From: Andrea Amorese Date: Tue, 1 Feb 2022 17:06:22 +0000 (+0100) Subject: Built motion from commit 74a1f83a.|2.5.49 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=fe7f3b15cff34e2ea746b2ab674b11e44a00be6b;p=motion2.git Built motion from commit 74a1f83a.|2.5.49 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6cb9ae5..8e7761c 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-02-01T16:18:00.067Z", + "time": "2022-02-01T16:52:59.173Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index d43a3b4..cd9a08d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-02-01T16:18:00.067Z", + "time": "2022-02-01T16:52:59.173Z", "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 c8c947b..b879fbf 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 _0xaf7e=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','getDataValue','STRING','contactManager','motionbar','bot','script','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[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]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaf7e,0xb9));var _0xeaf7=function(_0x13523a,_0x5f8049){_0x13523a=_0x13523a-0x0;var _0x13f0ba=_0xaf7e[_0x13523a];return _0x13f0ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5bba3b){return this[_0xeaf7('0x0')]('action');}},'action':{'type':Sequelize[_0xeaf7('0x1')],'allowNull':![],'validate':{'isIn':{'args':[[_0xeaf7('0x2'),'integration',_0xeaf7('0x3'),'jscripty','urlForward','browser',_0xeaf7('0x4'),_0xeaf7('0x5')]],'msg':_0xeaf7('0x6')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xeaf7('0x1')](0x1000),'comment':_0xeaf7('0x7')},'data2':{'type':Sequelize[_0xeaf7('0x1')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xeaf7('0x8')},'data4':{'type':Sequelize[_0xeaf7('0x1')](0x1000),'comments':_0xeaf7('0x9')},'data5':{'type':Sequelize[_0xeaf7('0x1')](0x1000),'comments':_0xeaf7('0xa')},'data6':{'type':Sequelize[_0xeaf7('0x1')],'comments':_0xeaf7('0xb')},'data7':{'type':Sequelize[_0xeaf7('0xc')],'comments':_0xeaf7('0xd')}}; \ No newline at end of file +var _0xc446=['integration','motionbar','jscripty','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x18ae2,_0x4228fb){var _0x5caedf=function(_0x5047a6){while(--_0x5047a6){_0x18ae2['push'](_0x18ae2['shift']());}};_0x5caedf(++_0x4228fb);}(_0xc446,0xd9));var _0x6c44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc446[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6c44('0x0'));module[_0x6c44('0x1')]={'name':{'type':Sequelize[_0x6c44('0x2')],'get':function(_0x5da724){return this[_0x6c44('0x3')](_0x6c44('0x4'));}},'action':{'type':Sequelize[_0x6c44('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6c44('0x6'),_0x6c44('0x7'),_0x6c44('0x8'),_0x6c44('0x9'),'urlForward','browser','bot',_0x6c44('0xa')]],'msg':_0x6c44('0xb')}},'comment':_0x6c44('0xb')},'data1':{'type':Sequelize[_0x6c44('0x5')](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[_0x6c44('0x5')](0x1000),'comment':_0x6c44('0xc')},'data4':{'type':Sequelize[_0x6c44('0x5')](0x1000),'comments':_0x6c44('0xd')},'data5':{'type':Sequelize[_0x6c44('0x5')](0x1000),'comments':_0x6c44('0xe')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x6c44('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 97c8006..430ef81 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 _0x9c7c=['then','error','stack','name','send','body','Action','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy'];(function(_0x302f5c,_0x214a42){var _0x4bfff9=function(_0xdf1f4b){while(--_0xdf1f4b){_0x302f5c['push'](_0x302f5c['shift']());}};_0x4bfff9(++_0x214a42);}(_0x9c7c,0xd1));var _0xc9c7=function(_0x3fba25,_0x495cbb){_0x3fba25=_0x3fba25-0x0;var _0x436f57=_0x9c7c[_0x3fba25];return _0x436f57;};'use strict';var emlformat=require(_0xc9c7('0x0'));var rimraf=require(_0xc9c7('0x1'));var zipdir=require(_0xc9c7('0x2'));var jsonpatch=require(_0xc9c7('0x3'));var rp=require(_0xc9c7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc9c7('0x5'));var util=require(_0xc9c7('0x6'));var path=require(_0xc9c7('0x7'));var sox=require(_0xc9c7('0x8'));var csv=require(_0xc9c7('0x9'));var ejs=require(_0xc9c7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9c7('0xb'));var squel=require(_0xc9c7('0xc'));var crypto=require(_0xc9c7('0xd'));var jsforce=require(_0xc9c7('0xe'));var deskjs=require(_0xc9c7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9c7('0x10'));var Papa=require(_0xc9c7('0x11'));var Redis=require(_0xc9c7('0x12'));var authService=require(_0xc9c7('0x13'));var qs=require(_0xc9c7('0x14'));var as=require(_0xc9c7('0x15'));var hardwareService=require(_0xc9c7('0x16'));var logger=require(_0xc9c7('0x17'))(_0xc9c7('0x18'));var utils=require('../../config/utils');var config=require(_0xc9c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9c7('0x1a'))['db'];function respondWithStatusCode(_0x43e8c5,_0xfdff96){_0xfdff96=_0xfdff96||0xcc;return function(_0x275581){if(_0x275581){return _0x43e8c5[_0xc9c7('0x1b')](_0xfdff96);}return _0x43e8c5['status'](_0xfdff96)[_0xc9c7('0x1c')]();};}function respondWithResult(_0x514852,_0x130929){_0x130929=_0x130929||0xc8;return function(_0x2c700d){if(_0x2c700d){return _0x514852[_0xc9c7('0x1d')](_0x130929)[_0xc9c7('0x1e')](_0x2c700d);}};}function respondWithFilteredResult(_0x1cd6ca,_0x26a398){return function(_0x15a750){if(_0x15a750){var _0x54e7b7=typeof _0x26a398[_0xc9c7('0x1f')]===_0xc9c7('0x20')&&typeof _0x26a398[_0xc9c7('0x21')]===_0xc9c7('0x20');var _0x11e303=_0x15a750['count'];var _0x273123=_0x54e7b7?0x0:_0x26a398['offset'];var _0x3ca40f=_0x54e7b7?_0x15a750[_0xc9c7('0x22')]:_0x26a398[_0xc9c7('0x1f')]+_0x26a398[_0xc9c7('0x21')];var _0x337ca4;if(_0x3ca40f>=_0x11e303){_0x3ca40f=_0x11e303;_0x337ca4=0xc8;}else{_0x337ca4=0xce;}_0x1cd6ca[_0xc9c7('0x1d')](_0x337ca4);return _0x1cd6ca[_0xc9c7('0x23')]('Content-Range',_0x273123+'-'+_0x3ca40f+'/'+_0x11e303)[_0xc9c7('0x1e')](_0x15a750);}return null;};}function patchUpdates(_0x12dc32){return function(_0x2e69d1){try{jsonpatch[_0xc9c7('0x24')](_0x2e69d1,_0x12dc32,!![]);}catch(_0xca70ef){return BPromise[_0xc9c7('0x25')](_0xca70ef);}return _0x2e69d1[_0xc9c7('0x26')]();};}function saveUpdates(_0x46d35d,_0x588ad7){return function(_0x888cef){if(_0x888cef){return _0x888cef[_0xc9c7('0x27')](_0x46d35d)['then'](function(_0x3dc483){return _0x3dc483;});}return null;};}function removeEntity(_0x5eb51f,_0x58218a){return function(_0x174e41){if(_0x174e41){return _0x174e41[_0xc9c7('0x28')]()[_0xc9c7('0x29')](function(){_0x5eb51f[_0xc9c7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8c07,_0x18d3ae){return function(_0x3b2fc2){if(!_0x3b2fc2){_0x5c8c07[_0xc9c7('0x1b')](0x194);}return _0x3b2fc2;};}function handleError(_0x4fd599,_0xc5a6ce){_0xc5a6ce=_0xc5a6ce||0x1f4;return function(_0xfd0b66){logger[_0xc9c7('0x2a')](_0xfd0b66[_0xc9c7('0x2b')]);if(_0xfd0b66[_0xc9c7('0x2c')]){delete _0xfd0b66['name'];}_0x4fd599['status'](_0xc5a6ce)[_0xc9c7('0x2d')](_0xfd0b66);};}exports[_0xc9c7('0x27')]=function(_0x34c827,_0x16da0c){if(_0x34c827['body']['id']){delete _0x34c827[_0xc9c7('0x2e')]['id'];}return db[_0xc9c7('0x2f')]['find']({'where':{'id':_0x34c827[_0xc9c7('0x30')]['id']}})['then'](handleEntityNotFound(_0x16da0c,null))[_0xc9c7('0x29')](saveUpdates(_0x34c827['body'],null))[_0xc9c7('0x29')](respondWithResult(_0x16da0c,null))[_0xc9c7('0x31')](handleError(_0x16da0c,null));};exports['destroy']=function(_0x32185f,_0x3ea1e5){return db['Action']['find']({'where':{'id':_0x32185f[_0xc9c7('0x30')]['id']}})[_0xc9c7('0x29')](handleEntityNotFound(_0x3ea1e5,null))['then'](removeEntity(_0x3ea1e5,null))[_0xc9c7('0x31')](handleError(_0x3ea1e5,null));}; \ No newline at end of file +var _0x2a3e=['status','set','Content-Range','json','apply','save','update','then','destroy','stack','name','body','find','params','catch','Action','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','end','offset','undefined','limit','count'];(function(_0x21d82d,_0x5a5533){var _0x2f2281=function(_0x26d373){while(--_0x26d373){_0x21d82d['push'](_0x21d82d['shift']());}};_0x2f2281(++_0x5a5533);}(_0x2a3e,0x190));var _0xe2a3=function(_0x1ae71f,_0x5e890f){_0x1ae71f=_0x1ae71f-0x0;var _0x17857e=_0x2a3e[_0x1ae71f];return _0x17857e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe2a3('0x0'));var jsonpatch=require(_0xe2a3('0x1'));var rp=require(_0xe2a3('0x2'));var moment=require(_0xe2a3('0x3'));var BPromise=require(_0xe2a3('0x4'));var Mustache=require(_0xe2a3('0x5'));var util=require('util');var path=require(_0xe2a3('0x6'));var sox=require(_0xe2a3('0x7'));var csv=require(_0xe2a3('0x8'));var ejs=require(_0xe2a3('0x9'));var fs=require('fs');var fs_extra=require(_0xe2a3('0xa'));var _=require(_0xe2a3('0xb'));var squel=require(_0xe2a3('0xc'));var crypto=require(_0xe2a3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe2a3('0xe'));var toCsv=require(_0xe2a3('0x8'));var querystring=require(_0xe2a3('0xf'));var Papa=require(_0xe2a3('0x10'));var Redis=require(_0xe2a3('0x11'));var authService=require(_0xe2a3('0x12'));var qs=require(_0xe2a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2a3('0x14'));var logger=require(_0xe2a3('0x15'))(_0xe2a3('0x16'));var utils=require(_0xe2a3('0x17'));var config=require(_0xe2a3('0x18'));var licenseUtil=require(_0xe2a3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8954,_0x2fab08){_0x2fab08=_0x2fab08||0xcc;return function(_0x27d751){if(_0x27d751){return _0x2f8954[_0xe2a3('0x1a')](_0x2fab08);}return _0x2f8954['status'](_0x2fab08)[_0xe2a3('0x1b')]();};}function respondWithResult(_0x218025,_0x2601bb){_0x2601bb=_0x2601bb||0xc8;return function(_0x3d164f){if(_0x3d164f){return _0x218025['status'](_0x2601bb)['json'](_0x3d164f);}};}function respondWithFilteredResult(_0x3bfe4e,_0x54b2da){return function(_0xd54c14){if(_0xd54c14){var _0x1ba01c=typeof _0x54b2da[_0xe2a3('0x1c')]===_0xe2a3('0x1d')&&typeof _0x54b2da[_0xe2a3('0x1e')]==='undefined';var _0x15f3d4=_0xd54c14[_0xe2a3('0x1f')];var _0x55c4e3=_0x1ba01c?0x0:_0x54b2da[_0xe2a3('0x1c')];var _0x33426f=_0x1ba01c?_0xd54c14[_0xe2a3('0x1f')]:_0x54b2da[_0xe2a3('0x1c')]+_0x54b2da['limit'];var _0x4a7a5d;if(_0x33426f>=_0x15f3d4){_0x33426f=_0x15f3d4;_0x4a7a5d=0xc8;}else{_0x4a7a5d=0xce;}_0x3bfe4e[_0xe2a3('0x20')](_0x4a7a5d);return _0x3bfe4e[_0xe2a3('0x21')](_0xe2a3('0x22'),_0x55c4e3+'-'+_0x33426f+'/'+_0x15f3d4)[_0xe2a3('0x23')](_0xd54c14);}return null;};}function patchUpdates(_0x2f99f2){return function(_0x20964e){try{jsonpatch[_0xe2a3('0x24')](_0x20964e,_0x2f99f2,!![]);}catch(_0x4b0dfe){return BPromise['reject'](_0x4b0dfe);}return _0x20964e[_0xe2a3('0x25')]();};}function saveUpdates(_0x488d15,_0x2b7ca1){return function(_0x528905){if(_0x528905){return _0x528905[_0xe2a3('0x26')](_0x488d15)[_0xe2a3('0x27')](function(_0x860202){return _0x860202;});}return null;};}function removeEntity(_0x7a1f01,_0x26ce83){return function(_0x4cf183){if(_0x4cf183){return _0x4cf183[_0xe2a3('0x28')]()[_0xe2a3('0x27')](function(){_0x7a1f01[_0xe2a3('0x20')](0xcc)[_0xe2a3('0x1b')]();});}};}function handleEntityNotFound(_0x69323c,_0x5e72f3){return function(_0x1dd728){if(!_0x1dd728){_0x69323c[_0xe2a3('0x1a')](0x194);}return _0x1dd728;};}function handleError(_0x542d2b,_0x2c2f3c){_0x2c2f3c=_0x2c2f3c||0x1f4;return function(_0x26d9f4){logger['error'](_0x26d9f4[_0xe2a3('0x29')]);if(_0x26d9f4[_0xe2a3('0x2a')]){delete _0x26d9f4[_0xe2a3('0x2a')];}_0x542d2b[_0xe2a3('0x20')](_0x2c2f3c)['send'](_0x26d9f4);};}exports['update']=function(_0x1d357c,_0x245e90){if(_0x1d357c[_0xe2a3('0x2b')]['id']){delete _0x1d357c[_0xe2a3('0x2b')]['id'];}return db['Action'][_0xe2a3('0x2c')]({'where':{'id':_0x1d357c[_0xe2a3('0x2d')]['id']}})[_0xe2a3('0x27')](handleEntityNotFound(_0x245e90,null))[_0xe2a3('0x27')](saveUpdates(_0x1d357c[_0xe2a3('0x2b')],null))['then'](respondWithResult(_0x245e90,null))[_0xe2a3('0x2e')](handleError(_0x245e90,null));};exports[_0xe2a3('0x28')]=function(_0x999cae,_0x496a2c){return db[_0xe2a3('0x2f')][_0xe2a3('0x2c')]({'where':{'id':_0x999cae[_0xe2a3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x496a2c,null))[_0xe2a3('0x27')](removeEntity(_0x496a2c,null))[_0xe2a3('0x2e')](handleError(_0x496a2c,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index c124309..1fd5d57 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 _0x4092=['./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xe442a6,_0x28b2e8){var _0x221d20=function(_0x44ea00){while(--_0x44ea00){_0xe442a6['push'](_0xe442a6['shift']());}};_0x221d20(++_0x28b2e8);}(_0x4092,0x64));var _0x2409=function(_0x968411,_0x151619){_0x968411=_0x968411-0x0;var _0x46e3e5=_0x4092[_0x968411];return _0x46e3e5;};'use strict';var _=require(_0x2409('0x0'));var util=require(_0x2409('0x1'));var logger=require(_0x2409('0x2'))(_0x2409('0x3'));var moment=require(_0x2409('0x4'));var BPromise=require(_0x2409('0x5'));var rp=require(_0x2409('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2409('0x7'));var config=require('../../config/environment');var attributes=require(_0x2409('0x8'));module[_0x2409('0x9')]=function(_0x1b3f02,_0x3056ca){return _0x1b3f02['define'](_0x2409('0xa'),attributes,{'tableName':_0x2409('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd94=['../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x42bea7,_0x16d1f3){var _0x418c2b=function(_0x495e00){while(--_0x495e00){_0x42bea7['push'](_0x42bea7['shift']());}};_0x418c2b(++_0x16d1f3);}(_0xdd94,0x18b));var _0x4dd9=function(_0x388d30,_0x2cdaf5){_0x388d30=_0x388d30-0x0;var _0x552806=_0xdd94[_0x388d30];return _0x552806;};'use strict';var _=require(_0x4dd9('0x0'));var util=require(_0x4dd9('0x1'));var logger=require(_0x4dd9('0x2'))('api');var moment=require(_0x4dd9('0x3'));var BPromise=require(_0x4dd9('0x4'));var rp=require(_0x4dd9('0x5'));var fs=require('fs');var path=require(_0x4dd9('0x6'));var rimraf=require(_0x4dd9('0x7'));var config=require(_0x4dd9('0x8'));var attributes=require(_0x4dd9('0x9'));module[_0x4dd9('0xa')]=function(_0x3847e8,_0x1917a6){return _0x3847e8[_0x4dd9('0xb')]('Action',attributes,{'tableName':_0x4dd9('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 a1a2a81..7893e33 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(_0x22e8ef,_0x38ed20){var _0x414f57=function(_0x1a9b30){while(--_0x1a9b30){_0x22e8ef['push'](_0x22e8ef['shift']());}};_0x414f57(++_0x38ed20);}(_0xe14b,0x93));var _0xbe14=function(_0x1e65c7,_0x89ce6d){_0x1e65c7=_0x1e65c7-0x0;var _0x183f1d=_0xe14b[_0x1e65c7];return _0x183f1d;};'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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'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')]('Action,\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']('Action,\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/action/index.js b/server/api/action/index.js index ce49365..1710912 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 _0x09fd=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x390bef,_0x2529d7){var _0x551e24=function(_0x61c72){while(--_0x61c72){_0x390bef['push'](_0x390bef['shift']());}};_0x551e24(++_0x2529d7);}(_0x09fd,0x14f));var _0xd09f=function(_0x584b56,_0x4cb1be){_0x584b56=_0x584b56-0x0;var _0x10cb37=_0x09fd[_0x584b56];return _0x10cb37;};'use strict';var multer=require('multer');var util=require(_0xd09f('0x0'));var path=require(_0xd09f('0x1'));var timeout=require(_0xd09f('0x2'));var express=require('express');var router=express[_0xd09f('0x3')]();var fs_extra=require(_0xd09f('0x4'));var auth=require(_0xd09f('0x5'));var interaction=require(_0xd09f('0x6'));var config=require(_0xd09f('0x7'));var controller=require('./action.controller');router['put'](_0xd09f('0x8'),auth[_0xd09f('0x9')](),controller[_0xd09f('0xa')]);router[_0xd09f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xd09f('0xc')]);module[_0xd09f('0xd')]=router; \ No newline at end of file +var _0xf74a=['exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','destroy'];(function(_0x53b7a2,_0x12f2fe){var _0x58d98d=function(_0xb4ccc9){while(--_0xb4ccc9){_0x53b7a2['push'](_0x53b7a2['shift']());}};_0x58d98d(++_0x12f2fe);}(_0xf74a,0x187));var _0xaf74=function(_0x5a0374,_0x486b25){_0x5a0374=_0x5a0374-0x0;var _0x92ee6f=_0xf74a[_0x5a0374];return _0x92ee6f;};'use strict';var multer=require('multer');var util=require(_0xaf74('0x0'));var path=require('path');var timeout=require(_0xaf74('0x1'));var express=require('express');var router=express[_0xaf74('0x2')]();var fs_extra=require(_0xaf74('0x3'));var auth=require(_0xaf74('0x4'));var interaction=require(_0xaf74('0x5'));var config=require(_0xaf74('0x6'));var controller=require('./action.controller');router[_0xaf74('0x7')](_0xaf74('0x8'),auth[_0xaf74('0x9')](),controller[_0xaf74('0xa')]);router['delete'](_0xaf74('0x8'),auth[_0xaf74('0x9')](),controller[_0xaf74('0xb')]);module[_0xaf74('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index dd13978..87b9d8e 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 _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x2fb9c6,_0x3b3de3){var _0x36e976=function(_0x3f172e){while(--_0x3f172e){_0x2fb9c6['push'](_0x2fb9c6['shift']());}};_0x36e976(++_0x3b3de3);}(_0xe14b,0x93));var _0xbe14=function(_0xc02d8a,_0x5356f4){_0xc02d8a=_0xc02d8a-0x0;var _0x4ff119=_0xe14b[_0xc02d8a];return _0x4ff119;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}}; \ No newline at end of file +var _0xdbf5=['exports','STRING','TEXT'];(function(_0x143f2d,_0x3f5293){var _0x156962=function(_0xcfbe61){while(--_0xcfbe61){_0x143f2d['push'](_0x143f2d['shift']());}};_0x156962(++_0x3f5293);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4fb8ad,_0x55b968){_0x4fb8ad=_0x4fb8ad-0x0;var _0x218d1c=_0xdbf5[_0x4fb8ad];return _0x218d1c;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index fec9ed7..d6dd61e 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 _0xd623=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','undefined','count','offset','set','apply','reject','destroy','then','get','CustomReports','end','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','field','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','sequelize','QueryTypes','SELECT','join','right_join','cross_join','MAX(%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','value','keyBy','from','groupBy','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','operator','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x2c2098,_0x5476f8){var _0x333ac0=function(_0x29c340){while(--_0x29c340){_0x2c2098['push'](_0x2c2098['shift']());}};_0x333ac0(++_0x5476f8);}(_0xd623,0x1f1));var _0x3d62=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xd623[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0x3d62('0x0'));var rimraf=require(_0x3d62('0x1'));var zipdir=require(_0x3d62('0x2'));var jsonpatch=require(_0x3d62('0x3'));var rp=require(_0x3d62('0x4'));var moment=require('moment');var BPromise=require(_0x3d62('0x5'));var Mustache=require(_0x3d62('0x6'));var util=require(_0x3d62('0x7'));var path=require(_0x3d62('0x8'));var sox=require(_0x3d62('0x9'));var csv=require(_0x3d62('0xa'));var ejs=require(_0x3d62('0xb'));var fs=require('fs');var fs_extra=require(_0x3d62('0xc'));var _=require(_0x3d62('0xd'));var squel=require(_0x3d62('0xe'));var crypto=require(_0x3d62('0xf'));var jsforce=require(_0x3d62('0x10'));var deskjs=require(_0x3d62('0x11'));var toCsv=require(_0x3d62('0xa'));var querystring=require(_0x3d62('0x12'));var Papa=require(_0x3d62('0x13'));var Redis=require(_0x3d62('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x3d62('0x15'));var as=require(_0x3d62('0x16'));var hardwareService=require(_0x3d62('0x17'));var logger=require(_0x3d62('0x18'))('api');var utils=require(_0x3d62('0x19'));var config=require(_0x3d62('0x1a'));var licenseUtil=require(_0x3d62('0x1b'));var db=require(_0x3d62('0x1c'))['db'];var dbH=require(_0x3d62('0x1c'))[_0x3d62('0x1d')];function respondWithStatusCode(_0x862da3,_0x1da3a0){_0x1da3a0=_0x1da3a0||0xcc;return function(_0x146a0f){if(_0x146a0f){return _0x862da3[_0x3d62('0x1e')](_0x1da3a0);}return _0x862da3[_0x3d62('0x1f')](_0x1da3a0)['end']();};}function respondWithResult(_0x5e6883,_0x3a980e){_0x3a980e=_0x3a980e||0xc8;return function(_0x2ffbd9){if(_0x2ffbd9){return _0x5e6883[_0x3d62('0x1f')](_0x3a980e)[_0x3d62('0x20')](_0x2ffbd9);}};}function respondWithFilteredResult(_0x3930d9,_0x2bd592){return function(_0x44aa42){if(_0x44aa42){var _0x32d76e=typeof _0x2bd592['offset']===_0x3d62('0x21')&&typeof _0x2bd592['limit']==='undefined';var _0xb79058=_0x44aa42[_0x3d62('0x22')];var _0x20a9b3=_0x32d76e?0x0:_0x2bd592[_0x3d62('0x23')];var _0x2d9fb5=_0x32d76e?_0x44aa42[_0x3d62('0x22')]:_0x2bd592[_0x3d62('0x23')]+_0x2bd592['limit'];var _0xf3ee62;if(_0x2d9fb5>=_0xb79058){_0x2d9fb5=_0xb79058;_0xf3ee62=0xc8;}else{_0xf3ee62=0xce;}_0x3930d9[_0x3d62('0x1f')](_0xf3ee62);return _0x3930d9[_0x3d62('0x24')]('Content-Range',_0x20a9b3+'-'+_0x2d9fb5+'/'+_0xb79058)[_0x3d62('0x20')](_0x44aa42);}return null;};}function patchUpdates(_0x4e82ca){return function(_0x518661){try{jsonpatch[_0x3d62('0x25')](_0x518661,_0x4e82ca,!![]);}catch(_0xeb1f44){return BPromise[_0x3d62('0x26')](_0xeb1f44);}return _0x518661['save']();};}function saveUpdates(_0x5470db,_0x12f985){return function(_0xd2d486){if(_0xd2d486){return _0xd2d486['update'](_0x5470db)['then'](function(_0x55b1c5){return _0x55b1c5;});}return null;};}function removeEntity(_0x4013f3,_0x111089){return function(_0x422d44){if(_0x422d44){return _0x422d44[_0x3d62('0x27')]()[_0x3d62('0x28')](function(){var _0x1d01cd=_0x422d44[_0x3d62('0x29')]({'plain':!![]});var _0x4d12db=_0x3d62('0x2a');return db['UserProfileResource'][_0x3d62('0x27')]({'where':{'type':_0x4d12db,'resourceId':_0x1d01cd['id']}})['then'](function(){return _0x422d44;});})[_0x3d62('0x28')](function(){_0x4013f3['status'](0xcc)[_0x3d62('0x2b')]();});}};}function handleEntityNotFound(_0x2a83e5,_0x3fa5b){return function(_0x1f1849){if(!_0x1f1849){_0x2a83e5[_0x3d62('0x1e')](0x194);}return _0x1f1849;};}function handleError(_0x5ca947,_0x5071dd){_0x5071dd=_0x5071dd||0x1f4;return function(_0x41e330){logger[_0x3d62('0x2c')](_0x41e330[_0x3d62('0x2d')]);if(_0x41e330[_0x3d62('0x2e')]){delete _0x41e330[_0x3d62('0x2e')];}_0x5ca947[_0x3d62('0x1f')](_0x5071dd)[_0x3d62('0x2f')](_0x41e330);};}exports['index']=function(_0x179232,_0x893ede){var _0x522579={},_0x2cfb69={},_0x5b3845={'count':0x0,'rows':[]};var _0x2a37e8=_[_0x3d62('0x30')](db[_0x3d62('0x31')][_0x3d62('0x32')],function(_0x2b5ee8){return{'name':_0x2b5ee8[_0x3d62('0x33')],'type':_0x2b5ee8[_0x3d62('0x34')][_0x3d62('0x35')]};});_0x2cfb69[_0x3d62('0x36')]=_['map'](_0x2a37e8,_0x3d62('0x2e'));_0x2cfb69[_0x3d62('0x37')]=_[_0x3d62('0x38')](_0x179232[_0x3d62('0x37')]);_0x2cfb69[_0x3d62('0x39')]=_[_0x3d62('0x3a')](_0x2cfb69['model'],_0x2cfb69[_0x3d62('0x37')]);_0x522579[_0x3d62('0x3b')]=_[_0x3d62('0x3a')](_0x2cfb69[_0x3d62('0x36')],qs['fields'](_0x179232[_0x3d62('0x37')][_0x3d62('0x3c')]));_0x522579[_0x3d62('0x3b')]=_0x522579['attributes'][_0x3d62('0x3d')]?_0x522579[_0x3d62('0x3b')]:_0x2cfb69[_0x3d62('0x36')];if(!_0x179232[_0x3d62('0x37')][_0x3d62('0x3e')](_0x3d62('0x3f'))){_0x522579[_0x3d62('0x40')]=qs[_0x3d62('0x40')](_0x179232[_0x3d62('0x37')][_0x3d62('0x40')]);_0x522579[_0x3d62('0x23')]=qs['offset'](_0x179232['query'][_0x3d62('0x23')]);}_0x522579[_0x3d62('0x41')]=qs[_0x3d62('0x42')](_0x179232[_0x3d62('0x37')][_0x3d62('0x42')]);_0x522579[_0x3d62('0x43')]=qs[_0x3d62('0x39')](_[_0x3d62('0x44')](_0x179232[_0x3d62('0x37')],_0x2cfb69['filters']),_0x2a37e8);if(_0x179232['query']['filter']){_0x522579[_0x3d62('0x43')]=_[_0x3d62('0x45')](_0x522579[_0x3d62('0x43')],{'$or':_[_0x3d62('0x30')](_0x2a37e8,function(_0x335eb5){if(_0x335eb5[_0x3d62('0x34')]!=='VIRTUAL'){var _0xdbb2e4={};_0xdbb2e4[_0x335eb5['name']]={'$like':'%'+_0x179232[_0x3d62('0x37')][_0x3d62('0x46')]+'%'};return _0xdbb2e4;}})});}_0x522579=_[_0x3d62('0x45')]({},_0x522579,_0x179232[_0x3d62('0x47')]);var _0x4621b7={'where':_0x522579[_0x3d62('0x43')]};return db[_0x3d62('0x31')][_0x3d62('0x22')](_0x4621b7)[_0x3d62('0x28')](function(_0x39681f){_0x5b3845[_0x3d62('0x22')]=_0x39681f;if(_0x179232[_0x3d62('0x37')][_0x3d62('0x48')]){_0x522579[_0x3d62('0x49')]=[{'all':!![]}];}return db[_0x3d62('0x31')][_0x3d62('0x4a')](_0x522579);})[_0x3d62('0x28')](function(_0x4d8ea9){_0x5b3845[_0x3d62('0x4b')]=_0x4d8ea9;return _0x5b3845;})[_0x3d62('0x28')](respondWithFilteredResult(_0x893ede,_0x522579))[_0x3d62('0x4c')](handleError(_0x893ede,null));};exports['show']=function(_0x5a563b,_0x5333ab){var _0x4cccb7={'raw':![],'where':{'id':_0x5a563b['params']['id']}},_0x1ff0c8={};_0x1ff0c8['model']=_[_0x3d62('0x38')](db[_0x3d62('0x31')][_0x3d62('0x32')]);_0x1ff0c8[_0x3d62('0x37')]=_[_0x3d62('0x38')](_0x5a563b[_0x3d62('0x37')]);_0x1ff0c8[_0x3d62('0x39')]=_[_0x3d62('0x3a')](_0x1ff0c8[_0x3d62('0x36')],_0x1ff0c8[_0x3d62('0x37')]);_0x4cccb7['attributes']=_[_0x3d62('0x3a')](_0x1ff0c8[_0x3d62('0x36')],qs[_0x3d62('0x3c')](_0x5a563b[_0x3d62('0x37')]['fields']));_0x4cccb7[_0x3d62('0x3b')]=_0x4cccb7[_0x3d62('0x3b')][_0x3d62('0x3d')]?_0x4cccb7[_0x3d62('0x3b')]:_0x1ff0c8[_0x3d62('0x36')];if(_0x5a563b['query']['includeAll']){_0x4cccb7[_0x3d62('0x49')]=[{'all':!![]}];}_0x4cccb7=_[_0x3d62('0x45')]({},_0x4cccb7,_0x5a563b[_0x3d62('0x47')]);return db[_0x3d62('0x31')][_0x3d62('0x4d')](_0x4cccb7)[_0x3d62('0x28')](handleEntityNotFound(_0x5333ab,null))[_0x3d62('0x28')](respondWithResult(_0x5333ab,null))['catch'](handleError(_0x5333ab,null));};exports['create']=function(_0x353915,_0x2a5390){return db[_0x3d62('0x31')][_0x3d62('0x4e')](_0x353915[_0x3d62('0x4f')],{})[_0x3d62('0x28')](function(_0x1977e7){var _0x46a88f=_0x353915[_0x3d62('0x50')][_0x3d62('0x29')]({'plain':!![]});if(!_0x46a88f)throw new Error(_0x3d62('0x51'));if(_0x46a88f['role']==='user'){var _0x3a72d7=_0x1977e7['get']({'plain':!![]});var _0x55d500=_0x3d62('0x52');return db[_0x3d62('0x53')]['find']({'where':{'name':_0x55d500,'userProfileId':_0x46a88f['userProfileId']},'raw':!![]})[_0x3d62('0x28')](function(_0x30add8){if(_0x30add8&&_0x30add8['autoAssociation']===0x0){return db[_0x3d62('0x54')][_0x3d62('0x4e')]({'name':_0x3a72d7[_0x3d62('0x2e')],'resourceId':_0x3a72d7['id'],'type':_0x3d62('0x2a'),'sectionId':_0x30add8['id']},{})[_0x3d62('0x28')](function(){return _0x1977e7;});}else{return _0x1977e7;}})[_0x3d62('0x4c')](function(_0x33d0d7){logger['error'](_0x3d62('0x55'),_0x33d0d7);throw _0x33d0d7;});}return _0x1977e7;})['then'](respondWithResult(_0x2a5390,0xc9))[_0x3d62('0x4c')](handleError(_0x2a5390,null));};exports[_0x3d62('0x56')]=function(_0x2db268,_0x40a757){if(_0x2db268[_0x3d62('0x4f')]['id']){delete _0x2db268[_0x3d62('0x4f')]['id'];}return db[_0x3d62('0x31')][_0x3d62('0x4d')]({'where':{'id':_0x2db268[_0x3d62('0x57')]['id']}})[_0x3d62('0x28')](handleEntityNotFound(_0x40a757,null))[_0x3d62('0x28')](saveUpdates(_0x2db268[_0x3d62('0x4f')],null))[_0x3d62('0x28')](respondWithResult(_0x40a757,null))[_0x3d62('0x4c')](handleError(_0x40a757,null));};exports[_0x3d62('0x27')]=function(_0x522d17,_0x4d4779){return db[_0x3d62('0x31')][_0x3d62('0x4d')]({'where':{'id':_0x522d17[_0x3d62('0x57')]['id']}})[_0x3d62('0x28')](handleEntityNotFound(_0x4d4779,null))[_0x3d62('0x28')](removeEntity(_0x4d4779,null))['catch'](handleError(_0x4d4779,null));};exports[_0x3d62('0x58')]=function(_0x24c536,_0x437e86){var _0x311089=0xa;var _0x12e7a3=['join',_0x3d62('0x59'),'right_join','cross_join'];var _0x3b6f7b={'SUM':_0x3d62('0x5a'),'COUNT':_0x3d62('0x5b'),'COUNT DISTINCT':_0x3d62('0x5c'),'MAX':'MAX(%s)','MIN':_0x3d62('0x5d'),'AVG':_0x3d62('0x5e'),'GROUP_CONCAT':_0x3d62('0x5f'),'GROUP_CONCAT ASC':_0x3d62('0x60'),'GROUP_CONCAT DESC':_0x3d62('0x61')};var _0xd1b9b9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3d62('0x62'),'HOUR':_0x3d62('0x63'),'ROUND':_0x3d62('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5cbcb0=function(_0xe58b8a){return!_[_0x3d62('0x65')](['IS\x20NULL',_0x3d62('0x66'),_0x3d62('0x67'),'IS\x20NOT\x20EMPTY'],_0xe58b8a);};var _0x543404=function(_0x183eda){if(!_0x183eda||!_0x183eda[_0x3d62('0x68')]['length']){return'';}for(var _0x1555c0='(',_0x3f6dd0=0x0;_0x3f6dd0<_0x183eda[_0x3d62('0x68')][_0x3d62('0x3d')];_0x3f6dd0+=0x1){_0x3f6dd0>0x0&&(_0x1555c0+='\x20'+_0x183eda['operator']+'\x20');_0x1555c0+=_0x183eda['rules'][_0x3f6dd0][_0x3d62('0x69')]?_0x543404(_0x183eda[_0x3d62('0x68')][_0x3f6dd0][_0x3d62('0x69')]):_0x183eda[_0x3d62('0x68')][_0x3f6dd0]['field']+'\x20'+_0x183eda[_0x3d62('0x68')][_0x3f6dd0][_0x3d62('0x6a')]+(_0x5cbcb0(_0x183eda['rules'][_0x3f6dd0][_0x3d62('0x6a')])?'\x20'+_0x183eda[_0x3d62('0x68')][_0x3f6dd0]['value']:'');}return _0x1555c0+')';};var _0x265243={'where':{'id':_0x24c536['params']['id']}},_0x294881,_0x5d7586,_0x26bf48,_0x3424f4,_0xb9a7a0;_0x265243=_[_0x3d62('0x45')]({},_0x265243,_0x24c536[_0x3d62('0x47')]);return db[_0x3d62('0x31')][_0x3d62('0x4d')](_0x265243)[_0x3d62('0x28')](function(_0x34b2f5){if(_0x34b2f5){_0x294881=_0x34b2f5;return _0x34b2f5[_0x3d62('0x6b')]();}return null;})[_0x3d62('0x28')](function(_0x5960b1){if(_0x5960b1){if(!_0x5960b1[_0x3d62('0x3d')]){throw new db[(_0x3d62('0x6c'))][(_0x3d62('0x6d'))](_0x3d62('0x6e'),0x193);}_0x5d7586=_0x5960b1;return db[_0x3d62('0x6f')][_0x3d62('0x4a')]({'raw':!![]});}return null;})[_0x3d62('0x28')](function(_0xecedbd){if(_0xecedbd){_0x26bf48=_['keyBy'](_0xecedbd,'id');var _0x1f567c;var _0x1425a5=squel[_0x3d62('0x70')]();_0x1425a5['from'](_0x294881[_0x3d62('0x71')]);for(var _0x51aa62=0x0;_0x51aa62<_0x5d7586[_0x3d62('0x3d')];_0x51aa62+=0x1){_0x1f567c=_0x5d7586[_0x51aa62]['MetricId']?_0x26bf48[_0x5d7586[_0x51aa62][_0x3d62('0x72')]]['metric']:_0x5d7586[_0x51aa62][_0x3d62('0x73')];_0x1f567c=_0x5d7586[_0x51aa62][_0x3d62('0x74')]?_['replace'](_0x3b6f7b[_0x5d7586[_0x51aa62]['function']],'%s',_0x1f567c):_0x1f567c;_0x1f567c=_0x5d7586[_0x51aa62][_0x3d62('0x75')]?_[_0x3d62('0x76')](_0xd1b9b9[_0x5d7586[_0x51aa62][_0x3d62('0x75')]],'%s',_0x1f567c):_0x1f567c;if(_0x5d7586[_0x51aa62]['groupBy']){_0x1425a5[_0x3d62('0x69')](_0x1f567c);}_0x5d7586[_0x51aa62]['orderBy']&&_0x1425a5[_0x3d62('0x41')](_0x1f567c,_0x5d7586[_0x51aa62][_0x3d62('0x77')]===_0x3d62('0x78')?![]:!![]);_0x1425a5[_0x3d62('0x73')](_0x1f567c,_0x5d7586[_0x51aa62][_0x3d62('0x79')]||_0x1f567c);}if(_0x294881[_0x3d62('0x7a')]){_0x294881[_0x3d62('0x7a')]=JSON[_0x3d62('0x7b')](_0x294881['joins']);for(var _0x2170b9=0x0;_0x2170b9<_0x294881[_0x3d62('0x7a')][_0x3d62('0x3d')];_0x2170b9+=0x1){if(_0x294881[_0x3d62('0x7a')][_0x2170b9][_0x3d62('0x34')]&&_[_0x3d62('0x65')](_0x12e7a3,_0x294881['joins'][_0x2170b9][_0x3d62('0x34')])&&_0x294881[_0x3d62('0x7a')][_0x2170b9][_0x3d62('0x7c')]&&_0x294881[_0x3d62('0x7a')][_0x2170b9][_0x3d62('0x7d')]&&_0x294881['joins'][_0x2170b9][_0x3d62('0x7e')]){_0x1425a5[_0x294881['joins'][_0x2170b9][_0x3d62('0x34')]](_0x294881[_0x3d62('0x7a')][_0x2170b9][_0x3d62('0x7d')],null,util['format'](_0x3d62('0x7f'),_0x294881['table'],_0x294881[_0x3d62('0x7a')][_0x2170b9][_0x3d62('0x7c')],_0x294881[_0x3d62('0x7a')][_0x2170b9][_0x3d62('0x7d')],_0x294881[_0x3d62('0x7a')][_0x2170b9]['foreignKey']));}}}if(_0x294881[_0x3d62('0x80')]){_0x294881[_0x3d62('0x80')]=JSON[_0x3d62('0x7b')](_0x294881[_0x3d62('0x80')]);_0x1425a5[_0x3d62('0x43')](_0x543404(_0x294881['conditions'][_0x3d62('0x69')]));}_0xb9a7a0=_0x1425a5['clone']();_0x1425a5[_0x3d62('0x40')](_0x311089);_0x1425a5[_0x3d62('0x23')](0x0);logger[_0x3d62('0x81')]('Limited\x20Query:',_0x1425a5['toString']());return dbH[_0x3d62('0x82')][_0x3d62('0x37')](_0x1425a5['toString'](),{'type':dbH[_0x3d62('0x82')][_0x3d62('0x83')][_0x3d62('0x84')]});}})['then'](respondWithResult(_0x437e86,null))[_0x3d62('0x4c')](handleError(_0x437e86,null));};function runReport(_0x16061c,_0x4e6d2c,_0x3e89d8){var _0x5e5cba=_0x4e6d2c[_0x3d62('0x2e')];var _0x1e06a1=0xa;var _0x381bbd=[_0x3d62('0x85'),'left_join',_0x3d62('0x86'),_0x3d62('0x87')];var _0x462fcf={'SUM':_0x3d62('0x5a'),'COUNT':_0x3d62('0x5b'),'COUNT DISTINCT':_0x3d62('0x5c'),'MAX':_0x3d62('0x88'),'MIN':'MIN(%s)','AVG':_0x3d62('0x5e'),'GROUP_CONCAT':_0x3d62('0x5f'),'GROUP_CONCAT ASC':_0x3d62('0x60'),'GROUP_CONCAT DESC':_0x3d62('0x61')};var _0x1ded2c={'SEC_TO_TIME':_0x3d62('0x89'),'DATE':_0x3d62('0x62'),'HOUR':_0x3d62('0x63'),'ROUND':_0x3d62('0x64'),'UNIX_TIMESTAMP':_0x3d62('0x8a')};var _0x1a11bf=function(_0x42ca98){return!_[_0x3d62('0x65')]([_0x3d62('0x8b'),'IS\x20NOT\x20NULL',_0x3d62('0x67'),_0x3d62('0x8c')],_0x42ca98);};var _0x14e669=function(_0x1a2390){if(!_0x1a2390||!_0x1a2390[_0x3d62('0x68')][_0x3d62('0x3d')]){return'';}for(var _0x52c69b='(',_0x36da25=0x0;_0x36da25<_0x1a2390[_0x3d62('0x68')]['length'];_0x36da25+=0x1){_0x36da25>0x0&&(_0x52c69b+='\x20'+_0x1a2390['operator']+'\x20');_0x52c69b+=_0x1a2390['rules'][_0x36da25]['group']?_0x14e669(_0x1a2390[_0x3d62('0x68')][_0x36da25][_0x3d62('0x69')]):_0x1a2390['rules'][_0x36da25][_0x3d62('0x73')]+'\x20'+_0x1a2390[_0x3d62('0x68')][_0x36da25]['condition']+(_0x1a11bf(_0x1a2390[_0x3d62('0x68')][_0x36da25][_0x3d62('0x6a')])?'\x20'+_0x1a2390[_0x3d62('0x68')][_0x36da25][_0x3d62('0x8d')]:'');}return _0x52c69b+')';};var _0x93ee99={'where':{'id':_0x16061c['id']}},_0x4d45b1,_0x117da2,_0x37eb18,_0x4ba549,_0x3e80a4;_0x93ee99=_['merge']({},_0x93ee99,_0x3e89d8);return db[_0x3d62('0x31')][_0x3d62('0x4d')](_0x93ee99)[_0x3d62('0x28')](function(_0x2dd325){if(_0x2dd325){_0x4d45b1=_0x2dd325;return _0x2dd325[_0x3d62('0x6b')]();}return null;})['then'](function(_0x357963){if(_0x357963){if(!_0x357963['length']){throw new db['Sequelize'][(_0x3d62('0x6d'))](_0x3d62('0x6e'),0x193);}_0x117da2=_0x357963;return db['AnalyticMetric'][_0x3d62('0x4a')]({'raw':!![]});}return null;})[_0x3d62('0x28')](function(_0x89d7f1){if(_0x89d7f1){_0x37eb18=_[_0x3d62('0x8e')](_0x89d7f1,'id');var _0x582bdd;var _0x2850aa=squel[_0x3d62('0x70')]();_0x2850aa[_0x3d62('0x8f')](_0x4d45b1[_0x3d62('0x71')]);for(var _0x5a486a=0x0;_0x5a486a<_0x117da2['length'];_0x5a486a+=0x1){_0x582bdd=_0x117da2[_0x5a486a][_0x3d62('0x72')]?_0x37eb18[_0x117da2[_0x5a486a][_0x3d62('0x72')]]['metric']:_0x117da2[_0x5a486a][_0x3d62('0x73')];_0x582bdd=_0x117da2[_0x5a486a][_0x3d62('0x74')]?_[_0x3d62('0x76')](_0x462fcf[_0x117da2[_0x5a486a]['function']],'%s',_0x582bdd):_0x582bdd;_0x582bdd=_0x117da2[_0x5a486a][_0x3d62('0x75')]?_['replace'](_0x1ded2c[_0x117da2[_0x5a486a][_0x3d62('0x75')]],'%s',_0x582bdd):_0x582bdd;if(_0x117da2[_0x5a486a][_0x3d62('0x90')]){_0x2850aa[_0x3d62('0x69')](_0x582bdd);}_0x117da2[_0x5a486a]['orderBy']&&_0x2850aa[_0x3d62('0x41')](_0x582bdd,_0x117da2[_0x5a486a]['orderBy']===_0x3d62('0x78')?![]:!![]);_0x2850aa['field'](_0x582bdd,_0x117da2[_0x5a486a][_0x3d62('0x79')]||_0x582bdd);}if(_0x4d45b1['joins']){_0x4d45b1[_0x3d62('0x7a')]=JSON['parse'](_0x4d45b1[_0x3d62('0x7a')]);for(var _0x559abe=0x0;_0x559abe<_0x4d45b1[_0x3d62('0x7a')][_0x3d62('0x3d')];_0x559abe+=0x1){if(_0x4d45b1[_0x3d62('0x7a')][_0x559abe][_0x3d62('0x34')]&&_[_0x3d62('0x65')](_0x381bbd,_0x4d45b1['joins'][_0x559abe]['type'])&&_0x4d45b1[_0x3d62('0x7a')][_0x559abe][_0x3d62('0x7c')]&&_0x4d45b1[_0x3d62('0x7a')][_0x559abe][_0x3d62('0x7d')]&&_0x4d45b1['joins'][_0x559abe][_0x3d62('0x7e')]){_0x2850aa[_0x4d45b1[_0x3d62('0x7a')][_0x559abe][_0x3d62('0x34')]](_0x4d45b1[_0x3d62('0x7a')][_0x559abe]['foreignTable'],null,util[_0x3d62('0x75')](_0x3d62('0x7f'),_0x4d45b1['table'],_0x4d45b1[_0x3d62('0x7a')][_0x559abe]['parentKey'],_0x4d45b1[_0x3d62('0x7a')][_0x559abe][_0x3d62('0x7d')],_0x4d45b1[_0x3d62('0x7a')][_0x559abe][_0x3d62('0x7e')]));}}}if(_0x4d45b1[_0x3d62('0x80')]){_0x4d45b1['conditions']=JSON[_0x3d62('0x7b')](_0x4d45b1['conditions']);_0x2850aa[_0x3d62('0x43')](_0x14e669(_0x4d45b1[_0x3d62('0x80')]['group']));}_0x3e80a4=_0x2850aa[_0x3d62('0x91')]();_0x2850aa[_0x3d62('0x40')](_0x1e06a1);_0x2850aa[_0x3d62('0x23')](0x0);return;}})[_0x3d62('0x28')](function(){if(_0x4e6d2c[_0x3d62('0x92')]===_0x3d62('0x93')){return null;}var _0x111e6a=_[_0x3d62('0x45')](_0x4e6d2c,{'name':_0x4e6d2c[_0x3d62('0x94')]||_0x4e6d2c[_0x3d62('0x2e')]||_0x4d45b1[_0x3d62('0x2e')],'basename':_0x5e5cba,'savename':util['format'](_0x3d62('0x95'),_0x4e6d2c[_0x3d62('0x2e')]||_0x4d45b1[_0x3d62('0x2e')],require(_0x3d62('0x96'))[_0x3d62('0x97')](0x4),_0x4e6d2c[_0x3d62('0x92')]||_0x3d62('0x98')),'reportId':_0x4d45b1['id'],'reportType':_0x3d62('0x99')});return db['AnalyticExtractedReport'][_0x3d62('0x4e')](_0x111e6a,{'raw':!![]});})[_0x3d62('0x28')](function(_0xc31892){if(_0x4d45b1[_0x3d62('0x71')]===_0x3d62('0x9a')){_0x3e80a4['where'](_0x4d45b1['table']+_0x3d62('0x9b'),_0x4e6d2c['startDate'],_0x4e6d2c[_0x3d62('0x9c')]);}else{_0x3e80a4[_0x3d62('0x43')](_0x4d45b1[_0x3d62('0x71')]+_0x3d62('0x9d'),_0x4e6d2c[_0x3d62('0x9e')],_0x4e6d2c['endDate']);}if(_0xc31892){logger['info']('Run\x20Query:',_0x3e80a4[_0x3d62('0x9f')]());require(_0x3d62('0xa0'))[_0x3d62('0xa1')](path[_0x3d62('0x85')](__dirname,_0x3d62('0xa2'),_0xc31892['output']),[_0xc31892['id'],_0x3e80a4[_0x3d62('0x9f')](),path[_0x3d62('0x85')](__dirname,_0x3d62('0xa3'),_0xc31892[_0x3d62('0xa4')]),_0x5e5cba]);return _0xc31892;}else{var _0x3239df=squel[_0x3d62('0x70')]();_0x3239df[_0x3d62('0x8f')]('('+_0x3e80a4['toString']()+')',_0x3d62('0xa5'));_0x3239df[_0x3d62('0x73')]('COUNT(*)',_0x3d62('0x22'));_0x3e80a4['limit'](_0x4e6d2c[_0x3d62('0x40')]||_0x1e06a1);_0x3e80a4[_0x3d62('0x23')](_0x4e6d2c[_0x3d62('0x23')]||0x0);return dbH[_0x3d62('0x82')][_0x3d62('0x37')](_0x3239df[_0x3d62('0x9f')](),{'type':dbH[_0x3d62('0x82')][_0x3d62('0x83')][_0x3d62('0x84')]})['then'](function(_0x28ccbc){if(!_0x28ccbc[_0x3d62('0x3d')]){_0x4ba549=0x0;}else{_0x4ba549=_0x28ccbc[0x0][_0x3d62('0x22')]||0x0;}return dbH[_0x3d62('0x82')][_0x3d62('0x37')](_0x3e80a4['toString'](),{'type':dbH['sequelize'][_0x3d62('0x83')]['SELECT']});})[_0x3d62('0x28')](function(_0x25b042){return{'rows':_0x25b042||[],'count':_0x4ba549};});}});}exports[_0x3d62('0xa6')]=function(_0xe889b1,_0x2c8558){return runReport(_0xe889b1['params'],_0xe889b1[_0x3d62('0x37')],_0xe889b1[_0x3d62('0x47')])[_0x3d62('0x28')](respondWithResult(_0x2c8558,null))[_0x3d62('0x4c')](handleError(_0x2c8558,null));};exports['runReport']=runReport;exports[_0x3d62('0x37')]=function(_0x8a2ac,_0x16b37c){var _0x2c979d=0xa;var _0x179e22=[_0x3d62('0x85'),_0x3d62('0x59'),_0x3d62('0x86'),'cross_join'];var _0x3b859b={'SUM':_0x3d62('0x5a'),'COUNT':_0x3d62('0x5b'),'COUNT DISTINCT':_0x3d62('0x5c'),'MAX':'MAX(%s)','MIN':_0x3d62('0x5d'),'AVG':_0x3d62('0x5e'),'GROUP_CONCAT':_0x3d62('0x5f'),'GROUP_CONCAT ASC':_0x3d62('0x60'),'GROUP_CONCAT DESC':_0x3d62('0x61')};var _0x5d478c={'SEC_TO_TIME':_0x3d62('0x89'),'DATE':_0x3d62('0x62'),'HOUR':_0x3d62('0x63'),'ROUND':_0x3d62('0x64'),'UNIX_TIMESTAMP':_0x3d62('0x8a')};var _0x5e10f3=function(_0x465f40){return!_[_0x3d62('0x65')]([_0x3d62('0x8b'),_0x3d62('0x66'),_0x3d62('0x67'),_0x3d62('0x8c')],_0x465f40);};var _0xea644d=function(_0x2c0a1f){if(!_0x2c0a1f||!_0x2c0a1f['rules']['length']){return'';}for(var _0x474201='(',_0x2502e9=0x0;_0x2502e9<_0x2c0a1f[_0x3d62('0x68')][_0x3d62('0x3d')];_0x2502e9+=0x1){_0x2502e9>0x0&&(_0x474201+='\x20'+_0x2c0a1f[_0x3d62('0xa7')]+'\x20');_0x474201+=_0x2c0a1f['rules'][_0x2502e9][_0x3d62('0x69')]?_0xea644d(_0x2c0a1f['rules'][_0x2502e9]['group']):_0x2c0a1f[_0x3d62('0x68')][_0x2502e9][_0x3d62('0x73')]+'\x20'+_0x2c0a1f[_0x3d62('0x68')][_0x2502e9]['condition']+(_0x5e10f3(_0x2c0a1f[_0x3d62('0x68')][_0x2502e9][_0x3d62('0x6a')])?'\x20'+_0x2c0a1f[_0x3d62('0x68')][_0x2502e9][_0x3d62('0x8d')]:'');}return _0x474201+')';};var _0x3e31be={'where':{'id':_0x8a2ac[_0x3d62('0x57')]['id']}},_0x561adf,_0x2a1bb0,_0xd241ea,_0x7abeef,_0x354c55;_0x3e31be=_[_0x3d62('0x45')]({},_0x3e31be,_0x8a2ac['options']);return db['AnalyticCustomReport']['find'](_0x3e31be)[_0x3d62('0x28')](function(_0x2a90f7){if(_0x2a90f7){_0x561adf=_0x2a90f7;return _0x2a90f7['getFields']();}return null;})[_0x3d62('0x28')](function(_0x505bba){if(_0x505bba){if(!_0x505bba[_0x3d62('0x3d')]){throw new db[(_0x3d62('0x6c'))][(_0x3d62('0x6d'))](_0x3d62('0x6e'),0x193);}_0x2a1bb0=_0x505bba;return db['AnalyticMetric'][_0x3d62('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x220438){if(_0x220438){_0xd241ea=_[_0x3d62('0x8e')](_0x220438,'id');var _0x9bb3ef;var _0x1134fe=squel[_0x3d62('0x70')]();_0x1134fe[_0x3d62('0x8f')](_0x561adf[_0x3d62('0x71')]);for(var _0x452c39=0x0;_0x452c39<_0x2a1bb0[_0x3d62('0x3d')];_0x452c39+=0x1){_0x9bb3ef=_0x2a1bb0[_0x452c39][_0x3d62('0x72')]?_0xd241ea[_0x2a1bb0[_0x452c39][_0x3d62('0x72')]][_0x3d62('0xa8')]:_0x2a1bb0[_0x452c39][_0x3d62('0x73')];_0x9bb3ef=_0x2a1bb0[_0x452c39][_0x3d62('0x74')]?_[_0x3d62('0x76')](_0x3b859b[_0x2a1bb0[_0x452c39][_0x3d62('0x74')]],'%s',_0x9bb3ef):_0x9bb3ef;_0x9bb3ef=_0x2a1bb0[_0x452c39][_0x3d62('0x75')]?_[_0x3d62('0x76')](_0x5d478c[_0x2a1bb0[_0x452c39]['format']],'%s',_0x9bb3ef):_0x9bb3ef;if(_0x2a1bb0[_0x452c39]['groupBy']){_0x1134fe['group'](_0x9bb3ef);}_0x2a1bb0[_0x452c39][_0x3d62('0x77')]&&_0x1134fe[_0x3d62('0x41')](_0x9bb3ef,_0x2a1bb0[_0x452c39][_0x3d62('0x77')]===_0x3d62('0x78')?![]:!![]);_0x1134fe[_0x3d62('0x73')](_0x9bb3ef,_0x2a1bb0[_0x452c39][_0x3d62('0x79')]||_0x9bb3ef);}if(_0x561adf['joins']){_0x561adf[_0x3d62('0x7a')]=JSON[_0x3d62('0x7b')](_0x561adf['joins']);for(var _0x3e40da=0x0;_0x3e40da<_0x561adf[_0x3d62('0x7a')]['length'];_0x3e40da+=0x1){if(_0x561adf['joins'][_0x3e40da][_0x3d62('0x34')]&&_[_0x3d62('0x65')](_0x179e22,_0x561adf[_0x3d62('0x7a')][_0x3e40da][_0x3d62('0x34')])&&_0x561adf[_0x3d62('0x7a')][_0x3e40da][_0x3d62('0x7c')]&&_0x561adf[_0x3d62('0x7a')][_0x3e40da][_0x3d62('0x7d')]&&_0x561adf['joins'][_0x3e40da][_0x3d62('0x7e')]){_0x1134fe[_0x561adf[_0x3d62('0x7a')][_0x3e40da][_0x3d62('0x34')]](_0x561adf[_0x3d62('0x7a')][_0x3e40da][_0x3d62('0x7d')],null,util['format'](_0x3d62('0x7f'),_0x561adf[_0x3d62('0x71')],_0x561adf['joins'][_0x3e40da][_0x3d62('0x7c')],_0x561adf[_0x3d62('0x7a')][_0x3e40da]['foreignTable'],_0x561adf['joins'][_0x3e40da][_0x3d62('0x7e')]));}}}if(_0x561adf[_0x3d62('0x80')]){_0x561adf['conditions']=JSON['parse'](_0x561adf[_0x3d62('0x80')]);_0x1134fe['where'](_0xea644d(_0x561adf['conditions'][_0x3d62('0x69')]));}_0x354c55=_0x1134fe[_0x3d62('0x91')]();_0x1134fe[_0x3d62('0x40')](_0x2c979d);_0x1134fe[_0x3d62('0x23')](0x0);logger['debug']('Limited\x20Query:',_0x1134fe[_0x3d62('0x9f')]());return dbH[_0x3d62('0x82')][_0x3d62('0x37')](_0x1134fe[_0x3d62('0x9f')](),{'type':dbH[_0x3d62('0x82')][_0x3d62('0x83')][_0x3d62('0x84')]});}})[_0x3d62('0x28')](function(){return{'sql':_0x354c55[_0x3d62('0x9f')]()};})[_0x3d62('0x28')](respondWithResult(_0x16b37c,null))[_0x3d62('0x4c')](handleError(_0x16b37c,null));}; \ No newline at end of file +var _0xbc11=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','merge','type','filter','options','where','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','userProfileId','autoAssociation','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','groupBy','orderBy','DESC','joins','parse','foreignKey','foreignTable','parentKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','MIN(%s)','IS\x20NULL','IS\x20NOT\x20NULL','operator','format','%s.%s\x20=\x20%s.%s','web','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','Sequelize','eml-format','rimraf','request-promise','moment'];(function(_0xe59443,_0x1c7fbc){var _0x155142=function(_0x147ab1){while(--_0x147ab1){_0xe59443['push'](_0xe59443['shift']());}};_0x155142(++_0x1c7fbc);}(_0xbc11,0xa0));var _0x1bc1=function(_0x36859d,_0x24b8a7){_0x36859d=_0x36859d-0x0;var _0x3b342a=_0xbc11[_0x36859d];return _0x3b342a;};'use strict';var emlformat=require(_0x1bc1('0x0'));var rimraf=require(_0x1bc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1bc1('0x2'));var moment=require(_0x1bc1('0x3'));var BPromise=require(_0x1bc1('0x4'));var Mustache=require(_0x1bc1('0x5'));var util=require(_0x1bc1('0x6'));var path=require(_0x1bc1('0x7'));var sox=require(_0x1bc1('0x8'));var csv=require(_0x1bc1('0x9'));var ejs=require(_0x1bc1('0xa'));var fs=require('fs');var fs_extra=require(_0x1bc1('0xb'));var _=require('lodash');var squel=require(_0x1bc1('0xc'));var crypto=require(_0x1bc1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1bc1('0xe'));var toCsv=require(_0x1bc1('0x9'));var querystring=require(_0x1bc1('0xf'));var Papa=require('papaparse');var Redis=require(_0x1bc1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1bc1('0x11'));var hardwareService=require(_0x1bc1('0x12'));var logger=require('../../config/logger')(_0x1bc1('0x13'));var utils=require('../../config/utils');var config=require(_0x1bc1('0x14'));var licenseUtil=require(_0x1bc1('0x15'));var db=require(_0x1bc1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x1bc1('0x17')];function respondWithStatusCode(_0x2766bc,_0x363e63){_0x363e63=_0x363e63||0xcc;return function(_0x26d429){if(_0x26d429){return _0x2766bc['sendStatus'](_0x363e63);}return _0x2766bc['status'](_0x363e63)[_0x1bc1('0x18')]();};}function respondWithResult(_0x30f6d2,_0x1ba691){_0x1ba691=_0x1ba691||0xc8;return function(_0x228ac2){if(_0x228ac2){return _0x30f6d2[_0x1bc1('0x19')](_0x1ba691)['json'](_0x228ac2);}};}function respondWithFilteredResult(_0x41cbfe,_0x50db81){return function(_0x129af2){if(_0x129af2){var _0x3f59f3=typeof _0x50db81[_0x1bc1('0x1a')]===_0x1bc1('0x1b')&&typeof _0x50db81[_0x1bc1('0x1c')]==='undefined';var _0x37dac0=_0x129af2[_0x1bc1('0x1d')];var _0x33712f=_0x3f59f3?0x0:_0x50db81[_0x1bc1('0x1a')];var _0x3671ea=_0x3f59f3?_0x129af2[_0x1bc1('0x1d')]:_0x50db81['offset']+_0x50db81[_0x1bc1('0x1c')];var _0x3c3875;if(_0x3671ea>=_0x37dac0){_0x3671ea=_0x37dac0;_0x3c3875=0xc8;}else{_0x3c3875=0xce;}_0x41cbfe[_0x1bc1('0x19')](_0x3c3875);return _0x41cbfe[_0x1bc1('0x1e')](_0x1bc1('0x1f'),_0x33712f+'-'+_0x3671ea+'/'+_0x37dac0)[_0x1bc1('0x20')](_0x129af2);}return null;};}function patchUpdates(_0x4aab2c){return function(_0x4e1360){try{jsonpatch['apply'](_0x4e1360,_0x4aab2c,!![]);}catch(_0x5f0341){return BPromise['reject'](_0x5f0341);}return _0x4e1360[_0x1bc1('0x21')]();};}function saveUpdates(_0x28c632,_0x2a4730){return function(_0x55364d){if(_0x55364d){return _0x55364d[_0x1bc1('0x22')](_0x28c632)[_0x1bc1('0x23')](function(_0x2376d2){return _0x2376d2;});}return null;};}function removeEntity(_0x1c5dc8,_0x1bf467){return function(_0x5aa007){if(_0x5aa007){return _0x5aa007[_0x1bc1('0x24')]()[_0x1bc1('0x23')](function(){var _0x2c9fc3=_0x5aa007[_0x1bc1('0x25')]({'plain':!![]});var _0x5d5ba3=_0x1bc1('0x26');return db[_0x1bc1('0x27')][_0x1bc1('0x24')]({'where':{'type':_0x5d5ba3,'resourceId':_0x2c9fc3['id']}})[_0x1bc1('0x23')](function(){return _0x5aa007;});})[_0x1bc1('0x23')](function(){_0x1c5dc8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5034b9,_0x1a491d){return function(_0x13852c){if(!_0x13852c){_0x5034b9[_0x1bc1('0x28')](0x194);}return _0x13852c;};}function handleError(_0x41901a,_0x43f338){_0x43f338=_0x43f338||0x1f4;return function(_0x185356){logger[_0x1bc1('0x29')](_0x185356[_0x1bc1('0x2a')]);if(_0x185356[_0x1bc1('0x2b')]){delete _0x185356[_0x1bc1('0x2b')];}_0x41901a[_0x1bc1('0x19')](_0x43f338)[_0x1bc1('0x2c')](_0x185356);};}exports[_0x1bc1('0x2d')]=function(_0x1f9ffa,_0x4ce22a){var _0x130c62={},_0xabfbff={},_0x18b553={'count':0x0,'rows':[]};var _0x379d5f=_[_0x1bc1('0x2e')](db[_0x1bc1('0x2f')][_0x1bc1('0x30')],function(_0x6c8200){return{'name':_0x6c8200[_0x1bc1('0x31')],'type':_0x6c8200['type'][_0x1bc1('0x32')]};});_0xabfbff[_0x1bc1('0x33')]=_[_0x1bc1('0x2e')](_0x379d5f,_0x1bc1('0x2b'));_0xabfbff[_0x1bc1('0x34')]=_[_0x1bc1('0x35')](_0x1f9ffa[_0x1bc1('0x34')]);_0xabfbff[_0x1bc1('0x36')]=_[_0x1bc1('0x37')](_0xabfbff[_0x1bc1('0x33')],_0xabfbff[_0x1bc1('0x34')]);_0x130c62[_0x1bc1('0x38')]=_[_0x1bc1('0x37')](_0xabfbff[_0x1bc1('0x33')],qs[_0x1bc1('0x39')](_0x1f9ffa[_0x1bc1('0x34')][_0x1bc1('0x39')]));_0x130c62[_0x1bc1('0x38')]=_0x130c62[_0x1bc1('0x38')][_0x1bc1('0x3a')]?_0x130c62[_0x1bc1('0x38')]:_0xabfbff[_0x1bc1('0x33')];if(!_0x1f9ffa[_0x1bc1('0x34')][_0x1bc1('0x3b')](_0x1bc1('0x3c'))){_0x130c62[_0x1bc1('0x1c')]=qs['limit'](_0x1f9ffa['query']['limit']);_0x130c62[_0x1bc1('0x1a')]=qs[_0x1bc1('0x1a')](_0x1f9ffa[_0x1bc1('0x34')]['offset']);}_0x130c62[_0x1bc1('0x3d')]=qs['sort'](_0x1f9ffa[_0x1bc1('0x34')]['sort']);_0x130c62['where']=qs[_0x1bc1('0x36')](_['pick'](_0x1f9ffa[_0x1bc1('0x34')],_0xabfbff[_0x1bc1('0x36')]),_0x379d5f);if(_0x1f9ffa[_0x1bc1('0x34')]['filter']){_0x130c62['where']=_[_0x1bc1('0x3e')](_0x130c62['where'],{'$or':_[_0x1bc1('0x2e')](_0x379d5f,function(_0xe200c8){if(_0xe200c8[_0x1bc1('0x3f')]!=='VIRTUAL'){var _0x36c5f2={};_0x36c5f2[_0xe200c8[_0x1bc1('0x2b')]]={'$like':'%'+_0x1f9ffa[_0x1bc1('0x34')][_0x1bc1('0x40')]+'%'};return _0x36c5f2;}})});}_0x130c62=_[_0x1bc1('0x3e')]({},_0x130c62,_0x1f9ffa[_0x1bc1('0x41')]);var _0x4ba428={'where':_0x130c62[_0x1bc1('0x42')]};return db[_0x1bc1('0x2f')][_0x1bc1('0x1d')](_0x4ba428)[_0x1bc1('0x23')](function(_0x19e4c6){_0x18b553['count']=_0x19e4c6;if(_0x1f9ffa[_0x1bc1('0x34')][_0x1bc1('0x43')]){_0x130c62[_0x1bc1('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x1bc1('0x45')](_0x130c62);})['then'](function(_0x40af83){_0x18b553[_0x1bc1('0x46')]=_0x40af83;return _0x18b553;})[_0x1bc1('0x23')](respondWithFilteredResult(_0x4ce22a,_0x130c62))[_0x1bc1('0x47')](handleError(_0x4ce22a,null));};exports[_0x1bc1('0x48')]=function(_0x3b1c01,_0x57cb0d){var _0x12ec09={'raw':![],'where':{'id':_0x3b1c01[_0x1bc1('0x49')]['id']}},_0x4a8fb7={};_0x4a8fb7[_0x1bc1('0x33')]=_[_0x1bc1('0x35')](db[_0x1bc1('0x2f')]['rawAttributes']);_0x4a8fb7[_0x1bc1('0x34')]=_['keys'](_0x3b1c01[_0x1bc1('0x34')]);_0x4a8fb7['filters']=_[_0x1bc1('0x37')](_0x4a8fb7[_0x1bc1('0x33')],_0x4a8fb7[_0x1bc1('0x34')]);_0x12ec09[_0x1bc1('0x38')]=_[_0x1bc1('0x37')](_0x4a8fb7[_0x1bc1('0x33')],qs[_0x1bc1('0x39')](_0x3b1c01['query'][_0x1bc1('0x39')]));_0x12ec09[_0x1bc1('0x38')]=_0x12ec09[_0x1bc1('0x38')][_0x1bc1('0x3a')]?_0x12ec09[_0x1bc1('0x38')]:_0x4a8fb7[_0x1bc1('0x33')];if(_0x3b1c01[_0x1bc1('0x34')][_0x1bc1('0x43')]){_0x12ec09[_0x1bc1('0x44')]=[{'all':!![]}];}_0x12ec09=_[_0x1bc1('0x3e')]({},_0x12ec09,_0x3b1c01[_0x1bc1('0x41')]);return db['AnalyticCustomReport']['find'](_0x12ec09)[_0x1bc1('0x23')](handleEntityNotFound(_0x57cb0d,null))[_0x1bc1('0x23')](respondWithResult(_0x57cb0d,null))[_0x1bc1('0x47')](handleError(_0x57cb0d,null));};exports['create']=function(_0x568654,_0x4beb65){return db['AnalyticCustomReport'][_0x1bc1('0x4a')](_0x568654['body'],{})[_0x1bc1('0x23')](function(_0x2f157d){var _0x500a6a=_0x568654[_0x1bc1('0x4b')][_0x1bc1('0x25')]({'plain':!![]});if(!_0x500a6a)throw new Error(_0x1bc1('0x4c'));if(_0x500a6a['role']===_0x1bc1('0x4b')){var _0x2dee3f=_0x2f157d[_0x1bc1('0x25')]({'plain':!![]});var _0x59724f=_0x1bc1('0x4d');return db['UserProfileSection'][_0x1bc1('0x4e')]({'where':{'name':_0x59724f,'userProfileId':_0x500a6a[_0x1bc1('0x4f')]},'raw':!![]})[_0x1bc1('0x23')](function(_0xd0b7a5){if(_0xd0b7a5&&_0xd0b7a5[_0x1bc1('0x50')]===0x0){return db[_0x1bc1('0x27')][_0x1bc1('0x4a')]({'name':_0x2dee3f[_0x1bc1('0x2b')],'resourceId':_0x2dee3f['id'],'type':_0x1bc1('0x26'),'sectionId':_0xd0b7a5['id']},{})[_0x1bc1('0x23')](function(){return _0x2f157d;});}else{return _0x2f157d;}})['catch'](function(_0x15ff11){logger[_0x1bc1('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15ff11);throw _0x15ff11;});}return _0x2f157d;})[_0x1bc1('0x23')](respondWithResult(_0x4beb65,0xc9))[_0x1bc1('0x47')](handleError(_0x4beb65,null));};exports[_0x1bc1('0x22')]=function(_0x241c82,_0xf6cbe1){if(_0x241c82[_0x1bc1('0x51')]['id']){delete _0x241c82[_0x1bc1('0x51')]['id'];}return db[_0x1bc1('0x2f')][_0x1bc1('0x4e')]({'where':{'id':_0x241c82[_0x1bc1('0x49')]['id']}})['then'](handleEntityNotFound(_0xf6cbe1,null))[_0x1bc1('0x23')](saveUpdates(_0x241c82[_0x1bc1('0x51')],null))[_0x1bc1('0x23')](respondWithResult(_0xf6cbe1,null))['catch'](handleError(_0xf6cbe1,null));};exports[_0x1bc1('0x24')]=function(_0xf83926,_0x48565b){return db[_0x1bc1('0x2f')][_0x1bc1('0x4e')]({'where':{'id':_0xf83926[_0x1bc1('0x49')]['id']}})[_0x1bc1('0x23')](handleEntityNotFound(_0x48565b,null))[_0x1bc1('0x23')](removeEntity(_0x48565b,null))['catch'](handleError(_0x48565b,null));};exports[_0x1bc1('0x52')]=function(_0x544d0e,_0x396838){var _0x5176fc=0xa;var _0x589ae2=[_0x1bc1('0x53'),'left_join',_0x1bc1('0x54'),_0x1bc1('0x55')];var _0x4e6388={'SUM':_0x1bc1('0x56'),'COUNT':_0x1bc1('0x57'),'COUNT DISTINCT':_0x1bc1('0x58'),'MAX':_0x1bc1('0x59'),'MIN':'MIN(%s)','AVG':_0x1bc1('0x5a'),'GROUP_CONCAT':_0x1bc1('0x5b'),'GROUP_CONCAT ASC':_0x1bc1('0x5c'),'GROUP_CONCAT DESC':_0x1bc1('0x5d')};var _0x23a173={'SEC_TO_TIME':_0x1bc1('0x5e'),'DATE':_0x1bc1('0x5f'),'HOUR':_0x1bc1('0x60'),'ROUND':_0x1bc1('0x61'),'UNIX_TIMESTAMP':_0x1bc1('0x62')};var _0x1b2230=function(_0x5040db){return!_[_0x1bc1('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1bc1('0x64'),_0x1bc1('0x65')],_0x5040db);};var _0x28ac49=function(_0xf64a66){if(!_0xf64a66||!_0xf64a66[_0x1bc1('0x66')][_0x1bc1('0x3a')]){return'';}for(var _0xb2adbf='(',_0x1e6c0a=0x0;_0x1e6c0a<_0xf64a66[_0x1bc1('0x66')][_0x1bc1('0x3a')];_0x1e6c0a+=0x1){_0x1e6c0a>0x0&&(_0xb2adbf+='\x20'+_0xf64a66['operator']+'\x20');_0xb2adbf+=_0xf64a66[_0x1bc1('0x66')][_0x1e6c0a][_0x1bc1('0x67')]?_0x28ac49(_0xf64a66['rules'][_0x1e6c0a][_0x1bc1('0x67')]):_0xf64a66[_0x1bc1('0x66')][_0x1e6c0a]['field']+'\x20'+_0xf64a66['rules'][_0x1e6c0a][_0x1bc1('0x68')]+(_0x1b2230(_0xf64a66[_0x1bc1('0x66')][_0x1e6c0a][_0x1bc1('0x68')])?'\x20'+_0xf64a66[_0x1bc1('0x66')][_0x1e6c0a][_0x1bc1('0x69')]:'');}return _0xb2adbf+')';};var _0x4fe31b={'where':{'id':_0x544d0e[_0x1bc1('0x49')]['id']}},_0x57359c,_0x1ccf62,_0x41835c,_0x50eaf2,_0x2e8544;_0x4fe31b=_[_0x1bc1('0x3e')]({},_0x4fe31b,_0x544d0e[_0x1bc1('0x41')]);return db['AnalyticCustomReport'][_0x1bc1('0x4e')](_0x4fe31b)[_0x1bc1('0x23')](function(_0x533c85){if(_0x533c85){_0x57359c=_0x533c85;return _0x533c85[_0x1bc1('0x6a')]();}return null;})[_0x1bc1('0x23')](function(_0x11f531){if(_0x11f531){if(!_0x11f531[_0x1bc1('0x3a')]){throw new db['Sequelize'][(_0x1bc1('0x6b'))](_0x1bc1('0x6c'),0x193);}_0x1ccf62=_0x11f531;return db[_0x1bc1('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x1bc1('0x23')](function(_0x2e0221){if(_0x2e0221){_0x41835c=_[_0x1bc1('0x6e')](_0x2e0221,'id');var _0x4cf29;var _0x539f65=squel[_0x1bc1('0x6f')]();_0x539f65[_0x1bc1('0x70')](_0x57359c[_0x1bc1('0x71')]);for(var _0x34b677=0x0;_0x34b677<_0x1ccf62[_0x1bc1('0x3a')];_0x34b677+=0x1){_0x4cf29=_0x1ccf62[_0x34b677][_0x1bc1('0x72')]?_0x41835c[_0x1ccf62[_0x34b677][_0x1bc1('0x72')]][_0x1bc1('0x73')]:_0x1ccf62[_0x34b677][_0x1bc1('0x74')];_0x4cf29=_0x1ccf62[_0x34b677]['function']?_['replace'](_0x4e6388[_0x1ccf62[_0x34b677][_0x1bc1('0x75')]],'%s',_0x4cf29):_0x4cf29;_0x4cf29=_0x1ccf62[_0x34b677]['format']?_[_0x1bc1('0x76')](_0x23a173[_0x1ccf62[_0x34b677]['format']],'%s',_0x4cf29):_0x4cf29;if(_0x1ccf62[_0x34b677][_0x1bc1('0x77')]){_0x539f65[_0x1bc1('0x67')](_0x4cf29);}_0x1ccf62[_0x34b677][_0x1bc1('0x78')]&&_0x539f65[_0x1bc1('0x3d')](_0x4cf29,_0x1ccf62[_0x34b677][_0x1bc1('0x78')]===_0x1bc1('0x79')?![]:!![]);_0x539f65[_0x1bc1('0x74')](_0x4cf29,_0x1ccf62[_0x34b677]['alias']||_0x4cf29);}if(_0x57359c[_0x1bc1('0x7a')]){_0x57359c[_0x1bc1('0x7a')]=JSON[_0x1bc1('0x7b')](_0x57359c[_0x1bc1('0x7a')]);for(var _0x5a2398=0x0;_0x5a2398<_0x57359c[_0x1bc1('0x7a')]['length'];_0x5a2398+=0x1){if(_0x57359c['joins'][_0x5a2398][_0x1bc1('0x3f')]&&_['includes'](_0x589ae2,_0x57359c['joins'][_0x5a2398][_0x1bc1('0x3f')])&&_0x57359c[_0x1bc1('0x7a')][_0x5a2398]['parentKey']&&_0x57359c['joins'][_0x5a2398]['foreignTable']&&_0x57359c[_0x1bc1('0x7a')][_0x5a2398][_0x1bc1('0x7c')]){_0x539f65[_0x57359c[_0x1bc1('0x7a')][_0x5a2398][_0x1bc1('0x3f')]](_0x57359c[_0x1bc1('0x7a')][_0x5a2398][_0x1bc1('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x57359c[_0x1bc1('0x71')],_0x57359c[_0x1bc1('0x7a')][_0x5a2398][_0x1bc1('0x7e')],_0x57359c['joins'][_0x5a2398]['foreignTable'],_0x57359c['joins'][_0x5a2398][_0x1bc1('0x7c')]));}}}if(_0x57359c[_0x1bc1('0x7f')]){_0x57359c[_0x1bc1('0x7f')]=JSON[_0x1bc1('0x7b')](_0x57359c['conditions']);_0x539f65['where'](_0x28ac49(_0x57359c[_0x1bc1('0x7f')][_0x1bc1('0x67')]));}_0x2e8544=_0x539f65[_0x1bc1('0x80')]();_0x539f65[_0x1bc1('0x1c')](_0x5176fc);_0x539f65[_0x1bc1('0x1a')](0x0);logger['debug'](_0x1bc1('0x81'),_0x539f65[_0x1bc1('0x82')]());return dbH[_0x1bc1('0x83')][_0x1bc1('0x34')](_0x539f65['toString'](),{'type':dbH[_0x1bc1('0x83')][_0x1bc1('0x84')][_0x1bc1('0x85')]});}})[_0x1bc1('0x23')](respondWithResult(_0x396838,null))['catch'](handleError(_0x396838,null));};function runReport(_0x22a6df,_0x245948,_0x2ad920){var _0x21afc7=_0x245948['name'];var _0x10f1df=0xa;var _0x804a11=['join',_0x1bc1('0x86'),_0x1bc1('0x54'),'cross_join'];var _0x50d6aa={'SUM':_0x1bc1('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1bc1('0x58'),'MAX':_0x1bc1('0x59'),'MIN':_0x1bc1('0x87'),'AVG':_0x1bc1('0x5a'),'GROUP_CONCAT':_0x1bc1('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1bc1('0x5d')};var _0x21537e={'SEC_TO_TIME':_0x1bc1('0x5e'),'DATE':'DATE(%s)','HOUR':_0x1bc1('0x60'),'ROUND':_0x1bc1('0x61'),'UNIX_TIMESTAMP':_0x1bc1('0x62')};var _0x2a7001=function(_0x4f30d8){return!_['includes']([_0x1bc1('0x88'),_0x1bc1('0x89'),'IS\x20EMPTY',_0x1bc1('0x65')],_0x4f30d8);};var _0x215d41=function(_0x4c09a7){if(!_0x4c09a7||!_0x4c09a7[_0x1bc1('0x66')]['length']){return'';}for(var _0x61bfee='(',_0x301bb8=0x0;_0x301bb8<_0x4c09a7[_0x1bc1('0x66')]['length'];_0x301bb8+=0x1){_0x301bb8>0x0&&(_0x61bfee+='\x20'+_0x4c09a7[_0x1bc1('0x8a')]+'\x20');_0x61bfee+=_0x4c09a7['rules'][_0x301bb8][_0x1bc1('0x67')]?_0x215d41(_0x4c09a7[_0x1bc1('0x66')][_0x301bb8][_0x1bc1('0x67')]):_0x4c09a7[_0x1bc1('0x66')][_0x301bb8][_0x1bc1('0x74')]+'\x20'+_0x4c09a7[_0x1bc1('0x66')][_0x301bb8][_0x1bc1('0x68')]+(_0x2a7001(_0x4c09a7['rules'][_0x301bb8]['condition'])?'\x20'+_0x4c09a7[_0x1bc1('0x66')][_0x301bb8][_0x1bc1('0x69')]:'');}return _0x61bfee+')';};var _0x12fd7b={'where':{'id':_0x22a6df['id']}},_0x27ffa0,_0x202619,_0x24b0c1,_0x29b1ce,_0x503ebf;_0x12fd7b=_[_0x1bc1('0x3e')]({},_0x12fd7b,_0x2ad920);return db[_0x1bc1('0x2f')][_0x1bc1('0x4e')](_0x12fd7b)[_0x1bc1('0x23')](function(_0x258b11){if(_0x258b11){_0x27ffa0=_0x258b11;return _0x258b11[_0x1bc1('0x6a')]();}return null;})['then'](function(_0x2622f9){if(_0x2622f9){if(!_0x2622f9[_0x1bc1('0x3a')]){throw new db['Sequelize'][(_0x1bc1('0x6b'))](_0x1bc1('0x6c'),0x193);}_0x202619=_0x2622f9;return db[_0x1bc1('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x1bc1('0x23')](function(_0x8a23fd){if(_0x8a23fd){_0x24b0c1=_[_0x1bc1('0x6e')](_0x8a23fd,'id');var _0x3d4b54;var _0x1df14c=squel[_0x1bc1('0x6f')]();_0x1df14c[_0x1bc1('0x70')](_0x27ffa0[_0x1bc1('0x71')]);for(var _0x581b87=0x0;_0x581b87<_0x202619[_0x1bc1('0x3a')];_0x581b87+=0x1){_0x3d4b54=_0x202619[_0x581b87]['MetricId']?_0x24b0c1[_0x202619[_0x581b87][_0x1bc1('0x72')]]['metric']:_0x202619[_0x581b87]['field'];_0x3d4b54=_0x202619[_0x581b87]['function']?_[_0x1bc1('0x76')](_0x50d6aa[_0x202619[_0x581b87][_0x1bc1('0x75')]],'%s',_0x3d4b54):_0x3d4b54;_0x3d4b54=_0x202619[_0x581b87][_0x1bc1('0x8b')]?_[_0x1bc1('0x76')](_0x21537e[_0x202619[_0x581b87]['format']],'%s',_0x3d4b54):_0x3d4b54;if(_0x202619[_0x581b87][_0x1bc1('0x77')]){_0x1df14c[_0x1bc1('0x67')](_0x3d4b54);}_0x202619[_0x581b87][_0x1bc1('0x78')]&&_0x1df14c[_0x1bc1('0x3d')](_0x3d4b54,_0x202619[_0x581b87][_0x1bc1('0x78')]===_0x1bc1('0x79')?![]:!![]);_0x1df14c[_0x1bc1('0x74')](_0x3d4b54,_0x202619[_0x581b87]['alias']||_0x3d4b54);}if(_0x27ffa0[_0x1bc1('0x7a')]){_0x27ffa0[_0x1bc1('0x7a')]=JSON[_0x1bc1('0x7b')](_0x27ffa0[_0x1bc1('0x7a')]);for(var _0x17447f=0x0;_0x17447f<_0x27ffa0[_0x1bc1('0x7a')][_0x1bc1('0x3a')];_0x17447f+=0x1){if(_0x27ffa0['joins'][_0x17447f][_0x1bc1('0x3f')]&&_[_0x1bc1('0x63')](_0x804a11,_0x27ffa0[_0x1bc1('0x7a')][_0x17447f]['type'])&&_0x27ffa0['joins'][_0x17447f][_0x1bc1('0x7e')]&&_0x27ffa0[_0x1bc1('0x7a')][_0x17447f]['foreignTable']&&_0x27ffa0['joins'][_0x17447f][_0x1bc1('0x7c')]){_0x1df14c[_0x27ffa0[_0x1bc1('0x7a')][_0x17447f][_0x1bc1('0x3f')]](_0x27ffa0[_0x1bc1('0x7a')][_0x17447f][_0x1bc1('0x7d')],null,util['format'](_0x1bc1('0x8c'),_0x27ffa0[_0x1bc1('0x71')],_0x27ffa0[_0x1bc1('0x7a')][_0x17447f][_0x1bc1('0x7e')],_0x27ffa0[_0x1bc1('0x7a')][_0x17447f][_0x1bc1('0x7d')],_0x27ffa0[_0x1bc1('0x7a')][_0x17447f][_0x1bc1('0x7c')]));}}}if(_0x27ffa0[_0x1bc1('0x7f')]){_0x27ffa0[_0x1bc1('0x7f')]=JSON[_0x1bc1('0x7b')](_0x27ffa0[_0x1bc1('0x7f')]);_0x1df14c[_0x1bc1('0x42')](_0x215d41(_0x27ffa0[_0x1bc1('0x7f')]['group']));}_0x503ebf=_0x1df14c[_0x1bc1('0x80')]();_0x1df14c[_0x1bc1('0x1c')](_0x10f1df);_0x1df14c[_0x1bc1('0x1a')](0x0);return;}})[_0x1bc1('0x23')](function(){if(_0x245948['output']===_0x1bc1('0x8d')){return null;}var _0x595f41=_[_0x1bc1('0x3e')](_0x245948,{'name':_0x245948[_0x1bc1('0x8e')]||_0x245948[_0x1bc1('0x2b')]||_0x27ffa0[_0x1bc1('0x2b')],'basename':_0x21afc7,'savename':util[_0x1bc1('0x8b')](_0x1bc1('0x8f'),_0x245948[_0x1bc1('0x2b')]||_0x27ffa0[_0x1bc1('0x2b')],require('randomstring')[_0x1bc1('0x90')](0x4),_0x245948[_0x1bc1('0x91')]||_0x1bc1('0x92')),'reportId':_0x27ffa0['id'],'reportType':_0x1bc1('0x93')});return db[_0x1bc1('0x94')][_0x1bc1('0x4a')](_0x595f41,{'raw':!![]});})[_0x1bc1('0x23')](function(_0x2ad1b4){if(_0x27ffa0[_0x1bc1('0x71')]===_0x1bc1('0x95')){_0x503ebf[_0x1bc1('0x42')](_0x27ffa0[_0x1bc1('0x71')]+_0x1bc1('0x96'),_0x245948[_0x1bc1('0x97')],_0x245948[_0x1bc1('0x98')]);}else{_0x503ebf['where'](_0x27ffa0[_0x1bc1('0x71')]+_0x1bc1('0x99'),_0x245948[_0x1bc1('0x97')],_0x245948[_0x1bc1('0x98')]);}if(_0x2ad1b4){logger[_0x1bc1('0x9a')](_0x1bc1('0x9b'),_0x503ebf[_0x1bc1('0x82')]());require(_0x1bc1('0x9c'))[_0x1bc1('0x9d')](path['join'](__dirname,'../../components/export/',_0x2ad1b4[_0x1bc1('0x91')]),[_0x2ad1b4['id'],_0x503ebf['toString'](),path[_0x1bc1('0x53')](__dirname,_0x1bc1('0x9e'),_0x2ad1b4[_0x1bc1('0x9f')]),_0x21afc7]);return _0x2ad1b4;}else{var _0x3c85e7=squel[_0x1bc1('0x6f')]();_0x3c85e7['from']('('+_0x503ebf[_0x1bc1('0x82')]()+')',_0x1bc1('0xa0'));_0x3c85e7['field']('COUNT(*)',_0x1bc1('0x1d'));_0x503ebf[_0x1bc1('0x1c')](_0x245948['limit']||_0x10f1df);_0x503ebf['offset'](_0x245948[_0x1bc1('0x1a')]||0x0);return dbH[_0x1bc1('0x83')][_0x1bc1('0x34')](_0x3c85e7[_0x1bc1('0x82')](),{'type':dbH['sequelize'][_0x1bc1('0x84')][_0x1bc1('0x85')]})['then'](function(_0xd0390b){if(!_0xd0390b[_0x1bc1('0x3a')]){_0x29b1ce=0x0;}else{_0x29b1ce=_0xd0390b[0x0][_0x1bc1('0x1d')]||0x0;}return dbH[_0x1bc1('0x83')]['query'](_0x503ebf[_0x1bc1('0x82')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x1bc1('0x23')](function(_0x551e9a){return{'rows':_0x551e9a||[],'count':_0x29b1ce};});}});}exports[_0x1bc1('0xa1')]=function(_0x31eee4,_0x53754a){return runReport(_0x31eee4[_0x1bc1('0x49')],_0x31eee4[_0x1bc1('0x34')],_0x31eee4['options'])['then'](respondWithResult(_0x53754a,null))[_0x1bc1('0x47')](handleError(_0x53754a,null));};exports[_0x1bc1('0xa2')]=runReport;exports[_0x1bc1('0x34')]=function(_0x7be645,_0x3ce59a){var _0x4ddcb3=0xa;var _0x41dd90=[_0x1bc1('0x53'),_0x1bc1('0x86'),'right_join','cross_join'];var _0x2045db={'SUM':_0x1bc1('0x56'),'COUNT':_0x1bc1('0x57'),'COUNT DISTINCT':_0x1bc1('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x1bc1('0x5b'),'GROUP_CONCAT ASC':_0x1bc1('0x5c'),'GROUP_CONCAT DESC':_0x1bc1('0x5d')};var _0x15bb96={'SEC_TO_TIME':_0x1bc1('0x5e'),'DATE':_0x1bc1('0x5f'),'HOUR':_0x1bc1('0x60'),'ROUND':_0x1bc1('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1123ce=function(_0x36dc2b){return!_['includes']([_0x1bc1('0x88'),_0x1bc1('0x89'),_0x1bc1('0x64'),_0x1bc1('0x65')],_0x36dc2b);};var _0xb6109d=function(_0x1e535f){if(!_0x1e535f||!_0x1e535f[_0x1bc1('0x66')][_0x1bc1('0x3a')]){return'';}for(var _0x46379b='(',_0x42392d=0x0;_0x42392d<_0x1e535f[_0x1bc1('0x66')]['length'];_0x42392d+=0x1){_0x42392d>0x0&&(_0x46379b+='\x20'+_0x1e535f[_0x1bc1('0x8a')]+'\x20');_0x46379b+=_0x1e535f[_0x1bc1('0x66')][_0x42392d][_0x1bc1('0x67')]?_0xb6109d(_0x1e535f['rules'][_0x42392d][_0x1bc1('0x67')]):_0x1e535f[_0x1bc1('0x66')][_0x42392d][_0x1bc1('0x74')]+'\x20'+_0x1e535f[_0x1bc1('0x66')][_0x42392d][_0x1bc1('0x68')]+(_0x1123ce(_0x1e535f['rules'][_0x42392d]['condition'])?'\x20'+_0x1e535f[_0x1bc1('0x66')][_0x42392d][_0x1bc1('0x69')]:'');}return _0x46379b+')';};var _0x56ebfd={'where':{'id':_0x7be645[_0x1bc1('0x49')]['id']}},_0x4d170b,_0x2a1005,_0x22c963,_0x538c6f,_0x4ffa41;_0x56ebfd=_['merge']({},_0x56ebfd,_0x7be645['options']);return db[_0x1bc1('0x2f')][_0x1bc1('0x4e')](_0x56ebfd)[_0x1bc1('0x23')](function(_0x211e4b){if(_0x211e4b){_0x4d170b=_0x211e4b;return _0x211e4b['getFields']();}return null;})[_0x1bc1('0x23')](function(_0x54f089){if(_0x54f089){if(!_0x54f089[_0x1bc1('0x3a')]){throw new db[(_0x1bc1('0xa3'))]['ValidationErrorItem'](_0x1bc1('0x6c'),0x193);}_0x2a1005=_0x54f089;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x355175){if(_0x355175){_0x22c963=_[_0x1bc1('0x6e')](_0x355175,'id');var _0x5b41c1;var _0x5ea4b9=squel[_0x1bc1('0x6f')]();_0x5ea4b9['from'](_0x4d170b[_0x1bc1('0x71')]);for(var _0x2c0216=0x0;_0x2c0216<_0x2a1005[_0x1bc1('0x3a')];_0x2c0216+=0x1){_0x5b41c1=_0x2a1005[_0x2c0216]['MetricId']?_0x22c963[_0x2a1005[_0x2c0216][_0x1bc1('0x72')]][_0x1bc1('0x73')]:_0x2a1005[_0x2c0216][_0x1bc1('0x74')];_0x5b41c1=_0x2a1005[_0x2c0216][_0x1bc1('0x75')]?_['replace'](_0x2045db[_0x2a1005[_0x2c0216][_0x1bc1('0x75')]],'%s',_0x5b41c1):_0x5b41c1;_0x5b41c1=_0x2a1005[_0x2c0216]['format']?_[_0x1bc1('0x76')](_0x15bb96[_0x2a1005[_0x2c0216][_0x1bc1('0x8b')]],'%s',_0x5b41c1):_0x5b41c1;if(_0x2a1005[_0x2c0216][_0x1bc1('0x77')]){_0x5ea4b9['group'](_0x5b41c1);}_0x2a1005[_0x2c0216]['orderBy']&&_0x5ea4b9['order'](_0x5b41c1,_0x2a1005[_0x2c0216]['orderBy']===_0x1bc1('0x79')?![]:!![]);_0x5ea4b9[_0x1bc1('0x74')](_0x5b41c1,_0x2a1005[_0x2c0216]['alias']||_0x5b41c1);}if(_0x4d170b[_0x1bc1('0x7a')]){_0x4d170b['joins']=JSON[_0x1bc1('0x7b')](_0x4d170b['joins']);for(var _0x560cbb=0x0;_0x560cbb<_0x4d170b[_0x1bc1('0x7a')][_0x1bc1('0x3a')];_0x560cbb+=0x1){if(_0x4d170b[_0x1bc1('0x7a')][_0x560cbb][_0x1bc1('0x3f')]&&_[_0x1bc1('0x63')](_0x41dd90,_0x4d170b[_0x1bc1('0x7a')][_0x560cbb][_0x1bc1('0x3f')])&&_0x4d170b[_0x1bc1('0x7a')][_0x560cbb][_0x1bc1('0x7e')]&&_0x4d170b[_0x1bc1('0x7a')][_0x560cbb][_0x1bc1('0x7d')]&&_0x4d170b[_0x1bc1('0x7a')][_0x560cbb][_0x1bc1('0x7c')]){_0x5ea4b9[_0x4d170b[_0x1bc1('0x7a')][_0x560cbb][_0x1bc1('0x3f')]](_0x4d170b['joins'][_0x560cbb][_0x1bc1('0x7d')],null,util[_0x1bc1('0x8b')](_0x1bc1('0x8c'),_0x4d170b[_0x1bc1('0x71')],_0x4d170b[_0x1bc1('0x7a')][_0x560cbb]['parentKey'],_0x4d170b[_0x1bc1('0x7a')][_0x560cbb]['foreignTable'],_0x4d170b['joins'][_0x560cbb][_0x1bc1('0x7c')]));}}}if(_0x4d170b[_0x1bc1('0x7f')]){_0x4d170b[_0x1bc1('0x7f')]=JSON['parse'](_0x4d170b['conditions']);_0x5ea4b9[_0x1bc1('0x42')](_0xb6109d(_0x4d170b[_0x1bc1('0x7f')]['group']));}_0x4ffa41=_0x5ea4b9['clone']();_0x5ea4b9[_0x1bc1('0x1c')](_0x4ddcb3);_0x5ea4b9[_0x1bc1('0x1a')](0x0);logger['debug'](_0x1bc1('0x81'),_0x5ea4b9['toString']());return dbH[_0x1bc1('0x83')][_0x1bc1('0x34')](_0x5ea4b9['toString'](),{'type':dbH['sequelize'][_0x1bc1('0x84')][_0x1bc1('0x85')]});}})['then'](function(){return{'sql':_0x4ffa41['toString']()};})[_0x1bc1('0x23')](respondWithResult(_0x3ce59a,null))[_0x1bc1('0x47')](handleError(_0x3ce59a,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index cc025f0..2c8f6a9 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 _0x522f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0xc11333,_0x2e1fdf){var _0x3b1fd8=function(_0x39dc95){while(--_0x39dc95){_0xc11333['push'](_0xc11333['shift']());}};_0x3b1fd8(++_0x2e1fdf);}(_0x522f,0x16c));var _0xf522=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x522f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xf522('0x0'));var util=require(_0xf522('0x1'));var logger=require(_0xf522('0x2'))(_0xf522('0x3'));var moment=require(_0xf522('0x4'));var BPromise=require('bluebird');var rp=require(_0xf522('0x5'));var fs=require('fs');var path=require(_0xf522('0x6'));var rimraf=require(_0xf522('0x7'));var config=require(_0xf522('0x8'));var attributes=require(_0xf522('0x9'));module[_0xf522('0xa')]=function(_0x121a75,_0x400c7c){return _0x121a75[_0xf522('0xb')](_0xf522('0xc'),attributes,{'tableName':_0xf522('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4abc=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports'];(function(_0x26dfa5,_0x2ed3e9){var _0x408dd2=function(_0x134b10){while(--_0x134b10){_0x26dfa5['push'](_0x26dfa5['shift']());}};_0x408dd2(++_0x2ed3e9);}(_0x4abc,0xb4));var _0xc4ab=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4abc[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xc4ab('0x0'));var util=require(_0xc4ab('0x1'));var logger=require('../../config/logger')(_0xc4ab('0x2'));var moment=require(_0xc4ab('0x3'));var BPromise=require(_0xc4ab('0x4'));var rp=require(_0xc4ab('0x5'));var fs=require('fs');var path=require(_0xc4ab('0x6'));var rimraf=require('rimraf');var config=require(_0xc4ab('0x7'));var attributes=require(_0xc4ab('0x8'));module[_0xc4ab('0x9')]=function(_0x3e8bbe,_0x2db4d8){return _0x3e8bbe[_0xc4ab('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0xc4ab('0xb'),'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 5378c20..2d68e92 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 _0xb8c9=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','bluebird','randomstring'];(function(_0x358c22,_0x13d618){var _0x23d0a9=function(_0x4ead1c){while(--_0x4ead1c){_0x358c22['push'](_0x358c22['shift']());}};_0x23d0a9(++_0x13d618);}(_0xb8c9,0x165));var _0x9b8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b8c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b8c('0x1'));var rs=require(_0x9b8c('0x2'));var fs=require('fs');var Redis=require(_0x9b8c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b8c('0x4'));var logger=require(_0x9b8c('0x5'))(_0x9b8c('0x6'));var config=require('../../config/environment');var jayson=require(_0x9b8c('0x7'));var client=jayson[_0x9b8c('0x8')][_0x9b8c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x965b96,_0x29ac6c,_0xde0067){return new BPromise(function(_0x29ae4d,_0x1e8610){return client[_0x9b8c('0xa')](_0x965b96,_0xde0067)['then'](function(_0x5b7952){logger['info'](_0x9b8c('0xb'),_0x29ac6c,_0x9b8c('0xc'));logger[_0x9b8c('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x29ac6c,_0x9b8c('0xc'),JSON[_0x9b8c('0xe')](_0x5b7952));if(_0x5b7952[_0x9b8c('0xf')]){if(_0x5b7952[_0x9b8c('0xf')][_0x9b8c('0x10')]===0x1f4){logger[_0x9b8c('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x29ac6c,_0x5b7952['error'][_0x9b8c('0x11')]);return _0x1e8610(_0x5b7952[_0x9b8c('0xf')][_0x9b8c('0x11')]);}logger['error'](_0x9b8c('0xb'),_0x29ac6c,_0x5b7952['error'][_0x9b8c('0x11')]);return _0x29ae4d(_0x5b7952[_0x9b8c('0xf')][_0x9b8c('0x11')]);}else{logger[_0x9b8c('0x12')](_0x9b8c('0xb'),_0x29ac6c,_0x9b8c('0xc'));_0x29ae4d(_0x5b7952[_0x9b8c('0x13')][_0x9b8c('0x11')]);}})['catch'](function(_0x31ae77){logger[_0x9b8c('0xf')](_0x9b8c('0xb'),_0x29ac6c,_0x31ae77);_0x1e8610(_0x31ae77);});});} \ No newline at end of file +var _0x43f2=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request'];(function(_0xb8cb20,_0x359ed1){var _0x5549b2=function(_0x596e78){while(--_0x596e78){_0xb8cb20['push'](_0xb8cb20['shift']());}};_0x5549b2(++_0x359ed1);}(_0x43f2,0xd2));var _0x243f=function(_0x30eabb,_0x5f0fdb){_0x30eabb=_0x30eabb-0x0;var _0x420d1f=_0x43f2[_0x30eabb];return _0x420d1f;};'use strict';var _=require(_0x243f('0x0'));var util=require('util');var moment=require(_0x243f('0x1'));var BPromise=require(_0x243f('0x2'));var rs=require(_0x243f('0x3'));var fs=require('fs');var Redis=require(_0x243f('0x4'));var db=require(_0x243f('0x5'))['db'];var utils=require(_0x243f('0x6'));var logger=require(_0x243f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x243f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x511c66,_0x391097,_0x8a0aa8){return new BPromise(function(_0x43b958,_0x3af40a){return client[_0x243f('0x9')](_0x511c66,_0x8a0aa8)[_0x243f('0xa')](function(_0x38c320){logger[_0x243f('0xb')](_0x243f('0xc'),_0x391097,_0x243f('0xd'));logger[_0x243f('0xe')](_0x243f('0xf'),_0x391097,_0x243f('0xd'),JSON[_0x243f('0x10')](_0x38c320));if(_0x38c320['error']){if(_0x38c320[_0x243f('0x11')][_0x243f('0x12')]===0x1f4){logger[_0x243f('0x11')](_0x243f('0xc'),_0x391097,_0x38c320['error'][_0x243f('0x13')]);return _0x3af40a(_0x38c320[_0x243f('0x11')][_0x243f('0x13')]);}logger[_0x243f('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x391097,_0x38c320['error']['message']);return _0x43b958(_0x38c320[_0x243f('0x11')]['message']);}else{logger[_0x243f('0xb')](_0x243f('0xc'),_0x391097,_0x243f('0xd'));_0x43b958(_0x38c320[_0x243f('0x14')][_0x243f('0x13')]);}})[_0x243f('0x15')](function(_0x1c6c79){logger[_0x243f('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x391097,_0x1c6c79);_0x3af40a(_0x1c6c79);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index c0df70e..9b6a485 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 _0x4e7c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','/:id/run','/:id/query','query','post','create','put','update','multer','util','connect-timeout','express','Router'];(function(_0x5d3575,_0x209078){var _0x25664c=function(_0x2f5cf6){while(--_0x2f5cf6){_0x5d3575['push'](_0x5d3575['shift']());}};_0x25664c(++_0x209078);}(_0x4e7c,0xc3));var _0xc4e7=function(_0x426b1c,_0x52b74){_0x426b1c=_0x426b1c-0x0;var _0x1e7e86=_0x4e7c[_0x426b1c];return _0x1e7e86;};'use strict';var multer=require(_0xc4e7('0x0'));var util=require(_0xc4e7('0x1'));var path=require('path');var timeout=require(_0xc4e7('0x2'));var express=require(_0xc4e7('0x3'));var router=express[_0xc4e7('0x4')]();var fs_extra=require(_0xc4e7('0x5'));var auth=require(_0xc4e7('0x6'));var interaction=require(_0xc4e7('0x7'));var config=require(_0xc4e7('0x8'));var controller=require(_0xc4e7('0x9'));router[_0xc4e7('0xa')]('/',auth[_0xc4e7('0xb')](),controller['index']);router[_0xc4e7('0xa')](_0xc4e7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc4e7('0xa')]('/:id/preview',auth[_0xc4e7('0xb')](),controller['preview']);router[_0xc4e7('0xa')](_0xc4e7('0xd'),auth['isAuthenticated'](),controller['run']);router[_0xc4e7('0xa')](_0xc4e7('0xe'),auth[_0xc4e7('0xb')](),controller[_0xc4e7('0xf')]);router[_0xc4e7('0x10')]('/',auth['isAuthenticated'](),controller[_0xc4e7('0x11')]);router[_0xc4e7('0x12')](_0xc4e7('0xc'),auth[_0xc4e7('0xb')](),controller[_0xc4e7('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe77a=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','/:id/query','create','put','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x32c857,_0x520261){var _0x41eb0d=function(_0x4d43d6){while(--_0x4d43d6){_0x32c857['push'](_0x32c857['shift']());}};_0x41eb0d(++_0x520261);}(_0xe77a,0x67));var _0xae77=function(_0xdad39e,_0xcd07e7){_0xdad39e=_0xdad39e-0x0;var _0x5232df=_0xe77a[_0xdad39e];return _0x5232df;};'use strict';var multer=require(_0xae77('0x0'));var util=require(_0xae77('0x1'));var path=require(_0xae77('0x2'));var timeout=require('connect-timeout');var express=require(_0xae77('0x3'));var router=express[_0xae77('0x4')]();var fs_extra=require(_0xae77('0x5'));var auth=require(_0xae77('0x6'));var interaction=require(_0xae77('0x7'));var config=require(_0xae77('0x8'));var controller=require(_0xae77('0x9'));router[_0xae77('0xa')]('/',auth[_0xae77('0xb')](),controller[_0xae77('0xc')]);router[_0xae77('0xa')]('/:id',auth[_0xae77('0xb')](),controller['show']);router[_0xae77('0xa')](_0xae77('0xd'),auth[_0xae77('0xb')](),controller[_0xae77('0xe')]);router[_0xae77('0xa')](_0xae77('0xf'),auth[_0xae77('0xb')](),controller[_0xae77('0x10')]);router[_0xae77('0xa')](_0xae77('0x11'),auth[_0xae77('0xb')](),controller['query']);router['post']('/',auth[_0xae77('0xb')](),controller[_0xae77('0x12')]);router[_0xae77('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xae77('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0xae77('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 3d4a755..4111ee9 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0xfd25dd,_0x5e8ecc){_0xfd25dd=_0xfd25dd-0x0;var _0xa10d20=_0x1cb9[_0xfd25dd];return _0xa10d20;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file +var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x4859f9,_0x2ebac5){var _0x586b3d=function(_0x2712b6){while(--_0x2712b6){_0x4859f9['push'](_0x4859f9['shift']());}};_0x586b3d(++_0x2ebac5);}(_0xeda8,0x104));var _0x8eda=function(_0xbf1b10,_0x493092){_0xbf1b10=_0xbf1b10-0x0;var _0x14406e=_0xeda8[_0xbf1b10];return _0x14406e;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0425d13..f594282 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 _0x687b=['util','path','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x5b8320,_0x2ab5e5){_0x5b8320=_0x5b8320-0x0;var _0x5239ff=_0x687b[_0x5b8320];return _0x5239ff;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file +var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2ef3,0xba));var _0x32ef=function(_0x3639e5,_0x2995a3){_0x3639e5=_0x3639e5-0x0;var _0xbbfa2a=_0x2ef3[_0x3639e5];return _0xbbfa2a;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4dd5c03..013d239 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 _0xbbd8=['util','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports'];(function(_0x3159aa,_0x490811){var _0x1c9fd7=function(_0x3933ef){while(--_0x3933ef){_0x3159aa['push'](_0x3159aa['shift']());}};_0x1c9fd7(++_0x490811);}(_0xbbd8,0xd8));var _0x8bbd=function(_0x534bdc,_0x5928c5){_0x534bdc=_0x534bdc-0x0;var _0x4bba43=_0xbbd8[_0x534bdc];return _0x4bba43;};'use strict';var _=require('lodash');var util=require(_0x8bbd('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8bbd('0x1'));var rp=require(_0x8bbd('0x2'));var fs=require('fs');var path=require(_0x8bbd('0x3'));var rimraf=require(_0x8bbd('0x4'));var config=require(_0x8bbd('0x5'));var attributes=require(_0x8bbd('0x6'));module['exports']=function(_0x501e26,_0x3b5fa7){return _0x501e26['define'](_0x8bbd('0x7'),attributes,{'tableName':_0x8bbd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30f4=['bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','moment'];(function(_0x571e04,_0x8c9c77){var _0x58ed52=function(_0x25af15){while(--_0x25af15){_0x571e04['push'](_0x571e04['shift']());}};_0x58ed52(++_0x8c9c77);}(_0x30f4,0x17c));var _0x430f=function(_0x24ac2c,_0x2e7a14){_0x24ac2c=_0x24ac2c-0x0;var _0x503c6e=_0x30f4[_0x24ac2c];return _0x503c6e;};'use strict';var _=require(_0x430f('0x0'));var util=require(_0x430f('0x1'));var logger=require(_0x430f('0x2'))('api');var moment=require(_0x430f('0x3'));var BPromise=require(_0x430f('0x4'));var rp=require(_0x430f('0x5'));var fs=require('fs');var path=require(_0x430f('0x6'));var rimraf=require('rimraf');var config=require(_0x430f('0x7'));var attributes=require(_0x430f('0x8'));module[_0x430f('0x9')]=function(_0x1734f1,_0x95a1cc){return _0x1734f1[_0x430f('0xa')](_0x430f('0xb'),attributes,{'tableName':'analytics_default_reports','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 2a95232..8b156a8 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 _0xdbad=['AnalyticDefaultReport,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','request','then','info','debug','request\x20sent','stringify','error','message'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xdbad,0x93));var _0xddba=function(_0x231e23,_0x19d074){_0x231e23=_0x231e23-0x0;var _0x5538f2=_0xdbad[_0x231e23];return _0x5538f2;};'use strict';var _=require('lodash');var util=require(_0xddba('0x0'));var moment=require('moment');var BPromise=require(_0xddba('0x1'));var rs=require(_0xddba('0x2'));var fs=require('fs');var Redis=require(_0xddba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xddba('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb52f57,_0x4b0ade,_0x420a81){return new BPromise(function(_0x3cff07,_0xeb1286){return client[_0xddba('0x5')](_0xb52f57,_0x420a81)[_0xddba('0x6')](function(_0x382add){logger[_0xddba('0x7')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b0ade,'request\x20sent');logger[_0xddba('0x8')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4b0ade,_0xddba('0x9'),JSON[_0xddba('0xa')](_0x382add));if(_0x382add[_0xddba('0xb')]){if(_0x382add[_0xddba('0xb')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b0ade,_0x382add[_0xddba('0xb')][_0xddba('0xc')]);return _0xeb1286(_0x382add['error'][_0xddba('0xc')]);}logger[_0xddba('0xb')](_0xddba('0xd'),_0x4b0ade,_0x382add[_0xddba('0xb')][_0xddba('0xc')]);return _0x3cff07(_0x382add[_0xddba('0xb')][_0xddba('0xc')]);}else{logger[_0xddba('0x7')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b0ade,_0xddba('0x9'));_0x3cff07(_0x382add[_0xddba('0xe')][_0xddba('0xc')]);}})[_0xddba('0xf')](function(_0x1337aa){logger['error'](_0xddba('0xd'),_0x4b0ade,_0x1337aa);_0xeb1286(_0x1337aa);});});} \ No newline at end of file +var _0xaf20=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x1e21ba,_0x28ac78){var _0x388399=function(_0x496d7a){while(--_0x496d7a){_0x1e21ba['push'](_0x1e21ba['shift']());}};_0x388399(++_0x28ac78);}(_0xaf20,0xdb));var _0x0af2=function(_0x3eb021,_0x35bc0c){_0x3eb021=_0x3eb021-0x0;var _0xd2b18d=_0xaf20[_0x3eb021];return _0xd2b18d;};'use strict';var _=require(_0x0af2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0af2('0x1'));var fs=require('fs');var Redis=require(_0x0af2('0x2'));var db=require(_0x0af2('0x3'))['db'];var utils=require(_0x0af2('0x4'));var logger=require(_0x0af2('0x5'))(_0x0af2('0x6'));var config=require(_0x0af2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0af2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7b41f5,_0x284fd6,_0x164910){return new BPromise(function(_0x113c83,_0x39eb8b){return client[_0x0af2('0x9')](_0x7b41f5,_0x164910)[_0x0af2('0xa')](function(_0x3568f7){logger[_0x0af2('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x284fd6,_0x0af2('0xc'));logger['debug'](_0x0af2('0xd'),_0x284fd6,_0x0af2('0xc'),JSON[_0x0af2('0xe')](_0x3568f7));if(_0x3568f7[_0x0af2('0xf')]){if(_0x3568f7['error'][_0x0af2('0x10')]===0x1f4){logger[_0x0af2('0xf')](_0x0af2('0x11'),_0x284fd6,_0x3568f7['error'][_0x0af2('0x12')]);return _0x39eb8b(_0x3568f7[_0x0af2('0xf')][_0x0af2('0x12')]);}logger[_0x0af2('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x284fd6,_0x3568f7[_0x0af2('0xf')][_0x0af2('0x12')]);return _0x113c83(_0x3568f7['error'][_0x0af2('0x12')]);}else{logger[_0x0af2('0xb')](_0x0af2('0x11'),_0x284fd6,_0x0af2('0xc'));_0x113c83(_0x3568f7[_0x0af2('0x13')][_0x0af2('0x12')]);}})[_0x0af2('0x14')](function(_0xbf09e7){logger[_0x0af2('0xf')](_0x0af2('0x11'),_0x284fd6,_0xbf09e7);_0x39eb8b(_0xbf09e7);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 986aeba..96b41c2 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 _0xc0ef=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','query','create','put','delete'];(function(_0x4a46e8,_0x5ba01d){var _0x4b08bd=function(_0x143397){while(--_0x143397){_0x4a46e8['push'](_0x4a46e8['shift']());}};_0x4b08bd(++_0x5ba01d);}(_0xc0ef,0x109));var _0xfc0e=function(_0x16bc1d,_0x1208aa){_0x16bc1d=_0x16bc1d-0x0;var _0x350e2b=_0xc0ef[_0x16bc1d];return _0x350e2b;};'use strict';var multer=require(_0xfc0e('0x0'));var util=require(_0xfc0e('0x1'));var path=require(_0xfc0e('0x2'));var timeout=require(_0xfc0e('0x3'));var express=require(_0xfc0e('0x4'));var router=express[_0xfc0e('0x5')]();var fs_extra=require(_0xfc0e('0x6'));var auth=require(_0xfc0e('0x7'));var interaction=require(_0xfc0e('0x8'));var config=require(_0xfc0e('0x9'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xfc0e('0xa')](),controller[_0xfc0e('0xb')]);router[_0xfc0e('0xc')](_0xfc0e('0xd'),auth[_0xfc0e('0xa')](),controller[_0xfc0e('0xe')]);router[_0xfc0e('0xc')](_0xfc0e('0xf'),auth[_0xfc0e('0xa')](),controller[_0xfc0e('0x10')]);router[_0xfc0e('0xc')](_0xfc0e('0x11'),auth['isAuthenticated'](),controller[_0xfc0e('0x12')]);router[_0xfc0e('0xc')]('/:id/query',auth[_0xfc0e('0xa')](),controller[_0xfc0e('0x13')]);router['post']('/',auth[_0xfc0e('0xa')](),controller[_0xfc0e('0x14')]);router[_0xfc0e('0x15')](_0xfc0e('0xd'),auth[_0xfc0e('0xa')](),controller['update']);router[_0xfc0e('0x16')](_0xfc0e('0xd'),auth[_0xfc0e('0xa')](),controller['destroy']);module[_0xfc0e('0x17')]=router; \ No newline at end of file +var _0xd2df=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','put','destroy','exports','multer'];(function(_0x5e8c57,_0x272b02){var _0x29c342=function(_0x530fd0){while(--_0x530fd0){_0x5e8c57['push'](_0x5e8c57['shift']());}};_0x29c342(++_0x272b02);}(_0xd2df,0x175));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var path=require(_0xfd2d('0x2'));var timeout=require(_0xfd2d('0x3'));var express=require(_0xfd2d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfd2d('0x5'));var config=require(_0xfd2d('0x6'));var controller=require(_0xfd2d('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfd2d('0x8')](_0xfd2d('0x9'),auth['isAuthenticated'](),controller[_0xfd2d('0xa')]);router[_0xfd2d('0x8')](_0xfd2d('0xb'),auth[_0xfd2d('0xc')](),controller[_0xfd2d('0xd')]);router[_0xfd2d('0x8')](_0xfd2d('0xe'),auth[_0xfd2d('0xc')](),controller[_0xfd2d('0xf')]);router['get'](_0xfd2d('0x10'),auth[_0xfd2d('0xc')](),controller[_0xfd2d('0x11')]);router[_0xfd2d('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfd2d('0x13')](_0xfd2d('0x9'),auth[_0xfd2d('0xc')](),controller['update']);router['delete'](_0xfd2d('0x9'),auth['isAuthenticated'](),controller[_0xfd2d('0x14')]);module[_0xfd2d('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 855ccdb..dfc0eaf 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 _0x8ad6=['xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','csv'];(function(_0x2fd8ec,_0x2a7f3c){var _0x3079e6=function(_0x51e7f1){while(--_0x51e7f1){_0x2fd8ec['push'](_0x2fd8ec['shift']());}};_0x3079e6(++_0x2a7f3c);}(_0x8ad6,0x17c));var _0x68ad=function(_0xbec846,_0x5006f3){_0xbec846=_0xbec846-0x0;var _0x20c393=_0x8ad6[_0xbec846];return _0x20c393;};'use strict';var Sequelize=require(_0x68ad('0x0'));var moment=require(_0x68ad('0x1'));module['exports']={'name':{'type':Sequelize[_0x68ad('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x68ad('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x68ad('0x3'),'pdf',_0x68ad('0x4')),'allowNull':![],'defaultValue':_0x68ad('0x3')},'savename':{'type':Sequelize[_0x68ad('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x68ad('0x5')]},'endDate':{'type':Sequelize[_0x68ad('0x5')]},'status':{'type':Sequelize[_0x68ad('0x2')],'defaultValue':_0x68ad('0x6')},'type':{'type':Sequelize[_0x68ad('0x7')](_0x68ad('0x8'),_0x68ad('0x9')),'allowNull':![],'defaultValue':_0x68ad('0x8')},'reportId':{'type':Sequelize[_0x68ad('0xa')](0xb)[_0x68ad('0xb')]},'reportType':{'type':Sequelize[_0x68ad('0x2')]}}; \ No newline at end of file +var _0xb413=['csv','DATE','Loading','scheduled','manual','UNSIGNED','moment','exports','STRING','ENUM','xlsx'];(function(_0x4af4c7,_0x1b75c2){var _0x438d85=function(_0x127c7b){while(--_0x127c7b){_0x4af4c7['push'](_0x4af4c7['shift']());}};_0x438d85(++_0x1b75c2);}(_0xb413,0x95));var _0x3b41=function(_0x426db8,_0x433ce3){_0x426db8=_0x426db8-0x0;var _0x44aa8b=_0xb413[_0x426db8];return _0x44aa8b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3b41('0x0'));module[_0x3b41('0x1')]={'name':{'type':Sequelize[_0x3b41('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x3b41('0x3')]('csv','pdf',_0x3b41('0x4')),'allowNull':![],'defaultValue':_0x3b41('0x5')},'savename':{'type':Sequelize[_0x3b41('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3b41('0x6')]},'endDate':{'type':Sequelize[_0x3b41('0x6')]},'status':{'type':Sequelize[_0x3b41('0x2')],'defaultValue':_0x3b41('0x7')},'type':{'type':Sequelize[_0x3b41('0x3')]('manual',_0x3b41('0x8')),'allowNull':![],'defaultValue':_0x3b41('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x3b41('0xa')]},'reportType':{'type':Sequelize[_0x3b41('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index bc874b9..edc6be5 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 _0x1557=['limit','count','offset','status','Content-Range','json','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','AnalyticExtractedReport','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','savename','output','existsSync','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','toLowerCase','rimraf','zip-dir','fast-json-patch','bluebird','mustache','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','api','../../config/environment','../../mysqldb','sendStatus','end','undefined'];(function(_0x4ad81b,_0x2ba5b7){var _0x18beb7=function(_0x19813b){while(--_0x19813b){_0x4ad81b['push'](_0x4ad81b['shift']());}};_0x18beb7(++_0x2ba5b7);}(_0x1557,0x10a));var _0x7155=function(_0x193994,_0x40d050){_0x193994=_0x193994-0x0;var _0x1e9596=_0x1557[_0x193994];return _0x1e9596;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7155('0x0'));var zipdir=require(_0x7155('0x1'));var jsonpatch=require(_0x7155('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7155('0x3'));var Mustache=require(_0x7155('0x4'));var util=require('util');var path=require(_0x7155('0x5'));var sox=require(_0x7155('0x6'));var csv=require(_0x7155('0x7'));var ejs=require(_0x7155('0x8'));var fs=require('fs');var fs_extra=require(_0x7155('0x9'));var _=require(_0x7155('0xa'));var squel=require(_0x7155('0xb'));var crypto=require(_0x7155('0xc'));var jsforce=require(_0x7155('0xd'));var deskjs=require(_0x7155('0xe'));var toCsv=require(_0x7155('0x7'));var querystring=require(_0x7155('0xf'));var Papa=require(_0x7155('0x10'));var Redis=require('ioredis');var authService=require(_0x7155('0x11'));var qs=require(_0x7155('0x12'));var as=require(_0x7155('0x13'));var hardwareService=require(_0x7155('0x14'));var logger=require(_0x7155('0x15'))(_0x7155('0x16'));var utils=require('../../config/utils');var config=require(_0x7155('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7155('0x18'))['db'];function respondWithStatusCode(_0x57be5f,_0x278b3d){_0x278b3d=_0x278b3d||0xcc;return function(_0xf99091){if(_0xf99091){return _0x57be5f[_0x7155('0x19')](_0x278b3d);}return _0x57be5f['status'](_0x278b3d)[_0x7155('0x1a')]();};}function respondWithResult(_0x460115,_0x4f3f01){_0x4f3f01=_0x4f3f01||0xc8;return function(_0x57c282){if(_0x57c282){return _0x460115['status'](_0x4f3f01)['json'](_0x57c282);}};}function respondWithFilteredResult(_0x3b3fd5,_0x57b553){return function(_0x52060a){if(_0x52060a){var _0x40c625=typeof _0x57b553['offset']===_0x7155('0x1b')&&typeof _0x57b553[_0x7155('0x1c')]===_0x7155('0x1b');var _0x3a1a81=_0x52060a[_0x7155('0x1d')];var _0x30f211=_0x40c625?0x0:_0x57b553[_0x7155('0x1e')];var _0x1156b2=_0x40c625?_0x52060a[_0x7155('0x1d')]:_0x57b553[_0x7155('0x1e')]+_0x57b553['limit'];var _0x267591;if(_0x1156b2>=_0x3a1a81){_0x1156b2=_0x3a1a81;_0x267591=0xc8;}else{_0x267591=0xce;}_0x3b3fd5[_0x7155('0x1f')](_0x267591);return _0x3b3fd5['set'](_0x7155('0x20'),_0x30f211+'-'+_0x1156b2+'/'+_0x3a1a81)[_0x7155('0x21')](_0x52060a);}return null;};}function patchUpdates(_0x10ba17){return function(_0x17cc81){try{jsonpatch[_0x7155('0x22')](_0x17cc81,_0x10ba17,!![]);}catch(_0x45f89e){return BPromise[_0x7155('0x23')](_0x45f89e);}return _0x17cc81[_0x7155('0x24')]();};}function saveUpdates(_0x28821f,_0x140ee8){return function(_0x1a1167){if(_0x1a1167){return _0x1a1167[_0x7155('0x25')](_0x28821f)[_0x7155('0x26')](function(_0x53d88f){return _0x53d88f;});}return null;};}function removeEntity(_0x268956,_0x568197){return function(_0x1a977a){if(_0x1a977a){return _0x1a977a[_0x7155('0x27')]()[_0x7155('0x26')](function(){var _0x33296e=_0x1a977a[_0x7155('0x28')]({'plain':!![]});var _0x5865bf=_0x7155('0x29');return db[_0x7155('0x2a')][_0x7155('0x27')]({'where':{'type':_0x5865bf,'resourceId':_0x33296e['id']}})[_0x7155('0x26')](function(){return _0x1a977a;});})[_0x7155('0x26')](function(){_0x268956[_0x7155('0x1f')](0xcc)[_0x7155('0x1a')]();});}};}function handleEntityNotFound(_0x544e24,_0x595d63){return function(_0x35422c){if(!_0x35422c){_0x544e24[_0x7155('0x19')](0x194);}return _0x35422c;};}function handleError(_0x50dffd,_0xbcd544){_0xbcd544=_0xbcd544||0x1f4;return function(_0x2c7eac){logger[_0x7155('0x2b')](_0x2c7eac[_0x7155('0x2c')]);if(_0x2c7eac[_0x7155('0x2d')]){delete _0x2c7eac['name'];}_0x50dffd[_0x7155('0x1f')](_0xbcd544)['send'](_0x2c7eac);};}exports['index']=function(_0x557e19,_0x3c39d9){var _0x17f529={},_0x3ac192={},_0xbe838e={'count':0x0,'rows':[]};var _0x516b49=_[_0x7155('0x2e')](db['AnalyticExtractedReport'][_0x7155('0x2f')],function(_0x4acdac){return{'name':_0x4acdac[_0x7155('0x30')],'type':_0x4acdac[_0x7155('0x31')][_0x7155('0x32')]};});_0x3ac192[_0x7155('0x33')]=_['map'](_0x516b49,_0x7155('0x2d'));_0x3ac192[_0x7155('0x34')]=_[_0x7155('0x35')](_0x557e19[_0x7155('0x34')]);_0x3ac192['filters']=_[_0x7155('0x36')](_0x3ac192[_0x7155('0x33')],_0x3ac192[_0x7155('0x34')]);_0x17f529[_0x7155('0x37')]=_['intersection'](_0x3ac192[_0x7155('0x33')],qs[_0x7155('0x38')](_0x557e19[_0x7155('0x34')][_0x7155('0x38')]));_0x17f529[_0x7155('0x37')]=_0x17f529['attributes'][_0x7155('0x39')]?_0x17f529[_0x7155('0x37')]:_0x3ac192[_0x7155('0x33')];if(!_0x557e19['query'][_0x7155('0x3a')](_0x7155('0x3b'))){_0x17f529[_0x7155('0x1c')]=qs['limit'](_0x557e19[_0x7155('0x34')]['limit']);_0x17f529['offset']=qs[_0x7155('0x1e')](_0x557e19[_0x7155('0x34')][_0x7155('0x1e')]);}_0x17f529[_0x7155('0x3c')]=qs['sort'](_0x557e19[_0x7155('0x34')]['sort']);_0x17f529[_0x7155('0x3d')]=qs[_0x7155('0x3e')](_[_0x7155('0x3f')](_0x557e19[_0x7155('0x34')],_0x3ac192[_0x7155('0x3e')]),_0x516b49);if(_0x557e19[_0x7155('0x34')][_0x7155('0x40')]){_0x17f529[_0x7155('0x3d')]=_[_0x7155('0x41')](_0x17f529[_0x7155('0x3d')],{'$or':_['map'](_0x516b49,function(_0x167c09){if(_0x167c09[_0x7155('0x31')]!==_0x7155('0x42')){var _0xaac932={};_0xaac932[_0x167c09[_0x7155('0x2d')]]={'$like':'%'+_0x557e19['query'][_0x7155('0x40')]+'%'};return _0xaac932;}})});}_0x17f529=_[_0x7155('0x41')]({},_0x17f529,_0x557e19['options']);var _0xd7f37={'where':_0x17f529[_0x7155('0x3d')]};return db['AnalyticExtractedReport']['count'](_0xd7f37)['then'](function(_0x4de551){_0xbe838e[_0x7155('0x1d')]=_0x4de551;if(_0x557e19[_0x7155('0x34')][_0x7155('0x43')]){_0x17f529[_0x7155('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x7155('0x45')](_0x17f529);})['then'](function(_0x50584c){_0xbe838e['rows']=_0x50584c;return _0xbe838e;})[_0x7155('0x26')](respondWithFilteredResult(_0x3c39d9,_0x17f529))[_0x7155('0x46')](handleError(_0x3c39d9,null));};exports[_0x7155('0x47')]=function(_0x888b8,_0x37f0ad){var _0x105d87={'raw':!![],'where':{'id':_0x888b8[_0x7155('0x48')]['id']}},_0x2ac7b9={};_0x2ac7b9[_0x7155('0x33')]=_['keys'](db[_0x7155('0x49')][_0x7155('0x2f')]);_0x2ac7b9[_0x7155('0x34')]=_[_0x7155('0x35')](_0x888b8[_0x7155('0x34')]);_0x2ac7b9[_0x7155('0x3e')]=_[_0x7155('0x36')](_0x2ac7b9['model'],_0x2ac7b9['query']);_0x105d87['attributes']=_['intersection'](_0x2ac7b9[_0x7155('0x33')],qs[_0x7155('0x38')](_0x888b8[_0x7155('0x34')]['fields']));_0x105d87[_0x7155('0x37')]=_0x105d87[_0x7155('0x37')][_0x7155('0x39')]?_0x105d87[_0x7155('0x37')]:_0x2ac7b9[_0x7155('0x33')];if(_0x888b8['query'][_0x7155('0x43')]){_0x105d87[_0x7155('0x44')]=[{'all':!![]}];}_0x105d87=_['merge']({},_0x105d87,_0x888b8[_0x7155('0x4a')]);return db[_0x7155('0x49')][_0x7155('0x4b')](_0x105d87)[_0x7155('0x26')](handleEntityNotFound(_0x37f0ad,null))[_0x7155('0x26')](respondWithResult(_0x37f0ad,null))[_0x7155('0x46')](handleError(_0x37f0ad,null));};exports[_0x7155('0x4c')]=function(_0x1419db,_0x2ee7dd){return db[_0x7155('0x49')][_0x7155('0x4c')](_0x1419db['body'],{})[_0x7155('0x26')](function(_0x59220f){var _0x63418a=_0x1419db[_0x7155('0x4d')][_0x7155('0x28')]({'plain':!![]});if(!_0x63418a)throw new Error(_0x7155('0x4e'));if(_0x63418a[_0x7155('0x4f')]===_0x7155('0x4d')){var _0x14c243=_0x59220f[_0x7155('0x28')]({'plain':!![]});var _0x463476=_0x7155('0x29');return db[_0x7155('0x50')][_0x7155('0x4b')]({'where':{'name':_0x463476,'userProfileId':_0x63418a[_0x7155('0x51')]},'raw':!![]})['then'](function(_0x5b7706){if(_0x5b7706&&_0x5b7706[_0x7155('0x52')]===0x0){return db['UserProfileResource'][_0x7155('0x4c')]({'name':_0x14c243[_0x7155('0x2d')],'resourceId':_0x14c243['id'],'type':_0x5b7706[_0x7155('0x2d')],'sectionId':_0x5b7706['id']},{})[_0x7155('0x26')](function(){return _0x59220f;});}else{return _0x59220f;}})[_0x7155('0x46')](function(_0x38e20d){logger['error'](_0x7155('0x53'),_0x38e20d);throw _0x38e20d;});}return _0x59220f;})[_0x7155('0x26')](respondWithResult(_0x2ee7dd,0xc9))[_0x7155('0x46')](handleError(_0x2ee7dd,null));};exports[_0x7155('0x25')]=function(_0x11a639,_0x152a1b){if(_0x11a639[_0x7155('0x54')]['id']){delete _0x11a639['body']['id'];}return db[_0x7155('0x49')]['find']({'where':{'id':_0x11a639[_0x7155('0x48')]['id']}})[_0x7155('0x26')](handleEntityNotFound(_0x152a1b,null))['then'](saveUpdates(_0x11a639[_0x7155('0x54')],null))[_0x7155('0x26')](respondWithResult(_0x152a1b,null))['catch'](handleError(_0x152a1b,null));};exports[_0x7155('0x27')]=function(_0x44effc,_0x809e68){return db['AnalyticExtractedReport'][_0x7155('0x4b')]({'where':{'id':_0x44effc[_0x7155('0x48')]['id']}})['then'](handleEntityNotFound(_0x809e68,null))[_0x7155('0x26')](removeEntity(_0x809e68,null))[_0x7155('0x46')](handleError(_0x809e68,null));};exports[_0x7155('0x55')]=function(_0x1fe742,_0xa8cc3d,_0xd81a56){return db[_0x7155('0x49')][_0x7155('0x4b')]({'where':{'id':_0x1fe742[_0x7155('0x48')]['id']},'attributes':[_0x7155('0x2d'),'basename',_0x7155('0x56'),_0x7155('0x57')],'raw':!![]})[_0x7155('0x26')](handleEntityNotFound(_0xa8cc3d,null))['then'](function(_0x4b23a5){if(_0x4b23a5){if(!fs[_0x7155('0x58')](path[_0x7155('0x59')](config[_0x7155('0x5a')],_0x7155('0x5b'),_0x4b23a5['savename']))){throw new db['Sequelize']['ValidationError'](_0x7155('0x5c'));}if(_0x1fe742[_0x7155('0x34')][_0x7155('0x5d')]){return _0xa8cc3d[_0x7155('0x19')](0xc8);}return _0xa8cc3d[_0x7155('0x55')](path[_0x7155('0x59')](config[_0x7155('0x5a')],_0x7155('0x5b'),_0x4b23a5[_0x7155('0x56')]),util[_0x7155('0x5e')](_0x7155('0x5f'),_0x4b23a5[_0x7155('0x60')]||_0x4b23a5['name'],_0x4b23a5[_0x7155('0x57')][_0x7155('0x61')]()));}})['catch'](handleError(_0xa8cc3d,null));}; \ No newline at end of file +var _0xf36b=['length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','body','savename','output','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','join','format','%s.%s','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','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','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','end','stack','name','send','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','show','params'];(function(_0x4b99f4,_0x19c2c7){var _0xf1fb0e=function(_0x566872){while(--_0x566872){_0x4b99f4['push'](_0x4b99f4['shift']());}};_0xf1fb0e(++_0x19c2c7);}(_0xf36b,0x1eb));var _0xbf36=function(_0x3a286e,_0x2eb1f3){_0x3a286e=_0x3a286e-0x0;var _0x2c8e37=_0xf36b[_0x3a286e];return _0x2c8e37;};'use strict';var emlformat=require(_0xbf36('0x0'));var rimraf=require(_0xbf36('0x1'));var zipdir=require(_0xbf36('0x2'));var jsonpatch=require(_0xbf36('0x3'));var rp=require(_0xbf36('0x4'));var moment=require(_0xbf36('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf36('0x6'));var path=require(_0xbf36('0x7'));var sox=require(_0xbf36('0x8'));var csv=require(_0xbf36('0x9'));var ejs=require(_0xbf36('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbf36('0xb'));var crypto=require(_0xbf36('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf36('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbf36('0xe'));var Papa=require(_0xbf36('0xf'));var Redis=require('ioredis');var authService=require(_0xbf36('0x10'));var qs=require(_0xbf36('0x11'));var as=require(_0xbf36('0x12'));var hardwareService=require(_0xbf36('0x13'));var logger=require(_0xbf36('0x14'))(_0xbf36('0x15'));var utils=require(_0xbf36('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbf36('0x17'));var db=require(_0xbf36('0x18'))['db'];function respondWithStatusCode(_0x58510a,_0x103afb){_0x103afb=_0x103afb||0xcc;return function(_0x367e9d){if(_0x367e9d){return _0x58510a[_0xbf36('0x19')](_0x103afb);}return _0x58510a[_0xbf36('0x1a')](_0x103afb)['end']();};}function respondWithResult(_0x1c188b,_0x19bb95){_0x19bb95=_0x19bb95||0xc8;return function(_0x4e0475){if(_0x4e0475){return _0x1c188b[_0xbf36('0x1a')](_0x19bb95)[_0xbf36('0x1b')](_0x4e0475);}};}function respondWithFilteredResult(_0xc87af6,_0x2f639a){return function(_0x41925e){if(_0x41925e){var _0x49c499=typeof _0x2f639a['offset']===_0xbf36('0x1c')&&typeof _0x2f639a[_0xbf36('0x1d')]===_0xbf36('0x1c');var _0x2b5f46=_0x41925e[_0xbf36('0x1e')];var _0x2ac591=_0x49c499?0x0:_0x2f639a[_0xbf36('0x1f')];var _0x3a2806=_0x49c499?_0x41925e[_0xbf36('0x1e')]:_0x2f639a['offset']+_0x2f639a[_0xbf36('0x1d')];var _0x30a5a8;if(_0x3a2806>=_0x2b5f46){_0x3a2806=_0x2b5f46;_0x30a5a8=0xc8;}else{_0x30a5a8=0xce;}_0xc87af6['status'](_0x30a5a8);return _0xc87af6[_0xbf36('0x20')](_0xbf36('0x21'),_0x2ac591+'-'+_0x3a2806+'/'+_0x2b5f46)[_0xbf36('0x1b')](_0x41925e);}return null;};}function patchUpdates(_0x2d1a34){return function(_0x1e98d7){try{jsonpatch[_0xbf36('0x22')](_0x1e98d7,_0x2d1a34,!![]);}catch(_0x4fc8a9){return BPromise[_0xbf36('0x23')](_0x4fc8a9);}return _0x1e98d7[_0xbf36('0x24')]();};}function saveUpdates(_0x14a24c,_0x7ce629){return function(_0x496a98){if(_0x496a98){return _0x496a98[_0xbf36('0x25')](_0x14a24c)[_0xbf36('0x26')](function(_0x3e47d6){return _0x3e47d6;});}return null;};}function removeEntity(_0x28fd79,_0xc7e934){return function(_0x2f64b6){if(_0x2f64b6){return _0x2f64b6[_0xbf36('0x27')]()[_0xbf36('0x26')](function(){var _0x176513=_0x2f64b6[_0xbf36('0x28')]({'plain':!![]});var _0x2b2a85=_0xbf36('0x29');return db['UserProfileResource'][_0xbf36('0x27')]({'where':{'type':_0x2b2a85,'resourceId':_0x176513['id']}})[_0xbf36('0x26')](function(){return _0x2f64b6;});})[_0xbf36('0x26')](function(){_0x28fd79[_0xbf36('0x1a')](0xcc)[_0xbf36('0x2a')]();});}};}function handleEntityNotFound(_0x1be704,_0x4301b9){return function(_0x10036b){if(!_0x10036b){_0x1be704[_0xbf36('0x19')](0x194);}return _0x10036b;};}function handleError(_0x20a1fa,_0x300ed8){_0x300ed8=_0x300ed8||0x1f4;return function(_0x4ed750){logger['error'](_0x4ed750[_0xbf36('0x2b')]);if(_0x4ed750[_0xbf36('0x2c')]){delete _0x4ed750['name'];}_0x20a1fa['status'](_0x300ed8)[_0xbf36('0x2d')](_0x4ed750);};}exports['index']=function(_0x2e4d9a,_0x399265){var _0x1a7cf8={},_0x39766c={},_0x4e8a97={'count':0x0,'rows':[]};var _0x48f67b=_[_0xbf36('0x2e')](db['AnalyticExtractedReport'][_0xbf36('0x2f')],function(_0x213bca){return{'name':_0x213bca['fieldName'],'type':_0x213bca[_0xbf36('0x30')][_0xbf36('0x31')]};});_0x39766c[_0xbf36('0x32')]=_['map'](_0x48f67b,_0xbf36('0x2c'));_0x39766c[_0xbf36('0x33')]=_[_0xbf36('0x34')](_0x2e4d9a[_0xbf36('0x33')]);_0x39766c['filters']=_['intersection'](_0x39766c['model'],_0x39766c['query']);_0x1a7cf8['attributes']=_[_0xbf36('0x35')](_0x39766c['model'],qs[_0xbf36('0x36')](_0x2e4d9a[_0xbf36('0x33')][_0xbf36('0x36')]));_0x1a7cf8['attributes']=_0x1a7cf8[_0xbf36('0x37')]['length']?_0x1a7cf8[_0xbf36('0x37')]:_0x39766c[_0xbf36('0x32')];if(!_0x2e4d9a['query'][_0xbf36('0x38')](_0xbf36('0x39'))){_0x1a7cf8[_0xbf36('0x1d')]=qs[_0xbf36('0x1d')](_0x2e4d9a[_0xbf36('0x33')][_0xbf36('0x1d')]);_0x1a7cf8[_0xbf36('0x1f')]=qs['offset'](_0x2e4d9a[_0xbf36('0x33')][_0xbf36('0x1f')]);}_0x1a7cf8['order']=qs[_0xbf36('0x3a')](_0x2e4d9a[_0xbf36('0x33')]['sort']);_0x1a7cf8[_0xbf36('0x3b')]=qs[_0xbf36('0x3c')](_[_0xbf36('0x3d')](_0x2e4d9a[_0xbf36('0x33')],_0x39766c[_0xbf36('0x3c')]),_0x48f67b);if(_0x2e4d9a['query'][_0xbf36('0x3e')]){_0x1a7cf8['where']=_[_0xbf36('0x3f')](_0x1a7cf8['where'],{'$or':_[_0xbf36('0x2e')](_0x48f67b,function(_0x4ad6f6){if(_0x4ad6f6[_0xbf36('0x30')]!==_0xbf36('0x40')){var _0x2a03b9={};_0x2a03b9[_0x4ad6f6['name']]={'$like':'%'+_0x2e4d9a[_0xbf36('0x33')]['filter']+'%'};return _0x2a03b9;}})});}_0x1a7cf8=_[_0xbf36('0x3f')]({},_0x1a7cf8,_0x2e4d9a[_0xbf36('0x41')]);var _0x334ebd={'where':_0x1a7cf8['where']};return db[_0xbf36('0x42')]['count'](_0x334ebd)[_0xbf36('0x26')](function(_0x3510d7){_0x4e8a97['count']=_0x3510d7;if(_0x2e4d9a['query'][_0xbf36('0x43')]){_0x1a7cf8[_0xbf36('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xbf36('0x45')](_0x1a7cf8);})[_0xbf36('0x26')](function(_0x15a8f1){_0x4e8a97[_0xbf36('0x46')]=_0x15a8f1;return _0x4e8a97;})[_0xbf36('0x26')](respondWithFilteredResult(_0x399265,_0x1a7cf8))['catch'](handleError(_0x399265,null));};exports[_0xbf36('0x47')]=function(_0x27d062,_0x3410c9){var _0x59faba={'raw':!![],'where':{'id':_0x27d062[_0xbf36('0x48')]['id']}},_0x3cf6d4={};_0x3cf6d4[_0xbf36('0x32')]=_['keys'](db[_0xbf36('0x42')][_0xbf36('0x2f')]);_0x3cf6d4[_0xbf36('0x33')]=_['keys'](_0x27d062['query']);_0x3cf6d4[_0xbf36('0x3c')]=_[_0xbf36('0x35')](_0x3cf6d4[_0xbf36('0x32')],_0x3cf6d4['query']);_0x59faba['attributes']=_[_0xbf36('0x35')](_0x3cf6d4['model'],qs[_0xbf36('0x36')](_0x27d062[_0xbf36('0x33')][_0xbf36('0x36')]));_0x59faba[_0xbf36('0x37')]=_0x59faba[_0xbf36('0x37')][_0xbf36('0x49')]?_0x59faba[_0xbf36('0x37')]:_0x3cf6d4[_0xbf36('0x32')];if(_0x27d062[_0xbf36('0x33')][_0xbf36('0x43')]){_0x59faba[_0xbf36('0x44')]=[{'all':!![]}];}_0x59faba=_[_0xbf36('0x3f')]({},_0x59faba,_0x27d062[_0xbf36('0x41')]);return db['AnalyticExtractedReport'][_0xbf36('0x4a')](_0x59faba)[_0xbf36('0x26')](handleEntityNotFound(_0x3410c9,null))[_0xbf36('0x26')](respondWithResult(_0x3410c9,null))[_0xbf36('0x4b')](handleError(_0x3410c9,null));};exports[_0xbf36('0x4c')]=function(_0x8abeb5,_0x36e3f7){return db['AnalyticExtractedReport'][_0xbf36('0x4c')](_0x8abeb5['body'],{})[_0xbf36('0x26')](function(_0xb76d5d){var _0xc45dd0=_0x8abeb5[_0xbf36('0x4d')][_0xbf36('0x28')]({'plain':!![]});if(!_0xc45dd0)throw new Error(_0xbf36('0x4e'));if(_0xc45dd0[_0xbf36('0x4f')]===_0xbf36('0x4d')){var _0x4d3d52=_0xb76d5d[_0xbf36('0x28')]({'plain':!![]});var _0x3041b6='ExtractedReports';return db[_0xbf36('0x50')][_0xbf36('0x4a')]({'where':{'name':_0x3041b6,'userProfileId':_0xc45dd0[_0xbf36('0x51')]},'raw':!![]})[_0xbf36('0x26')](function(_0x1aac18){if(_0x1aac18&&_0x1aac18['autoAssociation']===0x0){return db[_0xbf36('0x52')]['create']({'name':_0x4d3d52[_0xbf36('0x2c')],'resourceId':_0x4d3d52['id'],'type':_0x1aac18[_0xbf36('0x2c')],'sectionId':_0x1aac18['id']},{})[_0xbf36('0x26')](function(){return _0xb76d5d;});}else{return _0xb76d5d;}})['catch'](function(_0x5149df){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5149df);throw _0x5149df;});}return _0xb76d5d;})[_0xbf36('0x26')](respondWithResult(_0x36e3f7,0xc9))[_0xbf36('0x4b')](handleError(_0x36e3f7,null));};exports[_0xbf36('0x25')]=function(_0x274ce5,_0xa0c27e){if(_0x274ce5[_0xbf36('0x53')]['id']){delete _0x274ce5[_0xbf36('0x53')]['id'];}return db['AnalyticExtractedReport'][_0xbf36('0x4a')]({'where':{'id':_0x274ce5[_0xbf36('0x48')]['id']}})['then'](handleEntityNotFound(_0xa0c27e,null))[_0xbf36('0x26')](saveUpdates(_0x274ce5[_0xbf36('0x53')],null))[_0xbf36('0x26')](respondWithResult(_0xa0c27e,null))[_0xbf36('0x4b')](handleError(_0xa0c27e,null));};exports['destroy']=function(_0x35d622,_0x510862){return db[_0xbf36('0x42')][_0xbf36('0x4a')]({'where':{'id':_0x35d622[_0xbf36('0x48')]['id']}})['then'](handleEntityNotFound(_0x510862,null))['then'](removeEntity(_0x510862,null))[_0xbf36('0x4b')](handleError(_0x510862,null));};exports['download']=function(_0x43acc7,_0x56638b,_0x5cf661){return db[_0xbf36('0x42')][_0xbf36('0x4a')]({'where':{'id':_0x43acc7[_0xbf36('0x48')]['id']},'attributes':[_0xbf36('0x2c'),'basename',_0xbf36('0x54'),_0xbf36('0x55')],'raw':!![]})[_0xbf36('0x26')](handleEntityNotFound(_0x56638b,null))[_0xbf36('0x26')](function(_0x4bf2d2){if(_0x4bf2d2){if(!fs['existsSync'](path['join'](config[_0xbf36('0x56')],_0xbf36('0x57'),_0x4bf2d2['savename']))){throw new db[(_0xbf36('0x58'))]['ValidationError'](_0xbf36('0x59'));}if(_0x43acc7[_0xbf36('0x33')]['exists']){return _0x56638b[_0xbf36('0x19')](0xc8);}return _0x56638b['download'](path[_0xbf36('0x5a')](config[_0xbf36('0x56')],_0xbf36('0x57'),_0x4bf2d2[_0xbf36('0x54')]),util[_0xbf36('0x5b')](_0xbf36('0x5c'),_0x4bf2d2[_0xbf36('0x5d')]||_0x4bf2d2[_0xbf36('0x2c')],_0x4bf2d2['output']['toLowerCase']()));}})['catch'](handleError(_0x56638b,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 6e6d73e..f6f1f4c 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 _0x1abb=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','util','moment'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x1abb,0x17a));var _0xb1ab=function(_0x21145f,_0x3d9fef){_0x21145f=_0x21145f-0x0;var _0x3c0d97=_0x1abb[_0x21145f];return _0x3c0d97;};'use strict';var _=require('lodash');var util=require(_0xb1ab('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb1ab('0x1'));var BPromise=require(_0xb1ab('0x2'));var rp=require(_0xb1ab('0x3'));var fs=require('fs');var path=require(_0xb1ab('0x4'));var rimraf=require(_0xb1ab('0x5'));var config=require(_0xb1ab('0x6'));var attributes=require(_0xb1ab('0x7'));module['exports']=function(_0xcf0b0a,_0x5b5dd7){return _0xcf0b0a['define'](_0xb1ab('0x8'),attributes,{'tableName':_0xb1ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56b2=['moment','request-promise','path','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x4300a8,_0x197afd){var _0x224398=function(_0x8a8d98){while(--_0x8a8d98){_0x4300a8['push'](_0x4300a8['shift']());}};_0x224398(++_0x197afd);}(_0x56b2,0x180));var _0x256b=function(_0x542280,_0x570450){_0x542280=_0x542280-0x0;var _0x18ea72=_0x56b2[_0x542280];return _0x18ea72;};'use strict';var _=require(_0x256b('0x0'));var util=require(_0x256b('0x1'));var logger=require(_0x256b('0x2'))('api');var moment=require(_0x256b('0x3'));var BPromise=require('bluebird');var rp=require(_0x256b('0x4'));var fs=require('fs');var path=require(_0x256b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x30e76c,_0x2f4b7b){return _0x30e76c[_0x256b('0x6')](_0x256b('0x7'),attributes,{'tableName':_0x256b('0x8'),'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 b5a67fb..9397805 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 _0xc33d=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x279742,_0x3d5924){var _0x17aaac=function(_0x2b2aeb){while(--_0x2b2aeb){_0x279742['push'](_0x279742['shift']());}};_0x17aaac(++_0x3d5924);}(_0xc33d,0x1cd));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdc33('0x0'));var moment=require(_0xdc33('0x1'));var BPromise=require(_0xdc33('0x2'));var rs=require(_0xdc33('0x3'));var fs=require('fs');var Redis=require(_0xdc33('0x4'));var db=require(_0xdc33('0x5'))['db'];var utils=require(_0xdc33('0x6'));var logger=require(_0xdc33('0x7'))(_0xdc33('0x8'));var config=require(_0xdc33('0x9'));var jayson=require(_0xdc33('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3632f8,_0x4c5d67,_0x11c732){return new BPromise(function(_0x57d79b,_0x7f67ff){return client[_0xdc33('0xb')](_0x3632f8,_0x11c732)[_0xdc33('0xc')](function(_0x50f903){logger[_0xdc33('0xd')](_0xdc33('0xe'),_0x4c5d67,_0xdc33('0xf'));logger[_0xdc33('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4c5d67,_0xdc33('0xf'),JSON[_0xdc33('0x11')](_0x50f903));if(_0x50f903[_0xdc33('0x12')]){if(_0x50f903[_0xdc33('0x12')][_0xdc33('0x13')]===0x1f4){logger[_0xdc33('0x12')](_0xdc33('0xe'),_0x4c5d67,_0x50f903[_0xdc33('0x12')][_0xdc33('0x14')]);return _0x7f67ff(_0x50f903[_0xdc33('0x12')][_0xdc33('0x14')]);}logger[_0xdc33('0x12')](_0xdc33('0xe'),_0x4c5d67,_0x50f903[_0xdc33('0x12')][_0xdc33('0x14')]);return _0x57d79b(_0x50f903['error']['message']);}else{logger[_0xdc33('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c5d67,_0xdc33('0xf'));_0x57d79b(_0x50f903[_0xdc33('0x15')]['message']);}})[_0xdc33('0x16')](function(_0x4577c9){logger[_0xdc33('0x12')](_0xdc33('0xe'),_0x4c5d67,_0x4577c9);_0x7f67ff(_0x4577c9);});});} \ No newline at end of file +var _0xa82d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring'];(function(_0x1360e2,_0x989463){var _0x3ff882=function(_0x4a281b){while(--_0x4a281b){_0x1360e2['push'](_0x1360e2['shift']());}};_0x3ff882(++_0x989463);}(_0xa82d,0x183));var _0xda82=function(_0x1c8dd6,_0x2264cb){_0x1c8dd6=_0x1c8dd6-0x0;var _0x101890=_0xa82d[_0x1c8dd6];return _0x101890;};'use strict';var _=require(_0xda82('0x0'));var util=require(_0xda82('0x1'));var moment=require(_0xda82('0x2'));var BPromise=require('bluebird');var rs=require(_0xda82('0x3'));var fs=require('fs');var Redis=require(_0xda82('0x4'));var db=require(_0xda82('0x5'))['db'];var utils=require(_0xda82('0x6'));var logger=require(_0xda82('0x7'))(_0xda82('0x8'));var config=require(_0xda82('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xda82('0xa')][_0xda82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b0aa5,_0x28faff,_0x3a2632){return new BPromise(function(_0x190aa9,_0x2c2552){return client[_0xda82('0xc')](_0x2b0aa5,_0x3a2632)[_0xda82('0xd')](function(_0x477b56){logger['info'](_0xda82('0xe'),_0x28faff,_0xda82('0xf'));logger[_0xda82('0x10')](_0xda82('0x11'),_0x28faff,_0xda82('0xf'),JSON[_0xda82('0x12')](_0x477b56));if(_0x477b56[_0xda82('0x13')]){if(_0x477b56['error'][_0xda82('0x14')]===0x1f4){logger[_0xda82('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x28faff,_0x477b56[_0xda82('0x13')]['message']);return _0x2c2552(_0x477b56[_0xda82('0x13')][_0xda82('0x15')]);}logger[_0xda82('0x13')](_0xda82('0xe'),_0x28faff,_0x477b56[_0xda82('0x13')]['message']);return _0x190aa9(_0x477b56['error'][_0xda82('0x15')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x28faff,'request\x20sent');_0x190aa9(_0x477b56[_0xda82('0x16')][_0xda82('0x15')]);}})['catch'](function(_0x1c0a0c){logger[_0xda82('0x13')](_0xda82('0xe'),_0x28faff,_0x1c0a0c);_0x2c2552(_0x1c0a0c);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 0afa857..956b3a1 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 _0xbe97=['create','put','update','/:id','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','show','/:id/download','isAuthenticated','post'];(function(_0x3b7a67,_0x31c21b){var _0x17c30d=function(_0x2e2987){while(--_0x2e2987){_0x3b7a67['push'](_0x3b7a67['shift']());}};_0x17c30d(++_0x31c21b);}(_0xbe97,0x192));var _0x7be9=function(_0xef0de3,_0xe1a0cd){_0xef0de3=_0xef0de3-0x0;var _0x2adcc4=_0xbe97[_0xef0de3];return _0x2adcc4;};'use strict';var multer=require(_0x7be9('0x0'));var util=require(_0x7be9('0x1'));var path=require('path');var timeout=require(_0x7be9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7be9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7be9('0x4'));var config=require(_0x7be9('0x5'));var controller=require(_0x7be9('0x6'));router[_0x7be9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7be9('0x8')]);router['get'](_0x7be9('0x9'),auth[_0x7be9('0xa')](),controller['download']);router[_0x7be9('0xb')]('/',auth[_0x7be9('0xa')](),controller[_0x7be9('0xc')]);router[_0x7be9('0xd')]('/:id',auth[_0x7be9('0xa')](),controller[_0x7be9('0xe')]);router['delete'](_0x7be9('0xf'),auth['isAuthenticated'](),controller[_0x7be9('0x10')]);module[_0x7be9('0x11')]=router; \ No newline at end of file +var _0x3530=['./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a1dd1,_0x216c78){var _0x14d445=function(_0x4d30eb){while(--_0x4d30eb){_0x4a1dd1['push'](_0x4a1dd1['shift']());}};_0x14d445(++_0x216c78);}(_0x3530,0x132));var _0x0353=function(_0x19389a,_0x4e0ad5){_0x19389a=_0x19389a-0x0;var _0x2d6cec=_0x3530[_0x19389a];return _0x2d6cec;};'use strict';var multer=require('multer');var util=require(_0x0353('0x0'));var path=require(_0x0353('0x1'));var timeout=require(_0x0353('0x2'));var express=require(_0x0353('0x3'));var router=express[_0x0353('0x4')]();var fs_extra=require(_0x0353('0x5'));var auth=require(_0x0353('0x6'));var interaction=require(_0x0353('0x7'));var config=require(_0x0353('0x8'));var controller=require(_0x0353('0x9'));router[_0x0353('0xa')]('/',auth[_0x0353('0xb')](),controller['index']);router[_0x0353('0xa')](_0x0353('0xc'),auth['isAuthenticated'](),controller[_0x0353('0xd')]);router['get'](_0x0353('0xe'),auth[_0x0353('0xb')](),controller[_0x0353('0xf')]);router[_0x0353('0x10')]('/',auth[_0x0353('0xb')](),controller[_0x0353('0x11')]);router[_0x0353('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0353('0x13')]);router[_0x0353('0x14')](_0x0353('0xc'),auth[_0x0353('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index ca147b0..495d3c3 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 _0x2634=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3bee50,_0x24e0f3){var _0x482c66=function(_0xbf22b9){while(--_0xbf22b9){_0x3bee50['push'](_0x3bee50['shift']());}};_0x482c66(++_0x24e0f3);}(_0x2634,0x18e));var _0x4263=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2634[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x4263('0x0'));module[_0x4263('0x1')]={'field':{'type':Sequelize[_0x4263('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x4263('0x3')]},'format':{'type':Sequelize[_0x4263('0x3')]},'groupBy':{'type':Sequelize[_0x4263('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4263('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x989d=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x4a3366,_0x56c2e8){var _0x23882b=function(_0x31f052){while(--_0x31f052){_0x4a3366['push'](_0x4a3366['shift']());}};_0x23882b(++_0x56c2e8);}(_0x989d,0x1d9));var _0xd989=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x989d[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xd989('0x0'));module['exports']={'field':{'type':Sequelize[_0xd989('0x1')]},'alias':{'type':Sequelize[_0xd989('0x2')]},'function':{'type':Sequelize[_0xd989('0x2')]},'format':{'type':Sequelize[_0xd989('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd989('0x2')]},'custom':{'type':Sequelize[_0xd989('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 228b60c..a2b723a 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 _0xb28e=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x37216c,_0x57588a){var _0x24761d=function(_0x446b49){while(--_0x446b49){_0x37216c['push'](_0x37216c['shift']());}};_0x24761d(++_0x57588a);}(_0xb28e,0x98));var _0xeb28=function(_0x329101,_0x1eb476){_0x329101=_0x329101-0x0;var _0x1641d6=_0xb28e[_0x329101];return _0x1641d6;};'use strict';var emlformat=require(_0xeb28('0x0'));var rimraf=require(_0xeb28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb28('0x2'));var rp=require(_0xeb28('0x3'));var moment=require('moment');var BPromise=require(_0xeb28('0x4'));var Mustache=require(_0xeb28('0x5'));var util=require(_0xeb28('0x6'));var path=require('path');var sox=require(_0xeb28('0x7'));var csv=require(_0xeb28('0x8'));var ejs=require(_0xeb28('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb28('0xa'));var squel=require(_0xeb28('0xb'));var crypto=require(_0xeb28('0xc'));var jsforce=require(_0xeb28('0xd'));var deskjs=require(_0xeb28('0xe'));var toCsv=require(_0xeb28('0x8'));var querystring=require('querystring');var Papa=require(_0xeb28('0xf'));var Redis=require(_0xeb28('0x10'));var authService=require(_0xeb28('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeb28('0x12'));var hardwareService=require(_0xeb28('0x13'));var logger=require(_0xeb28('0x14'))('api');var utils=require(_0xeb28('0x15'));var config=require(_0xeb28('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251a1a,_0x3a7e34){_0x3a7e34=_0x3a7e34||0xcc;return function(_0x475741){if(_0x475741){return _0x251a1a[_0xeb28('0x17')](_0x3a7e34);}return _0x251a1a['status'](_0x3a7e34)['end']();};}function respondWithResult(_0x83eb53,_0x27a226){_0x27a226=_0x27a226||0xc8;return function(_0x541ffe){if(_0x541ffe){return _0x83eb53[_0xeb28('0x18')](_0x27a226)[_0xeb28('0x19')](_0x541ffe);}};}function respondWithFilteredResult(_0x27efd5,_0x302bab){return function(_0x1e20d7){if(_0x1e20d7){var _0x23246b=typeof _0x302bab[_0xeb28('0x1a')]===_0xeb28('0x1b')&&typeof _0x302bab[_0xeb28('0x1c')]===_0xeb28('0x1b');var _0x212419=_0x1e20d7['count'];var _0x296247=_0x23246b?0x0:_0x302bab['offset'];var _0x2ea092=_0x23246b?_0x1e20d7[_0xeb28('0x1d')]:_0x302bab[_0xeb28('0x1a')]+_0x302bab['limit'];var _0x51e3d7;if(_0x2ea092>=_0x212419){_0x2ea092=_0x212419;_0x51e3d7=0xc8;}else{_0x51e3d7=0xce;}_0x27efd5[_0xeb28('0x18')](_0x51e3d7);return _0x27efd5[_0xeb28('0x1e')]('Content-Range',_0x296247+'-'+_0x2ea092+'/'+_0x212419)[_0xeb28('0x19')](_0x1e20d7);}return null;};}function patchUpdates(_0x4b4d1c){return function(_0x5bc3da){try{jsonpatch[_0xeb28('0x1f')](_0x5bc3da,_0x4b4d1c,!![]);}catch(_0x46114a){return BPromise['reject'](_0x46114a);}return _0x5bc3da['save']();};}function saveUpdates(_0x32e060,_0x19e425){return function(_0x4ce480){if(_0x4ce480){return _0x4ce480[_0xeb28('0x20')](_0x32e060)[_0xeb28('0x21')](function(_0x3d2ddd){return _0x3d2ddd;});}return null;};}function removeEntity(_0x4523ee,_0x33bb67){return function(_0x363fa9){if(_0x363fa9){return _0x363fa9[_0xeb28('0x22')]()[_0xeb28('0x21')](function(){_0x4523ee[_0xeb28('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dddcd,_0x51b8c3){return function(_0x44928a){if(!_0x44928a){_0x4dddcd['sendStatus'](0x194);}return _0x44928a;};}function handleError(_0x8e00ec,_0x3bf089){_0x3bf089=_0x3bf089||0x1f4;return function(_0x4edcf8){logger['error'](_0x4edcf8[_0xeb28('0x23')]);if(_0x4edcf8['name']){delete _0x4edcf8[_0xeb28('0x24')];}_0x8e00ec[_0xeb28('0x18')](_0x3bf089)[_0xeb28('0x25')](_0x4edcf8);};}exports[_0xeb28('0x26')]=function(_0x1aabd8,_0x218adb){var _0x10ed65={},_0x262fa1={},_0x5d15a8={'count':0x0,'rows':[]};var _0x1989be=_[_0xeb28('0x27')](db[_0xeb28('0x28')][_0xeb28('0x29')],function(_0x41b465){return{'name':_0x41b465[_0xeb28('0x2a')],'type':_0x41b465['type'][_0xeb28('0x2b')]};});_0x262fa1[_0xeb28('0x2c')]=_[_0xeb28('0x27')](_0x1989be,_0xeb28('0x24'));_0x262fa1['query']=_[_0xeb28('0x2d')](_0x1aabd8['query']);_0x262fa1[_0xeb28('0x2e')]=_['intersection'](_0x262fa1[_0xeb28('0x2c')],_0x262fa1[_0xeb28('0x2f')]);_0x10ed65[_0xeb28('0x30')]=_[_0xeb28('0x31')](_0x262fa1[_0xeb28('0x2c')],qs['fields'](_0x1aabd8['query']['fields']));_0x10ed65[_0xeb28('0x30')]=_0x10ed65[_0xeb28('0x30')][_0xeb28('0x32')]?_0x10ed65[_0xeb28('0x30')]:_0x262fa1[_0xeb28('0x2c')];if(!_0x1aabd8[_0xeb28('0x2f')][_0xeb28('0x33')](_0xeb28('0x34'))){_0x10ed65[_0xeb28('0x1c')]=qs[_0xeb28('0x1c')](_0x1aabd8['query'][_0xeb28('0x1c')]);_0x10ed65['offset']=qs[_0xeb28('0x1a')](_0x1aabd8[_0xeb28('0x2f')][_0xeb28('0x1a')]);}_0x10ed65[_0xeb28('0x35')]=qs[_0xeb28('0x36')](_0x1aabd8[_0xeb28('0x2f')][_0xeb28('0x36')]);_0x10ed65[_0xeb28('0x37')]=qs['filters'](_['pick'](_0x1aabd8[_0xeb28('0x2f')],_0x262fa1[_0xeb28('0x2e')]),_0x1989be);if(_0x1aabd8[_0xeb28('0x2f')][_0xeb28('0x38')]){_0x10ed65[_0xeb28('0x37')]=_['merge'](_0x10ed65['where'],{'$or':_[_0xeb28('0x27')](_0x1989be,function(_0xc0f355){if(_0xc0f355[_0xeb28('0x39')]!==_0xeb28('0x3a')){var _0x53aabf={};_0x53aabf[_0xc0f355[_0xeb28('0x24')]]={'$like':'%'+_0x1aabd8[_0xeb28('0x2f')][_0xeb28('0x38')]+'%'};return _0x53aabf;}})});}_0x10ed65=_['merge']({},_0x10ed65,_0x1aabd8[_0xeb28('0x3b')]);var _0x19e8db={'where':_0x10ed65['where']};return db[_0xeb28('0x28')][_0xeb28('0x1d')](_0x19e8db)['then'](function(_0x3d9402){_0x5d15a8[_0xeb28('0x1d')]=_0x3d9402;if(_0x1aabd8['query'][_0xeb28('0x3c')]){_0x10ed65[_0xeb28('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xeb28('0x3e')](_0x10ed65);})[_0xeb28('0x21')](function(_0x44e3e3){_0x5d15a8[_0xeb28('0x3f')]=_0x44e3e3;return _0x5d15a8;})[_0xeb28('0x21')](respondWithFilteredResult(_0x218adb,_0x10ed65))[_0xeb28('0x40')](handleError(_0x218adb,null));};exports[_0xeb28('0x41')]=function(_0x5e3bfd,_0x149f17){var _0x5adc5e={'raw':![],'where':{'id':_0x5e3bfd[_0xeb28('0x42')]['id']}},_0x17c68={};_0x17c68[_0xeb28('0x2c')]=_[_0xeb28('0x2d')](db[_0xeb28('0x28')][_0xeb28('0x29')]);_0x17c68[_0xeb28('0x2f')]=_[_0xeb28('0x2d')](_0x5e3bfd[_0xeb28('0x2f')]);_0x17c68[_0xeb28('0x2e')]=_[_0xeb28('0x31')](_0x17c68['model'],_0x17c68['query']);_0x5adc5e[_0xeb28('0x30')]=_[_0xeb28('0x31')](_0x17c68[_0xeb28('0x2c')],qs['fields'](_0x5e3bfd[_0xeb28('0x2f')][_0xeb28('0x43')]));_0x5adc5e[_0xeb28('0x30')]=_0x5adc5e[_0xeb28('0x30')][_0xeb28('0x32')]?_0x5adc5e[_0xeb28('0x30')]:_0x17c68[_0xeb28('0x2c')];if(_0x5e3bfd[_0xeb28('0x2f')][_0xeb28('0x3c')]){_0x5adc5e[_0xeb28('0x3d')]=[{'all':!![]}];}_0x5adc5e=_['merge']({},_0x5adc5e,_0x5e3bfd[_0xeb28('0x3b')]);return db[_0xeb28('0x28')][_0xeb28('0x44')](_0x5adc5e)[_0xeb28('0x21')](handleEntityNotFound(_0x149f17,null))[_0xeb28('0x21')](respondWithResult(_0x149f17,null))[_0xeb28('0x40')](handleError(_0x149f17,null));};exports[_0xeb28('0x45')]=function(_0x11d7dc,_0x50ceeb){return db[_0xeb28('0x28')][_0xeb28('0x45')](_0x11d7dc[_0xeb28('0x46')],{})[_0xeb28('0x21')](respondWithResult(_0x50ceeb,0xc9))['catch'](handleError(_0x50ceeb,null));};exports[_0xeb28('0x47')]=function(_0x166c50,_0x28d08d){return db[_0xeb28('0x28')]['bulkCreate'](_0x166c50[_0xeb28('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x28d08d,0xc9))[_0xeb28('0x40')](handleError(_0x28d08d,null));};exports[_0xeb28('0x20')]=function(_0x538487,_0x3ca353){if(_0x538487[_0xeb28('0x46')]['id']){delete _0x538487[_0xeb28('0x46')]['id'];}return db[_0xeb28('0x28')]['find']({'where':{'id':_0x538487[_0xeb28('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ca353,null))[_0xeb28('0x21')](saveUpdates(_0x538487[_0xeb28('0x46')],null))[_0xeb28('0x21')](respondWithResult(_0x3ca353,null))['catch'](handleError(_0x3ca353,null));};exports[_0xeb28('0x22')]=function(_0x22bd26,_0x436b49){return db[_0xeb28('0x28')][_0xeb28('0x44')]({'where':{'id':_0x22bd26[_0xeb28('0x42')]['id']}})[_0xeb28('0x21')](handleEntityNotFound(_0x436b49,null))[_0xeb28('0x21')](removeEntity(_0x436b49,null))[_0xeb28('0x40')](handleError(_0x436b49,null));};exports[_0xeb28('0x48')]=function(_0x5d575b,_0x1cbfd5){return db[_0xeb28('0x28')][_0xeb28('0x22')]({'where':{'id':_0x5d575b['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xeb28('0x21')](respondWithResult(_0x1cbfd5,0xcc))[_0xeb28('0x40')](handleError(_0x1cbfd5,null));};exports[_0xeb28('0x49')]=function(_0x4fa12e,_0xaf5e30,_0x3562e7){return db[_0xeb28('0x4a')][_0xeb28('0x4b')]({'where':{'id':_0x4fa12e[_0xeb28('0x42')]['id']}})['then'](handleEntityNotFound(_0xaf5e30,null))[_0xeb28('0x21')](function(_0x19f911){if(_0x19f911){return db[_0xeb28('0x4c')]['transaction'](function(_0x53774b){return db['AnalyticFieldReport'][_0xeb28('0x22')]({'where':{'CustomReportId':_0x4fa12e[_0xeb28('0x42')]['id']},'transaction':_0x53774b})[_0xeb28('0x21')](function(_0xc02a84){var _0x448c27=_['map'](_0x4fa12e[_0xeb28('0x46')],function(_0x1ada2e){delete _0x1ada2e['id'];_0x1ada2e[_0xeb28('0x4d')]=_0x4fa12e[_0xeb28('0x42')]['id'];return _0x1ada2e;});return db['AnalyticFieldReport'][_0xeb28('0x47')](_0x448c27,{'transaction':_0x53774b});});})[_0xeb28('0x21')](function(){return db[_0xeb28('0x28')][_0xeb28('0x3e')]({'where':{'CustomReportId':_0x4fa12e['params']['id']}});});}})[_0xeb28('0x21')](respondWithResult(_0xaf5e30,null))[_0xeb28('0x40')](handleError(_0xaf5e30,null));}; \ No newline at end of file +var _0x5516=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','bulkCreate','body','update','bulkDestroy','addFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','apply','reject','save','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName'];(function(_0xc21097,_0x97ce69){var _0xc66a65=function(_0x1103a4){while(--_0x1103a4){_0xc21097['push'](_0xc21097['shift']());}};_0xc66a65(++_0x97ce69);}(_0x5516,0x1bc));var _0x6551=function(_0x5442d1,_0x193d0e){_0x5442d1=_0x5442d1-0x0;var _0x2f0eaf=_0x5516[_0x5442d1];return _0x2f0eaf;};'use strict';var emlformat=require(_0x6551('0x0'));var rimraf=require(_0x6551('0x1'));var zipdir=require(_0x6551('0x2'));var jsonpatch=require(_0x6551('0x3'));var rp=require(_0x6551('0x4'));var moment=require(_0x6551('0x5'));var BPromise=require(_0x6551('0x6'));var Mustache=require(_0x6551('0x7'));var util=require(_0x6551('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6551('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6551('0xa'));var _=require(_0x6551('0xb'));var squel=require(_0x6551('0xc'));var crypto=require('crypto');var jsforce=require(_0x6551('0xd'));var deskjs=require(_0x6551('0xe'));var toCsv=require(_0x6551('0x9'));var querystring=require(_0x6551('0xf'));var Papa=require(_0x6551('0x10'));var Redis=require(_0x6551('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6551('0x12'));var as=require(_0x6551('0x13'));var hardwareService=require(_0x6551('0x14'));var logger=require('../../config/logger')(_0x6551('0x15'));var utils=require(_0x6551('0x16'));var config=require(_0x6551('0x17'));var licenseUtil=require(_0x6551('0x18'));var db=require(_0x6551('0x19'))['db'];function respondWithStatusCode(_0x4f41fa,_0x42b59c){_0x42b59c=_0x42b59c||0xcc;return function(_0x4df88c){if(_0x4df88c){return _0x4f41fa[_0x6551('0x1a')](_0x42b59c);}return _0x4f41fa[_0x6551('0x1b')](_0x42b59c)[_0x6551('0x1c')]();};}function respondWithResult(_0x4fb772,_0x3da26c){_0x3da26c=_0x3da26c||0xc8;return function(_0x31960e){if(_0x31960e){return _0x4fb772[_0x6551('0x1b')](_0x3da26c)[_0x6551('0x1d')](_0x31960e);}};}function respondWithFilteredResult(_0xf9dd0b,_0x380040){return function(_0x2583ab){if(_0x2583ab){var _0x5c81a5=typeof _0x380040['offset']==='undefined'&&typeof _0x380040[_0x6551('0x1e')]===_0x6551('0x1f');var _0x12eb1c=_0x2583ab['count'];var _0x27be53=_0x5c81a5?0x0:_0x380040[_0x6551('0x20')];var _0x3819b2=_0x5c81a5?_0x2583ab[_0x6551('0x21')]:_0x380040['offset']+_0x380040[_0x6551('0x1e')];var _0x3fac89;if(_0x3819b2>=_0x12eb1c){_0x3819b2=_0x12eb1c;_0x3fac89=0xc8;}else{_0x3fac89=0xce;}_0xf9dd0b['status'](_0x3fac89);return _0xf9dd0b[_0x6551('0x22')]('Content-Range',_0x27be53+'-'+_0x3819b2+'/'+_0x12eb1c)[_0x6551('0x1d')](_0x2583ab);}return null;};}function patchUpdates(_0x55f3aa){return function(_0x154c46){try{jsonpatch[_0x6551('0x23')](_0x154c46,_0x55f3aa,!![]);}catch(_0x2dd276){return BPromise[_0x6551('0x24')](_0x2dd276);}return _0x154c46[_0x6551('0x25')]();};}function saveUpdates(_0x4ff566,_0x35ac74){return function(_0x4de240){if(_0x4de240){return _0x4de240['update'](_0x4ff566)[_0x6551('0x26')](function(_0x1ac3a8){return _0x1ac3a8;});}return null;};}function removeEntity(_0x21df36,_0x5499ed){return function(_0x53168c){if(_0x53168c){return _0x53168c[_0x6551('0x27')]()[_0x6551('0x26')](function(){_0x21df36[_0x6551('0x1b')](0xcc)[_0x6551('0x1c')]();});}};}function handleEntityNotFound(_0x23d873,_0x42a0cc){return function(_0x43f405){if(!_0x43f405){_0x23d873[_0x6551('0x1a')](0x194);}return _0x43f405;};}function handleError(_0x170848,_0x176c2c){_0x176c2c=_0x176c2c||0x1f4;return function(_0x5adfaa){logger[_0x6551('0x28')](_0x5adfaa['stack']);if(_0x5adfaa[_0x6551('0x29')]){delete _0x5adfaa[_0x6551('0x29')];}_0x170848[_0x6551('0x1b')](_0x176c2c)[_0x6551('0x2a')](_0x5adfaa);};}exports[_0x6551('0x2b')]=function(_0xfa6a9,_0xc41622){var _0x3f1b74={},_0x2dd1bf={},_0x3edb8f={'count':0x0,'rows':[]};var _0x57f47e=_[_0x6551('0x2c')](db[_0x6551('0x2d')][_0x6551('0x2e')],function(_0x592ec6){return{'name':_0x592ec6[_0x6551('0x2f')],'type':_0x592ec6[_0x6551('0x30')][_0x6551('0x31')]};});_0x2dd1bf[_0x6551('0x32')]=_[_0x6551('0x2c')](_0x57f47e,'name');_0x2dd1bf[_0x6551('0x33')]=_[_0x6551('0x34')](_0xfa6a9[_0x6551('0x33')]);_0x2dd1bf[_0x6551('0x35')]=_[_0x6551('0x36')](_0x2dd1bf['model'],_0x2dd1bf['query']);_0x3f1b74[_0x6551('0x37')]=_[_0x6551('0x36')](_0x2dd1bf['model'],qs[_0x6551('0x38')](_0xfa6a9[_0x6551('0x33')][_0x6551('0x38')]));_0x3f1b74[_0x6551('0x37')]=_0x3f1b74[_0x6551('0x37')][_0x6551('0x39')]?_0x3f1b74['attributes']:_0x2dd1bf[_0x6551('0x32')];if(!_0xfa6a9[_0x6551('0x33')][_0x6551('0x3a')](_0x6551('0x3b'))){_0x3f1b74[_0x6551('0x1e')]=qs[_0x6551('0x1e')](_0xfa6a9[_0x6551('0x33')][_0x6551('0x1e')]);_0x3f1b74[_0x6551('0x20')]=qs[_0x6551('0x20')](_0xfa6a9['query'][_0x6551('0x20')]);}_0x3f1b74[_0x6551('0x3c')]=qs['sort'](_0xfa6a9[_0x6551('0x33')][_0x6551('0x3d')]);_0x3f1b74[_0x6551('0x3e')]=qs[_0x6551('0x35')](_[_0x6551('0x3f')](_0xfa6a9[_0x6551('0x33')],_0x2dd1bf[_0x6551('0x35')]),_0x57f47e);if(_0xfa6a9[_0x6551('0x33')][_0x6551('0x40')]){_0x3f1b74[_0x6551('0x3e')]=_['merge'](_0x3f1b74[_0x6551('0x3e')],{'$or':_['map'](_0x57f47e,function(_0xb412e3){if(_0xb412e3[_0x6551('0x30')]!==_0x6551('0x41')){var _0x185e84={};_0x185e84[_0xb412e3[_0x6551('0x29')]]={'$like':'%'+_0xfa6a9[_0x6551('0x33')][_0x6551('0x40')]+'%'};return _0x185e84;}})});}_0x3f1b74=_[_0x6551('0x42')]({},_0x3f1b74,_0xfa6a9['options']);var _0x905bb={'where':_0x3f1b74[_0x6551('0x3e')]};return db['AnalyticFieldReport']['count'](_0x905bb)['then'](function(_0x22b6c6){_0x3edb8f['count']=_0x22b6c6;if(_0xfa6a9[_0x6551('0x33')][_0x6551('0x43')]){_0x3f1b74[_0x6551('0x44')]=[{'all':!![]}];}return db[_0x6551('0x2d')][_0x6551('0x45')](_0x3f1b74);})['then'](function(_0x231664){_0x3edb8f[_0x6551('0x46')]=_0x231664;return _0x3edb8f;})[_0x6551('0x26')](respondWithFilteredResult(_0xc41622,_0x3f1b74))[_0x6551('0x47')](handleError(_0xc41622,null));};exports[_0x6551('0x48')]=function(_0xb02c1e,_0x397b93){var _0x142795={'raw':![],'where':{'id':_0xb02c1e[_0x6551('0x49')]['id']}},_0xd13d46={};_0xd13d46['model']=_['keys'](db[_0x6551('0x2d')][_0x6551('0x2e')]);_0xd13d46[_0x6551('0x33')]=_[_0x6551('0x34')](_0xb02c1e['query']);_0xd13d46[_0x6551('0x35')]=_[_0x6551('0x36')](_0xd13d46[_0x6551('0x32')],_0xd13d46[_0x6551('0x33')]);_0x142795[_0x6551('0x37')]=_[_0x6551('0x36')](_0xd13d46[_0x6551('0x32')],qs[_0x6551('0x38')](_0xb02c1e[_0x6551('0x33')][_0x6551('0x38')]));_0x142795[_0x6551('0x37')]=_0x142795['attributes'][_0x6551('0x39')]?_0x142795['attributes']:_0xd13d46[_0x6551('0x32')];if(_0xb02c1e[_0x6551('0x33')]['includeAll']){_0x142795['include']=[{'all':!![]}];}_0x142795=_['merge']({},_0x142795,_0xb02c1e[_0x6551('0x4a')]);return db['AnalyticFieldReport'][_0x6551('0x4b')](_0x142795)[_0x6551('0x26')](handleEntityNotFound(_0x397b93,null))[_0x6551('0x26')](respondWithResult(_0x397b93,null))['catch'](handleError(_0x397b93,null));};exports[_0x6551('0x4c')]=function(_0x1382ab,_0xbf7070){return db[_0x6551('0x2d')][_0x6551('0x4c')](_0x1382ab['body'],{})[_0x6551('0x26')](respondWithResult(_0xbf7070,0xc9))[_0x6551('0x47')](handleError(_0xbf7070,null));};exports[_0x6551('0x4d')]=function(_0x2a8dcb,_0x256271){return db['AnalyticFieldReport'][_0x6551('0x4d')](_0x2a8dcb[_0x6551('0x4e')],{'raw':![],'individualHooks':!![]})[_0x6551('0x26')](respondWithResult(_0x256271,0xc9))[_0x6551('0x47')](handleError(_0x256271,null));};exports[_0x6551('0x4f')]=function(_0x45cc62,_0x26990b){if(_0x45cc62[_0x6551('0x4e')]['id']){delete _0x45cc62[_0x6551('0x4e')]['id'];}return db[_0x6551('0x2d')]['find']({'where':{'id':_0x45cc62['params']['id']}})[_0x6551('0x26')](handleEntityNotFound(_0x26990b,null))['then'](saveUpdates(_0x45cc62[_0x6551('0x4e')],null))[_0x6551('0x26')](respondWithResult(_0x26990b,null))[_0x6551('0x47')](handleError(_0x26990b,null));};exports[_0x6551('0x27')]=function(_0x38d8fb,_0x42e5f0){return db[_0x6551('0x2d')][_0x6551('0x4b')]({'where':{'id':_0x38d8fb[_0x6551('0x49')]['id']}})['then'](handleEntityNotFound(_0x42e5f0,null))[_0x6551('0x26')](removeEntity(_0x42e5f0,null))[_0x6551('0x47')](handleError(_0x42e5f0,null));};exports[_0x6551('0x50')]=function(_0x139b6c,_0x208e45){return db[_0x6551('0x2d')][_0x6551('0x27')]({'where':{'id':_0x139b6c[_0x6551('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x6551('0x26')](respondWithResult(_0x208e45,0xcc))[_0x6551('0x47')](handleError(_0x208e45,null));};exports[_0x6551('0x51')]=function(_0x541dca,_0x50628b,_0x1ae42e){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x541dca[_0x6551('0x49')]['id']}})[_0x6551('0x26')](handleEntityNotFound(_0x50628b,null))[_0x6551('0x26')](function(_0x4def67){if(_0x4def67){return db['sequelize']['transaction'](function(_0x1c4ea7){return db[_0x6551('0x2d')][_0x6551('0x27')]({'where':{'CustomReportId':_0x541dca['params']['id']},'transaction':_0x1c4ea7})[_0x6551('0x26')](function(_0x2dba41){var _0x43d32c=_[_0x6551('0x2c')](_0x541dca[_0x6551('0x4e')],function(_0x10f561){delete _0x10f561['id'];_0x10f561['CustomReportId']=_0x541dca['params']['id'];return _0x10f561;});return db['AnalyticFieldReport'][_0x6551('0x4d')](_0x43d32c,{'transaction':_0x1c4ea7});});})[_0x6551('0x26')](function(){return db['AnalyticFieldReport'][_0x6551('0x45')]({'where':{'CustomReportId':_0x541dca['params']['id']}});});}})['then'](respondWithResult(_0x50628b,null))[_0x6551('0x47')](handleError(_0x50628b,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 6b1b80b..62b94fa 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 _0x4100=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x1b3405,_0x37b5bd){var _0x115808=function(_0x207ef7){while(--_0x207ef7){_0x1b3405['push'](_0x1b3405['shift']());}};_0x115808(++_0x37b5bd);}(_0x4100,0xb0));var _0x0410=function(_0xfa145f,_0x405ec8){_0xfa145f=_0xfa145f-0x0;var _0x6d16e3=_0x4100[_0xfa145f];return _0x6d16e3;};'use strict';var _=require(_0x0410('0x0'));var util=require('util');var logger=require(_0x0410('0x1'))(_0x0410('0x2'));var moment=require(_0x0410('0x3'));var BPromise=require(_0x0410('0x4'));var rp=require(_0x0410('0x5'));var fs=require('fs');var path=require(_0x0410('0x6'));var rimraf=require(_0x0410('0x7'));var config=require(_0x0410('0x8'));var attributes=require(_0x0410('0x9'));module['exports']=function(_0xd12ef2,_0x4a9645){return _0xd12ef2[_0x0410('0xa')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57e3=['request-promise','path','rimraf','../../config/environment','exports','AnalyticFieldReport','lodash','bluebird'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x57e3,0x176));var _0x357e=function(_0x561934,_0x35594d){_0x561934=_0x561934-0x0;var _0x5560e8=_0x57e3[_0x561934];return _0x5560e8;};'use strict';var _=require(_0x357e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x357e('0x1'));var rp=require(_0x357e('0x2'));var fs=require('fs');var path=require(_0x357e('0x3'));var rimraf=require(_0x357e('0x4'));var config=require(_0x357e('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0x357e('0x6')]=function(_0x2d3756,_0x23f5c7){return _0x2d3756['define'](_0x357e('0x7'),attributes,{'tableName':'analytics_report_fields','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 218b9c7..f0ff98d 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 _0x37de=['error','code','message','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5a7b3e,_0x4402df){var _0x4059c0=function(_0x190e4e){while(--_0x190e4e){_0x5a7b3e['push'](_0x5a7b3e['shift']());}};_0x4059c0(++_0x4402df);}(_0x37de,0xed));var _0xe37d=function(_0x515ae8,_0x2a964f){_0x515ae8=_0x515ae8-0x0;var _0x4cf66a=_0x37de[_0x515ae8];return _0x4cf66a;};'use strict';var _=require(_0xe37d('0x0'));var util=require(_0xe37d('0x1'));var moment=require(_0xe37d('0x2'));var BPromise=require(_0xe37d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe37d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe37d('0x5'))(_0xe37d('0x6'));var config=require('../../config/environment');var jayson=require(_0xe37d('0x7'));var client=jayson['client'][_0xe37d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x117afb,_0x3244d9,_0x3d6c20){return new BPromise(function(_0x1f7cbf,_0x527531){return client[_0xe37d('0x9')](_0x117afb,_0x3d6c20)[_0xe37d('0xa')](function(_0x1f5ef3){logger[_0xe37d('0xb')](_0xe37d('0xc'),_0x3244d9,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3244d9,_0xe37d('0xd'),JSON[_0xe37d('0xe')](_0x1f5ef3));if(_0x1f5ef3['error']){if(_0x1f5ef3[_0xe37d('0xf')][_0xe37d('0x10')]===0x1f4){logger['error'](_0xe37d('0xc'),_0x3244d9,_0x1f5ef3[_0xe37d('0xf')][_0xe37d('0x11')]);return _0x527531(_0x1f5ef3[_0xe37d('0xf')][_0xe37d('0x11')]);}logger[_0xe37d('0xf')](_0xe37d('0xc'),_0x3244d9,_0x1f5ef3[_0xe37d('0xf')][_0xe37d('0x11')]);return _0x1f7cbf(_0x1f5ef3[_0xe37d('0xf')]['message']);}else{logger[_0xe37d('0xb')](_0xe37d('0xc'),_0x3244d9,'request\x20sent');_0x1f7cbf(_0x1f5ef3['result'][_0xe37d('0x11')]);}})['catch'](function(_0x2e75a9){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3244d9,_0x2e75a9);_0x527531(_0x2e75a9);});});} \ No newline at end of file +var _0x6dac=['then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','AnalyticFieldReport,\x20%s,\x20%s','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x6dac,0x184));var _0xc6da=function(_0x2bb2cc,_0x491968){_0x2bb2cc=_0x2bb2cc-0x0;var _0x2163b9=_0x6dac[_0x2bb2cc];return _0x2163b9;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var moment=require('moment');var BPromise=require(_0xc6da('0x2'));var rs=require(_0xc6da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6da('0x4'))['db'];var utils=require(_0xc6da('0x5'));var logger=require(_0xc6da('0x6'))(_0xc6da('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6da('0x8'));var client=jayson['client'][_0xc6da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451a2b,_0x59a7ca,_0x546273){return new BPromise(function(_0x3ccc34,_0x174911){return client[_0xc6da('0xa')](_0x451a2b,_0x546273)[_0xc6da('0xb')](function(_0x349a62){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x59a7ca,_0xc6da('0xc'));logger[_0xc6da('0xd')](_0xc6da('0xe'),_0x59a7ca,'request\x20sent',JSON[_0xc6da('0xf')](_0x349a62));if(_0x349a62[_0xc6da('0x10')]){if(_0x349a62['error']['code']===0x1f4){logger[_0xc6da('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x59a7ca,_0x349a62[_0xc6da('0x10')][_0xc6da('0x11')]);return _0x174911(_0x349a62['error']['message']);}logger[_0xc6da('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x59a7ca,_0x349a62[_0xc6da('0x10')]['message']);return _0x3ccc34(_0x349a62[_0xc6da('0x10')]['message']);}else{logger[_0xc6da('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x59a7ca,_0xc6da('0xc'));_0x3ccc34(_0x349a62[_0xc6da('0x13')][_0xc6da('0x11')]);}})['catch'](function(_0xbaa8b7){logger[_0xc6da('0x10')](_0xc6da('0x14'),_0x59a7ca,_0xbaa8b7);_0x174911(_0xbaa8b7);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index cc7e7d6..536b00c 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(_0x526749,_0x17cbf6){var _0x318c31=function(_0x1ed0d4){while(--_0x1ed0d4){_0x526749['push'](_0x526749['shift']());}};_0x318c31(++_0x17cbf6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x1332a8,_0x42a3bd){var _0x317e44=function(_0x528be5){while(--_0x528be5){_0x1332a8['push'](_0x1332a8['shift']());}};_0x317e44(++_0x42a3bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 fb8979a..faa9402 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 _0x8efc=['STRING','name','exports'];(function(_0x43f518,_0xc28d87){var _0x593644=function(_0x5b4566){while(--_0x5b4566){_0x43f518['push'](_0x43f518['shift']());}};_0x593644(++_0xc28d87);}(_0x8efc,0xb3));var _0xc8ef=function(_0x1d8a5d,_0x59a110){_0x1d8a5d=_0x1d8a5d-0x0;var _0x54d59f=_0x8efc[_0x1d8a5d];return _0x54d59f;};'use strict';var Sequelize=require('sequelize');module[_0xc8ef('0x0')]={'name':{'type':Sequelize[_0xc8ef('0x1')],'allowNull':![],'unique':_0xc8ef('0x2')},'table':{'type':Sequelize[_0xc8ef('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xc8ef('0x1')]}}; \ No newline at end of file +var _0x0427=['name','TEXT','STRING'];(function(_0x23527c,_0x185b3e){var _0xd9536f=function(_0x1045ba){while(--_0x1045ba){_0x23527c['push'](_0x23527c['shift']());}};_0xd9536f(++_0x185b3e);}(_0x0427,0x137));var _0x7042=function(_0x580a64,_0x107782){_0x580a64=_0x580a64-0x0;var _0x4e65ed=_0x0427[_0x580a64];return _0x4e65ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7042('0x0')],'allowNull':![],'unique':_0x7042('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7042('0x2')]},'description':{'type':Sequelize[_0x7042('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 47de390..a5ebb78 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x19901f,_0x3c7094){var _0x2e5f42=function(_0x41f4d3){while(--_0x41f4d3){_0x19901f['push'](_0x19901f['shift']());}};_0x2e5f42(++_0x3c7094);}(_0x425d,0x1e0));var _0xd425=function(_0x239a39,_0x5b787d){_0x239a39=_0x239a39-0x0;var _0x5bdc07=_0x425d[_0x239a39];return _0x5bdc07;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file +var _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3f5262,_0x1ad642){var _0x113366=function(_0x3facd9){while(--_0x3facd9){_0x3f5262['push'](_0x3f5262['shift']());}};_0x113366(++_0x1ad642);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4ac140,_0x1a829c){_0x4ac140=_0x4ac140-0x0;var _0x395607=_0xdbf5[_0x4ac140];return _0x395607;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 9974ab9..1246dea 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 _0x2cd0=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util'];(function(_0x2e01a0,_0x2788c1){var _0xccfd46=function(_0x3964cc){while(--_0x3964cc){_0x2e01a0['push'](_0x2e01a0['shift']());}};_0xccfd46(++_0x2788c1);}(_0x2cd0,0x10f));var _0x02cd=function(_0x1a1e23,_0x3c2f9b){_0x1a1e23=_0x1a1e23-0x0;var _0x39d845=_0x2cd0[_0x1a1e23];return _0x39d845;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var logger=require(_0x02cd('0x2'))(_0x02cd('0x3'));var moment=require(_0x02cd('0x4'));var BPromise=require(_0x02cd('0x5'));var rp=require(_0x02cd('0x6'));var fs=require('fs');var path=require(_0x02cd('0x7'));var rimraf=require('rimraf');var config=require(_0x02cd('0x8'));var attributes=require(_0x02cd('0x9'));module[_0x02cd('0xa')]=function(_0x17860f,_0x5172cc){return _0x17860f[_0x02cd('0xb')](_0x02cd('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e4b=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics'];(function(_0x26a179,_0x4bb945){var _0x2fddde=function(_0x52f1fd){while(--_0x52f1fd){_0x26a179['push'](_0x26a179['shift']());}};_0x2fddde(++_0x4bb945);}(_0x7e4b,0x84));var _0xb7e4=function(_0x5f539e,_0x1cc245){_0x5f539e=_0x5f539e-0x0;var _0x13a034=_0x7e4b[_0x5f539e];return _0x13a034;};'use strict';var _=require(_0xb7e4('0x0'));var util=require(_0xb7e4('0x1'));var logger=require('../../config/logger')(_0xb7e4('0x2'));var moment=require(_0xb7e4('0x3'));var BPromise=require('bluebird');var rp=require(_0xb7e4('0x4'));var fs=require('fs');var path=require(_0xb7e4('0x5'));var rimraf=require(_0xb7e4('0x6'));var config=require(_0xb7e4('0x7'));var attributes=require(_0xb7e4('0x8'));module[_0xb7e4('0x9')]=function(_0x39c1fd,_0x2f1b05){return _0x39c1fd[_0xb7e4('0xa')]('AnalyticMetric',attributes,{'tableName':_0xb7e4('0xb'),'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 d112e28..702415b 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 _0x23af=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x505733,_0x4f7706){var _0x4d7dad=function(_0x2cdb3b){while(--_0x2cdb3b){_0x505733['push'](_0x505733['shift']());}};_0x4d7dad(++_0x4f7706);}(_0x23af,0xa8));var _0xf23a=function(_0x5d0a09,_0xf7a28){_0x5d0a09=_0x5d0a09-0x0;var _0x5aabfe=_0x23af[_0x5d0a09];return _0x5aabfe;};'use strict';var _=require('lodash');var util=require(_0xf23a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf23a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf23a('0x2'));var logger=require(_0xf23a('0x3'))(_0xf23a('0x4'));var config=require(_0xf23a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf23a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x107bf7,_0x4ce022,_0x83a602){return new BPromise(function(_0x4f9aab,_0x5511e8){return client[_0xf23a('0x7')](_0x107bf7,_0x83a602)[_0xf23a('0x8')](function(_0x57e481){logger[_0xf23a('0x9')](_0xf23a('0xa'),_0x4ce022,_0xf23a('0xb'));logger['debug'](_0xf23a('0xc'),_0x4ce022,_0xf23a('0xb'),JSON[_0xf23a('0xd')](_0x57e481));if(_0x57e481[_0xf23a('0xe')]){if(_0x57e481[_0xf23a('0xe')][_0xf23a('0xf')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4ce022,_0x57e481[_0xf23a('0xe')][_0xf23a('0x10')]);return _0x5511e8(_0x57e481[_0xf23a('0xe')][_0xf23a('0x10')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4ce022,_0x57e481['error'][_0xf23a('0x10')]);return _0x4f9aab(_0x57e481[_0xf23a('0xe')][_0xf23a('0x10')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x4ce022,_0xf23a('0xb'));_0x4f9aab(_0x57e481[_0xf23a('0x11')][_0xf23a('0x10')]);}})['catch'](function(_0x2bf66e){logger[_0xf23a('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4ce022,_0x2bf66e);_0x5511e8(_0x2bf66e);});});} \ No newline at end of file +var _0x46d6=['catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0x46d6,0x155));var _0x646d=function(_0x5bdeed,_0x5b3377){_0x5bdeed=_0x5bdeed-0x0;var _0x17bd90=_0x46d6[_0x5bdeed];return _0x17bd90;};'use strict';var _=require(_0x646d('0x0'));var util=require(_0x646d('0x1'));var moment=require(_0x646d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x646d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x646d('0x4'))(_0x646d('0x5'));var config=require(_0x646d('0x6'));var jayson=require(_0x646d('0x7'));var client=jayson[_0x646d('0x8')][_0x646d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdc8920,_0x137ef3,_0x20dcb3){return new BPromise(function(_0xce3b40,_0x1e0b04){return client['request'](_0xdc8920,_0x20dcb3)[_0x646d('0xa')](function(_0x14fe2a){logger['info'](_0x646d('0xb'),_0x137ef3,'request\x20sent');logger['debug'](_0x646d('0xc'),_0x137ef3,_0x646d('0xd'),JSON[_0x646d('0xe')](_0x14fe2a));if(_0x14fe2a[_0x646d('0xf')]){if(_0x14fe2a['error'][_0x646d('0x10')]===0x1f4){logger['error'](_0x646d('0xb'),_0x137ef3,_0x14fe2a[_0x646d('0xf')]['message']);return _0x1e0b04(_0x14fe2a[_0x646d('0xf')][_0x646d('0x11')]);}logger[_0x646d('0xf')](_0x646d('0xb'),_0x137ef3,_0x14fe2a['error']['message']);return _0xce3b40(_0x14fe2a[_0x646d('0xf')]['message']);}else{logger['info'](_0x646d('0xb'),_0x137ef3,_0x646d('0xd'));_0xce3b40(_0x14fe2a[_0x646d('0x12')][_0x646d('0x11')]);}})[_0x646d('0x13')](function(_0x534069){logger[_0x646d('0xf')](_0x646d('0xb'),_0x137ef3,_0x534069);_0x1e0b04(_0x534069);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index e5354df..34f25e3 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 _0xcf12=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','connect-timeout','express','Router'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xcf12,0x140));var _0x2cf1=function(_0x191f9d,_0x21976f){_0x191f9d=_0x191f9d-0x0;var _0x58e60d=_0xcf12[_0x191f9d];return _0x58e60d;};'use strict';var multer=require('multer');var util=require(_0x2cf1('0x0'));var path=require('path');var timeout=require(_0x2cf1('0x1'));var express=require(_0x2cf1('0x2'));var router=express[_0x2cf1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2cf1('0x4'));var interaction=require(_0x2cf1('0x5'));var config=require(_0x2cf1('0x6'));var controller=require(_0x2cf1('0x7'));router[_0x2cf1('0x8')]('/',auth[_0x2cf1('0x9')](),controller[_0x2cf1('0xa')]);router[_0x2cf1('0x8')](_0x2cf1('0xb'),auth['isAuthenticated'](),controller[_0x2cf1('0xc')]);router[_0x2cf1('0xd')]('/',auth[_0x2cf1('0x9')](),controller[_0x2cf1('0xe')]);router[_0x2cf1('0xf')](_0x2cf1('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2cf1('0xb'),auth['isAuthenticated'](),controller[_0x2cf1('0x10')]);module[_0x2cf1('0x11')]=router; \ No newline at end of file +var _0x078c=['index','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x078c,0x19f));var _0xc078=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x078c[_0x4953da];return _0x2d3780;};'use strict';var multer=require(_0xc078('0x0'));var util=require('util');var path=require(_0xc078('0x1'));var timeout=require(_0xc078('0x2'));var express=require('express');var router=express[_0xc078('0x3')]();var fs_extra=require(_0xc078('0x4'));var auth=require(_0xc078('0x5'));var interaction=require(_0xc078('0x6'));var config=require('../../config/environment');var controller=require(_0xc078('0x7'));router[_0xc078('0x8')]('/',auth[_0xc078('0x9')](),controller[_0xc078('0xa')]);router[_0xc078('0x8')](_0xc078('0xb'),auth[_0xc078('0x9')](),controller[_0xc078('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc078('0xd')](_0xc078('0xb'),auth['isAuthenticated'](),controller[_0xc078('0xe')]);router[_0xc078('0xf')](_0xc078('0xb'),auth[_0xc078('0x9')](),controller[_0xc078('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 6610ca0..7014066 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 _0xf7a5=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7a5,0x12c));var _0x5f7a=function(_0x1317ed,_0x57217d){_0x1317ed=_0x1317ed-0x0;var _0xbaeca=_0xf7a5[_0x1317ed];return _0xbaeca;};'use strict';var Sequelize=require(_0x5f7a('0x0'));module[_0x5f7a('0x1')]={'tree':{'type':Sequelize[_0x5f7a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf06f=['sequelize','exports','TEXT'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf06f,0x99));var _0xff06=function(_0x11bcc0,_0x4724b5){_0x11bcc0=_0x11bcc0-0x0;var _0x1189ff=_0xf06f[_0x11bcc0];return _0x1189ff;};'use strict';var Sequelize=require(_0xff06('0x0'));module[_0xff06('0x1')]={'tree':{'type':Sequelize[_0xff06('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index f36f4cf..dac520a 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 _0x3527=['squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','params','includeAll','include','find','catch','create','body','eml-format','zip-dir','bluebird','mustache','util','path','to-csv','fs-extra','lodash'];(function(_0x35174b,_0x5b9fc2){var _0x27b505=function(_0x26468b){while(--_0x26468b){_0x35174b['push'](_0x35174b['shift']());}};_0x27b505(++_0x5b9fc2);}(_0x3527,0xcc));var _0x7352=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x3527[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0x7352('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7352('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7352('0x2'));var Mustache=require(_0x7352('0x3'));var util=require(_0x7352('0x4'));var path=require(_0x7352('0x5'));var sox=require('sox');var csv=require(_0x7352('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7352('0x7'));var _=require(_0x7352('0x8'));var squel=require(_0x7352('0x9'));var crypto=require(_0x7352('0xa'));var jsforce=require(_0x7352('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7352('0x6'));var querystring=require(_0x7352('0xc'));var Papa=require('papaparse');var Redis=require(_0x7352('0xd'));var authService=require(_0x7352('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7352('0xf'));var hardwareService=require(_0x7352('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x7352('0x11'));var config=require(_0x7352('0x12'));var licenseUtil=require(_0x7352('0x13'));var db=require(_0x7352('0x14'))['db'];function respondWithStatusCode(_0x5827d3,_0x593f09){_0x593f09=_0x593f09||0xcc;return function(_0x1be74c){if(_0x1be74c){return _0x5827d3[_0x7352('0x15')](_0x593f09);}return _0x5827d3[_0x7352('0x16')](_0x593f09)[_0x7352('0x17')]();};}function respondWithResult(_0x396b9a,_0x470ba2){_0x470ba2=_0x470ba2||0xc8;return function(_0x5dcc2a){if(_0x5dcc2a){return _0x396b9a['status'](_0x470ba2)[_0x7352('0x18')](_0x5dcc2a);}};}function respondWithFilteredResult(_0x356366,_0x183285){return function(_0xfa37ae){if(_0xfa37ae){var _0x58bc6b=typeof _0x183285[_0x7352('0x19')]===_0x7352('0x1a')&&typeof _0x183285[_0x7352('0x1b')]===_0x7352('0x1a');var _0x3cc4db=_0xfa37ae['count'];var _0x5a5fb1=_0x58bc6b?0x0:_0x183285['offset'];var _0x526648=_0x58bc6b?_0xfa37ae[_0x7352('0x1c')]:_0x183285[_0x7352('0x19')]+_0x183285['limit'];var _0x2eff1a;if(_0x526648>=_0x3cc4db){_0x526648=_0x3cc4db;_0x2eff1a=0xc8;}else{_0x2eff1a=0xce;}_0x356366[_0x7352('0x16')](_0x2eff1a);return _0x356366['set'](_0x7352('0x1d'),_0x5a5fb1+'-'+_0x526648+'/'+_0x3cc4db)[_0x7352('0x18')](_0xfa37ae);}return null;};}function patchUpdates(_0x111419){return function(_0x7bed7c){try{jsonpatch[_0x7352('0x1e')](_0x7bed7c,_0x111419,!![]);}catch(_0x4a79d7){return BPromise[_0x7352('0x1f')](_0x4a79d7);}return _0x7bed7c[_0x7352('0x20')]();};}function saveUpdates(_0x107333,_0x3a610d){return function(_0x4fbbb4){if(_0x4fbbb4){return _0x4fbbb4[_0x7352('0x21')](_0x107333)[_0x7352('0x22')](function(_0x45c880){return _0x45c880;});}return null;};}function removeEntity(_0x135c09,_0xa354d2){return function(_0x1da45e){if(_0x1da45e){return _0x1da45e[_0x7352('0x23')]()[_0x7352('0x22')](function(){_0x135c09[_0x7352('0x16')](0xcc)[_0x7352('0x17')]();});}};}function handleEntityNotFound(_0x4577be,_0x322dcf){return function(_0x462f72){if(!_0x462f72){_0x4577be['sendStatus'](0x194);}return _0x462f72;};}function handleError(_0x5aa017,_0x50eb1a){_0x50eb1a=_0x50eb1a||0x1f4;return function(_0x47c0cd){logger['error'](_0x47c0cd[_0x7352('0x24')]);if(_0x47c0cd[_0x7352('0x25')]){delete _0x47c0cd['name'];}_0x5aa017[_0x7352('0x16')](_0x50eb1a)[_0x7352('0x26')](_0x47c0cd);};}exports[_0x7352('0x27')]=function(_0x1a8f58,_0x382e73){var _0x14900d={},_0x5ab946={},_0x269506={'count':0x0,'rows':[]};var _0x1f04d6=_[_0x7352('0x28')](db[_0x7352('0x29')]['rawAttributes'],function(_0x59f2dc){return{'name':_0x59f2dc[_0x7352('0x2a')],'type':_0x59f2dc[_0x7352('0x2b')][_0x7352('0x2c')]};});_0x5ab946[_0x7352('0x2d')]=_[_0x7352('0x28')](_0x1f04d6,'name');_0x5ab946[_0x7352('0x2e')]=_[_0x7352('0x2f')](_0x1a8f58[_0x7352('0x2e')]);_0x5ab946[_0x7352('0x30')]=_[_0x7352('0x31')](_0x5ab946['model'],_0x5ab946[_0x7352('0x2e')]);_0x14900d['attributes']=_[_0x7352('0x31')](_0x5ab946[_0x7352('0x2d')],qs[_0x7352('0x32')](_0x1a8f58[_0x7352('0x2e')][_0x7352('0x32')]));_0x14900d[_0x7352('0x33')]=_0x14900d[_0x7352('0x33')][_0x7352('0x34')]?_0x14900d[_0x7352('0x33')]:_0x5ab946['model'];if(!_0x1a8f58['query'][_0x7352('0x35')](_0x7352('0x36'))){_0x14900d[_0x7352('0x1b')]=qs[_0x7352('0x1b')](_0x1a8f58[_0x7352('0x2e')][_0x7352('0x1b')]);_0x14900d[_0x7352('0x19')]=qs['offset'](_0x1a8f58[_0x7352('0x2e')][_0x7352('0x19')]);}_0x14900d['order']=qs[_0x7352('0x37')](_0x1a8f58[_0x7352('0x2e')][_0x7352('0x37')]);_0x14900d[_0x7352('0x38')]=qs[_0x7352('0x30')](_[_0x7352('0x39')](_0x1a8f58['query'],_0x5ab946[_0x7352('0x30')]),_0x1f04d6);if(_0x1a8f58[_0x7352('0x2e')][_0x7352('0x3a')]){_0x14900d['where']=_[_0x7352('0x3b')](_0x14900d[_0x7352('0x38')],{'$or':_['map'](_0x1f04d6,function(_0x50dfab){if(_0x50dfab[_0x7352('0x2b')]!==_0x7352('0x3c')){var _0x278232={};_0x278232[_0x50dfab[_0x7352('0x25')]]={'$like':'%'+_0x1a8f58[_0x7352('0x2e')][_0x7352('0x3a')]+'%'};return _0x278232;}})});}_0x14900d=_[_0x7352('0x3b')]({},_0x14900d,_0x1a8f58[_0x7352('0x3d')]);var _0x4043a9={'where':_0x14900d[_0x7352('0x38')]};return db['AnalyticTreeReport'][_0x7352('0x1c')](_0x4043a9)[_0x7352('0x22')](function(_0x21df5f){_0x269506[_0x7352('0x1c')]=_0x21df5f;if(_0x1a8f58['query']['includeAll']){_0x14900d['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x14900d);})['then'](function(_0x330b31){_0x269506[_0x7352('0x3e')]=_0x330b31;return _0x269506;})['then'](respondWithFilteredResult(_0x382e73,_0x14900d))['catch'](handleError(_0x382e73,null));};exports[_0x7352('0x3f')]=function(_0x5e1ec6,_0x343587){var _0x37ff28={'raw':!![],'where':{'id':_0x5e1ec6[_0x7352('0x40')]['id']}},_0x224a61={};_0x224a61['model']=_[_0x7352('0x2f')](db[_0x7352('0x29')]['rawAttributes']);_0x224a61['query']=_[_0x7352('0x2f')](_0x5e1ec6[_0x7352('0x2e')]);_0x224a61[_0x7352('0x30')]=_[_0x7352('0x31')](_0x224a61[_0x7352('0x2d')],_0x224a61[_0x7352('0x2e')]);_0x37ff28[_0x7352('0x33')]=_['intersection'](_0x224a61['model'],qs[_0x7352('0x32')](_0x5e1ec6[_0x7352('0x2e')][_0x7352('0x32')]));_0x37ff28[_0x7352('0x33')]=_0x37ff28[_0x7352('0x33')][_0x7352('0x34')]?_0x37ff28[_0x7352('0x33')]:_0x224a61['model'];if(_0x5e1ec6[_0x7352('0x2e')][_0x7352('0x41')]){_0x37ff28[_0x7352('0x42')]=[{'all':!![]}];}_0x37ff28=_[_0x7352('0x3b')]({},_0x37ff28,_0x5e1ec6['options']);return db[_0x7352('0x29')][_0x7352('0x43')](_0x37ff28)['then'](handleEntityNotFound(_0x343587,null))['then'](respondWithResult(_0x343587,null))[_0x7352('0x44')](handleError(_0x343587,null));};exports[_0x7352('0x45')]=function(_0x34206e,_0x34017b){return db['AnalyticTreeReport'][_0x7352('0x45')](_0x34206e[_0x7352('0x46')],{})[_0x7352('0x22')](respondWithResult(_0x34017b,0xc9))[_0x7352('0x44')](handleError(_0x34017b,null));};exports[_0x7352('0x21')]=function(_0x5aed95,_0x14cbe2){if(_0x5aed95[_0x7352('0x46')]['id']){delete _0x5aed95['body']['id'];}return db['AnalyticTreeReport'][_0x7352('0x43')]({'where':{'id':_0x5aed95[_0x7352('0x40')]['id']}})['then'](handleEntityNotFound(_0x14cbe2,null))['then'](saveUpdates(_0x5aed95['body'],null))[_0x7352('0x22')](respondWithResult(_0x14cbe2,null))[_0x7352('0x44')](handleError(_0x14cbe2,null));};exports[_0x7352('0x23')]=function(_0x104900,_0x3d7c93){return db[_0x7352('0x29')][_0x7352('0x43')]({'where':{'id':_0x104900[_0x7352('0x40')]['id']}})[_0x7352('0x22')](handleEntityNotFound(_0x3d7c93,null))[_0x7352('0x22')](removeEntity(_0x3d7c93,null))[_0x7352('0x44')](handleError(_0x3d7c93,null));}; \ No newline at end of file +var _0x7d5a=['count','includeAll','include','findAll','rows','show','params','fields','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','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/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','status','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x45c452,_0x213518){var _0x49c101=function(_0xfc0f07){while(--_0xfc0f07){_0x45c452['push'](_0x45c452['shift']());}};_0x49c101(++_0x213518);}(_0x7d5a,0xa5));var _0xa7d5=function(_0x4d0544,_0x2d8219){_0x4d0544=_0x4d0544-0x0;var _0x4aef04=_0x7d5a[_0x4d0544];return _0x4aef04;};'use strict';var emlformat=require(_0xa7d5('0x0'));var rimraf=require(_0xa7d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7d5('0x2'));var rp=require(_0xa7d5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa7d5('0x4'));var util=require(_0xa7d5('0x5'));var path=require(_0xa7d5('0x6'));var sox=require('sox');var csv=require(_0xa7d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7d5('0x8'));var _=require(_0xa7d5('0x9'));var squel=require(_0xa7d5('0xa'));var crypto=require(_0xa7d5('0xb'));var jsforce=require(_0xa7d5('0xc'));var deskjs=require(_0xa7d5('0xd'));var toCsv=require(_0xa7d5('0x7'));var querystring=require(_0xa7d5('0xe'));var Papa=require(_0xa7d5('0xf'));var Redis=require(_0xa7d5('0x10'));var authService=require(_0xa7d5('0x11'));var qs=require(_0xa7d5('0x12'));var as=require(_0xa7d5('0x13'));var hardwareService=require(_0xa7d5('0x14'));var logger=require(_0xa7d5('0x15'))(_0xa7d5('0x16'));var utils=require(_0xa7d5('0x17'));var config=require(_0xa7d5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7d5('0x19'))['db'];function respondWithStatusCode(_0x33321b,_0x41cd85){_0x41cd85=_0x41cd85||0xcc;return function(_0x21a5ef){if(_0x21a5ef){return _0x33321b[_0xa7d5('0x1a')](_0x41cd85);}return _0x33321b['status'](_0x41cd85)[_0xa7d5('0x1b')]();};}function respondWithResult(_0x2e075b,_0x1d08cc){_0x1d08cc=_0x1d08cc||0xc8;return function(_0x22190d){if(_0x22190d){return _0x2e075b['status'](_0x1d08cc)[_0xa7d5('0x1c')](_0x22190d);}};}function respondWithFilteredResult(_0x2497c2,_0x1dc58d){return function(_0xfc344){if(_0xfc344){var _0x41e34a=typeof _0x1dc58d[_0xa7d5('0x1d')]===_0xa7d5('0x1e')&&typeof _0x1dc58d[_0xa7d5('0x1f')]==='undefined';var _0xd0d8fd=_0xfc344['count'];var _0xf94c23=_0x41e34a?0x0:_0x1dc58d[_0xa7d5('0x1d')];var _0x2505eb=_0x41e34a?_0xfc344['count']:_0x1dc58d['offset']+_0x1dc58d[_0xa7d5('0x1f')];var _0x14ce5f;if(_0x2505eb>=_0xd0d8fd){_0x2505eb=_0xd0d8fd;_0x14ce5f=0xc8;}else{_0x14ce5f=0xce;}_0x2497c2['status'](_0x14ce5f);return _0x2497c2[_0xa7d5('0x20')](_0xa7d5('0x21'),_0xf94c23+'-'+_0x2505eb+'/'+_0xd0d8fd)['json'](_0xfc344);}return null;};}function patchUpdates(_0x3f0674){return function(_0x5d582d){try{jsonpatch[_0xa7d5('0x22')](_0x5d582d,_0x3f0674,!![]);}catch(_0x4ee420){return BPromise[_0xa7d5('0x23')](_0x4ee420);}return _0x5d582d[_0xa7d5('0x24')]();};}function saveUpdates(_0x40b5ff,_0x1a50b4){return function(_0x226c8a){if(_0x226c8a){return _0x226c8a[_0xa7d5('0x25')](_0x40b5ff)[_0xa7d5('0x26')](function(_0x5e45f4){return _0x5e45f4;});}return null;};}function removeEntity(_0x12a2c0,_0x4bf92a){return function(_0x5a5fa7){if(_0x5a5fa7){return _0x5a5fa7[_0xa7d5('0x27')]()[_0xa7d5('0x26')](function(){_0x12a2c0[_0xa7d5('0x28')](0xcc)[_0xa7d5('0x1b')]();});}};}function handleEntityNotFound(_0x3102ef,_0x5613da){return function(_0x2cf4d6){if(!_0x2cf4d6){_0x3102ef[_0xa7d5('0x1a')](0x194);}return _0x2cf4d6;};}function handleError(_0x56a3fb,_0x54b5e4){_0x54b5e4=_0x54b5e4||0x1f4;return function(_0x4c7440){logger['error'](_0x4c7440['stack']);if(_0x4c7440[_0xa7d5('0x29')]){delete _0x4c7440[_0xa7d5('0x29')];}_0x56a3fb['status'](_0x54b5e4)['send'](_0x4c7440);};}exports[_0xa7d5('0x2a')]=function(_0x514f9d,_0x25939a){var _0x4ab924={},_0x10f246={},_0x378923={'count':0x0,'rows':[]};var _0x2c6aae=_[_0xa7d5('0x2b')](db[_0xa7d5('0x2c')][_0xa7d5('0x2d')],function(_0x494ccd){return{'name':_0x494ccd[_0xa7d5('0x2e')],'type':_0x494ccd['type'][_0xa7d5('0x2f')]};});_0x10f246[_0xa7d5('0x30')]=_['map'](_0x2c6aae,_0xa7d5('0x29'));_0x10f246[_0xa7d5('0x31')]=_[_0xa7d5('0x32')](_0x514f9d[_0xa7d5('0x31')]);_0x10f246[_0xa7d5('0x33')]=_[_0xa7d5('0x34')](_0x10f246[_0xa7d5('0x30')],_0x10f246['query']);_0x4ab924[_0xa7d5('0x35')]=_[_0xa7d5('0x34')](_0x10f246[_0xa7d5('0x30')],qs['fields'](_0x514f9d['query']['fields']));_0x4ab924['attributes']=_0x4ab924[_0xa7d5('0x35')]['length']?_0x4ab924[_0xa7d5('0x35')]:_0x10f246[_0xa7d5('0x30')];if(!_0x514f9d[_0xa7d5('0x31')][_0xa7d5('0x36')]('nolimit')){_0x4ab924[_0xa7d5('0x1f')]=qs[_0xa7d5('0x1f')](_0x514f9d['query'][_0xa7d5('0x1f')]);_0x4ab924[_0xa7d5('0x1d')]=qs[_0xa7d5('0x1d')](_0x514f9d[_0xa7d5('0x31')][_0xa7d5('0x1d')]);}_0x4ab924[_0xa7d5('0x37')]=qs[_0xa7d5('0x38')](_0x514f9d[_0xa7d5('0x31')][_0xa7d5('0x38')]);_0x4ab924['where']=qs[_0xa7d5('0x33')](_[_0xa7d5('0x39')](_0x514f9d[_0xa7d5('0x31')],_0x10f246[_0xa7d5('0x33')]),_0x2c6aae);if(_0x514f9d[_0xa7d5('0x31')][_0xa7d5('0x3a')]){_0x4ab924[_0xa7d5('0x3b')]=_[_0xa7d5('0x3c')](_0x4ab924[_0xa7d5('0x3b')],{'$or':_['map'](_0x2c6aae,function(_0x37d555){if(_0x37d555['type']!==_0xa7d5('0x3d')){var _0xca2082={};_0xca2082[_0x37d555[_0xa7d5('0x29')]]={'$like':'%'+_0x514f9d[_0xa7d5('0x31')][_0xa7d5('0x3a')]+'%'};return _0xca2082;}})});}_0x4ab924=_[_0xa7d5('0x3c')]({},_0x4ab924,_0x514f9d[_0xa7d5('0x3e')]);var _0x1f6f15={'where':_0x4ab924['where']};return db['AnalyticTreeReport'][_0xa7d5('0x3f')](_0x1f6f15)[_0xa7d5('0x26')](function(_0x1eb3e5){_0x378923[_0xa7d5('0x3f')]=_0x1eb3e5;if(_0x514f9d[_0xa7d5('0x31')][_0xa7d5('0x40')]){_0x4ab924[_0xa7d5('0x41')]=[{'all':!![]}];}return db[_0xa7d5('0x2c')][_0xa7d5('0x42')](_0x4ab924);})[_0xa7d5('0x26')](function(_0x54a5e3){_0x378923[_0xa7d5('0x43')]=_0x54a5e3;return _0x378923;})['then'](respondWithFilteredResult(_0x25939a,_0x4ab924))['catch'](handleError(_0x25939a,null));};exports[_0xa7d5('0x44')]=function(_0xdd8b2,_0xc53034){var _0x446770={'raw':!![],'where':{'id':_0xdd8b2[_0xa7d5('0x45')]['id']}},_0xfeafa6={};_0xfeafa6[_0xa7d5('0x30')]=_['keys'](db[_0xa7d5('0x2c')][_0xa7d5('0x2d')]);_0xfeafa6[_0xa7d5('0x31')]=_[_0xa7d5('0x32')](_0xdd8b2[_0xa7d5('0x31')]);_0xfeafa6[_0xa7d5('0x33')]=_[_0xa7d5('0x34')](_0xfeafa6[_0xa7d5('0x30')],_0xfeafa6['query']);_0x446770[_0xa7d5('0x35')]=_[_0xa7d5('0x34')](_0xfeafa6[_0xa7d5('0x30')],qs[_0xa7d5('0x46')](_0xdd8b2['query']['fields']));_0x446770[_0xa7d5('0x35')]=_0x446770['attributes'][_0xa7d5('0x47')]?_0x446770[_0xa7d5('0x35')]:_0xfeafa6[_0xa7d5('0x30')];if(_0xdd8b2['query'][_0xa7d5('0x40')]){_0x446770[_0xa7d5('0x41')]=[{'all':!![]}];}_0x446770=_[_0xa7d5('0x3c')]({},_0x446770,_0xdd8b2['options']);return db[_0xa7d5('0x2c')][_0xa7d5('0x48')](_0x446770)[_0xa7d5('0x26')](handleEntityNotFound(_0xc53034,null))[_0xa7d5('0x26')](respondWithResult(_0xc53034,null))[_0xa7d5('0x49')](handleError(_0xc53034,null));};exports[_0xa7d5('0x4a')]=function(_0x13b5d6,_0x479a4){return db[_0xa7d5('0x2c')]['create'](_0x13b5d6[_0xa7d5('0x4b')],{})['then'](respondWithResult(_0x479a4,0xc9))['catch'](handleError(_0x479a4,null));};exports[_0xa7d5('0x25')]=function(_0x3459bf,_0x5dce50){if(_0x3459bf[_0xa7d5('0x4b')]['id']){delete _0x3459bf[_0xa7d5('0x4b')]['id'];}return db[_0xa7d5('0x2c')][_0xa7d5('0x48')]({'where':{'id':_0x3459bf['params']['id']}})[_0xa7d5('0x26')](handleEntityNotFound(_0x5dce50,null))[_0xa7d5('0x26')](saveUpdates(_0x3459bf['body'],null))[_0xa7d5('0x26')](respondWithResult(_0x5dce50,null))['catch'](handleError(_0x5dce50,null));};exports[_0xa7d5('0x27')]=function(_0x385c0a,_0x1f2a28){return db['AnalyticTreeReport'][_0xa7d5('0x48')]({'where':{'id':_0x385c0a[_0xa7d5('0x45')]['id']}})[_0xa7d5('0x26')](handleEntityNotFound(_0x1f2a28,null))[_0xa7d5('0x26')](removeEntity(_0x1f2a28,null))['catch'](handleError(_0x1f2a28,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f976629..e8d1819 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 _0x24fc=['lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x24fc,0x15f));var _0xc24f=function(_0x4ff4d8,_0x2814c2){_0x4ff4d8=_0x4ff4d8-0x0;var _0x4a4acd=_0x24fc[_0x4ff4d8];return _0x4a4acd;};'use strict';var _=require(_0xc24f('0x0'));var util=require('util');var logger=require(_0xc24f('0x1'))(_0xc24f('0x2'));var moment=require('moment');var BPromise=require(_0xc24f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc24f('0x4'));var config=require(_0xc24f('0x5'));var attributes=require(_0xc24f('0x6'));module['exports']=function(_0x1bc811,_0x4bca7b){return _0x1bc811[_0xc24f('0x7')](_0xc24f('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1114=['define','analytics_report_trees','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x45feb7,_0xe9b4f5){var _0x919c2e=function(_0x113916){while(--_0x113916){_0x45feb7['push'](_0x45feb7['shift']());}};_0x919c2e(++_0xe9b4f5);}(_0x1114,0xf4));var _0x4111=function(_0x498b80,_0x4a207c){_0x498b80=_0x498b80-0x0;var _0x368941=_0x1114[_0x498b80];return _0x368941;};'use strict';var _=require(_0x4111('0x0'));var util=require(_0x4111('0x1'));var logger=require('../../config/logger')(_0x4111('0x2'));var moment=require(_0x4111('0x3'));var BPromise=require('bluebird');var rp=require(_0x4111('0x4'));var fs=require('fs');var path=require(_0x4111('0x5'));var rimraf=require(_0x4111('0x6'));var config=require(_0x4111('0x7'));var attributes=require(_0x4111('0x8'));module['exports']=function(_0x34d471,_0x504e56){return _0x34d471[_0x4111('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x4111('0xa'),'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 7fb9019..4e2dcfd 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3d51d0,_0x4c743a){var _0x4d5a8e=function(_0x585b6c){while(--_0x585b6c){_0x3d51d0['push'](_0x3d51d0['shift']());}};_0x4d5a8e(++_0x4c743a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _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(_0x1c947f,_0x103a3f){_0x1c947f=_0x1c947f-0x0;var _0x57adaf=_0x7a54[_0x1c947f];return _0x57adaf;};'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 064409b..9fdc982 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 _0x1474=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','Router','fs-extra'];(function(_0x1f53b9,_0x481ec0){var _0x11cae6=function(_0x42fe44){while(--_0x42fe44){_0x1f53b9['push'](_0x1f53b9['shift']());}};_0x11cae6(++_0x481ec0);}(_0x1474,0x11d));var _0x4147=function(_0x9f295b,_0x5d274d){_0x9f295b=_0x9f295b-0x0;var _0x36d06d=_0x1474[_0x9f295b];return _0x36d06d;};'use strict';var multer=require(_0x4147('0x0'));var util=require(_0x4147('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4147('0x2')]();var fs_extra=require(_0x4147('0x3'));var auth=require(_0x4147('0x4'));var interaction=require(_0x4147('0x5'));var config=require(_0x4147('0x6'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x4147('0x7')](),controller['index']);router['get'](_0x4147('0x8'),auth[_0x4147('0x7')](),controller[_0x4147('0x9')]);router[_0x4147('0xa')]('/',auth['isAuthenticated'](),controller[_0x4147('0xb')]);router[_0x4147('0xc')](_0x4147('0x8'),auth[_0x4147('0x7')](),controller[_0x4147('0xd')]);router[_0x4147('0xe')](_0x4147('0x8'),auth['isAuthenticated'](),controller[_0x4147('0xf')]);module[_0x4147('0x10')]=router; \ No newline at end of file +var _0xe56e=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x32e973,_0x1736ad){var _0x36af20=function(_0x2b704a){while(--_0x2b704a){_0x32e973['push'](_0x32e973['shift']());}};_0x36af20(++_0x1736ad);}(_0xe56e,0x1cc));var _0xee56=function(_0x59ddb0,_0x2081c3){_0x59ddb0=_0x59ddb0-0x0;var _0x1dba64=_0xe56e[_0x59ddb0];return _0x1dba64;};'use strict';var multer=require(_0xee56('0x0'));var util=require(_0xee56('0x1'));var path=require(_0xee56('0x2'));var timeout=require(_0xee56('0x3'));var express=require(_0xee56('0x4'));var router=express['Router']();var fs_extra=require(_0xee56('0x5'));var auth=require(_0xee56('0x6'));var interaction=require(_0xee56('0x7'));var config=require(_0xee56('0x8'));var controller=require(_0xee56('0x9'));router[_0xee56('0xa')]('/',auth[_0xee56('0xb')](),controller[_0xee56('0xc')]);router['get'](_0xee56('0xd'),auth[_0xee56('0xb')](),controller[_0xee56('0xe')]);router[_0xee56('0xf')]('/',auth[_0xee56('0xb')](),controller[_0xee56('0x10')]);router[_0xee56('0x11')](_0xee56('0xd'),auth[_0xee56('0xb')](),controller[_0xee56('0x12')]);router[_0xee56('0x13')](_0xee56('0xd'),auth[_0xee56('0xb')](),controller[_0xee56('0x14')]);module[_0xee56('0x15')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 9584bd3..c8403e2 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 _0xbdfd=['STRING','sequelize'];(function(_0x5229a1,_0x5349f8){var _0xc4cb55=function(_0x211269){while(--_0x211269){_0x5229a1['push'](_0x5229a1['shift']());}};_0xc4cb55(++_0x5349f8);}(_0xbdfd,0x135));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xdbdf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xdbdf('0x1')]},'type':{'type':Sequelize[_0xdbdf('0x1')]}}; \ No newline at end of file +var _0x85d8=['sequelize','exports','STRING'];(function(_0x4746b5,_0x83dc98){var _0x10b5d2=function(_0x104eb3){while(--_0x104eb3){_0x4746b5['push'](_0x4746b5['shift']());}};_0x10b5d2(++_0x83dc98);}(_0x85d8,0x1b0));var _0x885d=function(_0xa80dfc,_0x1d0bd0){_0xa80dfc=_0xa80dfc-0x0;var _0x4b2ed6=_0x85d8[_0xa80dfc];return _0x4b2ed6;};'use strict';var Sequelize=require(_0x885d('0x0'));module[_0x885d('0x1')]={'name':{'type':Sequelize[_0x885d('0x2')]},'basename':{'type':Sequelize[_0x885d('0x2')]},'type':{'type':Sequelize[_0x885d('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 05b2de6..f752658 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 _0x74c1=['name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','merge','options','Attachment','includeAll','include','findAll','show','params','rawAttributes','find','catch','clone','get','createdAt','updatedAt','create','body','file','originalname','basename','filename','download','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy'];(function(_0x3831aa,_0x39e795){var _0x12f679=function(_0x45bf3b){while(--_0x45bf3b){_0x3831aa['push'](_0x3831aa['shift']());}};_0x12f679(++_0x39e795);}(_0x74c1,0x1cd));var _0x174c=function(_0x13d975,_0x19de11){_0x13d975=_0x13d975-0x0;var _0x22ffd3=_0x74c1[_0x13d975];return _0x22ffd3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x174c('0x0'));var zipdir=require(_0x174c('0x1'));var jsonpatch=require(_0x174c('0x2'));var rp=require(_0x174c('0x3'));var moment=require(_0x174c('0x4'));var BPromise=require(_0x174c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x174c('0x6'));var sox=require(_0x174c('0x7'));var csv=require('to-csv');var ejs=require(_0x174c('0x8'));var fs=require('fs');var fs_extra=require(_0x174c('0x9'));var _=require(_0x174c('0xa'));var squel=require(_0x174c('0xb'));var crypto=require(_0x174c('0xc'));var jsforce=require(_0x174c('0xd'));var deskjs=require(_0x174c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x174c('0xf'));var Papa=require(_0x174c('0x10'));var Redis=require('ioredis');var authService=require(_0x174c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x174c('0x12'));var hardwareService=require(_0x174c('0x13'));var logger=require('../../config/logger')(_0x174c('0x14'));var utils=require('../../config/utils');var config=require(_0x174c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x174c('0x16'))['db'];function respondWithStatusCode(_0x3acdc7,_0x48b06f){_0x48b06f=_0x48b06f||0xcc;return function(_0x3e5809){if(_0x3e5809){return _0x3acdc7['sendStatus'](_0x48b06f);}return _0x3acdc7[_0x174c('0x17')](_0x48b06f)[_0x174c('0x18')]();};}function respondWithResult(_0x609c87,_0x3e3571){_0x3e3571=_0x3e3571||0xc8;return function(_0x3e0ae0){if(_0x3e0ae0){return _0x609c87[_0x174c('0x17')](_0x3e3571)['json'](_0x3e0ae0);}};}function respondWithFilteredResult(_0x4926cb,_0x1101ae){return function(_0x3c2e02){if(_0x3c2e02){var _0x5bf2d8=typeof _0x1101ae['offset']===_0x174c('0x19')&&typeof _0x1101ae[_0x174c('0x1a')]===_0x174c('0x19');var _0x2a0e60=_0x3c2e02[_0x174c('0x1b')];var _0x58017c=_0x5bf2d8?0x0:_0x1101ae[_0x174c('0x1c')];var _0x512772=_0x5bf2d8?_0x3c2e02['count']:_0x1101ae['offset']+_0x1101ae[_0x174c('0x1a')];var _0x347672;if(_0x512772>=_0x2a0e60){_0x512772=_0x2a0e60;_0x347672=0xc8;}else{_0x347672=0xce;}_0x4926cb[_0x174c('0x17')](_0x347672);return _0x4926cb[_0x174c('0x1d')]('Content-Range',_0x58017c+'-'+_0x512772+'/'+_0x2a0e60)[_0x174c('0x1e')](_0x3c2e02);}return null;};}function patchUpdates(_0x485f56){return function(_0x2047e0){try{jsonpatch[_0x174c('0x1f')](_0x2047e0,_0x485f56,!![]);}catch(_0x461c92){return BPromise[_0x174c('0x20')](_0x461c92);}return _0x2047e0[_0x174c('0x21')]();};}function saveUpdates(_0x5100e0,_0x260580){return function(_0x281454){if(_0x281454){return _0x281454[_0x174c('0x22')](_0x5100e0)[_0x174c('0x23')](function(_0x4d6f09){return _0x4d6f09;});}return null;};}function removeEntity(_0x5ef77b,_0x31f069){return function(_0x2d19ce){if(_0x2d19ce){return _0x2d19ce[_0x174c('0x24')]()[_0x174c('0x23')](function(){_0x5ef77b[_0x174c('0x17')](0xcc)[_0x174c('0x18')]();});}};}function handleEntityNotFound(_0x44e523,_0x4676de){return function(_0x920a93){if(!_0x920a93){_0x44e523['sendStatus'](0x194);}return _0x920a93;};}function handleError(_0x529561,_0x24a298){_0x24a298=_0x24a298||0x1f4;return function(_0x155c29){logger['error'](_0x155c29['stack']);if(_0x155c29[_0x174c('0x25')]){delete _0x155c29[_0x174c('0x25')];}_0x529561[_0x174c('0x17')](_0x24a298)[_0x174c('0x26')](_0x155c29);};}exports['index']=function(_0x334e1a,_0xc97608){var _0x258b12={},_0x549929={},_0x25496b={'count':0x0,'rows':[]};var _0x49a4e1=_[_0x174c('0x27')](db['Attachment']['rawAttributes'],function(_0x1fad13){return{'name':_0x1fad13[_0x174c('0x28')],'type':_0x1fad13[_0x174c('0x29')][_0x174c('0x2a')]};});_0x549929['model']=_[_0x174c('0x27')](_0x49a4e1,'name');_0x549929[_0x174c('0x2b')]=_[_0x174c('0x2c')](_0x334e1a['query']);_0x549929[_0x174c('0x2d')]=_[_0x174c('0x2e')](_0x549929[_0x174c('0x2f')],_0x549929[_0x174c('0x2b')]);_0x258b12[_0x174c('0x30')]=_['intersection'](_0x549929[_0x174c('0x2f')],qs[_0x174c('0x31')](_0x334e1a[_0x174c('0x2b')][_0x174c('0x31')]));_0x258b12['attributes']=_0x258b12[_0x174c('0x30')][_0x174c('0x32')]?_0x258b12[_0x174c('0x30')]:_0x549929[_0x174c('0x2f')];if(!_0x334e1a[_0x174c('0x2b')]['hasOwnProperty'](_0x174c('0x33'))){_0x258b12[_0x174c('0x1a')]=qs['limit'](_0x334e1a[_0x174c('0x2b')][_0x174c('0x1a')]);_0x258b12[_0x174c('0x1c')]=qs[_0x174c('0x1c')](_0x334e1a[_0x174c('0x2b')]['offset']);}_0x258b12[_0x174c('0x34')]=qs[_0x174c('0x35')](_0x334e1a[_0x174c('0x2b')][_0x174c('0x35')]);_0x258b12[_0x174c('0x36')]=qs[_0x174c('0x2d')](_['pick'](_0x334e1a[_0x174c('0x2b')],_0x549929[_0x174c('0x2d')]),_0x49a4e1);if(_0x334e1a[_0x174c('0x2b')]['filter']){_0x258b12[_0x174c('0x36')]=_['merge'](_0x258b12['where'],{'$or':_[_0x174c('0x27')](_0x49a4e1,function(_0x5ca357){if(_0x5ca357['type']!==_0x174c('0x37')){var _0x512797={};_0x512797[_0x5ca357[_0x174c('0x25')]]={'$like':'%'+_0x334e1a[_0x174c('0x2b')]['filter']+'%'};return _0x512797;}})});}_0x258b12=_[_0x174c('0x38')]({},_0x258b12,_0x334e1a[_0x174c('0x39')]);var _0x5347eb={'where':_0x258b12[_0x174c('0x36')]};return db[_0x174c('0x3a')][_0x174c('0x1b')](_0x5347eb)[_0x174c('0x23')](function(_0x5c0514){_0x25496b[_0x174c('0x1b')]=_0x5c0514;if(_0x334e1a[_0x174c('0x2b')][_0x174c('0x3b')]){_0x258b12[_0x174c('0x3c')]=[{'all':!![]}];}return db[_0x174c('0x3a')][_0x174c('0x3d')](_0x258b12);})[_0x174c('0x23')](function(_0x271eea){_0x25496b['rows']=_0x271eea;return _0x25496b;})[_0x174c('0x23')](respondWithFilteredResult(_0xc97608,_0x258b12))['catch'](handleError(_0xc97608,null));};exports[_0x174c('0x3e')]=function(_0x2af137,_0x6284b6){var _0x1da02c={'raw':!![],'where':{'id':_0x2af137[_0x174c('0x3f')]['id']}},_0x555631={};_0x555631[_0x174c('0x2f')]=_[_0x174c('0x2c')](db[_0x174c('0x3a')][_0x174c('0x40')]);_0x555631[_0x174c('0x2b')]=_[_0x174c('0x2c')](_0x2af137[_0x174c('0x2b')]);_0x555631[_0x174c('0x2d')]=_[_0x174c('0x2e')](_0x555631[_0x174c('0x2f')],_0x555631[_0x174c('0x2b')]);_0x1da02c[_0x174c('0x30')]=_[_0x174c('0x2e')](_0x555631[_0x174c('0x2f')],qs['fields'](_0x2af137[_0x174c('0x2b')][_0x174c('0x31')]));_0x1da02c[_0x174c('0x30')]=_0x1da02c[_0x174c('0x30')][_0x174c('0x32')]?_0x1da02c[_0x174c('0x30')]:_0x555631['model'];if(_0x2af137['query'][_0x174c('0x3b')]){_0x1da02c[_0x174c('0x3c')]=[{'all':!![]}];}_0x1da02c=_[_0x174c('0x38')]({},_0x1da02c,_0x2af137[_0x174c('0x39')]);return db[_0x174c('0x3a')][_0x174c('0x41')](_0x1da02c)[_0x174c('0x23')](handleEntityNotFound(_0x6284b6,null))['then'](respondWithResult(_0x6284b6,null))[_0x174c('0x42')](handleError(_0x6284b6,null));};exports[_0x174c('0x43')]=function(_0x1e9e64,_0x31280e){var _0x37fb1e={'where':{'id':_0x1e9e64[_0x174c('0x3f')]['id']}},_0x44a739={};_0x44a739[_0x174c('0x2f')]=_[_0x174c('0x2c')](db['Attachment'][_0x174c('0x40')]);_0x37fb1e['attributes']=_['intersection'](_0x44a739['model'],qs[_0x174c('0x31')](_0x1e9e64[_0x174c('0x2b')]['fields']));_0x37fb1e[_0x174c('0x30')]=_0x37fb1e[_0x174c('0x30')][_0x174c('0x32')]?_0x37fb1e[_0x174c('0x30')]:_0x44a739[_0x174c('0x2f')];if(_0x1e9e64[_0x174c('0x2b')][_0x174c('0x3b')]){_0x37fb1e[_0x174c('0x3c')]=[{'all':!![]}];}_0x37fb1e=_[_0x174c('0x38')]({},_0x37fb1e,_0x1e9e64[_0x174c('0x39')]);return db[_0x174c('0x3a')][_0x174c('0x41')](_0x37fb1e)[_0x174c('0x23')](handleEntityNotFound(_0x31280e,null))[_0x174c('0x23')](function(_0x35bb6f){if(_0x35bb6f){var _0x11a5f3=_0x35bb6f[_0x174c('0x44')]({'plain':!![]});_0x11a5f3=qs['omit'](_0x11a5f3,['id',_0x174c('0x45'),_0x174c('0x46')]);_0x1e9e64['body']=_['omit'](_0x1e9e64['body'],['id','createdAt',_0x174c('0x46')]);return db[_0x174c('0x3a')][_0x174c('0x47')](_[_0x174c('0x38')](_0x11a5f3,_0x1e9e64['body']),{'include':_0x1e9e64[_0x174c('0x2b')][_0x174c('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x31280e,0xc9))['catch'](handleError(_0x31280e,null));};exports['update']=function(_0x45f843,_0x58454b){if(_0x45f843[_0x174c('0x48')]['id']){delete _0x45f843[_0x174c('0x48')]['id'];}return db[_0x174c('0x3a')]['find']({'where':{'id':_0x45f843[_0x174c('0x3f')]['id']}})[_0x174c('0x23')](handleEntityNotFound(_0x58454b,null))[_0x174c('0x23')](saveUpdates(_0x45f843['body'],null))[_0x174c('0x23')](respondWithResult(_0x58454b,null))[_0x174c('0x42')](handleError(_0x58454b,null));};exports['destroy']=function(_0x14d2c1,_0x26648d){return db[_0x174c('0x3a')][_0x174c('0x41')]({'where':{'id':_0x14d2c1[_0x174c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x26648d,null))['then'](removeEntity(_0x26648d,null))[_0x174c('0x42')](handleError(_0x26648d,null));};exports['create']=function(_0xf572b0,_0x4d5e30,_0x3e9caf){_0xf572b0[_0x174c('0x48')][_0x174c('0x25')]=_0xf572b0[_0x174c('0x49')][_0x174c('0x4a')];_0xf572b0[_0x174c('0x48')][_0x174c('0x4b')]=_0xf572b0[_0x174c('0x49')][_0x174c('0x4c')];_0xf572b0[_0x174c('0x48')][_0x174c('0x29')]=_0xf572b0[_0x174c('0x49')]['mimetype'];return db[_0x174c('0x3a')][_0x174c('0x47')](_0xf572b0[_0x174c('0x48')])[_0x174c('0x23')](respondWithResult(_0x4d5e30,0xc9))[_0x174c('0x42')](handleError(_0x4d5e30,null));};exports[_0x174c('0x4d')]=function(_0x2954aa,_0x1353fb,_0x587d1d){return db['Attachment']['findOne']({'where':{'id':_0x2954aa[_0x174c('0x3f')]['id']},'raw':!![]})[_0x174c('0x23')](handleEntityNotFound(_0x1353fb,null))['then'](function(_0x1c3acb){if(_0x1c3acb){var _0x3e5849=_0x1c3acb[_0x174c('0x4e')]!==null;var _0x52ca98=path['join'](config[_0x174c('0x4f')],_0x174c('0x50'));if(_0x3e5849){_0x52ca98=path[_0x174c('0x51')](_0x52ca98,_0x174c('0x52'));}var _0x50d8fd=path[_0x174c('0x51')](_0x52ca98,_0x1c3acb[_0x174c('0x4b')]);return _0x1353fb[_0x174c('0x4d')](_0x50d8fd);}})[_0x174c('0x42')](handleError(_0x1353fb,null));}; \ No newline at end of file +var _0x5241=['omit','updatedAt','body','createdAt','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','offset','count','limit','json','reject','save','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','merge','options','include','rows','catch','params','intersection','includeAll','find','clone'];(function(_0xe91d01,_0x55b425){var _0x47022d=function(_0x1dd3e6){while(--_0x1dd3e6){_0xe91d01['push'](_0xe91d01['shift']());}};_0x47022d(++_0x55b425);}(_0x5241,0x68));var _0x1524=function(_0x35e486,_0x41b583){_0x35e486=_0x35e486-0x0;var _0x585130=_0x5241[_0x35e486];return _0x585130;};'use strict';var emlformat=require(_0x1524('0x0'));var rimraf=require(_0x1524('0x1'));var zipdir=require(_0x1524('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1524('0x3'));var moment=require(_0x1524('0x4'));var BPromise=require(_0x1524('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1524('0x6'));var sox=require('sox');var csv=require(_0x1524('0x7'));var ejs=require(_0x1524('0x8'));var fs=require('fs');var fs_extra=require(_0x1524('0x9'));var _=require(_0x1524('0xa'));var squel=require(_0x1524('0xb'));var crypto=require(_0x1524('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1524('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1524('0xe'));var Papa=require('papaparse');var Redis=require(_0x1524('0xf'));var authService=require(_0x1524('0x10'));var qs=require(_0x1524('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1524('0x12'))(_0x1524('0x13'));var utils=require(_0x1524('0x14'));var config=require(_0x1524('0x15'));var licenseUtil=require(_0x1524('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c3a8b,_0x118caf){_0x118caf=_0x118caf||0xcc;return function(_0x291c68){if(_0x291c68){return _0x1c3a8b[_0x1524('0x17')](_0x118caf);}return _0x1c3a8b[_0x1524('0x18')](_0x118caf)[_0x1524('0x19')]();};}function respondWithResult(_0x565aaa,_0x4067a1){_0x4067a1=_0x4067a1||0xc8;return function(_0x2a8d78){if(_0x2a8d78){return _0x565aaa['status'](_0x4067a1)['json'](_0x2a8d78);}};}function respondWithFilteredResult(_0x279270,_0x5697d2){return function(_0x42bae9){if(_0x42bae9){var _0x33a481=typeof _0x5697d2['offset']===_0x1524('0x1a')&&typeof _0x5697d2['limit']===_0x1524('0x1a');var _0x28d844=_0x42bae9['count'];var _0x2444fa=_0x33a481?0x0:_0x5697d2[_0x1524('0x1b')];var _0x4cfbc2=_0x33a481?_0x42bae9[_0x1524('0x1c')]:_0x5697d2[_0x1524('0x1b')]+_0x5697d2[_0x1524('0x1d')];var _0x51f952;if(_0x4cfbc2>=_0x28d844){_0x4cfbc2=_0x28d844;_0x51f952=0xc8;}else{_0x51f952=0xce;}_0x279270['status'](_0x51f952);return _0x279270['set']('Content-Range',_0x2444fa+'-'+_0x4cfbc2+'/'+_0x28d844)[_0x1524('0x1e')](_0x42bae9);}return null;};}function patchUpdates(_0xaa0752){return function(_0x14db0d){try{jsonpatch['apply'](_0x14db0d,_0xaa0752,!![]);}catch(_0x1d275c){return BPromise[_0x1524('0x1f')](_0x1d275c);}return _0x14db0d[_0x1524('0x20')]();};}function saveUpdates(_0x2801bd,_0x321b6e){return function(_0x13d796){if(_0x13d796){return _0x13d796[_0x1524('0x21')](_0x2801bd)[_0x1524('0x22')](function(_0x4aba40){return _0x4aba40;});}return null;};}function removeEntity(_0x22182b,_0x1ae858){return function(_0x31bd46){if(_0x31bd46){return _0x31bd46[_0x1524('0x23')]()[_0x1524('0x22')](function(){_0x22182b[_0x1524('0x18')](0xcc)[_0x1524('0x19')]();});}};}function handleEntityNotFound(_0x2bd720,_0x8fc05e){return function(_0x2167e4){if(!_0x2167e4){_0x2bd720['sendStatus'](0x194);}return _0x2167e4;};}function handleError(_0x54c2ff,_0x819c2e){_0x819c2e=_0x819c2e||0x1f4;return function(_0xdb6f76){logger[_0x1524('0x24')](_0xdb6f76[_0x1524('0x25')]);if(_0xdb6f76[_0x1524('0x26')]){delete _0xdb6f76[_0x1524('0x26')];}_0x54c2ff[_0x1524('0x18')](_0x819c2e)[_0x1524('0x27')](_0xdb6f76);};}exports[_0x1524('0x28')]=function(_0x58bff6,_0x90bbc4){var _0x12ebc4={},_0x3cac27={},_0x46003c={'count':0x0,'rows':[]};var _0x1d56f7=_['map'](db[_0x1524('0x29')][_0x1524('0x2a')],function(_0x50d200){return{'name':_0x50d200['fieldName'],'type':_0x50d200[_0x1524('0x2b')][_0x1524('0x2c')]};});_0x3cac27[_0x1524('0x2d')]=_['map'](_0x1d56f7,_0x1524('0x26'));_0x3cac27[_0x1524('0x2e')]=_[_0x1524('0x2f')](_0x58bff6[_0x1524('0x2e')]);_0x3cac27['filters']=_['intersection'](_0x3cac27[_0x1524('0x2d')],_0x3cac27[_0x1524('0x2e')]);_0x12ebc4[_0x1524('0x30')]=_['intersection'](_0x3cac27['model'],qs[_0x1524('0x31')](_0x58bff6[_0x1524('0x2e')]['fields']));_0x12ebc4[_0x1524('0x30')]=_0x12ebc4['attributes'][_0x1524('0x32')]?_0x12ebc4[_0x1524('0x30')]:_0x3cac27[_0x1524('0x2d')];if(!_0x58bff6['query'][_0x1524('0x33')](_0x1524('0x34'))){_0x12ebc4[_0x1524('0x1d')]=qs['limit'](_0x58bff6[_0x1524('0x2e')][_0x1524('0x1d')]);_0x12ebc4['offset']=qs[_0x1524('0x1b')](_0x58bff6[_0x1524('0x2e')][_0x1524('0x1b')]);}_0x12ebc4[_0x1524('0x35')]=qs['sort'](_0x58bff6[_0x1524('0x2e')][_0x1524('0x36')]);_0x12ebc4[_0x1524('0x37')]=qs[_0x1524('0x38')](_[_0x1524('0x39')](_0x58bff6[_0x1524('0x2e')],_0x3cac27['filters']),_0x1d56f7);if(_0x58bff6['query'][_0x1524('0x3a')]){_0x12ebc4[_0x1524('0x37')]=_['merge'](_0x12ebc4[_0x1524('0x37')],{'$or':_[_0x1524('0x3b')](_0x1d56f7,function(_0x24953a){if(_0x24953a[_0x1524('0x2b')]!=='VIRTUAL'){var _0x67954={};_0x67954[_0x24953a['name']]={'$like':'%'+_0x58bff6[_0x1524('0x2e')][_0x1524('0x3a')]+'%'};return _0x67954;}})});}_0x12ebc4=_[_0x1524('0x3c')]({},_0x12ebc4,_0x58bff6[_0x1524('0x3d')]);var _0x10dea8={'where':_0x12ebc4[_0x1524('0x37')]};return db['Attachment'][_0x1524('0x1c')](_0x10dea8)[_0x1524('0x22')](function(_0x5752d8){_0x46003c[_0x1524('0x1c')]=_0x5752d8;if(_0x58bff6['query']['includeAll']){_0x12ebc4[_0x1524('0x3e')]=[{'all':!![]}];}return db[_0x1524('0x29')]['findAll'](_0x12ebc4);})[_0x1524('0x22')](function(_0x13f7ca){_0x46003c[_0x1524('0x3f')]=_0x13f7ca;return _0x46003c;})['then'](respondWithFilteredResult(_0x90bbc4,_0x12ebc4))[_0x1524('0x40')](handleError(_0x90bbc4,null));};exports['show']=function(_0x243319,_0x1b9015){var _0x1bb79b={'raw':!![],'where':{'id':_0x243319[_0x1524('0x41')]['id']}},_0x2371e9={};_0x2371e9[_0x1524('0x2d')]=_[_0x1524('0x2f')](db[_0x1524('0x29')][_0x1524('0x2a')]);_0x2371e9[_0x1524('0x2e')]=_[_0x1524('0x2f')](_0x243319[_0x1524('0x2e')]);_0x2371e9[_0x1524('0x38')]=_['intersection'](_0x2371e9['model'],_0x2371e9[_0x1524('0x2e')]);_0x1bb79b[_0x1524('0x30')]=_[_0x1524('0x42')](_0x2371e9[_0x1524('0x2d')],qs[_0x1524('0x31')](_0x243319[_0x1524('0x2e')][_0x1524('0x31')]));_0x1bb79b['attributes']=_0x1bb79b[_0x1524('0x30')][_0x1524('0x32')]?_0x1bb79b[_0x1524('0x30')]:_0x2371e9['model'];if(_0x243319[_0x1524('0x2e')][_0x1524('0x43')]){_0x1bb79b[_0x1524('0x3e')]=[{'all':!![]}];}_0x1bb79b=_[_0x1524('0x3c')]({},_0x1bb79b,_0x243319[_0x1524('0x3d')]);return db[_0x1524('0x29')][_0x1524('0x44')](_0x1bb79b)[_0x1524('0x22')](handleEntityNotFound(_0x1b9015,null))['then'](respondWithResult(_0x1b9015,null))[_0x1524('0x40')](handleError(_0x1b9015,null));};exports[_0x1524('0x45')]=function(_0x160d7e,_0x33ccef){var _0x6bf55a={'where':{'id':_0x160d7e[_0x1524('0x41')]['id']}},_0x4ae7e9={};_0x4ae7e9['model']=_['keys'](db[_0x1524('0x29')][_0x1524('0x2a')]);_0x6bf55a[_0x1524('0x30')]=_[_0x1524('0x42')](_0x4ae7e9[_0x1524('0x2d')],qs[_0x1524('0x31')](_0x160d7e[_0x1524('0x2e')][_0x1524('0x31')]));_0x6bf55a[_0x1524('0x30')]=_0x6bf55a[_0x1524('0x30')]['length']?_0x6bf55a[_0x1524('0x30')]:_0x4ae7e9[_0x1524('0x2d')];if(_0x160d7e[_0x1524('0x2e')][_0x1524('0x43')]){_0x6bf55a['include']=[{'all':!![]}];}_0x6bf55a=_[_0x1524('0x3c')]({},_0x6bf55a,_0x160d7e[_0x1524('0x3d')]);return db[_0x1524('0x29')][_0x1524('0x44')](_0x6bf55a)[_0x1524('0x22')](handleEntityNotFound(_0x33ccef,null))[_0x1524('0x22')](function(_0x33a1b9){if(_0x33a1b9){var _0x47e588=_0x33a1b9['get']({'plain':!![]});_0x47e588=qs[_0x1524('0x46')](_0x47e588,['id','createdAt',_0x1524('0x47')]);_0x160d7e[_0x1524('0x48')]=_[_0x1524('0x46')](_0x160d7e[_0x1524('0x48')],['id',_0x1524('0x49'),_0x1524('0x47')]);return db[_0x1524('0x29')][_0x1524('0x4a')](_[_0x1524('0x3c')](_0x47e588,_0x160d7e[_0x1524('0x48')]),{'include':_0x160d7e[_0x1524('0x2e')][_0x1524('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x33ccef,0xc9))[_0x1524('0x40')](handleError(_0x33ccef,null));};exports['update']=function(_0x9d3ea,_0x231e2e){if(_0x9d3ea[_0x1524('0x48')]['id']){delete _0x9d3ea[_0x1524('0x48')]['id'];}return db[_0x1524('0x29')][_0x1524('0x44')]({'where':{'id':_0x9d3ea['params']['id']}})[_0x1524('0x22')](handleEntityNotFound(_0x231e2e,null))[_0x1524('0x22')](saveUpdates(_0x9d3ea[_0x1524('0x48')],null))[_0x1524('0x22')](respondWithResult(_0x231e2e,null))['catch'](handleError(_0x231e2e,null));};exports[_0x1524('0x23')]=function(_0x1e578a,_0x3ffba9){return db[_0x1524('0x29')]['find']({'where':{'id':_0x1e578a['params']['id']}})[_0x1524('0x22')](handleEntityNotFound(_0x3ffba9,null))[_0x1524('0x22')](removeEntity(_0x3ffba9,null))[_0x1524('0x40')](handleError(_0x3ffba9,null));};exports[_0x1524('0x4a')]=function(_0x317ad2,_0x2600eb,_0x27cdc8){_0x317ad2[_0x1524('0x48')][_0x1524('0x26')]=_0x317ad2[_0x1524('0x4b')][_0x1524('0x4c')];_0x317ad2['body'][_0x1524('0x4d')]=_0x317ad2[_0x1524('0x4b')][_0x1524('0x4e')];_0x317ad2[_0x1524('0x48')][_0x1524('0x2b')]=_0x317ad2[_0x1524('0x4b')][_0x1524('0x4f')];return db[_0x1524('0x29')][_0x1524('0x4a')](_0x317ad2[_0x1524('0x48')])[_0x1524('0x22')](respondWithResult(_0x2600eb,0xc9))[_0x1524('0x40')](handleError(_0x2600eb,null));};exports['download']=function(_0x81aca2,_0x553bc7,_0x360bd6){return db[_0x1524('0x29')][_0x1524('0x50')]({'where':{'id':_0x81aca2[_0x1524('0x41')]['id']},'raw':!![]})[_0x1524('0x22')](handleEntityNotFound(_0x553bc7,null))['then'](function(_0x20b3ed){if(_0x20b3ed){var _0x1f5c40=_0x20b3ed[_0x1524('0x51')]!==null;var _0xabdf0a=path[_0x1524('0x52')](config[_0x1524('0x53')],_0x1524('0x54'));if(_0x1f5c40){_0xabdf0a=path['join'](_0xabdf0a,_0x1524('0x55'));}var _0x297d43=path[_0x1524('0x52')](_0xabdf0a,_0x20b3ed[_0x1524('0x4d')]);return _0x553bc7[_0x1524('0x56')](_0x297d43);}})[_0x1524('0x40')](handleError(_0x553bc7,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6cf19c6..9da8bd3 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 _0x155b=['request-promise','rimraf','../../config/environment','exports','attachments','lodash','../../config/logger','api','bluebird'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x155b,0x9e));var _0xb155=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0x155b[_0x5ad220];return _0xdec77d;};'use strict';var _=require(_0xb155('0x0'));var util=require('util');var logger=require(_0xb155('0x1'))(_0xb155('0x2'));var moment=require('moment');var BPromise=require(_0xb155('0x3'));var rp=require(_0xb155('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb155('0x5'));var config=require(_0xb155('0x6'));var attributes=require('./attachment.attributes');module[_0xb155('0x7')]=function(_0x152c3e,_0x2d0a22){return _0x152c3e['define']('Attachment',attributes,{'tableName':_0xb155('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9643=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Attachment','attachments','lodash','util'];(function(_0x328534,_0x33b41e){var _0x2796c0=function(_0x1ba8ad){while(--_0x1ba8ad){_0x328534['push'](_0x328534['shift']());}};_0x2796c0(++_0x33b41e);}(_0x9643,0x9a));var _0x3964=function(_0x309c77,_0xb926da){_0x309c77=_0x309c77-0x0;var _0x57685b=_0x9643[_0x309c77];return _0x57685b;};'use strict';var _=require(_0x3964('0x0'));var util=require(_0x3964('0x1'));var logger=require(_0x3964('0x2'))(_0x3964('0x3'));var moment=require(_0x3964('0x4'));var BPromise=require('bluebird');var rp=require(_0x3964('0x5'));var fs=require('fs');var path=require(_0x3964('0x6'));var rimraf=require(_0x3964('0x7'));var config=require(_0x3964('0x8'));var attributes=require('./attachment.attributes');module[_0x3964('0x9')]=function(_0x2eca17,_0x344870){return _0x2eca17[_0x3964('0xa')](_0x3964('0xb'),attributes,{'tableName':_0x3964('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 643607e..933d0dd 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 _0xf2cb=['body','options','raw','then','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','create'];(function(_0x1046eb,_0xa98803){var _0x211d33=function(_0x45ade5){while(--_0x45ade5){_0x1046eb['push'](_0x1046eb['shift']());}};_0x211d33(++_0xa98803);}(_0xf2cb,0x130));var _0xbf2c=function(_0x448f9b,_0x4dc053){_0x448f9b=_0x448f9b-0x0;var _0x55f774=_0xf2cb[_0x448f9b];return _0x55f774;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('Attachment,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('Attachment,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});}exports[_0xbf2c('0x13')]=function(_0x1df2ab){var _0x298329=this;return new Promise(function(_0x32a44d,_0x266035){return db['Attachment'][_0xbf2c('0x14')](_0x1df2ab[_0xbf2c('0x15')],{'raw':_0x1df2ab[_0xbf2c('0x16')]?_0x1df2ab[_0xbf2c('0x16')][_0xbf2c('0x17')]===undefined?!![]:![]:!![]})[_0xbf2c('0x18')](function(_0x426724){logger['info'](_0xbf2c('0x13'),_0x1df2ab);logger[_0xbf2c('0xa')](_0xbf2c('0x13'),_0x1df2ab,JSON[_0xbf2c('0xd')](_0x426724));_0x32a44d(_0x426724);})['catch'](function(_0x2bc2ad){logger[_0xbf2c('0xe')]('CreateAttachment',_0x2bc2ad[_0xbf2c('0x10')],_0x1df2ab);_0x266035(_0x298329[_0xbf2c('0xe')](0x1f4,_0x2bc2ad[_0xbf2c('0x10')]));});});}; \ No newline at end of file +var _0xfc4c=['raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','info','Attachment,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateAttachment','Attachment','create','body','options'];(function(_0x2d3a98,_0x2a9ffc){var _0x50d965=function(_0x19823b){while(--_0x19823b){_0x2d3a98['push'](_0x2d3a98['shift']());}};_0x50d965(++_0x2a9ffc);}(_0xfc4c,0xca));var _0xcfc4=function(_0x403c19,_0x4d6829){_0x403c19=_0x403c19-0x0;var _0x20efdf=_0xfc4c[_0x403c19];return _0x20efdf;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var moment=require(_0xcfc4('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfc4('0x3'));var fs=require('fs');var Redis=require(_0xcfc4('0x4'));var db=require(_0xcfc4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcfc4('0x6'));var config=require(_0xcfc4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfc4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53486d,_0x560b1c,_0x4578f4){return new BPromise(function(_0x520566,_0x13b9f6){return client['request'](_0x53486d,_0x4578f4)['then'](function(_0x49b787){logger[_0xcfc4('0x9')](_0xcfc4('0xa'),_0x560b1c,'request\x20sent');logger[_0xcfc4('0xb')]('Attachment,\x20%s,\x20%s,\x20%s',_0x560b1c,'request\x20sent',JSON[_0xcfc4('0xc')](_0x49b787));if(_0x49b787[_0xcfc4('0xd')]){if(_0x49b787[_0xcfc4('0xd')][_0xcfc4('0xe')]===0x1f4){logger[_0xcfc4('0xd')]('Attachment,\x20%s,\x20%s',_0x560b1c,_0x49b787[_0xcfc4('0xd')]['message']);return _0x13b9f6(_0x49b787[_0xcfc4('0xd')]['message']);}logger[_0xcfc4('0xd')]('Attachment,\x20%s,\x20%s',_0x560b1c,_0x49b787['error'][_0xcfc4('0xf')]);return _0x520566(_0x49b787[_0xcfc4('0xd')]['message']);}else{logger[_0xcfc4('0x9')](_0xcfc4('0xa'),_0x560b1c,_0xcfc4('0x10'));_0x520566(_0x49b787['result']['message']);}})[_0xcfc4('0x11')](function(_0x47db36){logger['error']('Attachment,\x20%s,\x20%s',_0x560b1c,_0x47db36);_0x13b9f6(_0x47db36);});});}exports[_0xcfc4('0x12')]=function(_0x52cd7b){var _0x472694=this;return new Promise(function(_0x19887b,_0x5ac260){return db[_0xcfc4('0x13')][_0xcfc4('0x14')](_0x52cd7b[_0xcfc4('0x15')],{'raw':_0x52cd7b['options']?_0x52cd7b[_0xcfc4('0x16')][_0xcfc4('0x17')]===undefined?!![]:![]:!![]})[_0xcfc4('0x18')](function(_0x5ab7f5){logger[_0xcfc4('0x9')](_0xcfc4('0x12'),_0x52cd7b);logger[_0xcfc4('0xb')](_0xcfc4('0x12'),_0x52cd7b,JSON[_0xcfc4('0xc')](_0x5ab7f5));_0x19887b(_0x5ab7f5);})[_0xcfc4('0x11')](function(_0x467e3f){logger[_0xcfc4('0xd')](_0xcfc4('0x12'),_0x467e3f[_0xcfc4('0xf')],_0x52cd7b);_0x5ac260(_0x472694[_0xcfc4('0xd')](0x1f4,_0x467e3f['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 6dafad6..c9fb83b 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x51516f,_0x1c9ca1){var _0x37dcbe=function(_0x1d1fbb){while(--_0x1d1fbb){_0x51516f['push'](_0x51516f['shift']());}};_0x37dcbe(++_0x1c9ca1);}(_0x2032,0xd9));var _0x2203=function(_0x57fe11,_0x45879b){_0x57fe11=_0x57fe11-0x0;var _0x30a545=_0x2032[_0x57fe11];return _0x30a545;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x1a72e4,_0x369807){_0x1a72e4=_0x1a72e4-0x0;var _0x137155=_0xdb28[_0x1a72e4];return _0x137155;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 19a98d9..2661576 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 _0x88f4=['Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','then','minutes','clearBlockUser','getLicense','catch','status','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','ad-login','password','User','passport-local','Strategy','moment','bluebird','util','../../components/auth/service','../../config/logger','undefined','activedirectory','url','domain','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'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x88f4,0x1dd));var _0x488f=function(_0x2b0ad1,_0x269979){_0x2b0ad1=_0x2b0ad1-0x0;var _0x458690=_0x88f4[_0x2b0ad1];return _0x458690;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x488f('0x0'))[_0x488f('0x1')];var moment=require(_0x488f('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x488f('0x3'));var util=require(_0x488f('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x488f('0x5'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x488f('0x6'))('api');function isActiveDirectoryConfigured(_0x91bf81){var _0xfd1352=![];if(typeof _0x91bf81['activedirectory']!==_0x488f('0x7')){_0xfd1352=_0x91bf81[_0x488f('0x8')]['baseDN']&&_0x91bf81[_0x488f('0x8')][_0x488f('0x9')]&&_0x91bf81[_0x488f('0x8')][_0x488f('0xa')];}return _0xfd1352;}function adAuthenticate(_0x573fa2,_0x18536d,_0x25fc36){return new BPromise(function(_0xd2bd21,_0x528592){try{var _0x498ca9=new ActiveDirectory(_0x573fa2);_0x498ca9[_0x488f('0xb')](_0x18536d,_0x25fc36,function(_0xaa7861,_0x3d16a1){if(_0xaa7861){logger[_0x488f('0xc')](_0x488f('0xd'),_0x18536d,util[_0x488f('0xe')](_0xaa7861,{'showHidden':![],'depth':null}));_0x528592(_0x488f('0xf'));}else if(!_0x3d16a1){logger[_0x488f('0xc')](_0x488f('0x10'),_0x18536d);_0x528592(_0x488f('0xf'));}else{_0xd2bd21(_0x3d16a1);}});}catch(_0x2f328b){_0x528592(_0x2f328b);}});}function ActiveDirectoryAuthenticate(_0x3d3283,_0x4a2820,_0x52f3bd,_0x5be545){var _0x5c208a,_0x3a0b61;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x488f('0x11'),_0x4a2820);return _0x5be545(null,![],{'message':_0x488f('0xf')});}return db[_0x488f('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x488f('0x13'),_0x488f('0x14')],'raw':!![]})['then'](function(_0x188d9e){_0x5c208a=_0x188d9e;if(!_0x5c208a[_0x488f('0x13')]){logger[_0x488f('0xc')](_0x488f('0x15'),_0x4a2820);throw new Error(_0x488f('0xf'));}return _0x3d3283[_0x488f('0x16')]({'logging':!![],'attributes':['id',_0x488f('0x17'),'password',_0x488f('0x18'),_0x488f('0x19'),_0x488f('0x1a'),_0x488f('0x1b'),_0x488f('0x1c'),_0x488f('0x1d')],'where':{'name':_0x4a2820,'role':{'$or':[_0x488f('0x1e'),_0x488f('0x1f'),_0x488f('0x20')]},'adSsoEnabled':!![]}});})[_0x488f('0x21')](function(_0x48777f){if(!_0x48777f||_0x48777f&&_0x48777f['name']!==_0x4a2820){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x3a0b61=_0x48777f;var _0x5d85ce=_0x3a0b61[_0x488f('0x17')]+'@'+config['activedirectory'][_0x488f('0xa')];return adAuthenticate(config[_0x488f('0x8')],_0x5d85ce,_0x52f3bd);})[_0x488f('0x21')](function(_0x53871c){if(_0x3a0b61[_0x488f('0x1a')]){throw new Error(_0x488f('0xf'));}if(_0x5c208a['blockDuration']>0x0){if(_0x3a0b61[_0x488f('0x1b')]){if(moment(_0x3a0b61[_0x488f('0x1c')])['add'](_0x5c208a[_0x488f('0x14')],_0x488f('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x488f('0x23')](_0x3a0b61,0x0,![],null)[_0x488f('0x21')](function(){return utils[_0x488f('0x24')](_0x3a0b61);})[_0x488f('0x21')](function(){return _0x5be545(null,_0x3a0b61);});}else{return utils[_0x488f('0x24')](_0x3a0b61)['then'](function(){return _0x5be545(null,_0x3a0b61);});}}else{return utils[_0x488f('0x24')](_0x3a0b61)[_0x488f('0x21')](function(){return _0x5be545(null,_0x3a0b61);});}})[_0x488f('0x25')](function(_0x1e0aa9){return _0x5be545(null,![],_0x1e0aa9);});}function handleError(_0x1d8a63,_0x2baa05,_0x4eecbd){return _0x1d8a63[_0x488f('0x26')](_0x2baa05||0x1f4)['send']({'message':_0x4eecbd?_0x4eecbd['message']||_0x4eecbd:''});}exports['login']=function(_0x6a194b,_0x13caa5,_0x3f5890){passport[_0x488f('0xb')]('ad-login',function(_0x1d277c,_0x36b5c5,_0x286502){var _0x3b14c0=_0x1d277c||_0x286502;if(_0x3b14c0){return handleError(_0x13caa5,0x191,_0x3b14c0);}if(!_0x36b5c5){return handleError(_0x13caa5,0x194,{'message':_0x488f('0x27')});}else{var _0x313bde={'payload':{'id':_0x36b5c5['id'],'role':_0x36b5c5['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x313bde)[_0x488f('0x21')](function(_0x56c09f){_0x13caa5[_0x488f('0x28')]({'id':_0x36b5c5['id'],'token':_0x56c09f,'statusCall':'','isAlreadyLogged':_0x36b5c5[_0x488f('0x1d')]});});}})(_0x6a194b,_0x13caa5,_0x3f5890);};passport[_0x488f('0x29')](_0x488f('0x2a'),new LocalStrategy({'usernameField':_0x488f('0x17'),'passwordField':_0x488f('0x2b')},function(_0x417e8d,_0x1b152e,_0x549d90){return ActiveDirectoryAuthenticate(db[_0x488f('0x2c')],_0x417e8d,_0x1b152e,_0x549d90);})); \ No newline at end of file +var _0xeffd=['adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blockedAt','online','admin','agent','then','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0xeffd,0x84));var _0xdeff=function(_0x2bed9c,_0x5bbd5e){_0x2bed9c=_0x2bed9c-0x0;var _0x104418=_0xeffd[_0x2bed9c];return _0x104418;};'use strict';var passport=require(_0xdeff('0x0'));var LocalStrategy=require(_0xdeff('0x1'))[_0xdeff('0x2')];var moment=require(_0xdeff('0x3'));var ActiveDirectory=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var util=require(_0xdeff('0x6'));var db=require(_0xdeff('0x7'))['db'];var authService=require(_0xdeff('0x8'));var utils=require('../../config/utils');var config=require(_0xdeff('0x9'));var logger=require(_0xdeff('0xa'))(_0xdeff('0xb'));function isActiveDirectoryConfigured(_0x3bdc7c){var _0xcd102a=![];if(typeof _0x3bdc7c[_0xdeff('0xc')]!=='undefined'){_0xcd102a=_0x3bdc7c[_0xdeff('0xc')][_0xdeff('0xd')]&&_0x3bdc7c[_0xdeff('0xc')][_0xdeff('0xe')]&&_0x3bdc7c[_0xdeff('0xc')][_0xdeff('0xf')];}return _0xcd102a;}function adAuthenticate(_0x1f34a9,_0x4fb30b,_0x77f13c){return new BPromise(function(_0x21da92,_0x1746e6){try{var _0x137564=new ActiveDirectory(_0x1f34a9);_0x137564[_0xdeff('0x10')](_0x4fb30b,_0x77f13c,function(_0xa33581,_0x48442b){if(_0xa33581){logger['error'](_0xdeff('0x11'),_0x4fb30b,util[_0xdeff('0x12')](_0xa33581,{'showHidden':![],'depth':null}));_0x1746e6(_0xdeff('0x13'));}else if(!_0x48442b){logger[_0xdeff('0x14')](_0xdeff('0x15'),_0x4fb30b);_0x1746e6(_0xdeff('0x13'));}else{_0x21da92(_0x48442b);}});}catch(_0x2e7b40){_0x1746e6(_0x2e7b40);}});}function ActiveDirectoryAuthenticate(_0x12f917,_0x34172e,_0x3c31fc,_0x83c26c){var _0x1d5caa,_0x3a4d4f;if(!isActiveDirectoryConfigured(config)){logger[_0xdeff('0x14')](_0xdeff('0x16'),_0x34172e);return _0x83c26c(null,![],{'message':_0xdeff('0x13')});}return db['Setting'][_0xdeff('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})['then'](function(_0x2105bf){_0x1d5caa=_0x2105bf;if(!_0x1d5caa[_0xdeff('0x18')]){logger['error'](_0xdeff('0x19'),_0x34172e);throw new Error(_0xdeff('0x13'));}return _0x12f917['findOne']({'logging':!![],'attributes':['id',_0xdeff('0x1a'),'password',_0xdeff('0x1b'),_0xdeff('0x1c'),_0xdeff('0x1d'),'blocked',_0xdeff('0x1e'),_0xdeff('0x1f')],'where':{'name':_0x34172e,'role':{'$or':[_0xdeff('0x20'),'user',_0xdeff('0x21')]},'adSsoEnabled':!![]}});})[_0xdeff('0x22')](function(_0x3a0253){if(!_0x3a0253||_0x3a0253&&_0x3a0253[_0xdeff('0x1a')]!==_0x34172e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x3a4d4f=_0x3a0253;var _0x150184=_0x3a4d4f[_0xdeff('0x1a')]+'@'+config['activedirectory'][_0xdeff('0xf')];return adAuthenticate(config[_0xdeff('0xc')],_0x150184,_0x3c31fc);})[_0xdeff('0x22')](function(_0x350f1d){if(_0x3a4d4f[_0xdeff('0x1d')]){throw new Error(_0xdeff('0x13'));}if(_0x1d5caa[_0xdeff('0x23')]>0x0){if(_0x3a4d4f[_0xdeff('0x24')]){if(moment(_0x3a4d4f['blockedAt'])[_0xdeff('0x25')](_0x1d5caa[_0xdeff('0x23')],_0xdeff('0x26'))>moment()){throw new Error(_0xdeff('0x13'));}return utils[_0xdeff('0x27')](_0x3a4d4f,0x0,![],null)[_0xdeff('0x22')](function(){return utils[_0xdeff('0x28')](_0x3a4d4f);})[_0xdeff('0x22')](function(){return _0x83c26c(null,_0x3a4d4f);});}else{return utils[_0xdeff('0x28')](_0x3a4d4f)[_0xdeff('0x22')](function(){return _0x83c26c(null,_0x3a4d4f);});}}else{return utils['getLicense'](_0x3a4d4f)['then'](function(){return _0x83c26c(null,_0x3a4d4f);});}})[_0xdeff('0x29')](function(_0x54b5f3){return _0x83c26c(null,![],_0x54b5f3);});}function handleError(_0xd898aa,_0x5db4ae,_0x2cf798){return _0xd898aa[_0xdeff('0x2a')](_0x5db4ae||0x1f4)[_0xdeff('0x2b')]({'message':_0x2cf798?_0x2cf798[_0xdeff('0x2c')]||_0x2cf798:''});}exports[_0xdeff('0x2d')]=function(_0x57fdea,_0x50028e,_0x1f37eb){passport[_0xdeff('0x10')](_0xdeff('0x2e'),function(_0x54d890,_0x41a07a,_0x4b3013){var _0x5484dd=_0x54d890||_0x4b3013;if(_0x5484dd){return handleError(_0x50028e,0x191,_0x5484dd);}if(!_0x41a07a){return handleError(_0x50028e,0x194,{'message':_0xdeff('0x2f')});}else{var _0x456516={'payload':{'id':_0x41a07a['id'],'role':_0x41a07a[_0xdeff('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xdeff('0x30')](_0x456516)['then'](function(_0x292224){_0x50028e[_0xdeff('0x31')]({'id':_0x41a07a['id'],'token':_0x292224,'statusCall':'','isAlreadyLogged':_0x41a07a[_0xdeff('0x1f')]});});}})(_0x57fdea,_0x50028e,_0x1f37eb);};passport['use'](_0xdeff('0x2e'),new LocalStrategy({'usernameField':_0xdeff('0x1a'),'passwordField':_0xdeff('0x32')},function(_0x5e38dc,_0x5b8d32,_0x5e9b7d){return ActiveDirectoryAuthenticate(db[_0xdeff('0x33')],_0x5e38dc,_0x5b8d32,_0x5e9b7d);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index cb33a1f..2f9b2cd 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 _0x9d6f=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d6f,0x1ba));var _0xf9d6=function(_0x1845b2,_0x360a66){_0x1845b2=_0x1845b2-0x0;var _0x492d89=_0x9d6f[_0x1845b2];return _0x492d89;};'use strict';var express=require(_0xf9d6('0x0'));var router=express[_0xf9d6('0x1')]();var controller=require(_0xf9d6('0x2'));router[_0xf9d6('0x3')]('/',controller[_0xf9d6('0x4')]);module[_0xf9d6('0x5')]=router; \ No newline at end of file +var _0xcc9a=['Router','login','express'];(function(_0x332edc,_0x34badb){var _0x4fbbce=function(_0x112cf4){while(--_0x112cf4){_0x332edc['push'](_0x332edc['shift']());}};_0x4fbbce(++_0x34badb);}(_0xcc9a,0x173));var _0xacc9=function(_0x310047,_0x13ebf5){_0x310047=_0x310047-0x0;var _0x2d3769=_0xcc9a[_0x310047];return _0x2d3769;};'use strict';var express=require(_0xacc9('0x0'));var router=express[_0xacc9('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xacc9('0x2')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0dcea02..44b4882 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x7a54,0x106));var _0x47a5=function(_0xecb4b7,_0x266adf){_0xecb4b7=_0xecb4b7-0x0;var _0x2ec79e=_0x7a54[_0xecb4b7];return _0x2ec79e;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ 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(_0x2e543b,_0x3c0c2a){var _0x5ad8f6=function(_0x4d896b){while(--_0x4d896b){_0x2e543b['push'](_0x2e543b['shift']());}};_0x5ad8f6(++_0x3c0c2a);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 7f3176a..7829c4e 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 _0x6865=['login','/callback','callback','setTokenCookie','exports','passport','Router','./authGoogle.controller','get'];(function(_0x375ae5,_0x3ffdf3){var _0x5299b0=function(_0x3847d4){while(--_0x3847d4){_0x375ae5['push'](_0x375ae5['shift']());}};_0x5299b0(++_0x3ffdf3);}(_0x6865,0x17f));var _0x5686=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6865[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var passport=require(_0x5686('0x0'));var router=express[_0x5686('0x1')]();var controller=require(_0x5686('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x5686('0x3')]('/',controller[_0x5686('0x4')]);router['get'](_0x5686('0x5'),controller[_0x5686('0x6')],authService['isMiddleware'],userController['login'],authService[_0x5686('0x7')]);module[_0x5686('0x8')]=router; \ No newline at end of file +var _0x8b91=['../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','express','passport','Router'];(function(_0x1efbe0,_0x4d4299){var _0x3948ff=function(_0x46f48a){while(--_0x46f48a){_0x1efbe0['push'](_0x1efbe0['shift']());}};_0x3948ff(++_0x4d4299);}(_0x8b91,0x17e));var _0x18b9=function(_0x39e74a,_0x124339){_0x39e74a=_0x39e74a-0x0;var _0x4c4068=_0x8b91[_0x39e74a];return _0x4c4068;};'use strict';var express=require(_0x18b9('0x0'));var passport=require(_0x18b9('0x1'));var router=express[_0x18b9('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x18b9('0x3'));var authService=require(_0x18b9('0x4'));router[_0x18b9('0x5')]('/',controller[_0x18b9('0x6')]);router[_0x18b9('0x5')](_0x18b9('0x7'),controller[_0x18b9('0x8')],authService[_0x18b9('0x9')],userController[_0x18b9('0x6')],authService[_0x18b9('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d7efb65..e5519bb 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 _0xe970=['getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','user','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','local-login','signToken','json','online','forgot','email','Email\x20parameter\x20is\x20missing','body','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordExpires','save','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe970,0xd9));var _0x0e97=function(_0x391b48,_0x245486){_0x391b48=_0x391b48-0x0;var _0x53abb8=_0xe970[_0x391b48];return _0x53abb8;};'use strict';var util=require('util');var passport=require(_0x0e97('0x0'));var LocalStrategy=require(_0x0e97('0x1'))[_0x0e97('0x2')];var jayson=require(_0x0e97('0x3'));var _=require(_0x0e97('0x4'));var rs=require(_0x0e97('0x5'));var moment=require('moment');var db=require(_0x0e97('0x6'))['db'];var authService=require(_0x0e97('0x7'));var utils=require(_0x0e97('0x8'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x458d0f,_0x35ba8a,_0xf1437d,_0x2a14cf){var _0x353788,_0x132b91;return db[_0x0e97('0x9')][_0x0e97('0xa')]({'where':{'id':0x1},'attributes':[_0x0e97('0xb'),_0x0e97('0xc')],'raw':!![]})[_0x0e97('0xd')](function(_0x35941e){_0x353788=_0x35941e;return _0x458d0f['findOne']({'attributes':['id',_0x0e97('0xe'),_0x0e97('0xf'),_0x0e97('0x10'),_0x0e97('0x11'),_0x0e97('0x12'),_0x0e97('0x13'),_0x0e97('0x14'),_0x0e97('0x15')],'where':{'name':_0x35ba8a,'role':{'$or':[_0x0e97('0x16'),'user',_0x0e97('0x17')]}}});})[_0x0e97('0xd')](function(_0x1e5da1){if(!_0x1e5da1||_0x1e5da1&&_0x1e5da1[_0x0e97('0xe')]!==_0x35ba8a){throw new Error(_0x0e97('0x18'));}else{_0x132b91=_0x1e5da1;return _0x132b91;}})[_0x0e97('0xd')](function(){_0x132b91[_0x0e97('0x19')](_0xf1437d,function(_0x21610f,_0x25c03b){var _0x36c83e=_0x132b91[_0x0e97('0x15')]+0x1;if(_0x21610f){return _0x2a14cf(_0x21610f);}else if(!_0x25c03b){if(_0x132b91['disabled']){return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});}else if(_0x353788[_0x0e97('0xb')]>0x0){if(_0x132b91[_0x0e97('0x13')]){if(_0x353788['blockDuration']>0x0){if(moment(_0x132b91['blockedAt'])['add'](_0x353788[_0x0e97('0xc')],_0x0e97('0x1a'))>moment()){return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});}else{return utils['clearBlockUser'](_0x132b91,_0x36c83e,![],null)[_0x0e97('0xd')](function(){return _0x2a14cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});}}else{if(_0x36c83e>=_0x353788[_0x0e97('0xb')]){return utils[_0x0e97('0x1b')](_0x132b91,0x0,!![],moment())[_0x0e97('0xd')](function(){return _0x2a14cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0e97('0x1b')](_0x132b91,_0x36c83e,![],null)[_0x0e97('0xd')](function(){return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});});}}}else{return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});}}else{if(_0x132b91[_0x0e97('0x12')]){return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});}else if(_0x353788[_0x0e97('0xb')]>0x0){if(_0x132b91[_0x0e97('0x13')]){if(_0x353788[_0x0e97('0xc')]>0x0){if(moment(_0x132b91[_0x0e97('0x14')])[_0x0e97('0x1c')](_0x353788[_0x0e97('0xc')],_0x0e97('0x1a'))>moment()){return _0x2a14cf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0e97('0x1b')](_0x132b91,0x0,![],null)['then'](function(){return utils[_0x0e97('0x1d')](_0x132b91);})[_0x0e97('0xd')](function(){return _0x2a14cf(null,_0x132b91);});}}else{return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});}}else{return utils['clearBlockUser'](_0x132b91,0x0,![],null)['then'](function(){return utils[_0x0e97('0x1d')](_0x132b91);})[_0x0e97('0xd')](function(){return _0x2a14cf(null,_0x132b91);})[_0x0e97('0x1e')](function(_0x47c258){return _0x2a14cf(null,![],_0x47c258);});}}else{if(_0x132b91[_0x0e97('0x13')]){return _0x2a14cf(null,![],{'message':_0x0e97('0x18')});}else{return utils[_0x0e97('0x1d')](_0x132b91)[_0x0e97('0xd')](function(){return _0x2a14cf(null,_0x132b91);});}}}});})[_0x0e97('0x1e')](function(_0x51e6a4){return _0x2a14cf(null,![],_0x51e6a4);});}function sendServiceMail(_0x32df3e){return db[_0x0e97('0x1f')][_0x0e97('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x0e97('0x21')],'as':_0x0e97('0x22'),'include':[{'model':db[_0x0e97('0x23')],'as':_0x0e97('0x23')}]}]})[_0x0e97('0xd')](function(_0x1d5a06){if(!_0x1d5a06){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xbdf906=_0x1d5a06[_0x0e97('0x24')]();var _0xf920ce={'account':_0xbdf906,'message':_[_0x0e97('0x25')]({'from':util[_0x0e97('0x26')]('\x22%s\x22\x20<%s>',_0x1d5a06['name'],_0x1d5a06['email']||_0x1d5a06[_0x0e97('0x22')][_0x0e97('0x27')])},_0x32df3e)};return client[_0x0e97('0x28')](_0x0e97('0x29'),_0xf920ce);})[_0x0e97('0xd')](function(_0xc93eac){if(_0xc93eac['error']){throw new Error(util[_0x0e97('0x26')](_0x0e97('0x2a'),_0xc93eac[_0x0e97('0x2b')][_0x0e97('0x2c')]||JSON['stringify'](_0xc93eac[_0x0e97('0x2b')])));}return!![];});}function handleError(_0x5f2d13,_0x998a2d,_0x5543a8){return _0x5f2d13[_0x0e97('0x2d')](_0x998a2d||0x1f4)['send']({'message':_0x5543a8?_0x5543a8[_0x0e97('0x2c')]||_0x5543a8:''});}exports['login']=function(_0x4c6c8a,_0x49df5d,_0x1cb149){passport[_0x0e97('0x19')](_0x0e97('0x2e'),function(_0x21ba0e,_0x9a4ec5,_0x39befb){var _0x1a02c1=_0x21ba0e||_0x39befb;if(_0x1a02c1){return handleError(_0x49df5d,0x191,_0x1a02c1);}if(!_0x9a4ec5){return handleError(_0x49df5d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xdd289c={'payload':{'id':_0x9a4ec5['id'],'role':_0x9a4ec5['role']},'options':{'expiresIn':0x15180}};return authService[_0x0e97('0x2f')](_0xdd289c)[_0x0e97('0xd')](function(_0xbdfdc1){_0x49df5d[_0x0e97('0x30')]({'id':_0x9a4ec5['id'],'token':_0xbdfdc1,'statusCall':'','isAlreadyLogged':_0x9a4ec5[_0x0e97('0x31')]});});}})(_0x4c6c8a,_0x49df5d,_0x1cb149);};exports[_0x0e97('0x32')]=function(_0x4ae560,_0x4ca3b5){if(!_0x4ae560['body'][_0x0e97('0x33')]){return handleError(_0x4ca3b5,0x1f4,{'message':_0x0e97('0x34')});}var _0x8daf3c=rs['generate']();_0x4ae560[_0x0e97('0x35')][_0x0e97('0x33')]=_0x4ae560[_0x0e97('0x35')][_0x0e97('0x33')][_0x0e97('0x36')]()['toLowerCase']();var _0x56996f;return db[_0x0e97('0x9')][_0x0e97('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0e97('0xc')],'raw':!![]})['then'](function(_0x5ae0d6){_0x56996f=_0x5ae0d6;return db['User']['find']({'where':{'email':_0x4ae560[_0x0e97('0x35')][_0x0e97('0x33')]}});})['then'](function(_0x13e4d2){if(!_0x13e4d2){throw new Error(_0x0e97('0x37'));}if(_0x13e4d2['disabled']){throw new Error(_0x0e97('0x38'));}if(_0x13e4d2[_0x0e97('0x13')]){if(moment(_0x13e4d2['blockedAt'])[_0x0e97('0x1c')](_0x56996f[_0x0e97('0xc')],_0x0e97('0x1a'))>moment()){throw new Error(_0x0e97('0x39'));}else{_0x13e4d2[_0x0e97('0x13')]=![];_0x13e4d2[_0x0e97('0x14')]=null;}}_0x13e4d2[_0x0e97('0x3a')]=_0x8daf3c;_0x13e4d2['resetPasswordExpires']=Date[_0x0e97('0x3b')]()+0x36ee80;return _0x13e4d2['save']();})['then'](function(){return sendServiceMail({'to':_0x4ae560[_0x0e97('0x35')][_0x0e97('0x33')],'subject':_0x0e97('0x3c'),'text':_0x0e97('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x0e97('0x3e')+_0x4ae560[_0x0e97('0x3f')]['host']+_0x0e97('0x40')+_0x8daf3c+'\x0a\x0a'+_0x0e97('0x41')});})[_0x0e97('0xd')](function(){_0x4ca3b5[_0x0e97('0x2d')](0xc8)[_0x0e97('0x42')]({'message':_0x0e97('0x43')});})[_0x0e97('0x1e')](function(_0x43c209){return handleError(_0x4ca3b5,0x1f4,_0x43c209);});};exports['reset']=function(_0x3dce08,_0x1ec4bc){return db[_0x0e97('0x44')][_0x0e97('0x20')]({'where':{'resetPasswordToken':_0x3dce08[_0x0e97('0x45')][_0x0e97('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x29c958){if(!_0x29c958){throw new Error(_0x0e97('0x47'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x0e97('0x48'),_0x0e97('0x49')]})[_0x0e97('0xd')](function(_0x35926e){if(_0x35926e[_0x0e97('0x4a')])authService[_0x0e97('0x4b')](_0x3dce08['body'][_0x0e97('0xf')]);if(!_0x35926e[_0x0e97('0x48')]||!_0x29c958['previousPasswords'])return _0x29c958;authService[_0x0e97('0x4c')](_0x3dce08[_0x0e97('0x35')][_0x0e97('0xf')],_0x29c958[_0x0e97('0x4d')],_0x35926e[_0x0e97('0x49')]);return _0x29c958;})[_0x0e97('0xd')](function(){_0x29c958[_0x0e97('0xf')]=_0x3dce08[_0x0e97('0x35')]['password'];_0x29c958[_0x0e97('0x3a')]=null;_0x29c958[_0x0e97('0x4e')]=null;return _0x29c958[_0x0e97('0x4f')]();});})[_0x0e97('0xd')](function(){_0x1ec4bc['status'](0xc8)[_0x0e97('0x42')]({'message':_0x0e97('0x50')});})['catch'](function(_0x1f1313){return handleError(_0x1ec4bc,0x1f4,_0x1f1313);});};passport[_0x0e97('0x51')](_0x0e97('0x2e'),new LocalStrategy({'usernameField':_0x0e97('0xe'),'passwordField':_0x0e97('0xf')},function(_0x2792d6,_0x1ed5ea,_0x2b4b3e){return localAuthenticate(db[_0x0e97('0x44')],_0x2792d6,_0x1ed5ea,_0x2b4b3e);})); \ No newline at end of file +var _0x125e=['format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','now','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','passwordHistoryLimit','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','util','passport','jayson/promise','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockedAt','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge'];(function(_0x1ccefa,_0x5f0dd9){var _0x2ffc70=function(_0x552c06){while(--_0x552c06){_0x1ccefa['push'](_0x1ccefa['shift']());}};_0x2ffc70(++_0x5f0dd9);}(_0x125e,0x173));var _0xe125=function(_0x4a3ee3,_0x304512){_0x4a3ee3=_0x4a3ee3-0x0;var _0x56d16d=_0x125e[_0x4a3ee3];return _0x56d16d;};'use strict';var util=require(_0xe125('0x0'));var passport=require(_0xe125('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xe125('0x2'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xe125('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0xe125('0x4'));var utils=require(_0xe125('0x5'));var client=jayson[_0xe125('0x6')][_0xe125('0x7')]({'port':0x232b});function localAuthenticate(_0x389ddb,_0x117906,_0x5b29c3,_0x5030fa){var _0x75ad1,_0x2703a5;return db[_0xe125('0x8')][_0xe125('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe125('0xa')],'raw':!![]})[_0xe125('0xb')](function(_0x4fe6ce){_0x75ad1=_0x4fe6ce;return _0x389ddb[_0xe125('0x9')]({'attributes':['id',_0xe125('0xc'),_0xe125('0xd'),_0xe125('0xe'),_0xe125('0xf'),_0xe125('0x10'),_0xe125('0x11'),'blockedAt','loginAttempts'],'where':{'name':_0x117906,'role':{'$or':[_0xe125('0x12'),_0xe125('0x13'),_0xe125('0x14')]}}});})['then'](function(_0x1a0700){if(!_0x1a0700||_0x1a0700&&_0x1a0700['name']!==_0x117906){throw new Error(_0xe125('0x15'));}else{_0x2703a5=_0x1a0700;return _0x2703a5;}})[_0xe125('0xb')](function(){_0x2703a5[_0xe125('0x16')](_0x5b29c3,function(_0x224563,_0x37544a){var _0x567fa9=_0x2703a5[_0xe125('0x17')]+0x1;if(_0x224563){return _0x5030fa(_0x224563);}else if(!_0x37544a){if(_0x2703a5['disabled']){return _0x5030fa(null,![],{'message':_0xe125('0x15')});}else if(_0x75ad1['allowedLoginAttempts']>0x0){if(_0x2703a5[_0xe125('0x11')]){if(_0x75ad1[_0xe125('0xa')]>0x0){if(moment(_0x2703a5[_0xe125('0x18')])[_0xe125('0x19')](_0x75ad1[_0xe125('0xa')],_0xe125('0x1a'))>moment()){return _0x5030fa(null,![],{'message':_0xe125('0x15')});}else{return utils[_0xe125('0x1b')](_0x2703a5,_0x567fa9,![],null)[_0xe125('0xb')](function(){return _0x5030fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5030fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x567fa9>=_0x75ad1[_0xe125('0x1c')]){return utils['clearBlockUser'](_0x2703a5,0x0,!![],moment())[_0xe125('0xb')](function(){return _0x5030fa(null,![],{'message':_0xe125('0x15')});});}else{return utils[_0xe125('0x1b')](_0x2703a5,_0x567fa9,![],null)['then'](function(){return _0x5030fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5030fa(null,![],{'message':_0xe125('0x15')});}}else{if(_0x2703a5['disabled']){return _0x5030fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x75ad1['allowedLoginAttempts']>0x0){if(_0x2703a5[_0xe125('0x11')]){if(_0x75ad1[_0xe125('0xa')]>0x0){if(moment(_0x2703a5[_0xe125('0x18')])[_0xe125('0x19')](_0x75ad1[_0xe125('0xa')],'minutes')>moment()){return _0x5030fa(null,![],{'message':_0xe125('0x15')});}else{return utils['clearBlockUser'](_0x2703a5,0x0,![],null)[_0xe125('0xb')](function(){return utils[_0xe125('0x1d')](_0x2703a5);})[_0xe125('0xb')](function(){return _0x5030fa(null,_0x2703a5);});}}else{return _0x5030fa(null,![],{'message':_0xe125('0x15')});}}else{return utils[_0xe125('0x1b')](_0x2703a5,0x0,![],null)[_0xe125('0xb')](function(){return utils[_0xe125('0x1d')](_0x2703a5);})[_0xe125('0xb')](function(){return _0x5030fa(null,_0x2703a5);})[_0xe125('0x1e')](function(_0x2bf442){return _0x5030fa(null,![],_0x2bf442);});}}else{if(_0x2703a5[_0xe125('0x11')]){return _0x5030fa(null,![],{'message':_0xe125('0x15')});}else{return utils[_0xe125('0x1d')](_0x2703a5)[_0xe125('0xb')](function(){return _0x5030fa(null,_0x2703a5);});}}}});})[_0xe125('0x1e')](function(_0x222160){return _0x5030fa(null,![],_0x222160);});}function sendServiceMail(_0x36b52f){return db[_0xe125('0x1f')][_0xe125('0x20')]({'where':{'service':!![]},'attributes':['id',_0xe125('0xc'),_0xe125('0x21')],'include':[{'model':db[_0xe125('0x22')],'as':'Smtp','include':[{'model':db[_0xe125('0x23')],'as':_0xe125('0x23')}]}]})[_0xe125('0xb')](function(_0x3b8510){if(!_0x3b8510){throw new Error(_0xe125('0x24'));}var _0x16afc2=_0x3b8510[_0xe125('0x25')]();var _0x4ce834={'account':_0x16afc2,'message':_[_0xe125('0x26')]({'from':util[_0xe125('0x27')](_0xe125('0x28'),_0x3b8510['name'],_0x3b8510[_0xe125('0x21')]||_0x3b8510['Smtp']['user'])},_0x36b52f)};return client[_0xe125('0x29')]('SendMail',_0x4ce834);})[_0xe125('0xb')](function(_0x4e784b){if(_0x4e784b[_0xe125('0x2a')]){throw new Error(util['format'](_0xe125('0x2b'),_0x4e784b[_0xe125('0x2a')][_0xe125('0x2c')]||JSON[_0xe125('0x2d')](_0x4e784b[_0xe125('0x2a')])));}return!![];});}function handleError(_0x31d08f,_0x455b40,_0x44db01){return _0x31d08f[_0xe125('0x2e')](_0x455b40||0x1f4)[_0xe125('0x2f')]({'message':_0x44db01?_0x44db01[_0xe125('0x2c')]||_0x44db01:''});}exports[_0xe125('0x30')]=function(_0x357bd9,_0x189f9c,_0x40251e){passport[_0xe125('0x16')](_0xe125('0x31'),function(_0x5b428a,_0x33677e,_0x4a2ae5){var _0x4b8cef=_0x5b428a||_0x4a2ae5;if(_0x4b8cef){return handleError(_0x189f9c,0x191,_0x4b8cef);}if(!_0x33677e){return handleError(_0x189f9c,0x194,{'message':_0xe125('0x32')});}else{var _0xb0b651={'payload':{'id':_0x33677e['id'],'role':_0x33677e[_0xe125('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xe125('0x33')](_0xb0b651)[_0xe125('0xb')](function(_0x4aeea8){_0x189f9c['json']({'id':_0x33677e['id'],'token':_0x4aeea8,'statusCall':'','isAlreadyLogged':_0x33677e[_0xe125('0x34')]});});}})(_0x357bd9,_0x189f9c,_0x40251e);};exports[_0xe125('0x35')]=function(_0x35dce0,_0x2c8e2a){if(!_0x35dce0['body'][_0xe125('0x21')]){return handleError(_0x2c8e2a,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x567681=rs[_0xe125('0x36')]();_0x35dce0[_0xe125('0x37')][_0xe125('0x21')]=_0x35dce0[_0xe125('0x37')][_0xe125('0x21')][_0xe125('0x38')]()[_0xe125('0x39')]();var _0x4b74e1;return db[_0xe125('0x8')][_0xe125('0x9')]({'where':{'id':0x1},'attributes':[_0xe125('0x1c'),_0xe125('0xa')],'raw':!![]})['then'](function(_0x825ac){_0x4b74e1=_0x825ac;return db[_0xe125('0x3a')]['find']({'where':{'email':_0x35dce0[_0xe125('0x37')][_0xe125('0x21')]}});})['then'](function(_0x59ca41){if(!_0x59ca41){throw new Error(_0xe125('0x3b'));}if(_0x59ca41['disabled']){throw new Error(_0xe125('0x3c'));}if(_0x59ca41[_0xe125('0x11')]){if(moment(_0x59ca41[_0xe125('0x18')])['add'](_0x4b74e1[_0xe125('0xa')],_0xe125('0x1a'))>moment()){throw new Error(_0xe125('0x3d'));}else{_0x59ca41[_0xe125('0x11')]=![];_0x59ca41['blockedAt']=null;}}_0x59ca41['resetPasswordToken']=_0x567681;_0x59ca41['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x59ca41[_0xe125('0x3e')]();})[_0xe125('0xb')](function(){return sendServiceMail({'to':_0x35dce0[_0xe125('0x37')]['email'],'subject':_0xe125('0x3f'),'text':_0xe125('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x35dce0[_0xe125('0x41')][_0xe125('0x42')]+_0xe125('0x43')+_0x567681+'\x0a\x0a'+_0xe125('0x44')});})[_0xe125('0xb')](function(){_0x2c8e2a['status'](0xc8)[_0xe125('0x2f')]({'message':_0xe125('0x45')});})['catch'](function(_0x37c714){return handleError(_0x2c8e2a,0x1f4,_0x37c714);});};exports[_0xe125('0x46')]=function(_0x2073f7,_0x3ea759){return db[_0xe125('0x3a')][_0xe125('0x20')]({'where':{'resetPasswordToken':_0x2073f7['params'][_0xe125('0x47')],'resetPasswordExpires':{'$gt':Date[_0xe125('0x48')]()}}})['then'](function(_0x13e77f){if(!_0x13e77f){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xe125('0x8')]['findOne']({'attributes':['id','securePassword',_0xe125('0x49'),'passwordHistoryLimit']})[_0xe125('0xb')](function(_0x57fe96){if(_0x57fe96[_0xe125('0x4a')])authService[_0xe125('0x4b')](_0x2073f7[_0xe125('0x37')][_0xe125('0xd')]);if(!_0x57fe96['enforcePasswordHistory']||!_0x13e77f['previousPasswords'])return _0x13e77f;authService['validatePasswordHistory'](_0x2073f7['body']['password'],_0x13e77f[_0xe125('0x4c')],_0x57fe96[_0xe125('0x4d')]);return _0x13e77f;})[_0xe125('0xb')](function(){_0x13e77f[_0xe125('0xd')]=_0x2073f7[_0xe125('0x37')][_0xe125('0xd')];_0x13e77f[_0xe125('0x4e')]=null;_0x13e77f[_0xe125('0x4f')]=null;return _0x13e77f[_0xe125('0x3e')]();});})[_0xe125('0xb')](function(){_0x3ea759[_0xe125('0x2e')](0xc8)['send']({'message':_0xe125('0x50')});})[_0xe125('0x1e')](function(_0x5ebab4){return handleError(_0x3ea759,0x1f4,_0x5ebab4);});};passport[_0xe125('0x51')](_0xe125('0x31'),new LocalStrategy({'usernameField':'name','passwordField':_0xe125('0xd')},function(_0x103de2,_0x432a2a,_0x376e37){return localAuthenticate(db['User'],_0x103de2,_0x432a2a,_0x376e37);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 15f373a..e7039c5 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 _0x4bae=['post','login','/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4bae,0x15c));var _0xe4ba=function(_0x4084eb,_0x30c6ad){_0x4084eb=_0x4084eb-0x0;var _0x4c1f1c=_0x4bae[_0x4084eb];return _0x4c1f1c;};'use strict';var express=require(_0xe4ba('0x0'));var router=express[_0xe4ba('0x1')]();var controller=require(_0xe4ba('0x2'));router[_0xe4ba('0x3')]('/',controller[_0xe4ba('0x4')]);router[_0xe4ba('0x3')](_0xe4ba('0x5'),controller[_0xe4ba('0x6')]);router[_0xe4ba('0x3')](_0xe4ba('0x7'),controller['reset']);module[_0xe4ba('0x8')]=router; \ No newline at end of file +var _0xfe57=['/reset/:token','exports','express','Router','./authLocal.controller','post'];(function(_0x4610c3,_0x3d96f6){var _0x39fb58=function(_0x368778){while(--_0x368778){_0x4610c3['push'](_0x4610c3['shift']());}};_0x39fb58(++_0x3d96f6);}(_0xfe57,0x152));var _0x7fe5=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xfe57[_0x403c20];return _0x2b271a;};'use strict';var express=require(_0x7fe5('0x0'));var router=express[_0x7fe5('0x1')]();var controller=require(_0x7fe5('0x2'));router[_0x7fe5('0x3')]('/',controller['login']);router[_0x7fe5('0x3')]('/forgot',controller['forgot']);router[_0x7fe5('0x3')](_0x7fe5('0x4'),controller['reset']);module[_0x7fe5('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f3ce13e..a987081 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 _0x605b=['sequelize','exports','STRING'];(function(_0xdb1544,_0x4b13ef){var _0x39136c=function(_0x128a31){while(--_0x128a31){_0xdb1544['push'](_0xdb1544['shift']());}};_0x39136c(++_0x4b13ef);}(_0x605b,0x1c5));var _0xb605=function(_0x4ae5e1,_0x2362f6){_0x4ae5e1=_0x4ae5e1-0x0;var _0x56fbac=_0x605b[_0x4ae5e1];return _0x56fbac;};'use strict';var Sequelize=require(_0xb605('0x0'));module[_0xb605('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xb605('0x2')]},'description':{'type':Sequelize[_0xb605('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xa259=['STRING','INTEGER','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa259,0x1b2));var _0x9a25=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xa259[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require('sequelize');module[_0x9a25('0x0')]={'name':{'type':Sequelize[_0x9a25('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x9a25('0x1')]},'description':{'type':Sequelize[_0x9a25('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9a25('0x2')],'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 0d5180a..5c7fc36 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 _0xad8e=['stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Automation','findAll','rows','show','params','rawAttributes','includeAll','include','find','catch','create','body','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xad8e,0x120));var _0xead8=function(_0x655047,_0x573efa){_0x655047=_0x655047-0x0;var _0x1328fe=_0xad8e[_0x655047];return _0x1328fe;};'use strict';var emlformat=require(_0xead8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xead8('0x1'));var jsonpatch=require(_0xead8('0x2'));var rp=require(_0xead8('0x3'));var moment=require(_0xead8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xead8('0x5'));var util=require('util');var path=require(_0xead8('0x6'));var sox=require('sox');var csv=require(_0xead8('0x7'));var ejs=require(_0xead8('0x8'));var fs=require('fs');var fs_extra=require(_0xead8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xead8('0xa'));var deskjs=require(_0xead8('0xb'));var toCsv=require(_0xead8('0x7'));var querystring=require('querystring');var Papa=require(_0xead8('0xc'));var Redis=require(_0xead8('0xd'));var authService=require(_0xead8('0xe'));var qs=require(_0xead8('0xf'));var as=require(_0xead8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xead8('0x11'))(_0xead8('0x12'));var utils=require(_0xead8('0x13'));var config=require(_0xead8('0x14'));var licenseUtil=require(_0xead8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x141436,_0xa91b57){_0xa91b57=_0xa91b57||0xcc;return function(_0x549e34){if(_0x549e34){return _0x141436['sendStatus'](_0xa91b57);}return _0x141436['status'](_0xa91b57)[_0xead8('0x16')]();};}function respondWithResult(_0x2714d4,_0x6d36e7){_0x6d36e7=_0x6d36e7||0xc8;return function(_0x4ae00a){if(_0x4ae00a){return _0x2714d4[_0xead8('0x17')](_0x6d36e7)[_0xead8('0x18')](_0x4ae00a);}};}function respondWithFilteredResult(_0x5d9882,_0x1bcd24){return function(_0x32a7aa){if(_0x32a7aa){var _0x29ff2d=typeof _0x1bcd24[_0xead8('0x19')]===_0xead8('0x1a')&&typeof _0x1bcd24[_0xead8('0x1b')]===_0xead8('0x1a');var _0x1c56b6=_0x32a7aa[_0xead8('0x1c')];var _0x4d8c35=_0x29ff2d?0x0:_0x1bcd24[_0xead8('0x19')];var _0x59be11=_0x29ff2d?_0x32a7aa[_0xead8('0x1c')]:_0x1bcd24[_0xead8('0x19')]+_0x1bcd24['limit'];var _0x1433d0;if(_0x59be11>=_0x1c56b6){_0x59be11=_0x1c56b6;_0x1433d0=0xc8;}else{_0x1433d0=0xce;}_0x5d9882[_0xead8('0x17')](_0x1433d0);return _0x5d9882[_0xead8('0x1d')]('Content-Range',_0x4d8c35+'-'+_0x59be11+'/'+_0x1c56b6)['json'](_0x32a7aa);}return null;};}function patchUpdates(_0x4a128a){return function(_0x463c65){try{jsonpatch['apply'](_0x463c65,_0x4a128a,!![]);}catch(_0x172987){return BPromise['reject'](_0x172987);}return _0x463c65[_0xead8('0x1e')]();};}function saveUpdates(_0xc107f4,_0x260100){return function(_0x2347c9){if(_0x2347c9){return _0x2347c9[_0xead8('0x1f')](_0xc107f4)[_0xead8('0x20')](function(_0x3e7b9e){return _0x3e7b9e;});}return null;};}function removeEntity(_0x29ebf5,_0x145df0){return function(_0x5049b6){if(_0x5049b6){return _0x5049b6[_0xead8('0x21')]()[_0xead8('0x20')](function(){_0x29ebf5[_0xead8('0x17')](0xcc)[_0xead8('0x16')]();});}};}function handleEntityNotFound(_0x1abe37,_0x3ec259){return function(_0xce4f6b){if(!_0xce4f6b){_0x1abe37[_0xead8('0x22')](0x194);}return _0xce4f6b;};}function handleError(_0x4be495,_0x2f441a){_0x2f441a=_0x2f441a||0x1f4;return function(_0x3fd6e6){logger[_0xead8('0x23')](_0x3fd6e6[_0xead8('0x24')]);if(_0x3fd6e6[_0xead8('0x25')]){delete _0x3fd6e6[_0xead8('0x25')];}_0x4be495[_0xead8('0x17')](_0x2f441a)[_0xead8('0x26')](_0x3fd6e6);};}exports['index']=function(_0x2e4a1d,_0x146582){var _0x35ba93={},_0x48dfed={},_0x4f8ae1={'count':0x0,'rows':[]};var _0x52b162=_['map'](db['Automation']['rawAttributes'],function(_0x339770){return{'name':_0x339770[_0xead8('0x27')],'type':_0x339770[_0xead8('0x28')][_0xead8('0x29')]};});_0x48dfed[_0xead8('0x2a')]=_[_0xead8('0x2b')](_0x52b162,_0xead8('0x25'));_0x48dfed[_0xead8('0x2c')]=_[_0xead8('0x2d')](_0x2e4a1d[_0xead8('0x2c')]);_0x48dfed[_0xead8('0x2e')]=_[_0xead8('0x2f')](_0x48dfed['model'],_0x48dfed[_0xead8('0x2c')]);_0x35ba93[_0xead8('0x30')]=_[_0xead8('0x2f')](_0x48dfed[_0xead8('0x2a')],qs[_0xead8('0x31')](_0x2e4a1d['query']['fields']));_0x35ba93[_0xead8('0x30')]=_0x35ba93[_0xead8('0x30')][_0xead8('0x32')]?_0x35ba93[_0xead8('0x30')]:_0x48dfed['model'];if(!_0x2e4a1d[_0xead8('0x2c')][_0xead8('0x33')](_0xead8('0x34'))){_0x35ba93[_0xead8('0x1b')]=qs['limit'](_0x2e4a1d['query']['limit']);_0x35ba93[_0xead8('0x19')]=qs[_0xead8('0x19')](_0x2e4a1d[_0xead8('0x2c')]['offset']);}_0x35ba93[_0xead8('0x35')]=qs[_0xead8('0x36')](_0x2e4a1d[_0xead8('0x2c')][_0xead8('0x36')]);_0x35ba93[_0xead8('0x37')]=qs[_0xead8('0x2e')](_[_0xead8('0x38')](_0x2e4a1d[_0xead8('0x2c')],_0x48dfed['filters']),_0x52b162);if(_0x2e4a1d['query'][_0xead8('0x39')]){_0x35ba93[_0xead8('0x37')]=_[_0xead8('0x3a')](_0x35ba93['where'],{'$or':_[_0xead8('0x2b')](_0x52b162,function(_0x2ab2c2){if(_0x2ab2c2[_0xead8('0x28')]!=='VIRTUAL'){var _0x13d5f3={};_0x13d5f3[_0x2ab2c2['name']]={'$like':'%'+_0x2e4a1d['query'][_0xead8('0x39')]+'%'};return _0x13d5f3;}})});}_0x35ba93=_[_0xead8('0x3a')]({},_0x35ba93,_0x2e4a1d[_0xead8('0x3b')]);var _0x31163b={'where':_0x35ba93[_0xead8('0x37')]};return db[_0xead8('0x3c')]['count'](_0x31163b)[_0xead8('0x20')](function(_0x38b3ae){_0x4f8ae1['count']=_0x38b3ae;if(_0x2e4a1d['query']['includeAll']){_0x35ba93['include']=[{'all':!![]}];}return db[_0xead8('0x3c')][_0xead8('0x3d')](_0x35ba93);})[_0xead8('0x20')](function(_0x2017ce){_0x4f8ae1[_0xead8('0x3e')]=_0x2017ce;return _0x4f8ae1;})[_0xead8('0x20')](respondWithFilteredResult(_0x146582,_0x35ba93))['catch'](handleError(_0x146582,null));};exports[_0xead8('0x3f')]=function(_0x48c14f,_0x469da2){var _0x3917e4={'raw':![],'where':{'id':_0x48c14f[_0xead8('0x40')]['id']}},_0xa67dc3={};_0xa67dc3[_0xead8('0x2a')]=_[_0xead8('0x2d')](db[_0xead8('0x3c')][_0xead8('0x41')]);_0xa67dc3[_0xead8('0x2c')]=_['keys'](_0x48c14f['query']);_0xa67dc3['filters']=_['intersection'](_0xa67dc3[_0xead8('0x2a')],_0xa67dc3[_0xead8('0x2c')]);_0x3917e4[_0xead8('0x30')]=_[_0xead8('0x2f')](_0xa67dc3[_0xead8('0x2a')],qs[_0xead8('0x31')](_0x48c14f[_0xead8('0x2c')][_0xead8('0x31')]));_0x3917e4[_0xead8('0x30')]=_0x3917e4[_0xead8('0x30')][_0xead8('0x32')]?_0x3917e4[_0xead8('0x30')]:_0xa67dc3[_0xead8('0x2a')];if(_0x48c14f['query'][_0xead8('0x42')]){_0x3917e4[_0xead8('0x43')]=[{'all':!![]}];}_0x3917e4=_['merge']({},_0x3917e4,_0x48c14f['options']);return db['Automation'][_0xead8('0x44')](_0x3917e4)[_0xead8('0x20')](handleEntityNotFound(_0x469da2,null))[_0xead8('0x20')](respondWithResult(_0x469da2,null))[_0xead8('0x45')](handleError(_0x469da2,null));};exports[_0xead8('0x46')]=function(_0x453a7b,_0x1ae5e1){return db[_0xead8('0x3c')][_0xead8('0x46')](_0x453a7b['body'],{})['then'](respondWithResult(_0x1ae5e1,0xc9))[_0xead8('0x45')](handleError(_0x1ae5e1,null));};exports[_0xead8('0x1f')]=function(_0xebc199,_0x5b6945){if(_0xebc199['body']['id']){delete _0xebc199['body']['id'];}return db[_0xead8('0x3c')][_0xead8('0x44')]({'where':{'id':_0xebc199['params']['id']}})[_0xead8('0x20')](handleEntityNotFound(_0x5b6945,null))[_0xead8('0x20')](saveUpdates(_0xebc199[_0xead8('0x47')],null))[_0xead8('0x20')](respondWithResult(_0x5b6945,null))['catch'](handleError(_0x5b6945,null));};exports[_0xead8('0x21')]=function(_0x36bc17,_0x1fb92a){return db[_0xead8('0x3c')][_0xead8('0x44')]({'where':{'id':_0x36bc17['params']['id']}})['then'](handleEntityNotFound(_0x1fb92a,null))[_0xead8('0x20')](removeEntity(_0x1fb92a,null))[_0xead8('0x45')](handleError(_0x1fb92a,null));};exports[_0xead8('0x48')]=function(_0x305917,_0x3eb1f1,_0x490eb5){return db['Condition'][_0xead8('0x44')]({'where':{'id':_0x305917[_0xead8('0x40')]['id']}})[_0xead8('0x20')](handleEntityNotFound(_0x3eb1f1,null))[_0xead8('0x20')](function(_0x5a71ef){if(_0x5a71ef){return _0x5a71ef[_0xead8('0x48')](_0x305917[_0xead8('0x47')][_0xead8('0x49')],_[_0xead8('0x4a')](_0x305917['body'],['ids','id'])||{});}})[_0xead8('0x20')](respondWithResult(_0x3eb1f1,null))[_0xead8('0x45')](handleError(_0x3eb1f1,null));};exports[_0xead8('0x4b')]=function(_0x28b102,_0x3db6af,_0x5aa7aa){var _0x4318b6={};var _0x2cb4de={};var _0x4c890b;var _0x512226;return db[_0xead8('0x3c')][_0xead8('0x4c')]({'where':{'id':_0x28b102[_0xead8('0x40')]['id']}})[_0xead8('0x20')](handleEntityNotFound(_0x3db6af,null))[_0xead8('0x20')](function(_0x477c0f){if(_0x477c0f){_0x4c890b=_0x477c0f;_0x2cb4de['model']=_[_0xead8('0x2d')](db[_0xead8('0x4d')][_0xead8('0x41')]);_0x2cb4de[_0xead8('0x2c')]=_[_0xead8('0x2d')](_0x28b102[_0xead8('0x2c')]);_0x2cb4de[_0xead8('0x2e')]=_['intersection'](_0x2cb4de['model'],_0x2cb4de[_0xead8('0x2c')]);_0x4318b6[_0xead8('0x30')]=_[_0xead8('0x2f')](_0x2cb4de['model'],qs[_0xead8('0x31')](_0x28b102[_0xead8('0x2c')]['fields']));_0x4318b6[_0xead8('0x30')]=_0x4318b6['attributes'][_0xead8('0x32')]?_0x4318b6['attributes']:_0x2cb4de[_0xead8('0x2a')];_0x4318b6[_0xead8('0x35')]=qs[_0xead8('0x36')](_0x28b102[_0xead8('0x2c')]['sort']);_0x4318b6['where']=qs[_0xead8('0x2e')](_['pick'](_0x28b102['query'],_0x2cb4de[_0xead8('0x2e')]));if(_0x28b102[_0xead8('0x2c')][_0xead8('0x39')]){_0x4318b6[_0xead8('0x37')]=_[_0xead8('0x3a')](_0x4318b6['where'],{'$or':_[_0xead8('0x2b')](_0x4318b6[_0xead8('0x30')],function(_0x43004a){var _0x1b547a={};_0x1b547a[_0x43004a]={'$like':'%'+_0x28b102[_0xead8('0x2c')]['filter']+'%'};return _0x1b547a;})});}_0x4318b6=_[_0xead8('0x3a')]({},_0x4318b6,_0x28b102[_0xead8('0x3b')]);return _0x4c890b[_0xead8('0x4b')](_0x4318b6);}})['then'](function(_0x42796d){if(_0x42796d){_0x512226=_0x42796d[_0xead8('0x32')];if(!_0x28b102[_0xead8('0x2c')]['hasOwnProperty']('nolimit')){_0x4318b6[_0xead8('0x1b')]=qs[_0xead8('0x1b')](_0x28b102[_0xead8('0x2c')][_0xead8('0x1b')]);_0x4318b6[_0xead8('0x19')]=qs[_0xead8('0x19')](_0x28b102[_0xead8('0x2c')][_0xead8('0x19')]);}return _0x4c890b['getConditions'](_0x4318b6);}})[_0xead8('0x20')](function(_0xf0e7ea){if(_0xf0e7ea){return _0xf0e7ea?{'count':_0x512226,'rows':_0xf0e7ea}:null;}})[_0xead8('0x20')](respondWithResult(_0x3db6af,null))[_0xead8('0x45')](handleError(_0x3db6af,null));};exports[_0xead8('0x4e')]=function(_0x351d90,_0x1615d8,_0x24ed6f){return db[_0xead8('0x4f')][_0xead8('0x44')]({'where':{'id':_0x351d90['params']['id']}})[_0xead8('0x20')](handleEntityNotFound(_0x1615d8,null))['then'](function(_0x377d49){if(_0x377d49){return _0x377d49[_0xead8('0x4e')](_0x351d90[_0xead8('0x47')]['ids'],_[_0xead8('0x4a')](_0x351d90['body'],['ids','id'])||{});}})[_0xead8('0x20')](respondWithResult(_0x1615d8,null))['catch'](handleError(_0x1615d8,null));};exports[_0xead8('0x50')]=function(_0x3fbcc2,_0x179e10,_0x5d5369){var _0x329c83={};var _0x598470={};var _0x25103f;var _0x4355b4;return db[_0xead8('0x3c')][_0xead8('0x4c')]({'where':{'id':_0x3fbcc2['params']['id']}})[_0xead8('0x20')](handleEntityNotFound(_0x179e10,null))['then'](function(_0xc15669){if(_0xc15669){_0x25103f=_0xc15669;_0x598470['model']=_['keys'](db[_0xead8('0x4f')][_0xead8('0x41')]);_0x598470['query']=_[_0xead8('0x2d')](_0x3fbcc2['query']);_0x598470[_0xead8('0x2e')]=_[_0xead8('0x2f')](_0x598470['model'],_0x598470[_0xead8('0x2c')]);_0x329c83[_0xead8('0x30')]=_[_0xead8('0x2f')](_0x598470[_0xead8('0x2a')],qs[_0xead8('0x31')](_0x3fbcc2[_0xead8('0x2c')][_0xead8('0x31')]));_0x329c83[_0xead8('0x30')]=_0x329c83['attributes'][_0xead8('0x32')]?_0x329c83[_0xead8('0x30')]:_0x598470[_0xead8('0x2a')];_0x329c83['order']=qs[_0xead8('0x36')](_0x3fbcc2[_0xead8('0x2c')][_0xead8('0x36')]);_0x329c83[_0xead8('0x37')]=qs[_0xead8('0x2e')](_[_0xead8('0x38')](_0x3fbcc2['query'],_0x598470[_0xead8('0x2e')]));if(_0x3fbcc2[_0xead8('0x2c')][_0xead8('0x39')]){_0x329c83[_0xead8('0x37')]=_[_0xead8('0x3a')](_0x329c83[_0xead8('0x37')],{'$or':_[_0xead8('0x2b')](_0x329c83['attributes'],function(_0x598993){var _0x24af39={};_0x24af39[_0x598993]={'$like':'%'+_0x3fbcc2[_0xead8('0x2c')][_0xead8('0x39')]+'%'};return _0x24af39;})});}_0x329c83=_['merge']({},_0x329c83,_0x3fbcc2[_0xead8('0x3b')]);return _0x25103f[_0xead8('0x50')](_0x329c83);}})['then'](function(_0x1b80ee){if(_0x1b80ee){_0x4355b4=_0x1b80ee['length'];if(!_0x3fbcc2[_0xead8('0x2c')][_0xead8('0x33')](_0xead8('0x34'))){_0x329c83['limit']=qs[_0xead8('0x1b')](_0x3fbcc2[_0xead8('0x2c')]['limit']);_0x329c83[_0xead8('0x19')]=qs[_0xead8('0x19')](_0x3fbcc2[_0xead8('0x2c')][_0xead8('0x19')]);}return _0x25103f[_0xead8('0x50')](_0x329c83);}})['then'](function(_0x26cc6f){if(_0x26cc6f){return _0x26cc6f?{'count':_0x4355b4,'rows':_0x26cc6f}:null;}})[_0xead8('0x20')](respondWithResult(_0x179e10,null))[_0xead8('0x45')](handleError(_0x179e10,null));}; \ No newline at end of file +var _0x1b8b=['includeAll','include','findAll','show','keys','fields','merge','find','create','body','catch','update','params','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','then','destroy','sendStatus','error','stack','name','send','map','Automation','rawAttributes','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','options'];(function(_0x4b483f,_0xc38ca6){var _0x4c11d3=function(_0xce0061){while(--_0xce0061){_0x4b483f['push'](_0x4b483f['shift']());}};_0x4c11d3(++_0xc38ca6);}(_0x1b8b,0x1b0));var _0xb1b8=function(_0x2bfcb6,_0x4a2177){_0x2bfcb6=_0x2bfcb6-0x0;var _0x366baf=_0x1b8b[_0x2bfcb6];return _0x366baf;};'use strict';var emlformat=require(_0xb1b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1b8('0x1'));var jsonpatch=require(_0xb1b8('0x2'));var rp=require(_0xb1b8('0x3'));var moment=require(_0xb1b8('0x4'));var BPromise=require(_0xb1b8('0x5'));var Mustache=require(_0xb1b8('0x6'));var util=require(_0xb1b8('0x7'));var path=require(_0xb1b8('0x8'));var sox=require(_0xb1b8('0x9'));var csv=require(_0xb1b8('0xa'));var ejs=require(_0xb1b8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1b8('0xc'));var squel=require(_0xb1b8('0xd'));var crypto=require(_0xb1b8('0xe'));var jsforce=require(_0xb1b8('0xf'));var deskjs=require(_0xb1b8('0x10'));var toCsv=require(_0xb1b8('0xa'));var querystring=require('querystring');var Papa=require(_0xb1b8('0x11'));var Redis=require(_0xb1b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb1b8('0x13'));var as=require(_0xb1b8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb1b8('0x15'));var licenseUtil=require(_0xb1b8('0x16'));var db=require(_0xb1b8('0x17'))['db'];function respondWithStatusCode(_0x501315,_0x5b4f0c){_0x5b4f0c=_0x5b4f0c||0xcc;return function(_0x182f34){if(_0x182f34){return _0x501315['sendStatus'](_0x5b4f0c);}return _0x501315[_0xb1b8('0x18')](_0x5b4f0c)[_0xb1b8('0x19')]();};}function respondWithResult(_0x4dbd06,_0x590dd5){_0x590dd5=_0x590dd5||0xc8;return function(_0x87a6f5){if(_0x87a6f5){return _0x4dbd06['status'](_0x590dd5)['json'](_0x87a6f5);}};}function respondWithFilteredResult(_0x5da3d6,_0x1e2097){return function(_0xd7ea98){if(_0xd7ea98){var _0x38d3fd=typeof _0x1e2097[_0xb1b8('0x1a')]===_0xb1b8('0x1b')&&typeof _0x1e2097['limit']===_0xb1b8('0x1b');var _0x4d9ee2=_0xd7ea98[_0xb1b8('0x1c')];var _0x4ba314=_0x38d3fd?0x0:_0x1e2097[_0xb1b8('0x1a')];var _0x2d9de1=_0x38d3fd?_0xd7ea98['count']:_0x1e2097[_0xb1b8('0x1a')]+_0x1e2097[_0xb1b8('0x1d')];var _0x1b3c2e;if(_0x2d9de1>=_0x4d9ee2){_0x2d9de1=_0x4d9ee2;_0x1b3c2e=0xc8;}else{_0x1b3c2e=0xce;}_0x5da3d6['status'](_0x1b3c2e);return _0x5da3d6['set'](_0xb1b8('0x1e'),_0x4ba314+'-'+_0x2d9de1+'/'+_0x4d9ee2)[_0xb1b8('0x1f')](_0xd7ea98);}return null;};}function patchUpdates(_0x54eefa){return function(_0x48e802){try{jsonpatch[_0xb1b8('0x20')](_0x48e802,_0x54eefa,!![]);}catch(_0x47b968){return BPromise['reject'](_0x47b968);}return _0x48e802[_0xb1b8('0x21')]();};}function saveUpdates(_0x1a6e9f,_0x3aab41){return function(_0x2cb449){if(_0x2cb449){return _0x2cb449['update'](_0x1a6e9f)[_0xb1b8('0x22')](function(_0x420f44){return _0x420f44;});}return null;};}function removeEntity(_0x46d2af,_0x3033cd){return function(_0x2d0492){if(_0x2d0492){return _0x2d0492[_0xb1b8('0x23')]()[_0xb1b8('0x22')](function(){_0x46d2af[_0xb1b8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe90cd4,_0x427fc2){return function(_0x398323){if(!_0x398323){_0xe90cd4[_0xb1b8('0x24')](0x194);}return _0x398323;};}function handleError(_0x3de3ab,_0xdaf923){_0xdaf923=_0xdaf923||0x1f4;return function(_0xe65f33){logger[_0xb1b8('0x25')](_0xe65f33[_0xb1b8('0x26')]);if(_0xe65f33[_0xb1b8('0x27')]){delete _0xe65f33['name'];}_0x3de3ab['status'](_0xdaf923)[_0xb1b8('0x28')](_0xe65f33);};}exports['index']=function(_0x10148b,_0x41f6e7){var _0x1d4866={},_0x413751={},_0x5c5834={'count':0x0,'rows':[]};var _0x425f52=_[_0xb1b8('0x29')](db[_0xb1b8('0x2a')][_0xb1b8('0x2b')],function(_0x5eb140){return{'name':_0x5eb140['fieldName'],'type':_0x5eb140['type'][_0xb1b8('0x2c')]};});_0x413751[_0xb1b8('0x2d')]=_[_0xb1b8('0x29')](_0x425f52,'name');_0x413751[_0xb1b8('0x2e')]=_['keys'](_0x10148b[_0xb1b8('0x2e')]);_0x413751['filters']=_[_0xb1b8('0x2f')](_0x413751[_0xb1b8('0x2d')],_0x413751['query']);_0x1d4866[_0xb1b8('0x30')]=_['intersection'](_0x413751[_0xb1b8('0x2d')],qs['fields'](_0x10148b[_0xb1b8('0x2e')]['fields']));_0x1d4866[_0xb1b8('0x30')]=_0x1d4866[_0xb1b8('0x30')][_0xb1b8('0x31')]?_0x1d4866['attributes']:_0x413751[_0xb1b8('0x2d')];if(!_0x10148b[_0xb1b8('0x2e')][_0xb1b8('0x32')](_0xb1b8('0x33'))){_0x1d4866[_0xb1b8('0x1d')]=qs[_0xb1b8('0x1d')](_0x10148b['query']['limit']);_0x1d4866[_0xb1b8('0x1a')]=qs[_0xb1b8('0x1a')](_0x10148b['query']['offset']);}_0x1d4866[_0xb1b8('0x34')]=qs[_0xb1b8('0x35')](_0x10148b['query'][_0xb1b8('0x35')]);_0x1d4866[_0xb1b8('0x36')]=qs[_0xb1b8('0x37')](_[_0xb1b8('0x38')](_0x10148b[_0xb1b8('0x2e')],_0x413751[_0xb1b8('0x37')]),_0x425f52);if(_0x10148b[_0xb1b8('0x2e')][_0xb1b8('0x39')]){_0x1d4866[_0xb1b8('0x36')]=_['merge'](_0x1d4866[_0xb1b8('0x36')],{'$or':_[_0xb1b8('0x29')](_0x425f52,function(_0x4f6b7b){if(_0x4f6b7b[_0xb1b8('0x3a')]!=='VIRTUAL'){var _0x1d88c5={};_0x1d88c5[_0x4f6b7b[_0xb1b8('0x27')]]={'$like':'%'+_0x10148b[_0xb1b8('0x2e')]['filter']+'%'};return _0x1d88c5;}})});}_0x1d4866=_['merge']({},_0x1d4866,_0x10148b[_0xb1b8('0x3b')]);var _0x4b1ba3={'where':_0x1d4866[_0xb1b8('0x36')]};return db['Automation'][_0xb1b8('0x1c')](_0x4b1ba3)[_0xb1b8('0x22')](function(_0x1f9b56){_0x5c5834[_0xb1b8('0x1c')]=_0x1f9b56;if(_0x10148b[_0xb1b8('0x2e')][_0xb1b8('0x3c')]){_0x1d4866[_0xb1b8('0x3d')]=[{'all':!![]}];}return db[_0xb1b8('0x2a')][_0xb1b8('0x3e')](_0x1d4866);})[_0xb1b8('0x22')](function(_0x241fe2){_0x5c5834['rows']=_0x241fe2;return _0x5c5834;})[_0xb1b8('0x22')](respondWithFilteredResult(_0x41f6e7,_0x1d4866))['catch'](handleError(_0x41f6e7,null));};exports[_0xb1b8('0x3f')]=function(_0x18a682,_0x15918e){var _0x338c19={'raw':![],'where':{'id':_0x18a682['params']['id']}},_0x5c89f6={};_0x5c89f6[_0xb1b8('0x2d')]=_[_0xb1b8('0x40')](db['Automation'][_0xb1b8('0x2b')]);_0x5c89f6[_0xb1b8('0x2e')]=_[_0xb1b8('0x40')](_0x18a682[_0xb1b8('0x2e')]);_0x5c89f6[_0xb1b8('0x37')]=_[_0xb1b8('0x2f')](_0x5c89f6[_0xb1b8('0x2d')],_0x5c89f6[_0xb1b8('0x2e')]);_0x338c19[_0xb1b8('0x30')]=_[_0xb1b8('0x2f')](_0x5c89f6[_0xb1b8('0x2d')],qs[_0xb1b8('0x41')](_0x18a682[_0xb1b8('0x2e')][_0xb1b8('0x41')]));_0x338c19[_0xb1b8('0x30')]=_0x338c19[_0xb1b8('0x30')][_0xb1b8('0x31')]?_0x338c19[_0xb1b8('0x30')]:_0x5c89f6['model'];if(_0x18a682[_0xb1b8('0x2e')][_0xb1b8('0x3c')]){_0x338c19[_0xb1b8('0x3d')]=[{'all':!![]}];}_0x338c19=_[_0xb1b8('0x42')]({},_0x338c19,_0x18a682[_0xb1b8('0x3b')]);return db[_0xb1b8('0x2a')][_0xb1b8('0x43')](_0x338c19)[_0xb1b8('0x22')](handleEntityNotFound(_0x15918e,null))['then'](respondWithResult(_0x15918e,null))['catch'](handleError(_0x15918e,null));};exports[_0xb1b8('0x44')]=function(_0x30416b,_0x3e4253){return db['Automation'][_0xb1b8('0x44')](_0x30416b[_0xb1b8('0x45')],{})[_0xb1b8('0x22')](respondWithResult(_0x3e4253,0xc9))[_0xb1b8('0x46')](handleError(_0x3e4253,null));};exports[_0xb1b8('0x47')]=function(_0x1b512f,_0x42aa94){if(_0x1b512f['body']['id']){delete _0x1b512f[_0xb1b8('0x45')]['id'];}return db[_0xb1b8('0x2a')][_0xb1b8('0x43')]({'where':{'id':_0x1b512f[_0xb1b8('0x48')]['id']}})[_0xb1b8('0x22')](handleEntityNotFound(_0x42aa94,null))[_0xb1b8('0x22')](saveUpdates(_0x1b512f['body'],null))[_0xb1b8('0x22')](respondWithResult(_0x42aa94,null))['catch'](handleError(_0x42aa94,null));};exports[_0xb1b8('0x23')]=function(_0x1a15c9,_0x236bc2){return db[_0xb1b8('0x2a')][_0xb1b8('0x43')]({'where':{'id':_0x1a15c9[_0xb1b8('0x48')]['id']}})['then'](handleEntityNotFound(_0x236bc2,null))[_0xb1b8('0x22')](removeEntity(_0x236bc2,null))[_0xb1b8('0x46')](handleError(_0x236bc2,null));};exports[_0xb1b8('0x49')]=function(_0x4df9f3,_0x3f9ddb,_0xa874c6){return db[_0xb1b8('0x4a')][_0xb1b8('0x43')]({'where':{'id':_0x4df9f3[_0xb1b8('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f9ddb,null))[_0xb1b8('0x22')](function(_0xbbc7ae){if(_0xbbc7ae){return _0xbbc7ae[_0xb1b8('0x49')](_0x4df9f3['body'][_0xb1b8('0x4b')],_[_0xb1b8('0x4c')](_0x4df9f3[_0xb1b8('0x45')],[_0xb1b8('0x4b'),'id'])||{});}})[_0xb1b8('0x22')](respondWithResult(_0x3f9ddb,null))[_0xb1b8('0x46')](handleError(_0x3f9ddb,null));};exports[_0xb1b8('0x4d')]=function(_0x1bda33,_0x418e99,_0x1e4e47){var _0x32ed9c={};var _0x47d9fc={};var _0x2e1672;var _0x547580;return db[_0xb1b8('0x2a')][_0xb1b8('0x4e')]({'where':{'id':_0x1bda33[_0xb1b8('0x48')]['id']}})[_0xb1b8('0x22')](handleEntityNotFound(_0x418e99,null))[_0xb1b8('0x22')](function(_0x52d420){if(_0x52d420){_0x2e1672=_0x52d420;_0x47d9fc['model']=_['keys'](db[_0xb1b8('0x4a')]['rawAttributes']);_0x47d9fc['query']=_[_0xb1b8('0x40')](_0x1bda33['query']);_0x47d9fc['filters']=_[_0xb1b8('0x2f')](_0x47d9fc[_0xb1b8('0x2d')],_0x47d9fc[_0xb1b8('0x2e')]);_0x32ed9c[_0xb1b8('0x30')]=_[_0xb1b8('0x2f')](_0x47d9fc[_0xb1b8('0x2d')],qs[_0xb1b8('0x41')](_0x1bda33[_0xb1b8('0x2e')][_0xb1b8('0x41')]));_0x32ed9c['attributes']=_0x32ed9c[_0xb1b8('0x30')]['length']?_0x32ed9c[_0xb1b8('0x30')]:_0x47d9fc[_0xb1b8('0x2d')];_0x32ed9c[_0xb1b8('0x34')]=qs[_0xb1b8('0x35')](_0x1bda33[_0xb1b8('0x2e')][_0xb1b8('0x35')]);_0x32ed9c[_0xb1b8('0x36')]=qs['filters'](_[_0xb1b8('0x38')](_0x1bda33[_0xb1b8('0x2e')],_0x47d9fc[_0xb1b8('0x37')]));if(_0x1bda33[_0xb1b8('0x2e')][_0xb1b8('0x39')]){_0x32ed9c[_0xb1b8('0x36')]=_[_0xb1b8('0x42')](_0x32ed9c['where'],{'$or':_[_0xb1b8('0x29')](_0x32ed9c[_0xb1b8('0x30')],function(_0x3a3101){var _0x3b9169={};_0x3b9169[_0x3a3101]={'$like':'%'+_0x1bda33['query'][_0xb1b8('0x39')]+'%'};return _0x3b9169;})});}_0x32ed9c=_[_0xb1b8('0x42')]({},_0x32ed9c,_0x1bda33[_0xb1b8('0x3b')]);return _0x2e1672[_0xb1b8('0x4d')](_0x32ed9c);}})[_0xb1b8('0x22')](function(_0x175b3a){if(_0x175b3a){_0x547580=_0x175b3a[_0xb1b8('0x31')];if(!_0x1bda33[_0xb1b8('0x2e')][_0xb1b8('0x32')](_0xb1b8('0x33'))){_0x32ed9c[_0xb1b8('0x1d')]=qs[_0xb1b8('0x1d')](_0x1bda33[_0xb1b8('0x2e')][_0xb1b8('0x1d')]);_0x32ed9c[_0xb1b8('0x1a')]=qs[_0xb1b8('0x1a')](_0x1bda33['query'][_0xb1b8('0x1a')]);}return _0x2e1672['getConditions'](_0x32ed9c);}})[_0xb1b8('0x22')](function(_0x2774a0){if(_0x2774a0){return _0x2774a0?{'count':_0x547580,'rows':_0x2774a0}:null;}})[_0xb1b8('0x22')](respondWithResult(_0x418e99,null))[_0xb1b8('0x46')](handleError(_0x418e99,null));};exports[_0xb1b8('0x4f')]=function(_0xdc9173,_0x118bcb,_0x5b043f){return db[_0xb1b8('0x50')][_0xb1b8('0x43')]({'where':{'id':_0xdc9173[_0xb1b8('0x48')]['id']}})[_0xb1b8('0x22')](handleEntityNotFound(_0x118bcb,null))[_0xb1b8('0x22')](function(_0x5d699b){if(_0x5d699b){return _0x5d699b[_0xb1b8('0x4f')](_0xdc9173[_0xb1b8('0x45')][_0xb1b8('0x4b')],_[_0xb1b8('0x4c')](_0xdc9173['body'],[_0xb1b8('0x4b'),'id'])||{});}})[_0xb1b8('0x22')](respondWithResult(_0x118bcb,null))[_0xb1b8('0x46')](handleError(_0x118bcb,null));};exports[_0xb1b8('0x51')]=function(_0x404e63,_0x50d669,_0x56648){var _0x302cd6={};var _0x3a11ab={};var _0xbbc328;var _0x5bfbbd;return db['Automation'][_0xb1b8('0x4e')]({'where':{'id':_0x404e63[_0xb1b8('0x48')]['id']}})[_0xb1b8('0x22')](handleEntityNotFound(_0x50d669,null))[_0xb1b8('0x22')](function(_0x5031c4){if(_0x5031c4){_0xbbc328=_0x5031c4;_0x3a11ab[_0xb1b8('0x2d')]=_['keys'](db['Action'][_0xb1b8('0x2b')]);_0x3a11ab[_0xb1b8('0x2e')]=_['keys'](_0x404e63[_0xb1b8('0x2e')]);_0x3a11ab[_0xb1b8('0x37')]=_[_0xb1b8('0x2f')](_0x3a11ab[_0xb1b8('0x2d')],_0x3a11ab['query']);_0x302cd6[_0xb1b8('0x30')]=_[_0xb1b8('0x2f')](_0x3a11ab[_0xb1b8('0x2d')],qs[_0xb1b8('0x41')](_0x404e63['query'][_0xb1b8('0x41')]));_0x302cd6['attributes']=_0x302cd6[_0xb1b8('0x30')][_0xb1b8('0x31')]?_0x302cd6[_0xb1b8('0x30')]:_0x3a11ab[_0xb1b8('0x2d')];_0x302cd6[_0xb1b8('0x34')]=qs['sort'](_0x404e63[_0xb1b8('0x2e')][_0xb1b8('0x35')]);_0x302cd6[_0xb1b8('0x36')]=qs[_0xb1b8('0x37')](_['pick'](_0x404e63['query'],_0x3a11ab[_0xb1b8('0x37')]));if(_0x404e63['query'][_0xb1b8('0x39')]){_0x302cd6['where']=_[_0xb1b8('0x42')](_0x302cd6['where'],{'$or':_[_0xb1b8('0x29')](_0x302cd6[_0xb1b8('0x30')],function(_0x48c868){var _0x5244c2={};_0x5244c2[_0x48c868]={'$like':'%'+_0x404e63['query'][_0xb1b8('0x39')]+'%'};return _0x5244c2;})});}_0x302cd6=_[_0xb1b8('0x42')]({},_0x302cd6,_0x404e63['options']);return _0xbbc328[_0xb1b8('0x51')](_0x302cd6);}})['then'](function(_0x2f8a49){if(_0x2f8a49){_0x5bfbbd=_0x2f8a49[_0xb1b8('0x31')];if(!_0x404e63[_0xb1b8('0x2e')][_0xb1b8('0x32')](_0xb1b8('0x33'))){_0x302cd6['limit']=qs[_0xb1b8('0x1d')](_0x404e63[_0xb1b8('0x2e')][_0xb1b8('0x1d')]);_0x302cd6[_0xb1b8('0x1a')]=qs['offset'](_0x404e63[_0xb1b8('0x2e')][_0xb1b8('0x1a')]);}return _0xbbc328['getActions'](_0x302cd6);}})[_0xb1b8('0x22')](function(_0x14bebd){if(_0x14bebd){return _0x14bebd?{'count':_0x5bfbbd,'rows':_0x14bebd}:null;}})[_0xb1b8('0x22')](respondWithResult(_0x50d669,null))[_0xb1b8('0x46')](handleError(_0x50d669,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index bc87f82..7009cc7 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 _0x20d0=['define','Automation','tools_automations','lodash','api','moment','request-promise','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x259106,_0x58d8af){var _0x3cbb63=function(_0x117afd){while(--_0x117afd){_0x259106['push'](_0x259106['shift']());}};_0x3cbb63(++_0x58d8af);}(_0x20d0,0x121));var _0x020d=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x20d0[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x020d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x020d('0x1'));var moment=require(_0x020d('0x2'));var BPromise=require('bluebird');var rp=require(_0x020d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x020d('0x4'));var config=require(_0x020d('0x5'));var attributes=require(_0x020d('0x6'));module[_0x020d('0x7')]=function(_0x5cf29f,_0x564282){return _0x5cf29f[_0x020d('0x8')](_0x020d('0x9'),attributes,{'tableName':_0x020d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe83d=['path','rimraf','../../config/environment','./automation.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x41c206,_0x27a056){var _0x5782bd=function(_0x4b5566){while(--_0x4b5566){_0x41c206['push'](_0x41c206['shift']());}};_0x5782bd(++_0x27a056);}(_0xe83d,0x131));var _0xde83=function(_0x5395cb,_0x525d01){_0x5395cb=_0x5395cb-0x0;var _0x492090=_0xe83d[_0x5395cb];return _0x492090;};'use strict';var _=require(_0xde83('0x0'));var util=require(_0xde83('0x1'));var logger=require(_0xde83('0x2'))(_0xde83('0x3'));var moment=require(_0xde83('0x4'));var BPromise=require(_0xde83('0x5'));var rp=require(_0xde83('0x6'));var fs=require('fs');var path=require(_0xde83('0x7'));var rimraf=require(_0xde83('0x8'));var config=require(_0xde83('0x9'));var attributes=require(_0xde83('0xa'));module[_0xde83('0xb')]=function(_0x558143,_0x371560){return _0x558143[_0xde83('0xc')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 72a92e1..3729a8f 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 _0xeaab=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0xeaab,0xd9));var _0xbeaa=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xeaab[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbeaa('0x0'));var util=require('util');var moment=require(_0xbeaa('0x1'));var BPromise=require(_0xbeaa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbeaa('0x3'))['db'];var utils=require(_0xbeaa('0x4'));var logger=require(_0xbeaa('0x5'))(_0xbeaa('0x6'));var config=require(_0xbeaa('0x7'));var jayson=require(_0xbeaa('0x8'));var client=jayson[_0xbeaa('0x9')][_0xbeaa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f015b,_0x42a779,_0x346043){return new BPromise(function(_0x2da505,_0x15a826){return client[_0xbeaa('0xb')](_0x2f015b,_0x346043)['then'](function(_0x389c0b){logger[_0xbeaa('0xc')](_0xbeaa('0xd'),_0x42a779,_0xbeaa('0xe'));logger[_0xbeaa('0xf')](_0xbeaa('0x10'),_0x42a779,_0xbeaa('0xe'),JSON['stringify'](_0x389c0b));if(_0x389c0b[_0xbeaa('0x11')]){if(_0x389c0b['error'][_0xbeaa('0x12')]===0x1f4){logger[_0xbeaa('0x11')]('Automation,\x20%s,\x20%s',_0x42a779,_0x389c0b[_0xbeaa('0x11')]['message']);return _0x15a826(_0x389c0b[_0xbeaa('0x11')][_0xbeaa('0x13')]);}logger['error'](_0xbeaa('0xd'),_0x42a779,_0x389c0b[_0xbeaa('0x11')][_0xbeaa('0x13')]);return _0x2da505(_0x389c0b[_0xbeaa('0x11')][_0xbeaa('0x13')]);}else{logger[_0xbeaa('0xc')](_0xbeaa('0xd'),_0x42a779,_0xbeaa('0xe'));_0x2da505(_0x389c0b[_0xbeaa('0x14')][_0xbeaa('0x13')]);}})[_0xbeaa('0x15')](function(_0x1cc387){logger[_0xbeaa('0x11')](_0xbeaa('0xd'),_0x42a779,_0x1cc387);_0x15a826(_0x1cc387);});});} \ No newline at end of file +var _0xbcff=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x39914e,_0x1ec745){var _0x56350b=function(_0x4b390d){while(--_0x4b390d){_0x39914e['push'](_0x39914e['shift']());}};_0x56350b(++_0x1ec745);}(_0xbcff,0x12e));var _0xfbcf=function(_0x15bf92,_0x836f07){_0x15bf92=_0x15bf92-0x0;var _0x344858=_0xbcff[_0x15bf92];return _0x344858;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcf('0x3'));var fs=require('fs');var Redis=require(_0xfbcf('0x4'));var db=require(_0xfbcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbcf('0x6'))(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcf('0x9')][_0xfbcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b87de,_0x51ee67,_0x470fa8){return new BPromise(function(_0x520d5f,_0x1481ba){return client['request'](_0x4b87de,_0x470fa8)[_0xfbcf('0xb')](function(_0xc63f23){logger['info']('Automation,\x20%s,\x20%s',_0x51ee67,_0xfbcf('0xc'));logger[_0xfbcf('0xd')](_0xfbcf('0xe'),_0x51ee67,_0xfbcf('0xc'),JSON['stringify'](_0xc63f23));if(_0xc63f23[_0xfbcf('0xf')]){if(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x10')]===0x1f4){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x1481ba(_0xc63f23['error'][_0xfbcf('0x12')]);}logger['error'](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x520d5f(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);}else{logger[_0xfbcf('0x13')](_0xfbcf('0x11'),_0x51ee67,_0xfbcf('0xc'));_0x520d5f(_0xc63f23[_0xfbcf('0x14')]['message']);}})[_0xfbcf('0x15')](function(_0xdb7a6a){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xdb7a6a);_0x1481ba(_0xdb7a6a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index b30ddca..71905c4 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 _0x447b=['/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated'];(function(_0xf46e88,_0x292579){var _0x1fcad4=function(_0x13a4c9){while(--_0x13a4c9){_0xf46e88['push'](_0xf46e88['shift']());}};_0x1fcad4(++_0x292579);}(_0x447b,0xe4));var _0xb447=function(_0x477feb,_0x161167){_0x477feb=_0x477feb-0x0;var _0x38e319=_0x447b[_0x477feb];return _0x38e319;};'use strict';var multer=require(_0xb447('0x0'));var util=require(_0xb447('0x1'));var path=require('path');var timeout=require(_0xb447('0x2'));var express=require(_0xb447('0x3'));var router=express[_0xb447('0x4')]();var fs_extra=require(_0xb447('0x5'));var auth=require(_0xb447('0x6'));var interaction=require(_0xb447('0x7'));var config=require(_0xb447('0x8'));var controller=require(_0xb447('0x9'));router[_0xb447('0xa')]('/',auth[_0xb447('0xb')](),controller['index']);router['get'](_0xb447('0xc'),auth['isAuthenticated'](),controller[_0xb447('0xd')]);router[_0xb447('0xa')](_0xb447('0xe'),auth[_0xb447('0xb')](),controller[_0xb447('0xf')]);router['get'](_0xb447('0x10'),auth[_0xb447('0xb')](),controller[_0xb447('0x11')]);router[_0xb447('0x12')]('/',auth['isAuthenticated'](),controller[_0xb447('0x13')]);router[_0xb447('0x12')](_0xb447('0xe'),auth[_0xb447('0xb')](),controller[_0xb447('0x14')]);router[_0xb447('0x12')](_0xb447('0x10'),auth[_0xb447('0xb')](),controller[_0xb447('0x15')]);router['put']('/:id',auth[_0xb447('0xb')](),controller[_0xb447('0x16')]);router['delete'](_0xb447('0xc'),auth[_0xb447('0xb')](),controller[_0xb447('0x17')]);module['exports']=router; \ No newline at end of file +var _0x62c8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','path','Router','fs-extra'];(function(_0x5a8097,_0x5a0d3e){var _0x461491=function(_0x52d707){while(--_0x52d707){_0x5a8097['push'](_0x5a8097['shift']());}};_0x461491(++_0x5a0d3e);}(_0x62c8,0x1ad));var _0x862c=function(_0x5716f3,_0x1af2f3){_0x5716f3=_0x5716f3-0x0;var _0x14f6cf=_0x62c8[_0x5716f3];return _0x14f6cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x862c('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x862c('0x1')]();var fs_extra=require(_0x862c('0x2'));var auth=require(_0x862c('0x3'));var interaction=require(_0x862c('0x4'));var config=require(_0x862c('0x5'));var controller=require(_0x862c('0x6'));router['get']('/',auth[_0x862c('0x7')](),controller[_0x862c('0x8')]);router[_0x862c('0x9')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0xb')]);router[_0x862c('0x9')](_0x862c('0xc'),auth[_0x862c('0x7')](),controller[_0x862c('0xd')]);router[_0x862c('0x9')]('/:id/actions',auth[_0x862c('0x7')](),controller[_0x862c('0xe')]);router[_0x862c('0xf')]('/',auth[_0x862c('0x7')](),controller[_0x862c('0x10')]);router['post'](_0x862c('0xc'),auth[_0x862c('0x7')](),controller[_0x862c('0x11')]);router[_0x862c('0xf')](_0x862c('0x12'),auth[_0x862c('0x7')](),controller[_0x862c('0x13')]);router[_0x862c('0x14')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0x15')]);router[_0x862c('0x16')](_0x862c('0xa'),auth[_0x862c('0x7')](),controller[_0x862c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8981cdd..b7599ea 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 _0x52bb=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x34ba31,_0x147b03){var _0x438f12=function(_0x206017){while(--_0x206017){_0x34ba31['push'](_0x34ba31['shift']());}};_0x438f12(++_0x147b03);}(_0x52bb,0xd4));var _0xb52b=function(_0xc5852d,_0x4df9e2){_0xc5852d=_0xc5852d-0x0;var _0xd7ba8=_0x52bb[_0xc5852d];return _0xd7ba8;};'use strict';var Sequelize=require(_0xb52b('0x0'));module[_0xb52b('0x1')]={'name':{'type':Sequelize[_0xb52b('0x2')],'unique':_0xb52b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb52b('0x4')](_0xb52b('0x5')),'allowNull':![],'defaultValue':_0xb52b('0x5')},'description':{'type':Sequelize[_0xb52b('0x2')]},'active':{'type':Sequelize[_0xb52b('0x6')],'defaultValue':0x0,'comment':_0xb52b('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xb52b('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xb52b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb52b('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xb52b('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb52b('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb52b('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xb52b('0x9')](0x3)[_0xb52b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb52b('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb52b('0x9')](0x3)[_0xb52b('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb52b('0x9')](0x5)[_0xb52b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb52b('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb52b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb52b('0x2')],'defaultValue':_0xb52b('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xb52b('0x4')](_0xb52b('0xe'),'never',_0xb52b('0xf')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb52b('0x9')](0x9)[_0xb52b('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb52b('0x10')},'dialAMDGreeting':{'type':Sequelize[_0xb52b('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb52b('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb52b('0x9')](0x9)[_0xb52b('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb52b('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb52b('0x9')](0x9)[_0xb52b('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb52b('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xb52b('0x9')](0x9)[_0xb52b('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb52b('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb52b('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb52b('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb52b('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb52b('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb52b('0x9')](0x5)[_0xb52b('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb52b('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb52b('0x4')]('DESC','ASC'),'defaultValue':_0xb52b('0x18')},'dialPrefix':{'type':Sequelize[_0xb52b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xb52b('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb52b('0x19')},'dialCutDigit':{'type':Sequelize[_0xb52b('0x9')](0x3)[_0xb52b('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb52b('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb52b('0x9')](0x3)[_0xb52b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb52b('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb52b('0x9')](0x5)[_0xb52b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb52b('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0xb52b('0x9')](0x3)[_0xb52b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb52b('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xb52b('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb52b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb52b('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb52b('0x9')](0x5)[_0xb52b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb52b('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0xb52b('0x9')](0x3)[_0xb52b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb52b('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb52b('0x9')](0x5)[_0xb52b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb52b('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb52b('0x9')](0x3)[_0xb52b('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb52b('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb52b('0x9')](0x5)[_0xb52b('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x0f8d=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen'];(function(_0x367995,_0x129ae2){var _0x22daa8=function(_0x4a2ceb){while(--_0x4a2ceb){_0x367995['push'](_0x367995['shift']());}};_0x22daa8(++_0x129ae2);}(_0x0f8d,0x185));var _0xd0f8=function(_0x32d537,_0x580e46){_0x32d537=_0x32d537-0x0;var _0x2ec857=_0x0f8d[_0x32d537];return _0x2ec857;};'use strict';var Sequelize=require(_0xd0f8('0x0'));module[_0xd0f8('0x1')]={'name':{'type':Sequelize[_0xd0f8('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd0f8('0x3')](_0xd0f8('0x4')),'allowNull':![],'defaultValue':_0xd0f8('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xd0f8('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xd0f8('0x6')](0x4)[_0xd0f8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd0f8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd0f8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd0f8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0f8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd0f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd0f8('0x6')](0x5)[_0xd0f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xd0f8('0x6')](0x3)[_0xd0f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0f8('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd0f8('0x6')](0x5)[_0xd0f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0f8('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd0f8('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd0f8('0x6')](0x5)[_0xd0f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0f8('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd0f8('0x6')](0x3)[_0xd0f8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd0f8('0xe')},'dialTimezone':{'type':Sequelize[_0xd0f8('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd0f8('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xd0f8('0x3')](_0xd0f8('0xf'),_0xd0f8('0x10'),_0xd0f8('0x11')),'defaultValue':_0xd0f8('0xf')},'dialAMDActive':{'type':Sequelize[_0xd0f8('0x5')],'defaultValue':0x0,'comment':_0xd0f8('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xd0f8('0x6')](0x9)[_0xd0f8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd0f8('0x6')](0x9)[_0xd0f8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd0f8('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd0f8('0x6')](0x9)[_0xd0f8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd0f8('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xd0f8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd0f8('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xd0f8('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd0f8('0x6')](0x9)[_0xd0f8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd0f8('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd0f8('0x6')](0x9)[_0xd0f8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd0f8('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd0f8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd0f8('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd0f8('0x6')](0x9)[_0xd0f8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd0f8('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd0f8('0x3')](_0xd0f8('0x1a'),_0xd0f8('0x1b')),'defaultValue':_0xd0f8('0x1a')},'dialPrefix':{'type':Sequelize[_0xd0f8('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd0f8('0x6')](0x3)[_0xd0f8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd0f8('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd0f8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd0f8('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd0f8('0x6')](0x3)[_0xd0f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd0f8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0f8('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xd0f8('0x6')](0x3)[_0xd0f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0f8('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xd0f8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0f8('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd0f8('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0f8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0f8('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd0f8('0x6')](0x3)[_0xd0f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd0f8('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd0f8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd0f8('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd0f8('0x6')](0x3)[_0xd0f8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd0f8('0x6')](0x5)[_0xd0f8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index def378b..b0f7798 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 _0x5a52=['error','catch','clone','params','length','include','omit','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','findOne','CmHopperHistory','nolimit','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','map','Campaign','fieldName','type','model','query','keys','intersection','attributes','fields','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x5a52,0x148));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25a5('0x0'));var rimraf=require(_0x25a5('0x1'));var zipdir=require(_0x25a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25a5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x25a5('0x4'));var util=require(_0x25a5('0x5'));var path=require(_0x25a5('0x6'));var sox=require(_0x25a5('0x7'));var csv=require(_0x25a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25a5('0x9'));var _=require('lodash');var squel=require(_0x25a5('0xa'));var crypto=require(_0x25a5('0xb'));var jsforce=require(_0x25a5('0xc'));var deskjs=require(_0x25a5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x25a5('0xe'));var Papa=require(_0x25a5('0xf'));var Redis=require(_0x25a5('0x10'));var authService=require(_0x25a5('0x11'));var qs=require(_0x25a5('0x12'));var as=require(_0x25a5('0x13'));var hardwareService=require(_0x25a5('0x14'));var logger=require(_0x25a5('0x15'))('api');var utils=require(_0x25a5('0x16'));var config=require(_0x25a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d4fda,_0x473d74){_0x473d74=_0x473d74||0xcc;return function(_0x5e61c4){if(_0x5e61c4){return _0x5d4fda[_0x25a5('0x18')](_0x473d74);}return _0x5d4fda[_0x25a5('0x19')](_0x473d74)['end']();};}function respondWithResult(_0x2319af,_0x4a9e56){_0x4a9e56=_0x4a9e56||0xc8;return function(_0x4aeaea){if(_0x4aeaea){return _0x2319af[_0x25a5('0x19')](_0x4a9e56)[_0x25a5('0x1a')](_0x4aeaea);}};}function respondWithFilteredResult(_0x36885e,_0x3cc65b){return function(_0x5570ca){if(_0x5570ca){var _0x38ceed=typeof _0x3cc65b['offset']==='undefined'&&typeof _0x3cc65b[_0x25a5('0x1b')]===_0x25a5('0x1c');var _0x1650ea=_0x5570ca[_0x25a5('0x1d')];var _0x4094fd=_0x38ceed?0x0:_0x3cc65b[_0x25a5('0x1e')];var _0x4d7b1b=_0x38ceed?_0x5570ca[_0x25a5('0x1d')]:_0x3cc65b['offset']+_0x3cc65b[_0x25a5('0x1b')];var _0x104507;if(_0x4d7b1b>=_0x1650ea){_0x4d7b1b=_0x1650ea;_0x104507=0xc8;}else{_0x104507=0xce;}_0x36885e[_0x25a5('0x19')](_0x104507);return _0x36885e['set'](_0x25a5('0x1f'),_0x4094fd+'-'+_0x4d7b1b+'/'+_0x1650ea)[_0x25a5('0x1a')](_0x5570ca);}return null;};}function patchUpdates(_0x91aaf2){return function(_0x439309){try{jsonpatch[_0x25a5('0x20')](_0x439309,_0x91aaf2,!![]);}catch(_0x370000){return BPromise[_0x25a5('0x21')](_0x370000);}return _0x439309[_0x25a5('0x22')]();};}function saveUpdates(_0x470ff3,_0x58244c){return function(_0x1adbb1){if(_0x1adbb1){return _0x1adbb1[_0x25a5('0x23')](_0x470ff3)[_0x25a5('0x24')](function(_0x44e313){return _0x44e313;});}return null;};}function removeEntity(_0x2bc26f,_0x3d1603){return function(_0x56a770){if(_0x56a770){return _0x56a770[_0x25a5('0x25')]()[_0x25a5('0x24')](function(){var _0x25da13=_0x56a770[_0x25a5('0x26')]({'plain':!![]});var _0x527a38=_0x25a5('0x27');return db[_0x25a5('0x28')][_0x25a5('0x25')]({'where':{'type':_0x527a38,'resourceId':_0x25da13['id']}})['then'](function(){return _0x56a770;});})[_0x25a5('0x24')](function(){_0x2bc26f[_0x25a5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38effa,_0x16be6b){return function(_0x26172b){if(!_0x26172b){_0x38effa[_0x25a5('0x18')](0x194);}return _0x26172b;};}function handleError(_0x2f72d6,_0x10490a){_0x10490a=_0x10490a||0x1f4;return function(_0x241f36){logger['error'](_0x241f36[_0x25a5('0x29')]);if(_0x241f36[_0x25a5('0x2a')]){delete _0x241f36[_0x25a5('0x2a')];}_0x2f72d6[_0x25a5('0x19')](_0x10490a)[_0x25a5('0x2b')](_0x241f36);};}exports['index']=function(_0xe0e643,_0x3db098){var _0x58bab3={},_0x226aed={},_0x5d35c4={'count':0x0,'rows':[]};var _0x2249e9=_[_0x25a5('0x2c')](db[_0x25a5('0x2d')]['rawAttributes'],function(_0x591b83){return{'name':_0x591b83[_0x25a5('0x2e')],'type':_0x591b83[_0x25a5('0x2f')]['key']};});_0x226aed[_0x25a5('0x30')]=_[_0x25a5('0x2c')](_0x2249e9,'name');_0x226aed[_0x25a5('0x31')]=_[_0x25a5('0x32')](_0xe0e643[_0x25a5('0x31')]);_0x226aed['filters']=_[_0x25a5('0x33')](_0x226aed['model'],_0x226aed[_0x25a5('0x31')]);_0x58bab3[_0x25a5('0x34')]=_[_0x25a5('0x33')](_0x226aed[_0x25a5('0x30')],qs[_0x25a5('0x35')](_0xe0e643['query'][_0x25a5('0x35')]));_0x58bab3[_0x25a5('0x34')]=_0x58bab3[_0x25a5('0x34')]['length']?_0x58bab3[_0x25a5('0x34')]:_0x226aed[_0x25a5('0x30')];if(!_0xe0e643[_0x25a5('0x31')]['hasOwnProperty']('nolimit')){_0x58bab3['limit']=qs[_0x25a5('0x1b')](_0xe0e643[_0x25a5('0x31')][_0x25a5('0x1b')]);_0x58bab3[_0x25a5('0x1e')]=qs[_0x25a5('0x1e')](_0xe0e643[_0x25a5('0x31')][_0x25a5('0x1e')]);}_0x58bab3[_0x25a5('0x36')]=qs[_0x25a5('0x37')](_0xe0e643[_0x25a5('0x31')][_0x25a5('0x37')]);_0x58bab3[_0x25a5('0x38')]=qs['filters'](_[_0x25a5('0x39')](_0xe0e643[_0x25a5('0x31')],_0x226aed[_0x25a5('0x3a')]),_0x2249e9);if(_0xe0e643[_0x25a5('0x31')][_0x25a5('0x3b')]){_0x58bab3[_0x25a5('0x38')]=_['merge'](_0x58bab3[_0x25a5('0x38')],{'$or':_[_0x25a5('0x2c')](_0x2249e9,function(_0x26427f){if(_0x26427f[_0x25a5('0x2f')]!==_0x25a5('0x3c')){var _0x55290c={};_0x55290c[_0x26427f['name']]={'$like':'%'+_0xe0e643['query'][_0x25a5('0x3b')]+'%'};return _0x55290c;}})});}_0x58bab3=_[_0x25a5('0x3d')]({},_0x58bab3,_0xe0e643[_0x25a5('0x3e')]);var _0x80f90e={'where':_0x58bab3[_0x25a5('0x38')]};return db['Campaign'][_0x25a5('0x1d')](_0x80f90e)[_0x25a5('0x24')](function(_0x594467){_0x5d35c4['count']=_0x594467;if(_0xe0e643['query'][_0x25a5('0x3f')]){_0x58bab3['include']=[{'all':!![]}];}return db['Campaign'][_0x25a5('0x40')](_0x58bab3);})['then'](function(_0x25a4f8){_0x5d35c4[_0x25a5('0x41')]=_0x25a4f8;return _0x5d35c4;})[_0x25a5('0x24')](respondWithFilteredResult(_0x3db098,_0x58bab3))['catch'](handleError(_0x3db098,null));};exports[_0x25a5('0x42')]=function(_0x23d3e7,_0x3a676c){var _0x1dacfb={'raw':![],'where':{'id':_0x23d3e7['params']['id']}},_0x4ec825={};_0x4ec825['model']=_[_0x25a5('0x32')](db[_0x25a5('0x2d')][_0x25a5('0x43')]);_0x4ec825['query']=_[_0x25a5('0x32')](_0x23d3e7[_0x25a5('0x31')]);_0x4ec825[_0x25a5('0x3a')]=_[_0x25a5('0x33')](_0x4ec825[_0x25a5('0x30')],_0x4ec825['query']);_0x1dacfb[_0x25a5('0x34')]=_[_0x25a5('0x33')](_0x4ec825[_0x25a5('0x30')],qs['fields'](_0x23d3e7[_0x25a5('0x31')][_0x25a5('0x35')]));_0x1dacfb[_0x25a5('0x34')]=_0x1dacfb[_0x25a5('0x34')]['length']?_0x1dacfb[_0x25a5('0x34')]:_0x4ec825[_0x25a5('0x30')];if(_0x23d3e7[_0x25a5('0x31')][_0x25a5('0x3f')]){_0x1dacfb['include']=[{'all':!![]}];}_0x1dacfb=_['merge']({},_0x1dacfb,_0x23d3e7[_0x25a5('0x3e')]);return db[_0x25a5('0x2d')]['find'](_0x1dacfb)['then'](handleEntityNotFound(_0x3a676c,null))['then'](respondWithResult(_0x3a676c,null))['catch'](handleError(_0x3a676c,null));};exports[_0x25a5('0x44')]=function(_0x1f0d36,_0x3e3920){return db[_0x25a5('0x2d')][_0x25a5('0x44')](_0x1f0d36[_0x25a5('0x45')],{})[_0x25a5('0x24')](function(_0x1fe8db){var _0x259906=_0x1f0d36[_0x25a5('0x46')][_0x25a5('0x26')]({'plain':!![]});if(!_0x259906)throw new Error(_0x25a5('0x47'));if(_0x259906[_0x25a5('0x48')]===_0x25a5('0x46')){var _0x3735d3=_0x1fe8db[_0x25a5('0x26')]({'plain':!![]});var _0x1fd0c1=_0x25a5('0x27');return db[_0x25a5('0x49')][_0x25a5('0x4a')]({'where':{'name':_0x1fd0c1,'userProfileId':_0x259906[_0x25a5('0x4b')]},'raw':!![]})['then'](function(_0x351df0){if(_0x351df0&&_0x351df0[_0x25a5('0x4c')]===0x0){return db[_0x25a5('0x28')]['create']({'name':_0x3735d3['name'],'resourceId':_0x3735d3['id'],'type':_0x351df0[_0x25a5('0x2a')],'sectionId':_0x351df0['id']},{})[_0x25a5('0x24')](function(){return _0x1fe8db;});}else{return _0x1fe8db;}})['catch'](function(_0x50bb4b){logger[_0x25a5('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50bb4b);throw _0x50bb4b;});}return _0x1fe8db;})[_0x25a5('0x24')](respondWithResult(_0x3e3920,0xc9))[_0x25a5('0x4e')](handleError(_0x3e3920,null));};exports[_0x25a5('0x4f')]=function(_0x1857da,_0x2aaf73){var _0x4dd5ac={'where':{'id':_0x1857da[_0x25a5('0x50')]['id']}},_0x15c8ad={};_0x15c8ad[_0x25a5('0x30')]=_[_0x25a5('0x32')](db[_0x25a5('0x2d')][_0x25a5('0x43')]);_0x4dd5ac[_0x25a5('0x34')]=_[_0x25a5('0x33')](_0x15c8ad[_0x25a5('0x30')],qs[_0x25a5('0x35')](_0x1857da['query'][_0x25a5('0x35')]));_0x4dd5ac[_0x25a5('0x34')]=_0x4dd5ac[_0x25a5('0x34')][_0x25a5('0x51')]?_0x4dd5ac['attributes']:_0x15c8ad[_0x25a5('0x30')];if(_0x1857da['query'][_0x25a5('0x3f')]){_0x4dd5ac[_0x25a5('0x52')]=[{'all':!![]}];}_0x4dd5ac=_[_0x25a5('0x3d')]({},_0x4dd5ac,_0x1857da[_0x25a5('0x3e')]);return db[_0x25a5('0x2d')][_0x25a5('0x4a')](_0x4dd5ac)[_0x25a5('0x24')](handleEntityNotFound(_0x2aaf73,null))[_0x25a5('0x24')](function(_0xd0d31a){if(_0xd0d31a){var _0x20053a=_0xd0d31a['get']({'plain':!![]});_0x20053a=qs[_0x25a5('0x53')](_0x20053a,['id','createdAt',_0x25a5('0x54')]);_0x1857da[_0x25a5('0x45')]=_[_0x25a5('0x53')](_0x1857da['body'],['id','createdAt',_0x25a5('0x54')]);return db[_0x25a5('0x2d')]['create'](_[_0x25a5('0x3d')](_0x20053a,_0x1857da[_0x25a5('0x45')]),{'include':_0x1857da['query'][_0x25a5('0x3f')]?[{'all':!![]}]:undefined})[_0x25a5('0x24')](function(_0x84aefa){var _0x13621b=_0x1857da[_0x25a5('0x46')][_0x25a5('0x26')]({'plain':!![]});if(!_0x13621b)throw new Error(_0x25a5('0x47'));if(_0x13621b[_0x25a5('0x48')]===_0x25a5('0x46')){var _0x2bd6db=_0x84aefa['get']({'plain':!![]});var _0x2df1bc=_0x25a5('0x27');return db[_0x25a5('0x49')]['find']({'where':{'name':_0x2df1bc,'userProfileId':_0x13621b['userProfileId']},'raw':!![]})[_0x25a5('0x24')](function(_0x36019c){if(_0x36019c&&_0x36019c[_0x25a5('0x4c')]===0x0){return db[_0x25a5('0x28')][_0x25a5('0x44')]({'name':_0x2bd6db[_0x25a5('0x2a')],'resourceId':_0x2bd6db['id'],'type':_0x36019c[_0x25a5('0x2a')],'sectionId':_0x36019c['id']},{})[_0x25a5('0x24')](function(){return _0x84aefa;});}else{return _0x84aefa;}})[_0x25a5('0x4e')](function(_0x3499bb){logger['error'](_0x25a5('0x55'),_0x3499bb);throw _0x3499bb;});}return _0x84aefa;});}})[_0x25a5('0x24')](respondWithResult(_0x2aaf73,0xc9))[_0x25a5('0x4e')](handleError(_0x2aaf73,null));};exports[_0x25a5('0x23')]=function(_0x4a1b48,_0x382b21){if(_0x4a1b48[_0x25a5('0x45')]['id']){delete _0x4a1b48[_0x25a5('0x45')]['id'];}return db[_0x25a5('0x2d')][_0x25a5('0x4a')]({'where':{'id':_0x4a1b48['params']['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x382b21,null))[_0x25a5('0x24')](saveUpdates(_0x4a1b48['body'],null))[_0x25a5('0x24')](respondWithResult(_0x382b21,null))[_0x25a5('0x4e')](handleError(_0x382b21,null));};exports['destroy']=function(_0x259566,_0x421262){return db[_0x25a5('0x2d')][_0x25a5('0x4a')]({'where':{'id':_0x259566['params']['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x421262,null))[_0x25a5('0x24')](removeEntity(_0x421262,null))[_0x25a5('0x4e')](handleError(_0x421262,null));};exports[_0x25a5('0x56')]=function(_0x462f7f,_0x1c599d,_0x11a18d){var _0x144d59={'raw':!![],'where':{}};var _0x36f4da={};var _0x789742={'count':0x0,'rows':[]};return db[_0x25a5('0x2d')]['findOne']({'where':{'id':_0x462f7f['params']['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x1c599d,null))[_0x25a5('0x24')](function(_0x320567){if(_0x320567){_0x36f4da['model']=_[_0x25a5('0x32')](db[_0x25a5('0x57')][_0x25a5('0x43')]);_0x36f4da[_0x25a5('0x31')]=_[_0x25a5('0x32')](_0x462f7f['query']);_0x36f4da[_0x25a5('0x3a')]=_[_0x25a5('0x33')](_0x36f4da[_0x25a5('0x30')],_0x36f4da[_0x25a5('0x31')]);_0x144d59[_0x25a5('0x34')]=_[_0x25a5('0x33')](_0x36f4da['model'],qs[_0x25a5('0x35')](_0x462f7f[_0x25a5('0x31')]['fields']));_0x144d59[_0x25a5('0x34')]=_0x144d59[_0x25a5('0x34')][_0x25a5('0x51')]?_0x144d59[_0x25a5('0x34')]:_0x36f4da[_0x25a5('0x30')];if(!_0x462f7f['query'][_0x25a5('0x58')]('nolimit')){_0x144d59[_0x25a5('0x1b')]=qs['limit'](_0x462f7f['query'][_0x25a5('0x1b')]);_0x144d59[_0x25a5('0x1e')]=qs[_0x25a5('0x1e')](_0x462f7f[_0x25a5('0x31')][_0x25a5('0x1e')]);}_0x144d59['order']=qs[_0x25a5('0x37')](_0x462f7f['query']['sort']);_0x144d59[_0x25a5('0x38')]=qs['filters'](_[_0x25a5('0x39')](_0x462f7f['query'],_0x36f4da[_0x25a5('0x3a')]));_0x144d59['where'][_0x25a5('0x59')]=_0x320567['id'];if(_0x462f7f[_0x25a5('0x31')][_0x25a5('0x3b')]){_0x144d59[_0x25a5('0x38')]=_[_0x25a5('0x3d')](_0x144d59['where'],{'$or':_['map'](_0x144d59['attributes'],function(_0x14df8f){var _0x47495b={};_0x47495b[_0x14df8f]={'$like':'%'+_0x462f7f[_0x25a5('0x31')][_0x25a5('0x3b')]+'%'};return _0x47495b;})});}_0x144d59=_[_0x25a5('0x3d')]({},_0x144d59,_0x462f7f[_0x25a5('0x3e')]);return db[_0x25a5('0x57')][_0x25a5('0x1d')]({'where':_0x144d59[_0x25a5('0x38')]})[_0x25a5('0x24')](function(_0x127308){_0x789742['count']=_0x127308;if(_0x462f7f['query'][_0x25a5('0x3f')]){_0x144d59['include']=[{'all':!![]}];}return db[_0x25a5('0x57')][_0x25a5('0x40')](_0x144d59);})['then'](function(_0x12a93b){_0x789742[_0x25a5('0x41')]=_0x12a93b;return _0x789742;});}})[_0x25a5('0x24')](respondWithFilteredResult(_0x1c599d,_0x144d59))[_0x25a5('0x4e')](handleError(_0x1c599d,null));};exports[_0x25a5('0x5a')]=function(_0x44748c,_0x197e54,_0x2b92e4){var _0x27387a={'raw':!![],'where':{}};var _0x4e7fbe={};var _0x5ba403={'count':0x0,'rows':[]};return db['Campaign'][_0x25a5('0x5b')]({'where':{'id':_0x44748c[_0x25a5('0x50')]['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x197e54,null))[_0x25a5('0x24')](function(_0x4e2e2a){if(_0x4e2e2a){_0x4e7fbe[_0x25a5('0x30')]=_['keys'](db[_0x25a5('0x5c')][_0x25a5('0x43')]);_0x4e7fbe['query']=_[_0x25a5('0x32')](_0x44748c[_0x25a5('0x31')]);_0x4e7fbe['filters']=_[_0x25a5('0x33')](_0x4e7fbe[_0x25a5('0x30')],_0x4e7fbe[_0x25a5('0x31')]);_0x27387a['attributes']=_[_0x25a5('0x33')](_0x4e7fbe[_0x25a5('0x30')],qs[_0x25a5('0x35')](_0x44748c[_0x25a5('0x31')]['fields']));_0x27387a['attributes']=_0x27387a[_0x25a5('0x34')]['length']?_0x27387a[_0x25a5('0x34')]:_0x4e7fbe[_0x25a5('0x30')];if(!_0x44748c[_0x25a5('0x31')][_0x25a5('0x58')](_0x25a5('0x5d'))){_0x27387a[_0x25a5('0x1b')]=qs[_0x25a5('0x1b')](_0x44748c[_0x25a5('0x31')][_0x25a5('0x1b')]);_0x27387a[_0x25a5('0x1e')]=qs[_0x25a5('0x1e')](_0x44748c[_0x25a5('0x31')]['offset']);}_0x27387a[_0x25a5('0x36')]=qs[_0x25a5('0x37')](_0x44748c['query'][_0x25a5('0x37')]);_0x27387a[_0x25a5('0x38')]=qs[_0x25a5('0x3a')](_[_0x25a5('0x39')](_0x44748c[_0x25a5('0x31')],_0x4e7fbe['filters']));_0x27387a[_0x25a5('0x38')][_0x25a5('0x59')]=_0x4e2e2a['id'];if(_0x44748c[_0x25a5('0x31')][_0x25a5('0x3b')]){_0x27387a[_0x25a5('0x38')]=_[_0x25a5('0x3d')](_0x27387a[_0x25a5('0x38')],{'$or':_[_0x25a5('0x2c')](_0x27387a[_0x25a5('0x34')],function(_0x227025){var _0x5dc67c={};_0x5dc67c[_0x227025]={'$like':'%'+_0x44748c[_0x25a5('0x31')]['filter']+'%'};return _0x5dc67c;})});}_0x27387a=_['merge']({},_0x27387a,_0x44748c['options']);return db[_0x25a5('0x5c')][_0x25a5('0x1d')]({'where':_0x27387a[_0x25a5('0x38')]})['then'](function(_0x5eda2c){_0x5ba403[_0x25a5('0x1d')]=_0x5eda2c;if(_0x44748c[_0x25a5('0x31')][_0x25a5('0x3f')]){_0x27387a['include']=[{'all':!![]}];}return db[_0x25a5('0x5c')][_0x25a5('0x40')](_0x27387a);})[_0x25a5('0x24')](function(_0x27c281){_0x5ba403[_0x25a5('0x41')]=_0x27c281;return _0x5ba403;});}})[_0x25a5('0x24')](respondWithFilteredResult(_0x197e54,_0x27387a))[_0x25a5('0x4e')](handleError(_0x197e54,null));};exports['getHopperFinals']=function(_0x2d4328,_0xef6131,_0x6deac0){var _0x515326={'raw':!![],'where':{}};var _0x3c8ee0={};var _0x2324c6={'count':0x0,'rows':[]};return db[_0x25a5('0x2d')][_0x25a5('0x5b')]({'where':{'id':_0x2d4328[_0x25a5('0x50')]['id']}})['then'](handleEntityNotFound(_0xef6131,null))[_0x25a5('0x24')](function(_0xe34ce2){if(_0xe34ce2){_0x3c8ee0[_0x25a5('0x30')]=_[_0x25a5('0x32')](db[_0x25a5('0x5e')]['rawAttributes']);_0x3c8ee0['query']=_[_0x25a5('0x32')](_0x2d4328['query']);_0x3c8ee0[_0x25a5('0x3a')]=_[_0x25a5('0x33')](_0x3c8ee0[_0x25a5('0x30')],_0x3c8ee0['query']);_0x515326[_0x25a5('0x34')]=_[_0x25a5('0x33')](_0x3c8ee0[_0x25a5('0x30')],qs[_0x25a5('0x35')](_0x2d4328[_0x25a5('0x31')][_0x25a5('0x35')]));_0x515326[_0x25a5('0x34')]=_0x515326[_0x25a5('0x34')][_0x25a5('0x51')]?_0x515326[_0x25a5('0x34')]:_0x3c8ee0['model'];if(!_0x2d4328[_0x25a5('0x31')][_0x25a5('0x58')](_0x25a5('0x5d'))){_0x515326[_0x25a5('0x1b')]=qs[_0x25a5('0x1b')](_0x2d4328[_0x25a5('0x31')][_0x25a5('0x1b')]);_0x515326[_0x25a5('0x1e')]=qs[_0x25a5('0x1e')](_0x2d4328['query'][_0x25a5('0x1e')]);}_0x515326[_0x25a5('0x36')]=qs[_0x25a5('0x37')](_0x2d4328['query'][_0x25a5('0x37')]);_0x515326[_0x25a5('0x38')]=qs[_0x25a5('0x3a')](_['pick'](_0x2d4328[_0x25a5('0x31')],_0x3c8ee0[_0x25a5('0x3a')]));_0x515326['where'][_0x25a5('0x59')]=_0xe34ce2['id'];if(_0x2d4328[_0x25a5('0x31')][_0x25a5('0x3b')]){_0x515326[_0x25a5('0x38')]=_[_0x25a5('0x3d')](_0x515326[_0x25a5('0x38')],{'$or':_[_0x25a5('0x2c')](_0x515326[_0x25a5('0x34')],function(_0x545054){var _0x329311={};_0x329311[_0x545054]={'$like':'%'+_0x2d4328['query'][_0x25a5('0x3b')]+'%'};return _0x329311;})});}_0x515326=_[_0x25a5('0x3d')]({},_0x515326,_0x2d4328[_0x25a5('0x3e')]);return db[_0x25a5('0x5e')][_0x25a5('0x1d')]({'where':_0x515326[_0x25a5('0x38')]})['then'](function(_0x36489c){_0x2324c6[_0x25a5('0x1d')]=_0x36489c;if(_0x2d4328['query'][_0x25a5('0x3f')]){_0x515326['include']=[{'all':!![]}];}return db[_0x25a5('0x5e')]['findAll'](_0x515326);})[_0x25a5('0x24')](function(_0x130c3d){_0x2324c6[_0x25a5('0x41')]=_0x130c3d;return _0x2324c6;});}})[_0x25a5('0x24')](respondWithFilteredResult(_0xef6131,_0x515326))['catch'](handleError(_0xef6131,null));};exports['getHopperBlacks']=function(_0x5c2237,_0x2ba3f1,_0x9c288c){var _0x1bdf66={'raw':!![],'where':{}};var _0x3e522b={};var _0xd3d9f7={'count':0x0,'rows':[]};return db[_0x25a5('0x2d')][_0x25a5('0x5b')]({'where':{'id':_0x5c2237[_0x25a5('0x50')]['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x2ba3f1,null))['then'](function(_0x40715c){if(_0x40715c){_0x3e522b[_0x25a5('0x30')]=_['keys'](db[_0x25a5('0x5f')][_0x25a5('0x43')]);_0x3e522b[_0x25a5('0x31')]=_['keys'](_0x5c2237[_0x25a5('0x31')]);_0x3e522b[_0x25a5('0x3a')]=_[_0x25a5('0x33')](_0x3e522b[_0x25a5('0x30')],_0x3e522b[_0x25a5('0x31')]);_0x1bdf66['attributes']=_[_0x25a5('0x33')](_0x3e522b[_0x25a5('0x30')],qs[_0x25a5('0x35')](_0x5c2237[_0x25a5('0x31')][_0x25a5('0x35')]));_0x1bdf66[_0x25a5('0x34')]=_0x1bdf66['attributes'][_0x25a5('0x51')]?_0x1bdf66['attributes']:_0x3e522b[_0x25a5('0x30')];if(!_0x5c2237[_0x25a5('0x31')][_0x25a5('0x58')](_0x25a5('0x5d'))){_0x1bdf66[_0x25a5('0x1b')]=qs[_0x25a5('0x1b')](_0x5c2237['query'][_0x25a5('0x1b')]);_0x1bdf66[_0x25a5('0x1e')]=qs[_0x25a5('0x1e')](_0x5c2237[_0x25a5('0x31')][_0x25a5('0x1e')]);}_0x1bdf66[_0x25a5('0x36')]=qs[_0x25a5('0x37')](_0x5c2237[_0x25a5('0x31')]['sort']);_0x1bdf66['where']=qs['filters'](_[_0x25a5('0x39')](_0x5c2237[_0x25a5('0x31')],_0x3e522b[_0x25a5('0x3a')]));_0x1bdf66[_0x25a5('0x38')][_0x25a5('0x59')]=_0x40715c['id'];if(_0x5c2237[_0x25a5('0x31')][_0x25a5('0x3b')]){_0x1bdf66[_0x25a5('0x38')]=_[_0x25a5('0x3d')](_0x1bdf66['where'],{'$or':_[_0x25a5('0x2c')](_0x1bdf66[_0x25a5('0x34')],function(_0x51bb9d){var _0x411139={};_0x411139[_0x51bb9d]={'$like':'%'+_0x5c2237['query']['filter']+'%'};return _0x411139;})});}_0x1bdf66=_[_0x25a5('0x3d')]({},_0x1bdf66,_0x5c2237[_0x25a5('0x3e')]);return db[_0x25a5('0x5f')]['count']({'where':_0x1bdf66['where']})[_0x25a5('0x24')](function(_0x53fe9b){_0xd3d9f7[_0x25a5('0x1d')]=_0x53fe9b;if(_0x5c2237[_0x25a5('0x31')][_0x25a5('0x3f')]){_0x1bdf66['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x25a5('0x40')](_0x1bdf66);})[_0x25a5('0x24')](function(_0x38ec0c){_0xd3d9f7[_0x25a5('0x41')]=_0x38ec0c;return _0xd3d9f7;});}})[_0x25a5('0x24')](respondWithFilteredResult(_0x2ba3f1,_0x1bdf66))[_0x25a5('0x4e')](handleError(_0x2ba3f1,null));};exports[_0x25a5('0x60')]=function(_0x504379,_0x47ee2b,_0x5b8f90){var _0x5c946a={};var _0x31bb01={};var _0x2f1b5c;var _0x3133b1;return db[_0x25a5('0x2d')][_0x25a5('0x5b')]({'where':{'id':_0x504379['params']['id']}})['then'](handleEntityNotFound(_0x47ee2b,null))[_0x25a5('0x24')](function(_0xc61dd){if(_0xc61dd){_0x2f1b5c=_0xc61dd;_0x31bb01[_0x25a5('0x30')]=_[_0x25a5('0x32')](db[_0x25a5('0x61')][_0x25a5('0x43')]);_0x31bb01[_0x25a5('0x31')]=_['keys'](_0x504379[_0x25a5('0x31')]);_0x31bb01[_0x25a5('0x3a')]=_[_0x25a5('0x33')](_0x31bb01[_0x25a5('0x30')],_0x31bb01[_0x25a5('0x31')]);_0x5c946a[_0x25a5('0x34')]=_['intersection'](_0x31bb01['model'],qs[_0x25a5('0x35')](_0x504379[_0x25a5('0x31')][_0x25a5('0x35')]));_0x5c946a[_0x25a5('0x34')]=_0x5c946a[_0x25a5('0x34')]['length']?_0x5c946a[_0x25a5('0x34')]:_0x31bb01[_0x25a5('0x30')];_0x5c946a['order']=qs[_0x25a5('0x37')](_0x504379[_0x25a5('0x31')][_0x25a5('0x37')]);_0x5c946a[_0x25a5('0x38')]=qs[_0x25a5('0x3a')](_[_0x25a5('0x39')](_0x504379[_0x25a5('0x31')],_0x31bb01[_0x25a5('0x3a')]));if(_0x504379[_0x25a5('0x31')][_0x25a5('0x3b')]){_0x5c946a[_0x25a5('0x38')]=_[_0x25a5('0x3d')](_0x5c946a[_0x25a5('0x38')],{'$or':_['map'](_0x5c946a[_0x25a5('0x34')],function(_0x505eaa){var _0x2d484f={};_0x2d484f[_0x505eaa]={'$like':'%'+_0x504379[_0x25a5('0x31')][_0x25a5('0x3b')]+'%'};return _0x2d484f;})});}_0x5c946a=_[_0x25a5('0x3d')]({},_0x5c946a,_0x504379[_0x25a5('0x3e')]);return _0x2f1b5c['getLists'](_0x5c946a);}})[_0x25a5('0x24')](function(_0x79dfed){if(_0x79dfed){_0x3133b1=_0x79dfed[_0x25a5('0x51')];if(!_0x504379['query'][_0x25a5('0x58')](_0x25a5('0x5d'))){_0x5c946a[_0x25a5('0x1b')]=qs[_0x25a5('0x1b')](_0x504379[_0x25a5('0x31')][_0x25a5('0x1b')]);_0x5c946a[_0x25a5('0x1e')]=qs[_0x25a5('0x1e')](_0x504379[_0x25a5('0x31')][_0x25a5('0x1e')]);}return _0x2f1b5c[_0x25a5('0x60')](_0x5c946a);}})[_0x25a5('0x24')](function(_0xf94b9d){if(_0xf94b9d){return _0xf94b9d?{'count':_0x3133b1,'rows':_0xf94b9d}:null;}})[_0x25a5('0x24')](respondWithResult(_0x47ee2b,null))[_0x25a5('0x4e')](handleError(_0x47ee2b,null));};exports[_0x25a5('0x62')]=function(_0x5e56d9,_0x1948e7,_0x88bc7b){var _0x10edab,_0x341b26;return db[_0x25a5('0x2d')]['find']({'where':{'id':_0x5e56d9[_0x25a5('0x50')]['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x1948e7,null))[_0x25a5('0x24')](function(_0x2bd971){if(_0x2bd971){_0x341b26=_0x2bd971;return _0x2bd971['addLists'](_0x5e56d9[_0x25a5('0x45')][_0x25a5('0x63')],_[_0x25a5('0x53')](_0x5e56d9[_0x25a5('0x45')],[_0x25a5('0x63'),'id'])||{});}return null;})[_0x25a5('0x64')](function(_0x414744){var _0xead5f1;_0x10edab=_0x414744||[];var _0x19d0bb=[];if(_0x414744){for(var _0x433353=0x0;_0x433353<_0x414744[_0x25a5('0x51')];_0x433353+=0x1){var _0x5688eb=_0x414744[_0x433353][_0x25a5('0x26')]({'plain':!![]});_0x341b26[_0x25a5('0x65')]=_0x5e56d9[_0x25a5('0x45')][_0x25a5('0x65')]?_0x5e56d9[_0x25a5('0x45')][_0x25a5('0x65')]:_0x341b26[_0x25a5('0x65')];switch(_0x341b26['dialCheckDuplicateType']){case _0x25a5('0x66'):_0xead5f1=squel[_0x25a5('0x67')]()[_0x25a5('0x68')](_0x25a5('0x69'))[_0x25a5('0x6a')]([_0x25a5('0x6b'),_0x25a5('0x6c'),_0x25a5('0x6d'),_0x25a5('0x6e'),_0x25a5('0x59'),_0x25a5('0x6f'),_0x25a5('0x54')],squel[_0x25a5('0x70')]()['field'](_0x25a5('0x6b'),_0x25a5('0x6b'))[_0x25a5('0x71')]('NOW()',_0x25a5('0x6c'))[_0x25a5('0x71')]('id',_0x25a5('0x6d'))[_0x25a5('0x71')](_0x5688eb[_0x25a5('0x72')][_0x25a5('0x73')](),_0x25a5('0x6e'))['field'](_0x5e56d9[_0x25a5('0x50')]['id'][_0x25a5('0x73')](),_0x25a5('0x59'))[_0x25a5('0x71')](_0x25a5('0x74'),'createdAt')[_0x25a5('0x71')](_0x25a5('0x74'),_0x25a5('0x54'))[_0x25a5('0x75')](_0x25a5('0x76'))[_0x25a5('0x38')](_0x25a5('0x77'))[_0x25a5('0x38')](_0x25a5('0x78'),_0x5688eb['CmListId'][_0x25a5('0x73')]())['where'](_0x25a5('0x79'))['where'](_0x25a5('0x7a'),squel[_0x25a5('0x70')]()['field'](_0x25a5('0x7b'))[_0x25a5('0x75')](_0x25a5('0x7c'))[_0x25a5('0x38')]('CampaignId\x20=\x20?',_0x5e56d9[_0x25a5('0x50')]['id'][_0x25a5('0x73')]()))[_0x25a5('0x38')](_0x25a5('0x7a'),squel[_0x25a5('0x70')]()[_0x25a5('0x71')](_0x25a5('0x7d'))['from'](_0x25a5('0x69'))[_0x25a5('0x38')](_0x25a5('0x7e'),_0x5e56d9[_0x25a5('0x50')]['id'][_0x25a5('0x73')]())))[_0x25a5('0x73')]();break;case'onlyIfOpen':_0xead5f1=squel[_0x25a5('0x67')]()[_0x25a5('0x68')](_0x25a5('0x69'))[_0x25a5('0x6a')]([_0x25a5('0x6b'),_0x25a5('0x6c'),'ContactId',_0x25a5('0x6e'),_0x25a5('0x59'),'createdAt','updatedAt'],squel[_0x25a5('0x70')]()[_0x25a5('0x71')](_0x25a5('0x6b'),_0x25a5('0x6b'))[_0x25a5('0x71')](_0x25a5('0x74'),'scheduledAt')[_0x25a5('0x71')]('id',_0x25a5('0x6d'))[_0x25a5('0x71')](_0x5688eb[_0x25a5('0x72')][_0x25a5('0x73')](),_0x25a5('0x6e'))[_0x25a5('0x71')](_0x5e56d9[_0x25a5('0x50')]['id']['toString'](),_0x25a5('0x59'))[_0x25a5('0x71')]('NOW()',_0x25a5('0x6f'))['field'](_0x25a5('0x74'),_0x25a5('0x54'))[_0x25a5('0x75')](_0x25a5('0x76'))[_0x25a5('0x38')](_0x25a5('0x77'))[_0x25a5('0x38')]('ListId\x20=\x20?',_0x5688eb[_0x25a5('0x72')][_0x25a5('0x73')]())[_0x25a5('0x38')](_0x25a5('0x79'))[_0x25a5('0x38')](_0x25a5('0x7a'),squel[_0x25a5('0x70')]()['field'](_0x25a5('0x7d'))[_0x25a5('0x75')](_0x25a5('0x69'))[_0x25a5('0x38')](_0x25a5('0x7e'),_0x5e56d9[_0x25a5('0x50')]['id']['toString']())))[_0x25a5('0x73')]();break;default:_0xead5f1=squel['insert']()[_0x25a5('0x68')]('cm_hopper')[_0x25a5('0x6a')]([_0x25a5('0x6b'),_0x25a5('0x6c'),'ContactId',_0x25a5('0x6e'),_0x25a5('0x59'),_0x25a5('0x6f'),_0x25a5('0x54')],squel[_0x25a5('0x70')]()[_0x25a5('0x71')](_0x25a5('0x6b'),_0x25a5('0x6b'))['field']('NOW()',_0x25a5('0x6c'))[_0x25a5('0x71')]('id','ContactId')[_0x25a5('0x71')](_0x5688eb[_0x25a5('0x72')][_0x25a5('0x73')](),_0x25a5('0x6e'))['field'](_0x5e56d9['params']['id'][_0x25a5('0x73')](),_0x25a5('0x59'))[_0x25a5('0x71')]('NOW()',_0x25a5('0x6f'))['field']('NOW()',_0x25a5('0x54'))[_0x25a5('0x75')](_0x25a5('0x76'))[_0x25a5('0x38')](_0x25a5('0x77'))[_0x25a5('0x38')](_0x25a5('0x78'),_0x5688eb['CmListId']['toString']())[_0x25a5('0x38')](_0x25a5('0x79')))[_0x25a5('0x73')]();}_0x19d0bb[_0x25a5('0x7f')](db[_0x25a5('0x80')][_0x25a5('0x31')](_0xead5f1));}return BPromise['all'](_0x19d0bb);}})[_0x25a5('0x24')](function(){return _0x10edab;})[_0x25a5('0x24')](respondWithResult(_0x1948e7,null))[_0x25a5('0x4e')](handleError(_0x1948e7,null));};exports['removeLists']=function(_0x3a5d47,_0x43fb41,_0x546c5a){return db[_0x25a5('0x2d')][_0x25a5('0x4a')]({'where':{'id':_0x3a5d47['params']['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x43fb41,null))[_0x25a5('0x24')](function(_0x181eb1){if(_0x181eb1){return _0x181eb1[_0x25a5('0x81')](_0x3a5d47[_0x25a5('0x31')][_0x25a5('0x63')]);}})['then'](function(_0x198a8c){if(_0x198a8c){return db['CmHopper'][_0x25a5('0x25')]({'where':{'ListId':_0x3a5d47[_0x25a5('0x31')][_0x25a5('0x63')],'CampaignId':_0x3a5d47[_0x25a5('0x50')]['id']}})[_0x25a5('0x24')](function(){return _0x198a8c;});}})['then'](respondWithStatusCode(_0x43fb41,null))[_0x25a5('0x4e')](handleError(_0x43fb41,null));};exports[_0x25a5('0x82')]=function(_0x264485,_0x44d61a,_0x3a8836){var _0x48c86a={};var _0x5ac10a={};var _0x5656ef;var _0x219f0d;return db[_0x25a5('0x2d')]['findOne']({'where':{'id':_0x264485[_0x25a5('0x50')]['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x44d61a,null))[_0x25a5('0x24')](function(_0x522d4d){if(_0x522d4d){_0x5656ef=_0x522d4d;_0x5ac10a[_0x25a5('0x30')]=_['keys'](db[_0x25a5('0x61')][_0x25a5('0x43')]);_0x5ac10a[_0x25a5('0x31')]=_[_0x25a5('0x32')](_0x264485['query']);_0x5ac10a['filters']=_[_0x25a5('0x33')](_0x5ac10a[_0x25a5('0x30')],_0x5ac10a[_0x25a5('0x31')]);_0x48c86a['attributes']=_[_0x25a5('0x33')](_0x5ac10a['model'],qs[_0x25a5('0x35')](_0x264485[_0x25a5('0x31')]['fields']));_0x48c86a[_0x25a5('0x34')]=_0x48c86a[_0x25a5('0x34')][_0x25a5('0x51')]?_0x48c86a['attributes']:_0x5ac10a['model'];_0x48c86a[_0x25a5('0x36')]=qs[_0x25a5('0x37')](_0x264485[_0x25a5('0x31')][_0x25a5('0x37')]);_0x48c86a['where']=qs['filters'](_[_0x25a5('0x39')](_0x264485[_0x25a5('0x31')],_0x5ac10a[_0x25a5('0x3a')]));if(_0x264485[_0x25a5('0x31')][_0x25a5('0x3b')]){_0x48c86a[_0x25a5('0x38')]=_[_0x25a5('0x3d')](_0x48c86a[_0x25a5('0x38')],{'$or':_['map'](_0x48c86a[_0x25a5('0x34')],function(_0xd245ad){var _0x3ed07b={};_0x3ed07b[_0xd245ad]={'$like':'%'+_0x264485[_0x25a5('0x31')]['filter']+'%'};return _0x3ed07b;})});}_0x48c86a=_[_0x25a5('0x3d')]({},_0x48c86a,_0x264485['options']);return _0x5656ef[_0x25a5('0x82')](_0x48c86a);}})[_0x25a5('0x24')](function(_0x1f6256){if(_0x1f6256){_0x219f0d=_0x1f6256['length'];if(!_0x264485[_0x25a5('0x31')][_0x25a5('0x58')]('nolimit')){_0x48c86a['limit']=qs[_0x25a5('0x1b')](_0x264485['query'][_0x25a5('0x1b')]);_0x48c86a[_0x25a5('0x1e')]=qs[_0x25a5('0x1e')](_0x264485[_0x25a5('0x31')]['offset']);}return _0x5656ef[_0x25a5('0x82')](_0x48c86a);}})[_0x25a5('0x24')](function(_0x544893){if(_0x544893){return _0x544893?{'count':_0x219f0d,'rows':_0x544893}:null;}})[_0x25a5('0x24')](respondWithResult(_0x44d61a,null))[_0x25a5('0x4e')](handleError(_0x44d61a,null));};exports[_0x25a5('0x83')]=function(_0x32b719,_0x33f55f,_0x148c2d){var _0x45ba0e,_0x16a806;return db[_0x25a5('0x2d')]['find']({'where':{'id':_0x32b719['params']['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x33f55f,null))[_0x25a5('0x24')](function(_0x417d81){if(_0x417d81){_0x16a806=_0x417d81;return _0x417d81[_0x25a5('0x83')](_0x32b719[_0x25a5('0x45')][_0x25a5('0x63')],_['omit'](_0x32b719[_0x25a5('0x45')],['ids','id'])||{});}return null;})['spread'](function(_0x2453ed){var _0xfa24ab;_0x45ba0e=_0x2453ed||[];var _0x397daa=[];if(_0x2453ed){for(var _0x4ddd55=0x0;_0x4ddd55<_0x2453ed[_0x25a5('0x51')];_0x4ddd55+=0x1){var _0x88af44=_0x2453ed[_0x4ddd55][_0x25a5('0x26')]({'plain':!![]});_0xfa24ab=squel[_0x25a5('0x67')]()[_0x25a5('0x68')](_0x25a5('0x84'))[_0x25a5('0x6a')]([_0x25a5('0x6b'),_0x25a5('0x6d'),_0x25a5('0x6e'),_0x25a5('0x59'),_0x25a5('0x6f'),'updatedAt'],squel['select']()['field'](_0x25a5('0x6b'),_0x25a5('0x6b'))['field']('id',_0x25a5('0x6d'))[_0x25a5('0x71')](_0x88af44[_0x25a5('0x72')][_0x25a5('0x73')](),_0x25a5('0x6e'))[_0x25a5('0x71')](_0x32b719[_0x25a5('0x50')]['id'][_0x25a5('0x73')](),'CampaignId')[_0x25a5('0x71')](_0x25a5('0x74'),'createdAt')[_0x25a5('0x71')](_0x25a5('0x74'),_0x25a5('0x54'))['from'](_0x25a5('0x76'))[_0x25a5('0x38')](_0x25a5('0x77'))[_0x25a5('0x38')]('ListId\x20=\x20?',_0x88af44[_0x25a5('0x72')][_0x25a5('0x73')]())[_0x25a5('0x38')](_0x25a5('0x79')))['toString']();_0x397daa[_0x25a5('0x7f')](db['sequelize'][_0x25a5('0x31')](_0xfa24ab));}return BPromise[_0x25a5('0x85')](_0x397daa);}})['then'](function(){return _0x45ba0e;})[_0x25a5('0x24')](respondWithResult(_0x33f55f,null))[_0x25a5('0x4e')](handleError(_0x33f55f,null));};exports[_0x25a5('0x86')]=function(_0x5557fb,_0x2d5118,_0xda0ee5){return db[_0x25a5('0x2d')][_0x25a5('0x4a')]({'where':{'id':_0x5557fb[_0x25a5('0x50')]['id']}})[_0x25a5('0x24')](handleEntityNotFound(_0x2d5118,null))[_0x25a5('0x24')](function(_0x1c1b41){if(_0x1c1b41){return _0x1c1b41[_0x25a5('0x86')](_0x5557fb[_0x25a5('0x31')][_0x25a5('0x63')]);}})['then'](function(_0x50a88b){if(_0x50a88b){return db[_0x25a5('0x5f')][_0x25a5('0x25')]({'where':{'ListId':_0x5557fb[_0x25a5('0x31')][_0x25a5('0x63')],'CampaignId':_0x5557fb['params']['id']}})[_0x25a5('0x24')](function(){return _0x50a88b;});}})[_0x25a5('0x24')](respondWithStatusCode(_0x2d5118,null))['catch'](handleError(_0x2d5118,null));}; \ No newline at end of file +var _0xd787=['reject','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','rows','show','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','findOne','CampaignId','CmHopper','findAll','getHopperHistories','order','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','insert','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd787,0xec));var _0x7d78=function(_0x267484,_0x3eb131){_0x267484=_0x267484-0x0;var _0x14a356=_0xd787[_0x267484];return _0x14a356;};'use strict';var emlformat=require(_0x7d78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d78('0x1'));var jsonpatch=require(_0x7d78('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7d78('0x3'));var util=require(_0x7d78('0x4'));var path=require(_0x7d78('0x5'));var sox=require(_0x7d78('0x6'));var csv=require(_0x7d78('0x7'));var ejs=require(_0x7d78('0x8'));var fs=require('fs');var fs_extra=require(_0x7d78('0x9'));var _=require(_0x7d78('0xa'));var squel=require(_0x7d78('0xb'));var crypto=require(_0x7d78('0xc'));var jsforce=require(_0x7d78('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d78('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7d78('0xf'));var hardwareService=require(_0x7d78('0x10'));var logger=require(_0x7d78('0x11'))(_0x7d78('0x12'));var utils=require(_0x7d78('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7d78('0x14'));var db=require(_0x7d78('0x15'))['db'];function respondWithStatusCode(_0xa186da,_0x1009c0){_0x1009c0=_0x1009c0||0xcc;return function(_0x13b270){if(_0x13b270){return _0xa186da[_0x7d78('0x16')](_0x1009c0);}return _0xa186da[_0x7d78('0x17')](_0x1009c0)[_0x7d78('0x18')]();};}function respondWithResult(_0x354ba7,_0x3596f2){_0x3596f2=_0x3596f2||0xc8;return function(_0x462466){if(_0x462466){return _0x354ba7[_0x7d78('0x17')](_0x3596f2)[_0x7d78('0x19')](_0x462466);}};}function respondWithFilteredResult(_0x5e3ac6,_0x13afb1){return function(_0x43c7ed){if(_0x43c7ed){var _0x147b73=typeof _0x13afb1[_0x7d78('0x1a')]===_0x7d78('0x1b')&&typeof _0x13afb1[_0x7d78('0x1c')]==='undefined';var _0x3117c7=_0x43c7ed[_0x7d78('0x1d')];var _0x4c419e=_0x147b73?0x0:_0x13afb1[_0x7d78('0x1a')];var _0x24da9b=_0x147b73?_0x43c7ed[_0x7d78('0x1d')]:_0x13afb1[_0x7d78('0x1a')]+_0x13afb1[_0x7d78('0x1c')];var _0x2e8c82;if(_0x24da9b>=_0x3117c7){_0x24da9b=_0x3117c7;_0x2e8c82=0xc8;}else{_0x2e8c82=0xce;}_0x5e3ac6[_0x7d78('0x17')](_0x2e8c82);return _0x5e3ac6[_0x7d78('0x1e')](_0x7d78('0x1f'),_0x4c419e+'-'+_0x24da9b+'/'+_0x3117c7)[_0x7d78('0x19')](_0x43c7ed);}return null;};}function patchUpdates(_0x4ff8b1){return function(_0x11d635){try{jsonpatch['apply'](_0x11d635,_0x4ff8b1,!![]);}catch(_0x36aa2d){return BPromise[_0x7d78('0x20')](_0x36aa2d);}return _0x11d635[_0x7d78('0x21')]();};}function saveUpdates(_0x307bbc,_0x49f2ab){return function(_0x474286){if(_0x474286){return _0x474286[_0x7d78('0x22')](_0x307bbc)[_0x7d78('0x23')](function(_0x59e312){return _0x59e312;});}return null;};}function removeEntity(_0x3c75de,_0x44c4e0){return function(_0xde6c7){if(_0xde6c7){return _0xde6c7[_0x7d78('0x24')]()['then'](function(){var _0x5275ab=_0xde6c7[_0x7d78('0x25')]({'plain':!![]});var _0x1d6e53=_0x7d78('0x26');return db['UserProfileResource'][_0x7d78('0x24')]({'where':{'type':_0x1d6e53,'resourceId':_0x5275ab['id']}})[_0x7d78('0x23')](function(){return _0xde6c7;});})[_0x7d78('0x23')](function(){_0x3c75de[_0x7d78('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38a392,_0x3b48b3){return function(_0x1d6af9){if(!_0x1d6af9){_0x38a392['sendStatus'](0x194);}return _0x1d6af9;};}function handleError(_0x51e094,_0x17d9a5){_0x17d9a5=_0x17d9a5||0x1f4;return function(_0x53358e){logger[_0x7d78('0x27')](_0x53358e[_0x7d78('0x28')]);if(_0x53358e[_0x7d78('0x29')]){delete _0x53358e['name'];}_0x51e094['status'](_0x17d9a5)[_0x7d78('0x2a')](_0x53358e);};}exports[_0x7d78('0x2b')]=function(_0x4df646,_0x222df5){var _0x3b97d9={},_0x5d44d2={},_0x5ed0a3={'count':0x0,'rows':[]};var _0x1d53a5=_[_0x7d78('0x2c')](db[_0x7d78('0x2d')][_0x7d78('0x2e')],function(_0x6db97f){return{'name':_0x6db97f[_0x7d78('0x2f')],'type':_0x6db97f[_0x7d78('0x30')]['key']};});_0x5d44d2['model']=_['map'](_0x1d53a5,_0x7d78('0x29'));_0x5d44d2[_0x7d78('0x31')]=_[_0x7d78('0x32')](_0x4df646[_0x7d78('0x31')]);_0x5d44d2[_0x7d78('0x33')]=_['intersection'](_0x5d44d2['model'],_0x5d44d2['query']);_0x3b97d9['attributes']=_[_0x7d78('0x34')](_0x5d44d2[_0x7d78('0x35')],qs[_0x7d78('0x36')](_0x4df646['query']['fields']));_0x3b97d9['attributes']=_0x3b97d9[_0x7d78('0x37')][_0x7d78('0x38')]?_0x3b97d9['attributes']:_0x5d44d2[_0x7d78('0x35')];if(!_0x4df646[_0x7d78('0x31')][_0x7d78('0x39')](_0x7d78('0x3a'))){_0x3b97d9[_0x7d78('0x1c')]=qs[_0x7d78('0x1c')](_0x4df646[_0x7d78('0x31')]['limit']);_0x3b97d9[_0x7d78('0x1a')]=qs[_0x7d78('0x1a')](_0x4df646[_0x7d78('0x31')]['offset']);}_0x3b97d9['order']=qs[_0x7d78('0x3b')](_0x4df646[_0x7d78('0x31')][_0x7d78('0x3b')]);_0x3b97d9[_0x7d78('0x3c')]=qs[_0x7d78('0x33')](_[_0x7d78('0x3d')](_0x4df646[_0x7d78('0x31')],_0x5d44d2[_0x7d78('0x33')]),_0x1d53a5);if(_0x4df646['query'][_0x7d78('0x3e')]){_0x3b97d9[_0x7d78('0x3c')]=_[_0x7d78('0x3f')](_0x3b97d9[_0x7d78('0x3c')],{'$or':_['map'](_0x1d53a5,function(_0x34e2cb){if(_0x34e2cb[_0x7d78('0x30')]!=='VIRTUAL'){var _0x14de2b={};_0x14de2b[_0x34e2cb[_0x7d78('0x29')]]={'$like':'%'+_0x4df646[_0x7d78('0x31')][_0x7d78('0x3e')]+'%'};return _0x14de2b;}})});}_0x3b97d9=_[_0x7d78('0x3f')]({},_0x3b97d9,_0x4df646[_0x7d78('0x40')]);var _0x4a4580={'where':_0x3b97d9['where']};return db[_0x7d78('0x2d')]['count'](_0x4a4580)[_0x7d78('0x23')](function(_0x51ad64){_0x5ed0a3[_0x7d78('0x1d')]=_0x51ad64;if(_0x4df646[_0x7d78('0x31')]['includeAll']){_0x3b97d9['include']=[{'all':!![]}];}return db[_0x7d78('0x2d')]['findAll'](_0x3b97d9);})[_0x7d78('0x23')](function(_0x3f15dd){_0x5ed0a3[_0x7d78('0x41')]=_0x3f15dd;return _0x5ed0a3;})[_0x7d78('0x23')](respondWithFilteredResult(_0x222df5,_0x3b97d9))['catch'](handleError(_0x222df5,null));};exports[_0x7d78('0x42')]=function(_0x39c121,_0x5934cd){var _0x4012a7={'raw':![],'where':{'id':_0x39c121['params']['id']}},_0x491b49={};_0x491b49[_0x7d78('0x35')]=_[_0x7d78('0x32')](db[_0x7d78('0x2d')][_0x7d78('0x2e')]);_0x491b49['query']=_[_0x7d78('0x32')](_0x39c121['query']);_0x491b49[_0x7d78('0x33')]=_['intersection'](_0x491b49[_0x7d78('0x35')],_0x491b49[_0x7d78('0x31')]);_0x4012a7[_0x7d78('0x37')]=_['intersection'](_0x491b49['model'],qs[_0x7d78('0x36')](_0x39c121[_0x7d78('0x31')][_0x7d78('0x36')]));_0x4012a7[_0x7d78('0x37')]=_0x4012a7[_0x7d78('0x37')][_0x7d78('0x38')]?_0x4012a7['attributes']:_0x491b49[_0x7d78('0x35')];if(_0x39c121[_0x7d78('0x31')][_0x7d78('0x43')]){_0x4012a7[_0x7d78('0x44')]=[{'all':!![]}];}_0x4012a7=_[_0x7d78('0x3f')]({},_0x4012a7,_0x39c121[_0x7d78('0x40')]);return db['Campaign']['find'](_0x4012a7)[_0x7d78('0x23')](handleEntityNotFound(_0x5934cd,null))[_0x7d78('0x23')](respondWithResult(_0x5934cd,null))[_0x7d78('0x45')](handleError(_0x5934cd,null));};exports[_0x7d78('0x46')]=function(_0x28c6a4,_0x46837e){return db['Campaign'][_0x7d78('0x46')](_0x28c6a4[_0x7d78('0x47')],{})[_0x7d78('0x23')](function(_0x4812ba){var _0x23483d=_0x28c6a4[_0x7d78('0x48')][_0x7d78('0x25')]({'plain':!![]});if(!_0x23483d)throw new Error(_0x7d78('0x49'));if(_0x23483d['role']===_0x7d78('0x48')){var _0x1d6bae=_0x4812ba[_0x7d78('0x25')]({'plain':!![]});var _0x167cbd=_0x7d78('0x26');return db[_0x7d78('0x4a')][_0x7d78('0x4b')]({'where':{'name':_0x167cbd,'userProfileId':_0x23483d[_0x7d78('0x4c')]},'raw':!![]})[_0x7d78('0x23')](function(_0x4862c1){if(_0x4862c1&&_0x4862c1[_0x7d78('0x4d')]===0x0){return db[_0x7d78('0x4e')][_0x7d78('0x46')]({'name':_0x1d6bae[_0x7d78('0x29')],'resourceId':_0x1d6bae['id'],'type':_0x4862c1[_0x7d78('0x29')],'sectionId':_0x4862c1['id']},{})[_0x7d78('0x23')](function(){return _0x4812ba;});}else{return _0x4812ba;}})['catch'](function(_0xf0e26b){logger[_0x7d78('0x27')](_0x7d78('0x4f'),_0xf0e26b);throw _0xf0e26b;});}return _0x4812ba;})[_0x7d78('0x23')](respondWithResult(_0x46837e,0xc9))[_0x7d78('0x45')](handleError(_0x46837e,null));};exports[_0x7d78('0x50')]=function(_0xcf9825,_0x520b45){var _0x1a28a8={'where':{'id':_0xcf9825[_0x7d78('0x51')]['id']}},_0xa0c378={};_0xa0c378[_0x7d78('0x35')]=_[_0x7d78('0x32')](db[_0x7d78('0x2d')][_0x7d78('0x2e')]);_0x1a28a8[_0x7d78('0x37')]=_['intersection'](_0xa0c378['model'],qs[_0x7d78('0x36')](_0xcf9825[_0x7d78('0x31')][_0x7d78('0x36')]));_0x1a28a8['attributes']=_0x1a28a8['attributes'][_0x7d78('0x38')]?_0x1a28a8[_0x7d78('0x37')]:_0xa0c378[_0x7d78('0x35')];if(_0xcf9825[_0x7d78('0x31')][_0x7d78('0x43')]){_0x1a28a8['include']=[{'all':!![]}];}_0x1a28a8=_[_0x7d78('0x3f')]({},_0x1a28a8,_0xcf9825[_0x7d78('0x40')]);return db[_0x7d78('0x2d')][_0x7d78('0x4b')](_0x1a28a8)[_0x7d78('0x23')](handleEntityNotFound(_0x520b45,null))['then'](function(_0x429832){if(_0x429832){var _0x5249eb=_0x429832[_0x7d78('0x25')]({'plain':!![]});_0x5249eb=qs[_0x7d78('0x52')](_0x5249eb,['id',_0x7d78('0x53'),_0x7d78('0x54')]);_0xcf9825[_0x7d78('0x47')]=_['omit'](_0xcf9825[_0x7d78('0x47')],['id',_0x7d78('0x53'),_0x7d78('0x54')]);return db[_0x7d78('0x2d')]['create'](_[_0x7d78('0x3f')](_0x5249eb,_0xcf9825[_0x7d78('0x47')]),{'include':_0xcf9825[_0x7d78('0x31')][_0x7d78('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x1696eb){var _0x3bc8bc=_0xcf9825[_0x7d78('0x48')][_0x7d78('0x25')]({'plain':!![]});if(!_0x3bc8bc)throw new Error(_0x7d78('0x49'));if(_0x3bc8bc[_0x7d78('0x55')]===_0x7d78('0x48')){var _0x1a25df=_0x1696eb[_0x7d78('0x25')]({'plain':!![]});var _0x1e6e77=_0x7d78('0x26');return db['UserProfileSection'][_0x7d78('0x4b')]({'where':{'name':_0x1e6e77,'userProfileId':_0x3bc8bc['userProfileId']},'raw':!![]})[_0x7d78('0x23')](function(_0x5787c6){if(_0x5787c6&&_0x5787c6[_0x7d78('0x4d')]===0x0){return db[_0x7d78('0x4e')]['create']({'name':_0x1a25df[_0x7d78('0x29')],'resourceId':_0x1a25df['id'],'type':_0x5787c6[_0x7d78('0x29')],'sectionId':_0x5787c6['id']},{})[_0x7d78('0x23')](function(){return _0x1696eb;});}else{return _0x1696eb;}})[_0x7d78('0x45')](function(_0x5d55b1){logger['error'](_0x7d78('0x4f'),_0x5d55b1);throw _0x5d55b1;});}return _0x1696eb;});}})[_0x7d78('0x23')](respondWithResult(_0x520b45,0xc9))[_0x7d78('0x45')](handleError(_0x520b45,null));};exports[_0x7d78('0x22')]=function(_0xc9ce9f,_0x19732b){if(_0xc9ce9f[_0x7d78('0x47')]['id']){delete _0xc9ce9f[_0x7d78('0x47')]['id'];}return db[_0x7d78('0x2d')]['find']({'where':{'id':_0xc9ce9f[_0x7d78('0x51')]['id']}})['then'](handleEntityNotFound(_0x19732b,null))[_0x7d78('0x23')](saveUpdates(_0xc9ce9f[_0x7d78('0x47')],null))[_0x7d78('0x23')](respondWithResult(_0x19732b,null))['catch'](handleError(_0x19732b,null));};exports[_0x7d78('0x24')]=function(_0x3ea847,_0x43bc4d){return db[_0x7d78('0x2d')][_0x7d78('0x4b')]({'where':{'id':_0x3ea847[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x43bc4d,null))[_0x7d78('0x23')](removeEntity(_0x43bc4d,null))[_0x7d78('0x45')](handleError(_0x43bc4d,null));};exports['getHoppers']=function(_0x4d96fa,_0x135335,_0x18708b){var _0x4786d1={'raw':!![],'where':{}};var _0x25eb4c={};var _0x2c2080={'count':0x0,'rows':[]};return db[_0x7d78('0x2d')][_0x7d78('0x56')]({'where':{'id':_0x4d96fa[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x135335,null))['then'](function(_0x5f3b35){if(_0x5f3b35){_0x25eb4c[_0x7d78('0x35')]=_[_0x7d78('0x32')](db['CmHopper'][_0x7d78('0x2e')]);_0x25eb4c[_0x7d78('0x31')]=_[_0x7d78('0x32')](_0x4d96fa[_0x7d78('0x31')]);_0x25eb4c[_0x7d78('0x33')]=_[_0x7d78('0x34')](_0x25eb4c[_0x7d78('0x35')],_0x25eb4c[_0x7d78('0x31')]);_0x4786d1[_0x7d78('0x37')]=_[_0x7d78('0x34')](_0x25eb4c[_0x7d78('0x35')],qs['fields'](_0x4d96fa['query']['fields']));_0x4786d1['attributes']=_0x4786d1['attributes']['length']?_0x4786d1[_0x7d78('0x37')]:_0x25eb4c[_0x7d78('0x35')];if(!_0x4d96fa[_0x7d78('0x31')]['hasOwnProperty'](_0x7d78('0x3a'))){_0x4786d1[_0x7d78('0x1c')]=qs['limit'](_0x4d96fa[_0x7d78('0x31')][_0x7d78('0x1c')]);_0x4786d1[_0x7d78('0x1a')]=qs[_0x7d78('0x1a')](_0x4d96fa[_0x7d78('0x31')][_0x7d78('0x1a')]);}_0x4786d1['order']=qs[_0x7d78('0x3b')](_0x4d96fa[_0x7d78('0x31')]['sort']);_0x4786d1[_0x7d78('0x3c')]=qs[_0x7d78('0x33')](_['pick'](_0x4d96fa[_0x7d78('0x31')],_0x25eb4c['filters']));_0x4786d1[_0x7d78('0x3c')][_0x7d78('0x57')]=_0x5f3b35['id'];if(_0x4d96fa[_0x7d78('0x31')][_0x7d78('0x3e')]){_0x4786d1[_0x7d78('0x3c')]=_[_0x7d78('0x3f')](_0x4786d1[_0x7d78('0x3c')],{'$or':_['map'](_0x4786d1['attributes'],function(_0x1e9f7f){var _0x4e4a8d={};_0x4e4a8d[_0x1e9f7f]={'$like':'%'+_0x4d96fa[_0x7d78('0x31')][_0x7d78('0x3e')]+'%'};return _0x4e4a8d;})});}_0x4786d1=_['merge']({},_0x4786d1,_0x4d96fa[_0x7d78('0x40')]);return db['CmHopper']['count']({'where':_0x4786d1[_0x7d78('0x3c')]})[_0x7d78('0x23')](function(_0x1df978){_0x2c2080[_0x7d78('0x1d')]=_0x1df978;if(_0x4d96fa[_0x7d78('0x31')][_0x7d78('0x43')]){_0x4786d1[_0x7d78('0x44')]=[{'all':!![]}];}return db[_0x7d78('0x58')][_0x7d78('0x59')](_0x4786d1);})[_0x7d78('0x23')](function(_0x246bbe){_0x2c2080[_0x7d78('0x41')]=_0x246bbe;return _0x2c2080;});}})[_0x7d78('0x23')](respondWithFilteredResult(_0x135335,_0x4786d1))[_0x7d78('0x45')](handleError(_0x135335,null));};exports[_0x7d78('0x5a')]=function(_0x2ea034,_0x4237a8,_0x1e4169){var _0x25d634={'raw':!![],'where':{}};var _0x27ef1f={};var _0x1ff2e6={'count':0x0,'rows':[]};return db[_0x7d78('0x2d')][_0x7d78('0x56')]({'where':{'id':_0x2ea034[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x4237a8,null))['then'](function(_0x1c0741){if(_0x1c0741){_0x27ef1f[_0x7d78('0x35')]=_['keys'](db['CmHopperHistory'][_0x7d78('0x2e')]);_0x27ef1f[_0x7d78('0x31')]=_['keys'](_0x2ea034[_0x7d78('0x31')]);_0x27ef1f[_0x7d78('0x33')]=_[_0x7d78('0x34')](_0x27ef1f[_0x7d78('0x35')],_0x27ef1f['query']);_0x25d634[_0x7d78('0x37')]=_[_0x7d78('0x34')](_0x27ef1f[_0x7d78('0x35')],qs[_0x7d78('0x36')](_0x2ea034[_0x7d78('0x31')][_0x7d78('0x36')]));_0x25d634[_0x7d78('0x37')]=_0x25d634[_0x7d78('0x37')]['length']?_0x25d634[_0x7d78('0x37')]:_0x27ef1f[_0x7d78('0x35')];if(!_0x2ea034[_0x7d78('0x31')][_0x7d78('0x39')](_0x7d78('0x3a'))){_0x25d634[_0x7d78('0x1c')]=qs[_0x7d78('0x1c')](_0x2ea034[_0x7d78('0x31')][_0x7d78('0x1c')]);_0x25d634[_0x7d78('0x1a')]=qs[_0x7d78('0x1a')](_0x2ea034['query'][_0x7d78('0x1a')]);}_0x25d634[_0x7d78('0x5b')]=qs[_0x7d78('0x3b')](_0x2ea034[_0x7d78('0x31')][_0x7d78('0x3b')]);_0x25d634[_0x7d78('0x3c')]=qs[_0x7d78('0x33')](_['pick'](_0x2ea034[_0x7d78('0x31')],_0x27ef1f[_0x7d78('0x33')]));_0x25d634[_0x7d78('0x3c')][_0x7d78('0x57')]=_0x1c0741['id'];if(_0x2ea034[_0x7d78('0x31')][_0x7d78('0x3e')]){_0x25d634[_0x7d78('0x3c')]=_[_0x7d78('0x3f')](_0x25d634['where'],{'$or':_[_0x7d78('0x2c')](_0x25d634['attributes'],function(_0x495b18){var _0x4a7e44={};_0x4a7e44[_0x495b18]={'$like':'%'+_0x2ea034[_0x7d78('0x31')]['filter']+'%'};return _0x4a7e44;})});}_0x25d634=_[_0x7d78('0x3f')]({},_0x25d634,_0x2ea034['options']);return db['CmHopperHistory'][_0x7d78('0x1d')]({'where':_0x25d634['where']})[_0x7d78('0x23')](function(_0x5c452){_0x1ff2e6[_0x7d78('0x1d')]=_0x5c452;if(_0x2ea034[_0x7d78('0x31')][_0x7d78('0x43')]){_0x25d634[_0x7d78('0x44')]=[{'all':!![]}];}return db[_0x7d78('0x5c')][_0x7d78('0x59')](_0x25d634);})[_0x7d78('0x23')](function(_0x6f40c1){_0x1ff2e6[_0x7d78('0x41')]=_0x6f40c1;return _0x1ff2e6;});}})[_0x7d78('0x23')](respondWithFilteredResult(_0x4237a8,_0x25d634))[_0x7d78('0x45')](handleError(_0x4237a8,null));};exports[_0x7d78('0x5d')]=function(_0x517989,_0x443a63,_0x5cd675){var _0xf7cdbe={'raw':!![],'where':{}};var _0x319b44={};var _0xd9bed1={'count':0x0,'rows':[]};return db[_0x7d78('0x2d')]['findOne']({'where':{'id':_0x517989[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x443a63,null))['then'](function(_0x4a18ad){if(_0x4a18ad){_0x319b44[_0x7d78('0x35')]=_[_0x7d78('0x32')](db[_0x7d78('0x5e')][_0x7d78('0x2e')]);_0x319b44[_0x7d78('0x31')]=_[_0x7d78('0x32')](_0x517989[_0x7d78('0x31')]);_0x319b44[_0x7d78('0x33')]=_[_0x7d78('0x34')](_0x319b44[_0x7d78('0x35')],_0x319b44[_0x7d78('0x31')]);_0xf7cdbe[_0x7d78('0x37')]=_[_0x7d78('0x34')](_0x319b44[_0x7d78('0x35')],qs[_0x7d78('0x36')](_0x517989[_0x7d78('0x31')][_0x7d78('0x36')]));_0xf7cdbe[_0x7d78('0x37')]=_0xf7cdbe[_0x7d78('0x37')][_0x7d78('0x38')]?_0xf7cdbe[_0x7d78('0x37')]:_0x319b44['model'];if(!_0x517989[_0x7d78('0x31')][_0x7d78('0x39')](_0x7d78('0x3a'))){_0xf7cdbe['limit']=qs[_0x7d78('0x1c')](_0x517989[_0x7d78('0x31')]['limit']);_0xf7cdbe['offset']=qs[_0x7d78('0x1a')](_0x517989[_0x7d78('0x31')]['offset']);}_0xf7cdbe[_0x7d78('0x5b')]=qs[_0x7d78('0x3b')](_0x517989['query'][_0x7d78('0x3b')]);_0xf7cdbe[_0x7d78('0x3c')]=qs['filters'](_[_0x7d78('0x3d')](_0x517989['query'],_0x319b44[_0x7d78('0x33')]));_0xf7cdbe[_0x7d78('0x3c')]['CampaignId']=_0x4a18ad['id'];if(_0x517989[_0x7d78('0x31')][_0x7d78('0x3e')]){_0xf7cdbe[_0x7d78('0x3c')]=_[_0x7d78('0x3f')](_0xf7cdbe[_0x7d78('0x3c')],{'$or':_[_0x7d78('0x2c')](_0xf7cdbe['attributes'],function(_0x26e42c){var _0x234f21={};_0x234f21[_0x26e42c]={'$like':'%'+_0x517989['query']['filter']+'%'};return _0x234f21;})});}_0xf7cdbe=_[_0x7d78('0x3f')]({},_0xf7cdbe,_0x517989[_0x7d78('0x40')]);return db['CmHopperFinal'][_0x7d78('0x1d')]({'where':_0xf7cdbe[_0x7d78('0x3c')]})[_0x7d78('0x23')](function(_0x24a6d2){_0xd9bed1[_0x7d78('0x1d')]=_0x24a6d2;if(_0x517989[_0x7d78('0x31')][_0x7d78('0x43')]){_0xf7cdbe[_0x7d78('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7d78('0x59')](_0xf7cdbe);})['then'](function(_0x101776){_0xd9bed1[_0x7d78('0x41')]=_0x101776;return _0xd9bed1;});}})[_0x7d78('0x23')](respondWithFilteredResult(_0x443a63,_0xf7cdbe))[_0x7d78('0x45')](handleError(_0x443a63,null));};exports[_0x7d78('0x5f')]=function(_0x48f396,_0x179523,_0x163555){var _0x3fec63={'raw':!![],'where':{}};var _0x1d7e7c={};var _0x3bd280={'count':0x0,'rows':[]};return db['Campaign'][_0x7d78('0x56')]({'where':{'id':_0x48f396[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x179523,null))['then'](function(_0x187589){if(_0x187589){_0x1d7e7c['model']=_['keys'](db['CmHopperBlack'][_0x7d78('0x2e')]);_0x1d7e7c[_0x7d78('0x31')]=_['keys'](_0x48f396[_0x7d78('0x31')]);_0x1d7e7c[_0x7d78('0x33')]=_[_0x7d78('0x34')](_0x1d7e7c[_0x7d78('0x35')],_0x1d7e7c['query']);_0x3fec63[_0x7d78('0x37')]=_[_0x7d78('0x34')](_0x1d7e7c[_0x7d78('0x35')],qs['fields'](_0x48f396[_0x7d78('0x31')][_0x7d78('0x36')]));_0x3fec63['attributes']=_0x3fec63[_0x7d78('0x37')]['length']?_0x3fec63[_0x7d78('0x37')]:_0x1d7e7c[_0x7d78('0x35')];if(!_0x48f396['query'][_0x7d78('0x39')](_0x7d78('0x3a'))){_0x3fec63[_0x7d78('0x1c')]=qs[_0x7d78('0x1c')](_0x48f396[_0x7d78('0x31')]['limit']);_0x3fec63['offset']=qs[_0x7d78('0x1a')](_0x48f396[_0x7d78('0x31')]['offset']);}_0x3fec63[_0x7d78('0x5b')]=qs[_0x7d78('0x3b')](_0x48f396[_0x7d78('0x31')][_0x7d78('0x3b')]);_0x3fec63['where']=qs[_0x7d78('0x33')](_[_0x7d78('0x3d')](_0x48f396[_0x7d78('0x31')],_0x1d7e7c[_0x7d78('0x33')]));_0x3fec63['where'][_0x7d78('0x57')]=_0x187589['id'];if(_0x48f396[_0x7d78('0x31')]['filter']){_0x3fec63[_0x7d78('0x3c')]=_[_0x7d78('0x3f')](_0x3fec63[_0x7d78('0x3c')],{'$or':_[_0x7d78('0x2c')](_0x3fec63[_0x7d78('0x37')],function(_0xd5c016){var _0x4f751a={};_0x4f751a[_0xd5c016]={'$like':'%'+_0x48f396[_0x7d78('0x31')]['filter']+'%'};return _0x4f751a;})});}_0x3fec63=_[_0x7d78('0x3f')]({},_0x3fec63,_0x48f396['options']);return db[_0x7d78('0x60')][_0x7d78('0x1d')]({'where':_0x3fec63[_0x7d78('0x3c')]})['then'](function(_0x449b43){_0x3bd280[_0x7d78('0x1d')]=_0x449b43;if(_0x48f396[_0x7d78('0x31')][_0x7d78('0x43')]){_0x3fec63[_0x7d78('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x7d78('0x59')](_0x3fec63);})[_0x7d78('0x23')](function(_0x157057){_0x3bd280[_0x7d78('0x41')]=_0x157057;return _0x3bd280;});}})['then'](respondWithFilteredResult(_0x179523,_0x3fec63))[_0x7d78('0x45')](handleError(_0x179523,null));};exports[_0x7d78('0x61')]=function(_0x3dd322,_0x27c305,_0x3bb3f3){var _0x418776={};var _0x522b86={};var _0x1d9c4d;var _0x4d8039;return db[_0x7d78('0x2d')]['findOne']({'where':{'id':_0x3dd322[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x27c305,null))['then'](function(_0x39dca7){if(_0x39dca7){_0x1d9c4d=_0x39dca7;_0x522b86[_0x7d78('0x35')]=_[_0x7d78('0x32')](db[_0x7d78('0x62')]['rawAttributes']);_0x522b86[_0x7d78('0x31')]=_[_0x7d78('0x32')](_0x3dd322[_0x7d78('0x31')]);_0x522b86[_0x7d78('0x33')]=_[_0x7d78('0x34')](_0x522b86['model'],_0x522b86[_0x7d78('0x31')]);_0x418776['attributes']=_[_0x7d78('0x34')](_0x522b86[_0x7d78('0x35')],qs[_0x7d78('0x36')](_0x3dd322[_0x7d78('0x31')][_0x7d78('0x36')]));_0x418776['attributes']=_0x418776['attributes'][_0x7d78('0x38')]?_0x418776[_0x7d78('0x37')]:_0x522b86[_0x7d78('0x35')];_0x418776[_0x7d78('0x5b')]=qs['sort'](_0x3dd322[_0x7d78('0x31')][_0x7d78('0x3b')]);_0x418776[_0x7d78('0x3c')]=qs[_0x7d78('0x33')](_[_0x7d78('0x3d')](_0x3dd322[_0x7d78('0x31')],_0x522b86[_0x7d78('0x33')]));if(_0x3dd322[_0x7d78('0x31')][_0x7d78('0x3e')]){_0x418776[_0x7d78('0x3c')]=_[_0x7d78('0x3f')](_0x418776[_0x7d78('0x3c')],{'$or':_[_0x7d78('0x2c')](_0x418776[_0x7d78('0x37')],function(_0x11f38d){var _0x3709a1={};_0x3709a1[_0x11f38d]={'$like':'%'+_0x3dd322['query'][_0x7d78('0x3e')]+'%'};return _0x3709a1;})});}_0x418776=_[_0x7d78('0x3f')]({},_0x418776,_0x3dd322[_0x7d78('0x40')]);return _0x1d9c4d[_0x7d78('0x61')](_0x418776);}})[_0x7d78('0x23')](function(_0x522b01){if(_0x522b01){_0x4d8039=_0x522b01[_0x7d78('0x38')];if(!_0x3dd322['query']['hasOwnProperty']('nolimit')){_0x418776[_0x7d78('0x1c')]=qs[_0x7d78('0x1c')](_0x3dd322[_0x7d78('0x31')][_0x7d78('0x1c')]);_0x418776[_0x7d78('0x1a')]=qs['offset'](_0x3dd322['query'][_0x7d78('0x1a')]);}return _0x1d9c4d[_0x7d78('0x61')](_0x418776);}})[_0x7d78('0x23')](function(_0x2263f5){if(_0x2263f5){return _0x2263f5?{'count':_0x4d8039,'rows':_0x2263f5}:null;}})[_0x7d78('0x23')](respondWithResult(_0x27c305,null))[_0x7d78('0x45')](handleError(_0x27c305,null));};exports[_0x7d78('0x63')]=function(_0x4f15e0,_0x46c39b,_0x46e9b5){var _0x126856,_0x12be69;return db[_0x7d78('0x2d')][_0x7d78('0x4b')]({'where':{'id':_0x4f15e0[_0x7d78('0x51')]['id']}})['then'](handleEntityNotFound(_0x46c39b,null))['then'](function(_0x5f563f){if(_0x5f563f){_0x12be69=_0x5f563f;return _0x5f563f[_0x7d78('0x63')](_0x4f15e0[_0x7d78('0x47')][_0x7d78('0x64')],_[_0x7d78('0x52')](_0x4f15e0[_0x7d78('0x47')],['ids','id'])||{});}return null;})[_0x7d78('0x65')](function(_0x28b6bc){var _0x568a37;_0x126856=_0x28b6bc||[];var _0x3635ad=[];if(_0x28b6bc){for(var _0x5dffdf=0x0;_0x5dffdf<_0x28b6bc[_0x7d78('0x38')];_0x5dffdf+=0x1){var _0x1c687d=_0x28b6bc[_0x5dffdf][_0x7d78('0x25')]({'plain':!![]});_0x12be69[_0x7d78('0x66')]=_0x4f15e0['body']['dialCheckDuplicateType']?_0x4f15e0['body']['dialCheckDuplicateType']:_0x12be69[_0x7d78('0x66')];switch(_0x12be69[_0x7d78('0x66')]){case _0x7d78('0x67'):_0x568a37=squel['insert']()[_0x7d78('0x68')](_0x7d78('0x69'))[_0x7d78('0x6a')]([_0x7d78('0x6b'),_0x7d78('0x6c'),_0x7d78('0x6d'),_0x7d78('0x6e'),_0x7d78('0x57'),_0x7d78('0x53'),'updatedAt'],squel[_0x7d78('0x6f')]()['field']('phone',_0x7d78('0x6b'))[_0x7d78('0x70')](_0x7d78('0x71'),_0x7d78('0x6c'))['field']('id',_0x7d78('0x6d'))['field'](_0x1c687d[_0x7d78('0x72')][_0x7d78('0x73')](),_0x7d78('0x6e'))['field'](_0x4f15e0['params']['id']['toString'](),_0x7d78('0x57'))[_0x7d78('0x70')](_0x7d78('0x71'),_0x7d78('0x53'))[_0x7d78('0x70')]('NOW()',_0x7d78('0x54'))['from'](_0x7d78('0x74'))[_0x7d78('0x3c')](_0x7d78('0x75'))[_0x7d78('0x3c')](_0x7d78('0x76'),_0x1c687d['CmListId']['toString']())[_0x7d78('0x3c')](_0x7d78('0x77'))[_0x7d78('0x3c')](_0x7d78('0x78'),squel[_0x7d78('0x6f')]()[_0x7d78('0x70')](_0x7d78('0x79'))[_0x7d78('0x7a')](_0x7d78('0x7b'))[_0x7d78('0x3c')](_0x7d78('0x7c'),_0x4f15e0[_0x7d78('0x51')]['id']['toString']()))[_0x7d78('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7d78('0x70')]('COALESCE(phone,\x27\x27)')[_0x7d78('0x7a')]('cm_hopper')[_0x7d78('0x3c')](_0x7d78('0x7c'),_0x4f15e0['params']['id'][_0x7d78('0x73')]())))[_0x7d78('0x73')]();break;case'onlyIfOpen':_0x568a37=squel[_0x7d78('0x7d')]()[_0x7d78('0x68')](_0x7d78('0x69'))[_0x7d78('0x6a')]([_0x7d78('0x6b'),_0x7d78('0x6c'),'ContactId',_0x7d78('0x6e'),_0x7d78('0x57'),_0x7d78('0x53'),_0x7d78('0x54')],squel[_0x7d78('0x6f')]()[_0x7d78('0x70')]('phone',_0x7d78('0x6b'))[_0x7d78('0x70')](_0x7d78('0x71'),_0x7d78('0x6c'))[_0x7d78('0x70')]('id','ContactId')[_0x7d78('0x70')](_0x1c687d[_0x7d78('0x72')]['toString'](),_0x7d78('0x6e'))[_0x7d78('0x70')](_0x4f15e0[_0x7d78('0x51')]['id'][_0x7d78('0x73')](),'CampaignId')[_0x7d78('0x70')]('NOW()',_0x7d78('0x53'))[_0x7d78('0x70')](_0x7d78('0x71'),_0x7d78('0x54'))[_0x7d78('0x7a')](_0x7d78('0x74'))[_0x7d78('0x3c')](_0x7d78('0x75'))['where'](_0x7d78('0x76'),_0x1c687d['CmListId'][_0x7d78('0x73')]())['where'](_0x7d78('0x77'))[_0x7d78('0x3c')](_0x7d78('0x78'),squel[_0x7d78('0x6f')]()[_0x7d78('0x70')]('COALESCE(phone,\x27\x27)')[_0x7d78('0x7a')](_0x7d78('0x69'))[_0x7d78('0x3c')](_0x7d78('0x7c'),_0x4f15e0[_0x7d78('0x51')]['id'][_0x7d78('0x73')]())))[_0x7d78('0x73')]();break;default:_0x568a37=squel[_0x7d78('0x7d')]()[_0x7d78('0x68')](_0x7d78('0x69'))[_0x7d78('0x6a')]([_0x7d78('0x6b'),_0x7d78('0x6c'),'ContactId',_0x7d78('0x6e'),'CampaignId',_0x7d78('0x53'),_0x7d78('0x54')],squel[_0x7d78('0x6f')]()['field'](_0x7d78('0x6b'),_0x7d78('0x6b'))['field'](_0x7d78('0x71'),_0x7d78('0x6c'))[_0x7d78('0x70')]('id','ContactId')[_0x7d78('0x70')](_0x1c687d[_0x7d78('0x72')][_0x7d78('0x73')](),_0x7d78('0x6e'))['field'](_0x4f15e0[_0x7d78('0x51')]['id'][_0x7d78('0x73')](),_0x7d78('0x57'))[_0x7d78('0x70')](_0x7d78('0x71'),_0x7d78('0x53'))[_0x7d78('0x70')]('NOW()',_0x7d78('0x54'))[_0x7d78('0x7a')](_0x7d78('0x74'))['where'](_0x7d78('0x75'))['where'](_0x7d78('0x76'),_0x1c687d[_0x7d78('0x72')][_0x7d78('0x73')]())[_0x7d78('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x7d78('0x73')]();}_0x3635ad[_0x7d78('0x7e')](db[_0x7d78('0x7f')]['query'](_0x568a37));}return BPromise[_0x7d78('0x80')](_0x3635ad);}})['then'](function(){return _0x126856;})[_0x7d78('0x23')](respondWithResult(_0x46c39b,null))[_0x7d78('0x45')](handleError(_0x46c39b,null));};exports['removeLists']=function(_0x261d1c,_0x2774fd,_0x2f6650){return db[_0x7d78('0x2d')][_0x7d78('0x4b')]({'where':{'id':_0x261d1c['params']['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x2774fd,null))[_0x7d78('0x23')](function(_0xf44311){if(_0xf44311){return _0xf44311[_0x7d78('0x81')](_0x261d1c['query'][_0x7d78('0x64')]);}})['then'](function(_0x36d137){if(_0x36d137){return db[_0x7d78('0x58')][_0x7d78('0x24')]({'where':{'ListId':_0x261d1c[_0x7d78('0x31')]['ids'],'CampaignId':_0x261d1c[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](function(){return _0x36d137;});}})[_0x7d78('0x23')](respondWithStatusCode(_0x2774fd,null))[_0x7d78('0x45')](handleError(_0x2774fd,null));};exports[_0x7d78('0x82')]=function(_0x5243df,_0x3a630c,_0xed89b4){var _0x17bbb4={};var _0x2a5242={};var _0x2e311e;var _0x1efd70;return db[_0x7d78('0x2d')]['findOne']({'where':{'id':_0x5243df[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x3a630c,null))['then'](function(_0x50c959){if(_0x50c959){_0x2e311e=_0x50c959;_0x2a5242[_0x7d78('0x35')]=_['keys'](db[_0x7d78('0x62')][_0x7d78('0x2e')]);_0x2a5242[_0x7d78('0x31')]=_[_0x7d78('0x32')](_0x5243df[_0x7d78('0x31')]);_0x2a5242[_0x7d78('0x33')]=_[_0x7d78('0x34')](_0x2a5242[_0x7d78('0x35')],_0x2a5242[_0x7d78('0x31')]);_0x17bbb4[_0x7d78('0x37')]=_['intersection'](_0x2a5242['model'],qs[_0x7d78('0x36')](_0x5243df['query']['fields']));_0x17bbb4['attributes']=_0x17bbb4['attributes'][_0x7d78('0x38')]?_0x17bbb4[_0x7d78('0x37')]:_0x2a5242['model'];_0x17bbb4[_0x7d78('0x5b')]=qs[_0x7d78('0x3b')](_0x5243df[_0x7d78('0x31')][_0x7d78('0x3b')]);_0x17bbb4[_0x7d78('0x3c')]=qs[_0x7d78('0x33')](_['pick'](_0x5243df[_0x7d78('0x31')],_0x2a5242[_0x7d78('0x33')]));if(_0x5243df[_0x7d78('0x31')][_0x7d78('0x3e')]){_0x17bbb4['where']=_['merge'](_0x17bbb4[_0x7d78('0x3c')],{'$or':_[_0x7d78('0x2c')](_0x17bbb4[_0x7d78('0x37')],function(_0x393ee6){var _0x264e78={};_0x264e78[_0x393ee6]={'$like':'%'+_0x5243df[_0x7d78('0x31')][_0x7d78('0x3e')]+'%'};return _0x264e78;})});}_0x17bbb4=_[_0x7d78('0x3f')]({},_0x17bbb4,_0x5243df[_0x7d78('0x40')]);return _0x2e311e[_0x7d78('0x82')](_0x17bbb4);}})[_0x7d78('0x23')](function(_0x6920e4){if(_0x6920e4){_0x1efd70=_0x6920e4['length'];if(!_0x5243df[_0x7d78('0x31')][_0x7d78('0x39')](_0x7d78('0x3a'))){_0x17bbb4['limit']=qs[_0x7d78('0x1c')](_0x5243df['query'][_0x7d78('0x1c')]);_0x17bbb4[_0x7d78('0x1a')]=qs['offset'](_0x5243df['query']['offset']);}return _0x2e311e[_0x7d78('0x82')](_0x17bbb4);}})[_0x7d78('0x23')](function(_0x180441){if(_0x180441){return _0x180441?{'count':_0x1efd70,'rows':_0x180441}:null;}})['then'](respondWithResult(_0x3a630c,null))[_0x7d78('0x45')](handleError(_0x3a630c,null));};exports[_0x7d78('0x83')]=function(_0x2c9485,_0x1b25f7,_0xb7ffdd){var _0x237eaa,_0x3b14dd;return db['Campaign']['find']({'where':{'id':_0x2c9485[_0x7d78('0x51')]['id']}})['then'](handleEntityNotFound(_0x1b25f7,null))[_0x7d78('0x23')](function(_0x1bc9a8){if(_0x1bc9a8){_0x3b14dd=_0x1bc9a8;return _0x1bc9a8['addBlackLists'](_0x2c9485[_0x7d78('0x47')]['ids'],_[_0x7d78('0x52')](_0x2c9485['body'],[_0x7d78('0x64'),'id'])||{});}return null;})[_0x7d78('0x65')](function(_0x4f7a8b){var _0x19bb2b;_0x237eaa=_0x4f7a8b||[];var _0x429c15=[];if(_0x4f7a8b){for(var _0x3aea5c=0x0;_0x3aea5c<_0x4f7a8b[_0x7d78('0x38')];_0x3aea5c+=0x1){var _0x5ddf81=_0x4f7a8b[_0x3aea5c]['get']({'plain':!![]});_0x19bb2b=squel[_0x7d78('0x7d')]()[_0x7d78('0x68')](_0x7d78('0x84'))[_0x7d78('0x6a')]([_0x7d78('0x6b'),'ContactId','ListId','CampaignId','createdAt',_0x7d78('0x54')],squel[_0x7d78('0x6f')]()['field'](_0x7d78('0x6b'),_0x7d78('0x6b'))[_0x7d78('0x70')]('id',_0x7d78('0x6d'))[_0x7d78('0x70')](_0x5ddf81[_0x7d78('0x72')][_0x7d78('0x73')](),'ListId')['field'](_0x2c9485[_0x7d78('0x51')]['id']['toString'](),'CampaignId')[_0x7d78('0x70')](_0x7d78('0x71'),_0x7d78('0x53'))['field'](_0x7d78('0x71'),_0x7d78('0x54'))['from'](_0x7d78('0x74'))[_0x7d78('0x3c')]('deletedAt\x20IS\x20NULL')['where'](_0x7d78('0x76'),_0x5ddf81[_0x7d78('0x72')][_0x7d78('0x73')]())[_0x7d78('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x429c15[_0x7d78('0x7e')](db['sequelize'][_0x7d78('0x31')](_0x19bb2b));}return BPromise[_0x7d78('0x80')](_0x429c15);}})[_0x7d78('0x23')](function(){return _0x237eaa;})[_0x7d78('0x23')](respondWithResult(_0x1b25f7,null))[_0x7d78('0x45')](handleError(_0x1b25f7,null));};exports[_0x7d78('0x85')]=function(_0x419b4e,_0x237699,_0x3119d7){return db['Campaign']['find']({'where':{'id':_0x419b4e[_0x7d78('0x51')]['id']}})[_0x7d78('0x23')](handleEntityNotFound(_0x237699,null))['then'](function(_0x26a0a8){if(_0x26a0a8){return _0x26a0a8[_0x7d78('0x85')](_0x419b4e[_0x7d78('0x31')][_0x7d78('0x64')]);}})['then'](function(_0x2ebd0d){if(_0x2ebd0d){return db[_0x7d78('0x60')][_0x7d78('0x24')]({'where':{'ListId':_0x419b4e[_0x7d78('0x31')][_0x7d78('0x64')],'CampaignId':_0x419b4e['params']['id']}})[_0x7d78('0x23')](function(){return _0x2ebd0d;});}})[_0x7d78('0x23')](respondWithStatusCode(_0x237699,null))[_0x7d78('0x45')](handleError(_0x237699,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 48516d5..91a4613 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_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':'campaigns','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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 67a6333..bbec7f5 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 _0x6e77=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','info','util'];(function(_0x32bd7b,_0x31964d){var _0x2a61d6=function(_0x1249bd){while(--_0x1249bd){_0x32bd7b['push'](_0x32bd7b['shift']());}};_0x2a61d6(++_0x31964d);}(_0x6e77,0xef));var _0x76e7=function(_0x533ca6,_0x4ed3fb){_0x533ca6=_0x533ca6-0x0;var _0x34f0bd=_0x6e77[_0x533ca6];return _0x34f0bd;};'use strict';var _=require('lodash');var util=require(_0x76e7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x76e7('0x1'));var fs=require('fs');var Redis=require(_0x76e7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x76e7('0x3'));var logger=require(_0x76e7('0x4'))(_0x76e7('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76e7('0x6')][_0x76e7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xac49d0,_0x5a5e94,_0x433ae3){return new BPromise(function(_0x464a99,_0x4ab2ff){return client['request'](_0xac49d0,_0x433ae3)[_0x76e7('0x8')](function(_0x2b2f4f){logger['info'](_0x76e7('0x9'),_0x5a5e94,_0x76e7('0xa'));logger[_0x76e7('0xb')](_0x76e7('0xc'),_0x5a5e94,'request\x20sent',JSON[_0x76e7('0xd')](_0x2b2f4f));if(_0x2b2f4f[_0x76e7('0xe')]){if(_0x2b2f4f[_0x76e7('0xe')][_0x76e7('0xf')]===0x1f4){logger[_0x76e7('0xe')](_0x76e7('0x9'),_0x5a5e94,_0x2b2f4f[_0x76e7('0xe')][_0x76e7('0x10')]);return _0x4ab2ff(_0x2b2f4f[_0x76e7('0xe')][_0x76e7('0x10')]);}logger[_0x76e7('0xe')]('Campaign,\x20%s,\x20%s',_0x5a5e94,_0x2b2f4f[_0x76e7('0xe')]['message']);return _0x464a99(_0x2b2f4f[_0x76e7('0xe')][_0x76e7('0x10')]);}else{logger['info'](_0x76e7('0x9'),_0x5a5e94,_0x76e7('0xa'));_0x464a99(_0x2b2f4f[_0x76e7('0x11')][_0x76e7('0x10')]);}})[_0x76e7('0x12')](function(_0x333466){logger[_0x76e7('0xe')]('Campaign,\x20%s,\x20%s',_0x5a5e94,_0x333466);_0x4ab2ff(_0x333466);});});}exports[_0x76e7('0x13')]=function(_0x5d54fd){var _0x91d06e=this;return new Promise(function(_0x29424b,_0x31cec6){return db[_0x76e7('0x14')][_0x76e7('0x15')]({'raw':_0x5d54fd['options']?_0x5d54fd[_0x76e7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5d54fd[_0x76e7('0x16')]?_0x5d54fd[_0x76e7('0x16')][_0x76e7('0x17')]||null:null,'attributes':_0x5d54fd[_0x76e7('0x16')]?_0x5d54fd[_0x76e7('0x16')][_0x76e7('0x18')]||null:null,'limit':_0x5d54fd[_0x76e7('0x16')]?_0x5d54fd[_0x76e7('0x16')][_0x76e7('0x19')]||null:null,'include':_0x5d54fd[_0x76e7('0x16')]?_0x5d54fd[_0x76e7('0x16')][_0x76e7('0x1a')]?_[_0x76e7('0x1b')](_0x5d54fd[_0x76e7('0x16')]['include'],function(_0x11afe6){return{'model':db[_0x11afe6['model']],'as':_0x11afe6['as'],'attributes':_0x11afe6[_0x76e7('0x18')],'include':_0x11afe6[_0x76e7('0x1a')]?_[_0x76e7('0x1b')](_0x11afe6[_0x76e7('0x1a')],function(_0x4c1bf7){return{'model':db[_0x4c1bf7[_0x76e7('0x1c')]],'as':_0x4c1bf7['as'],'attributes':_0x4c1bf7[_0x76e7('0x18')],'include':_0x4c1bf7['include']?_[_0x76e7('0x1b')](_0x4c1bf7[_0x76e7('0x1a')],function(_0x38238c){return{'model':db[_0x38238c[_0x76e7('0x1c')]],'as':_0x38238c['as'],'attributes':_0x38238c['attributes']};}):[]};}):[]};}):[]:[]})[_0x76e7('0x8')](function(_0x1a3f15){logger[_0x76e7('0x1d')](_0x76e7('0x13'),_0x5d54fd);logger[_0x76e7('0xb')](_0x76e7('0x13'),_0x5d54fd,JSON[_0x76e7('0xd')](_0x1a3f15));_0x29424b(_0x1a3f15);})[_0x76e7('0x12')](function(_0x10d6c6){logger[_0x76e7('0xe')]('GetCampaign',_0x10d6c6[_0x76e7('0x10')],_0x5d54fd);_0x31cec6(_0x91d06e['error'](0x1f4,_0x10d6c6[_0x76e7('0x10')]));});});}; \ No newline at end of file +var _0x3a32=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','options','raw','where','attributes','include','map','model','then','stringify'];(function(_0x28ea92,_0x58fa54){var _0x583e3d=function(_0x2d4cad){while(--_0x2d4cad){_0x28ea92['push'](_0x28ea92['shift']());}};_0x583e3d(++_0x58fa54);}(_0x3a32,0x9b));var _0x23a3=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x3a32[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x23a3('0x0'));var util=require(_0x23a3('0x1'));var moment=require(_0x23a3('0x2'));var BPromise=require(_0x23a3('0x3'));var rs=require(_0x23a3('0x4'));var fs=require('fs');var Redis=require(_0x23a3('0x5'));var db=require(_0x23a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23a3('0x7'));var config=require(_0x23a3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23a3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103499,_0x256bcf,_0xd4e907){return new BPromise(function(_0x2562bc,_0x11d423){return client[_0x23a3('0xa')](_0x103499,_0xd4e907)['then'](function(_0x233b17){logger[_0x23a3('0xb')]('Campaign,\x20%s,\x20%s',_0x256bcf,'request\x20sent');logger[_0x23a3('0xc')](_0x23a3('0xd'),_0x256bcf,_0x23a3('0xe'),JSON['stringify'](_0x233b17));if(_0x233b17[_0x23a3('0xf')]){if(_0x233b17['error'][_0x23a3('0x10')]===0x1f4){logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x233b17['error'][_0x23a3('0x12')]);return _0x11d423(_0x233b17[_0x23a3('0xf')][_0x23a3('0x12')]);}logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x233b17['error'][_0x23a3('0x12')]);return _0x2562bc(_0x233b17[_0x23a3('0xf')]['message']);}else{logger[_0x23a3('0xb')](_0x23a3('0x11'),_0x256bcf,'request\x20sent');_0x2562bc(_0x233b17[_0x23a3('0x13')][_0x23a3('0x12')]);}})[_0x23a3('0x14')](function(_0x3e3cc1){logger[_0x23a3('0xf')](_0x23a3('0x11'),_0x256bcf,_0x3e3cc1);_0x11d423(_0x3e3cc1);});});}exports[_0x23a3('0x15')]=function(_0xc33cbd){var _0x53f4e8=this;return new Promise(function(_0x3961e9,_0x2303d2){return db['Campaign']['findAll']({'raw':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x17')]===undefined?!![]:![]:!![],'where':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x18')]||null:null,'attributes':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x19')]||null:null,'limit':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')]['limit']||null:null,'include':_0xc33cbd[_0x23a3('0x16')]?_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x1a')]?_[_0x23a3('0x1b')](_0xc33cbd[_0x23a3('0x16')][_0x23a3('0x1a')],function(_0x509aa3){return{'model':db[_0x509aa3[_0x23a3('0x1c')]],'as':_0x509aa3['as'],'attributes':_0x509aa3['attributes'],'include':_0x509aa3[_0x23a3('0x1a')]?_['map'](_0x509aa3[_0x23a3('0x1a')],function(_0x525b5f){return{'model':db[_0x525b5f[_0x23a3('0x1c')]],'as':_0x525b5f['as'],'attributes':_0x525b5f['attributes'],'include':_0x525b5f[_0x23a3('0x1a')]?_[_0x23a3('0x1b')](_0x525b5f['include'],function(_0x333998){return{'model':db[_0x333998[_0x23a3('0x1c')]],'as':_0x333998['as'],'attributes':_0x333998[_0x23a3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x23a3('0x1d')](function(_0x2ace31){logger['info'](_0x23a3('0x15'),_0xc33cbd);logger[_0x23a3('0xc')](_0x23a3('0x15'),_0xc33cbd,JSON[_0x23a3('0x1e')](_0x2ace31));_0x3961e9(_0x2ace31);})[_0x23a3('0x14')](function(_0x35519f){logger[_0x23a3('0xf')](_0x23a3('0x15'),_0x35519f['message'],_0xc33cbd);_0x2303d2(_0x53f4e8[_0x23a3('0xf')](0x1f4,_0x35519f[_0x23a3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3a23e5f..d5196f8 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 _0x435a=['addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','Router','fs-extra','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','/:id/clone','post','addLists'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x435a,0x13b));var _0xa435=function(_0x185e44,_0x52d7f7){_0x185e44=_0x185e44-0x0;var _0x229c6c=_0x435a[_0x185e44];return _0x229c6c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa435('0x0')]();var fs_extra=require(_0xa435('0x1'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa435('0x2'));router[_0xa435('0x3')]('/',auth[_0xa435('0x4')](),controller[_0xa435('0x5')]);router[_0xa435('0x3')](_0xa435('0x6'),auth[_0xa435('0x4')](),controller['show']);router[_0xa435('0x3')](_0xa435('0x7'),auth[_0xa435('0x4')](),controller[_0xa435('0x8')]);router['get']('/:id/hopper_histories',auth[_0xa435('0x4')](),controller[_0xa435('0x9')]);router[_0xa435('0x3')](_0xa435('0xa'),auth['isAuthenticated'](),controller[_0xa435('0xb')]);router['get'](_0xa435('0xc'),auth['isAuthenticated'](),controller[_0xa435('0xd')]);router[_0xa435('0x3')](_0xa435('0xe'),auth['isAuthenticated'](),controller['getLists']);router[_0xa435('0x3')](_0xa435('0xf'),auth[_0xa435('0x4')](),controller[_0xa435('0x10')]);router['post']('/',auth[_0xa435('0x4')](),controller[_0xa435('0x11')]);router['post'](_0xa435('0x12'),auth[_0xa435('0x4')](),controller['clone']);router[_0xa435('0x13')]('/:id/lists',auth[_0xa435('0x4')](),controller[_0xa435('0x14')]);router[_0xa435('0x13')]('/:id/blacklists',auth[_0xa435('0x4')](),controller[_0xa435('0x15')]);router[_0xa435('0x16')](_0xa435('0x6'),auth['isAuthenticated'](),controller[_0xa435('0x17')]);router['delete']('/:id',auth[_0xa435('0x4')](),controller['destroy']);router[_0xa435('0x18')](_0xa435('0xe'),auth[_0xa435('0x4')](),controller[_0xa435('0x19')]);router[_0xa435('0x18')](_0xa435('0xf'),auth['isAuthenticated'](),controller[_0xa435('0x1a')]);module[_0xa435('0x1b')]=router; \ No newline at end of file +var _0x0993=['/:id/lists','addLists','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','clone'];(function(_0x3f419e,_0x3f901a){var _0x2cf753=function(_0x23b796){while(--_0x23b796){_0x3f419e['push'](_0x3f419e['shift']());}};_0x2cf753(++_0x3f901a);}(_0x0993,0x13c));var _0x3099=function(_0x3722e6,_0x10eb0b){_0x3722e6=_0x3722e6-0x0;var _0x1e33b5=_0x0993[_0x3722e6];return _0x1e33b5;};'use strict';var multer=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var path=require(_0x3099('0x2'));var timeout=require(_0x3099('0x3'));var express=require(_0x3099('0x4'));var router=express[_0x3099('0x5')]();var fs_extra=require(_0x3099('0x6'));var auth=require(_0x3099('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3099('0x8'));var controller=require(_0x3099('0x9'));router[_0x3099('0xa')]('/',auth[_0x3099('0xb')](),controller['index']);router['get'](_0x3099('0xc'),auth[_0x3099('0xb')](),controller['show']);router[_0x3099('0xa')](_0x3099('0xd'),auth[_0x3099('0xb')](),controller[_0x3099('0xe')]);router[_0x3099('0xa')](_0x3099('0xf'),auth['isAuthenticated'](),controller[_0x3099('0x10')]);router['get'](_0x3099('0x11'),auth['isAuthenticated'](),controller[_0x3099('0x12')]);router[_0x3099('0xa')](_0x3099('0x13'),auth[_0x3099('0xb')](),controller['getHopperBlacks']);router[_0x3099('0xa')]('/:id/lists',auth['isAuthenticated'](),controller[_0x3099('0x14')]);router[_0x3099('0xa')](_0x3099('0x15'),auth[_0x3099('0xb')](),controller[_0x3099('0x16')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3099('0x17')]('/:id/clone',auth[_0x3099('0xb')](),controller[_0x3099('0x18')]);router[_0x3099('0x17')](_0x3099('0x19'),auth[_0x3099('0xb')](),controller[_0x3099('0x1a')]);router[_0x3099('0x17')](_0x3099('0x15'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x3099('0x1b')](_0x3099('0xc'),auth['isAuthenticated'](),controller[_0x3099('0x1c')]);router[_0x3099('0x1d')](_0x3099('0xc'),auth['isAuthenticated'](),controller[_0x3099('0x1e')]);router['delete']('/:id/lists',auth[_0x3099('0xb')](),controller['removeLists']);router[_0x3099('0x1d')](_0x3099('0x15'),auth[_0x3099('0xb')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 01ea282..007da1a 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 _0xa04b=['key','sequelize','exports','STRING','getDataValue'];(function(_0x16c023,_0x273ff8){var _0x3525da=function(_0x16722f){while(--_0x16722f){_0x16c023['push'](_0x16c023['shift']());}};_0x3525da(++_0x273ff8);}(_0xa04b,0x1aa));var _0xba04=function(_0x2710de,_0x49db3d){_0x2710de=_0x2710de-0x0;var _0x2135f5=_0xa04b[_0x2710de];return _0x2135f5;};'use strict';var Sequelize=require(_0xba04('0x0'));module[_0xba04('0x1')]={'key':{'type':Sequelize[_0xba04('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xba04('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xba04('0x3')](_0xba04('0x4'));}}}; \ No newline at end of file +var _0x8a93=['exports','TEXT','STRING','getDataValue','key','sequelize'];(function(_0x463d51,_0x416a80){var _0x5d764c=function(_0x259fbe){while(--_0x259fbe){_0x463d51['push'](_0x463d51['shift']());}};_0x5d764c(++_0x416a80);}(_0x8a93,0x83));var _0x38a9=function(_0x3c5e45,_0x5a9916){_0x3c5e45=_0x3c5e45-0x0;var _0x2cecea=_0x8a93[_0x3c5e45];return _0x2cecea;};'use strict';var Sequelize=require(_0x38a9('0x0'));module[_0x38a9('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x38a9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x38a9('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x38a9('0x4')](_0x38a9('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b4c6c10..9de7d37 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 _0xa18b=['hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','UserProfileResource','sendStatus','stack','name','index','map','CannedAnswer','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xa18b,0xd5));var _0xba18=function(_0x35741f,_0x1bfb4f){_0x35741f=_0x35741f-0x0;var _0x2cd2b7=_0xa18b[_0x35741f];return _0x2cd2b7;};'use strict';var emlformat=require(_0xba18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba18('0x2'));var moment=require(_0xba18('0x3'));var BPromise=require(_0xba18('0x4'));var Mustache=require(_0xba18('0x5'));var util=require(_0xba18('0x6'));var path=require(_0xba18('0x7'));var sox=require(_0xba18('0x8'));var csv=require(_0xba18('0x9'));var ejs=require(_0xba18('0xa'));var fs=require('fs');var fs_extra=require(_0xba18('0xb'));var _=require(_0xba18('0xc'));var squel=require(_0xba18('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba18('0xe'));var toCsv=require(_0xba18('0x9'));var querystring=require('querystring');var Papa=require(_0xba18('0xf'));var Redis=require('ioredis');var authService=require(_0xba18('0x10'));var qs=require(_0xba18('0x11'));var as=require(_0xba18('0x12'));var hardwareService=require(_0xba18('0x13'));var logger=require(_0xba18('0x14'))('api');var utils=require(_0xba18('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xba18('0x16'));var db=require(_0xba18('0x17'))['db'];function respondWithStatusCode(_0x23c855,_0x2a2292){_0x2a2292=_0x2a2292||0xcc;return function(_0x223b8e){if(_0x223b8e){return _0x23c855['sendStatus'](_0x2a2292);}return _0x23c855[_0xba18('0x18')](_0x2a2292)[_0xba18('0x19')]();};}function respondWithResult(_0x2a8842,_0x1f0272){_0x1f0272=_0x1f0272||0xc8;return function(_0x49b43f){if(_0x49b43f){return _0x2a8842[_0xba18('0x18')](_0x1f0272)[_0xba18('0x1a')](_0x49b43f);}};}function respondWithFilteredResult(_0x154cb5,_0x452568){return function(_0x428fd5){if(_0x428fd5){var _0x13c234=typeof _0x452568[_0xba18('0x1b')]===_0xba18('0x1c')&&typeof _0x452568[_0xba18('0x1d')]===_0xba18('0x1c');var _0x3dacd7=_0x428fd5['count'];var _0x20e355=_0x13c234?0x0:_0x452568[_0xba18('0x1b')];var _0x56e5ba=_0x13c234?_0x428fd5[_0xba18('0x1e')]:_0x452568[_0xba18('0x1b')]+_0x452568['limit'];var _0x1cca3d;if(_0x56e5ba>=_0x3dacd7){_0x56e5ba=_0x3dacd7;_0x1cca3d=0xc8;}else{_0x1cca3d=0xce;}_0x154cb5[_0xba18('0x18')](_0x1cca3d);return _0x154cb5[_0xba18('0x1f')]('Content-Range',_0x20e355+'-'+_0x56e5ba+'/'+_0x3dacd7)[_0xba18('0x1a')](_0x428fd5);}return null;};}function patchUpdates(_0x43e037){return function(_0x6b3d38){try{jsonpatch[_0xba18('0x20')](_0x6b3d38,_0x43e037,!![]);}catch(_0x31c802){return BPromise[_0xba18('0x21')](_0x31c802);}return _0x6b3d38[_0xba18('0x22')]();};}function saveUpdates(_0x36713b,_0x557184){return function(_0x48559d){if(_0x48559d){return _0x48559d[_0xba18('0x23')](_0x36713b)['then'](function(_0x31fcfc){return _0x31fcfc;});}return null;};}function removeEntity(_0x3e2c5f,_0x5d88fb){return function(_0x50fa73){if(_0x50fa73){return _0x50fa73[_0xba18('0x24')]()[_0xba18('0x25')](function(){var _0x380882=_0x50fa73['get']({'plain':!![]});var _0x1e58e7='CannedAnswers';return db[_0xba18('0x26')][_0xba18('0x24')]({'where':{'type':_0x1e58e7,'resourceId':_0x380882['id']}})[_0xba18('0x25')](function(){return _0x50fa73;});})[_0xba18('0x25')](function(){_0x3e2c5f['status'](0xcc)[_0xba18('0x19')]();});}};}function handleEntityNotFound(_0x44adb3,_0x51bdc3){return function(_0x56b9ef){if(!_0x56b9ef){_0x44adb3[_0xba18('0x27')](0x194);}return _0x56b9ef;};}function handleError(_0x186629,_0x4568ee){_0x4568ee=_0x4568ee||0x1f4;return function(_0x16e145){logger['error'](_0x16e145[_0xba18('0x28')]);if(_0x16e145['name']){delete _0x16e145[_0xba18('0x29')];}_0x186629[_0xba18('0x18')](_0x4568ee)['send'](_0x16e145);};}exports[_0xba18('0x2a')]=function(_0x41cc15,_0x5319cc){var _0x287fc1={},_0x2b1068={},_0x22a7ce={'count':0x0,'rows':[]};var _0x3e2784=_[_0xba18('0x2b')](db[_0xba18('0x2c')]['rawAttributes'],function(_0x312668){return{'name':_0x312668['fieldName'],'type':_0x312668[_0xba18('0x2d')][_0xba18('0x2e')]};});_0x2b1068[_0xba18('0x2f')]=_[_0xba18('0x2b')](_0x3e2784,'name');_0x2b1068['query']=_[_0xba18('0x30')](_0x41cc15[_0xba18('0x31')]);_0x2b1068[_0xba18('0x32')]=_[_0xba18('0x33')](_0x2b1068[_0xba18('0x2f')],_0x2b1068[_0xba18('0x31')]);_0x287fc1[_0xba18('0x34')]=_['intersection'](_0x2b1068[_0xba18('0x2f')],qs[_0xba18('0x35')](_0x41cc15[_0xba18('0x31')]['fields']));_0x287fc1[_0xba18('0x34')]=_0x287fc1['attributes']['length']?_0x287fc1[_0xba18('0x34')]:_0x2b1068[_0xba18('0x2f')];if(!_0x41cc15['query'][_0xba18('0x36')]('nolimit')){_0x287fc1[_0xba18('0x1d')]=qs[_0xba18('0x1d')](_0x41cc15[_0xba18('0x31')][_0xba18('0x1d')]);_0x287fc1[_0xba18('0x1b')]=qs[_0xba18('0x1b')](_0x41cc15[_0xba18('0x31')]['offset']);}_0x287fc1[_0xba18('0x37')]=qs[_0xba18('0x38')](_0x41cc15[_0xba18('0x31')][_0xba18('0x38')]);_0x287fc1[_0xba18('0x39')]=qs['filters'](_[_0xba18('0x3a')](_0x41cc15[_0xba18('0x31')],_0x2b1068[_0xba18('0x32')]),_0x3e2784);if(_0x41cc15[_0xba18('0x31')][_0xba18('0x3b')]){_0x287fc1['where']=_[_0xba18('0x3c')](_0x287fc1[_0xba18('0x39')],{'$or':[{'key':{'$like':'%'+_0x41cc15[_0xba18('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x41cc15[_0xba18('0x31')][_0xba18('0x3b')]+'%'}}]});}_0x287fc1=_[_0xba18('0x3c')]({},_0x287fc1,_0x41cc15[_0xba18('0x3d')]);var _0x1c57f5={'where':_0x287fc1[_0xba18('0x39')]};return db[_0xba18('0x2c')][_0xba18('0x1e')](_0x1c57f5)[_0xba18('0x25')](function(_0x2a749c){_0x22a7ce[_0xba18('0x1e')]=_0x2a749c;if(_0x41cc15[_0xba18('0x31')][_0xba18('0x3e')]){_0x287fc1[_0xba18('0x3f')]=[{'all':!![]}];}return db[_0xba18('0x2c')][_0xba18('0x40')](_0x287fc1);})[_0xba18('0x25')](function(_0x5521d9){_0x22a7ce[_0xba18('0x41')]=_0x5521d9;return _0x22a7ce;})[_0xba18('0x25')](respondWithFilteredResult(_0x5319cc,_0x287fc1))[_0xba18('0x42')](handleError(_0x5319cc,null));};exports[_0xba18('0x43')]=function(_0x5bc6f8,_0x41db6b){var _0x315102={'raw':!![],'where':{'id':_0x5bc6f8['params']['id']}},_0x2b75e0={};_0x2b75e0[_0xba18('0x2f')]=_[_0xba18('0x30')](db[_0xba18('0x2c')][_0xba18('0x44')]);_0x2b75e0['query']=_['keys'](_0x5bc6f8[_0xba18('0x31')]);_0x2b75e0[_0xba18('0x32')]=_[_0xba18('0x33')](_0x2b75e0['model'],_0x2b75e0[_0xba18('0x31')]);_0x315102[_0xba18('0x34')]=_[_0xba18('0x33')](_0x2b75e0[_0xba18('0x2f')],qs[_0xba18('0x35')](_0x5bc6f8['query'][_0xba18('0x35')]));_0x315102[_0xba18('0x34')]=_0x315102[_0xba18('0x34')][_0xba18('0x45')]?_0x315102[_0xba18('0x34')]:_0x2b75e0[_0xba18('0x2f')];if(_0x5bc6f8[_0xba18('0x31')]['includeAll']){_0x315102[_0xba18('0x3f')]=[{'all':!![]}];}_0x315102=_[_0xba18('0x3c')]({},_0x315102,_0x5bc6f8['options']);return db[_0xba18('0x2c')][_0xba18('0x46')](_0x315102)[_0xba18('0x25')](handleEntityNotFound(_0x41db6b,null))[_0xba18('0x25')](respondWithResult(_0x41db6b,null))[_0xba18('0x42')](handleError(_0x41db6b,null));};exports[_0xba18('0x23')]=function(_0x75cab8,_0x449f08){if(_0x75cab8[_0xba18('0x47')]['id']){delete _0x75cab8[_0xba18('0x47')]['id'];}return db[_0xba18('0x2c')][_0xba18('0x46')]({'where':{'id':_0x75cab8[_0xba18('0x48')]['id']}})[_0xba18('0x25')](handleEntityNotFound(_0x449f08,null))[_0xba18('0x25')](saveUpdates(_0x75cab8[_0xba18('0x47')],null))[_0xba18('0x25')](respondWithResult(_0x449f08,null))[_0xba18('0x42')](handleError(_0x449f08,null));};exports[_0xba18('0x24')]=function(_0x29298d,_0x31247e){return db[_0xba18('0x2c')]['find']({'where':{'id':_0x29298d[_0xba18('0x48')]['id']}})[_0xba18('0x25')](handleEntityNotFound(_0x31247e,null))['then'](removeEntity(_0x31247e,null))[_0xba18('0x42')](handleError(_0x31247e,null));};exports[_0xba18('0x49')]=function(_0x2d73b0,_0x280b65){var _0x4e4869={'key':_0x2d73b0[_0xba18('0x47')]['key']};if(_0x2d73b0['body'][_0xba18('0x4a')]){_0x4e4869[_0xba18('0x4a')]=_0x2d73b0[_0xba18('0x47')]['MailAccountId'];}else if(_0x2d73b0[_0xba18('0x47')][_0xba18('0x4b')]){_0x4e4869[_0xba18('0x4b')]=_0x2d73b0[_0xba18('0x47')][_0xba18('0x4b')];}else if(_0x2d73b0[_0xba18('0x47')][_0xba18('0x4c')]){_0x4e4869[_0xba18('0x4c')]=_0x2d73b0[_0xba18('0x47')][_0xba18('0x4c')];}else if(_0x2d73b0[_0xba18('0x47')][_0xba18('0x4d')]){_0x4e4869['ChatWebsiteId']=_0x2d73b0['body'][_0xba18('0x4d')];}return db['CannedAnswer'][_0xba18('0x46')]({'where':_0x4e4869})[_0xba18('0x25')](function(_0x1deb83){if(_0x1deb83){throw new db['Sequelize'][(_0xba18('0x4e'))](_0xba18('0x4f'));}return db[_0xba18('0x2c')][_0xba18('0x49')](_0x2d73b0[_0xba18('0x47')]);})[_0xba18('0x25')](function(_0x5edcf4){var _0x36ab9a=_0x2d73b0[_0xba18('0x50')]['get']({'plain':!![]});if(!_0x36ab9a)throw new Error(_0xba18('0x51'));if(_0x36ab9a[_0xba18('0x52')]===_0xba18('0x50')){var _0x2c0df8=_0x5edcf4[_0xba18('0x53')]({'plain':!![]});return db[_0xba18('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x36ab9a[_0xba18('0x55')]},'raw':!![]})['then'](function(_0x6c3708){if(_0x6c3708&&_0x6c3708[_0xba18('0x56')]===0x0){return db['UserProfileResource'][_0xba18('0x49')]({'name':_0x2c0df8[_0xba18('0x29')],'resourceId':_0x2c0df8['id'],'type':_0x6c3708['name'],'sectionId':_0x6c3708['id']},{})[_0xba18('0x25')](function(){return _0x5edcf4;});}else{return _0x5edcf4;}})[_0xba18('0x42')](function(_0x401d60){logger[_0xba18('0x57')](_0xba18('0x58'),_0x401d60);throw _0x401d60;});}return _0x5edcf4;})[_0xba18('0x25')](respondWithResult(_0x280b65,0xc9))[_0xba18('0x42')](handleError(_0x280b65,null));}; \ No newline at end of file +var _0x415b=['count','findAll','rows','catch','show','params','keys','includeAll','body','find','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','offset','limit','status','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','CannedAnswer'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x415b,0xc3));var _0xb415=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x415b[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb415('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb415('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb415('0x2'));var util=require(_0xb415('0x3'));var path=require(_0xb415('0x4'));var sox=require(_0xb415('0x5'));var csv=require(_0xb415('0x6'));var ejs=require(_0xb415('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb415('0x8'));var squel=require(_0xb415('0x9'));var crypto=require('crypto');var jsforce=require(_0xb415('0xa'));var deskjs=require(_0xb415('0xb'));var toCsv=require(_0xb415('0x6'));var querystring=require(_0xb415('0xc'));var Papa=require('papaparse');var Redis=require(_0xb415('0xd'));var authService=require(_0xb415('0xe'));var qs=require(_0xb415('0xf'));var as=require(_0xb415('0x10'));var hardwareService=require(_0xb415('0x11'));var logger=require(_0xb415('0x12'))('api');var utils=require(_0xb415('0x13'));var config=require(_0xb415('0x14'));var licenseUtil=require(_0xb415('0x15'));var db=require(_0xb415('0x16'))['db'];function respondWithStatusCode(_0x5ec292,_0x15f88d){_0x15f88d=_0x15f88d||0xcc;return function(_0x40e496){if(_0x40e496){return _0x5ec292[_0xb415('0x17')](_0x15f88d);}return _0x5ec292['status'](_0x15f88d)['end']();};}function respondWithResult(_0x5d18d1,_0xe601eb){_0xe601eb=_0xe601eb||0xc8;return function(_0x183b9d){if(_0x183b9d){return _0x5d18d1['status'](_0xe601eb)[_0xb415('0x18')](_0x183b9d);}};}function respondWithFilteredResult(_0x572274,_0x37ab59){return function(_0x2ab73c){if(_0x2ab73c){var _0xce8c44=typeof _0x37ab59['offset']===_0xb415('0x19')&&typeof _0x37ab59['limit']===_0xb415('0x19');var _0xf91deb=_0x2ab73c['count'];var _0x1c3e57=_0xce8c44?0x0:_0x37ab59['offset'];var _0x2c7530=_0xce8c44?_0x2ab73c['count']:_0x37ab59[_0xb415('0x1a')]+_0x37ab59[_0xb415('0x1b')];var _0x84899e;if(_0x2c7530>=_0xf91deb){_0x2c7530=_0xf91deb;_0x84899e=0xc8;}else{_0x84899e=0xce;}_0x572274[_0xb415('0x1c')](_0x84899e);return _0x572274['set'](_0xb415('0x1d'),_0x1c3e57+'-'+_0x2c7530+'/'+_0xf91deb)[_0xb415('0x18')](_0x2ab73c);}return null;};}function patchUpdates(_0x424fae){return function(_0x389fef){try{jsonpatch[_0xb415('0x1e')](_0x389fef,_0x424fae,!![]);}catch(_0xd7c27){return BPromise[_0xb415('0x1f')](_0xd7c27);}return _0x389fef['save']();};}function saveUpdates(_0x350667,_0x5b318a){return function(_0x5db652){if(_0x5db652){return _0x5db652[_0xb415('0x20')](_0x350667)['then'](function(_0x535504){return _0x535504;});}return null;};}function removeEntity(_0x34a054,_0x484c8c){return function(_0x585483){if(_0x585483){return _0x585483[_0xb415('0x21')]()[_0xb415('0x22')](function(){var _0x380cff=_0x585483[_0xb415('0x23')]({'plain':!![]});var _0x1a1db4=_0xb415('0x24');return db[_0xb415('0x25')][_0xb415('0x21')]({'where':{'type':_0x1a1db4,'resourceId':_0x380cff['id']}})['then'](function(){return _0x585483;});})['then'](function(){_0x34a054[_0xb415('0x1c')](0xcc)[_0xb415('0x26')]();});}};}function handleEntityNotFound(_0x3cad38,_0x367f5f){return function(_0x29dba2){if(!_0x29dba2){_0x3cad38[_0xb415('0x17')](0x194);}return _0x29dba2;};}function handleError(_0x4f8966,_0x2f7a93){_0x2f7a93=_0x2f7a93||0x1f4;return function(_0x5e34d4){logger[_0xb415('0x27')](_0x5e34d4[_0xb415('0x28')]);if(_0x5e34d4[_0xb415('0x29')]){delete _0x5e34d4[_0xb415('0x29')];}_0x4f8966[_0xb415('0x1c')](_0x2f7a93)[_0xb415('0x2a')](_0x5e34d4);};}exports[_0xb415('0x2b')]=function(_0x51d8b5,_0x98f15a){var _0x41b5ff={},_0x10b86f={},_0x500615={'count':0x0,'rows':[]};var _0x59310b=_[_0xb415('0x2c')](db['CannedAnswer'][_0xb415('0x2d')],function(_0x431e2e){return{'name':_0x431e2e['fieldName'],'type':_0x431e2e[_0xb415('0x2e')]['key']};});_0x10b86f[_0xb415('0x2f')]=_[_0xb415('0x2c')](_0x59310b,_0xb415('0x29'));_0x10b86f[_0xb415('0x30')]=_['keys'](_0x51d8b5[_0xb415('0x30')]);_0x10b86f[_0xb415('0x31')]=_[_0xb415('0x32')](_0x10b86f[_0xb415('0x2f')],_0x10b86f[_0xb415('0x30')]);_0x41b5ff[_0xb415('0x33')]=_[_0xb415('0x32')](_0x10b86f[_0xb415('0x2f')],qs[_0xb415('0x34')](_0x51d8b5[_0xb415('0x30')]['fields']));_0x41b5ff[_0xb415('0x33')]=_0x41b5ff[_0xb415('0x33')][_0xb415('0x35')]?_0x41b5ff[_0xb415('0x33')]:_0x10b86f[_0xb415('0x2f')];if(!_0x51d8b5[_0xb415('0x30')][_0xb415('0x36')](_0xb415('0x37'))){_0x41b5ff['limit']=qs['limit'](_0x51d8b5[_0xb415('0x30')][_0xb415('0x1b')]);_0x41b5ff[_0xb415('0x1a')]=qs['offset'](_0x51d8b5[_0xb415('0x30')][_0xb415('0x1a')]);}_0x41b5ff[_0xb415('0x38')]=qs['sort'](_0x51d8b5[_0xb415('0x30')]['sort']);_0x41b5ff[_0xb415('0x39')]=qs[_0xb415('0x31')](_[_0xb415('0x3a')](_0x51d8b5['query'],_0x10b86f[_0xb415('0x31')]),_0x59310b);if(_0x51d8b5['query']['filter']){_0x41b5ff[_0xb415('0x39')]=_['merge'](_0x41b5ff[_0xb415('0x39')],{'$or':[{'key':{'$like':'%'+_0x51d8b5[_0xb415('0x30')][_0xb415('0x3b')]+'%'}},{'value':{'$like':'%'+_0x51d8b5['query']['filter']+'%'}}]});}_0x41b5ff=_[_0xb415('0x3c')]({},_0x41b5ff,_0x51d8b5[_0xb415('0x3d')]);var _0x407b11={'where':_0x41b5ff['where']};return db[_0xb415('0x3e')][_0xb415('0x3f')](_0x407b11)[_0xb415('0x22')](function(_0x275ead){_0x500615[_0xb415('0x3f')]=_0x275ead;if(_0x51d8b5[_0xb415('0x30')]['includeAll']){_0x41b5ff['include']=[{'all':!![]}];}return db[_0xb415('0x3e')][_0xb415('0x40')](_0x41b5ff);})[_0xb415('0x22')](function(_0x4ce1d5){_0x500615[_0xb415('0x41')]=_0x4ce1d5;return _0x500615;})[_0xb415('0x22')](respondWithFilteredResult(_0x98f15a,_0x41b5ff))[_0xb415('0x42')](handleError(_0x98f15a,null));};exports[_0xb415('0x43')]=function(_0x3a872d,_0x2e83e7){var _0x3f26d5={'raw':!![],'where':{'id':_0x3a872d[_0xb415('0x44')]['id']}},_0x42529f={};_0x42529f[_0xb415('0x2f')]=_[_0xb415('0x45')](db[_0xb415('0x3e')]['rawAttributes']);_0x42529f[_0xb415('0x30')]=_['keys'](_0x3a872d['query']);_0x42529f[_0xb415('0x31')]=_['intersection'](_0x42529f[_0xb415('0x2f')],_0x42529f[_0xb415('0x30')]);_0x3f26d5['attributes']=_[_0xb415('0x32')](_0x42529f['model'],qs[_0xb415('0x34')](_0x3a872d[_0xb415('0x30')][_0xb415('0x34')]));_0x3f26d5['attributes']=_0x3f26d5[_0xb415('0x33')][_0xb415('0x35')]?_0x3f26d5['attributes']:_0x42529f[_0xb415('0x2f')];if(_0x3a872d['query'][_0xb415('0x46')]){_0x3f26d5['include']=[{'all':!![]}];}_0x3f26d5=_[_0xb415('0x3c')]({},_0x3f26d5,_0x3a872d[_0xb415('0x3d')]);return db[_0xb415('0x3e')]['find'](_0x3f26d5)[_0xb415('0x22')](handleEntityNotFound(_0x2e83e7,null))[_0xb415('0x22')](respondWithResult(_0x2e83e7,null))[_0xb415('0x42')](handleError(_0x2e83e7,null));};exports[_0xb415('0x20')]=function(_0x3d4dc6,_0x3ef452){if(_0x3d4dc6[_0xb415('0x47')]['id']){delete _0x3d4dc6[_0xb415('0x47')]['id'];}return db[_0xb415('0x3e')][_0xb415('0x48')]({'where':{'id':_0x3d4dc6[_0xb415('0x44')]['id']}})[_0xb415('0x22')](handleEntityNotFound(_0x3ef452,null))['then'](saveUpdates(_0x3d4dc6[_0xb415('0x47')],null))[_0xb415('0x22')](respondWithResult(_0x3ef452,null))[_0xb415('0x42')](handleError(_0x3ef452,null));};exports[_0xb415('0x21')]=function(_0x16f181,_0x4dcae5){return db['CannedAnswer'][_0xb415('0x48')]({'where':{'id':_0x16f181[_0xb415('0x44')]['id']}})['then'](handleEntityNotFound(_0x4dcae5,null))['then'](removeEntity(_0x4dcae5,null))[_0xb415('0x42')](handleError(_0x4dcae5,null));};exports['create']=function(_0x3ad009,_0x4c775b){var _0x50a7b6={'key':_0x3ad009[_0xb415('0x47')][_0xb415('0x49')]};if(_0x3ad009['body']['MailAccountId']){_0x50a7b6[_0xb415('0x4a')]=_0x3ad009[_0xb415('0x47')][_0xb415('0x4a')];}else if(_0x3ad009[_0xb415('0x47')][_0xb415('0x4b')]){_0x50a7b6[_0xb415('0x4b')]=_0x3ad009[_0xb415('0x47')]['SmsAccountId'];}else if(_0x3ad009[_0xb415('0x47')][_0xb415('0x4c')]){_0x50a7b6[_0xb415('0x4c')]=_0x3ad009[_0xb415('0x47')][_0xb415('0x4c')];}else if(_0x3ad009[_0xb415('0x47')][_0xb415('0x4d')]){_0x50a7b6[_0xb415('0x4d')]=_0x3ad009[_0xb415('0x47')][_0xb415('0x4d')];}return db[_0xb415('0x3e')][_0xb415('0x48')]({'where':_0x50a7b6})[_0xb415('0x22')](function(_0x49227d){if(_0x49227d){throw new db[(_0xb415('0x4e'))][(_0xb415('0x4f'))](_0xb415('0x50'));}return db['CannedAnswer'][_0xb415('0x51')](_0x3ad009[_0xb415('0x47')]);})[_0xb415('0x22')](function(_0xfca1d7){var _0x1377b8=_0x3ad009[_0xb415('0x52')][_0xb415('0x23')]({'plain':!![]});if(!_0x1377b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1377b8[_0xb415('0x53')]===_0xb415('0x52')){var _0x26162c=_0xfca1d7[_0xb415('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xb415('0x48')]({'where':{'name':_0xb415('0x24'),'userProfileId':_0x1377b8[_0xb415('0x54')]},'raw':!![]})[_0xb415('0x22')](function(_0x1fdfdd){if(_0x1fdfdd&&_0x1fdfdd['autoAssociation']===0x0){return db[_0xb415('0x25')][_0xb415('0x51')]({'name':_0x26162c[_0xb415('0x29')],'resourceId':_0x26162c['id'],'type':_0x1fdfdd[_0xb415('0x29')],'sectionId':_0x1fdfdd['id']},{})[_0xb415('0x22')](function(){return _0xfca1d7;});}else{return _0xfca1d7;}})['catch'](function(_0xc6f276){logger['error'](_0xb415('0x55'),_0xc6f276);throw _0xc6f276;});}return _0xfca1d7;})['then'](respondWithResult(_0x4c775b,0xc9))[_0xb415('0x42')](handleError(_0x4c775b,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 6625b59..d530b94 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 _0x2b80=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer'];(function(_0x5645ad,_0x580ea3){var _0x17d292=function(_0xe66902){while(--_0xe66902){_0x5645ad['push'](_0x5645ad['shift']());}};_0x17d292(++_0x580ea3);}(_0x2b80,0x1a6));var _0x02b8=function(_0x534817,_0x55cc0a){_0x534817=_0x534817-0x0;var _0x4e3ecb=_0x2b80[_0x534817];return _0x4e3ecb;};'use strict';var _=require(_0x02b8('0x0'));var util=require('util');var logger=require(_0x02b8('0x1'))(_0x02b8('0x2'));var moment=require(_0x02b8('0x3'));var BPromise=require(_0x02b8('0x4'));var rp=require(_0x02b8('0x5'));var fs=require('fs');var path=require(_0x02b8('0x6'));var rimraf=require(_0x02b8('0x7'));var config=require(_0x02b8('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x02b8('0x9')]=function(_0x465755,_0x3ea91d){return _0x465755[_0x02b8('0xa')](_0x02b8('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x02b8('0xc'),'collate':_0x02b8('0xd')});}; \ No newline at end of file +var _0xefa3=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x359e92,_0x6e6b4f){var _0x25c1fb=function(_0x456793){while(--_0x456793){_0x359e92['push'](_0x359e92['shift']());}};_0x25c1fb(++_0x6e6b4f);}(_0xefa3,0x1e2));var _0x3efa=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0xefa3[_0x4709c8];return _0x478cdd;};'use strict';var _=require(_0x3efa('0x0'));var util=require('util');var logger=require(_0x3efa('0x1'))(_0x3efa('0x2'));var moment=require(_0x3efa('0x3'));var BPromise=require(_0x3efa('0x4'));var rp=require(_0x3efa('0x5'));var fs=require('fs');var path=require(_0x3efa('0x6'));var rimraf=require(_0x3efa('0x7'));var config=require(_0x3efa('0x8'));var attributes=require(_0x3efa('0x9'));module[_0x3efa('0xa')]=function(_0x5b4c69,_0x338284){return _0x5b4c69[_0x3efa('0xb')](_0x3efa('0xc'),attributes,{'tableName':_0x3efa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3efa('0xe'),'collate':_0x3efa('0xf')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 73fe0bc..d93eadf 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(_0x48cbb5,_0x3905d3){var _0x1292a4=function(_0x10419f){while(--_0x10419f){_0x48cbb5['push'](_0x48cbb5['shift']());}};_0x1292a4(++_0x3905d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x2165bf,_0x289f5f){var _0x3bdc70=function(_0x3dc6aa){while(--_0x3dc6aa){_0x2165bf['push'](_0x2165bf['shift']());}};_0x3bdc70(++_0x289f5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 055b721..37af66a 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 _0x0083=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x20efd5,_0x21e029){var _0x14bbd0=function(_0x201890){while(--_0x201890){_0x20efd5['push'](_0x20efd5['shift']());}};_0x14bbd0(++_0x21e029);}(_0x0083,0x111));var _0x3008=function(_0x153b3c,_0xe39a8c){_0x153b3c=_0x153b3c-0x0;var _0xf18056=_0x0083[_0x153b3c];return _0xf18056;};'use strict';var multer=require('multer');var util=require(_0x3008('0x0'));var path=require(_0x3008('0x1'));var timeout=require(_0x3008('0x2'));var express=require(_0x3008('0x3'));var router=express[_0x3008('0x4')]();var fs_extra=require(_0x3008('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3008('0x6'));var config=require(_0x3008('0x7'));var controller=require('./cannedAnswer.controller');router[_0x3008('0x8')]('/',auth[_0x3008('0x9')](),controller[_0x3008('0xa')]);router['get'](_0x3008('0xb'),auth[_0x3008('0x9')](),controller[_0x3008('0xc')]);router[_0x3008('0xd')]('/',auth[_0x3008('0x9')](),controller[_0x3008('0xe')]);router['put'](_0x3008('0xb'),auth[_0x3008('0x9')](),controller[_0x3008('0xf')]);router['delete'](_0x3008('0xb'),auth[_0x3008('0x9')](),controller['destroy']);module[_0x3008('0x10')]=router; \ No newline at end of file +var _0xd50b=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','put'];(function(_0x4638ef,_0x2c2665){var _0x2e8280=function(_0x3deef0){while(--_0x3deef0){_0x4638ef['push'](_0x4638ef['shift']());}};_0x2e8280(++_0x2c2665);}(_0xd50b,0xd6));var _0xbd50=function(_0x27b49f,_0x5609d2){_0x27b49f=_0x27b49f-0x0;var _0x1b75c2=_0xd50b[_0x27b49f];return _0x1b75c2;};'use strict';var multer=require(_0xbd50('0x0'));var util=require(_0xbd50('0x1'));var path=require('path');var timeout=require(_0xbd50('0x2'));var express=require(_0xbd50('0x3'));var router=express[_0xbd50('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbd50('0x5'));var config=require(_0xbd50('0x6'));var controller=require('./cannedAnswer.controller');router[_0xbd50('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd50('0x8')]);router[_0xbd50('0x7')]('/:id',auth[_0xbd50('0x9')](),controller['show']);router['post']('/',auth[_0xbd50('0x9')](),controller['create']);router[_0xbd50('0xa')]('/:id',auth[_0xbd50('0x9')](),controller[_0xbd50('0xb')]);router[_0xbd50('0xc')]('/:id',auth[_0xbd50('0x9')](),controller[_0xbd50('0xd')]);module[_0xbd50('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 5793a14..7cb45d0 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 _0xe3ee=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x46c1d5,_0x5ca335){var _0x40fe7b=function(_0x34cb99){while(--_0x34cb99){_0x46c1d5['push'](_0x46c1d5['shift']());}};_0x40fe7b(++_0x5ca335);}(_0xe3ee,0x116));var _0xee3e=function(_0x945354,_0x1f2ffa){_0x945354=_0x945354-0x0;var _0x4e4be3=_0xe3ee[_0x945354];return _0x4e4be3;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xee3e('0x0')],'allowNull':![],'defaultValue':_0xee3e('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xee3e('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xee3e('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xee3e('0x2')]},'duration':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee3e('0x2')]},'amaflags':{'type':Sequelize[_0xee3e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xee3e('0x2')]},'userfield':{'type':Sequelize[_0xee3e('0x2')]},'uniqueid':{'type':Sequelize[_0xee3e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xee3e('0x2')]},'peeraccount':{'type':Sequelize[_0xee3e('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xee3e('0x2')]}}; \ No newline at end of file +var _0xe0f5=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2b2372,_0x5256cf){var _0x1e0fb1=function(_0x1df65b){while(--_0x1df65b){_0x2b2372['push'](_0x2b2372['shift']());}};_0x1e0fb1(++_0x5256cf);}(_0xe0f5,0xfd));var _0x5e0f=function(_0x203e1c,_0x249eea){_0x203e1c=_0x203e1c-0x0;var _0x363bfb=_0xe0f5[_0x203e1c];return _0x363bfb;};'use strict';var Sequelize=require(_0x5e0f('0x0'));module[_0x5e0f('0x1')]={'calldate':{'type':Sequelize[_0x5e0f('0x2')],'allowNull':![],'defaultValue':_0x5e0f('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5e0f('0x4')]},'dst':{'type':Sequelize[_0x5e0f('0x4')]},'dcontext':{'type':Sequelize[_0x5e0f('0x4')]},'channel':{'type':Sequelize[_0x5e0f('0x4')]},'dstchannel':{'type':Sequelize[_0x5e0f('0x4')]},'lastapp':{'type':Sequelize[_0x5e0f('0x4')]},'lastdata':{'type':Sequelize[_0x5e0f('0x4')]},'duration':{'type':Sequelize[_0x5e0f('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x5e0f('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5e0f('0x4')]},'uniqueid':{'type':Sequelize[_0x5e0f('0x4')]},'linkedid':{'type':Sequelize[_0x5e0f('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x5e0f('0x4')]},'type':{'type':Sequelize[_0x5e0f('0x4')]},'tag':{'type':Sequelize[_0x5e0f('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e5030c8..30d9f41 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 _0xf3be=['then','error','stack','name','send','index','map','Cdr','fieldName','type','key','query','keys','intersection','attributes','fields','model','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','rawAttributes','length','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x5143f0,_0x2f897b){var _0x5d8e00=function(_0x1d945e){while(--_0x1d945e){_0x5143f0['push'](_0x5143f0['shift']());}};_0x5d8e00(++_0x2f897b);}(_0xf3be,0x1e1));var _0xef3b=function(_0x3447bd,_0x5ee821){_0x3447bd=_0x3447bd-0x0;var _0x2d510c=_0xf3be[_0x3447bd];return _0x2d510c;};'use strict';var emlformat=require(_0xef3b('0x0'));var rimraf=require(_0xef3b('0x1'));var zipdir=require(_0xef3b('0x2'));var jsonpatch=require(_0xef3b('0x3'));var rp=require('request-promise');var moment=require(_0xef3b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xef3b('0x5'));var csv=require(_0xef3b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef3b('0x7'));var _=require(_0xef3b('0x8'));var squel=require(_0xef3b('0x9'));var crypto=require(_0xef3b('0xa'));var jsforce=require(_0xef3b('0xb'));var deskjs=require(_0xef3b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef3b('0xd'));var Redis=require('ioredis');var authService=require(_0xef3b('0xe'));var qs=require(_0xef3b('0xf'));var as=require(_0xef3b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef3b('0x11'))('api');var utils=require(_0xef3b('0x12'));var config=require(_0xef3b('0x13'));var licenseUtil=require(_0xef3b('0x14'));var db=require(_0xef3b('0x15'))['db'];function respondWithStatusCode(_0x2a2a27,_0x3aef79){_0x3aef79=_0x3aef79||0xcc;return function(_0x169b2c){if(_0x169b2c){return _0x2a2a27[_0xef3b('0x16')](_0x3aef79);}return _0x2a2a27[_0xef3b('0x17')](_0x3aef79)[_0xef3b('0x18')]();};}function respondWithResult(_0x510cc3,_0x5a53b9){_0x5a53b9=_0x5a53b9||0xc8;return function(_0x138ea5){if(_0x138ea5){return _0x510cc3[_0xef3b('0x17')](_0x5a53b9)[_0xef3b('0x19')](_0x138ea5);}};}function respondWithFilteredResult(_0x118a31,_0x416801){return function(_0x529e89){if(_0x529e89){var _0x169803=typeof _0x416801[_0xef3b('0x1a')]===_0xef3b('0x1b')&&typeof _0x416801[_0xef3b('0x1c')]===_0xef3b('0x1b');var _0x5908cb=_0x529e89[_0xef3b('0x1d')];var _0x406eb7=_0x169803?0x0:_0x416801['offset'];var _0x280ccf=_0x169803?_0x529e89['count']:_0x416801[_0xef3b('0x1a')]+_0x416801['limit'];var _0x278de3;if(_0x280ccf>=_0x5908cb){_0x280ccf=_0x5908cb;_0x278de3=0xc8;}else{_0x278de3=0xce;}_0x118a31[_0xef3b('0x17')](_0x278de3);return _0x118a31[_0xef3b('0x1e')](_0xef3b('0x1f'),_0x406eb7+'-'+_0x280ccf+'/'+_0x5908cb)[_0xef3b('0x19')](_0x529e89);}return null;};}function patchUpdates(_0x3d18ef){return function(_0x19d4b5){try{jsonpatch[_0xef3b('0x20')](_0x19d4b5,_0x3d18ef,!![]);}catch(_0x4a3fbf){return BPromise[_0xef3b('0x21')](_0x4a3fbf);}return _0x19d4b5[_0xef3b('0x22')]();};}function saveUpdates(_0x214b53,_0xfe39a4){return function(_0x93a080){if(_0x93a080){return _0x93a080[_0xef3b('0x23')](_0x214b53)['then'](function(_0x27cc47){return _0x27cc47;});}return null;};}function removeEntity(_0x574042,_0x57b14a){return function(_0xc68cb2){if(_0xc68cb2){return _0xc68cb2[_0xef3b('0x24')]()[_0xef3b('0x25')](function(){_0x574042[_0xef3b('0x17')](0xcc)[_0xef3b('0x18')]();});}};}function handleEntityNotFound(_0x179338,_0x4ecb5e){return function(_0x487ae6){if(!_0x487ae6){_0x179338[_0xef3b('0x16')](0x194);}return _0x487ae6;};}function handleError(_0x4b6ee7,_0x4d5449){_0x4d5449=_0x4d5449||0x1f4;return function(_0x13dd47){logger[_0xef3b('0x26')](_0x13dd47[_0xef3b('0x27')]);if(_0x13dd47[_0xef3b('0x28')]){delete _0x13dd47[_0xef3b('0x28')];}_0x4b6ee7[_0xef3b('0x17')](_0x4d5449)[_0xef3b('0x29')](_0x13dd47);};}exports[_0xef3b('0x2a')]=function(_0x556c5c,_0xded00b){var _0x2b073b={},_0x634a45={},_0x187d1b={'count':0x0,'rows':[]};var _0x27ab13=_[_0xef3b('0x2b')](db[_0xef3b('0x2c')]['rawAttributes'],function(_0x4c9a84){return{'name':_0x4c9a84[_0xef3b('0x2d')],'type':_0x4c9a84[_0xef3b('0x2e')][_0xef3b('0x2f')]};});_0x634a45['model']=_[_0xef3b('0x2b')](_0x27ab13,_0xef3b('0x28'));_0x634a45[_0xef3b('0x30')]=_[_0xef3b('0x31')](_0x556c5c[_0xef3b('0x30')]);_0x634a45['filters']=_[_0xef3b('0x32')](_0x634a45['model'],_0x634a45[_0xef3b('0x30')]);_0x2b073b[_0xef3b('0x33')]=_[_0xef3b('0x32')](_0x634a45['model'],qs[_0xef3b('0x34')](_0x556c5c[_0xef3b('0x30')][_0xef3b('0x34')]));_0x2b073b['attributes']=_0x2b073b[_0xef3b('0x33')]['length']?_0x2b073b[_0xef3b('0x33')]:_0x634a45[_0xef3b('0x35')];if(!_0x556c5c['query']['hasOwnProperty'](_0xef3b('0x36'))){_0x2b073b[_0xef3b('0x1c')]=qs[_0xef3b('0x1c')](_0x556c5c['query'][_0xef3b('0x1c')]);_0x2b073b[_0xef3b('0x1a')]=qs[_0xef3b('0x1a')](_0x556c5c[_0xef3b('0x30')][_0xef3b('0x1a')]);}_0x2b073b[_0xef3b('0x37')]=qs['sort'](_0x556c5c['query'][_0xef3b('0x38')]);_0x2b073b[_0xef3b('0x39')]=qs[_0xef3b('0x3a')](_[_0xef3b('0x3b')](_0x556c5c[_0xef3b('0x30')],_0x634a45[_0xef3b('0x3a')]),_0x27ab13);if(_0x556c5c['query'][_0xef3b('0x3c')]){_0x2b073b[_0xef3b('0x39')]=_[_0xef3b('0x3d')](_0x2b073b['where'],{'$or':_[_0xef3b('0x2b')](_0x27ab13,function(_0x5ab5eb){if(_0x5ab5eb[_0xef3b('0x2e')]!=='VIRTUAL'){var _0x3a361f={};_0x3a361f[_0x5ab5eb['name']]={'$like':'%'+_0x556c5c[_0xef3b('0x30')]['filter']+'%'};return _0x3a361f;}})});}_0x2b073b=_[_0xef3b('0x3d')]({},_0x2b073b,_0x556c5c[_0xef3b('0x3e')]);var _0x1108e1={'where':_0x2b073b[_0xef3b('0x39')]};return db[_0xef3b('0x2c')][_0xef3b('0x1d')](_0x1108e1)[_0xef3b('0x25')](function(_0x219cfc){_0x187d1b['count']=_0x219cfc;if(_0x556c5c[_0xef3b('0x30')]['includeAll']){_0x2b073b[_0xef3b('0x3f')]=[{'all':!![]}];}return db[_0xef3b('0x2c')]['findAll'](_0x2b073b);})['then'](function(_0x51fb51){_0x187d1b[_0xef3b('0x40')]=_0x51fb51;return _0x187d1b;})['then'](respondWithFilteredResult(_0xded00b,_0x2b073b))[_0xef3b('0x41')](handleError(_0xded00b,null));};exports['show']=function(_0x4b2230,_0x516d08){var _0x5cec25={'raw':!![],'where':{'id':_0x4b2230['params']['id']}},_0x48699a={};_0x48699a['model']=_[_0xef3b('0x31')](db[_0xef3b('0x2c')][_0xef3b('0x42')]);_0x48699a['query']=_['keys'](_0x4b2230[_0xef3b('0x30')]);_0x48699a[_0xef3b('0x3a')]=_[_0xef3b('0x32')](_0x48699a[_0xef3b('0x35')],_0x48699a['query']);_0x5cec25[_0xef3b('0x33')]=_['intersection'](_0x48699a[_0xef3b('0x35')],qs[_0xef3b('0x34')](_0x4b2230[_0xef3b('0x30')][_0xef3b('0x34')]));_0x5cec25[_0xef3b('0x33')]=_0x5cec25['attributes'][_0xef3b('0x43')]?_0x5cec25[_0xef3b('0x33')]:_0x48699a[_0xef3b('0x35')];if(_0x4b2230[_0xef3b('0x30')][_0xef3b('0x44')]){_0x5cec25[_0xef3b('0x3f')]=[{'all':!![]}];}_0x5cec25=_[_0xef3b('0x3d')]({},_0x5cec25,_0x4b2230[_0xef3b('0x3e')]);return db[_0xef3b('0x2c')]['find'](_0x5cec25)[_0xef3b('0x25')](handleEntityNotFound(_0x516d08,null))[_0xef3b('0x25')](respondWithResult(_0x516d08,null))[_0xef3b('0x41')](handleError(_0x516d08,null));};exports['create']=function(_0x3f3e8b,_0x5d48c8){return db[_0xef3b('0x2c')][_0xef3b('0x45')](_0x3f3e8b[_0xef3b('0x46')],{})['then'](respondWithResult(_0x5d48c8,0xc9))['catch'](handleError(_0x5d48c8,null));};exports[_0xef3b('0x23')]=function(_0x38ee41,_0x4b368c){if(_0x38ee41[_0xef3b('0x46')]['id']){delete _0x38ee41[_0xef3b('0x46')]['id'];}return db[_0xef3b('0x2c')][_0xef3b('0x47')]({'where':{'id':_0x38ee41['params']['id']}})[_0xef3b('0x25')](handleEntityNotFound(_0x4b368c,null))[_0xef3b('0x25')](saveUpdates(_0x38ee41[_0xef3b('0x46')],null))[_0xef3b('0x25')](respondWithResult(_0x4b368c,null))[_0xef3b('0x41')](handleError(_0x4b368c,null));};exports[_0xef3b('0x24')]=function(_0x5e66fe,_0x2f45b1){return db[_0xef3b('0x2c')][_0xef3b('0x47')]({'where':{'id':_0x5e66fe[_0xef3b('0x48')]['id']}})[_0xef3b('0x25')](handleEntityNotFound(_0x2f45b1,null))[_0xef3b('0x25')](removeEntity(_0x2f45b1,null))[_0xef3b('0x41')](handleError(_0x2f45b1,null));};exports[_0xef3b('0x49')]=function(_0x3995b9,_0xf30f16){return db[_0xef3b('0x2c')][_0xef3b('0x49')]()[_0xef3b('0x25')](respondWithResult(_0xf30f16,null))['catch'](handleError(_0xf30f16,null));}; \ No newline at end of file +var _0x25fa=['json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fa,0x109));var _0xa25f=function(_0x3f8691,_0x175918){_0x3f8691=_0x3f8691-0x0;var _0x4f25be=_0x25fa[_0x3f8691];return _0x4f25be;};'use strict';var emlformat=require(_0xa25f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa25f('0x1'));var jsonpatch=require(_0xa25f('0x2'));var rp=require('request-promise');var moment=require(_0xa25f('0x3'));var BPromise=require(_0xa25f('0x4'));var Mustache=require(_0xa25f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa25f('0x6'));var csv=require('to-csv');var ejs=require(_0xa25f('0x7'));var fs=require('fs');var fs_extra=require(_0xa25f('0x8'));var _=require(_0xa25f('0x9'));var squel=require(_0xa25f('0xa'));var crypto=require(_0xa25f('0xb'));var jsforce=require(_0xa25f('0xc'));var deskjs=require(_0xa25f('0xd'));var toCsv=require(_0xa25f('0xe'));var querystring=require(_0xa25f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa25f('0x10'));var authService=require(_0xa25f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa25f('0x12'));var hardwareService=require(_0xa25f('0x13'));var logger=require(_0xa25f('0x14'))(_0xa25f('0x15'));var utils=require('../../config/utils');var config=require(_0xa25f('0x16'));var licenseUtil=require(_0xa25f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e970c,_0x465e41){_0x465e41=_0x465e41||0xcc;return function(_0x50bb78){if(_0x50bb78){return _0x3e970c[_0xa25f('0x18')](_0x465e41);}return _0x3e970c[_0xa25f('0x19')](_0x465e41)[_0xa25f('0x1a')]();};}function respondWithResult(_0x4b3792,_0x199e18){_0x199e18=_0x199e18||0xc8;return function(_0x2a627f){if(_0x2a627f){return _0x4b3792[_0xa25f('0x19')](_0x199e18)[_0xa25f('0x1b')](_0x2a627f);}};}function respondWithFilteredResult(_0x465809,_0x2d2417){return function(_0x1e5836){if(_0x1e5836){var _0x1859ba=typeof _0x2d2417['offset']===_0xa25f('0x1c')&&typeof _0x2d2417[_0xa25f('0x1d')]===_0xa25f('0x1c');var _0x451a6e=_0x1e5836[_0xa25f('0x1e')];var _0x427105=_0x1859ba?0x0:_0x2d2417['offset'];var _0x292171=_0x1859ba?_0x1e5836['count']:_0x2d2417[_0xa25f('0x1f')]+_0x2d2417['limit'];var _0x559c89;if(_0x292171>=_0x451a6e){_0x292171=_0x451a6e;_0x559c89=0xc8;}else{_0x559c89=0xce;}_0x465809[_0xa25f('0x19')](_0x559c89);return _0x465809['set'](_0xa25f('0x20'),_0x427105+'-'+_0x292171+'/'+_0x451a6e)[_0xa25f('0x1b')](_0x1e5836);}return null;};}function patchUpdates(_0x2aaf3a){return function(_0x3c2665){try{jsonpatch[_0xa25f('0x21')](_0x3c2665,_0x2aaf3a,!![]);}catch(_0x504135){return BPromise[_0xa25f('0x22')](_0x504135);}return _0x3c2665[_0xa25f('0x23')]();};}function saveUpdates(_0x371716,_0x14b7f6){return function(_0x5d2803){if(_0x5d2803){return _0x5d2803[_0xa25f('0x24')](_0x371716)[_0xa25f('0x25')](function(_0x248c0c){return _0x248c0c;});}return null;};}function removeEntity(_0x3675b5,_0x4c6f4d){return function(_0x2b710f){if(_0x2b710f){return _0x2b710f[_0xa25f('0x26')]()[_0xa25f('0x25')](function(){_0x3675b5[_0xa25f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2812d7,_0x898446){return function(_0x53f011){if(!_0x53f011){_0x2812d7[_0xa25f('0x18')](0x194);}return _0x53f011;};}function handleError(_0x51dbf8,_0x2df893){_0x2df893=_0x2df893||0x1f4;return function(_0x4eb7b7){logger[_0xa25f('0x27')](_0x4eb7b7[_0xa25f('0x28')]);if(_0x4eb7b7['name']){delete _0x4eb7b7[_0xa25f('0x29')];}_0x51dbf8[_0xa25f('0x19')](_0x2df893)['send'](_0x4eb7b7);};}exports[_0xa25f('0x2a')]=function(_0x5d39c7,_0x1030c4){var _0x41a847={},_0x472114={},_0x208518={'count':0x0,'rows':[]};var _0x334629=_['map'](db[_0xa25f('0x2b')][_0xa25f('0x2c')],function(_0x119ffc){return{'name':_0x119ffc[_0xa25f('0x2d')],'type':_0x119ffc[_0xa25f('0x2e')]['key']};});_0x472114[_0xa25f('0x2f')]=_[_0xa25f('0x30')](_0x334629,_0xa25f('0x29'));_0x472114[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0x5d39c7[_0xa25f('0x31')]);_0x472114[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x472114[_0xa25f('0x2f')],_0x472114['query']);_0x41a847['attributes']=_['intersection'](_0x472114[_0xa25f('0x2f')],qs[_0xa25f('0x35')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x35')]));_0x41a847[_0xa25f('0x36')]=_0x41a847[_0xa25f('0x36')][_0xa25f('0x37')]?_0x41a847[_0xa25f('0x36')]:_0x472114[_0xa25f('0x2f')];if(!_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x38')]('nolimit')){_0x41a847['limit']=qs[_0xa25f('0x1d')](_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x1d')]);_0x41a847['offset']=qs['offset'](_0x5d39c7['query'][_0xa25f('0x1f')]);}_0x41a847[_0xa25f('0x39')]=qs[_0xa25f('0x3a')](_0x5d39c7['query']['sort']);_0x41a847[_0xa25f('0x3b')]=qs[_0xa25f('0x33')](_['pick'](_0x5d39c7['query'],_0x472114[_0xa25f('0x33')]),_0x334629);if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]){_0x41a847['where']=_[_0xa25f('0x3d')](_0x41a847[_0xa25f('0x3b')],{'$or':_[_0xa25f('0x30')](_0x334629,function(_0x49556e){if(_0x49556e['type']!==_0xa25f('0x3e')){var _0x44c9c8={};_0x44c9c8[_0x49556e[_0xa25f('0x29')]]={'$like':'%'+_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x3c')]+'%'};return _0x44c9c8;}})});}_0x41a847=_[_0xa25f('0x3d')]({},_0x41a847,_0x5d39c7[_0xa25f('0x3f')]);var _0x3382f4={'where':_0x41a847['where']};return db[_0xa25f('0x2b')][_0xa25f('0x1e')](_0x3382f4)[_0xa25f('0x25')](function(_0x2e886f){_0x208518[_0xa25f('0x1e')]=_0x2e886f;if(_0x5d39c7[_0xa25f('0x31')][_0xa25f('0x40')]){_0x41a847[_0xa25f('0x41')]=[{'all':!![]}];}return db[_0xa25f('0x2b')][_0xa25f('0x42')](_0x41a847);})[_0xa25f('0x25')](function(_0x3267a0){_0x208518[_0xa25f('0x43')]=_0x3267a0;return _0x208518;})['then'](respondWithFilteredResult(_0x1030c4,_0x41a847))[_0xa25f('0x44')](handleError(_0x1030c4,null));};exports['show']=function(_0xace015,_0x320119){var _0x36afe4={'raw':!![],'where':{'id':_0xace015[_0xa25f('0x45')]['id']}},_0x559874={};_0x559874[_0xa25f('0x2f')]=_[_0xa25f('0x32')](db[_0xa25f('0x2b')]['rawAttributes']);_0x559874[_0xa25f('0x31')]=_[_0xa25f('0x32')](_0xace015[_0xa25f('0x31')]);_0x559874[_0xa25f('0x33')]=_[_0xa25f('0x34')](_0x559874[_0xa25f('0x2f')],_0x559874['query']);_0x36afe4[_0xa25f('0x36')]=_[_0xa25f('0x34')](_0x559874['model'],qs[_0xa25f('0x35')](_0xace015[_0xa25f('0x31')][_0xa25f('0x35')]));_0x36afe4[_0xa25f('0x36')]=_0x36afe4[_0xa25f('0x36')][_0xa25f('0x37')]?_0x36afe4[_0xa25f('0x36')]:_0x559874[_0xa25f('0x2f')];if(_0xace015[_0xa25f('0x31')][_0xa25f('0x40')]){_0x36afe4[_0xa25f('0x41')]=[{'all':!![]}];}_0x36afe4=_[_0xa25f('0x3d')]({},_0x36afe4,_0xace015[_0xa25f('0x3f')]);return db['Cdr'][_0xa25f('0x46')](_0x36afe4)[_0xa25f('0x25')](handleEntityNotFound(_0x320119,null))[_0xa25f('0x25')](respondWithResult(_0x320119,null))[_0xa25f('0x44')](handleError(_0x320119,null));};exports['create']=function(_0x34717c,_0x43888b){return db[_0xa25f('0x2b')]['create'](_0x34717c[_0xa25f('0x47')],{})[_0xa25f('0x25')](respondWithResult(_0x43888b,0xc9))[_0xa25f('0x44')](handleError(_0x43888b,null));};exports[_0xa25f('0x24')]=function(_0x18c9f2,_0x3b6d34){if(_0x18c9f2[_0xa25f('0x47')]['id']){delete _0x18c9f2[_0xa25f('0x47')]['id'];}return db['Cdr'][_0xa25f('0x46')]({'where':{'id':_0x18c9f2[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0x3b6d34,null))[_0xa25f('0x25')](saveUpdates(_0x18c9f2[_0xa25f('0x47')],null))[_0xa25f('0x25')](respondWithResult(_0x3b6d34,null))[_0xa25f('0x44')](handleError(_0x3b6d34,null));};exports[_0xa25f('0x26')]=function(_0x26a096,_0xe04d67){return db[_0xa25f('0x2b')][_0xa25f('0x46')]({'where':{'id':_0x26a096[_0xa25f('0x45')]['id']}})[_0xa25f('0x25')](handleEntityNotFound(_0xe04d67,null))[_0xa25f('0x25')](removeEntity(_0xe04d67,null))[_0xa25f('0x44')](handleError(_0xe04d67,null));};exports[_0xa25f('0x48')]=function(_0x2fedba,_0x32f719){return db[_0xa25f('0x2b')][_0xa25f('0x48')]()[_0xa25f('0x25')](respondWithResult(_0x32f719,null))['catch'](handleError(_0x32f719,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 0873d7e..b0c783b 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x966276,_0x3b1af2){var _0x2e2484=function(_0xc83aaf){while(--_0xc83aaf){_0x966276['push'](_0x966276['shift']());}};_0x2e2484(++_0x3b1af2);}(_0x7a54,0x106));var _0x47a5=function(_0x29d3be,_0x4def49){_0x29d3be=_0x29d3be-0x0;var _0x2a43f9=_0x7a54[_0x29d3be];return _0x2a43f9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x21f011,_0x5d5abe){var _0x23726e=function(_0x1d7176){while(--_0x1d7176){_0x21f011['push'](_0x21f011['shift']());}};_0x23726e(++_0x5d5abe);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 30e97af..60cb8a9 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 _0x3010=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2eb957,_0x14a6a7){var _0x55bd32=function(_0x1e2525){while(--_0x1e2525){_0x2eb957['push'](_0x2eb957['shift']());}};_0x55bd32(++_0x14a6a7);}(_0x3010,0x11a));var _0x0301=function(_0x1e6be2,_0x474f37){_0x1e6be2=_0x1e6be2-0x0;var _0x10b780=_0x3010[_0x1e6be2];return _0x10b780;};'use strict';var _=require(_0x0301('0x0'));var util=require(_0x0301('0x1'));var moment=require(_0x0301('0x2'));var BPromise=require(_0x0301('0x3'));var rs=require(_0x0301('0x4'));var fs=require('fs');var Redis=require(_0x0301('0x5'));var db=require(_0x0301('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0301('0x7'))(_0x0301('0x8'));var config=require(_0x0301('0x9'));var jayson=require(_0x0301('0xa'));var client=jayson[_0x0301('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dfd40,_0x2d8367,_0x1a1ce8){return new BPromise(function(_0x594e1e,_0x7d6dde){return client[_0x0301('0xc')](_0x4dfd40,_0x1a1ce8)['then'](function(_0x2060d9){logger[_0x0301('0xd')](_0x0301('0xe'),_0x2d8367,_0x0301('0xf'));logger['debug'](_0x0301('0x10'),_0x2d8367,'request\x20sent',JSON[_0x0301('0x11')](_0x2060d9));if(_0x2060d9[_0x0301('0x12')]){if(_0x2060d9[_0x0301('0x12')][_0x0301('0x13')]===0x1f4){logger[_0x0301('0x12')](_0x0301('0xe'),_0x2d8367,_0x2060d9[_0x0301('0x12')][_0x0301('0x14')]);return _0x7d6dde(_0x2060d9[_0x0301('0x12')][_0x0301('0x14')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x2d8367,_0x2060d9[_0x0301('0x12')][_0x0301('0x14')]);return _0x594e1e(_0x2060d9[_0x0301('0x12')]['message']);}else{logger['info'](_0x0301('0xe'),_0x2d8367,_0x0301('0xf'));_0x594e1e(_0x2060d9[_0x0301('0x15')][_0x0301('0x14')]);}})[_0x0301('0x16')](function(_0x45569d){logger[_0x0301('0x12')](_0x0301('0xe'),_0x2d8367,_0x45569d);_0x7d6dde(_0x45569d);});});} \ No newline at end of file +var _0x9a7c=['Cdr,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x5d6cb2,_0x21c5da){var _0xc35f37=function(_0x155fa2){while(--_0x155fa2){_0x5d6cb2['push'](_0x5d6cb2['shift']());}};_0xc35f37(++_0x21c5da);}(_0x9a7c,0x1c9));var _0xc9a7=function(_0x14330e,_0x3676f9){_0x14330e=_0x14330e-0x0;var _0x2d9ae0=_0x9a7c[_0x14330e];return _0x2d9ae0;};'use strict';var _=require(_0xc9a7('0x0'));var util=require(_0xc9a7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9a7('0x2'));var db=require(_0xc9a7('0x3'))['db'];var utils=require(_0xc9a7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc9a7('0x5'));var jayson=require(_0xc9a7('0x6'));var client=jayson[_0xc9a7('0x7')][_0xc9a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x118aa0,_0x342261,_0x1e0bf8){return new BPromise(function(_0x2a912e,_0x270a7b){return client[_0xc9a7('0x9')](_0x118aa0,_0x1e0bf8)['then'](function(_0x33ff5c){logger[_0xc9a7('0xa')](_0xc9a7('0xb'),_0x342261,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x342261,_0xc9a7('0xc'),JSON['stringify'](_0x33ff5c));if(_0x33ff5c[_0xc9a7('0xd')]){if(_0x33ff5c[_0xc9a7('0xd')][_0xc9a7('0xe')]===0x1f4){logger[_0xc9a7('0xd')](_0xc9a7('0xb'),_0x342261,_0x33ff5c[_0xc9a7('0xd')][_0xc9a7('0xf')]);return _0x270a7b(_0x33ff5c[_0xc9a7('0xd')][_0xc9a7('0xf')]);}logger[_0xc9a7('0xd')](_0xc9a7('0xb'),_0x342261,_0x33ff5c[_0xc9a7('0xd')][_0xc9a7('0xf')]);return _0x2a912e(_0x33ff5c['error'][_0xc9a7('0xf')]);}else{logger[_0xc9a7('0xa')]('Cdr,\x20%s,\x20%s',_0x342261,'request\x20sent');_0x2a912e(_0x33ff5c[_0xc9a7('0x10')][_0xc9a7('0xf')]);}})[_0xc9a7('0x11')](function(_0x47e6c0){logger[_0xc9a7('0xd')](_0xc9a7('0xb'),_0x342261,_0x47e6c0);_0x270a7b(_0x47e6c0);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d918918..b9c8e9a 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3e8cae,_0x4cb96a){var _0x45c4d6=function(_0x4bf3a5){while(--_0x4bf3a5){_0x3e8cae['push'](_0x3e8cae['shift']());}};_0x45c4d6(++_0x4cb96a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 47b38a2..e4718d4 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 _0x3014=['*,*,*,*','exports','noop','TEXT','STRING'];(function(_0x2bcad8,_0x389150){var _0x2f9ef1=function(_0xb25e40){while(--_0xb25e40){_0x2bcad8['push'](_0x2bcad8['shift']());}};_0x2f9ef1(++_0x389150);}(_0x3014,0xec));var _0x4301=function(_0x256a92,_0x3e7c86){_0x256a92=_0x256a92-0x0;var _0x6a693a=_0x3014[_0x256a92];return _0x6a693a;};'use strict';var Sequelize=require('sequelize');module[_0x4301('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4301('0x1')},'appdata':{'type':Sequelize[_0x4301('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4301('0x3')],'defaultValue':_0x4301('0x4')}}; \ No newline at end of file +var _0x83e8=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0xccc06b,_0x2782db){var _0x2cc767=function(_0x199f94){while(--_0x199f94){_0xccc06b['push'](_0xccc06b['shift']());}};_0x2cc767(++_0x2782db);}(_0x83e8,0xf6));var _0x883e=function(_0x25b615,_0x352d83){_0x25b615=_0x25b615-0x0;var _0x50b01b=_0x83e8[_0x25b615];return _0x50b01b;};'use strict';var Sequelize=require(_0x883e('0x0'));module[_0x883e('0x1')]={'priority':{'type':Sequelize[_0x883e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x883e('0x3')],'allowNull':![],'defaultValue':_0x883e('0x4')},'appdata':{'type':Sequelize[_0x883e('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 0ae3ab6..414bca8 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 _0xaa1b=['bluebird','mustache','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','params','model','ChatApplication','query','keys','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','request-promise'];(function(_0x276842,_0x12380e){var _0x560e9c=function(_0x1e8bd1){while(--_0x1e8bd1){_0x276842['push'](_0x276842['shift']());}};_0x560e9c(++_0x12380e);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbaa1('0x0'));var rimraf=require(_0xbaa1('0x1'));var zipdir=require(_0xbaa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbaa1('0x3'));var moment=require('moment');var BPromise=require(_0xbaa1('0x4'));var Mustache=require(_0xbaa1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbaa1('0x6'));var ejs=require(_0xbaa1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaa1('0x8'));var squel=require('squel');var crypto=require(_0xbaa1('0x9'));var jsforce=require(_0xbaa1('0xa'));var deskjs=require(_0xbaa1('0xb'));var toCsv=require(_0xbaa1('0x6'));var querystring=require(_0xbaa1('0xc'));var Papa=require(_0xbaa1('0xd'));var Redis=require('ioredis');var authService=require(_0xbaa1('0xe'));var qs=require(_0xbaa1('0xf'));var as=require(_0xbaa1('0x10'));var hardwareService=require(_0xbaa1('0x11'));var logger=require(_0xbaa1('0x12'))(_0xbaa1('0x13'));var utils=require(_0xbaa1('0x14'));var config=require(_0xbaa1('0x15'));var licenseUtil=require(_0xbaa1('0x16'));var db=require(_0xbaa1('0x17'))['db'];function respondWithStatusCode(_0x8ce72d,_0x1376c6){_0x1376c6=_0x1376c6||0xcc;return function(_0x5064a4){if(_0x5064a4){return _0x8ce72d['sendStatus'](_0x1376c6);}return _0x8ce72d['status'](_0x1376c6)['end']();};}function respondWithResult(_0x2184ab,_0x388cfd){_0x388cfd=_0x388cfd||0xc8;return function(_0x3bfbcc){if(_0x3bfbcc){return _0x2184ab[_0xbaa1('0x18')](_0x388cfd)[_0xbaa1('0x19')](_0x3bfbcc);}};}function respondWithFilteredResult(_0x2e7db5,_0x30f191){return function(_0xdbaa8b){if(_0xdbaa8b){var _0x35a3fd=typeof _0x30f191[_0xbaa1('0x1a')]===_0xbaa1('0x1b')&&typeof _0x30f191[_0xbaa1('0x1c')]===_0xbaa1('0x1b');var _0x16725c=_0xdbaa8b[_0xbaa1('0x1d')];var _0x155a16=_0x35a3fd?0x0:_0x30f191[_0xbaa1('0x1a')];var _0x200f01=_0x35a3fd?_0xdbaa8b[_0xbaa1('0x1d')]:_0x30f191['offset']+_0x30f191[_0xbaa1('0x1c')];var _0x3e3f4a;if(_0x200f01>=_0x16725c){_0x200f01=_0x16725c;_0x3e3f4a=0xc8;}else{_0x3e3f4a=0xce;}_0x2e7db5[_0xbaa1('0x18')](_0x3e3f4a);return _0x2e7db5[_0xbaa1('0x1e')](_0xbaa1('0x1f'),_0x155a16+'-'+_0x200f01+'/'+_0x16725c)[_0xbaa1('0x19')](_0xdbaa8b);}return null;};}function patchUpdates(_0x5c2115){return function(_0x1c587c){try{jsonpatch[_0xbaa1('0x20')](_0x1c587c,_0x5c2115,!![]);}catch(_0x1c38f3){return BPromise[_0xbaa1('0x21')](_0x1c38f3);}return _0x1c587c[_0xbaa1('0x22')]();};}function saveUpdates(_0x5a7d21,_0x4e4a0c){return function(_0x2b01ec){if(_0x2b01ec){return _0x2b01ec[_0xbaa1('0x23')](_0x5a7d21)[_0xbaa1('0x24')](function(_0x34946c){return _0x34946c;});}return null;};}function removeEntity(_0x117079,_0x113bbd){return function(_0x4806e7){if(_0x4806e7){return _0x4806e7[_0xbaa1('0x25')]()[_0xbaa1('0x24')](function(){_0x117079[_0xbaa1('0x18')](0xcc)[_0xbaa1('0x26')]();});}};}function handleEntityNotFound(_0x1204f4,_0x2a56ad){return function(_0x39e3ce){if(!_0x39e3ce){_0x1204f4[_0xbaa1('0x27')](0x194);}return _0x39e3ce;};}function handleError(_0x5f913f,_0x58d85d){_0x58d85d=_0x58d85d||0x1f4;return function(_0x2b80a4){logger[_0xbaa1('0x28')](_0x2b80a4[_0xbaa1('0x29')]);if(_0x2b80a4[_0xbaa1('0x2a')]){delete _0x2b80a4[_0xbaa1('0x2a')];}_0x5f913f[_0xbaa1('0x18')](_0x58d85d)['send'](_0x2b80a4);};}exports['show']=function(_0x18b6d6,_0x1e1869){var _0x270759={'raw':!![],'where':{'id':_0x18b6d6[_0xbaa1('0x2b')]['id']}},_0x48cbc0={};_0x48cbc0[_0xbaa1('0x2c')]=_['keys'](db[_0xbaa1('0x2d')]['rawAttributes']);_0x48cbc0[_0xbaa1('0x2e')]=_[_0xbaa1('0x2f')](_0x18b6d6[_0xbaa1('0x2e')]);_0x48cbc0['filters']=_['intersection'](_0x48cbc0[_0xbaa1('0x2c')],_0x48cbc0[_0xbaa1('0x2e')]);_0x270759[_0xbaa1('0x30')]=_[_0xbaa1('0x31')](_0x48cbc0[_0xbaa1('0x2c')],qs[_0xbaa1('0x32')](_0x18b6d6['query'][_0xbaa1('0x32')]));_0x270759[_0xbaa1('0x30')]=_0x270759[_0xbaa1('0x30')][_0xbaa1('0x33')]?_0x270759['attributes']:_0x48cbc0[_0xbaa1('0x2c')];if(_0x18b6d6['query'][_0xbaa1('0x34')]){_0x270759[_0xbaa1('0x35')]=[{'all':!![]}];}_0x270759=_[_0xbaa1('0x36')]({},_0x270759,_0x18b6d6[_0xbaa1('0x37')]);return db['ChatApplication'][_0xbaa1('0x38')](_0x270759)[_0xbaa1('0x24')](handleEntityNotFound(_0x1e1869,null))[_0xbaa1('0x24')](respondWithResult(_0x1e1869,null))['catch'](handleError(_0x1e1869,null));};exports[_0xbaa1('0x23')]=function(_0x446695,_0x5e093e){if(_0x446695[_0xbaa1('0x39')]['id']){delete _0x446695[_0xbaa1('0x39')]['id'];}return db[_0xbaa1('0x2d')]['find']({'where':{'id':_0x446695[_0xbaa1('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5e093e,null))['then'](saveUpdates(_0x446695[_0xbaa1('0x39')],null))['then'](respondWithResult(_0x5e093e,null))[_0xbaa1('0x3a')](handleError(_0x5e093e,null));};exports[_0xbaa1('0x25')]=function(_0x42804c,_0x4f6a48){return db[_0xbaa1('0x2d')][_0xbaa1('0x38')]({'where':{'id':_0x42804c['params']['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x4f6a48,null))[_0xbaa1('0x24')](removeEntity(_0x4f6a48,null))[_0xbaa1('0x3a')](handleError(_0x4f6a48,null));}; \ No newline at end of file +var _0x590a=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','ChatApplication','catch','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs'];(function(_0x417396,_0x1d6a2a){var _0x468d5=function(_0x132959){while(--_0x132959){_0x417396['push'](_0x417396['shift']());}};_0x468d5(++_0x1d6a2a);}(_0x590a,0x159));var _0xa590=function(_0xe64b4d,_0x4a4184){_0xe64b4d=_0xe64b4d-0x0;var _0x4ae5df=_0x590a[_0xe64b4d];return _0x4ae5df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa590('0x0'));var zipdir=require(_0xa590('0x1'));var jsonpatch=require(_0xa590('0x2'));var rp=require(_0xa590('0x3'));var moment=require(_0xa590('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa590('0x5'));var path=require(_0xa590('0x6'));var sox=require(_0xa590('0x7'));var csv=require('to-csv');var ejs=require(_0xa590('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa590('0x9'));var squel=require(_0xa590('0xa'));var crypto=require(_0xa590('0xb'));var jsforce=require(_0xa590('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa590('0xd'));var Papa=require('papaparse');var Redis=require(_0xa590('0xe'));var authService=require(_0xa590('0xf'));var qs=require(_0xa590('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa590('0x11'));var logger=require(_0xa590('0x12'))(_0xa590('0x13'));var utils=require(_0xa590('0x14'));var config=require(_0xa590('0x15'));var licenseUtil=require(_0xa590('0x16'));var db=require(_0xa590('0x17'))['db'];function respondWithStatusCode(_0x570b51,_0x5bc467){_0x5bc467=_0x5bc467||0xcc;return function(_0x252e2b){if(_0x252e2b){return _0x570b51[_0xa590('0x18')](_0x5bc467);}return _0x570b51[_0xa590('0x19')](_0x5bc467)[_0xa590('0x1a')]();};}function respondWithResult(_0x52656c,_0xdf68af){_0xdf68af=_0xdf68af||0xc8;return function(_0x3c1fee){if(_0x3c1fee){return _0x52656c['status'](_0xdf68af)['json'](_0x3c1fee);}};}function respondWithFilteredResult(_0x2954af,_0x5ec6e2){return function(_0x165b81){if(_0x165b81){var _0x6ca5c8=typeof _0x5ec6e2[_0xa590('0x1b')]===_0xa590('0x1c')&&typeof _0x5ec6e2[_0xa590('0x1d')]===_0xa590('0x1c');var _0xdfc78a=_0x165b81[_0xa590('0x1e')];var _0x4f4075=_0x6ca5c8?0x0:_0x5ec6e2[_0xa590('0x1b')];var _0x203812=_0x6ca5c8?_0x165b81[_0xa590('0x1e')]:_0x5ec6e2[_0xa590('0x1b')]+_0x5ec6e2[_0xa590('0x1d')];var _0x352bf6;if(_0x203812>=_0xdfc78a){_0x203812=_0xdfc78a;_0x352bf6=0xc8;}else{_0x352bf6=0xce;}_0x2954af[_0xa590('0x19')](_0x352bf6);return _0x2954af[_0xa590('0x1f')](_0xa590('0x20'),_0x4f4075+'-'+_0x203812+'/'+_0xdfc78a)[_0xa590('0x21')](_0x165b81);}return null;};}function patchUpdates(_0x12eaec){return function(_0x23381b){try{jsonpatch[_0xa590('0x22')](_0x23381b,_0x12eaec,!![]);}catch(_0x544a16){return BPromise[_0xa590('0x23')](_0x544a16);}return _0x23381b[_0xa590('0x24')]();};}function saveUpdates(_0x47d5f4,_0x489a13){return function(_0x2ccb4e){if(_0x2ccb4e){return _0x2ccb4e[_0xa590('0x25')](_0x47d5f4)[_0xa590('0x26')](function(_0x20dfa3){return _0x20dfa3;});}return null;};}function removeEntity(_0x24d901,_0x4d63e2){return function(_0x1805d8){if(_0x1805d8){return _0x1805d8[_0xa590('0x27')]()[_0xa590('0x26')](function(){_0x24d901[_0xa590('0x19')](0xcc)[_0xa590('0x1a')]();});}};}function handleEntityNotFound(_0x457a32,_0x5a1396){return function(_0x3a9c51){if(!_0x3a9c51){_0x457a32['sendStatus'](0x194);}return _0x3a9c51;};}function handleError(_0x30fd90,_0x41bd71){_0x41bd71=_0x41bd71||0x1f4;return function(_0x46f7dd){logger['error'](_0x46f7dd[_0xa590('0x28')]);if(_0x46f7dd[_0xa590('0x29')]){delete _0x46f7dd[_0xa590('0x29')];}_0x30fd90[_0xa590('0x19')](_0x41bd71)['send'](_0x46f7dd);};}exports['show']=function(_0x2b2f38,_0x391f8c){var _0x6928e4={'raw':!![],'where':{'id':_0x2b2f38[_0xa590('0x2a')]['id']}},_0x115e45={};_0x115e45[_0xa590('0x2b')]=_[_0xa590('0x2c')](db['ChatApplication'][_0xa590('0x2d')]);_0x115e45[_0xa590('0x2e')]=_[_0xa590('0x2c')](_0x2b2f38[_0xa590('0x2e')]);_0x115e45[_0xa590('0x2f')]=_[_0xa590('0x30')](_0x115e45['model'],_0x115e45['query']);_0x6928e4['attributes']=_[_0xa590('0x30')](_0x115e45['model'],qs['fields'](_0x2b2f38[_0xa590('0x2e')][_0xa590('0x31')]));_0x6928e4[_0xa590('0x32')]=_0x6928e4[_0xa590('0x32')]['length']?_0x6928e4[_0xa590('0x32')]:_0x115e45[_0xa590('0x2b')];if(_0x2b2f38['query'][_0xa590('0x33')]){_0x6928e4[_0xa590('0x34')]=[{'all':!![]}];}_0x6928e4=_[_0xa590('0x35')]({},_0x6928e4,_0x2b2f38[_0xa590('0x36')]);return db[_0xa590('0x37')]['find'](_0x6928e4)[_0xa590('0x26')](handleEntityNotFound(_0x391f8c,null))['then'](respondWithResult(_0x391f8c,null))[_0xa590('0x38')](handleError(_0x391f8c,null));};exports[_0xa590('0x25')]=function(_0x6278bd,_0x424751){if(_0x6278bd['body']['id']){delete _0x6278bd[_0xa590('0x39')]['id'];}return db[_0xa590('0x37')][_0xa590('0x3a')]({'where':{'id':_0x6278bd[_0xa590('0x2a')]['id']}})[_0xa590('0x26')](handleEntityNotFound(_0x424751,null))[_0xa590('0x26')](saveUpdates(_0x6278bd['body'],null))[_0xa590('0x26')](respondWithResult(_0x424751,null))[_0xa590('0x38')](handleError(_0x424751,null));};exports[_0xa590('0x27')]=function(_0x3cee4c,_0x2677ff){return db[_0xa590('0x37')][_0xa590('0x3a')]({'where':{'id':_0x3cee4c[_0xa590('0x2a')]['id']}})[_0xa590('0x26')](handleEntityNotFound(_0x2677ff,null))[_0xa590('0x26')](removeEntity(_0x2677ff,null))[_0xa590('0x38')](handleError(_0x2677ff,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 22a735c..bfe0c12 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 _0x04f1=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x04f1,0xc1));var _0x104f=function(_0xeac319,_0x58f835){_0xeac319=_0xeac319-0x0;var _0x1a52b0=_0x04f1[_0xeac319];return _0x1a52b0;};'use strict';var _=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var logger=require(_0x104f('0x2'))(_0x104f('0x3'));var moment=require(_0x104f('0x4'));var BPromise=require(_0x104f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x104f('0x6'));var rimraf=require(_0x104f('0x7'));var config=require(_0x104f('0x8'));var attributes=require(_0x104f('0x9'));module['exports']=function(_0x347f10,_0x51cffa){return _0x347f10[_0x104f('0xa')](_0x104f('0xb'),attributes,{'tableName':_0x104f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x104f('0xd'),'collate':_0x104f('0xe')});}; \ No newline at end of file +var _0x6f2a=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','lodash','../../config/logger','api','moment'];(function(_0x3b2311,_0x2ec149){var _0x13315f=function(_0x22a930){while(--_0x22a930){_0x3b2311['push'](_0x3b2311['shift']());}};_0x13315f(++_0x2ec149);}(_0x6f2a,0x1e0));var _0xa6f2=function(_0x4e4a34,_0x4a0b0f){_0x4e4a34=_0x4e4a34-0x0;var _0x38261a=_0x6f2a[_0x4e4a34];return _0x38261a;};'use strict';var _=require(_0xa6f2('0x0'));var util=require('util');var logger=require(_0xa6f2('0x1'))(_0xa6f2('0x2'));var moment=require(_0xa6f2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f2('0x4'));var rimraf=require(_0xa6f2('0x5'));var config=require(_0xa6f2('0x6'));var attributes=require(_0xa6f2('0x7'));module[_0xa6f2('0x8')]=function(_0x953046,_0x17e952){return _0x953046[_0xa6f2('0x9')](_0xa6f2('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index b9bb96d..77c2235 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 _0xba5e=['request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x114b0f,_0x32c280){var _0x54bec6=function(_0x565f67){while(--_0x565f67){_0x114b0f['push'](_0x114b0f['shift']());}};_0x54bec6(++_0x32c280);}(_0xba5e,0x8e));var _0xeba5=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xba5e[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xeba5('0x0'));var util=require(_0xeba5('0x1'));var moment=require(_0xeba5('0x2'));var BPromise=require(_0xeba5('0x3'));var rs=require(_0xeba5('0x4'));var fs=require('fs');var Redis=require(_0xeba5('0x5'));var db=require(_0xeba5('0x6'))['db'];var utils=require(_0xeba5('0x7'));var logger=require(_0xeba5('0x8'))(_0xeba5('0x9'));var config=require('../../config/environment');var jayson=require(_0xeba5('0xa'));var client=jayson[_0xeba5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5628c8,_0x247488,_0x590fd4){return new BPromise(function(_0x16f0b2,_0x56f52d){return client[_0xeba5('0xc')](_0x5628c8,_0x590fd4)[_0xeba5('0xd')](function(_0x2befcb){logger['info'](_0xeba5('0xe'),_0x247488,_0xeba5('0xf'));logger[_0xeba5('0x10')](_0xeba5('0x11'),_0x247488,'request\x20sent',JSON[_0xeba5('0x12')](_0x2befcb));if(_0x2befcb['error']){if(_0x2befcb[_0xeba5('0x13')][_0xeba5('0x14')]===0x1f4){logger[_0xeba5('0x13')](_0xeba5('0xe'),_0x247488,_0x2befcb[_0xeba5('0x13')]['message']);return _0x56f52d(_0x2befcb[_0xeba5('0x13')][_0xeba5('0x15')]);}logger[_0xeba5('0x13')](_0xeba5('0xe'),_0x247488,_0x2befcb['error'][_0xeba5('0x15')]);return _0x16f0b2(_0x2befcb[_0xeba5('0x13')][_0xeba5('0x15')]);}else{logger['info'](_0xeba5('0xe'),_0x247488,'request\x20sent');_0x16f0b2(_0x2befcb['result']['message']);}})['catch'](function(_0x4ba003){logger[_0xeba5('0x13')](_0xeba5('0xe'),_0x247488,_0x4ba003);_0x56f52d(_0x4ba003);});});} \ No newline at end of file +var _0xcef1=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x59edfb,_0x3afa07){var _0x85566c=function(_0x16a975){while(--_0x16a975){_0x59edfb['push'](_0x59edfb['shift']());}};_0x85566c(++_0x3afa07);}(_0xcef1,0xaf));var _0x1cef=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcef1[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x1cef('0x0'));var util=require(_0x1cef('0x1'));var moment=require(_0x1cef('0x2'));var BPromise=require(_0x1cef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cef('0x4'))['db'];var utils=require(_0x1cef('0x5'));var logger=require(_0x1cef('0x6'))(_0x1cef('0x7'));var config=require(_0x1cef('0x8'));var jayson=require(_0x1cef('0x9'));var client=jayson[_0x1cef('0xa')][_0x1cef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31c980,_0x4667d4,_0x3d1979){return new BPromise(function(_0x43a938,_0x1865b5){return client[_0x1cef('0xc')](_0x31c980,_0x3d1979)[_0x1cef('0xd')](function(_0x35408e){logger[_0x1cef('0xe')](_0x1cef('0xf'),_0x4667d4,_0x1cef('0x10'));logger[_0x1cef('0x11')](_0x1cef('0x12'),_0x4667d4,'request\x20sent',JSON['stringify'](_0x35408e));if(_0x35408e[_0x1cef('0x13')]){if(_0x35408e['error'][_0x1cef('0x14')]===0x1f4){logger[_0x1cef('0x13')]('ChatApplication,\x20%s,\x20%s',_0x4667d4,_0x35408e['error'][_0x1cef('0x15')]);return _0x1865b5(_0x35408e[_0x1cef('0x13')][_0x1cef('0x15')]);}logger[_0x1cef('0x13')](_0x1cef('0xf'),_0x4667d4,_0x35408e['error'][_0x1cef('0x15')]);return _0x43a938(_0x35408e['error'][_0x1cef('0x15')]);}else{logger[_0x1cef('0xe')](_0x1cef('0xf'),_0x4667d4,'request\x20sent');_0x43a938(_0x35408e[_0x1cef('0x16')][_0x1cef('0x15')]);}})[_0x1cef('0x17')](function(_0x4abdf0){logger[_0x1cef('0x13')](_0x1cef('0xf'),_0x4667d4,_0x4abdf0);_0x1865b5(_0x4abdf0);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index fa7a474..cf1b0b1 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 _0x47f1=['delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put'];(function(_0x55a8a6,_0xb8292b){var _0x3cdc46=function(_0x28ffda){while(--_0x28ffda){_0x55a8a6['push'](_0x55a8a6['shift']());}};_0x3cdc46(++_0xb8292b);}(_0x47f1,0x14c));var _0x147f=function(_0x29e3e9,_0x389fec){_0x29e3e9=_0x29e3e9-0x0;var _0x26948a=_0x47f1[_0x29e3e9];return _0x26948a;};'use strict';var multer=require('multer');var util=require(_0x147f('0x0'));var path=require('path');var timeout=require(_0x147f('0x1'));var express=require(_0x147f('0x2'));var router=express[_0x147f('0x3')]();var fs_extra=require(_0x147f('0x4'));var auth=require(_0x147f('0x5'));var interaction=require(_0x147f('0x6'));var config=require(_0x147f('0x7'));var controller=require(_0x147f('0x8'));router['get'](_0x147f('0x9'),auth[_0x147f('0xa')](),controller[_0x147f('0xb')]);router[_0x147f('0xc')](_0x147f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x147f('0xd')](_0x147f('0x9'),auth['isAuthenticated'](),controller[_0x147f('0xe')]);module['exports']=router; \ No newline at end of file +var _0xda61=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','update','delete','/:id','exports','path','express','Router'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xda61,0xc0));var _0x1da6=function(_0x4c612c,_0xdeae64){_0x4c612c=_0x4c612c-0x0;var _0x121746=_0xda61[_0x4c612c];return _0x121746;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1da6('0x0'));var timeout=require('connect-timeout');var express=require(_0x1da6('0x1'));var router=express[_0x1da6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1da6('0x3'));var interaction=require(_0x1da6('0x4'));var config=require(_0x1da6('0x5'));var controller=require(_0x1da6('0x6'));router[_0x1da6('0x7')]('/:id',auth[_0x1da6('0x8')](),controller[_0x1da6('0x9')]);router[_0x1da6('0xa')]('/:id',auth[_0x1da6('0x8')](),controller[_0x1da6('0xb')]);router[_0x1da6('0xc')](_0x1da6('0xd'),auth[_0x1da6('0x8')](),controller['destroy']);module[_0x1da6('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 3cbb8b5..8d048f5 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 _0xd61c=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xd61c,0xb1));var _0xcd61=function(_0x34098d,_0x333906){_0x34098d=_0x34098d-0x0;var _0x3fea60=_0xd61c[_0x34098d];return _0x3fea60;};'use strict';var Sequelize=require(_0xcd61('0x0'));module[_0xcd61('0x1')]={'name':{'type':Sequelize[_0xcd61('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xcd61('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x624d=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x624d,0xbc));var _0xd624=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x624d[_0x99ff94];return _0x1b5bc0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd624('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xd624('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index e55d36b..51df1e7 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 _0xf38e=['where','merge','options','ChatGroup','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','intersection','find','create','body','params','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','pick','removeMembers','addMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x5e8b46,_0x21eb4a){var _0x252814=function(_0x327288){while(--_0x327288){_0x5e8b46['push'](_0x5e8b46['shift']());}};_0x252814(++_0x21eb4a);}(_0xf38e,0x13d));var _0xef38=function(_0x548cee,_0x2f4bcf){_0x548cee=_0x548cee-0x0;var _0x34f700=_0xf38e[_0x548cee];return _0x34f700;};'use strict';var emlformat=require(_0xef38('0x0'));var rimraf=require(_0xef38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef38('0x2'));var rp=require(_0xef38('0x3'));var moment=require(_0xef38('0x4'));var BPromise=require(_0xef38('0x5'));var Mustache=require('mustache');var util=require(_0xef38('0x6'));var path=require(_0xef38('0x7'));var sox=require('sox');var csv=require(_0xef38('0x8'));var ejs=require(_0xef38('0x9'));var fs=require('fs');var fs_extra=require(_0xef38('0xa'));var _=require(_0xef38('0xb'));var squel=require(_0xef38('0xc'));var crypto=require(_0xef38('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xef38('0xe'));var toCsv=require(_0xef38('0x8'));var querystring=require(_0xef38('0xf'));var Papa=require('papaparse');var Redis=require(_0xef38('0x10'));var authService=require(_0xef38('0x11'));var qs=require(_0xef38('0x12'));var as=require(_0xef38('0x13'));var hardwareService=require(_0xef38('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xef38('0x15'));var licenseUtil=require(_0xef38('0x16'));var db=require(_0xef38('0x17'))['db'];config[_0xef38('0x18')]=_[_0xef38('0x19')](config[_0xef38('0x18')],{'host':_0xef38('0x1a'),'port':0x18eb});var socket=require(_0xef38('0x1b'))(new Redis(config[_0xef38('0x18')]));require(_0xef38('0x1c'))[_0xef38('0x1d')](socket);function respondWithStatusCode(_0x5cdc63,_0x2c6039){_0x2c6039=_0x2c6039||0xcc;return function(_0x5dab5f){if(_0x5dab5f){return _0x5cdc63[_0xef38('0x1e')](_0x2c6039);}return _0x5cdc63[_0xef38('0x1f')](_0x2c6039)[_0xef38('0x20')]();};}function respondWithResult(_0xa5068,_0x518939){_0x518939=_0x518939||0xc8;return function(_0x2c1852){if(_0x2c1852){return _0xa5068['status'](_0x518939)[_0xef38('0x21')](_0x2c1852);}};}function respondWithFilteredResult(_0x3ad1ad,_0x957de){return function(_0x499008){if(_0x499008){var _0x5c6fc8=typeof _0x957de[_0xef38('0x22')]===_0xef38('0x23')&&typeof _0x957de[_0xef38('0x24')]===_0xef38('0x23');var _0x31b41d=_0x499008[_0xef38('0x25')];var _0x5d1c25=_0x5c6fc8?0x0:_0x957de[_0xef38('0x22')];var _0x1c23e3=_0x5c6fc8?_0x499008[_0xef38('0x25')]:_0x957de[_0xef38('0x22')]+_0x957de['limit'];var _0x45adaa;if(_0x1c23e3>=_0x31b41d){_0x1c23e3=_0x31b41d;_0x45adaa=0xc8;}else{_0x45adaa=0xce;}_0x3ad1ad[_0xef38('0x1f')](_0x45adaa);return _0x3ad1ad['set'](_0xef38('0x26'),_0x5d1c25+'-'+_0x1c23e3+'/'+_0x31b41d)[_0xef38('0x21')](_0x499008);}return null;};}function patchUpdates(_0x32b276){return function(_0x50ac30){try{jsonpatch['apply'](_0x50ac30,_0x32b276,!![]);}catch(_0x41ff11){return BPromise[_0xef38('0x27')](_0x41ff11);}return _0x50ac30[_0xef38('0x28')]();};}function saveUpdates(_0x5b308e,_0x13ca96){return function(_0x5c0661){if(_0x5c0661){return _0x5c0661[_0xef38('0x29')](_0x5b308e)[_0xef38('0x2a')](function(_0x149978){return _0x149978;});}return null;};}function removeEntity(_0x4cdda4,_0x551df9){return function(_0x4e6f9c){if(_0x4e6f9c){return _0x4e6f9c[_0xef38('0x2b')]()[_0xef38('0x2a')](function(){_0x4cdda4['status'](0xcc)[_0xef38('0x20')]();});}};}function handleEntityNotFound(_0x445c92,_0x221fb9){return function(_0xab51ea){if(!_0xab51ea){_0x445c92[_0xef38('0x1e')](0x194);}return _0xab51ea;};}function handleError(_0x51eed4,_0xe15b3){_0xe15b3=_0xe15b3||0x1f4;return function(_0x3e69b8){logger[_0xef38('0x2c')](_0x3e69b8[_0xef38('0x2d')]);if(_0x3e69b8[_0xef38('0x2e')]){delete _0x3e69b8[_0xef38('0x2e')];}_0x51eed4[_0xef38('0x1f')](_0xe15b3)[_0xef38('0x2f')](_0x3e69b8);};}exports[_0xef38('0x30')]=function(_0x5e3f4a,_0x26220a){var _0x52aeae={},_0x4ffa05={},_0x241f7a={'count':0x0,'rows':[]};var _0x27bd24=_['map'](db['ChatGroup']['rawAttributes'],function(_0x73ca96){return{'name':_0x73ca96[_0xef38('0x31')],'type':_0x73ca96[_0xef38('0x32')]['key']};});_0x4ffa05[_0xef38('0x33')]=_[_0xef38('0x34')](_0x27bd24,_0xef38('0x2e'));_0x4ffa05[_0xef38('0x35')]=_['keys'](_0x5e3f4a['query']);_0x4ffa05[_0xef38('0x36')]=_['intersection'](_0x4ffa05[_0xef38('0x33')],_0x4ffa05['query']);_0x52aeae[_0xef38('0x37')]=_['intersection'](_0x4ffa05[_0xef38('0x33')],qs['fields'](_0x5e3f4a[_0xef38('0x35')][_0xef38('0x38')]));_0x52aeae['attributes']=_0x52aeae['attributes'][_0xef38('0x39')]?_0x52aeae[_0xef38('0x37')]:_0x4ffa05[_0xef38('0x33')];if(!_0x5e3f4a['query'][_0xef38('0x3a')](_0xef38('0x3b'))){_0x52aeae['limit']=qs[_0xef38('0x24')](_0x5e3f4a[_0xef38('0x35')][_0xef38('0x24')]);_0x52aeae['offset']=qs['offset'](_0x5e3f4a[_0xef38('0x35')][_0xef38('0x22')]);}_0x52aeae[_0xef38('0x3c')]=qs[_0xef38('0x3d')](_0x5e3f4a[_0xef38('0x35')][_0xef38('0x3d')]);_0x52aeae['where']=qs['filters'](_['pick'](_0x5e3f4a[_0xef38('0x35')],_0x4ffa05['filters']),_0x27bd24);if(_0x5e3f4a[_0xef38('0x35')][_0xef38('0x3e')]){_0x52aeae[_0xef38('0x3f')]=_[_0xef38('0x40')](_0x52aeae[_0xef38('0x3f')],{'$or':_[_0xef38('0x34')](_0x27bd24,function(_0x23d254){if(_0x23d254[_0xef38('0x32')]!=='VIRTUAL'){var _0x1bb142={};_0x1bb142[_0x23d254[_0xef38('0x2e')]]={'$like':'%'+_0x5e3f4a[_0xef38('0x35')]['filter']+'%'};return _0x1bb142;}})});}_0x52aeae=_[_0xef38('0x40')]({},_0x52aeae,_0x5e3f4a[_0xef38('0x41')]);var _0x1c8bf9={'where':_0x52aeae[_0xef38('0x3f')]};return db[_0xef38('0x42')][_0xef38('0x25')](_0x1c8bf9)[_0xef38('0x2a')](function(_0x145654){_0x241f7a[_0xef38('0x25')]=_0x145654;if(_0x5e3f4a['query'][_0xef38('0x43')]){_0x52aeae[_0xef38('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0xef38('0x45')](_0x52aeae);})[_0xef38('0x2a')](function(_0x59441b){_0x241f7a[_0xef38('0x46')]=_0x59441b;return _0x241f7a;})[_0xef38('0x2a')](respondWithFilteredResult(_0x26220a,_0x52aeae))[_0xef38('0x47')](handleError(_0x26220a,null));};exports[_0xef38('0x48')]=function(_0x839b69,_0x1fc70e){var _0x38c34a={'raw':!![],'where':{'id':_0x839b69['params']['id']}},_0x4a066f={};_0x4a066f['model']=_['keys'](db[_0xef38('0x42')][_0xef38('0x49')]);_0x4a066f[_0xef38('0x35')]=_[_0xef38('0x4a')](_0x839b69['query']);_0x4a066f['filters']=_[_0xef38('0x4b')](_0x4a066f[_0xef38('0x33')],_0x4a066f[_0xef38('0x35')]);_0x38c34a[_0xef38('0x37')]=_[_0xef38('0x4b')](_0x4a066f[_0xef38('0x33')],qs[_0xef38('0x38')](_0x839b69[_0xef38('0x35')][_0xef38('0x38')]));_0x38c34a[_0xef38('0x37')]=_0x38c34a[_0xef38('0x37')][_0xef38('0x39')]?_0x38c34a['attributes']:_0x4a066f[_0xef38('0x33')];if(_0x839b69['query'][_0xef38('0x43')]){_0x38c34a[_0xef38('0x44')]=[{'all':!![]}];}_0x38c34a=_[_0xef38('0x40')]({},_0x38c34a,_0x839b69['options']);return db['ChatGroup'][_0xef38('0x4c')](_0x38c34a)[_0xef38('0x2a')](handleEntityNotFound(_0x1fc70e,null))[_0xef38('0x2a')](respondWithResult(_0x1fc70e,null))[_0xef38('0x47')](handleError(_0x1fc70e,null));};exports[_0xef38('0x4d')]=function(_0x1dba90,_0x1fd4be){return db[_0xef38('0x42')][_0xef38('0x4d')](_0x1dba90[_0xef38('0x4e')],{})[_0xef38('0x2a')](respondWithResult(_0x1fd4be,0xc9))[_0xef38('0x47')](handleError(_0x1fd4be,null));};exports[_0xef38('0x29')]=function(_0x1407fc,_0x21b035){if(_0x1407fc[_0xef38('0x4e')]['id']){delete _0x1407fc[_0xef38('0x4e')]['id'];}return db[_0xef38('0x42')]['find']({'where':{'id':_0x1407fc[_0xef38('0x4f')]['id']}})[_0xef38('0x2a')](handleEntityNotFound(_0x21b035,null))['then'](saveUpdates(_0x1407fc['body'],null))[_0xef38('0x2a')](respondWithResult(_0x21b035,null))[_0xef38('0x47')](handleError(_0x21b035,null));};exports['destroy']=function(_0x38b360,_0x517c65){return db['ChatGroup'][_0xef38('0x4c')]({'where':{'id':_0x38b360[_0xef38('0x4f')]['id']}})[_0xef38('0x2a')](handleEntityNotFound(_0x517c65,null))[_0xef38('0x2a')](removeEntity(_0x517c65,null))[_0xef38('0x47')](handleError(_0x517c65,null));};exports[_0xef38('0x50')]=function(_0xbf7e20,_0x1810ac){return db[_0xef38('0x42')][_0xef38('0x50')]()[_0xef38('0x2a')](respondWithResult(_0x1810ac,null))[_0xef38('0x47')](handleError(_0x1810ac,null));};exports[_0xef38('0x51')]=function(_0x7f139e,_0xf97dab,_0x435d38){return db[_0xef38('0x52')][_0xef38('0x25')]({'where':{'ChatGroupId':_0x7f139e[_0xef38('0x4f')]['id'],'ToId':_0x7f139e['user']['id'],'read':![]}})[_0xef38('0x2a')](function(_0x42ac54){return{'id':_['toInteger'](_0x7f139e[_0xef38('0x4f')]['id']),'count':_0x42ac54};})['then'](respondWithResult(_0xf97dab,null))['catch'](handleError(_0xf97dab,null));};exports['addMembers']=function(_0x126137,_0x53909d,_0x456d19){return db['ChatGroup'][_0xef38('0x4c')]({'where':{'id':_0x126137[_0xef38('0x4f')]['id']}})[_0xef38('0x2a')](handleEntityNotFound(_0x53909d,null))[_0xef38('0x2a')](function(_0x244fa2){if(_0x244fa2){return _0x244fa2[_0xef38('0x53')](_0x126137[_0xef38('0x4e')][_0xef38('0x54')],_[_0xef38('0x55')](_0x126137[_0xef38('0x4e')],[_0xef38('0x54'),'id'])||{});}})[_0xef38('0x2a')](respondWithResult(_0x53909d,null))[_0xef38('0x47')](handleError(_0x53909d,null));};exports[_0xef38('0x56')]=function(_0x45c30a,_0x1d70b8,_0x3ee852){var _0x151c61={};var _0x2a7c6e={};var _0x373657;var _0x3e2262;return db[_0xef38('0x42')][_0xef38('0x57')]({'where':{'id':_0x45c30a[_0xef38('0x4f')]['id']}})[_0xef38('0x2a')](handleEntityNotFound(_0x1d70b8,null))[_0xef38('0x2a')](function(_0x5e2891){if(_0x5e2891){_0x373657=_0x5e2891;_0x2a7c6e[_0xef38('0x33')]=_[_0xef38('0x4a')](db['User'][_0xef38('0x49')]);_0x2a7c6e[_0xef38('0x35')]=_[_0xef38('0x4a')](_0x45c30a[_0xef38('0x35')]);_0x2a7c6e[_0xef38('0x36')]=_[_0xef38('0x4b')](_0x2a7c6e[_0xef38('0x33')],_0x2a7c6e['query']);_0x151c61[_0xef38('0x37')]=_[_0xef38('0x4b')](_0x2a7c6e['model'],qs[_0xef38('0x38')](_0x45c30a[_0xef38('0x35')][_0xef38('0x38')]));_0x151c61['attributes']=_0x151c61[_0xef38('0x37')]['length']?_0x151c61['attributes']:_0x2a7c6e[_0xef38('0x33')];_0x151c61[_0xef38('0x3c')]=qs[_0xef38('0x3d')](_0x45c30a[_0xef38('0x35')][_0xef38('0x3d')]);_0x151c61[_0xef38('0x3f')]=qs[_0xef38('0x36')](_[_0xef38('0x58')](_0x45c30a['query'],_0x2a7c6e[_0xef38('0x36')]));if(_0x45c30a['query'][_0xef38('0x3e')]){_0x151c61[_0xef38('0x3f')]=_[_0xef38('0x40')](_0x151c61[_0xef38('0x3f')],{'$or':_[_0xef38('0x34')](_0x151c61[_0xef38('0x37')],function(_0x2c7671){var _0x3fb3c6={};_0x3fb3c6[_0x2c7671]={'$like':'%'+_0x45c30a['query'][_0xef38('0x3e')]+'%'};return _0x3fb3c6;})});}_0x151c61=_[_0xef38('0x40')]({},_0x151c61,_0x45c30a[_0xef38('0x41')]);return _0x373657[_0xef38('0x56')](_0x151c61);}})[_0xef38('0x2a')](function(_0x2a1ab7){if(_0x2a1ab7){_0x3e2262=_0x2a1ab7[_0xef38('0x39')];if(!_0x45c30a[_0xef38('0x35')][_0xef38('0x3a')](_0xef38('0x3b'))){_0x151c61[_0xef38('0x24')]=qs[_0xef38('0x24')](_0x45c30a[_0xef38('0x35')]['limit']);_0x151c61[_0xef38('0x22')]=qs[_0xef38('0x22')](_0x45c30a[_0xef38('0x35')][_0xef38('0x22')]);}return _0x373657[_0xef38('0x56')](_0x151c61);}})['then'](function(_0x46cf93){if(_0x46cf93){return _0x46cf93?{'count':_0x3e2262,'rows':_0x46cf93}:null;}})[_0xef38('0x2a')](respondWithResult(_0x1d70b8,null))[_0xef38('0x47')](handleError(_0x1d70b8,null));};exports[_0xef38('0x59')]=function(_0x3e6ce4,_0x5d20b9,_0x2f7c7f){return db[_0xef38('0x42')][_0xef38('0x4c')]({'where':{'id':_0x3e6ce4[_0xef38('0x4f')]['id']}})[_0xef38('0x2a')](handleEntityNotFound(_0x5d20b9,null))[_0xef38('0x2a')](function(_0x2451a5){if(_0x2451a5){return _0x2451a5[_0xef38('0x59')](_0x3e6ce4[_0xef38('0x35')]['ids']);}})[_0xef38('0x2a')](respondWithStatusCode(_0x5d20b9,null))[_0xef38('0x47')](handleError(_0x5d20b9,null));};exports[_0xef38('0x5a')]=function(_0x5b8d33,_0x72143b,_0x16e42c){if(_0x5b8d33[_0xef38('0x4e')]['id']){delete _0x5b8d33[_0xef38('0x4e')]['id'];}return db[_0xef38('0x42')][_0xef38('0x4c')]({'where':{'id':_0x5b8d33[_0xef38('0x4f')]['id']}})[_0xef38('0x2a')](handleEntityNotFound(_0x72143b,null))[_0xef38('0x2a')](function(_0x377f93){if(_0x377f93){_0x5b8d33[_0xef38('0x4e')]['ChatGroupId']=_0x377f93['id'];return db['ChatInternalMessage']['create'](_0x5b8d33[_0xef38('0x4e')]);}})['then'](respondWithResult(_0x72143b,null))[_0xef38('0x47')](handleError(_0x72143b,null));};exports['getMessages']=function(_0x495c55,_0x2250f3,_0x1d203b){var _0x325fed={};var _0xfc81ff={};var _0x31de19;var _0x788836;return db['ChatGroup'][_0xef38('0x57')]({'where':{'id':_0x495c55[_0xef38('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2250f3,null))['then'](function(_0x15b1c8){if(_0x15b1c8){_0x31de19=_0x15b1c8;_0xfc81ff[_0xef38('0x33')]=_[_0xef38('0x4a')](db[_0xef38('0x52')][_0xef38('0x49')]);_0xfc81ff[_0xef38('0x35')]=_[_0xef38('0x4a')](_0x495c55[_0xef38('0x35')]);_0xfc81ff['filters']=_[_0xef38('0x4b')](_0xfc81ff[_0xef38('0x33')],_0xfc81ff['query']);_0x325fed[_0xef38('0x37')]=_[_0xef38('0x4b')](_0xfc81ff['model'],qs[_0xef38('0x38')](_0x495c55['query'][_0xef38('0x38')]));_0x325fed[_0xef38('0x37')]=_0x325fed[_0xef38('0x37')][_0xef38('0x39')]?_0x325fed['attributes']:_0xfc81ff[_0xef38('0x33')];_0x325fed[_0xef38('0x3c')]=qs[_0xef38('0x3d')](_0x495c55[_0xef38('0x35')][_0xef38('0x3d')]);_0x325fed[_0xef38('0x3f')]=qs[_0xef38('0x36')](_[_0xef38('0x58')](_0x495c55[_0xef38('0x35')],_0xfc81ff[_0xef38('0x36')]));if(_0x495c55[_0xef38('0x35')][_0xef38('0x3e')]){_0x325fed[_0xef38('0x3f')]=_['merge'](_0x325fed['where'],{'$or':_[_0xef38('0x34')](_0x325fed[_0xef38('0x37')],function(_0x3ed0b5){var _0x3b3d71={};_0x3b3d71[_0x3ed0b5]={'$like':'%'+_0x495c55[_0xef38('0x35')][_0xef38('0x3e')]+'%'};return _0x3b3d71;})});}if(_0x495c55['query'][_0xef38('0x5b')]){var _0x4d74eb=_0x495c55[_0xef38('0x35')]['$gte']['split'](',');var _0x407ece={};_0x407ece[_0x4d74eb[0x0]]={'$gte':moment(_0x4d74eb[0x1])[_0xef38('0x5c')](_0xef38('0x5d'))};_0x325fed[_0xef38('0x3f')]=_[_0xef38('0x40')](_0x325fed[_0xef38('0x3f')],_0x407ece);}_0x325fed=_[_0xef38('0x40')]({},_0x325fed,_0x495c55[_0xef38('0x41')]);return _0x31de19[_0xef38('0x5e')](_0x325fed);}})[_0xef38('0x2a')](function(_0x11c1ba){if(_0x11c1ba){_0x788836=_0x11c1ba[_0xef38('0x39')];if(!_0x495c55['query'][_0xef38('0x3a')](_0xef38('0x3b'))){_0x325fed['limit']=qs[_0xef38('0x24')](_0x495c55[_0xef38('0x35')]['limit']);_0x325fed[_0xef38('0x22')]=qs[_0xef38('0x22')](_0x495c55['query'][_0xef38('0x22')]);}return _0x31de19['getMessages'](_0x325fed);}})['then'](function(_0x4d1a48){if(_0x4d1a48){return _0x4d1a48?{'count':_0x788836,'rows':_0x4d1a48}:null;}})[_0xef38('0x2a')](respondWithResult(_0x2250f3,null))[_0xef38('0x47')](handleError(_0x2250f3,null));}; \ No newline at end of file +var _0xc2e7=['format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','ChatGroup','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','body','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','removeMembers','ChatGroupId','create','$gte','split'];(function(_0x2b0267,_0x59cab1){var _0x289a4a=function(_0x3ec45c){while(--_0x3ec45c){_0x2b0267['push'](_0x2b0267['shift']());}};_0x289a4a(++_0x59cab1);}(_0xc2e7,0x16f));var _0x7c2e=function(_0x24d549,_0x577ed1){_0x24d549=_0x24d549-0x0;var _0x2caba8=_0xc2e7[_0x24d549];return _0x2caba8;};'use strict';var emlformat=require(_0x7c2e('0x0'));var rimraf=require(_0x7c2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7c2e('0x2'));var moment=require(_0x7c2e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7c2e('0x4'));var sox=require(_0x7c2e('0x5'));var csv=require(_0x7c2e('0x6'));var ejs=require(_0x7c2e('0x7'));var fs=require('fs');var fs_extra=require(_0x7c2e('0x8'));var _=require(_0x7c2e('0x9'));var squel=require(_0x7c2e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c2e('0xb'));var toCsv=require(_0x7c2e('0x6'));var querystring=require('querystring');var Papa=require(_0x7c2e('0xc'));var Redis=require(_0x7c2e('0xd'));var authService=require(_0x7c2e('0xe'));var qs=require(_0x7c2e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c2e('0x10'))('api');var utils=require(_0x7c2e('0x11'));var config=require(_0x7c2e('0x12'));var licenseUtil=require(_0x7c2e('0x13'));var db=require('../../mysqldb')['db'];config[_0x7c2e('0x14')]=_[_0x7c2e('0x15')](config['redis'],{'host':_0x7c2e('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2e('0x14')]));require(_0x7c2e('0x17'))[_0x7c2e('0x18')](socket);function respondWithStatusCode(_0x227c2b,_0x7258a1){_0x7258a1=_0x7258a1||0xcc;return function(_0x3a1192){if(_0x3a1192){return _0x227c2b[_0x7c2e('0x19')](_0x7258a1);}return _0x227c2b[_0x7c2e('0x1a')](_0x7258a1)[_0x7c2e('0x1b')]();};}function respondWithResult(_0x1c9485,_0x33496a){_0x33496a=_0x33496a||0xc8;return function(_0x5a8d57){if(_0x5a8d57){return _0x1c9485[_0x7c2e('0x1a')](_0x33496a)[_0x7c2e('0x1c')](_0x5a8d57);}};}function respondWithFilteredResult(_0x757dc9,_0x1e8df9){return function(_0x2c8980){if(_0x2c8980){var _0x47501c=typeof _0x1e8df9['offset']==='undefined'&&typeof _0x1e8df9[_0x7c2e('0x1d')]==='undefined';var _0x1d5d42=_0x2c8980[_0x7c2e('0x1e')];var _0x5eb9f8=_0x47501c?0x0:_0x1e8df9['offset'];var _0x371a18=_0x47501c?_0x2c8980[_0x7c2e('0x1e')]:_0x1e8df9[_0x7c2e('0x1f')]+_0x1e8df9[_0x7c2e('0x1d')];var _0x4b5781;if(_0x371a18>=_0x1d5d42){_0x371a18=_0x1d5d42;_0x4b5781=0xc8;}else{_0x4b5781=0xce;}_0x757dc9['status'](_0x4b5781);return _0x757dc9[_0x7c2e('0x20')](_0x7c2e('0x21'),_0x5eb9f8+'-'+_0x371a18+'/'+_0x1d5d42)[_0x7c2e('0x1c')](_0x2c8980);}return null;};}function patchUpdates(_0x200b34){return function(_0x39e27a){try{jsonpatch[_0x7c2e('0x22')](_0x39e27a,_0x200b34,!![]);}catch(_0x31d381){return BPromise['reject'](_0x31d381);}return _0x39e27a[_0x7c2e('0x23')]();};}function saveUpdates(_0x27f2e0,_0x2e2279){return function(_0x2e4ef9){if(_0x2e4ef9){return _0x2e4ef9[_0x7c2e('0x24')](_0x27f2e0)['then'](function(_0x596243){return _0x596243;});}return null;};}function removeEntity(_0x4c7d33,_0x177a19){return function(_0x943c32){if(_0x943c32){return _0x943c32[_0x7c2e('0x25')]()[_0x7c2e('0x26')](function(){_0x4c7d33[_0x7c2e('0x1a')](0xcc)[_0x7c2e('0x1b')]();});}};}function handleEntityNotFound(_0x583b5f,_0x35ed2b){return function(_0x537c1e){if(!_0x537c1e){_0x583b5f[_0x7c2e('0x19')](0x194);}return _0x537c1e;};}function handleError(_0x5b08f7,_0x465111){_0x465111=_0x465111||0x1f4;return function(_0x46837b){logger[_0x7c2e('0x27')](_0x46837b['stack']);if(_0x46837b['name']){delete _0x46837b[_0x7c2e('0x28')];}_0x5b08f7[_0x7c2e('0x1a')](_0x465111)[_0x7c2e('0x29')](_0x46837b);};}exports[_0x7c2e('0x2a')]=function(_0x4fbde1,_0xa7a09f){var _0x67ea0b={},_0x23c3a5={},_0x518c9e={'count':0x0,'rows':[]};var _0x44a60a=_['map'](db[_0x7c2e('0x2b')]['rawAttributes'],function(_0x43fad9){return{'name':_0x43fad9[_0x7c2e('0x2c')],'type':_0x43fad9[_0x7c2e('0x2d')]['key']};});_0x23c3a5['model']=_[_0x7c2e('0x2e')](_0x44a60a,_0x7c2e('0x28'));_0x23c3a5[_0x7c2e('0x2f')]=_[_0x7c2e('0x30')](_0x4fbde1['query']);_0x23c3a5[_0x7c2e('0x31')]=_[_0x7c2e('0x32')](_0x23c3a5['model'],_0x23c3a5['query']);_0x67ea0b[_0x7c2e('0x33')]=_[_0x7c2e('0x32')](_0x23c3a5[_0x7c2e('0x34')],qs[_0x7c2e('0x35')](_0x4fbde1['query']['fields']));_0x67ea0b[_0x7c2e('0x33')]=_0x67ea0b['attributes'][_0x7c2e('0x36')]?_0x67ea0b[_0x7c2e('0x33')]:_0x23c3a5['model'];if(!_0x4fbde1['query'][_0x7c2e('0x37')](_0x7c2e('0x38'))){_0x67ea0b['limit']=qs[_0x7c2e('0x1d')](_0x4fbde1[_0x7c2e('0x2f')][_0x7c2e('0x1d')]);_0x67ea0b[_0x7c2e('0x1f')]=qs['offset'](_0x4fbde1[_0x7c2e('0x2f')][_0x7c2e('0x1f')]);}_0x67ea0b[_0x7c2e('0x39')]=qs[_0x7c2e('0x3a')](_0x4fbde1[_0x7c2e('0x2f')][_0x7c2e('0x3a')]);_0x67ea0b[_0x7c2e('0x3b')]=qs[_0x7c2e('0x31')](_[_0x7c2e('0x3c')](_0x4fbde1[_0x7c2e('0x2f')],_0x23c3a5[_0x7c2e('0x31')]),_0x44a60a);if(_0x4fbde1['query'][_0x7c2e('0x3d')]){_0x67ea0b['where']=_[_0x7c2e('0x3e')](_0x67ea0b['where'],{'$or':_['map'](_0x44a60a,function(_0xd5b830){if(_0xd5b830[_0x7c2e('0x2d')]!==_0x7c2e('0x3f')){var _0x46656d={};_0x46656d[_0xd5b830[_0x7c2e('0x28')]]={'$like':'%'+_0x4fbde1['query']['filter']+'%'};return _0x46656d;}})});}_0x67ea0b=_[_0x7c2e('0x3e')]({},_0x67ea0b,_0x4fbde1['options']);var _0x353610={'where':_0x67ea0b[_0x7c2e('0x3b')]};return db[_0x7c2e('0x2b')][_0x7c2e('0x1e')](_0x353610)['then'](function(_0x42a2e6){_0x518c9e[_0x7c2e('0x1e')]=_0x42a2e6;if(_0x4fbde1[_0x7c2e('0x2f')][_0x7c2e('0x40')]){_0x67ea0b['include']=[{'all':!![]}];}return db['ChatGroup'][_0x7c2e('0x41')](_0x67ea0b);})['then'](function(_0x17146f){_0x518c9e[_0x7c2e('0x42')]=_0x17146f;return _0x518c9e;})[_0x7c2e('0x26')](respondWithFilteredResult(_0xa7a09f,_0x67ea0b))[_0x7c2e('0x43')](handleError(_0xa7a09f,null));};exports[_0x7c2e('0x44')]=function(_0x565b54,_0x5705c4){var _0xe739ce={'raw':!![],'where':{'id':_0x565b54[_0x7c2e('0x45')]['id']}},_0xf27eae={};_0xf27eae[_0x7c2e('0x34')]=_[_0x7c2e('0x30')](db[_0x7c2e('0x2b')][_0x7c2e('0x46')]);_0xf27eae[_0x7c2e('0x2f')]=_['keys'](_0x565b54[_0x7c2e('0x2f')]);_0xf27eae['filters']=_[_0x7c2e('0x32')](_0xf27eae[_0x7c2e('0x34')],_0xf27eae[_0x7c2e('0x2f')]);_0xe739ce['attributes']=_['intersection'](_0xf27eae[_0x7c2e('0x34')],qs[_0x7c2e('0x35')](_0x565b54[_0x7c2e('0x2f')]['fields']));_0xe739ce[_0x7c2e('0x33')]=_0xe739ce[_0x7c2e('0x33')][_0x7c2e('0x36')]?_0xe739ce[_0x7c2e('0x33')]:_0xf27eae[_0x7c2e('0x34')];if(_0x565b54[_0x7c2e('0x2f')]['includeAll']){_0xe739ce[_0x7c2e('0x47')]=[{'all':!![]}];}_0xe739ce=_[_0x7c2e('0x3e')]({},_0xe739ce,_0x565b54[_0x7c2e('0x48')]);return db[_0x7c2e('0x2b')][_0x7c2e('0x49')](_0xe739ce)[_0x7c2e('0x26')](handleEntityNotFound(_0x5705c4,null))[_0x7c2e('0x26')](respondWithResult(_0x5705c4,null))[_0x7c2e('0x43')](handleError(_0x5705c4,null));};exports['create']=function(_0x50bc68,_0x3596f6){return db[_0x7c2e('0x2b')]['create'](_0x50bc68[_0x7c2e('0x4a')],{})[_0x7c2e('0x26')](respondWithResult(_0x3596f6,0xc9))[_0x7c2e('0x43')](handleError(_0x3596f6,null));};exports['update']=function(_0x4e8443,_0x4e3b0f){if(_0x4e8443['body']['id']){delete _0x4e8443[_0x7c2e('0x4a')]['id'];}return db[_0x7c2e('0x2b')][_0x7c2e('0x49')]({'where':{'id':_0x4e8443['params']['id']}})[_0x7c2e('0x26')](handleEntityNotFound(_0x4e3b0f,null))['then'](saveUpdates(_0x4e8443[_0x7c2e('0x4a')],null))['then'](respondWithResult(_0x4e3b0f,null))[_0x7c2e('0x43')](handleError(_0x4e3b0f,null));};exports[_0x7c2e('0x25')]=function(_0xe83ac1,_0x47508c){return db[_0x7c2e('0x2b')][_0x7c2e('0x49')]({'where':{'id':_0xe83ac1['params']['id']}})[_0x7c2e('0x26')](handleEntityNotFound(_0x47508c,null))[_0x7c2e('0x26')](removeEntity(_0x47508c,null))[_0x7c2e('0x43')](handleError(_0x47508c,null));};exports[_0x7c2e('0x4b')]=function(_0x5a5c03,_0x3796fd){return db[_0x7c2e('0x2b')][_0x7c2e('0x4b')]()['then'](respondWithResult(_0x3796fd,null))['catch'](handleError(_0x3796fd,null));};exports['getUnread']=function(_0x50357a,_0x425393,_0x3b0945){return db[_0x7c2e('0x4c')]['count']({'where':{'ChatGroupId':_0x50357a[_0x7c2e('0x45')]['id'],'ToId':_0x50357a[_0x7c2e('0x4d')]['id'],'read':![]}})[_0x7c2e('0x26')](function(_0x1863ef){return{'id':_['toInteger'](_0x50357a[_0x7c2e('0x45')]['id']),'count':_0x1863ef};})['then'](respondWithResult(_0x425393,null))['catch'](handleError(_0x425393,null));};exports['addMembers']=function(_0x2fd752,_0x419077,_0x43afdd){return db[_0x7c2e('0x2b')]['find']({'where':{'id':_0x2fd752[_0x7c2e('0x45')]['id']}})[_0x7c2e('0x26')](handleEntityNotFound(_0x419077,null))[_0x7c2e('0x26')](function(_0xfa268b){if(_0xfa268b){return _0xfa268b[_0x7c2e('0x4e')](_0x2fd752[_0x7c2e('0x4a')][_0x7c2e('0x4f')],_[_0x7c2e('0x50')](_0x2fd752[_0x7c2e('0x4a')],['ids','id'])||{});}})[_0x7c2e('0x26')](respondWithResult(_0x419077,null))[_0x7c2e('0x43')](handleError(_0x419077,null));};exports[_0x7c2e('0x51')]=function(_0x2acfc9,_0x42ccfc,_0x159584){var _0x1ba823={};var _0x3ce42a={};var _0x21ce7e;var _0x2d27f7;return db[_0x7c2e('0x2b')][_0x7c2e('0x52')]({'where':{'id':_0x2acfc9['params']['id']}})[_0x7c2e('0x26')](handleEntityNotFound(_0x42ccfc,null))[_0x7c2e('0x26')](function(_0x304502){if(_0x304502){_0x21ce7e=_0x304502;_0x3ce42a['model']=_[_0x7c2e('0x30')](db['User']['rawAttributes']);_0x3ce42a[_0x7c2e('0x2f')]=_['keys'](_0x2acfc9[_0x7c2e('0x2f')]);_0x3ce42a[_0x7c2e('0x31')]=_[_0x7c2e('0x32')](_0x3ce42a[_0x7c2e('0x34')],_0x3ce42a[_0x7c2e('0x2f')]);_0x1ba823[_0x7c2e('0x33')]=_['intersection'](_0x3ce42a[_0x7c2e('0x34')],qs[_0x7c2e('0x35')](_0x2acfc9[_0x7c2e('0x2f')][_0x7c2e('0x35')]));_0x1ba823[_0x7c2e('0x33')]=_0x1ba823['attributes'][_0x7c2e('0x36')]?_0x1ba823[_0x7c2e('0x33')]:_0x3ce42a[_0x7c2e('0x34')];_0x1ba823[_0x7c2e('0x39')]=qs[_0x7c2e('0x3a')](_0x2acfc9[_0x7c2e('0x2f')][_0x7c2e('0x3a')]);_0x1ba823['where']=qs[_0x7c2e('0x31')](_['pick'](_0x2acfc9[_0x7c2e('0x2f')],_0x3ce42a['filters']));if(_0x2acfc9['query'][_0x7c2e('0x3d')]){_0x1ba823[_0x7c2e('0x3b')]=_[_0x7c2e('0x3e')](_0x1ba823[_0x7c2e('0x3b')],{'$or':_[_0x7c2e('0x2e')](_0x1ba823[_0x7c2e('0x33')],function(_0x1e0f4d){var _0x5b60f9={};_0x5b60f9[_0x1e0f4d]={'$like':'%'+_0x2acfc9[_0x7c2e('0x2f')][_0x7c2e('0x3d')]+'%'};return _0x5b60f9;})});}_0x1ba823=_['merge']({},_0x1ba823,_0x2acfc9[_0x7c2e('0x48')]);return _0x21ce7e[_0x7c2e('0x51')](_0x1ba823);}})[_0x7c2e('0x26')](function(_0x4ddc18){if(_0x4ddc18){_0x2d27f7=_0x4ddc18[_0x7c2e('0x36')];if(!_0x2acfc9[_0x7c2e('0x2f')][_0x7c2e('0x37')](_0x7c2e('0x38'))){_0x1ba823[_0x7c2e('0x1d')]=qs[_0x7c2e('0x1d')](_0x2acfc9[_0x7c2e('0x2f')]['limit']);_0x1ba823['offset']=qs[_0x7c2e('0x1f')](_0x2acfc9[_0x7c2e('0x2f')][_0x7c2e('0x1f')]);}return _0x21ce7e[_0x7c2e('0x51')](_0x1ba823);}})[_0x7c2e('0x26')](function(_0x499ee6){if(_0x499ee6){return _0x499ee6?{'count':_0x2d27f7,'rows':_0x499ee6}:null;}})[_0x7c2e('0x26')](respondWithResult(_0x42ccfc,null))[_0x7c2e('0x43')](handleError(_0x42ccfc,null));};exports[_0x7c2e('0x53')]=function(_0x4d7b89,_0x4b880d,_0x2558a5){return db[_0x7c2e('0x2b')]['find']({'where':{'id':_0x4d7b89['params']['id']}})[_0x7c2e('0x26')](handleEntityNotFound(_0x4b880d,null))[_0x7c2e('0x26')](function(_0x6eb24a){if(_0x6eb24a){return _0x6eb24a['removeMembers'](_0x4d7b89[_0x7c2e('0x2f')][_0x7c2e('0x4f')]);}})[_0x7c2e('0x26')](respondWithStatusCode(_0x4b880d,null))['catch'](handleError(_0x4b880d,null));};exports['addMessage']=function(_0x492362,_0x56a2b7,_0x4a122b){if(_0x492362[_0x7c2e('0x4a')]['id']){delete _0x492362[_0x7c2e('0x4a')]['id'];}return db[_0x7c2e('0x2b')]['find']({'where':{'id':_0x492362['params']['id']}})[_0x7c2e('0x26')](handleEntityNotFound(_0x56a2b7,null))[_0x7c2e('0x26')](function(_0x3b0c93){if(_0x3b0c93){_0x492362[_0x7c2e('0x4a')][_0x7c2e('0x54')]=_0x3b0c93['id'];return db[_0x7c2e('0x4c')][_0x7c2e('0x55')](_0x492362[_0x7c2e('0x4a')]);}})[_0x7c2e('0x26')](respondWithResult(_0x56a2b7,null))['catch'](handleError(_0x56a2b7,null));};exports['getMessages']=function(_0x893fea,_0xfd1396,_0x1a866a){var _0x369170={};var _0x2d67d9={};var _0x583005;var _0x2b49e2;return db[_0x7c2e('0x2b')][_0x7c2e('0x52')]({'where':{'id':_0x893fea[_0x7c2e('0x45')]['id']}})[_0x7c2e('0x26')](handleEntityNotFound(_0xfd1396,null))[_0x7c2e('0x26')](function(_0x167762){if(_0x167762){_0x583005=_0x167762;_0x2d67d9[_0x7c2e('0x34')]=_['keys'](db[_0x7c2e('0x4c')][_0x7c2e('0x46')]);_0x2d67d9[_0x7c2e('0x2f')]=_[_0x7c2e('0x30')](_0x893fea['query']);_0x2d67d9['filters']=_[_0x7c2e('0x32')](_0x2d67d9['model'],_0x2d67d9[_0x7c2e('0x2f')]);_0x369170[_0x7c2e('0x33')]=_['intersection'](_0x2d67d9[_0x7c2e('0x34')],qs[_0x7c2e('0x35')](_0x893fea[_0x7c2e('0x2f')][_0x7c2e('0x35')]));_0x369170[_0x7c2e('0x33')]=_0x369170[_0x7c2e('0x33')][_0x7c2e('0x36')]?_0x369170[_0x7c2e('0x33')]:_0x2d67d9[_0x7c2e('0x34')];_0x369170[_0x7c2e('0x39')]=qs[_0x7c2e('0x3a')](_0x893fea[_0x7c2e('0x2f')][_0x7c2e('0x3a')]);_0x369170[_0x7c2e('0x3b')]=qs['filters'](_[_0x7c2e('0x3c')](_0x893fea[_0x7c2e('0x2f')],_0x2d67d9[_0x7c2e('0x31')]));if(_0x893fea[_0x7c2e('0x2f')][_0x7c2e('0x3d')]){_0x369170[_0x7c2e('0x3b')]=_[_0x7c2e('0x3e')](_0x369170[_0x7c2e('0x3b')],{'$or':_['map'](_0x369170[_0x7c2e('0x33')],function(_0x209974){var _0x3505ec={};_0x3505ec[_0x209974]={'$like':'%'+_0x893fea[_0x7c2e('0x2f')][_0x7c2e('0x3d')]+'%'};return _0x3505ec;})});}if(_0x893fea[_0x7c2e('0x2f')]['$gte']){var _0x31fc31=_0x893fea[_0x7c2e('0x2f')][_0x7c2e('0x56')][_0x7c2e('0x57')](',');var _0x1c6f95={};_0x1c6f95[_0x31fc31[0x0]]={'$gte':moment(_0x31fc31[0x1])[_0x7c2e('0x58')](_0x7c2e('0x59'))};_0x369170[_0x7c2e('0x3b')]=_[_0x7c2e('0x3e')](_0x369170[_0x7c2e('0x3b')],_0x1c6f95);}_0x369170=_[_0x7c2e('0x3e')]({},_0x369170,_0x893fea[_0x7c2e('0x48')]);return _0x583005[_0x7c2e('0x5a')](_0x369170);}})[_0x7c2e('0x26')](function(_0x365cbd){if(_0x365cbd){_0x2b49e2=_0x365cbd['length'];if(!_0x893fea[_0x7c2e('0x2f')][_0x7c2e('0x37')](_0x7c2e('0x38'))){_0x369170[_0x7c2e('0x1d')]=qs[_0x7c2e('0x1d')](_0x893fea['query'][_0x7c2e('0x1d')]);_0x369170['offset']=qs[_0x7c2e('0x1f')](_0x893fea[_0x7c2e('0x2f')][_0x7c2e('0x1f')]);}return _0x583005['getMessages'](_0x369170);}})[_0x7c2e('0x26')](function(_0x1fae55){if(_0x1fae55){return _0x1fae55?{'count':_0x2b49e2,'rows':_0x1fae55}:null;}})[_0x7c2e('0x26')](respondWithResult(_0xfd1396,null))[_0x7c2e('0x43')](handleError(_0xfd1396,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 5900938..cda44e4 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 _0xbf44=['events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbf44,0xa0));var _0x4bf4=function(_0x506e7b,_0x51e387){_0x506e7b=_0x506e7b-0x0;var _0x16b51b=_0xbf44[_0x506e7b];return _0x16b51b;};'use strict';var EventEmitter=require(_0x4bf4('0x0'));var ChatGroup=require(_0x4bf4('0x1'))['db'][_0x4bf4('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4bf4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4bf4('0x4'),'afterDestroy':_0x4bf4('0x5')};function emitEvent(_0x5bd0f2){return function(_0x55a3ec,_0x4eef25,_0x7b09){ChatGroupEvents[_0x4bf4('0x6')](_0x5bd0f2+':'+_0x55a3ec['id'],_0x55a3ec);ChatGroupEvents[_0x4bf4('0x6')](_0x5bd0f2,_0x55a3ec);_0x7b09(null);};}for(var e in events){if(events[_0x4bf4('0x7')](e)){var event=events[e];ChatGroup[_0x4bf4('0x8')](e,emitEvent(event));}}module[_0x4bf4('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0xfb93=['hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0xbab226,_0x3a70fd){var _0x2d4774=function(_0x433f66){while(--_0x433f66){_0xbab226['push'](_0xbab226['shift']());}};_0x2d4774(++_0x3a70fd);}(_0xfb93,0x111));var _0x3fb9=function(_0x5c4dee,_0x3ceeb1){_0x5c4dee=_0x5c4dee-0x0;var _0xa47b=_0xfb93[_0x5c4dee];return _0xa47b;};'use strict';var EventEmitter=require(_0x3fb9('0x0'));var ChatGroup=require(_0x3fb9('0x1'))['db'][_0x3fb9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3fb9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fb9('0x4'),'afterDestroy':_0x3fb9('0x5')};function emitEvent(_0x492ff9){return function(_0x49ac35,_0x4d5ec9,_0x131e5a){ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9+':'+_0x49ac35['id'],_0x49ac35);ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9,_0x49ac35);_0x131e5a(null);};}for(var e in events){if(events[_0x3fb9('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0860fdb..5147771 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 _0x0084=['ChatGroup','chat_groups','../../config/logger','api','moment','bluebird','rimraf','define'];(function(_0x294dc7,_0x4f292d){var _0x53fcb4=function(_0x32e0b8){while(--_0x32e0b8){_0x294dc7['push'](_0x294dc7['shift']());}};_0x53fcb4(++_0x4f292d);}(_0x0084,0x1e2));var _0x4008=function(_0x4c4981,_0x178530){_0x4c4981=_0x4c4981-0x0;var _0x2dc9c1=_0x0084[_0x4c4981];return _0x2dc9c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4008('0x0'))(_0x4008('0x1'));var moment=require(_0x4008('0x2'));var BPromise=require(_0x4008('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4008('0x4'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module['exports']=function(_0x4b4f3c,_0x1a06c6){return _0x4b4f3c[_0x4008('0x5')](_0x4008('0x6'),attributes,{'tableName':_0x4008('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0baf=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','lodash','util','../../config/logger','api'];(function(_0xeead8a,_0x3d2400){var _0x24742c=function(_0x1e357a){while(--_0x1e357a){_0xeead8a['push'](_0xeead8a['shift']());}};_0x24742c(++_0x3d2400);}(_0x0baf,0xb0));var _0xf0ba=function(_0x20aae1,_0x51efd4){_0x20aae1=_0x20aae1-0x0;var _0x510601=_0x0baf[_0x20aae1];return _0x510601;};'use strict';var _=require(_0xf0ba('0x0'));var util=require(_0xf0ba('0x1'));var logger=require(_0xf0ba('0x2'))(_0xf0ba('0x3'));var moment=require('moment');var BPromise=require(_0xf0ba('0x4'));var rp=require(_0xf0ba('0x5'));var fs=require('fs');var path=require(_0xf0ba('0x6'));var rimraf=require(_0xf0ba('0x7'));var config=require(_0xf0ba('0x8'));var attributes=require(_0xf0ba('0x9'));module[_0xf0ba('0xa')]=function(_0x55d37e,_0x3aa5bd){return _0x55d37e['define'](_0xf0ba('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 71721d9..f3eb0ec 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 _0xe4a5=['then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatGroup.socket','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe4a5,0xea));var _0x5e4a=function(_0x3c1fe0,_0xf10a95){_0x3c1fe0=_0x3c1fe0-0x0;var _0x2ef3e=_0xe4a5[_0x3c1fe0];return _0x2ef3e;};'use strict';var _=require(_0x5e4a('0x0'));var util=require(_0x5e4a('0x1'));var moment=require(_0x5e4a('0x2'));var BPromise=require(_0x5e4a('0x3'));var rs=require(_0x5e4a('0x4'));var fs=require('fs');var Redis=require(_0x5e4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e4a('0x6'));var logger=require(_0x5e4a('0x7'))(_0x5e4a('0x8'));var config=require(_0x5e4a('0x9'));var jayson=require(_0x5e4a('0xa'));var client=jayson[_0x5e4a('0xb')][_0x5e4a('0xc')]({'port':0x232a});config['redis']=_[_0x5e4a('0xd')](config[_0x5e4a('0xe')],{'host':_0x5e4a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e4a('0xe')]));require(_0x5e4a('0x10'))['register'](socket);function respondWithRpcPromise(_0x6eb81f,_0x559e4c,_0x10239a){return new BPromise(function(_0x176af2,_0x3c4ef7){return client[_0x5e4a('0x11')](_0x6eb81f,_0x10239a)[_0x5e4a('0x12')](function(_0x16569e){logger[_0x5e4a('0x13')]('ChatGroup,\x20%s,\x20%s',_0x559e4c,_0x5e4a('0x14'));logger[_0x5e4a('0x15')](_0x5e4a('0x16'),_0x559e4c,_0x5e4a('0x14'),JSON[_0x5e4a('0x17')](_0x16569e));if(_0x16569e[_0x5e4a('0x18')]){if(_0x16569e[_0x5e4a('0x18')]['code']===0x1f4){logger['error'](_0x5e4a('0x19'),_0x559e4c,_0x16569e[_0x5e4a('0x18')][_0x5e4a('0x1a')]);return _0x3c4ef7(_0x16569e[_0x5e4a('0x18')][_0x5e4a('0x1a')]);}logger[_0x5e4a('0x18')](_0x5e4a('0x19'),_0x559e4c,_0x16569e[_0x5e4a('0x18')][_0x5e4a('0x1a')]);return _0x176af2(_0x16569e[_0x5e4a('0x18')][_0x5e4a('0x1a')]);}else{logger[_0x5e4a('0x13')](_0x5e4a('0x19'),_0x559e4c,_0x5e4a('0x14'));_0x176af2(_0x16569e['result']['message']);}})[_0x5e4a('0x1b')](function(_0x75bf1d){logger[_0x5e4a('0x18')]('ChatGroup,\x20%s,\x20%s',_0x559e4c,_0x75bf1d);_0x3c4ef7(_0x75bf1d);});});} \ No newline at end of file +var _0xf2a5=['defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x15681d,_0x41dd92){var _0xa3b92e=function(_0x52ac6e){while(--_0x52ac6e){_0x15681d['push'](_0x15681d['shift']());}};_0xa3b92e(++_0x41dd92);}(_0xf2a5,0xc8));var _0x5f2a=function(_0x3e4d43,_0x35f64f){_0x3e4d43=_0x3e4d43-0x0;var _0x5af21e=_0xf2a5[_0x3e4d43];return _0x5af21e;};'use strict';var _=require('lodash');var util=require(_0x5f2a('0x0'));var moment=require(_0x5f2a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f2a('0x2'));var logger=require(_0x5f2a('0x3'))(_0x5f2a('0x4'));var config=require(_0x5f2a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5f2a('0x6')][_0x5f2a('0x7')]({'port':0x232a});config['redis']=_[_0x5f2a('0x8')](config[_0x5f2a('0x9')],{'host':_0x5f2a('0xa'),'port':0x18eb});var socket=require(_0x5f2a('0xb'))(new Redis(config[_0x5f2a('0x9')]));require(_0x5f2a('0xc'))[_0x5f2a('0xd')](socket);function respondWithRpcPromise(_0x3495d9,_0xcbff1a,_0x5f35a8){return new BPromise(function(_0x20f3b6,_0x3e0965){return client[_0x5f2a('0xe')](_0x3495d9,_0x5f35a8)[_0x5f2a('0xf')](function(_0x5d8c3d){logger[_0x5f2a('0x10')](_0x5f2a('0x11'),_0xcbff1a,_0x5f2a('0x12'));logger[_0x5f2a('0x13')](_0x5f2a('0x14'),_0xcbff1a,_0x5f2a('0x12'),JSON[_0x5f2a('0x15')](_0x5d8c3d));if(_0x5d8c3d[_0x5f2a('0x16')]){if(_0x5d8c3d['error']['code']===0x1f4){logger[_0x5f2a('0x16')](_0x5f2a('0x11'),_0xcbff1a,_0x5d8c3d['error']['message']);return _0x3e0965(_0x5d8c3d[_0x5f2a('0x16')]['message']);}logger[_0x5f2a('0x16')](_0x5f2a('0x11'),_0xcbff1a,_0x5d8c3d[_0x5f2a('0x16')][_0x5f2a('0x17')]);return _0x20f3b6(_0x5d8c3d[_0x5f2a('0x16')][_0x5f2a('0x17')]);}else{logger[_0x5f2a('0x10')](_0x5f2a('0x11'),_0xcbff1a,_0x5f2a('0x12'));_0x20f3b6(_0x5d8c3d[_0x5f2a('0x18')][_0x5f2a('0x17')]);}})[_0x5f2a('0x19')](function(_0x20fb67){logger['error']('ChatGroup,\x20%s,\x20%s',_0xcbff1a,_0x20fb67);_0x3e0965(_0x20fb67);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 8549dc1..ac4b917 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 _0x6fad=['save','update','removeListener','register','chatGroup:','./chatGroup.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fad,0x1b5));var _0xd6fa=function(_0x11fc67,_0x1eda19){_0x11fc67=_0x11fc67-0x0;var _0x50bb19=_0x6fad[_0x11fc67];return _0x50bb19;};'use strict';var ChatGroupEvents=require(_0xd6fa('0x0'));var events=[_0xd6fa('0x1'),'remove',_0xd6fa('0x2')];function createListener(_0x182a99,_0x74af41){return function(_0x4a6b73){_0x74af41['emit'](_0x182a99,_0x4a6b73);};}function removeListener(_0x4820dd,_0x13170e){return function(){ChatGroupEvents[_0xd6fa('0x3')](_0x4820dd,_0x13170e);};}exports[_0xd6fa('0x4')]=function(_0x502c9d){for(var _0x502314=0x0,_0x1ef45a=events['length'];_0x502314<_0x1ef45a;_0x502314++){var _0x5415c5=events[_0x502314];var _0x51e86e=createListener(_0xd6fa('0x5')+_0x5415c5,_0x502c9d);ChatGroupEvents['on'](_0x5415c5,_0x51e86e);}}; \ No newline at end of file +var _0x0af4=['removeListener','register','length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x0af4,0x1a4));var _0x40af=function(_0x4262fe,_0x3eeac5){_0x4262fe=_0x4262fe-0x0;var _0x3355f6=_0x0af4[_0x4262fe];return _0x3355f6;};'use strict';var ChatGroupEvents=require(_0x40af('0x0'));var events=['save',_0x40af('0x1'),_0x40af('0x2')];function createListener(_0x28f481,_0x132c77){return function(_0x53dc95){_0x132c77[_0x40af('0x3')](_0x28f481,_0x53dc95);};}function removeListener(_0x43b017,_0x596585){return function(){ChatGroupEvents[_0x40af('0x4')](_0x43b017,_0x596585);};}exports[_0x40af('0x5')]=function(_0x5d98a1){for(var _0x23686a=0x0,_0x576c17=events[_0x40af('0x6')];_0x23686a<_0x576c17;_0x23686a++){var _0x151238=events[_0x23686a];var _0x3753b3=createListener(_0x40af('0x7')+_0x151238,_0x5d98a1);ChatGroupEvents['on'](_0x151238,_0x3753b3);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 7d08e2b..c19fa96 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 _0xbe52=['isAuthenticated','describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','create','/:id/members','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x540634,_0x21121d){var _0x3ba858=function(_0x1c9d71){while(--_0x1c9d71){_0x540634['push'](_0x540634['shift']());}};_0x3ba858(++_0x21121d);}(_0xbe52,0x1ed));var _0x2be5=function(_0x2450e8,_0x360a9b){_0x2450e8=_0x2450e8-0x0;var _0x3021b6=_0xbe52[_0x2450e8];return _0x3021b6;};'use strict';var multer=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var path=require(_0x2be5('0x2'));var timeout=require(_0x2be5('0x3'));var express=require(_0x2be5('0x4'));var router=express[_0x2be5('0x5')]();var fs_extra=require(_0x2be5('0x6'));var auth=require(_0x2be5('0x7'));var interaction=require(_0x2be5('0x8'));var config=require('../../config/environment');var controller=require(_0x2be5('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2be5('0xa')]('/describe',auth[_0x2be5('0xb')](),controller[_0x2be5('0xc')]);router['get'](_0x2be5('0xd'),auth[_0x2be5('0xb')](),controller[_0x2be5('0xe')]);router['get'](_0x2be5('0xf'),auth[_0x2be5('0xb')](),controller['getUnread']);router[_0x2be5('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x2be5('0x10')]);router[_0x2be5('0xa')](_0x2be5('0x11'),auth[_0x2be5('0xb')](),controller[_0x2be5('0x12')]);router['post']('/',auth[_0x2be5('0xb')](),controller[_0x2be5('0x13')]);router['post'](_0x2be5('0x14'),auth['isAuthenticated'](),controller['addMembers']);router['post']('/:id/messages',auth[_0x2be5('0xb')](),controller[_0x2be5('0x15')]);router[_0x2be5('0x16')](_0x2be5('0xd'),auth[_0x2be5('0xb')](),controller[_0x2be5('0x17')]);router[_0x2be5('0x18')](_0x2be5('0xd'),auth[_0x2be5('0xb')](),controller[_0x2be5('0x19')]);router[_0x2be5('0x18')](_0x2be5('0x14'),auth[_0x2be5('0xb')](),controller[_0x2be5('0x1a')]);module[_0x2be5('0x1b')]=router; \ No newline at end of file +var _0x4f3d=['/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x414806,_0x12a8c2){var _0x14e039=function(_0x40fb9c){while(--_0x40fb9c){_0x414806['push'](_0x414806['shift']());}};_0x14e039(++_0x12a8c2);}(_0x4f3d,0x108));var _0xd4f3=function(_0x5cf93c,_0x2b5075){_0x5cf93c=_0x5cf93c-0x0;var _0x56aa24=_0x4f3d[_0x5cf93c];return _0x56aa24;};'use strict';var multer=require('multer');var util=require(_0xd4f3('0x0'));var path=require(_0xd4f3('0x1'));var timeout=require(_0xd4f3('0x2'));var express=require(_0xd4f3('0x3'));var router=express['Router']();var fs_extra=require(_0xd4f3('0x4'));var auth=require(_0xd4f3('0x5'));var interaction=require(_0xd4f3('0x6'));var config=require(_0xd4f3('0x7'));var controller=require(_0xd4f3('0x8'));router[_0xd4f3('0x9')]('/',auth[_0xd4f3('0xa')](),controller[_0xd4f3('0xb')]);router[_0xd4f3('0x9')]('/describe',auth[_0xd4f3('0xa')](),controller[_0xd4f3('0xc')]);router['get'](_0xd4f3('0xd'),auth[_0xd4f3('0xa')](),controller[_0xd4f3('0xe')]);router[_0xd4f3('0x9')](_0xd4f3('0xf'),auth[_0xd4f3('0xa')](),controller[_0xd4f3('0x10')]);router[_0xd4f3('0x9')](_0xd4f3('0x11'),auth[_0xd4f3('0xa')](),controller[_0xd4f3('0x12')]);router[_0xd4f3('0x9')](_0xd4f3('0x13'),auth[_0xd4f3('0xa')](),controller[_0xd4f3('0x14')]);router[_0xd4f3('0x15')]('/',auth['isAuthenticated'](),controller[_0xd4f3('0x16')]);router[_0xd4f3('0x15')](_0xd4f3('0x11'),auth[_0xd4f3('0xa')](),controller[_0xd4f3('0x17')]);router['post'](_0xd4f3('0x13'),auth['isAuthenticated'](),controller[_0xd4f3('0x18')]);router[_0xd4f3('0x19')](_0xd4f3('0xd'),auth['isAuthenticated'](),controller[_0xd4f3('0x1a')]);router[_0xd4f3('0x1b')](_0xd4f3('0xd'),auth['isAuthenticated'](),controller[_0xd4f3('0x1c')]);router[_0xd4f3('0x1b')]('/:id/members',auth['isAuthenticated'](),controller[_0xd4f3('0x1d')]);module[_0xd4f3('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ca0b5f4..2541e14 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 _0x88c3=['star','TEXT','STRING','DATE','ENUM','out','sequelize','BOOLEAN'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0x88c3,0x1ee));var _0x388c=function(_0x3cd2fd,_0x1613a7){_0x3cd2fd=_0x3cd2fd-0x0;var _0x2510dd=_0x88c3[_0x3cd2fd];return _0x2510dd;};'use strict';var Sequelize=require(_0x388c('0x0'));module['exports']={'closed':{'type':Sequelize[_0x388c('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x388c('0x2'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x388c('0x3')]},'pathTranscript':{'type':Sequelize[_0x388c('0x3')]},'mailTranscript':{'type':Sequelize[_0x388c('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x388c('0x5')]},'disposition':{'type':Sequelize[_0x388c('0x4')]},'secondDisposition':{'type':Sequelize[_0x388c('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x388c('0x4')]},'browserName':{'type':Sequelize[_0x388c('0x4')]},'browserVersion':{'type':Sequelize[_0x388c('0x4')]},'osName':{'type':Sequelize[_0x388c('0x4')]},'osVersion':{'type':Sequelize[_0x388c('0x4')]},'deviceModel':{'type':Sequelize[_0x388c('0x4')]},'deviceVendor':{'type':Sequelize[_0x388c('0x4')]},'deviceType':{'type':Sequelize[_0x388c('0x4')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x388c('0x4')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x388c('0x5')]},'lastMsgAt':{'type':Sequelize[_0x388c('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x388c('0x6')]('in',_0x388c('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x388c('0x4')]},'customerPort':{'type':Sequelize[_0x388c('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x388c('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x388c('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b70=['TEXT','STRING','DATE','out','BOOLEAN','exports','INTEGER','ENUM','thumb','star'];(function(_0x25d50e,_0x2f0f9b){var _0x54604f=function(_0x1efbb1){while(--_0x1efbb1){_0x25d50e['push'](_0x25d50e['shift']());}};_0x54604f(++_0x2f0f9b);}(_0x0b70,0x159));var _0x00b7=function(_0x469232,_0x43b77e){_0x469232=_0x469232-0x0;var _0xffacb7=_0x0b70[_0x469232];return _0xffacb7;};'use strict';var Sequelize=require('sequelize');module[_0x00b7('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x00b7('0x1')]},'ratingType':{'type':Sequelize[_0x00b7('0x2')]('star',_0x00b7('0x3')),'defaultValue':_0x00b7('0x4')},'ratingMessage':{'type':Sequelize[_0x00b7('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x00b7('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x00b7('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x00b7('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x00b7('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x00b7('0x6')]},'osVersion':{'type':Sequelize[_0x00b7('0x6')]},'deviceModel':{'type':Sequelize[_0x00b7('0x6')]},'deviceVendor':{'type':Sequelize[_0x00b7('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x00b7('0x5')]},'customerIp':{'type':Sequelize[_0x00b7('0x6')]},'formData':{'type':Sequelize[_0x00b7('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x00b7('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x00b7('0x2')]('in',_0x00b7('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x00b7('0x6')]},'customerPort':{'type':Sequelize[_0x00b7('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x00b7('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x00b7('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 1251847..bfd3585 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 _0x54ef=['info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','render','merge','body','contact','account','Users','map','fullname','TagIds','Tags','push','answered','unmanaged','total','closed','UserId','talking','waiting','disposition','abandoned','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','ChatMessage','Messages','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','includeAgent','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x54ef,0x112));var _0xf54e=function(_0xeb3559,_0x1c877b){_0xeb3559=_0xeb3559-0x0;var _0x92de0=_0x54ef[_0xeb3559];return _0x92de0;};'use strict';var rimraf=require(_0xf54e('0x0'));var zipdir=require(_0xf54e('0x1'));var rp=require(_0xf54e('0x2'));var moment=require('moment');var BPromise=require(_0xf54e('0x3'));var Mustache=require(_0xf54e('0x4'));var util=require(_0xf54e('0x5'));var path=require(_0xf54e('0x6'));var ejs=require(_0xf54e('0x7'));var fs=require('fs');var _=require(_0xf54e('0x8'));var squel=require(_0xf54e('0x9'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0xf54e('0xa'));var pdf=require(_0xf54e('0xb'));var logger=require(_0xf54e('0xc'))('api');var config=require(_0xf54e('0xd'));var db=require('../../mysqldb')['db'];config[_0xf54e('0xe')]=_[_0xf54e('0xf')](config['redis'],{'host':_0xf54e('0x10'),'port':0x18eb});var socket=require(_0xf54e('0x11'))(new Redis(config[_0xf54e('0xe')]));require(_0xf54e('0x12'))['register'](socket);var jayson=require(_0xf54e('0x13'));var client=jayson[_0xf54e('0x14')][_0xf54e('0x15')]({'port':0x232b});var client9004=jayson[_0xf54e('0x14')]['http']({'port':0x232c});function respondWithRpcPromise(_0x358c88,_0x4b0ee1,_0x4bd828,_0x15a9d4){return new BPromise(function(_0x2033e9,_0x28f776){var _0x380f26=_0x15a9d4||client;return _0x380f26['request'](_0x358c88,_0x4bd828)[_0xf54e('0x16')](function(_0x1bbeaa){logger[_0xf54e('0x17')](_0xf54e('0x18'),_0x4b0ee1,'request\x20sent');logger[_0xf54e('0x19')](_0xf54e('0x1a'),_0x4b0ee1,_0xf54e('0x1b'),JSON['stringify'](_0x1bbeaa));if(_0x1bbeaa['error']){if(_0x1bbeaa[_0xf54e('0x1c')][_0xf54e('0x1d')]===0x1f4){logger[_0xf54e('0x1c')](_0xf54e('0x18'),_0x4b0ee1,_0x1bbeaa[_0xf54e('0x1c')][_0xf54e('0x1e')]);return _0x28f776(_0x1bbeaa[_0xf54e('0x1c')][_0xf54e('0x1e')]);}logger[_0xf54e('0x1c')](_0xf54e('0x18'),_0x4b0ee1,_0x1bbeaa[_0xf54e('0x1c')]['message']);return _0x2033e9(_0x1bbeaa['error'][_0xf54e('0x1e')]);}else{logger['info'](_0xf54e('0x18'),_0x4b0ee1,_0xf54e('0x1b'));_0x2033e9(_0x1bbeaa[_0xf54e('0x1f')][_0xf54e('0x1e')]);}})[_0xf54e('0x20')](function(_0x3887b0){logger[_0xf54e('0x1c')](_0xf54e('0x18'),_0x4b0ee1,_0x3887b0);_0x28f776(_0x3887b0);});});}function respondWithStatusCode(_0x3c0169,_0x5f9eea){_0x5f9eea=_0x5f9eea||0xcc;return function(_0x1c58bd){if(_0x1c58bd){return _0x3c0169['sendStatus'](_0x5f9eea);}return _0x3c0169[_0xf54e('0x21')](_0x5f9eea)['end']();};}function respondWithResult(_0x264a8f,_0x272df6){_0x272df6=_0x272df6||0xc8;return function(_0x335492){if(_0x335492){return _0x264a8f[_0xf54e('0x21')](_0x272df6)[_0xf54e('0x22')](_0x335492);}};}function respondWithFilteredResult(_0x160160,_0x1e08d1){return function(_0x43488d){if(_0x43488d){var _0x2342a9=typeof _0x1e08d1[_0xf54e('0x23')]===_0xf54e('0x24')&&typeof _0x1e08d1[_0xf54e('0x25')]===_0xf54e('0x24');var _0x5390b8=_0x43488d[_0xf54e('0x26')];var _0x4cbf7c=_0x2342a9?0x0:_0x1e08d1[_0xf54e('0x23')];var _0x5e63f4=_0x2342a9?_0x43488d[_0xf54e('0x26')]:_0x1e08d1[_0xf54e('0x23')]+_0x1e08d1[_0xf54e('0x25')];var _0xa13cd0;if(_0x5e63f4>=_0x5390b8){_0x5e63f4=_0x5390b8;_0xa13cd0=0xc8;}else{_0xa13cd0=0xce;}_0x160160[_0xf54e('0x21')](_0xa13cd0);return _0x160160[_0xf54e('0x27')](_0xf54e('0x28'),_0x4cbf7c+'-'+_0x5e63f4+'/'+_0x5390b8)['json'](_0x43488d);}return null;};}function saveUpdates(_0x4b3c73){return function(_0x2f96b1){if(_0x2f96b1){return _0x2f96b1[_0xf54e('0x29')](_0x4b3c73)[_0xf54e('0x16')](function(_0x16d00f){return _0x16d00f;});}return null;};}function removeEntity(_0xb2d4c4){return function(_0x133cd7){if(_0x133cd7){return _0x133cd7[_0xf54e('0x2a')]()[_0xf54e('0x16')](function(){_0xb2d4c4[_0xf54e('0x21')](0xcc)[_0xf54e('0x2b')]();});}};}function handleEntityNotFound(_0x5ea0cc){return function(_0x5f29d3){if(!_0x5f29d3){_0x5ea0cc[_0xf54e('0x2c')](0x194);}return _0x5f29d3;};}function handleError(_0x3169dd,_0x4d8fdd){_0x4d8fdd=_0x4d8fdd||0x1f4;return function(_0x3e319c){logger[_0xf54e('0x1c')](_0x3e319c[_0xf54e('0x2d')]);if(_0x3e319c[_0xf54e('0x2e')]){delete _0x3e319c['name'];}_0x3169dd['status'](_0x4d8fdd)['send'](_0x3e319c);};}function getMustacheRender(_0x3c0cca,_0xe7e042){return Mustache[_0xf54e('0x2f')](_0x3c0cca,_[_0xf54e('0x30')](_0xe7e042[_0xf54e('0x31')],{'contact':_0xe7e042[_0xf54e('0x32')],'message':_0xe7e042['message'],'agent':_0xe7e042['agent'],'interaction':_0xe7e042['interaction'],'account':_0xe7e042[_0xf54e('0x33')]}))||'';}function getInteractionUsers(_0x734187,_0x59c003){return new BPromise(function(_0x4d9b06,_0xda1d10){try{if(_0x59c003[_0x734187['id']]){_0x734187[_0xf54e('0x34')]=_[_0xf54e('0x35')](_0x59c003[_0x734187['id']],function(_0x4a347a){return{'id':_0x4a347a['id'],'fullname':_0x4a347a[_0xf54e('0x36')]};});}}catch(_0x44a437){_0xda1d10(_0x44a437);}_0x4d9b06(_0x734187);});}function getInteractionTags(_0x50aeca,_0x38d7a0){return new BPromise(function(_0x6e5bdf,_0x5af03){try{if(_0x50aeca[_0xf54e('0x37')]){_0x50aeca[_0xf54e('0x38')]=[];_0x50aeca[_0xf54e('0x37')]['split'](',')['forEach'](function(_0x3d5a68){_0x50aeca[_0xf54e('0x38')][_0xf54e('0x39')](_0x38d7a0[_0x3d5a68]);});}delete _0x50aeca['TagIds'];}catch(_0x4533a2){_0x5af03(_0x4533a2);}_0x6e5bdf(_0x50aeca);});}function updateChatInteraction(_0x22fa6f,_0x448054,_0x1ee884){return new BPromise(function(_0x361e4c,_0x23f297){return getInteractionUsers(_0x22fa6f,_0x1ee884)[_0xf54e('0x16')](function(_0x1345b0){return getInteractionTags(_0x1345b0,_0x448054);})[_0xf54e('0x16')](function(_0x2087b3){return getStateInteraction(_0x2087b3);})[_0xf54e('0x16')](function(_0x30e147){_0x361e4c(_0x30e147);})[_0xf54e('0x20')](function(_0x2625fd){_0x23f297(_0x2625fd);});});}function getStateInteraction(_0x2043a8){return new BPromise(function(_0x5085c1){_0x2043a8['waiting']=0x0;_0x2043a8['talking']=0x0;_0x2043a8[_0xf54e('0x3a')]=0x0;_0x2043a8[_0xf54e('0x3b')]=0x0;_0x2043a8['abandoned']=0x0;_0x2043a8[_0xf54e('0x3c')]=0x0;if(!_0x2043a8[_0xf54e('0x3d')]&&!_0x2043a8[_0xf54e('0x3e')]){_0x2043a8['waiting']+=0x1;}if(!_0x2043a8[_0xf54e('0x3d')]&&_0x2043a8[_0xf54e('0x3e')]){_0x2043a8[_0xf54e('0x3f')]+=0x1;if(_0x2043a8[_0xf54e('0x40')]){_0x2043a8[_0xf54e('0x40')]-=0x1;}}if(_0x2043a8[_0xf54e('0x3d')]&&_0x2043a8[_0xf54e('0x41')]===_0xf54e('0x42')){_0x2043a8[_0xf54e('0x42')]+=0x1;if(_0x2043a8['waiting']){_0x2043a8[_0xf54e('0x40')]-=0x1;}}else if(_0x2043a8[_0xf54e('0x3d')]&&!_0x2043a8[_0xf54e('0x3e')]&&_0x2043a8[_0xf54e('0x41')]){_0x2043a8[_0xf54e('0x3b')]+=0x1;if(_0x2043a8[_0xf54e('0x40')]){_0x2043a8['waiting']-=0x1;}}else if(_0x2043a8[_0xf54e('0x3d')]&&_0x2043a8['UserId']){_0x2043a8[_0xf54e('0x3a')]+=0x1;if(_0x2043a8['talking']){_0x2043a8[_0xf54e('0x3f')]-=0x1;}}_0x2043a8[_0xf54e('0x3c')]+=0x1;_0x5085c1(_0x2043a8);});}exports[_0xf54e('0x43')]=function(_0x57371d,_0x1af35d){var _0x40b21c={},_0x12971a={},_0x32fb46={'count':0x0,'rows':[]};var _0x3a5a87=_['map'](db[_0xf54e('0x44')][_0xf54e('0x45')],function(_0x346bb4){return{'name':_0x346bb4[_0xf54e('0x46')],'type':_0x346bb4['type'][_0xf54e('0x47')]};});_0x12971a[_0xf54e('0x48')]=_['map'](_0x3a5a87,_0xf54e('0x2e'));_0x12971a[_0xf54e('0x49')]=_[_0xf54e('0x4a')](_0x57371d[_0xf54e('0x49')]);_0x12971a['filters']=_[_0xf54e('0x4b')](_0x12971a[_0xf54e('0x48')],_0x12971a[_0xf54e('0x49')]);_0x40b21c[_0xf54e('0x4c')]=_[_0xf54e('0x4b')](_0x12971a[_0xf54e('0x48')],qs[_0xf54e('0x4d')](_0x57371d[_0xf54e('0x49')][_0xf54e('0x4d')]));_0x40b21c[_0xf54e('0x4c')]=_0x40b21c[_0xf54e('0x4c')][_0xf54e('0x4e')]?_0x40b21c[_0xf54e('0x4c')]:_0x12971a[_0xf54e('0x48')];if(!_0x57371d[_0xf54e('0x49')][_0xf54e('0x4f')](_0xf54e('0x50'))){_0x40b21c[_0xf54e('0x25')]=qs[_0xf54e('0x25')](_0x57371d[_0xf54e('0x49')]['limit']);_0x40b21c['offset']=qs[_0xf54e('0x23')](_0x57371d[_0xf54e('0x49')][_0xf54e('0x23')]);}_0x40b21c[_0xf54e('0x51')]=qs[_0xf54e('0x52')](_0x57371d[_0xf54e('0x49')][_0xf54e('0x52')]);_0x40b21c[_0xf54e('0x53')]=qs[_0xf54e('0x54')](_[_0xf54e('0x55')](_0x57371d[_0xf54e('0x49')],_0x12971a['filters']),_0x3a5a87);var _0x2aacf6=[];var _0x2df864=squel[_0xf54e('0x56')]()[_0xf54e('0x57')]('id')[_0xf54e('0x57')](_0xf54e('0x2e'))[_0xf54e('0x57')]('color')[_0xf54e('0x58')](_0xf54e('0x59'));var _0x294fa1=squel['select']()[_0xf54e('0x57')]('u.id')[_0xf54e('0x57')](_0xf54e('0x5a'))[_0xf54e('0x57')]('ui.ChatInteractionId')[_0xf54e('0x58')](_0xf54e('0x5b'),'ui')[_0xf54e('0x5c')](_0xf54e('0x5d'),'u',_0xf54e('0x5e'));var _0x2ec72a=squel[_0xf54e('0x56')]()['from']('chat_interactions','i')[_0xf54e('0x5c')](_0xf54e('0x5f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf54e('0x5c')]('users','o',_0xf54e('0x60'))['left_join'](_0xf54e('0x61'),'a',_0xf54e('0x62'))[_0xf54e('0x5c')](_0xf54e('0x63'),'me',_0xf54e('0x64'))[_0xf54e('0x5c')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0xf54e('0x5c')](_0xf54e('0x59'),'t','t.id\x20=\x20it.TagId');var _0x57a48e=squel[_0xf54e('0x65')]();var _0x511a99=[];var _0x2b616a=squel[_0xf54e('0x65')]();var _0x47596c;if(_0x57371d[_0xf54e('0x49')][_0xf54e('0x66')]){_0x47596c=as[_0xf54e('0x67')](_0x57371d[_0xf54e('0x49')][_0xf54e('0x66')]);var _0x11732b=_0x47596c[_0xf54e('0x68')];for(var _0x1f9dad=0x0;_0x1f9dad<_0x47596c[_0xf54e('0x69')][_0xf54e('0x4e')];_0x1f9dad++){var _0x2607c2=_0x47596c['conditions'][_0x1f9dad];var _0x302f3d='i';var _0x5d5dd7=_[_0xf54e('0x6a')](_0x3a5a87,[_0xf54e('0x2e'),_0x2607c2[_0xf54e('0x57')]]);if(!_0x5d5dd7){switch(_0x2607c2['field']){case _0xf54e('0x6b'):if(_0x2607c2[_0xf54e('0x6c')]==0x1){_0x2ec72a['having']('`'+_0x2607c2['field']+_0xf54e('0x6d'));}else{_0x2ec72a['having']('`'+_0x2607c2[_0xf54e('0x57')]+_0xf54e('0x6e'));}break;case _0xf54e('0x6f'):if(_0x2607c2[_0xf54e('0x70')]==='$substring'){if(_0x2607c2[_0xf54e('0x6c')]['split']('\x20')[_0xf54e('0x4e')]>0x1){_0x57a48e[_0x11732b](_0xf54e('0x71'),qs[_0xf54e('0x72')](_0x2607c2['value']),null);}else{var _0x2d04db='%'+_0x2607c2['value']+'%';_0x57a48e[_0x11732b](_0xf54e('0x73'),_0x2d04db,_0x2d04db,_0x2d04db);}}else{_0x5d5dd7=_[_0xf54e('0x6a')](_0x3a5a87,['name',_0xf54e('0x74')]);_0x2607c2['field']=_0xf54e('0x74');_0x2ee19b=as[_0xf54e('0x75')](_0x302f3d,_0x5d5dd7[_0xf54e('0x76')],_0x2607c2);_0x57a48e[_0x11732b](_0x2ee19b[_0xf54e('0x77')],_0x2ee19b[_0xf54e('0x6c')]['start'],_0x2ee19b[_0xf54e('0x6c')][_0xf54e('0x2b')]);}break;case'Tag':var _0x2db742=_0x2607c2[_0xf54e('0x6c')]['split'](',')[_0xf54e('0x35')](function(_0x14aaf7){return Number(_0x14aaf7);});_0x2db742[_0xf54e('0x78')](function(_0x4c72ef){_0x2b616a['or'](_0xf54e('0x79'),'%,'+_0x4c72ef+',%');});_0x511a99=_['union'](_0x511a99,_0x2db742);break;case _0xf54e('0x7a'):if(_0x2607c2[_0xf54e('0x70')]==='$substring'){_0x57a48e[_0x11732b](_0xf54e('0x7b'),'%'+_0x2607c2[_0xf54e('0x6c')]+'%',null);}else{_0x5d5dd7=_[_0xf54e('0x6a')](_0x3a5a87,[_0xf54e('0x2e'),_0xf54e('0x3e')]);_0x2607c2[_0xf54e('0x57')]=_0xf54e('0x3e');_0x2ee19b=as[_0xf54e('0x75')](_0x302f3d,_0x5d5dd7[_0xf54e('0x76')],_0x2607c2);_0x57a48e[_0x11732b](_0x2ee19b[_0xf54e('0x77')],_0x2ee19b[_0xf54e('0x6c')]['start'],_0x2ee19b[_0xf54e('0x6c')][_0xf54e('0x2b')]);}break;case _0xf54e('0x31'):_0x2ee19b=as['buildExpression']('me',null,_0x2607c2);_0x57a48e[_0x11732b](_0x2ee19b[_0xf54e('0x77')],_0x2ee19b[_0xf54e('0x6c')][_0xf54e('0x7c')],_0x2ee19b[_0xf54e('0x6c')][_0xf54e('0x2b')]);break;}}else{var _0x2ee19b=as[_0xf54e('0x75')](_0x302f3d,_0x5d5dd7['type'],_0x2607c2);_0x57a48e[_0x11732b](_0x2ee19b[_0xf54e('0x77')],_0x2ee19b[_0xf54e('0x6c')][_0xf54e('0x7c')],_0x2ee19b['value'][_0xf54e('0x2b')]);}}}else{var _0x419ba2=_(_0x57371d[_0xf54e('0x49')])[_0xf54e('0x4a')]()['map'](function(_0x4a6dee){return _[_0xf54e('0x7d')](_0x3a5a87,[_0xf54e('0x2e'),_0x4a6dee])?_0x4a6dee:undefined;})[_0xf54e('0x7e')]()[_0xf54e('0x6c')]();if(!_[_0xf54e('0x7f')](_0x419ba2)){_0x419ba2[_0xf54e('0x78')](function(_0x35b5a4){if(_0x35b5a4===_0xf54e('0x80')){_0x2ec72a[_0xf54e('0x53')](_0xf54e('0x81'),[]['concat'](_0x57371d[_0xf54e('0x49')][_0x35b5a4]));}else if(_0x35b5a4===_0xf54e('0x82')){var _0x2b026a=JSON[_0xf54e('0x83')](_0x57371d['query'][_0x35b5a4])[_0xf54e('0x84')];var _0x1de6dd=JSON[_0xf54e('0x83')](_0x57371d[_0xf54e('0x49')][_0x35b5a4])['$lte'];_0x2ec72a[_0xf54e('0x53')](_0xf54e('0x85'),_0x2b026a,_0x1de6dd);}else{if(_0x57371d[_0xf54e('0x49')][_0x35b5a4]==='null'){_0x2ec72a['where']('i.'+_0x35b5a4+_0xf54e('0x86'));}else{_0x2ec72a[_0xf54e('0x53')]('i.'+_0x35b5a4+_0xf54e('0x87'),_0x57371d[_0xf54e('0x49')][_0x35b5a4]);}}});}if(_0x57371d[_0xf54e('0x49')][_0xf54e('0x88')]){if(_0x57371d[_0xf54e('0x49')][_0xf54e('0x88')]==0x1){_0x2ec72a[_0xf54e('0x89')]('`unreadMessages`\x20=\x200');}else{_0x2ec72a[_0xf54e('0x89')](_0xf54e('0x8a'));}}if(_0x57371d[_0xf54e('0x49')][_0xf54e('0x8b')]){_0x511a99=_[_0xf54e('0x8c')](_0x57371d[_0xf54e('0x49')][_0xf54e('0x8b')])?_0x57371d[_0xf54e('0x49')][_0xf54e('0x8b')]:new Array(_0x57371d[_0xf54e('0x49')][_0xf54e('0x8b')]);_0x511a99[_0xf54e('0x78')](function(_0x5b9ff2){_0x2b616a['or'](_0xf54e('0x79'),'%,'+_0x5b9ff2+',%');});}if(_0x57371d[_0xf54e('0x49')]['filter']){var _0x4a0614=_0x57371d[_0xf54e('0x49')][_0xf54e('0x8d')][_0xf54e('0x8e')]('\x5c','\x5c\x5c')[_0xf54e('0x8e')](/'/g,'\x27\x27');if(qs[_0xf54e('0x8f')](_0x4a0614)){_0x57a48e['or'](_0xf54e('0x90'),_0x4a0614+'%');}else{_0x57a48e['or'](_0xf54e('0x91'),qs[_0xf54e('0x72')](_0x4a0614))['or'](_0xf54e('0x92'),_0x4a0614+'%');}}}_0x2ec72a['where'](_0x57a48e);_0x2ec72a[_0xf54e('0x93')](_0xf54e('0x94'));var _0x3c641b={'type':db['Sequelize'][_0xf54e('0x95')]['SELECT'],'raw':!![]};var _0x3830e7=_0x2ec72a['clone']();_0x3830e7[_0xf54e('0x57')](_0xf54e('0x94'));_0x3830e7['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf54e('0x6b'));if(_0x40b21c[_0xf54e('0x51')]){_0x40b21c[_0xf54e('0x51')][_0xf54e('0x78')](function(_0x389f16){var _0x486626=_0x389f16[0x0]==='contactName'?_0x389f16[0x0]:'i.'+_0x389f16[0x0];_0x2ec72a[_0xf54e('0x51')](_0x486626,_0x389f16[0x1]===_0xf54e('0x96')?![]:!![]);});}if(!_[_0xf54e('0x7f')](_0x511a99)){_0x2ec72a[_0xf54e('0x89')](_0x2b616a);_0x3830e7[_0xf54e('0x53')](_0xf54e('0x97'),_0x511a99);}BPromise[_0xf54e('0x98')]()[_0xf54e('0x16')](function(){if(!_0x47596c){if(_0x57371d[_0xf54e('0x49')][_0xf54e('0x80')])return;_0x3830e7['where'](_0xf54e('0x99'));_0x2ec72a[_0xf54e('0x53')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x57371d['user'][_0xf54e('0x9a')]!==_0xf54e('0x9b'))return;return _0x57371d[_0xf54e('0x9c')][_0xf54e('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf54e('0x16')](function(_0x5e6713){if(_[_0xf54e('0x7f')](_0x5e6713)){_0x3830e7[_0xf54e('0x53')](_0xf54e('0x9e'));_0x2ec72a[_0xf54e('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3830e7[_0xf54e('0x53')](_0xf54e('0x81'),_[_0xf54e('0x35')](_0x5e6713,'id'));_0x2ec72a[_0xf54e('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf54e('0x35')](_0x5e6713,'id'));}});})[_0xf54e('0x16')](function(){if(_0x57371d[_0xf54e('0x9c')][_0xf54e('0x9a')]===_0xf54e('0x9b')&&!_0x47596c&&!_0x57371d['query'][_0xf54e('0x80')])return[];return db['sequelize']['query'](_0x3830e7[_0xf54e('0x9f')](),_0x3c641b);})[_0xf54e('0x16')](function(_0x242f5c){_0x32fb46[_0xf54e('0x26')]=_0x242f5c[_0xf54e('0x4e')];if(_0x32fb46[_0xf54e('0x26')]===0x0)return[];return db[_0xf54e('0xa0')][_0xf54e('0x49')](_0x2df864[_0xf54e('0x9f')](),_0x3c641b)['then'](function(_0x3dddbd){_0x2aacf6=_[_0xf54e('0xa1')](_0x3dddbd,'id');_0x3c641b=_[_0xf54e('0x30')](_0x3c641b,{'model':db[_0xf54e('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57371d[_0xf54e('0x49')][_0xf54e('0x4d')]){_0x40b21c['attributes'][_0xf54e('0x78')](function(_0x978fe2){_0x2ec72a[_0xf54e('0x57')]('i.'+_0x978fe2);});}else{_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xa2'),_0xf54e('0x6b'));_0x2ec72a['field'](_0xf54e('0xa3'),_0xf54e('0xa4'));_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xa5'),'Account.mandatoryDisposition');_0x2ec72a['field'](_0xf54e('0xa6'),_0xf54e('0xa7'));_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xa8'));_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xa9'),'Contact.firstName');_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xaa'),_0xf54e('0xab'));_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xac'),_0xf54e('0xad'));_0x2ec72a['field'](_0xf54e('0xae'),'Contact.phone');_0x2ec72a[_0xf54e('0x57')]('c.mobile',_0xf54e('0xaf'));_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xb0'),_0xf54e('0xb1'));_0x2ec72a[_0xf54e('0x57')]('o.fullname',_0xf54e('0xb2'));_0x2ec72a[_0xf54e('0x57')]('o.internal',_0xf54e('0xb3'));_0x2ec72a[_0xf54e('0x57')](_0xf54e('0xb4'),_0xf54e('0x37'));}if(_0x40b21c['limit'])_0x2ec72a[_0xf54e('0x25')](_0x40b21c[_0xf54e('0x25')]);if(_0x40b21c['offset'])_0x2ec72a[_0xf54e('0x23')](_0x40b21c['offset']);return db['sequelize'][_0xf54e('0x49')](_0x2ec72a['toString'](),_0x3c641b);})[_0xf54e('0x16')](function(_0x28e406){if(_0x28e406[_0xf54e('0x4e')]>0x0)_0x294fa1[_0xf54e('0x53')](_0xf54e('0xb5'),_['map'](_0x28e406,'id'));return db[_0xf54e('0xa0')][_0xf54e('0x49')](_0x294fa1[_0xf54e('0x9f')](),_0x3c641b)[_0xf54e('0x16')](function(_0x4a681e){var _0x3ed6e4=_['groupBy'](_0x4a681e,_0xf54e('0xb6'));var _0x1e6414=[];_0x28e406['forEach'](function(_0x236f93){_0x1e6414[_0xf54e('0x39')](updateChatInteraction(_0x236f93,_0x2aacf6,_0x3ed6e4));});return BPromise[_0xf54e('0xb7')](_0x1e6414);});});})[_0xf54e('0x16')](function(_0x5a7eac){_0x32fb46[_0xf54e('0xb8')]=_0x5a7eac;return _0x32fb46;})[_0xf54e('0x16')](respondWithFilteredResult(_0x1af35d,_0x40b21c))[_0xf54e('0x20')](handleError(_0x1af35d,null));};exports['show']=function(_0x4a133a,_0x4548a7){var _0x5e33bc={'raw':![],'where':{'id':_0x4a133a['params']['id']}},_0x5765e1={};_0x5765e1[_0xf54e('0x48')]=_[_0xf54e('0x4a')](db[_0xf54e('0x44')][_0xf54e('0x45')]);_0x5765e1[_0xf54e('0x49')]=_[_0xf54e('0x4a')](_0x4a133a[_0xf54e('0x49')]);_0x5765e1[_0xf54e('0x54')]=_[_0xf54e('0x4b')](_0x5765e1['model'],_0x5765e1[_0xf54e('0x49')]);_0x5e33bc['attributes']=_[_0xf54e('0x4b')](_0x5765e1[_0xf54e('0x48')],qs['fields'](_0x4a133a[_0xf54e('0x49')]['fields']));_0x5e33bc[_0xf54e('0x4c')]=_0x5e33bc[_0xf54e('0x4c')][_0xf54e('0x4e')]?_0x5e33bc[_0xf54e('0x4c')]:_0x5765e1[_0xf54e('0x48')];if(_0x4a133a[_0xf54e('0x49')]['includeAll']){_0x5e33bc['include']=[{'all':!![]}];}_0x5e33bc=_['merge']({},_0x5e33bc,_0x4a133a[_0xf54e('0xb9')]);return db['ChatInteraction'][_0xf54e('0x6a')](_0x5e33bc)[_0xf54e('0x16')](handleEntityNotFound(_0x4548a7,null))[_0xf54e('0x16')](respondWithResult(_0x4548a7,null))[_0xf54e('0x20')](handleError(_0x4548a7,null));};exports[_0xf54e('0xba')]=function(_0x5e5e50,_0x40a68c){return db[_0xf54e('0x44')][_0xf54e('0xba')](_0x5e5e50[_0xf54e('0x31')],{})[_0xf54e('0x16')](respondWithResult(_0x40a68c,0xc9))[_0xf54e('0x20')](handleError(_0x40a68c,null));};exports['update']=function(_0x996df5,_0x811fa7){if(_0x996df5[_0xf54e('0x31')]['id']){delete _0x996df5[_0xf54e('0x31')]['id'];}return db[_0xf54e('0x44')]['find']({'where':{'id':_0x996df5[_0xf54e('0xbb')]['id']}})[_0xf54e('0x16')](handleEntityNotFound(_0x811fa7,null))[_0xf54e('0x16')](saveUpdates(_0x996df5[_0xf54e('0x31')],null))[_0xf54e('0x16')](respondWithResult(_0x811fa7,null))[_0xf54e('0x20')](handleError(_0x811fa7,null));};exports[_0xf54e('0x2a')]=function(_0x4689e8,_0x2e42f7){return db['ChatInteraction'][_0xf54e('0x6a')]({'where':{'id':_0x4689e8[_0xf54e('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2e42f7,null))['then'](removeEntity(_0x2e42f7,null))[_0xf54e('0x20')](handleError(_0x2e42f7,null));};exports['describe']=function(_0x40bf28,_0xd4db77){return db[_0xf54e('0x44')][_0xf54e('0xbc')]()['then'](respondWithResult(_0xd4db77,null))[_0xf54e('0x20')](handleError(_0xd4db77,null));};exports[_0xf54e('0xbd')]=function(_0x59fb9a,_0x90ad88){var _0x3797bf=_0x59fb9a[_0xf54e('0xbb')]['id'];var _0x458450;var _0x627e9a;var _0x413b9a;return db[_0xf54e('0x44')][_0xf54e('0xbe')]({'where':{'id':_0x3797bf}})[_0xf54e('0x16')](function(_0x3634bc){_0x458450=_0x3634bc;return db[_0xf54e('0xbf')]['findOne']({'where':{'id':_0x3634bc['ChatWebsiteId']},'attributes':['id',_0xf54e('0xc0'),_0xf54e('0xc1'),_0xf54e('0xc2'),_0xf54e('0xc3'),_0xf54e('0xc4')],'raw':!![]});})['then'](function(_0x3b29f4){if(_0x3b29f4&&_0x3b29f4[_0xf54e('0xc0')]&&_0x3b29f4[_0xf54e('0xc1')]){_0x627e9a=_0x3b29f4;var _0x213dc5={'interaction':{'id':_0x3797bf},'agent':{'id':_0x59fb9a['user']['id'],'name':_0x59fb9a[_0xf54e('0x9c')][_0xf54e('0x2e')],'fullname':_0x59fb9a[_0xf54e('0x9c')][_0xf54e('0x36')],'email':_0x59fb9a[_0xf54e('0x9c')][_0xf54e('0xc5')]},'contact':_0x59fb9a[_0xf54e('0x31')][_0xf54e('0x32')],'account':_0x59fb9a[_0xf54e('0x31')][_0xf54e('0x33')]};var _0x3e0fb5={'rejectUnauthorized':![],'method':_0xf54e('0xc6'),'url':_0xf54e('0xc7'),'headers':{'X-APIKEY':_0x3b29f4[_0xf54e('0xc0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x59fb9a['user'][_0xf54e('0xc5')]],'buttons':null,'topic':_0x627e9a['vidaooTopic'],'note':_['isNull'](_0x627e9a[_0xf54e('0xc3')])?null:getMustacheRender(_0x627e9a[_0xf54e('0xc3')],_0x213dc5),'metadata':null},'redirect':_0xf54e('0xc8'),'json':!![]};try{if(!_[_0xf54e('0xc9')](_0x627e9a[_0xf54e('0xc4')])){var _0x2609ef=getMustacheRender(_0x627e9a[_0xf54e('0xc4')],_0x213dc5);var _0x113020=JSON[_0xf54e('0x83')](_0x2609ef);_0x3e0fb5[_0xf54e('0x31')][_0xf54e('0xca')]=_0x113020;}}catch(_0x3c77cd){throw new db[(_0xf54e('0xcb'))]['ValidationError'](_0xf54e('0xcc'));}return rp(_0x3e0fb5);}else{throw new db[(_0xf54e('0xcb'))][(_0xf54e('0xcd'))](_0xf54e('0xce'));}})[_0xf54e('0x16')](function(_0x59f0d7){_0x413b9a=_0x59f0d7;if(_0x413b9a['id']){var _0x54275b={'body':_0x413b9a[_0xf54e('0xcf')],'ChatWebsiteId':_0x627e9a['id'],'ChatInteractionId':_0x458450['id'],'direction':_0xf54e('0xd0'),'UserId':_0x59fb9a['user']['id']};return db['ChatMessage'][_0xf54e('0xba')](_0x54275b,{});}else{throw new db['Sequelize'][(_0xf54e('0xcd'))](_0xf54e('0xd1'));}})[_0xf54e('0x16')](function(){return _0x458450[_0xf54e('0xd2')]({'vidaooSessionId':_0x413b9a['id']});})[_0xf54e('0x16')](respondWithResult(_0x90ad88,null))[_0xf54e('0x20')](handleError(_0x90ad88,null));};exports['customUpdate']=function(_0x39fc7d,_0x2e0cf9){if(_0x39fc7d['body']['id']){delete _0x39fc7d[_0xf54e('0x31')]['id'];}return db[_0xf54e('0x44')]['find']({'where':{'id':_0x39fc7d[_0xf54e('0xbb')]['id']},'include':[{'model':db[_0xf54e('0xd3')],'as':_0xf54e('0x6f')}]})['then'](handleEntityNotFound(_0x2e0cf9,null))['then'](saveUpdates(_0x39fc7d[_0xf54e('0x31')],null))[_0xf54e('0x16')](respondWithResult(_0x2e0cf9,null))['catch'](handleError(_0x2e0cf9,null));};exports['abandon']=function(_0x4ce631,_0x39027b){if(_0x4ce631[_0xf54e('0x31')]['id']){delete _0x4ce631[_0xf54e('0x31')]['id'];}return db['ChatInteraction'][_0xf54e('0x6a')]({'where':{'id':_0x4ce631[_0xf54e('0xbb')]['id']}})[_0xf54e('0x16')](function(_0x3da354){if(!_0x3da354){logger[_0xf54e('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x39027b['sendStatus'](0x194);}else{if(_0x3da354['UserId']){throw new db[(_0xf54e('0xcb'))]['ValidationError'](_0xf54e('0xd4'));}}return _0x3da354;})[_0xf54e('0x16')](function(_0x484691){if(_0x484691){return _0x484691[_0xf54e('0x29')]({'closed':_0x4ce631['body'][_0xf54e('0x3d')],'disposition':_0x4ce631[_0xf54e('0x31')][_0xf54e('0x41')]})[_0xf54e('0x16')](function(_0x3c0755){return _0x3c0755;});}})[_0xf54e('0x16')](function(){return respondWithRpcPromise(_0xf54e('0xd5'),'abandon',_0x4ce631[_0xf54e('0x31')],client9004);})[_0xf54e('0x16')](respondWithResult(_0x39027b,null))[_0xf54e('0x20')](handleError(_0x39027b,null));};exports[_0xf54e('0xd6')]=function(_0x3733f5,_0x4e3ce0){_0x3733f5[_0xf54e('0x31')][_0xf54e('0x2e')]=_0x3733f5[_0xf54e('0xd7')][_0xf54e('0xd8')];_0x3733f5[_0xf54e('0x31')][_0xf54e('0xd9')]=_0x3733f5['file']['filename'];_0x3733f5['body'][_0xf54e('0x76')]=_0x3733f5[_0xf54e('0xd7')][_0xf54e('0xda')];return db[_0xf54e('0xdb')][_0xf54e('0xba')](_0x3733f5['body'])[_0xf54e('0x16')](respondWithResult(_0x4e3ce0,0xc9))[_0xf54e('0x20')](handleError(_0x4e3ce0,null));};exports['attachmentDownload']=function(_0x29c1ad,_0xd90115){return db[_0xf54e('0x44')]['findOne']({'where':{'id':_0x29c1ad[_0xf54e('0xbb')]['id']},'raw':!![]})[_0xf54e('0x16')](handleEntityNotFound(_0xd90115,null))[_0xf54e('0x16')](function(_0x3cbfc6){if(_0x3cbfc6){if(_0x3cbfc6[_0xf54e('0x3d')]){return _0xd90115[_0xf54e('0x21')](0x193)[_0xf54e('0x22')]({'status':0x193,'message':_0xf54e('0xdc')});}return db['Attachment'][_0xf54e('0xbe')]({'where':{'id':_0x29c1ad['query'][_0xf54e('0xdd')]},'raw':!![]})[_0xf54e('0x16')](handleEntityNotFound(_0xd90115,null));}})[_0xf54e('0x16')](function(_0x227683){if(_0x227683){var _0x10086b=_0x227683[_0xf54e('0xde')]!==null;var _0x32e453=path['join'](config['root'],'server/files/attachments/');if(_0x10086b){_0x32e453=path[_0xf54e('0xdf')](_0x32e453,'offline-chat/');}var _0x1d9795=path['join'](_0x32e453,_0x227683[_0xf54e('0xd9')]);return _0xd90115[_0xf54e('0xe0')](_0x1d9795);}})['catch'](handleError(_0xd90115,null));};exports[_0xf54e('0xe1')]=function(_0xf8dbf6,_0x1f832e){var _0xa05dcf=null;var _0x4701b8=null;var _0xfa9739=null;if(_0xf8dbf6[_0xf54e('0x31')]['id']){delete _0xf8dbf6[_0xf54e('0x31')]['id'];}if(_0xf8dbf6[_0xf54e('0x31')][_0xf54e('0xe2')]){_0xfa9739=path[_0xf54e('0xdf')](config['root'],_0xf54e('0xe3'),util[_0xf54e('0xe4')](_0xf54e('0xe5'),Date['now']()));_0xf8dbf6[_0xf54e('0x31')]['pathTranscript']=_0xfa9739;}return db[_0xf54e('0x44')][_0xf54e('0x6a')]({'where':{'id':_0xf8dbf6[_0xf54e('0xbb')]['id']},'include':[{'model':db[_0xf54e('0xe6')],'as':_0xf54e('0xe7'),'include':[{'model':db[_0xf54e('0x7a')],'as':_0xf54e('0x7a')}]}]})[_0xf54e('0x16')](handleEntityNotFound(_0x1f832e,null))[_0xf54e('0x16')](saveUpdates(_0xf8dbf6[_0xf54e('0x31')],null))[_0xf54e('0x16')](function(_0x4a2222){if(_0x4a2222){_0xa05dcf=_0x4a2222;return db['ChatWebsite']['find']({'where':{'id':_0xa05dcf[_0xf54e('0x80')]}});}})[_0xf54e('0x16')](function(_0x44fbb3){if(_0x44fbb3){_0x4701b8=_0x44fbb3;return db['CmContact'][_0xf54e('0x6a')]({'where':{'id':_0xa05dcf[_0xf54e('0x74')]}});}})['then'](function(_0x405254){if(_0x405254){if(_0xfa9739){var _0xc74621=null;for(var _0x37aeab=0x1;_0x37aeab<_0xa05dcf[_0xf54e('0xe7')][_0xf54e('0x4e')];++_0x37aeab){_0xc74621=_0xa05dcf[_0xf54e('0xe7')][_0x37aeab];var _0xbbae1c=_0xc74621['UserId']?util['format'](_0xf54e('0xe8'),_0x4701b8[_0xf54e('0xe9')],_0xc74621[_0xf54e('0x3e')]):_0xf54e('0xea');var _0x53ae5c=_0xf8dbf6[_0xf54e('0x31')][_0xf54e('0xeb')]||util['format'](_0xf54e('0xe8'),'Visitor',_0xc74621[_0xf54e('0x74')]);switch(_0x4701b8[_0xf54e('0xec')]){case _0xf54e('0xed'):_0xbbae1c=_0xc74621[_0xf54e('0x3e')]?util['format'](_0xf54e('0xe8'),_0x4701b8['agentAlias'],_0xc74621[_0xf54e('0x3e')]):_0xf54e('0xea');break;case _0xf54e('0xee'):_0xbbae1c=_0xc74621[_0xf54e('0x3e')]?_0xc74621['User']['alias']||_0xc74621[_0xf54e('0x7a')][_0xf54e('0x36')]:_0xf54e('0xea');break;case'agent_fullname':_0xbbae1c=_0xc74621[_0xf54e('0x3e')]?_0xc74621[_0xf54e('0x7a')]['fullname']:_0xf54e('0xea');break;default:_0xbbae1c=_0xc74621[_0xf54e('0x3e')]?util[_0xf54e('0xe4')](_0xf54e('0xe8'),_0x4701b8[_0xf54e('0xe9')],_0xc74621[_0xf54e('0x3e')]):'System';}var _0x1bf4d5=util[_0xf54e('0xe4')](_0xf54e('0xef'),moment(_0xc74621[_0xf54e('0x82')])[_0xf54e('0xe4')](_0xf54e('0xf0')),_0xc74621[_0xf54e('0xf1')]==='in'?_0x53ae5c:_0xbbae1c,_0xc74621[_0xf54e('0x31')]);if(!_0xc74621[_0xf54e('0xf2')]){fs[_0xf54e('0xf3')](_0xfa9739,_0x1bf4d5);}}return db[_0xf54e('0xf4')][_0xf54e('0xbe')]({'where':{'service':!![]},'include':[{'model':db[_0xf54e('0xf5')],'as':_0xf54e('0xf6'),'raw':!![],'include':[{'model':db[_0xf54e('0xf7')],'as':_0xf54e('0xf7'),'raw':!![]}]}]});}}})[_0xf54e('0x16')](function(_0x4af3ca){if(!_0x4af3ca||!_0x4af3ca[_0xf54e('0xf6')]||!_0xf8dbf6[_0xf54e('0x31')])return _0xa05dcf;var _0x49bf02=_0x4af3ca['getSmtpOptions']();return respondWithRpcPromise(_0xf54e('0xf8'),_0xf54e('0xf9'),{'account':_0x49bf02,'message':{'from':util[_0xf54e('0xe4')](_0xf54e('0xfa'),_0x4af3ca[_0xf54e('0x2e')],_0x4af3ca['email']||_0x4af3ca[_0xf54e('0xf6')]['user']),'to':_0xf8dbf6[_0xf54e('0x31')][_0xf54e('0xe2')],'subject':'Mail\x20Transcript','text':util[_0xf54e('0xe4')](_0xf54e('0xfb'),_0xf8dbf6[_0xf54e('0x31')][_0xf54e('0xe2')]),'attachments':[{'path':_0xfa9739}]}})[_0xf54e('0x16')](function(){return _0xa05dcf;})[_0xf54e('0x20')](function(_0x3770f3){logger[_0xf54e('0x1c')](_0x3770f3);});})[_0xf54e('0x16')](respondWithStatusCode(_0x1f832e,0xc8))['catch'](handleError(_0x1f832e,null));};exports[_0xf54e('0xfc')]=function(_0x5144f6,_0x1591e5){return db[_0xf54e('0xe6')]['find']({'where':{'id':_0x5144f6[_0xf54e('0xbb')]['id']}})['then'](handleEntityNotFound(_0x1591e5,null))[_0xf54e('0x16')](function(_0x826b2f){if(_0x826b2f){return _0x826b2f['addMessage'](_0x5144f6[_0xf54e('0x31')][_0xf54e('0xfd')],_['omit'](_0x5144f6['body'],['ids','id'])||{});}})[_0xf54e('0x16')](respondWithResult(_0x1591e5,null))[_0xf54e('0x20')](handleError(_0x1591e5,null));};exports[_0xf54e('0xfe')]=function(_0x369bfa,_0x3f5c0d){var _0x40d611={'raw':![],'where':{}};var _0x2514fa={};var _0x42d495={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x369bfa[_0xf54e('0xbb')]['id']}})[_0xf54e('0x16')](handleEntityNotFound(_0x3f5c0d,null))[_0xf54e('0x16')](function(_0x3e8afe){if(_0x3e8afe){_0x2514fa[_0xf54e('0x48')]=_['keys'](db[_0xf54e('0xe6')]['rawAttributes']);_0x2514fa['query']=_[_0xf54e('0x4a')](_0x369bfa[_0xf54e('0x49')]);_0x2514fa[_0xf54e('0x54')]=_[_0xf54e('0x4b')](_0x2514fa[_0xf54e('0x48')],_0x2514fa[_0xf54e('0x49')]);_0x40d611[_0xf54e('0x4c')]=_['intersection'](_0x2514fa[_0xf54e('0x48')],qs[_0xf54e('0x4d')](_0x369bfa[_0xf54e('0x49')][_0xf54e('0x4d')]));_0x40d611[_0xf54e('0x4c')]=_0x40d611['attributes'][_0xf54e('0x4e')]?_0x40d611[_0xf54e('0x4c')]:_0x2514fa[_0xf54e('0x48')];if(!_0x369bfa[_0xf54e('0x49')][_0xf54e('0x4f')]('nolimit')){_0x40d611['limit']=qs[_0xf54e('0x25')](_0x369bfa[_0xf54e('0x49')][_0xf54e('0x25')]);_0x40d611['offset']=qs[_0xf54e('0x23')](_0x369bfa[_0xf54e('0x49')][_0xf54e('0x23')]);}_0x40d611[_0xf54e('0x51')]=qs['sort'](_0x369bfa[_0xf54e('0x49')][_0xf54e('0x52')]);_0x40d611[_0xf54e('0x53')]=qs['filters'](_[_0xf54e('0x55')](_0x369bfa[_0xf54e('0x49')],_0x2514fa[_0xf54e('0x54')]));_0x40d611[_0xf54e('0x53')][_0xf54e('0xb6')]=_0x3e8afe['id'];if(_0x369bfa[_0xf54e('0x49')][_0xf54e('0x8d')]){_0x40d611[_0xf54e('0x53')]=_['merge'](_0x40d611[_0xf54e('0x53')],{'$or':_[_0xf54e('0x35')](_0x40d611[_0xf54e('0x4c')],function(_0x384519){var _0x5ceeda={};_0x5ceeda[_0x384519]={'$like':'%'+_0x369bfa['query']['filter']+'%'};return _0x5ceeda;})});}if(_0x369bfa['query'][_0xf54e('0x84')]){var _0x3ff3cc=_0x369bfa[_0xf54e('0x49')]['$gte']['split'](',');var _0xd82fad={};_0xd82fad[_0x3ff3cc[0x0]]={'$gte':moment(_0x3ff3cc[0x1])['format'](_0xf54e('0xff'))};_0x40d611['where']=_[_0xf54e('0x30')](_0x40d611[_0xf54e('0x53')],_0xd82fad);}_0x40d611=_[_0xf54e('0x30')]({},_0x40d611,_0x369bfa['options']);return db[_0xf54e('0xe6')][_0xf54e('0x26')]({'where':_0x40d611[_0xf54e('0x53')]})[_0xf54e('0x16')](function(_0x4d0e0c){_0x42d495[_0xf54e('0x26')]=_0x4d0e0c;if(_0x369bfa[_0xf54e('0x49')][_0xf54e('0x100')]){_0x40d611[_0xf54e('0x101')]=[{'all':!![]}];}return db[_0xf54e('0xe6')][_0xf54e('0x102')](_0x40d611);})['then'](function(_0x31e4c1){_0x42d495['rows']=_0x31e4c1;return _0x42d495;});}})['then'](respondWithFilteredResult(_0x3f5c0d,_0x40d611))[_0xf54e('0x20')](handleError(_0x3f5c0d,null));};exports['getMyMessages']=function(_0x36e321,_0x2775b3){var _0x56411c={'where':{}},_0x53b6a7={},_0x32fa55={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf54e('0xbe')]({'where':{'id':_0x36e321[_0xf54e('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2775b3,null))[_0xf54e('0x16')](function(_0x4ec7ed){if(_0x4ec7ed){_0x53b6a7[_0xf54e('0x48')]=_[_0xf54e('0x4a')](db['ChatMessage'][_0xf54e('0x45')]);_0x53b6a7[_0xf54e('0x49')]=_[_0xf54e('0x4a')](_0x36e321[_0xf54e('0x49')]);_0x53b6a7[_0xf54e('0x54')]=_[_0xf54e('0x4b')](_0x53b6a7[_0xf54e('0x48')],_0x53b6a7[_0xf54e('0x49')]);_0x56411c[_0xf54e('0x4c')]=_['intersection'](_0x53b6a7['model'],qs[_0xf54e('0x4d')](_0x36e321[_0xf54e('0x49')][_0xf54e('0x4d')]));_0x56411c[_0xf54e('0x4c')]=_0x56411c['attributes'][_0xf54e('0x4e')]?_0x56411c[_0xf54e('0x4c')]:_0x53b6a7['model'];if(!_0x36e321[_0xf54e('0x49')][_0xf54e('0x4f')](_0xf54e('0x50'))){_0x56411c[_0xf54e('0x25')]=qs[_0xf54e('0x25')](_0x36e321[_0xf54e('0x49')][_0xf54e('0x25')]);_0x56411c[_0xf54e('0x23')]=qs[_0xf54e('0x23')](_0x36e321[_0xf54e('0x49')][_0xf54e('0x23')]);}_0x56411c['order']=qs['sort'](_0x36e321[_0xf54e('0x49')][_0xf54e('0x52')]);_0x56411c[_0xf54e('0x53')]=qs[_0xf54e('0x54')](_[_0xf54e('0x55')](_0x36e321[_0xf54e('0x49')],_0x53b6a7['filters']));_0x56411c[_0xf54e('0x53')][_0xf54e('0xb6')]=_0x4ec7ed['id'];if(_0x36e321['query'][_0xf54e('0x8d')]){_0x56411c[_0xf54e('0x53')]=_[_0xf54e('0x30')](_0x56411c[_0xf54e('0x53')],{'$or':_['map'](_0x56411c['attributes'],function(_0x19a77b){var _0x23d25a={};_0x23d25a[_0x19a77b]={'$like':'%'+_0x36e321[_0xf54e('0x49')][_0xf54e('0x8d')]+'%'};return _0x23d25a;})});}_0x56411c['where']['secret']=![];if(_0x36e321[_0xf54e('0x49')]['id']){_0x56411c[_0xf54e('0x53')]['id']={'$gt':_0x36e321[_0xf54e('0x49')]['id']};}_0x56411c=_['merge']({},_0x56411c,_0x36e321[_0xf54e('0xb9')]);return db[_0xf54e('0xe6')][_0xf54e('0x26')]({'where':_0x56411c[_0xf54e('0x53')]})['then'](function(_0x2d172b){_0x32fa55['count']=_0x2d172b;_0x56411c[_0xf54e('0x101')]=[];if(_0x36e321[_0xf54e('0x49')][_0xf54e('0x103')]){_0x56411c[_0xf54e('0x101')]['push']({'model':db[_0xf54e('0x7a')],'as':_0xf54e('0x7a'),'attributes':['id',_0xf54e('0x36'),'alias']});}if(_0x36e321[_0xf54e('0x49')][_0xf54e('0x100')]){_0x56411c[_0xf54e('0x101')]=[{'all':!![]}];}return db['ChatMessage'][_0xf54e('0x102')](_0x56411c);})[_0xf54e('0x16')](function(_0x30358d){_0x32fa55[_0xf54e('0xb8')]=_0x30358d;return _0x32fa55;});}})[_0xf54e('0x16')](respondWithFilteredResult(_0x2775b3,_0x56411c))[_0xf54e('0x20')](handleError(_0x2775b3,null));};exports[_0xf54e('0x104')]=function(_0x13dd5a,_0x16d313){return db[_0xf54e('0x44')][_0xf54e('0x6a')]({'where':{'id':_0x13dd5a[_0xf54e('0xbb')]['id']}})[_0xf54e('0x16')](handleEntityNotFound(_0x16d313,null))[_0xf54e('0x16')](function(_0xaaf1ba){if(_0xaaf1ba){return _0xaaf1ba[_0xf54e('0x105')](_0x13dd5a[_0xf54e('0x31')][_0xf54e('0xfd')],_['omit'](_0x13dd5a[_0xf54e('0x31')],[_0xf54e('0xfd'),'id'])||{})[_0xf54e('0x106')](function(){return db[_0xf54e('0x107')][_0xf54e('0x102')]({'attributes':['id',_0xf54e('0x2e'),_0xf54e('0x108')],'where':{'id':_0x13dd5a[_0xf54e('0x31')][_0xf54e('0xfd')]}});})[_0xf54e('0x16')](function(_0x354f69){socket[_0xf54e('0x109')](_0xf54e('0x10a'),{'id':Number(_0x13dd5a[_0xf54e('0xbb')]['id']),'tags':_0x354f69||[]});return{'id':Number(_0x13dd5a[_0xf54e('0xbb')]['id']),'tags':_0x354f69||[]};});}})[_0xf54e('0x16')](respondWithResult(_0x16d313,null))['catch'](handleError(_0x16d313,null));};exports[_0xf54e('0x10b')]=function(_0x28a3f8,_0x1ea814){return db[_0xf54e('0x44')]['find']({'where':{'id':_0x28a3f8[_0xf54e('0xbb')]['id']}})[_0xf54e('0x16')](handleEntityNotFound(_0x1ea814,null))['then'](function(_0xbd64cf){if(_0xbd64cf){return _0xbd64cf[_0xf54e('0x10b')](_0x28a3f8[_0xf54e('0x49')][_0xf54e('0xfd')]);}})[_0xf54e('0x16')](respondWithStatusCode(_0x1ea814,null))[_0xf54e('0x20')](handleError(_0x1ea814,null));};exports[_0xf54e('0xe0')]=function(_0x22f8ad,_0x269670){var _0x17801c=moment()['unix']()[_0xf54e('0x9f')]();var _0x6af5dd=path[_0xf54e('0xdf')](config[_0xf54e('0x10c')],_0xf54e('0x10d'),_0xf54e('0x10e'),_0xf54e('0x10f'));var _0x57f2c8=path[_0xf54e('0xdf')](config[_0xf54e('0x10c')],_0xf54e('0x10d'),_0xf54e('0x10e'),_0xf54e('0x110'));var _0x2932f0=path[_0xf54e('0xdf')](_0x6af5dd,_0x17801c);var _0x3ba5e0=util[_0xf54e('0xe4')](_0xf54e('0x111'),_0x22f8ad['params']['id'],_0x17801c);var _0xb1e536=path[_0xf54e('0xdf')](_0x6af5dd,_0x3ba5e0);var _0x57ae4e=[];_0x57ae4e['push']({'model':db[_0xf54e('0x7a')],'as':_0xf54e('0x7a'),'attributes':['id',_0xf54e('0x36')],'raw':!![]});_0x57ae4e[_0xf54e('0x39')]({'model':db[_0xf54e('0xd3')],'as':_0xf54e('0x6f'),'attributes':['id',_0xf54e('0x112'),_0xf54e('0x113')],'raw':!![]});if(_0x22f8ad[_0xf54e('0x49')][_0xf54e('0x110')]){_0x57ae4e['push']({'model':db[_0xf54e('0xdb')],'as':_0xf54e('0xdb'),'raw':!![]});}var _0x596efb=[{'model':db['ChatMessage'],'as':_0xf54e('0xe7'),'attributes':['id',_0xf54e('0x31'),'createdAt',_0xf54e('0xf1'),_0xf54e('0xf2'),_0xf54e('0x88')],'include':_0x57ae4e}];_0x596efb['push']({'model':db['ChatWebsite'],'as':_0xf54e('0x114'),'attributes':['id','name']});_0x596efb[_0xf54e('0x39')]({'model':db[_0xf54e('0x7a')],'as':_0xf54e('0x115'),'attributes':['id',_0xf54e('0x36')]});return db[_0xf54e('0x44')]['find']({'where':{'id':_0x22f8ad['params']['id']},'include':_0x596efb})[_0xf54e('0x16')](handleEntityNotFound(_0x269670,null))[_0xf54e('0x16')](function(_0x497414){if(_0x497414){var _0x127b6c=_0x497414[_0xf54e('0x116')]({'plain':!![]});fs[_0xf54e('0x117')](_0x2932f0);var _0x1dd5fd={'channel':_0xf54e('0x118'),'account':_0x127b6c['Account']['name'],'agent':_0x127b6c[_0xf54e('0x115')]?_0x127b6c[_0xf54e('0x115')][_0xf54e('0x36')]:_0xf54e('0x119'),'createdAt':moment(_0x127b6c[_0xf54e('0x82')])['format'](_0xf54e('0xff'))[_0xf54e('0x9f')](),'closedAt':_0x127b6c[_0xf54e('0x3d')]?moment(_0x127b6c['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x127b6c['disposition'],'chatInfo':{'browser':_0x127b6c['browserName'],'os':_0x127b6c[_0xf54e('0x11a')],'referer':_0x127b6c[_0xf54e('0x11b')],'customerIp':_0x127b6c['customerIp'],'customerPort':_0x127b6c[_0xf54e('0x11c')]?_0x127b6c[_0xf54e('0x11c')]:_0xf54e('0x119')},'messages':_(_0x127b6c[_0xf54e('0xe7')])[_0xf54e('0x11d')]()[_0xf54e('0x8d')]({'secret':![]})[_0xf54e('0x35')](function(_0x53e6e6){if(_0x53e6e6['Attachment']){var _0x4d79d6=path[_0xf54e('0xdf')](_0x57f2c8,_0x53e6e6[_0xf54e('0xdb')]['basename']);if(fs[_0xf54e('0x11e')](_0x4d79d6)){fs[_0xf54e('0x11f')](_0x4d79d6)[_0xf54e('0x120')](fs['createWriteStream'](path[_0xf54e('0xdf')](_0x2932f0,_0x53e6e6[_0xf54e('0xdb')][_0xf54e('0xd9')])));}}return{'date':moment(_0x53e6e6['createdAt'])[_0xf54e('0xe4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf54e('0x9f')](),'sender':_0x53e6e6[_0xf54e('0xf1')]===_0xf54e('0xd0')?_0x53e6e6[_0xf54e('0x7a')]?_0x53e6e6[_0xf54e('0x7a')]['fullname']:_0xf54e('0xea'):_0x53e6e6[_0xf54e('0x6f')][_0xf54e('0x112')]+(_0x53e6e6[_0xf54e('0x6f')][_0xf54e('0x113')]?'\x20'+_0x53e6e6[_0xf54e('0x6f')]['lastName']:''),'body':_0x53e6e6[_0xf54e('0xdb')]?_0x53e6e6[_0xf54e('0xdb')][_0xf54e('0xd9')]:_0x53e6e6[_0xf54e('0x31')],'direction':_0x53e6e6[_0xf54e('0xf1')]===_0xf54e('0xd0')?'A':'C','secret':_0x53e6e6[_0xf54e('0xf2')],'read':_0x53e6e6[_0xf54e('0x88')],'attachment':_0x53e6e6['Attachment']};})[_0xf54e('0x6c')]()};return ejs[_0xf54e('0x121')](path[_0xf54e('0xdf')](config[_0xf54e('0x10c')],_0xf54e('0x10d'),_0xf54e('0x122'),_0xf54e('0x123')),{'interaction':_0x1dd5fd})[_0xf54e('0x16')](function(_0x2ea0bf){var _0x3fd7db=path[_0xf54e('0xdf')](_0x2932f0,_0xf54e('0x124')+_0x127b6c['id']+'-'+_0x17801c+_0xf54e('0x125'));var _0x13305c={'path':_0x3fd7db,'channel':_0xf54e('0x118'),'interactionId':_0x127b6c['id']};return pdf[_0xf54e('0x126')](_0x2ea0bf,_0x13305c);})[_0xf54e('0x16')](function(){return new Promise(function(_0x5ee371,_0x2310f0){zipdir(_0x2932f0,{'saveTo':_0xb1e536},function(_0x28df44,_0xc4b0a0){if(_0x28df44)return _0x2310f0(_0x28df44);return _0x5ee371(_0xc4b0a0);});})[_0xf54e('0x16')](function(){return new BPromise(function(_0x1eb3c7,_0x12663d){rimraf(_0x2932f0,function(_0x3c4862){if(_0x3c4862)_0x12663d(_0x3c4862);return _0x1eb3c7();});});})[_0xf54e('0x16')](function(){return _0x269670[_0xf54e('0xe0')](_0xb1e536,_0x3ba5e0,function(_0x3e4955){if(_0x3e4955){logger['error'](_0xf54e('0x127'),_0x3e4955);}else{fs[_0xf54e('0x128')](_0xb1e536);}});});});}else{return _0x269670['sendStatus'](0xc8);}})[_0xf54e('0x20')](handleError(_0x269670,null));}; \ No newline at end of file +var _0xf4eb=['fullname','TagIds','Tags','push','waiting','talking','answered','abandoned','total','closed','disposition','UserId','index','map','ChatInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','field','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','users','chat_interactions','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','Owner.fullname','Owner.internal','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','options','create','update','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','isNull','follow','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','nolimit','secret','includeAgent','addTags','setTags','spread','unix','server','files','tmp','transcript-%d-%s.zip','firstName','attachments','Owner','get','Chat','N.A.','referer','customerPort','existsSync','createReadStream','createWriteStream','out','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','rimraf','mustache','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','json','destroy','stack','name','send','render','merge','body','contact','interaction','account'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1832fd,_0x2097c2){_0x1832fd=_0x1832fd-0x0;var _0x1cb191=_0xf4eb[_0x1832fd];return _0x1cb191;};'use strict';var rimraf=require(_0xbf4e('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x1'));var util=require('util');var path=require('path');var ejs=require(_0xbf4e('0x2'));var fs=require('fs');var _=require(_0xbf4e('0x3'));var squel=require(_0xbf4e('0x4'));var Redis=require(_0xbf4e('0x5'));var qs=require(_0xbf4e('0x6'));var as=require(_0xbf4e('0x7'));var pdf=require(_0xbf4e('0x8'));var logger=require('../../config/logger')(_0xbf4e('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xbf4e('0xa')]=_[_0xbf4e('0xb')](config[_0xbf4e('0xa')],{'host':_0xbf4e('0xc'),'port':0x18eb});var socket=require(_0xbf4e('0xd'))(new Redis(config[_0xbf4e('0xa')]));require(_0xbf4e('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xbf4e('0xf')]['http']({'port':0x232b});var client9004=jayson[_0xbf4e('0xf')][_0xbf4e('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x54a96e,_0x17fd01,_0x5a3035,_0x56d185){return new BPromise(function(_0x209b25,_0x46c79c){var _0x1e029b=_0x56d185||client;return _0x1e029b[_0xbf4e('0x11')](_0x54a96e,_0x5a3035)[_0xbf4e('0x12')](function(_0x61bd54){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x17fd01,_0xbf4e('0x13'));logger[_0xbf4e('0x14')](_0xbf4e('0x15'),_0x17fd01,'request\x20sent',JSON[_0xbf4e('0x16')](_0x61bd54));if(_0x61bd54[_0xbf4e('0x17')]){if(_0x61bd54[_0xbf4e('0x17')][_0xbf4e('0x18')]===0x1f4){logger['error'](_0xbf4e('0x19'),_0x17fd01,_0x61bd54['error']['message']);return _0x46c79c(_0x61bd54['error']['message']);}logger[_0xbf4e('0x17')](_0xbf4e('0x19'),_0x17fd01,_0x61bd54[_0xbf4e('0x17')]['message']);return _0x209b25(_0x61bd54['error'][_0xbf4e('0x1a')]);}else{logger[_0xbf4e('0x1b')](_0xbf4e('0x19'),_0x17fd01,_0xbf4e('0x13'));_0x209b25(_0x61bd54[_0xbf4e('0x1c')][_0xbf4e('0x1a')]);}})[_0xbf4e('0x1d')](function(_0x3d642a){logger[_0xbf4e('0x17')](_0xbf4e('0x19'),_0x17fd01,_0x3d642a);_0x46c79c(_0x3d642a);});});}function respondWithStatusCode(_0x30539b,_0x59bd84){_0x59bd84=_0x59bd84||0xcc;return function(_0x1ff2ec){if(_0x1ff2ec){return _0x30539b[_0xbf4e('0x1e')](_0x59bd84);}return _0x30539b['status'](_0x59bd84)[_0xbf4e('0x1f')]();};}function respondWithResult(_0x30994d,_0x114412){_0x114412=_0x114412||0xc8;return function(_0x1bda8b){if(_0x1bda8b){return _0x30994d[_0xbf4e('0x20')](_0x114412)['json'](_0x1bda8b);}};}function respondWithFilteredResult(_0x90635e,_0x36688a){return function(_0x3d6863){if(_0x3d6863){var _0x5766d4=typeof _0x36688a[_0xbf4e('0x21')]==='undefined'&&typeof _0x36688a['limit']===_0xbf4e('0x22');var _0x5a0a9b=_0x3d6863[_0xbf4e('0x23')];var _0x315df3=_0x5766d4?0x0:_0x36688a[_0xbf4e('0x21')];var _0x41f918=_0x5766d4?_0x3d6863['count']:_0x36688a[_0xbf4e('0x21')]+_0x36688a[_0xbf4e('0x24')];var _0x43879d;if(_0x41f918>=_0x5a0a9b){_0x41f918=_0x5a0a9b;_0x43879d=0xc8;}else{_0x43879d=0xce;}_0x90635e['status'](_0x43879d);return _0x90635e[_0xbf4e('0x25')]('Content-Range',_0x315df3+'-'+_0x41f918+'/'+_0x5a0a9b)[_0xbf4e('0x26')](_0x3d6863);}return null;};}function saveUpdates(_0x1421e1){return function(_0xb8b58e){if(_0xb8b58e){return _0xb8b58e['update'](_0x1421e1)[_0xbf4e('0x12')](function(_0x362716){return _0x362716;});}return null;};}function removeEntity(_0x2f3cf8){return function(_0xc7ca87){if(_0xc7ca87){return _0xc7ca87[_0xbf4e('0x27')]()[_0xbf4e('0x12')](function(){_0x2f3cf8['status'](0xcc)[_0xbf4e('0x1f')]();});}};}function handleEntityNotFound(_0x154576){return function(_0x5e32c0){if(!_0x5e32c0){_0x154576[_0xbf4e('0x1e')](0x194);}return _0x5e32c0;};}function handleError(_0x26a375,_0x5473ed){_0x5473ed=_0x5473ed||0x1f4;return function(_0x23d769){logger['error'](_0x23d769[_0xbf4e('0x28')]);if(_0x23d769['name']){delete _0x23d769[_0xbf4e('0x29')];}_0x26a375[_0xbf4e('0x20')](_0x5473ed)[_0xbf4e('0x2a')](_0x23d769);};}function getMustacheRender(_0x5b3b28,_0x2716b7){return Mustache[_0xbf4e('0x2b')](_0x5b3b28,_[_0xbf4e('0x2c')](_0x2716b7[_0xbf4e('0x2d')],{'contact':_0x2716b7[_0xbf4e('0x2e')],'message':_0x2716b7[_0xbf4e('0x1a')],'agent':_0x2716b7['agent'],'interaction':_0x2716b7[_0xbf4e('0x2f')],'account':_0x2716b7[_0xbf4e('0x30')]}))||'';}function getInteractionUsers(_0x25b837,_0x3bba55){return new BPromise(function(_0x31d49a,_0x5b7ea1){try{if(_0x3bba55[_0x25b837['id']]){_0x25b837['Users']=_['map'](_0x3bba55[_0x25b837['id']],function(_0x4be59a){return{'id':_0x4be59a['id'],'fullname':_0x4be59a[_0xbf4e('0x31')]};});}}catch(_0x17a1a1){_0x5b7ea1(_0x17a1a1);}_0x31d49a(_0x25b837);});}function getInteractionTags(_0x91b52f,_0x2693ba){return new BPromise(function(_0x22ddde,_0x257b74){try{if(_0x91b52f[_0xbf4e('0x32')]){_0x91b52f[_0xbf4e('0x33')]=[];_0x91b52f[_0xbf4e('0x32')]['split'](',')['forEach'](function(_0x303fd8){_0x91b52f[_0xbf4e('0x33')][_0xbf4e('0x34')](_0x2693ba[_0x303fd8]);});}delete _0x91b52f['TagIds'];}catch(_0x3f46f1){_0x257b74(_0x3f46f1);}_0x22ddde(_0x91b52f);});}function updateChatInteraction(_0x4e72a2,_0x370d90,_0x22a5b2){return new BPromise(function(_0xd0bcf0,_0xb30f90){return getInteractionUsers(_0x4e72a2,_0x22a5b2)['then'](function(_0x31d8dc){return getInteractionTags(_0x31d8dc,_0x370d90);})[_0xbf4e('0x12')](function(_0x3aa308){return getStateInteraction(_0x3aa308);})[_0xbf4e('0x12')](function(_0x5dec7d){_0xd0bcf0(_0x5dec7d);})[_0xbf4e('0x1d')](function(_0x44e96b){_0xb30f90(_0x44e96b);});});}function getStateInteraction(_0x148d94){return new BPromise(function(_0x29fe9d){_0x148d94[_0xbf4e('0x35')]=0x0;_0x148d94[_0xbf4e('0x36')]=0x0;_0x148d94[_0xbf4e('0x37')]=0x0;_0x148d94['unmanaged']=0x0;_0x148d94[_0xbf4e('0x38')]=0x0;_0x148d94[_0xbf4e('0x39')]=0x0;if(!_0x148d94['closed']&&!_0x148d94['UserId']){_0x148d94[_0xbf4e('0x35')]+=0x1;}if(!_0x148d94[_0xbf4e('0x3a')]&&_0x148d94['UserId']){_0x148d94['talking']+=0x1;if(_0x148d94[_0xbf4e('0x35')]){_0x148d94[_0xbf4e('0x35')]-=0x1;}}if(_0x148d94[_0xbf4e('0x3a')]&&_0x148d94[_0xbf4e('0x3b')]===_0xbf4e('0x38')){_0x148d94[_0xbf4e('0x38')]+=0x1;if(_0x148d94['waiting']){_0x148d94[_0xbf4e('0x35')]-=0x1;}}else if(_0x148d94[_0xbf4e('0x3a')]&&!_0x148d94['UserId']&&_0x148d94['disposition']){_0x148d94['unmanaged']+=0x1;if(_0x148d94['waiting']){_0x148d94[_0xbf4e('0x35')]-=0x1;}}else if(_0x148d94['closed']&&_0x148d94[_0xbf4e('0x3c')]){_0x148d94[_0xbf4e('0x37')]+=0x1;if(_0x148d94['talking']){_0x148d94['talking']-=0x1;}}_0x148d94[_0xbf4e('0x39')]+=0x1;_0x29fe9d(_0x148d94);});}exports[_0xbf4e('0x3d')]=function(_0x46967c,_0x40c147){var _0x8ab634={},_0x52cf6a={},_0x2b20d3={'count':0x0,'rows':[]};var _0x3e8ade=_[_0xbf4e('0x3e')](db[_0xbf4e('0x3f')][_0xbf4e('0x40')],function(_0x1bc421){return{'name':_0x1bc421[_0xbf4e('0x41')],'type':_0x1bc421[_0xbf4e('0x42')]['key']};});_0x52cf6a[_0xbf4e('0x43')]=_[_0xbf4e('0x3e')](_0x3e8ade,_0xbf4e('0x29'));_0x52cf6a[_0xbf4e('0x44')]=_[_0xbf4e('0x45')](_0x46967c[_0xbf4e('0x44')]);_0x52cf6a[_0xbf4e('0x46')]=_[_0xbf4e('0x47')](_0x52cf6a[_0xbf4e('0x43')],_0x52cf6a[_0xbf4e('0x44')]);_0x8ab634[_0xbf4e('0x48')]=_[_0xbf4e('0x47')](_0x52cf6a[_0xbf4e('0x43')],qs[_0xbf4e('0x49')](_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x49')]));_0x8ab634[_0xbf4e('0x48')]=_0x8ab634['attributes'][_0xbf4e('0x4a')]?_0x8ab634[_0xbf4e('0x48')]:_0x52cf6a[_0xbf4e('0x43')];if(!_0x46967c['query'][_0xbf4e('0x4b')]('nolimit')){_0x8ab634['limit']=qs[_0xbf4e('0x24')](_0x46967c[_0xbf4e('0x44')]['limit']);_0x8ab634[_0xbf4e('0x21')]=qs[_0xbf4e('0x21')](_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x21')]);}_0x8ab634[_0xbf4e('0x4c')]=qs[_0xbf4e('0x4d')](_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x4d')]);_0x8ab634[_0xbf4e('0x4e')]=qs[_0xbf4e('0x46')](_[_0xbf4e('0x4f')](_0x46967c['query'],_0x52cf6a['filters']),_0x3e8ade);var _0xad8934=[];var _0x371799=squel[_0xbf4e('0x50')]()['field']('id')[_0xbf4e('0x51')](_0xbf4e('0x29'))['field']('color')[_0xbf4e('0x52')]('tools_tags');var _0x510548=squel[_0xbf4e('0x50')]()[_0xbf4e('0x51')](_0xbf4e('0x53'))[_0xbf4e('0x51')](_0xbf4e('0x54'))['field'](_0xbf4e('0x55'))['from'](_0xbf4e('0x56'),'ui')['left_join'](_0xbf4e('0x57'),'u','u.id\x20=\x20ui.UserId');var _0xab6991=squel[_0xbf4e('0x50')]()[_0xbf4e('0x52')](_0xbf4e('0x58'),'i')[_0xbf4e('0x59')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xbf4e('0x5a'))[_0xbf4e('0x59')]('chat_websites','a',_0xbf4e('0x5b'))[_0xbf4e('0x59')](_0xbf4e('0x5c'),'me',_0xbf4e('0x5d'))[_0xbf4e('0x59')](_0xbf4e('0x5e'),'it',_0xbf4e('0x5f'))['left_join'](_0xbf4e('0x60'),'t',_0xbf4e('0x61'));var _0x42e117=squel['expr']();var _0x56338e=[];var _0x64d8ea=squel[_0xbf4e('0x62')]();var _0x2e8a62;if(_0x46967c['query'][_0xbf4e('0x63')]){_0x2e8a62=as[_0xbf4e('0x64')](_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x63')]);var _0x18920e=_0x2e8a62[_0xbf4e('0x65')];for(var _0x35ce41=0x0;_0x35ce41<_0x2e8a62[_0xbf4e('0x66')][_0xbf4e('0x4a')];_0x35ce41++){var _0x3025c5=_0x2e8a62[_0xbf4e('0x66')][_0x35ce41];var _0x17bf52='i';var _0x4b09af=_[_0xbf4e('0x67')](_0x3e8ade,['name',_0x3025c5[_0xbf4e('0x51')]]);if(!_0x4b09af){switch(_0x3025c5[_0xbf4e('0x51')]){case _0xbf4e('0x68'):if(_0x3025c5[_0xbf4e('0x69')]==0x1){_0xab6991[_0xbf4e('0x6a')]('`'+_0x3025c5[_0xbf4e('0x51')]+_0xbf4e('0x6b'));}else{_0xab6991[_0xbf4e('0x6a')]('`'+_0x3025c5['field']+_0xbf4e('0x6c'));}break;case _0xbf4e('0x6d'):if(_0x3025c5[_0xbf4e('0x6e')]===_0xbf4e('0x6f')){if(_0x3025c5[_0xbf4e('0x69')]['split']('\x20')[_0xbf4e('0x4a')]>0x1){_0x42e117[_0x18920e](_0xbf4e('0x70'),qs[_0xbf4e('0x71')](_0x3025c5[_0xbf4e('0x69')]),null);}else{var _0x12f19f='%'+_0x3025c5[_0xbf4e('0x69')]+'%';_0x42e117[_0x18920e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x12f19f,_0x12f19f,_0x12f19f);}}else{_0x4b09af=_[_0xbf4e('0x67')](_0x3e8ade,['name',_0xbf4e('0x72')]);_0x3025c5[_0xbf4e('0x51')]=_0xbf4e('0x72');_0x34116f=as[_0xbf4e('0x73')](_0x17bf52,_0x4b09af['type'],_0x3025c5);_0x42e117[_0x18920e](_0x34116f[_0xbf4e('0x74')],_0x34116f['value']['start'],_0x34116f[_0xbf4e('0x69')][_0xbf4e('0x1f')]);}break;case _0xbf4e('0x75'):var _0x56f3e0=_0x3025c5[_0xbf4e('0x69')][_0xbf4e('0x76')](',')['map'](function(_0x19c5b4){return Number(_0x19c5b4);});_0x56f3e0[_0xbf4e('0x77')](function(_0x4405b9){_0x64d8ea['or'](_0xbf4e('0x78'),'%,'+_0x4405b9+',%');});_0x56338e=_[_0xbf4e('0x79')](_0x56338e,_0x56f3e0);break;case _0xbf4e('0x7a'):if(_0x3025c5[_0xbf4e('0x6e')]===_0xbf4e('0x6f')){_0x42e117[_0x18920e](_0xbf4e('0x7b'),'%'+_0x3025c5['value']+'%',null);}else{_0x4b09af=_[_0xbf4e('0x67')](_0x3e8ade,[_0xbf4e('0x29'),_0xbf4e('0x3c')]);_0x3025c5[_0xbf4e('0x51')]='UserId';_0x34116f=as[_0xbf4e('0x73')](_0x17bf52,_0x4b09af[_0xbf4e('0x42')],_0x3025c5);_0x42e117[_0x18920e](_0x34116f[_0xbf4e('0x74')],_0x34116f[_0xbf4e('0x69')][_0xbf4e('0x7c')],_0x34116f[_0xbf4e('0x69')][_0xbf4e('0x1f')]);}break;case _0xbf4e('0x2d'):_0x34116f=as[_0xbf4e('0x73')]('me',null,_0x3025c5);_0x42e117[_0x18920e](_0x34116f['text'],_0x34116f[_0xbf4e('0x69')]['start'],_0x34116f[_0xbf4e('0x69')][_0xbf4e('0x1f')]);break;}}else{var _0x34116f=as[_0xbf4e('0x73')](_0x17bf52,_0x4b09af[_0xbf4e('0x42')],_0x3025c5);_0x42e117[_0x18920e](_0x34116f['text'],_0x34116f[_0xbf4e('0x69')][_0xbf4e('0x7c')],_0x34116f[_0xbf4e('0x69')]['end']);}}}else{var _0x471028=_(_0x46967c[_0xbf4e('0x44')])[_0xbf4e('0x45')]()['map'](function(_0x25b9de){return _[_0xbf4e('0x7d')](_0x3e8ade,[_0xbf4e('0x29'),_0x25b9de])?_0x25b9de:undefined;})[_0xbf4e('0x7e')]()[_0xbf4e('0x69')]();if(!_['isEmpty'](_0x471028)){_0x471028[_0xbf4e('0x77')](function(_0x4e0d91){if(_0x4e0d91===_0xbf4e('0x7f')){_0xab6991['where'](_0xbf4e('0x80'),[]['concat'](_0x46967c[_0xbf4e('0x44')][_0x4e0d91]));}else if(_0x4e0d91==='createdAt'){var _0x4405eb=JSON[_0xbf4e('0x81')](_0x46967c[_0xbf4e('0x44')][_0x4e0d91])[_0xbf4e('0x82')];var _0x272bf7=JSON[_0xbf4e('0x81')](_0x46967c[_0xbf4e('0x44')][_0x4e0d91])['$lte'];_0xab6991[_0xbf4e('0x4e')](_0xbf4e('0x83'),_0x4405eb,_0x272bf7);}else{if(_0x46967c[_0xbf4e('0x44')][_0x4e0d91]===_0xbf4e('0x84')){_0xab6991[_0xbf4e('0x4e')]('i.'+_0x4e0d91+_0xbf4e('0x85'));}else{_0xab6991['where']('i.'+_0x4e0d91+_0xbf4e('0x86'),_0x46967c[_0xbf4e('0x44')][_0x4e0d91]);}}});}if(_0x46967c['query'][_0xbf4e('0x87')]){if(_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x87')]==0x1){_0xab6991[_0xbf4e('0x6a')](_0xbf4e('0x88'));}else{_0xab6991[_0xbf4e('0x6a')](_0xbf4e('0x89'));}}if(_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x8a')]){_0x56338e=_['isArray'](_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x8a')])?_0x46967c[_0xbf4e('0x44')]['tag']:new Array(_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x8a')]);_0x56338e['forEach'](function(_0x3d17dd){_0x64d8ea['or'](_0xbf4e('0x78'),'%,'+_0x3d17dd+',%');});}if(_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x8b')]){var _0x15d424=_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x8b')][_0xbf4e('0x8c')]('\x5c','\x5c\x5c')[_0xbf4e('0x8c')](/'/g,'\x27\x27');if(qs[_0xbf4e('0x8d')](_0x15d424)){_0x42e117['or']('i.id\x20LIKE\x20?',_0x15d424+'%');}else{_0x42e117['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf4e('0x71')](_0x15d424))['or'](_0xbf4e('0x8e'),_0x15d424+'%');}}}_0xab6991[_0xbf4e('0x4e')](_0x42e117);_0xab6991[_0xbf4e('0x8f')]('i.id');var _0x19108b={'type':db[_0xbf4e('0x90')][_0xbf4e('0x91')][_0xbf4e('0x92')],'raw':!![]};var _0x37876f=_0xab6991[_0xbf4e('0x93')]();_0x37876f[_0xbf4e('0x51')]('i.id');_0x37876f[_0xbf4e('0x51')](_0xbf4e('0x94'),_0xbf4e('0x68'));if(_0x8ab634[_0xbf4e('0x4c')]){_0x8ab634[_0xbf4e('0x4c')][_0xbf4e('0x77')](function(_0x521d8e){var _0x8dc4d5=_0x521d8e[0x0]===_0xbf4e('0x95')?_0x521d8e[0x0]:'i.'+_0x521d8e[0x0];_0xab6991[_0xbf4e('0x4c')](_0x8dc4d5,_0x521d8e[0x1]===_0xbf4e('0x96')?![]:!![]);});}if(!_[_0xbf4e('0x97')](_0x56338e)){_0xab6991[_0xbf4e('0x6a')](_0x64d8ea);_0x37876f[_0xbf4e('0x4e')]('t.id\x20IN\x20?',_0x56338e);}BPromise['resolve']()[_0xbf4e('0x12')](function(){if(!_0x2e8a62){if(_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x7f')])return;_0x37876f[_0xbf4e('0x4e')](_0xbf4e('0x98'));_0xab6991[_0xbf4e('0x4e')](_0xbf4e('0x98'));return;}if(_0x46967c['user'][_0xbf4e('0x99')]!==_0xbf4e('0x9a'))return;return _0x46967c[_0xbf4e('0x9b')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10a4b6){if(_[_0xbf4e('0x97')](_0x10a4b6)){_0x37876f[_0xbf4e('0x4e')]('i.ChatWebsiteId\x20IS\x20NULL');_0xab6991[_0xbf4e('0x4e')](_0xbf4e('0x9c'));}else{_0x37876f[_0xbf4e('0x4e')]('i.ChatWebsiteId\x20IN\x20?',_[_0xbf4e('0x3e')](_0x10a4b6,'id'));_0xab6991[_0xbf4e('0x4e')](_0xbf4e('0x80'),_[_0xbf4e('0x3e')](_0x10a4b6,'id'));}});})[_0xbf4e('0x12')](function(){if(_0x46967c[_0xbf4e('0x9b')][_0xbf4e('0x99')]===_0xbf4e('0x9a')&&!_0x2e8a62&&!_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x7f')])return[];return db[_0xbf4e('0x9d')]['query'](_0x37876f[_0xbf4e('0x9e')](),_0x19108b);})['then'](function(_0x2de373){_0x2b20d3[_0xbf4e('0x23')]=_0x2de373[_0xbf4e('0x4a')];if(_0x2b20d3[_0xbf4e('0x23')]===0x0)return[];return db['sequelize'][_0xbf4e('0x44')](_0x371799[_0xbf4e('0x9e')](),_0x19108b)['then'](function(_0x1b555c){_0xad8934=_[_0xbf4e('0x9f')](_0x1b555c,'id');_0x19108b=_[_0xbf4e('0x2c')](_0x19108b,{'model':db[_0xbf4e('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46967c[_0xbf4e('0x44')][_0xbf4e('0x49')]){_0x8ab634[_0xbf4e('0x48')][_0xbf4e('0x77')](function(_0x9c06e){_0xab6991['field']('i.'+_0x9c06e);});}else{_0xab6991[_0xbf4e('0x51')](_0xbf4e('0x94'),'unreadMessages');_0xab6991[_0xbf4e('0x51')](_0xbf4e('0xa0'),_0xbf4e('0xa1'));_0xab6991[_0xbf4e('0x51')](_0xbf4e('0xa2'),_0xbf4e('0xa3'));_0xab6991[_0xbf4e('0x51')](_0xbf4e('0xa4'),'contactName');_0xab6991[_0xbf4e('0x51')](_0xbf4e('0xa5'));_0xab6991[_0xbf4e('0x51')](_0xbf4e('0xa6'),_0xbf4e('0xa7'));_0xab6991['field'](_0xbf4e('0xa8'),_0xbf4e('0xa9'));_0xab6991[_0xbf4e('0x51')](_0xbf4e('0xaa'),_0xbf4e('0xab'));_0xab6991[_0xbf4e('0x51')](_0xbf4e('0xac'),_0xbf4e('0xad'));_0xab6991[_0xbf4e('0x51')]('c.mobile','Contact.mobile');_0xab6991['field'](_0xbf4e('0xae'),_0xbf4e('0xaf'));_0xab6991[_0xbf4e('0x51')]('o.fullname',_0xbf4e('0xb0'));_0xab6991[_0xbf4e('0x51')]('o.internal',_0xbf4e('0xb1'));_0xab6991[_0xbf4e('0x51')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbf4e('0x32'));}if(_0x8ab634['limit'])_0xab6991[_0xbf4e('0x24')](_0x8ab634['limit']);if(_0x8ab634['offset'])_0xab6991['offset'](_0x8ab634[_0xbf4e('0x21')]);return db[_0xbf4e('0x9d')]['query'](_0xab6991[_0xbf4e('0x9e')](),_0x19108b);})[_0xbf4e('0x12')](function(_0x26ed50){if(_0x26ed50[_0xbf4e('0x4a')]>0x0)_0x510548[_0xbf4e('0x4e')](_0xbf4e('0xb2'),_[_0xbf4e('0x3e')](_0x26ed50,'id'));return db[_0xbf4e('0x9d')][_0xbf4e('0x44')](_0x510548[_0xbf4e('0x9e')](),_0x19108b)[_0xbf4e('0x12')](function(_0x5e3783){var _0x526aeb=_['groupBy'](_0x5e3783,_0xbf4e('0xb3'));var _0x145a3f=[];_0x26ed50[_0xbf4e('0x77')](function(_0xfafe0d){_0x145a3f[_0xbf4e('0x34')](updateChatInteraction(_0xfafe0d,_0xad8934,_0x526aeb));});return BPromise[_0xbf4e('0xb4')](_0x145a3f);});});})[_0xbf4e('0x12')](function(_0x5bfba4){_0x2b20d3[_0xbf4e('0xb5')]=_0x5bfba4;return _0x2b20d3;})[_0xbf4e('0x12')](respondWithFilteredResult(_0x40c147,_0x8ab634))[_0xbf4e('0x1d')](handleError(_0x40c147,null));};exports['show']=function(_0x2a129f,_0x25d71a){var _0x3f7ae0={'raw':![],'where':{'id':_0x2a129f[_0xbf4e('0xb6')]['id']}},_0x92e714={};_0x92e714[_0xbf4e('0x43')]=_[_0xbf4e('0x45')](db[_0xbf4e('0x3f')][_0xbf4e('0x40')]);_0x92e714[_0xbf4e('0x44')]=_[_0xbf4e('0x45')](_0x2a129f['query']);_0x92e714[_0xbf4e('0x46')]=_['intersection'](_0x92e714['model'],_0x92e714[_0xbf4e('0x44')]);_0x3f7ae0['attributes']=_[_0xbf4e('0x47')](_0x92e714[_0xbf4e('0x43')],qs[_0xbf4e('0x49')](_0x2a129f[_0xbf4e('0x44')][_0xbf4e('0x49')]));_0x3f7ae0['attributes']=_0x3f7ae0['attributes'][_0xbf4e('0x4a')]?_0x3f7ae0[_0xbf4e('0x48')]:_0x92e714[_0xbf4e('0x43')];if(_0x2a129f[_0xbf4e('0x44')][_0xbf4e('0xb7')]){_0x3f7ae0['include']=[{'all':!![]}];}_0x3f7ae0=_[_0xbf4e('0x2c')]({},_0x3f7ae0,_0x2a129f[_0xbf4e('0xb8')]);return db[_0xbf4e('0x3f')]['find'](_0x3f7ae0)[_0xbf4e('0x12')](handleEntityNotFound(_0x25d71a,null))['then'](respondWithResult(_0x25d71a,null))[_0xbf4e('0x1d')](handleError(_0x25d71a,null));};exports['create']=function(_0x4a424b,_0x1862c8){return db[_0xbf4e('0x3f')][_0xbf4e('0xb9')](_0x4a424b[_0xbf4e('0x2d')],{})[_0xbf4e('0x12')](respondWithResult(_0x1862c8,0xc9))[_0xbf4e('0x1d')](handleError(_0x1862c8,null));};exports[_0xbf4e('0xba')]=function(_0x25740a,_0x48fbe4){if(_0x25740a[_0xbf4e('0x2d')]['id']){delete _0x25740a[_0xbf4e('0x2d')]['id'];}return db[_0xbf4e('0x3f')][_0xbf4e('0x67')]({'where':{'id':_0x25740a[_0xbf4e('0xb6')]['id']}})['then'](handleEntityNotFound(_0x48fbe4,null))['then'](saveUpdates(_0x25740a['body'],null))[_0xbf4e('0x12')](respondWithResult(_0x48fbe4,null))['catch'](handleError(_0x48fbe4,null));};exports[_0xbf4e('0x27')]=function(_0x7d508b,_0x30a504){return db[_0xbf4e('0x3f')]['find']({'where':{'id':_0x7d508b['params']['id']}})['then'](handleEntityNotFound(_0x30a504,null))[_0xbf4e('0x12')](removeEntity(_0x30a504,null))[_0xbf4e('0x1d')](handleError(_0x30a504,null));};exports['describe']=function(_0x1d717e,_0x21b98d){return db[_0xbf4e('0x3f')]['describe']()['then'](respondWithResult(_0x21b98d,null))[_0xbf4e('0x1d')](handleError(_0x21b98d,null));};exports[_0xbf4e('0xbb')]=function(_0x41b3cb,_0x366eee){var _0xaac646=_0x41b3cb['params']['id'];var _0x4de6e8;var _0x11cada;var _0x449e41;return db[_0xbf4e('0x3f')]['findOne']({'where':{'id':_0xaac646}})['then'](function(_0x2e5a42){_0x4de6e8=_0x2e5a42;return db[_0xbf4e('0xbc')][_0xbf4e('0xbd')]({'where':{'id':_0x2e5a42['ChatWebsiteId']},'attributes':['id',_0xbf4e('0xbe'),_0xbf4e('0xbf'),_0xbf4e('0xc0'),_0xbf4e('0xc1'),_0xbf4e('0xc2')],'raw':!![]});})[_0xbf4e('0x12')](function(_0x14970e){if(_0x14970e&&_0x14970e['vidaooApiKey']&&_0x14970e[_0xbf4e('0xbf')]){_0x11cada=_0x14970e;var _0x307143={'interaction':{'id':_0xaac646},'agent':{'id':_0x41b3cb['user']['id'],'name':_0x41b3cb['user']['name'],'fullname':_0x41b3cb[_0xbf4e('0x9b')][_0xbf4e('0x31')],'email':_0x41b3cb[_0xbf4e('0x9b')][_0xbf4e('0xc3')]},'contact':_0x41b3cb[_0xbf4e('0x2d')][_0xbf4e('0x2e')],'account':_0x41b3cb['body'][_0xbf4e('0x30')]};var _0x17eda0={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x14970e[_0xbf4e('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x41b3cb['user'][_0xbf4e('0xc3')]],'buttons':null,'topic':_0x11cada[_0xbf4e('0xc0')],'note':_[_0xbf4e('0xc4')](_0x11cada[_0xbf4e('0xc1')])?null:getMustacheRender(_0x11cada[_0xbf4e('0xc1')],_0x307143),'metadata':null},'redirect':_0xbf4e('0xc5'),'json':!![]};try{if(!_[_0xbf4e('0xc4')](_0x11cada['vidaooMetadata'])){var _0x519a75=getMustacheRender(_0x11cada['vidaooMetadata'],_0x307143);var _0x474493=JSON['parse'](_0x519a75);_0x17eda0[_0xbf4e('0x2d')]['metadata']=_0x474493;}}catch(_0x571cf4){throw new db[(_0xbf4e('0x90'))]['ValidationError'](_0xbf4e('0xc6'));}return rp(_0x17eda0);}else{throw new db[(_0xbf4e('0x90'))][(_0xbf4e('0xc7'))](_0xbf4e('0xc8'));}})[_0xbf4e('0x12')](function(_0x25a181){_0x449e41=_0x25a181;if(_0x449e41['id']){var _0x820681={'body':_0x449e41['join_url'],'ChatWebsiteId':_0x11cada['id'],'ChatInteractionId':_0x4de6e8['id'],'direction':'out','UserId':_0x41b3cb[_0xbf4e('0x9b')]['id']};return db[_0xbf4e('0xc9')][_0xbf4e('0xb9')](_0x820681,{});}else{throw new db[(_0xbf4e('0x90'))][(_0xbf4e('0xc7'))](_0xbf4e('0xca'));}})['then'](function(){return _0x4de6e8['updateAttributes']({'vidaooSessionId':_0x449e41['id']});})[_0xbf4e('0x12')](respondWithResult(_0x366eee,null))['catch'](handleError(_0x366eee,null));};exports['customUpdate']=function(_0x3056d6,_0x6af5b0){if(_0x3056d6[_0xbf4e('0x2d')]['id']){delete _0x3056d6[_0xbf4e('0x2d')]['id'];}return db[_0xbf4e('0x3f')][_0xbf4e('0x67')]({'where':{'id':_0x3056d6[_0xbf4e('0xb6')]['id']},'include':[{'model':db[_0xbf4e('0xcb')],'as':'Contact'}]})[_0xbf4e('0x12')](handleEntityNotFound(_0x6af5b0,null))[_0xbf4e('0x12')](saveUpdates(_0x3056d6[_0xbf4e('0x2d')],null))[_0xbf4e('0x12')](respondWithResult(_0x6af5b0,null))[_0xbf4e('0x1d')](handleError(_0x6af5b0,null));};exports[_0xbf4e('0xcc')]=function(_0x17726e,_0x50a459){if(_0x17726e[_0xbf4e('0x2d')]['id']){delete _0x17726e[_0xbf4e('0x2d')]['id'];}return db[_0xbf4e('0x3f')][_0xbf4e('0x67')]({'where':{'id':_0x17726e[_0xbf4e('0xb6')]['id']}})['then'](function(_0x38c465){if(!_0x38c465){logger['error'](_0xbf4e('0xcd'),_0xbf4e('0xcc'),0x194,_0xbf4e('0xce'));_0x50a459['sendStatus'](0x194);}else{if(_0x38c465['UserId']){throw new db[(_0xbf4e('0x90'))][(_0xbf4e('0xc7'))](_0xbf4e('0xcf'));}}return _0x38c465;})[_0xbf4e('0x12')](function(_0x5a7ff8){if(_0x5a7ff8){return _0x5a7ff8[_0xbf4e('0xba')]({'closed':_0x17726e['body'][_0xbf4e('0x3a')],'disposition':_0x17726e[_0xbf4e('0x2d')][_0xbf4e('0x3b')]})['then'](function(_0x224b30){return _0x224b30;});}})[_0xbf4e('0x12')](function(){return respondWithRpcPromise(_0xbf4e('0xd0'),_0xbf4e('0xcc'),_0x17726e[_0xbf4e('0x2d')],client9004);})['then'](respondWithResult(_0x50a459,null))[_0xbf4e('0x1d')](handleError(_0x50a459,null));};exports['attachmentUpload']=function(_0x4b0874,_0x36c64f){_0x4b0874['body'][_0xbf4e('0x29')]=_0x4b0874[_0xbf4e('0xd1')][_0xbf4e('0xd2')];_0x4b0874[_0xbf4e('0x2d')][_0xbf4e('0xd3')]=_0x4b0874[_0xbf4e('0xd1')][_0xbf4e('0xd4')];_0x4b0874['body'][_0xbf4e('0x42')]=_0x4b0874[_0xbf4e('0xd1')][_0xbf4e('0xd5')];return db[_0xbf4e('0xd6')]['create'](_0x4b0874[_0xbf4e('0x2d')])[_0xbf4e('0x12')](respondWithResult(_0x36c64f,0xc9))[_0xbf4e('0x1d')](handleError(_0x36c64f,null));};exports[_0xbf4e('0xd7')]=function(_0x3b76da,_0x43ce48){return db[_0xbf4e('0x3f')][_0xbf4e('0xbd')]({'where':{'id':_0x3b76da[_0xbf4e('0xb6')]['id']},'raw':!![]})[_0xbf4e('0x12')](handleEntityNotFound(_0x43ce48,null))['then'](function(_0x522dd0){if(_0x522dd0){if(_0x522dd0['closed']){return _0x43ce48['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xbf4e('0xd6')][_0xbf4e('0xbd')]({'where':{'id':_0x3b76da[_0xbf4e('0x44')]['attachId']},'raw':!![]})[_0xbf4e('0x12')](handleEntityNotFound(_0x43ce48,null));}})[_0xbf4e('0x12')](function(_0x41aab4){if(_0x41aab4){var _0x17139a=_0x41aab4[_0xbf4e('0xd8')]!==null;var _0x422fde=path[_0xbf4e('0xd9')](config[_0xbf4e('0xda')],_0xbf4e('0xdb'));if(_0x17139a){_0x422fde=path[_0xbf4e('0xd9')](_0x422fde,_0xbf4e('0xdc'));}var _0x11fba4=path['join'](_0x422fde,_0x41aab4['basename']);return _0x43ce48[_0xbf4e('0xdd')](_0x11fba4);}})['catch'](handleError(_0x43ce48,null));};exports[_0xbf4e('0xde')]=function(_0x5391d7,_0x4597c0){var _0x60fa65=null;var _0x44b4ed=null;var _0x51f940=null;if(_0x5391d7[_0xbf4e('0x2d')]['id']){delete _0x5391d7[_0xbf4e('0x2d')]['id'];}if(_0x5391d7[_0xbf4e('0x2d')][_0xbf4e('0xdf')]){_0x51f940=path['join'](config[_0xbf4e('0xda')],_0xbf4e('0xe0'),util[_0xbf4e('0xe1')](_0xbf4e('0xe2'),Date[_0xbf4e('0xe3')]()));_0x5391d7[_0xbf4e('0x2d')]['pathTranscript']=_0x51f940;}return db[_0xbf4e('0x3f')][_0xbf4e('0x67')]({'where':{'id':_0x5391d7[_0xbf4e('0xb6')]['id']},'include':[{'model':db[_0xbf4e('0xc9')],'as':_0xbf4e('0xe4'),'include':[{'model':db[_0xbf4e('0x7a')],'as':_0xbf4e('0x7a')}]}]})['then'](handleEntityNotFound(_0x4597c0,null))['then'](saveUpdates(_0x5391d7[_0xbf4e('0x2d')],null))[_0xbf4e('0x12')](function(_0x5ae7e0){if(_0x5ae7e0){_0x60fa65=_0x5ae7e0;return db[_0xbf4e('0xbc')]['find']({'where':{'id':_0x60fa65[_0xbf4e('0x7f')]}});}})['then'](function(_0x5cf68d){if(_0x5cf68d){_0x44b4ed=_0x5cf68d;return db[_0xbf4e('0xcb')][_0xbf4e('0x67')]({'where':{'id':_0x60fa65[_0xbf4e('0x72')]}});}})[_0xbf4e('0x12')](function(_0x34fa08){if(_0x34fa08){if(_0x51f940){var _0x57b42d=null;for(var _0x303fd4=0x1;_0x303fd4<_0x60fa65[_0xbf4e('0xe4')][_0xbf4e('0x4a')];++_0x303fd4){_0x57b42d=_0x60fa65[_0xbf4e('0xe4')][_0x303fd4];var _0x4b3ec3=_0x57b42d[_0xbf4e('0x3c')]?util[_0xbf4e('0xe1')](_0xbf4e('0xe5'),_0x44b4ed[_0xbf4e('0xe6')],_0x57b42d[_0xbf4e('0x3c')]):_0xbf4e('0xe7');var _0x3af88b=_0x5391d7[_0xbf4e('0x2d')][_0xbf4e('0xe8')]||util[_0xbf4e('0xe1')](_0xbf4e('0xe5'),_0xbf4e('0xe9'),_0x57b42d['ContactId']);switch(_0x44b4ed[_0xbf4e('0xea')]){case'website_alias':_0x4b3ec3=_0x57b42d[_0xbf4e('0x3c')]?util['format']('%s%d',_0x44b4ed[_0xbf4e('0xe6')],_0x57b42d['UserId']):_0xbf4e('0xe7');break;case _0xbf4e('0xeb'):_0x4b3ec3=_0x57b42d['UserId']?_0x57b42d[_0xbf4e('0x7a')][_0xbf4e('0xec')]||_0x57b42d[_0xbf4e('0x7a')][_0xbf4e('0x31')]:_0xbf4e('0xe7');break;case _0xbf4e('0xed'):_0x4b3ec3=_0x57b42d['UserId']?_0x57b42d[_0xbf4e('0x7a')][_0xbf4e('0x31')]:_0xbf4e('0xe7');break;default:_0x4b3ec3=_0x57b42d[_0xbf4e('0x3c')]?util[_0xbf4e('0xe1')](_0xbf4e('0xe5'),_0x44b4ed[_0xbf4e('0xe6')],_0x57b42d[_0xbf4e('0x3c')]):'System';}var _0x3d72b0=util[_0xbf4e('0xe1')](_0xbf4e('0xee'),moment(_0x57b42d[_0xbf4e('0xef')])[_0xbf4e('0xe1')](_0xbf4e('0xf0')),_0x57b42d[_0xbf4e('0xf1')]==='in'?_0x3af88b:_0x4b3ec3,_0x57b42d['body']);if(!_0x57b42d['secret']){fs[_0xbf4e('0xf2')](_0x51f940,_0x3d72b0);}}return db[_0xbf4e('0xf3')][_0xbf4e('0xbd')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbf4e('0xf4'),'raw':!![],'include':[{'model':db[_0xbf4e('0xf5')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xbf4e('0x12')](function(_0x509029){if(!_0x509029||!_0x509029[_0xbf4e('0xf4')]||!_0x5391d7[_0xbf4e('0x2d')])return _0x60fa65;var _0x24c937=_0x509029['getSmtpOptions']();return respondWithRpcPromise(_0xbf4e('0xf6'),_0xbf4e('0xf7'),{'account':_0x24c937,'message':{'from':util[_0xbf4e('0xe1')]('\x22%s\x22\x20<%s>',_0x509029[_0xbf4e('0x29')],_0x509029[_0xbf4e('0xc3')]||_0x509029[_0xbf4e('0xf4')][_0xbf4e('0x9b')]),'to':_0x5391d7[_0xbf4e('0x2d')][_0xbf4e('0xdf')],'subject':_0xbf4e('0xf8'),'text':util[_0xbf4e('0xe1')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5391d7[_0xbf4e('0x2d')][_0xbf4e('0xdf')]),'attachments':[{'path':_0x51f940}]}})[_0xbf4e('0x12')](function(){return _0x60fa65;})[_0xbf4e('0x1d')](function(_0xadbc93){logger['error'](_0xadbc93);});})[_0xbf4e('0x12')](respondWithStatusCode(_0x4597c0,0xc8))[_0xbf4e('0x1d')](handleError(_0x4597c0,null));};exports['addMessage']=function(_0x4ac7e2,_0xffe183){return db[_0xbf4e('0xc9')][_0xbf4e('0x67')]({'where':{'id':_0x4ac7e2[_0xbf4e('0xb6')]['id']}})[_0xbf4e('0x12')](handleEntityNotFound(_0xffe183,null))[_0xbf4e('0x12')](function(_0x2763b0){if(_0x2763b0){return _0x2763b0[_0xbf4e('0xf9')](_0x4ac7e2[_0xbf4e('0x2d')][_0xbf4e('0xfa')],_[_0xbf4e('0xfb')](_0x4ac7e2['body'],[_0xbf4e('0xfa'),'id'])||{});}})[_0xbf4e('0x12')](respondWithResult(_0xffe183,null))[_0xbf4e('0x1d')](handleError(_0xffe183,null));};exports['getMessages']=function(_0x4893d8,_0x2d86d0){var _0x4bf37e={'raw':![],'where':{}};var _0x3704e7={};var _0x31315a={'count':0x0,'rows':[]};return db[_0xbf4e('0x3f')]['findOne']({'where':{'id':_0x4893d8[_0xbf4e('0xb6')]['id']}})[_0xbf4e('0x12')](handleEntityNotFound(_0x2d86d0,null))[_0xbf4e('0x12')](function(_0x235bfb){if(_0x235bfb){_0x3704e7[_0xbf4e('0x43')]=_[_0xbf4e('0x45')](db[_0xbf4e('0xc9')]['rawAttributes']);_0x3704e7[_0xbf4e('0x44')]=_[_0xbf4e('0x45')](_0x4893d8[_0xbf4e('0x44')]);_0x3704e7[_0xbf4e('0x46')]=_[_0xbf4e('0x47')](_0x3704e7[_0xbf4e('0x43')],_0x3704e7['query']);_0x4bf37e['attributes']=_[_0xbf4e('0x47')](_0x3704e7[_0xbf4e('0x43')],qs[_0xbf4e('0x49')](_0x4893d8[_0xbf4e('0x44')][_0xbf4e('0x49')]));_0x4bf37e[_0xbf4e('0x48')]=_0x4bf37e[_0xbf4e('0x48')][_0xbf4e('0x4a')]?_0x4bf37e['attributes']:_0x3704e7[_0xbf4e('0x43')];if(!_0x4893d8['query'][_0xbf4e('0x4b')]('nolimit')){_0x4bf37e[_0xbf4e('0x24')]=qs[_0xbf4e('0x24')](_0x4893d8[_0xbf4e('0x44')][_0xbf4e('0x24')]);_0x4bf37e[_0xbf4e('0x21')]=qs[_0xbf4e('0x21')](_0x4893d8['query'][_0xbf4e('0x21')]);}_0x4bf37e['order']=qs[_0xbf4e('0x4d')](_0x4893d8[_0xbf4e('0x44')][_0xbf4e('0x4d')]);_0x4bf37e['where']=qs[_0xbf4e('0x46')](_[_0xbf4e('0x4f')](_0x4893d8[_0xbf4e('0x44')],_0x3704e7[_0xbf4e('0x46')]));_0x4bf37e[_0xbf4e('0x4e')]['ChatInteractionId']=_0x235bfb['id'];if(_0x4893d8[_0xbf4e('0x44')][_0xbf4e('0x8b')]){_0x4bf37e[_0xbf4e('0x4e')]=_['merge'](_0x4bf37e[_0xbf4e('0x4e')],{'$or':_[_0xbf4e('0x3e')](_0x4bf37e[_0xbf4e('0x48')],function(_0x417842){var _0x3d31ac={};_0x3d31ac[_0x417842]={'$like':'%'+_0x4893d8[_0xbf4e('0x44')][_0xbf4e('0x8b')]+'%'};return _0x3d31ac;})});}if(_0x4893d8[_0xbf4e('0x44')][_0xbf4e('0x82')]){var _0x1fb641=_0x4893d8[_0xbf4e('0x44')][_0xbf4e('0x82')][_0xbf4e('0x76')](',');var _0x17e5ac={};_0x17e5ac[_0x1fb641[0x0]]={'$gte':moment(_0x1fb641[0x1])[_0xbf4e('0xe1')](_0xbf4e('0xfc'))};_0x4bf37e[_0xbf4e('0x4e')]=_[_0xbf4e('0x2c')](_0x4bf37e[_0xbf4e('0x4e')],_0x17e5ac);}_0x4bf37e=_['merge']({},_0x4bf37e,_0x4893d8[_0xbf4e('0xb8')]);return db[_0xbf4e('0xc9')][_0xbf4e('0x23')]({'where':_0x4bf37e[_0xbf4e('0x4e')]})[_0xbf4e('0x12')](function(_0x26dd77){_0x31315a[_0xbf4e('0x23')]=_0x26dd77;if(_0x4893d8['query']['includeAll']){_0x4bf37e[_0xbf4e('0xfd')]=[{'all':!![]}];}return db[_0xbf4e('0xc9')][_0xbf4e('0xfe')](_0x4bf37e);})[_0xbf4e('0x12')](function(_0x278171){_0x31315a[_0xbf4e('0xb5')]=_0x278171;return _0x31315a;});}})[_0xbf4e('0x12')](respondWithFilteredResult(_0x2d86d0,_0x4bf37e))[_0xbf4e('0x1d')](handleError(_0x2d86d0,null));};exports[_0xbf4e('0xff')]=function(_0x1c1a74,_0x583f33){var _0x9f093f={'where':{}},_0x162146={},_0x4c758a={'count':0x0,'rows':[]};return db[_0xbf4e('0x3f')][_0xbf4e('0xbd')]({'where':{'id':_0x1c1a74[_0xbf4e('0xb6')]['id']}})[_0xbf4e('0x12')](handleEntityNotFound(_0x583f33,null))[_0xbf4e('0x12')](function(_0x5bd89c){if(_0x5bd89c){_0x162146[_0xbf4e('0x43')]=_['keys'](db[_0xbf4e('0xc9')][_0xbf4e('0x40')]);_0x162146[_0xbf4e('0x44')]=_[_0xbf4e('0x45')](_0x1c1a74[_0xbf4e('0x44')]);_0x162146[_0xbf4e('0x46')]=_[_0xbf4e('0x47')](_0x162146[_0xbf4e('0x43')],_0x162146[_0xbf4e('0x44')]);_0x9f093f[_0xbf4e('0x48')]=_['intersection'](_0x162146[_0xbf4e('0x43')],qs[_0xbf4e('0x49')](_0x1c1a74[_0xbf4e('0x44')][_0xbf4e('0x49')]));_0x9f093f['attributes']=_0x9f093f[_0xbf4e('0x48')][_0xbf4e('0x4a')]?_0x9f093f[_0xbf4e('0x48')]:_0x162146['model'];if(!_0x1c1a74[_0xbf4e('0x44')][_0xbf4e('0x4b')](_0xbf4e('0x100'))){_0x9f093f[_0xbf4e('0x24')]=qs[_0xbf4e('0x24')](_0x1c1a74['query'][_0xbf4e('0x24')]);_0x9f093f[_0xbf4e('0x21')]=qs[_0xbf4e('0x21')](_0x1c1a74[_0xbf4e('0x44')][_0xbf4e('0x21')]);}_0x9f093f['order']=qs[_0xbf4e('0x4d')](_0x1c1a74[_0xbf4e('0x44')]['sort']);_0x9f093f['where']=qs[_0xbf4e('0x46')](_[_0xbf4e('0x4f')](_0x1c1a74[_0xbf4e('0x44')],_0x162146[_0xbf4e('0x46')]));_0x9f093f['where']['ChatInteractionId']=_0x5bd89c['id'];if(_0x1c1a74[_0xbf4e('0x44')]['filter']){_0x9f093f[_0xbf4e('0x4e')]=_['merge'](_0x9f093f[_0xbf4e('0x4e')],{'$or':_[_0xbf4e('0x3e')](_0x9f093f[_0xbf4e('0x48')],function(_0x2787a7){var _0x939bf6={};_0x939bf6[_0x2787a7]={'$like':'%'+_0x1c1a74['query'][_0xbf4e('0x8b')]+'%'};return _0x939bf6;})});}_0x9f093f[_0xbf4e('0x4e')][_0xbf4e('0x101')]=![];if(_0x1c1a74['query']['id']){_0x9f093f[_0xbf4e('0x4e')]['id']={'$gt':_0x1c1a74[_0xbf4e('0x44')]['id']};}_0x9f093f=_[_0xbf4e('0x2c')]({},_0x9f093f,_0x1c1a74['options']);return db[_0xbf4e('0xc9')][_0xbf4e('0x23')]({'where':_0x9f093f[_0xbf4e('0x4e')]})[_0xbf4e('0x12')](function(_0x1d4173){_0x4c758a[_0xbf4e('0x23')]=_0x1d4173;_0x9f093f['include']=[];if(_0x1c1a74[_0xbf4e('0x44')][_0xbf4e('0x102')]){_0x9f093f[_0xbf4e('0xfd')][_0xbf4e('0x34')]({'model':db[_0xbf4e('0x7a')],'as':'User','attributes':['id',_0xbf4e('0x31'),_0xbf4e('0xec')]});}if(_0x1c1a74['query']['includeAll']){_0x9f093f[_0xbf4e('0xfd')]=[{'all':!![]}];}return db['ChatMessage'][_0xbf4e('0xfe')](_0x9f093f);})[_0xbf4e('0x12')](function(_0x5db938){_0x4c758a[_0xbf4e('0xb5')]=_0x5db938;return _0x4c758a;});}})[_0xbf4e('0x12')](respondWithFilteredResult(_0x583f33,_0x9f093f))[_0xbf4e('0x1d')](handleError(_0x583f33,null));};exports[_0xbf4e('0x103')]=function(_0x1add27,_0x13c27c){return db['ChatInteraction'][_0xbf4e('0x67')]({'where':{'id':_0x1add27[_0xbf4e('0xb6')]['id']}})[_0xbf4e('0x12')](handleEntityNotFound(_0x13c27c,null))[_0xbf4e('0x12')](function(_0x5c77ce){if(_0x5c77ce){return _0x5c77ce[_0xbf4e('0x104')](_0x1add27['body'][_0xbf4e('0xfa')],_[_0xbf4e('0xfb')](_0x1add27[_0xbf4e('0x2d')],[_0xbf4e('0xfa'),'id'])||{})[_0xbf4e('0x105')](function(){return db[_0xbf4e('0x75')][_0xbf4e('0xfe')]({'attributes':['id',_0xbf4e('0x29'),'color'],'where':{'id':_0x1add27[_0xbf4e('0x2d')][_0xbf4e('0xfa')]}});})[_0xbf4e('0x12')](function(_0x308cdb){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1add27[_0xbf4e('0xb6')]['id']),'tags':_0x308cdb||[]});return{'id':Number(_0x1add27[_0xbf4e('0xb6')]['id']),'tags':_0x308cdb||[]};});}})[_0xbf4e('0x12')](respondWithResult(_0x13c27c,null))[_0xbf4e('0x1d')](handleError(_0x13c27c,null));};exports['removeTags']=function(_0x4fe33a,_0x49ecb7){return db['ChatInteraction']['find']({'where':{'id':_0x4fe33a[_0xbf4e('0xb6')]['id']}})[_0xbf4e('0x12')](handleEntityNotFound(_0x49ecb7,null))[_0xbf4e('0x12')](function(_0x455eed){if(_0x455eed){return _0x455eed['removeTags'](_0x4fe33a['query'][_0xbf4e('0xfa')]);}})['then'](respondWithStatusCode(_0x49ecb7,null))['catch'](handleError(_0x49ecb7,null));};exports[_0xbf4e('0xdd')]=function(_0x4339c5,_0x2dd4bd){var _0x67a40b=moment()[_0xbf4e('0x106')]()[_0xbf4e('0x9e')]();var _0x2ee17d=path[_0xbf4e('0xd9')](config['root'],_0xbf4e('0x107'),_0xbf4e('0x108'),_0xbf4e('0x109'));var _0x3ce1ba=path['join'](config[_0xbf4e('0xda')],_0xbf4e('0x107'),_0xbf4e('0x108'),'attachments');var _0x411685=path[_0xbf4e('0xd9')](_0x2ee17d,_0x67a40b);var _0x2ffb32=util['format'](_0xbf4e('0x10a'),_0x4339c5[_0xbf4e('0xb6')]['id'],_0x67a40b);var _0x35630a=path[_0xbf4e('0xd9')](_0x2ee17d,_0x2ffb32);var _0x5b1fbd=[];_0x5b1fbd[_0xbf4e('0x34')]({'model':db[_0xbf4e('0x7a')],'as':_0xbf4e('0x7a'),'attributes':['id',_0xbf4e('0x31')],'raw':!![]});_0x5b1fbd[_0xbf4e('0x34')]({'model':db['CmContact'],'as':_0xbf4e('0x6d'),'attributes':['id',_0xbf4e('0x10b'),'lastName'],'raw':!![]});if(_0x4339c5[_0xbf4e('0x44')][_0xbf4e('0x10c')]){_0x5b1fbd[_0xbf4e('0x34')]({'model':db[_0xbf4e('0xd6')],'as':'Attachment','raw':!![]});}var _0x1173ec=[{'model':db['ChatMessage'],'as':_0xbf4e('0xe4'),'attributes':['id',_0xbf4e('0x2d'),_0xbf4e('0xef'),'direction','secret',_0xbf4e('0x87')],'include':_0x5b1fbd}];_0x1173ec[_0xbf4e('0x34')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0xbf4e('0x29')]});_0x1173ec[_0xbf4e('0x34')]({'model':db[_0xbf4e('0x7a')],'as':_0xbf4e('0x10d'),'attributes':['id','fullname']});return db[_0xbf4e('0x3f')][_0xbf4e('0x67')]({'where':{'id':_0x4339c5['params']['id']},'include':_0x1173ec})[_0xbf4e('0x12')](handleEntityNotFound(_0x2dd4bd,null))['then'](function(_0x49ba2d){if(_0x49ba2d){var _0x565d86=_0x49ba2d[_0xbf4e('0x10e')]({'plain':!![]});fs['mkdirSync'](_0x411685);var _0x527a45={'channel':_0xbf4e('0x10f'),'account':_0x565d86['Account'][_0xbf4e('0x29')],'agent':_0x565d86[_0xbf4e('0x10d')]?_0x565d86[_0xbf4e('0x10d')]['fullname']:_0xbf4e('0x110'),'createdAt':moment(_0x565d86[_0xbf4e('0xef')])[_0xbf4e('0xe1')](_0xbf4e('0xfc'))[_0xbf4e('0x9e')](),'closedAt':_0x565d86[_0xbf4e('0x3a')]?moment(_0x565d86['closedAt'])['format'](_0xbf4e('0xfc'))['toString']():'','disposition':_0x565d86[_0xbf4e('0x3b')],'chatInfo':{'browser':_0x565d86['browserName'],'os':_0x565d86['osName'],'referer':_0x565d86[_0xbf4e('0x111')],'customerIp':_0x565d86['customerIp'],'customerPort':_0x565d86[_0xbf4e('0x112')]?_0x565d86['customerPort']:'N.A.'},'messages':_(_0x565d86['Messages'])['tail']()[_0xbf4e('0x8b')]({'secret':![]})[_0xbf4e('0x3e')](function(_0x515f59){if(_0x515f59[_0xbf4e('0xd6')]){var _0x161998=path[_0xbf4e('0xd9')](_0x3ce1ba,_0x515f59['Attachment'][_0xbf4e('0xd3')]);if(fs[_0xbf4e('0x113')](_0x161998)){fs[_0xbf4e('0x114')](_0x161998)['pipe'](fs[_0xbf4e('0x115')](path[_0xbf4e('0xd9')](_0x411685,_0x515f59[_0xbf4e('0xd6')]['basename'])));}}return{'date':moment(_0x515f59[_0xbf4e('0xef')])['format'](_0xbf4e('0xfc'))[_0xbf4e('0x9e')](),'sender':_0x515f59[_0xbf4e('0xf1')]===_0xbf4e('0x116')?_0x515f59['User']?_0x515f59['User'][_0xbf4e('0x31')]:_0xbf4e('0xe7'):_0x515f59['Contact'][_0xbf4e('0x10b')]+(_0x515f59[_0xbf4e('0x6d')]['lastName']?'\x20'+_0x515f59[_0xbf4e('0x6d')]['lastName']:''),'body':_0x515f59[_0xbf4e('0xd6')]?_0x515f59[_0xbf4e('0xd6')][_0xbf4e('0xd3')]:_0x515f59[_0xbf4e('0x2d')],'direction':_0x515f59[_0xbf4e('0xf1')]===_0xbf4e('0x116')?'A':'C','secret':_0x515f59[_0xbf4e('0x101')],'read':_0x515f59[_0xbf4e('0x87')],'attachment':_0x515f59[_0xbf4e('0xd6')]};})[_0xbf4e('0x69')]()};return ejs[_0xbf4e('0x117')](path[_0xbf4e('0xd9')](config[_0xbf4e('0xda')],_0xbf4e('0x107'),_0xbf4e('0x118'),_0xbf4e('0x119')),{'interaction':_0x527a45})['then'](function(_0x49ec6e){var _0x36b95a=path[_0xbf4e('0xd9')](_0x411685,'transcript-'+_0x565d86['id']+'-'+_0x67a40b+_0xbf4e('0x11a'));var _0x4f7e94={'path':_0x36b95a,'channel':_0xbf4e('0x10f'),'interactionId':_0x565d86['id']};return pdf[_0xbf4e('0x11b')](_0x49ec6e,_0x4f7e94);})['then'](function(){return new Promise(function(_0x48f68f,_0x1f2101){zipdir(_0x411685,{'saveTo':_0x35630a},function(_0x2828b2,_0x56890){if(_0x2828b2)return _0x1f2101(_0x2828b2);return _0x48f68f(_0x56890);});})['then'](function(){return new BPromise(function(_0x2c17a7,_0x33049a){rimraf(_0x411685,function(_0x29bc59){if(_0x29bc59)_0x33049a(_0x29bc59);return _0x2c17a7();});});})['then'](function(){return _0x2dd4bd[_0xbf4e('0xdd')](_0x35630a,_0x2ffb32,function(_0x49565b){if(_0x49565b){logger[_0xbf4e('0x17')](_0xbf4e('0x11c'),_0x49565b);}else{fs['unlinkSync'](_0x35630a);}});});});}else{return _0x2dd4bd[_0xbf4e('0x1e')](0xc8);}})[_0xbf4e('0x1d')](handleError(_0x2dd4bd,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f90393b..7467e72 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 _0xf1d1=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hook'];(function(_0x26bd03,_0x363003){var _0xb9d863=function(_0x512a6f){while(--_0x512a6f){_0x26bd03['push'](_0x26bd03['shift']());}};_0xb9d863(++_0x363003);}(_0xf1d1,0x14a));var _0x1f1d=function(_0x1786bb,_0x3d3115){_0x1786bb=_0x1786bb-0x0;var _0x209850=_0xf1d1[_0x1786bb];return _0x209850;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x1f1d('0x0'))['db'][_0x1f1d('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x1f1d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1f1d('0x3')](0x0);var events={'afterCreate':_0x1f1d('0x4'),'afterUpdate':'update','afterDestroy':_0x1f1d('0x5')};function emitEvent(_0x82f3bc){return function(_0x4791a4,_0x49585a,_0x12d558){_0x4791a4['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5d32fc){_0x4791a4[_0x1f1d('0x6')](_0x1f1d('0x7'),_0x5d32fc['map'](function(_0x1d341e){return{'id':_0x1d341e['id']};}));return ChatMessage[_0x1f1d('0x8')]({'where':{'ChatInteractionId':_0x4791a4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1f1d('0x9')](function(_0x5d5ff8){_0x4791a4[_0x1f1d('0x6')](_0x1f1d('0xa'),_0x5d5ff8[_0x1f1d('0xb')]);ChatInteractionEvents['emit'](_0x82f3bc+':'+_0x4791a4['id'],_0x4791a4);ChatInteractionEvents[_0x1f1d('0xc')](_0x82f3bc,_0x4791a4);_0x12d558(null);})[_0x1f1d('0xd')](_0x12d558(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x1f1d('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xcc61=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','setDataValue'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xcc61,0x88));var _0x1cc6=function(_0xa03e8,_0x1ba262){_0xa03e8=_0xa03e8-0x0;var _0x9fbaa5=_0xcc61[_0xa03e8];return _0x9fbaa5;};'use strict';var EventEmitter=require(_0x1cc6('0x0'));var ChatInteraction=require(_0x1cc6('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x1cc6('0x1'))['db'][_0x1cc6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1cc6('0x3')](0x0);var events={'afterCreate':_0x1cc6('0x4'),'afterUpdate':_0x1cc6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22eca3){return function(_0x379720,_0x340771,_0x475751){_0x379720[_0x1cc6('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4978fb){_0x379720[_0x1cc6('0x7')]('Users',_0x4978fb['map'](function(_0x1946f2){return{'id':_0x1946f2['id']};}));return ChatMessage[_0x1cc6('0x8')]({'where':{'ChatInteractionId':_0x379720['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x189ab2){_0x379720['setDataValue'](_0x1cc6('0x9'),_0x189ab2[_0x1cc6('0xa')]);ChatInteractionEvents[_0x1cc6('0xb')](_0x22eca3+':'+_0x379720['id'],_0x379720);ChatInteractionEvents[_0x1cc6('0xb')](_0x22eca3,_0x379720);_0x475751(null);})[_0x1cc6('0xc')](_0x475751(null));};}for(var e in events){if(events[_0x1cc6('0xd')](e)){var event=events[e];ChatInteraction[_0x1cc6('0xe')](e,emitEvent(event));}}module[_0x1cc6('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e049a4a..c442c29 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 _0x9cad=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0x204af7,_0x5cc263){var _0x533187=function(_0x3115bb){while(--_0x3115bb){_0x204af7['push'](_0x204af7['shift']());}};_0x533187(++_0x5cc263);}(_0x9cad,0x1eb));var _0xd9ca=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0x9cad[_0x36bfe3];return _0x9b0436;};'use strict';var _=require(_0xd9ca('0x0'));var util=require(_0xd9ca('0x1'));var logger=require(_0xd9ca('0x2'))(_0xd9ca('0x3'));var moment=require(_0xd9ca('0x4'));var BPromise=require(_0xd9ca('0x5'));var rp=require(_0xd9ca('0x6'));var fs=require('fs');var path=require(_0xd9ca('0x7'));var rimraf=require('rimraf');var config=require(_0xd9ca('0x8'));var attributes=require(_0xd9ca('0x9'));module[_0xd9ca('0xa')]=function(_0x14a847,_0x5d1b32){return _0x14a847[_0xd9ca('0xb')]('ChatInteraction',attributes,{'tableName':_0xd9ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5af7ca,_0x4e2e95,_0x356922){if(_0x5af7ca['changed'](_0xd9ca('0xd'))){_0x5af7ca['closedAt']=moment()[_0xd9ca('0xe')](_0xd9ca('0xf'));}_0x356922(null,_0x5af7ca);}},'charset':_0xd9ca('0x10'),'collate':_0xd9ca('0x11')});}; \ No newline at end of file +var _0x525a=['request-promise','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0x512045,_0x32a0d5){var _0x32520d=function(_0x4046c8){while(--_0x4046c8){_0x512045['push'](_0x512045['shift']());}};_0x32520d(++_0x32a0d5);}(_0x525a,0x19a));var _0xa525=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x525a[_0x494d1f];return _0x457b6e;};'use strict';var _=require('lodash');var util=require(_0xa525('0x0'));var logger=require('../../config/logger')(_0xa525('0x1'));var moment=require(_0xa525('0x2'));var BPromise=require(_0xa525('0x3'));var rp=require(_0xa525('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa525('0x5'));var config=require('../../config/environment');var attributes=require(_0xa525('0x6'));module[_0xa525('0x7')]=function(_0xb120cd,_0x2141c1){return _0xb120cd[_0xa525('0x8')](_0xa525('0x9'),attributes,{'tableName':_0xa525('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24b26b,_0x45bfa4,_0x41c560){if(_0x24b26b[_0xa525('0xb')](_0xa525('0xc'))){_0x24b26b[_0xa525('0xd')]=moment()[_0xa525('0xe')](_0xa525('0xf'));}_0x41c560(null,_0x24b26b);}},'charset':_0xa525('0x10'),'collate':_0xa525('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index db7f2b7..89402b0 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 _0x4b17=['localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','ChatInteraction,\x20%s,\x20%s','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','ids','spread','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x37b2f0,_0x4e9544){var _0x1877ca=function(_0x311dce){while(--_0x311dce){_0x37b2f0['push'](_0x37b2f0['shift']());}};_0x1877ca(++_0x4e9544);}(_0x4b17,0x123));var _0x74b1=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x4b17[_0x29ae80];return _0x5d6d71;};'use strict';var _=require(_0x74b1('0x0'));var util=require(_0x74b1('0x1'));var moment=require('moment');var BPromise=require(_0x74b1('0x2'));var rs=require(_0x74b1('0x3'));var fs=require('fs');var Redis=require(_0x74b1('0x4'));var db=require(_0x74b1('0x5'))['db'];var utils=require(_0x74b1('0x6'));var logger=require(_0x74b1('0x7'))(_0x74b1('0x8'));var config=require('../../config/environment');var jayson=require(_0x74b1('0x9'));var client=jayson[_0x74b1('0xa')][_0x74b1('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x74b1('0xc')],{'host':_0x74b1('0xd'),'port':0x18eb});var socket=require(_0x74b1('0xe'))(new Redis(config['redis']));require(_0x74b1('0xf'))['register'](socket);function respondWithRpcPromise(_0x27e6b4,_0x2f5718,_0x111f6e){return new BPromise(function(_0x466a3a,_0x7f9d81){return client[_0x74b1('0x10')](_0x27e6b4,_0x111f6e)[_0x74b1('0x11')](function(_0x208dcb){logger[_0x74b1('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x2f5718,_0x74b1('0x13'));logger[_0x74b1('0x14')](_0x74b1('0x15'),_0x2f5718,_0x74b1('0x13'),JSON['stringify'](_0x208dcb));if(_0x208dcb[_0x74b1('0x16')]){if(_0x208dcb[_0x74b1('0x16')]['code']===0x1f4){logger[_0x74b1('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2f5718,_0x208dcb[_0x74b1('0x16')][_0x74b1('0x17')]);return _0x7f9d81(_0x208dcb[_0x74b1('0x16')][_0x74b1('0x17')]);}logger[_0x74b1('0x16')](_0x74b1('0x18'),_0x2f5718,_0x208dcb[_0x74b1('0x16')]['message']);return _0x466a3a(_0x208dcb[_0x74b1('0x16')][_0x74b1('0x17')]);}else{logger[_0x74b1('0x12')](_0x74b1('0x18'),_0x2f5718,_0x74b1('0x13'));_0x466a3a(_0x208dcb['result'][_0x74b1('0x17')]);}})[_0x74b1('0x19')](function(_0x13e999){logger['error'](_0x74b1('0x18'),_0x2f5718,_0x13e999);_0x7f9d81(_0x13e999);});});}exports[_0x74b1('0x1a')]=function(_0x5b286f){var _0x2ca596=this;return new Promise(function(_0x134110,_0x11a1f7){return db[_0x74b1('0x1b')][_0x74b1('0x1c')](_0x5b286f[_0x74b1('0x1d')],{'raw':_0x5b286f[_0x74b1('0x1e')]?_0x5b286f[_0x74b1('0x1e')][_0x74b1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b286f[_0x74b1('0x1e')]?_0x5b286f[_0x74b1('0x1e')][_0x74b1('0x20')]||null:null,'attributes':_0x5b286f[_0x74b1('0x1e')]?_0x5b286f['options'][_0x74b1('0x21')]||null:null,'limit':_0x5b286f[_0x74b1('0x1e')]?_0x5b286f[_0x74b1('0x1e')]['limit']||null:null})[_0x74b1('0x11')](function(_0xc5e23f){logger[_0x74b1('0x12')]('UpdateChatInteraction',_0x5b286f);logger[_0x74b1('0x14')]('UpdateChatInteraction',_0x5b286f,JSON['stringify'](_0xc5e23f));_0x134110(_0xc5e23f);})[_0x74b1('0x19')](function(_0x172150){logger[_0x74b1('0x16')](_0x74b1('0x1a'),_0x172150[_0x74b1('0x17')],_0x5b286f);_0x11a1f7(_0x2ca596[_0x74b1('0x16')](0x1f4,_0x172150[_0x74b1('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x5efba0){return new Promise(function(_0x118185,_0x1c3d5e){return db['ChatInteraction']['find']({'where':_0x5efba0[_0x74b1('0x1e')]?_0x5efba0[_0x74b1('0x1e')]['where']||null:null})[_0x74b1('0x11')](function(_0x46cbf0){if(_0x46cbf0){return _0x46cbf0['addTags'](_0x5efba0[_0x74b1('0x1d')][_0x74b1('0x22')],_['omit'](_0x5efba0[_0x74b1('0x1d')],[_0x74b1('0x22'),'id'])||{});}})[_0x74b1('0x23')](function(_0xe6214f){logger[_0x74b1('0x12')](_0x74b1('0x24'),_0x5efba0);logger[_0x74b1('0x14')](_0x74b1('0x24'),_0x5efba0,JSON[_0x74b1('0x25')](_0xe6214f));_0x118185(_0xe6214f);})[_0x74b1('0x19')](function(_0x2dd24d){logger[_0x74b1('0x16')](_0x74b1('0x24'),_0x2dd24d[_0x74b1('0x17')],_0x5efba0);_0x1c3d5e(_this['error'](0x1f4,_0x2dd24d[_0x74b1('0x17')]));});});}; \ No newline at end of file +var _0x53b3=['request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','find','addTags','body','ids','omit','spread','AddTags','stringify','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x53b3,0x127));var _0x353b=function(_0x473766,_0x46ead9){_0x473766=_0x473766-0x0;var _0x4d1e5a=_0x53b3[_0x473766];return _0x4d1e5a;};'use strict';var _=require('lodash');var util=require(_0x353b('0x0'));var moment=require('moment');var BPromise=require(_0x353b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x353b('0x2'));var logger=require(_0x353b('0x3'))('rpc');var config=require(_0x353b('0x4'));var jayson=require(_0x353b('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x353b('0x6')](config[_0x353b('0x7')],{'host':_0x353b('0x8'),'port':0x18eb});var socket=require(_0x353b('0x9'))(new Redis(config[_0x353b('0x7')]));require(_0x353b('0xa'))['register'](socket);function respondWithRpcPromise(_0xb24642,_0x4749b4,_0x547b9e){return new BPromise(function(_0x426a90,_0x38d927){return client[_0x353b('0xb')](_0xb24642,_0x547b9e)[_0x353b('0xc')](function(_0x4b2b20){logger[_0x353b('0xd')](_0x353b('0xe'),_0x4749b4,'request\x20sent');logger[_0x353b('0xf')](_0x353b('0x10'),_0x4749b4,_0x353b('0x11'),JSON['stringify'](_0x4b2b20));if(_0x4b2b20[_0x353b('0x12')]){if(_0x4b2b20[_0x353b('0x12')][_0x353b('0x13')]===0x1f4){logger[_0x353b('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x4749b4,_0x4b2b20[_0x353b('0x12')][_0x353b('0x14')]);return _0x38d927(_0x4b2b20[_0x353b('0x12')][_0x353b('0x14')]);}logger[_0x353b('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x4749b4,_0x4b2b20[_0x353b('0x12')][_0x353b('0x14')]);return _0x426a90(_0x4b2b20[_0x353b('0x12')]['message']);}else{logger['info'](_0x353b('0xe'),_0x4749b4,_0x353b('0x11'));_0x426a90(_0x4b2b20[_0x353b('0x15')][_0x353b('0x14')]);}})[_0x353b('0x16')](function(_0x5b979d){logger[_0x353b('0x12')](_0x353b('0xe'),_0x4749b4,_0x5b979d);_0x38d927(_0x5b979d);});});}exports[_0x353b('0x17')]=function(_0x3b724c){var _0x4ed1b1=this;return new Promise(function(_0x360251,_0x199893){return db[_0x353b('0x18')][_0x353b('0x19')](_0x3b724c['body'],{'raw':_0x3b724c[_0x353b('0x1a')]?_0x3b724c[_0x353b('0x1a')][_0x353b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b724c['options']?_0x3b724c[_0x353b('0x1a')][_0x353b('0x1c')]||null:null,'attributes':_0x3b724c['options']?_0x3b724c[_0x353b('0x1a')][_0x353b('0x1d')]||null:null,'limit':_0x3b724c[_0x353b('0x1a')]?_0x3b724c[_0x353b('0x1a')][_0x353b('0x1e')]||null:null})[_0x353b('0xc')](function(_0x1a7562){logger[_0x353b('0xd')]('UpdateChatInteraction',_0x3b724c);logger[_0x353b('0xf')]('UpdateChatInteraction',_0x3b724c,JSON['stringify'](_0x1a7562));_0x360251(_0x1a7562);})[_0x353b('0x16')](function(_0x408404){logger[_0x353b('0x12')]('UpdateChatInteraction',_0x408404['message'],_0x3b724c);_0x199893(_0x4ed1b1[_0x353b('0x12')](0x1f4,_0x408404['message']));});});};exports['AddTagsToChatInteraction']=function(_0x2909fb){return new Promise(function(_0x1f5634,_0x4b68b3){return db[_0x353b('0x18')][_0x353b('0x1f')]({'where':_0x2909fb[_0x353b('0x1a')]?_0x2909fb[_0x353b('0x1a')]['where']||null:null})[_0x353b('0xc')](function(_0x414e16){if(_0x414e16){return _0x414e16[_0x353b('0x20')](_0x2909fb[_0x353b('0x21')][_0x353b('0x22')],_[_0x353b('0x23')](_0x2909fb[_0x353b('0x21')],['ids','id'])||{});}})[_0x353b('0x24')](function(_0x4efec9){logger['info'](_0x353b('0x25'),_0x2909fb);logger[_0x353b('0xf')](_0x353b('0x25'),_0x2909fb,JSON[_0x353b('0x26')](_0x4efec9));_0x1f5634(_0x4efec9);})[_0x353b('0x16')](function(_0x34a3c0){logger[_0x353b('0x12')]('AddTags',_0x34a3c0['message'],_0x2909fb);_0x4b68b3(_this[_0x353b('0x12')](0x1f4,_0x34a3c0['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9321b71..0400d29 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 _0x492a=['./chatInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x48baab,_0x57f380){var _0x30c22f=function(_0x7144dc){while(--_0x7144dc){_0x48baab['push'](_0x48baab['shift']());}};_0x30c22f(++_0x57f380);}(_0x492a,0x150));var _0xa492=function(_0x5d99c6,_0x2447af){_0x5d99c6=_0x5d99c6-0x0;var _0x2d2c9a=_0x492a[_0x5d99c6];return _0x2d2c9a;};'use strict';var ChatInteractionEvents=require(_0xa492('0x0'));var events=[_0xa492('0x1'),_0xa492('0x2'),_0xa492('0x3')];function createListener(_0x286711,_0x5042a5){return function(_0x3d0a57){_0x5042a5[_0xa492('0x4')](_0x286711,_0x3d0a57);};}function removeListener(_0x1d4e56,_0x1389b8){return function(){ChatInteractionEvents[_0xa492('0x5')](_0x1d4e56,_0x1389b8);};}exports[_0xa492('0x6')]=function(_0x5db9b1){for(var _0x3b0663=0x0,_0x2a8cb1=events[_0xa492('0x7')];_0x3b0663<_0x2a8cb1;_0x3b0663++){var _0x4ccf9f=events[_0x3b0663];var _0x3d477a=createListener('chatInteraction:'+_0x4ccf9f,_0x5db9b1);ChatInteractionEvents['on'](_0x4ccf9f,_0x3d477a);}}; \ No newline at end of file +var _0x3b85=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','register'];(function(_0x5b3234,_0x24c77f){var _0x377eb2=function(_0x168f29){while(--_0x168f29){_0x5b3234['push'](_0x5b3234['shift']());}};_0x377eb2(++_0x24c77f);}(_0x3b85,0x14a));var _0x53b8=function(_0x1b2987,_0x4bb8c6){_0x1b2987=_0x1b2987-0x0;var _0xf4995f=_0x3b85[_0x1b2987];return _0xf4995f;};'use strict';var ChatInteractionEvents=require(_0x53b8('0x0'));var events=[_0x53b8('0x1'),_0x53b8('0x2'),_0x53b8('0x3')];function createListener(_0x38437f,_0x59ea3a){return function(_0x3668d0){_0x59ea3a[_0x53b8('0x4')](_0x38437f,_0x3668d0);};}function removeListener(_0x4fe775,_0x7674ea){return function(){ChatInteractionEvents['removeListener'](_0x4fe775,_0x7674ea);};}exports[_0x53b8('0x5')]=function(_0x2524a2){for(var _0x4b00a1=0x0,_0x357e85=events[_0x53b8('0x6')];_0x4b00a1<_0x357e85;_0x4b00a1++){var _0x1911a9=events[_0x4b00a1];var _0x39d872=createListener(_0x53b8('0x7')+_0x1911a9,_0x2524a2);ChatInteractionEvents['on'](_0x1911a9,_0x39d872);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 0c776a5..c9015f4 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 _0xb413=['../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','format','%s-%s','now','replace','/:id/attachment_upload','single','file','addMessage','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x554628,_0xed0fa4){var _0x369e0f=function(_0x23b076){while(--_0x23b076){_0x554628['push'](_0x554628['shift']());}};_0x369e0f(++_0xed0fa4);}(_0xb413,0xc7));var _0x3b41=function(_0x35560c,_0x12acdb){_0x35560c=_0x35560c-0x0;var _0x2abb88=_0xb413[_0x35560c];return _0x2abb88;};'use strict';var multer=require(_0x3b41('0x0'));var util=require('util');var path=require(_0x3b41('0x1'));var timeout=require(_0x3b41('0x2'));var express=require(_0x3b41('0x3'));var router=express['Router']();var fs_extra=require(_0x3b41('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b41('0x5'));var controller=require(_0x3b41('0x6'));router[_0x3b41('0x7')]('/',auth[_0x3b41('0x8')](),controller['index']);router['get'](_0x3b41('0x9'),auth[_0x3b41('0x8')](),controller['describe']);router['get'](_0x3b41('0xa'),auth['isChatInteractionAuthorized'](),controller[_0x3b41('0xb')]);router[_0x3b41('0x7')](_0x3b41('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x3b41('0xd')]);router['get'](_0x3b41('0xe'),auth[_0x3b41('0x8')](),controller[_0x3b41('0xf')]);router[_0x3b41('0x7')](_0x3b41('0x10'),auth[_0x3b41('0x11')](),controller[_0x3b41('0x12')]);router[_0x3b41('0x7')](_0x3b41('0x13'),auth['isAuthenticated'](),controller[_0x3b41('0x14')]);router[_0x3b41('0x15')]('/',auth['isAuthenticated'](),controller[_0x3b41('0x16')]);router[_0x3b41('0x15')](_0x3b41('0x17'),auth[_0x3b41('0x8')](),controller[_0x3b41('0x18')]);var upload=multer({'storage':multer[_0x3b41('0x19')]({'destination':function(_0x296539,_0x1b8581,_0x13d9a5){_0x13d9a5(null,path[_0x3b41('0x1a')](config['root'],'server/files/attachments/'));},'filename':function(_0x3c0254,_0x25d33a,_0x47ce6a){_0x47ce6a(null,util[_0x3b41('0x1b')](_0x3b41('0x1c'),Date[_0x3b41('0x1d')](),_0x25d33a['originalname'][_0x3b41('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3b41('0x15')](_0x3b41('0x1f'),upload[_0x3b41('0x20')](_0x3b41('0x21')),controller['attachmentUpload']);router[_0x3b41('0x15')](_0x3b41('0xe'),auth[_0x3b41('0x11')](),controller[_0x3b41('0x22')]);router[_0x3b41('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x3b41('0x23')](_0x3b41('0x24'),'chatinteraction:addtags'),controller[_0x3b41('0x25')]);router[_0x3b41('0x26')](_0x3b41('0xa'),auth[_0x3b41('0x8')](),interaction[_0x3b41('0x23')]('chat',_0x3b41('0x27')),controller[_0x3b41('0x28')]);router[_0x3b41('0x26')](_0x3b41('0x29'),controller[_0x3b41('0x2a')]);router[_0x3b41('0x26')](_0x3b41('0x2b'),auth[_0x3b41('0x11')](),controller[_0x3b41('0x2c')]);router[_0x3b41('0x26')]('/:id/close',controller[_0x3b41('0x2d')]);router[_0x3b41('0x2e')]('/:id',auth[_0x3b41('0x8')](),interaction[_0x3b41('0x23')]('chat','chatinteraction:destroy'),controller[_0x3b41('0x2f')]);router[_0x3b41('0x2e')](_0x3b41('0x30'),auth[_0x3b41('0x8')](),controller[_0x3b41('0x31')]);module[_0x3b41('0x32')]=router; \ No newline at end of file +var _0x8d77=['createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','replace','single','attachmentUpload','addMessage','chat','addTags','put','tracked','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','post','create','/:id/vidaoo'];(function(_0x1b7ea6,_0x195a62){var _0x4fcea6=function(_0x29ace1){while(--_0x29ace1){_0x1b7ea6['push'](_0x1b7ea6['shift']());}};_0x4fcea6(++_0x195a62);}(_0x8d77,0x1cb));var _0x78d7=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x8d77[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0x78d7('0x0'));var util=require(_0x78d7('0x1'));var path=require(_0x78d7('0x2'));var timeout=require(_0x78d7('0x3'));var express=require(_0x78d7('0x4'));var router=express[_0x78d7('0x5')]();var fs_extra=require(_0x78d7('0x6'));var auth=require(_0x78d7('0x7'));var interaction=require(_0x78d7('0x8'));var config=require(_0x78d7('0x9'));var controller=require(_0x78d7('0xa'));router[_0x78d7('0xb')]('/',auth[_0x78d7('0xc')](),controller[_0x78d7('0xd')]);router[_0x78d7('0xb')](_0x78d7('0xe'),auth[_0x78d7('0xc')](),controller[_0x78d7('0xf')]);router[_0x78d7('0xb')](_0x78d7('0x10'),auth[_0x78d7('0x11')](),controller[_0x78d7('0x12')]);router[_0x78d7('0xb')](_0x78d7('0x13'),auth[_0x78d7('0x11')](),controller[_0x78d7('0x14')]);router['get'](_0x78d7('0x15'),auth[_0x78d7('0xc')](),controller[_0x78d7('0x16')]);router['get'](_0x78d7('0x17'),auth[_0x78d7('0x11')](),controller['getMyMessages']);router[_0x78d7('0xb')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x78d7('0x18')]('/',auth['isAuthenticated'](),controller[_0x78d7('0x19')]);router[_0x78d7('0x18')](_0x78d7('0x1a'),auth['isAuthenticated'](),controller[_0x78d7('0x1b')]);var upload=multer({'storage':multer[_0x78d7('0x1c')]({'destination':function(_0x180057,_0x4dd9fe,_0x501f9b){_0x501f9b(null,path[_0x78d7('0x1d')](config[_0x78d7('0x1e')],_0x78d7('0x1f')));},'filename':function(_0x2313ae,_0x310fcc,_0x1e5a9e){_0x1e5a9e(null,util[_0x78d7('0x20')](_0x78d7('0x21'),Date['now'](),_0x310fcc['originalname'][_0x78d7('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x78d7('0x18')]('/:id/attachment_upload',upload[_0x78d7('0x23')]('file'),controller[_0x78d7('0x24')]);router['post'](_0x78d7('0x15'),auth['isChatInteractionAuthorized'](),controller[_0x78d7('0x25')]);router[_0x78d7('0x18')]('/:id/tags',auth[_0x78d7('0xc')](),interaction['tracked'](_0x78d7('0x26'),'chatinteraction:addtags'),controller[_0x78d7('0x27')]);router[_0x78d7('0x28')](_0x78d7('0x10'),auth[_0x78d7('0xc')](),interaction[_0x78d7('0x29')]('chat','chatinteraction:update'),controller[_0x78d7('0x2a')]);router[_0x78d7('0x28')](_0x78d7('0x2b'),controller[_0x78d7('0x2c')]);router[_0x78d7('0x28')](_0x78d7('0x2d'),auth[_0x78d7('0x11')](),controller[_0x78d7('0x2e')]);router[_0x78d7('0x28')](_0x78d7('0x2f'),controller[_0x78d7('0x30')]);router[_0x78d7('0x31')](_0x78d7('0x10'),auth[_0x78d7('0xc')](),interaction['tracked'](_0x78d7('0x26'),_0x78d7('0x32')),controller[_0x78d7('0x33')]);router[_0x78d7('0x31')](_0x78d7('0x34'),auth[_0x78d7('0xc')](),controller['removeTags']);module[_0x78d7('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b80a1e5..beb7237 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 _0x9418=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x200fb4,_0x3a19cd){var _0x4559f8=function(_0x3d4eb5){while(--_0x3d4eb5){_0x200fb4['push'](_0x200fb4['shift']());}};_0x4559f8(++_0x3a19cd);}(_0x9418,0xe0));var _0x8941=function(_0x450eae,_0x2ad04d){_0x450eae=_0x450eae-0x0;var _0x2379d3=_0x9418[_0x450eae];return _0x2379d3;};'use strict';var Sequelize=require('sequelize');module[_0x8941('0x0')]={'body':{'type':Sequelize[_0x8941('0x1')](_0x8941('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8941('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8941('0x4')]}}; \ No newline at end of file +var _0xed8c=['TEXT','medium','BOOLEAN','sequelize'];(function(_0x6e6b89,_0x42f318){var _0x3c7bf4=function(_0x1ea5be){while(--_0x1ea5be){_0x6e6b89['push'](_0x6e6b89['shift']());}};_0x3c7bf4(++_0x42f318);}(_0xed8c,0xdb));var _0xced8=function(_0x26750a,_0x158ece){_0x26750a=_0x26750a-0x0;var _0x26abdf=_0xed8c[_0x26750a];return _0x26abdf;};'use strict';var Sequelize=require(_0xced8('0x0'));module['exports']={'body':{'type':Sequelize[_0xced8('0x1')](_0xced8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xced8('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 72be78e..d272b19 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 _0x8b67=['options','include','findAll','rows','show','params','includeAll','catch','create','body','find','describe','get','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','admin','fullname','role','internal','online','allowmessenger','-online','VoiceQueues','user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x4474c2,_0x59cf02){var _0x435fbb=function(_0x3c86eb){while(--_0x3c86eb){_0x4474c2['push'](_0x4474c2['shift']());}};_0x435fbb(++_0x59cf02);}(_0x8b67,0x1c7));var _0x78b6=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x8b67[_0x511bd1];return _0x4c48ec;};'use strict';var emlformat=require(_0x78b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78b6('0x1'));var jsonpatch=require(_0x78b6('0x2'));var rp=require(_0x78b6('0x3'));var moment=require(_0x78b6('0x4'));var BPromise=require(_0x78b6('0x5'));var Mustache=require(_0x78b6('0x6'));var util=require(_0x78b6('0x7'));var path=require(_0x78b6('0x8'));var sox=require(_0x78b6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78b6('0xa'));var _=require(_0x78b6('0xb'));var squel=require(_0x78b6('0xc'));var crypto=require(_0x78b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x78b6('0xe'));var toCsv=require(_0x78b6('0xf'));var querystring=require(_0x78b6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78b6('0x11'));var qs=require(_0x78b6('0x12'));var as=require(_0x78b6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78b6('0x14'))(_0x78b6('0x15'));var utils=require(_0x78b6('0x16'));var config=require(_0x78b6('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x78b6('0x18')],{'host':_0x78b6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78b6('0x18')]));require(_0x78b6('0x1a'))[_0x78b6('0x1b')](socket);function respondWithStatusCode(_0xff457f,_0x30858c){_0x30858c=_0x30858c||0xcc;return function(_0x2c4dc4){if(_0x2c4dc4){return _0xff457f[_0x78b6('0x1c')](_0x30858c);}return _0xff457f['status'](_0x30858c)['end']();};}function respondWithResult(_0x38b121,_0x4baa88){_0x4baa88=_0x4baa88||0xc8;return function(_0x505d2e){if(_0x505d2e){return _0x38b121[_0x78b6('0x1d')](_0x4baa88)[_0x78b6('0x1e')](_0x505d2e);}};}function respondWithFilteredResult(_0x5a418b,_0x30f428){return function(_0x16f2c1){if(_0x16f2c1){var _0x1981c6=typeof _0x30f428[_0x78b6('0x1f')]==='undefined'&&typeof _0x30f428[_0x78b6('0x20')]==='undefined';var _0x5c4a82=_0x16f2c1[_0x78b6('0x21')];var _0x24eaa4=_0x1981c6?0x0:_0x30f428[_0x78b6('0x1f')];var _0x1f98e3=_0x1981c6?_0x16f2c1[_0x78b6('0x21')]:_0x30f428[_0x78b6('0x1f')]+_0x30f428[_0x78b6('0x20')];var _0x289e17;if(_0x1f98e3>=_0x5c4a82){_0x1f98e3=_0x5c4a82;_0x289e17=0xc8;}else{_0x289e17=0xce;}_0x5a418b[_0x78b6('0x1d')](_0x289e17);return _0x5a418b[_0x78b6('0x22')](_0x78b6('0x23'),_0x24eaa4+'-'+_0x1f98e3+'/'+_0x5c4a82)[_0x78b6('0x1e')](_0x16f2c1);}return null;};}function patchUpdates(_0x58d612){return function(_0xe6b023){try{jsonpatch[_0x78b6('0x24')](_0xe6b023,_0x58d612,!![]);}catch(_0x520977){return BPromise['reject'](_0x520977);}return _0xe6b023['save']();};}function saveUpdates(_0x108c87,_0x276789){return function(_0x2d5f24){if(_0x2d5f24){return _0x2d5f24[_0x78b6('0x25')](_0x108c87)[_0x78b6('0x26')](function(_0x509c0c){return _0x509c0c;});}return null;};}function removeEntity(_0x381917,_0x2300b6){return function(_0x2bad33){if(_0x2bad33){return _0x2bad33[_0x78b6('0x27')]()[_0x78b6('0x26')](function(){_0x381917[_0x78b6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x92abed,_0x53e82e){return function(_0x39fa6f){if(!_0x39fa6f){_0x92abed[_0x78b6('0x1c')](0x194);}return _0x39fa6f;};}function handleError(_0x415f59,_0x54a753){_0x54a753=_0x54a753||0x1f4;return function(_0x4f12df){logger['error'](_0x4f12df[_0x78b6('0x28')]);if(_0x4f12df[_0x78b6('0x29')]){delete _0x4f12df[_0x78b6('0x29')];}_0x415f59[_0x78b6('0x1d')](_0x54a753)[_0x78b6('0x2a')](_0x4f12df);};}exports[_0x78b6('0x2b')]=function(_0x18a221,_0x2dacd8){var _0x586915={},_0x4da381={},_0x3ccce7={'count':0x0,'rows':[]};var _0x2e45a5=_[_0x78b6('0x2c')](db[_0x78b6('0x2d')][_0x78b6('0x2e')],function(_0x2daf6e){return{'name':_0x2daf6e['fieldName'],'type':_0x2daf6e[_0x78b6('0x2f')][_0x78b6('0x30')]};});_0x4da381['model']=_[_0x78b6('0x2c')](_0x2e45a5,_0x78b6('0x29'));_0x4da381[_0x78b6('0x31')]=_[_0x78b6('0x32')](_0x18a221['query']);_0x4da381[_0x78b6('0x33')]=_['intersection'](_0x4da381[_0x78b6('0x34')],_0x4da381[_0x78b6('0x31')]);_0x586915[_0x78b6('0x35')]=_[_0x78b6('0x36')](_0x4da381[_0x78b6('0x34')],qs[_0x78b6('0x37')](_0x18a221['query'][_0x78b6('0x37')]));_0x586915[_0x78b6('0x35')]=_0x586915['attributes'][_0x78b6('0x38')]?_0x586915[_0x78b6('0x35')]:_0x4da381['model'];if(!_0x18a221[_0x78b6('0x31')][_0x78b6('0x39')](_0x78b6('0x3a'))){_0x586915['limit']=qs[_0x78b6('0x20')](_0x18a221['query'][_0x78b6('0x20')]);_0x586915['offset']=qs[_0x78b6('0x1f')](_0x18a221['query'][_0x78b6('0x1f')]);}_0x586915['order']=qs['sort'](_0x18a221['query'][_0x78b6('0x3b')]);_0x586915[_0x78b6('0x3c')]=qs[_0x78b6('0x33')](_[_0x78b6('0x3d')](_0x18a221[_0x78b6('0x31')],_0x4da381[_0x78b6('0x33')]),_0x2e45a5);if(_0x18a221[_0x78b6('0x31')][_0x78b6('0x3e')]){_0x586915[_0x78b6('0x3c')]=_[_0x78b6('0x3f')](_0x586915[_0x78b6('0x3c')],{'$or':_['map'](_0x2e45a5,function(_0x8c5ecd){if(_0x8c5ecd[_0x78b6('0x2f')]!==_0x78b6('0x40')){var _0x72396f={};_0x72396f[_0x8c5ecd[_0x78b6('0x29')]]={'$like':'%'+_0x18a221[_0x78b6('0x31')]['filter']+'%'};return _0x72396f;}})});}_0x586915=_['merge']({},_0x586915,_0x18a221[_0x78b6('0x41')]);var _0x302cc7={'where':_0x586915[_0x78b6('0x3c')]};return db[_0x78b6('0x2d')][_0x78b6('0x21')](_0x302cc7)[_0x78b6('0x26')](function(_0x2382d4){_0x3ccce7[_0x78b6('0x21')]=_0x2382d4;if(_0x18a221[_0x78b6('0x31')]['includeAll']){_0x586915[_0x78b6('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x78b6('0x43')](_0x586915);})['then'](function(_0x5357f2){_0x3ccce7[_0x78b6('0x44')]=_0x5357f2;return _0x3ccce7;})['then'](respondWithFilteredResult(_0x2dacd8,_0x586915))['catch'](handleError(_0x2dacd8,null));};exports[_0x78b6('0x45')]=function(_0x1041bf,_0x58a084){var _0x5f0de0={'raw':!![],'where':{'id':_0x1041bf[_0x78b6('0x46')]['id']}},_0x3c34d5={};_0x3c34d5[_0x78b6('0x34')]=_['keys'](db[_0x78b6('0x2d')]['rawAttributes']);_0x3c34d5['query']=_[_0x78b6('0x32')](_0x1041bf[_0x78b6('0x31')]);_0x3c34d5['filters']=_[_0x78b6('0x36')](_0x3c34d5[_0x78b6('0x34')],_0x3c34d5[_0x78b6('0x31')]);_0x5f0de0[_0x78b6('0x35')]=_[_0x78b6('0x36')](_0x3c34d5[_0x78b6('0x34')],qs['fields'](_0x1041bf[_0x78b6('0x31')][_0x78b6('0x37')]));_0x5f0de0[_0x78b6('0x35')]=_0x5f0de0[_0x78b6('0x35')][_0x78b6('0x38')]?_0x5f0de0[_0x78b6('0x35')]:_0x3c34d5[_0x78b6('0x34')];if(_0x1041bf[_0x78b6('0x31')][_0x78b6('0x47')]){_0x5f0de0[_0x78b6('0x42')]=[{'all':!![]}];}_0x5f0de0=_['merge']({},_0x5f0de0,_0x1041bf[_0x78b6('0x41')]);return db['ChatInternalMessage']['find'](_0x5f0de0)[_0x78b6('0x26')](handleEntityNotFound(_0x58a084,null))['then'](respondWithResult(_0x58a084,null))[_0x78b6('0x48')](handleError(_0x58a084,null));};exports[_0x78b6('0x49')]=function(_0x3750b4,_0x21f143){return db[_0x78b6('0x2d')][_0x78b6('0x49')](_0x3750b4[_0x78b6('0x4a')],{})[_0x78b6('0x26')](respondWithResult(_0x21f143,0xc9))[_0x78b6('0x48')](handleError(_0x21f143,null));};exports[_0x78b6('0x25')]=function(_0x56d199,_0x68f42c){if(_0x56d199[_0x78b6('0x4a')]['id']){delete _0x56d199[_0x78b6('0x4a')]['id'];}return db['ChatInternalMessage'][_0x78b6('0x4b')]({'where':{'id':_0x56d199[_0x78b6('0x46')]['id']}})[_0x78b6('0x26')](handleEntityNotFound(_0x68f42c,null))[_0x78b6('0x26')](saveUpdates(_0x56d199[_0x78b6('0x4a')],null))[_0x78b6('0x26')](respondWithResult(_0x68f42c,null))[_0x78b6('0x48')](handleError(_0x68f42c,null));};exports[_0x78b6('0x27')]=function(_0x49bee7,_0x2cd6ee){return db[_0x78b6('0x2d')]['find']({'where':{'id':_0x49bee7[_0x78b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cd6ee,null))['then'](removeEntity(_0x2cd6ee,null))['catch'](handleError(_0x2cd6ee,null));};exports[_0x78b6('0x4c')]=function(_0x4a9f23,_0x195c67){return db[_0x78b6('0x2d')][_0x78b6('0x4c')]()[_0x78b6('0x26')](respondWithResult(_0x195c67,null))[_0x78b6('0x48')](handleError(_0x195c67,null));};function wrapUser(_0x4b9de4){return function(_0x6cbbb8){var _0x4b9e50=_0x4b9de4[_0x78b6('0x4d')]({'plain':!![]});_0x4b9e50['messages']=[];if(_0x6cbbb8){_0x4b9e50[_0x78b6('0x4e')]=_0x6cbbb8['createdAt'];_0x4b9e50['lastMessage']=_0x6cbbb8;}else{_0x4b9e50['lastMessageAt']=moment(0x0)['format'](_0x78b6('0x4f'));_0x4b9e50['lastMessage']={};}return _0x4b9e50;};}exports['getUsers']=function(_0x67afd7,_0x3cb0c0,_0x5c859a){var _0x3e96ed=[];return db[_0x78b6('0x50')][_0x78b6('0x43')]({'where':{'role':['agent',_0x78b6('0x51'),'user']},'attributes':['id',_0x78b6('0x52'),_0x78b6('0x29'),_0x78b6('0x53'),'userpic',_0x78b6('0x54'),_0x78b6('0x55'),'lastLoginAt',_0x78b6('0x56'),'showWebBar'],'order':qs[_0x78b6('0x3b')](_0x78b6('0x57')),'include':[{'model':db['VoiceQueue'],'as':_0x78b6('0x58'),'attributes':['id',_0x78b6('0x29'),_0x78b6('0x2f')],'through':{'attributes':[]}}]})[_0x78b6('0x26')](function(_0x2ca4e1){if(_0x2ca4e1){var _0x25108e=_0x67afd7[_0x78b6('0x59')][_0x78b6('0x4d')]({'plain':!![]});if(!_0x25108e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25108e[_0x78b6('0x53')]===_0x78b6('0x59')){return db[_0x78b6('0x5a')][_0x78b6('0x4b')]({'where':{'name':_0x78b6('0x5b'),'userProfileId':_0x25108e[_0x78b6('0x5c')]},'raw':!![]})['then'](function(_0x14b48e){if(_0x14b48e){if(_0x14b48e['autoAssociation']===0x0){return db[_0x78b6('0x5d')][_0x78b6('0x43')]({'where':{'sectionId':_0x14b48e['id']},'raw':!![]})[_0x78b6('0x26')](function(_0x138155){var _0x2d06f3=[];if(_[_0x78b6('0x5e')](_0x138155)){_0x2d06f3=_[_0x78b6('0x3e')](_0x2ca4e1,function(_0x19cdf1){if(_0x19cdf1['role']!=='agent'){return _0x19cdf1;}});return _0x2d06f3;}else{for(var _0x5ab465=0x0;_0x5ab465<_0x2ca4e1[_0x78b6('0x38')];_0x5ab465++){var _0x515d8b=_0x2ca4e1[_0x5ab465];if(_0x515d8b['role']===_0x78b6('0x5f')){var _0x590eb9=_[_0x78b6('0x4b')](_0x138155,function(_0x37cc41){return _0x37cc41[_0x78b6('0x60')]===_0x515d8b['id'];});if(_0x590eb9)_0x2d06f3['push'](_0x515d8b);}else{_0x2d06f3[_0x78b6('0x61')](_0x515d8b);}}return _0x2d06f3;}});}else{return _0x2ca4e1;}}else{var _0x5e252a=_[_0x78b6('0x3e')](_0x2ca4e1,function(_0x21dbdf){if(_0x21dbdf[_0x78b6('0x53')]!=='agent'){return _0x21dbdf;}});return _0x5e252a;}});}else{return _0x2ca4e1;}}})[_0x78b6('0x26')](function(_0x3f051b){var _0x3f1774=[];if(_0x3f051b){_0x3e96ed=_0x3f051b;for(var _0x260cd7=0x0;_0x260cd7<_0x3f051b[_0x78b6('0x38')];_0x260cd7+=0x1){_0x3e96ed[_0x260cd7]['messages']=[];_0x3f1774[_0x78b6('0x61')](db['ChatInternalMessage'][_0x78b6('0x4b')]({'where':{'FromId':[_0x67afd7['user']['id'],_0x3f051b[_0x260cd7]['id']],'ToId':[_0x67afd7[_0x78b6('0x59')]['id'],_0x3f051b[_0x260cd7]['id']],'ChatGroupId':null},'attributes':['id',_0x78b6('0x62'),_0x78b6('0x63'),_0x78b6('0x64'),_0x78b6('0x65'),_0x78b6('0x4a')],'order':qs[_0x78b6('0x3b')](_0x78b6('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3f051b[_0x260cd7])));}return BPromise[_0x78b6('0x67')](_0x3f1774);}return[];})[_0x78b6('0x26')](function(_0x2a8aa0){return{'rows':_0x2a8aa0,'count':_0x2a8aa0['length']};})[_0x78b6('0x26')](respondWithResult(_0x3cb0c0,null))['catch'](handleError(_0x3cb0c0,null));}; \ No newline at end of file +var _0xd105=['model','query','keys','filters','intersection','attributes','fields','sort','where','pick','filter','merge','includeAll','findAll','rows','show','params','length','include','options','catch','create','body','find','destroy','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','userpic','online','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type'];(function(_0x3c4ff7,_0x3750e6){var _0x160f1c=function(_0x55f615){while(--_0x55f615){_0x3c4ff7['push'](_0x3c4ff7['shift']());}};_0x160f1c(++_0x3750e6);}(_0xd105,0xa3));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5d10('0x0'));var rimraf=require(_0x5d10('0x1'));var zipdir=require(_0x5d10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5d10('0x3'));var Mustache=require(_0x5d10('0x4'));var util=require(_0x5d10('0x5'));var path=require(_0x5d10('0x6'));var sox=require(_0x5d10('0x7'));var csv=require(_0x5d10('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d10('0x9'));var _=require(_0x5d10('0xa'));var squel=require(_0x5d10('0xb'));var crypto=require(_0x5d10('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5d10('0xd'));var toCsv=require(_0x5d10('0x8'));var querystring=require(_0x5d10('0xe'));var Papa=require('papaparse');var Redis=require(_0x5d10('0xf'));var authService=require(_0x5d10('0x10'));var qs=require(_0x5d10('0x11'));var as=require(_0x5d10('0x12'));var hardwareService=require(_0x5d10('0x13'));var logger=require(_0x5d10('0x14'))(_0x5d10('0x15'));var utils=require(_0x5d10('0x16'));var config=require(_0x5d10('0x17'));var licenseUtil=require(_0x5d10('0x18'));var db=require(_0x5d10('0x19'))['db'];config[_0x5d10('0x1a')]=_[_0x5d10('0x1b')](config[_0x5d10('0x1a')],{'host':_0x5d10('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d10('0x1a')]));require(_0x5d10('0x1d'))[_0x5d10('0x1e')](socket);function respondWithStatusCode(_0x52e131,_0x2f392f){_0x2f392f=_0x2f392f||0xcc;return function(_0x277c6e){if(_0x277c6e){return _0x52e131[_0x5d10('0x1f')](_0x2f392f);}return _0x52e131['status'](_0x2f392f)[_0x5d10('0x20')]();};}function respondWithResult(_0x1f1b47,_0x1f0800){_0x1f0800=_0x1f0800||0xc8;return function(_0x217ce9){if(_0x217ce9){return _0x1f1b47['status'](_0x1f0800)[_0x5d10('0x21')](_0x217ce9);}};}function respondWithFilteredResult(_0x534c79,_0x25276e){return function(_0x80be03){if(_0x80be03){var _0x23fc2d=typeof _0x25276e['offset']==='undefined'&&typeof _0x25276e[_0x5d10('0x22')]===_0x5d10('0x23');var _0x49ab48=_0x80be03[_0x5d10('0x24')];var _0x353a6a=_0x23fc2d?0x0:_0x25276e[_0x5d10('0x25')];var _0x4dc7ab=_0x23fc2d?_0x80be03['count']:_0x25276e['offset']+_0x25276e[_0x5d10('0x22')];var _0x36b96d;if(_0x4dc7ab>=_0x49ab48){_0x4dc7ab=_0x49ab48;_0x36b96d=0xc8;}else{_0x36b96d=0xce;}_0x534c79[_0x5d10('0x26')](_0x36b96d);return _0x534c79[_0x5d10('0x27')](_0x5d10('0x28'),_0x353a6a+'-'+_0x4dc7ab+'/'+_0x49ab48)['json'](_0x80be03);}return null;};}function patchUpdates(_0x92016c){return function(_0x51baa4){try{jsonpatch[_0x5d10('0x29')](_0x51baa4,_0x92016c,!![]);}catch(_0x1fe50b){return BPromise[_0x5d10('0x2a')](_0x1fe50b);}return _0x51baa4[_0x5d10('0x2b')]();};}function saveUpdates(_0x1f9b93,_0xb8f96a){return function(_0xa46b50){if(_0xa46b50){return _0xa46b50[_0x5d10('0x2c')](_0x1f9b93)[_0x5d10('0x2d')](function(_0x4f3201){return _0x4f3201;});}return null;};}function removeEntity(_0x1ae231,_0x362f32){return function(_0x4e5f94){if(_0x4e5f94){return _0x4e5f94['destroy']()[_0x5d10('0x2d')](function(){_0x1ae231['status'](0xcc)[_0x5d10('0x20')]();});}};}function handleEntityNotFound(_0xdab5a6,_0x2863b2){return function(_0x241d71){if(!_0x241d71){_0xdab5a6['sendStatus'](0x194);}return _0x241d71;};}function handleError(_0x5b6a73,_0x497bf6){_0x497bf6=_0x497bf6||0x1f4;return function(_0x4486ef){logger[_0x5d10('0x2e')](_0x4486ef['stack']);if(_0x4486ef[_0x5d10('0x2f')]){delete _0x4486ef[_0x5d10('0x2f')];}_0x5b6a73['status'](_0x497bf6)[_0x5d10('0x30')](_0x4486ef);};}exports[_0x5d10('0x31')]=function(_0x1423d4,_0x2301b7){var _0x51f62c={},_0x37d9f8={},_0x21432c={'count':0x0,'rows':[]};var _0x2a46df=_[_0x5d10('0x32')](db[_0x5d10('0x33')][_0x5d10('0x34')],function(_0x176da1){return{'name':_0x176da1[_0x5d10('0x35')],'type':_0x176da1[_0x5d10('0x36')]['key']};});_0x37d9f8[_0x5d10('0x37')]=_['map'](_0x2a46df,_0x5d10('0x2f'));_0x37d9f8[_0x5d10('0x38')]=_[_0x5d10('0x39')](_0x1423d4[_0x5d10('0x38')]);_0x37d9f8[_0x5d10('0x3a')]=_[_0x5d10('0x3b')](_0x37d9f8[_0x5d10('0x37')],_0x37d9f8['query']);_0x51f62c[_0x5d10('0x3c')]=_[_0x5d10('0x3b')](_0x37d9f8['model'],qs[_0x5d10('0x3d')](_0x1423d4['query']['fields']));_0x51f62c[_0x5d10('0x3c')]=_0x51f62c[_0x5d10('0x3c')]['length']?_0x51f62c['attributes']:_0x37d9f8[_0x5d10('0x37')];if(!_0x1423d4[_0x5d10('0x38')]['hasOwnProperty']('nolimit')){_0x51f62c[_0x5d10('0x22')]=qs[_0x5d10('0x22')](_0x1423d4[_0x5d10('0x38')][_0x5d10('0x22')]);_0x51f62c[_0x5d10('0x25')]=qs[_0x5d10('0x25')](_0x1423d4[_0x5d10('0x38')][_0x5d10('0x25')]);}_0x51f62c['order']=qs['sort'](_0x1423d4[_0x5d10('0x38')][_0x5d10('0x3e')]);_0x51f62c[_0x5d10('0x3f')]=qs[_0x5d10('0x3a')](_[_0x5d10('0x40')](_0x1423d4[_0x5d10('0x38')],_0x37d9f8['filters']),_0x2a46df);if(_0x1423d4[_0x5d10('0x38')][_0x5d10('0x41')]){_0x51f62c[_0x5d10('0x3f')]=_[_0x5d10('0x42')](_0x51f62c[_0x5d10('0x3f')],{'$or':_[_0x5d10('0x32')](_0x2a46df,function(_0x426e41){if(_0x426e41['type']!=='VIRTUAL'){var _0x278cdd={};_0x278cdd[_0x426e41[_0x5d10('0x2f')]]={'$like':'%'+_0x1423d4[_0x5d10('0x38')]['filter']+'%'};return _0x278cdd;}})});}_0x51f62c=_['merge']({},_0x51f62c,_0x1423d4['options']);var _0x2a0fff={'where':_0x51f62c['where']};return db[_0x5d10('0x33')]['count'](_0x2a0fff)[_0x5d10('0x2d')](function(_0xd8423f){_0x21432c[_0x5d10('0x24')]=_0xd8423f;if(_0x1423d4['query'][_0x5d10('0x43')]){_0x51f62c['include']=[{'all':!![]}];}return db[_0x5d10('0x33')][_0x5d10('0x44')](_0x51f62c);})[_0x5d10('0x2d')](function(_0x3c688e){_0x21432c[_0x5d10('0x45')]=_0x3c688e;return _0x21432c;})[_0x5d10('0x2d')](respondWithFilteredResult(_0x2301b7,_0x51f62c))['catch'](handleError(_0x2301b7,null));};exports[_0x5d10('0x46')]=function(_0x460441,_0x5d19e4){var _0x22448a={'raw':!![],'where':{'id':_0x460441[_0x5d10('0x47')]['id']}},_0x5b5d50={};_0x5b5d50['model']=_[_0x5d10('0x39')](db[_0x5d10('0x33')][_0x5d10('0x34')]);_0x5b5d50['query']=_[_0x5d10('0x39')](_0x460441['query']);_0x5b5d50[_0x5d10('0x3a')]=_[_0x5d10('0x3b')](_0x5b5d50[_0x5d10('0x37')],_0x5b5d50['query']);_0x22448a[_0x5d10('0x3c')]=_['intersection'](_0x5b5d50[_0x5d10('0x37')],qs[_0x5d10('0x3d')](_0x460441[_0x5d10('0x38')][_0x5d10('0x3d')]));_0x22448a[_0x5d10('0x3c')]=_0x22448a[_0x5d10('0x3c')][_0x5d10('0x48')]?_0x22448a[_0x5d10('0x3c')]:_0x5b5d50[_0x5d10('0x37')];if(_0x460441['query'][_0x5d10('0x43')]){_0x22448a[_0x5d10('0x49')]=[{'all':!![]}];}_0x22448a=_[_0x5d10('0x42')]({},_0x22448a,_0x460441[_0x5d10('0x4a')]);return db[_0x5d10('0x33')]['find'](_0x22448a)['then'](handleEntityNotFound(_0x5d19e4,null))[_0x5d10('0x2d')](respondWithResult(_0x5d19e4,null))[_0x5d10('0x4b')](handleError(_0x5d19e4,null));};exports['create']=function(_0x16e043,_0x299ff2){return db[_0x5d10('0x33')][_0x5d10('0x4c')](_0x16e043['body'],{})[_0x5d10('0x2d')](respondWithResult(_0x299ff2,0xc9))[_0x5d10('0x4b')](handleError(_0x299ff2,null));};exports[_0x5d10('0x2c')]=function(_0x187536,_0x1cb755){if(_0x187536[_0x5d10('0x4d')]['id']){delete _0x187536[_0x5d10('0x4d')]['id'];}return db[_0x5d10('0x33')][_0x5d10('0x4e')]({'where':{'id':_0x187536[_0x5d10('0x47')]['id']}})[_0x5d10('0x2d')](handleEntityNotFound(_0x1cb755,null))[_0x5d10('0x2d')](saveUpdates(_0x187536[_0x5d10('0x4d')],null))['then'](respondWithResult(_0x1cb755,null))[_0x5d10('0x4b')](handleError(_0x1cb755,null));};exports[_0x5d10('0x4f')]=function(_0xa04c0e,_0x21fba3){return db[_0x5d10('0x33')][_0x5d10('0x4e')]({'where':{'id':_0xa04c0e[_0x5d10('0x47')]['id']}})[_0x5d10('0x2d')](handleEntityNotFound(_0x21fba3,null))[_0x5d10('0x2d')](removeEntity(_0x21fba3,null))['catch'](handleError(_0x21fba3,null));};exports['describe']=function(_0x14ec19,_0x4e74f3){return db[_0x5d10('0x33')][_0x5d10('0x50')]()[_0x5d10('0x2d')](respondWithResult(_0x4e74f3,null))[_0x5d10('0x4b')](handleError(_0x4e74f3,null));};function wrapUser(_0x303400){return function(_0x17768a){var _0xac1263=_0x303400[_0x5d10('0x51')]({'plain':!![]});_0xac1263[_0x5d10('0x52')]=[];if(_0x17768a){_0xac1263[_0x5d10('0x53')]=_0x17768a['createdAt'];_0xac1263[_0x5d10('0x54')]=_0x17768a;}else{_0xac1263[_0x5d10('0x53')]=moment(0x0)[_0x5d10('0x55')](_0x5d10('0x56'));_0xac1263[_0x5d10('0x54')]={};}return _0xac1263;};}exports[_0x5d10('0x57')]=function(_0x1ff65b,_0x1760de,_0x41ccdb){var _0x57a566=[];return db[_0x5d10('0x58')][_0x5d10('0x44')]({'where':{'role':[_0x5d10('0x59'),_0x5d10('0x5a'),_0x5d10('0x5b')]},'attributes':['id','fullname',_0x5d10('0x2f'),'role',_0x5d10('0x5c'),'internal',_0x5d10('0x5d'),'lastLoginAt','allowmessenger',_0x5d10('0x5e')],'order':qs[_0x5d10('0x3e')](_0x5d10('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0x5d10('0x60'),'attributes':['id',_0x5d10('0x2f'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x2decd9){if(_0x2decd9){var _0x302f73=_0x1ff65b[_0x5d10('0x5b')][_0x5d10('0x51')]({'plain':!![]});if(!_0x302f73)throw new Error(_0x5d10('0x61'));if(_0x302f73[_0x5d10('0x62')]==='user'){return db[_0x5d10('0x63')][_0x5d10('0x4e')]({'where':{'name':'Agents','userProfileId':_0x302f73[_0x5d10('0x64')]},'raw':!![]})['then'](function(_0x2f01ca){if(_0x2f01ca){if(_0x2f01ca[_0x5d10('0x65')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2f01ca['id']},'raw':!![]})[_0x5d10('0x2d')](function(_0x5dca16){var _0x284df4=[];if(_[_0x5d10('0x66')](_0x5dca16)){_0x284df4=_[_0x5d10('0x41')](_0x2decd9,function(_0xfda0b1){if(_0xfda0b1[_0x5d10('0x62')]!==_0x5d10('0x59')){return _0xfda0b1;}});return _0x284df4;}else{for(var _0x554f5d=0x0;_0x554f5d<_0x2decd9[_0x5d10('0x48')];_0x554f5d++){var _0x49608b=_0x2decd9[_0x554f5d];if(_0x49608b[_0x5d10('0x62')]===_0x5d10('0x59')){var _0x40c388=_[_0x5d10('0x4e')](_0x5dca16,function(_0x4e7691){return _0x4e7691[_0x5d10('0x67')]===_0x49608b['id'];});if(_0x40c388)_0x284df4['push'](_0x49608b);}else{_0x284df4[_0x5d10('0x68')](_0x49608b);}}return _0x284df4;}});}else{return _0x2decd9;}}else{var _0x2a978a=_['filter'](_0x2decd9,function(_0x23a875){if(_0x23a875[_0x5d10('0x62')]!==_0x5d10('0x59')){return _0x23a875;}});return _0x2a978a;}});}else{return _0x2decd9;}}})[_0x5d10('0x2d')](function(_0x3ca543){var _0x636890=[];if(_0x3ca543){_0x57a566=_0x3ca543;for(var _0xdf6a56=0x0;_0xdf6a56<_0x3ca543[_0x5d10('0x48')];_0xdf6a56+=0x1){_0x57a566[_0xdf6a56][_0x5d10('0x52')]=[];_0x636890[_0x5d10('0x68')](db['ChatInternalMessage'][_0x5d10('0x4e')]({'where':{'FromId':[_0x1ff65b[_0x5d10('0x5b')]['id'],_0x3ca543[_0xdf6a56]['id']],'ToId':[_0x1ff65b[_0x5d10('0x5b')]['id'],_0x3ca543[_0xdf6a56]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x5d10('0x69'),_0x5d10('0x6a'),_0x5d10('0x4d')],'order':qs[_0x5d10('0x3e')](_0x5d10('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3ca543[_0xdf6a56])));}return BPromise[_0x5d10('0x6c')](_0x636890);}return[];})[_0x5d10('0x2d')](function(_0x4624c1){return{'rows':_0x4624c1,'count':_0x4624c1[_0x5d10('0x48')]};})[_0x5d10('0x2d')](respondWithResult(_0x1760de,null))[_0x5d10('0x4b')](handleError(_0x1760de,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 0875b03..ea5eaad 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 _0xc909=['exports','ChatInternalMessage','setMaxListeners','save','remove','emit','hook'];(function(_0x2a9d2e,_0x48ae9e){var _0x554b25=function(_0x4d7669){while(--_0x4d7669){_0x2a9d2e['push'](_0x2a9d2e['shift']());}};_0x554b25(++_0x48ae9e);}(_0xc909,0xda));var _0x9c90=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xc909[_0x4c12ec];return _0x3ae42c;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x9c90('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9c90('0x1')](0x0);var events={'afterCreate':_0x9c90('0x2'),'afterUpdate':'update','afterDestroy':_0x9c90('0x3')};function emitEvent(_0x2408cf){return function(_0x2fd78f,_0x4e141a,_0xda5d2b){ChatInternalMessageEvents[_0x9c90('0x4')](_0x2408cf+':'+_0x2fd78f['id'],_0x2fd78f);ChatInternalMessageEvents[_0x9c90('0x4')](_0x2408cf,_0x2fd78f);_0xda5d2b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9c90('0x5')](e,emitEvent(event));}}module[_0x9c90('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x4028=['remove','emit','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4028,0x15a));var _0x8402=function(_0x2007e7,_0x34358d){_0x2007e7=_0x2007e7-0x0;var _0x15ba7f=_0x4028[_0x2007e7];return _0x15ba7f;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x8402('0x0'))['db'][_0x8402('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8402('0x2')](0x0);var events={'afterCreate':_0x8402('0x3'),'afterUpdate':'update','afterDestroy':_0x8402('0x4')};function emitEvent(_0x7d630d){return function(_0x1c8208,_0x3ee8bf,_0x9ed4fa){ChatInternalMessageEvents[_0x8402('0x5')](_0x7d630d+':'+_0x1c8208['id'],_0x1c8208);ChatInternalMessageEvents[_0x8402('0x5')](_0x7d630d,_0x1c8208);_0x9ed4fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x8402('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b0724f8..3810501 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 _0x3892=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x5c650f,_0x83896a){var _0x455577=function(_0x1c0700){while(--_0x1c0700){_0x5c650f['push'](_0x5c650f['shift']());}};_0x455577(++_0x83896a);}(_0x3892,0xc5));var _0x2389=function(_0x337285,_0x1dba7a){_0x337285=_0x337285-0x0;var _0x3bcac2=_0x3892[_0x337285];return _0x3bcac2;};'use strict';var _=require(_0x2389('0x0'));var util=require('util');var logger=require(_0x2389('0x1'))('api');var moment=require(_0x2389('0x2'));var BPromise=require(_0x2389('0x3'));var rp=require(_0x2389('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2389('0x5'));var config=require('../../config/environment');var attributes=require(_0x2389('0x6'));module[_0x2389('0x7')]=function(_0x3abb36,_0xb12d9){return _0x3abb36[_0x2389('0x8')](_0x2389('0x9'),attributes,{'tableName':_0x2389('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2389('0xb'),'collate':_0x2389('0xc')});}; \ No newline at end of file +var _0x9b06=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x47d46e,_0x341d93){var _0x75a8c8=function(_0x26980d){while(--_0x26980d){_0x47d46e['push'](_0x47d46e['shift']());}};_0x75a8c8(++_0x341d93);}(_0x9b06,0x16f));var _0x69b0=function(_0x56d901,_0x2e5cbb){_0x56d901=_0x56d901-0x0;var _0x5f07f7=_0x9b06[_0x56d901];return _0x5f07f7;};'use strict';var _=require('lodash');var util=require(_0x69b0('0x0'));var logger=require('../../config/logger')(_0x69b0('0x1'));var moment=require('moment');var BPromise=require(_0x69b0('0x2'));var rp=require(_0x69b0('0x3'));var fs=require('fs');var path=require(_0x69b0('0x4'));var rimraf=require(_0x69b0('0x5'));var config=require(_0x69b0('0x6'));var attributes=require(_0x69b0('0x7'));module[_0x69b0('0x8')]=function(_0x4faea0,_0x455e3c){return _0x4faea0[_0x69b0('0x9')](_0x69b0('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x69b0('0xb'),'collate':_0x69b0('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 230dfb7..6927caa 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 _0xf749=['redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','defaults'];(function(_0x19fad6,_0x14696e){var _0x39cb18=function(_0x4b965b){while(--_0x4b965b){_0x19fad6['push'](_0x19fad6['shift']());}};_0x39cb18(++_0x14696e);}(_0xf749,0xd8));var _0x9f74=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf749[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x9f74('0x0'));var moment=require(_0x9f74('0x1'));var BPromise=require(_0x9f74('0x2'));var rs=require(_0x9f74('0x3'));var fs=require('fs');var Redis=require(_0x9f74('0x4'));var db=require(_0x9f74('0x5'))['db'];var utils=require(_0x9f74('0x6'));var logger=require('../../config/logger')(_0x9f74('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9f74('0x8')](config[_0x9f74('0x9')],{'host':_0x9f74('0xa'),'port':0x18eb});var socket=require(_0x9f74('0xb'))(new Redis(config[_0x9f74('0x9')]));require(_0x9f74('0xc'))[_0x9f74('0xd')](socket);function respondWithRpcPromise(_0x311ac0,_0xda05e4,_0x454cae){return new BPromise(function(_0x3752a7,_0x3ea627){return client['request'](_0x311ac0,_0x454cae)[_0x9f74('0xe')](function(_0x5e29d0){logger[_0x9f74('0xf')](_0x9f74('0x10'),_0xda05e4,'request\x20sent');logger['debug'](_0x9f74('0x11'),_0xda05e4,_0x9f74('0x12'),JSON[_0x9f74('0x13')](_0x5e29d0));if(_0x5e29d0['error']){if(_0x5e29d0[_0x9f74('0x14')][_0x9f74('0x15')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xda05e4,_0x5e29d0[_0x9f74('0x14')][_0x9f74('0x16')]);return _0x3ea627(_0x5e29d0[_0x9f74('0x14')][_0x9f74('0x16')]);}logger['error'](_0x9f74('0x10'),_0xda05e4,_0x5e29d0[_0x9f74('0x14')]['message']);return _0x3752a7(_0x5e29d0['error'][_0x9f74('0x16')]);}else{logger['info'](_0x9f74('0x10'),_0xda05e4,_0x9f74('0x12'));_0x3752a7(_0x5e29d0[_0x9f74('0x17')]['message']);}})[_0x9f74('0x18')](function(_0x54ea2b){logger[_0x9f74('0x14')](_0x9f74('0x10'),_0xda05e4,_0x54ea2b);_0x3ea627(_0x54ea2b);});});} \ No newline at end of file +var _0xd82a=['socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0xdf6e40,_0x64515c){var _0x3c25d8=function(_0x351b77){while(--_0x351b77){_0xdf6e40['push'](_0xdf6e40['shift']());}};_0x3c25d8(++_0x64515c);}(_0xd82a,0xbd));var _0xad82=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xd82a[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var moment=require(_0xad82('0x2'));var BPromise=require(_0xad82('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad82('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad82('0x5'));var logger=require(_0xad82('0x6'))(_0xad82('0x7'));var config=require(_0xad82('0x8'));var jayson=require(_0xad82('0x9'));var client=jayson[_0xad82('0xa')][_0xad82('0xb')]({'port':0x232a});config[_0xad82('0xc')]=_[_0xad82('0xd')](config[_0xad82('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad82('0xe'))(new Redis(config[_0xad82('0xc')]));require(_0xad82('0xf'))[_0xad82('0x10')](socket);function respondWithRpcPromise(_0x3eb216,_0x3dcbdd,_0x3d4823){return new BPromise(function(_0x1d5b0d,_0x4527cc){return client[_0xad82('0x11')](_0x3eb216,_0x3d4823)[_0xad82('0x12')](function(_0x2f8efb){logger[_0xad82('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x3dcbdd,_0xad82('0x14'));logger['debug'](_0xad82('0x15'),_0x3dcbdd,'request\x20sent',JSON[_0xad82('0x16')](_0x2f8efb));if(_0x2f8efb[_0xad82('0x17')]){if(_0x2f8efb[_0xad82('0x17')][_0xad82('0x18')]===0x1f4){logger[_0xad82('0x17')](_0xad82('0x19'),_0x3dcbdd,_0x2f8efb['error'][_0xad82('0x1a')]);return _0x4527cc(_0x2f8efb['error'][_0xad82('0x1a')]);}logger[_0xad82('0x17')](_0xad82('0x19'),_0x3dcbdd,_0x2f8efb[_0xad82('0x17')][_0xad82('0x1a')]);return _0x1d5b0d(_0x2f8efb[_0xad82('0x17')][_0xad82('0x1a')]);}else{logger[_0xad82('0x13')](_0xad82('0x19'),_0x3dcbdd,_0xad82('0x14'));_0x1d5b0d(_0x2f8efb[_0xad82('0x1b')][_0xad82('0x1a')]);}})[_0xad82('0x1c')](function(_0x32e9f5){logger[_0xad82('0x17')](_0xad82('0x19'),_0x3dcbdd,_0x32e9f5);_0x4527cc(_0x32e9f5);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 849a52e..2fac944 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 _0xdbb8=['emit','removeListener','length','save','remove'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xdbb8,0x85));var _0x8dbb=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xdbb8[_0x2f5a22];return _0x326b70;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x8dbb('0x0'),_0x8dbb('0x1'),'update'];function createListener(_0x53bb54,_0x544df4){return function(_0xc98b1c){_0x544df4[_0x8dbb('0x2')](_0x53bb54,_0xc98b1c);};}function removeListener(_0x38b6e6,_0x48936b){return function(){ChatInternalMessageEvents[_0x8dbb('0x3')](_0x38b6e6,_0x48936b);};}exports['register']=function(_0x2e8de9){for(var _0x1a6684=0x0,_0x7452e6=events[_0x8dbb('0x4')];_0x1a6684<_0x7452e6;_0x1a6684++){var _0x1c23ac=events[_0x1a6684];var _0x2de741=createListener('chatInternalMessage:'+_0x1c23ac,_0x2e8de9);ChatInternalMessageEvents['on'](_0x1c23ac,_0x2de741);}}; \ No newline at end of file +var _0x4f69=['./chatInternalMessage.events','save','remove','update','emit','register','length','chatInternalMessage:'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x4f69,0xe8));var _0x94f6=function(_0x25ffd4,_0x16b31d){_0x25ffd4=_0x25ffd4-0x0;var _0x414452=_0x4f69[_0x25ffd4];return _0x414452;};'use strict';var ChatInternalMessageEvents=require(_0x94f6('0x0'));var events=[_0x94f6('0x1'),_0x94f6('0x2'),_0x94f6('0x3')];function createListener(_0x3ea963,_0x3937fe){return function(_0x340de3){_0x3937fe[_0x94f6('0x4')](_0x3ea963,_0x340de3);};}function removeListener(_0x30743b,_0x5e1088){return function(){ChatInternalMessageEvents['removeListener'](_0x30743b,_0x5e1088);};}exports[_0x94f6('0x5')]=function(_0x34b222){for(var _0x3d3a2=0x0,_0x103f08=events[_0x94f6('0x6')];_0x3d3a2<_0x103f08;_0x3d3a2++){var _0x419f2f=events[_0x3d3a2];var _0x2483ad=createListener(_0x94f6('0x7')+_0x419f2f,_0x34b222);ChatInternalMessageEvents['on'](_0x419f2f,_0x2483ad);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index dc697a1..08e870f 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 _0xc24d=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','create','update','delete','destroy'];(function(_0x203f1f,_0x57cac4){var _0x557924=function(_0x5ceff6){while(--_0x5ceff6){_0x203f1f['push'](_0x203f1f['shift']());}};_0x557924(++_0x57cac4);}(_0xc24d,0x1ed));var _0xdc24=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0xc24d[_0xb6e2ea];return _0x2a57bb;};'use strict';var multer=require('multer');var util=require(_0xdc24('0x0'));var path=require('path');var timeout=require(_0xdc24('0x1'));var express=require('express');var router=express[_0xdc24('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdc24('0x3'));var interaction=require(_0xdc24('0x4'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xdc24('0x5')]('/',auth[_0xdc24('0x6')](),controller[_0xdc24('0x7')]);router[_0xdc24('0x5')](_0xdc24('0x8'),auth[_0xdc24('0x6')](),controller[_0xdc24('0x9')]);router[_0xdc24('0x5')](_0xdc24('0xa'),auth[_0xdc24('0x6')](),controller[_0xdc24('0xb')]);router[_0xdc24('0x5')](_0xdc24('0xc'),auth[_0xdc24('0x6')](),controller['show']);router['post']('/',auth[_0xdc24('0x6')](),controller[_0xdc24('0xd')]);router['put'](_0xdc24('0xc'),controller[_0xdc24('0xe')]);router[_0xdc24('0xf')](_0xdc24('0xc'),auth[_0xdc24('0x6')](),controller[_0xdc24('0x10')]);module['exports']=router; \ No newline at end of file +var _0xdcc2=['create','destroy','exports','multer','path','connect-timeout','express','Router','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post'];(function(_0x17bfa4,_0x3eb5f7){var _0x3d9ca8=function(_0x235cd4){while(--_0x235cd4){_0x17bfa4['push'](_0x17bfa4['shift']());}};_0x3d9ca8(++_0x3eb5f7);}(_0xdcc2,0x16b));var _0x2dcc=function(_0x42a0c8,_0xd484a5){_0x42a0c8=_0x42a0c8-0x0;var _0x1b554b=_0xdcc2[_0x42a0c8];return _0x1b554b;};'use strict';var multer=require(_0x2dcc('0x0'));var util=require('util');var path=require(_0x2dcc('0x1'));var timeout=require(_0x2dcc('0x2'));var express=require(_0x2dcc('0x3'));var router=express[_0x2dcc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2dcc('0x5'));router[_0x2dcc('0x6')]('/',auth[_0x2dcc('0x7')](),controller[_0x2dcc('0x8')]);router[_0x2dcc('0x6')]('/describe',auth[_0x2dcc('0x7')](),controller[_0x2dcc('0x9')]);router[_0x2dcc('0x6')](_0x2dcc('0xa'),auth[_0x2dcc('0x7')](),controller[_0x2dcc('0xb')]);router[_0x2dcc('0x6')](_0x2dcc('0xc'),auth[_0x2dcc('0x7')](),controller[_0x2dcc('0xd')]);router[_0x2dcc('0xe')]('/',auth[_0x2dcc('0x7')](),controller[_0x2dcc('0xf')]);router['put']('/:id',controller['update']);router['delete'](_0x2dcc('0xc'),auth[_0x2dcc('0x7')](),controller[_0x2dcc('0x10')]);module[_0x2dcc('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index ad0e06d..8b2073c 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 _0x4b0f=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x54d879,_0x35c691){var _0xf1c912=function(_0xde4d86){while(--_0xde4d86){_0x54d879['push'](_0x54d879['shift']());}};_0xf1c912(++_0x35c691);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x9f2af9,_0x55141a){_0x9f2af9=_0x9f2af9-0x0;var _0x24aa62=_0x4b0f[_0x9f2af9];return _0x24aa62;};'use strict';var Sequelize=require('sequelize');module[_0xf4b0('0x0')]={'body':{'type':Sequelize[_0xf4b0('0x1')](_0xf4b0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf4b0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf4b0('0x4')]('in',_0xf4b0('0x5')),'defaultValue':_0xf4b0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf4b0('0x6')]},'providerName':{'type':Sequelize[_0xf4b0('0x7')]},'providerResponse':{'type':Sequelize[_0xf4b0('0x1')]}}; \ No newline at end of file +var _0x531a=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x28d088,_0x98677d){var _0x4dba47=function(_0x30ab0d){while(--_0x30ab0d){_0x28d088['push'](_0x28d088['shift']());}};_0x4dba47(++_0x98677d);}(_0x531a,0x100));var _0xa531=function(_0x580795,_0x90f61){_0x580795=_0x580795-0x0;var _0x20eea5=_0x531a[_0x580795];return _0x20eea5;};'use strict';var Sequelize=require(_0xa531('0x0'));module[_0xa531('0x1')]={'body':{'type':Sequelize[_0xa531('0x2')](_0xa531('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa531('0x5')]('in',_0xa531('0x6')),'defaultValue':_0xa531('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa531('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa531('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 414aeb7..6d79c17 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 _0x8eb6=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','map','ChatMessage','type','key','model','query','keys','filters','intersection','fields','attributes','length','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','isNil','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','role','SELECT','User','fullname','format','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3515d5,_0x29688c){var _0x1c265f=function(_0x463a87){while(--_0x463a87){_0x3515d5['push'](_0x3515d5['shift']());}};_0x1c265f(++_0x29688c);}(_0x8eb6,0x17e));var _0x68eb=function(_0x154bf5,_0x543667){_0x154bf5=_0x154bf5-0x0;var _0x3cb4bc=_0x8eb6[_0x154bf5];return _0x3cb4bc;};'use strict';var emlformat=require(_0x68eb('0x0'));var rimraf=require(_0x68eb('0x1'));var zipdir=require(_0x68eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x68eb('0x3'));var BPromise=require(_0x68eb('0x4'));var Mustache=require(_0x68eb('0x5'));var util=require(_0x68eb('0x6'));var path=require(_0x68eb('0x7'));var sox=require(_0x68eb('0x8'));var csv=require(_0x68eb('0x9'));var ejs=require(_0x68eb('0xa'));var fs=require('fs');var fs_extra=require(_0x68eb('0xb'));var _=require(_0x68eb('0xc'));var squel=require(_0x68eb('0xd'));var crypto=require(_0x68eb('0xe'));var jsforce=require(_0x68eb('0xf'));var deskjs=require(_0x68eb('0x10'));var toCsv=require(_0x68eb('0x9'));var querystring=require(_0x68eb('0x11'));var Papa=require(_0x68eb('0x12'));var Redis=require(_0x68eb('0x13'));var authService=require(_0x68eb('0x14'));var qs=require(_0x68eb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68eb('0x16'));var logger=require('../../config/logger')(_0x68eb('0x17'));var utils=require(_0x68eb('0x18'));var config=require(_0x68eb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x68eb('0x1a'))['db'];config[_0x68eb('0x1b')]=_[_0x68eb('0x1c')](config[_0x68eb('0x1b')],{'host':_0x68eb('0x1d'),'port':0x18eb});var socket=require(_0x68eb('0x1e'))(new Redis(config[_0x68eb('0x1b')]));require(_0x68eb('0x1f'))[_0x68eb('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x68eb('0x21')][_0x68eb('0x22')]({'port':0x232c});var client9002=jayson[_0x68eb('0x21')][_0x68eb('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2db6ca,_0xb8ce3f,_0x3d0faa,_0x51b331){return new BPromise(function(_0xb4279a,_0x50a1c3){var _0x228859=_0x51b331||client;return _0x228859[_0x68eb('0x23')](_0x2db6ca,_0x3d0faa)['then'](function(_0x1fda0b){logger['info'](_0x68eb('0x24'),_0xb8ce3f,_0x68eb('0x25'));logger[_0x68eb('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xb8ce3f,_0x68eb('0x25'),JSON[_0x68eb('0x27')](_0x1fda0b));if(_0x1fda0b[_0x68eb('0x28')]){if(_0x1fda0b[_0x68eb('0x28')][_0x68eb('0x29')]===0x1f4){logger[_0x68eb('0x28')]('ChatMessage,\x20%s,\x20%s',_0xb8ce3f,_0x1fda0b['error'][_0x68eb('0x2a')]);return _0x50a1c3(_0x1fda0b[_0x68eb('0x28')][_0x68eb('0x2a')]);}logger[_0x68eb('0x28')](_0x68eb('0x24'),_0xb8ce3f,_0x1fda0b[_0x68eb('0x28')][_0x68eb('0x2a')]);return _0xb4279a(_0x1fda0b['error']['message']);}else{logger['info'](_0x68eb('0x24'),_0xb8ce3f,'request\x20sent');_0xb4279a(_0x1fda0b[_0x68eb('0x2b')]['message']);}})[_0x68eb('0x2c')](function(_0x3ed5de){logger['error'](_0x68eb('0x24'),_0xb8ce3f,_0x3ed5de);_0x50a1c3(_0x3ed5de);});});}function respondWithStatusCode(_0x4acb82,_0x27227f){_0x27227f=_0x27227f||0xcc;return function(_0x5aec29){if(_0x5aec29){return _0x4acb82['sendStatus'](_0x27227f);}return _0x4acb82[_0x68eb('0x2d')](_0x27227f)[_0x68eb('0x2e')]();};}function respondWithResult(_0xd80a94,_0x46fcdc){_0x46fcdc=_0x46fcdc||0xc8;return function(_0x4c9439){if(_0x4c9439){return _0xd80a94[_0x68eb('0x2d')](_0x46fcdc)['json'](_0x4c9439);}};}function respondWithFilteredResult(_0x667b78,_0x30388e){return function(_0x208ea4){if(_0x208ea4){var _0xee0371=typeof _0x30388e[_0x68eb('0x2f')]===_0x68eb('0x30')&&typeof _0x30388e['limit']===_0x68eb('0x30');var _0x4fd161=_0x208ea4[_0x68eb('0x31')];var _0x49c685=_0xee0371?0x0:_0x30388e[_0x68eb('0x2f')];var _0x344cf2=_0xee0371?_0x208ea4[_0x68eb('0x31')]:_0x30388e['offset']+_0x30388e['limit'];var _0x2e2ec7;if(_0x344cf2>=_0x4fd161){_0x344cf2=_0x4fd161;_0x2e2ec7=0xc8;}else{_0x2e2ec7=0xce;}_0x667b78[_0x68eb('0x2d')](_0x2e2ec7);return _0x667b78['set'](_0x68eb('0x32'),_0x49c685+'-'+_0x344cf2+'/'+_0x4fd161)[_0x68eb('0x33')](_0x208ea4);}return null;};}function patchUpdates(_0x10f344){return function(_0x47434c){try{jsonpatch[_0x68eb('0x34')](_0x47434c,_0x10f344,!![]);}catch(_0x5b60fc){return BPromise[_0x68eb('0x35')](_0x5b60fc);}return _0x47434c[_0x68eb('0x36')]();};}function saveUpdates(_0x59451b,_0x561a03){return function(_0x1d7822){if(_0x1d7822){return _0x1d7822[_0x68eb('0x37')](_0x59451b)[_0x68eb('0x38')](function(_0x58fbd2){return _0x58fbd2;});}return null;};}function removeEntity(_0x41d072,_0x5ab384){return function(_0x56a7da){if(_0x56a7da){return _0x56a7da[_0x68eb('0x39')]()['then'](function(){_0x41d072['status'](0xcc)[_0x68eb('0x2e')]();});}};}function handleEntityNotFound(_0x4479cd,_0x43d44b){return function(_0x3c8019){if(!_0x3c8019){_0x4479cd[_0x68eb('0x3a')](0x194);}return _0x3c8019;};}function handleError(_0x28d0b5,_0x24d500){_0x24d500=_0x24d500||0x1f4;return function(_0x25f595){logger[_0x68eb('0x28')](_0x25f595['stack']);if(_0x25f595[_0x68eb('0x3b')]){delete _0x25f595[_0x68eb('0x3b')];}_0x28d0b5[_0x68eb('0x2d')](_0x24d500)[_0x68eb('0x3c')](_0x25f595);};}exports['index']=function(_0x3a32b6,_0x2f2676){var _0x33b7da={},_0x23a770={},_0xcb26d4={'count':0x0,'rows':[]};var _0x12099a=_[_0x68eb('0x3d')](db[_0x68eb('0x3e')]['rawAttributes'],function(_0x403ee2){return{'name':_0x403ee2['fieldName'],'type':_0x403ee2[_0x68eb('0x3f')][_0x68eb('0x40')]};});_0x23a770[_0x68eb('0x41')]=_[_0x68eb('0x3d')](_0x12099a,_0x68eb('0x3b'));_0x23a770[_0x68eb('0x42')]=_[_0x68eb('0x43')](_0x3a32b6['query']);_0x23a770[_0x68eb('0x44')]=_['intersection'](_0x23a770[_0x68eb('0x41')],_0x23a770['query']);_0x33b7da['attributes']=_[_0x68eb('0x45')](_0x23a770[_0x68eb('0x41')],qs[_0x68eb('0x46')](_0x3a32b6['query']['fields']));_0x33b7da[_0x68eb('0x47')]=_0x33b7da[_0x68eb('0x47')][_0x68eb('0x48')]?_0x33b7da[_0x68eb('0x47')]:_0x23a770[_0x68eb('0x41')];if(!_0x3a32b6['query']['hasOwnProperty']('nolimit')){_0x33b7da[_0x68eb('0x49')]=qs['limit'](_0x3a32b6['query'][_0x68eb('0x49')]);_0x33b7da[_0x68eb('0x2f')]=qs[_0x68eb('0x2f')](_0x3a32b6['query']['offset']);}_0x33b7da['order']=qs[_0x68eb('0x4a')](_0x3a32b6[_0x68eb('0x42')]['sort']);_0x33b7da[_0x68eb('0x4b')]=qs[_0x68eb('0x44')](_[_0x68eb('0x4c')](_0x3a32b6[_0x68eb('0x42')],_0x23a770['filters']),_0x12099a);if(_0x3a32b6['query']['filter']){_0x33b7da['where']=_[_0x68eb('0x4d')](_0x33b7da[_0x68eb('0x4b')],{'$or':_[_0x68eb('0x3d')](_0x12099a,function(_0x423bfb){if(_0x423bfb[_0x68eb('0x3f')]!==_0x68eb('0x4e')){var _0x5ed5ef={};_0x5ed5ef[_0x423bfb[_0x68eb('0x3b')]]={'$like':'%'+_0x3a32b6[_0x68eb('0x42')][_0x68eb('0x4f')]+'%'};return _0x5ed5ef;}})});}_0x33b7da=_[_0x68eb('0x4d')]({},_0x33b7da,_0x3a32b6[_0x68eb('0x50')]);var _0x263285={'where':_0x33b7da[_0x68eb('0x4b')]};return db[_0x68eb('0x3e')][_0x68eb('0x31')](_0x263285)[_0x68eb('0x38')](function(_0x5b1d5d){_0xcb26d4[_0x68eb('0x31')]=_0x5b1d5d;if(_0x3a32b6[_0x68eb('0x42')][_0x68eb('0x51')]){_0x33b7da[_0x68eb('0x52')]=[{'all':!![]}];}return db['ChatMessage'][_0x68eb('0x53')](_0x33b7da);})['then'](function(_0x17f449){_0xcb26d4[_0x68eb('0x54')]=_0x17f449;return _0xcb26d4;})[_0x68eb('0x38')](respondWithFilteredResult(_0x2f2676,_0x33b7da))[_0x68eb('0x2c')](handleError(_0x2f2676,null));};exports[_0x68eb('0x55')]=function(_0x533952,_0x5cfb41){var _0x5b5a97={'raw':!![],'where':{'id':_0x533952[_0x68eb('0x56')]['id']}},_0x375c00={};_0x375c00[_0x68eb('0x41')]=_[_0x68eb('0x43')](db[_0x68eb('0x3e')][_0x68eb('0x57')]);_0x375c00['query']=_[_0x68eb('0x43')](_0x533952[_0x68eb('0x42')]);_0x375c00[_0x68eb('0x44')]=_[_0x68eb('0x45')](_0x375c00[_0x68eb('0x41')],_0x375c00[_0x68eb('0x42')]);_0x5b5a97[_0x68eb('0x47')]=_['intersection'](_0x375c00[_0x68eb('0x41')],qs[_0x68eb('0x46')](_0x533952[_0x68eb('0x42')][_0x68eb('0x46')]));_0x5b5a97[_0x68eb('0x47')]=_0x5b5a97['attributes'][_0x68eb('0x48')]?_0x5b5a97[_0x68eb('0x47')]:_0x375c00[_0x68eb('0x41')];if(_0x533952[_0x68eb('0x42')][_0x68eb('0x51')]){_0x5b5a97['include']=[{'all':!![]}];}_0x5b5a97=_[_0x68eb('0x4d')]({},_0x5b5a97,_0x533952[_0x68eb('0x50')]);return db[_0x68eb('0x3e')]['find'](_0x5b5a97)[_0x68eb('0x38')](handleEntityNotFound(_0x5cfb41,null))[_0x68eb('0x38')](respondWithResult(_0x5cfb41,null))['catch'](handleError(_0x5cfb41,null));};exports[_0x68eb('0x58')]=function(_0x43b559,_0x442dea){return db['ChatMessage'][_0x68eb('0x58')](_0x43b559[_0x68eb('0x59')],{})[_0x68eb('0x38')](respondWithResult(_0x442dea,0xc9))[_0x68eb('0x2c')](handleError(_0x442dea,null));};exports[_0x68eb('0x37')]=function(_0x3ce47b,_0x2b455a){if(_0x3ce47b[_0x68eb('0x59')]['id']){delete _0x3ce47b[_0x68eb('0x59')]['id'];}return db[_0x68eb('0x3e')][_0x68eb('0x5a')]({'where':{'id':_0x3ce47b['params']['id']}})['then'](handleEntityNotFound(_0x2b455a,null))[_0x68eb('0x38')](saveUpdates(_0x3ce47b[_0x68eb('0x59')],null))[_0x68eb('0x38')](respondWithResult(_0x2b455a,null))[_0x68eb('0x2c')](handleError(_0x2b455a,null));};exports[_0x68eb('0x39')]=function(_0x23ccc2,_0x5b3388){return db[_0x68eb('0x3e')][_0x68eb('0x5a')]({'where':{'id':_0x23ccc2[_0x68eb('0x56')]['id']}})[_0x68eb('0x38')](handleEntityNotFound(_0x5b3388,null))[_0x68eb('0x38')](removeEntity(_0x5b3388,null))[_0x68eb('0x2c')](handleError(_0x5b3388,null));};exports[_0x68eb('0x5b')]=function(_0x3abb85,_0x409797){return db['ChatMessage']['describe']()[_0x68eb('0x38')](respondWithResult(_0x409797,null))[_0x68eb('0x2c')](handleError(_0x409797,null));};var interaction_log=require(_0x68eb('0x5c'))(_0x68eb('0x5d'));exports[_0x68eb('0x5e')]=function(_0x3d9539,_0x29f6b7,_0x23b759){var _0x4cad5f={'agent':{},'channel':_0x68eb('0x5f')};if(_0x3d9539['body']['id']){delete _0x3d9539[_0x68eb('0x59')]['id'];}_0x3d9539[_0x68eb('0x59')][_0x68eb('0x60')]=!![];_0x3d9539[_0x68eb('0x59')][_0x68eb('0x61')]=moment()['format'](_0x68eb('0x62'));_0x3d9539[_0x68eb('0x59')][_0x68eb('0x63')]=_0x3d9539[_0x68eb('0x59')][_0x68eb('0x63')]||_0x3d9539['user']['id'];_0x4cad5f[_0x68eb('0x64')]['id']=_0x3d9539[_0x68eb('0x59')][_0x68eb('0x63')];return db[_0x68eb('0x3e')][_0x68eb('0x5a')]({'where':{'id':_0x3d9539['params']['id'],'UserId':null}})[_0x68eb('0x38')](handleEntityNotFound(_0x29f6b7,null))[_0x68eb('0x38')](saveUpdates(_0x3d9539[_0x68eb('0x59')],null))[_0x68eb('0x38')](function(_0x349b2b){if(_0x349b2b){_0x4cad5f['message']=_0x349b2b[_0x68eb('0x65')]({'plain':!![]});return db[_0x68eb('0x66')][_0x68eb('0x5a')]({'where':{'id':_0x349b2b['ChatInteractionId']}});}return null;})[_0x68eb('0x38')](handleEntityNotFound(_0x29f6b7,null))[_0x68eb('0x38')](function(_0x584a3a){if(_0x584a3a){return _0x584a3a[_0x68eb('0x37')]({'UserId':_0x3d9539[_0x68eb('0x59')][_0x68eb('0x63')],'read1stAt':_[_0x68eb('0x67')](_0x584a3a['read1stAt'])?moment()['format'](_0x68eb('0x62')):undefined});}return null;})[_0x68eb('0x38')](function(_0x57c9f6){if(_0x57c9f6){_0x4cad5f[_0x68eb('0x68')]=_0x57c9f6[_0x68eb('0x65')]({'plain':!![]});interaction_log[_0x68eb('0x69')](_0x68eb('0x6a'),_0x3d9539[_0x68eb('0x6b')]['id'],_0x3d9539['user'][_0x68eb('0x3b')],_0x3d9539[_0x68eb('0x6b')]['role'],_0x4cad5f[_0x68eb('0x68')]['id'],_0x3d9539[_0x68eb('0x59')]?JSON[_0x68eb('0x27')](_0x3d9539[_0x68eb('0x59')]):_0x68eb('0x6c'));return respondWithRpcPromise(_0x68eb('0x6d'),'acceptMessage',_0x4cad5f);}return null;})[_0x68eb('0x38')](function(_0x5b4412){var _0x300342=_0x68eb('0x6e')+_0x5b4412['message'][_0x68eb('0x6f')];return db[_0x68eb('0x70')][_0x68eb('0x42')](_0x300342,{'type':db[_0x68eb('0x71')][_0x68eb('0x72')]['SELECT'],'raw':!![]})[_0x68eb('0x38')](function(_0x3ca9f4){return _0x3ca9f4;});})[_0x68eb('0x38')](function(_0xb205fd){if(_0xb205fd){_0x4cad5f['message'][_0x68eb('0x73')]=_0xb205fd[0x0];if(!_0x3d9539[_0x68eb('0x59')][_0x68eb('0x63')])return;return db['User'][_0x68eb('0x5a')]({'where':{'id':_0x3d9539[_0x68eb('0x59')]['UserId'],'role':_0x68eb('0x64')},'attributes':['id',_0x68eb('0x3b'),'fullname',_0x68eb('0x74'),_0x68eb('0x75')],'raw':!![]});}return null;})['then'](function(_0x46280f){if(!_0x46280f)return null;_0x4cad5f[_0x68eb('0x2a')][_0x68eb('0x64')]=_0x46280f;return _0x4cad5f;})[_0x68eb('0x38')](function(_0x5b317e){if(_0x5b317e){if(_0x3d9539[_0x68eb('0x59')][_0x68eb('0x76')]){_0x4cad5f[_0x68eb('0x2a')][_0x68eb('0x77')]=util['format'](_0x68eb('0x78'),_0x3d9539[_0x68eb('0x6b')][_0x68eb('0x3b')]);_0x4cad5f['message'][_0x68eb('0x79')]=_0x4cad5f[_0x68eb('0x79')];_0x4cad5f[_0x68eb('0x2a')][_0x68eb('0x7a')]=_0x4cad5f[_0x68eb('0x79')];_0x4cad5f[_0x68eb('0x2a')][_0x68eb('0x7b')]=_0x68eb('0x5e');return respondWithRpcPromise('EventManager',_0x68eb('0x7c'),{'event':_0x68eb('0x7d'),'message':_[_0x68eb('0x4d')](_0x4cad5f[_0x68eb('0x2a')],JSON[_0x68eb('0x7e')](_0x4cad5f[_0x68eb('0x68')][_0x68eb('0x7f')]))},client9002)[_0x68eb('0x38')](function(){return _0x4cad5f;});}return _0x4cad5f;}return null;})[_0x68eb('0x38')](respondWithResult(_0x29f6b7,null))[_0x68eb('0x2c')](handleError(_0x29f6b7,null));};var interaction_log=require(_0x68eb('0x5c'))('chat-interactions');exports[_0x68eb('0x35')]=function(_0x54e3cb,_0x53b51f,_0x3c090c){var _0x2cd621={'agent':{},'channel':_0x68eb('0x5f')};if(_0x54e3cb[_0x68eb('0x59')]['id']){delete _0x54e3cb[_0x68eb('0x59')]['id'];}_0x54e3cb[_0x68eb('0x59')][_0x68eb('0x63')]=_0x54e3cb['body'][_0x68eb('0x63')]||_0x54e3cb[_0x68eb('0x6b')]['id'];_0x2cd621['agent']['id']=_0x54e3cb[_0x68eb('0x59')][_0x68eb('0x63')];return db[_0x68eb('0x3e')][_0x68eb('0x5a')]({'where':{'id':_0x54e3cb['params']['id'],'UserId':null}})[_0x68eb('0x38')](handleEntityNotFound(_0x53b51f,null))[_0x68eb('0x38')](function(_0x1c92ff){if(_0x1c92ff){_0x2cd621[_0x68eb('0x2a')]=_0x1c92ff[_0x68eb('0x65')]({'plain':!![]});return db[_0x68eb('0x66')][_0x68eb('0x5a')]({'where':{'id':_0x1c92ff[_0x68eb('0x80')]}});}return null;})[_0x68eb('0x38')](handleEntityNotFound(_0x53b51f,null))[_0x68eb('0x38')](function(_0x23cbf2){if(_0x23cbf2){_0x2cd621['interaction']=_0x23cbf2['get']({'plain':!![]});interaction_log[_0x68eb('0x69')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x54e3cb['user']['id'],_0x54e3cb[_0x68eb('0x6b')][_0x68eb('0x3b')],_0x54e3cb[_0x68eb('0x6b')][_0x68eb('0x81')],_0x2cd621[_0x68eb('0x68')]['id'],_0x54e3cb['body']?JSON['stringify'](_0x54e3cb[_0x68eb('0x59')]):_0x68eb('0x6c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x2cd621);}return null;})[_0x68eb('0x38')](function(_0x4accb0){var _0x3489c5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4accb0[_0x68eb('0x2a')][_0x68eb('0x6f')];return db['sequelize'][_0x68eb('0x42')](_0x3489c5,{'type':db[_0x68eb('0x71')]['QueryTypes'][_0x68eb('0x82')],'raw':!![]})[_0x68eb('0x38')](function(_0x2736c8){return _0x2736c8;});})[_0x68eb('0x38')](function(_0xe8df03){if(_0xe8df03){_0x2cd621[_0x68eb('0x2a')][_0x68eb('0x73')]=_0xe8df03[0x0];if(!_0x54e3cb['body'][_0x68eb('0x63')])return;return db[_0x68eb('0x83')]['find']({'where':{'id':_0x54e3cb['body']['UserId'],'role':_0x68eb('0x64')},'attributes':['id',_0x68eb('0x3b'),_0x68eb('0x84'),_0x68eb('0x74'),_0x68eb('0x75')],'raw':!![]});}return null;})[_0x68eb('0x38')](function(_0x3cfd91){if(!_0x3cfd91)return null;_0x2cd621[_0x68eb('0x2a')]['agent']=_0x3cfd91;return _0x2cd621;})['then'](function(_0x537c4a){if(_0x537c4a){_0x537c4a['message'][_0x68eb('0x77')]=util[_0x68eb('0x85')](_0x68eb('0x78'),_0x54e3cb[_0x68eb('0x6b')][_0x68eb('0x3b')]);_0x537c4a[_0x68eb('0x2a')][_0x68eb('0x79')]=_0x2cd621[_0x68eb('0x79')];_0x537c4a[_0x68eb('0x2a')][_0x68eb('0x7a')]=_0x2cd621[_0x68eb('0x79')];_0x537c4a[_0x68eb('0x2a')][_0x68eb('0x7b')]=_0x68eb('0x35');respondWithRpcPromise(_0x68eb('0x7c'),_0x68eb('0x7c'),{'event':'rejectmessage','message':_[_0x68eb('0x4d')](_0x2cd621[_0x68eb('0x2a')],JSON[_0x68eb('0x7e')](_0x2cd621['interaction'][_0x68eb('0x7f')]))},client9002);return _0x2cd621;}return null;})[_0x68eb('0x38')](respondWithResult(_0x53b51f,null))[_0x68eb('0x2c')](handleError(_0x53b51f,null));}; \ No newline at end of file +var _0x3042=['localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatMessage','includeAll','include','findAll','rows','params','find','create','body','describe','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','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','../../mysqldb','redis','defaults'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3042,0x184));var _0x2304=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x3042[_0x1488cd];return _0x63fa13;};'use strict';var emlformat=require(_0x2304('0x0'));var rimraf=require(_0x2304('0x1'));var zipdir=require(_0x2304('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2304('0x3'));var BPromise=require(_0x2304('0x4'));var Mustache=require(_0x2304('0x5'));var util=require('util');var path=require(_0x2304('0x6'));var sox=require(_0x2304('0x7'));var csv=require(_0x2304('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2304('0x9'));var _=require('lodash');var squel=require(_0x2304('0xa'));var crypto=require('crypto');var jsforce=require(_0x2304('0xb'));var deskjs=require(_0x2304('0xc'));var toCsv=require(_0x2304('0x8'));var querystring=require('querystring');var Papa=require(_0x2304('0xd'));var Redis=require(_0x2304('0xe'));var authService=require(_0x2304('0xf'));var qs=require(_0x2304('0x10'));var as=require(_0x2304('0x11'));var hardwareService=require(_0x2304('0x12'));var logger=require(_0x2304('0x13'))(_0x2304('0x14'));var utils=require(_0x2304('0x15'));var config=require(_0x2304('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2304('0x17'))['db'];config[_0x2304('0x18')]=_[_0x2304('0x19')](config[_0x2304('0x18')],{'host':_0x2304('0x1a'),'port':0x18eb});var socket=require(_0x2304('0x1b'))(new Redis(config['redis']));require(_0x2304('0x1c'))[_0x2304('0x1d')](socket);var jayson=require(_0x2304('0x1e'));var client=jayson[_0x2304('0x1f')][_0x2304('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x2304('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x645dfb,_0x5de92d,_0x26fa3e,_0x417c4b){return new BPromise(function(_0x337f36,_0x48ccd6){var _0x1c6d7b=_0x417c4b||client;return _0x1c6d7b[_0x2304('0x21')](_0x645dfb,_0x26fa3e)[_0x2304('0x22')](function(_0x590e78){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5de92d,_0x2304('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5de92d,_0x2304('0x23'),JSON[_0x2304('0x24')](_0x590e78));if(_0x590e78[_0x2304('0x25')]){if(_0x590e78[_0x2304('0x25')][_0x2304('0x26')]===0x1f4){logger[_0x2304('0x25')](_0x2304('0x27'),_0x5de92d,_0x590e78[_0x2304('0x25')][_0x2304('0x28')]);return _0x48ccd6(_0x590e78[_0x2304('0x25')][_0x2304('0x28')]);}logger['error'](_0x2304('0x27'),_0x5de92d,_0x590e78[_0x2304('0x25')][_0x2304('0x28')]);return _0x337f36(_0x590e78[_0x2304('0x25')]['message']);}else{logger[_0x2304('0x29')](_0x2304('0x27'),_0x5de92d,'request\x20sent');_0x337f36(_0x590e78[_0x2304('0x2a')][_0x2304('0x28')]);}})[_0x2304('0x2b')](function(_0x9dc59a){logger[_0x2304('0x25')]('ChatMessage,\x20%s,\x20%s',_0x5de92d,_0x9dc59a);_0x48ccd6(_0x9dc59a);});});}function respondWithStatusCode(_0x132957,_0x58ee4e){_0x58ee4e=_0x58ee4e||0xcc;return function(_0x38048a){if(_0x38048a){return _0x132957[_0x2304('0x2c')](_0x58ee4e);}return _0x132957[_0x2304('0x2d')](_0x58ee4e)['end']();};}function respondWithResult(_0x5ea947,_0x4f0151){_0x4f0151=_0x4f0151||0xc8;return function(_0x31de49){if(_0x31de49){return _0x5ea947['status'](_0x4f0151)[_0x2304('0x2e')](_0x31de49);}};}function respondWithFilteredResult(_0x197f69,_0x5d3475){return function(_0x36d4c7){if(_0x36d4c7){var _0x1f7e87=typeof _0x5d3475[_0x2304('0x2f')]===_0x2304('0x30')&&typeof _0x5d3475[_0x2304('0x31')]===_0x2304('0x30');var _0x258151=_0x36d4c7[_0x2304('0x32')];var _0x429d16=_0x1f7e87?0x0:_0x5d3475[_0x2304('0x2f')];var _0x1380d4=_0x1f7e87?_0x36d4c7['count']:_0x5d3475[_0x2304('0x2f')]+_0x5d3475[_0x2304('0x31')];var _0xa63edb;if(_0x1380d4>=_0x258151){_0x1380d4=_0x258151;_0xa63edb=0xc8;}else{_0xa63edb=0xce;}_0x197f69[_0x2304('0x2d')](_0xa63edb);return _0x197f69[_0x2304('0x33')](_0x2304('0x34'),_0x429d16+'-'+_0x1380d4+'/'+_0x258151)[_0x2304('0x2e')](_0x36d4c7);}return null;};}function patchUpdates(_0x3a00aa){return function(_0x851376){try{jsonpatch[_0x2304('0x35')](_0x851376,_0x3a00aa,!![]);}catch(_0x2599e5){return BPromise[_0x2304('0x36')](_0x2599e5);}return _0x851376['save']();};}function saveUpdates(_0x5a6ebc,_0x3f42c8){return function(_0x389f00){if(_0x389f00){return _0x389f00[_0x2304('0x37')](_0x5a6ebc)[_0x2304('0x22')](function(_0x2b2775){return _0x2b2775;});}return null;};}function removeEntity(_0xa4d68f,_0x463e23){return function(_0x2cdc43){if(_0x2cdc43){return _0x2cdc43[_0x2304('0x38')]()['then'](function(){_0xa4d68f['status'](0xcc)[_0x2304('0x39')]();});}};}function handleEntityNotFound(_0x4958b6,_0x2aade5){return function(_0x39458f){if(!_0x39458f){_0x4958b6[_0x2304('0x2c')](0x194);}return _0x39458f;};}function handleError(_0x5d4d64,_0x2dccec){_0x2dccec=_0x2dccec||0x1f4;return function(_0x3c2dde){logger[_0x2304('0x25')](_0x3c2dde[_0x2304('0x3a')]);if(_0x3c2dde[_0x2304('0x3b')]){delete _0x3c2dde[_0x2304('0x3b')];}_0x5d4d64[_0x2304('0x2d')](_0x2dccec)[_0x2304('0x3c')](_0x3c2dde);};}exports[_0x2304('0x3d')]=function(_0x413c02,_0x2fb0c1){var _0x2e4033={},_0x20cbc8={},_0x1d2dcb={'count':0x0,'rows':[]};var _0x44f4b7=_[_0x2304('0x3e')](db['ChatMessage'][_0x2304('0x3f')],function(_0x2c8b55){return{'name':_0x2c8b55[_0x2304('0x40')],'type':_0x2c8b55['type'][_0x2304('0x41')]};});_0x20cbc8[_0x2304('0x42')]=_['map'](_0x44f4b7,_0x2304('0x3b'));_0x20cbc8[_0x2304('0x43')]=_[_0x2304('0x44')](_0x413c02[_0x2304('0x43')]);_0x20cbc8[_0x2304('0x45')]=_['intersection'](_0x20cbc8['model'],_0x20cbc8[_0x2304('0x43')]);_0x2e4033[_0x2304('0x46')]=_[_0x2304('0x47')](_0x20cbc8[_0x2304('0x42')],qs[_0x2304('0x48')](_0x413c02[_0x2304('0x43')][_0x2304('0x48')]));_0x2e4033[_0x2304('0x46')]=_0x2e4033[_0x2304('0x46')][_0x2304('0x49')]?_0x2e4033[_0x2304('0x46')]:_0x20cbc8[_0x2304('0x42')];if(!_0x413c02[_0x2304('0x43')][_0x2304('0x4a')](_0x2304('0x4b'))){_0x2e4033[_0x2304('0x31')]=qs['limit'](_0x413c02[_0x2304('0x43')][_0x2304('0x31')]);_0x2e4033['offset']=qs[_0x2304('0x2f')](_0x413c02[_0x2304('0x43')][_0x2304('0x2f')]);}_0x2e4033[_0x2304('0x4c')]=qs[_0x2304('0x4d')](_0x413c02[_0x2304('0x43')][_0x2304('0x4d')]);_0x2e4033[_0x2304('0x4e')]=qs[_0x2304('0x45')](_[_0x2304('0x4f')](_0x413c02[_0x2304('0x43')],_0x20cbc8[_0x2304('0x45')]),_0x44f4b7);if(_0x413c02[_0x2304('0x43')]['filter']){_0x2e4033[_0x2304('0x4e')]=_[_0x2304('0x50')](_0x2e4033[_0x2304('0x4e')],{'$or':_[_0x2304('0x3e')](_0x44f4b7,function(_0x4a062b){if(_0x4a062b['type']!==_0x2304('0x51')){var _0x3ec9f3={};_0x3ec9f3[_0x4a062b['name']]={'$like':'%'+_0x413c02[_0x2304('0x43')][_0x2304('0x52')]+'%'};return _0x3ec9f3;}})});}_0x2e4033=_[_0x2304('0x50')]({},_0x2e4033,_0x413c02[_0x2304('0x53')]);var _0x5e5c71={'where':_0x2e4033[_0x2304('0x4e')]};return db[_0x2304('0x54')][_0x2304('0x32')](_0x5e5c71)[_0x2304('0x22')](function(_0x366584){_0x1d2dcb['count']=_0x366584;if(_0x413c02[_0x2304('0x43')][_0x2304('0x55')]){_0x2e4033[_0x2304('0x56')]=[{'all':!![]}];}return db[_0x2304('0x54')][_0x2304('0x57')](_0x2e4033);})[_0x2304('0x22')](function(_0x146dcc){_0x1d2dcb[_0x2304('0x58')]=_0x146dcc;return _0x1d2dcb;})[_0x2304('0x22')](respondWithFilteredResult(_0x2fb0c1,_0x2e4033))[_0x2304('0x2b')](handleError(_0x2fb0c1,null));};exports['show']=function(_0x3eb8e4,_0x31d804){var _0x277f7b={'raw':!![],'where':{'id':_0x3eb8e4[_0x2304('0x59')]['id']}},_0x5aa642={};_0x5aa642[_0x2304('0x42')]=_['keys'](db[_0x2304('0x54')]['rawAttributes']);_0x5aa642[_0x2304('0x43')]=_['keys'](_0x3eb8e4[_0x2304('0x43')]);_0x5aa642[_0x2304('0x45')]=_['intersection'](_0x5aa642[_0x2304('0x42')],_0x5aa642[_0x2304('0x43')]);_0x277f7b[_0x2304('0x46')]=_[_0x2304('0x47')](_0x5aa642[_0x2304('0x42')],qs['fields'](_0x3eb8e4['query'][_0x2304('0x48')]));_0x277f7b[_0x2304('0x46')]=_0x277f7b['attributes'][_0x2304('0x49')]?_0x277f7b[_0x2304('0x46')]:_0x5aa642['model'];if(_0x3eb8e4[_0x2304('0x43')][_0x2304('0x55')]){_0x277f7b['include']=[{'all':!![]}];}_0x277f7b=_['merge']({},_0x277f7b,_0x3eb8e4['options']);return db[_0x2304('0x54')][_0x2304('0x5a')](_0x277f7b)[_0x2304('0x22')](handleEntityNotFound(_0x31d804,null))[_0x2304('0x22')](respondWithResult(_0x31d804,null))[_0x2304('0x2b')](handleError(_0x31d804,null));};exports[_0x2304('0x5b')]=function(_0x52cc91,_0x31f916){return db[_0x2304('0x54')][_0x2304('0x5b')](_0x52cc91['body'],{})[_0x2304('0x22')](respondWithResult(_0x31f916,0xc9))[_0x2304('0x2b')](handleError(_0x31f916,null));};exports[_0x2304('0x37')]=function(_0x2d6af0,_0x3a73dd){if(_0x2d6af0[_0x2304('0x5c')]['id']){delete _0x2d6af0[_0x2304('0x5c')]['id'];}return db[_0x2304('0x54')]['find']({'where':{'id':_0x2d6af0['params']['id']}})['then'](handleEntityNotFound(_0x3a73dd,null))[_0x2304('0x22')](saveUpdates(_0x2d6af0[_0x2304('0x5c')],null))['then'](respondWithResult(_0x3a73dd,null))[_0x2304('0x2b')](handleError(_0x3a73dd,null));};exports[_0x2304('0x38')]=function(_0x335cab,_0x8f7dee){return db['ChatMessage'][_0x2304('0x5a')]({'where':{'id':_0x335cab[_0x2304('0x59')]['id']}})['then'](handleEntityNotFound(_0x8f7dee,null))[_0x2304('0x22')](removeEntity(_0x8f7dee,null))[_0x2304('0x2b')](handleError(_0x8f7dee,null));};exports[_0x2304('0x5d')]=function(_0x1e8d5d,_0x7269b){return db['ChatMessage'][_0x2304('0x5d')]()[_0x2304('0x22')](respondWithResult(_0x7269b,null))[_0x2304('0x2b')](handleError(_0x7269b,null));};var interaction_log=require(_0x2304('0x13'))('chat-interactions');exports[_0x2304('0x5e')]=function(_0x41a674,_0x11fc55,_0x3e36c1){var _0x403764={'agent':{},'channel':_0x2304('0x5f')};if(_0x41a674[_0x2304('0x5c')]['id']){delete _0x41a674[_0x2304('0x5c')]['id'];}_0x41a674[_0x2304('0x5c')]['read']=!![];_0x41a674[_0x2304('0x5c')][_0x2304('0x60')]=moment()['format'](_0x2304('0x61'));_0x41a674[_0x2304('0x5c')][_0x2304('0x62')]=_0x41a674['body'][_0x2304('0x62')]||_0x41a674[_0x2304('0x63')]['id'];_0x403764['agent']['id']=_0x41a674[_0x2304('0x5c')][_0x2304('0x62')];return db[_0x2304('0x54')]['find']({'where':{'id':_0x41a674[_0x2304('0x59')]['id'],'UserId':null}})[_0x2304('0x22')](handleEntityNotFound(_0x11fc55,null))[_0x2304('0x22')](saveUpdates(_0x41a674[_0x2304('0x5c')],null))['then'](function(_0x47bd0e){if(_0x47bd0e){_0x403764[_0x2304('0x28')]=_0x47bd0e[_0x2304('0x64')]({'plain':!![]});return db[_0x2304('0x65')][_0x2304('0x5a')]({'where':{'id':_0x47bd0e[_0x2304('0x66')]}});}return null;})[_0x2304('0x22')](handleEntityNotFound(_0x11fc55,null))['then'](function(_0x4075ea){if(_0x4075ea){return _0x4075ea[_0x2304('0x37')]({'UserId':_0x41a674[_0x2304('0x5c')]['UserId'],'read1stAt':_[_0x2304('0x67')](_0x4075ea[_0x2304('0x68')])?moment()['format'](_0x2304('0x61')):undefined});}return null;})[_0x2304('0x22')](function(_0x35a9ca){if(_0x35a9ca){_0x403764[_0x2304('0x69')]=_0x35a9ca['get']({'plain':!![]});interaction_log[_0x2304('0x29')](_0x2304('0x6a'),_0x41a674[_0x2304('0x63')]['id'],_0x41a674[_0x2304('0x63')][_0x2304('0x3b')],_0x41a674[_0x2304('0x63')][_0x2304('0x6b')],_0x403764[_0x2304('0x69')]['id'],_0x41a674[_0x2304('0x5c')]?JSON[_0x2304('0x24')](_0x41a674[_0x2304('0x5c')]):_0x2304('0x6c'));return respondWithRpcPromise(_0x2304('0x6d'),_0x2304('0x6e'),_0x403764);}return null;})['then'](function(_0x4209c5){var _0x1622b1=_0x2304('0x6f')+_0x4209c5['message'][_0x2304('0x70')];return db[_0x2304('0x71')][_0x2304('0x43')](_0x1622b1,{'type':db[_0x2304('0x72')][_0x2304('0x73')][_0x2304('0x74')],'raw':!![]})[_0x2304('0x22')](function(_0x464404){return _0x464404;});})['then'](function(_0x322631){if(_0x322631){_0x403764[_0x2304('0x28')][_0x2304('0x75')]=_0x322631[0x0];if(!_0x41a674[_0x2304('0x5c')][_0x2304('0x62')])return;return db[_0x2304('0x76')][_0x2304('0x5a')]({'where':{'id':_0x41a674[_0x2304('0x5c')][_0x2304('0x62')],'role':_0x2304('0x77')},'attributes':['id',_0x2304('0x3b'),_0x2304('0x78'),_0x2304('0x79'),_0x2304('0x7a')],'raw':!![]});}return null;})['then'](function(_0x5baf01){if(!_0x5baf01)return null;_0x403764[_0x2304('0x28')][_0x2304('0x77')]=_0x5baf01;return _0x403764;})[_0x2304('0x22')](function(_0x35c902){if(_0x35c902){if(_0x41a674['body'][_0x2304('0x7b')]){_0x403764['message'][_0x2304('0x7c')]=util[_0x2304('0x7d')](_0x2304('0x7e'),_0x41a674[_0x2304('0x63')][_0x2304('0x3b')]);_0x403764['message'][_0x2304('0x7f')]=_0x403764[_0x2304('0x7f')];_0x403764[_0x2304('0x28')][_0x2304('0x80')]=_0x403764[_0x2304('0x7f')];_0x403764[_0x2304('0x28')]['event']='accept';return respondWithRpcPromise(_0x2304('0x81'),'EventManager',{'event':_0x2304('0x82'),'message':_[_0x2304('0x50')](_0x403764[_0x2304('0x28')],JSON[_0x2304('0x83')](_0x403764[_0x2304('0x69')][_0x2304('0x84')]))},client9002)['then'](function(){return _0x403764;});}return _0x403764;}return null;})[_0x2304('0x22')](respondWithResult(_0x11fc55,null))[_0x2304('0x2b')](handleError(_0x11fc55,null));};var interaction_log=require(_0x2304('0x13'))(_0x2304('0x85'));exports[_0x2304('0x36')]=function(_0x34435e,_0x5808cf,_0x4abe09){var _0x5c96f7={'agent':{},'channel':_0x2304('0x5f')};if(_0x34435e[_0x2304('0x5c')]['id']){delete _0x34435e[_0x2304('0x5c')]['id'];}_0x34435e[_0x2304('0x5c')][_0x2304('0x62')]=_0x34435e['body'][_0x2304('0x62')]||_0x34435e[_0x2304('0x63')]['id'];_0x5c96f7[_0x2304('0x77')]['id']=_0x34435e[_0x2304('0x5c')][_0x2304('0x62')];return db[_0x2304('0x54')]['find']({'where':{'id':_0x34435e[_0x2304('0x59')]['id'],'UserId':null}})[_0x2304('0x22')](handleEntityNotFound(_0x5808cf,null))[_0x2304('0x22')](function(_0x3b4121){if(_0x3b4121){_0x5c96f7[_0x2304('0x28')]=_0x3b4121[_0x2304('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x2304('0x5a')]({'where':{'id':_0x3b4121[_0x2304('0x66')]}});}return null;})[_0x2304('0x22')](handleEntityNotFound(_0x5808cf,null))[_0x2304('0x22')](function(_0x1359b1){if(_0x1359b1){_0x5c96f7['interaction']=_0x1359b1['get']({'plain':!![]});interaction_log[_0x2304('0x29')](_0x2304('0x86'),_0x34435e[_0x2304('0x63')]['id'],_0x34435e[_0x2304('0x63')][_0x2304('0x3b')],_0x34435e[_0x2304('0x63')]['role'],_0x5c96f7[_0x2304('0x69')]['id'],_0x34435e[_0x2304('0x5c')]?JSON[_0x2304('0x24')](_0x34435e[_0x2304('0x5c')]):'null');return respondWithRpcPromise(_0x2304('0x87'),_0x2304('0x88'),_0x5c96f7);}return null;})[_0x2304('0x22')](function(_0x5297b3){var _0x1c2e3b=_0x2304('0x6f')+_0x5297b3[_0x2304('0x28')][_0x2304('0x70')];return db[_0x2304('0x71')][_0x2304('0x43')](_0x1c2e3b,{'type':db[_0x2304('0x72')]['QueryTypes'][_0x2304('0x74')],'raw':!![]})[_0x2304('0x22')](function(_0x24c889){return _0x24c889;});})[_0x2304('0x22')](function(_0x606f88){if(_0x606f88){_0x5c96f7[_0x2304('0x28')][_0x2304('0x75')]=_0x606f88[0x0];if(!_0x34435e[_0x2304('0x5c')][_0x2304('0x62')])return;return db[_0x2304('0x76')][_0x2304('0x5a')]({'where':{'id':_0x34435e[_0x2304('0x5c')][_0x2304('0x62')],'role':_0x2304('0x77')},'attributes':['id',_0x2304('0x3b'),'fullname',_0x2304('0x79'),_0x2304('0x7a')],'raw':!![]});}return null;})['then'](function(_0x37c5ac){if(!_0x37c5ac)return null;_0x5c96f7['message'][_0x2304('0x77')]=_0x37c5ac;return _0x5c96f7;})[_0x2304('0x22')](function(_0x27e5db){if(_0x27e5db){_0x27e5db[_0x2304('0x28')][_0x2304('0x7c')]=util[_0x2304('0x7d')](_0x2304('0x7e'),_0x34435e['user'][_0x2304('0x3b')]);_0x27e5db[_0x2304('0x28')][_0x2304('0x7f')]=_0x5c96f7[_0x2304('0x7f')];_0x27e5db[_0x2304('0x28')][_0x2304('0x80')]=_0x5c96f7[_0x2304('0x7f')];_0x27e5db['message'][_0x2304('0x89')]=_0x2304('0x36');respondWithRpcPromise(_0x2304('0x81'),_0x2304('0x81'),{'event':'rejectmessage','message':_[_0x2304('0x50')](_0x5c96f7[_0x2304('0x28')],JSON[_0x2304('0x83')](_0x5c96f7[_0x2304('0x69')][_0x2304('0x84')]))},client9002);return _0x5c96f7;}return null;})[_0x2304('0x22')](respondWithResult(_0x5808cf,null))[_0x2304('0x2b')](handleError(_0x5808cf,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 75b393d..1d1b4e6 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 _0x471b=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x51e75c,_0x4f9ad7){var _0x2b10c7=function(_0x40c332){while(--_0x40c332){_0x51e75c['push'](_0x51e75c['shift']());}};_0x2b10c7(++_0x4f9ad7);}(_0x471b,0x18d));var _0xb471=function(_0x28f5c5,_0x1ca2f2){_0x28f5c5=_0x28f5c5-0x0;var _0x4e6a31=_0x471b[_0x28f5c5];return _0x4e6a31;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb471('0x0'))['db'][_0xb471('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb471('0x2')](0x0);var events={'afterCreate':_0xb471('0x3'),'afterUpdate':_0xb471('0x4'),'afterDestroy':_0xb471('0x5')};function emitEvent(_0x5a28ac){return function(_0x4bd6f4,_0x47bc2c,_0x2f1461){ChatMessageEvents[_0xb471('0x6')](_0x5a28ac+':'+_0x4bd6f4['id'],_0x4bd6f4);ChatMessageEvents['emit'](_0x5a28ac,_0x4bd6f4);_0x2f1461(null);};}for(var e in events){if(events[_0xb471('0x7')](e)){var event=events[e];ChatMessage[_0xb471('0x8')](e,emitEvent(event));}}module[_0xb471('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0xfa6d=['update','emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x5c2a92,_0x2cfc0b){var _0x23ebbf=function(_0x2d47f2){while(--_0x2d47f2){_0x5c2a92['push'](_0x5c2a92['shift']());}};_0x23ebbf(++_0x2cfc0b);}(_0xfa6d,0xf9));var _0xdfa6=function(_0x396e76,_0x1c6cae){_0x396e76=_0x396e76-0x0;var _0x18cf61=_0xfa6d[_0x396e76];return _0x18cf61;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xdfa6('0x0'))['db'][_0xdfa6('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdfa6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdfa6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x307d16){return function(_0x479bbe,_0x4f0294,_0x82ee4f){ChatMessageEvents[_0xdfa6('0x4')](_0x307d16+':'+_0x479bbe['id'],_0x479bbe);ChatMessageEvents[_0xdfa6('0x4')](_0x307d16,_0x479bbe);_0x82ee4f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xdfa6('0x5')](e,emitEvent(event));}}module[_0xdfa6('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index dd4e71a..c1746e7 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 _0x749e=['api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3608e6,_0x8429e8){var _0x3b880f=function(_0x37042d){while(--_0x37042d){_0x3608e6['push'](_0x3608e6['shift']());}};_0x3b880f(++_0x8429e8);}(_0x749e,0x171));var _0xe749=function(_0x3688ea,_0x474e84){_0x3688ea=_0x3688ea-0x0;var _0x44f3a9=_0x749e[_0x3688ea];return _0x44f3a9;};'use strict';var _=require(_0xe749('0x0'));var util=require(_0xe749('0x1'));var logger=require(_0xe749('0x2'))(_0xe749('0x3'));var moment=require(_0xe749('0x4'));var BPromise=require('bluebird');var rp=require(_0xe749('0x5'));var fs=require('fs');var path=require(_0xe749('0x6'));var rimraf=require(_0xe749('0x7'));var config=require(_0xe749('0x8'));var attributes=require(_0xe749('0x9'));module[_0xe749('0xa')]=function(_0x17879f,_0x380a33){return _0x17879f[_0xe749('0xb')](_0xe749('0xc'),attributes,{'tableName':_0xe749('0xd'),'paranoid':![],'indexes':[{'name':_0xe749('0xe'),'fields':['body'],'type':_0xe749('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1801a4,_0x26bb46,_0x1e4f7f){var _0x33bfcb=_0x17879f['models'];var _0xb12710=_0x1801a4[_0xe749('0x10')]({'plain':!![]});if(_0xb12710['direction'][_0xe749('0x11')]()==='in'||_0xb12710['direction']['toLowerCase']()===_0xe749('0x12')&&!_0xb12710['secret']&&!_[_0xe749('0x13')](_0xb12710[_0xe749('0x14')])){_0x33bfcb[_0xe749('0x15')][_0xe749('0x16')]({'where':{'id':_0xb12710[_0xe749('0x17')]}})[_0xe749('0x18')](function(_0x41fee9){if(_0x41fee9){_0x41fee9['update']({'lastMsgAt':_0xb12710[_0xe749('0x19')],'lastMsgDirection':_0xb12710[_0xe749('0x1a')][_0xe749('0x11')]()});}})[_0xe749('0x1b')](function(_0xf9637f){console[_0xe749('0x1c')](_0xf9637f);});}_0x1e4f7f();}},'charset':_0xe749('0x1d'),'collate':_0xe749('0x1e')});}; \ No newline at end of file +var _0x0c48=['chat_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x1d152e,_0x10dd3a){var _0x48d732=function(_0x1baa91){while(--_0x1baa91){_0x1d152e['push'](_0x1d152e['shift']());}};_0x48d732(++_0x10dd3a);}(_0x0c48,0xd3));var _0x80c4=function(_0x6faf9a,_0x17d9e6){_0x6faf9a=_0x6faf9a-0x0;var _0x25f7cb=_0x0c48[_0x6faf9a];return _0x25f7cb;};'use strict';var _=require(_0x80c4('0x0'));var util=require(_0x80c4('0x1'));var logger=require(_0x80c4('0x2'))(_0x80c4('0x3'));var moment=require(_0x80c4('0x4'));var BPromise=require(_0x80c4('0x5'));var rp=require(_0x80c4('0x6'));var fs=require('fs');var path=require(_0x80c4('0x7'));var rimraf=require(_0x80c4('0x8'));var config=require('../../config/environment');var attributes=require(_0x80c4('0x9'));module[_0x80c4('0xa')]=function(_0x2ab2bc,_0x1c5753){return _0x2ab2bc[_0x80c4('0xb')](_0x80c4('0xc'),attributes,{'tableName':_0x80c4('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x80c4('0xe')],'type':_0x80c4('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x135e36,_0x5cee0e,_0x43c1f7){var _0x34d6d5=_0x2ab2bc[_0x80c4('0x10')];var _0xdfc571=_0x135e36['get']({'plain':!![]});if(_0xdfc571['direction'][_0x80c4('0x11')]()==='in'||_0xdfc571[_0x80c4('0x12')][_0x80c4('0x11')]()===_0x80c4('0x13')&&!_0xdfc571[_0x80c4('0x14')]&&!_[_0x80c4('0x15')](_0xdfc571[_0x80c4('0x16')])){_0x34d6d5[_0x80c4('0x17')][_0x80c4('0x18')]({'where':{'id':_0xdfc571['ChatInteractionId']}})[_0x80c4('0x19')](function(_0x8fd455){if(_0x8fd455){_0x8fd455[_0x80c4('0x1a')]({'lastMsgAt':_0xdfc571[_0x80c4('0x1b')],'lastMsgDirection':_0xdfc571[_0x80c4('0x12')]['toLowerCase']()});}})[_0x80c4('0x1c')](function(_0x1d852b){console[_0x80c4('0x1d')](_0x1d852b);});}_0x43c1f7();}},'charset':_0x80c4('0x1e'),'collate':_0x80c4('0x1f')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 724e70e..ce270a2 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 _0x3475=['register','request','then','info','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','ChatMessage','body','options','raw','CreateChatMessage','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x14d70f,_0x56b0dc){var _0xd610b4=function(_0x328157){while(--_0x328157){_0x14d70f['push'](_0x14d70f['shift']());}};_0xd610b4(++_0x56b0dc);}(_0x3475,0xbc));var _0x5347=function(_0x29adca,_0x2c0e10){_0x29adca=_0x29adca-0x0;var _0x15a963=_0x3475[_0x29adca];return _0x15a963;};'use strict';var _=require(_0x5347('0x0'));var util=require(_0x5347('0x1'));var moment=require(_0x5347('0x2'));var BPromise=require(_0x5347('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5347('0x4'));var db=require(_0x5347('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5347('0x6'))(_0x5347('0x7'));var config=require('../../config/environment');var jayson=require(_0x5347('0x8'));var client=jayson[_0x5347('0x9')][_0x5347('0xa')]({'port':0x232a});config[_0x5347('0xb')]=_[_0x5347('0xc')](config['redis'],{'host':_0x5347('0xd'),'port':0x18eb});var socket=require(_0x5347('0xe'))(new Redis(config[_0x5347('0xb')]));require(_0x5347('0xf'))[_0x5347('0x10')](socket);function respondWithRpcPromise(_0x5ce222,_0x4db134,_0x403a8c){return new BPromise(function(_0x18b5e2,_0x343354){return client[_0x5347('0x11')](_0x5ce222,_0x403a8c)[_0x5347('0x12')](function(_0x4f9626){logger[_0x5347('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4db134,_0x5347('0x14'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4db134,_0x5347('0x14'),JSON[_0x5347('0x15')](_0x4f9626));if(_0x4f9626['error']){if(_0x4f9626[_0x5347('0x16')][_0x5347('0x17')]===0x1f4){logger[_0x5347('0x16')](_0x5347('0x18'),_0x4db134,_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);return _0x343354(_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);}logger[_0x5347('0x16')](_0x5347('0x18'),_0x4db134,_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);return _0x18b5e2(_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);}else{logger[_0x5347('0x13')](_0x5347('0x18'),_0x4db134,_0x5347('0x14'));_0x18b5e2(_0x4f9626[_0x5347('0x1a')][_0x5347('0x19')]);}})['catch'](function(_0x1238fa){logger[_0x5347('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4db134,_0x1238fa);_0x343354(_0x1238fa);});});}exports['CreateChatMessage']=function(_0x187b3a){var _0x406e75=this;return new Promise(function(_0xe62d2a,_0x19fe45){return db[_0x5347('0x1b')]['create'](_0x187b3a[_0x5347('0x1c')],{'raw':_0x187b3a[_0x5347('0x1d')]?_0x187b3a['options'][_0x5347('0x1e')]===undefined?!![]:![]:!![]})[_0x5347('0x12')](function(_0x1199d2){logger[_0x5347('0x13')](_0x5347('0x1f'),_0x187b3a);logger[_0x5347('0x20')](_0x5347('0x1f'),_0x187b3a,JSON[_0x5347('0x15')](_0x1199d2));_0xe62d2a(_0x1199d2);})[_0x5347('0x21')](function(_0x20db23){logger[_0x5347('0x16')](_0x5347('0x1f'),_0x20db23[_0x5347('0x19')],_0x187b3a);_0x19fe45(_0x406e75[_0x5347('0x16')](0x1f4,_0x20db23[_0x5347('0x19')]));});});}; \ No newline at end of file +var _0xcad3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','util'];(function(_0x15111f,_0x31a5f4){var _0x317ce7=function(_0x51f6a2){while(--_0x51f6a2){_0x15111f['push'](_0x15111f['shift']());}};_0x317ce7(++_0x31a5f4);}(_0xcad3,0x153));var _0x3cad=function(_0x1d9e40,_0x1c44db){_0x1d9e40=_0x1d9e40-0x0;var _0x2ee94f=_0xcad3[_0x1d9e40];return _0x2ee94f;};'use strict';var _=require('lodash');var util=require(_0x3cad('0x0'));var moment=require(_0x3cad('0x1'));var BPromise=require(_0x3cad('0x2'));var rs=require(_0x3cad('0x3'));var fs=require('fs');var Redis=require(_0x3cad('0x4'));var db=require(_0x3cad('0x5'))['db'];var utils=require(_0x3cad('0x6'));var logger=require(_0x3cad('0x7'))('rpc');var config=require(_0x3cad('0x8'));var jayson=require(_0x3cad('0x9'));var client=jayson[_0x3cad('0xa')][_0x3cad('0xb')]({'port':0x232a});config[_0x3cad('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3cad('0xd'))(new Redis(config[_0x3cad('0xc')]));require(_0x3cad('0xe'))[_0x3cad('0xf')](socket);function respondWithRpcPromise(_0x7ceb1a,_0x48245d,_0x643a89){return new BPromise(function(_0x29a99a,_0x1337d5){return client[_0x3cad('0x10')](_0x7ceb1a,_0x643a89)[_0x3cad('0x11')](function(_0x5333eb){logger[_0x3cad('0x12')](_0x3cad('0x13'),_0x48245d,_0x3cad('0x14'));logger[_0x3cad('0x15')](_0x3cad('0x16'),_0x48245d,_0x3cad('0x14'),JSON[_0x3cad('0x17')](_0x5333eb));if(_0x5333eb[_0x3cad('0x18')]){if(_0x5333eb[_0x3cad('0x18')][_0x3cad('0x19')]===0x1f4){logger[_0x3cad('0x18')](_0x3cad('0x13'),_0x48245d,_0x5333eb[_0x3cad('0x18')][_0x3cad('0x1a')]);return _0x1337d5(_0x5333eb[_0x3cad('0x18')][_0x3cad('0x1a')]);}logger[_0x3cad('0x18')]('ChatMessage,\x20%s,\x20%s',_0x48245d,_0x5333eb[_0x3cad('0x18')][_0x3cad('0x1a')]);return _0x29a99a(_0x5333eb['error'][_0x3cad('0x1a')]);}else{logger[_0x3cad('0x12')](_0x3cad('0x13'),_0x48245d,'request\x20sent');_0x29a99a(_0x5333eb[_0x3cad('0x1b')][_0x3cad('0x1a')]);}})[_0x3cad('0x1c')](function(_0x94867b){logger[_0x3cad('0x18')]('ChatMessage,\x20%s,\x20%s',_0x48245d,_0x94867b);_0x1337d5(_0x94867b);});});}exports[_0x3cad('0x1d')]=function(_0x9b7a57){var _0x306164=this;return new Promise(function(_0x79ef90,_0x2f8a88){return db[_0x3cad('0x1e')][_0x3cad('0x1f')](_0x9b7a57['body'],{'raw':_0x9b7a57[_0x3cad('0x20')]?_0x9b7a57[_0x3cad('0x20')][_0x3cad('0x21')]===undefined?!![]:![]:!![]})[_0x3cad('0x11')](function(_0x524036){logger[_0x3cad('0x12')](_0x3cad('0x1d'),_0x9b7a57);logger[_0x3cad('0x15')]('CreateChatMessage',_0x9b7a57,JSON['stringify'](_0x524036));_0x79ef90(_0x524036);})[_0x3cad('0x1c')](function(_0x90d863){logger[_0x3cad('0x18')]('CreateChatMessage',_0x90d863[_0x3cad('0x1a')],_0x9b7a57);_0x2f8a88(_0x306164[_0x3cad('0x18')](0x1f4,_0x90d863[_0x3cad('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index d56c0ea..d83c179 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 _0x2b83=['remove','removeListener','length','save'];(function(_0x558cf5,_0x3caae2){var _0x45f531=function(_0x260d74){while(--_0x260d74){_0x558cf5['push'](_0x558cf5['shift']());}};_0x45f531(++_0x3caae2);}(_0x2b83,0x1d3));var _0x32b8=function(_0x2b5ec9,_0x9b2cc8){_0x2b5ec9=_0x2b5ec9-0x0;var _0x12ef99=_0x2b83[_0x2b5ec9];return _0x12ef99;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x32b8('0x0'),_0x32b8('0x1'),'update'];function createListener(_0x3fcbdc,_0x287f16){return function(_0x304105){_0x287f16['emit'](_0x3fcbdc,_0x304105);};}function removeListener(_0x51d3b4,_0xdd712a){return function(){ChatMessageEvents[_0x32b8('0x2')](_0x51d3b4,_0xdd712a);};}exports['register']=function(_0x6bbc3d){for(var _0x55abd0=0x0,_0x18150c=events[_0x32b8('0x3')];_0x55abd0<_0x18150c;_0x55abd0++){var _0x36bde3=events[_0x55abd0];var _0x10a967=createListener('chatMessage:'+_0x36bde3,_0x6bbc3d);ChatMessageEvents['on'](_0x36bde3,_0x10a967);}}; \ No newline at end of file +var _0x5d17=['./chatMessage.events','save','removeListener','register','length','chatMessage:'];(function(_0x36ce53,_0x5a5087){var _0xb237b6=function(_0x4e6a52){while(--_0x4e6a52){_0x36ce53['push'](_0x36ce53['shift']());}};_0xb237b6(++_0x5a5087);}(_0x5d17,0x114));var _0x75d1=function(_0x109f62,_0x2a1093){_0x109f62=_0x109f62-0x0;var _0x2ac0cc=_0x5d17[_0x109f62];return _0x2ac0cc;};'use strict';var ChatMessageEvents=require(_0x75d1('0x0'));var events=[_0x75d1('0x1'),'remove','update'];function createListener(_0x39c0ec,_0x426717){return function(_0x1c9ba6){_0x426717['emit'](_0x39c0ec,_0x1c9ba6);};}function removeListener(_0x177460,_0x45d03a){return function(){ChatMessageEvents[_0x75d1('0x2')](_0x177460,_0x45d03a);};}exports[_0x75d1('0x3')]=function(_0x56ac0a){for(var _0x458681=0x0,_0x116a51=events[_0x75d1('0x4')];_0x458681<_0x116a51;_0x458681++){var _0x1ee61b=events[_0x458681];var _0x3a9d5e=createListener(_0x75d1('0x5')+_0x1ee61b,_0x56ac0a);ChatMessageEvents['on'](_0x1ee61b,_0x3a9d5e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index bb2ba6f..1250f13 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 _0xb5f1=['update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','/:id','show','post','chatmessage:create','create','put'];(function(_0x57838d,_0x5724c7){var _0x3908f1=function(_0x56b31a){while(--_0x56b31a){_0x57838d['push'](_0x57838d['shift']());}};_0x3908f1(++_0x5724c7);}(_0xb5f1,0x187));var _0x1b5f=function(_0x5c9247,_0x414a0b){_0x5c9247=_0x5c9247-0x0;var _0x206fa6=_0xb5f1[_0x5c9247];return _0x206fa6;};'use strict';var multer=require(_0x1b5f('0x0'));var util=require(_0x1b5f('0x1'));var path=require(_0x1b5f('0x2'));var timeout=require(_0x1b5f('0x3'));var express=require(_0x1b5f('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(_0x1b5f('0x5'));var controller=require(_0x1b5f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1b5f('0x7')]);router[_0x1b5f('0x8')](_0x1b5f('0x9'),auth[_0x1b5f('0xa')](),controller['describe']);router['get'](_0x1b5f('0xb'),auth[_0x1b5f('0xa')](),controller[_0x1b5f('0xc')]);router[_0x1b5f('0xd')]('/',auth[_0x1b5f('0xa')](),interaction['tracked']('chat',_0x1b5f('0xe')),controller[_0x1b5f('0xf')]);router[_0x1b5f('0x10')](_0x1b5f('0xb'),controller[_0x1b5f('0x11')]);router[_0x1b5f('0x10')](_0x1b5f('0x12'),auth[_0x1b5f('0xa')](),controller[_0x1b5f('0x13')]);router[_0x1b5f('0x10')](_0x1b5f('0x14'),auth[_0x1b5f('0xa')](),controller[_0x1b5f('0x15')]);router[_0x1b5f('0x16')](_0x1b5f('0xb'),auth[_0x1b5f('0xa')](),controller['destroy']);module[_0x1b5f('0x17')]=router; \ No newline at end of file +var _0xb555=['update','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','describe','get','/:id','post','chat','chatmessage:create','create','put'];(function(_0x24ab6f,_0x1b5e94){var _0x4b8b7e=function(_0x6f3ed6){while(--_0x6f3ed6){_0x24ab6f['push'](_0x24ab6f['shift']());}};_0x4b8b7e(++_0x1b5e94);}(_0xb555,0x100));var _0x5b55=function(_0x2b4426,_0x307a84){_0x2b4426=_0x2b4426-0x0;var _0x19aaf2=_0xb555[_0x2b4426];return _0x19aaf2;};'use strict';var multer=require(_0x5b55('0x0'));var util=require(_0x5b55('0x1'));var path=require(_0x5b55('0x2'));var timeout=require(_0x5b55('0x3'));var express=require('express');var router=express[_0x5b55('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5b55('0x5'));var interaction=require(_0x5b55('0x6'));var config=require(_0x5b55('0x7'));var controller=require(_0x5b55('0x8'));router['get']('/',auth[_0x5b55('0x9')](),controller[_0x5b55('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5b55('0xb')]);router[_0x5b55('0xc')](_0x5b55('0xd'),auth[_0x5b55('0x9')](),controller['show']);router[_0x5b55('0xe')]('/',auth[_0x5b55('0x9')](),interaction['tracked'](_0x5b55('0xf'),_0x5b55('0x10')),controller[_0x5b55('0x11')]);router[_0x5b55('0x12')](_0x5b55('0xd'),controller[_0x5b55('0x13')]);router[_0x5b55('0x12')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x5b55('0x12')](_0x5b55('0x14'),auth[_0x5b55('0x9')](),controller[_0x5b55('0x15')]);router[_0x5b55('0x16')](_0x5b55('0xd'),auth[_0x5b55('0x9')](),controller[_0x5b55('0x17')]);module[_0x5b55('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8aff278..5d58f06 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 _0xadb5=['medium','TEXT','exports'];(function(_0xa872ce,_0x4118bb){var _0x191e3e=function(_0x577827){while(--_0x577827){_0xa872ce['push'](_0xa872ce['shift']());}};_0x191e3e(++_0x4118bb);}(_0xadb5,0xad));var _0x5adb=function(_0x58d6ed,_0x532934){_0x58d6ed=_0x58d6ed-0x0;var _0x306ae5=_0xadb5[_0x58d6ed];return _0x306ae5;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0xa24116,_0x12d030){var _0x3f62d8=function(_0x11881c){while(--_0x11881c){_0xa24116['push'](_0xa24116['shift']());}};_0x3f62d8(++_0x12d030);}(_0xdb28,0x106));var _0x8db2=function(_0x55ad0d,_0xc74b90){_0x55ad0d=_0x55ad0d-0x0;var _0x11972d=_0xdb28[_0x55ad0d];return _0x11972d;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 6cc3778..8d0c31a 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(_0x59c39a,_0x5cf1bd){var _0x1cba65=function(_0x555b92){while(--_0x555b92){_0x59c39a['push'](_0x59c39a['shift']());}};_0x1cba65(++_0x5cf1bd);}(_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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7a54,0x106));var _0x47a5=function(_0x904a8b,_0x398e3e){_0x904a8b=_0x904a8b-0x0;var _0x1ef25d=_0x7a54[_0x904a8b];return _0x1ef25d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 22e8039..e569d7b 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 _0xf2fc=['ChatOfflineMessage','update','remove','hook','exports','events','../../mysqldb'];(function(_0x58e883,_0x33aca2){var _0x46261f=function(_0x3b6909){while(--_0x3b6909){_0x58e883['push'](_0x58e883['shift']());}};_0x46261f(++_0x33aca2);}(_0xf2fc,0x15c));var _0xcf2f=function(_0x30381e,_0x2a1f30){_0x30381e=_0x30381e-0x0;var _0x9fb2f3=_0xf2fc[_0x30381e];return _0x9fb2f3;};'use strict';var EventEmitter=require(_0xcf2f('0x0'));var ChatOfflineMessage=require(_0xcf2f('0x1'))['db'][_0xcf2f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcf2f('0x3'),'afterDestroy':_0xcf2f('0x4')};function emitEvent(_0x403946){return function(_0x2d0d84,_0x56c242,_0x2b57c3){ChatOfflineMessageEvents['emit'](_0x403946+':'+_0x2d0d84['id'],_0x2d0d84);ChatOfflineMessageEvents['emit'](_0x403946,_0x2d0d84);_0x2b57c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xcf2f('0x5')](e,emitEvent(event));}}module[_0xcf2f('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x6889=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x376db9,_0x12a013){var _0x1ca163=function(_0x4b0cd4){while(--_0x4b0cd4){_0x376db9['push'](_0x376db9['shift']());}};_0x1ca163(++_0x12a013);}(_0x6889,0x114));var _0x9688=function(_0xef8e69,_0xbc78ff){_0xef8e69=_0xef8e69-0x0;var _0x463ee6=_0x6889[_0xef8e69];return _0x463ee6;};'use strict';var EventEmitter=require(_0x9688('0x0'));var ChatOfflineMessage=require(_0x9688('0x1'))['db'][_0x9688('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9688('0x3')](0x0);var events={'afterCreate':_0x9688('0x4'),'afterUpdate':'update','afterDestroy':_0x9688('0x5')};function emitEvent(_0x4e8a47){return function(_0x559406,_0x36070d,_0x293b45){ChatOfflineMessageEvents[_0x9688('0x6')](_0x4e8a47+':'+_0x559406['id'],_0x559406);ChatOfflineMessageEvents['emit'](_0x4e8a47,_0x559406);_0x293b45(null);};}for(var e in events){if(events[_0x9688('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9688('0x8')](e,emitEvent(event));}}module[_0x9688('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 5586659..1b269d1 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 _0xf1c0=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf1c0,0x122));var _0x0f1c=function(_0x266483,_0x2514c2){_0x266483=_0x266483-0x0;var _0x490e0e=_0xf1c0[_0x266483];return _0x490e0e;};'use strict';var attributes=require(_0x0f1c('0x0'));module[_0x0f1c('0x1')]=function(_0xb07b56){return _0xb07b56['define'](_0x0f1c('0x2'),attributes,{'tableName':_0x0f1c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0f1c('0x4'),'collate':_0x0f1c('0x5')});}; \ No newline at end of file +var _0x7e6c=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0xe1231c,_0x531069){var _0x14317d=function(_0x3e6a22){while(--_0x3e6a22){_0xe1231c['push'](_0xe1231c['shift']());}};_0x14317d(++_0x531069);}(_0x7e6c,0xc0));var _0xc7e6=function(_0x5e2c70,_0x108e64){_0x5e2c70=_0x5e2c70-0x0;var _0x1e6cbc=_0x7e6c[_0x5e2c70];return _0x1e6cbc;};'use strict';var attributes=require(_0xc7e6('0x0'));module[_0xc7e6('0x1')]=function(_0x2135f5){return _0x2135f5[_0xc7e6('0x2')](_0xc7e6('0x3'),attributes,{'tableName':_0xc7e6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc7e6('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3ef70e6..92d84ed 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 _0x06f4=['error','message','info','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x37fddf,_0x3923fa){var _0x33f770=function(_0x2e4046){while(--_0x2e4046){_0x37fddf['push'](_0x37fddf['shift']());}};_0x33f770(++_0x3923fa);}(_0x06f4,0x136));var _0x406f=function(_0xf3450d,_0x49f7f7){_0xf3450d=_0xf3450d-0x0;var _0x418ec3=_0x06f4[_0xf3450d];return _0x418ec3;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var moment=require('moment');var BPromise=require(_0x406f('0x2'));var rs=require(_0x406f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x406f('0x4'));var logger=require('../../config/logger')(_0x406f('0x5'));var config=require(_0x406f('0x6'));var jayson=require(_0x406f('0x7'));var client=jayson[_0x406f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d2886,_0x5bec4f,_0x1afec4){return new BPromise(function(_0x1c39ce,_0xc2f682){return client['request'](_0x1d2886,_0x1afec4)[_0x406f('0x9')](function(_0x52bad2){logger['info'](_0x406f('0xa'),_0x5bec4f,'request\x20sent');logger[_0x406f('0xb')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5bec4f,_0x406f('0xc'),JSON['stringify'](_0x52bad2));if(_0x52bad2[_0x406f('0xd')]){if(_0x52bad2[_0x406f('0xd')]['code']===0x1f4){logger[_0x406f('0xd')](_0x406f('0xa'),_0x5bec4f,_0x52bad2[_0x406f('0xd')][_0x406f('0xe')]);return _0xc2f682(_0x52bad2[_0x406f('0xd')][_0x406f('0xe')]);}logger[_0x406f('0xd')](_0x406f('0xa'),_0x5bec4f,_0x52bad2[_0x406f('0xd')][_0x406f('0xe')]);return _0x1c39ce(_0x52bad2[_0x406f('0xd')]['message']);}else{logger[_0x406f('0xf')](_0x406f('0xa'),_0x5bec4f,_0x406f('0xc'));_0x1c39ce(_0x52bad2['result'][_0x406f('0xe')]);}})[_0x406f('0x10')](function(_0x4dfbc1){logger['error'](_0x406f('0xa'),_0x5bec4f,_0x4dfbc1);_0xc2f682(_0x4dfbc1);});});} \ No newline at end of file +var _0x433b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring'];(function(_0x2f2f91,_0x31b841){var _0x2be3d3=function(_0x5c83c4){while(--_0x5c83c4){_0x2f2f91['push'](_0x2f2f91['shift']());}};_0x2be3d3(++_0x31b841);}(_0x433b,0x15c));var _0xb433=function(_0x4d471b,_0x281167){_0x4d471b=_0x4d471b-0x0;var _0x54fd9b=_0x433b[_0x4d471b];return _0x54fd9b;};'use strict';var _=require('lodash');var util=require(_0xb433('0x0'));var moment=require(_0xb433('0x1'));var BPromise=require(_0xb433('0x2'));var rs=require(_0xb433('0x3'));var fs=require('fs');var Redis=require(_0xb433('0x4'));var db=require(_0xb433('0x5'))['db'];var utils=require(_0xb433('0x6'));var logger=require(_0xb433('0x7'))(_0xb433('0x8'));var config=require(_0xb433('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb433('0xa')][_0xb433('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bb6c7,_0x29b6f7,_0x378037){return new BPromise(function(_0x46a7e6,_0x308abf){return client[_0xb433('0xc')](_0x5bb6c7,_0x378037)['then'](function(_0x304f86){logger[_0xb433('0xd')](_0xb433('0xe'),_0x29b6f7,_0xb433('0xf'));logger[_0xb433('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x29b6f7,_0xb433('0xf'),JSON[_0xb433('0x11')](_0x304f86));if(_0x304f86[_0xb433('0x12')]){if(_0x304f86[_0xb433('0x12')][_0xb433('0x13')]===0x1f4){logger[_0xb433('0x12')](_0xb433('0xe'),_0x29b6f7,_0x304f86[_0xb433('0x12')]['message']);return _0x308abf(_0x304f86[_0xb433('0x12')][_0xb433('0x14')]);}logger[_0xb433('0x12')](_0xb433('0xe'),_0x29b6f7,_0x304f86[_0xb433('0x12')][_0xb433('0x14')]);return _0x46a7e6(_0x304f86[_0xb433('0x12')][_0xb433('0x14')]);}else{logger[_0xb433('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x29b6f7,_0xb433('0xf'));_0x46a7e6(_0x304f86['result'][_0xb433('0x14')]);}})[_0xb433('0x15')](function(_0x545c7e){logger['error'](_0xb433('0xe'),_0x29b6f7,_0x545c7e);_0x308abf(_0x545c7e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 4d0334f..3e38f58 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 _0xc9b5=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3ae54c,_0x4b2004){var _0xdd9ecd=function(_0x40cfb6){while(--_0x40cfb6){_0x3ae54c['push'](_0x3ae54c['shift']());}};_0xdd9ecd(++_0x4b2004);}(_0xc9b5,0x1c8));var _0x5c9b=function(_0xca18be,_0x5bbe40){_0xca18be=_0xca18be-0x0;var _0x2815ad=_0xc9b5[_0xca18be];return _0x2815ad;};'use strict';var multer=require(_0x5c9b('0x0'));var util=require(_0x5c9b('0x1'));var path=require('path');var timeout=require(_0x5c9b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5c9b('0x3'));var interaction=require(_0x5c9b('0x4'));var config=require(_0x5c9b('0x5'));var controller=require(_0x5c9b('0x6'));router[_0x5c9b('0x7')]('/',auth[_0x5c9b('0x8')](),controller[_0x5c9b('0x9')]);router['get']('/describe',auth[_0x5c9b('0x8')](),controller['describe']);router['get'](_0x5c9b('0xa'),auth[_0x5c9b('0x8')](),controller[_0x5c9b('0xb')]);router[_0x5c9b('0xc')]('/',auth[_0x5c9b('0x8')](),controller[_0x5c9b('0xd')]);router[_0x5c9b('0xe')]('/:id',auth[_0x5c9b('0x8')](),controller[_0x5c9b('0xf')]);router[_0x5c9b('0x10')](_0x5c9b('0xa'),auth[_0x5c9b('0x8')](),controller[_0x5c9b('0x11')]);module[_0x5c9b('0x12')]=router; \ No newline at end of file +var _0xf907=['/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get'];(function(_0x45504d,_0x4d792c){var _0x30d19c=function(_0xd8ecba){while(--_0xd8ecba){_0x45504d['push'](_0x45504d['shift']());}};_0x30d19c(++_0x4d792c);}(_0xf907,0x1d6));var _0x7f90=function(_0x426384,_0x1901ab){_0x426384=_0x426384-0x0;var _0x3aa40a=_0xf907[_0x426384];return _0x3aa40a;};'use strict';var multer=require(_0x7f90('0x0'));var util=require(_0x7f90('0x1'));var path=require(_0x7f90('0x2'));var timeout=require(_0x7f90('0x3'));var express=require(_0x7f90('0x4'));var router=express[_0x7f90('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7f90('0x6'));var interaction=require(_0x7f90('0x7'));var config=require('../../config/environment');var controller=require(_0x7f90('0x8'));router[_0x7f90('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7f90('0x9')](_0x7f90('0xa'),auth[_0x7f90('0xb')](),controller['describe']);router[_0x7f90('0x9')](_0x7f90('0xc'),auth[_0x7f90('0xb')](),controller['show']);router[_0x7f90('0xd')]('/',auth['isAuthenticated'](),controller[_0x7f90('0xe')]);router[_0x7f90('0xf')](_0x7f90('0xc'),auth[_0x7f90('0xb')](),controller[_0x7f90('0x10')]);router[_0x7f90('0x11')](_0x7f90('0xc'),auth[_0x7f90('0xb')](),controller[_0x7f90('0x12')]);module[_0x7f90('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1618c52..0e5dcd3 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 _0x6646=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6646,0x1d0));var _0x6664=function(_0x5d40c3,_0x3940f9){_0x5d40c3=_0x5d40c3-0x0;var _0x515304=_0x6646[_0x5d40c3];return _0x515304;};'use strict';var Sequelize=require(_0x6664('0x0'));module[_0x6664('0x1')]={'name':{'type':Sequelize[_0x6664('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6664('0x3')](_0x6664('0x4'),_0x6664('0x5')),'defaultValue':_0x6664('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6664('0x6')]}}; \ No newline at end of file +var _0x1682=['mouseOver','INTEGER','sequelize','exports','ENUM'];(function(_0x2583b2,_0x45a743){var _0xc1b07c=function(_0x5a3d81){while(--_0x5a3d81){_0x2583b2['push'](_0x2583b2['shift']());}};_0xc1b07c(++_0x45a743);}(_0x1682,0x188));var _0x2168=function(_0xd6a35e,_0x39f4d4){_0xd6a35e=_0xd6a35e-0x0;var _0x2f1d39=_0x1682[_0xd6a35e];return _0x2f1d39;};'use strict';var Sequelize=require(_0x2168('0x0'));module[_0x2168('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2168('0x2')]('mouseOver','timeout'),'defaultValue':_0x2168('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2168('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index da3ff44..c24d38f 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 _0xdcc4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','options','ChatProactiveAction','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4e859c,_0xc2b230){var _0x3b571d=function(_0x40c359){while(--_0x40c359){_0x4e859c['push'](_0x4e859c['shift']());}};_0x3b571d(++_0xc2b230);}(_0xdcc4,0xea));var _0x4dcc=function(_0x3f66a8,_0x2ab114){_0x3f66a8=_0x3f66a8-0x0;var _0x98c310=_0xdcc4[_0x3f66a8];return _0x98c310;};'use strict';var emlformat=require(_0x4dcc('0x0'));var rimraf=require(_0x4dcc('0x1'));var zipdir=require(_0x4dcc('0x2'));var jsonpatch=require(_0x4dcc('0x3'));var rp=require(_0x4dcc('0x4'));var moment=require('moment');var BPromise=require(_0x4dcc('0x5'));var Mustache=require(_0x4dcc('0x6'));var util=require(_0x4dcc('0x7'));var path=require(_0x4dcc('0x8'));var sox=require(_0x4dcc('0x9'));var csv=require(_0x4dcc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dcc('0xb'));var _=require('lodash');var squel=require(_0x4dcc('0xc'));var crypto=require(_0x4dcc('0xd'));var jsforce=require(_0x4dcc('0xe'));var deskjs=require(_0x4dcc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4dcc('0x10'));var Papa=require(_0x4dcc('0x11'));var Redis=require(_0x4dcc('0x12'));var authService=require(_0x4dcc('0x13'));var qs=require(_0x4dcc('0x14'));var as=require(_0x4dcc('0x15'));var hardwareService=require(_0x4dcc('0x16'));var logger=require(_0x4dcc('0x17'))('api');var utils=require(_0x4dcc('0x18'));var config=require(_0x4dcc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4dcc('0x1a'))['db'];function respondWithStatusCode(_0x20013a,_0x49cfbb){_0x49cfbb=_0x49cfbb||0xcc;return function(_0x5cc1d1){if(_0x5cc1d1){return _0x20013a[_0x4dcc('0x1b')](_0x49cfbb);}return _0x20013a[_0x4dcc('0x1c')](_0x49cfbb)[_0x4dcc('0x1d')]();};}function respondWithResult(_0xa28755,_0x3760c9){_0x3760c9=_0x3760c9||0xc8;return function(_0x62a437){if(_0x62a437){return _0xa28755[_0x4dcc('0x1c')](_0x3760c9)['json'](_0x62a437);}};}function respondWithFilteredResult(_0x4cb7f0,_0x26c28c){return function(_0x407072){if(_0x407072){var _0xde3a5f=typeof _0x26c28c[_0x4dcc('0x1e')]===_0x4dcc('0x1f')&&typeof _0x26c28c['limit']===_0x4dcc('0x1f');var _0x387523=_0x407072['count'];var _0x4ba591=_0xde3a5f?0x0:_0x26c28c['offset'];var _0x418392=_0xde3a5f?_0x407072[_0x4dcc('0x20')]:_0x26c28c['offset']+_0x26c28c[_0x4dcc('0x21')];var _0x3fbb60;if(_0x418392>=_0x387523){_0x418392=_0x387523;_0x3fbb60=0xc8;}else{_0x3fbb60=0xce;}_0x4cb7f0[_0x4dcc('0x1c')](_0x3fbb60);return _0x4cb7f0['set'](_0x4dcc('0x22'),_0x4ba591+'-'+_0x418392+'/'+_0x387523)[_0x4dcc('0x23')](_0x407072);}return null;};}function patchUpdates(_0x39209e){return function(_0x2eb5ec){try{jsonpatch[_0x4dcc('0x24')](_0x2eb5ec,_0x39209e,!![]);}catch(_0x444387){return BPromise[_0x4dcc('0x25')](_0x444387);}return _0x2eb5ec[_0x4dcc('0x26')]();};}function saveUpdates(_0x1b2834,_0x1ed6d0){return function(_0x235f4f){if(_0x235f4f){return _0x235f4f[_0x4dcc('0x27')](_0x1b2834)[_0x4dcc('0x28')](function(_0x9007cc){return _0x9007cc;});}return null;};}function removeEntity(_0xdeab92,_0xc1c37b){return function(_0x537f32){if(_0x537f32){return _0x537f32[_0x4dcc('0x29')]()[_0x4dcc('0x28')](function(){_0xdeab92[_0x4dcc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35470e,_0x589149){return function(_0x3a548a){if(!_0x3a548a){_0x35470e[_0x4dcc('0x1b')](0x194);}return _0x3a548a;};}function handleError(_0x558419,_0x3853ae){_0x3853ae=_0x3853ae||0x1f4;return function(_0x2afff8){logger['error'](_0x2afff8[_0x4dcc('0x2a')]);if(_0x2afff8[_0x4dcc('0x2b')]){delete _0x2afff8['name'];}_0x558419['status'](_0x3853ae)[_0x4dcc('0x2c')](_0x2afff8);};}exports[_0x4dcc('0x2d')]=function(_0x160805,_0x562d1f){var _0x30c617={'raw':!![],'where':{'id':_0x160805[_0x4dcc('0x2e')]['id']}},_0x5c2464={};_0x5c2464[_0x4dcc('0x2f')]=_[_0x4dcc('0x30')](db['ChatProactiveAction'][_0x4dcc('0x31')]);_0x5c2464['query']=_['keys'](_0x160805[_0x4dcc('0x32')]);_0x5c2464['filters']=_[_0x4dcc('0x33')](_0x5c2464[_0x4dcc('0x2f')],_0x5c2464[_0x4dcc('0x32')]);_0x30c617[_0x4dcc('0x34')]=_[_0x4dcc('0x33')](_0x5c2464[_0x4dcc('0x2f')],qs[_0x4dcc('0x35')](_0x160805[_0x4dcc('0x32')][_0x4dcc('0x35')]));_0x30c617[_0x4dcc('0x34')]=_0x30c617[_0x4dcc('0x34')]['length']?_0x30c617['attributes']:_0x5c2464[_0x4dcc('0x2f')];if(_0x160805['query'][_0x4dcc('0x36')]){_0x30c617[_0x4dcc('0x37')]=[{'all':!![]}];}_0x30c617=_[_0x4dcc('0x38')]({},_0x30c617,_0x160805[_0x4dcc('0x39')]);return db[_0x4dcc('0x3a')][_0x4dcc('0x3b')](_0x30c617)[_0x4dcc('0x28')](handleEntityNotFound(_0x562d1f,null))[_0x4dcc('0x28')](respondWithResult(_0x562d1f,null))['catch'](handleError(_0x562d1f,null));};exports[_0x4dcc('0x3c')]=function(_0x5698b8,_0x6722ca){return db['ChatProactiveAction'][_0x4dcc('0x3c')](_0x5698b8['body'],{})[_0x4dcc('0x28')](respondWithResult(_0x6722ca,0xc9))[_0x4dcc('0x3d')](handleError(_0x6722ca,null));};exports[_0x4dcc('0x27')]=function(_0x2ea31d,_0x19df27){if(_0x2ea31d['body']['id']){delete _0x2ea31d[_0x4dcc('0x3e')]['id'];}return db['ChatProactiveAction'][_0x4dcc('0x3b')]({'where':{'id':_0x2ea31d[_0x4dcc('0x2e')]['id']}})[_0x4dcc('0x28')](handleEntityNotFound(_0x19df27,null))[_0x4dcc('0x28')](saveUpdates(_0x2ea31d[_0x4dcc('0x3e')],null))[_0x4dcc('0x28')](respondWithResult(_0x19df27,null))[_0x4dcc('0x3d')](handleError(_0x19df27,null));};exports[_0x4dcc('0x29')]=function(_0x17a8da,_0x42d534){return db[_0x4dcc('0x3a')][_0x4dcc('0x3b')]({'where':{'id':_0x17a8da['params']['id']}})['then'](handleEntityNotFound(_0x42d534,null))[_0x4dcc('0x28')](removeEntity(_0x42d534,null))[_0x4dcc('0x3d')](handleError(_0x42d534,null));}; \ No newline at end of file +var _0x624c=['sendStatus','error','stack','name','params','model','ChatProactiveAction','rawAttributes','query','keys','attributes','intersection','fields','length','includeAll','include','merge','options','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end'];(function(_0x1e4b43,_0x440113){var _0x4f68f1=function(_0x41a261){while(--_0x41a261){_0x1e4b43['push'](_0x1e4b43['shift']());}};_0x4f68f1(++_0x440113);}(_0x624c,0x1ee));var _0xc624=function(_0x5ca353,_0x21eb37){_0x5ca353=_0x5ca353-0x0;var _0x4f2fe5=_0x624c[_0x5ca353];return _0x4f2fe5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc624('0x0'));var zipdir=require(_0xc624('0x1'));var jsonpatch=require(_0xc624('0x2'));var rp=require(_0xc624('0x3'));var moment=require(_0xc624('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc624('0x5'));var util=require('util');var path=require(_0xc624('0x6'));var sox=require('sox');var csv=require(_0xc624('0x7'));var ejs=require(_0xc624('0x8'));var fs=require('fs');var fs_extra=require(_0xc624('0x9'));var _=require(_0xc624('0xa'));var squel=require(_0xc624('0xb'));var crypto=require(_0xc624('0xc'));var jsforce=require(_0xc624('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc624('0x7'));var querystring=require(_0xc624('0xe'));var Papa=require(_0xc624('0xf'));var Redis=require('ioredis');var authService=require(_0xc624('0x10'));var qs=require(_0xc624('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc624('0x12'));var logger=require(_0xc624('0x13'))(_0xc624('0x14'));var utils=require(_0xc624('0x15'));var config=require(_0xc624('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc624('0x17'))['db'];function respondWithStatusCode(_0x25e874,_0xef673c){_0xef673c=_0xef673c||0xcc;return function(_0x1a0f3d){if(_0x1a0f3d){return _0x25e874['sendStatus'](_0xef673c);}return _0x25e874['status'](_0xef673c)['end']();};}function respondWithResult(_0xfa6bae,_0x4cb641){_0x4cb641=_0x4cb641||0xc8;return function(_0x3cbc19){if(_0x3cbc19){return _0xfa6bae[_0xc624('0x18')](_0x4cb641)[_0xc624('0x19')](_0x3cbc19);}};}function respondWithFilteredResult(_0x362a4a,_0x7eaac7){return function(_0x330df7){if(_0x330df7){var _0x5834f0=typeof _0x7eaac7[_0xc624('0x1a')]===_0xc624('0x1b')&&typeof _0x7eaac7[_0xc624('0x1c')]==='undefined';var _0x190458=_0x330df7[_0xc624('0x1d')];var _0x5e263a=_0x5834f0?0x0:_0x7eaac7[_0xc624('0x1a')];var _0x170a4=_0x5834f0?_0x330df7['count']:_0x7eaac7[_0xc624('0x1a')]+_0x7eaac7['limit'];var _0x592d82;if(_0x170a4>=_0x190458){_0x170a4=_0x190458;_0x592d82=0xc8;}else{_0x592d82=0xce;}_0x362a4a[_0xc624('0x18')](_0x592d82);return _0x362a4a[_0xc624('0x1e')](_0xc624('0x1f'),_0x5e263a+'-'+_0x170a4+'/'+_0x190458)[_0xc624('0x19')](_0x330df7);}return null;};}function patchUpdates(_0x226f89){return function(_0x55be9e){try{jsonpatch[_0xc624('0x20')](_0x55be9e,_0x226f89,!![]);}catch(_0x246381){return BPromise[_0xc624('0x21')](_0x246381);}return _0x55be9e['save']();};}function saveUpdates(_0x400d46,_0x5f0ac3){return function(_0x3ce441){if(_0x3ce441){return _0x3ce441['update'](_0x400d46)[_0xc624('0x22')](function(_0x3e5aa3){return _0x3e5aa3;});}return null;};}function removeEntity(_0x3fe07e,_0x4b1812){return function(_0x4aab4d){if(_0x4aab4d){return _0x4aab4d[_0xc624('0x23')]()[_0xc624('0x22')](function(){_0x3fe07e[_0xc624('0x18')](0xcc)[_0xc624('0x24')]();});}};}function handleEntityNotFound(_0x3b0dca,_0x3ed4dd){return function(_0xef8a37){if(!_0xef8a37){_0x3b0dca[_0xc624('0x25')](0x194);}return _0xef8a37;};}function handleError(_0x2b52a3,_0x6d7d96){_0x6d7d96=_0x6d7d96||0x1f4;return function(_0x489a04){logger[_0xc624('0x26')](_0x489a04[_0xc624('0x27')]);if(_0x489a04[_0xc624('0x28')]){delete _0x489a04[_0xc624('0x28')];}_0x2b52a3[_0xc624('0x18')](_0x6d7d96)['send'](_0x489a04);};}exports['show']=function(_0x52b55c,_0x362ad7){var _0x4cdd14={'raw':!![],'where':{'id':_0x52b55c[_0xc624('0x29')]['id']}},_0x429e1d={};_0x429e1d[_0xc624('0x2a')]=_['keys'](db[_0xc624('0x2b')][_0xc624('0x2c')]);_0x429e1d[_0xc624('0x2d')]=_[_0xc624('0x2e')](_0x52b55c[_0xc624('0x2d')]);_0x429e1d['filters']=_['intersection'](_0x429e1d['model'],_0x429e1d[_0xc624('0x2d')]);_0x4cdd14[_0xc624('0x2f')]=_[_0xc624('0x30')](_0x429e1d[_0xc624('0x2a')],qs[_0xc624('0x31')](_0x52b55c[_0xc624('0x2d')][_0xc624('0x31')]));_0x4cdd14['attributes']=_0x4cdd14[_0xc624('0x2f')][_0xc624('0x32')]?_0x4cdd14[_0xc624('0x2f')]:_0x429e1d[_0xc624('0x2a')];if(_0x52b55c[_0xc624('0x2d')][_0xc624('0x33')]){_0x4cdd14[_0xc624('0x34')]=[{'all':!![]}];}_0x4cdd14=_[_0xc624('0x35')]({},_0x4cdd14,_0x52b55c[_0xc624('0x36')]);return db['ChatProactiveAction']['find'](_0x4cdd14)[_0xc624('0x22')](handleEntityNotFound(_0x362ad7,null))[_0xc624('0x22')](respondWithResult(_0x362ad7,null))[_0xc624('0x37')](handleError(_0x362ad7,null));};exports[_0xc624('0x38')]=function(_0x3c281b,_0x898784){return db[_0xc624('0x2b')][_0xc624('0x38')](_0x3c281b[_0xc624('0x39')],{})[_0xc624('0x22')](respondWithResult(_0x898784,0xc9))[_0xc624('0x37')](handleError(_0x898784,null));};exports['update']=function(_0x118a2b,_0x5ebd55){if(_0x118a2b['body']['id']){delete _0x118a2b[_0xc624('0x39')]['id'];}return db[_0xc624('0x2b')][_0xc624('0x3a')]({'where':{'id':_0x118a2b['params']['id']}})['then'](handleEntityNotFound(_0x5ebd55,null))[_0xc624('0x22')](saveUpdates(_0x118a2b[_0xc624('0x39')],null))[_0xc624('0x22')](respondWithResult(_0x5ebd55,null))['catch'](handleError(_0x5ebd55,null));};exports['destroy']=function(_0x12acf2,_0x5f1087){return db[_0xc624('0x2b')][_0xc624('0x3a')]({'where':{'id':_0x12acf2['params']['id']}})[_0xc624('0x22')](handleEntityNotFound(_0x5f1087,null))['then'](removeEntity(_0x5f1087,null))['catch'](handleError(_0x5f1087,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c41970d..d38e731 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 _0x31d5=['bluebird','request-promise','./chatProactiveAction.attributes','ChatProactiveAction','lodash','util','../../config/logger','api','moment'];(function(_0x2e3e11,_0x25c7f9){var _0x3b44fa=function(_0x52ece4){while(--_0x52ece4){_0x2e3e11['push'](_0x2e3e11['shift']());}};_0x3b44fa(++_0x25c7f9);}(_0x31d5,0x1cf));var _0x531d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x31d5[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x531d('0x0'));var util=require(_0x531d('0x1'));var logger=require(_0x531d('0x2'))(_0x531d('0x3'));var moment=require(_0x531d('0x4'));var BPromise=require(_0x531d('0x5'));var rp=require(_0x531d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x531d('0x7'));module['exports']=function(_0x5f534b,_0x214903){return _0x5f534b['define'](_0x531d('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4de=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api'];(function(_0x591865,_0x41ec87){var _0x2c2e7c=function(_0x43e6de){while(--_0x43e6de){_0x591865['push'](_0x591865['shift']());}};_0x2c2e7c(++_0x41ec87);}(_0xa4de,0xb3));var _0xea4d=function(_0xf55047,_0x127c58){_0xf55047=_0xf55047-0x0;var _0x6d4407=_0xa4de[_0xf55047];return _0x6d4407;};'use strict';var _=require(_0xea4d('0x0'));var util=require('util');var logger=require(_0xea4d('0x1'))(_0xea4d('0x2'));var moment=require(_0xea4d('0x3'));var BPromise=require(_0xea4d('0x4'));var rp=require(_0xea4d('0x5'));var fs=require('fs');var path=require(_0xea4d('0x6'));var rimraf=require(_0xea4d('0x7'));var config=require(_0xea4d('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xea4d('0x9')]=function(_0x3a66b4,_0x4abc6b){return _0x3a66b4[_0xea4d('0xa')](_0xea4d('0xb'),attributes,{'tableName':_0xea4d('0xc'),'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 4f755de..d4ffd93 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 _0xb98b=['request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x5e1fb6,_0xf3495b){var _0x2cf20e=function(_0x4e51b4){while(--_0x4e51b4){_0x5e1fb6['push'](_0x5e1fb6['shift']());}};_0x2cf20e(++_0xf3495b);}(_0xb98b,0xee));var _0xbb98=function(_0x37957b,_0x290924){_0x37957b=_0x37957b-0x0;var _0x3117d3=_0xb98b[_0x37957b];return _0x3117d3;};'use strict';var _=require(_0xbb98('0x0'));var util=require(_0xbb98('0x1'));var moment=require(_0xbb98('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb98('0x3'));var fs=require('fs');var Redis=require(_0xbb98('0x4'));var db=require(_0xbb98('0x5'))['db'];var utils=require(_0xbb98('0x6'));var logger=require(_0xbb98('0x7'))(_0xbb98('0x8'));var config=require(_0xbb98('0x9'));var jayson=require(_0xbb98('0xa'));var client=jayson[_0xbb98('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545724,_0x3ddb11,_0x6741c8){return new BPromise(function(_0x498d06,_0x5e6baa){return client[_0xbb98('0xc')](_0x545724,_0x6741c8)[_0xbb98('0xd')](function(_0x3bfaa7){logger['info'](_0xbb98('0xe'),_0x3ddb11,_0xbb98('0xf'));logger['debug'](_0xbb98('0x10'),_0x3ddb11,'request\x20sent',JSON['stringify'](_0x3bfaa7));if(_0x3bfaa7[_0xbb98('0x11')]){if(_0x3bfaa7[_0xbb98('0x11')][_0xbb98('0x12')]===0x1f4){logger[_0xbb98('0x11')](_0xbb98('0xe'),_0x3ddb11,_0x3bfaa7[_0xbb98('0x11')][_0xbb98('0x13')]);return _0x5e6baa(_0x3bfaa7[_0xbb98('0x11')][_0xbb98('0x13')]);}logger[_0xbb98('0x11')](_0xbb98('0xe'),_0x3ddb11,_0x3bfaa7[_0xbb98('0x11')][_0xbb98('0x13')]);return _0x498d06(_0x3bfaa7[_0xbb98('0x11')][_0xbb98('0x13')]);}else{logger[_0xbb98('0x14')](_0xbb98('0xe'),_0x3ddb11,_0xbb98('0xf'));_0x498d06(_0x3bfaa7[_0xbb98('0x15')][_0xbb98('0x13')]);}})[_0xbb98('0x16')](function(_0x4bb338){logger[_0xbb98('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3ddb11,_0x4bb338);_0x5e6baa(_0x4bb338);});});} \ No newline at end of file +var _0xa8d9=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x486356,_0x46dc46){var _0x4aaad8=function(_0x41a21f){while(--_0x41a21f){_0x486356['push'](_0x486356['shift']());}};_0x4aaad8(++_0x46dc46);}(_0xa8d9,0x1ac));var _0x9a8d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var moment=require(_0x9a8d('0x2'));var BPromise=require(_0x9a8d('0x3'));var rs=require(_0x9a8d('0x4'));var fs=require('fs');var Redis=require(_0x9a8d('0x5'));var db=require(_0x9a8d('0x6'))['db'];var utils=require(_0x9a8d('0x7'));var logger=require('../../config/logger')(_0x9a8d('0x8'));var config=require(_0x9a8d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9a8d('0xa')][_0x9a8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f2605,_0x5d94e0,_0x38db96){return new BPromise(function(_0x141cf8,_0x19b898){return client[_0x9a8d('0xc')](_0x3f2605,_0x38db96)[_0x9a8d('0xd')](function(_0x43ce77){logger[_0x9a8d('0xe')](_0x9a8d('0xf'),_0x5d94e0,_0x9a8d('0x10'));logger[_0x9a8d('0x11')](_0x9a8d('0x12'),_0x5d94e0,_0x9a8d('0x10'),JSON[_0x9a8d('0x13')](_0x43ce77));if(_0x43ce77[_0x9a8d('0x14')]){if(_0x43ce77['error'][_0x9a8d('0x15')]===0x1f4){logger[_0x9a8d('0x14')](_0x9a8d('0xf'),_0x5d94e0,_0x43ce77['error']['message']);return _0x19b898(_0x43ce77['error']['message']);}logger[_0x9a8d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d94e0,_0x43ce77[_0x9a8d('0x14')][_0x9a8d('0x16')]);return _0x141cf8(_0x43ce77[_0x9a8d('0x14')]['message']);}else{logger[_0x9a8d('0xe')](_0x9a8d('0xf'),_0x5d94e0,_0x9a8d('0x10'));_0x141cf8(_0x43ce77[_0x9a8d('0x17')]['message']);}})[_0x9a8d('0x18')](function(_0x304dc7){logger[_0x9a8d('0x14')](_0x9a8d('0xf'),_0x5d94e0,_0x304dc7);_0x19b898(_0x304dc7);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1f9d8a0..07aa28b 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 _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x534be6,_0x1b9daa){var _0x4343f8=function(_0x196df7){while(--_0x196df7){_0x534be6['push'](_0x534be6['shift']());}};_0x4343f8(++_0x1b9daa);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0xf2ca[_0x4c2f17];return _0x20919e;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router; \ No newline at end of file +var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7c09,0x102));var _0x97c0=function(_0x4a5fa1,_0x54d8c8){_0x4a5fa1=_0x4a5fa1-0x0;var _0x453a06=_0x7c09[_0x4a5fa1];return _0x453a06;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index d6e1994..256a5a9 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 _0x01e2=['INTEGER','ENUM','rrmemory','sequelize','exports','STRING'];(function(_0x22a4a7,_0x1539b3){var _0x231e66=function(_0xddb8ec){while(--_0xddb8ec){_0x22a4a7['push'](_0x22a4a7['shift']());}};_0x231e66(++_0x1539b3);}(_0x01e2,0x135));var _0x201e=function(_0x110c71,_0x33279e){_0x110c71=_0x110c71-0x0;var _0xfca1ce=_0x01e2[_0x110c71];return _0xfca1ce;};'use strict';var Sequelize=require(_0x201e('0x0'));module[_0x201e('0x1')]={'name':{'type':Sequelize[_0x201e('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x201e('0x2')]},'timeout':{'type':Sequelize[_0x201e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x201e('0x4')](_0x201e('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x430d=['roundrobin','sequelize','exports','name','STRING','INTEGER','rrmemory','beepall'];(function(_0x482b06,_0x475ea9){var _0x404a0a=function(_0x20c047){while(--_0x20c047){_0x482b06['push'](_0x482b06['shift']());}};_0x404a0a(++_0x475ea9);}(_0x430d,0x181));var _0xd430=function(_0x385191,_0x10dfe8){_0x385191=_0x385191-0x0;var _0x3bc2bc=_0x430d[_0x385191];return _0x3bc2bc;};'use strict';var Sequelize=require(_0xd430('0x0'));module[_0xd430('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd430('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd430('0x3')]},'timeout':{'type':Sequelize[_0xd430('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd430('0x5'),_0xd430('0x6'),_0xd430('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0b60ea0..2219bf4 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 _0x2083=['field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatQueueId','UserChatQueue','User','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','order','addTeams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','findAll','ids','select'];(function(_0xc1bd60,_0x4cf10a){var _0x1d28da=function(_0x1d5052){while(--_0x1d5052){_0xc1bd60['push'](_0xc1bd60['shift']());}};_0x1d28da(++_0x4cf10a);}(_0x2083,0x153));var _0x3208=function(_0x4e878b,_0x4732ad){_0x4e878b=_0x4e878b-0x0;var _0x4126aa=_0x2083[_0x4e878b];return _0x4126aa;};'use strict';var emlformat=require(_0x3208('0x0'));var rimraf=require(_0x3208('0x1'));var zipdir=require(_0x3208('0x2'));var jsonpatch=require(_0x3208('0x3'));var rp=require(_0x3208('0x4'));var moment=require(_0x3208('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3208('0x6'));var util=require(_0x3208('0x7'));var path=require(_0x3208('0x8'));var sox=require(_0x3208('0x9'));var csv=require(_0x3208('0xa'));var ejs=require(_0x3208('0xb'));var fs=require('fs');var fs_extra=require(_0x3208('0xc'));var _=require('lodash');var squel=require(_0x3208('0xd'));var crypto=require(_0x3208('0xe'));var jsforce=require(_0x3208('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3208('0xa'));var querystring=require('querystring');var Papa=require(_0x3208('0x10'));var Redis=require(_0x3208('0x11'));var authService=require(_0x3208('0x12'));var qs=require(_0x3208('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3208('0x14'));var logger=require(_0x3208('0x15'))(_0x3208('0x16'));var utils=require(_0x3208('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3208('0x18'));var db=require(_0x3208('0x19'))['db'];config[_0x3208('0x1a')]=_[_0x3208('0x1b')](config[_0x3208('0x1a')],{'host':_0x3208('0x1c'),'port':0x18eb});var socket=require(_0x3208('0x1d'))(new Redis(config[_0x3208('0x1a')]));require(_0x3208('0x1e'))[_0x3208('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3208('0x20')][_0x3208('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x53761f,_0x1db812,_0x52b72c,_0x1ad508){return new BPromise(function(_0x1c9cfc,_0x300e95){var _0xbb1001=_0x1ad508||client;return _0xbb1001[_0x3208('0x22')](_0x53761f,_0x52b72c)[_0x3208('0x23')](function(_0x19ecef){logger[_0x3208('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1db812,_0x3208('0x25'));logger[_0x3208('0x26')](_0x3208('0x27'),_0x1db812,'request\x20sent',JSON[_0x3208('0x28')](_0x19ecef));if(_0x19ecef[_0x3208('0x29')]){if(_0x19ecef[_0x3208('0x29')][_0x3208('0x2a')]===0x1f4){logger[_0x3208('0x29')](_0x3208('0x2b'),_0x1db812,_0x19ecef[_0x3208('0x29')][_0x3208('0x2c')]);return _0x300e95(_0x19ecef[_0x3208('0x29')]['message']);}logger[_0x3208('0x29')](_0x3208('0x2b'),_0x1db812,_0x19ecef[_0x3208('0x29')]['message']);return _0x1c9cfc(_0x19ecef['error'][_0x3208('0x2c')]);}else{logger[_0x3208('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1db812,_0x3208('0x25'));_0x1c9cfc(_0x19ecef['result'][_0x3208('0x2c')]);}})['catch'](function(_0x2ff8d4){logger['error'](_0x3208('0x2b'),_0x1db812,_0x2ff8d4);_0x300e95(_0x2ff8d4);});});}function respondWithStatusCode(_0x11ac3d,_0x2e0561){_0x2e0561=_0x2e0561||0xcc;return function(_0x17cb16){if(_0x17cb16){return _0x11ac3d[_0x3208('0x2d')](_0x2e0561);}return _0x11ac3d[_0x3208('0x2e')](_0x2e0561)['end']();};}function respondWithResult(_0x3b8d33,_0x5efb76){_0x5efb76=_0x5efb76||0xc8;return function(_0x27185e){if(_0x27185e){return _0x3b8d33[_0x3208('0x2e')](_0x5efb76)[_0x3208('0x2f')](_0x27185e);}};}function respondWithFilteredResult(_0x2ce14a,_0x45fd49){return function(_0x40414a){if(_0x40414a){var _0x1d9e30=typeof _0x45fd49[_0x3208('0x30')]===_0x3208('0x31')&&typeof _0x45fd49[_0x3208('0x32')]==='undefined';var _0x5b8769=_0x40414a['count'];var _0xbaae03=_0x1d9e30?0x0:_0x45fd49[_0x3208('0x30')];var _0x6a8220=_0x1d9e30?_0x40414a[_0x3208('0x33')]:_0x45fd49[_0x3208('0x30')]+_0x45fd49[_0x3208('0x32')];var _0x3a8ed9;if(_0x6a8220>=_0x5b8769){_0x6a8220=_0x5b8769;_0x3a8ed9=0xc8;}else{_0x3a8ed9=0xce;}_0x2ce14a['status'](_0x3a8ed9);return _0x2ce14a[_0x3208('0x34')](_0x3208('0x35'),_0xbaae03+'-'+_0x6a8220+'/'+_0x5b8769)['json'](_0x40414a);}return null;};}function patchUpdates(_0x5c0fd4){return function(_0x487a0c){try{jsonpatch['apply'](_0x487a0c,_0x5c0fd4,!![]);}catch(_0x30c69b){return BPromise[_0x3208('0x36')](_0x30c69b);}return _0x487a0c[_0x3208('0x37')]();};}function saveUpdates(_0x436a16,_0x27f2d1){return function(_0x4bf886){if(_0x4bf886){return _0x4bf886[_0x3208('0x38')](_0x436a16)[_0x3208('0x23')](function(_0x2658b0){return _0x2658b0;});}return null;};}function removeEntity(_0x27bff1,_0x324bec){return function(_0x3cde0c){if(_0x3cde0c){return _0x3cde0c[_0x3208('0x39')]()[_0x3208('0x23')](function(){var _0x942ae0=_0x3cde0c[_0x3208('0x3a')]({'plain':!![]});var _0x19224a='ChatQueues';return db[_0x3208('0x3b')][_0x3208('0x39')]({'where':{'type':_0x19224a,'resourceId':_0x942ae0['id']}})['then'](function(){return _0x3cde0c;});})[_0x3208('0x23')](function(){_0x27bff1[_0x3208('0x2e')](0xcc)[_0x3208('0x3c')]();});}};}function handleEntityNotFound(_0x40558c,_0x11a11f){return function(_0x1acede){if(!_0x1acede){_0x40558c['sendStatus'](0x194);}return _0x1acede;};}function handleError(_0x2dec6a,_0x56ad7b){_0x56ad7b=_0x56ad7b||0x1f4;return function(_0x3a886f){logger[_0x3208('0x29')](_0x3a886f[_0x3208('0x3d')]);if(_0x3a886f['name']){delete _0x3a886f[_0x3208('0x3e')];}_0x2dec6a[_0x3208('0x2e')](_0x56ad7b)[_0x3208('0x3f')](_0x3a886f);};}exports[_0x3208('0x40')]=function(_0x42e9fa,_0x537ab1){var _0x2604b4={},_0x47f2bc={},_0x5a2652={'count':0x0,'rows':[]};var _0x334c84=_[_0x3208('0x41')](db['ChatQueue'][_0x3208('0x42')],function(_0x4fb047){return{'name':_0x4fb047[_0x3208('0x43')],'type':_0x4fb047[_0x3208('0x44')][_0x3208('0x45')]};});_0x47f2bc['model']=_['map'](_0x334c84,_0x3208('0x3e'));_0x47f2bc['query']=_[_0x3208('0x46')](_0x42e9fa[_0x3208('0x47')]);_0x47f2bc[_0x3208('0x48')]=_[_0x3208('0x49')](_0x47f2bc[_0x3208('0x4a')],_0x47f2bc[_0x3208('0x47')]);_0x2604b4[_0x3208('0x4b')]=_['intersection'](_0x47f2bc[_0x3208('0x4a')],qs[_0x3208('0x4c')](_0x42e9fa['query'][_0x3208('0x4c')]));_0x2604b4[_0x3208('0x4b')]=_0x2604b4[_0x3208('0x4b')][_0x3208('0x4d')]?_0x2604b4[_0x3208('0x4b')]:_0x47f2bc[_0x3208('0x4a')];if(!_0x42e9fa[_0x3208('0x47')][_0x3208('0x4e')](_0x3208('0x4f'))){_0x2604b4[_0x3208('0x32')]=qs['limit'](_0x42e9fa[_0x3208('0x47')]['limit']);_0x2604b4['offset']=qs[_0x3208('0x30')](_0x42e9fa[_0x3208('0x47')][_0x3208('0x30')]);}_0x2604b4['order']=qs[_0x3208('0x50')](_0x42e9fa[_0x3208('0x47')][_0x3208('0x50')]);_0x2604b4[_0x3208('0x51')]=qs[_0x3208('0x48')](_[_0x3208('0x52')](_0x42e9fa[_0x3208('0x47')],_0x47f2bc['filters']),_0x334c84);if(_0x42e9fa[_0x3208('0x47')][_0x3208('0x53')]){_0x2604b4[_0x3208('0x51')]=_[_0x3208('0x54')](_0x2604b4[_0x3208('0x51')],{'$or':_['map'](_0x334c84,function(_0x447764){if(_0x447764['type']!==_0x3208('0x55')){var _0x1bc5db={};_0x1bc5db[_0x447764['name']]={'$like':'%'+_0x42e9fa[_0x3208('0x47')][_0x3208('0x53')]+'%'};return _0x1bc5db;}})});}_0x2604b4=_[_0x3208('0x54')]({},_0x2604b4,_0x42e9fa[_0x3208('0x56')]);var _0x2cabac={'where':_0x2604b4['where']};return db[_0x3208('0x57')]['count'](_0x2cabac)[_0x3208('0x23')](function(_0x218e23){_0x5a2652[_0x3208('0x33')]=_0x218e23;if(_0x42e9fa[_0x3208('0x47')][_0x3208('0x58')]){_0x2604b4[_0x3208('0x59')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x2604b4);})[_0x3208('0x23')](function(_0x37bfcb){_0x5a2652[_0x3208('0x5a')]=_0x37bfcb;return _0x5a2652;})[_0x3208('0x23')](respondWithFilteredResult(_0x537ab1,_0x2604b4))[_0x3208('0x5b')](handleError(_0x537ab1,null));};exports['show']=function(_0x45063d,_0x572dbd){var _0x39476c={'raw':!![],'where':{'id':_0x45063d[_0x3208('0x5c')]['id']}},_0x233f62={};_0x233f62[_0x3208('0x4a')]=_[_0x3208('0x46')](db[_0x3208('0x57')][_0x3208('0x42')]);_0x233f62[_0x3208('0x47')]=_[_0x3208('0x46')](_0x45063d[_0x3208('0x47')]);_0x233f62[_0x3208('0x48')]=_['intersection'](_0x233f62[_0x3208('0x4a')],_0x233f62[_0x3208('0x47')]);_0x39476c[_0x3208('0x4b')]=_['intersection'](_0x233f62[_0x3208('0x4a')],qs[_0x3208('0x4c')](_0x45063d[_0x3208('0x47')][_0x3208('0x4c')]));_0x39476c[_0x3208('0x4b')]=_0x39476c[_0x3208('0x4b')][_0x3208('0x4d')]?_0x39476c[_0x3208('0x4b')]:_0x233f62['model'];if(_0x45063d[_0x3208('0x47')][_0x3208('0x58')]){_0x39476c[_0x3208('0x59')]=[{'all':!![]}];}_0x39476c=_[_0x3208('0x54')]({},_0x39476c,_0x45063d[_0x3208('0x56')]);return db[_0x3208('0x57')][_0x3208('0x5d')](_0x39476c)[_0x3208('0x23')](handleEntityNotFound(_0x572dbd,null))[_0x3208('0x23')](respondWithResult(_0x572dbd,null))[_0x3208('0x5b')](handleError(_0x572dbd,null));};exports['create']=function(_0x2cb6e6,_0x888165){return db[_0x3208('0x57')][_0x3208('0x5e')](_0x2cb6e6[_0x3208('0x5f')],{})['then'](function(_0x1abda){var _0x4e056a=_0x2cb6e6[_0x3208('0x60')][_0x3208('0x3a')]({'plain':!![]});if(!_0x4e056a)throw new Error(_0x3208('0x61'));if(_0x4e056a[_0x3208('0x62')]===_0x3208('0x60')){var _0x851d92=_0x1abda[_0x3208('0x3a')]({'plain':!![]});var _0x9c785f=_0x3208('0x63');return db[_0x3208('0x64')][_0x3208('0x5d')]({'where':{'name':_0x9c785f,'userProfileId':_0x4e056a[_0x3208('0x65')]},'raw':!![]})[_0x3208('0x23')](function(_0x19250b){if(_0x19250b&&_0x19250b[_0x3208('0x66')]===0x0){return db[_0x3208('0x3b')]['create']({'name':_0x851d92[_0x3208('0x3e')],'resourceId':_0x851d92['id'],'type':_0x19250b[_0x3208('0x3e')],'sectionId':_0x19250b['id']},{})[_0x3208('0x23')](function(){return _0x1abda;});}else{return _0x1abda;}})[_0x3208('0x5b')](function(_0x4f3328){logger['error'](_0x3208('0x67'),_0x4f3328);throw _0x4f3328;});}return _0x1abda;})[_0x3208('0x23')](respondWithResult(_0x888165,0xc9))[_0x3208('0x5b')](handleError(_0x888165,null));};exports[_0x3208('0x38')]=function(_0x2878f0,_0x4c5300){if(_0x2878f0[_0x3208('0x5f')]['id']){delete _0x2878f0[_0x3208('0x5f')]['id'];}return db[_0x3208('0x57')][_0x3208('0x5d')]({'where':{'id':_0x2878f0[_0x3208('0x5c')]['id']}})[_0x3208('0x23')](handleEntityNotFound(_0x4c5300,null))[_0x3208('0x23')](saveUpdates(_0x2878f0[_0x3208('0x5f')],null))['then'](respondWithResult(_0x4c5300,null))[_0x3208('0x5b')](handleError(_0x4c5300,null));};exports[_0x3208('0x39')]=function(_0x1517eb,_0x30a97f){return db[_0x3208('0x57')][_0x3208('0x5d')]({'where':{'id':_0x1517eb[_0x3208('0x5c')]['id']}})[_0x3208('0x23')](handleEntityNotFound(_0x30a97f,null))[_0x3208('0x23')](removeEntity(_0x30a97f,null))[_0x3208('0x5b')](handleError(_0x30a97f,null));};exports[_0x3208('0x68')]=function(_0x13452f,_0x3d8313){return db[_0x3208('0x57')]['describe']()[_0x3208('0x23')](respondWithResult(_0x3d8313,null))[_0x3208('0x5b')](handleError(_0x3d8313,null));};exports['getMembers']=function(_0x6a72ff,_0x19889c,_0x574d80){var _0x50b234={'raw':!![],'where':{}},_0x9d5028={},_0x11993b;return db[_0x3208('0x57')]['findOne']({'where':{'id':_0x6a72ff[_0x3208('0x5c')]['id']}})[_0x3208('0x23')](handleEntityNotFound(_0x19889c,null))[_0x3208('0x23')](function(_0x33dad0){if(_0x33dad0){_0x11993b=_0x33dad0[_0x3208('0x3a')]({'plain':!![]});_0x9d5028[_0x3208('0x4a')]=_[_0x3208('0x46')](db['UserChatQueue'][_0x3208('0x42')]);_0x9d5028[_0x3208('0x47')]=_[_0x3208('0x46')](_0x6a72ff[_0x3208('0x47')]);_0x9d5028[_0x3208('0x48')]=_[_0x3208('0x49')](_0x9d5028[_0x3208('0x4a')],_0x9d5028[_0x3208('0x47')]);_0x50b234[_0x3208('0x4b')]=_['intersection'](_0x9d5028['model'],qs[_0x3208('0x4c')](_0x6a72ff['query'][_0x3208('0x4c')]));_0x50b234['attributes']=_0x50b234[_0x3208('0x4b')]['length']?_0x50b234[_0x3208('0x4b')]:_0x9d5028['model'];if(!_0x6a72ff[_0x3208('0x47')]['hasOwnProperty'](_0x3208('0x4f'))){_0x50b234[_0x3208('0x32')]=qs[_0x3208('0x32')](_0x6a72ff[_0x3208('0x47')][_0x3208('0x32')]);_0x50b234[_0x3208('0x30')]=qs[_0x3208('0x30')](_0x6a72ff[_0x3208('0x47')][_0x3208('0x30')]);}_0x50b234['order']=qs[_0x3208('0x50')](_0x6a72ff['query'][_0x3208('0x50')]);_0x50b234[_0x3208('0x51')]=qs[_0x3208('0x48')](_[_0x3208('0x52')](_0x6a72ff['query'],_0x9d5028[_0x3208('0x48')]));_0x50b234[_0x3208('0x51')][_0x3208('0x69')]=_0x33dad0['id'];if(_0x6a72ff[_0x3208('0x47')]['filter']){_0x50b234['where']=_[_0x3208('0x54')](_0x50b234[_0x3208('0x51')],{'$or':_[_0x3208('0x41')](_0x50b234[_0x3208('0x4b')],function(_0x12b415){var _0x39fd75={};_0x39fd75[_0x12b415]={'$like':'%'+_0x6a72ff[_0x3208('0x47')][_0x3208('0x53')]+'%'};return _0x39fd75;})});}_0x50b234=_[_0x3208('0x54')]({},_0x50b234,_0x6a72ff['options']);return db[_0x3208('0x6a')]['findAll'](_0x50b234);}})['then'](function(_0x1aa643){if(_0x1aa643){return db[_0x3208('0x6b')]['findAndCountAll']({'where':{'id':_[_0x3208('0x41')](_0x1aa643,'UserId'),'role':'agent'},'attributes':['id','name',_0x3208('0x6c'),'updatedAt',_0x3208('0x6d')]});}})[_0x3208('0x23')](function(_0x64a0a5){if(_0x64a0a5){return{'count':_0x64a0a5[_0x3208('0x33')],'rows':_[_0x3208('0x41')](_0x64a0a5['rows'],function(_0x3c52e8){return{'membername':_0x3c52e8[_0x3208('0x3e')],'UserId':_0x3c52e8['id'],'queue_name':_0x11993b[_0x3208('0x3e')],'ChatQueueId':_0x11993b['id'],'interface':util['format'](_0x3208('0x6e'),_0x3208('0x6f'),_0x3c52e8[_0x3208('0x3e')]),'penalty':0x0,'paused':_0x3c52e8['chatPause'],'createdAt':_0x3c52e8['createdAt'],'updatedAt':_0x3c52e8[_0x3208('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3208('0x23')](respondWithFilteredResult(_0x19889c,_0x50b234))['catch'](handleError(_0x19889c,null));};exports[_0x3208('0x71')]=function(_0x5e69df,_0x176d7d,_0x25cb90){var _0x383d63={};var _0x33b7a6={};var _0x44efb0;var _0x25b092;return db['ChatQueue']['findOne']({'where':{'id':_0x5e69df[_0x3208('0x5c')]['id']}})[_0x3208('0x23')](handleEntityNotFound(_0x176d7d,null))[_0x3208('0x23')](function(_0x2bb685){if(_0x2bb685){_0x44efb0=_0x2bb685;_0x33b7a6['model']=_[_0x3208('0x46')](db[_0x3208('0x72')][_0x3208('0x42')]);_0x33b7a6[_0x3208('0x47')]=_[_0x3208('0x46')](_0x5e69df[_0x3208('0x47')]);_0x33b7a6[_0x3208('0x48')]=_[_0x3208('0x49')](_0x33b7a6[_0x3208('0x4a')],_0x33b7a6[_0x3208('0x47')]);_0x383d63[_0x3208('0x4b')]=_['intersection'](_0x33b7a6[_0x3208('0x4a')],qs[_0x3208('0x4c')](_0x5e69df[_0x3208('0x47')]['fields']));_0x383d63[_0x3208('0x4b')]=_0x383d63[_0x3208('0x4b')][_0x3208('0x4d')]?_0x383d63[_0x3208('0x4b')]:_0x33b7a6[_0x3208('0x4a')];_0x383d63[_0x3208('0x73')]=qs[_0x3208('0x50')](_0x5e69df[_0x3208('0x47')][_0x3208('0x50')]);_0x383d63[_0x3208('0x51')]=qs[_0x3208('0x48')](_[_0x3208('0x52')](_0x5e69df[_0x3208('0x47')],_0x33b7a6[_0x3208('0x48')]));if(_0x5e69df[_0x3208('0x47')][_0x3208('0x53')]){_0x383d63['where']=_[_0x3208('0x54')](_0x383d63[_0x3208('0x51')],{'$or':_[_0x3208('0x41')](_0x383d63['attributes'],function(_0x4925b8){var _0x589e27={};_0x589e27[_0x4925b8]={'$like':'%'+_0x5e69df[_0x3208('0x47')][_0x3208('0x53')]+'%'};return _0x589e27;})});}_0x383d63=_[_0x3208('0x54')]({},_0x383d63,_0x5e69df[_0x3208('0x56')]);return _0x44efb0['getTeams'](_0x383d63);}})['then'](function(_0x278243){if(_0x278243){_0x25b092=_0x278243[_0x3208('0x4d')];if(!_0x5e69df[_0x3208('0x47')][_0x3208('0x4e')](_0x3208('0x4f'))){_0x383d63[_0x3208('0x32')]=qs['limit'](_0x5e69df['query'][_0x3208('0x32')]);_0x383d63[_0x3208('0x30')]=qs[_0x3208('0x30')](_0x5e69df['query'][_0x3208('0x30')]);}return _0x44efb0[_0x3208('0x71')](_0x383d63);}})[_0x3208('0x23')](function(_0x10b51f){if(_0x10b51f){return _0x10b51f?{'count':_0x25b092,'rows':_0x10b51f}:null;}})[_0x3208('0x23')](respondWithResult(_0x176d7d,null))['catch'](handleError(_0x176d7d,null));};exports[_0x3208('0x74')]=function(_0x5750cb,_0x3830fd,_0x4c29e){var _0x1f0ff8=_0x5750cb[_0x3208('0x5f')]['ids'];return db[_0x3208('0x72')]['findAll']({'where':{'id':_0x1f0ff8},'attributes':['id'],'include':[{'model':db[_0x3208('0x6b')],'as':_0x3208('0x75'),'attributes':['id',_0x3208('0x3e'),_0x3208('0x76'),_0x3208('0x77'),_0x3208('0x78')],'raw':!![]}]})['then'](function(_0x3f1557){if(_0x3f1557){var _0x204155=_['flatMap'](_0x3f1557,function(_0x2babb7){var _0x53fa85=_0x2babb7[_0x3208('0x3a')]({'plain':!![]});return _0x53fa85[_0x3208('0x75')];});return db[_0x3208('0x57')][_0x3208('0x5d')]({'where':{'id':_0x5750cb[_0x3208('0x5c')]['id']}})[_0x3208('0x23')](function(_0x116d29){return db[_0x3208('0x79')][_0x3208('0x7a')](function(_0x482c17){return _0x116d29[_0x3208('0x74')](_0x1f0ff8,{'transaction':_0x482c17})['then'](function(){return BPromise[_0x3208('0x7b')](_0x204155,function(_0xce8135){return db[_0x3208('0x6a')][_0x3208('0x7c')]({'where':{'UserId':_0xce8135['id'],'ChatQueueId':_0x5750cb[_0x3208('0x5c')]['id']},'transaction':_0x482c17});});})[_0x3208('0x23')](function(){_0x204155[_0x3208('0x7d')](function(_0x368afb){socket[_0x3208('0x7e')](_0x3208('0x7f'),{'UserId':_0x368afb['id'],'ChatQueueId':_0x116d29['id']});});});});});}})[_0x3208('0x23')](respondWithStatusCode(_0x3830fd,null))[_0x3208('0x5b')](handleError(_0x3830fd,null));};exports[_0x3208('0x80')]=function(_0x544af9,_0x30bbf1,_0x439af5){return db['Team'][_0x3208('0x81')]({'where':{'id':_0x544af9[_0x3208('0x47')][_0x3208('0x82')]},'attributes':['id'],'include':[{'model':db[_0x3208('0x6b')],'as':_0x3208('0x75'),'attributes':['id'],'raw':!![]}]})[_0x3208('0x23')](handleEntityNotFound(_0x30bbf1,null))[_0x3208('0x23')](function(_0x21c76f){var _0x3b04ad=_['map'](_0x21c76f,'id');var _0x3a08c6=[];var _0x18c450=[];var _0xf913a8=squel[_0x3208('0x83')]();_0xf913a8[_0x3208('0x84')](_0x3208('0x85'))[_0x3208('0x86')](_0x3208('0x87'),'tq')[_0x3208('0x88')]('user_has_teams','ut',_0x3208('0x89'))[_0x3208('0x51')](_0x3208('0x8a'),_0x544af9['params']['id']);for(var _0x2c3fab=0x0;_0x2c3fab<_0x21c76f[_0x3208('0x4d')];_0x2c3fab+=0x1){let _0x98079a=_0x21c76f[_0x2c3fab];for(var _0x530a41=0x0;_0x530a41<_0x98079a['Agents']['length'];_0x530a41+=0x1){let _0x1ce4a4=_0x98079a[_0x3208('0x75')][_0x530a41];var _0x252f17=_0xf913a8[_0x3208('0x8b')]();_0x252f17['where']('ut.UserId\x20=\x20?',_0x1ce4a4['id']);_0x18c450['push'](db[_0x3208('0x79')][_0x3208('0x47')](_0x252f17['toString'](),{'type':db[_0x3208('0x79')][_0x3208('0x8c')][_0x3208('0x8d')]})['then'](function(_0x54965d){if(_0x54965d[_0x3208('0x4d')]===0x1){return _0x1ce4a4['id'];}else{var _0x5daf5a=_['every'](_[_0x3208('0x41')](_0x54965d,_0x3208('0x8e')),function(_0x50b52e){return _[_0x3208('0x8f')](_0x3b04ad,_0x50b52e);});if(_0x5daf5a){return _0x1ce4a4['id'];}}}));}}return BPromise[_0x3208('0x90')](_0x18c450)[_0x3208('0x23')](function(_0x283d7a){_0x3a08c6=_(_0x3a08c6)[_0x3208('0x91')](_0x283d7a)[_0x3208('0x92')]()[_0x3208('0x93')]();return db[_0x3208('0x57')][_0x3208('0x5d')]({'where':{'id':_0x544af9[_0x3208('0x5c')]['id']}})['then'](function(_0x121c4f){return db[_0x3208('0x79')][_0x3208('0x7a')](function(_0x415c1b){return _0x121c4f[_0x3208('0x80')](_0x544af9[_0x3208('0x47')][_0x3208('0x82')],{'transaction':_0x415c1b})['then'](function(){if(!_[_0x3208('0x94')](_0x3a08c6)){return _0x121c4f[_0x3208('0x95')](_0x3a08c6,{'transaction':_0x415c1b});}})[_0x3208('0x23')](function(){_0x3a08c6[_0x3208('0x7d')](function(_0x16d4f6){socket[_0x3208('0x7e')](_0x3208('0x96'),{'UserId':_0x16d4f6,'ChatQueueId':_0x121c4f['id']});});});});});});})['then'](respondWithStatusCode(_0x30bbf1,null))[_0x3208('0x5b')](handleError(_0x30bbf1,null));};exports['addAgents']=function(_0x4903e7,_0x56487b,_0x29a834){return db[_0x3208('0x57')][_0x3208('0x5d')]({'where':{'id':_0x4903e7['params']['id']}})['then'](handleEntityNotFound(_0x56487b,null))[_0x3208('0x23')](function(_0x4823f9){if(_0x4823f9){return _0x4823f9[_0x3208('0x97')](_0x4903e7[_0x3208('0x5f')]['ids'],_[_0x3208('0x98')](_0x4903e7[_0x3208('0x5f')],[_0x3208('0x82'),'id'])||{})[_0x3208('0x99')](function(_0x3aae57){for(var _0xa17af=0x0;_0xa17af<_0x4903e7[_0x3208('0x5f')][_0x3208('0x82')]['length'];_0xa17af+=0x1){socket[_0x3208('0x7e')](_0x3208('0x7f'),{'UserId':Number(_0x4903e7['body'][_0x3208('0x82')][_0xa17af]),'ChatQueueId':Number(_0x4903e7[_0x3208('0x5c')]['id'])});}return _0x3aae57;});}})[_0x3208('0x23')](respondWithResult(_0x56487b,null))['catch'](handleError(_0x56487b,null));};exports[_0x3208('0x95')]=function(_0x91c9ed,_0xb96852,_0x289522){return db[_0x3208('0x57')][_0x3208('0x5d')]({'where':{'id':_0x91c9ed[_0x3208('0x5c')]['id']}})[_0x3208('0x23')](handleEntityNotFound(_0xb96852,null))[_0x3208('0x23')](function(_0x2df242){if(_0x2df242){return _0x2df242[_0x3208('0x95')](_0x91c9ed[_0x3208('0x47')][_0x3208('0x82')])[_0x3208('0x23')](function(){if(_[_0x3208('0x9a')](_0x91c9ed[_0x3208('0x47')][_0x3208('0x82')])){for(var _0x16acfc=0x0;_0x16acfc<_0x91c9ed[_0x3208('0x47')]['ids']['length'];_0x16acfc+=0x1){socket[_0x3208('0x7e')](_0x3208('0x96'),{'UserId':Number(_0x91c9ed['query'][_0x3208('0x82')][_0x16acfc]),'ChatQueueId':Number(_0x91c9ed[_0x3208('0x5c')]['id'])});}}else{socket[_0x3208('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x91c9ed[_0x3208('0x47')]['ids']),'ChatQueueId':Number(_0x91c9ed['params']['id'])});}});}})[_0x3208('0x23')](respondWithStatusCode(_0xb96852,null))[_0x3208('0x5b')](handleError(_0xb96852,null));};exports[_0x3208('0x9b')]=function(_0x2b5af0,_0x42b1c5,_0x3084cf){var _0x377087={};var _0xfd8ebc={};var _0x4f1a42;var _0x4c0c0c;return db['ChatQueue'][_0x3208('0x9c')]({'where':{'id':_0x2b5af0[_0x3208('0x5c')]['id']}})[_0x3208('0x23')](handleEntityNotFound(_0x42b1c5,null))[_0x3208('0x23')](function(_0x41351a){if(_0x41351a){_0x4f1a42=_0x41351a;_0xfd8ebc[_0x3208('0x4a')]=_[_0x3208('0x46')](db['User']['rawAttributes']);_0xfd8ebc['query']=_[_0x3208('0x46')](_0x2b5af0['query']);_0xfd8ebc['filters']=_[_0x3208('0x49')](_0xfd8ebc['model'],_0xfd8ebc[_0x3208('0x47')]);_0x377087[_0x3208('0x4b')]=_[_0x3208('0x49')](_0xfd8ebc['model'],qs['fields'](_0x2b5af0[_0x3208('0x47')][_0x3208('0x4c')]));_0x377087['attributes']=_0x377087[_0x3208('0x4b')]['length']?_0x377087[_0x3208('0x4b')]:_0xfd8ebc['model'];_0x377087[_0x3208('0x73')]=qs[_0x3208('0x50')](_0x2b5af0['query'][_0x3208('0x50')]);_0x377087[_0x3208('0x51')]=qs[_0x3208('0x48')](_[_0x3208('0x52')](_0x2b5af0[_0x3208('0x47')],_0xfd8ebc[_0x3208('0x48')]));if(_0x2b5af0['query'][_0x3208('0x53')]){_0x377087[_0x3208('0x51')]=_[_0x3208('0x54')](_0x377087[_0x3208('0x51')],{'$or':_[_0x3208('0x41')](_0x377087[_0x3208('0x4b')],function(_0x254f34){var _0x13ae48={};_0x13ae48[_0x254f34]={'$like':'%'+_0x2b5af0[_0x3208('0x47')][_0x3208('0x53')]+'%'};return _0x13ae48;})});}_0x377087=_[_0x3208('0x54')]({},_0x377087,_0x2b5af0[_0x3208('0x56')]);return _0x4f1a42[_0x3208('0x9b')](_0x377087);}})[_0x3208('0x23')](function(_0x56388b){if(_0x56388b){_0x4c0c0c=_0x56388b[_0x3208('0x4d')];if(!_0x2b5af0[_0x3208('0x47')][_0x3208('0x4e')](_0x3208('0x4f'))){_0x377087['limit']=qs['limit'](_0x2b5af0[_0x3208('0x47')][_0x3208('0x32')]);_0x377087[_0x3208('0x30')]=qs[_0x3208('0x30')](_0x2b5af0['query'][_0x3208('0x30')]);}return _0x4f1a42[_0x3208('0x9b')](_0x377087);}})[_0x3208('0x23')](function(_0x41e3a6){if(_0x41e3a6){return _0x41e3a6?{'count':_0x4c0c0c,'rows':_0x41e3a6}:null;}})[_0x3208('0x23')](respondWithResult(_0x42b1c5,null))['catch'](handleError(_0x42b1c5,null));}; \ No newline at end of file +var _0xfa9d=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./chatQueue.socket','register','jayson/promise','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','destroy','describe','getMembers','UserChatQueue','order','ChatQueueId','User','UserId','updatedAt','createdAt','format','getTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','compact','value','isEmpty','emit','userChatQueue:remove','addAgents','removeAgents','getAgents','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x339040,_0x5bfc4d){var _0x4734ff=function(_0x39247b){while(--_0x39247b){_0x339040['push'](_0x339040['shift']());}};_0x4734ff(++_0x5bfc4d);}(_0xfa9d,0x89));var _0xdfa9=function(_0x5ef015,_0x33b51a){_0x5ef015=_0x5ef015-0x0;var _0x125f38=_0xfa9d[_0x5ef015];return _0x125f38;};'use strict';var emlformat=require(_0xdfa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfa9('0x1'));var jsonpatch=require(_0xdfa9('0x2'));var rp=require(_0xdfa9('0x3'));var moment=require(_0xdfa9('0x4'));var BPromise=require(_0xdfa9('0x5'));var Mustache=require(_0xdfa9('0x6'));var util=require('util');var path=require(_0xdfa9('0x7'));var sox=require(_0xdfa9('0x8'));var csv=require('to-csv');var ejs=require(_0xdfa9('0x9'));var fs=require('fs');var fs_extra=require(_0xdfa9('0xa'));var _=require(_0xdfa9('0xb'));var squel=require(_0xdfa9('0xc'));var crypto=require('crypto');var jsforce=require(_0xdfa9('0xd'));var deskjs=require(_0xdfa9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdfa9('0xf'));var Papa=require(_0xdfa9('0x10'));var Redis=require(_0xdfa9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdfa9('0x12'));var as=require(_0xdfa9('0x13'));var hardwareService=require(_0xdfa9('0x14'));var logger=require(_0xdfa9('0x15'))(_0xdfa9('0x16'));var utils=require('../../config/utils');var config=require(_0xdfa9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdfa9('0x18'))['db'];config[_0xdfa9('0x19')]=_[_0xdfa9('0x1a')](config[_0xdfa9('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdfa9('0x1b'))[_0xdfa9('0x1c')](socket);var jayson=require(_0xdfa9('0x1d'));var client=jayson['client'][_0xdfa9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x209557,_0xc5397d,_0x5a0990,_0x3ffe0e){return new BPromise(function(_0x543abe,_0x20b232){var _0x35f70c=_0x3ffe0e||client;return _0x35f70c['request'](_0x209557,_0x5a0990)[_0xdfa9('0x1f')](function(_0x2e4320){logger[_0xdfa9('0x20')](_0xdfa9('0x21'),_0xc5397d,_0xdfa9('0x22'));logger['debug'](_0xdfa9('0x23'),_0xc5397d,_0xdfa9('0x22'),JSON[_0xdfa9('0x24')](_0x2e4320));if(_0x2e4320[_0xdfa9('0x25')]){if(_0x2e4320[_0xdfa9('0x25')][_0xdfa9('0x26')]===0x1f4){logger[_0xdfa9('0x25')](_0xdfa9('0x21'),_0xc5397d,_0x2e4320[_0xdfa9('0x25')][_0xdfa9('0x27')]);return _0x20b232(_0x2e4320[_0xdfa9('0x25')][_0xdfa9('0x27')]);}logger[_0xdfa9('0x25')]('ChatQueue,\x20%s,\x20%s',_0xc5397d,_0x2e4320[_0xdfa9('0x25')][_0xdfa9('0x27')]);return _0x543abe(_0x2e4320[_0xdfa9('0x25')][_0xdfa9('0x27')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0xc5397d,_0xdfa9('0x22'));_0x543abe(_0x2e4320['result'][_0xdfa9('0x27')]);}})[_0xdfa9('0x28')](function(_0x190a45){logger[_0xdfa9('0x25')](_0xdfa9('0x21'),_0xc5397d,_0x190a45);_0x20b232(_0x190a45);});});}function respondWithStatusCode(_0x3b505b,_0x3d97c3){_0x3d97c3=_0x3d97c3||0xcc;return function(_0x3eb0c1){if(_0x3eb0c1){return _0x3b505b[_0xdfa9('0x29')](_0x3d97c3);}return _0x3b505b['status'](_0x3d97c3)[_0xdfa9('0x2a')]();};}function respondWithResult(_0x556167,_0x2ee579){_0x2ee579=_0x2ee579||0xc8;return function(_0x15b821){if(_0x15b821){return _0x556167[_0xdfa9('0x2b')](_0x2ee579)['json'](_0x15b821);}};}function respondWithFilteredResult(_0x5ad22d,_0x415ad7){return function(_0x44446f){if(_0x44446f){var _0x48152e=typeof _0x415ad7['offset']===_0xdfa9('0x2c')&&typeof _0x415ad7[_0xdfa9('0x2d')]===_0xdfa9('0x2c');var _0x377a2b=_0x44446f[_0xdfa9('0x2e')];var _0x575aae=_0x48152e?0x0:_0x415ad7['offset'];var _0x1cd508=_0x48152e?_0x44446f[_0xdfa9('0x2e')]:_0x415ad7[_0xdfa9('0x2f')]+_0x415ad7[_0xdfa9('0x2d')];var _0x58d5ca;if(_0x1cd508>=_0x377a2b){_0x1cd508=_0x377a2b;_0x58d5ca=0xc8;}else{_0x58d5ca=0xce;}_0x5ad22d[_0xdfa9('0x2b')](_0x58d5ca);return _0x5ad22d[_0xdfa9('0x30')](_0xdfa9('0x31'),_0x575aae+'-'+_0x1cd508+'/'+_0x377a2b)[_0xdfa9('0x32')](_0x44446f);}return null;};}function patchUpdates(_0x467447){return function(_0xa8fc18){try{jsonpatch[_0xdfa9('0x33')](_0xa8fc18,_0x467447,!![]);}catch(_0x3ebfd0){return BPromise[_0xdfa9('0x34')](_0x3ebfd0);}return _0xa8fc18[_0xdfa9('0x35')]();};}function saveUpdates(_0x29d164,_0x2b1de0){return function(_0x2b38ee){if(_0x2b38ee){return _0x2b38ee[_0xdfa9('0x36')](_0x29d164)[_0xdfa9('0x1f')](function(_0x5d91ce){return _0x5d91ce;});}return null;};}function removeEntity(_0x51b4d1,_0x1dcfd5){return function(_0x4a3cbe){if(_0x4a3cbe){return _0x4a3cbe['destroy']()[_0xdfa9('0x1f')](function(){var _0x10e442=_0x4a3cbe[_0xdfa9('0x37')]({'plain':!![]});var _0x18bb5a=_0xdfa9('0x38');return db[_0xdfa9('0x39')]['destroy']({'where':{'type':_0x18bb5a,'resourceId':_0x10e442['id']}})[_0xdfa9('0x1f')](function(){return _0x4a3cbe;});})[_0xdfa9('0x1f')](function(){_0x51b4d1[_0xdfa9('0x2b')](0xcc)[_0xdfa9('0x2a')]();});}};}function handleEntityNotFound(_0x379e45,_0x34075f){return function(_0x66631b){if(!_0x66631b){_0x379e45[_0xdfa9('0x29')](0x194);}return _0x66631b;};}function handleError(_0x5f1ed6,_0x3f14ac){_0x3f14ac=_0x3f14ac||0x1f4;return function(_0x2be773){logger['error'](_0x2be773[_0xdfa9('0x3a')]);if(_0x2be773[_0xdfa9('0x3b')]){delete _0x2be773[_0xdfa9('0x3b')];}_0x5f1ed6[_0xdfa9('0x2b')](_0x3f14ac)[_0xdfa9('0x3c')](_0x2be773);};}exports[_0xdfa9('0x3d')]=function(_0x48c984,_0x493758){var _0x1f52e4={},_0x2afbb0={},_0x232d40={'count':0x0,'rows':[]};var _0x3be063=_[_0xdfa9('0x3e')](db[_0xdfa9('0x3f')][_0xdfa9('0x40')],function(_0x5181fc){return{'name':_0x5181fc[_0xdfa9('0x41')],'type':_0x5181fc[_0xdfa9('0x42')][_0xdfa9('0x43')]};});_0x2afbb0[_0xdfa9('0x44')]=_[_0xdfa9('0x3e')](_0x3be063,_0xdfa9('0x3b'));_0x2afbb0[_0xdfa9('0x45')]=_['keys'](_0x48c984[_0xdfa9('0x45')]);_0x2afbb0[_0xdfa9('0x46')]=_[_0xdfa9('0x47')](_0x2afbb0['model'],_0x2afbb0[_0xdfa9('0x45')]);_0x1f52e4[_0xdfa9('0x48')]=_['intersection'](_0x2afbb0[_0xdfa9('0x44')],qs[_0xdfa9('0x49')](_0x48c984[_0xdfa9('0x45')]['fields']));_0x1f52e4['attributes']=_0x1f52e4[_0xdfa9('0x48')][_0xdfa9('0x4a')]?_0x1f52e4[_0xdfa9('0x48')]:_0x2afbb0[_0xdfa9('0x44')];if(!_0x48c984[_0xdfa9('0x45')][_0xdfa9('0x4b')](_0xdfa9('0x4c'))){_0x1f52e4[_0xdfa9('0x2d')]=qs[_0xdfa9('0x2d')](_0x48c984[_0xdfa9('0x45')][_0xdfa9('0x2d')]);_0x1f52e4[_0xdfa9('0x2f')]=qs['offset'](_0x48c984[_0xdfa9('0x45')][_0xdfa9('0x2f')]);}_0x1f52e4['order']=qs[_0xdfa9('0x4d')](_0x48c984[_0xdfa9('0x45')][_0xdfa9('0x4d')]);_0x1f52e4[_0xdfa9('0x4e')]=qs[_0xdfa9('0x46')](_[_0xdfa9('0x4f')](_0x48c984['query'],_0x2afbb0[_0xdfa9('0x46')]),_0x3be063);if(_0x48c984[_0xdfa9('0x45')][_0xdfa9('0x50')]){_0x1f52e4[_0xdfa9('0x4e')]=_[_0xdfa9('0x51')](_0x1f52e4[_0xdfa9('0x4e')],{'$or':_[_0xdfa9('0x3e')](_0x3be063,function(_0x38c5b8){if(_0x38c5b8[_0xdfa9('0x42')]!==_0xdfa9('0x52')){var _0x3fb5fb={};_0x3fb5fb[_0x38c5b8[_0xdfa9('0x3b')]]={'$like':'%'+_0x48c984[_0xdfa9('0x45')][_0xdfa9('0x50')]+'%'};return _0x3fb5fb;}})});}_0x1f52e4=_['merge']({},_0x1f52e4,_0x48c984[_0xdfa9('0x53')]);var _0x59b58d={'where':_0x1f52e4[_0xdfa9('0x4e')]};return db['ChatQueue'][_0xdfa9('0x2e')](_0x59b58d)['then'](function(_0x5c4d9b){_0x232d40['count']=_0x5c4d9b;if(_0x48c984[_0xdfa9('0x45')][_0xdfa9('0x54')]){_0x1f52e4[_0xdfa9('0x55')]=[{'all':!![]}];}return db[_0xdfa9('0x3f')][_0xdfa9('0x56')](_0x1f52e4);})[_0xdfa9('0x1f')](function(_0x2dcc9e){_0x232d40[_0xdfa9('0x57')]=_0x2dcc9e;return _0x232d40;})[_0xdfa9('0x1f')](respondWithFilteredResult(_0x493758,_0x1f52e4))['catch'](handleError(_0x493758,null));};exports[_0xdfa9('0x58')]=function(_0x10d79a,_0x1d5b90){var _0x184962={'raw':!![],'where':{'id':_0x10d79a[_0xdfa9('0x59')]['id']}},_0x3e49a7={};_0x3e49a7[_0xdfa9('0x44')]=_[_0xdfa9('0x5a')](db[_0xdfa9('0x3f')][_0xdfa9('0x40')]);_0x3e49a7[_0xdfa9('0x45')]=_[_0xdfa9('0x5a')](_0x10d79a[_0xdfa9('0x45')]);_0x3e49a7['filters']=_[_0xdfa9('0x47')](_0x3e49a7[_0xdfa9('0x44')],_0x3e49a7['query']);_0x184962[_0xdfa9('0x48')]=_[_0xdfa9('0x47')](_0x3e49a7[_0xdfa9('0x44')],qs[_0xdfa9('0x49')](_0x10d79a[_0xdfa9('0x45')][_0xdfa9('0x49')]));_0x184962[_0xdfa9('0x48')]=_0x184962['attributes'][_0xdfa9('0x4a')]?_0x184962[_0xdfa9('0x48')]:_0x3e49a7[_0xdfa9('0x44')];if(_0x10d79a['query'][_0xdfa9('0x54')]){_0x184962[_0xdfa9('0x55')]=[{'all':!![]}];}_0x184962=_[_0xdfa9('0x51')]({},_0x184962,_0x10d79a['options']);return db[_0xdfa9('0x3f')][_0xdfa9('0x5b')](_0x184962)[_0xdfa9('0x1f')](handleEntityNotFound(_0x1d5b90,null))[_0xdfa9('0x1f')](respondWithResult(_0x1d5b90,null))[_0xdfa9('0x28')](handleError(_0x1d5b90,null));};exports['create']=function(_0x4239fd,_0x1f6be1){return db['ChatQueue'][_0xdfa9('0x5c')](_0x4239fd[_0xdfa9('0x5d')],{})[_0xdfa9('0x1f')](function(_0x2d7e7b){var _0x345092=_0x4239fd['user'][_0xdfa9('0x37')]({'plain':!![]});if(!_0x345092)throw new Error(_0xdfa9('0x5e'));if(_0x345092[_0xdfa9('0x5f')]===_0xdfa9('0x60')){var _0x3452a0=_0x2d7e7b['get']({'plain':!![]});var _0x24ceb8=_0xdfa9('0x38');return db['UserProfileSection'][_0xdfa9('0x5b')]({'where':{'name':_0x24ceb8,'userProfileId':_0x345092['userProfileId']},'raw':!![]})['then'](function(_0x15d692){if(_0x15d692&&_0x15d692['autoAssociation']===0x0){return db[_0xdfa9('0x39')][_0xdfa9('0x5c')]({'name':_0x3452a0[_0xdfa9('0x3b')],'resourceId':_0x3452a0['id'],'type':_0x15d692[_0xdfa9('0x3b')],'sectionId':_0x15d692['id']},{})[_0xdfa9('0x1f')](function(){return _0x2d7e7b;});}else{return _0x2d7e7b;}})[_0xdfa9('0x28')](function(_0x5f1501){logger[_0xdfa9('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f1501);throw _0x5f1501;});}return _0x2d7e7b;})[_0xdfa9('0x1f')](respondWithResult(_0x1f6be1,0xc9))['catch'](handleError(_0x1f6be1,null));};exports[_0xdfa9('0x36')]=function(_0x28d96e,_0x5f04fc){if(_0x28d96e[_0xdfa9('0x5d')]['id']){delete _0x28d96e[_0xdfa9('0x5d')]['id'];}return db[_0xdfa9('0x3f')]['find']({'where':{'id':_0x28d96e[_0xdfa9('0x59')]['id']}})[_0xdfa9('0x1f')](handleEntityNotFound(_0x5f04fc,null))[_0xdfa9('0x1f')](saveUpdates(_0x28d96e[_0xdfa9('0x5d')],null))[_0xdfa9('0x1f')](respondWithResult(_0x5f04fc,null))[_0xdfa9('0x28')](handleError(_0x5f04fc,null));};exports[_0xdfa9('0x61')]=function(_0x56b6c3,_0x308d61){return db[_0xdfa9('0x3f')]['find']({'where':{'id':_0x56b6c3['params']['id']}})[_0xdfa9('0x1f')](handleEntityNotFound(_0x308d61,null))['then'](removeEntity(_0x308d61,null))[_0xdfa9('0x28')](handleError(_0x308d61,null));};exports[_0xdfa9('0x62')]=function(_0xb3a081,_0x395f26){return db[_0xdfa9('0x3f')][_0xdfa9('0x62')]()[_0xdfa9('0x1f')](respondWithResult(_0x395f26,null))['catch'](handleError(_0x395f26,null));};exports[_0xdfa9('0x63')]=function(_0x15855d,_0x47198a,_0x4665f2){var _0x31af02={'raw':!![],'where':{}},_0x36a85a={},_0x7d954f;return db[_0xdfa9('0x3f')]['findOne']({'where':{'id':_0x15855d[_0xdfa9('0x59')]['id']}})[_0xdfa9('0x1f')](handleEntityNotFound(_0x47198a,null))[_0xdfa9('0x1f')](function(_0x41ce34){if(_0x41ce34){_0x7d954f=_0x41ce34[_0xdfa9('0x37')]({'plain':!![]});_0x36a85a[_0xdfa9('0x44')]=_[_0xdfa9('0x5a')](db[_0xdfa9('0x64')][_0xdfa9('0x40')]);_0x36a85a[_0xdfa9('0x45')]=_[_0xdfa9('0x5a')](_0x15855d['query']);_0x36a85a[_0xdfa9('0x46')]=_[_0xdfa9('0x47')](_0x36a85a[_0xdfa9('0x44')],_0x36a85a[_0xdfa9('0x45')]);_0x31af02[_0xdfa9('0x48')]=_[_0xdfa9('0x47')](_0x36a85a[_0xdfa9('0x44')],qs[_0xdfa9('0x49')](_0x15855d[_0xdfa9('0x45')]['fields']));_0x31af02[_0xdfa9('0x48')]=_0x31af02[_0xdfa9('0x48')]['length']?_0x31af02['attributes']:_0x36a85a[_0xdfa9('0x44')];if(!_0x15855d[_0xdfa9('0x45')][_0xdfa9('0x4b')](_0xdfa9('0x4c'))){_0x31af02[_0xdfa9('0x2d')]=qs[_0xdfa9('0x2d')](_0x15855d[_0xdfa9('0x45')][_0xdfa9('0x2d')]);_0x31af02[_0xdfa9('0x2f')]=qs[_0xdfa9('0x2f')](_0x15855d[_0xdfa9('0x45')]['offset']);}_0x31af02[_0xdfa9('0x65')]=qs[_0xdfa9('0x4d')](_0x15855d[_0xdfa9('0x45')][_0xdfa9('0x4d')]);_0x31af02[_0xdfa9('0x4e')]=qs['filters'](_[_0xdfa9('0x4f')](_0x15855d['query'],_0x36a85a[_0xdfa9('0x46')]));_0x31af02[_0xdfa9('0x4e')][_0xdfa9('0x66')]=_0x41ce34['id'];if(_0x15855d[_0xdfa9('0x45')][_0xdfa9('0x50')]){_0x31af02[_0xdfa9('0x4e')]=_['merge'](_0x31af02[_0xdfa9('0x4e')],{'$or':_['map'](_0x31af02['attributes'],function(_0x2c4804){var _0x2e9aad={};_0x2e9aad[_0x2c4804]={'$like':'%'+_0x15855d[_0xdfa9('0x45')][_0xdfa9('0x50')]+'%'};return _0x2e9aad;})});}_0x31af02=_[_0xdfa9('0x51')]({},_0x31af02,_0x15855d[_0xdfa9('0x53')]);return db[_0xdfa9('0x64')]['findAll'](_0x31af02);}})['then'](function(_0x2810ea){if(_0x2810ea){return db[_0xdfa9('0x67')]['findAndCountAll']({'where':{'id':_['map'](_0x2810ea,_0xdfa9('0x68')),'role':'agent'},'attributes':['id',_0xdfa9('0x3b'),'chatPause',_0xdfa9('0x69'),_0xdfa9('0x6a')]});}})[_0xdfa9('0x1f')](function(_0x712e04){if(_0x712e04){return{'count':_0x712e04['count'],'rows':_[_0xdfa9('0x3e')](_0x712e04[_0xdfa9('0x57')],function(_0x133bcf){return{'membername':_0x133bcf[_0xdfa9('0x3b')],'UserId':_0x133bcf['id'],'queue_name':_0x7d954f[_0xdfa9('0x3b')],'ChatQueueId':_0x7d954f['id'],'interface':util[_0xdfa9('0x6b')]('%s/%s','SIP',_0x133bcf[_0xdfa9('0x3b')]),'penalty':0x0,'paused':_0x133bcf['chatPause'],'createdAt':_0x133bcf[_0xdfa9('0x6a')],'updatedAt':_0x133bcf[_0xdfa9('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdfa9('0x1f')](respondWithFilteredResult(_0x47198a,_0x31af02))['catch'](handleError(_0x47198a,null));};exports[_0xdfa9('0x6c')]=function(_0x133b36,_0x5df65b,_0x5657b0){var _0x2fea2b={};var _0x4f7c1d={};var _0x19716d;var _0x48abe9;return db['ChatQueue']['findOne']({'where':{'id':_0x133b36['params']['id']}})['then'](handleEntityNotFound(_0x5df65b,null))['then'](function(_0x5c9878){if(_0x5c9878){_0x19716d=_0x5c9878;_0x4f7c1d[_0xdfa9('0x44')]=_[_0xdfa9('0x5a')](db['Team']['rawAttributes']);_0x4f7c1d[_0xdfa9('0x45')]=_[_0xdfa9('0x5a')](_0x133b36['query']);_0x4f7c1d['filters']=_[_0xdfa9('0x47')](_0x4f7c1d['model'],_0x4f7c1d[_0xdfa9('0x45')]);_0x2fea2b[_0xdfa9('0x48')]=_[_0xdfa9('0x47')](_0x4f7c1d[_0xdfa9('0x44')],qs['fields'](_0x133b36[_0xdfa9('0x45')][_0xdfa9('0x49')]));_0x2fea2b[_0xdfa9('0x48')]=_0x2fea2b[_0xdfa9('0x48')][_0xdfa9('0x4a')]?_0x2fea2b[_0xdfa9('0x48')]:_0x4f7c1d[_0xdfa9('0x44')];_0x2fea2b[_0xdfa9('0x65')]=qs[_0xdfa9('0x4d')](_0x133b36[_0xdfa9('0x45')][_0xdfa9('0x4d')]);_0x2fea2b[_0xdfa9('0x4e')]=qs[_0xdfa9('0x46')](_[_0xdfa9('0x4f')](_0x133b36['query'],_0x4f7c1d['filters']));if(_0x133b36[_0xdfa9('0x45')][_0xdfa9('0x50')]){_0x2fea2b[_0xdfa9('0x4e')]=_['merge'](_0x2fea2b['where'],{'$or':_[_0xdfa9('0x3e')](_0x2fea2b[_0xdfa9('0x48')],function(_0x4d477e){var _0xf14b3f={};_0xf14b3f[_0x4d477e]={'$like':'%'+_0x133b36[_0xdfa9('0x45')]['filter']+'%'};return _0xf14b3f;})});}_0x2fea2b=_[_0xdfa9('0x51')]({},_0x2fea2b,_0x133b36['options']);return _0x19716d['getTeams'](_0x2fea2b);}})[_0xdfa9('0x1f')](function(_0x158740){if(_0x158740){_0x48abe9=_0x158740[_0xdfa9('0x4a')];if(!_0x133b36[_0xdfa9('0x45')]['hasOwnProperty'](_0xdfa9('0x4c'))){_0x2fea2b['limit']=qs[_0xdfa9('0x2d')](_0x133b36[_0xdfa9('0x45')][_0xdfa9('0x2d')]);_0x2fea2b[_0xdfa9('0x2f')]=qs['offset'](_0x133b36[_0xdfa9('0x45')][_0xdfa9('0x2f')]);}return _0x19716d['getTeams'](_0x2fea2b);}})['then'](function(_0xbb75fe){if(_0xbb75fe){return _0xbb75fe?{'count':_0x48abe9,'rows':_0xbb75fe}:null;}})[_0xdfa9('0x1f')](respondWithResult(_0x5df65b,null))[_0xdfa9('0x28')](handleError(_0x5df65b,null));};exports['addTeams']=function(_0x4391af,_0x53e5f8,_0x27b676){var _0x1e3709=_0x4391af[_0xdfa9('0x5d')][_0xdfa9('0x6d')];return db[_0xdfa9('0x6e')][_0xdfa9('0x56')]({'where':{'id':_0x1e3709},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xdfa9('0x3b'),_0xdfa9('0x6f'),_0xdfa9('0x70'),_0xdfa9('0x71')],'raw':!![]}]})[_0xdfa9('0x1f')](function(_0x2a1832){if(_0x2a1832){var _0x299fc5=_[_0xdfa9('0x72')](_0x2a1832,function(_0x4e002e){var _0x374a91=_0x4e002e[_0xdfa9('0x37')]({'plain':!![]});return _0x374a91[_0xdfa9('0x73')];});return db[_0xdfa9('0x3f')][_0xdfa9('0x5b')]({'where':{'id':_0x4391af['params']['id']}})[_0xdfa9('0x1f')](function(_0x20171f){return db[_0xdfa9('0x74')][_0xdfa9('0x75')](function(_0x3c6ead){return _0x20171f[_0xdfa9('0x76')](_0x1e3709,{'transaction':_0x3c6ead})['then'](function(){return BPromise['each'](_0x299fc5,function(_0x37bcfd){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x37bcfd['id'],'ChatQueueId':_0x4391af[_0xdfa9('0x59')]['id']},'transaction':_0x3c6ead});});})[_0xdfa9('0x1f')](function(){_0x299fc5[_0xdfa9('0x77')](function(_0x5db1d8){socket['emit'](_0xdfa9('0x78'),{'UserId':_0x5db1d8['id'],'ChatQueueId':_0x20171f['id']});});});});});}})['then'](respondWithStatusCode(_0x53e5f8,null))['catch'](handleError(_0x53e5f8,null));};exports[_0xdfa9('0x79')]=function(_0x3d3306,_0x190a09,_0x1bd50d){return db[_0xdfa9('0x6e')]['findAll']({'where':{'id':_0x3d3306['query'][_0xdfa9('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xdfa9('0x67')],'as':_0xdfa9('0x73'),'attributes':['id'],'raw':!![]}]})[_0xdfa9('0x1f')](handleEntityNotFound(_0x190a09,null))[_0xdfa9('0x1f')](function(_0x39a741){var _0x2754fa=_[_0xdfa9('0x3e')](_0x39a741,'id');var _0x56cc3b=[];var _0x42a5e8=[];var _0x41659f=squel[_0xdfa9('0x7a')]();_0x41659f[_0xdfa9('0x7b')](_0xdfa9('0x7c'))[_0xdfa9('0x7d')](_0xdfa9('0x7e'),'tq')['join'](_0xdfa9('0x7f'),'ut',_0xdfa9('0x80'))[_0xdfa9('0x4e')](_0xdfa9('0x81'),_0x3d3306['params']['id']);for(var _0x57e3fe=0x0;_0x57e3fe<_0x39a741[_0xdfa9('0x4a')];_0x57e3fe+=0x1){let _0x288ecd=_0x39a741[_0x57e3fe];for(var _0x48a7cb=0x0;_0x48a7cb<_0x288ecd[_0xdfa9('0x73')][_0xdfa9('0x4a')];_0x48a7cb+=0x1){let _0x1d5662=_0x288ecd[_0xdfa9('0x73')][_0x48a7cb];var _0x2e621f=_0x41659f['clone']();_0x2e621f[_0xdfa9('0x4e')](_0xdfa9('0x82'),_0x1d5662['id']);_0x42a5e8[_0xdfa9('0x83')](db['sequelize'][_0xdfa9('0x45')](_0x2e621f[_0xdfa9('0x84')](),{'type':db['sequelize']['QueryTypes'][_0xdfa9('0x85')]})['then'](function(_0x4951fe){if(_0x4951fe['length']===0x1){return _0x1d5662['id'];}else{var _0x210a2d=_['every'](_[_0xdfa9('0x3e')](_0x4951fe,_0xdfa9('0x86')),function(_0xd4d3a3){return _[_0xdfa9('0x87')](_0x2754fa,_0xd4d3a3);});if(_0x210a2d){return _0x1d5662['id'];}}}));}}return BPromise[_0xdfa9('0x88')](_0x42a5e8)[_0xdfa9('0x1f')](function(_0x2c3898){_0x56cc3b=_(_0x56cc3b)[_0xdfa9('0x89')](_0x2c3898)[_0xdfa9('0x8a')]()[_0xdfa9('0x8b')]();return db[_0xdfa9('0x3f')][_0xdfa9('0x5b')]({'where':{'id':_0x3d3306[_0xdfa9('0x59')]['id']}})['then'](function(_0x4f66fe){return db[_0xdfa9('0x74')]['transaction'](function(_0x176e1f){return _0x4f66fe[_0xdfa9('0x79')](_0x3d3306[_0xdfa9('0x45')][_0xdfa9('0x6d')],{'transaction':_0x176e1f})['then'](function(){if(!_[_0xdfa9('0x8c')](_0x56cc3b)){return _0x4f66fe['removeAgents'](_0x56cc3b,{'transaction':_0x176e1f});}})[_0xdfa9('0x1f')](function(){_0x56cc3b[_0xdfa9('0x77')](function(_0x23c00b){socket[_0xdfa9('0x8d')](_0xdfa9('0x8e'),{'UserId':_0x23c00b,'ChatQueueId':_0x4f66fe['id']});});});});});});})[_0xdfa9('0x1f')](respondWithStatusCode(_0x190a09,null))[_0xdfa9('0x28')](handleError(_0x190a09,null));};exports[_0xdfa9('0x8f')]=function(_0x312ff9,_0x3ef6ba,_0x31b9ee){return db[_0xdfa9('0x3f')]['find']({'where':{'id':_0x312ff9[_0xdfa9('0x59')]['id']}})[_0xdfa9('0x1f')](handleEntityNotFound(_0x3ef6ba,null))[_0xdfa9('0x1f')](function(_0x5583d4){if(_0x5583d4){return _0x5583d4['addAgents'](_0x312ff9[_0xdfa9('0x5d')][_0xdfa9('0x6d')],_['omit'](_0x312ff9[_0xdfa9('0x5d')],[_0xdfa9('0x6d'),'id'])||{})['spread'](function(_0xc86d1c){for(var _0x3a6f5d=0x0;_0x3a6f5d<_0x312ff9[_0xdfa9('0x5d')]['ids'][_0xdfa9('0x4a')];_0x3a6f5d+=0x1){socket[_0xdfa9('0x8d')]('userChatQueue:save',{'UserId':Number(_0x312ff9[_0xdfa9('0x5d')][_0xdfa9('0x6d')][_0x3a6f5d]),'ChatQueueId':Number(_0x312ff9[_0xdfa9('0x59')]['id'])});}return _0xc86d1c;});}})[_0xdfa9('0x1f')](respondWithResult(_0x3ef6ba,null))[_0xdfa9('0x28')](handleError(_0x3ef6ba,null));};exports[_0xdfa9('0x90')]=function(_0x5d5db7,_0x518b2c,_0x2062b8){return db['ChatQueue'][_0xdfa9('0x5b')]({'where':{'id':_0x5d5db7['params']['id']}})[_0xdfa9('0x1f')](handleEntityNotFound(_0x518b2c,null))[_0xdfa9('0x1f')](function(_0x2f5887){if(_0x2f5887){return _0x2f5887[_0xdfa9('0x90')](_0x5d5db7[_0xdfa9('0x45')][_0xdfa9('0x6d')])['then'](function(){if(_['isArray'](_0x5d5db7[_0xdfa9('0x45')]['ids'])){for(var _0x29c142=0x0;_0x29c142<_0x5d5db7[_0xdfa9('0x45')]['ids'][_0xdfa9('0x4a')];_0x29c142+=0x1){socket[_0xdfa9('0x8d')]('userChatQueue:remove',{'UserId':Number(_0x5d5db7['query'][_0xdfa9('0x6d')][_0x29c142]),'ChatQueueId':Number(_0x5d5db7[_0xdfa9('0x59')]['id'])});}}else{socket[_0xdfa9('0x8d')]('userChatQueue:remove',{'UserId':Number(_0x5d5db7['query'][_0xdfa9('0x6d')]),'ChatQueueId':Number(_0x5d5db7[_0xdfa9('0x59')]['id'])});}});}})[_0xdfa9('0x1f')](respondWithStatusCode(_0x518b2c,null))[_0xdfa9('0x28')](handleError(_0x518b2c,null));};exports[_0xdfa9('0x91')]=function(_0xa347b2,_0x311e73,_0x364b5e){var _0x597d48={};var _0x5c0a94={};var _0x2d7c82;var _0x5d4b12;return db[_0xdfa9('0x3f')][_0xdfa9('0x92')]({'where':{'id':_0xa347b2[_0xdfa9('0x59')]['id']}})[_0xdfa9('0x1f')](handleEntityNotFound(_0x311e73,null))[_0xdfa9('0x1f')](function(_0x47f2be){if(_0x47f2be){_0x2d7c82=_0x47f2be;_0x5c0a94[_0xdfa9('0x44')]=_[_0xdfa9('0x5a')](db[_0xdfa9('0x67')][_0xdfa9('0x40')]);_0x5c0a94[_0xdfa9('0x45')]=_[_0xdfa9('0x5a')](_0xa347b2['query']);_0x5c0a94[_0xdfa9('0x46')]=_[_0xdfa9('0x47')](_0x5c0a94['model'],_0x5c0a94[_0xdfa9('0x45')]);_0x597d48[_0xdfa9('0x48')]=_['intersection'](_0x5c0a94[_0xdfa9('0x44')],qs['fields'](_0xa347b2[_0xdfa9('0x45')][_0xdfa9('0x49')]));_0x597d48[_0xdfa9('0x48')]=_0x597d48['attributes'][_0xdfa9('0x4a')]?_0x597d48[_0xdfa9('0x48')]:_0x5c0a94[_0xdfa9('0x44')];_0x597d48[_0xdfa9('0x65')]=qs[_0xdfa9('0x4d')](_0xa347b2[_0xdfa9('0x45')][_0xdfa9('0x4d')]);_0x597d48['where']=qs['filters'](_['pick'](_0xa347b2[_0xdfa9('0x45')],_0x5c0a94[_0xdfa9('0x46')]));if(_0xa347b2[_0xdfa9('0x45')][_0xdfa9('0x50')]){_0x597d48['where']=_[_0xdfa9('0x51')](_0x597d48[_0xdfa9('0x4e')],{'$or':_['map'](_0x597d48['attributes'],function(_0x37edf5){var _0x36c0b1={};_0x36c0b1[_0x37edf5]={'$like':'%'+_0xa347b2[_0xdfa9('0x45')]['filter']+'%'};return _0x36c0b1;})});}_0x597d48=_[_0xdfa9('0x51')]({},_0x597d48,_0xa347b2[_0xdfa9('0x53')]);return _0x2d7c82['getAgents'](_0x597d48);}})['then'](function(_0x43400f){if(_0x43400f){_0x5d4b12=_0x43400f[_0xdfa9('0x4a')];if(!_0xa347b2[_0xdfa9('0x45')]['hasOwnProperty']('nolimit')){_0x597d48['limit']=qs[_0xdfa9('0x2d')](_0xa347b2[_0xdfa9('0x45')][_0xdfa9('0x2d')]);_0x597d48['offset']=qs[_0xdfa9('0x2f')](_0xa347b2[_0xdfa9('0x45')]['offset']);}return _0x2d7c82[_0xdfa9('0x91')](_0x597d48);}})['then'](function(_0x22f4e0){if(_0x22f4e0){return _0x22f4e0?{'count':_0x5d4b12,'rows':_0x22f4e0}:null;}})[_0xdfa9('0x1f')](respondWithResult(_0x311e73,null))[_0xdfa9('0x28')](handleError(_0x311e73,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4fe5db1..9972bab 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 _0x42cf=['events','../../mysqldb','setMaxListeners','save','remove','emit','hook'];(function(_0xf6976b,_0x45ca7f){var _0x35824d=function(_0x2ca912){while(--_0x2ca912){_0xf6976b['push'](_0xf6976b['shift']());}};_0x35824d(++_0x45ca7f);}(_0x42cf,0x11f));var _0xf42c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x42cf[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require(_0xf42c('0x0'));var ChatQueue=require(_0xf42c('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf42c('0x2')](0x0);var events={'afterCreate':_0xf42c('0x3'),'afterUpdate':'update','afterDestroy':_0xf42c('0x4')};function emitEvent(_0x55fb1c){return function(_0x2dcb50,_0x100cd0,_0x4c7af9){ChatQueueEvents['emit'](_0x55fb1c+':'+_0x2dcb50['id'],_0x2dcb50);ChatQueueEvents[_0xf42c('0x5')](_0x55fb1c,_0x2dcb50);_0x4c7af9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xf42c('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x01e3=['hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01e3,0x122));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x301e('0x0'));var ChatQueue=require(_0x301e('0x1'))['db'][_0x301e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x301e('0x3')](0x0);var events={'afterCreate':_0x301e('0x4'),'afterUpdate':'update','afterDestroy':_0x301e('0x5')};function emitEvent(_0x4a7f49){return function(_0x5a7480,_0x456da7,_0x5c23ab){ChatQueueEvents[_0x301e('0x6')](_0x4a7f49+':'+_0x5a7480['id'],_0x5a7480);ChatQueueEvents[_0x301e('0x6')](_0x4a7f49,_0x5a7480);_0x5c23ab(null);};}for(var e in events){if(events[_0x301e('0x7')](e)){var event=events[e];ChatQueue[_0x301e('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 26798bb..3f189a0 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 _0x10ec=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','api','moment'];(function(_0x162ee0,_0x291661){var _0x48fc5e=function(_0x297a35){while(--_0x297a35){_0x162ee0['push'](_0x162ee0['shift']());}};_0x48fc5e(++_0x291661);}(_0x10ec,0x1dd));var _0xc10e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x10ec[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xc10e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc10e('0x1'));var moment=require(_0xc10e('0x2'));var BPromise=require(_0xc10e('0x3'));var rp=require(_0xc10e('0x4'));var fs=require('fs');var path=require(_0xc10e('0x5'));var rimraf=require(_0xc10e('0x6'));var config=require(_0xc10e('0x7'));var attributes=require(_0xc10e('0x8'));module[_0xc10e('0x9')]=function(_0x409c25,_0x1bba51){return _0x409c25[_0xc10e('0xa')]('ChatQueue',attributes,{'tableName':_0xc10e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9730=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4fe1e1,_0x260cab){var _0x3c3e9e=function(_0x4ffdbe){while(--_0x4ffdbe){_0x4fe1e1['push'](_0x4fe1e1['shift']());}};_0x3c3e9e(++_0x260cab);}(_0x9730,0x92));var _0x0973=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9730[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0973('0x0'));var util=require(_0x0973('0x1'));var logger=require(_0x0973('0x2'))(_0x0973('0x3'));var moment=require(_0x0973('0x4'));var BPromise=require(_0x0973('0x5'));var rp=require(_0x0973('0x6'));var fs=require('fs');var path=require(_0x0973('0x7'));var rimraf=require(_0x0973('0x8'));var config=require(_0x0973('0x9'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x405ccd,_0x15d072){return _0x405ccd['define'](_0x0973('0xa'),attributes,{'tableName':_0x0973('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 2986866..bcc7c0b 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 _0x9a6a=['GetChatQueue','stringify','ChatQueue','find','where','ShowChatQueue','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','limit','include','map','model','attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9a6a,0xce));var _0xa9a6=function(_0x5d0f40,_0x591761){_0x5d0f40=_0x5d0f40-0x0;var _0x4aa8f6=_0x9a6a[_0x5d0f40];return _0x4aa8f6;};'use strict';var _=require('lodash');var util=require(_0xa9a6('0x0'));var moment=require('moment');var BPromise=require(_0xa9a6('0x1'));var rs=require(_0xa9a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a6('0x3'))['db'];var utils=require(_0xa9a6('0x4'));var logger=require(_0xa9a6('0x5'))(_0xa9a6('0x6'));var config=require(_0xa9a6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa9a6('0x8')]({'port':0x232a});config[_0xa9a6('0x9')]=_[_0xa9a6('0xa')](config[_0xa9a6('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa9a6('0xb'))(new Redis(config[_0xa9a6('0x9')]));require(_0xa9a6('0xc'))[_0xa9a6('0xd')](socket);function respondWithRpcPromise(_0x1ff119,_0x443d93,_0x6e031c){return new BPromise(function(_0x22bbc9,_0x32b8b9){return client[_0xa9a6('0xe')](_0x1ff119,_0x6e031c)[_0xa9a6('0xf')](function(_0x45d8a4){logger[_0xa9a6('0x10')](_0xa9a6('0x11'),_0x443d93,_0xa9a6('0x12'));logger[_0xa9a6('0x13')](_0xa9a6('0x14'),_0x443d93,_0xa9a6('0x12'),JSON['stringify'](_0x45d8a4));if(_0x45d8a4[_0xa9a6('0x15')]){if(_0x45d8a4[_0xa9a6('0x15')][_0xa9a6('0x16')]===0x1f4){logger[_0xa9a6('0x15')]('ChatQueue,\x20%s,\x20%s',_0x443d93,_0x45d8a4['error'][_0xa9a6('0x17')]);return _0x32b8b9(_0x45d8a4['error'][_0xa9a6('0x17')]);}logger[_0xa9a6('0x15')](_0xa9a6('0x11'),_0x443d93,_0x45d8a4[_0xa9a6('0x15')][_0xa9a6('0x17')]);return _0x22bbc9(_0x45d8a4[_0xa9a6('0x15')][_0xa9a6('0x17')]);}else{logger[_0xa9a6('0x10')](_0xa9a6('0x11'),_0x443d93,_0xa9a6('0x12'));_0x22bbc9(_0x45d8a4[_0xa9a6('0x18')][_0xa9a6('0x17')]);}})[_0xa9a6('0x19')](function(_0x3f102a){logger[_0xa9a6('0x15')]('ChatQueue,\x20%s,\x20%s',_0x443d93,_0x3f102a);_0x32b8b9(_0x3f102a);});});}exports['GetChatQueue']=function(_0x7a4625){var _0x44c37b=this;return new Promise(function(_0x33429b,_0x3145fd){return db['ChatQueue'][_0xa9a6('0x1a')]({'raw':_0x7a4625[_0xa9a6('0x1b')]?_0x7a4625[_0xa9a6('0x1b')][_0xa9a6('0x1c')]===undefined?!![]:![]:!![],'where':_0x7a4625[_0xa9a6('0x1b')]?_0x7a4625[_0xa9a6('0x1b')]['where']||null:null,'attributes':_0x7a4625['options']?_0x7a4625[_0xa9a6('0x1b')]['attributes']||null:null,'limit':_0x7a4625[_0xa9a6('0x1b')]?_0x7a4625[_0xa9a6('0x1b')][_0xa9a6('0x1d')]||null:null,'include':_0x7a4625[_0xa9a6('0x1b')]?_0x7a4625[_0xa9a6('0x1b')][_0xa9a6('0x1e')]?_[_0xa9a6('0x1f')](_0x7a4625[_0xa9a6('0x1b')][_0xa9a6('0x1e')],function(_0x39af0b){return{'model':db[_0x39af0b[_0xa9a6('0x20')]],'as':_0x39af0b['as'],'attributes':_0x39af0b[_0xa9a6('0x21')],'include':_0x39af0b['include']?_['map'](_0x39af0b['include'],function(_0x4f4b89){return{'model':db[_0x4f4b89[_0xa9a6('0x20')]],'as':_0x4f4b89['as'],'attributes':_0x4f4b89[_0xa9a6('0x21')],'include':_0x4f4b89[_0xa9a6('0x1e')]?_[_0xa9a6('0x1f')](_0x4f4b89[_0xa9a6('0x1e')],function(_0x6466b2){return{'model':db[_0x6466b2['model']],'as':_0x6466b2['as'],'attributes':_0x6466b2[_0xa9a6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x159aba){logger['info']('GetChatQueue',_0x7a4625);logger[_0xa9a6('0x13')](_0xa9a6('0x22'),_0x7a4625,JSON[_0xa9a6('0x23')](_0x159aba));_0x33429b(_0x159aba);})[_0xa9a6('0x19')](function(_0x35d2e6){logger['error'](_0xa9a6('0x22'),_0x35d2e6['message'],_0x7a4625);_0x3145fd(_0x44c37b[_0xa9a6('0x15')](0x1f4,_0x35d2e6[_0xa9a6('0x17')]));});});};exports['ShowChatQueue']=function(_0x499fa2){var _0x10f6bb=this;return new Promise(function(_0x3f10e0,_0x32b399){return db[_0xa9a6('0x24')][_0xa9a6('0x25')]({'raw':_0x499fa2['options']?_0x499fa2['options'][_0xa9a6('0x1c')]===undefined?!![]:![]:!![],'where':_0x499fa2[_0xa9a6('0x1b')]?_0x499fa2[_0xa9a6('0x1b')][_0xa9a6('0x26')]||null:null,'attributes':_0x499fa2[_0xa9a6('0x1b')]?_0x499fa2['options'][_0xa9a6('0x21')]||null:null,'include':_0x499fa2[_0xa9a6('0x1b')]?_0x499fa2[_0xa9a6('0x1b')][_0xa9a6('0x1e')]?_[_0xa9a6('0x1f')](_0x499fa2[_0xa9a6('0x1b')][_0xa9a6('0x1e')],function(_0x2d0be0){return{'model':db[_0x2d0be0[_0xa9a6('0x20')]],'as':_0x2d0be0['as'],'attributes':_0x2d0be0['attributes'],'include':_0x2d0be0['include']?_[_0xa9a6('0x1f')](_0x2d0be0['include'],function(_0x59b4f5){return{'model':db[_0x59b4f5[_0xa9a6('0x20')]],'as':_0x59b4f5['as'],'attributes':_0x59b4f5[_0xa9a6('0x21')],'include':_0x59b4f5[_0xa9a6('0x1e')]?_[_0xa9a6('0x1f')](_0x59b4f5[_0xa9a6('0x1e')],function(_0x35d5ea){return{'model':db[_0x35d5ea[_0xa9a6('0x20')]],'as':_0x35d5ea['as'],'attributes':_0x35d5ea[_0xa9a6('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa9a6('0xf')](function(_0x58ac61){logger[_0xa9a6('0x10')](_0xa9a6('0x27'),_0x499fa2);logger[_0xa9a6('0x13')]('ShowChatQueue',_0x499fa2,JSON[_0xa9a6('0x23')](_0x58ac61));_0x3f10e0(_0x58ac61);})[_0xa9a6('0x19')](function(_0x1254d6){logger['error'](_0xa9a6('0x27'),_0x1254d6[_0xa9a6('0x17')],_0x499fa2);_0x32b399(_0x10f6bb[_0xa9a6('0x15')](0x1f4,_0x1254d6[_0xa9a6('0x17')]));});});}; \ No newline at end of file +var _0x7cd6=['model','map','catch','find','where','ShowChatQueue','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include'];(function(_0x158982,_0x2633d1){var _0x133e0e=function(_0x53a95d){while(--_0x53a95d){_0x158982['push'](_0x158982['shift']());}};_0x133e0e(++_0x2633d1);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x5459dd,_0x3ce142){_0x5459dd=_0x5459dd-0x0;var _0x524939=_0x7cd6[_0x5459dd];return _0x524939;};'use strict';var _=require(_0x67cd('0x0'));var util=require(_0x67cd('0x1'));var moment=require(_0x67cd('0x2'));var BPromise=require(_0x67cd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67cd('0x4'))['db'];var utils=require(_0x67cd('0x5'));var logger=require(_0x67cd('0x6'))('rpc');var config=require(_0x67cd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x67cd('0x8')][_0x67cd('0x9')]({'port':0x232a});config[_0x67cd('0xa')]=_[_0x67cd('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67cd('0xa')]));require(_0x67cd('0xc'))['register'](socket);function respondWithRpcPromise(_0x37d813,_0x563323,_0x59eadb){return new BPromise(function(_0x59eee1,_0x17a0da){return client[_0x67cd('0xd')](_0x37d813,_0x59eadb)[_0x67cd('0xe')](function(_0x4200c6){logger[_0x67cd('0xf')](_0x67cd('0x10'),_0x563323,'request\x20sent');logger[_0x67cd('0x11')](_0x67cd('0x12'),_0x563323,_0x67cd('0x13'),JSON[_0x67cd('0x14')](_0x4200c6));if(_0x4200c6[_0x67cd('0x15')]){if(_0x4200c6[_0x67cd('0x15')][_0x67cd('0x16')]===0x1f4){logger[_0x67cd('0x15')](_0x67cd('0x10'),_0x563323,_0x4200c6[_0x67cd('0x15')][_0x67cd('0x17')]);return _0x17a0da(_0x4200c6[_0x67cd('0x15')]['message']);}logger[_0x67cd('0x15')](_0x67cd('0x10'),_0x563323,_0x4200c6[_0x67cd('0x15')][_0x67cd('0x17')]);return _0x59eee1(_0x4200c6[_0x67cd('0x15')]['message']);}else{logger[_0x67cd('0xf')]('ChatQueue,\x20%s,\x20%s',_0x563323,_0x67cd('0x13'));_0x59eee1(_0x4200c6['result']['message']);}})['catch'](function(_0x1bd641){logger[_0x67cd('0x15')](_0x67cd('0x10'),_0x563323,_0x1bd641);_0x17a0da(_0x1bd641);});});}exports[_0x67cd('0x18')]=function(_0x2b1d18){var _0x703350=this;return new Promise(function(_0x3c777d,_0x2011e5){return db[_0x67cd('0x19')][_0x67cd('0x1a')]({'raw':_0x2b1d18['options']?_0x2b1d18[_0x67cd('0x1b')][_0x67cd('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b1d18[_0x67cd('0x1b')]?_0x2b1d18[_0x67cd('0x1b')]['where']||null:null,'attributes':_0x2b1d18['options']?_0x2b1d18[_0x67cd('0x1b')][_0x67cd('0x1d')]||null:null,'limit':_0x2b1d18[_0x67cd('0x1b')]?_0x2b1d18['options'][_0x67cd('0x1e')]||null:null,'include':_0x2b1d18[_0x67cd('0x1b')]?_0x2b1d18['options'][_0x67cd('0x1f')]?_['map'](_0x2b1d18[_0x67cd('0x1b')][_0x67cd('0x1f')],function(_0xbd0ca7){return{'model':db[_0xbd0ca7[_0x67cd('0x20')]],'as':_0xbd0ca7['as'],'attributes':_0xbd0ca7[_0x67cd('0x1d')],'include':_0xbd0ca7['include']?_[_0x67cd('0x21')](_0xbd0ca7['include'],function(_0x104b8e){return{'model':db[_0x104b8e[_0x67cd('0x20')]],'as':_0x104b8e['as'],'attributes':_0x104b8e[_0x67cd('0x1d')],'include':_0x104b8e[_0x67cd('0x1f')]?_['map'](_0x104b8e['include'],function(_0x1f252d){return{'model':db[_0x1f252d[_0x67cd('0x20')]],'as':_0x1f252d['as'],'attributes':_0x1f252d[_0x67cd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56ff0a){logger[_0x67cd('0xf')](_0x67cd('0x18'),_0x2b1d18);logger[_0x67cd('0x11')](_0x67cd('0x18'),_0x2b1d18,JSON['stringify'](_0x56ff0a));_0x3c777d(_0x56ff0a);})[_0x67cd('0x22')](function(_0x2fbcca){logger[_0x67cd('0x15')]('GetChatQueue',_0x2fbcca['message'],_0x2b1d18);_0x2011e5(_0x703350[_0x67cd('0x15')](0x1f4,_0x2fbcca[_0x67cd('0x17')]));});});};exports['ShowChatQueue']=function(_0x3f3e00){var _0x47ba0c=this;return new Promise(function(_0x3f3047,_0x17e197){return db['ChatQueue'][_0x67cd('0x23')]({'raw':_0x3f3e00[_0x67cd('0x1b')]?_0x3f3e00[_0x67cd('0x1b')][_0x67cd('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f3e00[_0x67cd('0x1b')]?_0x3f3e00[_0x67cd('0x1b')][_0x67cd('0x24')]||null:null,'attributes':_0x3f3e00[_0x67cd('0x1b')]?_0x3f3e00[_0x67cd('0x1b')][_0x67cd('0x1d')]||null:null,'include':_0x3f3e00['options']?_0x3f3e00['options'][_0x67cd('0x1f')]?_['map'](_0x3f3e00[_0x67cd('0x1b')][_0x67cd('0x1f')],function(_0x1524c0){return{'model':db[_0x1524c0['model']],'as':_0x1524c0['as'],'attributes':_0x1524c0[_0x67cd('0x1d')],'include':_0x1524c0[_0x67cd('0x1f')]?_['map'](_0x1524c0[_0x67cd('0x1f')],function(_0x5dace0){return{'model':db[_0x5dace0[_0x67cd('0x20')]],'as':_0x5dace0['as'],'attributes':_0x5dace0[_0x67cd('0x1d')],'include':_0x5dace0['include']?_[_0x67cd('0x21')](_0x5dace0[_0x67cd('0x1f')],function(_0x16374d){return{'model':db[_0x16374d[_0x67cd('0x20')]],'as':_0x16374d['as'],'attributes':_0x16374d[_0x67cd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x67cd('0xe')](function(_0xd98832){logger[_0x67cd('0xf')]('ShowChatQueue',_0x3f3e00);logger[_0x67cd('0x11')](_0x67cd('0x25'),_0x3f3e00,JSON[_0x67cd('0x14')](_0xd98832));_0x3f3047(_0xd98832);})[_0x67cd('0x22')](function(_0x10efcf){logger['error']('ShowChatQueue',_0x10efcf[_0x67cd('0x17')],_0x3f3e00);_0x17e197(_0x47ba0c[_0x67cd('0x15')](0x1f4,_0x10efcf[_0x67cd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 818ff20..f7d037d 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 _0xc874=['emit','removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x2908a4,_0xcd9a46){var _0x3f9edf=function(_0x51330e){while(--_0x51330e){_0x2908a4['push'](_0x2908a4['shift']());}};_0x3f9edf(++_0xcd9a46);}(_0xc874,0x154));var _0x4c87=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xc874[_0x42245d];return _0x4b211a;};'use strict';var ChatQueueEvents=require(_0x4c87('0x0'));var events=['save',_0x4c87('0x1'),_0x4c87('0x2')];function createListener(_0x505440,_0x5e6d61){return function(_0xfc1b9f){_0x5e6d61[_0x4c87('0x3')](_0x505440,_0xfc1b9f);};}function removeListener(_0x1c3dbc,_0x575a7c){return function(){ChatQueueEvents[_0x4c87('0x4')](_0x1c3dbc,_0x575a7c);};}exports[_0x4c87('0x5')]=function(_0x5d63ae){for(var _0x46e0f5=0x0,_0x3dafe0=events[_0x4c87('0x6')];_0x46e0f5<_0x3dafe0;_0x46e0f5++){var _0xdc4a29=events[_0x46e0f5];var _0x116649=createListener('chatQueue:'+_0xdc4a29,_0x5d63ae);ChatQueueEvents['on'](_0xdc4a29,_0x116649);}}; \ No newline at end of file +var _0x207c=['length','chatQueue:','save','remove','update','emit'];(function(_0x227a90,_0x58240f){var _0x133b23=function(_0x33b07d){while(--_0x33b07d){_0x227a90['push'](_0x227a90['shift']());}};_0x133b23(++_0x58240f);}(_0x207c,0x1e8));var _0xc207=function(_0x38baac,_0x2772b3){_0x38baac=_0x38baac-0x0;var _0x47baf1=_0x207c[_0x38baac];return _0x47baf1;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xc207('0x0'),_0xc207('0x1'),_0xc207('0x2')];function createListener(_0xaaba3d,_0x2b40be){return function(_0x12f1f2){_0x2b40be[_0xc207('0x3')](_0xaaba3d,_0x12f1f2);};}function removeListener(_0x4b9daa,_0x38ff02){return function(){ChatQueueEvents['removeListener'](_0x4b9daa,_0x38ff02);};}exports['register']=function(_0x55023e){for(var _0xc88789=0x0,_0x314561=events[_0xc207('0x4')];_0xc88789<_0x314561;_0xc88789++){var _0x59ff6f=events[_0xc88789];var _0x25cb97=createListener(_0xc207('0x5')+_0x59ff6f,_0x55023e);ChatQueueEvents['on'](_0x59ff6f,_0x25cb97);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b63c220..3696ed0 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d1b93,_0x35c3b8){var _0x42cc45=function(_0x163721){while(--_0x163721){_0x4d1b93['push'](_0x4d1b93['shift']());}};_0x42cc45(++_0x35c3b8);}(_0x008c,0x188));var _0xc008=function(_0x11a741,_0x1e7097){_0x11a741=_0x11a741-0x0;var _0xa466f6=_0x008c[_0x11a741];return _0xa466f6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0xc59d0a,_0x525a45){var _0x23fa1b=function(_0x22f73f){while(--_0x22f73f){_0xc59d0a['push'](_0xc59d0a['shift']());}};_0x23fa1b(++_0x525a45);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'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('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 1200ac8..e4b96ac 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 _0xf6c3=['sequelize','STRING','DATE','moment'];(function(_0x6ba3f7,_0x28d0f3){var _0x779054=function(_0x41c58e){while(--_0x41c58e){_0x6ba3f7['push'](_0x6ba3f7['shift']());}};_0x779054(++_0x28d0f3);}(_0xf6c3,0x1cf));var _0x3f6c=function(_0x1d81e0,_0x58a0b8){_0x1d81e0=_0x1d81e0-0x0;var _0x5a9d9a=_0xf6c3[_0x1d81e0];return _0x5a9d9a;};'use strict';var moment=require(_0x3f6c('0x0'));var Sequelize=require(_0x3f6c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3f6c('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3f6c('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3f6c('0x3')]},'exitAt':{'type':Sequelize[_0x3f6c('0x3')]},'reason':{'type':Sequelize[_0x3f6c('0x2')]}}; \ No newline at end of file +var _0x09f3=['exports','STRING','DATE','moment','sequelize'];(function(_0x497de,_0x6ecf5a){var _0x353695=function(_0x5cd868){while(--_0x5cd868){_0x497de['push'](_0x497de['shift']());}};_0x353695(++_0x6ecf5a);}(_0x09f3,0x1c5));var _0x309f=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0x09f3[_0x4eab61];return _0x342426;};'use strict';var moment=require(_0x309f('0x0'));var Sequelize=require(_0x309f('0x1'));module[_0x309f('0x2')]={'uniqueid':{'type':Sequelize[_0x309f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x309f('0x3')]},'joinAt':{'type':Sequelize[_0x309f('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x309f('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x309f('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 646de4a..ae0711f 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 _0xa701=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','describe','rimraf','zip-dir','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xd53281,_0x4dc750){var _0x250d65=function(_0x2a6da0){while(--_0x2a6da0){_0xd53281['push'](_0xd53281['shift']());}};_0x250d65(++_0x4dc750);}(_0xa701,0xd4));var _0x1a70=function(_0x4557e2,_0x4e64b7){_0x4557e2=_0x4557e2-0x0;var _0x3b6ce4=_0xa701[_0x4557e2];return _0x3b6ce4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a70('0x0'));var zipdir=require(_0x1a70('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1a70('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a70('0x3'));var path=require(_0x1a70('0x4'));var sox=require(_0x1a70('0x5'));var csv=require(_0x1a70('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a70('0x7'));var squel=require(_0x1a70('0x8'));var crypto=require(_0x1a70('0x9'));var jsforce=require(_0x1a70('0xa'));var deskjs=require(_0x1a70('0xb'));var toCsv=require(_0x1a70('0x6'));var querystring=require(_0x1a70('0xc'));var Papa=require('papaparse');var Redis=require(_0x1a70('0xd'));var authService=require(_0x1a70('0xe'));var qs=require(_0x1a70('0xf'));var as=require(_0x1a70('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a70('0x11'))(_0x1a70('0x12'));var utils=require(_0x1a70('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a70('0x14'))['db'];function respondWithStatusCode(_0x51a47a,_0x2391b5){_0x2391b5=_0x2391b5||0xcc;return function(_0x4eb892){if(_0x4eb892){return _0x51a47a[_0x1a70('0x15')](_0x2391b5);}return _0x51a47a['status'](_0x2391b5)[_0x1a70('0x16')]();};}function respondWithResult(_0x59fd45,_0x4c1b7f){_0x4c1b7f=_0x4c1b7f||0xc8;return function(_0x3e6a57){if(_0x3e6a57){return _0x59fd45[_0x1a70('0x17')](_0x4c1b7f)[_0x1a70('0x18')](_0x3e6a57);}};}function respondWithFilteredResult(_0x123523,_0x5d45ab){return function(_0x5a5b4c){if(_0x5a5b4c){var _0x318fcc=typeof _0x5d45ab['offset']===_0x1a70('0x19')&&typeof _0x5d45ab[_0x1a70('0x1a')]==='undefined';var _0x1cd5f4=_0x5a5b4c['count'];var _0x266784=_0x318fcc?0x0:_0x5d45ab[_0x1a70('0x1b')];var _0x555680=_0x318fcc?_0x5a5b4c[_0x1a70('0x1c')]:_0x5d45ab[_0x1a70('0x1b')]+_0x5d45ab['limit'];var _0x56fc92;if(_0x555680>=_0x1cd5f4){_0x555680=_0x1cd5f4;_0x56fc92=0xc8;}else{_0x56fc92=0xce;}_0x123523[_0x1a70('0x17')](_0x56fc92);return _0x123523[_0x1a70('0x1d')](_0x1a70('0x1e'),_0x266784+'-'+_0x555680+'/'+_0x1cd5f4)[_0x1a70('0x18')](_0x5a5b4c);}return null;};}function patchUpdates(_0x11023c){return function(_0x3b5625){try{jsonpatch[_0x1a70('0x1f')](_0x3b5625,_0x11023c,!![]);}catch(_0x1692e0){return BPromise[_0x1a70('0x20')](_0x1692e0);}return _0x3b5625[_0x1a70('0x21')]();};}function saveUpdates(_0x1832dc,_0x1e2b30){return function(_0x3aebb1){if(_0x3aebb1){return _0x3aebb1[_0x1a70('0x22')](_0x1832dc)['then'](function(_0x4fcf57){return _0x4fcf57;});}return null;};}function removeEntity(_0x3f9cdf,_0x20f1b1){return function(_0x437a6a){if(_0x437a6a){return _0x437a6a[_0x1a70('0x23')]()[_0x1a70('0x24')](function(){_0x3f9cdf[_0x1a70('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe7c8a5,_0x10be7d){return function(_0x51d172){if(!_0x51d172){_0xe7c8a5[_0x1a70('0x15')](0x194);}return _0x51d172;};}function handleError(_0x116852,_0x4bf455){_0x4bf455=_0x4bf455||0x1f4;return function(_0x24dee2){logger[_0x1a70('0x25')](_0x24dee2[_0x1a70('0x26')]);if(_0x24dee2[_0x1a70('0x27')]){delete _0x24dee2[_0x1a70('0x27')];}_0x116852[_0x1a70('0x17')](_0x4bf455)[_0x1a70('0x28')](_0x24dee2);};}exports[_0x1a70('0x29')]=function(_0x558750,_0x175c21){var _0x28da84={},_0x19e0ba={},_0x18d5c3={'count':0x0,'rows':[]};var _0xf3cfde=_[_0x1a70('0x2a')](db[_0x1a70('0x2b')][_0x1a70('0x2c')],function(_0x319cb7){return{'name':_0x319cb7[_0x1a70('0x2d')],'type':_0x319cb7[_0x1a70('0x2e')][_0x1a70('0x2f')]};});_0x19e0ba['model']=_[_0x1a70('0x2a')](_0xf3cfde,'name');_0x19e0ba[_0x1a70('0x30')]=_[_0x1a70('0x31')](_0x558750[_0x1a70('0x30')]);_0x19e0ba[_0x1a70('0x32')]=_[_0x1a70('0x33')](_0x19e0ba['model'],_0x19e0ba[_0x1a70('0x30')]);_0x28da84[_0x1a70('0x34')]=_[_0x1a70('0x33')](_0x19e0ba[_0x1a70('0x35')],qs[_0x1a70('0x36')](_0x558750[_0x1a70('0x30')][_0x1a70('0x36')]));_0x28da84[_0x1a70('0x34')]=_0x28da84['attributes']['length']?_0x28da84[_0x1a70('0x34')]:_0x19e0ba[_0x1a70('0x35')];if(!_0x558750[_0x1a70('0x30')][_0x1a70('0x37')](_0x1a70('0x38'))){_0x28da84[_0x1a70('0x1a')]=qs[_0x1a70('0x1a')](_0x558750[_0x1a70('0x30')][_0x1a70('0x1a')]);_0x28da84[_0x1a70('0x1b')]=qs['offset'](_0x558750[_0x1a70('0x30')]['offset']);}_0x28da84[_0x1a70('0x39')]=qs['sort'](_0x558750[_0x1a70('0x30')][_0x1a70('0x3a')]);_0x28da84['where']=qs[_0x1a70('0x32')](_[_0x1a70('0x3b')](_0x558750[_0x1a70('0x30')],_0x19e0ba[_0x1a70('0x32')]),_0xf3cfde);if(_0x558750['query'][_0x1a70('0x3c')]){_0x28da84[_0x1a70('0x3d')]=_[_0x1a70('0x3e')](_0x28da84[_0x1a70('0x3d')],{'$or':_[_0x1a70('0x2a')](_0xf3cfde,function(_0x3180c5){if(_0x3180c5[_0x1a70('0x2e')]!==_0x1a70('0x3f')){var _0x527796={};_0x527796[_0x3180c5[_0x1a70('0x27')]]={'$like':'%'+_0x558750['query'][_0x1a70('0x3c')]+'%'};return _0x527796;}})});}_0x28da84=_[_0x1a70('0x3e')]({},_0x28da84,_0x558750[_0x1a70('0x40')]);var _0x1d8848={'where':_0x28da84[_0x1a70('0x3d')]};return db['ChatQueueReport'][_0x1a70('0x1c')](_0x1d8848)['then'](function(_0x8b1602){_0x18d5c3[_0x1a70('0x1c')]=_0x8b1602;if(_0x558750[_0x1a70('0x30')][_0x1a70('0x41')]){_0x28da84[_0x1a70('0x42')]=[{'all':!![]}];}return db[_0x1a70('0x2b')][_0x1a70('0x43')](_0x28da84);})['then'](function(_0x89fc96){_0x18d5c3[_0x1a70('0x44')]=_0x89fc96;return _0x18d5c3;})[_0x1a70('0x24')](respondWithFilteredResult(_0x175c21,_0x28da84))[_0x1a70('0x45')](handleError(_0x175c21,null));};exports[_0x1a70('0x46')]=function(_0x1af669,_0x2da5a7){var _0x16c2a1={'raw':!![],'where':{'id':_0x1af669['params']['id']}},_0x19a8de={};_0x19a8de[_0x1a70('0x35')]=_[_0x1a70('0x31')](db[_0x1a70('0x2b')][_0x1a70('0x2c')]);_0x19a8de[_0x1a70('0x30')]=_[_0x1a70('0x31')](_0x1af669[_0x1a70('0x30')]);_0x19a8de[_0x1a70('0x32')]=_['intersection'](_0x19a8de['model'],_0x19a8de[_0x1a70('0x30')]);_0x16c2a1[_0x1a70('0x34')]=_['intersection'](_0x19a8de[_0x1a70('0x35')],qs['fields'](_0x1af669[_0x1a70('0x30')][_0x1a70('0x36')]));_0x16c2a1['attributes']=_0x16c2a1[_0x1a70('0x34')][_0x1a70('0x47')]?_0x16c2a1[_0x1a70('0x34')]:_0x19a8de['model'];if(_0x1af669[_0x1a70('0x30')][_0x1a70('0x41')]){_0x16c2a1['include']=[{'all':!![]}];}_0x16c2a1=_['merge']({},_0x16c2a1,_0x1af669[_0x1a70('0x40')]);return db['ChatQueueReport'][_0x1a70('0x48')](_0x16c2a1)[_0x1a70('0x24')](handleEntityNotFound(_0x2da5a7,null))[_0x1a70('0x24')](respondWithResult(_0x2da5a7,null))[_0x1a70('0x45')](handleError(_0x2da5a7,null));};exports[_0x1a70('0x49')]=function(_0x1bbfc4,_0x5ee372){return db[_0x1a70('0x2b')][_0x1a70('0x49')](_0x1bbfc4['body'],{})[_0x1a70('0x24')](respondWithResult(_0x5ee372,0xc9))[_0x1a70('0x45')](handleError(_0x5ee372,null));};exports[_0x1a70('0x22')]=function(_0x1a7a99,_0x40e227){if(_0x1a7a99['body']['id']){delete _0x1a7a99[_0x1a70('0x4a')]['id'];}return db[_0x1a70('0x2b')][_0x1a70('0x48')]({'where':{'id':_0x1a7a99['params']['id']}})[_0x1a70('0x24')](handleEntityNotFound(_0x40e227,null))[_0x1a70('0x24')](saveUpdates(_0x1a7a99[_0x1a70('0x4a')],null))[_0x1a70('0x24')](respondWithResult(_0x40e227,null))['catch'](handleError(_0x40e227,null));};exports['destroy']=function(_0x2066fb,_0x52986c){return db[_0x1a70('0x2b')]['find']({'where':{'id':_0x2066fb['params']['id']}})[_0x1a70('0x24')](handleEntityNotFound(_0x52986c,null))[_0x1a70('0x24')](removeEntity(_0x52986c,null))[_0x1a70('0x45')](handleError(_0x52986c,null));};exports['describe']=function(_0x850e76,_0xc7d213){return db[_0x1a70('0x2b')][_0x1a70('0x4b')]()[_0x1a70('0x24')](respondWithResult(_0xc7d213,null))['catch'](handleError(_0xc7d213,null));}; \ No newline at end of file +var _0x87f1=['path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../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','save','update','destroy','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4fc39a,_0x1b6ed3){var _0x476fae=function(_0x4fbd2f){while(--_0x4fbd2f){_0x4fc39a['push'](_0x4fc39a['shift']());}};_0x476fae(++_0x1b6ed3);}(_0x87f1,0x170));var _0x187f=function(_0x538ffd,_0x145008){_0x538ffd=_0x538ffd-0x0;var _0x5b5aaa=_0x87f1[_0x538ffd];return _0x5b5aaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x187f('0x0'));var zipdir=require(_0x187f('0x1'));var jsonpatch=require(_0x187f('0x2'));var rp=require(_0x187f('0x3'));var moment=require(_0x187f('0x4'));var BPromise=require(_0x187f('0x5'));var Mustache=require(_0x187f('0x6'));var util=require('util');var path=require(_0x187f('0x7'));var sox=require('sox');var csv=require(_0x187f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x187f('0x9'));var _=require('lodash');var squel=require(_0x187f('0xa'));var crypto=require(_0x187f('0xb'));var jsforce=require(_0x187f('0xc'));var deskjs=require(_0x187f('0xd'));var toCsv=require(_0x187f('0x8'));var querystring=require(_0x187f('0xe'));var Papa=require('papaparse');var Redis=require(_0x187f('0xf'));var authService=require(_0x187f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x187f('0x11'));var logger=require(_0x187f('0x12'))(_0x187f('0x13'));var utils=require(_0x187f('0x14'));var config=require(_0x187f('0x15'));var licenseUtil=require(_0x187f('0x16'));var db=require(_0x187f('0x17'))['db'];function respondWithStatusCode(_0x1298f5,_0x7f7067){_0x7f7067=_0x7f7067||0xcc;return function(_0x83b3a0){if(_0x83b3a0){return _0x1298f5['sendStatus'](_0x7f7067);}return _0x1298f5['status'](_0x7f7067)[_0x187f('0x18')]();};}function respondWithResult(_0x176fae,_0x4683fd){_0x4683fd=_0x4683fd||0xc8;return function(_0x2eee87){if(_0x2eee87){return _0x176fae[_0x187f('0x19')](_0x4683fd)[_0x187f('0x1a')](_0x2eee87);}};}function respondWithFilteredResult(_0xf3600,_0x557047){return function(_0x11c254){if(_0x11c254){var _0x4e232d=typeof _0x557047['offset']===_0x187f('0x1b')&&typeof _0x557047[_0x187f('0x1c')]==='undefined';var _0x1d30e8=_0x11c254['count'];var _0x50e6cc=_0x4e232d?0x0:_0x557047[_0x187f('0x1d')];var _0x195931=_0x4e232d?_0x11c254[_0x187f('0x1e')]:_0x557047[_0x187f('0x1d')]+_0x557047['limit'];var _0x5ecdc0;if(_0x195931>=_0x1d30e8){_0x195931=_0x1d30e8;_0x5ecdc0=0xc8;}else{_0x5ecdc0=0xce;}_0xf3600[_0x187f('0x19')](_0x5ecdc0);return _0xf3600[_0x187f('0x1f')](_0x187f('0x20'),_0x50e6cc+'-'+_0x195931+'/'+_0x1d30e8)['json'](_0x11c254);}return null;};}function patchUpdates(_0x546c4c){return function(_0x503101){try{jsonpatch[_0x187f('0x21')](_0x503101,_0x546c4c,!![]);}catch(_0x39d34d){return BPromise['reject'](_0x39d34d);}return _0x503101[_0x187f('0x22')]();};}function saveUpdates(_0xbc434c,_0x354453){return function(_0x4e069b){if(_0x4e069b){return _0x4e069b[_0x187f('0x23')](_0xbc434c)['then'](function(_0x123afe){return _0x123afe;});}return null;};}function removeEntity(_0x1ed126,_0x2a8299){return function(_0x48730e){if(_0x48730e){return _0x48730e[_0x187f('0x24')]()[_0x187f('0x25')](function(){_0x1ed126[_0x187f('0x19')](0xcc)[_0x187f('0x18')]();});}};}function handleEntityNotFound(_0x2b0e76,_0x5d036c){return function(_0x5a3426){if(!_0x5a3426){_0x2b0e76[_0x187f('0x26')](0x194);}return _0x5a3426;};}function handleError(_0x1a58eb,_0x388a58){_0x388a58=_0x388a58||0x1f4;return function(_0x372080){logger[_0x187f('0x27')](_0x372080[_0x187f('0x28')]);if(_0x372080[_0x187f('0x29')]){delete _0x372080[_0x187f('0x29')];}_0x1a58eb[_0x187f('0x19')](_0x388a58)['send'](_0x372080);};}exports[_0x187f('0x2a')]=function(_0x3ad607,_0x5c5020){var _0x2503a5={},_0x3c00dd={},_0x3d5c4d={'count':0x0,'rows':[]};var _0x6079c0=_[_0x187f('0x2b')](db['ChatQueueReport'][_0x187f('0x2c')],function(_0x304d08){return{'name':_0x304d08['fieldName'],'type':_0x304d08[_0x187f('0x2d')][_0x187f('0x2e')]};});_0x3c00dd[_0x187f('0x2f')]=_['map'](_0x6079c0,'name');_0x3c00dd[_0x187f('0x30')]=_[_0x187f('0x31')](_0x3ad607['query']);_0x3c00dd['filters']=_[_0x187f('0x32')](_0x3c00dd[_0x187f('0x2f')],_0x3c00dd[_0x187f('0x30')]);_0x2503a5[_0x187f('0x33')]=_[_0x187f('0x32')](_0x3c00dd[_0x187f('0x2f')],qs[_0x187f('0x34')](_0x3ad607[_0x187f('0x30')][_0x187f('0x34')]));_0x2503a5[_0x187f('0x33')]=_0x2503a5[_0x187f('0x33')][_0x187f('0x35')]?_0x2503a5[_0x187f('0x33')]:_0x3c00dd[_0x187f('0x2f')];if(!_0x3ad607['query']['hasOwnProperty'](_0x187f('0x36'))){_0x2503a5[_0x187f('0x1c')]=qs[_0x187f('0x1c')](_0x3ad607[_0x187f('0x30')][_0x187f('0x1c')]);_0x2503a5[_0x187f('0x1d')]=qs[_0x187f('0x1d')](_0x3ad607['query']['offset']);}_0x2503a5[_0x187f('0x37')]=qs[_0x187f('0x38')](_0x3ad607['query'][_0x187f('0x38')]);_0x2503a5[_0x187f('0x39')]=qs['filters'](_[_0x187f('0x3a')](_0x3ad607[_0x187f('0x30')],_0x3c00dd[_0x187f('0x3b')]),_0x6079c0);if(_0x3ad607[_0x187f('0x30')][_0x187f('0x3c')]){_0x2503a5[_0x187f('0x39')]=_[_0x187f('0x3d')](_0x2503a5['where'],{'$or':_[_0x187f('0x2b')](_0x6079c0,function(_0x10884c){if(_0x10884c[_0x187f('0x2d')]!=='VIRTUAL'){var _0x392941={};_0x392941[_0x10884c[_0x187f('0x29')]]={'$like':'%'+_0x3ad607[_0x187f('0x30')][_0x187f('0x3c')]+'%'};return _0x392941;}})});}_0x2503a5=_['merge']({},_0x2503a5,_0x3ad607[_0x187f('0x3e')]);var _0x25ed35={'where':_0x2503a5[_0x187f('0x39')]};return db[_0x187f('0x3f')][_0x187f('0x1e')](_0x25ed35)[_0x187f('0x25')](function(_0x2b0100){_0x3d5c4d[_0x187f('0x1e')]=_0x2b0100;if(_0x3ad607[_0x187f('0x30')][_0x187f('0x40')]){_0x2503a5[_0x187f('0x41')]=[{'all':!![]}];}return db[_0x187f('0x3f')][_0x187f('0x42')](_0x2503a5);})[_0x187f('0x25')](function(_0xeb8193){_0x3d5c4d[_0x187f('0x43')]=_0xeb8193;return _0x3d5c4d;})[_0x187f('0x25')](respondWithFilteredResult(_0x5c5020,_0x2503a5))[_0x187f('0x44')](handleError(_0x5c5020,null));};exports[_0x187f('0x45')]=function(_0x26f119,_0x2bd680){var _0x1e2efd={'raw':!![],'where':{'id':_0x26f119[_0x187f('0x46')]['id']}},_0x4e8314={};_0x4e8314[_0x187f('0x2f')]=_[_0x187f('0x31')](db[_0x187f('0x3f')]['rawAttributes']);_0x4e8314['query']=_[_0x187f('0x31')](_0x26f119['query']);_0x4e8314[_0x187f('0x3b')]=_[_0x187f('0x32')](_0x4e8314[_0x187f('0x2f')],_0x4e8314[_0x187f('0x30')]);_0x1e2efd['attributes']=_[_0x187f('0x32')](_0x4e8314['model'],qs[_0x187f('0x34')](_0x26f119[_0x187f('0x30')][_0x187f('0x34')]));_0x1e2efd[_0x187f('0x33')]=_0x1e2efd[_0x187f('0x33')]['length']?_0x1e2efd[_0x187f('0x33')]:_0x4e8314[_0x187f('0x2f')];if(_0x26f119['query'][_0x187f('0x40')]){_0x1e2efd[_0x187f('0x41')]=[{'all':!![]}];}_0x1e2efd=_['merge']({},_0x1e2efd,_0x26f119['options']);return db[_0x187f('0x3f')][_0x187f('0x47')](_0x1e2efd)[_0x187f('0x25')](handleEntityNotFound(_0x2bd680,null))['then'](respondWithResult(_0x2bd680,null))[_0x187f('0x44')](handleError(_0x2bd680,null));};exports[_0x187f('0x48')]=function(_0x45b6e4,_0x56198e){return db['ChatQueueReport'][_0x187f('0x48')](_0x45b6e4[_0x187f('0x49')],{})[_0x187f('0x25')](respondWithResult(_0x56198e,0xc9))[_0x187f('0x44')](handleError(_0x56198e,null));};exports[_0x187f('0x23')]=function(_0x2e6697,_0x5bda00){if(_0x2e6697[_0x187f('0x49')]['id']){delete _0x2e6697[_0x187f('0x49')]['id'];}return db[_0x187f('0x3f')][_0x187f('0x47')]({'where':{'id':_0x2e6697['params']['id']}})[_0x187f('0x25')](handleEntityNotFound(_0x5bda00,null))['then'](saveUpdates(_0x2e6697['body'],null))[_0x187f('0x25')](respondWithResult(_0x5bda00,null))[_0x187f('0x44')](handleError(_0x5bda00,null));};exports[_0x187f('0x24')]=function(_0x2127ac,_0x540207){return db['ChatQueueReport'][_0x187f('0x47')]({'where':{'id':_0x2127ac[_0x187f('0x46')]['id']}})[_0x187f('0x25')](handleEntityNotFound(_0x540207,null))['then'](removeEntity(_0x540207,null))[_0x187f('0x44')](handleError(_0x540207,null));};exports[_0x187f('0x4a')]=function(_0x35fea4,_0x4f81f6){return db[_0x187f('0x3f')][_0x187f('0x4a')]()[_0x187f('0x25')](respondWithResult(_0x4f81f6,null))[_0x187f('0x44')](handleError(_0x4f81f6,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 04e066e..5a81465 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x35b38c,_0x1a1581){var _0x4dd9c4=function(_0x2a5c66){while(--_0x2a5c66){_0x35b38c['push'](_0x35b38c['shift']());}};_0x4dd9c4(++_0x1a1581);}(_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 +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x10bd94,_0x46b509){var _0x364677=function(_0x417683){while(--_0x417683){_0x10bd94['push'](_0x10bd94['shift']());}};_0x364677(++_0x46b509);}(_0xe706,0xa3));var _0x6e70=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0xe706[_0x3aaf97];return _0xeba75e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 653ea04..1e650b7 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 _0x6299=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport','update','attributes','limit','lodash','moment','bluebird'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x6299,0x1af));var _0x9629=function(_0x10166a,_0xeb8ca8){_0x10166a=_0x10166a-0x0;var _0x45e282=_0x6299[_0x10166a];return _0x45e282;};'use strict';var _=require(_0x9629('0x0'));var util=require('util');var moment=require(_0x9629('0x1'));var BPromise=require(_0x9629('0x2'));var rs=require(_0x9629('0x3'));var fs=require('fs');var Redis=require(_0x9629('0x4'));var db=require(_0x9629('0x5'))['db'];var utils=require(_0x9629('0x6'));var logger=require(_0x9629('0x7'))(_0x9629('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39e7f8,_0x226a04,_0x2d73af){return new BPromise(function(_0x54f2cb,_0x52c626){return client['request'](_0x39e7f8,_0x2d73af)[_0x9629('0x9')](function(_0x48137b){logger[_0x9629('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x226a04,_0x9629('0xb'));logger[_0x9629('0xc')](_0x9629('0xd'),_0x226a04,_0x9629('0xb'),JSON[_0x9629('0xe')](_0x48137b));if(_0x48137b['error']){if(_0x48137b[_0x9629('0xf')][_0x9629('0x10')]===0x1f4){logger['error'](_0x9629('0x11'),_0x226a04,_0x48137b[_0x9629('0xf')][_0x9629('0x12')]);return _0x52c626(_0x48137b[_0x9629('0xf')][_0x9629('0x12')]);}logger[_0x9629('0xf')](_0x9629('0x11'),_0x226a04,_0x48137b['error'][_0x9629('0x12')]);return _0x54f2cb(_0x48137b[_0x9629('0xf')]['message']);}else{logger[_0x9629('0xa')](_0x9629('0x11'),_0x226a04,_0x9629('0xb'));_0x54f2cb(_0x48137b[_0x9629('0x13')][_0x9629('0x12')]);}})[_0x9629('0x14')](function(_0x448627){logger[_0x9629('0xf')](_0x9629('0x11'),_0x226a04,_0x448627);_0x52c626(_0x448627);});});}exports[_0x9629('0x15')]=function(_0xc0d4ba){var _0x43f2be=this;return new Promise(function(_0x332479,_0x239267){return db['ChatQueueReport'][_0x9629('0x16')](_0xc0d4ba[_0x9629('0x17')],{'raw':_0xc0d4ba['options']?_0xc0d4ba[_0x9629('0x18')][_0x9629('0x19')]===undefined?!![]:![]:!![]})[_0x9629('0x9')](function(_0x3dc80f){logger[_0x9629('0xa')](_0x9629('0x15'),_0xc0d4ba);logger[_0x9629('0xc')](_0x9629('0x15'),_0xc0d4ba,JSON[_0x9629('0xe')](_0x3dc80f));_0x332479(_0x3dc80f);})[_0x9629('0x14')](function(_0x415eb3){logger[_0x9629('0xf')]('CreateChatQueueReport',_0x415eb3[_0x9629('0x12')],_0xc0d4ba);_0x239267(_0x43f2be[_0x9629('0xf')](0x1f4,_0x415eb3[_0x9629('0x12')]));});});};exports[_0x9629('0x1a')]=function(_0x48086b){var _0x375bb5=this;return new Promise(function(_0x188743,_0x17d860){return db[_0x9629('0x1b')][_0x9629('0x1c')](_0x48086b[_0x9629('0x17')],{'raw':_0x48086b[_0x9629('0x18')]?_0x48086b[_0x9629('0x18')][_0x9629('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48086b[_0x9629('0x18')]?_0x48086b[_0x9629('0x18')]['where']||null:null,'attributes':_0x48086b[_0x9629('0x18')]?_0x48086b[_0x9629('0x18')][_0x9629('0x1d')]||null:null,'limit':_0x48086b[_0x9629('0x18')]?_0x48086b[_0x9629('0x18')][_0x9629('0x1e')]||null:null})[_0x9629('0x9')](function(_0x557db4){logger[_0x9629('0xa')](_0x9629('0x1a'),_0x48086b);logger[_0x9629('0xc')](_0x9629('0x1a'),_0x48086b,JSON[_0x9629('0xe')](_0x557db4));_0x188743(_0x557db4);})[_0x9629('0x14')](function(_0x24c8a2){logger['error']('UpdateChatQueueReport',_0x24c8a2[_0x9629('0x12')],_0x48086b);_0x17d860(_0x375bb5[_0x9629('0xf')](0x1f4,_0x24c8a2['message']));});});}; \ No newline at end of file +var _0x61f1=['UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','create','body','options','raw','catch'];(function(_0x1b664c,_0x173a00){var _0x2f359b=function(_0x2589ae){while(--_0x2589ae){_0x1b664c['push'](_0x1b664c['shift']());}};_0x2f359b(++_0x173a00);}(_0x61f1,0xde));var _0x161f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x61f1[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x161f('0x0'));var moment=require('moment');var BPromise=require(_0x161f('0x1'));var rs=require(_0x161f('0x2'));var fs=require('fs');var Redis=require(_0x161f('0x3'));var db=require(_0x161f('0x4'))['db'];var utils=require(_0x161f('0x5'));var logger=require(_0x161f('0x6'))(_0x161f('0x7'));var config=require(_0x161f('0x8'));var jayson=require(_0x161f('0x9'));var client=jayson[_0x161f('0xa')][_0x161f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x596bd9,_0x275a56,_0x19a931){return new BPromise(function(_0x458e0,_0x1281a9){return client[_0x161f('0xc')](_0x596bd9,_0x19a931)[_0x161f('0xd')](function(_0x100834){logger[_0x161f('0xe')](_0x161f('0xf'),_0x275a56,_0x161f('0x10'));logger[_0x161f('0x11')](_0x161f('0x12'),_0x275a56,_0x161f('0x10'),JSON[_0x161f('0x13')](_0x100834));if(_0x100834[_0x161f('0x14')]){if(_0x100834['error'][_0x161f('0x15')]===0x1f4){logger[_0x161f('0x14')](_0x161f('0xf'),_0x275a56,_0x100834[_0x161f('0x14')]['message']);return _0x1281a9(_0x100834['error'][_0x161f('0x16')]);}logger[_0x161f('0x14')](_0x161f('0xf'),_0x275a56,_0x100834[_0x161f('0x14')][_0x161f('0x16')]);return _0x458e0(_0x100834[_0x161f('0x14')]['message']);}else{logger['info'](_0x161f('0xf'),_0x275a56,'request\x20sent');_0x458e0(_0x100834[_0x161f('0x17')][_0x161f('0x16')]);}})['catch'](function(_0x170f0b){logger['error'](_0x161f('0xf'),_0x275a56,_0x170f0b);_0x1281a9(_0x170f0b);});});}exports[_0x161f('0x18')]=function(_0x105eb8){var _0x2161e8=this;return new Promise(function(_0x9d93ce,_0x434f16){return db['ChatQueueReport'][_0x161f('0x19')](_0x105eb8[_0x161f('0x1a')],{'raw':_0x105eb8[_0x161f('0x1b')]?_0x105eb8[_0x161f('0x1b')][_0x161f('0x1c')]===undefined?!![]:![]:!![]})[_0x161f('0xd')](function(_0x326702){logger['info'](_0x161f('0x18'),_0x105eb8);logger[_0x161f('0x11')](_0x161f('0x18'),_0x105eb8,JSON[_0x161f('0x13')](_0x326702));_0x9d93ce(_0x326702);})[_0x161f('0x1d')](function(_0x32987b){logger[_0x161f('0x14')]('CreateChatQueueReport',_0x32987b['message'],_0x105eb8);_0x434f16(_0x2161e8[_0x161f('0x14')](0x1f4,_0x32987b[_0x161f('0x16')]));});});};exports[_0x161f('0x1e')]=function(_0x27236a){var _0x4ab4f8=this;return new Promise(function(_0x93cd8e,_0xab9dbb){return db[_0x161f('0x1f')][_0x161f('0x20')](_0x27236a[_0x161f('0x1a')],{'raw':_0x27236a[_0x161f('0x1b')]?_0x27236a[_0x161f('0x1b')][_0x161f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27236a[_0x161f('0x1b')]?_0x27236a[_0x161f('0x1b')][_0x161f('0x21')]||null:null,'attributes':_0x27236a[_0x161f('0x1b')]?_0x27236a[_0x161f('0x1b')][_0x161f('0x22')]||null:null,'limit':_0x27236a['options']?_0x27236a[_0x161f('0x1b')][_0x161f('0x23')]||null:null})[_0x161f('0xd')](function(_0x19eba3){logger[_0x161f('0xe')]('UpdateChatQueueReport',_0x27236a);logger[_0x161f('0x11')](_0x161f('0x1e'),_0x27236a,JSON[_0x161f('0x13')](_0x19eba3));_0x93cd8e(_0x19eba3);})['catch'](function(_0x266882){logger['error']('UpdateChatQueueReport',_0x266882[_0x161f('0x16')],_0x27236a);_0xab9dbb(_0x4ab4f8[_0x161f('0x14')](0x1f4,_0x266882['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 54aacd7..d354dcb 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 _0x513f=['index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','express','../../config/environment','./chatQueueReport.controller','get'];(function(_0x4b5528,_0x5c2d2a){var _0x2a8b15=function(_0x3aefc9){while(--_0x3aefc9){_0x4b5528['push'](_0x4b5528['shift']());}};_0x2a8b15(++_0x5c2d2a);}(_0x513f,0x107));var _0xf513=function(_0x34f0af,_0x13fc50){_0x34f0af=_0x34f0af-0x0;var _0x432a27=_0x513f[_0x34f0af];return _0x432a27;};'use strict';var multer=require(_0xf513('0x0'));var util=require(_0xf513('0x1'));var path=require(_0xf513('0x2'));var timeout=require('connect-timeout');var express=require(_0xf513('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(_0xf513('0x4'));var controller=require(_0xf513('0x5'));router[_0xf513('0x6')]('/',auth['isAuthenticated'](),controller[_0xf513('0x7')]);router[_0xf513('0x6')](_0xf513('0x8'),auth['isAuthenticated'](),controller[_0xf513('0x9')]);router[_0xf513('0x6')](_0xf513('0xa'),auth[_0xf513('0xb')](),controller[_0xf513('0xc')]);router[_0xf513('0xd')]('/',auth['isAuthenticated'](),controller[_0xf513('0xe')]);router[_0xf513('0xf')](_0xf513('0xa'),auth['isAuthenticated'](),controller[_0xf513('0x10')]);router[_0xf513('0x11')]('/:id',auth[_0xf513('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbcfb=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','put','destroy'];(function(_0x538b31,_0x80e294){var _0x4348f0=function(_0x428ae3){while(--_0x428ae3){_0x538b31['push'](_0x538b31['shift']());}};_0x4348f0(++_0x80e294);}(_0xbcfb,0x9a));var _0xbbcf=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xbcfb[_0x1347f8];return _0x218368;};'use strict';var multer=require(_0xbbcf('0x0'));var util=require(_0xbbcf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbbcf('0x2'));var router=express[_0xbbcf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbbcf('0x4'));var interaction=require(_0xbbcf('0x5'));var config=require(_0xbbcf('0x6'));var controller=require(_0xbbcf('0x7'));router[_0xbbcf('0x8')]('/',auth[_0xbbcf('0x9')](),controller['index']);router[_0xbbcf('0x8')](_0xbbcf('0xa'),auth[_0xbbcf('0x9')](),controller[_0xbbcf('0xb')]);router[_0xbbcf('0x8')](_0xbbcf('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbbcf('0xd')]('/',auth[_0xbbcf('0x9')](),controller['create']);router[_0xbbcf('0xe')](_0xbbcf('0xc'),auth[_0xbbcf('0x9')](),controller['update']);router['delete'](_0xbbcf('0xc'),auth[_0xbbcf('0x9')](),controller[_0xbbcf('0xf')]);module[_0xbbcf('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 156885c..f7d7d1d 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x364987,_0x6873c5){var _0x5b899e=function(_0x4d5e5d){while(--_0x4d5e5d){_0x364987['push'](_0x364987['shift']());}};_0x5b899e(++_0x6873c5);}(_0xe706,0xa3));var _0x6e70=function(_0x588783,_0x550af0){_0x588783=_0x588783-0x0;var _0x146ed6=_0xe706[_0x588783];return _0x146ed6;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x9bde,0xe1));var _0xe9bd=function(_0x188f6e,_0x2b865f){_0x188f6e=_0x188f6e-0x0;var _0xab0246=_0x9bde[_0x188f6e];return _0xab0246;};'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 diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 91ac792..99ff401 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 _0xc036=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','ChatTransferReport','findAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','model','query'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xc036,0x13a));var _0x6c03=function(_0x4ceaa8,_0x452176){_0x4ceaa8=_0x4ceaa8-0x0;var _0x94bff6=_0xc036[_0x4ceaa8];return _0x94bff6;};'use strict';var emlformat=require(_0x6c03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c03('0x1'));var jsonpatch=require(_0x6c03('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6c03('0x3'));var util=require(_0x6c03('0x4'));var path=require(_0x6c03('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c03('0x6'));var fs=require('fs');var fs_extra=require(_0x6c03('0x7'));var _=require(_0x6c03('0x8'));var squel=require(_0x6c03('0x9'));var crypto=require('crypto');var jsforce=require(_0x6c03('0xa'));var deskjs=require(_0x6c03('0xb'));var toCsv=require(_0x6c03('0xc'));var querystring=require(_0x6c03('0xd'));var Papa=require(_0x6c03('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c03('0xf'));var as=require(_0x6c03('0x10'));var hardwareService=require(_0x6c03('0x11'));var logger=require('../../config/logger')(_0x6c03('0x12'));var utils=require(_0x6c03('0x13'));var config=require(_0x6c03('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c03('0x15'))['db'];function respondWithStatusCode(_0x3c4ec7,_0x62555b){_0x62555b=_0x62555b||0xcc;return function(_0x17bb6a){if(_0x17bb6a){return _0x3c4ec7[_0x6c03('0x16')](_0x62555b);}return _0x3c4ec7[_0x6c03('0x17')](_0x62555b)[_0x6c03('0x18')]();};}function respondWithResult(_0x4a9c13,_0x3702e8){_0x3702e8=_0x3702e8||0xc8;return function(_0x467b6a){if(_0x467b6a){return _0x4a9c13['status'](_0x3702e8)[_0x6c03('0x19')](_0x467b6a);}};}function respondWithFilteredResult(_0x571624,_0x526fdb){return function(_0x1d9b5d){if(_0x1d9b5d){var _0x998bf7=typeof _0x526fdb[_0x6c03('0x1a')]===_0x6c03('0x1b')&&typeof _0x526fdb[_0x6c03('0x1c')]===_0x6c03('0x1b');var _0x4ba306=_0x1d9b5d[_0x6c03('0x1d')];var _0x1d142a=_0x998bf7?0x0:_0x526fdb['offset'];var _0x5036ac=_0x998bf7?_0x1d9b5d[_0x6c03('0x1d')]:_0x526fdb['offset']+_0x526fdb['limit'];var _0x32fa60;if(_0x5036ac>=_0x4ba306){_0x5036ac=_0x4ba306;_0x32fa60=0xc8;}else{_0x32fa60=0xce;}_0x571624[_0x6c03('0x17')](_0x32fa60);return _0x571624[_0x6c03('0x1e')]('Content-Range',_0x1d142a+'-'+_0x5036ac+'/'+_0x4ba306)[_0x6c03('0x19')](_0x1d9b5d);}return null;};}function patchUpdates(_0x294b0a){return function(_0x54afa0){try{jsonpatch[_0x6c03('0x1f')](_0x54afa0,_0x294b0a,!![]);}catch(_0xb326bc){return BPromise[_0x6c03('0x20')](_0xb326bc);}return _0x54afa0[_0x6c03('0x21')]();};}function saveUpdates(_0x39974f,_0x26b413){return function(_0x532aca){if(_0x532aca){return _0x532aca[_0x6c03('0x22')](_0x39974f)[_0x6c03('0x23')](function(_0x3495dd){return _0x3495dd;});}return null;};}function removeEntity(_0x16bb5e,_0x4c7d57){return function(_0xea7e19){if(_0xea7e19){return _0xea7e19[_0x6c03('0x24')]()[_0x6c03('0x23')](function(){_0x16bb5e[_0x6c03('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56c459,_0x4a4263){return function(_0x9928a4){if(!_0x9928a4){_0x56c459[_0x6c03('0x16')](0x194);}return _0x9928a4;};}function handleError(_0x267e62,_0x17a4a8){_0x17a4a8=_0x17a4a8||0x1f4;return function(_0x4e271c){logger[_0x6c03('0x25')](_0x4e271c['stack']);if(_0x4e271c[_0x6c03('0x26')]){delete _0x4e271c[_0x6c03('0x26')];}_0x267e62[_0x6c03('0x17')](_0x17a4a8)[_0x6c03('0x27')](_0x4e271c);};}exports[_0x6c03('0x28')]=function(_0x4b83b9,_0x3aac2b){var _0x45fbe2={},_0x326fee={},_0x38ed6e={'count':0x0,'rows':[]};var _0x4fbd2f=_[_0x6c03('0x29')](db['ChatTransferReport'][_0x6c03('0x2a')],function(_0x148f1a){return{'name':_0x148f1a['fieldName'],'type':_0x148f1a[_0x6c03('0x2b')]['key']};});_0x326fee[_0x6c03('0x2c')]=_[_0x6c03('0x29')](_0x4fbd2f,_0x6c03('0x26'));_0x326fee[_0x6c03('0x2d')]=_[_0x6c03('0x2e')](_0x4b83b9['query']);_0x326fee[_0x6c03('0x2f')]=_[_0x6c03('0x30')](_0x326fee[_0x6c03('0x2c')],_0x326fee[_0x6c03('0x2d')]);_0x45fbe2[_0x6c03('0x31')]=_['intersection'](_0x326fee[_0x6c03('0x2c')],qs[_0x6c03('0x32')](_0x4b83b9['query'][_0x6c03('0x32')]));_0x45fbe2['attributes']=_0x45fbe2['attributes'][_0x6c03('0x33')]?_0x45fbe2[_0x6c03('0x31')]:_0x326fee[_0x6c03('0x2c')];if(!_0x4b83b9['query'][_0x6c03('0x34')](_0x6c03('0x35'))){_0x45fbe2[_0x6c03('0x1c')]=qs[_0x6c03('0x1c')](_0x4b83b9[_0x6c03('0x2d')][_0x6c03('0x1c')]);_0x45fbe2[_0x6c03('0x1a')]=qs[_0x6c03('0x1a')](_0x4b83b9[_0x6c03('0x2d')]['offset']);}_0x45fbe2[_0x6c03('0x36')]=qs[_0x6c03('0x37')](_0x4b83b9[_0x6c03('0x2d')][_0x6c03('0x37')]);_0x45fbe2['where']=qs[_0x6c03('0x2f')](_[_0x6c03('0x38')](_0x4b83b9[_0x6c03('0x2d')],_0x326fee[_0x6c03('0x2f')]),_0x4fbd2f);if(_0x4b83b9['query'][_0x6c03('0x39')]){_0x45fbe2[_0x6c03('0x3a')]=_['merge'](_0x45fbe2[_0x6c03('0x3a')],{'$or':_[_0x6c03('0x29')](_0x4fbd2f,function(_0x4c4cd4){if(_0x4c4cd4[_0x6c03('0x2b')]!==_0x6c03('0x3b')){var _0x1413ad={};_0x1413ad[_0x4c4cd4[_0x6c03('0x26')]]={'$like':'%'+_0x4b83b9[_0x6c03('0x2d')][_0x6c03('0x39')]+'%'};return _0x1413ad;}})});}_0x45fbe2=_[_0x6c03('0x3c')]({},_0x45fbe2,_0x4b83b9['options']);var _0x41f39b={'where':_0x45fbe2[_0x6c03('0x3a')]};return db['ChatTransferReport'][_0x6c03('0x1d')](_0x41f39b)[_0x6c03('0x23')](function(_0x28247b){_0x38ed6e['count']=_0x28247b;if(_0x4b83b9[_0x6c03('0x2d')][_0x6c03('0x3d')]){_0x45fbe2[_0x6c03('0x3e')]=[{'all':!![]}];}return db[_0x6c03('0x3f')][_0x6c03('0x40')](_0x45fbe2);})[_0x6c03('0x23')](function(_0x300529){_0x38ed6e['rows']=_0x300529;return _0x38ed6e;})[_0x6c03('0x23')](respondWithFilteredResult(_0x3aac2b,_0x45fbe2))[_0x6c03('0x41')](handleError(_0x3aac2b,null));};exports[_0x6c03('0x42')]=function(_0x492535,_0x8ce138){var _0x19e85e={'raw':!![],'where':{'id':_0x492535[_0x6c03('0x43')]['id']}},_0x3e1735={};_0x3e1735[_0x6c03('0x2c')]=_[_0x6c03('0x2e')](db[_0x6c03('0x3f')][_0x6c03('0x2a')]);_0x3e1735['query']=_[_0x6c03('0x2e')](_0x492535[_0x6c03('0x2d')]);_0x3e1735[_0x6c03('0x2f')]=_[_0x6c03('0x30')](_0x3e1735['model'],_0x3e1735['query']);_0x19e85e[_0x6c03('0x31')]=_['intersection'](_0x3e1735['model'],qs[_0x6c03('0x32')](_0x492535[_0x6c03('0x2d')]['fields']));_0x19e85e[_0x6c03('0x31')]=_0x19e85e[_0x6c03('0x31')][_0x6c03('0x33')]?_0x19e85e[_0x6c03('0x31')]:_0x3e1735['model'];if(_0x492535[_0x6c03('0x2d')][_0x6c03('0x3d')]){_0x19e85e['include']=[{'all':!![]}];}_0x19e85e=_[_0x6c03('0x3c')]({},_0x19e85e,_0x492535['options']);return db['ChatTransferReport']['find'](_0x19e85e)['then'](handleEntityNotFound(_0x8ce138,null))[_0x6c03('0x23')](respondWithResult(_0x8ce138,null))[_0x6c03('0x41')](handleError(_0x8ce138,null));};exports[_0x6c03('0x44')]=function(_0x3c32c3,_0x32807c){return db[_0x6c03('0x3f')][_0x6c03('0x44')](_0x3c32c3[_0x6c03('0x45')],{})[_0x6c03('0x23')](respondWithResult(_0x32807c,0xc9))[_0x6c03('0x41')](handleError(_0x32807c,null));};exports[_0x6c03('0x22')]=function(_0x55fae1,_0x224526){if(_0x55fae1['body']['id']){delete _0x55fae1[_0x6c03('0x45')]['id'];}return db['ChatTransferReport'][_0x6c03('0x46')]({'where':{'id':_0x55fae1[_0x6c03('0x43')]['id']}})[_0x6c03('0x23')](handleEntityNotFound(_0x224526,null))[_0x6c03('0x23')](saveUpdates(_0x55fae1[_0x6c03('0x45')],null))[_0x6c03('0x23')](respondWithResult(_0x224526,null))['catch'](handleError(_0x224526,null));};exports[_0x6c03('0x24')]=function(_0x2514d5,_0x4e34de){return db[_0x6c03('0x3f')][_0x6c03('0x46')]({'where':{'id':_0x2514d5[_0x6c03('0x43')]['id']}})[_0x6c03('0x23')](handleEntityNotFound(_0x4e34de,null))[_0x6c03('0x23')](removeEntity(_0x4e34de,null))[_0x6c03('0x41')](handleError(_0x4e34de,null));};exports[_0x6c03('0x47')]=function(_0xe5971,_0x3474c2){return db[_0x6c03('0x3f')][_0x6c03('0x47')]()['then'](respondWithResult(_0x3474c2,null))[_0x6c03('0x41')](handleError(_0x3474c2,null));}; \ No newline at end of file +var _0xa1f6=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes'];(function(_0x2443d9,_0x32d420){var _0x12f606=function(_0xc0e61c){while(--_0xc0e61c){_0x2443d9['push'](_0x2443d9['shift']());}};_0x12f606(++_0x32d420);}(_0xa1f6,0xad));var _0x6a1f=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xa1f6[_0x1573ea];return _0x51c0e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a1f('0x0'));var zipdir=require(_0x6a1f('0x1'));var jsonpatch=require(_0x6a1f('0x2'));var rp=require(_0x6a1f('0x3'));var moment=require(_0x6a1f('0x4'));var BPromise=require(_0x6a1f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6a1f('0x6'));var sox=require(_0x6a1f('0x7'));var csv=require(_0x6a1f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a1f('0x9'));var _=require(_0x6a1f('0xa'));var squel=require(_0x6a1f('0xb'));var crypto=require(_0x6a1f('0xc'));var jsforce=require(_0x6a1f('0xd'));var deskjs=require(_0x6a1f('0xe'));var toCsv=require(_0x6a1f('0x8'));var querystring=require(_0x6a1f('0xf'));var Papa=require(_0x6a1f('0x10'));var Redis=require(_0x6a1f('0x11'));var authService=require(_0x6a1f('0x12'));var qs=require(_0x6a1f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a1f('0x14'));var logger=require('../../config/logger')(_0x6a1f('0x15'));var utils=require(_0x6a1f('0x16'));var config=require(_0x6a1f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x18'))['db'];function respondWithStatusCode(_0x209f99,_0x251ff8){_0x251ff8=_0x251ff8||0xcc;return function(_0x38fb4a){if(_0x38fb4a){return _0x209f99[_0x6a1f('0x19')](_0x251ff8);}return _0x209f99[_0x6a1f('0x1a')](_0x251ff8)[_0x6a1f('0x1b')]();};}function respondWithResult(_0x89a07b,_0x4aa5f6){_0x4aa5f6=_0x4aa5f6||0xc8;return function(_0x4858de){if(_0x4858de){return _0x89a07b['status'](_0x4aa5f6)[_0x6a1f('0x1c')](_0x4858de);}};}function respondWithFilteredResult(_0x401f7b,_0x20f3c6){return function(_0x5ea9a2){if(_0x5ea9a2){var _0x137e06=typeof _0x20f3c6[_0x6a1f('0x1d')]==='undefined'&&typeof _0x20f3c6['limit']===_0x6a1f('0x1e');var _0x56f7e3=_0x5ea9a2[_0x6a1f('0x1f')];var _0x58736b=_0x137e06?0x0:_0x20f3c6[_0x6a1f('0x1d')];var _0x2fe673=_0x137e06?_0x5ea9a2[_0x6a1f('0x1f')]:_0x20f3c6[_0x6a1f('0x1d')]+_0x20f3c6[_0x6a1f('0x20')];var _0x2b4ba6;if(_0x2fe673>=_0x56f7e3){_0x2fe673=_0x56f7e3;_0x2b4ba6=0xc8;}else{_0x2b4ba6=0xce;}_0x401f7b[_0x6a1f('0x1a')](_0x2b4ba6);return _0x401f7b[_0x6a1f('0x21')](_0x6a1f('0x22'),_0x58736b+'-'+_0x2fe673+'/'+_0x56f7e3)[_0x6a1f('0x1c')](_0x5ea9a2);}return null;};}function patchUpdates(_0x29be0c){return function(_0x3ab0e7){try{jsonpatch['apply'](_0x3ab0e7,_0x29be0c,!![]);}catch(_0x4b3559){return BPromise[_0x6a1f('0x23')](_0x4b3559);}return _0x3ab0e7['save']();};}function saveUpdates(_0x579fff,_0x1d721c){return function(_0x25512d){if(_0x25512d){return _0x25512d[_0x6a1f('0x24')](_0x579fff)['then'](function(_0x27d29a){return _0x27d29a;});}return null;};}function removeEntity(_0x34736d,_0x282179){return function(_0x3bef75){if(_0x3bef75){return _0x3bef75['destroy']()[_0x6a1f('0x25')](function(){_0x34736d[_0x6a1f('0x1a')](0xcc)[_0x6a1f('0x1b')]();});}};}function handleEntityNotFound(_0x25aed8,_0x370ad2){return function(_0x3ae01e){if(!_0x3ae01e){_0x25aed8[_0x6a1f('0x19')](0x194);}return _0x3ae01e;};}function handleError(_0x57ff58,_0xb7bc51){_0xb7bc51=_0xb7bc51||0x1f4;return function(_0x2a48fa){logger[_0x6a1f('0x26')](_0x2a48fa['stack']);if(_0x2a48fa[_0x6a1f('0x27')]){delete _0x2a48fa[_0x6a1f('0x27')];}_0x57ff58[_0x6a1f('0x1a')](_0xb7bc51)[_0x6a1f('0x28')](_0x2a48fa);};}exports[_0x6a1f('0x29')]=function(_0x4f189e,_0x182c88){var _0xb6476c={},_0x1e56a8={},_0x4abb95={'count':0x0,'rows':[]};var _0xa50339=_['map'](db[_0x6a1f('0x2a')][_0x6a1f('0x2b')],function(_0x5caa84){return{'name':_0x5caa84[_0x6a1f('0x2c')],'type':_0x5caa84[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x1e56a8[_0x6a1f('0x2f')]=_[_0x6a1f('0x30')](_0xa50339,_0x6a1f('0x27'));_0x1e56a8['query']=_[_0x6a1f('0x31')](_0x4f189e[_0x6a1f('0x32')]);_0x1e56a8[_0x6a1f('0x33')]=_[_0x6a1f('0x34')](_0x1e56a8[_0x6a1f('0x2f')],_0x1e56a8[_0x6a1f('0x32')]);_0xb6476c['attributes']=_[_0x6a1f('0x34')](_0x1e56a8[_0x6a1f('0x2f')],qs[_0x6a1f('0x35')](_0x4f189e[_0x6a1f('0x32')][_0x6a1f('0x35')]));_0xb6476c[_0x6a1f('0x36')]=_0xb6476c[_0x6a1f('0x36')][_0x6a1f('0x37')]?_0xb6476c[_0x6a1f('0x36')]:_0x1e56a8[_0x6a1f('0x2f')];if(!_0x4f189e['query'][_0x6a1f('0x38')]('nolimit')){_0xb6476c[_0x6a1f('0x20')]=qs[_0x6a1f('0x20')](_0x4f189e[_0x6a1f('0x32')][_0x6a1f('0x20')]);_0xb6476c['offset']=qs['offset'](_0x4f189e[_0x6a1f('0x32')][_0x6a1f('0x1d')]);}_0xb6476c[_0x6a1f('0x39')]=qs[_0x6a1f('0x3a')](_0x4f189e[_0x6a1f('0x32')][_0x6a1f('0x3a')]);_0xb6476c[_0x6a1f('0x3b')]=qs['filters'](_[_0x6a1f('0x3c')](_0x4f189e[_0x6a1f('0x32')],_0x1e56a8['filters']),_0xa50339);if(_0x4f189e[_0x6a1f('0x32')][_0x6a1f('0x3d')]){_0xb6476c[_0x6a1f('0x3b')]=_[_0x6a1f('0x3e')](_0xb6476c['where'],{'$or':_['map'](_0xa50339,function(_0x41108a){if(_0x41108a[_0x6a1f('0x2d')]!==_0x6a1f('0x3f')){var _0x486d9e={};_0x486d9e[_0x41108a['name']]={'$like':'%'+_0x4f189e['query']['filter']+'%'};return _0x486d9e;}})});}_0xb6476c=_[_0x6a1f('0x3e')]({},_0xb6476c,_0x4f189e[_0x6a1f('0x40')]);var _0x136386={'where':_0xb6476c[_0x6a1f('0x3b')]};return db[_0x6a1f('0x2a')][_0x6a1f('0x1f')](_0x136386)[_0x6a1f('0x25')](function(_0x597795){_0x4abb95[_0x6a1f('0x1f')]=_0x597795;if(_0x4f189e['query'][_0x6a1f('0x41')]){_0xb6476c[_0x6a1f('0x42')]=[{'all':!![]}];}return db[_0x6a1f('0x2a')]['findAll'](_0xb6476c);})['then'](function(_0x3cfcc8){_0x4abb95[_0x6a1f('0x43')]=_0x3cfcc8;return _0x4abb95;})[_0x6a1f('0x25')](respondWithFilteredResult(_0x182c88,_0xb6476c))[_0x6a1f('0x44')](handleError(_0x182c88,null));};exports[_0x6a1f('0x45')]=function(_0x236924,_0x35df50){var _0x535f9d={'raw':!![],'where':{'id':_0x236924['params']['id']}},_0x3ff77d={};_0x3ff77d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db['ChatTransferReport'][_0x6a1f('0x2b')]);_0x3ff77d[_0x6a1f('0x32')]=_['keys'](_0x236924['query']);_0x3ff77d['filters']=_['intersection'](_0x3ff77d[_0x6a1f('0x2f')],_0x3ff77d['query']);_0x535f9d[_0x6a1f('0x36')]=_[_0x6a1f('0x34')](_0x3ff77d[_0x6a1f('0x2f')],qs['fields'](_0x236924[_0x6a1f('0x32')][_0x6a1f('0x35')]));_0x535f9d['attributes']=_0x535f9d['attributes'][_0x6a1f('0x37')]?_0x535f9d['attributes']:_0x3ff77d[_0x6a1f('0x2f')];if(_0x236924[_0x6a1f('0x32')][_0x6a1f('0x41')]){_0x535f9d[_0x6a1f('0x42')]=[{'all':!![]}];}_0x535f9d=_[_0x6a1f('0x3e')]({},_0x535f9d,_0x236924[_0x6a1f('0x40')]);return db[_0x6a1f('0x2a')]['find'](_0x535f9d)['then'](handleEntityNotFound(_0x35df50,null))['then'](respondWithResult(_0x35df50,null))['catch'](handleError(_0x35df50,null));};exports[_0x6a1f('0x46')]=function(_0x41f43b,_0x59094e){return db[_0x6a1f('0x2a')][_0x6a1f('0x46')](_0x41f43b[_0x6a1f('0x47')],{})['then'](respondWithResult(_0x59094e,0xc9))[_0x6a1f('0x44')](handleError(_0x59094e,null));};exports[_0x6a1f('0x24')]=function(_0x3bff6a,_0x59dffb){if(_0x3bff6a[_0x6a1f('0x47')]['id']){delete _0x3bff6a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2a')][_0x6a1f('0x48')]({'where':{'id':_0x3bff6a[_0x6a1f('0x49')]['id']}})[_0x6a1f('0x25')](handleEntityNotFound(_0x59dffb,null))['then'](saveUpdates(_0x3bff6a[_0x6a1f('0x47')],null))['then'](respondWithResult(_0x59dffb,null))['catch'](handleError(_0x59dffb,null));};exports[_0x6a1f('0x4a')]=function(_0x1aadea,_0x4fec90){return db[_0x6a1f('0x2a')][_0x6a1f('0x48')]({'where':{'id':_0x1aadea[_0x6a1f('0x49')]['id']}})[_0x6a1f('0x25')](handleEntityNotFound(_0x4fec90,null))[_0x6a1f('0x25')](removeEntity(_0x4fec90,null))[_0x6a1f('0x44')](handleError(_0x4fec90,null));};exports[_0x6a1f('0x4b')]=function(_0xc4aff1,_0x22b819){return db[_0x6a1f('0x2a')][_0x6a1f('0x4b')]()[_0x6a1f('0x25')](respondWithResult(_0x22b819,null))[_0x6a1f('0x44')](handleError(_0x22b819,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 71bec82..be868b3 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 _0x8772=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','ChatTransferReport'];(function(_0x56db66,_0x1a4f6c){var _0x5c8d9b=function(_0x1e9fcc){while(--_0x1e9fcc){_0x56db66['push'](_0x56db66['shift']());}};_0x5c8d9b(++_0x1a4f6c);}(_0x8772,0xac));var _0x2877=function(_0x24f326,_0x616a7){_0x24f326=_0x24f326-0x0;var _0x488e2d=_0x8772[_0x24f326];return _0x488e2d;};'use strict';var _=require(_0x2877('0x0'));var util=require(_0x2877('0x1'));var logger=require(_0x2877('0x2'))(_0x2877('0x3'));var moment=require(_0x2877('0x4'));var BPromise=require('bluebird');var rp=require(_0x2877('0x5'));var fs=require('fs');var path=require(_0x2877('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x52cd13,_0x345854){return _0x52cd13['define'](_0x2877('0x7'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x2877('0x8'),'fields':[_0x2877('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe10=['api','moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','util','../../config/logger'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xfe10,0x1a2));var _0x0fe1=function(_0x5a021d,_0x20c444){_0x5a021d=_0x5a021d-0x0;var _0x302da5=_0xfe10[_0x5a021d];return _0x302da5;};'use strict';var _=require('lodash');var util=require(_0x0fe1('0x0'));var logger=require(_0x0fe1('0x1'))(_0x0fe1('0x2'));var moment=require(_0x0fe1('0x3'));var BPromise=require(_0x0fe1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fe1('0x5'));var rimraf=require('rimraf');var config=require(_0x0fe1('0x6'));var attributes=require(_0x0fe1('0x7'));module[_0x0fe1('0x8')]=function(_0x32d7c3,_0x18df95){return _0x32d7c3[_0x0fe1('0x9')](_0x0fe1('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x0fe1('0xb'),'fields':[_0x0fe1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b1069c1..9d4bd94 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 _0xabd6=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xabd6,0x7a));var _0x6abd=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0xabd6[_0x5f46e7];return _0x567e95;};'use strict';var _=require(_0x6abd('0x0'));var util=require(_0x6abd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6abd('0x2'));var fs=require('fs');var Redis=require(_0x6abd('0x3'));var db=require(_0x6abd('0x4'))['db'];var utils=require(_0x6abd('0x5'));var logger=require(_0x6abd('0x6'))(_0x6abd('0x7'));var config=require(_0x6abd('0x8'));var jayson=require(_0x6abd('0x9'));var client=jayson[_0x6abd('0xa')][_0x6abd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4865af,_0x12e407,_0x473ef1){return new BPromise(function(_0x391090,_0x212ebe){return client[_0x6abd('0xc')](_0x4865af,_0x473ef1)[_0x6abd('0xd')](function(_0x5c7444){logger[_0x6abd('0xe')](_0x6abd('0xf'),_0x12e407,_0x6abd('0x10'));logger[_0x6abd('0x11')](_0x6abd('0x12'),_0x12e407,_0x6abd('0x10'),JSON['stringify'](_0x5c7444));if(_0x5c7444[_0x6abd('0x13')]){if(_0x5c7444[_0x6abd('0x13')]['code']===0x1f4){logger[_0x6abd('0x13')](_0x6abd('0xf'),_0x12e407,_0x5c7444['error']['message']);return _0x212ebe(_0x5c7444[_0x6abd('0x13')]['message']);}logger['error'](_0x6abd('0xf'),_0x12e407,_0x5c7444['error'][_0x6abd('0x14')]);return _0x391090(_0x5c7444['error'][_0x6abd('0x14')]);}else{logger[_0x6abd('0xe')](_0x6abd('0xf'),_0x12e407,_0x6abd('0x10'));_0x391090(_0x5c7444[_0x6abd('0x15')][_0x6abd('0x14')]);}})[_0x6abd('0x16')](function(_0x160626){logger[_0x6abd('0x13')](_0x6abd('0xf'),_0x12e407,_0x160626);_0x212ebe(_0x160626);});});} \ No newline at end of file +var _0x3f88=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3241d6,_0x2326d6){var _0x27a3cf=function(_0x199dd7){while(--_0x199dd7){_0x3241d6['push'](_0x3241d6['shift']());}};_0x27a3cf(++_0x2326d6);}(_0x3f88,0x179));var _0x83f8=function(_0x53c6a6,_0x491ffd){_0x53c6a6=_0x53c6a6-0x0;var _0xa76ba3=_0x3f88[_0x53c6a6];return _0xa76ba3;};'use strict';var _=require(_0x83f8('0x0'));var util=require(_0x83f8('0x1'));var moment=require(_0x83f8('0x2'));var BPromise=require(_0x83f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83f8('0x4'));var db=require(_0x83f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x83f8('0x6'))(_0x83f8('0x7'));var config=require(_0x83f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x83f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea9c6,_0x5cca65,_0x2c972c){return new BPromise(function(_0x44b79e,_0x330c89){return client['request'](_0x3ea9c6,_0x2c972c)[_0x83f8('0xa')](function(_0x21f95c){logger[_0x83f8('0xb')](_0x83f8('0xc'),_0x5cca65,_0x83f8('0xd'));logger[_0x83f8('0xe')](_0x83f8('0xf'),_0x5cca65,'request\x20sent',JSON['stringify'](_0x21f95c));if(_0x21f95c['error']){if(_0x21f95c[_0x83f8('0x10')][_0x83f8('0x11')]===0x1f4){logger[_0x83f8('0x10')](_0x83f8('0xc'),_0x5cca65,_0x21f95c[_0x83f8('0x10')][_0x83f8('0x12')]);return _0x330c89(_0x21f95c[_0x83f8('0x10')][_0x83f8('0x12')]);}logger[_0x83f8('0x10')](_0x83f8('0xc'),_0x5cca65,_0x21f95c[_0x83f8('0x10')][_0x83f8('0x12')]);return _0x44b79e(_0x21f95c[_0x83f8('0x10')][_0x83f8('0x12')]);}else{logger[_0x83f8('0xb')](_0x83f8('0xc'),_0x5cca65,_0x83f8('0xd'));_0x44b79e(_0x21f95c[_0x83f8('0x13')][_0x83f8('0x12')]);}})[_0x83f8('0x14')](function(_0x38bfe9){logger[_0x83f8('0x10')](_0x83f8('0xc'),_0x5cca65,_0x38bfe9);_0x330c89(_0x38bfe9);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 62b3fc2..341a6cf 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 _0xc37d=['./chatTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x442ccd,_0x415d61){var _0x1a2c10=function(_0x4ddd45){while(--_0x4ddd45){_0x442ccd['push'](_0x442ccd['shift']());}};_0x1a2c10(++_0x415d61);}(_0xc37d,0x9b));var _0xdc37=function(_0x3d655b,_0x5c0fd7){_0x3d655b=_0x3d655b-0x0;var _0x273514=_0xc37d[_0x3d655b];return _0x273514;};'use strict';var multer=require('multer');var util=require(_0xdc37('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc37('0x1'));var router=express[_0xdc37('0x2')]();var fs_extra=require(_0xdc37('0x3'));var auth=require(_0xdc37('0x4'));var interaction=require(_0xdc37('0x5'));var config=require(_0xdc37('0x6'));var controller=require(_0xdc37('0x7'));router[_0xdc37('0x8')]('/',auth[_0xdc37('0x9')](),controller['index']);router[_0xdc37('0x8')]('/describe',auth[_0xdc37('0x9')](),controller[_0xdc37('0xa')]);router[_0xdc37('0x8')](_0xdc37('0xb'),auth[_0xdc37('0x9')](),controller[_0xdc37('0xc')]);router[_0xdc37('0xd')]('/',auth[_0xdc37('0x9')](),controller[_0xdc37('0xe')]);router[_0xdc37('0xf')](_0xdc37('0xb'),auth[_0xdc37('0x9')](),controller['update']);router[_0xdc37('0x10')](_0xdc37('0xb'),auth[_0xdc37('0x9')](),controller['destroy']);module[_0xdc37('0x11')]=router; \ No newline at end of file +var _0x912e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','path','connect-timeout','express','Router','fs-extra'];(function(_0xa5a2db,_0x540c97){var _0xff251c=function(_0x548bb9){while(--_0x548bb9){_0xa5a2db['push'](_0xa5a2db['shift']());}};_0xff251c(++_0x540c97);}(_0x912e,0xe5));var _0xe912=function(_0x2fa3f6,_0x45925c){_0x2fa3f6=_0x2fa3f6-0x0;var _0x1192d5=_0x912e[_0x2fa3f6];return _0x1192d5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe912('0x0'));var timeout=require(_0xe912('0x1'));var express=require(_0xe912('0x2'));var router=express[_0xe912('0x3')]();var fs_extra=require(_0xe912('0x4'));var auth=require(_0xe912('0x5'));var interaction=require(_0xe912('0x6'));var config=require(_0xe912('0x7'));var controller=require('./chatTransferReport.controller');router[_0xe912('0x8')]('/',auth[_0xe912('0x9')](),controller[_0xe912('0xa')]);router[_0xe912('0x8')](_0xe912('0xb'),auth[_0xe912('0x9')](),controller['describe']);router[_0xe912('0x8')](_0xe912('0xc'),auth[_0xe912('0x9')](),controller[_0xe912('0xd')]);router['post']('/',auth[_0xe912('0x9')](),controller[_0xe912('0xe')]);router[_0xe912('0xf')](_0xe912('0xc'),auth[_0xe912('0x9')](),controller[_0xe912('0x10')]);router[_0xe912('0x11')]('/:id',auth[_0xe912('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index c79aeb0..06f5f16 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 _0xe5dd=['thumb','INTEGER','input','name','text','email','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','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}}','sequelize','randomstring','STRING','address','Agent','#011F6A','#ffffff','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star'];(function(_0x4d33d1,_0x3fe922){var _0x1f3396=function(_0x3a5b6e){while(--_0x3a5b6e){_0x4d33d1['push'](_0x4d33d1['shift']());}};_0x1f3396(++_0x3fe922);}(_0xe5dd,0xc4));var _0xde5d=function(_0x2d8ca3,_0x3e6a6d){_0x2d8ca3=_0x2d8ca3-0x0;var _0x41ae05=_0xe5dd[_0x2d8ca3];return _0x41ae05;};'use strict';var Sequelize=require(_0xde5d('0x0'));var rs=require(_0xde5d('0x1'));module['exports']={'name':{'type':Sequelize[_0xde5d('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xde5d('0x2')],'allowNull':![],'unique':_0xde5d('0x3')},'description':{'type':Sequelize[_0xde5d('0x2')]},'mapKey':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x4')},'customerAlias':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xde5d('0x2')],'allowNull':![],'defaultValue':_0xde5d('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xde5d('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde5d('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xde5d('0x7')](_0xde5d('0x8'),_0xde5d('0x9')),'defaultValue':_0xde5d('0x8')},'header_online':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0xa')},'start_chat_button':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0xb')},'header_offline':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0xc')},'download_transcript':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xde5d('0xf')]},'closingQuestion':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x12')},'noteTitle':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x13')},'placeholderMessage':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x15')},'closingMessageButton':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0xb')},'skipMessageButton':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x16')},'conditionAgreement':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xde5d('0x7')](_0xde5d('0x17'),_0xde5d('0x18')),'defaultValue':_0xde5d('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xde5d('0x19')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xde5d('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xde5d('0x1a'),'variable':null,'config':{'placeholder':_0xde5d('0x1b'),'type':_0xde5d('0x1c'),'required':!![]},'props':{'title':_0xde5d('0x1b'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xde5d('0x1d'),'type':_0xde5d('0x1d')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xde5d('0x1e')]('onlineForm')?JSON['parse'](this[_0xde5d('0x1e')](_0xde5d('0x1f'))):{};},'set':function(_0x424753){return this[_0xde5d('0x20')](_0xde5d('0x1f'),JSON[_0xde5d('0x21')](_0x424753));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xde5d('0x21')]({'items':[{'type':_0xde5d('0x1a'),'props':{'title':_0xde5d('0x1d'),'helpText':''},'config':{'required':!![],'placeholder':_0xde5d('0x1d'),'type':_0xde5d('0x1d')},'variable':null},{'type':_0xde5d('0x22'),'config':{'placeholder':_0xde5d('0x23')},'props':{'title':_0xde5d('0x23'),'helpText':_0xde5d('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xde5d('0x1e')](_0xde5d('0x25'))?JSON[_0xde5d('0x26')](this['getDataValue']('offlineForm')):{};},'set':function(_0x10caa1){return this[_0xde5d('0x20')]('offlineForm',JSON[_0xde5d('0x21')](_0x10caa1));}},'token':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':function(){return rs[_0xde5d('0x27')]();}},'autoclose':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xde5d('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x28')},'waitingMessage':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x29')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x2a')},'offlineMessageBody':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x2c')},'skipUnmanaged':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xde5d('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xde5d('0x2')]},'notificationTemplate':{'type':Sequelize[_0xde5d('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0xde5d('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xde5d('0x19')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':_0xde5d('0x2e')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x2f')},'defaultTitle':{'type':Sequelize[_0xde5d('0x2')]},'customerAvatar':{'type':Sequelize[_0xde5d('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xde5d('0x19')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde5d('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde5d('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xde5d('0x31')},'systemAvatar':{'type':Sequelize[_0xde5d('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde5d('0x19')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xde5d('0xd')],'defaultValue':![],'comment':_0xde5d('0x32'),'set':function(_0x429a16){if(!_0x429a16)this['setDataValue'](_0xde5d('0x33'),null);this[_0xde5d('0x20')](_0xde5d('0x34'),_0x429a16);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xde5d('0x2')]},'vidaooTopic':{'type':Sequelize[_0xde5d('0x2')],'allowNull':![],'defaultValue':_0xde5d('0x35')},'vidaooNote':{'type':Sequelize[_0xde5d('0x2')],'defaultValue':function(){return _0xde5d('0x36');}},'vidaooMetadata':{'type':Sequelize[_0xde5d('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xde5d('0xf')]}}; \ No newline at end of file +var _0x9ed9=['#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate'];(function(_0x522239,_0xcb4c67){var _0x30dc1d=function(_0x5b0a41){while(--_0x5b0a41){_0x522239['push'](_0x522239['shift']());}};_0x30dc1d(++_0xcb4c67);}(_0x9ed9,0xa2));var _0x99ed=function(_0x1c5d2a,_0x5a97c3){_0x1c5d2a=_0x1c5d2a-0x0;var _0x3c836f=_0x9ed9[_0x1c5d2a];return _0x3c836f;};'use strict';var Sequelize=require(_0x99ed('0x0'));var rs=require(_0x99ed('0x1'));module['exports']={'name':{'type':Sequelize[_0x99ed('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x99ed('0x2')]},'mapKey':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x4')},'customerAlias':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x99ed('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x99ed('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x99ed('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x99ed('0x2')]},'animation':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x99ed('0x7')](_0x99ed('0x8'),'squared'),'defaultValue':_0x99ed('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x99ed('0x9')},'start_chat_button':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0xa')},'offline_chat_button':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0xb')},'header_offline':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0xc')},'download_transcript':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x99ed('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x99ed('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x99ed('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x11')},'noteTitle':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x12')},'placeholderMessage':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x13')},'closingMessage':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x14')},'ratingType':{'type':Sequelize[_0x99ed('0x7')](_0x99ed('0x15'),_0x99ed('0x16')),'defaultValue':_0x99ed('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x99ed('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x99ed('0x17')],'defaultValue':function(){return JSON[_0x99ed('0x18')]({'items':[{'type':_0x99ed('0x19'),'variable':null,'config':{'placeholder':_0x99ed('0x1a'),'type':_0x99ed('0x1b'),'required':!![]},'props':{'title':_0x99ed('0x1a'),'helpText':''}},{'type':_0x99ed('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x99ed('0x3'),'type':_0x99ed('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x99ed('0x1c')](_0x99ed('0x1d'))?JSON[_0x99ed('0x1e')](this[_0x99ed('0x1c')]('onlineForm')):{};},'set':function(_0x2b3e42){return this['setDataValue'](_0x99ed('0x1d'),JSON[_0x99ed('0x18')](_0x2b3e42));}},'offlineForm':{'type':Sequelize[_0x99ed('0x17')],'defaultValue':function(){return JSON[_0x99ed('0x18')]({'items':[{'type':_0x99ed('0x19'),'props':{'title':_0x99ed('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x99ed('0x3'),'type':'email'},'variable':null},{'type':_0x99ed('0x1f'),'config':{'placeholder':_0x99ed('0x20')},'props':{'title':_0x99ed('0x20'),'helpText':_0x99ed('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x99ed('0x1c')](_0x99ed('0x22'))?JSON[_0x99ed('0x1e')](this['getDataValue'](_0x99ed('0x22'))):{};},'set':function(_0x2e390d){return this[_0x99ed('0x23')](_0x99ed('0x22'),JSON[_0x99ed('0x18')](_0x2e390d));}},'token':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':function(){return rs[_0x99ed('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x99ed('0x2')]},'forwardOffline':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x99ed('0x2')]},'waitingTitle':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x99ed('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x99ed('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x29')},'skipUnmanaged':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x2a')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x99ed('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x99ed('0x2b');}},'notificationSound':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':_0x99ed('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x99ed('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x99ed('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x99ed('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x99ed('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x99ed('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x99ed('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x99ed('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x99ed('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x99ed('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x99ed('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x480192){if(!_0x480192)this['setDataValue'](_0x99ed('0x30'),null);this['setDataValue'](_0x99ed('0x31'),_0x480192);}},'vidaooEscalation':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x99ed('0x2')]},'vidaooTopic':{'type':Sequelize[_0x99ed('0x2')],'allowNull':![],'defaultValue':_0x99ed('0x32')},'vidaooNote':{'type':Sequelize[_0x99ed('0x2')],'defaultValue':function(){return _0x99ed('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x99ed('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x99ed('0x17')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 5a0e6ab..a16addc 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 _0x5636=['undefined','limit','count','offset','Content-Range','update','then','destroy','get','ChatWebsites','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','include','findAll','rows','Pause','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','List','Applications','account','applications','list','orderBy','priority','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','vendor','format','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','mimetype','offline-chat','openNewInteraction','sequelize','transaction','bulkCreate','CloudProvider','Smtp','forwardOffline','getSmtpOptions','SendMail','email','forwardOfflineAddress','offlineMessageSubject','originalname','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','increment','all','some','remote','x-real-ip','remoteAddress','virtual','replace','alignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','stack','finally','json','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','online','false','offlineForm','items','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status'];(function(_0x4d0823,_0xfc61eb){var _0x38af3b=function(_0x571e43){while(--_0x571e43){_0x4d0823['push'](_0x4d0823['shift']());}};_0x38af3b(++_0xfc61eb);}(_0x5636,0x102));var _0x6563=function(_0x5e42e4,_0x457e1b){_0x5e42e4=_0x5e42e4-0x0;var _0x50b7e4=_0x5636[_0x5e42e4];return _0x50b7e4;};'use strict';var BPromise=require(_0x6563('0x0'));var Mustache=require(_0x6563('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6563('0x2'));var _=require(_0x6563('0x3'));var querystring=require(_0x6563('0x4'));var Redis=require('ioredis');var qs=require(_0x6563('0x5'));var logger=require(_0x6563('0x6'))(_0x6563('0x7'));var config=require(_0x6563('0x8'));var db=require(_0x6563('0x9'))['db'];config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x6563('0x10')][_0x6563('0x11')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client'][_0x6563('0x11')]({'port':0x232b});var client9001=jayson[_0x6563('0x10')][_0x6563('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x12429c,_0x33816e,_0x2ed676,_0x31d3fa){return new BPromise(function(_0xbbae72,_0x447f9a){var _0x51aeca=_0x31d3fa||client;return _0x51aeca[_0x6563('0x12')](_0x12429c,_0x2ed676)['then'](function(_0x37131e){logger[_0x6563('0x13')](_0x6563('0x14'),_0x33816e,_0x6563('0x15'));logger['debug'](_0x6563('0x16'),_0x33816e,_0x6563('0x15'),JSON[_0x6563('0x17')](_0x37131e));if(_0x37131e[_0x6563('0x18')]){if(_0x37131e['error'][_0x6563('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x33816e,_0x37131e['error'][_0x6563('0x1a')]);return _0x447f9a(_0x37131e['error']['message']);}logger[_0x6563('0x18')](_0x6563('0x14'),_0x33816e,_0x37131e[_0x6563('0x18')][_0x6563('0x1a')]);return _0xbbae72(_0x37131e[_0x6563('0x18')][_0x6563('0x1a')]);}else{logger[_0x6563('0x13')](_0x6563('0x14'),_0x33816e,_0x6563('0x15'));_0xbbae72(_0x37131e['result'][_0x6563('0x1a')]);}})[_0x6563('0x1b')](function(_0x20b478){logger['error'](_0x6563('0x14'),_0x33816e,_0x20b478);_0x447f9a(_0x20b478);});});}function respondWithStatusCode(_0x5c37bb,_0x5953c5){_0x5953c5=_0x5953c5||0xcc;return function(_0x105379){if(_0x105379){return _0x5c37bb['sendStatus'](_0x5953c5);}return _0x5c37bb['status'](_0x5953c5)[_0x6563('0x1c')]();};}function respondWithResult(_0x492f45,_0x1097d0){_0x1097d0=_0x1097d0||0xc8;return function(_0x19f34e){if(_0x19f34e){return _0x492f45[_0x6563('0x1d')](_0x1097d0)['json'](_0x19f34e);}};}function respondWithFilteredResult(_0xd860d5,_0x51ff06){return function(_0x7ea857){if(_0x7ea857){var _0x1590e6=typeof _0x51ff06['offset']===_0x6563('0x1e')&&typeof _0x51ff06[_0x6563('0x1f')]==='undefined';var _0x2ddb2b=_0x7ea857['count'];var _0x1fe1cb=_0x1590e6?0x0:_0x51ff06['offset'];var _0x480408=_0x1590e6?_0x7ea857[_0x6563('0x20')]:_0x51ff06[_0x6563('0x21')]+_0x51ff06[_0x6563('0x1f')];var _0x2a1550;if(_0x480408>=_0x2ddb2b){_0x480408=_0x2ddb2b;_0x2a1550=0xc8;}else{_0x2a1550=0xce;}_0xd860d5[_0x6563('0x1d')](_0x2a1550);return _0xd860d5['set'](_0x6563('0x22'),_0x1fe1cb+'-'+_0x480408+'/'+_0x2ddb2b)['json'](_0x7ea857);}return null;};}function saveUpdates(_0x5b100b){return function(_0x3582c9){if(_0x3582c9){return _0x3582c9[_0x6563('0x23')](_0x5b100b)[_0x6563('0x24')](function(_0xdbbdda){return _0xdbbdda;});}return null;};}function removeEntity(_0x116605){return function(_0x305861){if(_0x305861){return _0x305861[_0x6563('0x25')]()[_0x6563('0x24')](function(){var _0x101b24=_0x305861[_0x6563('0x26')]({'plain':!![]});var _0x59b1a6=_0x6563('0x27');return db[_0x6563('0x28')][_0x6563('0x25')]({'where':{'type':_0x59b1a6,'resourceId':_0x101b24['id']}})[_0x6563('0x24')](function(){return _0x305861;});})[_0x6563('0x24')](function(){_0x116605[_0x6563('0x1d')](0xcc)[_0x6563('0x1c')]();});}};}function handleEntityNotFound(_0x571f86){return function(_0x8cf1){if(!_0x8cf1){_0x571f86[_0x6563('0x29')](0x194);}return _0x8cf1;};}function handleError(_0x449e91,_0x46fb1b){_0x46fb1b=_0x46fb1b||0x1f4;return function(_0x3f79da){logger[_0x6563('0x18')](_0x3f79da['stack']);if(_0x3f79da[_0x6563('0x2a')]){delete _0x3f79da[_0x6563('0x2a')];}_0x449e91[_0x6563('0x1d')](_0x46fb1b)[_0x6563('0x2b')](_0x3f79da);};}exports[_0x6563('0x2c')]=function(_0x10d14a,_0x3f578a){var _0x4cc655={'include':[{'model':db['Pause'],'as':_0x6563('0x2d')}]},_0x1925cc={},_0x394120={'count':0x0,'rows':[]};var _0x1ff47d=_['map'](db['ChatWebsite'][_0x6563('0x2e')],function(_0x5ca0ab){return{'name':_0x5ca0ab[_0x6563('0x2f')],'type':_0x5ca0ab[_0x6563('0x30')]['key']};});_0x1925cc[_0x6563('0x31')]=_[_0x6563('0x32')](_0x1ff47d,'name');_0x1925cc[_0x6563('0x33')]=_[_0x6563('0x34')](_0x10d14a[_0x6563('0x33')]);_0x1925cc[_0x6563('0x35')]=_[_0x6563('0x36')](_0x1925cc[_0x6563('0x31')],_0x1925cc[_0x6563('0x33')]);_0x4cc655[_0x6563('0x37')]=_[_0x6563('0x36')](_0x1925cc['model'],qs[_0x6563('0x38')](_0x10d14a[_0x6563('0x33')][_0x6563('0x38')]));_0x4cc655[_0x6563('0x37')]=_0x4cc655['attributes']['length']?_0x4cc655[_0x6563('0x37')]:_0x1925cc[_0x6563('0x31')];if(!_0x10d14a[_0x6563('0x33')]['hasOwnProperty'](_0x6563('0x39'))){_0x4cc655['limit']=qs[_0x6563('0x1f')](_0x10d14a[_0x6563('0x33')]['limit']);_0x4cc655[_0x6563('0x21')]=qs[_0x6563('0x21')](_0x10d14a[_0x6563('0x33')][_0x6563('0x21')]);}_0x4cc655[_0x6563('0x3a')]=qs[_0x6563('0x3b')](_0x10d14a[_0x6563('0x33')][_0x6563('0x3b')]);_0x4cc655[_0x6563('0x3c')]=qs[_0x6563('0x35')](_[_0x6563('0x3d')](_0x10d14a['query'],_0x1925cc['filters']),_0x1ff47d);if(_0x10d14a[_0x6563('0x33')][_0x6563('0x3e')]){_0x4cc655[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0x4cc655[_0x6563('0x3c')],{'$or':_[_0x6563('0x32')](_0x1ff47d,function(_0x27024c){if(_0x27024c['type']!==_0x6563('0x40')){var _0x52f709={};_0x52f709[_0x27024c[_0x6563('0x2a')]]={'$like':'%'+_0x10d14a[_0x6563('0x33')]['filter']+'%'};return _0x52f709;}})});}_0x4cc655=_[_0x6563('0x3f')]({},_0x4cc655,_0x10d14a[_0x6563('0x41')]);var _0x15e86b={'where':_0x4cc655[_0x6563('0x3c')]};return db[_0x6563('0x42')]['count'](_0x15e86b)['then'](function(_0x1504ca){_0x394120[_0x6563('0x20')]=_0x1504ca;if(_0x10d14a[_0x6563('0x33')]['includeAll']){_0x4cc655[_0x6563('0x43')]=[{'all':!![]}];}return db[_0x6563('0x42')][_0x6563('0x44')](_0x4cc655);})[_0x6563('0x24')](function(_0x59e44f){_0x394120[_0x6563('0x45')]=_0x59e44f;return _0x394120;})[_0x6563('0x24')](respondWithFilteredResult(_0x3f578a,_0x4cc655))[_0x6563('0x1b')](handleError(_0x3f578a,null));};exports['show']=function(_0x35b0ce,_0x4bcfff){var _0xb80d6a={'raw':![],'where':{'id':_0x35b0ce['params']['id']},'include':[{'model':db[_0x6563('0x46')],'as':_0x6563('0x2d')}]},_0x4c5048={};_0x4c5048[_0x6563('0x31')]=_[_0x6563('0x34')](db[_0x6563('0x42')][_0x6563('0x2e')]);_0x4c5048[_0x6563('0x33')]=_[_0x6563('0x34')](_0x35b0ce[_0x6563('0x33')]);_0x4c5048[_0x6563('0x35')]=_['intersection'](_0x4c5048[_0x6563('0x31')],_0x4c5048['query']);_0xb80d6a[_0x6563('0x37')]=_[_0x6563('0x36')](_0x4c5048[_0x6563('0x31')],qs['fields'](_0x35b0ce[_0x6563('0x33')][_0x6563('0x38')]));_0xb80d6a['attributes']=_0xb80d6a[_0x6563('0x37')][_0x6563('0x47')]?_0xb80d6a[_0x6563('0x37')]:_0x4c5048[_0x6563('0x31')];if(_0x35b0ce[_0x6563('0x33')]['includeAll']){_0xb80d6a[_0x6563('0x43')]=[{'all':!![]}];}_0xb80d6a=_['merge']({},_0xb80d6a,_0x35b0ce[_0x6563('0x41')]);return db['ChatWebsite'][_0x6563('0x48')](_0xb80d6a)['then'](handleEntityNotFound(_0x4bcfff,null))['then'](respondWithResult(_0x4bcfff,null))['catch'](handleError(_0x4bcfff,null));};exports['create']=function(_0x270667,_0x5ade56){return db[_0x6563('0x42')]['create'](_0x270667[_0x6563('0x49')],{})[_0x6563('0x24')](function(_0x426664){var _0x32ebac=_0x270667[_0x6563('0x4a')][_0x6563('0x26')]({'plain':!![]});if(!_0x32ebac)throw new Error(_0x6563('0x4b'));if(_0x32ebac[_0x6563('0x4c')]===_0x6563('0x4a')){var _0x5827da=_0x426664[_0x6563('0x26')]({'plain':!![]});var _0x28b1c6=_0x6563('0x27');return db[_0x6563('0x4d')][_0x6563('0x48')]({'where':{'name':_0x28b1c6,'userProfileId':_0x32ebac[_0x6563('0x4e')]},'raw':!![]})[_0x6563('0x24')](function(_0x32c715){if(_0x32c715&&_0x32c715[_0x6563('0x4f')]===0x0){return db[_0x6563('0x28')][_0x6563('0x50')]({'name':_0x5827da['name'],'resourceId':_0x5827da['id'],'type':_0x32c715[_0x6563('0x2a')],'sectionId':_0x32c715['id']},{})[_0x6563('0x24')](function(){return _0x426664;});}else{return _0x426664;}})[_0x6563('0x1b')](function(_0x2e9c69){logger[_0x6563('0x18')](_0x6563('0x51'),_0x2e9c69);throw _0x2e9c69;});}return _0x426664;})[_0x6563('0x24')](respondWithResult(_0x5ade56,0xc9))[_0x6563('0x1b')](handleError(_0x5ade56,null));};exports['update']=function(_0xbfb2a6,_0x4f51d2){if(_0xbfb2a6[_0x6563('0x49')]['id']){delete _0xbfb2a6[_0x6563('0x49')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0xbfb2a6[_0x6563('0x52')]['id']},'include':[{'model':db[_0x6563('0x46')],'as':_0x6563('0x2d')}]})[_0x6563('0x24')](handleEntityNotFound(_0x4f51d2,null))['then'](saveUpdates(_0xbfb2a6[_0x6563('0x49')],null))['then'](respondWithResult(_0x4f51d2,null))[_0x6563('0x1b')](handleError(_0x4f51d2,null));};exports[_0x6563('0x25')]=function(_0x5b0fe8,_0x5ca0d5){return db[_0x6563('0x42')]['find']({'where':{'id':_0x5b0fe8['params']['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x5ca0d5,null))['then'](removeEntity(_0x5ca0d5,null))[_0x6563('0x1b')](handleError(_0x5ca0d5,null));};exports[_0x6563('0x53')]=function(_0x1de316,_0x21d111){return db['ChatWebsite'][_0x6563('0x53')]()[_0x6563('0x24')](respondWithResult(_0x21d111,null))[_0x6563('0x1b')](handleError(_0x21d111,null));};exports[_0x6563('0x54')]=function(_0x3ffb7f,_0x2d4694){if(_0x3ffb7f[_0x6563('0x49')]['id']){delete _0x3ffb7f[_0x6563('0x49')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3ffb7f[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x2d4694,null))['then'](function(_0x5924a3){if(_0x5924a3){_0x3ffb7f['body'][_0x6563('0x55')]=_0x5924a3['id'];return db[_0x6563('0x56')][_0x6563('0x50')](_0x3ffb7f[_0x6563('0x49')]);}})['then'](respondWithResult(_0x2d4694,null))[_0x6563('0x1b')](handleError(_0x2d4694,null));};exports[_0x6563('0x57')]=function(_0x386597,_0x3647b0){var _0xb55389={'raw':![],'where':{}};var _0x4e4e6d={};var _0x4fd7fc={'count':0x0,'rows':[]};return db[_0x6563('0x42')][_0x6563('0x58')]({'where':{'id':_0x386597[_0x6563('0x52')]['id']}})['then'](handleEntityNotFound(_0x3647b0,null))[_0x6563('0x24')](function(_0x5e8a05){if(_0x5e8a05){_0x4e4e6d[_0x6563('0x31')]=_[_0x6563('0x34')](db[_0x6563('0x56')][_0x6563('0x2e')]);_0x4e4e6d[_0x6563('0x33')]=_[_0x6563('0x34')](_0x386597[_0x6563('0x33')]);_0x4e4e6d['filters']=_['intersection'](_0x4e4e6d[_0x6563('0x31')],_0x4e4e6d[_0x6563('0x33')]);_0xb55389[_0x6563('0x37')]=_[_0x6563('0x36')](_0x4e4e6d[_0x6563('0x31')],qs[_0x6563('0x38')](_0x386597['query']['fields']));_0xb55389['attributes']=_0xb55389[_0x6563('0x37')][_0x6563('0x47')]?_0xb55389[_0x6563('0x37')]:_0x4e4e6d[_0x6563('0x31')];if(!_0x386597[_0x6563('0x33')]['hasOwnProperty'](_0x6563('0x39'))){_0xb55389[_0x6563('0x1f')]=qs[_0x6563('0x1f')](_0x386597[_0x6563('0x33')]['limit']);_0xb55389[_0x6563('0x21')]=qs[_0x6563('0x21')](_0x386597[_0x6563('0x33')][_0x6563('0x21')]);}_0xb55389[_0x6563('0x3a')]=qs[_0x6563('0x3b')](_0x386597[_0x6563('0x33')][_0x6563('0x3b')]);_0xb55389[_0x6563('0x3c')]=qs[_0x6563('0x35')](_[_0x6563('0x3d')](_0x386597[_0x6563('0x33')],_0x4e4e6d[_0x6563('0x35')]));_0xb55389[_0x6563('0x3c')][_0x6563('0x55')]=_0x5e8a05['id'];if(_0x386597['query'][_0x6563('0x3e')]){_0xb55389[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0xb55389[_0x6563('0x3c')],{'$or':_[_0x6563('0x32')](_0xb55389[_0x6563('0x37')],function(_0x3fd214){var _0x23551d={};_0x23551d[_0x3fd214]={'$like':'%'+_0x386597[_0x6563('0x33')][_0x6563('0x3e')]+'%'};return _0x23551d;})});}_0xb55389=_['merge']({},_0xb55389,_0x386597[_0x6563('0x41')]);return db[_0x6563('0x56')][_0x6563('0x20')]({'where':_0xb55389[_0x6563('0x3c')]})[_0x6563('0x24')](function(_0xf37913){_0x4fd7fc[_0x6563('0x20')]=_0xf37913;if(_0x386597['query'][_0x6563('0x59')]){_0xb55389[_0x6563('0x43')]=[{'all':!![]}];}return db[_0x6563('0x56')][_0x6563('0x44')](_0xb55389);})[_0x6563('0x24')](function(_0x241e73){_0x4fd7fc['rows']=_0x241e73;return _0x4fd7fc;});}})[_0x6563('0x24')](respondWithFilteredResult(_0x3647b0,_0xb55389))[_0x6563('0x1b')](handleError(_0x3647b0,null));};exports[_0x6563('0x5a')]=function(_0x4ff0fa,_0x38267c){return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x4ff0fa['params']['id']}})['then'](handleEntityNotFound(_0x38267c,null))['then'](function(_0x2712b4){if(_0x2712b4){return _0x2712b4[_0x6563('0x5a')](_0x4ff0fa[_0x6563('0x33')][_0x6563('0x5b')]);}})['then'](respondWithStatusCode(_0x38267c,null))[_0x6563('0x1b')](handleError(_0x38267c,null));};exports[_0x6563('0x5c')]=function(_0x50e7b4,_0x4ef39c){if(_0x50e7b4[_0x6563('0x49')]['id']){delete _0x50e7b4[_0x6563('0x49')]['id'];}return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x50e7b4['params']['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x4ef39c,null))[_0x6563('0x24')](function(_0x3e5200){if(_0x3e5200){_0x50e7b4[_0x6563('0x49')][_0x6563('0x55')]=_0x3e5200['id'];return db[_0x6563('0x5d')][_0x6563('0x50')](_0x50e7b4[_0x6563('0x49')]);}})[_0x6563('0x24')](respondWithResult(_0x4ef39c,null))['catch'](handleError(_0x4ef39c,null));};exports[_0x6563('0x5e')]=function(_0x403cf0,_0x241ce0){var _0x44c0f4={'raw':![],'where':{}};var _0x1fbb3c={};var _0x2530b5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6563('0x58')]({'where':{'id':_0x403cf0[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x241ce0,null))['then'](function(_0x4e63f3){if(_0x4e63f3){_0x1fbb3c[_0x6563('0x31')]=_[_0x6563('0x34')](db[_0x6563('0x5d')][_0x6563('0x2e')]);_0x1fbb3c[_0x6563('0x33')]=_['keys'](_0x403cf0['query']);_0x1fbb3c[_0x6563('0x35')]=_['intersection'](_0x1fbb3c[_0x6563('0x31')],_0x1fbb3c['query']);_0x44c0f4['attributes']=_[_0x6563('0x36')](_0x1fbb3c[_0x6563('0x31')],qs[_0x6563('0x38')](_0x403cf0[_0x6563('0x33')][_0x6563('0x38')]));_0x44c0f4[_0x6563('0x37')]=_0x44c0f4[_0x6563('0x37')][_0x6563('0x47')]?_0x44c0f4['attributes']:_0x1fbb3c[_0x6563('0x31')];if(!_0x403cf0[_0x6563('0x33')][_0x6563('0x5f')](_0x6563('0x39'))){_0x44c0f4['limit']=qs[_0x6563('0x1f')](_0x403cf0['query'][_0x6563('0x1f')]);_0x44c0f4[_0x6563('0x21')]=qs[_0x6563('0x21')](_0x403cf0[_0x6563('0x33')][_0x6563('0x21')]);}_0x44c0f4[_0x6563('0x3a')]=qs[_0x6563('0x3b')](_0x403cf0[_0x6563('0x33')][_0x6563('0x3b')]);_0x44c0f4[_0x6563('0x3c')]=qs[_0x6563('0x35')](_[_0x6563('0x3d')](_0x403cf0['query'],_0x1fbb3c[_0x6563('0x35')]));_0x44c0f4['where'][_0x6563('0x55')]=_0x4e63f3['id'];if(_0x403cf0[_0x6563('0x33')][_0x6563('0x3e')]){_0x44c0f4[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0x44c0f4[_0x6563('0x3c')],{'$or':_[_0x6563('0x32')](_0x44c0f4[_0x6563('0x37')],function(_0x3477d4){var _0x2c17eb={};_0x2c17eb[_0x3477d4]={'$like':'%'+_0x403cf0[_0x6563('0x33')]['filter']+'%'};return _0x2c17eb;})});}_0x44c0f4=_[_0x6563('0x3f')]({},_0x44c0f4,_0x403cf0[_0x6563('0x41')]);return db[_0x6563('0x5d')]['count']({'where':_0x44c0f4[_0x6563('0x3c')]})[_0x6563('0x24')](function(_0x1bd302){_0x2530b5[_0x6563('0x20')]=_0x1bd302;if(_0x403cf0[_0x6563('0x33')][_0x6563('0x59')]){_0x44c0f4['include']=[{'all':!![]}];}return db[_0x6563('0x5d')][_0x6563('0x44')](_0x44c0f4);})['then'](function(_0x162a57){_0x2530b5['rows']=_0x162a57;return _0x2530b5;});}})['then'](respondWithFilteredResult(_0x241ce0,_0x44c0f4))[_0x6563('0x1b')](handleError(_0x241ce0,null));};exports[_0x6563('0x60')]=function(_0x43b966,_0x2703ee){return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x43b966[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x2703ee,null))[_0x6563('0x24')](function(_0x3b3d9a){if(_0x3b3d9a){return _0x3b3d9a['removeAnswers'](_0x43b966[_0x6563('0x33')][_0x6563('0x5b')]);}})['then'](respondWithStatusCode(_0x2703ee,null))['catch'](handleError(_0x2703ee,null));};exports[_0x6563('0x61')]=function(_0x127207,_0x298935){_0x127207[_0x6563('0x49')]['sitepic']=_0x127207[_0x6563('0x62')]['filename'];return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x127207[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x298935,null))[_0x6563('0x24')](saveUpdates(_0x127207[_0x6563('0x49')],null))['then'](respondWithResult(_0x298935,null))['catch'](handleError(_0x298935,null));};exports[_0x6563('0x63')]=function(_0x28214a,_0x51ca9c){_0x28214a[_0x6563('0x49')]['agentAvatar']=_0x28214a['file'][_0x6563('0x64')];return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x28214a[_0x6563('0x52')]['id']}})['then'](handleEntityNotFound(_0x51ca9c,null))[_0x6563('0x24')](saveUpdates(_0x28214a[_0x6563('0x49')],null))[_0x6563('0x24')](respondWithResult(_0x51ca9c,null))[_0x6563('0x1b')](handleError(_0x51ca9c,null));};exports[_0x6563('0x65')]=function(_0x4120f5,_0x66c8f9){_0x4120f5['body'][_0x6563('0x66')]=_0x4120f5[_0x6563('0x62')][_0x6563('0x64')];return db[_0x6563('0x42')]['find']({'where':{'id':_0x4120f5['params']['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x66c8f9,null))[_0x6563('0x24')](saveUpdates(_0x4120f5[_0x6563('0x49')],null))[_0x6563('0x24')](respondWithResult(_0x66c8f9,null))[_0x6563('0x1b')](handleError(_0x66c8f9,null));};exports[_0x6563('0x67')]=function(_0x33df27,_0x194ddb){_0x33df27[_0x6563('0x49')]['systemAvatar']=_0x33df27['file'][_0x6563('0x64')];return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x33df27[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x194ddb,null))[_0x6563('0x24')](saveUpdates(_0x33df27['body'],null))[_0x6563('0x24')](respondWithResult(_0x194ddb,null))[_0x6563('0x1b')](handleError(_0x194ddb,null));};exports[_0x6563('0x68')]=function(_0x35fe8d,_0x21f61e){var _0x42171f=path[_0x6563('0x69')](config['root'],_0x6563('0x6a'));var _0x431327={'where':{'id':_0x35fe8d[_0x6563('0x52')]['id']},'attributes':['id',_0x6563('0x6b')],'raw':!![]};var _0x4af5ee=![];return require(_0x6563('0x6c'))[_0x6563('0x6d')]()[_0x6563('0x24')](function(_0x312040){if(_0x312040){_0x4af5ee=_0x312040[_0x6563('0x6e')];}})[_0x6563('0x24')](function(){return db[_0x6563('0x42')]['find'](_0x431327);})['then'](handleEntityNotFound(_0x21f61e,null))[_0x6563('0x24')](function(_0x2ddef6){if(_0x2ddef6){if(!_[_0x6563('0x6f')](_0x2ddef6[_0x6563('0x6b')])){if(fs['existsSync'](path['join'](config[_0x6563('0x70')],_0x6563('0x71'),_0x2ddef6['sitepic']))&&_0x4af5ee){_0x42171f=path[_0x6563('0x69')](config['root'],_0x6563('0x71'),_0x2ddef6['sitepic']);}}return _0x21f61e[_0x6563('0x72')](_0x42171f);}})[_0x6563('0x1b')](handleError(_0x21f61e,null));};exports[_0x6563('0x73')]=function(_0x592b21,_0x39e725){var _0x3a9c86=path[_0x6563('0x69')](config[_0x6563('0x70')],_0x6563('0x74'));var _0x1692c4={'where':{'id':_0x592b21['params']['id']},'attributes':['id',_0x6563('0x75')],'raw':!![]};return db[_0x6563('0x42')][_0x6563('0x48')](_0x1692c4)[_0x6563('0x24')](handleEntityNotFound(_0x39e725,null))[_0x6563('0x24')](function(_0x35bdff){if(_0x35bdff){if(!_[_0x6563('0x6f')](_0x35bdff[_0x6563('0x75')])){if(fs['existsSync'](path[_0x6563('0x69')](config['root'],_0x6563('0x76'),_0x35bdff[_0x6563('0x75')]))){_0x3a9c86=path['join'](config[_0x6563('0x70')],_0x6563('0x76'),_0x35bdff[_0x6563('0x75')]);}}return _0x39e725[_0x6563('0x72')](_0x3a9c86);}})[_0x6563('0x1b')](handleError(_0x39e725,null));};exports[_0x6563('0x77')]=function(_0xbd419d,_0x5eb011){var _0x3da283=path[_0x6563('0x69')](config[_0x6563('0x70')],_0x6563('0x78'));var _0x13692c={'where':{'id':_0xbd419d[_0x6563('0x52')]['id']},'attributes':['id',_0x6563('0x66'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x13692c)[_0x6563('0x24')](handleEntityNotFound(_0x5eb011,null))[_0x6563('0x24')](function(_0x4f51f4){if(_0x4f51f4){if(!_[_0x6563('0x6f')](_0x4f51f4[_0x6563('0x66')])){if(fs[_0x6563('0x79')](path[_0x6563('0x69')](config[_0x6563('0x70')],_0x6563('0x76'),_0x4f51f4[_0x6563('0x66')]))&&_0x4f51f4['showCustomerAvatar']){_0x3da283=path[_0x6563('0x69')](config[_0x6563('0x70')],_0x6563('0x76'),_0x4f51f4[_0x6563('0x66')]);}}return _0x5eb011[_0x6563('0x72')](_0x3da283);}})[_0x6563('0x1b')](handleError(_0x5eb011,null));};exports[_0x6563('0x7a')]=function(_0x89bca5,_0x47909d){var _0xbdfcc7=path['join'](config[_0x6563('0x70')],_0x6563('0x7b'));var _0x3e0436={'where':{'id':_0x89bca5[_0x6563('0x52')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x6563('0x42')][_0x6563('0x48')](_0x3e0436)[_0x6563('0x24')](handleEntityNotFound(_0x47909d,null))[_0x6563('0x24')](function(_0x6fef3d){if(_0x6fef3d){if(!_[_0x6563('0x6f')](_0x6fef3d[_0x6563('0x7c')])){if(fs[_0x6563('0x79')](path['join'](config[_0x6563('0x70')],'server/files/images/avatars/',_0x6fef3d[_0x6563('0x7c')]))){_0xbdfcc7=path[_0x6563('0x69')](config[_0x6563('0x70')],_0x6563('0x76'),_0x6fef3d[_0x6563('0x7c')]);}}return _0x47909d['download'](_0xbdfcc7);}})['catch'](handleError(_0x47909d,null));};exports['notify']=function(_0x37af5e,_0x49ff52){var _0x25cd9e=require('user-agent-parser');var _0x26e00c=new _0x25cd9e();var _0xad9e42=_0x26e00c[_0x6563('0x7d')](_0x37af5e[_0x6563('0x7e')][_0x6563('0x7f')])[_0x6563('0x80')]();var _0x5d22bd={'body':_0x37af5e['body'],'channel':_0x6563('0x81')};var _0x5a7ffd=[];var _0x99219e=[];var _0x219479={};var _0x50cea4=![];return db[_0x6563('0x82')][_0x6563('0x53')]()['then'](function(_0x1b1575){if(!_0x1b1575){throw new db[(_0x6563('0x83'))][(_0x6563('0x84'))](_0x6563('0x85'));}_0x5a7ffd=_[_0x6563('0x86')](_['keys'](_0x1b1575),[_0x6563('0x87'),_0x6563('0x88')]);_0x99219e=_[_0x6563('0x86')](_[_0x6563('0x34')](_0x1b1575),[_0x6563('0x87'),_0x6563('0x88'),_0x6563('0x89'),_0x6563('0x8a')]);if(_0x37af5e[_0x6563('0x49')]['id']){delete _0x37af5e[_0x6563('0x49')]['id'];}if(_[_0x6563('0x6f')](_0x37af5e[_0x6563('0x49')][_0x6563('0x8b')])){throw new db[(_0x6563('0x83'))][(_0x6563('0x84'))](_0x6563('0x8c'));}if(_[_0x6563('0x6f')](_0x37af5e[_0x6563('0x49')][_0x6563('0x49')])||_0x37af5e['body'][_0x6563('0x49')]===''){throw new db[(_0x6563('0x83'))][(_0x6563('0x84'))](_0x6563('0x8d'));}if(_[_0x6563('0x6f')](_0x37af5e[_0x6563('0x49')][_0x6563('0x8e')])){throw new db[(_0x6563('0x83'))][(_0x6563('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x99219e);}if(!_[_0x6563('0x8f')](_0x99219e,_0x37af5e['body'][_0x6563('0x8e')])){throw new db[(_0x6563('0x83'))][(_0x6563('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x99219e);}_0x219479[_0x37af5e[_0x6563('0x49')][_0x6563('0x8e')]]=_0x37af5e['body'][_0x6563('0x8b')];})[_0x6563('0x24')](function(){return db[_0x6563('0x42')]['find']({'where':{'id':_0x37af5e[_0x6563('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x6563('0x90'),'include':[{'model':db[_0x6563('0x82')],'as':'Contacts','where':_0x219479,'limit':0x1,'order':[[_0x6563('0x88'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x6563('0x91')}]});})[_0x6563('0x24')](handleEntityNotFound(_0x49ff52,null))[_0x6563('0x24')](function(_0x1036f0){if(_0x1036f0&&_0x1036f0[_0x6563('0x90')]){_0x5d22bd[_0x6563('0x92')]=_0x1036f0;_0x5d22bd[_0x6563('0x93')]=_0x1036f0[_0x6563('0x91')];_0x5d22bd[_0x6563('0x94')]=_0x1036f0[_0x6563('0x90')];_0x5d22bd[_0x6563('0x93')]=_[_0x6563('0x95')](_0x5d22bd[_0x6563('0x93')],[_0x6563('0x96')],['asc']);if(_0x5d22bd[_0x6563('0x92')][_0x6563('0x91')]){delete _0x5d22bd[_0x6563('0x92')]['Applications'];}if(_0x5d22bd[_0x6563('0x92')]['List']&&_0x5d22bd[_0x6563('0x92')][_0x6563('0x90')][_0x6563('0x97')]['length']){return _0x5d22bd[_0x6563('0x92')][_0x6563('0x90')]['Contacts'][0x0];}var _0x2cef73=_[_0x6563('0xb')](_0x37af5e[_0x6563('0x49')],{'firstName':_0x37af5e[_0x6563('0x49')][_0x6563('0x8b')],'ListId':_0x1036f0['ListId']});_0x2cef73[_0x37af5e[_0x6563('0x49')][_0x6563('0x8e')]]=_0x37af5e['body'][_0x6563('0x8b')];return db['CmContact']['create'](_0x2cef73,{'fields':_0x5a7ffd,'raw':!![]});}})[_0x6563('0x24')](handleEntityNotFound(_0x49ff52,null))[_0x6563('0x24')](function(_0x290d3e){_0x5d22bd[_0x6563('0x98')]=_0x290d3e;var _0x12a51c=_0x37af5e[_0x6563('0x49')][_0x6563('0x99')];if(_0x37af5e[_0x6563('0x7e')][_0x6563('0x9a')]){_0x12a51c=_0x37af5e[_0x6563('0x7e')]['cf-connecting-ip'];}else if(_0x37af5e[_0x6563('0x7e')][_0x6563('0x9b')]){_0x12a51c=_[_0x6563('0x9c')](_0x37af5e[_0x6563('0x7e')][_0x6563('0x9b')][_0x6563('0x9d')](','));}if(_0x290d3e){var _0x4e1daa={'ContactId':_0x290d3e['id'],'ChatWebsiteId':_0x37af5e[_0x6563('0x52')]['id'],'from':(_0x290d3e[_0x6563('0x9e')]||'')+'\x20'+(_0x290d3e[_0x6563('0x9f')]||''),'customerIp':_0x12a51c,'customerPort':_0x37af5e[_0x6563('0x7e')][_0x6563('0xa0')]?_0x37af5e[_0x6563('0x7e')][_0x6563('0xa0')]:null,'referer':_0x37af5e[_0x6563('0x49')][_0x6563('0xa1')],'browserName':_0xad9e42[_0x6563('0xa2')]['name']&&_0xad9e42['browser'][_0x6563('0xa3')]?util['format'](_0x6563('0xa4'),_0xad9e42[_0x6563('0xa2')][_0x6563('0x2a')],_0xad9e42['browser']['version']):_0x6563('0xa5'),'browserVersion':_0xad9e42['browser']['version']||_0x6563('0xa5'),'osName':util['format'](_0x6563('0xa4'),_0xad9e42['os'][_0x6563('0x2a')],_0xad9e42['os'][_0x6563('0xa3')]),'osVersion':_0xad9e42['os']['version'],'deviceModel':_0xad9e42['device'][_0x6563('0x31')]&&_0xad9e42['device'][_0x6563('0xa6')]?util[_0x6563('0xa7')](_0x6563('0xa8'),_0xad9e42[_0x6563('0xa9')][_0x6563('0x31')],_0xad9e42[_0x6563('0xa9')][_0x6563('0xa6')],_0xad9e42[_0x6563('0xa9')][_0x6563('0x30')]):null,'deviceVendor':_0xad9e42[_0x6563('0xa9')][_0x6563('0xa6')],'deviceType':_0xad9e42[_0x6563('0xa9')][_0x6563('0x30')],'formData':JSON[_0x6563('0x17')](_0x37af5e[_0x6563('0x49')])};var _0x469338={'ChatWebsiteId':_0x37af5e[_0x6563('0x52')]['id'],'closed':![]};if(_0x37af5e[_0x6563('0x49')][_0x6563('0xaa')]){_0x469338[_0x6563('0xaa')]=_0x37af5e[_0x6563('0x49')][_0x6563('0xaa')];return db[_0x6563('0xab')][_0x6563('0x48')]({'where':_0x469338})[_0x6563('0x24')](function(_0x4ae945){if(_0x4ae945){return[_0x4ae945,![]];}_0x4e1daa['threadId']=_0x37af5e[_0x6563('0x49')][_0x6563('0xaa')];_0x4e1daa['externalUrl']=_0x37af5e[_0x6563('0x49')][_0x6563('0xac')];return db['ChatInteraction'][_0x6563('0x50')](_0x4e1daa)[_0x6563('0x24')](function(_0xcfff9a){return[_0xcfff9a,!![]];});});}_0x469338[_0x6563('0xad')]=_0x290d3e['id'];if(_0x37af5e[_0x6563('0x49')][_0x6563('0xae')]&&_0x37af5e['body']['interaction']['id']){_0x469338['id']=_0x37af5e[_0x6563('0x49')][_0x6563('0xae')]['id'];return db[_0x6563('0xab')]['find']({'where':_0x469338})[_0x6563('0x24')](function(_0x15cbf2){if(_0x15cbf2){return[_0x15cbf2,![]];}return db[_0x6563('0xab')][_0x6563('0x50')](_0x4e1daa)[_0x6563('0x24')](function(_0x339541){return[_0x339541,!![]];});});}return db[_0x6563('0xab')]['create'](_0x4e1daa)[_0x6563('0x24')](function(_0x5db2ae){return[_0x5db2ae,!![]];});}})[_0x6563('0xaf')](function(_0x5663a2,_0x35215f){if(_0x5663a2){_0x50cea4=_0x35215f;if(!_0x35215f){var _0x45f75e={'from':(_0x5d22bd['contact'][_0x6563('0x9e')]||'')+'\x20'+(_0x5d22bd['contact'][_0x6563('0x9f')]||'')};if(_0x37af5e[_0x6563('0x49')][_0x6563('0xaa')]&&_0x37af5e[_0x6563('0x49')]['messageId']&&_0x37af5e[_0x6563('0x49')][_0x6563('0xaa')]!=_0x37af5e[_0x6563('0x49')][_0x6563('0xb0')]){_0x45f75e[_0x6563('0xaa')]=_0x37af5e[_0x6563('0x49')][_0x6563('0xb0')];}return _0x5663a2['update'](_0x45f75e);}else{return _0x5663a2;}}})[_0x6563('0x24')](function(_0x42ca83){_0x5d22bd[_0x6563('0xae')]=_0x42ca83[_0x6563('0x26')]({'plain':!![]});_0x5d22bd[_0x6563('0xae')][_0x6563('0xb1')]=_0x50cea4;if(_0x5d22bd['interaction'][_0x6563('0xb1')]){if(_0x5d22bd[_0x6563('0x92')]['autoclose']){_0x5d22bd['applications'][_0x6563('0xb2')]({'id':0x0,'priority':_0x5d22bd[_0x6563('0x93')][_0x6563('0x47')]+0x1,'app':'close','appdata':_0x6563('0xb3'),'interval':_0x6563('0xb4')});}}return db[_0x6563('0xb5')][_0x6563('0x50')]({'body':_0x37af5e['body']['body'],'ChatWebsiteId':_0x37af5e[_0x6563('0x52')]['id'],'ChatInteractionId':_0x42ca83['id'],'direction':'in','ContactId':_0x5d22bd[_0x6563('0x98')]['id'],'AttachmentId':_0x37af5e['body'][_0x6563('0xb6')]});})[_0x6563('0x24')](function(_0x2048f0){_0x5d22bd[_0x6563('0x1a')]=_0x2048f0;if(_0x5d22bd[_0x6563('0xae')][_0x6563('0xb7')]){return db[_0x6563('0xb8')][_0x6563('0x48')]({'attributes':['id','name'],'where':{'id':_0x5d22bd[_0x6563('0xae')][_0x6563('0xb7')]}})[_0x6563('0x24')](function(_0x3a4219){if(_0x3a4219){_0x5d22bd[_0x6563('0x93')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6563('0xb9'),'appdata':_0x3a4219[_0x6563('0x2a')]+','+(_0x5d22bd[_0x6563('0x92')][_0x6563('0xba')]||0xa),'interval':_0x6563('0xb4')});_0x5d22bd[_0x6563('0xbb')]=!![];}return respondWithRpcPromise(_0x6563('0xbc'),'startRouting',_0x5d22bd);});}return respondWithRpcPromise(_0x6563('0xbc'),_0x6563('0xbd'),_0x5d22bd);})[_0x6563('0x24')](function(_0x36edf0){respondWithRpcPromise(_0x6563('0xbe'),_0x6563('0xbe'),{'event':_0x6563('0xbf'),'message':_0x36edf0},client9002);return _0x36edf0;})[_0x6563('0x24')](respondWithResult(_0x49ff52,null))[_0x6563('0x1b')](handleError(_0x49ff52,null));};exports[_0x6563('0xc0')]=function(_0x3ad920,_0x243c1f){var _0x488337,_0x4db603,_0x10e9e0;var _0x23b935=[];var _0x4e0268={};var _0x22f0a0=_0x3ad920[_0x6563('0xc1')]||[];var _0x533a7c=[];var _0x50aa69;return db['CmContact'][_0x6563('0x53')]()[_0x6563('0x24')](function(_0x47e52e){if(!_0x47e52e){throw new db[(_0x6563('0x83'))]['ValidationError'](_0x6563('0x85'));}_0x23b935=_[_0x6563('0x86')](_['keys'](_0x47e52e),[_0x6563('0x87'),_0x6563('0x88'),_0x6563('0x89'),_0x6563('0x8a')]);if(_0x3ad920[_0x6563('0x49')]['id']){delete _0x3ad920['body']['id'];}if(_[_0x6563('0x6f')](_0x3ad920['body'][_0x6563('0x8b')])){throw _0x243c1f[_0x6563('0x1d')](0x1f4)[_0x6563('0x2b')](new db['Sequelize'][(_0x6563('0x84'))]('from\x20is\x20mandatory'));}if(_[_0x6563('0x6f')](_0x3ad920[_0x6563('0x49')][_0x6563('0x49')])||_0x3ad920[_0x6563('0x49')]['body']===''){throw _0x243c1f[_0x6563('0x1d')](0x1f4)[_0x6563('0x2b')](new db[(_0x6563('0x83'))][(_0x6563('0x84'))](_0x6563('0x8d')));}if(_[_0x6563('0x6f')](_0x3ad920['body']['mapKeyOffline'])){throw _0x243c1f[_0x6563('0x1d')](0x1f4)[_0x6563('0x2b')](new db['Sequelize']['ValidationError'](_0x6563('0xc2')+_0x23b935));}if(!_[_0x6563('0x8f')](_0x23b935,_0x3ad920['body'][_0x6563('0xc3')])){throw _0x243c1f[_0x6563('0x1d')](0x1f4)[_0x6563('0x2b')](new db[(_0x6563('0x83'))][(_0x6563('0x84'))](_0x6563('0xc4')+_0x23b935));}_0x4e0268[_0x3ad920[_0x6563('0x49')]['mapKeyOffline']]=_0x3ad920[_0x6563('0x49')][_0x6563('0x8b')];})[_0x6563('0x24')](function(){return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x3ad920[_0x6563('0x52')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x6563('0xc5')],'as':_0x6563('0xc5')}]});})[_0x6563('0x24')](handleEntityNotFound(_0x243c1f,null))['then'](function(_0x20845d){if(_0x20845d&&_0x20845d[_0x6563('0x90')]){_0x4db603=_0x20845d;var _0x5619bd=_[_0x6563('0xb')](_0x3ad920[_0x6563('0x49')],{'firstName':_0x3ad920[_0x6563('0x49')]['from'],'phone':_0x3ad920[_0x6563('0x49')][_0x6563('0x8b')],'ListId':_0x20845d[_0x6563('0x8a')]});_0x5619bd[_0x3ad920[_0x6563('0x49')][_0x6563('0xc3')]]=_0x3ad920[_0x6563('0x49')][_0x6563('0x8b')];return db[_0x6563('0x82')][_0x6563('0xc6')]({'where':_0x4e0268,'defaults':_0x5619bd});}})[_0x6563('0xaf')](function(_0x50ce7c){if(_0x50ce7c){_0x10e9e0=_0x50ce7c;var _0x5cb55f=fs[_0x6563('0xc7')](path[_0x6563('0x69')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x6563('0xc8'));var _0x3036b9=ejs[_0x6563('0xc9')](_0x5cb55f,{'body':_[_0x6563('0xca')](_0x3ad920['body']['body']),'bodyTitle':_0x4db603['offlineMessageBody']});return db['ChatOfflineMessage'][_0x6563('0x50')]({'body':_0x3036b9,'plainBody':htmlToText['fromString'](_0x3036b9),'ContactId':_0x50ce7c['id'],'ChatWebsiteId':_0x4db603['id']});}})[_0x6563('0x24')](function(_0x399ba8){_0x50aa69=_0x399ba8;if(_0x22f0a0['length']){var _0x46f4b1=_0x22f0a0['map'](function(_0x4ee7dd){return{'name':_0x4ee7dd['originalname'],'basename':_0x4ee7dd[_0x6563('0x64')],'type':_0x4ee7dd[_0x6563('0xcb')],'ChatOfflineMessageId':_0x399ba8['id']};});_0x533a7c=_0x46f4b1['map'](_0x5f54fc=>{var _0x36ff9b={'filename':_0x5f54fc[_0x6563('0x2a')],'path':path[_0x6563('0x69')](config[_0x6563('0x70')],'server',_0x6563('0xc1'),'attachments',_0x6563('0xcc'),_0x5f54fc['basename'])};return _0x36ff9b;});if(!_0x4db603[_0x6563('0xcd')]){return db[_0x6563('0xce')][_0x6563('0xcf')](function(_0x4df431){return db['Attachment'][_0x6563('0xd0')](_0x46f4b1,{'transaction':_0x4df431});});}}})[_0x6563('0x24')](function(){if(_0x50aa69){_0x488337=_0x50aa69;return db[_0x6563('0xc5')][_0x6563('0x58')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6563('0xd1'),'raw':!![]}]}]});}})[_0x6563('0x24')](function(_0x88b2d9){if(_0x88b2d9&&_0x88b2d9[_0x6563('0xd2')]&&_0x4db603[_0x6563('0xd3')]&&_0x4db603['forwardOfflineAddress']){var _0x1b22af=_0x88b2d9[_0x6563('0xd4')]();return respondWithRpcPromise(_0x6563('0xd5'),'sendMail',{'account':_0x1b22af,'message':{'from':util[_0x6563('0xa7')]('\x22%s\x22\x20<%s>',_0x88b2d9[_0x6563('0x2a')],_0x88b2d9[_0x6563('0xd6')]||_0x88b2d9['Smtp']['user']),'to':_0x4db603[_0x6563('0xd7')],'subject':_0x4db603[_0x6563('0xd8')],'html':_0x488337[_0x6563('0x49')],'attachments':_0x533a7c}},client9003)[_0x6563('0x24')](function(){return _0x488337;})[_0x6563('0x1b')](function(_0x59f16f){logger[_0x6563('0x18')](_0x59f16f);});}})['then'](function(){if(_0x4db603&&_0x4db603[_0x6563('0xcd')]&&_0x4db603['MailAccountId']){var _0x32c097=[];if(_0x22f0a0[_0x6563('0x47')]){_0x32c097=_0x22f0a0['map'](function(_0x4a8ce2){return{'name':_0x4a8ce2[_0x6563('0xd9')],'basename':_0x4a8ce2[_0x6563('0x64')],'type':_0x4a8ce2[_0x6563('0xcb')],'ChatOfflineMessageId':_0x50aa69['id']};});}var _0x38d145;if(!_[_0x6563('0x6f')](_0x4db603[_0x6563('0xda')])){var _0x4742bf=_[_0x6563('0x32')](_0x3ad920[_0x6563('0x49')],function(_0x28c4e1){return _0x28c4e1;});var _0x12681c=_[_0x6563('0xdb')](_0x4742bf)[0x0];var _0x11151e=_[_0x6563('0xdc')](_0x12681c,function(_0x337cb0){return _0x337cb0;});_0x38d145=_0x11151e[0x1][_0x4db603[_0x6563('0xda')]];}var _0x2dcf31={'from':_0x10e9e0[_0x6563('0xd6')],'firstName':_0x10e9e0[_0x6563('0x9e')],'lastName':_0x10e9e0['lastName'],'mapKey':_0x6563('0xd6'),'message':{'from':_0x10e9e0['email'],'to':_0x4db603[_0x6563('0xc5')]['email'],'cc':'','subject':_['isNil'](_0x38d145)?_0x4db603[_0x6563('0xd8')]:_0x38d145,'messageId':'','sentAt':new Date(),'attach':_0x32c097[_0x6563('0x47')],'attachments':_0x32c097,'originChannel':_0x6563('0xdd'),'ChatWebsiteId':_0x4db603['id'],'ChatOfflineMessageId':_0x488337['id'],'originTo':_0x4db603[_0x6563('0xc5')]['email']},'body':_0x488337[_0x6563('0x49')]};var _0x1abbd2={'account':{'id':_0x4db603[_0x6563('0xde')]},'body':_0x2dcf31,'log':_0x6563('0xdf')};return respondWithRpcPromise(_0x6563('0xdf'),_0x6563('0xe0'),_0x1abbd2,client9001)[_0x6563('0x24')](function(){return _0x488337;})['catch'](function(_0x43de10){logger['error'](_0x43de10);});}return;})['then'](function(){if(_0x488337){return _0x488337;}})[_0x6563('0x24')](respondWithResult(_0x243c1f,null))[_0x6563('0x1b')](function(_0x265179){logger['error'](_0x6563('0x1b'),_0x265179);for(var _0xf8aa3d of _0x22f0a0){var _0x352c96=path['join'](config[_0x6563('0x70')],_0x6563('0xe1'),_0x6563('0xc1'),_0x6563('0xe2'),_0x6563('0xcc'),_0xf8aa3d['filename']);fs_extra[_0x6563('0xe3')](_0x352c96)['catch'](function(_0x366361){logger[_0x6563('0x18')](_0x6563('0xe4'),_0x352c96,_0x366361);});}});};exports[_0x6563('0xe5')]=function(_0x415c65,_0x5b8987){return db[_0x6563('0xab')]['find']({'where':{'id':_0x415c65['params']['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x5b8987,null))['then'](function(_0x2cffef){if(_0x2cffef){return _0x2cffef['addInteraction'](_0x415c65[_0x6563('0x49')][_0x6563('0x5b')],_[_0x6563('0xe6')](_0x415c65['body'],['ids','id'])||{});}})[_0x6563('0x24')](respondWithResult(_0x5b8987,null))[_0x6563('0x1b')](handleError(_0x5b8987,null));};exports[_0x6563('0xe7')]=function(_0x3ae6c9,_0x233af1){var _0x2fda95={'raw':![],'where':{}};var _0xc909e3={};var _0x41dd58={'count':0x0,'rows':[]};return db[_0x6563('0x42')]['findOne']({'where':{'id':_0x3ae6c9[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x233af1,null))[_0x6563('0x24')](function(_0x55d84d){if(_0x55d84d){_0xc909e3['model']=_[_0x6563('0x34')](db['ChatInteraction'][_0x6563('0x2e')]);_0xc909e3['query']=_['keys'](_0x3ae6c9['query']);_0xc909e3[_0x6563('0x35')]=_[_0x6563('0x36')](_0xc909e3[_0x6563('0x31')],_0xc909e3[_0x6563('0x33')]);_0x2fda95[_0x6563('0x37')]=_[_0x6563('0x36')](_0xc909e3[_0x6563('0x31')],qs[_0x6563('0x38')](_0x3ae6c9[_0x6563('0x33')][_0x6563('0x38')]));_0x2fda95[_0x6563('0x37')]=_0x2fda95[_0x6563('0x37')][_0x6563('0x47')]?_0x2fda95[_0x6563('0x37')]:_0xc909e3[_0x6563('0x31')];if(!_0x3ae6c9['query'][_0x6563('0x5f')](_0x6563('0x39'))){_0x2fda95[_0x6563('0x1f')]=qs[_0x6563('0x1f')](_0x3ae6c9[_0x6563('0x33')][_0x6563('0x1f')]);_0x2fda95['offset']=qs[_0x6563('0x21')](_0x3ae6c9['query']['offset']);}_0x2fda95[_0x6563('0x3a')]=qs[_0x6563('0x3b')](_0x3ae6c9[_0x6563('0x33')]['sort']);_0x2fda95[_0x6563('0x3c')]=qs[_0x6563('0x35')](_['pick'](_0x3ae6c9[_0x6563('0x33')],_0xc909e3[_0x6563('0x35')]));_0x2fda95[_0x6563('0x3c')][_0x6563('0x55')]=_0x55d84d['id'];if(_0x3ae6c9[_0x6563('0x33')]['filter']){_0x2fda95[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0x2fda95[_0x6563('0x3c')],{'$or':_['map'](_0x2fda95['attributes'],function(_0x19ded9){var _0x3bdc47={};_0x3bdc47[_0x19ded9]={'$like':'%'+_0x3ae6c9['query'][_0x6563('0x3e')]+'%'};return _0x3bdc47;})});}_0x2fda95=_[_0x6563('0x3f')]({},_0x2fda95,_0x3ae6c9[_0x6563('0x41')]);return db[_0x6563('0xab')][_0x6563('0x20')]({'where':_0x2fda95['where']})[_0x6563('0x24')](function(_0x5f1f85){_0x41dd58[_0x6563('0x20')]=_0x5f1f85;if(_0x3ae6c9[_0x6563('0x33')][_0x6563('0x59')]){_0x2fda95[_0x6563('0x43')]=[{'model':db[_0x6563('0x82')],'as':_0x6563('0xe8'),'required':![]},{'model':db[_0x6563('0xb8')],'as':_0x6563('0xe9'),'attributes':[_0x6563('0x2a'),_0x6563('0xea'),_0x6563('0xeb')],'required':![]},{'model':db['Tag'],'as':_0x6563('0xec'),'attributes':['id','name',_0x6563('0xed')],'where':_0x3ae6c9[_0x6563('0x33')][_0x6563('0xee')]?{'id':_0x3ae6c9[_0x6563('0x33')][_0x6563('0xee')]}:undefined,'required':_0x3ae6c9[_0x6563('0x33')][_0x6563('0xee')]?!![]:![]}];}return db[_0x6563('0xab')][_0x6563('0x44')](_0x2fda95);})[_0x6563('0x24')](function(_0x3b7fab){_0x41dd58[_0x6563('0x45')]=_0x3b7fab;return _0x41dd58;});}})['then'](respondWithFilteredResult(_0x233af1,_0x2fda95))['catch'](handleError(_0x233af1,null));};function iftimePromise(_0x1c58ed,_0x5e9244){return respondWithRpcPromise(_0x6563('0xef'),_0x6563('0xf0'),{'command':_0x5e9244[_0x6563('0xf1')]?util['format'](_0x6563('0xf2'),_0x1c58ed[_0x6563('0xf3')],_0x5e9244[_0x6563('0xf1')]):util[_0x6563('0xa7')]('iftime\x20%s',_0x1c58ed[_0x6563('0xf3')])},client9002)[_0x6563('0x24')](function(_0x35a350){var _0x153e78=_0x35a350&&_0x35a350[_0x6563('0xf4')]('true')>=0x0?!![]:![];logger[_0x6563('0x13')](_0x6563('0xf5'),_0x5e9244['id'],_0x1c58ed['id'],_0x1c58ed[_0x6563('0xf3')],_0x153e78?_0x6563('0xf6'):'OFFLINE',_0x5e9244[_0x6563('0xf1')]?_0x5e9244[_0x6563('0xf1')]:_0x6563('0xf7'));return _0x153e78;})[_0x6563('0x1b')](function(_0x3027f9){logger[_0x6563('0x18')](_0x6563('0xf5'),_0x5e9244['id'],_0x1c58ed['id'],_0x1c58ed[_0x6563('0xf3')],util[_0x6563('0xf8')](_0x3027f9,{'showHidden':![],'depth':null}),_0x5e9244[_0x6563('0xf1')]?_0x5e9244['timezone']:_0x6563('0xf7'));return![];});}exports[_0x6563('0xf0')]=function(_0x12a4b6,_0x1f9659){var _0x14f5ec=0x0;var _0x31fc33=0x0;var _0x10737b=![];var _0x4dac97;var _0x38100a;return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x12a4b6[_0x6563('0x52')]['id']},'include':[{'model':db[_0x6563('0xf9')],'as':_0x6563('0xf9'),'include':[{'model':db[_0x6563('0xf9')],'as':_0x6563('0xfa'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x6563('0x24')](handleEntityNotFound(_0x1f9659,null))[_0x6563('0x24')](function(_0x18cad4){if(_0x18cad4){_0x4dac97=_0x18cad4;return _0x18cad4[_0x6563('0xfb')]({'raw':!![]});}})[_0x6563('0x24')](function(_0x21ec76){if(_0x4dac97){if(_0x21ec76){_0x38100a=_0x21ec76;}}return require('../../config/license/util')[_0x6563('0x6d')]();})['then'](function(_0xc8d2cf){if(_0xc8d2cf){_0x31fc33=_0xc8d2cf['virtual'];_0x10737b=_0xc8d2cf[_0x6563('0x6e')];}})[_0x6563('0x24')](function(){return db[_0x6563('0xab')][_0x6563('0x20')]({'where':{'closed':![]}});})[_0x6563('0x24')](function(_0x20a0e9){_0x14f5ec=_0x20a0e9;if(_0x31fc33&&_0x20a0e9>_0x31fc33){return db['License']['findOne']({'where':{'id':0x1}})[_0x6563('0x24')](function(_0x2eb435){if(_0x2eb435){_0x2eb435[_0x6563('0xfc')]('chatLicenseExceeded');}});}})[_0x6563('0x24')](function(){if(_0x4dac97[_0x6563('0xf9')]&&_0x4dac97[_0x6563('0xf9')][_0x6563('0xfa')]){var _0x5932de=[];for(var _0x5a1183=0x0;_0x5a1183<_0x4dac97[_0x6563('0xf9')][_0x6563('0xfa')][_0x6563('0x47')];_0x5a1183++){var _0xc19ccb=_0x4dac97['Interval'][_0x6563('0xfa')][_0x5a1183]['get']({'plain':!![]});_0x5932de['push'](iftimePromise(_0xc19ccb,_0x4dac97));}return BPromise[_0x6563('0xfd')](_0x5932de)[_0x6563('0x24')](function(_0x249019){return _[_0x6563('0xfe')](_0x249019);});}else{return!![];}})[_0x6563('0x24')](function(_0x7ba067){var _0x303687=fs[_0x6563('0xc7')](path[_0x6563('0x69')](config[_0x6563('0x70')],'server/files/chat/iframe.ejs'),_0x6563('0xc8'));var _0x403c59={'remote':_0x4dac97[_0x6563('0xff')],'query':querystring['stringify'](_[_0x6563('0x3f')](_0x4dac97[_0x6563('0x26')]({'plain':!![]}),{'customerIp':_0x12a4b6[_0x6563('0x7e')][_0x6563('0x9b')]||_0x12a4b6[_0x6563('0x7e')][_0x6563('0x100')]||_0x12a4b6['connection'][_0x6563('0x101')]||_0x12a4b6['ip'],'referer':_0x12a4b6[_0x6563('0x7e')]['referer'],'openedInteractions':_0x14f5ec,'maxInteractions':_0x31fc33,'virtual':_0x10737b[_0x6563('0x102')],'online':_0x7ba067,'custom':_0x10737b}))[_0x6563('0x103')](/'/g,'\x5c\x27')};_0x1f9659[_0x6563('0x2b')](ejs['render'](Mustache['render'](_0x303687,_0x403c59),{'proactiveActions':_0x38100a,'alignment':_0x4dac97[_0x6563('0x104')],'verticalAlignment':_0x4dac97['verticalAlignment'],'div_color':_0x4dac97[_0x6563('0xed')],'labelText':_0x4dac97['labelText'],'text_color':_0x4dac97[_0x6563('0x105')],'button_color':_0x4dac97[_0x6563('0x106')],'background_color':_0x4dac97[_0x6563('0x107')],'hideWhenOffline':_0x4dac97['hideWhenOffline'],'interval':_0x4dac97['IntervalId']}));})[_0x6563('0x1b')](handleError(_0x1f9659,null));};exports[_0x6563('0x108')]=function(_0x55f294,_0x1ff90d){var _0xe03f13=_0x55f294['params']['id'];var _0x1cd043=_0x55f294['body'];var _0x24eda6=0xc8;var _0x37ecf0=null;return db[_0x6563('0xce')][_0x6563('0xcf')]({'isolationLevel':db[_0x6563('0xce')][_0x6563('0x109')][_0x6563('0x10a')][_0x6563('0x10b')]},function(_0x56ac01){return db[_0x6563('0x42')][_0x6563('0x58')]({'where':{'id':_0xe03f13},'transaction':_0x56ac01})[_0x6563('0x24')](function(_0x38b977){if(_0x38b977){return db[_0x6563('0x10c')][_0x6563('0x25')]({'where':{'ChatWebsiteId':_0xe03f13},'transaction':_0x56ac01})[_0x6563('0x24')](function(){var _0x4de661=_[_0x6563('0x32')](_0x1cd043,function(_0x31efbc){_0x31efbc['ChatWebsiteId']=_0xe03f13;return _0x31efbc;});return db[_0x6563('0x10c')]['bulkCreate'](_0x4de661,{'transaction':_0x56ac01});});}else{_0x24eda6=0x194;_0x37ecf0=[];}});})['then'](function(){if(_0x24eda6!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0xe03f13},'order':_0x6563('0x96')})['then'](function(_0x35657b){_0x37ecf0=_0x35657b;});}})[_0x6563('0x1b')](function(_0xdff020){_0x24eda6=0x1f4;logger[_0x6563('0x18')](_0xdff020[_0x6563('0x10d')]);if(_0xdff020[_0x6563('0x2a')]){delete _0xdff020[_0x6563('0x2a')];}_0x37ecf0=_0xdff020;})[_0x6563('0x10e')](function(){if(_0x37ecf0===null){_0x1ff90d[_0x6563('0x29')](_0x24eda6);}else{if(_0x24eda6===0x1f4){_0x1ff90d[_0x6563('0x1d')](_0x24eda6)['send'](_0x37ecf0);}else{_0x1ff90d[_0x6563('0x1d')](_0x24eda6)[_0x6563('0x10f')](_0x37ecf0);}}});};exports['getApplications']=function(_0x4884d0,_0x4e2833){var _0x431383={};var _0x438cbb={};var _0x555f65;var _0x17de3c;return db['ChatWebsite'][_0x6563('0x58')]({'where':{'id':_0x4884d0[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x4e2833,null))[_0x6563('0x24')](function(_0x52372d){if(_0x52372d){_0x555f65=_0x52372d;_0x438cbb['model']=_[_0x6563('0x34')](db['ChatApplication'][_0x6563('0x2e')]);_0x438cbb[_0x6563('0x33')]=_['keys'](_0x4884d0[_0x6563('0x33')]);_0x438cbb[_0x6563('0x35')]=_['intersection'](_0x438cbb[_0x6563('0x31')],_0x438cbb[_0x6563('0x33')]);_0x431383[_0x6563('0x37')]=_[_0x6563('0x36')](_0x438cbb[_0x6563('0x31')],qs[_0x6563('0x38')](_0x4884d0[_0x6563('0x33')]['fields']));_0x431383[_0x6563('0x37')]=_0x431383[_0x6563('0x37')][_0x6563('0x47')]?_0x431383[_0x6563('0x37')]:_0x438cbb[_0x6563('0x31')];_0x431383[_0x6563('0x3a')]=qs[_0x6563('0x3b')](_0x4884d0[_0x6563('0x33')][_0x6563('0x3b')]);_0x431383[_0x6563('0x3c')]=qs[_0x6563('0x35')](_['pick'](_0x4884d0[_0x6563('0x33')],_0x438cbb[_0x6563('0x35')]));if(_0x4884d0['query'][_0x6563('0x3e')]){_0x431383[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0x431383['where'],{'$or':_[_0x6563('0x32')](_0x431383[_0x6563('0x37')],function(_0x1b64a3){var _0x411391={};_0x411391[_0x1b64a3]={'$like':'%'+_0x4884d0['query'][_0x6563('0x3e')]+'%'};return _0x411391;})});}_0x431383=_['merge']({},_0x431383,_0x4884d0[_0x6563('0x41')]);return _0x555f65[_0x6563('0x110')](_0x431383);}})['then'](function(_0x2d480e){if(_0x2d480e){_0x17de3c=_0x2d480e[_0x6563('0x47')];if(!_0x4884d0[_0x6563('0x33')][_0x6563('0x5f')](_0x6563('0x39'))){_0x431383[_0x6563('0x1f')]=qs['limit'](_0x4884d0[_0x6563('0x33')][_0x6563('0x1f')]);_0x431383[_0x6563('0x21')]=qs['offset'](_0x4884d0[_0x6563('0x33')]['offset']);}return _0x555f65[_0x6563('0x110')](_0x431383);}})['then'](function(_0x3fa8a1){if(_0x3fa8a1){return _0x3fa8a1?{'count':_0x17de3c,'rows':_0x3fa8a1}:null;}})['then'](respondWithResult(_0x4e2833,null))['catch'](handleError(_0x4e2833,null));};exports['addProactiveActions']=function(_0x28da34,_0x18b648){return db[_0x6563('0x111')]['find']({'where':{'id':_0x28da34['params']['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x18b648,null))[_0x6563('0x24')](function(_0x19493d){if(_0x19493d){return _0x19493d[_0x6563('0x112')](_0x28da34[_0x6563('0x49')][_0x6563('0x5b')],_['omit'](_0x28da34[_0x6563('0x49')],[_0x6563('0x5b'),'id'])||{});}})[_0x6563('0x24')](respondWithResult(_0x18b648,null))[_0x6563('0x1b')](handleError(_0x18b648,null));};exports[_0x6563('0xfb')]=function(_0x20ef38,_0x3009dc){var _0x30c6f7={};var _0xbafbb1={};var _0x59d6b4;var _0x559510;return db[_0x6563('0x42')][_0x6563('0x58')]({'where':{'id':_0x20ef38[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x3009dc,null))['then'](function(_0x1d9e83){if(_0x1d9e83){_0x59d6b4=_0x1d9e83;_0xbafbb1[_0x6563('0x31')]=_[_0x6563('0x34')](db[_0x6563('0x113')][_0x6563('0x2e')]);_0xbafbb1[_0x6563('0x33')]=_[_0x6563('0x34')](_0x20ef38[_0x6563('0x33')]);_0xbafbb1[_0x6563('0x35')]=_[_0x6563('0x36')](_0xbafbb1[_0x6563('0x31')],_0xbafbb1['query']);_0x30c6f7[_0x6563('0x37')]=_['intersection'](_0xbafbb1[_0x6563('0x31')],qs['fields'](_0x20ef38[_0x6563('0x33')][_0x6563('0x38')]));_0x30c6f7['attributes']=_0x30c6f7[_0x6563('0x37')][_0x6563('0x47')]?_0x30c6f7[_0x6563('0x37')]:_0xbafbb1[_0x6563('0x31')];_0x30c6f7['order']=qs['sort'](_0x20ef38['query']['sort']);_0x30c6f7[_0x6563('0x3c')]=qs[_0x6563('0x35')](_['pick'](_0x20ef38[_0x6563('0x33')],_0xbafbb1[_0x6563('0x35')]));if(_0x20ef38[_0x6563('0x33')]['filter']){_0x30c6f7[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0x30c6f7[_0x6563('0x3c')],{'$or':_[_0x6563('0x32')](_0x30c6f7[_0x6563('0x37')],function(_0x1ef153){var _0x528f65={};_0x528f65[_0x1ef153]={'$like':'%'+_0x20ef38[_0x6563('0x33')][_0x6563('0x3e')]+'%'};return _0x528f65;})});}_0x30c6f7=_[_0x6563('0x3f')]({},_0x30c6f7,_0x20ef38[_0x6563('0x41')]);return _0x59d6b4[_0x6563('0xfb')](_0x30c6f7);}})['then'](function(_0x20443b){if(_0x20443b){_0x559510=_0x20443b['length'];if(!_0x20ef38[_0x6563('0x33')][_0x6563('0x5f')](_0x6563('0x39'))){_0x30c6f7[_0x6563('0x1f')]=qs[_0x6563('0x1f')](_0x20ef38[_0x6563('0x33')][_0x6563('0x1f')]);_0x30c6f7['offset']=qs[_0x6563('0x21')](_0x20ef38['query']['offset']);}return _0x59d6b4[_0x6563('0xfb')](_0x30c6f7);}})[_0x6563('0x24')](function(_0x46c7e7){if(_0x46c7e7){return _0x46c7e7?{'count':_0x559510,'rows':_0x46c7e7}:null;}})[_0x6563('0x24')](respondWithResult(_0x3009dc,null))[_0x6563('0x1b')](handleError(_0x3009dc,null));};exports['getFields']=function(_0x2dd077,_0x19d5b0){var _0x1f21b8=_0x2dd077[_0x6563('0x33')][_0x6563('0x114')]===_0x6563('0x115')?_0x6563('0x116'):'onlineForm';return db[_0x6563('0x42')][_0x6563('0x48')]({'attributes':['id',_0x1f21b8],'where':{'id':_0x2dd077[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x19d5b0,null))[_0x6563('0x24')](function(_0x284202){if(_0x284202){var _0xe75a85=_0x284202[_0x1f21b8];var _0x5aa9a3=_0xe75a85&&_0xe75a85[_0x6563('0x117')]?_0xe75a85[_0x6563('0x117')]:[];_0x19d5b0['send']({'fromKey':_['isNil'](_0xe75a85['fromKey'])?undefined:_0xe75a85['fromKey'],'count':_0x5aa9a3[_0x6563('0x47')],'rows':_0x5aa9a3});}})['catch'](handleError(_0x19d5b0,null));};exports['getOfflineMessages']=function(_0x449862,_0x11806f){var _0x4f1f99={'raw':![],'where':{}};var _0x312dcf={};var _0x5ea038={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6563('0x58')]({'where':{'id':_0x449862['params']['id']}})['then'](handleEntityNotFound(_0x11806f,null))['then'](function(_0x2e2723){if(_0x2e2723){_0x312dcf[_0x6563('0x31')]=_[_0x6563('0x34')](db['ChatOfflineMessage'][_0x6563('0x2e')]);_0x312dcf[_0x6563('0x33')]=_[_0x6563('0x34')](_0x449862[_0x6563('0x33')]);_0x312dcf[_0x6563('0x35')]=_[_0x6563('0x36')](_0x312dcf[_0x6563('0x31')],_0x312dcf[_0x6563('0x33')]);_0x4f1f99[_0x6563('0x37')]=_[_0x6563('0x36')](_0x312dcf['model'],qs['fields'](_0x449862['query']['fields']));_0x4f1f99[_0x6563('0x37')]=_0x4f1f99['attributes']['length']?_0x4f1f99['attributes']:_0x312dcf[_0x6563('0x31')];if(!_0x449862['query']['hasOwnProperty']('nolimit')){_0x4f1f99[_0x6563('0x1f')]=qs[_0x6563('0x1f')](_0x449862['query']['limit']);_0x4f1f99['offset']=qs[_0x6563('0x21')](_0x449862[_0x6563('0x33')]['offset']);}_0x4f1f99['order']=qs[_0x6563('0x3b')](_0x449862[_0x6563('0x33')][_0x6563('0x3b')]);_0x4f1f99[_0x6563('0x3c')]=qs[_0x6563('0x35')](_[_0x6563('0x3d')](_0x449862[_0x6563('0x33')],_0x312dcf[_0x6563('0x35')]));_0x4f1f99['where'][_0x6563('0x55')]=_0x2e2723['id'];if(_0x449862[_0x6563('0x33')]['filter']){_0x4f1f99[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0x4f1f99[_0x6563('0x3c')],{'$or':_[_0x6563('0x32')](_0x4f1f99[_0x6563('0x37')],function(_0x728fdf){var _0x5af3a4={};_0x5af3a4[_0x728fdf]={'$like':'%'+_0x449862[_0x6563('0x33')]['filter']+'%'};return _0x5af3a4;})});}_0x4f1f99=_[_0x6563('0x3f')]({},_0x4f1f99,_0x449862[_0x6563('0x41')]);return db[_0x6563('0x118')][_0x6563('0x20')]({'where':_0x4f1f99[_0x6563('0x3c')]})[_0x6563('0x24')](function(_0xa56a55){_0x5ea038[_0x6563('0x20')]=_0xa56a55;if(_0x449862[_0x6563('0x33')][_0x6563('0x59')]){_0x4f1f99[_0x6563('0x43')]=[{'all':!![]}];}else{_0x4f1f99['include']=[{'model':db[_0x6563('0x82')],'as':_0x6563('0xe8'),'required':![]},{'model':db['Attachment'],'as':_0x6563('0x119'),'required':![]}];}return db[_0x6563('0x118')][_0x6563('0x44')](_0x4f1f99);})['then'](function(_0x4c026e){_0x5ea038[_0x6563('0x45')]=_0x4c026e;return _0x5ea038;});}})[_0x6563('0x24')](respondWithFilteredResult(_0x11806f,_0x4f1f99))[_0x6563('0x1b')](handleError(_0x11806f,null));};exports[_0x6563('0x11a')]=function(_0x3215b7,_0x1ddf3d){return db[_0x6563('0x42')]['find']({'where':{'id':_0x3215b7['params']['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x1ddf3d,null))[_0x6563('0x24')](function(_0x3b91ee){if(_0x3b91ee){return _0x3b91ee[_0x6563('0x11a')](_0x3215b7['body'][_0x6563('0x5b')],_[_0x6563('0xe6')](_0x3215b7[_0x6563('0x49')],['ids','id'])||{})[_0x6563('0xaf')](function(_0x3d34d9){for(var _0x29c756=0x0;_0x29c756<_0x3215b7['body']['ids'][_0x6563('0x47')];_0x29c756+=0x1){socket[_0x6563('0x11b')](_0x6563('0x11c'),{'UserId':Number(_0x3215b7[_0x6563('0x49')][_0x6563('0x5b')][_0x29c756]),'ChatWebsiteId':Number(_0x3215b7[_0x6563('0x52')]['id'])});}return _0x3d34d9;});}})[_0x6563('0x24')](respondWithResult(_0x1ddf3d,null))[_0x6563('0x1b')](handleError(_0x1ddf3d,null));};exports[_0x6563('0x11d')]=function(_0x4c9334,_0x3db47e){return db[_0x6563('0x42')][_0x6563('0x48')]({'where':{'id':_0x4c9334[_0x6563('0x52')]['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x3db47e,null))['then'](function(_0x5157bf){if(_0x5157bf){return _0x5157bf[_0x6563('0x11d')](_0x4c9334['query'][_0x6563('0x5b')])[_0x6563('0x24')](function(){if(_['isArray'](_0x4c9334[_0x6563('0x33')][_0x6563('0x5b')])){for(var _0x40ba29=0x0;_0x40ba29<_0x4c9334[_0x6563('0x33')][_0x6563('0x5b')][_0x6563('0x47')];_0x40ba29+=0x1){socket['emit'](_0x6563('0x11e'),{'UserId':Number(_0x4c9334[_0x6563('0x33')]['ids'][_0x40ba29]),'ChatWebsiteId':Number(_0x4c9334[_0x6563('0x52')]['id'])});}}else{socket['emit'](_0x6563('0x11e'),{'UserId':Number(_0x4c9334[_0x6563('0x33')][_0x6563('0x5b')]),'ChatWebsiteId':Number(_0x4c9334[_0x6563('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x3db47e,null))[_0x6563('0x1b')](handleError(_0x3db47e,null));};exports[_0x6563('0x11f')]=function(_0x4442fa,_0x25949a){var _0xb105a8={};var _0x463804={};var _0x42f038;var _0x31b959;return db[_0x6563('0x42')]['findOne']({'where':{'id':_0x4442fa['params']['id']}})[_0x6563('0x24')](handleEntityNotFound(_0x25949a,null))[_0x6563('0x24')](function(_0x31af31){if(_0x31af31){_0x42f038=_0x31af31;_0x463804[_0x6563('0x31')]=_[_0x6563('0x34')](db[_0x6563('0xb8')][_0x6563('0x2e')]);_0x463804[_0x6563('0x33')]=_[_0x6563('0x34')](_0x4442fa[_0x6563('0x33')]);_0x463804[_0x6563('0x35')]=_[_0x6563('0x36')](_0x463804['model'],_0x463804['query']);_0xb105a8[_0x6563('0x37')]=_[_0x6563('0x36')](_0x463804['model'],qs['fields'](_0x4442fa[_0x6563('0x33')][_0x6563('0x38')]));_0xb105a8[_0x6563('0x37')]=_0xb105a8['attributes'][_0x6563('0x47')]?_0xb105a8['attributes']:_0x463804[_0x6563('0x31')];_0xb105a8['order']=qs[_0x6563('0x3b')](_0x4442fa[_0x6563('0x33')][_0x6563('0x3b')]);_0xb105a8[_0x6563('0x3c')]=qs[_0x6563('0x35')](_[_0x6563('0x3d')](_0x4442fa[_0x6563('0x33')],_0x463804[_0x6563('0x35')]));if(_0x4442fa[_0x6563('0x33')][_0x6563('0x3e')]){_0xb105a8[_0x6563('0x3c')]=_[_0x6563('0x3f')](_0xb105a8[_0x6563('0x3c')],{'$or':_[_0x6563('0x32')](_0xb105a8[_0x6563('0x37')],function(_0x2de5b7){var _0x3c57fd={};_0x3c57fd[_0x2de5b7]={'$like':'%'+_0x4442fa[_0x6563('0x33')][_0x6563('0x3e')]+'%'};return _0x3c57fd;})});}_0xb105a8=_[_0x6563('0x3f')]({},_0xb105a8,_0x4442fa['options']);return _0x42f038[_0x6563('0x11f')](_0xb105a8);}})[_0x6563('0x24')](function(_0x2fc867){if(_0x2fc867){_0x31b959=_0x2fc867[_0x6563('0x47')];if(!_0x4442fa[_0x6563('0x33')]['hasOwnProperty'](_0x6563('0x39'))){_0xb105a8[_0x6563('0x1f')]=qs[_0x6563('0x1f')](_0x4442fa['query'][_0x6563('0x1f')]);_0xb105a8[_0x6563('0x21')]=qs['offset'](_0x4442fa[_0x6563('0x33')]['offset']);}return _0x42f038['getAgents'](_0xb105a8);}})[_0x6563('0x24')](function(_0x35569d){if(_0x35569d){return _0x35569d?{'count':_0x31b959,'rows':_0x35569d}:null;}})[_0x6563('0x24')](respondWithResult(_0x25949a,null))[_0x6563('0x1b')](handleError(_0x25949a,null));}; \ No newline at end of file +var _0x447b=['includeAll','include','ChatWebsite','catch','show','params','Pause','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','rows','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','account','applications','list','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor','format','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','NotifyMailAccount','remove','addInteraction','getInteractions','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','labelText','backgroundColor','hideWhenOffline','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','online','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','code','message','result','status','end','json','offset','undefined','limit','count','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter'];(function(_0x464343,_0x4f08dd){var _0x44af04=function(_0x3d7967){while(--_0x3d7967){_0x464343['push'](_0x464343['shift']());}};_0x44af04(++_0x4f08dd);}(_0x447b,0xe4));var _0xb447=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x447b[_0x12e3e3];return _0x26602e;};'use strict';var BPromise=require(_0xb447('0x0'));var Mustache=require(_0xb447('0x1'));var util=require('util');var path=require(_0xb447('0x2'));var ejs=require(_0xb447('0x3'));var fs=require('fs');var fs_extra=require(_0xb447('0x4'));var _=require(_0xb447('0x5'));var querystring=require(_0xb447('0x6'));var Redis=require(_0xb447('0x7'));var qs=require(_0xb447('0x8'));var logger=require(_0xb447('0x9'))(_0xb447('0xa'));var config=require(_0xb447('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb447('0xc')](config['redis'],{'host':_0xb447('0xd'),'port':0x18eb});var socket=require(_0xb447('0xe'))(new Redis(config[_0xb447('0xf')]));require(_0xb447('0x10'))[_0xb447('0x11')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xb447('0x12'));var client=jayson[_0xb447('0x13')][_0xb447('0x14')]({'port':0x232c});var client9002=jayson[_0xb447('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xb447('0x13')][_0xb447('0x14')]({'port':0x232b});var client9001=jayson[_0xb447('0x13')][_0xb447('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x461c97,_0x3743e7,_0x255ce0,_0x128a85){return new BPromise(function(_0x36ba65,_0x533712){var _0x4a8d6f=_0x128a85||client;return _0x4a8d6f[_0xb447('0x15')](_0x461c97,_0x255ce0)[_0xb447('0x16')](function(_0x5e63fb){logger[_0xb447('0x17')](_0xb447('0x18'),_0x3743e7,_0xb447('0x19'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3743e7,_0xb447('0x19'),JSON['stringify'](_0x5e63fb));if(_0x5e63fb[_0xb447('0x1a')]){if(_0x5e63fb['error'][_0xb447('0x1b')]===0x1f4){logger[_0xb447('0x1a')](_0xb447('0x18'),_0x3743e7,_0x5e63fb[_0xb447('0x1a')][_0xb447('0x1c')]);return _0x533712(_0x5e63fb[_0xb447('0x1a')][_0xb447('0x1c')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3743e7,_0x5e63fb[_0xb447('0x1a')][_0xb447('0x1c')]);return _0x36ba65(_0x5e63fb[_0xb447('0x1a')]['message']);}else{logger[_0xb447('0x17')](_0xb447('0x18'),_0x3743e7,_0xb447('0x19'));_0x36ba65(_0x5e63fb[_0xb447('0x1d')][_0xb447('0x1c')]);}})['catch'](function(_0xc3e763){logger[_0xb447('0x1a')](_0xb447('0x18'),_0x3743e7,_0xc3e763);_0x533712(_0xc3e763);});});}function respondWithStatusCode(_0x457ebc,_0x2bcde6){_0x2bcde6=_0x2bcde6||0xcc;return function(_0x28171f){if(_0x28171f){return _0x457ebc['sendStatus'](_0x2bcde6);}return _0x457ebc[_0xb447('0x1e')](_0x2bcde6)[_0xb447('0x1f')]();};}function respondWithResult(_0x24081c,_0x3c4d75){_0x3c4d75=_0x3c4d75||0xc8;return function(_0x1a8f69){if(_0x1a8f69){return _0x24081c['status'](_0x3c4d75)[_0xb447('0x20')](_0x1a8f69);}};}function respondWithFilteredResult(_0x265f11,_0x19d67a){return function(_0x42b452){if(_0x42b452){var _0x54c79b=typeof _0x19d67a[_0xb447('0x21')]===_0xb447('0x22')&&typeof _0x19d67a[_0xb447('0x23')]==='undefined';var _0x43153a=_0x42b452[_0xb447('0x24')];var _0x35f4ba=_0x54c79b?0x0:_0x19d67a[_0xb447('0x21')];var _0x1c5eec=_0x54c79b?_0x42b452[_0xb447('0x24')]:_0x19d67a[_0xb447('0x21')]+_0x19d67a[_0xb447('0x23')];var _0x2fb789;if(_0x1c5eec>=_0x43153a){_0x1c5eec=_0x43153a;_0x2fb789=0xc8;}else{_0x2fb789=0xce;}_0x265f11['status'](_0x2fb789);return _0x265f11['set']('Content-Range',_0x35f4ba+'-'+_0x1c5eec+'/'+_0x43153a)[_0xb447('0x20')](_0x42b452);}return null;};}function saveUpdates(_0x4c6691){return function(_0x49d6fc){if(_0x49d6fc){return _0x49d6fc['update'](_0x4c6691)[_0xb447('0x16')](function(_0x230a11){return _0x230a11;});}return null;};}function removeEntity(_0x1963a7){return function(_0x331158){if(_0x331158){return _0x331158['destroy']()[_0xb447('0x16')](function(){var _0xa13fbe=_0x331158[_0xb447('0x25')]({'plain':!![]});var _0x12f851=_0xb447('0x26');return db[_0xb447('0x27')][_0xb447('0x28')]({'where':{'type':_0x12f851,'resourceId':_0xa13fbe['id']}})[_0xb447('0x16')](function(){return _0x331158;});})[_0xb447('0x16')](function(){_0x1963a7[_0xb447('0x1e')](0xcc)[_0xb447('0x1f')]();});}};}function handleEntityNotFound(_0x23fda9){return function(_0x1565cc){if(!_0x1565cc){_0x23fda9[_0xb447('0x29')](0x194);}return _0x1565cc;};}function handleError(_0x53436f,_0x34c12c){_0x34c12c=_0x34c12c||0x1f4;return function(_0xfad317){logger[_0xb447('0x1a')](_0xfad317[_0xb447('0x2a')]);if(_0xfad317[_0xb447('0x2b')]){delete _0xfad317[_0xb447('0x2b')];}_0x53436f['status'](_0x34c12c)[_0xb447('0x2c')](_0xfad317);};}exports[_0xb447('0x2d')]=function(_0x144997,_0x4afc11){var _0x4e8d44={'include':[{'model':db['Pause'],'as':_0xb447('0x2e')}]},_0x2ac96e={},_0x4f39a6={'count':0x0,'rows':[]};var _0xf2c3a0=_[_0xb447('0x2f')](db['ChatWebsite']['rawAttributes'],function(_0x54fdf3){return{'name':_0x54fdf3[_0xb447('0x30')],'type':_0x54fdf3['type'][_0xb447('0x31')]};});_0x2ac96e[_0xb447('0x32')]=_[_0xb447('0x2f')](_0xf2c3a0,_0xb447('0x2b'));_0x2ac96e[_0xb447('0x33')]=_[_0xb447('0x34')](_0x144997[_0xb447('0x33')]);_0x2ac96e[_0xb447('0x35')]=_[_0xb447('0x36')](_0x2ac96e['model'],_0x2ac96e[_0xb447('0x33')]);_0x4e8d44['attributes']=_[_0xb447('0x36')](_0x2ac96e[_0xb447('0x32')],qs[_0xb447('0x37')](_0x144997['query'][_0xb447('0x37')]));_0x4e8d44[_0xb447('0x38')]=_0x4e8d44[_0xb447('0x38')][_0xb447('0x39')]?_0x4e8d44[_0xb447('0x38')]:_0x2ac96e[_0xb447('0x32')];if(!_0x144997['query'][_0xb447('0x3a')](_0xb447('0x3b'))){_0x4e8d44['limit']=qs[_0xb447('0x23')](_0x144997[_0xb447('0x33')]['limit']);_0x4e8d44[_0xb447('0x21')]=qs['offset'](_0x144997[_0xb447('0x33')]['offset']);}_0x4e8d44[_0xb447('0x3c')]=qs[_0xb447('0x3d')](_0x144997[_0xb447('0x33')][_0xb447('0x3d')]);_0x4e8d44[_0xb447('0x3e')]=qs[_0xb447('0x35')](_[_0xb447('0x3f')](_0x144997[_0xb447('0x33')],_0x2ac96e[_0xb447('0x35')]),_0xf2c3a0);if(_0x144997[_0xb447('0x33')]['filter']){_0x4e8d44[_0xb447('0x3e')]=_[_0xb447('0x40')](_0x4e8d44[_0xb447('0x3e')],{'$or':_[_0xb447('0x2f')](_0xf2c3a0,function(_0x534dea){if(_0x534dea[_0xb447('0x41')]!==_0xb447('0x42')){var _0x4766ed={};_0x4766ed[_0x534dea[_0xb447('0x2b')]]={'$like':'%'+_0x144997[_0xb447('0x33')][_0xb447('0x43')]+'%'};return _0x4766ed;}})});}_0x4e8d44=_[_0xb447('0x40')]({},_0x4e8d44,_0x144997['options']);var _0x22c961={'where':_0x4e8d44[_0xb447('0x3e')]};return db['ChatWebsite'][_0xb447('0x24')](_0x22c961)[_0xb447('0x16')](function(_0x1d2bfc){_0x4f39a6['count']=_0x1d2bfc;if(_0x144997[_0xb447('0x33')][_0xb447('0x44')]){_0x4e8d44[_0xb447('0x45')]=[{'all':!![]}];}return db[_0xb447('0x46')]['findAll'](_0x4e8d44);})[_0xb447('0x16')](function(_0x47b8f0){_0x4f39a6['rows']=_0x47b8f0;return _0x4f39a6;})[_0xb447('0x16')](respondWithFilteredResult(_0x4afc11,_0x4e8d44))[_0xb447('0x47')](handleError(_0x4afc11,null));};exports[_0xb447('0x48')]=function(_0x38e484,_0x1ce941){var _0x31644e={'raw':![],'where':{'id':_0x38e484[_0xb447('0x49')]['id']},'include':[{'model':db[_0xb447('0x4a')],'as':_0xb447('0x2e')}]},_0x22a85e={};_0x22a85e['model']=_[_0xb447('0x34')](db[_0xb447('0x46')][_0xb447('0x4b')]);_0x22a85e[_0xb447('0x33')]=_['keys'](_0x38e484['query']);_0x22a85e[_0xb447('0x35')]=_[_0xb447('0x36')](_0x22a85e[_0xb447('0x32')],_0x22a85e['query']);_0x31644e[_0xb447('0x38')]=_[_0xb447('0x36')](_0x22a85e[_0xb447('0x32')],qs[_0xb447('0x37')](_0x38e484[_0xb447('0x33')]['fields']));_0x31644e[_0xb447('0x38')]=_0x31644e[_0xb447('0x38')][_0xb447('0x39')]?_0x31644e[_0xb447('0x38')]:_0x22a85e['model'];if(_0x38e484[_0xb447('0x33')][_0xb447('0x44')]){_0x31644e[_0xb447('0x45')]=[{'all':!![]}];}_0x31644e=_[_0xb447('0x40')]({},_0x31644e,_0x38e484[_0xb447('0x4c')]);return db['ChatWebsite'][_0xb447('0x4d')](_0x31644e)[_0xb447('0x16')](handleEntityNotFound(_0x1ce941,null))[_0xb447('0x16')](respondWithResult(_0x1ce941,null))[_0xb447('0x47')](handleError(_0x1ce941,null));};exports[_0xb447('0x4e')]=function(_0xefa360,_0x548036){return db[_0xb447('0x46')][_0xb447('0x4e')](_0xefa360[_0xb447('0x4f')],{})[_0xb447('0x16')](function(_0x10eb6b){var _0x502a47=_0xefa360['user'][_0xb447('0x25')]({'plain':!![]});if(!_0x502a47)throw new Error(_0xb447('0x50'));if(_0x502a47[_0xb447('0x51')]==='user'){var _0x3a1dd0=_0x10eb6b[_0xb447('0x25')]({'plain':!![]});var _0x3f0bb9='ChatWebsites';return db[_0xb447('0x52')][_0xb447('0x4d')]({'where':{'name':_0x3f0bb9,'userProfileId':_0x502a47[_0xb447('0x53')]},'raw':!![]})[_0xb447('0x16')](function(_0x13f81e){if(_0x13f81e&&_0x13f81e['autoAssociation']===0x0){return db['UserProfileResource'][_0xb447('0x4e')]({'name':_0x3a1dd0[_0xb447('0x2b')],'resourceId':_0x3a1dd0['id'],'type':_0x13f81e['name'],'sectionId':_0x13f81e['id']},{})['then'](function(){return _0x10eb6b;});}else{return _0x10eb6b;}})['catch'](function(_0x4668da){logger[_0xb447('0x1a')](_0xb447('0x54'),_0x4668da);throw _0x4668da;});}return _0x10eb6b;})[_0xb447('0x16')](respondWithResult(_0x548036,0xc9))['catch'](handleError(_0x548036,null));};exports[_0xb447('0x55')]=function(_0x5e19b7,_0x2d4e48){if(_0x5e19b7[_0xb447('0x4f')]['id']){delete _0x5e19b7['body']['id'];}return db[_0xb447('0x46')]['find']({'where':{'id':_0x5e19b7['params']['id']},'include':[{'model':db[_0xb447('0x4a')],'as':'mandatoryDispositionPause'}]})[_0xb447('0x16')](handleEntityNotFound(_0x2d4e48,null))[_0xb447('0x16')](saveUpdates(_0x5e19b7[_0xb447('0x4f')],null))[_0xb447('0x16')](respondWithResult(_0x2d4e48,null))['catch'](handleError(_0x2d4e48,null));};exports['destroy']=function(_0x540903,_0x2d9bf4){return db['ChatWebsite'][_0xb447('0x4d')]({'where':{'id':_0x540903[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x2d9bf4,null))[_0xb447('0x16')](removeEntity(_0x2d9bf4,null))[_0xb447('0x47')](handleError(_0x2d9bf4,null));};exports[_0xb447('0x56')]=function(_0x57b5a2,_0x28a5be){return db[_0xb447('0x46')]['describe']()[_0xb447('0x16')](respondWithResult(_0x28a5be,null))[_0xb447('0x47')](handleError(_0x28a5be,null));};exports[_0xb447('0x57')]=function(_0x1f5451,_0x5c1a8e){if(_0x1f5451[_0xb447('0x4f')]['id']){delete _0x1f5451[_0xb447('0x4f')]['id'];}return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x1f5451[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x5c1a8e,null))['then'](function(_0x207a7f){if(_0x207a7f){_0x1f5451[_0xb447('0x4f')][_0xb447('0x58')]=_0x207a7f['id'];return db['Disposition']['create'](_0x1f5451[_0xb447('0x4f')]);}})[_0xb447('0x16')](respondWithResult(_0x5c1a8e,null))[_0xb447('0x47')](handleError(_0x5c1a8e,null));};exports[_0xb447('0x59')]=function(_0xbba899,_0x231ea1){var _0x3ca40c={'raw':![],'where':{}};var _0x27d1ab={};var _0x1ef9be={'count':0x0,'rows':[]};return db[_0xb447('0x46')]['findOne']({'where':{'id':_0xbba899[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x231ea1,null))[_0xb447('0x16')](function(_0x39c386){if(_0x39c386){_0x27d1ab[_0xb447('0x32')]=_['keys'](db[_0xb447('0x5a')][_0xb447('0x4b')]);_0x27d1ab['query']=_[_0xb447('0x34')](_0xbba899['query']);_0x27d1ab[_0xb447('0x35')]=_[_0xb447('0x36')](_0x27d1ab['model'],_0x27d1ab['query']);_0x3ca40c[_0xb447('0x38')]=_['intersection'](_0x27d1ab['model'],qs[_0xb447('0x37')](_0xbba899[_0xb447('0x33')][_0xb447('0x37')]));_0x3ca40c[_0xb447('0x38')]=_0x3ca40c[_0xb447('0x38')][_0xb447('0x39')]?_0x3ca40c[_0xb447('0x38')]:_0x27d1ab[_0xb447('0x32')];if(!_0xbba899[_0xb447('0x33')][_0xb447('0x3a')](_0xb447('0x3b'))){_0x3ca40c['limit']=qs[_0xb447('0x23')](_0xbba899['query'][_0xb447('0x23')]);_0x3ca40c[_0xb447('0x21')]=qs['offset'](_0xbba899[_0xb447('0x33')][_0xb447('0x21')]);}_0x3ca40c[_0xb447('0x3c')]=qs[_0xb447('0x3d')](_0xbba899[_0xb447('0x33')][_0xb447('0x3d')]);_0x3ca40c[_0xb447('0x3e')]=qs[_0xb447('0x35')](_[_0xb447('0x3f')](_0xbba899[_0xb447('0x33')],_0x27d1ab[_0xb447('0x35')]));_0x3ca40c[_0xb447('0x3e')][_0xb447('0x58')]=_0x39c386['id'];if(_0xbba899['query'][_0xb447('0x43')]){_0x3ca40c[_0xb447('0x3e')]=_[_0xb447('0x40')](_0x3ca40c[_0xb447('0x3e')],{'$or':_[_0xb447('0x2f')](_0x3ca40c[_0xb447('0x38')],function(_0x3b5303){var _0x392e06={};_0x392e06[_0x3b5303]={'$like':'%'+_0xbba899['query'][_0xb447('0x43')]+'%'};return _0x392e06;})});}_0x3ca40c=_[_0xb447('0x40')]({},_0x3ca40c,_0xbba899[_0xb447('0x4c')]);return db[_0xb447('0x5a')][_0xb447('0x24')]({'where':_0x3ca40c[_0xb447('0x3e')]})[_0xb447('0x16')](function(_0x113c5a){_0x1ef9be['count']=_0x113c5a;if(_0xbba899['query'][_0xb447('0x44')]){_0x3ca40c[_0xb447('0x45')]=[{'all':!![]}];}return db[_0xb447('0x5a')][_0xb447('0x5b')](_0x3ca40c);})[_0xb447('0x16')](function(_0x351dc7){_0x1ef9be['rows']=_0x351dc7;return _0x1ef9be;});}})[_0xb447('0x16')](respondWithFilteredResult(_0x231ea1,_0x3ca40c))['catch'](handleError(_0x231ea1,null));};exports[_0xb447('0x5c')]=function(_0x407ce9,_0x40d551){return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x407ce9['params']['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x40d551,null))[_0xb447('0x16')](function(_0x18ce6c){if(_0x18ce6c){return _0x18ce6c[_0xb447('0x5c')](_0x407ce9['query']['ids']);}})[_0xb447('0x16')](respondWithStatusCode(_0x40d551,null))['catch'](handleError(_0x40d551,null));};exports[_0xb447('0x5d')]=function(_0x59b74c,_0x2a7557){if(_0x59b74c[_0xb447('0x4f')]['id']){delete _0x59b74c[_0xb447('0x4f')]['id'];}return db[_0xb447('0x46')]['find']({'where':{'id':_0x59b74c[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x2a7557,null))['then'](function(_0x1850e6){if(_0x1850e6){_0x59b74c[_0xb447('0x4f')]['ChatWebsiteId']=_0x1850e6['id'];return db[_0xb447('0x5e')]['create'](_0x59b74c[_0xb447('0x4f')]);}})[_0xb447('0x16')](respondWithResult(_0x2a7557,null))[_0xb447('0x47')](handleError(_0x2a7557,null));};exports[_0xb447('0x5f')]=function(_0x6d7bc6,_0x5b607f){var _0x41cc97={'raw':![],'where':{}};var _0x490548={};var _0x551e43={'count':0x0,'rows':[]};return db[_0xb447('0x46')][_0xb447('0x60')]({'where':{'id':_0x6d7bc6[_0xb447('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b607f,null))[_0xb447('0x16')](function(_0x46e2e5){if(_0x46e2e5){_0x490548['model']=_[_0xb447('0x34')](db[_0xb447('0x5e')][_0xb447('0x4b')]);_0x490548[_0xb447('0x33')]=_[_0xb447('0x34')](_0x6d7bc6[_0xb447('0x33')]);_0x490548[_0xb447('0x35')]=_[_0xb447('0x36')](_0x490548[_0xb447('0x32')],_0x490548[_0xb447('0x33')]);_0x41cc97[_0xb447('0x38')]=_[_0xb447('0x36')](_0x490548[_0xb447('0x32')],qs[_0xb447('0x37')](_0x6d7bc6[_0xb447('0x33')][_0xb447('0x37')]));_0x41cc97['attributes']=_0x41cc97[_0xb447('0x38')][_0xb447('0x39')]?_0x41cc97[_0xb447('0x38')]:_0x490548[_0xb447('0x32')];if(!_0x6d7bc6[_0xb447('0x33')][_0xb447('0x3a')](_0xb447('0x3b'))){_0x41cc97[_0xb447('0x23')]=qs['limit'](_0x6d7bc6['query']['limit']);_0x41cc97[_0xb447('0x21')]=qs[_0xb447('0x21')](_0x6d7bc6[_0xb447('0x33')]['offset']);}_0x41cc97[_0xb447('0x3c')]=qs[_0xb447('0x3d')](_0x6d7bc6['query']['sort']);_0x41cc97['where']=qs['filters'](_['pick'](_0x6d7bc6['query'],_0x490548[_0xb447('0x35')]));_0x41cc97[_0xb447('0x3e')]['ChatWebsiteId']=_0x46e2e5['id'];if(_0x6d7bc6['query']['filter']){_0x41cc97['where']=_[_0xb447('0x40')](_0x41cc97[_0xb447('0x3e')],{'$or':_['map'](_0x41cc97['attributes'],function(_0xa4a56b){var _0x829187={};_0x829187[_0xa4a56b]={'$like':'%'+_0x6d7bc6['query']['filter']+'%'};return _0x829187;})});}_0x41cc97=_[_0xb447('0x40')]({},_0x41cc97,_0x6d7bc6['options']);return db['CannedAnswer'][_0xb447('0x24')]({'where':_0x41cc97['where']})[_0xb447('0x16')](function(_0x326130){_0x551e43[_0xb447('0x24')]=_0x326130;if(_0x6d7bc6[_0xb447('0x33')]['includeAll']){_0x41cc97['include']=[{'all':!![]}];}return db[_0xb447('0x5e')][_0xb447('0x5b')](_0x41cc97);})[_0xb447('0x16')](function(_0x3de632){_0x551e43[_0xb447('0x61')]=_0x3de632;return _0x551e43;});}})[_0xb447('0x16')](respondWithFilteredResult(_0x5b607f,_0x41cc97))['catch'](handleError(_0x5b607f,null));};exports[_0xb447('0x62')]=function(_0x163426,_0x166e8c){return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x163426['params']['id']}})['then'](handleEntityNotFound(_0x166e8c,null))[_0xb447('0x16')](function(_0xe64384){if(_0xe64384){return _0xe64384[_0xb447('0x62')](_0x163426['query'][_0xb447('0x63')]);}})['then'](respondWithStatusCode(_0x166e8c,null))[_0xb447('0x47')](handleError(_0x166e8c,null));};exports[_0xb447('0x64')]=function(_0x5539d0,_0x20e5c8){_0x5539d0[_0xb447('0x4f')][_0xb447('0x65')]=_0x5539d0[_0xb447('0x66')][_0xb447('0x67')];return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x5539d0[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x20e5c8,null))[_0xb447('0x16')](saveUpdates(_0x5539d0[_0xb447('0x4f')],null))[_0xb447('0x16')](respondWithResult(_0x20e5c8,null))[_0xb447('0x47')](handleError(_0x20e5c8,null));};exports[_0xb447('0x68')]=function(_0x58f533,_0x10cdc0){_0x58f533[_0xb447('0x4f')][_0xb447('0x69')]=_0x58f533[_0xb447('0x66')][_0xb447('0x67')];return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x58f533[_0xb447('0x49')]['id']}})['then'](handleEntityNotFound(_0x10cdc0,null))[_0xb447('0x16')](saveUpdates(_0x58f533[_0xb447('0x4f')],null))[_0xb447('0x16')](respondWithResult(_0x10cdc0,null))[_0xb447('0x47')](handleError(_0x10cdc0,null));};exports[_0xb447('0x6a')]=function(_0x3d9685,_0x29aebd){_0x3d9685[_0xb447('0x4f')][_0xb447('0x6b')]=_0x3d9685[_0xb447('0x66')][_0xb447('0x67')];return db[_0xb447('0x46')]['find']({'where':{'id':_0x3d9685[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x29aebd,null))[_0xb447('0x16')](saveUpdates(_0x3d9685[_0xb447('0x4f')],null))[_0xb447('0x16')](respondWithResult(_0x29aebd,null))[_0xb447('0x47')](handleError(_0x29aebd,null));};exports[_0xb447('0x6c')]=function(_0x595284,_0x55609b){_0x595284['body'][_0xb447('0x6d')]=_0x595284[_0xb447('0x66')]['filename'];return db[_0xb447('0x46')]['find']({'where':{'id':_0x595284[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x55609b,null))[_0xb447('0x16')](saveUpdates(_0x595284['body'],null))[_0xb447('0x16')](respondWithResult(_0x55609b,null))[_0xb447('0x47')](handleError(_0x55609b,null));};exports[_0xb447('0x6e')]=function(_0x19f4df,_0x53f41f){var _0x124a41=path[_0xb447('0x6f')](config['root'],_0xb447('0x70'));var _0x3e8d96={'where':{'id':_0x19f4df[_0xb447('0x49')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x286c52=![];return require('../../config/license/util')['getLicense']()[_0xb447('0x16')](function(_0x1bc23c){if(_0x1bc23c){_0x286c52=_0x1bc23c[_0xb447('0x71')];}})[_0xb447('0x16')](function(){return db['ChatWebsite'][_0xb447('0x4d')](_0x3e8d96);})['then'](handleEntityNotFound(_0x53f41f,null))[_0xb447('0x16')](function(_0x234fd2){if(_0x234fd2){if(!_[_0xb447('0x72')](_0x234fd2[_0xb447('0x65')])){if(fs[_0xb447('0x73')](path['join'](config['root'],'server/files/images/logos/',_0x234fd2[_0xb447('0x65')]))&&_0x286c52){_0x124a41=path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0x75'),_0x234fd2[_0xb447('0x65')]);}}return _0x53f41f['download'](_0x124a41);}})[_0xb447('0x47')](handleError(_0x53f41f,null));};exports[_0xb447('0x76')]=function(_0x1540ca,_0x3bc948){var _0x6c2d03=path[_0xb447('0x6f')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x2be4d2={'where':{'id':_0x1540ca['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x2be4d2)['then'](handleEntityNotFound(_0x3bc948,null))[_0xb447('0x16')](function(_0x3d4f18){if(_0x3d4f18){if(!_[_0xb447('0x72')](_0x3d4f18[_0xb447('0x69')])){if(fs[_0xb447('0x73')](path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0x77'),_0x3d4f18[_0xb447('0x69')]))){_0x6c2d03=path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0x77'),_0x3d4f18[_0xb447('0x69')]);}}return _0x3bc948[_0xb447('0x78')](_0x6c2d03);}})[_0xb447('0x47')](handleError(_0x3bc948,null));};exports[_0xb447('0x79')]=function(_0x2b82b3,_0x1ce905){var _0x46c619=path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0x7a'));var _0x4750d1={'where':{'id':_0x2b82b3[_0xb447('0x49')]['id']},'attributes':['id',_0xb447('0x6b'),_0xb447('0x7b')],'raw':!![]};return db[_0xb447('0x46')]['find'](_0x4750d1)[_0xb447('0x16')](handleEntityNotFound(_0x1ce905,null))[_0xb447('0x16')](function(_0xcab972){if(_0xcab972){if(!_[_0xb447('0x72')](_0xcab972[_0xb447('0x6b')])){if(fs[_0xb447('0x73')](path[_0xb447('0x6f')](config['root'],_0xb447('0x77'),_0xcab972[_0xb447('0x6b')]))&&_0xcab972['showCustomerAvatar']){_0x46c619=path[_0xb447('0x6f')](config['root'],_0xb447('0x77'),_0xcab972[_0xb447('0x6b')]);}}return _0x1ce905[_0xb447('0x78')](_0x46c619);}})[_0xb447('0x47')](handleError(_0x1ce905,null));};exports[_0xb447('0x7c')]=function(_0x547c30,_0x491f20){var _0x1af20f=path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0x7d'));var _0x2f43a2={'where':{'id':_0x547c30[_0xb447('0x49')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x2f43a2)[_0xb447('0x16')](handleEntityNotFound(_0x491f20,null))[_0xb447('0x16')](function(_0x2a82bc){if(_0x2a82bc){if(!_[_0xb447('0x72')](_0x2a82bc[_0xb447('0x6d')])){if(fs['existsSync'](path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0x77'),_0x2a82bc[_0xb447('0x6d')]))){_0x1af20f=path['join'](config['root'],_0xb447('0x77'),_0x2a82bc[_0xb447('0x6d')]);}}return _0x491f20[_0xb447('0x78')](_0x1af20f);}})['catch'](handleError(_0x491f20,null));};exports[_0xb447('0x7e')]=function(_0x54632c,_0x21931d){var _0x558ab2=require('user-agent-parser');var _0x3010ca=new _0x558ab2();var _0x437ed7=_0x3010ca[_0xb447('0x7f')](_0x54632c[_0xb447('0x80')][_0xb447('0x81')])[_0xb447('0x82')]();var _0x1cc63d={'body':_0x54632c[_0xb447('0x4f')],'channel':_0xb447('0x83')};var _0xc5b84b=[];var _0x2ead73=[];var _0x475431={};var _0x5b077a=![];return db[_0xb447('0x84')][_0xb447('0x56')]()[_0xb447('0x16')](function(_0x31e21b){if(!_0x31e21b){throw new db[(_0xb447('0x85'))][(_0xb447('0x86'))](_0xb447('0x87'));}_0xc5b84b=_[_0xb447('0x88')](_[_0xb447('0x34')](_0x31e21b),['createdAt','updatedAt']);_0x2ead73=_[_0xb447('0x88')](_[_0xb447('0x34')](_0x31e21b),[_0xb447('0x89'),_0xb447('0x8a'),_0xb447('0x8b'),_0xb447('0x8c')]);if(_0x54632c[_0xb447('0x4f')]['id']){delete _0x54632c[_0xb447('0x4f')]['id'];}if(_['isNil'](_0x54632c[_0xb447('0x4f')][_0xb447('0x8d')])){throw new db[(_0xb447('0x85'))][(_0xb447('0x86'))](_0xb447('0x8e'));}if(_[_0xb447('0x72')](_0x54632c[_0xb447('0x4f')]['body'])||_0x54632c[_0xb447('0x4f')]['body']===''){throw new db[(_0xb447('0x85'))][(_0xb447('0x86'))](_0xb447('0x8f'));}if(_[_0xb447('0x72')](_0x54632c[_0xb447('0x4f')][_0xb447('0x90')])){throw new db['Sequelize'][(_0xb447('0x86'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2ead73);}if(!_['includes'](_0x2ead73,_0x54632c[_0xb447('0x4f')]['mapKey'])){throw new db[(_0xb447('0x85'))][(_0xb447('0x86'))](_0xb447('0x91')+_0x2ead73);}_0x475431[_0x54632c[_0xb447('0x4f')][_0xb447('0x90')]]=_0x54632c[_0xb447('0x4f')][_0xb447('0x8d')];})[_0xb447('0x16')](function(){return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x54632c[_0xb447('0x49')]['id']},'include':[{'model':db[_0xb447('0x92')],'as':_0xb447('0x93'),'include':[{'model':db[_0xb447('0x84')],'as':'Contacts','where':_0x475431,'limit':0x1,'order':[[_0xb447('0x8a'),_0xb447('0x94')]]}]},{'model':db[_0xb447('0x95')],'as':_0xb447('0x96')}]});})[_0xb447('0x16')](handleEntityNotFound(_0x21931d,null))[_0xb447('0x16')](function(_0x3d90ba){if(_0x3d90ba&&_0x3d90ba[_0xb447('0x93')]){_0x1cc63d[_0xb447('0x97')]=_0x3d90ba;_0x1cc63d[_0xb447('0x98')]=_0x3d90ba[_0xb447('0x96')];_0x1cc63d[_0xb447('0x99')]=_0x3d90ba['List'];_0x1cc63d[_0xb447('0x98')]=_['orderBy'](_0x1cc63d['applications'],[_0xb447('0x9a')],[_0xb447('0x9b')]);if(_0x1cc63d['account']['Applications']){delete _0x1cc63d['account'][_0xb447('0x96')];}if(_0x1cc63d[_0xb447('0x97')][_0xb447('0x93')]&&_0x1cc63d[_0xb447('0x97')][_0xb447('0x93')][_0xb447('0x9c')]['length']){return _0x1cc63d[_0xb447('0x97')][_0xb447('0x93')][_0xb447('0x9c')][0x0];}var _0x38da26=_[_0xb447('0xc')](_0x54632c['body'],{'firstName':_0x54632c[_0xb447('0x4f')]['from'],'ListId':_0x3d90ba[_0xb447('0x8c')]});_0x38da26[_0x54632c[_0xb447('0x4f')]['mapKey']]=_0x54632c[_0xb447('0x4f')][_0xb447('0x8d')];return db['CmContact']['create'](_0x38da26,{'fields':_0xc5b84b,'raw':!![]});}})[_0xb447('0x16')](handleEntityNotFound(_0x21931d,null))[_0xb447('0x16')](function(_0x11f066){_0x1cc63d[_0xb447('0x9d')]=_0x11f066;var _0x43404a=_0x54632c[_0xb447('0x4f')][_0xb447('0x9e')];if(_0x54632c['headers'][_0xb447('0x9f')]){_0x43404a=_0x54632c['headers'][_0xb447('0x9f')];}else if(_0x54632c[_0xb447('0x80')][_0xb447('0xa0')]){_0x43404a=_['first'](_0x54632c[_0xb447('0x80')][_0xb447('0xa0')][_0xb447('0xa1')](','));}if(_0x11f066){var _0x221f60={'ContactId':_0x11f066['id'],'ChatWebsiteId':_0x54632c[_0xb447('0x49')]['id'],'from':(_0x11f066[_0xb447('0xa2')]||'')+'\x20'+(_0x11f066[_0xb447('0xa3')]||''),'customerIp':_0x43404a,'customerPort':_0x54632c[_0xb447('0x80')]['x-real-port']?_0x54632c[_0xb447('0x80')][_0xb447('0xa4')]:null,'referer':_0x54632c[_0xb447('0x4f')][_0xb447('0xa5')],'browserName':_0x437ed7['browser']['name']&&_0x437ed7[_0xb447('0xa6')][_0xb447('0xa7')]?util['format']('%s\x20%s',_0x437ed7[_0xb447('0xa6')]['name'],_0x437ed7['browser'][_0xb447('0xa7')]):_0xb447('0xa8'),'browserVersion':_0x437ed7[_0xb447('0xa6')][_0xb447('0xa7')]||_0xb447('0xa8'),'osName':util['format'](_0xb447('0xa9'),_0x437ed7['os'][_0xb447('0x2b')],_0x437ed7['os'][_0xb447('0xa7')]),'osVersion':_0x437ed7['os']['version'],'deviceModel':_0x437ed7[_0xb447('0xaa')][_0xb447('0x32')]&&_0x437ed7[_0xb447('0xaa')][_0xb447('0xab')]?util[_0xb447('0xac')](_0xb447('0xad'),_0x437ed7[_0xb447('0xaa')][_0xb447('0x32')],_0x437ed7['device'][_0xb447('0xab')],_0x437ed7[_0xb447('0xaa')][_0xb447('0x41')]):null,'deviceVendor':_0x437ed7[_0xb447('0xaa')][_0xb447('0xab')],'deviceType':_0x437ed7[_0xb447('0xaa')][_0xb447('0x41')],'formData':JSON[_0xb447('0xae')](_0x54632c['body'])};var _0x5724d4={'ChatWebsiteId':_0x54632c[_0xb447('0x49')]['id'],'closed':![]};if(_0x54632c[_0xb447('0x4f')][_0xb447('0xaf')]){_0x5724d4[_0xb447('0xaf')]=_0x54632c['body'][_0xb447('0xaf')];return db[_0xb447('0xb0')]['find']({'where':_0x5724d4})[_0xb447('0x16')](function(_0x37f69b){if(_0x37f69b){return[_0x37f69b,![]];}_0x221f60[_0xb447('0xaf')]=_0x54632c['body'][_0xb447('0xaf')];_0x221f60['externalUrl']=_0x54632c[_0xb447('0x4f')][_0xb447('0xb1')];return db['ChatInteraction']['create'](_0x221f60)['then'](function(_0x2ac3e7){return[_0x2ac3e7,!![]];});});}_0x5724d4[_0xb447('0xb2')]=_0x11f066['id'];if(_0x54632c['body'][_0xb447('0xb3')]&&_0x54632c[_0xb447('0x4f')][_0xb447('0xb3')]['id']){_0x5724d4['id']=_0x54632c[_0xb447('0x4f')][_0xb447('0xb3')]['id'];return db[_0xb447('0xb0')][_0xb447('0x4d')]({'where':_0x5724d4})[_0xb447('0x16')](function(_0x3e5fc8){if(_0x3e5fc8){return[_0x3e5fc8,![]];}return db['ChatInteraction'][_0xb447('0x4e')](_0x221f60)[_0xb447('0x16')](function(_0x34e634){return[_0x34e634,!![]];});});}return db[_0xb447('0xb0')][_0xb447('0x4e')](_0x221f60)[_0xb447('0x16')](function(_0x22b147){return[_0x22b147,!![]];});}})['spread'](function(_0x3cc8f2,_0x5c4bd9){if(_0x3cc8f2){_0x5b077a=_0x5c4bd9;if(!_0x5c4bd9){var _0xb05a1b={'from':(_0x1cc63d['contact'][_0xb447('0xa2')]||'')+'\x20'+(_0x1cc63d[_0xb447('0x9d')][_0xb447('0xa3')]||'')};if(_0x54632c[_0xb447('0x4f')]['threadId']&&_0x54632c['body']['messageId']&&_0x54632c[_0xb447('0x4f')][_0xb447('0xaf')]!=_0x54632c[_0xb447('0x4f')][_0xb447('0xb4')]){_0xb05a1b[_0xb447('0xaf')]=_0x54632c['body'][_0xb447('0xb4')];}return _0x3cc8f2[_0xb447('0x55')](_0xb05a1b);}else{return _0x3cc8f2;}}})[_0xb447('0x16')](function(_0x148e46){_0x1cc63d[_0xb447('0xb3')]=_0x148e46[_0xb447('0x25')]({'plain':!![]});_0x1cc63d[_0xb447('0xb3')][_0xb447('0xb5')]=_0x5b077a;if(_0x1cc63d[_0xb447('0xb3')]['created']){if(_0x1cc63d[_0xb447('0x97')]['autoclose']){_0x1cc63d[_0xb447('0x98')][_0xb447('0xb6')]({'id':0x0,'priority':_0x1cc63d[_0xb447('0x98')][_0xb447('0x39')]+0x1,'app':_0xb447('0xb7'),'appdata':_0xb447('0xb8'),'interval':_0xb447('0xb9')});}}return db[_0xb447('0xba')][_0xb447('0x4e')]({'body':_0x54632c['body'][_0xb447('0x4f')],'ChatWebsiteId':_0x54632c[_0xb447('0x49')]['id'],'ChatInteractionId':_0x148e46['id'],'direction':'in','ContactId':_0x1cc63d['contact']['id'],'AttachmentId':_0x54632c[_0xb447('0x4f')]['AttachmentId']});})[_0xb447('0x16')](function(_0x3c4368){_0x1cc63d[_0xb447('0x1c')]=_0x3c4368;if(_0x1cc63d[_0xb447('0xb3')][_0xb447('0xbb')]){return db['User'][_0xb447('0x4d')]({'attributes':['id',_0xb447('0x2b')],'where':{'id':_0x1cc63d[_0xb447('0xb3')][_0xb447('0xbb')]}})[_0xb447('0x16')](function(_0x52fd8b){if(_0x52fd8b){_0x1cc63d['applications'][_0xb447('0xbc')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x52fd8b[_0xb447('0x2b')]+','+(_0x1cc63d[_0xb447('0x97')]['waitForTheAssignedAgent']||0xa),'interval':_0xb447('0xb9')});_0x1cc63d[_0xb447('0xbd')]=!![];}return respondWithRpcPromise(_0xb447('0xbe'),_0xb447('0xbf'),_0x1cc63d);});}return respondWithRpcPromise('Start',_0xb447('0xbf'),_0x1cc63d);})[_0xb447('0x16')](function(_0x3ffcae){respondWithRpcPromise(_0xb447('0xc0'),_0xb447('0xc0'),{'event':'notify','message':_0x3ffcae},client9002);return _0x3ffcae;})[_0xb447('0x16')](respondWithResult(_0x21931d,null))[_0xb447('0x47')](handleError(_0x21931d,null));};exports[_0xb447('0xc1')]=function(_0x59a6c4,_0x2fba42){var _0x50b6f6,_0x5af219,_0x37a30a;var _0xf7e448=[];var _0x1cc745={};var _0x463adf=_0x59a6c4[_0xb447('0xc2')]||[];var _0xd7ea25=[];var _0x3060cf;return db[_0xb447('0x84')][_0xb447('0x56')]()['then'](function(_0x58c7a5){if(!_0x58c7a5){throw new db[(_0xb447('0x85'))]['ValidationError'](_0xb447('0x87'));}_0xf7e448=_[_0xb447('0x88')](_[_0xb447('0x34')](_0x58c7a5),['createdAt','updatedAt',_0xb447('0x8b'),_0xb447('0x8c')]);if(_0x59a6c4['body']['id']){delete _0x59a6c4[_0xb447('0x4f')]['id'];}if(_['isNil'](_0x59a6c4[_0xb447('0x4f')][_0xb447('0x8d')])){throw _0x2fba42[_0xb447('0x1e')](0x1f4)[_0xb447('0x2c')](new db[(_0xb447('0x85'))][(_0xb447('0x86'))](_0xb447('0x8e')));}if(_[_0xb447('0x72')](_0x59a6c4['body'][_0xb447('0x4f')])||_0x59a6c4[_0xb447('0x4f')][_0xb447('0x4f')]===''){throw _0x2fba42['status'](0x1f4)[_0xb447('0x2c')](new db[(_0xb447('0x85'))][(_0xb447('0x86'))](_0xb447('0x8f')));}if(_['isNil'](_0x59a6c4[_0xb447('0x4f')][_0xb447('0xc3')])){throw _0x2fba42[_0xb447('0x1e')](0x1f4)['send'](new db[(_0xb447('0x85'))]['ValidationError'](_0xb447('0xc4')+_0xf7e448));}if(!_[_0xb447('0xc5')](_0xf7e448,_0x59a6c4[_0xb447('0x4f')]['mapKeyOffline'])){throw _0x2fba42[_0xb447('0x1e')](0x1f4)['send'](new db[(_0xb447('0x85'))][(_0xb447('0x86'))](_0xb447('0xc6')+_0xf7e448));}_0x1cc745[_0x59a6c4[_0xb447('0x4f')][_0xb447('0xc3')]]=_0x59a6c4[_0xb447('0x4f')][_0xb447('0x8d')];})[_0xb447('0x16')](function(){return db['ChatWebsite'][_0xb447('0x4d')]({'where':{'id':_0x59a6c4[_0xb447('0x49')]['id']},'include':[{'model':db[_0xb447('0x92')],'as':'List'},{'model':db[_0xb447('0xc7')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x2fba42,null))[_0xb447('0x16')](function(_0x1a340e){if(_0x1a340e&&_0x1a340e['List']){_0x5af219=_0x1a340e;var _0x260665=_[_0xb447('0xc')](_0x59a6c4['body'],{'firstName':_0x59a6c4[_0xb447('0x4f')]['from'],'phone':_0x59a6c4['body'][_0xb447('0x8d')],'ListId':_0x1a340e[_0xb447('0x8c')]});_0x260665[_0x59a6c4['body'][_0xb447('0xc3')]]=_0x59a6c4[_0xb447('0x4f')][_0xb447('0x8d')];return db[_0xb447('0x84')][_0xb447('0xc8')]({'where':_0x1cc745,'defaults':_0x260665});}})['spread'](function(_0x3193f8){if(_0x3193f8){_0x37a30a=_0x3193f8;var _0x4414fd=fs[_0xb447('0xc9')](path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0xca')),'utf8');var _0x54741e=ejs['render'](_0x4414fd,{'body':_[_0xb447('0xcb')](_0x59a6c4[_0xb447('0x4f')][_0xb447('0x4f')]),'bodyTitle':_0x5af219[_0xb447('0xcc')]});return db[_0xb447('0xcd')][_0xb447('0x4e')]({'body':_0x54741e,'plainBody':htmlToText['fromString'](_0x54741e),'ContactId':_0x3193f8['id'],'ChatWebsiteId':_0x5af219['id']});}})[_0xb447('0x16')](function(_0x30703b){_0x3060cf=_0x30703b;if(_0x463adf[_0xb447('0x39')]){var _0x5200a4=_0x463adf[_0xb447('0x2f')](function(_0x352d1d){return{'name':_0x352d1d['originalname'],'basename':_0x352d1d['filename'],'type':_0x352d1d[_0xb447('0xce')],'ChatOfflineMessageId':_0x30703b['id']};});_0xd7ea25=_0x5200a4[_0xb447('0x2f')](_0x25788b=>{var _0x4bdc5b={'filename':_0x25788b['name'],'path':path[_0xb447('0x6f')](config['root'],_0xb447('0xcf'),_0xb447('0xc2'),_0xb447('0xd0'),_0xb447('0xd1'),_0x25788b[_0xb447('0xd2')])};return _0x4bdc5b;});if(!_0x5af219[_0xb447('0xd3')]){return db[_0xb447('0xd4')][_0xb447('0xd5')](function(_0x27c12d){return db[_0xb447('0xd6')]['bulkCreate'](_0x5200a4,{'transaction':_0x27c12d});});}}})['then'](function(){if(_0x3060cf){_0x50b6f6=_0x3060cf;return db['MailAccount'][_0xb447('0x60')]({'where':{'service':!![]},'include':[{'model':db[_0xb447('0xd7')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xb447('0xd8')],'as':_0xb447('0xd8'),'raw':!![]}]}]});}})[_0xb447('0x16')](function(_0x5a03e2){if(_0x5a03e2&&_0x5a03e2[_0xb447('0xd9')]&&_0x5af219['forwardOffline']&&_0x5af219['forwardOfflineAddress']){var _0x28d687=_0x5a03e2[_0xb447('0xda')]();return respondWithRpcPromise(_0xb447('0xdb'),_0xb447('0xdc'),{'account':_0x28d687,'message':{'from':util[_0xb447('0xac')](_0xb447('0xdd'),_0x5a03e2[_0xb447('0x2b')],_0x5a03e2[_0xb447('0xde')]||_0x5a03e2[_0xb447('0xd9')][_0xb447('0xdf')]),'to':_0x5af219[_0xb447('0xe0')],'subject':_0x5af219[_0xb447('0xe1')],'html':_0x50b6f6[_0xb447('0x4f')],'attachments':_0xd7ea25}},client9003)[_0xb447('0x16')](function(){return _0x50b6f6;})[_0xb447('0x47')](function(_0x49c5f7){logger[_0xb447('0x1a')](_0x49c5f7);});}})[_0xb447('0x16')](function(){if(_0x5af219&&_0x5af219[_0xb447('0xd3')]&&_0x5af219[_0xb447('0xe2')]){var _0x57729e=[];if(_0x463adf[_0xb447('0x39')]){_0x57729e=_0x463adf[_0xb447('0x2f')](function(_0x557271){return{'name':_0x557271[_0xb447('0xe3')],'basename':_0x557271[_0xb447('0x67')],'type':_0x557271[_0xb447('0xce')],'ChatOfflineMessageId':_0x3060cf['id']};});}var _0x485861;if(!_[_0xb447('0x72')](_0x5af219[_0xb447('0xe4')])){var _0x181d60=_[_0xb447('0x2f')](_0x59a6c4['body'],function(_0x3f5b8c){return _0x3f5b8c;});var _0x29a98e=_[_0xb447('0xe5')](_0x181d60)[0x0];var _0x308a00=_['mapValues'](_0x29a98e,function(_0x43b2a3){return _0x43b2a3;});_0x485861=_0x308a00[0x1][_0x5af219[_0xb447('0xe4')]];}var _0x7ebde0={'from':_0x37a30a[_0xb447('0xde')],'firstName':_0x37a30a[_0xb447('0xa2')],'lastName':_0x37a30a[_0xb447('0xa3')],'mapKey':_0xb447('0xde'),'message':{'from':_0x37a30a[_0xb447('0xde')],'to':_0x5af219[_0xb447('0xc7')][_0xb447('0xde')],'cc':'','subject':_[_0xb447('0x72')](_0x485861)?_0x5af219[_0xb447('0xe1')]:_0x485861,'messageId':'','sentAt':new Date(),'attach':_0x57729e[_0xb447('0x39')],'attachments':_0x57729e,'originChannel':'Chat','ChatWebsiteId':_0x5af219['id'],'ChatOfflineMessageId':_0x50b6f6['id'],'originTo':_0x5af219[_0xb447('0xc7')][_0xb447('0xde')]},'body':_0x50b6f6[_0xb447('0x4f')]};var _0x1df2bb={'account':{'id':_0x5af219[_0xb447('0xe2')]},'body':_0x7ebde0,'log':_0xb447('0xe6')};return respondWithRpcPromise(_0xb447('0xe6'),'notifyMail',_0x1df2bb,client9001)[_0xb447('0x16')](function(){return _0x50b6f6;})[_0xb447('0x47')](function(_0x1dcff8){logger[_0xb447('0x1a')](_0x1dcff8);});}return;})[_0xb447('0x16')](function(){if(_0x50b6f6){return _0x50b6f6;}})[_0xb447('0x16')](respondWithResult(_0x2fba42,null))[_0xb447('0x47')](function(_0xf5390e){logger[_0xb447('0x1a')](_0xb447('0x47'),_0xf5390e);for(var _0x11a66f of _0x463adf){var _0x2dd530=path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0xcf'),_0xb447('0xc2'),_0xb447('0xd0'),_0xb447('0xd1'),_0x11a66f[_0xb447('0x67')]);fs_extra[_0xb447('0xe7')](_0x2dd530)[_0xb447('0x47')](function(_0x4c3828){logger[_0xb447('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x2dd530,_0x4c3828);});}});};exports[_0xb447('0xe8')]=function(_0x1a761a,_0x184333){return db['ChatInteraction']['find']({'where':{'id':_0x1a761a[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x184333,null))['then'](function(_0x1ad1ef){if(_0x1ad1ef){return _0x1ad1ef[_0xb447('0xe8')](_0x1a761a[_0xb447('0x4f')][_0xb447('0x63')],_['omit'](_0x1a761a[_0xb447('0x4f')],[_0xb447('0x63'),'id'])||{});}})['then'](respondWithResult(_0x184333,null))[_0xb447('0x47')](handleError(_0x184333,null));};exports[_0xb447('0xe9')]=function(_0x23529c,_0x5ee851){var _0x8708c6={'raw':![],'where':{}};var _0x393bf9={};var _0x37182b={'count':0x0,'rows':[]};return db[_0xb447('0x46')]['findOne']({'where':{'id':_0x23529c['params']['id']}})['then'](handleEntityNotFound(_0x5ee851,null))[_0xb447('0x16')](function(_0x2194e5){if(_0x2194e5){_0x393bf9['model']=_['keys'](db[_0xb447('0xb0')][_0xb447('0x4b')]);_0x393bf9['query']=_[_0xb447('0x34')](_0x23529c['query']);_0x393bf9[_0xb447('0x35')]=_[_0xb447('0x36')](_0x393bf9[_0xb447('0x32')],_0x393bf9[_0xb447('0x33')]);_0x8708c6['attributes']=_[_0xb447('0x36')](_0x393bf9['model'],qs[_0xb447('0x37')](_0x23529c[_0xb447('0x33')][_0xb447('0x37')]));_0x8708c6[_0xb447('0x38')]=_0x8708c6[_0xb447('0x38')][_0xb447('0x39')]?_0x8708c6[_0xb447('0x38')]:_0x393bf9['model'];if(!_0x23529c[_0xb447('0x33')][_0xb447('0x3a')](_0xb447('0x3b'))){_0x8708c6[_0xb447('0x23')]=qs['limit'](_0x23529c[_0xb447('0x33')][_0xb447('0x23')]);_0x8708c6[_0xb447('0x21')]=qs['offset'](_0x23529c[_0xb447('0x33')]['offset']);}_0x8708c6[_0xb447('0x3c')]=qs[_0xb447('0x3d')](_0x23529c[_0xb447('0x33')][_0xb447('0x3d')]);_0x8708c6[_0xb447('0x3e')]=qs[_0xb447('0x35')](_[_0xb447('0x3f')](_0x23529c[_0xb447('0x33')],_0x393bf9[_0xb447('0x35')]));_0x8708c6[_0xb447('0x3e')][_0xb447('0x58')]=_0x2194e5['id'];if(_0x23529c['query'][_0xb447('0x43')]){_0x8708c6[_0xb447('0x3e')]=_[_0xb447('0x40')](_0x8708c6['where'],{'$or':_['map'](_0x8708c6['attributes'],function(_0x25142b){var _0x21f8dc={};_0x21f8dc[_0x25142b]={'$like':'%'+_0x23529c[_0xb447('0x33')][_0xb447('0x43')]+'%'};return _0x21f8dc;})});}_0x8708c6=_[_0xb447('0x40')]({},_0x8708c6,_0x23529c[_0xb447('0x4c')]);return db[_0xb447('0xb0')]['count']({'where':_0x8708c6[_0xb447('0x3e')]})['then'](function(_0x77c389){_0x37182b[_0xb447('0x24')]=_0x77c389;if(_0x23529c[_0xb447('0x33')]['includeAll']){_0x8708c6[_0xb447('0x45')]=[{'model':db[_0xb447('0x84')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0xb447('0xea'),_0xb447('0xeb')],'required':![]},{'model':db[_0xb447('0xec')],'as':_0xb447('0xed'),'attributes':['id',_0xb447('0x2b'),_0xb447('0xee')],'where':_0x23529c[_0xb447('0x33')][_0xb447('0xef')]?{'id':_0x23529c[_0xb447('0x33')][_0xb447('0xef')]}:undefined,'required':_0x23529c['query'][_0xb447('0xef')]?!![]:![]}];}return db[_0xb447('0xb0')]['findAll'](_0x8708c6);})[_0xb447('0x16')](function(_0x34a51c){_0x37182b[_0xb447('0x61')]=_0x34a51c;return _0x37182b;});}})[_0xb447('0x16')](respondWithFilteredResult(_0x5ee851,_0x8708c6))[_0xb447('0x47')](handleError(_0x5ee851,null));};function iftimePromise(_0x36eca8,_0x351b3b){return respondWithRpcPromise(_0xb447('0xf0'),_0xb447('0xf1'),{'command':_0x351b3b['timezone']?util[_0xb447('0xac')](_0xb447('0xf2'),_0x36eca8[_0xb447('0xf3')],_0x351b3b[_0xb447('0xf4')]):util['format'](_0xb447('0xf5'),_0x36eca8[_0xb447('0xf3')])},client9002)[_0xb447('0x16')](function(_0x1673a0){var _0x1d3277=_0x1673a0&&_0x1673a0[_0xb447('0xf6')](_0xb447('0xf7'))>=0x0?!![]:![];logger[_0xb447('0x17')](_0xb447('0xf8'),_0x351b3b['id'],_0x36eca8['id'],_0x36eca8[_0xb447('0xf3')],_0x1d3277?_0xb447('0xf9'):'OFFLINE',_0x351b3b['timezone']?_0x351b3b[_0xb447('0xf4')]:_0xb447('0xfa'));return _0x1d3277;})[_0xb447('0x47')](function(_0x2a3944){logger[_0xb447('0x1a')](_0xb447('0xf8'),_0x351b3b['id'],_0x36eca8['id'],_0x36eca8['interval'],util['inspect'](_0x2a3944,{'showHidden':![],'depth':null}),_0x351b3b[_0xb447('0xf4')]?_0x351b3b['timezone']:_0xb447('0xfa'));return![];});}exports[_0xb447('0xf1')]=function(_0x42fc60,_0x312bdf){var _0x5373ff=0x0;var _0x9f9581=0x0;var _0x2d02d7=![];var _0x3a8bd5;var _0x2dbab2;return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x42fc60[_0xb447('0x49')]['id']},'include':[{'model':db[_0xb447('0xfb')],'as':_0xb447('0xfb'),'include':[{'model':db[_0xb447('0xfb')],'as':_0xb447('0xfc'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xb447('0x16')](handleEntityNotFound(_0x312bdf,null))[_0xb447('0x16')](function(_0x2fae86){if(_0x2fae86){_0x3a8bd5=_0x2fae86;return _0x2fae86[_0xb447('0xfd')]({'raw':!![]});}})['then'](function(_0x24f419){if(_0x3a8bd5){if(_0x24f419){_0x2dbab2=_0x24f419;}}return require(_0xb447('0xfe'))[_0xb447('0xff')]();})[_0xb447('0x16')](function(_0x5f2d2d){if(_0x5f2d2d){_0x9f9581=_0x5f2d2d[_0xb447('0x100')];_0x2d02d7=_0x5f2d2d[_0xb447('0x71')];}})[_0xb447('0x16')](function(){return db[_0xb447('0xb0')][_0xb447('0x24')]({'where':{'closed':![]}});})[_0xb447('0x16')](function(_0xdb68da){_0x5373ff=_0xdb68da;if(_0x9f9581&&_0xdb68da>_0x9f9581){return db[_0xb447('0x101')][_0xb447('0x60')]({'where':{'id':0x1}})['then'](function(_0x52f664){if(_0x52f664){_0x52f664[_0xb447('0x102')](_0xb447('0x103'));}});}})[_0xb447('0x16')](function(){if(_0x3a8bd5['Interval']&&_0x3a8bd5[_0xb447('0xfb')][_0xb447('0xfc')]){var _0x274a50=[];for(var _0x61eecd=0x0;_0x61eecd<_0x3a8bd5[_0xb447('0xfb')][_0xb447('0xfc')][_0xb447('0x39')];_0x61eecd++){var _0xcbc4e2=_0x3a8bd5[_0xb447('0xfb')][_0xb447('0xfc')][_0x61eecd]['get']({'plain':!![]});_0x274a50['push'](iftimePromise(_0xcbc4e2,_0x3a8bd5));}return BPromise['all'](_0x274a50)['then'](function(_0x48f00a){return _['some'](_0x48f00a);});}else{return!![];}})[_0xb447('0x16')](function(_0xd99573){var _0x48bbd3=fs['readFileSync'](path[_0xb447('0x6f')](config[_0xb447('0x74')],_0xb447('0x104')),'utf8');var _0x36dd48={'remote':_0x3a8bd5[_0xb447('0x105')],'query':querystring['stringify'](_[_0xb447('0x40')](_0x3a8bd5[_0xb447('0x25')]({'plain':!![]}),{'customerIp':_0x42fc60[_0xb447('0x80')][_0xb447('0xa0')]||_0x42fc60[_0xb447('0x80')][_0xb447('0x106')]||_0x42fc60[_0xb447('0x107')][_0xb447('0x108')]||_0x42fc60['ip'],'referer':_0x42fc60[_0xb447('0x80')][_0xb447('0xa5')],'openedInteractions':_0x5373ff,'maxInteractions':_0x9f9581,'virtual':_0x2d02d7[_0xb447('0x100')],'online':_0xd99573,'custom':_0x2d02d7}))[_0xb447('0x109')](/'/g,'\x5c\x27')};_0x312bdf[_0xb447('0x2c')](ejs[_0xb447('0x10a')](Mustache[_0xb447('0x10a')](_0x48bbd3,_0x36dd48),{'proactiveActions':_0x2dbab2,'alignment':_0x3a8bd5[_0xb447('0x10b')],'verticalAlignment':_0x3a8bd5[_0xb447('0x10c')],'div_color':_0x3a8bd5[_0xb447('0xee')],'labelText':_0x3a8bd5[_0xb447('0x10d')],'text_color':_0x3a8bd5['textColor'],'button_color':_0x3a8bd5['color_button'],'background_color':_0x3a8bd5[_0xb447('0x10e')],'hideWhenOffline':_0x3a8bd5[_0xb447('0x10f')],'interval':_0x3a8bd5['IntervalId']}));})[_0xb447('0x47')](handleError(_0x312bdf,null));};exports['addApplications']=function(_0x4d268c,_0x19c96d){var _0xa41d64=_0x4d268c[_0xb447('0x49')]['id'];var _0x426e9b=_0x4d268c[_0xb447('0x4f')];var _0x4414b6=0xc8;var _0x56915d=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xb447('0xd4')]['Transaction'][_0xb447('0x110')][_0xb447('0x111')]},function(_0x4fcc02){return db[_0xb447('0x46')]['findOne']({'where':{'id':_0xa41d64},'transaction':_0x4fcc02})[_0xb447('0x16')](function(_0xa19577){if(_0xa19577){return db[_0xb447('0x95')]['destroy']({'where':{'ChatWebsiteId':_0xa41d64},'transaction':_0x4fcc02})['then'](function(){var _0x3eafd0=_[_0xb447('0x2f')](_0x426e9b,function(_0x320cba){_0x320cba[_0xb447('0x58')]=_0xa41d64;return _0x320cba;});return db[_0xb447('0x95')]['bulkCreate'](_0x3eafd0,{'transaction':_0x4fcc02});});}else{_0x4414b6=0x194;_0x56915d=[];}});})[_0xb447('0x16')](function(){if(_0x4414b6!==0x194){return db[_0xb447('0x95')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xa41d64},'order':'priority'})[_0xb447('0x16')](function(_0x361b24){_0x56915d=_0x361b24;});}})['catch'](function(_0x525a38){_0x4414b6=0x1f4;logger[_0xb447('0x1a')](_0x525a38[_0xb447('0x2a')]);if(_0x525a38[_0xb447('0x2b')]){delete _0x525a38['name'];}_0x56915d=_0x525a38;})[_0xb447('0x112')](function(){if(_0x56915d===null){_0x19c96d[_0xb447('0x29')](_0x4414b6);}else{if(_0x4414b6===0x1f4){_0x19c96d[_0xb447('0x1e')](_0x4414b6)[_0xb447('0x2c')](_0x56915d);}else{_0x19c96d[_0xb447('0x1e')](_0x4414b6)['json'](_0x56915d);}}});};exports[_0xb447('0x113')]=function(_0x4eaeac,_0x8abd9){var _0x53f2bf={};var _0x2b4df2={};var _0x2816f9;var _0x26561f;return db[_0xb447('0x46')]['findOne']({'where':{'id':_0x4eaeac[_0xb447('0x49')]['id']}})['then'](handleEntityNotFound(_0x8abd9,null))[_0xb447('0x16')](function(_0x2da311){if(_0x2da311){_0x2816f9=_0x2da311;_0x2b4df2[_0xb447('0x32')]=_[_0xb447('0x34')](db[_0xb447('0x95')][_0xb447('0x4b')]);_0x2b4df2[_0xb447('0x33')]=_[_0xb447('0x34')](_0x4eaeac[_0xb447('0x33')]);_0x2b4df2[_0xb447('0x35')]=_[_0xb447('0x36')](_0x2b4df2[_0xb447('0x32')],_0x2b4df2[_0xb447('0x33')]);_0x53f2bf['attributes']=_[_0xb447('0x36')](_0x2b4df2[_0xb447('0x32')],qs['fields'](_0x4eaeac['query'][_0xb447('0x37')]));_0x53f2bf[_0xb447('0x38')]=_0x53f2bf['attributes'][_0xb447('0x39')]?_0x53f2bf[_0xb447('0x38')]:_0x2b4df2[_0xb447('0x32')];_0x53f2bf[_0xb447('0x3c')]=qs[_0xb447('0x3d')](_0x4eaeac[_0xb447('0x33')][_0xb447('0x3d')]);_0x53f2bf[_0xb447('0x3e')]=qs[_0xb447('0x35')](_[_0xb447('0x3f')](_0x4eaeac[_0xb447('0x33')],_0x2b4df2['filters']));if(_0x4eaeac[_0xb447('0x33')][_0xb447('0x43')]){_0x53f2bf[_0xb447('0x3e')]=_[_0xb447('0x40')](_0x53f2bf[_0xb447('0x3e')],{'$or':_['map'](_0x53f2bf[_0xb447('0x38')],function(_0x168a21){var _0x354015={};_0x354015[_0x168a21]={'$like':'%'+_0x4eaeac[_0xb447('0x33')][_0xb447('0x43')]+'%'};return _0x354015;})});}_0x53f2bf=_[_0xb447('0x40')]({},_0x53f2bf,_0x4eaeac['options']);return _0x2816f9['getApplications'](_0x53f2bf);}})[_0xb447('0x16')](function(_0x5ba689){if(_0x5ba689){_0x26561f=_0x5ba689[_0xb447('0x39')];if(!_0x4eaeac[_0xb447('0x33')][_0xb447('0x3a')](_0xb447('0x3b'))){_0x53f2bf[_0xb447('0x23')]=qs[_0xb447('0x23')](_0x4eaeac[_0xb447('0x33')][_0xb447('0x23')]);_0x53f2bf['offset']=qs[_0xb447('0x21')](_0x4eaeac[_0xb447('0x33')][_0xb447('0x21')]);}return _0x2816f9[_0xb447('0x113')](_0x53f2bf);}})[_0xb447('0x16')](function(_0x18698d){if(_0x18698d){return _0x18698d?{'count':_0x26561f,'rows':_0x18698d}:null;}})[_0xb447('0x16')](respondWithResult(_0x8abd9,null))[_0xb447('0x47')](handleError(_0x8abd9,null));};exports[_0xb447('0x114')]=function(_0x144f01,_0x213236){return db[_0xb447('0x115')]['find']({'where':{'id':_0x144f01[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x213236,null))[_0xb447('0x16')](function(_0x46db06){if(_0x46db06){return _0x46db06[_0xb447('0x114')](_0x144f01['body']['ids'],_[_0xb447('0x116')](_0x144f01[_0xb447('0x4f')],['ids','id'])||{});}})[_0xb447('0x16')](respondWithResult(_0x213236,null))[_0xb447('0x47')](handleError(_0x213236,null));};exports[_0xb447('0xfd')]=function(_0x5826fc,_0x369469){var _0x185d10={};var _0x96eaf3={};var _0x246ac6;var _0x2149da;return db[_0xb447('0x46')][_0xb447('0x60')]({'where':{'id':_0x5826fc['params']['id']}})['then'](handleEntityNotFound(_0x369469,null))[_0xb447('0x16')](function(_0x37af3e){if(_0x37af3e){_0x246ac6=_0x37af3e;_0x96eaf3['model']=_['keys'](db[_0xb447('0x117')][_0xb447('0x4b')]);_0x96eaf3['query']=_[_0xb447('0x34')](_0x5826fc[_0xb447('0x33')]);_0x96eaf3[_0xb447('0x35')]=_[_0xb447('0x36')](_0x96eaf3['model'],_0x96eaf3[_0xb447('0x33')]);_0x185d10[_0xb447('0x38')]=_[_0xb447('0x36')](_0x96eaf3['model'],qs[_0xb447('0x37')](_0x5826fc['query'][_0xb447('0x37')]));_0x185d10[_0xb447('0x38')]=_0x185d10[_0xb447('0x38')][_0xb447('0x39')]?_0x185d10[_0xb447('0x38')]:_0x96eaf3[_0xb447('0x32')];_0x185d10[_0xb447('0x3c')]=qs['sort'](_0x5826fc['query'][_0xb447('0x3d')]);_0x185d10[_0xb447('0x3e')]=qs[_0xb447('0x35')](_[_0xb447('0x3f')](_0x5826fc[_0xb447('0x33')],_0x96eaf3[_0xb447('0x35')]));if(_0x5826fc[_0xb447('0x33')][_0xb447('0x43')]){_0x185d10['where']=_[_0xb447('0x40')](_0x185d10[_0xb447('0x3e')],{'$or':_[_0xb447('0x2f')](_0x185d10[_0xb447('0x38')],function(_0xcd8367){var _0x58f989={};_0x58f989[_0xcd8367]={'$like':'%'+_0x5826fc['query'][_0xb447('0x43')]+'%'};return _0x58f989;})});}_0x185d10=_[_0xb447('0x40')]({},_0x185d10,_0x5826fc['options']);return _0x246ac6[_0xb447('0xfd')](_0x185d10);}})[_0xb447('0x16')](function(_0x1bb486){if(_0x1bb486){_0x2149da=_0x1bb486[_0xb447('0x39')];if(!_0x5826fc[_0xb447('0x33')][_0xb447('0x3a')](_0xb447('0x3b'))){_0x185d10[_0xb447('0x23')]=qs['limit'](_0x5826fc[_0xb447('0x33')][_0xb447('0x23')]);_0x185d10[_0xb447('0x21')]=qs[_0xb447('0x21')](_0x5826fc[_0xb447('0x33')]['offset']);}return _0x246ac6['getProactiveActions'](_0x185d10);}})[_0xb447('0x16')](function(_0x1e8f7a){if(_0x1e8f7a){return _0x1e8f7a?{'count':_0x2149da,'rows':_0x1e8f7a}:null;}})['then'](respondWithResult(_0x369469,null))[_0xb447('0x47')](handleError(_0x369469,null));};exports['getFields']=function(_0x5bfaa9,_0x54d250){var _0xe0f549=_0x5bfaa9[_0xb447('0x33')][_0xb447('0x118')]==='false'?_0xb447('0x119'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0xe0f549],'where':{'id':_0x5bfaa9[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x54d250,null))[_0xb447('0x16')](function(_0x55efda){if(_0x55efda){var _0x10dd01=_0x55efda[_0xe0f549];var _0x41dc0c=_0x10dd01&&_0x10dd01['items']?_0x10dd01[_0xb447('0x11a')]:[];_0x54d250[_0xb447('0x2c')]({'fromKey':_[_0xb447('0x72')](_0x10dd01[_0xb447('0x11b')])?undefined:_0x10dd01[_0xb447('0x11b')],'count':_0x41dc0c[_0xb447('0x39')],'rows':_0x41dc0c});}})[_0xb447('0x47')](handleError(_0x54d250,null));};exports[_0xb447('0x11c')]=function(_0x568766,_0x351021){var _0x39fa76={'raw':![],'where':{}};var _0x2a7535={};var _0xc3a57f={'count':0x0,'rows':[]};return db[_0xb447('0x46')]['findOne']({'where':{'id':_0x568766[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x351021,null))[_0xb447('0x16')](function(_0x5867cb){if(_0x5867cb){_0x2a7535[_0xb447('0x32')]=_['keys'](db[_0xb447('0xcd')][_0xb447('0x4b')]);_0x2a7535[_0xb447('0x33')]=_[_0xb447('0x34')](_0x568766['query']);_0x2a7535['filters']=_['intersection'](_0x2a7535['model'],_0x2a7535[_0xb447('0x33')]);_0x39fa76[_0xb447('0x38')]=_[_0xb447('0x36')](_0x2a7535[_0xb447('0x32')],qs['fields'](_0x568766[_0xb447('0x33')][_0xb447('0x37')]));_0x39fa76['attributes']=_0x39fa76['attributes'][_0xb447('0x39')]?_0x39fa76[_0xb447('0x38')]:_0x2a7535[_0xb447('0x32')];if(!_0x568766[_0xb447('0x33')][_0xb447('0x3a')](_0xb447('0x3b'))){_0x39fa76[_0xb447('0x23')]=qs[_0xb447('0x23')](_0x568766[_0xb447('0x33')][_0xb447('0x23')]);_0x39fa76[_0xb447('0x21')]=qs[_0xb447('0x21')](_0x568766[_0xb447('0x33')][_0xb447('0x21')]);}_0x39fa76[_0xb447('0x3c')]=qs['sort'](_0x568766[_0xb447('0x33')]['sort']);_0x39fa76[_0xb447('0x3e')]=qs[_0xb447('0x35')](_['pick'](_0x568766[_0xb447('0x33')],_0x2a7535[_0xb447('0x35')]));_0x39fa76[_0xb447('0x3e')][_0xb447('0x58')]=_0x5867cb['id'];if(_0x568766[_0xb447('0x33')]['filter']){_0x39fa76[_0xb447('0x3e')]=_[_0xb447('0x40')](_0x39fa76[_0xb447('0x3e')],{'$or':_[_0xb447('0x2f')](_0x39fa76[_0xb447('0x38')],function(_0xd30d01){var _0x3e774e={};_0x3e774e[_0xd30d01]={'$like':'%'+_0x568766['query'][_0xb447('0x43')]+'%'};return _0x3e774e;})});}_0x39fa76=_[_0xb447('0x40')]({},_0x39fa76,_0x568766[_0xb447('0x4c')]);return db[_0xb447('0xcd')][_0xb447('0x24')]({'where':_0x39fa76['where']})[_0xb447('0x16')](function(_0x30967c){_0xc3a57f[_0xb447('0x24')]=_0x30967c;if(_0x568766['query'][_0xb447('0x44')]){_0x39fa76[_0xb447('0x45')]=[{'all':!![]}];}else{_0x39fa76['include']=[{'model':db[_0xb447('0x84')],'as':_0xb447('0x11d'),'required':![]},{'model':db[_0xb447('0xd6')],'as':_0xb447('0x11e'),'required':![]}];}return db[_0xb447('0xcd')][_0xb447('0x5b')](_0x39fa76);})[_0xb447('0x16')](function(_0x41cbde){_0xc3a57f[_0xb447('0x61')]=_0x41cbde;return _0xc3a57f;});}})[_0xb447('0x16')](respondWithFilteredResult(_0x351021,_0x39fa76))[_0xb447('0x47')](handleError(_0x351021,null));};exports[_0xb447('0x11f')]=function(_0x5bfce3,_0x4288bc){return db[_0xb447('0x46')][_0xb447('0x4d')]({'where':{'id':_0x5bfce3[_0xb447('0x49')]['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x4288bc,null))['then'](function(_0x1bd70f){if(_0x1bd70f){return _0x1bd70f['addAgents'](_0x5bfce3[_0xb447('0x4f')][_0xb447('0x63')],_[_0xb447('0x116')](_0x5bfce3['body'],[_0xb447('0x63'),'id'])||{})[_0xb447('0x120')](function(_0x3550e0){for(var _0x5f5b37=0x0;_0x5f5b37<_0x5bfce3[_0xb447('0x4f')][_0xb447('0x63')][_0xb447('0x39')];_0x5f5b37+=0x1){socket[_0xb447('0x121')](_0xb447('0x122'),{'UserId':Number(_0x5bfce3[_0xb447('0x4f')][_0xb447('0x63')][_0x5f5b37]),'ChatWebsiteId':Number(_0x5bfce3[_0xb447('0x49')]['id'])});}return _0x3550e0;});}})[_0xb447('0x16')](respondWithResult(_0x4288bc,null))[_0xb447('0x47')](handleError(_0x4288bc,null));};exports[_0xb447('0x123')]=function(_0x4ce56a,_0x3d636d){return db[_0xb447('0x46')]['find']({'where':{'id':_0x4ce56a['params']['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x3d636d,null))[_0xb447('0x16')](function(_0x27e38d){if(_0x27e38d){return _0x27e38d[_0xb447('0x123')](_0x4ce56a[_0xb447('0x33')][_0xb447('0x63')])[_0xb447('0x16')](function(){if(_[_0xb447('0x124')](_0x4ce56a[_0xb447('0x33')]['ids'])){for(var _0x47e8ce=0x0;_0x47e8ce<_0x4ce56a[_0xb447('0x33')]['ids']['length'];_0x47e8ce+=0x1){socket[_0xb447('0x121')](_0xb447('0x125'),{'UserId':Number(_0x4ce56a['query'][_0xb447('0x63')][_0x47e8ce]),'ChatWebsiteId':Number(_0x4ce56a[_0xb447('0x49')]['id'])});}}else{socket[_0xb447('0x121')](_0xb447('0x125'),{'UserId':Number(_0x4ce56a[_0xb447('0x33')][_0xb447('0x63')]),'ChatWebsiteId':Number(_0x4ce56a[_0xb447('0x49')]['id'])});}});}})[_0xb447('0x16')](respondWithStatusCode(_0x3d636d,null))[_0xb447('0x47')](handleError(_0x3d636d,null));};exports[_0xb447('0x126')]=function(_0xc0d68c,_0x197fdf){var _0x270ddd={};var _0x39dd67={};var _0x4039cb;var _0x3b5428;return db[_0xb447('0x46')][_0xb447('0x60')]({'where':{'id':_0xc0d68c['params']['id']}})[_0xb447('0x16')](handleEntityNotFound(_0x197fdf,null))[_0xb447('0x16')](function(_0x4809cd){if(_0x4809cd){_0x4039cb=_0x4809cd;_0x39dd67[_0xb447('0x32')]=_[_0xb447('0x34')](db[_0xb447('0x127')][_0xb447('0x4b')]);_0x39dd67['query']=_[_0xb447('0x34')](_0xc0d68c[_0xb447('0x33')]);_0x39dd67[_0xb447('0x35')]=_[_0xb447('0x36')](_0x39dd67['model'],_0x39dd67[_0xb447('0x33')]);_0x270ddd[_0xb447('0x38')]=_[_0xb447('0x36')](_0x39dd67[_0xb447('0x32')],qs[_0xb447('0x37')](_0xc0d68c['query']['fields']));_0x270ddd['attributes']=_0x270ddd[_0xb447('0x38')]['length']?_0x270ddd[_0xb447('0x38')]:_0x39dd67[_0xb447('0x32')];_0x270ddd[_0xb447('0x3c')]=qs[_0xb447('0x3d')](_0xc0d68c[_0xb447('0x33')][_0xb447('0x3d')]);_0x270ddd[_0xb447('0x3e')]=qs['filters'](_['pick'](_0xc0d68c[_0xb447('0x33')],_0x39dd67[_0xb447('0x35')]));if(_0xc0d68c['query'][_0xb447('0x43')]){_0x270ddd[_0xb447('0x3e')]=_['merge'](_0x270ddd[_0xb447('0x3e')],{'$or':_[_0xb447('0x2f')](_0x270ddd['attributes'],function(_0x38650a){var _0x50c9c3={};_0x50c9c3[_0x38650a]={'$like':'%'+_0xc0d68c[_0xb447('0x33')][_0xb447('0x43')]+'%'};return _0x50c9c3;})});}_0x270ddd=_[_0xb447('0x40')]({},_0x270ddd,_0xc0d68c['options']);return _0x4039cb[_0xb447('0x126')](_0x270ddd);}})['then'](function(_0xc30e4d){if(_0xc30e4d){_0x3b5428=_0xc30e4d[_0xb447('0x39')];if(!_0xc0d68c[_0xb447('0x33')]['hasOwnProperty']('nolimit')){_0x270ddd[_0xb447('0x23')]=qs[_0xb447('0x23')](_0xc0d68c['query']['limit']);_0x270ddd[_0xb447('0x21')]=qs['offset'](_0xc0d68c[_0xb447('0x33')][_0xb447('0x21')]);}return _0x4039cb['getAgents'](_0x270ddd);}})['then'](function(_0x1ca03b){if(_0x1ca03b){return _0x1ca03b?{'count':_0x3b5428,'rows':_0x1ca03b}:null;}})[_0xb447('0x16')](respondWithResult(_0x197fdf,null))['catch'](handleError(_0x197fdf,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index f1eac9d..36a3a59 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 _0x448b=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x1b1fa0,_0x4bf8b3){var _0x4a1556=function(_0x478f2a){while(--_0x478f2a){_0x1b1fa0['push'](_0x1b1fa0['shift']());}};_0x4a1556(++_0x4bf8b3);}(_0x448b,0x125));var _0xb448=function(_0x39f84e,_0x48261d){_0x39f84e=_0x39f84e-0x0;var _0x28b7d8=_0x448b[_0x39f84e];return _0x28b7d8;};'use strict';var EventEmitter=require(_0xb448('0x0'));var ChatWebsite=require(_0xb448('0x1'))['db'][_0xb448('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb448('0x3')](0x0);var events={'afterCreate':_0xb448('0x4'),'afterUpdate':_0xb448('0x5'),'afterDestroy':'remove'};function emitEvent(_0x189ccb){return function(_0x32bcae,_0x172a89,_0x220082){ChatWebsiteEvents[_0xb448('0x6')](_0x189ccb+':'+_0x32bcae['id'],_0x32bcae);ChatWebsiteEvents[_0xb448('0x6')](_0x189ccb,_0x32bcae);_0x220082(null);};}for(var e in events){if(events[_0xb448('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xb448('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xdbf7=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x48b6f4,_0x4a328a){var _0x31f74e=function(_0x57024a){while(--_0x57024a){_0x48b6f4['push'](_0x48b6f4['shift']());}};_0x31f74e(++_0x4a328a);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x4986a9,_0x311d65){_0x4986a9=_0x4986a9-0x0;var _0x2d31fe=_0xdbf7[_0x4986a9];return _0x2d31fe;};'use strict';var EventEmitter=require(_0x7dbf('0x0'));var ChatWebsite=require(_0x7dbf('0x1'))['db'][_0x7dbf('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7dbf('0x3')](0x0);var events={'afterCreate':_0x7dbf('0x4'),'afterUpdate':_0x7dbf('0x5'),'afterDestroy':_0x7dbf('0x6')};function emitEvent(_0x7b931c){return function(_0x4e243e,_0x11294f,_0x5cdcfc){ChatWebsiteEvents['emit'](_0x7b931c+':'+_0x4e243e['id'],_0x4e243e);ChatWebsiteEvents[_0x7dbf('0x7')](_0x7b931c,_0x4e243e);_0x5cdcfc(null);};}for(var e in events){if(events[_0x7dbf('0x8')](e)){var event=events[e];ChatWebsite[_0x7dbf('0x9')](e,emitEvent(event));}}module[_0x7dbf('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 8664a51..ac96ace 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 _0x4870=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4870,0xdc));var _0x0487=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4870[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x0487('0x0'));var util=require('util');var logger=require(_0x0487('0x1'))(_0x0487('0x2'));var moment=require(_0x0487('0x3'));var BPromise=require(_0x0487('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0487('0x5'));var config=require(_0x0487('0x6'));var attributes=require(_0x0487('0x7'));module[_0x0487('0x8')]=function(_0x5dd819,_0x1af4d5){return _0x5dd819['define'](_0x0487('0x9'),attributes,{'tableName':_0x0487('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24b4=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x272f33,_0x521232){var _0x40e66a=function(_0xd8fba8){while(--_0xd8fba8){_0x272f33['push'](_0x272f33['shift']());}};_0x40e66a(++_0x521232);}(_0x24b4,0x82));var _0x424b=function(_0x29fb83,_0x1cd513){_0x29fb83=_0x29fb83-0x0;var _0x5ad68c=_0x24b4[_0x29fb83];return _0x5ad68c;};'use strict';var _=require(_0x424b('0x0'));var util=require(_0x424b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x424b('0x2'));var BPromise=require(_0x424b('0x3'));var rp=require(_0x424b('0x4'));var fs=require('fs');var path=require(_0x424b('0x5'));var rimraf=require(_0x424b('0x6'));var config=require(_0x424b('0x7'));var attributes=require(_0x424b('0x8'));module[_0x424b('0x9')]=function(_0x3e1dc6,_0x32d636){return _0x3e1dc6[_0x424b('0xa')](_0x424b('0xb'),attributes,{'tableName':_0x424b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 154bef7..b66b5de 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 _0x632c=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x632c,0x73));var _0xc632=function(_0x4af8cc,_0x51abdf){_0x4af8cc=_0x4af8cc-0x0;var _0x49e6f4=_0x632c[_0x4af8cc];return _0x49e6f4;};'use strict';var _=require(_0xc632('0x0'));var util=require(_0xc632('0x1'));var moment=require(_0xc632('0x2'));var BPromise=require('bluebird');var rs=require(_0xc632('0x3'));var fs=require('fs');var Redis=require(_0xc632('0x4'));var db=require(_0xc632('0x5'))['db'];var utils=require(_0xc632('0x6'));var logger=require(_0xc632('0x7'))(_0xc632('0x8'));var config=require(_0xc632('0x9'));var jayson=require(_0xc632('0xa'));var client=jayson[_0xc632('0xb')][_0xc632('0xc')]({'port':0x232a});config[_0xc632('0xd')]=_[_0xc632('0xe')](config[_0xc632('0xd')],{'host':_0xc632('0xf'),'port':0x18eb});var socket=require(_0xc632('0x10'))(new Redis(config[_0xc632('0xd')]));require(_0xc632('0x11'))[_0xc632('0x12')](socket);function respondWithRpcPromise(_0xb7b6b6,_0xa77119,_0x26a49e){return new BPromise(function(_0x4c2942,_0x233046){return client['request'](_0xb7b6b6,_0x26a49e)['then'](function(_0x526cb2){logger[_0xc632('0x13')](_0xc632('0x14'),_0xa77119,_0xc632('0x15'));logger[_0xc632('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xa77119,_0xc632('0x15'),JSON[_0xc632('0x17')](_0x526cb2));if(_0x526cb2[_0xc632('0x18')]){if(_0x526cb2['error']['code']===0x1f4){logger[_0xc632('0x18')](_0xc632('0x14'),_0xa77119,_0x526cb2[_0xc632('0x18')][_0xc632('0x19')]);return _0x233046(_0x526cb2[_0xc632('0x18')][_0xc632('0x19')]);}logger[_0xc632('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xa77119,_0x526cb2[_0xc632('0x18')][_0xc632('0x19')]);return _0x4c2942(_0x526cb2[_0xc632('0x18')][_0xc632('0x19')]);}else{logger[_0xc632('0x13')](_0xc632('0x14'),_0xa77119,_0xc632('0x15'));_0x4c2942(_0x526cb2[_0xc632('0x1a')][_0xc632('0x19')]);}})[_0xc632('0x1b')](function(_0x382437){logger[_0xc632('0x18')](_0xc632('0x14'),_0xa77119,_0x382437);_0x233046(_0x382437);});});} \ No newline at end of file +var _0xa75b=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x593a4b,_0x1c26bb){var _0x3591b9=function(_0x55d631){while(--_0x55d631){_0x593a4b['push'](_0x593a4b['shift']());}};_0x3591b9(++_0x1c26bb);}(_0xa75b,0xfb));var _0xba75=function(_0x4d81be,_0x40f89e){_0x4d81be=_0x4d81be-0x0;var _0x82427b=_0xa75b[_0x4d81be];return _0x82427b;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require(_0xba75('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba75('0x2'));var db=require(_0xba75('0x3'))['db'];var utils=require(_0xba75('0x4'));var logger=require(_0xba75('0x5'))(_0xba75('0x6'));var config=require(_0xba75('0x7'));var jayson=require(_0xba75('0x8'));var client=jayson['client'][_0xba75('0x9')]({'port':0x232a});config[_0xba75('0xa')]=_[_0xba75('0xb')](config['redis'],{'host':_0xba75('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba75('0xa')]));require('./chatWebsite.socket')[_0xba75('0xd')](socket);function respondWithRpcPromise(_0x2cc03e,_0x10f346,_0x2e1ccc){return new BPromise(function(_0x12a9d7,_0x4f89de){return client['request'](_0x2cc03e,_0x2e1ccc)[_0xba75('0xe')](function(_0x485776){logger[_0xba75('0xf')](_0xba75('0x10'),_0x10f346,_0xba75('0x11'));logger['debug'](_0xba75('0x12'),_0x10f346,_0xba75('0x11'),JSON[_0xba75('0x13')](_0x485776));if(_0x485776[_0xba75('0x14')]){if(_0x485776[_0xba75('0x14')][_0xba75('0x15')]===0x1f4){logger[_0xba75('0x14')](_0xba75('0x10'),_0x10f346,_0x485776['error'][_0xba75('0x16')]);return _0x4f89de(_0x485776[_0xba75('0x14')]['message']);}logger[_0xba75('0x14')](_0xba75('0x10'),_0x10f346,_0x485776[_0xba75('0x14')][_0xba75('0x16')]);return _0x12a9d7(_0x485776['error'][_0xba75('0x16')]);}else{logger[_0xba75('0xf')](_0xba75('0x10'),_0x10f346,_0xba75('0x11'));_0x12a9d7(_0x485776[_0xba75('0x17')]['message']);}})[_0xba75('0x18')](function(_0x5d86de){logger[_0xba75('0x14')](_0xba75('0x10'),_0x10f346,_0x5d86de);_0x4f89de(_0x5d86de);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8719630..d88f4af 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 _0xb2bd=['emit','removeListener','register','chatWebsite:','save','remove','update'];(function(_0x187266,_0x3f99df){var _0x1a83bc=function(_0x189626){while(--_0x189626){_0x187266['push'](_0x187266['shift']());}};_0x1a83bc(++_0x3f99df);}(_0xb2bd,0x13f));var _0xdb2b=function(_0x4ddbf5,_0x233f7e){_0x4ddbf5=_0x4ddbf5-0x0;var _0x325fdf=_0xb2bd[_0x4ddbf5];return _0x325fdf;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xdb2b('0x0'),_0xdb2b('0x1'),_0xdb2b('0x2')];function createListener(_0x50d840,_0x5dc5f0){return function(_0x4db58f){_0x5dc5f0[_0xdb2b('0x3')](_0x50d840,_0x4db58f);};}function removeListener(_0x619ca9,_0x3eb25a){return function(){ChatWebsiteEvents[_0xdb2b('0x4')](_0x619ca9,_0x3eb25a);};}exports[_0xdb2b('0x5')]=function(_0xc0776e){for(var _0x5f2edd=0x0,_0x5eb763=events['length'];_0x5f2edd<_0x5eb763;_0x5f2edd++){var _0x59ef46=events[_0x5f2edd];var _0x4b2e22=createListener(_0xdb2b('0x6')+_0x59ef46,_0xc0776e);ChatWebsiteEvents['on'](_0x59ef46,_0x4b2e22);}}; \ No newline at end of file +var _0x2e43=['save','remove','update','emit','removeListener','register','chatWebsite:','./chatWebsite.events'];(function(_0x209d23,_0x1fa9b0){var _0xa4c139=function(_0x25bc90){while(--_0x25bc90){_0x209d23['push'](_0x209d23['shift']());}};_0xa4c139(++_0x1fa9b0);}(_0x2e43,0x1c7));var _0x32e4=function(_0x4e25ed,_0x2d34c7){_0x4e25ed=_0x4e25ed-0x0;var _0x3aa239=_0x2e43[_0x4e25ed];return _0x3aa239;};'use strict';var ChatWebsiteEvents=require(_0x32e4('0x0'));var events=[_0x32e4('0x1'),_0x32e4('0x2'),_0x32e4('0x3')];function createListener(_0x500554,_0x1a6a6e){return function(_0x1774c0){_0x1a6a6e[_0x32e4('0x4')](_0x500554,_0x1774c0);};}function removeListener(_0x2d9421,_0x4b9840){return function(){ChatWebsiteEvents[_0x32e4('0x5')](_0x2d9421,_0x4b9840);};}exports[_0x32e4('0x6')]=function(_0x5e2cfc){for(var _0x3598b2=0x0,_0x57cbcd=events['length'];_0x3598b2<_0x57cbcd;_0x3598b2++){var _0x41d55d=events[_0x3598b2];var _0x1b894a=createListener(_0x32e4('0x7')+_0x41d55d,_0x5e2cfc);ChatWebsiteEvents['on'](_0x41d55d,_0x1b894a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 34579a7..78fd3ce 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 _0xe2b2=['server/files/images/avatars/','file','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','put','update','delete','removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','join'];(function(_0xa81926,_0x38e368){var _0x8177ef=function(_0x2b3726){while(--_0x2b3726){_0xa81926['push'](_0xa81926['shift']());}};_0x8177ef(++_0x38e368);}(_0xe2b2,0x12a));var _0x2e2b=function(_0x56afcb,_0x362b13){_0x56afcb=_0x56afcb-0x0;var _0x2b69f6=_0xe2b2[_0x56afcb];return _0x2b69f6;};'use strict';var multer=require(_0x2e2b('0x0'));var util=require('util');var path=require(_0x2e2b('0x1'));var timeout=require(_0x2e2b('0x2'));var express=require(_0x2e2b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e2b('0x4'));var interaction=require(_0x2e2b('0x5'));var config=require(_0x2e2b('0x6'));var controller=require('./chatWebsite.controller');router[_0x2e2b('0x7')]('/',auth['isAuthenticated'](),controller[_0x2e2b('0x8')]);router['get'](_0x2e2b('0x9'),auth[_0x2e2b('0xa')](),controller[_0x2e2b('0xb')]);router['get'](_0x2e2b('0xc'),auth[_0x2e2b('0xa')](),controller['show']);router[_0x2e2b('0x7')](_0x2e2b('0xd'),auth[_0x2e2b('0xa')](),controller['getDispositions']);router['get'](_0x2e2b('0xe'),auth['isAuthenticated'](),controller[_0x2e2b('0xf')]);router[_0x2e2b('0x7')](_0x2e2b('0x10'),controller[_0x2e2b('0x11')]);router[_0x2e2b('0x7')](_0x2e2b('0x12'),controller[_0x2e2b('0x13')]);router[_0x2e2b('0x7')](_0x2e2b('0x14'),controller['getCustomerAvatar']);router[_0x2e2b('0x7')](_0x2e2b('0x15'),controller[_0x2e2b('0x16')]);router['get']('/:id/interactions',auth[_0x2e2b('0xa')](),controller[_0x2e2b('0x17')]);router[_0x2e2b('0x7')](_0x2e2b('0x18'),controller[_0x2e2b('0x19')]);router[_0x2e2b('0x7')](_0x2e2b('0x1a'),auth[_0x2e2b('0xa')](),controller[_0x2e2b('0x1b')]);router[_0x2e2b('0x7')]('/:id/proactive_actions',auth[_0x2e2b('0xa')](),controller['getProactiveActions']);router['get'](_0x2e2b('0x1c'),controller[_0x2e2b('0x1d')]);router[_0x2e2b('0x7')](_0x2e2b('0x1e'),auth[_0x2e2b('0xa')](),controller[_0x2e2b('0x1f')]);router[_0x2e2b('0x7')](_0x2e2b('0x20'),auth['isAuthenticated'](),controller[_0x2e2b('0x21')]);router['post']('/',auth[_0x2e2b('0xa')](),controller['create']);router[_0x2e2b('0x22')](_0x2e2b('0xd'),auth[_0x2e2b('0xa')](),controller[_0x2e2b('0x23')]);router[_0x2e2b('0x22')](_0x2e2b('0xe'),auth['isAuthenticated'](),controller[_0x2e2b('0x24')]);var upload=multer({'storage':multer[_0x2e2b('0x25')]({'destination':function(_0xabe890,_0x56f5fb,_0x33b89e){_0x33b89e(null,path['join'](config[_0x2e2b('0x26')],_0x2e2b('0x27')));},'filename':function(_0xb17e93,_0x5375e5,_0x26c455){_0x26c455(null,util[_0x2e2b('0x28')](_0x2e2b('0x29'),Date[_0x2e2b('0x2a')](),_0x5375e5[_0x2e2b('0x2b')]));}})});router[_0x2e2b('0x22')](_0x2e2b('0x10'),upload[_0x2e2b('0x2c')]('file'),controller[_0x2e2b('0x2d')]);var upload=multer({'storage':multer[_0x2e2b('0x25')]({'destination':function(_0x10b9c6,_0x59a08c,_0x162751){_0x162751(null,path[_0x2e2b('0x2e')](config[_0x2e2b('0x26')],_0x2e2b('0x2f')));},'filename':function(_0x3e5b07,_0x539cac,_0x2a2006){_0x2a2006(null,util[_0x2e2b('0x28')](_0x2e2b('0x29'),Date[_0x2e2b('0x2a')](),_0x539cac[_0x2e2b('0x2b')]));}})});router[_0x2e2b('0x22')](_0x2e2b('0x12'),upload[_0x2e2b('0x2c')](_0x2e2b('0x30')),controller[_0x2e2b('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5f20b4,_0x4659bd,_0x1f014e){_0x1f014e(null,path[_0x2e2b('0x2e')](config[_0x2e2b('0x26')],'server/files/images/avatars/'));},'filename':function(_0xe33b0d,_0x3d2939,_0x20bd2d){_0x20bd2d(null,util[_0x2e2b('0x28')]('%s-%s',Date[_0x2e2b('0x2a')](),_0x3d2939['originalname']));}})});router['post'](_0x2e2b('0x14'),upload[_0x2e2b('0x2c')](_0x2e2b('0x30')),controller[_0x2e2b('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3cb20c,_0x36a5c6,_0x18e8df){_0x18e8df(null,path[_0x2e2b('0x2e')](config[_0x2e2b('0x26')],_0x2e2b('0x2f')));},'filename':function(_0x3e0b59,_0x39da01,_0x2c3cbc){_0x2c3cbc(null,util['format'](_0x2e2b('0x29'),Date[_0x2e2b('0x2a')](),_0x39da01[_0x2e2b('0x2b')]));}})});router[_0x2e2b('0x22')](_0x2e2b('0x15'),upload[_0x2e2b('0x2c')](_0x2e2b('0x30')),controller[_0x2e2b('0x33')]);router[_0x2e2b('0x22')](_0x2e2b('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x2e2b('0x25')]({'destination':function(_0x387b3e,_0x24178e,_0x4f9e75){const _0xa214f8=path['join'](config[_0x2e2b('0x26')],_0x2e2b('0x35'),'attachments',_0x2e2b('0x36'));fs_extra[_0x2e2b('0x37')](_0xa214f8,function(){_0x4f9e75(null,_0xa214f8);});},'filename':function(_0x73e439,_0x1acc21,_0x1d7e41){const _0x37f61d=_0x1acc21[_0x2e2b('0x2b')][_0x2e2b('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x34c143=path['extname'](_0x37f61d);const _0x4b00a7=Date['now']()+'-'+_0x37f61d['replace'](_0x34c143,'')+_0x34c143;_0x1d7e41(null,_0x4b00a7);}})});router['post'](_0x2e2b('0x39'),offlineUploadMulter[_0x2e2b('0x3a')](),controller[_0x2e2b('0x3b')]);router[_0x2e2b('0x22')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x2e2b('0x3c')]);router[_0x2e2b('0x22')](_0x2e2b('0x1a'),auth['isAuthenticated'](),controller[_0x2e2b('0x3d')]);router[_0x2e2b('0x22')](_0x2e2b('0x3e'),auth[_0x2e2b('0xa')](),controller['addProactiveActions']);router[_0x2e2b('0x22')]('/:id/users',auth[_0x2e2b('0xa')](),controller['addAgents']);router[_0x2e2b('0x3f')]('/:id',auth[_0x2e2b('0xa')](),controller[_0x2e2b('0x40')]);router[_0x2e2b('0x41')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2e2b('0x41')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2e2b('0x42')]);router[_0x2e2b('0x41')](_0x2e2b('0xe'),auth[_0x2e2b('0xa')](),controller[_0x2e2b('0x43')]);router[_0x2e2b('0x41')](_0x2e2b('0x20'),auth[_0x2e2b('0xa')](),controller['removeAgents']);module[_0x2e2b('0x44')]=router; \ No newline at end of file +var _0x7367=['/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','diskStorage','single','addAvatar','server/files/images/avatars/','now','/:id/customer_avatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','/:id','update','delete','removeDispositions','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3b4c29,_0x4254d4){var _0xeb7557=function(_0x13dfe2){while(--_0x13dfe2){_0x3b4c29['push'](_0x3b4c29['shift']());}};_0xeb7557(++_0x4254d4);}(_0x7367,0x105));var _0x7736=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7367[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x7736('0x0'));var path=require(_0x7736('0x1'));var timeout=require(_0x7736('0x2'));var express=require(_0x7736('0x3'));var router=express[_0x7736('0x4')]();var fs_extra=require(_0x7736('0x5'));var auth=require(_0x7736('0x6'));var interaction=require(_0x7736('0x7'));var config=require(_0x7736('0x8'));var controller=require('./chatWebsite.controller');router[_0x7736('0x9')]('/',auth[_0x7736('0xa')](),controller['index']);router[_0x7736('0x9')](_0x7736('0xb'),auth[_0x7736('0xa')](),controller[_0x7736('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7736('0xd')]);router[_0x7736('0x9')](_0x7736('0xe'),auth[_0x7736('0xa')](),controller[_0x7736('0xf')]);router[_0x7736('0x9')](_0x7736('0x10'),auth['isAuthenticated'](),controller[_0x7736('0x11')]);router['get'](_0x7736('0x12'),controller[_0x7736('0x13')]);router['get'](_0x7736('0x14'),controller['getAvatar']);router[_0x7736('0x9')]('/:id/customer_avatar',controller[_0x7736('0x15')]);router['get'](_0x7736('0x16'),controller[_0x7736('0x17')]);router[_0x7736('0x9')](_0x7736('0x18'),auth[_0x7736('0xa')](),controller[_0x7736('0x19')]);router[_0x7736('0x9')](_0x7736('0x1a'),controller['getSnippet']);router[_0x7736('0x9')](_0x7736('0x1b'),auth[_0x7736('0xa')](),controller[_0x7736('0x1c')]);router[_0x7736('0x9')](_0x7736('0x1d'),auth[_0x7736('0xa')](),controller[_0x7736('0x1e')]);router[_0x7736('0x9')](_0x7736('0x1f'),controller['getFields']);router[_0x7736('0x9')](_0x7736('0x20'),auth[_0x7736('0xa')](),controller[_0x7736('0x21')]);router[_0x7736('0x9')](_0x7736('0x22'),auth[_0x7736('0xa')](),controller[_0x7736('0x23')]);router['post']('/',auth[_0x7736('0xa')](),controller[_0x7736('0x24')]);router[_0x7736('0x25')](_0x7736('0xe'),auth['isAuthenticated'](),controller[_0x7736('0x26')]);router[_0x7736('0x25')](_0x7736('0x10'),auth[_0x7736('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c88df,_0x283cd3,_0x8090ad){_0x8090ad(null,path[_0x7736('0x27')](config[_0x7736('0x28')],_0x7736('0x29')));},'filename':function(_0x39a410,_0x377ca1,_0x5261eb){_0x5261eb(null,util[_0x7736('0x2a')](_0x7736('0x2b'),Date['now'](),_0x377ca1[_0x7736('0x2c')]));}})});router[_0x7736('0x25')](_0x7736('0x12'),upload['single'](_0x7736('0x2d')),controller[_0x7736('0x2e')]);var upload=multer({'storage':multer[_0x7736('0x2f')]({'destination':function(_0x2af133,_0xf77f62,_0x1ba2bf){_0x1ba2bf(null,path[_0x7736('0x27')](config[_0x7736('0x28')],'server/files/images/avatars/'));},'filename':function(_0x4f0a9a,_0x5de7ef,_0x4340c4){_0x4340c4(null,util['format'](_0x7736('0x2b'),Date['now'](),_0x5de7ef[_0x7736('0x2c')]));}})});router['post']('/:id/avatar',upload[_0x7736('0x30')](_0x7736('0x2d')),controller[_0x7736('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3dee4b,_0x26646f,_0x25c8bd){_0x25c8bd(null,path[_0x7736('0x27')](config['root'],_0x7736('0x32')));},'filename':function(_0x46a881,_0x5ce962,_0x1da70b){_0x1da70b(null,util[_0x7736('0x2a')](_0x7736('0x2b'),Date[_0x7736('0x33')](),_0x5ce962['originalname']));}})});router[_0x7736('0x25')](_0x7736('0x34'),upload[_0x7736('0x30')](_0x7736('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x7736('0x2f')]({'destination':function(_0x1d625e,_0x4ecb29,_0xb52c7b){_0xb52c7b(null,path[_0x7736('0x27')](config[_0x7736('0x28')],'server/files/images/avatars/'));},'filename':function(_0x3b4df1,_0x14f255,_0x54db58){_0x54db58(null,util['format'](_0x7736('0x2b'),Date[_0x7736('0x33')](),_0x14f255[_0x7736('0x2c')]));}})});router['post']('/:id/system_avatar',upload[_0x7736('0x30')](_0x7736('0x2d')),controller[_0x7736('0x35')]);router[_0x7736('0x25')]('/:id/notify',controller[_0x7736('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x7736('0x2f')]({'destination':function(_0x1a4f0f,_0x31546c,_0x32d4ff){const _0x2cd11a=path[_0x7736('0x27')](config['root'],_0x7736('0x37'),_0x7736('0x38'),'offline-chat');fs_extra[_0x7736('0x39')](_0x2cd11a,function(){_0x32d4ff(null,_0x2cd11a);});},'filename':function(_0x1a9dba,_0xa3ed16,_0x3e7289){const _0x5000d9=_0xa3ed16[_0x7736('0x2c')][_0x7736('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x163495=path['extname'](_0x5000d9);const _0xe01b70=Date[_0x7736('0x33')]()+'-'+_0x5000d9[_0x7736('0x3a')](_0x163495,'')+_0x163495;_0x3e7289(null,_0xe01b70);}})});router['post'](_0x7736('0x3b'),offlineUploadMulter['any'](),controller[_0x7736('0x3c')]);router['post'](_0x7736('0x18'),auth[_0x7736('0xa')](),controller['addInteraction']);router[_0x7736('0x25')](_0x7736('0x1b'),auth['isAuthenticated'](),controller[_0x7736('0x3d')]);router['post'](_0x7736('0x1d'),auth[_0x7736('0xa')](),controller[_0x7736('0x3e')]);router[_0x7736('0x25')](_0x7736('0x22'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x7736('0x3f'),auth[_0x7736('0xa')](),controller[_0x7736('0x40')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7736('0x41')](_0x7736('0xe'),auth[_0x7736('0xa')](),controller[_0x7736('0x42')]);router[_0x7736('0x41')](_0x7736('0x10'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x7736('0x43')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index b60a804..e6a8ff3 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 _0x683d=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','get','client-side-logger'];(function(_0x79037d,_0xe70193){var _0x22e0b6=function(_0x1d062e){while(--_0x1d062e){_0x79037d['push'](_0x79037d['shift']());}};_0x22e0b6(++_0xe70193);}(_0x683d,0x67));var _0xd683=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x683d[_0x56740a];return _0x257144;};var beaverLogger=require(_0xd683('0x0'));var express=require(_0xd683('0x1'));var auth=require(_0xd683('0x2'));var config=require(_0xd683('0x3'));var router=express[_0xd683('0x4')]();var isProduction=config[_0xd683('0x5')]===_0xd683('0x6')||![];function clientSideLogs(_0x200963,_0x47f20c,_0x594298){var _0x17401d=_0x200963['app'][_0xd683('0x7')](_0xd683('0x8'));if(!_0x17401d){throw new Error(_0xd683('0x9'));}return beaverLogger[_0xd683('0xa')]({'uri':_0xd683('0xb'),'logger':_0x17401d,'enableCors':!isProduction})(_0x200963,_0x47f20c,_0x594298);}router[_0xd683('0xc')](auth[_0xd683('0xd')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x84ac=['get','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','production','app'];(function(_0x3a3d8e,_0x4869c3){var _0x3eba3f=function(_0x31239b){while(--_0x31239b){_0x3a3d8e['push'](_0x3a3d8e['shift']());}};_0x3eba3f(++_0x4869c3);}(_0x84ac,0x132));var _0xc84a=function(_0x8f448c,_0x5587a4){_0x8f448c=_0x8f448c-0x0;var _0x24b4e3=_0x84ac[_0x8f448c];return _0x24b4e3;};var beaverLogger=require(_0xc84a('0x0'));var express=require('express');var auth=require(_0xc84a('0x1'));var config=require(_0xc84a('0x2'));var router=express[_0xc84a('0x3')]();var isProduction=config['env']===_0xc84a('0x4')||![];function clientSideLogs(_0x3405f2,_0xb6c10a,_0x11df58){var _0x328312=_0x3405f2[_0xc84a('0x5')][_0xc84a('0x6')]('client-side-logger');if(!_0x328312){throw new Error(_0xc84a('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0xc84a('0x8'),'logger':_0x328312,'enableCors':!isProduction})(_0x3405f2,_0xb6c10a,_0x11df58);}router[_0xc84a('0x9')](auth[_0xc84a('0xa')](),clientSideLogs);module[_0xc84a('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index ee98f79..6e4c5c5 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 _0x4a89=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','sequelize','exports','STRING','Google','MicrosoftAzure','ENUM','Outlook365'];(function(_0x366763,_0x5efea2){var _0x3abd75=function(_0x2e66ee){while(--_0x2e66ee){_0x366763['push'](_0x366763['shift']());}};_0x3abd75(++_0x5efea2);}(_0x4a89,0xf5));var _0x94a8=function(_0x2b393f,_0x14af41){_0x2b393f=_0x2b393f-0x0;var _0x53c201=_0x4a89[_0x2b393f];return _0x53c201;};'use strict';var Sequelize=require(_0x94a8('0x0'));module[_0x94a8('0x1')]={'name':{'type':Sequelize[_0x94a8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x94a8('0x3'),_0x94a8('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x94a8('0x5')](_0x94a8('0x6'),_0x94a8('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x94a8('0x8')},'data2':{'type':Sequelize[_0x94a8('0x2')],'comment':_0x94a8('0x9')},'data3':{'type':Sequelize[_0x94a8('0x2')],'comment':_0x94a8('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x94a8('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0x94a8('0xc')},'data6':{'type':Sequelize[_0x94a8('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x94a8('0xd')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xfda3=['MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x2ac87c,_0x1b07b4){var _0x41a0b5=function(_0x390729){while(--_0x390729){_0x2ac87c['push'](_0x2ac87c['shift']());}};_0x41a0b5(++_0x1b07b4);}(_0xfda3,0xea));var _0x3fda=function(_0x3f581f,_0x4ea03c){_0x3f581f=_0x3f581f-0x0;var _0x1e0d19=_0xfda3[_0x3f581f];return _0x1e0d19;};'use strict';var Sequelize=require(_0x3fda('0x0'));module[_0x3fda('0x1')]={'name':{'type':Sequelize[_0x3fda('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3fda('0x3')](_0x3fda('0x4'),_0x3fda('0x5'),_0x3fda('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3fda('0x3')](_0x3fda('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x3fda('0x2')],'comment':_0x3fda('0x8')},'data2':{'type':Sequelize[_0x3fda('0x2')],'comment':_0x3fda('0x9')},'data3':{'type':Sequelize[_0x3fda('0x2')],'comment':_0x3fda('0xa')},'data4':{'type':Sequelize[_0x3fda('0x2')],'comment':_0x3fda('0xb')},'data5':{'type':Sequelize[_0x3fda('0xc')],'comment':_0x3fda('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x3fda('0xc')],'comment':_0x3fda('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 548339c..0ed974e 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 _0x7fa9=['get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','keys','length','find','create','body','Service\x20parameter\x20not\x20specified','includes','join','encryptString','oauth2MicrosoftAuthorize','findOne','user'];(function(_0x47e38c,_0x50eca0){var _0x72a70e=function(_0x2d8de8){while(--_0x2d8de8){_0x47e38c['push'](_0x47e38c['shift']());}};_0x72a70e(++_0x50eca0);}(_0x7fa9,0x78));var _0x97fa=function(_0x45cb7f,_0x1738ef){_0x45cb7f=_0x45cb7f-0x0;var _0x2f523f=_0x7fa9[_0x45cb7f];return _0x2f523f;};'use strict';var _=require(_0x97fa('0x0'));var Redis=require(_0x97fa('0x1'));var qs=require(_0x97fa('0x2'));var encryptor=require(_0x97fa('0x3'));var config=require(_0x97fa('0x4'));var logger=require(_0x97fa('0x5'))(_0x97fa('0x6'));var db=require('../../mysqldb')['db'];var oauth=require(_0x97fa('0x7'));config[_0x97fa('0x8')]=_[_0x97fa('0x9')](config[_0x97fa('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x97fa('0xa'))(new Redis(config[_0x97fa('0x8')]));var redis=new Redis(config[_0x97fa('0x8')]);function respondWithStatusCode(_0x3d131e,_0x479d2d){_0x479d2d=_0x479d2d||0xcc;return function(_0x5dfb42){if(_0x5dfb42){return _0x3d131e[_0x97fa('0xb')](_0x479d2d);}return _0x3d131e[_0x97fa('0xc')](_0x479d2d)[_0x97fa('0xd')]();};}function respondWithResult(_0xbc8377,_0xf0b2c3){_0xf0b2c3=_0xf0b2c3||0xc8;return function(_0x45699e){if(_0x45699e){return _0xbc8377[_0x97fa('0xc')](_0xf0b2c3)[_0x97fa('0xe')](_0x45699e);}};}function respondWithFilteredResult(_0x62d825,_0x39fa79){return function(_0x586f77){if(_0x586f77){var _0x2d100d=typeof _0x39fa79[_0x97fa('0xf')]===_0x97fa('0x10')&&typeof _0x39fa79[_0x97fa('0x11')]===_0x97fa('0x10');var _0x24c154=_0x586f77[_0x97fa('0x12')];var _0x2fd44a=_0x2d100d?0x0:_0x39fa79[_0x97fa('0xf')];var _0x3ab8a4=_0x2d100d?_0x586f77[_0x97fa('0x12')]:_0x39fa79[_0x97fa('0xf')]+_0x39fa79[_0x97fa('0x11')];var _0x406f2c;if(_0x3ab8a4>=_0x24c154){_0x3ab8a4=_0x24c154;_0x406f2c=0xc8;}else{_0x406f2c=0xce;}_0x62d825[_0x97fa('0xc')](_0x406f2c);return _0x62d825[_0x97fa('0x13')](_0x97fa('0x14'),_0x2fd44a+'-'+_0x3ab8a4+'/'+_0x24c154)[_0x97fa('0xe')](_0x586f77);}return null;};}function saveUpdates(_0x2082bb){return function(_0x5ee90a){if(_0x5ee90a){return _0x5ee90a[_0x97fa('0x15')](_0x2082bb)['then'](function(_0x832df1){return _0x832df1;});}return null;};}function removeEntity(_0x2abd9b){return function(_0x453f57){if(_0x453f57){return _0x453f57[_0x97fa('0x16')]()[_0x97fa('0x17')](function(){_0x2abd9b['status'](0xcc)[_0x97fa('0xd')]();});}};}function handleEntityNotFound(_0xfad970){return function(_0x444f2e){if(!_0x444f2e){_0xfad970[_0x97fa('0xb')](0x194);}return _0x444f2e;};}function handleError(_0x242958,_0x30a2f6){_0x30a2f6=_0x30a2f6||0x1f4;return function(_0x1d34aa){logger[_0x97fa('0x18')](_0x1d34aa[_0x97fa('0x19')]);if(_0x1d34aa['name']){delete _0x1d34aa[_0x97fa('0x1a')];}_0x242958[_0x97fa('0xc')](_0x30a2f6)[_0x97fa('0x1b')](_0x1d34aa);};}function maskClientSecret(_0xeb3bb2){return _[_0x97fa('0x1c')](_0xeb3bb2[_0x97fa('0x1d')](0x0,0x3),0x14,'*');}exports[_0x97fa('0x1e')]=function(_0x25ca5d,_0x223610){var _0x383dc4={},_0x25d436={},_0x5a9754={'count':0x0,'rows':[]};var _0x57e95c=_[_0x97fa('0x1f')](db[_0x97fa('0x20')][_0x97fa('0x21')],function(_0x3d7f74){return{'name':_0x3d7f74[_0x97fa('0x22')],'type':_0x3d7f74['type'][_0x97fa('0x23')]};});_0x25d436[_0x97fa('0x24')]=_['map'](_0x57e95c,'name');_0x25d436['query']=_['keys'](_0x25ca5d[_0x97fa('0x25')]);_0x25d436[_0x97fa('0x26')]=_[_0x97fa('0x27')](_0x25d436[_0x97fa('0x24')],_0x25d436[_0x97fa('0x25')]);_0x383dc4['attributes']=_[_0x97fa('0x27')](_0x25d436[_0x97fa('0x24')],qs[_0x97fa('0x28')](_0x25ca5d['query'][_0x97fa('0x28')]));_0x383dc4[_0x97fa('0x29')]=_0x383dc4[_0x97fa('0x29')]['length']?_0x383dc4['attributes']:_0x25d436[_0x97fa('0x24')];if(!_0x25ca5d[_0x97fa('0x25')][_0x97fa('0x2a')](_0x97fa('0x2b'))){_0x383dc4[_0x97fa('0x11')]=qs['limit'](_0x25ca5d[_0x97fa('0x25')][_0x97fa('0x11')]);_0x383dc4['offset']=qs[_0x97fa('0xf')](_0x25ca5d[_0x97fa('0x25')]['offset']);}_0x383dc4[_0x97fa('0x2c')]=qs[_0x97fa('0x2d')](_0x25ca5d[_0x97fa('0x25')][_0x97fa('0x2d')]);_0x383dc4[_0x97fa('0x2e')]=qs['filters'](_[_0x97fa('0x2f')](_0x25ca5d[_0x97fa('0x25')],_0x25d436[_0x97fa('0x26')]),_0x57e95c);if(_0x25ca5d['query'][_0x97fa('0x30')]){_0x383dc4[_0x97fa('0x2e')]=_[_0x97fa('0x31')](_0x383dc4['where'],{'$or':_[_0x97fa('0x1f')](_0x57e95c,function(_0x589997){if(_0x589997['type']!=='VIRTUAL'){var _0xfe38fc={};_0xfe38fc[_0x589997['name']]={'$like':'%'+_0x25ca5d[_0x97fa('0x25')]['filter']+'%'};return _0xfe38fc;}})});}_0x383dc4=_['merge']({},_0x383dc4,_0x25ca5d[_0x97fa('0x32')]);var _0x53ce36={'where':_0x383dc4[_0x97fa('0x2e')]};return db[_0x97fa('0x20')][_0x97fa('0x12')](_0x53ce36)[_0x97fa('0x17')](function(_0x2f971e){_0x5a9754[_0x97fa('0x12')]=_0x2f971e;if(_0x25ca5d[_0x97fa('0x25')][_0x97fa('0x33')]){_0x383dc4['include']=[{'all':!![]}];}return db[_0x97fa('0x20')][_0x97fa('0x34')](_0x383dc4);})[_0x97fa('0x17')](function(_0x78d109){_0x5a9754[_0x97fa('0x35')]=_[_0x97fa('0x1f')](_0x78d109,function(_0x3e0f1b){if(_0x3e0f1b[_0x97fa('0x36')]===_0x97fa('0x37')){var _0x592f4a=encryptor['decryptString'](_0x3e0f1b[_0x97fa('0x38')]);_0x3e0f1b[_0x97fa('0x38')]=maskClientSecret(_0x592f4a);}return _0x3e0f1b;});return _0x5a9754;})['then'](respondWithFilteredResult(_0x223610,_0x383dc4))[_0x97fa('0x39')](handleError(_0x223610,null));};exports[_0x97fa('0x3a')]=function(_0x149fc2,_0x3b8c4c){var _0x542f5b={'raw':!![],'where':{'id':_0x149fc2[_0x97fa('0x3b')]['id']}},_0x25c420={};_0x25c420[_0x97fa('0x24')]=_['keys'](db[_0x97fa('0x20')][_0x97fa('0x21')]);_0x25c420[_0x97fa('0x25')]=_[_0x97fa('0x3c')](_0x149fc2[_0x97fa('0x25')]);_0x25c420[_0x97fa('0x26')]=_[_0x97fa('0x27')](_0x25c420[_0x97fa('0x24')],_0x25c420[_0x97fa('0x25')]);_0x542f5b['attributes']=_[_0x97fa('0x27')](_0x25c420[_0x97fa('0x24')],qs[_0x97fa('0x28')](_0x149fc2['query'][_0x97fa('0x28')]));_0x542f5b[_0x97fa('0x29')]=_0x542f5b[_0x97fa('0x29')][_0x97fa('0x3d')]?_0x542f5b[_0x97fa('0x29')]:_0x25c420[_0x97fa('0x24')];if(_0x149fc2[_0x97fa('0x25')]['includeAll']){_0x542f5b['include']=[{'all':!![]}];}_0x542f5b=_['merge']({},_0x542f5b,_0x149fc2[_0x97fa('0x32')]);return db['CloudProvider'][_0x97fa('0x3e')](_0x542f5b)[_0x97fa('0x17')](handleEntityNotFound(_0x3b8c4c,null))[_0x97fa('0x17')](function(_0x18e2cc){if(_0x18e2cc[_0x97fa('0x36')]===_0x97fa('0x37')){var _0x3ca404=encryptor['decryptString'](_0x18e2cc[_0x97fa('0x38')]);_0x18e2cc[_0x97fa('0x38')]=maskClientSecret(_0x3ca404);}return _0x18e2cc;})[_0x97fa('0x17')](respondWithResult(_0x3b8c4c,null))[_0x97fa('0x39')](handleError(_0x3b8c4c,null));};exports[_0x97fa('0x3f')]=function(_0x3ee163,_0x5864ff){if(!_0x3ee163['body']['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3ee163[_0x97fa('0x40')][_0x97fa('0x36')])throw new Error(_0x97fa('0x41'));var _0x5d224a=db[_0x97fa('0x20')][_0x97fa('0x21')]['service']['values'];if(!_0x5d224a[_0x97fa('0x42')](_0x3ee163[_0x97fa('0x40')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5d224a[_0x97fa('0x43')](',\x20'));if(_0x3ee163['body'][_0x97fa('0x36')]===_0x97fa('0x37')&&_0x3ee163[_0x97fa('0x40')]['data3']){_0x3ee163['body']['data3']=encryptor[_0x97fa('0x44')](_0x3ee163[_0x97fa('0x40')]['data3']);}return db[_0x97fa('0x20')][_0x97fa('0x3f')](_0x3ee163[_0x97fa('0x40')],{})[_0x97fa('0x17')](respondWithResult(_0x5864ff,0xc9))['catch'](handleError(_0x5864ff,null));};exports[_0x97fa('0x15')]=function(_0x28fd50,_0xc4d981){if(_0x28fd50[_0x97fa('0x40')]['id']){delete _0x28fd50['body']['id'];}return db[_0x97fa('0x20')][_0x97fa('0x3e')]({'where':{'id':_0x28fd50[_0x97fa('0x3b')]['id']}})[_0x97fa('0x17')](handleEntityNotFound(_0xc4d981,null))[_0x97fa('0x17')](function(_0x18b7ef){if(_0x18b7ef[_0x97fa('0x36')]===_0x97fa('0x37')&&_0x28fd50['body'][_0x97fa('0x38')]){_0x28fd50[_0x97fa('0x40')]['data3']=encryptor[_0x97fa('0x44')](_0x28fd50[_0x97fa('0x40')]['data3']);}return _0x18b7ef;})['then'](saveUpdates(_0x28fd50['body'],null))['then'](respondWithResult(_0xc4d981,null))[_0x97fa('0x39')](handleError(_0xc4d981,null));};exports['destroy']=function(_0x248dc8,_0x5cc9e6){return db['CloudProvider'][_0x97fa('0x3e')]({'where':{'id':_0x248dc8[_0x97fa('0x3b')]['id']}})[_0x97fa('0x17')](handleEntityNotFound(_0x5cc9e6,null))['then'](removeEntity(_0x5cc9e6,null))[_0x97fa('0x39')](handleError(_0x5cc9e6,null));};exports[_0x97fa('0x45')]=function(_0x1ff2be,_0x1212fd){return db[_0x97fa('0x20')][_0x97fa('0x46')]({'where':{'id':_0x1ff2be[_0x97fa('0x3b')]['id']},'raw':!![]})['then'](function(_0x2d7a47){if(!_0x2d7a47)return _0x1212fd[_0x97fa('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2d7a47,_0x1ff2be[_0x97fa('0x47')]['id'])};})[_0x97fa('0x17')](respondWithResult(_0x1212fd,null))[_0x97fa('0x39')](handleError(_0x1212fd,null));};exports['oauth2MicrosoftCallback']=function(_0x49c6ea,_0x396172){var _0x5df8bb=_0x49c6ea['body'];var _0x3aa8a4;var _0x1bfba6;if(_0x5df8bb[_0x97fa('0x18')])throw _0x5df8bb;redis[_0x97fa('0x48')](_0x5df8bb[_0x97fa('0x49')])['then'](function(_0x5980eb){if(!_0x5980eb)throw new Error(_0x97fa('0x4a'));_0x3aa8a4=JSON[_0x97fa('0x4b')](_0x5980eb);var _0x5838cd=Buffer[_0x97fa('0x4c')](_0x5df8bb[_0x97fa('0x49')],_0x97fa('0x4d'))[_0x97fa('0x4e')](_0x97fa('0x4f'));_0x1bfba6=JSON[_0x97fa('0x4b')](_0x5838cd);if(!oauth[_0x97fa('0x50')](_0x5df8bb['id_token'],_0x3aa8a4[_0x97fa('0x51')]))throw new Error(_0x97fa('0x52'));redis[_0x97fa('0x53')](_0x5df8bb[_0x97fa('0x49')]);return oauth[_0x97fa('0x54')](_0x5df8bb['code'],_0x3aa8a4);})[_0x97fa('0x17')](function(_0x1dd513){_0x3aa8a4[_0x97fa('0x55')]=_0x1dd513[_0x97fa('0x56')];_0x3aa8a4[_0x97fa('0x57')]=_0x1dd513[_0x97fa('0x58')];return db[_0x97fa('0x20')][_0x97fa('0x15')]({'data5':_0x3aa8a4[_0x97fa('0x55')],'data6':_0x3aa8a4[_0x97fa('0x57')]},{'where':{'id':_0x3aa8a4['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x3aa8a4);socket[_0x97fa('0x59')](_0x97fa('0x5a'),{'id':_0x1bfba6['id']});return;})[_0x97fa('0x17')](respondWithStatusCode(_0x396172,null))[_0x97fa('0x39')](function(_0x3c3414){if(_0x1bfba6){socket[_0x97fa('0x59')](_0x97fa('0x5b'),{'id':_0x1bfba6['id']});}if(!_0x3aa8a4){logger['error'](_0x97fa('0x5c'),_0x3c3414);return _0x396172[_0x97fa('0xc')](0x1f4)[_0x97fa('0x1b')](_0x3c3414[_0x97fa('0x5d')]);}logger[_0x97fa('0x18')](_0x97fa('0x5e'),_0x3aa8a4['id'],JSON[_0x97fa('0x5f')](_0x3c3414));});}; \ No newline at end of file +var _0xc28f=['microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','CloudProvider','count','includeAll','rows','MicrosoftAzure','data3','catch','show','keys','include','options','find','service','Service\x20parameter\x20not\x20specified','values','includes','body','encryptString','create','params','findOne','oauth2MicrosoftCallback','from','base64','toString','parse','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','state','getOauth2MicrosoftAccessToken','code','data5','access_token','data6'];(function(_0x1ad115,_0x102900){var _0x2545e8=function(_0xc40b11){while(--_0xc40b11){_0x1ad115['push'](_0x1ad115['shift']());}};_0x2545e8(++_0x102900);}(_0xc28f,0xb5));var _0xfc28=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc28f[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xfc28('0x0'));var Redis=require(_0xfc28('0x1'));var qs=require(_0xfc28('0x2'));var encryptor=require(_0xfc28('0x3'));var config=require('../../config/environment');var logger=require(_0xfc28('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xfc28('0x5'));config[_0xfc28('0x6')]=_[_0xfc28('0x7')](config['redis'],{'host':_0xfc28('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc28('0x6')]));var redis=new Redis(config[_0xfc28('0x6')]);function respondWithStatusCode(_0x2e9c9b,_0x12bb60){_0x12bb60=_0x12bb60||0xcc;return function(_0x1d768e){if(_0x1d768e){return _0x2e9c9b[_0xfc28('0x9')](_0x12bb60);}return _0x2e9c9b[_0xfc28('0xa')](_0x12bb60)[_0xfc28('0xb')]();};}function respondWithResult(_0x343552,_0x4fff3a){_0x4fff3a=_0x4fff3a||0xc8;return function(_0x440fee){if(_0x440fee){return _0x343552[_0xfc28('0xa')](_0x4fff3a)[_0xfc28('0xc')](_0x440fee);}};}function respondWithFilteredResult(_0x1b4daa,_0x4357e1){return function(_0x55205b){if(_0x55205b){var _0xfe89e=typeof _0x4357e1[_0xfc28('0xd')]===_0xfc28('0xe')&&typeof _0x4357e1[_0xfc28('0xf')]===_0xfc28('0xe');var _0x276df1=_0x55205b['count'];var _0x806a8c=_0xfe89e?0x0:_0x4357e1[_0xfc28('0xd')];var _0x27c744=_0xfe89e?_0x55205b['count']:_0x4357e1[_0xfc28('0xd')]+_0x4357e1['limit'];var _0xfb1f0f;if(_0x27c744>=_0x276df1){_0x27c744=_0x276df1;_0xfb1f0f=0xc8;}else{_0xfb1f0f=0xce;}_0x1b4daa['status'](_0xfb1f0f);return _0x1b4daa[_0xfc28('0x10')](_0xfc28('0x11'),_0x806a8c+'-'+_0x27c744+'/'+_0x276df1)[_0xfc28('0xc')](_0x55205b);}return null;};}function saveUpdates(_0x59074c){return function(_0x3e2248){if(_0x3e2248){return _0x3e2248[_0xfc28('0x12')](_0x59074c)['then'](function(_0x2e2189){return _0x2e2189;});}return null;};}function removeEntity(_0x35a180){return function(_0x4db2ef){if(_0x4db2ef){return _0x4db2ef[_0xfc28('0x13')]()[_0xfc28('0x14')](function(){_0x35a180[_0xfc28('0xa')](0xcc)[_0xfc28('0xb')]();});}};}function handleEntityNotFound(_0x43b6b0){return function(_0x409063){if(!_0x409063){_0x43b6b0['sendStatus'](0x194);}return _0x409063;};}function handleError(_0xd11234,_0x34995c){_0x34995c=_0x34995c||0x1f4;return function(_0xff002e){logger[_0xfc28('0x15')](_0xff002e[_0xfc28('0x16')]);if(_0xff002e[_0xfc28('0x17')]){delete _0xff002e[_0xfc28('0x17')];}_0xd11234['status'](_0x34995c)[_0xfc28('0x18')](_0xff002e);};}function maskClientSecret(_0x51c7cf){return _[_0xfc28('0x19')](_0x51c7cf[_0xfc28('0x1a')](0x0,0x3),0x14,'*');}exports[_0xfc28('0x1b')]=function(_0x39fb9c,_0x2a18f0){var _0x5e193c={},_0x36dece={},_0x4ad41d={'count':0x0,'rows':[]};var _0x3cda2e=_[_0xfc28('0x1c')](db['CloudProvider'][_0xfc28('0x1d')],function(_0x3aa882){return{'name':_0x3aa882[_0xfc28('0x1e')],'type':_0x3aa882[_0xfc28('0x1f')][_0xfc28('0x20')]};});_0x36dece[_0xfc28('0x21')]=_[_0xfc28('0x1c')](_0x3cda2e,_0xfc28('0x17'));_0x36dece[_0xfc28('0x22')]=_['keys'](_0x39fb9c[_0xfc28('0x22')]);_0x36dece['filters']=_[_0xfc28('0x23')](_0x36dece[_0xfc28('0x21')],_0x36dece[_0xfc28('0x22')]);_0x5e193c[_0xfc28('0x24')]=_['intersection'](_0x36dece[_0xfc28('0x21')],qs['fields'](_0x39fb9c[_0xfc28('0x22')][_0xfc28('0x25')]));_0x5e193c['attributes']=_0x5e193c[_0xfc28('0x24')][_0xfc28('0x26')]?_0x5e193c['attributes']:_0x36dece[_0xfc28('0x21')];if(!_0x39fb9c[_0xfc28('0x22')][_0xfc28('0x27')](_0xfc28('0x28'))){_0x5e193c[_0xfc28('0xf')]=qs[_0xfc28('0xf')](_0x39fb9c['query'][_0xfc28('0xf')]);_0x5e193c['offset']=qs['offset'](_0x39fb9c[_0xfc28('0x22')][_0xfc28('0xd')]);}_0x5e193c[_0xfc28('0x29')]=qs['sort'](_0x39fb9c['query'][_0xfc28('0x2a')]);_0x5e193c[_0xfc28('0x2b')]=qs[_0xfc28('0x2c')](_[_0xfc28('0x2d')](_0x39fb9c[_0xfc28('0x22')],_0x36dece[_0xfc28('0x2c')]),_0x3cda2e);if(_0x39fb9c[_0xfc28('0x22')][_0xfc28('0x2e')]){_0x5e193c[_0xfc28('0x2b')]=_[_0xfc28('0x2f')](_0x5e193c[_0xfc28('0x2b')],{'$or':_[_0xfc28('0x1c')](_0x3cda2e,function(_0x1d3efd){if(_0x1d3efd[_0xfc28('0x1f')]!=='VIRTUAL'){var _0x6a81fc={};_0x6a81fc[_0x1d3efd[_0xfc28('0x17')]]={'$like':'%'+_0x39fb9c[_0xfc28('0x22')][_0xfc28('0x2e')]+'%'};return _0x6a81fc;}})});}_0x5e193c=_['merge']({},_0x5e193c,_0x39fb9c['options']);var _0x4047b2={'where':_0x5e193c[_0xfc28('0x2b')]};return db[_0xfc28('0x30')][_0xfc28('0x31')](_0x4047b2)['then'](function(_0x4f6722){_0x4ad41d[_0xfc28('0x31')]=_0x4f6722;if(_0x39fb9c[_0xfc28('0x22')][_0xfc28('0x32')]){_0x5e193c['include']=[{'all':!![]}];}return db[_0xfc28('0x30')]['findAll'](_0x5e193c);})[_0xfc28('0x14')](function(_0x48c250){_0x4ad41d[_0xfc28('0x33')]=_[_0xfc28('0x1c')](_0x48c250,function(_0x285348){if(_0x285348['service']===_0xfc28('0x34')){var _0x460657=encryptor['decryptString'](_0x285348[_0xfc28('0x35')]);_0x285348[_0xfc28('0x35')]=maskClientSecret(_0x460657);}return _0x285348;});return _0x4ad41d;})['then'](respondWithFilteredResult(_0x2a18f0,_0x5e193c))[_0xfc28('0x36')](handleError(_0x2a18f0,null));};exports[_0xfc28('0x37')]=function(_0x3db08c,_0x14c998){var _0x37b0f9={'raw':!![],'where':{'id':_0x3db08c['params']['id']}},_0x2175a9={};_0x2175a9[_0xfc28('0x21')]=_[_0xfc28('0x38')](db[_0xfc28('0x30')][_0xfc28('0x1d')]);_0x2175a9[_0xfc28('0x22')]=_[_0xfc28('0x38')](_0x3db08c[_0xfc28('0x22')]);_0x2175a9[_0xfc28('0x2c')]=_['intersection'](_0x2175a9[_0xfc28('0x21')],_0x2175a9[_0xfc28('0x22')]);_0x37b0f9[_0xfc28('0x24')]=_['intersection'](_0x2175a9[_0xfc28('0x21')],qs[_0xfc28('0x25')](_0x3db08c[_0xfc28('0x22')][_0xfc28('0x25')]));_0x37b0f9[_0xfc28('0x24')]=_0x37b0f9['attributes'][_0xfc28('0x26')]?_0x37b0f9[_0xfc28('0x24')]:_0x2175a9[_0xfc28('0x21')];if(_0x3db08c[_0xfc28('0x22')]['includeAll']){_0x37b0f9[_0xfc28('0x39')]=[{'all':!![]}];}_0x37b0f9=_[_0xfc28('0x2f')]({},_0x37b0f9,_0x3db08c[_0xfc28('0x3a')]);return db[_0xfc28('0x30')][_0xfc28('0x3b')](_0x37b0f9)['then'](handleEntityNotFound(_0x14c998,null))['then'](function(_0x27c7b2){if(_0x27c7b2[_0xfc28('0x3c')]===_0xfc28('0x34')){var _0x20eb1c=encryptor['decryptString'](_0x27c7b2[_0xfc28('0x35')]);_0x27c7b2[_0xfc28('0x35')]=maskClientSecret(_0x20eb1c);}return _0x27c7b2;})[_0xfc28('0x14')](respondWithResult(_0x14c998,null))[_0xfc28('0x36')](handleError(_0x14c998,null));};exports['create']=function(_0x3e5109,_0x45fba1){if(!_0x3e5109['body'][_0xfc28('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3e5109['body']['service'])throw new Error(_0xfc28('0x3d'));var _0x2e056e=db[_0xfc28('0x30')]['rawAttributes'][_0xfc28('0x3c')][_0xfc28('0x3e')];if(!_0x2e056e[_0xfc28('0x3f')](_0x3e5109[_0xfc28('0x40')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2e056e['join'](',\x20'));if(_0x3e5109['body'][_0xfc28('0x3c')]===_0xfc28('0x34')&&_0x3e5109[_0xfc28('0x40')]['data3']){_0x3e5109[_0xfc28('0x40')][_0xfc28('0x35')]=encryptor[_0xfc28('0x41')](_0x3e5109[_0xfc28('0x40')][_0xfc28('0x35')]);}return db[_0xfc28('0x30')][_0xfc28('0x42')](_0x3e5109[_0xfc28('0x40')],{})[_0xfc28('0x14')](respondWithResult(_0x45fba1,0xc9))['catch'](handleError(_0x45fba1,null));};exports[_0xfc28('0x12')]=function(_0x34486c,_0x45bed4){if(_0x34486c[_0xfc28('0x40')]['id']){delete _0x34486c[_0xfc28('0x40')]['id'];}return db[_0xfc28('0x30')][_0xfc28('0x3b')]({'where':{'id':_0x34486c[_0xfc28('0x43')]['id']}})[_0xfc28('0x14')](handleEntityNotFound(_0x45bed4,null))[_0xfc28('0x14')](function(_0x5ceb5c){if(_0x5ceb5c[_0xfc28('0x3c')]==='MicrosoftAzure'&&_0x34486c[_0xfc28('0x40')][_0xfc28('0x35')]){_0x34486c['body'][_0xfc28('0x35')]=encryptor[_0xfc28('0x41')](_0x34486c[_0xfc28('0x40')][_0xfc28('0x35')]);}return _0x5ceb5c;})[_0xfc28('0x14')](saveUpdates(_0x34486c[_0xfc28('0x40')],null))[_0xfc28('0x14')](respondWithResult(_0x45bed4,null))[_0xfc28('0x36')](handleError(_0x45bed4,null));};exports['destroy']=function(_0x201e69,_0x5d7922){return db[_0xfc28('0x30')][_0xfc28('0x3b')]({'where':{'id':_0x201e69[_0xfc28('0x43')]['id']}})[_0xfc28('0x14')](handleEntityNotFound(_0x5d7922,null))['then'](removeEntity(_0x5d7922,null))[_0xfc28('0x36')](handleError(_0x5d7922,null));};exports['oauth2MicrosoftAuthorize']=function(_0x3d1e87,_0x286fb8){return db[_0xfc28('0x30')][_0xfc28('0x44')]({'where':{'id':_0x3d1e87[_0xfc28('0x43')]['id']},'raw':!![]})[_0xfc28('0x14')](function(_0x2e7cef){if(!_0x2e7cef)return _0x286fb8[_0xfc28('0x9')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2e7cef,_0x3d1e87['user']['id'])};})[_0xfc28('0x14')](respondWithResult(_0x286fb8,null))[_0xfc28('0x36')](handleError(_0x286fb8,null));};exports[_0xfc28('0x45')]=function(_0x7e111d,_0x2dc266){var _0x50a16b=_0x7e111d[_0xfc28('0x40')];var _0x3f9d6d;var _0x2fee76;if(_0x50a16b[_0xfc28('0x15')])throw _0x50a16b;redis['get'](_0x50a16b['state'])[_0xfc28('0x14')](function(_0x209aef){if(!_0x209aef)throw new Error('Invalid\x20state\x20parameter');_0x3f9d6d=JSON['parse'](_0x209aef);var _0x41032e=Buffer[_0xfc28('0x46')](_0x50a16b['state'],_0xfc28('0x47'))[_0xfc28('0x48')]('ascii');_0x2fee76=JSON[_0xfc28('0x49')](_0x41032e);if(!oauth[_0xfc28('0x4a')](_0x50a16b[_0xfc28('0x4b')],_0x3f9d6d['oauth2Claims']))throw new Error(_0xfc28('0x4c'));redis['del'](_0x50a16b[_0xfc28('0x4d')]);return oauth[_0xfc28('0x4e')](_0x50a16b[_0xfc28('0x4f')],_0x3f9d6d);})[_0xfc28('0x14')](function(_0x47c6eb){_0x3f9d6d[_0xfc28('0x50')]=_0x47c6eb[_0xfc28('0x51')];_0x3f9d6d[_0xfc28('0x52')]=_0x47c6eb['refresh_token'];return db[_0xfc28('0x30')][_0xfc28('0x12')]({'data5':_0x3f9d6d[_0xfc28('0x50')],'data6':_0x3f9d6d[_0xfc28('0x52')]},{'where':{'id':_0x3f9d6d['id']}});})[_0xfc28('0x14')](function(){oauth['startRefreshInterval'](_0x3f9d6d);socket['emit'](_0xfc28('0x53'),{'id':_0x2fee76['id']});return;})[_0xfc28('0x14')](respondWithStatusCode(_0x2dc266,null))[_0xfc28('0x36')](function(_0x1df58d){if(_0x2fee76){socket['emit'](_0xfc28('0x54'),{'id':_0x2fee76['id']});}if(!_0x3f9d6d){logger['error'](_0xfc28('0x55'),_0x1df58d);return _0x2dc266[_0xfc28('0xa')](0x1f4)[_0xfc28('0x18')](_0x1df58d[_0xfc28('0x56')]);}logger[_0xfc28('0x15')](_0xfc28('0x57'),_0x3f9d6d['id'],JSON['stringify'](_0x1df58d));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 21d2910..cbb51b5 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 _0x1d05=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0x1d05,0xfa));var _0x51d0=function(_0x1d6faf,_0x25e7e6){_0x1d6faf=_0x1d6faf-0x0;var _0x5efa5b=_0x1d05[_0x1d6faf];return _0x5efa5b;};'use strict';var _=require(_0x51d0('0x0'));var util=require(_0x51d0('0x1'));var logger=require(_0x51d0('0x2'))(_0x51d0('0x3'));var moment=require(_0x51d0('0x4'));var BPromise=require(_0x51d0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51d0('0x6'));var rimraf=require(_0x51d0('0x7'));var config=require(_0x51d0('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x51d0('0x9')]=function(_0xc0b6e0,_0x4fecdf){return _0xc0b6e0[_0x51d0('0xa')](_0x51d0('0xb'),attributes,{'tableName':_0x51d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9331=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports'];(function(_0x59a0fe,_0x5e9a90){var _0x5b50d5=function(_0x189d32){while(--_0x189d32){_0x59a0fe['push'](_0x59a0fe['shift']());}};_0x5b50d5(++_0x5e9a90);}(_0x9331,0x92));var _0x1933=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0x9331[_0x39e2d7];return _0x413d0d;};'use strict';var _=require(_0x1933('0x0'));var util=require(_0x1933('0x1'));var logger=require(_0x1933('0x2'))('api');var moment=require(_0x1933('0x3'));var BPromise=require(_0x1933('0x4'));var rp=require(_0x1933('0x5'));var fs=require('fs');var path=require(_0x1933('0x6'));var rimraf=require(_0x1933('0x7'));var config=require('../../config/environment');var attributes=require(_0x1933('0x8'));module[_0x1933('0x9')]=function(_0x5a6705,_0x5d8a61){return _0x5a6705[_0x1933('0xa')](_0x1933('0xb'),attributes,{'tableName':_0x1933('0xc'),'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 975a5a0..34d21d4 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 _0xf4bf=['oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','exp','resolve','data3','findOne','refresh_token','data6','data1','decryptString','POST','data5','access_token','CloudProvider','update','then','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','request-promise','util','../../config/environment','../../config/logger','api','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','response_type','join','data4','form_post','scope','state','nonce','prompt','login','key','value'];(function(_0x295081,_0x2b7394){var _0x444b0e=function(_0x522ecd){while(--_0x522ecd){_0x295081['push'](_0x295081['shift']());}};_0x444b0e(++_0x2b7394);}(_0xf4bf,0xc4));var _0xff4b=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0xf4bf[_0x4eb6ec];return _0x58881b;};'use strict';var _=require(_0xff4b('0x0'));var crypto=require(_0xff4b('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xff4b('0x2'));var util=require(_0xff4b('0x3'));var encryptor=require('../../components/encryptor');var config=require(_0xff4b('0x4'));var logger=require(_0xff4b('0x5'))(_0xff4b('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0xff4b('0x7')]=_[_0xff4b('0x8')](config[_0xff4b('0x7')],{'host':_0xff4b('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xff4b('0xa');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xff4b('0xb'),_0xff4b('0xc'),_0xff4b('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xff4b('0xe'),_0xff4b('0xf')],'Dynamics365':[_0xff4b('0x10'),_0xff4b('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xff4b('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2ab8a8){var _0x45cfd1=_[_0xff4b('0x12')](AZURE_AUTH_SCOPES[_0x2ab8a8[_0xff4b('0x13')]]);if(_0x2ab8a8[_0xff4b('0x13')]===_0xff4b('0x14'))_0x45cfd1[_0xff4b('0x15')](_0x2ab8a8[_0xff4b('0x16')]+_0xff4b('0x17'));return _0x45cfd1['join']('\x20');}function getAccessTokenScope(_0x34e168){if(_0x34e168[_0xff4b('0x13')]===_0xff4b('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x34e168[_0xff4b('0x13')]===_0xff4b('0x14'))return _0x34e168['data7']+_0xff4b('0x17');}function generateMicrosoftAuthorizationUrl(_0x222c46,_0x78e94f){var _0x84be2d=MICROSOFT_AUTH_URL[_0xff4b('0x19')](_0xff4b('0x1a'),_0x222c46[_0xff4b('0x1b')]);var _0x5c5fc1=[_0xff4b('0x1c'),_0xff4b('0x1d')];var _0x3018ee=Buffer['from'](JSON[_0xff4b('0x1e')]({'id':_0x78e94f}))[_0xff4b('0x1f')](_0xff4b('0x20'));var _0x5bc5eb=crypto[_0xff4b('0x21')](0x10)['toString'](_0xff4b('0x22'));var _0x18e720=getAuthorizationScopes(_0x222c46);var _0x2d56ef=[{'key':_0xff4b('0x23'),'value':_0x222c46['data1']},{'key':_0xff4b('0x24'),'value':encodeURIComponent(_0x5c5fc1[_0xff4b('0x25')]('\x20'))},{'key':'redirect_uri','value':_0x222c46[_0xff4b('0x26')]},{'key':'response_mode','value':_0xff4b('0x27')},{'key':_0xff4b('0x28'),'value':encodeURIComponent(_0x18e720)},{'key':_0xff4b('0x29'),'value':_0x3018ee},{'key':_0xff4b('0x2a'),'value':_0x5bc5eb},{'key':_0xff4b('0x2b'),'value':_0xff4b('0x2c')}];var _0x1d3775=_0x84be2d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xff4b('0x12')](_0x2d56ef,function(_0x188b1a){return _0x188b1a[_0xff4b('0x2d')]+'='+_0x188b1a[_0xff4b('0x2e')];})[_0xff4b('0x25')]('&');_0x222c46[_0xff4b('0x2f')]={'issuer':_0x84be2d[_0xff4b('0x19')](_0xff4b('0x30'),''),'audience':_0x222c46['data1'],'state':_0x3018ee,'nonce':_0x5bc5eb};redis[_0xff4b('0x31')](_0x3018ee,JSON[_0xff4b('0x1e')](_0x222c46));return _0x1d3775;}function isValidIdToken(_0x252fea,_0x3caa0f){try{var _0x213f2c=jwt[_0xff4b('0x32')](_0x252fea,{'complete':!![]});var _0x3976c8=_0x213f2c[_0xff4b('0x33')];if(_0x3976c8[_0xff4b('0x34')]!==_0x3caa0f['issuer'])return![];if(_0x3976c8[_0xff4b('0x35')]!==_0x3caa0f[_0xff4b('0x36')])return![];if(_0x3976c8['nonce']!==_0x3caa0f[_0xff4b('0x2a')])return![];if(moment()[_0xff4b('0x37')](moment[_0xff4b('0x38')](_0x3976c8[_0xff4b('0x39')])))return![];return!![];}catch(_0x4fc573){throw _0x4fc573;}}function refreshOauth2MicrosoftAccessToken(_0x10ae90){return Promise[_0xff4b('0x3a')]()['then'](function(){if(_0x10ae90[_0xff4b('0x3b')])return _0x10ae90;return db['CloudProvider'][_0xff4b('0x3c')]({'where':{'id':_0x10ae90['id']},'raw':!![]});})['then'](function(_0x1110c0){var _0x59a524={'grant_type':_0xff4b('0x3d'),'refresh_token':_0x1110c0[_0xff4b('0x3e')],'scope':getAccessTokenScope(_0x1110c0),'redirect_uri':_0x1110c0[_0xff4b('0x26')],'client_id':_0x1110c0[_0xff4b('0x3f')],'client_secret':encryptor[_0xff4b('0x40')](_0x1110c0[_0xff4b('0x3b')])};var _0x37931f={'method':_0xff4b('0x41'),'uri':MICROSOFT_AUTH_URL[_0xff4b('0x19')](_0xff4b('0x1a'),_0x1110c0[_0xff4b('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x59a524,'json':!![]};return rp(_0x37931f);})['then'](function(_0x1b32bf){_0x10ae90[_0xff4b('0x42')]=_0x1b32bf[_0xff4b('0x43')];_0x10ae90[_0xff4b('0x3e')]=_0x1b32bf[_0xff4b('0x3d')];return db[_0xff4b('0x44')][_0xff4b('0x45')]({'data5':_0x10ae90[_0xff4b('0x42')],'data6':_0x10ae90['data6']},{'where':{'id':_0x10ae90['id']}});})[_0xff4b('0x46')](function(){return _0x10ae90;})[_0xff4b('0x47')](function(_0x32aeef){logger[_0xff4b('0x48')](_0xff4b('0x49'),_0x10ae90['id'],_0x32aeef);});}function getOauth2MicrosoftAccessToken(_0x54c446,_0x1efb7e){var _0x477d45={'grant_type':_0xff4b('0x4a'),'code':_0x54c446,'scope':getAccessTokenScope(_0x1efb7e),'redirect_uri':_0x1efb7e['data4'],'client_id':_0x1efb7e[_0xff4b('0x3f')],'client_secret':encryptor[_0xff4b('0x40')](_0x1efb7e[_0xff4b('0x3b')])};var _0x3f6e9b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xff4b('0x19')](_0xff4b('0x1a'),_0x1efb7e[_0xff4b('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x477d45,'json':!![]};return rp(_0x3f6e9b);}function startRefreshInterval(_0x39dc4c){var _0x2a29bd=schedule[_0xff4b('0x4b')];if(_0x2a29bd[_0x39dc4c['id']])clearInterval(_0x2a29bd[_0x39dc4c['id']]);_0x2a29bd[_0x39dc4c['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xff4b('0x4c')](this,{'id':_0x39dc4c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xff4b('0x4b')]=_0x2a29bd;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xff4b('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xff4b('0x46')](function(_0x466613){var _0xeab438=_0x466613[_0xff4b('0x12')](function(_0x30dc61){return refreshOauth2MicrosoftAccessToken(_0x30dc61)[_0xff4b('0x46')](function(_0x5b6eae){startRefreshInterval(_0x5b6eae);});});return Promise[_0xff4b('0x4e')](_0xeab438);})['catch'](function(_0x53fb22){var _0x5d8e19=_0x53fb22?util[_0xff4b('0x4f')](_0x53fb22,{'showHidden':![],'depth':null}):'';logger[_0xff4b('0x48')](_0xff4b('0x50'),_0x5d8e19);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x2ff9=['Dynamics365','push','/.default','Outlook365','replace','{TENANT_ID}','code','stringify','toString','base64','randomBytes','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','set','decode','payload','iss','issuer','audience','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','data2','data5','access_token','update','error','authorization_code','intervals','findAll','map','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','type'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x2ff9,0x117));var _0x92ff=function(_0x12d944,_0xb7bf3){_0x12d944=_0x12d944-0x0;var _0x2b6d46=_0x2ff9[_0x12d944];return _0x2b6d46;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x92ff('0x0'));var moment=require(_0x92ff('0x1'));var Redis=require(_0x92ff('0x2'));var rp=require(_0x92ff('0x3'));var util=require(_0x92ff('0x4'));var encryptor=require(_0x92ff('0x5'));var config=require(_0x92ff('0x6'));var logger=require(_0x92ff('0x7'))('api');var schedule=require(_0x92ff('0x8'));var db=require(_0x92ff('0x9'))['db'];config[_0x92ff('0xa')]=_[_0x92ff('0xb')](config[_0x92ff('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x92ff('0xa')]);var MICROSOFT_AUTH_URL=_0x92ff('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x92ff('0xd'),'profile',_0x92ff('0xe'),_0x92ff('0xf'),_0x92ff('0x10'),_0x92ff('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x92ff('0xd'),_0x92ff('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x92ff('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x92ff('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2101c0){var _0x21b032=_['map'](AZURE_AUTH_SCOPES[_0x2101c0['type']]);if(_0x2101c0[_0x92ff('0x14')]===_0x92ff('0x15'))_0x21b032[_0x92ff('0x16')](_0x2101c0['data7']+_0x92ff('0x17'));return _0x21b032['join']('\x20');}function getAccessTokenScope(_0x469e10){if(_0x469e10['type']===_0x92ff('0x18'))return _0x92ff('0x10');if(_0x469e10[_0x92ff('0x14')]===_0x92ff('0x15'))return _0x469e10['data7']+_0x92ff('0x17');}function generateMicrosoftAuthorizationUrl(_0x4bc4c2,_0x2f9be9){var _0x69084a=MICROSOFT_AUTH_URL[_0x92ff('0x19')](_0x92ff('0x1a'),_0x4bc4c2['data2']);var _0x2087de=[_0x92ff('0x1b'),'id_token'];var _0xfc4add=Buffer['from'](JSON[_0x92ff('0x1c')]({'id':_0x2f9be9}))[_0x92ff('0x1d')](_0x92ff('0x1e'));var _0x25613e=crypto[_0x92ff('0x1f')](0x10)['toString'](_0x92ff('0x20'));var _0x51fb9e=getAuthorizationScopes(_0x4bc4c2);var _0x1a9e14=[{'key':'client_id','value':_0x4bc4c2[_0x92ff('0x21')]},{'key':_0x92ff('0x22'),'value':encodeURIComponent(_0x2087de['join']('\x20'))},{'key':_0x92ff('0x23'),'value':_0x4bc4c2[_0x92ff('0x24')]},{'key':_0x92ff('0x25'),'value':_0x92ff('0x26')},{'key':'scope','value':encodeURIComponent(_0x51fb9e)},{'key':_0x92ff('0x27'),'value':_0xfc4add},{'key':_0x92ff('0x28'),'value':_0x25613e},{'key':_0x92ff('0x29'),'value':_0x92ff('0x2a')}];var _0x165c2e=_0x69084a+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1a9e14,function(_0x42dc4f){return _0x42dc4f[_0x92ff('0x2b')]+'='+_0x42dc4f[_0x92ff('0x2c')];})['join']('&');_0x4bc4c2[_0x92ff('0x2d')]={'issuer':_0x69084a['replace']('oauth2/',''),'audience':_0x4bc4c2[_0x92ff('0x21')],'state':_0xfc4add,'nonce':_0x25613e};redis[_0x92ff('0x2e')](_0xfc4add,JSON['stringify'](_0x4bc4c2));return _0x165c2e;}function isValidIdToken(_0x479ab3,_0x339816){try{var _0x290161=jwt[_0x92ff('0x2f')](_0x479ab3,{'complete':!![]});var _0x64930c=_0x290161[_0x92ff('0x30')];if(_0x64930c[_0x92ff('0x31')]!==_0x339816[_0x92ff('0x32')])return![];if(_0x64930c['aud']!==_0x339816[_0x92ff('0x33')])return![];if(_0x64930c[_0x92ff('0x28')]!==_0x339816[_0x92ff('0x28')])return![];if(moment()['isAfter'](moment['unix'](_0x64930c[_0x92ff('0x34')])))return![];return!![];}catch(_0xd9b0a4){throw _0xd9b0a4;}}function refreshOauth2MicrosoftAccessToken(_0x5cbeab){return Promise[_0x92ff('0x35')]()[_0x92ff('0x36')](function(){if(_0x5cbeab[_0x92ff('0x37')])return _0x5cbeab;return db[_0x92ff('0x38')][_0x92ff('0x39')]({'where':{'id':_0x5cbeab['id']},'raw':!![]});})[_0x92ff('0x36')](function(_0x4b79f6){var _0x4a1844={'grant_type':_0x92ff('0x3a'),'refresh_token':_0x4b79f6[_0x92ff('0x3b')],'scope':getAccessTokenScope(_0x4b79f6),'redirect_uri':_0x4b79f6[_0x92ff('0x24')],'client_id':_0x4b79f6[_0x92ff('0x21')],'client_secret':encryptor[_0x92ff('0x3c')](_0x4b79f6[_0x92ff('0x37')])};var _0x26beaa={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x92ff('0x1a'),_0x4b79f6[_0x92ff('0x3d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4a1844,'json':!![]};return rp(_0x26beaa);})[_0x92ff('0x36')](function(_0x5cf64e){_0x5cbeab[_0x92ff('0x3e')]=_0x5cf64e[_0x92ff('0x3f')];_0x5cbeab[_0x92ff('0x3b')]=_0x5cf64e[_0x92ff('0x3a')];return db[_0x92ff('0x38')][_0x92ff('0x40')]({'data5':_0x5cbeab[_0x92ff('0x3e')],'data6':_0x5cbeab[_0x92ff('0x3b')]},{'where':{'id':_0x5cbeab['id']}});})[_0x92ff('0x36')](function(){return _0x5cbeab;})['catch'](function(_0x6f1519){logger[_0x92ff('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5cbeab['id'],_0x6f1519);});}function getOauth2MicrosoftAccessToken(_0x52bd9d,_0x4aa495){var _0x131958={'grant_type':_0x92ff('0x42'),'code':_0x52bd9d,'scope':getAccessTokenScope(_0x4aa495),'redirect_uri':_0x4aa495[_0x92ff('0x24')],'client_id':_0x4aa495[_0x92ff('0x21')],'client_secret':encryptor['decryptString'](_0x4aa495[_0x92ff('0x37')])};var _0x3143ae={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x92ff('0x19')](_0x92ff('0x1a'),_0x4aa495['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x131958,'json':!![]};return rp(_0x3143ae);}function startRefreshInterval(_0x465f48){var _0x31de2d=schedule[_0x92ff('0x43')];if(_0x31de2d[_0x465f48['id']])clearInterval(_0x31de2d[_0x465f48['id']]);_0x31de2d[_0x465f48['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x465f48['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x92ff('0x43')]=_0x31de2d;}function startAllRefreshIntervals(){return db[_0x92ff('0x38')][_0x92ff('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x1fe337){var _0x22ba55=_0x1fe337[_0x92ff('0x45')](function(_0x12d1b7){return refreshOauth2MicrosoftAccessToken(_0x12d1b7)[_0x92ff('0x36')](function(_0x31ad17){startRefreshInterval(_0x31ad17);});});return Promise[_0x92ff('0x46')](_0x22ba55);})[_0x92ff('0x47')](function(_0x2fd6ab){var _0x4d1cc3=_0x2fd6ab?util[_0x92ff('0x48')](_0x2fd6ab,{'showHidden':![],'depth':null}):'';logger[_0x92ff('0x41')](_0x92ff('0x49'),_0x4d1cc3);});}module[_0x92ff('0x4a')]={'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 4a295d5..ecdff7d 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 _0x0447=['request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','CloudProvider,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x10ead2,_0x43af2c){var _0x104a39=function(_0x22bba2){while(--_0x22bba2){_0x10ead2['push'](_0x10ead2['shift']());}};_0x104a39(++_0x43af2c);}(_0x0447,0x8b));var _0x7044=function(_0xc6489d,_0x27d8d6){_0xc6489d=_0xc6489d-0x0;var _0x53618d=_0x0447[_0xc6489d];return _0x53618d;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var moment=require(_0x7044('0x2'));var BPromise=require(_0x7044('0x3'));var rs=require(_0x7044('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7044('0x5'))['db'];var utils=require(_0x7044('0x6'));var logger=require(_0x7044('0x7'))(_0x7044('0x8'));var config=require(_0x7044('0x9'));var jayson=require(_0x7044('0xa'));var client=jayson[_0x7044('0xb')][_0x7044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x66b8cb,_0x51de50,_0x72d341){return new BPromise(function(_0x42d53b,_0x2a2b36){return client[_0x7044('0xd')](_0x66b8cb,_0x72d341)['then'](function(_0x41616d){logger[_0x7044('0xe')]('CloudProvider,\x20%s,\x20%s',_0x51de50,_0x7044('0xf'));logger[_0x7044('0x10')](_0x7044('0x11'),_0x51de50,_0x7044('0xf'),JSON['stringify'](_0x41616d));if(_0x41616d[_0x7044('0x12')]){if(_0x41616d['error']['code']===0x1f4){logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')][_0x7044('0x14')]);return _0x2a2b36(_0x41616d[_0x7044('0x12')]['message']);}logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')]['message']);return _0x42d53b(_0x41616d['error'][_0x7044('0x14')]);}else{logger[_0x7044('0xe')](_0x7044('0x13'),_0x51de50,_0x7044('0xf'));_0x42d53b(_0x41616d[_0x7044('0x15')][_0x7044('0x14')]);}})['catch'](function(_0xdae8a){logger[_0x7044('0x12')](_0x7044('0x13'),_0x51de50,_0xdae8a);_0x2a2b36(_0xdae8a);});});} \ No newline at end of file +var _0xa064=['stringify','error','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x475bc2,_0x2f46aa){var _0x4d7cd8=function(_0x377776){while(--_0x377776){_0x475bc2['push'](_0x475bc2['shift']());}};_0x4d7cd8(++_0x2f46aa);}(_0xa064,0x192));var _0x4a06=function(_0x150fa2,_0x156632){_0x150fa2=_0x150fa2-0x0;var _0x88e6ba=_0xa064[_0x150fa2];return _0x88e6ba;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var moment=require(_0x4a06('0x2'));var BPromise=require(_0x4a06('0x3'));var rs=require(_0x4a06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a06('0x5'));var logger=require('../../config/logger')(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a06('0x8')][_0x4a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d4e3,_0x3b01cc,_0x454574){return new BPromise(function(_0x4c966b,_0x5e3342){return client[_0x4a06('0xa')](_0x55d4e3,_0x454574)[_0x4a06('0xb')](function(_0x3a8db5){logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));logger[_0x4a06('0xe')](_0x4a06('0xf'),_0x3b01cc,_0x4a06('0xd'),JSON[_0x4a06('0x10')](_0x3a8db5));if(_0x3a8db5[_0x4a06('0x11')]){if(_0x3a8db5[_0x4a06('0x11')]['code']===0x1f4){logger[_0x4a06('0x11')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);return _0x5e3342(_0x3a8db5[_0x4a06('0x11')]['message']);}logger[_0x4a06('0x11')](_0x4a06('0x13'),_0x3b01cc,_0x3a8db5[_0x4a06('0x11')]['message']);return _0x4c966b(_0x3a8db5[_0x4a06('0x11')][_0x4a06('0x12')]);}else{logger[_0x4a06('0xc')]('CloudProvider,\x20%s,\x20%s',_0x3b01cc,_0x4a06('0xd'));_0x4c966b(_0x3a8db5[_0x4a06('0x14')][_0x4a06('0x12')]);}})[_0x4a06('0x15')](function(_0x15b067){logger['error'](_0x4a06('0x13'),_0x3b01cc,_0x15b067);_0x5e3342(_0x15b067);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 107fb33..4e065ac 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x58c34c,_0x20fb1b){var _0x1556bf=function(_0x2fd0ed){while(--_0x2fd0ed){_0x58c34c['push'](_0x58c34c['shift']());}};_0x1556bf(++_0x20fb1b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7a54,0x106));var _0x47a5=function(_0x2a9788,_0x222726){_0x2a9788=_0x2a9788-0x0;var _0x24ec8e=_0x7a54[_0x2a9788];return _0x24ec8e;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e76f6e9..bb8dfac 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 _0xb2c0=['STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2c0,0x1a9));var _0x0b2c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2c0[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x0b2c('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b2c('0x1')],'unique':_0x0b2c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0b2c('0x1')]},'companyId':{'type':Sequelize[_0x0b2c('0x1')]},'website':{'type':Sequelize[_0x0b2c('0x1')]},'phone':{'type':Sequelize[_0x0b2c('0x1')]},'fax':{'type':Sequelize[_0x0b2c('0x1')]},'type':{'type':Sequelize[_0x0b2c('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0b2c('0x1')]},'city':{'type':Sequelize[_0x0b2c('0x1')]},'country':{'type':Sequelize[_0x0b2c('0x1')]},'email':{'type':Sequelize[_0x0b2c('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x0b2c('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0b2c('0x1')]}}; \ No newline at end of file +var _0x55ec=['name','sequelize','exports','STRING'];(function(_0x4b4f70,_0x2f3d27){var _0x35b1d7=function(_0x4d8c79){while(--_0x4d8c79){_0x4b4f70['push'](_0x4b4f70['shift']());}};_0x35b1d7(++_0x2f3d27);}(_0x55ec,0x105));var _0xc55e=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x55ec[_0x4ca333];return _0x13b2e1;};'use strict';var Sequelize=require(_0xc55e('0x0'));module[_0xc55e('0x1')]={'name':{'type':Sequelize[_0xc55e('0x2')],'unique':_0xc55e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc55e('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc55e('0x2')]},'phone':{'type':Sequelize[_0xc55e('0x2')]},'fax':{'type':Sequelize[_0xc55e('0x2')]},'type':{'type':Sequelize[_0xc55e('0x2')]},'street':{'type':Sequelize[_0xc55e('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc55e('0x2')]},'country':{'type':Sequelize[_0xc55e('0x2')]},'email':{'type':Sequelize[_0xc55e('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc55e('0x2')]},'sStreet':{'type':Sequelize[_0xc55e('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc55e('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc55e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index add49c6..d852e7c 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 _0x21d5=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','CmContact','ids','getContacts','sort','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','sendStatus','error','stack','name','CmCompany'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x21d5,0x177));var _0x521d=function(_0x22301d,_0x4dd4bb){_0x22301d=_0x22301d-0x0;var _0x1693ef=_0x21d5[_0x22301d];return _0x1693ef;};'use strict';var emlformat=require(_0x521d('0x0'));var rimraf=require(_0x521d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x521d('0x2'));var rp=require(_0x521d('0x3'));var moment=require(_0x521d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x521d('0x5'));var util=require('util');var path=require(_0x521d('0x6'));var sox=require(_0x521d('0x7'));var csv=require(_0x521d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x521d('0x9'));var _=require(_0x521d('0xa'));var squel=require(_0x521d('0xb'));var crypto=require('crypto');var jsforce=require(_0x521d('0xc'));var deskjs=require(_0x521d('0xd'));var toCsv=require(_0x521d('0x8'));var querystring=require(_0x521d('0xe'));var Papa=require(_0x521d('0xf'));var Redis=require(_0x521d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x521d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x521d('0x12'))(_0x521d('0x13'));var utils=require(_0x521d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x521d('0x15'));var db=require(_0x521d('0x16'))['db'];function respondWithStatusCode(_0x1f9b55,_0x13d23a){_0x13d23a=_0x13d23a||0xcc;return function(_0x50aaf8){if(_0x50aaf8){return _0x1f9b55['sendStatus'](_0x13d23a);}return _0x1f9b55[_0x521d('0x17')](_0x13d23a)['end']();};}function respondWithResult(_0x316459,_0x893a87){_0x893a87=_0x893a87||0xc8;return function(_0x1910c5){if(_0x1910c5){return _0x316459[_0x521d('0x17')](_0x893a87)[_0x521d('0x18')](_0x1910c5);}};}function respondWithFilteredResult(_0x34ead7,_0x1d94e7){return function(_0x2aa214){if(_0x2aa214){var _0x3b5c97=typeof _0x1d94e7[_0x521d('0x19')]==='undefined'&&typeof _0x1d94e7[_0x521d('0x1a')]===_0x521d('0x1b');var _0x1e8566=_0x2aa214['count'];var _0x8ac514=_0x3b5c97?0x0:_0x1d94e7[_0x521d('0x19')];var _0x3a16eb=_0x3b5c97?_0x2aa214[_0x521d('0x1c')]:_0x1d94e7['offset']+_0x1d94e7['limit'];var _0x4346f9;if(_0x3a16eb>=_0x1e8566){_0x3a16eb=_0x1e8566;_0x4346f9=0xc8;}else{_0x4346f9=0xce;}_0x34ead7['status'](_0x4346f9);return _0x34ead7[_0x521d('0x1d')](_0x521d('0x1e'),_0x8ac514+'-'+_0x3a16eb+'/'+_0x1e8566)[_0x521d('0x18')](_0x2aa214);}return null;};}function patchUpdates(_0x2f35e6){return function(_0x3eafae){try{jsonpatch[_0x521d('0x1f')](_0x3eafae,_0x2f35e6,!![]);}catch(_0x333f28){return BPromise[_0x521d('0x20')](_0x333f28);}return _0x3eafae[_0x521d('0x21')]();};}function saveUpdates(_0x14128f,_0x3182fa){return function(_0x8de021){if(_0x8de021){return _0x8de021[_0x521d('0x22')](_0x14128f)[_0x521d('0x23')](function(_0x3ef615){return _0x3ef615;});}return null;};}function removeEntity(_0x14b9a5,_0x5bcf43){return function(_0x29d6e3){if(_0x29d6e3){return _0x29d6e3['destroy']()[_0x521d('0x23')](function(){var _0x34706d=_0x29d6e3[_0x521d('0x24')]({'plain':!![]});var _0x43d421=_0x521d('0x25');return db[_0x521d('0x26')][_0x521d('0x27')]({'where':{'type':_0x43d421,'resourceId':_0x34706d['id']}})[_0x521d('0x23')](function(){return _0x29d6e3;});})[_0x521d('0x23')](function(){_0x14b9a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47bfed,_0x10d7ae){return function(_0x1023c4){if(!_0x1023c4){_0x47bfed[_0x521d('0x28')](0x194);}return _0x1023c4;};}function handleError(_0x5676ea,_0x277e12){_0x277e12=_0x277e12||0x1f4;return function(_0x4b7edd){logger[_0x521d('0x29')](_0x4b7edd[_0x521d('0x2a')]);if(_0x4b7edd[_0x521d('0x2b')]){delete _0x4b7edd[_0x521d('0x2b')];}_0x5676ea['status'](_0x277e12)['send'](_0x4b7edd);};}exports['index']=function(_0x2f45d6,_0x566345){var _0x10813e={},_0x230d08={},_0x4c3023={'count':0x0,'rows':[]};return db[_0x521d('0x2c')]['describe']()[_0x521d('0x23')](function(_0x202f18){_0x230d08[_0x521d('0x2d')]=_[_0x521d('0x2e')](_0x202f18);_0x230d08[_0x521d('0x2f')]=_[_0x521d('0x2e')](_0x2f45d6[_0x521d('0x2f')]);_0x230d08[_0x521d('0x30')]=_[_0x521d('0x31')](_0x230d08['model'],_0x230d08[_0x521d('0x2f')]);_0x10813e['attributes']=_['intersection'](_0x230d08[_0x521d('0x2d')],qs[_0x521d('0x32')](_0x2f45d6[_0x521d('0x2f')][_0x521d('0x32')]));_0x10813e[_0x521d('0x33')]=_0x10813e[_0x521d('0x33')][_0x521d('0x34')]?_0x10813e['attributes']:_0x230d08[_0x521d('0x2d')];if(!_0x2f45d6[_0x521d('0x2f')][_0x521d('0x35')](_0x521d('0x36'))){_0x10813e['limit']=qs['limit'](_0x2f45d6[_0x521d('0x2f')][_0x521d('0x1a')]);_0x10813e['offset']=qs['offset'](_0x2f45d6['query'][_0x521d('0x19')]);}_0x10813e[_0x521d('0x37')]=qs['sort'](_0x2f45d6[_0x521d('0x2f')]['sort']);_0x10813e['where']=qs[_0x521d('0x30')](_[_0x521d('0x38')](_0x2f45d6['query'],_0x230d08[_0x521d('0x30')]),_0x202f18);if(_0x2f45d6['query'][_0x521d('0x39')]){_0x10813e[_0x521d('0x3a')]=_[_0x521d('0x3b')](_0x10813e[_0x521d('0x3a')],{'$or':_[_0x521d('0x3c')](_0x10813e['attributes'],function(_0x10e0bf){var _0x24bed0={};_0x24bed0[_0x10e0bf]={'$like':'%'+_0x2f45d6[_0x521d('0x2f')][_0x521d('0x39')]+'%'};return _0x24bed0;})});}_0x10813e=_[_0x521d('0x3b')]({},_0x10813e,_0x2f45d6['options']);var _0x373e2f={'where':_0x10813e[_0x521d('0x3a')]};return db[_0x521d('0x2c')][_0x521d('0x1c')](_0x373e2f)[_0x521d('0x23')](function(_0x15fea7){_0x4c3023[_0x521d('0x1c')]=_0x15fea7;if(_0x2f45d6[_0x521d('0x2f')][_0x521d('0x3d')]){_0x10813e['include']=[{'all':!![]}];}return db[_0x521d('0x2c')]['findAll'](_0x10813e);})['then'](function(_0x4b2ac5){_0x4c3023[_0x521d('0x3e')]=_0x4b2ac5;return _0x4c3023;})[_0x521d('0x23')](respondWithFilteredResult(_0x566345,_0x10813e))['catch'](handleError(_0x566345,null));})[_0x521d('0x3f')](handleError(_0x566345,null));};exports[_0x521d('0x40')]=function(_0x2b8090,_0x1f604d){var _0x2192a5={'raw':![],'where':{'id':_0x2b8090[_0x521d('0x41')]['id']}},_0x2670f9={};_0x2670f9['model']=_['keys'](db[_0x521d('0x2c')][_0x521d('0x42')]);_0x2670f9[_0x521d('0x2f')]=_[_0x521d('0x2e')](_0x2b8090['query']);_0x2670f9[_0x521d('0x30')]=_[_0x521d('0x31')](_0x2670f9[_0x521d('0x2d')],_0x2670f9['query']);_0x2192a5['attributes']=_[_0x521d('0x31')](_0x2670f9[_0x521d('0x2d')],qs[_0x521d('0x32')](_0x2b8090['query']['fields']));_0x2192a5[_0x521d('0x33')]=_0x2192a5[_0x521d('0x33')][_0x521d('0x34')]?_0x2192a5['attributes']:_0x2670f9[_0x521d('0x2d')];if(_0x2b8090[_0x521d('0x2f')][_0x521d('0x3d')]){_0x2192a5[_0x521d('0x43')]=[{'all':!![]}];}_0x2192a5=_[_0x521d('0x3b')]({},_0x2192a5,_0x2b8090[_0x521d('0x44')]);return db[_0x521d('0x2c')][_0x521d('0x45')](_0x2192a5)[_0x521d('0x23')](handleEntityNotFound(_0x1f604d,null))[_0x521d('0x23')](respondWithResult(_0x1f604d,null))['catch'](handleError(_0x1f604d,null));};exports[_0x521d('0x46')]=function(_0x2ff213,_0x2f2496){return db[_0x521d('0x2c')][_0x521d('0x46')](_0x2ff213['body'],{})[_0x521d('0x23')](function(_0x3300ab){var _0x15dc41=_0x2ff213[_0x521d('0x47')]['get']({'plain':!![]});if(!_0x15dc41)throw new Error(_0x521d('0x48'));if(_0x15dc41[_0x521d('0x49')]==='user'){var _0x5580db=_0x3300ab[_0x521d('0x24')]({'plain':!![]});var _0xddde89='Companies';return db[_0x521d('0x4a')]['find']({'where':{'name':_0xddde89,'userProfileId':_0x15dc41[_0x521d('0x4b')]},'raw':!![]})['then'](function(_0x599e6d){if(_0x599e6d&&_0x599e6d[_0x521d('0x4c')]===0x0){return db[_0x521d('0x26')][_0x521d('0x46')]({'name':_0x5580db[_0x521d('0x2b')],'resourceId':_0x5580db['id'],'type':_0x599e6d['name'],'sectionId':_0x599e6d['id']},{})[_0x521d('0x23')](function(){return _0x3300ab;});}else{return _0x3300ab;}})[_0x521d('0x3f')](function(_0x583a7a){logger[_0x521d('0x29')](_0x521d('0x4d'),_0x583a7a);throw _0x583a7a;});}return _0x3300ab;})[_0x521d('0x23')](respondWithResult(_0x2f2496,0xc9))[_0x521d('0x3f')](handleError(_0x2f2496,null));};exports[_0x521d('0x22')]=function(_0x3bfc7a,_0x393aeb){if(_0x3bfc7a[_0x521d('0x4e')]['id']){delete _0x3bfc7a[_0x521d('0x4e')]['id'];}return db[_0x521d('0x2c')][_0x521d('0x45')]({'where':{'id':_0x3bfc7a[_0x521d('0x41')]['id']}})[_0x521d('0x23')](handleEntityNotFound(_0x393aeb,null))[_0x521d('0x23')](saveUpdates(_0x3bfc7a[_0x521d('0x4e')],null))[_0x521d('0x23')](respondWithResult(_0x393aeb,null))[_0x521d('0x3f')](handleError(_0x393aeb,null));};exports[_0x521d('0x27')]=function(_0x107b50,_0x54fe11){return db[_0x521d('0x2c')][_0x521d('0x45')]({'where':{'id':_0x107b50[_0x521d('0x41')]['id']}})[_0x521d('0x23')](handleEntityNotFound(_0x54fe11,null))[_0x521d('0x23')](removeEntity(_0x54fe11,null))['catch'](handleError(_0x54fe11,null));};exports[_0x521d('0x4f')]=function(_0x26df33,_0x453b50){return db[_0x521d('0x2c')]['describe']()[_0x521d('0x23')](respondWithResult(_0x453b50,null))[_0x521d('0x3f')](handleError(_0x453b50,null));};exports['addContacts']=function(_0x329931,_0x44db96,_0x597bce){return db[_0x521d('0x50')][_0x521d('0x45')]({'where':{'id':_0x329931['params']['id']}})[_0x521d('0x23')](handleEntityNotFound(_0x44db96,null))[_0x521d('0x23')](function(_0x3fd170){if(_0x3fd170){return _0x3fd170['addContacts'](_0x329931['body'][_0x521d('0x51')],_['omit'](_0x329931['body'],[_0x521d('0x51'),'id'])||{});}})[_0x521d('0x23')](respondWithResult(_0x44db96,null))[_0x521d('0x3f')](handleError(_0x44db96,null));};exports[_0x521d('0x52')]=function(_0x8ed452,_0x133337,_0x5397e9){var _0x8e9ac={};var _0x59bd3d={};var _0x4a593e;var _0x4f6585;return db[_0x521d('0x2c')]['findOne']({'where':{'id':_0x8ed452[_0x521d('0x41')]['id']}})[_0x521d('0x23')](handleEntityNotFound(_0x133337,null))[_0x521d('0x23')](function(_0xaf7b84){if(_0xaf7b84){_0x4a593e=_0xaf7b84;_0x59bd3d['model']=_[_0x521d('0x2e')](db[_0x521d('0x50')][_0x521d('0x42')]);_0x59bd3d['query']=_['keys'](_0x8ed452['query']);_0x59bd3d[_0x521d('0x30')]=_[_0x521d('0x31')](_0x59bd3d[_0x521d('0x2d')],_0x59bd3d[_0x521d('0x2f')]);_0x8e9ac[_0x521d('0x33')]=_[_0x521d('0x31')](_0x59bd3d[_0x521d('0x2d')],qs[_0x521d('0x32')](_0x8ed452['query']['fields']));_0x8e9ac['attributes']=_0x8e9ac[_0x521d('0x33')][_0x521d('0x34')]?_0x8e9ac[_0x521d('0x33')]:_0x59bd3d[_0x521d('0x2d')];_0x8e9ac[_0x521d('0x37')]=qs[_0x521d('0x53')](_0x8ed452['query']['sort']);_0x8e9ac[_0x521d('0x3a')]=qs[_0x521d('0x30')](_[_0x521d('0x38')](_0x8ed452[_0x521d('0x2f')],_0x59bd3d[_0x521d('0x30')]));if(_0x8ed452[_0x521d('0x2f')][_0x521d('0x39')]){_0x8e9ac[_0x521d('0x3a')]=_[_0x521d('0x3b')](_0x8e9ac[_0x521d('0x3a')],{'$or':_[_0x521d('0x3c')](_0x8e9ac[_0x521d('0x33')],function(_0x5ab133){var _0x3190de={};_0x3190de[_0x5ab133]={'$like':'%'+_0x8ed452[_0x521d('0x2f')][_0x521d('0x39')]+'%'};return _0x3190de;})});}_0x8e9ac=_[_0x521d('0x3b')]({},_0x8e9ac,_0x8ed452[_0x521d('0x44')]);return _0x4a593e[_0x521d('0x52')](_0x8e9ac);}})[_0x521d('0x23')](function(_0x235c2f){if(_0x235c2f){_0x4f6585=_0x235c2f[_0x521d('0x34')];if(!_0x8ed452[_0x521d('0x2f')][_0x521d('0x35')](_0x521d('0x36'))){_0x8e9ac[_0x521d('0x1a')]=qs['limit'](_0x8ed452[_0x521d('0x2f')][_0x521d('0x1a')]);_0x8e9ac[_0x521d('0x19')]=qs[_0x521d('0x19')](_0x8ed452[_0x521d('0x2f')]['offset']);}return _0x4a593e['getContacts'](_0x8e9ac);}})[_0x521d('0x23')](function(_0xa930b4){if(_0xa930b4){return _0xa930b4?{'count':_0x4f6585,'rows':_0xa930b4}:null;}})[_0x521d('0x23')](respondWithResult(_0x133337,null))['catch'](handleError(_0x133337,null));}; \ No newline at end of file +var _0xf367=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','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','end'];(function(_0x390cde,_0x297f4a){var _0x13152e=function(_0x52e860){while(--_0x52e860){_0x390cde['push'](_0x390cde['shift']());}};_0x13152e(++_0x297f4a);}(_0xf367,0xf6));var _0x7f36=function(_0x39690b,_0x41a11b){_0x39690b=_0x39690b-0x0;var _0x133a33=_0xf367[_0x39690b];return _0x133a33;};'use strict';var emlformat=require(_0x7f36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f36('0x1'));var jsonpatch=require(_0x7f36('0x2'));var rp=require(_0x7f36('0x3'));var moment=require(_0x7f36('0x4'));var BPromise=require(_0x7f36('0x5'));var Mustache=require(_0x7f36('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7f36('0x7'));var csv=require('to-csv');var ejs=require(_0x7f36('0x8'));var fs=require('fs');var fs_extra=require(_0x7f36('0x9'));var _=require(_0x7f36('0xa'));var squel=require('squel');var crypto=require(_0x7f36('0xb'));var jsforce=require(_0x7f36('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7f36('0xd'));var querystring=require(_0x7f36('0xe'));var Papa=require(_0x7f36('0xf'));var Redis=require('ioredis');var authService=require(_0x7f36('0x10'));var qs=require(_0x7f36('0x11'));var as=require(_0x7f36('0x12'));var hardwareService=require(_0x7f36('0x13'));var logger=require(_0x7f36('0x14'))(_0x7f36('0x15'));var utils=require(_0x7f36('0x16'));var config=require(_0x7f36('0x17'));var licenseUtil=require(_0x7f36('0x18'));var db=require(_0x7f36('0x19'))['db'];function respondWithStatusCode(_0x48e1bf,_0x2438b8){_0x2438b8=_0x2438b8||0xcc;return function(_0x151527){if(_0x151527){return _0x48e1bf['sendStatus'](_0x2438b8);}return _0x48e1bf['status'](_0x2438b8)[_0x7f36('0x1a')]();};}function respondWithResult(_0x5a936d,_0x16a228){_0x16a228=_0x16a228||0xc8;return function(_0x21a281){if(_0x21a281){return _0x5a936d[_0x7f36('0x1b')](_0x16a228)[_0x7f36('0x1c')](_0x21a281);}};}function respondWithFilteredResult(_0x1cd57c,_0x9aaf17){return function(_0x233e89){if(_0x233e89){var _0x16e6c9=typeof _0x9aaf17[_0x7f36('0x1d')]===_0x7f36('0x1e')&&typeof _0x9aaf17[_0x7f36('0x1f')]===_0x7f36('0x1e');var _0x2c0559=_0x233e89[_0x7f36('0x20')];var _0x44fa40=_0x16e6c9?0x0:_0x9aaf17['offset'];var _0x5f2752=_0x16e6c9?_0x233e89[_0x7f36('0x20')]:_0x9aaf17[_0x7f36('0x1d')]+_0x9aaf17[_0x7f36('0x1f')];var _0x48ea86;if(_0x5f2752>=_0x2c0559){_0x5f2752=_0x2c0559;_0x48ea86=0xc8;}else{_0x48ea86=0xce;}_0x1cd57c[_0x7f36('0x1b')](_0x48ea86);return _0x1cd57c[_0x7f36('0x21')](_0x7f36('0x22'),_0x44fa40+'-'+_0x5f2752+'/'+_0x2c0559)[_0x7f36('0x1c')](_0x233e89);}return null;};}function patchUpdates(_0x404150){return function(_0x563a93){try{jsonpatch[_0x7f36('0x23')](_0x563a93,_0x404150,!![]);}catch(_0x574e5f){return BPromise[_0x7f36('0x24')](_0x574e5f);}return _0x563a93[_0x7f36('0x25')]();};}function saveUpdates(_0x40750,_0x47d617){return function(_0x41ac44){if(_0x41ac44){return _0x41ac44[_0x7f36('0x26')](_0x40750)[_0x7f36('0x27')](function(_0x595914){return _0x595914;});}return null;};}function removeEntity(_0x1fe859,_0x5836a2){return function(_0xb76df3){if(_0xb76df3){return _0xb76df3[_0x7f36('0x28')]()['then'](function(){var _0x586faf=_0xb76df3[_0x7f36('0x29')]({'plain':!![]});var _0xcd7da4=_0x7f36('0x2a');return db['UserProfileResource'][_0x7f36('0x28')]({'where':{'type':_0xcd7da4,'resourceId':_0x586faf['id']}})[_0x7f36('0x27')](function(){return _0xb76df3;});})['then'](function(){_0x1fe859[_0x7f36('0x1b')](0xcc)[_0x7f36('0x1a')]();});}};}function handleEntityNotFound(_0x5e03eb,_0x391d16){return function(_0x4cd507){if(!_0x4cd507){_0x5e03eb['sendStatus'](0x194);}return _0x4cd507;};}function handleError(_0x1f8540,_0x3fc43d){_0x3fc43d=_0x3fc43d||0x1f4;return function(_0x478d73){logger[_0x7f36('0x2b')](_0x478d73[_0x7f36('0x2c')]);if(_0x478d73[_0x7f36('0x2d')]){delete _0x478d73[_0x7f36('0x2d')];}_0x1f8540[_0x7f36('0x1b')](_0x3fc43d)[_0x7f36('0x2e')](_0x478d73);};}exports[_0x7f36('0x2f')]=function(_0x1a30c0,_0x2b7262){var _0x222a14={},_0x4c9877={},_0x38bd65={'count':0x0,'rows':[]};return db[_0x7f36('0x30')]['describe']()['then'](function(_0x233578){_0x4c9877[_0x7f36('0x31')]=_[_0x7f36('0x32')](_0x233578);_0x4c9877['query']=_['keys'](_0x1a30c0[_0x7f36('0x33')]);_0x4c9877[_0x7f36('0x34')]=_[_0x7f36('0x35')](_0x4c9877[_0x7f36('0x31')],_0x4c9877[_0x7f36('0x33')]);_0x222a14[_0x7f36('0x36')]=_[_0x7f36('0x35')](_0x4c9877[_0x7f36('0x31')],qs['fields'](_0x1a30c0['query'][_0x7f36('0x37')]));_0x222a14['attributes']=_0x222a14[_0x7f36('0x36')][_0x7f36('0x38')]?_0x222a14[_0x7f36('0x36')]:_0x4c9877['model'];if(!_0x1a30c0[_0x7f36('0x33')][_0x7f36('0x39')](_0x7f36('0x3a'))){_0x222a14[_0x7f36('0x1f')]=qs[_0x7f36('0x1f')](_0x1a30c0[_0x7f36('0x33')][_0x7f36('0x1f')]);_0x222a14[_0x7f36('0x1d')]=qs[_0x7f36('0x1d')](_0x1a30c0[_0x7f36('0x33')][_0x7f36('0x1d')]);}_0x222a14[_0x7f36('0x3b')]=qs[_0x7f36('0x3c')](_0x1a30c0[_0x7f36('0x33')][_0x7f36('0x3c')]);_0x222a14[_0x7f36('0x3d')]=qs['filters'](_[_0x7f36('0x3e')](_0x1a30c0['query'],_0x4c9877['filters']),_0x233578);if(_0x1a30c0[_0x7f36('0x33')][_0x7f36('0x3f')]){_0x222a14[_0x7f36('0x3d')]=_[_0x7f36('0x40')](_0x222a14[_0x7f36('0x3d')],{'$or':_[_0x7f36('0x41')](_0x222a14['attributes'],function(_0x4b368f){var _0x3738b1={};_0x3738b1[_0x4b368f]={'$like':'%'+_0x1a30c0[_0x7f36('0x33')][_0x7f36('0x3f')]+'%'};return _0x3738b1;})});}_0x222a14=_[_0x7f36('0x40')]({},_0x222a14,_0x1a30c0[_0x7f36('0x42')]);var _0x4091e2={'where':_0x222a14['where']};return db[_0x7f36('0x30')][_0x7f36('0x20')](_0x4091e2)[_0x7f36('0x27')](function(_0xd43271){_0x38bd65[_0x7f36('0x20')]=_0xd43271;if(_0x1a30c0[_0x7f36('0x33')][_0x7f36('0x43')]){_0x222a14[_0x7f36('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0x7f36('0x45')](_0x222a14);})[_0x7f36('0x27')](function(_0x73b9e5){_0x38bd65['rows']=_0x73b9e5;return _0x38bd65;})[_0x7f36('0x27')](respondWithFilteredResult(_0x2b7262,_0x222a14))[_0x7f36('0x46')](handleError(_0x2b7262,null));})[_0x7f36('0x46')](handleError(_0x2b7262,null));};exports[_0x7f36('0x47')]=function(_0x5241ac,_0x41a888){var _0xdef808={'raw':![],'where':{'id':_0x5241ac[_0x7f36('0x48')]['id']}},_0x37436b={};_0x37436b[_0x7f36('0x31')]=_[_0x7f36('0x32')](db[_0x7f36('0x30')][_0x7f36('0x49')]);_0x37436b['query']=_[_0x7f36('0x32')](_0x5241ac[_0x7f36('0x33')]);_0x37436b[_0x7f36('0x34')]=_[_0x7f36('0x35')](_0x37436b[_0x7f36('0x31')],_0x37436b[_0x7f36('0x33')]);_0xdef808[_0x7f36('0x36')]=_[_0x7f36('0x35')](_0x37436b[_0x7f36('0x31')],qs['fields'](_0x5241ac[_0x7f36('0x33')]['fields']));_0xdef808[_0x7f36('0x36')]=_0xdef808['attributes'][_0x7f36('0x38')]?_0xdef808[_0x7f36('0x36')]:_0x37436b[_0x7f36('0x31')];if(_0x5241ac[_0x7f36('0x33')][_0x7f36('0x43')]){_0xdef808[_0x7f36('0x44')]=[{'all':!![]}];}_0xdef808=_['merge']({},_0xdef808,_0x5241ac[_0x7f36('0x42')]);return db[_0x7f36('0x30')][_0x7f36('0x4a')](_0xdef808)[_0x7f36('0x27')](handleEntityNotFound(_0x41a888,null))[_0x7f36('0x27')](respondWithResult(_0x41a888,null))[_0x7f36('0x46')](handleError(_0x41a888,null));};exports['create']=function(_0x20b44c,_0x838bc){return db[_0x7f36('0x30')][_0x7f36('0x4b')](_0x20b44c[_0x7f36('0x4c')],{})[_0x7f36('0x27')](function(_0x56bb1f){var _0xa1f20d=_0x20b44c[_0x7f36('0x4d')][_0x7f36('0x29')]({'plain':!![]});if(!_0xa1f20d)throw new Error(_0x7f36('0x4e'));if(_0xa1f20d[_0x7f36('0x4f')]===_0x7f36('0x4d')){var _0x2bf45e=_0x56bb1f['get']({'plain':!![]});var _0x44684a='Companies';return db['UserProfileSection'][_0x7f36('0x4a')]({'where':{'name':_0x44684a,'userProfileId':_0xa1f20d[_0x7f36('0x50')]},'raw':!![]})['then'](function(_0x556eae){if(_0x556eae&&_0x556eae[_0x7f36('0x51')]===0x0){return db[_0x7f36('0x52')][_0x7f36('0x4b')]({'name':_0x2bf45e['name'],'resourceId':_0x2bf45e['id'],'type':_0x556eae[_0x7f36('0x2d')],'sectionId':_0x556eae['id']},{})[_0x7f36('0x27')](function(){return _0x56bb1f;});}else{return _0x56bb1f;}})[_0x7f36('0x46')](function(_0x51cc3e){logger[_0x7f36('0x2b')](_0x7f36('0x53'),_0x51cc3e);throw _0x51cc3e;});}return _0x56bb1f;})[_0x7f36('0x27')](respondWithResult(_0x838bc,0xc9))[_0x7f36('0x46')](handleError(_0x838bc,null));};exports[_0x7f36('0x26')]=function(_0x398daa,_0x3365f1){if(_0x398daa[_0x7f36('0x4c')]['id']){delete _0x398daa[_0x7f36('0x4c')]['id'];}return db['CmCompany'][_0x7f36('0x4a')]({'where':{'id':_0x398daa[_0x7f36('0x48')]['id']}})[_0x7f36('0x27')](handleEntityNotFound(_0x3365f1,null))[_0x7f36('0x27')](saveUpdates(_0x398daa['body'],null))[_0x7f36('0x27')](respondWithResult(_0x3365f1,null))[_0x7f36('0x46')](handleError(_0x3365f1,null));};exports[_0x7f36('0x28')]=function(_0x4882c5,_0x5e2787){return db[_0x7f36('0x30')]['find']({'where':{'id':_0x4882c5[_0x7f36('0x48')]['id']}})[_0x7f36('0x27')](handleEntityNotFound(_0x5e2787,null))[_0x7f36('0x27')](removeEntity(_0x5e2787,null))[_0x7f36('0x46')](handleError(_0x5e2787,null));};exports[_0x7f36('0x54')]=function(_0x1450db,_0x42b1c9){return db[_0x7f36('0x30')][_0x7f36('0x54')]()[_0x7f36('0x27')](respondWithResult(_0x42b1c9,null))['catch'](handleError(_0x42b1c9,null));};exports[_0x7f36('0x55')]=function(_0x1578a7,_0x2ffa86,_0x3379a1){return db['CmContact'][_0x7f36('0x4a')]({'where':{'id':_0x1578a7[_0x7f36('0x48')]['id']}})[_0x7f36('0x27')](handleEntityNotFound(_0x2ffa86,null))[_0x7f36('0x27')](function(_0x3e8f65){if(_0x3e8f65){return _0x3e8f65[_0x7f36('0x55')](_0x1578a7['body']['ids'],_[_0x7f36('0x56')](_0x1578a7[_0x7f36('0x4c')],[_0x7f36('0x57'),'id'])||{});}})[_0x7f36('0x27')](respondWithResult(_0x2ffa86,null))[_0x7f36('0x46')](handleError(_0x2ffa86,null));};exports[_0x7f36('0x58')]=function(_0x110864,_0x21d224,_0x8ca8a4){var _0x3bc324={};var _0x435def={};var _0x744480;var _0x8c055;return db[_0x7f36('0x30')][_0x7f36('0x59')]({'where':{'id':_0x110864[_0x7f36('0x48')]['id']}})[_0x7f36('0x27')](handleEntityNotFound(_0x21d224,null))[_0x7f36('0x27')](function(_0x172eeb){if(_0x172eeb){_0x744480=_0x172eeb;_0x435def[_0x7f36('0x31')]=_[_0x7f36('0x32')](db[_0x7f36('0x5a')][_0x7f36('0x49')]);_0x435def['query']=_[_0x7f36('0x32')](_0x110864['query']);_0x435def[_0x7f36('0x34')]=_[_0x7f36('0x35')](_0x435def[_0x7f36('0x31')],_0x435def[_0x7f36('0x33')]);_0x3bc324[_0x7f36('0x36')]=_[_0x7f36('0x35')](_0x435def[_0x7f36('0x31')],qs[_0x7f36('0x37')](_0x110864[_0x7f36('0x33')][_0x7f36('0x37')]));_0x3bc324[_0x7f36('0x36')]=_0x3bc324[_0x7f36('0x36')]['length']?_0x3bc324['attributes']:_0x435def[_0x7f36('0x31')];_0x3bc324[_0x7f36('0x3b')]=qs[_0x7f36('0x3c')](_0x110864['query'][_0x7f36('0x3c')]);_0x3bc324['where']=qs[_0x7f36('0x34')](_['pick'](_0x110864['query'],_0x435def['filters']));if(_0x110864['query']['filter']){_0x3bc324[_0x7f36('0x3d')]=_[_0x7f36('0x40')](_0x3bc324['where'],{'$or':_[_0x7f36('0x41')](_0x3bc324[_0x7f36('0x36')],function(_0x456093){var _0x414d4e={};_0x414d4e[_0x456093]={'$like':'%'+_0x110864[_0x7f36('0x33')][_0x7f36('0x3f')]+'%'};return _0x414d4e;})});}_0x3bc324=_['merge']({},_0x3bc324,_0x110864[_0x7f36('0x42')]);return _0x744480['getContacts'](_0x3bc324);}})[_0x7f36('0x27')](function(_0x57d793){if(_0x57d793){_0x8c055=_0x57d793['length'];if(!_0x110864[_0x7f36('0x33')]['hasOwnProperty'](_0x7f36('0x3a'))){_0x3bc324[_0x7f36('0x1f')]=qs['limit'](_0x110864[_0x7f36('0x33')]['limit']);_0x3bc324['offset']=qs[_0x7f36('0x1d')](_0x110864[_0x7f36('0x33')][_0x7f36('0x1d')]);}return _0x744480[_0x7f36('0x58')](_0x3bc324);}})['then'](function(_0x9e5529){if(_0x9e5529){return _0x9e5529?{'count':_0x8c055,'rows':_0x9e5529}:null;}})['then'](respondWithResult(_0x21d224,null))[_0x7f36('0x46')](handleError(_0x21d224,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index da8c55d..c7edbaa 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 _0xad90=['CmCompany','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','define'];(function(_0x4e0359,_0x205155){var _0x450f0a=function(_0x2056c6){while(--_0x2056c6){_0x4e0359['push'](_0x4e0359['shift']());}};_0x450f0a(++_0x205155);}(_0xad90,0x1d5));var _0x0ad9=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xad90[_0x42f009];return _0x22a1e0;};'use strict';var _=require('lodash');var util=require(_0x0ad9('0x0'));var logger=require(_0x0ad9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0ad9('0x2'));var rp=require(_0x0ad9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ad9('0x4'));var config=require(_0x0ad9('0x5'));var attributes=require(_0x0ad9('0x6'));module['exports']=function(_0x2e9576,_0x4a666f){return _0x2e9576[_0x0ad9('0x7')](_0x0ad9('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe485=['define','CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x312c1c,_0x161d31){var _0x801c3b=function(_0x41a100){while(--_0x41a100){_0x312c1c['push'](_0x312c1c['shift']());}};_0x801c3b(++_0x161d31);}(_0xe485,0x129));var _0x5e48=function(_0xc2bef7,_0x50a8c5){_0xc2bef7=_0xc2bef7-0x0;var _0x55238a=_0xe485[_0xc2bef7];return _0x55238a;};'use strict';var _=require(_0x5e48('0x0'));var util=require(_0x5e48('0x1'));var logger=require('../../config/logger')(_0x5e48('0x2'));var moment=require(_0x5e48('0x3'));var BPromise=require(_0x5e48('0x4'));var rp=require(_0x5e48('0x5'));var fs=require('fs');var path=require(_0x5e48('0x6'));var rimraf=require(_0x5e48('0x7'));var config=require(_0x5e48('0x8'));var attributes=require(_0x5e48('0x9'));module[_0x5e48('0xa')]=function(_0x552c37,_0x5030c1){return _0x552c37[_0x5e48('0xb')](_0x5e48('0xc'),attributes,{'tableName':_0x5e48('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 47afafd..f6b760e 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 _0x1862=['then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1862,0x186));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2186('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2186('0x1'));var db=require(_0x2186('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2186('0x3'));var config=require(_0x2186('0x4'));var jayson=require(_0x2186('0x5'));var client=jayson[_0x2186('0x6')][_0x2186('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54ae55,_0x3c8f4d,_0x4e7a79){return new BPromise(function(_0x4be4fe,_0x2ed797){return client[_0x2186('0x8')](_0x54ae55,_0x4e7a79)[_0x2186('0x9')](function(_0x58a78d){logger[_0x2186('0xa')](_0x2186('0xb'),_0x3c8f4d,'request\x20sent');logger[_0x2186('0xc')](_0x2186('0xd'),_0x3c8f4d,_0x2186('0xe'),JSON[_0x2186('0xf')](_0x58a78d));if(_0x58a78d[_0x2186('0x10')]){if(_0x58a78d['error'][_0x2186('0x11')]===0x1f4){logger[_0x2186('0x10')]('CmCompany,\x20%s,\x20%s',_0x3c8f4d,_0x58a78d[_0x2186('0x10')][_0x2186('0x12')]);return _0x2ed797(_0x58a78d['error'][_0x2186('0x12')]);}logger[_0x2186('0x10')](_0x2186('0xb'),_0x3c8f4d,_0x58a78d[_0x2186('0x10')]['message']);return _0x4be4fe(_0x58a78d[_0x2186('0x10')][_0x2186('0x12')]);}else{logger[_0x2186('0xa')]('CmCompany,\x20%s,\x20%s',_0x3c8f4d,_0x2186('0xe'));_0x4be4fe(_0x58a78d['result']['message']);}})['catch'](function(_0x3c66b3){logger[_0x2186('0x10')](_0x2186('0xb'),_0x3c8f4d,_0x3c66b3);_0x2ed797(_0x3c66b3);});});} \ No newline at end of file +var _0xf484=['http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf484,0x8f));var _0x4f48=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf484[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x4f48('0x0'));var util=require('util');var moment=require(_0x4f48('0x1'));var BPromise=require(_0x4f48('0x2'));var rs=require(_0x4f48('0x3'));var fs=require('fs');var Redis=require(_0x4f48('0x4'));var db=require(_0x4f48('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f48('0x6'))(_0x4f48('0x7'));var config=require(_0x4f48('0x8'));var jayson=require(_0x4f48('0x9'));var client=jayson[_0x4f48('0xa')][_0x4f48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x278d35,_0x2b781b,_0x22fe68){return new BPromise(function(_0x4062d4,_0x39a8b0){return client['request'](_0x278d35,_0x22fe68)[_0x4f48('0xc')](function(_0x37af83){logger[_0x4f48('0xd')](_0x4f48('0xe'),_0x2b781b,_0x4f48('0xf'));logger[_0x4f48('0x10')](_0x4f48('0x11'),_0x2b781b,_0x4f48('0xf'),JSON[_0x4f48('0x12')](_0x37af83));if(_0x37af83['error']){if(_0x37af83[_0x4f48('0x13')]['code']===0x1f4){logger[_0x4f48('0x13')](_0x4f48('0xe'),_0x2b781b,_0x37af83[_0x4f48('0x13')]['message']);return _0x39a8b0(_0x37af83[_0x4f48('0x13')]['message']);}logger[_0x4f48('0x13')](_0x4f48('0xe'),_0x2b781b,_0x37af83['error'][_0x4f48('0x14')]);return _0x4062d4(_0x37af83[_0x4f48('0x13')][_0x4f48('0x14')]);}else{logger['info'](_0x4f48('0xe'),_0x2b781b,'request\x20sent');_0x4062d4(_0x37af83['result'][_0x4f48('0x14')]);}})[_0x4f48('0x15')](function(_0x520cb3){logger[_0x4f48('0x13')](_0x4f48('0xe'),_0x2b781b,_0x520cb3);_0x39a8b0(_0x520cb3);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b0a9ab1..f11ab11 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 _0x521e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id/contacts','getContacts','post','create','addContacts','put','/:id','exports','util','path','connect-timeout'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x521e,0x162));var _0xe521=function(_0x9086c8,_0x59e22c){_0x9086c8=_0x9086c8-0x0;var _0x6ba2b9=_0x521e[_0x9086c8];return _0x6ba2b9;};'use strict';var multer=require('multer');var util=require(_0xe521('0x0'));var path=require(_0xe521('0x1'));var timeout=require(_0xe521('0x2'));var express=require(_0xe521('0x3'));var router=express[_0xe521('0x4')]();var fs_extra=require(_0xe521('0x5'));var auth=require(_0xe521('0x6'));var interaction=require(_0xe521('0x7'));var config=require(_0xe521('0x8'));var controller=require('./cmCompany.controller');router[_0xe521('0x9')]('/',auth['isAuthenticated'](),controller[_0xe521('0xa')]);router[_0xe521('0x9')]('/describe',auth[_0xe521('0xb')](),controller[_0xe521('0xc')]);router[_0xe521('0x9')]('/:id',auth[_0xe521('0xb')](),controller['show']);router[_0xe521('0x9')](_0xe521('0xd'),auth[_0xe521('0xb')](),controller[_0xe521('0xe')]);router[_0xe521('0xf')]('/',auth[_0xe521('0xb')](),controller[_0xe521('0x10')]);router['post'](_0xe521('0xd'),auth[_0xe521('0xb')](),controller[_0xe521('0x11')]);router[_0xe521('0x12')](_0xe521('0x13'),auth[_0xe521('0xb')](),controller['update']);router['delete'](_0xe521('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xe521('0x14')]=router; \ No newline at end of file +var _0xf2bb=['post','create','/:id/contacts','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2da654,_0x5c922e){var _0x344237=function(_0x2ce930){while(--_0x2ce930){_0x2da654['push'](_0x2da654['shift']());}};_0x344237(++_0x5c922e);}(_0xf2bb,0x126));var _0xbf2b=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xf2bb[_0x2d89ce];return _0x3fad10;};'use strict';var multer=require(_0xbf2b('0x0'));var util=require(_0xbf2b('0x1'));var path=require(_0xbf2b('0x2'));var timeout=require(_0xbf2b('0x3'));var express=require(_0xbf2b('0x4'));var router=express[_0xbf2b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf2b('0x6'));var controller=require(_0xbf2b('0x7'));router[_0xbf2b('0x8')]('/',auth[_0xbf2b('0x9')](),controller[_0xbf2b('0xa')]);router[_0xbf2b('0x8')](_0xbf2b('0xb'),auth[_0xbf2b('0x9')](),controller[_0xbf2b('0xc')]);router[_0xbf2b('0x8')](_0xbf2b('0xd'),auth[_0xbf2b('0x9')](),controller['show']);router[_0xbf2b('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xbf2b('0xe')]('/',auth['isAuthenticated'](),controller[_0xbf2b('0xf')]);router[_0xbf2b('0xe')](_0xbf2b('0x10'),auth['isAuthenticated'](),controller[_0xbf2b('0x11')]);router[_0xbf2b('0x12')](_0xbf2b('0xd'),auth[_0xbf2b('0x9')](),controller['update']);router[_0xbf2b('0x13')](_0xbf2b('0xd'),auth[_0xbf2b('0x9')](),controller[_0xbf2b('0x14')]);module[_0xbf2b('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index e0ae570..eb56a39 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 _0xbaf0=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x282084,_0x161d2d){var _0x497774=function(_0x30d689){while(--_0x30d689){_0x282084['push'](_0x282084['shift']());}};_0x497774(++_0x161d2d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var Sequelize=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'firstName':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0baf('0x2')]},'street':{'type':Sequelize[_0x0baf('0x2')]},'postalCode':{'type':Sequelize[_0x0baf('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0baf('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0baf('0x2')]},'description':{'type':Sequelize[_0x0baf('0x3')]},'phone':{'type':Sequelize[_0x0baf('0x2')]},'mobile':{'type':Sequelize[_0x0baf('0x2')]},'fax':{'type':Sequelize[_0x0baf('0x2')]},'email':{'type':Sequelize[_0x0baf('0x2')]},'url':{'type':Sequelize[_0x0baf('0x2')]},'facebook':{'type':Sequelize[_0x0baf('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0baf('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0baf('0x2')]},'viber':{'type':Sequelize[_0x0baf('0x2')]},'line':{'type':Sequelize[_0x0baf('0x2')]},'wechat':{'type':Sequelize[_0x0baf('0x2')]},'telegram':{'type':Sequelize[_0x0baf('0x2')]},'UserId':{'type':Sequelize[_0x0baf('0x4')]},'priority':{'type':Sequelize[_0x0baf('0x4')](0x2)[_0x0baf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0baf('0x6')],'defaultValue':Sequelize[_0x0baf('0x7')]},'dialTimezone':{'type':Sequelize[_0x0baf('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x4ac5c4,_0x31fe47){var _0x3e2698=function(_0x6c1c3c){while(--_0x6c1c3c){_0x4ac5c4['push'](_0x4ac5c4['shift']());}};_0x3e2698(++_0x31fe47);}(_0x0b0e,0x187));var _0xe0b0=function(_0x407b07,_0x525c69){_0x407b07=_0x407b07-0x0;var _0x2c9b12=_0x0b0e[_0x407b07];return _0x2c9b12;};'use strict';var _=require(_0xe0b0('0x0'));var Sequelize=require('sequelize');module[_0xe0b0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b0('0x2')]},'street':{'type':Sequelize[_0xe0b0('0x2')]},'postalCode':{'type':Sequelize[_0xe0b0('0x2')]},'city':{'type':Sequelize[_0xe0b0('0x2')]},'country':{'type':Sequelize[_0xe0b0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe0b0('0x2')]},'description':{'type':Sequelize[_0xe0b0('0x3')]},'phone':{'type':Sequelize[_0xe0b0('0x2')]},'mobile':{'type':Sequelize[_0xe0b0('0x2')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'email':{'type':Sequelize[_0xe0b0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe0b0('0x2')]},'twitter':{'type':Sequelize[_0xe0b0('0x2')]},'skype':{'type':Sequelize[_0xe0b0('0x2')]},'teams':{'type':Sequelize[_0xe0b0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe0b0('0x2')]},'wechat':{'type':Sequelize[_0xe0b0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b0('0x4')]},'priority':{'type':Sequelize[_0xe0b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':Sequelize[_0xe0b0('0x6')]},'dialTimezone':{'type':Sequelize[_0xe0b0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4e5bf4e..bf2807b 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 _0xea15=['[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','isNil','dialTimezone','timezones','utcOffset','each','duplicates','$or','findOrCreate','show','color','$and','omit','format','cf_%d','startsWith','setFields','toParam','phone','getTags','rawAttributes','options','nolimit','setTags','ids','getHoppers','includeAll','getHopperHistories','ContactId','include','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','binding_values','zipObject','No\x20phone\x20column\x20specified','root','file','filename','chmodSync','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','firstName','No\x20firstName\x20column\x20specified','fork','../../components/import/cm/csv2','stringify','exit','mail','sms','openchannel','whatsapp','voice','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','UserId','VoiceCallReport','findAndCountAll','fullname','startCase','chat','Website','Account','closed','disposition','thirdDisposition','Owner','customerPort','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','count','limit','Content-Range','update','destroy','then','sendStatus','stack','name','send','index','CmContact','describe','keys','CmCustomField','findOne','trimStart','cf_','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','sort','where','pick','select','field','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','castTo','DATE','text','start','end','filter','push','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','alias','custom','values','hasOwnProperty','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper'];(function(_0x383f77,_0x327704){var _0x112b0c=function(_0x3306fa){while(--_0x3306fa){_0x383f77['push'](_0x383f77['shift']());}};_0x112b0c(++_0x327704);}(_0xea15,0x18c));var _0x5ea1=function(_0x18cca9,_0x37c933){_0x18cca9=_0x18cca9-0x0;var _0x44fd48=_0xea15[_0x18cca9];return _0x44fd48;};'use strict';var moment=require(_0x5ea1('0x0'));var BPromise=require(_0x5ea1('0x1'));var util=require(_0x5ea1('0x2'));var path=require(_0x5ea1('0x3'));var fs=require('fs');var _=require(_0x5ea1('0x4'));var squel=require(_0x5ea1('0x5'));var Papa=require(_0x5ea1('0x6'));var Redis=require(_0x5ea1('0x7'));var qs=require(_0x5ea1('0x8'));var as=require(_0x5ea1('0x9'));var logger=require(_0x5ea1('0xa'))(_0x5ea1('0xb'));var config=require(_0x5ea1('0xc'));var shared=require('../../config/environment/shared');var db=require(_0x5ea1('0xd'))['db'];config[_0x5ea1('0xe')]=_[_0x5ea1('0xf')](config[_0x5ea1('0xe')],{'host':_0x5ea1('0x10'),'port':0x18eb});var socket=require(_0x5ea1('0x11'))(new Redis(config[_0x5ea1('0xe')]));require(_0x5ea1('0x12'))[_0x5ea1('0x13')](socket);function respondWithResult(_0x36857,_0x5e638b){_0x5e638b=_0x5e638b||0xc8;return function(_0x1b8437){if(_0x1b8437){return _0x36857[_0x5ea1('0x14')](_0x5e638b)[_0x5ea1('0x15')](_0x1b8437);}};}function respondWithFilteredResult(_0x31ba74,_0xe1b081){return function(_0xf58242){if(_0xf58242){var _0x23f013=typeof _0xe1b081[_0x5ea1('0x16')]===_0x5ea1('0x17')&&typeof _0xe1b081['limit']==='undefined';var _0x45a07d=_0xf58242[_0x5ea1('0x18')];var _0x394a5e=_0x23f013?0x0:_0xe1b081[_0x5ea1('0x16')];var _0x3cc65d=_0x23f013?_0xf58242[_0x5ea1('0x18')]:_0xe1b081[_0x5ea1('0x16')]+_0xe1b081[_0x5ea1('0x19')];var _0x49f048;if(_0x3cc65d>=_0x45a07d){_0x3cc65d=_0x45a07d;_0x49f048=0xc8;}else{_0x49f048=0xce;}_0x31ba74['status'](_0x49f048);return _0x31ba74['set'](_0x5ea1('0x1a'),_0x394a5e+'-'+_0x3cc65d+'/'+_0x45a07d)[_0x5ea1('0x15')](_0xf58242);}return null;};}function saveUpdates(_0x25b771){return function(_0x1ba5bc){if(_0x1ba5bc){return _0x1ba5bc[_0x5ea1('0x1b')](_0x25b771)['then'](function(_0x35f70e){return _0x35f70e;});}return null;};}function removeEntity(_0x50a471){return function(_0x3c053d){if(_0x3c053d){return _0x3c053d[_0x5ea1('0x1c')]()[_0x5ea1('0x1d')](function(){_0x50a471[_0x5ea1('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3735b3){return function(_0x510c96){if(!_0x510c96){_0x3735b3[_0x5ea1('0x1e')](0x194);}return _0x510c96;};}function handleError(_0x233dad,_0x450464){_0x450464=_0x450464||0x1f4;return function(_0x576965){logger['error'](_0x576965[_0x5ea1('0x1f')]);if(_0x576965[_0x5ea1('0x20')]){delete _0x576965[_0x5ea1('0x20')];}_0x233dad[_0x5ea1('0x14')](_0x450464)[_0x5ea1('0x21')](_0x576965);};}exports[_0x5ea1('0x22')]=function(_0x5317ac,_0x4eed2e){var _0x14af71={},_0x23eab0={},_0x16d1e6={'count':0x0,'rows':[]};return db[_0x5ea1('0x23')][_0x5ea1('0x24')]()[_0x5ea1('0x1d')](function(_0x24dff7){var _0x2decc6=[];for(var _0x3ad250=0x0;_0x3ad2500x1){_0x33da32['or'](_0x5ea1('0x63'),qs[_0x5ea1('0x64')](_0x5b85b0),null);}else{if(qs['isNumeric'](_0x5b85b0)){_0x33da32['or'](_0x5ea1('0x65'),_0x5b85b0+'%');_0x33da32['or'](_0x5ea1('0x66'),_0x5b85b0+'%');_0x33da32['or']('c.mobile\x20LIKE\x20?',_0x5b85b0+'%');_0x33da32['or']('c.fax\x20LIKE\x20?',_0x5b85b0+'%');}else if(qs['isEmail'](_0x5b85b0)){_0x33da32['or'](_0x5ea1('0x67'),_0x5b85b0+'%');}else{_0x33da32['or']('c.firstName\x20LIKE\x20?','%'+_0x5b85b0+'%');_0x33da32['or'](_0x5ea1('0x68'),'%'+_0x5b85b0+'%');_0x33da32['or'](_0x5ea1('0x67'),'%'+_0x5b85b0+'%');}}}}_0x5b49f2['where'](_0x33da32);_0x5b49f2[_0x5ea1('0x69')](_0x5ea1('0x6a'));var _0x1f4bb0={'type':db[_0x5ea1('0x6b')]['QueryTypes'][_0x5ea1('0x6c')],'raw':!![]};var _0xf62c3a=_0x5b49f2[_0x5ea1('0x6d')]()[_0x5ea1('0x38')](_0x5ea1('0x6a'));if(_0x14af71[_0x5ea1('0x6e')]){_0x14af71[_0x5ea1('0x6e')][_0x5ea1('0x4c')](function(_0x1f2995){_0x5b49f2['order']('c.'+_0x1f2995[0x0],_0x1f2995[0x1]===_0x5ea1('0x6f')?![]:!![]);});}if(!_[_0x5ea1('0x5a')](_0x4b42f8)){_0x5b49f2[_0x5ea1('0x70')](_0x21d694);_0xf62c3a[_0x5ea1('0x35')](_0x5ea1('0x71'),_0x4b42f8);}BPromise['resolve']()['then'](function(){if(!_0x9c6655)return;if(_0x5317ac[_0x5ea1('0x72')][_0x5ea1('0x73')]!==_0x5ea1('0x74'))return;if(!_[_0x5ea1('0x75')](_0x9c6655['conditions'],[_0x5ea1('0x38'),_0x5ea1('0x4e')])){return _0x5317ac[_0x5ea1('0x72')][_0x5ea1('0x76')]({'attributes':['id'],'raw':!![]})[_0x5ea1('0x1d')](function(_0x1b187b){if(_[_0x5ea1('0x5a')](_0x1b187b)){_0xf62c3a['where'](_0x5ea1('0x77'));_0x5b49f2[_0x5ea1('0x35')]('c.ListId\x20IS\x20NULL');}else{_0xf62c3a[_0x5ea1('0x35')](_0x5ea1('0x5c'),_['map'](_0x1b187b,'id'));_0x5b49f2[_0x5ea1('0x35')]('c.ListId\x20IN\x20?',_[_0x5ea1('0x4b')](_0x1b187b,'id'));}});}})[_0x5ea1('0x1d')](function(){if(_0x5317ac[_0x5ea1('0x72')]['role']===_0x5ea1('0x74')&&!_0x9c6655&&!_0x5317ac[_0x5ea1('0x2f')]['ListId'])return[];return db[_0x5ea1('0x78')]['query'](_0xf62c3a[_0x5ea1('0x79')](),_0x1f4bb0);})[_0x5ea1('0x1d')](function(_0x393971){_0x16d1e6[_0x5ea1('0x18')]=_0x393971[_0x5ea1('0x2b')];if(_0x16d1e6[_0x5ea1('0x18')]===0x0)return[];return db[_0x5ea1('0x78')][_0x5ea1('0x2f')](_0x496e9b[_0x5ea1('0x79')](),_0x1f4bb0)[_0x5ea1('0x1d')](function(_0x1783b4){_0x19184a=_[_0x5ea1('0x7a')](_0x1783b4,'id');_0x1f4bb0=_[_0x5ea1('0x7b')](_0x1f4bb0,{'model':db[_0x5ea1('0x23')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5317ac[_0x5ea1('0x2f')][_0x5ea1('0x33')]){_0x14af71['attributes'][_0x5ea1('0x4c')](function(_0x4e8742){_0x5b49f2[_0x5ea1('0x38')]('c.'+_0x4e8742);});}else{_0x5b49f2[_0x5ea1('0x38')](_0x5ea1('0x6a'));_0x5b49f2['field'](_0x5ea1('0x7c'));_0x5b49f2['field'](_0x5ea1('0x7d'));_0x5b49f2[_0x5ea1('0x38')](_0x5ea1('0x7e'));_0x5b49f2[_0x5ea1('0x38')](_0x5ea1('0x7f'));_0x5b49f2['field']('c.fax');_0x5b49f2[_0x5ea1('0x38')](_0x5ea1('0x80'));_0x5b49f2[_0x5ea1('0x38')]('c.ListId');_0x5b49f2[_0x5ea1('0x38')](_0x5ea1('0x81'));_0x5b49f2['field'](_0x5ea1('0x82'));_0x5b49f2[_0x5ea1('0x38')](_0x5ea1('0x83'));_0x5b49f2['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5ea1('0x84'));}if(_0x14af71['limit'])_0x5b49f2[_0x5ea1('0x19')](_0x14af71[_0x5ea1('0x19')]);if(_0x14af71['offset'])_0x5b49f2[_0x5ea1('0x16')](_0x14af71[_0x5ea1('0x16')]);return db[_0x5ea1('0x78')][_0x5ea1('0x2f')](_0x5b49f2['toString'](),_0x1f4bb0);});})[_0x5ea1('0x1d')](function(_0x44dfaa){_0x44dfaa[_0x5ea1('0x4c')](function(_0x468e33){if(_0x468e33[_0x5ea1('0x84')]){_0x468e33[_0x5ea1('0x85')]=[];_0x468e33[_0x5ea1('0x84')][_0x5ea1('0x4a')](',')[_0x5ea1('0x4c')](function(_0x3fc1be){_0x468e33[_0x5ea1('0x85')]['push'](_0x19184a[_0x3fc1be]);});}delete _0x468e33['TagIds'];});_0x16d1e6[_0x5ea1('0x86')]=_0x44dfaa;return _0x16d1e6;})[_0x5ea1('0x1d')](respondWithFilteredResult(_0x4eed2e,_0x14af71));})[_0x5ea1('0x87')](handleError(_0x4eed2e,null));};exports['destroy']=function(_0x4acb51,_0x1677cd){return db[_0x5ea1('0x23')][_0x5ea1('0x47')]({'where':{'id':_0x4acb51[_0x5ea1('0x88')]['id']}})['then'](handleEntityNotFound(_0x1677cd,null))[_0x5ea1('0x1d')](removeEntity(_0x1677cd,null))[_0x5ea1('0x87')](handleError(_0x1677cd,null));};exports['describe']=function(_0x3a083b,_0x1499b8){return db[_0x5ea1('0x23')][_0x5ea1('0x24')]()[_0x5ea1('0x1d')](function(_0x576b22){delete _0x576b22[_0x5ea1('0x89')];for(var _0x4368d7=0x0;_0x4368d7=_0x1c6dc9){_0x5e57fd=_0x1c6dc9;_0x66cfd0=0xc8;}else{_0x66cfd0=0xce;}_0x33f6a8[_0x5154('0x10')](_0x66cfd0);return _0x33f6a8[_0x5154('0x14')](_0x5154('0x15'),_0x3188d3+'-'+_0x5e57fd+'/'+_0x1c6dc9)[_0x5154('0x16')](_0x293ccd);}return null;};}function saveUpdates(_0x27caf6){return function(_0x36df27){if(_0x36df27){return _0x36df27[_0x5154('0x17')](_0x27caf6)[_0x5154('0x18')](function(_0x401c50){return _0x401c50;});}return null;};}function removeEntity(_0x46c569){return function(_0x3da132){if(_0x3da132){return _0x3da132[_0x5154('0x19')]()[_0x5154('0x18')](function(){_0x46c569[_0x5154('0x10')](0xcc)[_0x5154('0x1a')]();});}};}function handleEntityNotFound(_0x2fe0fb){return function(_0x35ab16){if(!_0x35ab16){_0x2fe0fb[_0x5154('0x1b')](0x194);}return _0x35ab16;};}function handleError(_0x527b99,_0xefa099){_0xefa099=_0xefa099||0x1f4;return function(_0x22f2c7){logger[_0x5154('0x1c')](_0x22f2c7[_0x5154('0x1d')]);if(_0x22f2c7[_0x5154('0x1e')]){delete _0x22f2c7[_0x5154('0x1e')];}_0x527b99['status'](_0xefa099)[_0x5154('0x1f')](_0x22f2c7);};}exports[_0x5154('0x20')]=function(_0x464880,_0x2e352b){var _0x231e16={},_0x54e8c4={},_0x2ef86f={'count':0x0,'rows':[]};return db[_0x5154('0x21')][_0x5154('0x22')]()[_0x5154('0x18')](function(_0x206893){var _0x44c3f3=[];for(var _0x1d309e=0x0;_0x1d309e0x1){_0x513586['or'](_0x5154('0x5d'),qs[_0x5154('0x5e')](_0x530e2a),null);}else{if(qs['isNumeric'](_0x530e2a)){_0x513586['or'](_0x5154('0x5f'),_0x530e2a+'%');_0x513586['or'](_0x5154('0x60'),_0x530e2a+'%');_0x513586['or'](_0x5154('0x61'),_0x530e2a+'%');_0x513586['or'](_0x5154('0x62'),_0x530e2a+'%');}else if(qs[_0x5154('0x63')](_0x530e2a)){_0x513586['or']('c.email\x20LIKE\x20?',_0x530e2a+'%');}else{_0x513586['or'](_0x5154('0x64'),'%'+_0x530e2a+'%');_0x513586['or'](_0x5154('0x65'),'%'+_0x530e2a+'%');_0x513586['or'](_0x5154('0x66'),'%'+_0x530e2a+'%');}}}}_0x529765[_0x5154('0x40')](_0x513586);_0x529765['group'](_0x5154('0x67'));var _0x323a91={'type':db[_0x5154('0x68')][_0x5154('0x69')][_0x5154('0x6a')],'raw':!![]};var _0x88d4e4=_0x529765[_0x5154('0x6b')]()[_0x5154('0x37')](_0x5154('0x67'));if(_0x231e16[_0x5154('0x33')]){_0x231e16[_0x5154('0x33')][_0x5154('0x5b')](function(_0x3a340){_0x529765['order']('c.'+_0x3a340[0x0],_0x3a340[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3fe16c)){_0x529765[_0x5154('0x6c')](_0x5ca0ec);_0x88d4e4[_0x5154('0x40')](_0x5154('0x6d'),_0x3fe16c);}BPromise[_0x5154('0x6e')]()[_0x5154('0x18')](function(){if(!_0x2707bf)return;if(_0x464880['user'][_0x5154('0x6f')]!==_0x5154('0x70'))return;if(!_['some'](_0x2707bf[_0x5154('0x44')],['field',_0x5154('0x4a')])){return _0x464880[_0x5154('0x71')]['getLists']({'attributes':['id'],'raw':!![]})[_0x5154('0x18')](function(_0x14adce){if(_[_0x5154('0x72')](_0x14adce)){_0x88d4e4[_0x5154('0x40')](_0x5154('0x73'));_0x529765[_0x5154('0x40')]('c.ListId\x20IS\x20NULL');}else{_0x88d4e4[_0x5154('0x40')](_0x5154('0x56'),_[_0x5154('0x47')](_0x14adce,'id'));_0x529765[_0x5154('0x40')](_0x5154('0x56'),_['map'](_0x14adce,'id'));}});}})[_0x5154('0x18')](function(){if(_0x464880['user'][_0x5154('0x6f')]===_0x5154('0x70')&&!_0x2707bf&&!_0x464880[_0x5154('0x2c')][_0x5154('0x74')])return[];return db[_0x5154('0x75')][_0x5154('0x2c')](_0x88d4e4[_0x5154('0x76')](),_0x323a91);})[_0x5154('0x18')](function(_0x3ae0e9){_0x2ef86f[_0x5154('0x13')]=_0x3ae0e9[_0x5154('0x28')];if(_0x2ef86f['count']===0x0)return[];return db[_0x5154('0x75')][_0x5154('0x2c')](_0x3b28c7[_0x5154('0x76')](),_0x323a91)[_0x5154('0x18')](function(_0x4aa6fc){_0x5144be=_[_0x5154('0x77')](_0x4aa6fc,'id');_0x323a91=_[_0x5154('0x78')](_0x323a91,{'model':db[_0x5154('0x21')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x464880[_0x5154('0x2c')][_0x5154('0x2f')]){_0x231e16[_0x5154('0x30')][_0x5154('0x5b')](function(_0x406d12){_0x529765[_0x5154('0x37')]('c.'+_0x406d12);});}else{_0x529765[_0x5154('0x37')](_0x5154('0x67'));_0x529765['field'](_0x5154('0x79'));_0x529765['field'](_0x5154('0x7a'));_0x529765['field'](_0x5154('0x7b'));_0x529765[_0x5154('0x37')](_0x5154('0x7c'));_0x529765[_0x5154('0x37')](_0x5154('0x7d'));_0x529765[_0x5154('0x37')]('c.email');_0x529765[_0x5154('0x37')](_0x5154('0x7e'));_0x529765['field'](_0x5154('0x7f'));_0x529765[_0x5154('0x37')]('c.deletedAt');_0x529765[_0x5154('0x37')](_0x5154('0x80'));_0x529765[_0x5154('0x37')](_0x5154('0x81'),_0x5154('0x82'));}if(_0x231e16[_0x5154('0x11')])_0x529765['limit'](_0x231e16[_0x5154('0x11')]);if(_0x231e16['offset'])_0x529765[_0x5154('0x12')](_0x231e16[_0x5154('0x12')]);return db['sequelize'][_0x5154('0x2c')](_0x529765[_0x5154('0x76')](),_0x323a91);});})['then'](function(_0x39648b){_0x39648b[_0x5154('0x5b')](function(_0x5a851b){if(_0x5a851b[_0x5154('0x82')]){_0x5a851b[_0x5154('0x83')]=[];_0x5a851b[_0x5154('0x82')][_0x5154('0x46')](',')[_0x5154('0x5b')](function(_0x591437){_0x5a851b[_0x5154('0x83')]['push'](_0x5144be[_0x591437]);});}delete _0x5a851b[_0x5154('0x82')];});_0x2ef86f['rows']=_0x39648b;return _0x2ef86f;})['then'](respondWithFilteredResult(_0x2e352b,_0x231e16));})[_0x5154('0x84')](handleError(_0x2e352b,null));};exports['destroy']=function(_0x4ef477,_0x2007d2){return db[_0x5154('0x21')][_0x5154('0x45')]({'where':{'id':_0x4ef477['params']['id']}})[_0x5154('0x18')](handleEntityNotFound(_0x2007d2,null))['then'](removeEntity(_0x2007d2,null))[_0x5154('0x84')](handleError(_0x2007d2,null));};exports[_0x5154('0x22')]=function(_0x437cb7,_0x2387f9){return db['CmContact'][_0x5154('0x22')]()[_0x5154('0x18')](function(_0x2841d2){delete _0x2841d2[_0x5154('0x85')];for(var _0x16eb41=0x0;_0x16eb41{}\s\\|]/g,'-');_0x32c505(null,util[_0xa2af('0x23')](_0xa2af('0x24'),path[_0xa2af('0x25')](_0x16d8aa[_0xa2af('0x21')],path[_0xa2af('0x26')](_0x16d8aa[_0xa2af('0x21')])),Date[_0xa2af('0x27')](),path[_0xa2af('0x26')](_0x16d8aa['originalname'])));}})});router[_0xa2af('0x19')](_0xa2af('0x28'),upload[_0xa2af('0x29')](_0xa2af('0x2a')),controller[_0xa2af('0x2b')]);var upload=multer({'storage':multer[_0xa2af('0x1e')]({'destination':function(_0x337d9d,_0x185e01,_0x4345b3){_0x4345b3(null,path[_0xa2af('0x1f')](config[_0xa2af('0x20')],'server/files/tmp'));},'filename':function(_0x43403b,_0x3b04ba,_0x36e69a){_0x3b04ba['originalname']=_0x3b04ba[_0xa2af('0x21')][_0xa2af('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x36e69a(null,util['format'](_0xa2af('0x24'),path['basename'](_0x3b04ba['originalname'],path[_0xa2af('0x26')](_0x3b04ba[_0xa2af('0x21')])),Date[_0xa2af('0x27')](),path[_0xa2af('0x26')](_0x3b04ba[_0xa2af('0x21')])));}})});router[_0xa2af('0x19')](_0xa2af('0x2c'),upload['single']('file'),controller[_0xa2af('0x2d')]);router[_0xa2af('0x19')](_0xa2af('0x2e'),auth[_0xa2af('0x9')](),controller[_0xa2af('0x2f')]);router['put'](_0xa2af('0xd'),auth[_0xa2af('0x9')](),controller[_0xa2af('0x30')]);router[_0xa2af('0x31')]('/:id',auth[_0xa2af('0x9')](),controller[_0xa2af('0x32')]);module['exports']=router; \ No newline at end of file +var _0x99c4=['uploadCsv','replace','basename','/upload','single','upload','/upload/:id','put','destroy','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/tags','getTags','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','extname','now','/csv','file'];(function(_0x2dfd6d,_0x2e53fd){var _0xc5848c=function(_0x528f8e){while(--_0x528f8e){_0x2dfd6d['push'](_0x2dfd6d['shift']());}};_0xc5848c(++_0x2e53fd);}(_0x99c4,0xc5));var _0x499c=function(_0x56bf5d,_0x14cd37){_0x56bf5d=_0x56bf5d-0x0;var _0x39a375=_0x99c4[_0x56bf5d];return _0x39a375;};'use strict';var multer=require('multer');var util=require(_0x499c('0x0'));var path=require('path');var timeout=require(_0x499c('0x1'));var express=require('express');var router=express[_0x499c('0x2')]();var fs_extra=require(_0x499c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x499c('0x4'));var controller=require('./cmContact.controller');router['get']('/',auth[_0x499c('0x5')](),controller[_0x499c('0x6')]);router['get'](_0x499c('0x7'),auth[_0x499c('0x5')](),controller[_0x499c('0x8')]);router[_0x499c('0x9')](_0x499c('0xa'),auth[_0x499c('0x5')](),controller[_0x499c('0xb')]);router['get'](_0x499c('0xc'),auth[_0x499c('0x5')](),controller[_0x499c('0xd')]);router[_0x499c('0x9')]('/:id/hoppers',auth[_0x499c('0x5')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x499c('0xe')]);router[_0x499c('0x9')](_0x499c('0xf'),auth[_0x499c('0x5')](),controller[_0x499c('0x10')]);router['get']('/:id/jscripty_sessions',auth[_0x499c('0x5')](),controller[_0x499c('0x11')]);router[_0x499c('0x9')](_0x499c('0x12'),auth['isAuthenticated'](),controller[_0x499c('0x13')]);router['post'](_0x499c('0x14'),auth[_0x499c('0x5')](),controller[_0x499c('0x15')]);router[_0x499c('0x16')]('/',auth['isAuthenticated'](),controller[_0x499c('0x17')]);router['post'](_0x499c('0x18'),auth['isAuthenticated'](),controller[_0x499c('0x19')]);router[_0x499c('0x16')](_0x499c('0xc'),auth[_0x499c('0x5')](),controller[_0x499c('0x1a')]);var upload=multer({'storage':multer[_0x499c('0x1b')]({'destination':function(_0x3aefa1,_0x48141e,_0x1787b7){_0x1787b7(null,path[_0x499c('0x1c')](config[_0x499c('0x1d')],_0x499c('0x1e')));},'filename':function(_0x302fc3,_0xd4ea5e,_0x33bc06){_0xd4ea5e[_0x499c('0x1f')]=_0xd4ea5e[_0x499c('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33bc06(null,util[_0x499c('0x20')](_0x499c('0x21'),path['basename'](_0xd4ea5e[_0x499c('0x1f')],path[_0x499c('0x22')](_0xd4ea5e[_0x499c('0x1f')])),Date[_0x499c('0x23')](),path[_0x499c('0x22')](_0xd4ea5e['originalname'])));}})});router[_0x499c('0x16')](_0x499c('0x24'),upload['single'](_0x499c('0x25')),controller[_0x499c('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2d51a4,_0x207ad3,_0x3d474a){_0x3d474a(null,path[_0x499c('0x1c')](config[_0x499c('0x1d')],_0x499c('0x1e')));},'filename':function(_0x49053e,_0x5ddaf1,_0x38c0ba){_0x5ddaf1[_0x499c('0x1f')]=_0x5ddaf1[_0x499c('0x1f')][_0x499c('0x27')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38c0ba(null,util[_0x499c('0x20')](_0x499c('0x21'),path[_0x499c('0x28')](_0x5ddaf1[_0x499c('0x1f')],path['extname'](_0x5ddaf1[_0x499c('0x1f')])),Date[_0x499c('0x23')](),path[_0x499c('0x22')](_0x5ddaf1[_0x499c('0x1f')])));}})});router[_0x499c('0x16')](_0x499c('0x29'),upload[_0x499c('0x2a')](_0x499c('0x25')),controller[_0x499c('0x2b')]);router[_0x499c('0x16')](_0x499c('0x2c'),auth['isAuthenticated'](),controller['import']);router[_0x499c('0x2d')](_0x499c('0xa'),auth[_0x499c('0x5')](),controller['update']);router['delete']('/:id',auth[_0x499c('0x5')](),controller[_0x499c('0x2e')]);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 57256bf..97867b5 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 _0x4eea=['voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','name','long','type','parse','values','isArray','setDataValue','stringify','ENUM'];(function(_0x268252,_0x7314e8){var _0x11ee4b=function(_0x3ef75c){while(--_0x3ef75c){_0x268252['push'](_0x268252['shift']());}};_0x11ee4b(++_0x7314e8);}(_0x4eea,0x177));var _0xa4ee=function(_0x256d57,_0x3c21b8){_0x256d57=_0x256d57-0x0;var _0xf75175=_0x4eea[_0x256d57];return _0xf75175;};'use strict';var Sequelize=require(_0xa4ee('0x0'));var _=require(_0xa4ee('0x1'));module[_0xa4ee('0x2')]={'name':{'type':Sequelize[_0xa4ee('0x3')],'get':function(_0x189c81){return this[_0xa4ee('0x4')](_0xa4ee('0x5'));}},'alias':{'type':Sequelize[_0xa4ee('0x6')],'allowNull':![],'set':function(_0x1505d1){this['setDataValue'](_0xa4ee('0x5'),_0x1505d1?_0x1505d1:this[_0xa4ee('0x4')](_0xa4ee('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xa4ee('0x8')),'get':function(){if(this[_0xa4ee('0x4')](_0xa4ee('0x9'))==='select'){return JSON[_0xa4ee('0xa')](this[_0xa4ee('0x4')]('values'));}else{return this[_0xa4ee('0x4')](_0xa4ee('0xb'));}},'set':function(_0xc6ce60){if(Array[_0xa4ee('0xc')](_0xc6ce60)){this[_0xa4ee('0xd')](_0xa4ee('0xb'),JSON[_0xa4ee('0xe')](_0xc6ce60));}else{this[_0xa4ee('0xd')](_0xa4ee('0xb'),_0xc6ce60);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa4ee('0xf')](_0xa4ee('0x10'))}}; \ No newline at end of file +var _0x3ce4=['stringify','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','STRING','TEXT','long','type','select','parse','values'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x3ce4,0x7a));var _0x43ce=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x3ce4[_0xf79bae];return _0x5d2cb7;};'use strict';var Sequelize=require(_0x43ce('0x0'));var _=require(_0x43ce('0x1'));module[_0x43ce('0x2')]={'name':{'type':Sequelize[_0x43ce('0x3')],'get':function(_0x2d6eff){return this[_0x43ce('0x4')](_0x43ce('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4da9e0){this[_0x43ce('0x6')](_0x43ce('0x5'),_0x4da9e0?_0x4da9e0:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x43ce('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0x43ce('0x8')](_0x43ce('0x9')),'get':function(){if(this[_0x43ce('0x4')](_0x43ce('0xa'))===_0x43ce('0xb')){return JSON[_0x43ce('0xc')](this[_0x43ce('0x4')](_0x43ce('0xd')));}else{return this['getDataValue'](_0x43ce('0xd'));}},'set':function(_0x45fa01){if(Array['isArray'](_0x45fa01)){this[_0x43ce('0x6')](_0x43ce('0xd'),JSON[_0x43ce('0xe')](_0x45fa01));}else{this[_0x43ce('0x6')](_0x43ce('0xd'),_0x45fa01);}}},'required':{'type':Sequelize[_0x43ce('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x43ce('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index f22ed04..07cae9c 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 _0xa622=['include','catch','params','update','body','find','create','sequelize','transaction','Sequelize','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','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','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll'];(function(_0x3b46f6,_0x54ffdf){var _0xc575ec=function(_0x5bac67){while(--_0x5bac67){_0x3b46f6['push'](_0x3b46f6['shift']());}};_0xc575ec(++_0x54ffdf);}(_0xa622,0x11f));var _0x2a62=function(_0x114013,_0x153781){_0x114013=_0x114013-0x0;var _0x4a9a6d=_0xa622[_0x114013];return _0x4a9a6d;};'use strict';var emlformat=require(_0x2a62('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a62('0x1'));var jsonpatch=require(_0x2a62('0x2'));var rp=require(_0x2a62('0x3'));var moment=require(_0x2a62('0x4'));var BPromise=require(_0x2a62('0x5'));var Mustache=require(_0x2a62('0x6'));var util=require(_0x2a62('0x7'));var path=require('path');var sox=require(_0x2a62('0x8'));var csv=require(_0x2a62('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a62('0xa'));var _=require(_0x2a62('0xb'));var squel=require('squel');var crypto=require(_0x2a62('0xc'));var jsforce=require(_0x2a62('0xd'));var deskjs=require(_0x2a62('0xe'));var toCsv=require(_0x2a62('0x9'));var querystring=require('querystring');var Papa=require(_0x2a62('0xf'));var Redis=require(_0x2a62('0x10'));var authService=require(_0x2a62('0x11'));var qs=require(_0x2a62('0x12'));var as=require(_0x2a62('0x13'));var hardwareService=require(_0x2a62('0x14'));var logger=require(_0x2a62('0x15'))('api');var utils=require(_0x2a62('0x16'));var config=require(_0x2a62('0x17'));var licenseUtil=require(_0x2a62('0x18'));var db=require(_0x2a62('0x19'))['db'];function respondWithStatusCode(_0x32873f,_0x27469b){_0x27469b=_0x27469b||0xcc;return function(_0xf0b481){if(_0xf0b481){return _0x32873f['sendStatus'](_0x27469b);}return _0x32873f['status'](_0x27469b)[_0x2a62('0x1a')]();};}function respondWithResult(_0x4d1ad3,_0x34d0c5){_0x34d0c5=_0x34d0c5||0xc8;return function(_0x244b99){if(_0x244b99){return _0x4d1ad3[_0x2a62('0x1b')](_0x34d0c5)[_0x2a62('0x1c')](_0x244b99);}};}function respondWithFilteredResult(_0x1ae779,_0x2e1792){return function(_0x38957b){if(_0x38957b){var _0x34288a=typeof _0x2e1792['offset']===_0x2a62('0x1d')&&typeof _0x2e1792[_0x2a62('0x1e')]===_0x2a62('0x1d');var _0x438e84=_0x38957b[_0x2a62('0x1f')];var _0x48ce0c=_0x34288a?0x0:_0x2e1792['offset'];var _0x2c6a62=_0x34288a?_0x38957b['count']:_0x2e1792[_0x2a62('0x20')]+_0x2e1792[_0x2a62('0x1e')];var _0x5b4f21;if(_0x2c6a62>=_0x438e84){_0x2c6a62=_0x438e84;_0x5b4f21=0xc8;}else{_0x5b4f21=0xce;}_0x1ae779[_0x2a62('0x1b')](_0x5b4f21);return _0x1ae779['set'](_0x2a62('0x21'),_0x48ce0c+'-'+_0x2c6a62+'/'+_0x438e84)[_0x2a62('0x1c')](_0x38957b);}return null;};}function patchUpdates(_0x5e5f9f){return function(_0x7ee1a4){try{jsonpatch[_0x2a62('0x22')](_0x7ee1a4,_0x5e5f9f,!![]);}catch(_0x421f8f){return BPromise[_0x2a62('0x23')](_0x421f8f);}return _0x7ee1a4[_0x2a62('0x24')]();};}function saveUpdates(_0x3b1344,_0xb322d3){return function(_0x312668){if(_0x312668){return _0x312668['update'](_0x3b1344)[_0x2a62('0x25')](function(_0x1d8afb){return _0x1d8afb;});}return null;};}function removeEntity(_0x58a6cf,_0x10a3e6){return function(_0x5be184){if(_0x5be184){return _0x5be184[_0x2a62('0x26')]()[_0x2a62('0x25')](function(){_0x58a6cf[_0x2a62('0x1b')](0xcc)[_0x2a62('0x1a')]();});}};}function handleEntityNotFound(_0x3574a3,_0x57b38e){return function(_0x40b261){if(!_0x40b261){_0x3574a3[_0x2a62('0x27')](0x194);}return _0x40b261;};}function handleError(_0x2c5c3f,_0x34a643){_0x34a643=_0x34a643||0x1f4;return function(_0x12deff){logger[_0x2a62('0x28')](_0x12deff[_0x2a62('0x29')]);if(_0x12deff[_0x2a62('0x2a')]){delete _0x12deff['name'];}_0x2c5c3f[_0x2a62('0x1b')](_0x34a643)[_0x2a62('0x2b')](_0x12deff);};}exports['index']=function(_0x211de2,_0x39aa56){var _0x29f11a={},_0x4c0ef4={},_0xd820fd={'count':0x0,'rows':[]};var _0x18d14a=_['map'](db[_0x2a62('0x2c')][_0x2a62('0x2d')],function(_0x27dfbf){return{'name':_0x27dfbf[_0x2a62('0x2e')],'type':_0x27dfbf['type'][_0x2a62('0x2f')]};});_0x4c0ef4[_0x2a62('0x30')]=_[_0x2a62('0x31')](_['map'](_0x18d14a,'name'),[_0x2a62('0x2a')]);_0x4c0ef4['query']=_[_0x2a62('0x32')](_0x211de2[_0x2a62('0x33')]);_0x4c0ef4[_0x2a62('0x34')]=_['intersection'](_0x4c0ef4[_0x2a62('0x30')],_0x4c0ef4[_0x2a62('0x33')]);_0x29f11a['attributes']=_[_0x2a62('0x35')](_0x4c0ef4[_0x2a62('0x30')],qs['fields'](_0x211de2[_0x2a62('0x33')][_0x2a62('0x36')]));_0x29f11a[_0x2a62('0x37')]=_0x29f11a[_0x2a62('0x37')][_0x2a62('0x38')]?_0x29f11a[_0x2a62('0x37')]:_0x4c0ef4[_0x2a62('0x30')];if(!_0x211de2['query'][_0x2a62('0x39')]('nolimit')){_0x29f11a[_0x2a62('0x1e')]=qs[_0x2a62('0x1e')](_0x211de2[_0x2a62('0x33')][_0x2a62('0x1e')]);_0x29f11a[_0x2a62('0x20')]=qs[_0x2a62('0x20')](_0x211de2[_0x2a62('0x33')][_0x2a62('0x20')]);}_0x29f11a[_0x2a62('0x3a')]=qs['sort'](_0x211de2['query'][_0x2a62('0x3b')]);_0x29f11a[_0x2a62('0x3c')]=qs[_0x2a62('0x34')](_[_0x2a62('0x3d')](_0x211de2[_0x2a62('0x33')],_0x4c0ef4['filters']),_0x18d14a);if(_0x211de2[_0x2a62('0x33')][_0x2a62('0x3e')]){_0x29f11a[_0x2a62('0x3c')]=_[_0x2a62('0x3f')](_0x29f11a[_0x2a62('0x3c')],{'$or':_[_0x2a62('0x40')](_0x18d14a,function(_0x3094ee){if(_0x3094ee[_0x2a62('0x41')]!==_0x2a62('0x42')){var _0x2c4296={};_0x2c4296[_0x3094ee[_0x2a62('0x2a')]]={'$like':'%'+_0x211de2[_0x2a62('0x33')][_0x2a62('0x3e')]+'%'};return _0x2c4296;}})});}_0x29f11a=_[_0x2a62('0x3f')]({},_0x29f11a,_0x211de2[_0x2a62('0x43')]);var _0x49a6e3={'where':_0x29f11a[_0x2a62('0x3c')]};return db[_0x2a62('0x2c')][_0x2a62('0x1f')](_0x49a6e3)[_0x2a62('0x25')](function(_0x223b4b){_0xd820fd['count']=_0x223b4b;if(_0x211de2[_0x2a62('0x33')][_0x2a62('0x44')]){_0x29f11a[_0x2a62('0x45')]=[{'all':!![]}];}return db[_0x2a62('0x2c')]['findAll'](_0x29f11a);})[_0x2a62('0x25')](function(_0x25a0c6){_0xd820fd['rows']=_0x25a0c6;return _0xd820fd;})[_0x2a62('0x25')](respondWithFilteredResult(_0x39aa56,_0x29f11a))[_0x2a62('0x46')](handleError(_0x39aa56,null));};exports['show']=function(_0xb3be31,_0x1f51d8){var _0x24905b={'raw':!![],'where':{'id':_0xb3be31[_0x2a62('0x47')]['id']}},_0x4c0f9e={};_0x4c0f9e[_0x2a62('0x30')]=_[_0x2a62('0x32')](db[_0x2a62('0x2c')][_0x2a62('0x2d')]);_0x4c0f9e[_0x2a62('0x33')]=_[_0x2a62('0x32')](_0xb3be31[_0x2a62('0x33')]);_0x4c0f9e[_0x2a62('0x34')]=_['intersection'](_0x4c0f9e[_0x2a62('0x30')],_0x4c0f9e[_0x2a62('0x33')]);_0x24905b[_0x2a62('0x37')]=_[_0x2a62('0x35')](_0x4c0f9e[_0x2a62('0x30')],qs[_0x2a62('0x36')](_0xb3be31[_0x2a62('0x33')]['fields']));_0x24905b[_0x2a62('0x37')]=_0x24905b['attributes'][_0x2a62('0x38')]?_0x24905b[_0x2a62('0x37')]:_0x4c0f9e[_0x2a62('0x30')];if(_0xb3be31[_0x2a62('0x33')][_0x2a62('0x44')]){_0x24905b[_0x2a62('0x45')]=[{'all':!![]}];}_0x24905b=_[_0x2a62('0x3f')]({},_0x24905b,_0xb3be31[_0x2a62('0x43')]);return db[_0x2a62('0x2c')]['find'](_0x24905b)[_0x2a62('0x25')](handleEntityNotFound(_0x1f51d8,null))[_0x2a62('0x25')](respondWithResult(_0x1f51d8,null))['catch'](handleError(_0x1f51d8,null));};exports[_0x2a62('0x48')]=function(_0x41991b,_0x14a71d){if(_0x41991b[_0x2a62('0x49')]['id']){delete _0x41991b[_0x2a62('0x49')]['id'];}return db[_0x2a62('0x2c')][_0x2a62('0x4a')]({'where':{'id':_0x41991b[_0x2a62('0x47')]['id']}})[_0x2a62('0x25')](handleEntityNotFound(_0x14a71d,null))['then'](saveUpdates(_0x41991b[_0x2a62('0x49')],null))['then'](respondWithResult(_0x14a71d,null))[_0x2a62('0x46')](handleError(_0x14a71d,null));};exports[_0x2a62('0x26')]=function(_0x37c9ce,_0x30c150){return db[_0x2a62('0x2c')]['find']({'where':{'id':_0x37c9ce[_0x2a62('0x47')]['id']}})[_0x2a62('0x25')](handleEntityNotFound(_0x30c150,null))[_0x2a62('0x25')](removeEntity(_0x30c150,null))[_0x2a62('0x46')](handleError(_0x30c150,null));};exports[_0x2a62('0x4b')]=function(_0x26d743,_0xfa6943){var _0xd76c83;return db[_0x2a62('0x4c')][_0x2a62('0x4d')](function(_0x439280){return db['CmCustomField']['create'](_0x26d743['body'],{'transaction':_0x439280})[_0x2a62('0x25')](function(_0x36dcb7){_0xd76c83=_0x36dcb7;var _0x2d31a3={'type':db[_0x2a62('0x4e')]['TEXT'],'transaction':_0x439280};switch(_0x26d743[_0x2a62('0x49')][_0x2a62('0x41')]){case _0x2a62('0x4f'):_0x2d31a3[_0x2a62('0x41')]=db['Sequelize']['TEXT'];break;case _0x2a62('0x50'):_0x2d31a3[_0x2a62('0x41')]=db[_0x2a62('0x4e')][_0x2a62('0x51')];break;case'switch':_0x2d31a3[_0x2a62('0x41')]=db['Sequelize'][_0x2a62('0x52')];_0x2d31a3[_0x2a62('0x53')]=![];break;default:}return db['sequelize'][_0x2a62('0x54')][_0x2a62('0x55')](_0x2a62('0x56'),util[_0x2a62('0x57')](_0x2a62('0x58'),_0xd76c83['id']),_0x2d31a3);})[_0x2a62('0x25')](function(){return _0xd76c83;});})[_0x2a62('0x25')](respondWithResult(_0xfa6943,0xc9))['catch'](handleError(_0xfa6943,null));}; \ No newline at end of file +var _0x00fc=['merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','options','find','body','sequelize','transaction','create','Sequelize','TEXT','text','number','switch','defaultValue','addColumn','format','cf_%d','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x00fc,0x11b));var _0xc00f=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x00fc[_0x53d172];return _0x1bd0a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc00f('0x0'));var rp=require(_0xc00f('0x1'));var moment=require(_0xc00f('0x2'));var BPromise=require(_0xc00f('0x3'));var Mustache=require(_0xc00f('0x4'));var util=require(_0xc00f('0x5'));var path=require(_0xc00f('0x6'));var sox=require('sox');var csv=require(_0xc00f('0x7'));var ejs=require(_0xc00f('0x8'));var fs=require('fs');var fs_extra=require(_0xc00f('0x9'));var _=require(_0xc00f('0xa'));var squel=require(_0xc00f('0xb'));var crypto=require(_0xc00f('0xc'));var jsforce=require(_0xc00f('0xd'));var deskjs=require(_0xc00f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc00f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc00f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc00f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc00f('0x12'));var utils=require(_0xc00f('0x13'));var config=require(_0xc00f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc00f('0x15'))['db'];function respondWithStatusCode(_0x4b99e3,_0x24d26e){_0x24d26e=_0x24d26e||0xcc;return function(_0x47f86c){if(_0x47f86c){return _0x4b99e3[_0xc00f('0x16')](_0x24d26e);}return _0x4b99e3[_0xc00f('0x17')](_0x24d26e)['end']();};}function respondWithResult(_0x28906b,_0x23403e){_0x23403e=_0x23403e||0xc8;return function(_0xe5d30){if(_0xe5d30){return _0x28906b[_0xc00f('0x17')](_0x23403e)['json'](_0xe5d30);}};}function respondWithFilteredResult(_0xe32924,_0x3a4115){return function(_0xe09ad2){if(_0xe09ad2){var _0xab9203=typeof _0x3a4115[_0xc00f('0x18')]===_0xc00f('0x19')&&typeof _0x3a4115[_0xc00f('0x1a')]===_0xc00f('0x19');var _0x54bded=_0xe09ad2['count'];var _0x2dadc2=_0xab9203?0x0:_0x3a4115[_0xc00f('0x18')];var _0x167436=_0xab9203?_0xe09ad2[_0xc00f('0x1b')]:_0x3a4115[_0xc00f('0x18')]+_0x3a4115['limit'];var _0x15b9f3;if(_0x167436>=_0x54bded){_0x167436=_0x54bded;_0x15b9f3=0xc8;}else{_0x15b9f3=0xce;}_0xe32924[_0xc00f('0x17')](_0x15b9f3);return _0xe32924[_0xc00f('0x1c')](_0xc00f('0x1d'),_0x2dadc2+'-'+_0x167436+'/'+_0x54bded)[_0xc00f('0x1e')](_0xe09ad2);}return null;};}function patchUpdates(_0x200aa3){return function(_0xff1902){try{jsonpatch[_0xc00f('0x1f')](_0xff1902,_0x200aa3,!![]);}catch(_0x12630e){return BPromise[_0xc00f('0x20')](_0x12630e);}return _0xff1902[_0xc00f('0x21')]();};}function saveUpdates(_0x1e3446,_0x1a9cd5){return function(_0x21e752){if(_0x21e752){return _0x21e752[_0xc00f('0x22')](_0x1e3446)[_0xc00f('0x23')](function(_0x101ccf){return _0x101ccf;});}return null;};}function removeEntity(_0x5efe50,_0x51aa29){return function(_0x52498c){if(_0x52498c){return _0x52498c[_0xc00f('0x24')]()[_0xc00f('0x23')](function(){_0x5efe50[_0xc00f('0x17')](0xcc)[_0xc00f('0x25')]();});}};}function handleEntityNotFound(_0x359462,_0x36d02f){return function(_0x2d3207){if(!_0x2d3207){_0x359462[_0xc00f('0x16')](0x194);}return _0x2d3207;};}function handleError(_0x510156,_0x2a1f45){_0x2a1f45=_0x2a1f45||0x1f4;return function(_0x47966e){logger[_0xc00f('0x26')](_0x47966e['stack']);if(_0x47966e[_0xc00f('0x27')]){delete _0x47966e[_0xc00f('0x27')];}_0x510156[_0xc00f('0x17')](_0x2a1f45)[_0xc00f('0x28')](_0x47966e);};}exports[_0xc00f('0x29')]=function(_0x4c8c8e,_0x3ed278){var _0x3d6811={},_0x2853c2={},_0x293051={'count':0x0,'rows':[]};var _0x4a73f1=_[_0xc00f('0x2a')](db[_0xc00f('0x2b')][_0xc00f('0x2c')],function(_0x2e7a48){return{'name':_0x2e7a48[_0xc00f('0x2d')],'type':_0x2e7a48[_0xc00f('0x2e')]['key']};});_0x2853c2[_0xc00f('0x2f')]=_['differenceBy'](_[_0xc00f('0x2a')](_0x4a73f1,_0xc00f('0x27')),[_0xc00f('0x27')]);_0x2853c2[_0xc00f('0x30')]=_[_0xc00f('0x31')](_0x4c8c8e[_0xc00f('0x30')]);_0x2853c2[_0xc00f('0x32')]=_[_0xc00f('0x33')](_0x2853c2['model'],_0x2853c2['query']);_0x3d6811[_0xc00f('0x34')]=_[_0xc00f('0x33')](_0x2853c2[_0xc00f('0x2f')],qs[_0xc00f('0x35')](_0x4c8c8e['query']['fields']));_0x3d6811[_0xc00f('0x34')]=_0x3d6811[_0xc00f('0x34')][_0xc00f('0x36')]?_0x3d6811['attributes']:_0x2853c2['model'];if(!_0x4c8c8e[_0xc00f('0x30')][_0xc00f('0x37')](_0xc00f('0x38'))){_0x3d6811['limit']=qs[_0xc00f('0x1a')](_0x4c8c8e[_0xc00f('0x30')][_0xc00f('0x1a')]);_0x3d6811[_0xc00f('0x18')]=qs[_0xc00f('0x18')](_0x4c8c8e[_0xc00f('0x30')][_0xc00f('0x18')]);}_0x3d6811[_0xc00f('0x39')]=qs[_0xc00f('0x3a')](_0x4c8c8e['query'][_0xc00f('0x3a')]);_0x3d6811[_0xc00f('0x3b')]=qs[_0xc00f('0x32')](_[_0xc00f('0x3c')](_0x4c8c8e['query'],_0x2853c2[_0xc00f('0x32')]),_0x4a73f1);if(_0x4c8c8e[_0xc00f('0x30')]['filter']){_0x3d6811['where']=_[_0xc00f('0x3d')](_0x3d6811[_0xc00f('0x3b')],{'$or':_[_0xc00f('0x2a')](_0x4a73f1,function(_0x3cbdb2){if(_0x3cbdb2[_0xc00f('0x2e')]!==_0xc00f('0x3e')){var _0x48ad92={};_0x48ad92[_0x3cbdb2[_0xc00f('0x27')]]={'$like':'%'+_0x4c8c8e[_0xc00f('0x30')][_0xc00f('0x3f')]+'%'};return _0x48ad92;}})});}_0x3d6811=_[_0xc00f('0x3d')]({},_0x3d6811,_0x4c8c8e['options']);var _0x460039={'where':_0x3d6811[_0xc00f('0x3b')]};return db['CmCustomField'][_0xc00f('0x1b')](_0x460039)[_0xc00f('0x23')](function(_0x37e1b0){_0x293051[_0xc00f('0x1b')]=_0x37e1b0;if(_0x4c8c8e[_0xc00f('0x30')][_0xc00f('0x40')]){_0x3d6811['include']=[{'all':!![]}];}return db['CmCustomField'][_0xc00f('0x41')](_0x3d6811);})[_0xc00f('0x23')](function(_0x10047a){_0x293051[_0xc00f('0x42')]=_0x10047a;return _0x293051;})[_0xc00f('0x23')](respondWithFilteredResult(_0x3ed278,_0x3d6811))[_0xc00f('0x43')](handleError(_0x3ed278,null));};exports[_0xc00f('0x44')]=function(_0x212aab,_0x32f41e){var _0x5e77d0={'raw':!![],'where':{'id':_0x212aab[_0xc00f('0x45')]['id']}},_0x4e3c3e={};_0x4e3c3e['model']=_[_0xc00f('0x31')](db['CmCustomField']['rawAttributes']);_0x4e3c3e[_0xc00f('0x30')]=_[_0xc00f('0x31')](_0x212aab['query']);_0x4e3c3e[_0xc00f('0x32')]=_[_0xc00f('0x33')](_0x4e3c3e[_0xc00f('0x2f')],_0x4e3c3e[_0xc00f('0x30')]);_0x5e77d0[_0xc00f('0x34')]=_[_0xc00f('0x33')](_0x4e3c3e['model'],qs[_0xc00f('0x35')](_0x212aab[_0xc00f('0x30')][_0xc00f('0x35')]));_0x5e77d0[_0xc00f('0x34')]=_0x5e77d0[_0xc00f('0x34')][_0xc00f('0x36')]?_0x5e77d0['attributes']:_0x4e3c3e[_0xc00f('0x2f')];if(_0x212aab[_0xc00f('0x30')][_0xc00f('0x40')]){_0x5e77d0[_0xc00f('0x46')]=[{'all':!![]}];}_0x5e77d0=_[_0xc00f('0x3d')]({},_0x5e77d0,_0x212aab[_0xc00f('0x47')]);return db[_0xc00f('0x2b')][_0xc00f('0x48')](_0x5e77d0)[_0xc00f('0x23')](handleEntityNotFound(_0x32f41e,null))[_0xc00f('0x23')](respondWithResult(_0x32f41e,null))[_0xc00f('0x43')](handleError(_0x32f41e,null));};exports[_0xc00f('0x22')]=function(_0x480198,_0x380fc4){if(_0x480198[_0xc00f('0x49')]['id']){delete _0x480198[_0xc00f('0x49')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x480198[_0xc00f('0x45')]['id']}})['then'](handleEntityNotFound(_0x380fc4,null))[_0xc00f('0x23')](saveUpdates(_0x480198['body'],null))[_0xc00f('0x23')](respondWithResult(_0x380fc4,null))[_0xc00f('0x43')](handleError(_0x380fc4,null));};exports[_0xc00f('0x24')]=function(_0x3e5060,_0x5af78d){return db[_0xc00f('0x2b')]['find']({'where':{'id':_0x3e5060['params']['id']}})[_0xc00f('0x23')](handleEntityNotFound(_0x5af78d,null))[_0xc00f('0x23')](removeEntity(_0x5af78d,null))[_0xc00f('0x43')](handleError(_0x5af78d,null));};exports['create']=function(_0x13e68d,_0x57d10b){var _0x32c10c;return db[_0xc00f('0x4a')][_0xc00f('0x4b')](function(_0x4ee3b4){return db[_0xc00f('0x2b')][_0xc00f('0x4c')](_0x13e68d[_0xc00f('0x49')],{'transaction':_0x4ee3b4})[_0xc00f('0x23')](function(_0x39bc33){_0x32c10c=_0x39bc33;var _0x4bf02a={'type':db[_0xc00f('0x4d')][_0xc00f('0x4e')],'transaction':_0x4ee3b4};switch(_0x13e68d[_0xc00f('0x49')][_0xc00f('0x2e')]){case _0xc00f('0x4f'):_0x4bf02a['type']=db[_0xc00f('0x4d')]['TEXT'];break;case _0xc00f('0x50'):_0x4bf02a[_0xc00f('0x2e')]=db[_0xc00f('0x4d')]['INTEGER'];break;case _0xc00f('0x51'):_0x4bf02a['type']=db[_0xc00f('0x4d')]['BOOLEAN'];_0x4bf02a[_0xc00f('0x52')]=![];break;default:}return db[_0xc00f('0x4a')]['queryInterface'][_0xc00f('0x53')]('cm_contacts',util[_0xc00f('0x54')](_0xc00f('0x55'),_0x32c10c['id']),_0x4bf02a);})['then'](function(){return _0x32c10c;});})['then'](respondWithResult(_0x57d10b,0xc9))[_0xc00f('0x43')](handleError(_0x57d10b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d7531b3..f5d3ef2 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 _0x4261=['moment','bluebird','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','api'];(function(_0x5e5e29,_0x36ab4f){var _0x3ecff2=function(_0x305355){while(--_0x305355){_0x5e5e29['push'](_0x5e5e29['shift']());}};_0x3ecff2(++_0x36ab4f);}(_0x4261,0x6b));var _0x1426=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4261[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x1426('0x0'));var util=require(_0x1426('0x1'));var logger=require('../../config/logger')(_0x1426('0x2'));var moment=require(_0x1426('0x3'));var BPromise=require(_0x1426('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1426('0x5'));var config=require('../../config/environment');var attributes=require(_0x1426('0x6'));module[_0x1426('0x7')]=function(_0x1a9a3a,_0x30b587){return _0x1a9a3a[_0x1426('0x8')](_0x1426('0x9'),attributes,{'tableName':_0x1426('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda86=['cm_custom_fields','lodash','util','api','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x1751f5,_0x50c972){var _0x1e40fc=function(_0x243f8c){while(--_0x243f8c){_0x1751f5['push'](_0x1751f5['shift']());}};_0x1e40fc(++_0x50c972);}(_0xda86,0x18d));var _0x6da8=function(_0x122f10,_0x4f95bd){_0x122f10=_0x122f10-0x0;var _0x3f5d42=_0xda86[_0x122f10];return _0x3f5d42;};'use strict';var _=require(_0x6da8('0x0'));var util=require(_0x6da8('0x1'));var logger=require('../../config/logger')(_0x6da8('0x2'));var moment=require('moment');var BPromise=require(_0x6da8('0x3'));var rp=require(_0x6da8('0x4'));var fs=require('fs');var path=require(_0x6da8('0x5'));var rimraf=require('rimraf');var config=require(_0x6da8('0x6'));var attributes=require(_0x6da8('0x7'));module[_0x6da8('0x8')]=function(_0x5d6dfd,_0x727f1c){return _0x5d6dfd[_0x6da8('0x9')]('CmCustomField',attributes,{'tableName':_0x6da8('0xa'),'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 49b8d51..f9dda0e 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 _0xc39e=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc39e,0x1e3));var _0xec39=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xc39e[_0x193e28];return _0x20ef59;};'use strict';var _=require(_0xec39('0x0'));var util=require(_0xec39('0x1'));var moment=require(_0xec39('0x2'));var BPromise=require(_0xec39('0x3'));var rs=require(_0xec39('0x4'));var fs=require('fs');var Redis=require(_0xec39('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec39('0x6'));var logger=require(_0xec39('0x7'))('rpc');var config=require(_0xec39('0x8'));var jayson=require(_0xec39('0x9'));var client=jayson[_0xec39('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd83c1c,_0x531612,_0x1c4919){return new BPromise(function(_0x21af77,_0x44db96){return client[_0xec39('0xb')](_0xd83c1c,_0x1c4919)[_0xec39('0xc')](function(_0xdf4660){logger[_0xec39('0xd')](_0xec39('0xe'),_0x531612,'request\x20sent');logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x531612,_0xec39('0xf'),JSON[_0xec39('0x10')](_0xdf4660));if(_0xdf4660[_0xec39('0x11')]){if(_0xdf4660[_0xec39('0x11')][_0xec39('0x12')]===0x1f4){logger[_0xec39('0x11')]('CmCustomField,\x20%s,\x20%s',_0x531612,_0xdf4660[_0xec39('0x11')]['message']);return _0x44db96(_0xdf4660[_0xec39('0x11')][_0xec39('0x13')]);}logger[_0xec39('0x11')](_0xec39('0xe'),_0x531612,_0xdf4660[_0xec39('0x11')][_0xec39('0x13')]);return _0x21af77(_0xdf4660[_0xec39('0x11')][_0xec39('0x13')]);}else{logger[_0xec39('0xd')](_0xec39('0xe'),_0x531612,_0xec39('0xf'));_0x21af77(_0xdf4660[_0xec39('0x14')][_0xec39('0x13')]);}})[_0xec39('0x15')](function(_0x5e6ee7){logger['error'](_0xec39('0xe'),_0x531612,_0x5e6ee7);_0x44db96(_0x5e6ee7);});});} \ No newline at end of file +var _0xe5ee=['code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xe5ee,0x8f));var _0xee5e=function(_0x405c43,_0x3e5b7c){_0x405c43=_0x405c43-0x0;var _0x5d09c8=_0xe5ee[_0x405c43];return _0x5d09c8;};'use strict';var _=require(_0xee5e('0x0'));var util=require(_0xee5e('0x1'));var moment=require(_0xee5e('0x2'));var BPromise=require('bluebird');var rs=require(_0xee5e('0x3'));var fs=require('fs');var Redis=require(_0xee5e('0x4'));var db=require(_0xee5e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee5e('0x6'));var config=require(_0xee5e('0x7'));var jayson=require(_0xee5e('0x8'));var client=jayson[_0xee5e('0x9')][_0xee5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a5e57,_0x413988,_0x4deade){return new BPromise(function(_0x4c2615,_0x2e0ef9){return client['request'](_0x3a5e57,_0x4deade)[_0xee5e('0xb')](function(_0x42d173){logger['info'](_0xee5e('0xc'),_0x413988,_0xee5e('0xd'));logger[_0xee5e('0xe')](_0xee5e('0xf'),_0x413988,_0xee5e('0xd'),JSON[_0xee5e('0x10')](_0x42d173));if(_0x42d173[_0xee5e('0x11')]){if(_0x42d173[_0xee5e('0x11')][_0xee5e('0x12')]===0x1f4){logger[_0xee5e('0x11')]('CmCustomField,\x20%s,\x20%s',_0x413988,_0x42d173['error']['message']);return _0x2e0ef9(_0x42d173['error'][_0xee5e('0x13')]);}logger[_0xee5e('0x11')]('CmCustomField,\x20%s,\x20%s',_0x413988,_0x42d173[_0xee5e('0x11')][_0xee5e('0x13')]);return _0x4c2615(_0x42d173[_0xee5e('0x11')][_0xee5e('0x13')]);}else{logger[_0xee5e('0x14')](_0xee5e('0xc'),_0x413988,_0xee5e('0xd'));_0x4c2615(_0x42d173[_0xee5e('0x15')][_0xee5e('0x13')]);}})[_0xee5e('0x16')](function(_0x2341f3){logger[_0xee5e('0x11')]('CmCustomField,\x20%s,\x20%s',_0x413988,_0x2341f3);_0x2e0ef9(_0x2341f3);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 932d5d0..5ba95c7 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 _0x9388=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9388,0x13f));var _0x8938=function(_0x171d55,_0x4d0b10){_0x171d55=_0x171d55-0x0;var _0x103ded=_0x9388[_0x171d55];return _0x103ded;};'use strict';var multer=require(_0x8938('0x0'));var util=require(_0x8938('0x1'));var path=require(_0x8938('0x2'));var timeout=require(_0x8938('0x3'));var express=require(_0x8938('0x4'));var router=express[_0x8938('0x5')]();var fs_extra=require(_0x8938('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8938('0x7'));var config=require(_0x8938('0x8'));var controller=require(_0x8938('0x9'));router[_0x8938('0xa')]('/',auth['isAuthenticated'](),controller[_0x8938('0xb')]);router[_0x8938('0xa')](_0x8938('0xc'),auth[_0x8938('0xd')](),controller[_0x8938('0xe')]);router['post']('/',auth[_0x8938('0xd')](),controller[_0x8938('0xf')]);router[_0x8938('0x10')](_0x8938('0xc'),auth[_0x8938('0xd')](),controller['update']);router[_0x8938('0x11')](_0x8938('0xc'),auth[_0x8938('0xd')](),controller['destroy']);module[_0x8938('0x12')]=router; \ No newline at end of file +var _0x2234=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x2234,0x16e));var _0x4223=function(_0x39cbe4,_0x4a7958){_0x39cbe4=_0x39cbe4-0x0;var _0xe76ba7=_0x2234[_0x39cbe4];return _0xe76ba7;};'use strict';var multer=require(_0x4223('0x0'));var util=require(_0x4223('0x1'));var path=require(_0x4223('0x2'));var timeout=require(_0x4223('0x3'));var express=require(_0x4223('0x4'));var router=express[_0x4223('0x5')]();var fs_extra=require(_0x4223('0x6'));var auth=require(_0x4223('0x7'));var interaction=require(_0x4223('0x8'));var config=require(_0x4223('0x9'));var controller=require('./cmCustomField.controller');router[_0x4223('0xa')]('/',auth['isAuthenticated'](),controller[_0x4223('0xb')]);router[_0x4223('0xa')](_0x4223('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x4223('0xd')](),controller[_0x4223('0xe')]);router[_0x4223('0xf')](_0x4223('0xc'),auth[_0x4223('0xd')](),controller['update']);router[_0x4223('0x10')](_0x4223('0xc'),auth[_0x4223('0xd')](),controller[_0x4223('0x11')]);module[_0x4223('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index fe3a32e..7c4db50 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 _0xadb5=['DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN'];(function(_0xad3524,_0x3061f4){var _0x4e6c4e=function(_0xaec9f4){while(--_0xaec9f4){_0xad3524['push'](_0xad3524['shift']());}};_0x4e6c4e(++_0x3061f4);}(_0xadb5,0xad));var _0x5adb=function(_0xe74d22,_0x2424a5){_0xe74d22=_0xe74d22-0x0;var _0x19934e=_0xadb5[_0xe74d22];return _0x19934e;};'use strict';var moment=require('moment');var Sequelize=require(_0x5adb('0x0'));module['exports']={'phone':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5adb('0x3')],'defaultValue':moment()['format'](_0x5adb('0x4'))},'countbusyretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5adb('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5adb('0x3')]},'priority':{'type':Sequelize[_0x5adb('0x5')](0x2)[_0x5adb('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5adb('0x5')],'unique':_0x5adb('0x7')},'ListId':{'type':Sequelize[_0x5adb('0x5')],'unique':_0x5adb('0x7')},'UserId':{'type':Sequelize[_0x5adb('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x5adb('0x5')],'unique':_0x5adb('0x7')},'CampaignId':{'type':Sequelize[_0x5adb('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5adb('0x5')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x5adb('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x4213=['sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x9fb085,_0x2251a3){var _0x400c75=function(_0x1455ed){while(--_0x1455ed){_0x9fb085['push'](_0x9fb085['shift']());}};_0x400c75(++_0x2251a3);}(_0x4213,0x77));var _0x3421=function(_0x19c766,_0x4634c0){_0x19c766=_0x19c766-0x0;var _0x4105e1=_0x4213[_0x19c766];return _0x4105e1;};'use strict';var moment=require(_0x3421('0x0'));var Sequelize=require(_0x3421('0x1'));module[_0x3421('0x2')]={'phone':{'type':Sequelize[_0x3421('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3421('0x5')],'defaultValue':moment()[_0x3421('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3421('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3421('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3421('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3421('0x7')],'unique':_0x3421('0x9')},'ListId':{'type':Sequelize[_0x3421('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3421('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x3421('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3421('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3421('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3421('0x5')],'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 da846b4..6da68ab 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 _0xa8fd=['$notIn','$like','$notLike','$iLike','$notILike','$contained','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','create','body','catch','describe','params','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','campaigntype','queue','ivr','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','end','getPreview','keys','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getVoiceQueues','findOne','recallme','getOpenContacts','isNumber','timezones','push','utcOffset','getTimezone','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','error','name','index','map','CmHopper','rawAttributes','fieldName','type','model','query','filters','intersection','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in'];(function(_0x232d09,_0x30a518){var _0x454385=function(_0x3a5fdd){while(--_0x3a5fdd){_0x232d09['push'](_0x232d09['shift']());}};_0x454385(++_0x30a518);}(_0xa8fd,0x17a));var _0xda8f=function(_0x35021f,_0x451349){_0x35021f=_0x35021f-0x0;var _0x1044e9=_0xa8fd[_0x35021f];return _0x1044e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda8f('0x0'));var zipdir=require(_0xda8f('0x1'));var jsonpatch=require(_0xda8f('0x2'));var rp=require(_0xda8f('0x3'));var moment=require(_0xda8f('0x4'));var BPromise=require(_0xda8f('0x5'));var Mustache=require(_0xda8f('0x6'));var util=require(_0xda8f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xda8f('0x8'));var ejs=require(_0xda8f('0x9'));var fs=require('fs');var fs_extra=require(_0xda8f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xda8f('0xb'));var toCsv=require(_0xda8f('0x8'));var querystring=require(_0xda8f('0xc'));var Papa=require('papaparse');var Redis=require(_0xda8f('0xd'));var authService=require(_0xda8f('0xe'));var qs=require(_0xda8f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xda8f('0x10'))('api');var utils=require(_0xda8f('0x11'));var config=require(_0xda8f('0x12'));var shared=require('../../config/environment');var licenseUtil=require(_0xda8f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e7969,_0x3bc5c2){_0x3bc5c2=_0x3bc5c2||0xcc;return function(_0x1b7972){if(_0x1b7972){return _0x1e7969[_0xda8f('0x14')](_0x3bc5c2);}return _0x1e7969[_0xda8f('0x15')](_0x3bc5c2)['end']();};}function respondWithResult(_0x203532,_0x524e82){_0x524e82=_0x524e82||0xc8;return function(_0x38b198){if(_0x38b198){return _0x203532['status'](_0x524e82)[_0xda8f('0x16')](_0x38b198);}};}function respondWithFilteredResult(_0x25eaed,_0x43ee2d){return function(_0x264488){if(_0x264488){var _0x9dba31=typeof _0x43ee2d[_0xda8f('0x17')]===_0xda8f('0x18')&&typeof _0x43ee2d[_0xda8f('0x19')]===_0xda8f('0x18');var _0x22bc5f=_0x264488[_0xda8f('0x1a')];var _0x5da974=_0x9dba31?0x0:_0x43ee2d[_0xda8f('0x17')];var _0x5eb4a4=_0x9dba31?_0x264488[_0xda8f('0x1a')]:_0x43ee2d[_0xda8f('0x17')]+_0x43ee2d[_0xda8f('0x19')];var _0x5d16bc;if(_0x5eb4a4>=_0x22bc5f){_0x5eb4a4=_0x22bc5f;_0x5d16bc=0xc8;}else{_0x5d16bc=0xce;}_0x25eaed['status'](_0x5d16bc);return _0x25eaed[_0xda8f('0x1b')]('Content-Range',_0x5da974+'-'+_0x5eb4a4+'/'+_0x22bc5f)[_0xda8f('0x16')](_0x264488);}return null;};}function patchUpdates(_0x261358){return function(_0x5f405d){try{jsonpatch[_0xda8f('0x1c')](_0x5f405d,_0x261358,!![]);}catch(_0x276065){return BPromise['reject'](_0x276065);}return _0x5f405d['save']();};}function saveUpdates(_0x243c9d,_0xf83a9){return function(_0x3bc92c){if(_0x3bc92c){return _0x3bc92c[_0xda8f('0x1d')](_0x243c9d)[_0xda8f('0x1e')](function(_0x3f709c){return _0x3f709c;});}return null;};}function removeEntity(_0x3c036a,_0x1acd2c){return function(_0x3d6c89){if(_0x3d6c89){return _0x3d6c89['destroy']()[_0xda8f('0x1e')](function(){_0x3c036a[_0xda8f('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2426af,_0x652829){return function(_0x275408){if(!_0x275408){_0x2426af['sendStatus'](0x194);}return _0x275408;};}function handleError(_0x1fdd4c,_0x26b08d){_0x26b08d=_0x26b08d||0x1f4;return function(_0x3789b7){logger[_0xda8f('0x1f')](_0x3789b7['stack']);if(_0x3789b7[_0xda8f('0x20')]){delete _0x3789b7[_0xda8f('0x20')];}_0x1fdd4c[_0xda8f('0x15')](_0x26b08d)['send'](_0x3789b7);};}exports[_0xda8f('0x21')]=function(_0x33b8b7,_0x57bba1){var _0x30682c={},_0x2dea16={},_0x287a9c={'count':0x0,'rows':[]};var _0xcc25ea=_[_0xda8f('0x22')](db[_0xda8f('0x23')][_0xda8f('0x24')],function(_0x4f7f5a){return{'name':_0x4f7f5a[_0xda8f('0x25')],'type':_0x4f7f5a[_0xda8f('0x26')]['key']};});_0x2dea16[_0xda8f('0x27')]=_[_0xda8f('0x22')](_0xcc25ea,'name');_0x2dea16[_0xda8f('0x28')]=_['keys'](_0x33b8b7[_0xda8f('0x28')]);_0x2dea16[_0xda8f('0x29')]=_[_0xda8f('0x2a')](_0x2dea16[_0xda8f('0x27')],_0x2dea16['query']);_0x2dea16[_0xda8f('0x29')]=_[_0xda8f('0x2b')](_0x2dea16[_0xda8f('0x29')],[_0xda8f('0x2c'),_0xda8f('0x2d'),_0xda8f('0x2e'),'$gte',_0xda8f('0x2f'),_0xda8f('0x30'),_0xda8f('0x31'),_0xda8f('0x32'),'$not',_0xda8f('0x33'),_0xda8f('0x34'),_0xda8f('0x35'),_0xda8f('0x36'),_0xda8f('0x37'),_0xda8f('0x38'),_0xda8f('0x39'),_0xda8f('0x3a'),_0xda8f('0x37'),'$overlap','$contains',_0xda8f('0x3b'),'$any']);_0x30682c[_0xda8f('0x3c')]=_[_0xda8f('0x2a')](_0x2dea16['model'],qs[_0xda8f('0x3d')](_0x33b8b7[_0xda8f('0x28')]['fields']));_0x30682c[_0xda8f('0x3c')]=_0x30682c[_0xda8f('0x3c')][_0xda8f('0x3e')]?_0x30682c[_0xda8f('0x3c')]:_0x2dea16[_0xda8f('0x27')];if(!_0x33b8b7['query']['hasOwnProperty']('nolimit')){_0x30682c[_0xda8f('0x19')]=qs[_0xda8f('0x19')](_0x33b8b7[_0xda8f('0x28')][_0xda8f('0x19')]);_0x30682c['offset']=qs[_0xda8f('0x17')](_0x33b8b7[_0xda8f('0x28')][_0xda8f('0x17')]);}_0x30682c[_0xda8f('0x3f')]=qs['sort'](_0x33b8b7[_0xda8f('0x28')][_0xda8f('0x40')]);_0x30682c[_0xda8f('0x41')]=qs[_0xda8f('0x29')](_[_0xda8f('0x42')](_0x33b8b7[_0xda8f('0x28')],_0x2dea16['filters']),_0xcc25ea);if(_0x33b8b7['query'][_0xda8f('0x43')]){_0x30682c[_0xda8f('0x41')]=_[_0xda8f('0x44')](_0x30682c[_0xda8f('0x41')],{'$or':_[_0xda8f('0x22')](_0xcc25ea,function(_0x4663d5){if(_0x4663d5[_0xda8f('0x26')]!==_0xda8f('0x45')){var _0x2021b6={};_0x2021b6[_0x4663d5['name']]={'$like':'%'+_0x33b8b7[_0xda8f('0x28')][_0xda8f('0x43')]+'%'};return _0x2021b6;}})});}_0x30682c=_[_0xda8f('0x44')]({},_0x30682c,_0x33b8b7[_0xda8f('0x46')]);var _0x4ca555={'where':_0x30682c['where']};return db[_0xda8f('0x23')][_0xda8f('0x1a')](_0x4ca555)[_0xda8f('0x1e')](function(_0x57df5e){_0x287a9c[_0xda8f('0x1a')]=_0x57df5e;if(_0x33b8b7[_0xda8f('0x28')]['includeAll']){_0x30682c[_0xda8f('0x47')]=[{'all':!![]}];}return db[_0xda8f('0x23')][_0xda8f('0x48')](_0x30682c);})[_0xda8f('0x1e')](function(_0x107e7f){_0x287a9c[_0xda8f('0x49')]=_0x107e7f;return _0x287a9c;})[_0xda8f('0x1e')](respondWithFilteredResult(_0x57bba1,_0x30682c))['catch'](handleError(_0x57bba1,null));};exports[_0xda8f('0x4a')]=function(_0x3f6390,_0x659596){var _0x283266={'raw':!![],'where':{'id':_0x3f6390['params']['id']}},_0x55dfe4={};_0x55dfe4[_0xda8f('0x27')]=_['keys'](db[_0xda8f('0x23')][_0xda8f('0x24')]);_0x55dfe4[_0xda8f('0x28')]=_['keys'](_0x3f6390[_0xda8f('0x28')]);_0x55dfe4[_0xda8f('0x29')]=_[_0xda8f('0x2a')](_0x55dfe4['model'],_0x55dfe4['query']);_0x283266[_0xda8f('0x3c')]=_[_0xda8f('0x2a')](_0x55dfe4['model'],qs[_0xda8f('0x3d')](_0x3f6390['query'][_0xda8f('0x3d')]));_0x283266[_0xda8f('0x3c')]=_0x283266[_0xda8f('0x3c')][_0xda8f('0x3e')]?_0x283266[_0xda8f('0x3c')]:_0x55dfe4['model'];if(_0x3f6390[_0xda8f('0x28')][_0xda8f('0x4b')]){_0x283266['include']=[{'all':!![]}];}_0x283266=_[_0xda8f('0x44')]({},_0x283266,_0x3f6390[_0xda8f('0x46')]);return db[_0xda8f('0x23')][_0xda8f('0x4c')](_0x283266)[_0xda8f('0x1e')](handleEntityNotFound(_0x659596,null))[_0xda8f('0x1e')](respondWithResult(_0x659596,null))['catch'](handleError(_0x659596,null));};exports[_0xda8f('0x4d')]=function(_0x5d7201,_0x49807d){return db[_0xda8f('0x23')][_0xda8f('0x4d')](_0x5d7201[_0xda8f('0x4e')],{})[_0xda8f('0x1e')](respondWithResult(_0x49807d,0xc9))['catch'](handleError(_0x49807d,null));};exports[_0xda8f('0x1d')]=function(_0x2a5bf2,_0xc91b40){if(_0x2a5bf2[_0xda8f('0x4e')]['id']){delete _0x2a5bf2[_0xda8f('0x4e')]['id'];}return db['CmHopper'][_0xda8f('0x4c')]({'where':{'id':_0x2a5bf2['params']['id']}})['then'](handleEntityNotFound(_0xc91b40,null))[_0xda8f('0x1e')](saveUpdates(_0x2a5bf2[_0xda8f('0x4e')],null))[_0xda8f('0x1e')](respondWithResult(_0xc91b40,null))[_0xda8f('0x4f')](handleError(_0xc91b40,null));};exports[_0xda8f('0x50')]=function(_0xf72783,_0x3ad912){return db[_0xda8f('0x23')][_0xda8f('0x50')]()[_0xda8f('0x1e')](respondWithResult(_0x3ad912,null))[_0xda8f('0x4f')](handleError(_0x3ad912,null));};exports['destroy']=function(_0x723d3d,_0x2ca0c3){var _0x2216ca;return db[_0xda8f('0x23')]['find']({'where':{'id':_0x723d3d[_0xda8f('0x51')]['id']}})[_0xda8f('0x1e')](handleEntityNotFound(_0x2ca0c3,null))[_0xda8f('0x1e')](function(_0x427bed){if(_0x427bed){return _0x427bed['destroy']()['then'](function(_0x1d7cb2){return _0x1d7cb2;});}})[_0xda8f('0x1e')](function(_0x40b92d){_0x2216ca=_0x40b92d;if(_0x40b92d){if(_0x40b92d['VoiceQueueId']||_0x40b92d['CampaignId']){return db[_0x40b92d[_0xda8f('0x52')]?_0xda8f('0x53'):_0xda8f('0x54')][_0xda8f('0x4c')]({'where':{'id':_0x40b92d[_0xda8f('0x52')]?_0x40b92d[_0xda8f('0x52')]:_0x40b92d['CampaignId']},'attributes':['id',_0xda8f('0x20')],'raw':!![]});}}})[_0xda8f('0x1e')](function(_0x1ecf7e){var _0x322770={};if(_0x1ecf7e){_['merge'](_0x322770,_[_0xda8f('0x55')](_0x2216ca[_0xda8f('0x56')],['createdAt',_0xda8f('0x57'),'id']));_0x322770['state']=0x15;_0x322770['statedesc']='deleted';_0x322770[_0xda8f('0x58')]=_0x1ecf7e[_0xda8f('0x20')];_0x322770[_0xda8f('0x59')]=_0x723d3d[_0xda8f('0x5a')][_0xda8f('0x20')];_0x322770[_0xda8f('0x5b')]=_0x723d3d['user']['id'];_0x322770['deleted']=!![];_0x322770[_0xda8f('0x5c')]=moment()[_0xda8f('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x322770[_0xda8f('0x5e')]=_0x2216ca[_0xda8f('0x5f')];_0x322770[_0xda8f('0x60')]=_0x2216ca[_0xda8f('0x52')]?_0xda8f('0x61'):_0xda8f('0x62');return db[_0xda8f('0x63')][_0xda8f('0x4c')]({'where':{'id':_0x322770['ContactId']},'attributes':['firstName',_0xda8f('0x64')]})[_0xda8f('0x1e')](function(_0x476b99){if(!_[_0xda8f('0x65')](_0x2ca0c3)&&!_[_0xda8f('0x65')](_0x476b99[_0xda8f('0x66')])){_0x322770[_0xda8f('0x67')]=_0x476b99[_0xda8f('0x66')];if(!_[_0xda8f('0x65')](_0x476b99[_0xda8f('0x64')])){_0x322770[_0xda8f('0x67')]+='\x20'+_0x476b99[_0xda8f('0x64')];}}})[_0xda8f('0x68')](function(){return db[_0xda8f('0x69')]['create'](_0x322770);});}})['then'](function(){return _0x2ca0c3[_0xda8f('0x15')](0xcc)[_0xda8f('0x6a')]();})[_0xda8f('0x4f')](handleError(_0x2ca0c3,null));};exports[_0xda8f('0x6b')]=function(_0x5e6dc2,_0xfec16b,_0x47dda3){var _0xfae6ed=[];return db[_0xda8f('0x63')]['describe']()[_0xda8f('0x1e')](function(_0x579b06){_0xfae6ed=_[_0xda8f('0x6c')](_0x579b06);return _0x5e6dc2['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xda8f('0x6d')},'attributes':['id',_0xda8f('0x6e'),_0xda8f('0x6f')],'raw':!![]});})['then'](function(_0x43db92){if(_0x43db92&&_0x43db92[_0xda8f('0x3e')]){return db[_0xda8f('0x70')][_0xda8f('0x71')](function(_0x311041){var _0x4b03eb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xda8f('0x72'))},'VoiceQueueId':{'$in':_[_0xda8f('0x22')](_0x43db92,'id')},'$or':[{'UserId':null},{'UserId':_0x5e6dc2[_0xda8f('0x5a')]['id']}]};var _0x3665f5={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x43db92)[_0xda8f('0x43')](['dialPreviewAutoRecallMe',0x0])[_0xda8f('0x22')]('id')[_0xda8f('0x73')]()},'$or':[{'UserId':null},{'UserId':_0x5e6dc2['user']['id']}]};var _0x70b463={'$or':[_0x4b03eb,_0x3665f5]};var _0x43480c=[];if(_0x5e6dc2[_0xda8f('0x4e')][_0xda8f('0x74')]&&_0x5e6dc2[_0xda8f('0x4e')][_0xda8f('0x74')]===_0xda8f('0x75')){if(!_[_0xda8f('0x76')](_0x5e6dc2[_0xda8f('0x4e')]['hopperIds'])){_0x70b463['id']={'$in':_0x5e6dc2[_0xda8f('0x4e')][_0xda8f('0x77')]};}_0x43480c=[[_0xda8f('0x78'),_0xda8f('0x79')],[_0xda8f('0x7a'),_0x43db92[0x0][_0xda8f('0x6e')]===_0xda8f('0x79')?_0xda8f('0x7b'):_0xda8f('0x79')],db['sequelize']['literal'](_0xda8f('0x7c')),['id',_0xda8f('0x7b')]];}else{if(!_[_0xda8f('0x76')](_0x5e6dc2[_0xda8f('0x4e')][_0xda8f('0x77')])){_0x70b463['id']={'$notIn':_0x5e6dc2['body'][_0xda8f('0x77')]};}_0x43480c=[[_0xda8f('0x78'),_0xda8f('0x7b')],['scheduledAt',_0x43db92[0x0][_0xda8f('0x6e')]],db[_0xda8f('0x70')][_0xda8f('0x7d')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xda8f('0x79')]];}return db['CmHopper']['findOne']({'attributes':['id',_0xda8f('0x7e'),'recallme'],'where':_0x70b463,'order':_0x43480c,'transaction':_0x311041,'lock':_0x311041[_0xda8f('0x7f')][_0xda8f('0x80')],'include':[{'model':db[_0xda8f('0x63')],'as':_0xda8f('0x81'),'attributes':_0xfae6ed,'include':[{'model':db[_0xda8f('0x82')],'as':_0xda8f('0x83'),'attributes':['id',_0xda8f('0x20')]}]},{'model':db[_0xda8f('0x84')],'as':_0xda8f('0x85'),'attributes':['id','name']},{'model':db[_0xda8f('0x53')],'as':'Queue','attributes':['id','name',_0xda8f('0x86')]}]})['then'](function(_0x58c882){if(_0x58c882){return _0x58c882[_0xda8f('0x1d')]({'UserId':_0x5e6dc2['user']['id']},{'transaction':_0x311041});}});});}})[_0xda8f('0x1e')](handleEntityNotFound(_0xfec16b,null))[_0xda8f('0x1e')](respondWithResult(_0xfec16b,null))[_0xda8f('0x4f')](handleError(_0xfec16b,null));};exports['getPreviewRecall']=function(_0x5df2bb,_0x34ee07,_0x10a1e4){var _0xed93b9=[];return db[_0xda8f('0x63')][_0xda8f('0x50')]()[_0xda8f('0x1e')](function(_0x3a425f){_0xed93b9=_[_0xda8f('0x6c')](_0x3a425f);return _0x5df2bb[_0xda8f('0x5a')][_0xda8f('0x87')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xda8f('0x6d')},'attributes':['id',_0xda8f('0x6e'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xda8f('0x1e')](function(_0x29d441){if(_0x29d441&&_0x29d441[_0xda8f('0x3e')]){return db['sequelize']['transaction'](function(_0x3956e1){var _0x3cda7d={'active':![],'recallme':!![],'id':_0x5df2bb['body']['hopperId']};return db[_0xda8f('0x23')][_0xda8f('0x88')]({'attributes':['id',_0xda8f('0x7e'),_0xda8f('0x89')],'where':_0x3cda7d,'transaction':_0x3956e1,'lock':_0x3956e1['LOCK']['UPDATE'],'include':[{'model':db[_0xda8f('0x63')],'as':'Contact','attributes':_0xed93b9,'include':[{'model':db[_0xda8f('0x82')],'as':'Company','attributes':['id',_0xda8f('0x20')]}]},{'model':db[_0xda8f('0x84')],'as':'List','attributes':['id',_0xda8f('0x20')]},{'model':db[_0xda8f('0x53')],'as':'Queue','attributes':['id','name',_0xda8f('0x86')]}]})['then'](function(_0x24f3cc){if(_0x24f3cc){return _0x24f3cc[_0xda8f('0x1d')]({'UserId':_0x5df2bb[_0xda8f('0x5a')]['id']},{'transaction':_0x3956e1});}});});}})[_0xda8f('0x1e')](handleEntityNotFound(_0x34ee07,null))[_0xda8f('0x1e')](respondWithResult(_0x34ee07,null))[_0xda8f('0x4f')](handleError(_0x34ee07,null));};exports[_0xda8f('0x8a')]=function(_0x5dc50f,_0x243b40,_0x430ada){return _0x5dc50f[_0xda8f('0x5a')][_0xda8f('0x87')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xda8f('0x6d')},'attributes':['id'],'raw':!![]})[_0xda8f('0x1e')](function(_0x4037e2){if(_0x4037e2&&_0x4037e2['length']){return db[_0xda8f('0x23')][_0xda8f('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xda8f('0x72'))},'VoiceQueueId':{'$in':_[_0xda8f('0x22')](_0x4037e2,'id')},'$or':[{'UserId':null},{'UserId':_0x5dc50f[_0xda8f('0x5a')]['id']}]}});}return 0x0;})[_0xda8f('0x1e')](function(_0x242bb5){if(!_[_0xda8f('0x65')](_0x242bb5)&&_[_0xda8f('0x8b')](_0x242bb5)){return _0x243b40['status'](0xc8)['json']({'contacts':_0x242bb5});}else{logger[_0xda8f('0x1f')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xda8f('0x8a'),0x194,'entity\x20not\x20found');_0x243b40[_0xda8f('0x14')](0x194);}})['catch'](handleError(_0x243b40,null));};exports['getTimezones']=function(_0x4bae29,_0xef8fbc,_0x571ca0){var _0x163401=shared[_0xda8f('0x8c')];var _0x472fd2=[];_[_0xda8f('0x22')](_0x163401,function(_0x5679c8){_0x472fd2[_0xda8f('0x8d')]({'id':_0x5679c8[_0xda8f('0x20')],'name':_0x5679c8[_0xda8f('0x20')],'utcOffset':_0x5679c8[_0xda8f('0x8e')]});});return _0xef8fbc['status'](0xc8)[_0xda8f('0x16')]({'tz':_0x472fd2});};exports[_0xda8f('0x8f')]=function(_0x43da9e,_0x508680,_0x3ff213){var _0x3ad28d=shared[_0xda8f('0x8c')];var _0x3f94ba={};if(!_[_0xda8f('0x65')](_0x3ad28d[_0x43da9e['body']['id']]))_0x3f94ba=_0x3ad28d[_0x43da9e[_0xda8f('0x4e')]['id']];return _0x508680[_0xda8f('0x15')](0xc8)[_0xda8f('0x16')](_0x3f94ba);}; \ No newline at end of file +var _0xd820=['YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','CmList','Queue','getPreviewRecall','preview','hopperId','Company','List','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','getTimezone','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','key','model','keys','query','filters','$and','$or','$gte','$lt','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','statedesc','campaign','membername','user','UserId','deleted','deletedat','format'];(function(_0x3c7805,_0x73d8b2){var _0xb11821=function(_0x3f3a69){while(--_0x3f3a69){_0x3c7805['push'](_0x3c7805['shift']());}};_0xb11821(++_0x73d8b2);}(_0xd820,0x16f));var _0x0d82=function(_0x101249,_0x4ef66e){_0x101249=_0x101249-0x0;var _0xea142a=_0xd820[_0x101249];return _0xea142a;};'use strict';var emlformat=require(_0x0d82('0x0'));var rimraf=require(_0x0d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d82('0x2'));var rp=require(_0x0d82('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d82('0x4'));var util=require(_0x0d82('0x5'));var path=require(_0x0d82('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d82('0x7'));var fs=require('fs');var fs_extra=require(_0x0d82('0x8'));var _=require(_0x0d82('0x9'));var squel=require(_0x0d82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d82('0xb'));var deskjs=require(_0x0d82('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d82('0xd'));var Redis=require(_0x0d82('0xe'));var authService=require(_0x0d82('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d82('0x10'));var logger=require(_0x0d82('0x11'))(_0x0d82('0x12'));var utils=require(_0x0d82('0x13'));var config=require(_0x0d82('0x14'));var shared=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0d82('0x15'))['db'];function respondWithStatusCode(_0x7fdd7a,_0x103e1d){_0x103e1d=_0x103e1d||0xcc;return function(_0x4ddcf0){if(_0x4ddcf0){return _0x7fdd7a[_0x0d82('0x16')](_0x103e1d);}return _0x7fdd7a[_0x0d82('0x17')](_0x103e1d)[_0x0d82('0x18')]();};}function respondWithResult(_0x3ad9dd,_0x288020){_0x288020=_0x288020||0xc8;return function(_0x11e218){if(_0x11e218){return _0x3ad9dd[_0x0d82('0x17')](_0x288020)[_0x0d82('0x19')](_0x11e218);}};}function respondWithFilteredResult(_0x2b2d47,_0x55415f){return function(_0x1e9024){if(_0x1e9024){var _0x507c9e=typeof _0x55415f[_0x0d82('0x1a')]==='undefined'&&typeof _0x55415f[_0x0d82('0x1b')]===_0x0d82('0x1c');var _0x16c858=_0x1e9024[_0x0d82('0x1d')];var _0x2bb0da=_0x507c9e?0x0:_0x55415f[_0x0d82('0x1a')];var _0x24c091=_0x507c9e?_0x1e9024[_0x0d82('0x1d')]:_0x55415f[_0x0d82('0x1a')]+_0x55415f[_0x0d82('0x1b')];var _0x219abc;if(_0x24c091>=_0x16c858){_0x24c091=_0x16c858;_0x219abc=0xc8;}else{_0x219abc=0xce;}_0x2b2d47[_0x0d82('0x17')](_0x219abc);return _0x2b2d47[_0x0d82('0x1e')](_0x0d82('0x1f'),_0x2bb0da+'-'+_0x24c091+'/'+_0x16c858)['json'](_0x1e9024);}return null;};}function patchUpdates(_0x517997){return function(_0x3874a7){try{jsonpatch[_0x0d82('0x20')](_0x3874a7,_0x517997,!![]);}catch(_0x18d869){return BPromise['reject'](_0x18d869);}return _0x3874a7['save']();};}function saveUpdates(_0x2e332d,_0x20d5eb){return function(_0xd3dc36){if(_0xd3dc36){return _0xd3dc36[_0x0d82('0x21')](_0x2e332d)[_0x0d82('0x22')](function(_0x18c248){return _0x18c248;});}return null;};}function removeEntity(_0x4a2d4d,_0xb04794){return function(_0x22a85a){if(_0x22a85a){return _0x22a85a[_0x0d82('0x23')]()['then'](function(){_0x4a2d4d[_0x0d82('0x17')](0xcc)[_0x0d82('0x18')]();});}};}function handleEntityNotFound(_0x35a614,_0x51b5a1){return function(_0x26a9ca){if(!_0x26a9ca){_0x35a614[_0x0d82('0x16')](0x194);}return _0x26a9ca;};}function handleError(_0xa636f0,_0x5b3307){_0x5b3307=_0x5b3307||0x1f4;return function(_0x3258cf){logger[_0x0d82('0x24')](_0x3258cf[_0x0d82('0x25')]);if(_0x3258cf[_0x0d82('0x26')]){delete _0x3258cf[_0x0d82('0x26')];}_0xa636f0[_0x0d82('0x17')](_0x5b3307)['send'](_0x3258cf);};}exports[_0x0d82('0x27')]=function(_0x15bc2b,_0x43f679){var _0xf08815={},_0x548f33={},_0x465cd6={'count':0x0,'rows':[]};var _0x293276=_[_0x0d82('0x28')](db[_0x0d82('0x29')][_0x0d82('0x2a')],function(_0x730ed9){return{'name':_0x730ed9[_0x0d82('0x2b')],'type':_0x730ed9['type'][_0x0d82('0x2c')]};});_0x548f33[_0x0d82('0x2d')]=_['map'](_0x293276,_0x0d82('0x26'));_0x548f33['query']=_[_0x0d82('0x2e')](_0x15bc2b[_0x0d82('0x2f')]);_0x548f33[_0x0d82('0x30')]=_['intersection'](_0x548f33[_0x0d82('0x2d')],_0x548f33[_0x0d82('0x2f')]);_0x548f33[_0x0d82('0x30')]=_['concat'](_0x548f33[_0x0d82('0x30')],[_0x0d82('0x31'),_0x0d82('0x32'),'$gt',_0x0d82('0x33'),_0x0d82('0x34'),'$lte',_0x0d82('0x35'),'$eq',_0x0d82('0x36'),_0x0d82('0x37'),_0x0d82('0x38'),_0x0d82('0x39'),_0x0d82('0x3a'),_0x0d82('0x3b'),_0x0d82('0x3c'),_0x0d82('0x3d'),_0x0d82('0x3e'),_0x0d82('0x3b'),_0x0d82('0x3f'),_0x0d82('0x40'),_0x0d82('0x41'),_0x0d82('0x42')]);_0xf08815[_0x0d82('0x43')]=_[_0x0d82('0x44')](_0x548f33[_0x0d82('0x2d')],qs[_0x0d82('0x45')](_0x15bc2b[_0x0d82('0x2f')][_0x0d82('0x45')]));_0xf08815[_0x0d82('0x43')]=_0xf08815['attributes'][_0x0d82('0x46')]?_0xf08815['attributes']:_0x548f33[_0x0d82('0x2d')];if(!_0x15bc2b[_0x0d82('0x2f')][_0x0d82('0x47')]('nolimit')){_0xf08815['limit']=qs[_0x0d82('0x1b')](_0x15bc2b[_0x0d82('0x2f')][_0x0d82('0x1b')]);_0xf08815[_0x0d82('0x1a')]=qs['offset'](_0x15bc2b[_0x0d82('0x2f')]['offset']);}_0xf08815[_0x0d82('0x48')]=qs[_0x0d82('0x49')](_0x15bc2b[_0x0d82('0x2f')]['sort']);_0xf08815[_0x0d82('0x4a')]=qs[_0x0d82('0x30')](_[_0x0d82('0x4b')](_0x15bc2b[_0x0d82('0x2f')],_0x548f33[_0x0d82('0x30')]),_0x293276);if(_0x15bc2b['query'][_0x0d82('0x4c')]){_0xf08815[_0x0d82('0x4a')]=_[_0x0d82('0x4d')](_0xf08815[_0x0d82('0x4a')],{'$or':_['map'](_0x293276,function(_0x5eae87){if(_0x5eae87[_0x0d82('0x4e')]!==_0x0d82('0x4f')){var _0x5d4b63={};_0x5d4b63[_0x5eae87[_0x0d82('0x26')]]={'$like':'%'+_0x15bc2b[_0x0d82('0x2f')]['filter']+'%'};return _0x5d4b63;}})});}_0xf08815=_[_0x0d82('0x4d')]({},_0xf08815,_0x15bc2b[_0x0d82('0x50')]);var _0x50248b={'where':_0xf08815[_0x0d82('0x4a')]};return db[_0x0d82('0x29')][_0x0d82('0x1d')](_0x50248b)[_0x0d82('0x22')](function(_0x520729){_0x465cd6['count']=_0x520729;if(_0x15bc2b['query'][_0x0d82('0x51')]){_0xf08815[_0x0d82('0x52')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xf08815);})[_0x0d82('0x22')](function(_0x4ac162){_0x465cd6[_0x0d82('0x53')]=_0x4ac162;return _0x465cd6;})['then'](respondWithFilteredResult(_0x43f679,_0xf08815))[_0x0d82('0x54')](handleError(_0x43f679,null));};exports[_0x0d82('0x55')]=function(_0x2b72aa,_0x4dd5cb){var _0x2d8249={'raw':!![],'where':{'id':_0x2b72aa[_0x0d82('0x56')]['id']}},_0x101c7f={};_0x101c7f[_0x0d82('0x2d')]=_['keys'](db[_0x0d82('0x29')][_0x0d82('0x2a')]);_0x101c7f[_0x0d82('0x2f')]=_[_0x0d82('0x2e')](_0x2b72aa[_0x0d82('0x2f')]);_0x101c7f['filters']=_[_0x0d82('0x44')](_0x101c7f[_0x0d82('0x2d')],_0x101c7f[_0x0d82('0x2f')]);_0x2d8249['attributes']=_[_0x0d82('0x44')](_0x101c7f[_0x0d82('0x2d')],qs[_0x0d82('0x45')](_0x2b72aa[_0x0d82('0x2f')]['fields']));_0x2d8249[_0x0d82('0x43')]=_0x2d8249['attributes'][_0x0d82('0x46')]?_0x2d8249['attributes']:_0x101c7f[_0x0d82('0x2d')];if(_0x2b72aa[_0x0d82('0x2f')]['includeAll']){_0x2d8249['include']=[{'all':!![]}];}_0x2d8249=_['merge']({},_0x2d8249,_0x2b72aa[_0x0d82('0x50')]);return db['CmHopper'][_0x0d82('0x57')](_0x2d8249)[_0x0d82('0x22')](handleEntityNotFound(_0x4dd5cb,null))[_0x0d82('0x22')](respondWithResult(_0x4dd5cb,null))['catch'](handleError(_0x4dd5cb,null));};exports[_0x0d82('0x58')]=function(_0x4df749,_0xc278ce){return db[_0x0d82('0x29')][_0x0d82('0x58')](_0x4df749[_0x0d82('0x59')],{})[_0x0d82('0x22')](respondWithResult(_0xc278ce,0xc9))[_0x0d82('0x54')](handleError(_0xc278ce,null));};exports['update']=function(_0x4dc82d,_0x4cfec5){if(_0x4dc82d[_0x0d82('0x59')]['id']){delete _0x4dc82d[_0x0d82('0x59')]['id'];}return db[_0x0d82('0x29')][_0x0d82('0x57')]({'where':{'id':_0x4dc82d[_0x0d82('0x56')]['id']}})[_0x0d82('0x22')](handleEntityNotFound(_0x4cfec5,null))[_0x0d82('0x22')](saveUpdates(_0x4dc82d[_0x0d82('0x59')],null))[_0x0d82('0x22')](respondWithResult(_0x4cfec5,null))[_0x0d82('0x54')](handleError(_0x4cfec5,null));};exports[_0x0d82('0x5a')]=function(_0x7b37ca,_0x29a3f0){return db[_0x0d82('0x29')][_0x0d82('0x5a')]()[_0x0d82('0x22')](respondWithResult(_0x29a3f0,null))['catch'](handleError(_0x29a3f0,null));};exports[_0x0d82('0x23')]=function(_0x1e2e26,_0x1446e1){var _0x2c4637;return db[_0x0d82('0x29')][_0x0d82('0x57')]({'where':{'id':_0x1e2e26['params']['id']}})[_0x0d82('0x22')](handleEntityNotFound(_0x1446e1,null))[_0x0d82('0x22')](function(_0x47259a){if(_0x47259a){return _0x47259a[_0x0d82('0x23')]()[_0x0d82('0x22')](function(_0x4ce711){return _0x4ce711;});}})[_0x0d82('0x22')](function(_0x3e3234){_0x2c4637=_0x3e3234;if(_0x3e3234){if(_0x3e3234['VoiceQueueId']||_0x3e3234['CampaignId']){return db[_0x3e3234[_0x0d82('0x5b')]?_0x0d82('0x5c'):_0x0d82('0x5d')][_0x0d82('0x57')]({'where':{'id':_0x3e3234[_0x0d82('0x5b')]?_0x3e3234[_0x0d82('0x5b')]:_0x3e3234[_0x0d82('0x5e')]},'attributes':['id',_0x0d82('0x26')],'raw':!![]});}}})['then'](function(_0x204885){var _0x57ab95={};if(_0x204885){_[_0x0d82('0x4d')](_0x57ab95,_[_0x0d82('0x5f')](_0x2c4637[_0x0d82('0x60')],[_0x0d82('0x61'),_0x0d82('0x62'),'id']));_0x57ab95['state']=0x15;_0x57ab95[_0x0d82('0x63')]='deleted';_0x57ab95[_0x0d82('0x64')]=_0x204885[_0x0d82('0x26')];_0x57ab95[_0x0d82('0x65')]=_0x1e2e26[_0x0d82('0x66')][_0x0d82('0x26')];_0x57ab95[_0x0d82('0x67')]=_0x1e2e26['user']['id'];_0x57ab95[_0x0d82('0x68')]=!![];_0x57ab95[_0x0d82('0x69')]=moment()[_0x0d82('0x6a')](_0x0d82('0x6b'));_0x57ab95[_0x0d82('0x6c')]=_0x2c4637[_0x0d82('0x6d')];_0x57ab95['campaigntype']=_0x2c4637[_0x0d82('0x5b')]?_0x0d82('0x6e'):'ivr';return db[_0x0d82('0x6f')][_0x0d82('0x57')]({'where':{'id':_0x57ab95[_0x0d82('0x70')]},'attributes':[_0x0d82('0x71'),_0x0d82('0x72')]})['then'](function(_0x332353){if(!_[_0x0d82('0x73')](_0x1446e1)&&!_['isNil'](_0x332353[_0x0d82('0x71')])){_0x57ab95['calleridname']=_0x332353[_0x0d82('0x71')];if(!_[_0x0d82('0x73')](_0x332353[_0x0d82('0x72')])){_0x57ab95[_0x0d82('0x74')]+='\x20'+_0x332353[_0x0d82('0x72')];}}})[_0x0d82('0x75')](function(){return db['CmHopperFinal'][_0x0d82('0x58')](_0x57ab95);});}})['then'](function(){return _0x1446e1[_0x0d82('0x17')](0xcc)[_0x0d82('0x18')]();})['catch'](handleError(_0x1446e1,null));};exports[_0x0d82('0x76')]=function(_0x3c9ce3,_0x2aa853,_0x31a389){var _0x216e12=[];return db[_0x0d82('0x6f')][_0x0d82('0x5a')]()[_0x0d82('0x22')](function(_0x420975){_0x216e12=_['keys'](_0x420975);return _0x3c9ce3['user'][_0x0d82('0x77')]({'where':{'type':_0x0d82('0x78'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x0d82('0x79'),_0x0d82('0x7a')],'raw':!![]});})[_0x0d82('0x22')](function(_0x413ee2){if(_0x413ee2&&_0x413ee2['length']){return db['sequelize'][_0x0d82('0x7b')](function(_0x2cc06e){var _0x1d2745={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x0d82('0x28')](_0x413ee2,'id')},'$or':[{'UserId':null},{'UserId':_0x3c9ce3[_0x0d82('0x66')]['id']}]};var _0x870ac3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x413ee2)['filter']([_0x0d82('0x7a'),0x0])[_0x0d82('0x28')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3c9ce3['user']['id']}]};var _0x55cc3c={'$or':[_0x1d2745,_0x870ac3]};var _0x36e99c=[];if(_0x3c9ce3['body'][_0x0d82('0x7c')]&&_0x3c9ce3[_0x0d82('0x59')][_0x0d82('0x7c')]===_0x0d82('0x7d')){if(!_[_0x0d82('0x7e')](_0x3c9ce3[_0x0d82('0x59')][_0x0d82('0x7f')])){_0x55cc3c['id']={'$in':_0x3c9ce3['body'][_0x0d82('0x7f')]};}_0x36e99c=[[_0x0d82('0x80'),'ASC'],['scheduledAt',_0x413ee2[0x0][_0x0d82('0x79')]===_0x0d82('0x81')?'DESC':'ASC'],db[_0x0d82('0x82')][_0x0d82('0x83')](_0x0d82('0x84')),['id',_0x0d82('0x85')]];}else{if(!_[_0x0d82('0x7e')](_0x3c9ce3['body']['hopperIds'])){_0x55cc3c['id']={'$notIn':_0x3c9ce3[_0x0d82('0x59')][_0x0d82('0x7f')]};}_0x36e99c=[[_0x0d82('0x80'),_0x0d82('0x85')],[_0x0d82('0x86'),_0x413ee2[0x0][_0x0d82('0x79')]],db['sequelize'][_0x0d82('0x83')](_0x0d82('0x87')),['id',_0x0d82('0x81')]];}return db[_0x0d82('0x29')][_0x0d82('0x88')]({'attributes':['id',_0x0d82('0x89'),_0x0d82('0x8a')],'where':_0x55cc3c,'order':_0x36e99c,'transaction':_0x2cc06e,'lock':_0x2cc06e[_0x0d82('0x8b')]['UPDATE'],'include':[{'model':db[_0x0d82('0x6f')],'as':_0x0d82('0x8c'),'attributes':_0x216e12,'include':[{'model':db[_0x0d82('0x8d')],'as':'Company','attributes':['id',_0x0d82('0x26')]}]},{'model':db[_0x0d82('0x8e')],'as':'List','attributes':['id',_0x0d82('0x26')]},{'model':db['VoiceQueue'],'as':_0x0d82('0x8f'),'attributes':['id',_0x0d82('0x26'),'dialActive']}]})[_0x0d82('0x22')](function(_0x4b4555){if(_0x4b4555){return _0x4b4555[_0x0d82('0x21')]({'UserId':_0x3c9ce3[_0x0d82('0x66')]['id']},{'transaction':_0x2cc06e});}});});}})[_0x0d82('0x22')](handleEntityNotFound(_0x2aa853,null))['then'](respondWithResult(_0x2aa853,null))['catch'](handleError(_0x2aa853,null));};exports[_0x0d82('0x90')]=function(_0x30ac67,_0x2026aa,_0x35ff90){var _0x58c321=[];return db['CmContact'][_0x0d82('0x5a')]()[_0x0d82('0x22')](function(_0x38bc9a){_0x58c321=_[_0x0d82('0x2e')](_0x38bc9a);return _0x30ac67[_0x0d82('0x66')][_0x0d82('0x77')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x0d82('0x91')},'attributes':['id',_0x0d82('0x79'),_0x0d82('0x7a')],'raw':!![]});})[_0x0d82('0x22')](function(_0x5eb62f){if(_0x5eb62f&&_0x5eb62f[_0x0d82('0x46')]){return db[_0x0d82('0x82')][_0x0d82('0x7b')](function(_0x268a7a){var _0x322338={'active':![],'recallme':!![],'id':_0x30ac67[_0x0d82('0x59')][_0x0d82('0x92')]};return db[_0x0d82('0x29')]['findOne']({'attributes':['id',_0x0d82('0x89'),_0x0d82('0x8a')],'where':_0x322338,'transaction':_0x268a7a,'lock':_0x268a7a[_0x0d82('0x8b')]['UPDATE'],'include':[{'model':db[_0x0d82('0x6f')],'as':_0x0d82('0x8c'),'attributes':_0x58c321,'include':[{'model':db[_0x0d82('0x8d')],'as':_0x0d82('0x93'),'attributes':['id',_0x0d82('0x26')]}]},{'model':db[_0x0d82('0x8e')],'as':_0x0d82('0x94'),'attributes':['id',_0x0d82('0x26')]},{'model':db[_0x0d82('0x5c')],'as':_0x0d82('0x8f'),'attributes':['id','name',_0x0d82('0x95')]}]})['then'](function(_0x139b06){if(_0x139b06){return _0x139b06[_0x0d82('0x21')]({'UserId':_0x30ac67[_0x0d82('0x66')]['id']},{'transaction':_0x268a7a});}});});}})[_0x0d82('0x22')](handleEntityNotFound(_0x2026aa,null))['then'](respondWithResult(_0x2026aa,null))[_0x0d82('0x54')](handleError(_0x2026aa,null));};exports['getOpenContacts']=function(_0x2459ae,_0x14e534,_0x1be058){return _0x2459ae[_0x0d82('0x66')][_0x0d82('0x77')]({'where':{'type':_0x0d82('0x78'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x35b1ab){if(_0x35b1ab&&_0x35b1ab['length']){return db[_0x0d82('0x29')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0d82('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x0d82('0x28')](_0x35b1ab,'id')},'$or':[{'UserId':null},{'UserId':_0x2459ae['user']['id']}]}});}return 0x0;})[_0x0d82('0x22')](function(_0x5250b9){if(!_[_0x0d82('0x73')](_0x5250b9)&&_[_0x0d82('0x96')](_0x5250b9)){return _0x14e534[_0x0d82('0x17')](0xc8)[_0x0d82('0x19')]({'contacts':_0x5250b9});}else{logger[_0x0d82('0x24')](_0x0d82('0x97'),_0x0d82('0x98'),0x194,_0x0d82('0x99'));_0x14e534[_0x0d82('0x16')](0x194);}})[_0x0d82('0x54')](handleError(_0x14e534,null));};exports[_0x0d82('0x9a')]=function(_0x21f4ba,_0x15f8eb,_0x30cf6a){var _0x52816c=shared[_0x0d82('0x9b')];var _0x3def6b=[];_[_0x0d82('0x28')](_0x52816c,function(_0xecb716){_0x3def6b[_0x0d82('0x9c')]({'id':_0xecb716['name'],'name':_0xecb716[_0x0d82('0x26')],'utcOffset':_0xecb716['utcOffset']});});return _0x15f8eb[_0x0d82('0x17')](0xc8)[_0x0d82('0x19')]({'tz':_0x3def6b});};exports[_0x0d82('0x9d')]=function(_0x48009d,_0x416672,_0x561236){var _0x57be98=shared['timezones'];var _0x43cc76={};if(!_[_0x0d82('0x73')](_0x57be98[_0x48009d['body']['id']]))_0x43cc76=_0x57be98[_0x48009d[_0x0d82('0x59')]['id']];return _0x416672[_0x0d82('0x17')](0xc8)[_0x0d82('0x19')](_0x43cc76);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index bcca033..d2c7078 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 _0x5fc3=['scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0x2181dc,_0x6a8b82){var _0x2fe9a6=function(_0x56a028){while(--_0x56a028){_0x2181dc['push'](_0x2181dc['shift']());}};_0x2fe9a6(++_0x6a8b82);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0x5fc3[_0x4b784d];return _0x2cdeaf;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('CmHopper',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]},{'name':_0x35fc('0xd'),'fields':[_0x35fc('0xd')]},{'name':_0x35fc('0xe'),'fields':[_0x35fc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x4090ec,_0x2314d7){var _0x3917ae=function(_0x29f263){while(--_0x29f263){_0x4090ec['push'](_0x4090ec['shift']());}};_0x3917ae(++_0x2314d7);}(_0xafc4,0x69));var _0x4afc=function(_0x4982d2,_0x2ca5e4){_0x4982d2=_0x4982d2-0x0;var _0x1f458f=_0xafc4[_0x4982d2];return _0x1f458f;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x4afc('0xa')]},{'name':_0x4afc('0xb'),'fields':[_0x4afc('0xb')]},{'name':_0x4afc('0xc'),'fields':[_0x4afc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index a8dda37..aa92faa 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 _0x02a1=['active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','User','Agent','voicePause','length','UserId','push','includes','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','CmList','List','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','twilio/lib/webhooks/webhooks','client','http','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCmHopper','stringify','catch','ShowCmHopper','create','body','CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02a1,0x13b));var _0x102a=function(_0x32eaa7,_0x271e4a){_0x32eaa7=_0x32eaa7-0x0;var _0x2cb094=_0x02a1[_0x32eaa7];return _0x2cb094;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x102a('0x0'));var BPromise=require(_0x102a('0x1'));var rs=require(_0x102a('0x2'));var fs=require('fs');var Redis=require(_0x102a('0x3'));var db=require(_0x102a('0x4'))['db'];var utils=require(_0x102a('0x5'));var logger=require(_0x102a('0x6'))(_0x102a('0x7'));var config=require(_0x102a('0x8'));var jayson=require('jayson/promise');const {validateExpressRequest}=require(_0x102a('0x9'));var client=jayson[_0x102a('0xa')][_0x102a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b74f6,_0x107c2c,_0x2ab5bf){return new BPromise(function(_0x47a136,_0x7aa0fb){return client['request'](_0x1b74f6,_0x2ab5bf)['then'](function(_0x1d1d46){logger[_0x102a('0xc')](_0x102a('0xd'),_0x107c2c,_0x102a('0xe'));logger[_0x102a('0xf')](_0x102a('0x10'),_0x107c2c,_0x102a('0xe'),JSON['stringify'](_0x1d1d46));if(_0x1d1d46[_0x102a('0x11')]){if(_0x1d1d46['error'][_0x102a('0x12')]===0x1f4){logger[_0x102a('0x11')]('CmHopper,\x20%s,\x20%s',_0x107c2c,_0x1d1d46['error'][_0x102a('0x13')]);return _0x7aa0fb(_0x1d1d46[_0x102a('0x11')][_0x102a('0x13')]);}logger[_0x102a('0x11')]('CmHopper,\x20%s,\x20%s',_0x107c2c,_0x1d1d46['error'][_0x102a('0x13')]);return _0x47a136(_0x1d1d46[_0x102a('0x11')][_0x102a('0x13')]);}else{logger['info'](_0x102a('0xd'),_0x107c2c,_0x102a('0xe'));_0x47a136(_0x1d1d46[_0x102a('0x14')][_0x102a('0x13')]);}})['catch'](function(_0x592b59){logger[_0x102a('0x11')](_0x102a('0xd'),_0x107c2c,_0x592b59);_0x7aa0fb(_0x592b59);});});}exports['GetCmHopper']=function(_0x1e6020){var _0x283d37=this;return new Promise(function(_0xda8175,_0x243eb7){return db[_0x102a('0x15')][_0x102a('0x16')]({'raw':_0x1e6020[_0x102a('0x17')]?_0x1e6020['options'][_0x102a('0x18')]===undefined?!![]:![]:!![],'where':_0x1e6020['options']?_0x1e6020['options'][_0x102a('0x19')]||null:null,'attributes':_0x1e6020['options']?_0x1e6020[_0x102a('0x17')][_0x102a('0x1a')]||null:null,'limit':_0x1e6020[_0x102a('0x17')]?_0x1e6020[_0x102a('0x17')][_0x102a('0x1b')]||null:null,'include':_0x1e6020[_0x102a('0x17')]?_0x1e6020[_0x102a('0x17')][_0x102a('0x1c')]?_[_0x102a('0x1d')](_0x1e6020[_0x102a('0x17')][_0x102a('0x1c')],function(_0x4bfc95){return{'model':db[_0x4bfc95['model']],'as':_0x4bfc95['as'],'attributes':_0x4bfc95[_0x102a('0x1a')],'include':_0x4bfc95[_0x102a('0x1c')]?_['map'](_0x4bfc95[_0x102a('0x1c')],function(_0x4e2dff){return{'model':db[_0x4e2dff[_0x102a('0x1e')]],'as':_0x4e2dff['as'],'attributes':_0x4e2dff[_0x102a('0x1a')],'include':_0x4e2dff['include']?_[_0x102a('0x1d')](_0x4e2dff[_0x102a('0x1c')],function(_0x3d835d){return{'model':db[_0x3d835d['model']],'as':_0x3d835d['as'],'attributes':_0x3d835d[_0x102a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x102a('0x1f')](function(_0x752258){logger[_0x102a('0xc')]('GetCmHopper',_0x1e6020);logger[_0x102a('0xf')](_0x102a('0x20'),_0x1e6020,JSON[_0x102a('0x21')](_0x752258));_0xda8175(_0x752258);})[_0x102a('0x22')](function(_0x1a09a1){logger[_0x102a('0x11')](_0x102a('0x20'),_0x1a09a1[_0x102a('0x13')],_0x1e6020);_0x243eb7(_0x283d37[_0x102a('0x11')](0x1f4,_0x1a09a1[_0x102a('0x13')]));});});};exports[_0x102a('0x23')]=function(_0xc900ea){var _0x100008=this;return new Promise(function(_0x56e6ce,_0x15b572){return db[_0x102a('0x15')]['find']({'raw':_0xc900ea['options']?_0xc900ea[_0x102a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xc900ea[_0x102a('0x17')]?_0xc900ea[_0x102a('0x17')][_0x102a('0x19')]||null:null,'attributes':_0xc900ea[_0x102a('0x17')]?_0xc900ea['options'][_0x102a('0x1a')]||null:null,'include':_0xc900ea[_0x102a('0x17')]?_0xc900ea[_0x102a('0x17')]['include']?_['map'](_0xc900ea[_0x102a('0x17')][_0x102a('0x1c')],function(_0x1ce207){return{'model':db[_0x1ce207['model']],'as':_0x1ce207['as'],'attributes':_0x1ce207[_0x102a('0x1a')],'include':_0x1ce207[_0x102a('0x1c')]?_['map'](_0x1ce207['include'],function(_0x318ae8){return{'model':db[_0x318ae8[_0x102a('0x1e')]],'as':_0x318ae8['as'],'attributes':_0x318ae8[_0x102a('0x1a')],'include':_0x318ae8[_0x102a('0x1c')]?_[_0x102a('0x1d')](_0x318ae8['include'],function(_0xb1bad5){return{'model':db[_0xb1bad5[_0x102a('0x1e')]],'as':_0xb1bad5['as'],'attributes':_0xb1bad5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x513cc9){logger[_0x102a('0xc')](_0x102a('0x23'),_0xc900ea);logger[_0x102a('0xf')](_0x102a('0x23'),_0xc900ea,JSON[_0x102a('0x21')](_0x513cc9));_0x56e6ce(_0x513cc9);})[_0x102a('0x22')](function(_0x2e88f7){logger['error'](_0x102a('0x23'),_0x2e88f7['message'],_0xc900ea);_0x15b572(_0x100008['error'](0x1f4,_0x2e88f7[_0x102a('0x13')]));});});};exports['CreateCmHopper']=function(_0x142d9b){var _0x58659a=this;return new Promise(function(_0x5b23ac,_0x3a37f7){return db[_0x102a('0x15')][_0x102a('0x24')](_0x142d9b[_0x102a('0x25')],{'raw':_0x142d9b['options']?_0x142d9b[_0x102a('0x17')][_0x102a('0x18')]===undefined?!![]:![]:!![]})[_0x102a('0x1f')](function(_0x1d4eb7){logger[_0x102a('0xc')](_0x102a('0x26'),_0x142d9b);logger[_0x102a('0xf')](_0x102a('0x26'),_0x142d9b,JSON[_0x102a('0x21')](_0x1d4eb7));_0x5b23ac(_0x1d4eb7);})[_0x102a('0x22')](function(_0x158b9e){logger[_0x102a('0x11')](_0x102a('0x26'),_0x158b9e[_0x102a('0x13')],_0x142d9b);_0x3a37f7(_0x58659a[_0x102a('0x11')](0x1f4,_0x158b9e[_0x102a('0x13')]));});});};exports[_0x102a('0x27')]=function(_0x26f1a9){var _0x5b362a=this;return new Promise(function(_0x4f47cb,_0x5a42c4){return db[_0x102a('0x15')]['update'](_0x26f1a9['body'],{'raw':_0x26f1a9['options']?_0x26f1a9[_0x102a('0x17')][_0x102a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26f1a9[_0x102a('0x17')]?_0x26f1a9['options'][_0x102a('0x19')]||null:null,'attributes':_0x26f1a9['options']?_0x26f1a9[_0x102a('0x17')][_0x102a('0x1a')]||null:null,'limit':_0x26f1a9[_0x102a('0x17')]?_0x26f1a9[_0x102a('0x17')][_0x102a('0x1b')]||null:null})[_0x102a('0x1f')](function(_0x2c3c46){logger[_0x102a('0xc')](_0x102a('0x27'),_0x26f1a9);logger['info'](_0x102a('0x28'),JSON['stringify'](_0x26f1a9[_0x102a('0x17')][_0x102a('0x19')]),_0x26f1a9[_0x102a('0x25')][_0x102a('0x29')]);logger[_0x102a('0xf')](_0x102a('0x27'),_0x26f1a9,JSON[_0x102a('0x21')](_0x2c3c46));_0x4f47cb(_0x2c3c46);})[_0x102a('0x22')](function(_0x4f4974){logger[_0x102a('0x11')](_0x102a('0x27'),_0x4f4974[_0x102a('0x13')],_0x26f1a9);_0x5a42c4(_0x5b362a[_0x102a('0x11')](0x1f4,_0x4f4974[_0x102a('0x13')]));});});};exports[_0x102a('0x2a')]=function(_0x21bd02){var _0x39c7f9=this;return new Promise(function(_0x21c148,_0x5cc6f4){return db[_0x102a('0x15')]['destroy']({'where':_0x21bd02[_0x102a('0x17')]?_0x21bd02[_0x102a('0x17')][_0x102a('0x19')]||null:null})['then'](function(_0x2f41e1){logger[_0x102a('0xc')](_0x102a('0x2a'),_0x21bd02);logger[_0x102a('0xf')](_0x102a('0x2a'),_0x21bd02,JSON[_0x102a('0x21')](_0x2f41e1));_0x21c148(_0x2f41e1);})[_0x102a('0x22')](function(_0x131f44){logger[_0x102a('0x11')]('DestroyCmHopper',_0x131f44[_0x102a('0x13')],_0x21bd02);_0x5cc6f4(_0x39c7f9[_0x102a('0x11')](0x1f4,_0x131f44[_0x102a('0x13')]));});});};exports[_0x102a('0x2b')]=function(_0x26c743){var _0x54fe70=this;return new Promise(function(_0xa48882,_0x622edc){return db[_0x102a('0x2c')][_0x102a('0x2d')]()['then'](function(_0x11c04e){return db['sequelize'][_0x102a('0x2e')](function(_0xe6c724){return db['CmHopper'][_0x102a('0x16')]({'where':_0x26c743[_0x102a('0x17')]?_0x26c743[_0x102a('0x17')][_0x102a('0x19')]||null:null,'attributes':_0x26c743[_0x102a('0x17')]?_0x26c743[_0x102a('0x17')]['attributes']||null:null,'limit':_0x26c743[_0x102a('0x17')]?_0x26c743['options'][_0x102a('0x1b')]||null:null,'order':_0x26c743['options']?_0x26c743[_0x102a('0x17')][_0x102a('0x2f')]||null:null,'transaction':_0xe6c724,'lock':_0xe6c724[_0x102a('0x30')][_0x102a('0x31')],'include':[{'model':db[_0x102a('0x2c')],'as':_0x102a('0x32'),'attributes':_['keys'](_0x11c04e)},{'model':db[_0x102a('0x33')],'as':_0x102a('0x34'),'attributes':['id','name',_0x102a('0x35')]}]})[_0x102a('0x1f')](function(_0x23240f){var _0x50fe13=[];var _0x8619df=[];for(var _0x25a60b=0x0;_0x25a60b<_0x23240f[_0x102a('0x36')];_0x25a60b+=0x1){var _0x11207f=_0x23240f[_0x25a60b][_0x102a('0x37')];if(_0x11207f===null){_0x50fe13[_0x102a('0x38')](_0x23240f[_0x25a60b]['update'](_0x26c743[_0x102a('0x25')],{'transaction':_0xe6c724}));}else if(!_0x8619df[_0x102a('0x39')](_0x11207f)){_0x8619df[_0x102a('0x38')](_0x11207f);_0x50fe13[_0x102a('0x38')](_0x23240f[_0x25a60b][_0x102a('0x3a')](_0x26c743['body'],{'transaction':_0xe6c724}));}}return BPromise[_0x102a('0x3b')](_0x50fe13);});})[_0x102a('0x1f')](function(_0x3b564d){logger[_0x102a('0xc')](_0x102a('0x2b'),_0x26c743);if(_0x3b564d[_0x102a('0x36')]>0x0){logger[_0x102a('0xc')](_0x102a('0x3c'),_0x3b564d[0x0][_0x102a('0x3d')]['id'],_0x3b564d[0x0][_0x102a('0x3d')][_0x102a('0x3e')],_0x3b564d[0x0]['dataValues'][_0x102a('0x29')]);}logger[_0x102a('0xf')](_0x102a('0x2b'),_0x26c743,JSON[_0x102a('0x21')](_0x3b564d));_0xa48882(_0x3b564d);})[_0x102a('0x22')](function(_0x24466c){logger[_0x102a('0x11')](_0x102a('0x2b'),_0x24466c[_0x102a('0x13')],_0x26c743);_0x622edc(_0x54fe70['error'](0x1f4,_0x24466c[_0x102a('0x13')]));});});});};exports[_0x102a('0x3f')]=function(_0x365393){var _0x1052e3=this;return new Promise(function(_0x311082,_0x3198fd){return db[_0x102a('0x40')][_0x102a('0x2e')](function(_0x4afd39){return db[_0x102a('0x41')][_0x102a('0x24')](_0x365393[_0x102a('0x25')],{'raw':_0x365393['options']?_0x365393[_0x102a('0x17')][_0x102a('0x18')]===undefined?!![]:![]:!![],'transaction':_0x4afd39})[_0x102a('0x1f')](function(){logger[_0x102a('0xc')](_0x102a('0x42'),JSON[_0x102a('0x21')](_0x365393[_0x102a('0x17')][_0x102a('0x19')]),_0x365393[_0x102a('0x17')][_0x102a('0x19')]['active']);return db['CmHopper'][_0x102a('0x43')]({'where':_0x365393[_0x102a('0x17')]?_0x365393[_0x102a('0x17')][_0x102a('0x19')]||null:null,'transaction':_0x4afd39});});})[_0x102a('0x1f')](function(_0x38be33){logger[_0x102a('0xc')](_0x102a('0x3f'),_0x365393);logger[_0x102a('0xf')]('MoveContactManagedDialer',_0x365393,JSON[_0x102a('0x21')](_0x38be33));_0x311082(_0x38be33);})[_0x102a('0x22')](function(_0x176352){logger[_0x102a('0x11')](_0x102a('0x3f'),_0x176352[_0x102a('0x13')],_0x365393);_0x3198fd(_0x1052e3['error'](0x1f4,_0x176352['message']));});});};exports[_0x102a('0x44')]=function(_0xad66e7){var _0xd2fa47=this;return new Promise(function(_0x38a52b,_0x4732f3){return db[_0x102a('0x15')]['findAll']({'raw':_0xad66e7[_0x102a('0x17')]?_0xad66e7[_0x102a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xad66e7[_0x102a('0x17')]?_0xad66e7[_0x102a('0x17')][_0x102a('0x19')]||null:null,'attributes':[[db[_0x102a('0x40')]['fn'](_0x102a('0x45'),db[_0x102a('0x40')]['fn']('IF',db[_0x102a('0x40')][_0x102a('0x46')]('`scheduledat`\x20>=\x20'+util[_0x102a('0x47')](_0x102a('0x48'),moment()[_0x102a('0x47')](_0x102a('0x49')))+_0x102a('0x4a')))),_0x102a('0x4b')]]})[_0x102a('0x1f')](function(_0x9ac385){logger['info'](_0x102a('0x44'),_0xad66e7);logger['debug'](_0x102a('0x44'),_0xad66e7,JSON[_0x102a('0x21')](_0x9ac385));_0x38a52b(_0x9ac385);})['catch'](function(_0x1db50e){logger[_0x102a('0x11')]('CountReScheduled',_0x1db50e['message'],_0xad66e7);_0x4732f3(_0xd2fa47['error'](0x1f4,_0x1db50e['message']));});});};exports[_0x102a('0x4c')]=function(_0x41b130){var _0x4f798b=this;return new Promise(function(_0x4623a9,_0x1ae5d3){return db['CmContact'][_0x102a('0x2d')]()[_0x102a('0x1f')](function(_0x37086c){return db[_0x102a('0x40')]['transaction'](function(_0x3d55f6){return db[_0x102a('0x15')][_0x102a('0x16')]({'where':_0x41b130[_0x102a('0x17')]?_0x41b130['options'][_0x102a('0x19')]||null:null,'attributes':_0x41b130[_0x102a('0x17')]?_0x41b130['options'][_0x102a('0x1a')]||null:null,'limit':0x1,'order':_0x41b130[_0x102a('0x17')]?_0x41b130[_0x102a('0x17')][_0x102a('0x2f')]||null:null,'group':db[_0x102a('0x15')]['UserId'],'transaction':_0x3d55f6,'lock':_0x3d55f6[_0x102a('0x30')][_0x102a('0x31')],'include':_0x41b130[_0x102a('0x17')]?_0x41b130[_0x102a('0x17')][_0x102a('0x1c')]?_[_0x102a('0x1d')](_0x41b130[_0x102a('0x17')][_0x102a('0x1c')],function(_0x3fe782){return{'model':db[_0x3fe782[_0x102a('0x1e')]],'as':_0x3fe782['as'],'attributes':_0x3fe782[_0x102a('0x1a')],'include':_0x3fe782[_0x102a('0x1c')]?_[_0x102a('0x1d')](_0x3fe782[_0x102a('0x1c')],function(_0x14f235){return{'model':db[_0x14f235[_0x102a('0x1e')]],'as':_0x14f235['as'],'attributes':_0x14f235[_0x102a('0x1a')],'include':_0x14f235[_0x102a('0x1c')]?_[_0x102a('0x1d')](_0x14f235['include'],function(_0x2438de){return{'model':db[_0x2438de[_0x102a('0x1e')]],'as':_0x2438de['as'],'attributes':_0x2438de[_0x102a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x102a('0x1f')](function(_0x4e3ebc){var _0x210bea=[];for(var _0x2c3611=0x0;_0x2c3611<_0x4e3ebc[_0x102a('0x36')];_0x2c3611+=0x1){_0x210bea[_0x102a('0x38')](_0x4e3ebc[_0x2c3611][_0x102a('0x3a')](_0x41b130['body'],{'transaction':_0x3d55f6}));}return BPromise['all'](_0x210bea);});})['then'](function(_0x2df08a){logger['info']('GetContactRecallMe',_0x41b130);logger['debug'](_0x102a('0x4c'),_0x41b130,JSON['stringify'](_0x2df08a));_0x4623a9(_0x2df08a);})[_0x102a('0x22')](function(_0x4a51f6){logger['error']('GetContactRecallMe',_0x4a51f6['message'],_0x41b130);_0x1ae5d3(_0x4f798b['error'](0x1f4,_0x4a51f6['message']));});});});};exports[_0x102a('0x4d')]=function(_0x5a8d5e){var _0x53ca47=this;return new Promise(function(_0x69d2e8,_0x1ae936){db['CmContact'][_0x102a('0x2d')]()[_0x102a('0x1f')](function(_0x1881e6){return db[_0x102a('0x15')][_0x102a('0x16')]({'raw':_0x5a8d5e[_0x102a('0x17')]?_0x5a8d5e[_0x102a('0x17')][_0x102a('0x18')]===undefined?!![]:![]:!![],'where':_0x5a8d5e[_0x102a('0x17')]?_0x5a8d5e[_0x102a('0x17')][_0x102a('0x19')]||null:null,'attributes':_0x5a8d5e['options']?_0x5a8d5e[_0x102a('0x17')]['attributes']||null:null,'limit':_0x5a8d5e[_0x102a('0x17')]?_0x5a8d5e[_0x102a('0x17')][_0x102a('0x1b')]||null:null,'include':_0x5a8d5e['options']?_0x5a8d5e['options'][_0x102a('0x1c')]?_['map'](_0x5a8d5e[_0x102a('0x17')][_0x102a('0x1c')],function(_0x53df68){return{'model':db[_0x53df68['model']],'as':_0x53df68['as'],'attributes':_0x53df68['as']===_0x102a('0x32')?_[_0x102a('0x4e')](_0x1881e6):_0x53df68[_0x102a('0x1a')],'include':_0x53df68[_0x102a('0x1c')]?_[_0x102a('0x1d')](_0x53df68[_0x102a('0x1c')],function(_0x480024){return{'model':db[_0x480024['model']],'as':_0x480024['as'],'attributes':_0x480024[_0x102a('0x1a')],'include':_0x480024[_0x102a('0x1c')]?_[_0x102a('0x1d')](_0x480024[_0x102a('0x1c')],function(_0x5e4cda){return{'model':db[_0x5e4cda[_0x102a('0x1e')]],'as':_0x5e4cda['as'],'attributes':_0x5e4cda[_0x102a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5da6f9){logger[_0x102a('0xc')](_0x102a('0x20'),_0x5a8d5e);logger['debug'](_0x102a('0x20'),_0x5a8d5e,JSON['stringify'](_0x5da6f9));_0x69d2e8(_0x5da6f9);})[_0x102a('0x22')](function(_0x228e4a){logger[_0x102a('0x11')]('GetCmHopper',_0x228e4a['message'],_0x5a8d5e);_0x1ae936(_0x53ca47[_0x102a('0x11')](0x1f4,_0x228e4a['message']));});});});};exports['GetContactByPhone']=function(_0x54a89f){var _0x169683=this;return new Promise(function(_0x13b64e,_0x34f8cd){return db['CmContact']['findOne']({'raw':!![],'where':{'phone':_0x54a89f[_0x102a('0x17')][_0x102a('0x19')][_0x102a('0x4f')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x102a('0x1f')](function(_0xada87){logger[_0x102a('0xc')](_0x102a('0x50'),_0x54a89f);logger[_0x102a('0xf')](_0x102a('0x50'),_0x54a89f,JSON[_0x102a('0x21')](_0xada87));_0x13b64e(_0xada87);})[_0x102a('0x22')](function(_0x2703dc){logger[_0x102a('0x11')](_0x102a('0x50'),_0x2703dc[_0x102a('0x13')],_0x54a89f);_0x34f8cd(_0x169683[_0x102a('0x11')](0x1f4,_0x2703dc[_0x102a('0x13')]));});});};exports[_0x102a('0x51')]=function(_0xc41452){var _0x3c2415=this;return new Promise(function(_0xf0c67c,_0x53b661){return db[_0x102a('0x40')][_0x102a('0x2e')](function(_0x509444){return db[_0x102a('0x15')][_0x102a('0x3a')]({'active':![]},{'where':{},'transaction':_0x509444})[_0x102a('0x1f')](function(_0x3fce37){logger['info'](_0x102a('0x51'),_0xc41452);logger[_0x102a('0xf')](_0x102a('0x51'),_0xc41452,JSON[_0x102a('0x21')](_0x3fce37));_0xf0c67c(_0x3fce37);})[_0x102a('0x22')](function(_0x4cefeb){logger[_0x102a('0x11')](_0x102a('0x51'),_0x4cefeb[_0x102a('0x13')],_0xc41452);_0x53b661(_0x3c2415[_0x102a('0x11')](0x1f4,_0x4cefeb[_0x102a('0x13')]));});});});};exports[_0x102a('0x52')]=function(_0x3c7823){var _0x13aca5=this;var _0x4735a6=_0x3c7823[_0x102a('0x25')][_0x102a('0x19')]['voiceQueueId'];var _0xb9bd74=_0x3c7823[_0x102a('0x25')]['where'][_0x102a('0x53')];return new Promise(function(_0x395653,_0x113169){return db[_0x102a('0x15')][_0x102a('0x16')]({'where':{'voiceQueueId':_0x4735a6,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x102a('0x46')](_0x102a('0x54')+_0xb9bd74+_0x102a('0x55'))}},'include':[{'model':db[_0x102a('0x2c')],'as':_0x102a('0x32')},{'model':db[_0x102a('0x33')],'as':_0x102a('0x34'),'attributes':['id',_0x102a('0x56'),_0x102a('0x35')]},{'model':db[_0x102a('0x57')],'as':_0x102a('0x58')}]})[_0x102a('0x1f')](function(_0x50be7a){return db[_0x102a('0x40')][_0x102a('0x2e')](function(_0x137a46){return db[_0x102a('0x15')]['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x4735a6,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0xb9bd74+'\x20MINUTE')}},'transaction':_0x137a46})['then'](function(_0x42c76b){_0x395653(_0x50be7a);})[_0x102a('0x22')](function(_0x291270){logger[_0x102a('0x11')]('CmHopperHandlePreviewRecallNotifications',_0x291270['message'],_0x3c7823);_0x113169(validateExpressRequest);});});})[_0x102a('0x22')](function(_0x2e1bf2){logger[_0x102a('0x11')](_0x102a('0x52'),_0x2e1bf2[_0x102a('0x13')],_0x3c7823);_0x113169(_0x13aca5[_0x102a('0x11')](0x1f4,_0x2e1bf2[_0x102a('0x13')]));});});}; \ No newline at end of file +var _0xdc9d=['UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','LOCK','UPDATE','Contact','User','Agent','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','order','GetContactRecallMe','GetCmHopperPreview','describe','keys','GetContactByPhone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','voicePause','CmList','List','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','find','CreateCmHopper','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xdc9d,0x142));var _0xddc9=function(_0x285c58,_0x2a5057){_0x285c58=_0x285c58-0x0;var _0xc00c9f=_0xdc9d[_0x285c58];return _0xc00c9f;};'use strict';var _=require('lodash');var util=require(_0xddc9('0x0'));var moment=require(_0xddc9('0x1'));var BPromise=require(_0xddc9('0x2'));var rs=require(_0xddc9('0x3'));var fs=require('fs');var Redis=require(_0xddc9('0x4'));var db=require(_0xddc9('0x5'))['db'];var utils=require(_0xddc9('0x6'));var logger=require(_0xddc9('0x7'))(_0xddc9('0x8'));var config=require(_0xddc9('0x9'));var jayson=require('jayson/promise');const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0xddc9('0xa')][_0xddc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a4b0a,_0x3cf1da,_0x395d09){return new BPromise(function(_0x33e565,_0x26dc82){return client['request'](_0x2a4b0a,_0x395d09)[_0xddc9('0xc')](function(_0x3712a9){logger[_0xddc9('0xd')]('CmHopper,\x20%s,\x20%s',_0x3cf1da,_0xddc9('0xe'));logger[_0xddc9('0xf')](_0xddc9('0x10'),_0x3cf1da,_0xddc9('0xe'),JSON[_0xddc9('0x11')](_0x3712a9));if(_0x3712a9[_0xddc9('0x12')]){if(_0x3712a9[_0xddc9('0x12')]['code']===0x1f4){logger[_0xddc9('0x12')](_0xddc9('0x13'),_0x3cf1da,_0x3712a9[_0xddc9('0x12')][_0xddc9('0x14')]);return _0x26dc82(_0x3712a9[_0xddc9('0x12')][_0xddc9('0x14')]);}logger['error'](_0xddc9('0x13'),_0x3cf1da,_0x3712a9[_0xddc9('0x12')][_0xddc9('0x14')]);return _0x33e565(_0x3712a9[_0xddc9('0x12')][_0xddc9('0x14')]);}else{logger[_0xddc9('0xd')]('CmHopper,\x20%s,\x20%s',_0x3cf1da,_0xddc9('0xe'));_0x33e565(_0x3712a9[_0xddc9('0x15')][_0xddc9('0x14')]);}})[_0xddc9('0x16')](function(_0xe5665e){logger[_0xddc9('0x12')](_0xddc9('0x13'),_0x3cf1da,_0xe5665e);_0x26dc82(_0xe5665e);});});}exports[_0xddc9('0x17')]=function(_0x3f64ea){var _0x1d15b7=this;return new Promise(function(_0x380544,_0x4ddd4f){return db[_0xddc9('0x18')][_0xddc9('0x19')]({'raw':_0x3f64ea['options']?_0x3f64ea[_0xddc9('0x1a')][_0xddc9('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f64ea[_0xddc9('0x1a')]?_0x3f64ea[_0xddc9('0x1a')][_0xddc9('0x1c')]||null:null,'attributes':_0x3f64ea['options']?_0x3f64ea['options'][_0xddc9('0x1d')]||null:null,'limit':_0x3f64ea[_0xddc9('0x1a')]?_0x3f64ea[_0xddc9('0x1a')][_0xddc9('0x1e')]||null:null,'include':_0x3f64ea[_0xddc9('0x1a')]?_0x3f64ea[_0xddc9('0x1a')][_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x3f64ea[_0xddc9('0x1a')][_0xddc9('0x1f')],function(_0x4a1c16){return{'model':db[_0x4a1c16[_0xddc9('0x21')]],'as':_0x4a1c16['as'],'attributes':_0x4a1c16['attributes'],'include':_0x4a1c16['include']?_[_0xddc9('0x20')](_0x4a1c16['include'],function(_0x35ec66){return{'model':db[_0x35ec66[_0xddc9('0x21')]],'as':_0x35ec66['as'],'attributes':_0x35ec66['attributes'],'include':_0x35ec66['include']?_[_0xddc9('0x20')](_0x35ec66[_0xddc9('0x1f')],function(_0x377901){return{'model':db[_0x377901[_0xddc9('0x21')]],'as':_0x377901['as'],'attributes':_0x377901['attributes']};}):[]};}):[]};}):[]:[]})[_0xddc9('0xc')](function(_0x3ac621){logger[_0xddc9('0xd')](_0xddc9('0x17'),_0x3f64ea);logger[_0xddc9('0xf')]('GetCmHopper',_0x3f64ea,JSON[_0xddc9('0x11')](_0x3ac621));_0x380544(_0x3ac621);})[_0xddc9('0x16')](function(_0x5ab60f){logger[_0xddc9('0x12')](_0xddc9('0x17'),_0x5ab60f[_0xddc9('0x14')],_0x3f64ea);_0x4ddd4f(_0x1d15b7['error'](0x1f4,_0x5ab60f[_0xddc9('0x14')]));});});};exports[_0xddc9('0x22')]=function(_0x5c3c79){var _0x482dcd=this;return new Promise(function(_0x352e7e,_0x1be72b){return db['CmHopper'][_0xddc9('0x23')]({'raw':_0x5c3c79['options']?_0x5c3c79[_0xddc9('0x1a')][_0xddc9('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c3c79['options']?_0x5c3c79[_0xddc9('0x1a')][_0xddc9('0x1c')]||null:null,'attributes':_0x5c3c79[_0xddc9('0x1a')]?_0x5c3c79[_0xddc9('0x1a')][_0xddc9('0x1d')]||null:null,'include':_0x5c3c79[_0xddc9('0x1a')]?_0x5c3c79[_0xddc9('0x1a')][_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x5c3c79[_0xddc9('0x1a')][_0xddc9('0x1f')],function(_0x1b5db1){return{'model':db[_0x1b5db1[_0xddc9('0x21')]],'as':_0x1b5db1['as'],'attributes':_0x1b5db1['attributes'],'include':_0x1b5db1[_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x1b5db1['include'],function(_0x148320){return{'model':db[_0x148320[_0xddc9('0x21')]],'as':_0x148320['as'],'attributes':_0x148320[_0xddc9('0x1d')],'include':_0x148320[_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x148320[_0xddc9('0x1f')],function(_0x153738){return{'model':db[_0x153738[_0xddc9('0x21')]],'as':_0x153738['as'],'attributes':_0x153738['attributes']};}):[]};}):[]};}):[]:[]})[_0xddc9('0xc')](function(_0x5b4755){logger[_0xddc9('0xd')](_0xddc9('0x22'),_0x5c3c79);logger[_0xddc9('0xf')](_0xddc9('0x22'),_0x5c3c79,JSON[_0xddc9('0x11')](_0x5b4755));_0x352e7e(_0x5b4755);})[_0xddc9('0x16')](function(_0x15c63f){logger['error'](_0xddc9('0x22'),_0x15c63f[_0xddc9('0x14')],_0x5c3c79);_0x1be72b(_0x482dcd[_0xddc9('0x12')](0x1f4,_0x15c63f[_0xddc9('0x14')]));});});};exports[_0xddc9('0x24')]=function(_0x31792a){var _0x3191e9=this;return new Promise(function(_0x1a8b99,_0x5da934){return db['CmHopper'][_0xddc9('0x25')](_0x31792a['body'],{'raw':_0x31792a[_0xddc9('0x1a')]?_0x31792a['options'][_0xddc9('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x37f882){logger[_0xddc9('0xd')]('CreateCmHopper',_0x31792a);logger[_0xddc9('0xf')](_0xddc9('0x24'),_0x31792a,JSON[_0xddc9('0x11')](_0x37f882));_0x1a8b99(_0x37f882);})[_0xddc9('0x16')](function(_0x278c92){logger[_0xddc9('0x12')](_0xddc9('0x24'),_0x278c92[_0xddc9('0x14')],_0x31792a);_0x5da934(_0x3191e9[_0xddc9('0x12')](0x1f4,_0x278c92[_0xddc9('0x14')]));});});};exports[_0xddc9('0x26')]=function(_0x414362){var _0x525a37=this;return new Promise(function(_0x2d5216,_0x15d415){return db[_0xddc9('0x18')][_0xddc9('0x27')](_0x414362[_0xddc9('0x28')],{'raw':_0x414362[_0xddc9('0x1a')]?_0x414362['options'][_0xddc9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414362[_0xddc9('0x1a')]?_0x414362['options'][_0xddc9('0x1c')]||null:null,'attributes':_0x414362[_0xddc9('0x1a')]?_0x414362[_0xddc9('0x1a')][_0xddc9('0x1d')]||null:null,'limit':_0x414362['options']?_0x414362[_0xddc9('0x1a')]['limit']||null:null})['then'](function(_0x33ad11){logger[_0xddc9('0xd')](_0xddc9('0x26'),_0x414362);logger[_0xddc9('0xd')](_0xddc9('0x29'),JSON[_0xddc9('0x11')](_0x414362[_0xddc9('0x1a')][_0xddc9('0x1c')]),_0x414362[_0xddc9('0x28')][_0xddc9('0x2a')]);logger[_0xddc9('0xf')]('UpdateCmHopper',_0x414362,JSON['stringify'](_0x33ad11));_0x2d5216(_0x33ad11);})[_0xddc9('0x16')](function(_0x5662d9){logger[_0xddc9('0x12')](_0xddc9('0x26'),_0x5662d9['message'],_0x414362);_0x15d415(_0x525a37['error'](0x1f4,_0x5662d9['message']));});});};exports[_0xddc9('0x2b')]=function(_0x63def3){var _0x152cad=this;return new Promise(function(_0x215157,_0x3da333){return db[_0xddc9('0x18')][_0xddc9('0x2c')]({'where':_0x63def3[_0xddc9('0x1a')]?_0x63def3[_0xddc9('0x1a')]['where']||null:null})[_0xddc9('0xc')](function(_0xd5991){logger[_0xddc9('0xd')](_0xddc9('0x2b'),_0x63def3);logger[_0xddc9('0xf')]('DestroyCmHopper',_0x63def3,JSON['stringify'](_0xd5991));_0x215157(_0xd5991);})[_0xddc9('0x16')](function(_0x3a4c4e){logger[_0xddc9('0x12')](_0xddc9('0x2b'),_0x3a4c4e[_0xddc9('0x14')],_0x63def3);_0x3da333(_0x152cad['error'](0x1f4,_0x3a4c4e['message']));});});};exports[_0xddc9('0x2d')]=function(_0x876e22){var _0x3010c4=this;return new Promise(function(_0x1592ec,_0x4f4ff6){return db[_0xddc9('0x2e')]['describe']()[_0xddc9('0xc')](function(_0x183409){return db[_0xddc9('0x2f')][_0xddc9('0x30')](function(_0x15ba92){return db[_0xddc9('0x18')][_0xddc9('0x19')]({'where':_0x876e22[_0xddc9('0x1a')]?_0x876e22[_0xddc9('0x1a')][_0xddc9('0x1c')]||null:null,'attributes':_0x876e22[_0xddc9('0x1a')]?_0x876e22[_0xddc9('0x1a')][_0xddc9('0x1d')]||null:null,'limit':_0x876e22[_0xddc9('0x1a')]?_0x876e22['options']['limit']||null:null,'order':_0x876e22[_0xddc9('0x1a')]?_0x876e22['options']['order']||null:null,'transaction':_0x15ba92,'lock':_0x15ba92[_0xddc9('0x31')][_0xddc9('0x32')],'include':[{'model':db[_0xddc9('0x2e')],'as':_0xddc9('0x33'),'attributes':_['keys'](_0x183409)},{'model':db[_0xddc9('0x34')],'as':_0xddc9('0x35'),'attributes':['id','name','voicePause']}]})['then'](function(_0x166c78){var _0x4a73ad=[];var _0x30bd6f=[];for(var _0x1c0aff=0x0;_0x1c0aff<_0x166c78[_0xddc9('0x36')];_0x1c0aff+=0x1){var _0x2077c4=_0x166c78[_0x1c0aff][_0xddc9('0x37')];if(_0x2077c4===null){_0x4a73ad[_0xddc9('0x38')](_0x166c78[_0x1c0aff][_0xddc9('0x27')](_0x876e22[_0xddc9('0x28')],{'transaction':_0x15ba92}));}else if(!_0x30bd6f[_0xddc9('0x39')](_0x2077c4)){_0x30bd6f[_0xddc9('0x38')](_0x2077c4);_0x4a73ad['push'](_0x166c78[_0x1c0aff][_0xddc9('0x27')](_0x876e22[_0xddc9('0x28')],{'transaction':_0x15ba92}));}}return BPromise[_0xddc9('0x3a')](_0x4a73ad);});})[_0xddc9('0xc')](function(_0x32cfde){logger[_0xddc9('0xd')](_0xddc9('0x2d'),_0x876e22);if(_0x32cfde['length']>0x0){logger['info'](_0xddc9('0x3b'),_0x32cfde[0x0][_0xddc9('0x3c')]['id'],_0x32cfde[0x0][_0xddc9('0x3c')][_0xddc9('0x3d')],_0x32cfde[0x0][_0xddc9('0x3c')]['active']);}logger[_0xddc9('0xf')]('GetContactDialer',_0x876e22,JSON[_0xddc9('0x11')](_0x32cfde));_0x1592ec(_0x32cfde);})[_0xddc9('0x16')](function(_0x2162c1){logger[_0xddc9('0x12')](_0xddc9('0x2d'),_0x2162c1[_0xddc9('0x14')],_0x876e22);_0x4f4ff6(_0x3010c4[_0xddc9('0x12')](0x1f4,_0x2162c1[_0xddc9('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x3cab2a){var _0x5b4234=this;return new Promise(function(_0x263d7f,_0x34d30f){return db['sequelize'][_0xddc9('0x30')](function(_0x561c2d){return db['CmHopperFinal'][_0xddc9('0x25')](_0x3cab2a[_0xddc9('0x28')],{'raw':_0x3cab2a[_0xddc9('0x1a')]?_0x3cab2a[_0xddc9('0x1a')][_0xddc9('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x561c2d})[_0xddc9('0xc')](function(){logger['info'](_0xddc9('0x3e'),JSON[_0xddc9('0x11')](_0x3cab2a[_0xddc9('0x1a')][_0xddc9('0x1c')]),_0x3cab2a[_0xddc9('0x1a')][_0xddc9('0x1c')]['active']);return db[_0xddc9('0x18')]['destroy']({'where':_0x3cab2a[_0xddc9('0x1a')]?_0x3cab2a[_0xddc9('0x1a')][_0xddc9('0x1c')]||null:null,'transaction':_0x561c2d});});})[_0xddc9('0xc')](function(_0x344fb7){logger['info']('MoveContactManagedDialer',_0x3cab2a);logger[_0xddc9('0xf')](_0xddc9('0x3f'),_0x3cab2a,JSON[_0xddc9('0x11')](_0x344fb7));_0x263d7f(_0x344fb7);})['catch'](function(_0x52ebaf){logger[_0xddc9('0x12')](_0xddc9('0x3f'),_0x52ebaf[_0xddc9('0x14')],_0x3cab2a);_0x34d30f(_0x5b4234[_0xddc9('0x12')](0x1f4,_0x52ebaf[_0xddc9('0x14')]));});});};exports[_0xddc9('0x40')]=function(_0x4a7bbd){var _0x11d360=this;return new Promise(function(_0x2ab1a8,_0x50f43c){return db[_0xddc9('0x18')][_0xddc9('0x19')]({'raw':_0x4a7bbd[_0xddc9('0x1a')]?_0x4a7bbd['options'][_0xddc9('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a7bbd[_0xddc9('0x1a')]?_0x4a7bbd[_0xddc9('0x1a')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xddc9('0x41'),db['sequelize']['fn']('IF',db['sequelize'][_0xddc9('0x42')](_0xddc9('0x43')+util['format'](_0xddc9('0x44'),moment()[_0xddc9('0x45')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xddc9('0x46')))),_0xddc9('0x47')]]})[_0xddc9('0xc')](function(_0x764250){logger['info']('CountReScheduled',_0x4a7bbd);logger[_0xddc9('0xf')]('CountReScheduled',_0x4a7bbd,JSON[_0xddc9('0x11')](_0x764250));_0x2ab1a8(_0x764250);})['catch'](function(_0x314766){logger[_0xddc9('0x12')](_0xddc9('0x40'),_0x314766['message'],_0x4a7bbd);_0x50f43c(_0x11d360[_0xddc9('0x12')](0x1f4,_0x314766['message']));});});};exports['GetContactRecallMe']=function(_0x3b972e){var _0x333f46=this;return new Promise(function(_0x547940,_0x13fd91){return db[_0xddc9('0x2e')]['describe']()['then'](function(_0x17a283){return db[_0xddc9('0x2f')]['transaction'](function(_0x47c650){return db['CmHopper'][_0xddc9('0x19')]({'where':_0x3b972e['options']?_0x3b972e[_0xddc9('0x1a')][_0xddc9('0x1c')]||null:null,'attributes':_0x3b972e[_0xddc9('0x1a')]?_0x3b972e[_0xddc9('0x1a')]['attributes']||null:null,'limit':0x1,'order':_0x3b972e[_0xddc9('0x1a')]?_0x3b972e[_0xddc9('0x1a')][_0xddc9('0x48')]||null:null,'group':db[_0xddc9('0x18')]['UserId'],'transaction':_0x47c650,'lock':_0x47c650[_0xddc9('0x31')]['UPDATE'],'include':_0x3b972e['options']?_0x3b972e[_0xddc9('0x1a')][_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x3b972e[_0xddc9('0x1a')][_0xddc9('0x1f')],function(_0x3e1290){return{'model':db[_0x3e1290[_0xddc9('0x21')]],'as':_0x3e1290['as'],'attributes':_0x3e1290['attributes'],'include':_0x3e1290[_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x3e1290[_0xddc9('0x1f')],function(_0x1e6b5f){return{'model':db[_0x1e6b5f[_0xddc9('0x21')]],'as':_0x1e6b5f['as'],'attributes':_0x1e6b5f[_0xddc9('0x1d')],'include':_0x1e6b5f['include']?_[_0xddc9('0x20')](_0x1e6b5f[_0xddc9('0x1f')],function(_0x3bda48){return{'model':db[_0x3bda48['model']],'as':_0x3bda48['as'],'attributes':_0x3bda48['attributes']};}):[]};}):[]};}):[]:[]})[_0xddc9('0xc')](function(_0x472516){var _0x5a8534=[];for(var _0x25eec1=0x0;_0x25eec1<_0x472516[_0xddc9('0x36')];_0x25eec1+=0x1){_0x5a8534['push'](_0x472516[_0x25eec1]['update'](_0x3b972e[_0xddc9('0x28')],{'transaction':_0x47c650}));}return BPromise[_0xddc9('0x3a')](_0x5a8534);});})[_0xddc9('0xc')](function(_0x2eefd8){logger[_0xddc9('0xd')](_0xddc9('0x49'),_0x3b972e);logger['debug'](_0xddc9('0x49'),_0x3b972e,JSON[_0xddc9('0x11')](_0x2eefd8));_0x547940(_0x2eefd8);})[_0xddc9('0x16')](function(_0x64929f){logger[_0xddc9('0x12')]('GetContactRecallMe',_0x64929f['message'],_0x3b972e);_0x13fd91(_0x333f46[_0xddc9('0x12')](0x1f4,_0x64929f[_0xddc9('0x14')]));});});});};exports[_0xddc9('0x4a')]=function(_0x3fbcc1){var _0x101be3=this;return new Promise(function(_0x2a4397,_0xa4dfc4){db[_0xddc9('0x2e')][_0xddc9('0x4b')]()[_0xddc9('0xc')](function(_0x528583){return db['CmHopper'][_0xddc9('0x19')]({'raw':_0x3fbcc1['options']?_0x3fbcc1[_0xddc9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3fbcc1['options']?_0x3fbcc1[_0xddc9('0x1a')][_0xddc9('0x1c')]||null:null,'attributes':_0x3fbcc1['options']?_0x3fbcc1[_0xddc9('0x1a')][_0xddc9('0x1d')]||null:null,'limit':_0x3fbcc1[_0xddc9('0x1a')]?_0x3fbcc1[_0xddc9('0x1a')][_0xddc9('0x1e')]||null:null,'include':_0x3fbcc1['options']?_0x3fbcc1[_0xddc9('0x1a')][_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x3fbcc1[_0xddc9('0x1a')][_0xddc9('0x1f')],function(_0x53c280){return{'model':db[_0x53c280[_0xddc9('0x21')]],'as':_0x53c280['as'],'attributes':_0x53c280['as']===_0xddc9('0x33')?_[_0xddc9('0x4c')](_0x528583):_0x53c280['attributes'],'include':_0x53c280[_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x53c280[_0xddc9('0x1f')],function(_0x1795f5){return{'model':db[_0x1795f5[_0xddc9('0x21')]],'as':_0x1795f5['as'],'attributes':_0x1795f5['attributes'],'include':_0x1795f5[_0xddc9('0x1f')]?_[_0xddc9('0x20')](_0x1795f5[_0xddc9('0x1f')],function(_0x2923ae){return{'model':db[_0x2923ae[_0xddc9('0x21')]],'as':_0x2923ae['as'],'attributes':_0x2923ae[_0xddc9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xddc9('0xc')](function(_0x25ef34){logger[_0xddc9('0xd')]('GetCmHopper',_0x3fbcc1);logger[_0xddc9('0xf')](_0xddc9('0x17'),_0x3fbcc1,JSON[_0xddc9('0x11')](_0x25ef34));_0x2a4397(_0x25ef34);})[_0xddc9('0x16')](function(_0x3029b9){logger[_0xddc9('0x12')]('GetCmHopper',_0x3029b9[_0xddc9('0x14')],_0x3fbcc1);_0xa4dfc4(_0x101be3[_0xddc9('0x12')](0x1f4,_0x3029b9[_0xddc9('0x14')]));});});});};exports[_0xddc9('0x4d')]=function(_0x5c2652){var _0x532f92=this;return new Promise(function(_0x2b8060,_0x1caad8){return db[_0xddc9('0x2e')]['findOne']({'raw':!![],'where':{'phone':_0x5c2652['options'][_0xddc9('0x1c')]['phone']},'attributes':['id',_0xddc9('0x4e')],'order':[['id',_0xddc9('0x4f')]]})['then'](function(_0x24238c){logger['info']('getContactByPhone',_0x5c2652);logger[_0xddc9('0xf')](_0xddc9('0x50'),_0x5c2652,JSON['stringify'](_0x24238c));_0x2b8060(_0x24238c);})['catch'](function(_0x3f414e){logger[_0xddc9('0x12')](_0xddc9('0x50'),_0x3f414e[_0xddc9('0x14')],_0x5c2652);_0x1caad8(_0x532f92['error'](0x1f4,_0x3f414e[_0xddc9('0x14')]));});});};exports[_0xddc9('0x51')]=function(_0x24e611){var _0x571e70=this;return new Promise(function(_0x2b30d2,_0x2df585){return db['sequelize'][_0xddc9('0x30')](function(_0x40cb4d){return db[_0xddc9('0x18')]['update']({'active':![]},{'where':{},'transaction':_0x40cb4d})[_0xddc9('0xc')](function(_0x4ab2b1){logger[_0xddc9('0xd')](_0xddc9('0x51'),_0x24e611);logger[_0xddc9('0xf')]('ResetActiveCalls',_0x24e611,JSON['stringify'](_0x4ab2b1));_0x2b30d2(_0x4ab2b1);})['catch'](function(_0x2aeced){logger[_0xddc9('0x12')](_0xddc9('0x51'),_0x2aeced[_0xddc9('0x14')],_0x24e611);_0x2df585(_0x571e70['error'](0x1f4,_0x2aeced['message']));});});});};exports[_0xddc9('0x52')]=function(_0x4d2348){var _0x387c41=this;var _0x38eb91=_0x4d2348['body']['where']['voiceQueueId'];var _0x210c16=_0x4d2348[_0xddc9('0x28')][_0xddc9('0x1c')][_0xddc9('0x53')];return new Promise(function(_0x1607ac,_0xcb6f4e){return db[_0xddc9('0x18')]['findAll']({'where':{'voiceQueueId':_0x38eb91,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xddc9('0x2f')][_0xddc9('0x42')](_0xddc9('0x54')+_0x210c16+_0xddc9('0x55'))}},'include':[{'model':db['CmContact'],'as':_0xddc9('0x33')},{'model':db[_0xddc9('0x34')],'as':_0xddc9('0x35'),'attributes':['id',_0xddc9('0x56'),_0xddc9('0x57')]},{'model':db[_0xddc9('0x58')],'as':_0xddc9('0x59')}]})[_0xddc9('0xc')](function(_0x589cff){return db[_0xddc9('0x2f')][_0xddc9('0x30')](function(_0xa601ff){return db[_0xddc9('0x18')][_0xddc9('0x27')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x38eb91,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xddc9('0x2f')][_0xddc9('0x42')]('NOW()\x20+\x20INTERVAL\x20'+_0x210c16+_0xddc9('0x55'))}},'transaction':_0xa601ff})[_0xddc9('0xc')](function(_0x5712eb){_0x1607ac(_0x589cff);})['catch'](function(_0x5068f){logger[_0xddc9('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x5068f[_0xddc9('0x14')],_0x4d2348);_0xcb6f4e(validateExpressRequest);});});})['catch'](function(_0x5ac5ef){logger[_0xddc9('0x12')](_0xddc9('0x52'),_0x5ac5ef['message'],_0x4d2348);_0xcb6f4e(_0x387c41['error'](0x1f4,_0x5ac5ef[_0xddc9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 457ccd2..cc690cc 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 _0x534d=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','getOpenContacts','/timezones','getTimezones','/:id','show','create','post','/previewrecall','getPreviewRecall','put','delete','destroy','exports'];(function(_0x29bf38,_0x389649){var _0x5dd70b=function(_0xd52f0d){while(--_0xd52f0d){_0x29bf38['push'](_0x29bf38['shift']());}};_0x5dd70b(++_0x389649);}(_0x534d,0xb6));var _0xd534=function(_0x59d98a,_0x5e4f16){_0x59d98a=_0x59d98a-0x0;var _0x2387de=_0x534d[_0x59d98a];return _0x2387de;};'use strict';var multer=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var path=require(_0xd534('0x2'));var timeout=require(_0xd534('0x3'));var express=require('express');var router=express[_0xd534('0x4')]();var fs_extra=require(_0xd534('0x5'));var auth=require(_0xd534('0x6'));var interaction=require(_0xd534('0x7'));var config=require('../../config/environment');var controller=require(_0xd534('0x8'));router[_0xd534('0x9')]('/',auth[_0xd534('0xa')](),controller['index']);router[_0xd534('0x9')](_0xd534('0xb'),auth[_0xd534('0xa')](),controller[_0xd534('0xc')]);router[_0xd534('0x9')]('/opencontacts',auth[_0xd534('0xa')](),controller[_0xd534('0xd')]);router[_0xd534('0x9')](_0xd534('0xe'),auth[_0xd534('0xa')](),controller[_0xd534('0xf')]);router[_0xd534('0x9')](_0xd534('0x10'),auth['isAuthenticated'](),controller[_0xd534('0x11')]);router['post']('/',auth[_0xd534('0xa')](),controller[_0xd534('0x12')]);router['post']('/preview',auth[_0xd534('0xa')](),controller['getPreview']);router[_0xd534('0x13')]('/timezone',auth[_0xd534('0xa')](),controller['getTimezone']);router[_0xd534('0x13')](_0xd534('0x14'),auth['isAuthenticated'](),controller[_0xd534('0x15')]);router[_0xd534('0x16')](_0xd534('0x10'),auth[_0xd534('0xa')](),controller['update']);router[_0xd534('0x17')]('/:id',auth[_0xd534('0xa')](),controller[_0xd534('0x18')]);module[_0xd534('0x19')]=router; \ No newline at end of file +var _0xb575=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','create','/timezone','getPreviewRecall','put','update','destroy','exports','multer','path'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0xb575,0x103));var _0x5b57=function(_0x4f067e,_0x3ded65){_0x4f067e=_0x4f067e-0x0;var _0x338eec=_0xb575[_0x4f067e];return _0x338eec;};'use strict';var multer=require(_0x5b57('0x0'));var util=require('util');var path=require(_0x5b57('0x1'));var timeout=require(_0x5b57('0x2'));var express=require(_0x5b57('0x3'));var router=express[_0x5b57('0x4')]();var fs_extra=require(_0x5b57('0x5'));var auth=require(_0x5b57('0x6'));var interaction=require(_0x5b57('0x7'));var config=require(_0x5b57('0x8'));var controller=require(_0x5b57('0x9'));router[_0x5b57('0xa')]('/',auth[_0x5b57('0xb')](),controller[_0x5b57('0xc')]);router[_0x5b57('0xa')](_0x5b57('0xd'),auth['isAuthenticated'](),controller[_0x5b57('0xe')]);router[_0x5b57('0xa')](_0x5b57('0xf'),auth['isAuthenticated'](),controller[_0x5b57('0x10')]);router[_0x5b57('0xa')](_0x5b57('0x11'),auth[_0x5b57('0xb')](),controller[_0x5b57('0x12')]);router[_0x5b57('0xa')](_0x5b57('0x13'),auth[_0x5b57('0xb')](),controller[_0x5b57('0x14')]);router[_0x5b57('0x15')]('/',auth[_0x5b57('0xb')](),controller[_0x5b57('0x16')]);router[_0x5b57('0x15')]('/preview',auth[_0x5b57('0xb')](),controller['getPreview']);router[_0x5b57('0x15')](_0x5b57('0x17'),auth[_0x5b57('0xb')](),controller['getTimezone']);router[_0x5b57('0x15')]('/previewrecall',auth['isAuthenticated'](),controller[_0x5b57('0x18')]);router[_0x5b57('0x19')](_0x5b57('0x13'),auth[_0x5b57('0xb')](),controller[_0x5b57('0x1a')]);router['delete']('/:id',auth[_0x5b57('0xb')](),controller[_0x5b57('0x1b')]);module[_0x5b57('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a715e63..0b6109d 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 _0x0183=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x0183,0x1e1));var _0x3018=function(_0x34f591,_0x55fb1c){_0x34f591=_0x34f591-0x0;var _0xda3ec2=_0x0183[_0x34f591];return _0xda3ec2;};'use strict';var moment=require(_0x3018('0x0'));var Sequelize=require(_0x3018('0x1'));module[_0x3018('0x2')]={'phone':{'type':Sequelize[_0x3018('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3018('0x4')],'unique':_0x3018('0x5')},'ListId':{'type':Sequelize[_0x3018('0x4')],'unique':_0x3018('0x5')},'VoiceQueueId':{'type':Sequelize[_0x3018('0x4')],'unique':_0x3018('0x5')}}; \ No newline at end of file +var _0xcb3a=['STRING','INTEGER','contactListQueue','moment'];(function(_0x310a54,_0x212d9a){var _0x4e4caa=function(_0x6baec9){while(--_0x6baec9){_0x310a54['push'](_0x310a54['shift']());}};_0x4e4caa(++_0x212d9a);}(_0xcb3a,0x1d7));var _0xacb3=function(_0x4dea3b,_0x3fe7a9){_0x4dea3b=_0x4dea3b-0x0;var _0x39e6a4=_0xcb3a[_0x4dea3b];return _0x39e6a4;};'use strict';var moment=require(_0xacb3('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xacb3('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xacb3('0x2')],'unique':_0xacb3('0x3')},'ListId':{'type':Sequelize[_0xacb3('0x2')],'unique':_0xacb3('0x3')},'VoiceQueueId':{'type':Sequelize[_0xacb3('0x2')],'unique':_0xacb3('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index d707d4a..cc3ea51 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 _0xfefa=['offset','undefined','limit','count','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','CmHopperBlack','findAll','rows','catch','show','params','include','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json'];(function(_0x2601fb,_0x5865f1){var _0x4f48c1=function(_0x3b38d2){while(--_0x3b38d2){_0x2601fb['push'](_0x2601fb['shift']());}};_0x4f48c1(++_0x5865f1);}(_0xfefa,0x14c));var _0xafef=function(_0x118b86,_0x547462){_0x118b86=_0x118b86-0x0;var _0x52242f=_0xfefa[_0x118b86];return _0x52242f;};'use strict';var emlformat=require(_0xafef('0x0'));var rimraf=require(_0xafef('0x1'));var zipdir=require(_0xafef('0x2'));var jsonpatch=require(_0xafef('0x3'));var rp=require(_0xafef('0x4'));var moment=require(_0xafef('0x5'));var BPromise=require(_0xafef('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xafef('0x7'));var sox=require(_0xafef('0x8'));var csv=require(_0xafef('0x9'));var ejs=require(_0xafef('0xa'));var fs=require('fs');var fs_extra=require(_0xafef('0xb'));var _=require(_0xafef('0xc'));var squel=require(_0xafef('0xd'));var crypto=require('crypto');var jsforce=require(_0xafef('0xe'));var deskjs=require(_0xafef('0xf'));var toCsv=require(_0xafef('0x9'));var querystring=require(_0xafef('0x10'));var Papa=require('papaparse');var Redis=require(_0xafef('0x11'));var authService=require(_0xafef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xafef('0x13'));var hardwareService=require(_0xafef('0x14'));var logger=require(_0xafef('0x15'))(_0xafef('0x16'));var utils=require(_0xafef('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ea237,_0x21e3a8){_0x21e3a8=_0x21e3a8||0xcc;return function(_0x567980){if(_0x567980){return _0x4ea237[_0xafef('0x18')](_0x21e3a8);}return _0x4ea237['status'](_0x21e3a8)[_0xafef('0x19')]();};}function respondWithResult(_0x4e6deb,_0x17f5e4){_0x17f5e4=_0x17f5e4||0xc8;return function(_0x25e837){if(_0x25e837){return _0x4e6deb[_0xafef('0x1a')](_0x17f5e4)[_0xafef('0x1b')](_0x25e837);}};}function respondWithFilteredResult(_0xc9c820,_0x52eb10){return function(_0x15f7b2){if(_0x15f7b2){var _0x28e266=typeof _0x52eb10[_0xafef('0x1c')]===_0xafef('0x1d')&&typeof _0x52eb10[_0xafef('0x1e')]===_0xafef('0x1d');var _0x3eb03d=_0x15f7b2[_0xafef('0x1f')];var _0x3ec325=_0x28e266?0x0:_0x52eb10['offset'];var _0x54bdb9=_0x28e266?_0x15f7b2[_0xafef('0x1f')]:_0x52eb10[_0xafef('0x1c')]+_0x52eb10['limit'];var _0xf26ae1;if(_0x54bdb9>=_0x3eb03d){_0x54bdb9=_0x3eb03d;_0xf26ae1=0xc8;}else{_0xf26ae1=0xce;}_0xc9c820['status'](_0xf26ae1);return _0xc9c820['set']('Content-Range',_0x3ec325+'-'+_0x54bdb9+'/'+_0x3eb03d)['json'](_0x15f7b2);}return null;};}function patchUpdates(_0x5f146a){return function(_0x2858e4){try{jsonpatch['apply'](_0x2858e4,_0x5f146a,!![]);}catch(_0x1e2700){return BPromise['reject'](_0x1e2700);}return _0x2858e4[_0xafef('0x20')]();};}function saveUpdates(_0x32ce79,_0x3c07dd){return function(_0x448e38){if(_0x448e38){return _0x448e38[_0xafef('0x21')](_0x32ce79)[_0xafef('0x22')](function(_0x246ce6){return _0x246ce6;});}return null;};}function removeEntity(_0x16ecd7,_0x39f97a){return function(_0x4e3452){if(_0x4e3452){return _0x4e3452[_0xafef('0x23')]()[_0xafef('0x22')](function(){_0x16ecd7[_0xafef('0x1a')](0xcc)[_0xafef('0x19')]();});}};}function handleEntityNotFound(_0x1f211d,_0x18c802){return function(_0x53cc92){if(!_0x53cc92){_0x1f211d[_0xafef('0x18')](0x194);}return _0x53cc92;};}function handleError(_0x1d7fd8,_0x6946cb){_0x6946cb=_0x6946cb||0x1f4;return function(_0x544619){logger[_0xafef('0x24')](_0x544619[_0xafef('0x25')]);if(_0x544619[_0xafef('0x26')]){delete _0x544619[_0xafef('0x26')];}_0x1d7fd8['status'](_0x6946cb)[_0xafef('0x27')](_0x544619);};}exports[_0xafef('0x28')]=function(_0x5d85df,_0x1c7642){var _0x799b9e={},_0x4413a8={},_0x3c8c3b={'count':0x0,'rows':[]};var _0x10d278=_['map'](db['CmHopperBlack'][_0xafef('0x29')],function(_0x1dbf24){return{'name':_0x1dbf24['fieldName'],'type':_0x1dbf24[_0xafef('0x2a')]['key']};});_0x4413a8[_0xafef('0x2b')]=_[_0xafef('0x2c')](_0x10d278,_0xafef('0x26'));_0x4413a8[_0xafef('0x2d')]=_[_0xafef('0x2e')](_0x5d85df[_0xafef('0x2d')]);_0x4413a8[_0xafef('0x2f')]=_[_0xafef('0x30')](_0x4413a8[_0xafef('0x2b')],_0x4413a8[_0xafef('0x2d')]);_0x799b9e['attributes']=_['intersection'](_0x4413a8[_0xafef('0x2b')],qs[_0xafef('0x31')](_0x5d85df['query']['fields']));_0x799b9e[_0xafef('0x32')]=_0x799b9e[_0xafef('0x32')][_0xafef('0x33')]?_0x799b9e[_0xafef('0x32')]:_0x4413a8['model'];if(!_0x5d85df[_0xafef('0x2d')][_0xafef('0x34')]('nolimit')){_0x799b9e[_0xafef('0x1e')]=qs['limit'](_0x5d85df[_0xafef('0x2d')][_0xafef('0x1e')]);_0x799b9e['offset']=qs[_0xafef('0x1c')](_0x5d85df[_0xafef('0x2d')]['offset']);}_0x799b9e[_0xafef('0x35')]=qs[_0xafef('0x36')](_0x5d85df[_0xafef('0x2d')][_0xafef('0x36')]);_0x799b9e[_0xafef('0x37')]=qs['filters'](_[_0xafef('0x38')](_0x5d85df[_0xafef('0x2d')],_0x4413a8[_0xafef('0x2f')]),_0x10d278);if(_0x5d85df[_0xafef('0x2d')][_0xafef('0x39')]){_0x799b9e[_0xafef('0x37')]=_[_0xafef('0x3a')](_0x799b9e[_0xafef('0x37')],{'$or':_[_0xafef('0x2c')](_0x10d278,function(_0x14f10b){if(_0x14f10b[_0xafef('0x2a')]!==_0xafef('0x3b')){var _0x1509c4={};_0x1509c4[_0x14f10b['name']]={'$like':'%'+_0x5d85df[_0xafef('0x2d')][_0xafef('0x39')]+'%'};return _0x1509c4;}})});}_0x799b9e=_[_0xafef('0x3a')]({},_0x799b9e,_0x5d85df[_0xafef('0x3c')]);var _0x296314={'where':_0x799b9e[_0xafef('0x37')]};return db['CmHopperBlack'][_0xafef('0x1f')](_0x296314)[_0xafef('0x22')](function(_0x242504){_0x3c8c3b[_0xafef('0x1f')]=_0x242504;if(_0x5d85df[_0xafef('0x2d')][_0xafef('0x3d')]){_0x799b9e['include']=[{'all':!![]}];}return db[_0xafef('0x3e')][_0xafef('0x3f')](_0x799b9e);})[_0xafef('0x22')](function(_0xcf7cd5){_0x3c8c3b[_0xafef('0x40')]=_0xcf7cd5;return _0x3c8c3b;})[_0xafef('0x22')](respondWithFilteredResult(_0x1c7642,_0x799b9e))[_0xafef('0x41')](handleError(_0x1c7642,null));};exports[_0xafef('0x42')]=function(_0x17161a,_0x43cdf3){var _0x175453={'raw':!![],'where':{'id':_0x17161a[_0xafef('0x43')]['id']}},_0x5df074={};_0x5df074[_0xafef('0x2b')]=_[_0xafef('0x2e')](db['CmHopperBlack'][_0xafef('0x29')]);_0x5df074['query']=_['keys'](_0x17161a[_0xafef('0x2d')]);_0x5df074['filters']=_[_0xafef('0x30')](_0x5df074['model'],_0x5df074[_0xafef('0x2d')]);_0x175453['attributes']=_[_0xafef('0x30')](_0x5df074[_0xafef('0x2b')],qs['fields'](_0x17161a[_0xafef('0x2d')][_0xafef('0x31')]));_0x175453['attributes']=_0x175453[_0xafef('0x32')][_0xafef('0x33')]?_0x175453[_0xafef('0x32')]:_0x5df074[_0xafef('0x2b')];if(_0x17161a[_0xafef('0x2d')][_0xafef('0x3d')]){_0x175453[_0xafef('0x44')]=[{'all':!![]}];}_0x175453=_['merge']({},_0x175453,_0x17161a['options']);return db[_0xafef('0x3e')]['find'](_0x175453)[_0xafef('0x22')](handleEntityNotFound(_0x43cdf3,null))[_0xafef('0x22')](respondWithResult(_0x43cdf3,null))[_0xafef('0x41')](handleError(_0x43cdf3,null));};exports[_0xafef('0x21')]=function(_0x557771,_0x18280f){if(_0x557771[_0xafef('0x45')]['id']){delete _0x557771[_0xafef('0x45')]['id'];}return db[_0xafef('0x3e')][_0xafef('0x46')]({'where':{'id':_0x557771[_0xafef('0x43')]['id']}})[_0xafef('0x22')](handleEntityNotFound(_0x18280f,null))[_0xafef('0x22')](saveUpdates(_0x557771[_0xafef('0x45')],null))['then'](respondWithResult(_0x18280f,null))[_0xafef('0x41')](handleError(_0x18280f,null));};exports[_0xafef('0x23')]=function(_0x158cf8,_0x5a0547){return db[_0xafef('0x3e')][_0xafef('0x46')]({'where':{'id':_0x158cf8[_0xafef('0x43')]['id']}})[_0xafef('0x22')](handleEntityNotFound(_0x5a0547,null))[_0xafef('0x22')](removeEntity(_0x5a0547,null))[_0xafef('0x41')](handleError(_0x5a0547,null));};exports[_0xafef('0x47')]=function(_0x1f2449,_0x5f06c4){return db[_0xafef('0x3e')][_0xafef('0x47')]()['then'](respondWithResult(_0x5f06c4,null))[_0xafef('0x41')](handleError(_0x5f06c4,null));}; \ No newline at end of file +var _0x500b=['sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','json','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','CmHopperBlack','includeAll','findAll','rows','catch','params','include','merge','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x500b,0x8c));var _0xb500=function(_0x439614,_0x4a3f3d){_0x439614=_0x439614-0x0;var _0x4a7560=_0x500b[_0x439614];return _0x4a7560;};'use strict';var emlformat=require(_0xb500('0x0'));var rimraf=require(_0xb500('0x1'));var zipdir=require(_0xb500('0x2'));var jsonpatch=require(_0xb500('0x3'));var rp=require(_0xb500('0x4'));var moment=require(_0xb500('0x5'));var BPromise=require(_0xb500('0x6'));var Mustache=require(_0xb500('0x7'));var util=require(_0xb500('0x8'));var path=require(_0xb500('0x9'));var sox=require(_0xb500('0xa'));var csv=require('to-csv');var ejs=require(_0xb500('0xb'));var fs=require('fs');var fs_extra=require(_0xb500('0xc'));var _=require(_0xb500('0xd'));var squel=require(_0xb500('0xe'));var crypto=require(_0xb500('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb500('0x10'));var toCsv=require(_0xb500('0x11'));var querystring=require('querystring');var Papa=require(_0xb500('0x12'));var Redis=require(_0xb500('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb500('0x14'));var logger=require(_0xb500('0x15'))(_0xb500('0x16'));var utils=require(_0xb500('0x17'));var config=require(_0xb500('0x18'));var licenseUtil=require(_0xb500('0x19'));var db=require(_0xb500('0x1a'))['db'];function respondWithStatusCode(_0x4cf075,_0x3d0fba){_0x3d0fba=_0x3d0fba||0xcc;return function(_0xcf779c){if(_0xcf779c){return _0x4cf075['sendStatus'](_0x3d0fba);}return _0x4cf075['status'](_0x3d0fba)['end']();};}function respondWithResult(_0x3e56e4,_0x39a3bc){_0x39a3bc=_0x39a3bc||0xc8;return function(_0x1849df){if(_0x1849df){return _0x3e56e4[_0xb500('0x1b')](_0x39a3bc)['json'](_0x1849df);}};}function respondWithFilteredResult(_0x4cba77,_0x373199){return function(_0x47a3a3){if(_0x47a3a3){var _0x1d9bd6=typeof _0x373199['offset']===_0xb500('0x1c')&&typeof _0x373199[_0xb500('0x1d')]===_0xb500('0x1c');var _0x30abc7=_0x47a3a3[_0xb500('0x1e')];var _0x5897d1=_0x1d9bd6?0x0:_0x373199[_0xb500('0x1f')];var _0x306c6a=_0x1d9bd6?_0x47a3a3[_0xb500('0x1e')]:_0x373199[_0xb500('0x1f')]+_0x373199[_0xb500('0x1d')];var _0x2cb52b;if(_0x306c6a>=_0x30abc7){_0x306c6a=_0x30abc7;_0x2cb52b=0xc8;}else{_0x2cb52b=0xce;}_0x4cba77['status'](_0x2cb52b);return _0x4cba77['set']('Content-Range',_0x5897d1+'-'+_0x306c6a+'/'+_0x30abc7)[_0xb500('0x20')](_0x47a3a3);}return null;};}function patchUpdates(_0x118626){return function(_0x44b04d){try{jsonpatch[_0xb500('0x21')](_0x44b04d,_0x118626,!![]);}catch(_0x3209d4){return BPromise[_0xb500('0x22')](_0x3209d4);}return _0x44b04d[_0xb500('0x23')]();};}function saveUpdates(_0xf68960,_0x30eb1a){return function(_0xda646b){if(_0xda646b){return _0xda646b[_0xb500('0x24')](_0xf68960)['then'](function(_0x4b1595){return _0x4b1595;});}return null;};}function removeEntity(_0x58cc4d,_0x3d1231){return function(_0x3d3908){if(_0x3d3908){return _0x3d3908[_0xb500('0x25')]()[_0xb500('0x26')](function(){_0x58cc4d[_0xb500('0x1b')](0xcc)[_0xb500('0x27')]();});}};}function handleEntityNotFound(_0x50f114,_0x80b670){return function(_0x13e0ed){if(!_0x13e0ed){_0x50f114[_0xb500('0x28')](0x194);}return _0x13e0ed;};}function handleError(_0x106e4b,_0x38fe56){_0x38fe56=_0x38fe56||0x1f4;return function(_0x192726){logger[_0xb500('0x29')](_0x192726['stack']);if(_0x192726['name']){delete _0x192726[_0xb500('0x2a')];}_0x106e4b[_0xb500('0x1b')](_0x38fe56)[_0xb500('0x2b')](_0x192726);};}exports[_0xb500('0x2c')]=function(_0x37d9ae,_0x2bd499){var _0x484796={},_0x2e75e1={},_0x54b0ad={'count':0x0,'rows':[]};var _0x53f0d0=_[_0xb500('0x2d')](db['CmHopperBlack'][_0xb500('0x2e')],function(_0xf77637){return{'name':_0xf77637['fieldName'],'type':_0xf77637[_0xb500('0x2f')][_0xb500('0x30')]};});_0x2e75e1['model']=_[_0xb500('0x2d')](_0x53f0d0,_0xb500('0x2a'));_0x2e75e1[_0xb500('0x31')]=_[_0xb500('0x32')](_0x37d9ae['query']);_0x2e75e1[_0xb500('0x33')]=_[_0xb500('0x34')](_0x2e75e1[_0xb500('0x35')],_0x2e75e1['query']);_0x484796[_0xb500('0x36')]=_['intersection'](_0x2e75e1['model'],qs['fields'](_0x37d9ae[_0xb500('0x31')][_0xb500('0x37')]));_0x484796[_0xb500('0x36')]=_0x484796[_0xb500('0x36')][_0xb500('0x38')]?_0x484796[_0xb500('0x36')]:_0x2e75e1[_0xb500('0x35')];if(!_0x37d9ae['query'][_0xb500('0x39')](_0xb500('0x3a'))){_0x484796[_0xb500('0x1d')]=qs['limit'](_0x37d9ae[_0xb500('0x31')][_0xb500('0x1d')]);_0x484796['offset']=qs[_0xb500('0x1f')](_0x37d9ae['query'][_0xb500('0x1f')]);}_0x484796['order']=qs[_0xb500('0x3b')](_0x37d9ae['query'][_0xb500('0x3b')]);_0x484796[_0xb500('0x3c')]=qs['filters'](_[_0xb500('0x3d')](_0x37d9ae[_0xb500('0x31')],_0x2e75e1[_0xb500('0x33')]),_0x53f0d0);if(_0x37d9ae['query'][_0xb500('0x3e')]){_0x484796['where']=_['merge'](_0x484796[_0xb500('0x3c')],{'$or':_[_0xb500('0x2d')](_0x53f0d0,function(_0x390104){if(_0x390104['type']!=='VIRTUAL'){var _0x19aa6b={};_0x19aa6b[_0x390104['name']]={'$like':'%'+_0x37d9ae[_0xb500('0x31')][_0xb500('0x3e')]+'%'};return _0x19aa6b;}})});}_0x484796=_['merge']({},_0x484796,_0x37d9ae[_0xb500('0x3f')]);var _0x437561={'where':_0x484796[_0xb500('0x3c')]};return db[_0xb500('0x40')][_0xb500('0x1e')](_0x437561)[_0xb500('0x26')](function(_0x398902){_0x54b0ad[_0xb500('0x1e')]=_0x398902;if(_0x37d9ae[_0xb500('0x31')][_0xb500('0x41')]){_0x484796['include']=[{'all':!![]}];}return db[_0xb500('0x40')][_0xb500('0x42')](_0x484796);})['then'](function(_0x3b7ede){_0x54b0ad[_0xb500('0x43')]=_0x3b7ede;return _0x54b0ad;})[_0xb500('0x26')](respondWithFilteredResult(_0x2bd499,_0x484796))[_0xb500('0x44')](handleError(_0x2bd499,null));};exports['show']=function(_0x3b4eaf,_0x2db490){var _0x52ced0={'raw':!![],'where':{'id':_0x3b4eaf[_0xb500('0x45')]['id']}},_0x1ba4a5={};_0x1ba4a5['model']=_[_0xb500('0x32')](db[_0xb500('0x40')][_0xb500('0x2e')]);_0x1ba4a5['query']=_[_0xb500('0x32')](_0x3b4eaf[_0xb500('0x31')]);_0x1ba4a5[_0xb500('0x33')]=_[_0xb500('0x34')](_0x1ba4a5[_0xb500('0x35')],_0x1ba4a5[_0xb500('0x31')]);_0x52ced0[_0xb500('0x36')]=_[_0xb500('0x34')](_0x1ba4a5[_0xb500('0x35')],qs['fields'](_0x3b4eaf[_0xb500('0x31')][_0xb500('0x37')]));_0x52ced0['attributes']=_0x52ced0[_0xb500('0x36')][_0xb500('0x38')]?_0x52ced0[_0xb500('0x36')]:_0x1ba4a5[_0xb500('0x35')];if(_0x3b4eaf[_0xb500('0x31')][_0xb500('0x41')]){_0x52ced0[_0xb500('0x46')]=[{'all':!![]}];}_0x52ced0=_[_0xb500('0x47')]({},_0x52ced0,_0x3b4eaf['options']);return db['CmHopperBlack'][_0xb500('0x48')](_0x52ced0)[_0xb500('0x26')](handleEntityNotFound(_0x2db490,null))[_0xb500('0x26')](respondWithResult(_0x2db490,null))[_0xb500('0x44')](handleError(_0x2db490,null));};exports[_0xb500('0x24')]=function(_0x2aec71,_0x5854e4){if(_0x2aec71[_0xb500('0x49')]['id']){delete _0x2aec71[_0xb500('0x49')]['id'];}return db[_0xb500('0x40')][_0xb500('0x48')]({'where':{'id':_0x2aec71[_0xb500('0x45')]['id']}})[_0xb500('0x26')](handleEntityNotFound(_0x5854e4,null))['then'](saveUpdates(_0x2aec71[_0xb500('0x49')],null))['then'](respondWithResult(_0x5854e4,null))[_0xb500('0x44')](handleError(_0x5854e4,null));};exports[_0xb500('0x25')]=function(_0x2dd819,_0x306799){return db['CmHopperBlack'][_0xb500('0x48')]({'where':{'id':_0x2dd819[_0xb500('0x45')]['id']}})['then'](handleEntityNotFound(_0x306799,null))['then'](removeEntity(_0x306799,null))['catch'](handleError(_0x306799,null));};exports[_0xb500('0x4a')]=function(_0x466dda,_0x821dac){return db['CmHopperBlack'][_0xb500('0x4a')]()[_0xb500('0x26')](respondWithResult(_0x821dac,null))[_0xb500('0x44')](handleError(_0x821dac,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index fc59a60..c941524 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 _0x6444=['CmHopperBlack','cm_hopper_black','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x71f716,_0x45ca5c){var _0x1df4ed=function(_0x44c9d1){while(--_0x44c9d1){_0x71f716['push'](_0x71f716['shift']());}};_0x1df4ed(++_0x45ca5c);}(_0x6444,0x9c));var _0x4644=function(_0x31741b,_0x5aeb18){_0x31741b=_0x31741b-0x0;var _0x49e96b=_0x6444[_0x31741b];return _0x49e96b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4644('0x0'))(_0x4644('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4644('0x2'));var fs=require('fs');var path=require(_0x4644('0x3'));var rimraf=require(_0x4644('0x4'));var config=require(_0x4644('0x5'));var attributes=require(_0x4644('0x6'));module[_0x4644('0x7')]=function(_0x4d1265,_0x718467){return _0x4d1265[_0x4644('0x8')](_0x4644('0x9'),attributes,{'tableName':_0x4644('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd306=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','cm_hopper_black','lodash'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0xd306,0x99));var _0x6d30=function(_0x3fbe48,_0x25ace7){_0x3fbe48=_0x3fbe48-0x0;var _0x378090=_0xd306[_0x3fbe48];return _0x378090;};'use strict';var _=require(_0x6d30('0x0'));var util=require(_0x6d30('0x1'));var logger=require(_0x6d30('0x2'))(_0x6d30('0x3'));var moment=require(_0x6d30('0x4'));var BPromise=require(_0x6d30('0x5'));var rp=require(_0x6d30('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d30('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x6d30('0x8')]=function(_0x164415,_0x13540d){return _0x164415[_0x6d30('0x9')]('CmHopperBlack',attributes,{'tableName':_0x6d30('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 385955d..2d84590 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 _0x460e=['../../config/utils','rpc','../../config/environment','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetCmHopperBlack','findAll','options','raw','where','attributes','include','map','model','then','catch','UpdateCmHopperBlack','CmHopperBlack','update','body','debug','DestroyCmHopperBlack','util','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x460e,0x68));var _0xe460=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x460e[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require('lodash');var util=require(_0xe460('0x0'));var moment=require('moment');var BPromise=require(_0xe460('0x1'));var rs=require(_0xe460('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe460('0x3'))['db'];var utils=require(_0xe460('0x4'));var logger=require('../../config/logger')(_0xe460('0x5'));var config=require(_0xe460('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe460('0x7')][_0xe460('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f61b4,_0x3aff12,_0x330a8a){return new BPromise(function(_0xa84f0b,_0x5376e2){return client[_0xe460('0x9')](_0x1f61b4,_0x330a8a)['then'](function(_0x10e8ee){logger[_0xe460('0xa')](_0xe460('0xb'),_0x3aff12,'request\x20sent');logger['debug'](_0xe460('0xc'),_0x3aff12,'request\x20sent',JSON[_0xe460('0xd')](_0x10e8ee));if(_0x10e8ee[_0xe460('0xe')]){if(_0x10e8ee[_0xe460('0xe')][_0xe460('0xf')]===0x1f4){logger[_0xe460('0xe')](_0xe460('0xb'),_0x3aff12,_0x10e8ee[_0xe460('0xe')][_0xe460('0x10')]);return _0x5376e2(_0x10e8ee[_0xe460('0xe')][_0xe460('0x10')]);}logger[_0xe460('0xe')](_0xe460('0xb'),_0x3aff12,_0x10e8ee[_0xe460('0xe')][_0xe460('0x10')]);return _0xa84f0b(_0x10e8ee[_0xe460('0xe')]['message']);}else{logger[_0xe460('0xa')](_0xe460('0xb'),_0x3aff12,_0xe460('0x11'));_0xa84f0b(_0x10e8ee[_0xe460('0x12')][_0xe460('0x10')]);}})['catch'](function(_0x339db1){logger['error'](_0xe460('0xb'),_0x3aff12,_0x339db1);_0x5376e2(_0x339db1);});});}exports[_0xe460('0x13')]=function(_0x3e4a64){var _0x5d9331=this;return new Promise(function(_0x28f799,_0x26f032){return db['CmHopperBlack'][_0xe460('0x14')]({'raw':_0x3e4a64['options']?_0x3e4a64[_0xe460('0x15')][_0xe460('0x16')]===undefined?!![]:![]:!![],'where':_0x3e4a64[_0xe460('0x15')]?_0x3e4a64[_0xe460('0x15')][_0xe460('0x17')]||null:null,'attributes':_0x3e4a64[_0xe460('0x15')]?_0x3e4a64[_0xe460('0x15')][_0xe460('0x18')]||null:null,'limit':_0x3e4a64['options']?_0x3e4a64[_0xe460('0x15')]['limit']||null:null,'include':_0x3e4a64['options']?_0x3e4a64[_0xe460('0x15')][_0xe460('0x19')]?_[_0xe460('0x1a')](_0x3e4a64['options'][_0xe460('0x19')],function(_0x2bea26){return{'model':db[_0x2bea26[_0xe460('0x1b')]],'as':_0x2bea26['as'],'attributes':_0x2bea26[_0xe460('0x18')],'include':_0x2bea26['include']?_[_0xe460('0x1a')](_0x2bea26[_0xe460('0x19')],function(_0x3f2444){return{'model':db[_0x3f2444[_0xe460('0x1b')]],'as':_0x3f2444['as'],'attributes':_0x3f2444['attributes'],'include':_0x3f2444[_0xe460('0x19')]?_[_0xe460('0x1a')](_0x3f2444[_0xe460('0x19')],function(_0x16589b){return{'model':db[_0x16589b[_0xe460('0x1b')]],'as':_0x16589b['as'],'attributes':_0x16589b[_0xe460('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe460('0x1c')](function(_0x2f4a3b){logger[_0xe460('0xa')](_0xe460('0x13'),_0x3e4a64);logger['debug'](_0xe460('0x13'),_0x3e4a64,JSON[_0xe460('0xd')](_0x2f4a3b));_0x28f799(_0x2f4a3b);})[_0xe460('0x1d')](function(_0x3f96b1){logger[_0xe460('0xe')](_0xe460('0x13'),_0x3f96b1['message'],_0x3e4a64);_0x26f032(_0x5d9331[_0xe460('0xe')](0x1f4,_0x3f96b1[_0xe460('0x10')]));});});};exports[_0xe460('0x1e')]=function(_0x4254b8){var _0x5d4bb7=this;return new Promise(function(_0x454078,_0x5d32b6){return db[_0xe460('0x1f')][_0xe460('0x20')](_0x4254b8[_0xe460('0x21')],{'raw':_0x4254b8[_0xe460('0x15')]?_0x4254b8[_0xe460('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4254b8[_0xe460('0x15')]?_0x4254b8['options'][_0xe460('0x17')]||null:null,'attributes':_0x4254b8[_0xe460('0x15')]?_0x4254b8['options'][_0xe460('0x18')]||null:null,'limit':_0x4254b8[_0xe460('0x15')]?_0x4254b8[_0xe460('0x15')]['limit']||null:null})[_0xe460('0x1c')](function(_0x32d34e){logger[_0xe460('0xa')](_0xe460('0x1e'),_0x4254b8);logger[_0xe460('0x22')](_0xe460('0x1e'),_0x4254b8,JSON[_0xe460('0xd')](_0x32d34e));_0x454078(_0x32d34e);})[_0xe460('0x1d')](function(_0xe32813){logger[_0xe460('0xe')](_0xe460('0x1e'),_0xe32813[_0xe460('0x10')],_0x4254b8);_0x5d32b6(_0x5d4bb7[_0xe460('0xe')](0x1f4,_0xe32813[_0xe460('0x10')]));});});};exports[_0xe460('0x23')]=function(_0x5960b4){var _0x31e650=this;return new Promise(function(_0x15ff82,_0x55fe0d){return db[_0xe460('0x1f')]['destroy']({'where':_0x5960b4[_0xe460('0x15')]?_0x5960b4['options'][_0xe460('0x17')]||null:null})[_0xe460('0x1c')](function(_0x4d413f){logger[_0xe460('0xa')](_0xe460('0x23'),_0x5960b4);logger[_0xe460('0x22')](_0xe460('0x23'),_0x5960b4,JSON[_0xe460('0xd')](_0x4d413f));_0x15ff82(_0x4d413f);})['catch'](function(_0xbb3d99){logger[_0xe460('0xe')]('DestroyCmHopperBlack',_0xbb3d99[_0xe460('0x10')],_0x5960b4);_0x55fe0d(_0x31e650[_0xe460('0xe')](0x1f4,_0xbb3d99[_0xe460('0x10')]));});});}; \ No newline at end of file +var _0xe416=['catch','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','raw','where','include','map','model','attributes','GetCmHopperBlack','debug'];(function(_0x3d956a,_0x107964){var _0x2ca95d=function(_0xeed786){while(--_0xeed786){_0x3d956a['push'](_0x3d956a['shift']());}};_0x2ca95d(++_0x107964);}(_0xe416,0x142));var _0x6e41=function(_0x3dd4b9,_0x21827f){_0x3dd4b9=_0x3dd4b9-0x0;var _0x1e4409=_0xe416[_0x3dd4b9];return _0x1e4409;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e41('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e41('0x1'))['db'];var utils=require(_0x6e41('0x2'));var logger=require('../../config/logger')(_0x6e41('0x3'));var config=require(_0x6e41('0x4'));var jayson=require(_0x6e41('0x5'));var client=jayson[_0x6e41('0x6')][_0x6e41('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf94983,_0x3ced55,_0x2cf2af){return new BPromise(function(_0x5bfdf6,_0x2ce7ae){return client[_0x6e41('0x8')](_0xf94983,_0x2cf2af)[_0x6e41('0x9')](function(_0x4db19b){logger[_0x6e41('0xa')](_0x6e41('0xb'),_0x3ced55,'request\x20sent');logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x3ced55,_0x6e41('0xc'),JSON[_0x6e41('0xd')](_0x4db19b));if(_0x4db19b[_0x6e41('0xe')]){if(_0x4db19b[_0x6e41('0xe')][_0x6e41('0xf')]===0x1f4){logger[_0x6e41('0xe')](_0x6e41('0xb'),_0x3ced55,_0x4db19b[_0x6e41('0xe')][_0x6e41('0x10')]);return _0x2ce7ae(_0x4db19b[_0x6e41('0xe')][_0x6e41('0x10')]);}logger[_0x6e41('0xe')](_0x6e41('0xb'),_0x3ced55,_0x4db19b['error'][_0x6e41('0x10')]);return _0x5bfdf6(_0x4db19b[_0x6e41('0xe')][_0x6e41('0x10')]);}else{logger['info'](_0x6e41('0xb'),_0x3ced55,_0x6e41('0xc'));_0x5bfdf6(_0x4db19b[_0x6e41('0x11')][_0x6e41('0x10')]);}})['catch'](function(_0x4e51af){logger[_0x6e41('0xe')](_0x6e41('0xb'),_0x3ced55,_0x4e51af);_0x2ce7ae(_0x4e51af);});});}exports['GetCmHopperBlack']=function(_0x44bdb8){var _0x5bfe4a=this;return new Promise(function(_0x314abc,_0x45dd9c){return db['CmHopperBlack'][_0x6e41('0x12')]({'raw':_0x44bdb8[_0x6e41('0x13')]?_0x44bdb8[_0x6e41('0x13')][_0x6e41('0x14')]===undefined?!![]:![]:!![],'where':_0x44bdb8[_0x6e41('0x13')]?_0x44bdb8[_0x6e41('0x13')][_0x6e41('0x15')]||null:null,'attributes':_0x44bdb8[_0x6e41('0x13')]?_0x44bdb8[_0x6e41('0x13')]['attributes']||null:null,'limit':_0x44bdb8[_0x6e41('0x13')]?_0x44bdb8[_0x6e41('0x13')]['limit']||null:null,'include':_0x44bdb8[_0x6e41('0x13')]?_0x44bdb8['options'][_0x6e41('0x16')]?_[_0x6e41('0x17')](_0x44bdb8[_0x6e41('0x13')]['include'],function(_0x218ae7){return{'model':db[_0x218ae7[_0x6e41('0x18')]],'as':_0x218ae7['as'],'attributes':_0x218ae7[_0x6e41('0x19')],'include':_0x218ae7[_0x6e41('0x16')]?_[_0x6e41('0x17')](_0x218ae7['include'],function(_0x1816b3){return{'model':db[_0x1816b3[_0x6e41('0x18')]],'as':_0x1816b3['as'],'attributes':_0x1816b3['attributes'],'include':_0x1816b3[_0x6e41('0x16')]?_[_0x6e41('0x17')](_0x1816b3[_0x6e41('0x16')],function(_0x5554c3){return{'model':db[_0x5554c3[_0x6e41('0x18')]],'as':_0x5554c3['as'],'attributes':_0x5554c3[_0x6e41('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6e41('0x9')](function(_0x4f7fa7){logger[_0x6e41('0xa')](_0x6e41('0x1a'),_0x44bdb8);logger[_0x6e41('0x1b')](_0x6e41('0x1a'),_0x44bdb8,JSON['stringify'](_0x4f7fa7));_0x314abc(_0x4f7fa7);})[_0x6e41('0x1c')](function(_0x4cbb6d){logger['error']('GetCmHopperBlack',_0x4cbb6d['message'],_0x44bdb8);_0x45dd9c(_0x5bfe4a[_0x6e41('0xe')](0x1f4,_0x4cbb6d[_0x6e41('0x10')]));});});};exports[_0x6e41('0x1d')]=function(_0x54aa99){var _0x191737=this;return new Promise(function(_0x43c88e,_0x5b3b46){return db[_0x6e41('0x1e')][_0x6e41('0x1f')](_0x54aa99[_0x6e41('0x20')],{'raw':_0x54aa99[_0x6e41('0x13')]?_0x54aa99[_0x6e41('0x13')][_0x6e41('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54aa99[_0x6e41('0x13')]?_0x54aa99['options']['where']||null:null,'attributes':_0x54aa99['options']?_0x54aa99[_0x6e41('0x13')][_0x6e41('0x19')]||null:null,'limit':_0x54aa99['options']?_0x54aa99[_0x6e41('0x13')]['limit']||null:null})[_0x6e41('0x9')](function(_0x4a1dac){logger[_0x6e41('0xa')](_0x6e41('0x1d'),_0x54aa99);logger[_0x6e41('0x1b')](_0x6e41('0x1d'),_0x54aa99,JSON[_0x6e41('0xd')](_0x4a1dac));_0x43c88e(_0x4a1dac);})[_0x6e41('0x1c')](function(_0xcb6309){logger[_0x6e41('0xe')](_0x6e41('0x1d'),_0xcb6309[_0x6e41('0x10')],_0x54aa99);_0x5b3b46(_0x191737[_0x6e41('0xe')](0x1f4,_0xcb6309[_0x6e41('0x10')]));});});};exports[_0x6e41('0x21')]=function(_0x40fde9){var _0x10ca66=this;return new Promise(function(_0x2bfd63,_0x31b785){return db[_0x6e41('0x1e')][_0x6e41('0x22')]({'where':_0x40fde9[_0x6e41('0x13')]?_0x40fde9[_0x6e41('0x13')]['where']||null:null})[_0x6e41('0x9')](function(_0x56fe67){logger['info'](_0x6e41('0x21'),_0x40fde9);logger[_0x6e41('0x1b')](_0x6e41('0x21'),_0x40fde9,JSON['stringify'](_0x56fe67));_0x2bfd63(_0x56fe67);})[_0x6e41('0x1c')](function(_0x4af6e6){logger['error'](_0x6e41('0x21'),_0x4af6e6[_0x6e41('0x10')],_0x40fde9);_0x31b785(_0x10ca66[_0x6e41('0xe')](0x1f4,_0x4af6e6[_0x6e41('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index efe8478..aae5081 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 _0xafb9=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','show','put','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x56feda,_0x321944){var _0x408f32=function(_0x5d090b){while(--_0x5d090b){_0x56feda['push'](_0x56feda['shift']());}};_0x408f32(++_0x321944);}(_0xafb9,0x68));var _0x9afb=function(_0x33c10c,_0x519b4c){_0x33c10c=_0x33c10c-0x0;var _0x1b3788=_0xafb9[_0x33c10c];return _0x1b3788;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require(_0x9afb('0x4'));var router=express[_0x9afb('0x5')]();var fs_extra=require(_0x9afb('0x6'));var auth=require(_0x9afb('0x7'));var interaction=require(_0x9afb('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x9afb('0x9')]('/',auth['isAuthenticated'](),controller[_0x9afb('0xa')]);router['get']('/describe',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0x9')]('/:id',auth[_0x9afb('0xb')](),controller[_0x9afb('0xd')]);router[_0x9afb('0xe')](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller['update']);router['delete'](_0x9afb('0xf'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x10')]);module[_0x9afb('0x11')]=router; \ No newline at end of file +var _0x77d4=['get','isAuthenticated','index','describe','show','put','/:id','delete','destroy','util','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperBlack.controller'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x77d4,0x108));var _0x477d=function(_0x53b16b,_0x2a6550){_0x53b16b=_0x53b16b-0x0;var _0x5d10f3=_0x77d4[_0x53b16b];return _0x5d10f3;};'use strict';var multer=require('multer');var util=require(_0x477d('0x0'));var path=require('path');var timeout=require(_0x477d('0x1'));var express=require('express');var router=express[_0x477d('0x2')]();var fs_extra=require(_0x477d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x477d('0x4'));var controller=require(_0x477d('0x5'));router[_0x477d('0x6')]('/',auth[_0x477d('0x7')](),controller[_0x477d('0x8')]);router[_0x477d('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x477d('0x9')]);router['get']('/:id',auth[_0x477d('0x7')](),controller[_0x477d('0xa')]);router[_0x477d('0xb')](_0x477d('0xc'),auth[_0x477d('0x7')](),controller['update']);router[_0x477d('0xd')]('/:id',auth[_0x477d('0x7')](),controller[_0x477d('0xe')]);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 5f29d03..b0aa14e 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 _0xccec=['setDataValue','followuptime','diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x38960a,_0x555254){var _0x2495e1=function(_0xc319e5){while(--_0xc319e5){_0x38960a['push'](_0x38960a['shift']());}};_0x2495e1(++_0x555254);}(_0xccec,0x88));var _0xccce=function(_0x264873,_0x17ee62){_0x264873=_0x264873-0x0;var _0x29d1e6=_0xccec[_0x264873];return _0x29d1e6;};'use strict';var Sequelize=require(_0xccce('0x0'));var moment=require(_0xccce('0x1'));module[_0xccce('0x2')]={'state':{'type':Sequelize[_0xccce('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xccce('0x4')]},'scheduledat':{'type':Sequelize[_0xccce('0x5')]},'countbusyretry':{'type':Sequelize[_0xccce('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xccce('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xccce('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xccce('0x4')]},'originatecalleridname':{'type':Sequelize[_0xccce('0x4')]},'calleridnum':{'type':Sequelize[_0xccce('0x4')]},'calleridname':{'type':Sequelize[_0xccce('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xccce('0x5')]},'answertime':{'type':Sequelize[_0xccce('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xccce('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xccce('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xccce('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xccce('0x4')]},'campaigntype':{'type':Sequelize[_0xccce('0x4')]},'membername':{'type':Sequelize[_0xccce('0x4')]},'reason':{'type':Sequelize[_0xccce('0x4')]},'disposition':{'type':Sequelize[_0xccce('0x4')]},'secondDisposition':{'type':Sequelize[_0xccce('0x4')]},'thirdDisposition':{'type':Sequelize[_0xccce('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0xff8f11){var _0x12732d=this[_0xccce('0x6')]('endtime');if(_0x12732d&&_0xff8f11){this[_0xccce('0x7')](_0xccce('0x8'),moment(_0xff8f11)[_0xccce('0x9')](moment(_0x12732d),'seconds'));}return this[_0xccce('0x7')]('dispositionat',_0xff8f11);}},'amd':{'type':Sequelize[_0xccce('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xccce('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xccce('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xccce('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xccce('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xccce('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xccce('0x5')]},'recallme':{'type':Sequelize[_0xccce('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xccce('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xccce('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xccce('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x44bd=['endtime','followuptime','diff','setDataValue','dispositionat','BOOLEAN','moment','exports','INTEGER','DATE','STRING','getDataValue'];(function(_0x3d890d,_0x3984e0){var _0x223d86=function(_0x1ea237){while(--_0x1ea237){_0x3d890d['push'](_0x3d890d['shift']());}};_0x223d86(++_0x3984e0);}(_0x44bd,0x192));var _0xd44b=function(_0x174570,_0x326c35){_0x174570=_0x174570-0x0;var _0x162b65=_0x44bd[_0x174570];return _0x162b65;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd44b('0x0'));module[_0xd44b('0x1')]={'state':{'type':Sequelize[_0xd44b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd44b('0x3')]},'countbusyretry':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd44b('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd44b('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd44b('0x3')]},'responsetime':{'type':Sequelize[_0xd44b('0x3')]},'answertime':{'type':Sequelize[_0xd44b('0x3')]},'droptime':{'type':Sequelize[_0xd44b('0x3')]},'endtime':{'type':Sequelize[_0xd44b('0x3')]},'ringtime':{'type':Sequelize[_0xd44b('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[_0xd44b('0x4')]},'campaigntype':{'type':Sequelize[_0xd44b('0x4')]},'membername':{'type':Sequelize[_0xd44b('0x4')]},'reason':{'type':Sequelize[_0xd44b('0x4')]},'disposition':{'type':Sequelize[_0xd44b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd44b('0x4')]},'dispositionat':{'type':Sequelize[_0xd44b('0x3')],'set':function(_0x28b074){var _0x5503eb=this[_0xd44b('0x5')](_0xd44b('0x6'));if(_0x5503eb&&_0x28b074){this['setDataValue'](_0xd44b('0x7'),moment(_0x28b074)[_0xd44b('0x8')](moment(_0x5503eb),'seconds'));}return this[_0xd44b('0x9')](_0xd44b('0xa'),_0x28b074);}},'amd':{'type':Sequelize[_0xd44b('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd44b('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd44b('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd44b('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd44b('0x3')]},'deleted':{'type':Sequelize[_0xd44b('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd44b('0x3')]},'recallme':{'type':Sequelize[_0xd44b('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd44b('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd44b('0x2')],'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 35c4086..a6fefea 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 _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x243f79,_0x429e45){var _0x460321=function(_0x4feefc){while(--_0x4feefc){_0x243f79['push'](_0x243f79['shift']());}};_0x460321(++_0x429e45);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file +var _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x454cbd,_0x436d19){var _0x45b4bf=function(_0x52241d){while(--_0x52241d){_0x454cbd['push'](_0x454cbd['shift']());}};_0x45b4bf(++_0x436d19);}(_0x5d58,0x187));var _0x85d5=function(_0x16c6f3,_0x288c95){_0x16c6f3=_0x16c6f3-0x0;var _0x35e948=_0x5d58[_0x16c6f3];return _0x35e948;};'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('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 513d312..78ee48b 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 _0x5fa4=['api','path','rimraf','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x5e9d1f,_0x37c578){var _0x895bea=function(_0x4e10bc){while(--_0x4e10bc){_0x5e9d1f['push'](_0x5e9d1f['shift']());}};_0x895bea(++_0x37c578);}(_0x5fa4,0x6b));var _0x45fa=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x5fa4[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x45fa('0x0'));var util=require(_0x45fa('0x1'));var logger=require(_0x45fa('0x2'))(_0x45fa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x45fa('0x4'));var rimraf=require(_0x45fa('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x45fa('0x6')]=function(_0x1a7e7a,_0x3c55b0){return _0x1a7e7a[_0x45fa('0x7')](_0x45fa('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x45fa('0x9')]},{'name':'uniqueid','fields':[_0x45fa('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d5d=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x8d5d,0x105));var _0xd8d5=function(_0x3cec5e,_0x19d59f){_0x3cec5e=_0x3cec5e-0x0;var _0x2db60c=_0x8d5d[_0x3cec5e];return _0x2db60c;};'use strict';var _=require(_0xd8d5('0x0'));var util=require('util');var logger=require(_0xd8d5('0x1'))(_0xd8d5('0x2'));var moment=require(_0xd8d5('0x3'));var BPromise=require(_0xd8d5('0x4'));var rp=require(_0xd8d5('0x5'));var fs=require('fs');var path=require(_0xd8d5('0x6'));var rimraf=require(_0xd8d5('0x7'));var config=require('../../config/environment');var attributes=require(_0xd8d5('0x8'));module[_0xd8d5('0x9')]=function(_0x1039cb,_0x443c43){return _0x1039cb['define'](_0xd8d5('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xd8d5('0xb'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xd8d5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 7746acf..a8efee3 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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5524dc,_0x507099){var _0x384152=function(_0x2f1f8c){while(--_0x2f1f8c){_0x5524dc['push'](_0x5524dc['shift']());}};_0x384152(++_0x507099);}(_0x7a54,0x106));var _0x47a5=function(_0x5b54ad,_0x40eed7){_0x5b54ad=_0x5b54ad-0x0;var _0x7c5efc=_0x7a54[_0x5b54ad];return _0x7c5efc;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +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(_0x5b4913,_0xee09d3){var _0x208c61=function(_0x31200f){while(--_0x31200f){_0x5b4913['push'](_0x5b4913['shift']());}};_0x208c61(++_0xee09d3);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fa8ee,_0x3b350d){_0x3fa8ee=_0x3fa8ee-0x0;var _0x36a857=_0xb10b[_0x3fa8ee];return _0x36a857;};'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 411c2ac..c04fba2 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 _0xce47=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','/:id','update','exports','multer'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xce47,0x17f));var _0x7ce4=function(_0x4b32d0,_0xa5c123){_0x4b32d0=_0x4b32d0-0x0;var _0x51a4ee=_0xce47[_0x4b32d0];return _0x51a4ee;};'use strict';var multer=require(_0x7ce4('0x0'));var util=require('util');var path=require(_0x7ce4('0x1'));var timeout=require(_0x7ce4('0x2'));var express=require(_0x7ce4('0x3'));var router=express[_0x7ce4('0x4')]();var fs_extra=require(_0x7ce4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7ce4('0x6'));var config=require('../../config/environment');var controller=require(_0x7ce4('0x7'));router[_0x7ce4('0x8')]('/',auth[_0x7ce4('0x9')](),controller['index']);router[_0x7ce4('0x8')]('/describe',auth[_0x7ce4('0x9')](),controller['describe']);router['get']('/:id',auth[_0x7ce4('0x9')](),controller['show']);router[_0x7ce4('0x8')](_0x7ce4('0xa'),auth['isAuthenticated'](),controller[_0x7ce4('0xb')]);router[_0x7ce4('0x8')](_0x7ce4('0xc'),auth['isAuthenticated'](),controller[_0x7ce4('0xd')]);router['post'](_0x7ce4('0xe'),auth[_0x7ce4('0x9')](),controller[_0x7ce4('0xf')]);router[_0x7ce4('0x10')](_0x7ce4('0x11'),auth[_0x7ce4('0x9')](),controller[_0x7ce4('0x12')]);router[_0x7ce4('0x10')](_0x7ce4('0x13'),auth[_0x7ce4('0x9')](),controller['checkContactHopper']);router[_0x7ce4('0x14')](_0x7ce4('0x15'),auth['isAuthenticated'](),controller[_0x7ce4('0x16')]);module[_0x7ce4('0x17')]=router; \ No newline at end of file +var _0x089d=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','util','connect-timeout','express','../../components/interaction/service','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/voice/queue/countAttributes/:id'];(function(_0x2ceec2,_0x5d607a){var _0xbbe84e=function(_0x41a1ad){while(--_0x41a1ad){_0x2ceec2['push'](_0x2ceec2['shift']());}};_0xbbe84e(++_0x5d607a);}(_0x089d,0x137));var _0xd089=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x089d[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require(_0xd089('0x0'));var path=require('path');var timeout=require(_0xd089('0x1'));var express=require(_0xd089('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd089('0x3'));var config=require('../../config/environment');var controller=require(_0xd089('0x4'));router[_0xd089('0x5')]('/',auth['isAuthenticated'](),controller[_0xd089('0x6')]);router[_0xd089('0x5')](_0xd089('0x7'),auth[_0xd089('0x8')](),controller[_0xd089('0x9')]);router[_0xd089('0x5')]('/:id',auth[_0xd089('0x8')](),controller['show']);router[_0xd089('0x5')](_0xd089('0xa'),auth[_0xd089('0x8')](),controller[_0xd089('0xb')]);router['get'](_0xd089('0xc'),auth[_0xd089('0x8')](),controller[_0xd089('0xd')]);router[_0xd089('0xe')]('/voice/queue/moveContacts/:id',auth[_0xd089('0x8')](),controller[_0xd089('0xf')]);router[_0xd089('0xe')](_0xd089('0x10'),auth[_0xd089('0x8')](),controller[_0xd089('0x11')]);router[_0xd089('0xe')](_0xd089('0x12'),auth[_0xd089('0x8')](),controller[_0xd089('0x13')]);router[_0xd089('0x14')](_0xd089('0x15'),auth[_0xd089('0x8')](),controller[_0xd089('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index e83dd5f..9cb9d17 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 _0xd1ad=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xd1ad,0x1d7));var _0xdd1a=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0xd1ad[_0x2892da];return _0x28cff2;};'use strict';var Sequelize=require('sequelize');module[_0xdd1a('0x0')]={'state':{'type':Sequelize[_0xdd1a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xdd1a('0x2')]},'scheduledat':{'type':Sequelize[_0xdd1a('0x3')]},'countbusyretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdd1a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xdd1a('0x2')]},'originatecalleridname':{'type':Sequelize[_0xdd1a('0x2')]},'calleridnum':{'type':Sequelize[_0xdd1a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdd1a('0x3')]},'responsetime':{'type':Sequelize[_0xdd1a('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xdd1a('0x3')]},'endtime':{'type':Sequelize[_0xdd1a('0x3')]},'ringtime':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdd1a('0x2')]},'campaign':{'type':Sequelize[_0xdd1a('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdd1a('0x2')]},'reason':{'type':Sequelize[_0xdd1a('0x2')]},'amd':{'type':Sequelize[_0xdd1a('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdd1a('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xdd1a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdd1a('0x3')]},'recallme':{'type':Sequelize[_0xdd1a('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xdd1a('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdd1a('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xdd1a('0x2')]}}; \ No newline at end of file +var _0xb9e0=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x4ff97d,_0x48a03a){var _0x2a2494=function(_0x22ecc6){while(--_0x22ecc6){_0x4ff97d['push'](_0x4ff97d['shift']());}};_0x2a2494(++_0x48a03a);}(_0xb9e0,0x18c));var _0x0b9e=function(_0xc6d019,_0x4efcd3){_0xc6d019=_0xc6d019-0x0;var _0x775ffb=_0xb9e0[_0xc6d019];return _0x775ffb;};'use strict';var Sequelize=require(_0x0b9e('0x0'));module[_0x0b9e('0x1')]={'state':{'type':Sequelize[_0x0b9e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x0b9e('0x3')]},'scheduledat':{'type':Sequelize[_0x0b9e('0x4')]},'countbusyretry':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0b9e('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x0b9e('0x3')]},'originatecalleridname':{'type':Sequelize[_0x0b9e('0x3')]},'calleridnum':{'type':Sequelize[_0x0b9e('0x3')]},'calleridname':{'type':Sequelize[_0x0b9e('0x3')]},'starttime':{'type':Sequelize[_0x0b9e('0x4')]},'responsetime':{'type':Sequelize[_0x0b9e('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x0b9e('0x4')]},'endtime':{'type':Sequelize[_0x0b9e('0x4')]},'ringtime':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0b9e('0x3')]},'membername':{'type':Sequelize[_0x0b9e('0x3')]},'reason':{'type':Sequelize[_0x0b9e('0x3')]},'amd':{'type':Sequelize[_0x0b9e('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0b9e('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0b9e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0b9e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0b9e('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0b9e('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0b9e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0b9e('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 296db18..ea47d11 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 _0xf854=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','map','CmHopperHistory','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','create','describe','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0xf854,0x19c));var _0x4f85=function(_0x3e4dac,_0x588781){_0x3e4dac=_0x3e4dac-0x0;var _0xf4ce94=_0xf854[_0x3e4dac];return _0xf4ce94;};'use strict';var emlformat=require(_0x4f85('0x0'));var rimraf=require(_0x4f85('0x1'));var zipdir=require(_0x4f85('0x2'));var jsonpatch=require(_0x4f85('0x3'));var rp=require(_0x4f85('0x4'));var moment=require(_0x4f85('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4f85('0x6'));var util=require(_0x4f85('0x7'));var path=require('path');var sox=require(_0x4f85('0x8'));var csv=require(_0x4f85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f85('0xa'));var _=require(_0x4f85('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f85('0xc'));var toCsv=require(_0x4f85('0x9'));var querystring=require(_0x4f85('0xd'));var Papa=require('papaparse');var Redis=require(_0x4f85('0xe'));var authService=require(_0x4f85('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4f85('0x10'));var hardwareService=require(_0x4f85('0x11'));var logger=require(_0x4f85('0x12'))(_0x4f85('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f85('0x14'))['db'];function respondWithStatusCode(_0x5d307a,_0x471bd9){_0x471bd9=_0x471bd9||0xcc;return function(_0x5bb258){if(_0x5bb258){return _0x5d307a['sendStatus'](_0x471bd9);}return _0x5d307a[_0x4f85('0x15')](_0x471bd9)[_0x4f85('0x16')]();};}function respondWithResult(_0x36650b,_0x4addf9){_0x4addf9=_0x4addf9||0xc8;return function(_0x48f21f){if(_0x48f21f){return _0x36650b['status'](_0x4addf9)[_0x4f85('0x17')](_0x48f21f);}};}function respondWithFilteredResult(_0x4a8b9d,_0x509c23){return function(_0x44953e){if(_0x44953e){var _0x27b31b=typeof _0x509c23[_0x4f85('0x18')]===_0x4f85('0x19')&&typeof _0x509c23[_0x4f85('0x1a')]===_0x4f85('0x19');var _0xade191=_0x44953e[_0x4f85('0x1b')];var _0x237f3f=_0x27b31b?0x0:_0x509c23[_0x4f85('0x18')];var _0x3bbc95=_0x27b31b?_0x44953e[_0x4f85('0x1b')]:_0x509c23['offset']+_0x509c23[_0x4f85('0x1a')];var _0x410e19;if(_0x3bbc95>=_0xade191){_0x3bbc95=_0xade191;_0x410e19=0xc8;}else{_0x410e19=0xce;}_0x4a8b9d[_0x4f85('0x15')](_0x410e19);return _0x4a8b9d[_0x4f85('0x1c')](_0x4f85('0x1d'),_0x237f3f+'-'+_0x3bbc95+'/'+_0xade191)[_0x4f85('0x17')](_0x44953e);}return null;};}function patchUpdates(_0x1abaca){return function(_0x5a98a2){try{jsonpatch[_0x4f85('0x1e')](_0x5a98a2,_0x1abaca,!![]);}catch(_0x239544){return BPromise[_0x4f85('0x1f')](_0x239544);}return _0x5a98a2[_0x4f85('0x20')]();};}function saveUpdates(_0x1db903,_0x222d39){return function(_0x261844){if(_0x261844){return _0x261844[_0x4f85('0x21')](_0x1db903)[_0x4f85('0x22')](function(_0x131f78){return _0x131f78;});}return null;};}function removeEntity(_0x23432f,_0x4633e4){return function(_0x4374ec){if(_0x4374ec){return _0x4374ec[_0x4f85('0x23')]()[_0x4f85('0x22')](function(){_0x23432f[_0x4f85('0x15')](0xcc)[_0x4f85('0x16')]();});}};}function handleEntityNotFound(_0xccbb6d,_0x254d36){return function(_0x5efce3){if(!_0x5efce3){_0xccbb6d[_0x4f85('0x24')](0x194);}return _0x5efce3;};}function handleError(_0x4d91a6,_0x56e618){_0x56e618=_0x56e618||0x1f4;return function(_0x4c30be){logger['error'](_0x4c30be[_0x4f85('0x25')]);if(_0x4c30be[_0x4f85('0x26')]){delete _0x4c30be['name'];}_0x4d91a6[_0x4f85('0x15')](_0x56e618)['send'](_0x4c30be);};}exports['index']=function(_0x270408,_0x403314){var _0x135c25={},_0x1b0c39={},_0x7dc7d4={'count':0x0,'rows':[]};var _0x291b9f=_[_0x4f85('0x27')](db[_0x4f85('0x28')]['rawAttributes'],function(_0xd21c1e){return{'name':_0xd21c1e['fieldName'],'type':_0xd21c1e[_0x4f85('0x29')][_0x4f85('0x2a')]};});_0x1b0c39['model']=_[_0x4f85('0x27')](_0x291b9f,_0x4f85('0x26'));_0x1b0c39[_0x4f85('0x2b')]=_[_0x4f85('0x2c')](_0x270408['query']);_0x1b0c39[_0x4f85('0x2d')]=_[_0x4f85('0x2e')](_0x1b0c39[_0x4f85('0x2f')],_0x1b0c39['query']);_0x135c25[_0x4f85('0x30')]=_[_0x4f85('0x2e')](_0x1b0c39[_0x4f85('0x2f')],qs[_0x4f85('0x31')](_0x270408[_0x4f85('0x2b')][_0x4f85('0x31')]));_0x135c25[_0x4f85('0x30')]=_0x135c25[_0x4f85('0x30')][_0x4f85('0x32')]?_0x135c25['attributes']:_0x1b0c39['model'];if(!_0x270408['query'][_0x4f85('0x33')](_0x4f85('0x34'))){_0x135c25[_0x4f85('0x1a')]=qs['limit'](_0x270408[_0x4f85('0x2b')][_0x4f85('0x1a')]);_0x135c25['offset']=qs[_0x4f85('0x18')](_0x270408[_0x4f85('0x2b')][_0x4f85('0x18')]);}_0x135c25[_0x4f85('0x35')]=qs['sort'](_0x270408[_0x4f85('0x2b')][_0x4f85('0x36')]);_0x135c25[_0x4f85('0x37')]=qs[_0x4f85('0x2d')](_[_0x4f85('0x38')](_0x270408[_0x4f85('0x2b')],_0x1b0c39[_0x4f85('0x2d')]),_0x291b9f);if(_0x270408[_0x4f85('0x2b')][_0x4f85('0x39')]){_0x135c25[_0x4f85('0x37')]=_[_0x4f85('0x3a')](_0x135c25['where'],{'$or':_[_0x4f85('0x27')](_0x291b9f,function(_0x2c3330){if(_0x2c3330['type']!==_0x4f85('0x3b')){var _0x358366={};_0x358366[_0x2c3330[_0x4f85('0x26')]]={'$like':'%'+_0x270408[_0x4f85('0x2b')]['filter']+'%'};return _0x358366;}})});}_0x135c25=_['merge']({},_0x135c25,_0x270408[_0x4f85('0x3c')]);var _0x2337d6={'where':_0x135c25[_0x4f85('0x37')]};return db[_0x4f85('0x28')]['count'](_0x2337d6)['then'](function(_0x4b199e){_0x7dc7d4['count']=_0x4b199e;if(_0x270408[_0x4f85('0x2b')]['includeAll']){_0x135c25[_0x4f85('0x3d')]=[{'all':!![]}];}return db[_0x4f85('0x28')][_0x4f85('0x3e')](_0x135c25);})[_0x4f85('0x22')](function(_0x3c3d13){_0x7dc7d4[_0x4f85('0x3f')]=_0x3c3d13;return _0x7dc7d4;})[_0x4f85('0x22')](respondWithFilteredResult(_0x403314,_0x135c25))[_0x4f85('0x40')](handleError(_0x403314,null));};exports['show']=function(_0x157893,_0x253d99){var _0x14f455={'raw':!![],'where':{'id':_0x157893[_0x4f85('0x41')]['id']}},_0x91bce0={};_0x91bce0[_0x4f85('0x2f')]=_[_0x4f85('0x2c')](db[_0x4f85('0x28')][_0x4f85('0x42')]);_0x91bce0[_0x4f85('0x2b')]=_['keys'](_0x157893[_0x4f85('0x2b')]);_0x91bce0['filters']=_[_0x4f85('0x2e')](_0x91bce0['model'],_0x91bce0[_0x4f85('0x2b')]);_0x14f455[_0x4f85('0x30')]=_[_0x4f85('0x2e')](_0x91bce0[_0x4f85('0x2f')],qs[_0x4f85('0x31')](_0x157893[_0x4f85('0x2b')][_0x4f85('0x31')]));_0x14f455[_0x4f85('0x30')]=_0x14f455[_0x4f85('0x30')][_0x4f85('0x32')]?_0x14f455[_0x4f85('0x30')]:_0x91bce0[_0x4f85('0x2f')];if(_0x157893[_0x4f85('0x2b')][_0x4f85('0x43')]){_0x14f455['include']=[{'all':!![]}];}_0x14f455=_['merge']({},_0x14f455,_0x157893[_0x4f85('0x3c')]);return db[_0x4f85('0x28')]['find'](_0x14f455)['then'](handleEntityNotFound(_0x253d99,null))[_0x4f85('0x22')](respondWithResult(_0x253d99,null))[_0x4f85('0x40')](handleError(_0x253d99,null));};exports[_0x4f85('0x44')]=function(_0x358f42,_0x1e220f){return db[_0x4f85('0x28')]['create'](_0x358f42['body'],{})[_0x4f85('0x22')](respondWithResult(_0x1e220f,0xc9))[_0x4f85('0x40')](handleError(_0x1e220f,null));};exports[_0x4f85('0x45')]=function(_0x2f1283,_0x4c814b){return db[_0x4f85('0x28')][_0x4f85('0x45')]()[_0x4f85('0x22')](respondWithResult(_0x4c814b,null))[_0x4f85('0x40')](handleError(_0x4c814b,null));};exports[_0x4f85('0x21')]=function(_0x33c5e7,_0xa655c6){if(_0x33c5e7['body']['uniqueid']){delete _0x33c5e7['body']['uniqueid'];}return db[_0x4f85('0x28')][_0x4f85('0x46')]({'where':{'uniqueid':_0x33c5e7[_0x4f85('0x41')]['id']}})[_0x4f85('0x22')](handleEntityNotFound(_0xa655c6,null))[_0x4f85('0x22')](saveUpdates(_0x33c5e7['body'],null))[_0x4f85('0x22')](respondWithResult(_0xa655c6,null))[_0x4f85('0x40')](handleError(_0xa655c6,null));}; \ No newline at end of file +var _0x2f5a=['options','includeAll','include','findAll','show','params','length','catch','create','body','describe','uniqueid','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x5d08c8,_0x12c72d){var _0xf9f14d=function(_0x242a4a){while(--_0x242a4a){_0x5d08c8['push'](_0x5d08c8['shift']());}};_0xf9f14d(++_0x12c72d);}(_0x2f5a,0x14d));var _0xa2f5=function(_0xd637a3,_0x19b904){_0xd637a3=_0xd637a3-0x0;var _0x180a84=_0x2f5a[_0xd637a3];return _0x180a84;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa2f5('0x0'));var jsonpatch=require(_0xa2f5('0x1'));var rp=require(_0xa2f5('0x2'));var moment=require(_0xa2f5('0x3'));var BPromise=require(_0xa2f5('0x4'));var Mustache=require('mustache');var util=require(_0xa2f5('0x5'));var path=require(_0xa2f5('0x6'));var sox=require(_0xa2f5('0x7'));var csv=require(_0xa2f5('0x8'));var ejs=require(_0xa2f5('0x9'));var fs=require('fs');var fs_extra=require(_0xa2f5('0xa'));var _=require(_0xa2f5('0xb'));var squel=require(_0xa2f5('0xc'));var crypto=require('crypto');var jsforce=require(_0xa2f5('0xd'));var deskjs=require(_0xa2f5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa2f5('0xf'));var Papa=require(_0xa2f5('0x10'));var Redis=require(_0xa2f5('0x11'));var authService=require(_0xa2f5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa2f5('0x13'));var hardwareService=require(_0xa2f5('0x14'));var logger=require(_0xa2f5('0x15'))(_0xa2f5('0x16'));var utils=require('../../config/utils');var config=require(_0xa2f5('0x17'));var licenseUtil=require(_0xa2f5('0x18'));var db=require(_0xa2f5('0x19'))['db'];function respondWithStatusCode(_0xbff4b9,_0x1c3504){_0x1c3504=_0x1c3504||0xcc;return function(_0x24936f){if(_0x24936f){return _0xbff4b9[_0xa2f5('0x1a')](_0x1c3504);}return _0xbff4b9[_0xa2f5('0x1b')](_0x1c3504)[_0xa2f5('0x1c')]();};}function respondWithResult(_0x3ced50,_0x21f1c6){_0x21f1c6=_0x21f1c6||0xc8;return function(_0x16e6b1){if(_0x16e6b1){return _0x3ced50['status'](_0x21f1c6)[_0xa2f5('0x1d')](_0x16e6b1);}};}function respondWithFilteredResult(_0x19d5b3,_0x3aa05b){return function(_0x1498d5){if(_0x1498d5){var _0x5d7830=typeof _0x3aa05b[_0xa2f5('0x1e')]===_0xa2f5('0x1f')&&typeof _0x3aa05b['limit']==='undefined';var _0x3e0362=_0x1498d5[_0xa2f5('0x20')];var _0x490e12=_0x5d7830?0x0:_0x3aa05b[_0xa2f5('0x1e')];var _0x43fa76=_0x5d7830?_0x1498d5[_0xa2f5('0x20')]:_0x3aa05b[_0xa2f5('0x1e')]+_0x3aa05b['limit'];var _0x102dec;if(_0x43fa76>=_0x3e0362){_0x43fa76=_0x3e0362;_0x102dec=0xc8;}else{_0x102dec=0xce;}_0x19d5b3[_0xa2f5('0x1b')](_0x102dec);return _0x19d5b3[_0xa2f5('0x21')]('Content-Range',_0x490e12+'-'+_0x43fa76+'/'+_0x3e0362)[_0xa2f5('0x1d')](_0x1498d5);}return null;};}function patchUpdates(_0x3ca7d9){return function(_0x2c1ac4){try{jsonpatch[_0xa2f5('0x22')](_0x2c1ac4,_0x3ca7d9,!![]);}catch(_0x32fae8){return BPromise[_0xa2f5('0x23')](_0x32fae8);}return _0x2c1ac4[_0xa2f5('0x24')]();};}function saveUpdates(_0x1ce5a3,_0x319cd2){return function(_0x59ac3b){if(_0x59ac3b){return _0x59ac3b[_0xa2f5('0x25')](_0x1ce5a3)['then'](function(_0x53327f){return _0x53327f;});}return null;};}function removeEntity(_0x56af93,_0x42e8fc){return function(_0x36b09a){if(_0x36b09a){return _0x36b09a[_0xa2f5('0x26')]()[_0xa2f5('0x27')](function(){_0x56af93[_0xa2f5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xacd747,_0x1a989c){return function(_0x39ad8e){if(!_0x39ad8e){_0xacd747['sendStatus'](0x194);}return _0x39ad8e;};}function handleError(_0x27fd36,_0x45b974){_0x45b974=_0x45b974||0x1f4;return function(_0x221eff){logger[_0xa2f5('0x28')](_0x221eff[_0xa2f5('0x29')]);if(_0x221eff[_0xa2f5('0x2a')]){delete _0x221eff[_0xa2f5('0x2a')];}_0x27fd36[_0xa2f5('0x1b')](_0x45b974)[_0xa2f5('0x2b')](_0x221eff);};}exports[_0xa2f5('0x2c')]=function(_0x410be2,_0x557f25){var _0xa8f18a={},_0x227c71={},_0x23db3d={'count':0x0,'rows':[]};var _0x275c38=_[_0xa2f5('0x2d')](db[_0xa2f5('0x2e')][_0xa2f5('0x2f')],function(_0x3904f8){return{'name':_0x3904f8[_0xa2f5('0x30')],'type':_0x3904f8[_0xa2f5('0x31')][_0xa2f5('0x32')]};});_0x227c71['model']=_['map'](_0x275c38,_0xa2f5('0x2a'));_0x227c71[_0xa2f5('0x33')]=_[_0xa2f5('0x34')](_0x410be2['query']);_0x227c71[_0xa2f5('0x35')]=_[_0xa2f5('0x36')](_0x227c71[_0xa2f5('0x37')],_0x227c71[_0xa2f5('0x33')]);_0xa8f18a['attributes']=_[_0xa2f5('0x36')](_0x227c71['model'],qs['fields'](_0x410be2['query'][_0xa2f5('0x38')]));_0xa8f18a[_0xa2f5('0x39')]=_0xa8f18a[_0xa2f5('0x39')]['length']?_0xa8f18a[_0xa2f5('0x39')]:_0x227c71['model'];if(!_0x410be2['query'][_0xa2f5('0x3a')](_0xa2f5('0x3b'))){_0xa8f18a[_0xa2f5('0x3c')]=qs[_0xa2f5('0x3c')](_0x410be2['query'][_0xa2f5('0x3c')]);_0xa8f18a[_0xa2f5('0x1e')]=qs[_0xa2f5('0x1e')](_0x410be2[_0xa2f5('0x33')]['offset']);}_0xa8f18a[_0xa2f5('0x3d')]=qs['sort'](_0x410be2['query'][_0xa2f5('0x3e')]);_0xa8f18a[_0xa2f5('0x3f')]=qs[_0xa2f5('0x35')](_['pick'](_0x410be2[_0xa2f5('0x33')],_0x227c71[_0xa2f5('0x35')]),_0x275c38);if(_0x410be2[_0xa2f5('0x33')][_0xa2f5('0x40')]){_0xa8f18a[_0xa2f5('0x3f')]=_[_0xa2f5('0x41')](_0xa8f18a[_0xa2f5('0x3f')],{'$or':_['map'](_0x275c38,function(_0x2f5c57){if(_0x2f5c57[_0xa2f5('0x31')]!==_0xa2f5('0x42')){var _0x3d2b6d={};_0x3d2b6d[_0x2f5c57[_0xa2f5('0x2a')]]={'$like':'%'+_0x410be2['query'][_0xa2f5('0x40')]+'%'};return _0x3d2b6d;}})});}_0xa8f18a=_['merge']({},_0xa8f18a,_0x410be2[_0xa2f5('0x43')]);var _0x691912={'where':_0xa8f18a['where']};return db['CmHopperHistory']['count'](_0x691912)[_0xa2f5('0x27')](function(_0x1d2579){_0x23db3d['count']=_0x1d2579;if(_0x410be2[_0xa2f5('0x33')][_0xa2f5('0x44')]){_0xa8f18a[_0xa2f5('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa2f5('0x46')](_0xa8f18a);})[_0xa2f5('0x27')](function(_0x2fbb10){_0x23db3d['rows']=_0x2fbb10;return _0x23db3d;})['then'](respondWithFilteredResult(_0x557f25,_0xa8f18a))['catch'](handleError(_0x557f25,null));};exports[_0xa2f5('0x47')]=function(_0x1b9f41,_0x2b5f28){var _0x4bc437={'raw':!![],'where':{'id':_0x1b9f41[_0xa2f5('0x48')]['id']}},_0x462a26={};_0x462a26[_0xa2f5('0x37')]=_[_0xa2f5('0x34')](db[_0xa2f5('0x2e')][_0xa2f5('0x2f')]);_0x462a26[_0xa2f5('0x33')]=_[_0xa2f5('0x34')](_0x1b9f41[_0xa2f5('0x33')]);_0x462a26[_0xa2f5('0x35')]=_['intersection'](_0x462a26[_0xa2f5('0x37')],_0x462a26['query']);_0x4bc437[_0xa2f5('0x39')]=_['intersection'](_0x462a26[_0xa2f5('0x37')],qs[_0xa2f5('0x38')](_0x1b9f41[_0xa2f5('0x33')][_0xa2f5('0x38')]));_0x4bc437[_0xa2f5('0x39')]=_0x4bc437['attributes'][_0xa2f5('0x49')]?_0x4bc437[_0xa2f5('0x39')]:_0x462a26[_0xa2f5('0x37')];if(_0x1b9f41[_0xa2f5('0x33')][_0xa2f5('0x44')]){_0x4bc437[_0xa2f5('0x45')]=[{'all':!![]}];}_0x4bc437=_[_0xa2f5('0x41')]({},_0x4bc437,_0x1b9f41[_0xa2f5('0x43')]);return db[_0xa2f5('0x2e')]['find'](_0x4bc437)[_0xa2f5('0x27')](handleEntityNotFound(_0x2b5f28,null))['then'](respondWithResult(_0x2b5f28,null))[_0xa2f5('0x4a')](handleError(_0x2b5f28,null));};exports[_0xa2f5('0x4b')]=function(_0x25a016,_0x2f036f){return db[_0xa2f5('0x2e')][_0xa2f5('0x4b')](_0x25a016[_0xa2f5('0x4c')],{})[_0xa2f5('0x27')](respondWithResult(_0x2f036f,0xc9))['catch'](handleError(_0x2f036f,null));};exports[_0xa2f5('0x4d')]=function(_0x2cd2d2,_0x125187){return db['CmHopperHistory'][_0xa2f5('0x4d')]()[_0xa2f5('0x27')](respondWithResult(_0x125187,null))[_0xa2f5('0x4a')](handleError(_0x125187,null));};exports['update']=function(_0x219e0f,_0x4c8453){if(_0x219e0f[_0xa2f5('0x4c')][_0xa2f5('0x4e')]){delete _0x219e0f[_0xa2f5('0x4c')][_0xa2f5('0x4e')];}return db[_0xa2f5('0x2e')][_0xa2f5('0x4f')]({'where':{'uniqueid':_0x219e0f[_0xa2f5('0x48')]['id']}})[_0xa2f5('0x27')](handleEntityNotFound(_0x4c8453,null))[_0xa2f5('0x27')](saveUpdates(_0x219e0f['body'],null))[_0xa2f5('0x27')](respondWithResult(_0x4c8453,null))[_0xa2f5('0x4a')](handleError(_0x4c8453,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 6a73ade..8ca940b 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 _0xdd4f=['lodash','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmHopperHistory','endtime','uniqueid'];(function(_0x3ee76c,_0x58354e){var _0x14bfa8=function(_0xef7be8){while(--_0xef7be8){_0x3ee76c['push'](_0x3ee76c['shift']());}};_0x14bfa8(++_0x58354e);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2fca0c,_0x3ebc1c){_0x2fca0c=_0x2fca0c-0x0;var _0x1ba87b=_0xdd4f[_0x2fca0c];return _0x1ba87b;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfdd4('0x1'));var BPromise=require(_0xfdd4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd4('0x3'));var rimraf=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0xfdd4('0x6')]=function(_0x43cbcf,_0x30e080){return _0x43cbcf[_0xfdd4('0x7')](_0xfdd4('0x8'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xfdd4('0x9'),'fields':['endtime']},{'name':_0xfdd4('0xa'),'fields':[_0xfdd4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27fb=['moment','request-promise','path','rimraf','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x3d8d97,_0x402186){var _0x3c066c=function(_0x1f0c2e){while(--_0x1f0c2e){_0x3d8d97['push'](_0x3d8d97['shift']());}};_0x3c066c(++_0x402186);}(_0x27fb,0x1de));var _0xb27f=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x27fb[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var logger=require(_0xb27f('0x2'))('api');var moment=require(_0xb27f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb27f('0x4'));var fs=require('fs');var path=require(_0xb27f('0x5'));var rimraf=require(_0xb27f('0x6'));var config=require('../../config/environment');var attributes=require(_0xb27f('0x7'));module['exports']=function(_0x2a1fa2,_0x3d70f3){return _0x2a1fa2[_0xb27f('0x8')](_0xb27f('0x9'),attributes,{'tableName':_0xb27f('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xb27f('0xb')]},{'name':_0xb27f('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 103d2f3..f6d6be7 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 _0xcf84=['outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopperHistory','body','options','CreateCmHopperHistory','catch','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null'];(function(_0x4331ff,_0x1c4d72){var _0x50fd41=function(_0x322b1e){while(--_0x322b1e){_0x4331ff['push'](_0x4331ff['shift']());}};_0x50fd41(++_0x1c4d72);}(_0xcf84,0x175));var _0x4cf8=function(_0x542c1e,_0x3d45dd){_0x542c1e=_0x542c1e-0x0;var _0x517620=_0xcf84[_0x542c1e];return _0x517620;};'use strict';var _=require(_0x4cf8('0x0'));var util=require(_0x4cf8('0x1'));var moment=require(_0x4cf8('0x2'));var BPromise=require(_0x4cf8('0x3'));var rs=require(_0x4cf8('0x4'));var fs=require('fs');var Redis=require(_0x4cf8('0x5'));var db=require(_0x4cf8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cf8('0x7'))('rpc');var config=require(_0x4cf8('0x8'));var jayson=require(_0x4cf8('0x9'));var client=jayson[_0x4cf8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c25ae,_0x2002cc,_0x4755cd){return new BPromise(function(_0x4ea833,_0x2ca70f){return client[_0x4cf8('0xb')](_0x5c25ae,_0x4755cd)[_0x4cf8('0xc')](function(_0x1f490d){logger[_0x4cf8('0xd')](_0x4cf8('0xe'),_0x2002cc,_0x4cf8('0xf'));logger[_0x4cf8('0x10')](_0x4cf8('0x11'),_0x2002cc,'request\x20sent',JSON[_0x4cf8('0x12')](_0x1f490d));if(_0x1f490d[_0x4cf8('0x13')]){if(_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x14')]===0x1f4){logger[_0x4cf8('0x13')](_0x4cf8('0xe'),_0x2002cc,_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x15')]);return _0x2ca70f(_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x15')]);}logger[_0x4cf8('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x2002cc,_0x1f490d[_0x4cf8('0x13')][_0x4cf8('0x15')]);return _0x4ea833(_0x1f490d['error']['message']);}else{logger[_0x4cf8('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x2002cc,_0x4cf8('0xf'));_0x4ea833(_0x1f490d[_0x4cf8('0x16')]['message']);}})['catch'](function(_0x5c556b){logger[_0x4cf8('0x13')](_0x4cf8('0xe'),_0x2002cc,_0x5c556b);_0x2ca70f(_0x5c556b);});});}exports['CreateCmHopperHistory']=function(_0x16af39){var _0x28de0b=this;return new Promise(function(_0xae1518,_0x11f108){return db[_0x4cf8('0x17')]['create'](_0x16af39[_0x4cf8('0x18')],{'raw':_0x16af39[_0x4cf8('0x19')]?_0x16af39[_0x4cf8('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4cf8('0xc')](function(_0x486ff0){logger[_0x4cf8('0xd')](_0x4cf8('0x1a'),_0x16af39);logger['debug'](_0x4cf8('0x1a'),_0x16af39,JSON[_0x4cf8('0x12')](_0x486ff0));_0xae1518(_0x486ff0);})[_0x4cf8('0x1b')](function(_0x266c32){logger[_0x4cf8('0x13')](_0x4cf8('0x1a'),_0x266c32[_0x4cf8('0x15')],_0x16af39);_0x11f108(_0x28de0b[_0x4cf8('0x13')](0x1f4,_0x266c32[_0x4cf8('0x15')]));});});};exports[_0x4cf8('0x1c')]=function(_0x8cbe72){var _0x1edfe5=this;return new Promise(function(_0x53ae13,_0x37ee8e){return db[_0x4cf8('0x17')][_0x4cf8('0x1d')]({'raw':_0x8cbe72[_0x4cf8('0x19')]?_0x8cbe72['options'][_0x4cf8('0x1e')]===undefined?!![]:![]:!![],'where':_0x8cbe72[_0x4cf8('0x19')]?_0x8cbe72[_0x4cf8('0x19')][_0x4cf8('0x1f')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x4cf8('0x20')][_0x4cf8('0x21')]('id')),_0x4cf8('0x22')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x25')))),_0x4cf8('0x26')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')]['literal'](_0x4cf8('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn']('COUNT',db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x28')))),_0x4cf8('0x29')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x2a'),db['sequelize']['fn']('IF',db['sequelize'][_0x4cf8('0x24')](_0x4cf8('0x2b')))),'predictiveIntervalAvgHoldtime'],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x2a'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x2c')))),_0x4cf8('0x2d')]]})['then'](function(_0x215cd9){logger[_0x4cf8('0xd')](_0x4cf8('0x1c'),_0x8cbe72);logger[_0x4cf8('0x10')](_0x4cf8('0x1c'),_0x8cbe72,JSON['stringify'](_0x215cd9));_0x53ae13(_0x215cd9);})[_0x4cf8('0x1b')](function(_0x12efda){logger[_0x4cf8('0x13')](_0x4cf8('0x1c'),_0x12efda['message'],_0x8cbe72);_0x37ee8e(_0x1edfe5[_0x4cf8('0x13')](0x1f4,_0x12efda['message']));});});};exports[_0x4cf8('0x2e')]=function(_0x4a4307){var _0x38858e=this;return new Promise(function(_0x3e6fe6,_0x2df964){return db[_0x4cf8('0x17')][_0x4cf8('0x1d')]({'raw':_0x4a4307[_0x4cf8('0x19')]?_0x4a4307[_0x4cf8('0x19')][_0x4cf8('0x1e')]===undefined?!![]:![]:!![],'where':_0x4a4307[_0x4cf8('0x19')]?_0x4a4307[_0x4cf8('0x19')][_0x4cf8('0x1f')]||null:null,'attributes':[[_0x4cf8('0x2f'),'name'],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x30')))),_0x4cf8('0x31')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x32')))),_0x4cf8('0x33')],[db['sequelize']['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x25')))),_0x4cf8('0x34')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x35')))),'outboundBusyCallsDay'],[db[_0x4cf8('0x20')]['fn']('COUNT',db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0x4cf8('0x36')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db['sequelize']['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x37')))),_0x4cf8('0x38')],[db[_0x4cf8('0x20')]['fn']('COUNT',db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')]['literal'](_0x4cf8('0x39')))),'outboundDropCallsDayCallersExit'],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x3a')))),_0x4cf8('0x3b')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x3c')))),_0x4cf8('0x3d')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x3e')))),_0x4cf8('0x3f')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x40')))),_0x4cf8('0x41')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')][_0x4cf8('0x24')](_0x4cf8('0x42')))),_0x4cf8('0x43')],[db['sequelize']['fn'](_0x4cf8('0x23'),db['sequelize']['fn']('IF',db[_0x4cf8('0x20')]['literal'](_0x4cf8('0x44')))),_0x4cf8('0x41')],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')]['literal'](_0x4cf8('0x45')))),_0x4cf8('0x46')]],'group':['campaign']})[_0x4cf8('0xc')](function(_0x2900cd){logger[_0x4cf8('0xd')](_0x4cf8('0x2e'),_0x4a4307);logger[_0x4cf8('0x10')]('GetVoiceQueueHopperHistory',_0x4a4307,JSON[_0x4cf8('0x12')](_0x2900cd));_0x3e6fe6(_0x2900cd);})[_0x4cf8('0x1b')](function(_0x294c44){logger[_0x4cf8('0x13')]('GetVoiceQueueHopperHistory',_0x294c44[_0x4cf8('0x15')],_0x4a4307);_0x2df964(_0x38858e[_0x4cf8('0x13')](0x1f4,_0x294c44[_0x4cf8('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x5f0f87){var _0xe61e35=this;return new Promise(function(_0x545909,_0x5257c5){return db[_0x4cf8('0x17')][_0x4cf8('0x1d')]({'raw':_0x5f0f87['options']?_0x5f0f87['options'][_0x4cf8('0x1e')]===undefined?!![]:![]:!![],'where':_0x5f0f87['options']?_0x5f0f87[_0x4cf8('0x19')][_0x4cf8('0x1f')]||null:null,'attributes':[[_0x4cf8('0x2f'),'name'],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['col']('id')),'ivrTotalCallsDays'],[db[_0x4cf8('0x20')]['fn'](_0x4cf8('0x23'),db[_0x4cf8('0x20')]['fn']('IF',db[_0x4cf8('0x20')]['literal'](_0x4cf8('0x25')))),_0x4cf8('0x47')]],'group':['campaign']})[_0x4cf8('0xc')](function(_0x3aba29){logger['info']('GetCampaignHopperHistory',_0x5f0f87);logger['debug'](_0x4cf8('0x48'),_0x5f0f87,JSON[_0x4cf8('0x12')](_0x3aba29));_0x545909(_0x3aba29);})[_0x4cf8('0x1b')](function(_0x3db63a){logger[_0x4cf8('0x13')](_0x4cf8('0x48'),_0x3db63a[_0x4cf8('0x15')],_0x5f0f87);_0x5257c5(_0xe61e35[_0x4cf8('0x13')](0x1f4,_0x3db63a[_0x4cf8('0x15')]));});});}; \ No newline at end of file +var _0xcc94=['outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CmHopperHistory','options','CreateCmHopperHistory','debug','catch','AvgHandleTime','findAll','raw','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xcc94,0xee));var _0x4cc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc94[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4cc9('0x0'));var moment=require(_0x4cc9('0x1'));var BPromise=require(_0x4cc9('0x2'));var rs=require(_0x4cc9('0x3'));var fs=require('fs');var Redis=require(_0x4cc9('0x4'));var db=require(_0x4cc9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4cc9('0x6'));var config=require(_0x4cc9('0x7'));var jayson=require(_0x4cc9('0x8'));var client=jayson[_0x4cc9('0x9')][_0x4cc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59df01,_0xff989c,_0x4c82f1){return new BPromise(function(_0x2058f9,_0x40ec6d){return client[_0x4cc9('0xb')](_0x59df01,_0x4c82f1)[_0x4cc9('0xc')](function(_0x530d43){logger['info'](_0x4cc9('0xd'),_0xff989c,_0x4cc9('0xe'));logger['debug'](_0x4cc9('0xf'),_0xff989c,_0x4cc9('0xe'),JSON[_0x4cc9('0x10')](_0x530d43));if(_0x530d43[_0x4cc9('0x11')]){if(_0x530d43[_0x4cc9('0x11')][_0x4cc9('0x12')]===0x1f4){logger[_0x4cc9('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0xff989c,_0x530d43[_0x4cc9('0x11')][_0x4cc9('0x13')]);return _0x40ec6d(_0x530d43[_0x4cc9('0x11')][_0x4cc9('0x13')]);}logger[_0x4cc9('0x11')](_0x4cc9('0xd'),_0xff989c,_0x530d43[_0x4cc9('0x11')][_0x4cc9('0x13')]);return _0x2058f9(_0x530d43[_0x4cc9('0x11')][_0x4cc9('0x13')]);}else{logger[_0x4cc9('0x14')](_0x4cc9('0xd'),_0xff989c,_0x4cc9('0xe'));_0x2058f9(_0x530d43[_0x4cc9('0x15')][_0x4cc9('0x13')]);}})['catch'](function(_0x142696){logger[_0x4cc9('0x11')](_0x4cc9('0xd'),_0xff989c,_0x142696);_0x40ec6d(_0x142696);});});}exports['CreateCmHopperHistory']=function(_0x4b09d3){var _0x59ccfb=this;return new Promise(function(_0x38bbd4,_0x29a898){return db[_0x4cc9('0x16')]['create'](_0x4b09d3['body'],{'raw':_0x4b09d3[_0x4cc9('0x17')]?_0x4b09d3[_0x4cc9('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x4cc9('0xc')](function(_0x40d7f0){logger[_0x4cc9('0x14')](_0x4cc9('0x18'),_0x4b09d3);logger[_0x4cc9('0x19')](_0x4cc9('0x18'),_0x4b09d3,JSON[_0x4cc9('0x10')](_0x40d7f0));_0x38bbd4(_0x40d7f0);})[_0x4cc9('0x1a')](function(_0x14f8c0){logger['error']('CreateCmHopperHistory',_0x14f8c0[_0x4cc9('0x13')],_0x4b09d3);_0x29a898(_0x59ccfb['error'](0x1f4,_0x14f8c0[_0x4cc9('0x13')]));});});};exports[_0x4cc9('0x1b')]=function(_0xf4d853){var _0x14e729=this;return new Promise(function(_0x2858b3,_0x3dabfe){return db[_0x4cc9('0x16')][_0x4cc9('0x1c')]({'raw':_0xf4d853[_0x4cc9('0x17')]?_0xf4d853[_0x4cc9('0x17')][_0x4cc9('0x1d')]===undefined?!![]:![]:!![],'where':_0xf4d853[_0x4cc9('0x17')]?_0xf4d853[_0x4cc9('0x17')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')][_0x4cc9('0x20')]('id')),_0x4cc9('0x21')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x23')))),_0x4cc9('0x24')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db['sequelize'][_0x4cc9('0x22')](_0x4cc9('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')]['literal'](_0x4cc9('0x26')))),_0x4cc9('0x27')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x28'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x28'),db[_0x4cc9('0x1f')]['fn']('IF',db['sequelize'][_0x4cc9('0x22')](_0x4cc9('0x2a')))),_0x4cc9('0x2b')]]})[_0x4cc9('0xc')](function(_0x31d595){logger[_0x4cc9('0x14')]('AvgHandleTime',_0xf4d853);logger[_0x4cc9('0x19')](_0x4cc9('0x1b'),_0xf4d853,JSON[_0x4cc9('0x10')](_0x31d595));_0x2858b3(_0x31d595);})['catch'](function(_0x69d377){logger[_0x4cc9('0x11')](_0x4cc9('0x1b'),_0x69d377[_0x4cc9('0x13')],_0xf4d853);_0x3dabfe(_0x14e729[_0x4cc9('0x11')](0x1f4,_0x69d377[_0x4cc9('0x13')]));});});};exports[_0x4cc9('0x2c')]=function(_0x4d5dcb){var _0x56ed1b=this;return new Promise(function(_0x246bf1,_0x30d6ca){return db[_0x4cc9('0x16')]['findAll']({'raw':_0x4d5dcb[_0x4cc9('0x17')]?_0x4d5dcb['options'][_0x4cc9('0x1d')]===undefined?!![]:![]:!![],'where':_0x4d5dcb[_0x4cc9('0x17')]?_0x4d5dcb[_0x4cc9('0x17')][_0x4cc9('0x2d')]||null:null,'attributes':[[_0x4cc9('0x2e'),_0x4cc9('0x2f')],[db[_0x4cc9('0x1f')]['fn']('COUNT',db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db['sequelize']['fn']('IF',db[_0x4cc9('0x1f')]['literal'](_0x4cc9('0x30')))),_0x4cc9('0x31')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x23')))),_0x4cc9('0x32')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x33')))),_0x4cc9('0x34')],[db['sequelize']['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x35')))),_0x4cc9('0x36')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x4cc9('0x37')))),_0x4cc9('0x38')],[db[_0x4cc9('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x39')))),_0x4cc9('0x3a')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')]['literal'](_0x4cc9('0x3b')))),'outboundUnknownCallsDay'],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db['sequelize']['fn']('IF',db[_0x4cc9('0x1f')]['literal'](_0x4cc9('0x3c')))),_0x4cc9('0x3d')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x4cc9('0x3e')],[db[_0x4cc9('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x3f')))),_0x4cc9('0x40')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')][_0x4cc9('0x22')](_0x4cc9('0x41')))),_0x4cc9('0x42')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')]['literal'](_0x4cc9('0x43')))),_0x4cc9('0x40')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db[_0x4cc9('0x1f')]['fn']('IF',db[_0x4cc9('0x1f')]['literal'](_0x4cc9('0x44')))),'outboundReCallsDay']],'group':[_0x4cc9('0x2e')]})[_0x4cc9('0xc')](function(_0x2cf8c4){logger['info']('GetVoiceQueueHopperHistory',_0x4d5dcb);logger['debug']('GetVoiceQueueHopperHistory',_0x4d5dcb,JSON[_0x4cc9('0x10')](_0x2cf8c4));_0x246bf1(_0x2cf8c4);})['catch'](function(_0x48cb97){logger['error'](_0x4cc9('0x2c'),_0x48cb97[_0x4cc9('0x13')],_0x4d5dcb);_0x30d6ca(_0x56ed1b['error'](0x1f4,_0x48cb97[_0x4cc9('0x13')]));});});};exports[_0x4cc9('0x45')]=function(_0x44ace5){var _0x300e8e=this;return new Promise(function(_0xe301b9,_0x5d774c){return db['CmHopperHistory']['findAll']({'raw':_0x44ace5['options']?_0x44ace5[_0x4cc9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x44ace5['options']?_0x44ace5[_0x4cc9('0x17')][_0x4cc9('0x2d')]||null:null,'attributes':[[_0x4cc9('0x2e'),_0x4cc9('0x2f')],[db[_0x4cc9('0x1f')]['fn']('COUNT',db[_0x4cc9('0x1f')][_0x4cc9('0x20')]('id')),_0x4cc9('0x46')],[db[_0x4cc9('0x1f')]['fn'](_0x4cc9('0x1e'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x4cc9('0x47')]],'group':[_0x4cc9('0x2e')]})[_0x4cc9('0xc')](function(_0x26b4cf){logger[_0x4cc9('0x14')]('GetCampaignHopperHistory',_0x44ace5);logger['debug']('GetCampaignHopperHistory',_0x44ace5,JSON[_0x4cc9('0x10')](_0x26b4cf));_0xe301b9(_0x26b4cf);})[_0x4cc9('0x1a')](function(_0x11fd2b){logger[_0x4cc9('0x11')]('GetCampaignHopperHistory',_0x11fd2b[_0x4cc9('0x13')],_0x44ace5);_0x5d774c(_0x300e8e[_0x4cc9('0x11')](0x1f4,_0x11fd2b['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 335395e..097eb25 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 _0xf998=['get','isAuthenticated','/describe','show','post','create','put','/:id','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0xf998,0x17f));var _0x8f99=function(_0x547160,_0x537a78){_0x547160=_0x547160-0x0;var _0x3f7b71=_0xf998[_0x547160];return _0x3f7b71;};'use strict';var multer=require('multer');var util=require(_0x8f99('0x0'));var path=require(_0x8f99('0x1'));var timeout=require(_0x8f99('0x2'));var express=require('express');var router=express[_0x8f99('0x3')]();var fs_extra=require(_0x8f99('0x4'));var auth=require(_0x8f99('0x5'));var interaction=require(_0x8f99('0x6'));var config=require(_0x8f99('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x8f99('0x8')]('/',auth[_0x8f99('0x9')](),controller['index']);router[_0x8f99('0x8')](_0x8f99('0xa'),auth[_0x8f99('0x9')](),controller['describe']);router[_0x8f99('0x8')]('/:id',auth[_0x8f99('0x9')](),controller[_0x8f99('0xb')]);router[_0x8f99('0xc')]('/',auth[_0x8f99('0x9')](),controller[_0x8f99('0xd')]);router[_0x8f99('0xe')](_0x8f99('0xf'),auth[_0x8f99('0x9')](),controller['update']);module[_0x8f99('0x10')]=router; \ No newline at end of file +var _0x01e6=['/:id','post','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/describe','describe'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x01e6,0x103));var _0x601e=function(_0x372a74,_0x5df93c){_0x372a74=_0x372a74-0x0;var _0x533013=_0x01e6[_0x372a74];return _0x533013;};'use strict';var multer=require(_0x601e('0x0'));var util=require(_0x601e('0x1'));var path=require(_0x601e('0x2'));var timeout=require(_0x601e('0x3'));var express=require(_0x601e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x601e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0x601e('0x6')]('/',auth[_0x601e('0x7')](),controller[_0x601e('0x8')]);router[_0x601e('0x6')](_0x601e('0x9'),auth[_0x601e('0x7')](),controller[_0x601e('0xa')]);router[_0x601e('0x6')](_0x601e('0xb'),auth[_0x601e('0x7')](),controller['show']);router[_0x601e('0xc')]('/',auth[_0x601e('0x7')](),controller['create']);router['put'](_0x601e('0xb'),auth[_0x601e('0x7')](),controller[_0x601e('0xd')]);module[_0x601e('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index dbb7c48..8517f1e 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 _0x0faf=['sequelize','STRING','name'];(function(_0x2d7972,_0x27e99c){var _0x4b054d=function(_0x43bcb){while(--_0x43bcb){_0x2d7972['push'](_0x2d7972['shift']());}};_0x4b054d(++_0x27e99c);}(_0x0faf,0x132));var _0xf0fa=function(_0x57e18a,_0x199383){_0x57e18a=_0x57e18a-0x0;var _0x1181c7=_0x0faf[_0x57e18a];return _0x1181c7;};'use strict';var Sequelize=require(_0xf0fa('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0fa('0x1')],'unique':_0xf0fa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf0fa('0x1')]},'dialPrefix':{'type':Sequelize[_0xf0fa('0x1')]}}; \ No newline at end of file +var _0x0b78=['STRING','sequelize','exports','name'];(function(_0x1b2538,_0x2bbe47){var _0x15acde=function(_0xf1fd91){while(--_0xf1fd91){_0x1b2538['push'](_0x1b2538['shift']());}};_0x15acde(++_0x2bbe47);}(_0x0b78,0x1ad));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x80b7('0x0'));module[_0x80b7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x80b7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x80b7('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 492afc7..ea5704a 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 _0xc781=['reject','save','then','destroy','get','Lists','error','stack','name','status','index','map','CmList','fieldName','type','key','model','keys','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','pick','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','raw','getContactsCsv','cf_%d','isEmpty','now','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','findOne','sequelize','transaction','addCustomFields','TEXT','Sequelize','number','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc781,0x185));var _0x1c78=function(_0x1ecbef,_0x26b929){_0x1ecbef=_0x1ecbef-0x0;var _0x5089c4=_0xc781[_0x1ecbef];return _0x5089c4;};'use strict';var emlformat=require(_0x1c78('0x0'));var rimraf=require(_0x1c78('0x1'));var zipdir=require(_0x1c78('0x2'));var jsonpatch=require(_0x1c78('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1c78('0x4'));var Mustache=require(_0x1c78('0x5'));var util=require(_0x1c78('0x6'));var path=require(_0x1c78('0x7'));var sox=require('sox');var csv=require(_0x1c78('0x8'));var ejs=require(_0x1c78('0x9'));var fs=require('fs');var fs_extra=require(_0x1c78('0xa'));var _=require(_0x1c78('0xb'));var squel=require(_0x1c78('0xc'));var crypto=require(_0x1c78('0xd'));var jsforce=require(_0x1c78('0xe'));var deskjs=require(_0x1c78('0xf'));var toCsv=require(_0x1c78('0x8'));var querystring=require('querystring');var Papa=require(_0x1c78('0x10'));var Redis=require(_0x1c78('0x11'));var authService=require(_0x1c78('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1c78('0x13'));var hardwareService=require(_0x1c78('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1c78('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c78('0x16'))['db'];config[_0x1c78('0x17')]=_[_0x1c78('0x18')](config[_0x1c78('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c78('0x19'))(new Redis(config['redis']));require(_0x1c78('0x1a'))[_0x1c78('0x1b')](socket);function respondWithStatusCode(_0xcd67ef,_0x2ed9ad){_0x2ed9ad=_0x2ed9ad||0xcc;return function(_0x7d7d0b){if(_0x7d7d0b){return _0xcd67ef[_0x1c78('0x1c')](_0x2ed9ad);}return _0xcd67ef['status'](_0x2ed9ad)['end']();};}function respondWithResult(_0x112d3b,_0x1b58fc){_0x1b58fc=_0x1b58fc||0xc8;return function(_0x3c64cf){if(_0x3c64cf){return _0x112d3b['status'](_0x1b58fc)[_0x1c78('0x1d')](_0x3c64cf);}};}function respondWithFilteredResult(_0x54319e,_0x5e814f){return function(_0x1fb033){if(_0x1fb033){var _0x44a698=typeof _0x5e814f[_0x1c78('0x1e')]===_0x1c78('0x1f')&&typeof _0x5e814f[_0x1c78('0x20')]===_0x1c78('0x1f');var _0x4fa544=_0x1fb033[_0x1c78('0x21')];var _0x3eef7f=_0x44a698?0x0:_0x5e814f[_0x1c78('0x1e')];var _0x220871=_0x44a698?_0x1fb033[_0x1c78('0x21')]:_0x5e814f['offset']+_0x5e814f[_0x1c78('0x20')];var _0x122342;if(_0x220871>=_0x4fa544){_0x220871=_0x4fa544;_0x122342=0xc8;}else{_0x122342=0xce;}_0x54319e['status'](_0x122342);return _0x54319e[_0x1c78('0x22')](_0x1c78('0x23'),_0x3eef7f+'-'+_0x220871+'/'+_0x4fa544)[_0x1c78('0x1d')](_0x1fb033);}return null;};}function patchUpdates(_0x4dac61){return function(_0x42fab2){try{jsonpatch[_0x1c78('0x24')](_0x42fab2,_0x4dac61,!![]);}catch(_0x4ed5c3){return BPromise[_0x1c78('0x25')](_0x4ed5c3);}return _0x42fab2[_0x1c78('0x26')]();};}function saveUpdates(_0x5befa7,_0x353565){return function(_0x374497){if(_0x374497){return _0x374497['update'](_0x5befa7)[_0x1c78('0x27')](function(_0x1ad3a4){return _0x1ad3a4;});}return null;};}function removeEntity(_0x117cbf,_0x2da372){return function(_0x3c0b97){if(_0x3c0b97){return _0x3c0b97[_0x1c78('0x28')]()['then'](function(){var _0x167327=_0x3c0b97[_0x1c78('0x29')]({'plain':!![]});var _0x24c5bf=_0x1c78('0x2a');return db['UserProfileResource'][_0x1c78('0x28')]({'where':{'type':_0x24c5bf,'resourceId':_0x167327['id']}})['then'](function(){return _0x3c0b97;});})[_0x1c78('0x27')](function(){_0x117cbf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3acfd9,_0x2f2681){return function(_0x329919){if(!_0x329919){_0x3acfd9['sendStatus'](0x194);}return _0x329919;};}function handleError(_0x1fd2d8,_0x373aaf){_0x373aaf=_0x373aaf||0x1f4;return function(_0x58eced){logger[_0x1c78('0x2b')](_0x58eced[_0x1c78('0x2c')]);if(_0x58eced[_0x1c78('0x2d')]){delete _0x58eced[_0x1c78('0x2d')];}_0x1fd2d8[_0x1c78('0x2e')](_0x373aaf)['send'](_0x58eced);};}exports[_0x1c78('0x2f')]=function(_0x5a0c3d,_0x4eb0c9){var _0x494d41={},_0x4a8238={},_0x2e8aa5={'count':0x0,'rows':[]};var _0x4c749e=_[_0x1c78('0x30')](db[_0x1c78('0x31')]['rawAttributes'],function(_0x45ba29){return{'name':_0x45ba29[_0x1c78('0x32')],'type':_0x45ba29[_0x1c78('0x33')][_0x1c78('0x34')]};});_0x4a8238[_0x1c78('0x35')]=_[_0x1c78('0x30')](_0x4c749e,_0x1c78('0x2d'));_0x4a8238['query']=_[_0x1c78('0x36')](_0x5a0c3d[_0x1c78('0x37')]);_0x4a8238[_0x1c78('0x38')]=_['intersection'](_0x4a8238[_0x1c78('0x35')],_0x4a8238[_0x1c78('0x37')]);_0x494d41[_0x1c78('0x39')]=_[_0x1c78('0x3a')](_0x4a8238[_0x1c78('0x35')],qs['fields'](_0x5a0c3d['query']['fields']));_0x494d41[_0x1c78('0x39')]=_0x494d41['attributes']['length']?_0x494d41[_0x1c78('0x39')]:_0x4a8238[_0x1c78('0x35')];if(!_0x5a0c3d[_0x1c78('0x37')][_0x1c78('0x3b')](_0x1c78('0x3c'))){_0x494d41[_0x1c78('0x20')]=qs[_0x1c78('0x20')](_0x5a0c3d[_0x1c78('0x37')][_0x1c78('0x20')]);_0x494d41['offset']=qs['offset'](_0x5a0c3d['query']['offset']);}_0x494d41[_0x1c78('0x3d')]=qs[_0x1c78('0x3e')](_0x5a0c3d['query']['sort']);_0x494d41[_0x1c78('0x3f')]=qs[_0x1c78('0x38')](_['pick'](_0x5a0c3d[_0x1c78('0x37')],_0x4a8238['filters']),_0x4c749e);if(_0x5a0c3d[_0x1c78('0x37')][_0x1c78('0x40')]){_0x494d41['where']=_['merge'](_0x494d41[_0x1c78('0x3f')],{'$or':_[_0x1c78('0x30')](_0x4c749e,function(_0xa4d1a0){if(_0xa4d1a0[_0x1c78('0x33')]!==_0x1c78('0x41')){var _0x5debc3={};_0x5debc3[_0xa4d1a0[_0x1c78('0x2d')]]={'$like':'%'+_0x5a0c3d['query'][_0x1c78('0x40')]+'%'};return _0x5debc3;}})});}_0x494d41=_[_0x1c78('0x42')]({},_0x494d41,_0x5a0c3d[_0x1c78('0x43')]);var _0x4b4c57={'where':_0x494d41[_0x1c78('0x3f')]};return db[_0x1c78('0x31')][_0x1c78('0x21')](_0x4b4c57)[_0x1c78('0x27')](function(_0x51ca28){_0x2e8aa5[_0x1c78('0x21')]=_0x51ca28;if(_0x5a0c3d[_0x1c78('0x37')][_0x1c78('0x44')]){_0x494d41[_0x1c78('0x45')]=[{'all':!![]}];}return db[_0x1c78('0x31')]['findAll'](_0x494d41);})[_0x1c78('0x27')](function(_0x338209){_0x2e8aa5[_0x1c78('0x46')]=_0x338209;return _0x2e8aa5;})['then'](respondWithFilteredResult(_0x4eb0c9,_0x494d41))[_0x1c78('0x47')](handleError(_0x4eb0c9,null));};exports[_0x1c78('0x48')]=function(_0x25a2b6,_0x15a3c1){var _0x2da51e={'raw':![],'where':{'id':_0x25a2b6[_0x1c78('0x49')]['id']}},_0xb5a57f={};_0xb5a57f[_0x1c78('0x35')]=_['keys'](db[_0x1c78('0x31')][_0x1c78('0x4a')]);_0xb5a57f[_0x1c78('0x37')]=_[_0x1c78('0x36')](_0x25a2b6[_0x1c78('0x37')]);_0xb5a57f['filters']=_[_0x1c78('0x3a')](_0xb5a57f[_0x1c78('0x35')],_0xb5a57f[_0x1c78('0x37')]);_0x2da51e[_0x1c78('0x39')]=_[_0x1c78('0x3a')](_0xb5a57f[_0x1c78('0x35')],qs[_0x1c78('0x4b')](_0x25a2b6[_0x1c78('0x37')][_0x1c78('0x4b')]));_0x2da51e[_0x1c78('0x39')]=_0x2da51e[_0x1c78('0x39')][_0x1c78('0x4c')]?_0x2da51e[_0x1c78('0x39')]:_0xb5a57f[_0x1c78('0x35')];if(_0x25a2b6[_0x1c78('0x37')][_0x1c78('0x44')]){_0x2da51e['include']=[{'all':!![]}];}_0x2da51e=_[_0x1c78('0x42')]({},_0x2da51e,_0x25a2b6[_0x1c78('0x43')]);return db['CmList'][_0x1c78('0x4d')](_0x2da51e)[_0x1c78('0x27')](handleEntityNotFound(_0x15a3c1,null))[_0x1c78('0x27')](respondWithResult(_0x15a3c1,null))[_0x1c78('0x47')](handleError(_0x15a3c1,null));};exports['create']=function(_0x4d89c6,_0x32dc1e){return db[_0x1c78('0x31')][_0x1c78('0x4e')](_0x4d89c6[_0x1c78('0x4f')],{})[_0x1c78('0x27')](function(_0x4ea087){var _0x5d9605=_0x4d89c6[_0x1c78('0x50')][_0x1c78('0x29')]({'plain':!![]});if(!_0x5d9605)throw new Error(_0x1c78('0x51'));if(_0x5d9605[_0x1c78('0x52')]===_0x1c78('0x50')){var _0x4a48d9=_0x4ea087[_0x1c78('0x29')]({'plain':!![]});var _0xf5fdbd=_0x1c78('0x2a');return db['UserProfileSection'][_0x1c78('0x4d')]({'where':{'name':_0xf5fdbd,'userProfileId':_0x5d9605[_0x1c78('0x53')]},'raw':!![]})[_0x1c78('0x27')](function(_0x3d349e){if(_0x3d349e&&_0x3d349e[_0x1c78('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a48d9[_0x1c78('0x2d')],'resourceId':_0x4a48d9['id'],'type':_0x3d349e[_0x1c78('0x2d')],'sectionId':_0x3d349e['id']},{})[_0x1c78('0x27')](function(){return _0x4ea087;});}else{return _0x4ea087;}})[_0x1c78('0x47')](function(_0x3dbe24){logger[_0x1c78('0x2b')](_0x1c78('0x55'),_0x3dbe24);throw _0x3dbe24;});}return _0x4ea087;})['then'](respondWithResult(_0x32dc1e,0xc9))['catch'](handleError(_0x32dc1e,null));};exports[_0x1c78('0x56')]=function(_0x3d56e3,_0x1d73ed){if(_0x3d56e3['body']['id']){delete _0x3d56e3[_0x1c78('0x4f')]['id'];}return db[_0x1c78('0x31')][_0x1c78('0x4d')]({'where':{'id':_0x3d56e3[_0x1c78('0x49')]['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x1d73ed,null))[_0x1c78('0x27')](saveUpdates(_0x3d56e3[_0x1c78('0x4f')],null))[_0x1c78('0x27')](respondWithResult(_0x1d73ed,null))[_0x1c78('0x47')](handleError(_0x1d73ed,null));};exports['destroy']=function(_0x53c067,_0x4f52c8){return db['CmList'][_0x1c78('0x4d')]({'where':{'id':_0x53c067[_0x1c78('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f52c8,null))[_0x1c78('0x27')](removeEntity(_0x4f52c8,null))[_0x1c78('0x47')](handleError(_0x4f52c8,null));};exports[_0x1c78('0x57')]=function(_0x1ead0e,_0x3a708b){return db[_0x1c78('0x31')][_0x1c78('0x57')]()[_0x1c78('0x27')](respondWithResult(_0x3a708b,null))['catch'](handleError(_0x3a708b,null));};exports[_0x1c78('0x58')]=function(_0x597443,_0x4464de,_0x281ee6){if(_0x597443[_0x1c78('0x4f')]['id']){delete _0x597443[_0x1c78('0x4f')]['id'];}return db[_0x1c78('0x31')][_0x1c78('0x4d')]({'where':{'id':_0x597443['params']['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x4464de,null))[_0x1c78('0x27')](function(_0x368d19){if(_0x368d19){_0x597443['body'][_0x1c78('0x59')]=_0x368d19['id'];return db[_0x1c78('0x5a')][_0x1c78('0x4e')](_0x597443[_0x1c78('0x4f')]);}})[_0x1c78('0x27')](respondWithResult(_0x4464de,null))[_0x1c78('0x47')](handleError(_0x4464de,null));};exports['getDispositions']=function(_0x3b8865,_0x10888b,_0x13b972){var _0x3ae883={'raw':![],'where':{}};var _0x295585={};var _0x1df08c={'count':0x0,'rows':[]};return db[_0x1c78('0x31')]['findOne']({'where':{'id':_0x3b8865[_0x1c78('0x49')]['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x10888b,null))[_0x1c78('0x27')](function(_0x9f71b7){if(_0x9f71b7){_0x295585[_0x1c78('0x35')]=_[_0x1c78('0x36')](db[_0x1c78('0x5a')][_0x1c78('0x4a')]);_0x295585['query']=_[_0x1c78('0x36')](_0x3b8865[_0x1c78('0x37')]);_0x295585[_0x1c78('0x38')]=_[_0x1c78('0x3a')](_0x295585[_0x1c78('0x35')],_0x295585[_0x1c78('0x37')]);_0x3ae883[_0x1c78('0x39')]=_[_0x1c78('0x3a')](_0x295585[_0x1c78('0x35')],qs[_0x1c78('0x4b')](_0x3b8865[_0x1c78('0x37')][_0x1c78('0x4b')]));_0x3ae883[_0x1c78('0x39')]=_0x3ae883[_0x1c78('0x39')][_0x1c78('0x4c')]?_0x3ae883[_0x1c78('0x39')]:_0x295585[_0x1c78('0x35')];if(!_0x3b8865[_0x1c78('0x37')][_0x1c78('0x3b')](_0x1c78('0x3c'))){_0x3ae883[_0x1c78('0x20')]=qs[_0x1c78('0x20')](_0x3b8865[_0x1c78('0x37')][_0x1c78('0x20')]);_0x3ae883[_0x1c78('0x1e')]=qs[_0x1c78('0x1e')](_0x3b8865[_0x1c78('0x37')][_0x1c78('0x1e')]);}_0x3ae883[_0x1c78('0x3d')]=qs[_0x1c78('0x3e')](_0x3b8865[_0x1c78('0x37')]['sort']);_0x3ae883['where']=qs[_0x1c78('0x38')](_[_0x1c78('0x5b')](_0x3b8865['query'],_0x295585[_0x1c78('0x38')]));_0x3ae883[_0x1c78('0x3f')][_0x1c78('0x59')]=_0x9f71b7['id'];if(_0x3b8865[_0x1c78('0x37')][_0x1c78('0x40')]){_0x3ae883['where']=_[_0x1c78('0x42')](_0x3ae883['where'],{'$or':_[_0x1c78('0x30')](_0x3ae883[_0x1c78('0x39')],function(_0x595aa6){var _0x39b2d5={};_0x39b2d5[_0x595aa6]={'$like':'%'+_0x3b8865[_0x1c78('0x37')][_0x1c78('0x40')]+'%'};return _0x39b2d5;})});}_0x3ae883=_[_0x1c78('0x42')]({},_0x3ae883,_0x3b8865[_0x1c78('0x43')]);return db[_0x1c78('0x5a')][_0x1c78('0x21')]({'where':_0x3ae883[_0x1c78('0x3f')]})[_0x1c78('0x27')](function(_0x45d43c){_0x1df08c[_0x1c78('0x21')]=_0x45d43c;if(_0x3b8865[_0x1c78('0x37')][_0x1c78('0x44')]){_0x3ae883['include']=[{'all':!![]}];}return db['Disposition'][_0x1c78('0x5c')](_0x3ae883);})['then'](function(_0x1147de){_0x1df08c['rows']=_0x1147de;return _0x1df08c;});}})[_0x1c78('0x27')](respondWithFilteredResult(_0x10888b,_0x3ae883))[_0x1c78('0x47')](handleError(_0x10888b,null));};exports['removeDispositions']=function(_0x11ce63,_0x287fb7,_0x2ab049){return db[_0x1c78('0x31')][_0x1c78('0x4d')]({'where':{'id':_0x11ce63[_0x1c78('0x49')]['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x287fb7,null))['then'](function(_0x2dd2eb){if(_0x2dd2eb){return _0x2dd2eb[_0x1c78('0x5d')](_0x11ce63[_0x1c78('0x37')][_0x1c78('0x5e')]);}})[_0x1c78('0x27')](respondWithStatusCode(_0x287fb7,null))[_0x1c78('0x47')](handleError(_0x287fb7,null));};exports[_0x1c78('0x5f')]=function(_0xe66d4,_0x403fc7,_0x39c9cb){return db[_0x1c78('0x31')][_0x1c78('0x4d')]({'where':{'id':_0xe66d4[_0x1c78('0x49')]['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x403fc7,null))['then'](function(_0x33b21e){if(_0x33b21e){var _0x395c28=[];var _0x1f2ff6={'success':[],'errors':[]};return db[_0x1c78('0x60')][_0x1c78('0x57')]()[_0x1c78('0x27')](function(_0x2a7a71){if(_0xe66d4[_0x1c78('0x4f')][_0x1c78('0x61')]&&_[_0x1c78('0x62')](_0xe66d4[_0x1c78('0x4f')]['tags'])){if(_0xe66d4[_0x1c78('0x4f')]['tags'][_0x1c78('0x4c')]){_0xe66d4[_0x1c78('0x4f')][_0x1c78('0x61')]=_0xe66d4[_0x1c78('0x4f')][_0x1c78('0x61')][_0x1c78('0x63')](';')+';';}else{_0xe66d4['body'][_0x1c78('0x61')]=null;}}else{_0xe66d4[_0x1c78('0x4f')][_0x1c78('0x61')]=null;}if(_0xe66d4[_0x1c78('0x4f')]&&_['isArray'](_0xe66d4[_0x1c78('0x4f')])){for(var _0x315bf8=0x0;_0x315bf8<_0xe66d4[_0x1c78('0x4f')][_0x1c78('0x4c')];_0x315bf8+=0x1){_0xe66d4['body'][_0x315bf8][_0x1c78('0x59')]=_0xe66d4[_0x1c78('0x49')]['id'];_0x395c28['push'](_0xe66d4[_0x1c78('0x4f')][_0x315bf8]);}return BPromise[_0x1c78('0x64')](_0x395c28,function(_0x1215b9){return db[_0x1c78('0x60')][_0x1c78('0x4e')](_[_0x1c78('0x65')](_0x1215b9,[_0x1c78('0x5e'),'id'])||{},{'fields':_[_0x1c78('0x36')](_0x2a7a71),'raw':!![]})['then'](function(_0x5eeb0f){_0x1f2ff6[_0x1c78('0x66')][_0x1c78('0x67')](_0x5eeb0f[_0x1c78('0x68')]);})[_0x1c78('0x47')](function(_0x1f120a){_0x1f2ff6['errors'][_0x1c78('0x67')]({'data':_0x1215b9,'error':_0x1f120a[_0x1c78('0x69')]});});})[_0x1c78('0x27')](function(_0x4b3f28){return _0x1f2ff6;})[_0x1c78('0x47')](function(_0x51892d){return _0x51892d;});}else{_0x403fc7[_0x1c78('0x2e')](0x190)[_0x1c78('0x1d')]({'message':_0x1c78('0x6a')});}});}})[_0x1c78('0x27')](respondWithResult(_0x403fc7,null))[_0x1c78('0x47')](handleError(_0x403fc7,null));};exports[_0x1c78('0x6b')]=function(_0x28d9e2,_0x457ed4,_0x163160){var _0x135455;return db['CmList']['find']({'where':{'id':_0x28d9e2[_0x1c78('0x49')]['id']},'include':[{'model':db[_0x1c78('0x6c')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x457ed4,null))['then'](function(_0x5db277){if(_0x5db277){_0x135455=_0x5db277;return db[_0x1c78('0x60')][_0x1c78('0x4a')];}})[_0x1c78('0x27')](function(_0x5a54b1){if(_0x5a54b1){var _0x594101={};var _0x3e7a34={};_0x3e7a34[_0x1c78('0x35')]=_[_0x1c78('0x6d')](_[_0x1c78('0x36')](_0x5a54b1),_[_0x1c78('0x30')](_0x135455[_0x1c78('0x6e')],function(_0x441e85){return util[_0x1c78('0x6f')]('cf_%d',_0x441e85['id']);}));_0x3e7a34['query']=_[_0x1c78('0x36')](_0x28d9e2[_0x1c78('0x37')]);_0x3e7a34[_0x1c78('0x38')]=_[_0x1c78('0x3a')](_0x3e7a34['model'],_0x3e7a34[_0x1c78('0x37')]);_0x594101[_0x1c78('0x39')]=_[_0x1c78('0x3a')](_0x3e7a34['model'],qs[_0x1c78('0x4b')](_0x28d9e2[_0x1c78('0x37')]['fields']));_0x594101[_0x1c78('0x39')]=_0x594101['attributes'][_0x1c78('0x4c')]?_0x594101[_0x1c78('0x39')]:_0x3e7a34['model'];if(!_0x28d9e2[_0x1c78('0x37')][_0x1c78('0x3b')](_0x1c78('0x3c'))){_0x594101[_0x1c78('0x20')]=qs['limit'](_0x28d9e2[_0x1c78('0x37')][_0x1c78('0x20')]);_0x594101[_0x1c78('0x1e')]=qs[_0x1c78('0x1e')](_0x28d9e2[_0x1c78('0x37')][_0x1c78('0x1e')]);}_0x594101[_0x1c78('0x3d')]=qs[_0x1c78('0x3e')](_0x28d9e2[_0x1c78('0x37')]['sort']);_0x594101['where']=qs[_0x1c78('0x38')](_['pick'](_0x28d9e2[_0x1c78('0x37')],_0x3e7a34[_0x1c78('0x38')]));_0x594101[_0x1c78('0x70')]=!![];if(_0x28d9e2[_0x1c78('0x37')][_0x1c78('0x40')]){_0x594101[_0x1c78('0x3f')]=_['merge'](_0x594101[_0x1c78('0x3f')],{'$or':_[_0x1c78('0x30')](_0x594101[_0x1c78('0x39')],function(_0xba8bac){var _0x1a95b8={};_0x1a95b8[_0xba8bac]={'$like':'%'+_0x28d9e2[_0x1c78('0x37')]['filter']+'%'};return _0x1a95b8;})});}_0x594101=_[_0x1c78('0x42')]({},_0x594101,_0x28d9e2[_0x1c78('0x43')]);return _0x135455[_0x1c78('0x6b')](_0x594101);}})['then'](respondWithResult(_0x457ed4,null))[_0x1c78('0x47')](handleError(_0x457ed4,null));};exports[_0x1c78('0x71')]=function(_0x3e8916,_0x8cd017,_0x44106e){var _0x1f538d;return db[_0x1c78('0x31')][_0x1c78('0x4d')]({'where':{'id':_0x3e8916[_0x1c78('0x49')]['id']},'include':[{'model':db[_0x1c78('0x6c')],'as':_0x1c78('0x6e')}]})[_0x1c78('0x27')](handleEntityNotFound(_0x8cd017,null))[_0x1c78('0x27')](function(_0x37bfdd){if(_0x37bfdd){_0x1f538d=_0x37bfdd;return db[_0x1c78('0x60')][_0x1c78('0x4a')];}})['then'](function(_0x4e2d80){if(_0x4e2d80){var _0x3b3c51={};var _0x29532c={};_0x29532c[_0x1c78('0x35')]=_['concat'](_[_0x1c78('0x36')](_0x4e2d80),_[_0x1c78('0x30')](_0x1f538d['CustomFields'],function(_0x416fa2){return util[_0x1c78('0x6f')](_0x1c78('0x72'),_0x416fa2['id']);}));_0x29532c[_0x1c78('0x37')]=_[_0x1c78('0x36')](_0x3e8916[_0x1c78('0x37')]);_0x29532c['filters']=_[_0x1c78('0x3a')](_0x29532c[_0x1c78('0x35')],_0x29532c['query']);_0x3b3c51[_0x1c78('0x39')]=_[_0x1c78('0x3a')](_0x29532c[_0x1c78('0x35')],qs[_0x1c78('0x4b')](_0x3e8916['query'][_0x1c78('0x4b')]));_0x3b3c51[_0x1c78('0x39')]=_0x3b3c51[_0x1c78('0x39')]['length']?_0x3b3c51['attributes']:_0x29532c[_0x1c78('0x35')];if(!_0x3e8916[_0x1c78('0x37')][_0x1c78('0x3b')](_0x1c78('0x3c'))){_0x3b3c51['limit']=qs['limit'](_0x3e8916[_0x1c78('0x37')][_0x1c78('0x20')]);_0x3b3c51['offset']=qs[_0x1c78('0x1e')](_0x3e8916[_0x1c78('0x37')]['offset']);}_0x3b3c51[_0x1c78('0x3d')]=qs[_0x1c78('0x3e')](_0x3e8916['query'][_0x1c78('0x3e')]);_0x3b3c51[_0x1c78('0x3f')]=qs['filters'](_[_0x1c78('0x5b')](_0x3e8916[_0x1c78('0x37')],_0x29532c['filters']));_0x3b3c51[_0x1c78('0x70')]=!![];if(_0x3e8916[_0x1c78('0x37')][_0x1c78('0x40')]){_0x3b3c51[_0x1c78('0x3f')]=_[_0x1c78('0x42')](_0x3b3c51[_0x1c78('0x3f')],{'$or':_[_0x1c78('0x30')](_0x3b3c51[_0x1c78('0x39')],function(_0x32288d){var _0x10549f={};_0x10549f[_0x32288d]={'$like':'%'+_0x3e8916[_0x1c78('0x37')]['filter']+'%'};return _0x10549f;})});}_0x3b3c51=_['merge']({},_0x3b3c51,_0x3e8916['options']);return _0x1f538d[_0x1c78('0x6b')](_0x3b3c51);}})[_0x1c78('0x27')](function(_0x28a409){if(!_[_0x1c78('0x73')](_0x28a409)){var _0x362e65=toCsv(_0x28a409);var _0x331bfa=Date[_0x1c78('0x74')]();fs['writeFileSync'](util[_0x1c78('0x6f')](_0x1c78('0x75'),_0x1f538d['id'],_0x331bfa),_0x362e65);_0x8cd017['setHeader']('Content-disposition',_0x1c78('0x76')+util[_0x1c78('0x6f')](_0x1c78('0x77'),_0x1f538d['id'],_0x331bfa));_0x8cd017['setHeader'](_0x1c78('0x78'),'text/csv');return _0x8cd017[_0x1c78('0x79')](util[_0x1c78('0x6f')](_0x1c78('0x75'),_0x1f538d['id'],_0x331bfa));}else{return _0x8cd017[_0x1c78('0x1c')](0xcc);}})[_0x1c78('0x47')](handleError(_0x8cd017,null));};exports['addCustomField']=function(_0x3c0082,_0x3685f2,_0x4d7da9){var _0x829dae;delete _0x3c0082['body']['id'];return db[_0x1c78('0x31')][_0x1c78('0x7a')]({'where':{'id':_0x3c0082[_0x1c78('0x49')]['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x3685f2,null))['then'](function(_0xdbff7){if(_0xdbff7){return db[_0x1c78('0x7b')][_0x1c78('0x7c')](function(_0x218b38){return db[_0x1c78('0x6c')][_0x1c78('0x4e')](_0x3c0082[_0x1c78('0x4f')],{'transaction':_0x218b38})['then'](function(_0x5b9863){_0x829dae=_0x5b9863;return _0xdbff7[_0x1c78('0x7d')](_0x5b9863,{'transaction':_0x218b38});})[_0x1c78('0x27')](function(){var _0x16d3f7={'type':db['Sequelize'][_0x1c78('0x7e')],'transaction':_0x218b38};switch(_0x3c0082[_0x1c78('0x4f')][_0x1c78('0x33')]){case'text':_0x16d3f7[_0x1c78('0x33')]=db[_0x1c78('0x7f')][_0x1c78('0x7e')];break;case _0x1c78('0x80'):_0x16d3f7[_0x1c78('0x33')]=db[_0x1c78('0x7f')]['INTEGER'];break;case'switch':_0x16d3f7[_0x1c78('0x33')]=db[_0x1c78('0x7f')][_0x1c78('0x81')];_0x16d3f7[_0x1c78('0x82')]=![];break;default:}return db[_0x1c78('0x7b')][_0x1c78('0x83')][_0x1c78('0x84')](_0x1c78('0x85'),util[_0x1c78('0x6f')]('cf_%s',_0x829dae['id']),_0x16d3f7);})[_0x1c78('0x27')](function(){return _0x829dae;});});}})[_0x1c78('0x27')](respondWithResult(_0x3685f2,null))[_0x1c78('0x47')](handleError(_0x3685f2,null));};exports['getCustomFields']=function(_0x38b784,_0x332da2,_0x514421){var _0x296663={};var _0x69b1a3={};var _0x19ed6c;var _0x3bfe9e;return db['CmList'][_0x1c78('0x7a')]({'where':{'id':_0x38b784[_0x1c78('0x49')]['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x332da2,null))[_0x1c78('0x27')](function(_0x19736a){if(_0x19736a){_0x19ed6c=_0x19736a;_0x69b1a3[_0x1c78('0x35')]=_[_0x1c78('0x36')](db['CmCustomField'][_0x1c78('0x4a')]);_0x69b1a3[_0x1c78('0x37')]=_[_0x1c78('0x36')](_0x38b784[_0x1c78('0x37')]);_0x69b1a3['filters']=_[_0x1c78('0x3a')](_0x69b1a3[_0x1c78('0x35')],_0x69b1a3[_0x1c78('0x37')]);_0x296663[_0x1c78('0x39')]=_[_0x1c78('0x3a')](_0x69b1a3[_0x1c78('0x35')],qs[_0x1c78('0x4b')](_0x38b784[_0x1c78('0x37')][_0x1c78('0x4b')]));_0x296663['attributes']=_0x296663[_0x1c78('0x39')][_0x1c78('0x4c')]?_0x296663['attributes']:_0x69b1a3['model'];_0x296663[_0x1c78('0x3d')]=qs['sort'](_0x38b784[_0x1c78('0x37')][_0x1c78('0x3e')]);_0x296663['where']=qs['filters'](_[_0x1c78('0x5b')](_0x38b784[_0x1c78('0x37')],_0x69b1a3[_0x1c78('0x38')]));_0x296663[_0x1c78('0x3f')]=_[_0x1c78('0x42')](_0x296663[_0x1c78('0x3f')],{'$or':[{'ListId':_0x19736a['id']},{'ListId':null}]});if(_0x38b784[_0x1c78('0x37')][_0x1c78('0x40')]){_0x296663[_0x1c78('0x3f')]=_[_0x1c78('0x42')](_0x296663[_0x1c78('0x3f')],{'$or':_['map'](_0x296663[_0x1c78('0x39')],function(_0x58ed8d){var _0x29def2={};_0x29def2[_0x58ed8d]={'$like':'%'+_0x38b784[_0x1c78('0x37')][_0x1c78('0x40')]+'%'};return _0x29def2;})});}_0x296663=_[_0x1c78('0x42')]({},_0x296663,_0x38b784[_0x1c78('0x43')]);return db[_0x1c78('0x6c')]['findAndCountAll'](_0x296663);}})[_0x1c78('0x27')](respondWithResult(_0x332da2,null))[_0x1c78('0x47')](handleError(_0x332da2,null));};exports['addAgents']=function(_0x40f284,_0x366ab8,_0x16d5d8){return db['CmList']['find']({'where':{'id':_0x40f284['params']['id']}})['then'](handleEntityNotFound(_0x366ab8,null))[_0x1c78('0x27')](function(_0x1604cf){if(_0x1604cf){return _0x1604cf[_0x1c78('0x86')](_0x40f284[_0x1c78('0x4f')][_0x1c78('0x5e')],_[_0x1c78('0x65')](_0x40f284[_0x1c78('0x4f')],[_0x1c78('0x5e'),'id'])||{})[_0x1c78('0x87')](function(_0x53c223){for(var _0x2dfb3a=0x0;_0x2dfb3a<_0x40f284['body']['ids'][_0x1c78('0x4c')];_0x2dfb3a+=0x1){socket['emit'](_0x1c78('0x88'),{'UserId':Number(_0x40f284['body'][_0x1c78('0x5e')][_0x2dfb3a]),'CmListId':Number(_0x40f284[_0x1c78('0x49')]['id'])});}return _0x53c223;});}})[_0x1c78('0x27')](respondWithResult(_0x366ab8,null))[_0x1c78('0x47')](handleError(_0x366ab8,null));};exports['removeAgents']=function(_0x35d893,_0x22132c,_0x267ab3){return db[_0x1c78('0x31')]['find']({'where':{'id':_0x35d893[_0x1c78('0x49')]['id']}})['then'](handleEntityNotFound(_0x22132c,null))[_0x1c78('0x27')](function(_0x59e51b){if(_0x59e51b){return _0x59e51b[_0x1c78('0x89')](_0x35d893['query'][_0x1c78('0x5e')])['then'](function(){if(_[_0x1c78('0x62')](_0x35d893['query'][_0x1c78('0x5e')])){for(var _0x5542c7=0x0;_0x5542c7<_0x35d893[_0x1c78('0x37')][_0x1c78('0x5e')]['length'];_0x5542c7+=0x1){socket[_0x1c78('0x8a')](_0x1c78('0x8b'),{'UserId':Number(_0x35d893[_0x1c78('0x37')][_0x1c78('0x5e')][_0x5542c7]),'CmListId':Number(_0x35d893[_0x1c78('0x49')]['id'])});}}else{socket[_0x1c78('0x8a')](_0x1c78('0x8b'),{'UserId':Number(_0x35d893[_0x1c78('0x37')][_0x1c78('0x5e')]),'CmListId':Number(_0x35d893[_0x1c78('0x49')]['id'])});}});}})[_0x1c78('0x27')](respondWithStatusCode(_0x22132c,null))[_0x1c78('0x47')](handleError(_0x22132c,null));};exports[_0x1c78('0x8c')]=function(_0x1170b0,_0x17cc15,_0x1beaae){var _0x586f9a={};var _0x958d0d={};var _0x1ada4c;var _0x8ea2a3;return db[_0x1c78('0x31')][_0x1c78('0x7a')]({'where':{'id':_0x1170b0[_0x1c78('0x49')]['id']}})[_0x1c78('0x27')](handleEntityNotFound(_0x17cc15,null))[_0x1c78('0x27')](function(_0x4991fa){if(_0x4991fa){_0x1ada4c=_0x4991fa;_0x958d0d[_0x1c78('0x35')]=_['keys'](db[_0x1c78('0x8d')][_0x1c78('0x4a')]);_0x958d0d[_0x1c78('0x37')]=_[_0x1c78('0x36')](_0x1170b0[_0x1c78('0x37')]);_0x958d0d['filters']=_[_0x1c78('0x3a')](_0x958d0d['model'],_0x958d0d[_0x1c78('0x37')]);_0x586f9a[_0x1c78('0x39')]=_[_0x1c78('0x3a')](_0x958d0d[_0x1c78('0x35')],qs[_0x1c78('0x4b')](_0x1170b0['query'][_0x1c78('0x4b')]));_0x586f9a[_0x1c78('0x39')]=_0x586f9a[_0x1c78('0x39')][_0x1c78('0x4c')]?_0x586f9a[_0x1c78('0x39')]:_0x958d0d[_0x1c78('0x35')];_0x586f9a[_0x1c78('0x3d')]=qs[_0x1c78('0x3e')](_0x1170b0[_0x1c78('0x37')][_0x1c78('0x3e')]);_0x586f9a[_0x1c78('0x3f')]=qs[_0x1c78('0x38')](_[_0x1c78('0x5b')](_0x1170b0['query'],_0x958d0d[_0x1c78('0x38')]));if(_0x1170b0[_0x1c78('0x37')][_0x1c78('0x40')]){_0x586f9a[_0x1c78('0x3f')]=_[_0x1c78('0x42')](_0x586f9a[_0x1c78('0x3f')],{'$or':_['map'](_0x586f9a[_0x1c78('0x39')],function(_0x101139){var _0x52ec5a={};_0x52ec5a[_0x101139]={'$like':'%'+_0x1170b0['query'][_0x1c78('0x40')]+'%'};return _0x52ec5a;})});}_0x586f9a=_[_0x1c78('0x42')]({},_0x586f9a,_0x1170b0['options']);return _0x1ada4c[_0x1c78('0x8c')](_0x586f9a);}})[_0x1c78('0x27')](function(_0x21f09f){if(_0x21f09f){_0x8ea2a3=_0x21f09f['length'];if(!_0x1170b0[_0x1c78('0x37')][_0x1c78('0x3b')]('nolimit')){_0x586f9a[_0x1c78('0x20')]=qs['limit'](_0x1170b0[_0x1c78('0x37')][_0x1c78('0x20')]);_0x586f9a['offset']=qs[_0x1c78('0x1e')](_0x1170b0[_0x1c78('0x37')][_0x1c78('0x1e')]);}return _0x1ada4c[_0x1c78('0x8c')](_0x586f9a);}})['then'](function(_0x2db6d3){if(_0x2db6d3){return _0x2db6d3?{'count':_0x8ea2a3,'rows':_0x2db6d3}:null;}})[_0x1c78('0x27')](respondWithResult(_0x17cc15,null))[_0x1c78('0x47')](handleError(_0x17cc15,null));}; \ No newline at end of file +var _0x6623=['transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','Lists','UserProfileResource','destroy','stack','name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','error','body','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','length','hasOwnProperty','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','isEmpty','now','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize'];(function(_0x4dca28,_0x2cd0f3){var _0x3841b1=function(_0x4d68e5){while(--_0x4d68e5){_0x4dca28['push'](_0x4dca28['shift']());}};_0x3841b1(++_0x2cd0f3);}(_0x6623,0xa5));var _0x3662=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x6623[_0x4c7fb5];return _0x2e10ac;};'use strict';var emlformat=require(_0x3662('0x0'));var rimraf=require(_0x3662('0x1'));var zipdir=require(_0x3662('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3662('0x3'));var BPromise=require(_0x3662('0x4'));var Mustache=require(_0x3662('0x5'));var util=require(_0x3662('0x6'));var path=require(_0x3662('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3662('0x8'));var fs=require('fs');var fs_extra=require(_0x3662('0x9'));var _=require(_0x3662('0xa'));var squel=require(_0x3662('0xb'));var crypto=require('crypto');var jsforce=require(_0x3662('0xc'));var deskjs=require(_0x3662('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3662('0xe'));var Papa=require(_0x3662('0xf'));var Redis=require(_0x3662('0x10'));var authService=require(_0x3662('0x11'));var qs=require(_0x3662('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3662('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3662('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3662('0x15'));var db=require(_0x3662('0x16'))['db'];config[_0x3662('0x17')]=_[_0x3662('0x18')](config[_0x3662('0x17')],{'host':_0x3662('0x19'),'port':0x18eb});var socket=require(_0x3662('0x1a'))(new Redis(config[_0x3662('0x17')]));require(_0x3662('0x1b'))['register'](socket);function respondWithStatusCode(_0x17214f,_0x4b98b4){_0x4b98b4=_0x4b98b4||0xcc;return function(_0xcd9a2d){if(_0xcd9a2d){return _0x17214f[_0x3662('0x1c')](_0x4b98b4);}return _0x17214f[_0x3662('0x1d')](_0x4b98b4)[_0x3662('0x1e')]();};}function respondWithResult(_0x33c553,_0x3ab61a){_0x3ab61a=_0x3ab61a||0xc8;return function(_0x38a758){if(_0x38a758){return _0x33c553[_0x3662('0x1d')](_0x3ab61a)[_0x3662('0x1f')](_0x38a758);}};}function respondWithFilteredResult(_0x36cb31,_0xd94c0e){return function(_0x542827){if(_0x542827){var _0x46c496=typeof _0xd94c0e[_0x3662('0x20')]==='undefined'&&typeof _0xd94c0e[_0x3662('0x21')]===_0x3662('0x22');var _0x88da9d=_0x542827[_0x3662('0x23')];var _0x189c5a=_0x46c496?0x0:_0xd94c0e['offset'];var _0x26723c=_0x46c496?_0x542827['count']:_0xd94c0e[_0x3662('0x20')]+_0xd94c0e['limit'];var _0x27a5eb;if(_0x26723c>=_0x88da9d){_0x26723c=_0x88da9d;_0x27a5eb=0xc8;}else{_0x27a5eb=0xce;}_0x36cb31['status'](_0x27a5eb);return _0x36cb31[_0x3662('0x24')](_0x3662('0x25'),_0x189c5a+'-'+_0x26723c+'/'+_0x88da9d)[_0x3662('0x1f')](_0x542827);}return null;};}function patchUpdates(_0x3f9c7e){return function(_0x1a087c){try{jsonpatch['apply'](_0x1a087c,_0x3f9c7e,!![]);}catch(_0x53b65d){return BPromise['reject'](_0x53b65d);}return _0x1a087c[_0x3662('0x26')]();};}function saveUpdates(_0xd330,_0x4de63a){return function(_0x3765ee){if(_0x3765ee){return _0x3765ee[_0x3662('0x27')](_0xd330)[_0x3662('0x28')](function(_0x516fb0){return _0x516fb0;});}return null;};}function removeEntity(_0x1be07c,_0x2d154a){return function(_0x4424f3){if(_0x4424f3){return _0x4424f3['destroy']()[_0x3662('0x28')](function(){var _0x1ccde6=_0x4424f3['get']({'plain':!![]});var _0x40058f=_0x3662('0x29');return db[_0x3662('0x2a')][_0x3662('0x2b')]({'where':{'type':_0x40058f,'resourceId':_0x1ccde6['id']}})[_0x3662('0x28')](function(){return _0x4424f3;});})[_0x3662('0x28')](function(){_0x1be07c[_0x3662('0x1d')](0xcc)[_0x3662('0x1e')]();});}};}function handleEntityNotFound(_0x5326af,_0xd37e2f){return function(_0x33e7eb){if(!_0x33e7eb){_0x5326af[_0x3662('0x1c')](0x194);}return _0x33e7eb;};}function handleError(_0x36db97,_0xa89803){_0xa89803=_0xa89803||0x1f4;return function(_0xebd5b9){logger['error'](_0xebd5b9[_0x3662('0x2c')]);if(_0xebd5b9[_0x3662('0x2d')]){delete _0xebd5b9[_0x3662('0x2d')];}_0x36db97[_0x3662('0x1d')](_0xa89803)[_0x3662('0x2e')](_0xebd5b9);};}exports[_0x3662('0x2f')]=function(_0x54ea51,_0xf828b8){var _0x3038ca={},_0x263eb4={},_0xa7a082={'count':0x0,'rows':[]};var _0x4de66a=_[_0x3662('0x30')](db[_0x3662('0x31')][_0x3662('0x32')],function(_0xe0a37d){return{'name':_0xe0a37d[_0x3662('0x33')],'type':_0xe0a37d['type'][_0x3662('0x34')]};});_0x263eb4[_0x3662('0x35')]=_[_0x3662('0x30')](_0x4de66a,_0x3662('0x2d'));_0x263eb4[_0x3662('0x36')]=_[_0x3662('0x37')](_0x54ea51['query']);_0x263eb4[_0x3662('0x38')]=_[_0x3662('0x39')](_0x263eb4['model'],_0x263eb4[_0x3662('0x36')]);_0x3038ca['attributes']=_[_0x3662('0x39')](_0x263eb4[_0x3662('0x35')],qs[_0x3662('0x3a')](_0x54ea51[_0x3662('0x36')][_0x3662('0x3a')]));_0x3038ca[_0x3662('0x3b')]=_0x3038ca[_0x3662('0x3b')]['length']?_0x3038ca[_0x3662('0x3b')]:_0x263eb4[_0x3662('0x35')];if(!_0x54ea51[_0x3662('0x36')]['hasOwnProperty'](_0x3662('0x3c'))){_0x3038ca[_0x3662('0x21')]=qs[_0x3662('0x21')](_0x54ea51[_0x3662('0x36')][_0x3662('0x21')]);_0x3038ca[_0x3662('0x20')]=qs[_0x3662('0x20')](_0x54ea51['query'][_0x3662('0x20')]);}_0x3038ca[_0x3662('0x3d')]=qs['sort'](_0x54ea51['query'][_0x3662('0x3e')]);_0x3038ca[_0x3662('0x3f')]=qs[_0x3662('0x38')](_[_0x3662('0x40')](_0x54ea51[_0x3662('0x36')],_0x263eb4[_0x3662('0x38')]),_0x4de66a);if(_0x54ea51[_0x3662('0x36')]['filter']){_0x3038ca['where']=_[_0x3662('0x41')](_0x3038ca[_0x3662('0x3f')],{'$or':_[_0x3662('0x30')](_0x4de66a,function(_0x4ab75c){if(_0x4ab75c[_0x3662('0x42')]!==_0x3662('0x43')){var _0x2339c4={};_0x2339c4[_0x4ab75c[_0x3662('0x2d')]]={'$like':'%'+_0x54ea51[_0x3662('0x36')][_0x3662('0x44')]+'%'};return _0x2339c4;}})});}_0x3038ca=_['merge']({},_0x3038ca,_0x54ea51[_0x3662('0x45')]);var _0x313b39={'where':_0x3038ca['where']};return db['CmList'][_0x3662('0x23')](_0x313b39)['then'](function(_0x2deac0){_0xa7a082[_0x3662('0x23')]=_0x2deac0;if(_0x54ea51[_0x3662('0x36')][_0x3662('0x46')]){_0x3038ca[_0x3662('0x47')]=[{'all':!![]}];}return db['CmList'][_0x3662('0x48')](_0x3038ca);})[_0x3662('0x28')](function(_0x42147d){_0xa7a082[_0x3662('0x49')]=_0x42147d;return _0xa7a082;})['then'](respondWithFilteredResult(_0xf828b8,_0x3038ca))[_0x3662('0x4a')](handleError(_0xf828b8,null));};exports[_0x3662('0x4b')]=function(_0xa6ad33,_0x181060){var _0xcbcdc9={'raw':![],'where':{'id':_0xa6ad33['params']['id']}},_0x93c289={};_0x93c289[_0x3662('0x35')]=_[_0x3662('0x37')](db[_0x3662('0x31')][_0x3662('0x32')]);_0x93c289['query']=_['keys'](_0xa6ad33[_0x3662('0x36')]);_0x93c289[_0x3662('0x38')]=_[_0x3662('0x39')](_0x93c289[_0x3662('0x35')],_0x93c289[_0x3662('0x36')]);_0xcbcdc9[_0x3662('0x3b')]=_[_0x3662('0x39')](_0x93c289['model'],qs[_0x3662('0x3a')](_0xa6ad33['query'][_0x3662('0x3a')]));_0xcbcdc9['attributes']=_0xcbcdc9[_0x3662('0x3b')]['length']?_0xcbcdc9[_0x3662('0x3b')]:_0x93c289[_0x3662('0x35')];if(_0xa6ad33['query'][_0x3662('0x46')]){_0xcbcdc9[_0x3662('0x47')]=[{'all':!![]}];}_0xcbcdc9=_[_0x3662('0x41')]({},_0xcbcdc9,_0xa6ad33[_0x3662('0x45')]);return db[_0x3662('0x31')]['find'](_0xcbcdc9)[_0x3662('0x28')](handleEntityNotFound(_0x181060,null))[_0x3662('0x28')](respondWithResult(_0x181060,null))['catch'](handleError(_0x181060,null));};exports['create']=function(_0x4a9177,_0x3caeba){return db[_0x3662('0x31')][_0x3662('0x4c')](_0x4a9177['body'],{})[_0x3662('0x28')](function(_0x2e6fa4){var _0x581505=_0x4a9177[_0x3662('0x4d')][_0x3662('0x4e')]({'plain':!![]});if(!_0x581505)throw new Error(_0x3662('0x4f'));if(_0x581505[_0x3662('0x50')]===_0x3662('0x4d')){var _0x51ae92=_0x2e6fa4[_0x3662('0x4e')]({'plain':!![]});var _0x15262d=_0x3662('0x29');return db['UserProfileSection'][_0x3662('0x51')]({'where':{'name':_0x15262d,'userProfileId':_0x581505['userProfileId']},'raw':!![]})[_0x3662('0x28')](function(_0x5e9dfb){if(_0x5e9dfb&&_0x5e9dfb[_0x3662('0x52')]===0x0){return db[_0x3662('0x2a')][_0x3662('0x4c')]({'name':_0x51ae92[_0x3662('0x2d')],'resourceId':_0x51ae92['id'],'type':_0x5e9dfb[_0x3662('0x2d')],'sectionId':_0x5e9dfb['id']},{})[_0x3662('0x28')](function(){return _0x2e6fa4;});}else{return _0x2e6fa4;}})[_0x3662('0x4a')](function(_0x1fef1d){logger[_0x3662('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fef1d);throw _0x1fef1d;});}return _0x2e6fa4;})[_0x3662('0x28')](respondWithResult(_0x3caeba,0xc9))['catch'](handleError(_0x3caeba,null));};exports[_0x3662('0x27')]=function(_0x5e32e9,_0x2674c4){if(_0x5e32e9['body']['id']){delete _0x5e32e9[_0x3662('0x54')]['id'];}return db[_0x3662('0x31')]['find']({'where':{'id':_0x5e32e9[_0x3662('0x55')]['id']}})['then'](handleEntityNotFound(_0x2674c4,null))[_0x3662('0x28')](saveUpdates(_0x5e32e9[_0x3662('0x54')],null))[_0x3662('0x28')](respondWithResult(_0x2674c4,null))[_0x3662('0x4a')](handleError(_0x2674c4,null));};exports[_0x3662('0x2b')]=function(_0x2f4a4c,_0x536661){return db['CmList'][_0x3662('0x51')]({'where':{'id':_0x2f4a4c[_0x3662('0x55')]['id']}})[_0x3662('0x28')](handleEntityNotFound(_0x536661,null))[_0x3662('0x28')](removeEntity(_0x536661,null))['catch'](handleError(_0x536661,null));};exports[_0x3662('0x56')]=function(_0x182c71,_0x5e0a30){return db[_0x3662('0x31')][_0x3662('0x56')]()[_0x3662('0x28')](respondWithResult(_0x5e0a30,null))['catch'](handleError(_0x5e0a30,null));};exports[_0x3662('0x57')]=function(_0x58f7d7,_0x15856f,_0x52b97e){if(_0x58f7d7[_0x3662('0x54')]['id']){delete _0x58f7d7['body']['id'];}return db[_0x3662('0x31')][_0x3662('0x51')]({'where':{'id':_0x58f7d7[_0x3662('0x55')]['id']}})['then'](handleEntityNotFound(_0x15856f,null))['then'](function(_0x1c7dbc){if(_0x1c7dbc){_0x58f7d7[_0x3662('0x54')][_0x3662('0x58')]=_0x1c7dbc['id'];return db[_0x3662('0x59')][_0x3662('0x4c')](_0x58f7d7[_0x3662('0x54')]);}})[_0x3662('0x28')](respondWithResult(_0x15856f,null))[_0x3662('0x4a')](handleError(_0x15856f,null));};exports[_0x3662('0x5a')]=function(_0x2a1f9d,_0xc72229,_0x2957ac){var _0x16389a={'raw':![],'where':{}};var _0x5d3d0a={};var _0x27eea0={'count':0x0,'rows':[]};return db[_0x3662('0x31')][_0x3662('0x5b')]({'where':{'id':_0x2a1f9d[_0x3662('0x55')]['id']}})[_0x3662('0x28')](handleEntityNotFound(_0xc72229,null))[_0x3662('0x28')](function(_0x2e9d1c){if(_0x2e9d1c){_0x5d3d0a[_0x3662('0x35')]=_[_0x3662('0x37')](db[_0x3662('0x59')][_0x3662('0x32')]);_0x5d3d0a[_0x3662('0x36')]=_['keys'](_0x2a1f9d['query']);_0x5d3d0a[_0x3662('0x38')]=_[_0x3662('0x39')](_0x5d3d0a[_0x3662('0x35')],_0x5d3d0a[_0x3662('0x36')]);_0x16389a[_0x3662('0x3b')]=_[_0x3662('0x39')](_0x5d3d0a['model'],qs[_0x3662('0x3a')](_0x2a1f9d['query'][_0x3662('0x3a')]));_0x16389a[_0x3662('0x3b')]=_0x16389a[_0x3662('0x3b')][_0x3662('0x5c')]?_0x16389a[_0x3662('0x3b')]:_0x5d3d0a[_0x3662('0x35')];if(!_0x2a1f9d[_0x3662('0x36')][_0x3662('0x5d')](_0x3662('0x3c'))){_0x16389a[_0x3662('0x21')]=qs[_0x3662('0x21')](_0x2a1f9d[_0x3662('0x36')]['limit']);_0x16389a['offset']=qs['offset'](_0x2a1f9d[_0x3662('0x36')]['offset']);}_0x16389a[_0x3662('0x3d')]=qs['sort'](_0x2a1f9d[_0x3662('0x36')]['sort']);_0x16389a[_0x3662('0x3f')]=qs[_0x3662('0x38')](_[_0x3662('0x40')](_0x2a1f9d[_0x3662('0x36')],_0x5d3d0a[_0x3662('0x38')]));_0x16389a['where']['ListId']=_0x2e9d1c['id'];if(_0x2a1f9d[_0x3662('0x36')]['filter']){_0x16389a[_0x3662('0x3f')]=_[_0x3662('0x41')](_0x16389a[_0x3662('0x3f')],{'$or':_['map'](_0x16389a['attributes'],function(_0x152d59){var _0x4fdf53={};_0x4fdf53[_0x152d59]={'$like':'%'+_0x2a1f9d['query'][_0x3662('0x44')]+'%'};return _0x4fdf53;})});}_0x16389a=_[_0x3662('0x41')]({},_0x16389a,_0x2a1f9d[_0x3662('0x45')]);return db[_0x3662('0x59')][_0x3662('0x23')]({'where':_0x16389a[_0x3662('0x3f')]})['then'](function(_0x7220c7){_0x27eea0[_0x3662('0x23')]=_0x7220c7;if(_0x2a1f9d[_0x3662('0x36')][_0x3662('0x46')]){_0x16389a[_0x3662('0x47')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x16389a);})['then'](function(_0x17a05a){_0x27eea0[_0x3662('0x49')]=_0x17a05a;return _0x27eea0;});}})[_0x3662('0x28')](respondWithFilteredResult(_0xc72229,_0x16389a))[_0x3662('0x4a')](handleError(_0xc72229,null));};exports[_0x3662('0x5e')]=function(_0x3e5f6f,_0x58bdcb,_0xdf87cc){return db[_0x3662('0x31')][_0x3662('0x51')]({'where':{'id':_0x3e5f6f['params']['id']}})[_0x3662('0x28')](handleEntityNotFound(_0x58bdcb,null))[_0x3662('0x28')](function(_0x405dc4){if(_0x405dc4){return _0x405dc4[_0x3662('0x5e')](_0x3e5f6f['query'][_0x3662('0x5f')]);}})['then'](respondWithStatusCode(_0x58bdcb,null))['catch'](handleError(_0x58bdcb,null));};exports[_0x3662('0x60')]=function(_0x4a0304,_0x221df8,_0x4fec45){return db['CmList']['find']({'where':{'id':_0x4a0304[_0x3662('0x55')]['id']}})[_0x3662('0x28')](handleEntityNotFound(_0x221df8,null))['then'](function(_0x12eb99){if(_0x12eb99){var _0x5d10b7=[];var _0x4f12fb={'success':[],'errors':[]};return db[_0x3662('0x61')][_0x3662('0x56')]()['then'](function(_0xab89f3){if(_0x4a0304[_0x3662('0x54')][_0x3662('0x62')]&&_['isArray'](_0x4a0304[_0x3662('0x54')][_0x3662('0x62')])){if(_0x4a0304[_0x3662('0x54')][_0x3662('0x62')][_0x3662('0x5c')]){_0x4a0304[_0x3662('0x54')][_0x3662('0x62')]=_0x4a0304[_0x3662('0x54')][_0x3662('0x62')][_0x3662('0x63')](';')+';';}else{_0x4a0304[_0x3662('0x54')]['tags']=null;}}else{_0x4a0304[_0x3662('0x54')][_0x3662('0x62')]=null;}if(_0x4a0304[_0x3662('0x54')]&&_[_0x3662('0x64')](_0x4a0304[_0x3662('0x54')])){for(var _0xf99af=0x0;_0xf99af<_0x4a0304[_0x3662('0x54')]['length'];_0xf99af+=0x1){_0x4a0304['body'][_0xf99af][_0x3662('0x58')]=_0x4a0304[_0x3662('0x55')]['id'];_0x5d10b7[_0x3662('0x65')](_0x4a0304['body'][_0xf99af]);}return BPromise[_0x3662('0x66')](_0x5d10b7,function(_0x5106f0){return db['CmContact'][_0x3662('0x4c')](_[_0x3662('0x67')](_0x5106f0,['ids','id'])||{},{'fields':_[_0x3662('0x37')](_0xab89f3),'raw':!![]})[_0x3662('0x28')](function(_0x45a304){_0x4f12fb[_0x3662('0x68')][_0x3662('0x65')](_0x45a304[_0x3662('0x69')]);})[_0x3662('0x4a')](function(_0x451b02){_0x4f12fb[_0x3662('0x6a')][_0x3662('0x65')]({'data':_0x5106f0,'error':_0x451b02[_0x3662('0x6b')]});});})[_0x3662('0x28')](function(_0x2def44){return _0x4f12fb;})['catch'](function(_0x1acd97){return _0x1acd97;});}else{_0x221df8[_0x3662('0x1d')](0x190)[_0x3662('0x1f')]({'message':_0x3662('0x6c')});}});}})[_0x3662('0x28')](respondWithResult(_0x221df8,null))[_0x3662('0x4a')](handleError(_0x221df8,null));};exports['getContacts']=function(_0x586bb4,_0x174767,_0x1dfea4){var _0x7f018f;return db['CmList'][_0x3662('0x51')]({'where':{'id':_0x586bb4[_0x3662('0x55')]['id']},'include':[{'model':db[_0x3662('0x6d')],'as':_0x3662('0x6e')}]})[_0x3662('0x28')](handleEntityNotFound(_0x174767,null))['then'](function(_0xe62b8c){if(_0xe62b8c){_0x7f018f=_0xe62b8c;return db[_0x3662('0x61')][_0x3662('0x32')];}})['then'](function(_0x16fd5c){if(_0x16fd5c){var _0x3324e9={};var _0xac1124={};_0xac1124[_0x3662('0x35')]=_[_0x3662('0x6f')](_['keys'](_0x16fd5c),_[_0x3662('0x30')](_0x7f018f[_0x3662('0x6e')],function(_0x3d5033){return util[_0x3662('0x70')](_0x3662('0x71'),_0x3d5033['id']);}));_0xac1124[_0x3662('0x36')]=_['keys'](_0x586bb4['query']);_0xac1124[_0x3662('0x38')]=_[_0x3662('0x39')](_0xac1124[_0x3662('0x35')],_0xac1124[_0x3662('0x36')]);_0x3324e9[_0x3662('0x3b')]=_[_0x3662('0x39')](_0xac1124[_0x3662('0x35')],qs['fields'](_0x586bb4['query'][_0x3662('0x3a')]));_0x3324e9[_0x3662('0x3b')]=_0x3324e9[_0x3662('0x3b')][_0x3662('0x5c')]?_0x3324e9[_0x3662('0x3b')]:_0xac1124[_0x3662('0x35')];if(!_0x586bb4['query'][_0x3662('0x5d')](_0x3662('0x3c'))){_0x3324e9['limit']=qs[_0x3662('0x21')](_0x586bb4[_0x3662('0x36')]['limit']);_0x3324e9['offset']=qs[_0x3662('0x20')](_0x586bb4[_0x3662('0x36')][_0x3662('0x20')]);}_0x3324e9[_0x3662('0x3d')]=qs[_0x3662('0x3e')](_0x586bb4[_0x3662('0x36')]['sort']);_0x3324e9[_0x3662('0x3f')]=qs[_0x3662('0x38')](_[_0x3662('0x40')](_0x586bb4[_0x3662('0x36')],_0xac1124[_0x3662('0x38')]));_0x3324e9[_0x3662('0x72')]=!![];if(_0x586bb4[_0x3662('0x36')][_0x3662('0x44')]){_0x3324e9['where']=_[_0x3662('0x41')](_0x3324e9['where'],{'$or':_[_0x3662('0x30')](_0x3324e9[_0x3662('0x3b')],function(_0x12ea89){var _0x2a10d0={};_0x2a10d0[_0x12ea89]={'$like':'%'+_0x586bb4[_0x3662('0x36')]['filter']+'%'};return _0x2a10d0;})});}_0x3324e9=_[_0x3662('0x41')]({},_0x3324e9,_0x586bb4[_0x3662('0x45')]);return _0x7f018f[_0x3662('0x73')](_0x3324e9);}})[_0x3662('0x28')](respondWithResult(_0x174767,null))[_0x3662('0x4a')](handleError(_0x174767,null));};exports['getContactsCsv']=function(_0x2c91a3,_0x3ca751,_0x4ba692){var _0x5b1d6b;return db['CmList']['find']({'where':{'id':_0x2c91a3[_0x3662('0x55')]['id']},'include':[{'model':db[_0x3662('0x6d')],'as':_0x3662('0x6e')}]})[_0x3662('0x28')](handleEntityNotFound(_0x3ca751,null))[_0x3662('0x28')](function(_0x39ec3c){if(_0x39ec3c){_0x5b1d6b=_0x39ec3c;return db['CmContact'][_0x3662('0x32')];}})[_0x3662('0x28')](function(_0x53e02e){if(_0x53e02e){var _0x395d97={};var _0x269201={};_0x269201[_0x3662('0x35')]=_[_0x3662('0x6f')](_[_0x3662('0x37')](_0x53e02e),_[_0x3662('0x30')](_0x5b1d6b[_0x3662('0x6e')],function(_0x3bd78a){return util[_0x3662('0x70')](_0x3662('0x71'),_0x3bd78a['id']);}));_0x269201[_0x3662('0x36')]=_[_0x3662('0x37')](_0x2c91a3[_0x3662('0x36')]);_0x269201[_0x3662('0x38')]=_['intersection'](_0x269201[_0x3662('0x35')],_0x269201[_0x3662('0x36')]);_0x395d97[_0x3662('0x3b')]=_[_0x3662('0x39')](_0x269201[_0x3662('0x35')],qs[_0x3662('0x3a')](_0x2c91a3[_0x3662('0x36')][_0x3662('0x3a')]));_0x395d97[_0x3662('0x3b')]=_0x395d97['attributes'][_0x3662('0x5c')]?_0x395d97[_0x3662('0x3b')]:_0x269201[_0x3662('0x35')];if(!_0x2c91a3[_0x3662('0x36')][_0x3662('0x5d')](_0x3662('0x3c'))){_0x395d97[_0x3662('0x21')]=qs['limit'](_0x2c91a3[_0x3662('0x36')][_0x3662('0x21')]);_0x395d97[_0x3662('0x20')]=qs[_0x3662('0x20')](_0x2c91a3[_0x3662('0x36')]['offset']);}_0x395d97[_0x3662('0x3d')]=qs[_0x3662('0x3e')](_0x2c91a3[_0x3662('0x36')][_0x3662('0x3e')]);_0x395d97[_0x3662('0x3f')]=qs[_0x3662('0x38')](_['pick'](_0x2c91a3['query'],_0x269201[_0x3662('0x38')]));_0x395d97[_0x3662('0x72')]=!![];if(_0x2c91a3[_0x3662('0x36')][_0x3662('0x44')]){_0x395d97[_0x3662('0x3f')]=_[_0x3662('0x41')](_0x395d97[_0x3662('0x3f')],{'$or':_['map'](_0x395d97[_0x3662('0x3b')],function(_0x2fbaad){var _0x4df840={};_0x4df840[_0x2fbaad]={'$like':'%'+_0x2c91a3[_0x3662('0x36')][_0x3662('0x44')]+'%'};return _0x4df840;})});}_0x395d97=_[_0x3662('0x41')]({},_0x395d97,_0x2c91a3[_0x3662('0x45')]);return _0x5b1d6b[_0x3662('0x73')](_0x395d97);}})[_0x3662('0x28')](function(_0x321050){if(!_[_0x3662('0x74')](_0x321050)){var _0x504abf=toCsv(_0x321050);var _0x3bd2e4=Date[_0x3662('0x75')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x5b1d6b['id'],_0x3bd2e4),_0x504abf);_0x3ca751[_0x3662('0x76')]('Content-disposition',_0x3662('0x77')+util[_0x3662('0x70')](_0x3662('0x78'),_0x5b1d6b['id'],_0x3bd2e4));_0x3ca751[_0x3662('0x76')](_0x3662('0x79'),_0x3662('0x7a'));return _0x3ca751[_0x3662('0x7b')](util[_0x3662('0x70')]('/tmp/list_%d_%s.csv',_0x5b1d6b['id'],_0x3bd2e4));}else{return _0x3ca751['sendStatus'](0xcc);}})[_0x3662('0x4a')](handleError(_0x3ca751,null));};exports['addCustomField']=function(_0x57cbe0,_0x40fbc3,_0x3a790b){var _0x3e6783;delete _0x57cbe0[_0x3662('0x54')]['id'];return db[_0x3662('0x31')][_0x3662('0x5b')]({'where':{'id':_0x57cbe0['params']['id']}})[_0x3662('0x28')](handleEntityNotFound(_0x40fbc3,null))[_0x3662('0x28')](function(_0x1aead5){if(_0x1aead5){return db[_0x3662('0x7c')][_0x3662('0x7d')](function(_0x1cc69b){return db[_0x3662('0x6d')][_0x3662('0x4c')](_0x57cbe0['body'],{'transaction':_0x1cc69b})[_0x3662('0x28')](function(_0x10e7aa){_0x3e6783=_0x10e7aa;return _0x1aead5[_0x3662('0x7e')](_0x10e7aa,{'transaction':_0x1cc69b});})[_0x3662('0x28')](function(){var _0x281858={'type':db[_0x3662('0x7f')][_0x3662('0x80')],'transaction':_0x1cc69b};switch(_0x57cbe0[_0x3662('0x54')]['type']){case _0x3662('0x81'):_0x281858[_0x3662('0x42')]=db[_0x3662('0x7f')][_0x3662('0x80')];break;case _0x3662('0x82'):_0x281858[_0x3662('0x42')]=db[_0x3662('0x7f')][_0x3662('0x83')];break;case _0x3662('0x84'):_0x281858[_0x3662('0x42')]=db[_0x3662('0x7f')][_0x3662('0x85')];_0x281858[_0x3662('0x86')]=![];break;default:}return db[_0x3662('0x7c')]['queryInterface'][_0x3662('0x87')](_0x3662('0x88'),util[_0x3662('0x70')](_0x3662('0x89'),_0x3e6783['id']),_0x281858);})[_0x3662('0x28')](function(){return _0x3e6783;});});}})[_0x3662('0x28')](respondWithResult(_0x40fbc3,null))[_0x3662('0x4a')](handleError(_0x40fbc3,null));};exports[_0x3662('0x8a')]=function(_0x4d1529,_0x550d3b,_0x220396){var _0x245ff7={};var _0x3d5517={};var _0xbcc6ff;var _0x26d78a;return db[_0x3662('0x31')][_0x3662('0x5b')]({'where':{'id':_0x4d1529[_0x3662('0x55')]['id']}})[_0x3662('0x28')](handleEntityNotFound(_0x550d3b,null))[_0x3662('0x28')](function(_0x1d3a48){if(_0x1d3a48){_0xbcc6ff=_0x1d3a48;_0x3d5517[_0x3662('0x35')]=_[_0x3662('0x37')](db['CmCustomField'][_0x3662('0x32')]);_0x3d5517[_0x3662('0x36')]=_[_0x3662('0x37')](_0x4d1529[_0x3662('0x36')]);_0x3d5517['filters']=_[_0x3662('0x39')](_0x3d5517[_0x3662('0x35')],_0x3d5517[_0x3662('0x36')]);_0x245ff7[_0x3662('0x3b')]=_[_0x3662('0x39')](_0x3d5517[_0x3662('0x35')],qs[_0x3662('0x3a')](_0x4d1529[_0x3662('0x36')][_0x3662('0x3a')]));_0x245ff7[_0x3662('0x3b')]=_0x245ff7[_0x3662('0x3b')][_0x3662('0x5c')]?_0x245ff7[_0x3662('0x3b')]:_0x3d5517[_0x3662('0x35')];_0x245ff7[_0x3662('0x3d')]=qs[_0x3662('0x3e')](_0x4d1529[_0x3662('0x36')][_0x3662('0x3e')]);_0x245ff7['where']=qs[_0x3662('0x38')](_[_0x3662('0x40')](_0x4d1529['query'],_0x3d5517[_0x3662('0x38')]));_0x245ff7[_0x3662('0x3f')]=_[_0x3662('0x41')](_0x245ff7[_0x3662('0x3f')],{'$or':[{'ListId':_0x1d3a48['id']},{'ListId':null}]});if(_0x4d1529['query'][_0x3662('0x44')]){_0x245ff7['where']=_[_0x3662('0x41')](_0x245ff7[_0x3662('0x3f')],{'$or':_[_0x3662('0x30')](_0x245ff7[_0x3662('0x3b')],function(_0x2aa6a5){var _0x1a88a9={};_0x1a88a9[_0x2aa6a5]={'$like':'%'+_0x4d1529[_0x3662('0x36')][_0x3662('0x44')]+'%'};return _0x1a88a9;})});}_0x245ff7=_[_0x3662('0x41')]({},_0x245ff7,_0x4d1529[_0x3662('0x45')]);return db[_0x3662('0x6d')][_0x3662('0x8b')](_0x245ff7);}})[_0x3662('0x28')](respondWithResult(_0x550d3b,null))[_0x3662('0x4a')](handleError(_0x550d3b,null));};exports[_0x3662('0x8c')]=function(_0x482ade,_0x53fc93,_0x314072){return db['CmList'][_0x3662('0x51')]({'where':{'id':_0x482ade[_0x3662('0x55')]['id']}})['then'](handleEntityNotFound(_0x53fc93,null))[_0x3662('0x28')](function(_0x45ce97){if(_0x45ce97){return _0x45ce97[_0x3662('0x8c')](_0x482ade[_0x3662('0x54')][_0x3662('0x5f')],_[_0x3662('0x67')](_0x482ade[_0x3662('0x54')],[_0x3662('0x5f'),'id'])||{})['spread'](function(_0x3b0a3a){for(var _0x4c2177=0x0;_0x4c2177<_0x482ade[_0x3662('0x54')][_0x3662('0x5f')][_0x3662('0x5c')];_0x4c2177+=0x1){socket[_0x3662('0x8d')]('userCmList:save',{'UserId':Number(_0x482ade[_0x3662('0x54')]['ids'][_0x4c2177]),'CmListId':Number(_0x482ade[_0x3662('0x55')]['id'])});}return _0x3b0a3a;});}})[_0x3662('0x28')](respondWithResult(_0x53fc93,null))['catch'](handleError(_0x53fc93,null));};exports[_0x3662('0x8e')]=function(_0xd9c4cc,_0x5e77b4,_0x113e23){return db[_0x3662('0x31')][_0x3662('0x51')]({'where':{'id':_0xd9c4cc['params']['id']}})[_0x3662('0x28')](handleEntityNotFound(_0x5e77b4,null))[_0x3662('0x28')](function(_0x599469){if(_0x599469){return _0x599469[_0x3662('0x8e')](_0xd9c4cc[_0x3662('0x36')][_0x3662('0x5f')])[_0x3662('0x28')](function(){if(_[_0x3662('0x64')](_0xd9c4cc[_0x3662('0x36')]['ids'])){for(var _0x1b42b5=0x0;_0x1b42b5<_0xd9c4cc[_0x3662('0x36')]['ids'][_0x3662('0x5c')];_0x1b42b5+=0x1){socket[_0x3662('0x8d')](_0x3662('0x8f'),{'UserId':Number(_0xd9c4cc[_0x3662('0x36')][_0x3662('0x5f')][_0x1b42b5]),'CmListId':Number(_0xd9c4cc[_0x3662('0x55')]['id'])});}}else{socket['emit'](_0x3662('0x8f'),{'UserId':Number(_0xd9c4cc[_0x3662('0x36')]['ids']),'CmListId':Number(_0xd9c4cc[_0x3662('0x55')]['id'])});}});}})[_0x3662('0x28')](respondWithStatusCode(_0x5e77b4,null))['catch'](handleError(_0x5e77b4,null));};exports[_0x3662('0x90')]=function(_0x425546,_0x574581,_0x226096){var _0x5def2e={};var _0x1649d6={};var _0x489463;var _0x1a87f6;return db[_0x3662('0x31')][_0x3662('0x5b')]({'where':{'id':_0x425546['params']['id']}})[_0x3662('0x28')](handleEntityNotFound(_0x574581,null))['then'](function(_0x2c473a){if(_0x2c473a){_0x489463=_0x2c473a;_0x1649d6[_0x3662('0x35')]=_[_0x3662('0x37')](db['User'][_0x3662('0x32')]);_0x1649d6[_0x3662('0x36')]=_[_0x3662('0x37')](_0x425546[_0x3662('0x36')]);_0x1649d6[_0x3662('0x38')]=_[_0x3662('0x39')](_0x1649d6[_0x3662('0x35')],_0x1649d6[_0x3662('0x36')]);_0x5def2e[_0x3662('0x3b')]=_[_0x3662('0x39')](_0x1649d6[_0x3662('0x35')],qs[_0x3662('0x3a')](_0x425546[_0x3662('0x36')][_0x3662('0x3a')]));_0x5def2e[_0x3662('0x3b')]=_0x5def2e[_0x3662('0x3b')][_0x3662('0x5c')]?_0x5def2e[_0x3662('0x3b')]:_0x1649d6[_0x3662('0x35')];_0x5def2e[_0x3662('0x3d')]=qs[_0x3662('0x3e')](_0x425546[_0x3662('0x36')][_0x3662('0x3e')]);_0x5def2e[_0x3662('0x3f')]=qs[_0x3662('0x38')](_['pick'](_0x425546['query'],_0x1649d6[_0x3662('0x38')]));if(_0x425546[_0x3662('0x36')]['filter']){_0x5def2e['where']=_[_0x3662('0x41')](_0x5def2e[_0x3662('0x3f')],{'$or':_[_0x3662('0x30')](_0x5def2e['attributes'],function(_0x42a55f){var _0x59bdca={};_0x59bdca[_0x42a55f]={'$like':'%'+_0x425546[_0x3662('0x36')][_0x3662('0x44')]+'%'};return _0x59bdca;})});}_0x5def2e=_['merge']({},_0x5def2e,_0x425546[_0x3662('0x45')]);return _0x489463[_0x3662('0x90')](_0x5def2e);}})[_0x3662('0x28')](function(_0x57b713){if(_0x57b713){_0x1a87f6=_0x57b713[_0x3662('0x5c')];if(!_0x425546['query'][_0x3662('0x5d')](_0x3662('0x3c'))){_0x5def2e[_0x3662('0x21')]=qs[_0x3662('0x21')](_0x425546[_0x3662('0x36')][_0x3662('0x21')]);_0x5def2e[_0x3662('0x20')]=qs[_0x3662('0x20')](_0x425546[_0x3662('0x36')][_0x3662('0x20')]);}return _0x489463[_0x3662('0x90')](_0x5def2e);}})[_0x3662('0x28')](function(_0x270623){if(_0x270623){return _0x270623?{'count':_0x1a87f6,'rows':_0x270623}:null;}})[_0x3662('0x28')](respondWithResult(_0x574581,null))['catch'](handleError(_0x574581,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 582d59f..426bc25 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x416d4f,_0x474170){var _0x3910c9=function(_0x2796e0){while(--_0x2796e0){_0x416d4f['push'](_0x416d4f['shift']());}};_0x3910c9(++_0x474170);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x44ab30,_0x2ea2b5){var _0x129099=function(_0x54b708){while(--_0x54b708){_0x44ab30['push'](_0x44ab30['shift']());}};_0x129099(++_0x2ea2b5);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 76fd8bc..218e175 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x4e37e3,_0x192097){var _0x5d1cf5=function(_0x160269){while(--_0x160269){_0x4e37e3['push'](_0x4e37e3['shift']());}};_0x5d1cf5(++_0x192097);}(_0x2dae,0xc3));var _0xe2da=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0x2dae[_0x1895b7];return _0x1aecdc;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd64b=['define','CmList','cm_lists','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0xd64b,0xc1));var _0xbd64=function(_0x48d3f8,_0x502a1b){_0x48d3f8=_0x48d3f8-0x0;var _0x3f6498=_0xd64b[_0x48d3f8];return _0x3f6498;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'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 ed4f18d..d98d4a5 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 _0x0382=['error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x52b80b,_0x14ccde){var _0x44e670=function(_0x4c6bad){while(--_0x4c6bad){_0x52b80b['push'](_0x52b80b['shift']());}};_0x44e670(++_0x14ccde);}(_0x0382,0xab));var _0x2038=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x0382[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0x2038('0x0'));var util=require(_0x2038('0x1'));var moment=require('moment');var BPromise=require(_0x2038('0x2'));var rs=require(_0x2038('0x3'));var fs=require('fs');var Redis=require(_0x2038('0x4'));var db=require(_0x2038('0x5'))['db'];var utils=require(_0x2038('0x6'));var logger=require(_0x2038('0x7'))(_0x2038('0x8'));var config=require(_0x2038('0x9'));var jayson=require(_0x2038('0xa'));var client=jayson[_0x2038('0xb')][_0x2038('0xc')]({'port':0x232a});config[_0x2038('0xd')]=_[_0x2038('0xe')](config[_0x2038('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2038('0xf'))(new Redis(config['redis']));require('./cmList.socket')[_0x2038('0x10')](socket);function respondWithRpcPromise(_0x26e3c0,_0x97c581,_0x2274de){return new BPromise(function(_0x4f87a8,_0x4c3598){return client[_0x2038('0x11')](_0x26e3c0,_0x2274de)[_0x2038('0x12')](function(_0xbb00a6){logger[_0x2038('0x13')](_0x2038('0x14'),_0x97c581,_0x2038('0x15'));logger[_0x2038('0x16')](_0x2038('0x17'),_0x97c581,_0x2038('0x15'),JSON[_0x2038('0x18')](_0xbb00a6));if(_0xbb00a6['error']){if(_0xbb00a6[_0x2038('0x19')]['code']===0x1f4){logger['error'](_0x2038('0x14'),_0x97c581,_0xbb00a6[_0x2038('0x19')]['message']);return _0x4c3598(_0xbb00a6['error'][_0x2038('0x1a')]);}logger[_0x2038('0x19')](_0x2038('0x14'),_0x97c581,_0xbb00a6[_0x2038('0x19')]['message']);return _0x4f87a8(_0xbb00a6['error']['message']);}else{logger[_0x2038('0x13')]('CmList,\x20%s,\x20%s',_0x97c581,'request\x20sent');_0x4f87a8(_0xbb00a6['result']['message']);}})[_0x2038('0x1b')](function(_0x3cf0c7){logger[_0x2038('0x19')](_0x2038('0x14'),_0x97c581,_0x3cf0c7);_0x4c3598(_0x3cf0c7);});});} \ No newline at end of file +var _0x9bf5=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x9bf5,0x1df));var _0x59bf=function(_0x11379e,_0x2e2c6c){_0x11379e=_0x11379e-0x0;var _0x12839a=_0x9bf5[_0x11379e];return _0x12839a;};'use strict';var _=require(_0x59bf('0x0'));var util=require('util');var moment=require(_0x59bf('0x1'));var BPromise=require(_0x59bf('0x2'));var rs=require(_0x59bf('0x3'));var fs=require('fs');var Redis=require(_0x59bf('0x4'));var db=require(_0x59bf('0x5'))['db'];var utils=require(_0x59bf('0x6'));var logger=require(_0x59bf('0x7'))(_0x59bf('0x8'));var config=require(_0x59bf('0x9'));var jayson=require(_0x59bf('0xa'));var client=jayson['client'][_0x59bf('0xb')]({'port':0x232a});config[_0x59bf('0xc')]=_['defaults'](config[_0x59bf('0xc')],{'host':_0x59bf('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x59bf('0xc')]));require(_0x59bf('0xe'))[_0x59bf('0xf')](socket);function respondWithRpcPromise(_0xbedfbe,_0x3452f7,_0x283d08){return new BPromise(function(_0x5da40d,_0x5e4141){return client['request'](_0xbedfbe,_0x283d08)[_0x59bf('0x10')](function(_0x1bffc4){logger['info'](_0x59bf('0x11'),_0x3452f7,_0x59bf('0x12'));logger[_0x59bf('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x3452f7,_0x59bf('0x12'),JSON[_0x59bf('0x14')](_0x1bffc4));if(_0x1bffc4['error']){if(_0x1bffc4['error'][_0x59bf('0x15')]===0x1f4){logger[_0x59bf('0x16')]('CmList,\x20%s,\x20%s',_0x3452f7,_0x1bffc4[_0x59bf('0x16')][_0x59bf('0x17')]);return _0x5e4141(_0x1bffc4[_0x59bf('0x16')][_0x59bf('0x17')]);}logger[_0x59bf('0x16')](_0x59bf('0x11'),_0x3452f7,_0x1bffc4[_0x59bf('0x16')]['message']);return _0x5da40d(_0x1bffc4[_0x59bf('0x16')][_0x59bf('0x17')]);}else{logger[_0x59bf('0x18')](_0x59bf('0x11'),_0x3452f7,_0x59bf('0x12'));_0x5da40d(_0x1bffc4[_0x59bf('0x19')][_0x59bf('0x17')]);}})[_0x59bf('0x1a')](function(_0x4b84dd){logger['error'](_0x59bf('0x11'),_0x3452f7,_0x4b84dd);_0x5e4141(_0x4b84dd);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1322945..72766c6 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 _0x2318=['emit','removeListener','register','cmList:','./cmList.events','save'];(function(_0x1a7972,_0x445ab9){var _0x27f750=function(_0x3856a1){while(--_0x3856a1){_0x1a7972['push'](_0x1a7972['shift']());}};_0x27f750(++_0x445ab9);}(_0x2318,0x13c));var _0x8231=function(_0x3788c5,_0x35bfa0){_0x3788c5=_0x3788c5-0x0;var _0x3e6beb=_0x2318[_0x3788c5];return _0x3e6beb;};'use strict';var CmListEvents=require(_0x8231('0x0'));var events=[_0x8231('0x1'),'remove','update'];function createListener(_0x3145d2,_0x24aaef){return function(_0x134e60){_0x24aaef[_0x8231('0x2')](_0x3145d2,_0x134e60);};}function removeListener(_0x58e392,_0x4b5596){return function(){CmListEvents[_0x8231('0x3')](_0x58e392,_0x4b5596);};}exports[_0x8231('0x4')]=function(_0x2ce954){for(var _0x371681=0x0,_0x582d20=events['length'];_0x371681<_0x582d20;_0x371681++){var _0x2af104=events[_0x371681];var _0x21734b=createListener(_0x8231('0x5')+_0x2af104,_0x2ce954);CmListEvents['on'](_0x2af104,_0x21734b);}}; \ No newline at end of file +var _0xe609=['removeListener','register','length','cmList:','save','update','emit'];(function(_0x787316,_0x492e36){var _0x5b8bcb=function(_0x545cc4){while(--_0x545cc4){_0x787316['push'](_0x787316['shift']());}};_0x5b8bcb(++_0x492e36);}(_0xe609,0xc8));var _0x9e60=function(_0xa4ab9a,_0x4e01b6){_0xa4ab9a=_0xa4ab9a-0x0;var _0x22406a=_0xe609[_0xa4ab9a];return _0x22406a;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x9e60('0x0'),'remove',_0x9e60('0x1')];function createListener(_0x54a363,_0x29aaaa){return function(_0x1e3045){_0x29aaaa[_0x9e60('0x2')](_0x54a363,_0x1e3045);};}function removeListener(_0x383962,_0x464b4f){return function(){CmListEvents[_0x9e60('0x3')](_0x383962,_0x464b4f);};}exports[_0x9e60('0x4')]=function(_0x107812){for(var _0x26e859=0x0,_0x56785f=events[_0x9e60('0x5')];_0x26e859<_0x56785f;_0x26e859++){var _0x322ebb=events[_0x26e859];var _0x42ad5a=createListener(_0x9e60('0x6')+_0x322ebb,_0x107812);CmListEvents['on'](_0x322ebb,_0x42ad5a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 823ecb4..f09b9d3 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 _0xafd6=['/:id/contacts','addCustomField','addAgents','delete','removeDispositions','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','create','post','addDisposition'];(function(_0x4a3b11,_0x5d478f){var _0x9db2df=function(_0x3483a7){while(--_0x3483a7){_0x4a3b11['push'](_0x4a3b11['shift']());}};_0x9db2df(++_0x5d478f);}(_0xafd6,0x10f));var _0x6afd=function(_0x1c1572,_0x2ec564){_0x1c1572=_0x1c1572-0x0;var _0x233187=_0xafd6[_0x1c1572];return _0x233187;};'use strict';var multer=require(_0x6afd('0x0'));var util=require(_0x6afd('0x1'));var path=require(_0x6afd('0x2'));var timeout=require('connect-timeout');var express=require(_0x6afd('0x3'));var router=express['Router']();var fs_extra=require(_0x6afd('0x4'));var auth=require(_0x6afd('0x5'));var interaction=require(_0x6afd('0x6'));var config=require(_0x6afd('0x7'));var controller=require(_0x6afd('0x8'));router[_0x6afd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6afd('0x9')](_0x6afd('0xa'),auth[_0x6afd('0xb')](),controller[_0x6afd('0xc')]);router[_0x6afd('0x9')](_0x6afd('0xd'),auth[_0x6afd('0xb')](),controller[_0x6afd('0xe')]);router[_0x6afd('0x9')](_0x6afd('0xf'),auth[_0x6afd('0xb')](),controller[_0x6afd('0x10')]);router[_0x6afd('0x9')]('/:id/contacts',auth[_0x6afd('0xb')](),controller[_0x6afd('0x11')]);router[_0x6afd('0x9')](_0x6afd('0x12'),auth[_0x6afd('0xb')](),controller[_0x6afd('0x13')]);router[_0x6afd('0x9')](_0x6afd('0x14'),auth[_0x6afd('0xb')](),controller[_0x6afd('0x15')]);router['get'](_0x6afd('0x16'),auth[_0x6afd('0xb')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x6afd('0x17')]);router[_0x6afd('0x18')](_0x6afd('0xf'),auth['isAuthenticated'](),controller[_0x6afd('0x19')]);router[_0x6afd('0x18')](_0x6afd('0x1a'),auth[_0x6afd('0xb')](),controller['addContacts']);router[_0x6afd('0x18')](_0x6afd('0x14'),auth[_0x6afd('0xb')](),controller[_0x6afd('0x1b')]);router[_0x6afd('0x18')](_0x6afd('0x16'),auth['isAuthenticated'](),controller[_0x6afd('0x1c')]);router['put']('/:id',auth[_0x6afd('0xb')](),controller['update']);router[_0x6afd('0x1d')]('/:id',auth[_0x6afd('0xb')](),controller['destroy']);router['delete'](_0x6afd('0xf'),auth[_0x6afd('0xb')](),controller[_0x6afd('0x1e')]);router[_0x6afd('0x1d')](_0x6afd('0x16'),auth[_0x6afd('0xb')](),controller[_0x6afd('0x1f')]);module[_0x6afd('0x20')]=router; \ No newline at end of file +var _0x6987=['create','post','addDisposition','addCustomField','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','./cmList.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users'];(function(_0x3b6a02,_0x4e1fd2){var _0x3c9ea6=function(_0x38c300){while(--_0x38c300){_0x3b6a02['push'](_0x3b6a02['shift']());}};_0x3c9ea6(++_0x4e1fd2);}(_0x6987,0xaa));var _0x7698=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0x6987[_0x2ae8ce];return _0x4bf686;};'use strict';var multer=require(_0x7698('0x0'));var util=require('util');var path=require(_0x7698('0x1'));var timeout=require(_0x7698('0x2'));var express=require(_0x7698('0x3'));var router=express[_0x7698('0x4')]();var fs_extra=require(_0x7698('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7698('0x6'));router[_0x7698('0x7')]('/',auth['isAuthenticated'](),controller[_0x7698('0x8')]);router[_0x7698('0x7')](_0x7698('0x9'),auth[_0x7698('0xa')](),controller['describe']);router['get'](_0x7698('0xb'),auth[_0x7698('0xa')](),controller[_0x7698('0xc')]);router['get'](_0x7698('0xd'),auth[_0x7698('0xa')](),controller[_0x7698('0xe')]);router[_0x7698('0x7')](_0x7698('0xf'),auth[_0x7698('0xa')](),controller[_0x7698('0x10')]);router[_0x7698('0x7')](_0x7698('0x11'),auth[_0x7698('0xa')](),controller[_0x7698('0x12')]);router['get'](_0x7698('0x13'),auth[_0x7698('0xa')](),controller[_0x7698('0x14')]);router[_0x7698('0x7')](_0x7698('0x15'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x7698('0xa')](),controller[_0x7698('0x16')]);router[_0x7698('0x17')](_0x7698('0xd'),auth[_0x7698('0xa')](),controller[_0x7698('0x18')]);router[_0x7698('0x17')]('/:id/contacts',auth[_0x7698('0xa')](),controller['addContacts']);router[_0x7698('0x17')](_0x7698('0x13'),auth[_0x7698('0xa')](),controller[_0x7698('0x19')]);router[_0x7698('0x17')]('/:id/users',auth[_0x7698('0xa')](),controller['addAgents']);router['put']('/:id',auth[_0x7698('0xa')](),controller[_0x7698('0x1a')]);router[_0x7698('0x1b')](_0x7698('0xb'),auth[_0x7698('0xa')](),controller[_0x7698('0x1c')]);router[_0x7698('0x1b')](_0x7698('0xd'),auth[_0x7698('0xa')](),controller[_0x7698('0x1d')]);router[_0x7698('0x1b')](_0x7698('0x15'),auth[_0x7698('0xa')](),controller[_0x7698('0x1e')]);module[_0x7698('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 f173c55..5990b63 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 _0x527c=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x4d189e,_0x2c0a04){var _0x1b36df=function(_0x2d386c){while(--_0x2d386c){_0x4d189e['push'](_0x4d189e['shift']());}};_0x1b36df(++_0x2c0a04);}(_0x527c,0x169));var _0xc527=function(_0x2c9056,_0x552f14){_0x2c9056=_0x2c9056-0x0;var _0x3e6959=_0x527c[_0x2c9056];return _0x3e6959;};'use strict';var Sequelize=require(_0xc527('0x0'));module[_0xc527('0x1')]={'name':{'type':Sequelize[_0xc527('0x2')],'get':function(_0x47f35a){return this['getDataValue'](_0xc527('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xc527('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xc527('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa928=['STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x547454,_0x2c795f){var _0xcdb31b=function(_0x5a4723){while(--_0x5a4723){_0x547454['push'](_0x547454['shift']());}};_0xcdb31b(++_0x2c795f);}(_0xa928,0x15f));var _0x8a92=function(_0x2a9df5,_0x2176a8){_0x2a9df5=_0x2a9df5-0x0;var _0x23b23b=_0xa928[_0x2a9df5];return _0x23b23b;};'use strict';var Sequelize=require(_0x8a92('0x0'));module[_0x8a92('0x1')]={'name':{'type':Sequelize[_0x8a92('0x2')],'get':function(_0xbf06d4){return this[_0x8a92('0x3')]('field');}},'field':{'type':Sequelize[_0x8a92('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x8a92('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 48c7cbc..12c1285 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 _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(_0x5e8b70,_0x3428ef){var _0x41b005=function(_0x5d74dc){while(--_0x5d74dc){_0x5e8b70['push'](_0x5e8b70['shift']());}};_0x41b005(++_0x3428ef);}(_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){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 +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(_0x3fce17,_0x46ddf9){var _0x193654=function(_0x566699){while(--_0x566699){_0x3fce17['push'](_0x3fce17['shift']());}};_0x193654(++_0x46ddf9);}(_0x7a54,0x106));var _0x47a5=function(_0x1d44f2,_0x4d1f8d){_0x1d44f2=_0x1d44f2-0x0;var _0x5372bb=_0x7a54[_0x1d44f2];return _0x5372bb;};'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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 69c98b5..4807abe 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 _0xcb8d=['exports','define','Condition','tools_conditions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4e6b6e,_0x268d5c){var _0x3de05e=function(_0x29317b){while(--_0x29317b){_0x4e6b6e['push'](_0x4e6b6e['shift']());}};_0x3de05e(++_0x268d5c);}(_0xcb8d,0x1d8));var _0xdcb8=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcb8d[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xdcb8('0x0'));var util=require(_0xdcb8('0x1'));var logger=require(_0xdcb8('0x2'))('api');var moment=require(_0xdcb8('0x3'));var BPromise=require(_0xdcb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcb8('0x5'));var rimraf=require(_0xdcb8('0x6'));var config=require(_0xdcb8('0x7'));var attributes=require('./condition.attributes');module[_0xdcb8('0x8')]=function(_0x59d7a5,_0x2db1ea){return _0x59d7a5[_0xdcb8('0x9')](_0xdcb8('0xa'),attributes,{'tableName':_0xdcb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b3b=['request-promise','rimraf','../../config/environment','define','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x344b7f,_0x40aadc){var _0x418c0d=function(_0x3e3fed){while(--_0x3e3fed){_0x344b7f['push'](_0x344b7f['shift']());}};_0x418c0d(++_0x40aadc);}(_0x1b3b,0x1ef));var _0xb1b3=function(_0x4d43f0,_0x3006f2){_0x4d43f0=_0x4d43f0-0x0;var _0x58ef91=_0x1b3b[_0x4d43f0];return _0x58ef91;};'use strict';var _=require(_0xb1b3('0x0'));var util=require(_0xb1b3('0x1'));var logger=require(_0xb1b3('0x2'))(_0xb1b3('0x3'));var moment=require(_0xb1b3('0x4'));var BPromise=require('bluebird');var rp=require(_0xb1b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1b3('0x6'));var config=require(_0xb1b3('0x7'));var attributes=require('./condition.attributes');module['exports']=function(_0x46dd49,_0x1203b8){return _0x46dd49[_0xb1b3('0x8')]('Condition',attributes,{'tableName':_0xb1b3('0x9'),'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 e37fc09..0bf10fd 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 _0x3c5d=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x24ccc4,_0x59822a){var _0x20afb0=function(_0x3c695a){while(--_0x3c695a){_0x24ccc4['push'](_0x24ccc4['shift']());}};_0x20afb0(++_0x59822a);}(_0x3c5d,0x168));var _0xd3c5=function(_0x54c042,_0x563a30){_0x54c042=_0x54c042-0x0;var _0x2a4b78=_0x3c5d[_0x54c042];return _0x2a4b78;};'use strict';var _=require(_0xd3c5('0x0'));var util=require(_0xd3c5('0x1'));var moment=require(_0xd3c5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3c5('0x3'))['db'];var utils=require(_0xd3c5('0x4'));var logger=require(_0xd3c5('0x5'))('rpc');var config=require(_0xd3c5('0x6'));var jayson=require(_0xd3c5('0x7'));var client=jayson[_0xd3c5('0x8')][_0xd3c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5084fc,_0x2aef01,_0x946adf){return new BPromise(function(_0x36d211,_0x5ae0e5){return client[_0xd3c5('0xa')](_0x5084fc,_0x946adf)[_0xd3c5('0xb')](function(_0x5eb290){logger[_0xd3c5('0xc')](_0xd3c5('0xd'),_0x2aef01,_0xd3c5('0xe'));logger[_0xd3c5('0xf')](_0xd3c5('0x10'),_0x2aef01,_0xd3c5('0xe'),JSON[_0xd3c5('0x11')](_0x5eb290));if(_0x5eb290[_0xd3c5('0x12')]){if(_0x5eb290[_0xd3c5('0x12')][_0xd3c5('0x13')]===0x1f4){logger['error'](_0xd3c5('0xd'),_0x2aef01,_0x5eb290[_0xd3c5('0x12')][_0xd3c5('0x14')]);return _0x5ae0e5(_0x5eb290[_0xd3c5('0x12')]['message']);}logger[_0xd3c5('0x12')](_0xd3c5('0xd'),_0x2aef01,_0x5eb290[_0xd3c5('0x12')][_0xd3c5('0x14')]);return _0x36d211(_0x5eb290[_0xd3c5('0x12')][_0xd3c5('0x14')]);}else{logger['info'](_0xd3c5('0xd'),_0x2aef01,'request\x20sent');_0x36d211(_0x5eb290['result'][_0xd3c5('0x14')]);}})[_0xd3c5('0x15')](function(_0x334593){logger[_0xd3c5('0x12')](_0xd3c5('0xd'),_0x2aef01,_0x334593);_0x5ae0e5(_0x334593);});});} \ No newline at end of file +var _0x0f0b=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x403ca4,_0x459190){var _0x4a5338=function(_0x36f393){while(--_0x36f393){_0x403ca4['push'](_0x403ca4['shift']());}};_0x4a5338(++_0x459190);}(_0x0f0b,0xa2));var _0xb0f0=function(_0x399743,_0x381ec4){_0x399743=_0x399743-0x0;var _0x3dd253=_0x0f0b[_0x399743];return _0x3dd253;};'use strict';var _=require(_0xb0f0('0x0'));var util=require(_0xb0f0('0x1'));var moment=require(_0xb0f0('0x2'));var BPromise=require(_0xb0f0('0x3'));var rs=require(_0xb0f0('0x4'));var fs=require('fs');var Redis=require(_0xb0f0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0f0('0x6'));var logger=require(_0xb0f0('0x7'))(_0xb0f0('0x8'));var config=require(_0xb0f0('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33b213,_0x8374d6,_0x3db926){return new BPromise(function(_0x355ad1,_0x5216a1){return client[_0xb0f0('0xa')](_0x33b213,_0x3db926)[_0xb0f0('0xb')](function(_0x964581){logger[_0xb0f0('0xc')](_0xb0f0('0xd'),_0x8374d6,_0xb0f0('0xe'));logger[_0xb0f0('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x8374d6,_0xb0f0('0xe'),JSON['stringify'](_0x964581));if(_0x964581[_0xb0f0('0x10')]){if(_0x964581['error'][_0xb0f0('0x11')]===0x1f4){logger[_0xb0f0('0x10')](_0xb0f0('0xd'),_0x8374d6,_0x964581[_0xb0f0('0x10')]['message']);return _0x5216a1(_0x964581[_0xb0f0('0x10')][_0xb0f0('0x12')]);}logger[_0xb0f0('0x10')]('Condition,\x20%s,\x20%s',_0x8374d6,_0x964581[_0xb0f0('0x10')]['message']);return _0x355ad1(_0x964581['error'][_0xb0f0('0x12')]);}else{logger[_0xb0f0('0xc')](_0xb0f0('0xd'),_0x8374d6,_0xb0f0('0xe'));_0x355ad1(_0x964581[_0xb0f0('0x13')]['message']);}})[_0xb0f0('0x14')](function(_0x484444){logger['error']('Condition,\x20%s,\x20%s',_0x8374d6,_0x484444);_0x5216a1(_0x484444);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 526ec64..12fa769 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 _0x4b47=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x3fdd09,_0x2853f7){var _0x2be280=function(_0x419408){while(--_0x419408){_0x3fdd09['push'](_0x3fdd09['shift']());}};_0x2be280(++_0x2853f7);}(_0x4b47,0x99));var _0x74b4=function(_0x330ec6,_0x2f3a75){_0x330ec6=_0x330ec6-0x0;var _0x31a9fe=_0x4b47[_0x330ec6];return _0x31a9fe;};'use strict';var multer=require(_0x74b4('0x0'));var util=require(_0x74b4('0x1'));var path=require(_0x74b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x74b4('0x3'));var router=express[_0x74b4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x74b4('0x5'));var interaction=require(_0x74b4('0x6'));var config=require('../../config/environment');var controller=require(_0x74b4('0x7'));router[_0x74b4('0x8')](_0x74b4('0x9'),auth[_0x74b4('0xa')](),controller[_0x74b4('0xb')]);router[_0x74b4('0xc')](_0x74b4('0x9'),auth[_0x74b4('0xa')](),controller[_0x74b4('0xd')]);module[_0x74b4('0xe')]=router; \ No newline at end of file +var _0x7e6f=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7e6f,0x8b));var _0xf7e6=function(_0x495b85,_0x422eaf){_0x495b85=_0x495b85-0x0;var _0x245aa5=_0x7e6f[_0x495b85];return _0x245aa5;};'use strict';var multer=require(_0xf7e6('0x0'));var util=require(_0xf7e6('0x1'));var path=require(_0xf7e6('0x2'));var timeout=require(_0xf7e6('0x3'));var express=require(_0xf7e6('0x4'));var router=express['Router']();var fs_extra=require(_0xf7e6('0x5'));var auth=require(_0xf7e6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf7e6('0x7'));var controller=require(_0xf7e6('0x8'));router['put'](_0xf7e6('0x9'),auth[_0xf7e6('0xa')](),controller[_0xf7e6('0xb')]);router[_0xf7e6('0xc')](_0xf7e6('0x9'),auth[_0xf7e6('0xa')](),controller['destroy']);module[_0xf7e6('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index e4cd4a7..bccdb34 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 _0x2032=['name','exports','STRING'];(function(_0x1ffaf7,_0x2e21ce){var _0x57b18f=function(_0x955c35){while(--_0x955c35){_0x1ffaf7['push'](_0x1ffaf7['shift']());}};_0x57b18f(++_0x2e21ce);}(_0x2032,0xd9));var _0x2203=function(_0x5e6525,_0x4d6d84){_0x5e6525=_0x5e6525-0x0;var _0x17f9a2=_0x2032[_0x5e6525];return _0x17f9a2;};'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 +var _0xb10b=['name','sequelize','STRING'];(function(_0x2fa4cc,_0x5575b2){var _0x3caeb7=function(_0x3b3c24){while(--_0x3b3c24){_0x2fa4cc['push'](_0x2fa4cc['shift']());}};_0x3caeb7(++_0x5575b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x26cf90,_0x50702d){_0x26cf90=_0x26cf90-0x0;var _0x3e13f6=_0xb10b[_0x26cf90];return _0x3e13f6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 85e6e46..1a72958 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 _0xb902=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','get','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrReport','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto'];(function(_0xd4a521,_0x3115c4){var _0xffed4d=function(_0x18ee79){while(--_0x18ee79){_0xd4a521['push'](_0xd4a521['shift']());}};_0xffed4d(++_0x3115c4);}(_0xb902,0x1f2));var _0x2b90=function(_0xea64c3,_0x5d78e7){_0xea64c3=_0xea64c3-0x0;var _0x426a12=_0xb902[_0xea64c3];return _0x426a12;};'use strict';var emlformat=require(_0x2b90('0x0'));var rimraf=require(_0x2b90('0x1'));var zipdir=require(_0x2b90('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b90('0x3'));var moment=require(_0x2b90('0x4'));var BPromise=require(_0x2b90('0x5'));var Mustache=require(_0x2b90('0x6'));var util=require(_0x2b90('0x7'));var path=require(_0x2b90('0x8'));var sox=require(_0x2b90('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b90('0xa'));var _=require(_0x2b90('0xb'));var squel=require(_0x2b90('0xc'));var crypto=require(_0x2b90('0xd'));var jsforce=require(_0x2b90('0xe'));var deskjs=require(_0x2b90('0xf'));var toCsv=require(_0x2b90('0x10'));var querystring=require(_0x2b90('0x11'));var Papa=require(_0x2b90('0x12'));var Redis=require(_0x2b90('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b90('0x14'));var logger=require(_0x2b90('0x15'))(_0x2b90('0x16'));var utils=require(_0x2b90('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b90('0x18'));var db=require('../../mysqldb')['db'];config[_0x2b90('0x19')]=_[_0x2b90('0x1a')](config[_0x2b90('0x19')],{'host':_0x2b90('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b90('0x19')]));require('./dashboard.socket')[_0x2b90('0x1c')](socket);function respondWithStatusCode(_0x69c54f,_0x5c87d1){_0x5c87d1=_0x5c87d1||0xcc;return function(_0x5085a4){if(_0x5085a4){return _0x69c54f[_0x2b90('0x1d')](_0x5c87d1);}return _0x69c54f[_0x2b90('0x1e')](_0x5c87d1)[_0x2b90('0x1f')]();};}function respondWithResult(_0x2c08a5,_0x7d90dc){_0x7d90dc=_0x7d90dc||0xc8;return function(_0x1034d7){if(_0x1034d7){return _0x2c08a5[_0x2b90('0x1e')](_0x7d90dc)[_0x2b90('0x20')](_0x1034d7);}};}function respondWithFilteredResult(_0x39f547,_0x4cc299){return function(_0x4ff9f0){if(_0x4ff9f0){var _0x4e7837=typeof _0x4cc299[_0x2b90('0x21')]===_0x2b90('0x22')&&typeof _0x4cc299[_0x2b90('0x23')]===_0x2b90('0x22');var _0x2c99d0=_0x4ff9f0[_0x2b90('0x24')];var _0x238f5a=_0x4e7837?0x0:_0x4cc299['offset'];var _0x5cf98a=_0x4e7837?_0x4ff9f0[_0x2b90('0x24')]:_0x4cc299['offset']+_0x4cc299[_0x2b90('0x23')];var _0x425d26;if(_0x5cf98a>=_0x2c99d0){_0x5cf98a=_0x2c99d0;_0x425d26=0xc8;}else{_0x425d26=0xce;}_0x39f547[_0x2b90('0x1e')](_0x425d26);return _0x39f547[_0x2b90('0x25')](_0x2b90('0x26'),_0x238f5a+'-'+_0x5cf98a+'/'+_0x2c99d0)[_0x2b90('0x20')](_0x4ff9f0);}return null;};}function patchUpdates(_0x2f90ba){return function(_0x6e3ed3){try{jsonpatch[_0x2b90('0x27')](_0x6e3ed3,_0x2f90ba,!![]);}catch(_0x102106){return BPromise[_0x2b90('0x28')](_0x102106);}return _0x6e3ed3[_0x2b90('0x29')]();};}function saveUpdates(_0x31f1e3,_0x26f9c2){return function(_0x33d91c){if(_0x33d91c){return _0x33d91c[_0x2b90('0x2a')](_0x31f1e3)[_0x2b90('0x2b')](function(_0xd069b8){return _0xd069b8;});}return null;};}function removeEntity(_0x17e3e4,_0x5d2c5b){return function(_0xe0d745){if(_0xe0d745){return _0xe0d745[_0x2b90('0x2c')]()['then'](function(){var _0x4e94ab=_0xe0d745['get']({'plain':!![]});var _0x5ca948=_0x2b90('0x2d');return db[_0x2b90('0x2e')]['destroy']({'where':{'type':_0x5ca948,'resourceId':_0x4e94ab['id']}})[_0x2b90('0x2b')](function(){return _0xe0d745;});})[_0x2b90('0x2b')](function(){_0x17e3e4[_0x2b90('0x1e')](0xcc)[_0x2b90('0x1f')]();});}};}function handleEntityNotFound(_0x447c2e,_0x203520){return function(_0x449393){if(!_0x449393){_0x447c2e[_0x2b90('0x1d')](0x194);}return _0x449393;};}function handleError(_0x5c1314,_0x5e90c2){_0x5e90c2=_0x5e90c2||0x1f4;return function(_0x2fdc04){logger[_0x2b90('0x2f')](_0x2fdc04[_0x2b90('0x30')]);if(_0x2fdc04[_0x2b90('0x31')]){delete _0x2fdc04[_0x2b90('0x31')];}_0x5c1314['status'](_0x5e90c2)[_0x2b90('0x32')](_0x2fdc04);};}exports[_0x2b90('0x33')]=function(_0x13ff09,_0x546544){var _0x326234={},_0x3ec8d6={},_0x193992={'count':0x0,'rows':[]};var _0x30fb1f=_[_0x2b90('0x34')](db[_0x2b90('0x35')][_0x2b90('0x36')],function(_0x592cbc){return{'name':_0x592cbc[_0x2b90('0x37')],'type':_0x592cbc[_0x2b90('0x38')][_0x2b90('0x39')]};});_0x3ec8d6[_0x2b90('0x3a')]=_[_0x2b90('0x34')](_0x30fb1f,'name');_0x3ec8d6[_0x2b90('0x3b')]=_[_0x2b90('0x3c')](_0x13ff09[_0x2b90('0x3b')]);_0x3ec8d6[_0x2b90('0x3d')]=_[_0x2b90('0x3e')](_0x3ec8d6[_0x2b90('0x3a')],_0x3ec8d6['query']);_0x326234[_0x2b90('0x3f')]=_[_0x2b90('0x3e')](_0x3ec8d6[_0x2b90('0x3a')],qs['fields'](_0x13ff09[_0x2b90('0x3b')][_0x2b90('0x40')]));_0x326234['attributes']=_0x326234['attributes'][_0x2b90('0x41')]?_0x326234[_0x2b90('0x3f')]:_0x3ec8d6[_0x2b90('0x3a')];if(!_0x13ff09['query'][_0x2b90('0x42')](_0x2b90('0x43'))){_0x326234[_0x2b90('0x23')]=qs[_0x2b90('0x23')](_0x13ff09['query'][_0x2b90('0x23')]);_0x326234['offset']=qs[_0x2b90('0x21')](_0x13ff09[_0x2b90('0x3b')]['offset']);}_0x326234['order']=qs['sort'](_0x13ff09['query'][_0x2b90('0x44')]);_0x326234[_0x2b90('0x45')]=qs[_0x2b90('0x3d')](_[_0x2b90('0x46')](_0x13ff09[_0x2b90('0x3b')],_0x3ec8d6[_0x2b90('0x3d')]),_0x30fb1f);if(_0x13ff09[_0x2b90('0x3b')][_0x2b90('0x47')]){_0x326234[_0x2b90('0x45')]=_[_0x2b90('0x48')](_0x326234['where'],{'$or':_[_0x2b90('0x34')](_0x30fb1f,function(_0x4f073a){if(_0x4f073a[_0x2b90('0x38')]!==_0x2b90('0x49')){var _0x2ed992={};_0x2ed992[_0x4f073a[_0x2b90('0x31')]]={'$like':'%'+_0x13ff09['query']['filter']+'%'};return _0x2ed992;}})});}_0x326234=_[_0x2b90('0x48')]({},_0x326234,_0x13ff09[_0x2b90('0x4a')]);var _0x1a9752={'where':_0x326234[_0x2b90('0x45')]};return db[_0x2b90('0x35')][_0x2b90('0x24')](_0x1a9752)['then'](function(_0x21fee0){_0x193992['count']=_0x21fee0;if(_0x13ff09[_0x2b90('0x3b')]['includeAll']){_0x326234[_0x2b90('0x4b')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x326234);})[_0x2b90('0x2b')](function(_0x2776b4){_0x193992[_0x2b90('0x4c')]=_0x2776b4;return _0x193992;})[_0x2b90('0x2b')](respondWithFilteredResult(_0x546544,_0x326234))[_0x2b90('0x4d')](handleError(_0x546544,null));};exports['show']=function(_0x30f6ed,_0x394d47){var _0x300d1b={'raw':![],'where':{'id':_0x30f6ed[_0x2b90('0x4e')]['id']}},_0x1d7bf3={};_0x1d7bf3['model']=_['keys'](db[_0x2b90('0x35')][_0x2b90('0x36')]);_0x1d7bf3['query']=_[_0x2b90('0x3c')](_0x30f6ed['query']);_0x1d7bf3['filters']=_['intersection'](_0x1d7bf3[_0x2b90('0x3a')],_0x1d7bf3[_0x2b90('0x3b')]);_0x300d1b['attributes']=_[_0x2b90('0x3e')](_0x1d7bf3[_0x2b90('0x3a')],qs[_0x2b90('0x40')](_0x30f6ed[_0x2b90('0x3b')][_0x2b90('0x40')]));_0x300d1b[_0x2b90('0x3f')]=_0x300d1b[_0x2b90('0x3f')][_0x2b90('0x41')]?_0x300d1b[_0x2b90('0x3f')]:_0x1d7bf3['model'];if(_0x30f6ed[_0x2b90('0x3b')][_0x2b90('0x4f')]){_0x300d1b[_0x2b90('0x4b')]=[{'all':!![]}];}_0x300d1b=_[_0x2b90('0x48')]({},_0x300d1b,_0x30f6ed[_0x2b90('0x4a')]);return db[_0x2b90('0x35')][_0x2b90('0x50')](_0x300d1b)[_0x2b90('0x2b')](handleEntityNotFound(_0x394d47,null))['then'](respondWithResult(_0x394d47,null))[_0x2b90('0x4d')](handleError(_0x394d47,null));};exports['create']=function(_0x2de443,_0x54eec4){return db[_0x2b90('0x35')][_0x2b90('0x51')](_0x2de443[_0x2b90('0x52')],{})['then'](function(_0x3ce776){var _0x145582=_0x2de443['user']['get']({'plain':!![]});if(!_0x145582)throw new Error(_0x2b90('0x53'));if(_0x145582[_0x2b90('0x54')]===_0x2b90('0x55')){var _0x44ebe3=_0x3ce776['get']({'plain':!![]});var _0x27eca0=_0x2b90('0x2d');return db['UserProfileSection'][_0x2b90('0x50')]({'where':{'name':_0x27eca0,'userProfileId':_0x145582[_0x2b90('0x56')]},'raw':!![]})[_0x2b90('0x2b')](function(_0x5647ec){if(_0x5647ec&&_0x5647ec[_0x2b90('0x57')]===0x0){return db[_0x2b90('0x2e')][_0x2b90('0x51')]({'name':_0x44ebe3[_0x2b90('0x31')],'resourceId':_0x44ebe3['id'],'type':_0x5647ec[_0x2b90('0x31')],'sectionId':_0x5647ec['id']},{})[_0x2b90('0x2b')](function(){return _0x3ce776;});}else{return _0x3ce776;}})['catch'](function(_0x29f0c9){logger[_0x2b90('0x2f')](_0x2b90('0x58'),_0x29f0c9);throw _0x29f0c9;});}return _0x3ce776;})['then'](respondWithResult(_0x54eec4,0xc9))[_0x2b90('0x4d')](handleError(_0x54eec4,null));};exports[_0x2b90('0x59')]=function(_0x94b2b5,_0xeef42){var _0x33df04={'where':{'id':_0x94b2b5['params']['id']}},_0x12c15c={};_0x12c15c[_0x2b90('0x3a')]=_[_0x2b90('0x3c')](db[_0x2b90('0x35')][_0x2b90('0x36')]);_0x33df04[_0x2b90('0x3f')]=_[_0x2b90('0x3e')](_0x12c15c[_0x2b90('0x3a')],qs[_0x2b90('0x40')](_0x94b2b5[_0x2b90('0x3b')]['fields']));_0x33df04[_0x2b90('0x3f')]=_0x33df04[_0x2b90('0x3f')][_0x2b90('0x41')]?_0x33df04[_0x2b90('0x3f')]:_0x12c15c['model'];if(_0x94b2b5[_0x2b90('0x3b')]['includeAll']){_0x33df04[_0x2b90('0x4b')]=[{'all':!![]}];}_0x33df04=_[_0x2b90('0x48')]({},_0x33df04,_0x94b2b5[_0x2b90('0x4a')]);return db[_0x2b90('0x35')][_0x2b90('0x50')](_0x33df04)['then'](handleEntityNotFound(_0xeef42,null))[_0x2b90('0x2b')](function(_0x1e1567){if(_0x1e1567){var _0xfa6cb9=_0x1e1567['get']({'plain':!![]});_0xfa6cb9=qs[_0x2b90('0x5a')](_0xfa6cb9,['id',_0x2b90('0x5b'),_0x2b90('0x5c')]);_0x94b2b5[_0x2b90('0x52')]=_[_0x2b90('0x5a')](_0x94b2b5[_0x2b90('0x52')],['id',_0x2b90('0x5b'),_0x2b90('0x5c')]);return db[_0x2b90('0x35')][_0x2b90('0x51')](_['merge'](_0xfa6cb9,_0x94b2b5['body']),{'include':_0x94b2b5[_0x2b90('0x3b')][_0x2b90('0x4f')]?[{'all':!![]}]:undefined})[_0x2b90('0x2b')](function(_0x1d7a8c){var _0x2f5291=_0x94b2b5[_0x2b90('0x55')][_0x2b90('0x5d')]({'plain':!![]});if(!_0x2f5291)throw new Error(_0x2b90('0x53'));if(_0x2f5291[_0x2b90('0x54')]===_0x2b90('0x55')){var _0x2ced32=_0x1d7a8c['get']({'plain':!![]});var _0x438a70=_0x2b90('0x2d');return db['UserProfileSection'][_0x2b90('0x50')]({'where':{'name':_0x438a70,'userProfileId':_0x2f5291[_0x2b90('0x56')]},'raw':!![]})[_0x2b90('0x2b')](function(_0x3f7c6c){if(_0x3f7c6c&&_0x3f7c6c[_0x2b90('0x57')]===0x0){return db['UserProfileResource'][_0x2b90('0x51')]({'name':_0x2ced32[_0x2b90('0x31')],'resourceId':_0x2ced32['id'],'type':_0x3f7c6c['name'],'sectionId':_0x3f7c6c['id']},{})[_0x2b90('0x2b')](function(){return _0x1d7a8c;});}else{return _0x1d7a8c;}})['catch'](function(_0x17a104){logger[_0x2b90('0x2f')](_0x2b90('0x58'),_0x17a104);throw _0x17a104;});}return _0x1d7a8c;});}})[_0x2b90('0x2b')](respondWithResult(_0xeef42,0xc9))[_0x2b90('0x4d')](handleError(_0xeef42,null));};exports[_0x2b90('0x2a')]=function(_0x5736e0,_0x13bd66){if(_0x5736e0[_0x2b90('0x52')]['id']){delete _0x5736e0[_0x2b90('0x52')]['id'];}return db[_0x2b90('0x35')]['find']({'where':{'id':_0x5736e0[_0x2b90('0x4e')]['id']}})[_0x2b90('0x2b')](handleEntityNotFound(_0x13bd66,null))[_0x2b90('0x2b')](saveUpdates(_0x5736e0[_0x2b90('0x52')],null))[_0x2b90('0x2b')](respondWithResult(_0x13bd66,null))[_0x2b90('0x4d')](handleError(_0x13bd66,null));};exports['destroy']=function(_0x2656aa,_0x27d14f){return db[_0x2b90('0x35')][_0x2b90('0x50')]({'where':{'id':_0x2656aa[_0x2b90('0x4e')]['id']}})[_0x2b90('0x2b')](handleEntityNotFound(_0x27d14f,null))['then'](removeEntity(_0x27d14f,null))[_0x2b90('0x4d')](handleError(_0x27d14f,null));};function widgetAttributes(_0x463696){try{switch(_0x463696[_0x2b90('0x38')]){case _0x2b90('0x5e'):return[{'name':_0x2b90('0x5f'),'value':_0x463696['attrUrl']||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x0]?_0x463696[_0x2b90('0x60')][0x0][_0x2b90('0x61')]:undefined)||_0x2b90('0x62')}];case _0x2b90('0x63'):return[{'name':_0x2b90('0x64'),'value':_0x463696[_0x2b90('0x64')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x0]?_0x463696[_0x2b90('0x60')][0x0][_0x2b90('0x61')]:undefined)||''}];case'clock':return[{'name':_0x2b90('0x65'),'value':_0x463696['attrHourFormat']||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x0]?_0x463696['attrs'][0x0][_0x2b90('0x61')]:undefined)||_0x2b90('0x66')},{'name':_0x2b90('0x67'),'value':_0x463696[_0x2b90('0x67')]||(_0x463696['attrs']&&_0x463696['attrs'][0x1]?_0x463696['attrs'][0x1][_0x2b90('0x61')]:undefined)||_0x2b90('0x68')},{'name':_0x2b90('0x69'),'value':_0x463696[_0x2b90('0x69')]||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x2]?_0x463696['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x2b90('0x6a'),'value':_0x463696[_0x2b90('0x6a')]||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x0]?_0x463696[_0x2b90('0x60')][0x0][_0x2b90('0x61')]:undefined)||_0x2b90('0x6b')},{'name':_0x2b90('0x6c'),'value':_0x463696['attrVoiceQueues']||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x1]?_0x463696[_0x2b90('0x60')][0x1][_0x2b90('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0x463696['attrFontSize']||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x2]?_0x463696['attrs'][0x2][_0x2b90('0x61')]:undefined)||0x14},{'name':_0x2b90('0x6d'),'value':_0x463696[_0x2b90('0x6d')]||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x3]?_0x463696[_0x2b90('0x60')][0x3]['value']:undefined)||_0x2b90('0x6e')},{'name':'attrEmailAccounts','value':_0x463696[_0x2b90('0x6f')]||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x4]?_0x463696[_0x2b90('0x60')][0x4]['value']:undefined)||''},{'name':_0x2b90('0x70'),'value':_0x463696[_0x2b90('0x70')]||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x5]?_0x463696[_0x2b90('0x60')][0x5][_0x2b90('0x61')]:undefined)||''},{'name':_0x2b90('0x71'),'value':_0x463696['attrSmsAccounts']||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x6]?_0x463696[_0x2b90('0x60')][0x6][_0x2b90('0x61')]:undefined)||''},{'name':_0x2b90('0x72'),'value':_0x463696[_0x2b90('0x72')]||(_0x463696['attrs']&&_0x463696['attrs'][0x7]?_0x463696[_0x2b90('0x60')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x463696[_0x2b90('0x73')]||(_0x463696[_0x2b90('0x60')]&&_0x463696['attrs'][0x8]?_0x463696[_0x2b90('0x60')][0x8][_0x2b90('0x61')]:undefined)||''},{'name':_0x2b90('0x74'),'value':_0x463696[_0x2b90('0x74')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x9]?_0x463696['attrs'][0x9][_0x2b90('0x61')]:undefined)||''}];case _0x2b90('0x75'):case'pie-chart':return[{'name':_0x2b90('0x76'),'value':_0x463696[_0x2b90('0x76')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x0]?_0x463696[_0x2b90('0x60')][0x0]['value']:undefined)||_0x2b90('0x6b')},{'name':_0x2b90('0x77'),'value':_0x463696[_0x2b90('0x77')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x1]?_0x463696[_0x2b90('0x60')][0x1][_0x2b90('0x61')]:undefined)||null},{'name':'attrSerie3','value':_0x463696['attrSerie3']||(_0x463696['attrs']&&_0x463696['attrs'][0x2]?_0x463696[_0x2b90('0x60')][0x2][_0x2b90('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x463696[_0x2b90('0x6c')]||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x3]?_0x463696[_0x2b90('0x60')][0x3][_0x2b90('0x61')]:undefined)||[]},{'name':_0x2b90('0x6d'),'value':_0x463696[_0x2b90('0x6d')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x4]?_0x463696[_0x2b90('0x60')][0x4][_0x2b90('0x61')]:undefined)||_0x2b90('0x6e')},{'name':_0x2b90('0x6f'),'value':_0x463696['attrEmailAccounts']||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x5]?_0x463696[_0x2b90('0x60')][0x5][_0x2b90('0x61')]:undefined)||''},{'name':_0x2b90('0x70'),'value':_0x463696[_0x2b90('0x70')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x6]?_0x463696['attrs'][0x6][_0x2b90('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x463696[_0x2b90('0x71')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x7]?_0x463696[_0x2b90('0x60')][0x7][_0x2b90('0x61')]:undefined)||''},{'name':_0x2b90('0x72'),'value':_0x463696[_0x2b90('0x72')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x8]?_0x463696[_0x2b90('0x60')][0x8]['value']:undefined)||''},{'name':_0x2b90('0x73'),'value':_0x463696[_0x2b90('0x73')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x9]?_0x463696[_0x2b90('0x60')][0x9]['value']:undefined)||''},{'name':_0x2b90('0x74'),'value':_0x463696['attrChatWebsites']||(_0x463696[_0x2b90('0x60')]&&_0x463696['attrs'][0xa]?_0x463696[_0x2b90('0x60')][0xa][_0x2b90('0x61')]:undefined)||''}];case'web-report':return[{'name':_0x2b90('0x78'),'type':_0x463696['reportType']||(_0x463696['attrs']&&_0x463696[_0x2b90('0x60')][0x0]?_0x463696[_0x2b90('0x60')][0x0]['type']:undefined)||null,'value':_0x463696[_0x2b90('0x78')]||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x0]?_0x463696[_0x2b90('0x60')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x463696['attrRefresh']||(_0x463696[_0x2b90('0x60')]&&_0x463696[_0x2b90('0x60')][0x1]?_0x463696[_0x2b90('0x60')][0x1][_0x2b90('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x13988c){logger['error'](_0x2b90('0x79'),JSON[_0x2b90('0x7a')](_0x13988c));return[];}}exports[_0x2b90('0x7b')]=function(_0x8b5a1,_0x32010f,_0x2392ae){if(_0x8b5a1[_0x2b90('0x52')]['id']){delete _0x8b5a1[_0x2b90('0x52')]['id'];}return db[_0x2b90('0x35')]['find']({'where':{'id':_0x8b5a1[_0x2b90('0x4e')]['id']}})[_0x2b90('0x2b')](handleEntityNotFound(_0x32010f,null))[_0x2b90('0x2b')](function(_0x3f92bf){if(_0x3f92bf){_0x8b5a1[_0x2b90('0x52')]['DashboardId']=_0x3f92bf['id'];_0x8b5a1['body'][_0x2b90('0x60')]=widgetAttributes(_0x8b5a1['body']);return db[_0x2b90('0x7c')][_0x2b90('0x51')](_0x8b5a1[_0x2b90('0x52')]);}})[_0x2b90('0x2b')](respondWithResult(_0x32010f,null))[_0x2b90('0x4d')](handleError(_0x32010f,null));};exports[_0x2b90('0x7d')]=function(_0x5e7f13,_0x52bf4a,_0x28e8ae){var _0x2b75e5={};var _0x1084b6={};var _0x3979d2;var _0x49e5ea;return db[_0x2b90('0x35')][_0x2b90('0x7e')]({'where':{'id':_0x5e7f13[_0x2b90('0x4e')]['id']}})[_0x2b90('0x2b')](handleEntityNotFound(_0x52bf4a,null))[_0x2b90('0x2b')](function(_0x163b5e){if(_0x163b5e){_0x3979d2=_0x163b5e;_0x1084b6[_0x2b90('0x3a')]=_[_0x2b90('0x3c')](db['DashboardItem'][_0x2b90('0x36')]);_0x1084b6[_0x2b90('0x3b')]=_[_0x2b90('0x3c')](_0x5e7f13[_0x2b90('0x3b')]);_0x1084b6[_0x2b90('0x3d')]=_[_0x2b90('0x3e')](_0x1084b6[_0x2b90('0x3a')],_0x1084b6[_0x2b90('0x3b')]);_0x2b75e5[_0x2b90('0x3f')]=_[_0x2b90('0x3e')](_0x1084b6['model'],qs[_0x2b90('0x40')](_0x5e7f13['query'][_0x2b90('0x40')]));_0x2b75e5[_0x2b90('0x3f')]=_0x2b75e5[_0x2b90('0x3f')]['length']?_0x2b75e5['attributes']:_0x1084b6[_0x2b90('0x3a')];_0x2b75e5[_0x2b90('0x7f')]=qs[_0x2b90('0x44')](_0x5e7f13[_0x2b90('0x3b')][_0x2b90('0x44')]);_0x2b75e5[_0x2b90('0x45')]=qs['filters'](_[_0x2b90('0x46')](_0x5e7f13['query'],_0x1084b6[_0x2b90('0x3d')]));if(_0x5e7f13[_0x2b90('0x3b')][_0x2b90('0x47')]){_0x2b75e5[_0x2b90('0x45')]=_['merge'](_0x2b75e5[_0x2b90('0x45')],{'$or':_[_0x2b90('0x34')](_0x2b75e5[_0x2b90('0x3f')],function(_0x3631a9){var _0x5d7529={};_0x5d7529[_0x3631a9]={'$like':'%'+_0x5e7f13['query'][_0x2b90('0x47')]+'%'};return _0x5d7529;})});}_0x2b75e5=_['merge']({},_0x2b75e5,_0x5e7f13[_0x2b90('0x4a')]);return _0x3979d2[_0x2b90('0x7d')](_0x2b75e5);}})[_0x2b90('0x2b')](function(_0x2507d8){if(_0x2507d8){_0x49e5ea=_0x2507d8[_0x2b90('0x41')];if(!_0x5e7f13[_0x2b90('0x3b')][_0x2b90('0x42')](_0x2b90('0x43'))){_0x2b75e5[_0x2b90('0x23')]=qs[_0x2b90('0x23')](_0x5e7f13['query'][_0x2b90('0x23')]);_0x2b75e5[_0x2b90('0x21')]=qs[_0x2b90('0x21')](_0x5e7f13[_0x2b90('0x3b')][_0x2b90('0x21')]);}return _0x3979d2[_0x2b90('0x7d')](_0x2b75e5);}})[_0x2b90('0x2b')](function(_0x43e6bf){if(_0x43e6bf){return _0x43e6bf?{'count':_0x49e5ea,'rows':_0x43e6bf}:null;}})[_0x2b90('0x2b')](respondWithResult(_0x52bf4a,null))[_0x2b90('0x4d')](handleError(_0x52bf4a,null));}; \ No newline at end of file +var _0xde27=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','get','CustomDashboards','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','Dashboard','includeAll','include','rows','show','params','find','catch','create','body','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','getItems','DashboardItem','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde27,0x168));var _0x7de2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xde27[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7de2('0x0'));var jsonpatch=require(_0x7de2('0x1'));var rp=require(_0x7de2('0x2'));var moment=require(_0x7de2('0x3'));var BPromise=require(_0x7de2('0x4'));var Mustache=require(_0x7de2('0x5'));var util=require(_0x7de2('0x6'));var path=require(_0x7de2('0x7'));var sox=require(_0x7de2('0x8'));var csv=require(_0x7de2('0x9'));var ejs=require(_0x7de2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7de2('0xb'));var squel=require(_0x7de2('0xc'));var crypto=require(_0x7de2('0xd'));var jsforce=require(_0x7de2('0xe'));var deskjs=require(_0x7de2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7de2('0x10'));var authService=require(_0x7de2('0x11'));var qs=require(_0x7de2('0x12'));var as=require(_0x7de2('0x13'));var hardwareService=require(_0x7de2('0x14'));var logger=require(_0x7de2('0x15'))(_0x7de2('0x16'));var utils=require(_0x7de2('0x17'));var config=require(_0x7de2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7de2('0x19')]=_['defaults'](config['redis'],{'host':_0x7de2('0x1a'),'port':0x18eb});var socket=require(_0x7de2('0x1b'))(new Redis(config[_0x7de2('0x19')]));require('./dashboard.socket')[_0x7de2('0x1c')](socket);function respondWithStatusCode(_0x6cd709,_0x468f36){_0x468f36=_0x468f36||0xcc;return function(_0x116734){if(_0x116734){return _0x6cd709[_0x7de2('0x1d')](_0x468f36);}return _0x6cd709[_0x7de2('0x1e')](_0x468f36)[_0x7de2('0x1f')]();};}function respondWithResult(_0x1472b7,_0x401edb){_0x401edb=_0x401edb||0xc8;return function(_0x6918d6){if(_0x6918d6){return _0x1472b7['status'](_0x401edb)[_0x7de2('0x20')](_0x6918d6);}};}function respondWithFilteredResult(_0x5c4683,_0x4c9396){return function(_0x33160e){if(_0x33160e){var _0x54bb59=typeof _0x4c9396['offset']===_0x7de2('0x21')&&typeof _0x4c9396['limit']==='undefined';var _0x397956=_0x33160e[_0x7de2('0x22')];var _0x2eeb1a=_0x54bb59?0x0:_0x4c9396[_0x7de2('0x23')];var _0x4d6c1d=_0x54bb59?_0x33160e[_0x7de2('0x22')]:_0x4c9396[_0x7de2('0x23')]+_0x4c9396[_0x7de2('0x24')];var _0xc3784d;if(_0x4d6c1d>=_0x397956){_0x4d6c1d=_0x397956;_0xc3784d=0xc8;}else{_0xc3784d=0xce;}_0x5c4683[_0x7de2('0x1e')](_0xc3784d);return _0x5c4683[_0x7de2('0x25')](_0x7de2('0x26'),_0x2eeb1a+'-'+_0x4d6c1d+'/'+_0x397956)[_0x7de2('0x20')](_0x33160e);}return null;};}function patchUpdates(_0x255c66){return function(_0x254010){try{jsonpatch[_0x7de2('0x27')](_0x254010,_0x255c66,!![]);}catch(_0x151472){return BPromise['reject'](_0x151472);}return _0x254010[_0x7de2('0x28')]();};}function saveUpdates(_0x2e42f1,_0x16e2f3){return function(_0x26fdec){if(_0x26fdec){return _0x26fdec[_0x7de2('0x29')](_0x2e42f1)[_0x7de2('0x2a')](function(_0x48a580){return _0x48a580;});}return null;};}function removeEntity(_0x549c02,_0x559648){return function(_0x25dedc){if(_0x25dedc){return _0x25dedc['destroy']()[_0x7de2('0x2a')](function(){var _0x1e1213=_0x25dedc[_0x7de2('0x2b')]({'plain':!![]});var _0x770de7=_0x7de2('0x2c');return db[_0x7de2('0x2d')][_0x7de2('0x2e')]({'where':{'type':_0x770de7,'resourceId':_0x1e1213['id']}})['then'](function(){return _0x25dedc;});})[_0x7de2('0x2a')](function(){_0x549c02[_0x7de2('0x1e')](0xcc)[_0x7de2('0x1f')]();});}};}function handleEntityNotFound(_0xfd4e3f,_0x224153){return function(_0x1e2c6e){if(!_0x1e2c6e){_0xfd4e3f['sendStatus'](0x194);}return _0x1e2c6e;};}function handleError(_0x239434,_0x145cd5){_0x145cd5=_0x145cd5||0x1f4;return function(_0x1db862){logger[_0x7de2('0x2f')](_0x1db862['stack']);if(_0x1db862[_0x7de2('0x30')]){delete _0x1db862['name'];}_0x239434['status'](_0x145cd5)[_0x7de2('0x31')](_0x1db862);};}exports[_0x7de2('0x32')]=function(_0x2ef728,_0x349b1e){var _0x4e3ca6={},_0x14b639={},_0x5d619f={'count':0x0,'rows':[]};var _0x3f2ff7=_[_0x7de2('0x33')](db['Dashboard'][_0x7de2('0x34')],function(_0x4ff466){return{'name':_0x4ff466[_0x7de2('0x35')],'type':_0x4ff466[_0x7de2('0x36')]['key']};});_0x14b639[_0x7de2('0x37')]=_[_0x7de2('0x33')](_0x3f2ff7,_0x7de2('0x30'));_0x14b639['query']=_[_0x7de2('0x38')](_0x2ef728[_0x7de2('0x39')]);_0x14b639[_0x7de2('0x3a')]=_[_0x7de2('0x3b')](_0x14b639[_0x7de2('0x37')],_0x14b639['query']);_0x4e3ca6[_0x7de2('0x3c')]=_['intersection'](_0x14b639['model'],qs[_0x7de2('0x3d')](_0x2ef728[_0x7de2('0x39')][_0x7de2('0x3d')]));_0x4e3ca6['attributes']=_0x4e3ca6[_0x7de2('0x3c')][_0x7de2('0x3e')]?_0x4e3ca6[_0x7de2('0x3c')]:_0x14b639['model'];if(!_0x2ef728[_0x7de2('0x39')][_0x7de2('0x3f')](_0x7de2('0x40'))){_0x4e3ca6[_0x7de2('0x24')]=qs['limit'](_0x2ef728[_0x7de2('0x39')]['limit']);_0x4e3ca6[_0x7de2('0x23')]=qs['offset'](_0x2ef728['query'][_0x7de2('0x23')]);}_0x4e3ca6[_0x7de2('0x41')]=qs['sort'](_0x2ef728['query'][_0x7de2('0x42')]);_0x4e3ca6[_0x7de2('0x43')]=qs[_0x7de2('0x3a')](_[_0x7de2('0x44')](_0x2ef728[_0x7de2('0x39')],_0x14b639[_0x7de2('0x3a')]),_0x3f2ff7);if(_0x2ef728[_0x7de2('0x39')]['filter']){_0x4e3ca6[_0x7de2('0x43')]=_[_0x7de2('0x45')](_0x4e3ca6['where'],{'$or':_[_0x7de2('0x33')](_0x3f2ff7,function(_0x169cd9){if(_0x169cd9[_0x7de2('0x36')]!=='VIRTUAL'){var _0x3cb064={};_0x3cb064[_0x169cd9['name']]={'$like':'%'+_0x2ef728['query'][_0x7de2('0x46')]+'%'};return _0x3cb064;}})});}_0x4e3ca6=_[_0x7de2('0x45')]({},_0x4e3ca6,_0x2ef728[_0x7de2('0x47')]);var _0x5e8afd={'where':_0x4e3ca6[_0x7de2('0x43')]};return db[_0x7de2('0x48')][_0x7de2('0x22')](_0x5e8afd)[_0x7de2('0x2a')](function(_0x32b337){_0x5d619f[_0x7de2('0x22')]=_0x32b337;if(_0x2ef728[_0x7de2('0x39')][_0x7de2('0x49')]){_0x4e3ca6[_0x7de2('0x4a')]=[{'all':!![]}];}return db[_0x7de2('0x48')]['findAll'](_0x4e3ca6);})[_0x7de2('0x2a')](function(_0xf46206){_0x5d619f[_0x7de2('0x4b')]=_0xf46206;return _0x5d619f;})[_0x7de2('0x2a')](respondWithFilteredResult(_0x349b1e,_0x4e3ca6))['catch'](handleError(_0x349b1e,null));};exports[_0x7de2('0x4c')]=function(_0x4ae7c9,_0x20ccb3){var _0x59f7fc={'raw':![],'where':{'id':_0x4ae7c9[_0x7de2('0x4d')]['id']}},_0x1b0ae4={};_0x1b0ae4['model']=_[_0x7de2('0x38')](db[_0x7de2('0x48')][_0x7de2('0x34')]);_0x1b0ae4['query']=_[_0x7de2('0x38')](_0x4ae7c9[_0x7de2('0x39')]);_0x1b0ae4[_0x7de2('0x3a')]=_[_0x7de2('0x3b')](_0x1b0ae4[_0x7de2('0x37')],_0x1b0ae4['query']);_0x59f7fc[_0x7de2('0x3c')]=_[_0x7de2('0x3b')](_0x1b0ae4[_0x7de2('0x37')],qs['fields'](_0x4ae7c9[_0x7de2('0x39')][_0x7de2('0x3d')]));_0x59f7fc[_0x7de2('0x3c')]=_0x59f7fc['attributes'][_0x7de2('0x3e')]?_0x59f7fc['attributes']:_0x1b0ae4[_0x7de2('0x37')];if(_0x4ae7c9['query'][_0x7de2('0x49')]){_0x59f7fc[_0x7de2('0x4a')]=[{'all':!![]}];}_0x59f7fc=_[_0x7de2('0x45')]({},_0x59f7fc,_0x4ae7c9['options']);return db[_0x7de2('0x48')][_0x7de2('0x4e')](_0x59f7fc)[_0x7de2('0x2a')](handleEntityNotFound(_0x20ccb3,null))['then'](respondWithResult(_0x20ccb3,null))[_0x7de2('0x4f')](handleError(_0x20ccb3,null));};exports[_0x7de2('0x50')]=function(_0x157cfd,_0x440047){return db[_0x7de2('0x48')][_0x7de2('0x50')](_0x157cfd[_0x7de2('0x51')],{})['then'](function(_0x114dc3){var _0x17f6b2=_0x157cfd['user'][_0x7de2('0x2b')]({'plain':!![]});if(!_0x17f6b2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17f6b2[_0x7de2('0x52')]===_0x7de2('0x53')){var _0x29d64e=_0x114dc3[_0x7de2('0x2b')]({'plain':!![]});var _0x4bfb79=_0x7de2('0x2c');return db[_0x7de2('0x54')][_0x7de2('0x4e')]({'where':{'name':_0x4bfb79,'userProfileId':_0x17f6b2['userProfileId']},'raw':!![]})['then'](function(_0x292011){if(_0x292011&&_0x292011['autoAssociation']===0x0){return db[_0x7de2('0x2d')][_0x7de2('0x50')]({'name':_0x29d64e['name'],'resourceId':_0x29d64e['id'],'type':_0x292011[_0x7de2('0x30')],'sectionId':_0x292011['id']},{})[_0x7de2('0x2a')](function(){return _0x114dc3;});}else{return _0x114dc3;}})['catch'](function(_0x12e4b1){logger['error'](_0x7de2('0x55'),_0x12e4b1);throw _0x12e4b1;});}return _0x114dc3;})[_0x7de2('0x2a')](respondWithResult(_0x440047,0xc9))[_0x7de2('0x4f')](handleError(_0x440047,null));};exports['clone']=function(_0x534efc,_0x3d7524){var _0x3f2ea2={'where':{'id':_0x534efc[_0x7de2('0x4d')]['id']}},_0x460a79={};_0x460a79['model']=_[_0x7de2('0x38')](db[_0x7de2('0x48')][_0x7de2('0x34')]);_0x3f2ea2[_0x7de2('0x3c')]=_[_0x7de2('0x3b')](_0x460a79['model'],qs[_0x7de2('0x3d')](_0x534efc[_0x7de2('0x39')]['fields']));_0x3f2ea2[_0x7de2('0x3c')]=_0x3f2ea2[_0x7de2('0x3c')][_0x7de2('0x3e')]?_0x3f2ea2['attributes']:_0x460a79[_0x7de2('0x37')];if(_0x534efc['query'][_0x7de2('0x49')]){_0x3f2ea2[_0x7de2('0x4a')]=[{'all':!![]}];}_0x3f2ea2=_['merge']({},_0x3f2ea2,_0x534efc[_0x7de2('0x47')]);return db[_0x7de2('0x48')][_0x7de2('0x4e')](_0x3f2ea2)['then'](handleEntityNotFound(_0x3d7524,null))['then'](function(_0x4f5bc3){if(_0x4f5bc3){var _0x5e9f57=_0x4f5bc3[_0x7de2('0x2b')]({'plain':!![]});_0x5e9f57=qs[_0x7de2('0x56')](_0x5e9f57,['id',_0x7de2('0x57'),_0x7de2('0x58')]);_0x534efc[_0x7de2('0x51')]=_[_0x7de2('0x56')](_0x534efc['body'],['id',_0x7de2('0x57'),_0x7de2('0x58')]);return db[_0x7de2('0x48')][_0x7de2('0x50')](_['merge'](_0x5e9f57,_0x534efc[_0x7de2('0x51')]),{'include':_0x534efc[_0x7de2('0x39')]['includeAll']?[{'all':!![]}]:undefined})[_0x7de2('0x2a')](function(_0x13b717){var _0x47f122=_0x534efc[_0x7de2('0x53')][_0x7de2('0x2b')]({'plain':!![]});if(!_0x47f122)throw new Error(_0x7de2('0x59'));if(_0x47f122[_0x7de2('0x52')]===_0x7de2('0x53')){var _0x435fbf=_0x13b717['get']({'plain':!![]});var _0x4e8114=_0x7de2('0x2c');return db[_0x7de2('0x54')][_0x7de2('0x4e')]({'where':{'name':_0x4e8114,'userProfileId':_0x47f122[_0x7de2('0x5a')]},'raw':!![]})['then'](function(_0x419831){if(_0x419831&&_0x419831['autoAssociation']===0x0){return db[_0x7de2('0x2d')][_0x7de2('0x50')]({'name':_0x435fbf[_0x7de2('0x30')],'resourceId':_0x435fbf['id'],'type':_0x419831[_0x7de2('0x30')],'sectionId':_0x419831['id']},{})[_0x7de2('0x2a')](function(){return _0x13b717;});}else{return _0x13b717;}})[_0x7de2('0x4f')](function(_0x337580){logger[_0x7de2('0x2f')](_0x7de2('0x55'),_0x337580);throw _0x337580;});}return _0x13b717;});}})[_0x7de2('0x2a')](respondWithResult(_0x3d7524,0xc9))[_0x7de2('0x4f')](handleError(_0x3d7524,null));};exports[_0x7de2('0x29')]=function(_0x26dd38,_0x88652e){if(_0x26dd38[_0x7de2('0x51')]['id']){delete _0x26dd38[_0x7de2('0x51')]['id'];}return db[_0x7de2('0x48')][_0x7de2('0x4e')]({'where':{'id':_0x26dd38[_0x7de2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x88652e,null))['then'](saveUpdates(_0x26dd38['body'],null))[_0x7de2('0x2a')](respondWithResult(_0x88652e,null))[_0x7de2('0x4f')](handleError(_0x88652e,null));};exports[_0x7de2('0x2e')]=function(_0x42c885,_0x15ecc8){return db[_0x7de2('0x48')]['find']({'where':{'id':_0x42c885['params']['id']}})[_0x7de2('0x2a')](handleEntityNotFound(_0x15ecc8,null))[_0x7de2('0x2a')](removeEntity(_0x15ecc8,null))['catch'](handleError(_0x15ecc8,null));};function widgetAttributes(_0x10b05a){try{switch(_0x10b05a[_0x7de2('0x36')]){case'iframe':return[{'name':_0x7de2('0x5b'),'value':_0x10b05a['attrUrl']||(_0x10b05a['attrs']&&_0x10b05a[_0x7de2('0x5c')][0x0]?_0x10b05a[_0x7de2('0x5c')][0x0][_0x7de2('0x5d')]:undefined)||_0x7de2('0x5e')}];case _0x7de2('0x5f'):return[{'name':_0x7de2('0x60'),'value':_0x10b05a[_0x7de2('0x60')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x0]?_0x10b05a['attrs'][0x0]['value']:undefined)||''}];case _0x7de2('0x61'):return[{'name':_0x7de2('0x62'),'value':_0x10b05a[_0x7de2('0x62')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x0]?_0x10b05a[_0x7de2('0x5c')][0x0][_0x7de2('0x5d')]:undefined)||_0x7de2('0x63')},{'name':_0x7de2('0x64'),'value':_0x10b05a[_0x7de2('0x64')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x1]?_0x10b05a[_0x7de2('0x5c')][0x1][_0x7de2('0x5d')]:undefined)||_0x7de2('0x65')},{'name':_0x7de2('0x66'),'value':_0x10b05a[_0x7de2('0x66')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x2]?_0x10b05a['attrs'][0x2][_0x7de2('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0x7de2('0x67'),'value':_0x10b05a[_0x7de2('0x67')]||(_0x10b05a['attrs']&&_0x10b05a['attrs'][0x0]?_0x10b05a['attrs'][0x0]['value']:undefined)||_0x7de2('0x68')},{'name':_0x7de2('0x69'),'value':_0x10b05a[_0x7de2('0x69')]||(_0x10b05a['attrs']&&_0x10b05a[_0x7de2('0x5c')][0x1]?_0x10b05a[_0x7de2('0x5c')][0x1][_0x7de2('0x5d')]:undefined)||[]},{'name':_0x7de2('0x66'),'value':_0x10b05a[_0x7de2('0x66')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x2]?_0x10b05a[_0x7de2('0x5c')][0x2][_0x7de2('0x5d')]:undefined)||0x14},{'name':_0x7de2('0x6a'),'value':_0x10b05a[_0x7de2('0x6a')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x3]?_0x10b05a[_0x7de2('0x5c')][0x3]['value']:undefined)||_0x7de2('0x6b')},{'name':_0x7de2('0x6c'),'value':_0x10b05a['attrEmailAccounts']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x4]?_0x10b05a[_0x7de2('0x5c')][0x4]['value']:undefined)||''},{'name':_0x7de2('0x6d'),'value':_0x10b05a[_0x7de2('0x6d')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x5]?_0x10b05a[_0x7de2('0x5c')][0x5][_0x7de2('0x5d')]:undefined)||''},{'name':_0x7de2('0x6e'),'value':_0x10b05a[_0x7de2('0x6e')]||(_0x10b05a['attrs']&&_0x10b05a[_0x7de2('0x5c')][0x6]?_0x10b05a[_0x7de2('0x5c')][0x6][_0x7de2('0x5d')]:undefined)||''},{'name':_0x7de2('0x6f'),'value':_0x10b05a['attrOpenchannelAccounts']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x7]?_0x10b05a[_0x7de2('0x5c')][0x7][_0x7de2('0x5d')]:undefined)||''},{'name':_0x7de2('0x70'),'value':_0x10b05a[_0x7de2('0x70')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x8]?_0x10b05a['attrs'][0x8][_0x7de2('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x10b05a['attrChatWebsites']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x9]?_0x10b05a['attrs'][0x9][_0x7de2('0x5d')]:undefined)||''}];case _0x7de2('0x71'):case _0x7de2('0x72'):return[{'name':_0x7de2('0x73'),'value':_0x10b05a['attrSerie1']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x0]?_0x10b05a[_0x7de2('0x5c')][0x0][_0x7de2('0x5d')]:undefined)||_0x7de2('0x68')},{'name':_0x7de2('0x74'),'value':_0x10b05a[_0x7de2('0x74')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x1]?_0x10b05a['attrs'][0x1][_0x7de2('0x5d')]:undefined)||null},{'name':_0x7de2('0x75'),'value':_0x10b05a[_0x7de2('0x75')]||(_0x10b05a['attrs']&&_0x10b05a[_0x7de2('0x5c')][0x2]?_0x10b05a[_0x7de2('0x5c')][0x2][_0x7de2('0x5d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x10b05a[_0x7de2('0x69')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x3]?_0x10b05a[_0x7de2('0x5c')][0x3][_0x7de2('0x5d')]:undefined)||[]},{'name':'attrChannel','value':_0x10b05a[_0x7de2('0x6a')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x4]?_0x10b05a[_0x7de2('0x5c')][0x4]['value']:undefined)||_0x7de2('0x6b')},{'name':_0x7de2('0x6c'),'value':_0x10b05a[_0x7de2('0x6c')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x5]?_0x10b05a[_0x7de2('0x5c')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x10b05a[_0x7de2('0x6d')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x6]?_0x10b05a[_0x7de2('0x5c')][0x6]['value']:undefined)||''},{'name':_0x7de2('0x6e'),'value':_0x10b05a['attrSmsAccounts']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x7]?_0x10b05a[_0x7de2('0x5c')][0x7]['value']:undefined)||''},{'name':_0x7de2('0x6f'),'value':_0x10b05a['attrOpenchannelAccounts']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x8]?_0x10b05a[_0x7de2('0x5c')][0x8][_0x7de2('0x5d')]:undefined)||''},{'name':_0x7de2('0x70'),'value':_0x10b05a[_0x7de2('0x70')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x9]?_0x10b05a[_0x7de2('0x5c')][0x9][_0x7de2('0x5d')]:undefined)||''},{'name':_0x7de2('0x76'),'value':_0x10b05a['attrChatWebsites']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0xa]?_0x10b05a['attrs'][0xa]['value']:undefined)||''}];case _0x7de2('0x77'):return[{'name':_0x7de2('0x78'),'type':_0x10b05a[_0x7de2('0x79')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x0]?_0x10b05a[_0x7de2('0x5c')][0x0][_0x7de2('0x36')]:undefined)||null,'value':_0x10b05a[_0x7de2('0x78')]||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a['attrs'][0x0]?_0x10b05a['attrs'][0x0]['value']:undefined)||null},{'name':_0x7de2('0x7a'),'value':_0x10b05a['attrRefresh']||(_0x10b05a[_0x7de2('0x5c')]&&_0x10b05a[_0x7de2('0x5c')][0x1]?_0x10b05a[_0x7de2('0x5c')][0x1][_0x7de2('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x2445d1){logger[_0x7de2('0x2f')](_0x7de2('0x7b'),JSON['stringify'](_0x2445d1));return[];}}exports['addItem']=function(_0x49a2db,_0x3bdbc8,_0x1e04b6){if(_0x49a2db[_0x7de2('0x51')]['id']){delete _0x49a2db[_0x7de2('0x51')]['id'];}return db['Dashboard'][_0x7de2('0x4e')]({'where':{'id':_0x49a2db[_0x7de2('0x4d')]['id']}})[_0x7de2('0x2a')](handleEntityNotFound(_0x3bdbc8,null))['then'](function(_0xf509b0){if(_0xf509b0){_0x49a2db[_0x7de2('0x51')]['DashboardId']=_0xf509b0['id'];_0x49a2db[_0x7de2('0x51')][_0x7de2('0x5c')]=widgetAttributes(_0x49a2db[_0x7de2('0x51')]);return db['DashboardItem'][_0x7de2('0x50')](_0x49a2db[_0x7de2('0x51')]);}})[_0x7de2('0x2a')](respondWithResult(_0x3bdbc8,null))['catch'](handleError(_0x3bdbc8,null));};exports[_0x7de2('0x7c')]=function(_0x354a88,_0x18399a,_0x1f82ad){var _0xc7df03={};var _0x55cd0a={};var _0x25f28b;var _0x490cd2;return db[_0x7de2('0x48')]['findOne']({'where':{'id':_0x354a88[_0x7de2('0x4d')]['id']}})[_0x7de2('0x2a')](handleEntityNotFound(_0x18399a,null))[_0x7de2('0x2a')](function(_0x337de9){if(_0x337de9){_0x25f28b=_0x337de9;_0x55cd0a[_0x7de2('0x37')]=_[_0x7de2('0x38')](db[_0x7de2('0x7d')]['rawAttributes']);_0x55cd0a[_0x7de2('0x39')]=_[_0x7de2('0x38')](_0x354a88[_0x7de2('0x39')]);_0x55cd0a['filters']=_[_0x7de2('0x3b')](_0x55cd0a[_0x7de2('0x37')],_0x55cd0a[_0x7de2('0x39')]);_0xc7df03[_0x7de2('0x3c')]=_[_0x7de2('0x3b')](_0x55cd0a[_0x7de2('0x37')],qs[_0x7de2('0x3d')](_0x354a88['query'][_0x7de2('0x3d')]));_0xc7df03[_0x7de2('0x3c')]=_0xc7df03[_0x7de2('0x3c')][_0x7de2('0x3e')]?_0xc7df03[_0x7de2('0x3c')]:_0x55cd0a[_0x7de2('0x37')];_0xc7df03[_0x7de2('0x41')]=qs[_0x7de2('0x42')](_0x354a88[_0x7de2('0x39')][_0x7de2('0x42')]);_0xc7df03['where']=qs['filters'](_[_0x7de2('0x44')](_0x354a88[_0x7de2('0x39')],_0x55cd0a[_0x7de2('0x3a')]));if(_0x354a88[_0x7de2('0x39')]['filter']){_0xc7df03[_0x7de2('0x43')]=_[_0x7de2('0x45')](_0xc7df03[_0x7de2('0x43')],{'$or':_[_0x7de2('0x33')](_0xc7df03[_0x7de2('0x3c')],function(_0x841a93){var _0x22f0dd={};_0x22f0dd[_0x841a93]={'$like':'%'+_0x354a88[_0x7de2('0x39')][_0x7de2('0x46')]+'%'};return _0x22f0dd;})});}_0xc7df03=_[_0x7de2('0x45')]({},_0xc7df03,_0x354a88[_0x7de2('0x47')]);return _0x25f28b[_0x7de2('0x7c')](_0xc7df03);}})['then'](function(_0x2b43da){if(_0x2b43da){_0x490cd2=_0x2b43da[_0x7de2('0x3e')];if(!_0x354a88[_0x7de2('0x39')][_0x7de2('0x3f')](_0x7de2('0x40'))){_0xc7df03[_0x7de2('0x24')]=qs[_0x7de2('0x24')](_0x354a88['query'][_0x7de2('0x24')]);_0xc7df03[_0x7de2('0x23')]=qs[_0x7de2('0x23')](_0x354a88['query'][_0x7de2('0x23')]);}return _0x25f28b[_0x7de2('0x7c')](_0xc7df03);}})[_0x7de2('0x2a')](function(_0x20aced){if(_0x20aced){return _0x20aced?{'count':_0x490cd2,'rows':_0x20aced}:null;}})[_0x7de2('0x2a')](respondWithResult(_0x18399a,null))[_0x7de2('0x4f')](handleError(_0x18399a,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index dd399c8..809c731 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 _0x8084=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x22783b,_0x48f6c6){var _0x52651a=function(_0x2f9ed3){while(--_0x2f9ed3){_0x22783b['push'](_0x22783b['shift']());}};_0x52651a(++_0x48f6c6);}(_0x8084,0x13b));var _0x4808=function(_0x45ffe3,_0x5aae83){_0x45ffe3=_0x45ffe3-0x0;var _0x36aa7b=_0x8084[_0x45ffe3];return _0x36aa7b;};'use strict';var EventEmitter=require(_0x4808('0x0'));var Dashboard=require(_0x4808('0x1'))['db'][_0x4808('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4808('0x3')](0x0);var events={'afterCreate':_0x4808('0x4'),'afterUpdate':_0x4808('0x5'),'afterDestroy':_0x4808('0x6')};function emitEvent(_0x163282){return function(_0x4a702e,_0x3e467e,_0x175b52){DashboardEvents[_0x4808('0x7')](_0x163282+':'+_0x4a702e['id'],_0x4a702e);DashboardEvents[_0x4808('0x7')](_0x163282,_0x4a702e);_0x175b52(null);};}for(var e in events){if(events[_0x4808('0x8')](e)){var event=events[e];Dashboard[_0x4808('0x9')](e,emitEvent(event));}}module[_0x4808('0xa')]=DashboardEvents; \ No newline at end of file +var _0xfc9b=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xfc9b,0x74));var _0xbfc9=function(_0x573eb3,_0x109fba){_0x573eb3=_0x573eb3-0x0;var _0x22792e=_0xfc9b[_0x573eb3];return _0x22792e;};'use strict';var EventEmitter=require(_0xbfc9('0x0'));var Dashboard=require(_0xbfc9('0x1'))['db'][_0xbfc9('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xbfc9('0x3')](0x0);var events={'afterCreate':_0xbfc9('0x4'),'afterUpdate':_0xbfc9('0x5'),'afterDestroy':_0xbfc9('0x6')};function emitEvent(_0x5b30b2){return function(_0x2eedb4,_0x49e470,_0x12beb4){DashboardEvents[_0xbfc9('0x7')](_0x5b30b2+':'+_0x2eedb4['id'],_0x2eedb4);DashboardEvents['emit'](_0x5b30b2,_0x2eedb4);_0x12beb4(null);};}for(var e in events){if(events[_0xbfc9('0x8')](e)){var event=events[e];Dashboard[_0xbfc9('0x9')](e,emitEvent(event));}}module[_0xbfc9('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index d8cafbb..8ec256f 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 _0x6a2d=['define','dashboards','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x39ebf2,_0x59eb37){var _0x2df154=function(_0x41bcf8){while(--_0x41bcf8){_0x39ebf2['push'](_0x39ebf2['shift']());}};_0x2df154(++_0x59eb37);}(_0x6a2d,0x152));var _0xd6a2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6a2d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd6a2('0x0'));var util=require(_0xd6a2('0x1'));var logger=require(_0xd6a2('0x2'))(_0xd6a2('0x3'));var moment=require('moment');var BPromise=require(_0xd6a2('0x4'));var rp=require(_0xd6a2('0x5'));var fs=require('fs');var path=require(_0xd6a2('0x6'));var rimraf=require(_0xd6a2('0x7'));var config=require(_0xd6a2('0x8'));var attributes=require('./dashboard.attributes');module[_0xd6a2('0x9')]=function(_0x4f3cb9,_0x439866){return _0x4f3cb9[_0xd6a2('0xa')]('Dashboard',attributes,{'tableName':_0xd6a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9967=['bluebird','request-promise','path','../../config/environment','exports','define','Dashboard','dashboards','util','../../config/logger','api','moment'];(function(_0x308a1d,_0x3d379d){var _0x5eb875=function(_0x464dbe){while(--_0x464dbe){_0x308a1d['push'](_0x308a1d['shift']());}};_0x5eb875(++_0x3d379d);}(_0x9967,0x14c));var _0x7996=function(_0x4b24c5,_0x2064af){_0x4b24c5=_0x4b24c5-0x0;var _0x46f55c=_0x9967[_0x4b24c5];return _0x46f55c;};'use strict';var _=require('lodash');var util=require(_0x7996('0x0'));var logger=require(_0x7996('0x1'))(_0x7996('0x2'));var moment=require(_0x7996('0x3'));var BPromise=require(_0x7996('0x4'));var rp=require(_0x7996('0x5'));var fs=require('fs');var path=require(_0x7996('0x6'));var rimraf=require('rimraf');var config=require(_0x7996('0x7'));var attributes=require('./dashboard.attributes');module[_0x7996('0x8')]=function(_0x4e9fb0,_0x447504){return _0x4e9fb0[_0x7996('0x9')](_0x7996('0xa'),attributes,{'tableName':_0x7996('0xb'),'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 6746b83..ff4df01 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 _0x8654=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','stringify','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x28fabd,_0x20a78c){var _0x287794=function(_0x4cc128){while(--_0x4cc128){_0x28fabd['push'](_0x28fabd['shift']());}};_0x287794(++_0x20a78c);}(_0x8654,0x9a));var _0x4865=function(_0x25ea8a,_0x21919f){_0x25ea8a=_0x25ea8a-0x0;var _0x29f19e=_0x8654[_0x25ea8a];return _0x29f19e;};'use strict';var _=require(_0x4865('0x0'));var util=require(_0x4865('0x1'));var moment=require(_0x4865('0x2'));var BPromise=require(_0x4865('0x3'));var rs=require(_0x4865('0x4'));var fs=require('fs');var Redis=require(_0x4865('0x5'));var db=require(_0x4865('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4865('0x7'))(_0x4865('0x8'));var config=require(_0x4865('0x9'));var jayson=require(_0x4865('0xa'));var client=jayson['client'][_0x4865('0xb')]({'port':0x232a});config[_0x4865('0xc')]=_[_0x4865('0xd')](config[_0x4865('0xc')],{'host':_0x4865('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4865('0xc')]));require('./dashboard.socket')[_0x4865('0xf')](socket);function respondWithRpcPromise(_0x5aa1d5,_0x246e29,_0x5b7168){return new BPromise(function(_0x505572,_0x54074e){return client[_0x4865('0x10')](_0x5aa1d5,_0x5b7168)[_0x4865('0x11')](function(_0x1cdc34){logger[_0x4865('0x12')]('Dashboard,\x20%s,\x20%s',_0x246e29,_0x4865('0x13'));logger[_0x4865('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x246e29,_0x4865('0x13'),JSON[_0x4865('0x15')](_0x1cdc34));if(_0x1cdc34[_0x4865('0x16')]){if(_0x1cdc34[_0x4865('0x16')][_0x4865('0x17')]===0x1f4){logger['error'](_0x4865('0x18'),_0x246e29,_0x1cdc34[_0x4865('0x16')][_0x4865('0x19')]);return _0x54074e(_0x1cdc34[_0x4865('0x16')][_0x4865('0x19')]);}logger[_0x4865('0x16')](_0x4865('0x18'),_0x246e29,_0x1cdc34[_0x4865('0x16')][_0x4865('0x19')]);return _0x505572(_0x1cdc34[_0x4865('0x16')]['message']);}else{logger[_0x4865('0x12')](_0x4865('0x18'),_0x246e29,_0x4865('0x13'));_0x505572(_0x1cdc34['result'][_0x4865('0x19')]);}})[_0x4865('0x1a')](function(_0x512974){logger['error'](_0x4865('0x18'),_0x246e29,_0x512974);_0x54074e(_0x512974);});});} \ No newline at end of file +var _0x9a7f=['code','message','Dashboard,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x2909c1,_0x2226ca){var _0x10cce5=function(_0x1691ba){while(--_0x1691ba){_0x2909c1['push'](_0x2909c1['shift']());}};_0x10cce5(++_0x2226ca);}(_0x9a7f,0x1cf));var _0xf9a7=function(_0x16848e,_0x8effbf){_0x16848e=_0x16848e-0x0;var _0x1c459c=_0x9a7f[_0x16848e];return _0x1c459c;};'use strict';var _=require(_0xf9a7('0x0'));var util=require(_0xf9a7('0x1'));var moment=require(_0xf9a7('0x2'));var BPromise=require(_0xf9a7('0x3'));var rs=require(_0xf9a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9a7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9a7('0x6'))(_0xf9a7('0x7'));var config=require(_0xf9a7('0x8'));var jayson=require(_0xf9a7('0x9'));var client=jayson[_0xf9a7('0xa')]['http']({'port':0x232a});config[_0xf9a7('0xb')]=_[_0xf9a7('0xc')](config['redis'],{'host':_0xf9a7('0xd'),'port':0x18eb});var socket=require(_0xf9a7('0xe'))(new Redis(config[_0xf9a7('0xb')]));require(_0xf9a7('0xf'))['register'](socket);function respondWithRpcPromise(_0x41c38a,_0x560e15,_0x41aa05){return new BPromise(function(_0xe8b282,_0x388892){return client[_0xf9a7('0x10')](_0x41c38a,_0x41aa05)[_0xf9a7('0x11')](function(_0x39e6d3){logger[_0xf9a7('0x12')]('Dashboard,\x20%s,\x20%s',_0x560e15,'request\x20sent');logger[_0xf9a7('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x560e15,_0xf9a7('0x14'),JSON[_0xf9a7('0x15')](_0x39e6d3));if(_0x39e6d3[_0xf9a7('0x16')]){if(_0x39e6d3[_0xf9a7('0x16')][_0xf9a7('0x17')]===0x1f4){logger[_0xf9a7('0x16')]('Dashboard,\x20%s,\x20%s',_0x560e15,_0x39e6d3[_0xf9a7('0x16')][_0xf9a7('0x18')]);return _0x388892(_0x39e6d3['error'][_0xf9a7('0x18')]);}logger[_0xf9a7('0x16')]('Dashboard,\x20%s,\x20%s',_0x560e15,_0x39e6d3[_0xf9a7('0x16')]['message']);return _0xe8b282(_0x39e6d3[_0xf9a7('0x16')][_0xf9a7('0x18')]);}else{logger['info'](_0xf9a7('0x19'),_0x560e15,_0xf9a7('0x14'));_0xe8b282(_0x39e6d3['result']['message']);}})[_0xf9a7('0x1a')](function(_0x529b7f){logger[_0xf9a7('0x16')](_0xf9a7('0x19'),_0x560e15,_0x529b7f);_0x388892(_0x529b7f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 7565a5c..f9e365f 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 _0xf099=['register','./dashboard.events','remove','update','emit','removeListener'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf099,0xfd));var _0x9f09=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xf099[_0x525af9];return _0x129fbf;};'use strict';var DashboardEvents=require(_0x9f09('0x0'));var events=['save',_0x9f09('0x1'),_0x9f09('0x2')];function createListener(_0x573751,_0x138696){return function(_0x2c636f){_0x138696[_0x9f09('0x3')](_0x573751,_0x2c636f);};}function removeListener(_0x38bcdd,_0x1966c3){return function(){DashboardEvents[_0x9f09('0x4')](_0x38bcdd,_0x1966c3);};}exports[_0x9f09('0x5')]=function(_0x141666){for(var _0x203e6b=0x0,_0x2cdd53=events['length'];_0x203e6b<_0x2cdd53;_0x203e6b++){var _0x25e49e=events[_0x203e6b];var _0x528b63=createListener('dashboard:'+_0x25e49e,_0x141666);DashboardEvents['on'](_0x25e49e,_0x528b63);}}; \ No newline at end of file +var _0x9802=['register','dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x40b9aa,_0x4df8a1){var _0x13833a=function(_0xae3dff){while(--_0xae3dff){_0x40b9aa['push'](_0x40b9aa['shift']());}};_0x13833a(++_0x4df8a1);}(_0x9802,0x18a));var _0x2980=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x9802[_0xaa1b3e];return _0x454d7d;};'use strict';var DashboardEvents=require(_0x2980('0x0'));var events=[_0x2980('0x1'),_0x2980('0x2'),_0x2980('0x3')];function createListener(_0x4d3691,_0x1b9803){return function(_0x9680e6){_0x1b9803[_0x2980('0x4')](_0x4d3691,_0x9680e6);};}function removeListener(_0x246e9a,_0x51f89c){return function(){DashboardEvents[_0x2980('0x5')](_0x246e9a,_0x51f89c);};}exports[_0x2980('0x6')]=function(_0x4261d2){for(var _0x14841e=0x0,_0x454cf8=events['length'];_0x14841e<_0x454cf8;_0x14841e++){var _0x416ec6=events[_0x14841e];var _0x3d8c15=createListener(_0x2980('0x7')+_0x416ec6,_0x4261d2);DashboardEvents['on'](_0x416ec6,_0x3d8c15);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index a92ed94..fcba87c 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 _0x3036=['../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3036,0x132));var _0x6303=function(_0x4d0237,_0x4bfafd){_0x4d0237=_0x4d0237-0x0;var _0x237c31=_0x3036[_0x4d0237];return _0x237c31;};'use strict';var multer=require('multer');var util=require(_0x6303('0x0'));var path=require(_0x6303('0x1'));var timeout=require(_0x6303('0x2'));var express=require(_0x6303('0x3'));var router=express['Router']();var fs_extra=require(_0x6303('0x4'));var auth=require(_0x6303('0x5'));var interaction=require(_0x6303('0x6'));var config=require(_0x6303('0x7'));var controller=require(_0x6303('0x8'));router[_0x6303('0x9')]('/',auth[_0x6303('0xa')](),controller[_0x6303('0xb')]);router[_0x6303('0x9')](_0x6303('0xc'),auth[_0x6303('0xa')](),controller[_0x6303('0xd')]);router['get'](_0x6303('0xe'),auth[_0x6303('0xa')](),controller[_0x6303('0xf')]);router[_0x6303('0x10')]('/',auth[_0x6303('0xa')](),controller[_0x6303('0x11')]);router[_0x6303('0x10')](_0x6303('0x12'),auth['isAuthenticated'](),controller[_0x6303('0x13')]);router[_0x6303('0x10')](_0x6303('0xe'),auth['isAuthenticated'](),controller[_0x6303('0x14')]);router[_0x6303('0x15')]('/:id',auth[_0x6303('0xa')](),controller[_0x6303('0x16')]);router['delete']('/:id',auth[_0x6303('0xa')](),controller[_0x6303('0x17')]);module['exports']=router; \ No newline at end of file +var _0x84e6=['fs-extra','../../components/auth/service','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','create','post','/:id/clone','clone','addItem','/:id','update','destroy','multer','path','connect-timeout','express'];(function(_0x520ed8,_0x535d27){var _0x5f3ecb=function(_0xcc540e){while(--_0xcc540e){_0x520ed8['push'](_0x520ed8['shift']());}};_0x5f3ecb(++_0x535d27);}(_0x84e6,0xce));var _0x684e=function(_0x4b0b5f,_0x2f6f13){_0x4b0b5f=_0x4b0b5f-0x0;var _0x3bfa76=_0x84e6[_0x4b0b5f];return _0x3bfa76;};'use strict';var multer=require(_0x684e('0x0'));var util=require('util');var path=require(_0x684e('0x1'));var timeout=require(_0x684e('0x2'));var express=require(_0x684e('0x3'));var router=express['Router']();var fs_extra=require(_0x684e('0x4'));var auth=require(_0x684e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x684e('0x6'));router[_0x684e('0x7')]('/',auth[_0x684e('0x8')](),controller[_0x684e('0x9')]);router[_0x684e('0x7')]('/:id',auth[_0x684e('0x8')](),controller[_0x684e('0xa')]);router['get'](_0x684e('0xb'),auth[_0x684e('0x8')](),controller[_0x684e('0xc')]);router['post']('/',auth[_0x684e('0x8')](),controller[_0x684e('0xd')]);router[_0x684e('0xe')](_0x684e('0xf'),auth[_0x684e('0x8')](),controller[_0x684e('0x10')]);router[_0x684e('0xe')](_0x684e('0xb'),auth[_0x684e('0x8')](),controller[_0x684e('0x11')]);router['put'](_0x684e('0x12'),auth['isAuthenticated'](),controller[_0x684e('0x13')]);router['delete'](_0x684e('0x12'),auth['isAuthenticated'](),controller[_0x684e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 465c763..d01c8f9 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 _0xc4aa=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x520dbf,_0x2ccccf){var _0x29406a=function(_0xe887f9){while(--_0xe887f9){_0x520dbf['push'](_0x520dbf['shift']());}};_0x29406a(++_0x2ccccf);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0xac4a('0x0'));var squel=require(_0xac4a('0x1'));var _=require(_0xac4a('0x2'));module[_0xac4a('0x3')]={'title':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0xac4a('0x5')](_0xac4a('0x6')));}catch(_0x730a38){return[];}},'set':function(_0x215f39){try{this[_0xac4a('0x7')](_0xac4a('0x6'),JSON[_0xac4a('0x8')](_0x215f39));}catch(_0x10525b){this['setDataValue']('attrs',JSON[_0xac4a('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xac4a('0x9')]},'background':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![],'defaultValue':_0xac4a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac4a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xac4a('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x5e6749,_0x2dba25){var _0x853cf6=function(_0x101e74){while(--_0x101e74){_0x5e6749['push'](_0x5e6749['shift']());}};_0x853cf6(++_0x2dba25);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1b1196,_0x535dc0){_0x1b1196=_0x1b1196-0x0;var _0x57400a=_0xc6ac[_0x1b1196];return _0x57400a;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'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 135f65b..8fb6649 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 _0xc319=['body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','options','find','catch','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','stringify','create'];(function(_0x5e5c74,_0x1c0d09){var _0x5d2127=function(_0x371e2b){while(--_0x371e2b){_0x5e5c74['push'](_0x5e5c74['shift']());}};_0x5d2127(++_0x1c0d09);}(_0xc319,0x12e));var _0x9c31=function(_0x1393df,_0x426250){_0x1393df=_0x1393df-0x0;var _0x247762=_0xc319[_0x1393df];return _0x247762;};'use strict';var emlformat=require(_0x9c31('0x0'));var rimraf=require(_0x9c31('0x1'));var zipdir=require(_0x9c31('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c31('0x3'));var moment=require(_0x9c31('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c31('0x5'));var util=require(_0x9c31('0x6'));var path=require(_0x9c31('0x7'));var sox=require(_0x9c31('0x8'));var csv=require('to-csv');var ejs=require(_0x9c31('0x9'));var fs=require('fs');var fs_extra=require(_0x9c31('0xa'));var _=require(_0x9c31('0xb'));var squel=require(_0x9c31('0xc'));var crypto=require(_0x9c31('0xd'));var jsforce=require(_0x9c31('0xe'));var deskjs=require(_0x9c31('0xf'));var toCsv=require(_0x9c31('0x10'));var querystring=require(_0x9c31('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c31('0x12'));var as=require(_0x9c31('0x13'));var hardwareService=require(_0x9c31('0x14'));var logger=require(_0x9c31('0x15'))(_0x9c31('0x16'));var utils=require('../../config/utils');var config=require(_0x9c31('0x17'));var licenseUtil=require(_0x9c31('0x18'));var db=require(_0x9c31('0x19'))['db'];config['redis']=_[_0x9c31('0x1a')](config[_0x9c31('0x1b')],{'host':_0x9c31('0x1c'),'port':0x18eb});var socket=require(_0x9c31('0x1d'))(new Redis(config[_0x9c31('0x1b')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x513815,_0x4ef0ea){_0x4ef0ea=_0x4ef0ea||0xcc;return function(_0x4c6645){if(_0x4c6645){return _0x513815[_0x9c31('0x1e')](_0x4ef0ea);}return _0x513815[_0x9c31('0x1f')](_0x4ef0ea)['end']();};}function respondWithResult(_0x3df9ad,_0x80496a){_0x80496a=_0x80496a||0xc8;return function(_0x262d24){if(_0x262d24){return _0x3df9ad[_0x9c31('0x1f')](_0x80496a)[_0x9c31('0x20')](_0x262d24);}};}function respondWithFilteredResult(_0x5eec43,_0x27b19e){return function(_0x47b5a7){if(_0x47b5a7){var _0xf3a426=typeof _0x27b19e['offset']===_0x9c31('0x21')&&typeof _0x27b19e['limit']===_0x9c31('0x21');var _0x3ae089=_0x47b5a7[_0x9c31('0x22')];var _0x59c053=_0xf3a426?0x0:_0x27b19e[_0x9c31('0x23')];var _0x15323e=_0xf3a426?_0x47b5a7[_0x9c31('0x22')]:_0x27b19e['offset']+_0x27b19e[_0x9c31('0x24')];var _0x34eca6;if(_0x15323e>=_0x3ae089){_0x15323e=_0x3ae089;_0x34eca6=0xc8;}else{_0x34eca6=0xce;}_0x5eec43['status'](_0x34eca6);return _0x5eec43[_0x9c31('0x25')](_0x9c31('0x26'),_0x59c053+'-'+_0x15323e+'/'+_0x3ae089)[_0x9c31('0x20')](_0x47b5a7);}return null;};}function patchUpdates(_0x9fb534){return function(_0x53393e){try{jsonpatch[_0x9c31('0x27')](_0x53393e,_0x9fb534,!![]);}catch(_0x3f66ee){return BPromise[_0x9c31('0x28')](_0x3f66ee);}return _0x53393e[_0x9c31('0x29')]();};}function saveUpdates(_0x3cfeba,_0x34988d){return function(_0x19e668){if(_0x19e668){return _0x19e668['update'](_0x3cfeba)[_0x9c31('0x2a')](function(_0x1b9600){return _0x1b9600;});}return null;};}function removeEntity(_0x2b9cd2,_0x28297e){return function(_0x1c78ab){if(_0x1c78ab){return _0x1c78ab[_0x9c31('0x2b')]()['then'](function(){_0x2b9cd2[_0x9c31('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48d270,_0x24325c){return function(_0x6f4b92){if(!_0x6f4b92){_0x48d270[_0x9c31('0x1e')](0x194);}return _0x6f4b92;};}function handleError(_0x3288e0,_0x4aab82){_0x4aab82=_0x4aab82||0x1f4;return function(_0xa43ac0){logger[_0x9c31('0x2c')](_0xa43ac0[_0x9c31('0x2d')]);if(_0xa43ac0[_0x9c31('0x2e')]){delete _0xa43ac0[_0x9c31('0x2e')];}_0x3288e0[_0x9c31('0x1f')](_0x4aab82)[_0x9c31('0x2f')](_0xa43ac0);};}exports['show']=function(_0x294163,_0x2acfca){var _0x1df7b7={'raw':![],'where':{'id':_0x294163[_0x9c31('0x30')]['id']}},_0x44a8b0={};_0x44a8b0[_0x9c31('0x31')]=_[_0x9c31('0x32')](db[_0x9c31('0x33')][_0x9c31('0x34')]);_0x44a8b0[_0x9c31('0x35')]=_[_0x9c31('0x32')](_0x294163[_0x9c31('0x35')]);_0x44a8b0[_0x9c31('0x36')]=_['intersection'](_0x44a8b0['model'],_0x44a8b0[_0x9c31('0x35')]);_0x1df7b7[_0x9c31('0x37')]=_[_0x9c31('0x38')](_0x44a8b0[_0x9c31('0x31')],qs['fields'](_0x294163[_0x9c31('0x35')][_0x9c31('0x39')]));_0x1df7b7[_0x9c31('0x37')]=_0x1df7b7[_0x9c31('0x37')][_0x9c31('0x3a')]?_0x1df7b7[_0x9c31('0x37')]:_0x44a8b0[_0x9c31('0x31')];if(_0x294163[_0x9c31('0x35')]['includeAll']){_0x1df7b7[_0x9c31('0x3b')]=[{'all':!![]}];}_0x1df7b7=_[_0x9c31('0x3c')]({},_0x1df7b7,_0x294163[_0x9c31('0x3d')]);return db['DashboardItem'][_0x9c31('0x3e')](_0x1df7b7)[_0x9c31('0x2a')](handleEntityNotFound(_0x2acfca,null))[_0x9c31('0x2a')](respondWithResult(_0x2acfca,null))['catch'](handleError(_0x2acfca,null));};exports[_0x9c31('0x2b')]=function(_0x39df35,_0x4ba86b){return db['DashboardItem'][_0x9c31('0x3e')]({'where':{'id':_0x39df35[_0x9c31('0x30')]['id']}})[_0x9c31('0x2a')](handleEntityNotFound(_0x4ba86b,null))[_0x9c31('0x2a')](removeEntity(_0x4ba86b,null))[_0x9c31('0x3f')](handleError(_0x4ba86b,null));};function widgetAttributes(_0x31bf46){try{switch(_0x31bf46['type']){case _0x9c31('0x40'):return[{'name':'attrUrl','value':_0x31bf46[_0x9c31('0x41')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x0]?_0x31bf46[_0x9c31('0x42')][0x0][_0x9c31('0x43')]:undefined)||_0x9c31('0x44')}];case'custom':return[{'name':'attrPath','value':_0x31bf46[_0x9c31('0x45')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x0]?_0x31bf46[_0x9c31('0x42')][0x0][_0x9c31('0x43')]:undefined)||''}];case _0x9c31('0x46'):return[{'name':_0x9c31('0x47'),'value':_0x31bf46[_0x9c31('0x47')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46['attrs'][0x0]?_0x31bf46[_0x9c31('0x42')][0x0][_0x9c31('0x43')]:undefined)||_0x9c31('0x48')},{'name':'attrTimezone','value':_0x31bf46[_0x9c31('0x49')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x1]?_0x31bf46[_0x9c31('0x42')][0x1][_0x9c31('0x43')]:undefined)||'0.00'},{'name':_0x9c31('0x4a'),'value':_0x31bf46[_0x9c31('0x4a')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46['attrs'][0x2]?_0x31bf46[_0x9c31('0x42')][0x2][_0x9c31('0x43')]:undefined)||0xc}];case _0x9c31('0x4b'):return[{'name':_0x9c31('0x4c'),'value':_0x31bf46[_0x9c31('0x4c')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x0]?_0x31bf46['attrs'][0x0]['value']:undefined)||_0x9c31('0x4d')},{'name':_0x9c31('0x4e'),'value':_0x31bf46[_0x9c31('0x4e')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x1]?_0x31bf46['attrs'][0x1]['value']:undefined)||[]},{'name':_0x9c31('0x4a'),'value':_0x31bf46[_0x9c31('0x4a')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x2]?_0x31bf46[_0x9c31('0x42')][0x2][_0x9c31('0x43')]:undefined)||0x14},{'name':_0x9c31('0x4f'),'value':_0x31bf46[_0x9c31('0x4f')]||(_0x31bf46['attrs']&&_0x31bf46[_0x9c31('0x42')][0x3]?_0x31bf46['attrs'][0x3]['value']:undefined)||_0x9c31('0x50')},{'name':_0x9c31('0x51'),'value':_0x31bf46['attrEmailAccounts']||(_0x31bf46['attrs']&&_0x31bf46[_0x9c31('0x42')][0x4]?_0x31bf46[_0x9c31('0x42')][0x4][_0x9c31('0x43')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x31bf46[_0x9c31('0x52')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x5]?_0x31bf46['attrs'][0x5][_0x9c31('0x43')]:undefined)||''},{'name':_0x9c31('0x53'),'value':_0x31bf46[_0x9c31('0x53')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x6]?_0x31bf46['attrs'][0x6]['value']:undefined)||''},{'name':_0x9c31('0x54'),'value':_0x31bf46[_0x9c31('0x54')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46['attrs'][0x7]?_0x31bf46[_0x9c31('0x42')][0x7][_0x9c31('0x43')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x31bf46[_0x9c31('0x55')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x8]?_0x31bf46[_0x9c31('0x42')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x31bf46[_0x9c31('0x56')]||(_0x31bf46['attrs']&&_0x31bf46[_0x9c31('0x42')][0x9]?_0x31bf46[_0x9c31('0x42')][0x9]['value']:undefined)||''}];case _0x9c31('0x57'):case'pie-chart':return[{'name':'attrSerie1','value':_0x31bf46[_0x9c31('0x58')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x0]?_0x31bf46[_0x9c31('0x42')][0x0][_0x9c31('0x43')]:undefined)||_0x9c31('0x4d')},{'name':_0x9c31('0x59'),'value':_0x31bf46[_0x9c31('0x59')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x1]?_0x31bf46[_0x9c31('0x42')][0x1][_0x9c31('0x43')]:undefined)||null},{'name':_0x9c31('0x5a'),'value':_0x31bf46['attrSerie3']||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x2]?_0x31bf46[_0x9c31('0x42')][0x2]['value']:undefined)||null},{'name':_0x9c31('0x4e'),'value':_0x31bf46[_0x9c31('0x4e')]||(_0x31bf46['attrs']&&_0x31bf46[_0x9c31('0x42')][0x3]?_0x31bf46['attrs'][0x3]['value']:undefined)||[]},{'name':_0x9c31('0x4f'),'value':_0x31bf46['attrChannel']||(_0x31bf46['attrs']&&_0x31bf46[_0x9c31('0x42')][0x4]?_0x31bf46[_0x9c31('0x42')][0x4][_0x9c31('0x43')]:undefined)||_0x9c31('0x50')},{'name':_0x9c31('0x51'),'value':_0x31bf46['attrEmailAccounts']||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x5]?_0x31bf46[_0x9c31('0x42')][0x5][_0x9c31('0x43')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x31bf46[_0x9c31('0x52')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x6]?_0x31bf46['attrs'][0x6][_0x9c31('0x43')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x31bf46[_0x9c31('0x53')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x7]?_0x31bf46['attrs'][0x7][_0x9c31('0x43')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x31bf46[_0x9c31('0x54')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x8]?_0x31bf46['attrs'][0x8][_0x9c31('0x43')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x31bf46['attrWhatsappAccounts']||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x9]?_0x31bf46['attrs'][0x9]['value']:undefined)||''},{'name':_0x9c31('0x56'),'value':_0x31bf46[_0x9c31('0x56')]||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0xa]?_0x31bf46[_0x9c31('0x42')][0xa][_0x9c31('0x43')]:undefined)||''}];case _0x9c31('0x5b'):return[{'name':_0x9c31('0x5c'),'type':_0x31bf46['reportType']||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46[_0x9c31('0x42')][0x0]?_0x31bf46[_0x9c31('0x42')][0x0][_0x9c31('0x5d')]:undefined)||null,'value':_0x31bf46[_0x9c31('0x5c')]||(_0x31bf46['attrs']&&_0x31bf46[_0x9c31('0x42')][0x0]?_0x31bf46[_0x9c31('0x42')][0x0]['value']:undefined)||null},{'name':_0x9c31('0x5e'),'value':_0x31bf46['attrRefresh']||(_0x31bf46[_0x9c31('0x42')]&&_0x31bf46['attrs'][0x1]?_0x31bf46[_0x9c31('0x42')][0x1][_0x9c31('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x5387e2){logger[_0x9c31('0x2c')](_0x9c31('0x5f'),JSON[_0x9c31('0x60')](_0x5387e2));return[];}}exports[_0x9c31('0x61')]=function(_0x3fa916,_0xcdcbe1){if(_0x3fa916[_0x9c31('0x62')]){_0x3fa916[_0x9c31('0x62')][_0x9c31('0x42')]=widgetAttributes(_0x3fa916['body']);}return db['DashboardItem'][_0x9c31('0x61')](_0x3fa916[_0x9c31('0x62')],{})[_0x9c31('0x2a')](respondWithResult(_0xcdcbe1,0xc9))[_0x9c31('0x3f')](handleError(_0xcdcbe1,null));};exports[_0x9c31('0x63')]=function(_0x5c5e46,_0xa3f926){if(_0x5c5e46[_0x9c31('0x62')]['id']){delete _0x5c5e46[_0x9c31('0x62')]['id'];}_0x5c5e46['body'][_0x9c31('0x42')]=widgetAttributes(_0x5c5e46['body']);return db[_0x9c31('0x33')][_0x9c31('0x3e')]({'where':{'id':_0x5c5e46[_0x9c31('0x30')]['id']}})['then'](handleEntityNotFound(_0xa3f926,null))[_0x9c31('0x2a')](saveUpdates(_0x5c5e46['body'],null))[_0x9c31('0x2a')](respondWithResult(_0xa3f926,null))['catch'](handleError(_0xa3f926,null));}; \ No newline at end of file +var _0x714c=['multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','destroy','then','error','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites'];(function(_0x448b66,_0x43de1b){var _0x862a6b=function(_0x2160c8){while(--_0x2160c8){_0x448b66['push'](_0x448b66['shift']());}};_0x862a6b(++_0x43de1b);}(_0x714c,0x18d));var _0xc714=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0x714c[_0x33d4a2];return _0x2c793f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc714('0x0'));var zipdir=require(_0xc714('0x1'));var jsonpatch=require(_0xc714('0x2'));var rp=require(_0xc714('0x3'));var moment=require(_0xc714('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc714('0x5'));var util=require(_0xc714('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc714('0x7'));var ejs=require(_0xc714('0x8'));var fs=require('fs');var fs_extra=require(_0xc714('0x9'));var _=require(_0xc714('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc714('0xb'));var deskjs=require(_0xc714('0xc'));var toCsv=require(_0xc714('0x7'));var querystring=require(_0xc714('0xd'));var Papa=require(_0xc714('0xe'));var Redis=require('ioredis');var authService=require(_0xc714('0xf'));var qs=require(_0xc714('0x10'));var as=require(_0xc714('0x11'));var hardwareService=require(_0xc714('0x12'));var logger=require(_0xc714('0x13'))('api');var utils=require(_0xc714('0x14'));var config=require(_0xc714('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc714('0x16')]=_['defaults'](config[_0xc714('0x16')],{'host':_0xc714('0x17'),'port':0x18eb});var socket=require(_0xc714('0x18'))(new Redis(config[_0xc714('0x16')]));require('./dashboardItem.socket')[_0xc714('0x19')](socket);function respondWithStatusCode(_0xde619a,_0x30b839){_0x30b839=_0x30b839||0xcc;return function(_0x25a61c){if(_0x25a61c){return _0xde619a[_0xc714('0x1a')](_0x30b839);}return _0xde619a[_0xc714('0x1b')](_0x30b839)[_0xc714('0x1c')]();};}function respondWithResult(_0x54144c,_0x4fd793){_0x4fd793=_0x4fd793||0xc8;return function(_0x4b2f57){if(_0x4b2f57){return _0x54144c[_0xc714('0x1b')](_0x4fd793)[_0xc714('0x1d')](_0x4b2f57);}};}function respondWithFilteredResult(_0xe22937,_0x3eef2f){return function(_0x310fe3){if(_0x310fe3){var _0x3b877a=typeof _0x3eef2f[_0xc714('0x1e')]===_0xc714('0x1f')&&typeof _0x3eef2f['limit']===_0xc714('0x1f');var _0x309ca2=_0x310fe3[_0xc714('0x20')];var _0x29c3ab=_0x3b877a?0x0:_0x3eef2f['offset'];var _0x751c4d=_0x3b877a?_0x310fe3[_0xc714('0x20')]:_0x3eef2f[_0xc714('0x1e')]+_0x3eef2f[_0xc714('0x21')];var _0x5e8d36;if(_0x751c4d>=_0x309ca2){_0x751c4d=_0x309ca2;_0x5e8d36=0xc8;}else{_0x5e8d36=0xce;}_0xe22937['status'](_0x5e8d36);return _0xe22937[_0xc714('0x22')]('Content-Range',_0x29c3ab+'-'+_0x751c4d+'/'+_0x309ca2)[_0xc714('0x1d')](_0x310fe3);}return null;};}function patchUpdates(_0x379127){return function(_0x3f2542){try{jsonpatch[_0xc714('0x23')](_0x3f2542,_0x379127,!![]);}catch(_0x3c6b1f){return BPromise['reject'](_0x3c6b1f);}return _0x3f2542['save']();};}function saveUpdates(_0x2bc48c,_0x50c332){return function(_0xbc41ee){if(_0xbc41ee){return _0xbc41ee[_0xc714('0x24')](_0x2bc48c)['then'](function(_0x5e1731){return _0x5e1731;});}return null;};}function removeEntity(_0x33ac9c,_0x306dd0){return function(_0x270386){if(_0x270386){return _0x270386[_0xc714('0x25')]()[_0xc714('0x26')](function(){_0x33ac9c['status'](0xcc)[_0xc714('0x1c')]();});}};}function handleEntityNotFound(_0x431a00,_0x56d3c8){return function(_0x2dad21){if(!_0x2dad21){_0x431a00[_0xc714('0x1a')](0x194);}return _0x2dad21;};}function handleError(_0x43f8d9,_0x48b64b){_0x48b64b=_0x48b64b||0x1f4;return function(_0x4e6b70){logger[_0xc714('0x27')](_0x4e6b70['stack']);if(_0x4e6b70[_0xc714('0x28')]){delete _0x4e6b70[_0xc714('0x28')];}_0x43f8d9['status'](_0x48b64b)[_0xc714('0x29')](_0x4e6b70);};}exports[_0xc714('0x2a')]=function(_0x4fb684,_0x21c29a){var _0xc7e7a={'raw':![],'where':{'id':_0x4fb684[_0xc714('0x2b')]['id']}},_0x4a947c={};_0x4a947c[_0xc714('0x2c')]=_[_0xc714('0x2d')](db[_0xc714('0x2e')][_0xc714('0x2f')]);_0x4a947c[_0xc714('0x30')]=_[_0xc714('0x2d')](_0x4fb684['query']);_0x4a947c[_0xc714('0x31')]=_[_0xc714('0x32')](_0x4a947c[_0xc714('0x2c')],_0x4a947c[_0xc714('0x30')]);_0xc7e7a[_0xc714('0x33')]=_[_0xc714('0x32')](_0x4a947c[_0xc714('0x2c')],qs[_0xc714('0x34')](_0x4fb684[_0xc714('0x30')][_0xc714('0x34')]));_0xc7e7a[_0xc714('0x33')]=_0xc7e7a[_0xc714('0x33')][_0xc714('0x35')]?_0xc7e7a[_0xc714('0x33')]:_0x4a947c['model'];if(_0x4fb684[_0xc714('0x30')][_0xc714('0x36')]){_0xc7e7a[_0xc714('0x37')]=[{'all':!![]}];}_0xc7e7a=_[_0xc714('0x38')]({},_0xc7e7a,_0x4fb684[_0xc714('0x39')]);return db[_0xc714('0x2e')][_0xc714('0x3a')](_0xc7e7a)[_0xc714('0x26')](handleEntityNotFound(_0x21c29a,null))[_0xc714('0x26')](respondWithResult(_0x21c29a,null))['catch'](handleError(_0x21c29a,null));};exports[_0xc714('0x25')]=function(_0x487f54,_0x541577){return db[_0xc714('0x2e')]['find']({'where':{'id':_0x487f54['params']['id']}})[_0xc714('0x26')](handleEntityNotFound(_0x541577,null))[_0xc714('0x26')](removeEntity(_0x541577,null))[_0xc714('0x3b')](handleError(_0x541577,null));};function widgetAttributes(_0x2cb513){try{switch(_0x2cb513[_0xc714('0x3c')]){case'iframe':return[{'name':_0xc714('0x3d'),'value':_0x2cb513[_0xc714('0x3d')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513['attrs'][0x0]?_0x2cb513['attrs'][0x0]['value']:undefined)||'https://'}];case _0xc714('0x3f'):return[{'name':_0xc714('0x40'),'value':_0x2cb513[_0xc714('0x40')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x0]?_0x2cb513[_0xc714('0x3e')][0x0][_0xc714('0x41')]:undefined)||''}];case _0xc714('0x42'):return[{'name':_0xc714('0x43'),'value':_0x2cb513[_0xc714('0x43')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x0]?_0x2cb513[_0xc714('0x3e')][0x0][_0xc714('0x41')]:undefined)||'HH:mm:ss'},{'name':_0xc714('0x44'),'value':_0x2cb513[_0xc714('0x44')]||(_0x2cb513['attrs']&&_0x2cb513['attrs'][0x1]?_0x2cb513[_0xc714('0x3e')][0x1][_0xc714('0x41')]:undefined)||_0xc714('0x45')},{'name':_0xc714('0x46'),'value':_0x2cb513[_0xc714('0x46')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513['attrs'][0x2]?_0x2cb513['attrs'][0x2]['value']:undefined)||0xc}];case _0xc714('0x47'):return[{'name':_0xc714('0x48'),'value':_0x2cb513[_0xc714('0x48')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x0]?_0x2cb513[_0xc714('0x3e')][0x0][_0xc714('0x41')]:undefined)||_0xc714('0x49')},{'name':'attrVoiceQueues','value':_0x2cb513[_0xc714('0x4a')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x1]?_0x2cb513[_0xc714('0x3e')][0x1]['value']:undefined)||[]},{'name':_0xc714('0x46'),'value':_0x2cb513[_0xc714('0x46')]||(_0x2cb513['attrs']&&_0x2cb513['attrs'][0x2]?_0x2cb513[_0xc714('0x3e')][0x2][_0xc714('0x41')]:undefined)||0x14},{'name':'attrChannel','value':_0x2cb513[_0xc714('0x4b')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x3]?_0x2cb513[_0xc714('0x3e')][0x3][_0xc714('0x41')]:undefined)||_0xc714('0x4c')},{'name':'attrEmailAccounts','value':_0x2cb513[_0xc714('0x4d')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x4]?_0x2cb513[_0xc714('0x3e')][0x4][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x4e'),'value':_0x2cb513[_0xc714('0x4e')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x5]?_0x2cb513['attrs'][0x5][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x4f'),'value':_0x2cb513[_0xc714('0x4f')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x6]?_0x2cb513[_0xc714('0x3e')][0x6][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x50'),'value':_0x2cb513[_0xc714('0x50')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x7]?_0x2cb513[_0xc714('0x3e')][0x7][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x51'),'value':_0x2cb513[_0xc714('0x51')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x8]?_0x2cb513['attrs'][0x8][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x52'),'value':_0x2cb513[_0xc714('0x52')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513['attrs'][0x9]?_0x2cb513[_0xc714('0x3e')][0x9][_0xc714('0x41')]:undefined)||''}];case _0xc714('0x53'):case _0xc714('0x54'):return[{'name':_0xc714('0x55'),'value':_0x2cb513[_0xc714('0x55')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x0]?_0x2cb513[_0xc714('0x3e')][0x0][_0xc714('0x41')]:undefined)||_0xc714('0x49')},{'name':'attrSerie2','value':_0x2cb513[_0xc714('0x56')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x1]?_0x2cb513['attrs'][0x1][_0xc714('0x41')]:undefined)||null},{'name':_0xc714('0x57'),'value':_0x2cb513[_0xc714('0x57')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x2]?_0x2cb513[_0xc714('0x3e')][0x2][_0xc714('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2cb513[_0xc714('0x4a')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513['attrs'][0x3]?_0x2cb513['attrs'][0x3][_0xc714('0x41')]:undefined)||[]},{'name':'attrChannel','value':_0x2cb513['attrChannel']||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x4]?_0x2cb513[_0xc714('0x3e')][0x4][_0xc714('0x41')]:undefined)||_0xc714('0x4c')},{'name':'attrEmailAccounts','value':_0x2cb513[_0xc714('0x4d')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513['attrs'][0x5]?_0x2cb513['attrs'][0x5][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x4e'),'value':_0x2cb513['attrFaxAccounts']||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x6]?_0x2cb513[_0xc714('0x3e')][0x6][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x4f'),'value':_0x2cb513['attrSmsAccounts']||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x7]?_0x2cb513[_0xc714('0x3e')][0x7][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x50'),'value':_0x2cb513[_0xc714('0x50')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x8]?_0x2cb513[_0xc714('0x3e')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2cb513[_0xc714('0x51')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x9]?_0x2cb513['attrs'][0x9][_0xc714('0x41')]:undefined)||''},{'name':_0xc714('0x52'),'value':_0x2cb513[_0xc714('0x52')]||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0xa]?_0x2cb513[_0xc714('0x3e')][0xa][_0xc714('0x41')]:undefined)||''}];case _0xc714('0x58'):return[{'name':_0xc714('0x59'),'type':_0x2cb513[_0xc714('0x5a')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513['attrs'][0x0]?_0x2cb513[_0xc714('0x3e')][0x0][_0xc714('0x3c')]:undefined)||null,'value':_0x2cb513[_0xc714('0x59')]||(_0x2cb513[_0xc714('0x3e')]&&_0x2cb513[_0xc714('0x3e')][0x0]?_0x2cb513[_0xc714('0x3e')][0x0]['value']:undefined)||null},{'name':_0xc714('0x5b'),'value':_0x2cb513['attrRefresh']||(_0x2cb513['attrs']&&_0x2cb513[_0xc714('0x3e')][0x1]?_0x2cb513['attrs'][0x1][_0xc714('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x429c1d){logger['error'](_0xc714('0x5c'),JSON[_0xc714('0x5d')](_0x429c1d));return[];}}exports['create']=function(_0x478156,_0x47c26d){if(_0x478156[_0xc714('0x5e')]){_0x478156[_0xc714('0x5e')][_0xc714('0x3e')]=widgetAttributes(_0x478156[_0xc714('0x5e')]);}return db[_0xc714('0x2e')][_0xc714('0x5f')](_0x478156[_0xc714('0x5e')],{})[_0xc714('0x26')](respondWithResult(_0x47c26d,0xc9))[_0xc714('0x3b')](handleError(_0x47c26d,null));};exports['update']=function(_0x185c83,_0x1f184a){if(_0x185c83[_0xc714('0x5e')]['id']){delete _0x185c83[_0xc714('0x5e')]['id'];}_0x185c83['body'][_0xc714('0x3e')]=widgetAttributes(_0x185c83[_0xc714('0x5e')]);return db['DashboardItem']['find']({'where':{'id':_0x185c83[_0xc714('0x2b')]['id']}})[_0xc714('0x26')](handleEntityNotFound(_0x1f184a,null))[_0xc714('0x26')](saveUpdates(_0x185c83[_0xc714('0x5e')],null))[_0xc714('0x26')](respondWithResult(_0x1f184a,null))[_0xc714('0x3b')](handleError(_0x1f184a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index bc63083..46f36a8 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 _0x6c99=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','update'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x6c99,0x19b));var _0x96c9=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x6c99[_0x30c649];return _0x3edfb9;};'use strict';var EventEmitter=require(_0x96c9('0x0'));var DashboardItem=require(_0x96c9('0x1'))['db'][_0x96c9('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x96c9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x96c9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a9bd4){return function(_0x276fba,_0x15d946,_0x46973f){DashboardItemEvents['emit'](_0x2a9bd4+':'+_0x276fba['id'],_0x276fba);DashboardItemEvents['emit'](_0x2a9bd4,_0x276fba);_0x46973f(null);};}for(var e in events){if(events[_0x96c9('0x5')](e)){var event=events[e];DashboardItem[_0x96c9('0x6')](e,emitEvent(event));}}module[_0x96c9('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x9ba5=['emit','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x361d10,_0x273d0e){var _0xb73014=function(_0x5df2b6){while(--_0x5df2b6){_0x361d10['push'](_0x361d10['shift']());}};_0xb73014(++_0x273d0e);}(_0x9ba5,0x1f3));var _0x59ba=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x9ba5[_0x1e4360];return _0x31e6b4;};'use strict';var EventEmitter=require(_0x59ba('0x0'));var DashboardItem=require(_0x59ba('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x59ba('0x2')](0x0);var events={'afterCreate':_0x59ba('0x3'),'afterUpdate':'update','afterDestroy':_0x59ba('0x4')};function emitEvent(_0x1ef1d2){return function(_0x32a23b,_0xe0177d,_0x119bc1){DashboardItemEvents[_0x59ba('0x5')](_0x1ef1d2+':'+_0x32a23b['id'],_0x32a23b);DashboardItemEvents[_0x59ba('0x5')](_0x1ef1d2,_0x32a23b);_0x119bc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x59ba('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 6bfb856..e53f1fe 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 _0xe4eb=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xe4eb,0x9b));var _0xbe4e=function(_0x4f197e,_0x3f903d){_0x4f197e=_0x4f197e-0x0;var _0x3364b5=_0xe4eb[_0x4f197e];return _0x3364b5;};'use strict';var _=require(_0xbe4e('0x0'));var util=require(_0xbe4e('0x1'));var logger=require('../../config/logger')(_0xbe4e('0x2'));var moment=require(_0xbe4e('0x3'));var BPromise=require(_0xbe4e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe4e('0x5'));var rimraf=require(_0xbe4e('0x6'));var config=require(_0xbe4e('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xbe4e('0x8')]=function(_0x15aa50,_0x2e4bd6){return _0x15aa50[_0xbe4e('0x9')](_0xbe4e('0xa'),attributes,{'tableName':_0xbe4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a13=['rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x8a13,0xd6));var _0x38a1=function(_0x3aa779,_0x4a18c5){_0x3aa779=_0x3aa779-0x0;var _0x2fd150=_0x8a13[_0x3aa779];return _0x2fd150;};'use strict';var _=require(_0x38a1('0x0'));var util=require(_0x38a1('0x1'));var logger=require(_0x38a1('0x2'))(_0x38a1('0x3'));var moment=require(_0x38a1('0x4'));var BPromise=require(_0x38a1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38a1('0x6'));var rimraf=require(_0x38a1('0x7'));var config=require(_0x38a1('0x8'));var attributes=require(_0x38a1('0x9'));module[_0x38a1('0xa')]=function(_0x1bf204,_0x4d4fcd){return _0x1bf204['define'](_0x38a1('0xb'),attributes,{'tableName':_0x38a1('0xc'),'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 ff8d536..e7c9375 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 _0x6e5b=['./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x6e5b,0xe7));var _0xb6e5=function(_0x2e901f,_0x57a6db){_0x2e901f=_0x2e901f-0x0;var _0x102239=_0x6e5b[_0x2e901f];return _0x102239;};'use strict';var _=require(_0xb6e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6e5('0x1'));var fs=require('fs');var Redis=require(_0xb6e5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6e5('0x3'));var logger=require(_0xb6e5('0x4'))(_0xb6e5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb6e5('0x6')]({'port':0x232a});config[_0xb6e5('0x7')]=_[_0xb6e5('0x8')](config[_0xb6e5('0x7')],{'host':_0xb6e5('0x9'),'port':0x18eb});var socket=require(_0xb6e5('0xa'))(new Redis(config[_0xb6e5('0x7')]));require(_0xb6e5('0xb'))['register'](socket);function respondWithRpcPromise(_0x2047d2,_0x5d0146,_0x2aa14e){return new BPromise(function(_0xd79971,_0x388d83){return client[_0xb6e5('0xc')](_0x2047d2,_0x2aa14e)[_0xb6e5('0xd')](function(_0x13475c){logger[_0xb6e5('0xe')](_0xb6e5('0xf'),_0x5d0146,_0xb6e5('0x10'));logger['debug'](_0xb6e5('0x11'),_0x5d0146,_0xb6e5('0x10'),JSON['stringify'](_0x13475c));if(_0x13475c[_0xb6e5('0x12')]){if(_0x13475c[_0xb6e5('0x12')][_0xb6e5('0x13')]===0x1f4){logger[_0xb6e5('0x12')](_0xb6e5('0xf'),_0x5d0146,_0x13475c[_0xb6e5('0x12')][_0xb6e5('0x14')]);return _0x388d83(_0x13475c['error'][_0xb6e5('0x14')]);}logger[_0xb6e5('0x12')](_0xb6e5('0xf'),_0x5d0146,_0x13475c[_0xb6e5('0x12')][_0xb6e5('0x14')]);return _0xd79971(_0x13475c[_0xb6e5('0x12')][_0xb6e5('0x14')]);}else{logger[_0xb6e5('0xe')](_0xb6e5('0xf'),_0x5d0146,_0xb6e5('0x10'));_0xd79971(_0x13475c['result']['message']);}})[_0xb6e5('0x15')](function(_0x1a12d9){logger[_0xb6e5('0x12')](_0xb6e5('0xf'),_0x5d0146,_0x1a12d9);_0x388d83(_0x1a12d9);});});} \ No newline at end of file +var _0x6963=['register','request','then','info','request\x20sent','debug','error','code','message','DashboardItem,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0x6963,0x1d6));var _0x3696=function(_0x40ad44,_0x5757ee){_0x40ad44=_0x40ad44-0x0;var _0x2bc119=_0x6963[_0x40ad44];return _0x2bc119;};'use strict';var _=require(_0x3696('0x0'));var util=require(_0x3696('0x1'));var moment=require(_0x3696('0x2'));var BPromise=require('bluebird');var rs=require(_0x3696('0x3'));var fs=require('fs');var Redis=require(_0x3696('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3696('0x5'));var logger=require(_0x3696('0x6'))(_0x3696('0x7'));var config=require(_0x3696('0x8'));var jayson=require(_0x3696('0x9'));var client=jayson[_0x3696('0xa')][_0x3696('0xb')]({'port':0x232a});config[_0x3696('0xc')]=_[_0x3696('0xd')](config[_0x3696('0xc')],{'host':_0x3696('0xe'),'port':0x18eb});var socket=require(_0x3696('0xf'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x3696('0x10')](socket);function respondWithRpcPromise(_0x5a55e1,_0x3ac54a,_0xac6273){return new BPromise(function(_0x445220,_0x222424){return client[_0x3696('0x11')](_0x5a55e1,_0xac6273)[_0x3696('0x12')](function(_0x2c7247){logger[_0x3696('0x13')]('DashboardItem,\x20%s,\x20%s',_0x3ac54a,_0x3696('0x14'));logger[_0x3696('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3ac54a,_0x3696('0x14'),JSON['stringify'](_0x2c7247));if(_0x2c7247[_0x3696('0x16')]){if(_0x2c7247[_0x3696('0x16')][_0x3696('0x17')]===0x1f4){logger[_0x3696('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3ac54a,_0x2c7247[_0x3696('0x16')][_0x3696('0x18')]);return _0x222424(_0x2c7247['error']['message']);}logger[_0x3696('0x16')](_0x3696('0x19'),_0x3ac54a,_0x2c7247[_0x3696('0x16')][_0x3696('0x18')]);return _0x445220(_0x2c7247[_0x3696('0x16')][_0x3696('0x18')]);}else{logger[_0x3696('0x13')]('DashboardItem,\x20%s,\x20%s',_0x3ac54a,_0x3696('0x14'));_0x445220(_0x2c7247['result'][_0x3696('0x18')]);}})[_0x3696('0x1a')](function(_0x39b051){logger[_0x3696('0x16')](_0x3696('0x19'),_0x3ac54a,_0x39b051);_0x222424(_0x39b051);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index f55baba..e56342f 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 _0x7c7b=['dashboardItem:','./dashboardItem.events','save','remove','emit','removeListener','register','length'];(function(_0x7265b0,_0x1e9b1b){var _0x5938d8=function(_0x1fcb2a){while(--_0x1fcb2a){_0x7265b0['push'](_0x7265b0['shift']());}};_0x5938d8(++_0x1e9b1b);}(_0x7c7b,0x1c1));var _0xb7c7=function(_0x350db0,_0x121a74){_0x350db0=_0x350db0-0x0;var _0x3eaead=_0x7c7b[_0x350db0];return _0x3eaead;};'use strict';var DashboardItemEvents=require(_0xb7c7('0x0'));var events=[_0xb7c7('0x1'),_0xb7c7('0x2'),'update'];function createListener(_0x7310db,_0x15aa26){return function(_0xfdf8c2){_0x15aa26[_0xb7c7('0x3')](_0x7310db,_0xfdf8c2);};}function removeListener(_0x41a968,_0x3b050c){return function(){DashboardItemEvents[_0xb7c7('0x4')](_0x41a968,_0x3b050c);};}exports[_0xb7c7('0x5')]=function(_0x4d9cc3){for(var _0x51afe7=0x0,_0x4ef786=events[_0xb7c7('0x6')];_0x51afe7<_0x4ef786;_0x51afe7++){var _0x5ea274=events[_0x51afe7];var _0x5b3b9f=createListener(_0xb7c7('0x7')+_0x5ea274,_0x4d9cc3);DashboardItemEvents['on'](_0x5ea274,_0x5b3b9f);}}; \ No newline at end of file +var _0x6bb8=['dashboardItem:','./dashboardItem.events','save','remove','update','removeListener','register','length'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x6bb8,0x79));var _0x86bb=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0x6bb8[_0x3ff685];return _0x2046c9;};'use strict';var DashboardItemEvents=require(_0x86bb('0x0'));var events=[_0x86bb('0x1'),_0x86bb('0x2'),_0x86bb('0x3')];function createListener(_0x2e7d98,_0xa98db0){return function(_0x1e066a){_0xa98db0['emit'](_0x2e7d98,_0x1e066a);};}function removeListener(_0xc98337,_0x2ef028){return function(){DashboardItemEvents[_0x86bb('0x4')](_0xc98337,_0x2ef028);};}exports[_0x86bb('0x5')]=function(_0x2f8b39){for(var _0x5b4084=0x0,_0xcb9ca6=events[_0x86bb('0x6')];_0x5b4084<_0xcb9ca6;_0x5b4084++){var _0x27b402=events[_0x5b4084];var _0x5f0d48=createListener(_0x86bb('0x7')+_0x27b402,_0x2f8b39);DashboardItemEvents['on'](_0x27b402,_0x5f0d48);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c0068d0..d514fb6 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 _0x028e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x3b92e5,_0x187a84){var _0x199c50=function(_0x5c21ca){while(--_0x5c21ca){_0x3b92e5['push'](_0x3b92e5['shift']());}};_0x199c50(++_0x187a84);}(_0x028e,0x73));var _0xe028=function(_0x11d10f,_0x275d65){_0x11d10f=_0x11d10f-0x0;var _0x4f3a86=_0x028e[_0x11d10f];return _0x4f3a86;};'use strict';var multer=require('multer');var util=require(_0xe028('0x0'));var path=require(_0xe028('0x1'));var timeout=require(_0xe028('0x2'));var express=require(_0xe028('0x3'));var router=express[_0xe028('0x4')]();var fs_extra=require(_0xe028('0x5'));var auth=require(_0xe028('0x6'));var interaction=require(_0xe028('0x7'));var config=require(_0xe028('0x8'));var controller=require(_0xe028('0x9'));router[_0xe028('0xa')]('/:id',auth[_0xe028('0xb')](),controller[_0xe028('0xc')]);router[_0xe028('0xd')]('/',auth['isAuthenticated'](),controller[_0xe028('0xe')]);router[_0xe028('0xf')](_0xe028('0x10'),auth[_0xe028('0xb')](),controller[_0xe028('0x11')]);router[_0xe028('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe028('0x13')]=router; \ No newline at end of file +var _0x7340=['get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x358830,_0x203709){var _0x8c07df=function(_0x587bbd){while(--_0x587bbd){_0x358830['push'](_0x358830['shift']());}};_0x8c07df(++_0x203709);}(_0x7340,0x149));var _0x0734=function(_0x5762eb,_0x485bfb){_0x5762eb=_0x5762eb-0x0;var _0x47bbb9=_0x7340[_0x5762eb];return _0x47bbb9;};'use strict';var multer=require(_0x0734('0x0'));var util=require(_0x0734('0x1'));var path=require(_0x0734('0x2'));var timeout=require(_0x0734('0x3'));var express=require(_0x0734('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0734('0x5'));var interaction=require(_0x0734('0x6'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0x0734('0x7')](_0x0734('0x8'),auth[_0x0734('0x9')](),controller[_0x0734('0xa')]);router['post']('/',auth[_0x0734('0x9')](),controller[_0x0734('0xb')]);router[_0x0734('0xc')]('/:id',auth[_0x0734('0x9')](),controller[_0x0734('0xd')]);router[_0x0734('0xe')](_0x0734('0x8'),auth[_0x0734('0x9')](),controller['destroy']);module[_0x0734('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 81714eb..c39c09b 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 _0x6449=['third','sequelize','ENUM','first','second'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x6449,0x92));var _0x9644=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x6449[_0x1d50f2];return _0x3769b8;};'use strict';var Sequelize=require(_0x9644('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x9644('0x1')](_0x9644('0x2'),_0x9644('0x3'),_0x9644('0x4')),'allowNull':![],'defaultValue':_0x9644('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe153=['second','third','STRING','ENUM','first'];(function(_0x3bad26,_0x1cf013){var _0x42e1ff=function(_0xb53d84){while(--_0xb53d84){_0x3bad26['push'](_0x3bad26['shift']());}};_0x42e1ff(++_0x1cf013);}(_0xe153,0x1dd));var _0x3e15=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xe153[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3e15('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x3e15('0x1')](_0x3e15('0x2'),_0x3e15('0x3'),_0x3e15('0x4')),'allowNull':![],'defaultValue':_0x3e15('0x2')},'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 68a29b4..c152683 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 _0x4397=['../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','Disposition','includeAll','rows','show','params','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x187666,_0x378940){var _0x5b8fa4=function(_0xe4461e){while(--_0xe4461e){_0x187666['push'](_0x187666['shift']());}};_0x5b8fa4(++_0x378940);}(_0x4397,0xe4));var _0x7439=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x4397[_0x329437];return _0x3789d9;};'use strict';var emlformat=require(_0x7439('0x0'));var rimraf=require(_0x7439('0x1'));var zipdir=require(_0x7439('0x2'));var jsonpatch=require(_0x7439('0x3'));var rp=require(_0x7439('0x4'));var moment=require('moment');var BPromise=require(_0x7439('0x5'));var Mustache=require(_0x7439('0x6'));var util=require(_0x7439('0x7'));var path=require(_0x7439('0x8'));var sox=require(_0x7439('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7439('0xa'));var _=require(_0x7439('0xb'));var squel=require('squel');var crypto=require(_0x7439('0xc'));var jsforce=require(_0x7439('0xd'));var deskjs=require(_0x7439('0xe'));var toCsv=require(_0x7439('0xf'));var querystring=require('querystring');var Papa=require(_0x7439('0x10'));var Redis=require(_0x7439('0x11'));var authService=require(_0x7439('0x12'));var qs=require(_0x7439('0x13'));var as=require(_0x7439('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7439('0x15'))(_0x7439('0x16'));var utils=require(_0x7439('0x17'));var config=require(_0x7439('0x18'));var licenseUtil=require(_0x7439('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48ee9e,_0x47eb9d){_0x47eb9d=_0x47eb9d||0xcc;return function(_0x4d08c4){if(_0x4d08c4){return _0x48ee9e[_0x7439('0x1a')](_0x47eb9d);}return _0x48ee9e[_0x7439('0x1b')](_0x47eb9d)['end']();};}function respondWithResult(_0x20c5bd,_0x15c918){_0x15c918=_0x15c918||0xc8;return function(_0xdb311d){if(_0xdb311d){return _0x20c5bd[_0x7439('0x1b')](_0x15c918)[_0x7439('0x1c')](_0xdb311d);}};}function respondWithFilteredResult(_0x4b85e5,_0x4aa41c){return function(_0x16fd81){if(_0x16fd81){var _0x3fed84=typeof _0x4aa41c['offset']==='undefined'&&typeof _0x4aa41c[_0x7439('0x1d')]===_0x7439('0x1e');var _0x1716a9=_0x16fd81['count'];var _0x17c7a1=_0x3fed84?0x0:_0x4aa41c[_0x7439('0x1f')];var _0x1323eb=_0x3fed84?_0x16fd81[_0x7439('0x20')]:_0x4aa41c[_0x7439('0x1f')]+_0x4aa41c[_0x7439('0x1d')];var _0x3a0e36;if(_0x1323eb>=_0x1716a9){_0x1323eb=_0x1716a9;_0x3a0e36=0xc8;}else{_0x3a0e36=0xce;}_0x4b85e5['status'](_0x3a0e36);return _0x4b85e5[_0x7439('0x21')](_0x7439('0x22'),_0x17c7a1+'-'+_0x1323eb+'/'+_0x1716a9)[_0x7439('0x1c')](_0x16fd81);}return null;};}function patchUpdates(_0x46ae57){return function(_0x4f816a){try{jsonpatch['apply'](_0x4f816a,_0x46ae57,!![]);}catch(_0xac3a91){return BPromise[_0x7439('0x23')](_0xac3a91);}return _0x4f816a[_0x7439('0x24')]();};}function saveUpdates(_0x47b8c5,_0x11986a){return function(_0x2e5815){if(_0x2e5815){return _0x2e5815[_0x7439('0x25')](_0x47b8c5)[_0x7439('0x26')](function(_0x2fbb5b){return _0x2fbb5b;});}return null;};}function removeEntity(_0x51fddb,_0x7ad080){return function(_0x567e0d){if(_0x567e0d){return _0x567e0d[_0x7439('0x27')]()[_0x7439('0x26')](function(){var _0x1828bd=_0x567e0d[_0x7439('0x28')]({'plain':!![]});var _0x58faf4=_0x7439('0x29');return db[_0x7439('0x2a')][_0x7439('0x27')]({'where':{'type':_0x58faf4,'resourceId':_0x1828bd['id']}})[_0x7439('0x26')](function(){return _0x567e0d;});})[_0x7439('0x26')](function(){_0x51fddb[_0x7439('0x1b')](0xcc)[_0x7439('0x2b')]();});}};}function handleEntityNotFound(_0x413adf,_0x419a0a){return function(_0x165072){if(!_0x165072){_0x413adf['sendStatus'](0x194);}return _0x165072;};}function handleError(_0x41cb1e,_0x43d241){_0x43d241=_0x43d241||0x1f4;return function(_0x311c79){logger['error'](_0x311c79[_0x7439('0x2c')]);if(_0x311c79[_0x7439('0x2d')]){delete _0x311c79[_0x7439('0x2d')];}_0x41cb1e['status'](_0x43d241)[_0x7439('0x2e')](_0x311c79);};}exports[_0x7439('0x2f')]=function(_0x5c8ef8,_0x5d532e){var _0x2dc6bb={},_0x333f31={},_0x5d791f={'count':0x0,'rows':[]};var _0xf2727a=_[_0x7439('0x30')](db['Disposition'][_0x7439('0x31')],function(_0x20488a){return{'name':_0x20488a[_0x7439('0x32')],'type':_0x20488a[_0x7439('0x33')][_0x7439('0x34')]};});_0x333f31[_0x7439('0x35')]=_[_0x7439('0x30')](_0xf2727a,_0x7439('0x2d'));_0x333f31['query']=_[_0x7439('0x36')](_0x5c8ef8['query']);_0x333f31[_0x7439('0x37')]=_['intersection'](_0x333f31[_0x7439('0x35')],_0x333f31['query']);_0x2dc6bb[_0x7439('0x38')]=_[_0x7439('0x39')](_0x333f31['model'],qs[_0x7439('0x3a')](_0x5c8ef8[_0x7439('0x3b')][_0x7439('0x3a')]));_0x2dc6bb[_0x7439('0x38')]=_0x2dc6bb[_0x7439('0x38')]['length']?_0x2dc6bb[_0x7439('0x38')]:_0x333f31[_0x7439('0x35')];if(!_0x5c8ef8[_0x7439('0x3b')][_0x7439('0x3c')](_0x7439('0x3d'))){_0x2dc6bb[_0x7439('0x1d')]=qs[_0x7439('0x1d')](_0x5c8ef8[_0x7439('0x3b')][_0x7439('0x1d')]);_0x2dc6bb[_0x7439('0x1f')]=qs[_0x7439('0x1f')](_0x5c8ef8[_0x7439('0x3b')][_0x7439('0x1f')]);}_0x2dc6bb['order']=qs[_0x7439('0x3e')](_0x5c8ef8[_0x7439('0x3b')][_0x7439('0x3e')]);_0x2dc6bb[_0x7439('0x3f')]=qs[_0x7439('0x37')](_[_0x7439('0x40')](_0x5c8ef8[_0x7439('0x3b')],_0x333f31[_0x7439('0x37')]),_0xf2727a);if(_0x5c8ef8[_0x7439('0x3b')]['filter']){_0x2dc6bb[_0x7439('0x3f')]=_[_0x7439('0x41')](_0x2dc6bb[_0x7439('0x3f')],{'$or':_['map'](_0xf2727a,function(_0x5e1da3){if(_0x5e1da3[_0x7439('0x33')]!==_0x7439('0x42')){var _0x2a2610={};_0x2a2610[_0x5e1da3[_0x7439('0x2d')]]={'$like':'%'+_0x5c8ef8[_0x7439('0x3b')][_0x7439('0x43')]+'%'};return _0x2a2610;}})});}_0x2dc6bb=_[_0x7439('0x41')]({},_0x2dc6bb,_0x5c8ef8['options']);var _0x5caf9d={'where':_0x2dc6bb[_0x7439('0x3f')]};return db[_0x7439('0x44')][_0x7439('0x20')](_0x5caf9d)['then'](function(_0x1fcd2a){_0x5d791f[_0x7439('0x20')]=_0x1fcd2a;if(_0x5c8ef8['query'][_0x7439('0x45')]){_0x2dc6bb['include']=[{'all':!![]}];}return db[_0x7439('0x44')]['findAll'](_0x2dc6bb);})[_0x7439('0x26')](function(_0x2ad531){_0x5d791f[_0x7439('0x46')]=_0x2ad531;return _0x5d791f;})['then'](respondWithFilteredResult(_0x5d532e,_0x2dc6bb))['catch'](handleError(_0x5d532e,null));};exports[_0x7439('0x47')]=function(_0x4c8c84,_0x320b68){var _0x178694={'raw':!![],'where':{'id':_0x4c8c84[_0x7439('0x48')]['id']}},_0x58a94b={};_0x58a94b['model']=_[_0x7439('0x36')](db[_0x7439('0x44')][_0x7439('0x31')]);_0x58a94b[_0x7439('0x3b')]=_[_0x7439('0x36')](_0x4c8c84[_0x7439('0x3b')]);_0x58a94b[_0x7439('0x37')]=_[_0x7439('0x39')](_0x58a94b[_0x7439('0x35')],_0x58a94b[_0x7439('0x3b')]);_0x178694[_0x7439('0x38')]=_[_0x7439('0x39')](_0x58a94b[_0x7439('0x35')],qs[_0x7439('0x3a')](_0x4c8c84[_0x7439('0x3b')][_0x7439('0x3a')]));_0x178694[_0x7439('0x38')]=_0x178694[_0x7439('0x38')]['length']?_0x178694[_0x7439('0x38')]:_0x58a94b[_0x7439('0x35')];if(_0x4c8c84[_0x7439('0x3b')]['includeAll']){_0x178694[_0x7439('0x49')]=[{'all':!![]}];}_0x178694=_[_0x7439('0x41')]({},_0x178694,_0x4c8c84[_0x7439('0x4a')]);return db[_0x7439('0x44')][_0x7439('0x4b')](_0x178694)[_0x7439('0x26')](handleEntityNotFound(_0x320b68,null))[_0x7439('0x26')](respondWithResult(_0x320b68,null))['catch'](handleError(_0x320b68,null));};exports[_0x7439('0x4c')]=function(_0x503532,_0x534332){return db[_0x7439('0x44')][_0x7439('0x4c')](_0x503532['body'],{})[_0x7439('0x26')](function(_0x15d442){var _0x138024=_0x503532['user'][_0x7439('0x28')]({'plain':!![]});if(!_0x138024)throw new Error(_0x7439('0x4d'));if(_0x138024[_0x7439('0x4e')]==='user'){var _0x7787f2=_0x15d442['get']({'plain':!![]});var _0x315d4b=_0x7439('0x29');return db[_0x7439('0x4f')][_0x7439('0x4b')]({'where':{'name':_0x315d4b,'userProfileId':_0x138024[_0x7439('0x50')]},'raw':!![]})[_0x7439('0x26')](function(_0x79b8db){if(_0x79b8db&&_0x79b8db['autoAssociation']===0x0){return db[_0x7439('0x2a')][_0x7439('0x4c')]({'name':_0x7787f2[_0x7439('0x2d')],'resourceId':_0x7787f2['id'],'type':_0x79b8db[_0x7439('0x2d')],'sectionId':_0x79b8db['id']},{})[_0x7439('0x26')](function(){return _0x15d442;});}else{return _0x15d442;}})['catch'](function(_0x592b7f){logger['error'](_0x7439('0x51'),_0x592b7f);throw _0x592b7f;});}return _0x15d442;})[_0x7439('0x26')](respondWithResult(_0x534332,0xc9))[_0x7439('0x52')](handleError(_0x534332,null));};exports['update']=function(_0x13dc12,_0x56e6dc){if(_0x13dc12[_0x7439('0x53')]['id']){delete _0x13dc12[_0x7439('0x53')]['id'];}return db[_0x7439('0x44')][_0x7439('0x4b')]({'where':{'id':_0x13dc12[_0x7439('0x48')]['id']}})[_0x7439('0x26')](handleEntityNotFound(_0x56e6dc,null))[_0x7439('0x26')](saveUpdates(_0x13dc12[_0x7439('0x53')],null))['then'](respondWithResult(_0x56e6dc,null))[_0x7439('0x52')](handleError(_0x56e6dc,null));};exports[_0x7439('0x27')]=function(_0x1c9b4c,_0x3a5a20){return db[_0x7439('0x44')][_0x7439('0x4b')]({'where':{'id':_0x1c9b4c['params']['id']}})[_0x7439('0x26')](handleEntityNotFound(_0x3a5a20,null))[_0x7439('0x26')](removeEntity(_0x3a5a20,null))['catch'](handleError(_0x3a5a20,null));}; \ No newline at end of file +var _0x0ee1=['params','rawAttributes','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','get','Dispositions','error','stack','name','send','index','map','Disposition','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','show'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0ee1,0x1b0));var _0x10ee=function(_0x2937ea,_0x43a2a9){_0x2937ea=_0x2937ea-0x0;var _0x40b81b=_0x0ee1[_0x2937ea];return _0x40b81b;};'use strict';var emlformat=require(_0x10ee('0x0'));var rimraf=require(_0x10ee('0x1'));var zipdir=require(_0x10ee('0x2'));var jsonpatch=require(_0x10ee('0x3'));var rp=require(_0x10ee('0x4'));var moment=require(_0x10ee('0x5'));var BPromise=require(_0x10ee('0x6'));var Mustache=require(_0x10ee('0x7'));var util=require(_0x10ee('0x8'));var path=require(_0x10ee('0x9'));var sox=require('sox');var csv=require(_0x10ee('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x10ee('0xb'));var _=require(_0x10ee('0xc'));var squel=require(_0x10ee('0xd'));var crypto=require(_0x10ee('0xe'));var jsforce=require(_0x10ee('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x10ee('0xa'));var querystring=require('querystring');var Papa=require(_0x10ee('0x10'));var Redis=require(_0x10ee('0x11'));var authService=require(_0x10ee('0x12'));var qs=require(_0x10ee('0x13'));var as=require(_0x10ee('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10ee('0x15'))('api');var utils=require(_0x10ee('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x10ee('0x17'));var db=require(_0x10ee('0x18'))['db'];function respondWithStatusCode(_0x2f43e1,_0x17073e){_0x17073e=_0x17073e||0xcc;return function(_0x12b12f){if(_0x12b12f){return _0x2f43e1[_0x10ee('0x19')](_0x17073e);}return _0x2f43e1[_0x10ee('0x1a')](_0x17073e)[_0x10ee('0x1b')]();};}function respondWithResult(_0x874341,_0x27a913){_0x27a913=_0x27a913||0xc8;return function(_0x2c5cac){if(_0x2c5cac){return _0x874341[_0x10ee('0x1a')](_0x27a913)['json'](_0x2c5cac);}};}function respondWithFilteredResult(_0x207bdc,_0x5a1e97){return function(_0x2fa9fe){if(_0x2fa9fe){var _0x318733=typeof _0x5a1e97[_0x10ee('0x1c')]==='undefined'&&typeof _0x5a1e97[_0x10ee('0x1d')]===_0x10ee('0x1e');var _0x642de9=_0x2fa9fe[_0x10ee('0x1f')];var _0x12baa6=_0x318733?0x0:_0x5a1e97[_0x10ee('0x1c')];var _0x2ff46e=_0x318733?_0x2fa9fe[_0x10ee('0x1f')]:_0x5a1e97[_0x10ee('0x1c')]+_0x5a1e97[_0x10ee('0x1d')];var _0x1b6755;if(_0x2ff46e>=_0x642de9){_0x2ff46e=_0x642de9;_0x1b6755=0xc8;}else{_0x1b6755=0xce;}_0x207bdc[_0x10ee('0x1a')](_0x1b6755);return _0x207bdc[_0x10ee('0x20')](_0x10ee('0x21'),_0x12baa6+'-'+_0x2ff46e+'/'+_0x642de9)[_0x10ee('0x22')](_0x2fa9fe);}return null;};}function patchUpdates(_0x5d6ccc){return function(_0x51c591){try{jsonpatch['apply'](_0x51c591,_0x5d6ccc,!![]);}catch(_0x34802d){return BPromise[_0x10ee('0x23')](_0x34802d);}return _0x51c591['save']();};}function saveUpdates(_0x4c3a5c,_0x569aaa){return function(_0x2176bb){if(_0x2176bb){return _0x2176bb[_0x10ee('0x24')](_0x4c3a5c)[_0x10ee('0x25')](function(_0x1f7b5a){return _0x1f7b5a;});}return null;};}function removeEntity(_0x221073,_0x1f2dcc){return function(_0x2f45b7){if(_0x2f45b7){return _0x2f45b7[_0x10ee('0x26')]()[_0x10ee('0x25')](function(){var _0x202d9a=_0x2f45b7[_0x10ee('0x27')]({'plain':!![]});var _0x36602d=_0x10ee('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x36602d,'resourceId':_0x202d9a['id']}})[_0x10ee('0x25')](function(){return _0x2f45b7;});})[_0x10ee('0x25')](function(){_0x221073[_0x10ee('0x1a')](0xcc)[_0x10ee('0x1b')]();});}};}function handleEntityNotFound(_0x51df24,_0x1802cf){return function(_0x35b203){if(!_0x35b203){_0x51df24[_0x10ee('0x19')](0x194);}return _0x35b203;};}function handleError(_0x169257,_0x1645b6){_0x1645b6=_0x1645b6||0x1f4;return function(_0x24acb0){logger[_0x10ee('0x29')](_0x24acb0[_0x10ee('0x2a')]);if(_0x24acb0['name']){delete _0x24acb0[_0x10ee('0x2b')];}_0x169257[_0x10ee('0x1a')](_0x1645b6)[_0x10ee('0x2c')](_0x24acb0);};}exports[_0x10ee('0x2d')]=function(_0x4c82a5,_0x364eed){var _0x16e8c7={},_0x246339={},_0x266f04={'count':0x0,'rows':[]};var _0x4c4d3b=_[_0x10ee('0x2e')](db[_0x10ee('0x2f')]['rawAttributes'],function(_0x23ed06){return{'name':_0x23ed06[_0x10ee('0x30')],'type':_0x23ed06['type'][_0x10ee('0x31')]};});_0x246339[_0x10ee('0x32')]=_['map'](_0x4c4d3b,'name');_0x246339[_0x10ee('0x33')]=_[_0x10ee('0x34')](_0x4c82a5[_0x10ee('0x33')]);_0x246339['filters']=_[_0x10ee('0x35')](_0x246339[_0x10ee('0x32')],_0x246339[_0x10ee('0x33')]);_0x16e8c7['attributes']=_[_0x10ee('0x35')](_0x246339['model'],qs['fields'](_0x4c82a5[_0x10ee('0x33')][_0x10ee('0x36')]));_0x16e8c7[_0x10ee('0x37')]=_0x16e8c7[_0x10ee('0x37')][_0x10ee('0x38')]?_0x16e8c7[_0x10ee('0x37')]:_0x246339[_0x10ee('0x32')];if(!_0x4c82a5[_0x10ee('0x33')]['hasOwnProperty'](_0x10ee('0x39'))){_0x16e8c7[_0x10ee('0x1d')]=qs[_0x10ee('0x1d')](_0x4c82a5[_0x10ee('0x33')][_0x10ee('0x1d')]);_0x16e8c7[_0x10ee('0x1c')]=qs['offset'](_0x4c82a5[_0x10ee('0x33')][_0x10ee('0x1c')]);}_0x16e8c7[_0x10ee('0x3a')]=qs['sort'](_0x4c82a5[_0x10ee('0x33')][_0x10ee('0x3b')]);_0x16e8c7[_0x10ee('0x3c')]=qs[_0x10ee('0x3d')](_[_0x10ee('0x3e')](_0x4c82a5[_0x10ee('0x33')],_0x246339[_0x10ee('0x3d')]),_0x4c4d3b);if(_0x4c82a5[_0x10ee('0x33')][_0x10ee('0x3f')]){_0x16e8c7['where']=_[_0x10ee('0x40')](_0x16e8c7[_0x10ee('0x3c')],{'$or':_['map'](_0x4c4d3b,function(_0x3071c0){if(_0x3071c0[_0x10ee('0x41')]!=='VIRTUAL'){var _0x559c90={};_0x559c90[_0x3071c0['name']]={'$like':'%'+_0x4c82a5[_0x10ee('0x33')][_0x10ee('0x3f')]+'%'};return _0x559c90;}})});}_0x16e8c7=_[_0x10ee('0x40')]({},_0x16e8c7,_0x4c82a5[_0x10ee('0x42')]);var _0x58b211={'where':_0x16e8c7['where']};return db[_0x10ee('0x2f')][_0x10ee('0x1f')](_0x58b211)[_0x10ee('0x25')](function(_0x6e7d2){_0x266f04[_0x10ee('0x1f')]=_0x6e7d2;if(_0x4c82a5['query'][_0x10ee('0x43')]){_0x16e8c7[_0x10ee('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x10ee('0x45')](_0x16e8c7);})[_0x10ee('0x25')](function(_0x1ecef6){_0x266f04[_0x10ee('0x46')]=_0x1ecef6;return _0x266f04;})[_0x10ee('0x25')](respondWithFilteredResult(_0x364eed,_0x16e8c7))['catch'](handleError(_0x364eed,null));};exports[_0x10ee('0x47')]=function(_0x592af0,_0x452470){var _0x4e42f2={'raw':!![],'where':{'id':_0x592af0[_0x10ee('0x48')]['id']}},_0x1bcdbc={};_0x1bcdbc[_0x10ee('0x32')]=_['keys'](db[_0x10ee('0x2f')][_0x10ee('0x49')]);_0x1bcdbc['query']=_[_0x10ee('0x34')](_0x592af0[_0x10ee('0x33')]);_0x1bcdbc[_0x10ee('0x3d')]=_[_0x10ee('0x35')](_0x1bcdbc[_0x10ee('0x32')],_0x1bcdbc[_0x10ee('0x33')]);_0x4e42f2[_0x10ee('0x37')]=_[_0x10ee('0x35')](_0x1bcdbc[_0x10ee('0x32')],qs[_0x10ee('0x36')](_0x592af0[_0x10ee('0x33')]['fields']));_0x4e42f2[_0x10ee('0x37')]=_0x4e42f2['attributes'][_0x10ee('0x38')]?_0x4e42f2[_0x10ee('0x37')]:_0x1bcdbc[_0x10ee('0x32')];if(_0x592af0[_0x10ee('0x33')][_0x10ee('0x43')]){_0x4e42f2[_0x10ee('0x44')]=[{'all':!![]}];}_0x4e42f2=_[_0x10ee('0x40')]({},_0x4e42f2,_0x592af0[_0x10ee('0x42')]);return db[_0x10ee('0x2f')][_0x10ee('0x4a')](_0x4e42f2)[_0x10ee('0x25')](handleEntityNotFound(_0x452470,null))[_0x10ee('0x25')](respondWithResult(_0x452470,null))[_0x10ee('0x4b')](handleError(_0x452470,null));};exports[_0x10ee('0x4c')]=function(_0x3b7840,_0x48f02f){return db[_0x10ee('0x2f')][_0x10ee('0x4c')](_0x3b7840[_0x10ee('0x4d')],{})[_0x10ee('0x25')](function(_0x4f6bb9){var _0x92ba84=_0x3b7840[_0x10ee('0x4e')][_0x10ee('0x27')]({'plain':!![]});if(!_0x92ba84)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x92ba84['role']===_0x10ee('0x4e')){var _0x62a880=_0x4f6bb9[_0x10ee('0x27')]({'plain':!![]});var _0x4bf321=_0x10ee('0x28');return db[_0x10ee('0x4f')]['find']({'where':{'name':_0x4bf321,'userProfileId':_0x92ba84[_0x10ee('0x50')]},'raw':!![]})['then'](function(_0x5d84c2){if(_0x5d84c2&&_0x5d84c2[_0x10ee('0x51')]===0x0){return db[_0x10ee('0x52')][_0x10ee('0x4c')]({'name':_0x62a880[_0x10ee('0x2b')],'resourceId':_0x62a880['id'],'type':_0x5d84c2['name'],'sectionId':_0x5d84c2['id']},{})['then'](function(){return _0x4f6bb9;});}else{return _0x4f6bb9;}})[_0x10ee('0x4b')](function(_0x36c737){logger[_0x10ee('0x29')](_0x10ee('0x53'),_0x36c737);throw _0x36c737;});}return _0x4f6bb9;})[_0x10ee('0x25')](respondWithResult(_0x48f02f,0xc9))[_0x10ee('0x4b')](handleError(_0x48f02f,null));};exports['update']=function(_0x5479b3,_0x41ee0d){if(_0x5479b3[_0x10ee('0x4d')]['id']){delete _0x5479b3[_0x10ee('0x4d')]['id'];}return db['Disposition'][_0x10ee('0x4a')]({'where':{'id':_0x5479b3['params']['id']}})['then'](handleEntityNotFound(_0x41ee0d,null))[_0x10ee('0x25')](saveUpdates(_0x5479b3[_0x10ee('0x4d')],null))[_0x10ee('0x25')](respondWithResult(_0x41ee0d,null))[_0x10ee('0x4b')](handleError(_0x41ee0d,null));};exports[_0x10ee('0x26')]=function(_0x4dd8c3,_0x3bf6de){return db[_0x10ee('0x2f')][_0x10ee('0x4a')]({'where':{'id':_0x4dd8c3[_0x10ee('0x48')]['id']}})[_0x10ee('0x25')](handleEntityNotFound(_0x3bf6de,null))[_0x10ee('0x25')](removeEntity(_0x3bf6de,null))[_0x10ee('0x4b')](handleError(_0x3bf6de,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6ce8efc..c98f57c 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 _0xa25a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','OpenchannelAccountId','WhatsappAccountId'];(function(_0x4ec0bc,_0x387812){var _0x1555bf=function(_0x47706e){while(--_0x47706e){_0x4ec0bc['push'](_0x4ec0bc['shift']());}};_0x1555bf(++_0x387812);}(_0xa25a,0x78));var _0xaa25=function(_0xe481fb,_0x263188){_0xe481fb=_0xe481fb-0x0;var _0x5e1776=_0xa25a[_0xe481fb];return _0x5e1776;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa25('0x0'))(_0xaa25('0x1'));var moment=require(_0xaa25('0x2'));var BPromise=require(_0xaa25('0x3'));var rp=require(_0xaa25('0x4'));var fs=require('fs');var path=require(_0xaa25('0x5'));var rimraf=require(_0xaa25('0x6'));var config=require(_0xaa25('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x4d12a4,_0x138d60){return _0x4d12a4['define'](_0xaa25('0x8'),attributes,{'tableName':_0xaa25('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xaa25('0xa'),'fields':[_0xaa25('0xb'),_0xaa25('0xc')]},{'unique':!![],'name':_0xaa25('0xd'),'fields':[_0xaa25('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0xaa25('0xe'),'fields':[_0xaa25('0xb'),_0xaa25('0xf')]},{'unique':!![],'name':_0xaa25('0x10'),'fields':[_0xaa25('0xb'),_0xaa25('0x11')]},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xaa25('0xb'),_0xaa25('0x12')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0xaa25('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9537=['../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1f047e,_0x23b312){var _0x206db5=function(_0xe06955){while(--_0xe06955){_0x1f047e['push'](_0x1f047e['shift']());}};_0x206db5(++_0x23b312);}(_0x9537,0x191));var _0x7953=function(_0xcc4b0c,_0xb1d3b5){_0xcc4b0c=_0xcc4b0c-0x0;var _0x24abcf=_0x9537[_0xcc4b0c];return _0x24abcf;};'use strict';var _=require(_0x7953('0x0'));var util=require(_0x7953('0x1'));var logger=require(_0x7953('0x2'))(_0x7953('0x3'));var moment=require(_0x7953('0x4'));var BPromise=require(_0x7953('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7953('0x6'));var rimraf=require('rimraf');var config=require(_0x7953('0x7'));var attributes=require(_0x7953('0x8'));module[_0x7953('0x9')]=function(_0x4119b7,_0xa68b22){return _0x4119b7[_0x7953('0xa')](_0x7953('0xb'),attributes,{'tableName':_0x7953('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7953('0xd'),'fields':[_0x7953('0xe'),_0x7953('0xf')]},{'unique':!![],'name':_0x7953('0x10'),'fields':[_0x7953('0xe'),_0x7953('0x11')]},{'unique':!![],'name':_0x7953('0x12'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0x7953('0x13'),'fields':[_0x7953('0xe'),_0x7953('0x14')]},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':_0x7953('0x15'),'fields':[_0x7953('0xe'),_0x7953('0x16')]},{'unique':!![],'name':_0x7953('0x17'),'fields':[_0x7953('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 31bc327..e777158 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(_0x1e4e7c,_0xceb03a){var _0x5414cd=function(_0x5698f2){while(--_0x5698f2){_0x1e4e7c['push'](_0x1e4e7c['shift']());}};_0x5414cd(++_0xceb03a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0xe737b1,_0x41aaad){var _0x1bb9dd=function(_0x4362a7){while(--_0x4362a7){_0xe737b1['push'](_0xe737b1['shift']());}};_0x1bb9dd(++_0x41aaad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 f870f9b..1ebc5e8 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 _0xde1f=['index','/:id','show','create','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated'];(function(_0x41a642,_0x50a513){var _0x4491b0=function(_0xc81c89){while(--_0xc81c89){_0x41a642['push'](_0x41a642['shift']());}};_0x4491b0(++_0x50a513);}(_0xde1f,0x1e3));var _0xfde1=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0xde1f[_0x57b432];return _0x2edf2a;};'use strict';var multer=require(_0xfde1('0x0'));var util=require(_0xfde1('0x1'));var path=require(_0xfde1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfde1('0x3')]();var fs_extra=require(_0xfde1('0x4'));var auth=require(_0xfde1('0x5'));var interaction=require(_0xfde1('0x6'));var config=require('../../config/environment');var controller=require(_0xfde1('0x7'));router[_0xfde1('0x8')]('/',auth[_0xfde1('0x9')](),controller[_0xfde1('0xa')]);router[_0xfde1('0x8')](_0xfde1('0xb'),auth[_0xfde1('0x9')](),controller[_0xfde1('0xc')]);router['post']('/',auth[_0xfde1('0x9')](),controller[_0xfde1('0xd')]);router['put']('/:id',auth[_0xfde1('0x9')](),controller[_0xfde1('0xe')]);router[_0xfde1('0xf')](_0xfde1('0xb'),auth[_0xfde1('0x9')](),controller['destroy']);module[_0xfde1('0x10')]=router; \ No newline at end of file +var _0x4610=['./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x166901,_0x21fcb1){var _0xb14c8b=function(_0x34a69c){while(--_0x34a69c){_0x166901['push'](_0x166901['shift']());}};_0xb14c8b(++_0x21fcb1);}(_0x4610,0x182));var _0x0461=function(_0x513254,_0x1305ca){_0x513254=_0x513254-0x0;var _0x384c92=_0x4610[_0x513254];return _0x384c92;};'use strict';var multer=require(_0x0461('0x0'));var util=require('util');var path=require(_0x0461('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0461('0x2'));var interaction=require(_0x0461('0x3'));var config=require(_0x0461('0x4'));var controller=require(_0x0461('0x5'));router[_0x0461('0x6')]('/',auth[_0x0461('0x7')](),controller[_0x0461('0x8')]);router[_0x0461('0x6')](_0x0461('0x9'),auth[_0x0461('0x7')](),controller[_0x0461('0xa')]);router[_0x0461('0xb')]('/',auth[_0x0461('0x7')](),controller[_0x0461('0xc')]);router['put']('/:id',auth[_0x0461('0x7')](),controller[_0x0461('0xd')]);router[_0x0461('0xe')](_0x0461('0x9'),auth[_0x0461('0x7')](),controller[_0x0461('0xf')]);module[_0x0461('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 239f054..b1cf17e 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 _0x0b82=['INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','localstationid','2400','4800','9600','14400','7200','12000','v17,v27,v29'];(function(_0x54073a,_0xd989bb){var _0x213f12=function(_0xf32df9){while(--_0xf32df9){_0x54073a['push'](_0x54073a['shift']());}};_0x213f12(++_0xd989bb);}(_0x0b82,0xb4));var _0x20b8=function(_0x5f3828,_0x65e89c){_0x5f3828=_0x5f3828-0x0;var _0x33b7fd=_0x0b82[_0x5f3828];return _0x33b7fd;};'use strict';var Sequelize=require('sequelize');module[_0x20b8('0x0')]={'name':{'type':Sequelize[_0x20b8('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x20b8('0x1')]},'ecm':{'type':Sequelize[_0x20b8('0x2')]('yes','no'),'defaultValue':_0x20b8('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x20b8('0x1')],'unique':_0x20b8('0x4')},'minrate':{'type':Sequelize[_0x20b8('0x2')](_0x20b8('0x5'),_0x20b8('0x6'),'7200',_0x20b8('0x7'),'12000',_0x20b8('0x8')),'defaultValue':_0x20b8('0x6')},'maxrate':{'type':Sequelize[_0x20b8('0x2')](_0x20b8('0x5'),_0x20b8('0x6'),_0x20b8('0x9'),_0x20b8('0x7'),_0x20b8('0xa'),'14400'),'defaultValue':_0x20b8('0x8')},'modem':{'type':Sequelize[_0x20b8('0x1')],'defaultValue':_0x20b8('0xb')},'gateway':{'type':Sequelize[_0x20b8('0x1')],'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[_0x20b8('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x20b8('0xd'),_0x20b8('0xe'),_0x20b8('0xf'),_0x20b8('0x10')),'defaultValue':_0x20b8('0xd')},'key':{'type':Sequelize[_0x20b8('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x20b8('0x11');}},'notificationSound':{'type':Sequelize[_0x20b8('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x20b8('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x20b8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x20b8('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x20b8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x20b8('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x20b8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x20b8('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x20b8('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x20b8('0x12')],'defaultValue':![],'comment':_0x20b8('0x14'),'set':function(_0x512b8e){if(!_0x512b8e)this[_0x20b8('0x15')](_0x20b8('0x16'),null);this[_0x20b8('0x15')](_0x20b8('0x17'),_0x512b8e);}}}; \ No newline at end of file +var _0x9f13=['sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400','4800','v17,v27,v29','INTEGER','IAX','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x4b1936,_0x283775){var _0x1d53b5=function(_0x2e75b8){while(--_0x2e75b8){_0x4b1936['push'](_0x4b1936['shift']());}};_0x1d53b5(++_0x283775);}(_0x9f13,0x1f4));var _0x39f1=function(_0xe6b759,_0x2637a9){_0xe6b759=_0xe6b759-0x0;var _0x250568=_0x9f13[_0xe6b759];return _0x250568;};'use strict';var Sequelize=require(_0x39f1('0x0'));module[_0x39f1('0x1')]={'name':{'type':Sequelize[_0x39f1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x39f1('0x2')]},'ecm':{'type':Sequelize[_0x39f1('0x3')](_0x39f1('0x4'),'no'),'defaultValue':_0x39f1('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x39f1('0x5')},'localstationid':{'type':Sequelize[_0x39f1('0x2')],'unique':_0x39f1('0x6')},'minrate':{'type':Sequelize[_0x39f1('0x3')](_0x39f1('0x7'),'4800',_0x39f1('0x8'),_0x39f1('0x9'),_0x39f1('0xa'),_0x39f1('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x39f1('0x7'),_0x39f1('0xc'),'7200',_0x39f1('0x9'),_0x39f1('0xa'),_0x39f1('0xb')),'defaultValue':_0x39f1('0xb')},'modem':{'type':Sequelize[_0x39f1('0x2')],'defaultValue':_0x39f1('0xd')},'gateway':{'type':Sequelize[_0x39f1('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x39f1('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x39f1('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x39f1('0x3')]('SIP',_0x39f1('0xf'),'DADHI',_0x39f1('0x10')),'defaultValue':_0x39f1('0x11')},'key':{'type':Sequelize[_0x39f1('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x39f1('0x12')],'defaultValue':function(){return _0x39f1('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x39f1('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x39f1('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x39f1('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x39f1('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x39f1('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x39f1('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x39f1('0x14')],'defaultValue':![],'comment':_0x39f1('0x16'),'set':function(_0xe0ea5a){if(!_0xe0ea5a)this['setDataValue'](_0x39f1('0x17'),null);this[_0x39f1('0x18')]('mandatoryDisposition',_0xe0ea5a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 94ad78f..b1c23e9 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 _0xd7f8=['message','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','length','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','findAndCountAll','priority','stack','getApplications','from-voip-provider','localstationid','system','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','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','VoiceExtension','updateAccountApplications','sequelize','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','user','out','Contact\x20not\x20found','filename','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd7f8,0x9c));var _0x8d7f=function(_0x2ade54,_0x28432e){_0x2ade54=_0x2ade54-0x0;var _0x118e3f=_0xd7f8[_0x2ade54];return _0x118e3f;};'use strict';var emlformat=require(_0x8d7f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d7f('0x1'));var rp=require('request-promise');var moment=require(_0x8d7f('0x2'));var BPromise=require(_0x8d7f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8d7f('0x4'));var csv=require(_0x8d7f('0x5'));var ejs=require(_0x8d7f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d7f('0x7'));var squel=require(_0x8d7f('0x8'));var crypto=require(_0x8d7f('0x9'));var jsforce=require(_0x8d7f('0xa'));var deskjs=require(_0x8d7f('0xb'));var toCsv=require(_0x8d7f('0x5'));var querystring=require(_0x8d7f('0xc'));var Papa=require(_0x8d7f('0xd'));var Redis=require(_0x8d7f('0xe'));var authService=require(_0x8d7f('0xf'));var qs=require(_0x8d7f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d7f('0x11'));var logger=require(_0x8d7f('0x12'))(_0x8d7f('0x13'));var utils=require(_0x8d7f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8d7f('0x15'))['db'];config[_0x8d7f('0x16')]=_[_0x8d7f('0x17')](config[_0x8d7f('0x16')],{'host':_0x8d7f('0x18'),'port':0x18eb});var socket=require(_0x8d7f('0x19'))(new Redis(config[_0x8d7f('0x16')]));require(_0x8d7f('0x1a'))[_0x8d7f('0x1b')](socket);var jayson=require(_0x8d7f('0x1c'));var client=jayson['client'][_0x8d7f('0x1d')]({'port':0x232c});var client9002=jayson[_0x8d7f('0x1e')][_0x8d7f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x27d6f8,_0x202ee3,_0x1b0d9d,_0x327521){return new BPromise(function(_0x368120,_0x2f0376){var _0x5af52f=_0x327521||client;return _0x5af52f[_0x8d7f('0x1f')](_0x27d6f8,_0x1b0d9d)[_0x8d7f('0x20')](function(_0x5ee0cc){logger[_0x8d7f('0x21')](_0x8d7f('0x22'),_0x202ee3,_0x8d7f('0x23'));logger[_0x8d7f('0x24')](_0x8d7f('0x25'),_0x202ee3,_0x8d7f('0x23'),JSON[_0x8d7f('0x26')](_0x5ee0cc));if(_0x5ee0cc[_0x8d7f('0x27')]){if(_0x5ee0cc[_0x8d7f('0x27')][_0x8d7f('0x28')]===0x1f4){logger[_0x8d7f('0x27')]('FaxAccount,\x20%s,\x20%s',_0x202ee3,_0x5ee0cc[_0x8d7f('0x27')][_0x8d7f('0x29')]);return _0x2f0376(_0x5ee0cc[_0x8d7f('0x27')][_0x8d7f('0x29')]);}logger[_0x8d7f('0x27')](_0x8d7f('0x22'),_0x202ee3,_0x5ee0cc['error']['message']);return _0x368120(_0x5ee0cc[_0x8d7f('0x27')][_0x8d7f('0x29')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x202ee3,_0x8d7f('0x23'));_0x368120(_0x5ee0cc['result']['message']);}})[_0x8d7f('0x2a')](function(_0x464674){logger[_0x8d7f('0x27')]('FaxAccount,\x20%s,\x20%s',_0x202ee3,_0x464674);_0x2f0376(_0x464674);});});}function respondWithStatusCode(_0x35d3af,_0x5d4e02){_0x5d4e02=_0x5d4e02||0xcc;return function(_0x3c20de){if(_0x3c20de){return _0x35d3af[_0x8d7f('0x2b')](_0x5d4e02);}return _0x35d3af[_0x8d7f('0x2c')](_0x5d4e02)[_0x8d7f('0x2d')]();};}function respondWithResult(_0x5f4519,_0x218080){_0x218080=_0x218080||0xc8;return function(_0x569fdd){if(_0x569fdd){return _0x5f4519[_0x8d7f('0x2c')](_0x218080)['json'](_0x569fdd);}};}function respondWithFilteredResult(_0x37f9a3,_0x30f75f){return function(_0x3e920b){if(_0x3e920b){var _0xf430b4=typeof _0x30f75f[_0x8d7f('0x2e')]===_0x8d7f('0x2f')&&typeof _0x30f75f['limit']===_0x8d7f('0x2f');var _0xff5f8b=_0x3e920b[_0x8d7f('0x30')];var _0x30ff44=_0xf430b4?0x0:_0x30f75f[_0x8d7f('0x2e')];var _0x6f7267=_0xf430b4?_0x3e920b[_0x8d7f('0x30')]:_0x30f75f[_0x8d7f('0x2e')]+_0x30f75f[_0x8d7f('0x31')];var _0x34f648;if(_0x6f7267>=_0xff5f8b){_0x6f7267=_0xff5f8b;_0x34f648=0xc8;}else{_0x34f648=0xce;}_0x37f9a3[_0x8d7f('0x2c')](_0x34f648);return _0x37f9a3['set'](_0x8d7f('0x32'),_0x30ff44+'-'+_0x6f7267+'/'+_0xff5f8b)[_0x8d7f('0x33')](_0x3e920b);}return null;};}function patchUpdates(_0x284020){return function(_0x1e294a){try{jsonpatch[_0x8d7f('0x34')](_0x1e294a,_0x284020,!![]);}catch(_0x3a0be3){return BPromise[_0x8d7f('0x35')](_0x3a0be3);}return _0x1e294a[_0x8d7f('0x36')]();};}function saveUpdates(_0x5775a6,_0x5c75b6){return function(_0x12bd61){if(_0x12bd61){return _0x12bd61['update'](_0x5775a6)['then'](function(_0x16b68c){return _0x16b68c;});}return null;};}function removeEntity(_0x2350fd,_0x2203e5){return function(_0x10c5d4){if(_0x10c5d4){return _0x10c5d4[_0x8d7f('0x37')]()['then'](function(){var _0x51896a=_0x10c5d4[_0x8d7f('0x38')]({'plain':!![]});var _0x4a295a='FaxAccounts';return db[_0x8d7f('0x39')][_0x8d7f('0x37')]({'where':{'type':_0x4a295a,'resourceId':_0x51896a['id']}})[_0x8d7f('0x20')](function(){return _0x10c5d4;});})[_0x8d7f('0x20')](function(){_0x2350fd[_0x8d7f('0x2c')](0xcc)[_0x8d7f('0x2d')]();});}};}function handleEntityNotFound(_0x54d93d,_0x54673c){return function(_0x5087b5){if(!_0x5087b5){_0x54d93d[_0x8d7f('0x2b')](0x194);}return _0x5087b5;};}function handleError(_0x11f924,_0x43511c){_0x43511c=_0x43511c||0x1f4;return function(_0x836b67){logger['error'](_0x836b67['stack']);if(_0x836b67[_0x8d7f('0x3a')]){delete _0x836b67[_0x8d7f('0x3a')];}_0x11f924[_0x8d7f('0x2c')](_0x43511c)[_0x8d7f('0x3b')](_0x836b67);};}exports[_0x8d7f('0x3c')]=function(_0x52b7d1,_0x21f794){var _0x30129b={'include':[{'model':db[_0x8d7f('0x3d')],'as':_0x8d7f('0x3e')}]},_0x206e47={},_0x228577={'count':0x0,'rows':[]};var _0x2d9dab=_['map'](db[_0x8d7f('0x3f')]['rawAttributes'],function(_0x19cf60){return{'name':_0x19cf60['fieldName'],'type':_0x19cf60[_0x8d7f('0x40')]['key']};});_0x206e47[_0x8d7f('0x41')]=_[_0x8d7f('0x42')](_0x2d9dab,_0x8d7f('0x3a'));_0x206e47[_0x8d7f('0x43')]=_[_0x8d7f('0x44')](_0x52b7d1['query']);_0x206e47[_0x8d7f('0x45')]=_[_0x8d7f('0x46')](_0x206e47[_0x8d7f('0x41')],_0x206e47['query']);_0x30129b[_0x8d7f('0x47')]=_['intersection'](_0x206e47[_0x8d7f('0x41')],qs[_0x8d7f('0x48')](_0x52b7d1[_0x8d7f('0x43')]['fields']));_0x30129b[_0x8d7f('0x47')]=_0x30129b[_0x8d7f('0x47')]['length']?_0x30129b[_0x8d7f('0x47')]:_0x206e47[_0x8d7f('0x41')];if(!_0x52b7d1[_0x8d7f('0x43')][_0x8d7f('0x49')](_0x8d7f('0x4a'))){_0x30129b[_0x8d7f('0x31')]=qs[_0x8d7f('0x31')](_0x52b7d1['query'][_0x8d7f('0x31')]);_0x30129b[_0x8d7f('0x2e')]=qs[_0x8d7f('0x2e')](_0x52b7d1[_0x8d7f('0x43')][_0x8d7f('0x2e')]);}_0x30129b[_0x8d7f('0x4b')]=qs[_0x8d7f('0x4c')](_0x52b7d1['query'][_0x8d7f('0x4c')]);_0x30129b['where']=qs[_0x8d7f('0x45')](_[_0x8d7f('0x4d')](_0x52b7d1[_0x8d7f('0x43')],_0x206e47[_0x8d7f('0x45')]),_0x2d9dab);if(_0x52b7d1[_0x8d7f('0x43')]['filter']){_0x30129b[_0x8d7f('0x4e')]=_[_0x8d7f('0x4f')](_0x30129b[_0x8d7f('0x4e')],{'$or':_[_0x8d7f('0x42')](_0x2d9dab,function(_0x3dd115){if(_0x3dd115[_0x8d7f('0x40')]!==_0x8d7f('0x50')){var _0x5e7db0={};_0x5e7db0[_0x3dd115[_0x8d7f('0x3a')]]={'$like':'%'+_0x52b7d1[_0x8d7f('0x43')][_0x8d7f('0x51')]+'%'};return _0x5e7db0;}})});}_0x30129b=_[_0x8d7f('0x4f')]({},_0x30129b,_0x52b7d1[_0x8d7f('0x52')]);var _0x25d553={'where':_0x30129b[_0x8d7f('0x4e')]};return db['FaxAccount'][_0x8d7f('0x30')](_0x25d553)['then'](function(_0x4c49e0){_0x228577['count']=_0x4c49e0;if(_0x52b7d1[_0x8d7f('0x43')][_0x8d7f('0x53')]){_0x30129b[_0x8d7f('0x54')]=[{'all':!![]}];}return db[_0x8d7f('0x3f')][_0x8d7f('0x55')](_0x30129b);})[_0x8d7f('0x20')](function(_0x2a9c1d){_0x228577[_0x8d7f('0x56')]=_0x2a9c1d;return _0x228577;})['then'](respondWithFilteredResult(_0x21f794,_0x30129b))['catch'](handleError(_0x21f794,null));};exports[_0x8d7f('0x57')]=function(_0x4d85b0,_0x12bf66){var _0x33702a={'raw':![],'where':{'id':_0x4d85b0[_0x8d7f('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8d7f('0x3e')}]},_0x34c47d={};_0x34c47d[_0x8d7f('0x41')]=_['keys'](db['FaxAccount'][_0x8d7f('0x59')]);_0x34c47d['query']=_['keys'](_0x4d85b0[_0x8d7f('0x43')]);_0x34c47d[_0x8d7f('0x45')]=_[_0x8d7f('0x46')](_0x34c47d[_0x8d7f('0x41')],_0x34c47d[_0x8d7f('0x43')]);_0x33702a[_0x8d7f('0x47')]=_[_0x8d7f('0x46')](_0x34c47d[_0x8d7f('0x41')],qs['fields'](_0x4d85b0[_0x8d7f('0x43')][_0x8d7f('0x48')]));_0x33702a[_0x8d7f('0x47')]=_0x33702a[_0x8d7f('0x47')]['length']?_0x33702a[_0x8d7f('0x47')]:_0x34c47d[_0x8d7f('0x41')];if(_0x4d85b0[_0x8d7f('0x43')]['includeAll']){_0x33702a[_0x8d7f('0x54')]=[{'all':!![]}];}_0x33702a=_[_0x8d7f('0x4f')]({},_0x33702a,_0x4d85b0['options']);return db[_0x8d7f('0x3f')][_0x8d7f('0x5a')](_0x33702a)[_0x8d7f('0x20')](handleEntityNotFound(_0x12bf66,null))['then'](respondWithResult(_0x12bf66,null))[_0x8d7f('0x2a')](handleError(_0x12bf66,null));};exports[_0x8d7f('0x5b')]=function(_0x1ceff0,_0x5b808e){return db[_0x8d7f('0x3f')][_0x8d7f('0x5b')](_0x1ceff0[_0x8d7f('0x5c')],{})['then'](function(_0x13d36e){var _0x2bede9=_0x1ceff0['user']['get']({'plain':!![]});if(!_0x2bede9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bede9['role']==='user'){var _0x26c42a=_0x13d36e[_0x8d7f('0x38')]({'plain':!![]});var _0x407cfb=_0x8d7f('0x5d');return db[_0x8d7f('0x5e')][_0x8d7f('0x5a')]({'where':{'name':_0x407cfb,'userProfileId':_0x2bede9[_0x8d7f('0x5f')]},'raw':!![]})[_0x8d7f('0x20')](function(_0x2a22d6){if(_0x2a22d6&&_0x2a22d6[_0x8d7f('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x26c42a[_0x8d7f('0x3a')],'resourceId':_0x26c42a['id'],'type':_0x2a22d6['name'],'sectionId':_0x2a22d6['id']},{})[_0x8d7f('0x20')](function(){return _0x13d36e;});}else{return _0x13d36e;}})[_0x8d7f('0x2a')](function(_0x64ab22){logger['error'](_0x8d7f('0x61'),_0x64ab22);throw _0x64ab22;});}return _0x13d36e;})[_0x8d7f('0x20')](respondWithResult(_0x5b808e,0xc9))[_0x8d7f('0x2a')](handleError(_0x5b808e,null));};exports[_0x8d7f('0x62')]=function(_0x81f6d6,_0x599051){if(_0x81f6d6[_0x8d7f('0x5c')]['id']){delete _0x81f6d6[_0x8d7f('0x5c')]['id'];}return db[_0x8d7f('0x3f')][_0x8d7f('0x5a')]({'where':{'id':_0x81f6d6['params']['id']},'include':[{'model':db[_0x8d7f('0x3d')],'as':_0x8d7f('0x3e')}]})[_0x8d7f('0x20')](handleEntityNotFound(_0x599051,null))[_0x8d7f('0x20')](saveUpdates(_0x81f6d6['body'],null))[_0x8d7f('0x20')](respondWithResult(_0x599051,null))[_0x8d7f('0x2a')](handleError(_0x599051,null));};exports[_0x8d7f('0x37')]=function(_0x65776a,_0x14fd5a){return db[_0x8d7f('0x3f')][_0x8d7f('0x5a')]({'where':{'id':_0x65776a[_0x8d7f('0x58')]['id']}})['then'](handleEntityNotFound(_0x14fd5a,null))[_0x8d7f('0x20')](removeEntity(_0x14fd5a,null))[_0x8d7f('0x2a')](handleError(_0x14fd5a,null));};exports[_0x8d7f('0x63')]=function(_0x52045f,_0x1b33ae){return db[_0x8d7f('0x3f')][_0x8d7f('0x63')]()[_0x8d7f('0x20')](respondWithResult(_0x1b33ae,null))[_0x8d7f('0x2a')](handleError(_0x1b33ae,null));};exports[_0x8d7f('0x64')]=function(_0x124e66,_0x756cd9,_0x48b9ba){if(_0x124e66[_0x8d7f('0x5c')]['id']){delete _0x124e66[_0x8d7f('0x5c')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x124e66[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x756cd9,null))[_0x8d7f('0x20')](function(_0x344226){if(_0x344226){_0x124e66[_0x8d7f('0x5c')][_0x8d7f('0x65')]=_0x344226['id'];return db[_0x8d7f('0x66')]['create'](_0x124e66[_0x8d7f('0x5c')]);}})[_0x8d7f('0x20')](respondWithResult(_0x756cd9,null))[_0x8d7f('0x2a')](handleError(_0x756cd9,null));};exports[_0x8d7f('0x67')]=function(_0x341bcd,_0x256281,_0x35d9e4){var _0x15d32a={'raw':![],'where':{}};var _0x447c33={};var _0x401275={'count':0x0,'rows':[]};return db[_0x8d7f('0x3f')]['findOne']({'where':{'id':_0x341bcd['params']['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x256281,null))[_0x8d7f('0x20')](function(_0xa4ef3){if(_0xa4ef3){_0x447c33[_0x8d7f('0x41')]=_[_0x8d7f('0x44')](db[_0x8d7f('0x66')][_0x8d7f('0x59')]);_0x447c33[_0x8d7f('0x43')]=_[_0x8d7f('0x44')](_0x341bcd[_0x8d7f('0x43')]);_0x447c33[_0x8d7f('0x45')]=_['intersection'](_0x447c33['model'],_0x447c33[_0x8d7f('0x43')]);_0x15d32a[_0x8d7f('0x47')]=_[_0x8d7f('0x46')](_0x447c33[_0x8d7f('0x41')],qs[_0x8d7f('0x48')](_0x341bcd['query'][_0x8d7f('0x48')]));_0x15d32a[_0x8d7f('0x47')]=_0x15d32a[_0x8d7f('0x47')][_0x8d7f('0x68')]?_0x15d32a[_0x8d7f('0x47')]:_0x447c33[_0x8d7f('0x41')];if(!_0x341bcd[_0x8d7f('0x43')]['hasOwnProperty'](_0x8d7f('0x4a'))){_0x15d32a[_0x8d7f('0x31')]=qs[_0x8d7f('0x31')](_0x341bcd['query'][_0x8d7f('0x31')]);_0x15d32a[_0x8d7f('0x2e')]=qs[_0x8d7f('0x2e')](_0x341bcd[_0x8d7f('0x43')]['offset']);}_0x15d32a[_0x8d7f('0x4b')]=qs[_0x8d7f('0x4c')](_0x341bcd[_0x8d7f('0x43')][_0x8d7f('0x4c')]);_0x15d32a['where']=qs['filters'](_['pick'](_0x341bcd['query'],_0x447c33[_0x8d7f('0x45')]));_0x15d32a['where']['FaxAccountId']=_0xa4ef3['id'];if(_0x341bcd['query']['filter']){_0x15d32a[_0x8d7f('0x4e')]=_['merge'](_0x15d32a[_0x8d7f('0x4e')],{'$or':_[_0x8d7f('0x42')](_0x15d32a['attributes'],function(_0x2c0631){var _0x3c4fd1={};_0x3c4fd1[_0x2c0631]={'$like':'%'+_0x341bcd[_0x8d7f('0x43')][_0x8d7f('0x51')]+'%'};return _0x3c4fd1;})});}_0x15d32a=_['merge']({},_0x15d32a,_0x341bcd[_0x8d7f('0x52')]);return db[_0x8d7f('0x66')][_0x8d7f('0x30')]({'where':_0x15d32a[_0x8d7f('0x4e')]})[_0x8d7f('0x20')](function(_0x774eb5){_0x401275[_0x8d7f('0x30')]=_0x774eb5;if(_0x341bcd[_0x8d7f('0x43')][_0x8d7f('0x53')]){_0x15d32a[_0x8d7f('0x54')]=[{'all':!![]}];}return db[_0x8d7f('0x66')]['findAll'](_0x15d32a);})[_0x8d7f('0x20')](function(_0x1f4470){_0x401275[_0x8d7f('0x56')]=_0x1f4470;return _0x401275;});}})[_0x8d7f('0x20')](respondWithFilteredResult(_0x256281,_0x15d32a))[_0x8d7f('0x2a')](handleError(_0x256281,null));};exports[_0x8d7f('0x69')]=function(_0x4ad045,_0x432c24,_0x18024c){return db[_0x8d7f('0x3f')][_0x8d7f('0x5a')]({'where':{'id':_0x4ad045['params']['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x432c24,null))[_0x8d7f('0x20')](function(_0x49b033){if(_0x49b033){return _0x49b033[_0x8d7f('0x69')](_0x4ad045[_0x8d7f('0x43')][_0x8d7f('0x6a')]);}})[_0x8d7f('0x20')](respondWithStatusCode(_0x432c24,null))[_0x8d7f('0x2a')](handleError(_0x432c24,null));};exports['addAnswer']=function(_0x1fe694,_0x40c7f1,_0x5970ec){if(_0x1fe694[_0x8d7f('0x5c')]['id']){delete _0x1fe694['body']['id'];}return db[_0x8d7f('0x3f')][_0x8d7f('0x5a')]({'where':{'id':_0x1fe694['params']['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x40c7f1,null))['then'](function(_0x281945){if(_0x281945){_0x1fe694[_0x8d7f('0x5c')][_0x8d7f('0x65')]=_0x281945['id'];return db[_0x8d7f('0x6b')][_0x8d7f('0x5b')](_0x1fe694[_0x8d7f('0x5c')]);}})[_0x8d7f('0x20')](respondWithResult(_0x40c7f1,null))[_0x8d7f('0x2a')](handleError(_0x40c7f1,null));};exports[_0x8d7f('0x6c')]=function(_0x51acb2,_0x17908f,_0x3b159b){var _0x411b4e={'raw':![],'where':{}};var _0x3f53d0={};var _0x2dd9e1={'count':0x0,'rows':[]};return db[_0x8d7f('0x3f')][_0x8d7f('0x6d')]({'where':{'id':_0x51acb2[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x17908f,null))[_0x8d7f('0x20')](function(_0x41bf86){if(_0x41bf86){_0x3f53d0[_0x8d7f('0x41')]=_[_0x8d7f('0x44')](db[_0x8d7f('0x6b')][_0x8d7f('0x59')]);_0x3f53d0[_0x8d7f('0x43')]=_[_0x8d7f('0x44')](_0x51acb2[_0x8d7f('0x43')]);_0x3f53d0[_0x8d7f('0x45')]=_[_0x8d7f('0x46')](_0x3f53d0['model'],_0x3f53d0['query']);_0x411b4e[_0x8d7f('0x47')]=_[_0x8d7f('0x46')](_0x3f53d0[_0x8d7f('0x41')],qs['fields'](_0x51acb2[_0x8d7f('0x43')][_0x8d7f('0x48')]));_0x411b4e[_0x8d7f('0x47')]=_0x411b4e[_0x8d7f('0x47')][_0x8d7f('0x68')]?_0x411b4e[_0x8d7f('0x47')]:_0x3f53d0[_0x8d7f('0x41')];if(!_0x51acb2[_0x8d7f('0x43')]['hasOwnProperty'](_0x8d7f('0x4a'))){_0x411b4e['limit']=qs['limit'](_0x51acb2[_0x8d7f('0x43')][_0x8d7f('0x31')]);_0x411b4e[_0x8d7f('0x2e')]=qs[_0x8d7f('0x2e')](_0x51acb2['query']['offset']);}_0x411b4e['order']=qs[_0x8d7f('0x4c')](_0x51acb2[_0x8d7f('0x43')][_0x8d7f('0x4c')]);_0x411b4e['where']=qs[_0x8d7f('0x45')](_[_0x8d7f('0x4d')](_0x51acb2[_0x8d7f('0x43')],_0x3f53d0[_0x8d7f('0x45')]));_0x411b4e[_0x8d7f('0x4e')][_0x8d7f('0x65')]=_0x41bf86['id'];if(_0x51acb2[_0x8d7f('0x43')][_0x8d7f('0x51')]){_0x411b4e[_0x8d7f('0x4e')]=_[_0x8d7f('0x4f')](_0x411b4e['where'],{'$or':_[_0x8d7f('0x42')](_0x411b4e[_0x8d7f('0x47')],function(_0x46758e){var _0x3346b1={};_0x3346b1[_0x46758e]={'$like':'%'+_0x51acb2[_0x8d7f('0x43')][_0x8d7f('0x51')]+'%'};return _0x3346b1;})});}_0x411b4e=_[_0x8d7f('0x4f')]({},_0x411b4e,_0x51acb2[_0x8d7f('0x52')]);return db[_0x8d7f('0x6b')]['count']({'where':_0x411b4e['where']})[_0x8d7f('0x20')](function(_0x28e14a){_0x2dd9e1[_0x8d7f('0x30')]=_0x28e14a;if(_0x51acb2[_0x8d7f('0x43')][_0x8d7f('0x53')]){_0x411b4e['include']=[{'all':!![]}];}return db[_0x8d7f('0x6b')][_0x8d7f('0x55')](_0x411b4e);})[_0x8d7f('0x20')](function(_0x3ee873){_0x2dd9e1[_0x8d7f('0x56')]=_0x3ee873;return _0x2dd9e1;});}})[_0x8d7f('0x20')](respondWithFilteredResult(_0x17908f,_0x411b4e))[_0x8d7f('0x2a')](handleError(_0x17908f,null));};exports[_0x8d7f('0x6e')]=function(_0x597cd8,_0x36cc2d,_0x3d4493){return db['FaxAccount'][_0x8d7f('0x5a')]({'where':{'id':_0x597cd8[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x36cc2d,null))[_0x8d7f('0x20')](function(_0x5119ed){if(_0x5119ed){return _0x5119ed['removeAnswers'](_0x597cd8[_0x8d7f('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x36cc2d,null))['catch'](handleError(_0x36cc2d,null));};exports['addInteraction']=function(_0x3b47a3,_0x236714,_0x10c608){return db[_0x8d7f('0x6f')][_0x8d7f('0x5a')]({'where':{'id':_0x3b47a3[_0x8d7f('0x58')]['id']}})['then'](handleEntityNotFound(_0x236714,null))[_0x8d7f('0x20')](function(_0x28dcb5){if(_0x28dcb5){return _0x28dcb5[_0x8d7f('0x70')](_0x3b47a3[_0x8d7f('0x5c')][_0x8d7f('0x6a')],_[_0x8d7f('0x71')](_0x3b47a3[_0x8d7f('0x5c')],[_0x8d7f('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x236714,null))[_0x8d7f('0x2a')](handleError(_0x236714,null));};exports[_0x8d7f('0x72')]=function(_0xaa2781,_0x57b0bf,_0x1df9fe){var _0x5ed9db={'raw':![],'where':{}};var _0x5d7e6b={};var _0x1414f4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xaa2781[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x57b0bf,null))[_0x8d7f('0x20')](function(_0x5111b5){if(_0x5111b5){_0x5d7e6b[_0x8d7f('0x41')]=_[_0x8d7f('0x44')](db[_0x8d7f('0x6f')][_0x8d7f('0x59')]);_0x5d7e6b[_0x8d7f('0x43')]=_[_0x8d7f('0x44')](_0xaa2781['query']);_0x5d7e6b[_0x8d7f('0x45')]=_[_0x8d7f('0x46')](_0x5d7e6b['model'],_0x5d7e6b[_0x8d7f('0x43')]);_0x5ed9db[_0x8d7f('0x47')]=_[_0x8d7f('0x46')](_0x5d7e6b[_0x8d7f('0x41')],qs['fields'](_0xaa2781[_0x8d7f('0x43')][_0x8d7f('0x48')]));_0x5ed9db[_0x8d7f('0x47')]=_0x5ed9db[_0x8d7f('0x47')][_0x8d7f('0x68')]?_0x5ed9db['attributes']:_0x5d7e6b['model'];if(!_0xaa2781['query'][_0x8d7f('0x49')](_0x8d7f('0x4a'))){_0x5ed9db[_0x8d7f('0x31')]=qs[_0x8d7f('0x31')](_0xaa2781[_0x8d7f('0x43')]['limit']);_0x5ed9db['offset']=qs[_0x8d7f('0x2e')](_0xaa2781['query']['offset']);}_0x5ed9db['order']=qs[_0x8d7f('0x4c')](_0xaa2781[_0x8d7f('0x43')]['sort']);_0x5ed9db[_0x8d7f('0x4e')]=qs[_0x8d7f('0x45')](_['pick'](_0xaa2781[_0x8d7f('0x43')],_0x5d7e6b['filters']));_0x5ed9db[_0x8d7f('0x4e')][_0x8d7f('0x65')]=_0x5111b5['id'];if(_0xaa2781[_0x8d7f('0x43')]['filter']){_0x5ed9db[_0x8d7f('0x4e')]=_[_0x8d7f('0x4f')](_0x5ed9db[_0x8d7f('0x4e')],{'$or':_[_0x8d7f('0x42')](_0x5ed9db[_0x8d7f('0x47')],function(_0x216bcd){var _0x2209a8={};_0x2209a8[_0x216bcd]={'$like':'%'+_0xaa2781['query'][_0x8d7f('0x51')]+'%'};return _0x2209a8;})});}_0x5ed9db=_[_0x8d7f('0x4f')]({},_0x5ed9db,_0xaa2781[_0x8d7f('0x52')]);return db[_0x8d7f('0x6f')][_0x8d7f('0x30')]({'where':_0x5ed9db['where']})[_0x8d7f('0x20')](function(_0x8f6d2f){_0x1414f4[_0x8d7f('0x30')]=_0x8f6d2f;if(_0xaa2781[_0x8d7f('0x43')][_0x8d7f('0x53')]){_0x5ed9db[_0x8d7f('0x54')]=[{'model':db[_0x8d7f('0x73')],'as':_0x8d7f('0x74'),'required':![]},{'model':db[_0x8d7f('0x75')],'as':_0x8d7f('0x76'),'attributes':[_0x8d7f('0x3a'),'fullname',_0x8d7f('0x77')],'required':![]},{'model':db[_0x8d7f('0x78')],'as':_0x8d7f('0x79'),'attributes':['id',_0x8d7f('0x3a'),_0x8d7f('0x7a')],'where':_0xaa2781[_0x8d7f('0x43')]['tag']?{'id':_0xaa2781['query'][_0x8d7f('0x7b')]}:undefined,'required':_0xaa2781[_0x8d7f('0x43')]['tag']?!![]:![]}];}return db[_0x8d7f('0x6f')][_0x8d7f('0x55')](_0x5ed9db);})['then'](function(_0x50e064){_0x1414f4['rows']=_0x50e064;return _0x1414f4;});}})[_0x8d7f('0x20')](respondWithFilteredResult(_0x57b0bf,_0x5ed9db))[_0x8d7f('0x2a')](handleError(_0x57b0bf,null));};exports[_0x8d7f('0x7c')]=function(_0x1cab59,_0x11e908){var _0x1824af=_0x1cab59[_0x8d7f('0x58')]['id'];var _0x50d271=_0x1cab59['body'];var _0x34e2f7=0xc8;var _0x2f2f7b=null;return db['sequelize'][_0x8d7f('0x7d')]({'isolationLevel':db['sequelize']['Transaction'][_0x8d7f('0x7e')][_0x8d7f('0x7f')]},function(_0x559711){return db['FaxAccount'][_0x8d7f('0x6d')]({'where':{'id':_0x1824af},'transaction':_0x559711})[_0x8d7f('0x20')](function(_0x46cd9a){if(_0x46cd9a){return db['FaxApplication'][_0x8d7f('0x37')]({'where':{'FaxAccountId':_0x1824af},'transaction':_0x559711})[_0x8d7f('0x20')](function(){var _0x56fc2e=_['map'](_0x50d271,function(_0x42a35a){_0x42a35a[_0x8d7f('0x65')]=_0x1824af;return _0x42a35a;});return db['FaxApplication'][_0x8d7f('0x80')](_0x56fc2e,{'transaction':_0x559711});});}else{_0x34e2f7=0x194;_0x2f2f7b=[];}});})[_0x8d7f('0x20')](function(){if(_0x34e2f7!==0x194){return db[_0x8d7f('0x81')][_0x8d7f('0x82')]({'where':{'FaxAccountId':_0x1824af},'order':_0x8d7f('0x83')})[_0x8d7f('0x20')](function(_0x157056){_0x2f2f7b=_0x157056;});}})[_0x8d7f('0x2a')](function(_0x2eb054){_0x34e2f7=0x1f4;logger['error'](_0x2eb054[_0x8d7f('0x84')]);if(_0x2eb054[_0x8d7f('0x3a')]){delete _0x2eb054['name'];}_0x2f2f7b=_0x2eb054;})['finally'](function(){if(_0x2f2f7b===null){_0x11e908[_0x8d7f('0x2b')](_0x34e2f7);}else{if(_0x34e2f7===0x1f4){_0x11e908[_0x8d7f('0x2c')](_0x34e2f7)[_0x8d7f('0x3b')](_0x2f2f7b);}else{_0x11e908['status'](_0x34e2f7)[_0x8d7f('0x33')](_0x2f2f7b);}}});};exports[_0x8d7f('0x85')]=function(_0x3f213e,_0x97593b,_0x40a16b){var _0x38cac2={};var _0x18ca41={};var _0x1966a6;var _0x15d49d;return db[_0x8d7f('0x3f')][_0x8d7f('0x6d')]({'where':{'id':_0x3f213e[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x97593b,null))['then'](function(_0x34906d){if(_0x34906d){_0x1966a6=_0x34906d;_0x18ca41[_0x8d7f('0x41')]=_[_0x8d7f('0x44')](db['FaxApplication'][_0x8d7f('0x59')]);_0x18ca41['query']=_[_0x8d7f('0x44')](_0x3f213e['query']);_0x18ca41[_0x8d7f('0x45')]=_[_0x8d7f('0x46')](_0x18ca41[_0x8d7f('0x41')],_0x18ca41[_0x8d7f('0x43')]);_0x38cac2[_0x8d7f('0x47')]=_[_0x8d7f('0x46')](_0x18ca41['model'],qs[_0x8d7f('0x48')](_0x3f213e['query'][_0x8d7f('0x48')]));_0x38cac2['attributes']=_0x38cac2[_0x8d7f('0x47')]['length']?_0x38cac2[_0x8d7f('0x47')]:_0x18ca41[_0x8d7f('0x41')];_0x38cac2['order']=qs[_0x8d7f('0x4c')](_0x3f213e[_0x8d7f('0x43')][_0x8d7f('0x4c')]);_0x38cac2[_0x8d7f('0x4e')]=qs[_0x8d7f('0x45')](_['pick'](_0x3f213e[_0x8d7f('0x43')],_0x18ca41['filters']));if(_0x3f213e[_0x8d7f('0x43')][_0x8d7f('0x51')]){_0x38cac2['where']=_[_0x8d7f('0x4f')](_0x38cac2[_0x8d7f('0x4e')],{'$or':_[_0x8d7f('0x42')](_0x38cac2[_0x8d7f('0x47')],function(_0x5dc241){var _0x5ebfde={};_0x5ebfde[_0x5dc241]={'$like':'%'+_0x3f213e[_0x8d7f('0x43')][_0x8d7f('0x51')]+'%'};return _0x5ebfde;})});}_0x38cac2=_[_0x8d7f('0x4f')]({},_0x38cac2,_0x3f213e['options']);return _0x1966a6['getApplications'](_0x38cac2);}})[_0x8d7f('0x20')](function(_0x51348d){if(_0x51348d){_0x15d49d=_0x51348d[_0x8d7f('0x68')];if(!_0x3f213e['query'][_0x8d7f('0x49')](_0x8d7f('0x4a'))){_0x38cac2[_0x8d7f('0x31')]=qs[_0x8d7f('0x31')](_0x3f213e[_0x8d7f('0x43')][_0x8d7f('0x31')]);_0x38cac2[_0x8d7f('0x2e')]=qs[_0x8d7f('0x2e')](_0x3f213e[_0x8d7f('0x43')]['offset']);}return _0x1966a6[_0x8d7f('0x85')](_0x38cac2);}})[_0x8d7f('0x20')](function(_0x4171a2){if(_0x4171a2){return _0x4171a2?{'count':_0x15d49d,'rows':_0x4171a2}:null;}})[_0x8d7f('0x20')](respondWithResult(_0x97593b,null))['catch'](handleError(_0x97593b,null));};function Extension(_0x2dc0a8,_0x3047ca,_0x25438d,_0x15a675){this['context']=_0x8d7f('0x86');this['exten']=_0x2dc0a8[_0x8d7f('0x87')];this['app']=_0x15a675;this[_0x8d7f('0x40')]=_0x8d7f('0x88');this['description']=_0x8d7f('0x89');this[_0x8d7f('0x65')]=_0x2dc0a8['id'];this[_0x8d7f('0x83')]=_0x3047ca;this['appdata']=_0x25438d;}function createExtensionsReciveFax(_0x2acc56){var _0x40d7cd=0x1;var _0x52f960=[];_0x52f960[_0x8d7f('0x8a')](new Extension(_0x2acc56,_0x40d7cd,'',_0x8d7f('0x8b')));_0x40d7cd+=0x1;_0x52f960['push'](new Extension(_0x2acc56,_0x40d7cd,_0x8d7f('0x8c'),_0x8d7f('0x8d')));_0x40d7cd+=0x1;for(var _0x12e00e in _0x2acc56){if(_0x2acc56[_0x8d7f('0x49')](_0x12e00e)&&(_0x12e00e==='ecm'||_0x12e00e===_0x8d7f('0x87')||_0x12e00e===_0x8d7f('0x8e')||_0x12e00e===_0x8d7f('0x8f')||_0x12e00e===_0x8d7f('0x90')||_0x12e00e===_0x8d7f('0x91')||_0x12e00e===_0x8d7f('0x92')||_0x12e00e==='modem'||_0x12e00e==='t38timeout')){_0x52f960['push'](new Extension(_0x2acc56,_0x40d7cd,_0x8d7f('0x93')+_0x12e00e+')='+_0x2acc56[_0x12e00e],_0x8d7f('0x8d')));_0x40d7cd+=0x1;}}_0x52f960[_0x8d7f('0x8a')](new Extension(_0x2acc56,_0x40d7cd,'6',_0x8d7f('0x94')));_0x40d7cd+=0x1;_0x52f960['push'](new Extension(_0x2acc56,_0x40d7cd,_0x8d7f('0x95'),_0x8d7f('0x96')));_0x40d7cd=0x0;return _0x52f960;}exports['addAccountApplications']=function(_0x2d27ca,_0x48410c,_0x33d291){var _0x54eea7;return db['sequelize']['transaction'](function(_0x2a8f57){return db[_0x8d7f('0x3f')][_0x8d7f('0x5b')](_0x2d27ca[_0x8d7f('0x5c')],{'transaction':_0x2a8f57})['then'](function(_0x20b41a){_0x54eea7=_0x20b41a['get']({'plain':!![]});return db[_0x8d7f('0x97')][_0x8d7f('0x80')](createExtensionsReciveFax(_0x54eea7),{'transaction':_0x2a8f57});});})[_0x8d7f('0x20')](function(){return _0x54eea7;})[_0x8d7f('0x20')](respondWithResult(_0x48410c,null))[_0x8d7f('0x2a')](handleError(_0x48410c,null));};exports[_0x8d7f('0x98')]=function(_0x2e2931,_0x1b5807,_0x3dffd7){var _0x30d7f8;return db[_0x8d7f('0x99')]['transaction'](function(_0x87b82f){return db[_0x8d7f('0x3f')][_0x8d7f('0x62')](_0x2e2931['body'],{'where':{'id':_0x2e2931[_0x8d7f('0x5c')]['id']},'transaction':_0x87b82f})[_0x8d7f('0x20')](function(_0x2d8e09){return db[_0x8d7f('0x97')]['destroy']({'where':{'FaxAccountId':_0x2e2931[_0x8d7f('0x5c')]['id']},'transaction':_0x87b82f})[_0x8d7f('0x20')](function(_0x1648b6){return db[_0x8d7f('0x97')][_0x8d7f('0x80')](createExtensionsReciveFax(_[_0x8d7f('0x71')](_0x2e2931[_0x8d7f('0x5c')],['tech','key','createdAt',_0x8d7f('0x9a'),_0x8d7f('0x9b'),_0x8d7f('0x9c')])),{'transaction':_0x87b82f});});});})['then'](function(){return db[_0x8d7f('0x3f')][_0x8d7f('0x9d')](_0x2e2931[_0x8d7f('0x5c')]['id']);})['then'](respondWithResult(_0x1b5807,null))[_0x8d7f('0x2a')](handleError(_0x1b5807,null));};exports[_0x8d7f('0x9e')]=function(_0x3fc073,_0x5de474,_0xacc16){var _0x18eb94={'raw':!![],'where':{}};var _0x5e4857={};var _0x24720c={'count':0x0,'rows':[]};return db[_0x8d7f('0x3f')][_0x8d7f('0x6d')]({'where':{'id':_0x3fc073[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x5de474,null))[_0x8d7f('0x20')](function(_0x502cd1){if(_0x502cd1){_0x5e4857[_0x8d7f('0x41')]=_[_0x8d7f('0x44')](db[_0x8d7f('0x9f')]['rawAttributes']);_0x5e4857[_0x8d7f('0x43')]=_[_0x8d7f('0x44')](_0x3fc073[_0x8d7f('0x43')]);_0x5e4857[_0x8d7f('0x45')]=_[_0x8d7f('0x46')](_0x5e4857['model'],_0x5e4857[_0x8d7f('0x43')]);_0x18eb94[_0x8d7f('0x47')]=_[_0x8d7f('0x46')](_0x5e4857['model'],qs['fields'](_0x3fc073[_0x8d7f('0x43')][_0x8d7f('0x48')]));_0x18eb94['attributes']=_0x18eb94[_0x8d7f('0x47')][_0x8d7f('0x68')]?_0x18eb94[_0x8d7f('0x47')]:_0x5e4857[_0x8d7f('0x41')];if(!_0x3fc073[_0x8d7f('0x43')][_0x8d7f('0x49')](_0x8d7f('0x4a'))){_0x18eb94['limit']=qs[_0x8d7f('0x31')](_0x3fc073[_0x8d7f('0x43')]['limit']);_0x18eb94[_0x8d7f('0x2e')]=qs[_0x8d7f('0x2e')](_0x3fc073[_0x8d7f('0x43')][_0x8d7f('0x2e')]);}_0x18eb94[_0x8d7f('0x4b')]=qs[_0x8d7f('0x4c')](_0x3fc073[_0x8d7f('0x43')]['sort']);_0x18eb94['where']=qs[_0x8d7f('0x45')](_[_0x8d7f('0x4d')](_0x3fc073[_0x8d7f('0x43')],_0x5e4857['filters']));_0x18eb94[_0x8d7f('0x4e')][_0x8d7f('0x65')]=_0x502cd1['id'];if(_0x3fc073[_0x8d7f('0x43')][_0x8d7f('0x51')]){_0x18eb94[_0x8d7f('0x4e')]=_[_0x8d7f('0x4f')](_0x18eb94[_0x8d7f('0x4e')],{'$or':_[_0x8d7f('0x42')](_0x18eb94['attributes'],function(_0x5941c4){var _0x198504={};_0x198504[_0x5941c4]={'$like':'%'+_0x3fc073[_0x8d7f('0x43')][_0x8d7f('0x51')]+'%'};return _0x198504;})});}if(_0x3fc073[_0x8d7f('0x43')][_0x8d7f('0xa0')]){var _0x520444=_0x3fc073[_0x8d7f('0x43')]['$gte'][_0x8d7f('0xa1')](',');var _0x4c63e3={};_0x4c63e3[_0x520444[0x0]]={'$gte':moment(_0x520444[0x1])[_0x8d7f('0xa2')](_0x8d7f('0xa3'))};_0x18eb94[_0x8d7f('0x4e')]=_[_0x8d7f('0x4f')](_0x18eb94[_0x8d7f('0x4e')],_0x4c63e3);}_0x18eb94=_['merge']({},_0x18eb94,_0x3fc073['options']);return db[_0x8d7f('0x9f')]['count']({'where':_0x18eb94[_0x8d7f('0x4e')]})[_0x8d7f('0x20')](function(_0x36468b){_0x24720c['count']=_0x36468b;if(_0x3fc073['query']['includeAll']){_0x18eb94[_0x8d7f('0x54')]=[{'all':!![]}];}return db[_0x8d7f('0x9f')][_0x8d7f('0x55')](_0x18eb94);})['then'](function(_0x18dbd0){_0x24720c[_0x8d7f('0x56')]=_0x18dbd0;return _0x24720c;});}})['then'](respondWithFilteredResult(_0x5de474,_0x18eb94))[_0x8d7f('0x2a')](handleError(_0x5de474,null));};exports[_0x8d7f('0x3b')]=function(_0x58a290,_0x109912,_0x26ddad){var _0x1fe650,_0x8b8e6b={},_0x4988f8;if(_0x58a290[_0x8d7f('0x5c')]['to']){_0x4988f8=_0x58a290[_0x8d7f('0x5c')]['to'][0x0];}return db[_0x8d7f('0x3f')]['find']({'where':{'id':_0x58a290['params']['id']},'include':[{'model':db[_0x8d7f('0xa4')],'as':_0x8d7f('0xa5'),'include':[{'model':db[_0x8d7f('0x73')],'as':_0x8d7f('0xa6'),'where':{'fax':_0x4988f8},'limit':0x1,'order':[['updatedAt',_0x8d7f('0xa7')]]}]}]})[_0x8d7f('0x20')](handleEntityNotFound(_0x109912,null))[_0x8d7f('0x20')](function(_0x46ee03){_0x1fe650=_0x46ee03;if(_0x58a290['body'][_0x8d7f('0xa8')]&&_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')]['length']){for(var _0x5561b7=0x0;_0x5561b7<_0x58a290['body']['attachments'][_0x8d7f('0x68')];_0x5561b7+=0x1){_0x58a290['body']['attachments'][_0x5561b7]={'filename':_0x58a290['body'][_0x8d7f('0xa8')][_0x5561b7]['name'],'id':_0x58a290['body']['attachments'][_0x5561b7]['id'],'path':path[_0x8d7f('0xa9')](config[_0x8d7f('0xaa')],_0x8d7f('0xab'),_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')][_0x5561b7][_0x8d7f('0xac')])};}}return respondWithRpcPromise('CheckAfterSend',_0x8d7f('0xad'),{'FaxAccountId':_['isNil'](_0x58a290[_0x8d7f('0x58')]['id'])?undefined:_0x58a290[_0x8d7f('0x58')]['id'],'path':_[_0x8d7f('0xae')](_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')][0x0]['path'])?undefined:_0x58a290[_0x8d7f('0x5c')]['attachments'][0x0][_0x8d7f('0xaf')],'fax':_[_0x8d7f('0xae')](_0x58a290[_0x8d7f('0x5c')]['to'][0x0])?undefined:_0x58a290[_0x8d7f('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x1fe650){if(_[_0x8d7f('0xae')](_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xb0')])){_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xb0')]=util[_0x8d7f('0xa2')]('\x22%s\x22\x20<%s>',_0x1fe650['name'],_0x1fe650[_0x8d7f('0xb1')]);}if(_0x1fe650[_0x8d7f('0xa5')]){if(_0x1fe650[_0x8d7f('0xa5')][_0x8d7f('0xa6')][_0x8d7f('0x68')]){return _0x1fe650[_0x8d7f('0xa5')][_0x8d7f('0xa6')][0x0];}else{return db['CmContact'][_0x8d7f('0x5b')](_[_0x8d7f('0x17')](_0x58a290[_0x8d7f('0x5c')],{'firstName':_0x58a290[_0x8d7f('0x5c')]['to'][0x0],'phone':_0x58a290['body']['to'][0x0],'fax':_0x58a290['body']['to'][0x0],'ListId':_0x1fe650[_0x8d7f('0x9c')]}));}}else{throw new Error(_0x8d7f('0xb2'));}}else{throw new Error(_0x8d7f('0xb3'));}})['then'](function(_0x232592){if(_0x232592){return db[_0x8d7f('0x6f')][_0x8d7f('0x5a')]({'where':{'ContactId':_0x232592['id'],'closed':![],'FaxAccountId':_0x1fe650['id']}})[_0x8d7f('0x20')](function(_0x4d25b5){if(_0x4d25b5){return[_0x4d25b5,![]];}return db[_0x8d7f('0x6f')][_0x8d7f('0x5b')]({'UserId':_0x58a290[_0x8d7f('0xb4')]['id'],'ContactId':_0x232592['id'],'FaxAccountId':_0x1fe650['id'],'fax':_0x58a290[_0x8d7f('0x5c')]['to'][0x0],'firstMsgDirection':_0x8d7f('0xb5'),'Messages':[_['merge'](_0x58a290[_0x8d7f('0x5c')],{'read':![],'body':_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')][0x0]['filename'],'FaxAccountId':_0x1fe650['id'],'UserId':_0x58a290['user']['id'],'ContactId':_0x232592['id'],'AttachmentId':_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x8d7f('0x9f')],'as':'Messages'}]})[_0x8d7f('0x20')](function(_0x48a169){return[_0x48a169,!![]];});});}else{throw new Error(_0x8d7f('0xb6'));}})['spread'](function(_0x4fb921,_0x7702){if(_0x7702){return _0x4fb921;}return db[_0x8d7f('0x9f')]['create']({'direction':'out','read':![],'body':_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')][0x0][_0x8d7f('0xb7')],'FaxAccountId':_0x1fe650['id'],'FaxInteractionId':_0x4fb921['id'],'UserId':_0x58a290['user']['id'],'ContactId':_0x4fb921[_0x8d7f('0xb8')],'AttachmentId':_0x58a290['body'][_0x8d7f('0xa8')][0x0]['id']})[_0x8d7f('0x20')](function(_0x44981c){_0x4fb921[_0x8d7f('0xb9')]['Messages']=[];_0x4fb921['dataValues'][_0x8d7f('0xba')][_0x8d7f('0x8a')](_0x44981c['dataValues']);return _0x4fb921;});})[_0x8d7f('0x20')](function(_0x206f32){respondWithRpcPromise(_0x8d7f('0xbb'),_0x8d7f('0xbb'),{'FaxAccountId':_[_0x8d7f('0xae')](_0x58a290[_0x8d7f('0x58')]['id'])?undefined:_0x58a290['params']['id'],'path':_[_0x8d7f('0xae')](_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')][0x0][_0x8d7f('0xaf')])?undefined:_0x58a290[_0x8d7f('0x5c')][_0x8d7f('0xa8')][0x0][_0x8d7f('0xaf')],'fax':_['isNil'](_0x58a290['body']['to'][0x0])?undefined:_0x58a290[_0x8d7f('0x5c')]['to'][0x0],'AttachmentId':_0x58a290['body']['attachments'][0x0]['id']},client9002)[_0x8d7f('0x20')](function(_0x31f03e){logger[_0x8d7f('0x21')](_0x8d7f('0xbc'),_0x31f03e);})['catch'](function(_0x5a81ad){logger[_0x8d7f('0x21')](_0x8d7f('0xbc'),_0x5a81ad);});return _0x206f32;})[_0x8d7f('0x20')](respondWithResult(_0x109912,null))[_0x8d7f('0x2a')](handleError(_0x109912,null));};exports[_0x8d7f('0xbd')]=function(_0x31caa6,_0x232e15,_0x936384){return db[_0x8d7f('0x3f')][_0x8d7f('0x5a')]({'where':{'id':_0x31caa6[_0x8d7f('0x58')]['id']}})['then'](handleEntityNotFound(_0x232e15,null))[_0x8d7f('0x20')](function(_0x538e5e){if(_0x538e5e){return _0x538e5e['addAgents'](_0x31caa6[_0x8d7f('0x5c')][_0x8d7f('0x6a')],_[_0x8d7f('0x71')](_0x31caa6[_0x8d7f('0x5c')],[_0x8d7f('0x6a'),'id'])||{})[_0x8d7f('0xbe')](function(_0x3b338d){for(var _0x213402=0x0;_0x213402<_0x31caa6[_0x8d7f('0x5c')][_0x8d7f('0x6a')][_0x8d7f('0x68')];_0x213402+=0x1){socket[_0x8d7f('0xbf')](_0x8d7f('0xc0'),{'UserId':Number(_0x31caa6[_0x8d7f('0x5c')][_0x8d7f('0x6a')][_0x213402]),'FaxAccountId':Number(_0x31caa6[_0x8d7f('0x58')]['id'])});}return _0x3b338d;});}})[_0x8d7f('0x20')](respondWithResult(_0x232e15,null))['catch'](handleError(_0x232e15,null));};exports[_0x8d7f('0xc1')]=function(_0x32adb8,_0x3a3063,_0x3576a9){return db['FaxAccount']['find']({'where':{'id':_0x32adb8[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x3a3063,null))['then'](function(_0x608796){if(_0x608796){return _0x608796[_0x8d7f('0xc1')](_0x32adb8[_0x8d7f('0x43')][_0x8d7f('0x6a')])[_0x8d7f('0x20')](function(){if(_[_0x8d7f('0xc2')](_0x32adb8['query'][_0x8d7f('0x6a')])){for(var _0x1f28c7=0x0;_0x1f28c7<_0x32adb8[_0x8d7f('0x43')][_0x8d7f('0x6a')][_0x8d7f('0x68')];_0x1f28c7+=0x1){socket['emit'](_0x8d7f('0xc3'),{'UserId':Number(_0x32adb8[_0x8d7f('0x43')][_0x8d7f('0x6a')][_0x1f28c7]),'FaxAccountId':Number(_0x32adb8[_0x8d7f('0x58')]['id'])});}}else{socket[_0x8d7f('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x32adb8[_0x8d7f('0x43')][_0x8d7f('0x6a')]),'FaxAccountId':Number(_0x32adb8[_0x8d7f('0x58')]['id'])});}});}})[_0x8d7f('0x20')](respondWithStatusCode(_0x3a3063,null))[_0x8d7f('0x2a')](handleError(_0x3a3063,null));};exports[_0x8d7f('0xc4')]=function(_0x53de6e,_0x437fd8,_0x81e250){var _0x226a0c={};var _0x4dff49={};var _0x2e1e92;var _0x24adc0;return db['FaxAccount'][_0x8d7f('0x6d')]({'where':{'id':_0x53de6e[_0x8d7f('0x58')]['id']}})[_0x8d7f('0x20')](handleEntityNotFound(_0x437fd8,null))[_0x8d7f('0x20')](function(_0x5e9a63){if(_0x5e9a63){_0x2e1e92=_0x5e9a63;_0x4dff49[_0x8d7f('0x41')]=_[_0x8d7f('0x44')](db[_0x8d7f('0x75')]['rawAttributes']);_0x4dff49[_0x8d7f('0x43')]=_[_0x8d7f('0x44')](_0x53de6e[_0x8d7f('0x43')]);_0x4dff49[_0x8d7f('0x45')]=_['intersection'](_0x4dff49[_0x8d7f('0x41')],_0x4dff49[_0x8d7f('0x43')]);_0x226a0c[_0x8d7f('0x47')]=_[_0x8d7f('0x46')](_0x4dff49[_0x8d7f('0x41')],qs[_0x8d7f('0x48')](_0x53de6e['query']['fields']));_0x226a0c['attributes']=_0x226a0c[_0x8d7f('0x47')][_0x8d7f('0x68')]?_0x226a0c['attributes']:_0x4dff49[_0x8d7f('0x41')];_0x226a0c[_0x8d7f('0x4b')]=qs[_0x8d7f('0x4c')](_0x53de6e[_0x8d7f('0x43')][_0x8d7f('0x4c')]);_0x226a0c[_0x8d7f('0x4e')]=qs[_0x8d7f('0x45')](_['pick'](_0x53de6e[_0x8d7f('0x43')],_0x4dff49[_0x8d7f('0x45')]));if(_0x53de6e[_0x8d7f('0x43')]['filter']){_0x226a0c[_0x8d7f('0x4e')]=_[_0x8d7f('0x4f')](_0x226a0c[_0x8d7f('0x4e')],{'$or':_[_0x8d7f('0x42')](_0x226a0c[_0x8d7f('0x47')],function(_0x4e1569){var _0x69aa52={};_0x69aa52[_0x4e1569]={'$like':'%'+_0x53de6e[_0x8d7f('0x43')][_0x8d7f('0x51')]+'%'};return _0x69aa52;})});}_0x226a0c=_[_0x8d7f('0x4f')]({},_0x226a0c,_0x53de6e[_0x8d7f('0x52')]);return _0x2e1e92[_0x8d7f('0xc4')](_0x226a0c);}})['then'](function(_0x338750){if(_0x338750){_0x24adc0=_0x338750['length'];if(!_0x53de6e['query'][_0x8d7f('0x49')]('nolimit')){_0x226a0c[_0x8d7f('0x31')]=qs['limit'](_0x53de6e[_0x8d7f('0x43')]['limit']);_0x226a0c[_0x8d7f('0x2e')]=qs['offset'](_0x53de6e[_0x8d7f('0x43')][_0x8d7f('0x2e')]);}return _0x2e1e92['getAgents'](_0x226a0c);}})[_0x8d7f('0x20')](function(_0x5d706a){if(_0x5d706a){return _0x5d706a?{'count':_0x24adc0,'rows':_0x5d706a}:null;}})[_0x8d7f('0x20')](respondWithResult(_0x437fd8,null))[_0x8d7f('0x2a')](handleError(_0x437fd8,null));}; \ No newline at end of file +var _0x52d9=['appdata','push','CDR(type)=inbound-fax','ecm','localstationid','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','findById','$gte','split','format','FaxMessage','CmList','CmContact','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','ListId','Send\x20Fax\x20failed','out','filename','ContactId','Messages','SendFax','info','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','request','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','FaxAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','FaxAccount','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','Pause','describe','Disposition','getDispositions','findOne','pick','FaxAccountId','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','omit','FaxInteraction','Contact','User','Owner','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','sendStatus','getApplications','context','from-voip-provider','exten','type','system'];(function(_0x31d3a7,_0xa34e92){var _0x537351=function(_0x137da6){while(--_0x137da6){_0x31d3a7['push'](_0x31d3a7['shift']());}};_0x537351(++_0xa34e92);}(_0x52d9,0xfb));var _0x952d=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x52d9[_0x4bd950];return _0x5dc59a;};'use strict';var emlformat=require(_0x952d('0x0'));var rimraf=require(_0x952d('0x1'));var zipdir=require(_0x952d('0x2'));var jsonpatch=require(_0x952d('0x3'));var rp=require(_0x952d('0x4'));var moment=require(_0x952d('0x5'));var BPromise=require(_0x952d('0x6'));var Mustache=require(_0x952d('0x7'));var util=require(_0x952d('0x8'));var path=require(_0x952d('0x9'));var sox=require('sox');var csv=require(_0x952d('0xa'));var ejs=require(_0x952d('0xb'));var fs=require('fs');var fs_extra=require(_0x952d('0xc'));var _=require('lodash');var squel=require(_0x952d('0xd'));var crypto=require(_0x952d('0xe'));var jsforce=require(_0x952d('0xf'));var deskjs=require(_0x952d('0x10'));var toCsv=require(_0x952d('0xa'));var querystring=require(_0x952d('0x11'));var Papa=require(_0x952d('0x12'));var Redis=require(_0x952d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x952d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x952d('0x15'))(_0x952d('0x16'));var utils=require(_0x952d('0x17'));var config=require(_0x952d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x952d('0x19'))['db'];config[_0x952d('0x1a')]=_[_0x952d('0x1b')](config[_0x952d('0x1a')],{'host':_0x952d('0x1c'),'port':0x18eb});var socket=require(_0x952d('0x1d'))(new Redis(config[_0x952d('0x1a')]));require('./faxAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x952d('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x952d('0x1e')][_0x952d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2bbd49,_0x4ebd61,_0x5ab948,_0x2d3b62){return new BPromise(function(_0x1262a5,_0x5b53a7){var _0x25efa9=_0x2d3b62||client;return _0x25efa9[_0x952d('0x20')](_0x2bbd49,_0x5ab948)['then'](function(_0x3f875b){logger['info'](_0x952d('0x21'),_0x4ebd61,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4ebd61,_0x952d('0x22'),JSON[_0x952d('0x23')](_0x3f875b));if(_0x3f875b[_0x952d('0x24')]){if(_0x3f875b[_0x952d('0x24')][_0x952d('0x25')]===0x1f4){logger[_0x952d('0x24')](_0x952d('0x21'),_0x4ebd61,_0x3f875b['error'][_0x952d('0x26')]);return _0x5b53a7(_0x3f875b[_0x952d('0x24')][_0x952d('0x26')]);}logger[_0x952d('0x24')](_0x952d('0x21'),_0x4ebd61,_0x3f875b[_0x952d('0x24')][_0x952d('0x26')]);return _0x1262a5(_0x3f875b['error'][_0x952d('0x26')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4ebd61,_0x952d('0x22'));_0x1262a5(_0x3f875b['result']['message']);}})[_0x952d('0x27')](function(_0x328443){logger[_0x952d('0x24')]('FaxAccount,\x20%s,\x20%s',_0x4ebd61,_0x328443);_0x5b53a7(_0x328443);});});}function respondWithStatusCode(_0x54d8c1,_0x3aa169){_0x3aa169=_0x3aa169||0xcc;return function(_0x181ca6){if(_0x181ca6){return _0x54d8c1['sendStatus'](_0x3aa169);}return _0x54d8c1[_0x952d('0x28')](_0x3aa169)[_0x952d('0x29')]();};}function respondWithResult(_0x3bcf9e,_0x4a88ea){_0x4a88ea=_0x4a88ea||0xc8;return function(_0x4257f8){if(_0x4257f8){return _0x3bcf9e[_0x952d('0x28')](_0x4a88ea)[_0x952d('0x2a')](_0x4257f8);}};}function respondWithFilteredResult(_0x1cde36,_0x380917){return function(_0x191c7a){if(_0x191c7a){var _0x44b7ee=typeof _0x380917[_0x952d('0x2b')]==='undefined'&&typeof _0x380917[_0x952d('0x2c')]===_0x952d('0x2d');var _0x4ddf3a=_0x191c7a[_0x952d('0x2e')];var _0x13b241=_0x44b7ee?0x0:_0x380917[_0x952d('0x2b')];var _0x57cdf4=_0x44b7ee?_0x191c7a[_0x952d('0x2e')]:_0x380917[_0x952d('0x2b')]+_0x380917[_0x952d('0x2c')];var _0x55226f;if(_0x57cdf4>=_0x4ddf3a){_0x57cdf4=_0x4ddf3a;_0x55226f=0xc8;}else{_0x55226f=0xce;}_0x1cde36['status'](_0x55226f);return _0x1cde36[_0x952d('0x2f')](_0x952d('0x30'),_0x13b241+'-'+_0x57cdf4+'/'+_0x4ddf3a)[_0x952d('0x2a')](_0x191c7a);}return null;};}function patchUpdates(_0x1fdca8){return function(_0x225428){try{jsonpatch[_0x952d('0x31')](_0x225428,_0x1fdca8,!![]);}catch(_0x2f847d){return BPromise['reject'](_0x2f847d);}return _0x225428[_0x952d('0x32')]();};}function saveUpdates(_0x44bcf0,_0x6d7fb3){return function(_0x23ccae){if(_0x23ccae){return _0x23ccae['update'](_0x44bcf0)[_0x952d('0x33')](function(_0x573e3f){return _0x573e3f;});}return null;};}function removeEntity(_0x4d50ce,_0x17126d){return function(_0x52759d){if(_0x52759d){return _0x52759d[_0x952d('0x34')]()[_0x952d('0x33')](function(){var _0x42d84c=_0x52759d['get']({'plain':!![]});var _0x587de4=_0x952d('0x35');return db[_0x952d('0x36')][_0x952d('0x34')]({'where':{'type':_0x587de4,'resourceId':_0x42d84c['id']}})['then'](function(){return _0x52759d;});})[_0x952d('0x33')](function(){_0x4d50ce[_0x952d('0x28')](0xcc)[_0x952d('0x29')]();});}};}function handleEntityNotFound(_0x1de3c9,_0x5a54f5){return function(_0x17042f){if(!_0x17042f){_0x1de3c9['sendStatus'](0x194);}return _0x17042f;};}function handleError(_0x4a16e4,_0x38615f){_0x38615f=_0x38615f||0x1f4;return function(_0x4f424c){logger[_0x952d('0x24')](_0x4f424c['stack']);if(_0x4f424c[_0x952d('0x37')]){delete _0x4f424c[_0x952d('0x37')];}_0x4a16e4[_0x952d('0x28')](_0x38615f)[_0x952d('0x38')](_0x4f424c);};}exports[_0x952d('0x39')]=function(_0x23a457,_0xd0813c){var _0x5a30d0={'include':[{'model':db['Pause'],'as':_0x952d('0x3a')}]},_0x122423={},_0x3ed47b={'count':0x0,'rows':[]};var _0x36a3b4=_['map'](db['FaxAccount'][_0x952d('0x3b')],function(_0x100f92){return{'name':_0x100f92[_0x952d('0x3c')],'type':_0x100f92['type'][_0x952d('0x3d')]};});_0x122423[_0x952d('0x3e')]=_[_0x952d('0x3f')](_0x36a3b4,_0x952d('0x37'));_0x122423[_0x952d('0x40')]=_[_0x952d('0x41')](_0x23a457[_0x952d('0x40')]);_0x122423[_0x952d('0x42')]=_[_0x952d('0x43')](_0x122423['model'],_0x122423[_0x952d('0x40')]);_0x5a30d0[_0x952d('0x44')]=_[_0x952d('0x43')](_0x122423['model'],qs[_0x952d('0x45')](_0x23a457[_0x952d('0x40')][_0x952d('0x45')]));_0x5a30d0[_0x952d('0x44')]=_0x5a30d0[_0x952d('0x44')]['length']?_0x5a30d0[_0x952d('0x44')]:_0x122423[_0x952d('0x3e')];if(!_0x23a457[_0x952d('0x40')][_0x952d('0x46')](_0x952d('0x47'))){_0x5a30d0[_0x952d('0x2c')]=qs[_0x952d('0x2c')](_0x23a457[_0x952d('0x40')]['limit']);_0x5a30d0[_0x952d('0x2b')]=qs['offset'](_0x23a457[_0x952d('0x40')][_0x952d('0x2b')]);}_0x5a30d0[_0x952d('0x48')]=qs['sort'](_0x23a457[_0x952d('0x40')][_0x952d('0x49')]);_0x5a30d0[_0x952d('0x4a')]=qs[_0x952d('0x42')](_['pick'](_0x23a457[_0x952d('0x40')],_0x122423[_0x952d('0x42')]),_0x36a3b4);if(_0x23a457[_0x952d('0x40')][_0x952d('0x4b')]){_0x5a30d0[_0x952d('0x4a')]=_[_0x952d('0x4c')](_0x5a30d0[_0x952d('0x4a')],{'$or':_[_0x952d('0x3f')](_0x36a3b4,function(_0x21eddc){if(_0x21eddc['type']!==_0x952d('0x4d')){var _0x56443b={};_0x56443b[_0x21eddc[_0x952d('0x37')]]={'$like':'%'+_0x23a457['query'][_0x952d('0x4b')]+'%'};return _0x56443b;}})});}_0x5a30d0=_[_0x952d('0x4c')]({},_0x5a30d0,_0x23a457[_0x952d('0x4e')]);var _0x3c5165={'where':_0x5a30d0[_0x952d('0x4a')]};return db['FaxAccount'][_0x952d('0x2e')](_0x3c5165)[_0x952d('0x33')](function(_0xed10be){_0x3ed47b[_0x952d('0x2e')]=_0xed10be;if(_0x23a457[_0x952d('0x40')][_0x952d('0x4f')]){_0x5a30d0[_0x952d('0x50')]=[{'all':!![]}];}return db['FaxAccount'][_0x952d('0x51')](_0x5a30d0);})[_0x952d('0x33')](function(_0x8786a2){_0x3ed47b['rows']=_0x8786a2;return _0x3ed47b;})[_0x952d('0x33')](respondWithFilteredResult(_0xd0813c,_0x5a30d0))[_0x952d('0x27')](handleError(_0xd0813c,null));};exports[_0x952d('0x52')]=function(_0x37cb17,_0x4f6e79){var _0x5bf6cb={'raw':![],'where':{'id':_0x37cb17[_0x952d('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x952d('0x3a')}]},_0xa90df9={};_0xa90df9[_0x952d('0x3e')]=_[_0x952d('0x41')](db['FaxAccount'][_0x952d('0x3b')]);_0xa90df9[_0x952d('0x40')]=_['keys'](_0x37cb17[_0x952d('0x40')]);_0xa90df9['filters']=_[_0x952d('0x43')](_0xa90df9['model'],_0xa90df9[_0x952d('0x40')]);_0x5bf6cb[_0x952d('0x44')]=_[_0x952d('0x43')](_0xa90df9['model'],qs[_0x952d('0x45')](_0x37cb17[_0x952d('0x40')]['fields']));_0x5bf6cb[_0x952d('0x44')]=_0x5bf6cb[_0x952d('0x44')][_0x952d('0x54')]?_0x5bf6cb[_0x952d('0x44')]:_0xa90df9['model'];if(_0x37cb17[_0x952d('0x40')][_0x952d('0x4f')]){_0x5bf6cb[_0x952d('0x50')]=[{'all':!![]}];}_0x5bf6cb=_['merge']({},_0x5bf6cb,_0x37cb17['options']);return db[_0x952d('0x55')][_0x952d('0x56')](_0x5bf6cb)[_0x952d('0x33')](handleEntityNotFound(_0x4f6e79,null))['then'](respondWithResult(_0x4f6e79,null))['catch'](handleError(_0x4f6e79,null));};exports[_0x952d('0x57')]=function(_0x301b72,_0x3bef5b){return db['FaxAccount'][_0x952d('0x57')](_0x301b72['body'],{})[_0x952d('0x33')](function(_0x4aa77a){var _0x1353e0=_0x301b72[_0x952d('0x58')]['get']({'plain':!![]});if(!_0x1353e0)throw new Error(_0x952d('0x59'));if(_0x1353e0[_0x952d('0x5a')]==='user'){var _0xe723db=_0x4aa77a[_0x952d('0x5b')]({'plain':!![]});var _0xb817a3=_0x952d('0x35');return db['UserProfileSection'][_0x952d('0x56')]({'where':{'name':_0xb817a3,'userProfileId':_0x1353e0[_0x952d('0x5c')]},'raw':!![]})[_0x952d('0x33')](function(_0x4187b7){if(_0x4187b7&&_0x4187b7['autoAssociation']===0x0){return db[_0x952d('0x36')][_0x952d('0x57')]({'name':_0xe723db['name'],'resourceId':_0xe723db['id'],'type':_0x4187b7[_0x952d('0x37')],'sectionId':_0x4187b7['id']},{})[_0x952d('0x33')](function(){return _0x4aa77a;});}else{return _0x4aa77a;}})['catch'](function(_0x5ad73b){logger['error'](_0x952d('0x5d'),_0x5ad73b);throw _0x5ad73b;});}return _0x4aa77a;})[_0x952d('0x33')](respondWithResult(_0x3bef5b,0xc9))[_0x952d('0x27')](handleError(_0x3bef5b,null));};exports[_0x952d('0x5e')]=function(_0x1c6d7d,_0x17a76a){if(_0x1c6d7d[_0x952d('0x5f')]['id']){delete _0x1c6d7d[_0x952d('0x5f')]['id'];}return db['FaxAccount'][_0x952d('0x56')]({'where':{'id':_0x1c6d7d[_0x952d('0x53')]['id']},'include':[{'model':db[_0x952d('0x60')],'as':_0x952d('0x3a')}]})[_0x952d('0x33')](handleEntityNotFound(_0x17a76a,null))[_0x952d('0x33')](saveUpdates(_0x1c6d7d[_0x952d('0x5f')],null))[_0x952d('0x33')](respondWithResult(_0x17a76a,null))[_0x952d('0x27')](handleError(_0x17a76a,null));};exports['destroy']=function(_0x402cf4,_0x4c8bf4){return db['FaxAccount'][_0x952d('0x56')]({'where':{'id':_0x402cf4[_0x952d('0x53')]['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x4c8bf4,null))[_0x952d('0x33')](removeEntity(_0x4c8bf4,null))[_0x952d('0x27')](handleError(_0x4c8bf4,null));};exports[_0x952d('0x61')]=function(_0x451a2d,_0x500979){return db[_0x952d('0x55')][_0x952d('0x61')]()['then'](respondWithResult(_0x500979,null))[_0x952d('0x27')](handleError(_0x500979,null));};exports['addDisposition']=function(_0x516bac,_0x37665f,_0x16ad5d){if(_0x516bac[_0x952d('0x5f')]['id']){delete _0x516bac[_0x952d('0x5f')]['id'];}return db['FaxAccount'][_0x952d('0x56')]({'where':{'id':_0x516bac['params']['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x37665f,null))['then'](function(_0x1617f4){if(_0x1617f4){_0x516bac['body']['FaxAccountId']=_0x1617f4['id'];return db[_0x952d('0x62')]['create'](_0x516bac['body']);}})[_0x952d('0x33')](respondWithResult(_0x37665f,null))[_0x952d('0x27')](handleError(_0x37665f,null));};exports[_0x952d('0x63')]=function(_0x449f8a,_0x339809,_0x334d03){var _0x4e437e={'raw':![],'where':{}};var _0x5c632c={};var _0x33e60d={'count':0x0,'rows':[]};return db[_0x952d('0x55')][_0x952d('0x64')]({'where':{'id':_0x449f8a['params']['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x339809,null))[_0x952d('0x33')](function(_0xe3be4b){if(_0xe3be4b){_0x5c632c[_0x952d('0x3e')]=_['keys'](db[_0x952d('0x62')]['rawAttributes']);_0x5c632c[_0x952d('0x40')]=_[_0x952d('0x41')](_0x449f8a[_0x952d('0x40')]);_0x5c632c[_0x952d('0x42')]=_[_0x952d('0x43')](_0x5c632c[_0x952d('0x3e')],_0x5c632c[_0x952d('0x40')]);_0x4e437e[_0x952d('0x44')]=_[_0x952d('0x43')](_0x5c632c[_0x952d('0x3e')],qs[_0x952d('0x45')](_0x449f8a[_0x952d('0x40')][_0x952d('0x45')]));_0x4e437e['attributes']=_0x4e437e[_0x952d('0x44')][_0x952d('0x54')]?_0x4e437e['attributes']:_0x5c632c[_0x952d('0x3e')];if(!_0x449f8a['query'][_0x952d('0x46')](_0x952d('0x47'))){_0x4e437e[_0x952d('0x2c')]=qs[_0x952d('0x2c')](_0x449f8a[_0x952d('0x40')][_0x952d('0x2c')]);_0x4e437e['offset']=qs[_0x952d('0x2b')](_0x449f8a['query'][_0x952d('0x2b')]);}_0x4e437e[_0x952d('0x48')]=qs['sort'](_0x449f8a[_0x952d('0x40')][_0x952d('0x49')]);_0x4e437e[_0x952d('0x4a')]=qs[_0x952d('0x42')](_[_0x952d('0x65')](_0x449f8a['query'],_0x5c632c[_0x952d('0x42')]));_0x4e437e[_0x952d('0x4a')][_0x952d('0x66')]=_0xe3be4b['id'];if(_0x449f8a[_0x952d('0x40')][_0x952d('0x4b')]){_0x4e437e[_0x952d('0x4a')]=_[_0x952d('0x4c')](_0x4e437e[_0x952d('0x4a')],{'$or':_[_0x952d('0x3f')](_0x4e437e['attributes'],function(_0x83e6cc){var _0x483da2={};_0x483da2[_0x83e6cc]={'$like':'%'+_0x449f8a[_0x952d('0x40')]['filter']+'%'};return _0x483da2;})});}_0x4e437e=_[_0x952d('0x4c')]({},_0x4e437e,_0x449f8a[_0x952d('0x4e')]);return db[_0x952d('0x62')][_0x952d('0x2e')]({'where':_0x4e437e[_0x952d('0x4a')]})[_0x952d('0x33')](function(_0x154c66){_0x33e60d['count']=_0x154c66;if(_0x449f8a['query'][_0x952d('0x4f')]){_0x4e437e[_0x952d('0x50')]=[{'all':!![]}];}return db[_0x952d('0x62')][_0x952d('0x51')](_0x4e437e);})[_0x952d('0x33')](function(_0x24793e){_0x33e60d[_0x952d('0x67')]=_0x24793e;return _0x33e60d;});}})[_0x952d('0x33')](respondWithFilteredResult(_0x339809,_0x4e437e))['catch'](handleError(_0x339809,null));};exports[_0x952d('0x68')]=function(_0x1f336d,_0x16c49f,_0x3a1531){return db['FaxAccount'][_0x952d('0x56')]({'where':{'id':_0x1f336d[_0x952d('0x53')]['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x16c49f,null))[_0x952d('0x33')](function(_0x29434d){if(_0x29434d){return _0x29434d[_0x952d('0x68')](_0x1f336d[_0x952d('0x40')]['ids']);}})[_0x952d('0x33')](respondWithStatusCode(_0x16c49f,null))['catch'](handleError(_0x16c49f,null));};exports[_0x952d('0x69')]=function(_0x231ab1,_0x1656ac,_0x28ad01){if(_0x231ab1[_0x952d('0x5f')]['id']){delete _0x231ab1['body']['id'];}return db[_0x952d('0x55')][_0x952d('0x56')]({'where':{'id':_0x231ab1['params']['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x1656ac,null))[_0x952d('0x33')](function(_0x929ff){if(_0x929ff){_0x231ab1[_0x952d('0x5f')][_0x952d('0x66')]=_0x929ff['id'];return db[_0x952d('0x6a')]['create'](_0x231ab1[_0x952d('0x5f')]);}})[_0x952d('0x33')](respondWithResult(_0x1656ac,null))[_0x952d('0x27')](handleError(_0x1656ac,null));};exports[_0x952d('0x6b')]=function(_0x32ed83,_0x8ca272,_0x2f08ea){var _0x2f426e={'raw':![],'where':{}};var _0x50c0da={};var _0x55a016={'count':0x0,'rows':[]};return db['FaxAccount'][_0x952d('0x64')]({'where':{'id':_0x32ed83[_0x952d('0x53')]['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x8ca272,null))[_0x952d('0x33')](function(_0x120ba0){if(_0x120ba0){_0x50c0da['model']=_[_0x952d('0x41')](db[_0x952d('0x6a')][_0x952d('0x3b')]);_0x50c0da['query']=_[_0x952d('0x41')](_0x32ed83[_0x952d('0x40')]);_0x50c0da['filters']=_['intersection'](_0x50c0da[_0x952d('0x3e')],_0x50c0da[_0x952d('0x40')]);_0x2f426e[_0x952d('0x44')]=_[_0x952d('0x43')](_0x50c0da[_0x952d('0x3e')],qs[_0x952d('0x45')](_0x32ed83[_0x952d('0x40')][_0x952d('0x45')]));_0x2f426e[_0x952d('0x44')]=_0x2f426e[_0x952d('0x44')][_0x952d('0x54')]?_0x2f426e['attributes']:_0x50c0da[_0x952d('0x3e')];if(!_0x32ed83[_0x952d('0x40')]['hasOwnProperty'](_0x952d('0x47'))){_0x2f426e[_0x952d('0x2c')]=qs[_0x952d('0x2c')](_0x32ed83['query']['limit']);_0x2f426e[_0x952d('0x2b')]=qs[_0x952d('0x2b')](_0x32ed83[_0x952d('0x40')][_0x952d('0x2b')]);}_0x2f426e[_0x952d('0x48')]=qs['sort'](_0x32ed83['query']['sort']);_0x2f426e['where']=qs[_0x952d('0x42')](_['pick'](_0x32ed83[_0x952d('0x40')],_0x50c0da[_0x952d('0x42')]));_0x2f426e[_0x952d('0x4a')][_0x952d('0x66')]=_0x120ba0['id'];if(_0x32ed83['query'][_0x952d('0x4b')]){_0x2f426e[_0x952d('0x4a')]=_['merge'](_0x2f426e[_0x952d('0x4a')],{'$or':_[_0x952d('0x3f')](_0x2f426e[_0x952d('0x44')],function(_0x39a5af){var _0x1a5951={};_0x1a5951[_0x39a5af]={'$like':'%'+_0x32ed83['query']['filter']+'%'};return _0x1a5951;})});}_0x2f426e=_[_0x952d('0x4c')]({},_0x2f426e,_0x32ed83[_0x952d('0x4e')]);return db['CannedAnswer'][_0x952d('0x2e')]({'where':_0x2f426e[_0x952d('0x4a')]})[_0x952d('0x33')](function(_0xf9a21d){_0x55a016[_0x952d('0x2e')]=_0xf9a21d;if(_0x32ed83[_0x952d('0x40')][_0x952d('0x4f')]){_0x2f426e[_0x952d('0x50')]=[{'all':!![]}];}return db[_0x952d('0x6a')][_0x952d('0x51')](_0x2f426e);})['then'](function(_0x3275e7){_0x55a016[_0x952d('0x67')]=_0x3275e7;return _0x55a016;});}})[_0x952d('0x33')](respondWithFilteredResult(_0x8ca272,_0x2f426e))[_0x952d('0x27')](handleError(_0x8ca272,null));};exports[_0x952d('0x6c')]=function(_0x269e89,_0x2a7011,_0x20acdd){return db[_0x952d('0x55')][_0x952d('0x56')]({'where':{'id':_0x269e89[_0x952d('0x53')]['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x2a7011,null))[_0x952d('0x33')](function(_0x41888e){if(_0x41888e){return _0x41888e[_0x952d('0x6c')](_0x269e89['query'][_0x952d('0x6d')]);}})[_0x952d('0x33')](respondWithStatusCode(_0x2a7011,null))['catch'](handleError(_0x2a7011,null));};exports[_0x952d('0x6e')]=function(_0x1b76ed,_0x2ed5d7,_0x4ba0f8){return db['FaxInteraction'][_0x952d('0x56')]({'where':{'id':_0x1b76ed[_0x952d('0x53')]['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x2ed5d7,null))[_0x952d('0x33')](function(_0xbfcc7){if(_0xbfcc7){return _0xbfcc7['addInteraction'](_0x1b76ed[_0x952d('0x5f')][_0x952d('0x6d')],_[_0x952d('0x6f')](_0x1b76ed[_0x952d('0x5f')],['ids','id'])||{});}})[_0x952d('0x33')](respondWithResult(_0x2ed5d7,null))['catch'](handleError(_0x2ed5d7,null));};exports['getInteractions']=function(_0x1564be,_0x5acf26,_0x221dc0){var _0x29f495={'raw':![],'where':{}};var _0x252c1f={};var _0x4e1221={'count':0x0,'rows':[]};return db[_0x952d('0x55')][_0x952d('0x64')]({'where':{'id':_0x1564be[_0x952d('0x53')]['id']}})['then'](handleEntityNotFound(_0x5acf26,null))[_0x952d('0x33')](function(_0x18a75d){if(_0x18a75d){_0x252c1f['model']=_['keys'](db['FaxInteraction'][_0x952d('0x3b')]);_0x252c1f['query']=_['keys'](_0x1564be['query']);_0x252c1f[_0x952d('0x42')]=_[_0x952d('0x43')](_0x252c1f['model'],_0x252c1f[_0x952d('0x40')]);_0x29f495['attributes']=_[_0x952d('0x43')](_0x252c1f[_0x952d('0x3e')],qs[_0x952d('0x45')](_0x1564be['query']['fields']));_0x29f495[_0x952d('0x44')]=_0x29f495[_0x952d('0x44')]['length']?_0x29f495[_0x952d('0x44')]:_0x252c1f['model'];if(!_0x1564be[_0x952d('0x40')]['hasOwnProperty']('nolimit')){_0x29f495['limit']=qs[_0x952d('0x2c')](_0x1564be['query'][_0x952d('0x2c')]);_0x29f495[_0x952d('0x2b')]=qs[_0x952d('0x2b')](_0x1564be[_0x952d('0x40')][_0x952d('0x2b')]);}_0x29f495[_0x952d('0x48')]=qs[_0x952d('0x49')](_0x1564be[_0x952d('0x40')]['sort']);_0x29f495[_0x952d('0x4a')]=qs[_0x952d('0x42')](_[_0x952d('0x65')](_0x1564be[_0x952d('0x40')],_0x252c1f[_0x952d('0x42')]));_0x29f495[_0x952d('0x4a')]['FaxAccountId']=_0x18a75d['id'];if(_0x1564be[_0x952d('0x40')][_0x952d('0x4b')]){_0x29f495[_0x952d('0x4a')]=_[_0x952d('0x4c')](_0x29f495[_0x952d('0x4a')],{'$or':_[_0x952d('0x3f')](_0x29f495[_0x952d('0x44')],function(_0x1bbad5){var _0x1902ae={};_0x1902ae[_0x1bbad5]={'$like':'%'+_0x1564be[_0x952d('0x40')][_0x952d('0x4b')]+'%'};return _0x1902ae;})});}_0x29f495=_[_0x952d('0x4c')]({},_0x29f495,_0x1564be[_0x952d('0x4e')]);return db[_0x952d('0x70')]['count']({'where':_0x29f495[_0x952d('0x4a')]})[_0x952d('0x33')](function(_0x24c46b){_0x4e1221[_0x952d('0x2e')]=_0x24c46b;if(_0x1564be['query'][_0x952d('0x4f')]){_0x29f495['include']=[{'model':db['CmContact'],'as':_0x952d('0x71'),'required':![]},{'model':db[_0x952d('0x72')],'as':_0x952d('0x73'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x952d('0x74')],'as':_0x952d('0x75'),'attributes':['id','name',_0x952d('0x76')],'where':_0x1564be[_0x952d('0x40')][_0x952d('0x77')]?{'id':_0x1564be[_0x952d('0x40')][_0x952d('0x77')]}:undefined,'required':_0x1564be['query'][_0x952d('0x77')]?!![]:![]}];}return db[_0x952d('0x70')][_0x952d('0x51')](_0x29f495);})[_0x952d('0x33')](function(_0x550268){_0x4e1221['rows']=_0x550268;return _0x4e1221;});}})[_0x952d('0x33')](respondWithFilteredResult(_0x5acf26,_0x29f495))['catch'](handleError(_0x5acf26,null));};exports[_0x952d('0x78')]=function(_0x270d92,_0x21c450){var _0x225f92=_0x270d92[_0x952d('0x53')]['id'];var _0x101e02=_0x270d92[_0x952d('0x5f')];var _0x204851=0xc8;var _0x57d26d=null;return db['sequelize'][_0x952d('0x79')]({'isolationLevel':db[_0x952d('0x7a')][_0x952d('0x7b')][_0x952d('0x7c')]['READ_COMMITTED']},function(_0x1a10b1){return db[_0x952d('0x55')]['findOne']({'where':{'id':_0x225f92},'transaction':_0x1a10b1})[_0x952d('0x33')](function(_0x2ce145){if(_0x2ce145){return db[_0x952d('0x7d')]['destroy']({'where':{'FaxAccountId':_0x225f92},'transaction':_0x1a10b1})[_0x952d('0x33')](function(){var _0x3b429d=_['map'](_0x101e02,function(_0x42f795){_0x42f795[_0x952d('0x66')]=_0x225f92;return _0x42f795;});return db['FaxApplication'][_0x952d('0x7e')](_0x3b429d,{'transaction':_0x1a10b1});});}else{_0x204851=0x194;_0x57d26d=[];}});})['then'](function(){if(_0x204851!==0x194){return db[_0x952d('0x7d')][_0x952d('0x7f')]({'where':{'FaxAccountId':_0x225f92},'order':_0x952d('0x80')})[_0x952d('0x33')](function(_0x50be7f){_0x57d26d=_0x50be7f;});}})[_0x952d('0x27')](function(_0x45c0d1){_0x204851=0x1f4;logger[_0x952d('0x24')](_0x45c0d1['stack']);if(_0x45c0d1[_0x952d('0x37')]){delete _0x45c0d1[_0x952d('0x37')];}_0x57d26d=_0x45c0d1;})[_0x952d('0x81')](function(){if(_0x57d26d===null){_0x21c450[_0x952d('0x82')](_0x204851);}else{if(_0x204851===0x1f4){_0x21c450['status'](_0x204851)[_0x952d('0x38')](_0x57d26d);}else{_0x21c450['status'](_0x204851)[_0x952d('0x2a')](_0x57d26d);}}});};exports[_0x952d('0x83')]=function(_0xebfa64,_0x2f1374,_0x2f69af){var _0x51e516={};var _0x4f3975={};var _0x350bed;var _0x3ce5ae;return db[_0x952d('0x55')][_0x952d('0x64')]({'where':{'id':_0xebfa64[_0x952d('0x53')]['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x2f1374,null))['then'](function(_0x4eb79f){if(_0x4eb79f){_0x350bed=_0x4eb79f;_0x4f3975['model']=_[_0x952d('0x41')](db['FaxApplication'][_0x952d('0x3b')]);_0x4f3975[_0x952d('0x40')]=_[_0x952d('0x41')](_0xebfa64['query']);_0x4f3975[_0x952d('0x42')]=_[_0x952d('0x43')](_0x4f3975[_0x952d('0x3e')],_0x4f3975[_0x952d('0x40')]);_0x51e516[_0x952d('0x44')]=_[_0x952d('0x43')](_0x4f3975[_0x952d('0x3e')],qs['fields'](_0xebfa64[_0x952d('0x40')][_0x952d('0x45')]));_0x51e516[_0x952d('0x44')]=_0x51e516[_0x952d('0x44')][_0x952d('0x54')]?_0x51e516[_0x952d('0x44')]:_0x4f3975[_0x952d('0x3e')];_0x51e516[_0x952d('0x48')]=qs[_0x952d('0x49')](_0xebfa64[_0x952d('0x40')][_0x952d('0x49')]);_0x51e516[_0x952d('0x4a')]=qs[_0x952d('0x42')](_['pick'](_0xebfa64[_0x952d('0x40')],_0x4f3975[_0x952d('0x42')]));if(_0xebfa64[_0x952d('0x40')][_0x952d('0x4b')]){_0x51e516[_0x952d('0x4a')]=_['merge'](_0x51e516['where'],{'$or':_[_0x952d('0x3f')](_0x51e516['attributes'],function(_0x59d0e6){var _0x22f605={};_0x22f605[_0x59d0e6]={'$like':'%'+_0xebfa64[_0x952d('0x40')][_0x952d('0x4b')]+'%'};return _0x22f605;})});}_0x51e516=_[_0x952d('0x4c')]({},_0x51e516,_0xebfa64[_0x952d('0x4e')]);return _0x350bed[_0x952d('0x83')](_0x51e516);}})['then'](function(_0x5ed349){if(_0x5ed349){_0x3ce5ae=_0x5ed349['length'];if(!_0xebfa64[_0x952d('0x40')]['hasOwnProperty'](_0x952d('0x47'))){_0x51e516[_0x952d('0x2c')]=qs[_0x952d('0x2c')](_0xebfa64[_0x952d('0x40')][_0x952d('0x2c')]);_0x51e516[_0x952d('0x2b')]=qs[_0x952d('0x2b')](_0xebfa64[_0x952d('0x40')][_0x952d('0x2b')]);}return _0x350bed['getApplications'](_0x51e516);}})[_0x952d('0x33')](function(_0x1f56d9){if(_0x1f56d9){return _0x1f56d9?{'count':_0x3ce5ae,'rows':_0x1f56d9}:null;}})[_0x952d('0x33')](respondWithResult(_0x2f1374,null))[_0x952d('0x27')](handleError(_0x2f1374,null));};function Extension(_0x1e99fb,_0x367dbb,_0x1cfadc,_0x1cf9a9){this[_0x952d('0x84')]=_0x952d('0x85');this[_0x952d('0x86')]=_0x1e99fb['localstationid'];this['app']=_0x1cf9a9;this[_0x952d('0x87')]=_0x952d('0x88');this['description']='Fax\x20Extension';this[_0x952d('0x66')]=_0x1e99fb['id'];this[_0x952d('0x80')]=_0x367dbb;this[_0x952d('0x89')]=_0x1cfadc;}function createExtensionsReciveFax(_0xb033d9){var _0x823eec=0x1;var _0x5657fd=[];_0x5657fd[_0x952d('0x8a')](new Extension(_0xb033d9,_0x823eec,'','Answer'));_0x823eec+=0x1;_0x5657fd[_0x952d('0x8a')](new Extension(_0xb033d9,_0x823eec,_0x952d('0x8b'),'Set'));_0x823eec+=0x1;for(var _0x357a12 in _0xb033d9){if(_0xb033d9['hasOwnProperty'](_0x357a12)&&(_0x357a12===_0x952d('0x8c')||_0x357a12===_0x952d('0x8d')||_0x357a12==='gateway'||_0x357a12===_0x952d('0x8e')||_0x357a12===_0x952d('0x8f')||_0x357a12===_0x952d('0x90')||_0x357a12==='minrate'||_0x357a12===_0x952d('0x91')||_0x357a12===_0x952d('0x92'))){_0x5657fd[_0x952d('0x8a')](new Extension(_0xb033d9,_0x823eec,_0x952d('0x93')+_0x357a12+')='+_0xb033d9[_0x357a12],_0x952d('0x94')));_0x823eec+=0x1;}}_0x5657fd[_0x952d('0x8a')](new Extension(_0xb033d9,_0x823eec,'6',_0x952d('0x95')));_0x823eec+=0x1;_0x5657fd['push'](new Extension(_0xb033d9,_0x823eec,_0x952d('0x96'),_0x952d('0x97')));_0x823eec=0x0;return _0x5657fd;}exports[_0x952d('0x98')]=function(_0x2b1afc,_0x1d1f2d,_0x166fe5){var _0x4dc852;return db[_0x952d('0x7a')][_0x952d('0x79')](function(_0x529c4d){return db[_0x952d('0x55')][_0x952d('0x57')](_0x2b1afc['body'],{'transaction':_0x529c4d})[_0x952d('0x33')](function(_0x2a2063){_0x4dc852=_0x2a2063['get']({'plain':!![]});return db[_0x952d('0x99')]['bulkCreate'](createExtensionsReciveFax(_0x4dc852),{'transaction':_0x529c4d});});})['then'](function(){return _0x4dc852;})[_0x952d('0x33')](respondWithResult(_0x1d1f2d,null))[_0x952d('0x27')](handleError(_0x1d1f2d,null));};exports[_0x952d('0x9a')]=function(_0x28ca0b,_0x29e51b,_0x3e7e54){var _0xb27cf5;return db[_0x952d('0x7a')][_0x952d('0x79')](function(_0x50714a){return db[_0x952d('0x55')]['update'](_0x28ca0b[_0x952d('0x5f')],{'where':{'id':_0x28ca0b[_0x952d('0x5f')]['id']},'transaction':_0x50714a})[_0x952d('0x33')](function(_0x561aba){return db[_0x952d('0x99')]['destroy']({'where':{'FaxAccountId':_0x28ca0b['body']['id']},'transaction':_0x50714a})[_0x952d('0x33')](function(_0x1bb78b){return db[_0x952d('0x99')][_0x952d('0x7e')](createExtensionsReciveFax(_[_0x952d('0x6f')](_0x28ca0b[_0x952d('0x5f')],[_0x952d('0x9b'),_0x952d('0x3d'),_0x952d('0x9c'),'updatedAt',_0x952d('0x9d'),'ListId'])),{'transaction':_0x50714a});});});})[_0x952d('0x33')](function(){return db[_0x952d('0x55')][_0x952d('0x9e')](_0x28ca0b[_0x952d('0x5f')]['id']);})['then'](respondWithResult(_0x29e51b,null))[_0x952d('0x27')](handleError(_0x29e51b,null));};exports['getMessages']=function(_0x281b7a,_0x36ebb4,_0xb8e42e){var _0xd13c70={'raw':!![],'where':{}};var _0x5558cf={};var _0x50a639={'count':0x0,'rows':[]};return db[_0x952d('0x55')][_0x952d('0x64')]({'where':{'id':_0x281b7a[_0x952d('0x53')]['id']}})['then'](handleEntityNotFound(_0x36ebb4,null))[_0x952d('0x33')](function(_0x4b3e9f){if(_0x4b3e9f){_0x5558cf['model']=_[_0x952d('0x41')](db['FaxMessage'][_0x952d('0x3b')]);_0x5558cf[_0x952d('0x40')]=_[_0x952d('0x41')](_0x281b7a[_0x952d('0x40')]);_0x5558cf[_0x952d('0x42')]=_[_0x952d('0x43')](_0x5558cf[_0x952d('0x3e')],_0x5558cf[_0x952d('0x40')]);_0xd13c70[_0x952d('0x44')]=_[_0x952d('0x43')](_0x5558cf[_0x952d('0x3e')],qs[_0x952d('0x45')](_0x281b7a[_0x952d('0x40')][_0x952d('0x45')]));_0xd13c70[_0x952d('0x44')]=_0xd13c70[_0x952d('0x44')][_0x952d('0x54')]?_0xd13c70[_0x952d('0x44')]:_0x5558cf[_0x952d('0x3e')];if(!_0x281b7a['query'][_0x952d('0x46')](_0x952d('0x47'))){_0xd13c70['limit']=qs[_0x952d('0x2c')](_0x281b7a[_0x952d('0x40')]['limit']);_0xd13c70[_0x952d('0x2b')]=qs['offset'](_0x281b7a['query']['offset']);}_0xd13c70[_0x952d('0x48')]=qs[_0x952d('0x49')](_0x281b7a[_0x952d('0x40')][_0x952d('0x49')]);_0xd13c70[_0x952d('0x4a')]=qs['filters'](_[_0x952d('0x65')](_0x281b7a[_0x952d('0x40')],_0x5558cf[_0x952d('0x42')]));_0xd13c70[_0x952d('0x4a')][_0x952d('0x66')]=_0x4b3e9f['id'];if(_0x281b7a[_0x952d('0x40')][_0x952d('0x4b')]){_0xd13c70[_0x952d('0x4a')]=_[_0x952d('0x4c')](_0xd13c70[_0x952d('0x4a')],{'$or':_[_0x952d('0x3f')](_0xd13c70[_0x952d('0x44')],function(_0x421b22){var _0x13caac={};_0x13caac[_0x421b22]={'$like':'%'+_0x281b7a[_0x952d('0x40')][_0x952d('0x4b')]+'%'};return _0x13caac;})});}if(_0x281b7a[_0x952d('0x40')][_0x952d('0x9f')]){var _0x33a2e3=_0x281b7a[_0x952d('0x40')]['$gte'][_0x952d('0xa0')](',');var _0x5c7e8e={};_0x5c7e8e[_0x33a2e3[0x0]]={'$gte':moment(_0x33a2e3[0x1])[_0x952d('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd13c70[_0x952d('0x4a')]=_[_0x952d('0x4c')](_0xd13c70[_0x952d('0x4a')],_0x5c7e8e);}_0xd13c70=_[_0x952d('0x4c')]({},_0xd13c70,_0x281b7a[_0x952d('0x4e')]);return db[_0x952d('0xa2')][_0x952d('0x2e')]({'where':_0xd13c70[_0x952d('0x4a')]})[_0x952d('0x33')](function(_0x52ee4f){_0x50a639[_0x952d('0x2e')]=_0x52ee4f;if(_0x281b7a['query'][_0x952d('0x4f')]){_0xd13c70['include']=[{'all':!![]}];}return db['FaxMessage'][_0x952d('0x51')](_0xd13c70);})[_0x952d('0x33')](function(_0xdd8990){_0x50a639['rows']=_0xdd8990;return _0x50a639;});}})[_0x952d('0x33')](respondWithFilteredResult(_0x36ebb4,_0xd13c70))['catch'](handleError(_0x36ebb4,null));};exports['send']=function(_0x3d96d5,_0x41bdb1,_0x5b894b){var _0x502f33,_0x2e090f={},_0x4864a9;if(_0x3d96d5[_0x952d('0x5f')]['to']){_0x4864a9=_0x3d96d5[_0x952d('0x5f')]['to'][0x0];}return db['FaxAccount'][_0x952d('0x56')]({'where':{'id':_0x3d96d5[_0x952d('0x53')]['id']},'include':[{'model':db[_0x952d('0xa3')],'as':'List','include':[{'model':db[_0x952d('0xa4')],'as':_0x952d('0xa5'),'where':{'fax':_0x4864a9},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x41bdb1,null))['then'](function(_0x42eae5){_0x502f33=_0x42eae5;if(_0x3d96d5['body'][_0x952d('0xa6')]&&_0x3d96d5['body'][_0x952d('0xa6')]['length']){for(var _0x367653=0x0;_0x367653<_0x3d96d5['body'][_0x952d('0xa6')][_0x952d('0x54')];_0x367653+=0x1){_0x3d96d5[_0x952d('0x5f')]['attachments'][_0x367653]={'filename':_0x3d96d5[_0x952d('0x5f')][_0x952d('0xa6')][_0x367653][_0x952d('0x37')],'id':_0x3d96d5[_0x952d('0x5f')][_0x952d('0xa6')][_0x367653]['id'],'path':path[_0x952d('0xa7')](config[_0x952d('0xa8')],_0x952d('0xa9'),_0x3d96d5[_0x952d('0x5f')]['attachments'][_0x367653][_0x952d('0xaa')])};}}return respondWithRpcPromise(_0x952d('0xab'),_0x952d('0xab'),{'FaxAccountId':_[_0x952d('0xac')](_0x3d96d5[_0x952d('0x53')]['id'])?undefined:_0x3d96d5['params']['id'],'path':_[_0x952d('0xac')](_0x3d96d5[_0x952d('0x5f')][_0x952d('0xa6')][0x0]['path'])?undefined:_0x3d96d5[_0x952d('0x5f')]['attachments'][0x0][_0x952d('0x9')],'fax':_[_0x952d('0xac')](_0x3d96d5[_0x952d('0x5f')]['to'][0x0])?undefined:_0x3d96d5[_0x952d('0x5f')]['to'][0x0]},client9002);})['then'](function(){if(_0x502f33){if(_[_0x952d('0xac')](_0x3d96d5[_0x952d('0x5f')][_0x952d('0xad')])){_0x3d96d5['body'][_0x952d('0xad')]=util[_0x952d('0xa1')](_0x952d('0xae'),_0x502f33[_0x952d('0x37')],_0x502f33[_0x952d('0xaf')]);}if(_0x502f33[_0x952d('0xb0')]){if(_0x502f33[_0x952d('0xb0')]['Contacts'][_0x952d('0x54')]){return _0x502f33[_0x952d('0xb0')]['Contacts'][0x0];}else{return db[_0x952d('0xa4')][_0x952d('0x57')](_[_0x952d('0x1b')](_0x3d96d5[_0x952d('0x5f')],{'firstName':_0x3d96d5[_0x952d('0x5f')]['to'][0x0],'phone':_0x3d96d5[_0x952d('0x5f')]['to'][0x0],'fax':_0x3d96d5[_0x952d('0x5f')]['to'][0x0],'ListId':_0x502f33[_0x952d('0xb1')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x952d('0xb2'));}})['then'](function(_0x10330e){if(_0x10330e){return db[_0x952d('0x70')][_0x952d('0x56')]({'where':{'ContactId':_0x10330e['id'],'closed':![],'FaxAccountId':_0x502f33['id']}})[_0x952d('0x33')](function(_0x5d7744){if(_0x5d7744){return[_0x5d7744,![]];}return db[_0x952d('0x70')][_0x952d('0x57')]({'UserId':_0x3d96d5[_0x952d('0x58')]['id'],'ContactId':_0x10330e['id'],'FaxAccountId':_0x502f33['id'],'fax':_0x3d96d5[_0x952d('0x5f')]['to'][0x0],'firstMsgDirection':_0x952d('0xb3'),'Messages':[_[_0x952d('0x4c')](_0x3d96d5[_0x952d('0x5f')],{'read':![],'body':_0x3d96d5[_0x952d('0x5f')][_0x952d('0xa6')][0x0][_0x952d('0xb4')],'FaxAccountId':_0x502f33['id'],'UserId':_0x3d96d5[_0x952d('0x58')]['id'],'ContactId':_0x10330e['id'],'AttachmentId':_0x3d96d5[_0x952d('0x5f')][_0x952d('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0x952d('0xa2')],'as':'Messages'}]})[_0x952d('0x33')](function(_0x462cbb){return[_0x462cbb,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x1c0ba7,_0x5e789c){if(_0x5e789c){return _0x1c0ba7;}return db[_0x952d('0xa2')]['create']({'direction':_0x952d('0xb3'),'read':![],'body':_0x3d96d5[_0x952d('0x5f')][_0x952d('0xa6')][0x0][_0x952d('0xb4')],'FaxAccountId':_0x502f33['id'],'FaxInteractionId':_0x1c0ba7['id'],'UserId':_0x3d96d5[_0x952d('0x58')]['id'],'ContactId':_0x1c0ba7[_0x952d('0xb5')],'AttachmentId':_0x3d96d5['body']['attachments'][0x0]['id']})[_0x952d('0x33')](function(_0x36a846){_0x1c0ba7['dataValues'][_0x952d('0xb6')]=[];_0x1c0ba7['dataValues']['Messages'][_0x952d('0x8a')](_0x36a846['dataValues']);return _0x1c0ba7;});})[_0x952d('0x33')](function(_0x1b3db3){respondWithRpcPromise(_0x952d('0xb7'),'SendFax',{'FaxAccountId':_[_0x952d('0xac')](_0x3d96d5[_0x952d('0x53')]['id'])?undefined:_0x3d96d5[_0x952d('0x53')]['id'],'path':_[_0x952d('0xac')](_0x3d96d5[_0x952d('0x5f')]['attachments'][0x0]['path'])?undefined:_0x3d96d5[_0x952d('0x5f')]['attachments'][0x0][_0x952d('0x9')],'fax':_[_0x952d('0xac')](_0x3d96d5[_0x952d('0x5f')]['to'][0x0])?undefined:_0x3d96d5[_0x952d('0x5f')]['to'][0x0],'AttachmentId':_0x3d96d5[_0x952d('0x5f')][_0x952d('0xa6')][0x0]['id']},client9002)[_0x952d('0x33')](function(_0x19a18d){logger[_0x952d('0xb8')](_0x952d('0xb9'),_0x19a18d);})[_0x952d('0x27')](function(_0x403b5f){logger[_0x952d('0xb8')](_0x952d('0xb9'),_0x403b5f);});return _0x1b3db3;})[_0x952d('0x33')](respondWithResult(_0x41bdb1,null))[_0x952d('0x27')](handleError(_0x41bdb1,null));};exports['addAgents']=function(_0x48fab5,_0x1b6b8c,_0x52296c){return db['FaxAccount'][_0x952d('0x56')]({'where':{'id':_0x48fab5['params']['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x1b6b8c,null))[_0x952d('0x33')](function(_0x21187c){if(_0x21187c){return _0x21187c[_0x952d('0xba')](_0x48fab5['body'][_0x952d('0x6d')],_[_0x952d('0x6f')](_0x48fab5[_0x952d('0x5f')],['ids','id'])||{})[_0x952d('0xbb')](function(_0x5e4cb7){for(var _0x18d4b4=0x0;_0x18d4b4<_0x48fab5[_0x952d('0x5f')]['ids'][_0x952d('0x54')];_0x18d4b4+=0x1){socket[_0x952d('0xbc')](_0x952d('0xbd'),{'UserId':Number(_0x48fab5['body']['ids'][_0x18d4b4]),'FaxAccountId':Number(_0x48fab5['params']['id'])});}return _0x5e4cb7;});}})[_0x952d('0x33')](respondWithResult(_0x1b6b8c,null))[_0x952d('0x27')](handleError(_0x1b6b8c,null));};exports[_0x952d('0xbe')]=function(_0x2e9c79,_0x3e3381,_0x24778f){return db[_0x952d('0x55')][_0x952d('0x56')]({'where':{'id':_0x2e9c79[_0x952d('0x53')]['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x3e3381,null))['then'](function(_0x2a37f8){if(_0x2a37f8){return _0x2a37f8[_0x952d('0xbe')](_0x2e9c79[_0x952d('0x40')]['ids'])[_0x952d('0x33')](function(){if(_[_0x952d('0xbf')](_0x2e9c79[_0x952d('0x40')]['ids'])){for(var _0x4e3b3f=0x0;_0x4e3b3f<_0x2e9c79['query'][_0x952d('0x6d')]['length'];_0x4e3b3f+=0x1){socket[_0x952d('0xbc')](_0x952d('0xc0'),{'UserId':Number(_0x2e9c79['query'][_0x952d('0x6d')][_0x4e3b3f]),'FaxAccountId':Number(_0x2e9c79['params']['id'])});}}else{socket[_0x952d('0xbc')](_0x952d('0xc0'),{'UserId':Number(_0x2e9c79[_0x952d('0x40')][_0x952d('0x6d')]),'FaxAccountId':Number(_0x2e9c79[_0x952d('0x53')]['id'])});}});}})[_0x952d('0x33')](respondWithStatusCode(_0x3e3381,null))['catch'](handleError(_0x3e3381,null));};exports[_0x952d('0xc1')]=function(_0x3d0c06,_0x5c9252,_0x50a50d){var _0x545083={};var _0x3d16a8={};var _0x543d4d;var _0x49bf8b;return db[_0x952d('0x55')]['findOne']({'where':{'id':_0x3d0c06['params']['id']}})[_0x952d('0x33')](handleEntityNotFound(_0x5c9252,null))[_0x952d('0x33')](function(_0x2ed722){if(_0x2ed722){_0x543d4d=_0x2ed722;_0x3d16a8[_0x952d('0x3e')]=_[_0x952d('0x41')](db['User'][_0x952d('0x3b')]);_0x3d16a8[_0x952d('0x40')]=_['keys'](_0x3d0c06['query']);_0x3d16a8[_0x952d('0x42')]=_[_0x952d('0x43')](_0x3d16a8['model'],_0x3d16a8[_0x952d('0x40')]);_0x545083[_0x952d('0x44')]=_[_0x952d('0x43')](_0x3d16a8[_0x952d('0x3e')],qs[_0x952d('0x45')](_0x3d0c06[_0x952d('0x40')][_0x952d('0x45')]));_0x545083[_0x952d('0x44')]=_0x545083[_0x952d('0x44')]['length']?_0x545083[_0x952d('0x44')]:_0x3d16a8[_0x952d('0x3e')];_0x545083['order']=qs['sort'](_0x3d0c06[_0x952d('0x40')][_0x952d('0x49')]);_0x545083[_0x952d('0x4a')]=qs[_0x952d('0x42')](_[_0x952d('0x65')](_0x3d0c06[_0x952d('0x40')],_0x3d16a8[_0x952d('0x42')]));if(_0x3d0c06[_0x952d('0x40')]['filter']){_0x545083[_0x952d('0x4a')]=_['merge'](_0x545083[_0x952d('0x4a')],{'$or':_[_0x952d('0x3f')](_0x545083[_0x952d('0x44')],function(_0x2f025f){var _0x2db99d={};_0x2db99d[_0x2f025f]={'$like':'%'+_0x3d0c06[_0x952d('0x40')][_0x952d('0x4b')]+'%'};return _0x2db99d;})});}_0x545083=_[_0x952d('0x4c')]({},_0x545083,_0x3d0c06[_0x952d('0x4e')]);return _0x543d4d[_0x952d('0xc1')](_0x545083);}})[_0x952d('0x33')](function(_0x3ff72b){if(_0x3ff72b){_0x49bf8b=_0x3ff72b['length'];if(!_0x3d0c06[_0x952d('0x40')]['hasOwnProperty']('nolimit')){_0x545083['limit']=qs[_0x952d('0x2c')](_0x3d0c06['query'][_0x952d('0x2c')]);_0x545083[_0x952d('0x2b')]=qs[_0x952d('0x2b')](_0x3d0c06['query'][_0x952d('0x2b')]);}return _0x543d4d[_0x952d('0xc1')](_0x545083);}})[_0x952d('0x33')](function(_0x5e3a4d){if(_0x5e3a4d){return _0x5e3a4d?{'count':_0x49bf8b,'rows':_0x5e3a4d}:null;}})[_0x952d('0x33')](respondWithResult(_0x5c9252,null))[_0x952d('0x27')](handleError(_0x5c9252,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 494841c..e6622dd 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 _0x54ac=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','emit'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x54ac,0x159));var _0xc54a=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0x54ac[_0x301dab];return _0x2500a2;};'use strict';var EventEmitter=require(_0xc54a('0x0'));var FaxAccount=require(_0xc54a('0x1'))['db'][_0xc54a('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc54a('0x3')](0x0);var events={'afterCreate':_0xc54a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7b9a2e){return function(_0x508ddd,_0x44abea,_0x3d8562){FaxAccountEvents[_0xc54a('0x5')](_0x7b9a2e+':'+_0x508ddd['id'],_0x508ddd);FaxAccountEvents['emit'](_0x7b9a2e,_0x508ddd);_0x3d8562(null);};}for(var e in events){if(events[_0xc54a('0x6')](e)){var event=events[e];FaxAccount[_0xc54a('0x7')](e,emitEvent(event));}}module[_0xc54a('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x5706=['FaxAccount','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x2d65aa,_0x120bf3){var _0x594233=function(_0x246429){while(--_0x246429){_0x2d65aa['push'](_0x2d65aa['shift']());}};_0x594233(++_0x120bf3);}(_0x5706,0x8a));var _0x6570=function(_0x426570,_0x5a2b47){_0x426570=_0x426570-0x0;var _0x48a7e5=_0x5706[_0x426570];return _0x48a7e5;};'use strict';var EventEmitter=require(_0x6570('0x0'));var FaxAccount=require(_0x6570('0x1'))['db'][_0x6570('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6570('0x3')](0x0);var events={'afterCreate':_0x6570('0x4'),'afterUpdate':_0x6570('0x5'),'afterDestroy':_0x6570('0x6')};function emitEvent(_0x5d1525){return function(_0xbb3879,_0x546af2,_0x3b45f4){FaxAccountEvents[_0x6570('0x7')](_0x5d1525+':'+_0xbb3879['id'],_0xbb3879);FaxAccountEvents['emit'](_0x5d1525,_0xbb3879);_0x3b45f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x6570('0x8')](e,emitEvent(event));}}module[_0x6570('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 35bcd07..9c4048e 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 _0x9c6e=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','FaxAccount','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c6e,0x15d));var _0xe9c6=function(_0x4173f3,_0x41904c){_0x4173f3=_0x4173f3-0x0;var _0x2431a0=_0x9c6e[_0x4173f3];return _0x2431a0;};'use strict';var _=require(_0xe9c6('0x0'));var util=require(_0xe9c6('0x1'));var logger=require(_0xe9c6('0x2'))('api');var moment=require(_0xe9c6('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9c6('0x4'));var fs=require('fs');var path=require(_0xe9c6('0x5'));var rimraf=require(_0xe9c6('0x6'));var config=require(_0xe9c6('0x7'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0xa71456,_0x4abe13){return _0xa71456['define'](_0xe9c6('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51b3=['request-promise','path','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','moment'];(function(_0x85a5c3,_0x10ff7e){var _0x5398c9=function(_0x5abcdb){while(--_0x5abcdb){_0x85a5c3['push'](_0x85a5c3['shift']());}};_0x5398c9(++_0x10ff7e);}(_0x51b3,0x1de));var _0x351b=function(_0x147534,_0x4ee9db){_0x147534=_0x147534-0x0;var _0x3ce4b1=_0x51b3[_0x147534];return _0x3ce4b1;};'use strict';var _=require(_0x351b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x351b('0x1'));var BPromise=require('bluebird');var rp=require(_0x351b('0x2'));var fs=require('fs');var path=require(_0x351b('0x3'));var rimraf=require(_0x351b('0x4'));var config=require(_0x351b('0x5'));var attributes=require('./faxAccount.attributes');module[_0x351b('0x6')]=function(_0x19d92d,_0x383a51){return _0x19d92d[_0x351b('0x7')](_0x351b('0x8'),attributes,{'tableName':_0x351b('0x9'),'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 c4e417b..578e184 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 _0x5704=['CmList','List','Contacts','DESC','FaxApplication','applications','orderBy','asc','Applications','length','from','create','Contact\x20not\x20found','spread','get','push','close','created','interaction','FaxMessage','ContactId','AttachmentId','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','include','attributes','map','model','debug','GetFaxAccount','NotifyFaxAccount','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','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','FaxAccount','find','account'];(function(_0x14e454,_0x39fe84){var _0x22d7f4=function(_0xf94e6f){while(--_0xf94e6f){_0x14e454['push'](_0x14e454['shift']());}};_0x22d7f4(++_0x39fe84);}(_0x5704,0x16d));var _0x4570=function(_0x34c8ff,_0x674110){_0x34c8ff=_0x34c8ff-0x0;var _0x42601c=_0x5704[_0x34c8ff];return _0x42601c;};'use strict';var _=require(_0x4570('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4570('0x1'));var rs=require(_0x4570('0x2'));var fs=require('fs');var Redis=require(_0x4570('0x3'));var db=require(_0x4570('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4570('0x5'))('rpc');var config=require(_0x4570('0x6'));var jayson=require(_0x4570('0x7'));var client=jayson['client'][_0x4570('0x8')]({'port':0x232c});config['redis']=_[_0x4570('0x9')](config[_0x4570('0xa')],{'host':_0x4570('0xb'),'port':0x18eb});var socket=require(_0x4570('0xc'))(new Redis(config['redis']));require(_0x4570('0xd'))['register'](socket);function respondWithRpcPromise(_0x3a3dcc,_0x20f24e,_0x49b826){return new BPromise(function(_0x63821a,_0x410df0){return client[_0x4570('0xe')](_0x3a3dcc,_0x49b826)[_0x4570('0xf')](function(_0x49fdd0){logger[_0x4570('0x10')](_0x4570('0x11'),_0x20f24e,_0x4570('0x12'));logger['debug'](_0x4570('0x13'),_0x20f24e,_0x4570('0x12'),JSON[_0x4570('0x14')](_0x49fdd0));if(_0x49fdd0[_0x4570('0x15')]){if(_0x49fdd0[_0x4570('0x15')][_0x4570('0x16')]===0x1f4){logger[_0x4570('0x15')](_0x4570('0x11'),_0x20f24e,_0x49fdd0[_0x4570('0x15')][_0x4570('0x17')]);return _0x410df0(_0x49fdd0[_0x4570('0x15')]['message']);}logger['error'](_0x4570('0x11'),_0x20f24e,_0x49fdd0[_0x4570('0x15')][_0x4570('0x17')]);return _0x63821a(_0x49fdd0['error']['message']);}else{logger[_0x4570('0x10')]('FaxAccount,\x20%s,\x20%s',_0x20f24e,_0x4570('0x12'));_0x63821a(_0x49fdd0[_0x4570('0x18')][_0x4570('0x17')]);}})[_0x4570('0x19')](function(_0x4d4d34){logger[_0x4570('0x15')](_0x4570('0x11'),_0x20f24e,_0x4d4d34);_0x410df0(_0x4d4d34);});});}exports['GetFaxAccount']=function(_0x152c17){var _0x43bab3=this;return new Promise(function(_0x26b859,_0x25d9a4){return db['FaxAccount']['findAll']({'raw':_0x152c17[_0x4570('0x1a')]?_0x152c17['options']['raw']===undefined?!![]:![]:!![],'where':_0x152c17[_0x4570('0x1a')]?_0x152c17[_0x4570('0x1a')]['where']||null:null,'attributes':_0x152c17['options']?_0x152c17['options']['attributes']||null:null,'limit':_0x152c17[_0x4570('0x1a')]?_0x152c17['options']['limit']||null:null,'include':_0x152c17['options']?_0x152c17['options'][_0x4570('0x1b')]?_['map'](_0x152c17[_0x4570('0x1a')][_0x4570('0x1b')],function(_0x17fc59){return{'model':db[_0x17fc59['model']],'as':_0x17fc59['as'],'attributes':_0x17fc59[_0x4570('0x1c')],'include':_0x17fc59[_0x4570('0x1b')]?_[_0x4570('0x1d')](_0x17fc59[_0x4570('0x1b')],function(_0x121cd0){return{'model':db[_0x121cd0[_0x4570('0x1e')]],'as':_0x121cd0['as'],'attributes':_0x121cd0[_0x4570('0x1c')],'include':_0x121cd0[_0x4570('0x1b')]?_[_0x4570('0x1d')](_0x121cd0[_0x4570('0x1b')],function(_0x4f8c6e){return{'model':db[_0x4f8c6e[_0x4570('0x1e')]],'as':_0x4f8c6e['as'],'attributes':_0x4f8c6e[_0x4570('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4570('0xf')](function(_0x3c27a2){logger['info']('GetFaxAccount',_0x152c17);logger[_0x4570('0x1f')]('GetFaxAccount',_0x152c17,JSON[_0x4570('0x14')](_0x3c27a2));_0x26b859(_0x3c27a2);})[_0x4570('0x19')](function(_0x51289e){logger['error'](_0x4570('0x20'),_0x51289e[_0x4570('0x17')],_0x152c17);_0x25d9a4(_0x43bab3[_0x4570('0x15')](0x1f4,_0x51289e[_0x4570('0x17')]));});});};exports[_0x4570('0x21')]=function(_0x8615ae,_0x32621a,_0x1a06a6){var _0x3bc896=this;return new Promise(function(_0x3c0fbc,_0x41c3cc){var _0x30582f={'body':_0x8615ae['body'],'channel':'fax'};var _0x285862=[];var _0xaef895=[];var _0x435cfb={};return db[_0x4570('0x22')][_0x4570('0x23')]()[_0x4570('0xf')](function(_0x285837){if(!_0x285837){throw new db[(_0x4570('0x24'))][(_0x4570('0x25'))]('no\x20available\x20attributes');}_0x285862=_[_0x4570('0x26')](_[_0x4570('0x27')](_0x285837),[_0x4570('0x28'),'updatedAt']);_0xaef895=_[_0x4570('0x26')](_['keys'](_0x285837),[_0x4570('0x28'),_0x4570('0x29'),_0x4570('0x2a'),_0x4570('0x2b')]);if(_0x8615ae[_0x4570('0x2c')]['id']){delete _0x8615ae[_0x4570('0x2c')]['id'];}if(_[_0x4570('0x2d')](_0x8615ae['body']['from'])){throw new db[(_0x4570('0x24'))]['ValidationError'](_0x4570('0x2e'));}if(_[_0x4570('0x2d')](_0x8615ae[_0x4570('0x2c')][_0x4570('0x2c')])||_0x8615ae[_0x4570('0x2c')][_0x4570('0x2c')]===''){throw new db[(_0x4570('0x24'))][(_0x4570('0x25'))](_0x4570('0x2f'));}if(_['isNil'](_0x8615ae[_0x4570('0x2c')][_0x4570('0x30')])){throw new db[(_0x4570('0x24'))][(_0x4570('0x25'))](_0x4570('0x31')+_0xaef895);}if(!_[_0x4570('0x32')](_0xaef895,_0x8615ae[_0x4570('0x2c')][_0x4570('0x30')])){throw new db[(_0x4570('0x24'))][(_0x4570('0x25'))](_0x4570('0x33')+_0xaef895);}_0x435cfb[_0x8615ae[_0x4570('0x2c')][_0x4570('0x30')]]=_0x8615ae['body']['from'];})[_0x4570('0xf')](function(){return db[_0x4570('0x34')][_0x4570('0x35')]({'where':{'id':_0x8615ae[_0x4570('0x36')]['id']},'include':[{'model':db[_0x4570('0x37')],'as':_0x4570('0x38'),'include':[{'model':db['CmContact'],'as':_0x4570('0x39'),'where':_0x435cfb,'limit':0x1,'order':[[_0x4570('0x29'),_0x4570('0x3a')]]}]},{'model':db[_0x4570('0x3b')],'as':'Applications'}]});})['then'](function(_0x36374){if(_0x36374&&_0x36374[_0x4570('0x38')]){var _0x2554f8=_0x36374['get']({'plain':!![]});_0x30582f[_0x4570('0x36')]=_0x2554f8;_0x30582f[_0x4570('0x3c')]=_0x2554f8['Applications'];_0x30582f['list']=_0x2554f8[_0x4570('0x38')];_0x30582f['applications']=_[_0x4570('0x3d')](_0x30582f[_0x4570('0x3c')],['priority'],[_0x4570('0x3e')]);if(_0x30582f[_0x4570('0x36')][_0x4570('0x3f')]){delete _0x30582f[_0x4570('0x36')]['Applications'];}if(_0x30582f['account']['List']&&_0x30582f[_0x4570('0x36')][_0x4570('0x38')]['Contacts'][_0x4570('0x40')]){return _0x30582f[_0x4570('0x36')]['List'][_0x4570('0x39')][0x0];}var _0x362ff1=_[_0x4570('0x9')](_0x8615ae[_0x4570('0x2c')],{'firstName':_0x8615ae[_0x4570('0x2c')]['from'],'ListId':_0x2554f8[_0x4570('0x2b')]});_0x362ff1[_0x8615ae[_0x4570('0x2c')][_0x4570('0x30')]]=_0x8615ae[_0x4570('0x2c')][_0x4570('0x41')];return db[_0x4570('0x22')][_0x4570('0x42')](_0x362ff1,{'fields':_0x285862,'raw':!![]});}})[_0x4570('0xf')](function(_0x24e370){_0x30582f['contact']=_0x24e370;if(_0x24e370){var _0x152bad={'ContactId':_0x24e370['id'],'FaxAccountId':_0x8615ae[_0x4570('0x36')]['id'],'fax':_0x24e370['fax']};return db['FaxInteraction'][_0x4570('0x35')]({'where':{'ContactId':_0x24e370['id'],'closed':![],'FaxAccountId':_0x8615ae[_0x4570('0x36')]['id']}})[_0x4570('0xf')](function(_0x33770f){if(_0x33770f){return[_0x33770f,![]];}return db['FaxInteraction'][_0x4570('0x42')](_0x152bad)['then'](function(_0x721835){return[_0x721835,!![]];});});}else{throw new Error(_0x4570('0x43'));}})[_0x4570('0x44')](function(_0x3e0869,_0x1c88d8){var _0x28bfae=_0x3e0869[_0x4570('0x45')]({'plain':!![]});if(_0x1c88d8){if(_0x30582f['account']['autoclose']){_0x30582f[_0x4570('0x3c')][_0x4570('0x46')]({'id':0x0,'priority':_0x30582f[_0x4570('0x3c')][_0x4570('0x40')]+0x1,'app':_0x4570('0x47'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x28bfae[_0x4570('0x48')]=!![];}else{_0x28bfae[_0x4570('0x48')]=![];}_0x30582f[_0x4570('0x49')]=_0x28bfae;return db[_0x4570('0x4a')][_0x4570('0x42')]({'body':_0x8615ae[_0x4570('0x2c')]['body'],'FaxAccountId':_0x8615ae[_0x4570('0x36')]['id'],'FaxInteractionId':_0x3e0869['id'],'direction':'in','ContactId':_0x3e0869[_0x4570('0x4b')],'AttachmentId':_0x8615ae[_0x4570('0x2c')][_0x4570('0x4c')]});})[_0x4570('0xf')](function(_0x4d44a3){_0x30582f[_0x4570('0x17')]=_0x4d44a3;if(_0x30582f[_0x4570('0x49')]['UserId']){return db['User']['find']({'attributes':['id',_0x4570('0x4d')],'where':{'id':_0x30582f['interaction'][_0x4570('0x4e')]}})['then'](function(_0x335b9c){if(_0x335b9c){_0x30582f[_0x4570('0x3c')][_0x4570('0x4f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x335b9c[_0x4570('0x4d')]+','+(_0x30582f['account'][_0x4570('0x50')]||0xa),'interval':_0x4570('0x51')});}return respondWithRpcPromise('Start',_0x4570('0x52'),_0x30582f);});}return respondWithRpcPromise(_0x4570('0x53'),'startRouting',_0x30582f);})[_0x4570('0xf')](function(_0x37632a){_0x3c0fbc(_0x37632a);})['catch'](function(_0x11d607){_0x41c3cc(_0x3bc896[_0x4570('0x15')](0x1f4,_0x11d607[_0x4570('0x17')]));});});}; \ No newline at end of file +var _0xb4ba=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','Contacts','DESC','Applications','get','applications','list','orderBy','priority','asc','account','length','create','fax','FaxInteraction','find','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','unshift','name','waitForTheAssignedAgent','startRouting','Start'];(function(_0x496f97,_0x5e174f){var _0x393b87=function(_0x2a8948){while(--_0x2a8948){_0x496f97['push'](_0x496f97['shift']());}};_0x393b87(++_0x5e174f);}(_0xb4ba,0x10e));var _0xab4b=function(_0x5ee607,_0x5ef350){_0x5ee607=_0x5ee607-0x0;var _0x49a75a=_0xb4ba[_0x5ee607];return _0x49a75a;};'use strict';var _=require(_0xab4b('0x0'));var util=require(_0xab4b('0x1'));var moment=require('moment');var BPromise=require(_0xab4b('0x2'));var rs=require(_0xab4b('0x3'));var fs=require('fs');var Redis=require(_0xab4b('0x4'));var db=require(_0xab4b('0x5'))['db'];var utils=require(_0xab4b('0x6'));var logger=require(_0xab4b('0x7'))(_0xab4b('0x8'));var config=require(_0xab4b('0x9'));var jayson=require(_0xab4b('0xa'));var client=jayson[_0xab4b('0xb')][_0xab4b('0xc')]({'port':0x232c});config[_0xab4b('0xd')]=_['defaults'](config[_0xab4b('0xd')],{'host':_0xab4b('0xe'),'port':0x18eb});var socket=require(_0xab4b('0xf'))(new Redis(config[_0xab4b('0xd')]));require(_0xab4b('0x10'))[_0xab4b('0x11')](socket);function respondWithRpcPromise(_0x12dcad,_0x11cdcf,_0x1bfd4c){return new BPromise(function(_0x5d1e09,_0x12b914){return client[_0xab4b('0x12')](_0x12dcad,_0x1bfd4c)['then'](function(_0x1d206c){logger[_0xab4b('0x13')](_0xab4b('0x14'),_0x11cdcf,'request\x20sent');logger[_0xab4b('0x15')](_0xab4b('0x16'),_0x11cdcf,'request\x20sent',JSON[_0xab4b('0x17')](_0x1d206c));if(_0x1d206c[_0xab4b('0x18')]){if(_0x1d206c[_0xab4b('0x18')][_0xab4b('0x19')]===0x1f4){logger[_0xab4b('0x18')](_0xab4b('0x14'),_0x11cdcf,_0x1d206c[_0xab4b('0x18')][_0xab4b('0x1a')]);return _0x12b914(_0x1d206c['error'][_0xab4b('0x1a')]);}logger[_0xab4b('0x18')](_0xab4b('0x14'),_0x11cdcf,_0x1d206c['error'][_0xab4b('0x1a')]);return _0x5d1e09(_0x1d206c['error'][_0xab4b('0x1a')]);}else{logger[_0xab4b('0x13')](_0xab4b('0x14'),_0x11cdcf,'request\x20sent');_0x5d1e09(_0x1d206c['result'][_0xab4b('0x1a')]);}})[_0xab4b('0x1b')](function(_0x32eb29){logger[_0xab4b('0x18')](_0xab4b('0x14'),_0x11cdcf,_0x32eb29);_0x12b914(_0x32eb29);});});}exports[_0xab4b('0x1c')]=function(_0x27460e){var _0x34a081=this;return new Promise(function(_0x3268ab,_0x4cda2b){return db[_0xab4b('0x1d')][_0xab4b('0x1e')]({'raw':_0x27460e[_0xab4b('0x1f')]?_0x27460e[_0xab4b('0x1f')][_0xab4b('0x20')]===undefined?!![]:![]:!![],'where':_0x27460e[_0xab4b('0x1f')]?_0x27460e[_0xab4b('0x1f')][_0xab4b('0x21')]||null:null,'attributes':_0x27460e[_0xab4b('0x1f')]?_0x27460e['options'][_0xab4b('0x22')]||null:null,'limit':_0x27460e['options']?_0x27460e[_0xab4b('0x1f')][_0xab4b('0x23')]||null:null,'include':_0x27460e[_0xab4b('0x1f')]?_0x27460e[_0xab4b('0x1f')][_0xab4b('0x24')]?_[_0xab4b('0x25')](_0x27460e['options'][_0xab4b('0x24')],function(_0x7aaf86){return{'model':db[_0x7aaf86[_0xab4b('0x26')]],'as':_0x7aaf86['as'],'attributes':_0x7aaf86['attributes'],'include':_0x7aaf86[_0xab4b('0x24')]?_[_0xab4b('0x25')](_0x7aaf86[_0xab4b('0x24')],function(_0x2c2620){return{'model':db[_0x2c2620[_0xab4b('0x26')]],'as':_0x2c2620['as'],'attributes':_0x2c2620[_0xab4b('0x22')],'include':_0x2c2620[_0xab4b('0x24')]?_[_0xab4b('0x25')](_0x2c2620[_0xab4b('0x24')],function(_0x45a5f2){return{'model':db[_0x45a5f2['model']],'as':_0x45a5f2['as'],'attributes':_0x45a5f2[_0xab4b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xab4b('0x27')](function(_0x744937){logger[_0xab4b('0x13')]('GetFaxAccount',_0x27460e);logger['debug'](_0xab4b('0x1c'),_0x27460e,JSON[_0xab4b('0x17')](_0x744937));_0x3268ab(_0x744937);})[_0xab4b('0x1b')](function(_0x34ec30){logger['error'](_0xab4b('0x1c'),_0x34ec30[_0xab4b('0x1a')],_0x27460e);_0x4cda2b(_0x34a081[_0xab4b('0x18')](0x1f4,_0x34ec30['message']));});});};exports[_0xab4b('0x28')]=function(_0x23430a,_0x477c87,_0x4fc716){var _0x20b649=this;return new Promise(function(_0x7b22ce,_0x1d3908){var _0x37db0b={'body':_0x23430a[_0xab4b('0x29')],'channel':'fax'};var _0x335853=[];var _0x4a85ae=[];var _0x54fa7d={};return db[_0xab4b('0x2a')][_0xab4b('0x2b')]()[_0xab4b('0x27')](function(_0x2ef930){if(!_0x2ef930){throw new db[(_0xab4b('0x2c'))][(_0xab4b('0x2d'))](_0xab4b('0x2e'));}_0x335853=_[_0xab4b('0x2f')](_[_0xab4b('0x30')](_0x2ef930),['createdAt',_0xab4b('0x31')]);_0x4a85ae=_[_0xab4b('0x2f')](_[_0xab4b('0x30')](_0x2ef930),['createdAt',_0xab4b('0x31'),'CompanyId',_0xab4b('0x32')]);if(_0x23430a[_0xab4b('0x29')]['id']){delete _0x23430a['body']['id'];}if(_[_0xab4b('0x33')](_0x23430a['body'][_0xab4b('0x34')])){throw new db[(_0xab4b('0x2c'))]['ValidationError'](_0xab4b('0x35'));}if(_['isNil'](_0x23430a['body']['body'])||_0x23430a[_0xab4b('0x29')][_0xab4b('0x29')]===''){throw new db[(_0xab4b('0x2c'))][(_0xab4b('0x2d'))](_0xab4b('0x36'));}if(_['isNil'](_0x23430a[_0xab4b('0x29')][_0xab4b('0x37')])){throw new db[(_0xab4b('0x2c'))][(_0xab4b('0x2d'))](_0xab4b('0x38')+_0x4a85ae);}if(!_[_0xab4b('0x39')](_0x4a85ae,_0x23430a[_0xab4b('0x29')][_0xab4b('0x37')])){throw new db[(_0xab4b('0x2c'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a85ae);}_0x54fa7d[_0x23430a[_0xab4b('0x29')][_0xab4b('0x37')]]=_0x23430a[_0xab4b('0x29')][_0xab4b('0x34')];})[_0xab4b('0x27')](function(){return db[_0xab4b('0x1d')]['find']({'where':{'id':_0x23430a['account']['id']},'include':[{'model':db['CmList'],'as':_0xab4b('0x3a'),'include':[{'model':db[_0xab4b('0x2a')],'as':_0xab4b('0x3b'),'where':_0x54fa7d,'limit':0x1,'order':[[_0xab4b('0x31'),_0xab4b('0x3c')]]}]},{'model':db['FaxApplication'],'as':_0xab4b('0x3d')}]});})[_0xab4b('0x27')](function(_0x5922){if(_0x5922&&_0x5922['List']){var _0x306ff8=_0x5922[_0xab4b('0x3e')]({'plain':!![]});_0x37db0b['account']=_0x306ff8;_0x37db0b[_0xab4b('0x3f')]=_0x306ff8[_0xab4b('0x3d')];_0x37db0b[_0xab4b('0x40')]=_0x306ff8[_0xab4b('0x3a')];_0x37db0b['applications']=_[_0xab4b('0x41')](_0x37db0b[_0xab4b('0x3f')],[_0xab4b('0x42')],[_0xab4b('0x43')]);if(_0x37db0b[_0xab4b('0x44')]['Applications']){delete _0x37db0b[_0xab4b('0x44')]['Applications'];}if(_0x37db0b[_0xab4b('0x44')][_0xab4b('0x3a')]&&_0x37db0b[_0xab4b('0x44')][_0xab4b('0x3a')][_0xab4b('0x3b')][_0xab4b('0x45')]){return _0x37db0b[_0xab4b('0x44')]['List'][_0xab4b('0x3b')][0x0];}var _0x3db092=_['defaults'](_0x23430a[_0xab4b('0x29')],{'firstName':_0x23430a['body'][_0xab4b('0x34')],'ListId':_0x306ff8[_0xab4b('0x32')]});_0x3db092[_0x23430a[_0xab4b('0x29')]['mapKey']]=_0x23430a[_0xab4b('0x29')][_0xab4b('0x34')];return db[_0xab4b('0x2a')][_0xab4b('0x46')](_0x3db092,{'fields':_0x335853,'raw':!![]});}})[_0xab4b('0x27')](function(_0x177534){_0x37db0b['contact']=_0x177534;if(_0x177534){var _0x222b62={'ContactId':_0x177534['id'],'FaxAccountId':_0x23430a[_0xab4b('0x44')]['id'],'fax':_0x177534[_0xab4b('0x47')]};return db[_0xab4b('0x48')][_0xab4b('0x49')]({'where':{'ContactId':_0x177534['id'],'closed':![],'FaxAccountId':_0x23430a[_0xab4b('0x44')]['id']}})[_0xab4b('0x27')](function(_0x6d7e6c){if(_0x6d7e6c){return[_0x6d7e6c,![]];}return db[_0xab4b('0x48')][_0xab4b('0x46')](_0x222b62)[_0xab4b('0x27')](function(_0x6fd8f2){return[_0x6fd8f2,!![]];});});}else{throw new Error(_0xab4b('0x4a'));}})[_0xab4b('0x4b')](function(_0x5ad21e,_0x9a1415){var _0x22bc2a=_0x5ad21e['get']({'plain':!![]});if(_0x9a1415){if(_0x37db0b[_0xab4b('0x44')]['autoclose']){_0x37db0b[_0xab4b('0x3f')][_0xab4b('0x4c')]({'id':0x0,'priority':_0x37db0b[_0xab4b('0x3f')][_0xab4b('0x45')]+0x1,'app':_0xab4b('0x4d'),'appdata':_0xab4b('0x4e'),'interval':_0xab4b('0x4f')});}_0x22bc2a[_0xab4b('0x50')]=!![];}else{_0x22bc2a[_0xab4b('0x50')]=![];}_0x37db0b[_0xab4b('0x51')]=_0x22bc2a;return db[_0xab4b('0x52')][_0xab4b('0x46')]({'body':_0x23430a[_0xab4b('0x29')][_0xab4b('0x29')],'FaxAccountId':_0x23430a[_0xab4b('0x44')]['id'],'FaxInteractionId':_0x5ad21e['id'],'direction':'in','ContactId':_0x5ad21e['ContactId'],'AttachmentId':_0x23430a[_0xab4b('0x29')][_0xab4b('0x53')]});})[_0xab4b('0x27')](function(_0xf9a10c){_0x37db0b['message']=_0xf9a10c;if(_0x37db0b[_0xab4b('0x51')][_0xab4b('0x54')]){return db['User'][_0xab4b('0x49')]({'attributes':['id','name'],'where':{'id':_0x37db0b[_0xab4b('0x51')][_0xab4b('0x54')]}})[_0xab4b('0x27')](function(_0xd4d82b){if(_0xd4d82b){_0x37db0b['applications'][_0xab4b('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd4d82b[_0xab4b('0x56')]+','+(_0x37db0b[_0xab4b('0x44')][_0xab4b('0x57')]||0xa),'interval':_0xab4b('0x4f')});}return respondWithRpcPromise('Start',_0xab4b('0x58'),_0x37db0b);});}return respondWithRpcPromise(_0xab4b('0x59'),_0xab4b('0x58'),_0x37db0b);})[_0xab4b('0x27')](function(_0x453e22){_0x7b22ce(_0x453e22);})[_0xab4b('0x1b')](function(_0x4176d){_0x1d3908(_0x20b649[_0xab4b('0x18')](0x1f4,_0x4176d[_0xab4b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 2328112..021f2f8 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 _0x48d7=['register','length','faxAccount:','./faxAccount.events','remove','update','emit','removeListener'];(function(_0x580d4a,_0x3e612b){var _0x897cdd=function(_0x357e83){while(--_0x357e83){_0x580d4a['push'](_0x580d4a['shift']());}};_0x897cdd(++_0x3e612b);}(_0x48d7,0x1cb));var _0x748d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x48d7[_0x20a584];return _0x4b41a8;};'use strict';var FaxAccountEvents=require(_0x748d('0x0'));var events=['save',_0x748d('0x1'),_0x748d('0x2')];function createListener(_0x5ee381,_0x36923f){return function(_0x1f062b){_0x36923f[_0x748d('0x3')](_0x5ee381,_0x1f062b);};}function removeListener(_0x54bce6,_0x573dde){return function(){FaxAccountEvents[_0x748d('0x4')](_0x54bce6,_0x573dde);};}exports[_0x748d('0x5')]=function(_0x5d7ae9){for(var _0x3b4548=0x0,_0x542533=events[_0x748d('0x6')];_0x3b4548<_0x542533;_0x3b4548++){var _0x3b122c=events[_0x3b4548];var _0x19b9b2=createListener(_0x748d('0x7')+_0x3b122c,_0x5d7ae9);FaxAccountEvents['on'](_0x3b122c,_0x19b9b2);}}; \ No newline at end of file +var _0x6058=['save','update','emit','removeListener','length','faxAccount:','./faxAccount.events'];(function(_0xa3f96d,_0x178175){var _0x3669f9=function(_0x11ba61){while(--_0x11ba61){_0xa3f96d['push'](_0xa3f96d['shift']());}};_0x3669f9(++_0x178175);}(_0x6058,0x141));var _0x8605=function(_0x3fa59c,_0x2302f9){_0x3fa59c=_0x3fa59c-0x0;var _0x239a2c=_0x6058[_0x3fa59c];return _0x239a2c;};'use strict';var FaxAccountEvents=require(_0x8605('0x0'));var events=[_0x8605('0x1'),'remove',_0x8605('0x2')];function createListener(_0x51bf80,_0x225454){return function(_0x294a7e){_0x225454[_0x8605('0x3')](_0x51bf80,_0x294a7e);};}function removeListener(_0x36a211,_0x184a4a){return function(){FaxAccountEvents[_0x8605('0x4')](_0x36a211,_0x184a4a);};}exports['register']=function(_0x4ad5c5){for(var _0xb7f0c4=0x0,_0x222660=events[_0x8605('0x5')];_0xb7f0c4<_0x222660;_0xb7f0c4++){var _0x40480d=events[_0xb7f0c4];var _0x2d622b=createListener(_0x8605('0x6')+_0x40480d,_0x4ad5c5);FaxAccountEvents['on'](_0x40480d,_0x2d622b);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 610d871..8f31f28 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x1677d7,_0x263bb0){var _0x5b9f31=function(_0x5eb0f8){while(--_0x5eb0f8){_0x1677d7['push'](_0x1677d7['shift']());}};_0x5b9f31(++_0x263bb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x2dab23,_0x11db5f){var _0x509868=function(_0x3d477f){while(--_0x3d477f){_0x2dab23['push'](_0x2dab23['shift']());}};_0x509868(++_0x11db5f);}(_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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index d2c7c60..e5ca1db 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 _0xd5bd=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x229287,_0x389d45){var _0x13335f=function(_0x358126){while(--_0x358126){_0x229287['push'](_0x229287['shift']());}};_0x13335f(++_0x389d45);}(_0xd5bd,0x1e7));var _0xdd5b=function(_0x1d6a12,_0x49b3d3){_0x1d6a12=_0x1d6a12-0x0;var _0x3a79ca=_0xd5bd[_0x1d6a12];return _0x3a79ca;};'use strict';var Sequelize=require('sequelize');module[_0xdd5b('0x0')]={'priority':{'type':Sequelize[_0xdd5b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdd5b('0x2')],'allowNull':![],'defaultValue':_0xdd5b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdd5b('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdd5b('0x4')}}; \ No newline at end of file +var _0x5702=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x2356aa,_0x1dbbe9){var _0x4bb878=function(_0x5a4aff){while(--_0x5a4aff){_0x2356aa['push'](_0x2356aa['shift']());}};_0x4bb878(++_0x1dbbe9);}(_0x5702,0x107));var _0x2570=function(_0x987bb3,_0x21b6de){_0x987bb3=_0x987bb3-0x0;var _0x59c869=_0x5702[_0x987bb3];return _0x59c869;};'use strict';var Sequelize=require(_0x2570('0x0'));module[_0x2570('0x1')]={'priority':{'type':Sequelize[_0x2570('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2570('0x3')],'allowNull':![],'defaultValue':_0x2570('0x4')},'appdata':{'type':Sequelize[_0x2570('0x5')]()},'description':{'type':Sequelize[_0x2570('0x3')]},'interval':{'type':Sequelize[_0x2570('0x3')],'defaultValue':_0x2570('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b773029..c4a6179 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 _0xf231=['stack','name','index','map','FaxApplication','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','error'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0xf231,0xb5));var _0x1f23=function(_0x11f231,_0x1fadab){_0x11f231=_0x11f231-0x0;var _0x20c4b9=_0xf231[_0x11f231];return _0x20c4b9;};'use strict';var emlformat=require(_0x1f23('0x0'));var rimraf=require(_0x1f23('0x1'));var zipdir=require(_0x1f23('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f23('0x3'));var moment=require(_0x1f23('0x4'));var BPromise=require(_0x1f23('0x5'));var Mustache=require(_0x1f23('0x6'));var util=require(_0x1f23('0x7'));var path=require(_0x1f23('0x8'));var sox=require(_0x1f23('0x9'));var csv=require(_0x1f23('0xa'));var ejs=require(_0x1f23('0xb'));var fs=require('fs');var fs_extra=require(_0x1f23('0xc'));var _=require(_0x1f23('0xd'));var squel=require(_0x1f23('0xe'));var crypto=require(_0x1f23('0xf'));var jsforce=require(_0x1f23('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f23('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f23('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1f23('0x13'));var hardwareService=require(_0x1f23('0x14'));var logger=require('../../config/logger')(_0x1f23('0x15'));var utils=require(_0x1f23('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1f23('0x17'));var db=require(_0x1f23('0x18'))['db'];function respondWithStatusCode(_0x342106,_0x5a9eff){_0x5a9eff=_0x5a9eff||0xcc;return function(_0x7ab056){if(_0x7ab056){return _0x342106[_0x1f23('0x19')](_0x5a9eff);}return _0x342106[_0x1f23('0x1a')](_0x5a9eff)[_0x1f23('0x1b')]();};}function respondWithResult(_0x312d6b,_0x2758f1){_0x2758f1=_0x2758f1||0xc8;return function(_0x22452a){if(_0x22452a){return _0x312d6b[_0x1f23('0x1a')](_0x2758f1)['json'](_0x22452a);}};}function respondWithFilteredResult(_0x3fbd57,_0x5aa55d){return function(_0x5ea56c){if(_0x5ea56c){var _0x41cbf9=typeof _0x5aa55d[_0x1f23('0x1c')]==='undefined'&&typeof _0x5aa55d['limit']===_0x1f23('0x1d');var _0x17941b=_0x5ea56c[_0x1f23('0x1e')];var _0x3f7b03=_0x41cbf9?0x0:_0x5aa55d[_0x1f23('0x1c')];var _0x4bc622=_0x41cbf9?_0x5ea56c[_0x1f23('0x1e')]:_0x5aa55d['offset']+_0x5aa55d[_0x1f23('0x1f')];var _0x1b5016;if(_0x4bc622>=_0x17941b){_0x4bc622=_0x17941b;_0x1b5016=0xc8;}else{_0x1b5016=0xce;}_0x3fbd57[_0x1f23('0x1a')](_0x1b5016);return _0x3fbd57[_0x1f23('0x20')](_0x1f23('0x21'),_0x3f7b03+'-'+_0x4bc622+'/'+_0x17941b)[_0x1f23('0x22')](_0x5ea56c);}return null;};}function patchUpdates(_0x53bc64){return function(_0x54278d){try{jsonpatch['apply'](_0x54278d,_0x53bc64,!![]);}catch(_0x39799c){return BPromise[_0x1f23('0x23')](_0x39799c);}return _0x54278d[_0x1f23('0x24')]();};}function saveUpdates(_0x1caee9,_0x4df1d4){return function(_0x1cbf75){if(_0x1cbf75){return _0x1cbf75[_0x1f23('0x25')](_0x1caee9)['then'](function(_0x5ab401){return _0x5ab401;});}return null;};}function removeEntity(_0x1d8f63,_0x53041e){return function(_0x28b4f7){if(_0x28b4f7){return _0x28b4f7[_0x1f23('0x26')]()[_0x1f23('0x27')](function(){_0x1d8f63[_0x1f23('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ec4f8,_0x4fb0db){return function(_0x42ee0f){if(!_0x42ee0f){_0x3ec4f8[_0x1f23('0x19')](0x194);}return _0x42ee0f;};}function handleError(_0x5de8cc,_0x16fa6c){_0x16fa6c=_0x16fa6c||0x1f4;return function(_0x11b57a){logger[_0x1f23('0x28')](_0x11b57a[_0x1f23('0x29')]);if(_0x11b57a[_0x1f23('0x2a')]){delete _0x11b57a[_0x1f23('0x2a')];}_0x5de8cc[_0x1f23('0x1a')](_0x16fa6c)['send'](_0x11b57a);};}exports[_0x1f23('0x2b')]=function(_0x93ee53,_0x592672){var _0x476c4a={},_0x36c364={},_0x2198d0={'count':0x0,'rows':[]};var _0x157c15=_[_0x1f23('0x2c')](db[_0x1f23('0x2d')][_0x1f23('0x2e')],function(_0x572b49){return{'name':_0x572b49[_0x1f23('0x2f')],'type':_0x572b49['type']['key']};});_0x36c364[_0x1f23('0x30')]=_[_0x1f23('0x2c')](_0x157c15,_0x1f23('0x2a'));_0x36c364[_0x1f23('0x31')]=_[_0x1f23('0x32')](_0x93ee53['query']);_0x36c364[_0x1f23('0x33')]=_[_0x1f23('0x34')](_0x36c364['model'],_0x36c364['query']);_0x476c4a[_0x1f23('0x35')]=_['intersection'](_0x36c364['model'],qs[_0x1f23('0x36')](_0x93ee53[_0x1f23('0x31')]['fields']));_0x476c4a['attributes']=_0x476c4a[_0x1f23('0x35')][_0x1f23('0x37')]?_0x476c4a[_0x1f23('0x35')]:_0x36c364[_0x1f23('0x30')];if(!_0x93ee53[_0x1f23('0x31')][_0x1f23('0x38')](_0x1f23('0x39'))){_0x476c4a[_0x1f23('0x1f')]=qs[_0x1f23('0x1f')](_0x93ee53[_0x1f23('0x31')][_0x1f23('0x1f')]);_0x476c4a[_0x1f23('0x1c')]=qs['offset'](_0x93ee53['query'][_0x1f23('0x1c')]);}_0x476c4a[_0x1f23('0x3a')]=qs['sort'](_0x93ee53[_0x1f23('0x31')][_0x1f23('0x3b')]);_0x476c4a[_0x1f23('0x3c')]=qs[_0x1f23('0x33')](_['pick'](_0x93ee53['query'],_0x36c364['filters']),_0x157c15);if(_0x93ee53[_0x1f23('0x31')][_0x1f23('0x3d')]){_0x476c4a['where']=_[_0x1f23('0x3e')](_0x476c4a[_0x1f23('0x3c')],{'$or':_[_0x1f23('0x2c')](_0x157c15,function(_0x319f9b){if(_0x319f9b['type']!==_0x1f23('0x3f')){var _0x57f45f={};_0x57f45f[_0x319f9b[_0x1f23('0x2a')]]={'$like':'%'+_0x93ee53[_0x1f23('0x31')]['filter']+'%'};return _0x57f45f;}})});}_0x476c4a=_['merge']({},_0x476c4a,_0x93ee53['options']);var _0x104328={'where':_0x476c4a[_0x1f23('0x3c')]};return db[_0x1f23('0x2d')][_0x1f23('0x1e')](_0x104328)['then'](function(_0x1a616b){_0x2198d0[_0x1f23('0x1e')]=_0x1a616b;if(_0x93ee53[_0x1f23('0x31')][_0x1f23('0x40')]){_0x476c4a[_0x1f23('0x41')]=[{'all':!![]}];}return db[_0x1f23('0x2d')][_0x1f23('0x42')](_0x476c4a);})[_0x1f23('0x27')](function(_0x36130a){_0x2198d0[_0x1f23('0x43')]=_0x36130a;return _0x2198d0;})[_0x1f23('0x27')](respondWithFilteredResult(_0x592672,_0x476c4a))[_0x1f23('0x44')](handleError(_0x592672,null));};exports[_0x1f23('0x45')]=function(_0x3e14b7,_0x296afe){var _0x59c6a2={'raw':!![],'where':{'id':_0x3e14b7[_0x1f23('0x46')]['id']}},_0x1086b8={};_0x1086b8[_0x1f23('0x30')]=_[_0x1f23('0x32')](db['FaxApplication'][_0x1f23('0x2e')]);_0x1086b8[_0x1f23('0x31')]=_[_0x1f23('0x32')](_0x3e14b7['query']);_0x1086b8[_0x1f23('0x33')]=_[_0x1f23('0x34')](_0x1086b8[_0x1f23('0x30')],_0x1086b8['query']);_0x59c6a2[_0x1f23('0x35')]=_['intersection'](_0x1086b8['model'],qs[_0x1f23('0x36')](_0x3e14b7[_0x1f23('0x31')]['fields']));_0x59c6a2[_0x1f23('0x35')]=_0x59c6a2['attributes'][_0x1f23('0x37')]?_0x59c6a2[_0x1f23('0x35')]:_0x1086b8['model'];if(_0x3e14b7[_0x1f23('0x31')][_0x1f23('0x40')]){_0x59c6a2['include']=[{'all':!![]}];}_0x59c6a2=_[_0x1f23('0x3e')]({},_0x59c6a2,_0x3e14b7['options']);return db[_0x1f23('0x2d')][_0x1f23('0x47')](_0x59c6a2)['then'](handleEntityNotFound(_0x296afe,null))[_0x1f23('0x27')](respondWithResult(_0x296afe,null))[_0x1f23('0x44')](handleError(_0x296afe,null));};exports[_0x1f23('0x48')]=function(_0x49fb4b,_0x4f7384){return db[_0x1f23('0x2d')]['create'](_0x49fb4b[_0x1f23('0x49')],{})[_0x1f23('0x27')](respondWithResult(_0x4f7384,0xc9))['catch'](handleError(_0x4f7384,null));};exports[_0x1f23('0x25')]=function(_0x158673,_0x1f0cf4){if(_0x158673[_0x1f23('0x49')]['id']){delete _0x158673['body']['id'];}return db[_0x1f23('0x2d')][_0x1f23('0x47')]({'where':{'id':_0x158673['params']['id']}})[_0x1f23('0x27')](handleEntityNotFound(_0x1f0cf4,null))[_0x1f23('0x27')](saveUpdates(_0x158673['body'],null))[_0x1f23('0x27')](respondWithResult(_0x1f0cf4,null))[_0x1f23('0x44')](handleError(_0x1f0cf4,null));};exports[_0x1f23('0x26')]=function(_0x5216b0,_0x441525){return db[_0x1f23('0x2d')][_0x1f23('0x47')]({'where':{'id':_0x5216b0[_0x1f23('0x46')]['id']}})[_0x1f23('0x27')](handleEntityNotFound(_0x441525,null))[_0x1f23('0x27')](removeEntity(_0x441525,null))[_0x1f23('0x44')](handleError(_0x441525,null));}; \ No newline at end of file +var _0xe871=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FaxApplication','rawAttributes','type','key','map','keys','filters','intersection','attributes','model','fields','query','length','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xe871,0x1a1));var _0x1e87=function(_0x204606,_0x4ff7c6){_0x204606=_0x204606-0x0;var _0x4e2d1a=_0xe871[_0x204606];return _0x4e2d1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e87('0x0'));var zipdir=require(_0x1e87('0x1'));var jsonpatch=require(_0x1e87('0x2'));var rp=require(_0x1e87('0x3'));var moment=require(_0x1e87('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1e87('0x5'));var sox=require(_0x1e87('0x6'));var csv=require(_0x1e87('0x7'));var ejs=require(_0x1e87('0x8'));var fs=require('fs');var fs_extra=require(_0x1e87('0x9'));var _=require(_0x1e87('0xa'));var squel=require(_0x1e87('0xb'));var crypto=require(_0x1e87('0xc'));var jsforce=require(_0x1e87('0xd'));var deskjs=require(_0x1e87('0xe'));var toCsv=require(_0x1e87('0x7'));var querystring=require(_0x1e87('0xf'));var Papa=require('papaparse');var Redis=require(_0x1e87('0x10'));var authService=require(_0x1e87('0x11'));var qs=require(_0x1e87('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e87('0x13'));var logger=require(_0x1e87('0x14'))(_0x1e87('0x15'));var utils=require(_0x1e87('0x16'));var config=require(_0x1e87('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e87('0x18'))['db'];function respondWithStatusCode(_0x149997,_0x381496){_0x381496=_0x381496||0xcc;return function(_0x2ce892){if(_0x2ce892){return _0x149997[_0x1e87('0x19')](_0x381496);}return _0x149997[_0x1e87('0x1a')](_0x381496)[_0x1e87('0x1b')]();};}function respondWithResult(_0x55a0a1,_0x56dd2d){_0x56dd2d=_0x56dd2d||0xc8;return function(_0x511cb6){if(_0x511cb6){return _0x55a0a1['status'](_0x56dd2d)[_0x1e87('0x1c')](_0x511cb6);}};}function respondWithFilteredResult(_0x13c19c,_0x13d06a){return function(_0x2bb8dd){if(_0x2bb8dd){var _0x5b8d9d=typeof _0x13d06a[_0x1e87('0x1d')]===_0x1e87('0x1e')&&typeof _0x13d06a['limit']===_0x1e87('0x1e');var _0x3409d3=_0x2bb8dd[_0x1e87('0x1f')];var _0x1e7ca9=_0x5b8d9d?0x0:_0x13d06a[_0x1e87('0x1d')];var _0x34c7b1=_0x5b8d9d?_0x2bb8dd[_0x1e87('0x1f')]:_0x13d06a[_0x1e87('0x1d')]+_0x13d06a[_0x1e87('0x20')];var _0x42fe26;if(_0x34c7b1>=_0x3409d3){_0x34c7b1=_0x3409d3;_0x42fe26=0xc8;}else{_0x42fe26=0xce;}_0x13c19c[_0x1e87('0x1a')](_0x42fe26);return _0x13c19c[_0x1e87('0x21')](_0x1e87('0x22'),_0x1e7ca9+'-'+_0x34c7b1+'/'+_0x3409d3)['json'](_0x2bb8dd);}return null;};}function patchUpdates(_0x9aaa10){return function(_0x53ee4f){try{jsonpatch[_0x1e87('0x23')](_0x53ee4f,_0x9aaa10,!![]);}catch(_0x1fae12){return BPromise[_0x1e87('0x24')](_0x1fae12);}return _0x53ee4f[_0x1e87('0x25')]();};}function saveUpdates(_0x55f651,_0x298c95){return function(_0x4fe957){if(_0x4fe957){return _0x4fe957[_0x1e87('0x26')](_0x55f651)[_0x1e87('0x27')](function(_0x5453bb){return _0x5453bb;});}return null;};}function removeEntity(_0x24f11e,_0x38da31){return function(_0x588814){if(_0x588814){return _0x588814[_0x1e87('0x28')]()['then'](function(){_0x24f11e[_0x1e87('0x1a')](0xcc)[_0x1e87('0x1b')]();});}};}function handleEntityNotFound(_0x2ef8e7,_0x471284){return function(_0x288039){if(!_0x288039){_0x2ef8e7[_0x1e87('0x19')](0x194);}return _0x288039;};}function handleError(_0x239877,_0x33c78e){_0x33c78e=_0x33c78e||0x1f4;return function(_0x2b36ef){logger[_0x1e87('0x29')](_0x2b36ef[_0x1e87('0x2a')]);if(_0x2b36ef[_0x1e87('0x2b')]){delete _0x2b36ef[_0x1e87('0x2b')];}_0x239877[_0x1e87('0x1a')](_0x33c78e)[_0x1e87('0x2c')](_0x2b36ef);};}exports[_0x1e87('0x2d')]=function(_0xed25a3,_0x3a112e){var _0x281719={},_0x453a09={},_0x4a80ba={'count':0x0,'rows':[]};var _0x180014=_['map'](db[_0x1e87('0x2e')][_0x1e87('0x2f')],function(_0x55146a){return{'name':_0x55146a['fieldName'],'type':_0x55146a[_0x1e87('0x30')][_0x1e87('0x31')]};});_0x453a09['model']=_[_0x1e87('0x32')](_0x180014,_0x1e87('0x2b'));_0x453a09['query']=_[_0x1e87('0x33')](_0xed25a3['query']);_0x453a09[_0x1e87('0x34')]=_[_0x1e87('0x35')](_0x453a09['model'],_0x453a09['query']);_0x281719[_0x1e87('0x36')]=_[_0x1e87('0x35')](_0x453a09[_0x1e87('0x37')],qs[_0x1e87('0x38')](_0xed25a3[_0x1e87('0x39')][_0x1e87('0x38')]));_0x281719['attributes']=_0x281719['attributes'][_0x1e87('0x3a')]?_0x281719[_0x1e87('0x36')]:_0x453a09[_0x1e87('0x37')];if(!_0xed25a3[_0x1e87('0x39')]['hasOwnProperty'](_0x1e87('0x3b'))){_0x281719[_0x1e87('0x20')]=qs[_0x1e87('0x20')](_0xed25a3['query'][_0x1e87('0x20')]);_0x281719[_0x1e87('0x1d')]=qs[_0x1e87('0x1d')](_0xed25a3[_0x1e87('0x39')][_0x1e87('0x1d')]);}_0x281719['order']=qs[_0x1e87('0x3c')](_0xed25a3[_0x1e87('0x39')][_0x1e87('0x3c')]);_0x281719['where']=qs[_0x1e87('0x34')](_['pick'](_0xed25a3[_0x1e87('0x39')],_0x453a09[_0x1e87('0x34')]),_0x180014);if(_0xed25a3[_0x1e87('0x39')][_0x1e87('0x3d')]){_0x281719['where']=_[_0x1e87('0x3e')](_0x281719[_0x1e87('0x3f')],{'$or':_[_0x1e87('0x32')](_0x180014,function(_0x5da282){if(_0x5da282[_0x1e87('0x30')]!=='VIRTUAL'){var _0x45990b={};_0x45990b[_0x5da282[_0x1e87('0x2b')]]={'$like':'%'+_0xed25a3[_0x1e87('0x39')][_0x1e87('0x3d')]+'%'};return _0x45990b;}})});}_0x281719=_['merge']({},_0x281719,_0xed25a3[_0x1e87('0x40')]);var _0x4aa4d9={'where':_0x281719[_0x1e87('0x3f')]};return db[_0x1e87('0x2e')][_0x1e87('0x1f')](_0x4aa4d9)[_0x1e87('0x27')](function(_0x143354){_0x4a80ba[_0x1e87('0x1f')]=_0x143354;if(_0xed25a3[_0x1e87('0x39')][_0x1e87('0x41')]){_0x281719[_0x1e87('0x42')]=[{'all':!![]}];}return db[_0x1e87('0x2e')][_0x1e87('0x43')](_0x281719);})['then'](function(_0x1e6a5){_0x4a80ba[_0x1e87('0x44')]=_0x1e6a5;return _0x4a80ba;})[_0x1e87('0x27')](respondWithFilteredResult(_0x3a112e,_0x281719))['catch'](handleError(_0x3a112e,null));};exports[_0x1e87('0x45')]=function(_0x3699ef,_0x3a9e6e){var _0x248b9e={'raw':!![],'where':{'id':_0x3699ef[_0x1e87('0x46')]['id']}},_0xa6569={};_0xa6569[_0x1e87('0x37')]=_[_0x1e87('0x33')](db[_0x1e87('0x2e')][_0x1e87('0x2f')]);_0xa6569[_0x1e87('0x39')]=_[_0x1e87('0x33')](_0x3699ef[_0x1e87('0x39')]);_0xa6569[_0x1e87('0x34')]=_[_0x1e87('0x35')](_0xa6569[_0x1e87('0x37')],_0xa6569[_0x1e87('0x39')]);_0x248b9e[_0x1e87('0x36')]=_['intersection'](_0xa6569[_0x1e87('0x37')],qs['fields'](_0x3699ef['query']['fields']));_0x248b9e[_0x1e87('0x36')]=_0x248b9e[_0x1e87('0x36')][_0x1e87('0x3a')]?_0x248b9e[_0x1e87('0x36')]:_0xa6569[_0x1e87('0x37')];if(_0x3699ef[_0x1e87('0x39')][_0x1e87('0x41')]){_0x248b9e['include']=[{'all':!![]}];}_0x248b9e=_[_0x1e87('0x3e')]({},_0x248b9e,_0x3699ef[_0x1e87('0x40')]);return db[_0x1e87('0x2e')][_0x1e87('0x47')](_0x248b9e)[_0x1e87('0x27')](handleEntityNotFound(_0x3a9e6e,null))[_0x1e87('0x27')](respondWithResult(_0x3a9e6e,null))[_0x1e87('0x48')](handleError(_0x3a9e6e,null));};exports['create']=function(_0x5ca10a,_0xa0fbd9){return db[_0x1e87('0x2e')][_0x1e87('0x49')](_0x5ca10a['body'],{})['then'](respondWithResult(_0xa0fbd9,0xc9))[_0x1e87('0x48')](handleError(_0xa0fbd9,null));};exports[_0x1e87('0x26')]=function(_0x575e85,_0x29e5da){if(_0x575e85['body']['id']){delete _0x575e85[_0x1e87('0x4a')]['id'];}return db[_0x1e87('0x2e')][_0x1e87('0x47')]({'where':{'id':_0x575e85[_0x1e87('0x46')]['id']}})[_0x1e87('0x27')](handleEntityNotFound(_0x29e5da,null))['then'](saveUpdates(_0x575e85[_0x1e87('0x4a')],null))[_0x1e87('0x27')](respondWithResult(_0x29e5da,null))['catch'](handleError(_0x29e5da,null));};exports[_0x1e87('0x28')]=function(_0x2698d9,_0x192def){return db[_0x1e87('0x2e')][_0x1e87('0x47')]({'where':{'id':_0x2698d9[_0x1e87('0x46')]['id']}})[_0x1e87('0x27')](handleEntityNotFound(_0x192def,null))[_0x1e87('0x27')](removeEntity(_0x192def,null))[_0x1e87('0x48')](handleError(_0x192def,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index edcef6e..9b327a8 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 _0x0afb=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1744e1,_0x1d5cd9){var _0x5166a0=function(_0x5f28dd){while(--_0x5f28dd){_0x1744e1['push'](_0x1744e1['shift']());}};_0x5166a0(++_0x1d5cd9);}(_0x0afb,0x18b));var _0xb0af=function(_0x26a989,_0x88b496){_0x26a989=_0x26a989-0x0;var _0x11ca56=_0x0afb[_0x26a989];return _0x11ca56;};'use strict';var _=require(_0xb0af('0x0'));var util=require(_0xb0af('0x1'));var logger=require(_0xb0af('0x2'))('api');var moment=require(_0xb0af('0x3'));var BPromise=require(_0xb0af('0x4'));var rp=require(_0xb0af('0x5'));var fs=require('fs');var path=require(_0xb0af('0x6'));var rimraf=require(_0xb0af('0x7'));var config=require(_0xb0af('0x8'));var attributes=require('./faxApplication.attributes');module[_0xb0af('0x9')]=function(_0x4d4db5,_0x1af206){return _0x4d4db5[_0xb0af('0xa')](_0xb0af('0xb'),attributes,{'tableName':_0xb0af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb0af('0xd'),'collate':_0xb0af('0xe')});}; \ No newline at end of file +var _0x1615=['exports','define','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','./faxApplication.attributes'];(function(_0x14ad25,_0x508588){var _0x3a0628=function(_0x55fd28){while(--_0x55fd28){_0x14ad25['push'](_0x14ad25['shift']());}};_0x3a0628(++_0x508588);}(_0x1615,0x1dd));var _0x5161=function(_0x561bf3,_0x248909){_0x561bf3=_0x561bf3-0x0;var _0x5c0634=_0x1615[_0x561bf3];return _0x5c0634;};'use strict';var _=require('lodash');var util=require(_0x5161('0x0'));var logger=require(_0x5161('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5161('0x2'));var rp=require(_0x5161('0x3'));var fs=require('fs');var path=require(_0x5161('0x4'));var rimraf=require(_0x5161('0x5'));var config=require('../../config/environment');var attributes=require(_0x5161('0x6'));module[_0x5161('0x7')]=function(_0x23ee89,_0x589ddc){return _0x23ee89[_0x5161('0x8')]('FaxApplication',attributes,{'tableName':_0x5161('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5161('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index f711175..b045693 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 _0x94fe=['catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x62f192,_0x19340e){var _0x413c61=function(_0x3be0c8){while(--_0x3be0c8){_0x62f192['push'](_0x62f192['shift']());}};_0x413c61(++_0x19340e);}(_0x94fe,0x1b7));var _0xe94f=function(_0x13026d,_0x318917){_0x13026d=_0x13026d-0x0;var _0x13a4ae=_0x94fe[_0x13026d];return _0x13a4ae;};'use strict';var _=require(_0xe94f('0x0'));var util=require(_0xe94f('0x1'));var moment=require(_0xe94f('0x2'));var BPromise=require(_0xe94f('0x3'));var rs=require(_0xe94f('0x4'));var fs=require('fs');var Redis=require(_0xe94f('0x5'));var db=require(_0xe94f('0x6'))['db'];var utils=require(_0xe94f('0x7'));var logger=require(_0xe94f('0x8'))(_0xe94f('0x9'));var config=require(_0xe94f('0xa'));var jayson=require(_0xe94f('0xb'));var client=jayson[_0xe94f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43771c,_0x5317d8,_0x307c45){return new BPromise(function(_0x2152b5,_0x2e2f6e){return client['request'](_0x43771c,_0x307c45)[_0xe94f('0xd')](function(_0x4784df){logger[_0xe94f('0xe')](_0xe94f('0xf'),_0x5317d8,_0xe94f('0x10'));logger[_0xe94f('0x11')](_0xe94f('0x12'),_0x5317d8,_0xe94f('0x10'),JSON['stringify'](_0x4784df));if(_0x4784df[_0xe94f('0x13')]){if(_0x4784df[_0xe94f('0x13')][_0xe94f('0x14')]===0x1f4){logger[_0xe94f('0x13')](_0xe94f('0xf'),_0x5317d8,_0x4784df['error'][_0xe94f('0x15')]);return _0x2e2f6e(_0x4784df[_0xe94f('0x13')][_0xe94f('0x15')]);}logger['error'](_0xe94f('0xf'),_0x5317d8,_0x4784df[_0xe94f('0x13')][_0xe94f('0x15')]);return _0x2152b5(_0x4784df[_0xe94f('0x13')]['message']);}else{logger[_0xe94f('0xe')](_0xe94f('0xf'),_0x5317d8,'request\x20sent');_0x2152b5(_0x4784df[_0xe94f('0x16')][_0xe94f('0x15')]);}})[_0xe94f('0x17')](function(_0x2123c7){logger[_0xe94f('0x13')]('FaxApplication,\x20%s,\x20%s',_0x5317d8,_0x2123c7);_0x2e2f6e(_0x2123c7);});});}exports[_0xe94f('0x18')]=function(_0x21ae78){var _0x46e73c=this;return new Promise(function(_0xc5cbab,_0x59c573){return db[_0xe94f('0x19')]['update'](_0x21ae78[_0xe94f('0x1a')],{'raw':_0x21ae78[_0xe94f('0x1b')]?_0x21ae78[_0xe94f('0x1b')][_0xe94f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21ae78[_0xe94f('0x1b')]?_0x21ae78[_0xe94f('0x1b')][_0xe94f('0x1d')]||null:null,'attributes':_0x21ae78[_0xe94f('0x1b')]?_0x21ae78[_0xe94f('0x1b')][_0xe94f('0x1e')]||null:null,'limit':_0x21ae78[_0xe94f('0x1b')]?_0x21ae78[_0xe94f('0x1b')][_0xe94f('0x1f')]||null:null})[_0xe94f('0xd')](function(_0x304a97){logger[_0xe94f('0xe')]('UpdateFaxApplication',_0x21ae78);logger[_0xe94f('0x11')](_0xe94f('0x18'),_0x21ae78,JSON[_0xe94f('0x20')](_0x304a97));_0xc5cbab(_0x304a97);})['catch'](function(_0x55e41c){logger[_0xe94f('0x13')]('UpdateFaxApplication',_0x55e41c[_0xe94f('0x15')],_0x21ae78);_0x59c573(_0x46e73c['error'](0x1f4,_0x55e41c[_0xe94f('0x15')]));});});}; \ No newline at end of file +var _0x1a72=['UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x551754,_0x4ce079){var _0x187440=function(_0x273dda){while(--_0x273dda){_0x551754['push'](_0x551754['shift']());}};_0x187440(++_0x4ce079);}(_0x1a72,0xd5));var _0x21a7=function(_0x1d0055,_0x42e440){_0x1d0055=_0x1d0055-0x0;var _0x3192ad=_0x1a72[_0x1d0055];return _0x3192ad;};'use strict';var _=require(_0x21a7('0x0'));var util=require('util');var moment=require(_0x21a7('0x1'));var BPromise=require(_0x21a7('0x2'));var rs=require(_0x21a7('0x3'));var fs=require('fs');var Redis=require(_0x21a7('0x4'));var db=require(_0x21a7('0x5'))['db'];var utils=require(_0x21a7('0x6'));var logger=require(_0x21a7('0x7'))(_0x21a7('0x8'));var config=require(_0x21a7('0x9'));var jayson=require(_0x21a7('0xa'));var client=jayson[_0x21a7('0xb')][_0x21a7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xae1fcd,_0x119724,_0x1af892){return new BPromise(function(_0x381f08,_0x3fa32a){return client['request'](_0xae1fcd,_0x1af892)[_0x21a7('0xd')](function(_0x5b08a5){logger['info'](_0x21a7('0xe'),_0x119724,_0x21a7('0xf'));logger[_0x21a7('0x10')](_0x21a7('0x11'),_0x119724,_0x21a7('0xf'),JSON[_0x21a7('0x12')](_0x5b08a5));if(_0x5b08a5['error']){if(_0x5b08a5[_0x21a7('0x13')][_0x21a7('0x14')]===0x1f4){logger[_0x21a7('0x13')]('FaxApplication,\x20%s,\x20%s',_0x119724,_0x5b08a5[_0x21a7('0x13')][_0x21a7('0x15')]);return _0x3fa32a(_0x5b08a5[_0x21a7('0x13')][_0x21a7('0x15')]);}logger[_0x21a7('0x13')](_0x21a7('0xe'),_0x119724,_0x5b08a5[_0x21a7('0x13')][_0x21a7('0x15')]);return _0x381f08(_0x5b08a5[_0x21a7('0x13')][_0x21a7('0x15')]);}else{logger[_0x21a7('0x16')](_0x21a7('0xe'),_0x119724,_0x21a7('0xf'));_0x381f08(_0x5b08a5[_0x21a7('0x17')][_0x21a7('0x15')]);}})[_0x21a7('0x18')](function(_0x26cab9){logger[_0x21a7('0x13')](_0x21a7('0xe'),_0x119724,_0x26cab9);_0x3fa32a(_0x26cab9);});});}exports[_0x21a7('0x19')]=function(_0x3c62cc){var _0x427c4f=this;return new Promise(function(_0x864d57,_0xfd7c31){return db[_0x21a7('0x1a')][_0x21a7('0x1b')](_0x3c62cc[_0x21a7('0x1c')],{'raw':_0x3c62cc[_0x21a7('0x1d')]?_0x3c62cc['options'][_0x21a7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c62cc['options']?_0x3c62cc[_0x21a7('0x1d')][_0x21a7('0x1f')]||null:null,'attributes':_0x3c62cc[_0x21a7('0x1d')]?_0x3c62cc[_0x21a7('0x1d')][_0x21a7('0x20')]||null:null,'limit':_0x3c62cc['options']?_0x3c62cc[_0x21a7('0x1d')][_0x21a7('0x21')]||null:null})['then'](function(_0x551121){logger[_0x21a7('0x16')](_0x21a7('0x19'),_0x3c62cc);logger[_0x21a7('0x10')](_0x21a7('0x19'),_0x3c62cc,JSON['stringify'](_0x551121));_0x864d57(_0x551121);})[_0x21a7('0x18')](function(_0x15f38f){logger[_0x21a7('0x13')]('UpdateFaxApplication',_0x15f38f[_0x21a7('0x15')],_0x3c62cc);_0xfd7c31(_0x427c4f[_0x21a7('0x13')](0x1f4,_0x15f38f[_0x21a7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a62248b..de5765e 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 _0xa571=['index','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x38469c,_0x2232e7){var _0x3fb47c=function(_0x123575){while(--_0x123575){_0x38469c['push'](_0x38469c['shift']());}};_0x3fb47c(++_0x2232e7);}(_0xa571,0x107));var _0x1a57=function(_0x10864c,_0x49ca5e){_0x10864c=_0x10864c-0x0;var _0x4484ce=_0xa571[_0x10864c];return _0x4484ce;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./faxApplication.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0xb')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0xc')]);router['put'](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);module[_0x1a57('0x10')]=router; \ No newline at end of file +var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb688,0xcf));var _0x8b68=function(_0x4e75ed,_0x31154b){_0x4e75ed=_0x4e75ed-0x0;var _0x3c724f=_0xb688[_0x4e75ed];return _0x3c724f;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c33f0dd..74e4251 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 _0x61fa=['ENUM','out','exports','DATE','STRING'];(function(_0x360213,_0x4a4984){var _0x483c2d=function(_0x130346){while(--_0x130346){_0x360213['push'](_0x360213['shift']());}};_0x483c2d(++_0x4a4984);}(_0x61fa,0x1ba));var _0xa61f=function(_0x538afd,_0x8a95f1){_0x538afd=_0x538afd-0x0;var _0x5c1a7f=_0x61fa[_0x538afd];return _0x5c1a7f;};'use strict';var Sequelize=require('sequelize');module[_0xa61f('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa61f('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa61f('0x2')]},'note':{'type':Sequelize[_0xa61f('0x2')]},'read1stAt':{'type':Sequelize[_0xa61f('0x1')]},'fax':{'type':Sequelize[_0xa61f('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xa61f('0x3')]('in',_0xa61f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa61f('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xa61f('0x3')]('in',_0xa61f('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xca30=['DATE','STRING','out','ENUM','sequelize','BOOLEAN'];(function(_0x1ead47,_0x47766a){var _0x8cbbbc=function(_0x2a20fb){while(--_0x2a20fb){_0x1ead47['push'](_0x1ead47['shift']());}};_0x8cbbbc(++_0x47766a);}(_0xca30,0x106));var _0x0ca3=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xca30[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x0ca3('0x0'));module['exports']={'closed':{'type':Sequelize[_0x0ca3('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0ca3('0x2')]},'disposition':{'type':Sequelize[_0x0ca3('0x3')]},'secondDisposition':{'type':Sequelize[_0x0ca3('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0ca3('0x3')]},'note':{'type':Sequelize[_0x0ca3('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x0ca3('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0ca3('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0ca3('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0ca3('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index c354eb5..3b4d7f7 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 _0x94ff=['../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','reject','save','update','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','then','catch','waiting','talking','answered','unmanaged','total','closed','index','FaxInteraction','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','from','tools_tags','select','u.id','ui.FaxInteractionId','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','rows','show','params','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','format','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x94ff,0xc3));var _0xf94f=function(_0x2250d1,_0x3eafe2){_0x2250d1=_0x2250d1-0x0;var _0x16ed44=_0x94ff[_0x2250d1];return _0x16ed44;};'use strict';var emlformat=require(_0xf94f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf94f('0x1'));var moment=require(_0xf94f('0x2'));var BPromise=require(_0xf94f('0x3'));var Mustache=require('mustache');var util=require(_0xf94f('0x4'));var path=require(_0xf94f('0x5'));var sox=require('sox');var csv=require(_0xf94f('0x6'));var ejs=require(_0xf94f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf94f('0x8'));var squel=require('squel');var crypto=require(_0xf94f('0x9'));var jsforce=require(_0xf94f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf94f('0x6'));var querystring=require(_0xf94f('0xb'));var Papa=require(_0xf94f('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf94f('0xd'));var as=require(_0xf94f('0xe'));var hardwareService=require(_0xf94f('0xf'));var logger=require(_0xf94f('0x10'))(_0xf94f('0x11'));var utils=require(_0xf94f('0x12'));var config=require(_0xf94f('0x13'));var licenseUtil=require(_0xf94f('0x14'));var db=require(_0xf94f('0x15'))['db'];config['redis']=_[_0xf94f('0x16')](config[_0xf94f('0x17')],{'host':_0xf94f('0x18'),'port':0x18eb});var socket=require(_0xf94f('0x19'))(new Redis(config['redis']));require(_0xf94f('0x1a'))[_0xf94f('0x1b')](socket);function respondWithStatusCode(_0x1dc133,_0x38dcc3){_0x38dcc3=_0x38dcc3||0xcc;return function(_0x3505e2){if(_0x3505e2){return _0x1dc133[_0xf94f('0x1c')](_0x38dcc3);}return _0x1dc133['status'](_0x38dcc3)[_0xf94f('0x1d')]();};}function respondWithResult(_0x5924da,_0x2d7acd){_0x2d7acd=_0x2d7acd||0xc8;return function(_0x346c76){if(_0x346c76){return _0x5924da['status'](_0x2d7acd)['json'](_0x346c76);}};}function respondWithFilteredResult(_0x55944e,_0x457463){return function(_0x4fa016){if(_0x4fa016){var _0x4e43d1=typeof _0x457463[_0xf94f('0x1e')]==='undefined'&&typeof _0x457463[_0xf94f('0x1f')]==='undefined';var _0x3cf285=_0x4fa016['count'];var _0x18aedc=_0x4e43d1?0x0:_0x457463[_0xf94f('0x1e')];var _0x5779ea=_0x4e43d1?_0x4fa016[_0xf94f('0x20')]:_0x457463[_0xf94f('0x1e')]+_0x457463['limit'];var _0x3c275b;if(_0x5779ea>=_0x3cf285){_0x5779ea=_0x3cf285;_0x3c275b=0xc8;}else{_0x3c275b=0xce;}_0x55944e[_0xf94f('0x21')](_0x3c275b);return _0x55944e['set'](_0xf94f('0x22'),_0x18aedc+'-'+_0x5779ea+'/'+_0x3cf285)[_0xf94f('0x23')](_0x4fa016);}return null;};}function patchUpdates(_0x5beb9c){return function(_0x3ea709){try{jsonpatch[_0xf94f('0x24')](_0x3ea709,_0x5beb9c,!![]);}catch(_0x115637){return BPromise[_0xf94f('0x25')](_0x115637);}return _0x3ea709[_0xf94f('0x26')]();};}function saveUpdates(_0x4c9ec5,_0x2af18d){return function(_0x16a470){if(_0x16a470){return _0x16a470[_0xf94f('0x27')](_0x4c9ec5)['then'](function(_0x26b0dd){return _0x26b0dd;});}return null;};}function removeEntity(_0x2f1bd5,_0x4d87ef){return function(_0x1cb6e5){if(_0x1cb6e5){return _0x1cb6e5['destroy']()['then'](function(){_0x2f1bd5[_0xf94f('0x21')](0xcc)[_0xf94f('0x1d')]();});}};}function handleEntityNotFound(_0x58f56f,_0x55e414){return function(_0x9cdeeb){if(!_0x9cdeeb){_0x58f56f[_0xf94f('0x1c')](0x194);}return _0x9cdeeb;};}function handleError(_0x4d2c11,_0x5fb66c){_0x5fb66c=_0x5fb66c||0x1f4;return function(_0x2be1e1){logger[_0xf94f('0x28')](_0x2be1e1['stack']);if(_0x2be1e1[_0xf94f('0x29')]){delete _0x2be1e1['name'];}_0x4d2c11[_0xf94f('0x21')](_0x5fb66c)[_0xf94f('0x2a')](_0x2be1e1);};}function getInteractionUsers(_0x12abe6,_0x599e64){return new BPromise(function(_0x1175fc,_0xe3e35){try{if(_0x599e64[_0x12abe6['id']]){_0x12abe6[_0xf94f('0x2b')]=_[_0xf94f('0x2c')](_0x599e64[_0x12abe6['id']],function(_0x464f4e){return{'id':_0x464f4e['id'],'fullname':_0x464f4e[_0xf94f('0x2d')]};});}}catch(_0xfeb13f){_0xe3e35(_0xfeb13f);}_0x1175fc(_0x12abe6);});}function getInteractionTags(_0x57716c,_0x43f19c){return new BPromise(function(_0x37bb43,_0x29ae73){try{if(_0x57716c[_0xf94f('0x2e')]){_0x57716c[_0xf94f('0x2f')]=[];_0x57716c[_0xf94f('0x2e')][_0xf94f('0x30')](',')[_0xf94f('0x31')](function(_0x1891ca){_0x57716c[_0xf94f('0x2f')][_0xf94f('0x32')](_0x43f19c[_0x1891ca]);});}delete _0x57716c['TagIds'];}catch(_0x11022c){_0x29ae73(_0x11022c);}_0x37bb43(_0x57716c);});}function updateFaxInteraction(_0x17d925,_0x302391,_0x4f9ef2){return new BPromise(function(_0x1b8aad,_0x2ad886){return getInteractionUsers(_0x17d925,_0x4f9ef2)[_0xf94f('0x33')](function(_0x378810){return getInteractionTags(_0x378810,_0x302391);})[_0xf94f('0x33')](function(_0x1a9bf1){return getStateInteraction(_0x1a9bf1);})[_0xf94f('0x33')](function(_0x52ddfd){_0x1b8aad(_0x52ddfd);})[_0xf94f('0x34')](function(_0x239ba9){_0x2ad886(_0x239ba9);});});}function getStateInteraction(_0x58e599){return new BPromise(function(_0x591792){_0x58e599[_0xf94f('0x35')]=0x0;_0x58e599[_0xf94f('0x36')]=0x0;_0x58e599[_0xf94f('0x37')]=0x0;_0x58e599[_0xf94f('0x38')]=0x0;_0x58e599[_0xf94f('0x39')]=0x0;if(!_0x58e599[_0xf94f('0x3a')]&&!_0x58e599['UserId']){_0x58e599[_0xf94f('0x35')]+=0x1;}if(!_0x58e599['closed']&&_0x58e599['UserId']){_0x58e599[_0xf94f('0x36')]+=0x1;if(_0x58e599[_0xf94f('0x35')]){_0x58e599[_0xf94f('0x35')]-=0x1;}}if(_0x58e599[_0xf94f('0x3a')]&&_0x58e599['UserId']){_0x58e599['answered']+=0x1;if(_0x58e599[_0xf94f('0x36')]){_0x58e599[_0xf94f('0x36')]-=0x1;}}if(_0x58e599[_0xf94f('0x3a')]&&!_0x58e599['UserId']){_0x58e599[_0xf94f('0x38')]+=0x1;if(_0x58e599['waiting']){_0x58e599['waiting']-=0x1;}}_0x58e599[_0xf94f('0x39')]+=0x1;_0x591792(_0x58e599);});}exports[_0xf94f('0x3b')]=function(_0x3f22f3,_0x5b99f8){var _0x5aa735={},_0x17a30d={},_0x425903={'count':0x0,'rows':[]};var _0x22aaad=_[_0xf94f('0x2c')](db[_0xf94f('0x3c')][_0xf94f('0x3d')],function(_0x537c1f){return{'name':_0x537c1f['fieldName'],'type':_0x537c1f[_0xf94f('0x3e')]['key']};});_0x17a30d[_0xf94f('0x3f')]=_[_0xf94f('0x2c')](_0x22aaad,_0xf94f('0x29'));_0x17a30d[_0xf94f('0x40')]=_['keys'](_0x3f22f3[_0xf94f('0x40')]);_0x17a30d[_0xf94f('0x41')]=_[_0xf94f('0x42')](_0x17a30d[_0xf94f('0x3f')],_0x17a30d[_0xf94f('0x40')]);_0x5aa735[_0xf94f('0x43')]=_[_0xf94f('0x42')](_0x17a30d['model'],qs['fields'](_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x44')]));_0x5aa735[_0xf94f('0x43')]=_0x5aa735[_0xf94f('0x43')][_0xf94f('0x45')]?_0x5aa735[_0xf94f('0x43')]:_0x17a30d['model'];if(!_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x46')]('nolimit')){_0x5aa735[_0xf94f('0x1f')]=qs[_0xf94f('0x1f')](_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x1f')]);_0x5aa735[_0xf94f('0x1e')]=qs[_0xf94f('0x1e')](_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x1e')]);}_0x5aa735[_0xf94f('0x47')]=qs['sort'](_0x3f22f3['query'][_0xf94f('0x48')]);_0x5aa735[_0xf94f('0x49')]=qs[_0xf94f('0x41')](_[_0xf94f('0x4a')](_0x3f22f3['query'],_0x17a30d[_0xf94f('0x41')]),_0x22aaad);var _0xbb3a21=[];var _0x2802ad=squel['select']()[_0xf94f('0x4b')]('id')[_0xf94f('0x4b')]('name')[_0xf94f('0x4b')](_0xf94f('0x4c'))[_0xf94f('0x4d')](_0xf94f('0x4e'));var _0x4e5074=squel[_0xf94f('0x4f')]()['field'](_0xf94f('0x50'))[_0xf94f('0x4b')]('u.fullname')[_0xf94f('0x4b')](_0xf94f('0x51'))['from']('user_has_fax_interactions','ui')['left_join'](_0xf94f('0x52'),'u',_0xf94f('0x53'));var _0x4724d3=squel[_0xf94f('0x4f')]()[_0xf94f('0x4d')](_0xf94f('0x54'),'i')[_0xf94f('0x55')](_0xf94f('0x56'),'c',_0xf94f('0x57'))[_0xf94f('0x55')]('users','o',_0xf94f('0x58'))[_0xf94f('0x55')]('fax_accounts','a',_0xf94f('0x59'))[_0xf94f('0x55')]('fax_messages','me',_0xf94f('0x5a'))[_0xf94f('0x55')](_0xf94f('0x5b'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xf94f('0x55')](_0xf94f('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x177641=squel['expr']();var _0x9aa73c=[];var _0x209f3b=squel['expr']();var _0xd0f131;if(_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x5c')]){_0xd0f131=as[_0xf94f('0x5d')](_0x3f22f3['query'][_0xf94f('0x5c')]);var _0x207da5=_0xd0f131[_0xf94f('0x5e')];for(var _0x570b62=0x0;_0x570b62<_0xd0f131[_0xf94f('0x5f')][_0xf94f('0x45')];_0x570b62++){var _0xff7ddc=_0xd0f131[_0xf94f('0x5f')][_0x570b62];var _0x1f1fc2='i';var _0x1b2bb6=_['find'](_0x22aaad,[_0xf94f('0x29'),_0xff7ddc[_0xf94f('0x4b')]]);if(!_0x1b2bb6){switch(_0xff7ddc[_0xf94f('0x4b')]){case _0xf94f('0x60'):if(_0xff7ddc['value']==0x1){_0x4724d3[_0xf94f('0x61')]('`'+_0xff7ddc[_0xf94f('0x4b')]+_0xf94f('0x62'));}else{_0x4724d3[_0xf94f('0x61')]('`'+_0xff7ddc[_0xf94f('0x4b')]+'`\x20>\x200');}break;case _0xf94f('0x63'):if(_0xff7ddc['operator']===_0xf94f('0x64')){if(_0xff7ddc[_0xf94f('0x65')][_0xf94f('0x30')]('\x20')[_0xf94f('0x45')]>0x1){_0x177641[_0x207da5](_0xf94f('0x66'),qs[_0xf94f('0x67')](_0xff7ddc[_0xf94f('0x65')]),null);}else{var _0x28ba4a='%'+_0xff7ddc[_0xf94f('0x65')]+'%';_0x177641[_0x207da5](_0xf94f('0x68'),_0x28ba4a,_0x28ba4a,_0x28ba4a);}}else{_0x1b2bb6=_[_0xf94f('0x69')](_0x22aaad,[_0xf94f('0x29'),_0xf94f('0x6a')]);_0xff7ddc['field']=_0xf94f('0x6a');_0xc1987b=as[_0xf94f('0x6b')](_0x1f1fc2,_0x1b2bb6['type'],_0xff7ddc);_0x177641[_0x207da5](_0xc1987b[_0xf94f('0x6c')],_0xc1987b[_0xf94f('0x65')]['start'],_0xc1987b[_0xf94f('0x65')][_0xf94f('0x1d')]);}break;case _0xf94f('0x6d'):var _0x566203=_0xff7ddc[_0xf94f('0x65')][_0xf94f('0x30')](',')['map'](function(_0x106cad){return Number(_0x106cad);});_0x566203[_0xf94f('0x31')](function(_0x53e46a){_0x209f3b['or'](_0xf94f('0x6e'),'%,'+_0x53e46a+',%');});_0x9aa73c=_[_0xf94f('0x6f')](_0x9aa73c,_0x566203);break;case _0xf94f('0x70'):if(_0xff7ddc[_0xf94f('0x71')]==='$substring'){_0x177641[_0x207da5](_0xf94f('0x72'),'%'+_0xff7ddc[_0xf94f('0x65')]+'%',null);}else{_0x1b2bb6=_[_0xf94f('0x69')](_0x22aaad,[_0xf94f('0x29'),_0xf94f('0x73')]);_0xff7ddc[_0xf94f('0x4b')]=_0xf94f('0x73');_0xc1987b=as['buildExpression'](_0x1f1fc2,_0x1b2bb6['type'],_0xff7ddc);_0x177641[_0x207da5](_0xc1987b[_0xf94f('0x6c')],_0xc1987b[_0xf94f('0x65')][_0xf94f('0x74')],_0xc1987b['value'][_0xf94f('0x1d')]);}break;case _0xf94f('0x75'):_0xc1987b=as[_0xf94f('0x6b')]('me',null,_0xff7ddc);_0x177641[_0x207da5](_0xc1987b[_0xf94f('0x6c')],_0xc1987b[_0xf94f('0x65')][_0xf94f('0x74')],_0xc1987b[_0xf94f('0x65')][_0xf94f('0x1d')]);break;}}else{var _0xc1987b=as[_0xf94f('0x6b')](_0x1f1fc2,_0x1b2bb6[_0xf94f('0x3e')],_0xff7ddc);_0x177641[_0x207da5](_0xc1987b[_0xf94f('0x6c')],_0xc1987b[_0xf94f('0x65')]['start'],_0xc1987b[_0xf94f('0x65')][_0xf94f('0x1d')]);}}}else{var _0x40ba1b=_(_0x3f22f3[_0xf94f('0x40')])[_0xf94f('0x76')]()[_0xf94f('0x2c')](function(_0x4d9b39){return _['some'](_0x22aaad,[_0xf94f('0x29'),_0x4d9b39])?_0x4d9b39:undefined;})[_0xf94f('0x77')]()[_0xf94f('0x65')]();if(!_[_0xf94f('0x78')](_0x40ba1b)){_0x40ba1b[_0xf94f('0x31')](function(_0x135a8f){if(_0x135a8f===_0xf94f('0x79')){_0x4724d3[_0xf94f('0x49')](_0xf94f('0x7a'),[][_0xf94f('0x7b')](_0x3f22f3[_0xf94f('0x40')][_0x135a8f]));}else if(_0x135a8f===_0xf94f('0x7c')){var _0x5c3d60=JSON[_0xf94f('0x7d')](_0x3f22f3[_0xf94f('0x40')][_0x135a8f])[_0xf94f('0x7e')];var _0x2a40e1=JSON[_0xf94f('0x7d')](_0x3f22f3[_0xf94f('0x40')][_0x135a8f])[_0xf94f('0x7f')];_0x4724d3[_0xf94f('0x49')](_0xf94f('0x80'),_0x5c3d60,_0x2a40e1);}else{if(_0x3f22f3[_0xf94f('0x40')][_0x135a8f]===_0xf94f('0x81')){_0x4724d3[_0xf94f('0x49')]('i.'+_0x135a8f+'\x20IS\x20NULL');}else{_0x4724d3[_0xf94f('0x49')]('i.'+_0x135a8f+'\x20=\x20?',_0x3f22f3[_0xf94f('0x40')][_0x135a8f]);}}});}if(_0x3f22f3['query'][_0xf94f('0x82')]){if(_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x82')]==0x1){_0x4724d3[_0xf94f('0x61')](_0xf94f('0x83'));}else{_0x4724d3[_0xf94f('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x84')]){_0x9aa73c=_[_0xf94f('0x85')](_0x3f22f3[_0xf94f('0x40')]['tag'])?_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x84')]:new Array(_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x84')]);_0x9aa73c[_0xf94f('0x31')](function(_0x1e2076){_0x209f3b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1e2076+',%');});}if(_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x86')]){var _0x57d2c9=_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x86')][_0xf94f('0x87')]('\x5c','\x5c\x5c')[_0xf94f('0x87')](/'/g,'\x27\x27');if(qs[_0xf94f('0x88')](_0x57d2c9)){_0x177641['or'](_0xf94f('0x89'),_0x57d2c9+'%')['or'](_0xf94f('0x8a'),_0x57d2c9+'%');}_0x177641['or'](_0xf94f('0x8b'),_0x57d2c9+'%');}}_0x4724d3[_0xf94f('0x49')](_0x177641);_0x4724d3[_0xf94f('0x8c')](_0xf94f('0x8d'));var _0x1032d5={'type':db[_0xf94f('0x8e')][_0xf94f('0x8f')]['SELECT'],'raw':!![]};var _0x5371b4=_0x4724d3[_0xf94f('0x90')]();_0x5371b4['field']('i.id');_0x5371b4['field'](_0xf94f('0x91'),_0xf94f('0x60'));if(_0x5aa735['order']){_0x5aa735[_0xf94f('0x47')][_0xf94f('0x31')](function(_0x55e17b){var _0x525691=_0x55e17b[0x0]===_0xf94f('0x92')?_0x55e17b[0x0]:'i.'+_0x55e17b[0x0];_0x4724d3[_0xf94f('0x47')](_0x525691,_0x55e17b[0x1]===_0xf94f('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x9aa73c)){_0x4724d3[_0xf94f('0x61')](_0x209f3b);_0x5371b4[_0xf94f('0x49')](_0xf94f('0x94'),_0x9aa73c);}BPromise['resolve']()[_0xf94f('0x33')](function(){if(!_0xd0f131){if(_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x79')])return;_0x5371b4[_0xf94f('0x49')](_0xf94f('0x95'));_0x4724d3[_0xf94f('0x49')](_0xf94f('0x95'));return;}if(_0x3f22f3[_0xf94f('0x96')][_0xf94f('0x97')]!==_0xf94f('0x98'))return;return _0x3f22f3[_0xf94f('0x96')][_0xf94f('0x99')]({'attributes':['id'],'raw':!![]})[_0xf94f('0x33')](function(_0x5339b8){if(_[_0xf94f('0x78')](_0x5339b8)){_0x5371b4[_0xf94f('0x49')](_0xf94f('0x9a'));_0x4724d3['where'](_0xf94f('0x9a'));}else{_0x5371b4[_0xf94f('0x49')](_0xf94f('0x7a'),_['map'](_0x5339b8,'id'));_0x4724d3[_0xf94f('0x49')](_0xf94f('0x7a'),_[_0xf94f('0x2c')](_0x5339b8,'id'));}});})[_0xf94f('0x33')](function(){if(_0x3f22f3[_0xf94f('0x96')]['role']==='agent'&&!_0xd0f131&&!_0x3f22f3['query'][_0xf94f('0x79')])return[];return db[_0xf94f('0x9b')][_0xf94f('0x40')](_0x5371b4[_0xf94f('0x9c')](),_0x1032d5);})['then'](function(_0x488632){_0x425903[_0xf94f('0x20')]=_0x488632[_0xf94f('0x45')];if(_0x425903[_0xf94f('0x20')]===0x0)return[];return db[_0xf94f('0x9b')][_0xf94f('0x40')](_0x2802ad[_0xf94f('0x9c')](),_0x1032d5)[_0xf94f('0x33')](function(_0x34a315){_0xbb3a21=_[_0xf94f('0x9d')](_0x34a315,'id');_0x1032d5=_[_0xf94f('0x9e')](_0x1032d5,{'model':db[_0xf94f('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f22f3[_0xf94f('0x40')][_0xf94f('0x44')]){_0x5aa735[_0xf94f('0x43')]['forEach'](function(_0x1b4c90){_0x4724d3[_0xf94f('0x4b')]('i.'+_0x1b4c90);});}else{_0x4724d3[_0xf94f('0x4b')](_0xf94f('0x91'),'unreadMessages');_0x4724d3[_0xf94f('0x4b')](_0xf94f('0x9f'),'Account.key');_0x4724d3[_0xf94f('0x4b')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xa0'),_0xf94f('0x92'));_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xa1'));_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xa2'),'Contact.firstName');_0x4724d3[_0xf94f('0x4b')]('c.lastName',_0xf94f('0xa3'));_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xa4'),'Contact.email');_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xa5'),_0xf94f('0xa6'));_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xa7'),'Contact.mobile');_0x4724d3[_0xf94f('0x4b')]('c.fax','Contact.fax');_0x4724d3['field'](_0xf94f('0xa8'),_0xf94f('0xa9'));_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xaa'),'Owner.internal');_0x4724d3[_0xf94f('0x4b')](_0xf94f('0xab'),'TagIds');}if(_0x5aa735[_0xf94f('0x1f')])_0x4724d3[_0xf94f('0x1f')](_0x5aa735[_0xf94f('0x1f')]);if(_0x5aa735['offset'])_0x4724d3[_0xf94f('0x1e')](_0x5aa735[_0xf94f('0x1e')]);return db[_0xf94f('0x9b')]['query'](_0x4724d3[_0xf94f('0x9c')](),_0x1032d5);})[_0xf94f('0x33')](function(_0x16dff8){if(_0x16dff8['length']>0x0)_0x4e5074[_0xf94f('0x49')]('ui.FaxInteractionId\x20IN\x20?',_[_0xf94f('0x2c')](_0x16dff8,'id'));return db[_0xf94f('0x9b')]['query'](_0x4e5074[_0xf94f('0x9c')](),_0x1032d5)['then'](function(_0x2ad170){var _0x419d69=_['groupBy'](_0x2ad170,_0xf94f('0xac'));var _0xd78140=[];_0x16dff8[_0xf94f('0x31')](function(_0x207015){_0xd78140[_0xf94f('0x32')](updateFaxInteraction(_0x207015,_0xbb3a21,_0x419d69));});return BPromise['all'](_0xd78140);});});})[_0xf94f('0x33')](function(_0x35ebc8){_0x425903[_0xf94f('0xad')]=_0x35ebc8;return _0x425903;})[_0xf94f('0x33')](respondWithFilteredResult(_0x5b99f8,_0x5aa735))[_0xf94f('0x34')](handleError(_0x5b99f8,null));};exports[_0xf94f('0xae')]=function(_0x267640,_0x40795c){var _0x447b97={'raw':![],'where':{'id':_0x267640[_0xf94f('0xaf')]['id']}},_0x4ba5ae={};_0x4ba5ae[_0xf94f('0x3f')]=_['keys'](db[_0xf94f('0x3c')][_0xf94f('0x3d')]);_0x4ba5ae[_0xf94f('0x40')]=_[_0xf94f('0x76')](_0x267640[_0xf94f('0x40')]);_0x4ba5ae[_0xf94f('0x41')]=_[_0xf94f('0x42')](_0x4ba5ae[_0xf94f('0x3f')],_0x4ba5ae[_0xf94f('0x40')]);_0x447b97[_0xf94f('0x43')]=_[_0xf94f('0x42')](_0x4ba5ae[_0xf94f('0x3f')],qs[_0xf94f('0x44')](_0x267640[_0xf94f('0x40')]['fields']));_0x447b97[_0xf94f('0x43')]=_0x447b97[_0xf94f('0x43')]['length']?_0x447b97['attributes']:_0x4ba5ae[_0xf94f('0x3f')];if(_0x267640[_0xf94f('0x40')][_0xf94f('0xb0')]){_0x447b97[_0xf94f('0xb1')]=[{'all':!![]}];}_0x447b97=_['merge']({},_0x447b97,_0x267640[_0xf94f('0xb2')]);return db[_0xf94f('0x3c')][_0xf94f('0x69')](_0x447b97)[_0xf94f('0x33')](handleEntityNotFound(_0x40795c,null))[_0xf94f('0x33')](respondWithResult(_0x40795c,null))[_0xf94f('0x34')](handleError(_0x40795c,null));};exports[_0xf94f('0xb3')]=function(_0x478933,_0x28e685){return db[_0xf94f('0x3c')][_0xf94f('0xb3')](_0x478933[_0xf94f('0x75')],{})[_0xf94f('0x33')](respondWithResult(_0x28e685,0xc9))[_0xf94f('0x34')](handleError(_0x28e685,null));};exports[_0xf94f('0x27')]=function(_0x261265,_0x4ed679){if(_0x261265[_0xf94f('0x75')]['id']){delete _0x261265[_0xf94f('0x75')]['id'];}return db[_0xf94f('0x3c')][_0xf94f('0x69')]({'where':{'id':_0x261265[_0xf94f('0xaf')]['id']}})[_0xf94f('0x33')](handleEntityNotFound(_0x4ed679,null))['then'](saveUpdates(_0x261265[_0xf94f('0x75')],null))['then'](respondWithResult(_0x4ed679,null))[_0xf94f('0x34')](handleError(_0x4ed679,null));};exports['destroy']=function(_0x2a9520,_0x3341a0){return db['FaxInteraction'][_0xf94f('0x69')]({'where':{'id':_0x2a9520['params']['id']}})[_0xf94f('0x33')](handleEntityNotFound(_0x3341a0,null))[_0xf94f('0x33')](removeEntity(_0x3341a0,null))[_0xf94f('0x34')](handleError(_0x3341a0,null));};exports['describe']=function(_0x11b705,_0x1afe7c){return db[_0xf94f('0x3c')][_0xf94f('0xb4')]()[_0xf94f('0x33')](respondWithResult(_0x1afe7c,null))[_0xf94f('0x34')](handleError(_0x1afe7c,null));};exports[_0xf94f('0xb5')]=function(_0x545c16,_0x38623e,_0x3d4699){return db[_0xf94f('0xb6')][_0xf94f('0x69')]({'where':{'id':_0x545c16[_0xf94f('0xaf')]['id']}})['then'](handleEntityNotFound(_0x38623e,null))[_0xf94f('0x33')](function(_0x4cf0fe){if(_0x4cf0fe){return _0x4cf0fe[_0xf94f('0xb5')](_0x545c16['body'][_0xf94f('0xb7')],_[_0xf94f('0xb8')](_0x545c16[_0xf94f('0x75')],[_0xf94f('0xb7'),'id'])||{});}})['then'](respondWithResult(_0x38623e,null))['catch'](handleError(_0x38623e,null));};exports[_0xf94f('0xb9')]=function(_0x4b2929,_0x280035,_0x103bc6){var _0x5e0828={'raw':![],'where':{}};var _0x33de9d={};var _0x7d8928={'count':0x0,'rows':[]};return db[_0xf94f('0x3c')][_0xf94f('0xba')]({'where':{'id':_0x4b2929[_0xf94f('0xaf')]['id']}})['then'](handleEntityNotFound(_0x280035,null))[_0xf94f('0x33')](function(_0x146a05){if(_0x146a05){_0x33de9d[_0xf94f('0x3f')]=_[_0xf94f('0x76')](db[_0xf94f('0xb6')][_0xf94f('0x3d')]);_0x33de9d['query']=_[_0xf94f('0x76')](_0x4b2929[_0xf94f('0x40')]);_0x33de9d[_0xf94f('0x41')]=_['intersection'](_0x33de9d[_0xf94f('0x3f')],_0x33de9d['query']);_0x5e0828[_0xf94f('0x43')]=_['intersection'](_0x33de9d[_0xf94f('0x3f')],qs['fields'](_0x4b2929['query'][_0xf94f('0x44')]));_0x5e0828['attributes']=_0x5e0828['attributes'][_0xf94f('0x45')]?_0x5e0828[_0xf94f('0x43')]:_0x33de9d[_0xf94f('0x3f')];if(!_0x4b2929[_0xf94f('0x40')]['hasOwnProperty'](_0xf94f('0xbb'))){_0x5e0828[_0xf94f('0x1f')]=qs[_0xf94f('0x1f')](_0x4b2929['query']['limit']);_0x5e0828[_0xf94f('0x1e')]=qs[_0xf94f('0x1e')](_0x4b2929[_0xf94f('0x40')][_0xf94f('0x1e')]);}_0x5e0828['order']=qs['sort'](_0x4b2929[_0xf94f('0x40')][_0xf94f('0x48')]);_0x5e0828['where']=qs[_0xf94f('0x41')](_['pick'](_0x4b2929['query'],_0x33de9d[_0xf94f('0x41')]));_0x5e0828['where'][_0xf94f('0xac')]=_0x146a05['id'];if(_0x4b2929['query'][_0xf94f('0x86')]){_0x5e0828[_0xf94f('0x49')]=_['merge'](_0x5e0828['where'],{'$or':_['map'](_0x5e0828[_0xf94f('0x43')],function(_0x1c5f6e){var _0x2aeca9={};_0x2aeca9[_0x1c5f6e]={'$like':'%'+_0x4b2929['query'][_0xf94f('0x86')]+'%'};return _0x2aeca9;})});}if(_0x4b2929[_0xf94f('0x40')][_0xf94f('0x7e')]){var _0x36ce07=_0x4b2929[_0xf94f('0x40')][_0xf94f('0x7e')][_0xf94f('0x30')](',');var _0x459d38={};_0x459d38[_0x36ce07[0x0]]={'$gte':moment(_0x36ce07[0x1])[_0xf94f('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5e0828[_0xf94f('0x49')]=_[_0xf94f('0x9e')](_0x5e0828[_0xf94f('0x49')],_0x459d38);}_0x5e0828=_[_0xf94f('0x9e')]({},_0x5e0828,_0x4b2929[_0xf94f('0xb2')]);return db[_0xf94f('0xb6')]['count']({'where':_0x5e0828['where']})[_0xf94f('0x33')](function(_0x4a17b3){_0x7d8928[_0xf94f('0x20')]=_0x4a17b3;if(_0x4b2929[_0xf94f('0x40')]['includeAll']){_0x5e0828['include']=[{'all':!![]}];}return db['FaxMessage'][_0xf94f('0xbd')](_0x5e0828);})['then'](function(_0x2ab71c){_0x7d8928['rows']=_0x2ab71c;return _0x7d8928;});}})[_0xf94f('0x33')](respondWithFilteredResult(_0x280035,_0x5e0828))['catch'](handleError(_0x280035,null));};exports[_0xf94f('0xbe')]=function(_0x51a015,_0x5a53aa,_0x355c81){return db[_0xf94f('0x3c')]['find']({'where':{'id':_0x51a015[_0xf94f('0xaf')]['id']}})[_0xf94f('0x33')](handleEntityNotFound(_0x5a53aa,null))[_0xf94f('0x33')](function(_0x16e276){if(_0x16e276){return _0x16e276[_0xf94f('0xbf')](_0x51a015[_0xf94f('0x75')]['ids'],_[_0xf94f('0xb8')](_0x51a015[_0xf94f('0x75')],[_0xf94f('0xb7'),'id'])||{})[_0xf94f('0xc0')](function(){return db[_0xf94f('0x6d')]['findAll']({'attributes':['id','name',_0xf94f('0x4c')],'where':{'id':_0x51a015[_0xf94f('0x75')]['ids']}});})[_0xf94f('0x33')](function(_0x233566){socket[_0xf94f('0xc1')](_0xf94f('0xc2'),{'id':Number(_0x51a015['params']['id']),'tags':_0x233566||[]});return{'id':Number(_0x51a015[_0xf94f('0xaf')]['id']),'tags':_0x233566||[]};});}})[_0xf94f('0x33')](respondWithResult(_0x5a53aa,null))['catch'](handleError(_0x5a53aa,null));};exports[_0xf94f('0xc3')]=function(_0x3f0bbc,_0x5e54b5,_0x343350){return db[_0xf94f('0x3c')][_0xf94f('0x69')]({'where':{'id':_0x3f0bbc['params']['id']}})[_0xf94f('0x33')](handleEntityNotFound(_0x5e54b5,null))[_0xf94f('0x33')](function(_0x5af8ba){if(_0x5af8ba){return _0x5af8ba[_0xf94f('0xc3')](_0x3f0bbc['query'][_0xf94f('0xb7')]);}})['then'](respondWithStatusCode(_0x5e54b5,null))['catch'](handleError(_0x5e54b5,null));};exports[_0xf94f('0xc4')]=function(_0x4e601c,_0x8cc596){var _0x4d978b=moment()[_0xf94f('0xc5')]()['toString']();var _0x36f3c3=path[_0xf94f('0xc6')](config['root'],_0xf94f('0xc7'),_0xf94f('0xc8'),_0xf94f('0xc9'));var _0x20055a=path[_0xf94f('0xc6')](config[_0xf94f('0xca')],_0xf94f('0xc7'),_0xf94f('0xc8'),'attachments');var _0x266847=path[_0xf94f('0xc6')](_0x36f3c3,_0x4d978b);var _0x3f0478=util[_0xf94f('0xbc')](_0xf94f('0xcb'),_0x4e601c[_0xf94f('0xaf')]['id'],_0x4d978b);var _0x2efd9c=path[_0xf94f('0xc6')](_0x36f3c3,_0x3f0478);var _0x4bb585=[];_0x4bb585[_0xf94f('0x32')]({'model':db[_0xf94f('0xcc')],'as':'Attachment','raw':!![]});var _0x49929a=[{'model':db[_0xf94f('0xb6')],'as':_0xf94f('0xcd'),'attributes':['id','body',_0xf94f('0x7c')],'include':_0x4bb585}];return db[_0xf94f('0x3c')][_0xf94f('0x69')]({'where':{'id':_0x4e601c[_0xf94f('0xaf')]['id']},'include':_0x49929a})[_0xf94f('0x33')](handleEntityNotFound(_0x8cc596,null))[_0xf94f('0x33')](function(_0x4a3923){if(_0x4a3923&&_0x4a3923['Messages']){var _0x3f9d6c=_0x4a3923[_0xf94f('0xce')]({'plain':!![]});fs[_0xf94f('0xcf')](_0x266847);for(var _0x326068=0x0;_0x326068<_0x3f9d6c['Messages'][_0xf94f('0x45')];_0x326068++){var _0x34bc3e=_0x3f9d6c[_0xf94f('0xcd')][_0x326068][_0xf94f('0xcc')];if(_0x34bc3e){var _0x3a993f=path[_0xf94f('0xc6')](_0x20055a,_0x34bc3e[_0xf94f('0xd0')]);if(fs[_0xf94f('0xd1')](_0x3a993f)){fs[_0xf94f('0xd2')](_0x3a993f)[_0xf94f('0xd3')](fs[_0xf94f('0xd4')](path[_0xf94f('0xc6')](_0x266847,_0x34bc3e[_0xf94f('0xd0')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x55dd31,_0x254c9f){zipdir(_0x266847,{'saveTo':_0x2efd9c},function(_0x40fc53,_0x3c70b5){if(_0x40fc53)return _0x254c9f(_0x40fc53);return _0x55dd31(_0x3c70b5);});})[_0xf94f('0x33')](function(){return new BPromise(function(_0x405e77,_0x4b967d){rimraf(_0x266847,function(_0x431ef6){if(_0x431ef6)_0x4b967d(_0x431ef6);return _0x405e77();});});})[_0xf94f('0x33')](function(){return _0x8cc596[_0xf94f('0xc4')](_0x2efd9c,_0x3f0478,function(_0x196ad3){if(_0x196ad3){console[_0xf94f('0xd5')](_0xf94f('0xd6'),_0x196ad3);}else{fs[_0xf94f('0xd7')](_0x2efd9c);}});});});}else{return _0x8cc596[_0xf94f('0x1c')](0xc8);}})[_0xf94f('0x34')](handleError(_0x8cc596,null));}; \ No newline at end of file +var _0x6d7f=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','send','map','fullname','TagIds','forEach','Tags','push','then','catch','waiting','talking','answered','unmanaged','total','closed','UserId','FaxInteraction','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','having','`\x20=\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','body','some','compact','isEmpty','FaxAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','groupBy','FaxInteractionId','rows','params','rawAttributes','fields','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch'];(function(_0x4c9b52,_0x56965f){var _0x535c22=function(_0x35c4a2){while(--_0x35c4a2){_0x4c9b52['push'](_0x4c9b52['shift']());}};_0x535c22(++_0x56965f);}(_0x6d7f,0xd9));var _0xf6d7=function(_0x40037a,_0x78792d){_0x40037a=_0x40037a-0x0;var _0x2ddc90=_0x6d7f[_0x40037a];return _0x2ddc90;};'use strict';var emlformat=require(_0xf6d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6d7('0x1'));var jsonpatch=require(_0xf6d7('0x2'));var rp=require(_0xf6d7('0x3'));var moment=require(_0xf6d7('0x4'));var BPromise=require(_0xf6d7('0x5'));var Mustache=require(_0xf6d7('0x6'));var util=require(_0xf6d7('0x7'));var path=require(_0xf6d7('0x8'));var sox=require(_0xf6d7('0x9'));var csv=require(_0xf6d7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6d7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf6d7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6d7('0xa'));var querystring=require('querystring');var Papa=require(_0xf6d7('0xd'));var Redis=require(_0xf6d7('0xe'));var authService=require(_0xf6d7('0xf'));var qs=require(_0xf6d7('0x10'));var as=require(_0xf6d7('0x11'));var hardwareService=require(_0xf6d7('0x12'));var logger=require(_0xf6d7('0x13'))(_0xf6d7('0x14'));var utils=require(_0xf6d7('0x15'));var config=require(_0xf6d7('0x16'));var licenseUtil=require(_0xf6d7('0x17'));var db=require('../../mysqldb')['db'];config[_0xf6d7('0x18')]=_['defaults'](config[_0xf6d7('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6d7('0x19'))(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4c4d65,_0x5eb588){_0x5eb588=_0x5eb588||0xcc;return function(_0x29038a){if(_0x29038a){return _0x4c4d65[_0xf6d7('0x1a')](_0x5eb588);}return _0x4c4d65[_0xf6d7('0x1b')](_0x5eb588)[_0xf6d7('0x1c')]();};}function respondWithResult(_0x14f38b,_0xc18362){_0xc18362=_0xc18362||0xc8;return function(_0x17e181){if(_0x17e181){return _0x14f38b[_0xf6d7('0x1b')](_0xc18362)[_0xf6d7('0x1d')](_0x17e181);}};}function respondWithFilteredResult(_0x168149,_0x259801){return function(_0xc737e5){if(_0xc737e5){var _0x2bed1=typeof _0x259801['offset']===_0xf6d7('0x1e')&&typeof _0x259801[_0xf6d7('0x1f')]==='undefined';var _0x5a621f=_0xc737e5[_0xf6d7('0x20')];var _0x3c8397=_0x2bed1?0x0:_0x259801[_0xf6d7('0x21')];var _0x474899=_0x2bed1?_0xc737e5[_0xf6d7('0x20')]:_0x259801[_0xf6d7('0x21')]+_0x259801[_0xf6d7('0x1f')];var _0x3417bc;if(_0x474899>=_0x5a621f){_0x474899=_0x5a621f;_0x3417bc=0xc8;}else{_0x3417bc=0xce;}_0x168149['status'](_0x3417bc);return _0x168149['set'](_0xf6d7('0x22'),_0x3c8397+'-'+_0x474899+'/'+_0x5a621f)[_0xf6d7('0x1d')](_0xc737e5);}return null;};}function patchUpdates(_0x211048){return function(_0x112181){try{jsonpatch[_0xf6d7('0x23')](_0x112181,_0x211048,!![]);}catch(_0x269d3c){return BPromise['reject'](_0x269d3c);}return _0x112181[_0xf6d7('0x24')]();};}function saveUpdates(_0x50c465,_0x1b78ce){return function(_0x39efdc){if(_0x39efdc){return _0x39efdc[_0xf6d7('0x25')](_0x50c465)['then'](function(_0x3ff34f){return _0x3ff34f;});}return null;};}function removeEntity(_0x210d2a,_0x361f1c){return function(_0x7b90de){if(_0x7b90de){return _0x7b90de[_0xf6d7('0x26')]()['then'](function(){_0x210d2a[_0xf6d7('0x1b')](0xcc)[_0xf6d7('0x1c')]();});}};}function handleEntityNotFound(_0x493a62,_0x5023f8){return function(_0x28693d){if(!_0x28693d){_0x493a62['sendStatus'](0x194);}return _0x28693d;};}function handleError(_0x5aacdf,_0x811b8d){_0x811b8d=_0x811b8d||0x1f4;return function(_0x1599d1){logger[_0xf6d7('0x27')](_0x1599d1[_0xf6d7('0x28')]);if(_0x1599d1[_0xf6d7('0x29')]){delete _0x1599d1['name'];}_0x5aacdf['status'](_0x811b8d)[_0xf6d7('0x2a')](_0x1599d1);};}function getInteractionUsers(_0x1cfad7,_0xd3fe16){return new BPromise(function(_0x1e4a42,_0x27e491){try{if(_0xd3fe16[_0x1cfad7['id']]){_0x1cfad7['Users']=_[_0xf6d7('0x2b')](_0xd3fe16[_0x1cfad7['id']],function(_0x302cd7){return{'id':_0x302cd7['id'],'fullname':_0x302cd7[_0xf6d7('0x2c')]};});}}catch(_0x32f212){_0x27e491(_0x32f212);}_0x1e4a42(_0x1cfad7);});}function getInteractionTags(_0x4b6807,_0x1eb586){return new BPromise(function(_0x1e52a9,_0x226447){try{if(_0x4b6807['TagIds']){_0x4b6807['Tags']=[];_0x4b6807[_0xf6d7('0x2d')]['split'](',')[_0xf6d7('0x2e')](function(_0x1a57df){_0x4b6807[_0xf6d7('0x2f')][_0xf6d7('0x30')](_0x1eb586[_0x1a57df]);});}delete _0x4b6807[_0xf6d7('0x2d')];}catch(_0x10501c){_0x226447(_0x10501c);}_0x1e52a9(_0x4b6807);});}function updateFaxInteraction(_0x407643,_0x2f74ea,_0x5b0cee){return new BPromise(function(_0x4b9100,_0x2fe18a){return getInteractionUsers(_0x407643,_0x5b0cee)[_0xf6d7('0x31')](function(_0x31751e){return getInteractionTags(_0x31751e,_0x2f74ea);})[_0xf6d7('0x31')](function(_0x1cfab3){return getStateInteraction(_0x1cfab3);})[_0xf6d7('0x31')](function(_0x13a136){_0x4b9100(_0x13a136);})[_0xf6d7('0x32')](function(_0x208ad4){_0x2fe18a(_0x208ad4);});});}function getStateInteraction(_0x4bc101){return new BPromise(function(_0x1bf409){_0x4bc101[_0xf6d7('0x33')]=0x0;_0x4bc101[_0xf6d7('0x34')]=0x0;_0x4bc101[_0xf6d7('0x35')]=0x0;_0x4bc101[_0xf6d7('0x36')]=0x0;_0x4bc101[_0xf6d7('0x37')]=0x0;if(!_0x4bc101[_0xf6d7('0x38')]&&!_0x4bc101[_0xf6d7('0x39')]){_0x4bc101[_0xf6d7('0x33')]+=0x1;}if(!_0x4bc101['closed']&&_0x4bc101[_0xf6d7('0x39')]){_0x4bc101[_0xf6d7('0x34')]+=0x1;if(_0x4bc101[_0xf6d7('0x33')]){_0x4bc101[_0xf6d7('0x33')]-=0x1;}}if(_0x4bc101[_0xf6d7('0x38')]&&_0x4bc101['UserId']){_0x4bc101[_0xf6d7('0x35')]+=0x1;if(_0x4bc101[_0xf6d7('0x34')]){_0x4bc101[_0xf6d7('0x34')]-=0x1;}}if(_0x4bc101[_0xf6d7('0x38')]&&!_0x4bc101['UserId']){_0x4bc101[_0xf6d7('0x36')]+=0x1;if(_0x4bc101[_0xf6d7('0x33')]){_0x4bc101['waiting']-=0x1;}}_0x4bc101[_0xf6d7('0x37')]+=0x1;_0x1bf409(_0x4bc101);});}exports['index']=function(_0x530c31,_0xb0c563){var _0x2f00e6={},_0x2f10fa={},_0x338019={'count':0x0,'rows':[]};var _0x6aafd1=_[_0xf6d7('0x2b')](db[_0xf6d7('0x3a')]['rawAttributes'],function(_0x10cfd9){return{'name':_0x10cfd9[_0xf6d7('0x3b')],'type':_0x10cfd9[_0xf6d7('0x3c')][_0xf6d7('0x3d')]};});_0x2f10fa['model']=_[_0xf6d7('0x2b')](_0x6aafd1,_0xf6d7('0x29'));_0x2f10fa[_0xf6d7('0x3e')]=_[_0xf6d7('0x3f')](_0x530c31[_0xf6d7('0x3e')]);_0x2f10fa[_0xf6d7('0x40')]=_[_0xf6d7('0x41')](_0x2f10fa[_0xf6d7('0x42')],_0x2f10fa[_0xf6d7('0x3e')]);_0x2f00e6['attributes']=_['intersection'](_0x2f10fa[_0xf6d7('0x42')],qs['fields'](_0x530c31['query']['fields']));_0x2f00e6[_0xf6d7('0x43')]=_0x2f00e6[_0xf6d7('0x43')][_0xf6d7('0x44')]?_0x2f00e6['attributes']:_0x2f10fa[_0xf6d7('0x42')];if(!_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x45')](_0xf6d7('0x46'))){_0x2f00e6[_0xf6d7('0x1f')]=qs[_0xf6d7('0x1f')](_0x530c31[_0xf6d7('0x3e')]['limit']);_0x2f00e6[_0xf6d7('0x21')]=qs['offset'](_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x21')]);}_0x2f00e6[_0xf6d7('0x47')]=qs['sort'](_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x48')]);_0x2f00e6[_0xf6d7('0x49')]=qs[_0xf6d7('0x40')](_[_0xf6d7('0x4a')](_0x530c31[_0xf6d7('0x3e')],_0x2f10fa['filters']),_0x6aafd1);var _0x3b3e88=[];var _0x28a406=squel[_0xf6d7('0x4b')]()[_0xf6d7('0x4c')]('id')[_0xf6d7('0x4c')](_0xf6d7('0x29'))[_0xf6d7('0x4c')]('color')[_0xf6d7('0x4d')](_0xf6d7('0x4e'));var _0x363dc6=squel[_0xf6d7('0x4b')]()['field'](_0xf6d7('0x4f'))[_0xf6d7('0x4c')](_0xf6d7('0x50'))[_0xf6d7('0x4c')]('ui.FaxInteractionId')['from'](_0xf6d7('0x51'),'ui')[_0xf6d7('0x52')](_0xf6d7('0x53'),'u',_0xf6d7('0x54'));var _0x5de6af=squel[_0xf6d7('0x4b')]()[_0xf6d7('0x4d')](_0xf6d7('0x55'),'i')[_0xf6d7('0x52')](_0xf6d7('0x56'),'c',_0xf6d7('0x57'))['left_join'](_0xf6d7('0x53'),'o',_0xf6d7('0x58'))['left_join']('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0xf6d7('0x52')](_0xf6d7('0x59'),'me',_0xf6d7('0x5a'))['left_join']('fax_interaction_has_tags','it',_0xf6d7('0x5b'))[_0xf6d7('0x52')](_0xf6d7('0x4e'),'t',_0xf6d7('0x5c'));var _0x1a1ec6=squel['expr']();var _0x31966c=[];var _0x113f77=squel[_0xf6d7('0x5d')]();var _0x30d06b;if(_0x530c31['query'][_0xf6d7('0x5e')]){_0x30d06b=as[_0xf6d7('0x5f')](_0x530c31[_0xf6d7('0x3e')]['search']);var _0x450e15=_0x30d06b[_0xf6d7('0x60')];for(var _0x37ff53=0x0;_0x37ff53<_0x30d06b['conditions']['length'];_0x37ff53++){var _0x5b8f46=_0x30d06b['conditions'][_0x37ff53];var _0x12de2d='i';var _0x120ae7=_[_0xf6d7('0x61')](_0x6aafd1,['name',_0x5b8f46[_0xf6d7('0x4c')]]);if(!_0x120ae7){switch(_0x5b8f46['field']){case _0xf6d7('0x62'):if(_0x5b8f46['value']==0x1){_0x5de6af[_0xf6d7('0x63')]('`'+_0x5b8f46[_0xf6d7('0x4c')]+_0xf6d7('0x64'));}else{_0x5de6af[_0xf6d7('0x63')]('`'+_0x5b8f46['field']+'`\x20>\x200');}break;case _0xf6d7('0x65'):if(_0x5b8f46[_0xf6d7('0x66')]===_0xf6d7('0x67')){if(_0x5b8f46[_0xf6d7('0x68')][_0xf6d7('0x69')]('\x20')['length']>0x1){_0x1a1ec6[_0x450e15](_0xf6d7('0x6a'),qs[_0xf6d7('0x6b')](_0x5b8f46['value']),null);}else{var _0x4abbd3='%'+_0x5b8f46[_0xf6d7('0x68')]+'%';_0x1a1ec6[_0x450e15](_0xf6d7('0x6c'),_0x4abbd3,_0x4abbd3,_0x4abbd3);}}else{_0x120ae7=_['find'](_0x6aafd1,[_0xf6d7('0x29'),'ContactId']);_0x5b8f46[_0xf6d7('0x4c')]=_0xf6d7('0x6d');_0x57f6f7=as[_0xf6d7('0x6e')](_0x12de2d,_0x120ae7['type'],_0x5b8f46);_0x1a1ec6[_0x450e15](_0x57f6f7[_0xf6d7('0x6f')],_0x57f6f7[_0xf6d7('0x68')][_0xf6d7('0x70')],_0x57f6f7[_0xf6d7('0x68')][_0xf6d7('0x1c')]);}break;case _0xf6d7('0x71'):var _0x3d9869=_0x5b8f46[_0xf6d7('0x68')][_0xf6d7('0x69')](',')[_0xf6d7('0x2b')](function(_0x183e95){return Number(_0x183e95);});_0x3d9869[_0xf6d7('0x2e')](function(_0x3c9a2b){_0x113f77['or'](_0xf6d7('0x72'),'%,'+_0x3c9a2b+',%');});_0x31966c=_[_0xf6d7('0x73')](_0x31966c,_0x3d9869);break;case'User':if(_0x5b8f46[_0xf6d7('0x66')]===_0xf6d7('0x67')){_0x1a1ec6[_0x450e15]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5b8f46[_0xf6d7('0x68')]+'%',null);}else{_0x120ae7=_[_0xf6d7('0x61')](_0x6aafd1,[_0xf6d7('0x29'),'UserId']);_0x5b8f46['field']=_0xf6d7('0x39');_0x57f6f7=as['buildExpression'](_0x12de2d,_0x120ae7[_0xf6d7('0x3c')],_0x5b8f46);_0x1a1ec6[_0x450e15](_0x57f6f7[_0xf6d7('0x6f')],_0x57f6f7[_0xf6d7('0x68')][_0xf6d7('0x70')],_0x57f6f7[_0xf6d7('0x68')][_0xf6d7('0x1c')]);}break;case _0xf6d7('0x74'):_0x57f6f7=as['buildExpression']('me',null,_0x5b8f46);_0x1a1ec6[_0x450e15](_0x57f6f7[_0xf6d7('0x6f')],_0x57f6f7[_0xf6d7('0x68')]['start'],_0x57f6f7['value']['end']);break;}}else{var _0x57f6f7=as[_0xf6d7('0x6e')](_0x12de2d,_0x120ae7['type'],_0x5b8f46);_0x1a1ec6[_0x450e15](_0x57f6f7[_0xf6d7('0x6f')],_0x57f6f7[_0xf6d7('0x68')]['start'],_0x57f6f7['value']['end']);}}}else{var _0x21ffff=_(_0x530c31[_0xf6d7('0x3e')])['keys']()[_0xf6d7('0x2b')](function(_0x45cb49){return _[_0xf6d7('0x75')](_0x6aafd1,[_0xf6d7('0x29'),_0x45cb49])?_0x45cb49:undefined;})[_0xf6d7('0x76')]()[_0xf6d7('0x68')]();if(!_[_0xf6d7('0x77')](_0x21ffff)){_0x21ffff[_0xf6d7('0x2e')](function(_0x44b96f){if(_0x44b96f===_0xf6d7('0x78')){_0x5de6af[_0xf6d7('0x49')]('i.FaxAccountId\x20IN\x20?',[][_0xf6d7('0x79')](_0x530c31['query'][_0x44b96f]));}else if(_0x44b96f===_0xf6d7('0x7a')){var _0x94a83=JSON[_0xf6d7('0x7b')](_0x530c31[_0xf6d7('0x3e')][_0x44b96f])['$gte'];var _0xe1ff20=JSON[_0xf6d7('0x7b')](_0x530c31[_0xf6d7('0x3e')][_0x44b96f])[_0xf6d7('0x7c')];_0x5de6af[_0xf6d7('0x49')](_0xf6d7('0x7d'),_0x94a83,_0xe1ff20);}else{if(_0x530c31[_0xf6d7('0x3e')][_0x44b96f]===_0xf6d7('0x7e')){_0x5de6af[_0xf6d7('0x49')]('i.'+_0x44b96f+_0xf6d7('0x7f'));}else{_0x5de6af[_0xf6d7('0x49')]('i.'+_0x44b96f+'\x20=\x20?',_0x530c31[_0xf6d7('0x3e')][_0x44b96f]);}}});}if(_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x80')]){if(_0x530c31[_0xf6d7('0x3e')]['read']==0x1){_0x5de6af['having']('`unreadMessages`\x20=\x200');}else{_0x5de6af[_0xf6d7('0x63')](_0xf6d7('0x81'));}}if(_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x82')]){_0x31966c=_[_0xf6d7('0x83')](_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x82')])?_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x82')]:new Array(_0x530c31['query']['tag']);_0x31966c[_0xf6d7('0x2e')](function(_0x29eb98){_0x113f77['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29eb98+',%');});}if(_0x530c31['query']['filter']){var _0x38d79c=_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x84')][_0xf6d7('0x85')]('\x5c','\x5c\x5c')[_0xf6d7('0x85')](/'/g,'\x27\x27');if(qs[_0xf6d7('0x86')](_0x38d79c)){_0x1a1ec6['or'](_0xf6d7('0x87'),_0x38d79c+'%')['or'](_0xf6d7('0x88'),_0x38d79c+'%');}_0x1a1ec6['or'](_0xf6d7('0x89'),_0x38d79c+'%');}}_0x5de6af['where'](_0x1a1ec6);_0x5de6af[_0xf6d7('0x8a')](_0xf6d7('0x8b'));var _0x2ce9b8={'type':db[_0xf6d7('0x8c')][_0xf6d7('0x8d')][_0xf6d7('0x8e')],'raw':!![]};var _0x4953ef=_0x5de6af[_0xf6d7('0x8f')]();_0x4953ef[_0xf6d7('0x4c')](_0xf6d7('0x8b'));_0x4953ef[_0xf6d7('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf6d7('0x62'));if(_0x2f00e6[_0xf6d7('0x47')]){_0x2f00e6[_0xf6d7('0x47')]['forEach'](function(_0x28f604){var _0x36fbee=_0x28f604[0x0]===_0xf6d7('0x90')?_0x28f604[0x0]:'i.'+_0x28f604[0x0];_0x5de6af[_0xf6d7('0x47')](_0x36fbee,_0x28f604[0x1]===_0xf6d7('0x91')?![]:!![]);});}if(!_[_0xf6d7('0x77')](_0x31966c)){_0x5de6af[_0xf6d7('0x63')](_0x113f77);_0x4953ef[_0xf6d7('0x49')](_0xf6d7('0x92'),_0x31966c);}BPromise[_0xf6d7('0x93')]()[_0xf6d7('0x31')](function(){if(!_0x30d06b){if(_0x530c31['query'][_0xf6d7('0x78')])return;_0x4953ef[_0xf6d7('0x49')](_0xf6d7('0x94'));_0x5de6af['where'](_0xf6d7('0x94'));return;}if(_0x530c31[_0xf6d7('0x95')][_0xf6d7('0x96')]!==_0xf6d7('0x97'))return;return _0x530c31[_0xf6d7('0x95')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xf6d7('0x31')](function(_0x314426){if(_['isEmpty'](_0x314426)){_0x4953ef['where'](_0xf6d7('0x98'));_0x5de6af[_0xf6d7('0x49')](_0xf6d7('0x98'));}else{_0x4953ef[_0xf6d7('0x49')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x314426,'id'));_0x5de6af['where'](_0xf6d7('0x99'),_[_0xf6d7('0x2b')](_0x314426,'id'));}});})['then'](function(){if(_0x530c31[_0xf6d7('0x95')]['role']===_0xf6d7('0x97')&&!_0x30d06b&&!_0x530c31[_0xf6d7('0x3e')][_0xf6d7('0x78')])return[];return db[_0xf6d7('0x9a')][_0xf6d7('0x3e')](_0x4953ef[_0xf6d7('0x9b')](),_0x2ce9b8);})[_0xf6d7('0x31')](function(_0x53818c){_0x338019[_0xf6d7('0x20')]=_0x53818c[_0xf6d7('0x44')];if(_0x338019[_0xf6d7('0x20')]===0x0)return[];return db[_0xf6d7('0x9a')]['query'](_0x28a406[_0xf6d7('0x9b')](),_0x2ce9b8)[_0xf6d7('0x31')](function(_0x25dfe4){_0x3b3e88=_[_0xf6d7('0x9c')](_0x25dfe4,'id');_0x2ce9b8=_[_0xf6d7('0x9d')](_0x2ce9b8,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x530c31[_0xf6d7('0x3e')]['fields']){_0x2f00e6[_0xf6d7('0x43')][_0xf6d7('0x2e')](function(_0x3fec6b){_0x5de6af[_0xf6d7('0x4c')]('i.'+_0x3fec6b);});}else{_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0x9e'),'unreadMessages');_0x5de6af['field']('a.key','Account.key');_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0x9f'),_0xf6d7('0xa0'));_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0xa1'),_0xf6d7('0x90'));_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0xa2'));_0x5de6af['field'](_0xf6d7('0xa3'),_0xf6d7('0xa4'));_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0xa5'),_0xf6d7('0xa6'));_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0xa7'),'Contact.email');_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0xa8'),_0xf6d7('0xa9'));_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0xaa'),_0xf6d7('0xab'));_0x5de6af['field'](_0xf6d7('0xac'),_0xf6d7('0xad'));_0x5de6af[_0xf6d7('0x4c')]('o.fullname',_0xf6d7('0xae'));_0x5de6af[_0xf6d7('0x4c')](_0xf6d7('0xaf'),_0xf6d7('0xb0'));_0x5de6af[_0xf6d7('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf6d7('0x2d'));}if(_0x2f00e6[_0xf6d7('0x1f')])_0x5de6af[_0xf6d7('0x1f')](_0x2f00e6[_0xf6d7('0x1f')]);if(_0x2f00e6[_0xf6d7('0x21')])_0x5de6af[_0xf6d7('0x21')](_0x2f00e6[_0xf6d7('0x21')]);return db[_0xf6d7('0x9a')][_0xf6d7('0x3e')](_0x5de6af[_0xf6d7('0x9b')](),_0x2ce9b8);})[_0xf6d7('0x31')](function(_0x1c4611){if(_0x1c4611[_0xf6d7('0x44')]>0x0)_0x363dc6[_0xf6d7('0x49')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x1c4611,'id'));return db[_0xf6d7('0x9a')][_0xf6d7('0x3e')](_0x363dc6['toString'](),_0x2ce9b8)[_0xf6d7('0x31')](function(_0xea5cb7){var _0x3e0def=_[_0xf6d7('0xb1')](_0xea5cb7,_0xf6d7('0xb2'));var _0x74eb52=[];_0x1c4611[_0xf6d7('0x2e')](function(_0x256021){_0x74eb52[_0xf6d7('0x30')](updateFaxInteraction(_0x256021,_0x3b3e88,_0x3e0def));});return BPromise['all'](_0x74eb52);});});})['then'](function(_0x172d63){_0x338019[_0xf6d7('0xb3')]=_0x172d63;return _0x338019;})['then'](respondWithFilteredResult(_0xb0c563,_0x2f00e6))[_0xf6d7('0x32')](handleError(_0xb0c563,null));};exports['show']=function(_0x38048c,_0x297abf){var _0x3e478b={'raw':![],'where':{'id':_0x38048c[_0xf6d7('0xb4')]['id']}},_0x14584d={};_0x14584d['model']=_['keys'](db[_0xf6d7('0x3a')][_0xf6d7('0xb5')]);_0x14584d['query']=_[_0xf6d7('0x3f')](_0x38048c[_0xf6d7('0x3e')]);_0x14584d[_0xf6d7('0x40')]=_[_0xf6d7('0x41')](_0x14584d[_0xf6d7('0x42')],_0x14584d['query']);_0x3e478b[_0xf6d7('0x43')]=_['intersection'](_0x14584d[_0xf6d7('0x42')],qs[_0xf6d7('0xb6')](_0x38048c[_0xf6d7('0x3e')][_0xf6d7('0xb6')]));_0x3e478b[_0xf6d7('0x43')]=_0x3e478b[_0xf6d7('0x43')][_0xf6d7('0x44')]?_0x3e478b[_0xf6d7('0x43')]:_0x14584d['model'];if(_0x38048c[_0xf6d7('0x3e')][_0xf6d7('0xb7')]){_0x3e478b[_0xf6d7('0xb8')]=[{'all':!![]}];}_0x3e478b=_[_0xf6d7('0x9d')]({},_0x3e478b,_0x38048c[_0xf6d7('0xb9')]);return db[_0xf6d7('0x3a')][_0xf6d7('0x61')](_0x3e478b)[_0xf6d7('0x31')](handleEntityNotFound(_0x297abf,null))[_0xf6d7('0x31')](respondWithResult(_0x297abf,null))[_0xf6d7('0x32')](handleError(_0x297abf,null));};exports[_0xf6d7('0xba')]=function(_0xddb675,_0x5ebc4a){return db[_0xf6d7('0x3a')][_0xf6d7('0xba')](_0xddb675[_0xf6d7('0x74')],{})[_0xf6d7('0x31')](respondWithResult(_0x5ebc4a,0xc9))[_0xf6d7('0x32')](handleError(_0x5ebc4a,null));};exports[_0xf6d7('0x25')]=function(_0x47cdfb,_0xacbe68){if(_0x47cdfb[_0xf6d7('0x74')]['id']){delete _0x47cdfb[_0xf6d7('0x74')]['id'];}return db['FaxInteraction'][_0xf6d7('0x61')]({'where':{'id':_0x47cdfb[_0xf6d7('0xb4')]['id']}})['then'](handleEntityNotFound(_0xacbe68,null))[_0xf6d7('0x31')](saveUpdates(_0x47cdfb[_0xf6d7('0x74')],null))[_0xf6d7('0x31')](respondWithResult(_0xacbe68,null))['catch'](handleError(_0xacbe68,null));};exports[_0xf6d7('0x26')]=function(_0x57c776,_0x23b6af){return db['FaxInteraction'][_0xf6d7('0x61')]({'where':{'id':_0x57c776[_0xf6d7('0xb4')]['id']}})['then'](handleEntityNotFound(_0x23b6af,null))[_0xf6d7('0x31')](removeEntity(_0x23b6af,null))[_0xf6d7('0x32')](handleError(_0x23b6af,null));};exports[_0xf6d7('0xbb')]=function(_0x42c610,_0x3dd75d){return db[_0xf6d7('0x3a')][_0xf6d7('0xbb')]()[_0xf6d7('0x31')](respondWithResult(_0x3dd75d,null))[_0xf6d7('0x32')](handleError(_0x3dd75d,null));};exports[_0xf6d7('0xbc')]=function(_0x9150b0,_0xb1e82c,_0x27b925){return db[_0xf6d7('0xbd')][_0xf6d7('0x61')]({'where':{'id':_0x9150b0[_0xf6d7('0xb4')]['id']}})[_0xf6d7('0x31')](handleEntityNotFound(_0xb1e82c,null))[_0xf6d7('0x31')](function(_0x235067){if(_0x235067){return _0x235067['addMessage'](_0x9150b0[_0xf6d7('0x74')][_0xf6d7('0xbe')],_[_0xf6d7('0xbf')](_0x9150b0[_0xf6d7('0x74')],[_0xf6d7('0xbe'),'id'])||{});}})[_0xf6d7('0x31')](respondWithResult(_0xb1e82c,null))[_0xf6d7('0x32')](handleError(_0xb1e82c,null));};exports[_0xf6d7('0xc0')]=function(_0x26359e,_0x4b689b,_0xf66121){var _0x3955bf={'raw':![],'where':{}};var _0x46c1d3={};var _0x5a646a={'count':0x0,'rows':[]};return db[_0xf6d7('0x3a')][_0xf6d7('0xc1')]({'where':{'id':_0x26359e['params']['id']}})[_0xf6d7('0x31')](handleEntityNotFound(_0x4b689b,null))[_0xf6d7('0x31')](function(_0x337b42){if(_0x337b42){_0x46c1d3[_0xf6d7('0x42')]=_['keys'](db[_0xf6d7('0xbd')]['rawAttributes']);_0x46c1d3[_0xf6d7('0x3e')]=_[_0xf6d7('0x3f')](_0x26359e[_0xf6d7('0x3e')]);_0x46c1d3[_0xf6d7('0x40')]=_['intersection'](_0x46c1d3[_0xf6d7('0x42')],_0x46c1d3[_0xf6d7('0x3e')]);_0x3955bf[_0xf6d7('0x43')]=_['intersection'](_0x46c1d3['model'],qs[_0xf6d7('0xb6')](_0x26359e[_0xf6d7('0x3e')][_0xf6d7('0xb6')]));_0x3955bf[_0xf6d7('0x43')]=_0x3955bf[_0xf6d7('0x43')][_0xf6d7('0x44')]?_0x3955bf[_0xf6d7('0x43')]:_0x46c1d3[_0xf6d7('0x42')];if(!_0x26359e[_0xf6d7('0x3e')][_0xf6d7('0x45')](_0xf6d7('0x46'))){_0x3955bf[_0xf6d7('0x1f')]=qs[_0xf6d7('0x1f')](_0x26359e[_0xf6d7('0x3e')][_0xf6d7('0x1f')]);_0x3955bf[_0xf6d7('0x21')]=qs['offset'](_0x26359e[_0xf6d7('0x3e')][_0xf6d7('0x21')]);}_0x3955bf[_0xf6d7('0x47')]=qs[_0xf6d7('0x48')](_0x26359e[_0xf6d7('0x3e')]['sort']);_0x3955bf[_0xf6d7('0x49')]=qs[_0xf6d7('0x40')](_[_0xf6d7('0x4a')](_0x26359e[_0xf6d7('0x3e')],_0x46c1d3[_0xf6d7('0x40')]));_0x3955bf[_0xf6d7('0x49')][_0xf6d7('0xb2')]=_0x337b42['id'];if(_0x26359e[_0xf6d7('0x3e')]['filter']){_0x3955bf[_0xf6d7('0x49')]=_['merge'](_0x3955bf[_0xf6d7('0x49')],{'$or':_[_0xf6d7('0x2b')](_0x3955bf[_0xf6d7('0x43')],function(_0x5162b0){var _0xe61eb3={};_0xe61eb3[_0x5162b0]={'$like':'%'+_0x26359e[_0xf6d7('0x3e')][_0xf6d7('0x84')]+'%'};return _0xe61eb3;})});}if(_0x26359e[_0xf6d7('0x3e')][_0xf6d7('0xc2')]){var _0x29a618=_0x26359e['query']['$gte'][_0xf6d7('0x69')](',');var _0xc106cc={};_0xc106cc[_0x29a618[0x0]]={'$gte':moment(_0x29a618[0x1])['format'](_0xf6d7('0xc3'))};_0x3955bf[_0xf6d7('0x49')]=_[_0xf6d7('0x9d')](_0x3955bf['where'],_0xc106cc);}_0x3955bf=_[_0xf6d7('0x9d')]({},_0x3955bf,_0x26359e[_0xf6d7('0xb9')]);return db[_0xf6d7('0xbd')][_0xf6d7('0x20')]({'where':_0x3955bf[_0xf6d7('0x49')]})[_0xf6d7('0x31')](function(_0xa2a536){_0x5a646a[_0xf6d7('0x20')]=_0xa2a536;if(_0x26359e[_0xf6d7('0x3e')][_0xf6d7('0xb7')]){_0x3955bf[_0xf6d7('0xb8')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3955bf);})[_0xf6d7('0x31')](function(_0x5df216){_0x5a646a['rows']=_0x5df216;return _0x5a646a;});}})['then'](respondWithFilteredResult(_0x4b689b,_0x3955bf))[_0xf6d7('0x32')](handleError(_0x4b689b,null));};exports[_0xf6d7('0xc4')]=function(_0x245a94,_0x341ad4,_0x226811){return db[_0xf6d7('0x3a')][_0xf6d7('0x61')]({'where':{'id':_0x245a94['params']['id']}})[_0xf6d7('0x31')](handleEntityNotFound(_0x341ad4,null))[_0xf6d7('0x31')](function(_0x500b68){if(_0x500b68){return _0x500b68[_0xf6d7('0xc5')](_0x245a94[_0xf6d7('0x74')][_0xf6d7('0xbe')],_[_0xf6d7('0xbf')](_0x245a94['body'],[_0xf6d7('0xbe'),'id'])||{})[_0xf6d7('0xc6')](function(){return db[_0xf6d7('0x71')]['findAll']({'attributes':['id',_0xf6d7('0x29'),'color'],'where':{'id':_0x245a94[_0xf6d7('0x74')][_0xf6d7('0xbe')]}});})[_0xf6d7('0x31')](function(_0x67df74){socket[_0xf6d7('0xc7')](_0xf6d7('0xc8'),{'id':Number(_0x245a94[_0xf6d7('0xb4')]['id']),'tags':_0x67df74||[]});return{'id':Number(_0x245a94['params']['id']),'tags':_0x67df74||[]};});}})[_0xf6d7('0x31')](respondWithResult(_0x341ad4,null))[_0xf6d7('0x32')](handleError(_0x341ad4,null));};exports[_0xf6d7('0xc9')]=function(_0x4a9a49,_0xdf10e1,_0x37d3fa){return db[_0xf6d7('0x3a')]['find']({'where':{'id':_0x4a9a49[_0xf6d7('0xb4')]['id']}})[_0xf6d7('0x31')](handleEntityNotFound(_0xdf10e1,null))[_0xf6d7('0x31')](function(_0x3740a8){if(_0x3740a8){return _0x3740a8[_0xf6d7('0xc9')](_0x4a9a49[_0xf6d7('0x3e')]['ids']);}})[_0xf6d7('0x31')](respondWithStatusCode(_0xdf10e1,null))['catch'](handleError(_0xdf10e1,null));};exports[_0xf6d7('0xca')]=function(_0x137afa,_0xf2d880){var _0x3f270f=moment()[_0xf6d7('0xcb')]()[_0xf6d7('0x9b')]();var _0x29db65=path[_0xf6d7('0xcc')](config[_0xf6d7('0xcd')],_0xf6d7('0xce'),'files',_0xf6d7('0xcf'));var _0xd12b59=path['join'](config[_0xf6d7('0xcd')],_0xf6d7('0xce'),_0xf6d7('0xd0'),'attachments');var _0x15ffac=path['join'](_0x29db65,_0x3f270f);var _0x4ff28f=util['format']('transcript-%d-%s.zip',_0x137afa[_0xf6d7('0xb4')]['id'],_0x3f270f);var _0x493456=path[_0xf6d7('0xcc')](_0x29db65,_0x4ff28f);var _0x32d227=[];_0x32d227[_0xf6d7('0x30')]({'model':db[_0xf6d7('0xd1')],'as':_0xf6d7('0xd1'),'raw':!![]});var _0x28a3da=[{'model':db[_0xf6d7('0xbd')],'as':_0xf6d7('0xd2'),'attributes':['id',_0xf6d7('0x74'),_0xf6d7('0x7a')],'include':_0x32d227}];return db[_0xf6d7('0x3a')][_0xf6d7('0x61')]({'where':{'id':_0x137afa['params']['id']},'include':_0x28a3da})[_0xf6d7('0x31')](handleEntityNotFound(_0xf2d880,null))[_0xf6d7('0x31')](function(_0xbfda94){if(_0xbfda94&&_0xbfda94[_0xf6d7('0xd2')]){var _0x9927c8=_0xbfda94[_0xf6d7('0xd3')]({'plain':!![]});fs[_0xf6d7('0xd4')](_0x15ffac);for(var _0x5b6d2a=0x0;_0x5b6d2a<_0x9927c8[_0xf6d7('0xd2')][_0xf6d7('0x44')];_0x5b6d2a++){var _0x28688c=_0x9927c8['Messages'][_0x5b6d2a][_0xf6d7('0xd1')];if(_0x28688c){var _0x390600=path[_0xf6d7('0xcc')](_0xd12b59,_0x28688c[_0xf6d7('0xd5')]);if(fs[_0xf6d7('0xd6')](_0x390600)){fs[_0xf6d7('0xd7')](_0x390600)['pipe'](fs[_0xf6d7('0xd8')](path[_0xf6d7('0xcc')](_0x15ffac,_0x28688c[_0xf6d7('0xd5')])));}}}return BPromise[_0xf6d7('0x93')]()[_0xf6d7('0x31')](function(){return new BPromise(function(_0x457a95,_0x3d3d4c){zipdir(_0x15ffac,{'saveTo':_0x493456},function(_0x3b74e4,_0x2c0631){if(_0x3b74e4)return _0x3d3d4c(_0x3b74e4);return _0x457a95(_0x2c0631);});})['then'](function(){return new BPromise(function(_0x55b38a,_0x527435){rimraf(_0x15ffac,function(_0x443ba3){if(_0x443ba3)_0x527435(_0x443ba3);return _0x55b38a();});});})[_0xf6d7('0x31')](function(){return _0xf2d880[_0xf6d7('0xca')](_0x493456,_0x4ff28f,function(_0x5c8385){if(_0x5c8385){console[_0xf6d7('0xd9')](_0xf6d7('0xda'),_0x5c8385);}else{fs[_0xf6d7('0xdb')](_0x493456);}});});});}else{return _0xf2d880[_0xf6d7('0x1a')](0xc8);}})[_0xf6d7('0x32')](handleError(_0xf2d880,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index acf790e..d8808ce 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 _0xfb88=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x4c525c,_0x4668a1){var _0x14a634=function(_0x467b4b){while(--_0x467b4b){_0x4c525c['push'](_0x4c525c['shift']());}};_0x14a634(++_0x4668a1);}(_0xfb88,0x1a1));var _0x8fb8=function(_0x48a8fb,_0x33d3cb){_0x48a8fb=_0x48a8fb-0x0;var _0x34117d=_0xfb88[_0x48a8fb];return _0x34117d;};'use strict';var EventEmitter=require(_0x8fb8('0x0'));var FaxInteraction=require(_0x8fb8('0x1'))['db'][_0x8fb8('0x2')];var FaxMessage=require(_0x8fb8('0x1'))['db'][_0x8fb8('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8fb8('0x4')](0x0);var events={'afterCreate':_0x8fb8('0x5'),'afterUpdate':_0x8fb8('0x6'),'afterDestroy':_0x8fb8('0x7')};function emitEvent(_0x372858){return function(_0x4f8f51,_0x311013,_0x36d1b0){_0x4f8f51[_0x8fb8('0x8')]({'attributes':['id'],'raw':!![]})[_0x8fb8('0x9')](function(_0x418b2c){_0x4f8f51[_0x8fb8('0xa')](_0x8fb8('0xb'),_0x418b2c['map'](function(_0x18b53f){return{'id':_0x18b53f['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4f8f51['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8fb8('0x9')](function(_0x128a4d){_0x4f8f51[_0x8fb8('0xa')](_0x8fb8('0xc'),_0x128a4d[_0x8fb8('0xd')]);FaxInteractionEvents['emit'](_0x372858+':'+_0x4f8f51['id'],_0x4f8f51);FaxInteractionEvents[_0x8fb8('0xe')](_0x372858,_0x4f8f51);_0x36d1b0(null);})[_0x8fb8('0xf')](_0x36d1b0(null));};}for(var e in events){if(events[_0x8fb8('0x10')](e)){var event=events[e];FaxInteraction[_0x8fb8('0x11')](e,emitEvent(event));}}module[_0x8fb8('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x887c=['FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hook','events','../../mysqldb','FaxInteraction'];(function(_0x53a2a5,_0x22058e){var _0x3958af=function(_0x4a8bda){while(--_0x4a8bda){_0x53a2a5['push'](_0x53a2a5['shift']());}};_0x3958af(++_0x22058e);}(_0x887c,0x7d));var _0xc887=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0x887c[_0x3ab0ac];return _0x1f743d;};'use strict';var EventEmitter=require(_0xc887('0x0'));var FaxInteraction=require(_0xc887('0x1'))['db'][_0xc887('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xc887('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc887('0x4')](0x0);var events={'afterCreate':_0xc887('0x5'),'afterUpdate':_0xc887('0x6'),'afterDestroy':'remove'};function emitEvent(_0x18fe9b){return function(_0x3c44ba,_0x364127,_0x116306){_0x3c44ba[_0xc887('0x7')]({'attributes':['id'],'raw':!![]})[_0xc887('0x8')](function(_0xc8ef2){_0x3c44ba[_0xc887('0x9')](_0xc887('0xa'),_0xc8ef2['map'](function(_0x1c94aa){return{'id':_0x1c94aa['id']};}));return FaxMessage[_0xc887('0xb')]({'where':{'FaxInteractionId':_0x3c44ba['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc887('0x8')](function(_0x4df298){_0x3c44ba['setDataValue'](_0xc887('0xc'),_0x4df298[_0xc887('0xd')]);FaxInteractionEvents[_0xc887('0xe')](_0x18fe9b+':'+_0x3c44ba['id'],_0x3c44ba);FaxInteractionEvents['emit'](_0x18fe9b,_0x3c44ba);_0x116306(null);})['catch'](_0x116306(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xc887('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 82a9dc0..c12d4bf 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 _0xf277=['define','fax_interactions','changed','closed','closedAt','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf277,0x1e1));var _0x7f27=function(_0x369c43,_0x1152a2){_0x369c43=_0x369c43-0x0;var _0x322a98=_0xf277[_0x369c43];return _0x322a98;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var logger=require('../../config/logger')(_0x7f27('0x2'));var moment=require('moment');var BPromise=require(_0x7f27('0x3'));var rp=require(_0x7f27('0x4'));var fs=require('fs');var path=require(_0x7f27('0x5'));var rimraf=require(_0x7f27('0x6'));var config=require(_0x7f27('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x7f27('0x8')]=function(_0x57b338,_0x40bcdf){return _0x57b338[_0x7f27('0x9')]('FaxInteraction',attributes,{'tableName':_0x7f27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25c4dc,_0x5c0dbb,_0x341908){if(_0x25c4dc[_0x7f27('0xb')](_0x7f27('0xc'))){_0x25c4dc[_0x7f27('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x341908(null,_0x25c4dc);}}});}; \ No newline at end of file +var _0xeca9=['../../config/environment','./faxInteraction.attributes','define','changed','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x37db81,_0x3a2062){var _0x2b6f0b=function(_0x1e3827){while(--_0x1e3827){_0x37db81['push'](_0x37db81['shift']());}};_0x2b6f0b(++_0x3a2062);}(_0xeca9,0x1da));var _0x9eca=function(_0x41dcaa,_0x5cbbf0){_0x41dcaa=_0x41dcaa-0x0;var _0x3adbea=_0xeca9[_0x41dcaa];return _0x3adbea;};'use strict';var _=require('lodash');var util=require(_0x9eca('0x0'));var logger=require('../../config/logger')(_0x9eca('0x1'));var moment=require(_0x9eca('0x2'));var BPromise=require(_0x9eca('0x3'));var rp=require(_0x9eca('0x4'));var fs=require('fs');var path=require(_0x9eca('0x5'));var rimraf=require(_0x9eca('0x6'));var config=require(_0x9eca('0x7'));var attributes=require(_0x9eca('0x8'));module['exports']=function(_0x9fc1c9,_0x525cb8){return _0x9fc1c9[_0x9eca('0x9')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26dddd,_0x2af724,_0x31a6a9){if(_0x26dddd[_0x9eca('0xa')]('closed')){_0x26dddd['closedAt']=moment()[_0x9eca('0xb')](_0x9eca('0xc'));}_0x31a6a9(null,_0x26dddd);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a1434e8..4d36c13 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 _0x57b0=['http','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','update','options','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','body','ids','spread','AddTags','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x57b0,0xa8));var _0x057b=function(_0x1aac82,_0x50d7fd){_0x1aac82=_0x1aac82-0x0;var _0x52ec34=_0x57b0[_0x1aac82];return _0x52ec34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x057b('0x0'));var BPromise=require(_0x057b('0x1'));var rs=require(_0x057b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x057b('0x3'));var logger=require('../../config/logger')(_0x057b('0x4'));var config=require('../../config/environment');var jayson=require(_0x057b('0x5'));var client=jayson[_0x057b('0x6')][_0x057b('0x7')]({'port':0x232a});config[_0x057b('0x8')]=_['defaults'](config[_0x057b('0x8')],{'host':_0x057b('0x9'),'port':0x18eb});var socket=require(_0x057b('0xa'))(new Redis(config[_0x057b('0x8')]));require(_0x057b('0xb'))['register'](socket);function respondWithRpcPromise(_0x1ae682,_0x3741ad,_0x22aa7e){return new BPromise(function(_0x58a73d,_0x5e9a7a){return client[_0x057b('0xc')](_0x1ae682,_0x22aa7e)['then'](function(_0x420dce){logger[_0x057b('0xd')](_0x057b('0xe'),_0x3741ad,_0x057b('0xf'));logger[_0x057b('0x10')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3741ad,_0x057b('0xf'),JSON[_0x057b('0x11')](_0x420dce));if(_0x420dce[_0x057b('0x12')]){if(_0x420dce[_0x057b('0x12')][_0x057b('0x13')]===0x1f4){logger[_0x057b('0x12')](_0x057b('0xe'),_0x3741ad,_0x420dce[_0x057b('0x12')][_0x057b('0x14')]);return _0x5e9a7a(_0x420dce[_0x057b('0x12')][_0x057b('0x14')]);}logger['error'](_0x057b('0xe'),_0x3741ad,_0x420dce['error']['message']);return _0x58a73d(_0x420dce[_0x057b('0x12')][_0x057b('0x14')]);}else{logger['info'](_0x057b('0xe'),_0x3741ad,_0x057b('0xf'));_0x58a73d(_0x420dce[_0x057b('0x15')]['message']);}})[_0x057b('0x16')](function(_0x4054bf){logger[_0x057b('0x12')](_0x057b('0xe'),_0x3741ad,_0x4054bf);_0x5e9a7a(_0x4054bf);});});}exports['UpdateFaxInteraction']=function(_0x280e24){var _0x1c5073=this;return new Promise(function(_0x3a9406,_0x1e6845){return db['FaxInteraction'][_0x057b('0x17')](_0x280e24['body'],{'raw':_0x280e24[_0x057b('0x18')]?_0x280e24[_0x057b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x280e24[_0x057b('0x18')]?_0x280e24[_0x057b('0x18')]['where']||null:null,'attributes':_0x280e24[_0x057b('0x18')]?_0x280e24[_0x057b('0x18')][_0x057b('0x19')]||null:null,'limit':_0x280e24[_0x057b('0x18')]?_0x280e24[_0x057b('0x18')][_0x057b('0x1a')]||null:null})['then'](function(_0x56e8f8){logger['info'](_0x057b('0x1b'),_0x280e24);logger[_0x057b('0x10')](_0x057b('0x1b'),_0x280e24,JSON[_0x057b('0x11')](_0x56e8f8));_0x3a9406(_0x56e8f8);})[_0x057b('0x16')](function(_0x1400d9){logger[_0x057b('0x12')]('UpdateFaxInteraction',_0x1400d9[_0x057b('0x14')],_0x280e24);_0x1e6845(_0x1c5073[_0x057b('0x12')](0x1f4,_0x1400d9[_0x057b('0x14')]));});});};exports[_0x057b('0x1c')]=function(_0x12e940){return new Promise(function(_0x21e5b6,_0x55a76c){return db[_0x057b('0x1d')][_0x057b('0x1e')]({'where':_0x12e940[_0x057b('0x18')]?_0x12e940[_0x057b('0x18')]['where']||null:null})['then'](function(_0x339970){if(_0x339970){return _0x339970['addTags'](_0x12e940[_0x057b('0x1f')][_0x057b('0x20')],_['omit'](_0x12e940[_0x057b('0x1f')],[_0x057b('0x20'),'id'])||{});}})[_0x057b('0x21')](function(_0x5b24bc){logger[_0x057b('0xd')](_0x057b('0x22'),_0x12e940);logger[_0x057b('0x10')](_0x057b('0x22'),_0x12e940,JSON[_0x057b('0x11')](_0x5b24bc));_0x21e5b6(_0x5b24bc);})[_0x057b('0x16')](function(_0x3aac80){logger[_0x057b('0x12')](_0x057b('0x22'),_0x3aac80[_0x057b('0x14')],_0x12e940);_0x55a76c(_this[_0x057b('0x12')](0x1f4,_0x3aac80[_0x057b('0x14')]));});});}; \ No newline at end of file +var _0x2f12=['body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0x2f12,0x174));var _0x22f1=function(_0x2fdb57,_0x353a2a){_0x2fdb57=_0x2fdb57-0x0;var _0x82abd8=_0x2f12[_0x2fdb57];return _0x82abd8;};'use strict';var _=require(_0x22f1('0x0'));var util=require(_0x22f1('0x1'));var moment=require(_0x22f1('0x2'));var BPromise=require(_0x22f1('0x3'));var rs=require(_0x22f1('0x4'));var fs=require('fs');var Redis=require(_0x22f1('0x5'));var db=require(_0x22f1('0x6'))['db'];var utils=require(_0x22f1('0x7'));var logger=require(_0x22f1('0x8'))('rpc');var config=require(_0x22f1('0x9'));var jayson=require(_0x22f1('0xa'));var client=jayson[_0x22f1('0xb')][_0x22f1('0xc')]({'port':0x232a});config[_0x22f1('0xd')]=_[_0x22f1('0xe')](config[_0x22f1('0xd')],{'host':_0x22f1('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22f1('0xd')]));require(_0x22f1('0x10'))['register'](socket);function respondWithRpcPromise(_0x270290,_0x19bf3f,_0x2f8a47){return new BPromise(function(_0x506271,_0x47d07a){return client[_0x22f1('0x11')](_0x270290,_0x2f8a47)[_0x22f1('0x12')](function(_0x31ea98){logger[_0x22f1('0x13')](_0x22f1('0x14'),_0x19bf3f,_0x22f1('0x15'));logger[_0x22f1('0x16')](_0x22f1('0x17'),_0x19bf3f,_0x22f1('0x15'),JSON[_0x22f1('0x18')](_0x31ea98));if(_0x31ea98[_0x22f1('0x19')]){if(_0x31ea98['error'][_0x22f1('0x1a')]===0x1f4){logger[_0x22f1('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x19bf3f,_0x31ea98['error']['message']);return _0x47d07a(_0x31ea98['error'][_0x22f1('0x1b')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x19bf3f,_0x31ea98['error'][_0x22f1('0x1b')]);return _0x506271(_0x31ea98['error']['message']);}else{logger['info'](_0x22f1('0x14'),_0x19bf3f,_0x22f1('0x15'));_0x506271(_0x31ea98[_0x22f1('0x1c')][_0x22f1('0x1b')]);}})[_0x22f1('0x1d')](function(_0x23b630){logger['error'](_0x22f1('0x14'),_0x19bf3f,_0x23b630);_0x47d07a(_0x23b630);});});}exports[_0x22f1('0x1e')]=function(_0x57102b){var _0x35a6d3=this;return new Promise(function(_0x4e723d,_0x5ed094){return db[_0x22f1('0x1f')][_0x22f1('0x20')](_0x57102b[_0x22f1('0x21')],{'raw':_0x57102b['options']?_0x57102b[_0x22f1('0x22')][_0x22f1('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57102b[_0x22f1('0x22')]?_0x57102b[_0x22f1('0x22')][_0x22f1('0x24')]||null:null,'attributes':_0x57102b[_0x22f1('0x22')]?_0x57102b[_0x22f1('0x22')][_0x22f1('0x25')]||null:null,'limit':_0x57102b['options']?_0x57102b[_0x22f1('0x22')][_0x22f1('0x26')]||null:null})[_0x22f1('0x12')](function(_0x953c18){logger[_0x22f1('0x13')](_0x22f1('0x1e'),_0x57102b);logger[_0x22f1('0x16')](_0x22f1('0x1e'),_0x57102b,JSON['stringify'](_0x953c18));_0x4e723d(_0x953c18);})[_0x22f1('0x1d')](function(_0x419f9a){logger[_0x22f1('0x19')](_0x22f1('0x1e'),_0x419f9a['message'],_0x57102b);_0x5ed094(_0x35a6d3[_0x22f1('0x19')](0x1f4,_0x419f9a[_0x22f1('0x1b')]));});});};exports[_0x22f1('0x27')]=function(_0x55313b){return new Promise(function(_0x4096f8,_0x5f2cad){return db[_0x22f1('0x1f')][_0x22f1('0x28')]({'where':_0x55313b[_0x22f1('0x22')]?_0x55313b[_0x22f1('0x22')][_0x22f1('0x24')]||null:null})[_0x22f1('0x12')](function(_0x57b4e4){if(_0x57b4e4){return _0x57b4e4['addTags'](_0x55313b[_0x22f1('0x21')][_0x22f1('0x29')],_[_0x22f1('0x2a')](_0x55313b[_0x22f1('0x21')],[_0x22f1('0x29'),'id'])||{});}})[_0x22f1('0x2b')](function(_0x46f501){logger[_0x22f1('0x13')](_0x22f1('0x2c'),_0x55313b);logger[_0x22f1('0x16')](_0x22f1('0x2c'),_0x55313b,JSON[_0x22f1('0x18')](_0x46f501));_0x4096f8(_0x46f501);})[_0x22f1('0x1d')](function(_0x239d51){logger[_0x22f1('0x19')]('AddTags',_0x239d51[_0x22f1('0x1b')],_0x55313b);_0x5f2cad(_this[_0x22f1('0x19')](0x1f4,_0x239d51['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a454fbe..1de85a7 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 _0xb574=['faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x57d2ff,_0x52a035){var _0x237b23=function(_0x1caa69){while(--_0x1caa69){_0x57d2ff['push'](_0x57d2ff['shift']());}};_0x237b23(++_0x52a035);}(_0xb574,0xf9));var _0x4b57=function(_0x403de6,_0x29269b){_0x403de6=_0x403de6-0x0;var _0x2f99f1=_0xb574[_0x403de6];return _0x2f99f1;};'use strict';var FaxInteractionEvents=require(_0x4b57('0x0'));var events=[_0x4b57('0x1'),_0x4b57('0x2'),_0x4b57('0x3')];function createListener(_0x5ab7cf,_0xa0193f){return function(_0x346c60){_0xa0193f[_0x4b57('0x4')](_0x5ab7cf,_0x346c60);};}function removeListener(_0x549638,_0x223e22){return function(){FaxInteractionEvents[_0x4b57('0x5')](_0x549638,_0x223e22);};}exports[_0x4b57('0x6')]=function(_0x294265){for(var _0x5ddec4=0x0,_0x37f540=events['length'];_0x5ddec4<_0x37f540;_0x5ddec4++){var _0x4da822=events[_0x5ddec4];var _0x3a1f18=createListener(_0x4b57('0x7')+_0x4da822,_0x294265);FaxInteractionEvents['on'](_0x4da822,_0x3a1f18);}}; \ No newline at end of file +var _0xf721=['length','save','remove','update','register'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf721,0x10a));var _0x1f72=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xf721[_0x4c0622];return _0x1799d8;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x1f72('0x0'),_0x1f72('0x1'),_0x1f72('0x2')];function createListener(_0x5a98ce,_0x1c446a){return function(_0xb5ce93){_0x1c446a['emit'](_0x5a98ce,_0xb5ce93);};}function removeListener(_0x20381d,_0xaa1639){return function(){FaxInteractionEvents['removeListener'](_0x20381d,_0xaa1639);};}exports[_0x1f72('0x3')]=function(_0x1180bc){for(var _0x35dd21=0x0,_0x36f895=events[_0x1f72('0x4')];_0x35dd21<_0x36f895;_0x35dd21++){var _0x458223=events[_0x35dd21];var _0x50296f=createListener('faxInteraction:'+_0x458223,_0x1180bc);FaxInteractionEvents['on'](_0x458223,_0x50296f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3fdc642..3fac934 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 _0xb922=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout'];(function(_0x36900b,_0x41bed4){var _0x17c02e=function(_0x459b53){while(--_0x459b53){_0x36900b['push'](_0x36900b['shift']());}};_0x17c02e(++_0x41bed4);}(_0xb922,0x7c));var _0x2b92=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xb922[_0x38eb23];return _0x48506a;};'use strict';var multer=require(_0x2b92('0x0'));var util=require(_0x2b92('0x1'));var path=require(_0x2b92('0x2'));var timeout=require(_0x2b92('0x3'));var express=require(_0x2b92('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2b92('0x5'));var interaction=require(_0x2b92('0x6'));var config=require(_0x2b92('0x7'));var controller=require(_0x2b92('0x8'));router[_0x2b92('0x9')]('/',auth[_0x2b92('0xa')](),controller[_0x2b92('0xb')]);router[_0x2b92('0x9')](_0x2b92('0xc'),auth[_0x2b92('0xa')](),controller[_0x2b92('0xd')]);router['get'](_0x2b92('0xe'),auth[_0x2b92('0xa')](),controller[_0x2b92('0xf')]);router[_0x2b92('0x9')](_0x2b92('0x10'),auth['isAuthenticated'](),controller[_0x2b92('0x11')]);router['get'](_0x2b92('0x12'),auth[_0x2b92('0xa')](),controller['download']);router[_0x2b92('0x13')]('/',auth[_0x2b92('0xa')](),controller['create']);router['post'](_0x2b92('0x10'),auth[_0x2b92('0xa')](),controller[_0x2b92('0x14')]);router[_0x2b92('0x13')](_0x2b92('0x15'),auth[_0x2b92('0xa')](),interaction[_0x2b92('0x16')](_0x2b92('0x17'),_0x2b92('0x18')),controller[_0x2b92('0x19')]);router[_0x2b92('0x1a')](_0x2b92('0xe'),auth[_0x2b92('0xa')](),interaction[_0x2b92('0x16')](_0x2b92('0x17'),_0x2b92('0x1b')),controller['update']);router[_0x2b92('0x1c')]('/:id',auth[_0x2b92('0xa')](),interaction[_0x2b92('0x16')](_0x2b92('0x17'),_0x2b92('0x1d')),controller[_0x2b92('0x1e')]);router[_0x2b92('0x1c')](_0x2b92('0x15'),auth[_0x2b92('0xa')](),controller['removeTags']);module[_0x2b92('0x1f')]=router; \ No newline at end of file +var _0xc3b1=['/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','addMessage','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update','delete','fax','destroy','removeTags','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','describe'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xc3b1,0x1c6));var _0x1c3b=function(_0x31370d,_0x545efd){_0x31370d=_0x31370d-0x0;var _0x3a9f59=_0xc3b1[_0x31370d];return _0x3a9f59;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1c3b('0x0'));var timeout=require('connect-timeout');var express=require(_0x1c3b('0x1'));var router=express[_0x1c3b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1c3b('0x3'));var interaction=require(_0x1c3b('0x4'));var config=require(_0x1c3b('0x5'));var controller=require(_0x1c3b('0x6'));router[_0x1c3b('0x7')]('/',auth['isAuthenticated'](),controller[_0x1c3b('0x8')]);router[_0x1c3b('0x7')](_0x1c3b('0x9'),auth['isAuthenticated'](),controller[_0x1c3b('0xa')]);router[_0x1c3b('0x7')](_0x1c3b('0xb'),auth['isAuthenticated'](),controller[_0x1c3b('0xc')]);router['get'](_0x1c3b('0xd'),auth[_0x1c3b('0xe')](),controller[_0x1c3b('0xf')]);router[_0x1c3b('0x7')](_0x1c3b('0x10'),auth[_0x1c3b('0xe')](),controller[_0x1c3b('0x11')]);router[_0x1c3b('0x12')]('/',auth[_0x1c3b('0xe')](),controller['create']);router[_0x1c3b('0x12')](_0x1c3b('0xd'),auth[_0x1c3b('0xe')](),controller[_0x1c3b('0x13')]);router[_0x1c3b('0x12')]('/:id/tags',auth[_0x1c3b('0xe')](),interaction['tracked']('fax',_0x1c3b('0x14')),controller[_0x1c3b('0x15')]);router[_0x1c3b('0x16')](_0x1c3b('0xb'),auth[_0x1c3b('0xe')](),interaction[_0x1c3b('0x17')]('fax',_0x1c3b('0x18')),controller[_0x1c3b('0x19')]);router[_0x1c3b('0x1a')](_0x1c3b('0xb'),auth[_0x1c3b('0xe')](),interaction[_0x1c3b('0x17')](_0x1c3b('0x1b'),'faxinteraction:destroy'),controller[_0x1c3b('0x1c')]);router[_0x1c3b('0x1a')]('/:id/tags',auth[_0x1c3b('0xe')](),controller[_0x1c3b('0x1d')]);module[_0x1c3b('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 81511bc..d702fba 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 _0x5b02=['exports','TEXT','medium','out','DATE','sequelize'];(function(_0x1fae51,_0x56f193){var _0x5aae9b=function(_0x58d5a7){while(--_0x58d5a7){_0x1fae51['push'](_0x1fae51['shift']());}};_0x5aae9b(++_0x56f193);}(_0x5b02,0xe9));var _0x25b0=function(_0x1be325,_0x7dab78){_0x1be325=_0x1be325-0x0;var _0x2e6e6a=_0x5b02[_0x1be325];return _0x2e6e6a;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'body':{'type':Sequelize[_0x25b0('0x2')](_0x25b0('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x25b0('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x25b0('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x25b0('0x5')]}}; \ No newline at end of file +var _0xfa2b=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x4c742f,_0x2bd40a){var _0x2913ae=function(_0x4e2759){while(--_0x4e2759){_0x4c742f['push'](_0x4c742f['shift']());}};_0x2913ae(++_0x2bd40a);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x400efb,_0x5e8c1c){_0x400efb=_0x400efb-0x0;var _0x54e9d3=_0xfa2b[_0x400efb];return _0x54e9d3;};'use strict';var Sequelize=require(_0xbfa2('0x0'));module[_0xbfa2('0x1')]={'body':{'type':Sequelize[_0xbfa2('0x2')](_0xbfa2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbfa2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfa2('0x5')]('in',_0xbfa2('0x6')),'defaultValue':_0xbfa2('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xbfa2('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xbfa2('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 067d327..d564b3d 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 _0x200c=['channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','format','/var/opt/motion2/server/files/attachments/%s','basename','root','server','files','attachments','download','join','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','FaxMessage','includeAll','include','findAll','rows','show','params','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','user','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s'];(function(_0x34ec2b,_0xa03bf5){var _0x17ca83=function(_0x52df49){while(--_0x52df49){_0x34ec2b['push'](_0x34ec2b['shift']());}};_0x17ca83(++_0xa03bf5);}(_0x200c,0x138));var _0xc200=function(_0x3dcf14,_0x56f0ba){_0x3dcf14=_0x3dcf14-0x0;var _0x3769f6=_0x200c[_0x3dcf14];return _0x3769f6;};'use strict';var emlformat=require(_0xc200('0x0'));var rimraf=require(_0xc200('0x1'));var zipdir=require(_0xc200('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc200('0x3'));var moment=require(_0xc200('0x4'));var BPromise=require(_0xc200('0x5'));var Mustache=require(_0xc200('0x6'));var util=require(_0xc200('0x7'));var path=require('path');var sox=require(_0xc200('0x8'));var csv=require(_0xc200('0x9'));var ejs=require(_0xc200('0xa'));var fs=require('fs');var fs_extra=require(_0xc200('0xb'));var _=require(_0xc200('0xc'));var squel=require('squel');var crypto=require(_0xc200('0xd'));var jsforce=require(_0xc200('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc200('0xf'));var Redis=require('ioredis');var authService=require(_0xc200('0x10'));var qs=require(_0xc200('0x11'));var as=require(_0xc200('0x12'));var hardwareService=require(_0xc200('0x13'));var logger=require('../../config/logger')(_0xc200('0x14'));var utils=require(_0xc200('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc200('0x16'));var db=require(_0xc200('0x17'))['db'];config[_0xc200('0x18')]=_['defaults'](config[_0xc200('0x18')],{'host':_0xc200('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc200('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc200('0x1b')][_0xc200('0x1c')]({'port':0x232c});var client9002=jayson[_0xc200('0x1b')][_0xc200('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4a4ab7,_0x575e4b,_0x16c7a8,_0x2b905c){return new BPromise(function(_0x5c5eeb,_0x4f320e){var _0x19d523=_0x2b905c||client;return _0x19d523[_0xc200('0x1d')](_0x4a4ab7,_0x16c7a8)[_0xc200('0x1e')](function(_0x13cb02){logger[_0xc200('0x1f')](_0xc200('0x20'),_0x575e4b,_0xc200('0x21'));logger['debug'](_0xc200('0x22'),_0x575e4b,_0xc200('0x21'),JSON[_0xc200('0x23')](_0x13cb02));if(_0x13cb02[_0xc200('0x24')]){if(_0x13cb02['error'][_0xc200('0x25')]===0x1f4){logger[_0xc200('0x24')](_0xc200('0x20'),_0x575e4b,_0x13cb02[_0xc200('0x24')][_0xc200('0x26')]);return _0x4f320e(_0x13cb02[_0xc200('0x24')][_0xc200('0x26')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x575e4b,_0x13cb02[_0xc200('0x24')]['message']);return _0x5c5eeb(_0x13cb02[_0xc200('0x24')][_0xc200('0x26')]);}else{logger[_0xc200('0x1f')](_0xc200('0x20'),_0x575e4b,_0xc200('0x21'));_0x5c5eeb(_0x13cb02[_0xc200('0x27')][_0xc200('0x26')]);}})[_0xc200('0x28')](function(_0x5751c9){logger[_0xc200('0x24')](_0xc200('0x20'),_0x575e4b,_0x5751c9);_0x4f320e(_0x5751c9);});});}function respondWithStatusCode(_0x54d0a9,_0x363771){_0x363771=_0x363771||0xcc;return function(_0x30701b){if(_0x30701b){return _0x54d0a9[_0xc200('0x29')](_0x363771);}return _0x54d0a9[_0xc200('0x2a')](_0x363771)['end']();};}function respondWithResult(_0x4441fd,_0x194227){_0x194227=_0x194227||0xc8;return function(_0x57ea80){if(_0x57ea80){return _0x4441fd[_0xc200('0x2a')](_0x194227)[_0xc200('0x2b')](_0x57ea80);}};}function respondWithFilteredResult(_0x93b059,_0x42c727){return function(_0x57f431){if(_0x57f431){var _0x29a617=typeof _0x42c727[_0xc200('0x2c')]===_0xc200('0x2d')&&typeof _0x42c727[_0xc200('0x2e')]===_0xc200('0x2d');var _0x49c45e=_0x57f431[_0xc200('0x2f')];var _0x42c03b=_0x29a617?0x0:_0x42c727[_0xc200('0x2c')];var _0x9844d7=_0x29a617?_0x57f431[_0xc200('0x2f')]:_0x42c727[_0xc200('0x2c')]+_0x42c727[_0xc200('0x2e')];var _0x67829b;if(_0x9844d7>=_0x49c45e){_0x9844d7=_0x49c45e;_0x67829b=0xc8;}else{_0x67829b=0xce;}_0x93b059['status'](_0x67829b);return _0x93b059[_0xc200('0x30')](_0xc200('0x31'),_0x42c03b+'-'+_0x9844d7+'/'+_0x49c45e)[_0xc200('0x2b')](_0x57f431);}return null;};}function patchUpdates(_0x4d40de){return function(_0x21ba70){try{jsonpatch[_0xc200('0x32')](_0x21ba70,_0x4d40de,!![]);}catch(_0x32a429){return BPromise[_0xc200('0x33')](_0x32a429);}return _0x21ba70[_0xc200('0x34')]();};}function saveUpdates(_0x444a34,_0x151c14){return function(_0xb74455){if(_0xb74455){return _0xb74455[_0xc200('0x35')](_0x444a34)[_0xc200('0x1e')](function(_0x3e981e){return _0x3e981e;});}return null;};}function removeEntity(_0x5b44fb,_0x441ac5){return function(_0x57d305){if(_0x57d305){return _0x57d305[_0xc200('0x36')]()[_0xc200('0x1e')](function(){_0x5b44fb[_0xc200('0x2a')](0xcc)[_0xc200('0x37')]();});}};}function handleEntityNotFound(_0x41da42,_0x19967b){return function(_0x5cab5c){if(!_0x5cab5c){_0x41da42[_0xc200('0x29')](0x194);}return _0x5cab5c;};}function handleError(_0x33e2dc,_0x255688){_0x255688=_0x255688||0x1f4;return function(_0x7dca4a){logger[_0xc200('0x24')](_0x7dca4a[_0xc200('0x38')]);if(_0x7dca4a[_0xc200('0x39')]){delete _0x7dca4a[_0xc200('0x39')];}_0x33e2dc[_0xc200('0x2a')](_0x255688)[_0xc200('0x3a')](_0x7dca4a);};}exports[_0xc200('0x3b')]=function(_0x1e7e9c,_0x3a4c5d){var _0x5efb42={},_0x36b1d9={},_0x33e81b={'count':0x0,'rows':[]};var _0x38537d=_[_0xc200('0x3c')](db['FaxMessage'][_0xc200('0x3d')],function(_0x5b9339){return{'name':_0x5b9339[_0xc200('0x3e')],'type':_0x5b9339['type'][_0xc200('0x3f')]};});_0x36b1d9[_0xc200('0x40')]=_[_0xc200('0x3c')](_0x38537d,_0xc200('0x39'));_0x36b1d9[_0xc200('0x41')]=_[_0xc200('0x42')](_0x1e7e9c[_0xc200('0x41')]);_0x36b1d9[_0xc200('0x43')]=_[_0xc200('0x44')](_0x36b1d9[_0xc200('0x40')],_0x36b1d9[_0xc200('0x41')]);_0x5efb42[_0xc200('0x45')]=_[_0xc200('0x44')](_0x36b1d9[_0xc200('0x40')],qs[_0xc200('0x46')](_0x1e7e9c['query'][_0xc200('0x46')]));_0x5efb42['attributes']=_0x5efb42[_0xc200('0x45')]['length']?_0x5efb42[_0xc200('0x45')]:_0x36b1d9[_0xc200('0x40')];if(!_0x1e7e9c[_0xc200('0x41')][_0xc200('0x47')](_0xc200('0x48'))){_0x5efb42[_0xc200('0x2e')]=qs[_0xc200('0x2e')](_0x1e7e9c[_0xc200('0x41')][_0xc200('0x2e')]);_0x5efb42[_0xc200('0x2c')]=qs['offset'](_0x1e7e9c[_0xc200('0x41')][_0xc200('0x2c')]);}_0x5efb42['order']=qs[_0xc200('0x49')](_0x1e7e9c['query']['sort']);_0x5efb42[_0xc200('0x4a')]=qs['filters'](_[_0xc200('0x4b')](_0x1e7e9c['query'],_0x36b1d9[_0xc200('0x43')]),_0x38537d);if(_0x1e7e9c['query'][_0xc200('0x4c')]){_0x5efb42[_0xc200('0x4a')]=_[_0xc200('0x4d')](_0x5efb42[_0xc200('0x4a')],{'$or':_['map'](_0x38537d,function(_0x5d955f){if(_0x5d955f[_0xc200('0x4e')]!=='VIRTUAL'){var _0x42d345={};_0x42d345[_0x5d955f[_0xc200('0x39')]]={'$like':'%'+_0x1e7e9c[_0xc200('0x41')][_0xc200('0x4c')]+'%'};return _0x42d345;}})});}_0x5efb42=_[_0xc200('0x4d')]({},_0x5efb42,_0x1e7e9c[_0xc200('0x4f')]);var _0xdfce7d={'where':_0x5efb42['where']};return db[_0xc200('0x50')][_0xc200('0x2f')](_0xdfce7d)[_0xc200('0x1e')](function(_0x160492){_0x33e81b['count']=_0x160492;if(_0x1e7e9c[_0xc200('0x41')][_0xc200('0x51')]){_0x5efb42[_0xc200('0x52')]=[{'all':!![]}];}return db[_0xc200('0x50')][_0xc200('0x53')](_0x5efb42);})[_0xc200('0x1e')](function(_0x457c4f){_0x33e81b[_0xc200('0x54')]=_0x457c4f;return _0x33e81b;})[_0xc200('0x1e')](respondWithFilteredResult(_0x3a4c5d,_0x5efb42))[_0xc200('0x28')](handleError(_0x3a4c5d,null));};exports[_0xc200('0x55')]=function(_0x5cbe8c,_0x505bca){var _0x5b69c4={'raw':!![],'where':{'id':_0x5cbe8c[_0xc200('0x56')]['id']}},_0x4e0b88={};_0x4e0b88[_0xc200('0x40')]=_['keys'](db['FaxMessage'][_0xc200('0x3d')]);_0x4e0b88[_0xc200('0x41')]=_[_0xc200('0x42')](_0x5cbe8c[_0xc200('0x41')]);_0x4e0b88['filters']=_[_0xc200('0x44')](_0x4e0b88[_0xc200('0x40')],_0x4e0b88[_0xc200('0x41')]);_0x5b69c4[_0xc200('0x45')]=_[_0xc200('0x44')](_0x4e0b88['model'],qs['fields'](_0x5cbe8c[_0xc200('0x41')][_0xc200('0x46')]));_0x5b69c4[_0xc200('0x45')]=_0x5b69c4[_0xc200('0x45')]['length']?_0x5b69c4[_0xc200('0x45')]:_0x4e0b88[_0xc200('0x40')];if(_0x5cbe8c[_0xc200('0x41')][_0xc200('0x51')]){_0x5b69c4[_0xc200('0x52')]=[{'all':!![]}];}_0x5b69c4=_['merge']({},_0x5b69c4,_0x5cbe8c[_0xc200('0x4f')]);return db[_0xc200('0x50')][_0xc200('0x57')](_0x5b69c4)['then'](handleEntityNotFound(_0x505bca,null))[_0xc200('0x1e')](respondWithResult(_0x505bca,null))['catch'](handleError(_0x505bca,null));};exports[_0xc200('0x35')]=function(_0xa5f4ea,_0xcbccdc){if(_0xa5f4ea[_0xc200('0x58')]['id']){delete _0xa5f4ea[_0xc200('0x58')]['id'];}return db['FaxMessage'][_0xc200('0x57')]({'where':{'id':_0xa5f4ea[_0xc200('0x56')]['id']}})[_0xc200('0x1e')](handleEntityNotFound(_0xcbccdc,null))[_0xc200('0x1e')](saveUpdates(_0xa5f4ea[_0xc200('0x58')],null))[_0xc200('0x1e')](respondWithResult(_0xcbccdc,null))['catch'](handleError(_0xcbccdc,null));};exports[_0xc200('0x36')]=function(_0x3c226b,_0x3d3d68){return db[_0xc200('0x50')][_0xc200('0x57')]({'where':{'id':_0x3c226b['params']['id']}})[_0xc200('0x1e')](handleEntityNotFound(_0x3d3d68,null))[_0xc200('0x1e')](removeEntity(_0x3d3d68,null))[_0xc200('0x28')](handleError(_0x3d3d68,null));};exports['describe']=function(_0x1b6014,_0x5c6796){return db[_0xc200('0x50')][_0xc200('0x59')]()['then'](respondWithResult(_0x5c6796,null))[_0xc200('0x28')](handleError(_0x5c6796,null));};var interaction_log=require(_0xc200('0x5a'))(_0xc200('0x5b'));exports[_0xc200('0x5c')]=function(_0x31eaca,_0x240e44,_0x2d5328){var _0x269244={'agent':{},'channel':_0xc200('0x5d')};if(_0x31eaca[_0xc200('0x58')]['id']){delete _0x31eaca[_0xc200('0x58')]['id'];}_0x31eaca[_0xc200('0x58')][_0xc200('0x5e')]=!![];_0x31eaca['body'][_0xc200('0x5f')]=moment()['format'](_0xc200('0x60'));_0x31eaca['body']['UserId']=_0x31eaca['body'][_0xc200('0x61')]||_0x31eaca['user']['id'];_0x269244[_0xc200('0x62')]['id']=_0x31eaca[_0xc200('0x58')]['UserId'];return db[_0xc200('0x50')][_0xc200('0x57')]({'where':{'id':_0x31eaca[_0xc200('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x240e44,null))[_0xc200('0x1e')](saveUpdates(_0x31eaca['body'],null))[_0xc200('0x1e')](function(_0x569a44){if(_0x569a44){_0x269244[_0xc200('0x26')]=_0x569a44[_0xc200('0x63')]({'plain':!![]});return db[_0xc200('0x64')][_0xc200('0x57')]({'where':{'id':_0x569a44[_0xc200('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x240e44,null))[_0xc200('0x1e')](function(_0x58cfd1){if(_0x58cfd1){return _0x58cfd1[_0xc200('0x35')]({'UserId':_0x31eaca[_0xc200('0x58')][_0xc200('0x61')],'read1stAt':_[_0xc200('0x66')](_0x58cfd1[_0xc200('0x67')])?moment()['format'](_0xc200('0x60')):undefined});}return null;})['then'](function(_0x5498f4){if(_0x5498f4){_0x269244[_0xc200('0x68')]=_0x5498f4[_0xc200('0x63')]({'plain':!![]});interaction_log[_0xc200('0x1f')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31eaca[_0xc200('0x69')]['id'],_0x31eaca[_0xc200('0x69')]['name'],_0x31eaca[_0xc200('0x69')]['role'],_0x269244['interaction']['id'],_0x31eaca[_0xc200('0x58')]?JSON[_0xc200('0x23')](_0x31eaca[_0xc200('0x58')]):_0xc200('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x269244);}return null;})[_0xc200('0x1e')](function(_0x4d9ca5){var _0x1823e0=_0xc200('0x6b')+_0x4d9ca5[_0xc200('0x26')][_0xc200('0x6c')];return db[_0xc200('0x6d')][_0xc200('0x41')](_0x1823e0,{'type':db[_0xc200('0x6e')][_0xc200('0x6f')][_0xc200('0x70')],'raw':!![]})[_0xc200('0x1e')](function(_0x14f5b3){return _0x14f5b3;});})[_0xc200('0x1e')](function(_0x530d38){if(_0x530d38){_0x269244[_0xc200('0x26')][_0xc200('0x71')]=_0x530d38[0x0];if(!_0x31eaca[_0xc200('0x58')][_0xc200('0x61')])return;return db[_0xc200('0x72')][_0xc200('0x57')]({'where':{'id':_0x31eaca[_0xc200('0x58')][_0xc200('0x61')],'role':_0xc200('0x62')},'attributes':['id',_0xc200('0x39'),_0xc200('0x73'),_0xc200('0x74'),_0xc200('0x75')],'raw':!![]});}return null;})[_0xc200('0x1e')](function(_0xb4500b){if(!_0xb4500b)return null;_0x269244[_0xc200('0x26')][_0xc200('0x62')]=_0xb4500b;return _0x269244;})[_0xc200('0x1e')](function(_0x3d8d24){if(_0x3d8d24){if(_0x31eaca[_0xc200('0x58')]['manual']){_0x269244['message'][_0xc200('0x76')]=util['format'](_0xc200('0x77'),_0x31eaca['user'][_0xc200('0x39')]);_0x269244[_0xc200('0x26')][_0xc200('0x78')]=_0x269244[_0xc200('0x78')];_0x269244[_0xc200('0x26')][_0xc200('0x79')]=_0x269244[_0xc200('0x78')];_0x269244[_0xc200('0x26')][_0xc200('0x7a')]=_0xc200('0x5c');return respondWithRpcPromise(_0xc200('0x7b'),_0xc200('0x7b'),{'event':_0xc200('0x7c'),'message':_0x269244[_0xc200('0x26')]},client9002)[_0xc200('0x1e')](function(){return _0x269244;});}return _0x269244;}return null;})[_0xc200('0x1e')](respondWithResult(_0x240e44,null))[_0xc200('0x28')](handleError(_0x240e44,null));};var interaction_log=require(_0xc200('0x5a'))(_0xc200('0x5b'));exports[_0xc200('0x33')]=function(_0x310e09,_0x35a397,_0x1e022b){var _0x28b8e4={'agent':{},'channel':_0xc200('0x5d')};if(_0x310e09[_0xc200('0x58')]['id']){delete _0x310e09[_0xc200('0x58')]['id'];}_0x310e09['body']['UserId']=_0x310e09[_0xc200('0x58')]['UserId']||_0x310e09[_0xc200('0x69')]['id'];_0x28b8e4[_0xc200('0x62')]['id']=_0x310e09[_0xc200('0x58')][_0xc200('0x61')];return db['FaxMessage'][_0xc200('0x57')]({'where':{'id':_0x310e09[_0xc200('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35a397,null))[_0xc200('0x1e')](function(_0x53f00c){if(_0x53f00c){_0x28b8e4['message']=_0x53f00c[_0xc200('0x63')]({'plain':!![]});return db[_0xc200('0x64')][_0xc200('0x57')]({'where':{'id':_0x53f00c[_0xc200('0x65')]}});}return null;})[_0xc200('0x1e')](handleEntityNotFound(_0x35a397,null))[_0xc200('0x1e')](function(_0xdd3570){if(_0xdd3570){_0x28b8e4[_0xc200('0x68')]=_0xdd3570[_0xc200('0x63')]({'plain':!![]});interaction_log[_0xc200('0x1f')](_0xc200('0x7d'),_0x310e09[_0xc200('0x69')]['id'],_0x310e09[_0xc200('0x69')]['name'],_0x310e09[_0xc200('0x69')][_0xc200('0x7e')],_0x28b8e4[_0xc200('0x68')]['id'],_0x310e09[_0xc200('0x58')]?JSON[_0xc200('0x23')](_0x310e09['body']):_0xc200('0x6a'));return respondWithRpcPromise('RejectMessage',_0xc200('0x7f'),_0x28b8e4);}return null;})[_0xc200('0x1e')](function(_0x415d60){var _0x14d543=_0xc200('0x6b')+_0x415d60[_0xc200('0x26')][_0xc200('0x6c')];return db[_0xc200('0x6d')][_0xc200('0x41')](_0x14d543,{'type':db[_0xc200('0x6e')][_0xc200('0x6f')][_0xc200('0x70')],'raw':!![]})['then'](function(_0x5c5fb5){return _0x5c5fb5;});})['then'](function(_0x57ea92){if(_0x57ea92){_0x28b8e4['message'][_0xc200('0x71')]=_0x57ea92[0x0];if(!_0x310e09[_0xc200('0x58')]['UserId'])return;return db[_0xc200('0x72')][_0xc200('0x57')]({'where':{'id':_0x310e09[_0xc200('0x58')][_0xc200('0x61')],'role':'agent'},'attributes':['id',_0xc200('0x39'),'fullname',_0xc200('0x74'),_0xc200('0x75')],'raw':!![]});}return null;})[_0xc200('0x1e')](function(_0x3b49a0){if(!_0x3b49a0)return null;_0x28b8e4[_0xc200('0x26')][_0xc200('0x62')]=_0x3b49a0;return _0x28b8e4;})[_0xc200('0x1e')](function(_0x231997){if(_0x231997){_0x231997[_0xc200('0x26')]['interface']=util['format']('SIP/%s',_0x310e09[_0xc200('0x69')][_0xc200('0x39')]);_0x231997[_0xc200('0x26')][_0xc200('0x78')]=_0x28b8e4[_0xc200('0x78')];_0x231997[_0xc200('0x26')][_0xc200('0x79')]=_0x28b8e4[_0xc200('0x78')];_0x231997[_0xc200('0x26')]['event']=_0xc200('0x33');respondWithRpcPromise(_0xc200('0x7b'),_0xc200('0x7b'),{'event':_0xc200('0x80'),'message':_0x231997[_0xc200('0x26')]},client9002);return _0x28b8e4;}return null;})['then'](respondWithResult(_0x35a397,null))[_0xc200('0x28')](handleError(_0x35a397,null));};exports[_0xc200('0x81')]=function(_0x2ea6bb,_0x2da3f9){var _0x4a913b;return db[_0xc200('0x50')]['create'](_0x2ea6bb[_0xc200('0x58')],{})[_0xc200('0x1e')](function(_0x5b2896){_0x4a913b=_0x5b2896;return db[_0xc200('0x82')][_0xc200('0x83')]({'where':{'id':_0x4a913b[_0xc200('0x6c')]}});})[_0xc200('0x1e')](function(_0x244733){if(_[_0xc200('0x66')](_0x244733)){return;}else{_0x4a913b[_0xc200('0x5d')]=_0x244733['fax'];return db[_0xc200('0x84')][_0xc200('0x83')]({'where':{'id':_0x4a913b[_0xc200('0x85')]}});}})[_0xc200('0x1e')](function(_0x3faa48){return respondWithRpcPromise(_0xc200('0x86'),_0xc200('0x86'),{'FaxAccountId':_['isNil'](_0x2ea6bb[_0xc200('0x58')])?undefined:_0x2ea6bb['body']['FaxAccountId'],'path':_[_0xc200('0x66')](_0x3faa48)?undefined:util[_0xc200('0x87')](_0xc200('0x88'),_0x3faa48[_0xc200('0x89')]),'fax':_['isNil'](_0x4a913b[_0xc200('0x5d')])?undefined:_0x4a913b[_0xc200('0x5d')],'AttachmentId':_0x4a913b[_0xc200('0x85')]},client9002);})[_0xc200('0x1e')](respondWithResult(_0x2da3f9,0xc9))[_0xc200('0x28')](handleError(_0x2da3f9,null));};exports['download']=function(_0x1570ab,_0x3bbeb1){var _0x1844b9=path['join'](config[_0xc200('0x8a')],_0xc200('0x8b'),_0xc200('0x8c'),_0xc200('0x8d'));return db[_0xc200('0x50')][_0xc200('0x57')]({'where':{'id':_0x1570ab[_0xc200('0x56')]['id']},'include':[{'model':db[_0xc200('0x84')],'as':_0xc200('0x84')}]})['then'](handleEntityNotFound(_0x3bbeb1,null))[_0xc200('0x1e')](function(_0x578b16){if(_0x578b16){return _0x3bbeb1[_0xc200('0x8e')](path[_0xc200('0x8f')](_0x1844b9,_0x578b16[_0xc200('0x84')][_0xc200('0x89')]));}})[_0xc200('0x28')](handleError(_0x3bbeb1,null));}; \ No newline at end of file +var _0x170c=['then','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','FaxMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','body','find','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','FaxInteraction','FaxInteractionId','update','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','internal','interface','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','fullname','email','SIP/%s','motionChannel','rejectmessage','CmContact','findOne','Attachment','AttachmentId','SendFax','join','root','server','files','download','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request'];(function(_0x17fbf0,_0x414860){var _0x352a30=function(_0x2d9795){while(--_0x2d9795){_0x17fbf0['push'](_0x17fbf0['shift']());}};_0x352a30(++_0x414860);}(_0x170c,0x6e));var _0xc170=function(_0x5918a4,_0x5d5662){_0x5918a4=_0x5918a4-0x0;var _0x5ddd8c=_0x170c[_0x5918a4];return _0x5ddd8c;};'use strict';var emlformat=require(_0xc170('0x0'));var rimraf=require(_0xc170('0x1'));var zipdir=require(_0xc170('0x2'));var jsonpatch=require(_0xc170('0x3'));var rp=require(_0xc170('0x4'));var moment=require(_0xc170('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc170('0x6'));var path=require(_0xc170('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc170('0x8'));var _=require(_0xc170('0x9'));var squel=require('squel');var crypto=require(_0xc170('0xa'));var jsforce=require(_0xc170('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc170('0xc'));var querystring=require(_0xc170('0xd'));var Papa=require(_0xc170('0xe'));var Redis=require(_0xc170('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc170('0x10'));var as=require(_0xc170('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc170('0x12'))('api');var utils=require(_0xc170('0x13'));var config=require(_0xc170('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc170('0x15'))['db'];config['redis']=_[_0xc170('0x16')](config['redis'],{'host':_0xc170('0x17'),'port':0x18eb});var socket=require(_0xc170('0x18'))(new Redis(config['redis']));require(_0xc170('0x19'))[_0xc170('0x1a')](socket);var jayson=require(_0xc170('0x1b'));var client=jayson[_0xc170('0x1c')][_0xc170('0x1d')]({'port':0x232c});var client9002=jayson[_0xc170('0x1c')][_0xc170('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x32f82a,_0x202b69,_0x5e3438,_0xd458cd){return new BPromise(function(_0x130806,_0x30c93e){var _0x5a11b1=_0xd458cd||client;return _0x5a11b1[_0xc170('0x1e')](_0x32f82a,_0x5e3438)[_0xc170('0x1f')](function(_0x4c8148){logger['info']('FaxMessage,\x20%s,\x20%s',_0x202b69,_0xc170('0x20'));logger[_0xc170('0x21')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x202b69,_0xc170('0x20'),JSON[_0xc170('0x22')](_0x4c8148));if(_0x4c8148[_0xc170('0x23')]){if(_0x4c8148[_0xc170('0x23')][_0xc170('0x24')]===0x1f4){logger['error'](_0xc170('0x25'),_0x202b69,_0x4c8148['error'][_0xc170('0x26')]);return _0x30c93e(_0x4c8148[_0xc170('0x23')]['message']);}logger[_0xc170('0x23')]('FaxMessage,\x20%s,\x20%s',_0x202b69,_0x4c8148['error'][_0xc170('0x26')]);return _0x130806(_0x4c8148['error']['message']);}else{logger[_0xc170('0x27')](_0xc170('0x25'),_0x202b69,'request\x20sent');_0x130806(_0x4c8148[_0xc170('0x28')][_0xc170('0x26')]);}})['catch'](function(_0x1c35a3){logger[_0xc170('0x23')](_0xc170('0x25'),_0x202b69,_0x1c35a3);_0x30c93e(_0x1c35a3);});});}function respondWithStatusCode(_0x5f5393,_0x274a56){_0x274a56=_0x274a56||0xcc;return function(_0x375c85){if(_0x375c85){return _0x5f5393[_0xc170('0x29')](_0x274a56);}return _0x5f5393[_0xc170('0x2a')](_0x274a56)[_0xc170('0x2b')]();};}function respondWithResult(_0x4af4cd,_0xbd5e1d){_0xbd5e1d=_0xbd5e1d||0xc8;return function(_0x1b944e){if(_0x1b944e){return _0x4af4cd[_0xc170('0x2a')](_0xbd5e1d)[_0xc170('0x2c')](_0x1b944e);}};}function respondWithFilteredResult(_0x514982,_0x436eef){return function(_0x182786){if(_0x182786){var _0x1f7e38=typeof _0x436eef['offset']===_0xc170('0x2d')&&typeof _0x436eef[_0xc170('0x2e')]===_0xc170('0x2d');var _0x268f3d=_0x182786[_0xc170('0x2f')];var _0x34698f=_0x1f7e38?0x0:_0x436eef[_0xc170('0x30')];var _0x3d0062=_0x1f7e38?_0x182786[_0xc170('0x2f')]:_0x436eef[_0xc170('0x30')]+_0x436eef[_0xc170('0x2e')];var _0x3e4a4b;if(_0x3d0062>=_0x268f3d){_0x3d0062=_0x268f3d;_0x3e4a4b=0xc8;}else{_0x3e4a4b=0xce;}_0x514982['status'](_0x3e4a4b);return _0x514982[_0xc170('0x31')](_0xc170('0x32'),_0x34698f+'-'+_0x3d0062+'/'+_0x268f3d)['json'](_0x182786);}return null;};}function patchUpdates(_0x8ecc69){return function(_0x28ea44){try{jsonpatch[_0xc170('0x33')](_0x28ea44,_0x8ecc69,!![]);}catch(_0x1aca12){return BPromise[_0xc170('0x34')](_0x1aca12);}return _0x28ea44[_0xc170('0x35')]();};}function saveUpdates(_0x3db3fa,_0x2eb48c){return function(_0x3239a8){if(_0x3239a8){return _0x3239a8['update'](_0x3db3fa)[_0xc170('0x1f')](function(_0xc5cf76){return _0xc5cf76;});}return null;};}function removeEntity(_0x594f60,_0x3cb81a){return function(_0x4518cb){if(_0x4518cb){return _0x4518cb[_0xc170('0x36')]()['then'](function(){_0x594f60['status'](0xcc)[_0xc170('0x2b')]();});}};}function handleEntityNotFound(_0x29418d,_0x51a200){return function(_0x3846de){if(!_0x3846de){_0x29418d[_0xc170('0x29')](0x194);}return _0x3846de;};}function handleError(_0x38b54c,_0x1f8980){_0x1f8980=_0x1f8980||0x1f4;return function(_0x2e97df){logger['error'](_0x2e97df[_0xc170('0x37')]);if(_0x2e97df[_0xc170('0x38')]){delete _0x2e97df['name'];}_0x38b54c[_0xc170('0x2a')](_0x1f8980)['send'](_0x2e97df);};}exports[_0xc170('0x39')]=function(_0x2d11ee,_0x33ee7f){var _0x273d99={},_0x1d64cc={},_0x466901={'count':0x0,'rows':[]};var _0x4f6610=_[_0xc170('0x3a')](db[_0xc170('0x3b')][_0xc170('0x3c')],function(_0x532e19){return{'name':_0x532e19[_0xc170('0x3d')],'type':_0x532e19['type'][_0xc170('0x3e')]};});_0x1d64cc[_0xc170('0x3f')]=_['map'](_0x4f6610,_0xc170('0x38'));_0x1d64cc['query']=_[_0xc170('0x40')](_0x2d11ee[_0xc170('0x41')]);_0x1d64cc[_0xc170('0x42')]=_[_0xc170('0x43')](_0x1d64cc[_0xc170('0x3f')],_0x1d64cc['query']);_0x273d99[_0xc170('0x44')]=_[_0xc170('0x43')](_0x1d64cc[_0xc170('0x3f')],qs[_0xc170('0x45')](_0x2d11ee[_0xc170('0x41')][_0xc170('0x45')]));_0x273d99[_0xc170('0x44')]=_0x273d99[_0xc170('0x44')]['length']?_0x273d99[_0xc170('0x44')]:_0x1d64cc['model'];if(!_0x2d11ee['query']['hasOwnProperty']('nolimit')){_0x273d99[_0xc170('0x2e')]=qs[_0xc170('0x2e')](_0x2d11ee[_0xc170('0x41')][_0xc170('0x2e')]);_0x273d99[_0xc170('0x30')]=qs[_0xc170('0x30')](_0x2d11ee['query'][_0xc170('0x30')]);}_0x273d99[_0xc170('0x46')]=qs[_0xc170('0x47')](_0x2d11ee[_0xc170('0x41')]['sort']);_0x273d99[_0xc170('0x48')]=qs['filters'](_[_0xc170('0x49')](_0x2d11ee[_0xc170('0x41')],_0x1d64cc[_0xc170('0x42')]),_0x4f6610);if(_0x2d11ee[_0xc170('0x41')][_0xc170('0x4a')]){_0x273d99[_0xc170('0x48')]=_[_0xc170('0x4b')](_0x273d99['where'],{'$or':_[_0xc170('0x3a')](_0x4f6610,function(_0x584d07){if(_0x584d07[_0xc170('0x4c')]!==_0xc170('0x4d')){var _0x221db4={};_0x221db4[_0x584d07[_0xc170('0x38')]]={'$like':'%'+_0x2d11ee['query'][_0xc170('0x4a')]+'%'};return _0x221db4;}})});}_0x273d99=_[_0xc170('0x4b')]({},_0x273d99,_0x2d11ee[_0xc170('0x4e')]);var _0x18f4fe={'where':_0x273d99[_0xc170('0x48')]};return db[_0xc170('0x3b')][_0xc170('0x2f')](_0x18f4fe)[_0xc170('0x1f')](function(_0x1523db){_0x466901[_0xc170('0x2f')]=_0x1523db;if(_0x2d11ee[_0xc170('0x41')][_0xc170('0x4f')]){_0x273d99['include']=[{'all':!![]}];}return db[_0xc170('0x3b')][_0xc170('0x50')](_0x273d99);})[_0xc170('0x1f')](function(_0x13e942){_0x466901[_0xc170('0x51')]=_0x13e942;return _0x466901;})[_0xc170('0x1f')](respondWithFilteredResult(_0x33ee7f,_0x273d99))[_0xc170('0x52')](handleError(_0x33ee7f,null));};exports['show']=function(_0x3b4337,_0x35e148){var _0x14acbf={'raw':!![],'where':{'id':_0x3b4337[_0xc170('0x53')]['id']}},_0x32d9d8={};_0x32d9d8[_0xc170('0x3f')]=_[_0xc170('0x40')](db[_0xc170('0x3b')][_0xc170('0x3c')]);_0x32d9d8[_0xc170('0x41')]=_[_0xc170('0x40')](_0x3b4337[_0xc170('0x41')]);_0x32d9d8[_0xc170('0x42')]=_['intersection'](_0x32d9d8['model'],_0x32d9d8[_0xc170('0x41')]);_0x14acbf[_0xc170('0x44')]=_[_0xc170('0x43')](_0x32d9d8[_0xc170('0x3f')],qs[_0xc170('0x45')](_0x3b4337['query'][_0xc170('0x45')]));_0x14acbf['attributes']=_0x14acbf[_0xc170('0x44')]['length']?_0x14acbf[_0xc170('0x44')]:_0x32d9d8['model'];if(_0x3b4337['query'][_0xc170('0x4f')]){_0x14acbf[_0xc170('0x54')]=[{'all':!![]}];}_0x14acbf=_[_0xc170('0x4b')]({},_0x14acbf,_0x3b4337[_0xc170('0x4e')]);return db['FaxMessage']['find'](_0x14acbf)[_0xc170('0x1f')](handleEntityNotFound(_0x35e148,null))[_0xc170('0x1f')](respondWithResult(_0x35e148,null))[_0xc170('0x52')](handleError(_0x35e148,null));};exports['update']=function(_0x199401,_0x18fffa){if(_0x199401[_0xc170('0x55')]['id']){delete _0x199401[_0xc170('0x55')]['id'];}return db[_0xc170('0x3b')][_0xc170('0x56')]({'where':{'id':_0x199401[_0xc170('0x53')]['id']}})[_0xc170('0x1f')](handleEntityNotFound(_0x18fffa,null))['then'](saveUpdates(_0x199401[_0xc170('0x55')],null))[_0xc170('0x1f')](respondWithResult(_0x18fffa,null))[_0xc170('0x52')](handleError(_0x18fffa,null));};exports['destroy']=function(_0x150968,_0x533099){return db[_0xc170('0x3b')][_0xc170('0x56')]({'where':{'id':_0x150968[_0xc170('0x53')]['id']}})[_0xc170('0x1f')](handleEntityNotFound(_0x533099,null))[_0xc170('0x1f')](removeEntity(_0x533099,null))[_0xc170('0x52')](handleError(_0x533099,null));};exports[_0xc170('0x57')]=function(_0x3e3421,_0x5ac7f1){return db[_0xc170('0x3b')][_0xc170('0x57')]()[_0xc170('0x1f')](respondWithResult(_0x5ac7f1,null))[_0xc170('0x52')](handleError(_0x5ac7f1,null));};var interaction_log=require(_0xc170('0x12'))(_0xc170('0x58'));exports[_0xc170('0x59')]=function(_0x29e4f8,_0x5d0faa,_0x468678){var _0x10144a={'agent':{},'channel':_0xc170('0x5a')};if(_0x29e4f8[_0xc170('0x55')]['id']){delete _0x29e4f8[_0xc170('0x55')]['id'];}_0x29e4f8['body']['read']=!![];_0x29e4f8[_0xc170('0x55')][_0xc170('0x5b')]=moment()[_0xc170('0x5c')](_0xc170('0x5d'));_0x29e4f8['body'][_0xc170('0x5e')]=_0x29e4f8[_0xc170('0x55')][_0xc170('0x5e')]||_0x29e4f8['user']['id'];_0x10144a[_0xc170('0x5f')]['id']=_0x29e4f8[_0xc170('0x55')]['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x29e4f8[_0xc170('0x53')]['id'],'UserId':null}})[_0xc170('0x1f')](handleEntityNotFound(_0x5d0faa,null))[_0xc170('0x1f')](saveUpdates(_0x29e4f8[_0xc170('0x55')],null))[_0xc170('0x1f')](function(_0x3d7460){if(_0x3d7460){_0x10144a[_0xc170('0x26')]=_0x3d7460['get']({'plain':!![]});return db[_0xc170('0x60')][_0xc170('0x56')]({'where':{'id':_0x3d7460[_0xc170('0x61')]}});}return null;})[_0xc170('0x1f')](handleEntityNotFound(_0x5d0faa,null))[_0xc170('0x1f')](function(_0x181a77){if(_0x181a77){return _0x181a77[_0xc170('0x62')]({'UserId':_0x29e4f8[_0xc170('0x55')][_0xc170('0x5e')],'read1stAt':_[_0xc170('0x63')](_0x181a77[_0xc170('0x64')])?moment()[_0xc170('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc170('0x1f')](function(_0xebb76f){if(_0xebb76f){_0x10144a[_0xc170('0x65')]=_0xebb76f[_0xc170('0x66')]({'plain':!![]});interaction_log[_0xc170('0x27')](_0xc170('0x67'),_0x29e4f8[_0xc170('0x68')]['id'],_0x29e4f8[_0xc170('0x68')][_0xc170('0x38')],_0x29e4f8[_0xc170('0x68')]['role'],_0x10144a[_0xc170('0x65')]['id'],_0x29e4f8['body']?JSON[_0xc170('0x22')](_0x29e4f8[_0xc170('0x55')]):'null');return respondWithRpcPromise(_0xc170('0x69'),_0xc170('0x6a'),_0x10144a);}return null;})[_0xc170('0x1f')](function(_0x5c9308){var _0x394576='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c9308[_0xc170('0x26')][_0xc170('0x6b')];return db['sequelize'][_0xc170('0x41')](_0x394576,{'type':db[_0xc170('0x6c')][_0xc170('0x6d')][_0xc170('0x6e')],'raw':!![]})['then'](function(_0x559a05){return _0x559a05;});})['then'](function(_0x2a9aa1){if(_0x2a9aa1){_0x10144a['message']['contact']=_0x2a9aa1[0x0];if(!_0x29e4f8[_0xc170('0x55')][_0xc170('0x5e')])return;return db['User'][_0xc170('0x56')]({'where':{'id':_0x29e4f8[_0xc170('0x55')][_0xc170('0x5e')],'role':_0xc170('0x5f')},'attributes':['id',_0xc170('0x38'),'fullname','email',_0xc170('0x6f')],'raw':!![]});}return null;})[_0xc170('0x1f')](function(_0x530bc4){if(!_0x530bc4)return null;_0x10144a[_0xc170('0x26')]['agent']=_0x530bc4;return _0x10144a;})[_0xc170('0x1f')](function(_0xd99856){if(_0xd99856){if(_0x29e4f8[_0xc170('0x55')]['manual']){_0x10144a[_0xc170('0x26')][_0xc170('0x70')]=util[_0xc170('0x5c')]('SIP/%s',_0x29e4f8['user']['name']);_0x10144a[_0xc170('0x26')][_0xc170('0x71')]=_0x10144a[_0xc170('0x71')];_0x10144a['message']['motionChannel']=_0x10144a[_0xc170('0x71')];_0x10144a['message'][_0xc170('0x72')]='accept';return respondWithRpcPromise(_0xc170('0x73'),_0xc170('0x73'),{'event':_0xc170('0x74'),'message':_0x10144a[_0xc170('0x26')]},client9002)[_0xc170('0x1f')](function(){return _0x10144a;});}return _0x10144a;}return null;})[_0xc170('0x1f')](respondWithResult(_0x5d0faa,null))[_0xc170('0x52')](handleError(_0x5d0faa,null));};var interaction_log=require(_0xc170('0x12'))(_0xc170('0x58'));exports[_0xc170('0x34')]=function(_0x37fa32,_0xd5cc02,_0x10ecef){var _0x47c95e={'agent':{},'channel':_0xc170('0x5a')};if(_0x37fa32['body']['id']){delete _0x37fa32[_0xc170('0x55')]['id'];}_0x37fa32['body'][_0xc170('0x5e')]=_0x37fa32[_0xc170('0x55')]['UserId']||_0x37fa32[_0xc170('0x68')]['id'];_0x47c95e[_0xc170('0x5f')]['id']=_0x37fa32[_0xc170('0x55')]['UserId'];return db[_0xc170('0x3b')]['find']({'where':{'id':_0x37fa32[_0xc170('0x53')]['id'],'UserId':null}})[_0xc170('0x1f')](handleEntityNotFound(_0xd5cc02,null))[_0xc170('0x1f')](function(_0x252dd9){if(_0x252dd9){_0x47c95e[_0xc170('0x26')]=_0x252dd9[_0xc170('0x66')]({'plain':!![]});return db[_0xc170('0x60')][_0xc170('0x56')]({'where':{'id':_0x252dd9[_0xc170('0x61')]}});}return null;})[_0xc170('0x1f')](handleEntityNotFound(_0xd5cc02,null))['then'](function(_0x4663fb){if(_0x4663fb){_0x47c95e[_0xc170('0x65')]=_0x4663fb[_0xc170('0x66')]({'plain':!![]});interaction_log[_0xc170('0x27')](_0xc170('0x75'),_0x37fa32[_0xc170('0x68')]['id'],_0x37fa32[_0xc170('0x68')][_0xc170('0x38')],_0x37fa32[_0xc170('0x68')][_0xc170('0x76')],_0x47c95e[_0xc170('0x65')]['id'],_0x37fa32['body']?JSON['stringify'](_0x37fa32['body']):_0xc170('0x77'));return respondWithRpcPromise(_0xc170('0x78'),_0xc170('0x79'),_0x47c95e);}return null;})[_0xc170('0x1f')](function(_0x36eb9e){var _0x32ae8e=_0xc170('0x7a')+_0x36eb9e[_0xc170('0x26')][_0xc170('0x6b')];return db[_0xc170('0x7b')][_0xc170('0x41')](_0x32ae8e,{'type':db[_0xc170('0x6c')][_0xc170('0x6d')]['SELECT'],'raw':!![]})[_0xc170('0x1f')](function(_0x37e4e8){return _0x37e4e8;});})[_0xc170('0x1f')](function(_0xa16bb8){if(_0xa16bb8){_0x47c95e[_0xc170('0x26')]['contact']=_0xa16bb8[0x0];if(!_0x37fa32['body'][_0xc170('0x5e')])return;return db[_0xc170('0x7c')][_0xc170('0x56')]({'where':{'id':_0x37fa32[_0xc170('0x55')][_0xc170('0x5e')],'role':'agent'},'attributes':['id',_0xc170('0x38'),_0xc170('0x7d'),_0xc170('0x7e'),_0xc170('0x6f')],'raw':!![]});}return null;})['then'](function(_0x1c9f5c){if(!_0x1c9f5c)return null;_0x47c95e[_0xc170('0x26')][_0xc170('0x5f')]=_0x1c9f5c;return _0x47c95e;})['then'](function(_0x1dcdab){if(_0x1dcdab){_0x1dcdab[_0xc170('0x26')][_0xc170('0x70')]=util[_0xc170('0x5c')](_0xc170('0x7f'),_0x37fa32[_0xc170('0x68')][_0xc170('0x38')]);_0x1dcdab[_0xc170('0x26')]['channel']=_0x47c95e['channel'];_0x1dcdab[_0xc170('0x26')][_0xc170('0x80')]=_0x47c95e[_0xc170('0x71')];_0x1dcdab[_0xc170('0x26')][_0xc170('0x72')]=_0xc170('0x34');respondWithRpcPromise(_0xc170('0x73'),_0xc170('0x73'),{'event':_0xc170('0x81'),'message':_0x1dcdab[_0xc170('0x26')]},client9002);return _0x47c95e;}return null;})[_0xc170('0x1f')](respondWithResult(_0xd5cc02,null))[_0xc170('0x52')](handleError(_0xd5cc02,null));};exports['create']=function(_0x4174d0,_0x43e208){var _0x40ef5d;return db[_0xc170('0x3b')]['create'](_0x4174d0[_0xc170('0x55')],{})['then'](function(_0x246b4f){_0x40ef5d=_0x246b4f;return db[_0xc170('0x82')][_0xc170('0x83')]({'where':{'id':_0x40ef5d[_0xc170('0x6b')]}});})['then'](function(_0x1375df){if(_[_0xc170('0x63')](_0x1375df)){return;}else{_0x40ef5d['fax']=_0x1375df['fax'];return db[_0xc170('0x84')]['findOne']({'where':{'id':_0x40ef5d[_0xc170('0x85')]}});}})[_0xc170('0x1f')](function(_0x30fe66){return respondWithRpcPromise(_0xc170('0x86'),'SendFax',{'FaxAccountId':_[_0xc170('0x63')](_0x4174d0[_0xc170('0x55')])?undefined:_0x4174d0[_0xc170('0x55')]['FaxAccountId'],'path':_[_0xc170('0x63')](_0x30fe66)?undefined:util[_0xc170('0x5c')]('/var/opt/motion2/server/files/attachments/%s',_0x30fe66['basename']),'fax':_['isNil'](_0x40ef5d[_0xc170('0x5a')])?undefined:_0x40ef5d[_0xc170('0x5a')],'AttachmentId':_0x40ef5d[_0xc170('0x85')]},client9002);})[_0xc170('0x1f')](respondWithResult(_0x43e208,0xc9))['catch'](handleError(_0x43e208,null));};exports['download']=function(_0x4e9437,_0x3c26a3){var _0x395e7f=path[_0xc170('0x87')](config[_0xc170('0x88')],_0xc170('0x89'),_0xc170('0x8a'),'attachments');return db['FaxMessage'][_0xc170('0x56')]({'where':{'id':_0x4e9437[_0xc170('0x53')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0xc170('0x1f')](handleEntityNotFound(_0x3c26a3,null))[_0xc170('0x1f')](function(_0x2671c5){if(_0x2671c5){return _0x3c26a3[_0xc170('0x8b')](path[_0xc170('0x87')](_0x395e7f,_0x2671c5[_0xc170('0x84')][_0xc170('0x8c')]));}})[_0xc170('0x52')](handleError(_0x3c26a3,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 680e554..9de5399 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 _0x126e=['emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x5daad4,_0x3cecda){var _0x4b3fe4=function(_0x51ebd6){while(--_0x51ebd6){_0x5daad4['push'](_0x5daad4['shift']());}};_0x4b3fe4(++_0x3cecda);}(_0x126e,0x108));var _0xe126=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x126e[_0xb0f7c3];return _0x28ea68;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xe126('0x0'))['db'][_0xe126('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xe126('0x2')](0x0);var events={'afterCreate':_0xe126('0x3'),'afterUpdate':_0xe126('0x4'),'afterDestroy':_0xe126('0x5')};function emitEvent(_0x5e7f60){return function(_0x3beaef,_0x31c902,_0x8cb81d){FaxMessageEvents[_0xe126('0x6')](_0x5e7f60+':'+_0x3beaef['id'],_0x3beaef);FaxMessageEvents[_0xe126('0x6')](_0x5e7f60,_0x3beaef);_0x8cb81d(null);};}for(var e in events){if(events[_0xe126('0x7')](e)){var event=events[e];FaxMessage[_0xe126('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xf2e3=['remove','emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf2e3,0x9b));var _0x3f2e=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xf2e3[_0xe73080];return _0x12cbc4;};'use strict';var EventEmitter=require(_0x3f2e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x3f2e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3f2e('0x2')](0x0);var events={'afterCreate':_0x3f2e('0x3'),'afterUpdate':_0x3f2e('0x4'),'afterDestroy':_0x3f2e('0x5')};function emitEvent(_0x1634cd){return function(_0x3938e2,_0xabcf5c,_0x216b26){FaxMessageEvents['emit'](_0x1634cd+':'+_0x3938e2['id'],_0x3938e2);FaxMessageEvents[_0x3f2e('0x6')](_0x1634cd,_0x3938e2);_0x216b26(null);};}for(var e in events){if(events[_0x3f2e('0x7')](e)){var event=events[e];FaxMessage[_0x3f2e('0x8')](e,emitEvent(event));}}module[_0x3f2e('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index f99bc96..555eac1 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 _0x6c6a=['moment','bluebird','request-promise','path','rimraf','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','catch','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x6c6a,0x66));var _0xa6c6=function(_0x38990b,_0x4c5c7b){_0x38990b=_0x38990b-0x0;var _0x367e2d=_0x6c6a[_0x38990b];return _0x367e2d;};'use strict';var _=require(_0xa6c6('0x0'));var util=require('util');var logger=require(_0xa6c6('0x1'))('api');var moment=require(_0xa6c6('0x2'));var BPromise=require(_0xa6c6('0x3'));var rp=require(_0xa6c6('0x4'));var fs=require('fs');var path=require(_0xa6c6('0x5'));var rimraf=require(_0xa6c6('0x6'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0xa6c6('0x7')]=function(_0x27f350,_0x2a79e9){return _0x27f350[_0xa6c6('0x8')](_0xa6c6('0x9'),attributes,{'tableName':_0xa6c6('0xa'),'paranoid':![],'indexes':[{'name':_0xa6c6('0xb'),'fields':['body'],'type':_0xa6c6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x440250,_0x190191,_0xf9272a){var _0x58e8b3=_0x27f350[_0xa6c6('0xd')];var _0x25e086=_0x440250[_0xa6c6('0xe')]({'plain':!![]});if(_0x25e086['direction'][_0xa6c6('0xf')]()==='in'||_0x25e086[_0xa6c6('0x10')][_0xa6c6('0xf')]()===_0xa6c6('0x11')&&!_0x25e086['secret']&&!_[_0xa6c6('0x12')](_0x25e086[_0xa6c6('0x13')])){_0x58e8b3[_0xa6c6('0x14')][_0xa6c6('0x15')]({'where':{'id':_0x25e086[_0xa6c6('0x16')]}})['then'](function(_0x382b11){if(_0x382b11){_0x382b11[_0xa6c6('0x17')]({'lastMsgAt':_0x25e086['createdAt'],'lastMsgDirection':_0x25e086['direction'][_0xa6c6('0xf')]()});}})[_0xa6c6('0x18')](function(_0x5cc7c8){console['error'](_0x5cc7c8);});}_0xf9272a();}},'charset':'utf8mb4','collate':_0xa6c6('0x19')});}; \ No newline at end of file +var _0xc962=['secret','isNil','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xc962,0x19d));var _0x2c96=function(_0x30fbbf,_0x53ea76){_0x30fbbf=_0x30fbbf-0x0;var _0xfda58e=_0xc962[_0x30fbbf];return _0xfda58e;};'use strict';var _=require(_0x2c96('0x0'));var util=require(_0x2c96('0x1'));var logger=require(_0x2c96('0x2'))(_0x2c96('0x3'));var moment=require('moment');var BPromise=require(_0x2c96('0x4'));var rp=require(_0x2c96('0x5'));var fs=require('fs');var path=require(_0x2c96('0x6'));var rimraf=require('rimraf');var config=require(_0x2c96('0x7'));var attributes=require(_0x2c96('0x8'));module[_0x2c96('0x9')]=function(_0x6250fd,_0x29069c){return _0x6250fd[_0x2c96('0xa')](_0x2c96('0xb'),attributes,{'tableName':_0x2c96('0xc'),'paranoid':![],'indexes':[{'name':_0x2c96('0xd'),'fields':[_0x2c96('0xe')],'type':_0x2c96('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34de68,_0x171cf0,_0x4037aa){var _0x4e992b=_0x6250fd[_0x2c96('0x10')];var _0x5882be=_0x34de68[_0x2c96('0x11')]({'plain':!![]});if(_0x5882be[_0x2c96('0x12')]['toLowerCase']()==='in'||_0x5882be[_0x2c96('0x12')][_0x2c96('0x13')]()===_0x2c96('0x14')&&!_0x5882be[_0x2c96('0x15')]&&!_[_0x2c96('0x16')](_0x5882be['UserId'])){_0x4e992b['FaxInteraction'][_0x2c96('0x17')]({'where':{'id':_0x5882be[_0x2c96('0x18')]}})[_0x2c96('0x19')](function(_0x350e7f){if(_0x350e7f){_0x350e7f[_0x2c96('0x1a')]({'lastMsgAt':_0x5882be[_0x2c96('0x1b')],'lastMsgDirection':_0x5882be[_0x2c96('0x12')]['toLowerCase']()});}})[_0x2c96('0x1c')](function(_0x380829){console[_0x2c96('0x1d')](_0x380829);});}_0x4037aa();}},'charset':'utf8mb4','collate':_0x2c96('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index cd6e309..4523fa2 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 _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x51fee9,_0x5b4b90){var _0x532a2b=function(_0x1a1ee5){while(--_0x1a1ee5){_0x51fee9['push'](_0x51fee9['shift']());}};_0x532a2b(++_0x5b4b90);}(_0x6aa7,0x178));var _0x76aa=function(_0xb998de,_0x3814c6){_0xb998de=_0xb998de-0x0;var _0x24f698=_0x6aa7[_0xb998de];return _0x24f698;};'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});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});}; \ No newline at end of file +var _0x2d17=['create','catch','UpdateFaxMessage','FaxMessage','body','options','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage'];(function(_0x30f987,_0x52f509){var _0x6b9bab=function(_0x4383dc){while(--_0x4383dc){_0x30f987['push'](_0x30f987['shift']());}};_0x6b9bab(++_0x52f509);}(_0x2d17,0x17e));var _0x72d1=function(_0x282dc9,_0x5ad970){_0x282dc9=_0x282dc9-0x0;var _0x190b38=_0x2d17[_0x282dc9];return _0x190b38;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('FaxMessage,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});}exports[_0x72d1('0x19')]=function(_0x1865c1){var _0x8d6890=this;return new Promise(function(_0x2253fd,_0x1e2411){return db['FaxMessage'][_0x72d1('0x1a')](_0x1865c1['body'],{'raw':_0x1865c1['options']?_0x1865c1['options']['raw']===undefined?!![]:![]:!![]})[_0x72d1('0xf')](function(_0x374602){logger['info'](_0x72d1('0x19'),_0x1865c1);logger[_0x72d1('0x13')](_0x72d1('0x19'),_0x1865c1,JSON[_0x72d1('0x14')](_0x374602));_0x2253fd(_0x374602);})[_0x72d1('0x1b')](function(_0x4e6acd){logger['error'](_0x72d1('0x19'),_0x4e6acd[_0x72d1('0x17')],_0x1865c1);_0x1e2411(_0x8d6890[_0x72d1('0x15')](0x1f4,_0x4e6acd[_0x72d1('0x17')]));});});};exports[_0x72d1('0x1c')]=function(_0x33d530){var _0x163bec=this;return new Promise(function(_0x589f7c,_0x57ec9e){return db[_0x72d1('0x1d')]['update'](_0x33d530[_0x72d1('0x1e')],{'raw':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d530[_0x72d1('0x1f')]?_0x33d530['options'][_0x72d1('0x20')]||null:null,'attributes':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')][_0x72d1('0x21')]||null:null,'limit':_0x33d530['options']?_0x33d530[_0x72d1('0x1f')]['limit']||null:null})[_0x72d1('0xf')](function(_0x32dc5e){logger['info'](_0x72d1('0x1c'),_0x33d530);logger[_0x72d1('0x13')](_0x72d1('0x1c'),_0x33d530,JSON[_0x72d1('0x14')](_0x32dc5e));_0x589f7c(_0x32dc5e);})[_0x72d1('0x1b')](function(_0x52511f){logger[_0x72d1('0x15')](_0x72d1('0x1c'),_0x52511f[_0x72d1('0x17')],_0x33d530);_0x57ec9e(_0x163bec['error'](0x1f4,_0x52511f[_0x72d1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7ea66ab..60381be 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 _0xd75e=['save','update','emit','register','length','faxMessage:','./faxMessage.events'];(function(_0x32a235,_0x5e7e3b){var _0x582689=function(_0x108453){while(--_0x108453){_0x32a235['push'](_0x32a235['shift']());}};_0x582689(++_0x5e7e3b);}(_0xd75e,0x7d));var _0xed75=function(_0x2b1cb2,_0x353f85){_0x2b1cb2=_0x2b1cb2-0x0;var _0x218d20=_0xd75e[_0x2b1cb2];return _0x218d20;};'use strict';var FaxMessageEvents=require(_0xed75('0x0'));var events=[_0xed75('0x1'),'remove',_0xed75('0x2')];function createListener(_0x585433,_0x434b74){return function(_0x131a9f){_0x434b74[_0xed75('0x3')](_0x585433,_0x131a9f);};}function removeListener(_0x4ecc01,_0x5732ed){return function(){FaxMessageEvents['removeListener'](_0x4ecc01,_0x5732ed);};}exports[_0xed75('0x4')]=function(_0x1e70da){for(var _0x42626b=0x0,_0x4ba473=events[_0xed75('0x5')];_0x42626b<_0x4ba473;_0x42626b++){var _0x557e7c=events[_0x42626b];var _0x30a4f9=createListener(_0xed75('0x6')+_0x557e7c,_0x1e70da);FaxMessageEvents['on'](_0x557e7c,_0x30a4f9);}}; \ No newline at end of file +var _0xb27e=['emit','removeListener','register','length','faxMessage:','save','update'];(function(_0x2956d7,_0x16e51c){var _0x1decbd=function(_0x3d48e4){while(--_0x3d48e4){_0x2956d7['push'](_0x2956d7['shift']());}};_0x1decbd(++_0x16e51c);}(_0xb27e,0x83));var _0xeb27=function(_0x22f6e7,_0xac6a59){_0x22f6e7=_0x22f6e7-0x0;var _0x3c8aed=_0xb27e[_0x22f6e7];return _0x3c8aed;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xeb27('0x0'),'remove',_0xeb27('0x1')];function createListener(_0xfe0072,_0x5b831){return function(_0x34e479){_0x5b831[_0xeb27('0x2')](_0xfe0072,_0x34e479);};}function removeListener(_0x4bc7bb,_0x55a551){return function(){FaxMessageEvents[_0xeb27('0x3')](_0x4bc7bb,_0x55a551);};}exports[_0xeb27('0x4')]=function(_0x37f77c){for(var _0x346f06=0x0,_0x455d47=events[_0xeb27('0x5')];_0x346f06<_0x455d47;_0x346f06++){var _0x4abff9=events[_0x346f06];var _0x5ed127=createListener(_0xeb27('0x6')+_0x4abff9,_0x37f77c);FaxMessageEvents['on'](_0x4abff9,_0x5ed127);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e5bdb0a..7de7f8e 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 _0x4522=['destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','fax','faxmessage:create','create','put','reject'];(function(_0x468bb0,_0x10e0bf){var _0x241441=function(_0x32aa9b){while(--_0x32aa9b){_0x468bb0['push'](_0x468bb0['shift']());}};_0x241441(++_0x10e0bf);}(_0x4522,0x1a0));var _0x2452=function(_0x342913,_0x20c377){_0x342913=_0x342913-0x0;var _0xe810e3=_0x4522[_0x342913];return _0xe810e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['get']('/:id/download',auth[_0x2452('0x9')](),controller['download']);router['post']('/',auth[_0x2452('0x9')](),interaction[_0x2452('0xf')](_0x2452('0x10'),_0x2452('0x11')),controller[_0x2452('0x12')]);router[_0x2452('0x13')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x2452('0x9')](),controller['accept']);router[_0x2452('0x13')]('/:id/reject',auth[_0x2452('0x9')](),controller[_0x2452('0x14')]);router['delete'](_0x2452('0xd'),auth['isAuthenticated'](),controller[_0x2452('0x15')]);module[_0x2452('0x16')]=router; \ No newline at end of file +var _0xca66=['faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax'];(function(_0xbacbc7,_0x2551e7){var _0x29e340=function(_0x3315fd){while(--_0x3315fd){_0xbacbc7['push'](_0xbacbc7['shift']());}};_0x29e340(++_0x2551e7);}(_0xca66,0x8b));var _0x6ca6=function(_0x2cda7f,_0x1a4623){_0x2cda7f=_0x2cda7f-0x0;var _0x3eebd7=_0xca66[_0x2cda7f];return _0x3eebd7;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./faxMessage.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),interaction[_0x6ca6('0xf')](_0x6ca6('0x10'),_0x6ca6('0x11')),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x14')]);router['put'](_0x6ca6('0x15'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x16')]);router[_0x6ca6('0x13')](_0x6ca6('0x17'),auth[_0x6ca6('0x7')](),controller['reject']);router['delete']('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x18')]);module[_0x6ca6('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 6b0e62b..57585ab 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 _0x9d56=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x9d56,0x122));var _0x69d5=function(_0x633fb9,_0x3b161f){_0x633fb9=_0x633fb9-0x0;var _0x36c108=_0x9d56[_0x633fb9];return _0x36c108;};'use strict';var Sequelize=require(_0x69d5('0x0'));module[_0x69d5('0x1')]={'name':{'type':Sequelize[_0x69d5('0x2')],'unique':_0x69d5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x69d5('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x69d5('0x5')](_0x69d5('0x6'),_0x69d5('0x7'),_0x69d5('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xec50=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x157b5e,_0x48d4cb){var _0x51ae9e=function(_0x32ba06){while(--_0x32ba06){_0x157b5e['push'](_0x157b5e['shift']());}};_0x51ae9e(++_0x48d4cb);}(_0xec50,0x88));var _0x0ec5=function(_0x47dcb1,_0x2e7067){_0x47dcb1=_0x47dcb1-0x0;var _0x532b9f=_0xec50[_0x47dcb1];return _0x532b9f;};'use strict';var Sequelize=require(_0x0ec5('0x0'));module[_0x0ec5('0x1')]={'name':{'type':Sequelize[_0x0ec5('0x2')],'unique':_0x0ec5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0ec5('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0ec5('0x5'),'beepall',_0x0ec5('0x6')),'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 470efd1..513c79c 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 _0x2869=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserFaxQueue','nolimit','FaxQueueId','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','getTeams','Team','User','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','FaxQueues'];(function(_0x222fe7,_0x4ff31a){var _0x2d9aa1=function(_0x53fd75){while(--_0x53fd75){_0x222fe7['push'](_0x222fe7['shift']());}};_0x2d9aa1(++_0x4ff31a);}(_0x2869,0x1e6));var _0x9286=function(_0x10a572,_0x581330){_0x10a572=_0x10a572-0x0;var _0x10f0c4=_0x2869[_0x10a572];return _0x10f0c4;};'use strict';var emlformat=require(_0x9286('0x0'));var rimraf=require(_0x9286('0x1'));var zipdir=require(_0x9286('0x2'));var jsonpatch=require(_0x9286('0x3'));var rp=require(_0x9286('0x4'));var moment=require('moment');var BPromise=require(_0x9286('0x5'));var Mustache=require('mustache');var util=require(_0x9286('0x6'));var path=require(_0x9286('0x7'));var sox=require(_0x9286('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9286('0x9'));var _=require(_0x9286('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9286('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9286('0xc'));var querystring=require(_0x9286('0xd'));var Papa=require(_0x9286('0xe'));var Redis=require(_0x9286('0xf'));var authService=require(_0x9286('0x10'));var qs=require(_0x9286('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9286('0x12'));var logger=require(_0x9286('0x13'))('api');var utils=require(_0x9286('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9286('0x15'));var db=require(_0x9286('0x16'))['db'];config[_0x9286('0x17')]=_[_0x9286('0x18')](config[_0x9286('0x17')],{'host':_0x9286('0x19'),'port':0x18eb});var socket=require(_0x9286('0x1a'))(new Redis(config[_0x9286('0x17')]));require(_0x9286('0x1b'))[_0x9286('0x1c')](socket);function respondWithStatusCode(_0x255103,_0x3c11f6){_0x3c11f6=_0x3c11f6||0xcc;return function(_0xd17d5c){if(_0xd17d5c){return _0x255103[_0x9286('0x1d')](_0x3c11f6);}return _0x255103[_0x9286('0x1e')](_0x3c11f6)[_0x9286('0x1f')]();};}function respondWithResult(_0x22c917,_0x2bdba5){_0x2bdba5=_0x2bdba5||0xc8;return function(_0x298e9c){if(_0x298e9c){return _0x22c917[_0x9286('0x1e')](_0x2bdba5)[_0x9286('0x20')](_0x298e9c);}};}function respondWithFilteredResult(_0xd8e307,_0x9f23b){return function(_0x1d94f6){if(_0x1d94f6){var _0x277889=typeof _0x9f23b['offset']===_0x9286('0x21')&&typeof _0x9f23b[_0x9286('0x22')]==='undefined';var _0x54dca1=_0x1d94f6[_0x9286('0x23')];var _0x4f3acd=_0x277889?0x0:_0x9f23b[_0x9286('0x24')];var _0x410d1e=_0x277889?_0x1d94f6[_0x9286('0x23')]:_0x9f23b[_0x9286('0x24')]+_0x9f23b[_0x9286('0x22')];var _0x2f0720;if(_0x410d1e>=_0x54dca1){_0x410d1e=_0x54dca1;_0x2f0720=0xc8;}else{_0x2f0720=0xce;}_0xd8e307[_0x9286('0x1e')](_0x2f0720);return _0xd8e307[_0x9286('0x25')](_0x9286('0x26'),_0x4f3acd+'-'+_0x410d1e+'/'+_0x54dca1)[_0x9286('0x20')](_0x1d94f6);}return null;};}function patchUpdates(_0x319b73){return function(_0x3578af){try{jsonpatch[_0x9286('0x27')](_0x3578af,_0x319b73,!![]);}catch(_0x1b84d2){return BPromise[_0x9286('0x28')](_0x1b84d2);}return _0x3578af['save']();};}function saveUpdates(_0x47ca06,_0x1f772f){return function(_0x2267c3){if(_0x2267c3){return _0x2267c3['update'](_0x47ca06)[_0x9286('0x29')](function(_0x3289e9){return _0x3289e9;});}return null;};}function removeEntity(_0xebda6,_0x41251d){return function(_0x1e0d78){if(_0x1e0d78){return _0x1e0d78[_0x9286('0x2a')]()[_0x9286('0x29')](function(){var _0x57d894=_0x1e0d78['get']({'plain':!![]});var _0x19d9b6='FaxQueues';return db[_0x9286('0x2b')]['destroy']({'where':{'type':_0x19d9b6,'resourceId':_0x57d894['id']}})[_0x9286('0x29')](function(){return _0x1e0d78;});})['then'](function(){_0xebda6[_0x9286('0x1e')](0xcc)[_0x9286('0x1f')]();});}};}function handleEntityNotFound(_0x2ea769,_0x2014c1){return function(_0x2dfb71){if(!_0x2dfb71){_0x2ea769[_0x9286('0x1d')](0x194);}return _0x2dfb71;};}function handleError(_0x372e40,_0x310bd8){_0x310bd8=_0x310bd8||0x1f4;return function(_0x46b6ec){logger[_0x9286('0x2c')](_0x46b6ec[_0x9286('0x2d')]);if(_0x46b6ec[_0x9286('0x2e')]){delete _0x46b6ec[_0x9286('0x2e')];}_0x372e40[_0x9286('0x1e')](_0x310bd8)[_0x9286('0x2f')](_0x46b6ec);};}exports[_0x9286('0x30')]=function(_0xc18f01,_0x4f137f){var _0x4e67e6={},_0x3a697c={},_0x44cf6d={'count':0x0,'rows':[]};var _0x23f51a=_[_0x9286('0x31')](db[_0x9286('0x32')][_0x9286('0x33')],function(_0xed8992){return{'name':_0xed8992[_0x9286('0x34')],'type':_0xed8992[_0x9286('0x35')][_0x9286('0x36')]};});_0x3a697c[_0x9286('0x37')]=_[_0x9286('0x31')](_0x23f51a,_0x9286('0x2e'));_0x3a697c[_0x9286('0x38')]=_[_0x9286('0x39')](_0xc18f01[_0x9286('0x38')]);_0x3a697c[_0x9286('0x3a')]=_['intersection'](_0x3a697c['model'],_0x3a697c[_0x9286('0x38')]);_0x4e67e6[_0x9286('0x3b')]=_[_0x9286('0x3c')](_0x3a697c[_0x9286('0x37')],qs[_0x9286('0x3d')](_0xc18f01['query'][_0x9286('0x3d')]));_0x4e67e6[_0x9286('0x3b')]=_0x4e67e6[_0x9286('0x3b')][_0x9286('0x3e')]?_0x4e67e6['attributes']:_0x3a697c[_0x9286('0x37')];if(!_0xc18f01['query'][_0x9286('0x3f')]('nolimit')){_0x4e67e6[_0x9286('0x22')]=qs[_0x9286('0x22')](_0xc18f01['query'][_0x9286('0x22')]);_0x4e67e6[_0x9286('0x24')]=qs[_0x9286('0x24')](_0xc18f01['query'][_0x9286('0x24')]);}_0x4e67e6[_0x9286('0x40')]=qs[_0x9286('0x41')](_0xc18f01[_0x9286('0x38')][_0x9286('0x41')]);_0x4e67e6[_0x9286('0x42')]=qs[_0x9286('0x3a')](_[_0x9286('0x43')](_0xc18f01[_0x9286('0x38')],_0x3a697c[_0x9286('0x3a')]),_0x23f51a);if(_0xc18f01[_0x9286('0x38')][_0x9286('0x44')]){_0x4e67e6[_0x9286('0x42')]=_['merge'](_0x4e67e6['where'],{'$or':_[_0x9286('0x31')](_0x23f51a,function(_0x9a28bb){if(_0x9a28bb[_0x9286('0x35')]!==_0x9286('0x45')){var _0x1a45dc={};_0x1a45dc[_0x9a28bb[_0x9286('0x2e')]]={'$like':'%'+_0xc18f01['query'][_0x9286('0x44')]+'%'};return _0x1a45dc;}})});}_0x4e67e6=_[_0x9286('0x46')]({},_0x4e67e6,_0xc18f01[_0x9286('0x47')]);var _0x3edd59={'where':_0x4e67e6[_0x9286('0x42')]};return db[_0x9286('0x32')][_0x9286('0x23')](_0x3edd59)[_0x9286('0x29')](function(_0x2c781b){_0x44cf6d[_0x9286('0x23')]=_0x2c781b;if(_0xc18f01['query'][_0x9286('0x48')]){_0x4e67e6[_0x9286('0x49')]=[{'all':!![]}];}return db[_0x9286('0x32')][_0x9286('0x4a')](_0x4e67e6);})[_0x9286('0x29')](function(_0x9dc0a6){_0x44cf6d[_0x9286('0x4b')]=_0x9dc0a6;return _0x44cf6d;})[_0x9286('0x29')](respondWithFilteredResult(_0x4f137f,_0x4e67e6))[_0x9286('0x4c')](handleError(_0x4f137f,null));};exports[_0x9286('0x4d')]=function(_0x350a7a,_0x325cc6){var _0xc0dfbe={'raw':!![],'where':{'id':_0x350a7a[_0x9286('0x4e')]['id']}},_0x472005={};_0x472005[_0x9286('0x37')]=_[_0x9286('0x39')](db[_0x9286('0x32')][_0x9286('0x33')]);_0x472005['query']=_[_0x9286('0x39')](_0x350a7a[_0x9286('0x38')]);_0x472005[_0x9286('0x3a')]=_[_0x9286('0x3c')](_0x472005['model'],_0x472005[_0x9286('0x38')]);_0xc0dfbe[_0x9286('0x3b')]=_[_0x9286('0x3c')](_0x472005[_0x9286('0x37')],qs['fields'](_0x350a7a[_0x9286('0x38')][_0x9286('0x3d')]));_0xc0dfbe[_0x9286('0x3b')]=_0xc0dfbe[_0x9286('0x3b')]['length']?_0xc0dfbe['attributes']:_0x472005[_0x9286('0x37')];if(_0x350a7a[_0x9286('0x38')][_0x9286('0x48')]){_0xc0dfbe[_0x9286('0x49')]=[{'all':!![]}];}_0xc0dfbe=_[_0x9286('0x46')]({},_0xc0dfbe,_0x350a7a[_0x9286('0x47')]);return db[_0x9286('0x32')][_0x9286('0x4f')](_0xc0dfbe)[_0x9286('0x29')](handleEntityNotFound(_0x325cc6,null))[_0x9286('0x29')](respondWithResult(_0x325cc6,null))[_0x9286('0x4c')](handleError(_0x325cc6,null));};exports['create']=function(_0x31ffda,_0x1303b0){return db['FaxQueue'][_0x9286('0x50')](_0x31ffda[_0x9286('0x51')],{})[_0x9286('0x29')](function(_0x5a1b9f){var _0x1c877e=_0x31ffda[_0x9286('0x52')]['get']({'plain':!![]});if(!_0x1c877e)throw new Error(_0x9286('0x53'));if(_0x1c877e['role']===_0x9286('0x52')){var _0x317467=_0x5a1b9f[_0x9286('0x54')]({'plain':!![]});var _0xe93bfa=_0x9286('0x55');return db[_0x9286('0x56')][_0x9286('0x4f')]({'where':{'name':_0xe93bfa,'userProfileId':_0x1c877e[_0x9286('0x57')]},'raw':!![]})[_0x9286('0x29')](function(_0x24b87c){if(_0x24b87c&&_0x24b87c[_0x9286('0x58')]===0x0){return db['UserProfileResource'][_0x9286('0x50')]({'name':_0x317467[_0x9286('0x2e')],'resourceId':_0x317467['id'],'type':_0x24b87c[_0x9286('0x2e')],'sectionId':_0x24b87c['id']},{})['then'](function(){return _0x5a1b9f;});}else{return _0x5a1b9f;}})[_0x9286('0x4c')](function(_0x172de2){logger['error'](_0x9286('0x59'),_0x172de2);throw _0x172de2;});}return _0x5a1b9f;})['then'](respondWithResult(_0x1303b0,0xc9))[_0x9286('0x4c')](handleError(_0x1303b0,null));};exports[_0x9286('0x5a')]=function(_0x597769,_0xab5383){if(_0x597769['body']['id']){delete _0x597769[_0x9286('0x51')]['id'];}return db[_0x9286('0x32')][_0x9286('0x4f')]({'where':{'id':_0x597769['params']['id']}})[_0x9286('0x29')](handleEntityNotFound(_0xab5383,null))[_0x9286('0x29')](saveUpdates(_0x597769[_0x9286('0x51')],null))[_0x9286('0x29')](respondWithResult(_0xab5383,null))[_0x9286('0x4c')](handleError(_0xab5383,null));};exports['destroy']=function(_0x198635,_0x3d84ff){return db[_0x9286('0x32')][_0x9286('0x4f')]({'where':{'id':_0x198635[_0x9286('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d84ff,null))[_0x9286('0x29')](removeEntity(_0x3d84ff,null))['catch'](handleError(_0x3d84ff,null));};exports[_0x9286('0x5b')]=function(_0x35892b,_0x7b3873){return db[_0x9286('0x32')][_0x9286('0x5b')]()['then'](respondWithResult(_0x7b3873,null))[_0x9286('0x4c')](handleError(_0x7b3873,null));};exports['getMembers']=function(_0x1f4744,_0x370f45,_0x292860){var _0x68b8bd={'raw':!![],'where':{}},_0x202cbc={},_0x19a3dc;return db[_0x9286('0x32')][_0x9286('0x5c')]({'where':{'id':_0x1f4744[_0x9286('0x4e')]['id']}})[_0x9286('0x29')](handleEntityNotFound(_0x370f45,null))[_0x9286('0x29')](function(_0x5d9cd0){if(_0x5d9cd0){_0x19a3dc=_0x5d9cd0['get']({'plain':!![]});_0x202cbc[_0x9286('0x37')]=_[_0x9286('0x39')](db[_0x9286('0x5d')][_0x9286('0x33')]);_0x202cbc['query']=_[_0x9286('0x39')](_0x1f4744[_0x9286('0x38')]);_0x202cbc[_0x9286('0x3a')]=_[_0x9286('0x3c')](_0x202cbc[_0x9286('0x37')],_0x202cbc[_0x9286('0x38')]);_0x68b8bd[_0x9286('0x3b')]=_[_0x9286('0x3c')](_0x202cbc[_0x9286('0x37')],qs[_0x9286('0x3d')](_0x1f4744[_0x9286('0x38')][_0x9286('0x3d')]));_0x68b8bd[_0x9286('0x3b')]=_0x68b8bd[_0x9286('0x3b')][_0x9286('0x3e')]?_0x68b8bd['attributes']:_0x202cbc[_0x9286('0x37')];if(!_0x1f4744[_0x9286('0x38')]['hasOwnProperty'](_0x9286('0x5e'))){_0x68b8bd['limit']=qs[_0x9286('0x22')](_0x1f4744[_0x9286('0x38')][_0x9286('0x22')]);_0x68b8bd[_0x9286('0x24')]=qs[_0x9286('0x24')](_0x1f4744['query'][_0x9286('0x24')]);}_0x68b8bd[_0x9286('0x40')]=qs[_0x9286('0x41')](_0x1f4744[_0x9286('0x38')][_0x9286('0x41')]);_0x68b8bd[_0x9286('0x42')]=qs[_0x9286('0x3a')](_[_0x9286('0x43')](_0x1f4744['query'],_0x202cbc[_0x9286('0x3a')]));_0x68b8bd[_0x9286('0x42')][_0x9286('0x5f')]=_0x5d9cd0['id'];if(_0x1f4744[_0x9286('0x38')]['filter']){_0x68b8bd[_0x9286('0x42')]=_['merge'](_0x68b8bd[_0x9286('0x42')],{'$or':_['map'](_0x68b8bd[_0x9286('0x3b')],function(_0x4da987){var _0x27f0cb={};_0x27f0cb[_0x4da987]={'$like':'%'+_0x1f4744[_0x9286('0x38')]['filter']+'%'};return _0x27f0cb;})});}_0x68b8bd=_[_0x9286('0x46')]({},_0x68b8bd,_0x1f4744['options']);return db[_0x9286('0x5d')][_0x9286('0x4a')](_0x68b8bd);}})[_0x9286('0x29')](function(_0x456cf6){if(_0x456cf6){return db['User'][_0x9286('0x60')]({'where':{'id':_[_0x9286('0x31')](_0x456cf6,'UserId'),'role':_0x9286('0x61')},'attributes':['id',_0x9286('0x2e'),_0x9286('0x62'),_0x9286('0x63'),_0x9286('0x64')]});}})[_0x9286('0x29')](function(_0x56f067){if(_0x56f067){return{'count':_0x56f067[_0x9286('0x23')],'rows':_[_0x9286('0x31')](_0x56f067[_0x9286('0x4b')],function(_0x51c5ea){return{'membername':_0x51c5ea[_0x9286('0x2e')],'UserId':_0x51c5ea['id'],'queue_name':_0x19a3dc[_0x9286('0x2e')],'FaxQueueId':_0x19a3dc['id'],'interface':util[_0x9286('0x65')]('%s/%s','SIP',_0x51c5ea[_0x9286('0x2e')]),'penalty':0x0,'paused':_0x51c5ea[_0x9286('0x62')],'createdAt':_0x51c5ea[_0x9286('0x64')],'updatedAt':_0x51c5ea[_0x9286('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9286('0x29')](respondWithFilteredResult(_0x370f45,_0x68b8bd))[_0x9286('0x4c')](handleError(_0x370f45,null));};exports[_0x9286('0x66')]=function(_0x277429,_0x40cef3,_0x6e8bb4){var _0x3bcba1={};var _0x16542f={};var _0x489478;var _0x67c532;return db[_0x9286('0x32')][_0x9286('0x5c')]({'where':{'id':_0x277429['params']['id']}})[_0x9286('0x29')](handleEntityNotFound(_0x40cef3,null))[_0x9286('0x29')](function(_0x300288){if(_0x300288){_0x489478=_0x300288;_0x16542f[_0x9286('0x37')]=_[_0x9286('0x39')](db[_0x9286('0x67')][_0x9286('0x33')]);_0x16542f[_0x9286('0x38')]=_[_0x9286('0x39')](_0x277429['query']);_0x16542f[_0x9286('0x3a')]=_[_0x9286('0x3c')](_0x16542f[_0x9286('0x37')],_0x16542f[_0x9286('0x38')]);_0x3bcba1[_0x9286('0x3b')]=_[_0x9286('0x3c')](_0x16542f[_0x9286('0x37')],qs[_0x9286('0x3d')](_0x277429[_0x9286('0x38')][_0x9286('0x3d')]));_0x3bcba1[_0x9286('0x3b')]=_0x3bcba1[_0x9286('0x3b')][_0x9286('0x3e')]?_0x3bcba1[_0x9286('0x3b')]:_0x16542f[_0x9286('0x37')];_0x3bcba1['order']=qs[_0x9286('0x41')](_0x277429['query']['sort']);_0x3bcba1[_0x9286('0x42')]=qs['filters'](_[_0x9286('0x43')](_0x277429[_0x9286('0x38')],_0x16542f['filters']));if(_0x277429['query'][_0x9286('0x44')]){_0x3bcba1[_0x9286('0x42')]=_[_0x9286('0x46')](_0x3bcba1[_0x9286('0x42')],{'$or':_[_0x9286('0x31')](_0x3bcba1[_0x9286('0x3b')],function(_0x371fb6){var _0x4f010e={};_0x4f010e[_0x371fb6]={'$like':'%'+_0x277429[_0x9286('0x38')][_0x9286('0x44')]+'%'};return _0x4f010e;})});}_0x3bcba1=_['merge']({},_0x3bcba1,_0x277429[_0x9286('0x47')]);return _0x489478['getTeams'](_0x3bcba1);}})[_0x9286('0x29')](function(_0x53d17c){if(_0x53d17c){_0x67c532=_0x53d17c['length'];if(!_0x277429['query'][_0x9286('0x3f')](_0x9286('0x5e'))){_0x3bcba1[_0x9286('0x22')]=qs[_0x9286('0x22')](_0x277429[_0x9286('0x38')]['limit']);_0x3bcba1[_0x9286('0x24')]=qs[_0x9286('0x24')](_0x277429[_0x9286('0x38')][_0x9286('0x24')]);}return _0x489478[_0x9286('0x66')](_0x3bcba1);}})[_0x9286('0x29')](function(_0x2ccf97){if(_0x2ccf97){return _0x2ccf97?{'count':_0x67c532,'rows':_0x2ccf97}:null;}})[_0x9286('0x29')](respondWithResult(_0x40cef3,null))[_0x9286('0x4c')](handleError(_0x40cef3,null));};exports['addTeams']=function(_0x1658df,_0x1b18d9,_0x362505){var _0xa3dc5c=_0x1658df[_0x9286('0x51')]['ids'];return db['Team'][_0x9286('0x4a')]({'where':{'id':_0xa3dc5c},'attributes':['id'],'include':[{'model':db[_0x9286('0x68')],'as':_0x9286('0x69'),'attributes':['id','name','online',_0x9286('0x6a'),_0x9286('0x6b')],'raw':!![]}]})[_0x9286('0x29')](function(_0x2604ac){if(_0x2604ac){var _0xfe8b8d=_[_0x9286('0x6c')](_0x2604ac,function(_0x201b16){var _0x3025e5=_0x201b16[_0x9286('0x54')]({'plain':!![]});return _0x3025e5[_0x9286('0x69')];});return db['FaxQueue'][_0x9286('0x4f')]({'where':{'id':_0x1658df[_0x9286('0x4e')]['id']}})[_0x9286('0x29')](function(_0x88badb){return db[_0x9286('0x6d')][_0x9286('0x6e')](function(_0xaf542f){return _0x88badb[_0x9286('0x6f')](_0xa3dc5c,{'transaction':_0xaf542f})['then'](function(){return BPromise[_0x9286('0x70')](_0xfe8b8d,function(_0x172e73){return db[_0x9286('0x5d')]['findOrCreate']({'where':{'UserId':_0x172e73['id'],'FaxQueueId':_0x1658df['params']['id']},'transaction':_0xaf542f});});})[_0x9286('0x29')](function(){_0xfe8b8d[_0x9286('0x71')](function(_0x403251){socket[_0x9286('0x72')](_0x9286('0x73'),{'UserId':_0x403251['id'],'FaxQueueId':_0x88badb['id']});});});});});}})['then'](respondWithStatusCode(_0x1b18d9,null))[_0x9286('0x4c')](handleError(_0x1b18d9,null));};exports[_0x9286('0x74')]=function(_0x25bf15,_0x65418f,_0x3e16a4){return db['Team'][_0x9286('0x4a')]({'where':{'id':_0x25bf15[_0x9286('0x38')][_0x9286('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9286('0x29')](handleEntityNotFound(_0x65418f,null))[_0x9286('0x29')](function(_0x38f63c){var _0x3c1d46=_[_0x9286('0x31')](_0x38f63c,'id');var _0x1c40de=[];var _0x24a962=[];var _0x189d78=squel[_0x9286('0x76')]();_0x189d78['field'](_0x9286('0x77'))['from'](_0x9286('0x78'),'tq')[_0x9286('0x79')](_0x9286('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9286('0x42')](_0x9286('0x7b'),_0x25bf15[_0x9286('0x4e')]['id']);for(var _0x2acf3d=0x0;_0x2acf3d<_0x38f63c[_0x9286('0x3e')];_0x2acf3d+=0x1){let _0x1f67c3=_0x38f63c[_0x2acf3d];for(var _0x5b3a53=0x0;_0x5b3a53<_0x1f67c3[_0x9286('0x69')]['length'];_0x5b3a53+=0x1){let _0x5f3921=_0x1f67c3[_0x9286('0x69')][_0x5b3a53];var _0x4bb231=_0x189d78[_0x9286('0x7c')]();_0x4bb231[_0x9286('0x42')](_0x9286('0x7d'),_0x5f3921['id']);_0x24a962[_0x9286('0x7e')](db[_0x9286('0x6d')]['query'](_0x4bb231['toString'](),{'type':db[_0x9286('0x6d')][_0x9286('0x7f')][_0x9286('0x80')]})[_0x9286('0x29')](function(_0x3cd969){if(_0x3cd969[_0x9286('0x3e')]===0x1){return _0x5f3921['id'];}else{var _0x579def=_[_0x9286('0x81')](_['map'](_0x3cd969,_0x9286('0x82')),function(_0x5e4f2c){return _[_0x9286('0x83')](_0x3c1d46,_0x5e4f2c);});if(_0x579def){return _0x5f3921['id'];}}}));}}return BPromise[_0x9286('0x84')](_0x24a962)[_0x9286('0x29')](function(_0x557c2e){_0x1c40de=_(_0x1c40de)[_0x9286('0x85')](_0x557c2e)[_0x9286('0x86')]()[_0x9286('0x87')]();return db[_0x9286('0x32')][_0x9286('0x4f')]({'where':{'id':_0x25bf15[_0x9286('0x4e')]['id']}})[_0x9286('0x29')](function(_0x31240e){return db['sequelize']['transaction'](function(_0x558ec6){return _0x31240e[_0x9286('0x74')](_0x25bf15[_0x9286('0x38')][_0x9286('0x75')],{'transaction':_0x558ec6})[_0x9286('0x29')](function(){if(!_[_0x9286('0x88')](_0x1c40de)){return _0x31240e[_0x9286('0x89')](_0x1c40de,{'transaction':_0x558ec6});}})[_0x9286('0x29')](function(){_0x1c40de[_0x9286('0x71')](function(_0x7e9c39){socket[_0x9286('0x72')](_0x9286('0x8a'),{'UserId':_0x7e9c39,'FaxQueueId':_0x31240e['id']});});});});});});})[_0x9286('0x29')](respondWithStatusCode(_0x65418f,null))[_0x9286('0x4c')](handleError(_0x65418f,null));};exports[_0x9286('0x8b')]=function(_0x3ac445,_0xbb722c,_0xc738e6){return db[_0x9286('0x32')]['find']({'where':{'id':_0x3ac445['params']['id']}})['then'](handleEntityNotFound(_0xbb722c,null))[_0x9286('0x29')](function(_0x51c1fb){if(_0x51c1fb){return _0x51c1fb[_0x9286('0x8b')](_0x3ac445[_0x9286('0x51')][_0x9286('0x75')],_[_0x9286('0x8c')](_0x3ac445[_0x9286('0x51')],[_0x9286('0x75'),'id'])||{})[_0x9286('0x8d')](function(_0x2f5d2f){for(var _0x140890=0x0;_0x140890<_0x3ac445[_0x9286('0x51')][_0x9286('0x75')][_0x9286('0x3e')];_0x140890+=0x1){socket[_0x9286('0x72')]('userFaxQueue:save',{'UserId':Number(_0x3ac445[_0x9286('0x51')][_0x9286('0x75')][_0x140890]),'FaxQueueId':Number(_0x3ac445['params']['id'])});}return _0x2f5d2f;});}})[_0x9286('0x29')](respondWithResult(_0xbb722c,null))['catch'](handleError(_0xbb722c,null));};exports['removeAgents']=function(_0x2bc9d5,_0x2bebb8,_0x4c336b){return db['FaxQueue'][_0x9286('0x4f')]({'where':{'id':_0x2bc9d5[_0x9286('0x4e')]['id']}})[_0x9286('0x29')](handleEntityNotFound(_0x2bebb8,null))['then'](function(_0x522c25){if(_0x522c25){return _0x522c25[_0x9286('0x89')](_0x2bc9d5['query']['ids'])[_0x9286('0x29')](function(){if(_['isArray'](_0x2bc9d5['query'][_0x9286('0x75')])){for(var _0x521837=0x0;_0x521837<_0x2bc9d5[_0x9286('0x38')][_0x9286('0x75')][_0x9286('0x3e')];_0x521837+=0x1){socket[_0x9286('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x2bc9d5['query']['ids'][_0x521837]),'FaxQueueId':Number(_0x2bc9d5['params']['id'])});}}else{socket['emit'](_0x9286('0x8a'),{'UserId':Number(_0x2bc9d5[_0x9286('0x38')][_0x9286('0x75')]),'FaxQueueId':Number(_0x2bc9d5[_0x9286('0x4e')]['id'])});}});}})[_0x9286('0x29')](respondWithStatusCode(_0x2bebb8,null))[_0x9286('0x4c')](handleError(_0x2bebb8,null));};exports[_0x9286('0x8e')]=function(_0x215b93,_0x497924,_0xc6fbc1){var _0x2ffdfc={};var _0x21a7be={};var _0x226a8c;var _0x7c170d;return db[_0x9286('0x32')][_0x9286('0x5c')]({'where':{'id':_0x215b93[_0x9286('0x4e')]['id']}})['then'](handleEntityNotFound(_0x497924,null))[_0x9286('0x29')](function(_0x2600e1){if(_0x2600e1){_0x226a8c=_0x2600e1;_0x21a7be[_0x9286('0x37')]=_['keys'](db[_0x9286('0x68')][_0x9286('0x33')]);_0x21a7be['query']=_[_0x9286('0x39')](_0x215b93[_0x9286('0x38')]);_0x21a7be[_0x9286('0x3a')]=_[_0x9286('0x3c')](_0x21a7be['model'],_0x21a7be['query']);_0x2ffdfc['attributes']=_['intersection'](_0x21a7be[_0x9286('0x37')],qs[_0x9286('0x3d')](_0x215b93[_0x9286('0x38')]['fields']));_0x2ffdfc[_0x9286('0x3b')]=_0x2ffdfc[_0x9286('0x3b')]['length']?_0x2ffdfc['attributes']:_0x21a7be[_0x9286('0x37')];_0x2ffdfc[_0x9286('0x40')]=qs[_0x9286('0x41')](_0x215b93['query'][_0x9286('0x41')]);_0x2ffdfc[_0x9286('0x42')]=qs[_0x9286('0x3a')](_[_0x9286('0x43')](_0x215b93[_0x9286('0x38')],_0x21a7be['filters']));if(_0x215b93[_0x9286('0x38')][_0x9286('0x44')]){_0x2ffdfc['where']=_[_0x9286('0x46')](_0x2ffdfc[_0x9286('0x42')],{'$or':_[_0x9286('0x31')](_0x2ffdfc[_0x9286('0x3b')],function(_0x101d71){var _0x45963c={};_0x45963c[_0x101d71]={'$like':'%'+_0x215b93[_0x9286('0x38')][_0x9286('0x44')]+'%'};return _0x45963c;})});}_0x2ffdfc=_[_0x9286('0x46')]({},_0x2ffdfc,_0x215b93[_0x9286('0x47')]);return _0x226a8c[_0x9286('0x8e')](_0x2ffdfc);}})[_0x9286('0x29')](function(_0x22362b){if(_0x22362b){_0x7c170d=_0x22362b['length'];if(!_0x215b93['query'][_0x9286('0x3f')](_0x9286('0x5e'))){_0x2ffdfc[_0x9286('0x22')]=qs['limit'](_0x215b93[_0x9286('0x38')][_0x9286('0x22')]);_0x2ffdfc['offset']=qs['offset'](_0x215b93[_0x9286('0x38')]['offset']);}return _0x226a8c[_0x9286('0x8e')](_0x2ffdfc);}})[_0x9286('0x29')](function(_0x1fcf08){if(_0x1fcf08){return _0x1fcf08?{'count':_0x7c170d,'rows':_0x1fcf08}:null;}})['then'](respondWithResult(_0x497924,null))[_0x9286('0x4c')](handleError(_0x497924,null));}; \ No newline at end of file +var _0x9210=['FaxQueue','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','type','merge','options','include','findAll','rows','catch','show','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','FaxQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','nolimit','FaxQueueId','User','UserId','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','Agents','interface','flatMap','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','ids','field','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','includes','all','union','isEmpty','userFaxQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','map'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x9210,0x1f2));var _0x0921=function(_0x50bbe0,_0x21b194){_0x50bbe0=_0x50bbe0-0x0;var _0x3a6b27=_0x9210[_0x50bbe0];return _0x3a6b27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0921('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0921('0x1'));var rp=require(_0x0921('0x2'));var moment=require(_0x0921('0x3'));var BPromise=require(_0x0921('0x4'));var Mustache=require(_0x0921('0x5'));var util=require(_0x0921('0x6'));var path=require(_0x0921('0x7'));var sox=require(_0x0921('0x8'));var csv=require(_0x0921('0x9'));var ejs=require(_0x0921('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0921('0xb'));var squel=require(_0x0921('0xc'));var crypto=require('crypto');var jsforce=require(_0x0921('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0921('0x9'));var querystring=require(_0x0921('0xe'));var Papa=require(_0x0921('0xf'));var Redis=require(_0x0921('0x10'));var authService=require(_0x0921('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0921('0x12'));var hardwareService=require(_0x0921('0x13'));var logger=require(_0x0921('0x14'))(_0x0921('0x15'));var utils=require(_0x0921('0x16'));var config=require(_0x0921('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0921('0x18'))['db'];config[_0x0921('0x19')]=_[_0x0921('0x1a')](config[_0x0921('0x19')],{'host':_0x0921('0x1b'),'port':0x18eb});var socket=require(_0x0921('0x1c'))(new Redis(config[_0x0921('0x19')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x1abd6e,_0xb08e5c){_0xb08e5c=_0xb08e5c||0xcc;return function(_0x196c1e){if(_0x196c1e){return _0x1abd6e[_0x0921('0x1d')](_0xb08e5c);}return _0x1abd6e[_0x0921('0x1e')](_0xb08e5c)[_0x0921('0x1f')]();};}function respondWithResult(_0x1d6120,_0x53e6f3){_0x53e6f3=_0x53e6f3||0xc8;return function(_0x46a736){if(_0x46a736){return _0x1d6120[_0x0921('0x1e')](_0x53e6f3)[_0x0921('0x20')](_0x46a736);}};}function respondWithFilteredResult(_0x2a9d75,_0x493b88){return function(_0x31798d){if(_0x31798d){var _0x2e82d9=typeof _0x493b88['offset']===_0x0921('0x21')&&typeof _0x493b88[_0x0921('0x22')]===_0x0921('0x21');var _0x3077fd=_0x31798d[_0x0921('0x23')];var _0x4e792b=_0x2e82d9?0x0:_0x493b88[_0x0921('0x24')];var _0xd237fe=_0x2e82d9?_0x31798d[_0x0921('0x23')]:_0x493b88['offset']+_0x493b88[_0x0921('0x22')];var _0x4eefc3;if(_0xd237fe>=_0x3077fd){_0xd237fe=_0x3077fd;_0x4eefc3=0xc8;}else{_0x4eefc3=0xce;}_0x2a9d75[_0x0921('0x1e')](_0x4eefc3);return _0x2a9d75[_0x0921('0x25')](_0x0921('0x26'),_0x4e792b+'-'+_0xd237fe+'/'+_0x3077fd)[_0x0921('0x20')](_0x31798d);}return null;};}function patchUpdates(_0x2c77c0){return function(_0x5e87b5){try{jsonpatch['apply'](_0x5e87b5,_0x2c77c0,!![]);}catch(_0x3884ba){return BPromise[_0x0921('0x27')](_0x3884ba);}return _0x5e87b5[_0x0921('0x28')]();};}function saveUpdates(_0x51479,_0x34fc63){return function(_0x4e7abe){if(_0x4e7abe){return _0x4e7abe[_0x0921('0x29')](_0x51479)[_0x0921('0x2a')](function(_0x10cad4){return _0x10cad4;});}return null;};}function removeEntity(_0x3a9bec,_0x38c645){return function(_0x14f976){if(_0x14f976){return _0x14f976[_0x0921('0x2b')]()['then'](function(){var _0x672ecb=_0x14f976['get']({'plain':!![]});var _0x29a829='FaxQueues';return db[_0x0921('0x2c')]['destroy']({'where':{'type':_0x29a829,'resourceId':_0x672ecb['id']}})[_0x0921('0x2a')](function(){return _0x14f976;});})[_0x0921('0x2a')](function(){_0x3a9bec[_0x0921('0x1e')](0xcc)[_0x0921('0x1f')]();});}};}function handleEntityNotFound(_0x5ac459,_0x2ed0ef){return function(_0x10e075){if(!_0x10e075){_0x5ac459[_0x0921('0x1d')](0x194);}return _0x10e075;};}function handleError(_0x47abc1,_0x2bd5d2){_0x2bd5d2=_0x2bd5d2||0x1f4;return function(_0x2ffef4){logger[_0x0921('0x2d')](_0x2ffef4[_0x0921('0x2e')]);if(_0x2ffef4[_0x0921('0x2f')]){delete _0x2ffef4[_0x0921('0x2f')];}_0x47abc1[_0x0921('0x1e')](_0x2bd5d2)[_0x0921('0x30')](_0x2ffef4);};}exports['index']=function(_0x8a3c69,_0x57c393){var _0x1d196d={},_0x1bc349={},_0x56456f={'count':0x0,'rows':[]};var _0x3b023c=_[_0x0921('0x31')](db[_0x0921('0x32')][_0x0921('0x33')],function(_0x3fbbf7){return{'name':_0x3fbbf7[_0x0921('0x34')],'type':_0x3fbbf7['type'][_0x0921('0x35')]};});_0x1bc349[_0x0921('0x36')]=_[_0x0921('0x31')](_0x3b023c,_0x0921('0x2f'));_0x1bc349[_0x0921('0x37')]=_['keys'](_0x8a3c69['query']);_0x1bc349['filters']=_['intersection'](_0x1bc349['model'],_0x1bc349[_0x0921('0x37')]);_0x1d196d[_0x0921('0x38')]=_[_0x0921('0x39')](_0x1bc349[_0x0921('0x36')],qs[_0x0921('0x3a')](_0x8a3c69[_0x0921('0x37')]['fields']));_0x1d196d['attributes']=_0x1d196d[_0x0921('0x38')]['length']?_0x1d196d[_0x0921('0x38')]:_0x1bc349[_0x0921('0x36')];if(!_0x8a3c69[_0x0921('0x37')][_0x0921('0x3b')]('nolimit')){_0x1d196d['limit']=qs[_0x0921('0x22')](_0x8a3c69['query']['limit']);_0x1d196d['offset']=qs[_0x0921('0x24')](_0x8a3c69['query'][_0x0921('0x24')]);}_0x1d196d[_0x0921('0x3c')]=qs['sort'](_0x8a3c69[_0x0921('0x37')][_0x0921('0x3d')]);_0x1d196d[_0x0921('0x3e')]=qs[_0x0921('0x3f')](_[_0x0921('0x40')](_0x8a3c69['query'],_0x1bc349[_0x0921('0x3f')]),_0x3b023c);if(_0x8a3c69[_0x0921('0x37')][_0x0921('0x41')]){_0x1d196d[_0x0921('0x3e')]=_['merge'](_0x1d196d['where'],{'$or':_[_0x0921('0x31')](_0x3b023c,function(_0x219439){if(_0x219439[_0x0921('0x42')]!=='VIRTUAL'){var _0x51ab91={};_0x51ab91[_0x219439[_0x0921('0x2f')]]={'$like':'%'+_0x8a3c69['query'][_0x0921('0x41')]+'%'};return _0x51ab91;}})});}_0x1d196d=_[_0x0921('0x43')]({},_0x1d196d,_0x8a3c69[_0x0921('0x44')]);var _0xe665f7={'where':_0x1d196d[_0x0921('0x3e')]};return db['FaxQueue']['count'](_0xe665f7)['then'](function(_0x23e9c1){_0x56456f[_0x0921('0x23')]=_0x23e9c1;if(_0x8a3c69[_0x0921('0x37')]['includeAll']){_0x1d196d[_0x0921('0x45')]=[{'all':!![]}];}return db[_0x0921('0x32')][_0x0921('0x46')](_0x1d196d);})[_0x0921('0x2a')](function(_0x7c1f43){_0x56456f[_0x0921('0x47')]=_0x7c1f43;return _0x56456f;})[_0x0921('0x2a')](respondWithFilteredResult(_0x57c393,_0x1d196d))[_0x0921('0x48')](handleError(_0x57c393,null));};exports[_0x0921('0x49')]=function(_0x217675,_0x3ef574){var _0x3763e4={'raw':!![],'where':{'id':_0x217675[_0x0921('0x4a')]['id']}},_0x718751={};_0x718751[_0x0921('0x36')]=_[_0x0921('0x4b')](db[_0x0921('0x32')][_0x0921('0x33')]);_0x718751[_0x0921('0x37')]=_[_0x0921('0x4b')](_0x217675[_0x0921('0x37')]);_0x718751['filters']=_[_0x0921('0x39')](_0x718751[_0x0921('0x36')],_0x718751[_0x0921('0x37')]);_0x3763e4[_0x0921('0x38')]=_[_0x0921('0x39')](_0x718751[_0x0921('0x36')],qs[_0x0921('0x3a')](_0x217675['query'][_0x0921('0x3a')]));_0x3763e4[_0x0921('0x38')]=_0x3763e4[_0x0921('0x38')][_0x0921('0x4c')]?_0x3763e4[_0x0921('0x38')]:_0x718751[_0x0921('0x36')];if(_0x217675[_0x0921('0x37')]['includeAll']){_0x3763e4[_0x0921('0x45')]=[{'all':!![]}];}_0x3763e4=_[_0x0921('0x43')]({},_0x3763e4,_0x217675[_0x0921('0x44')]);return db['FaxQueue'][_0x0921('0x4d')](_0x3763e4)[_0x0921('0x2a')](handleEntityNotFound(_0x3ef574,null))['then'](respondWithResult(_0x3ef574,null))[_0x0921('0x48')](handleError(_0x3ef574,null));};exports['create']=function(_0x446d07,_0xe92756){return db[_0x0921('0x32')][_0x0921('0x4e')](_0x446d07['body'],{})['then'](function(_0x248875){var _0x473869=_0x446d07[_0x0921('0x4f')]['get']({'plain':!![]});if(!_0x473869)throw new Error(_0x0921('0x50'));if(_0x473869[_0x0921('0x51')]===_0x0921('0x4f')){var _0x5bea80=_0x248875[_0x0921('0x52')]({'plain':!![]});var _0x45622b=_0x0921('0x53');return db[_0x0921('0x54')][_0x0921('0x4d')]({'where':{'name':_0x45622b,'userProfileId':_0x473869[_0x0921('0x55')]},'raw':!![]})[_0x0921('0x2a')](function(_0x58dac5){if(_0x58dac5&&_0x58dac5['autoAssociation']===0x0){return db[_0x0921('0x2c')][_0x0921('0x4e')]({'name':_0x5bea80[_0x0921('0x2f')],'resourceId':_0x5bea80['id'],'type':_0x58dac5[_0x0921('0x2f')],'sectionId':_0x58dac5['id']},{})['then'](function(){return _0x248875;});}else{return _0x248875;}})[_0x0921('0x48')](function(_0x1c5580){logger[_0x0921('0x2d')](_0x0921('0x56'),_0x1c5580);throw _0x1c5580;});}return _0x248875;})['then'](respondWithResult(_0xe92756,0xc9))['catch'](handleError(_0xe92756,null));};exports[_0x0921('0x29')]=function(_0x5d28f9,_0x5a3918){if(_0x5d28f9[_0x0921('0x57')]['id']){delete _0x5d28f9[_0x0921('0x57')]['id'];}return db[_0x0921('0x32')][_0x0921('0x4d')]({'where':{'id':_0x5d28f9[_0x0921('0x4a')]['id']}})[_0x0921('0x2a')](handleEntityNotFound(_0x5a3918,null))[_0x0921('0x2a')](saveUpdates(_0x5d28f9['body'],null))['then'](respondWithResult(_0x5a3918,null))[_0x0921('0x48')](handleError(_0x5a3918,null));};exports[_0x0921('0x2b')]=function(_0x42e60a,_0x3e264a){return db[_0x0921('0x32')][_0x0921('0x4d')]({'where':{'id':_0x42e60a[_0x0921('0x4a')]['id']}})[_0x0921('0x2a')](handleEntityNotFound(_0x3e264a,null))[_0x0921('0x2a')](removeEntity(_0x3e264a,null))[_0x0921('0x48')](handleError(_0x3e264a,null));};exports[_0x0921('0x58')]=function(_0x2fd6c8,_0x3a425c){return db[_0x0921('0x32')][_0x0921('0x58')]()['then'](respondWithResult(_0x3a425c,null))['catch'](handleError(_0x3a425c,null));};exports[_0x0921('0x59')]=function(_0x5b9ab2,_0x362a29,_0x52c4c1){var _0x174b17={'raw':!![],'where':{}},_0x1b03b5={},_0x4573d8;return db[_0x0921('0x32')][_0x0921('0x5a')]({'where':{'id':_0x5b9ab2[_0x0921('0x4a')]['id']}})['then'](handleEntityNotFound(_0x362a29,null))[_0x0921('0x2a')](function(_0x15adbb){if(_0x15adbb){_0x4573d8=_0x15adbb[_0x0921('0x52')]({'plain':!![]});_0x1b03b5[_0x0921('0x36')]=_[_0x0921('0x4b')](db[_0x0921('0x5b')][_0x0921('0x33')]);_0x1b03b5[_0x0921('0x37')]=_['keys'](_0x5b9ab2['query']);_0x1b03b5[_0x0921('0x3f')]=_[_0x0921('0x39')](_0x1b03b5[_0x0921('0x36')],_0x1b03b5['query']);_0x174b17[_0x0921('0x38')]=_[_0x0921('0x39')](_0x1b03b5[_0x0921('0x36')],qs[_0x0921('0x3a')](_0x5b9ab2[_0x0921('0x37')]['fields']));_0x174b17[_0x0921('0x38')]=_0x174b17[_0x0921('0x38')][_0x0921('0x4c')]?_0x174b17[_0x0921('0x38')]:_0x1b03b5['model'];if(!_0x5b9ab2[_0x0921('0x37')][_0x0921('0x3b')](_0x0921('0x5c'))){_0x174b17[_0x0921('0x22')]=qs[_0x0921('0x22')](_0x5b9ab2[_0x0921('0x37')]['limit']);_0x174b17[_0x0921('0x24')]=qs[_0x0921('0x24')](_0x5b9ab2[_0x0921('0x37')][_0x0921('0x24')]);}_0x174b17[_0x0921('0x3c')]=qs['sort'](_0x5b9ab2[_0x0921('0x37')][_0x0921('0x3d')]);_0x174b17[_0x0921('0x3e')]=qs['filters'](_[_0x0921('0x40')](_0x5b9ab2[_0x0921('0x37')],_0x1b03b5[_0x0921('0x3f')]));_0x174b17[_0x0921('0x3e')][_0x0921('0x5d')]=_0x15adbb['id'];if(_0x5b9ab2[_0x0921('0x37')]['filter']){_0x174b17[_0x0921('0x3e')]=_['merge'](_0x174b17['where'],{'$or':_[_0x0921('0x31')](_0x174b17[_0x0921('0x38')],function(_0x166c99){var _0x1295bc={};_0x1295bc[_0x166c99]={'$like':'%'+_0x5b9ab2[_0x0921('0x37')][_0x0921('0x41')]+'%'};return _0x1295bc;})});}_0x174b17=_[_0x0921('0x43')]({},_0x174b17,_0x5b9ab2[_0x0921('0x44')]);return db[_0x0921('0x5b')][_0x0921('0x46')](_0x174b17);}})[_0x0921('0x2a')](function(_0x4ca667){if(_0x4ca667){return db[_0x0921('0x5e')]['findAndCountAll']({'where':{'id':_[_0x0921('0x31')](_0x4ca667,_0x0921('0x5f')),'role':_0x0921('0x60')},'attributes':['id','name',_0x0921('0x61'),_0x0921('0x62'),_0x0921('0x63')]});}})['then'](function(_0x12bc85){if(_0x12bc85){return{'count':_0x12bc85[_0x0921('0x23')],'rows':_[_0x0921('0x31')](_0x12bc85[_0x0921('0x47')],function(_0xfb0cec){return{'membername':_0xfb0cec[_0x0921('0x2f')],'UserId':_0xfb0cec['id'],'queue_name':_0x4573d8['name'],'FaxQueueId':_0x4573d8['id'],'interface':util[_0x0921('0x64')]('%s/%s',_0x0921('0x65'),_0xfb0cec[_0x0921('0x2f')]),'penalty':0x0,'paused':_0xfb0cec[_0x0921('0x61')],'createdAt':_0xfb0cec[_0x0921('0x63')],'updatedAt':_0xfb0cec[_0x0921('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0921('0x2a')](respondWithFilteredResult(_0x362a29,_0x174b17))['catch'](handleError(_0x362a29,null));};exports[_0x0921('0x66')]=function(_0x4f13e6,_0x466153,_0xeac9df){var _0x22b1dd={};var _0x28f821={};var _0x4b974c;var _0x509d00;return db['FaxQueue']['findOne']({'where':{'id':_0x4f13e6[_0x0921('0x4a')]['id']}})[_0x0921('0x2a')](handleEntityNotFound(_0x466153,null))[_0x0921('0x2a')](function(_0x5e92ae){if(_0x5e92ae){_0x4b974c=_0x5e92ae;_0x28f821[_0x0921('0x36')]=_['keys'](db[_0x0921('0x67')]['rawAttributes']);_0x28f821[_0x0921('0x37')]=_[_0x0921('0x4b')](_0x4f13e6[_0x0921('0x37')]);_0x28f821['filters']=_[_0x0921('0x39')](_0x28f821[_0x0921('0x36')],_0x28f821[_0x0921('0x37')]);_0x22b1dd[_0x0921('0x38')]=_[_0x0921('0x39')](_0x28f821['model'],qs[_0x0921('0x3a')](_0x4f13e6['query'][_0x0921('0x3a')]));_0x22b1dd[_0x0921('0x38')]=_0x22b1dd[_0x0921('0x38')][_0x0921('0x4c')]?_0x22b1dd[_0x0921('0x38')]:_0x28f821[_0x0921('0x36')];_0x22b1dd[_0x0921('0x3c')]=qs[_0x0921('0x3d')](_0x4f13e6[_0x0921('0x37')][_0x0921('0x3d')]);_0x22b1dd['where']=qs[_0x0921('0x3f')](_[_0x0921('0x40')](_0x4f13e6[_0x0921('0x37')],_0x28f821[_0x0921('0x3f')]));if(_0x4f13e6['query'][_0x0921('0x41')]){_0x22b1dd[_0x0921('0x3e')]=_['merge'](_0x22b1dd[_0x0921('0x3e')],{'$or':_['map'](_0x22b1dd['attributes'],function(_0x14dd6d){var _0x51c888={};_0x51c888[_0x14dd6d]={'$like':'%'+_0x4f13e6[_0x0921('0x37')]['filter']+'%'};return _0x51c888;})});}_0x22b1dd=_['merge']({},_0x22b1dd,_0x4f13e6['options']);return _0x4b974c[_0x0921('0x66')](_0x22b1dd);}})['then'](function(_0x4af6e1){if(_0x4af6e1){_0x509d00=_0x4af6e1[_0x0921('0x4c')];if(!_0x4f13e6[_0x0921('0x37')]['hasOwnProperty'](_0x0921('0x5c'))){_0x22b1dd[_0x0921('0x22')]=qs[_0x0921('0x22')](_0x4f13e6['query'][_0x0921('0x22')]);_0x22b1dd['offset']=qs[_0x0921('0x24')](_0x4f13e6[_0x0921('0x37')][_0x0921('0x24')]);}return _0x4b974c['getTeams'](_0x22b1dd);}})[_0x0921('0x2a')](function(_0x1bad67){if(_0x1bad67){return _0x1bad67?{'count':_0x509d00,'rows':_0x1bad67}:null;}})[_0x0921('0x2a')](respondWithResult(_0x466153,null))[_0x0921('0x48')](handleError(_0x466153,null));};exports[_0x0921('0x68')]=function(_0x4d6c1d,_0x15852b,_0x55db27){var _0x3c779e=_0x4d6c1d['body']['ids'];return db[_0x0921('0x67')][_0x0921('0x46')]({'where':{'id':_0x3c779e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0921('0x69'),'attributes':['id',_0x0921('0x2f'),'online','voicePause',_0x0921('0x6a')],'raw':!![]}]})[_0x0921('0x2a')](function(_0x160181){if(_0x160181){var _0x1ee17d=_[_0x0921('0x6b')](_0x160181,function(_0xb3f60){var _0x5d8bfb=_0xb3f60[_0x0921('0x52')]({'plain':!![]});return _0x5d8bfb[_0x0921('0x69')];});return db[_0x0921('0x32')]['find']({'where':{'id':_0x4d6c1d['params']['id']}})[_0x0921('0x2a')](function(_0x539e22){return db['sequelize'][_0x0921('0x6c')](function(_0x534301){return _0x539e22[_0x0921('0x68')](_0x3c779e,{'transaction':_0x534301})[_0x0921('0x2a')](function(){return BPromise[_0x0921('0x6d')](_0x1ee17d,function(_0x401e4b){return db[_0x0921('0x5b')][_0x0921('0x6e')]({'where':{'UserId':_0x401e4b['id'],'FaxQueueId':_0x4d6c1d[_0x0921('0x4a')]['id']},'transaction':_0x534301});});})[_0x0921('0x2a')](function(){_0x1ee17d['forEach'](function(_0x9b2f44){socket[_0x0921('0x6f')](_0x0921('0x70'),{'UserId':_0x9b2f44['id'],'FaxQueueId':_0x539e22['id']});});});});});}})[_0x0921('0x2a')](respondWithStatusCode(_0x15852b,null))[_0x0921('0x48')](handleError(_0x15852b,null));};exports[_0x0921('0x71')]=function(_0x5da42e,_0x31ea66,_0x378096){return db[_0x0921('0x67')][_0x0921('0x46')]({'where':{'id':_0x5da42e[_0x0921('0x37')][_0x0921('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0921('0x5e')],'as':_0x0921('0x69'),'attributes':['id'],'raw':!![]}]})[_0x0921('0x2a')](handleEntityNotFound(_0x31ea66,null))[_0x0921('0x2a')](function(_0x2ac86b){var _0xd1ff8e=_[_0x0921('0x31')](_0x2ac86b,'id');var _0x2e4255=[];var _0x381bcc=[];var _0x5b7b27=squel['select']();_0x5b7b27[_0x0921('0x73')]('tq.TeamId')[_0x0921('0x74')](_0x0921('0x75'),'tq')[_0x0921('0x76')](_0x0921('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0921('0x3e')](_0x0921('0x78'),_0x5da42e[_0x0921('0x4a')]['id']);for(var _0x308b4b=0x0;_0x308b4b<_0x2ac86b['length'];_0x308b4b+=0x1){let _0x9b010a=_0x2ac86b[_0x308b4b];for(var _0x1a16bf=0x0;_0x1a16bf<_0x9b010a[_0x0921('0x69')][_0x0921('0x4c')];_0x1a16bf+=0x1){let _0x33def3=_0x9b010a[_0x0921('0x69')][_0x1a16bf];var _0x351e86=_0x5b7b27[_0x0921('0x79')]();_0x351e86['where'](_0x0921('0x7a'),_0x33def3['id']);_0x381bcc['push'](db[_0x0921('0x7b')][_0x0921('0x37')](_0x351e86['toString'](),{'type':db[_0x0921('0x7b')][_0x0921('0x7c')][_0x0921('0x7d')]})[_0x0921('0x2a')](function(_0x2c1016){if(_0x2c1016[_0x0921('0x4c')]===0x1){return _0x33def3['id'];}else{var _0x557f5e=_[_0x0921('0x7e')](_[_0x0921('0x31')](_0x2c1016,'TeamId'),function(_0x46721d){return _[_0x0921('0x7f')](_0xd1ff8e,_0x46721d);});if(_0x557f5e){return _0x33def3['id'];}}}));}}return BPromise[_0x0921('0x80')](_0x381bcc)['then'](function(_0xaf3b63){_0x2e4255=_(_0x2e4255)[_0x0921('0x81')](_0xaf3b63)['compact']()['value']();return db[_0x0921('0x32')]['find']({'where':{'id':_0x5da42e[_0x0921('0x4a')]['id']}})['then'](function(_0x2423ea){return db[_0x0921('0x7b')][_0x0921('0x6c')](function(_0x1fca03){return _0x2423ea[_0x0921('0x71')](_0x5da42e[_0x0921('0x37')]['ids'],{'transaction':_0x1fca03})[_0x0921('0x2a')](function(){if(!_[_0x0921('0x82')](_0x2e4255)){return _0x2423ea['removeAgents'](_0x2e4255,{'transaction':_0x1fca03});}})[_0x0921('0x2a')](function(){_0x2e4255['forEach'](function(_0x52bfe8){socket[_0x0921('0x6f')](_0x0921('0x83'),{'UserId':_0x52bfe8,'FaxQueueId':_0x2423ea['id']});});});});});});})['then'](respondWithStatusCode(_0x31ea66,null))[_0x0921('0x48')](handleError(_0x31ea66,null));};exports[_0x0921('0x84')]=function(_0x180777,_0x4c6ae3,_0x31da21){return db[_0x0921('0x32')][_0x0921('0x4d')]({'where':{'id':_0x180777[_0x0921('0x4a')]['id']}})[_0x0921('0x2a')](handleEntityNotFound(_0x4c6ae3,null))[_0x0921('0x2a')](function(_0x141905){if(_0x141905){return _0x141905[_0x0921('0x84')](_0x180777[_0x0921('0x57')][_0x0921('0x72')],_['omit'](_0x180777[_0x0921('0x57')],[_0x0921('0x72'),'id'])||{})[_0x0921('0x85')](function(_0x414635){for(var _0x463ed3=0x0;_0x463ed3<_0x180777['body'][_0x0921('0x72')][_0x0921('0x4c')];_0x463ed3+=0x1){socket['emit'](_0x0921('0x70'),{'UserId':Number(_0x180777[_0x0921('0x57')][_0x0921('0x72')][_0x463ed3]),'FaxQueueId':Number(_0x180777[_0x0921('0x4a')]['id'])});}return _0x414635;});}})[_0x0921('0x2a')](respondWithResult(_0x4c6ae3,null))[_0x0921('0x48')](handleError(_0x4c6ae3,null));};exports[_0x0921('0x86')]=function(_0xbce082,_0x13e635,_0x467e69){return db['FaxQueue'][_0x0921('0x4d')]({'where':{'id':_0xbce082[_0x0921('0x4a')]['id']}})[_0x0921('0x2a')](handleEntityNotFound(_0x13e635,null))[_0x0921('0x2a')](function(_0x530eec){if(_0x530eec){return _0x530eec['removeAgents'](_0xbce082[_0x0921('0x37')][_0x0921('0x72')])[_0x0921('0x2a')](function(){if(_[_0x0921('0x87')](_0xbce082[_0x0921('0x37')][_0x0921('0x72')])){for(var _0x448270=0x0;_0x448270<_0xbce082[_0x0921('0x37')]['ids'][_0x0921('0x4c')];_0x448270+=0x1){socket[_0x0921('0x6f')](_0x0921('0x83'),{'UserId':Number(_0xbce082[_0x0921('0x37')][_0x0921('0x72')][_0x448270]),'FaxQueueId':Number(_0xbce082[_0x0921('0x4a')]['id'])});}}else{socket[_0x0921('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0xbce082[_0x0921('0x37')][_0x0921('0x72')]),'FaxQueueId':Number(_0xbce082[_0x0921('0x4a')]['id'])});}});}})[_0x0921('0x2a')](respondWithStatusCode(_0x13e635,null))[_0x0921('0x48')](handleError(_0x13e635,null));};exports['getAgents']=function(_0x370003,_0x1a858c,_0x4d9016){var _0x2f0d9e={};var _0x44c650={};var _0x3a0eea;var _0x5a85fe;return db['FaxQueue'][_0x0921('0x5a')]({'where':{'id':_0x370003[_0x0921('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a858c,null))[_0x0921('0x2a')](function(_0x118a18){if(_0x118a18){_0x3a0eea=_0x118a18;_0x44c650[_0x0921('0x36')]=_[_0x0921('0x4b')](db[_0x0921('0x5e')][_0x0921('0x33')]);_0x44c650[_0x0921('0x37')]=_[_0x0921('0x4b')](_0x370003['query']);_0x44c650[_0x0921('0x3f')]=_[_0x0921('0x39')](_0x44c650[_0x0921('0x36')],_0x44c650[_0x0921('0x37')]);_0x2f0d9e['attributes']=_['intersection'](_0x44c650[_0x0921('0x36')],qs['fields'](_0x370003[_0x0921('0x37')][_0x0921('0x3a')]));_0x2f0d9e[_0x0921('0x38')]=_0x2f0d9e[_0x0921('0x38')]['length']?_0x2f0d9e[_0x0921('0x38')]:_0x44c650[_0x0921('0x36')];_0x2f0d9e['order']=qs[_0x0921('0x3d')](_0x370003['query'][_0x0921('0x3d')]);_0x2f0d9e[_0x0921('0x3e')]=qs[_0x0921('0x3f')](_[_0x0921('0x40')](_0x370003[_0x0921('0x37')],_0x44c650[_0x0921('0x3f')]));if(_0x370003[_0x0921('0x37')][_0x0921('0x41')]){_0x2f0d9e[_0x0921('0x3e')]=_[_0x0921('0x43')](_0x2f0d9e[_0x0921('0x3e')],{'$or':_['map'](_0x2f0d9e[_0x0921('0x38')],function(_0x2d48f6){var _0x3b23cb={};_0x3b23cb[_0x2d48f6]={'$like':'%'+_0x370003[_0x0921('0x37')][_0x0921('0x41')]+'%'};return _0x3b23cb;})});}_0x2f0d9e=_['merge']({},_0x2f0d9e,_0x370003['options']);return _0x3a0eea[_0x0921('0x88')](_0x2f0d9e);}})['then'](function(_0xc30404){if(_0xc30404){_0x5a85fe=_0xc30404[_0x0921('0x4c')];if(!_0x370003[_0x0921('0x37')][_0x0921('0x3b')](_0x0921('0x5c'))){_0x2f0d9e['limit']=qs[_0x0921('0x22')](_0x370003[_0x0921('0x37')][_0x0921('0x22')]);_0x2f0d9e[_0x0921('0x24')]=qs[_0x0921('0x24')](_0x370003[_0x0921('0x37')]['offset']);}return _0x3a0eea[_0x0921('0x88')](_0x2f0d9e);}})[_0x0921('0x2a')](function(_0x446a2f){if(_0x446a2f){return _0x446a2f?{'count':_0x5a85fe,'rows':_0x446a2f}:null;}})[_0x0921('0x2a')](respondWithResult(_0x1a858c,null))[_0x0921('0x48')](handleError(_0x1a858c,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 8a206bf..071930e 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 _0x304b=['remove','hasOwnProperty','events','../../mysqldb','FaxQueue','setMaxListeners','update'];(function(_0x40cd73,_0x17608b){var _0x1be4cf=function(_0x4ae41a){while(--_0x4ae41a){_0x40cd73['push'](_0x40cd73['shift']());}};_0x1be4cf(++_0x17608b);}(_0x304b,0x1ad));var _0xb304=function(_0x97c022,_0x7e31bf){_0x97c022=_0x97c022-0x0;var _0x43f8a7=_0x304b[_0x97c022];return _0x43f8a7;};'use strict';var EventEmitter=require(_0xb304('0x0'));var FaxQueue=require(_0xb304('0x1'))['db'][_0xb304('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb304('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb304('0x4'),'afterDestroy':_0xb304('0x5')};function emitEvent(_0x4ef4f7){return function(_0x44bdb8,_0x253e7a,_0x51a02a){FaxQueueEvents['emit'](_0x4ef4f7+':'+_0x44bdb8['id'],_0x44bdb8);FaxQueueEvents['emit'](_0x4ef4f7,_0x44bdb8);_0x51a02a(null);};}for(var e in events){if(events[_0xb304('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xe50b=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0xfa6442,_0x2f7ba3){var _0x2a4573=function(_0x5c229e){while(--_0x5c229e){_0xfa6442['push'](_0xfa6442['shift']());}};_0x2a4573(++_0x2f7ba3);}(_0xe50b,0x6f));var _0xbe50=function(_0x433444,_0x176667){_0x433444=_0x433444-0x0;var _0x6b12d7=_0xe50b[_0x433444];return _0x6b12d7;};'use strict';var EventEmitter=require(_0xbe50('0x0'));var FaxQueue=require(_0xbe50('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xbe50('0x2')](0x0);var events={'afterCreate':_0xbe50('0x3'),'afterUpdate':'update','afterDestroy':_0xbe50('0x4')};function emitEvent(_0x3cc5bd){return function(_0x559031,_0x39b49d,_0x145b89){FaxQueueEvents[_0xbe50('0x5')](_0x3cc5bd+':'+_0x559031['id'],_0x559031);FaxQueueEvents[_0xbe50('0x5')](_0x3cc5bd,_0x559031);_0x145b89(null);};}for(var e in events){if(events[_0xbe50('0x6')](e)){var event=events[e];FaxQueue[_0xbe50('0x7')](e,emitEvent(event));}}module[_0xbe50('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 0a70fc7..2cb9827 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 _0x51ff=['../../config/environment','./faxQueue.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x51ff,0x1d8));var _0xf51f=function(_0x1dfc65,_0x2de3e9){_0x1dfc65=_0x1dfc65-0x0;var _0x1768f6=_0x51ff[_0x1dfc65];return _0x1768f6;};'use strict';var _=require(_0xf51f('0x0'));var util=require(_0xf51f('0x1'));var logger=require(_0xf51f('0x2'))(_0xf51f('0x3'));var moment=require('moment');var BPromise=require(_0xf51f('0x4'));var rp=require(_0xf51f('0x5'));var fs=require('fs');var path=require(_0xf51f('0x6'));var rimraf=require(_0xf51f('0x7'));var config=require(_0xf51f('0x8'));var attributes=require(_0xf51f('0x9'));module[_0xf51f('0xa')]=function(_0x1209c7,_0x2c22c6){return _0x1209c7[_0xf51f('0xb')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4282=['exports','define','FaxQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxQueue.attributes'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4282,0xff));var _0x2428=function(_0x237340,_0x39b15d){_0x237340=_0x237340-0x0;var _0x5542c8=_0x4282[_0x237340];return _0x5542c8;};'use strict';var _=require(_0x2428('0x0'));var util=require(_0x2428('0x1'));var logger=require('../../config/logger')(_0x2428('0x2'));var moment=require(_0x2428('0x3'));var BPromise=require(_0x2428('0x4'));var rp=require(_0x2428('0x5'));var fs=require('fs');var path=require(_0x2428('0x6'));var rimraf=require(_0x2428('0x7'));var config=require('../../config/environment');var attributes=require(_0x2428('0x8'));module[_0x2428('0x9')]=function(_0x1ca51d,_0x56396e){return _0x1ca51d[_0x2428('0xa')](_0x2428('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 97a5433..5f20cc4 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 _0xb27d=['result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','include','map','model','attributes','ShowFaxQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message'];(function(_0x47d455,_0x34a171){var _0x2982c3=function(_0x4e329c){while(--_0x4e329c){_0x47d455['push'](_0x47d455['shift']());}};_0x2982c3(++_0x34a171);}(_0xb27d,0x110));var _0xdb27=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xb27d[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xdb27('0x0'));var util=require(_0xdb27('0x1'));var moment=require(_0xdb27('0x2'));var BPromise=require(_0xdb27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb27('0x4'));var db=require(_0xdb27('0x5'))['db'];var utils=require(_0xdb27('0x6'));var logger=require(_0xdb27('0x7'))(_0xdb27('0x8'));var config=require(_0xdb27('0x9'));var jayson=require(_0xdb27('0xa'));var client=jayson[_0xdb27('0xb')][_0xdb27('0xc')]({'port':0x232a});config[_0xdb27('0xd')]=_[_0xdb27('0xe')](config[_0xdb27('0xd')],{'host':_0xdb27('0xf'),'port':0x18eb});var socket=require(_0xdb27('0x10'))(new Redis(config['redis']));require(_0xdb27('0x11'))['register'](socket);function respondWithRpcPromise(_0x1a62ed,_0x544501,_0x9894ee){return new BPromise(function(_0xaa3bf7,_0x1f963e){return client[_0xdb27('0x12')](_0x1a62ed,_0x9894ee)[_0xdb27('0x13')](function(_0x5ba623){logger[_0xdb27('0x14')]('FaxQueue,\x20%s,\x20%s',_0x544501,_0xdb27('0x15'));logger[_0xdb27('0x16')](_0xdb27('0x17'),_0x544501,_0xdb27('0x15'),JSON[_0xdb27('0x18')](_0x5ba623));if(_0x5ba623[_0xdb27('0x19')]){if(_0x5ba623[_0xdb27('0x19')][_0xdb27('0x1a')]===0x1f4){logger['error'](_0xdb27('0x1b'),_0x544501,_0x5ba623[_0xdb27('0x19')][_0xdb27('0x1c')]);return _0x1f963e(_0x5ba623['error'][_0xdb27('0x1c')]);}logger[_0xdb27('0x19')](_0xdb27('0x1b'),_0x544501,_0x5ba623[_0xdb27('0x19')]['message']);return _0xaa3bf7(_0x5ba623[_0xdb27('0x19')][_0xdb27('0x1c')]);}else{logger['info'](_0xdb27('0x1b'),_0x544501,_0xdb27('0x15'));_0xaa3bf7(_0x5ba623[_0xdb27('0x1d')]['message']);}})[_0xdb27('0x1e')](function(_0x8eaa81){logger[_0xdb27('0x19')]('FaxQueue,\x20%s,\x20%s',_0x544501,_0x8eaa81);_0x1f963e(_0x8eaa81);});});}exports[_0xdb27('0x1f')]=function(_0x4d8309){var _0x5c7a7a=this;return new Promise(function(_0x350ddf,_0x49e22a){return db[_0xdb27('0x20')][_0xdb27('0x21')]({'raw':_0x4d8309[_0xdb27('0x22')]?_0x4d8309[_0xdb27('0x22')][_0xdb27('0x23')]===undefined?!![]:![]:!![],'where':_0x4d8309[_0xdb27('0x22')]?_0x4d8309[_0xdb27('0x22')][_0xdb27('0x24')]||null:null,'attributes':_0x4d8309[_0xdb27('0x22')]?_0x4d8309[_0xdb27('0x22')]['attributes']||null:null,'limit':_0x4d8309[_0xdb27('0x22')]?_0x4d8309[_0xdb27('0x22')]['limit']||null:null,'include':_0x4d8309['options']?_0x4d8309[_0xdb27('0x22')][_0xdb27('0x25')]?_[_0xdb27('0x26')](_0x4d8309[_0xdb27('0x22')][_0xdb27('0x25')],function(_0x4e9dcf){return{'model':db[_0x4e9dcf[_0xdb27('0x27')]],'as':_0x4e9dcf['as'],'attributes':_0x4e9dcf[_0xdb27('0x28')],'include':_0x4e9dcf[_0xdb27('0x25')]?_[_0xdb27('0x26')](_0x4e9dcf[_0xdb27('0x25')],function(_0x8d21d3){return{'model':db[_0x8d21d3['model']],'as':_0x8d21d3['as'],'attributes':_0x8d21d3[_0xdb27('0x28')],'include':_0x8d21d3[_0xdb27('0x25')]?_[_0xdb27('0x26')](_0x8d21d3[_0xdb27('0x25')],function(_0x26f785){return{'model':db[_0x26f785[_0xdb27('0x27')]],'as':_0x26f785['as'],'attributes':_0x26f785[_0xdb27('0x28')]};}):[]};}):[]};}):[]:[]})[_0xdb27('0x13')](function(_0xe95ac7){logger[_0xdb27('0x14')](_0xdb27('0x1f'),_0x4d8309);logger[_0xdb27('0x16')]('GetFaxQueue',_0x4d8309,JSON[_0xdb27('0x18')](_0xe95ac7));_0x350ddf(_0xe95ac7);})['catch'](function(_0x53f62b){logger[_0xdb27('0x19')](_0xdb27('0x1f'),_0x53f62b['message'],_0x4d8309);_0x49e22a(_0x5c7a7a[_0xdb27('0x19')](0x1f4,_0x53f62b[_0xdb27('0x1c')]));});});};exports[_0xdb27('0x29')]=function(_0x24eaee){var _0x5891fa=this;return new Promise(function(_0x583b7a,_0x152d5f){return db[_0xdb27('0x20')][_0xdb27('0x2a')]({'raw':_0x24eaee['options']?_0x24eaee['options'][_0xdb27('0x23')]===undefined?!![]:![]:!![],'where':_0x24eaee[_0xdb27('0x22')]?_0x24eaee['options'][_0xdb27('0x24')]||null:null,'attributes':_0x24eaee['options']?_0x24eaee[_0xdb27('0x22')][_0xdb27('0x28')]||null:null,'include':_0x24eaee['options']?_0x24eaee[_0xdb27('0x22')]['include']?_[_0xdb27('0x26')](_0x24eaee['options'][_0xdb27('0x25')],function(_0x32ac56){return{'model':db[_0x32ac56[_0xdb27('0x27')]],'as':_0x32ac56['as'],'attributes':_0x32ac56[_0xdb27('0x28')],'include':_0x32ac56[_0xdb27('0x25')]?_[_0xdb27('0x26')](_0x32ac56[_0xdb27('0x25')],function(_0x5a66e7){return{'model':db[_0x5a66e7[_0xdb27('0x27')]],'as':_0x5a66e7['as'],'attributes':_0x5a66e7['attributes'],'include':_0x5a66e7[_0xdb27('0x25')]?_[_0xdb27('0x26')](_0x5a66e7['include'],function(_0x2d2334){return{'model':db[_0x2d2334[_0xdb27('0x27')]],'as':_0x2d2334['as'],'attributes':_0x2d2334['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb27('0x13')](function(_0x498eb0){logger[_0xdb27('0x14')](_0xdb27('0x29'),_0x24eaee);logger[_0xdb27('0x16')](_0xdb27('0x29'),_0x24eaee,JSON[_0xdb27('0x18')](_0x498eb0));_0x583b7a(_0x498eb0);})[_0xdb27('0x1e')](function(_0x2d2e8b){logger['error'](_0xdb27('0x29'),_0x2d2e8b['message'],_0x24eaee);_0x152d5f(_0x5891fa[_0xdb27('0x19')](0x1f4,_0x2d2e8b[_0xdb27('0x1c')]));});});}; \ No newline at end of file +var _0x6ce8=['jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowFaxQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5844f9,_0x7be0f9){var _0x191a9d=function(_0xa31c4d){while(--_0xa31c4d){_0x5844f9['push'](_0x5844f9['shift']());}};_0x191a9d(++_0x7be0f9);}(_0x6ce8,0x1af));var _0x86ce=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x6ce8[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x86ce('0x0'));var util=require(_0x86ce('0x1'));var moment=require(_0x86ce('0x2'));var BPromise=require('bluebird');var rs=require(_0x86ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86ce('0x4'))['db'];var utils=require(_0x86ce('0x5'));var logger=require(_0x86ce('0x6'))(_0x86ce('0x7'));var config=require(_0x86ce('0x8'));var jayson=require(_0x86ce('0x9'));var client=jayson[_0x86ce('0xa')][_0x86ce('0xb')]({'port':0x232a});config[_0x86ce('0xc')]=_[_0x86ce('0xd')](config['redis'],{'host':_0x86ce('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86ce('0xc')]));require(_0x86ce('0xf'))[_0x86ce('0x10')](socket);function respondWithRpcPromise(_0x356434,_0x4f1355,_0x454281){return new BPromise(function(_0x48c415,_0x3baaa1){return client['request'](_0x356434,_0x454281)[_0x86ce('0x11')](function(_0x23607c){logger[_0x86ce('0x12')](_0x86ce('0x13'),_0x4f1355,_0x86ce('0x14'));logger[_0x86ce('0x15')](_0x86ce('0x16'),_0x4f1355,_0x86ce('0x14'),JSON[_0x86ce('0x17')](_0x23607c));if(_0x23607c[_0x86ce('0x18')]){if(_0x23607c['error']['code']===0x1f4){logger[_0x86ce('0x18')](_0x86ce('0x13'),_0x4f1355,_0x23607c[_0x86ce('0x18')][_0x86ce('0x19')]);return _0x3baaa1(_0x23607c[_0x86ce('0x18')]['message']);}logger[_0x86ce('0x18')]('FaxQueue,\x20%s,\x20%s',_0x4f1355,_0x23607c[_0x86ce('0x18')][_0x86ce('0x19')]);return _0x48c415(_0x23607c[_0x86ce('0x18')][_0x86ce('0x19')]);}else{logger['info'](_0x86ce('0x13'),_0x4f1355,_0x86ce('0x14'));_0x48c415(_0x23607c['result'][_0x86ce('0x19')]);}})[_0x86ce('0x1a')](function(_0x44fd46){logger[_0x86ce('0x18')](_0x86ce('0x13'),_0x4f1355,_0x44fd46);_0x3baaa1(_0x44fd46);});});}exports[_0x86ce('0x1b')]=function(_0x27a387){var _0x1f3c91=this;return new Promise(function(_0x1dedb7,_0x3825f0){return db[_0x86ce('0x1c')][_0x86ce('0x1d')]({'raw':_0x27a387[_0x86ce('0x1e')]?_0x27a387[_0x86ce('0x1e')][_0x86ce('0x1f')]===undefined?!![]:![]:!![],'where':_0x27a387[_0x86ce('0x1e')]?_0x27a387['options'][_0x86ce('0x20')]||null:null,'attributes':_0x27a387[_0x86ce('0x1e')]?_0x27a387[_0x86ce('0x1e')][_0x86ce('0x21')]||null:null,'limit':_0x27a387[_0x86ce('0x1e')]?_0x27a387[_0x86ce('0x1e')][_0x86ce('0x22')]||null:null,'include':_0x27a387[_0x86ce('0x1e')]?_0x27a387[_0x86ce('0x1e')]['include']?_[_0x86ce('0x23')](_0x27a387[_0x86ce('0x1e')][_0x86ce('0x24')],function(_0xfd4bac){return{'model':db[_0xfd4bac[_0x86ce('0x25')]],'as':_0xfd4bac['as'],'attributes':_0xfd4bac[_0x86ce('0x21')],'include':_0xfd4bac['include']?_[_0x86ce('0x23')](_0xfd4bac[_0x86ce('0x24')],function(_0x41347c){return{'model':db[_0x41347c[_0x86ce('0x25')]],'as':_0x41347c['as'],'attributes':_0x41347c[_0x86ce('0x21')],'include':_0x41347c['include']?_[_0x86ce('0x23')](_0x41347c[_0x86ce('0x24')],function(_0x21464f){return{'model':db[_0x21464f[_0x86ce('0x25')]],'as':_0x21464f['as'],'attributes':_0x21464f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48a8b2){logger[_0x86ce('0x12')](_0x86ce('0x1b'),_0x27a387);logger[_0x86ce('0x15')]('GetFaxQueue',_0x27a387,JSON[_0x86ce('0x17')](_0x48a8b2));_0x1dedb7(_0x48a8b2);})[_0x86ce('0x1a')](function(_0x492558){logger[_0x86ce('0x18')](_0x86ce('0x1b'),_0x492558[_0x86ce('0x19')],_0x27a387);_0x3825f0(_0x1f3c91[_0x86ce('0x18')](0x1f4,_0x492558[_0x86ce('0x19')]));});});};exports[_0x86ce('0x26')]=function(_0x481058){var _0x3b82dd=this;return new Promise(function(_0x3ce09b,_0x3acf18){return db[_0x86ce('0x1c')][_0x86ce('0x27')]({'raw':_0x481058[_0x86ce('0x1e')]?_0x481058[_0x86ce('0x1e')][_0x86ce('0x1f')]===undefined?!![]:![]:!![],'where':_0x481058[_0x86ce('0x1e')]?_0x481058[_0x86ce('0x1e')][_0x86ce('0x20')]||null:null,'attributes':_0x481058['options']?_0x481058[_0x86ce('0x1e')][_0x86ce('0x21')]||null:null,'include':_0x481058[_0x86ce('0x1e')]?_0x481058[_0x86ce('0x1e')]['include']?_[_0x86ce('0x23')](_0x481058[_0x86ce('0x1e')][_0x86ce('0x24')],function(_0x19d208){return{'model':db[_0x19d208['model']],'as':_0x19d208['as'],'attributes':_0x19d208['attributes'],'include':_0x19d208['include']?_[_0x86ce('0x23')](_0x19d208[_0x86ce('0x24')],function(_0xeeab1e){return{'model':db[_0xeeab1e[_0x86ce('0x25')]],'as':_0xeeab1e['as'],'attributes':_0xeeab1e[_0x86ce('0x21')],'include':_0xeeab1e[_0x86ce('0x24')]?_[_0x86ce('0x23')](_0xeeab1e[_0x86ce('0x24')],function(_0x486a00){return{'model':db[_0x486a00[_0x86ce('0x25')]],'as':_0x486a00['as'],'attributes':_0x486a00['attributes']};}):[]};}):[]};}):[]:[]})[_0x86ce('0x11')](function(_0x36e4d3){logger[_0x86ce('0x12')](_0x86ce('0x26'),_0x481058);logger[_0x86ce('0x15')](_0x86ce('0x26'),_0x481058,JSON['stringify'](_0x36e4d3));_0x3ce09b(_0x36e4d3);})[_0x86ce('0x1a')](function(_0x56702b){logger['error'](_0x86ce('0x26'),_0x56702b[_0x86ce('0x19')],_0x481058);_0x3acf18(_0x3b82dd[_0x86ce('0x18')](0x1f4,_0x56702b[_0x86ce('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 3656d51..750ca88 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 _0x9417=['emit','removeListener','register','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x9417,0xb4));var _0x7941=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x9417[_0x1344d6];return _0xf45b24;};'use strict';var FaxQueueEvents=require(_0x7941('0x0'));var events=[_0x7941('0x1'),_0x7941('0x2'),_0x7941('0x3')];function createListener(_0x5e2057,_0x32968f){return function(_0x240766){_0x32968f[_0x7941('0x4')](_0x5e2057,_0x240766);};}function removeListener(_0x3351ee,_0x6f6dca){return function(){FaxQueueEvents[_0x7941('0x5')](_0x3351ee,_0x6f6dca);};}exports[_0x7941('0x6')]=function(_0x3e38d8){for(var _0x1dee1a=0x0,_0x15c666=events['length'];_0x1dee1a<_0x15c666;_0x1dee1a++){var _0x11a155=events[_0x1dee1a];var _0x238e43=createListener(_0x7941('0x7')+_0x11a155,_0x3e38d8);FaxQueueEvents['on'](_0x11a155,_0x238e43);}}; \ No newline at end of file +var _0xa9e7=['length','faxQueue:','./faxQueue.events','save','remove','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e7,0xfa));var _0x7a9e=function(_0x2cc401,_0x463894){_0x2cc401=_0x2cc401-0x0;var _0x580695=_0xa9e7[_0x2cc401];return _0x580695;};'use strict';var FaxQueueEvents=require(_0x7a9e('0x0'));var events=[_0x7a9e('0x1'),_0x7a9e('0x2'),'update'];function createListener(_0x4f503d,_0x51cce7){return function(_0x3f6b27){_0x51cce7[_0x7a9e('0x3')](_0x4f503d,_0x3f6b27);};}function removeListener(_0x979bac,_0x4582ca){return function(){FaxQueueEvents[_0x7a9e('0x4')](_0x979bac,_0x4582ca);};}exports[_0x7a9e('0x5')]=function(_0x2cf173){for(var _0x2c91e1=0x0,_0x47e0dd=events[_0x7a9e('0x6')];_0x2c91e1<_0x47e0dd;_0x2c91e1++){var _0x4fe768=events[_0x2c91e1];var _0x30745a=createListener(_0x7a9e('0x7')+_0x4fe768,_0x2cf173);FaxQueueEvents['on'](_0x4fe768,_0x30745a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 0588fbf..01c6ac4 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 _0x9f0e=['destroy','/:id/teams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','getTeams','post','create','/:id/users','put','delete'];(function(_0x572468,_0x374ac5){var _0x52b510=function(_0x5c25d6){while(--_0x5c25d6){_0x572468['push'](_0x572468['shift']());}};_0x52b510(++_0x374ac5);}(_0x9f0e,0x116));var _0xe9f0=function(_0x39682b,_0x1a2339){_0x39682b=_0x39682b-0x0;var _0x41b00f=_0x9f0e[_0x39682b];return _0x41b00f;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0x9')](_0xe9f0('0xe'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x9')]('/:id/teams',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x10')]);router[_0xe9f0('0x9')]('/:id/users',auth[_0xe9f0('0xb')](),controller['getAgents']);router[_0xe9f0('0x11')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x12')]);router[_0xe9f0('0x11')]('/:id/teams',auth[_0xe9f0('0xb')](),controller['addTeams']);router[_0xe9f0('0x11')](_0xe9f0('0x13'),auth[_0xe9f0('0xb')](),controller['addAgents']);router[_0xe9f0('0x14')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller['update']);router[_0xe9f0('0x15')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0x16')]);router[_0xe9f0('0x15')](_0xe9f0('0x17'),auth[_0xe9f0('0xb')](),controller['removeTeams']);router[_0xe9f0('0x15')](_0xe9f0('0x13'),auth[_0xe9f0('0xb')](),controller['removeAgents']);module[_0xe9f0('0x18')]=router; \ No newline at end of file +var _0x9582=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3a94ea,_0x1bd82b){var _0x26543a=function(_0x63417a){while(--_0x63417a){_0x3a94ea['push'](_0x3a94ea['shift']());}};_0x26543a(++_0x1bd82b);}(_0x9582,0x95));var _0x2958=function(_0x1d8312,_0x3516b1){_0x1d8312=_0x1d8312-0x0;var _0x16d1ad=_0x9582[_0x1d8312];return _0x16d1ad;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['describe']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['get'](_0x2958('0x10'),auth['isAuthenticated'](),controller[_0x2958('0x11')]);router[_0x2958('0xa')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);router['get'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x15')]);router[_0x2958('0x16')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0x17')]);router[_0x2958('0x16')](_0x2958('0x12'),auth['isAuthenticated'](),controller[_0x2958('0x18')]);router[_0x2958('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x2958('0x19')]);router[_0x2958('0x1a')]('/:id',auth[_0x2958('0xb')](),controller['update']);router['delete'](_0x2958('0xe'),auth[_0x2958('0xb')](),controller['destroy']);router['delete'](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x1b')]);router[_0x2958('0x1c')](_0x2958('0x14'),auth['isAuthenticated'](),controller[_0x2958('0x1d')]);module[_0x2958('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index c7d5562..a8573f5 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 _0x8e89=['DATE','moment','sequelize','STRING'];(function(_0x1f337b,_0x5512fb){var _0x5eb800=function(_0x12d8a9){while(--_0x12d8a9){_0x1f337b['push'](_0x1f337b['shift']());}};_0x5eb800(++_0x5512fb);}(_0x8e89,0x189));var _0x98e8=function(_0x3dee92,_0x55e1eb){_0x3dee92=_0x3dee92-0x0;var _0x44d36e=_0x8e89[_0x3dee92];return _0x44d36e;};'use strict';var moment=require(_0x98e8('0x0'));var Sequelize=require(_0x98e8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x98e8('0x2')]},'joinAt':{'type':Sequelize[_0x98e8('0x3')]},'leaveAt':{'type':Sequelize[_0x98e8('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x98e8('0x3')]},'reason':{'type':Sequelize[_0x98e8('0x2')]}}; \ No newline at end of file +var _0xecc2=['DATE','STRING'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xecc2,0x119));var _0x2ecc=function(_0x469852,_0x532e8c){_0x469852=_0x469852-0x0;var _0xa844b9=_0xecc2[_0x469852];return _0xa844b9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x2ecc('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x2ecc('0x0')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2ecc('0x1')]},'exitAt':{'type':Sequelize[_0x2ecc('0x1')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c178692..a070877 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 _0xba47=['catch','params','rawAttributes','create','update','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','reject','then','destroy','sendStatus','name','send','index','map','FaxQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows'];(function(_0x1aec65,_0x371b56){var _0x3a6ee9=function(_0x4fbc82){while(--_0x4fbc82){_0x1aec65['push'](_0x1aec65['shift']());}};_0x3a6ee9(++_0x371b56);}(_0xba47,0x1ac));var _0x7ba4=function(_0x3e781e,_0x39b0e4){_0x3e781e=_0x3e781e-0x0;var _0x3477af=_0xba47[_0x3e781e];return _0x3477af;};'use strict';var emlformat=require(_0x7ba4('0x0'));var rimraf=require(_0x7ba4('0x1'));var zipdir=require(_0x7ba4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ba4('0x3'));var moment=require(_0x7ba4('0x4'));var BPromise=require(_0x7ba4('0x5'));var Mustache=require(_0x7ba4('0x6'));var util=require('util');var path=require(_0x7ba4('0x7'));var sox=require(_0x7ba4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ba4('0x9'));var _=require(_0x7ba4('0xa'));var squel=require(_0x7ba4('0xb'));var crypto=require(_0x7ba4('0xc'));var jsforce=require(_0x7ba4('0xd'));var deskjs=require(_0x7ba4('0xe'));var toCsv=require(_0x7ba4('0xf'));var querystring=require(_0x7ba4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ba4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7ba4('0x12'));var hardwareService=require(_0x7ba4('0x13'));var logger=require(_0x7ba4('0x14'))(_0x7ba4('0x15'));var utils=require('../../config/utils');var config=require(_0x7ba4('0x16'));var licenseUtil=require(_0x7ba4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x83d2c,_0x266be2){_0x266be2=_0x266be2||0xcc;return function(_0x2fdee0){if(_0x2fdee0){return _0x83d2c['sendStatus'](_0x266be2);}return _0x83d2c[_0x7ba4('0x18')](_0x266be2)[_0x7ba4('0x19')]();};}function respondWithResult(_0x26da9d,_0x471e93){_0x471e93=_0x471e93||0xc8;return function(_0xcf45f6){if(_0xcf45f6){return _0x26da9d[_0x7ba4('0x18')](_0x471e93)[_0x7ba4('0x1a')](_0xcf45f6);}};}function respondWithFilteredResult(_0x1e16c5,_0x3197d9){return function(_0x480e0b){if(_0x480e0b){var _0x4b0fb7=typeof _0x3197d9[_0x7ba4('0x1b')]===_0x7ba4('0x1c')&&typeof _0x3197d9['limit']===_0x7ba4('0x1c');var _0xbc6330=_0x480e0b[_0x7ba4('0x1d')];var _0xd5bdde=_0x4b0fb7?0x0:_0x3197d9[_0x7ba4('0x1b')];var _0x988f2f=_0x4b0fb7?_0x480e0b[_0x7ba4('0x1d')]:_0x3197d9[_0x7ba4('0x1b')]+_0x3197d9['limit'];var _0x5d14ba;if(_0x988f2f>=_0xbc6330){_0x988f2f=_0xbc6330;_0x5d14ba=0xc8;}else{_0x5d14ba=0xce;}_0x1e16c5[_0x7ba4('0x18')](_0x5d14ba);return _0x1e16c5[_0x7ba4('0x1e')]('Content-Range',_0xd5bdde+'-'+_0x988f2f+'/'+_0xbc6330)[_0x7ba4('0x1a')](_0x480e0b);}return null;};}function patchUpdates(_0x14a214){return function(_0x3601ba){try{jsonpatch['apply'](_0x3601ba,_0x14a214,!![]);}catch(_0x5b1dde){return BPromise[_0x7ba4('0x1f')](_0x5b1dde);}return _0x3601ba['save']();};}function saveUpdates(_0x4bd364,_0x225b6a){return function(_0x4dffd7){if(_0x4dffd7){return _0x4dffd7['update'](_0x4bd364)[_0x7ba4('0x20')](function(_0x246943){return _0x246943;});}return null;};}function removeEntity(_0x3a3c67,_0x413a67){return function(_0x2afc11){if(_0x2afc11){return _0x2afc11[_0x7ba4('0x21')]()[_0x7ba4('0x20')](function(){_0x3a3c67['status'](0xcc)[_0x7ba4('0x19')]();});}};}function handleEntityNotFound(_0x34ee62,_0x10508e){return function(_0x3c679c){if(!_0x3c679c){_0x34ee62[_0x7ba4('0x22')](0x194);}return _0x3c679c;};}function handleError(_0x28c51c,_0x4f0ce5){_0x4f0ce5=_0x4f0ce5||0x1f4;return function(_0x901837){logger['error'](_0x901837['stack']);if(_0x901837['name']){delete _0x901837[_0x7ba4('0x23')];}_0x28c51c[_0x7ba4('0x18')](_0x4f0ce5)[_0x7ba4('0x24')](_0x901837);};}exports[_0x7ba4('0x25')]=function(_0x37d8cd,_0x494754){var _0x315cdb={},_0x45be5c={},_0xfb47a5={'count':0x0,'rows':[]};var _0x40a6fb=_[_0x7ba4('0x26')](db[_0x7ba4('0x27')]['rawAttributes'],function(_0x4fdbc7){return{'name':_0x4fdbc7[_0x7ba4('0x28')],'type':_0x4fdbc7[_0x7ba4('0x29')][_0x7ba4('0x2a')]};});_0x45be5c[_0x7ba4('0x2b')]=_[_0x7ba4('0x26')](_0x40a6fb,_0x7ba4('0x23'));_0x45be5c[_0x7ba4('0x2c')]=_[_0x7ba4('0x2d')](_0x37d8cd[_0x7ba4('0x2c')]);_0x45be5c[_0x7ba4('0x2e')]=_['intersection'](_0x45be5c[_0x7ba4('0x2b')],_0x45be5c[_0x7ba4('0x2c')]);_0x315cdb['attributes']=_[_0x7ba4('0x2f')](_0x45be5c[_0x7ba4('0x2b')],qs['fields'](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x30')]));_0x315cdb['attributes']=_0x315cdb[_0x7ba4('0x31')]['length']?_0x315cdb['attributes']:_0x45be5c[_0x7ba4('0x2b')];if(!_0x37d8cd['query'][_0x7ba4('0x32')](_0x7ba4('0x33'))){_0x315cdb[_0x7ba4('0x34')]=qs[_0x7ba4('0x34')](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x34')]);_0x315cdb['offset']=qs[_0x7ba4('0x1b')](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x1b')]);}_0x315cdb[_0x7ba4('0x35')]=qs['sort'](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x36')]);_0x315cdb[_0x7ba4('0x37')]=qs[_0x7ba4('0x2e')](_[_0x7ba4('0x38')](_0x37d8cd['query'],_0x45be5c[_0x7ba4('0x2e')]),_0x40a6fb);if(_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x39')]){_0x315cdb['where']=_[_0x7ba4('0x3a')](_0x315cdb[_0x7ba4('0x37')],{'$or':_[_0x7ba4('0x26')](_0x40a6fb,function(_0x498520){if(_0x498520[_0x7ba4('0x29')]!=='VIRTUAL'){var _0x21c7f8={};_0x21c7f8[_0x498520['name']]={'$like':'%'+_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x39')]+'%'};return _0x21c7f8;}})});}_0x315cdb=_[_0x7ba4('0x3a')]({},_0x315cdb,_0x37d8cd[_0x7ba4('0x3b')]);var _0x2307ef={'where':_0x315cdb[_0x7ba4('0x37')]};return db[_0x7ba4('0x27')][_0x7ba4('0x1d')](_0x2307ef)[_0x7ba4('0x20')](function(_0x234182){_0xfb47a5['count']=_0x234182;if(_0x37d8cd['query']['includeAll']){_0x315cdb[_0x7ba4('0x3c')]=[{'all':!![]}];}return db[_0x7ba4('0x27')]['findAll'](_0x315cdb);})[_0x7ba4('0x20')](function(_0x3daf6f){_0xfb47a5[_0x7ba4('0x3d')]=_0x3daf6f;return _0xfb47a5;})['then'](respondWithFilteredResult(_0x494754,_0x315cdb))[_0x7ba4('0x3e')](handleError(_0x494754,null));};exports['show']=function(_0x21338c,_0x242b7e){var _0x306e4e={'raw':!![],'where':{'id':_0x21338c[_0x7ba4('0x3f')]['id']}},_0x35b21a={};_0x35b21a['model']=_['keys'](db[_0x7ba4('0x27')][_0x7ba4('0x40')]);_0x35b21a[_0x7ba4('0x2c')]=_['keys'](_0x21338c[_0x7ba4('0x2c')]);_0x35b21a['filters']=_[_0x7ba4('0x2f')](_0x35b21a[_0x7ba4('0x2b')],_0x35b21a['query']);_0x306e4e[_0x7ba4('0x31')]=_[_0x7ba4('0x2f')](_0x35b21a[_0x7ba4('0x2b')],qs[_0x7ba4('0x30')](_0x21338c[_0x7ba4('0x2c')][_0x7ba4('0x30')]));_0x306e4e[_0x7ba4('0x31')]=_0x306e4e[_0x7ba4('0x31')]['length']?_0x306e4e[_0x7ba4('0x31')]:_0x35b21a[_0x7ba4('0x2b')];if(_0x21338c[_0x7ba4('0x2c')]['includeAll']){_0x306e4e[_0x7ba4('0x3c')]=[{'all':!![]}];}_0x306e4e=_['merge']({},_0x306e4e,_0x21338c[_0x7ba4('0x3b')]);return db[_0x7ba4('0x27')]['find'](_0x306e4e)[_0x7ba4('0x20')](handleEntityNotFound(_0x242b7e,null))[_0x7ba4('0x20')](respondWithResult(_0x242b7e,null))[_0x7ba4('0x3e')](handleError(_0x242b7e,null));};exports['create']=function(_0x2ce0c0,_0x3000cf){return db['FaxQueueReport'][_0x7ba4('0x41')](_0x2ce0c0['body'],{})[_0x7ba4('0x20')](respondWithResult(_0x3000cf,0xc9))[_0x7ba4('0x3e')](handleError(_0x3000cf,null));};exports[_0x7ba4('0x42')]=function(_0x4e62d6,_0x448cb5){if(_0x4e62d6[_0x7ba4('0x43')]['id']){delete _0x4e62d6[_0x7ba4('0x43')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x4e62d6[_0x7ba4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x448cb5,null))[_0x7ba4('0x20')](saveUpdates(_0x4e62d6['body'],null))[_0x7ba4('0x20')](respondWithResult(_0x448cb5,null))['catch'](handleError(_0x448cb5,null));};exports[_0x7ba4('0x21')]=function(_0x7044cc,_0x4946ae){return db[_0x7ba4('0x27')][_0x7ba4('0x44')]({'where':{'id':_0x7044cc[_0x7ba4('0x3f')]['id']}})[_0x7ba4('0x20')](handleEntityNotFound(_0x4946ae,null))[_0x7ba4('0x20')](removeEntity(_0x4946ae,null))['catch'](handleError(_0x4946ae,null));};exports[_0x7ba4('0x45')]=function(_0x1dfa4b,_0xd6d1da){return db[_0x7ba4('0x27')]['describe']()[_0x7ba4('0x20')](respondWithResult(_0xd6d1da,null))[_0x7ba4('0x3e')](handleError(_0xd6d1da,null));}; \ No newline at end of file +var _0xdab2=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body'];(function(_0x4e7c16,_0x30361f){var _0x1b7e63=function(_0x32d4ca){while(--_0x32d4ca){_0x4e7c16['push'](_0x4e7c16['shift']());}};_0x1b7e63(++_0x30361f);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dab('0x0'));var rimraf=require(_0x2dab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dab('0x2'));var rp=require(_0x2dab('0x3'));var moment=require(_0x2dab('0x4'));var BPromise=require(_0x2dab('0x5'));var Mustache=require('mustache');var util=require(_0x2dab('0x6'));var path=require(_0x2dab('0x7'));var sox=require(_0x2dab('0x8'));var csv=require(_0x2dab('0x9'));var ejs=require(_0x2dab('0xa'));var fs=require('fs');var fs_extra=require(_0x2dab('0xb'));var _=require(_0x2dab('0xc'));var squel=require(_0x2dab('0xd'));var crypto=require(_0x2dab('0xe'));var jsforce=require(_0x2dab('0xf'));var deskjs=require(_0x2dab('0x10'));var toCsv=require(_0x2dab('0x9'));var querystring=require(_0x2dab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2dab('0x12'));var qs=require(_0x2dab('0x13'));var as=require(_0x2dab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2dab('0x15'));var utils=require(_0x2dab('0x16'));var config=require(_0x2dab('0x17'));var licenseUtil=require(_0x2dab('0x18'));var db=require(_0x2dab('0x19'))['db'];function respondWithStatusCode(_0x553435,_0x2653c8){_0x2653c8=_0x2653c8||0xcc;return function(_0x263f53){if(_0x263f53){return _0x553435['sendStatus'](_0x2653c8);}return _0x553435[_0x2dab('0x1a')](_0x2653c8)[_0x2dab('0x1b')]();};}function respondWithResult(_0x1b5161,_0x597a6e){_0x597a6e=_0x597a6e||0xc8;return function(_0x4040d8){if(_0x4040d8){return _0x1b5161[_0x2dab('0x1a')](_0x597a6e)['json'](_0x4040d8);}};}function respondWithFilteredResult(_0x3c00b1,_0x15a9e7){return function(_0x3e8613){if(_0x3e8613){var _0x2f64c8=typeof _0x15a9e7[_0x2dab('0x1c')]==='undefined'&&typeof _0x15a9e7[_0x2dab('0x1d')]===_0x2dab('0x1e');var _0x18d52c=_0x3e8613[_0x2dab('0x1f')];var _0x30bbde=_0x2f64c8?0x0:_0x15a9e7[_0x2dab('0x1c')];var _0x4ff9be=_0x2f64c8?_0x3e8613[_0x2dab('0x1f')]:_0x15a9e7[_0x2dab('0x1c')]+_0x15a9e7[_0x2dab('0x1d')];var _0x5d3c93;if(_0x4ff9be>=_0x18d52c){_0x4ff9be=_0x18d52c;_0x5d3c93=0xc8;}else{_0x5d3c93=0xce;}_0x3c00b1[_0x2dab('0x1a')](_0x5d3c93);return _0x3c00b1[_0x2dab('0x20')](_0x2dab('0x21'),_0x30bbde+'-'+_0x4ff9be+'/'+_0x18d52c)['json'](_0x3e8613);}return null;};}function patchUpdates(_0x477494){return function(_0x14e373){try{jsonpatch[_0x2dab('0x22')](_0x14e373,_0x477494,!![]);}catch(_0x37a4c0){return BPromise[_0x2dab('0x23')](_0x37a4c0);}return _0x14e373[_0x2dab('0x24')]();};}function saveUpdates(_0x528a8c,_0x343bfc){return function(_0x321469){if(_0x321469){return _0x321469['update'](_0x528a8c)[_0x2dab('0x25')](function(_0x3b0b84){return _0x3b0b84;});}return null;};}function removeEntity(_0xf16fec,_0x37cb08){return function(_0x119d38){if(_0x119d38){return _0x119d38[_0x2dab('0x26')]()[_0x2dab('0x25')](function(){_0xf16fec[_0x2dab('0x1a')](0xcc)[_0x2dab('0x1b')]();});}};}function handleEntityNotFound(_0x1b1c5b,_0x50153d){return function(_0x255478){if(!_0x255478){_0x1b1c5b['sendStatus'](0x194);}return _0x255478;};}function handleError(_0xbe611,_0x11454f){_0x11454f=_0x11454f||0x1f4;return function(_0x594f6f){logger[_0x2dab('0x27')](_0x594f6f[_0x2dab('0x28')]);if(_0x594f6f[_0x2dab('0x29')]){delete _0x594f6f[_0x2dab('0x29')];}_0xbe611['status'](_0x11454f)[_0x2dab('0x2a')](_0x594f6f);};}exports[_0x2dab('0x2b')]=function(_0xa93e,_0x2b15c0){var _0x31cde1={},_0x577a09={},_0x39a899={'count':0x0,'rows':[]};var _0x271d4f=_[_0x2dab('0x2c')](db[_0x2dab('0x2d')][_0x2dab('0x2e')],function(_0x11582d){return{'name':_0x11582d[_0x2dab('0x2f')],'type':_0x11582d[_0x2dab('0x30')][_0x2dab('0x31')]};});_0x577a09['model']=_['map'](_0x271d4f,'name');_0x577a09[_0x2dab('0x32')]=_[_0x2dab('0x33')](_0xa93e[_0x2dab('0x32')]);_0x577a09[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x577a09['model'],_0x577a09[_0x2dab('0x32')]);_0x31cde1['attributes']=_['intersection'](_0x577a09['model'],qs[_0x2dab('0x36')](_0xa93e[_0x2dab('0x32')]['fields']));_0x31cde1['attributes']=_0x31cde1[_0x2dab('0x37')][_0x2dab('0x38')]?_0x31cde1[_0x2dab('0x37')]:_0x577a09[_0x2dab('0x39')];if(!_0xa93e[_0x2dab('0x32')][_0x2dab('0x3a')]('nolimit')){_0x31cde1[_0x2dab('0x1d')]=qs['limit'](_0xa93e[_0x2dab('0x32')][_0x2dab('0x1d')]);_0x31cde1[_0x2dab('0x1c')]=qs[_0x2dab('0x1c')](_0xa93e[_0x2dab('0x32')][_0x2dab('0x1c')]);}_0x31cde1['order']=qs['sort'](_0xa93e[_0x2dab('0x32')][_0x2dab('0x3b')]);_0x31cde1[_0x2dab('0x3c')]=qs[_0x2dab('0x34')](_[_0x2dab('0x3d')](_0xa93e['query'],_0x577a09[_0x2dab('0x34')]),_0x271d4f);if(_0xa93e[_0x2dab('0x32')][_0x2dab('0x3e')]){_0x31cde1[_0x2dab('0x3c')]=_[_0x2dab('0x3f')](_0x31cde1[_0x2dab('0x3c')],{'$or':_[_0x2dab('0x2c')](_0x271d4f,function(_0x3e1b57){if(_0x3e1b57[_0x2dab('0x30')]!==_0x2dab('0x40')){var _0x4dc041={};_0x4dc041[_0x3e1b57[_0x2dab('0x29')]]={'$like':'%'+_0xa93e['query'][_0x2dab('0x3e')]+'%'};return _0x4dc041;}})});}_0x31cde1=_['merge']({},_0x31cde1,_0xa93e[_0x2dab('0x41')]);var _0x5d52b6={'where':_0x31cde1['where']};return db[_0x2dab('0x2d')][_0x2dab('0x1f')](_0x5d52b6)[_0x2dab('0x25')](function(_0x47967e){_0x39a899[_0x2dab('0x1f')]=_0x47967e;if(_0xa93e[_0x2dab('0x32')][_0x2dab('0x42')]){_0x31cde1[_0x2dab('0x43')]=[{'all':!![]}];}return db[_0x2dab('0x2d')][_0x2dab('0x44')](_0x31cde1);})[_0x2dab('0x25')](function(_0x23c7c2){_0x39a899[_0x2dab('0x45')]=_0x23c7c2;return _0x39a899;})[_0x2dab('0x25')](respondWithFilteredResult(_0x2b15c0,_0x31cde1))['catch'](handleError(_0x2b15c0,null));};exports[_0x2dab('0x46')]=function(_0x5c5b73,_0x53239d){var _0x25fd84={'raw':!![],'where':{'id':_0x5c5b73[_0x2dab('0x47')]['id']}},_0x964bad={};_0x964bad['model']=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x964bad[_0x2dab('0x32')]=_['keys'](_0x5c5b73[_0x2dab('0x32')]);_0x964bad[_0x2dab('0x34')]=_[_0x2dab('0x35')](_0x964bad[_0x2dab('0x39')],_0x964bad[_0x2dab('0x32')]);_0x25fd84[_0x2dab('0x37')]=_['intersection'](_0x964bad[_0x2dab('0x39')],qs[_0x2dab('0x36')](_0x5c5b73['query'][_0x2dab('0x36')]));_0x25fd84[_0x2dab('0x37')]=_0x25fd84['attributes']['length']?_0x25fd84[_0x2dab('0x37')]:_0x964bad[_0x2dab('0x39')];if(_0x5c5b73[_0x2dab('0x32')][_0x2dab('0x42')]){_0x25fd84['include']=[{'all':!![]}];}_0x25fd84=_[_0x2dab('0x3f')]({},_0x25fd84,_0x5c5b73[_0x2dab('0x41')]);return db['FaxQueueReport'][_0x2dab('0x48')](_0x25fd84)[_0x2dab('0x25')](handleEntityNotFound(_0x53239d,null))[_0x2dab('0x25')](respondWithResult(_0x53239d,null))[_0x2dab('0x49')](handleError(_0x53239d,null));};exports[_0x2dab('0x4a')]=function(_0x2ee65c,_0x3b0056){return db[_0x2dab('0x2d')][_0x2dab('0x4a')](_0x2ee65c['body'],{})['then'](respondWithResult(_0x3b0056,0xc9))['catch'](handleError(_0x3b0056,null));};exports['update']=function(_0x4b117f,_0x358576){if(_0x4b117f[_0x2dab('0x4b')]['id']){delete _0x4b117f[_0x2dab('0x4b')]['id'];}return db['FaxQueueReport'][_0x2dab('0x48')]({'where':{'id':_0x4b117f[_0x2dab('0x47')]['id']}})[_0x2dab('0x25')](handleEntityNotFound(_0x358576,null))['then'](saveUpdates(_0x4b117f[_0x2dab('0x4b')],null))['then'](respondWithResult(_0x358576,null))[_0x2dab('0x49')](handleError(_0x358576,null));};exports[_0x2dab('0x26')]=function(_0x3d1bfd,_0x83d78d){return db[_0x2dab('0x2d')]['find']({'where':{'id':_0x3d1bfd[_0x2dab('0x47')]['id']}})[_0x2dab('0x25')](handleEntityNotFound(_0x83d78d,null))[_0x2dab('0x25')](removeEntity(_0x83d78d,null))['catch'](handleError(_0x83d78d,null));};exports['describe']=function(_0x580a33,_0x3ce70a){return db[_0x2dab('0x2d')]['describe']()[_0x2dab('0x25')](respondWithResult(_0x3ce70a,null))[_0x2dab('0x49')](handleError(_0x3ce70a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index f501f18..cc70f70 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(_0x536b05,_0x4faea9){var _0x34319e=function(_0x4c23c2){while(--_0x4c23c2){_0x536b05['push'](_0x536b05['shift']());}};_0x34319e(++_0x4faea9);}(_0xe14b,0x93));var _0xbe14=function(_0x34f645,_0x3a894c){_0x34f645=_0x34f645-0x0;var _0x47ca5d=_0xe14b[_0x34f645];return _0x47ca5d;};'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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x337449,_0x783e2f){var _0xed97ef=function(_0x13b255){while(--_0x13b255){_0x337449['push'](_0x337449['shift']());}};_0xed97ef(++_0x783e2f);}(_0xe14b,0x93));var _0xbe14=function(_0x3dff7d,_0x348e2e){_0x3dff7d=_0x3dff7d-0x0;var _0x40e609=_0xe14b[_0x3dff7d];return _0x40e609;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 2e56a2b..d85d2e0 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 _0x95b6=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateFaxQueueReport','create','body','options','raw','then','update','where','attributes','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x7ecc0,_0x3c5cc5){var _0x5d016b=function(_0x4229ad){while(--_0x4229ad){_0x7ecc0['push'](_0x7ecc0['shift']());}};_0x5d016b(++_0x3c5cc5);}(_0x95b6,0x1c8));var _0x695b=function(_0x37b3a4,_0x60d7f7){_0x37b3a4=_0x37b3a4-0x0;var _0x34b357=_0x95b6[_0x37b3a4];return _0x34b357;};'use strict';var _=require(_0x695b('0x0'));var util=require('util');var moment=require(_0x695b('0x1'));var BPromise=require(_0x695b('0x2'));var rs=require(_0x695b('0x3'));var fs=require('fs');var Redis=require(_0x695b('0x4'));var db=require(_0x695b('0x5'))['db'];var utils=require(_0x695b('0x6'));var logger=require('../../config/logger')(_0x695b('0x7'));var config=require(_0x695b('0x8'));var jayson=require(_0x695b('0x9'));var client=jayson[_0x695b('0xa')][_0x695b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x330530,_0x35f34f,_0x34bdfd){return new BPromise(function(_0x521cb7,_0x46f99b){return client[_0x695b('0xc')](_0x330530,_0x34bdfd)['then'](function(_0x4d1d11){logger['info'](_0x695b('0xd'),_0x35f34f,'request\x20sent');logger[_0x695b('0xe')](_0x695b('0xf'),_0x35f34f,_0x695b('0x10'),JSON[_0x695b('0x11')](_0x4d1d11));if(_0x4d1d11[_0x695b('0x12')]){if(_0x4d1d11[_0x695b('0x12')][_0x695b('0x13')]===0x1f4){logger[_0x695b('0x12')](_0x695b('0xd'),_0x35f34f,_0x4d1d11[_0x695b('0x12')][_0x695b('0x14')]);return _0x46f99b(_0x4d1d11[_0x695b('0x12')][_0x695b('0x14')]);}logger[_0x695b('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x35f34f,_0x4d1d11[_0x695b('0x12')][_0x695b('0x14')]);return _0x521cb7(_0x4d1d11['error'][_0x695b('0x14')]);}else{logger[_0x695b('0x15')](_0x695b('0xd'),_0x35f34f,_0x695b('0x10'));_0x521cb7(_0x4d1d11['result'][_0x695b('0x14')]);}})[_0x695b('0x16')](function(_0x57f88b){logger['error'](_0x695b('0xd'),_0x35f34f,_0x57f88b);_0x46f99b(_0x57f88b);});});}exports[_0x695b('0x17')]=function(_0x13daa9){var _0xf56b92=this;return new Promise(function(_0x424d69,_0x1809d9){return db['FaxQueueReport'][_0x695b('0x18')](_0x13daa9[_0x695b('0x19')],{'raw':_0x13daa9[_0x695b('0x1a')]?_0x13daa9['options'][_0x695b('0x1b')]===undefined?!![]:![]:!![]})[_0x695b('0x1c')](function(_0x11d08e){logger[_0x695b('0x15')](_0x695b('0x17'),_0x13daa9);logger[_0x695b('0xe')]('CreateFaxQueueReport',_0x13daa9,JSON[_0x695b('0x11')](_0x11d08e));_0x424d69(_0x11d08e);})[_0x695b('0x16')](function(_0x380f45){logger[_0x695b('0x12')](_0x695b('0x17'),_0x380f45[_0x695b('0x14')],_0x13daa9);_0x1809d9(_0xf56b92[_0x695b('0x12')](0x1f4,_0x380f45['message']));});});};exports['UpdateFaxQueueReport']=function(_0x2b49d1){var _0x20fc78=this;return new Promise(function(_0x2dfb12,_0x53bf15){return db['FaxQueueReport'][_0x695b('0x1d')](_0x2b49d1[_0x695b('0x19')],{'raw':_0x2b49d1['options']?_0x2b49d1[_0x695b('0x1a')][_0x695b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b49d1['options']?_0x2b49d1[_0x695b('0x1a')][_0x695b('0x1e')]||null:null,'attributes':_0x2b49d1[_0x695b('0x1a')]?_0x2b49d1[_0x695b('0x1a')][_0x695b('0x1f')]||null:null,'limit':_0x2b49d1[_0x695b('0x1a')]?_0x2b49d1[_0x695b('0x1a')]['limit']||null:null})[_0x695b('0x1c')](function(_0x82907c){logger[_0x695b('0x15')](_0x695b('0x20'),_0x2b49d1);logger['debug']('UpdateFaxQueueReport',_0x2b49d1,JSON['stringify'](_0x82907c));_0x2dfb12(_0x82907c);})[_0x695b('0x16')](function(_0xfb4324){logger[_0x695b('0x12')](_0x695b('0x20'),_0xfb4324[_0x695b('0x14')],_0x2b49d1);_0x53bf15(_0x20fc78[_0x695b('0x12')](0x1f4,_0xfb4324[_0x695b('0x14')]));});});}; \ No newline at end of file +var _0x5ac1=['CreateFaxQueueReport','FaxQueueReport','body','raw','then','UpdateFaxQueueReport','update','options','where','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x5ac1,0xfa));var _0x15ac=function(_0x24c6b3,_0x311f39){_0x24c6b3=_0x24c6b3-0x0;var _0x24f6cd=_0x5ac1[_0x24c6b3];return _0x24f6cd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x15ac('0x0'));var BPromise=require('bluebird');var rs=require(_0x15ac('0x1'));var fs=require('fs');var Redis=require(_0x15ac('0x2'));var db=require(_0x15ac('0x3'))['db'];var utils=require(_0x15ac('0x4'));var logger=require(_0x15ac('0x5'))(_0x15ac('0x6'));var config=require(_0x15ac('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x15ac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21e8a4,_0x3eb8a7,_0x73db7e){return new BPromise(function(_0x525e97,_0x2af939){return client[_0x15ac('0x9')](_0x21e8a4,_0x73db7e)['then'](function(_0x1c78d6){logger[_0x15ac('0xa')](_0x15ac('0xb'),_0x3eb8a7,'request\x20sent');logger['debug'](_0x15ac('0xc'),_0x3eb8a7,'request\x20sent',JSON[_0x15ac('0xd')](_0x1c78d6));if(_0x1c78d6[_0x15ac('0xe')]){if(_0x1c78d6[_0x15ac('0xe')][_0x15ac('0xf')]===0x1f4){logger[_0x15ac('0xe')](_0x15ac('0xb'),_0x3eb8a7,_0x1c78d6[_0x15ac('0xe')][_0x15ac('0x10')]);return _0x2af939(_0x1c78d6[_0x15ac('0xe')][_0x15ac('0x10')]);}logger['error'](_0x15ac('0xb'),_0x3eb8a7,_0x1c78d6['error'][_0x15ac('0x10')]);return _0x525e97(_0x1c78d6[_0x15ac('0xe')][_0x15ac('0x10')]);}else{logger[_0x15ac('0xa')](_0x15ac('0xb'),_0x3eb8a7,_0x15ac('0x11'));_0x525e97(_0x1c78d6[_0x15ac('0x12')][_0x15ac('0x10')]);}})[_0x15ac('0x13')](function(_0x3b117e){logger[_0x15ac('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x3eb8a7,_0x3b117e);_0x2af939(_0x3b117e);});});}exports[_0x15ac('0x14')]=function(_0x45fbd9){var _0x1d3f05=this;return new Promise(function(_0x59ba58,_0x1c0673){return db[_0x15ac('0x15')]['create'](_0x45fbd9[_0x15ac('0x16')],{'raw':_0x45fbd9['options']?_0x45fbd9['options'][_0x15ac('0x17')]===undefined?!![]:![]:!![]})[_0x15ac('0x18')](function(_0x484551){logger['info']('CreateFaxQueueReport',_0x45fbd9);logger['debug'](_0x15ac('0x14'),_0x45fbd9,JSON[_0x15ac('0xd')](_0x484551));_0x59ba58(_0x484551);})[_0x15ac('0x13')](function(_0x598dd2){logger[_0x15ac('0xe')](_0x15ac('0x14'),_0x598dd2[_0x15ac('0x10')],_0x45fbd9);_0x1c0673(_0x1d3f05[_0x15ac('0xe')](0x1f4,_0x598dd2['message']));});});};exports[_0x15ac('0x19')]=function(_0x48655e){var _0x54edf7=this;return new Promise(function(_0x2dc2cd,_0x3f485){return db['FaxQueueReport'][_0x15ac('0x1a')](_0x48655e['body'],{'raw':_0x48655e['options']?_0x48655e[_0x15ac('0x1b')][_0x15ac('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48655e[_0x15ac('0x1b')]?_0x48655e['options'][_0x15ac('0x1c')]||null:null,'attributes':_0x48655e['options']?_0x48655e[_0x15ac('0x1b')]['attributes']||null:null,'limit':_0x48655e[_0x15ac('0x1b')]?_0x48655e[_0x15ac('0x1b')]['limit']||null:null})[_0x15ac('0x18')](function(_0x592686){logger['info']('UpdateFaxQueueReport',_0x48655e);logger[_0x15ac('0x1d')](_0x15ac('0x19'),_0x48655e,JSON[_0x15ac('0xd')](_0x592686));_0x2dc2cd(_0x592686);})[_0x15ac('0x13')](function(_0x1e4184){logger[_0x15ac('0xe')](_0x15ac('0x19'),_0x1e4184['message'],_0x48655e);_0x3f485(_0x54edf7['error'](0x1f4,_0x1e4184[_0x15ac('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 9f62d7b..d52bb2a 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 _0xe1b1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x53f4ec,_0x43aa2a){var _0x506123=function(_0x2822a2){while(--_0x2822a2){_0x53f4ec['push'](_0x53f4ec['shift']());}};_0x506123(++_0x43aa2a);}(_0xe1b1,0x160));var _0x1e1b=function(_0xecb87c,_0x87ad1b){_0xecb87c=_0xecb87c-0x0;var _0x3f47bc=_0xe1b1[_0xecb87c];return _0x3f47bc;};'use strict';var multer=require(_0x1e1b('0x0'));var util=require('util');var path=require(_0x1e1b('0x1'));var timeout=require(_0x1e1b('0x2'));var express=require(_0x1e1b('0x3'));var router=express[_0x1e1b('0x4')]();var fs_extra=require(_0x1e1b('0x5'));var auth=require(_0x1e1b('0x6'));var interaction=require(_0x1e1b('0x7'));var config=require(_0x1e1b('0x8'));var controller=require('./faxQueueReport.controller');router[_0x1e1b('0x9')]('/',auth[_0x1e1b('0xa')](),controller[_0x1e1b('0xb')]);router[_0x1e1b('0x9')](_0x1e1b('0xc'),auth[_0x1e1b('0xa')](),controller[_0x1e1b('0xd')]);router[_0x1e1b('0x9')](_0x1e1b('0xe'),auth[_0x1e1b('0xa')](),controller[_0x1e1b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1e1b('0x10')]);router[_0x1e1b('0x11')](_0x1e1b('0xe'),auth[_0x1e1b('0xa')](),controller[_0x1e1b('0x12')]);router[_0x1e1b('0x13')]('/:id',auth[_0x1e1b('0xa')](),controller[_0x1e1b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7068=['show','post','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4ae63b,_0x3bdeb2){var _0x160967=function(_0x3ee979){while(--_0x3ee979){_0x4ae63b['push'](_0x4ae63b['shift']());}};_0x160967(++_0x3bdeb2);}(_0x7068,0x10e));var _0x8706=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0x7068[_0x4733d3];return _0x1b9a44;};'use strict';var multer=require(_0x8706('0x0'));var util=require(_0x8706('0x1'));var path=require(_0x8706('0x2'));var timeout=require('connect-timeout');var express=require(_0x8706('0x3'));var router=express[_0x8706('0x4')]();var fs_extra=require(_0x8706('0x5'));var auth=require(_0x8706('0x6'));var interaction=require(_0x8706('0x7'));var config=require(_0x8706('0x8'));var controller=require(_0x8706('0x9'));router[_0x8706('0xa')]('/',auth[_0x8706('0xb')](),controller[_0x8706('0xc')]);router['get'](_0x8706('0xd'),auth['isAuthenticated'](),controller[_0x8706('0xe')]);router[_0x8706('0xa')](_0x8706('0xf'),auth[_0x8706('0xb')](),controller[_0x8706('0x10')]);router[_0x8706('0x11')]('/',auth[_0x8706('0xb')](),controller[_0x8706('0x12')]);router[_0x8706('0x13')](_0x8706('0xf'),auth[_0x8706('0xb')](),controller[_0x8706('0x14')]);router['delete']('/:id',auth[_0x8706('0xb')](),controller['destroy']);module[_0x8706('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index f41e0da..f11071e 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x2d9e35,_0x2b6ce1){var _0x3862da=function(_0x3a9498){while(--_0x3a9498){_0x2d9e35['push'](_0x2d9e35['shift']());}};_0x3862da(++_0x2b6ce1);}(_0xedd9,0xfc));var _0x9edd=function(_0x48c20a,_0x59fcb2){_0x48c20a=_0x48c20a-0x0;var _0x3ad072=_0xedd9[_0x48c20a];return _0x3ad072;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0x9bde,0xe1));var _0xe9bd=function(_0x24ccae,_0x5a0a0a){_0x24ccae=_0x24ccae-0x0;var _0x2e550b=_0x9bde[_0x24ccae];return _0x2e550b;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index b05da0b..8a8021a 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 _0xef48=['update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','include','find','create','body'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0xef48,0x189));var _0x8ef4=function(_0x8c767a,_0x46c7d9){_0x8c767a=_0x8c767a-0x0;var _0x409447=_0xef48[_0x8c767a];return _0x409447;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ef4('0x0'));var zipdir=require(_0x8ef4('0x1'));var jsonpatch=require(_0x8ef4('0x2'));var rp=require(_0x8ef4('0x3'));var moment=require(_0x8ef4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8ef4('0x5'));var util=require(_0x8ef4('0x6'));var path=require(_0x8ef4('0x7'));var sox=require(_0x8ef4('0x8'));var csv=require(_0x8ef4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ef4('0xa'));var _=require(_0x8ef4('0xb'));var squel=require(_0x8ef4('0xc'));var crypto=require(_0x8ef4('0xd'));var jsforce=require(_0x8ef4('0xe'));var deskjs=require(_0x8ef4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8ef4('0x10'));var Papa=require(_0x8ef4('0x11'));var Redis=require(_0x8ef4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8ef4('0x13'));var as=require(_0x8ef4('0x14'));var hardwareService=require(_0x8ef4('0x15'));var logger=require(_0x8ef4('0x16'))('api');var utils=require(_0x8ef4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8ef4('0x18'));var db=require(_0x8ef4('0x19'))['db'];function respondWithStatusCode(_0x245540,_0x1072f1){_0x1072f1=_0x1072f1||0xcc;return function(_0x11e99e){if(_0x11e99e){return _0x245540[_0x8ef4('0x1a')](_0x1072f1);}return _0x245540[_0x8ef4('0x1b')](_0x1072f1)[_0x8ef4('0x1c')]();};}function respondWithResult(_0xc032dd,_0x23aa3b){_0x23aa3b=_0x23aa3b||0xc8;return function(_0x51d701){if(_0x51d701){return _0xc032dd['status'](_0x23aa3b)[_0x8ef4('0x1d')](_0x51d701);}};}function respondWithFilteredResult(_0x2aaef2,_0x3de30b){return function(_0x1aedb8){if(_0x1aedb8){var _0x57f0bd=typeof _0x3de30b[_0x8ef4('0x1e')]===_0x8ef4('0x1f')&&typeof _0x3de30b[_0x8ef4('0x20')]===_0x8ef4('0x1f');var _0x31b86a=_0x1aedb8[_0x8ef4('0x21')];var _0xf87898=_0x57f0bd?0x0:_0x3de30b[_0x8ef4('0x1e')];var _0x10ee70=_0x57f0bd?_0x1aedb8[_0x8ef4('0x21')]:_0x3de30b[_0x8ef4('0x1e')]+_0x3de30b[_0x8ef4('0x20')];var _0x2c4e81;if(_0x10ee70>=_0x31b86a){_0x10ee70=_0x31b86a;_0x2c4e81=0xc8;}else{_0x2c4e81=0xce;}_0x2aaef2[_0x8ef4('0x1b')](_0x2c4e81);return _0x2aaef2[_0x8ef4('0x22')](_0x8ef4('0x23'),_0xf87898+'-'+_0x10ee70+'/'+_0x31b86a)['json'](_0x1aedb8);}return null;};}function patchUpdates(_0x106418){return function(_0x5c3231){try{jsonpatch['apply'](_0x5c3231,_0x106418,!![]);}catch(_0x2aa911){return BPromise[_0x8ef4('0x24')](_0x2aa911);}return _0x5c3231[_0x8ef4('0x25')]();};}function saveUpdates(_0x1da5ed,_0x396a2e){return function(_0x46c7f6){if(_0x46c7f6){return _0x46c7f6['update'](_0x1da5ed)[_0x8ef4('0x26')](function(_0x1ca0cd){return _0x1ca0cd;});}return null;};}function removeEntity(_0x598b8e,_0x5b67d8){return function(_0x50520c){if(_0x50520c){return _0x50520c[_0x8ef4('0x27')]()[_0x8ef4('0x26')](function(){_0x598b8e[_0x8ef4('0x1b')](0xcc)[_0x8ef4('0x1c')]();});}};}function handleEntityNotFound(_0x16c429,_0x514d28){return function(_0x5e5177){if(!_0x5e5177){_0x16c429[_0x8ef4('0x1a')](0x194);}return _0x5e5177;};}function handleError(_0xaa3700,_0x348649){_0x348649=_0x348649||0x1f4;return function(_0x451045){logger[_0x8ef4('0x28')](_0x451045[_0x8ef4('0x29')]);if(_0x451045['name']){delete _0x451045['name'];}_0xaa3700[_0x8ef4('0x1b')](_0x348649)[_0x8ef4('0x2a')](_0x451045);};}exports[_0x8ef4('0x2b')]=function(_0x5703b5,_0x17f85a){var _0x1bd257={},_0x2750d6={},_0x26c4fd={'count':0x0,'rows':[]};var _0x2c8f05=_[_0x8ef4('0x2c')](db[_0x8ef4('0x2d')][_0x8ef4('0x2e')],function(_0x595d77){return{'name':_0x595d77[_0x8ef4('0x2f')],'type':_0x595d77[_0x8ef4('0x30')][_0x8ef4('0x31')]};});_0x2750d6[_0x8ef4('0x32')]=_[_0x8ef4('0x2c')](_0x2c8f05,_0x8ef4('0x33'));_0x2750d6[_0x8ef4('0x34')]=_[_0x8ef4('0x35')](_0x5703b5[_0x8ef4('0x34')]);_0x2750d6[_0x8ef4('0x36')]=_[_0x8ef4('0x37')](_0x2750d6['model'],_0x2750d6['query']);_0x1bd257[_0x8ef4('0x38')]=_[_0x8ef4('0x37')](_0x2750d6[_0x8ef4('0x32')],qs[_0x8ef4('0x39')](_0x5703b5['query'][_0x8ef4('0x39')]));_0x1bd257[_0x8ef4('0x38')]=_0x1bd257['attributes'][_0x8ef4('0x3a')]?_0x1bd257[_0x8ef4('0x38')]:_0x2750d6['model'];if(!_0x5703b5['query']['hasOwnProperty']('nolimit')){_0x1bd257[_0x8ef4('0x20')]=qs[_0x8ef4('0x20')](_0x5703b5['query'][_0x8ef4('0x20')]);_0x1bd257['offset']=qs[_0x8ef4('0x1e')](_0x5703b5[_0x8ef4('0x34')][_0x8ef4('0x1e')]);}_0x1bd257[_0x8ef4('0x3b')]=qs[_0x8ef4('0x3c')](_0x5703b5['query']['sort']);_0x1bd257[_0x8ef4('0x3d')]=qs[_0x8ef4('0x36')](_[_0x8ef4('0x3e')](_0x5703b5[_0x8ef4('0x34')],_0x2750d6['filters']),_0x2c8f05);if(_0x5703b5[_0x8ef4('0x34')]['filter']){_0x1bd257[_0x8ef4('0x3d')]=_[_0x8ef4('0x3f')](_0x1bd257['where'],{'$or':_['map'](_0x2c8f05,function(_0x358b57){if(_0x358b57['type']!==_0x8ef4('0x40')){var _0x21e7d4={};_0x21e7d4[_0x358b57[_0x8ef4('0x33')]]={'$like':'%'+_0x5703b5['query'][_0x8ef4('0x41')]+'%'};return _0x21e7d4;}})});}_0x1bd257=_[_0x8ef4('0x3f')]({},_0x1bd257,_0x5703b5[_0x8ef4('0x42')]);var _0x129f17={'where':_0x1bd257['where']};return db['FaxTransferReport'][_0x8ef4('0x21')](_0x129f17)['then'](function(_0x20afea){_0x26c4fd[_0x8ef4('0x21')]=_0x20afea;if(_0x5703b5[_0x8ef4('0x34')][_0x8ef4('0x43')]){_0x1bd257['include']=[{'all':!![]}];}return db[_0x8ef4('0x2d')][_0x8ef4('0x44')](_0x1bd257);})[_0x8ef4('0x26')](function(_0x2d609f){_0x26c4fd['rows']=_0x2d609f;return _0x26c4fd;})[_0x8ef4('0x26')](respondWithFilteredResult(_0x17f85a,_0x1bd257))[_0x8ef4('0x45')](handleError(_0x17f85a,null));};exports[_0x8ef4('0x46')]=function(_0x328c8b,_0x2d6deb){var _0x4bbfb0={'raw':!![],'where':{'id':_0x328c8b['params']['id']}},_0x199ea3={};_0x199ea3['model']=_[_0x8ef4('0x35')](db[_0x8ef4('0x2d')][_0x8ef4('0x2e')]);_0x199ea3[_0x8ef4('0x34')]=_[_0x8ef4('0x35')](_0x328c8b['query']);_0x199ea3[_0x8ef4('0x36')]=_[_0x8ef4('0x37')](_0x199ea3['model'],_0x199ea3[_0x8ef4('0x34')]);_0x4bbfb0[_0x8ef4('0x38')]=_[_0x8ef4('0x37')](_0x199ea3[_0x8ef4('0x32')],qs[_0x8ef4('0x39')](_0x328c8b['query'][_0x8ef4('0x39')]));_0x4bbfb0[_0x8ef4('0x38')]=_0x4bbfb0[_0x8ef4('0x38')][_0x8ef4('0x3a')]?_0x4bbfb0[_0x8ef4('0x38')]:_0x199ea3['model'];if(_0x328c8b[_0x8ef4('0x34')][_0x8ef4('0x43')]){_0x4bbfb0[_0x8ef4('0x47')]=[{'all':!![]}];}_0x4bbfb0=_['merge']({},_0x4bbfb0,_0x328c8b[_0x8ef4('0x42')]);return db[_0x8ef4('0x2d')][_0x8ef4('0x48')](_0x4bbfb0)[_0x8ef4('0x26')](handleEntityNotFound(_0x2d6deb,null))[_0x8ef4('0x26')](respondWithResult(_0x2d6deb,null))[_0x8ef4('0x45')](handleError(_0x2d6deb,null));};exports[_0x8ef4('0x49')]=function(_0x424a95,_0x589242){return db[_0x8ef4('0x2d')][_0x8ef4('0x49')](_0x424a95[_0x8ef4('0x4a')],{})[_0x8ef4('0x26')](respondWithResult(_0x589242,0xc9))[_0x8ef4('0x45')](handleError(_0x589242,null));};exports[_0x8ef4('0x4b')]=function(_0x383ed1,_0x3d4d4d){if(_0x383ed1[_0x8ef4('0x4a')]['id']){delete _0x383ed1[_0x8ef4('0x4a')]['id'];}return db[_0x8ef4('0x2d')][_0x8ef4('0x48')]({'where':{'id':_0x383ed1[_0x8ef4('0x4c')]['id']}})[_0x8ef4('0x26')](handleEntityNotFound(_0x3d4d4d,null))[_0x8ef4('0x26')](saveUpdates(_0x383ed1['body'],null))[_0x8ef4('0x26')](respondWithResult(_0x3d4d4d,null))[_0x8ef4('0x45')](handleError(_0x3d4d4d,null));};exports[_0x8ef4('0x27')]=function(_0x3823fd,_0x5c8eaa){return db[_0x8ef4('0x2d')]['find']({'where':{'id':_0x3823fd[_0x8ef4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5c8eaa,null))[_0x8ef4('0x26')](removeEntity(_0x5c8eaa,null))[_0x8ef4('0x45')](handleError(_0x5c8eaa,null));};exports[_0x8ef4('0x4d')]=function(_0x4369c3,_0x5d08f2){return db[_0x8ef4('0x2d')]['describe']()[_0x8ef4('0x26')](respondWithResult(_0x5d08f2,null))['catch'](handleError(_0x5d08f2,null));}; \ No newline at end of file +var _0x6b92=['merge','VIRTUAL','include','rows','show','params','includeAll','options','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','then','error','stack','name','send','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x6b92,0x1b2));var _0x26b9=function(_0x4bc927,_0x25e1da){_0x4bc927=_0x4bc927-0x0;var _0x4f08a8=_0x6b92[_0x4bc927];return _0x4f08a8;};'use strict';var emlformat=require(_0x26b9('0x0'));var rimraf=require(_0x26b9('0x1'));var zipdir=require(_0x26b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x26b9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x26b9('0x4'));var util=require(_0x26b9('0x5'));var path=require('path');var sox=require(_0x26b9('0x6'));var csv=require('to-csv');var ejs=require(_0x26b9('0x7'));var fs=require('fs');var fs_extra=require(_0x26b9('0x8'));var _=require(_0x26b9('0x9'));var squel=require(_0x26b9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x26b9('0xb'));var toCsv=require('to-csv');var querystring=require(_0x26b9('0xc'));var Papa=require(_0x26b9('0xd'));var Redis=require(_0x26b9('0xe'));var authService=require(_0x26b9('0xf'));var qs=require(_0x26b9('0x10'));var as=require(_0x26b9('0x11'));var hardwareService=require(_0x26b9('0x12'));var logger=require('../../config/logger')(_0x26b9('0x13'));var utils=require(_0x26b9('0x14'));var config=require(_0x26b9('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ae36b,_0x321e54){_0x321e54=_0x321e54||0xcc;return function(_0xa93773){if(_0xa93773){return _0x2ae36b[_0x26b9('0x16')](_0x321e54);}return _0x2ae36b[_0x26b9('0x17')](_0x321e54)['end']();};}function respondWithResult(_0x5057dc,_0x42410d){_0x42410d=_0x42410d||0xc8;return function(_0x566e4a){if(_0x566e4a){return _0x5057dc['status'](_0x42410d)[_0x26b9('0x18')](_0x566e4a);}};}function respondWithFilteredResult(_0x441759,_0x456c81){return function(_0x1f8add){if(_0x1f8add){var _0xccbaee=typeof _0x456c81[_0x26b9('0x19')]===_0x26b9('0x1a')&&typeof _0x456c81['limit']===_0x26b9('0x1a');var _0x89269e=_0x1f8add[_0x26b9('0x1b')];var _0x26ccb2=_0xccbaee?0x0:_0x456c81[_0x26b9('0x19')];var _0x49b78b=_0xccbaee?_0x1f8add[_0x26b9('0x1b')]:_0x456c81[_0x26b9('0x19')]+_0x456c81[_0x26b9('0x1c')];var _0x5e5240;if(_0x49b78b>=_0x89269e){_0x49b78b=_0x89269e;_0x5e5240=0xc8;}else{_0x5e5240=0xce;}_0x441759[_0x26b9('0x17')](_0x5e5240);return _0x441759[_0x26b9('0x1d')]('Content-Range',_0x26ccb2+'-'+_0x49b78b+'/'+_0x89269e)['json'](_0x1f8add);}return null;};}function patchUpdates(_0x137da9){return function(_0x36a0e0){try{jsonpatch[_0x26b9('0x1e')](_0x36a0e0,_0x137da9,!![]);}catch(_0x26b111){return BPromise[_0x26b9('0x1f')](_0x26b111);}return _0x36a0e0['save']();};}function saveUpdates(_0x994e5b,_0x415b2d){return function(_0x2135ce){if(_0x2135ce){return _0x2135ce[_0x26b9('0x20')](_0x994e5b)[_0x26b9('0x21')](function(_0x3c36b3){return _0x3c36b3;});}return null;};}function removeEntity(_0x815ce5,_0x30bfad){return function(_0x15a631){if(_0x15a631){return _0x15a631['destroy']()[_0x26b9('0x21')](function(){_0x815ce5[_0x26b9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ffc91,_0x2c6949){return function(_0x320088){if(!_0x320088){_0x4ffc91[_0x26b9('0x16')](0x194);}return _0x320088;};}function handleError(_0x36873e,_0x195b88){_0x195b88=_0x195b88||0x1f4;return function(_0x2490cc){logger[_0x26b9('0x22')](_0x2490cc[_0x26b9('0x23')]);if(_0x2490cc[_0x26b9('0x24')]){delete _0x2490cc[_0x26b9('0x24')];}_0x36873e[_0x26b9('0x17')](_0x195b88)[_0x26b9('0x25')](_0x2490cc);};}exports[_0x26b9('0x26')]=function(_0x510379,_0x4b8fa8){var _0x58e829={},_0x27b7bb={},_0xcdeac3={'count':0x0,'rows':[]};var _0x2fd188=_[_0x26b9('0x27')](db[_0x26b9('0x28')]['rawAttributes'],function(_0x43d95d){return{'name':_0x43d95d[_0x26b9('0x29')],'type':_0x43d95d[_0x26b9('0x2a')][_0x26b9('0x2b')]};});_0x27b7bb[_0x26b9('0x2c')]=_[_0x26b9('0x27')](_0x2fd188,_0x26b9('0x24'));_0x27b7bb[_0x26b9('0x2d')]=_[_0x26b9('0x2e')](_0x510379[_0x26b9('0x2d')]);_0x27b7bb[_0x26b9('0x2f')]=_[_0x26b9('0x30')](_0x27b7bb['model'],_0x27b7bb[_0x26b9('0x2d')]);_0x58e829[_0x26b9('0x31')]=_[_0x26b9('0x30')](_0x27b7bb[_0x26b9('0x2c')],qs[_0x26b9('0x32')](_0x510379['query']['fields']));_0x58e829[_0x26b9('0x31')]=_0x58e829[_0x26b9('0x31')]['length']?_0x58e829[_0x26b9('0x31')]:_0x27b7bb['model'];if(!_0x510379[_0x26b9('0x2d')][_0x26b9('0x33')]('nolimit')){_0x58e829[_0x26b9('0x1c')]=qs[_0x26b9('0x1c')](_0x510379[_0x26b9('0x2d')]['limit']);_0x58e829[_0x26b9('0x19')]=qs['offset'](_0x510379[_0x26b9('0x2d')][_0x26b9('0x19')]);}_0x58e829['order']=qs['sort'](_0x510379['query'][_0x26b9('0x34')]);_0x58e829['where']=qs[_0x26b9('0x2f')](_[_0x26b9('0x35')](_0x510379[_0x26b9('0x2d')],_0x27b7bb['filters']),_0x2fd188);if(_0x510379['query'][_0x26b9('0x36')]){_0x58e829[_0x26b9('0x37')]=_[_0x26b9('0x38')](_0x58e829['where'],{'$or':_[_0x26b9('0x27')](_0x2fd188,function(_0x57fee0){if(_0x57fee0[_0x26b9('0x2a')]!==_0x26b9('0x39')){var _0x53cb86={};_0x53cb86[_0x57fee0['name']]={'$like':'%'+_0x510379[_0x26b9('0x2d')][_0x26b9('0x36')]+'%'};return _0x53cb86;}})});}_0x58e829=_[_0x26b9('0x38')]({},_0x58e829,_0x510379['options']);var _0x44b8ec={'where':_0x58e829[_0x26b9('0x37')]};return db[_0x26b9('0x28')][_0x26b9('0x1b')](_0x44b8ec)[_0x26b9('0x21')](function(_0x452e74){_0xcdeac3['count']=_0x452e74;if(_0x510379[_0x26b9('0x2d')]['includeAll']){_0x58e829[_0x26b9('0x3a')]=[{'all':!![]}];}return db[_0x26b9('0x28')]['findAll'](_0x58e829);})[_0x26b9('0x21')](function(_0x3322d6){_0xcdeac3[_0x26b9('0x3b')]=_0x3322d6;return _0xcdeac3;})['then'](respondWithFilteredResult(_0x4b8fa8,_0x58e829))['catch'](handleError(_0x4b8fa8,null));};exports[_0x26b9('0x3c')]=function(_0x431f0c,_0x5a5c27){var _0x36bdc7={'raw':!![],'where':{'id':_0x431f0c[_0x26b9('0x3d')]['id']}},_0xef65e9={};_0xef65e9['model']=_[_0x26b9('0x2e')](db[_0x26b9('0x28')]['rawAttributes']);_0xef65e9[_0x26b9('0x2d')]=_[_0x26b9('0x2e')](_0x431f0c[_0x26b9('0x2d')]);_0xef65e9[_0x26b9('0x2f')]=_[_0x26b9('0x30')](_0xef65e9['model'],_0xef65e9[_0x26b9('0x2d')]);_0x36bdc7['attributes']=_[_0x26b9('0x30')](_0xef65e9[_0x26b9('0x2c')],qs[_0x26b9('0x32')](_0x431f0c[_0x26b9('0x2d')][_0x26b9('0x32')]));_0x36bdc7[_0x26b9('0x31')]=_0x36bdc7[_0x26b9('0x31')]['length']?_0x36bdc7[_0x26b9('0x31')]:_0xef65e9['model'];if(_0x431f0c[_0x26b9('0x2d')][_0x26b9('0x3e')]){_0x36bdc7['include']=[{'all':!![]}];}_0x36bdc7=_[_0x26b9('0x38')]({},_0x36bdc7,_0x431f0c[_0x26b9('0x3f')]);return db[_0x26b9('0x28')][_0x26b9('0x40')](_0x36bdc7)[_0x26b9('0x21')](handleEntityNotFound(_0x5a5c27,null))[_0x26b9('0x21')](respondWithResult(_0x5a5c27,null))[_0x26b9('0x41')](handleError(_0x5a5c27,null));};exports[_0x26b9('0x42')]=function(_0x4d4278,_0x4235e9){return db[_0x26b9('0x28')][_0x26b9('0x42')](_0x4d4278['body'],{})[_0x26b9('0x21')](respondWithResult(_0x4235e9,0xc9))[_0x26b9('0x41')](handleError(_0x4235e9,null));};exports['update']=function(_0x2e9d6c,_0x509802){if(_0x2e9d6c[_0x26b9('0x43')]['id']){delete _0x2e9d6c[_0x26b9('0x43')]['id'];}return db[_0x26b9('0x28')]['find']({'where':{'id':_0x2e9d6c[_0x26b9('0x3d')]['id']}})[_0x26b9('0x21')](handleEntityNotFound(_0x509802,null))[_0x26b9('0x21')](saveUpdates(_0x2e9d6c['body'],null))[_0x26b9('0x21')](respondWithResult(_0x509802,null))['catch'](handleError(_0x509802,null));};exports[_0x26b9('0x44')]=function(_0x38652e,_0x4be34e){return db[_0x26b9('0x28')][_0x26b9('0x40')]({'where':{'id':_0x38652e['params']['id']}})[_0x26b9('0x21')](handleEntityNotFound(_0x4be34e,null))[_0x26b9('0x21')](removeEntity(_0x4be34e,null))[_0x26b9('0x41')](handleError(_0x4be34e,null));};exports[_0x26b9('0x45')]=function(_0x38a1ae,_0x384205){return db[_0x26b9('0x28')]['describe']()['then'](respondWithResult(_0x384205,null))[_0x26b9('0x41')](handleError(_0x384205,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index d96a409..4b9a3e3 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 _0x61c0=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x61c0,0x1b1));var _0x061c=function(_0x3fa9ed,_0x336669){_0x3fa9ed=_0x3fa9ed-0x0;var _0x4e2abd=_0x61c0[_0x3fa9ed];return _0x4e2abd;};'use strict';var _=require(_0x061c('0x0'));var util=require('util');var logger=require(_0x061c('0x1'))(_0x061c('0x2'));var moment=require(_0x061c('0x3'));var BPromise=require(_0x061c('0x4'));var rp=require(_0x061c('0x5'));var fs=require('fs');var path=require(_0x061c('0x6'));var rimraf=require(_0x061c('0x7'));var config=require(_0x061c('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0x061c('0x9')]=function(_0x48e9a9,_0x2d76a4){return _0x48e9a9[_0x061c('0xa')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x061c('0xb'),'fields':[_0x061c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7208=['exports','define','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./faxTransferReport.attributes'];(function(_0x1df340,_0x2436c5){var _0x2eda25=function(_0x859a3){while(--_0x859a3){_0x1df340['push'](_0x1df340['shift']());}};_0x2eda25(++_0x2436c5);}(_0x7208,0x16b));var _0x8720=function(_0x568191,_0x7f3c01){_0x568191=_0x568191-0x0;var _0x1a212e=_0x7208[_0x568191];return _0x1a212e;};'use strict';var _=require(_0x8720('0x0'));var util=require('util');var logger=require(_0x8720('0x1'))(_0x8720('0x2'));var moment=require('moment');var BPromise=require(_0x8720('0x3'));var rp=require(_0x8720('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8720('0x5'));var attributes=require(_0x8720('0x6'));module[_0x8720('0x7')]=function(_0x239e88,_0x2a8191){return _0x239e88[_0x8720('0x8')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x8720('0x9'),'fields':[_0x8720('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index a105b99..dd761eb 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 _0x9d5f=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x9d5f,0xa3));var _0xf9d5=function(_0xb57896,_0x71357d){_0xb57896=_0xb57896-0x0;var _0x57a743=_0x9d5f[_0xb57896];return _0x57a743;};'use strict';var _=require('lodash');var util=require(_0xf9d5('0x0'));var moment=require('moment');var BPromise=require(_0xf9d5('0x1'));var rs=require(_0xf9d5('0x2'));var fs=require('fs');var Redis=require(_0xf9d5('0x3'));var db=require(_0xf9d5('0x4'))['db'];var utils=require(_0xf9d5('0x5'));var logger=require(_0xf9d5('0x6'))(_0xf9d5('0x7'));var config=require(_0xf9d5('0x8'));var jayson=require(_0xf9d5('0x9'));var client=jayson['client'][_0xf9d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f5013,_0xab1735,_0x368ded){return new BPromise(function(_0x51ff1b,_0x8378c6){return client[_0xf9d5('0xb')](_0x4f5013,_0x368ded)['then'](function(_0x3a7b9b){logger[_0xf9d5('0xc')](_0xf9d5('0xd'),_0xab1735,_0xf9d5('0xe'));logger[_0xf9d5('0xf')](_0xf9d5('0x10'),_0xab1735,_0xf9d5('0xe'),JSON[_0xf9d5('0x11')](_0x3a7b9b));if(_0x3a7b9b[_0xf9d5('0x12')]){if(_0x3a7b9b[_0xf9d5('0x12')]['code']===0x1f4){logger[_0xf9d5('0x12')](_0xf9d5('0xd'),_0xab1735,_0x3a7b9b[_0xf9d5('0x12')][_0xf9d5('0x13')]);return _0x8378c6(_0x3a7b9b['error'][_0xf9d5('0x13')]);}logger[_0xf9d5('0x12')](_0xf9d5('0xd'),_0xab1735,_0x3a7b9b[_0xf9d5('0x12')][_0xf9d5('0x13')]);return _0x51ff1b(_0x3a7b9b['error'][_0xf9d5('0x13')]);}else{logger[_0xf9d5('0xc')](_0xf9d5('0xd'),_0xab1735,'request\x20sent');_0x51ff1b(_0x3a7b9b[_0xf9d5('0x14')][_0xf9d5('0x13')]);}})[_0xf9d5('0x15')](function(_0x1a35d6){logger['error'](_0xf9d5('0xd'),_0xab1735,_0x1a35d6);_0x8378c6(_0x1a35d6);});});} \ No newline at end of file +var _0x3c95=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x3c95,0x1f4));var _0x53c9=function(_0x573365,_0x72a344){_0x573365=_0x573365-0x0;var _0xe99fbb=_0x3c95[_0x573365];return _0xe99fbb;};'use strict';var _=require(_0x53c9('0x0'));var util=require(_0x53c9('0x1'));var moment=require(_0x53c9('0x2'));var BPromise=require(_0x53c9('0x3'));var rs=require(_0x53c9('0x4'));var fs=require('fs');var Redis=require(_0x53c9('0x5'));var db=require(_0x53c9('0x6'))['db'];var utils=require(_0x53c9('0x7'));var logger=require(_0x53c9('0x8'))(_0x53c9('0x9'));var config=require(_0x53c9('0xa'));var jayson=require(_0x53c9('0xb'));var client=jayson[_0x53c9('0xc')][_0x53c9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2bc67f,_0x165345,_0x1cf35a){return new BPromise(function(_0x4f2209,_0x3d5d5a){return client[_0x53c9('0xe')](_0x2bc67f,_0x1cf35a)['then'](function(_0x181d7e){logger['info'](_0x53c9('0xf'),_0x165345,'request\x20sent');logger[_0x53c9('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x165345,_0x53c9('0x11'),JSON[_0x53c9('0x12')](_0x181d7e));if(_0x181d7e['error']){if(_0x181d7e[_0x53c9('0x13')][_0x53c9('0x14')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x165345,_0x181d7e[_0x53c9('0x13')][_0x53c9('0x15')]);return _0x3d5d5a(_0x181d7e[_0x53c9('0x13')]['message']);}logger[_0x53c9('0x13')](_0x53c9('0xf'),_0x165345,_0x181d7e['error'][_0x53c9('0x15')]);return _0x4f2209(_0x181d7e[_0x53c9('0x13')][_0x53c9('0x15')]);}else{logger[_0x53c9('0x16')](_0x53c9('0xf'),_0x165345,_0x53c9('0x11'));_0x4f2209(_0x181d7e[_0x53c9('0x17')][_0x53c9('0x15')]);}})[_0x53c9('0x18')](function(_0x2bcacd){logger[_0x53c9('0x13')](_0x53c9('0xf'),_0x165345,_0x2bcacd);_0x3d5d5a(_0x2bcacd);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 419d162..a03cbe6 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 _0x1ebe=['create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x1ebe,0xb8));var _0xe1eb=function(_0x4ea7bd,_0x359821){_0x4ea7bd=_0x4ea7bd-0x0;var _0x9dab6b=_0x1ebe[_0x4ea7bd];return _0x9dab6b;};'use strict';var multer=require(_0xe1eb('0x0'));var util=require(_0xe1eb('0x1'));var path=require('path');var timeout=require(_0xe1eb('0x2'));var express=require(_0xe1eb('0x3'));var router=express[_0xe1eb('0x4')]();var fs_extra=require(_0xe1eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe1eb('0x6'));var config=require(_0xe1eb('0x7'));var controller=require(_0xe1eb('0x8'));router[_0xe1eb('0x9')]('/',auth[_0xe1eb('0xa')](),controller[_0xe1eb('0xb')]);router[_0xe1eb('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe1eb('0xc')]);router[_0xe1eb('0x9')](_0xe1eb('0xd'),auth[_0xe1eb('0xa')](),controller[_0xe1eb('0xe')]);router[_0xe1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xe1eb('0x10')]);router[_0xe1eb('0x11')](_0xe1eb('0xd'),auth[_0xe1eb('0xa')](),controller[_0xe1eb('0x12')]);router[_0xe1eb('0x13')](_0xe1eb('0xd'),auth[_0xe1eb('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4796=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','create','delete','destroy','exports','multer','util','path'];(function(_0x1c08f6,_0x14c077){var _0xbc156a=function(_0x59df22){while(--_0x59df22){_0x1c08f6['push'](_0x1c08f6['shift']());}};_0xbc156a(++_0x14c077);}(_0x4796,0x189));var _0x6479=function(_0x3c745a,_0x41e6c9){_0x3c745a=_0x3c745a-0x0;var _0x5d3811=_0x4796[_0x3c745a];return _0x5d3811;};'use strict';var multer=require(_0x6479('0x0'));var util=require(_0x6479('0x1'));var path=require(_0x6479('0x2'));var timeout=require(_0x6479('0x3'));var express=require(_0x6479('0x4'));var router=express[_0x6479('0x5')]();var fs_extra=require(_0x6479('0x6'));var auth=require(_0x6479('0x7'));var interaction=require(_0x6479('0x8'));var config=require(_0x6479('0x9'));var controller=require('./faxTransferReport.controller');router[_0x6479('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6479('0xa')]('/describe',auth[_0x6479('0xb')](),controller[_0x6479('0xc')]);router[_0x6479('0xa')](_0x6479('0xd'),auth[_0x6479('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6479('0xe')]);router['put']('/:id',auth[_0x6479('0xb')](),controller['update']);router[_0x6479('0xf')](_0x6479('0xd'),auth['isAuthenticated'](),controller[_0x6479('0x10')]);module[_0x6479('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6e9e94b..922ce54 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 _0xf5e8=['create','post','addConfiguration','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5e8,0x10b));var _0x8f5e=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xf5e8[_0x4cbf20];return _0x582ae4;};'use strict';var multer=require(_0x8f5e('0x0'));var util=require('util');var path=require(_0x8f5e('0x1'));var timeout=require(_0x8f5e('0x2'));var express=require(_0x8f5e('0x3'));var router=express['Router']();var fs_extra=require(_0x8f5e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8f5e('0x5'));var controller=require('./intDeskAccount.controller');router[_0x8f5e('0x6')]('/',auth['isAuthenticated'](),controller[_0x8f5e('0x7')]);router[_0x8f5e('0x6')](_0x8f5e('0x8'),auth[_0x8f5e('0x9')](),controller[_0x8f5e('0xa')]);router[_0x8f5e('0x6')](_0x8f5e('0xb'),auth[_0x8f5e('0x9')](),controller[_0x8f5e('0xc')]);router[_0x8f5e('0x6')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x8f5e('0xd')]);router[_0x8f5e('0xe')](_0x8f5e('0xb'),auth['isAuthenticated'](),controller[_0x8f5e('0xf')]);router[_0x8f5e('0x10')](_0x8f5e('0x8'),auth['isAuthenticated'](),controller[_0x8f5e('0x11')]);router['delete'](_0x8f5e('0x8'),auth['isAuthenticated'](),controller[_0x8f5e('0x12')]);module[_0x8f5e('0x13')]=router; \ No newline at end of file +var _0x91e0=['post','create','put','delete','destroy','exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91e0,0x84));var _0x091e=function(_0x4dd1f7,_0x2e5c3c){_0x4dd1f7=_0x4dd1f7-0x0;var _0x293eed=_0x91e0[_0x4dd1f7];return _0x293eed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x091e('0x0'));var timeout=require('connect-timeout');var express=require(_0x091e('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x091e('0x2'));var interaction=require(_0x091e('0x3'));var config=require(_0x091e('0x4'));var controller=require(_0x091e('0x5'));router[_0x091e('0x6')]('/',auth[_0x091e('0x7')](),controller[_0x091e('0x8')]);router[_0x091e('0x6')](_0x091e('0x9'),auth[_0x091e('0x7')](),controller[_0x091e('0xa')]);router[_0x091e('0x6')](_0x091e('0xb'),auth['isAuthenticated'](),controller[_0x091e('0xc')]);router['get'](_0x091e('0xd'),auth[_0x091e('0x7')](),controller[_0x091e('0xe')]);router[_0x091e('0xf')]('/',auth[_0x091e('0x7')](),controller[_0x091e('0x10')]);router[_0x091e('0xf')](_0x091e('0xb'),auth[_0x091e('0x7')](),controller['addConfiguration']);router[_0x091e('0x11')]('/:id',auth[_0x091e('0x7')](),controller['update']);router[_0x091e('0x12')]('/:id',auth[_0x091e('0x7')](),controller[_0x091e('0x13')]);module[_0x091e('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 d0bde99..160bed8 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 _0x7099=['basic','newTab','sequelize','STRING','ENUM'];(function(_0x510217,_0x7e39da){var _0x2ef07e=function(_0x4f8134){while(--_0x4f8134){_0x510217['push'](_0x510217['shift']());}};_0x2ef07e(++_0x7e39da);}(_0x7099,0xac));var _0x9709=function(_0x396985,_0x2c5950){_0x396985=_0x396985-0x0;var _0x236ff3=_0x7099[_0x396985];return _0x236ff3;};'use strict';var Sequelize=require(_0x9709('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9709('0x1')]},'username':{'type':Sequelize[_0x9709('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x9709('0x2')](_0x9709('0x3')),'defaultValue':_0x9709('0x3')},'password':{'type':Sequelize[_0x9709('0x1')]},'consumerKey':{'type':Sequelize[_0x9709('0x1')]},'consumerSecret':{'type':Sequelize[_0x9709('0x1')]},'token':{'type':Sequelize[_0x9709('0x1')]},'tokenSecret':{'type':Sequelize[_0x9709('0x1')]},'serverUrl':{'type':Sequelize[_0x9709('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9709('0x2')]('integrationTab',_0x9709('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x365e=['integrationTab','newTab','sequelize','STRING','basic','ENUM'];(function(_0x38bfb8,_0x1b0fd8){var _0x744a4b=function(_0x30d0df){while(--_0x30d0df){_0x38bfb8['push'](_0x38bfb8['shift']());}};_0x744a4b(++_0x1b0fd8);}(_0x365e,0x128));var _0xe365=function(_0x23ca20,_0x592597){_0x23ca20=_0x23ca20-0x0;var _0x31aa55=_0x365e[_0x23ca20];return _0x31aa55;};'use strict';var Sequelize=require(_0xe365('0x0'));module['exports']={'name':{'type':Sequelize[_0xe365('0x1')]},'description':{'type':Sequelize[_0xe365('0x1')]},'username':{'type':Sequelize[_0xe365('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xe365('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xe365('0x1')]},'consumerKey':{'type':Sequelize[_0xe365('0x1')]},'consumerSecret':{'type':Sequelize[_0xe365('0x1')]},'token':{'type':Sequelize[_0xe365('0x1')]},'tokenSecret':{'type':Sequelize[_0xe365('0x1')]},'serverUrl':{'type':Sequelize[_0xe365('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe365('0x3')](_0xe365('0x4'),_0xe365('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index dd51640..0abf517 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 _0x20f6=['test','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','model','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','DeskAccount','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','token','tokenSecret','lastIndexOf','GET','format','application/json','basic','headers','Authorization','%s:%s','base64','concat','_embedded','active','label'];(function(_0x1a4c1e,_0x56a0f0){var _0x29c892=function(_0xfeffb5){while(--_0xfeffb5){_0x1a4c1e['push'](_0x1a4c1e['shift']());}};_0x29c892(++_0x56a0f0);}(_0x20f6,0xe1));var _0x620f=function(_0x4fa9e5,_0x4e59bc){_0x4fa9e5=_0x4fa9e5-0x0;var _0x1a28c3=_0x20f6[_0x4fa9e5];return _0x1a28c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x620f('0x0'));var zipdir=require(_0x620f('0x1'));var jsonpatch=require(_0x620f('0x2'));var rp=require(_0x620f('0x3'));var moment=require(_0x620f('0x4'));var BPromise=require(_0x620f('0x5'));var Mustache=require('mustache');var util=require(_0x620f('0x6'));var path=require(_0x620f('0x7'));var sox=require('sox');var csv=require(_0x620f('0x8'));var ejs=require(_0x620f('0x9'));var fs=require('fs');var fs_extra=require(_0x620f('0xa'));var _=require(_0x620f('0xb'));var squel=require(_0x620f('0xc'));var crypto=require(_0x620f('0xd'));var jsforce=require(_0x620f('0xe'));var deskjs=require(_0x620f('0xf'));var toCsv=require(_0x620f('0x8'));var querystring=require(_0x620f('0x10'));var Papa=require('papaparse');var Redis=require(_0x620f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x620f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x620f('0x13'));var logger=require('../../config/logger')(_0x620f('0x14'));var utils=require(_0x620f('0x15'));var config=require(_0x620f('0x16'));var licenseUtil=require(_0x620f('0x17'));var db=require(_0x620f('0x18'))['db'];var integrations=require(_0x620f('0x19'));function respondWithStatusCode(_0x53ba01,_0x254ed2){_0x254ed2=_0x254ed2||0xcc;return function(_0x253609){if(_0x253609){return _0x53ba01[_0x620f('0x1a')](_0x254ed2);}return _0x53ba01['status'](_0x254ed2)[_0x620f('0x1b')]();};}function respondWithResult(_0x4016b3,_0x3ff181){_0x3ff181=_0x3ff181||0xc8;return function(_0x2ce21d){if(_0x2ce21d){return _0x4016b3[_0x620f('0x1c')](_0x3ff181)['json'](_0x2ce21d);}};}function respondWithFilteredResult(_0x1d5494,_0x4be194){return function(_0x584c5a){if(_0x584c5a){var _0x58f385=typeof _0x4be194[_0x620f('0x1d')]===_0x620f('0x1e')&&typeof _0x4be194[_0x620f('0x1f')]==='undefined';var _0x29d6d3=_0x584c5a['count'];var _0x3d2ef6=_0x58f385?0x0:_0x4be194[_0x620f('0x1d')];var _0x16305e=_0x58f385?_0x584c5a['count']:_0x4be194[_0x620f('0x1d')]+_0x4be194[_0x620f('0x1f')];var _0x46cb57;if(_0x16305e>=_0x29d6d3){_0x16305e=_0x29d6d3;_0x46cb57=0xc8;}else{_0x46cb57=0xce;}_0x1d5494[_0x620f('0x1c')](_0x46cb57);return _0x1d5494['set'](_0x620f('0x20'),_0x3d2ef6+'-'+_0x16305e+'/'+_0x29d6d3)['json'](_0x584c5a);}return null;};}function patchUpdates(_0x3920ce){return function(_0x4a8207){try{jsonpatch[_0x620f('0x21')](_0x4a8207,_0x3920ce,!![]);}catch(_0x4dcca6){return BPromise[_0x620f('0x22')](_0x4dcca6);}return _0x4a8207[_0x620f('0x23')]();};}function saveUpdates(_0x519fdd,_0x46964f){return function(_0x12d51a){if(_0x12d51a){return _0x12d51a[_0x620f('0x24')](_0x519fdd)[_0x620f('0x25')](function(_0x183004){return _0x183004;});}return null;};}function removeEntity(_0x2d1c6e,_0x496ae4){return function(_0x2ffb67){if(_0x2ffb67){return _0x2ffb67[_0x620f('0x26')]()[_0x620f('0x25')](function(){_0x2d1c6e[_0x620f('0x1c')](0xcc)[_0x620f('0x1b')]();});}};}function handleEntityNotFound(_0x77916f,_0x3d79dd){return function(_0x250039){if(!_0x250039){_0x77916f['sendStatus'](0x194);}return _0x250039;};}function handleError(_0x34a81d,_0x57ee43){_0x57ee43=_0x57ee43||0x1f4;return function(_0x2c1d9d){logger[_0x620f('0x27')](_0x2c1d9d[_0x620f('0x28')]);if(_0x2c1d9d[_0x620f('0x29')]){delete _0x2c1d9d[_0x620f('0x29')];}_0x34a81d[_0x620f('0x1c')](_0x57ee43)[_0x620f('0x2a')](_0x2c1d9d);};}exports['index']=function(_0x248bf3,_0x1f8f7f){var _0x1fae78={},_0x36b7ef={},_0x3428fc={'count':0x0,'rows':[]};var _0x18d8b5=_[_0x620f('0x2b')](db['DeskAccount'][_0x620f('0x2c')],function(_0x1676e9){return{'name':_0x1676e9[_0x620f('0x2d')],'type':_0x1676e9[_0x620f('0x2e')][_0x620f('0x2f')]};});_0x36b7ef['model']=_[_0x620f('0x2b')](_0x18d8b5,_0x620f('0x29'));_0x36b7ef[_0x620f('0x30')]=_[_0x620f('0x31')](_0x248bf3[_0x620f('0x30')]);_0x36b7ef['filters']=_['intersection'](_0x36b7ef[_0x620f('0x32')],_0x36b7ef[_0x620f('0x30')]);_0x1fae78['attributes']=_[_0x620f('0x33')](_0x36b7ef[_0x620f('0x32')],qs[_0x620f('0x34')](_0x248bf3[_0x620f('0x30')][_0x620f('0x34')]));_0x1fae78[_0x620f('0x35')]=_0x1fae78[_0x620f('0x35')][_0x620f('0x36')]?_0x1fae78[_0x620f('0x35')]:_0x36b7ef[_0x620f('0x32')];if(!_0x248bf3[_0x620f('0x30')]['hasOwnProperty'](_0x620f('0x37'))){_0x1fae78[_0x620f('0x1f')]=qs[_0x620f('0x1f')](_0x248bf3[_0x620f('0x30')][_0x620f('0x1f')]);_0x1fae78[_0x620f('0x1d')]=qs[_0x620f('0x1d')](_0x248bf3[_0x620f('0x30')][_0x620f('0x1d')]);}_0x1fae78[_0x620f('0x38')]=qs[_0x620f('0x39')](_0x248bf3['query'][_0x620f('0x39')]);_0x1fae78[_0x620f('0x3a')]=qs[_0x620f('0x3b')](_[_0x620f('0x3c')](_0x248bf3[_0x620f('0x30')],_0x36b7ef['filters']),_0x18d8b5);if(_0x248bf3['query']['filter']){_0x1fae78['where']=_[_0x620f('0x3d')](_0x1fae78[_0x620f('0x3a')],{'$or':_[_0x620f('0x2b')](_0x18d8b5,function(_0x2c9043){if(_0x2c9043['type']!==_0x620f('0x3e')){var _0x33ab8c={};_0x33ab8c[_0x2c9043[_0x620f('0x29')]]={'$like':'%'+_0x248bf3[_0x620f('0x30')][_0x620f('0x3f')]+'%'};return _0x33ab8c;}})});}_0x1fae78=_[_0x620f('0x3d')]({},_0x1fae78,_0x248bf3[_0x620f('0x40')]);var _0x21eec5={'where':_0x1fae78[_0x620f('0x3a')]};return db['DeskAccount'][_0x620f('0x41')](_0x21eec5)['then'](function(_0x3f5fba){_0x3428fc['count']=_0x3f5fba;if(_0x248bf3[_0x620f('0x30')]['includeAll']){_0x1fae78[_0x620f('0x42')]=[{'all':!![]}];}return db[_0x620f('0x43')][_0x620f('0x44')](_0x1fae78);})[_0x620f('0x25')](function(_0x5a9156){_0x3428fc[_0x620f('0x45')]=_0x5a9156;return _0x3428fc;})[_0x620f('0x25')](respondWithFilteredResult(_0x1f8f7f,_0x1fae78))[_0x620f('0x46')](handleError(_0x1f8f7f,null));};exports['show']=function(_0x2f6033,_0x444294){var _0x2fdd1b={'raw':![],'where':{'id':_0x2f6033[_0x620f('0x47')]['id']}},_0x31677a={};_0x31677a[_0x620f('0x32')]=_[_0x620f('0x31')](db[_0x620f('0x43')][_0x620f('0x2c')]);_0x31677a[_0x620f('0x30')]=_['keys'](_0x2f6033[_0x620f('0x30')]);_0x31677a[_0x620f('0x3b')]=_['intersection'](_0x31677a['model'],_0x31677a['query']);_0x2fdd1b[_0x620f('0x35')]=_[_0x620f('0x33')](_0x31677a['model'],qs[_0x620f('0x34')](_0x2f6033[_0x620f('0x30')][_0x620f('0x34')]));_0x2fdd1b[_0x620f('0x35')]=_0x2fdd1b[_0x620f('0x35')][_0x620f('0x36')]?_0x2fdd1b['attributes']:_0x31677a['model'];if(_0x2f6033[_0x620f('0x30')]['includeAll']){_0x2fdd1b[_0x620f('0x42')]=[{'all':!![]}];}_0x2fdd1b=_[_0x620f('0x3d')]({},_0x2fdd1b,_0x2f6033['options']);return db[_0x620f('0x43')][_0x620f('0x48')](_0x2fdd1b)[_0x620f('0x25')](handleEntityNotFound(_0x444294,null))[_0x620f('0x25')](respondWithResult(_0x444294,null))['catch'](handleError(_0x444294,null));};exports[_0x620f('0x49')]=function(_0x5e2ed8,_0x4cdabe){return db[_0x620f('0x43')][_0x620f('0x49')](_0x5e2ed8['body'],{})['then'](respondWithResult(_0x4cdabe,0xc9))[_0x620f('0x46')](handleError(_0x4cdabe,null));};exports[_0x620f('0x24')]=function(_0x504c66,_0x27a58b){if(_0x504c66[_0x620f('0x4a')]['id']){delete _0x504c66[_0x620f('0x4a')]['id'];}return db[_0x620f('0x43')][_0x620f('0x48')]({'where':{'id':_0x504c66[_0x620f('0x47')]['id']}})[_0x620f('0x25')](handleEntityNotFound(_0x27a58b,null))['then'](saveUpdates(_0x504c66[_0x620f('0x4a')],null))[_0x620f('0x25')](respondWithResult(_0x27a58b,null))[_0x620f('0x46')](handleError(_0x27a58b,null));};exports[_0x620f('0x26')]=function(_0x454dc9,_0x4be2e2){return db[_0x620f('0x43')]['find']({'where':{'id':_0x454dc9[_0x620f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4be2e2,null))[_0x620f('0x25')](removeEntity(_0x4be2e2,null))[_0x620f('0x46')](handleError(_0x4be2e2,null));};exports[_0x620f('0x4b')]=function(_0x231f99,_0x1c1deb,_0x30a3f1){var _0x5e3255={};var _0x5c8748={};var _0x475e71;var _0x56e500;return db[_0x620f('0x43')][_0x620f('0x4c')]({'where':{'id':_0x231f99['params']['id']}})['then'](handleEntityNotFound(_0x1c1deb,null))[_0x620f('0x25')](function(_0x3eed1a){if(_0x3eed1a){_0x475e71=_0x3eed1a;_0x5c8748[_0x620f('0x32')]=_[_0x620f('0x31')](db[_0x620f('0x4d')][_0x620f('0x2c')]);_0x5c8748[_0x620f('0x30')]=_[_0x620f('0x31')](_0x231f99[_0x620f('0x30')]);_0x5c8748['filters']=_[_0x620f('0x33')](_0x5c8748[_0x620f('0x32')],_0x5c8748[_0x620f('0x30')]);_0x5e3255[_0x620f('0x35')]=_['intersection'](_0x5c8748[_0x620f('0x32')],qs[_0x620f('0x34')](_0x231f99[_0x620f('0x30')][_0x620f('0x34')]));_0x5e3255[_0x620f('0x35')]=_0x5e3255[_0x620f('0x35')][_0x620f('0x36')]?_0x5e3255[_0x620f('0x35')]:_0x5c8748[_0x620f('0x32')];_0x5e3255[_0x620f('0x38')]=qs[_0x620f('0x39')](_0x231f99['query'][_0x620f('0x39')]);_0x5e3255[_0x620f('0x3a')]=qs[_0x620f('0x3b')](_['pick'](_0x231f99[_0x620f('0x30')],_0x5c8748[_0x620f('0x3b')]));if(_0x231f99[_0x620f('0x30')][_0x620f('0x3f')]){_0x5e3255[_0x620f('0x3a')]=_[_0x620f('0x3d')](_0x5e3255[_0x620f('0x3a')],{'$or':_[_0x620f('0x2b')](_0x5e3255[_0x620f('0x35')],function(_0x27365b){var _0x1c3435={};_0x1c3435[_0x27365b]={'$like':'%'+_0x231f99[_0x620f('0x30')][_0x620f('0x3f')]+'%'};return _0x1c3435;})});}_0x5e3255=_[_0x620f('0x3d')]({},_0x5e3255,_0x231f99['options']);return _0x475e71['getConfigurations'](_0x5e3255);}})[_0x620f('0x25')](function(_0x8fd847){if(_0x8fd847){_0x56e500=_0x8fd847[_0x620f('0x36')];if(!_0x231f99['query'][_0x620f('0x4e')](_0x620f('0x37'))){_0x5e3255[_0x620f('0x1f')]=qs[_0x620f('0x1f')](_0x231f99['query'][_0x620f('0x1f')]);_0x5e3255[_0x620f('0x1d')]=qs[_0x620f('0x1d')](_0x231f99[_0x620f('0x30')][_0x620f('0x1d')]);}return _0x475e71[_0x620f('0x4b')](_0x5e3255);}})[_0x620f('0x25')](function(_0x1351a9){if(_0x1351a9){return _0x1351a9?{'count':_0x56e500,'rows':_0x1351a9}:null;}})[_0x620f('0x25')](respondWithResult(_0x1c1deb,null))[_0x620f('0x46')](handleError(_0x1c1deb,null));};exports['addConfiguration']=function(_0x3e7ab8,_0x3bd280,_0x113a7f){if(_0x3e7ab8[_0x620f('0x4a')]['id']){delete _0x3e7ab8[_0x620f('0x4a')]['id'];}return db['DeskAccount'][_0x620f('0x4c')]({'where':{'id':_0x3e7ab8[_0x620f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bd280,null))[_0x620f('0x25')](function(_0x180c77){if(_0x180c77){_0x3e7ab8[_0x620f('0x4a')][_0x620f('0x4f')]=_0x180c77['id'];_0x3e7ab8[_0x620f('0x4a')][_0x620f('0x50')]=integrations[_0x620f('0x51')](_0x3e7ab8[_0x620f('0x4a')][_0x620f('0x52')],_0x3e7ab8[_0x620f('0x4a')][_0x620f('0x2e')]);_0x3e7ab8['body'][_0x620f('0x53')]=integrations[_0x620f('0x54')](_0x3e7ab8[_0x620f('0x4a')]['channel'],_0x3e7ab8[_0x620f('0x4a')][_0x620f('0x2e')]);return db['DeskConfiguration'][_0x620f('0x49')](_0x3e7ab8['body'],{'include':[{'model':db[_0x620f('0x55')],'as':_0x620f('0x50')},{'model':db[_0x620f('0x55')],'as':_0x620f('0x53')}]});}return null;})[_0x620f('0x25')](respondWithResult(_0x3bd280,null))['catch'](handleError(_0x3bd280,null));};exports[_0x620f('0x56')]=function(_0x321778,_0x245916,_0x2e7205){var _0x4e8b3d=[{'name':'priority','label':_0x620f('0x57'),'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 _0x21ef22='';return db[_0x620f('0x43')][_0x620f('0x4c')]({'where':{'id':_0x321778[_0x620f('0x47')]['id']},'attributes':['id',_0x620f('0x58'),_0x620f('0x59'),_0x620f('0x5a'),_0x620f('0x5b'),_0x620f('0x5c'),'consumerSecret',_0x620f('0x5d'),_0x620f('0x5e')]})[_0x620f('0x25')](handleEntityNotFound(_0x245916,null))[_0x620f('0x25')](function(_0x1278de){if(_0x1278de){_0x21ef22=_0x1278de[_0x620f('0x58')];var _0x3c9360=_0x21ef22['slice'](-0x1);if(_0x3c9360==='/'){_0x21ef22=_0x21ef22['substring'](0x0,_0x21ef22[_0x620f('0x5f')](_0x3c9360));}var _0x5154a3={'method':_0x620f('0x60'),'uri':util[_0x620f('0x61')]('%s/custom_fields',_0x21ef22),'headers':{'Content-Type':_0x620f('0x62'),'Accept':'application/json'},'json':!![]};if(_0x1278de[_0x620f('0x59')]===_0x620f('0x63')){_0x5154a3[_0x620f('0x64')][_0x620f('0x65')]=util['format']('Basic\x20%s',new Buffer(util[_0x620f('0x61')](_0x620f('0x66'),_0x1278de[_0x620f('0x5a')],_0x1278de[_0x620f('0x5b')]))['toString'](_0x620f('0x67')));}return rp(_0x5154a3)[_0x620f('0x25')](function(_0x5d805a){return _0x4e8b3d[_0x620f('0x68')](_['map'](_0x5d805a[_0x620f('0x69')]['entries'],function(_0xcefec6){return{'id':_0xcefec6[_0x620f('0x29')],'name':_0xcefec6[_0x620f('0x29')],'type':_0xcefec6[_0x620f('0x2e')],'active':_0xcefec6[_0x620f('0x6a')],'label':_0xcefec6[_0x620f('0x6b')],'custom':!![]};}));});}})[_0x620f('0x25')](function(_0x54ae40){return{'count':_0x54ae40[_0x620f('0x36')],'rows':_0x54ae40};})[_0x620f('0x25')](respondWithResult(_0x245916,null))[_0x620f('0x46')](function(_0x5bc536){var _0x599aae=_0x321778[_0x620f('0x30')][_0x620f('0x6c')]?0x1f4:_0x5bc536[_0x620f('0x6d')]||0x1f4;logger[_0x620f('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x620f('0x56'),_0x599aae,JSON['stringify'](_0x5bc536));delete _0x5bc536['name'];if(_0x599aae===0x191){_0x599aae=0x190;}_0x245916['status'](_0x599aae)[_0x620f('0x2a')](_0x321778['query'][_0x620f('0x6c')]?{'message':_0x620f('0x6e'),'statusCode':_0x5bc536[_0x620f('0x6d')]}:_0x5bc536);});}; \ No newline at end of file +var _0xfaa0=['GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','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/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','map','DeskAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','substring'];(function(_0x11d2f6,_0x572bc9){var _0x22a285=function(_0x21aaca){while(--_0x21aaca){_0x11d2f6['push'](_0x11d2f6['shift']());}};_0x22a285(++_0x572bc9);}(_0xfaa0,0x84));var _0x0faa=function(_0x147eea,_0x11a68e){_0x147eea=_0x147eea-0x0;var _0x1f1d7b=_0xfaa0[_0x147eea];return _0x1f1d7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0faa('0x0'));var zipdir=require(_0x0faa('0x1'));var jsonpatch=require(_0x0faa('0x2'));var rp=require(_0x0faa('0x3'));var moment=require('moment');var BPromise=require(_0x0faa('0x4'));var Mustache=require(_0x0faa('0x5'));var util=require(_0x0faa('0x6'));var path=require(_0x0faa('0x7'));var sox=require(_0x0faa('0x8'));var csv=require(_0x0faa('0x9'));var ejs=require(_0x0faa('0xa'));var fs=require('fs');var fs_extra=require(_0x0faa('0xb'));var _=require(_0x0faa('0xc'));var squel=require(_0x0faa('0xd'));var crypto=require('crypto');var jsforce=require(_0x0faa('0xe'));var deskjs=require(_0x0faa('0xf'));var toCsv=require(_0x0faa('0x9'));var querystring=require('querystring');var Papa=require(_0x0faa('0x10'));var Redis=require(_0x0faa('0x11'));var authService=require(_0x0faa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0faa('0x13'));var hardwareService=require(_0x0faa('0x14'));var logger=require('../../config/logger')(_0x0faa('0x15'));var utils=require(_0x0faa('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0faa('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0faa('0x18'));function respondWithStatusCode(_0x154cb2,_0x863c71){_0x863c71=_0x863c71||0xcc;return function(_0x5d965a){if(_0x5d965a){return _0x154cb2['sendStatus'](_0x863c71);}return _0x154cb2[_0x0faa('0x19')](_0x863c71)[_0x0faa('0x1a')]();};}function respondWithResult(_0x5c3cbb,_0x285b50){_0x285b50=_0x285b50||0xc8;return function(_0x2d9dfa){if(_0x2d9dfa){return _0x5c3cbb[_0x0faa('0x19')](_0x285b50)[_0x0faa('0x1b')](_0x2d9dfa);}};}function respondWithFilteredResult(_0x5bb28d,_0x50cc9f){return function(_0x330e0f){if(_0x330e0f){var _0x1f6585=typeof _0x50cc9f[_0x0faa('0x1c')]==='undefined'&&typeof _0x50cc9f[_0x0faa('0x1d')]===_0x0faa('0x1e');var _0xdcd420=_0x330e0f[_0x0faa('0x1f')];var _0x1c62ab=_0x1f6585?0x0:_0x50cc9f[_0x0faa('0x1c')];var _0x165d53=_0x1f6585?_0x330e0f[_0x0faa('0x1f')]:_0x50cc9f[_0x0faa('0x1c')]+_0x50cc9f[_0x0faa('0x1d')];var _0x22ece4;if(_0x165d53>=_0xdcd420){_0x165d53=_0xdcd420;_0x22ece4=0xc8;}else{_0x22ece4=0xce;}_0x5bb28d['status'](_0x22ece4);return _0x5bb28d[_0x0faa('0x20')](_0x0faa('0x21'),_0x1c62ab+'-'+_0x165d53+'/'+_0xdcd420)[_0x0faa('0x1b')](_0x330e0f);}return null;};}function patchUpdates(_0x15e60f){return function(_0xf8afd7){try{jsonpatch[_0x0faa('0x22')](_0xf8afd7,_0x15e60f,!![]);}catch(_0x503b9f){return BPromise['reject'](_0x503b9f);}return _0xf8afd7[_0x0faa('0x23')]();};}function saveUpdates(_0x5a17c8,_0x2c25b2){return function(_0x28e6a0){if(_0x28e6a0){return _0x28e6a0[_0x0faa('0x24')](_0x5a17c8)[_0x0faa('0x25')](function(_0x589297){return _0x589297;});}return null;};}function removeEntity(_0xfec0c0,_0x324cfb){return function(_0x3b3c94){if(_0x3b3c94){return _0x3b3c94[_0x0faa('0x26')]()[_0x0faa('0x25')](function(){_0xfec0c0[_0x0faa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e7d5c,_0x3935a3){return function(_0x31de1b){if(!_0x31de1b){_0x2e7d5c[_0x0faa('0x27')](0x194);}return _0x31de1b;};}function handleError(_0x31b45c,_0x453a59){_0x453a59=_0x453a59||0x1f4;return function(_0x3481f6){logger[_0x0faa('0x28')](_0x3481f6['stack']);if(_0x3481f6['name']){delete _0x3481f6[_0x0faa('0x29')];}_0x31b45c['status'](_0x453a59)['send'](_0x3481f6);};}exports['index']=function(_0x2cab1a,_0x4b3f43){var _0x7500a4={},_0x1b7341={},_0x154162={'count':0x0,'rows':[]};var _0x5dd469=_[_0x0faa('0x2a')](db[_0x0faa('0x2b')][_0x0faa('0x2c')],function(_0x41e1bc){return{'name':_0x41e1bc['fieldName'],'type':_0x41e1bc[_0x0faa('0x2d')][_0x0faa('0x2e')]};});_0x1b7341[_0x0faa('0x2f')]=_[_0x0faa('0x2a')](_0x5dd469,_0x0faa('0x29'));_0x1b7341[_0x0faa('0x30')]=_['keys'](_0x2cab1a['query']);_0x1b7341['filters']=_[_0x0faa('0x31')](_0x1b7341['model'],_0x1b7341[_0x0faa('0x30')]);_0x7500a4[_0x0faa('0x32')]=_[_0x0faa('0x31')](_0x1b7341[_0x0faa('0x2f')],qs[_0x0faa('0x33')](_0x2cab1a['query']['fields']));_0x7500a4['attributes']=_0x7500a4[_0x0faa('0x32')][_0x0faa('0x34')]?_0x7500a4[_0x0faa('0x32')]:_0x1b7341[_0x0faa('0x2f')];if(!_0x2cab1a[_0x0faa('0x30')][_0x0faa('0x35')](_0x0faa('0x36'))){_0x7500a4['limit']=qs[_0x0faa('0x1d')](_0x2cab1a['query'][_0x0faa('0x1d')]);_0x7500a4['offset']=qs[_0x0faa('0x1c')](_0x2cab1a[_0x0faa('0x30')][_0x0faa('0x1c')]);}_0x7500a4[_0x0faa('0x37')]=qs[_0x0faa('0x38')](_0x2cab1a[_0x0faa('0x30')]['sort']);_0x7500a4[_0x0faa('0x39')]=qs[_0x0faa('0x3a')](_[_0x0faa('0x3b')](_0x2cab1a[_0x0faa('0x30')],_0x1b7341['filters']),_0x5dd469);if(_0x2cab1a[_0x0faa('0x30')][_0x0faa('0x3c')]){_0x7500a4[_0x0faa('0x39')]=_[_0x0faa('0x3d')](_0x7500a4[_0x0faa('0x39')],{'$or':_[_0x0faa('0x2a')](_0x5dd469,function(_0x857b06){if(_0x857b06[_0x0faa('0x2d')]!==_0x0faa('0x3e')){var _0x28fb18={};_0x28fb18[_0x857b06[_0x0faa('0x29')]]={'$like':'%'+_0x2cab1a[_0x0faa('0x30')][_0x0faa('0x3c')]+'%'};return _0x28fb18;}})});}_0x7500a4=_[_0x0faa('0x3d')]({},_0x7500a4,_0x2cab1a[_0x0faa('0x3f')]);var _0x34da50={'where':_0x7500a4[_0x0faa('0x39')]};return db[_0x0faa('0x2b')][_0x0faa('0x1f')](_0x34da50)['then'](function(_0x16a918){_0x154162[_0x0faa('0x1f')]=_0x16a918;if(_0x2cab1a[_0x0faa('0x30')][_0x0faa('0x40')]){_0x7500a4['include']=[{'all':!![]}];}return db[_0x0faa('0x2b')][_0x0faa('0x41')](_0x7500a4);})[_0x0faa('0x25')](function(_0x60241c){_0x154162[_0x0faa('0x42')]=_0x60241c;return _0x154162;})['then'](respondWithFilteredResult(_0x4b3f43,_0x7500a4))[_0x0faa('0x43')](handleError(_0x4b3f43,null));};exports['show']=function(_0x22d6b1,_0x550cfd){var _0x36921a={'raw':![],'where':{'id':_0x22d6b1[_0x0faa('0x44')]['id']}},_0x2f5dfc={};_0x2f5dfc[_0x0faa('0x2f')]=_[_0x0faa('0x45')](db[_0x0faa('0x2b')][_0x0faa('0x2c')]);_0x2f5dfc[_0x0faa('0x30')]=_[_0x0faa('0x45')](_0x22d6b1[_0x0faa('0x30')]);_0x2f5dfc[_0x0faa('0x3a')]=_['intersection'](_0x2f5dfc['model'],_0x2f5dfc[_0x0faa('0x30')]);_0x36921a['attributes']=_[_0x0faa('0x31')](_0x2f5dfc[_0x0faa('0x2f')],qs[_0x0faa('0x33')](_0x22d6b1[_0x0faa('0x30')][_0x0faa('0x33')]));_0x36921a[_0x0faa('0x32')]=_0x36921a['attributes']['length']?_0x36921a['attributes']:_0x2f5dfc[_0x0faa('0x2f')];if(_0x22d6b1[_0x0faa('0x30')]['includeAll']){_0x36921a[_0x0faa('0x46')]=[{'all':!![]}];}_0x36921a=_[_0x0faa('0x3d')]({},_0x36921a,_0x22d6b1[_0x0faa('0x3f')]);return db['DeskAccount'][_0x0faa('0x47')](_0x36921a)[_0x0faa('0x25')](handleEntityNotFound(_0x550cfd,null))[_0x0faa('0x25')](respondWithResult(_0x550cfd,null))['catch'](handleError(_0x550cfd,null));};exports['create']=function(_0x179d32,_0x3ddf5c){return db[_0x0faa('0x2b')][_0x0faa('0x48')](_0x179d32[_0x0faa('0x49')],{})[_0x0faa('0x25')](respondWithResult(_0x3ddf5c,0xc9))[_0x0faa('0x43')](handleError(_0x3ddf5c,null));};exports['update']=function(_0x3a7bbf,_0x498b71){if(_0x3a7bbf[_0x0faa('0x49')]['id']){delete _0x3a7bbf['body']['id'];}return db[_0x0faa('0x2b')][_0x0faa('0x47')]({'where':{'id':_0x3a7bbf[_0x0faa('0x44')]['id']}})[_0x0faa('0x25')](handleEntityNotFound(_0x498b71,null))[_0x0faa('0x25')](saveUpdates(_0x3a7bbf[_0x0faa('0x49')],null))['then'](respondWithResult(_0x498b71,null))['catch'](handleError(_0x498b71,null));};exports['destroy']=function(_0x48bac6,_0x22e93c){return db[_0x0faa('0x2b')][_0x0faa('0x47')]({'where':{'id':_0x48bac6['params']['id']}})[_0x0faa('0x25')](handleEntityNotFound(_0x22e93c,null))['then'](removeEntity(_0x22e93c,null))['catch'](handleError(_0x22e93c,null));};exports[_0x0faa('0x4a')]=function(_0x37f533,_0x10d498,_0x5bdb46){var _0x3a88e5={};var _0x133bf7={};var _0x36eed5;var _0x2a6426;return db[_0x0faa('0x2b')][_0x0faa('0x4b')]({'where':{'id':_0x37f533[_0x0faa('0x44')]['id']}})[_0x0faa('0x25')](handleEntityNotFound(_0x10d498,null))[_0x0faa('0x25')](function(_0x42d8aa){if(_0x42d8aa){_0x36eed5=_0x42d8aa;_0x133bf7[_0x0faa('0x2f')]=_['keys'](db[_0x0faa('0x4c')][_0x0faa('0x2c')]);_0x133bf7[_0x0faa('0x30')]=_['keys'](_0x37f533[_0x0faa('0x30')]);_0x133bf7[_0x0faa('0x3a')]=_[_0x0faa('0x31')](_0x133bf7[_0x0faa('0x2f')],_0x133bf7[_0x0faa('0x30')]);_0x3a88e5['attributes']=_['intersection'](_0x133bf7[_0x0faa('0x2f')],qs[_0x0faa('0x33')](_0x37f533[_0x0faa('0x30')]['fields']));_0x3a88e5[_0x0faa('0x32')]=_0x3a88e5[_0x0faa('0x32')][_0x0faa('0x34')]?_0x3a88e5['attributes']:_0x133bf7[_0x0faa('0x2f')];_0x3a88e5[_0x0faa('0x37')]=qs['sort'](_0x37f533[_0x0faa('0x30')][_0x0faa('0x38')]);_0x3a88e5[_0x0faa('0x39')]=qs[_0x0faa('0x3a')](_[_0x0faa('0x3b')](_0x37f533[_0x0faa('0x30')],_0x133bf7[_0x0faa('0x3a')]));if(_0x37f533[_0x0faa('0x30')]['filter']){_0x3a88e5[_0x0faa('0x39')]=_[_0x0faa('0x3d')](_0x3a88e5[_0x0faa('0x39')],{'$or':_[_0x0faa('0x2a')](_0x3a88e5[_0x0faa('0x32')],function(_0x18fd48){var _0x500214={};_0x500214[_0x18fd48]={'$like':'%'+_0x37f533[_0x0faa('0x30')][_0x0faa('0x3c')]+'%'};return _0x500214;})});}_0x3a88e5=_[_0x0faa('0x3d')]({},_0x3a88e5,_0x37f533[_0x0faa('0x3f')]);return _0x36eed5[_0x0faa('0x4a')](_0x3a88e5);}})[_0x0faa('0x25')](function(_0x4a91a0){if(_0x4a91a0){_0x2a6426=_0x4a91a0[_0x0faa('0x34')];if(!_0x37f533['query'][_0x0faa('0x35')](_0x0faa('0x36'))){_0x3a88e5['limit']=qs['limit'](_0x37f533[_0x0faa('0x30')][_0x0faa('0x1d')]);_0x3a88e5[_0x0faa('0x1c')]=qs[_0x0faa('0x1c')](_0x37f533['query'][_0x0faa('0x1c')]);}return _0x36eed5[_0x0faa('0x4a')](_0x3a88e5);}})[_0x0faa('0x25')](function(_0x4dd402){if(_0x4dd402){return _0x4dd402?{'count':_0x2a6426,'rows':_0x4dd402}:null;}})[_0x0faa('0x25')](respondWithResult(_0x10d498,null))['catch'](handleError(_0x10d498,null));};exports[_0x0faa('0x4d')]=function(_0x129a45,_0x1cce76,_0x421c31){if(_0x129a45['body']['id']){delete _0x129a45[_0x0faa('0x49')]['id'];}return db[_0x0faa('0x2b')]['findOne']({'where':{'id':_0x129a45[_0x0faa('0x44')]['id']}})[_0x0faa('0x25')](handleEntityNotFound(_0x1cce76,null))[_0x0faa('0x25')](function(_0x52355e){if(_0x52355e){_0x129a45[_0x0faa('0x49')][_0x0faa('0x4e')]=_0x52355e['id'];_0x129a45[_0x0faa('0x49')][_0x0faa('0x4f')]=integrations['getSubjects'](_0x129a45[_0x0faa('0x49')][_0x0faa('0x50')],_0x129a45[_0x0faa('0x49')][_0x0faa('0x2d')]);_0x129a45[_0x0faa('0x49')][_0x0faa('0x51')]=integrations[_0x0faa('0x52')](_0x129a45[_0x0faa('0x49')]['channel'],_0x129a45['body']['type']);return db[_0x0faa('0x4c')][_0x0faa('0x48')](_0x129a45['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x0faa('0x53')],'as':_0x0faa('0x51')}]});}return null;})[_0x0faa('0x25')](respondWithResult(_0x1cce76,null))['catch'](handleError(_0x1cce76,null));};exports[_0x0faa('0x54')]=function(_0x2fdf0d,_0x128911,_0x490664){var _0x36fc4b=[{'name':_0x0faa('0x55'),'label':_0x0faa('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4395='';return db[_0x0faa('0x2b')]['findOne']({'where':{'id':_0x2fdf0d[_0x0faa('0x44')]['id']},'attributes':['id',_0x0faa('0x56'),_0x0faa('0x57'),_0x0faa('0x58'),_0x0faa('0x59'),_0x0faa('0x5a'),_0x0faa('0x5b'),'token',_0x0faa('0x5c')]})[_0x0faa('0x25')](handleEntityNotFound(_0x128911,null))[_0x0faa('0x25')](function(_0x58e9e2){if(_0x58e9e2){_0x4395=_0x58e9e2['remoteUri'];var _0x30e102=_0x4395['slice'](-0x1);if(_0x30e102==='/'){_0x4395=_0x4395[_0x0faa('0x5d')](0x0,_0x4395['lastIndexOf'](_0x30e102));}var _0x5a165e={'method':_0x0faa('0x5e'),'uri':util[_0x0faa('0x5f')](_0x0faa('0x60'),_0x4395),'headers':{'Content-Type':_0x0faa('0x61'),'Accept':_0x0faa('0x61')},'json':!![]};if(_0x58e9e2[_0x0faa('0x57')]==='basic'){_0x5a165e[_0x0faa('0x62')][_0x0faa('0x63')]=util['format'](_0x0faa('0x64'),new Buffer(util[_0x0faa('0x5f')](_0x0faa('0x65'),_0x58e9e2[_0x0faa('0x58')],_0x58e9e2[_0x0faa('0x59')]))[_0x0faa('0x66')]('base64'));}return rp(_0x5a165e)[_0x0faa('0x25')](function(_0x572610){return _0x36fc4b[_0x0faa('0x67')](_['map'](_0x572610[_0x0faa('0x68')][_0x0faa('0x69')],function(_0x5ac04a){return{'id':_0x5ac04a[_0x0faa('0x29')],'name':_0x5ac04a[_0x0faa('0x29')],'type':_0x5ac04a[_0x0faa('0x2d')],'active':_0x5ac04a['active'],'label':_0x5ac04a[_0x0faa('0x6a')],'custom':!![]};}));});}})[_0x0faa('0x25')](function(_0x256e9b){return{'count':_0x256e9b['length'],'rows':_0x256e9b};})['then'](respondWithResult(_0x128911,null))[_0x0faa('0x43')](function(_0x13ace7){var _0x2464b9=_0x2fdf0d['query'][_0x0faa('0x6b')]?0x1f4:_0x13ace7[_0x0faa('0x6c')]||0x1f4;logger[_0x0faa('0x28')](_0x0faa('0x6d'),_0x0faa('0x54'),_0x2464b9,JSON[_0x0faa('0x6e')](_0x13ace7));delete _0x13ace7['name'];if(_0x2464b9===0x191){_0x2464b9=0x190;}_0x128911[_0x0faa('0x19')](_0x2464b9)[_0x0faa('0x6f')](_0x2fdf0d[_0x0faa('0x30')][_0x0faa('0x6b')]?{'message':_0x0faa('0x70'),'statusCode':_0x13ace7[_0x0faa('0x6c')]}:_0x13ace7);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 066443c..c395552 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 _0xf813=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','../../config/logger','api','moment','request-promise','path'];(function(_0xd9b0cb,_0x111687){var _0x1062e9=function(_0x2e8fca){while(--_0x2e8fca){_0xd9b0cb['push'](_0xd9b0cb['shift']());}};_0x1062e9(++_0x111687);}(_0xf813,0x13a));var _0x3f81=function(_0x7e3f06,_0x426f70){_0x7e3f06=_0x7e3f06-0x0;var _0x12b8ff=_0xf813[_0x7e3f06];return _0x12b8ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f81('0x0'))(_0x3f81('0x1'));var moment=require(_0x3f81('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f81('0x3'));var fs=require('fs');var path=require(_0x3f81('0x4'));var rimraf=require('rimraf');var config=require(_0x3f81('0x5'));var attributes=require(_0x3f81('0x6'));var integrations=require(_0x3f81('0x7'));module[_0x3f81('0x8')]=function(_0x292317,_0x21692b){return _0x292317['define'](_0x3f81('0x9'),attributes,{'tableName':_0x3f81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cbb=['path','rimraf','../../config/environment','exports','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1af794,_0x570050){var _0x402845=function(_0x319b24){while(--_0x319b24){_0x1af794['push'](_0x1af794['shift']());}};_0x402845(++_0x570050);}(_0x2cbb,0x1a9));var _0xb2cb=function(_0x37357f,_0x3b23bb){_0x37357f=_0x37357f-0x0;var _0x505ef9=_0x2cbb[_0x37357f];return _0x505ef9;};'use strict';var _=require(_0xb2cb('0x0'));var util=require(_0xb2cb('0x1'));var logger=require(_0xb2cb('0x2'))(_0xb2cb('0x3'));var moment=require(_0xb2cb('0x4'));var BPromise=require(_0xb2cb('0x5'));var rp=require(_0xb2cb('0x6'));var fs=require('fs');var path=require(_0xb2cb('0x7'));var rimraf=require(_0xb2cb('0x8'));var config=require(_0xb2cb('0x9'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xb2cb('0xa')]=function(_0x137f5b,_0x1a4686){return _0x137f5b['define']('DeskAccount',attributes,{'tableName':_0xb2cb('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 d4a627f..67a31cc 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 _0xd27f=['catch','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','DeskAccount','findAll','options','raw','limit','include','model','map','attributes','info','GetDeskAccount'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0xd27f,0x93));var _0xfd27=function(_0x2b5ec4,_0x2c1cdc){_0x2b5ec4=_0x2b5ec4-0x0;var _0x22575d=_0xd27f[_0x2b5ec4];return _0x22575d;};'use strict';var _=require(_0xfd27('0x0'));var util=require(_0xfd27('0x1'));var moment=require(_0xfd27('0x2'));var BPromise=require(_0xfd27('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd27('0x4'));var db=require(_0xfd27('0x5'))['db'];var utils=require(_0xfd27('0x6'));var logger=require(_0xfd27('0x7'))('rpc');var config=require(_0xfd27('0x8'));var jayson=require(_0xfd27('0x9'));var client=jayson[_0xfd27('0xa')][_0xfd27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f4477,_0x2a1ee4,_0xe1e590){return new BPromise(function(_0x56ba2a,_0x315f4c){return client[_0xfd27('0xc')](_0x3f4477,_0xe1e590)[_0xfd27('0xd')](function(_0x305808){logger['info'](_0xfd27('0xe'),_0x2a1ee4,_0xfd27('0xf'));logger[_0xfd27('0x10')](_0xfd27('0x11'),_0x2a1ee4,_0xfd27('0xf'),JSON[_0xfd27('0x12')](_0x305808));if(_0x305808[_0xfd27('0x13')]){if(_0x305808[_0xfd27('0x13')]['code']===0x1f4){logger[_0xfd27('0x13')]('DeskAccount,\x20%s,\x20%s',_0x2a1ee4,_0x305808[_0xfd27('0x13')][_0xfd27('0x14')]);return _0x315f4c(_0x305808[_0xfd27('0x13')][_0xfd27('0x14')]);}logger[_0xfd27('0x13')]('DeskAccount,\x20%s,\x20%s',_0x2a1ee4,_0x305808[_0xfd27('0x13')][_0xfd27('0x14')]);return _0x56ba2a(_0x305808['error'][_0xfd27('0x14')]);}else{logger['info'](_0xfd27('0xe'),_0x2a1ee4,_0xfd27('0xf'));_0x56ba2a(_0x305808[_0xfd27('0x15')][_0xfd27('0x14')]);}})['catch'](function(_0x24806b){logger['error'](_0xfd27('0xe'),_0x2a1ee4,_0x24806b);_0x315f4c(_0x24806b);});});}exports['GetDeskAccount']=function(_0x45499f){var _0x59711d=this;return new Promise(function(_0x592f17,_0x227565){return db[_0xfd27('0x16')][_0xfd27('0x17')]({'raw':_0x45499f[_0xfd27('0x18')]?_0x45499f[_0xfd27('0x18')][_0xfd27('0x19')]===undefined?!![]:![]:!![],'where':_0x45499f['options']?_0x45499f[_0xfd27('0x18')]['where']||null:null,'attributes':_0x45499f[_0xfd27('0x18')]?_0x45499f[_0xfd27('0x18')]['attributes']||null:null,'limit':_0x45499f[_0xfd27('0x18')]?_0x45499f[_0xfd27('0x18')][_0xfd27('0x1a')]||null:null,'include':_0x45499f[_0xfd27('0x18')]?_0x45499f[_0xfd27('0x18')][_0xfd27('0x1b')]?_['map'](_0x45499f['options'][_0xfd27('0x1b')],function(_0x53eda1){return{'model':db[_0x53eda1[_0xfd27('0x1c')]],'as':_0x53eda1['as'],'attributes':_0x53eda1['attributes'],'include':_0x53eda1[_0xfd27('0x1b')]?_[_0xfd27('0x1d')](_0x53eda1[_0xfd27('0x1b')],function(_0x40ce5a){return{'model':db[_0x40ce5a[_0xfd27('0x1c')]],'as':_0x40ce5a['as'],'attributes':_0x40ce5a[_0xfd27('0x1e')],'include':_0x40ce5a['include']?_[_0xfd27('0x1d')](_0x40ce5a[_0xfd27('0x1b')],function(_0x217eb2){return{'model':db[_0x217eb2['model']],'as':_0x217eb2['as'],'attributes':_0x217eb2['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd27('0xd')](function(_0x1bfd5d){logger[_0xfd27('0x1f')](_0xfd27('0x20'),_0x45499f);logger[_0xfd27('0x10')]('GetDeskAccount',_0x45499f,JSON[_0xfd27('0x12')](_0x1bfd5d));_0x592f17(_0x1bfd5d);})[_0xfd27('0x21')](function(_0x9e06f9){logger['error'](_0xfd27('0x20'),_0x9e06f9[_0xfd27('0x14')],_0x45499f);_0x227565(_0x59711d[_0xfd27('0x13')](0x1f4,_0x9e06f9['message']));});});};exports[_0xfd27('0x22')]=function(_0x1cc52b){var _0x4ffe63=this;return new Promise(function(_0x1c5c1e,_0x169c62){return db[_0xfd27('0x16')][_0xfd27('0x23')]({'raw':_0x1cc52b[_0xfd27('0x18')]?_0x1cc52b['options'][_0xfd27('0x19')]===undefined?!![]:![]:!![],'where':_0x1cc52b[_0xfd27('0x18')]?_0x1cc52b[_0xfd27('0x18')]['where']||null:null,'attributes':_0x1cc52b[_0xfd27('0x18')]?_0x1cc52b[_0xfd27('0x18')][_0xfd27('0x1e')]||null:null,'include':_0x1cc52b[_0xfd27('0x18')]?_0x1cc52b[_0xfd27('0x18')]['include']?_[_0xfd27('0x1d')](_0x1cc52b[_0xfd27('0x18')][_0xfd27('0x1b')],function(_0x170f86){return{'model':db[_0x170f86[_0xfd27('0x1c')]],'as':_0x170f86['as'],'attributes':_0x170f86['attributes'],'include':_0x170f86[_0xfd27('0x1b')]?_[_0xfd27('0x1d')](_0x170f86[_0xfd27('0x1b')],function(_0x469a52){return{'model':db[_0x469a52[_0xfd27('0x1c')]],'as':_0x469a52['as'],'attributes':_0x469a52['attributes'],'include':_0x469a52[_0xfd27('0x1b')]?_['map'](_0x469a52[_0xfd27('0x1b')],function(_0x43c11a){return{'model':db[_0x43c11a[_0xfd27('0x1c')]],'as':_0x43c11a['as'],'attributes':_0x43c11a['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd27('0xd')](function(_0x2e8458){logger[_0xfd27('0x1f')](_0xfd27('0x22'),_0x1cc52b);logger['debug'](_0xfd27('0x22'),_0x1cc52b,JSON['stringify'](_0x2e8458));_0x1c5c1e(_0x2e8458);})[_0xfd27('0x21')](function(_0x1a495b){logger['error']('ShowDeskAccount',_0x1a495b[_0xfd27('0x14')],_0x1cc52b);_0x169c62(_0x4ffe63[_0xfd27('0x13')](0x1f4,_0x1a495b[_0xfd27('0x14')]));});});}; \ No newline at end of file +var _0x1463=['../../config/logger','rpc','../../config/environment','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','options','raw','where','map','model','include','attributes','ShowDeskAccount','find','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x1463,0x11a));var _0x3146=function(_0x57a843,_0x4d3d1f){_0x57a843=_0x57a843-0x0;var _0x295932=_0x1463[_0x57a843];return _0x295932;};'use strict';var _=require(_0x3146('0x0'));var util=require(_0x3146('0x1'));var moment=require(_0x3146('0x2'));var BPromise=require('bluebird');var rs=require(_0x3146('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3146('0x4'))['db'];var utils=require(_0x3146('0x5'));var logger=require(_0x3146('0x6'))(_0x3146('0x7'));var config=require(_0x3146('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3146('0x9')][_0x3146('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cb26f,_0x50bbd2,_0x16c3f3){return new BPromise(function(_0x153420,_0x4b8092){return client['request'](_0x4cb26f,_0x16c3f3)[_0x3146('0xb')](function(_0x52348f){logger[_0x3146('0xc')](_0x3146('0xd'),_0x50bbd2,_0x3146('0xe'));logger['debug'](_0x3146('0xf'),_0x50bbd2,_0x3146('0xe'),JSON[_0x3146('0x10')](_0x52348f));if(_0x52348f[_0x3146('0x11')]){if(_0x52348f[_0x3146('0x11')][_0x3146('0x12')]===0x1f4){logger[_0x3146('0x11')]('DeskAccount,\x20%s,\x20%s',_0x50bbd2,_0x52348f[_0x3146('0x11')][_0x3146('0x13')]);return _0x4b8092(_0x52348f['error'][_0x3146('0x13')]);}logger['error'](_0x3146('0xd'),_0x50bbd2,_0x52348f['error']['message']);return _0x153420(_0x52348f[_0x3146('0x11')][_0x3146('0x13')]);}else{logger[_0x3146('0xc')](_0x3146('0xd'),_0x50bbd2,_0x3146('0xe'));_0x153420(_0x52348f['result']['message']);}})[_0x3146('0x14')](function(_0xf5f17f){logger['error'](_0x3146('0xd'),_0x50bbd2,_0xf5f17f);_0x4b8092(_0xf5f17f);});});}exports[_0x3146('0x15')]=function(_0x467bc4){var _0x3171c8=this;return new Promise(function(_0x5014e2,_0x1a773e){return db['DeskAccount']['findAll']({'raw':_0x467bc4[_0x3146('0x16')]?_0x467bc4[_0x3146('0x16')][_0x3146('0x17')]===undefined?!![]:![]:!![],'where':_0x467bc4['options']?_0x467bc4['options'][_0x3146('0x18')]||null:null,'attributes':_0x467bc4[_0x3146('0x16')]?_0x467bc4[_0x3146('0x16')]['attributes']||null:null,'limit':_0x467bc4[_0x3146('0x16')]?_0x467bc4['options']['limit']||null:null,'include':_0x467bc4[_0x3146('0x16')]?_0x467bc4['options']['include']?_[_0x3146('0x19')](_0x467bc4['options']['include'],function(_0x1ad628){return{'model':db[_0x1ad628[_0x3146('0x1a')]],'as':_0x1ad628['as'],'attributes':_0x1ad628['attributes'],'include':_0x1ad628[_0x3146('0x1b')]?_['map'](_0x1ad628['include'],function(_0x103798){return{'model':db[_0x103798['model']],'as':_0x103798['as'],'attributes':_0x103798[_0x3146('0x1c')],'include':_0x103798[_0x3146('0x1b')]?_[_0x3146('0x19')](_0x103798[_0x3146('0x1b')],function(_0xcb667d){return{'model':db[_0xcb667d[_0x3146('0x1a')]],'as':_0xcb667d['as'],'attributes':_0xcb667d[_0x3146('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3146('0xb')](function(_0x5b3e53){logger['info']('GetDeskAccount',_0x467bc4);logger['debug']('GetDeskAccount',_0x467bc4,JSON[_0x3146('0x10')](_0x5b3e53));_0x5014e2(_0x5b3e53);})['catch'](function(_0x5bae15){logger[_0x3146('0x11')](_0x3146('0x15'),_0x5bae15[_0x3146('0x13')],_0x467bc4);_0x1a773e(_0x3171c8[_0x3146('0x11')](0x1f4,_0x5bae15['message']));});});};exports[_0x3146('0x1d')]=function(_0x1d4b14){var _0xe9ddd=this;return new Promise(function(_0x2a49d2,_0xeabf75){return db['DeskAccount'][_0x3146('0x1e')]({'raw':_0x1d4b14[_0x3146('0x16')]?_0x1d4b14[_0x3146('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d4b14[_0x3146('0x16')]?_0x1d4b14['options']['where']||null:null,'attributes':_0x1d4b14[_0x3146('0x16')]?_0x1d4b14[_0x3146('0x16')]['attributes']||null:null,'include':_0x1d4b14[_0x3146('0x16')]?_0x1d4b14[_0x3146('0x16')][_0x3146('0x1b')]?_[_0x3146('0x19')](_0x1d4b14['options'][_0x3146('0x1b')],function(_0x2ad0ef){return{'model':db[_0x2ad0ef[_0x3146('0x1a')]],'as':_0x2ad0ef['as'],'attributes':_0x2ad0ef[_0x3146('0x1c')],'include':_0x2ad0ef[_0x3146('0x1b')]?_['map'](_0x2ad0ef[_0x3146('0x1b')],function(_0x135d8b){return{'model':db[_0x135d8b[_0x3146('0x1a')]],'as':_0x135d8b['as'],'attributes':_0x135d8b[_0x3146('0x1c')],'include':_0x135d8b[_0x3146('0x1b')]?_[_0x3146('0x19')](_0x135d8b[_0x3146('0x1b')],function(_0x565f61){return{'model':db[_0x565f61[_0x3146('0x1a')]],'as':_0x565f61['as'],'attributes':_0x565f61[_0x3146('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3146('0xb')](function(_0x164778){logger['info'](_0x3146('0x1d'),_0x1d4b14);logger[_0x3146('0x1f')]('ShowDeskAccount',_0x1d4b14,JSON[_0x3146('0x10')](_0x164778));_0x2a49d2(_0x164778);})[_0x3146('0x14')](function(_0x26c568){logger['error'](_0x3146('0x1d'),_0x26c568[_0x3146('0x13')],_0x1d4b14);_0xeabf75(_0xe9ddd['error'](0x1f4,_0x26c568[_0x3146('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index f05ec39..8ae472f 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5df61f,_0x2b4bb4){var _0x2d4881=function(_0x404473){while(--_0x404473){_0x5df61f['push'](_0x5df61f['shift']());}};_0x2d4881(++_0x2b4bb4);}(_0x3e74,0x175));var _0x43e7=function(_0x2174d9,_0x18b6d7){_0x2174d9=_0x2174d9-0x0;var _0x2145d0=_0x3e74[_0x2174d9];return _0x2145d0;};'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('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +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(_0x532138,_0x3b38ad){var _0x3555dd=function(_0x1febde){while(--_0x1febde){_0x532138['push'](_0x532138['shift']());}};_0x3555dd(++_0x3b38ad);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a07d2,_0x34cf1c){_0x1a07d2=_0x1a07d2-0x0;var _0x4004b8=_0xedd9[_0x1a07d2];return _0x4004b8;};'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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b81331c..a920bc9 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 _0x80aa=['STRING','exports'];(function(_0x40eae8,_0x475c0e){var _0x57c094=function(_0x37988a){while(--_0x37988a){_0x40eae8['push'](_0x40eae8['shift']());}};_0x57c094(++_0x475c0e);}(_0x80aa,0xbd));var _0xa80a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x80aa[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xa80a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa80a('0x1')]}}; \ No newline at end of file +var _0xdda4=['STRING'];(function(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0xdda4,0x96));var _0x4dda=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xdda4[_0x3042c5];return _0x7cd140;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4dda('0x0')]},'description':{'type':Sequelize[_0x4dda('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7c17628..a8a62f3 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 _0xf122=['findOne','setTags','ids','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','getFields','DeskField','pick','getDescriptions','getTags','Tag'];(function(_0x4653d0,_0x2b9bdb){var _0x27f40=function(_0x5091fc){while(--_0x5091fc){_0x4653d0['push'](_0x4653d0['shift']());}};_0x27f40(++_0x2b9bdb);}(_0xf122,0xa3));var _0x2f12=function(_0x2cc5c6,_0x3d698b){_0x2cc5c6=_0x2cc5c6-0x0;var _0x5ae621=_0xf122[_0x2cc5c6];return _0x5ae621;};'use strict';var emlformat=require(_0x2f12('0x0'));var rimraf=require(_0x2f12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2f12('0x2'));var moment=require('moment');var BPromise=require(_0x2f12('0x3'));var Mustache=require(_0x2f12('0x4'));var util=require(_0x2f12('0x5'));var path=require('path');var sox=require(_0x2f12('0x6'));var csv=require(_0x2f12('0x7'));var ejs=require(_0x2f12('0x8'));var fs=require('fs');var fs_extra=require(_0x2f12('0x9'));var _=require('lodash');var squel=require(_0x2f12('0xa'));var crypto=require(_0x2f12('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2f12('0xc'));var toCsv=require(_0x2f12('0x7'));var querystring=require(_0x2f12('0xd'));var Papa=require(_0x2f12('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2f12('0xf'));var as=require(_0x2f12('0x10'));var hardwareService=require(_0x2f12('0x11'));var logger=require(_0x2f12('0x12'))(_0x2f12('0x13'));var utils=require(_0x2f12('0x14'));var config=require(_0x2f12('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f12('0x16'))['db'];function respondWithStatusCode(_0x2e9750,_0x1b5fb3){_0x1b5fb3=_0x1b5fb3||0xcc;return function(_0x367abe){if(_0x367abe){return _0x2e9750[_0x2f12('0x17')](_0x1b5fb3);}return _0x2e9750[_0x2f12('0x18')](_0x1b5fb3)['end']();};}function respondWithResult(_0x39f43f,_0x4974da){_0x4974da=_0x4974da||0xc8;return function(_0x2ecf21){if(_0x2ecf21){return _0x39f43f[_0x2f12('0x18')](_0x4974da)['json'](_0x2ecf21);}};}function respondWithFilteredResult(_0x1654cd,_0x239fdf){return function(_0x3f43db){if(_0x3f43db){var _0x1fb966=typeof _0x239fdf[_0x2f12('0x19')]===_0x2f12('0x1a')&&typeof _0x239fdf[_0x2f12('0x1b')]==='undefined';var _0x403076=_0x3f43db[_0x2f12('0x1c')];var _0x4c931b=_0x1fb966?0x0:_0x239fdf[_0x2f12('0x19')];var _0x1ff300=_0x1fb966?_0x3f43db['count']:_0x239fdf[_0x2f12('0x19')]+_0x239fdf[_0x2f12('0x1b')];var _0x435137;if(_0x1ff300>=_0x403076){_0x1ff300=_0x403076;_0x435137=0xc8;}else{_0x435137=0xce;}_0x1654cd[_0x2f12('0x18')](_0x435137);return _0x1654cd[_0x2f12('0x1d')](_0x2f12('0x1e'),_0x4c931b+'-'+_0x1ff300+'/'+_0x403076)['json'](_0x3f43db);}return null;};}function patchUpdates(_0x54a465){return function(_0x259ecb){try{jsonpatch[_0x2f12('0x1f')](_0x259ecb,_0x54a465,!![]);}catch(_0x4fdc04){return BPromise[_0x2f12('0x20')](_0x4fdc04);}return _0x259ecb[_0x2f12('0x21')]();};}function saveUpdates(_0x5cf70e,_0x592895){return function(_0x1c12bb){if(_0x1c12bb){return _0x1c12bb[_0x2f12('0x22')](_0x5cf70e)[_0x2f12('0x23')](function(_0x481c1f){return _0x481c1f;});}return null;};}function removeEntity(_0x1157c7,_0x3a7d94){return function(_0x41788c){if(_0x41788c){return _0x41788c[_0x2f12('0x24')]()['then'](function(){_0x1157c7['status'](0xcc)[_0x2f12('0x25')]();});}};}function handleEntityNotFound(_0x345126,_0x561d89){return function(_0x55852f){if(!_0x55852f){_0x345126[_0x2f12('0x17')](0x194);}return _0x55852f;};}function handleError(_0x2d9c91,_0x4c9e29){_0x4c9e29=_0x4c9e29||0x1f4;return function(_0x1a4b89){logger[_0x2f12('0x26')](_0x1a4b89['stack']);if(_0x1a4b89[_0x2f12('0x27')]){delete _0x1a4b89['name'];}_0x2d9c91['status'](_0x4c9e29)['send'](_0x1a4b89);};}exports['index']=function(_0xc486e7,_0x771e25){var _0x2a4cc7={},_0x31c178={},_0x513bbe={'count':0x0,'rows':[]};var _0x6a8ba3=_[_0x2f12('0x28')](db[_0x2f12('0x29')][_0x2f12('0x2a')],function(_0xa527a8){return{'name':_0xa527a8[_0x2f12('0x2b')],'type':_0xa527a8[_0x2f12('0x2c')]['key']};});_0x31c178[_0x2f12('0x2d')]=_[_0x2f12('0x28')](_0x6a8ba3,_0x2f12('0x27'));_0x31c178[_0x2f12('0x2e')]=_['keys'](_0xc486e7[_0x2f12('0x2e')]);_0x31c178[_0x2f12('0x2f')]=_[_0x2f12('0x30')](_0x31c178[_0x2f12('0x2d')],_0x31c178[_0x2f12('0x2e')]);_0x2a4cc7[_0x2f12('0x31')]=_[_0x2f12('0x30')](_0x31c178['model'],qs[_0x2f12('0x32')](_0xc486e7[_0x2f12('0x2e')]['fields']));_0x2a4cc7[_0x2f12('0x31')]=_0x2a4cc7['attributes']['length']?_0x2a4cc7['attributes']:_0x31c178[_0x2f12('0x2d')];if(!_0xc486e7[_0x2f12('0x2e')][_0x2f12('0x33')](_0x2f12('0x34'))){_0x2a4cc7[_0x2f12('0x1b')]=qs['limit'](_0xc486e7[_0x2f12('0x2e')]['limit']);_0x2a4cc7[_0x2f12('0x19')]=qs[_0x2f12('0x19')](_0xc486e7[_0x2f12('0x2e')]['offset']);}_0x2a4cc7[_0x2f12('0x35')]=qs[_0x2f12('0x36')](_0xc486e7[_0x2f12('0x2e')]['sort']);_0x2a4cc7[_0x2f12('0x37')]=qs[_0x2f12('0x2f')](_['pick'](_0xc486e7['query'],_0x31c178[_0x2f12('0x2f')]),_0x6a8ba3);if(_0xc486e7[_0x2f12('0x2e')][_0x2f12('0x38')]){_0x2a4cc7[_0x2f12('0x37')]=_[_0x2f12('0x39')](_0x2a4cc7[_0x2f12('0x37')],{'$or':_[_0x2f12('0x28')](_0x6a8ba3,function(_0x29e810){if(_0x29e810[_0x2f12('0x2c')]!=='VIRTUAL'){var _0x576319={};_0x576319[_0x29e810[_0x2f12('0x27')]]={'$like':'%'+_0xc486e7[_0x2f12('0x2e')][_0x2f12('0x38')]+'%'};return _0x576319;}})});}_0x2a4cc7=_[_0x2f12('0x39')]({},_0x2a4cc7,_0xc486e7[_0x2f12('0x3a')]);var _0x3c3f92={'where':_0x2a4cc7[_0x2f12('0x37')]};return db[_0x2f12('0x29')][_0x2f12('0x1c')](_0x3c3f92)[_0x2f12('0x23')](function(_0x4ad5){_0x513bbe[_0x2f12('0x1c')]=_0x4ad5;if(_0xc486e7[_0x2f12('0x2e')][_0x2f12('0x3b')]){_0x2a4cc7[_0x2f12('0x3c')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x2f12('0x3d')](_0x2a4cc7);})['then'](function(_0x3d1ab1){_0x513bbe[_0x2f12('0x3e')]=_0x3d1ab1;return _0x513bbe;})[_0x2f12('0x23')](respondWithFilteredResult(_0x771e25,_0x2a4cc7))[_0x2f12('0x3f')](handleError(_0x771e25,null));};exports[_0x2f12('0x40')]=function(_0x4bf891,_0x518c82){var _0x43d2d1={'raw':![],'where':{'id':_0x4bf891[_0x2f12('0x41')]['id']}},_0x468b7c={};_0x468b7c[_0x2f12('0x2d')]=_[_0x2f12('0x42')](db[_0x2f12('0x29')][_0x2f12('0x2a')]);_0x468b7c[_0x2f12('0x2e')]=_[_0x2f12('0x42')](_0x4bf891['query']);_0x468b7c[_0x2f12('0x2f')]=_[_0x2f12('0x30')](_0x468b7c['model'],_0x468b7c[_0x2f12('0x2e')]);_0x43d2d1['attributes']=_['intersection'](_0x468b7c['model'],qs[_0x2f12('0x32')](_0x4bf891[_0x2f12('0x2e')][_0x2f12('0x32')]));_0x43d2d1[_0x2f12('0x31')]=_0x43d2d1['attributes'][_0x2f12('0x43')]?_0x43d2d1['attributes']:_0x468b7c[_0x2f12('0x2d')];if(_0x4bf891[_0x2f12('0x2e')][_0x2f12('0x3b')]){_0x43d2d1['include']=[{'all':!![]}];}_0x43d2d1=_[_0x2f12('0x39')]({},_0x43d2d1,_0x4bf891[_0x2f12('0x3a')]);return db[_0x2f12('0x29')]['find'](_0x43d2d1)[_0x2f12('0x23')](handleEntityNotFound(_0x518c82,null))['then'](respondWithResult(_0x518c82,null))[_0x2f12('0x3f')](handleError(_0x518c82,null));};exports[_0x2f12('0x44')]=function(_0xb52f06,_0x4fc3df){return db[_0x2f12('0x29')]['create'](_0xb52f06[_0x2f12('0x45')],{})[_0x2f12('0x23')](respondWithResult(_0x4fc3df,0xc9))[_0x2f12('0x3f')](handleError(_0x4fc3df,null));};exports[_0x2f12('0x22')]=function(_0x4fcdb1,_0x817f8e){if(_0x4fcdb1['body']['id']){delete _0x4fcdb1[_0x2f12('0x45')]['id'];}return db['DeskConfiguration'][_0x2f12('0x46')]({'where':{'id':_0x4fcdb1['params']['id']}})[_0x2f12('0x23')](handleEntityNotFound(_0x817f8e,null))[_0x2f12('0x23')](saveUpdates(_0x4fcdb1['body'],null))[_0x2f12('0x23')](respondWithResult(_0x817f8e,null))[_0x2f12('0x3f')](handleError(_0x817f8e,null));};exports[_0x2f12('0x24')]=function(_0x357121,_0x39e856){return db[_0x2f12('0x29')]['find']({'where':{'id':_0x357121['params']['id']}})[_0x2f12('0x23')](handleEntityNotFound(_0x39e856,null))[_0x2f12('0x23')](removeEntity(_0x39e856,null))[_0x2f12('0x3f')](handleError(_0x39e856,null));};exports[_0x2f12('0x47')]=function(_0x50578d,_0x26344d,_0x31b65b){var _0x398314={};var _0x2ff956={};var _0xbbc239;var _0x20de2b;return db[_0x2f12('0x29')]['findOne']({'where':{'id':_0x50578d[_0x2f12('0x41')]['id']}})['then'](handleEntityNotFound(_0x26344d,null))[_0x2f12('0x23')](function(_0x3abde9){if(_0x3abde9){_0xbbc239=_0x3abde9;_0x2ff956['model']=_[_0x2f12('0x42')](db['DeskField']['rawAttributes']);_0x2ff956['query']=_[_0x2f12('0x42')](_0x50578d[_0x2f12('0x2e')]);_0x2ff956[_0x2f12('0x2f')]=_[_0x2f12('0x30')](_0x2ff956['model'],_0x2ff956[_0x2f12('0x2e')]);_0x398314[_0x2f12('0x31')]=_[_0x2f12('0x30')](_0x2ff956['model'],qs[_0x2f12('0x32')](_0x50578d['query']['fields']));_0x398314[_0x2f12('0x31')]=_0x398314[_0x2f12('0x31')][_0x2f12('0x43')]?_0x398314['attributes']:_0x2ff956['model'];_0x398314[_0x2f12('0x35')]=qs['sort'](_0x50578d['query']['sort']);_0x398314[_0x2f12('0x37')]=qs[_0x2f12('0x2f')](_['pick'](_0x50578d[_0x2f12('0x2e')],_0x2ff956[_0x2f12('0x2f')]));if(_0x50578d['query']['filter']){_0x398314['where']=_[_0x2f12('0x39')](_0x398314[_0x2f12('0x37')],{'$or':_[_0x2f12('0x28')](_0x398314[_0x2f12('0x31')],function(_0x443ca3){var _0x599916={};_0x599916[_0x443ca3]={'$like':'%'+_0x50578d[_0x2f12('0x2e')][_0x2f12('0x38')]+'%'};return _0x599916;})});}_0x398314=_['merge']({},_0x398314,_0x50578d[_0x2f12('0x3a')]);return _0xbbc239[_0x2f12('0x47')](_0x398314);}})[_0x2f12('0x23')](function(_0x5f499d){if(_0x5f499d){_0x20de2b=_0x5f499d[_0x2f12('0x43')];if(!_0x50578d[_0x2f12('0x2e')]['hasOwnProperty'](_0x2f12('0x34'))){_0x398314[_0x2f12('0x1b')]=qs[_0x2f12('0x1b')](_0x50578d[_0x2f12('0x2e')][_0x2f12('0x1b')]);_0x398314[_0x2f12('0x19')]=qs[_0x2f12('0x19')](_0x50578d['query'][_0x2f12('0x19')]);}return _0xbbc239['getFields'](_0x398314);}})[_0x2f12('0x23')](function(_0x4a9dec){if(_0x4a9dec){return _0x4a9dec?{'count':_0x20de2b,'rows':_0x4a9dec}:null;}})[_0x2f12('0x23')](respondWithResult(_0x26344d,null))['catch'](handleError(_0x26344d,null));};exports['getSubjects']=function(_0x5d5945,_0x4fda7b,_0x44d712){var _0x2a2399={};var _0x56b883={};var _0x2231b0;var _0x5aca9a;return db[_0x2f12('0x29')]['findOne']({'where':{'id':_0x5d5945[_0x2f12('0x41')]['id']}})['then'](handleEntityNotFound(_0x4fda7b,null))[_0x2f12('0x23')](function(_0x1ce470){if(_0x1ce470){_0x2231b0=_0x1ce470;_0x56b883['model']=_['keys'](db[_0x2f12('0x48')][_0x2f12('0x2a')]);_0x56b883[_0x2f12('0x2e')]=_[_0x2f12('0x42')](_0x5d5945[_0x2f12('0x2e')]);_0x56b883['filters']=_['intersection'](_0x56b883['model'],_0x56b883[_0x2f12('0x2e')]);_0x2a2399['attributes']=_['intersection'](_0x56b883['model'],qs[_0x2f12('0x32')](_0x5d5945['query'][_0x2f12('0x32')]));_0x2a2399[_0x2f12('0x31')]=_0x2a2399[_0x2f12('0x31')][_0x2f12('0x43')]?_0x2a2399[_0x2f12('0x31')]:_0x56b883['model'];_0x2a2399['order']=qs[_0x2f12('0x36')](_0x5d5945[_0x2f12('0x2e')][_0x2f12('0x36')]);_0x2a2399[_0x2f12('0x37')]=qs[_0x2f12('0x2f')](_[_0x2f12('0x49')](_0x5d5945['query'],_0x56b883['filters']));if(_0x5d5945[_0x2f12('0x2e')]['filter']){_0x2a2399[_0x2f12('0x37')]=_[_0x2f12('0x39')](_0x2a2399[_0x2f12('0x37')],{'$or':_['map'](_0x2a2399[_0x2f12('0x31')],function(_0x116170){var _0x5befd1={};_0x5befd1[_0x116170]={'$like':'%'+_0x5d5945[_0x2f12('0x2e')][_0x2f12('0x38')]+'%'};return _0x5befd1;})});}_0x2a2399=_[_0x2f12('0x39')]({},_0x2a2399,_0x5d5945[_0x2f12('0x3a')]);return _0x2231b0['getSubjects'](_0x2a2399);}})['then'](function(_0x855d26){if(_0x855d26){_0x5aca9a=_0x855d26['length'];if(!_0x5d5945[_0x2f12('0x2e')][_0x2f12('0x33')](_0x2f12('0x34'))){_0x2a2399[_0x2f12('0x1b')]=qs[_0x2f12('0x1b')](_0x5d5945[_0x2f12('0x2e')]['limit']);_0x2a2399['offset']=qs[_0x2f12('0x19')](_0x5d5945[_0x2f12('0x2e')]['offset']);}return _0x2231b0['getSubjects'](_0x2a2399);}})['then'](function(_0x291549){if(_0x291549){return _0x291549?{'count':_0x5aca9a,'rows':_0x291549}:null;}})[_0x2f12('0x23')](respondWithResult(_0x4fda7b,null))['catch'](handleError(_0x4fda7b,null));};exports[_0x2f12('0x4a')]=function(_0x5488a5,_0x4e67b5,_0xbce4fb){var _0x3b8f78={};var _0x12a189={};var _0x5d9505;var _0x12c381;return db[_0x2f12('0x29')]['findOne']({'where':{'id':_0x5488a5['params']['id']}})[_0x2f12('0x23')](handleEntityNotFound(_0x4e67b5,null))[_0x2f12('0x23')](function(_0x17b519){if(_0x17b519){_0x5d9505=_0x17b519;_0x12a189[_0x2f12('0x2d')]=_[_0x2f12('0x42')](db['DeskField']['rawAttributes']);_0x12a189[_0x2f12('0x2e')]=_[_0x2f12('0x42')](_0x5488a5[_0x2f12('0x2e')]);_0x12a189[_0x2f12('0x2f')]=_['intersection'](_0x12a189[_0x2f12('0x2d')],_0x12a189[_0x2f12('0x2e')]);_0x3b8f78[_0x2f12('0x31')]=_['intersection'](_0x12a189[_0x2f12('0x2d')],qs[_0x2f12('0x32')](_0x5488a5[_0x2f12('0x2e')][_0x2f12('0x32')]));_0x3b8f78['attributes']=_0x3b8f78['attributes'][_0x2f12('0x43')]?_0x3b8f78['attributes']:_0x12a189['model'];_0x3b8f78['order']=qs[_0x2f12('0x36')](_0x5488a5[_0x2f12('0x2e')][_0x2f12('0x36')]);_0x3b8f78[_0x2f12('0x37')]=qs['filters'](_['pick'](_0x5488a5[_0x2f12('0x2e')],_0x12a189['filters']));if(_0x5488a5[_0x2f12('0x2e')][_0x2f12('0x38')]){_0x3b8f78[_0x2f12('0x37')]=_[_0x2f12('0x39')](_0x3b8f78[_0x2f12('0x37')],{'$or':_[_0x2f12('0x28')](_0x3b8f78[_0x2f12('0x31')],function(_0x2ee4c9){var _0x3a8bab={};_0x3a8bab[_0x2ee4c9]={'$like':'%'+_0x5488a5['query'][_0x2f12('0x38')]+'%'};return _0x3a8bab;})});}_0x3b8f78=_[_0x2f12('0x39')]({},_0x3b8f78,_0x5488a5[_0x2f12('0x3a')]);return _0x5d9505[_0x2f12('0x4a')](_0x3b8f78);}})[_0x2f12('0x23')](function(_0x9e8d84){if(_0x9e8d84){_0x12c381=_0x9e8d84[_0x2f12('0x43')];if(!_0x5488a5['query'][_0x2f12('0x33')](_0x2f12('0x34'))){_0x3b8f78[_0x2f12('0x1b')]=qs[_0x2f12('0x1b')](_0x5488a5[_0x2f12('0x2e')][_0x2f12('0x1b')]);_0x3b8f78[_0x2f12('0x19')]=qs[_0x2f12('0x19')](_0x5488a5[_0x2f12('0x2e')][_0x2f12('0x19')]);}return _0x5d9505[_0x2f12('0x4a')](_0x3b8f78);}})['then'](function(_0x2e9ea7){if(_0x2e9ea7){return _0x2e9ea7?{'count':_0x12c381,'rows':_0x2e9ea7}:null;}})[_0x2f12('0x23')](respondWithResult(_0x4e67b5,null))[_0x2f12('0x3f')](handleError(_0x4e67b5,null));};exports[_0x2f12('0x4b')]=function(_0x54d230,_0x30dbb2,_0x5ebb9c){var _0x523c0a={};var _0xb4980b={};var _0x36a779;var _0x372875;return db[_0x2f12('0x29')]['findOne']({'where':{'id':_0x54d230[_0x2f12('0x41')]['id']}})[_0x2f12('0x23')](handleEntityNotFound(_0x30dbb2,null))[_0x2f12('0x23')](function(_0x13bb7d){if(_0x13bb7d){_0x36a779=_0x13bb7d;_0xb4980b[_0x2f12('0x2d')]=_[_0x2f12('0x42')](db[_0x2f12('0x4c')][_0x2f12('0x2a')]);_0xb4980b[_0x2f12('0x2e')]=_[_0x2f12('0x42')](_0x54d230[_0x2f12('0x2e')]);_0xb4980b[_0x2f12('0x2f')]=_[_0x2f12('0x30')](_0xb4980b[_0x2f12('0x2d')],_0xb4980b[_0x2f12('0x2e')]);_0x523c0a[_0x2f12('0x31')]=_[_0x2f12('0x30')](_0xb4980b[_0x2f12('0x2d')],qs[_0x2f12('0x32')](_0x54d230['query'][_0x2f12('0x32')]));_0x523c0a[_0x2f12('0x31')]=_0x523c0a[_0x2f12('0x31')][_0x2f12('0x43')]?_0x523c0a[_0x2f12('0x31')]:_0xb4980b[_0x2f12('0x2d')];_0x523c0a[_0x2f12('0x35')]=qs[_0x2f12('0x36')](_0x54d230[_0x2f12('0x2e')][_0x2f12('0x36')]);_0x523c0a[_0x2f12('0x37')]=qs[_0x2f12('0x2f')](_[_0x2f12('0x49')](_0x54d230[_0x2f12('0x2e')],_0xb4980b[_0x2f12('0x2f')]));if(_0x54d230['query']['filter']){_0x523c0a[_0x2f12('0x37')]=_[_0x2f12('0x39')](_0x523c0a[_0x2f12('0x37')],{'$or':_[_0x2f12('0x28')](_0x523c0a[_0x2f12('0x31')],function(_0x128334){var _0x38cc7f={};_0x38cc7f[_0x128334]={'$like':'%'+_0x54d230[_0x2f12('0x2e')][_0x2f12('0x38')]+'%'};return _0x38cc7f;})});}_0x523c0a=_[_0x2f12('0x39')]({},_0x523c0a,_0x54d230['options']);return _0x36a779[_0x2f12('0x4b')](_0x523c0a);}})['then'](function(_0x2ce90d){if(_0x2ce90d){_0x372875=_0x2ce90d[_0x2f12('0x43')];if(!_0x54d230['query'][_0x2f12('0x33')](_0x2f12('0x34'))){_0x523c0a['limit']=qs['limit'](_0x54d230[_0x2f12('0x2e')]['limit']);_0x523c0a[_0x2f12('0x19')]=qs[_0x2f12('0x19')](_0x54d230[_0x2f12('0x2e')]['offset']);}return _0x36a779[_0x2f12('0x4b')](_0x523c0a);}})[_0x2f12('0x23')](function(_0x402c79){if(_0x402c79){return _0x402c79?{'count':_0x372875,'rows':_0x402c79}:null;}})[_0x2f12('0x23')](respondWithResult(_0x30dbb2,null))[_0x2f12('0x3f')](handleError(_0x30dbb2,null));};exports['setTags']=function(_0x4b3f96,_0x32e816,_0x2c2bb8){if(_0x4b3f96[_0x2f12('0x45')]['id']){delete _0x4b3f96[_0x2f12('0x45')]['id'];}return db[_0x2f12('0x29')][_0x2f12('0x4d')]({'where':{'id':_0x4b3f96[_0x2f12('0x41')]['id']}})[_0x2f12('0x23')](handleEntityNotFound(_0x32e816,null))[_0x2f12('0x23')](function(_0x5f3b75){if(_0x5f3b75){return _0x5f3b75[_0x2f12('0x4e')](_0x4b3f96[_0x2f12('0x45')][_0x2f12('0x4f')]||[]);}return null;})[_0x2f12('0x23')](respondWithResult(_0x32e816,null))['catch'](handleError(_0x32e816,null));}; \ No newline at end of file +var _0xfc04=['../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskConfiguration','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','catch','show','rawAttributes','includeAll','include','find','create','body','params','getFields','findOne','DeskField','getSubjects','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2b6346,_0x93cf33){var _0x5da459=function(_0x2d5a97){while(--_0x2d5a97){_0x2b6346['push'](_0x2b6346['shift']());}};_0x5da459(++_0x93cf33);}(_0xfc04,0x92));var _0x4fc0=function(_0x216ab9,_0x3ecc6d){_0x216ab9=_0x216ab9-0x0;var _0x38e7bd=_0xfc04[_0x216ab9];return _0x38e7bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fc0('0x0'));var zipdir=require(_0x4fc0('0x1'));var jsonpatch=require(_0x4fc0('0x2'));var rp=require('request-promise');var moment=require(_0x4fc0('0x3'));var BPromise=require(_0x4fc0('0x4'));var Mustache=require(_0x4fc0('0x5'));var util=require(_0x4fc0('0x6'));var path=require(_0x4fc0('0x7'));var sox=require(_0x4fc0('0x8'));var csv=require(_0x4fc0('0x9'));var ejs=require(_0x4fc0('0xa'));var fs=require('fs');var fs_extra=require(_0x4fc0('0xb'));var _=require(_0x4fc0('0xc'));var squel=require(_0x4fc0('0xd'));var crypto=require(_0x4fc0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4fc0('0xf'));var toCsv=require(_0x4fc0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4fc0('0x10'));var as=require(_0x4fc0('0x11'));var hardwareService=require(_0x4fc0('0x12'));var logger=require(_0x4fc0('0x13'))('api');var utils=require(_0x4fc0('0x14'));var config=require(_0x4fc0('0x15'));var licenseUtil=require(_0x4fc0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4674c1,_0x165f6d){_0x165f6d=_0x165f6d||0xcc;return function(_0x4e0b82){if(_0x4e0b82){return _0x4674c1['sendStatus'](_0x165f6d);}return _0x4674c1[_0x4fc0('0x17')](_0x165f6d)[_0x4fc0('0x18')]();};}function respondWithResult(_0x30bca9,_0x479e1b){_0x479e1b=_0x479e1b||0xc8;return function(_0x229934){if(_0x229934){return _0x30bca9['status'](_0x479e1b)['json'](_0x229934);}};}function respondWithFilteredResult(_0x17ae77,_0x359962){return function(_0x509377){if(_0x509377){var _0x5556c3=typeof _0x359962['offset']===_0x4fc0('0x19')&&typeof _0x359962[_0x4fc0('0x1a')]==='undefined';var _0x1eb796=_0x509377[_0x4fc0('0x1b')];var _0x4ae43f=_0x5556c3?0x0:_0x359962[_0x4fc0('0x1c')];var _0x796889=_0x5556c3?_0x509377['count']:_0x359962['offset']+_0x359962[_0x4fc0('0x1a')];var _0x2f0e80;if(_0x796889>=_0x1eb796){_0x796889=_0x1eb796;_0x2f0e80=0xc8;}else{_0x2f0e80=0xce;}_0x17ae77['status'](_0x2f0e80);return _0x17ae77[_0x4fc0('0x1d')](_0x4fc0('0x1e'),_0x4ae43f+'-'+_0x796889+'/'+_0x1eb796)[_0x4fc0('0x1f')](_0x509377);}return null;};}function patchUpdates(_0x3f20cb){return function(_0x3d1906){try{jsonpatch[_0x4fc0('0x20')](_0x3d1906,_0x3f20cb,!![]);}catch(_0x30a1bd){return BPromise[_0x4fc0('0x21')](_0x30a1bd);}return _0x3d1906[_0x4fc0('0x22')]();};}function saveUpdates(_0x18fad8,_0x267dd9){return function(_0x23cfeb){if(_0x23cfeb){return _0x23cfeb[_0x4fc0('0x23')](_0x18fad8)[_0x4fc0('0x24')](function(_0x806b2c){return _0x806b2c;});}return null;};}function removeEntity(_0x17604b,_0x4eb437){return function(_0x251fcf){if(_0x251fcf){return _0x251fcf[_0x4fc0('0x25')]()[_0x4fc0('0x24')](function(){_0x17604b[_0x4fc0('0x17')](0xcc)[_0x4fc0('0x18')]();});}};}function handleEntityNotFound(_0x408c46,_0x50e242){return function(_0x4dd265){if(!_0x4dd265){_0x408c46[_0x4fc0('0x26')](0x194);}return _0x4dd265;};}function handleError(_0x549ab1,_0x4f1509){_0x4f1509=_0x4f1509||0x1f4;return function(_0x2e663c){logger[_0x4fc0('0x27')](_0x2e663c[_0x4fc0('0x28')]);if(_0x2e663c[_0x4fc0('0x29')]){delete _0x2e663c[_0x4fc0('0x29')];}_0x549ab1[_0x4fc0('0x17')](_0x4f1509)[_0x4fc0('0x2a')](_0x2e663c);};}exports[_0x4fc0('0x2b')]=function(_0x5e0190,_0x37f48b){var _0xbf8455={},_0x5d5fb7={},_0x191c4b={'count':0x0,'rows':[]};var _0x2888f5=_[_0x4fc0('0x2c')](db[_0x4fc0('0x2d')]['rawAttributes'],function(_0x449fb5){return{'name':_0x449fb5['fieldName'],'type':_0x449fb5['type'][_0x4fc0('0x2e')]};});_0x5d5fb7[_0x4fc0('0x2f')]=_['map'](_0x2888f5,_0x4fc0('0x29'));_0x5d5fb7[_0x4fc0('0x30')]=_[_0x4fc0('0x31')](_0x5e0190['query']);_0x5d5fb7[_0x4fc0('0x32')]=_[_0x4fc0('0x33')](_0x5d5fb7[_0x4fc0('0x2f')],_0x5d5fb7['query']);_0xbf8455[_0x4fc0('0x34')]=_[_0x4fc0('0x33')](_0x5d5fb7['model'],qs[_0x4fc0('0x35')](_0x5e0190['query'][_0x4fc0('0x35')]));_0xbf8455['attributes']=_0xbf8455[_0x4fc0('0x34')][_0x4fc0('0x36')]?_0xbf8455['attributes']:_0x5d5fb7[_0x4fc0('0x2f')];if(!_0x5e0190[_0x4fc0('0x30')][_0x4fc0('0x37')](_0x4fc0('0x38'))){_0xbf8455[_0x4fc0('0x1a')]=qs[_0x4fc0('0x1a')](_0x5e0190['query']['limit']);_0xbf8455[_0x4fc0('0x1c')]=qs[_0x4fc0('0x1c')](_0x5e0190[_0x4fc0('0x30')][_0x4fc0('0x1c')]);}_0xbf8455[_0x4fc0('0x39')]=qs[_0x4fc0('0x3a')](_0x5e0190['query'][_0x4fc0('0x3a')]);_0xbf8455[_0x4fc0('0x3b')]=qs[_0x4fc0('0x32')](_[_0x4fc0('0x3c')](_0x5e0190[_0x4fc0('0x30')],_0x5d5fb7[_0x4fc0('0x32')]),_0x2888f5);if(_0x5e0190[_0x4fc0('0x30')]['filter']){_0xbf8455[_0x4fc0('0x3b')]=_[_0x4fc0('0x3d')](_0xbf8455['where'],{'$or':_['map'](_0x2888f5,function(_0x37e7ea){if(_0x37e7ea[_0x4fc0('0x3e')]!==_0x4fc0('0x3f')){var _0x1b37f4={};_0x1b37f4[_0x37e7ea[_0x4fc0('0x29')]]={'$like':'%'+_0x5e0190[_0x4fc0('0x30')][_0x4fc0('0x40')]+'%'};return _0x1b37f4;}})});}_0xbf8455=_[_0x4fc0('0x3d')]({},_0xbf8455,_0x5e0190[_0x4fc0('0x41')]);var _0xa12929={'where':_0xbf8455[_0x4fc0('0x3b')]};return db[_0x4fc0('0x2d')][_0x4fc0('0x1b')](_0xa12929)['then'](function(_0x18b1af){_0x191c4b[_0x4fc0('0x1b')]=_0x18b1af;if(_0x5e0190[_0x4fc0('0x30')]['includeAll']){_0xbf8455['include']=[{'all':!![]}];}return db[_0x4fc0('0x2d')]['findAll'](_0xbf8455);})[_0x4fc0('0x24')](function(_0x38aea0){_0x191c4b['rows']=_0x38aea0;return _0x191c4b;})[_0x4fc0('0x24')](respondWithFilteredResult(_0x37f48b,_0xbf8455))[_0x4fc0('0x42')](handleError(_0x37f48b,null));};exports[_0x4fc0('0x43')]=function(_0x5c90d9,_0x3f18d5){var _0x2240eb={'raw':![],'where':{'id':_0x5c90d9['params']['id']}},_0x332445={};_0x332445[_0x4fc0('0x2f')]=_[_0x4fc0('0x31')](db[_0x4fc0('0x2d')][_0x4fc0('0x44')]);_0x332445[_0x4fc0('0x30')]=_['keys'](_0x5c90d9[_0x4fc0('0x30')]);_0x332445['filters']=_[_0x4fc0('0x33')](_0x332445[_0x4fc0('0x2f')],_0x332445[_0x4fc0('0x30')]);_0x2240eb[_0x4fc0('0x34')]=_[_0x4fc0('0x33')](_0x332445[_0x4fc0('0x2f')],qs[_0x4fc0('0x35')](_0x5c90d9[_0x4fc0('0x30')][_0x4fc0('0x35')]));_0x2240eb[_0x4fc0('0x34')]=_0x2240eb[_0x4fc0('0x34')][_0x4fc0('0x36')]?_0x2240eb[_0x4fc0('0x34')]:_0x332445[_0x4fc0('0x2f')];if(_0x5c90d9[_0x4fc0('0x30')][_0x4fc0('0x45')]){_0x2240eb[_0x4fc0('0x46')]=[{'all':!![]}];}_0x2240eb=_[_0x4fc0('0x3d')]({},_0x2240eb,_0x5c90d9[_0x4fc0('0x41')]);return db[_0x4fc0('0x2d')][_0x4fc0('0x47')](_0x2240eb)[_0x4fc0('0x24')](handleEntityNotFound(_0x3f18d5,null))[_0x4fc0('0x24')](respondWithResult(_0x3f18d5,null))[_0x4fc0('0x42')](handleError(_0x3f18d5,null));};exports[_0x4fc0('0x48')]=function(_0x59259f,_0x7e6d0e){return db[_0x4fc0('0x2d')][_0x4fc0('0x48')](_0x59259f['body'],{})[_0x4fc0('0x24')](respondWithResult(_0x7e6d0e,0xc9))[_0x4fc0('0x42')](handleError(_0x7e6d0e,null));};exports[_0x4fc0('0x23')]=function(_0x557022,_0x28ce56){if(_0x557022['body']['id']){delete _0x557022[_0x4fc0('0x49')]['id'];}return db[_0x4fc0('0x2d')][_0x4fc0('0x47')]({'where':{'id':_0x557022[_0x4fc0('0x4a')]['id']}})[_0x4fc0('0x24')](handleEntityNotFound(_0x28ce56,null))[_0x4fc0('0x24')](saveUpdates(_0x557022[_0x4fc0('0x49')],null))[_0x4fc0('0x24')](respondWithResult(_0x28ce56,null))[_0x4fc0('0x42')](handleError(_0x28ce56,null));};exports['destroy']=function(_0x13a77e,_0x5242ad){return db[_0x4fc0('0x2d')]['find']({'where':{'id':_0x13a77e[_0x4fc0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5242ad,null))['then'](removeEntity(_0x5242ad,null))[_0x4fc0('0x42')](handleError(_0x5242ad,null));};exports[_0x4fc0('0x4b')]=function(_0x1c1c4c,_0x32e040,_0x5d4f10){var _0x388898={};var _0x1e338f={};var _0x5e23c6;var _0x5946c8;return db[_0x4fc0('0x2d')][_0x4fc0('0x4c')]({'where':{'id':_0x1c1c4c[_0x4fc0('0x4a')]['id']}})[_0x4fc0('0x24')](handleEntityNotFound(_0x32e040,null))[_0x4fc0('0x24')](function(_0xf48e40){if(_0xf48e40){_0x5e23c6=_0xf48e40;_0x1e338f[_0x4fc0('0x2f')]=_[_0x4fc0('0x31')](db[_0x4fc0('0x4d')][_0x4fc0('0x44')]);_0x1e338f[_0x4fc0('0x30')]=_[_0x4fc0('0x31')](_0x1c1c4c[_0x4fc0('0x30')]);_0x1e338f[_0x4fc0('0x32')]=_[_0x4fc0('0x33')](_0x1e338f[_0x4fc0('0x2f')],_0x1e338f[_0x4fc0('0x30')]);_0x388898['attributes']=_[_0x4fc0('0x33')](_0x1e338f['model'],qs[_0x4fc0('0x35')](_0x1c1c4c[_0x4fc0('0x30')]['fields']));_0x388898[_0x4fc0('0x34')]=_0x388898[_0x4fc0('0x34')][_0x4fc0('0x36')]?_0x388898[_0x4fc0('0x34')]:_0x1e338f[_0x4fc0('0x2f')];_0x388898['order']=qs[_0x4fc0('0x3a')](_0x1c1c4c['query'][_0x4fc0('0x3a')]);_0x388898['where']=qs[_0x4fc0('0x32')](_[_0x4fc0('0x3c')](_0x1c1c4c[_0x4fc0('0x30')],_0x1e338f['filters']));if(_0x1c1c4c[_0x4fc0('0x30')][_0x4fc0('0x40')]){_0x388898['where']=_['merge'](_0x388898[_0x4fc0('0x3b')],{'$or':_['map'](_0x388898[_0x4fc0('0x34')],function(_0x51cec5){var _0x4519f5={};_0x4519f5[_0x51cec5]={'$like':'%'+_0x1c1c4c[_0x4fc0('0x30')][_0x4fc0('0x40')]+'%'};return _0x4519f5;})});}_0x388898=_['merge']({},_0x388898,_0x1c1c4c['options']);return _0x5e23c6[_0x4fc0('0x4b')](_0x388898);}})[_0x4fc0('0x24')](function(_0x33ccfa){if(_0x33ccfa){_0x5946c8=_0x33ccfa['length'];if(!_0x1c1c4c['query'][_0x4fc0('0x37')]('nolimit')){_0x388898[_0x4fc0('0x1a')]=qs[_0x4fc0('0x1a')](_0x1c1c4c[_0x4fc0('0x30')][_0x4fc0('0x1a')]);_0x388898[_0x4fc0('0x1c')]=qs[_0x4fc0('0x1c')](_0x1c1c4c[_0x4fc0('0x30')]['offset']);}return _0x5e23c6[_0x4fc0('0x4b')](_0x388898);}})[_0x4fc0('0x24')](function(_0x1f0ae1){if(_0x1f0ae1){return _0x1f0ae1?{'count':_0x5946c8,'rows':_0x1f0ae1}:null;}})[_0x4fc0('0x24')](respondWithResult(_0x32e040,null))[_0x4fc0('0x42')](handleError(_0x32e040,null));};exports[_0x4fc0('0x4e')]=function(_0x15be6d,_0x26b9cf,_0xee932f){var _0xe65a95={};var _0x484c54={};var _0x66eb32;var _0xcb8543;return db[_0x4fc0('0x2d')][_0x4fc0('0x4c')]({'where':{'id':_0x15be6d['params']['id']}})[_0x4fc0('0x24')](handleEntityNotFound(_0x26b9cf,null))['then'](function(_0x29a50d){if(_0x29a50d){_0x66eb32=_0x29a50d;_0x484c54[_0x4fc0('0x2f')]=_[_0x4fc0('0x31')](db[_0x4fc0('0x4d')][_0x4fc0('0x44')]);_0x484c54[_0x4fc0('0x30')]=_[_0x4fc0('0x31')](_0x15be6d[_0x4fc0('0x30')]);_0x484c54[_0x4fc0('0x32')]=_['intersection'](_0x484c54[_0x4fc0('0x2f')],_0x484c54[_0x4fc0('0x30')]);_0xe65a95[_0x4fc0('0x34')]=_[_0x4fc0('0x33')](_0x484c54[_0x4fc0('0x2f')],qs[_0x4fc0('0x35')](_0x15be6d['query'][_0x4fc0('0x35')]));_0xe65a95['attributes']=_0xe65a95[_0x4fc0('0x34')]['length']?_0xe65a95[_0x4fc0('0x34')]:_0x484c54[_0x4fc0('0x2f')];_0xe65a95[_0x4fc0('0x39')]=qs[_0x4fc0('0x3a')](_0x15be6d[_0x4fc0('0x30')][_0x4fc0('0x3a')]);_0xe65a95['where']=qs[_0x4fc0('0x32')](_[_0x4fc0('0x3c')](_0x15be6d['query'],_0x484c54['filters']));if(_0x15be6d['query'][_0x4fc0('0x40')]){_0xe65a95['where']=_[_0x4fc0('0x3d')](_0xe65a95[_0x4fc0('0x3b')],{'$or':_[_0x4fc0('0x2c')](_0xe65a95[_0x4fc0('0x34')],function(_0x20dcd1){var _0x1e35af={};_0x1e35af[_0x20dcd1]={'$like':'%'+_0x15be6d[_0x4fc0('0x30')][_0x4fc0('0x40')]+'%'};return _0x1e35af;})});}_0xe65a95=_[_0x4fc0('0x3d')]({},_0xe65a95,_0x15be6d['options']);return _0x66eb32['getSubjects'](_0xe65a95);}})['then'](function(_0x5245b5){if(_0x5245b5){_0xcb8543=_0x5245b5[_0x4fc0('0x36')];if(!_0x15be6d['query'][_0x4fc0('0x37')](_0x4fc0('0x38'))){_0xe65a95[_0x4fc0('0x1a')]=qs['limit'](_0x15be6d['query'][_0x4fc0('0x1a')]);_0xe65a95[_0x4fc0('0x1c')]=qs[_0x4fc0('0x1c')](_0x15be6d['query'][_0x4fc0('0x1c')]);}return _0x66eb32[_0x4fc0('0x4e')](_0xe65a95);}})[_0x4fc0('0x24')](function(_0x38d0bc){if(_0x38d0bc){return _0x38d0bc?{'count':_0xcb8543,'rows':_0x38d0bc}:null;}})[_0x4fc0('0x24')](respondWithResult(_0x26b9cf,null))[_0x4fc0('0x42')](handleError(_0x26b9cf,null));};exports['getDescriptions']=function(_0x277970,_0x828c5,_0x3ad1d6){var _0x5216b3={};var _0x345c20={};var _0x3200b3;var _0x5a01ea;return db[_0x4fc0('0x2d')][_0x4fc0('0x4c')]({'where':{'id':_0x277970[_0x4fc0('0x4a')]['id']}})[_0x4fc0('0x24')](handleEntityNotFound(_0x828c5,null))[_0x4fc0('0x24')](function(_0x53ce0e){if(_0x53ce0e){_0x3200b3=_0x53ce0e;_0x345c20[_0x4fc0('0x2f')]=_[_0x4fc0('0x31')](db[_0x4fc0('0x4d')]['rawAttributes']);_0x345c20[_0x4fc0('0x30')]=_[_0x4fc0('0x31')](_0x277970[_0x4fc0('0x30')]);_0x345c20[_0x4fc0('0x32')]=_[_0x4fc0('0x33')](_0x345c20[_0x4fc0('0x2f')],_0x345c20[_0x4fc0('0x30')]);_0x5216b3[_0x4fc0('0x34')]=_[_0x4fc0('0x33')](_0x345c20[_0x4fc0('0x2f')],qs[_0x4fc0('0x35')](_0x277970[_0x4fc0('0x30')]['fields']));_0x5216b3['attributes']=_0x5216b3[_0x4fc0('0x34')][_0x4fc0('0x36')]?_0x5216b3['attributes']:_0x345c20[_0x4fc0('0x2f')];_0x5216b3['order']=qs[_0x4fc0('0x3a')](_0x277970['query'][_0x4fc0('0x3a')]);_0x5216b3[_0x4fc0('0x3b')]=qs[_0x4fc0('0x32')](_[_0x4fc0('0x3c')](_0x277970[_0x4fc0('0x30')],_0x345c20[_0x4fc0('0x32')]));if(_0x277970[_0x4fc0('0x30')][_0x4fc0('0x40')]){_0x5216b3[_0x4fc0('0x3b')]=_[_0x4fc0('0x3d')](_0x5216b3[_0x4fc0('0x3b')],{'$or':_[_0x4fc0('0x2c')](_0x5216b3['attributes'],function(_0xd852fe){var _0x38c30f={};_0x38c30f[_0xd852fe]={'$like':'%'+_0x277970[_0x4fc0('0x30')][_0x4fc0('0x40')]+'%'};return _0x38c30f;})});}_0x5216b3=_['merge']({},_0x5216b3,_0x277970[_0x4fc0('0x41')]);return _0x3200b3['getDescriptions'](_0x5216b3);}})[_0x4fc0('0x24')](function(_0x2040d5){if(_0x2040d5){_0x5a01ea=_0x2040d5['length'];if(!_0x277970[_0x4fc0('0x30')][_0x4fc0('0x37')]('nolimit')){_0x5216b3['limit']=qs[_0x4fc0('0x1a')](_0x277970[_0x4fc0('0x30')][_0x4fc0('0x1a')]);_0x5216b3['offset']=qs['offset'](_0x277970['query']['offset']);}return _0x3200b3['getDescriptions'](_0x5216b3);}})[_0x4fc0('0x24')](function(_0x25b75f){if(_0x25b75f){return _0x25b75f?{'count':_0x5a01ea,'rows':_0x25b75f}:null;}})[_0x4fc0('0x24')](respondWithResult(_0x828c5,null))[_0x4fc0('0x42')](handleError(_0x828c5,null));};exports[_0x4fc0('0x4f')]=function(_0x3aa8f6,_0x53a7bc,_0x10ea30){var _0x17d3ab={};var _0x5dc40f={};var _0x581dde;var _0x41ca22;return db['DeskConfiguration'][_0x4fc0('0x4c')]({'where':{'id':_0x3aa8f6[_0x4fc0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53a7bc,null))[_0x4fc0('0x24')](function(_0x45b416){if(_0x45b416){_0x581dde=_0x45b416;_0x5dc40f[_0x4fc0('0x2f')]=_[_0x4fc0('0x31')](db[_0x4fc0('0x50')]['rawAttributes']);_0x5dc40f['query']=_['keys'](_0x3aa8f6[_0x4fc0('0x30')]);_0x5dc40f[_0x4fc0('0x32')]=_[_0x4fc0('0x33')](_0x5dc40f[_0x4fc0('0x2f')],_0x5dc40f[_0x4fc0('0x30')]);_0x17d3ab[_0x4fc0('0x34')]=_[_0x4fc0('0x33')](_0x5dc40f[_0x4fc0('0x2f')],qs[_0x4fc0('0x35')](_0x3aa8f6[_0x4fc0('0x30')]['fields']));_0x17d3ab[_0x4fc0('0x34')]=_0x17d3ab['attributes'][_0x4fc0('0x36')]?_0x17d3ab['attributes']:_0x5dc40f[_0x4fc0('0x2f')];_0x17d3ab[_0x4fc0('0x39')]=qs['sort'](_0x3aa8f6[_0x4fc0('0x30')][_0x4fc0('0x3a')]);_0x17d3ab[_0x4fc0('0x3b')]=qs[_0x4fc0('0x32')](_[_0x4fc0('0x3c')](_0x3aa8f6[_0x4fc0('0x30')],_0x5dc40f[_0x4fc0('0x32')]));if(_0x3aa8f6['query']['filter']){_0x17d3ab['where']=_[_0x4fc0('0x3d')](_0x17d3ab[_0x4fc0('0x3b')],{'$or':_[_0x4fc0('0x2c')](_0x17d3ab[_0x4fc0('0x34')],function(_0x1e245b){var _0x370b6b={};_0x370b6b[_0x1e245b]={'$like':'%'+_0x3aa8f6[_0x4fc0('0x30')][_0x4fc0('0x40')]+'%'};return _0x370b6b;})});}_0x17d3ab=_[_0x4fc0('0x3d')]({},_0x17d3ab,_0x3aa8f6['options']);return _0x581dde['getTags'](_0x17d3ab);}})['then'](function(_0xe4cda0){if(_0xe4cda0){_0x41ca22=_0xe4cda0[_0x4fc0('0x36')];if(!_0x3aa8f6['query'][_0x4fc0('0x37')](_0x4fc0('0x38'))){_0x17d3ab[_0x4fc0('0x1a')]=qs[_0x4fc0('0x1a')](_0x3aa8f6['query'][_0x4fc0('0x1a')]);_0x17d3ab['offset']=qs[_0x4fc0('0x1c')](_0x3aa8f6['query'][_0x4fc0('0x1c')]);}return _0x581dde[_0x4fc0('0x4f')](_0x17d3ab);}})[_0x4fc0('0x24')](function(_0xb99099){if(_0xb99099){return _0xb99099?{'count':_0x41ca22,'rows':_0xb99099}:null;}})[_0x4fc0('0x24')](respondWithResult(_0x53a7bc,null))['catch'](handleError(_0x53a7bc,null));};exports[_0x4fc0('0x51')]=function(_0x3121f5,_0x295a23,_0x59a20b){if(_0x3121f5[_0x4fc0('0x49')]['id']){delete _0x3121f5[_0x4fc0('0x49')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x3121f5['params']['id']}})[_0x4fc0('0x24')](handleEntityNotFound(_0x295a23,null))['then'](function(_0x1a3cef){if(_0x1a3cef){return _0x1a3cef[_0x4fc0('0x51')](_0x3121f5[_0x4fc0('0x49')][_0x4fc0('0x52')]||[]);}return null;})['then'](respondWithResult(_0x295a23,null))[_0x4fc0('0x42')](handleError(_0x295a23,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6744e3e..9057b93 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 _0x52fd=['moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util','../../config/logger','api'];(function(_0x180f6e,_0x1d7c5c){var _0x537fd2=function(_0x3226ab){while(--_0x3226ab){_0x180f6e['push'](_0x180f6e['shift']());}};_0x537fd2(++_0x1d7c5c);}(_0x52fd,0x18f));var _0xd52f=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x52fd[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xd52f('0x0'));var util=require(_0xd52f('0x1'));var logger=require(_0xd52f('0x2'))(_0xd52f('0x3'));var moment=require(_0xd52f('0x4'));var BPromise=require(_0xd52f('0x5'));var rp=require(_0xd52f('0x6'));var fs=require('fs');var path=require(_0xd52f('0x7'));var rimraf=require(_0xd52f('0x8'));var config=require('../../config/environment');var attributes=require(_0xd52f('0x9'));module[_0xd52f('0xa')]=function(_0x391962,_0x2905de){return _0x391962[_0xd52f('0xb')]('DeskConfiguration',attributes,{'tableName':_0xd52f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x943f=['path','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','util','../../config/logger','api','bluebird'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x943f,0xa7));var _0xf943=function(_0xb847f2,_0x1690df){_0xb847f2=_0xb847f2-0x0;var _0x24964e=_0x943f[_0xb847f2];return _0x24964e;};'use strict';var _=require('lodash');var util=require(_0xf943('0x0'));var logger=require(_0xf943('0x1'))(_0xf943('0x2'));var moment=require('moment');var BPromise=require(_0xf943('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf943('0x4'));var rimraf=require('rimraf');var config=require(_0xf943('0x5'));var attributes=require(_0xf943('0x6'));module[_0xf943('0x7')]=function(_0x1a3655,_0xd7838c){return _0x1a3655['define'](_0xf943('0x8'),attributes,{'tableName':'int_desk_configurations','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 07c1bc0..bb48153 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 _0x01b5=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01b5,0xca));var _0x501b=function(_0x290274,_0x282840){_0x290274=_0x290274-0x0;var _0x5d8972=_0x01b5[_0x290274];return _0x5d8972;};'use strict';var _=require(_0x501b('0x0'));var util=require(_0x501b('0x1'));var moment=require(_0x501b('0x2'));var BPromise=require(_0x501b('0x3'));var rs=require(_0x501b('0x4'));var fs=require('fs');var Redis=require(_0x501b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x501b('0x6'));var logger=require(_0x501b('0x7'))(_0x501b('0x8'));var config=require(_0x501b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x501b('0xa')][_0x501b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x288d59,_0x493687,_0x17ee86){return new BPromise(function(_0x2df165,_0x15c4f4){return client['request'](_0x288d59,_0x17ee86)[_0x501b('0xc')](function(_0x444bc3){logger[_0x501b('0xd')](_0x501b('0xe'),_0x493687,_0x501b('0xf'));logger[_0x501b('0x10')](_0x501b('0x11'),_0x493687,_0x501b('0xf'),JSON[_0x501b('0x12')](_0x444bc3));if(_0x444bc3['error']){if(_0x444bc3['error'][_0x501b('0x13')]===0x1f4){logger[_0x501b('0x14')](_0x501b('0xe'),_0x493687,_0x444bc3['error'][_0x501b('0x15')]);return _0x15c4f4(_0x444bc3[_0x501b('0x14')][_0x501b('0x15')]);}logger[_0x501b('0x14')](_0x501b('0xe'),_0x493687,_0x444bc3[_0x501b('0x14')][_0x501b('0x15')]);return _0x2df165(_0x444bc3[_0x501b('0x14')][_0x501b('0x15')]);}else{logger[_0x501b('0xd')](_0x501b('0xe'),_0x493687,_0x501b('0xf'));_0x2df165(_0x444bc3[_0x501b('0x16')][_0x501b('0x15')]);}})['catch'](function(_0x5547d9){logger[_0x501b('0x14')](_0x501b('0xe'),_0x493687,_0x5547d9);_0x15c4f4(_0x5547d9);});});} \ No newline at end of file +var _0x928c=['catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1fe8f7,_0x3bcca1){var _0x5bf977=function(_0x5d66fc){while(--_0x5d66fc){_0x1fe8f7['push'](_0x1fe8f7['shift']());}};_0x5bf977(++_0x3bcca1);}(_0x928c,0x157));var _0xc928=function(_0x4998f7,_0x4c0a5f){_0x4998f7=_0x4998f7-0x0;var _0xdd9537=_0x928c[_0x4998f7];return _0xdd9537;};'use strict';var _=require(_0xc928('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc928('0x1'));var rs=require(_0xc928('0x2'));var fs=require('fs');var Redis=require(_0xc928('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc928('0x4'));var logger=require('../../config/logger')(_0xc928('0x5'));var config=require('../../config/environment');var jayson=require(_0xc928('0x6'));var client=jayson[_0xc928('0x7')][_0xc928('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c61c1,_0x41f542,_0x111004){return new BPromise(function(_0x19ec0a,_0x37a526){return client[_0xc928('0x9')](_0x3c61c1,_0x111004)['then'](function(_0x470b11){logger[_0xc928('0xa')](_0xc928('0xb'),_0x41f542,_0xc928('0xc'));logger[_0xc928('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x41f542,_0xc928('0xc'),JSON[_0xc928('0xe')](_0x470b11));if(_0x470b11[_0xc928('0xf')]){if(_0x470b11['error'][_0xc928('0x10')]===0x1f4){logger[_0xc928('0xf')](_0xc928('0xb'),_0x41f542,_0x470b11['error'][_0xc928('0x11')]);return _0x37a526(_0x470b11['error'][_0xc928('0x11')]);}logger['error'](_0xc928('0xb'),_0x41f542,_0x470b11['error'][_0xc928('0x11')]);return _0x19ec0a(_0x470b11[_0xc928('0xf')]['message']);}else{logger[_0xc928('0xa')](_0xc928('0xb'),_0x41f542,'request\x20sent');_0x19ec0a(_0x470b11['result']['message']);}})[_0xc928('0x12')](function(_0x1e0f0e){logger['error'](_0xc928('0xb'),_0x41f542,_0x1e0f0e);_0x37a526(_0x1e0f0e);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 60a8d98..c41df6d 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 _0x757c=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4af23f,_0x1264dc){var _0x25abf9=function(_0x1a4191){while(--_0x1a4191){_0x4af23f['push'](_0x4af23f['shift']());}};_0x25abf9(++_0x1264dc);}(_0x757c,0x191));var _0xc757=function(_0x41037a,_0x5ecc61){_0x41037a=_0x41037a-0x0;var _0x5a5ada=_0x757c[_0x41037a];return _0x5a5ada;};'use strict';var multer=require(_0xc757('0x0'));var util=require(_0xc757('0x1'));var path=require('path');var timeout=require(_0xc757('0x2'));var express=require(_0xc757('0x3'));var router=express[_0xc757('0x4')]();var fs_extra=require(_0xc757('0x5'));var auth=require(_0xc757('0x6'));var interaction=require(_0xc757('0x7'));var config=require(_0xc757('0x8'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0xc757('0x9')](),controller['index']);router[_0xc757('0xa')](_0xc757('0xb'),auth[_0xc757('0x9')](),controller[_0xc757('0xc')]);router[_0xc757('0xd')]('/',auth[_0xc757('0x9')](),controller[_0xc757('0xe')]);router['put']('/:id',auth[_0xc757('0x9')](),controller['update']);router[_0xc757('0xf')]('/:id',auth[_0xc757('0x9')](),controller['destroy']);module[_0xc757('0x10')]=router; \ No newline at end of file +var _0x1669=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','post','update','delete','destroy','multer','util','path','Router'];(function(_0x3d599f,_0x4fca99){var _0x46590e=function(_0x549c1f){while(--_0x549c1f){_0x3d599f['push'](_0x3d599f['shift']());}};_0x46590e(++_0x4fca99);}(_0x1669,0x1e9));var _0x9166=function(_0x47019f,_0x1c1cac){_0x47019f=_0x47019f-0x0;var _0x2e53c8=_0x1669[_0x47019f];return _0x2e53c8;};'use strict';var multer=require(_0x9166('0x0'));var util=require(_0x9166('0x1'));var path=require(_0x9166('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9166('0x3')]();var fs_extra=require(_0x9166('0x4'));var auth=require(_0x9166('0x5'));var interaction=require(_0x9166('0x6'));var config=require(_0x9166('0x7'));var controller=require(_0x9166('0x8'));router[_0x9166('0x9')]('/',auth['isAuthenticated'](),controller[_0x9166('0xa')]);router['get'](_0x9166('0xb'),auth[_0x9166('0xc')](),controller['show']);router[_0x9166('0xd')]('/',auth[_0x9166('0xc')](),controller['create']);router['put'](_0x9166('0xb'),auth[_0x9166('0xc')](),controller[_0x9166('0xe')]);router[_0x9166('0xf')]('/:id',auth[_0x9166('0xc')](),controller[_0x9166('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e4f84c8..a3b46a8 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 _0x88a1=['exports','ENUM','string','customVariable','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0x88a1,0x128));var _0x188a=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0x88a1[_0x27ddf5];return _0x26e74a;};'use strict';var Sequelize=require(_0x188a('0x0'));module[_0x188a('0x1')]={'type':{'type':Sequelize[_0x188a('0x2')](_0x188a('0x3'),'variable',_0x188a('0x4'),'keyValue',_0x188a('0x5')),'defaultValue':_0x188a('0x3')},'content':{'type':Sequelize[_0x188a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x188a('0x2')](_0x188a('0x3'),_0x188a('0x7'),_0x188a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x188a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x188a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x188a('0x6')]}}; \ No newline at end of file +var _0x4ded=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x2ed176,_0x1d3e64){var _0x10f61a=function(_0x5339a5){while(--_0x5339a5){_0x2ed176['push'](_0x2ed176['shift']());}};_0x10f61a(++_0x1d3e64);}(_0x4ded,0x1c0));var _0xd4de=function(_0x11f897,_0x1096cf){_0x11f897=_0x11f897-0x0;var _0x5cd165=_0x4ded[_0x11f897];return _0x5cd165;};'use strict';var Sequelize=require(_0xd4de('0x0'));module[_0xd4de('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd4de('0x2'),_0xd4de('0x3'),_0xd4de('0x4'),_0xd4de('0x5'),_0xd4de('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd4de('0x7')]},'key':{'type':Sequelize[_0xd4de('0x7')]},'keyType':{'type':Sequelize[_0xd4de('0x8')](_0xd4de('0x2'),_0xd4de('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd4de('0x7')]},'idField':{'type':Sequelize[_0xd4de('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd4de('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd4de('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3f87837..3c6b10e 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 _0x7ebb=['destroy','error','stack','name','send','index','DeskField','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then'];(function(_0x3f8611,_0x2eafe9){var _0x57d20e=function(_0x22654b){while(--_0x22654b){_0x3f8611['push'](_0x3f8611['shift']());}};_0x57d20e(++_0x2eafe9);}(_0x7ebb,0x161));var _0xb7eb=function(_0x23fd09,_0x51c74c){_0x23fd09=_0x23fd09-0x0;var _0x5d8176=_0x7ebb[_0x23fd09];return _0x5d8176;};'use strict';var emlformat=require(_0xb7eb('0x0'));var rimraf=require(_0xb7eb('0x1'));var zipdir=require(_0xb7eb('0x2'));var jsonpatch=require(_0xb7eb('0x3'));var rp=require(_0xb7eb('0x4'));var moment=require(_0xb7eb('0x5'));var BPromise=require(_0xb7eb('0x6'));var Mustache=require('mustache');var util=require(_0xb7eb('0x7'));var path=require(_0xb7eb('0x8'));var sox=require(_0xb7eb('0x9'));var csv=require(_0xb7eb('0xa'));var ejs=require(_0xb7eb('0xb'));var fs=require('fs');var fs_extra=require(_0xb7eb('0xc'));var _=require(_0xb7eb('0xd'));var squel=require(_0xb7eb('0xe'));var crypto=require(_0xb7eb('0xf'));var jsforce=require(_0xb7eb('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7eb('0x11'));var Papa=require(_0xb7eb('0x12'));var Redis=require(_0xb7eb('0x13'));var authService=require(_0xb7eb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb7eb('0x15'));var hardwareService=require(_0xb7eb('0x16'));var logger=require('../../config/logger')(_0xb7eb('0x17'));var utils=require(_0xb7eb('0x18'));var config=require(_0xb7eb('0x19'));var licenseUtil=require(_0xb7eb('0x1a'));var db=require(_0xb7eb('0x1b'))['db'];function respondWithStatusCode(_0x24e51b,_0x3cf3ca){_0x3cf3ca=_0x3cf3ca||0xcc;return function(_0x5932b9){if(_0x5932b9){return _0x24e51b[_0xb7eb('0x1c')](_0x3cf3ca);}return _0x24e51b[_0xb7eb('0x1d')](_0x3cf3ca)[_0xb7eb('0x1e')]();};}function respondWithResult(_0x5e50f0,_0x3b2af5){_0x3b2af5=_0x3b2af5||0xc8;return function(_0xbd0a5a){if(_0xbd0a5a){return _0x5e50f0[_0xb7eb('0x1d')](_0x3b2af5)[_0xb7eb('0x1f')](_0xbd0a5a);}};}function respondWithFilteredResult(_0x560f8f,_0x348cc5){return function(_0x55c850){if(_0x55c850){var _0x4977b5=typeof _0x348cc5[_0xb7eb('0x20')]===_0xb7eb('0x21')&&typeof _0x348cc5['limit']===_0xb7eb('0x21');var _0x2186ae=_0x55c850[_0xb7eb('0x22')];var _0x1c0294=_0x4977b5?0x0:_0x348cc5['offset'];var _0x36fc4d=_0x4977b5?_0x55c850['count']:_0x348cc5[_0xb7eb('0x20')]+_0x348cc5[_0xb7eb('0x23')];var _0x4b74f3;if(_0x36fc4d>=_0x2186ae){_0x36fc4d=_0x2186ae;_0x4b74f3=0xc8;}else{_0x4b74f3=0xce;}_0x560f8f[_0xb7eb('0x1d')](_0x4b74f3);return _0x560f8f['set'](_0xb7eb('0x24'),_0x1c0294+'-'+_0x36fc4d+'/'+_0x2186ae)[_0xb7eb('0x1f')](_0x55c850);}return null;};}function patchUpdates(_0x1b6036){return function(_0x24657e){try{jsonpatch[_0xb7eb('0x25')](_0x24657e,_0x1b6036,!![]);}catch(_0x36beb6){return BPromise[_0xb7eb('0x26')](_0x36beb6);}return _0x24657e[_0xb7eb('0x27')]();};}function saveUpdates(_0x874ba5,_0x4c5cc8){return function(_0x53071f){if(_0x53071f){return _0x53071f[_0xb7eb('0x28')](_0x874ba5)[_0xb7eb('0x29')](function(_0x3ad448){return _0x3ad448;});}return null;};}function removeEntity(_0x29e197,_0x68c3d0){return function(_0x5bdadf){if(_0x5bdadf){return _0x5bdadf[_0xb7eb('0x2a')]()[_0xb7eb('0x29')](function(){_0x29e197[_0xb7eb('0x1d')](0xcc)[_0xb7eb('0x1e')]();});}};}function handleEntityNotFound(_0x48e4d7,_0x202b4d){return function(_0x48dabb){if(!_0x48dabb){_0x48e4d7[_0xb7eb('0x1c')](0x194);}return _0x48dabb;};}function handleError(_0x1b7617,_0xbba0bb){_0xbba0bb=_0xbba0bb||0x1f4;return function(_0x56a5d7){logger[_0xb7eb('0x2b')](_0x56a5d7[_0xb7eb('0x2c')]);if(_0x56a5d7[_0xb7eb('0x2d')]){delete _0x56a5d7[_0xb7eb('0x2d')];}_0x1b7617[_0xb7eb('0x1d')](_0xbba0bb)[_0xb7eb('0x2e')](_0x56a5d7);};}exports[_0xb7eb('0x2f')]=function(_0x23aee6,_0x841096){var _0x156e2b={},_0xc68143={},_0x3d75ed={'count':0x0,'rows':[]};var _0x2d19bf=_['map'](db[_0xb7eb('0x30')]['rawAttributes'],function(_0x20f0c0){return{'name':_0x20f0c0['fieldName'],'type':_0x20f0c0[_0xb7eb('0x31')][_0xb7eb('0x32')]};});_0xc68143['model']=_[_0xb7eb('0x33')](_0x2d19bf,_0xb7eb('0x2d'));_0xc68143[_0xb7eb('0x34')]=_['keys'](_0x23aee6[_0xb7eb('0x34')]);_0xc68143[_0xb7eb('0x35')]=_[_0xb7eb('0x36')](_0xc68143[_0xb7eb('0x37')],_0xc68143[_0xb7eb('0x34')]);_0x156e2b[_0xb7eb('0x38')]=_['intersection'](_0xc68143[_0xb7eb('0x37')],qs[_0xb7eb('0x39')](_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x39')]));_0x156e2b['attributes']=_0x156e2b[_0xb7eb('0x38')][_0xb7eb('0x3a')]?_0x156e2b['attributes']:_0xc68143[_0xb7eb('0x37')];if(!_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x3b')]('nolimit')){_0x156e2b[_0xb7eb('0x23')]=qs['limit'](_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x23')]);_0x156e2b[_0xb7eb('0x20')]=qs[_0xb7eb('0x20')](_0x23aee6['query']['offset']);}_0x156e2b[_0xb7eb('0x3c')]=qs[_0xb7eb('0x3d')](_0x23aee6['query'][_0xb7eb('0x3d')]);_0x156e2b[_0xb7eb('0x3e')]=qs[_0xb7eb('0x35')](_[_0xb7eb('0x3f')](_0x23aee6[_0xb7eb('0x34')],_0xc68143[_0xb7eb('0x35')]),_0x2d19bf);if(_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x40')]){_0x156e2b['where']=_[_0xb7eb('0x41')](_0x156e2b['where'],{'$or':_[_0xb7eb('0x33')](_0x2d19bf,function(_0x33e229){if(_0x33e229[_0xb7eb('0x31')]!==_0xb7eb('0x42')){var _0x5a8ecf={};_0x5a8ecf[_0x33e229[_0xb7eb('0x2d')]]={'$like':'%'+_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x40')]+'%'};return _0x5a8ecf;}})});}_0x156e2b=_[_0xb7eb('0x41')]({},_0x156e2b,_0x23aee6[_0xb7eb('0x43')]);var _0x4add76={'where':_0x156e2b[_0xb7eb('0x3e')]};return db['DeskField'][_0xb7eb('0x22')](_0x4add76)[_0xb7eb('0x29')](function(_0x57e3e6){_0x3d75ed[_0xb7eb('0x22')]=_0x57e3e6;if(_0x23aee6[_0xb7eb('0x34')][_0xb7eb('0x44')]){_0x156e2b[_0xb7eb('0x45')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x156e2b);})['then'](function(_0x3ee221){_0x3d75ed[_0xb7eb('0x46')]=_0x3ee221;return _0x3d75ed;})[_0xb7eb('0x29')](respondWithFilteredResult(_0x841096,_0x156e2b))[_0xb7eb('0x47')](handleError(_0x841096,null));};exports[_0xb7eb('0x48')]=function(_0x5147e8,_0x4d65e5){var _0x381fc3={'raw':!![],'where':{'id':_0x5147e8[_0xb7eb('0x49')]['id']}},_0x5c3a07={};_0x5c3a07[_0xb7eb('0x37')]=_[_0xb7eb('0x4a')](db['DeskField'][_0xb7eb('0x4b')]);_0x5c3a07[_0xb7eb('0x34')]=_[_0xb7eb('0x4a')](_0x5147e8['query']);_0x5c3a07[_0xb7eb('0x35')]=_[_0xb7eb('0x36')](_0x5c3a07[_0xb7eb('0x37')],_0x5c3a07[_0xb7eb('0x34')]);_0x381fc3[_0xb7eb('0x38')]=_[_0xb7eb('0x36')](_0x5c3a07[_0xb7eb('0x37')],qs[_0xb7eb('0x39')](_0x5147e8[_0xb7eb('0x34')][_0xb7eb('0x39')]));_0x381fc3[_0xb7eb('0x38')]=_0x381fc3[_0xb7eb('0x38')][_0xb7eb('0x3a')]?_0x381fc3[_0xb7eb('0x38')]:_0x5c3a07[_0xb7eb('0x37')];if(_0x5147e8[_0xb7eb('0x34')][_0xb7eb('0x44')]){_0x381fc3[_0xb7eb('0x45')]=[{'all':!![]}];}_0x381fc3=_[_0xb7eb('0x41')]({},_0x381fc3,_0x5147e8['options']);return db[_0xb7eb('0x30')][_0xb7eb('0x4c')](_0x381fc3)[_0xb7eb('0x29')](handleEntityNotFound(_0x4d65e5,null))[_0xb7eb('0x29')](respondWithResult(_0x4d65e5,null))[_0xb7eb('0x47')](handleError(_0x4d65e5,null));};exports['create']=function(_0x9d509b,_0xa3c387){return db['DeskField'][_0xb7eb('0x4d')](_0x9d509b[_0xb7eb('0x4e')],{})['then'](respondWithResult(_0xa3c387,0xc9))['catch'](handleError(_0xa3c387,null));};exports[_0xb7eb('0x28')]=function(_0x13741b,_0x2f20d3){if(_0x13741b[_0xb7eb('0x4e')]['id']){delete _0x13741b[_0xb7eb('0x4e')]['id'];}return db[_0xb7eb('0x30')][_0xb7eb('0x4c')]({'where':{'id':_0x13741b['params']['id']}})[_0xb7eb('0x29')](handleEntityNotFound(_0x2f20d3,null))[_0xb7eb('0x29')](saveUpdates(_0x13741b['body'],null))[_0xb7eb('0x29')](respondWithResult(_0x2f20d3,null))['catch'](handleError(_0x2f20d3,null));};exports['destroy']=function(_0x4bb9c2,_0x217dfd){return db[_0xb7eb('0x30')]['find']({'where':{'id':_0x4bb9c2['params']['id']}})[_0xb7eb('0x29')](handleEntityNotFound(_0x217dfd,null))[_0xb7eb('0x29')](removeEntity(_0x217dfd,null))[_0xb7eb('0x47')](handleError(_0x217dfd,null));}; \ No newline at end of file +var _0x9b2c=['query','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','model','keys'];(function(_0x3923f7,_0x4a83b3){var _0x5b9a9d=function(_0x2a2e97){while(--_0x2a2e97){_0x3923f7['push'](_0x3923f7['shift']());}};_0x5b9a9d(++_0x4a83b3);}(_0x9b2c,0x189));var _0xc9b2=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x9b2c[_0x33c1b1];return _0x2c2037;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9b2('0x0'));var zipdir=require(_0xc9b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9b2('0x2'));var moment=require('moment');var BPromise=require(_0xc9b2('0x3'));var Mustache=require('mustache');var util=require(_0xc9b2('0x4'));var path=require(_0xc9b2('0x5'));var sox=require(_0xc9b2('0x6'));var csv=require(_0xc9b2('0x7'));var ejs=require(_0xc9b2('0x8'));var fs=require('fs');var fs_extra=require(_0xc9b2('0x9'));var _=require(_0xc9b2('0xa'));var squel=require(_0xc9b2('0xb'));var crypto=require(_0xc9b2('0xc'));var jsforce=require(_0xc9b2('0xd'));var deskjs=require(_0xc9b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9b2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc9b2('0x10'));var qs=require(_0xc9b2('0x11'));var as=require(_0xc9b2('0x12'));var hardwareService=require(_0xc9b2('0x13'));var logger=require(_0xc9b2('0x14'))(_0xc9b2('0x15'));var utils=require(_0xc9b2('0x16'));var config=require(_0xc9b2('0x17'));var licenseUtil=require(_0xc9b2('0x18'));var db=require(_0xc9b2('0x19'))['db'];function respondWithStatusCode(_0x1cddb4,_0x3c4a7e){_0x3c4a7e=_0x3c4a7e||0xcc;return function(_0x5a1297){if(_0x5a1297){return _0x1cddb4[_0xc9b2('0x1a')](_0x3c4a7e);}return _0x1cddb4[_0xc9b2('0x1b')](_0x3c4a7e)[_0xc9b2('0x1c')]();};}function respondWithResult(_0x203739,_0x58a94f){_0x58a94f=_0x58a94f||0xc8;return function(_0x11b076){if(_0x11b076){return _0x203739[_0xc9b2('0x1b')](_0x58a94f)[_0xc9b2('0x1d')](_0x11b076);}};}function respondWithFilteredResult(_0x3a000e,_0xe8c3d8){return function(_0xc37dd){if(_0xc37dd){var _0x302c1a=typeof _0xe8c3d8[_0xc9b2('0x1e')]==='undefined'&&typeof _0xe8c3d8[_0xc9b2('0x1f')]===_0xc9b2('0x20');var _0xe224aa=_0xc37dd[_0xc9b2('0x21')];var _0x49d95a=_0x302c1a?0x0:_0xe8c3d8[_0xc9b2('0x1e')];var _0xde5092=_0x302c1a?_0xc37dd[_0xc9b2('0x21')]:_0xe8c3d8[_0xc9b2('0x1e')]+_0xe8c3d8[_0xc9b2('0x1f')];var _0x43fb7a;if(_0xde5092>=_0xe224aa){_0xde5092=_0xe224aa;_0x43fb7a=0xc8;}else{_0x43fb7a=0xce;}_0x3a000e[_0xc9b2('0x1b')](_0x43fb7a);return _0x3a000e['set'](_0xc9b2('0x22'),_0x49d95a+'-'+_0xde5092+'/'+_0xe224aa)['json'](_0xc37dd);}return null;};}function patchUpdates(_0x13739a){return function(_0x3d3a5c){try{jsonpatch['apply'](_0x3d3a5c,_0x13739a,!![]);}catch(_0x18237a){return BPromise[_0xc9b2('0x23')](_0x18237a);}return _0x3d3a5c['save']();};}function saveUpdates(_0x2842be,_0x4cc1b9){return function(_0x127fef){if(_0x127fef){return _0x127fef[_0xc9b2('0x24')](_0x2842be)[_0xc9b2('0x25')](function(_0x13006d){return _0x13006d;});}return null;};}function removeEntity(_0x20875a,_0x16e0e6){return function(_0x128ec5){if(_0x128ec5){return _0x128ec5[_0xc9b2('0x26')]()[_0xc9b2('0x25')](function(){_0x20875a[_0xc9b2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15dc60,_0xbb3bf9){return function(_0x444181){if(!_0x444181){_0x15dc60[_0xc9b2('0x1a')](0x194);}return _0x444181;};}function handleError(_0x5a2c79,_0x349943){_0x349943=_0x349943||0x1f4;return function(_0x5bdfe8){logger[_0xc9b2('0x27')](_0x5bdfe8[_0xc9b2('0x28')]);if(_0x5bdfe8[_0xc9b2('0x29')]){delete _0x5bdfe8[_0xc9b2('0x29')];}_0x5a2c79[_0xc9b2('0x1b')](_0x349943)[_0xc9b2('0x2a')](_0x5bdfe8);};}exports[_0xc9b2('0x2b')]=function(_0x3d735a,_0x46ab9b){var _0x37f4f0={},_0x16936f={},_0x2ab823={'count':0x0,'rows':[]};var _0x3de1f9=_[_0xc9b2('0x2c')](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')],function(_0x5d7748){return{'name':_0x5d7748['fieldName'],'type':_0x5d7748[_0xc9b2('0x2f')][_0xc9b2('0x30')]};});_0x16936f[_0xc9b2('0x31')]=_['map'](_0x3de1f9,_0xc9b2('0x29'));_0x16936f['query']=_[_0xc9b2('0x32')](_0x3d735a[_0xc9b2('0x33')]);_0x16936f[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x16936f[_0xc9b2('0x31')],_0x16936f[_0xc9b2('0x33')]);_0x37f4f0[_0xc9b2('0x36')]=_[_0xc9b2('0x35')](_0x16936f['model'],qs[_0xc9b2('0x37')](_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x37f4f0[_0xc9b2('0x36')]=_0x37f4f0['attributes']['length']?_0x37f4f0[_0xc9b2('0x36')]:_0x16936f[_0xc9b2('0x31')];if(!_0x3d735a['query']['hasOwnProperty'](_0xc9b2('0x38'))){_0x37f4f0['limit']=qs[_0xc9b2('0x1f')](_0x3d735a[_0xc9b2('0x33')]['limit']);_0x37f4f0[_0xc9b2('0x1e')]=qs[_0xc9b2('0x1e')](_0x3d735a[_0xc9b2('0x33')]['offset']);}_0x37f4f0[_0xc9b2('0x39')]=qs[_0xc9b2('0x3a')](_0x3d735a[_0xc9b2('0x33')]['sort']);_0x37f4f0['where']=qs[_0xc9b2('0x34')](_['pick'](_0x3d735a[_0xc9b2('0x33')],_0x16936f[_0xc9b2('0x34')]),_0x3de1f9);if(_0x3d735a['query'][_0xc9b2('0x3b')]){_0x37f4f0[_0xc9b2('0x3c')]=_[_0xc9b2('0x3d')](_0x37f4f0['where'],{'$or':_[_0xc9b2('0x2c')](_0x3de1f9,function(_0x1ef6f3){if(_0x1ef6f3[_0xc9b2('0x2f')]!==_0xc9b2('0x3e')){var _0x3f31ae={};_0x3f31ae[_0x1ef6f3['name']]={'$like':'%'+_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x3b')]+'%'};return _0x3f31ae;}})});}_0x37f4f0=_[_0xc9b2('0x3d')]({},_0x37f4f0,_0x3d735a[_0xc9b2('0x3f')]);var _0x97b664={'where':_0x37f4f0[_0xc9b2('0x3c')]};return db[_0xc9b2('0x2d')][_0xc9b2('0x21')](_0x97b664)[_0xc9b2('0x25')](function(_0x26893c){_0x2ab823[_0xc9b2('0x21')]=_0x26893c;if(_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x37f4f0[_0xc9b2('0x41')]=[{'all':!![]}];}return db['DeskField'][_0xc9b2('0x42')](_0x37f4f0);})[_0xc9b2('0x25')](function(_0x304fa1){_0x2ab823[_0xc9b2('0x43')]=_0x304fa1;return _0x2ab823;})['then'](respondWithFilteredResult(_0x46ab9b,_0x37f4f0))[_0xc9b2('0x44')](handleError(_0x46ab9b,null));};exports[_0xc9b2('0x45')]=function(_0x53b549,_0x21dd63){var _0x3b93cb={'raw':!![],'where':{'id':_0x53b549[_0xc9b2('0x46')]['id']}},_0x5add26={};_0x5add26['model']=_['keys'](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')]);_0x5add26[_0xc9b2('0x33')]=_[_0xc9b2('0x32')](_0x53b549[_0xc9b2('0x33')]);_0x5add26[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],_0x5add26[_0xc9b2('0x33')]);_0x3b93cb['attributes']=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],qs[_0xc9b2('0x37')](_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x3b93cb[_0xc9b2('0x36')]=_0x3b93cb[_0xc9b2('0x36')]['length']?_0x3b93cb[_0xc9b2('0x36')]:_0x5add26['model'];if(_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x3b93cb['include']=[{'all':!![]}];}_0x3b93cb=_[_0xc9b2('0x3d')]({},_0x3b93cb,_0x53b549['options']);return db[_0xc9b2('0x2d')][_0xc9b2('0x47')](_0x3b93cb)['then'](handleEntityNotFound(_0x21dd63,null))[_0xc9b2('0x25')](respondWithResult(_0x21dd63,null))['catch'](handleError(_0x21dd63,null));};exports[_0xc9b2('0x48')]=function(_0x351ef6,_0x5413bd){return db[_0xc9b2('0x2d')][_0xc9b2('0x48')](_0x351ef6[_0xc9b2('0x49')],{})[_0xc9b2('0x25')](respondWithResult(_0x5413bd,0xc9))[_0xc9b2('0x44')](handleError(_0x5413bd,null));};exports[_0xc9b2('0x24')]=function(_0x245293,_0x544445){if(_0x245293['body']['id']){delete _0x245293[_0xc9b2('0x49')]['id'];}return db[_0xc9b2('0x2d')]['find']({'where':{'id':_0x245293[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x544445,null))[_0xc9b2('0x25')](saveUpdates(_0x245293[_0xc9b2('0x49')],null))['then'](respondWithResult(_0x544445,null))[_0xc9b2('0x44')](handleError(_0x544445,null));};exports[_0xc9b2('0x26')]=function(_0x456ea4,_0x3f6083){return db['DeskField']['find']({'where':{'id':_0x456ea4[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x3f6083,null))[_0xc9b2('0x25')](removeEntity(_0x3f6083,null))['catch'](handleError(_0x3f6083,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index ad177ef..fbee0fe 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 _0xb84b=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index'];(function(_0x5098d3,_0x245091){var _0x285389=function(_0x2a32c9){while(--_0x2a32c9){_0x5098d3['push'](_0x5098d3['shift']());}};_0x285389(++_0x245091);}(_0xb84b,0xd1));var _0xbb84=function(_0x28774d,_0x3c80b1){_0x28774d=_0x28774d-0x0;var _0x5b2b97=_0xb84b[_0x28774d];return _0x5b2b97;};'use strict';var _=require(_0xbb84('0x0'));var util=require(_0xbb84('0x1'));var logger=require(_0xbb84('0x2'))(_0xbb84('0x3'));var moment=require(_0xbb84('0x4'));var BPromise=require(_0xbb84('0x5'));var rp=require(_0xbb84('0x6'));var fs=require('fs');var path=require(_0xbb84('0x7'));var rimraf=require(_0xbb84('0x8'));var config=require(_0xbb84('0x9'));var attributes=require(_0xbb84('0xa'));module[_0xbb84('0xb')]=function(_0x3afe18,_0x57bbeb){return _0x3afe18[_0xbb84('0xc')](_0xbb84('0xd'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xbb84('0xe'),'fields':['idField',_0xbb84('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x65ef=['define','DeskField','int_desk_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports'];(function(_0x1eac5b,_0x44cdc5){var _0x40b4d6=function(_0x1f4564){while(--_0x1f4564){_0x1eac5b['push'](_0x1eac5b['shift']());}};_0x40b4d6(++_0x44cdc5);}(_0x65ef,0xad));var _0xf65e=function(_0x23f002,_0x554b33){_0x23f002=_0x23f002-0x0;var _0x43fb2a=_0x65ef[_0x23f002];return _0x43fb2a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf65e('0x0'))(_0xf65e('0x1'));var moment=require(_0xf65e('0x2'));var BPromise=require(_0xf65e('0x3'));var rp=require(_0xf65e('0x4'));var fs=require('fs');var path=require(_0xf65e('0x5'));var rimraf=require(_0xf65e('0x6'));var config=require('../../config/environment');var attributes=require(_0xf65e('0x7'));module[_0xf65e('0x8')]=function(_0x2fc9e3,_0x3349ec){return _0x2fc9e3[_0xf65e('0x9')](_0xf65e('0xa'),attributes,{'tableName':_0xf65e('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xf65e('0xc'),_0xf65e('0xd')],'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 9584833..3e8367f 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 _0xb79f=['../../config/environment','jayson/promise','client','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xb79f,0x139));var _0xfb79=function(_0x1ed010,_0x734e0b){_0x1ed010=_0x1ed010-0x0;var _0x6e22bf=_0xb79f[_0x1ed010];return _0x6e22bf;};'use strict';var _=require(_0xfb79('0x0'));var util=require(_0xfb79('0x1'));var moment=require(_0xfb79('0x2'));var BPromise=require(_0xfb79('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb79('0x4'))['db'];var utils=require(_0xfb79('0x5'));var logger=require('../../config/logger')(_0xfb79('0x6'));var config=require(_0xfb79('0x7'));var jayson=require(_0xfb79('0x8'));var client=jayson[_0xfb79('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e496c,_0x432ec7,_0x19211a){return new BPromise(function(_0x30d006,_0x3f345a){return client['request'](_0x4e496c,_0x19211a)[_0xfb79('0xa')](function(_0x3b19df){logger['info'](_0xfb79('0xb'),_0x432ec7,_0xfb79('0xc'));logger[_0xfb79('0xd')](_0xfb79('0xe'),_0x432ec7,_0xfb79('0xc'),JSON['stringify'](_0x3b19df));if(_0x3b19df[_0xfb79('0xf')]){if(_0x3b19df['error'][_0xfb79('0x10')]===0x1f4){logger[_0xfb79('0xf')](_0xfb79('0xb'),_0x432ec7,_0x3b19df[_0xfb79('0xf')]['message']);return _0x3f345a(_0x3b19df[_0xfb79('0xf')]['message']);}logger[_0xfb79('0xf')](_0xfb79('0xb'),_0x432ec7,_0x3b19df[_0xfb79('0xf')][_0xfb79('0x11')]);return _0x30d006(_0x3b19df[_0xfb79('0xf')][_0xfb79('0x11')]);}else{logger[_0xfb79('0x12')](_0xfb79('0xb'),_0x432ec7,_0xfb79('0xc'));_0x30d006(_0x3b19df['result'][_0xfb79('0x11')]);}})[_0xfb79('0x13')](function(_0x2f949d){logger[_0xfb79('0xf')](_0xfb79('0xb'),_0x432ec7,_0x2f949d);_0x3f345a(_0x2f949d);});});} \ No newline at end of file +var _0x0456=['code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','debug','stringify','error'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x0456,0x1d3));var _0x6045=function(_0x347434,_0x40b4b2){_0x347434=_0x347434-0x0;var _0x36ab3d=_0x0456[_0x347434];return _0x36ab3d;};'use strict';var _=require(_0x6045('0x0'));var util=require(_0x6045('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6045('0x2'));var fs=require('fs');var Redis=require(_0x6045('0x3'));var db=require(_0x6045('0x4'))['db'];var utils=require(_0x6045('0x5'));var logger=require(_0x6045('0x6'))('rpc');var config=require(_0x6045('0x7'));var jayson=require(_0x6045('0x8'));var client=jayson[_0x6045('0x9')][_0x6045('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48e8ab,_0x52c550,_0x5e3eee){return new BPromise(function(_0x4d49ea,_0x2dffc3){return client[_0x6045('0xb')](_0x48e8ab,_0x5e3eee)['then'](function(_0x54a8ca){logger[_0x6045('0xc')](_0x6045('0xd'),_0x52c550,'request\x20sent');logger[_0x6045('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x52c550,'request\x20sent',JSON[_0x6045('0xf')](_0x54a8ca));if(_0x54a8ca['error']){if(_0x54a8ca[_0x6045('0x10')][_0x6045('0x11')]===0x1f4){logger[_0x6045('0x10')](_0x6045('0xd'),_0x52c550,_0x54a8ca[_0x6045('0x10')][_0x6045('0x12')]);return _0x2dffc3(_0x54a8ca[_0x6045('0x10')][_0x6045('0x12')]);}logger[_0x6045('0x10')](_0x6045('0xd'),_0x52c550,_0x54a8ca[_0x6045('0x10')][_0x6045('0x12')]);return _0x4d49ea(_0x54a8ca[_0x6045('0x10')]['message']);}else{logger[_0x6045('0xc')](_0x6045('0xd'),_0x52c550,_0x6045('0x13'));_0x4d49ea(_0x54a8ca[_0x6045('0x14')]['message']);}})[_0x6045('0x15')](function(_0x3b86dc){logger[_0x6045('0x10')]('DeskField,\x20%s,\x20%s',_0x52c550,_0x3b86dc);_0x2dffc3(_0x3b86dc);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 694efdf..3367fa6 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 _0xd95c=['post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','getFields'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xd95c,0x1b8));var _0xcd95=function(_0x4ffd4b,_0x55e800){_0x4ffd4b=_0x4ffd4b-0x0;var _0x44db0a=_0xd95c[_0x4ffd4b];return _0x44db0a;};'use strict';var multer=require(_0xcd95('0x0'));var util=require('util');var path=require(_0xcd95('0x1'));var timeout=require(_0xcd95('0x2'));var express=require(_0xcd95('0x3'));var router=express['Router']();var fs_extra=require(_0xcd95('0x4'));var auth=require(_0xcd95('0x5'));var interaction=require(_0xcd95('0x6'));var config=require(_0xcd95('0x7'));var controller=require(_0xcd95('0x8'));router[_0xcd95('0x9')]('/',auth['isAuthenticated'](),controller[_0xcd95('0xa')]);router['get']('/:id',auth[_0xcd95('0xb')](),controller[_0xcd95('0xc')]);router['get'](_0xcd95('0xd'),auth['isAuthenticated'](),controller[_0xcd95('0xe')]);router[_0xcd95('0x9')]('/:id/fields',auth[_0xcd95('0xb')](),controller[_0xcd95('0xf')]);router[_0xcd95('0x10')]('/',auth[_0xcd95('0xb')](),controller['create']);router['post'](_0xcd95('0xd'),auth[_0xcd95('0xb')](),controller[_0xcd95('0x11')]);router[_0xcd95('0x12')](_0xcd95('0x13'),auth[_0xcd95('0xb')](),controller[_0xcd95('0x14')]);router[_0xcd95('0x15')](_0xcd95('0x13'),auth[_0xcd95('0xb')](),controller[_0xcd95('0x16')]);module[_0xcd95('0x17')]=router; \ No newline at end of file +var _0xabb2=['index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0xabb2,0x1f0));var _0x2abb=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0xabb2[_0x3a3758];return _0x1a9234;};'use strict';var multer=require(_0x2abb('0x0'));var util=require(_0x2abb('0x1'));var path=require(_0x2abb('0x2'));var timeout=require(_0x2abb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2abb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2abb('0x5'));var config=require(_0x2abb('0x6'));var controller=require(_0x2abb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2abb('0x8')]);router[_0x2abb('0x9')](_0x2abb('0xa'),auth[_0x2abb('0xb')](),controller['show']);router['get'](_0x2abb('0xc'),auth[_0x2abb('0xb')](),controller[_0x2abb('0xd')]);router[_0x2abb('0x9')](_0x2abb('0xe'),auth[_0x2abb('0xb')](),controller[_0x2abb('0xf')]);router[_0x2abb('0x10')]('/',auth[_0x2abb('0xb')](),controller[_0x2abb('0x11')]);router['post']('/:id/configurations',auth[_0x2abb('0xb')](),controller['addConfiguration']);router[_0x2abb('0x12')](_0x2abb('0xa'),auth[_0x2abb('0xb')](),controller['update']);router[_0x2abb('0x13')]('/:id',auth[_0x2abb('0xb')](),controller[_0x2abb('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 0820355..739dbf4 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 _0x13fe=['sequelize','exports','STRING','BOOLEAN'];(function(_0x311f41,_0x461b71){var _0x6d9c2d=function(_0x34f48d){while(--_0x34f48d){_0x311f41['push'](_0x311f41['shift']());}};_0x6d9c2d(++_0x461b71);}(_0x13fe,0x138));var _0xe13f=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x13fe[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xe13f('0x0'));module[_0xe13f('0x1')]={'name':{'type':Sequelize[_0xe13f('0x2')]},'username':{'type':Sequelize[_0xe13f('0x2')]},'password':{'type':Sequelize[_0xe13f('0x2')]},'remoteUri':{'type':Sequelize[_0xe13f('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe13f('0x2')]},'clientSecret':{'type':Sequelize[_0xe13f('0x2')]},'serverUrl':{'type':Sequelize[_0xe13f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe13f('0x2')]},'modernAuthentication':{'type':Sequelize[_0xe13f('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xef17=['STRING','sequelize','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xef17,0x136));var _0x7ef1=function(_0x4805b9,_0xd82cc1){_0x4805b9=_0x4805b9-0x0;var _0x384f0f=_0xef17[_0x4805b9];return _0x384f0f;};'use strict';var Sequelize=require(_0x7ef1('0x0'));module[_0x7ef1('0x1')]={'name':{'type':Sequelize[_0x7ef1('0x2')]},'username':{'type':Sequelize[_0x7ef1('0x2')]},'password':{'type':Sequelize[_0x7ef1('0x2')]},'remoteUri':{'type':Sequelize[_0x7ef1('0x2')]},'tenantId':{'type':Sequelize[_0x7ef1('0x2')]},'clientId':{'type':Sequelize[_0x7ef1('0x2')]},'clientSecret':{'type':Sequelize[_0x7ef1('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7ef1('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c9d5803..7c864ad 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 _0x5eb3=['DecimalAttributeMetadata','concat','statusCode','error','stack','test','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','LogicalName','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','sendStatus','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','findAll','catch','show','include','merge','find','create','body','params','getConfigurations','Dynamics365Configuration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','format','getFields','ticketType','PhoneCall','title','description','customerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','findOne','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','data5','access_token','CloudProvider','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(','Attributes','remove','includes','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata'];(function(_0x249940,_0x37bfbe){var _0x526e43=function(_0x2e6815){while(--_0x2e6815){_0x249940['push'](_0x249940['shift']());}};_0x526e43(++_0x37bfbe);}(_0x5eb3,0xd0));var _0x35eb=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x5eb3[_0x2b9b7f];return _0x4ed19a;};'use strict';var rp=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var _=require(_0x35eb('0x2'));var qs=require(_0x35eb('0x3'));var logger=require(_0x35eb('0x4'))(_0x35eb('0x5'));var db=require(_0x35eb('0x6'))['db'];var integrations=require(_0x35eb('0x7'));function respondWithResult(_0x54ec1a,_0x252036){_0x252036=_0x252036||0xc8;return function(_0x204392){if(_0x204392){return _0x54ec1a[_0x35eb('0x8')](_0x252036)[_0x35eb('0x9')](_0x204392);}};}function respondWithFilteredResult(_0x2a8d75,_0x45a283){return function(_0x22aff6){if(_0x22aff6){var _0x231395=typeof _0x45a283['offset']===_0x35eb('0xa')&&typeof _0x45a283[_0x35eb('0xb')]===_0x35eb('0xa');var _0x8594e4=_0x22aff6[_0x35eb('0xc')];var _0x395e41=_0x231395?0x0:_0x45a283[_0x35eb('0xd')];var _0x11587f=_0x231395?_0x22aff6[_0x35eb('0xc')]:_0x45a283['offset']+_0x45a283[_0x35eb('0xb')];var _0x551907;if(_0x11587f>=_0x8594e4){_0x11587f=_0x8594e4;_0x551907=0xc8;}else{_0x551907=0xce;}_0x2a8d75['status'](_0x551907);return _0x2a8d75[_0x35eb('0xe')](_0x35eb('0xf'),_0x395e41+'-'+_0x11587f+'/'+_0x8594e4)[_0x35eb('0x9')](_0x22aff6);}return null;};}function saveUpdates(_0x11ea04){return function(_0x1622e6){if(_0x1622e6){return _0x1622e6[_0x35eb('0x10')](_0x11ea04)[_0x35eb('0x11')](function(_0xdd29af){return _0xdd29af;});}return null;};}function removeEntity(_0x296ca1){return function(_0x47abe1){if(_0x47abe1){return _0x47abe1[_0x35eb('0x12')]()[_0x35eb('0x11')](function(){_0x296ca1[_0x35eb('0x8')](0xcc)[_0x35eb('0x13')]();});}};}function handleEntityNotFound(_0x908026){return function(_0x5bcf59){if(!_0x5bcf59){_0x908026[_0x35eb('0x14')](0x194);}return _0x5bcf59;};}function handleError(_0x677a19,_0x555a8e){_0x555a8e=_0x555a8e||0x1f4;return function(_0x18d470){logger['error'](_0x18d470['stack']);if(_0x18d470[_0x35eb('0x15')]){delete _0x18d470[_0x35eb('0x15')];}_0x677a19[_0x35eb('0x8')](_0x555a8e)[_0x35eb('0x16')](_0x18d470);};}exports[_0x35eb('0x17')]=function(_0x1620ee,_0x4da14e){var _0xd3f360={},_0x10f1a9={},_0x312aa1={'count':0x0,'rows':[]};var _0x4bd537=_[_0x35eb('0x18')](db[_0x35eb('0x19')][_0x35eb('0x1a')],function(_0x777f54){return{'name':_0x777f54[_0x35eb('0x1b')],'type':_0x777f54[_0x35eb('0x1c')][_0x35eb('0x1d')]};});_0x10f1a9['model']=_[_0x35eb('0x18')](_0x4bd537,'name');_0x10f1a9[_0x35eb('0x1e')]=_[_0x35eb('0x1f')](_0x1620ee[_0x35eb('0x1e')]);_0x10f1a9['filters']=_['intersection'](_0x10f1a9[_0x35eb('0x20')],_0x10f1a9['query']);_0xd3f360['attributes']=_[_0x35eb('0x21')](_0x10f1a9[_0x35eb('0x20')],qs[_0x35eb('0x22')](_0x1620ee[_0x35eb('0x1e')][_0x35eb('0x22')]));_0xd3f360[_0x35eb('0x23')]=_0xd3f360[_0x35eb('0x23')][_0x35eb('0x24')]?_0xd3f360[_0x35eb('0x23')]:_0x10f1a9[_0x35eb('0x20')];if(!_0x1620ee[_0x35eb('0x1e')][_0x35eb('0x25')](_0x35eb('0x26'))){_0xd3f360[_0x35eb('0xb')]=qs[_0x35eb('0xb')](_0x1620ee[_0x35eb('0x1e')]['limit']);_0xd3f360[_0x35eb('0xd')]=qs[_0x35eb('0xd')](_0x1620ee[_0x35eb('0x1e')]['offset']);}_0xd3f360[_0x35eb('0x27')]=qs['sort'](_0x1620ee[_0x35eb('0x1e')][_0x35eb('0x28')]);_0xd3f360['where']=qs[_0x35eb('0x29')](_[_0x35eb('0x2a')](_0x1620ee['query'],_0x10f1a9[_0x35eb('0x29')]),_0x4bd537);if(_0x1620ee[_0x35eb('0x1e')][_0x35eb('0x2b')]){_0xd3f360[_0x35eb('0x2c')]=_['merge'](_0xd3f360[_0x35eb('0x2c')],{'$or':_[_0x35eb('0x18')](_0x4bd537,function(_0x4a91d4){if(_0x4a91d4['type']!==_0x35eb('0x2d')){var _0x54090c={};_0x54090c[_0x4a91d4[_0x35eb('0x15')]]={'$like':'%'+_0x1620ee[_0x35eb('0x1e')]['filter']+'%'};return _0x54090c;}})});}_0xd3f360=_['merge']({},_0xd3f360,_0x1620ee[_0x35eb('0x2e')]);var _0x652f45={'where':_0xd3f360[_0x35eb('0x2c')]};return db[_0x35eb('0x19')][_0x35eb('0xc')](_0x652f45)['then'](function(_0x283beb){_0x312aa1[_0x35eb('0xc')]=_0x283beb;if(_0x1620ee[_0x35eb('0x1e')][_0x35eb('0x2f')]){_0xd3f360['include']=[{'all':!![]}];}return db[_0x35eb('0x19')][_0x35eb('0x30')](_0xd3f360);})[_0x35eb('0x11')](function(_0x3ee53c){_0x312aa1['rows']=_0x3ee53c;return _0x312aa1;})[_0x35eb('0x11')](respondWithFilteredResult(_0x4da14e,_0xd3f360))[_0x35eb('0x31')](handleError(_0x4da14e,null));};exports[_0x35eb('0x32')]=function(_0x5dd6a3,_0x265bc7){var _0x9a4982={'raw':![],'where':{'id':_0x5dd6a3['params']['id']}},_0xb40b6b={};_0xb40b6b['model']=_[_0x35eb('0x1f')](db[_0x35eb('0x19')][_0x35eb('0x1a')]);_0xb40b6b[_0x35eb('0x1e')]=_['keys'](_0x5dd6a3[_0x35eb('0x1e')]);_0xb40b6b['filters']=_[_0x35eb('0x21')](_0xb40b6b[_0x35eb('0x20')],_0xb40b6b[_0x35eb('0x1e')]);_0x9a4982[_0x35eb('0x23')]=_['intersection'](_0xb40b6b[_0x35eb('0x20')],qs['fields'](_0x5dd6a3[_0x35eb('0x1e')][_0x35eb('0x22')]));_0x9a4982[_0x35eb('0x23')]=_0x9a4982['attributes']['length']?_0x9a4982['attributes']:_0xb40b6b[_0x35eb('0x20')];if(_0x5dd6a3[_0x35eb('0x1e')][_0x35eb('0x2f')]){_0x9a4982[_0x35eb('0x33')]=[{'all':!![]}];}_0x9a4982=_[_0x35eb('0x34')]({},_0x9a4982,_0x5dd6a3['options']);return db[_0x35eb('0x19')][_0x35eb('0x35')](_0x9a4982)['then'](handleEntityNotFound(_0x265bc7,null))[_0x35eb('0x11')](respondWithResult(_0x265bc7,null))[_0x35eb('0x31')](handleError(_0x265bc7,null));};exports[_0x35eb('0x36')]=function(_0x27aa42,_0x101daf){return db[_0x35eb('0x19')][_0x35eb('0x36')](_0x27aa42['body'],{})[_0x35eb('0x11')](respondWithResult(_0x101daf,0xc9))[_0x35eb('0x31')](handleError(_0x101daf,null));};exports['update']=function(_0x36ee77,_0x22ae91){if(_0x36ee77[_0x35eb('0x37')]['id']){delete _0x36ee77[_0x35eb('0x37')]['id'];}return db[_0x35eb('0x19')][_0x35eb('0x35')]({'where':{'id':_0x36ee77[_0x35eb('0x38')]['id']}})[_0x35eb('0x11')](handleEntityNotFound(_0x22ae91,null))['then'](saveUpdates(_0x36ee77[_0x35eb('0x37')],null))[_0x35eb('0x11')](respondWithResult(_0x22ae91,null))[_0x35eb('0x31')](handleError(_0x22ae91,null));};exports[_0x35eb('0x12')]=function(_0x273b5b,_0x4b7560){return db[_0x35eb('0x19')]['find']({'where':{'id':_0x273b5b[_0x35eb('0x38')]['id']}})[_0x35eb('0x11')](handleEntityNotFound(_0x4b7560,null))['then'](removeEntity(_0x4b7560,null))[_0x35eb('0x31')](handleError(_0x4b7560,null));};exports[_0x35eb('0x39')]=function(_0x23bb1d,_0x587d51){var _0x514453={};var _0x11e248={};var _0x423403;var _0x160186;return db[_0x35eb('0x19')]['findOne']({'where':{'id':_0x23bb1d['params']['id']}})[_0x35eb('0x11')](handleEntityNotFound(_0x587d51,null))[_0x35eb('0x11')](function(_0x18e0a1){if(_0x18e0a1){_0x423403=_0x18e0a1;_0x11e248[_0x35eb('0x20')]=_[_0x35eb('0x1f')](db[_0x35eb('0x3a')]['rawAttributes']);_0x11e248[_0x35eb('0x1e')]=_[_0x35eb('0x1f')](_0x23bb1d[_0x35eb('0x1e')]);_0x11e248[_0x35eb('0x29')]=_[_0x35eb('0x21')](_0x11e248['model'],_0x11e248['query']);_0x514453[_0x35eb('0x23')]=_[_0x35eb('0x21')](_0x11e248[_0x35eb('0x20')],qs['fields'](_0x23bb1d[_0x35eb('0x1e')][_0x35eb('0x22')]));_0x514453[_0x35eb('0x23')]=_0x514453['attributes']['length']?_0x514453[_0x35eb('0x23')]:_0x11e248['model'];_0x514453[_0x35eb('0x27')]=qs[_0x35eb('0x28')](_0x23bb1d[_0x35eb('0x1e')][_0x35eb('0x28')]);_0x514453['where']=qs['filters'](_['pick'](_0x23bb1d[_0x35eb('0x1e')],_0x11e248[_0x35eb('0x29')]));if(_0x23bb1d['query'][_0x35eb('0x2b')]){_0x514453[_0x35eb('0x2c')]=_[_0x35eb('0x34')](_0x514453['where'],{'$or':_[_0x35eb('0x18')](_0x514453[_0x35eb('0x23')],function(_0x23013c){var _0x393a2c={};_0x393a2c[_0x23013c]={'$like':'%'+_0x23bb1d['query'][_0x35eb('0x2b')]+'%'};return _0x393a2c;})});}_0x514453=_[_0x35eb('0x34')]({},_0x514453,_0x23bb1d[_0x35eb('0x2e')]);return _0x423403[_0x35eb('0x39')](_0x514453);}})[_0x35eb('0x11')](function(_0x3cf13f){if(_0x3cf13f){_0x160186=_0x3cf13f['length'];if(!_0x23bb1d[_0x35eb('0x1e')]['hasOwnProperty']('nolimit')){_0x514453[_0x35eb('0xb')]=qs[_0x35eb('0xb')](_0x23bb1d['query']['limit']);_0x514453[_0x35eb('0xd')]=qs['offset'](_0x23bb1d[_0x35eb('0x1e')][_0x35eb('0xd')]);}return _0x423403[_0x35eb('0x39')](_0x514453);}})[_0x35eb('0x11')](function(_0x4e7ff5){if(_0x4e7ff5){return _0x4e7ff5?{'count':_0x160186,'rows':_0x4e7ff5}:null;}})[_0x35eb('0x11')](respondWithResult(_0x587d51,null))[_0x35eb('0x31')](handleError(_0x587d51,null));};exports['addConfiguration']=function(_0xe07cbe,_0x249ad4){if(_0xe07cbe[_0x35eb('0x37')]['id']){delete _0xe07cbe[_0x35eb('0x37')]['id'];}return db[_0x35eb('0x19')]['findOne']({'where':{'id':_0xe07cbe[_0x35eb('0x38')]['id']}})[_0x35eb('0x11')](handleEntityNotFound(_0x249ad4,null))[_0x35eb('0x11')](function(_0xf792be){if(_0xf792be){_0xe07cbe['body']['AccountId']=_0xf792be['id'];_0xe07cbe[_0x35eb('0x37')][_0x35eb('0x3b')]=integrations[_0x35eb('0x3c')](_0xe07cbe['body'][_0x35eb('0x3d')],_0xe07cbe['body'][_0x35eb('0x1c')]);_0xe07cbe[_0x35eb('0x37')][_0x35eb('0x3e')]=integrations[_0x35eb('0x3f')](_0xe07cbe[_0x35eb('0x37')][_0x35eb('0x3d')],_0xe07cbe['body'][_0x35eb('0x1c')]);return db[_0x35eb('0x3a')][_0x35eb('0x36')](_0xe07cbe[_0x35eb('0x37')],{'include':[{'model':db[_0x35eb('0x40')],'as':'Subjects'},{'model':db[_0x35eb('0x40')],'as':_0x35eb('0x3e')}]});}return null;})['then'](respondWithResult(_0x249ad4,null))[_0x35eb('0x31')](handleError(_0x249ad4,null));};function sanitizeRemoteUri(_0x3e3c9a){var _0xe045cf=_0x3e3c9a[_0x35eb('0x41')](-0x1);if(_0xe045cf==='/')return _0x3e3c9a['substring'](0x0,_0x3e3c9a[_0x35eb('0x42')](_0xe045cf));return _0x3e3c9a;}function getWebApiUrl(_0x120ce4){return util[_0x35eb('0x43')]('%s/api/data/v9.0/',_0x120ce4);}exports[_0x35eb('0x44')]=function(_0x3fe737,_0x1cebe0){var _0x4b1389=_0x3fe737[_0x35eb('0x1e')][_0x35eb('0x45')];var _0x48acec=_0x4b1389==='incident'?'Incident':_0x35eb('0x46');var _0x394c4a='';var _0x365ce8='';var _0x451773='';var _0x4f1f8c='';var _0x15eef0='';var _0x516566='';var _0x35b900='';var _0x442a98='';var _0x551f68=[_0x35eb('0x47'),_0x35eb('0x48'),_0x35eb('0x49'),'ownerid',_0x35eb('0x4a'),_0x35eb('0x4b'),'phonenumber','regardingobjectid',_0x35eb('0x4c'),_0x35eb('0x4d')];var _0x410a0a=[_0x35eb('0x4e'),_0x35eb('0x4f'),_0x35eb('0x50'),'billedserviceunits','contactidname',_0x35eb('0x51'),_0x35eb('0x52'),_0x35eb('0x53'),_0x35eb('0x54'),_0x35eb('0x55'),_0x35eb('0x56'),'createdbyyominame',_0x35eb('0x57'),_0x35eb('0x58'),'createdonbehalfbyyominame',_0x35eb('0x59'),_0x35eb('0x5a'),_0x35eb('0x5b'),_0x35eb('0x5c'),_0x35eb('0x5d'),_0x35eb('0x5e'),_0x35eb('0x5f'),_0x35eb('0x60'),'exchangerate',_0x35eb('0x61'),'followupby',_0x35eb('0x62'),_0x35eb('0x63'),_0x35eb('0x64'),_0x35eb('0x65'),_0x35eb('0x66'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x35eb('0x67'),_0x35eb('0x68'),_0x35eb('0x69'),_0x35eb('0x6a'),_0x35eb('0x6b'),_0x35eb('0x6c'),_0x35eb('0x6d'),'numberofchildincidents',_0x35eb('0x6e'),_0x35eb('0x6f'),'owneridname',_0x35eb('0x70'),_0x35eb('0x71'),_0x35eb('0x72'),'primarycontactidname',_0x35eb('0x73'),_0x35eb('0x74'),_0x35eb('0x75'),_0x35eb('0x76'),_0x35eb('0x77'),'resolvebykpiidname',_0x35eb('0x78'),_0x35eb('0x79'),_0x35eb('0x7a'),_0x35eb('0x7b'),'slainvokedidname',_0x35eb('0x7c'),_0x35eb('0x7d'),_0x35eb('0x7e'),_0x35eb('0x7f'),_0x35eb('0x80'),_0x35eb('0x81'),'timezoneruleversionnumber',_0x35eb('0x82'),_0x35eb('0x83'),_0x35eb('0x84'),_0x35eb('0x85')];var _0x2fc94a=_0x551f68['concat'](_0x410a0a);return db[_0x35eb('0x19')][_0x35eb('0x86')]({'where':{'id':_0x3fe737['params']['id']},'attributes':['id',_0x35eb('0x87'),_0x35eb('0x88'),_0x35eb('0x89'),_0x35eb('0x8a'),_0x35eb('0x8b'),_0x35eb('0x8c'),_0x35eb('0x8d')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id',_0x35eb('0x8e'),'data7']}]})[_0x35eb('0x11')](handleEntityNotFound(_0x1cebe0,null))[_0x35eb('0x11')](function(_0x38d7fa){if(_0x38d7fa){if(_0x38d7fa['modernAuthentication']){_0x38d7fa[_0x35eb('0x8f')]=_0x38d7fa['CloudProvider'][_0x35eb('0x8e')];_0x442a98=sanitizeRemoteUri(_0x38d7fa[_0x35eb('0x90')]['data7']);_0x35b900=getWebApiUrl(_0x442a98);return _0x38d7fa;}_0x442a98=sanitizeRemoteUri(_0x38d7fa[_0x35eb('0x89')]);_0x35b900=getWebApiUrl(_0x442a98);var _0x329c51={'method':_0x35eb('0x91'),'uri':_0x35eb('0x92')+_0x38d7fa[_0x35eb('0x8a')]+_0x35eb('0x93'),'form':{'client_id':_0x38d7fa[_0x35eb('0x8b')],'resource':_0x442a98,'username':_0x38d7fa[_0x35eb('0x87')],'password':_0x38d7fa[_0x35eb('0x88')],'grant_type':_0x35eb('0x88'),'client_secret':_0x38d7fa[_0x35eb('0x8c')]},'json':!![]};return rp(_0x329c51);}})[_0x35eb('0x11')](function(_0x130ec9){_0x516566=_0x130ec9[_0x35eb('0x8f')];var _0x24dbf6={'method':_0x35eb('0x94'),'uri':encodeURI(_0x35b900+_0x35eb('0x95')+_0x48acec+'\x27'),'headers':{'Authorization':_0x35eb('0x96')+_0x516566,'If-None-Match':null,'OData-Version':_0x35eb('0x97')},'json':!![]};return rp(_0x24dbf6);})['then'](function(_0x1f204f){var _0x16e929=_0x1f204f['value'][0x0];var _0x1a2b78=_0x16e929[_0x35eb('0x98')];var _0x40a2af={'method':_0x35eb('0x94'),'uri':_0x35b900+_0x35eb('0x99')+_0x1a2b78+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x35eb('0x96')+_0x516566,'If-None-Match':null,'OData-Version':_0x35eb('0x97')},'json':!![]};return rp(_0x40a2af);})[_0x35eb('0x11')](function(_0x3c4400){_0x394c4a=_0x3c4400;_0x365ce8=_0x394c4a[_0x35eb('0x9a')];_0x365ce8=_[_0x35eb('0x9b')](_0x365ce8,function(_0x122d99){return!_0x2fc94a[_0x35eb('0x9c')](_0x122d99['LogicalName']);});var _0x346164=[];var _0x3dabb8=[];_0x365ce8[_0x35eb('0x9d')](function(_0x4d30c7){if(_0x4d30c7[_0x35eb('0x9e')]){var _0x13ac4f=_0x4d30c7['@odata.type'][_0x35eb('0x9f')](_0x4d30c7[_0x35eb('0x9e')][_0x35eb('0x42')]('.')+0x1);if(_0x13ac4f===_0x35eb('0xa0')){_0x346164[_0x35eb('0xa1')](getSelectList(_0x35b900,_0x4b1389,_0x3dabb8,_0x394c4a['MetadataId'],_0x4d30c7['MetadataId'],_0x516566));}}});return Promise[_0x35eb('0xa2')](_0x346164);})['then'](function(_0x47e335){_0x451773=_0x47e335[0x0];var _0x1cf8cc=[];var _0x5c0e21=[];_0x365ce8['forEach'](function(_0x9cb675){if(!_[_0x35eb('0xa3')](_0x9cb675[_0x35eb('0x9e')])){var _0x4f3978=_0x9cb675['@odata.type'][_0x35eb('0x9f')](_0x9cb675['@odata.type'][_0x35eb('0x42')]('.')+0x1);if(_0x4f3978===_0x35eb('0xa4')){_0x1cf8cc[_0x35eb('0xa1')](getBooleanList(_0x35b900,_0x4b1389,_0x5c0e21,_0x394c4a[_0x35eb('0x98')],_0x9cb675[_0x35eb('0x98')],_0x516566));}}});return Promise[_0x35eb('0xa2')](_0x1cf8cc);})['then'](function(_0x38895a){_0x4f1f8c=_0x38895a[0x0];var _0x21e6f0=[];var _0x4d4fe4=[];_0x365ce8['forEach'](function(_0xe36618){if(_0xe36618[_0x35eb('0x9e')]){var _0x1f13ac=_0xe36618['@odata.type'][_0x35eb('0x9f')](_0xe36618[_0x35eb('0x9e')]['lastIndexOf']('.')+0x1);if(_0x1f13ac==='StringAttributeMetadata'||_0x1f13ac==='DoubleAttributeMetadata'||_0x1f13ac==='BigIntAttributeMetadata'||_0x1f13ac===_0x35eb('0xa5')||_0x1f13ac===_0x35eb('0xa6')||_0x1f13ac===_0x35eb('0xa7')||_0x1f13ac===_0x35eb('0xa8')||_0x1f13ac==='EntityNameAttributeMetadata'||_0x1f13ac===_0x35eb('0xa9')||_0x1f13ac===_0x35eb('0xaa')){_0x21e6f0[_0x35eb('0xa1')](getInputList(_0x35b900,_0x4b1389,_0x1f13ac,_0x4d4fe4,_0x394c4a[_0x35eb('0x98')],_0xe36618['MetadataId'],_0x516566));}}});return Promise[_0x35eb('0xa2')](_0x21e6f0);})['then'](function(_0x349ba8){_0x15eef0=_0x349ba8[0x0];var _0x2c16d1=_0x451773[_0x35eb('0xab')](_0x4f1f8c)[_0x35eb('0xab')](_0x15eef0);var _0x418973={'count':_0x2c16d1[_0x35eb('0x24')],'rows':_0x2c16d1};return _0x418973;})['then'](respondWithResult(_0x1cebe0,null))[_0x35eb('0x31')](function(_0x4b019f){var _0x384f33=_0x3fe737[_0x35eb('0x1e')]['test']?0x1f4:_0x4b019f[_0x35eb('0xac')]||0x1f4;logger[_0x35eb('0xad')](_0x4b019f[_0x35eb('0xae')]);delete _0x4b019f[_0x35eb('0x15')];if(_0x384f33===0x191){_0x384f33=0x190;}_0x1cebe0[_0x35eb('0x8')](_0x384f33)[_0x35eb('0x16')](_0x3fe737['query'][_0x35eb('0xaf')]?{'message':_0x35eb('0xb0'),'statusCode':_0x4b019f[_0x35eb('0xac')]}:_0x4b019f);});};function getSelectList(_0x23e667,_0x56cd3d,_0x367822,_0x4385ae,_0x2dd88b,_0x332537){var _0x1fc38e={'method':'GET','uri':_0x23e667+_0x35eb('0x99')+_0x4385ae+_0x35eb('0xb1')+_0x2dd88b+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x35eb('0xb2'),'headers':{'Authorization':_0x35eb('0x96')+_0x332537,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1fc38e)[_0x35eb('0x11')](function(_0x4e0fef){var _0x5bee69=[];var _0x19c294=_0x4e0fef[_0x35eb('0xb3')][_0x35eb('0xb4')];_0x19c294['forEach'](function(_0x165669){_0x5bee69[_0x35eb('0xa1')]({'name':_0x165669[_0x35eb('0xb5')][_0x35eb('0xb6')][_0x35eb('0xb5')],'value':String(_0x165669[_0x35eb('0xb7')])});});var _0x1dbb46={'id':_0x56cd3d+'_'+_0x4e0fef['LogicalName'],'name':_0x4e0fef[_0x35eb('0xb8')][_0x35eb('0xb6')]['Label'],'custom':![],'options':_0x5bee69};_0x367822['push'](_0x1dbb46);return _0x367822;});}function getBooleanList(_0x36772e,_0x44e305,_0x255218,_0x50cc75,_0x55e37b,_0x3183fe){var _0x2382c4={'method':_0x35eb('0x94'),'uri':_0x36772e+'EntityDefinitions('+_0x50cc75+_0x35eb('0xb1')+_0x55e37b+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x3183fe,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2382c4)['then'](function(_0x1711a9){var _0x28aa9a=[];_0x28aa9a[_0x35eb('0xa1')]({'name':_0x1711a9[_0x35eb('0xb3')][_0x35eb('0xb9')]['Label']['UserLocalizedLabel']['Label'],'value':_0x35eb('0xba')},{'name':_0x1711a9[_0x35eb('0xb3')]['FalseOption'][_0x35eb('0xb5')][_0x35eb('0xb6')][_0x35eb('0xb5')],'value':'false'});var _0x92366={'id':_0x44e305+'_'+_0x1711a9[_0x35eb('0xbb')],'name':_0x1711a9[_0x35eb('0xb8')]['UserLocalizedLabel'][_0x35eb('0xb5')],'custom':![],'options':_0x28aa9a};_0x255218[_0x35eb('0xa1')](_0x92366);return _0x255218;});}function getInputList(_0x2abc68,_0x176a43,_0x2acacc,_0x2c7198,_0x58b69b,_0x3c9e0c,_0x4056f7){var _0x226d7e={'method':_0x35eb('0x94'),'uri':_0x2abc68+_0x35eb('0x99')+_0x58b69b+_0x35eb('0xb1')+_0x3c9e0c+')/Microsoft.Dynamics.CRM.'+_0x2acacc+_0x35eb('0xbc'),'headers':{'Authorization':_0x35eb('0x96')+_0x4056f7,'If-None-Match':null,'OData-Version':_0x35eb('0x97')},'json':!![]};return rp(_0x226d7e)[_0x35eb('0x11')](function(_0x4a498b){var _0x429de9={'id':_0x176a43+'_'+_0x4a498b[_0x35eb('0xbb')],'name':_0x4a498b[_0x35eb('0xb8')][_0x35eb('0xb6')]?_0x4a498b[_0x35eb('0xb8')][_0x35eb('0xb6')][_0x35eb('0xb5')]:_0x4a498b[_0x35eb('0xbb')],'custom':![],'options':[]};_0x2c7198[_0x35eb('0xa1')](_0x429de9);return _0x2c7198;});} \ No newline at end of file +var _0x823a=['include','findAll','rows','show','params','options','find','catch','create','body','update','getConfigurations','findOne','Dynamics365Configuration','order','AccountId','getSubjects','channel','Descriptions','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','incident','Incident','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','traversedpath','utcconversiontimezonecode','concat','password','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','username','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','all','forEach','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','push','Label','DisplayName','UserLocalizedLabel',')/Attributes(','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','Content-Range','then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','Dynamics365Account','includeAll'];(function(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0x823a,0x14a));var _0xa823=function(_0x5468bf,_0x48c1ad){_0x5468bf=_0x5468bf-0x0;var _0x3c6c01=_0x823a[_0x5468bf];return _0x3c6c01;};'use strict';var rp=require(_0xa823('0x0'));var util=require(_0xa823('0x1'));var _=require(_0xa823('0x2'));var qs=require(_0xa823('0x3'));var logger=require(_0xa823('0x4'))(_0xa823('0x5'));var db=require(_0xa823('0x6'))['db'];var integrations=require(_0xa823('0x7'));function respondWithResult(_0x1ff902,_0x2ebce1){_0x2ebce1=_0x2ebce1||0xc8;return function(_0x19f851){if(_0x19f851){return _0x1ff902[_0xa823('0x8')](_0x2ebce1)[_0xa823('0x9')](_0x19f851);}};}function respondWithFilteredResult(_0x434551,_0x3e6049){return function(_0x5d1591){if(_0x5d1591){var _0x3724fa=typeof _0x3e6049[_0xa823('0xa')]==='undefined'&&typeof _0x3e6049[_0xa823('0xb')]===_0xa823('0xc');var _0x5c486f=_0x5d1591[_0xa823('0xd')];var _0x53b92a=_0x3724fa?0x0:_0x3e6049[_0xa823('0xa')];var _0x23dd2c=_0x3724fa?_0x5d1591[_0xa823('0xd')]:_0x3e6049[_0xa823('0xa')]+_0x3e6049[_0xa823('0xb')];var _0x22bd9d;if(_0x23dd2c>=_0x5c486f){_0x23dd2c=_0x5c486f;_0x22bd9d=0xc8;}else{_0x22bd9d=0xce;}_0x434551[_0xa823('0x8')](_0x22bd9d);return _0x434551['set'](_0xa823('0xe'),_0x53b92a+'-'+_0x23dd2c+'/'+_0x5c486f)[_0xa823('0x9')](_0x5d1591);}return null;};}function saveUpdates(_0x1842cc){return function(_0x415d01){if(_0x415d01){return _0x415d01['update'](_0x1842cc)[_0xa823('0xf')](function(_0x26c0ed){return _0x26c0ed;});}return null;};}function removeEntity(_0xe8a990){return function(_0x30907c){if(_0x30907c){return _0x30907c[_0xa823('0x10')]()[_0xa823('0xf')](function(){_0xe8a990[_0xa823('0x8')](0xcc)[_0xa823('0x11')]();});}};}function handleEntityNotFound(_0xdae13f){return function(_0x33d755){if(!_0x33d755){_0xdae13f['sendStatus'](0x194);}return _0x33d755;};}function handleError(_0x642203,_0x4fe9f1){_0x4fe9f1=_0x4fe9f1||0x1f4;return function(_0x20ca5d){logger[_0xa823('0x12')](_0x20ca5d['stack']);if(_0x20ca5d[_0xa823('0x13')]){delete _0x20ca5d[_0xa823('0x13')];}_0x642203[_0xa823('0x8')](_0x4fe9f1)[_0xa823('0x14')](_0x20ca5d);};}exports[_0xa823('0x15')]=function(_0x139aa1,_0x302bc5){var _0x28ee04={},_0x5aa964={},_0x1a8c0a={'count':0x0,'rows':[]};var _0x335a0c=_['map'](db['Dynamics365Account'][_0xa823('0x16')],function(_0x1f267c){return{'name':_0x1f267c[_0xa823('0x17')],'type':_0x1f267c[_0xa823('0x18')][_0xa823('0x19')]};});_0x5aa964[_0xa823('0x1a')]=_[_0xa823('0x1b')](_0x335a0c,'name');_0x5aa964[_0xa823('0x1c')]=_[_0xa823('0x1d')](_0x139aa1[_0xa823('0x1c')]);_0x5aa964[_0xa823('0x1e')]=_[_0xa823('0x1f')](_0x5aa964['model'],_0x5aa964[_0xa823('0x1c')]);_0x28ee04[_0xa823('0x20')]=_[_0xa823('0x1f')](_0x5aa964['model'],qs[_0xa823('0x21')](_0x139aa1['query']['fields']));_0x28ee04[_0xa823('0x20')]=_0x28ee04[_0xa823('0x20')][_0xa823('0x22')]?_0x28ee04[_0xa823('0x20')]:_0x5aa964[_0xa823('0x1a')];if(!_0x139aa1[_0xa823('0x1c')][_0xa823('0x23')](_0xa823('0x24'))){_0x28ee04[_0xa823('0xb')]=qs[_0xa823('0xb')](_0x139aa1[_0xa823('0x1c')][_0xa823('0xb')]);_0x28ee04[_0xa823('0xa')]=qs['offset'](_0x139aa1[_0xa823('0x1c')][_0xa823('0xa')]);}_0x28ee04['order']=qs[_0xa823('0x25')](_0x139aa1[_0xa823('0x1c')][_0xa823('0x25')]);_0x28ee04[_0xa823('0x26')]=qs['filters'](_[_0xa823('0x27')](_0x139aa1[_0xa823('0x1c')],_0x5aa964['filters']),_0x335a0c);if(_0x139aa1[_0xa823('0x1c')][_0xa823('0x28')]){_0x28ee04[_0xa823('0x26')]=_[_0xa823('0x29')](_0x28ee04[_0xa823('0x26')],{'$or':_[_0xa823('0x1b')](_0x335a0c,function(_0xdeeeca){if(_0xdeeeca[_0xa823('0x18')]!=='VIRTUAL'){var _0x4cd161={};_0x4cd161[_0xdeeeca['name']]={'$like':'%'+_0x139aa1[_0xa823('0x1c')]['filter']+'%'};return _0x4cd161;}})});}_0x28ee04=_[_0xa823('0x29')]({},_0x28ee04,_0x139aa1['options']);var _0xbcc224={'where':_0x28ee04[_0xa823('0x26')]};return db[_0xa823('0x2a')][_0xa823('0xd')](_0xbcc224)[_0xa823('0xf')](function(_0x371f74){_0x1a8c0a[_0xa823('0xd')]=_0x371f74;if(_0x139aa1[_0xa823('0x1c')][_0xa823('0x2b')]){_0x28ee04[_0xa823('0x2c')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xa823('0x2d')](_0x28ee04);})[_0xa823('0xf')](function(_0x29dcc7){_0x1a8c0a[_0xa823('0x2e')]=_0x29dcc7;return _0x1a8c0a;})['then'](respondWithFilteredResult(_0x302bc5,_0x28ee04))['catch'](handleError(_0x302bc5,null));};exports[_0xa823('0x2f')]=function(_0x402944,_0x4d4a24){var _0x2cd375={'raw':![],'where':{'id':_0x402944[_0xa823('0x30')]['id']}},_0x58639e={};_0x58639e[_0xa823('0x1a')]=_[_0xa823('0x1d')](db[_0xa823('0x2a')][_0xa823('0x16')]);_0x58639e['query']=_[_0xa823('0x1d')](_0x402944[_0xa823('0x1c')]);_0x58639e[_0xa823('0x1e')]=_['intersection'](_0x58639e[_0xa823('0x1a')],_0x58639e[_0xa823('0x1c')]);_0x2cd375['attributes']=_[_0xa823('0x1f')](_0x58639e[_0xa823('0x1a')],qs['fields'](_0x402944['query'][_0xa823('0x21')]));_0x2cd375[_0xa823('0x20')]=_0x2cd375['attributes'][_0xa823('0x22')]?_0x2cd375['attributes']:_0x58639e[_0xa823('0x1a')];if(_0x402944['query'][_0xa823('0x2b')]){_0x2cd375[_0xa823('0x2c')]=[{'all':!![]}];}_0x2cd375=_[_0xa823('0x29')]({},_0x2cd375,_0x402944[_0xa823('0x31')]);return db[_0xa823('0x2a')][_0xa823('0x32')](_0x2cd375)[_0xa823('0xf')](handleEntityNotFound(_0x4d4a24,null))[_0xa823('0xf')](respondWithResult(_0x4d4a24,null))[_0xa823('0x33')](handleError(_0x4d4a24,null));};exports[_0xa823('0x34')]=function(_0x10ac9f,_0x4c455e){return db[_0xa823('0x2a')]['create'](_0x10ac9f[_0xa823('0x35')],{})[_0xa823('0xf')](respondWithResult(_0x4c455e,0xc9))[_0xa823('0x33')](handleError(_0x4c455e,null));};exports[_0xa823('0x36')]=function(_0x3526e2,_0x380127){if(_0x3526e2[_0xa823('0x35')]['id']){delete _0x3526e2['body']['id'];}return db[_0xa823('0x2a')][_0xa823('0x32')]({'where':{'id':_0x3526e2['params']['id']}})[_0xa823('0xf')](handleEntityNotFound(_0x380127,null))[_0xa823('0xf')](saveUpdates(_0x3526e2['body'],null))[_0xa823('0xf')](respondWithResult(_0x380127,null))[_0xa823('0x33')](handleError(_0x380127,null));};exports[_0xa823('0x10')]=function(_0x4a1e69,_0x7dfb79){return db[_0xa823('0x2a')][_0xa823('0x32')]({'where':{'id':_0x4a1e69['params']['id']}})[_0xa823('0xf')](handleEntityNotFound(_0x7dfb79,null))[_0xa823('0xf')](removeEntity(_0x7dfb79,null))[_0xa823('0x33')](handleError(_0x7dfb79,null));};exports[_0xa823('0x37')]=function(_0x42aa4a,_0xebfcb5){var _0xf83ecc={};var _0xdca9ef={};var _0xffa58d;var _0x3bca05;return db[_0xa823('0x2a')][_0xa823('0x38')]({'where':{'id':_0x42aa4a[_0xa823('0x30')]['id']}})['then'](handleEntityNotFound(_0xebfcb5,null))[_0xa823('0xf')](function(_0x944f01){if(_0x944f01){_0xffa58d=_0x944f01;_0xdca9ef[_0xa823('0x1a')]=_[_0xa823('0x1d')](db[_0xa823('0x39')][_0xa823('0x16')]);_0xdca9ef['query']=_['keys'](_0x42aa4a[_0xa823('0x1c')]);_0xdca9ef[_0xa823('0x1e')]=_['intersection'](_0xdca9ef[_0xa823('0x1a')],_0xdca9ef['query']);_0xf83ecc['attributes']=_[_0xa823('0x1f')](_0xdca9ef[_0xa823('0x1a')],qs[_0xa823('0x21')](_0x42aa4a[_0xa823('0x1c')][_0xa823('0x21')]));_0xf83ecc['attributes']=_0xf83ecc[_0xa823('0x20')][_0xa823('0x22')]?_0xf83ecc[_0xa823('0x20')]:_0xdca9ef[_0xa823('0x1a')];_0xf83ecc[_0xa823('0x3a')]=qs['sort'](_0x42aa4a[_0xa823('0x1c')]['sort']);_0xf83ecc[_0xa823('0x26')]=qs['filters'](_[_0xa823('0x27')](_0x42aa4a[_0xa823('0x1c')],_0xdca9ef[_0xa823('0x1e')]));if(_0x42aa4a[_0xa823('0x1c')][_0xa823('0x28')]){_0xf83ecc['where']=_['merge'](_0xf83ecc[_0xa823('0x26')],{'$or':_[_0xa823('0x1b')](_0xf83ecc[_0xa823('0x20')],function(_0x57ed61){var _0x108d08={};_0x108d08[_0x57ed61]={'$like':'%'+_0x42aa4a[_0xa823('0x1c')][_0xa823('0x28')]+'%'};return _0x108d08;})});}_0xf83ecc=_[_0xa823('0x29')]({},_0xf83ecc,_0x42aa4a[_0xa823('0x31')]);return _0xffa58d[_0xa823('0x37')](_0xf83ecc);}})[_0xa823('0xf')](function(_0x57a5f2){if(_0x57a5f2){_0x3bca05=_0x57a5f2[_0xa823('0x22')];if(!_0x42aa4a['query'][_0xa823('0x23')](_0xa823('0x24'))){_0xf83ecc[_0xa823('0xb')]=qs[_0xa823('0xb')](_0x42aa4a[_0xa823('0x1c')][_0xa823('0xb')]);_0xf83ecc[_0xa823('0xa')]=qs[_0xa823('0xa')](_0x42aa4a[_0xa823('0x1c')][_0xa823('0xa')]);}return _0xffa58d['getConfigurations'](_0xf83ecc);}})[_0xa823('0xf')](function(_0x4fbc77){if(_0x4fbc77){return _0x4fbc77?{'count':_0x3bca05,'rows':_0x4fbc77}:null;}})[_0xa823('0xf')](respondWithResult(_0xebfcb5,null))[_0xa823('0x33')](handleError(_0xebfcb5,null));};exports['addConfiguration']=function(_0x3017fc,_0x3971b3){if(_0x3017fc[_0xa823('0x35')]['id']){delete _0x3017fc[_0xa823('0x35')]['id'];}return db['Dynamics365Account'][_0xa823('0x38')]({'where':{'id':_0x3017fc[_0xa823('0x30')]['id']}})['then'](handleEntityNotFound(_0x3971b3,null))[_0xa823('0xf')](function(_0xd1586d){if(_0xd1586d){_0x3017fc[_0xa823('0x35')][_0xa823('0x3b')]=_0xd1586d['id'];_0x3017fc[_0xa823('0x35')]['Subjects']=integrations[_0xa823('0x3c')](_0x3017fc[_0xa823('0x35')][_0xa823('0x3d')],_0x3017fc['body'][_0xa823('0x18')]);_0x3017fc[_0xa823('0x35')][_0xa823('0x3e')]=integrations['getDescriptions'](_0x3017fc[_0xa823('0x35')]['channel'],_0x3017fc[_0xa823('0x35')]['type']);return db[_0xa823('0x39')][_0xa823('0x34')](_0x3017fc[_0xa823('0x35')],{'include':[{'model':db[_0xa823('0x3f')],'as':_0xa823('0x40')},{'model':db[_0xa823('0x3f')],'as':_0xa823('0x3e')}]});}return null;})['then'](respondWithResult(_0x3971b3,null))[_0xa823('0x33')](handleError(_0x3971b3,null));};function sanitizeRemoteUri(_0x1e4987){var _0x570ba2=_0x1e4987[_0xa823('0x41')](-0x1);if(_0x570ba2==='/')return _0x1e4987[_0xa823('0x42')](0x0,_0x1e4987[_0xa823('0x43')](_0x570ba2));return _0x1e4987;}function getWebApiUrl(_0x414393){return util[_0xa823('0x44')](_0xa823('0x45'),_0x414393);}exports['getFields']=function(_0x4a5a9a,_0x35ca19){var _0x5b5a29=_0x4a5a9a[_0xa823('0x1c')][_0xa823('0x46')];var _0x377a6a=_0x5b5a29===_0xa823('0x47')?_0xa823('0x48'):'PhoneCall';var _0x5098a0='';var _0x58008a='';var _0xceed40='';var _0x286b5='';var _0x186843='';var _0x5b998f='';var _0x5b5c1f='';var _0x4d47e4='';var _0x153eab=['title',_0xa823('0x49'),_0xa823('0x4a'),_0xa823('0x4b'),_0xa823('0x4c'),_0xa823('0x4d'),_0xa823('0x4e'),_0xa823('0x4f'),_0xa823('0x50'),_0xa823('0x51')];var _0x30929b=[_0xa823('0x52'),'accountidyominame',_0xa823('0x53'),'billedserviceunits','contactidname','contactidyominame',_0xa823('0x54'),_0xa823('0x55'),_0xa823('0x56'),_0xa823('0x57'),_0xa823('0x58'),_0xa823('0x59'),_0xa823('0x5a'),_0xa823('0x5b'),_0xa823('0x5c'),'customeridname','customeridtype','customeridyominame',_0xa823('0x5d'),_0xa823('0x5e'),_0xa823('0x5f'),_0xa823('0x60'),'escalatedon','exchangerate','firstresponsebykpiidname',_0xa823('0x61'),'importsequencenumber',_0xa823('0x62'),_0xa823('0x63'),_0xa823('0x64'),_0xa823('0x65'),_0xa823('0x66'),_0xa823('0x67'),_0xa823('0x68'),_0xa823('0x69'),'modifiedon',_0xa823('0x6a'),_0xa823('0x6b'),'msdyn_incidenttypename',_0xa823('0x6c'),_0xa823('0x6d'),_0xa823('0x6e'),_0xa823('0x6f'),_0xa823('0x70'),_0xa823('0x71'),_0xa823('0x72'),_0xa823('0x73'),_0xa823('0x74'),'primarycontactidyominame',_0xa823('0x75'),_0xa823('0x76'),_0xa823('0x77'),'resolveby',_0xa823('0x78'),_0xa823('0x79'),_0xa823('0x7a'),'responsiblecontactidyominame','sentimentvalue',_0xa823('0x7b'),_0xa823('0x7c'),_0xa823('0x7d'),_0xa823('0x7e'),'statuscode',_0xa823('0x7f'),_0xa823('0x80'),'timezoneruleversionnumber','transactioncurrencyidname',_0xa823('0x81'),_0xa823('0x82'),'versionnumber'];var _0x4bd590=_0x153eab[_0xa823('0x83')](_0x30929b);return db[_0xa823('0x2a')]['findOne']({'where':{'id':_0x4a5a9a['params']['id']},'attributes':['id','username',_0xa823('0x84'),'remoteUri','tenantId',_0xa823('0x85'),_0xa823('0x86'),_0xa823('0x87')],'include':[{'model':db[_0xa823('0x88')],'as':_0xa823('0x88'),'attributes':['id',_0xa823('0x89'),_0xa823('0x8a')]}]})[_0xa823('0xf')](handleEntityNotFound(_0x35ca19,null))['then'](function(_0x379931){if(_0x379931){if(_0x379931[_0xa823('0x87')]){_0x379931[_0xa823('0x8b')]=_0x379931[_0xa823('0x88')][_0xa823('0x89')];_0x4d47e4=sanitizeRemoteUri(_0x379931[_0xa823('0x88')][_0xa823('0x8a')]);_0x5b5c1f=getWebApiUrl(_0x4d47e4);return _0x379931;}_0x4d47e4=sanitizeRemoteUri(_0x379931[_0xa823('0x8c')]);_0x5b5c1f=getWebApiUrl(_0x4d47e4);var _0x1db7a3={'method':_0xa823('0x8d'),'uri':_0xa823('0x8e')+_0x379931['tenantId']+_0xa823('0x8f'),'form':{'client_id':_0x379931['clientId'],'resource':_0x4d47e4,'username':_0x379931[_0xa823('0x90')],'password':_0x379931[_0xa823('0x84')],'grant_type':_0xa823('0x84'),'client_secret':_0x379931[_0xa823('0x86')]},'json':!![]};return rp(_0x1db7a3);}})[_0xa823('0xf')](function(_0x447ef4){_0x5b998f=_0x447ef4[_0xa823('0x8b')];var _0x266efa={'method':_0xa823('0x91'),'uri':encodeURI(_0x5b5c1f+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x377a6a+'\x27'),'headers':{'Authorization':_0xa823('0x92')+_0x5b998f,'If-None-Match':null,'OData-Version':_0xa823('0x93')},'json':!![]};return rp(_0x266efa);})[_0xa823('0xf')](function(_0x41e48e){var _0x151e23=_0x41e48e[_0xa823('0x94')][0x0];var _0x48d9e4=_0x151e23[_0xa823('0x95')];var _0x23fa5a={'method':_0xa823('0x91'),'uri':_0x5b5c1f+_0xa823('0x96')+_0x48d9e4+_0xa823('0x97'),'headers':{'Authorization':_0xa823('0x92')+_0x5b998f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x23fa5a);})[_0xa823('0xf')](function(_0x479ab4){_0x5098a0=_0x479ab4;_0x58008a=_0x5098a0[_0xa823('0x98')];_0x58008a=_[_0xa823('0x99')](_0x58008a,function(_0x15b163){return!_0x4bd590[_0xa823('0x9a')](_0x15b163[_0xa823('0x9b')]);});var _0x30de10=[];var _0x4ea4a7=[];_0x58008a['forEach'](function(_0x14f4bd){if(_0x14f4bd['@odata.type']){var _0x59bfed=_0x14f4bd[_0xa823('0x9c')][_0xa823('0x42')](_0x14f4bd['@odata.type'][_0xa823('0x43')]('.')+0x1);if(_0x59bfed===_0xa823('0x9d')){_0x30de10['push'](getSelectList(_0x5b5c1f,_0x5b5a29,_0x4ea4a7,_0x5098a0[_0xa823('0x95')],_0x14f4bd[_0xa823('0x95')],_0x5b998f));}}});return Promise[_0xa823('0x9e')](_0x30de10);})[_0xa823('0xf')](function(_0x2939e8){_0xceed40=_0x2939e8[0x0];var _0x211309=[];var _0x259c7b=[];_0x58008a[_0xa823('0x9f')](function(_0x5259d1){if(!_[_0xa823('0xa0')](_0x5259d1[_0xa823('0x9c')])){var _0x1f7869=_0x5259d1[_0xa823('0x9c')][_0xa823('0x42')](_0x5259d1[_0xa823('0x9c')][_0xa823('0x43')]('.')+0x1);if(_0x1f7869==='BooleanAttributeMetadata'){_0x211309['push'](getBooleanList(_0x5b5c1f,_0x5b5a29,_0x259c7b,_0x5098a0[_0xa823('0x95')],_0x5259d1['MetadataId'],_0x5b998f));}}});return Promise[_0xa823('0x9e')](_0x211309);})['then'](function(_0x5b57d0){_0x286b5=_0x5b57d0[0x0];var _0x3522a4=[];var _0x3da000=[];_0x58008a[_0xa823('0x9f')](function(_0x47156c){if(_0x47156c[_0xa823('0x9c')]){var _0x54fff4=_0x47156c[_0xa823('0x9c')][_0xa823('0x42')](_0x47156c[_0xa823('0x9c')][_0xa823('0x43')]('.')+0x1);if(_0x54fff4===_0xa823('0xa1')||_0x54fff4===_0xa823('0xa2')||_0x54fff4===_0xa823('0xa3')||_0x54fff4===_0xa823('0xa4')||_0x54fff4===_0xa823('0xa5')||_0x54fff4===_0xa823('0xa6')||_0x54fff4===_0xa823('0xa7')||_0x54fff4===_0xa823('0xa8')||_0x54fff4==='StateAttributeMetadata'||_0x54fff4===_0xa823('0xa9')){_0x3522a4['push'](getInputList(_0x5b5c1f,_0x5b5a29,_0x54fff4,_0x3da000,_0x5098a0[_0xa823('0x95')],_0x47156c[_0xa823('0x95')],_0x5b998f));}}});return Promise[_0xa823('0x9e')](_0x3522a4);})[_0xa823('0xf')](function(_0x3c2747){_0x186843=_0x3c2747[0x0];var _0x1969db=_0xceed40[_0xa823('0x83')](_0x286b5)[_0xa823('0x83')](_0x186843);var _0x5d49fd={'count':_0x1969db[_0xa823('0x22')],'rows':_0x1969db};return _0x5d49fd;})[_0xa823('0xf')](respondWithResult(_0x35ca19,null))['catch'](function(_0x522a4e){var _0x181399=_0x4a5a9a[_0xa823('0x1c')][_0xa823('0xaa')]?0x1f4:_0x522a4e[_0xa823('0xab')]||0x1f4;logger[_0xa823('0x12')](_0x522a4e[_0xa823('0xac')]);delete _0x522a4e[_0xa823('0x13')];if(_0x181399===0x191){_0x181399=0x190;}_0x35ca19[_0xa823('0x8')](_0x181399)[_0xa823('0x14')](_0x4a5a9a[_0xa823('0x1c')][_0xa823('0xaa')]?{'message':_0xa823('0xad'),'statusCode':_0x522a4e[_0xa823('0xab')]}:_0x522a4e);});};function getSelectList(_0x354bf7,_0x1d9f6d,_0x53aa83,_0x164342,_0x98c2df,_0x22c481){var _0x8cf950={'method':'GET','uri':_0x354bf7+'EntityDefinitions('+_0x164342+')/Attributes('+_0x98c2df+_0xa823('0xae')+_0xa823('0xaf'),'headers':{'Authorization':_0xa823('0x92')+_0x22c481,'If-None-Match':null,'OData-Version':_0xa823('0x93')},'json':!![]};return rp(_0x8cf950)[_0xa823('0xf')](function(_0x37f15c){var _0x3d5845=[];var _0x59884a=_0x37f15c[_0xa823('0xb0')]['Options'];_0x59884a['forEach'](function(_0x35b95f){_0x3d5845[_0xa823('0xb1')]({'name':_0x35b95f['Label']['UserLocalizedLabel'][_0xa823('0xb2')],'value':String(_0x35b95f['Value'])});});var _0x1bc77d={'id':_0x1d9f6d+'_'+_0x37f15c[_0xa823('0x9b')],'name':_0x37f15c[_0xa823('0xb3')][_0xa823('0xb4')][_0xa823('0xb2')],'custom':![],'options':_0x3d5845};_0x53aa83[_0xa823('0xb1')](_0x1bc77d);return _0x53aa83;});}function getBooleanList(_0x2faa2e,_0x2f5766,_0x309df6,_0x17e168,_0x256046,_0x522c9b){var _0x43f9f0={'method':'GET','uri':_0x2faa2e+_0xa823('0x96')+_0x17e168+_0xa823('0xb5')+_0x256046+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x522c9b,'If-None-Match':null,'OData-Version':_0xa823('0x93')},'json':!![]};return rp(_0x43f9f0)[_0xa823('0xf')](function(_0x71337c){var _0x42dfde=[];_0x42dfde['push']({'name':_0x71337c[_0xa823('0xb0')][_0xa823('0xb6')]['Label'][_0xa823('0xb4')][_0xa823('0xb2')],'value':_0xa823('0xb7')},{'name':_0x71337c[_0xa823('0xb0')]['FalseOption'][_0xa823('0xb2')][_0xa823('0xb4')][_0xa823('0xb2')],'value':_0xa823('0xb8')});var _0x3ebcbb={'id':_0x2f5766+'_'+_0x71337c['LogicalName'],'name':_0x71337c[_0xa823('0xb3')][_0xa823('0xb4')][_0xa823('0xb2')],'custom':![],'options':_0x42dfde};_0x309df6[_0xa823('0xb1')](_0x3ebcbb);return _0x309df6;});}function getInputList(_0x5a90c1,_0x267f6f,_0x5d4612,_0x314ec3,_0x442796,_0x170467,_0x4a88a5){var _0x3eef1f={'method':'GET','uri':_0x5a90c1+_0xa823('0x96')+_0x442796+_0xa823('0xb5')+_0x170467+_0xa823('0xb9')+_0x5d4612+_0xa823('0xba'),'headers':{'Authorization':_0xa823('0x92')+_0x4a88a5,'If-None-Match':null,'OData-Version':_0xa823('0x93')},'json':!![]};return rp(_0x3eef1f)[_0xa823('0xf')](function(_0x5726ab){var _0x1648bd={'id':_0x267f6f+'_'+_0x5726ab[_0xa823('0x9b')],'name':_0x5726ab['DisplayName']['UserLocalizedLabel']?_0x5726ab['DisplayName'][_0xa823('0xb4')][_0xa823('0xb2')]:_0x5726ab['LogicalName'],'custom':![],'options':[]};_0x314ec3[_0xa823('0xb1')](_0x1648bd);return _0x314ec3;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b3745c1..3684966 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_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'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_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'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'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 df3262e..edf90f6 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 _0x7b27=['attributes','limit','include','model','map','ShowDynamics365Account','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw'];(function(_0x6b7dd0,_0x2eebf2){var _0x2356cc=function(_0x18c8d8){while(--_0x18c8d8){_0x6b7dd0['push'](_0x6b7dd0['shift']());}};_0x2356cc(++_0x2eebf2);}(_0x7b27,0x74));var _0x77b2=function(_0x41c77e,_0x1bb978){_0x41c77e=_0x41c77e-0x0;var _0x2595b8=_0x7b27[_0x41c77e];return _0x2595b8;};'use strict';var _=require('lodash');var util=require(_0x77b2('0x0'));var moment=require(_0x77b2('0x1'));var BPromise=require(_0x77b2('0x2'));var rs=require(_0x77b2('0x3'));var fs=require('fs');var Redis=require(_0x77b2('0x4'));var db=require(_0x77b2('0x5'))['db'];var utils=require(_0x77b2('0x6'));var logger=require(_0x77b2('0x7'))(_0x77b2('0x8'));var config=require(_0x77b2('0x9'));var jayson=require(_0x77b2('0xa'));var client=jayson['client'][_0x77b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f7af1,_0x290a03,_0x2386ae){return new BPromise(function(_0xfe7e75,_0x534418){return client[_0x77b2('0xc')](_0x1f7af1,_0x2386ae)[_0x77b2('0xd')](function(_0x16e1a5){logger['info'](_0x77b2('0xe'),_0x290a03,_0x77b2('0xf'));logger[_0x77b2('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x290a03,_0x77b2('0xf'),JSON[_0x77b2('0x11')](_0x16e1a5));if(_0x16e1a5[_0x77b2('0x12')]){if(_0x16e1a5[_0x77b2('0x12')][_0x77b2('0x13')]===0x1f4){logger[_0x77b2('0x12')](_0x77b2('0xe'),_0x290a03,_0x16e1a5[_0x77b2('0x12')][_0x77b2('0x14')]);return _0x534418(_0x16e1a5[_0x77b2('0x12')]['message']);}logger[_0x77b2('0x12')](_0x77b2('0xe'),_0x290a03,_0x16e1a5[_0x77b2('0x12')][_0x77b2('0x14')]);return _0xfe7e75(_0x16e1a5[_0x77b2('0x12')][_0x77b2('0x14')]);}else{logger[_0x77b2('0x15')](_0x77b2('0xe'),_0x290a03,_0x77b2('0xf'));_0xfe7e75(_0x16e1a5['result'][_0x77b2('0x14')]);}})[_0x77b2('0x16')](function(_0x30c28b){logger[_0x77b2('0x12')](_0x77b2('0xe'),_0x290a03,_0x30c28b);_0x534418(_0x30c28b);});});}exports[_0x77b2('0x17')]=function(_0x43c715){var _0x17d419=this;return new Promise(function(_0x2c5159,_0x4e7d69){return db[_0x77b2('0x18')][_0x77b2('0x19')]({'raw':_0x43c715['options']?_0x43c715[_0x77b2('0x1a')][_0x77b2('0x1b')]===undefined?!![]:![]:!![],'where':_0x43c715[_0x77b2('0x1a')]?_0x43c715[_0x77b2('0x1a')]['where']||null:null,'attributes':_0x43c715[_0x77b2('0x1a')]?_0x43c715[_0x77b2('0x1a')][_0x77b2('0x1c')]||null:null,'limit':_0x43c715['options']?_0x43c715['options'][_0x77b2('0x1d')]||null:null,'include':_0x43c715['options']?_0x43c715[_0x77b2('0x1a')][_0x77b2('0x1e')]?_['map'](_0x43c715['options']['include'],function(_0x9f69ca){return{'model':db[_0x9f69ca[_0x77b2('0x1f')]],'as':_0x9f69ca['as'],'attributes':_0x9f69ca[_0x77b2('0x1c')],'include':_0x9f69ca[_0x77b2('0x1e')]?_[_0x77b2('0x20')](_0x9f69ca[_0x77b2('0x1e')],function(_0x204d6b){return{'model':db[_0x204d6b[_0x77b2('0x1f')]],'as':_0x204d6b['as'],'attributes':_0x204d6b[_0x77b2('0x1c')],'include':_0x204d6b[_0x77b2('0x1e')]?_[_0x77b2('0x20')](_0x204d6b[_0x77b2('0x1e')],function(_0x4311df){return{'model':db[_0x4311df['model']],'as':_0x4311df['as'],'attributes':_0x4311df[_0x77b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x77b2('0xd')](function(_0x3f437c){logger['info'](_0x77b2('0x17'),_0x43c715);logger[_0x77b2('0x10')](_0x77b2('0x17'),_0x43c715,JSON[_0x77b2('0x11')](_0x3f437c));_0x2c5159(_0x3f437c);})[_0x77b2('0x16')](function(_0x40c3e1){logger[_0x77b2('0x12')](_0x77b2('0x17'),_0x40c3e1['message'],_0x43c715);_0x4e7d69(_0x17d419[_0x77b2('0x12')](0x1f4,_0x40c3e1[_0x77b2('0x14')]));});});};exports[_0x77b2('0x21')]=function(_0x569903){var _0x303639=this;return new Promise(function(_0xf4476b,_0x16b422){return db[_0x77b2('0x18')][_0x77b2('0x22')]({'raw':_0x569903[_0x77b2('0x1a')]?_0x569903['options'][_0x77b2('0x1b')]===undefined?!![]:![]:!![],'where':_0x569903['options']?_0x569903[_0x77b2('0x1a')][_0x77b2('0x23')]||null:null,'attributes':_0x569903[_0x77b2('0x1a')]?_0x569903[_0x77b2('0x1a')][_0x77b2('0x1c')]||null:null,'include':_0x569903['options']?_0x569903[_0x77b2('0x1a')]['include']?_['map'](_0x569903[_0x77b2('0x1a')][_0x77b2('0x1e')],function(_0x1981f4){return{'model':db[_0x1981f4[_0x77b2('0x1f')]],'as':_0x1981f4['as'],'attributes':_0x1981f4[_0x77b2('0x1c')],'include':_0x1981f4[_0x77b2('0x1e')]?_[_0x77b2('0x20')](_0x1981f4[_0x77b2('0x1e')],function(_0x33a52e){return{'model':db[_0x33a52e[_0x77b2('0x1f')]],'as':_0x33a52e['as'],'attributes':_0x33a52e[_0x77b2('0x1c')],'include':_0x33a52e[_0x77b2('0x1e')]?_[_0x77b2('0x20')](_0x33a52e[_0x77b2('0x1e')],function(_0xe96ad6){return{'model':db[_0xe96ad6[_0x77b2('0x1f')]],'as':_0xe96ad6['as'],'attributes':_0xe96ad6[_0x77b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x77b2('0xd')](function(_0x4da535){logger['info'](_0x77b2('0x21'),_0x569903);logger[_0x77b2('0x10')](_0x77b2('0x21'),_0x569903,JSON['stringify'](_0x4da535));_0xf4476b(_0x4da535);})[_0x77b2('0x16')](function(_0x3f4201){logger['error'](_0x77b2('0x21'),_0x3f4201['message'],_0x569903);_0x16b422(_0x303639[_0x77b2('0x12')](0x1f4,_0x3f4201['message']));});});}; \ No newline at end of file +var _0x32d2=['GetDynamics365Account','Dynamics365Account','findAll','options','raw','include','map','model','attributes','then','stringify','ShowDynamics365Account','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch'];(function(_0x3c6c1b,_0x82a1e4){var _0x15170e=function(_0x388a43){while(--_0x388a43){_0x3c6c1b['push'](_0x3c6c1b['shift']());}};_0x15170e(++_0x82a1e4);}(_0x32d2,0x70));var _0x232d=function(_0x3bad67,_0x2aab51){_0x3bad67=_0x3bad67-0x0;var _0x365723=_0x32d2[_0x3bad67];return _0x365723;};'use strict';var _=require(_0x232d('0x0'));var util=require(_0x232d('0x1'));var moment=require(_0x232d('0x2'));var BPromise=require(_0x232d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x232d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x232d('0x5'));var logger=require(_0x232d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x232d('0x7'));var client=jayson[_0x232d('0x8')][_0x232d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35efd1,_0x58628a,_0x12d6ed){return new BPromise(function(_0x11fce3,_0x57a20f){return client[_0x232d('0xa')](_0x35efd1,_0x12d6ed)['then'](function(_0x5d6864){logger[_0x232d('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x58628a,_0x232d('0xc'));logger[_0x232d('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x58628a,_0x232d('0xc'),JSON['stringify'](_0x5d6864));if(_0x5d6864[_0x232d('0xe')]){if(_0x5d6864[_0x232d('0xe')][_0x232d('0xf')]===0x1f4){logger['error'](_0x232d('0x10'),_0x58628a,_0x5d6864[_0x232d('0xe')][_0x232d('0x11')]);return _0x57a20f(_0x5d6864['error'][_0x232d('0x11')]);}logger[_0x232d('0xe')](_0x232d('0x10'),_0x58628a,_0x5d6864[_0x232d('0xe')][_0x232d('0x11')]);return _0x11fce3(_0x5d6864[_0x232d('0xe')][_0x232d('0x11')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x58628a,'request\x20sent');_0x11fce3(_0x5d6864[_0x232d('0x12')][_0x232d('0x11')]);}})[_0x232d('0x13')](function(_0x58a018){logger[_0x232d('0xe')](_0x232d('0x10'),_0x58628a,_0x58a018);_0x57a20f(_0x58a018);});});}exports[_0x232d('0x14')]=function(_0x1ee9d1){var _0xfc22b8=this;return new Promise(function(_0xd2dbc2,_0x218a31){return db[_0x232d('0x15')][_0x232d('0x16')]({'raw':_0x1ee9d1[_0x232d('0x17')]?_0x1ee9d1[_0x232d('0x17')][_0x232d('0x18')]===undefined?!![]:![]:!![],'where':_0x1ee9d1[_0x232d('0x17')]?_0x1ee9d1[_0x232d('0x17')]['where']||null:null,'attributes':_0x1ee9d1[_0x232d('0x17')]?_0x1ee9d1[_0x232d('0x17')]['attributes']||null:null,'limit':_0x1ee9d1[_0x232d('0x17')]?_0x1ee9d1[_0x232d('0x17')]['limit']||null:null,'include':_0x1ee9d1[_0x232d('0x17')]?_0x1ee9d1[_0x232d('0x17')][_0x232d('0x19')]?_[_0x232d('0x1a')](_0x1ee9d1[_0x232d('0x17')][_0x232d('0x19')],function(_0x557c65){return{'model':db[_0x557c65[_0x232d('0x1b')]],'as':_0x557c65['as'],'attributes':_0x557c65[_0x232d('0x1c')],'include':_0x557c65['include']?_[_0x232d('0x1a')](_0x557c65[_0x232d('0x19')],function(_0xc276c0){return{'model':db[_0xc276c0['model']],'as':_0xc276c0['as'],'attributes':_0xc276c0[_0x232d('0x1c')],'include':_0xc276c0['include']?_[_0x232d('0x1a')](_0xc276c0[_0x232d('0x19')],function(_0x5dadab){return{'model':db[_0x5dadab[_0x232d('0x1b')]],'as':_0x5dadab['as'],'attributes':_0x5dadab[_0x232d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x232d('0x1d')](function(_0x39b7de){logger[_0x232d('0xb')](_0x232d('0x14'),_0x1ee9d1);logger[_0x232d('0xd')](_0x232d('0x14'),_0x1ee9d1,JSON[_0x232d('0x1e')](_0x39b7de));_0xd2dbc2(_0x39b7de);})[_0x232d('0x13')](function(_0x362708){logger[_0x232d('0xe')](_0x232d('0x14'),_0x362708[_0x232d('0x11')],_0x1ee9d1);_0x218a31(_0xfc22b8[_0x232d('0xe')](0x1f4,_0x362708[_0x232d('0x11')]));});});};exports[_0x232d('0x1f')]=function(_0x5c8e6d){var _0x3f6059=this;return new Promise(function(_0x1f5802,_0x1f1ca1){return db[_0x232d('0x15')][_0x232d('0x20')]({'raw':_0x5c8e6d[_0x232d('0x17')]?_0x5c8e6d['options'][_0x232d('0x18')]===undefined?!![]:![]:!![],'where':_0x5c8e6d[_0x232d('0x17')]?_0x5c8e6d[_0x232d('0x17')]['where']||null:null,'attributes':_0x5c8e6d[_0x232d('0x17')]?_0x5c8e6d['options']['attributes']||null:null,'include':_0x5c8e6d[_0x232d('0x17')]?_0x5c8e6d[_0x232d('0x17')]['include']?_[_0x232d('0x1a')](_0x5c8e6d[_0x232d('0x17')][_0x232d('0x19')],function(_0x32136d){return{'model':db[_0x32136d[_0x232d('0x1b')]],'as':_0x32136d['as'],'attributes':_0x32136d[_0x232d('0x1c')],'include':_0x32136d[_0x232d('0x19')]?_[_0x232d('0x1a')](_0x32136d['include'],function(_0x9b33c){return{'model':db[_0x9b33c[_0x232d('0x1b')]],'as':_0x9b33c['as'],'attributes':_0x9b33c['attributes'],'include':_0x9b33c['include']?_[_0x232d('0x1a')](_0x9b33c['include'],function(_0x2ce803){return{'model':db[_0x2ce803[_0x232d('0x1b')]],'as':_0x2ce803['as'],'attributes':_0x2ce803[_0x232d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x232d('0x1d')](function(_0x38cbba){logger['info']('ShowDynamics365Account',_0x5c8e6d);logger[_0x232d('0xd')](_0x232d('0x1f'),_0x5c8e6d,JSON['stringify'](_0x38cbba));_0x1f5802(_0x38cbba);})[_0x232d('0x13')](function(_0x2e7fcf){logger['error'](_0x232d('0x1f'),_0x2e7fcf[_0x232d('0x11')],_0x5c8e6d);_0x1f1ca1(_0x3f6059[_0x232d('0xe')](0x1f4,_0x2e7fcf['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 6f5974e..c8b66a9 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 _0x354b=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','put','update','delete','destroy'];(function(_0xdab14e,_0x1169ea){var _0x54cf05=function(_0x15f419){while(--_0x15f419){_0xdab14e['push'](_0xdab14e['shift']());}};_0x54cf05(++_0x1169ea);}(_0x354b,0x85));var _0xb354=function(_0x1fb94f,_0x2812e7){_0x1fb94f=_0x1fb94f-0x0;var _0x2a1bd0=_0x354b[_0x1fb94f];return _0x2a1bd0;};'use strict';var multer=require(_0xb354('0x0'));var util=require(_0xb354('0x1'));var path=require(_0xb354('0x2'));var timeout=require(_0xb354('0x3'));var express=require(_0xb354('0x4'));var router=express[_0xb354('0x5')]();var fs_extra=require(_0xb354('0x6'));var auth=require(_0xb354('0x7'));var interaction=require(_0xb354('0x8'));var config=require(_0xb354('0x9'));var controller=require('./intDynamics365Configuration.controller');router[_0xb354('0xa')]('/',auth['isAuthenticated'](),controller[_0xb354('0xb')]);router[_0xb354('0xa')](_0xb354('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb354('0xa')]('/:id/fields',auth[_0xb354('0xd')](),controller['getFields']);router[_0xb354('0xa')](_0xb354('0xe'),auth[_0xb354('0xd')](),controller[_0xb354('0xf')]);router[_0xb354('0xa')](_0xb354('0x10'),auth[_0xb354('0xd')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb354('0x11')](_0xb354('0xc'),auth[_0xb354('0xd')](),controller[_0xb354('0x12')]);router[_0xb354('0x13')](_0xb354('0xc'),auth[_0xb354('0xd')](),controller[_0xb354('0x14')]);module[_0xb354('0x15')]=router; \ No newline at end of file +var _0xd26f=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd26f,0x113));var _0xfd26=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xd26f[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfd26('0x2'));var router=express[_0xfd26('0x3')]();var fs_extra=require(_0xfd26('0x4'));var auth=require(_0xfd26('0x5'));var interaction=require(_0xfd26('0x6'));var config=require(_0xfd26('0x7'));var controller=require(_0xfd26('0x8'));router[_0xfd26('0x9')]('/',auth[_0xfd26('0xa')](),controller['index']);router[_0xfd26('0x9')](_0xfd26('0xb'),auth[_0xfd26('0xa')](),controller[_0xfd26('0xc')]);router[_0xfd26('0x9')](_0xfd26('0xd'),auth['isAuthenticated'](),controller[_0xfd26('0xe')]);router[_0xfd26('0x9')](_0xfd26('0xf'),auth[_0xfd26('0xa')](),controller[_0xfd26('0x10')]);router[_0xfd26('0x9')]('/:id/descriptions',auth[_0xfd26('0xa')](),controller['getDescriptions']);router[_0xfd26('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfd26('0x12')]);router[_0xfd26('0x13')](_0xfd26('0xb'),auth[_0xfd26('0xa')](),controller[_0xfd26('0x14')]);module[_0xfd26('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index ae51eda..2861f98 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 _0x6d70=['ENUM','phonecall','contact','nothing','sequelize','exports','STRING'];(function(_0x276b00,_0x44db9e){var _0x57e9c6=function(_0x53e96c){while(--_0x53e96c){_0x276b00['push'](_0x276b00['shift']());}};_0x57e9c6(++_0x44db9e);}(_0x6d70,0x1d2));var _0x06d7=function(_0x1a19b1,_0x4dfc08){_0x1a19b1=_0x1a19b1-0x0;var _0x5d764a=_0x6d70[_0x1a19b1];return _0x5d764a;};'use strict';var Sequelize=require(_0x06d7('0x0'));module[_0x06d7('0x1')]={'name':{'type':Sequelize[_0x06d7('0x2')]},'description':{'type':Sequelize[_0x06d7('0x2')]},'ticketType':{'type':Sequelize[_0x06d7('0x3')]('incident',_0x06d7('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x06d7('0x3')](_0x06d7('0x5'),_0x06d7('0x6')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0xea41=['contact','sequelize','STRING','ENUM','incident','phonecall','nothing'];(function(_0x5ad85a,_0x5bdc6d){var _0x6eeeb5=function(_0x3a4f86){while(--_0x3a4f86){_0x5ad85a['push'](_0x5ad85a['shift']());}};_0x6eeeb5(++_0x5bdc6d);}(_0xea41,0xbe));var _0x1ea4=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xea41[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0x1ea4('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ea4('0x1')]},'description':{'type':Sequelize[_0x1ea4('0x1')]},'ticketType':{'type':Sequelize[_0x1ea4('0x2')](_0x1ea4('0x3'),_0x1ea4('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x1ea4('0x2')]('contact',_0x1ea4('0x5')),'defaultValue':_0x1ea4('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 0e2e84c..d9fb03d 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 _0x73c9=['path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','Dynamics365Configuration','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','includeAll','include','catch','show','params','keys','length','create','body','destroy','findOne','Dynamics365Field','rawAttributes','getFields','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x73c9,0x1c8));var _0x973c=function(_0x52347e,_0x53106e){_0x52347e=_0x52347e-0x0;var _0x2f9d75=_0x73c9[_0x52347e];return _0x2f9d75;};'use strict';var emlformat=require(_0x973c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x973c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x973c('0x2'));var moment=require(_0x973c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x973c('0x4'));var util=require(_0x973c('0x5'));var path=require(_0x973c('0x6'));var sox=require('sox');var csv=require(_0x973c('0x7'));var ejs=require(_0x973c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x973c('0x9'));var squel=require(_0x973c('0xa'));var crypto=require(_0x973c('0xb'));var jsforce=require(_0x973c('0xc'));var deskjs=require(_0x973c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x973c('0xe'));var Papa=require(_0x973c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x973c('0x10'));var as=require(_0x973c('0x11'));var hardwareService=require(_0x973c('0x12'));var logger=require(_0x973c('0x13'))('api');var utils=require(_0x973c('0x14'));var config=require(_0x973c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x973c('0x16'))['db'];function respondWithStatusCode(_0x242fd3,_0x1f93f8){_0x1f93f8=_0x1f93f8||0xcc;return function(_0x4289f2){if(_0x4289f2){return _0x242fd3[_0x973c('0x17')](_0x1f93f8);}return _0x242fd3[_0x973c('0x18')](_0x1f93f8)['end']();};}function respondWithResult(_0x21117f,_0x5800cb){_0x5800cb=_0x5800cb||0xc8;return function(_0x4f1200){if(_0x4f1200){return _0x21117f[_0x973c('0x18')](_0x5800cb)[_0x973c('0x19')](_0x4f1200);}};}function respondWithFilteredResult(_0x3aeeff,_0x1d807c){return function(_0x430680){if(_0x430680){var _0x33a63c=typeof _0x1d807c[_0x973c('0x1a')]===_0x973c('0x1b')&&typeof _0x1d807c[_0x973c('0x1c')]==='undefined';var _0x52b226=_0x430680['count'];var _0x594cc9=_0x33a63c?0x0:_0x1d807c[_0x973c('0x1a')];var _0xd70c3c=_0x33a63c?_0x430680['count']:_0x1d807c[_0x973c('0x1a')]+_0x1d807c[_0x973c('0x1c')];var _0x547a86;if(_0xd70c3c>=_0x52b226){_0xd70c3c=_0x52b226;_0x547a86=0xc8;}else{_0x547a86=0xce;}_0x3aeeff[_0x973c('0x18')](_0x547a86);return _0x3aeeff[_0x973c('0x1d')]('Content-Range',_0x594cc9+'-'+_0xd70c3c+'/'+_0x52b226)[_0x973c('0x19')](_0x430680);}return null;};}function patchUpdates(_0x55ba87){return function(_0x217c74){try{jsonpatch[_0x973c('0x1e')](_0x217c74,_0x55ba87,!![]);}catch(_0x56ce9a){return BPromise[_0x973c('0x1f')](_0x56ce9a);}return _0x217c74[_0x973c('0x20')]();};}function saveUpdates(_0x4053ab,_0x19d9dc){return function(_0x10ed9c){if(_0x10ed9c){return _0x10ed9c[_0x973c('0x21')](_0x4053ab)[_0x973c('0x22')](function(_0x4e7cc1){return _0x4e7cc1;});}return null;};}function removeEntity(_0x1efaa0,_0x515323){return function(_0x1ba1a6){if(_0x1ba1a6){return _0x1ba1a6['destroy']()[_0x973c('0x22')](function(){_0x1efaa0['status'](0xcc)[_0x973c('0x23')]();});}};}function handleEntityNotFound(_0x4e7d6b,_0x4d314b){return function(_0x1f29ff){if(!_0x1f29ff){_0x4e7d6b[_0x973c('0x17')](0x194);}return _0x1f29ff;};}function handleError(_0x43c7e5,_0x373370){_0x373370=_0x373370||0x1f4;return function(_0x3f0646){logger[_0x973c('0x24')](_0x3f0646[_0x973c('0x25')]);if(_0x3f0646[_0x973c('0x26')]){delete _0x3f0646['name'];}_0x43c7e5['status'](_0x373370)[_0x973c('0x27')](_0x3f0646);};}exports[_0x973c('0x28')]=function(_0x516876,_0x60c5df){var _0x56803c={},_0x39fa4f={},_0xc2782a={'count':0x0,'rows':[]};var _0x48f501=_[_0x973c('0x29')](db[_0x973c('0x2a')]['rawAttributes'],function(_0x305efd){return{'name':_0x305efd['fieldName'],'type':_0x305efd['type'][_0x973c('0x2b')]};});_0x39fa4f[_0x973c('0x2c')]=_[_0x973c('0x29')](_0x48f501,_0x973c('0x26'));_0x39fa4f[_0x973c('0x2d')]=_['keys'](_0x516876[_0x973c('0x2d')]);_0x39fa4f[_0x973c('0x2e')]=_['intersection'](_0x39fa4f[_0x973c('0x2c')],_0x39fa4f[_0x973c('0x2d')]);_0x56803c[_0x973c('0x2f')]=_[_0x973c('0x30')](_0x39fa4f['model'],qs[_0x973c('0x31')](_0x516876[_0x973c('0x2d')][_0x973c('0x31')]));_0x56803c[_0x973c('0x2f')]=_0x56803c['attributes']['length']?_0x56803c[_0x973c('0x2f')]:_0x39fa4f[_0x973c('0x2c')];if(!_0x516876[_0x973c('0x2d')][_0x973c('0x32')](_0x973c('0x33'))){_0x56803c[_0x973c('0x1c')]=qs[_0x973c('0x1c')](_0x516876[_0x973c('0x2d')]['limit']);_0x56803c[_0x973c('0x1a')]=qs[_0x973c('0x1a')](_0x516876[_0x973c('0x2d')][_0x973c('0x1a')]);}_0x56803c[_0x973c('0x34')]=qs[_0x973c('0x35')](_0x516876[_0x973c('0x2d')][_0x973c('0x35')]);_0x56803c[_0x973c('0x36')]=qs[_0x973c('0x2e')](_[_0x973c('0x37')](_0x516876[_0x973c('0x2d')],_0x39fa4f['filters']),_0x48f501);if(_0x516876['query'][_0x973c('0x38')]){_0x56803c[_0x973c('0x36')]=_[_0x973c('0x39')](_0x56803c[_0x973c('0x36')],{'$or':_[_0x973c('0x29')](_0x48f501,function(_0x11ca14){if(_0x11ca14[_0x973c('0x3a')]!=='VIRTUAL'){var _0x20f27d={};_0x20f27d[_0x11ca14[_0x973c('0x26')]]={'$like':'%'+_0x516876[_0x973c('0x2d')][_0x973c('0x38')]+'%'};return _0x20f27d;}})});}_0x56803c=_['merge']({},_0x56803c,_0x516876[_0x973c('0x3b')]);var _0x262cdc={'where':_0x56803c[_0x973c('0x36')]};return db[_0x973c('0x2a')][_0x973c('0x3c')](_0x262cdc)['then'](function(_0x3acc71){_0xc2782a['count']=_0x3acc71;if(_0x516876[_0x973c('0x2d')][_0x973c('0x3d')]){_0x56803c[_0x973c('0x3e')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x56803c);})[_0x973c('0x22')](function(_0x509bef){_0xc2782a['rows']=_0x509bef;return _0xc2782a;})[_0x973c('0x22')](respondWithFilteredResult(_0x60c5df,_0x56803c))[_0x973c('0x3f')](handleError(_0x60c5df,null));};exports[_0x973c('0x40')]=function(_0x5088e2,_0x3ec8ca){var _0x1cc662={'raw':![],'where':{'id':_0x5088e2[_0x973c('0x41')]['id']}},_0x344ca8={};_0x344ca8['model']=_[_0x973c('0x42')](db['Dynamics365Configuration']['rawAttributes']);_0x344ca8[_0x973c('0x2d')]=_['keys'](_0x5088e2[_0x973c('0x2d')]);_0x344ca8['filters']=_[_0x973c('0x30')](_0x344ca8[_0x973c('0x2c')],_0x344ca8[_0x973c('0x2d')]);_0x1cc662[_0x973c('0x2f')]=_[_0x973c('0x30')](_0x344ca8['model'],qs[_0x973c('0x31')](_0x5088e2[_0x973c('0x2d')][_0x973c('0x31')]));_0x1cc662['attributes']=_0x1cc662[_0x973c('0x2f')][_0x973c('0x43')]?_0x1cc662[_0x973c('0x2f')]:_0x344ca8[_0x973c('0x2c')];if(_0x5088e2['query'][_0x973c('0x3d')]){_0x1cc662[_0x973c('0x3e')]=[{'all':!![]}];}_0x1cc662=_[_0x973c('0x39')]({},_0x1cc662,_0x5088e2[_0x973c('0x3b')]);return db[_0x973c('0x2a')]['find'](_0x1cc662)[_0x973c('0x22')](handleEntityNotFound(_0x3ec8ca,null))[_0x973c('0x22')](respondWithResult(_0x3ec8ca,null))[_0x973c('0x3f')](handleError(_0x3ec8ca,null));};exports['create']=function(_0x358268,_0x2d4439){return db['Dynamics365Configuration'][_0x973c('0x44')](_0x358268[_0x973c('0x45')],{})[_0x973c('0x22')](respondWithResult(_0x2d4439,0xc9))['catch'](handleError(_0x2d4439,null));};exports['update']=function(_0x2b9983,_0x53535b){if(_0x2b9983[_0x973c('0x45')]['id']){delete _0x2b9983[_0x973c('0x45')]['id'];}return db[_0x973c('0x2a')]['find']({'where':{'id':_0x2b9983[_0x973c('0x41')]['id']}})[_0x973c('0x22')](handleEntityNotFound(_0x53535b,null))['then'](saveUpdates(_0x2b9983[_0x973c('0x45')],null))[_0x973c('0x22')](respondWithResult(_0x53535b,null))[_0x973c('0x3f')](handleError(_0x53535b,null));};exports[_0x973c('0x46')]=function(_0x3cf5b9,_0x360b77){return db['Dynamics365Configuration']['find']({'where':{'id':_0x3cf5b9[_0x973c('0x41')]['id']}})[_0x973c('0x22')](handleEntityNotFound(_0x360b77,null))[_0x973c('0x22')](removeEntity(_0x360b77,null))[_0x973c('0x3f')](handleError(_0x360b77,null));};exports['getFields']=function(_0x1f1f9c,_0x50f4b1,_0x59a576){var _0x4febf2={};var _0x195bd2={};var _0x42bcda;var _0x163637;return db['Dynamics365Configuration'][_0x973c('0x47')]({'where':{'id':_0x1f1f9c['params']['id']}})[_0x973c('0x22')](handleEntityNotFound(_0x50f4b1,null))[_0x973c('0x22')](function(_0x2d2da7){if(_0x2d2da7){_0x42bcda=_0x2d2da7;_0x195bd2['model']=_[_0x973c('0x42')](db[_0x973c('0x48')][_0x973c('0x49')]);_0x195bd2[_0x973c('0x2d')]=_[_0x973c('0x42')](_0x1f1f9c[_0x973c('0x2d')]);_0x195bd2[_0x973c('0x2e')]=_[_0x973c('0x30')](_0x195bd2[_0x973c('0x2c')],_0x195bd2[_0x973c('0x2d')]);_0x4febf2['attributes']=_['intersection'](_0x195bd2['model'],qs[_0x973c('0x31')](_0x1f1f9c[_0x973c('0x2d')][_0x973c('0x31')]));_0x4febf2[_0x973c('0x2f')]=_0x4febf2['attributes'][_0x973c('0x43')]?_0x4febf2[_0x973c('0x2f')]:_0x195bd2[_0x973c('0x2c')];_0x4febf2[_0x973c('0x34')]=qs['sort'](_0x1f1f9c[_0x973c('0x2d')][_0x973c('0x35')]);_0x4febf2['where']=qs[_0x973c('0x2e')](_['pick'](_0x1f1f9c[_0x973c('0x2d')],_0x195bd2[_0x973c('0x2e')]));if(_0x1f1f9c[_0x973c('0x2d')]['filter']){_0x4febf2[_0x973c('0x36')]=_[_0x973c('0x39')](_0x4febf2['where'],{'$or':_[_0x973c('0x29')](_0x4febf2[_0x973c('0x2f')],function(_0x233601){var _0x10753a={};_0x10753a[_0x233601]={'$like':'%'+_0x1f1f9c['query']['filter']+'%'};return _0x10753a;})});}_0x4febf2=_[_0x973c('0x39')]({},_0x4febf2,_0x1f1f9c['options']);return _0x42bcda[_0x973c('0x4a')](_0x4febf2);}})['then'](function(_0x356fb6){if(_0x356fb6){_0x163637=_0x356fb6[_0x973c('0x43')];if(!_0x1f1f9c[_0x973c('0x2d')][_0x973c('0x32')](_0x973c('0x33'))){_0x4febf2[_0x973c('0x1c')]=qs['limit'](_0x1f1f9c[_0x973c('0x2d')][_0x973c('0x1c')]);_0x4febf2[_0x973c('0x1a')]=qs['offset'](_0x1f1f9c[_0x973c('0x2d')]['offset']);}return _0x42bcda[_0x973c('0x4a')](_0x4febf2);}})[_0x973c('0x22')](function(_0x453d53){if(_0x453d53){return _0x453d53?{'count':_0x163637,'rows':_0x453d53}:null;}})[_0x973c('0x22')](respondWithResult(_0x50f4b1,null))['catch'](handleError(_0x50f4b1,null));};exports['getSubjects']=function(_0x31fa18,_0x3dd980,_0x578094){var _0xcbce39={};var _0x21a19c={};var _0x50f32a;var _0x294d02;return db[_0x973c('0x2a')][_0x973c('0x47')]({'where':{'id':_0x31fa18['params']['id']}})[_0x973c('0x22')](handleEntityNotFound(_0x3dd980,null))[_0x973c('0x22')](function(_0x6efb6d){if(_0x6efb6d){_0x50f32a=_0x6efb6d;_0x21a19c[_0x973c('0x2c')]=_[_0x973c('0x42')](db[_0x973c('0x48')][_0x973c('0x49')]);_0x21a19c[_0x973c('0x2d')]=_[_0x973c('0x42')](_0x31fa18['query']);_0x21a19c['filters']=_[_0x973c('0x30')](_0x21a19c[_0x973c('0x2c')],_0x21a19c[_0x973c('0x2d')]);_0xcbce39['attributes']=_['intersection'](_0x21a19c[_0x973c('0x2c')],qs['fields'](_0x31fa18[_0x973c('0x2d')][_0x973c('0x31')]));_0xcbce39[_0x973c('0x2f')]=_0xcbce39[_0x973c('0x2f')][_0x973c('0x43')]?_0xcbce39[_0x973c('0x2f')]:_0x21a19c[_0x973c('0x2c')];_0xcbce39[_0x973c('0x34')]=qs[_0x973c('0x35')](_0x31fa18['query'][_0x973c('0x35')]);_0xcbce39[_0x973c('0x36')]=qs[_0x973c('0x2e')](_[_0x973c('0x37')](_0x31fa18[_0x973c('0x2d')],_0x21a19c[_0x973c('0x2e')]));if(_0x31fa18[_0x973c('0x2d')]['filter']){_0xcbce39[_0x973c('0x36')]=_['merge'](_0xcbce39[_0x973c('0x36')],{'$or':_['map'](_0xcbce39[_0x973c('0x2f')],function(_0x30db03){var _0x17f82c={};_0x17f82c[_0x30db03]={'$like':'%'+_0x31fa18[_0x973c('0x2d')]['filter']+'%'};return _0x17f82c;})});}_0xcbce39=_['merge']({},_0xcbce39,_0x31fa18[_0x973c('0x3b')]);return _0x50f32a[_0x973c('0x4b')](_0xcbce39);}})['then'](function(_0x2d0e35){if(_0x2d0e35){_0x294d02=_0x2d0e35[_0x973c('0x43')];if(!_0x31fa18[_0x973c('0x2d')][_0x973c('0x32')](_0x973c('0x33'))){_0xcbce39[_0x973c('0x1c')]=qs[_0x973c('0x1c')](_0x31fa18[_0x973c('0x2d')][_0x973c('0x1c')]);_0xcbce39[_0x973c('0x1a')]=qs['offset'](_0x31fa18[_0x973c('0x2d')][_0x973c('0x1a')]);}return _0x50f32a[_0x973c('0x4b')](_0xcbce39);}})[_0x973c('0x22')](function(_0x43dd52){if(_0x43dd52){return _0x43dd52?{'count':_0x294d02,'rows':_0x43dd52}:null;}})['then'](respondWithResult(_0x3dd980,null))[_0x973c('0x3f')](handleError(_0x3dd980,null));};exports[_0x973c('0x4c')]=function(_0x4a9c23,_0xc81e32,_0x3a1ca5){var _0xe58164={};var _0x56fb28={};var _0x42d1dc;var _0x5541d9;return db[_0x973c('0x2a')][_0x973c('0x47')]({'where':{'id':_0x4a9c23[_0x973c('0x41')]['id']}})[_0x973c('0x22')](handleEntityNotFound(_0xc81e32,null))[_0x973c('0x22')](function(_0x2d9f7a){if(_0x2d9f7a){_0x42d1dc=_0x2d9f7a;_0x56fb28[_0x973c('0x2c')]=_[_0x973c('0x42')](db['Dynamics365Field'][_0x973c('0x49')]);_0x56fb28['query']=_[_0x973c('0x42')](_0x4a9c23[_0x973c('0x2d')]);_0x56fb28['filters']=_[_0x973c('0x30')](_0x56fb28[_0x973c('0x2c')],_0x56fb28[_0x973c('0x2d')]);_0xe58164[_0x973c('0x2f')]=_[_0x973c('0x30')](_0x56fb28[_0x973c('0x2c')],qs[_0x973c('0x31')](_0x4a9c23[_0x973c('0x2d')][_0x973c('0x31')]));_0xe58164[_0x973c('0x2f')]=_0xe58164[_0x973c('0x2f')][_0x973c('0x43')]?_0xe58164[_0x973c('0x2f')]:_0x56fb28[_0x973c('0x2c')];_0xe58164[_0x973c('0x34')]=qs[_0x973c('0x35')](_0x4a9c23[_0x973c('0x2d')][_0x973c('0x35')]);_0xe58164['where']=qs[_0x973c('0x2e')](_[_0x973c('0x37')](_0x4a9c23[_0x973c('0x2d')],_0x56fb28['filters']));if(_0x4a9c23[_0x973c('0x2d')][_0x973c('0x38')]){_0xe58164[_0x973c('0x36')]=_[_0x973c('0x39')](_0xe58164[_0x973c('0x36')],{'$or':_['map'](_0xe58164[_0x973c('0x2f')],function(_0x2c241f){var _0x260ca2={};_0x260ca2[_0x2c241f]={'$like':'%'+_0x4a9c23[_0x973c('0x2d')][_0x973c('0x38')]+'%'};return _0x260ca2;})});}_0xe58164=_['merge']({},_0xe58164,_0x4a9c23[_0x973c('0x3b')]);return _0x42d1dc[_0x973c('0x4c')](_0xe58164);}})[_0x973c('0x22')](function(_0x5f1553){if(_0x5f1553){_0x5541d9=_0x5f1553['length'];if(!_0x4a9c23[_0x973c('0x2d')][_0x973c('0x32')](_0x973c('0x33'))){_0xe58164['limit']=qs['limit'](_0x4a9c23['query'][_0x973c('0x1c')]);_0xe58164[_0x973c('0x1a')]=qs[_0x973c('0x1a')](_0x4a9c23['query'][_0x973c('0x1a')]);}return _0x42d1dc['getDescriptions'](_0xe58164);}})[_0x973c('0x22')](function(_0x834b64){if(_0x834b64){return _0x834b64?{'count':_0x5541d9,'rows':_0x834b64}:null;}})[_0x973c('0x22')](respondWithResult(_0xc81e32,null))[_0x973c('0x3f')](handleError(_0xc81e32,null));}; \ No newline at end of file +var _0xc789=['keys','query','filters','intersection','model','fields','attributes','length','limit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','Dynamics365Configuration','options','find','create','body','update','findOne','Dynamics365Field','order','sort','hasOwnProperty','nolimit','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','error','stack','name','map','rawAttributes','type'];(function(_0x7aa2f6,_0x18264f){var _0x90bb11=function(_0x50d3ad){while(--_0x50d3ad){_0x7aa2f6['push'](_0x7aa2f6['shift']());}};_0x90bb11(++_0x18264f);}(_0xc789,0x6f));var _0x9c78=function(_0x18ae11,_0x191be0){_0x18ae11=_0x18ae11-0x0;var _0x302cf3=_0xc789[_0x18ae11];return _0x302cf3;};'use strict';var emlformat=require(_0x9c78('0x0'));var rimraf=require(_0x9c78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c78('0x2'));var rp=require(_0x9c78('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9c78('0x4'));var util=require('util');var path=require(_0x9c78('0x5'));var sox=require(_0x9c78('0x6'));var csv=require(_0x9c78('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c78('0x8'));var _=require('lodash');var squel=require(_0x9c78('0x9'));var crypto=require(_0x9c78('0xa'));var jsforce=require(_0x9c78('0xb'));var deskjs=require(_0x9c78('0xc'));var toCsv=require(_0x9c78('0x7'));var querystring=require('querystring');var Papa=require(_0x9c78('0xd'));var Redis=require(_0x9c78('0xe'));var authService=require(_0x9c78('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9c78('0x10'));var hardwareService=require(_0x9c78('0x11'));var logger=require(_0x9c78('0x12'))(_0x9c78('0x13'));var utils=require(_0x9c78('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d8772,_0x551176){_0x551176=_0x551176||0xcc;return function(_0x190314){if(_0x190314){return _0x1d8772[_0x9c78('0x15')](_0x551176);}return _0x1d8772[_0x9c78('0x16')](_0x551176)[_0x9c78('0x17')]();};}function respondWithResult(_0x468d1b,_0x5e64c9){_0x5e64c9=_0x5e64c9||0xc8;return function(_0x86b4a5){if(_0x86b4a5){return _0x468d1b[_0x9c78('0x16')](_0x5e64c9)[_0x9c78('0x18')](_0x86b4a5);}};}function respondWithFilteredResult(_0x249dd5,_0x286bab){return function(_0x1fa418){if(_0x1fa418){var _0x5f4296=typeof _0x286bab[_0x9c78('0x19')]===_0x9c78('0x1a')&&typeof _0x286bab['limit']===_0x9c78('0x1a');var _0xcb36d4=_0x1fa418[_0x9c78('0x1b')];var _0x3836c5=_0x5f4296?0x0:_0x286bab[_0x9c78('0x19')];var _0x1cc10f=_0x5f4296?_0x1fa418['count']:_0x286bab['offset']+_0x286bab['limit'];var _0x1d791f;if(_0x1cc10f>=_0xcb36d4){_0x1cc10f=_0xcb36d4;_0x1d791f=0xc8;}else{_0x1d791f=0xce;}_0x249dd5[_0x9c78('0x16')](_0x1d791f);return _0x249dd5['set'](_0x9c78('0x1c'),_0x3836c5+'-'+_0x1cc10f+'/'+_0xcb36d4)[_0x9c78('0x18')](_0x1fa418);}return null;};}function patchUpdates(_0x73af11){return function(_0x4c8184){try{jsonpatch[_0x9c78('0x1d')](_0x4c8184,_0x73af11,!![]);}catch(_0x5a8f51){return BPromise['reject'](_0x5a8f51);}return _0x4c8184[_0x9c78('0x1e')]();};}function saveUpdates(_0xdbcd6,_0x4c3607){return function(_0x53d3ce){if(_0x53d3ce){return _0x53d3ce['update'](_0xdbcd6)[_0x9c78('0x1f')](function(_0x6ab326){return _0x6ab326;});}return null;};}function removeEntity(_0x5d16bd,_0x35bfd9){return function(_0x3c30b8){if(_0x3c30b8){return _0x3c30b8[_0x9c78('0x20')]()['then'](function(){_0x5d16bd[_0x9c78('0x16')](0xcc)[_0x9c78('0x17')]();});}};}function handleEntityNotFound(_0x1e2e33,_0x5d4937){return function(_0x5d33c0){if(!_0x5d33c0){_0x1e2e33[_0x9c78('0x15')](0x194);}return _0x5d33c0;};}function handleError(_0x4aaaf4,_0x1cf7fa){_0x1cf7fa=_0x1cf7fa||0x1f4;return function(_0x5a4fda){logger[_0x9c78('0x21')](_0x5a4fda[_0x9c78('0x22')]);if(_0x5a4fda[_0x9c78('0x23')]){delete _0x5a4fda[_0x9c78('0x23')];}_0x4aaaf4[_0x9c78('0x16')](_0x1cf7fa)['send'](_0x5a4fda);};}exports['index']=function(_0x59ad99,_0x171652){var _0x42a8b3={},_0x14892e={},_0x3500ba={'count':0x0,'rows':[]};var _0x577467=_[_0x9c78('0x24')](db['Dynamics365Configuration'][_0x9c78('0x25')],function(_0x3d270e){return{'name':_0x3d270e['fieldName'],'type':_0x3d270e[_0x9c78('0x26')]['key']};});_0x14892e['model']=_['map'](_0x577467,_0x9c78('0x23'));_0x14892e['query']=_[_0x9c78('0x27')](_0x59ad99[_0x9c78('0x28')]);_0x14892e[_0x9c78('0x29')]=_[_0x9c78('0x2a')](_0x14892e['model'],_0x14892e[_0x9c78('0x28')]);_0x42a8b3['attributes']=_['intersection'](_0x14892e[_0x9c78('0x2b')],qs[_0x9c78('0x2c')](_0x59ad99[_0x9c78('0x28')][_0x9c78('0x2c')]));_0x42a8b3[_0x9c78('0x2d')]=_0x42a8b3[_0x9c78('0x2d')][_0x9c78('0x2e')]?_0x42a8b3[_0x9c78('0x2d')]:_0x14892e[_0x9c78('0x2b')];if(!_0x59ad99[_0x9c78('0x28')]['hasOwnProperty']('nolimit')){_0x42a8b3[_0x9c78('0x2f')]=qs[_0x9c78('0x2f')](_0x59ad99[_0x9c78('0x28')][_0x9c78('0x2f')]);_0x42a8b3[_0x9c78('0x19')]=qs[_0x9c78('0x19')](_0x59ad99['query'][_0x9c78('0x19')]);}_0x42a8b3['order']=qs['sort'](_0x59ad99['query']['sort']);_0x42a8b3[_0x9c78('0x30')]=qs['filters'](_[_0x9c78('0x31')](_0x59ad99[_0x9c78('0x28')],_0x14892e[_0x9c78('0x29')]),_0x577467);if(_0x59ad99['query'][_0x9c78('0x32')]){_0x42a8b3[_0x9c78('0x30')]=_[_0x9c78('0x33')](_0x42a8b3[_0x9c78('0x30')],{'$or':_[_0x9c78('0x24')](_0x577467,function(_0x4bfb59){if(_0x4bfb59['type']!==_0x9c78('0x34')){var _0x10e2f8={};_0x10e2f8[_0x4bfb59[_0x9c78('0x23')]]={'$like':'%'+_0x59ad99[_0x9c78('0x28')]['filter']+'%'};return _0x10e2f8;}})});}_0x42a8b3=_[_0x9c78('0x33')]({},_0x42a8b3,_0x59ad99['options']);var _0x291930={'where':_0x42a8b3['where']};return db['Dynamics365Configuration']['count'](_0x291930)[_0x9c78('0x1f')](function(_0x18cfcb){_0x3500ba[_0x9c78('0x1b')]=_0x18cfcb;if(_0x59ad99[_0x9c78('0x28')][_0x9c78('0x35')]){_0x42a8b3[_0x9c78('0x36')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x9c78('0x37')](_0x42a8b3);})[_0x9c78('0x1f')](function(_0x4714e1){_0x3500ba[_0x9c78('0x38')]=_0x4714e1;return _0x3500ba;})[_0x9c78('0x1f')](respondWithFilteredResult(_0x171652,_0x42a8b3))[_0x9c78('0x39')](handleError(_0x171652,null));};exports[_0x9c78('0x3a')]=function(_0x494c43,_0x1ade58){var _0x1d6c5a={'raw':![],'where':{'id':_0x494c43[_0x9c78('0x3b')]['id']}},_0x4702f2={};_0x4702f2[_0x9c78('0x2b')]=_[_0x9c78('0x27')](db[_0x9c78('0x3c')]['rawAttributes']);_0x4702f2['query']=_['keys'](_0x494c43[_0x9c78('0x28')]);_0x4702f2['filters']=_[_0x9c78('0x2a')](_0x4702f2[_0x9c78('0x2b')],_0x4702f2[_0x9c78('0x28')]);_0x1d6c5a[_0x9c78('0x2d')]=_[_0x9c78('0x2a')](_0x4702f2[_0x9c78('0x2b')],qs[_0x9c78('0x2c')](_0x494c43[_0x9c78('0x28')][_0x9c78('0x2c')]));_0x1d6c5a[_0x9c78('0x2d')]=_0x1d6c5a[_0x9c78('0x2d')][_0x9c78('0x2e')]?_0x1d6c5a['attributes']:_0x4702f2[_0x9c78('0x2b')];if(_0x494c43[_0x9c78('0x28')][_0x9c78('0x35')]){_0x1d6c5a[_0x9c78('0x36')]=[{'all':!![]}];}_0x1d6c5a=_[_0x9c78('0x33')]({},_0x1d6c5a,_0x494c43[_0x9c78('0x3d')]);return db[_0x9c78('0x3c')][_0x9c78('0x3e')](_0x1d6c5a)['then'](handleEntityNotFound(_0x1ade58,null))[_0x9c78('0x1f')](respondWithResult(_0x1ade58,null))[_0x9c78('0x39')](handleError(_0x1ade58,null));};exports[_0x9c78('0x3f')]=function(_0x136d37,_0x9d35ef){return db['Dynamics365Configuration'][_0x9c78('0x3f')](_0x136d37[_0x9c78('0x40')],{})['then'](respondWithResult(_0x9d35ef,0xc9))[_0x9c78('0x39')](handleError(_0x9d35ef,null));};exports[_0x9c78('0x41')]=function(_0x5d9b82,_0x4a6f6a){if(_0x5d9b82['body']['id']){delete _0x5d9b82[_0x9c78('0x40')]['id'];}return db['Dynamics365Configuration'][_0x9c78('0x3e')]({'where':{'id':_0x5d9b82['params']['id']}})['then'](handleEntityNotFound(_0x4a6f6a,null))[_0x9c78('0x1f')](saveUpdates(_0x5d9b82[_0x9c78('0x40')],null))[_0x9c78('0x1f')](respondWithResult(_0x4a6f6a,null))[_0x9c78('0x39')](handleError(_0x4a6f6a,null));};exports[_0x9c78('0x20')]=function(_0x1e17a4,_0x4f032f){return db[_0x9c78('0x3c')][_0x9c78('0x3e')]({'where':{'id':_0x1e17a4['params']['id']}})['then'](handleEntityNotFound(_0x4f032f,null))['then'](removeEntity(_0x4f032f,null))[_0x9c78('0x39')](handleError(_0x4f032f,null));};exports['getFields']=function(_0x23b303,_0x866666,_0x411057){var _0x4038af={};var _0x5634a3={};var _0x5110ed;var _0x56ee17;return db[_0x9c78('0x3c')][_0x9c78('0x42')]({'where':{'id':_0x23b303[_0x9c78('0x3b')]['id']}})['then'](handleEntityNotFound(_0x866666,null))['then'](function(_0x3f1584){if(_0x3f1584){_0x5110ed=_0x3f1584;_0x5634a3[_0x9c78('0x2b')]=_[_0x9c78('0x27')](db[_0x9c78('0x43')]['rawAttributes']);_0x5634a3['query']=_[_0x9c78('0x27')](_0x23b303[_0x9c78('0x28')]);_0x5634a3[_0x9c78('0x29')]=_['intersection'](_0x5634a3[_0x9c78('0x2b')],_0x5634a3[_0x9c78('0x28')]);_0x4038af[_0x9c78('0x2d')]=_[_0x9c78('0x2a')](_0x5634a3[_0x9c78('0x2b')],qs[_0x9c78('0x2c')](_0x23b303[_0x9c78('0x28')][_0x9c78('0x2c')]));_0x4038af[_0x9c78('0x2d')]=_0x4038af['attributes'][_0x9c78('0x2e')]?_0x4038af[_0x9c78('0x2d')]:_0x5634a3[_0x9c78('0x2b')];_0x4038af[_0x9c78('0x44')]=qs['sort'](_0x23b303[_0x9c78('0x28')][_0x9c78('0x45')]);_0x4038af['where']=qs[_0x9c78('0x29')](_[_0x9c78('0x31')](_0x23b303[_0x9c78('0x28')],_0x5634a3[_0x9c78('0x29')]));if(_0x23b303[_0x9c78('0x28')][_0x9c78('0x32')]){_0x4038af[_0x9c78('0x30')]=_['merge'](_0x4038af[_0x9c78('0x30')],{'$or':_['map'](_0x4038af[_0x9c78('0x2d')],function(_0x2fc877){var _0x486e1b={};_0x486e1b[_0x2fc877]={'$like':'%'+_0x23b303['query'][_0x9c78('0x32')]+'%'};return _0x486e1b;})});}_0x4038af=_[_0x9c78('0x33')]({},_0x4038af,_0x23b303[_0x9c78('0x3d')]);return _0x5110ed['getFields'](_0x4038af);}})[_0x9c78('0x1f')](function(_0x3ec256){if(_0x3ec256){_0x56ee17=_0x3ec256['length'];if(!_0x23b303[_0x9c78('0x28')][_0x9c78('0x46')](_0x9c78('0x47'))){_0x4038af[_0x9c78('0x2f')]=qs[_0x9c78('0x2f')](_0x23b303[_0x9c78('0x28')][_0x9c78('0x2f')]);_0x4038af[_0x9c78('0x19')]=qs[_0x9c78('0x19')](_0x23b303['query']['offset']);}return _0x5110ed[_0x9c78('0x48')](_0x4038af);}})[_0x9c78('0x1f')](function(_0x2f3609){if(_0x2f3609){return _0x2f3609?{'count':_0x56ee17,'rows':_0x2f3609}:null;}})[_0x9c78('0x1f')](respondWithResult(_0x866666,null))[_0x9c78('0x39')](handleError(_0x866666,null));};exports[_0x9c78('0x49')]=function(_0x246df7,_0x3a7233,_0x4f9a68){var _0x242704={};var _0x4ffbac={};var _0x1f34bd;var _0x5a4d66;return db[_0x9c78('0x3c')][_0x9c78('0x42')]({'where':{'id':_0x246df7[_0x9c78('0x3b')]['id']}})[_0x9c78('0x1f')](handleEntityNotFound(_0x3a7233,null))['then'](function(_0x591b52){if(_0x591b52){_0x1f34bd=_0x591b52;_0x4ffbac[_0x9c78('0x2b')]=_[_0x9c78('0x27')](db['Dynamics365Field']['rawAttributes']);_0x4ffbac[_0x9c78('0x28')]=_[_0x9c78('0x27')](_0x246df7[_0x9c78('0x28')]);_0x4ffbac[_0x9c78('0x29')]=_[_0x9c78('0x2a')](_0x4ffbac[_0x9c78('0x2b')],_0x4ffbac[_0x9c78('0x28')]);_0x242704[_0x9c78('0x2d')]=_[_0x9c78('0x2a')](_0x4ffbac[_0x9c78('0x2b')],qs['fields'](_0x246df7[_0x9c78('0x28')][_0x9c78('0x2c')]));_0x242704[_0x9c78('0x2d')]=_0x242704[_0x9c78('0x2d')][_0x9c78('0x2e')]?_0x242704['attributes']:_0x4ffbac[_0x9c78('0x2b')];_0x242704['order']=qs[_0x9c78('0x45')](_0x246df7[_0x9c78('0x28')][_0x9c78('0x45')]);_0x242704[_0x9c78('0x30')]=qs[_0x9c78('0x29')](_[_0x9c78('0x31')](_0x246df7[_0x9c78('0x28')],_0x4ffbac[_0x9c78('0x29')]));if(_0x246df7[_0x9c78('0x28')]['filter']){_0x242704[_0x9c78('0x30')]=_[_0x9c78('0x33')](_0x242704['where'],{'$or':_[_0x9c78('0x24')](_0x242704[_0x9c78('0x2d')],function(_0x5a3fca){var _0x29bf1c={};_0x29bf1c[_0x5a3fca]={'$like':'%'+_0x246df7[_0x9c78('0x28')][_0x9c78('0x32')]+'%'};return _0x29bf1c;})});}_0x242704=_[_0x9c78('0x33')]({},_0x242704,_0x246df7[_0x9c78('0x3d')]);return _0x1f34bd['getSubjects'](_0x242704);}})['then'](function(_0xe72234){if(_0xe72234){_0x5a4d66=_0xe72234[_0x9c78('0x2e')];if(!_0x246df7[_0x9c78('0x28')][_0x9c78('0x46')](_0x9c78('0x47'))){_0x242704[_0x9c78('0x2f')]=qs[_0x9c78('0x2f')](_0x246df7[_0x9c78('0x28')][_0x9c78('0x2f')]);_0x242704[_0x9c78('0x19')]=qs[_0x9c78('0x19')](_0x246df7[_0x9c78('0x28')][_0x9c78('0x19')]);}return _0x1f34bd[_0x9c78('0x49')](_0x242704);}})[_0x9c78('0x1f')](function(_0xc3cd18){if(_0xc3cd18){return _0xc3cd18?{'count':_0x5a4d66,'rows':_0xc3cd18}:null;}})[_0x9c78('0x1f')](respondWithResult(_0x3a7233,null))['catch'](handleError(_0x3a7233,null));};exports[_0x9c78('0x4a')]=function(_0x4bb01a,_0xcc6cfe,_0x299a70){var _0x2dcdee={};var _0xc468c6={};var _0x11d7a8;var _0x242344;return db['Dynamics365Configuration'][_0x9c78('0x42')]({'where':{'id':_0x4bb01a[_0x9c78('0x3b')]['id']}})[_0x9c78('0x1f')](handleEntityNotFound(_0xcc6cfe,null))[_0x9c78('0x1f')](function(_0x527fb6){if(_0x527fb6){_0x11d7a8=_0x527fb6;_0xc468c6['model']=_[_0x9c78('0x27')](db[_0x9c78('0x43')][_0x9c78('0x25')]);_0xc468c6[_0x9c78('0x28')]=_['keys'](_0x4bb01a[_0x9c78('0x28')]);_0xc468c6[_0x9c78('0x29')]=_[_0x9c78('0x2a')](_0xc468c6[_0x9c78('0x2b')],_0xc468c6[_0x9c78('0x28')]);_0x2dcdee[_0x9c78('0x2d')]=_[_0x9c78('0x2a')](_0xc468c6[_0x9c78('0x2b')],qs[_0x9c78('0x2c')](_0x4bb01a[_0x9c78('0x28')][_0x9c78('0x2c')]));_0x2dcdee[_0x9c78('0x2d')]=_0x2dcdee['attributes'][_0x9c78('0x2e')]?_0x2dcdee['attributes']:_0xc468c6[_0x9c78('0x2b')];_0x2dcdee[_0x9c78('0x44')]=qs[_0x9c78('0x45')](_0x4bb01a[_0x9c78('0x28')]['sort']);_0x2dcdee[_0x9c78('0x30')]=qs['filters'](_[_0x9c78('0x31')](_0x4bb01a[_0x9c78('0x28')],_0xc468c6[_0x9c78('0x29')]));if(_0x4bb01a['query'][_0x9c78('0x32')]){_0x2dcdee[_0x9c78('0x30')]=_[_0x9c78('0x33')](_0x2dcdee[_0x9c78('0x30')],{'$or':_[_0x9c78('0x24')](_0x2dcdee[_0x9c78('0x2d')],function(_0x4a60ba){var _0x5982a7={};_0x5982a7[_0x4a60ba]={'$like':'%'+_0x4bb01a['query'][_0x9c78('0x32')]+'%'};return _0x5982a7;})});}_0x2dcdee=_['merge']({},_0x2dcdee,_0x4bb01a['options']);return _0x11d7a8[_0x9c78('0x4a')](_0x2dcdee);}})[_0x9c78('0x1f')](function(_0x76a296){if(_0x76a296){_0x242344=_0x76a296[_0x9c78('0x2e')];if(!_0x4bb01a[_0x9c78('0x28')][_0x9c78('0x46')]('nolimit')){_0x2dcdee[_0x9c78('0x2f')]=qs[_0x9c78('0x2f')](_0x4bb01a[_0x9c78('0x28')]['limit']);_0x2dcdee[_0x9c78('0x19')]=qs[_0x9c78('0x19')](_0x4bb01a[_0x9c78('0x28')]['offset']);}return _0x11d7a8[_0x9c78('0x4a')](_0x2dcdee);}})[_0x9c78('0x1f')](function(_0x2ce05a){if(_0x2ce05a){return _0x2ce05a?{'count':_0x242344,'rows':_0x2ce05a}:null;}})[_0x9c78('0x1f')](respondWithResult(_0xcc6cfe,null))[_0x9c78('0x39')](handleError(_0xcc6cfe,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 4e10aae..2687bf1 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 _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x15f22a,_0x447960){var _0x45360a=function(_0x469eb8){while(--_0x469eb8){_0x15f22a['push'](_0x15f22a['shift']());}};_0x45360a(++_0x447960);}(_0x70e0,0x17b));var _0x070e=function(_0x253ee5,_0x146e95){_0x253ee5=_0x253ee5-0x0;var _0x54652a=_0x70e0[_0x253ee5];return _0x54652a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x1cc016,_0xda0dcc){var _0x414bfa=function(_0x4616dd){while(--_0x4616dd){_0x1cc016['push'](_0x1cc016['shift']());}};_0x414bfa(++_0xda0dcc);}(_0xa41a,0x6b));var _0xaa41=function(_0x56b039,_0x1edc06){_0x56b039=_0x56b039-0x0;var _0x2aa90a=_0xa41a[_0x56b039];return _0x2aa90a;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'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 e9fec72..9a84c97 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 _0x400e=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','code','error','message','Dynamics365Configuration,\x20%s,\x20%s','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x400e,0x18a));var _0xe400=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x400e[_0x329437];return _0x3789d9;};'use strict';var _=require('lodash');var util=require(_0xe400('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe400('0x1'));var fs=require('fs');var Redis=require(_0xe400('0x2'));var db=require(_0xe400('0x3'))['db'];var utils=require(_0xe400('0x4'));var logger=require('../../config/logger')(_0xe400('0x5'));var config=require(_0xe400('0x6'));var jayson=require(_0xe400('0x7'));var client=jayson['client'][_0xe400('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e95e2,_0xbd4013,_0x2a3da8){return new BPromise(function(_0x2e0762,_0x878df6){return client['request'](_0x5e95e2,_0x2a3da8)[_0xe400('0x9')](function(_0x21b588){logger[_0xe400('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0xbd4013,_0xe400('0xb'));logger[_0xe400('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xbd4013,_0xe400('0xb'),JSON[_0xe400('0xd')](_0x21b588));if(_0x21b588['error']){if(_0x21b588['error'][_0xe400('0xe')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xbd4013,_0x21b588[_0xe400('0xf')][_0xe400('0x10')]);return _0x878df6(_0x21b588[_0xe400('0xf')]['message']);}logger[_0xe400('0xf')](_0xe400('0x11'),_0xbd4013,_0x21b588[_0xe400('0xf')][_0xe400('0x10')]);return _0x2e0762(_0x21b588[_0xe400('0xf')]['message']);}else{logger[_0xe400('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0xbd4013,_0xe400('0xb'));_0x2e0762(_0x21b588['result']['message']);}})[_0xe400('0x12')](function(_0x8a774f){logger[_0xe400('0xf')](_0xe400('0x11'),_0xbd4013,_0x8a774f);_0x878df6(_0x8a774f);});});} \ No newline at end of file +var _0x684b=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x684b,0x14d));var _0xb684=function(_0x963690,_0x297300){_0x963690=_0x963690-0x0;var _0x4b4399=_0x684b[_0x963690];return _0x4b4399;};'use strict';var _=require('lodash');var util=require(_0xb684('0x0'));var moment=require('moment');var BPromise=require(_0xb684('0x1'));var rs=require(_0xb684('0x2'));var fs=require('fs');var Redis=require(_0xb684('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb684('0x4'));var logger=require(_0xb684('0x5'))(_0xb684('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb684('0x7')][_0xb684('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc5c232,_0x180ecf,_0x326aae){return new BPromise(function(_0x46b02d,_0x4f605d){return client['request'](_0xc5c232,_0x326aae)[_0xb684('0x9')](function(_0x59b44b){logger[_0xb684('0xa')](_0xb684('0xb'),_0x180ecf,_0xb684('0xc'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x180ecf,_0xb684('0xc'),JSON[_0xb684('0xd')](_0x59b44b));if(_0x59b44b[_0xb684('0xe')]){if(_0x59b44b[_0xb684('0xe')][_0xb684('0xf')]===0x1f4){logger['error'](_0xb684('0xb'),_0x180ecf,_0x59b44b[_0xb684('0xe')][_0xb684('0x10')]);return _0x4f605d(_0x59b44b['error'][_0xb684('0x10')]);}logger[_0xb684('0xe')](_0xb684('0xb'),_0x180ecf,_0x59b44b[_0xb684('0xe')]['message']);return _0x46b02d(_0x59b44b['error']['message']);}else{logger[_0xb684('0xa')](_0xb684('0xb'),_0x180ecf,_0xb684('0xc'));_0x46b02d(_0x59b44b[_0xb684('0x11')][_0xb684('0x10')]);}})[_0xb684('0x12')](function(_0x357f64){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x180ecf,_0x357f64);_0x4f605d(_0x357f64);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 2444864..f6f7f21 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 _0x4444=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','/:id','show','create','put','update','delete','isAuthenticated','destroy'];(function(_0x2ff00d,_0x378ddf){var _0x408b87=function(_0x4efe99){while(--_0x4efe99){_0x2ff00d['push'](_0x2ff00d['shift']());}};_0x408b87(++_0x378ddf);}(_0x4444,0xf1));var _0x4444=function(_0x1e6e99,_0xd3bb5f){_0x1e6e99=_0x1e6e99-0x0;var _0x6b6ca8=_0x4444[_0x1e6e99];return _0x6b6ca8;};'use strict';var multer=require(_0x4444('0x0'));var util=require('util');var path=require(_0x4444('0x1'));var timeout=require(_0x4444('0x2'));var express=require(_0x4444('0x3'));var router=express[_0x4444('0x4')]();var fs_extra=require(_0x4444('0x5'));var auth=require(_0x4444('0x6'));var interaction=require(_0x4444('0x7'));var config=require(_0x4444('0x8'));var controller=require(_0x4444('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4444('0xa')](_0x4444('0xb'),auth['isAuthenticated'](),controller[_0x4444('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4444('0xd')]);router[_0x4444('0xe')](_0x4444('0xb'),auth['isAuthenticated'](),controller[_0x4444('0xf')]);router[_0x4444('0x10')](_0x4444('0xb'),auth[_0x4444('0x11')](),controller[_0x4444('0x12')]);module[_0x4444('0x13')]=router; \ No newline at end of file +var _0x580e=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x580e,0x1e7));var _0xe580=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x580e[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xe580('0x0'));var util=require(_0xe580('0x1'));var path=require(_0xe580('0x2'));var timeout=require(_0xe580('0x3'));var express=require(_0xe580('0x4'));var router=express[_0xe580('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe580('0x6'));var config=require(_0xe580('0x7'));var controller=require('./intDynamics365Field.controller');router[_0xe580('0x8')]('/',auth[_0xe580('0x9')](),controller[_0xe580('0xa')]);router[_0xe580('0x8')](_0xe580('0xb'),auth['isAuthenticated'](),controller[_0xe580('0xc')]);router[_0xe580('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe580('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe580('0xf')](_0xe580('0xb'),auth[_0xe580('0x9')](),controller['destroy']);module[_0xe580('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a6f245e..7c81131 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 _0x1008=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x159492,_0x2c6a91){var _0x4f4ec8=function(_0x4d7cdf){while(--_0x4d7cdf){_0x159492['push'](_0x159492['shift']());}};_0x4f4ec8(++_0x2c6a91);}(_0x1008,0x10a));var _0x8100=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0x1008[_0x3d27ba];return _0xf01885;};'use strict';var Sequelize=require(_0x8100('0x0'));module[_0x8100('0x1')]={'type':{'type':Sequelize[_0x8100('0x2')](_0x8100('0x3'),_0x8100('0x4'),_0x8100('0x5'),'keyValue',_0x8100('0x6')),'defaultValue':_0x8100('0x3')},'content':{'type':Sequelize[_0x8100('0x7')]},'key':{'type':Sequelize[_0x8100('0x7')]},'keyType':{'type':Sequelize[_0x8100('0x2')](_0x8100('0x3'),_0x8100('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x8100('0x7')]},'idField':{'type':Sequelize[_0x8100('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8100('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc207=['string','STRING','sequelize','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x38dd64,_0x38799f){var _0x4670df=function(_0x343b65){while(--_0x343b65){_0x38dd64['push'](_0x38dd64['shift']());}};_0x4670df(++_0x38799f);}(_0xc207,0x112));var _0x7c20=function(_0x1233d1,_0x15cf04){_0x1233d1=_0x1233d1-0x0;var _0x56ee5e=_0xc207[_0x1233d1];return _0x56ee5e;};'use strict';var Sequelize=require(_0x7c20('0x0'));module['exports']={'type':{'type':Sequelize[_0x7c20('0x1')]('string',_0x7c20('0x2'),_0x7c20('0x3'),_0x7c20('0x4'),_0x7c20('0x5')),'defaultValue':_0x7c20('0x6')},'content':{'type':Sequelize[_0x7c20('0x7')]},'key':{'type':Sequelize[_0x7c20('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x7c20('0x6'),_0x7c20('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7c20('0x7')]},'nameField':{'type':Sequelize[_0x7c20('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9b06c29..22c58f8 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 _0x80b2=['options','includeAll','include','Dynamics365Field','findAll','rows','catch','show','rawAttributes','intersection','find','create','body','params','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','keys','filters','attributes','model','fields','length','query','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','filter','merge'];(function(_0x16f533,_0x505ef0){var _0xf0b358=function(_0xe0fc39){while(--_0xe0fc39){_0x16f533['push'](_0x16f533['shift']());}};_0xf0b358(++_0x505ef0);}(_0x80b2,0xec));var _0x280b=function(_0x261951,_0x233243){_0x261951=_0x261951-0x0;var _0x345f40=_0x80b2[_0x261951];return _0x345f40;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x280b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x280b('0x1'));var moment=require(_0x280b('0x2'));var BPromise=require(_0x280b('0x3'));var Mustache=require('mustache');var util=require(_0x280b('0x4'));var path=require(_0x280b('0x5'));var sox=require(_0x280b('0x6'));var csv=require(_0x280b('0x7'));var ejs=require(_0x280b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x280b('0x9'));var squel=require(_0x280b('0xa'));var crypto=require('crypto');var jsforce=require(_0x280b('0xb'));var deskjs=require(_0x280b('0xc'));var toCsv=require(_0x280b('0x7'));var querystring=require(_0x280b('0xd'));var Papa=require('papaparse');var Redis=require(_0x280b('0xe'));var authService=require(_0x280b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x280b('0x10'));var logger=require('../../config/logger')(_0x280b('0x11'));var utils=require(_0x280b('0x12'));var config=require(_0x280b('0x13'));var licenseUtil=require(_0x280b('0x14'));var db=require(_0x280b('0x15'))['db'];function respondWithStatusCode(_0x43bb46,_0x18d313){_0x18d313=_0x18d313||0xcc;return function(_0x128abd){if(_0x128abd){return _0x43bb46[_0x280b('0x16')](_0x18d313);}return _0x43bb46[_0x280b('0x17')](_0x18d313)[_0x280b('0x18')]();};}function respondWithResult(_0x18a4c5,_0x14956b){_0x14956b=_0x14956b||0xc8;return function(_0x29d9a3){if(_0x29d9a3){return _0x18a4c5[_0x280b('0x17')](_0x14956b)[_0x280b('0x19')](_0x29d9a3);}};}function respondWithFilteredResult(_0x1bc63a,_0x18370d){return function(_0x382215){if(_0x382215){var _0xf3c0fa=typeof _0x18370d[_0x280b('0x1a')]===_0x280b('0x1b')&&typeof _0x18370d['limit']===_0x280b('0x1b');var _0x374415=_0x382215[_0x280b('0x1c')];var _0x5bf9bb=_0xf3c0fa?0x0:_0x18370d[_0x280b('0x1a')];var _0x3e5fe7=_0xf3c0fa?_0x382215[_0x280b('0x1c')]:_0x18370d[_0x280b('0x1a')]+_0x18370d['limit'];var _0x44bb00;if(_0x3e5fe7>=_0x374415){_0x3e5fe7=_0x374415;_0x44bb00=0xc8;}else{_0x44bb00=0xce;}_0x1bc63a[_0x280b('0x17')](_0x44bb00);return _0x1bc63a[_0x280b('0x1d')](_0x280b('0x1e'),_0x5bf9bb+'-'+_0x3e5fe7+'/'+_0x374415)['json'](_0x382215);}return null;};}function patchUpdates(_0x11b775){return function(_0x32c01c){try{jsonpatch['apply'](_0x32c01c,_0x11b775,!![]);}catch(_0x1b9df2){return BPromise[_0x280b('0x1f')](_0x1b9df2);}return _0x32c01c[_0x280b('0x20')]();};}function saveUpdates(_0x142ab1,_0x3961c3){return function(_0x4a6966){if(_0x4a6966){return _0x4a6966[_0x280b('0x21')](_0x142ab1)[_0x280b('0x22')](function(_0x1824d0){return _0x1824d0;});}return null;};}function removeEntity(_0x5c192c,_0x25ffa6){return function(_0x919ba0){if(_0x919ba0){return _0x919ba0[_0x280b('0x23')]()['then'](function(){_0x5c192c['status'](0xcc)[_0x280b('0x18')]();});}};}function handleEntityNotFound(_0x323200,_0x270b0d){return function(_0x2646d4){if(!_0x2646d4){_0x323200[_0x280b('0x16')](0x194);}return _0x2646d4;};}function handleError(_0xb9dea1,_0x2f58c4){_0x2f58c4=_0x2f58c4||0x1f4;return function(_0x492edb){logger['error'](_0x492edb[_0x280b('0x24')]);if(_0x492edb[_0x280b('0x25')]){delete _0x492edb[_0x280b('0x25')];}_0xb9dea1[_0x280b('0x17')](_0x2f58c4)[_0x280b('0x26')](_0x492edb);};}exports[_0x280b('0x27')]=function(_0xfca4ae,_0x3c3b23){var _0xae553a={},_0x225342={},_0x30ac88={'count':0x0,'rows':[]};var _0x43e2ef=_[_0x280b('0x28')](db['Dynamics365Field']['rawAttributes'],function(_0x4e63d1){return{'name':_0x4e63d1[_0x280b('0x29')],'type':_0x4e63d1[_0x280b('0x2a')][_0x280b('0x2b')]};});_0x225342['model']=_['map'](_0x43e2ef,'name');_0x225342['query']=_[_0x280b('0x2c')](_0xfca4ae['query']);_0x225342[_0x280b('0x2d')]=_['intersection'](_0x225342['model'],_0x225342['query']);_0xae553a[_0x280b('0x2e')]=_['intersection'](_0x225342[_0x280b('0x2f')],qs[_0x280b('0x30')](_0xfca4ae['query'][_0x280b('0x30')]));_0xae553a[_0x280b('0x2e')]=_0xae553a[_0x280b('0x2e')][_0x280b('0x31')]?_0xae553a[_0x280b('0x2e')]:_0x225342[_0x280b('0x2f')];if(!_0xfca4ae[_0x280b('0x32')][_0x280b('0x33')]('nolimit')){_0xae553a[_0x280b('0x34')]=qs[_0x280b('0x34')](_0xfca4ae['query'][_0x280b('0x34')]);_0xae553a[_0x280b('0x1a')]=qs['offset'](_0xfca4ae[_0x280b('0x32')][_0x280b('0x1a')]);}_0xae553a[_0x280b('0x35')]=qs[_0x280b('0x36')](_0xfca4ae[_0x280b('0x32')]['sort']);_0xae553a[_0x280b('0x37')]=qs['filters'](_[_0x280b('0x38')](_0xfca4ae['query'],_0x225342[_0x280b('0x2d')]),_0x43e2ef);if(_0xfca4ae['query']['filter']){_0xae553a[_0x280b('0x37')]=_['merge'](_0xae553a['where'],{'$or':_[_0x280b('0x28')](_0x43e2ef,function(_0x193767){if(_0x193767[_0x280b('0x2a')]!==_0x280b('0x39')){var _0x3fd307={};_0x3fd307[_0x193767[_0x280b('0x25')]]={'$like':'%'+_0xfca4ae['query'][_0x280b('0x3a')]+'%'};return _0x3fd307;}})});}_0xae553a=_[_0x280b('0x3b')]({},_0xae553a,_0xfca4ae[_0x280b('0x3c')]);var _0xfd1d45={'where':_0xae553a[_0x280b('0x37')]};return db['Dynamics365Field'][_0x280b('0x1c')](_0xfd1d45)[_0x280b('0x22')](function(_0x47fe8a){_0x30ac88[_0x280b('0x1c')]=_0x47fe8a;if(_0xfca4ae['query'][_0x280b('0x3d')]){_0xae553a[_0x280b('0x3e')]=[{'all':!![]}];}return db[_0x280b('0x3f')][_0x280b('0x40')](_0xae553a);})['then'](function(_0x1c0de6){_0x30ac88[_0x280b('0x41')]=_0x1c0de6;return _0x30ac88;})[_0x280b('0x22')](respondWithFilteredResult(_0x3c3b23,_0xae553a))[_0x280b('0x42')](handleError(_0x3c3b23,null));};exports[_0x280b('0x43')]=function(_0x5634a0,_0x427d8f){var _0x3b5e19={'raw':!![],'where':{'id':_0x5634a0['params']['id']}},_0x409b69={};_0x409b69['model']=_[_0x280b('0x2c')](db['Dynamics365Field'][_0x280b('0x44')]);_0x409b69[_0x280b('0x32')]=_[_0x280b('0x2c')](_0x5634a0[_0x280b('0x32')]);_0x409b69[_0x280b('0x2d')]=_[_0x280b('0x45')](_0x409b69[_0x280b('0x2f')],_0x409b69[_0x280b('0x32')]);_0x3b5e19[_0x280b('0x2e')]=_['intersection'](_0x409b69[_0x280b('0x2f')],qs[_0x280b('0x30')](_0x5634a0[_0x280b('0x32')][_0x280b('0x30')]));_0x3b5e19['attributes']=_0x3b5e19[_0x280b('0x2e')][_0x280b('0x31')]?_0x3b5e19[_0x280b('0x2e')]:_0x409b69[_0x280b('0x2f')];if(_0x5634a0[_0x280b('0x32')][_0x280b('0x3d')]){_0x3b5e19['include']=[{'all':!![]}];}_0x3b5e19=_['merge']({},_0x3b5e19,_0x5634a0['options']);return db[_0x280b('0x3f')][_0x280b('0x46')](_0x3b5e19)[_0x280b('0x22')](handleEntityNotFound(_0x427d8f,null))['then'](respondWithResult(_0x427d8f,null))[_0x280b('0x42')](handleError(_0x427d8f,null));};exports[_0x280b('0x47')]=function(_0x1dabbc,_0x41b6be){return db[_0x280b('0x3f')][_0x280b('0x47')](_0x1dabbc[_0x280b('0x48')],{})[_0x280b('0x22')](respondWithResult(_0x41b6be,0xc9))['catch'](handleError(_0x41b6be,null));};exports['update']=function(_0x48d6cf,_0x15f03f){if(_0x48d6cf[_0x280b('0x48')]['id']){delete _0x48d6cf['body']['id'];}return db[_0x280b('0x3f')][_0x280b('0x46')]({'where':{'id':_0x48d6cf[_0x280b('0x49')]['id']}})[_0x280b('0x22')](handleEntityNotFound(_0x15f03f,null))[_0x280b('0x22')](saveUpdates(_0x48d6cf[_0x280b('0x48')],null))['then'](respondWithResult(_0x15f03f,null))[_0x280b('0x42')](handleError(_0x15f03f,null));};exports[_0x280b('0x23')]=function(_0x46b420,_0x2ed88f){return db['Dynamics365Field'][_0x280b('0x46')]({'where':{'id':_0x46b420['params']['id']}})[_0x280b('0x22')](handleEntityNotFound(_0x2ed88f,null))[_0x280b('0x22')](removeEntity(_0x2ed88f,null))[_0x280b('0x42')](handleError(_0x2ed88f,null));}; \ No newline at end of file +var _0x2992=['fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','catch','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','undefined','offset','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x575b99,_0x15038e){var _0x5b65fe=function(_0x517636){while(--_0x517636){_0x575b99['push'](_0x575b99['shift']());}};_0x5b65fe(++_0x15038e);}(_0x2992,0xab));var _0x2299=function(_0x7aee79,_0x124af2){_0x7aee79=_0x7aee79-0x0;var _0xcbf9d1=_0x2992[_0x7aee79];return _0xcbf9d1;};'use strict';var emlformat=require(_0x2299('0x0'));var rimraf=require(_0x2299('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2299('0x2'));var moment=require(_0x2299('0x3'));var BPromise=require(_0x2299('0x4'));var Mustache=require(_0x2299('0x5'));var util=require(_0x2299('0x6'));var path=require(_0x2299('0x7'));var sox=require('sox');var csv=require(_0x2299('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2299('0x9'));var _=require(_0x2299('0xa'));var squel=require(_0x2299('0xb'));var crypto=require(_0x2299('0xc'));var jsforce=require(_0x2299('0xd'));var deskjs=require(_0x2299('0xe'));var toCsv=require(_0x2299('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2299('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2299('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2299('0x11'));var logger=require('../../config/logger')(_0x2299('0x12'));var utils=require(_0x2299('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2299('0x14'));var db=require(_0x2299('0x15'))['db'];function respondWithStatusCode(_0x307214,_0x3a45e5){_0x3a45e5=_0x3a45e5||0xcc;return function(_0x37b13e){if(_0x37b13e){return _0x307214['sendStatus'](_0x3a45e5);}return _0x307214['status'](_0x3a45e5)[_0x2299('0x16')]();};}function respondWithResult(_0x58e690,_0x33bfa7){_0x33bfa7=_0x33bfa7||0xc8;return function(_0xf41a08){if(_0xf41a08){return _0x58e690[_0x2299('0x17')](_0x33bfa7)['json'](_0xf41a08);}};}function respondWithFilteredResult(_0x583284,_0x59d7d0){return function(_0x3222ee){if(_0x3222ee){var _0x508753=typeof _0x59d7d0['offset']===_0x2299('0x18')&&typeof _0x59d7d0['limit']===_0x2299('0x18');var _0x25f321=_0x3222ee['count'];var _0x2512ac=_0x508753?0x0:_0x59d7d0[_0x2299('0x19')];var _0x24132f=_0x508753?_0x3222ee[_0x2299('0x1a')]:_0x59d7d0[_0x2299('0x19')]+_0x59d7d0['limit'];var _0x16ab3f;if(_0x24132f>=_0x25f321){_0x24132f=_0x25f321;_0x16ab3f=0xc8;}else{_0x16ab3f=0xce;}_0x583284[_0x2299('0x17')](_0x16ab3f);return _0x583284[_0x2299('0x1b')](_0x2299('0x1c'),_0x2512ac+'-'+_0x24132f+'/'+_0x25f321)['json'](_0x3222ee);}return null;};}function patchUpdates(_0x12244f){return function(_0x4c9b41){try{jsonpatch[_0x2299('0x1d')](_0x4c9b41,_0x12244f,!![]);}catch(_0x500c7e){return BPromise['reject'](_0x500c7e);}return _0x4c9b41[_0x2299('0x1e')]();};}function saveUpdates(_0x3d147b,_0x3f2677){return function(_0x1c9c22){if(_0x1c9c22){return _0x1c9c22[_0x2299('0x1f')](_0x3d147b)[_0x2299('0x20')](function(_0x27567f){return _0x27567f;});}return null;};}function removeEntity(_0x1af627,_0x4ba3ed){return function(_0x3bee12){if(_0x3bee12){return _0x3bee12[_0x2299('0x21')]()[_0x2299('0x20')](function(){_0x1af627['status'](0xcc)[_0x2299('0x16')]();});}};}function handleEntityNotFound(_0x5ddc64,_0x4f2f27){return function(_0x197f26){if(!_0x197f26){_0x5ddc64[_0x2299('0x22')](0x194);}return _0x197f26;};}function handleError(_0x506aaa,_0x4efae0){_0x4efae0=_0x4efae0||0x1f4;return function(_0x41a6dd){logger[_0x2299('0x23')](_0x41a6dd[_0x2299('0x24')]);if(_0x41a6dd[_0x2299('0x25')]){delete _0x41a6dd['name'];}_0x506aaa[_0x2299('0x17')](_0x4efae0)[_0x2299('0x26')](_0x41a6dd);};}exports[_0x2299('0x27')]=function(_0x318eaa,_0x17592c){var _0x4783a6={},_0x21cb74={},_0x4dbd12={'count':0x0,'rows':[]};var _0x243de7=_[_0x2299('0x28')](db[_0x2299('0x29')][_0x2299('0x2a')],function(_0x39c712){return{'name':_0x39c712[_0x2299('0x2b')],'type':_0x39c712[_0x2299('0x2c')][_0x2299('0x2d')]};});_0x21cb74[_0x2299('0x2e')]=_['map'](_0x243de7,'name');_0x21cb74[_0x2299('0x2f')]=_[_0x2299('0x30')](_0x318eaa[_0x2299('0x2f')]);_0x21cb74[_0x2299('0x31')]=_[_0x2299('0x32')](_0x21cb74[_0x2299('0x2e')],_0x21cb74[_0x2299('0x2f')]);_0x4783a6['attributes']=_[_0x2299('0x32')](_0x21cb74[_0x2299('0x2e')],qs['fields'](_0x318eaa[_0x2299('0x2f')][_0x2299('0x33')]));_0x4783a6[_0x2299('0x34')]=_0x4783a6['attributes'][_0x2299('0x35')]?_0x4783a6[_0x2299('0x34')]:_0x21cb74['model'];if(!_0x318eaa[_0x2299('0x2f')][_0x2299('0x36')](_0x2299('0x37'))){_0x4783a6[_0x2299('0x38')]=qs[_0x2299('0x38')](_0x318eaa[_0x2299('0x2f')][_0x2299('0x38')]);_0x4783a6['offset']=qs[_0x2299('0x19')](_0x318eaa[_0x2299('0x2f')][_0x2299('0x19')]);}_0x4783a6[_0x2299('0x39')]=qs[_0x2299('0x3a')](_0x318eaa[_0x2299('0x2f')][_0x2299('0x3a')]);_0x4783a6[_0x2299('0x3b')]=qs['filters'](_[_0x2299('0x3c')](_0x318eaa[_0x2299('0x2f')],_0x21cb74[_0x2299('0x31')]),_0x243de7);if(_0x318eaa[_0x2299('0x2f')]['filter']){_0x4783a6[_0x2299('0x3b')]=_['merge'](_0x4783a6[_0x2299('0x3b')],{'$or':_[_0x2299('0x28')](_0x243de7,function(_0x5d94b8){if(_0x5d94b8[_0x2299('0x2c')]!==_0x2299('0x3d')){var _0x479129={};_0x479129[_0x5d94b8[_0x2299('0x25')]]={'$like':'%'+_0x318eaa[_0x2299('0x2f')][_0x2299('0x3e')]+'%'};return _0x479129;}})});}_0x4783a6=_[_0x2299('0x3f')]({},_0x4783a6,_0x318eaa[_0x2299('0x40')]);var _0x18c00e={'where':_0x4783a6[_0x2299('0x3b')]};return db[_0x2299('0x29')][_0x2299('0x1a')](_0x18c00e)[_0x2299('0x20')](function(_0x56146d){_0x4dbd12['count']=_0x56146d;if(_0x318eaa[_0x2299('0x2f')][_0x2299('0x41')]){_0x4783a6[_0x2299('0x42')]=[{'all':!![]}];}return db[_0x2299('0x29')][_0x2299('0x43')](_0x4783a6);})[_0x2299('0x20')](function(_0x409878){_0x4dbd12[_0x2299('0x44')]=_0x409878;return _0x4dbd12;})[_0x2299('0x20')](respondWithFilteredResult(_0x17592c,_0x4783a6))['catch'](handleError(_0x17592c,null));};exports['show']=function(_0x5da16c,_0x4fa69c){var _0x386d16={'raw':!![],'where':{'id':_0x5da16c[_0x2299('0x45')]['id']}},_0x5aabfd={};_0x5aabfd[_0x2299('0x2e')]=_[_0x2299('0x30')](db['Dynamics365Field'][_0x2299('0x2a')]);_0x5aabfd[_0x2299('0x2f')]=_[_0x2299('0x30')](_0x5da16c[_0x2299('0x2f')]);_0x5aabfd[_0x2299('0x31')]=_[_0x2299('0x32')](_0x5aabfd['model'],_0x5aabfd[_0x2299('0x2f')]);_0x386d16[_0x2299('0x34')]=_[_0x2299('0x32')](_0x5aabfd[_0x2299('0x2e')],qs[_0x2299('0x33')](_0x5da16c[_0x2299('0x2f')]['fields']));_0x386d16[_0x2299('0x34')]=_0x386d16['attributes']['length']?_0x386d16[_0x2299('0x34')]:_0x5aabfd[_0x2299('0x2e')];if(_0x5da16c['query'][_0x2299('0x41')]){_0x386d16[_0x2299('0x42')]=[{'all':!![]}];}_0x386d16=_[_0x2299('0x3f')]({},_0x386d16,_0x5da16c['options']);return db[_0x2299('0x29')]['find'](_0x386d16)['then'](handleEntityNotFound(_0x4fa69c,null))[_0x2299('0x20')](respondWithResult(_0x4fa69c,null))[_0x2299('0x46')](handleError(_0x4fa69c,null));};exports[_0x2299('0x47')]=function(_0x3334ee,_0x239c5a){return db['Dynamics365Field']['create'](_0x3334ee[_0x2299('0x48')],{})['then'](respondWithResult(_0x239c5a,0xc9))['catch'](handleError(_0x239c5a,null));};exports[_0x2299('0x1f')]=function(_0x3609c1,_0x217d66){if(_0x3609c1['body']['id']){delete _0x3609c1['body']['id'];}return db[_0x2299('0x29')][_0x2299('0x49')]({'where':{'id':_0x3609c1[_0x2299('0x45')]['id']}})[_0x2299('0x20')](handleEntityNotFound(_0x217d66,null))[_0x2299('0x20')](saveUpdates(_0x3609c1['body'],null))[_0x2299('0x20')](respondWithResult(_0x217d66,null))[_0x2299('0x46')](handleError(_0x217d66,null));};exports[_0x2299('0x21')]=function(_0x38cfae,_0x1f9c31){return db[_0x2299('0x29')]['find']({'where':{'id':_0x38cfae['params']['id']}})[_0x2299('0x20')](handleEntityNotFound(_0x1f9c31,null))[_0x2299('0x20')](removeEntity(_0x1f9c31,null))[_0x2299('0x46')](handleError(_0x1f9c31,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 38576ad..893d56a 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 _0x9788=['../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3387a2,_0x52799f){var _0x1cc9c9=function(_0x49ceae){while(--_0x49ceae){_0x3387a2['push'](_0x3387a2['shift']());}};_0x1cc9c9(++_0x52799f);}(_0x9788,0x19c));var _0x8978=function(_0x34a202,_0x27c6e0){_0x34a202=_0x34a202-0x0;var _0x5c16d1=_0x9788[_0x34a202];return _0x5c16d1;};'use strict';var _=require(_0x8978('0x0'));var util=require(_0x8978('0x1'));var logger=require(_0x8978('0x2'))(_0x8978('0x3'));var moment=require(_0x8978('0x4'));var BPromise=require(_0x8978('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8978('0x6'));var rimraf=require(_0x8978('0x7'));var config=require(_0x8978('0x8'));var attributes=require(_0x8978('0x9'));module[_0x8978('0xa')]=function(_0x1778a0,_0x2287b5){return _0x1778a0[_0x8978('0xb')](_0x8978('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x8978('0xd'),_0x8978('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a37=['api','moment','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util'];(function(_0x521f14,_0x33a059){var _0x8171ab=function(_0x166bba){while(--_0x166bba){_0x521f14['push'](_0x521f14['shift']());}};_0x8171ab(++_0x33a059);}(_0x4a37,0x19e));var _0x74a3=function(_0x2725ba,_0x223893){_0x2725ba=_0x2725ba-0x0;var _0x46dc3d=_0x4a37[_0x2725ba];return _0x46dc3d;};'use strict';var _=require(_0x74a3('0x0'));var util=require(_0x74a3('0x1'));var logger=require('../../config/logger')(_0x74a3('0x2'));var moment=require(_0x74a3('0x3'));var BPromise=require('bluebird');var rp=require(_0x74a3('0x4'));var fs=require('fs');var path=require(_0x74a3('0x5'));var rimraf=require('rimraf');var config=require(_0x74a3('0x6'));var attributes=require(_0x74a3('0x7'));module[_0x74a3('0x8')]=function(_0x3db5c7,_0x3235b7){return _0x3db5c7['define'](_0x74a3('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x74a3('0xa'),'fields':[_0x74a3('0xb'),_0x74a3('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 16cbe73..6649e52 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 _0x93e8=['ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x93e8,0x1ca));var _0x893e=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x93e8[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x893e('0x0'));var util=require(_0x893e('0x1'));var moment=require(_0x893e('0x2'));var BPromise=require('bluebird');var rs=require(_0x893e('0x3'));var fs=require('fs');var Redis=require(_0x893e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x893e('0x5'));var logger=require(_0x893e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x893e('0x7'));var client=jayson['client'][_0x893e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x868a8d,_0x472253,_0xfd8384){return new BPromise(function(_0xfc31db,_0x1eaa3c){return client[_0x893e('0x9')](_0x868a8d,_0xfd8384)[_0x893e('0xa')](function(_0x36b3f5){logger[_0x893e('0xb')](_0x893e('0xc'),_0x472253,_0x893e('0xd'));logger[_0x893e('0xe')](_0x893e('0xf'),_0x472253,_0x893e('0xd'),JSON[_0x893e('0x10')](_0x36b3f5));if(_0x36b3f5['error']){if(_0x36b3f5[_0x893e('0x11')][_0x893e('0x12')]===0x1f4){logger['error'](_0x893e('0xc'),_0x472253,_0x36b3f5[_0x893e('0x11')][_0x893e('0x13')]);return _0x1eaa3c(_0x36b3f5['error'][_0x893e('0x13')]);}logger[_0x893e('0x11')](_0x893e('0xc'),_0x472253,_0x36b3f5[_0x893e('0x11')][_0x893e('0x13')]);return _0xfc31db(_0x36b3f5[_0x893e('0x11')][_0x893e('0x13')]);}else{logger[_0x893e('0xb')](_0x893e('0xc'),_0x472253,'request\x20sent');_0xfc31db(_0x36b3f5[_0x893e('0x14')][_0x893e('0x13')]);}})[_0x893e('0x15')](function(_0x7442d4){logger[_0x893e('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x472253,_0x7442d4);_0x1eaa3c(_0x7442d4);});});} \ No newline at end of file +var _0x6f9b=['rpc','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x6f9b,0x1d9));var _0xb6f9=function(_0x42797d,_0x111a97){_0x42797d=_0x42797d-0x0;var _0x576727=_0x6f9b[_0x42797d];return _0x576727;};'use strict';var _=require(_0xb6f9('0x0'));var util=require(_0xb6f9('0x1'));var moment=require('moment');var BPromise=require(_0xb6f9('0x2'));var rs=require(_0xb6f9('0x3'));var fs=require('fs');var Redis=require(_0xb6f9('0x4'));var db=require(_0xb6f9('0x5'))['db'];var utils=require(_0xb6f9('0x6'));var logger=require('../../config/logger')(_0xb6f9('0x7'));var config=require('../../config/environment');var jayson=require(_0xb6f9('0x8'));var client=jayson[_0xb6f9('0x9')][_0xb6f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e44c1,_0x38a9dc,_0x153ca8){return new BPromise(function(_0x27af7a,_0xf70cef){return client[_0xb6f9('0xb')](_0x4e44c1,_0x153ca8)[_0xb6f9('0xc')](function(_0x3c2d75){logger[_0xb6f9('0xd')](_0xb6f9('0xe'),_0x38a9dc,_0xb6f9('0xf'));logger[_0xb6f9('0x10')](_0xb6f9('0x11'),_0x38a9dc,_0xb6f9('0xf'),JSON[_0xb6f9('0x12')](_0x3c2d75));if(_0x3c2d75[_0xb6f9('0x13')]){if(_0x3c2d75[_0xb6f9('0x13')][_0xb6f9('0x14')]===0x1f4){logger[_0xb6f9('0x13')](_0xb6f9('0xe'),_0x38a9dc,_0x3c2d75[_0xb6f9('0x13')][_0xb6f9('0x15')]);return _0xf70cef(_0x3c2d75[_0xb6f9('0x13')][_0xb6f9('0x15')]);}logger['error'](_0xb6f9('0xe'),_0x38a9dc,_0x3c2d75[_0xb6f9('0x13')][_0xb6f9('0x15')]);return _0x27af7a(_0x3c2d75[_0xb6f9('0x13')]['message']);}else{logger['info'](_0xb6f9('0xe'),_0x38a9dc,_0xb6f9('0xf'));_0x27af7a(_0x3c2d75[_0xb6f9('0x16')]['message']);}})[_0xb6f9('0x17')](function(_0x3f4461){logger[_0xb6f9('0x13')](_0xb6f9('0xe'),_0x38a9dc,_0x3f4461);_0xf70cef(_0x3f4461);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b3dc987..85acdeb 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 _0x811a=['get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','destroy','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index'];(function(_0x550a9f,_0x4784c6){var _0x2a8aa4=function(_0x31bb3b){while(--_0x31bb3b){_0x550a9f['push'](_0x550a9f['shift']());}};_0x2a8aa4(++_0x4784c6);}(_0x811a,0x7d));var _0xa811=function(_0xf766d,_0x30acbc){_0xf766d=_0xf766d-0x0;var _0x522802=_0x811a[_0xf766d];return _0x522802;};'use strict';var multer=require('multer');var util=require(_0xa811('0x0'));var path=require('path');var timeout=require(_0xa811('0x1'));var express=require('express');var router=express[_0xa811('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa811('0x3'));var config=require(_0xa811('0x4'));var controller=require(_0xa811('0x5'));router['get']('/',auth[_0xa811('0x6')](),controller[_0xa811('0x7')]);router[_0xa811('0x8')](_0xa811('0x9'),auth[_0xa811('0x6')](),controller['show']);router[_0xa811('0x8')](_0xa811('0xa'),auth[_0xa811('0x6')](),controller[_0xa811('0xb')]);router['get'](_0xa811('0xc'),auth[_0xa811('0x6')](),controller[_0xa811('0xd')]);router['post']('/',auth[_0xa811('0x6')](),controller[_0xa811('0xe')]);router[_0xa811('0xf')](_0xa811('0xa'),auth[_0xa811('0x6')](),controller['addConfiguration']);router[_0xa811('0x10')](_0xa811('0x9'),auth[_0xa811('0x6')](),controller['update']);router['delete'](_0xa811('0x9'),auth[_0xa811('0x6')](),controller[_0xa811('0x11')]);module[_0xa811('0x12')]=router; \ No newline at end of file +var _0x5758=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0xbb7e1a,_0x2b103f){var _0x5b9751=function(_0x4eb853){while(--_0x4eb853){_0xbb7e1a['push'](_0xbb7e1a['shift']());}};_0x5b9751(++_0x2b103f);}(_0x5758,0x103));var _0x8575=function(_0x466363,_0x671dcb){_0x466363=_0x466363-0x0;var _0x1cf972=_0x5758[_0x466363];return _0x1cf972;};'use strict';var multer=require(_0x8575('0x0'));var util=require('util');var path=require(_0x8575('0x1'));var timeout=require(_0x8575('0x2'));var express=require(_0x8575('0x3'));var router=express[_0x8575('0x4')]();var fs_extra=require(_0x8575('0x5'));var auth=require(_0x8575('0x6'));var interaction=require(_0x8575('0x7'));var config=require('../../config/environment');var controller=require(_0x8575('0x8'));router[_0x8575('0x9')]('/',auth['isAuthenticated'](),controller[_0x8575('0xa')]);router[_0x8575('0x9')]('/:id',auth[_0x8575('0xb')](),controller['show']);router[_0x8575('0x9')](_0x8575('0xc'),auth['isAuthenticated'](),controller[_0x8575('0xd')]);router[_0x8575('0x9')](_0x8575('0xe'),auth[_0x8575('0xb')](),controller[_0x8575('0xf')]);router['post']('/',auth[_0x8575('0xb')](),controller[_0x8575('0x10')]);router[_0x8575('0x11')](_0x8575('0xc'),auth[_0x8575('0xb')](),controller[_0x8575('0x12')]);router[_0x8575('0x13')](_0x8575('0x14'),auth[_0x8575('0xb')](),controller[_0x8575('0x15')]);router['delete'](_0x8575('0x14'),auth[_0x8575('0xb')](),controller[_0x8575('0x16')]);module[_0x8575('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6939631..67dc5f1 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 _0x627e=['STRING','remoteUri','sequelize','exports'];(function(_0x141fdf,_0x4d002a){var _0x42231a=function(_0xea91ad){while(--_0xea91ad){_0x141fdf['push'](_0x141fdf['shift']());}};_0x42231a(++_0x4d002a);}(_0x627e,0x14a));var _0xe627=function(_0x3b557f,_0x33b92d){_0x3b557f=_0x3b557f-0x0;var _0x2efba7=_0x627e[_0x3b557f];return _0x2efba7;};'use strict';var Sequelize=require(_0xe627('0x0'));module[_0xe627('0x1')]={'name':{'type':Sequelize[_0xe627('0x2')]},'description':{'type':Sequelize[_0xe627('0x2')]},'username':{'type':Sequelize[_0xe627('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe627('0x2')]},'remoteUri':{'type':Sequelize[_0xe627('0x2')],'unique':_0xe627('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfef3,0x118));var _0x3fef=function(_0x4fa916,_0x3ec36a){_0x4fa916=_0x4fa916-0x0;var _0x576439=_0xfef3[_0x4fa916];return _0x576439;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index b58679c..86db4b6 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 _0x3c0d=['subject','agent','description','priority','group','source','ticket_type','company','remove','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','FreshdeskAccount','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','rows','params','rawAttributes','includeAll','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','order','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','type','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester'];(function(_0x5cf442,_0x455295){var _0x139b28=function(_0x3143b4){while(--_0x3143b4){_0x5cf442['push'](_0x5cf442['shift']());}};_0x139b28(++_0x455295);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x261337,_0x23206e){_0x261337=_0x261337-0x0;var _0x4dcfd6=_0x3c0d[_0x261337];return _0x4dcfd6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd3c0('0x0'));var rp=require(_0xd3c0('0x1'));var moment=require(_0xd3c0('0x2'));var BPromise=require(_0xd3c0('0x3'));var Mustache=require(_0xd3c0('0x4'));var util=require(_0xd3c0('0x5'));var path=require(_0xd3c0('0x6'));var sox=require(_0xd3c0('0x7'));var csv=require(_0xd3c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3c0('0x9'));var _=require('lodash');var squel=require(_0xd3c0('0xa'));var crypto=require(_0xd3c0('0xb'));var jsforce=require(_0xd3c0('0xc'));var deskjs=require(_0xd3c0('0xd'));var toCsv=require(_0xd3c0('0x8'));var querystring=require(_0xd3c0('0xe'));var Papa=require(_0xd3c0('0xf'));var Redis=require(_0xd3c0('0x10'));var authService=require(_0xd3c0('0x11'));var qs=require(_0xd3c0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3c0('0x13'));var logger=require(_0xd3c0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd3c0('0x15'));var licenseUtil=require(_0xd3c0('0x16'));var db=require(_0xd3c0('0x17'))['db'];var integrations=require(_0xd3c0('0x18'));function respondWithStatusCode(_0x5cc5ca,_0x1eb687){_0x1eb687=_0x1eb687||0xcc;return function(_0x43d732){if(_0x43d732){return _0x5cc5ca[_0xd3c0('0x19')](_0x1eb687);}return _0x5cc5ca['status'](_0x1eb687)[_0xd3c0('0x1a')]();};}function respondWithResult(_0xbb88d2,_0x1b6250){_0x1b6250=_0x1b6250||0xc8;return function(_0x3fdf53){if(_0x3fdf53){return _0xbb88d2[_0xd3c0('0x1b')](_0x1b6250)[_0xd3c0('0x1c')](_0x3fdf53);}};}function respondWithFilteredResult(_0x532c8f,_0x4e6632){return function(_0x36f41c){if(_0x36f41c){var _0x2ad443=typeof _0x4e6632['offset']===_0xd3c0('0x1d')&&typeof _0x4e6632[_0xd3c0('0x1e')]===_0xd3c0('0x1d');var _0x23c61b=_0x36f41c[_0xd3c0('0x1f')];var _0x2adf93=_0x2ad443?0x0:_0x4e6632[_0xd3c0('0x20')];var _0x53584a=_0x2ad443?_0x36f41c['count']:_0x4e6632[_0xd3c0('0x20')]+_0x4e6632['limit'];var _0x38aad0;if(_0x53584a>=_0x23c61b){_0x53584a=_0x23c61b;_0x38aad0=0xc8;}else{_0x38aad0=0xce;}_0x532c8f[_0xd3c0('0x1b')](_0x38aad0);return _0x532c8f[_0xd3c0('0x21')](_0xd3c0('0x22'),_0x2adf93+'-'+_0x53584a+'/'+_0x23c61b)['json'](_0x36f41c);}return null;};}function patchUpdates(_0x54af55){return function(_0x35883e){try{jsonpatch[_0xd3c0('0x23')](_0x35883e,_0x54af55,!![]);}catch(_0x362318){return BPromise[_0xd3c0('0x24')](_0x362318);}return _0x35883e['save']();};}function saveUpdates(_0x476a17,_0x5b44c7){return function(_0x5a56b9){if(_0x5a56b9){return _0x5a56b9[_0xd3c0('0x25')](_0x476a17)[_0xd3c0('0x26')](function(_0x5711eb){return _0x5711eb;});}return null;};}function removeEntity(_0x3ac1b3,_0x454e45){return function(_0x579078){if(_0x579078){return _0x579078[_0xd3c0('0x27')]()['then'](function(){_0x3ac1b3['status'](0xcc)[_0xd3c0('0x1a')]();});}};}function handleEntityNotFound(_0x21f72d,_0x55320f){return function(_0x542b49){if(!_0x542b49){_0x21f72d[_0xd3c0('0x19')](0x194);}return _0x542b49;};}function handleError(_0x1bc543,_0x58d3cc){_0x58d3cc=_0x58d3cc||0x1f4;return function(_0x5910a5){logger[_0xd3c0('0x28')](_0x5910a5[_0xd3c0('0x29')]);if(_0x5910a5[_0xd3c0('0x2a')]){delete _0x5910a5['name'];}_0x1bc543[_0xd3c0('0x1b')](_0x58d3cc)[_0xd3c0('0x2b')](_0x5910a5);};}exports['index']=function(_0x200a5f,_0x149b6a){var _0xeeaecc={},_0x13eebe={},_0x32d6ac={'count':0x0,'rows':[]};var _0x54ebb2=_[_0xd3c0('0x2c')](db[_0xd3c0('0x2d')]['rawAttributes'],function(_0x41cebe){return{'name':_0x41cebe[_0xd3c0('0x2e')],'type':_0x41cebe['type']['key']};});_0x13eebe[_0xd3c0('0x2f')]=_[_0xd3c0('0x2c')](_0x54ebb2,_0xd3c0('0x2a'));_0x13eebe[_0xd3c0('0x30')]=_[_0xd3c0('0x31')](_0x200a5f[_0xd3c0('0x30')]);_0x13eebe[_0xd3c0('0x32')]=_[_0xd3c0('0x33')](_0x13eebe['model'],_0x13eebe['query']);_0xeeaecc['attributes']=_[_0xd3c0('0x33')](_0x13eebe['model'],qs['fields'](_0x200a5f[_0xd3c0('0x30')][_0xd3c0('0x34')]));_0xeeaecc[_0xd3c0('0x35')]=_0xeeaecc[_0xd3c0('0x35')][_0xd3c0('0x36')]?_0xeeaecc['attributes']:_0x13eebe['model'];if(!_0x200a5f['query']['hasOwnProperty'](_0xd3c0('0x37'))){_0xeeaecc[_0xd3c0('0x1e')]=qs[_0xd3c0('0x1e')](_0x200a5f[_0xd3c0('0x30')][_0xd3c0('0x1e')]);_0xeeaecc[_0xd3c0('0x20')]=qs[_0xd3c0('0x20')](_0x200a5f[_0xd3c0('0x30')]['offset']);}_0xeeaecc['order']=qs[_0xd3c0('0x38')](_0x200a5f['query'][_0xd3c0('0x38')]);_0xeeaecc[_0xd3c0('0x39')]=qs[_0xd3c0('0x32')](_[_0xd3c0('0x3a')](_0x200a5f[_0xd3c0('0x30')],_0x13eebe[_0xd3c0('0x32')]),_0x54ebb2);if(_0x200a5f['query'][_0xd3c0('0x3b')]){_0xeeaecc[_0xd3c0('0x39')]=_[_0xd3c0('0x3c')](_0xeeaecc[_0xd3c0('0x39')],{'$or':_[_0xd3c0('0x2c')](_0x54ebb2,function(_0x23af64){if(_0x23af64['type']!=='VIRTUAL'){var _0x31a8b6={};_0x31a8b6[_0x23af64[_0xd3c0('0x2a')]]={'$like':'%'+_0x200a5f[_0xd3c0('0x30')][_0xd3c0('0x3b')]+'%'};return _0x31a8b6;}})});}_0xeeaecc=_[_0xd3c0('0x3c')]({},_0xeeaecc,_0x200a5f[_0xd3c0('0x3d')]);var _0x39d815={'where':_0xeeaecc[_0xd3c0('0x39')]};return db[_0xd3c0('0x2d')]['count'](_0x39d815)[_0xd3c0('0x26')](function(_0x31647e){_0x32d6ac[_0xd3c0('0x1f')]=_0x31647e;if(_0x200a5f[_0xd3c0('0x30')]['includeAll']){_0xeeaecc['include']=[{'all':!![]}];}return db[_0xd3c0('0x2d')]['findAll'](_0xeeaecc);})['then'](function(_0x3a56ab){_0x32d6ac[_0xd3c0('0x3e')]=_0x3a56ab;return _0x32d6ac;})[_0xd3c0('0x26')](respondWithFilteredResult(_0x149b6a,_0xeeaecc))['catch'](handleError(_0x149b6a,null));};exports['show']=function(_0x429d41,_0x5c2175){var _0xcb1250={'raw':![],'where':{'id':_0x429d41[_0xd3c0('0x3f')]['id']}},_0x1729f3={};_0x1729f3[_0xd3c0('0x2f')]=_[_0xd3c0('0x31')](db[_0xd3c0('0x2d')][_0xd3c0('0x40')]);_0x1729f3[_0xd3c0('0x30')]=_[_0xd3c0('0x31')](_0x429d41[_0xd3c0('0x30')]);_0x1729f3[_0xd3c0('0x32')]=_[_0xd3c0('0x33')](_0x1729f3[_0xd3c0('0x2f')],_0x1729f3['query']);_0xcb1250[_0xd3c0('0x35')]=_[_0xd3c0('0x33')](_0x1729f3[_0xd3c0('0x2f')],qs['fields'](_0x429d41[_0xd3c0('0x30')][_0xd3c0('0x34')]));_0xcb1250[_0xd3c0('0x35')]=_0xcb1250[_0xd3c0('0x35')][_0xd3c0('0x36')]?_0xcb1250['attributes']:_0x1729f3['model'];if(_0x429d41[_0xd3c0('0x30')][_0xd3c0('0x41')]){_0xcb1250['include']=[{'all':!![]}];}_0xcb1250=_[_0xd3c0('0x3c')]({},_0xcb1250,_0x429d41[_0xd3c0('0x3d')]);return db[_0xd3c0('0x2d')][_0xd3c0('0x42')](_0xcb1250)[_0xd3c0('0x26')](handleEntityNotFound(_0x5c2175,null))[_0xd3c0('0x26')](respondWithResult(_0x5c2175,null))[_0xd3c0('0x43')](handleError(_0x5c2175,null));};exports['create']=function(_0x36e881,_0x5b9ff9){return db[_0xd3c0('0x2d')][_0xd3c0('0x44')](_0x36e881[_0xd3c0('0x45')],{})[_0xd3c0('0x26')](respondWithResult(_0x5b9ff9,0xc9))['catch'](handleError(_0x5b9ff9,null));};exports['update']=function(_0x498204,_0x481dc5){if(_0x498204['body']['id']){delete _0x498204['body']['id'];}return db['FreshdeskAccount'][_0xd3c0('0x42')]({'where':{'id':_0x498204[_0xd3c0('0x3f')]['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0x481dc5,null))[_0xd3c0('0x26')](saveUpdates(_0x498204[_0xd3c0('0x45')],null))[_0xd3c0('0x26')](respondWithResult(_0x481dc5,null))[_0xd3c0('0x43')](handleError(_0x481dc5,null));};exports['destroy']=function(_0x326263,_0xa112d9){return db[_0xd3c0('0x2d')]['find']({'where':{'id':_0x326263[_0xd3c0('0x3f')]['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0xa112d9,null))[_0xd3c0('0x26')](removeEntity(_0xa112d9,null))[_0xd3c0('0x43')](handleError(_0xa112d9,null));};exports[_0xd3c0('0x46')]=function(_0x49f9d6,_0xd2f4b1,_0xcf4a){var _0x37f16f={};var _0x2f5895={};var _0x132ebd;var _0x2bcd13;return db[_0xd3c0('0x2d')][_0xd3c0('0x47')]({'where':{'id':_0x49f9d6[_0xd3c0('0x3f')]['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0xd2f4b1,null))[_0xd3c0('0x26')](function(_0x2fddb5){if(_0x2fddb5){_0x132ebd=_0x2fddb5;_0x2f5895['model']=_[_0xd3c0('0x31')](db[_0xd3c0('0x48')]['rawAttributes']);_0x2f5895['query']=_[_0xd3c0('0x31')](_0x49f9d6[_0xd3c0('0x30')]);_0x2f5895[_0xd3c0('0x32')]=_['intersection'](_0x2f5895[_0xd3c0('0x2f')],_0x2f5895['query']);_0x37f16f[_0xd3c0('0x35')]=_[_0xd3c0('0x33')](_0x2f5895['model'],qs['fields'](_0x49f9d6['query'][_0xd3c0('0x34')]));_0x37f16f[_0xd3c0('0x35')]=_0x37f16f[_0xd3c0('0x35')][_0xd3c0('0x36')]?_0x37f16f[_0xd3c0('0x35')]:_0x2f5895[_0xd3c0('0x2f')];_0x37f16f[_0xd3c0('0x49')]=qs[_0xd3c0('0x38')](_0x49f9d6[_0xd3c0('0x30')][_0xd3c0('0x38')]);_0x37f16f['where']=qs[_0xd3c0('0x32')](_[_0xd3c0('0x3a')](_0x49f9d6[_0xd3c0('0x30')],_0x2f5895[_0xd3c0('0x32')]));if(_0x49f9d6['query'][_0xd3c0('0x3b')]){_0x37f16f[_0xd3c0('0x39')]=_['merge'](_0x37f16f['where'],{'$or':_['map'](_0x37f16f[_0xd3c0('0x35')],function(_0x241dcd){var _0x50ab9d={};_0x50ab9d[_0x241dcd]={'$like':'%'+_0x49f9d6['query'][_0xd3c0('0x3b')]+'%'};return _0x50ab9d;})});}_0x37f16f=_['merge']({},_0x37f16f,_0x49f9d6[_0xd3c0('0x3d')]);return _0x132ebd['getConfigurations'](_0x37f16f);}})[_0xd3c0('0x26')](function(_0x3b06a6){if(_0x3b06a6){_0x2bcd13=_0x3b06a6[_0xd3c0('0x36')];if(!_0x49f9d6[_0xd3c0('0x30')][_0xd3c0('0x4a')](_0xd3c0('0x37'))){_0x37f16f[_0xd3c0('0x1e')]=qs['limit'](_0x49f9d6[_0xd3c0('0x30')][_0xd3c0('0x1e')]);_0x37f16f[_0xd3c0('0x20')]=qs[_0xd3c0('0x20')](_0x49f9d6[_0xd3c0('0x30')][_0xd3c0('0x20')]);}return _0x132ebd['getConfigurations'](_0x37f16f);}})[_0xd3c0('0x26')](function(_0x140b72){if(_0x140b72){return _0x140b72?{'count':_0x2bcd13,'rows':_0x140b72}:null;}})[_0xd3c0('0x26')](respondWithResult(_0xd2f4b1,null))[_0xd3c0('0x43')](handleError(_0xd2f4b1,null));};exports[_0xd3c0('0x4b')]=function(_0x336d75,_0x24f208,_0x2a0831){if(_0x336d75[_0xd3c0('0x45')]['id']){delete _0x336d75[_0xd3c0('0x45')]['id'];}return db[_0xd3c0('0x2d')][_0xd3c0('0x47')]({'where':{'id':_0x336d75['params']['id']}})['then'](handleEntityNotFound(_0x24f208,null))[_0xd3c0('0x26')](function(_0x2d6a0f){if(_0x2d6a0f){_0x336d75[_0xd3c0('0x45')][_0xd3c0('0x4c')]=_0x2d6a0f['id'];_0x336d75[_0xd3c0('0x45')]['Subjects']=integrations[_0xd3c0('0x4d')](_0x336d75[_0xd3c0('0x45')][_0xd3c0('0x4e')],_0x336d75[_0xd3c0('0x45')]['type']);_0x336d75['body'][_0xd3c0('0x4f')]=integrations[_0xd3c0('0x50')](_0x336d75['body'][_0xd3c0('0x4e')],_0x336d75['body'][_0xd3c0('0x51')]);return db[_0xd3c0('0x48')][_0xd3c0('0x44')](_0x336d75[_0xd3c0('0x45')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0xd3c0('0x52')],'as':_0xd3c0('0x4f')}]});}return null;})['then'](respondWithResult(_0x24f208,null))[_0xd3c0('0x43')](handleError(_0x24f208,null));};exports[_0xd3c0('0x53')]=function(_0x54a2c3,_0x87f169,_0x45d6f6){var _0x5a3ca6='';return db[_0xd3c0('0x2d')]['findOne']({'where':{'id':_0x54a2c3[_0xd3c0('0x3f')]['id']},'attributes':['id',_0xd3c0('0x54'),_0xd3c0('0x55')]})[_0xd3c0('0x26')](handleEntityNotFound(_0x87f169,null))[_0xd3c0('0x26')](function(_0x1c39b3){if(_0x1c39b3){_0x5a3ca6=_0x1c39b3['remoteUri'];var _0x43e379=_0x5a3ca6[_0xd3c0('0x56')](-0x1);if(_0x43e379==='/'){_0x5a3ca6=_0x5a3ca6[_0xd3c0('0x57')](0x0,_0x5a3ca6[_0xd3c0('0x58')](_0x43e379));}return rp({'method':'GET','uri':util[_0xd3c0('0x59')](_0xd3c0('0x5a'),_0x5a3ca6,_0xd3c0('0x5b')),'headers':{'Authorization':util['format'](_0xd3c0('0x5c'),new Buffer(util[_0xd3c0('0x59')](_0xd3c0('0x5d'),_0x1c39b3[_0xd3c0('0x55')]))['toString'](_0xd3c0('0x5e')))},'json':!![]});}})[_0xd3c0('0x26')](function(_0x32fd74){if(_0x32fd74){var _0x5ce8be=[_0xd3c0('0x5f'),_0xd3c0('0x60'),_0xd3c0('0x61'),_0xd3c0('0x62'),_0xd3c0('0x1b'),_0xd3c0('0x63'),_0xd3c0('0x64'),_0xd3c0('0x65'),_0xd3c0('0x66'),_0xd3c0('0x64'),_0xd3c0('0x67')];_[_0xd3c0('0x68')](_0x32fd74,function(_0x2c732e){return _0x5ce8be['includes'](_0x2c732e[_0xd3c0('0x2a')])||!_0x2c732e[_0xd3c0('0x69')]&&_0x2c732e[_0xd3c0('0x51')]!==_0xd3c0('0x6a')&&_0x2c732e[_0xd3c0('0x51')]!==_0xd3c0('0x6b');});return{'count':_0x32fd74[_0xd3c0('0x36')],'rows':_[_0xd3c0('0x2c')](_0x32fd74,function(_0x3797d3){return{'id':_0x3797d3[_0xd3c0('0x2a')],'name':_0x3797d3['label'],'custom':!_0x3797d3[_0xd3c0('0x69')],'options':_0x3797d3[_0xd3c0('0x6c')]?_[_0xd3c0('0x2c')](_0x3797d3['choices'],function(_0x3bab5a){return{'name':_[_0xd3c0('0x6d')](_0x3bab5a),'value':_0x3bab5a};}):[]};})};}})[_0xd3c0('0x26')](respondWithResult(_0x87f169,null))[_0xd3c0('0x43')](function(_0x1e8e1d){var _0x12f45c=_0x54a2c3[_0xd3c0('0x30')][_0xd3c0('0x6e')]?0x1f4:_0x1e8e1d[_0xd3c0('0x6f')]||0x1f4;logger['error'](_0xd3c0('0x70'),_0xd3c0('0x53'),_0x12f45c,JSON['stringify'](_0x1e8e1d));delete _0x1e8e1d[_0xd3c0('0x2a')];if(_0x12f45c===0x191){_0x12f45c=0x190;}_0x87f169['status'](_0x12f45c)['send'](_0x54a2c3[_0xd3c0('0x30')][_0xd3c0('0x6e')]?{'message':_0xd3c0('0x71'),'statusCode':_0x1e8e1d[_0xd3c0('0x6f')]}:_0x1e8e1d);});}; \ No newline at end of file +var _0x4522=['FreshdeskAccount','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','catch','show','params','include','find','create','body','findOne','FreshdeskConfiguration','getConfigurations','hasOwnProperty','AccountId','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','requester','agent','description','priority','ticket_type','group','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','name','index'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x4522,0x1a0));var _0x2452=function(_0x47ed1a,_0x34e1d8){_0x47ed1a=_0x47ed1a-0x0;var _0x23b059=_0x4522[_0x47ed1a];return _0x23b059;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2452('0x0'));var jsonpatch=require(_0x2452('0x1'));var rp=require(_0x2452('0x2'));var moment=require('moment');var BPromise=require(_0x2452('0x3'));var Mustache=require(_0x2452('0x4'));var util=require(_0x2452('0x5'));var path=require(_0x2452('0x6'));var sox=require(_0x2452('0x7'));var csv=require(_0x2452('0x8'));var ejs=require(_0x2452('0x9'));var fs=require('fs');var fs_extra=require(_0x2452('0xa'));var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x8'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2452('0x13'))(_0x2452('0x14'));var utils=require(_0x2452('0x15'));var config=require(_0x2452('0x16'));var licenseUtil=require(_0x2452('0x17'));var db=require(_0x2452('0x18'))['db'];var integrations=require(_0x2452('0x19'));function respondWithStatusCode(_0x2377b9,_0x4968e8){_0x4968e8=_0x4968e8||0xcc;return function(_0x529fb2){if(_0x529fb2){return _0x2377b9['sendStatus'](_0x4968e8);}return _0x2377b9[_0x2452('0x1a')](_0x4968e8)['end']();};}function respondWithResult(_0x33e592,_0x506cd4){_0x506cd4=_0x506cd4||0xc8;return function(_0x209a43){if(_0x209a43){return _0x33e592[_0x2452('0x1a')](_0x506cd4)['json'](_0x209a43);}};}function respondWithFilteredResult(_0x1dbadf,_0x47930c){return function(_0x3dd8cc){if(_0x3dd8cc){var _0x734b88=typeof _0x47930c[_0x2452('0x1b')]===_0x2452('0x1c')&&typeof _0x47930c['limit']===_0x2452('0x1c');var _0x16e33a=_0x3dd8cc['count'];var _0x4802ad=_0x734b88?0x0:_0x47930c[_0x2452('0x1b')];var _0x37c6a6=_0x734b88?_0x3dd8cc[_0x2452('0x1d')]:_0x47930c['offset']+_0x47930c[_0x2452('0x1e')];var _0x467963;if(_0x37c6a6>=_0x16e33a){_0x37c6a6=_0x16e33a;_0x467963=0xc8;}else{_0x467963=0xce;}_0x1dbadf[_0x2452('0x1a')](_0x467963);return _0x1dbadf[_0x2452('0x1f')](_0x2452('0x20'),_0x4802ad+'-'+_0x37c6a6+'/'+_0x16e33a)[_0x2452('0x21')](_0x3dd8cc);}return null;};}function patchUpdates(_0x3f48c2){return function(_0xea452e){try{jsonpatch['apply'](_0xea452e,_0x3f48c2,!![]);}catch(_0x48f356){return BPromise[_0x2452('0x22')](_0x48f356);}return _0xea452e[_0x2452('0x23')]();};}function saveUpdates(_0x4bb3ff,_0x17d0a0){return function(_0x395cf1){if(_0x395cf1){return _0x395cf1[_0x2452('0x24')](_0x4bb3ff)[_0x2452('0x25')](function(_0x285281){return _0x285281;});}return null;};}function removeEntity(_0x397f21,_0x155caa){return function(_0x543b06){if(_0x543b06){return _0x543b06[_0x2452('0x26')]()[_0x2452('0x25')](function(){_0x397f21[_0x2452('0x1a')](0xcc)[_0x2452('0x27')]();});}};}function handleEntityNotFound(_0x3a4326,_0x516fcf){return function(_0x48783a){if(!_0x48783a){_0x3a4326[_0x2452('0x28')](0x194);}return _0x48783a;};}function handleError(_0x159ba1,_0x46fcbb){_0x46fcbb=_0x46fcbb||0x1f4;return function(_0x3a183c){logger[_0x2452('0x29')](_0x3a183c['stack']);if(_0x3a183c[_0x2452('0x2a')]){delete _0x3a183c[_0x2452('0x2a')];}_0x159ba1['status'](_0x46fcbb)['send'](_0x3a183c);};}exports[_0x2452('0x2b')]=function(_0xe8d39b,_0x36cb6c){var _0x28e6ea={},_0x43fde0={},_0x258fa6={'count':0x0,'rows':[]};var _0x504162=_['map'](db[_0x2452('0x2c')][_0x2452('0x2d')],function(_0x130565){return{'name':_0x130565['fieldName'],'type':_0x130565[_0x2452('0x2e')][_0x2452('0x2f')]};});_0x43fde0['model']=_[_0x2452('0x30')](_0x504162,_0x2452('0x2a'));_0x43fde0[_0x2452('0x31')]=_[_0x2452('0x32')](_0xe8d39b[_0x2452('0x31')]);_0x43fde0[_0x2452('0x33')]=_[_0x2452('0x34')](_0x43fde0[_0x2452('0x35')],_0x43fde0[_0x2452('0x31')]);_0x28e6ea[_0x2452('0x36')]=_[_0x2452('0x34')](_0x43fde0[_0x2452('0x35')],qs[_0x2452('0x37')](_0xe8d39b['query'][_0x2452('0x37')]));_0x28e6ea[_0x2452('0x36')]=_0x28e6ea['attributes'][_0x2452('0x38')]?_0x28e6ea['attributes']:_0x43fde0[_0x2452('0x35')];if(!_0xe8d39b[_0x2452('0x31')]['hasOwnProperty'](_0x2452('0x39'))){_0x28e6ea[_0x2452('0x1e')]=qs[_0x2452('0x1e')](_0xe8d39b['query'][_0x2452('0x1e')]);_0x28e6ea[_0x2452('0x1b')]=qs['offset'](_0xe8d39b[_0x2452('0x31')][_0x2452('0x1b')]);}_0x28e6ea[_0x2452('0x3a')]=qs[_0x2452('0x3b')](_0xe8d39b[_0x2452('0x31')]['sort']);_0x28e6ea['where']=qs['filters'](_[_0x2452('0x3c')](_0xe8d39b[_0x2452('0x31')],_0x43fde0[_0x2452('0x33')]),_0x504162);if(_0xe8d39b[_0x2452('0x31')][_0x2452('0x3d')]){_0x28e6ea['where']=_[_0x2452('0x3e')](_0x28e6ea['where'],{'$or':_['map'](_0x504162,function(_0x28bc06){if(_0x28bc06['type']!==_0x2452('0x3f')){var _0xac3b74={};_0xac3b74[_0x28bc06['name']]={'$like':'%'+_0xe8d39b[_0x2452('0x31')][_0x2452('0x3d')]+'%'};return _0xac3b74;}})});}_0x28e6ea=_[_0x2452('0x3e')]({},_0x28e6ea,_0xe8d39b[_0x2452('0x40')]);var _0x2babbe={'where':_0x28e6ea[_0x2452('0x41')]};return db[_0x2452('0x2c')][_0x2452('0x1d')](_0x2babbe)['then'](function(_0x262467){_0x258fa6['count']=_0x262467;if(_0xe8d39b[_0x2452('0x31')][_0x2452('0x42')]){_0x28e6ea['include']=[{'all':!![]}];}return db[_0x2452('0x2c')][_0x2452('0x43')](_0x28e6ea);})[_0x2452('0x25')](function(_0x13c6ac){_0x258fa6[_0x2452('0x44')]=_0x13c6ac;return _0x258fa6;})['then'](respondWithFilteredResult(_0x36cb6c,_0x28e6ea))[_0x2452('0x45')](handleError(_0x36cb6c,null));};exports[_0x2452('0x46')]=function(_0x5379a9,_0xfabbd8){var _0x449b89={'raw':![],'where':{'id':_0x5379a9[_0x2452('0x47')]['id']}},_0xf21655={};_0xf21655['model']=_[_0x2452('0x32')](db[_0x2452('0x2c')][_0x2452('0x2d')]);_0xf21655[_0x2452('0x31')]=_[_0x2452('0x32')](_0x5379a9[_0x2452('0x31')]);_0xf21655['filters']=_[_0x2452('0x34')](_0xf21655['model'],_0xf21655[_0x2452('0x31')]);_0x449b89[_0x2452('0x36')]=_['intersection'](_0xf21655['model'],qs['fields'](_0x5379a9['query'][_0x2452('0x37')]));_0x449b89['attributes']=_0x449b89[_0x2452('0x36')]['length']?_0x449b89[_0x2452('0x36')]:_0xf21655[_0x2452('0x35')];if(_0x5379a9['query']['includeAll']){_0x449b89[_0x2452('0x48')]=[{'all':!![]}];}_0x449b89=_['merge']({},_0x449b89,_0x5379a9[_0x2452('0x40')]);return db[_0x2452('0x2c')][_0x2452('0x49')](_0x449b89)[_0x2452('0x25')](handleEntityNotFound(_0xfabbd8,null))['then'](respondWithResult(_0xfabbd8,null))['catch'](handleError(_0xfabbd8,null));};exports[_0x2452('0x4a')]=function(_0x38615e,_0x40a550){return db[_0x2452('0x2c')][_0x2452('0x4a')](_0x38615e['body'],{})[_0x2452('0x25')](respondWithResult(_0x40a550,0xc9))['catch'](handleError(_0x40a550,null));};exports[_0x2452('0x24')]=function(_0x53fd05,_0x454666){if(_0x53fd05[_0x2452('0x4b')]['id']){delete _0x53fd05['body']['id'];}return db[_0x2452('0x2c')]['find']({'where':{'id':_0x53fd05[_0x2452('0x47')]['id']}})['then'](handleEntityNotFound(_0x454666,null))['then'](saveUpdates(_0x53fd05['body'],null))[_0x2452('0x25')](respondWithResult(_0x454666,null))[_0x2452('0x45')](handleError(_0x454666,null));};exports[_0x2452('0x26')]=function(_0x4b705f,_0x454eca){return db[_0x2452('0x2c')][_0x2452('0x49')]({'where':{'id':_0x4b705f[_0x2452('0x47')]['id']}})[_0x2452('0x25')](handleEntityNotFound(_0x454eca,null))['then'](removeEntity(_0x454eca,null))[_0x2452('0x45')](handleError(_0x454eca,null));};exports['getConfigurations']=function(_0x163510,_0x44a6f,_0x1818a9){var _0x51eb53={};var _0x6ee99d={};var _0x2096e2;var _0x3a3a85;return db[_0x2452('0x2c')][_0x2452('0x4c')]({'where':{'id':_0x163510['params']['id']}})[_0x2452('0x25')](handleEntityNotFound(_0x44a6f,null))['then'](function(_0x2d9e86){if(_0x2d9e86){_0x2096e2=_0x2d9e86;_0x6ee99d['model']=_[_0x2452('0x32')](db[_0x2452('0x4d')]['rawAttributes']);_0x6ee99d[_0x2452('0x31')]=_[_0x2452('0x32')](_0x163510[_0x2452('0x31')]);_0x6ee99d[_0x2452('0x33')]=_[_0x2452('0x34')](_0x6ee99d[_0x2452('0x35')],_0x6ee99d[_0x2452('0x31')]);_0x51eb53[_0x2452('0x36')]=_[_0x2452('0x34')](_0x6ee99d[_0x2452('0x35')],qs[_0x2452('0x37')](_0x163510['query'][_0x2452('0x37')]));_0x51eb53['attributes']=_0x51eb53[_0x2452('0x36')]['length']?_0x51eb53[_0x2452('0x36')]:_0x6ee99d[_0x2452('0x35')];_0x51eb53[_0x2452('0x3a')]=qs[_0x2452('0x3b')](_0x163510[_0x2452('0x31')][_0x2452('0x3b')]);_0x51eb53[_0x2452('0x41')]=qs[_0x2452('0x33')](_[_0x2452('0x3c')](_0x163510[_0x2452('0x31')],_0x6ee99d[_0x2452('0x33')]));if(_0x163510['query'][_0x2452('0x3d')]){_0x51eb53[_0x2452('0x41')]=_[_0x2452('0x3e')](_0x51eb53[_0x2452('0x41')],{'$or':_[_0x2452('0x30')](_0x51eb53[_0x2452('0x36')],function(_0x4f0fe9){var _0x356485={};_0x356485[_0x4f0fe9]={'$like':'%'+_0x163510[_0x2452('0x31')]['filter']+'%'};return _0x356485;})});}_0x51eb53=_[_0x2452('0x3e')]({},_0x51eb53,_0x163510[_0x2452('0x40')]);return _0x2096e2[_0x2452('0x4e')](_0x51eb53);}})[_0x2452('0x25')](function(_0x2f1b16){if(_0x2f1b16){_0x3a3a85=_0x2f1b16[_0x2452('0x38')];if(!_0x163510[_0x2452('0x31')][_0x2452('0x4f')](_0x2452('0x39'))){_0x51eb53[_0x2452('0x1e')]=qs[_0x2452('0x1e')](_0x163510['query']['limit']);_0x51eb53[_0x2452('0x1b')]=qs['offset'](_0x163510[_0x2452('0x31')][_0x2452('0x1b')]);}return _0x2096e2[_0x2452('0x4e')](_0x51eb53);}})[_0x2452('0x25')](function(_0x1b3450){if(_0x1b3450){return _0x1b3450?{'count':_0x3a3a85,'rows':_0x1b3450}:null;}})[_0x2452('0x25')](respondWithResult(_0x44a6f,null))['catch'](handleError(_0x44a6f,null));};exports['addConfiguration']=function(_0x19d6c7,_0x548240,_0x222dea){if(_0x19d6c7['body']['id']){delete _0x19d6c7[_0x2452('0x4b')]['id'];}return db[_0x2452('0x2c')][_0x2452('0x4c')]({'where':{'id':_0x19d6c7[_0x2452('0x47')]['id']}})['then'](handleEntityNotFound(_0x548240,null))['then'](function(_0x505d5a){if(_0x505d5a){_0x19d6c7[_0x2452('0x4b')][_0x2452('0x50')]=_0x505d5a['id'];_0x19d6c7['body']['Subjects']=integrations['getSubjects'](_0x19d6c7['body']['channel'],_0x19d6c7[_0x2452('0x4b')]['type']);_0x19d6c7['body'][_0x2452('0x51')]=integrations[_0x2452('0x52')](_0x19d6c7[_0x2452('0x4b')][_0x2452('0x53')],_0x19d6c7[_0x2452('0x4b')][_0x2452('0x2e')]);return db['FreshdeskConfiguration'][_0x2452('0x4a')](_0x19d6c7[_0x2452('0x4b')],{'include':[{'model':db[_0x2452('0x54')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x2452('0x51')}]});}return null;})[_0x2452('0x25')](respondWithResult(_0x548240,null))[_0x2452('0x45')](handleError(_0x548240,null));};exports[_0x2452('0x55')]=function(_0x401628,_0x336fc6,_0x4dd13d){var _0x2b2033='';return db['FreshdeskAccount'][_0x2452('0x4c')]({'where':{'id':_0x401628[_0x2452('0x47')]['id']},'attributes':['id',_0x2452('0x56'),_0x2452('0x57')]})['then'](handleEntityNotFound(_0x336fc6,null))[_0x2452('0x25')](function(_0x132cd3){if(_0x132cd3){_0x2b2033=_0x132cd3['remoteUri'];var _0x20f796=_0x2b2033[_0x2452('0x58')](-0x1);if(_0x20f796==='/'){_0x2b2033=_0x2b2033[_0x2452('0x59')](0x0,_0x2b2033[_0x2452('0x5a')](_0x20f796));}return rp({'method':_0x2452('0x5b'),'uri':util[_0x2452('0x5c')](_0x2452('0x5d'),_0x2b2033,_0x2452('0x5e')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x2452('0x5c')](_0x2452('0x5f'),_0x132cd3[_0x2452('0x57')]))[_0x2452('0x60')]('base64'))},'json':!![]});}})[_0x2452('0x25')](function(_0x1ce631){if(_0x1ce631){var _0x2101f3=[_0x2452('0x61'),'subject',_0x2452('0x62'),_0x2452('0x63'),_0x2452('0x1a'),_0x2452('0x64'),'group','source',_0x2452('0x65'),_0x2452('0x66'),'company'];_[_0x2452('0x67')](_0x1ce631,function(_0xe02ef1){return _0x2101f3[_0x2452('0x68')](_0xe02ef1[_0x2452('0x2a')])||!_0xe02ef1[_0x2452('0x69')]&&_0xe02ef1[_0x2452('0x2e')]!==_0x2452('0x6a')&&_0xe02ef1[_0x2452('0x2e')]!==_0x2452('0x6b');});return{'count':_0x1ce631[_0x2452('0x38')],'rows':_[_0x2452('0x30')](_0x1ce631,function(_0x45bf4b){return{'id':_0x45bf4b[_0x2452('0x2a')],'name':_0x45bf4b[_0x2452('0x6c')],'custom':!_0x45bf4b[_0x2452('0x69')],'options':_0x45bf4b[_0x2452('0x6d')]?_['map'](_0x45bf4b[_0x2452('0x6d')],function(_0x40ca65){return{'name':_[_0x2452('0x6e')](_0x40ca65),'value':_0x40ca65};}):[]};})};}})['then'](respondWithResult(_0x336fc6,null))['catch'](function(_0x51cb2b){var _0x43ac2c=_0x401628[_0x2452('0x31')][_0x2452('0x6f')]?0x1f4:_0x51cb2b[_0x2452('0x70')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x43ac2c,JSON[_0x2452('0x71')](_0x51cb2b));delete _0x51cb2b['name'];if(_0x43ac2c===0x191){_0x43ac2c=0x190;}_0x336fc6[_0x2452('0x1a')](_0x43ac2c)['send'](_0x401628[_0x2452('0x31')]['test']?{'message':_0x2452('0x72'),'statusCode':_0x51cb2b['statusCode']}:_0x51cb2b);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0ced7e8..536462c 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 _0x3eb6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger'];(function(_0x3fa9ed,_0x49e688){var _0x2c3063=function(_0x3c6def){while(--_0x3c6def){_0x3fa9ed['push'](_0x3fa9ed['shift']());}};_0x2c3063(++_0x49e688);}(_0x3eb6,0x1af));var _0x63eb=function(_0x347a0c,_0x6624e7){_0x347a0c=_0x347a0c-0x0;var _0x184eec=_0x3eb6[_0x347a0c];return _0x184eec;};'use strict';var _=require(_0x63eb('0x0'));var util=require(_0x63eb('0x1'));var logger=require(_0x63eb('0x2'))('api');var moment=require(_0x63eb('0x3'));var BPromise=require(_0x63eb('0x4'));var rp=require(_0x63eb('0x5'));var fs=require('fs');var path=require(_0x63eb('0x6'));var rimraf=require(_0x63eb('0x7'));var config=require(_0x63eb('0x8'));var attributes=require(_0x63eb('0x9'));var integrations=require(_0x63eb('0xa'));module[_0x63eb('0xb')]=function(_0x324fb7,_0x42f1c1){return _0x324fb7[_0x63eb('0xc')]('FreshdeskAccount',attributes,{'tableName':_0x63eb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9865=['lodash','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x23925c,_0x524ca3){var _0x3bbee3=function(_0x316470){while(--_0x316470){_0x23925c['push'](_0x23925c['shift']());}};_0x3bbee3(++_0x524ca3);}(_0x9865,0xbb));var _0x5986=function(_0x1a152f,_0xf89c26){_0x1a152f=_0x1a152f-0x0;var _0x13346a=_0x9865[_0x1a152f];return _0x13346a;};'use strict';var _=require(_0x5986('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5986('0x1'));var BPromise=require(_0x5986('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5986('0x3'));var rimraf=require(_0x5986('0x4'));var config=require(_0x5986('0x5'));var attributes=require(_0x5986('0x6'));var integrations=require(_0x5986('0x7'));module[_0x5986('0x8')]=function(_0x3f09bd,_0x272697){return _0x3f09bd[_0x5986('0x9')](_0x5986('0xa'),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 c72e6f0..64d1f4b 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 _0xd54c=['error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetFreshdeskAccount','find','ShowFreshdeskAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19769a,_0x472d4b){var _0x1554ad=function(_0x1a931b){while(--_0x1a931b){_0x19769a['push'](_0x19769a['shift']());}};_0x1554ad(++_0x472d4b);}(_0xd54c,0x171));var _0xcd54=function(_0x1a15d0,_0x13b74b){_0x1a15d0=_0x1a15d0-0x0;var _0x3ae8b7=_0xd54c[_0x1a15d0];return _0x3ae8b7;};'use strict';var _=require(_0xcd54('0x0'));var util=require('util');var moment=require(_0xcd54('0x1'));var BPromise=require(_0xcd54('0x2'));var rs=require(_0xcd54('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd54('0x4'))['db'];var utils=require(_0xcd54('0x5'));var logger=require('../../config/logger')(_0xcd54('0x6'));var config=require(_0xcd54('0x7'));var jayson=require(_0xcd54('0x8'));var client=jayson['client'][_0xcd54('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11c4df,_0x8100a4,_0x251305){return new BPromise(function(_0x5f07b0,_0x4951cd){return client[_0xcd54('0xa')](_0x11c4df,_0x251305)[_0xcd54('0xb')](function(_0x2f7ebd){logger[_0xcd54('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x8100a4,_0xcd54('0xd'));logger['debug'](_0xcd54('0xe'),_0x8100a4,_0xcd54('0xd'),JSON[_0xcd54('0xf')](_0x2f7ebd));if(_0x2f7ebd[_0xcd54('0x10')]){if(_0x2f7ebd['error']['code']===0x1f4){logger[_0xcd54('0x10')](_0xcd54('0x11'),_0x8100a4,_0x2f7ebd[_0xcd54('0x10')][_0xcd54('0x12')]);return _0x4951cd(_0x2f7ebd[_0xcd54('0x10')]['message']);}logger['error'](_0xcd54('0x11'),_0x8100a4,_0x2f7ebd['error'][_0xcd54('0x12')]);return _0x5f07b0(_0x2f7ebd[_0xcd54('0x10')][_0xcd54('0x12')]);}else{logger[_0xcd54('0xc')](_0xcd54('0x11'),_0x8100a4,_0xcd54('0xd'));_0x5f07b0(_0x2f7ebd[_0xcd54('0x13')][_0xcd54('0x12')]);}})[_0xcd54('0x14')](function(_0x3819d2){logger['error'](_0xcd54('0x11'),_0x8100a4,_0x3819d2);_0x4951cd(_0x3819d2);});});}exports['GetFreshdeskAccount']=function(_0x551375){var _0xea2f33=this;return new Promise(function(_0x546fe6,_0x46faa6){return db[_0xcd54('0x15')][_0xcd54('0x16')]({'raw':_0x551375[_0xcd54('0x17')]?_0x551375[_0xcd54('0x17')][_0xcd54('0x18')]===undefined?!![]:![]:!![],'where':_0x551375[_0xcd54('0x17')]?_0x551375[_0xcd54('0x17')][_0xcd54('0x19')]||null:null,'attributes':_0x551375[_0xcd54('0x17')]?_0x551375[_0xcd54('0x17')][_0xcd54('0x1a')]||null:null,'limit':_0x551375[_0xcd54('0x17')]?_0x551375['options'][_0xcd54('0x1b')]||null:null,'include':_0x551375[_0xcd54('0x17')]?_0x551375[_0xcd54('0x17')][_0xcd54('0x1c')]?_[_0xcd54('0x1d')](_0x551375['options'][_0xcd54('0x1c')],function(_0x3e89a7){return{'model':db[_0x3e89a7[_0xcd54('0x1e')]],'as':_0x3e89a7['as'],'attributes':_0x3e89a7['attributes'],'include':_0x3e89a7[_0xcd54('0x1c')]?_[_0xcd54('0x1d')](_0x3e89a7['include'],function(_0x5c48c8){return{'model':db[_0x5c48c8[_0xcd54('0x1e')]],'as':_0x5c48c8['as'],'attributes':_0x5c48c8[_0xcd54('0x1a')],'include':_0x5c48c8[_0xcd54('0x1c')]?_[_0xcd54('0x1d')](_0x5c48c8[_0xcd54('0x1c')],function(_0x2206d6){return{'model':db[_0x2206d6[_0xcd54('0x1e')]],'as':_0x2206d6['as'],'attributes':_0x2206d6['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd54('0xb')](function(_0x41e568){logger[_0xcd54('0xc')]('GetFreshdeskAccount',_0x551375);logger[_0xcd54('0x1f')](_0xcd54('0x20'),_0x551375,JSON['stringify'](_0x41e568));_0x546fe6(_0x41e568);})[_0xcd54('0x14')](function(_0x47196a){logger[_0xcd54('0x10')](_0xcd54('0x20'),_0x47196a[_0xcd54('0x12')],_0x551375);_0x46faa6(_0xea2f33[_0xcd54('0x10')](0x1f4,_0x47196a[_0xcd54('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x5bd8bf){var _0x37d26c=this;return new Promise(function(_0x2d4264,_0x5b5872){return db[_0xcd54('0x15')][_0xcd54('0x21')]({'raw':_0x5bd8bf['options']?_0x5bd8bf[_0xcd54('0x17')][_0xcd54('0x18')]===undefined?!![]:![]:!![],'where':_0x5bd8bf['options']?_0x5bd8bf['options'][_0xcd54('0x19')]||null:null,'attributes':_0x5bd8bf[_0xcd54('0x17')]?_0x5bd8bf[_0xcd54('0x17')]['attributes']||null:null,'include':_0x5bd8bf[_0xcd54('0x17')]?_0x5bd8bf[_0xcd54('0x17')]['include']?_['map'](_0x5bd8bf['options'][_0xcd54('0x1c')],function(_0x5a5ed2){return{'model':db[_0x5a5ed2[_0xcd54('0x1e')]],'as':_0x5a5ed2['as'],'attributes':_0x5a5ed2[_0xcd54('0x1a')],'include':_0x5a5ed2['include']?_['map'](_0x5a5ed2[_0xcd54('0x1c')],function(_0x325261){return{'model':db[_0x325261[_0xcd54('0x1e')]],'as':_0x325261['as'],'attributes':_0x325261[_0xcd54('0x1a')],'include':_0x325261[_0xcd54('0x1c')]?_[_0xcd54('0x1d')](_0x325261[_0xcd54('0x1c')],function(_0x14bc3b){return{'model':db[_0x14bc3b[_0xcd54('0x1e')]],'as':_0x14bc3b['as'],'attributes':_0x14bc3b[_0xcd54('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcd54('0xb')](function(_0xb73deb){logger[_0xcd54('0xc')](_0xcd54('0x22'),_0x5bd8bf);logger[_0xcd54('0x1f')]('ShowFreshdeskAccount',_0x5bd8bf,JSON[_0xcd54('0xf')](_0xb73deb));_0x2d4264(_0xb73deb);})['catch'](function(_0x28a469){logger['error'](_0xcd54('0x22'),_0x28a469[_0xcd54('0x12')],_0x5bd8bf);_0x5b5872(_0x37d26c[_0xcd54('0x10')](0x1f4,_0x28a469[_0xcd54('0x12')]));});});}; \ No newline at end of file +var _0x1d05=['then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','debug','ShowFreshdeskAccount','find','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1d05,0xc4));var _0x51d0=function(_0x5d1edd,_0x19f170){_0x5d1edd=_0x5d1edd-0x0;var _0x3d4813=_0x1d05[_0x5d1edd];return _0x3d4813;};'use strict';var _=require('lodash');var util=require(_0x51d0('0x0'));var moment=require(_0x51d0('0x1'));var BPromise=require(_0x51d0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51d0('0x3'));var db=require(_0x51d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x51d0('0x5'));var config=require(_0x51d0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4227cd,_0x32fd67,_0x4c1ebe){return new BPromise(function(_0x3b91cc,_0x21684f){return client['request'](_0x4227cd,_0x4c1ebe)[_0x51d0('0x7')](function(_0x429437){logger[_0x51d0('0x8')](_0x51d0('0x9'),_0x32fd67,_0x51d0('0xa'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x32fd67,_0x51d0('0xa'),JSON['stringify'](_0x429437));if(_0x429437[_0x51d0('0xb')]){if(_0x429437[_0x51d0('0xb')][_0x51d0('0xc')]===0x1f4){logger[_0x51d0('0xb')](_0x51d0('0x9'),_0x32fd67,_0x429437['error']['message']);return _0x21684f(_0x429437[_0x51d0('0xb')]['message']);}logger['error'](_0x51d0('0x9'),_0x32fd67,_0x429437['error'][_0x51d0('0xd')]);return _0x3b91cc(_0x429437['error'][_0x51d0('0xd')]);}else{logger['info'](_0x51d0('0x9'),_0x32fd67,_0x51d0('0xa'));_0x3b91cc(_0x429437[_0x51d0('0xe')]['message']);}})['catch'](function(_0x2ac913){logger[_0x51d0('0xb')](_0x51d0('0x9'),_0x32fd67,_0x2ac913);_0x21684f(_0x2ac913);});});}exports[_0x51d0('0xf')]=function(_0x2d4ca9){var _0x20d27e=this;return new Promise(function(_0xecf253,_0x31a0f1){return db[_0x51d0('0x10')][_0x51d0('0x11')]({'raw':_0x2d4ca9[_0x51d0('0x12')]?_0x2d4ca9[_0x51d0('0x12')][_0x51d0('0x13')]===undefined?!![]:![]:!![],'where':_0x2d4ca9[_0x51d0('0x12')]?_0x2d4ca9[_0x51d0('0x12')][_0x51d0('0x14')]||null:null,'attributes':_0x2d4ca9[_0x51d0('0x12')]?_0x2d4ca9['options'][_0x51d0('0x15')]||null:null,'limit':_0x2d4ca9[_0x51d0('0x12')]?_0x2d4ca9[_0x51d0('0x12')]['limit']||null:null,'include':_0x2d4ca9[_0x51d0('0x12')]?_0x2d4ca9[_0x51d0('0x12')][_0x51d0('0x16')]?_[_0x51d0('0x17')](_0x2d4ca9[_0x51d0('0x12')][_0x51d0('0x16')],function(_0x109343){return{'model':db[_0x109343[_0x51d0('0x18')]],'as':_0x109343['as'],'attributes':_0x109343['attributes'],'include':_0x109343[_0x51d0('0x16')]?_['map'](_0x109343[_0x51d0('0x16')],function(_0x265c37){return{'model':db[_0x265c37[_0x51d0('0x18')]],'as':_0x265c37['as'],'attributes':_0x265c37[_0x51d0('0x15')],'include':_0x265c37[_0x51d0('0x16')]?_['map'](_0x265c37['include'],function(_0x1d01e3){return{'model':db[_0x1d01e3[_0x51d0('0x18')]],'as':_0x1d01e3['as'],'attributes':_0x1d01e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x51d0('0x7')](function(_0xecd3cf){logger[_0x51d0('0x8')](_0x51d0('0xf'),_0x2d4ca9);logger[_0x51d0('0x19')](_0x51d0('0xf'),_0x2d4ca9,JSON['stringify'](_0xecd3cf));_0xecf253(_0xecd3cf);})['catch'](function(_0x5e3760){logger[_0x51d0('0xb')](_0x51d0('0xf'),_0x5e3760['message'],_0x2d4ca9);_0x31a0f1(_0x20d27e[_0x51d0('0xb')](0x1f4,_0x5e3760['message']));});});};exports[_0x51d0('0x1a')]=function(_0x792149){var _0x51e72a=this;return new Promise(function(_0x57267e,_0x11b42c){return db[_0x51d0('0x10')][_0x51d0('0x1b')]({'raw':_0x792149['options']?_0x792149[_0x51d0('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x792149[_0x51d0('0x12')]?_0x792149[_0x51d0('0x12')][_0x51d0('0x14')]||null:null,'attributes':_0x792149[_0x51d0('0x12')]?_0x792149[_0x51d0('0x12')][_0x51d0('0x15')]||null:null,'include':_0x792149[_0x51d0('0x12')]?_0x792149[_0x51d0('0x12')]['include']?_['map'](_0x792149[_0x51d0('0x12')][_0x51d0('0x16')],function(_0x209357){return{'model':db[_0x209357[_0x51d0('0x18')]],'as':_0x209357['as'],'attributes':_0x209357['attributes'],'include':_0x209357['include']?_[_0x51d0('0x17')](_0x209357['include'],function(_0x5b2623){return{'model':db[_0x5b2623[_0x51d0('0x18')]],'as':_0x5b2623['as'],'attributes':_0x5b2623[_0x51d0('0x15')],'include':_0x5b2623['include']?_[_0x51d0('0x17')](_0x5b2623[_0x51d0('0x16')],function(_0x5de6b8){return{'model':db[_0x5de6b8[_0x51d0('0x18')]],'as':_0x5de6b8['as'],'attributes':_0x5de6b8[_0x51d0('0x15')]};}):[]};}):[]};}):[]:[]})[_0x51d0('0x7')](function(_0x4467cd){logger[_0x51d0('0x8')](_0x51d0('0x1a'),_0x792149);logger['debug']('ShowFreshdeskAccount',_0x792149,JSON['stringify'](_0x4467cd));_0x57267e(_0x4467cd);})[_0x51d0('0x1c')](function(_0x264e70){logger['error'](_0x51d0('0x1a'),_0x264e70[_0x51d0('0xd')],_0x792149);_0x11b42c(_0x51e72a[_0x51d0('0xb')](0x1f4,_0x264e70['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 95892cc..f2bcfa8 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 _0x1716=['getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags'];(function(_0xc5b9d6,_0x345c43){var _0x454217=function(_0x318d47){while(--_0x318d47){_0xc5b9d6['push'](_0xc5b9d6['shift']());}};_0x454217(++_0x345c43);}(_0x1716,0xf0));var _0x6171=function(_0x417d39,_0x3237f8){_0x417d39=_0x417d39-0x0;var _0x32af30=_0x1716[_0x417d39];return _0x32af30;};'use strict';var multer=require(_0x6171('0x0'));var util=require(_0x6171('0x1'));var path=require(_0x6171('0x2'));var timeout=require(_0x6171('0x3'));var express=require(_0x6171('0x4'));var router=express[_0x6171('0x5')]();var fs_extra=require(_0x6171('0x6'));var auth=require(_0x6171('0x7'));var interaction=require(_0x6171('0x8'));var config=require(_0x6171('0x9'));var controller=require(_0x6171('0xa'));router[_0x6171('0xb')]('/',auth[_0x6171('0xc')](),controller[_0x6171('0xd')]);router[_0x6171('0xb')](_0x6171('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x6171('0xb')](_0x6171('0xf'),auth[_0x6171('0xc')](),controller[_0x6171('0x10')]);router[_0x6171('0xb')](_0x6171('0x11'),auth['isAuthenticated'](),controller[_0x6171('0x12')]);router[_0x6171('0xb')]('/:id/descriptions',auth[_0x6171('0xc')](),controller[_0x6171('0x13')]);router[_0x6171('0xb')](_0x6171('0x14'),auth['isAuthenticated'](),controller[_0x6171('0x15')]);router[_0x6171('0x16')]('/',auth[_0x6171('0xc')](),controller['create']);router[_0x6171('0x16')](_0x6171('0x14'),auth[_0x6171('0xc')](),controller[_0x6171('0x17')]);router[_0x6171('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6171('0x19')]);router[_0x6171('0x1a')](_0x6171('0xe'),auth['isAuthenticated'](),controller[_0x6171('0x1b')]);module[_0x6171('0x1c')]=router; \ No newline at end of file +var _0x3947=['/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields'];(function(_0x22fc4c,_0x4244f5){var _0x1b555d=function(_0x17eb43){while(--_0x17eb43){_0x22fc4c['push'](_0x22fc4c['shift']());}};_0x1b555d(++_0x4244f5);}(_0x3947,0x15e));var _0x7394=function(_0x3dbe70,_0x55a586){_0x3dbe70=_0x3dbe70-0x0;var _0x3601f8=_0x3947[_0x3dbe70];return _0x3601f8;};'use strict';var multer=require(_0x7394('0x0'));var util=require(_0x7394('0x1'));var path=require(_0x7394('0x2'));var timeout=require(_0x7394('0x3'));var express=require(_0x7394('0x4'));var router=express[_0x7394('0x5')]();var fs_extra=require(_0x7394('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7394('0x7'));var controller=require(_0x7394('0x8'));router[_0x7394('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7394('0x9')](_0x7394('0xa'),auth[_0x7394('0xb')](),controller[_0x7394('0xc')]);router[_0x7394('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7394('0xd')]);router[_0x7394('0x9')](_0x7394('0xe'),auth[_0x7394('0xb')](),controller['getSubjects']);router[_0x7394('0x9')](_0x7394('0xf'),auth[_0x7394('0xb')](),controller[_0x7394('0x10')]);router[_0x7394('0x9')](_0x7394('0x11'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth[_0x7394('0xb')](),controller[_0x7394('0x12')]);router[_0x7394('0x13')](_0x7394('0x11'),auth[_0x7394('0xb')](),controller[_0x7394('0x14')]);router[_0x7394('0x15')](_0x7394('0xa'),auth['isAuthenticated'](),controller[_0x7394('0x16')]);router[_0x7394('0x17')](_0x7394('0xa'),auth[_0x7394('0xb')](),controller[_0x7394('0x18')]);module[_0x7394('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 5895070..702dce3 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 _0x7f98=['exports','STRING'];(function(_0x3dbd9b,_0x37f93c){var _0x24aacd=function(_0x8ae821){while(--_0x8ae821){_0x3dbd9b['push'](_0x3dbd9b['shift']());}};_0x24aacd(++_0x37f93c);}(_0x7f98,0x1a8));var _0x87f9=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7f98[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require('sequelize');module[_0x87f9('0x0')]={'name':{'type':Sequelize[_0x87f9('0x1')]},'description':{'type':Sequelize[_0x87f9('0x1')]}}; \ No newline at end of file +var _0x9e91=['exports','STRING'];(function(_0x96e227,_0x43fd87){var _0x4c3b85=function(_0x5af4b7){while(--_0x5af4b7){_0x96e227['push'](_0x96e227['shift']());}};_0x4c3b85(++_0x43fd87);}(_0x9e91,0xb4));var _0x19e9=function(_0x2ea5fd,_0x442cd9){_0x2ea5fd=_0x2ea5fd-0x0;var _0x4e54a0=_0x9e91[_0x2ea5fd];return _0x4e54a0;};'use strict';var Sequelize=require('sequelize');module[_0x19e9('0x0')]={'name':{'type':Sequelize[_0x19e9('0x1')]},'description':{'type':Sequelize[_0x19e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index ae0af48..03b5c7d 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 _0xa55b=['sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','FreshdeskConfiguration','includeAll','findAll','rows','catch','params','rawAttributes','include','options','create','body','find','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xa55b,0x140));var _0xba55=function(_0x34ed77,_0x118c4f){_0x34ed77=_0x34ed77-0x0;var _0x251c75=_0xa55b[_0x34ed77];return _0x251c75;};'use strict';var emlformat=require(_0xba55('0x0'));var rimraf=require(_0xba55('0x1'));var zipdir=require(_0xba55('0x2'));var jsonpatch=require(_0xba55('0x3'));var rp=require(_0xba55('0x4'));var moment=require(_0xba55('0x5'));var BPromise=require(_0xba55('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xba55('0x7'));var sox=require(_0xba55('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba55('0x9'));var _=require(_0xba55('0xa'));var squel=require(_0xba55('0xb'));var crypto=require('crypto');var jsforce=require(_0xba55('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xba55('0xd'));var querystring=require(_0xba55('0xe'));var Papa=require(_0xba55('0xf'));var Redis=require(_0xba55('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xba55('0x11'));var as=require(_0xba55('0x12'));var hardwareService=require(_0xba55('0x13'));var logger=require(_0xba55('0x14'))(_0xba55('0x15'));var utils=require(_0xba55('0x16'));var config=require(_0xba55('0x17'));var licenseUtil=require(_0xba55('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12d481,_0x34094f){_0x34094f=_0x34094f||0xcc;return function(_0x2cdd59){if(_0x2cdd59){return _0x12d481[_0xba55('0x19')](_0x34094f);}return _0x12d481[_0xba55('0x1a')](_0x34094f)[_0xba55('0x1b')]();};}function respondWithResult(_0x1be035,_0x4fa4b0){_0x4fa4b0=_0x4fa4b0||0xc8;return function(_0x2aaef8){if(_0x2aaef8){return _0x1be035[_0xba55('0x1a')](_0x4fa4b0)[_0xba55('0x1c')](_0x2aaef8);}};}function respondWithFilteredResult(_0x28997b,_0x5cfd40){return function(_0x4543aa){if(_0x4543aa){var _0x2c4108=typeof _0x5cfd40[_0xba55('0x1d')]===_0xba55('0x1e')&&typeof _0x5cfd40['limit']===_0xba55('0x1e');var _0x304c6d=_0x4543aa['count'];var _0x538330=_0x2c4108?0x0:_0x5cfd40[_0xba55('0x1d')];var _0x4cd655=_0x2c4108?_0x4543aa[_0xba55('0x1f')]:_0x5cfd40[_0xba55('0x1d')]+_0x5cfd40[_0xba55('0x20')];var _0x3cffe3;if(_0x4cd655>=_0x304c6d){_0x4cd655=_0x304c6d;_0x3cffe3=0xc8;}else{_0x3cffe3=0xce;}_0x28997b['status'](_0x3cffe3);return _0x28997b[_0xba55('0x21')]('Content-Range',_0x538330+'-'+_0x4cd655+'/'+_0x304c6d)[_0xba55('0x1c')](_0x4543aa);}return null;};}function patchUpdates(_0x5b18b0){return function(_0x3c46a9){try{jsonpatch[_0xba55('0x22')](_0x3c46a9,_0x5b18b0,!![]);}catch(_0x33b61f){return BPromise[_0xba55('0x23')](_0x33b61f);}return _0x3c46a9[_0xba55('0x24')]();};}function saveUpdates(_0x2aa343,_0x55fb27){return function(_0x148fbd){if(_0x148fbd){return _0x148fbd[_0xba55('0x25')](_0x2aa343)['then'](function(_0x41b3c8){return _0x41b3c8;});}return null;};}function removeEntity(_0x2782ad,_0x533aa7){return function(_0x3c5f52){if(_0x3c5f52){return _0x3c5f52[_0xba55('0x26')]()[_0xba55('0x27')](function(){_0x2782ad[_0xba55('0x1a')](0xcc)[_0xba55('0x1b')]();});}};}function handleEntityNotFound(_0x290438,_0x3a746b){return function(_0x3dc385){if(!_0x3dc385){_0x290438['sendStatus'](0x194);}return _0x3dc385;};}function handleError(_0x42900c,_0x10f018){_0x10f018=_0x10f018||0x1f4;return function(_0x99e489){logger['error'](_0x99e489['stack']);if(_0x99e489['name']){delete _0x99e489[_0xba55('0x28')];}_0x42900c[_0xba55('0x1a')](_0x10f018)[_0xba55('0x29')](_0x99e489);};}exports['index']=function(_0xd7eb39,_0x14ddc0){var _0x45e045={},_0x3efb7a={},_0x2b123b={'count':0x0,'rows':[]};var _0x4ae4e9=_[_0xba55('0x2a')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x5eed97){return{'name':_0x5eed97[_0xba55('0x2b')],'type':_0x5eed97[_0xba55('0x2c')][_0xba55('0x2d')]};});_0x3efb7a[_0xba55('0x2e')]=_[_0xba55('0x2a')](_0x4ae4e9,'name');_0x3efb7a[_0xba55('0x2f')]=_[_0xba55('0x30')](_0xd7eb39[_0xba55('0x2f')]);_0x3efb7a[_0xba55('0x31')]=_['intersection'](_0x3efb7a[_0xba55('0x2e')],_0x3efb7a[_0xba55('0x2f')]);_0x45e045[_0xba55('0x32')]=_[_0xba55('0x33')](_0x3efb7a[_0xba55('0x2e')],qs[_0xba55('0x34')](_0xd7eb39['query']['fields']));_0x45e045['attributes']=_0x45e045[_0xba55('0x32')][_0xba55('0x35')]?_0x45e045[_0xba55('0x32')]:_0x3efb7a['model'];if(!_0xd7eb39['query'][_0xba55('0x36')]('nolimit')){_0x45e045[_0xba55('0x20')]=qs[_0xba55('0x20')](_0xd7eb39[_0xba55('0x2f')][_0xba55('0x20')]);_0x45e045[_0xba55('0x1d')]=qs[_0xba55('0x1d')](_0xd7eb39[_0xba55('0x2f')][_0xba55('0x1d')]);}_0x45e045[_0xba55('0x37')]=qs[_0xba55('0x38')](_0xd7eb39[_0xba55('0x2f')]['sort']);_0x45e045['where']=qs['filters'](_[_0xba55('0x39')](_0xd7eb39[_0xba55('0x2f')],_0x3efb7a[_0xba55('0x31')]),_0x4ae4e9);if(_0xd7eb39[_0xba55('0x2f')]['filter']){_0x45e045['where']=_[_0xba55('0x3a')](_0x45e045[_0xba55('0x3b')],{'$or':_['map'](_0x4ae4e9,function(_0x150c3f){if(_0x150c3f['type']!==_0xba55('0x3c')){var _0x32120a={};_0x32120a[_0x150c3f[_0xba55('0x28')]]={'$like':'%'+_0xd7eb39[_0xba55('0x2f')][_0xba55('0x3d')]+'%'};return _0x32120a;}})});}_0x45e045=_[_0xba55('0x3a')]({},_0x45e045,_0xd7eb39['options']);var _0x3623ce={'where':_0x45e045[_0xba55('0x3b')]};return db[_0xba55('0x3e')][_0xba55('0x1f')](_0x3623ce)[_0xba55('0x27')](function(_0x44b5c6){_0x2b123b[_0xba55('0x1f')]=_0x44b5c6;if(_0xd7eb39[_0xba55('0x2f')][_0xba55('0x3f')]){_0x45e045['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xba55('0x40')](_0x45e045);})['then'](function(_0x266b80){_0x2b123b[_0xba55('0x41')]=_0x266b80;return _0x2b123b;})[_0xba55('0x27')](respondWithFilteredResult(_0x14ddc0,_0x45e045))[_0xba55('0x42')](handleError(_0x14ddc0,null));};exports['show']=function(_0x2b5df5,_0x15e140){var _0xdb3e65={'raw':![],'where':{'id':_0x2b5df5[_0xba55('0x43')]['id']}},_0x10d640={};_0x10d640[_0xba55('0x2e')]=_[_0xba55('0x30')](db[_0xba55('0x3e')][_0xba55('0x44')]);_0x10d640[_0xba55('0x2f')]=_[_0xba55('0x30')](_0x2b5df5[_0xba55('0x2f')]);_0x10d640[_0xba55('0x31')]=_['intersection'](_0x10d640['model'],_0x10d640[_0xba55('0x2f')]);_0xdb3e65[_0xba55('0x32')]=_[_0xba55('0x33')](_0x10d640[_0xba55('0x2e')],qs[_0xba55('0x34')](_0x2b5df5[_0xba55('0x2f')][_0xba55('0x34')]));_0xdb3e65[_0xba55('0x32')]=_0xdb3e65['attributes']['length']?_0xdb3e65[_0xba55('0x32')]:_0x10d640[_0xba55('0x2e')];if(_0x2b5df5[_0xba55('0x2f')][_0xba55('0x3f')]){_0xdb3e65[_0xba55('0x45')]=[{'all':!![]}];}_0xdb3e65=_[_0xba55('0x3a')]({},_0xdb3e65,_0x2b5df5[_0xba55('0x46')]);return db[_0xba55('0x3e')]['find'](_0xdb3e65)[_0xba55('0x27')](handleEntityNotFound(_0x15e140,null))[_0xba55('0x27')](respondWithResult(_0x15e140,null))[_0xba55('0x42')](handleError(_0x15e140,null));};exports[_0xba55('0x47')]=function(_0x417289,_0x2c48de){return db[_0xba55('0x3e')][_0xba55('0x47')](_0x417289[_0xba55('0x48')],{})[_0xba55('0x27')](respondWithResult(_0x2c48de,0xc9))[_0xba55('0x42')](handleError(_0x2c48de,null));};exports[_0xba55('0x25')]=function(_0xa0a3b1,_0x149c87){if(_0xa0a3b1[_0xba55('0x48')]['id']){delete _0xa0a3b1[_0xba55('0x48')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0xa0a3b1[_0xba55('0x43')]['id']}})['then'](handleEntityNotFound(_0x149c87,null))[_0xba55('0x27')](saveUpdates(_0xa0a3b1[_0xba55('0x48')],null))[_0xba55('0x27')](respondWithResult(_0x149c87,null))[_0xba55('0x42')](handleError(_0x149c87,null));};exports[_0xba55('0x26')]=function(_0xedc694,_0x11c412){return db[_0xba55('0x3e')][_0xba55('0x49')]({'where':{'id':_0xedc694['params']['id']}})[_0xba55('0x27')](handleEntityNotFound(_0x11c412,null))[_0xba55('0x27')](removeEntity(_0x11c412,null))[_0xba55('0x42')](handleError(_0x11c412,null));};exports[_0xba55('0x4a')]=function(_0x1fb553,_0x4c99ae,_0x49a497){var _0x1ac422={};var _0x5a4f73={};var _0x5d2950;var _0x5b15fe;return db[_0xba55('0x3e')][_0xba55('0x4b')]({'where':{'id':_0x1fb553[_0xba55('0x43')]['id']}})[_0xba55('0x27')](handleEntityNotFound(_0x4c99ae,null))['then'](function(_0x2dcc6b){if(_0x2dcc6b){_0x5d2950=_0x2dcc6b;_0x5a4f73[_0xba55('0x2e')]=_[_0xba55('0x30')](db[_0xba55('0x4c')][_0xba55('0x44')]);_0x5a4f73['query']=_[_0xba55('0x30')](_0x1fb553[_0xba55('0x2f')]);_0x5a4f73[_0xba55('0x31')]=_[_0xba55('0x33')](_0x5a4f73[_0xba55('0x2e')],_0x5a4f73['query']);_0x1ac422['attributes']=_['intersection'](_0x5a4f73[_0xba55('0x2e')],qs['fields'](_0x1fb553[_0xba55('0x2f')][_0xba55('0x34')]));_0x1ac422[_0xba55('0x32')]=_0x1ac422[_0xba55('0x32')][_0xba55('0x35')]?_0x1ac422[_0xba55('0x32')]:_0x5a4f73[_0xba55('0x2e')];_0x1ac422[_0xba55('0x37')]=qs[_0xba55('0x38')](_0x1fb553[_0xba55('0x2f')][_0xba55('0x38')]);_0x1ac422['where']=qs['filters'](_[_0xba55('0x39')](_0x1fb553[_0xba55('0x2f')],_0x5a4f73[_0xba55('0x31')]));if(_0x1fb553['query']['filter']){_0x1ac422[_0xba55('0x3b')]=_['merge'](_0x1ac422[_0xba55('0x3b')],{'$or':_[_0xba55('0x2a')](_0x1ac422['attributes'],function(_0x476ac7){var _0x3e9d08={};_0x3e9d08[_0x476ac7]={'$like':'%'+_0x1fb553[_0xba55('0x2f')][_0xba55('0x3d')]+'%'};return _0x3e9d08;})});}_0x1ac422=_['merge']({},_0x1ac422,_0x1fb553['options']);return _0x5d2950['getFields'](_0x1ac422);}})[_0xba55('0x27')](function(_0x383c91){if(_0x383c91){_0x5b15fe=_0x383c91[_0xba55('0x35')];if(!_0x1fb553[_0xba55('0x2f')][_0xba55('0x36')](_0xba55('0x4d'))){_0x1ac422['limit']=qs['limit'](_0x1fb553[_0xba55('0x2f')]['limit']);_0x1ac422['offset']=qs[_0xba55('0x1d')](_0x1fb553[_0xba55('0x2f')][_0xba55('0x1d')]);}return _0x5d2950['getFields'](_0x1ac422);}})[_0xba55('0x27')](function(_0x1a887c){if(_0x1a887c){return _0x1a887c?{'count':_0x5b15fe,'rows':_0x1a887c}:null;}})[_0xba55('0x27')](respondWithResult(_0x4c99ae,null))['catch'](handleError(_0x4c99ae,null));};exports['getSubjects']=function(_0x9f3b1,_0x1de376,_0x2678ab){var _0x45efd6={};var _0x3acfd3={};var _0x298ab2;var _0x94e002;return db[_0xba55('0x3e')]['findOne']({'where':{'id':_0x9f3b1[_0xba55('0x43')]['id']}})[_0xba55('0x27')](handleEntityNotFound(_0x1de376,null))[_0xba55('0x27')](function(_0x3d5967){if(_0x3d5967){_0x298ab2=_0x3d5967;_0x3acfd3[_0xba55('0x2e')]=_[_0xba55('0x30')](db['FreshdeskField'][_0xba55('0x44')]);_0x3acfd3[_0xba55('0x2f')]=_[_0xba55('0x30')](_0x9f3b1[_0xba55('0x2f')]);_0x3acfd3[_0xba55('0x31')]=_[_0xba55('0x33')](_0x3acfd3[_0xba55('0x2e')],_0x3acfd3['query']);_0x45efd6[_0xba55('0x32')]=_[_0xba55('0x33')](_0x3acfd3[_0xba55('0x2e')],qs[_0xba55('0x34')](_0x9f3b1['query']['fields']));_0x45efd6['attributes']=_0x45efd6[_0xba55('0x32')]['length']?_0x45efd6['attributes']:_0x3acfd3[_0xba55('0x2e')];_0x45efd6[_0xba55('0x37')]=qs['sort'](_0x9f3b1[_0xba55('0x2f')][_0xba55('0x38')]);_0x45efd6[_0xba55('0x3b')]=qs[_0xba55('0x31')](_[_0xba55('0x39')](_0x9f3b1[_0xba55('0x2f')],_0x3acfd3['filters']));if(_0x9f3b1['query']['filter']){_0x45efd6['where']=_[_0xba55('0x3a')](_0x45efd6['where'],{'$or':_[_0xba55('0x2a')](_0x45efd6['attributes'],function(_0x1000ae){var _0x2426b7={};_0x2426b7[_0x1000ae]={'$like':'%'+_0x9f3b1['query'][_0xba55('0x3d')]+'%'};return _0x2426b7;})});}_0x45efd6=_[_0xba55('0x3a')]({},_0x45efd6,_0x9f3b1['options']);return _0x298ab2[_0xba55('0x4e')](_0x45efd6);}})[_0xba55('0x27')](function(_0x3f4888){if(_0x3f4888){_0x94e002=_0x3f4888[_0xba55('0x35')];if(!_0x9f3b1[_0xba55('0x2f')][_0xba55('0x36')]('nolimit')){_0x45efd6[_0xba55('0x20')]=qs[_0xba55('0x20')](_0x9f3b1[_0xba55('0x2f')]['limit']);_0x45efd6[_0xba55('0x1d')]=qs[_0xba55('0x1d')](_0x9f3b1[_0xba55('0x2f')]['offset']);}return _0x298ab2[_0xba55('0x4e')](_0x45efd6);}})[_0xba55('0x27')](function(_0x3d3530){if(_0x3d3530){return _0x3d3530?{'count':_0x94e002,'rows':_0x3d3530}:null;}})[_0xba55('0x27')](respondWithResult(_0x1de376,null))[_0xba55('0x42')](handleError(_0x1de376,null));};exports['getDescriptions']=function(_0x26f3d5,_0xa296b0,_0x3b8f5c){var _0x5999cc={};var _0x121431={};var _0x333eb1;var _0x5c1ff5;return db[_0xba55('0x3e')][_0xba55('0x4b')]({'where':{'id':_0x26f3d5[_0xba55('0x43')]['id']}})[_0xba55('0x27')](handleEntityNotFound(_0xa296b0,null))['then'](function(_0xdf7cce){if(_0xdf7cce){_0x333eb1=_0xdf7cce;_0x121431['model']=_[_0xba55('0x30')](db['FreshdeskField'][_0xba55('0x44')]);_0x121431[_0xba55('0x2f')]=_[_0xba55('0x30')](_0x26f3d5[_0xba55('0x2f')]);_0x121431[_0xba55('0x31')]=_[_0xba55('0x33')](_0x121431[_0xba55('0x2e')],_0x121431['query']);_0x5999cc['attributes']=_[_0xba55('0x33')](_0x121431[_0xba55('0x2e')],qs[_0xba55('0x34')](_0x26f3d5[_0xba55('0x2f')][_0xba55('0x34')]));_0x5999cc[_0xba55('0x32')]=_0x5999cc['attributes'][_0xba55('0x35')]?_0x5999cc[_0xba55('0x32')]:_0x121431[_0xba55('0x2e')];_0x5999cc[_0xba55('0x37')]=qs[_0xba55('0x38')](_0x26f3d5[_0xba55('0x2f')][_0xba55('0x38')]);_0x5999cc[_0xba55('0x3b')]=qs['filters'](_[_0xba55('0x39')](_0x26f3d5[_0xba55('0x2f')],_0x121431['filters']));if(_0x26f3d5[_0xba55('0x2f')][_0xba55('0x3d')]){_0x5999cc[_0xba55('0x3b')]=_['merge'](_0x5999cc[_0xba55('0x3b')],{'$or':_[_0xba55('0x2a')](_0x5999cc[_0xba55('0x32')],function(_0xae5fe5){var _0x250bac={};_0x250bac[_0xae5fe5]={'$like':'%'+_0x26f3d5[_0xba55('0x2f')][_0xba55('0x3d')]+'%'};return _0x250bac;})});}_0x5999cc=_[_0xba55('0x3a')]({},_0x5999cc,_0x26f3d5[_0xba55('0x46')]);return _0x333eb1[_0xba55('0x4f')](_0x5999cc);}})[_0xba55('0x27')](function(_0xf0cafd){if(_0xf0cafd){_0x5c1ff5=_0xf0cafd[_0xba55('0x35')];if(!_0x26f3d5[_0xba55('0x2f')][_0xba55('0x36')](_0xba55('0x4d'))){_0x5999cc[_0xba55('0x20')]=qs[_0xba55('0x20')](_0x26f3d5[_0xba55('0x2f')][_0xba55('0x20')]);_0x5999cc[_0xba55('0x1d')]=qs['offset'](_0x26f3d5[_0xba55('0x2f')][_0xba55('0x1d')]);}return _0x333eb1[_0xba55('0x4f')](_0x5999cc);}})[_0xba55('0x27')](function(_0x540ff0){if(_0x540ff0){return _0x540ff0?{'count':_0x5c1ff5,'rows':_0x540ff0}:null;}})[_0xba55('0x27')](respondWithResult(_0xa296b0,null))[_0xba55('0x42')](handleError(_0xa296b0,null));};exports[_0xba55('0x50')]=function(_0x27c558,_0x1974c2,_0x2a75ed){var _0x300ae3={};var _0x1fcd6e={};var _0x1f295a;var _0x243120;return db[_0xba55('0x3e')][_0xba55('0x4b')]({'where':{'id':_0x27c558['params']['id']}})[_0xba55('0x27')](handleEntityNotFound(_0x1974c2,null))['then'](function(_0x256f5e){if(_0x256f5e){_0x1f295a=_0x256f5e;_0x1fcd6e[_0xba55('0x2e')]=_['keys'](db['Tag'][_0xba55('0x44')]);_0x1fcd6e[_0xba55('0x2f')]=_[_0xba55('0x30')](_0x27c558['query']);_0x1fcd6e[_0xba55('0x31')]=_['intersection'](_0x1fcd6e[_0xba55('0x2e')],_0x1fcd6e['query']);_0x300ae3['attributes']=_['intersection'](_0x1fcd6e[_0xba55('0x2e')],qs[_0xba55('0x34')](_0x27c558['query'][_0xba55('0x34')]));_0x300ae3[_0xba55('0x32')]=_0x300ae3[_0xba55('0x32')][_0xba55('0x35')]?_0x300ae3[_0xba55('0x32')]:_0x1fcd6e['model'];_0x300ae3[_0xba55('0x37')]=qs['sort'](_0x27c558['query'][_0xba55('0x38')]);_0x300ae3[_0xba55('0x3b')]=qs[_0xba55('0x31')](_['pick'](_0x27c558[_0xba55('0x2f')],_0x1fcd6e[_0xba55('0x31')]));if(_0x27c558[_0xba55('0x2f')][_0xba55('0x3d')]){_0x300ae3[_0xba55('0x3b')]=_[_0xba55('0x3a')](_0x300ae3[_0xba55('0x3b')],{'$or':_[_0xba55('0x2a')](_0x300ae3[_0xba55('0x32')],function(_0xfc9095){var _0x1a2beb={};_0x1a2beb[_0xfc9095]={'$like':'%'+_0x27c558[_0xba55('0x2f')][_0xba55('0x3d')]+'%'};return _0x1a2beb;})});}_0x300ae3=_[_0xba55('0x3a')]({},_0x300ae3,_0x27c558[_0xba55('0x46')]);return _0x1f295a[_0xba55('0x50')](_0x300ae3);}})[_0xba55('0x27')](function(_0x1ff921){if(_0x1ff921){_0x243120=_0x1ff921[_0xba55('0x35')];if(!_0x27c558[_0xba55('0x2f')][_0xba55('0x36')](_0xba55('0x4d'))){_0x300ae3['limit']=qs[_0xba55('0x20')](_0x27c558['query'][_0xba55('0x20')]);_0x300ae3[_0xba55('0x1d')]=qs[_0xba55('0x1d')](_0x27c558[_0xba55('0x2f')][_0xba55('0x1d')]);}return _0x1f295a[_0xba55('0x50')](_0x300ae3);}})[_0xba55('0x27')](function(_0x5785a9){if(_0x5785a9){return _0x5785a9?{'count':_0x243120,'rows':_0x5785a9}:null;}})['then'](respondWithResult(_0x1974c2,null))[_0xba55('0x42')](handleError(_0x1974c2,null));};exports[_0xba55('0x51')]=function(_0x3cc45a,_0x4ba1d6,_0x4cf35d){if(_0x3cc45a['body']['id']){delete _0x3cc45a['body']['id'];}return db[_0xba55('0x3e')][_0xba55('0x4b')]({'where':{'id':_0x3cc45a[_0xba55('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ba1d6,null))[_0xba55('0x27')](function(_0x3ad56c){if(_0x3ad56c){return _0x3ad56c['setTags'](_0x3cc45a[_0xba55('0x48')]['ids']||[]);}return null;})[_0xba55('0x27')](respondWithResult(_0x4ba1d6,null))[_0xba55('0x42')](handleError(_0x4ba1d6,null));}; \ No newline at end of file +var _0x9928=['destroy','then','stack','name','send','index','map','FreshdeskConfiguration','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','update','find','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','limit','count','Content-Range','reject','save'];(function(_0x3db34d,_0x1cefb9){var _0x55da90=function(_0x1219f1){while(--_0x1219f1){_0x3db34d['push'](_0x3db34d['shift']());}};_0x55da90(++_0x1cefb9);}(_0x9928,0x124));var _0x8992=function(_0xdc0397,_0x20d1f1){_0xdc0397=_0xdc0397-0x0;var _0x553d02=_0x9928[_0xdc0397];return _0x553d02;};'use strict';var emlformat=require(_0x8992('0x0'));var rimraf=require(_0x8992('0x1'));var zipdir=require(_0x8992('0x2'));var jsonpatch=require(_0x8992('0x3'));var rp=require(_0x8992('0x4'));var moment=require(_0x8992('0x5'));var BPromise=require(_0x8992('0x6'));var Mustache=require('mustache');var util=require(_0x8992('0x7'));var path=require('path');var sox=require(_0x8992('0x8'));var csv=require(_0x8992('0x9'));var ejs=require(_0x8992('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8992('0xb'));var squel=require('squel');var crypto=require(_0x8992('0xc'));var jsforce=require(_0x8992('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8992('0x9'));var querystring=require('querystring');var Papa=require(_0x8992('0xe'));var Redis=require(_0x8992('0xf'));var authService=require(_0x8992('0x10'));var qs=require(_0x8992('0x11'));var as=require(_0x8992('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8992('0x13'))(_0x8992('0x14'));var utils=require(_0x8992('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cf4c6,_0x3148cc){_0x3148cc=_0x3148cc||0xcc;return function(_0xf2ac4e){if(_0xf2ac4e){return _0x1cf4c6[_0x8992('0x16')](_0x3148cc);}return _0x1cf4c6['status'](_0x3148cc)[_0x8992('0x17')]();};}function respondWithResult(_0x3dfbfb,_0x5600cc){_0x5600cc=_0x5600cc||0xc8;return function(_0x16df21){if(_0x16df21){return _0x3dfbfb[_0x8992('0x18')](_0x5600cc)[_0x8992('0x19')](_0x16df21);}};}function respondWithFilteredResult(_0x179dd5,_0xb72952){return function(_0x1d64ab){if(_0x1d64ab){var _0x1f91f1=typeof _0xb72952[_0x8992('0x1a')]==='undefined'&&typeof _0xb72952[_0x8992('0x1b')]==='undefined';var _0x4cda6c=_0x1d64ab[_0x8992('0x1c')];var _0x5c4758=_0x1f91f1?0x0:_0xb72952[_0x8992('0x1a')];var _0x5f27a5=_0x1f91f1?_0x1d64ab[_0x8992('0x1c')]:_0xb72952[_0x8992('0x1a')]+_0xb72952[_0x8992('0x1b')];var _0x40a03a;if(_0x5f27a5>=_0x4cda6c){_0x5f27a5=_0x4cda6c;_0x40a03a=0xc8;}else{_0x40a03a=0xce;}_0x179dd5[_0x8992('0x18')](_0x40a03a);return _0x179dd5['set'](_0x8992('0x1d'),_0x5c4758+'-'+_0x5f27a5+'/'+_0x4cda6c)[_0x8992('0x19')](_0x1d64ab);}return null;};}function patchUpdates(_0x8e59f6){return function(_0x12e9e7){try{jsonpatch['apply'](_0x12e9e7,_0x8e59f6,!![]);}catch(_0x26b6cf){return BPromise[_0x8992('0x1e')](_0x26b6cf);}return _0x12e9e7[_0x8992('0x1f')]();};}function saveUpdates(_0xd8ff40,_0x3d05fd){return function(_0x31dff0){if(_0x31dff0){return _0x31dff0['update'](_0xd8ff40)['then'](function(_0x485915){return _0x485915;});}return null;};}function removeEntity(_0x4d0130,_0x2fffef){return function(_0x4abcf5){if(_0x4abcf5){return _0x4abcf5[_0x8992('0x20')]()[_0x8992('0x21')](function(){_0x4d0130[_0x8992('0x18')](0xcc)[_0x8992('0x17')]();});}};}function handleEntityNotFound(_0x5412e2,_0x3262ea){return function(_0xa3f16a){if(!_0xa3f16a){_0x5412e2[_0x8992('0x16')](0x194);}return _0xa3f16a;};}function handleError(_0x175221,_0x580917){_0x580917=_0x580917||0x1f4;return function(_0x915141){logger['error'](_0x915141[_0x8992('0x22')]);if(_0x915141[_0x8992('0x23')]){delete _0x915141['name'];}_0x175221[_0x8992('0x18')](_0x580917)[_0x8992('0x24')](_0x915141);};}exports[_0x8992('0x25')]=function(_0x31e3f9,_0xa0eecb){var _0x52f226={},_0x24960b={},_0x500e3f={'count':0x0,'rows':[]};var _0x1aa86d=_[_0x8992('0x26')](db[_0x8992('0x27')]['rawAttributes'],function(_0x2930c4){return{'name':_0x2930c4['fieldName'],'type':_0x2930c4[_0x8992('0x28')][_0x8992('0x29')]};});_0x24960b[_0x8992('0x2a')]=_[_0x8992('0x26')](_0x1aa86d,_0x8992('0x23'));_0x24960b[_0x8992('0x2b')]=_[_0x8992('0x2c')](_0x31e3f9[_0x8992('0x2b')]);_0x24960b['filters']=_[_0x8992('0x2d')](_0x24960b[_0x8992('0x2a')],_0x24960b[_0x8992('0x2b')]);_0x52f226[_0x8992('0x2e')]=_[_0x8992('0x2d')](_0x24960b[_0x8992('0x2a')],qs['fields'](_0x31e3f9['query'][_0x8992('0x2f')]));_0x52f226['attributes']=_0x52f226[_0x8992('0x2e')]['length']?_0x52f226[_0x8992('0x2e')]:_0x24960b[_0x8992('0x2a')];if(!_0x31e3f9[_0x8992('0x2b')][_0x8992('0x30')](_0x8992('0x31'))){_0x52f226[_0x8992('0x1b')]=qs[_0x8992('0x1b')](_0x31e3f9[_0x8992('0x2b')][_0x8992('0x1b')]);_0x52f226[_0x8992('0x1a')]=qs[_0x8992('0x1a')](_0x31e3f9[_0x8992('0x2b')]['offset']);}_0x52f226[_0x8992('0x32')]=qs[_0x8992('0x33')](_0x31e3f9[_0x8992('0x2b')][_0x8992('0x33')]);_0x52f226[_0x8992('0x34')]=qs['filters'](_[_0x8992('0x35')](_0x31e3f9[_0x8992('0x2b')],_0x24960b[_0x8992('0x36')]),_0x1aa86d);if(_0x31e3f9[_0x8992('0x2b')]['filter']){_0x52f226[_0x8992('0x34')]=_[_0x8992('0x37')](_0x52f226[_0x8992('0x34')],{'$or':_['map'](_0x1aa86d,function(_0x52e3fb){if(_0x52e3fb[_0x8992('0x28')]!==_0x8992('0x38')){var _0x1bc560={};_0x1bc560[_0x52e3fb['name']]={'$like':'%'+_0x31e3f9[_0x8992('0x2b')][_0x8992('0x39')]+'%'};return _0x1bc560;}})});}_0x52f226=_[_0x8992('0x37')]({},_0x52f226,_0x31e3f9[_0x8992('0x3a')]);var _0x1ea9e4={'where':_0x52f226[_0x8992('0x34')]};return db[_0x8992('0x27')][_0x8992('0x1c')](_0x1ea9e4)[_0x8992('0x21')](function(_0x14de7f){_0x500e3f[_0x8992('0x1c')]=_0x14de7f;if(_0x31e3f9[_0x8992('0x2b')]['includeAll']){_0x52f226[_0x8992('0x3b')]=[{'all':!![]}];}return db[_0x8992('0x27')][_0x8992('0x3c')](_0x52f226);})[_0x8992('0x21')](function(_0x14549f){_0x500e3f[_0x8992('0x3d')]=_0x14549f;return _0x500e3f;})[_0x8992('0x21')](respondWithFilteredResult(_0xa0eecb,_0x52f226))[_0x8992('0x3e')](handleError(_0xa0eecb,null));};exports[_0x8992('0x3f')]=function(_0x44f4ff,_0x45712b){var _0x552a4e={'raw':![],'where':{'id':_0x44f4ff[_0x8992('0x40')]['id']}},_0x1105ea={};_0x1105ea[_0x8992('0x2a')]=_[_0x8992('0x2c')](db['FreshdeskConfiguration'][_0x8992('0x41')]);_0x1105ea['query']=_['keys'](_0x44f4ff[_0x8992('0x2b')]);_0x1105ea[_0x8992('0x36')]=_[_0x8992('0x2d')](_0x1105ea[_0x8992('0x2a')],_0x1105ea[_0x8992('0x2b')]);_0x552a4e[_0x8992('0x2e')]=_[_0x8992('0x2d')](_0x1105ea[_0x8992('0x2a')],qs[_0x8992('0x2f')](_0x44f4ff[_0x8992('0x2b')][_0x8992('0x2f')]));_0x552a4e[_0x8992('0x2e')]=_0x552a4e[_0x8992('0x2e')][_0x8992('0x42')]?_0x552a4e[_0x8992('0x2e')]:_0x1105ea[_0x8992('0x2a')];if(_0x44f4ff['query'][_0x8992('0x43')]){_0x552a4e['include']=[{'all':!![]}];}_0x552a4e=_['merge']({},_0x552a4e,_0x44f4ff['options']);return db[_0x8992('0x27')]['find'](_0x552a4e)[_0x8992('0x21')](handleEntityNotFound(_0x45712b,null))[_0x8992('0x21')](respondWithResult(_0x45712b,null))[_0x8992('0x3e')](handleError(_0x45712b,null));};exports[_0x8992('0x44')]=function(_0x1b20a2,_0x53bb6d){return db[_0x8992('0x27')][_0x8992('0x44')](_0x1b20a2[_0x8992('0x45')],{})[_0x8992('0x21')](respondWithResult(_0x53bb6d,0xc9))[_0x8992('0x3e')](handleError(_0x53bb6d,null));};exports[_0x8992('0x46')]=function(_0x558953,_0x2e938f){if(_0x558953[_0x8992('0x45')]['id']){delete _0x558953['body']['id'];}return db[_0x8992('0x27')]['find']({'where':{'id':_0x558953[_0x8992('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e938f,null))['then'](saveUpdates(_0x558953[_0x8992('0x45')],null))[_0x8992('0x21')](respondWithResult(_0x2e938f,null))[_0x8992('0x3e')](handleError(_0x2e938f,null));};exports[_0x8992('0x20')]=function(_0x356c9,_0x53f4ef){return db[_0x8992('0x27')][_0x8992('0x47')]({'where':{'id':_0x356c9[_0x8992('0x40')]['id']}})[_0x8992('0x21')](handleEntityNotFound(_0x53f4ef,null))[_0x8992('0x21')](removeEntity(_0x53f4ef,null))[_0x8992('0x3e')](handleError(_0x53f4ef,null));};exports[_0x8992('0x48')]=function(_0x4f5a3e,_0x215f37,_0x3705fa){var _0x4e5d1e={};var _0x30ea2e={};var _0x2aae1e;var _0x1e7dc4;return db[_0x8992('0x27')][_0x8992('0x49')]({'where':{'id':_0x4f5a3e[_0x8992('0x40')]['id']}})[_0x8992('0x21')](handleEntityNotFound(_0x215f37,null))['then'](function(_0x14bb6a){if(_0x14bb6a){_0x2aae1e=_0x14bb6a;_0x30ea2e[_0x8992('0x2a')]=_[_0x8992('0x2c')](db['FreshdeskField']['rawAttributes']);_0x30ea2e[_0x8992('0x2b')]=_['keys'](_0x4f5a3e[_0x8992('0x2b')]);_0x30ea2e[_0x8992('0x36')]=_[_0x8992('0x2d')](_0x30ea2e[_0x8992('0x2a')],_0x30ea2e[_0x8992('0x2b')]);_0x4e5d1e[_0x8992('0x2e')]=_['intersection'](_0x30ea2e['model'],qs[_0x8992('0x2f')](_0x4f5a3e[_0x8992('0x2b')][_0x8992('0x2f')]));_0x4e5d1e[_0x8992('0x2e')]=_0x4e5d1e[_0x8992('0x2e')][_0x8992('0x42')]?_0x4e5d1e[_0x8992('0x2e')]:_0x30ea2e['model'];_0x4e5d1e[_0x8992('0x32')]=qs[_0x8992('0x33')](_0x4f5a3e['query'][_0x8992('0x33')]);_0x4e5d1e[_0x8992('0x34')]=qs[_0x8992('0x36')](_[_0x8992('0x35')](_0x4f5a3e[_0x8992('0x2b')],_0x30ea2e[_0x8992('0x36')]));if(_0x4f5a3e['query']['filter']){_0x4e5d1e[_0x8992('0x34')]=_[_0x8992('0x37')](_0x4e5d1e[_0x8992('0x34')],{'$or':_[_0x8992('0x26')](_0x4e5d1e['attributes'],function(_0x4e16f5){var _0x1b550e={};_0x1b550e[_0x4e16f5]={'$like':'%'+_0x4f5a3e[_0x8992('0x2b')]['filter']+'%'};return _0x1b550e;})});}_0x4e5d1e=_[_0x8992('0x37')]({},_0x4e5d1e,_0x4f5a3e[_0x8992('0x3a')]);return _0x2aae1e['getFields'](_0x4e5d1e);}})[_0x8992('0x21')](function(_0x13bb07){if(_0x13bb07){_0x1e7dc4=_0x13bb07[_0x8992('0x42')];if(!_0x4f5a3e['query'][_0x8992('0x30')](_0x8992('0x31'))){_0x4e5d1e[_0x8992('0x1b')]=qs[_0x8992('0x1b')](_0x4f5a3e[_0x8992('0x2b')][_0x8992('0x1b')]);_0x4e5d1e[_0x8992('0x1a')]=qs[_0x8992('0x1a')](_0x4f5a3e[_0x8992('0x2b')][_0x8992('0x1a')]);}return _0x2aae1e[_0x8992('0x48')](_0x4e5d1e);}})[_0x8992('0x21')](function(_0x5194a2){if(_0x5194a2){return _0x5194a2?{'count':_0x1e7dc4,'rows':_0x5194a2}:null;}})['then'](respondWithResult(_0x215f37,null))[_0x8992('0x3e')](handleError(_0x215f37,null));};exports['getSubjects']=function(_0x1e53b0,_0x5eca15,_0x4a57cc){var _0x558b9c={};var _0x69c438={};var _0x77a980;var _0x1c42ce;return db[_0x8992('0x27')][_0x8992('0x49')]({'where':{'id':_0x1e53b0[_0x8992('0x40')]['id']}})[_0x8992('0x21')](handleEntityNotFound(_0x5eca15,null))[_0x8992('0x21')](function(_0x190148){if(_0x190148){_0x77a980=_0x190148;_0x69c438[_0x8992('0x2a')]=_[_0x8992('0x2c')](db[_0x8992('0x4a')][_0x8992('0x41')]);_0x69c438[_0x8992('0x2b')]=_[_0x8992('0x2c')](_0x1e53b0[_0x8992('0x2b')]);_0x69c438[_0x8992('0x36')]=_[_0x8992('0x2d')](_0x69c438[_0x8992('0x2a')],_0x69c438[_0x8992('0x2b')]);_0x558b9c[_0x8992('0x2e')]=_['intersection'](_0x69c438['model'],qs['fields'](_0x1e53b0[_0x8992('0x2b')][_0x8992('0x2f')]));_0x558b9c[_0x8992('0x2e')]=_0x558b9c[_0x8992('0x2e')][_0x8992('0x42')]?_0x558b9c[_0x8992('0x2e')]:_0x69c438['model'];_0x558b9c[_0x8992('0x32')]=qs[_0x8992('0x33')](_0x1e53b0[_0x8992('0x2b')]['sort']);_0x558b9c[_0x8992('0x34')]=qs['filters'](_['pick'](_0x1e53b0['query'],_0x69c438[_0x8992('0x36')]));if(_0x1e53b0[_0x8992('0x2b')]['filter']){_0x558b9c[_0x8992('0x34')]=_[_0x8992('0x37')](_0x558b9c[_0x8992('0x34')],{'$or':_['map'](_0x558b9c[_0x8992('0x2e')],function(_0x51fe5e){var _0x383c89={};_0x383c89[_0x51fe5e]={'$like':'%'+_0x1e53b0[_0x8992('0x2b')][_0x8992('0x39')]+'%'};return _0x383c89;})});}_0x558b9c=_['merge']({},_0x558b9c,_0x1e53b0[_0x8992('0x3a')]);return _0x77a980[_0x8992('0x4b')](_0x558b9c);}})[_0x8992('0x21')](function(_0x466f9c){if(_0x466f9c){_0x1c42ce=_0x466f9c[_0x8992('0x42')];if(!_0x1e53b0[_0x8992('0x2b')][_0x8992('0x30')](_0x8992('0x31'))){_0x558b9c[_0x8992('0x1b')]=qs[_0x8992('0x1b')](_0x1e53b0['query']['limit']);_0x558b9c['offset']=qs[_0x8992('0x1a')](_0x1e53b0[_0x8992('0x2b')]['offset']);}return _0x77a980[_0x8992('0x4b')](_0x558b9c);}})[_0x8992('0x21')](function(_0x33d391){if(_0x33d391){return _0x33d391?{'count':_0x1c42ce,'rows':_0x33d391}:null;}})['then'](respondWithResult(_0x5eca15,null))[_0x8992('0x3e')](handleError(_0x5eca15,null));};exports[_0x8992('0x4c')]=function(_0x2ab9e8,_0x3b7044,_0x17d05a){var _0x1e5194={};var _0x136e1b={};var _0x5b8adb;var _0x520e87;return db[_0x8992('0x27')][_0x8992('0x49')]({'where':{'id':_0x2ab9e8[_0x8992('0x40')]['id']}})[_0x8992('0x21')](handleEntityNotFound(_0x3b7044,null))[_0x8992('0x21')](function(_0x30141f){if(_0x30141f){_0x5b8adb=_0x30141f;_0x136e1b[_0x8992('0x2a')]=_[_0x8992('0x2c')](db[_0x8992('0x4a')][_0x8992('0x41')]);_0x136e1b[_0x8992('0x2b')]=_['keys'](_0x2ab9e8['query']);_0x136e1b[_0x8992('0x36')]=_[_0x8992('0x2d')](_0x136e1b[_0x8992('0x2a')],_0x136e1b['query']);_0x1e5194[_0x8992('0x2e')]=_['intersection'](_0x136e1b[_0x8992('0x2a')],qs['fields'](_0x2ab9e8['query'][_0x8992('0x2f')]));_0x1e5194[_0x8992('0x2e')]=_0x1e5194[_0x8992('0x2e')][_0x8992('0x42')]?_0x1e5194['attributes']:_0x136e1b['model'];_0x1e5194[_0x8992('0x32')]=qs['sort'](_0x2ab9e8[_0x8992('0x2b')][_0x8992('0x33')]);_0x1e5194[_0x8992('0x34')]=qs[_0x8992('0x36')](_[_0x8992('0x35')](_0x2ab9e8[_0x8992('0x2b')],_0x136e1b[_0x8992('0x36')]));if(_0x2ab9e8['query'][_0x8992('0x39')]){_0x1e5194[_0x8992('0x34')]=_['merge'](_0x1e5194[_0x8992('0x34')],{'$or':_['map'](_0x1e5194['attributes'],function(_0x522015){var _0x353086={};_0x353086[_0x522015]={'$like':'%'+_0x2ab9e8[_0x8992('0x2b')]['filter']+'%'};return _0x353086;})});}_0x1e5194=_[_0x8992('0x37')]({},_0x1e5194,_0x2ab9e8['options']);return _0x5b8adb['getDescriptions'](_0x1e5194);}})[_0x8992('0x21')](function(_0x1c27d6){if(_0x1c27d6){_0x520e87=_0x1c27d6['length'];if(!_0x2ab9e8[_0x8992('0x2b')][_0x8992('0x30')](_0x8992('0x31'))){_0x1e5194[_0x8992('0x1b')]=qs['limit'](_0x2ab9e8[_0x8992('0x2b')][_0x8992('0x1b')]);_0x1e5194['offset']=qs['offset'](_0x2ab9e8['query'][_0x8992('0x1a')]);}return _0x5b8adb['getDescriptions'](_0x1e5194);}})[_0x8992('0x21')](function(_0x43195c){if(_0x43195c){return _0x43195c?{'count':_0x520e87,'rows':_0x43195c}:null;}})[_0x8992('0x21')](respondWithResult(_0x3b7044,null))[_0x8992('0x3e')](handleError(_0x3b7044,null));};exports[_0x8992('0x4d')]=function(_0x4bcf6f,_0x40473a,_0x1df9b9){var _0x11224b={};var _0x545361={};var _0x4debda;var _0x17a99e;return db[_0x8992('0x27')][_0x8992('0x49')]({'where':{'id':_0x4bcf6f[_0x8992('0x40')]['id']}})[_0x8992('0x21')](handleEntityNotFound(_0x40473a,null))[_0x8992('0x21')](function(_0x4c5794){if(_0x4c5794){_0x4debda=_0x4c5794;_0x545361[_0x8992('0x2a')]=_[_0x8992('0x2c')](db[_0x8992('0x4e')][_0x8992('0x41')]);_0x545361[_0x8992('0x2b')]=_[_0x8992('0x2c')](_0x4bcf6f[_0x8992('0x2b')]);_0x545361[_0x8992('0x36')]=_[_0x8992('0x2d')](_0x545361[_0x8992('0x2a')],_0x545361[_0x8992('0x2b')]);_0x11224b[_0x8992('0x2e')]=_['intersection'](_0x545361[_0x8992('0x2a')],qs[_0x8992('0x2f')](_0x4bcf6f[_0x8992('0x2b')][_0x8992('0x2f')]));_0x11224b[_0x8992('0x2e')]=_0x11224b[_0x8992('0x2e')][_0x8992('0x42')]?_0x11224b[_0x8992('0x2e')]:_0x545361[_0x8992('0x2a')];_0x11224b[_0x8992('0x32')]=qs['sort'](_0x4bcf6f[_0x8992('0x2b')][_0x8992('0x33')]);_0x11224b[_0x8992('0x34')]=qs['filters'](_['pick'](_0x4bcf6f[_0x8992('0x2b')],_0x545361[_0x8992('0x36')]));if(_0x4bcf6f[_0x8992('0x2b')][_0x8992('0x39')]){_0x11224b[_0x8992('0x34')]=_[_0x8992('0x37')](_0x11224b['where'],{'$or':_[_0x8992('0x26')](_0x11224b['attributes'],function(_0x409f44){var _0x47cd6f={};_0x47cd6f[_0x409f44]={'$like':'%'+_0x4bcf6f[_0x8992('0x2b')][_0x8992('0x39')]+'%'};return _0x47cd6f;})});}_0x11224b=_[_0x8992('0x37')]({},_0x11224b,_0x4bcf6f[_0x8992('0x3a')]);return _0x4debda['getTags'](_0x11224b);}})['then'](function(_0x400856){if(_0x400856){_0x17a99e=_0x400856['length'];if(!_0x4bcf6f[_0x8992('0x2b')][_0x8992('0x30')](_0x8992('0x31'))){_0x11224b['limit']=qs[_0x8992('0x1b')](_0x4bcf6f[_0x8992('0x2b')][_0x8992('0x1b')]);_0x11224b[_0x8992('0x1a')]=qs['offset'](_0x4bcf6f[_0x8992('0x2b')][_0x8992('0x1a')]);}return _0x4debda[_0x8992('0x4d')](_0x11224b);}})[_0x8992('0x21')](function(_0x4b72c7){if(_0x4b72c7){return _0x4b72c7?{'count':_0x17a99e,'rows':_0x4b72c7}:null;}})['then'](respondWithResult(_0x40473a,null))[_0x8992('0x3e')](handleError(_0x40473a,null));};exports['setTags']=function(_0x2f074e,_0x131002,_0x21124c){if(_0x2f074e[_0x8992('0x45')]['id']){delete _0x2f074e[_0x8992('0x45')]['id'];}return db[_0x8992('0x27')][_0x8992('0x49')]({'where':{'id':_0x2f074e[_0x8992('0x40')]['id']}})[_0x8992('0x21')](handleEntityNotFound(_0x131002,null))[_0x8992('0x21')](function(_0x54adb8){if(_0x54adb8){return _0x54adb8[_0x8992('0x4f')](_0x2f074e[_0x8992('0x45')][_0x8992('0x50')]||[]);}return null;})[_0x8992('0x21')](respondWithResult(_0x131002,null))[_0x8992('0x3e')](handleError(_0x131002,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index ac05001..39d3792 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 _0x416e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x29fc12,_0xb73ed3){var _0x3da6ad=function(_0x5ad368){while(--_0x5ad368){_0x29fc12['push'](_0x29fc12['shift']());}};_0x3da6ad(++_0xb73ed3);}(_0x416e,0x1d3));var _0xe416=function(_0x53e1ca,_0x4df7ef){_0x53e1ca=_0x53e1ca-0x0;var _0x1c43e9=_0x416e[_0x53e1ca];return _0x1c43e9;};'use strict';var _=require('lodash');var util=require(_0xe416('0x0'));var logger=require(_0xe416('0x1'))(_0xe416('0x2'));var moment=require(_0xe416('0x3'));var BPromise=require(_0xe416('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe416('0x5'));var rimraf=require(_0xe416('0x6'));var config=require(_0xe416('0x7'));var attributes=require(_0xe416('0x8'));module[_0xe416('0x9')]=function(_0x2bc1a4,_0x4259bc){return _0x2bc1a4['define'](_0xe416('0xa'),attributes,{'tableName':_0xe416('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d2c=['int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration'];(function(_0x1fe8b9,_0xd87696){var _0x25d006=function(_0x35727f){while(--_0x35727f){_0x1fe8b9['push'](_0x1fe8b9['shift']());}};_0x25d006(++_0xd87696);}(_0x4d2c,0x7f));var _0xc4d2=function(_0x40599f,_0x5cfb5a){_0x40599f=_0x40599f-0x0;var _0x2bcc4e=_0x4d2c[_0x40599f];return _0x2bcc4e;};'use strict';var _=require(_0xc4d2('0x0'));var util=require(_0xc4d2('0x1'));var logger=require(_0xc4d2('0x2'))(_0xc4d2('0x3'));var moment=require(_0xc4d2('0x4'));var BPromise=require(_0xc4d2('0x5'));var rp=require(_0xc4d2('0x6'));var fs=require('fs');var path=require(_0xc4d2('0x7'));var rimraf=require(_0xc4d2('0x8'));var config=require(_0xc4d2('0x9'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xc4d2('0xa')]=function(_0x2fb16d,_0x2e926){return _0x2fb16d[_0xc4d2('0xb')](_0xc4d2('0xc'),attributes,{'tableName':_0xc4d2('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 4a660a1..8f52d2f 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 _0x3ff7=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug'];(function(_0x279b1a,_0x2bb6df){var _0x316364=function(_0x67247f){while(--_0x67247f){_0x279b1a['push'](_0x279b1a['shift']());}};_0x316364(++_0x2bb6df);}(_0x3ff7,0x1be));var _0x73ff=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x3ff7[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x73ff('0x0'));var util=require(_0x73ff('0x1'));var moment=require('moment');var BPromise=require(_0x73ff('0x2'));var rs=require(_0x73ff('0x3'));var fs=require('fs');var Redis=require(_0x73ff('0x4'));var db=require(_0x73ff('0x5'))['db'];var utils=require(_0x73ff('0x6'));var logger=require(_0x73ff('0x7'))('rpc');var config=require(_0x73ff('0x8'));var jayson=require(_0x73ff('0x9'));var client=jayson[_0x73ff('0xa')][_0x73ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf8ef0f,_0x308c94,_0x1b4cf3){return new BPromise(function(_0x14e66f,_0xd95fa5){return client[_0x73ff('0xc')](_0xf8ef0f,_0x1b4cf3)[_0x73ff('0xd')](function(_0x9e3dde){logger['info'](_0x73ff('0xe'),_0x308c94,'request\x20sent');logger[_0x73ff('0xf')](_0x73ff('0x10'),_0x308c94,_0x73ff('0x11'),JSON['stringify'](_0x9e3dde));if(_0x9e3dde[_0x73ff('0x12')]){if(_0x9e3dde[_0x73ff('0x12')]['code']===0x1f4){logger[_0x73ff('0x12')](_0x73ff('0xe'),_0x308c94,_0x9e3dde[_0x73ff('0x12')][_0x73ff('0x13')]);return _0xd95fa5(_0x9e3dde[_0x73ff('0x12')][_0x73ff('0x13')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x308c94,_0x9e3dde[_0x73ff('0x12')][_0x73ff('0x13')]);return _0x14e66f(_0x9e3dde[_0x73ff('0x12')][_0x73ff('0x13')]);}else{logger['info'](_0x73ff('0xe'),_0x308c94,_0x73ff('0x11'));_0x14e66f(_0x9e3dde[_0x73ff('0x14')]['message']);}})[_0x73ff('0x15')](function(_0xf35447){logger[_0x73ff('0x12')](_0x73ff('0xe'),_0x308c94,_0xf35447);_0xd95fa5(_0xf35447);});});} \ No newline at end of file +var _0xa640=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x47c842,_0x31f193){var _0x336fec=function(_0x4c57f0){while(--_0x4c57f0){_0x47c842['push'](_0x47c842['shift']());}};_0x336fec(++_0x31f193);}(_0xa640,0x6e));var _0x0a64=function(_0x5a06d9,_0x17e4ff){_0x5a06d9=_0x5a06d9-0x0;var _0x5ee5bf=_0xa640[_0x5a06d9];return _0x5ee5bf;};'use strict';var _=require('lodash');var util=require(_0x0a64('0x0'));var moment=require('moment');var BPromise=require(_0x0a64('0x1'));var rs=require(_0x0a64('0x2'));var fs=require('fs');var Redis=require(_0x0a64('0x3'));var db=require(_0x0a64('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a64('0x5'))('rpc');var config=require(_0x0a64('0x6'));var jayson=require(_0x0a64('0x7'));var client=jayson[_0x0a64('0x8')][_0x0a64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cc594,_0x3f71d7,_0x4bdd48){return new BPromise(function(_0x56c590,_0x2b1b20){return client[_0x0a64('0xa')](_0x2cc594,_0x4bdd48)[_0x0a64('0xb')](function(_0x2298b3){logger[_0x0a64('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f71d7,_0x0a64('0xd'));logger[_0x0a64('0xe')](_0x0a64('0xf'),_0x3f71d7,'request\x20sent',JSON['stringify'](_0x2298b3));if(_0x2298b3[_0x0a64('0x10')]){if(_0x2298b3[_0x0a64('0x10')][_0x0a64('0x11')]===0x1f4){logger[_0x0a64('0x10')](_0x0a64('0x12'),_0x3f71d7,_0x2298b3[_0x0a64('0x10')][_0x0a64('0x13')]);return _0x2b1b20(_0x2298b3[_0x0a64('0x10')][_0x0a64('0x13')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f71d7,_0x2298b3['error']['message']);return _0x56c590(_0x2298b3[_0x0a64('0x10')]['message']);}else{logger[_0x0a64('0xc')](_0x0a64('0x12'),_0x3f71d7,_0x0a64('0xd'));_0x56c590(_0x2298b3[_0x0a64('0x14')][_0x0a64('0x13')]);}})[_0x0a64('0x15')](function(_0x594899){logger[_0x0a64('0x10')](_0x0a64('0x12'),_0x3f71d7,_0x594899);_0x2b1b20(_0x594899);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index ee40401..0a3ed4d 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 _0x8015=['express','Router','fs-extra','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','path','connect-timeout'];(function(_0x8537d2,_0x318056){var _0x5ea89c=function(_0x5b900b){while(--_0x5b900b){_0x8537d2['push'](_0x8537d2['shift']());}};_0x5ea89c(++_0x318056);}(_0x8015,0x1eb));var _0x5801=function(_0xf0d6e0,_0x26ff19){_0xf0d6e0=_0xf0d6e0-0x0;var _0x4a7d5c=_0x8015[_0xf0d6e0];return _0x4a7d5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5801('0x0'));var timeout=require(_0x5801('0x1'));var express=require(_0x5801('0x2'));var router=express[_0x5801('0x3')]();var fs_extra=require(_0x5801('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5801('0x5'));var controller=require(_0x5801('0x6'));router[_0x5801('0x7')]('/',auth[_0x5801('0x8')](),controller[_0x5801('0x9')]);router['get'](_0x5801('0xa'),auth[_0x5801('0x8')](),controller[_0x5801('0xb')]);router[_0x5801('0xc')]('/',auth[_0x5801('0x8')](),controller[_0x5801('0xd')]);router[_0x5801('0xe')](_0x5801('0xa'),auth[_0x5801('0x8')](),controller[_0x5801('0xf')]);router['delete'](_0x5801('0xa'),auth['isAuthenticated'](),controller[_0x5801('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf4af=['/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x2e96bc,_0x235471){var _0x1bb2d5=function(_0x4f16c3){while(--_0x4f16c3){_0x2e96bc['push'](_0x2e96bc['shift']());}};_0x1bb2d5(++_0x235471);}(_0xf4af,0x116));var _0xff4a=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0xf4af[_0x2d364e];return _0x1b9312;};'use strict';var multer=require(_0xff4a('0x0'));var util=require(_0xff4a('0x1'));var path=require(_0xff4a('0x2'));var timeout=require(_0xff4a('0x3'));var express=require(_0xff4a('0x4'));var router=express[_0xff4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xff4a('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0xff4a('0x7')]('/',auth[_0xff4a('0x8')](),controller[_0xff4a('0x9')]);router[_0xff4a('0x7')](_0xff4a('0xa'),auth[_0xff4a('0x8')](),controller['show']);router[_0xff4a('0xb')]('/',auth[_0xff4a('0x8')](),controller['create']);router['put'](_0xff4a('0xa'),auth[_0xff4a('0x8')](),controller[_0xff4a('0xc')]);router[_0xff4a('0xd')]('/:id',auth[_0xff4a('0x8')](),controller[_0xff4a('0xe')]);module[_0xff4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5662024..8705771 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 _0x0e71=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e71,0x121));var _0x10e7=function(_0x4e19dd,_0x2ba02d){_0x4e19dd=_0x4e19dd-0x0;var _0x4e99ef=_0x0e71[_0x4e19dd];return _0x4e99ef;};'use strict';var Sequelize=require(_0x10e7('0x0'));module[_0x10e7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x10e7('0x2'),_0x10e7('0x3'),_0x10e7('0x4'),_0x10e7('0x5'),_0x10e7('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x10e7('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x10e7('0x8')](_0x10e7('0x2'),_0x10e7('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x10e7('0x7')]},'nameField':{'type':Sequelize[_0x10e7('0x7')]},'customField':{'type':Sequelize[_0x10e7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x10e7('0x7')]}}; \ No newline at end of file +var _0x0e12=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x386266,_0x5192d9){var _0x53685b=function(_0x232c3a){while(--_0x232c3a){_0x386266['push'](_0x386266['shift']());}};_0x53685b(++_0x5192d9);}(_0x0e12,0x9e));var _0x20e1=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x0e12[_0x56b138];return _0x3df878;};'use strict';var Sequelize=require(_0x20e1('0x0'));module['exports']={'type':{'type':Sequelize[_0x20e1('0x1')](_0x20e1('0x2'),_0x20e1('0x3'),_0x20e1('0x4'),_0x20e1('0x5'),'picklist'),'defaultValue':_0x20e1('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x20e1('0x6')]},'keyType':{'type':Sequelize[_0x20e1('0x1')](_0x20e1('0x2'),_0x20e1('0x3'),_0x20e1('0x4'))},'keyContent':{'type':Sequelize[_0x20e1('0x6')]},'idField':{'type':Sequelize[_0x20e1('0x6')]},'nameField':{'type':Sequelize[_0x20e1('0x6')]},'customField':{'type':Sequelize[_0x20e1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x20e1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 98bad1d..de805b1 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 _0x41bb=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','FreshdeskField','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xd866e8,_0x4d3a65){var _0x5ddc0c=function(_0x6a216f){while(--_0x6a216f){_0xd866e8['push'](_0xd866e8['shift']());}};_0x5ddc0c(++_0x4d3a65);}(_0x41bb,0xc5));var _0xb41b=function(_0x2a7a96,_0x1341ed){_0x2a7a96=_0x2a7a96-0x0;var _0x5077ea=_0x41bb[_0x2a7a96];return _0x5077ea;};'use strict';var emlformat=require(_0xb41b('0x0'));var rimraf=require(_0xb41b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb41b('0x2'));var rp=require('request-promise');var moment=require(_0xb41b('0x3'));var BPromise=require(_0xb41b('0x4'));var Mustache=require(_0xb41b('0x5'));var util=require(_0xb41b('0x6'));var path=require('path');var sox=require(_0xb41b('0x7'));var csv=require(_0xb41b('0x8'));var ejs=require(_0xb41b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb41b('0xa'));var jsforce=require(_0xb41b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb41b('0x8'));var querystring=require(_0xb41b('0xc'));var Papa=require(_0xb41b('0xd'));var Redis=require(_0xb41b('0xe'));var authService=require(_0xb41b('0xf'));var qs=require(_0xb41b('0x10'));var as=require(_0xb41b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb41b('0x12'))('api');var utils=require(_0xb41b('0x13'));var config=require(_0xb41b('0x14'));var licenseUtil=require(_0xb41b('0x15'));var db=require(_0xb41b('0x16'))['db'];function respondWithStatusCode(_0x2066d5,_0x5f1ea4){_0x5f1ea4=_0x5f1ea4||0xcc;return function(_0x353ba3){if(_0x353ba3){return _0x2066d5[_0xb41b('0x17')](_0x5f1ea4);}return _0x2066d5[_0xb41b('0x18')](_0x5f1ea4)[_0xb41b('0x19')]();};}function respondWithResult(_0x3be1ec,_0x4e8603){_0x4e8603=_0x4e8603||0xc8;return function(_0x4e7f11){if(_0x4e7f11){return _0x3be1ec['status'](_0x4e8603)[_0xb41b('0x1a')](_0x4e7f11);}};}function respondWithFilteredResult(_0xdc5fb0,_0x143a81){return function(_0x338920){if(_0x338920){var _0x29ea51=typeof _0x143a81['offset']===_0xb41b('0x1b')&&typeof _0x143a81[_0xb41b('0x1c')]===_0xb41b('0x1b');var _0xcf0728=_0x338920[_0xb41b('0x1d')];var _0x47154d=_0x29ea51?0x0:_0x143a81[_0xb41b('0x1e')];var _0x5df8c2=_0x29ea51?_0x338920['count']:_0x143a81['offset']+_0x143a81[_0xb41b('0x1c')];var _0x503e86;if(_0x5df8c2>=_0xcf0728){_0x5df8c2=_0xcf0728;_0x503e86=0xc8;}else{_0x503e86=0xce;}_0xdc5fb0[_0xb41b('0x18')](_0x503e86);return _0xdc5fb0[_0xb41b('0x1f')](_0xb41b('0x20'),_0x47154d+'-'+_0x5df8c2+'/'+_0xcf0728)['json'](_0x338920);}return null;};}function patchUpdates(_0x53bc44){return function(_0x1a1386){try{jsonpatch[_0xb41b('0x21')](_0x1a1386,_0x53bc44,!![]);}catch(_0xd1bc61){return BPromise[_0xb41b('0x22')](_0xd1bc61);}return _0x1a1386[_0xb41b('0x23')]();};}function saveUpdates(_0x42dccb,_0x4c73da){return function(_0x58f149){if(_0x58f149){return _0x58f149[_0xb41b('0x24')](_0x42dccb)[_0xb41b('0x25')](function(_0x871b35){return _0x871b35;});}return null;};}function removeEntity(_0x583741,_0x14e9c8){return function(_0x2441d6){if(_0x2441d6){return _0x2441d6['destroy']()[_0xb41b('0x25')](function(){_0x583741[_0xb41b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed3c7e,_0x4a7992){return function(_0x2d0f27){if(!_0x2d0f27){_0xed3c7e[_0xb41b('0x17')](0x194);}return _0x2d0f27;};}function handleError(_0x53e3a2,_0x3af2c){_0x3af2c=_0x3af2c||0x1f4;return function(_0x4265b8){logger['error'](_0x4265b8['stack']);if(_0x4265b8[_0xb41b('0x26')]){delete _0x4265b8[_0xb41b('0x26')];}_0x53e3a2[_0xb41b('0x18')](_0x3af2c)[_0xb41b('0x27')](_0x4265b8);};}exports[_0xb41b('0x28')]=function(_0x181cbd,_0x253efb){var _0x545395={},_0x26ef96={},_0xb68029={'count':0x0,'rows':[]};var _0x5069aa=_[_0xb41b('0x29')](db['FreshdeskField'][_0xb41b('0x2a')],function(_0x31d4cd){return{'name':_0x31d4cd['fieldName'],'type':_0x31d4cd[_0xb41b('0x2b')]['key']};});_0x26ef96[_0xb41b('0x2c')]=_[_0xb41b('0x29')](_0x5069aa,'name');_0x26ef96[_0xb41b('0x2d')]=_[_0xb41b('0x2e')](_0x181cbd[_0xb41b('0x2d')]);_0x26ef96[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],_0x26ef96[_0xb41b('0x2d')]);_0x545395[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],qs['fields'](_0x181cbd[_0xb41b('0x2d')]['fields']));_0x545395['attributes']=_0x545395[_0xb41b('0x31')][_0xb41b('0x32')]?_0x545395[_0xb41b('0x31')]:_0x26ef96[_0xb41b('0x2c')];if(!_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x33')](_0xb41b('0x34'))){_0x545395[_0xb41b('0x1c')]=qs[_0xb41b('0x1c')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1c')]);_0x545395['offset']=qs[_0xb41b('0x1e')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1e')]);}_0x545395[_0xb41b('0x35')]=qs[_0xb41b('0x36')](_0x181cbd[_0xb41b('0x2d')]['sort']);_0x545395['where']=qs[_0xb41b('0x2f')](_[_0xb41b('0x37')](_0x181cbd['query'],_0x26ef96[_0xb41b('0x2f')]),_0x5069aa);if(_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]){_0x545395[_0xb41b('0x39')]=_[_0xb41b('0x3a')](_0x545395['where'],{'$or':_[_0xb41b('0x29')](_0x5069aa,function(_0x5775d3){if(_0x5775d3[_0xb41b('0x2b')]!==_0xb41b('0x3b')){var _0x799d6={};_0x799d6[_0x5775d3[_0xb41b('0x26')]]={'$like':'%'+_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]+'%'};return _0x799d6;}})});}_0x545395=_[_0xb41b('0x3a')]({},_0x545395,_0x181cbd[_0xb41b('0x3c')]);var _0x2b0721={'where':_0x545395['where']};return db['FreshdeskField']['count'](_0x2b0721)[_0xb41b('0x25')](function(_0x5147ce){_0xb68029['count']=_0x5147ce;if(_0x181cbd[_0xb41b('0x2d')]['includeAll']){_0x545395[_0xb41b('0x3d')]=[{'all':!![]}];}return db[_0xb41b('0x3e')][_0xb41b('0x3f')](_0x545395);})[_0xb41b('0x25')](function(_0x4fa390){_0xb68029[_0xb41b('0x40')]=_0x4fa390;return _0xb68029;})[_0xb41b('0x25')](respondWithFilteredResult(_0x253efb,_0x545395))['catch'](handleError(_0x253efb,null));};exports[_0xb41b('0x41')]=function(_0xa70324,_0x3f181c){var _0x174d6c={'raw':!![],'where':{'id':_0xa70324[_0xb41b('0x42')]['id']}},_0x47bab5={};_0x47bab5['model']=_[_0xb41b('0x2e')](db[_0xb41b('0x3e')][_0xb41b('0x2a')]);_0x47bab5['query']=_['keys'](_0xa70324[_0xb41b('0x2d')]);_0x47bab5[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x47bab5[_0xb41b('0x2c')],_0x47bab5[_0xb41b('0x2d')]);_0x174d6c[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x47bab5['model'],qs['fields'](_0xa70324[_0xb41b('0x2d')]['fields']));_0x174d6c[_0xb41b('0x31')]=_0x174d6c['attributes'][_0xb41b('0x32')]?_0x174d6c['attributes']:_0x47bab5[_0xb41b('0x2c')];if(_0xa70324['query'][_0xb41b('0x43')]){_0x174d6c[_0xb41b('0x3d')]=[{'all':!![]}];}_0x174d6c=_[_0xb41b('0x3a')]({},_0x174d6c,_0xa70324[_0xb41b('0x3c')]);return db['FreshdeskField'][_0xb41b('0x44')](_0x174d6c)[_0xb41b('0x25')](handleEntityNotFound(_0x3f181c,null))['then'](respondWithResult(_0x3f181c,null))[_0xb41b('0x45')](handleError(_0x3f181c,null));};exports['create']=function(_0x5cc658,_0x5733d0){return db['FreshdeskField'][_0xb41b('0x46')](_0x5cc658[_0xb41b('0x47')],{})[_0xb41b('0x25')](respondWithResult(_0x5733d0,0xc9))[_0xb41b('0x45')](handleError(_0x5733d0,null));};exports[_0xb41b('0x24')]=function(_0x349a6c,_0x34d076){if(_0x349a6c[_0xb41b('0x47')]['id']){delete _0x349a6c[_0xb41b('0x47')]['id'];}return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x349a6c[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x34d076,null))[_0xb41b('0x25')](saveUpdates(_0x349a6c[_0xb41b('0x47')],null))[_0xb41b('0x25')](respondWithResult(_0x34d076,null))['catch'](handleError(_0x34d076,null));};exports[_0xb41b('0x48')]=function(_0x5e041d,_0x4a7aa3){return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x5e041d[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x4a7aa3,null))[_0xb41b('0x25')](removeEntity(_0x4a7aa3,null))[_0xb41b('0x45')](handleError(_0x4a7aa3,null));}; \ No newline at end of file +var _0x2750=['show','params','rawAttributes','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','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','count','offset','set','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','FreshdeskField','include','findAll','rows','catch'];(function(_0x1ceb14,_0x35e7c8){var _0x870cfa=function(_0x6baf6c){while(--_0x6baf6c){_0x1ceb14['push'](_0x1ceb14['shift']());}};_0x870cfa(++_0x35e7c8);}(_0x2750,0x13b));var _0x0275=function(_0x45a057,_0x1cb3e4){_0x45a057=_0x45a057-0x0;var _0x599481=_0x2750[_0x45a057];return _0x599481;};'use strict';var emlformat=require(_0x0275('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0275('0x1'));var jsonpatch=require(_0x0275('0x2'));var rp=require(_0x0275('0x3'));var moment=require(_0x0275('0x4'));var BPromise=require(_0x0275('0x5'));var Mustache=require(_0x0275('0x6'));var util=require(_0x0275('0x7'));var path=require(_0x0275('0x8'));var sox=require(_0x0275('0x9'));var csv=require(_0x0275('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0275('0xb'));var _=require(_0x0275('0xc'));var squel=require(_0x0275('0xd'));var crypto=require(_0x0275('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0275('0xf'));var toCsv=require(_0x0275('0xa'));var querystring=require(_0x0275('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0275('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0275('0x12'));var hardwareService=require(_0x0275('0x13'));var logger=require(_0x0275('0x14'))(_0x0275('0x15'));var utils=require(_0x0275('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0275('0x17'));var db=require(_0x0275('0x18'))['db'];function respondWithStatusCode(_0x1f128d,_0x4c6ee0){_0x4c6ee0=_0x4c6ee0||0xcc;return function(_0x55ffd6){if(_0x55ffd6){return _0x1f128d[_0x0275('0x19')](_0x4c6ee0);}return _0x1f128d[_0x0275('0x1a')](_0x4c6ee0)[_0x0275('0x1b')]();};}function respondWithResult(_0x46a729,_0x28827b){_0x28827b=_0x28827b||0xc8;return function(_0x36921c){if(_0x36921c){return _0x46a729['status'](_0x28827b)[_0x0275('0x1c')](_0x36921c);}};}function respondWithFilteredResult(_0x3030c0,_0x4aa412){return function(_0x6344fc){if(_0x6344fc){var _0xaae367=typeof _0x4aa412['offset']===_0x0275('0x1d')&&typeof _0x4aa412[_0x0275('0x1e')]==='undefined';var _0x5e7466=_0x6344fc['count'];var _0x591d27=_0xaae367?0x0:_0x4aa412['offset'];var _0x566ad6=_0xaae367?_0x6344fc[_0x0275('0x1f')]:_0x4aa412[_0x0275('0x20')]+_0x4aa412['limit'];var _0x7075c9;if(_0x566ad6>=_0x5e7466){_0x566ad6=_0x5e7466;_0x7075c9=0xc8;}else{_0x7075c9=0xce;}_0x3030c0[_0x0275('0x1a')](_0x7075c9);return _0x3030c0[_0x0275('0x21')]('Content-Range',_0x591d27+'-'+_0x566ad6+'/'+_0x5e7466)[_0x0275('0x1c')](_0x6344fc);}return null;};}function patchUpdates(_0x402f0d){return function(_0x575786){try{jsonpatch['apply'](_0x575786,_0x402f0d,!![]);}catch(_0x31ba9e){return BPromise[_0x0275('0x22')](_0x31ba9e);}return _0x575786[_0x0275('0x23')]();};}function saveUpdates(_0x592a53,_0xf3b68e){return function(_0x5ab9e7){if(_0x5ab9e7){return _0x5ab9e7[_0x0275('0x24')](_0x592a53)['then'](function(_0x26f2c2){return _0x26f2c2;});}return null;};}function removeEntity(_0xfa0081,_0x594321){return function(_0x140a18){if(_0x140a18){return _0x140a18[_0x0275('0x25')]()[_0x0275('0x26')](function(){_0xfa0081['status'](0xcc)[_0x0275('0x1b')]();});}};}function handleEntityNotFound(_0x44bbf8,_0x24c928){return function(_0x15813f){if(!_0x15813f){_0x44bbf8[_0x0275('0x19')](0x194);}return _0x15813f;};}function handleError(_0x437752,_0x56f26c){_0x56f26c=_0x56f26c||0x1f4;return function(_0x35343c){logger[_0x0275('0x27')](_0x35343c[_0x0275('0x28')]);if(_0x35343c[_0x0275('0x29')]){delete _0x35343c[_0x0275('0x29')];}_0x437752['status'](_0x56f26c)[_0x0275('0x2a')](_0x35343c);};}exports[_0x0275('0x2b')]=function(_0x3246ea,_0xe9d730){var _0xe5863c={},_0x49e645={},_0x2d49b4={'count':0x0,'rows':[]};var _0x287be3=_[_0x0275('0x2c')](db['FreshdeskField']['rawAttributes'],function(_0x3cb2d7){return{'name':_0x3cb2d7[_0x0275('0x2d')],'type':_0x3cb2d7['type'][_0x0275('0x2e')]};});_0x49e645[_0x0275('0x2f')]=_[_0x0275('0x2c')](_0x287be3,_0x0275('0x29'));_0x49e645['query']=_[_0x0275('0x30')](_0x3246ea[_0x0275('0x31')]);_0x49e645[_0x0275('0x32')]=_[_0x0275('0x33')](_0x49e645['model'],_0x49e645[_0x0275('0x31')]);_0xe5863c['attributes']=_[_0x0275('0x33')](_0x49e645['model'],qs[_0x0275('0x34')](_0x3246ea[_0x0275('0x31')]['fields']));_0xe5863c[_0x0275('0x35')]=_0xe5863c[_0x0275('0x35')][_0x0275('0x36')]?_0xe5863c[_0x0275('0x35')]:_0x49e645['model'];if(!_0x3246ea[_0x0275('0x31')][_0x0275('0x37')](_0x0275('0x38'))){_0xe5863c[_0x0275('0x1e')]=qs[_0x0275('0x1e')](_0x3246ea['query'][_0x0275('0x1e')]);_0xe5863c[_0x0275('0x20')]=qs[_0x0275('0x20')](_0x3246ea[_0x0275('0x31')][_0x0275('0x20')]);}_0xe5863c[_0x0275('0x39')]=qs[_0x0275('0x3a')](_0x3246ea[_0x0275('0x31')][_0x0275('0x3a')]);_0xe5863c[_0x0275('0x3b')]=qs[_0x0275('0x32')](_['pick'](_0x3246ea[_0x0275('0x31')],_0x49e645[_0x0275('0x32')]),_0x287be3);if(_0x3246ea[_0x0275('0x31')][_0x0275('0x3c')]){_0xe5863c[_0x0275('0x3b')]=_[_0x0275('0x3d')](_0xe5863c[_0x0275('0x3b')],{'$or':_[_0x0275('0x2c')](_0x287be3,function(_0x34cbe3){if(_0x34cbe3[_0x0275('0x3e')]!==_0x0275('0x3f')){var _0x43417a={};_0x43417a[_0x34cbe3[_0x0275('0x29')]]={'$like':'%'+_0x3246ea[_0x0275('0x31')]['filter']+'%'};return _0x43417a;}})});}_0xe5863c=_[_0x0275('0x3d')]({},_0xe5863c,_0x3246ea[_0x0275('0x40')]);var _0x4d2d59={'where':_0xe5863c[_0x0275('0x3b')]};return db[_0x0275('0x41')][_0x0275('0x1f')](_0x4d2d59)[_0x0275('0x26')](function(_0x3611f5){_0x2d49b4[_0x0275('0x1f')]=_0x3611f5;if(_0x3246ea[_0x0275('0x31')]['includeAll']){_0xe5863c[_0x0275('0x42')]=[{'all':!![]}];}return db[_0x0275('0x41')][_0x0275('0x43')](_0xe5863c);})[_0x0275('0x26')](function(_0x4f888c){_0x2d49b4[_0x0275('0x44')]=_0x4f888c;return _0x2d49b4;})[_0x0275('0x26')](respondWithFilteredResult(_0xe9d730,_0xe5863c))[_0x0275('0x45')](handleError(_0xe9d730,null));};exports[_0x0275('0x46')]=function(_0x4ad75f,_0xcbfe0a){var _0x52f69c={'raw':!![],'where':{'id':_0x4ad75f[_0x0275('0x47')]['id']}},_0x261e66={};_0x261e66[_0x0275('0x2f')]=_[_0x0275('0x30')](db['FreshdeskField'][_0x0275('0x48')]);_0x261e66[_0x0275('0x31')]=_['keys'](_0x4ad75f[_0x0275('0x31')]);_0x261e66[_0x0275('0x32')]=_[_0x0275('0x33')](_0x261e66['model'],_0x261e66[_0x0275('0x31')]);_0x52f69c[_0x0275('0x35')]=_['intersection'](_0x261e66[_0x0275('0x2f')],qs[_0x0275('0x34')](_0x4ad75f[_0x0275('0x31')][_0x0275('0x34')]));_0x52f69c[_0x0275('0x35')]=_0x52f69c[_0x0275('0x35')][_0x0275('0x36')]?_0x52f69c[_0x0275('0x35')]:_0x261e66[_0x0275('0x2f')];if(_0x4ad75f[_0x0275('0x31')][_0x0275('0x49')]){_0x52f69c['include']=[{'all':!![]}];}_0x52f69c=_[_0x0275('0x3d')]({},_0x52f69c,_0x4ad75f[_0x0275('0x40')]);return db[_0x0275('0x41')][_0x0275('0x4a')](_0x52f69c)[_0x0275('0x26')](handleEntityNotFound(_0xcbfe0a,null))[_0x0275('0x26')](respondWithResult(_0xcbfe0a,null))[_0x0275('0x45')](handleError(_0xcbfe0a,null));};exports[_0x0275('0x4b')]=function(_0x300e40,_0x3ac454){return db[_0x0275('0x41')]['create'](_0x300e40['body'],{})[_0x0275('0x26')](respondWithResult(_0x3ac454,0xc9))[_0x0275('0x45')](handleError(_0x3ac454,null));};exports[_0x0275('0x24')]=function(_0x3bd019,_0x310c6b){if(_0x3bd019['body']['id']){delete _0x3bd019[_0x0275('0x4c')]['id'];}return db['FreshdeskField'][_0x0275('0x4a')]({'where':{'id':_0x3bd019[_0x0275('0x47')]['id']}})[_0x0275('0x26')](handleEntityNotFound(_0x310c6b,null))[_0x0275('0x26')](saveUpdates(_0x3bd019['body'],null))[_0x0275('0x26')](respondWithResult(_0x310c6b,null))['catch'](handleError(_0x310c6b,null));};exports['destroy']=function(_0x515860,_0x28e90f){return db['FreshdeskField'][_0x0275('0x4a')]({'where':{'id':_0x515860[_0x0275('0x47')]['id']}})[_0x0275('0x26')](handleEntityNotFound(_0x28e90f,null))[_0x0275('0x26')](removeEntity(_0x28e90f,null))[_0x0275('0x45')](handleError(_0x28e90f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index a4ef49a..9ce4963 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 _0x9491=['exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3627f3,_0x1b1896){var _0x5c6289=function(_0x213805){while(--_0x213805){_0x3627f3['push'](_0x3627f3['shift']());}};_0x5c6289(++_0x1b1896);}(_0x9491,0xb6));var _0x1949=function(_0x1ac350,_0x139d90){_0x1ac350=_0x1ac350-0x0;var _0x31fabc=_0x9491[_0x1ac350];return _0x31fabc;};'use strict';var _=require(_0x1949('0x0'));var util=require(_0x1949('0x1'));var logger=require(_0x1949('0x2'))(_0x1949('0x3'));var moment=require(_0x1949('0x4'));var BPromise=require(_0x1949('0x5'));var rp=require(_0x1949('0x6'));var fs=require('fs');var path=require(_0x1949('0x7'));var rimraf=require(_0x1949('0x8'));var config=require(_0x1949('0x9'));var attributes=require('./intFreshdeskField.attributes');module[_0x1949('0xa')]=function(_0x5b01b9,_0x14c30e){return _0x5b01b9[_0x1949('0xb')]('FreshdeskField',attributes,{'tableName':_0x1949('0xc'),'paranoid':![],'indexes':[{'name':_0x1949('0xd'),'fields':[_0x1949('0xe'),_0x1949('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6127=['api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x2c0807,_0x430274){var _0x917d5=function(_0x2bc2d4){while(--_0x2bc2d4){_0x2c0807['push'](_0x2c0807['shift']());}};_0x917d5(++_0x430274);}(_0x6127,0x165));var _0x7612=function(_0x1e8db4,_0x12b067){_0x1e8db4=_0x1e8db4-0x0;var _0x3e1495=_0x6127[_0x1e8db4];return _0x3e1495;};'use strict';var _=require(_0x7612('0x0'));var util=require(_0x7612('0x1'));var logger=require(_0x7612('0x2'))(_0x7612('0x3'));var moment=require(_0x7612('0x4'));var BPromise=require(_0x7612('0x5'));var rp=require(_0x7612('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7612('0x7'));var attributes=require(_0x7612('0x8'));module[_0x7612('0x9')]=function(_0x25e573,_0x3c8d5f){return _0x25e573['define'](_0x7612('0xa'),attributes,{'tableName':_0x7612('0xb'),'paranoid':![],'indexes':[{'name':_0x7612('0xc'),'fields':[_0x7612('0xd'),_0x7612('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index ec25f9e..c8eed55 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 _0x5de3=['then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2e997e,_0x4edf31){var _0x5a6cb1=function(_0x3904da){while(--_0x3904da){_0x2e997e['push'](_0x2e997e['shift']());}};_0x5a6cb1(++_0x4edf31);}(_0x5de3,0x113));var _0x35de=function(_0x17f4c8,_0x3aa345){_0x17f4c8=_0x17f4c8-0x0;var _0x288b47=_0x5de3[_0x17f4c8];return _0x288b47;};'use strict';var _=require(_0x35de('0x0'));var util=require(_0x35de('0x1'));var moment=require('moment');var BPromise=require(_0x35de('0x2'));var rs=require(_0x35de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35de('0x4'))['db'];var utils=require(_0x35de('0x5'));var logger=require(_0x35de('0x6'))(_0x35de('0x7'));var config=require(_0x35de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x35de('0x9')][_0x35de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22cbd1,_0x53c5e0,_0x3f0d12){return new BPromise(function(_0x438d0a,_0xf750d5){return client['request'](_0x22cbd1,_0x3f0d12)[_0x35de('0xb')](function(_0x3c7270){logger['info'](_0x35de('0xc'),_0x53c5e0,_0x35de('0xd'));logger['debug'](_0x35de('0xe'),_0x53c5e0,'request\x20sent',JSON[_0x35de('0xf')](_0x3c7270));if(_0x3c7270['error']){if(_0x3c7270[_0x35de('0x10')][_0x35de('0x11')]===0x1f4){logger[_0x35de('0x10')](_0x35de('0xc'),_0x53c5e0,_0x3c7270[_0x35de('0x10')][_0x35de('0x12')]);return _0xf750d5(_0x3c7270['error'][_0x35de('0x12')]);}logger[_0x35de('0x10')](_0x35de('0xc'),_0x53c5e0,_0x3c7270[_0x35de('0x10')][_0x35de('0x12')]);return _0x438d0a(_0x3c7270[_0x35de('0x10')][_0x35de('0x12')]);}else{logger[_0x35de('0x13')](_0x35de('0xc'),_0x53c5e0,_0x35de('0xd'));_0x438d0a(_0x3c7270[_0x35de('0x14')][_0x35de('0x12')]);}})[_0x35de('0x15')](function(_0x196f05){logger[_0x35de('0x10')](_0x35de('0xc'),_0x53c5e0,_0x196f05);_0xf750d5(_0x196f05);});});} \ No newline at end of file +var _0xf83b=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','info','result'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xf83b,0x176));var _0xbf83=function(_0x35668c,_0x3aae1f){_0x35668c=_0x35668c-0x0;var _0x252606=_0xf83b[_0x35668c];return _0x252606;};'use strict';var _=require(_0xbf83('0x0'));var util=require(_0xbf83('0x1'));var moment=require(_0xbf83('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf83('0x3'));var db=require(_0xbf83('0x4'))['db'];var utils=require(_0xbf83('0x5'));var logger=require(_0xbf83('0x6'))('rpc');var config=require(_0xbf83('0x7'));var jayson=require(_0xbf83('0x8'));var client=jayson[_0xbf83('0x9')][_0xbf83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x117cac,_0x2624e0,_0x22f250){return new BPromise(function(_0x483025,_0x2d3b9c){return client['request'](_0x117cac,_0x22f250)[_0xbf83('0xb')](function(_0x5157c1){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x2624e0,_0xbf83('0xc'));logger[_0xbf83('0xd')](_0xbf83('0xe'),_0x2624e0,_0xbf83('0xc'),JSON[_0xbf83('0xf')](_0x5157c1));if(_0x5157c1[_0xbf83('0x10')]){if(_0x5157c1[_0xbf83('0x10')][_0xbf83('0x11')]===0x1f4){logger[_0xbf83('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x2624e0,_0x5157c1[_0xbf83('0x10')][_0xbf83('0x12')]);return _0x2d3b9c(_0x5157c1[_0xbf83('0x10')][_0xbf83('0x12')]);}logger[_0xbf83('0x10')](_0xbf83('0x13'),_0x2624e0,_0x5157c1[_0xbf83('0x10')][_0xbf83('0x12')]);return _0x483025(_0x5157c1[_0xbf83('0x10')][_0xbf83('0x12')]);}else{logger[_0xbf83('0x14')](_0xbf83('0x13'),_0x2624e0,_0xbf83('0xc'));_0x483025(_0x5157c1[_0xbf83('0x15')]['message']);}})['catch'](function(_0x55fec4){logger[_0xbf83('0x10')](_0xbf83('0x13'),_0x2624e0,_0x55fec4);_0x2d3b9c(_0x55fec4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0875968..27a2993 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 _0xe511=['get','index','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0xfde6a6,_0x43472b){var _0xe59107=function(_0xf26400){while(--_0xf26400){_0xfde6a6['push'](_0xfde6a6['shift']());}};_0xe59107(++_0x43472b);}(_0xe511,0x16f));var _0x1e51=function(_0x223ee7,_0x570db2){_0x223ee7=_0x223ee7-0x0;var _0x508164=_0xe511[_0x223ee7];return _0x508164;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x10')]);router[_0x1e51('0xf')](_0x1e51('0x11'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x14')]);router[_0x1e51('0x15')](_0x1e51('0x16'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x17')]);module[_0x1e51('0x18')]=router; \ No newline at end of file +var _0x57f8=['/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x462a36,_0x592ddd){var _0x1f300b=function(_0x333b4d){while(--_0x333b4d){_0x462a36['push'](_0x462a36['shift']());}};_0x1f300b(++_0x592ddd);}(_0x57f8,0x198));var _0x857f=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x57f8[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var fs_extra=require(_0x857f('0x5'));var auth=require(_0x857f('0x6'));var interaction=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var controller=require(_0x857f('0x9'));router[_0x857f('0xa')]('/',auth[_0x857f('0xb')](),controller['index']);router[_0x857f('0xa')](_0x857f('0xc'),auth[_0x857f('0xb')](),controller['show']);router[_0x857f('0xa')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['getConfigurations']);router[_0x857f('0xa')](_0x857f('0xe'),auth[_0x857f('0xb')](),controller['getFields']);router[_0x857f('0xf')]('/',auth[_0x857f('0xb')](),controller[_0x857f('0x10')]);router[_0x857f('0xf')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller[_0x857f('0x11')]);router['put'](_0x857f('0xc'),auth[_0x857f('0xb')](),controller[_0x857f('0x12')]);router[_0x857f('0x13')](_0x857f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x857f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index c178fd5..ce51fa5 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 _0x0120=['remoteUri','sequelize','exports','STRING','username'];(function(_0x44a1b2,_0x510940){var _0x198e03=function(_0x1ac418){while(--_0x1ac418){_0x44a1b2['push'](_0x44a1b2['shift']());}};_0x198e03(++_0x510940);}(_0x0120,0x6f));var _0x0012=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0120[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'apiKey':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'serverUrl':{'type':Sequelize[_0x0012('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xffd6=['exports','STRING','username','sequelize'];(function(_0x1522fc,_0x35947c){var _0x15f6ab=function(_0x537274){while(--_0x537274){_0x1522fc['push'](_0x1522fc['shift']());}};_0x15f6ab(++_0x35947c);}(_0xffd6,0x97));var _0x6ffd=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xffd6[_0x386c3e];return _0x4b8e13;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('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 e34750b..95f87b5 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 _0x846a=['filters','filter','merge','type','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','length','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','apiKey','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','json','offset','undefined','count','status','set','Content-Range','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','query','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x1c0c35,_0x173747){var _0x5b64a8=function(_0x4e16b6){while(--_0x4e16b6){_0x1c0c35['push'](_0x1c0c35['shift']());}};_0x5b64a8(++_0x173747);}(_0x846a,0x1c4));var _0xa846=function(_0xca62b6,_0x2c53e7){_0xca62b6=_0xca62b6-0x0;var _0x1b81be=_0x846a[_0xca62b6];return _0x1b81be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa846('0x0'));var zipdir=require(_0xa846('0x1'));var jsonpatch=require(_0xa846('0x2'));var rp=require(_0xa846('0x3'));var moment=require(_0xa846('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa846('0x5'));var sox=require(_0xa846('0x6'));var csv=require(_0xa846('0x7'));var ejs=require(_0xa846('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa846('0x9'));var jsforce=require(_0xa846('0xa'));var deskjs=require(_0xa846('0xb'));var toCsv=require(_0xa846('0x7'));var querystring=require(_0xa846('0xc'));var Papa=require(_0xa846('0xd'));var Redis=require(_0xa846('0xe'));var authService=require(_0xa846('0xf'));var qs=require(_0xa846('0x10'));var as=require(_0xa846('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa846('0x12'))(_0xa846('0x13'));var utils=require('../../config/utils');var config=require(_0xa846('0x14'));var licenseUtil=require(_0xa846('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa846('0x16'));function respondWithStatusCode(_0x38b9b9,_0x4ca2ce){_0x4ca2ce=_0x4ca2ce||0xcc;return function(_0x1f793d){if(_0x1f793d){return _0x38b9b9[_0xa846('0x17')](_0x4ca2ce);}return _0x38b9b9['status'](_0x4ca2ce)['end']();};}function respondWithResult(_0x1caeb6,_0x222c3a){_0x222c3a=_0x222c3a||0xc8;return function(_0xa2a348){if(_0xa2a348){return _0x1caeb6['status'](_0x222c3a)[_0xa846('0x18')](_0xa2a348);}};}function respondWithFilteredResult(_0x2f3236,_0x67cecd){return function(_0x32a580){if(_0x32a580){var _0x27f984=typeof _0x67cecd[_0xa846('0x19')]==='undefined'&&typeof _0x67cecd['limit']===_0xa846('0x1a');var _0x5005e5=_0x32a580[_0xa846('0x1b')];var _0x4c234a=_0x27f984?0x0:_0x67cecd[_0xa846('0x19')];var _0x15b33c=_0x27f984?_0x32a580[_0xa846('0x1b')]:_0x67cecd[_0xa846('0x19')]+_0x67cecd['limit'];var _0x5009c2;if(_0x15b33c>=_0x5005e5){_0x15b33c=_0x5005e5;_0x5009c2=0xc8;}else{_0x5009c2=0xce;}_0x2f3236[_0xa846('0x1c')](_0x5009c2);return _0x2f3236[_0xa846('0x1d')](_0xa846('0x1e'),_0x4c234a+'-'+_0x15b33c+'/'+_0x5005e5)[_0xa846('0x18')](_0x32a580);}return null;};}function patchUpdates(_0x1dfbd1){return function(_0x3436cc){try{jsonpatch['apply'](_0x3436cc,_0x1dfbd1,!![]);}catch(_0x2cb807){return BPromise['reject'](_0x2cb807);}return _0x3436cc[_0xa846('0x1f')]();};}function saveUpdates(_0x1f01e4,_0x4c9cdc){return function(_0x140de3){if(_0x140de3){return _0x140de3[_0xa846('0x20')](_0x1f01e4)[_0xa846('0x21')](function(_0x5c9e12){return _0x5c9e12;});}return null;};}function removeEntity(_0x1a5939,_0x4bf2b7){return function(_0x4f2f59){if(_0x4f2f59){return _0x4f2f59[_0xa846('0x22')]()['then'](function(){_0x1a5939[_0xa846('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ecab2,_0x571878){return function(_0x2d063e){if(!_0x2d063e){_0x2ecab2[_0xa846('0x17')](0x194);}return _0x2d063e;};}function handleError(_0x3b0f08,_0x2b917f){_0x2b917f=_0x2b917f||0x1f4;return function(_0x18cd20){logger[_0xa846('0x23')](_0x18cd20[_0xa846('0x24')]);if(_0x18cd20[_0xa846('0x25')]){delete _0x18cd20[_0xa846('0x25')];}_0x3b0f08[_0xa846('0x1c')](_0x2b917f)[_0xa846('0x26')](_0x18cd20);};}exports['index']=function(_0x4bc164,_0x40a1d8){var _0x3ed28a={},_0x254654={},_0x16a661={'count':0x0,'rows':[]};var _0x16f663=_[_0xa846('0x27')](db['FreshsalesAccount'][_0xa846('0x28')],function(_0x1a3e3b){return{'name':_0x1a3e3b[_0xa846('0x29')],'type':_0x1a3e3b['type'][_0xa846('0x2a')]};});_0x254654['model']=_[_0xa846('0x27')](_0x16f663,_0xa846('0x25'));_0x254654[_0xa846('0x2b')]=_['keys'](_0x4bc164[_0xa846('0x2b')]);_0x254654['filters']=_['intersection'](_0x254654[_0xa846('0x2c')],_0x254654[_0xa846('0x2b')]);_0x3ed28a[_0xa846('0x2d')]=_['intersection'](_0x254654[_0xa846('0x2c')],qs[_0xa846('0x2e')](_0x4bc164['query'][_0xa846('0x2e')]));_0x3ed28a[_0xa846('0x2d')]=_0x3ed28a[_0xa846('0x2d')]['length']?_0x3ed28a[_0xa846('0x2d')]:_0x254654[_0xa846('0x2c')];if(!_0x4bc164['query'][_0xa846('0x2f')](_0xa846('0x30'))){_0x3ed28a['limit']=qs[_0xa846('0x31')](_0x4bc164[_0xa846('0x2b')][_0xa846('0x31')]);_0x3ed28a[_0xa846('0x19')]=qs[_0xa846('0x19')](_0x4bc164[_0xa846('0x2b')][_0xa846('0x19')]);}_0x3ed28a[_0xa846('0x32')]=qs[_0xa846('0x33')](_0x4bc164[_0xa846('0x2b')]['sort']);_0x3ed28a[_0xa846('0x34')]=qs[_0xa846('0x35')](_['pick'](_0x4bc164[_0xa846('0x2b')],_0x254654[_0xa846('0x35')]),_0x16f663);if(_0x4bc164[_0xa846('0x2b')][_0xa846('0x36')]){_0x3ed28a[_0xa846('0x34')]=_[_0xa846('0x37')](_0x3ed28a['where'],{'$or':_['map'](_0x16f663,function(_0x3a6008){if(_0x3a6008[_0xa846('0x38')]!==_0xa846('0x39')){var _0x349c6a={};_0x349c6a[_0x3a6008[_0xa846('0x25')]]={'$like':'%'+_0x4bc164[_0xa846('0x2b')][_0xa846('0x36')]+'%'};return _0x349c6a;}})});}_0x3ed28a=_['merge']({},_0x3ed28a,_0x4bc164[_0xa846('0x3a')]);var _0x156160={'where':_0x3ed28a[_0xa846('0x34')]};return db[_0xa846('0x3b')][_0xa846('0x1b')](_0x156160)[_0xa846('0x21')](function(_0x3eb6f5){_0x16a661['count']=_0x3eb6f5;if(_0x4bc164[_0xa846('0x2b')][_0xa846('0x3c')]){_0x3ed28a[_0xa846('0x3d')]=[{'all':!![]}];}return db[_0xa846('0x3b')][_0xa846('0x3e')](_0x3ed28a);})['then'](function(_0x57e805){_0x16a661[_0xa846('0x3f')]=_0x57e805;return _0x16a661;})[_0xa846('0x21')](respondWithFilteredResult(_0x40a1d8,_0x3ed28a))[_0xa846('0x40')](handleError(_0x40a1d8,null));};exports[_0xa846('0x41')]=function(_0x111c6f,_0x343c24){var _0x4f205f={'raw':![],'where':{'id':_0x111c6f[_0xa846('0x42')]['id']}},_0x6de383={};_0x6de383[_0xa846('0x2c')]=_['keys'](db[_0xa846('0x3b')]['rawAttributes']);_0x6de383[_0xa846('0x2b')]=_[_0xa846('0x43')](_0x111c6f['query']);_0x6de383[_0xa846('0x35')]=_['intersection'](_0x6de383['model'],_0x6de383['query']);_0x4f205f[_0xa846('0x2d')]=_[_0xa846('0x44')](_0x6de383['model'],qs[_0xa846('0x2e')](_0x111c6f['query'][_0xa846('0x2e')]));_0x4f205f[_0xa846('0x2d')]=_0x4f205f[_0xa846('0x2d')]['length']?_0x4f205f[_0xa846('0x2d')]:_0x6de383[_0xa846('0x2c')];if(_0x111c6f[_0xa846('0x2b')][_0xa846('0x3c')]){_0x4f205f[_0xa846('0x3d')]=[{'all':!![]}];}_0x4f205f=_[_0xa846('0x37')]({},_0x4f205f,_0x111c6f['options']);return db[_0xa846('0x3b')][_0xa846('0x45')](_0x4f205f)['then'](handleEntityNotFound(_0x343c24,null))['then'](respondWithResult(_0x343c24,null))[_0xa846('0x40')](handleError(_0x343c24,null));};exports[_0xa846('0x46')]=function(_0xa50f6,_0x35b1a9){return db['FreshsalesAccount']['create'](_0xa50f6[_0xa846('0x47')],{})[_0xa846('0x21')](respondWithResult(_0x35b1a9,0xc9))[_0xa846('0x40')](handleError(_0x35b1a9,null));};exports[_0xa846('0x20')]=function(_0x19cf24,_0x37fab0){if(_0x19cf24['body']['id']){delete _0x19cf24['body']['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x19cf24[_0xa846('0x42')]['id']}})['then'](handleEntityNotFound(_0x37fab0,null))[_0xa846('0x21')](saveUpdates(_0x19cf24[_0xa846('0x47')],null))[_0xa846('0x21')](respondWithResult(_0x37fab0,null))[_0xa846('0x40')](handleError(_0x37fab0,null));};exports[_0xa846('0x22')]=function(_0x27f696,_0xb9c283){return db['FreshsalesAccount']['find']({'where':{'id':_0x27f696[_0xa846('0x42')]['id']}})['then'](handleEntityNotFound(_0xb9c283,null))[_0xa846('0x21')](removeEntity(_0xb9c283,null))[_0xa846('0x40')](handleError(_0xb9c283,null));};exports[_0xa846('0x48')]=function(_0x1610ab,_0x380bf3,_0x35e2aa){var _0x235aa8={};var _0x1d822f={};var _0x30353e;var _0x47680e;return db[_0xa846('0x3b')][_0xa846('0x49')]({'where':{'id':_0x1610ab[_0xa846('0x42')]['id']}})[_0xa846('0x21')](handleEntityNotFound(_0x380bf3,null))['then'](function(_0x407700){if(_0x407700){_0x30353e=_0x407700;_0x1d822f[_0xa846('0x2c')]=_[_0xa846('0x43')](db[_0xa846('0x4a')][_0xa846('0x28')]);_0x1d822f[_0xa846('0x2b')]=_[_0xa846('0x43')](_0x1610ab['query']);_0x1d822f[_0xa846('0x35')]=_[_0xa846('0x44')](_0x1d822f[_0xa846('0x2c')],_0x1d822f[_0xa846('0x2b')]);_0x235aa8[_0xa846('0x2d')]=_['intersection'](_0x1d822f['model'],qs[_0xa846('0x2e')](_0x1610ab[_0xa846('0x2b')]['fields']));_0x235aa8[_0xa846('0x2d')]=_0x235aa8['attributes'][_0xa846('0x4b')]?_0x235aa8[_0xa846('0x2d')]:_0x1d822f['model'];_0x235aa8[_0xa846('0x32')]=qs['sort'](_0x1610ab[_0xa846('0x2b')][_0xa846('0x33')]);_0x235aa8['where']=qs[_0xa846('0x35')](_[_0xa846('0x4c')](_0x1610ab['query'],_0x1d822f[_0xa846('0x35')]));if(_0x1610ab[_0xa846('0x2b')]['filter']){_0x235aa8['where']=_[_0xa846('0x37')](_0x235aa8[_0xa846('0x34')],{'$or':_[_0xa846('0x27')](_0x235aa8[_0xa846('0x2d')],function(_0x18a02d){var _0x3a7214={};_0x3a7214[_0x18a02d]={'$like':'%'+_0x1610ab[_0xa846('0x2b')]['filter']+'%'};return _0x3a7214;})});}_0x235aa8=_['merge']({},_0x235aa8,_0x1610ab['options']);return _0x30353e['getConfigurations'](_0x235aa8);}})['then'](function(_0x485a90){if(_0x485a90){_0x47680e=_0x485a90[_0xa846('0x4b')];if(!_0x1610ab[_0xa846('0x2b')][_0xa846('0x2f')](_0xa846('0x30'))){_0x235aa8['limit']=qs[_0xa846('0x31')](_0x1610ab[_0xa846('0x2b')][_0xa846('0x31')]);_0x235aa8[_0xa846('0x19')]=qs[_0xa846('0x19')](_0x1610ab[_0xa846('0x2b')][_0xa846('0x19')]);}return _0x30353e[_0xa846('0x48')](_0x235aa8);}})['then'](function(_0x4a77d1){if(_0x4a77d1){return _0x4a77d1?{'count':_0x47680e,'rows':_0x4a77d1}:null;}})[_0xa846('0x21')](respondWithResult(_0x380bf3,null))['catch'](handleError(_0x380bf3,null));};exports[_0xa846('0x4d')]=function(_0x30af08,_0x3f1aaa,_0x996a9){if(_0x30af08[_0xa846('0x47')]['id']){delete _0x30af08[_0xa846('0x47')]['id'];}return db[_0xa846('0x3b')][_0xa846('0x49')]({'where':{'id':_0x30af08[_0xa846('0x42')]['id']}})[_0xa846('0x21')](handleEntityNotFound(_0x3f1aaa,null))[_0xa846('0x21')](function(_0xfaf626){if(_0xfaf626){_0x30af08[_0xa846('0x47')][_0xa846('0x4e')]=_0xfaf626['id'];_0x30af08[_0xa846('0x47')][_0xa846('0x4f')]=integrations[_0xa846('0x50')](_0x30af08['body'][_0xa846('0x51')],_0x30af08[_0xa846('0x47')][_0xa846('0x38')]);_0x30af08[_0xa846('0x47')][_0xa846('0x52')]=integrations[_0xa846('0x53')](_0x30af08[_0xa846('0x47')][_0xa846('0x51')],_0x30af08['body'][_0xa846('0x38')]);return db[_0xa846('0x4a')][_0xa846('0x46')](_0x30af08[_0xa846('0x47')],{'include':[{'model':db[_0xa846('0x54')],'as':_0xa846('0x4f')},{'model':db[_0xa846('0x54')],'as':_0xa846('0x52')}]});}return null;})[_0xa846('0x21')](respondWithResult(_0x3f1aaa,null))['catch'](handleError(_0x3f1aaa,null));};exports[_0xa846('0x55')]=function(_0x709e87,_0x4656f8,_0x16048a){var _0xe3e0a2='';var _0x20d5fd='';return db[_0xa846('0x3b')][_0xa846('0x49')]({'where':{'id':_0x709e87[_0xa846('0x42')]['id']},'attributes':['id',_0xa846('0x56'),'remoteUri','apiKey']})[_0xa846('0x21')](handleEntityNotFound(_0x4656f8,null))[_0xa846('0x21')](function(_0x728d8a){if(_0x728d8a){_0x20d5fd=_0x728d8a[_0xa846('0x56')];_0xe3e0a2=_0x728d8a[_0xa846('0x57')];var _0x38fd93=_0x728d8a[_0xa846('0x57')][_0xa846('0x58')](-0x1);if(_0x38fd93==='/'){_0xe3e0a2=_0xe3e0a2[_0xa846('0x59')](0x0,_0xe3e0a2[_0xa846('0x5a')](_0x38fd93));}return rp({'method':_0xa846('0x5b'),'uri':util[_0xa846('0x5c')](_0xa846('0x5d'),_0xe3e0a2,_0xa846('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x728d8a[_0xa846('0x5f')]},'json':!![]});}})['then'](function(_0x3c11df){if(_0x3c11df){var _0x207424=_0x3c11df[_0xa846('0x60')];var _0x4d6442=![];var _0xe6611=null;for(_0xe6611=0x0;_0xe6611<_0x207424[_0xa846('0x4b')];_0xe6611++){if(_0x207424[_0xe6611][_0xa846('0x61')]===_0x20d5fd){_0x4d6442=!![];}}if(_0x4d6442){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xa846('0x21')](respondWithResult(_0x4656f8,null))[_0xa846('0x40')](function(_0x1a3d69){var _0x13fc5b=_0x709e87[_0xa846('0x2b')]['test']?0x1f4:_0x1a3d69[_0xa846('0x62')]||0x1f4;logger[_0xa846('0x23')](_0xa846('0x63'),_0xa846('0x55'),_0x13fc5b,JSON[_0xa846('0x64')](_0x1a3d69));delete _0x1a3d69['name'];if(_0x13fc5b===0x191){_0x13fc5b=0x190;}_0x4656f8['status'](_0x13fc5b)[_0xa846('0x26')](_0x709e87['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x1a3d69[_0xa846('0x62')]}:_0x1a3d69);});}; \ No newline at end of file +var _0x1121=['../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','username','remoteUri','apiKey','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x590b4d,_0x3f88c8){var _0x2a82f9=function(_0x4e5db4){while(--_0x4e5db4){_0x590b4d['push'](_0x590b4d['shift']());}};_0x2a82f9(++_0x3f88c8);}(_0x1121,0x180));var _0x1112=function(_0x334c46,_0x192d67){_0x334c46=_0x334c46-0x0;var _0x258345=_0x1121[_0x334c46];return _0x258345;};'use strict';var emlformat=require(_0x1112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1112('0x1'));var jsonpatch=require(_0x1112('0x2'));var rp=require(_0x1112('0x3'));var moment=require(_0x1112('0x4'));var BPromise=require(_0x1112('0x5'));var Mustache=require(_0x1112('0x6'));var util=require(_0x1112('0x7'));var path=require(_0x1112('0x8'));var sox=require(_0x1112('0x9'));var csv=require(_0x1112('0xa'));var ejs=require(_0x1112('0xb'));var fs=require('fs');var fs_extra=require(_0x1112('0xc'));var _=require('lodash');var squel=require(_0x1112('0xd'));var crypto=require(_0x1112('0xe'));var jsforce=require(_0x1112('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1112('0xa'));var querystring=require(_0x1112('0x10'));var Papa=require(_0x1112('0x11'));var Redis=require('ioredis');var authService=require(_0x1112('0x12'));var qs=require(_0x1112('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1112('0x14'));var logger=require('../../config/logger')(_0x1112('0x15'));var utils=require(_0x1112('0x16'));var config=require(_0x1112('0x17'));var licenseUtil=require(_0x1112('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1112('0x19'));function respondWithStatusCode(_0x42f4be,_0x304a4e){_0x304a4e=_0x304a4e||0xcc;return function(_0x1902e3){if(_0x1902e3){return _0x42f4be[_0x1112('0x1a')](_0x304a4e);}return _0x42f4be[_0x1112('0x1b')](_0x304a4e)[_0x1112('0x1c')]();};}function respondWithResult(_0x144b02,_0x5c2c2c){_0x5c2c2c=_0x5c2c2c||0xc8;return function(_0x362da3){if(_0x362da3){return _0x144b02[_0x1112('0x1b')](_0x5c2c2c)[_0x1112('0x1d')](_0x362da3);}};}function respondWithFilteredResult(_0x49a442,_0x595ee6){return function(_0x533f58){if(_0x533f58){var _0xfcb7fd=typeof _0x595ee6[_0x1112('0x1e')]===_0x1112('0x1f')&&typeof _0x595ee6[_0x1112('0x20')]===_0x1112('0x1f');var _0x8bba63=_0x533f58[_0x1112('0x21')];var _0x2525d8=_0xfcb7fd?0x0:_0x595ee6[_0x1112('0x1e')];var _0x13c179=_0xfcb7fd?_0x533f58[_0x1112('0x21')]:_0x595ee6[_0x1112('0x1e')]+_0x595ee6[_0x1112('0x20')];var _0x9c230d;if(_0x13c179>=_0x8bba63){_0x13c179=_0x8bba63;_0x9c230d=0xc8;}else{_0x9c230d=0xce;}_0x49a442[_0x1112('0x1b')](_0x9c230d);return _0x49a442[_0x1112('0x22')]('Content-Range',_0x2525d8+'-'+_0x13c179+'/'+_0x8bba63)[_0x1112('0x1d')](_0x533f58);}return null;};}function patchUpdates(_0x5dfe64){return function(_0x2fc6e1){try{jsonpatch[_0x1112('0x23')](_0x2fc6e1,_0x5dfe64,!![]);}catch(_0x2f185e){return BPromise[_0x1112('0x24')](_0x2f185e);}return _0x2fc6e1['save']();};}function saveUpdates(_0x4eeba2,_0x2b97a3){return function(_0x18b77f){if(_0x18b77f){return _0x18b77f[_0x1112('0x25')](_0x4eeba2)[_0x1112('0x26')](function(_0x4e3956){return _0x4e3956;});}return null;};}function removeEntity(_0x4599f3,_0x2e8b3d){return function(_0x568acd){if(_0x568acd){return _0x568acd[_0x1112('0x27')]()[_0x1112('0x26')](function(){_0x4599f3['status'](0xcc)[_0x1112('0x1c')]();});}};}function handleEntityNotFound(_0x958828,_0x2f9485){return function(_0x5dfb15){if(!_0x5dfb15){_0x958828['sendStatus'](0x194);}return _0x5dfb15;};}function handleError(_0x10f15f,_0x14f9b6){_0x14f9b6=_0x14f9b6||0x1f4;return function(_0x151074){logger[_0x1112('0x28')](_0x151074['stack']);if(_0x151074['name']){delete _0x151074['name'];}_0x10f15f[_0x1112('0x1b')](_0x14f9b6)[_0x1112('0x29')](_0x151074);};}exports[_0x1112('0x2a')]=function(_0x357bf4,_0x4ec3d2){var _0x17d6da={},_0x53d585={},_0x2eb8ea={'count':0x0,'rows':[]};var _0x1b79a4=_[_0x1112('0x2b')](db[_0x1112('0x2c')][_0x1112('0x2d')],function(_0x4c44ae){return{'name':_0x4c44ae[_0x1112('0x2e')],'type':_0x4c44ae[_0x1112('0x2f')]['key']};});_0x53d585[_0x1112('0x30')]=_[_0x1112('0x2b')](_0x1b79a4,_0x1112('0x31'));_0x53d585[_0x1112('0x32')]=_[_0x1112('0x33')](_0x357bf4['query']);_0x53d585[_0x1112('0x34')]=_[_0x1112('0x35')](_0x53d585[_0x1112('0x30')],_0x53d585[_0x1112('0x32')]);_0x17d6da[_0x1112('0x36')]=_[_0x1112('0x35')](_0x53d585['model'],qs['fields'](_0x357bf4[_0x1112('0x32')][_0x1112('0x37')]));_0x17d6da['attributes']=_0x17d6da[_0x1112('0x36')][_0x1112('0x38')]?_0x17d6da[_0x1112('0x36')]:_0x53d585[_0x1112('0x30')];if(!_0x357bf4[_0x1112('0x32')][_0x1112('0x39')](_0x1112('0x3a'))){_0x17d6da[_0x1112('0x20')]=qs['limit'](_0x357bf4[_0x1112('0x32')][_0x1112('0x20')]);_0x17d6da[_0x1112('0x1e')]=qs['offset'](_0x357bf4[_0x1112('0x32')]['offset']);}_0x17d6da[_0x1112('0x3b')]=qs[_0x1112('0x3c')](_0x357bf4[_0x1112('0x32')][_0x1112('0x3c')]);_0x17d6da[_0x1112('0x3d')]=qs[_0x1112('0x34')](_[_0x1112('0x3e')](_0x357bf4[_0x1112('0x32')],_0x53d585[_0x1112('0x34')]),_0x1b79a4);if(_0x357bf4[_0x1112('0x32')][_0x1112('0x3f')]){_0x17d6da[_0x1112('0x3d')]=_[_0x1112('0x40')](_0x17d6da['where'],{'$or':_['map'](_0x1b79a4,function(_0x88fd63){if(_0x88fd63[_0x1112('0x2f')]!=='VIRTUAL'){var _0x4f6874={};_0x4f6874[_0x88fd63[_0x1112('0x31')]]={'$like':'%'+_0x357bf4[_0x1112('0x32')]['filter']+'%'};return _0x4f6874;}})});}_0x17d6da=_[_0x1112('0x40')]({},_0x17d6da,_0x357bf4[_0x1112('0x41')]);var _0x326305={'where':_0x17d6da[_0x1112('0x3d')]};return db[_0x1112('0x2c')][_0x1112('0x21')](_0x326305)[_0x1112('0x26')](function(_0xb7b67){_0x2eb8ea[_0x1112('0x21')]=_0xb7b67;if(_0x357bf4[_0x1112('0x32')][_0x1112('0x42')]){_0x17d6da[_0x1112('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x17d6da);})[_0x1112('0x26')](function(_0x53cea0){_0x2eb8ea['rows']=_0x53cea0;return _0x2eb8ea;})[_0x1112('0x26')](respondWithFilteredResult(_0x4ec3d2,_0x17d6da))[_0x1112('0x44')](handleError(_0x4ec3d2,null));};exports[_0x1112('0x45')]=function(_0x5b61ae,_0x26656e){var _0x26f275={'raw':![],'where':{'id':_0x5b61ae[_0x1112('0x46')]['id']}},_0x1d348c={};_0x1d348c[_0x1112('0x30')]=_[_0x1112('0x33')](db['FreshsalesAccount']['rawAttributes']);_0x1d348c[_0x1112('0x32')]=_[_0x1112('0x33')](_0x5b61ae[_0x1112('0x32')]);_0x1d348c[_0x1112('0x34')]=_[_0x1112('0x35')](_0x1d348c[_0x1112('0x30')],_0x1d348c['query']);_0x26f275[_0x1112('0x36')]=_[_0x1112('0x35')](_0x1d348c[_0x1112('0x30')],qs[_0x1112('0x37')](_0x5b61ae[_0x1112('0x32')][_0x1112('0x37')]));_0x26f275['attributes']=_0x26f275['attributes'][_0x1112('0x38')]?_0x26f275[_0x1112('0x36')]:_0x1d348c[_0x1112('0x30')];if(_0x5b61ae['query'][_0x1112('0x42')]){_0x26f275[_0x1112('0x43')]=[{'all':!![]}];}_0x26f275=_[_0x1112('0x40')]({},_0x26f275,_0x5b61ae['options']);return db[_0x1112('0x2c')][_0x1112('0x47')](_0x26f275)[_0x1112('0x26')](handleEntityNotFound(_0x26656e,null))[_0x1112('0x26')](respondWithResult(_0x26656e,null))[_0x1112('0x44')](handleError(_0x26656e,null));};exports[_0x1112('0x48')]=function(_0x3f7e11,_0x11ec9d){return db['FreshsalesAccount']['create'](_0x3f7e11[_0x1112('0x49')],{})['then'](respondWithResult(_0x11ec9d,0xc9))['catch'](handleError(_0x11ec9d,null));};exports[_0x1112('0x25')]=function(_0x5ea473,_0x44b185){if(_0x5ea473[_0x1112('0x49')]['id']){delete _0x5ea473[_0x1112('0x49')]['id'];}return db[_0x1112('0x2c')][_0x1112('0x47')]({'where':{'id':_0x5ea473[_0x1112('0x46')]['id']}})[_0x1112('0x26')](handleEntityNotFound(_0x44b185,null))[_0x1112('0x26')](saveUpdates(_0x5ea473[_0x1112('0x49')],null))[_0x1112('0x26')](respondWithResult(_0x44b185,null))[_0x1112('0x44')](handleError(_0x44b185,null));};exports['destroy']=function(_0x59b7ed,_0x403e27){return db[_0x1112('0x2c')]['find']({'where':{'id':_0x59b7ed[_0x1112('0x46')]['id']}})[_0x1112('0x26')](handleEntityNotFound(_0x403e27,null))['then'](removeEntity(_0x403e27,null))[_0x1112('0x44')](handleError(_0x403e27,null));};exports[_0x1112('0x4a')]=function(_0x356fd0,_0x2f9389,_0x318742){var _0x585a27={};var _0x3fce22={};var _0x23da23;var _0x1273c9;return db[_0x1112('0x2c')][_0x1112('0x4b')]({'where':{'id':_0x356fd0[_0x1112('0x46')]['id']}})[_0x1112('0x26')](handleEntityNotFound(_0x2f9389,null))[_0x1112('0x26')](function(_0x55cc7b){if(_0x55cc7b){_0x23da23=_0x55cc7b;_0x3fce22[_0x1112('0x30')]=_[_0x1112('0x33')](db['FreshsalesConfiguration'][_0x1112('0x2d')]);_0x3fce22[_0x1112('0x32')]=_[_0x1112('0x33')](_0x356fd0[_0x1112('0x32')]);_0x3fce22['filters']=_[_0x1112('0x35')](_0x3fce22[_0x1112('0x30')],_0x3fce22[_0x1112('0x32')]);_0x585a27[_0x1112('0x36')]=_[_0x1112('0x35')](_0x3fce22['model'],qs[_0x1112('0x37')](_0x356fd0[_0x1112('0x32')][_0x1112('0x37')]));_0x585a27['attributes']=_0x585a27['attributes']['length']?_0x585a27[_0x1112('0x36')]:_0x3fce22[_0x1112('0x30')];_0x585a27[_0x1112('0x3b')]=qs[_0x1112('0x3c')](_0x356fd0[_0x1112('0x32')]['sort']);_0x585a27[_0x1112('0x3d')]=qs[_0x1112('0x34')](_[_0x1112('0x3e')](_0x356fd0[_0x1112('0x32')],_0x3fce22[_0x1112('0x34')]));if(_0x356fd0['query'][_0x1112('0x3f')]){_0x585a27[_0x1112('0x3d')]=_['merge'](_0x585a27[_0x1112('0x3d')],{'$or':_[_0x1112('0x2b')](_0x585a27['attributes'],function(_0x422249){var _0x2a2bff={};_0x2a2bff[_0x422249]={'$like':'%'+_0x356fd0[_0x1112('0x32')][_0x1112('0x3f')]+'%'};return _0x2a2bff;})});}_0x585a27=_[_0x1112('0x40')]({},_0x585a27,_0x356fd0['options']);return _0x23da23[_0x1112('0x4a')](_0x585a27);}})[_0x1112('0x26')](function(_0x1f901b){if(_0x1f901b){_0x1273c9=_0x1f901b[_0x1112('0x38')];if(!_0x356fd0[_0x1112('0x32')][_0x1112('0x39')](_0x1112('0x3a'))){_0x585a27[_0x1112('0x20')]=qs[_0x1112('0x20')](_0x356fd0[_0x1112('0x32')]['limit']);_0x585a27[_0x1112('0x1e')]=qs[_0x1112('0x1e')](_0x356fd0['query'][_0x1112('0x1e')]);}return _0x23da23[_0x1112('0x4a')](_0x585a27);}})[_0x1112('0x26')](function(_0x26666f){if(_0x26666f){return _0x26666f?{'count':_0x1273c9,'rows':_0x26666f}:null;}})[_0x1112('0x26')](respondWithResult(_0x2f9389,null))['catch'](handleError(_0x2f9389,null));};exports[_0x1112('0x4c')]=function(_0xd1f838,_0x20f7d9,_0x2b6d8e){if(_0xd1f838[_0x1112('0x49')]['id']){delete _0xd1f838['body']['id'];}return db[_0x1112('0x2c')][_0x1112('0x4b')]({'where':{'id':_0xd1f838[_0x1112('0x46')]['id']}})[_0x1112('0x26')](handleEntityNotFound(_0x20f7d9,null))[_0x1112('0x26')](function(_0x4e71be){if(_0x4e71be){_0xd1f838[_0x1112('0x49')][_0x1112('0x4d')]=_0x4e71be['id'];_0xd1f838[_0x1112('0x49')][_0x1112('0x4e')]=integrations[_0x1112('0x4f')](_0xd1f838[_0x1112('0x49')][_0x1112('0x50')],_0xd1f838['body'][_0x1112('0x2f')]);_0xd1f838[_0x1112('0x49')][_0x1112('0x51')]=integrations[_0x1112('0x52')](_0xd1f838['body'][_0x1112('0x50')],_0xd1f838[_0x1112('0x49')][_0x1112('0x2f')]);return db[_0x1112('0x53')][_0x1112('0x48')](_0xd1f838['body'],{'include':[{'model':db[_0x1112('0x54')],'as':_0x1112('0x4e')},{'model':db[_0x1112('0x54')],'as':_0x1112('0x51')}]});}return null;})[_0x1112('0x26')](respondWithResult(_0x20f7d9,null))['catch'](handleError(_0x20f7d9,null));};exports['getFields']=function(_0x2f6c46,_0xb5bde7,_0x179bf1){var _0x56466a='';var _0x230578='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x2f6c46[_0x1112('0x46')]['id']},'attributes':['id',_0x1112('0x55'),_0x1112('0x56'),_0x1112('0x57')]})['then'](handleEntityNotFound(_0xb5bde7,null))[_0x1112('0x26')](function(_0x1626ec){if(_0x1626ec){_0x230578=_0x1626ec[_0x1112('0x55')];_0x56466a=_0x1626ec[_0x1112('0x56')];var _0x509afe=_0x1626ec['remoteUri']['slice'](-0x1);if(_0x509afe==='/'){_0x56466a=_0x56466a['substring'](0x0,_0x56466a[_0x1112('0x58')](_0x509afe));}return rp({'method':_0x1112('0x59'),'uri':util[_0x1112('0x5a')](_0x1112('0x5b'),_0x56466a,_0x1112('0x5c')),'headers':{'Authorization':_0x1112('0x5d')+_0x1626ec[_0x1112('0x57')]},'json':!![]});}})[_0x1112('0x26')](function(_0x3a7531){if(_0x3a7531){var _0x1218ab=_0x3a7531[_0x1112('0x5e')];var _0x4cd470=![];var _0x1afe2c=null;for(_0x1afe2c=0x0;_0x1afe2c<_0x1218ab['length'];_0x1afe2c++){if(_0x1218ab[_0x1afe2c][_0x1112('0x5f')]===_0x230578){_0x4cd470=!![];}}if(_0x4cd470){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1112('0x60')});}}})[_0x1112('0x26')](respondWithResult(_0xb5bde7,null))[_0x1112('0x44')](function(_0x3337c1){var _0x162492=_0x2f6c46['query'][_0x1112('0x61')]?0x1f4:_0x3337c1['statusCode']||0x1f4;logger[_0x1112('0x28')](_0x1112('0x62'),_0x1112('0x63'),_0x162492,JSON[_0x1112('0x64')](_0x3337c1));delete _0x3337c1['name'];if(_0x162492===0x191){_0x162492=0x190;}_0xb5bde7[_0x1112('0x1b')](_0x162492)['send'](_0x2f6c46[_0x1112('0x32')][_0x1112('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0x3337c1[_0x1112('0x65')]}:_0x3337c1);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index a066897..c48e2ee 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 _0xba34=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x59c292,_0x24b0fb){var _0x4afd03=function(_0x4fcb7c){while(--_0x4fcb7c){_0x59c292['push'](_0x59c292['shift']());}};_0x4afd03(++_0x24b0fb);}(_0xba34,0x119));var _0x4ba3=function(_0x14adf5,_0x10bedb){_0x14adf5=_0x14adf5-0x0;var _0x48232c=_0xba34[_0x14adf5];return _0x48232c;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2da6=['int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount'];(function(_0x3ed5c8,_0x5515d9){var _0x58fb50=function(_0x204ef2){while(--_0x204ef2){_0x3ed5c8['push'](_0x3ed5c8['shift']());}};_0x58fb50(++_0x5515d9);}(_0x2da6,0x1dd));var _0x62da=function(_0x5ee4a4,_0x218579){_0x5ee4a4=_0x5ee4a4-0x0;var _0x11b351=_0x2da6[_0x5ee4a4];return _0x11b351;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var logger=require(_0x62da('0x2'))(_0x62da('0x3'));var moment=require(_0x62da('0x4'));var BPromise=require(_0x62da('0x5'));var rp=require(_0x62da('0x6'));var fs=require('fs');var path=require(_0x62da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62da('0x8'));var integrations=require(_0x62da('0x9'));module[_0x62da('0xa')]=function(_0x30437f,_0x100e73){return _0x30437f[_0x62da('0xb')](_0x62da('0xc'),attributes,{'tableName':_0x62da('0xd'),'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 b06ee60..d02eadf 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 _0xffd6=['options','raw','limit','include','model','attributes','ShowFreshsalesAccount','FreshsalesAccount','find','where','map','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFreshsalesAccount','findAll'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0xffd6,0x97));var _0x6ffd=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xffd6[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});}exports[_0x6ffd('0x16')]=function(_0x889a4b){var _0x545576=this;return new Promise(function(_0x11a609,_0x56c541){return db['FreshsalesAccount'][_0x6ffd('0x17')]({'raw':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b['options'][_0x6ffd('0x19')]===undefined?!![]:![]:!![],'where':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b['options']['where']||null:null,'attributes':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b[_0x6ffd('0x18')]['attributes']||null:null,'limit':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b[_0x6ffd('0x18')][_0x6ffd('0x1a')]||null:null,'include':_0x889a4b['options']?_0x889a4b[_0x6ffd('0x18')][_0x6ffd('0x1b')]?_['map'](_0x889a4b[_0x6ffd('0x18')][_0x6ffd('0x1b')],function(_0x50c19a){return{'model':db[_0x50c19a[_0x6ffd('0x1c')]],'as':_0x50c19a['as'],'attributes':_0x50c19a[_0x6ffd('0x1d')],'include':_0x50c19a[_0x6ffd('0x1b')]?_['map'](_0x50c19a[_0x6ffd('0x1b')],function(_0x3e5726){return{'model':db[_0x3e5726[_0x6ffd('0x1c')]],'as':_0x3e5726['as'],'attributes':_0x3e5726['attributes'],'include':_0x3e5726[_0x6ffd('0x1b')]?_['map'](_0x3e5726[_0x6ffd('0x1b')],function(_0x43269c){return{'model':db[_0x43269c['model']],'as':_0x43269c['as'],'attributes':_0x43269c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ffd('0xa')](function(_0x2a0391){logger[_0x6ffd('0x13')]('GetFreshsalesAccount',_0x889a4b);logger['debug'](_0x6ffd('0x16'),_0x889a4b,JSON['stringify'](_0x2a0391));_0x11a609(_0x2a0391);})[_0x6ffd('0x15')](function(_0x20c007){logger['error'](_0x6ffd('0x16'),_0x20c007[_0x6ffd('0x12')],_0x889a4b);_0x56c541(_0x545576[_0x6ffd('0x10')](0x1f4,_0x20c007[_0x6ffd('0x12')]));});});};exports[_0x6ffd('0x1e')]=function(_0x31c609){var _0x225c66=this;return new Promise(function(_0xccb8c,_0x17f627){return db[_0x6ffd('0x1f')][_0x6ffd('0x20')]({'raw':_0x31c609[_0x6ffd('0x18')]?_0x31c609[_0x6ffd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x31c609['options']?_0x31c609['options'][_0x6ffd('0x21')]||null:null,'attributes':_0x31c609[_0x6ffd('0x18')]?_0x31c609[_0x6ffd('0x18')][_0x6ffd('0x1d')]||null:null,'include':_0x31c609[_0x6ffd('0x18')]?_0x31c609[_0x6ffd('0x18')][_0x6ffd('0x1b')]?_[_0x6ffd('0x22')](_0x31c609[_0x6ffd('0x18')][_0x6ffd('0x1b')],function(_0x26394c){return{'model':db[_0x26394c[_0x6ffd('0x1c')]],'as':_0x26394c['as'],'attributes':_0x26394c[_0x6ffd('0x1d')],'include':_0x26394c['include']?_[_0x6ffd('0x22')](_0x26394c[_0x6ffd('0x1b')],function(_0x2efc20){return{'model':db[_0x2efc20[_0x6ffd('0x1c')]],'as':_0x2efc20['as'],'attributes':_0x2efc20['attributes'],'include':_0x2efc20[_0x6ffd('0x1b')]?_['map'](_0x2efc20['include'],function(_0x617d52){return{'model':db[_0x617d52[_0x6ffd('0x1c')]],'as':_0x617d52['as'],'attributes':_0x617d52[_0x6ffd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6ffd('0xa')](function(_0x55e9b4){logger[_0x6ffd('0x13')]('ShowFreshsalesAccount',_0x31c609);logger[_0x6ffd('0xd')](_0x6ffd('0x1e'),_0x31c609,JSON[_0x6ffd('0xf')](_0x55e9b4));_0xccb8c(_0x55e9b4);})[_0x6ffd('0x15')](function(_0x23fae4){logger['error']('ShowFreshsalesAccount',_0x23fae4[_0x6ffd('0x12')],_0x31c609);_0x17f627(_0x225c66['error'](0x1f4,_0x23fae4[_0x6ffd('0x12')]));});});}; \ No newline at end of file +var _0xa46e=['model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','result','catch','FreshsalesAccount','findAll','options','raw','include','map'];(function(_0x26f77f,_0x1cd2f6){var _0x55d526=function(_0x11cc02){while(--_0x11cc02){_0x26f77f['push'](_0x26f77f['shift']());}};_0x55d526(++_0x1cd2f6);}(_0xa46e,0x8a));var _0xea46=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0xa46e[_0x5dfc2a];return _0x3f1a71;};'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']('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('FreshsalesAccount,\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')]('FreshsalesAccount,\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')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}exports['GetFreshsalesAccount']=function(_0x19d5c1){var _0x3f463d=this;return new Promise(function(_0x5cf5dd,_0x4b6745){return db[_0xea46('0x15')][_0xea46('0x16')]({'raw':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1[_0xea46('0x17')]['where']||null:null,'attributes':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['attributes']||null:null,'limit':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['limit']||null:null,'include':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x19d5c1['options'][_0xea46('0x19')],function(_0x59b10d){return{'model':db[_0x59b10d[_0xea46('0x1b')]],'as':_0x59b10d['as'],'attributes':_0x59b10d[_0xea46('0x1c')],'include':_0x59b10d['include']?_[_0xea46('0x1a')](_0x59b10d['include'],function(_0x2b3a8f){return{'model':db[_0x2b3a8f[_0xea46('0x1b')]],'as':_0x2b3a8f['as'],'attributes':_0x2b3a8f[_0xea46('0x1c')],'include':_0x2b3a8f['include']?_['map'](_0x2b3a8f[_0xea46('0x19')],function(_0x38ac07){return{'model':db[_0x38ac07['model']],'as':_0x38ac07['as'],'attributes':_0x38ac07[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11129d){logger['info'](_0xea46('0x1d'),_0x19d5c1);logger[_0xea46('0xc')](_0xea46('0x1d'),_0x19d5c1,JSON[_0xea46('0xd')](_0x11129d));_0x5cf5dd(_0x11129d);})[_0xea46('0x14')](function(_0x174345){logger['error'](_0xea46('0x1d'),_0x174345[_0xea46('0x10')],_0x19d5c1);_0x4b6745(_0x3f463d[_0xea46('0xe')](0x1f4,_0x174345['message']));});});};exports[_0xea46('0x1e')]=function(_0x3cdf96){var _0x38d631=this;return new Promise(function(_0x5a0fc0,_0x4a0635){return db['FreshsalesAccount'][_0xea46('0x1f')]({'raw':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x20')]||null:null,'attributes':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x1c')]||null:null,'include':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96['options'][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x3cdf96[_0xea46('0x17')][_0xea46('0x19')],function(_0x1472c0){return{'model':db[_0x1472c0[_0xea46('0x1b')]],'as':_0x1472c0['as'],'attributes':_0x1472c0[_0xea46('0x1c')],'include':_0x1472c0['include']?_[_0xea46('0x1a')](_0x1472c0[_0xea46('0x19')],function(_0x388449){return{'model':db[_0x388449[_0xea46('0x1b')]],'as':_0x388449['as'],'attributes':_0x388449[_0xea46('0x1c')],'include':_0x388449['include']?_['map'](_0x388449[_0xea46('0x19')],function(_0x343499){return{'model':db[_0x343499['model']],'as':_0x343499['as'],'attributes':_0x343499[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea46('0xa')](function(_0x123aae){logger[_0xea46('0x12')]('ShowFreshsalesAccount',_0x3cdf96);logger['debug'](_0xea46('0x1e'),_0x3cdf96,JSON['stringify'](_0x123aae));_0x5a0fc0(_0x123aae);})[_0xea46('0x14')](function(_0xdec374){logger['error'](_0xea46('0x1e'),_0xdec374[_0xea46('0x10')],_0x3cdf96);_0x4a0635(_0x38d631['error'](0x1f4,_0xdec374[_0xea46('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 40d1689..c45b640 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 _0xaffc=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','/:id/descriptions','/:id/fields','getFields','post'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xaffc,0x1e1));var _0xcaff=function(_0x237c56,_0x574684){_0x237c56=_0x237c56-0x0;var _0x3881b1=_0xaffc[_0x237c56];return _0x3881b1;};'use strict';var multer=require(_0xcaff('0x0'));var util=require(_0xcaff('0x1'));var path=require(_0xcaff('0x2'));var timeout=require(_0xcaff('0x3'));var express=require(_0xcaff('0x4'));var router=express[_0xcaff('0x5')]();var fs_extra=require(_0xcaff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcaff('0x7'));var config=require(_0xcaff('0x8'));var controller=require(_0xcaff('0x9'));router[_0xcaff('0xa')]('/',auth[_0xcaff('0xb')](),controller[_0xcaff('0xc')]);router[_0xcaff('0xa')]('/:id',auth[_0xcaff('0xb')](),controller[_0xcaff('0xd')]);router[_0xcaff('0xa')](_0xcaff('0xe'),auth[_0xcaff('0xb')](),controller['getSubjects']);router[_0xcaff('0xa')](_0xcaff('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0xcaff('0x10'),auth['isAuthenticated'](),controller[_0xcaff('0x11')]);router[_0xcaff('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcaff('0x13')](_0xcaff('0x14'),auth[_0xcaff('0xb')](),controller[_0xcaff('0x15')]);router[_0xcaff('0x16')](_0xcaff('0x14'),auth[_0xcaff('0xb')](),controller[_0xcaff('0x17')]);module[_0xcaff('0x18')]=router; \ No newline at end of file +var _0x2da7=['isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','/:id/fields','getFields','post','create','update','delete','exports','util','path','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0xe4348c,_0x1f6f84){var _0x498a2f=function(_0x47db99){while(--_0x47db99){_0xe4348c['push'](_0xe4348c['shift']());}};_0x498a2f(++_0x1f6f84);}(_0x2da7,0x175));var _0x72da=function(_0x2edd6e,_0x5c7605){_0x2edd6e=_0x2edd6e-0x0;var _0x7b801=_0x2da7[_0x2edd6e];return _0x7b801;};'use strict';var multer=require('multer');var util=require(_0x72da('0x0'));var path=require(_0x72da('0x1'));var timeout=require('connect-timeout');var express=require(_0x72da('0x2'));var router=express[_0x72da('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x72da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x72da('0x5'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x72da('0x6')]('/',auth[_0x72da('0x7')](),controller[_0x72da('0x8')]);router[_0x72da('0x6')](_0x72da('0x9'),auth['isAuthenticated'](),controller[_0x72da('0xa')]);router[_0x72da('0x6')](_0x72da('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x72da('0x6')](_0x72da('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x72da('0x6')](_0x72da('0xd'),auth[_0x72da('0x7')](),controller[_0x72da('0xe')]);router[_0x72da('0xf')]('/',auth[_0x72da('0x7')](),controller[_0x72da('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x72da('0x11')]);router[_0x72da('0x12')](_0x72da('0x9'),auth[_0x72da('0x7')](),controller['destroy']);module[_0x72da('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 79f49e1..ed3e277 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 _0x4ae6=['STRING'];(function(_0x194549,_0x2d6481){var _0x307b7d=function(_0x5f396d){while(--_0x5f396d){_0x194549['push'](_0x194549['shift']());}};_0x307b7d(++_0x2d6481);}(_0x4ae6,0x1b3));var _0x64ae=function(_0x5626b2,_0x2f7016){_0x5626b2=_0x5626b2-0x0;var _0x4f2262=_0x4ae6[_0x5626b2];return _0x4f2262;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x64ae('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd05c=['STRING','exports'];(function(_0x17a322,_0x46022f){var _0x31c926=function(_0x3f6a2b){while(--_0x3f6a2b){_0x17a322['push'](_0x17a322['shift']());}};_0x31c926(++_0x46022f);}(_0xd05c,0x105));var _0xcd05=function(_0x576599,_0x233d1f){_0x576599=_0x576599-0x0;var _0x126640=_0xd05c[_0x576599];return _0x126640;};'use strict';var Sequelize=require('sequelize');module[_0xcd05('0x0')]={'name':{'type':Sequelize[_0xcd05('0x1')]},'description':{'type':Sequelize[_0xcd05('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 3cec0e9..d627183 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 _0x402d=['getSubjects','FreshsalesField','getDescriptions','findOne','order','getFields','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params'];(function(_0x3df749,_0x44b1d5){var _0x28608b=function(_0x1aa476){while(--_0x1aa476){_0x3df749['push'](_0x3df749['shift']());}};_0x28608b(++_0x44b1d5);}(_0x402d,0x1d4));var _0xd402=function(_0xf2e71c,_0x265309){_0xf2e71c=_0xf2e71c-0x0;var _0xf0f8cc=_0x402d[_0xf2e71c];return _0xf0f8cc;};'use strict';var emlformat=require(_0xd402('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd402('0x1'));var jsonpatch=require(_0xd402('0x2'));var rp=require(_0xd402('0x3'));var moment=require('moment');var BPromise=require(_0xd402('0x4'));var Mustache=require(_0xd402('0x5'));var util=require(_0xd402('0x6'));var path=require(_0xd402('0x7'));var sox=require(_0xd402('0x8'));var csv=require(_0xd402('0x9'));var ejs=require(_0xd402('0xa'));var fs=require('fs');var fs_extra=require(_0xd402('0xb'));var _=require(_0xd402('0xc'));var squel=require('squel');var crypto=require(_0xd402('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd402('0xe'));var toCsv=require(_0xd402('0x9'));var querystring=require('querystring');var Papa=require(_0xd402('0xf'));var Redis=require(_0xd402('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd402('0x11'));var hardwareService=require(_0xd402('0x12'));var logger=require('../../config/logger')(_0xd402('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd402('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28f448,_0x56efef){_0x56efef=_0x56efef||0xcc;return function(_0x4c66de){if(_0x4c66de){return _0x28f448['sendStatus'](_0x56efef);}return _0x28f448[_0xd402('0x15')](_0x56efef)[_0xd402('0x16')]();};}function respondWithResult(_0x2c3a80,_0x5cacae){_0x5cacae=_0x5cacae||0xc8;return function(_0x5dccdd){if(_0x5dccdd){return _0x2c3a80['status'](_0x5cacae)[_0xd402('0x17')](_0x5dccdd);}};}function respondWithFilteredResult(_0xd5ee4,_0x582953){return function(_0x4bd7e0){if(_0x4bd7e0){var _0x5edd06=typeof _0x582953[_0xd402('0x18')]==='undefined'&&typeof _0x582953[_0xd402('0x19')]==='undefined';var _0x41fe52=_0x4bd7e0[_0xd402('0x1a')];var _0x7d78f5=_0x5edd06?0x0:_0x582953['offset'];var _0x1710ed=_0x5edd06?_0x4bd7e0[_0xd402('0x1a')]:_0x582953[_0xd402('0x18')]+_0x582953['limit'];var _0x5c1eb6;if(_0x1710ed>=_0x41fe52){_0x1710ed=_0x41fe52;_0x5c1eb6=0xc8;}else{_0x5c1eb6=0xce;}_0xd5ee4[_0xd402('0x15')](_0x5c1eb6);return _0xd5ee4[_0xd402('0x1b')]('Content-Range',_0x7d78f5+'-'+_0x1710ed+'/'+_0x41fe52)[_0xd402('0x17')](_0x4bd7e0);}return null;};}function patchUpdates(_0x23cb31){return function(_0x37d263){try{jsonpatch[_0xd402('0x1c')](_0x37d263,_0x23cb31,!![]);}catch(_0x1d21e7){return BPromise[_0xd402('0x1d')](_0x1d21e7);}return _0x37d263[_0xd402('0x1e')]();};}function saveUpdates(_0x3b76b7,_0x1bcf2e){return function(_0x6762b6){if(_0x6762b6){return _0x6762b6[_0xd402('0x1f')](_0x3b76b7)[_0xd402('0x20')](function(_0x6afce8){return _0x6afce8;});}return null;};}function removeEntity(_0x59a4e4,_0x1374b7){return function(_0x32ef08){if(_0x32ef08){return _0x32ef08[_0xd402('0x21')]()[_0xd402('0x20')](function(){_0x59a4e4[_0xd402('0x15')](0xcc)[_0xd402('0x16')]();});}};}function handleEntityNotFound(_0x25ae3d,_0x3e6dd8){return function(_0x44436f){if(!_0x44436f){_0x25ae3d[_0xd402('0x22')](0x194);}return _0x44436f;};}function handleError(_0x2ec2f0,_0x5d9e25){_0x5d9e25=_0x5d9e25||0x1f4;return function(_0x27cf4a){logger['error'](_0x27cf4a[_0xd402('0x23')]);if(_0x27cf4a['name']){delete _0x27cf4a[_0xd402('0x24')];}_0x2ec2f0['status'](_0x5d9e25)[_0xd402('0x25')](_0x27cf4a);};}exports['index']=function(_0x33b997,_0x688ad5){var _0x4761aa={},_0x52e50d={},_0x481390={'count':0x0,'rows':[]};var _0x177cc6=_[_0xd402('0x26')](db[_0xd402('0x27')][_0xd402('0x28')],function(_0xb36500){return{'name':_0xb36500[_0xd402('0x29')],'type':_0xb36500[_0xd402('0x2a')][_0xd402('0x2b')]};});_0x52e50d[_0xd402('0x2c')]=_['map'](_0x177cc6,'name');_0x52e50d[_0xd402('0x2d')]=_[_0xd402('0x2e')](_0x33b997['query']);_0x52e50d[_0xd402('0x2f')]=_[_0xd402('0x30')](_0x52e50d['model'],_0x52e50d[_0xd402('0x2d')]);_0x4761aa['attributes']=_[_0xd402('0x30')](_0x52e50d['model'],qs['fields'](_0x33b997['query'][_0xd402('0x31')]));_0x4761aa['attributes']=_0x4761aa['attributes'][_0xd402('0x32')]?_0x4761aa[_0xd402('0x33')]:_0x52e50d[_0xd402('0x2c')];if(!_0x33b997[_0xd402('0x2d')][_0xd402('0x34')](_0xd402('0x35'))){_0x4761aa[_0xd402('0x19')]=qs['limit'](_0x33b997[_0xd402('0x2d')][_0xd402('0x19')]);_0x4761aa[_0xd402('0x18')]=qs[_0xd402('0x18')](_0x33b997[_0xd402('0x2d')]['offset']);}_0x4761aa['order']=qs[_0xd402('0x36')](_0x33b997[_0xd402('0x2d')][_0xd402('0x36')]);_0x4761aa[_0xd402('0x37')]=qs[_0xd402('0x2f')](_[_0xd402('0x38')](_0x33b997[_0xd402('0x2d')],_0x52e50d[_0xd402('0x2f')]),_0x177cc6);if(_0x33b997['query']['filter']){_0x4761aa[_0xd402('0x37')]=_['merge'](_0x4761aa[_0xd402('0x37')],{'$or':_[_0xd402('0x26')](_0x177cc6,function(_0x52f78a){if(_0x52f78a[_0xd402('0x2a')]!==_0xd402('0x39')){var _0x19e570={};_0x19e570[_0x52f78a['name']]={'$like':'%'+_0x33b997[_0xd402('0x2d')][_0xd402('0x3a')]+'%'};return _0x19e570;}})});}_0x4761aa=_[_0xd402('0x3b')]({},_0x4761aa,_0x33b997[_0xd402('0x3c')]);var _0x30ca77={'where':_0x4761aa[_0xd402('0x37')]};return db[_0xd402('0x27')]['count'](_0x30ca77)[_0xd402('0x20')](function(_0xf265fc){_0x481390[_0xd402('0x1a')]=_0xf265fc;if(_0x33b997['query'][_0xd402('0x3d')]){_0x4761aa[_0xd402('0x3e')]=[{'all':!![]}];}return db[_0xd402('0x27')][_0xd402('0x3f')](_0x4761aa);})[_0xd402('0x20')](function(_0x548b81){_0x481390[_0xd402('0x40')]=_0x548b81;return _0x481390;})[_0xd402('0x20')](respondWithFilteredResult(_0x688ad5,_0x4761aa))[_0xd402('0x41')](handleError(_0x688ad5,null));};exports[_0xd402('0x42')]=function(_0x4e69e1,_0x243aa5){var _0x35f6dc={'raw':![],'where':{'id':_0x4e69e1['params']['id']}},_0x27941a={};_0x27941a[_0xd402('0x2c')]=_['keys'](db[_0xd402('0x27')][_0xd402('0x28')]);_0x27941a[_0xd402('0x2d')]=_[_0xd402('0x2e')](_0x4e69e1[_0xd402('0x2d')]);_0x27941a[_0xd402('0x2f')]=_[_0xd402('0x30')](_0x27941a['model'],_0x27941a[_0xd402('0x2d')]);_0x35f6dc[_0xd402('0x33')]=_[_0xd402('0x30')](_0x27941a[_0xd402('0x2c')],qs['fields'](_0x4e69e1['query']['fields']));_0x35f6dc['attributes']=_0x35f6dc[_0xd402('0x33')]['length']?_0x35f6dc['attributes']:_0x27941a['model'];if(_0x4e69e1[_0xd402('0x2d')][_0xd402('0x3d')]){_0x35f6dc[_0xd402('0x3e')]=[{'all':!![]}];}_0x35f6dc=_[_0xd402('0x3b')]({},_0x35f6dc,_0x4e69e1[_0xd402('0x3c')]);return db['FreshsalesConfiguration'][_0xd402('0x43')](_0x35f6dc)[_0xd402('0x20')](handleEntityNotFound(_0x243aa5,null))[_0xd402('0x20')](respondWithResult(_0x243aa5,null))[_0xd402('0x41')](handleError(_0x243aa5,null));};exports[_0xd402('0x44')]=function(_0x11d240,_0x41ed39){return db[_0xd402('0x27')]['create'](_0x11d240[_0xd402('0x45')],{})[_0xd402('0x20')](respondWithResult(_0x41ed39,0xc9))['catch'](handleError(_0x41ed39,null));};exports[_0xd402('0x1f')]=function(_0x18117a,_0x215543){if(_0x18117a['body']['id']){delete _0x18117a[_0xd402('0x45')]['id'];}return db[_0xd402('0x27')][_0xd402('0x43')]({'where':{'id':_0x18117a[_0xd402('0x46')]['id']}})[_0xd402('0x20')](handleEntityNotFound(_0x215543,null))[_0xd402('0x20')](saveUpdates(_0x18117a[_0xd402('0x45')],null))[_0xd402('0x20')](respondWithResult(_0x215543,null))[_0xd402('0x41')](handleError(_0x215543,null));};exports[_0xd402('0x21')]=function(_0x4c695c,_0x3180e8){return db['FreshsalesConfiguration'][_0xd402('0x43')]({'where':{'id':_0x4c695c[_0xd402('0x46')]['id']}})['then'](handleEntityNotFound(_0x3180e8,null))['then'](removeEntity(_0x3180e8,null))[_0xd402('0x41')](handleError(_0x3180e8,null));};exports[_0xd402('0x47')]=function(_0x531782,_0x243466,_0x2a3728){var _0x382f55={};var _0x32475f={};var _0x3cac0f;var _0x5d68b9;return db[_0xd402('0x27')]['findOne']({'where':{'id':_0x531782[_0xd402('0x46')]['id']}})['then'](handleEntityNotFound(_0x243466,null))['then'](function(_0x50cdfb){if(_0x50cdfb){_0x3cac0f=_0x50cdfb;_0x32475f[_0xd402('0x2c')]=_[_0xd402('0x2e')](db[_0xd402('0x48')][_0xd402('0x28')]);_0x32475f['query']=_[_0xd402('0x2e')](_0x531782[_0xd402('0x2d')]);_0x32475f[_0xd402('0x2f')]=_[_0xd402('0x30')](_0x32475f[_0xd402('0x2c')],_0x32475f['query']);_0x382f55[_0xd402('0x33')]=_[_0xd402('0x30')](_0x32475f['model'],qs[_0xd402('0x31')](_0x531782[_0xd402('0x2d')][_0xd402('0x31')]));_0x382f55[_0xd402('0x33')]=_0x382f55[_0xd402('0x33')][_0xd402('0x32')]?_0x382f55['attributes']:_0x32475f[_0xd402('0x2c')];_0x382f55['order']=qs[_0xd402('0x36')](_0x531782['query'][_0xd402('0x36')]);_0x382f55[_0xd402('0x37')]=qs[_0xd402('0x2f')](_[_0xd402('0x38')](_0x531782[_0xd402('0x2d')],_0x32475f[_0xd402('0x2f')]));if(_0x531782['query']['filter']){_0x382f55['where']=_[_0xd402('0x3b')](_0x382f55[_0xd402('0x37')],{'$or':_['map'](_0x382f55['attributes'],function(_0x3b4536){var _0x5b5cfd={};_0x5b5cfd[_0x3b4536]={'$like':'%'+_0x531782[_0xd402('0x2d')][_0xd402('0x3a')]+'%'};return _0x5b5cfd;})});}_0x382f55=_['merge']({},_0x382f55,_0x531782[_0xd402('0x3c')]);return _0x3cac0f['getSubjects'](_0x382f55);}})[_0xd402('0x20')](function(_0x29e31d){if(_0x29e31d){_0x5d68b9=_0x29e31d[_0xd402('0x32')];if(!_0x531782[_0xd402('0x2d')][_0xd402('0x34')](_0xd402('0x35'))){_0x382f55['limit']=qs[_0xd402('0x19')](_0x531782[_0xd402('0x2d')][_0xd402('0x19')]);_0x382f55[_0xd402('0x18')]=qs['offset'](_0x531782['query']['offset']);}return _0x3cac0f[_0xd402('0x47')](_0x382f55);}})['then'](function(_0x119b08){if(_0x119b08){return _0x119b08?{'count':_0x5d68b9,'rows':_0x119b08}:null;}})[_0xd402('0x20')](respondWithResult(_0x243466,null))['catch'](handleError(_0x243466,null));};exports[_0xd402('0x49')]=function(_0x4c8c91,_0xfd213f,_0x5c660f){var _0x52ce9d={};var _0x1b5b9c={};var _0x1b131b;var _0x13a217;return db[_0xd402('0x27')][_0xd402('0x4a')]({'where':{'id':_0x4c8c91[_0xd402('0x46')]['id']}})[_0xd402('0x20')](handleEntityNotFound(_0xfd213f,null))[_0xd402('0x20')](function(_0x2ecbe4){if(_0x2ecbe4){_0x1b131b=_0x2ecbe4;_0x1b5b9c[_0xd402('0x2c')]=_['keys'](db[_0xd402('0x48')][_0xd402('0x28')]);_0x1b5b9c[_0xd402('0x2d')]=_[_0xd402('0x2e')](_0x4c8c91[_0xd402('0x2d')]);_0x1b5b9c['filters']=_[_0xd402('0x30')](_0x1b5b9c[_0xd402('0x2c')],_0x1b5b9c[_0xd402('0x2d')]);_0x52ce9d[_0xd402('0x33')]=_[_0xd402('0x30')](_0x1b5b9c[_0xd402('0x2c')],qs[_0xd402('0x31')](_0x4c8c91[_0xd402('0x2d')]['fields']));_0x52ce9d[_0xd402('0x33')]=_0x52ce9d[_0xd402('0x33')][_0xd402('0x32')]?_0x52ce9d[_0xd402('0x33')]:_0x1b5b9c[_0xd402('0x2c')];_0x52ce9d[_0xd402('0x4b')]=qs[_0xd402('0x36')](_0x4c8c91['query'][_0xd402('0x36')]);_0x52ce9d[_0xd402('0x37')]=qs[_0xd402('0x2f')](_[_0xd402('0x38')](_0x4c8c91[_0xd402('0x2d')],_0x1b5b9c['filters']));if(_0x4c8c91['query']['filter']){_0x52ce9d[_0xd402('0x37')]=_[_0xd402('0x3b')](_0x52ce9d[_0xd402('0x37')],{'$or':_[_0xd402('0x26')](_0x52ce9d['attributes'],function(_0xdc94d1){var _0x2ee92b={};_0x2ee92b[_0xdc94d1]={'$like':'%'+_0x4c8c91[_0xd402('0x2d')][_0xd402('0x3a')]+'%'};return _0x2ee92b;})});}_0x52ce9d=_[_0xd402('0x3b')]({},_0x52ce9d,_0x4c8c91[_0xd402('0x3c')]);return _0x1b131b[_0xd402('0x49')](_0x52ce9d);}})[_0xd402('0x20')](function(_0x4c64f8){if(_0x4c64f8){_0x13a217=_0x4c64f8[_0xd402('0x32')];if(!_0x4c8c91[_0xd402('0x2d')][_0xd402('0x34')](_0xd402('0x35'))){_0x52ce9d['limit']=qs['limit'](_0x4c8c91[_0xd402('0x2d')][_0xd402('0x19')]);_0x52ce9d[_0xd402('0x18')]=qs[_0xd402('0x18')](_0x4c8c91['query'][_0xd402('0x18')]);}return _0x1b131b[_0xd402('0x49')](_0x52ce9d);}})['then'](function(_0x87bcd1){if(_0x87bcd1){return _0x87bcd1?{'count':_0x13a217,'rows':_0x87bcd1}:null;}})[_0xd402('0x20')](respondWithResult(_0xfd213f,null))[_0xd402('0x41')](handleError(_0xfd213f,null));};exports[_0xd402('0x4c')]=function(_0x49ce5f,_0x29bf57,_0x1e168d){var _0x4ed8ee={};var _0x26dd67={};var _0x490130;var _0x580a91;return db[_0xd402('0x27')][_0xd402('0x4a')]({'where':{'id':_0x49ce5f[_0xd402('0x46')]['id']}})[_0xd402('0x20')](handleEntityNotFound(_0x29bf57,null))[_0xd402('0x20')](function(_0x10fde6){if(_0x10fde6){_0x490130=_0x10fde6;_0x26dd67[_0xd402('0x2c')]=_[_0xd402('0x2e')](db['FreshsalesField']['rawAttributes']);_0x26dd67[_0xd402('0x2d')]=_[_0xd402('0x2e')](_0x49ce5f[_0xd402('0x2d')]);_0x26dd67[_0xd402('0x2f')]=_[_0xd402('0x30')](_0x26dd67[_0xd402('0x2c')],_0x26dd67[_0xd402('0x2d')]);_0x4ed8ee[_0xd402('0x33')]=_[_0xd402('0x30')](_0x26dd67[_0xd402('0x2c')],qs[_0xd402('0x31')](_0x49ce5f[_0xd402('0x2d')][_0xd402('0x31')]));_0x4ed8ee[_0xd402('0x33')]=_0x4ed8ee[_0xd402('0x33')][_0xd402('0x32')]?_0x4ed8ee[_0xd402('0x33')]:_0x26dd67['model'];_0x4ed8ee[_0xd402('0x4b')]=qs[_0xd402('0x36')](_0x49ce5f[_0xd402('0x2d')][_0xd402('0x36')]);_0x4ed8ee['where']=qs['filters'](_[_0xd402('0x38')](_0x49ce5f[_0xd402('0x2d')],_0x26dd67[_0xd402('0x2f')]));if(_0x49ce5f[_0xd402('0x2d')][_0xd402('0x3a')]){_0x4ed8ee[_0xd402('0x37')]=_['merge'](_0x4ed8ee[_0xd402('0x37')],{'$or':_[_0xd402('0x26')](_0x4ed8ee[_0xd402('0x33')],function(_0x2607ef){var _0x3f5db7={};_0x3f5db7[_0x2607ef]={'$like':'%'+_0x49ce5f[_0xd402('0x2d')][_0xd402('0x3a')]+'%'};return _0x3f5db7;})});}_0x4ed8ee=_['merge']({},_0x4ed8ee,_0x49ce5f[_0xd402('0x3c')]);return _0x490130['getFields'](_0x4ed8ee);}})['then'](function(_0x3aed51){if(_0x3aed51){_0x580a91=_0x3aed51[_0xd402('0x32')];if(!_0x49ce5f[_0xd402('0x2d')]['hasOwnProperty'](_0xd402('0x35'))){_0x4ed8ee[_0xd402('0x19')]=qs[_0xd402('0x19')](_0x49ce5f[_0xd402('0x2d')][_0xd402('0x19')]);_0x4ed8ee['offset']=qs['offset'](_0x49ce5f[_0xd402('0x2d')]['offset']);}return _0x490130[_0xd402('0x4c')](_0x4ed8ee);}})[_0xd402('0x20')](function(_0x211399){if(_0x211399){return _0x211399?{'count':_0x580a91,'rows':_0x211399}:null;}})['then'](respondWithResult(_0x29bf57,null))[_0xd402('0x41')](handleError(_0x29bf57,null));}; \ No newline at end of file +var _0x8993=['reject','save','update','then','error','stack','name','FreshsalesConfiguration','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','VIRTUAL','merge','findAll','catch','show','params','keys','includeAll','include','options','find','create','body','getSubjects','findOne','FreshsalesField','rawAttributes','nolimit','getDescriptions','getFields','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x8993,0x19f));var _0x3899=function(_0x2c6252,_0x1683c9){_0x2c6252=_0x2c6252-0x0;var _0xb04c99=_0x8993[_0x2c6252];return _0xb04c99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3899('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3899('0x1'));var rp=require('request-promise');var moment=require(_0x3899('0x2'));var BPromise=require(_0x3899('0x3'));var Mustache=require(_0x3899('0x4'));var util=require(_0x3899('0x5'));var path=require(_0x3899('0x6'));var sox=require(_0x3899('0x7'));var csv=require('to-csv');var ejs=require(_0x3899('0x8'));var fs=require('fs');var fs_extra=require(_0x3899('0x9'));var _=require('lodash');var squel=require(_0x3899('0xa'));var crypto=require(_0x3899('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3899('0xc'));var querystring=require('querystring');var Papa=require(_0x3899('0xd'));var Redis=require(_0x3899('0xe'));var authService=require(_0x3899('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3899('0x10'))(_0x3899('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3899('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a9c27,_0x2a0ea4){_0x2a0ea4=_0x2a0ea4||0xcc;return function(_0x3bbf99){if(_0x3bbf99){return _0x4a9c27[_0x3899('0x13')](_0x2a0ea4);}return _0x4a9c27[_0x3899('0x14')](_0x2a0ea4)[_0x3899('0x15')]();};}function respondWithResult(_0x1a2f29,_0x51ca5f){_0x51ca5f=_0x51ca5f||0xc8;return function(_0x120085){if(_0x120085){return _0x1a2f29[_0x3899('0x14')](_0x51ca5f)[_0x3899('0x16')](_0x120085);}};}function respondWithFilteredResult(_0x68f775,_0x1d349f){return function(_0x2cc4f3){if(_0x2cc4f3){var _0x4ed356=typeof _0x1d349f[_0x3899('0x17')]===_0x3899('0x18')&&typeof _0x1d349f[_0x3899('0x19')]===_0x3899('0x18');var _0x15dc31=_0x2cc4f3[_0x3899('0x1a')];var _0x4d1f7b=_0x4ed356?0x0:_0x1d349f[_0x3899('0x17')];var _0x3a5def=_0x4ed356?_0x2cc4f3[_0x3899('0x1a')]:_0x1d349f['offset']+_0x1d349f['limit'];var _0x50a2ad;if(_0x3a5def>=_0x15dc31){_0x3a5def=_0x15dc31;_0x50a2ad=0xc8;}else{_0x50a2ad=0xce;}_0x68f775[_0x3899('0x14')](_0x50a2ad);return _0x68f775[_0x3899('0x1b')]('Content-Range',_0x4d1f7b+'-'+_0x3a5def+'/'+_0x15dc31)['json'](_0x2cc4f3);}return null;};}function patchUpdates(_0x1d067a){return function(_0x5f240a){try{jsonpatch[_0x3899('0x1c')](_0x5f240a,_0x1d067a,!![]);}catch(_0x32286c){return BPromise[_0x3899('0x1d')](_0x32286c);}return _0x5f240a[_0x3899('0x1e')]();};}function saveUpdates(_0xc26daf,_0x276042){return function(_0xecbe11){if(_0xecbe11){return _0xecbe11[_0x3899('0x1f')](_0xc26daf)[_0x3899('0x20')](function(_0x4c38d2){return _0x4c38d2;});}return null;};}function removeEntity(_0x2035c9,_0x3fe40f){return function(_0x3b0b80){if(_0x3b0b80){return _0x3b0b80['destroy']()['then'](function(){_0x2035c9[_0x3899('0x14')](0xcc)[_0x3899('0x15')]();});}};}function handleEntityNotFound(_0x2d54bd,_0x5f38b0){return function(_0xac9748){if(!_0xac9748){_0x2d54bd['sendStatus'](0x194);}return _0xac9748;};}function handleError(_0x2191a0,_0x20534e){_0x20534e=_0x20534e||0x1f4;return function(_0x4eebb2){logger[_0x3899('0x21')](_0x4eebb2[_0x3899('0x22')]);if(_0x4eebb2[_0x3899('0x23')]){delete _0x4eebb2['name'];}_0x2191a0[_0x3899('0x14')](_0x20534e)['send'](_0x4eebb2);};}exports['index']=function(_0x38da94,_0x18391c){var _0x580d69={},_0x4a7b49={},_0x3b7003={'count':0x0,'rows':[]};var _0x3d8cb6=_['map'](db[_0x3899('0x24')]['rawAttributes'],function(_0x4d872a){return{'name':_0x4d872a[_0x3899('0x25')],'type':_0x4d872a['type'][_0x3899('0x26')]};});_0x4a7b49[_0x3899('0x27')]=_['map'](_0x3d8cb6,_0x3899('0x23'));_0x4a7b49[_0x3899('0x28')]=_['keys'](_0x38da94['query']);_0x4a7b49[_0x3899('0x29')]=_[_0x3899('0x2a')](_0x4a7b49[_0x3899('0x27')],_0x4a7b49[_0x3899('0x28')]);_0x580d69[_0x3899('0x2b')]=_[_0x3899('0x2a')](_0x4a7b49['model'],qs[_0x3899('0x2c')](_0x38da94[_0x3899('0x28')][_0x3899('0x2c')]));_0x580d69[_0x3899('0x2b')]=_0x580d69[_0x3899('0x2b')][_0x3899('0x2d')]?_0x580d69[_0x3899('0x2b')]:_0x4a7b49['model'];if(!_0x38da94[_0x3899('0x28')][_0x3899('0x2e')]('nolimit')){_0x580d69['limit']=qs['limit'](_0x38da94[_0x3899('0x28')][_0x3899('0x19')]);_0x580d69[_0x3899('0x17')]=qs[_0x3899('0x17')](_0x38da94[_0x3899('0x28')][_0x3899('0x17')]);}_0x580d69[_0x3899('0x2f')]=qs[_0x3899('0x30')](_0x38da94['query'][_0x3899('0x30')]);_0x580d69[_0x3899('0x31')]=qs[_0x3899('0x29')](_[_0x3899('0x32')](_0x38da94[_0x3899('0x28')],_0x4a7b49[_0x3899('0x29')]),_0x3d8cb6);if(_0x38da94['query'][_0x3899('0x33')]){_0x580d69[_0x3899('0x31')]=_['merge'](_0x580d69[_0x3899('0x31')],{'$or':_[_0x3899('0x34')](_0x3d8cb6,function(_0x1c7ad0){if(_0x1c7ad0[_0x3899('0x35')]!==_0x3899('0x36')){var _0x3a85f1={};_0x3a85f1[_0x1c7ad0['name']]={'$like':'%'+_0x38da94[_0x3899('0x28')][_0x3899('0x33')]+'%'};return _0x3a85f1;}})});}_0x580d69=_[_0x3899('0x37')]({},_0x580d69,_0x38da94['options']);var _0x3f6423={'where':_0x580d69[_0x3899('0x31')]};return db[_0x3899('0x24')][_0x3899('0x1a')](_0x3f6423)['then'](function(_0x156052){_0x3b7003[_0x3899('0x1a')]=_0x156052;if(_0x38da94[_0x3899('0x28')]['includeAll']){_0x580d69['include']=[{'all':!![]}];}return db[_0x3899('0x24')][_0x3899('0x38')](_0x580d69);})[_0x3899('0x20')](function(_0x4c025c){_0x3b7003['rows']=_0x4c025c;return _0x3b7003;})[_0x3899('0x20')](respondWithFilteredResult(_0x18391c,_0x580d69))[_0x3899('0x39')](handleError(_0x18391c,null));};exports[_0x3899('0x3a')]=function(_0x2dfb76,_0x254a54){var _0x56f534={'raw':![],'where':{'id':_0x2dfb76[_0x3899('0x3b')]['id']}},_0x5f53c1={};_0x5f53c1[_0x3899('0x27')]=_[_0x3899('0x3c')](db[_0x3899('0x24')]['rawAttributes']);_0x5f53c1['query']=_[_0x3899('0x3c')](_0x2dfb76['query']);_0x5f53c1[_0x3899('0x29')]=_[_0x3899('0x2a')](_0x5f53c1[_0x3899('0x27')],_0x5f53c1[_0x3899('0x28')]);_0x56f534[_0x3899('0x2b')]=_[_0x3899('0x2a')](_0x5f53c1[_0x3899('0x27')],qs[_0x3899('0x2c')](_0x2dfb76[_0x3899('0x28')]['fields']));_0x56f534[_0x3899('0x2b')]=_0x56f534['attributes'][_0x3899('0x2d')]?_0x56f534[_0x3899('0x2b')]:_0x5f53c1[_0x3899('0x27')];if(_0x2dfb76[_0x3899('0x28')][_0x3899('0x3d')]){_0x56f534[_0x3899('0x3e')]=[{'all':!![]}];}_0x56f534=_['merge']({},_0x56f534,_0x2dfb76[_0x3899('0x3f')]);return db['FreshsalesConfiguration'][_0x3899('0x40')](_0x56f534)[_0x3899('0x20')](handleEntityNotFound(_0x254a54,null))[_0x3899('0x20')](respondWithResult(_0x254a54,null))[_0x3899('0x39')](handleError(_0x254a54,null));};exports[_0x3899('0x41')]=function(_0x446e46,_0x52bdff){return db[_0x3899('0x24')][_0x3899('0x41')](_0x446e46[_0x3899('0x42')],{})[_0x3899('0x20')](respondWithResult(_0x52bdff,0xc9))[_0x3899('0x39')](handleError(_0x52bdff,null));};exports[_0x3899('0x1f')]=function(_0x526ebb,_0x2b5f72){if(_0x526ebb[_0x3899('0x42')]['id']){delete _0x526ebb['body']['id'];}return db[_0x3899('0x24')]['find']({'where':{'id':_0x526ebb[_0x3899('0x3b')]['id']}})[_0x3899('0x20')](handleEntityNotFound(_0x2b5f72,null))['then'](saveUpdates(_0x526ebb['body'],null))[_0x3899('0x20')](respondWithResult(_0x2b5f72,null))[_0x3899('0x39')](handleError(_0x2b5f72,null));};exports['destroy']=function(_0x31cfd3,_0x4e2eaa){return db[_0x3899('0x24')][_0x3899('0x40')]({'where':{'id':_0x31cfd3['params']['id']}})['then'](handleEntityNotFound(_0x4e2eaa,null))[_0x3899('0x20')](removeEntity(_0x4e2eaa,null))[_0x3899('0x39')](handleError(_0x4e2eaa,null));};exports[_0x3899('0x43')]=function(_0x5238cf,_0x56f083,_0x12e506){var _0xea4a16={};var _0x2f7594={};var _0x2be3c2;var _0xe4daa8;return db[_0x3899('0x24')][_0x3899('0x44')]({'where':{'id':_0x5238cf[_0x3899('0x3b')]['id']}})[_0x3899('0x20')](handleEntityNotFound(_0x56f083,null))[_0x3899('0x20')](function(_0x917251){if(_0x917251){_0x2be3c2=_0x917251;_0x2f7594[_0x3899('0x27')]=_[_0x3899('0x3c')](db[_0x3899('0x45')][_0x3899('0x46')]);_0x2f7594[_0x3899('0x28')]=_[_0x3899('0x3c')](_0x5238cf[_0x3899('0x28')]);_0x2f7594[_0x3899('0x29')]=_[_0x3899('0x2a')](_0x2f7594[_0x3899('0x27')],_0x2f7594['query']);_0xea4a16['attributes']=_[_0x3899('0x2a')](_0x2f7594[_0x3899('0x27')],qs[_0x3899('0x2c')](_0x5238cf[_0x3899('0x28')][_0x3899('0x2c')]));_0xea4a16[_0x3899('0x2b')]=_0xea4a16[_0x3899('0x2b')][_0x3899('0x2d')]?_0xea4a16[_0x3899('0x2b')]:_0x2f7594[_0x3899('0x27')];_0xea4a16[_0x3899('0x2f')]=qs[_0x3899('0x30')](_0x5238cf[_0x3899('0x28')][_0x3899('0x30')]);_0xea4a16['where']=qs[_0x3899('0x29')](_[_0x3899('0x32')](_0x5238cf[_0x3899('0x28')],_0x2f7594[_0x3899('0x29')]));if(_0x5238cf[_0x3899('0x28')][_0x3899('0x33')]){_0xea4a16[_0x3899('0x31')]=_[_0x3899('0x37')](_0xea4a16['where'],{'$or':_[_0x3899('0x34')](_0xea4a16[_0x3899('0x2b')],function(_0x3345f7){var _0x28f4a8={};_0x28f4a8[_0x3345f7]={'$like':'%'+_0x5238cf[_0x3899('0x28')][_0x3899('0x33')]+'%'};return _0x28f4a8;})});}_0xea4a16=_[_0x3899('0x37')]({},_0xea4a16,_0x5238cf['options']);return _0x2be3c2[_0x3899('0x43')](_0xea4a16);}})[_0x3899('0x20')](function(_0x26b25a){if(_0x26b25a){_0xe4daa8=_0x26b25a[_0x3899('0x2d')];if(!_0x5238cf[_0x3899('0x28')][_0x3899('0x2e')](_0x3899('0x47'))){_0xea4a16[_0x3899('0x19')]=qs[_0x3899('0x19')](_0x5238cf[_0x3899('0x28')][_0x3899('0x19')]);_0xea4a16[_0x3899('0x17')]=qs[_0x3899('0x17')](_0x5238cf[_0x3899('0x28')][_0x3899('0x17')]);}return _0x2be3c2[_0x3899('0x43')](_0xea4a16);}})[_0x3899('0x20')](function(_0x112cc4){if(_0x112cc4){return _0x112cc4?{'count':_0xe4daa8,'rows':_0x112cc4}:null;}})['then'](respondWithResult(_0x56f083,null))[_0x3899('0x39')](handleError(_0x56f083,null));};exports['getDescriptions']=function(_0x34efe4,_0x5bbbf2,_0x368715){var _0x354789={};var _0x2351c2={};var _0x6c79c;var _0x4a7192;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x34efe4[_0x3899('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5bbbf2,null))[_0x3899('0x20')](function(_0x4f2253){if(_0x4f2253){_0x6c79c=_0x4f2253;_0x2351c2[_0x3899('0x27')]=_[_0x3899('0x3c')](db['FreshsalesField'][_0x3899('0x46')]);_0x2351c2[_0x3899('0x28')]=_[_0x3899('0x3c')](_0x34efe4[_0x3899('0x28')]);_0x2351c2[_0x3899('0x29')]=_[_0x3899('0x2a')](_0x2351c2[_0x3899('0x27')],_0x2351c2[_0x3899('0x28')]);_0x354789[_0x3899('0x2b')]=_[_0x3899('0x2a')](_0x2351c2[_0x3899('0x27')],qs[_0x3899('0x2c')](_0x34efe4[_0x3899('0x28')]['fields']));_0x354789[_0x3899('0x2b')]=_0x354789[_0x3899('0x2b')]['length']?_0x354789['attributes']:_0x2351c2[_0x3899('0x27')];_0x354789[_0x3899('0x2f')]=qs['sort'](_0x34efe4[_0x3899('0x28')]['sort']);_0x354789[_0x3899('0x31')]=qs[_0x3899('0x29')](_['pick'](_0x34efe4[_0x3899('0x28')],_0x2351c2[_0x3899('0x29')]));if(_0x34efe4['query']['filter']){_0x354789[_0x3899('0x31')]=_[_0x3899('0x37')](_0x354789['where'],{'$or':_[_0x3899('0x34')](_0x354789['attributes'],function(_0x1887c6){var _0x522f2f={};_0x522f2f[_0x1887c6]={'$like':'%'+_0x34efe4[_0x3899('0x28')][_0x3899('0x33')]+'%'};return _0x522f2f;})});}_0x354789=_['merge']({},_0x354789,_0x34efe4[_0x3899('0x3f')]);return _0x6c79c[_0x3899('0x48')](_0x354789);}})['then'](function(_0x3fcdda){if(_0x3fcdda){_0x4a7192=_0x3fcdda[_0x3899('0x2d')];if(!_0x34efe4[_0x3899('0x28')][_0x3899('0x2e')](_0x3899('0x47'))){_0x354789['limit']=qs[_0x3899('0x19')](_0x34efe4[_0x3899('0x28')]['limit']);_0x354789[_0x3899('0x17')]=qs['offset'](_0x34efe4['query'][_0x3899('0x17')]);}return _0x6c79c[_0x3899('0x48')](_0x354789);}})['then'](function(_0x19d479){if(_0x19d479){return _0x19d479?{'count':_0x4a7192,'rows':_0x19d479}:null;}})[_0x3899('0x20')](respondWithResult(_0x5bbbf2,null))[_0x3899('0x39')](handleError(_0x5bbbf2,null));};exports[_0x3899('0x49')]=function(_0x155baa,_0x567ba7,_0x29f5de){var _0x60ec01={};var _0x39a6f9={};var _0x49630d;var _0x211391;return db[_0x3899('0x24')][_0x3899('0x44')]({'where':{'id':_0x155baa[_0x3899('0x3b')]['id']}})['then'](handleEntityNotFound(_0x567ba7,null))[_0x3899('0x20')](function(_0x14a1e3){if(_0x14a1e3){_0x49630d=_0x14a1e3;_0x39a6f9[_0x3899('0x27')]=_['keys'](db[_0x3899('0x45')]['rawAttributes']);_0x39a6f9[_0x3899('0x28')]=_['keys'](_0x155baa[_0x3899('0x28')]);_0x39a6f9[_0x3899('0x29')]=_['intersection'](_0x39a6f9[_0x3899('0x27')],_0x39a6f9['query']);_0x60ec01[_0x3899('0x2b')]=_[_0x3899('0x2a')](_0x39a6f9[_0x3899('0x27')],qs[_0x3899('0x2c')](_0x155baa['query'][_0x3899('0x2c')]));_0x60ec01[_0x3899('0x2b')]=_0x60ec01['attributes'][_0x3899('0x2d')]?_0x60ec01[_0x3899('0x2b')]:_0x39a6f9[_0x3899('0x27')];_0x60ec01[_0x3899('0x2f')]=qs['sort'](_0x155baa['query'][_0x3899('0x30')]);_0x60ec01[_0x3899('0x31')]=qs[_0x3899('0x29')](_[_0x3899('0x32')](_0x155baa[_0x3899('0x28')],_0x39a6f9[_0x3899('0x29')]));if(_0x155baa[_0x3899('0x28')][_0x3899('0x33')]){_0x60ec01['where']=_[_0x3899('0x37')](_0x60ec01[_0x3899('0x31')],{'$or':_['map'](_0x60ec01[_0x3899('0x2b')],function(_0x1804fc){var _0x56d72d={};_0x56d72d[_0x1804fc]={'$like':'%'+_0x155baa['query'][_0x3899('0x33')]+'%'};return _0x56d72d;})});}_0x60ec01=_[_0x3899('0x37')]({},_0x60ec01,_0x155baa[_0x3899('0x3f')]);return _0x49630d[_0x3899('0x49')](_0x60ec01);}})['then'](function(_0x3479ad){if(_0x3479ad){_0x211391=_0x3479ad[_0x3899('0x2d')];if(!_0x155baa[_0x3899('0x28')][_0x3899('0x2e')](_0x3899('0x47'))){_0x60ec01[_0x3899('0x19')]=qs[_0x3899('0x19')](_0x155baa['query'][_0x3899('0x19')]);_0x60ec01['offset']=qs['offset'](_0x155baa['query'][_0x3899('0x17')]);}return _0x49630d[_0x3899('0x49')](_0x60ec01);}})[_0x3899('0x20')](function(_0x9aa6a7){if(_0x9aa6a7){return _0x9aa6a7?{'count':_0x211391,'rows':_0x9aa6a7}:null;}})[_0x3899('0x20')](respondWithResult(_0x567ba7,null))[_0x3899('0x39')](handleError(_0x567ba7,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 49047cd..cd06ff9 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 _0x0d26=['./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x137a7b,_0x4f039f){var _0x42cdad=function(_0x13d06a){while(--_0x13d06a){_0x137a7b['push'](_0x137a7b['shift']());}};_0x42cdad(++_0x4f039f);}(_0x0d26,0x82));var _0x60d2=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x0d26[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x60d2('0x0'));var util=require(_0x60d2('0x1'));var logger=require(_0x60d2('0x2'))(_0x60d2('0x3'));var moment=require(_0x60d2('0x4'));var BPromise=require(_0x60d2('0x5'));var rp=require(_0x60d2('0x6'));var fs=require('fs');var path=require(_0x60d2('0x7'));var rimraf=require(_0x60d2('0x8'));var config=require(_0x60d2('0x9'));var attributes=require(_0x60d2('0xa'));module['exports']=function(_0x56fbc2,_0x18e615){return _0x56fbc2[_0x60d2('0xb')](_0x60d2('0xc'),attributes,{'tableName':_0x60d2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc94c=['FreshsalesConfiguration','int_freshsales_configurations','util','bluebird','request-promise','path','exports','define'];(function(_0x408240,_0x1979c3){var _0x3f002a=function(_0x26d4a0){while(--_0x26d4a0){_0x408240['push'](_0x408240['shift']());}};_0x3f002a(++_0x1979c3);}(_0xc94c,0x18a));var _0xcc94=function(_0x15e4d0,_0x4167cd){_0x15e4d0=_0x15e4d0-0x0;var _0x57c623=_0xc94c[_0x15e4d0];return _0x57c623;};'use strict';var _=require('lodash');var util=require(_0xcc94('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcc94('0x1'));var rp=require(_0xcc94('0x2'));var fs=require('fs');var path=require(_0xcc94('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xcc94('0x4')]=function(_0xe6f607,_0x50136f){return _0xe6f607[_0xcc94('0x5')](_0xcc94('0x6'),attributes,{'tableName':_0xcc94('0x7'),'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 fdae9f9..bbff8f9 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 _0x49ab=['then','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x49ab,0x18a));var _0xb49a=function(_0x1705c6,_0x1af12f){_0x1705c6=_0x1705c6-0x0;var _0x55cca2=_0x49ab[_0x1705c6];return _0x55cca2;};'use strict';var _=require(_0xb49a('0x0'));var util=require(_0xb49a('0x1'));var moment=require(_0xb49a('0x2'));var BPromise=require(_0xb49a('0x3'));var rs=require(_0xb49a('0x4'));var fs=require('fs');var Redis=require(_0xb49a('0x5'));var db=require(_0xb49a('0x6'))['db'];var utils=require(_0xb49a('0x7'));var logger=require(_0xb49a('0x8'))(_0xb49a('0x9'));var config=require(_0xb49a('0xa'));var jayson=require(_0xb49a('0xb'));var client=jayson[_0xb49a('0xc')][_0xb49a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4bc002,_0xb79564,_0x15cfbc){return new BPromise(function(_0x3a3a7c,_0x3c904b){return client['request'](_0x4bc002,_0x15cfbc)[_0xb49a('0xe')](function(_0x378949){logger['info'](_0xb49a('0xf'),_0xb79564,'request\x20sent');logger[_0xb49a('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0xb79564,_0xb49a('0x11'),JSON[_0xb49a('0x12')](_0x378949));if(_0x378949[_0xb49a('0x13')]){if(_0x378949['error'][_0xb49a('0x14')]===0x1f4){logger[_0xb49a('0x13')](_0xb49a('0xf'),_0xb79564,_0x378949['error'][_0xb49a('0x15')]);return _0x3c904b(_0x378949[_0xb49a('0x13')][_0xb49a('0x15')]);}logger[_0xb49a('0x13')](_0xb49a('0xf'),_0xb79564,_0x378949[_0xb49a('0x13')][_0xb49a('0x15')]);return _0x3a3a7c(_0x378949[_0xb49a('0x13')][_0xb49a('0x15')]);}else{logger[_0xb49a('0x16')](_0xb49a('0xf'),_0xb79564,_0xb49a('0x11'));_0x3a3a7c(_0x378949[_0xb49a('0x17')][_0xb49a('0x15')]);}})['catch'](function(_0x5bb4be){logger[_0xb49a('0x13')](_0xb49a('0xf'),_0xb79564,_0x5bb4be);_0x3c904b(_0x5bb4be);});});} \ No newline at end of file +var _0x144f=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x144f,0xf7));var _0xf144=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x144f[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xf144('0x0'));var util=require(_0xf144('0x1'));var moment=require(_0xf144('0x2'));var BPromise=require(_0xf144('0x3'));var rs=require(_0xf144('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf144('0x5'))['db'];var utils=require(_0xf144('0x6'));var logger=require(_0xf144('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf144('0x8'));var client=jayson[_0xf144('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2e8b,_0x187a81,_0xa3887e){return new BPromise(function(_0x58a795,_0x55ea21){return client[_0xf144('0xa')](_0x4e2e8b,_0xa3887e)['then'](function(_0x2d8e03){logger['info'](_0xf144('0xb'),_0x187a81,_0xf144('0xc'));logger[_0xf144('0xd')](_0xf144('0xe'),_0x187a81,_0xf144('0xc'),JSON[_0xf144('0xf')](_0x2d8e03));if(_0x2d8e03['error']){if(_0x2d8e03[_0xf144('0x10')][_0xf144('0x11')]===0x1f4){logger[_0xf144('0x10')](_0xf144('0xb'),_0x187a81,_0x2d8e03['error'][_0xf144('0x12')]);return _0x55ea21(_0x2d8e03[_0xf144('0x10')]['message']);}logger[_0xf144('0x10')](_0xf144('0xb'),_0x187a81,_0x2d8e03['error'][_0xf144('0x12')]);return _0x58a795(_0x2d8e03['error']['message']);}else{logger[_0xf144('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x187a81,_0xf144('0xc'));_0x58a795(_0x2d8e03[_0xf144('0x14')][_0xf144('0x12')]);}})[_0xf144('0x15')](function(_0x28b19a){logger['error'](_0xf144('0xb'),_0x187a81,_0x28b19a);_0x55ea21(_0x28b19a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 39e2748..a3386cf 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 _0xc39c=['../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1a3bfa,_0x46404f){var _0x50a717=function(_0x125fc0){while(--_0x125fc0){_0x1a3bfa['push'](_0x1a3bfa['shift']());}};_0x50a717(++_0x46404f);}(_0xc39c,0xd2));var _0xcc39=function(_0x27b578,_0x53652b){_0x27b578=_0x27b578-0x0;var _0x8f51c6=_0xc39c[_0x27b578];return _0x8f51c6;};'use strict';var multer=require('multer');var util=require(_0xcc39('0x0'));var path=require(_0xcc39('0x1'));var timeout=require(_0xcc39('0x2'));var express=require('express');var router=express[_0xcc39('0x3')]();var fs_extra=require(_0xcc39('0x4'));var auth=require(_0xcc39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc39('0x6'));var controller=require(_0xcc39('0x7'));router[_0xcc39('0x8')]('/',auth[_0xcc39('0x9')](),controller['index']);router[_0xcc39('0x8')](_0xcc39('0xa'),auth[_0xcc39('0x9')](),controller[_0xcc39('0xb')]);router[_0xcc39('0xc')]('/',auth[_0xcc39('0x9')](),controller[_0xcc39('0xd')]);router[_0xcc39('0xe')](_0xcc39('0xa'),auth[_0xcc39('0x9')](),controller['update']);router[_0xcc39('0xf')]('/:id',auth[_0xcc39('0x9')](),controller[_0xcc39('0x10')]);module[_0xcc39('0x11')]=router; \ No newline at end of file +var _0xaefc=['index','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xaefc,0xc8));var _0xcaef=function(_0x23f797,_0x1e5cca){_0x23f797=_0x23f797-0x0;var _0x44cd3f=_0xaefc[_0x23f797];return _0x44cd3f;};'use strict';var multer=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var path=require(_0xcaef('0x2'));var timeout=require('connect-timeout');var express=require(_0xcaef('0x3'));var router=express[_0xcaef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xcaef('0x7')](),controller[_0xcaef('0x8')]);router['get'](_0xcaef('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xcaef('0xa')]('/',auth[_0xcaef('0x7')](),controller['create']);router[_0xcaef('0xb')](_0xcaef('0x9'),auth['isAuthenticated'](),controller[_0xcaef('0xc')]);router[_0xcaef('0xd')](_0xcaef('0x9'),auth[_0xcaef('0x7')](),controller[_0xcaef('0xe')]);module[_0xcaef('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index bfc776a..fff7203 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 _0x4604=['customVariable','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x3c8cfc,_0x167a4a){var _0x5e1857=function(_0x53f384){while(--_0x53f384){_0x3c8cfc['push'](_0x3c8cfc['shift']());}};_0x5e1857(++_0x167a4a);}(_0x4604,0x7b));var _0x4460=function(_0x12421a,_0x1a9d40){_0x12421a=_0x12421a-0x0;var _0xd328a2=_0x4604[_0x12421a];return _0xd328a2;};'use strict';var Sequelize=require(_0x4460('0x0'));module[_0x4460('0x1')]={'type':{'type':Sequelize[_0x4460('0x2')](_0x4460('0x3'),_0x4460('0x4'),_0x4460('0x5'),'keyValue',_0x4460('0x6')),'defaultValue':_0x4460('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4460('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x4460('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4460('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x48c2=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1ae793,_0x3a57e9){var _0x3ce01a=function(_0x4ae310){while(--_0x4ae310){_0x1ae793['push'](_0x1ae793['shift']());}};_0x3ce01a(++_0x3a57e9);}(_0x48c2,0x146));var _0x248c=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x48c2[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0x248c('0x0'));module[_0x248c('0x1')]={'type':{'type':Sequelize[_0x248c('0x2')](_0x248c('0x3'),_0x248c('0x4'),'customVariable',_0x248c('0x5'),_0x248c('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x248c('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x248c('0x3'),_0x248c('0x4'),_0x248c('0x8'))},'keyContent':{'type':Sequelize[_0x248c('0x7')]},'idField':{'type':Sequelize[_0x248c('0x7')]},'nameField':{'type':Sequelize[_0x248c('0x7')]},'customField':{'type':Sequelize[_0x248c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 0dbbe5a..700ba71 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 _0x7302=['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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','options','catch','create','body','find','params','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x96a34a,_0x48b3c6){var _0x4e325e=function(_0x20e343){while(--_0x20e343){_0x96a34a['push'](_0x96a34a['shift']());}};_0x4e325e(++_0x48b3c6);}(_0x7302,0x1e5));var _0x2730=function(_0x1c27d2,_0x4ee189){_0x1c27d2=_0x1c27d2-0x0;var _0x1ca338=_0x7302[_0x1c27d2];return _0x1ca338;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2730('0x0'));var jsonpatch=require(_0x2730('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2730('0x2'));var Mustache=require(_0x2730('0x3'));var util=require('util');var path=require(_0x2730('0x4'));var sox=require(_0x2730('0x5'));var csv=require(_0x2730('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2730('0x7'));var squel=require('squel');var crypto=require(_0x2730('0x8'));var jsforce=require(_0x2730('0x9'));var deskjs=require(_0x2730('0xa'));var toCsv=require(_0x2730('0x6'));var querystring=require(_0x2730('0xb'));var Papa=require(_0x2730('0xc'));var Redis=require(_0x2730('0xd'));var authService=require(_0x2730('0xe'));var qs=require(_0x2730('0xf'));var as=require(_0x2730('0x10'));var hardwareService=require(_0x2730('0x11'));var logger=require(_0x2730('0x12'))(_0x2730('0x13'));var utils=require(_0x2730('0x14'));var config=require(_0x2730('0x15'));var licenseUtil=require(_0x2730('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a8956,_0x3fe697){_0x3fe697=_0x3fe697||0xcc;return function(_0x2934aa){if(_0x2934aa){return _0x1a8956[_0x2730('0x17')](_0x3fe697);}return _0x1a8956[_0x2730('0x18')](_0x3fe697)[_0x2730('0x19')]();};}function respondWithResult(_0x32f261,_0x4f69ed){_0x4f69ed=_0x4f69ed||0xc8;return function(_0x159a40){if(_0x159a40){return _0x32f261[_0x2730('0x18')](_0x4f69ed)[_0x2730('0x1a')](_0x159a40);}};}function respondWithFilteredResult(_0x276b99,_0x3dedd6){return function(_0x4b8b7d){if(_0x4b8b7d){var _0x93712c=typeof _0x3dedd6['offset']===_0x2730('0x1b')&&typeof _0x3dedd6[_0x2730('0x1c')]==='undefined';var _0x2ecc5c=_0x4b8b7d[_0x2730('0x1d')];var _0x531b98=_0x93712c?0x0:_0x3dedd6[_0x2730('0x1e')];var _0x175927=_0x93712c?_0x4b8b7d['count']:_0x3dedd6[_0x2730('0x1e')]+_0x3dedd6[_0x2730('0x1c')];var _0x2dac84;if(_0x175927>=_0x2ecc5c){_0x175927=_0x2ecc5c;_0x2dac84=0xc8;}else{_0x2dac84=0xce;}_0x276b99[_0x2730('0x18')](_0x2dac84);return _0x276b99[_0x2730('0x1f')](_0x2730('0x20'),_0x531b98+'-'+_0x175927+'/'+_0x2ecc5c)[_0x2730('0x1a')](_0x4b8b7d);}return null;};}function patchUpdates(_0x56031d){return function(_0x13c4df){try{jsonpatch[_0x2730('0x21')](_0x13c4df,_0x56031d,!![]);}catch(_0x497db0){return BPromise[_0x2730('0x22')](_0x497db0);}return _0x13c4df[_0x2730('0x23')]();};}function saveUpdates(_0x5b1fe4,_0x557f04){return function(_0x173e54){if(_0x173e54){return _0x173e54[_0x2730('0x24')](_0x5b1fe4)[_0x2730('0x25')](function(_0x5ca9ef){return _0x5ca9ef;});}return null;};}function removeEntity(_0x395483,_0x3338a1){return function(_0x2e2963){if(_0x2e2963){return _0x2e2963[_0x2730('0x26')]()['then'](function(){_0x395483[_0x2730('0x18')](0xcc)[_0x2730('0x19')]();});}};}function handleEntityNotFound(_0xdfa9fc,_0x9cd190){return function(_0x39c632){if(!_0x39c632){_0xdfa9fc[_0x2730('0x17')](0x194);}return _0x39c632;};}function handleError(_0xbbb56c,_0x5e2f4a){_0x5e2f4a=_0x5e2f4a||0x1f4;return function(_0x259d65){logger[_0x2730('0x27')](_0x259d65[_0x2730('0x28')]);if(_0x259d65[_0x2730('0x29')]){delete _0x259d65[_0x2730('0x29')];}_0xbbb56c[_0x2730('0x18')](_0x5e2f4a)[_0x2730('0x2a')](_0x259d65);};}exports['index']=function(_0x24c175,_0x5f1c68){var _0xb50801={},_0x2e16d2={},_0x4a695d={'count':0x0,'rows':[]};var _0xe50ba2=_[_0x2730('0x2b')](db[_0x2730('0x2c')][_0x2730('0x2d')],function(_0x539537){return{'name':_0x539537['fieldName'],'type':_0x539537[_0x2730('0x2e')]['key']};});_0x2e16d2[_0x2730('0x2f')]=_[_0x2730('0x2b')](_0xe50ba2,_0x2730('0x29'));_0x2e16d2[_0x2730('0x30')]=_[_0x2730('0x31')](_0x24c175['query']);_0x2e16d2[_0x2730('0x32')]=_[_0x2730('0x33')](_0x2e16d2[_0x2730('0x2f')],_0x2e16d2[_0x2730('0x30')]);_0xb50801['attributes']=_['intersection'](_0x2e16d2[_0x2730('0x2f')],qs[_0x2730('0x34')](_0x24c175[_0x2730('0x30')][_0x2730('0x34')]));_0xb50801[_0x2730('0x35')]=_0xb50801[_0x2730('0x35')][_0x2730('0x36')]?_0xb50801['attributes']:_0x2e16d2[_0x2730('0x2f')];if(!_0x24c175[_0x2730('0x30')][_0x2730('0x37')]('nolimit')){_0xb50801[_0x2730('0x1c')]=qs[_0x2730('0x1c')](_0x24c175[_0x2730('0x30')][_0x2730('0x1c')]);_0xb50801[_0x2730('0x1e')]=qs['offset'](_0x24c175['query'][_0x2730('0x1e')]);}_0xb50801[_0x2730('0x38')]=qs[_0x2730('0x39')](_0x24c175['query']['sort']);_0xb50801[_0x2730('0x3a')]=qs[_0x2730('0x32')](_[_0x2730('0x3b')](_0x24c175['query'],_0x2e16d2[_0x2730('0x32')]),_0xe50ba2);if(_0x24c175['query'][_0x2730('0x3c')]){_0xb50801[_0x2730('0x3a')]=_[_0x2730('0x3d')](_0xb50801[_0x2730('0x3a')],{'$or':_[_0x2730('0x2b')](_0xe50ba2,function(_0x1d05a2){if(_0x1d05a2[_0x2730('0x2e')]!==_0x2730('0x3e')){var _0x21ad2b={};_0x21ad2b[_0x1d05a2[_0x2730('0x29')]]={'$like':'%'+_0x24c175[_0x2730('0x30')][_0x2730('0x3c')]+'%'};return _0x21ad2b;}})});}_0xb50801=_[_0x2730('0x3d')]({},_0xb50801,_0x24c175['options']);var _0x328820={'where':_0xb50801['where']};return db[_0x2730('0x2c')][_0x2730('0x1d')](_0x328820)[_0x2730('0x25')](function(_0x30da7a){_0x4a695d[_0x2730('0x1d')]=_0x30da7a;if(_0x24c175['query'][_0x2730('0x3f')]){_0xb50801[_0x2730('0x40')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0xb50801);})[_0x2730('0x25')](function(_0xd8cae4){_0x4a695d['rows']=_0xd8cae4;return _0x4a695d;})[_0x2730('0x25')](respondWithFilteredResult(_0x5f1c68,_0xb50801))['catch'](handleError(_0x5f1c68,null));};exports['show']=function(_0x39a444,_0xc264df){var _0x3cdbee={'raw':!![],'where':{'id':_0x39a444['params']['id']}},_0x5e59e8={};_0x5e59e8['model']=_[_0x2730('0x31')](db['FreshsalesField']['rawAttributes']);_0x5e59e8['query']=_[_0x2730('0x31')](_0x39a444[_0x2730('0x30')]);_0x5e59e8['filters']=_[_0x2730('0x33')](_0x5e59e8[_0x2730('0x2f')],_0x5e59e8[_0x2730('0x30')]);_0x3cdbee['attributes']=_[_0x2730('0x33')](_0x5e59e8['model'],qs[_0x2730('0x34')](_0x39a444[_0x2730('0x30')]['fields']));_0x3cdbee[_0x2730('0x35')]=_0x3cdbee['attributes'][_0x2730('0x36')]?_0x3cdbee[_0x2730('0x35')]:_0x5e59e8['model'];if(_0x39a444[_0x2730('0x30')][_0x2730('0x3f')]){_0x3cdbee[_0x2730('0x40')]=[{'all':!![]}];}_0x3cdbee=_['merge']({},_0x3cdbee,_0x39a444[_0x2730('0x41')]);return db[_0x2730('0x2c')]['find'](_0x3cdbee)[_0x2730('0x25')](handleEntityNotFound(_0xc264df,null))[_0x2730('0x25')](respondWithResult(_0xc264df,null))[_0x2730('0x42')](handleError(_0xc264df,null));};exports[_0x2730('0x43')]=function(_0x4effdf,_0x54e89d){return db[_0x2730('0x2c')][_0x2730('0x43')](_0x4effdf[_0x2730('0x44')],{})['then'](respondWithResult(_0x54e89d,0xc9))[_0x2730('0x42')](handleError(_0x54e89d,null));};exports[_0x2730('0x24')]=function(_0x2c5e4b,_0x17f87c){if(_0x2c5e4b[_0x2730('0x44')]['id']){delete _0x2c5e4b[_0x2730('0x44')]['id'];}return db[_0x2730('0x2c')]['find']({'where':{'id':_0x2c5e4b['params']['id']}})[_0x2730('0x25')](handleEntityNotFound(_0x17f87c,null))[_0x2730('0x25')](saveUpdates(_0x2c5e4b[_0x2730('0x44')],null))[_0x2730('0x25')](respondWithResult(_0x17f87c,null))[_0x2730('0x42')](handleError(_0x17f87c,null));};exports['destroy']=function(_0x42dd83,_0x13165f){return db[_0x2730('0x2c')][_0x2730('0x45')]({'where':{'id':_0x42dd83[_0x2730('0x46')]['id']}})[_0x2730('0x25')](handleEntityNotFound(_0x13165f,null))[_0x2730('0x25')](removeEntity(_0x13165f,null))[_0x2730('0x42')](handleError(_0x13165f,null));}; \ No newline at end of file +var _0x2bf6=['destroy','then','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','reject','save','update'];(function(_0x146fbb,_0x1612ed){var _0x515202=function(_0x5382ff){while(--_0x5382ff){_0x146fbb['push'](_0x146fbb['shift']());}};_0x515202(++_0x1612ed);}(_0x2bf6,0x1a2));var _0x62bf=function(_0x183be7,_0xb9d0c5){_0x183be7=_0x183be7-0x0;var _0x2bdd8b=_0x2bf6[_0x183be7];return _0x2bdd8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62bf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62bf('0x1'));var rp=require(_0x62bf('0x2'));var moment=require(_0x62bf('0x3'));var BPromise=require(_0x62bf('0x4'));var Mustache=require(_0x62bf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x62bf('0x6'));var csv=require('to-csv');var ejs=require(_0x62bf('0x7'));var fs=require('fs');var fs_extra=require(_0x62bf('0x8'));var _=require(_0x62bf('0x9'));var squel=require('squel');var crypto=require(_0x62bf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x62bf('0xb'));var toCsv=require('to-csv');var querystring=require(_0x62bf('0xc'));var Papa=require(_0x62bf('0xd'));var Redis=require(_0x62bf('0xe'));var authService=require(_0x62bf('0xf'));var qs=require(_0x62bf('0x10'));var as=require(_0x62bf('0x11'));var hardwareService=require(_0x62bf('0x12'));var logger=require(_0x62bf('0x13'))(_0x62bf('0x14'));var utils=require(_0x62bf('0x15'));var config=require(_0x62bf('0x16'));var licenseUtil=require(_0x62bf('0x17'));var db=require(_0x62bf('0x18'))['db'];function respondWithStatusCode(_0x5e4c58,_0xd43262){_0xd43262=_0xd43262||0xcc;return function(_0x258f6b){if(_0x258f6b){return _0x5e4c58[_0x62bf('0x19')](_0xd43262);}return _0x5e4c58[_0x62bf('0x1a')](_0xd43262)[_0x62bf('0x1b')]();};}function respondWithResult(_0x5f3350,_0x3e5f32){_0x3e5f32=_0x3e5f32||0xc8;return function(_0x2f45df){if(_0x2f45df){return _0x5f3350[_0x62bf('0x1a')](_0x3e5f32)['json'](_0x2f45df);}};}function respondWithFilteredResult(_0x1ab266,_0x1e041b){return function(_0x29983c){if(_0x29983c){var _0x44e9c7=typeof _0x1e041b['offset']===_0x62bf('0x1c')&&typeof _0x1e041b['limit']===_0x62bf('0x1c');var _0x631798=_0x29983c['count'];var _0x582b50=_0x44e9c7?0x0:_0x1e041b[_0x62bf('0x1d')];var _0x46e5a7=_0x44e9c7?_0x29983c[_0x62bf('0x1e')]:_0x1e041b[_0x62bf('0x1d')]+_0x1e041b[_0x62bf('0x1f')];var _0x35e027;if(_0x46e5a7>=_0x631798){_0x46e5a7=_0x631798;_0x35e027=0xc8;}else{_0x35e027=0xce;}_0x1ab266['status'](_0x35e027);return _0x1ab266[_0x62bf('0x20')](_0x62bf('0x21'),_0x582b50+'-'+_0x46e5a7+'/'+_0x631798)[_0x62bf('0x22')](_0x29983c);}return null;};}function patchUpdates(_0x4f3779){return function(_0x125188){try{jsonpatch['apply'](_0x125188,_0x4f3779,!![]);}catch(_0xe43ab0){return BPromise[_0x62bf('0x23')](_0xe43ab0);}return _0x125188[_0x62bf('0x24')]();};}function saveUpdates(_0x1a5337,_0x3e6f49){return function(_0x38b42f){if(_0x38b42f){return _0x38b42f[_0x62bf('0x25')](_0x1a5337)['then'](function(_0x11671b){return _0x11671b;});}return null;};}function removeEntity(_0x5c352a,_0x245f4e){return function(_0x4e5c92){if(_0x4e5c92){return _0x4e5c92[_0x62bf('0x26')]()[_0x62bf('0x27')](function(){_0x5c352a[_0x62bf('0x1a')](0xcc)[_0x62bf('0x1b')]();});}};}function handleEntityNotFound(_0x1d0c88,_0x55923f){return function(_0x497c88){if(!_0x497c88){_0x1d0c88[_0x62bf('0x19')](0x194);}return _0x497c88;};}function handleError(_0x88b47,_0x299a49){_0x299a49=_0x299a49||0x1f4;return function(_0x29daad){logger['error'](_0x29daad[_0x62bf('0x28')]);if(_0x29daad[_0x62bf('0x29')]){delete _0x29daad[_0x62bf('0x29')];}_0x88b47[_0x62bf('0x1a')](_0x299a49)[_0x62bf('0x2a')](_0x29daad);};}exports[_0x62bf('0x2b')]=function(_0xb034e6,_0x198562){var _0x1370a6={},_0x2faa96={},_0x148da4={'count':0x0,'rows':[]};var _0x14b38b=_[_0x62bf('0x2c')](db[_0x62bf('0x2d')][_0x62bf('0x2e')],function(_0x5604fc){return{'name':_0x5604fc[_0x62bf('0x2f')],'type':_0x5604fc['type'][_0x62bf('0x30')]};});_0x2faa96[_0x62bf('0x31')]=_[_0x62bf('0x2c')](_0x14b38b,'name');_0x2faa96[_0x62bf('0x32')]=_[_0x62bf('0x33')](_0xb034e6[_0x62bf('0x32')]);_0x2faa96['filters']=_[_0x62bf('0x34')](_0x2faa96[_0x62bf('0x31')],_0x2faa96[_0x62bf('0x32')]);_0x1370a6[_0x62bf('0x35')]=_['intersection'](_0x2faa96[_0x62bf('0x31')],qs['fields'](_0xb034e6[_0x62bf('0x32')][_0x62bf('0x36')]));_0x1370a6[_0x62bf('0x35')]=_0x1370a6[_0x62bf('0x35')]['length']?_0x1370a6[_0x62bf('0x35')]:_0x2faa96[_0x62bf('0x31')];if(!_0xb034e6[_0x62bf('0x32')]['hasOwnProperty'](_0x62bf('0x37'))){_0x1370a6[_0x62bf('0x1f')]=qs[_0x62bf('0x1f')](_0xb034e6[_0x62bf('0x32')][_0x62bf('0x1f')]);_0x1370a6['offset']=qs['offset'](_0xb034e6['query'][_0x62bf('0x1d')]);}_0x1370a6[_0x62bf('0x38')]=qs[_0x62bf('0x39')](_0xb034e6[_0x62bf('0x32')][_0x62bf('0x39')]);_0x1370a6[_0x62bf('0x3a')]=qs[_0x62bf('0x3b')](_[_0x62bf('0x3c')](_0xb034e6[_0x62bf('0x32')],_0x2faa96[_0x62bf('0x3b')]),_0x14b38b);if(_0xb034e6['query'][_0x62bf('0x3d')]){_0x1370a6[_0x62bf('0x3a')]=_[_0x62bf('0x3e')](_0x1370a6[_0x62bf('0x3a')],{'$or':_[_0x62bf('0x2c')](_0x14b38b,function(_0x250f54){if(_0x250f54[_0x62bf('0x3f')]!==_0x62bf('0x40')){var _0x57f19f={};_0x57f19f[_0x250f54[_0x62bf('0x29')]]={'$like':'%'+_0xb034e6[_0x62bf('0x32')]['filter']+'%'};return _0x57f19f;}})});}_0x1370a6=_['merge']({},_0x1370a6,_0xb034e6[_0x62bf('0x41')]);var _0x33eacd={'where':_0x1370a6[_0x62bf('0x3a')]};return db[_0x62bf('0x2d')][_0x62bf('0x1e')](_0x33eacd)['then'](function(_0x1ed7a1){_0x148da4[_0x62bf('0x1e')]=_0x1ed7a1;if(_0xb034e6[_0x62bf('0x32')][_0x62bf('0x42')]){_0x1370a6[_0x62bf('0x43')]=[{'all':!![]}];}return db['FreshsalesField'][_0x62bf('0x44')](_0x1370a6);})[_0x62bf('0x27')](function(_0x57354c){_0x148da4['rows']=_0x57354c;return _0x148da4;})[_0x62bf('0x27')](respondWithFilteredResult(_0x198562,_0x1370a6))[_0x62bf('0x45')](handleError(_0x198562,null));};exports[_0x62bf('0x46')]=function(_0x5cbeca,_0x2e8cfe){var _0x3ea7b7={'raw':!![],'where':{'id':_0x5cbeca[_0x62bf('0x47')]['id']}},_0x1283db={};_0x1283db[_0x62bf('0x31')]=_[_0x62bf('0x33')](db[_0x62bf('0x2d')][_0x62bf('0x2e')]);_0x1283db['query']=_[_0x62bf('0x33')](_0x5cbeca[_0x62bf('0x32')]);_0x1283db[_0x62bf('0x3b')]=_[_0x62bf('0x34')](_0x1283db[_0x62bf('0x31')],_0x1283db[_0x62bf('0x32')]);_0x3ea7b7['attributes']=_['intersection'](_0x1283db[_0x62bf('0x31')],qs[_0x62bf('0x36')](_0x5cbeca['query']['fields']));_0x3ea7b7[_0x62bf('0x35')]=_0x3ea7b7['attributes'][_0x62bf('0x48')]?_0x3ea7b7[_0x62bf('0x35')]:_0x1283db[_0x62bf('0x31')];if(_0x5cbeca[_0x62bf('0x32')][_0x62bf('0x42')]){_0x3ea7b7['include']=[{'all':!![]}];}_0x3ea7b7=_[_0x62bf('0x3e')]({},_0x3ea7b7,_0x5cbeca[_0x62bf('0x41')]);return db[_0x62bf('0x2d')][_0x62bf('0x49')](_0x3ea7b7)[_0x62bf('0x27')](handleEntityNotFound(_0x2e8cfe,null))['then'](respondWithResult(_0x2e8cfe,null))[_0x62bf('0x45')](handleError(_0x2e8cfe,null));};exports[_0x62bf('0x4a')]=function(_0x133a70,_0x2aa8e6){return db[_0x62bf('0x2d')][_0x62bf('0x4a')](_0x133a70[_0x62bf('0x4b')],{})[_0x62bf('0x27')](respondWithResult(_0x2aa8e6,0xc9))[_0x62bf('0x45')](handleError(_0x2aa8e6,null));};exports['update']=function(_0x2e8ffc,_0x50a84a){if(_0x2e8ffc['body']['id']){delete _0x2e8ffc[_0x62bf('0x4b')]['id'];}return db[_0x62bf('0x2d')]['find']({'where':{'id':_0x2e8ffc[_0x62bf('0x47')]['id']}})['then'](handleEntityNotFound(_0x50a84a,null))[_0x62bf('0x27')](saveUpdates(_0x2e8ffc[_0x62bf('0x4b')],null))[_0x62bf('0x27')](respondWithResult(_0x50a84a,null))[_0x62bf('0x45')](handleError(_0x50a84a,null));};exports[_0x62bf('0x26')]=function(_0x57b129,_0x4edfdd){return db[_0x62bf('0x2d')][_0x62bf('0x49')]({'where':{'id':_0x57b129[_0x62bf('0x47')]['id']}})[_0x62bf('0x27')](handleEntityNotFound(_0x4edfdd,null))['then'](removeEntity(_0x4edfdd,null))['catch'](handleError(_0x4edfdd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 2c0c933..4a27308 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 _0x2ea1=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util'];(function(_0x237815,_0x1ef2b0){var _0x5498ee=function(_0x5d0f6e){while(--_0x5d0f6e){_0x237815['push'](_0x237815['shift']());}};_0x5498ee(++_0x1ef2b0);}(_0x2ea1,0xca));var _0x12ea=function(_0x11f833,_0x1dde59){_0x11f833=_0x11f833-0x0;var _0x2981f7=_0x2ea1[_0x11f833];return _0x2981f7;};'use strict';var _=require(_0x12ea('0x0'));var util=require(_0x12ea('0x1'));var logger=require(_0x12ea('0x2'))(_0x12ea('0x3'));var moment=require(_0x12ea('0x4'));var BPromise=require(_0x12ea('0x5'));var rp=require(_0x12ea('0x6'));var fs=require('fs');var path=require(_0x12ea('0x7'));var rimraf=require('rimraf');var config=require(_0x12ea('0x8'));var attributes=require(_0x12ea('0x9'));module[_0x12ea('0xa')]=function(_0x551f0b,_0x132217){return _0x551f0b[_0x12ea('0xb')](_0x12ea('0xc'),attributes,{'tableName':_0x12ea('0xd'),'paranoid':![],'indexes':[{'name':_0x12ea('0xe'),'fields':[_0x12ea('0xf'),_0x12ea('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x337f=['bluebird','request-promise','rimraf','../../config/environment','exports','FreshsalesField','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x229492,_0x1bfa67){var _0x72d61=function(_0x23fe76){while(--_0x23fe76){_0x229492['push'](_0x229492['shift']());}};_0x72d61(++_0x1bfa67);}(_0x337f,0x11c));var _0xf337=function(_0x2240d8,_0x413b9f){_0x2240d8=_0x2240d8-0x0;var _0x12509f=_0x337f[_0x2240d8];return _0x12509f;};'use strict';var _=require(_0xf337('0x0'));var util=require(_0xf337('0x1'));var logger=require(_0xf337('0x2'))('api');var moment=require(_0xf337('0x3'));var BPromise=require(_0xf337('0x4'));var rp=require(_0xf337('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf337('0x6'));var config=require(_0xf337('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xf337('0x8')]=function(_0x485b2a,_0x4580a3){return _0x485b2a['define'](_0xf337('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xf337('0xa'),_0xf337('0xb')],'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 616b6c8..10c7279 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 _0x7a54=['info','FreshsalesField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x40cd36,_0x359252){_0x40cd36=_0x40cd36-0x0;var _0x51f876=_0x7a54[_0x40cd36];return _0x51f876;};'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')]('FreshsalesField,\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 _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0xc5a53c,_0xf6683c){var _0x36b0b5=function(_0x5470a6){while(--_0x5470a6){_0xc5a53c['push'](_0xc5a53c['shift']());}};_0x36b0b5(++_0xf6683c);}(_0x4c60,0xc1));var _0x04c6=function(_0x2fde93,_0xd12b85){_0x2fde93=_0x2fde93-0x0;var _0x1cdfc6=_0x4c60[_0x2fde93];return _0x1cdfc6;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 7537f57..e6bfff8 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(_0x47dbc4,_0x28cc6f){var _0x185e1d=function(_0x3a215a){while(--_0x3a215a){_0x47dbc4['push'](_0x47dbc4['shift']());}};_0x185e1d(++_0x28cc6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 _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(_0x5b551e,_0x540b10){var _0x499ebd=function(_0x453050){while(--_0x453050){_0x5b551e['push'](_0x5b551e['shift']());}};_0x499ebd(++_0x540b10);}(_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/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 8705ac4..0d383f4 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 _0xf7d9=['sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x1a3d07,_0x105a71){var _0xd0058a=function(_0x213e53){while(--_0x213e53){_0x1a3d07['push'](_0x1a3d07['shift']());}};_0xd0058a(++_0x105a71);}(_0xf7d9,0x122));var _0x9f7d=function(_0xb9dedd,_0x1b88d0){_0xb9dedd=_0xb9dedd-0x0;var _0x229d73=_0xf7d9[_0xb9dedd];return _0x229d73;};'use strict';var Sequelize=require(_0x9f7d('0x0'));module[_0x9f7d('0x1')]={'name':{'type':Sequelize[_0x9f7d('0x2')]},'description':{'type':Sequelize[_0x9f7d('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x9f7d('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f7d('0x2')]},'clientSecret':{'type':Sequelize[_0x9f7d('0x2')]},'securityToken':{'type':Sequelize[_0x9f7d('0x2')]},'serverUrl':{'type':Sequelize[_0x9f7d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9f7d('0x3')]('integrationTab','newTab'),'defaultValue':_0x9f7d('0x4')}}; \ No newline at end of file +var _0xccef=['username','integrationTab','newTab','exports','STRING'];(function(_0x45ee67,_0x4bdfe4){var _0x3f9824=function(_0x5f328c){while(--_0x5f328c){_0x45ee67['push'](_0x45ee67['shift']());}};_0x3f9824(++_0x4bdfe4);}(_0xccef,0x1d4));var _0xfcce=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xccef[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xfcce('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfcce('0x1')]},'username':{'type':Sequelize[_0xfcce('0x1')],'unique':_0xfcce('0x2')},'remoteUri':{'type':Sequelize[_0xfcce('0x1')]},'password':{'type':Sequelize[_0xfcce('0x1')]},'clientId':{'type':Sequelize[_0xfcce('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xfcce('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfcce('0x3'),_0xfcce('0x4')),'defaultValue':_0xfcce('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 07c4678..6ac9097 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 _0xb653=['fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','getConfigurations','findOne','addConfiguration','AccountId','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Subjects','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','includes','label','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','SalesforceAccount','rawAttributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb653,0x1bc));var _0x3b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb653[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3b65('0x0'));var rimraf=require(_0x3b65('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3b65('0x2'));var Mustache=require(_0x3b65('0x3'));var util=require(_0x3b65('0x4'));var path=require(_0x3b65('0x5'));var sox=require(_0x3b65('0x6'));var csv=require(_0x3b65('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b65('0x8'));var _=require(_0x3b65('0x9'));var squel=require('squel');var crypto=require(_0x3b65('0xa'));var jsforce=require(_0x3b65('0xb'));var deskjs=require(_0x3b65('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b65('0xd'));var Redis=require(_0x3b65('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3b65('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b65('0x10'));var logger=require('../../config/logger')(_0x3b65('0x11'));var utils=require(_0x3b65('0x12'));var config=require(_0x3b65('0x13'));var licenseUtil=require(_0x3b65('0x14'));var db=require(_0x3b65('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2465e3,_0x18dee7){_0x18dee7=_0x18dee7||0xcc;return function(_0x5ac6bc){if(_0x5ac6bc){return _0x2465e3['sendStatus'](_0x18dee7);}return _0x2465e3[_0x3b65('0x16')](_0x18dee7)[_0x3b65('0x17')]();};}function respondWithResult(_0x544769,_0x512558){_0x512558=_0x512558||0xc8;return function(_0xdb0c6f){if(_0xdb0c6f){return _0x544769[_0x3b65('0x16')](_0x512558)[_0x3b65('0x18')](_0xdb0c6f);}};}function respondWithFilteredResult(_0x4d8727,_0x12a04a){return function(_0x3ab18e){if(_0x3ab18e){var _0x1b1336=typeof _0x12a04a[_0x3b65('0x19')]===_0x3b65('0x1a')&&typeof _0x12a04a[_0x3b65('0x1b')]==='undefined';var _0x3ad3b2=_0x3ab18e[_0x3b65('0x1c')];var _0x48e1ca=_0x1b1336?0x0:_0x12a04a[_0x3b65('0x19')];var _0x90ee14=_0x1b1336?_0x3ab18e[_0x3b65('0x1c')]:_0x12a04a[_0x3b65('0x19')]+_0x12a04a[_0x3b65('0x1b')];var _0x377aef;if(_0x90ee14>=_0x3ad3b2){_0x90ee14=_0x3ad3b2;_0x377aef=0xc8;}else{_0x377aef=0xce;}_0x4d8727['status'](_0x377aef);return _0x4d8727[_0x3b65('0x1d')](_0x3b65('0x1e'),_0x48e1ca+'-'+_0x90ee14+'/'+_0x3ad3b2)[_0x3b65('0x18')](_0x3ab18e);}return null;};}function patchUpdates(_0x3e4c66){return function(_0x2b17a9){try{jsonpatch[_0x3b65('0x1f')](_0x2b17a9,_0x3e4c66,!![]);}catch(_0x3a5844){return BPromise[_0x3b65('0x20')](_0x3a5844);}return _0x2b17a9[_0x3b65('0x21')]();};}function saveUpdates(_0x4b93d7,_0x1471b5){return function(_0x369396){if(_0x369396){return _0x369396[_0x3b65('0x22')](_0x4b93d7)[_0x3b65('0x23')](function(_0x87635b){return _0x87635b;});}return null;};}function removeEntity(_0x2879fe,_0x253749){return function(_0x13f9ff){if(_0x13f9ff){return _0x13f9ff[_0x3b65('0x24')]()[_0x3b65('0x23')](function(){_0x2879fe[_0x3b65('0x16')](0xcc)[_0x3b65('0x17')]();});}};}function handleEntityNotFound(_0x16339f,_0x398214){return function(_0x2a90be){if(!_0x2a90be){_0x16339f[_0x3b65('0x25')](0x194);}return _0x2a90be;};}function handleError(_0x4c3522,_0x434661){_0x434661=_0x434661||0x1f4;return function(_0x45fb70){logger[_0x3b65('0x26')](_0x45fb70['stack']);if(_0x45fb70['name']){delete _0x45fb70[_0x3b65('0x27')];}_0x4c3522['status'](_0x434661)['send'](_0x45fb70);};}exports[_0x3b65('0x28')]=function(_0x4e6928,_0x118a7c){var _0x49aa24={},_0x448251={},_0x310413={'count':0x0,'rows':[]};var _0x4af8bd=_[_0x3b65('0x29')](db[_0x3b65('0x2a')][_0x3b65('0x2b')],function(_0x4cc36d){return{'name':_0x4cc36d[_0x3b65('0x2c')],'type':_0x4cc36d[_0x3b65('0x2d')][_0x3b65('0x2e')]};});_0x448251[_0x3b65('0x2f')]=_[_0x3b65('0x29')](_0x4af8bd,_0x3b65('0x27'));_0x448251[_0x3b65('0x30')]=_[_0x3b65('0x31')](_0x4e6928[_0x3b65('0x30')]);_0x448251['filters']=_[_0x3b65('0x32')](_0x448251[_0x3b65('0x2f')],_0x448251['query']);_0x49aa24['attributes']=_[_0x3b65('0x32')](_0x448251[_0x3b65('0x2f')],qs[_0x3b65('0x33')](_0x4e6928['query'][_0x3b65('0x33')]));_0x49aa24['attributes']=_0x49aa24['attributes'][_0x3b65('0x34')]?_0x49aa24[_0x3b65('0x35')]:_0x448251[_0x3b65('0x2f')];if(!_0x4e6928['query'][_0x3b65('0x36')](_0x3b65('0x37'))){_0x49aa24[_0x3b65('0x1b')]=qs[_0x3b65('0x1b')](_0x4e6928[_0x3b65('0x30')][_0x3b65('0x1b')]);_0x49aa24['offset']=qs[_0x3b65('0x19')](_0x4e6928[_0x3b65('0x30')][_0x3b65('0x19')]);}_0x49aa24['order']=qs[_0x3b65('0x38')](_0x4e6928['query']['sort']);_0x49aa24[_0x3b65('0x39')]=qs[_0x3b65('0x3a')](_['pick'](_0x4e6928[_0x3b65('0x30')],_0x448251['filters']),_0x4af8bd);if(_0x4e6928[_0x3b65('0x30')][_0x3b65('0x3b')]){_0x49aa24[_0x3b65('0x39')]=_['merge'](_0x49aa24[_0x3b65('0x39')],{'$or':_[_0x3b65('0x29')](_0x4af8bd,function(_0x429180){if(_0x429180['type']!==_0x3b65('0x3c')){var _0x1e00a4={};_0x1e00a4[_0x429180[_0x3b65('0x27')]]={'$like':'%'+_0x4e6928[_0x3b65('0x30')]['filter']+'%'};return _0x1e00a4;}})});}_0x49aa24=_['merge']({},_0x49aa24,_0x4e6928[_0x3b65('0x3d')]);var _0x5bb100={'where':_0x49aa24[_0x3b65('0x39')]};return db['SalesforceAccount'][_0x3b65('0x1c')](_0x5bb100)['then'](function(_0x2002ca){_0x310413[_0x3b65('0x1c')]=_0x2002ca;if(_0x4e6928[_0x3b65('0x30')][_0x3b65('0x3e')]){_0x49aa24[_0x3b65('0x3f')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x3b65('0x40')](_0x49aa24);})[_0x3b65('0x23')](function(_0x2d9d95){_0x310413[_0x3b65('0x41')]=_0x2d9d95;return _0x310413;})[_0x3b65('0x23')](respondWithFilteredResult(_0x118a7c,_0x49aa24))['catch'](handleError(_0x118a7c,null));};exports[_0x3b65('0x42')]=function(_0x49921f,_0x2d3fdc){var _0x8a7ca7={'raw':![],'where':{'id':_0x49921f[_0x3b65('0x43')]['id']}},_0x33ebf9={};_0x33ebf9[_0x3b65('0x2f')]=_[_0x3b65('0x31')](db['SalesforceAccount'][_0x3b65('0x2b')]);_0x33ebf9[_0x3b65('0x30')]=_[_0x3b65('0x31')](_0x49921f[_0x3b65('0x30')]);_0x33ebf9[_0x3b65('0x3a')]=_['intersection'](_0x33ebf9['model'],_0x33ebf9['query']);_0x8a7ca7[_0x3b65('0x35')]=_[_0x3b65('0x32')](_0x33ebf9['model'],qs[_0x3b65('0x33')](_0x49921f[_0x3b65('0x30')]['fields']));_0x8a7ca7['attributes']=_0x8a7ca7[_0x3b65('0x35')][_0x3b65('0x34')]?_0x8a7ca7[_0x3b65('0x35')]:_0x33ebf9['model'];if(_0x49921f['query']['includeAll']){_0x8a7ca7[_0x3b65('0x3f')]=[{'all':!![]}];}_0x8a7ca7=_[_0x3b65('0x44')]({},_0x8a7ca7,_0x49921f[_0x3b65('0x3d')]);return db['SalesforceAccount'][_0x3b65('0x45')](_0x8a7ca7)[_0x3b65('0x23')](handleEntityNotFound(_0x2d3fdc,null))['then'](respondWithResult(_0x2d3fdc,null))[_0x3b65('0x46')](handleError(_0x2d3fdc,null));};exports['create']=function(_0x4794e3,_0x584680){return db['SalesforceAccount'][_0x3b65('0x47')](_0x4794e3[_0x3b65('0x48')],{})[_0x3b65('0x23')](respondWithResult(_0x584680,0xc9))[_0x3b65('0x46')](handleError(_0x584680,null));};exports['update']=function(_0x4f02ef,_0x4f7557){if(_0x4f02ef[_0x3b65('0x48')]['id']){delete _0x4f02ef[_0x3b65('0x48')]['id'];}return db[_0x3b65('0x2a')]['find']({'where':{'id':_0x4f02ef[_0x3b65('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f7557,null))[_0x3b65('0x23')](saveUpdates(_0x4f02ef[_0x3b65('0x48')],null))[_0x3b65('0x23')](respondWithResult(_0x4f7557,null))[_0x3b65('0x46')](handleError(_0x4f7557,null));};exports[_0x3b65('0x24')]=function(_0x196dc8,_0x2f9614){return db[_0x3b65('0x2a')][_0x3b65('0x45')]({'where':{'id':_0x196dc8[_0x3b65('0x43')]['id']}})[_0x3b65('0x23')](handleEntityNotFound(_0x2f9614,null))[_0x3b65('0x23')](removeEntity(_0x2f9614,null))[_0x3b65('0x46')](handleError(_0x2f9614,null));};exports[_0x3b65('0x49')]=function(_0x2ae0ef,_0x4da74a,_0xf79ed7){var _0x17d9d5={};var _0x2da3ce={};var _0x4fc102;var _0x3339a5;return db[_0x3b65('0x2a')][_0x3b65('0x4a')]({'where':{'id':_0x2ae0ef[_0x3b65('0x43')]['id']}})['then'](handleEntityNotFound(_0x4da74a,null))['then'](function(_0x475a9c){if(_0x475a9c){_0x4fc102=_0x475a9c;_0x2da3ce[_0x3b65('0x2f')]=_[_0x3b65('0x31')](db['SalesforceConfiguration'][_0x3b65('0x2b')]);_0x2da3ce['query']=_[_0x3b65('0x31')](_0x2ae0ef[_0x3b65('0x30')]);_0x2da3ce['filters']=_[_0x3b65('0x32')](_0x2da3ce[_0x3b65('0x2f')],_0x2da3ce['query']);_0x17d9d5['attributes']=_[_0x3b65('0x32')](_0x2da3ce[_0x3b65('0x2f')],qs[_0x3b65('0x33')](_0x2ae0ef[_0x3b65('0x30')][_0x3b65('0x33')]));_0x17d9d5['attributes']=_0x17d9d5[_0x3b65('0x35')][_0x3b65('0x34')]?_0x17d9d5['attributes']:_0x2da3ce[_0x3b65('0x2f')];_0x17d9d5['order']=qs[_0x3b65('0x38')](_0x2ae0ef[_0x3b65('0x30')][_0x3b65('0x38')]);_0x17d9d5[_0x3b65('0x39')]=qs[_0x3b65('0x3a')](_['pick'](_0x2ae0ef[_0x3b65('0x30')],_0x2da3ce[_0x3b65('0x3a')]));if(_0x2ae0ef['query']['filter']){_0x17d9d5[_0x3b65('0x39')]=_[_0x3b65('0x44')](_0x17d9d5[_0x3b65('0x39')],{'$or':_[_0x3b65('0x29')](_0x17d9d5[_0x3b65('0x35')],function(_0x36b499){var _0x3532a2={};_0x3532a2[_0x36b499]={'$like':'%'+_0x2ae0ef[_0x3b65('0x30')][_0x3b65('0x3b')]+'%'};return _0x3532a2;})});}_0x17d9d5=_[_0x3b65('0x44')]({},_0x17d9d5,_0x2ae0ef['options']);return _0x4fc102['getConfigurations'](_0x17d9d5);}})[_0x3b65('0x23')](function(_0x8531){if(_0x8531){_0x3339a5=_0x8531[_0x3b65('0x34')];if(!_0x2ae0ef[_0x3b65('0x30')][_0x3b65('0x36')]('nolimit')){_0x17d9d5[_0x3b65('0x1b')]=qs[_0x3b65('0x1b')](_0x2ae0ef[_0x3b65('0x30')][_0x3b65('0x1b')]);_0x17d9d5[_0x3b65('0x19')]=qs[_0x3b65('0x19')](_0x2ae0ef[_0x3b65('0x30')][_0x3b65('0x19')]);}return _0x4fc102['getConfigurations'](_0x17d9d5);}})[_0x3b65('0x23')](function(_0x15eb21){if(_0x15eb21){return _0x15eb21?{'count':_0x3339a5,'rows':_0x15eb21}:null;}})[_0x3b65('0x23')](respondWithResult(_0x4da74a,null))[_0x3b65('0x46')](handleError(_0x4da74a,null));};exports[_0x3b65('0x4b')]=function(_0x476508,_0xfa4f3e,_0x5cc6e6){if(_0x476508['body']['id']){delete _0x476508[_0x3b65('0x48')]['id'];}return db[_0x3b65('0x2a')][_0x3b65('0x4a')]({'where':{'id':_0x476508[_0x3b65('0x43')]['id']}})['then'](handleEntityNotFound(_0xfa4f3e,null))[_0x3b65('0x23')](function(_0x27b221){if(_0x27b221){_0x476508['body'][_0x3b65('0x4c')]=_0x27b221['id'];_0x476508[_0x3b65('0x48')]['Subjects']=integrations['getSubjects'](_0x476508[_0x3b65('0x48')][_0x3b65('0x4d')],_0x476508[_0x3b65('0x48')][_0x3b65('0x2d')]);_0x476508[_0x3b65('0x48')][_0x3b65('0x4e')]=integrations[_0x3b65('0x4f')](_0x476508[_0x3b65('0x48')][_0x3b65('0x4d')],_0x476508[_0x3b65('0x48')][_0x3b65('0x2d')]);return db[_0x3b65('0x50')][_0x3b65('0x47')](_0x476508['body'],{'include':[{'model':db[_0x3b65('0x51')],'as':_0x3b65('0x52')},{'model':db[_0x3b65('0x51')],'as':_0x3b65('0x4e')}]});}return null;})[_0x3b65('0x23')](respondWithResult(_0xfa4f3e,null))['catch'](handleError(_0xfa4f3e,null));};exports[_0x3b65('0x53')]=function(_0xc8a675,_0x7b6a8f,_0x50e606){var _0x330716;var _0x9e5c61='';var _0xbdfd09=_0x3b65('0x54');return db[_0x3b65('0x2a')][_0x3b65('0x4a')]({'where':{'id':_0xc8a675[_0x3b65('0x43')]['id']},'attributes':['id',_0x3b65('0x55'),'clientId',_0x3b65('0x56'),_0x3b65('0x57'),_0x3b65('0x58'),_0x3b65('0x59')]})['then'](handleEntityNotFound(_0x7b6a8f,null))['then'](function(_0x11f25f){if(_0x11f25f){_0x9e5c61=_0x11f25f[_0x3b65('0x55')];var _0x20bef3=_0x9e5c61[_0x3b65('0x5a')](-0x1);if(_0x20bef3==='/'){_0x9e5c61=_0x9e5c61['substring'](0x0,_0x9e5c61[_0x3b65('0x5b')](_0x20bef3));}_0x330716=new jsforce[(_0x3b65('0x5c'))]({'oauth2':{'loginUrl':_0x9e5c61,'clientId':_0x11f25f['clientId'],'clientSecret':_0x11f25f[_0x3b65('0x56')]}});return _0x330716[_0x3b65('0x5d')](_0x11f25f['username'],_0x11f25f[_0x3b65('0x58')][_0x3b65('0x5e')](_0x11f25f[_0x3b65('0x59')]));}})[_0x3b65('0x23')](function(_0x3df701){if(_0x3df701){if(!_[_0x3b65('0x5f')](_0xc8a675[_0x3b65('0x30')][_0x3b65('0x60')])){_0xbdfd09=_0xc8a675[_0x3b65('0x30')]['ticketType'];}return _0x330716[_0x3b65('0x61')](_0xbdfd09)['describe']();}})['then'](function(_0x29934a){var _0x23f00a=[_0x3b65('0x62'),_0x3b65('0x63'),_0x3b65('0x64'),_0x3b65('0x65'),_0x3b65('0x66'),_0x3b65('0x67')];var _0x4f8161=[_0x3b65('0x68'),'int',_0x3b65('0x69'),_0x3b65('0x6a'),_0x3b65('0x6b'),'textarea','phone'];if(_0x29934a){_['remove'](_0x29934a[_0x3b65('0x33')],function(_0x4407d5){return _0x23f00a[_0x3b65('0x6c')](_0x4407d5[_0x3b65('0x27')])||!_0x4f8161[_0x3b65('0x6c')](_0x4407d5[_0x3b65('0x2d')]);});return{'count':_0x29934a['fields']['length'],'rows':_[_0x3b65('0x29')](_0x29934a[_0x3b65('0x33')],function(_0xcfac75){return{'id':_0xcfac75[_0x3b65('0x27')],'name':_0xcfac75[_0x3b65('0x6d')],'custom':_0xcfac75['custom'],'options':_0xcfac75[_0x3b65('0x6e')][_0x3b65('0x34')]>0x0?_[_0x3b65('0x29')](_0xcfac75[_0x3b65('0x6e')],function(_0x22edde){return{'name':_0x22edde[_0x3b65('0x6d')],'value':_0x22edde[_0x3b65('0x6f')]};}):_0xcfac75[_0x3b65('0x2d')]==_0x3b65('0x6a')?[{'name':_0x3b65('0x70'),'value':_0x3b65('0x71')},{'name':_0x3b65('0x72'),'value':_0x3b65('0x73')}]:[]};})};}})[_0x3b65('0x23')](respondWithResult(_0x7b6a8f,null))[_0x3b65('0x46')](function(_0xcd8fef){var _0x1714bd=_0xc8a675[_0x3b65('0x30')][_0x3b65('0x74')]?0x1f4:_0xcd8fef[_0x3b65('0x75')]||0x1f4;logger[_0x3b65('0x26')](_0x3b65('0x76'),_0x3b65('0x53'),_0x1714bd,JSON[_0x3b65('0x77')](_0xcd8fef));delete _0xcd8fef[_0x3b65('0x27')];if(_0x1714bd===0x191){_0x1714bd=0x190;}_0x7b6a8f[_0x3b65('0x16')](_0x1714bd)[_0x3b65('0x78')](_0xc8a675[_0x3b65('0x30')]['test']?{'message':_0x3b65('0x79'),'statusCode':_0xcd8fef[_0x3b65('0x75')]}:_0xcd8fef);});}; \ No newline at end of file +var _0x096b=['type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','filter','merge','options','SalesforceAccount','count','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','destroy','getConfigurations','SalesforceConfiguration','order','pick','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','remoteUri','clientSecret','password','securityToken','substring','clientId','login','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','int','picklist','boolean','email','phone','remove','includes','label','custom','picklistValues','value','True','true','False','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','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','json','offset','undefined','limit','set','apply','save','update','then','sendStatus','stack','name','send','index','fieldName'];(function(_0x5b1cb2,_0x2f1f4a){var _0x590bf4=function(_0x80216b){while(--_0x80216b){_0x5b1cb2['push'](_0x5b1cb2['shift']());}};_0x590bf4(++_0x2f1f4a);}(_0x096b,0x13e));var _0xb096=function(_0xf0ea2b,_0x54c78e){_0xf0ea2b=_0xf0ea2b-0x0;var _0x2ce2d9=_0x096b[_0xf0ea2b];return _0x2ce2d9;};'use strict';var emlformat=require(_0xb096('0x0'));var rimraf=require(_0xb096('0x1'));var zipdir=require(_0xb096('0x2'));var jsonpatch=require(_0xb096('0x3'));var rp=require(_0xb096('0x4'));var moment=require('moment');var BPromise=require(_0xb096('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb096('0x6'));var sox=require(_0xb096('0x7'));var csv=require('to-csv');var ejs=require(_0xb096('0x8'));var fs=require('fs');var fs_extra=require(_0xb096('0x9'));var _=require(_0xb096('0xa'));var squel=require(_0xb096('0xb'));var crypto=require(_0xb096('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb096('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb096('0xe'));var authService=require(_0xb096('0xf'));var qs=require(_0xb096('0x10'));var as=require(_0xb096('0x11'));var hardwareService=require(_0xb096('0x12'));var logger=require(_0xb096('0x13'))(_0xb096('0x14'));var utils=require(_0xb096('0x15'));var config=require(_0xb096('0x16'));var licenseUtil=require(_0xb096('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb096('0x18'));function respondWithStatusCode(_0x8cb8a8,_0x22ec75){_0x22ec75=_0x22ec75||0xcc;return function(_0x3c890e){if(_0x3c890e){return _0x8cb8a8['sendStatus'](_0x22ec75);}return _0x8cb8a8[_0xb096('0x19')](_0x22ec75)[_0xb096('0x1a')]();};}function respondWithResult(_0x3b0414,_0xf81591){_0xf81591=_0xf81591||0xc8;return function(_0x194f0d){if(_0x194f0d){return _0x3b0414['status'](_0xf81591)[_0xb096('0x1b')](_0x194f0d);}};}function respondWithFilteredResult(_0x2e68a5,_0x13df4f){return function(_0x588e1d){if(_0x588e1d){var _0x333e6c=typeof _0x13df4f[_0xb096('0x1c')]===_0xb096('0x1d')&&typeof _0x13df4f['limit']===_0xb096('0x1d');var _0x1372c8=_0x588e1d['count'];var _0x5a2452=_0x333e6c?0x0:_0x13df4f[_0xb096('0x1c')];var _0x587558=_0x333e6c?_0x588e1d['count']:_0x13df4f[_0xb096('0x1c')]+_0x13df4f[_0xb096('0x1e')];var _0x14aafa;if(_0x587558>=_0x1372c8){_0x587558=_0x1372c8;_0x14aafa=0xc8;}else{_0x14aafa=0xce;}_0x2e68a5[_0xb096('0x19')](_0x14aafa);return _0x2e68a5[_0xb096('0x1f')]('Content-Range',_0x5a2452+'-'+_0x587558+'/'+_0x1372c8)['json'](_0x588e1d);}return null;};}function patchUpdates(_0x4cf5c1){return function(_0x3a5199){try{jsonpatch[_0xb096('0x20')](_0x3a5199,_0x4cf5c1,!![]);}catch(_0x5d4d2c){return BPromise['reject'](_0x5d4d2c);}return _0x3a5199[_0xb096('0x21')]();};}function saveUpdates(_0x3d6bab,_0x1349d0){return function(_0xd97490){if(_0xd97490){return _0xd97490[_0xb096('0x22')](_0x3d6bab)[_0xb096('0x23')](function(_0x85b451){return _0x85b451;});}return null;};}function removeEntity(_0x4fdd34,_0x10dc62){return function(_0x44dfd8){if(_0x44dfd8){return _0x44dfd8['destroy']()[_0xb096('0x23')](function(){_0x4fdd34[_0xb096('0x19')](0xcc)[_0xb096('0x1a')]();});}};}function handleEntityNotFound(_0x5e7509,_0x5beab7){return function(_0x46dd2e){if(!_0x46dd2e){_0x5e7509[_0xb096('0x24')](0x194);}return _0x46dd2e;};}function handleError(_0x3cd013,_0x1c34a1){_0x1c34a1=_0x1c34a1||0x1f4;return function(_0x2ae975){logger['error'](_0x2ae975[_0xb096('0x25')]);if(_0x2ae975[_0xb096('0x26')]){delete _0x2ae975[_0xb096('0x26')];}_0x3cd013[_0xb096('0x19')](_0x1c34a1)[_0xb096('0x27')](_0x2ae975);};}exports[_0xb096('0x28')]=function(_0x44673d,_0x58ce1b){var _0x3e86c8={},_0x11d204={},_0x32a231={'count':0x0,'rows':[]};var _0x46d88e=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x13203c){return{'name':_0x13203c[_0xb096('0x29')],'type':_0x13203c[_0xb096('0x2a')][_0xb096('0x2b')]};});_0x11d204[_0xb096('0x2c')]=_[_0xb096('0x2d')](_0x46d88e,_0xb096('0x26'));_0x11d204[_0xb096('0x2e')]=_[_0xb096('0x2f')](_0x44673d[_0xb096('0x2e')]);_0x11d204[_0xb096('0x30')]=_['intersection'](_0x11d204[_0xb096('0x2c')],_0x11d204['query']);_0x3e86c8[_0xb096('0x31')]=_[_0xb096('0x32')](_0x11d204[_0xb096('0x2c')],qs['fields'](_0x44673d[_0xb096('0x2e')][_0xb096('0x33')]));_0x3e86c8[_0xb096('0x31')]=_0x3e86c8[_0xb096('0x31')]['length']?_0x3e86c8[_0xb096('0x31')]:_0x11d204[_0xb096('0x2c')];if(!_0x44673d['query'][_0xb096('0x34')]('nolimit')){_0x3e86c8['limit']=qs[_0xb096('0x1e')](_0x44673d[_0xb096('0x2e')][_0xb096('0x1e')]);_0x3e86c8[_0xb096('0x1c')]=qs[_0xb096('0x1c')](_0x44673d[_0xb096('0x2e')][_0xb096('0x1c')]);}_0x3e86c8['order']=qs[_0xb096('0x35')](_0x44673d[_0xb096('0x2e')]['sort']);_0x3e86c8[_0xb096('0x36')]=qs[_0xb096('0x30')](_['pick'](_0x44673d[_0xb096('0x2e')],_0x11d204[_0xb096('0x30')]),_0x46d88e);if(_0x44673d[_0xb096('0x2e')][_0xb096('0x37')]){_0x3e86c8[_0xb096('0x36')]=_['merge'](_0x3e86c8[_0xb096('0x36')],{'$or':_[_0xb096('0x2d')](_0x46d88e,function(_0x5b1b41){if(_0x5b1b41[_0xb096('0x2a')]!=='VIRTUAL'){var _0x556ea8={};_0x556ea8[_0x5b1b41[_0xb096('0x26')]]={'$like':'%'+_0x44673d['query'][_0xb096('0x37')]+'%'};return _0x556ea8;}})});}_0x3e86c8=_[_0xb096('0x38')]({},_0x3e86c8,_0x44673d[_0xb096('0x39')]);var _0x5b82a4={'where':_0x3e86c8[_0xb096('0x36')]};return db[_0xb096('0x3a')][_0xb096('0x3b')](_0x5b82a4)[_0xb096('0x23')](function(_0x55cd5f){_0x32a231['count']=_0x55cd5f;if(_0x44673d[_0xb096('0x2e')][_0xb096('0x3c')]){_0x3e86c8[_0xb096('0x3d')]=[{'all':!![]}];}return db[_0xb096('0x3a')][_0xb096('0x3e')](_0x3e86c8);})['then'](function(_0x3a15a6){_0x32a231['rows']=_0x3a15a6;return _0x32a231;})[_0xb096('0x23')](respondWithFilteredResult(_0x58ce1b,_0x3e86c8))[_0xb096('0x3f')](handleError(_0x58ce1b,null));};exports[_0xb096('0x40')]=function(_0x243ca1,_0x3eb0c){var _0x1a5835={'raw':![],'where':{'id':_0x243ca1[_0xb096('0x41')]['id']}},_0x579e9b={};_0x579e9b[_0xb096('0x2c')]=_[_0xb096('0x2f')](db[_0xb096('0x3a')][_0xb096('0x42')]);_0x579e9b[_0xb096('0x2e')]=_['keys'](_0x243ca1[_0xb096('0x2e')]);_0x579e9b['filters']=_['intersection'](_0x579e9b[_0xb096('0x2c')],_0x579e9b[_0xb096('0x2e')]);_0x1a5835[_0xb096('0x31')]=_[_0xb096('0x32')](_0x579e9b['model'],qs[_0xb096('0x33')](_0x243ca1[_0xb096('0x2e')][_0xb096('0x33')]));_0x1a5835[_0xb096('0x31')]=_0x1a5835[_0xb096('0x31')][_0xb096('0x43')]?_0x1a5835[_0xb096('0x31')]:_0x579e9b[_0xb096('0x2c')];if(_0x243ca1['query'][_0xb096('0x3c')]){_0x1a5835[_0xb096('0x3d')]=[{'all':!![]}];}_0x1a5835=_[_0xb096('0x38')]({},_0x1a5835,_0x243ca1[_0xb096('0x39')]);return db['SalesforceAccount'][_0xb096('0x44')](_0x1a5835)[_0xb096('0x23')](handleEntityNotFound(_0x3eb0c,null))['then'](respondWithResult(_0x3eb0c,null))[_0xb096('0x3f')](handleError(_0x3eb0c,null));};exports[_0xb096('0x45')]=function(_0x5dc7d5,_0x41de78){return db['SalesforceAccount'][_0xb096('0x45')](_0x5dc7d5[_0xb096('0x46')],{})['then'](respondWithResult(_0x41de78,0xc9))[_0xb096('0x3f')](handleError(_0x41de78,null));};exports['update']=function(_0x14585d,_0x136515){if(_0x14585d[_0xb096('0x46')]['id']){delete _0x14585d['body']['id'];}return db['SalesforceAccount'][_0xb096('0x44')]({'where':{'id':_0x14585d[_0xb096('0x41')]['id']}})['then'](handleEntityNotFound(_0x136515,null))[_0xb096('0x23')](saveUpdates(_0x14585d[_0xb096('0x46')],null))[_0xb096('0x23')](respondWithResult(_0x136515,null))['catch'](handleError(_0x136515,null));};exports[_0xb096('0x47')]=function(_0x5ade53,_0x1e77fc){return db['SalesforceAccount'][_0xb096('0x44')]({'where':{'id':_0x5ade53[_0xb096('0x41')]['id']}})[_0xb096('0x23')](handleEntityNotFound(_0x1e77fc,null))[_0xb096('0x23')](removeEntity(_0x1e77fc,null))[_0xb096('0x3f')](handleError(_0x1e77fc,null));};exports[_0xb096('0x48')]=function(_0x1e8434,_0x3c91bc,_0x1d6e16){var _0xddf287={};var _0x2fe84c={};var _0x115dc9;var _0x29aaa4;return db[_0xb096('0x3a')]['findOne']({'where':{'id':_0x1e8434[_0xb096('0x41')]['id']}})[_0xb096('0x23')](handleEntityNotFound(_0x3c91bc,null))[_0xb096('0x23')](function(_0x4637a4){if(_0x4637a4){_0x115dc9=_0x4637a4;_0x2fe84c['model']=_[_0xb096('0x2f')](db[_0xb096('0x49')][_0xb096('0x42')]);_0x2fe84c[_0xb096('0x2e')]=_['keys'](_0x1e8434[_0xb096('0x2e')]);_0x2fe84c[_0xb096('0x30')]=_['intersection'](_0x2fe84c[_0xb096('0x2c')],_0x2fe84c[_0xb096('0x2e')]);_0xddf287[_0xb096('0x31')]=_[_0xb096('0x32')](_0x2fe84c[_0xb096('0x2c')],qs['fields'](_0x1e8434[_0xb096('0x2e')][_0xb096('0x33')]));_0xddf287[_0xb096('0x31')]=_0xddf287[_0xb096('0x31')][_0xb096('0x43')]?_0xddf287['attributes']:_0x2fe84c[_0xb096('0x2c')];_0xddf287[_0xb096('0x4a')]=qs['sort'](_0x1e8434[_0xb096('0x2e')][_0xb096('0x35')]);_0xddf287[_0xb096('0x36')]=qs['filters'](_[_0xb096('0x4b')](_0x1e8434[_0xb096('0x2e')],_0x2fe84c[_0xb096('0x30')]));if(_0x1e8434[_0xb096('0x2e')]['filter']){_0xddf287['where']=_[_0xb096('0x38')](_0xddf287[_0xb096('0x36')],{'$or':_[_0xb096('0x2d')](_0xddf287[_0xb096('0x31')],function(_0x1521d4){var _0xd8d8fb={};_0xd8d8fb[_0x1521d4]={'$like':'%'+_0x1e8434[_0xb096('0x2e')]['filter']+'%'};return _0xd8d8fb;})});}_0xddf287=_[_0xb096('0x38')]({},_0xddf287,_0x1e8434[_0xb096('0x39')]);return _0x115dc9['getConfigurations'](_0xddf287);}})[_0xb096('0x23')](function(_0x2eff4b){if(_0x2eff4b){_0x29aaa4=_0x2eff4b[_0xb096('0x43')];if(!_0x1e8434['query'][_0xb096('0x34')](_0xb096('0x4c'))){_0xddf287[_0xb096('0x1e')]=qs[_0xb096('0x1e')](_0x1e8434[_0xb096('0x2e')][_0xb096('0x1e')]);_0xddf287['offset']=qs[_0xb096('0x1c')](_0x1e8434['query'][_0xb096('0x1c')]);}return _0x115dc9[_0xb096('0x48')](_0xddf287);}})[_0xb096('0x23')](function(_0x5647f8){if(_0x5647f8){return _0x5647f8?{'count':_0x29aaa4,'rows':_0x5647f8}:null;}})['then'](respondWithResult(_0x3c91bc,null))[_0xb096('0x3f')](handleError(_0x3c91bc,null));};exports[_0xb096('0x4d')]=function(_0x43c747,_0x3117f7,_0x3955a8){if(_0x43c747[_0xb096('0x46')]['id']){delete _0x43c747['body']['id'];}return db['SalesforceAccount'][_0xb096('0x4e')]({'where':{'id':_0x43c747['params']['id']}})[_0xb096('0x23')](handleEntityNotFound(_0x3117f7,null))[_0xb096('0x23')](function(_0x1a98eb){if(_0x1a98eb){_0x43c747[_0xb096('0x46')][_0xb096('0x4f')]=_0x1a98eb['id'];_0x43c747[_0xb096('0x46')][_0xb096('0x50')]=integrations[_0xb096('0x51')](_0x43c747[_0xb096('0x46')][_0xb096('0x52')],_0x43c747[_0xb096('0x46')][_0xb096('0x2a')]);_0x43c747[_0xb096('0x46')][_0xb096('0x53')]=integrations[_0xb096('0x54')](_0x43c747[_0xb096('0x46')][_0xb096('0x52')],_0x43c747[_0xb096('0x46')][_0xb096('0x2a')]);return db['SalesforceConfiguration'][_0xb096('0x45')](_0x43c747[_0xb096('0x46')],{'include':[{'model':db[_0xb096('0x55')],'as':_0xb096('0x50')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xb096('0x23')](respondWithResult(_0x3117f7,null))['catch'](handleError(_0x3117f7,null));};exports['getFields']=function(_0x4cc020,_0x4eee66,_0x26f130){var _0x171502;var _0x4882b4='';var _0x59a09f='Task';return db[_0xb096('0x3a')][_0xb096('0x4e')]({'where':{'id':_0x4cc020[_0xb096('0x41')]['id']},'attributes':['id',_0xb096('0x56'),'clientId',_0xb096('0x57'),'username',_0xb096('0x58'),_0xb096('0x59')]})[_0xb096('0x23')](handleEntityNotFound(_0x4eee66,null))[_0xb096('0x23')](function(_0x4a5251){if(_0x4a5251){_0x4882b4=_0x4a5251[_0xb096('0x56')];var _0x2b55a9=_0x4882b4['slice'](-0x1);if(_0x2b55a9==='/'){_0x4882b4=_0x4882b4[_0xb096('0x5a')](0x0,_0x4882b4['lastIndexOf'](_0x2b55a9));}_0x171502=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4882b4,'clientId':_0x4a5251[_0xb096('0x5b')],'clientSecret':_0x4a5251[_0xb096('0x57')]}});return _0x171502[_0xb096('0x5c')](_0x4a5251['username'],_0x4a5251[_0xb096('0x58')]['concat'](_0x4a5251[_0xb096('0x59')]));}})[_0xb096('0x23')](function(_0xeb1b87){if(_0xeb1b87){if(!_['isNil'](_0x4cc020[_0xb096('0x2e')][_0xb096('0x5d')])){_0x59a09f=_0x4cc020['query'][_0xb096('0x5d')];}return _0x171502[_0xb096('0x5e')](_0x59a09f)[_0xb096('0x5f')]();}})['then'](function(_0x393545){var _0x2af64a=[_0xb096('0x60'),_0xb096('0x61'),_0xb096('0x62'),_0xb096('0x63'),_0xb096('0x64'),'Description'];var _0x6ad5d2=['string',_0xb096('0x65'),_0xb096('0x66'),_0xb096('0x67'),_0xb096('0x68'),'textarea',_0xb096('0x69')];if(_0x393545){_[_0xb096('0x6a')](_0x393545[_0xb096('0x33')],function(_0x334c98){return _0x2af64a['includes'](_0x334c98[_0xb096('0x26')])||!_0x6ad5d2[_0xb096('0x6b')](_0x334c98[_0xb096('0x2a')]);});return{'count':_0x393545[_0xb096('0x33')][_0xb096('0x43')],'rows':_['map'](_0x393545[_0xb096('0x33')],function(_0x4e008b){return{'id':_0x4e008b[_0xb096('0x26')],'name':_0x4e008b[_0xb096('0x6c')],'custom':_0x4e008b[_0xb096('0x6d')],'options':_0x4e008b[_0xb096('0x6e')]['length']>0x0?_['map'](_0x4e008b[_0xb096('0x6e')],function(_0x1432aa){return{'name':_0x1432aa[_0xb096('0x6c')],'value':_0x1432aa[_0xb096('0x6f')]};}):_0x4e008b['type']==_0xb096('0x67')?[{'name':_0xb096('0x70'),'value':_0xb096('0x71')},{'name':_0xb096('0x72'),'value':'false'}]:[]};})};}})[_0xb096('0x23')](respondWithResult(_0x4eee66,null))[_0xb096('0x3f')](function(_0x3eb3c2){var _0x5c85ee=_0x4cc020[_0xb096('0x2e')][_0xb096('0x73')]?0x1f4:_0x3eb3c2[_0xb096('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb096('0x75'),_0x5c85ee,JSON[_0xb096('0x76')](_0x3eb3c2));delete _0x3eb3c2['name'];if(_0x5c85ee===0x191){_0x5c85ee=0x190;}_0x4eee66[_0xb096('0x19')](_0x5c85ee)[_0xb096('0x27')](_0x4cc020['query']['test']?{'message':_0xb096('0x77'),'statusCode':_0x3eb3c2['statusCode']}:_0x3eb3c2);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 30593f2..747e7a0 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 _0x1e72=['../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x1e72,0xe9));var _0x21e7=function(_0x315b85,_0x3194b0){_0x315b85=_0x315b85-0x0;var _0x4efd93=_0x1e72[_0x315b85];return _0x4efd93;};'use strict';var _=require(_0x21e7('0x0'));var util=require(_0x21e7('0x1'));var logger=require(_0x21e7('0x2'))(_0x21e7('0x3'));var moment=require('moment');var BPromise=require(_0x21e7('0x4'));var rp=require(_0x21e7('0x5'));var fs=require('fs');var path=require(_0x21e7('0x6'));var rimraf=require('rimraf');var config=require(_0x21e7('0x7'));var attributes=require(_0x21e7('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x21e7('0x9')]=function(_0x21f3d9,_0x55ad48){return _0x21f3d9['define'](_0x21e7('0xa'),attributes,{'tableName':_0x21e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc762=['exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x31f120,_0x1e2dc0){var _0x189e75=function(_0xe7d4bd){while(--_0xe7d4bd){_0x31f120['push'](_0x31f120['shift']());}};_0x189e75(++_0x1e2dc0);}(_0xc762,0x90));var _0x2c76=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xc762[_0x1911ed];return _0x11edaa;};'use strict';var _=require('lodash');var util=require(_0x2c76('0x0'));var logger=require(_0x2c76('0x1'))(_0x2c76('0x2'));var moment=require(_0x2c76('0x3'));var BPromise=require(_0x2c76('0x4'));var rp=require(_0x2c76('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c76('0x6'));var config=require(_0x2c76('0x7'));var attributes=require(_0x2c76('0x8'));var integrations=require(_0x2c76('0x9'));module[_0x2c76('0xa')]=function(_0x280654,_0xca556a){return _0x280654[_0x2c76('0xb')](_0x2c76('0xc'),attributes,{'tableName':_0x2c76('0xd'),'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 187bc7c..a2de732 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 _0xba3c=['debug','request\x20sent','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','SalesforceAccount,\x20%s,\x20%s'];(function(_0x9b835d,_0x431212){var _0x4473e6=function(_0x4f5ceb){while(--_0x4f5ceb){_0x9b835d['push'](_0x9b835d['shift']());}};_0x4473e6(++_0x431212);}(_0xba3c,0xb9));var _0xcba3=function(_0x4ee1ac,_0x2da10c){_0x4ee1ac=_0x4ee1ac-0x0;var _0x5646d8=_0xba3c[_0x4ee1ac];return _0x5646d8;};'use strict';var _=require(_0xcba3('0x0'));var util=require(_0xcba3('0x1'));var moment=require(_0xcba3('0x2'));var BPromise=require('bluebird');var rs=require(_0xcba3('0x3'));var fs=require('fs');var Redis=require(_0xcba3('0x4'));var db=require(_0xcba3('0x5'))['db'];var utils=require(_0xcba3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcba3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcba3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x394eb9,_0x1207f4,_0x390c39){return new BPromise(function(_0x15a811,_0x31146d){return client[_0xcba3('0x9')](_0x394eb9,_0x390c39)[_0xcba3('0xa')](function(_0x162580){logger[_0xcba3('0xb')](_0xcba3('0xc'),_0x1207f4,'request\x20sent');logger[_0xcba3('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1207f4,_0xcba3('0xe'),JSON['stringify'](_0x162580));if(_0x162580[_0xcba3('0xf')]){if(_0x162580[_0xcba3('0xf')][_0xcba3('0x10')]===0x1f4){logger[_0xcba3('0xf')](_0xcba3('0xc'),_0x1207f4,_0x162580[_0xcba3('0xf')][_0xcba3('0x11')]);return _0x31146d(_0x162580['error']['message']);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1207f4,_0x162580[_0xcba3('0xf')][_0xcba3('0x11')]);return _0x15a811(_0x162580[_0xcba3('0xf')]['message']);}else{logger[_0xcba3('0xb')](_0xcba3('0xc'),_0x1207f4,'request\x20sent');_0x15a811(_0x162580['result'][_0xcba3('0x11')]);}})[_0xcba3('0x12')](function(_0x58f738){logger[_0xcba3('0xf')](_0xcba3('0xc'),_0x1207f4,_0x58f738);_0x31146d(_0x58f738);});});}exports[_0xcba3('0x13')]=function(_0x2673fb){var _0x3005f9=this;return new Promise(function(_0x37b411,_0x1c783d){return db[_0xcba3('0x14')][_0xcba3('0x15')]({'raw':_0x2673fb[_0xcba3('0x16')]?_0x2673fb[_0xcba3('0x16')][_0xcba3('0x17')]===undefined?!![]:![]:!![],'where':_0x2673fb[_0xcba3('0x16')]?_0x2673fb[_0xcba3('0x16')]['where']||null:null,'attributes':_0x2673fb[_0xcba3('0x16')]?_0x2673fb['options'][_0xcba3('0x18')]||null:null,'limit':_0x2673fb[_0xcba3('0x16')]?_0x2673fb[_0xcba3('0x16')][_0xcba3('0x19')]||null:null,'include':_0x2673fb[_0xcba3('0x16')]?_0x2673fb[_0xcba3('0x16')][_0xcba3('0x1a')]?_[_0xcba3('0x1b')](_0x2673fb[_0xcba3('0x16')]['include'],function(_0x458d5f){return{'model':db[_0x458d5f[_0xcba3('0x1c')]],'as':_0x458d5f['as'],'attributes':_0x458d5f[_0xcba3('0x18')],'include':_0x458d5f[_0xcba3('0x1a')]?_[_0xcba3('0x1b')](_0x458d5f[_0xcba3('0x1a')],function(_0x2d2c56){return{'model':db[_0x2d2c56[_0xcba3('0x1c')]],'as':_0x2d2c56['as'],'attributes':_0x2d2c56['attributes'],'include':_0x2d2c56[_0xcba3('0x1a')]?_[_0xcba3('0x1b')](_0x2d2c56[_0xcba3('0x1a')],function(_0xcceb8a){return{'model':db[_0xcceb8a['model']],'as':_0xcceb8a['as'],'attributes':_0xcceb8a[_0xcba3('0x18')]};}):[]};}):[]};}):[]:[]})[_0xcba3('0xa')](function(_0x18ebb8){logger[_0xcba3('0xb')](_0xcba3('0x13'),_0x2673fb);logger[_0xcba3('0xd')](_0xcba3('0x13'),_0x2673fb,JSON[_0xcba3('0x1d')](_0x18ebb8));_0x37b411(_0x18ebb8);})[_0xcba3('0x12')](function(_0x269197){logger[_0xcba3('0xf')]('GetSalesforceAccount',_0x269197[_0xcba3('0x11')],_0x2673fb);_0x1c783d(_0x3005f9[_0xcba3('0xf')](0x1f4,_0x269197[_0xcba3('0x11')]));});});};exports[_0xcba3('0x1e')]=function(_0x4a218e){var _0x4bc835=this;return new Promise(function(_0x4c8d4c,_0x583502){return db['SalesforceAccount'][_0xcba3('0x1f')]({'raw':_0x4a218e[_0xcba3('0x16')]?_0x4a218e[_0xcba3('0x16')][_0xcba3('0x17')]===undefined?!![]:![]:!![],'where':_0x4a218e['options']?_0x4a218e[_0xcba3('0x16')][_0xcba3('0x20')]||null:null,'attributes':_0x4a218e[_0xcba3('0x16')]?_0x4a218e['options'][_0xcba3('0x18')]||null:null,'include':_0x4a218e[_0xcba3('0x16')]?_0x4a218e[_0xcba3('0x16')][_0xcba3('0x1a')]?_[_0xcba3('0x1b')](_0x4a218e[_0xcba3('0x16')][_0xcba3('0x1a')],function(_0x16a980){return{'model':db[_0x16a980[_0xcba3('0x1c')]],'as':_0x16a980['as'],'attributes':_0x16a980[_0xcba3('0x18')],'include':_0x16a980['include']?_[_0xcba3('0x1b')](_0x16a980[_0xcba3('0x1a')],function(_0x43da0f){return{'model':db[_0x43da0f[_0xcba3('0x1c')]],'as':_0x43da0f['as'],'attributes':_0x43da0f[_0xcba3('0x18')],'include':_0x43da0f[_0xcba3('0x1a')]?_['map'](_0x43da0f[_0xcba3('0x1a')],function(_0x4b3a68){return{'model':db[_0x4b3a68['model']],'as':_0x4b3a68['as'],'attributes':_0x4b3a68[_0xcba3('0x18')]};}):[]};}):[]};}):[]:[]})[_0xcba3('0xa')](function(_0x5eab47){logger[_0xcba3('0xb')](_0xcba3('0x1e'),_0x4a218e);logger[_0xcba3('0xd')](_0xcba3('0x1e'),_0x4a218e,JSON[_0xcba3('0x1d')](_0x5eab47));_0x4c8d4c(_0x5eab47);})[_0xcba3('0x12')](function(_0x27f1bd){logger[_0xcba3('0xf')](_0xcba3('0x1e'),_0x27f1bd[_0xcba3('0x11')],_0x4a218e);_0x583502(_0x4bc835[_0xcba3('0xf')](0x1f4,_0x27f1bd[_0xcba3('0x11')]));});});}; \ No newline at end of file +var _0x4c71=['code','message','result','GetSalesforceAccount','findAll','options','attributes','include','model','map','catch','ShowSalesforceAccount','SalesforceAccount','find','raw','lodash','util','moment','ioredis','../../config/logger','rpc','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x33837e,_0x507b2f){var _0xbcb7ab=function(_0x1b93c2){while(--_0x1b93c2){_0x33837e['push'](_0x33837e['shift']());}};_0xbcb7ab(++_0x507b2f);}(_0x4c71,0x1d1));var _0x14c7=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x4c71[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var moment=require(_0x14c7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x14c7('0x4'))(_0x14c7('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14c7('0x6')][_0x14c7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35cb97,_0x59d18e,_0x2ca2bc){return new BPromise(function(_0x147e26,_0x50129b){return client['request'](_0x35cb97,_0x2ca2bc)[_0x14c7('0x8')](function(_0x45de23){logger[_0x14c7('0x9')](_0x14c7('0xa'),_0x59d18e,_0x14c7('0xb'));logger['debug'](_0x14c7('0xc'),_0x59d18e,_0x14c7('0xb'),JSON[_0x14c7('0xd')](_0x45de23));if(_0x45de23[_0x14c7('0xe')]){if(_0x45de23['error'][_0x14c7('0xf')]===0x1f4){logger[_0x14c7('0xe')](_0x14c7('0xa'),_0x59d18e,_0x45de23[_0x14c7('0xe')][_0x14c7('0x10')]);return _0x50129b(_0x45de23[_0x14c7('0xe')][_0x14c7('0x10')]);}logger['error'](_0x14c7('0xa'),_0x59d18e,_0x45de23[_0x14c7('0xe')][_0x14c7('0x10')]);return _0x147e26(_0x45de23['error'][_0x14c7('0x10')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x59d18e,_0x14c7('0xb'));_0x147e26(_0x45de23[_0x14c7('0x11')][_0x14c7('0x10')]);}})['catch'](function(_0x4f3b26){logger[_0x14c7('0xe')](_0x14c7('0xa'),_0x59d18e,_0x4f3b26);_0x50129b(_0x4f3b26);});});}exports[_0x14c7('0x12')]=function(_0x1db169){var _0x20352e=this;return new Promise(function(_0x5b4f20,_0x5422a8){return db['SalesforceAccount'][_0x14c7('0x13')]({'raw':_0x1db169[_0x14c7('0x14')]?_0x1db169[_0x14c7('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1db169[_0x14c7('0x14')]?_0x1db169[_0x14c7('0x14')]['where']||null:null,'attributes':_0x1db169[_0x14c7('0x14')]?_0x1db169['options'][_0x14c7('0x15')]||null:null,'limit':_0x1db169[_0x14c7('0x14')]?_0x1db169[_0x14c7('0x14')]['limit']||null:null,'include':_0x1db169[_0x14c7('0x14')]?_0x1db169[_0x14c7('0x14')]['include']?_['map'](_0x1db169[_0x14c7('0x14')][_0x14c7('0x16')],function(_0x382471){return{'model':db[_0x382471[_0x14c7('0x17')]],'as':_0x382471['as'],'attributes':_0x382471[_0x14c7('0x15')],'include':_0x382471['include']?_[_0x14c7('0x18')](_0x382471[_0x14c7('0x16')],function(_0x209409){return{'model':db[_0x209409[_0x14c7('0x17')]],'as':_0x209409['as'],'attributes':_0x209409[_0x14c7('0x15')],'include':_0x209409['include']?_[_0x14c7('0x18')](_0x209409['include'],function(_0x3ab4e1){return{'model':db[_0x3ab4e1[_0x14c7('0x17')]],'as':_0x3ab4e1['as'],'attributes':_0x3ab4e1[_0x14c7('0x15')]};}):[]};}):[]};}):[]:[]})[_0x14c7('0x8')](function(_0x147eab){logger[_0x14c7('0x9')](_0x14c7('0x12'),_0x1db169);logger['debug'](_0x14c7('0x12'),_0x1db169,JSON[_0x14c7('0xd')](_0x147eab));_0x5b4f20(_0x147eab);})[_0x14c7('0x19')](function(_0x2ffd74){logger[_0x14c7('0xe')](_0x14c7('0x12'),_0x2ffd74['message'],_0x1db169);_0x5422a8(_0x20352e[_0x14c7('0xe')](0x1f4,_0x2ffd74[_0x14c7('0x10')]));});});};exports[_0x14c7('0x1a')]=function(_0x509514){var _0x31df89=this;return new Promise(function(_0x1c41d0,_0x535121){return db[_0x14c7('0x1b')][_0x14c7('0x1c')]({'raw':_0x509514[_0x14c7('0x14')]?_0x509514['options'][_0x14c7('0x1d')]===undefined?!![]:![]:!![],'where':_0x509514[_0x14c7('0x14')]?_0x509514[_0x14c7('0x14')]['where']||null:null,'attributes':_0x509514[_0x14c7('0x14')]?_0x509514[_0x14c7('0x14')][_0x14c7('0x15')]||null:null,'include':_0x509514[_0x14c7('0x14')]?_0x509514[_0x14c7('0x14')][_0x14c7('0x16')]?_['map'](_0x509514[_0x14c7('0x14')][_0x14c7('0x16')],function(_0x52823e){return{'model':db[_0x52823e[_0x14c7('0x17')]],'as':_0x52823e['as'],'attributes':_0x52823e[_0x14c7('0x15')],'include':_0x52823e[_0x14c7('0x16')]?_['map'](_0x52823e[_0x14c7('0x16')],function(_0x5b45e8){return{'model':db[_0x5b45e8['model']],'as':_0x5b45e8['as'],'attributes':_0x5b45e8[_0x14c7('0x15')],'include':_0x5b45e8['include']?_[_0x14c7('0x18')](_0x5b45e8[_0x14c7('0x16')],function(_0x15a8e0){return{'model':db[_0x15a8e0[_0x14c7('0x17')]],'as':_0x15a8e0['as'],'attributes':_0x15a8e0[_0x14c7('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dfceb){logger[_0x14c7('0x9')](_0x14c7('0x1a'),_0x509514);logger['debug']('ShowSalesforceAccount',_0x509514,JSON[_0x14c7('0xd')](_0x3dfceb));_0x1c41d0(_0x3dfceb);})[_0x14c7('0x19')](function(_0x1127bf){logger['error'](_0x14c7('0x1a'),_0x1127bf[_0x14c7('0x10')],_0x509514);_0x535121(_0x31df89['error'](0x1f4,_0x1127bf[_0x14c7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2952f8b..51e6235 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 _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(_0x40e57f,_0x41633b){var _0x209fe4=function(_0x251ea7){while(--_0x251ea7){_0x40e57f['push'](_0x40e57f['shift']());}};_0x209fe4(++_0x41633b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'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 +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xdb28,0x106));var _0x8db2=function(_0x7eb307,_0x1615db){_0x7eb307=_0x7eb307-0x0;var _0x36005f=_0xdb28[_0x7eb307];return _0x36005f;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index bcec7d5..0bc7866 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 _0xa747=['account','nothing','lead','sequelize','exports','STRING','Case','Task','ENUM','contact_lead','contact','account_contact_lead'];(function(_0x29715c,_0x321c73){var _0x48b8a1=function(_0x4293aa){while(--_0x4293aa){_0x29715c['push'](_0x29715c['shift']());}};_0x48b8a1(++_0x321c73);}(_0xa747,0x12f));var _0x7a74=function(_0x3460b4,_0x4c022a){_0x3460b4=_0x3460b4-0x0;var _0x1e3033=_0xa747[_0x3460b4];return _0x1e3033;};'use strict';var Sequelize=require(_0x7a74('0x0'));module[_0x7a74('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7a74('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x7a74('0x3')),'defaultValue':_0x7a74('0x4')},'moduleSearch':{'type':Sequelize[_0x7a74('0x5')](_0x7a74('0x6'),_0x7a74('0x7'),'lead',_0x7a74('0x8'),_0x7a74('0x9')),'defaultValue':_0x7a74('0x6')},'moduleCreate':{'type':Sequelize[_0x7a74('0x5')](_0x7a74('0xa'),_0x7a74('0x7'),_0x7a74('0xb'),_0x7a74('0x9')),'defaultValue':_0x7a74('0xb')},'leadId':{'type':Sequelize[_0x7a74('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x7a74('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x7a74('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe5fc=['account_contact_lead','account','contact_lead','nothing','sequelize','STRING','ENUM','contact','lead'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xe5fc,0x109));var _0xce5f=function(_0x464dd7,_0xfaf6){_0x464dd7=_0x464dd7-0x0;var _0x5c2bc4=_0xe5fc[_0x464dd7];return _0x5c2bc4;};'use strict';var Sequelize=require(_0xce5f('0x0'));module['exports']={'name':{'type':Sequelize[_0xce5f('0x1')]},'description':{'type':Sequelize[_0xce5f('0x1')]},'ticketType':{'type':Sequelize[_0xce5f('0x2')]('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xce5f('0x2')]('contact_lead',_0xce5f('0x3'),_0xce5f('0x4'),_0xce5f('0x5'),_0xce5f('0x6')),'defaultValue':_0xce5f('0x7')},'moduleCreate':{'type':Sequelize[_0xce5f('0x2')](_0xce5f('0x8'),_0xce5f('0x3'),'lead',_0xce5f('0x6')),'defaultValue':_0xce5f('0x4')},'leadId':{'type':Sequelize[_0xce5f('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xce5f('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xce5f('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xce5f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 87d43da..2850253 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 _0x74fb=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','SalesforceField','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','destroy','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x2a70d4,_0xe056f3){var _0x3884b0=function(_0x4e2da0){while(--_0x4e2da0){_0x2a70d4['push'](_0x2a70d4['shift']());}};_0x3884b0(++_0xe056f3);}(_0x74fb,0x111));var _0xb74f=function(_0x3707ad,_0x1d477f){_0x3707ad=_0x3707ad-0x0;var _0x2767cb=_0x74fb[_0x3707ad];return _0x2767cb;};'use strict';var emlformat=require(_0xb74f('0x0'));var rimraf=require(_0xb74f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb74f('0x2'));var moment=require(_0xb74f('0x3'));var BPromise=require(_0xb74f('0x4'));var Mustache=require(_0xb74f('0x5'));var util=require('util');var path=require(_0xb74f('0x6'));var sox=require(_0xb74f('0x7'));var csv=require(_0xb74f('0x8'));var ejs=require(_0xb74f('0x9'));var fs=require('fs');var fs_extra=require(_0xb74f('0xa'));var _=require(_0xb74f('0xb'));var squel=require(_0xb74f('0xc'));var crypto=require(_0xb74f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb74f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb74f('0xf'));var Papa=require('papaparse');var Redis=require(_0xb74f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb74f('0x11'));var as=require(_0xb74f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb74f('0x13'))(_0xb74f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb74f('0x15'));var db=require(_0xb74f('0x16'))['db'];function respondWithStatusCode(_0x51d405,_0x58aa6a){_0x58aa6a=_0x58aa6a||0xcc;return function(_0x597bc7){if(_0x597bc7){return _0x51d405[_0xb74f('0x17')](_0x58aa6a);}return _0x51d405['status'](_0x58aa6a)[_0xb74f('0x18')]();};}function respondWithResult(_0x47e004,_0x4a13f4){_0x4a13f4=_0x4a13f4||0xc8;return function(_0x446aba){if(_0x446aba){return _0x47e004['status'](_0x4a13f4)[_0xb74f('0x19')](_0x446aba);}};}function respondWithFilteredResult(_0xcaaa20,_0x3ca742){return function(_0x413b34){if(_0x413b34){var _0x86e7a5=typeof _0x3ca742[_0xb74f('0x1a')]===_0xb74f('0x1b')&&typeof _0x3ca742[_0xb74f('0x1c')]===_0xb74f('0x1b');var _0x378f2a=_0x413b34[_0xb74f('0x1d')];var _0x7326ed=_0x86e7a5?0x0:_0x3ca742[_0xb74f('0x1a')];var _0x3ebc67=_0x86e7a5?_0x413b34['count']:_0x3ca742[_0xb74f('0x1a')]+_0x3ca742[_0xb74f('0x1c')];var _0x3a0a6c;if(_0x3ebc67>=_0x378f2a){_0x3ebc67=_0x378f2a;_0x3a0a6c=0xc8;}else{_0x3a0a6c=0xce;}_0xcaaa20[_0xb74f('0x1e')](_0x3a0a6c);return _0xcaaa20[_0xb74f('0x1f')](_0xb74f('0x20'),_0x7326ed+'-'+_0x3ebc67+'/'+_0x378f2a)[_0xb74f('0x19')](_0x413b34);}return null;};}function patchUpdates(_0x27192c){return function(_0x1cf9b){try{jsonpatch['apply'](_0x1cf9b,_0x27192c,!![]);}catch(_0x1e107c){return BPromise['reject'](_0x1e107c);}return _0x1cf9b[_0xb74f('0x21')]();};}function saveUpdates(_0x31f4d4,_0x417c02){return function(_0x52b478){if(_0x52b478){return _0x52b478[_0xb74f('0x22')](_0x31f4d4)['then'](function(_0x462ac1){return _0x462ac1;});}return null;};}function removeEntity(_0xa0d36d,_0x15f0ef){return function(_0x4e0bc7){if(_0x4e0bc7){return _0x4e0bc7[_0xb74f('0x23')]()['then'](function(){_0xa0d36d[_0xb74f('0x1e')](0xcc)[_0xb74f('0x18')]();});}};}function handleEntityNotFound(_0x61acdf,_0x433e31){return function(_0x5d65e4){if(!_0x5d65e4){_0x61acdf[_0xb74f('0x17')](0x194);}return _0x5d65e4;};}function handleError(_0x1af96d,_0xa02189){_0xa02189=_0xa02189||0x1f4;return function(_0xae8a3d){logger[_0xb74f('0x24')](_0xae8a3d[_0xb74f('0x25')]);if(_0xae8a3d[_0xb74f('0x26')]){delete _0xae8a3d['name'];}_0x1af96d['status'](_0xa02189)[_0xb74f('0x27')](_0xae8a3d);};}exports[_0xb74f('0x28')]=function(_0x5a2bb0,_0x147970){var _0x2e3c1a={},_0x531f4f={},_0x1ec108={'count':0x0,'rows':[]};var _0x1d6813=_['map'](db[_0xb74f('0x29')][_0xb74f('0x2a')],function(_0x415aea){return{'name':_0x415aea[_0xb74f('0x2b')],'type':_0x415aea[_0xb74f('0x2c')][_0xb74f('0x2d')]};});_0x531f4f[_0xb74f('0x2e')]=_['map'](_0x1d6813,_0xb74f('0x26'));_0x531f4f[_0xb74f('0x2f')]=_[_0xb74f('0x30')](_0x5a2bb0['query']);_0x531f4f[_0xb74f('0x31')]=_[_0xb74f('0x32')](_0x531f4f[_0xb74f('0x2e')],_0x531f4f[_0xb74f('0x2f')]);_0x2e3c1a[_0xb74f('0x33')]=_['intersection'](_0x531f4f[_0xb74f('0x2e')],qs[_0xb74f('0x34')](_0x5a2bb0['query'][_0xb74f('0x34')]));_0x2e3c1a[_0xb74f('0x33')]=_0x2e3c1a['attributes'][_0xb74f('0x35')]?_0x2e3c1a['attributes']:_0x531f4f[_0xb74f('0x2e')];if(!_0x5a2bb0[_0xb74f('0x2f')][_0xb74f('0x36')](_0xb74f('0x37'))){_0x2e3c1a['limit']=qs[_0xb74f('0x1c')](_0x5a2bb0[_0xb74f('0x2f')][_0xb74f('0x1c')]);_0x2e3c1a[_0xb74f('0x1a')]=qs[_0xb74f('0x1a')](_0x5a2bb0['query'][_0xb74f('0x1a')]);}_0x2e3c1a[_0xb74f('0x38')]=qs[_0xb74f('0x39')](_0x5a2bb0[_0xb74f('0x2f')]['sort']);_0x2e3c1a['where']=qs[_0xb74f('0x31')](_['pick'](_0x5a2bb0[_0xb74f('0x2f')],_0x531f4f[_0xb74f('0x31')]),_0x1d6813);if(_0x5a2bb0[_0xb74f('0x2f')][_0xb74f('0x3a')]){_0x2e3c1a[_0xb74f('0x3b')]=_[_0xb74f('0x3c')](_0x2e3c1a['where'],{'$or':_[_0xb74f('0x3d')](_0x1d6813,function(_0x1fe704){if(_0x1fe704[_0xb74f('0x2c')]!==_0xb74f('0x3e')){var _0x44889a={};_0x44889a[_0x1fe704['name']]={'$like':'%'+_0x5a2bb0[_0xb74f('0x2f')][_0xb74f('0x3a')]+'%'};return _0x44889a;}})});}_0x2e3c1a=_[_0xb74f('0x3c')]({},_0x2e3c1a,_0x5a2bb0[_0xb74f('0x3f')]);var _0x2b8896={'where':_0x2e3c1a[_0xb74f('0x3b')]};return db[_0xb74f('0x29')][_0xb74f('0x1d')](_0x2b8896)[_0xb74f('0x40')](function(_0x52a896){_0x1ec108['count']=_0x52a896;if(_0x5a2bb0[_0xb74f('0x2f')][_0xb74f('0x41')]){_0x2e3c1a[_0xb74f('0x42')]=[{'all':!![]}];}return db[_0xb74f('0x29')][_0xb74f('0x43')](_0x2e3c1a);})[_0xb74f('0x40')](function(_0x5ac4fa){_0x1ec108[_0xb74f('0x44')]=_0x5ac4fa;return _0x1ec108;})[_0xb74f('0x40')](respondWithFilteredResult(_0x147970,_0x2e3c1a))[_0xb74f('0x45')](handleError(_0x147970,null));};exports[_0xb74f('0x46')]=function(_0x163078,_0x3b542a){var _0x36da2d={'raw':![],'where':{'id':_0x163078[_0xb74f('0x47')]['id']}},_0x150d5b={};_0x150d5b[_0xb74f('0x2e')]=_[_0xb74f('0x30')](db[_0xb74f('0x29')][_0xb74f('0x2a')]);_0x150d5b[_0xb74f('0x2f')]=_['keys'](_0x163078[_0xb74f('0x2f')]);_0x150d5b[_0xb74f('0x31')]=_[_0xb74f('0x32')](_0x150d5b[_0xb74f('0x2e')],_0x150d5b[_0xb74f('0x2f')]);_0x36da2d[_0xb74f('0x33')]=_['intersection'](_0x150d5b['model'],qs['fields'](_0x163078[_0xb74f('0x2f')][_0xb74f('0x34')]));_0x36da2d['attributes']=_0x36da2d['attributes'][_0xb74f('0x35')]?_0x36da2d['attributes']:_0x150d5b[_0xb74f('0x2e')];if(_0x163078[_0xb74f('0x2f')][_0xb74f('0x41')]){_0x36da2d[_0xb74f('0x42')]=[{'all':!![]}];}_0x36da2d=_['merge']({},_0x36da2d,_0x163078['options']);return db[_0xb74f('0x29')]['find'](_0x36da2d)[_0xb74f('0x40')](handleEntityNotFound(_0x3b542a,null))[_0xb74f('0x40')](respondWithResult(_0x3b542a,null))['catch'](handleError(_0x3b542a,null));};exports[_0xb74f('0x48')]=function(_0x2f77bf,_0x49d324){return db['SalesforceConfiguration'][_0xb74f('0x48')](_0x2f77bf['body'],{})[_0xb74f('0x40')](respondWithResult(_0x49d324,0xc9))[_0xb74f('0x45')](handleError(_0x49d324,null));};exports[_0xb74f('0x22')]=function(_0x3e0731,_0x3c87d3){if(_0x3e0731['body']['id']){delete _0x3e0731['body']['id'];}return db[_0xb74f('0x29')]['find']({'where':{'id':_0x3e0731[_0xb74f('0x47')]['id']}})[_0xb74f('0x40')](handleEntityNotFound(_0x3c87d3,null))['then'](saveUpdates(_0x3e0731[_0xb74f('0x49')],null))[_0xb74f('0x40')](respondWithResult(_0x3c87d3,null))['catch'](handleError(_0x3c87d3,null));};exports[_0xb74f('0x23')]=function(_0x68b351,_0x2ebb96){return db[_0xb74f('0x29')][_0xb74f('0x4a')]({'where':{'id':_0x68b351[_0xb74f('0x47')]['id']}})[_0xb74f('0x40')](handleEntityNotFound(_0x2ebb96,null))[_0xb74f('0x40')](removeEntity(_0x2ebb96,null))[_0xb74f('0x45')](handleError(_0x2ebb96,null));};exports[_0xb74f('0x4b')]=function(_0x34dab5,_0xb250b5,_0xbdb479){var _0x5e33db={};var _0x38b86b={};var _0x263672;var _0x35e48e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x34dab5[_0xb74f('0x47')]['id']}})[_0xb74f('0x40')](handleEntityNotFound(_0xb250b5,null))[_0xb74f('0x40')](function(_0x4877c4){if(_0x4877c4){_0x263672=_0x4877c4;_0x38b86b[_0xb74f('0x2e')]=_[_0xb74f('0x30')](db[_0xb74f('0x4c')][_0xb74f('0x2a')]);_0x38b86b[_0xb74f('0x2f')]=_[_0xb74f('0x30')](_0x34dab5[_0xb74f('0x2f')]);_0x38b86b[_0xb74f('0x31')]=_['intersection'](_0x38b86b[_0xb74f('0x2e')],_0x38b86b[_0xb74f('0x2f')]);_0x5e33db[_0xb74f('0x33')]=_['intersection'](_0x38b86b[_0xb74f('0x2e')],qs['fields'](_0x34dab5['query'][_0xb74f('0x34')]));_0x5e33db[_0xb74f('0x33')]=_0x5e33db[_0xb74f('0x33')][_0xb74f('0x35')]?_0x5e33db[_0xb74f('0x33')]:_0x38b86b[_0xb74f('0x2e')];_0x5e33db[_0xb74f('0x38')]=qs['sort'](_0x34dab5['query'][_0xb74f('0x39')]);_0x5e33db[_0xb74f('0x3b')]=qs['filters'](_['pick'](_0x34dab5[_0xb74f('0x2f')],_0x38b86b[_0xb74f('0x31')]));if(_0x34dab5[_0xb74f('0x2f')]['filter']){_0x5e33db['where']=_[_0xb74f('0x3c')](_0x5e33db[_0xb74f('0x3b')],{'$or':_[_0xb74f('0x3d')](_0x5e33db[_0xb74f('0x33')],function(_0x2c77ae){var _0x1cbd61={};_0x1cbd61[_0x2c77ae]={'$like':'%'+_0x34dab5[_0xb74f('0x2f')]['filter']+'%'};return _0x1cbd61;})});}_0x5e33db=_['merge']({},_0x5e33db,_0x34dab5['options']);return _0x263672[_0xb74f('0x4b')](_0x5e33db);}})[_0xb74f('0x40')](function(_0x595c71){if(_0x595c71){_0x35e48e=_0x595c71[_0xb74f('0x35')];if(!_0x34dab5[_0xb74f('0x2f')]['hasOwnProperty'](_0xb74f('0x37'))){_0x5e33db[_0xb74f('0x1c')]=qs[_0xb74f('0x1c')](_0x34dab5[_0xb74f('0x2f')][_0xb74f('0x1c')]);_0x5e33db[_0xb74f('0x1a')]=qs[_0xb74f('0x1a')](_0x34dab5[_0xb74f('0x2f')]['offset']);}return _0x263672['getFields'](_0x5e33db);}})[_0xb74f('0x40')](function(_0x21d6d5){if(_0x21d6d5){return _0x21d6d5?{'count':_0x35e48e,'rows':_0x21d6d5}:null;}})[_0xb74f('0x40')](respondWithResult(_0xb250b5,null))[_0xb74f('0x45')](handleError(_0xb250b5,null));};exports[_0xb74f('0x4d')]=function(_0x5b8ada,_0x4918d4,_0x3ad806){var _0x29b9b4={};var _0x2e1f87={};var _0xe638e6;var _0x4f60c7;return db[_0xb74f('0x29')][_0xb74f('0x4e')]({'where':{'id':_0x5b8ada['params']['id']}})['then'](handleEntityNotFound(_0x4918d4,null))[_0xb74f('0x40')](function(_0x2bec7a){if(_0x2bec7a){_0xe638e6=_0x2bec7a;_0x2e1f87[_0xb74f('0x2e')]=_[_0xb74f('0x30')](db[_0xb74f('0x4c')][_0xb74f('0x2a')]);_0x2e1f87['query']=_[_0xb74f('0x30')](_0x5b8ada['query']);_0x2e1f87['filters']=_[_0xb74f('0x32')](_0x2e1f87[_0xb74f('0x2e')],_0x2e1f87[_0xb74f('0x2f')]);_0x29b9b4[_0xb74f('0x33')]=_['intersection'](_0x2e1f87[_0xb74f('0x2e')],qs[_0xb74f('0x34')](_0x5b8ada[_0xb74f('0x2f')][_0xb74f('0x34')]));_0x29b9b4[_0xb74f('0x33')]=_0x29b9b4[_0xb74f('0x33')][_0xb74f('0x35')]?_0x29b9b4['attributes']:_0x2e1f87[_0xb74f('0x2e')];_0x29b9b4[_0xb74f('0x38')]=qs['sort'](_0x5b8ada['query'][_0xb74f('0x39')]);_0x29b9b4[_0xb74f('0x3b')]=qs['filters'](_[_0xb74f('0x4f')](_0x5b8ada['query'],_0x2e1f87['filters']));if(_0x5b8ada[_0xb74f('0x2f')]['filter']){_0x29b9b4[_0xb74f('0x3b')]=_[_0xb74f('0x3c')](_0x29b9b4[_0xb74f('0x3b')],{'$or':_[_0xb74f('0x3d')](_0x29b9b4['attributes'],function(_0x21d299){var _0x52df91={};_0x52df91[_0x21d299]={'$like':'%'+_0x5b8ada[_0xb74f('0x2f')]['filter']+'%'};return _0x52df91;})});}_0x29b9b4=_['merge']({},_0x29b9b4,_0x5b8ada[_0xb74f('0x3f')]);return _0xe638e6['getSubjects'](_0x29b9b4);}})['then'](function(_0x5d27d8){if(_0x5d27d8){_0x4f60c7=_0x5d27d8[_0xb74f('0x35')];if(!_0x5b8ada[_0xb74f('0x2f')][_0xb74f('0x36')]('nolimit')){_0x29b9b4[_0xb74f('0x1c')]=qs['limit'](_0x5b8ada[_0xb74f('0x2f')][_0xb74f('0x1c')]);_0x29b9b4[_0xb74f('0x1a')]=qs[_0xb74f('0x1a')](_0x5b8ada[_0xb74f('0x2f')][_0xb74f('0x1a')]);}return _0xe638e6[_0xb74f('0x4d')](_0x29b9b4);}})[_0xb74f('0x40')](function(_0x4ed086){if(_0x4ed086){return _0x4ed086?{'count':_0x4f60c7,'rows':_0x4ed086}:null;}})['then'](respondWithResult(_0x4918d4,null))[_0xb74f('0x45')](handleError(_0x4918d4,null));};exports[_0xb74f('0x50')]=function(_0x5d9a46,_0x2c44ea,_0x206783){var _0x59b123={};var _0x110294={};var _0x5067f6;var _0x88acb2;return db[_0xb74f('0x29')][_0xb74f('0x4e')]({'where':{'id':_0x5d9a46[_0xb74f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c44ea,null))['then'](function(_0xddc3fd){if(_0xddc3fd){_0x5067f6=_0xddc3fd;_0x110294[_0xb74f('0x2e')]=_[_0xb74f('0x30')](db[_0xb74f('0x4c')][_0xb74f('0x2a')]);_0x110294[_0xb74f('0x2f')]=_['keys'](_0x5d9a46[_0xb74f('0x2f')]);_0x110294[_0xb74f('0x31')]=_['intersection'](_0x110294[_0xb74f('0x2e')],_0x110294[_0xb74f('0x2f')]);_0x59b123[_0xb74f('0x33')]=_['intersection'](_0x110294[_0xb74f('0x2e')],qs['fields'](_0x5d9a46[_0xb74f('0x2f')][_0xb74f('0x34')]));_0x59b123[_0xb74f('0x33')]=_0x59b123[_0xb74f('0x33')][_0xb74f('0x35')]?_0x59b123[_0xb74f('0x33')]:_0x110294[_0xb74f('0x2e')];_0x59b123['order']=qs['sort'](_0x5d9a46[_0xb74f('0x2f')][_0xb74f('0x39')]);_0x59b123['where']=qs['filters'](_[_0xb74f('0x4f')](_0x5d9a46[_0xb74f('0x2f')],_0x110294[_0xb74f('0x31')]));if(_0x5d9a46[_0xb74f('0x2f')][_0xb74f('0x3a')]){_0x59b123[_0xb74f('0x3b')]=_[_0xb74f('0x3c')](_0x59b123['where'],{'$or':_[_0xb74f('0x3d')](_0x59b123[_0xb74f('0x33')],function(_0x250c0e){var _0x23d23f={};_0x23d23f[_0x250c0e]={'$like':'%'+_0x5d9a46['query'][_0xb74f('0x3a')]+'%'};return _0x23d23f;})});}_0x59b123=_[_0xb74f('0x3c')]({},_0x59b123,_0x5d9a46['options']);return _0x5067f6[_0xb74f('0x50')](_0x59b123);}})['then'](function(_0x28873e){if(_0x28873e){_0x88acb2=_0x28873e[_0xb74f('0x35')];if(!_0x5d9a46[_0xb74f('0x2f')][_0xb74f('0x36')](_0xb74f('0x37'))){_0x59b123[_0xb74f('0x1c')]=qs[_0xb74f('0x1c')](_0x5d9a46[_0xb74f('0x2f')][_0xb74f('0x1c')]);_0x59b123[_0xb74f('0x1a')]=qs['offset'](_0x5d9a46[_0xb74f('0x2f')][_0xb74f('0x1a')]);}return _0x5067f6['getDescriptions'](_0x59b123);}})['then'](function(_0x4f1ed0){if(_0x4f1ed0){return _0x4f1ed0?{'count':_0x88acb2,'rows':_0x4f1ed0}:null;}})['then'](respondWithResult(_0x2c44ea,null))[_0xb74f('0x45')](handleError(_0x2c44ea,null));}; \ No newline at end of file +var _0x0d64=['stack','send','index','map','fieldName','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','keys','SalesforceConfiguration','find','create','body','update','params','destroy','getFields','SalesforceField','getSubjects','findOne','rawAttributes','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','error'];(function(_0x506c56,_0x50e2b7){var _0x58abe3=function(_0x380b20){while(--_0x380b20){_0x506c56['push'](_0x506c56['shift']());}};_0x58abe3(++_0x50e2b7);}(_0x0d64,0x77));var _0x40d6=function(_0x79c6de,_0x10de94){_0x79c6de=_0x79c6de-0x0;var _0x321a56=_0x0d64[_0x79c6de];return _0x321a56;};'use strict';var emlformat=require(_0x40d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40d6('0x1'));var jsonpatch=require(_0x40d6('0x2'));var rp=require('request-promise');var moment=require(_0x40d6('0x3'));var BPromise=require(_0x40d6('0x4'));var Mustache=require('mustache');var util=require(_0x40d6('0x5'));var path=require(_0x40d6('0x6'));var sox=require(_0x40d6('0x7'));var csv=require(_0x40d6('0x8'));var ejs=require(_0x40d6('0x9'));var fs=require('fs');var fs_extra=require(_0x40d6('0xa'));var _=require(_0x40d6('0xb'));var squel=require(_0x40d6('0xc'));var crypto=require(_0x40d6('0xd'));var jsforce=require(_0x40d6('0xe'));var deskjs=require(_0x40d6('0xf'));var toCsv=require(_0x40d6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x40d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x40d6('0x11'));var as=require(_0x40d6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d6('0x13'))('api');var utils=require(_0x40d6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a4067,_0x233ab5){_0x233ab5=_0x233ab5||0xcc;return function(_0x3dd4af){if(_0x3dd4af){return _0x1a4067[_0x40d6('0x15')](_0x233ab5);}return _0x1a4067['status'](_0x233ab5)[_0x40d6('0x16')]();};}function respondWithResult(_0x42537a,_0x44ae12){_0x44ae12=_0x44ae12||0xc8;return function(_0x18ccf7){if(_0x18ccf7){return _0x42537a['status'](_0x44ae12)[_0x40d6('0x17')](_0x18ccf7);}};}function respondWithFilteredResult(_0x29392b,_0x3eeab2){return function(_0x3db4c3){if(_0x3db4c3){var _0x300a26=typeof _0x3eeab2[_0x40d6('0x18')]===_0x40d6('0x19')&&typeof _0x3eeab2[_0x40d6('0x1a')]===_0x40d6('0x19');var _0x5866e9=_0x3db4c3[_0x40d6('0x1b')];var _0xbe088d=_0x300a26?0x0:_0x3eeab2['offset'];var _0x1118ee=_0x300a26?_0x3db4c3[_0x40d6('0x1b')]:_0x3eeab2[_0x40d6('0x18')]+_0x3eeab2[_0x40d6('0x1a')];var _0x41a0f3;if(_0x1118ee>=_0x5866e9){_0x1118ee=_0x5866e9;_0x41a0f3=0xc8;}else{_0x41a0f3=0xce;}_0x29392b[_0x40d6('0x1c')](_0x41a0f3);return _0x29392b['set'](_0x40d6('0x1d'),_0xbe088d+'-'+_0x1118ee+'/'+_0x5866e9)['json'](_0x3db4c3);}return null;};}function patchUpdates(_0x38ae04){return function(_0x39e53d){try{jsonpatch[_0x40d6('0x1e')](_0x39e53d,_0x38ae04,!![]);}catch(_0x2f8d02){return BPromise[_0x40d6('0x1f')](_0x2f8d02);}return _0x39e53d[_0x40d6('0x20')]();};}function saveUpdates(_0x48312b,_0x1f29b8){return function(_0x3dfbab){if(_0x3dfbab){return _0x3dfbab['update'](_0x48312b)['then'](function(_0x4fa4f2){return _0x4fa4f2;});}return null;};}function removeEntity(_0x45125d,_0x302def){return function(_0x3357ba){if(_0x3357ba){return _0x3357ba['destroy']()[_0x40d6('0x21')](function(){_0x45125d[_0x40d6('0x1c')](0xcc)[_0x40d6('0x16')]();});}};}function handleEntityNotFound(_0x2b7da1,_0x408265){return function(_0x5020eb){if(!_0x5020eb){_0x2b7da1[_0x40d6('0x15')](0x194);}return _0x5020eb;};}function handleError(_0x2ddc43,_0x298abd){_0x298abd=_0x298abd||0x1f4;return function(_0x127d40){logger[_0x40d6('0x22')](_0x127d40[_0x40d6('0x23')]);if(_0x127d40['name']){delete _0x127d40['name'];}_0x2ddc43[_0x40d6('0x1c')](_0x298abd)[_0x40d6('0x24')](_0x127d40);};}exports[_0x40d6('0x25')]=function(_0x33fcdd,_0x21fec7){var _0x8ff273={},_0x11566a={},_0x545df0={'count':0x0,'rows':[]};var _0x49476c=_[_0x40d6('0x26')](db['SalesforceConfiguration']['rawAttributes'],function(_0x45c95d){return{'name':_0x45c95d[_0x40d6('0x27')],'type':_0x45c95d['type']['key']};});_0x11566a[_0x40d6('0x28')]=_[_0x40d6('0x26')](_0x49476c,_0x40d6('0x29'));_0x11566a[_0x40d6('0x2a')]=_['keys'](_0x33fcdd[_0x40d6('0x2a')]);_0x11566a[_0x40d6('0x2b')]=_[_0x40d6('0x2c')](_0x11566a[_0x40d6('0x28')],_0x11566a['query']);_0x8ff273[_0x40d6('0x2d')]=_[_0x40d6('0x2c')](_0x11566a[_0x40d6('0x28')],qs[_0x40d6('0x2e')](_0x33fcdd[_0x40d6('0x2a')]['fields']));_0x8ff273['attributes']=_0x8ff273[_0x40d6('0x2d')][_0x40d6('0x2f')]?_0x8ff273[_0x40d6('0x2d')]:_0x11566a['model'];if(!_0x33fcdd[_0x40d6('0x2a')][_0x40d6('0x30')](_0x40d6('0x31'))){_0x8ff273[_0x40d6('0x1a')]=qs[_0x40d6('0x1a')](_0x33fcdd[_0x40d6('0x2a')]['limit']);_0x8ff273[_0x40d6('0x18')]=qs[_0x40d6('0x18')](_0x33fcdd[_0x40d6('0x2a')][_0x40d6('0x18')]);}_0x8ff273[_0x40d6('0x32')]=qs[_0x40d6('0x33')](_0x33fcdd['query'][_0x40d6('0x33')]);_0x8ff273[_0x40d6('0x34')]=qs[_0x40d6('0x2b')](_[_0x40d6('0x35')](_0x33fcdd[_0x40d6('0x2a')],_0x11566a[_0x40d6('0x2b')]),_0x49476c);if(_0x33fcdd[_0x40d6('0x2a')][_0x40d6('0x36')]){_0x8ff273[_0x40d6('0x34')]=_[_0x40d6('0x37')](_0x8ff273[_0x40d6('0x34')],{'$or':_[_0x40d6('0x26')](_0x49476c,function(_0x20a578){if(_0x20a578[_0x40d6('0x38')]!=='VIRTUAL'){var _0x5dac5c={};_0x5dac5c[_0x20a578[_0x40d6('0x29')]]={'$like':'%'+_0x33fcdd[_0x40d6('0x2a')]['filter']+'%'};return _0x5dac5c;}})});}_0x8ff273=_[_0x40d6('0x37')]({},_0x8ff273,_0x33fcdd[_0x40d6('0x39')]);var _0x323052={'where':_0x8ff273[_0x40d6('0x34')]};return db['SalesforceConfiguration'][_0x40d6('0x1b')](_0x323052)[_0x40d6('0x21')](function(_0x408976){_0x545df0[_0x40d6('0x1b')]=_0x408976;if(_0x33fcdd[_0x40d6('0x2a')][_0x40d6('0x3a')]){_0x8ff273[_0x40d6('0x3b')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x8ff273);})['then'](function(_0x50e0ae){_0x545df0[_0x40d6('0x3c')]=_0x50e0ae;return _0x545df0;})['then'](respondWithFilteredResult(_0x21fec7,_0x8ff273))[_0x40d6('0x3d')](handleError(_0x21fec7,null));};exports[_0x40d6('0x3e')]=function(_0x11fbc4,_0x39539a){var _0x5d4ea9={'raw':![],'where':{'id':_0x11fbc4['params']['id']}},_0x412827={};_0x412827[_0x40d6('0x28')]=_[_0x40d6('0x3f')](db[_0x40d6('0x40')]['rawAttributes']);_0x412827[_0x40d6('0x2a')]=_[_0x40d6('0x3f')](_0x11fbc4[_0x40d6('0x2a')]);_0x412827[_0x40d6('0x2b')]=_['intersection'](_0x412827['model'],_0x412827['query']);_0x5d4ea9[_0x40d6('0x2d')]=_[_0x40d6('0x2c')](_0x412827[_0x40d6('0x28')],qs['fields'](_0x11fbc4[_0x40d6('0x2a')][_0x40d6('0x2e')]));_0x5d4ea9[_0x40d6('0x2d')]=_0x5d4ea9[_0x40d6('0x2d')][_0x40d6('0x2f')]?_0x5d4ea9[_0x40d6('0x2d')]:_0x412827[_0x40d6('0x28')];if(_0x11fbc4['query']['includeAll']){_0x5d4ea9[_0x40d6('0x3b')]=[{'all':!![]}];}_0x5d4ea9=_[_0x40d6('0x37')]({},_0x5d4ea9,_0x11fbc4[_0x40d6('0x39')]);return db[_0x40d6('0x40')][_0x40d6('0x41')](_0x5d4ea9)[_0x40d6('0x21')](handleEntityNotFound(_0x39539a,null))[_0x40d6('0x21')](respondWithResult(_0x39539a,null))[_0x40d6('0x3d')](handleError(_0x39539a,null));};exports['create']=function(_0x1222b5,_0x169b9d){return db[_0x40d6('0x40')][_0x40d6('0x42')](_0x1222b5[_0x40d6('0x43')],{})[_0x40d6('0x21')](respondWithResult(_0x169b9d,0xc9))['catch'](handleError(_0x169b9d,null));};exports[_0x40d6('0x44')]=function(_0x3d9fe9,_0x5aaea0){if(_0x3d9fe9['body']['id']){delete _0x3d9fe9['body']['id'];}return db['SalesforceConfiguration'][_0x40d6('0x41')]({'where':{'id':_0x3d9fe9[_0x40d6('0x45')]['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0x5aaea0,null))[_0x40d6('0x21')](saveUpdates(_0x3d9fe9['body'],null))[_0x40d6('0x21')](respondWithResult(_0x5aaea0,null))[_0x40d6('0x3d')](handleError(_0x5aaea0,null));};exports[_0x40d6('0x46')]=function(_0x53765c,_0x1267a3){return db['SalesforceConfiguration'][_0x40d6('0x41')]({'where':{'id':_0x53765c[_0x40d6('0x45')]['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0x1267a3,null))[_0x40d6('0x21')](removeEntity(_0x1267a3,null))[_0x40d6('0x3d')](handleError(_0x1267a3,null));};exports[_0x40d6('0x47')]=function(_0x161ec9,_0xbebf8c,_0x5728b5){var _0x52dd73={};var _0x596945={};var _0x1b0f74;var _0x9c46e8;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x161ec9[_0x40d6('0x45')]['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0xbebf8c,null))[_0x40d6('0x21')](function(_0x28d88b){if(_0x28d88b){_0x1b0f74=_0x28d88b;_0x596945[_0x40d6('0x28')]=_[_0x40d6('0x3f')](db[_0x40d6('0x48')]['rawAttributes']);_0x596945['query']=_[_0x40d6('0x3f')](_0x161ec9[_0x40d6('0x2a')]);_0x596945[_0x40d6('0x2b')]=_[_0x40d6('0x2c')](_0x596945[_0x40d6('0x28')],_0x596945[_0x40d6('0x2a')]);_0x52dd73[_0x40d6('0x2d')]=_[_0x40d6('0x2c')](_0x596945['model'],qs['fields'](_0x161ec9['query']['fields']));_0x52dd73['attributes']=_0x52dd73[_0x40d6('0x2d')][_0x40d6('0x2f')]?_0x52dd73['attributes']:_0x596945[_0x40d6('0x28')];_0x52dd73[_0x40d6('0x32')]=qs['sort'](_0x161ec9[_0x40d6('0x2a')][_0x40d6('0x33')]);_0x52dd73[_0x40d6('0x34')]=qs[_0x40d6('0x2b')](_[_0x40d6('0x35')](_0x161ec9['query'],_0x596945[_0x40d6('0x2b')]));if(_0x161ec9['query'][_0x40d6('0x36')]){_0x52dd73[_0x40d6('0x34')]=_[_0x40d6('0x37')](_0x52dd73['where'],{'$or':_[_0x40d6('0x26')](_0x52dd73['attributes'],function(_0x24d90f){var _0x381d22={};_0x381d22[_0x24d90f]={'$like':'%'+_0x161ec9['query'][_0x40d6('0x36')]+'%'};return _0x381d22;})});}_0x52dd73=_[_0x40d6('0x37')]({},_0x52dd73,_0x161ec9['options']);return _0x1b0f74['getFields'](_0x52dd73);}})[_0x40d6('0x21')](function(_0x9980af){if(_0x9980af){_0x9c46e8=_0x9980af['length'];if(!_0x161ec9['query'][_0x40d6('0x30')]('nolimit')){_0x52dd73[_0x40d6('0x1a')]=qs[_0x40d6('0x1a')](_0x161ec9[_0x40d6('0x2a')][_0x40d6('0x1a')]);_0x52dd73[_0x40d6('0x18')]=qs[_0x40d6('0x18')](_0x161ec9[_0x40d6('0x2a')][_0x40d6('0x18')]);}return _0x1b0f74[_0x40d6('0x47')](_0x52dd73);}})[_0x40d6('0x21')](function(_0x527f01){if(_0x527f01){return _0x527f01?{'count':_0x9c46e8,'rows':_0x527f01}:null;}})[_0x40d6('0x21')](respondWithResult(_0xbebf8c,null))[_0x40d6('0x3d')](handleError(_0xbebf8c,null));};exports[_0x40d6('0x49')]=function(_0x110c74,_0x21b303,_0x4b187c){var _0xbcfcf0={};var _0x1b256f={};var _0x87e0b8;var _0x1bd6ac;return db[_0x40d6('0x40')][_0x40d6('0x4a')]({'where':{'id':_0x110c74[_0x40d6('0x45')]['id']}})[_0x40d6('0x21')](handleEntityNotFound(_0x21b303,null))[_0x40d6('0x21')](function(_0x359feb){if(_0x359feb){_0x87e0b8=_0x359feb;_0x1b256f[_0x40d6('0x28')]=_[_0x40d6('0x3f')](db[_0x40d6('0x48')][_0x40d6('0x4b')]);_0x1b256f[_0x40d6('0x2a')]=_[_0x40d6('0x3f')](_0x110c74[_0x40d6('0x2a')]);_0x1b256f['filters']=_[_0x40d6('0x2c')](_0x1b256f[_0x40d6('0x28')],_0x1b256f[_0x40d6('0x2a')]);_0xbcfcf0[_0x40d6('0x2d')]=_['intersection'](_0x1b256f[_0x40d6('0x28')],qs[_0x40d6('0x2e')](_0x110c74[_0x40d6('0x2a')]['fields']));_0xbcfcf0[_0x40d6('0x2d')]=_0xbcfcf0[_0x40d6('0x2d')][_0x40d6('0x2f')]?_0xbcfcf0[_0x40d6('0x2d')]:_0x1b256f[_0x40d6('0x28')];_0xbcfcf0[_0x40d6('0x32')]=qs[_0x40d6('0x33')](_0x110c74[_0x40d6('0x2a')][_0x40d6('0x33')]);_0xbcfcf0[_0x40d6('0x34')]=qs[_0x40d6('0x2b')](_[_0x40d6('0x35')](_0x110c74[_0x40d6('0x2a')],_0x1b256f[_0x40d6('0x2b')]));if(_0x110c74['query'][_0x40d6('0x36')]){_0xbcfcf0[_0x40d6('0x34')]=_[_0x40d6('0x37')](_0xbcfcf0[_0x40d6('0x34')],{'$or':_[_0x40d6('0x26')](_0xbcfcf0[_0x40d6('0x2d')],function(_0x1d25fa){var _0x217e84={};_0x217e84[_0x1d25fa]={'$like':'%'+_0x110c74[_0x40d6('0x2a')][_0x40d6('0x36')]+'%'};return _0x217e84;})});}_0xbcfcf0=_['merge']({},_0xbcfcf0,_0x110c74[_0x40d6('0x39')]);return _0x87e0b8[_0x40d6('0x49')](_0xbcfcf0);}})[_0x40d6('0x21')](function(_0x12890f){if(_0x12890f){_0x1bd6ac=_0x12890f[_0x40d6('0x2f')];if(!_0x110c74[_0x40d6('0x2a')][_0x40d6('0x30')](_0x40d6('0x31'))){_0xbcfcf0[_0x40d6('0x1a')]=qs[_0x40d6('0x1a')](_0x110c74[_0x40d6('0x2a')]['limit']);_0xbcfcf0['offset']=qs[_0x40d6('0x18')](_0x110c74['query'][_0x40d6('0x18')]);}return _0x87e0b8[_0x40d6('0x49')](_0xbcfcf0);}})['then'](function(_0x4eb7f3){if(_0x4eb7f3){return _0x4eb7f3?{'count':_0x1bd6ac,'rows':_0x4eb7f3}:null;}})[_0x40d6('0x21')](respondWithResult(_0x21b303,null))[_0x40d6('0x3d')](handleError(_0x21b303,null));};exports[_0x40d6('0x4c')]=function(_0x7ec64d,_0x2a48e6,_0x4105f8){var _0x3863b7={};var _0x5c9672={};var _0x76a7e5;var _0x16e408;return db[_0x40d6('0x40')][_0x40d6('0x4a')]({'where':{'id':_0x7ec64d[_0x40d6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a48e6,null))['then'](function(_0xd0ee98){if(_0xd0ee98){_0x76a7e5=_0xd0ee98;_0x5c9672[_0x40d6('0x28')]=_[_0x40d6('0x3f')](db[_0x40d6('0x48')][_0x40d6('0x4b')]);_0x5c9672[_0x40d6('0x2a')]=_[_0x40d6('0x3f')](_0x7ec64d[_0x40d6('0x2a')]);_0x5c9672[_0x40d6('0x2b')]=_[_0x40d6('0x2c')](_0x5c9672['model'],_0x5c9672['query']);_0x3863b7[_0x40d6('0x2d')]=_['intersection'](_0x5c9672['model'],qs[_0x40d6('0x2e')](_0x7ec64d['query'][_0x40d6('0x2e')]));_0x3863b7[_0x40d6('0x2d')]=_0x3863b7[_0x40d6('0x2d')][_0x40d6('0x2f')]?_0x3863b7['attributes']:_0x5c9672[_0x40d6('0x28')];_0x3863b7[_0x40d6('0x32')]=qs[_0x40d6('0x33')](_0x7ec64d[_0x40d6('0x2a')][_0x40d6('0x33')]);_0x3863b7['where']=qs['filters'](_['pick'](_0x7ec64d[_0x40d6('0x2a')],_0x5c9672[_0x40d6('0x2b')]));if(_0x7ec64d['query'][_0x40d6('0x36')]){_0x3863b7['where']=_[_0x40d6('0x37')](_0x3863b7['where'],{'$or':_[_0x40d6('0x26')](_0x3863b7[_0x40d6('0x2d')],function(_0x283f55){var _0x414e8e={};_0x414e8e[_0x283f55]={'$like':'%'+_0x7ec64d['query']['filter']+'%'};return _0x414e8e;})});}_0x3863b7=_[_0x40d6('0x37')]({},_0x3863b7,_0x7ec64d['options']);return _0x76a7e5[_0x40d6('0x4c')](_0x3863b7);}})[_0x40d6('0x21')](function(_0x1dd290){if(_0x1dd290){_0x16e408=_0x1dd290['length'];if(!_0x7ec64d['query'][_0x40d6('0x30')](_0x40d6('0x31'))){_0x3863b7[_0x40d6('0x1a')]=qs[_0x40d6('0x1a')](_0x7ec64d[_0x40d6('0x2a')][_0x40d6('0x1a')]);_0x3863b7[_0x40d6('0x18')]=qs[_0x40d6('0x18')](_0x7ec64d[_0x40d6('0x2a')][_0x40d6('0x18')]);}return _0x76a7e5['getDescriptions'](_0x3863b7);}})[_0x40d6('0x21')](function(_0x552a5f){if(_0x552a5f){return _0x552a5f?{'count':_0x16e408,'rows':_0x552a5f}:null;}})[_0x40d6('0x21')](respondWithResult(_0x2a48e6,null))['catch'](handleError(_0x2a48e6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index fa107e7..a8ab791 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 _0x7bd9=['api','moment','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','lodash'];(function(_0xeb7786,_0x53a053){var _0x120bbc=function(_0x291f05){while(--_0x291f05){_0xeb7786['push'](_0xeb7786['shift']());}};_0x120bbc(++_0x53a053);}(_0x7bd9,0x1ee));var _0x97bd=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7bd9[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0x97bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x97bd('0x1'));var moment=require(_0x97bd('0x2'));var BPromise=require(_0x97bd('0x3'));var rp=require(_0x97bd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x97bd('0x5'));var attributes=require(_0x97bd('0x6'));module['exports']=function(_0x23094b,_0x334ec3){return _0x23094b[_0x97bd('0x7')]('SalesforceConfiguration',attributes,{'tableName':_0x97bd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6673=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x564687,_0x39fa6b){var _0xa043d0=function(_0x4f1660){while(--_0x4f1660){_0x564687['push'](_0x564687['shift']());}};_0xa043d0(++_0x39fa6b);}(_0x6673,0x13a));var _0x3667=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x6673[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x3667('0x0'));var util=require(_0x3667('0x1'));var logger=require(_0x3667('0x2'))(_0x3667('0x3'));var moment=require(_0x3667('0x4'));var BPromise=require(_0x3667('0x5'));var rp=require(_0x3667('0x6'));var fs=require('fs');var path=require(_0x3667('0x7'));var rimraf=require(_0x3667('0x8'));var config=require(_0x3667('0x9'));var attributes=require(_0x3667('0xa'));module[_0x3667('0xb')]=function(_0x593bf5,_0x2854db){return _0x593bf5['define'](_0x3667('0xc'),attributes,{'tableName':_0x3667('0xd'),'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 716c192..b4b196e 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 _0x6b1a=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x34efa2,_0x413202){var _0x6dafe3=function(_0x46ef05){while(--_0x46ef05){_0x34efa2['push'](_0x34efa2['shift']());}};_0x6dafe3(++_0x413202);}(_0x6b1a,0xac));var _0xa6b1=function(_0x5ede42,_0x2b0bf5){_0x5ede42=_0x5ede42-0x0;var _0x30b2be=_0x6b1a[_0x5ede42];return _0x30b2be;};'use strict';var _=require(_0xa6b1('0x0'));var util=require('util');var moment=require(_0xa6b1('0x1'));var BPromise=require('bluebird');var rs=require(_0xa6b1('0x2'));var fs=require('fs');var Redis=require(_0xa6b1('0x3'));var db=require(_0xa6b1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6b1('0x5'))(_0xa6b1('0x6'));var config=require(_0xa6b1('0x7'));var jayson=require(_0xa6b1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3eda0b,_0x45264b,_0x443d18){return new BPromise(function(_0x406eba,_0x3dfc77){return client[_0xa6b1('0x9')](_0x3eda0b,_0x443d18)[_0xa6b1('0xa')](function(_0x26038f){logger[_0xa6b1('0xb')](_0xa6b1('0xc'),_0x45264b,_0xa6b1('0xd'));logger['debug'](_0xa6b1('0xe'),_0x45264b,'request\x20sent',JSON['stringify'](_0x26038f));if(_0x26038f[_0xa6b1('0xf')]){if(_0x26038f[_0xa6b1('0xf')]['code']===0x1f4){logger[_0xa6b1('0xf')](_0xa6b1('0xc'),_0x45264b,_0x26038f['error'][_0xa6b1('0x10')]);return _0x3dfc77(_0x26038f[_0xa6b1('0xf')][_0xa6b1('0x10')]);}logger[_0xa6b1('0xf')](_0xa6b1('0xc'),_0x45264b,_0x26038f[_0xa6b1('0xf')][_0xa6b1('0x10')]);return _0x406eba(_0x26038f['error'][_0xa6b1('0x10')]);}else{logger[_0xa6b1('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x45264b,'request\x20sent');_0x406eba(_0x26038f[_0xa6b1('0x11')][_0xa6b1('0x10')]);}})[_0xa6b1('0x12')](function(_0x178e1f){logger[_0xa6b1('0xf')](_0xa6b1('0xc'),_0x45264b,_0x178e1f);_0x3dfc77(_0x178e1f);});});} \ No newline at end of file +var _0x0bc4=['error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xd793f4,_0xba7b19){var _0x142994=function(_0x4300fe){while(--_0x4300fe){_0xd793f4['push'](_0xd793f4['shift']());}};_0x142994(++_0xba7b19);}(_0x0bc4,0x130));var _0x40bc=function(_0x190ed4,_0x5041a4){_0x190ed4=_0x190ed4-0x0;var _0x5d2ea4=_0x0bc4[_0x190ed4];return _0x5d2ea4;};'use strict';var _=require(_0x40bc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x40bc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40bc('0x2'))['db'];var utils=require(_0x40bc('0x3'));var logger=require(_0x40bc('0x4'))(_0x40bc('0x5'));var config=require(_0x40bc('0x6'));var jayson=require(_0x40bc('0x7'));var client=jayson[_0x40bc('0x8')][_0x40bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12cded,_0x32616d,_0x2b5e5d){return new BPromise(function(_0x12712a,_0x3b76c0){return client[_0x40bc('0xa')](_0x12cded,_0x2b5e5d)[_0x40bc('0xb')](function(_0x20c2fb){logger[_0x40bc('0xc')](_0x40bc('0xd'),_0x32616d,_0x40bc('0xe'));logger[_0x40bc('0xf')](_0x40bc('0x10'),_0x32616d,'request\x20sent',JSON[_0x40bc('0x11')](_0x20c2fb));if(_0x20c2fb['error']){if(_0x20c2fb[_0x40bc('0x12')][_0x40bc('0x13')]===0x1f4){logger['error'](_0x40bc('0xd'),_0x32616d,_0x20c2fb[_0x40bc('0x12')][_0x40bc('0x14')]);return _0x3b76c0(_0x20c2fb[_0x40bc('0x12')][_0x40bc('0x14')]);}logger[_0x40bc('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x32616d,_0x20c2fb[_0x40bc('0x12')]['message']);return _0x12712a(_0x20c2fb['error'][_0x40bc('0x14')]);}else{logger[_0x40bc('0xc')](_0x40bc('0xd'),_0x32616d,'request\x20sent');_0x12712a(_0x20c2fb[_0x40bc('0x15')][_0x40bc('0x14')]);}})[_0x40bc('0x16')](function(_0x4663fd){logger['error'](_0x40bc('0xd'),_0x32616d,_0x4663fd);_0x3b76c0(_0x4663fd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e59e4a5..cc55156 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 _0x6563=['get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','./intSalesforceField.controller'];(function(_0x479993,_0x5c5a1a){var _0x1a37a2=function(_0x709e91){while(--_0x709e91){_0x479993['push'](_0x479993['shift']());}};_0x1a37a2(++_0x5c5a1a);}(_0x6563,0x1e8));var _0x3656=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0x6563[_0x2726ad];return _0xd87993;};'use strict';var multer=require('multer');var util=require(_0x3656('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3656('0x1')]();var fs_extra=require(_0x3656('0x2'));var auth=require(_0x3656('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3656('0x4'));router[_0x3656('0x5')]('/',auth['isAuthenticated'](),controller[_0x3656('0x6')]);router[_0x3656('0x5')](_0x3656('0x7'),auth['isAuthenticated'](),controller[_0x3656('0x8')]);router[_0x3656('0x9')]('/',auth[_0x3656('0xa')](),controller[_0x3656('0xb')]);router[_0x3656('0xc')]('/:id',auth[_0x3656('0xa')](),controller[_0x3656('0xd')]);router[_0x3656('0xe')](_0x3656('0x7'),auth[_0x3656('0xa')](),controller[_0x3656('0xf')]);module[_0x3656('0x10')]=router; \ No newline at end of file +var _0xe561=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b7d51,_0x4aa4d7){var _0x2f1d84=function(_0x523c81){while(--_0x523c81){_0x2b7d51['push'](_0x2b7d51['shift']());}};_0x2f1d84(++_0x4aa4d7);}(_0xe561,0x1f0));var _0x1e56=function(_0x510475,_0x582e32){_0x510475=_0x510475-0x0;var _0x3d300a=_0xe561[_0x510475];return _0x3d300a;};'use strict';var multer=require(_0x1e56('0x0'));var util=require(_0x1e56('0x1'));var path=require(_0x1e56('0x2'));var timeout=require(_0x1e56('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e56('0x4'));var auth=require(_0x1e56('0x5'));var interaction=require(_0x1e56('0x6'));var config=require(_0x1e56('0x7'));var controller=require(_0x1e56('0x8'));router[_0x1e56('0x9')]('/',auth[_0x1e56('0xa')](),controller[_0x1e56('0xb')]);router[_0x1e56('0x9')](_0x1e56('0xc'),auth[_0x1e56('0xa')](),controller[_0x1e56('0xd')]);router[_0x1e56('0xe')]('/',auth[_0x1e56('0xa')](),controller[_0x1e56('0xf')]);router['put'](_0x1e56('0xc'),auth[_0x1e56('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1e56('0x10')]);module[_0x1e56('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index ab22a1f..d414a56 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 _0xfeed=['picklist','STRING','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x540abf,_0x2bd579){var _0x551eda=function(_0x57840d){while(--_0x57840d){_0x540abf['push'](_0x540abf['shift']());}};_0x551eda(++_0x2bd579);}(_0xfeed,0x12a));var _0xdfee=function(_0x5a0d14,_0x28f0dd){_0x5a0d14=_0x5a0d14-0x0;var _0x17a4cf=_0xfeed[_0x5a0d14];return _0x17a4cf;};'use strict';var Sequelize=require(_0xdfee('0x0'));module['exports']={'type':{'type':Sequelize[_0xdfee('0x1')](_0xdfee('0x2'),_0xdfee('0x3'),_0xdfee('0x4'),_0xdfee('0x5'),_0xdfee('0x6')),'defaultValue':_0xdfee('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdfee('0x1')](_0xdfee('0x2'),_0xdfee('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdfee('0x7')]},'variableName':{'type':Sequelize[_0xdfee('0x7')]}}; \ No newline at end of file +var _0x0aaf=['exports','ENUM','variable','customVariable','keyValue','string','STRING','sequelize'];(function(_0x535d1c,_0x45d3c2){var _0x1430e2=function(_0x1c221c){while(--_0x1c221c){_0x535d1c['push'](_0x535d1c['shift']());}};_0x1430e2(++_0x45d3c2);}(_0x0aaf,0x6f));var _0xf0aa=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0x0aaf[_0x270a54];return _0x4d07d0;};'use strict';var Sequelize=require(_0xf0aa('0x0'));module[_0xf0aa('0x1')]={'type':{'type':Sequelize[_0xf0aa('0x2')]('string',_0xf0aa('0x3'),_0xf0aa('0x4'),_0xf0aa('0x5'),'picklist'),'defaultValue':_0xf0aa('0x6')},'content':{'type':Sequelize[_0xf0aa('0x7')]},'key':{'type':Sequelize[_0xf0aa('0x7')]},'keyType':{'type':Sequelize[_0xf0aa('0x2')](_0xf0aa('0x6'),_0xf0aa('0x3'),_0xf0aa('0x4'))},'keyContent':{'type':Sequelize[_0xf0aa('0x7')]},'idField':{'type':Sequelize[_0xf0aa('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 68d2166..d64f964 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 _0x0e58=['model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','params','length','find','create','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x0e58,0x1e9));var _0x80e5=function(_0x14fe1a,_0x5bc7c8){_0x14fe1a=_0x14fe1a-0x0;var _0x540aa8=_0x0e58[_0x14fe1a];return _0x540aa8;};'use strict';var emlformat=require(_0x80e5('0x0'));var rimraf=require(_0x80e5('0x1'));var zipdir=require(_0x80e5('0x2'));var jsonpatch=require(_0x80e5('0x3'));var rp=require(_0x80e5('0x4'));var moment=require(_0x80e5('0x5'));var BPromise=require(_0x80e5('0x6'));var Mustache=require(_0x80e5('0x7'));var util=require(_0x80e5('0x8'));var path=require(_0x80e5('0x9'));var sox=require(_0x80e5('0xa'));var csv=require(_0x80e5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80e5('0xc'));var _=require(_0x80e5('0xd'));var squel=require(_0x80e5('0xe'));var crypto=require(_0x80e5('0xf'));var jsforce=require(_0x80e5('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x80e5('0xb'));var querystring=require(_0x80e5('0x11'));var Papa=require(_0x80e5('0x12'));var Redis=require(_0x80e5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x80e5('0x14'));var as=require(_0x80e5('0x15'));var hardwareService=require(_0x80e5('0x16'));var logger=require(_0x80e5('0x17'))(_0x80e5('0x18'));var utils=require('../../config/utils');var config=require(_0x80e5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x80e5('0x1a'))['db'];function respondWithStatusCode(_0x5826e8,_0x9fc0bc){_0x9fc0bc=_0x9fc0bc||0xcc;return function(_0x5558b5){if(_0x5558b5){return _0x5826e8[_0x80e5('0x1b')](_0x9fc0bc);}return _0x5826e8[_0x80e5('0x1c')](_0x9fc0bc)[_0x80e5('0x1d')]();};}function respondWithResult(_0x5b914a,_0x1ccee7){_0x1ccee7=_0x1ccee7||0xc8;return function(_0x492548){if(_0x492548){return _0x5b914a['status'](_0x1ccee7)[_0x80e5('0x1e')](_0x492548);}};}function respondWithFilteredResult(_0x6da766,_0x158d54){return function(_0x58ae61){if(_0x58ae61){var _0x350804=typeof _0x158d54['offset']===_0x80e5('0x1f')&&typeof _0x158d54[_0x80e5('0x20')]===_0x80e5('0x1f');var _0x3215fa=_0x58ae61[_0x80e5('0x21')];var _0x3487e7=_0x350804?0x0:_0x158d54[_0x80e5('0x22')];var _0x407ce7=_0x350804?_0x58ae61[_0x80e5('0x21')]:_0x158d54[_0x80e5('0x22')]+_0x158d54[_0x80e5('0x20')];var _0x224a42;if(_0x407ce7>=_0x3215fa){_0x407ce7=_0x3215fa;_0x224a42=0xc8;}else{_0x224a42=0xce;}_0x6da766[_0x80e5('0x1c')](_0x224a42);return _0x6da766[_0x80e5('0x23')]('Content-Range',_0x3487e7+'-'+_0x407ce7+'/'+_0x3215fa)[_0x80e5('0x1e')](_0x58ae61);}return null;};}function patchUpdates(_0x553d7e){return function(_0x48ae9f){try{jsonpatch[_0x80e5('0x24')](_0x48ae9f,_0x553d7e,!![]);}catch(_0x29312b){return BPromise[_0x80e5('0x25')](_0x29312b);}return _0x48ae9f[_0x80e5('0x26')]();};}function saveUpdates(_0x4a77a0,_0x302ad9){return function(_0x25f15d){if(_0x25f15d){return _0x25f15d[_0x80e5('0x27')](_0x4a77a0)[_0x80e5('0x28')](function(_0x759348){return _0x759348;});}return null;};}function removeEntity(_0x2f1b2d,_0x17bb0a){return function(_0x2fdb84){if(_0x2fdb84){return _0x2fdb84[_0x80e5('0x29')]()[_0x80e5('0x28')](function(){_0x2f1b2d[_0x80e5('0x1c')](0xcc)[_0x80e5('0x1d')]();});}};}function handleEntityNotFound(_0x3cfa15,_0x6e603a){return function(_0x5f578a){if(!_0x5f578a){_0x3cfa15[_0x80e5('0x1b')](0x194);}return _0x5f578a;};}function handleError(_0x1dc062,_0x263553){_0x263553=_0x263553||0x1f4;return function(_0x3e5959){logger[_0x80e5('0x2a')](_0x3e5959[_0x80e5('0x2b')]);if(_0x3e5959[_0x80e5('0x2c')]){delete _0x3e5959[_0x80e5('0x2c')];}_0x1dc062['status'](_0x263553)[_0x80e5('0x2d')](_0x3e5959);};}exports[_0x80e5('0x2e')]=function(_0xe7595f,_0x1b5dbb){var _0x2f7e35={},_0xce06be={},_0x2795cb={'count':0x0,'rows':[]};var _0x452a2d=_[_0x80e5('0x2f')](db[_0x80e5('0x30')][_0x80e5('0x31')],function(_0x74344a){return{'name':_0x74344a[_0x80e5('0x32')],'type':_0x74344a[_0x80e5('0x33')][_0x80e5('0x34')]};});_0xce06be['model']=_[_0x80e5('0x2f')](_0x452a2d,_0x80e5('0x2c'));_0xce06be[_0x80e5('0x35')]=_[_0x80e5('0x36')](_0xe7595f[_0x80e5('0x35')]);_0xce06be[_0x80e5('0x37')]=_[_0x80e5('0x38')](_0xce06be[_0x80e5('0x39')],_0xce06be[_0x80e5('0x35')]);_0x2f7e35['attributes']=_[_0x80e5('0x38')](_0xce06be[_0x80e5('0x39')],qs[_0x80e5('0x3a')](_0xe7595f[_0x80e5('0x35')][_0x80e5('0x3a')]));_0x2f7e35['attributes']=_0x2f7e35['attributes']['length']?_0x2f7e35[_0x80e5('0x3b')]:_0xce06be[_0x80e5('0x39')];if(!_0xe7595f[_0x80e5('0x35')][_0x80e5('0x3c')](_0x80e5('0x3d'))){_0x2f7e35[_0x80e5('0x20')]=qs[_0x80e5('0x20')](_0xe7595f[_0x80e5('0x35')]['limit']);_0x2f7e35[_0x80e5('0x22')]=qs[_0x80e5('0x22')](_0xe7595f[_0x80e5('0x35')][_0x80e5('0x22')]);}_0x2f7e35[_0x80e5('0x3e')]=qs['sort'](_0xe7595f[_0x80e5('0x35')][_0x80e5('0x3f')]);_0x2f7e35['where']=qs[_0x80e5('0x37')](_[_0x80e5('0x40')](_0xe7595f[_0x80e5('0x35')],_0xce06be[_0x80e5('0x37')]),_0x452a2d);if(_0xe7595f[_0x80e5('0x35')][_0x80e5('0x41')]){_0x2f7e35[_0x80e5('0x42')]=_[_0x80e5('0x43')](_0x2f7e35[_0x80e5('0x42')],{'$or':_[_0x80e5('0x2f')](_0x452a2d,function(_0x33b053){if(_0x33b053['type']!==_0x80e5('0x44')){var _0x44c6bf={};_0x44c6bf[_0x33b053[_0x80e5('0x2c')]]={'$like':'%'+_0xe7595f[_0x80e5('0x35')][_0x80e5('0x41')]+'%'};return _0x44c6bf;}})});}_0x2f7e35=_['merge']({},_0x2f7e35,_0xe7595f[_0x80e5('0x45')]);var _0x81a113={'where':_0x2f7e35[_0x80e5('0x42')]};return db['SalesforceField'][_0x80e5('0x21')](_0x81a113)['then'](function(_0x16565a){_0x2795cb[_0x80e5('0x21')]=_0x16565a;if(_0xe7595f['query']['includeAll']){_0x2f7e35[_0x80e5('0x46')]=[{'all':!![]}];}return db['SalesforceField'][_0x80e5('0x47')](_0x2f7e35);})[_0x80e5('0x28')](function(_0x4aeb46){_0x2795cb['rows']=_0x4aeb46;return _0x2795cb;})['then'](respondWithFilteredResult(_0x1b5dbb,_0x2f7e35))[_0x80e5('0x48')](handleError(_0x1b5dbb,null));};exports['show']=function(_0x39abb1,_0x8ea053){var _0x256fdc={'raw':!![],'where':{'id':_0x39abb1[_0x80e5('0x49')]['id']}},_0x94a856={};_0x94a856[_0x80e5('0x39')]=_[_0x80e5('0x36')](db[_0x80e5('0x30')]['rawAttributes']);_0x94a856[_0x80e5('0x35')]=_[_0x80e5('0x36')](_0x39abb1[_0x80e5('0x35')]);_0x94a856[_0x80e5('0x37')]=_[_0x80e5('0x38')](_0x94a856[_0x80e5('0x39')],_0x94a856[_0x80e5('0x35')]);_0x256fdc[_0x80e5('0x3b')]=_['intersection'](_0x94a856[_0x80e5('0x39')],qs[_0x80e5('0x3a')](_0x39abb1[_0x80e5('0x35')][_0x80e5('0x3a')]));_0x256fdc[_0x80e5('0x3b')]=_0x256fdc['attributes'][_0x80e5('0x4a')]?_0x256fdc[_0x80e5('0x3b')]:_0x94a856[_0x80e5('0x39')];if(_0x39abb1[_0x80e5('0x35')]['includeAll']){_0x256fdc['include']=[{'all':!![]}];}_0x256fdc=_['merge']({},_0x256fdc,_0x39abb1[_0x80e5('0x45')]);return db[_0x80e5('0x30')][_0x80e5('0x4b')](_0x256fdc)[_0x80e5('0x28')](handleEntityNotFound(_0x8ea053,null))[_0x80e5('0x28')](respondWithResult(_0x8ea053,null))[_0x80e5('0x48')](handleError(_0x8ea053,null));};exports[_0x80e5('0x4c')]=function(_0x2a8162,_0x5732ba){return db[_0x80e5('0x30')][_0x80e5('0x4c')](_0x2a8162[_0x80e5('0x4d')],{})['then'](respondWithResult(_0x5732ba,0xc9))[_0x80e5('0x48')](handleError(_0x5732ba,null));};exports[_0x80e5('0x27')]=function(_0x80d774,_0x42fbdd){if(_0x80d774['body']['id']){delete _0x80d774[_0x80e5('0x4d')]['id'];}return db['SalesforceField'][_0x80e5('0x4b')]({'where':{'id':_0x80d774['params']['id']}})[_0x80e5('0x28')](handleEntityNotFound(_0x42fbdd,null))[_0x80e5('0x28')](saveUpdates(_0x80d774[_0x80e5('0x4d')],null))[_0x80e5('0x28')](respondWithResult(_0x42fbdd,null))['catch'](handleError(_0x42fbdd,null));};exports['destroy']=function(_0x5efa3e,_0x50f822){return db['SalesforceField']['find']({'where':{'id':_0x5efa3e['params']['id']}})['then'](handleEntityNotFound(_0x50f822,null))[_0x80e5('0x28')](removeEntity(_0x50f822,null))[_0x80e5('0x48')](handleError(_0x50f822,null));}; \ No newline at end of file +var _0x2926=['keys','find','create','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceField','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','catch'];(function(_0x51ca22,_0x293044){var _0x5ea264=function(_0x350c88){while(--_0x350c88){_0x51ca22['push'](_0x51ca22['shift']());}};_0x5ea264(++_0x293044);}(_0x2926,0x95));var _0x6292=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x2926[_0xce6f11];return _0x35b709;};'use strict';var emlformat=require(_0x6292('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6292('0x1'));var rp=require(_0x6292('0x2'));var moment=require(_0x6292('0x3'));var BPromise=require(_0x6292('0x4'));var Mustache=require('mustache');var util=require(_0x6292('0x5'));var path=require(_0x6292('0x6'));var sox=require(_0x6292('0x7'));var csv=require(_0x6292('0x8'));var ejs=require(_0x6292('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6292('0xa'));var squel=require(_0x6292('0xb'));var crypto=require(_0x6292('0xc'));var jsforce=require(_0x6292('0xd'));var deskjs=require(_0x6292('0xe'));var toCsv=require(_0x6292('0x8'));var querystring=require(_0x6292('0xf'));var Papa=require('papaparse');var Redis=require(_0x6292('0x10'));var authService=require(_0x6292('0x11'));var qs=require(_0x6292('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6292('0x13'))(_0x6292('0x14'));var utils=require(_0x6292('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6292('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f2474,_0x52d95c){_0x52d95c=_0x52d95c||0xcc;return function(_0x7cb321){if(_0x7cb321){return _0x4f2474[_0x6292('0x17')](_0x52d95c);}return _0x4f2474['status'](_0x52d95c)[_0x6292('0x18')]();};}function respondWithResult(_0x46dd56,_0x1a7fa2){_0x1a7fa2=_0x1a7fa2||0xc8;return function(_0x523e38){if(_0x523e38){return _0x46dd56[_0x6292('0x19')](_0x1a7fa2)[_0x6292('0x1a')](_0x523e38);}};}function respondWithFilteredResult(_0x5a1abb,_0x1b0af4){return function(_0x530edb){if(_0x530edb){var _0x4e2058=typeof _0x1b0af4[_0x6292('0x1b')]==='undefined'&&typeof _0x1b0af4[_0x6292('0x1c')]===_0x6292('0x1d');var _0x1e9c61=_0x530edb[_0x6292('0x1e')];var _0x54d7da=_0x4e2058?0x0:_0x1b0af4['offset'];var _0x3dcc05=_0x4e2058?_0x530edb[_0x6292('0x1e')]:_0x1b0af4['offset']+_0x1b0af4[_0x6292('0x1c')];var _0x596c25;if(_0x3dcc05>=_0x1e9c61){_0x3dcc05=_0x1e9c61;_0x596c25=0xc8;}else{_0x596c25=0xce;}_0x5a1abb[_0x6292('0x19')](_0x596c25);return _0x5a1abb[_0x6292('0x1f')](_0x6292('0x20'),_0x54d7da+'-'+_0x3dcc05+'/'+_0x1e9c61)['json'](_0x530edb);}return null;};}function patchUpdates(_0x1adb95){return function(_0x511582){try{jsonpatch[_0x6292('0x21')](_0x511582,_0x1adb95,!![]);}catch(_0x32c6cd){return BPromise[_0x6292('0x22')](_0x32c6cd);}return _0x511582['save']();};}function saveUpdates(_0x5044f0,_0x55b2d4){return function(_0x527c63){if(_0x527c63){return _0x527c63[_0x6292('0x23')](_0x5044f0)[_0x6292('0x24')](function(_0x2b2946){return _0x2b2946;});}return null;};}function removeEntity(_0x3fcf38,_0x3fa83c){return function(_0x1d8c99){if(_0x1d8c99){return _0x1d8c99[_0x6292('0x25')]()[_0x6292('0x24')](function(){_0x3fcf38[_0x6292('0x19')](0xcc)[_0x6292('0x18')]();});}};}function handleEntityNotFound(_0xe0b1b9,_0x72dadc){return function(_0x4d70db){if(!_0x4d70db){_0xe0b1b9['sendStatus'](0x194);}return _0x4d70db;};}function handleError(_0x58f6a5,_0x15ee8c){_0x15ee8c=_0x15ee8c||0x1f4;return function(_0x289f08){logger[_0x6292('0x26')](_0x289f08[_0x6292('0x27')]);if(_0x289f08['name']){delete _0x289f08[_0x6292('0x28')];}_0x58f6a5[_0x6292('0x19')](_0x15ee8c)['send'](_0x289f08);};}exports[_0x6292('0x29')]=function(_0x20bca9,_0x521f53){var _0xa4b67b={},_0x4c331a={},_0x2c1bdc={'count':0x0,'rows':[]};var _0x2ba3e9=_[_0x6292('0x2a')](db[_0x6292('0x2b')][_0x6292('0x2c')],function(_0x10f65d){return{'name':_0x10f65d['fieldName'],'type':_0x10f65d[_0x6292('0x2d')][_0x6292('0x2e')]};});_0x4c331a[_0x6292('0x2f')]=_['map'](_0x2ba3e9,_0x6292('0x28'));_0x4c331a[_0x6292('0x30')]=_['keys'](_0x20bca9['query']);_0x4c331a['filters']=_['intersection'](_0x4c331a[_0x6292('0x2f')],_0x4c331a['query']);_0xa4b67b[_0x6292('0x31')]=_[_0x6292('0x32')](_0x4c331a[_0x6292('0x2f')],qs['fields'](_0x20bca9[_0x6292('0x30')][_0x6292('0x33')]));_0xa4b67b[_0x6292('0x31')]=_0xa4b67b[_0x6292('0x31')][_0x6292('0x34')]?_0xa4b67b['attributes']:_0x4c331a[_0x6292('0x2f')];if(!_0x20bca9[_0x6292('0x30')][_0x6292('0x35')](_0x6292('0x36'))){_0xa4b67b['limit']=qs[_0x6292('0x1c')](_0x20bca9['query'][_0x6292('0x1c')]);_0xa4b67b[_0x6292('0x1b')]=qs[_0x6292('0x1b')](_0x20bca9['query'][_0x6292('0x1b')]);}_0xa4b67b[_0x6292('0x37')]=qs[_0x6292('0x38')](_0x20bca9[_0x6292('0x30')][_0x6292('0x38')]);_0xa4b67b[_0x6292('0x39')]=qs[_0x6292('0x3a')](_[_0x6292('0x3b')](_0x20bca9[_0x6292('0x30')],_0x4c331a[_0x6292('0x3a')]),_0x2ba3e9);if(_0x20bca9[_0x6292('0x30')]['filter']){_0xa4b67b[_0x6292('0x39')]=_[_0x6292('0x3c')](_0xa4b67b[_0x6292('0x39')],{'$or':_[_0x6292('0x2a')](_0x2ba3e9,function(_0x435eec){if(_0x435eec['type']!=='VIRTUAL'){var _0x502fa3={};_0x502fa3[_0x435eec[_0x6292('0x28')]]={'$like':'%'+_0x20bca9['query'][_0x6292('0x3d')]+'%'};return _0x502fa3;}})});}_0xa4b67b=_[_0x6292('0x3c')]({},_0xa4b67b,_0x20bca9[_0x6292('0x3e')]);var _0x413c82={'where':_0xa4b67b[_0x6292('0x39')]};return db[_0x6292('0x2b')][_0x6292('0x1e')](_0x413c82)[_0x6292('0x24')](function(_0xceae35){_0x2c1bdc[_0x6292('0x1e')]=_0xceae35;if(_0x20bca9[_0x6292('0x30')][_0x6292('0x3f')]){_0xa4b67b[_0x6292('0x40')]=[{'all':!![]}];}return db['SalesforceField'][_0x6292('0x41')](_0xa4b67b);})['then'](function(_0x4a6518){_0x2c1bdc['rows']=_0x4a6518;return _0x2c1bdc;})[_0x6292('0x24')](respondWithFilteredResult(_0x521f53,_0xa4b67b))[_0x6292('0x42')](handleError(_0x521f53,null));};exports['show']=function(_0x2ea15d,_0x2b910e){var _0x3f95cf={'raw':!![],'where':{'id':_0x2ea15d['params']['id']}},_0x5841f5={};_0x5841f5[_0x6292('0x2f')]=_[_0x6292('0x43')](db[_0x6292('0x2b')][_0x6292('0x2c')]);_0x5841f5[_0x6292('0x30')]=_[_0x6292('0x43')](_0x2ea15d[_0x6292('0x30')]);_0x5841f5[_0x6292('0x3a')]=_[_0x6292('0x32')](_0x5841f5[_0x6292('0x2f')],_0x5841f5['query']);_0x3f95cf[_0x6292('0x31')]=_['intersection'](_0x5841f5[_0x6292('0x2f')],qs['fields'](_0x2ea15d['query'][_0x6292('0x33')]));_0x3f95cf[_0x6292('0x31')]=_0x3f95cf['attributes'][_0x6292('0x34')]?_0x3f95cf[_0x6292('0x31')]:_0x5841f5[_0x6292('0x2f')];if(_0x2ea15d[_0x6292('0x30')]['includeAll']){_0x3f95cf['include']=[{'all':!![]}];}_0x3f95cf=_[_0x6292('0x3c')]({},_0x3f95cf,_0x2ea15d[_0x6292('0x3e')]);return db['SalesforceField'][_0x6292('0x44')](_0x3f95cf)[_0x6292('0x24')](handleEntityNotFound(_0x2b910e,null))[_0x6292('0x24')](respondWithResult(_0x2b910e,null))[_0x6292('0x42')](handleError(_0x2b910e,null));};exports[_0x6292('0x45')]=function(_0x456deb,_0xe0a95f){return db[_0x6292('0x2b')][_0x6292('0x45')](_0x456deb[_0x6292('0x46')],{})[_0x6292('0x24')](respondWithResult(_0xe0a95f,0xc9))[_0x6292('0x42')](handleError(_0xe0a95f,null));};exports['update']=function(_0x47fdf9,_0x49bea3){if(_0x47fdf9[_0x6292('0x46')]['id']){delete _0x47fdf9['body']['id'];}return db[_0x6292('0x2b')][_0x6292('0x44')]({'where':{'id':_0x47fdf9[_0x6292('0x47')]['id']}})[_0x6292('0x24')](handleEntityNotFound(_0x49bea3,null))[_0x6292('0x24')](saveUpdates(_0x47fdf9[_0x6292('0x46')],null))[_0x6292('0x24')](respondWithResult(_0x49bea3,null))[_0x6292('0x42')](handleError(_0x49bea3,null));};exports['destroy']=function(_0x1c57e7,_0x10ab39){return db['SalesforceField']['find']({'where':{'id':_0x1c57e7[_0x6292('0x47')]['id']}})['then'](handleEntityNotFound(_0x10ab39,null))[_0x6292('0x24')](removeEntity(_0x10ab39,null))[_0x6292('0x42')](handleError(_0x10ab39,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 56a96a8..bfefa43 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 _0x8c31=['salesforce_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','path','exports','int_salesforce_fields'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x8c31,0xf5));var _0x18c3=function(_0x2ff581,_0x334b2){_0x2ff581=_0x2ff581-0x0;var _0x41b001=_0x8c31[_0x2ff581];return _0x41b001;};'use strict';var _=require(_0x18c3('0x0'));var util=require(_0x18c3('0x1'));var logger=require('../../config/logger')(_0x18c3('0x2'));var moment=require(_0x18c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x18c3('0x4'));var fs=require('fs');var path=require(_0x18c3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x18c3('0x6')]=function(_0x2ef0ca,_0x543606){return _0x2ef0ca['define']('SalesforceField',attributes,{'tableName':_0x18c3('0x7'),'paranoid':![],'indexes':[{'name':_0x18c3('0x8'),'fields':[_0x18c3('0x9'),_0x18c3('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeeeb=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','path'];(function(_0x31ca61,_0x4667d2){var _0x359e5e=function(_0x1cd616){while(--_0x1cd616){_0x31ca61['push'](_0x31ca61['shift']());}};_0x359e5e(++_0x4667d2);}(_0xeeeb,0x1da));var _0xbeee=function(_0x56d700,_0x379b88){_0x56d700=_0x56d700-0x0;var _0x2cc7d2=_0xeeeb[_0x56d700];return _0x2cc7d2;};'use strict';var _=require('lodash');var util=require(_0xbeee('0x0'));var logger=require(_0xbeee('0x1'))(_0xbeee('0x2'));var moment=require(_0xbeee('0x3'));var BPromise=require(_0xbeee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbeee('0x5'));var rimraf=require(_0xbeee('0x6'));var config=require(_0xbeee('0x7'));var attributes=require(_0xbeee('0x8'));module[_0xbeee('0x9')]=function(_0x161750,_0x332062){return _0x161750[_0xbeee('0xa')](_0xbeee('0xb'),attributes,{'tableName':_0xbeee('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xbeee('0xd'),_0xbeee('0xe')],'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 db4a83d..5e05c3b 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 _0x176b=['request\x20sent','debug','stringify','error','code','message','info','result','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','SalesforceField,\x20%s,\x20%s'];(function(_0x34078e,_0x2705fe){var _0x427bdf=function(_0x517119){while(--_0x517119){_0x34078e['push'](_0x34078e['shift']());}};_0x427bdf(++_0x2705fe);}(_0x176b,0xd9));var _0xb176=function(_0x11a383,_0x4e05ae){_0x11a383=_0x11a383-0x0;var _0x49f2bb=_0x176b[_0x11a383];return _0x49f2bb;};'use strict';var _=require('lodash');var util=require(_0xb176('0x0'));var moment=require('moment');var BPromise=require(_0xb176('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb176('0x2'));var db=require(_0xb176('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb176('0x4'))(_0xb176('0x5'));var config=require(_0xb176('0x6'));var jayson=require(_0xb176('0x7'));var client=jayson['client'][_0xb176('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e6958,_0x2cb79f,_0xd1ddd4){return new BPromise(function(_0x15dad1,_0x4ff98f){return client[_0xb176('0x9')](_0x2e6958,_0xd1ddd4)['then'](function(_0x4c322b){logger['info'](_0xb176('0xa'),_0x2cb79f,_0xb176('0xb'));logger[_0xb176('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2cb79f,_0xb176('0xb'),JSON[_0xb176('0xd')](_0x4c322b));if(_0x4c322b[_0xb176('0xe')]){if(_0x4c322b[_0xb176('0xe')][_0xb176('0xf')]===0x1f4){logger[_0xb176('0xe')]('SalesforceField,\x20%s,\x20%s',_0x2cb79f,_0x4c322b[_0xb176('0xe')]['message']);return _0x4ff98f(_0x4c322b[_0xb176('0xe')][_0xb176('0x10')]);}logger[_0xb176('0xe')](_0xb176('0xa'),_0x2cb79f,_0x4c322b['error'][_0xb176('0x10')]);return _0x15dad1(_0x4c322b[_0xb176('0xe')][_0xb176('0x10')]);}else{logger[_0xb176('0x11')]('SalesforceField,\x20%s,\x20%s',_0x2cb79f,_0xb176('0xb'));_0x15dad1(_0x4c322b[_0xb176('0x12')][_0xb176('0x10')]);}})['catch'](function(_0x675821){logger[_0xb176('0xe')](_0xb176('0xa'),_0x2cb79f,_0x675821);_0x4ff98f(_0x675821);});});} \ No newline at end of file +var _0x5106=['client','http','request','then','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2d7d6a,_0x37b106){var _0x323ec9=function(_0x480312){while(--_0x480312){_0x2d7d6a['push'](_0x2d7d6a['shift']());}};_0x323ec9(++_0x37b106);}(_0x5106,0x10b));var _0x6510=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5106[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x6510('0x0'));var moment=require('moment');var BPromise=require(_0x6510('0x1'));var rs=require(_0x6510('0x2'));var fs=require('fs');var Redis=require(_0x6510('0x3'));var db=require(_0x6510('0x4'))['db'];var utils=require(_0x6510('0x5'));var logger=require(_0x6510('0x6'))('rpc');var config=require(_0x6510('0x7'));var jayson=require(_0x6510('0x8'));var client=jayson[_0x6510('0x9')][_0x6510('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbf6e5a,_0x68b7b9,_0xabb999){return new BPromise(function(_0xedd2b,_0x51e034){return client[_0x6510('0xb')](_0xbf6e5a,_0xabb999)[_0x6510('0xc')](function(_0x58db1a){logger['info']('SalesforceField,\x20%s,\x20%s',_0x68b7b9,_0x6510('0xd'));logger[_0x6510('0xe')](_0x6510('0xf'),_0x68b7b9,'request\x20sent',JSON[_0x6510('0x10')](_0x58db1a));if(_0x58db1a[_0x6510('0x11')]){if(_0x58db1a[_0x6510('0x11')][_0x6510('0x12')]===0x1f4){logger[_0x6510('0x11')](_0x6510('0x13'),_0x68b7b9,_0x58db1a[_0x6510('0x11')]['message']);return _0x51e034(_0x58db1a[_0x6510('0x11')][_0x6510('0x14')]);}logger[_0x6510('0x11')](_0x6510('0x13'),_0x68b7b9,_0x58db1a[_0x6510('0x11')][_0x6510('0x14')]);return _0xedd2b(_0x58db1a['error'][_0x6510('0x14')]);}else{logger[_0x6510('0x15')](_0x6510('0x13'),_0x68b7b9,_0x6510('0xd'));_0xedd2b(_0x58db1a['result'][_0x6510('0x14')]);}})[_0x6510('0x16')](function(_0x24789f){logger['error'](_0x6510('0x13'),_0x68b7b9,_0x24789f);_0x51e034(_0x24789f);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 1a54601..95e8fe1 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 _0xd08c=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xd08c,0x106));var _0xcd08=function(_0x367f41,_0x2d3703){_0x367f41=_0x367f41-0x0;var _0x550717=_0xd08c[_0x367f41];return _0x550717;};'use strict';var multer=require(_0xcd08('0x0'));var util=require(_0xcd08('0x1'));var path=require(_0xcd08('0x2'));var timeout=require(_0xcd08('0x3'));var express=require(_0xcd08('0x4'));var router=express[_0xcd08('0x5')]();var fs_extra=require(_0xcd08('0x6'));var auth=require(_0xcd08('0x7'));var interaction=require(_0xcd08('0x8'));var config=require(_0xcd08('0x9'));var controller=require('./intServicenowAccount.controller');router[_0xcd08('0xa')]('/',auth[_0xcd08('0xb')](),controller[_0xcd08('0xc')]);router[_0xcd08('0xa')](_0xcd08('0xd'),auth[_0xcd08('0xb')](),controller[_0xcd08('0xe')]);router['get'](_0xcd08('0xf'),auth[_0xcd08('0xb')](),controller[_0xcd08('0x10')]);router[_0xcd08('0xa')](_0xcd08('0x11'),auth[_0xcd08('0xb')](),controller['getFields']);router[_0xcd08('0x12')]('/',auth['isAuthenticated'](),controller[_0xcd08('0x13')]);router[_0xcd08('0x12')](_0xcd08('0xf'),auth['isAuthenticated'](),controller[_0xcd08('0x14')]);router[_0xcd08('0x15')](_0xcd08('0xd'),auth[_0xcd08('0xb')](),controller['update']);router[_0xcd08('0x16')](_0xcd08('0xd'),auth[_0xcd08('0xb')](),controller[_0xcd08('0x17')]);module[_0xcd08('0x18')]=router; \ No newline at end of file +var _0xd2a8=['exports','util','path','express','Router','../../config/environment','get','/:id','show','/:id/configurations','getConfigurations','isAuthenticated','getFields','post','create','addConfiguration','put','update','delete','destroy'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd2a8,0xc9));var _0x8d2a=function(_0x235348,_0x5978ad){_0x235348=_0x235348-0x0;var _0xfe13fe=_0xd2a8[_0x235348];return _0xfe13fe;};'use strict';var multer=require('multer');var util=require(_0x8d2a('0x0'));var path=require(_0x8d2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d2a('0x2'));var router=express[_0x8d2a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d2a('0x4'));var controller=require('./intServicenowAccount.controller');router[_0x8d2a('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8d2a('0x6'),auth['isAuthenticated'](),controller[_0x8d2a('0x7')]);router['get'](_0x8d2a('0x8'),auth['isAuthenticated'](),controller[_0x8d2a('0x9')]);router[_0x8d2a('0x5')]('/:id/fields',auth[_0x8d2a('0xa')](),controller[_0x8d2a('0xb')]);router[_0x8d2a('0xc')]('/',auth[_0x8d2a('0xa')](),controller[_0x8d2a('0xd')]);router[_0x8d2a('0xc')](_0x8d2a('0x8'),auth[_0x8d2a('0xa')](),controller[_0x8d2a('0xe')]);router[_0x8d2a('0xf')](_0x8d2a('0x6'),auth[_0x8d2a('0xa')](),controller[_0x8d2a('0x10')]);router[_0x8d2a('0x11')](_0x8d2a('0x6'),auth[_0x8d2a('0xa')](),controller[_0x8d2a('0x12')]);module[_0x8d2a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 727ad90..ebec9d4 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 _0x18e4=['exports','STRING','username','remoteUri','sequelize'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x18e4,0x194));var _0x418e=function(_0x5b3b6a,_0x906f49){_0x5b3b6a=_0x5b3b6a-0x0;var _0x4a9af7=_0x18e4[_0x5b3b6a];return _0x4a9af7;};'use strict';var Sequelize=require(_0x418e('0x0'));module[_0x418e('0x1')]={'name':{'type':Sequelize[_0x418e('0x2')]},'description':{'type':Sequelize[_0x418e('0x2')]},'username':{'type':Sequelize[_0x418e('0x2')],'unique':_0x418e('0x3')},'password':{'type':Sequelize[_0x418e('0x2')]},'email':{'type':Sequelize[_0x418e('0x2')]},'remoteUri':{'type':Sequelize[_0x418e('0x2')],'unique':_0x418e('0x4')},'serverUrl':{'type':Sequelize[_0x418e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf6ef=['exports','STRING','remoteUri','sequelize'];(function(_0xdc0c68,_0x400227){var _0x44d1b5=function(_0x1c8a65){while(--_0x1c8a65){_0xdc0c68['push'](_0xdc0c68['shift']());}};_0x44d1b5(++_0x400227);}(_0xf6ef,0x1df));var _0xff6e=function(_0x414a33,_0x5bf179){_0x414a33=_0x414a33-0x0;var _0x1922bd=_0xf6ef[_0x414a33];return _0x1922bd;};'use strict';var Sequelize=require(_0xff6e('0x0'));module[_0xff6e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xff6e('0x2')]},'email':{'type':Sequelize[_0xff6e('0x2')]},'remoteUri':{'type':Sequelize[_0xff6e('0x2')],'unique':_0xff6e('0x3')},'serverUrl':{'type':Sequelize[_0xff6e('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 c86ee85..56f2dcd 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 _0xc905=['correlation_id','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','test','statusCode','error','boolean','False','inactive','false','value','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','ServicenowAccount','includeAll','include','findAll','rows','catch','options','find','create','body','findOne','params','ServicenowConfiguration','pick','filter','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','incident_state','category','parent','caused_by','watch_list','upon_reject','child_incidents','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','cmdb_ci','delivery_plan','work_notes_list','priority','sys_domain_path','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','short_description','correlation_display','work_start','additional_assignee_list','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','upon_approval'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc905,0xd4));var _0x5c90=function(_0x71b14c,_0x18115c){_0x71b14c=_0x71b14c-0x0;var _0x273447=_0xc905[_0x71b14c];return _0x273447;};'use strict';var emlformat=require(_0x5c90('0x0'));var rimraf=require(_0x5c90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c90('0x2'));var rp=require('request-promise');var moment=require(_0x5c90('0x3'));var BPromise=require(_0x5c90('0x4'));var Mustache=require(_0x5c90('0x5'));var util=require('util');var path=require(_0x5c90('0x6'));var sox=require(_0x5c90('0x7'));var csv=require(_0x5c90('0x8'));var ejs=require(_0x5c90('0x9'));var fs=require('fs');var fs_extra=require(_0x5c90('0xa'));var _=require('lodash');var squel=require(_0x5c90('0xb'));var crypto=require('crypto');var jsforce=require(_0x5c90('0xc'));var deskjs=require(_0x5c90('0xd'));var toCsv=require(_0x5c90('0x8'));var querystring=require(_0x5c90('0xe'));var Papa=require('papaparse');var Redis=require(_0x5c90('0xf'));var authService=require(_0x5c90('0x10'));var qs=require(_0x5c90('0x11'));var as=require(_0x5c90('0x12'));var hardwareService=require(_0x5c90('0x13'));var logger=require(_0x5c90('0x14'))(_0x5c90('0x15'));var utils=require('../../config/utils');var config=require(_0x5c90('0x16'));var licenseUtil=require(_0x5c90('0x17'));var db=require(_0x5c90('0x18'))['db'];var integrations=require(_0x5c90('0x19'));function respondWithStatusCode(_0x5326b4,_0x1d5c8b){_0x1d5c8b=_0x1d5c8b||0xcc;return function(_0x23181b){if(_0x23181b){return _0x5326b4['sendStatus'](_0x1d5c8b);}return _0x5326b4[_0x5c90('0x1a')](_0x1d5c8b)[_0x5c90('0x1b')]();};}function respondWithResult(_0x4a46a7,_0x5d5b7d){_0x5d5b7d=_0x5d5b7d||0xc8;return function(_0xda43a2){if(_0xda43a2){return _0x4a46a7[_0x5c90('0x1a')](_0x5d5b7d)[_0x5c90('0x1c')](_0xda43a2);}};}function respondWithFilteredResult(_0x4928d3,_0x6dba05){return function(_0x3e43e2){if(_0x3e43e2){var _0x588ee5=typeof _0x6dba05['offset']==='undefined'&&typeof _0x6dba05[_0x5c90('0x1d')]===_0x5c90('0x1e');var _0x54c5e3=_0x3e43e2[_0x5c90('0x1f')];var _0x3ec753=_0x588ee5?0x0:_0x6dba05[_0x5c90('0x20')];var _0x4765e6=_0x588ee5?_0x3e43e2[_0x5c90('0x1f')]:_0x6dba05[_0x5c90('0x20')]+_0x6dba05['limit'];var _0x523c5e;if(_0x4765e6>=_0x54c5e3){_0x4765e6=_0x54c5e3;_0x523c5e=0xc8;}else{_0x523c5e=0xce;}_0x4928d3['status'](_0x523c5e);return _0x4928d3['set'](_0x5c90('0x21'),_0x3ec753+'-'+_0x4765e6+'/'+_0x54c5e3)[_0x5c90('0x1c')](_0x3e43e2);}return null;};}function patchUpdates(_0x38b9cc){return function(_0x472f81){try{jsonpatch[_0x5c90('0x22')](_0x472f81,_0x38b9cc,!![]);}catch(_0x7cabae){return BPromise[_0x5c90('0x23')](_0x7cabae);}return _0x472f81[_0x5c90('0x24')]();};}function saveUpdates(_0x2a03c4,_0x142116){return function(_0x5a07aa){if(_0x5a07aa){return _0x5a07aa[_0x5c90('0x25')](_0x2a03c4)[_0x5c90('0x26')](function(_0x247304){return _0x247304;});}return null;};}function removeEntity(_0x5c09bf,_0x51bdf3){return function(_0x473c7c){if(_0x473c7c){return _0x473c7c[_0x5c90('0x27')]()['then'](function(){_0x5c09bf[_0x5c90('0x1a')](0xcc)[_0x5c90('0x1b')]();});}};}function handleEntityNotFound(_0x4f6910,_0x6c55e8){return function(_0x119fc7){if(!_0x119fc7){_0x4f6910[_0x5c90('0x28')](0x194);}return _0x119fc7;};}function handleError(_0x32c901,_0x476067){_0x476067=_0x476067||0x1f4;return function(_0x31d1dc){logger['error'](_0x31d1dc[_0x5c90('0x29')]);if(_0x31d1dc[_0x5c90('0x2a')]){delete _0x31d1dc[_0x5c90('0x2a')];}_0x32c901[_0x5c90('0x1a')](_0x476067)[_0x5c90('0x2b')](_0x31d1dc);};}exports[_0x5c90('0x2c')]=function(_0x3846e6,_0x449528){var _0x141ff3={},_0x57be9c={},_0x221c88={'count':0x0,'rows':[]};var _0x56cd99=_[_0x5c90('0x2d')](db['ServicenowAccount']['rawAttributes'],function(_0x243c71){return{'name':_0x243c71[_0x5c90('0x2e')],'type':_0x243c71[_0x5c90('0x2f')][_0x5c90('0x30')]};});_0x57be9c[_0x5c90('0x31')]=_[_0x5c90('0x2d')](_0x56cd99,_0x5c90('0x2a'));_0x57be9c['query']=_[_0x5c90('0x32')](_0x3846e6[_0x5c90('0x33')]);_0x57be9c['filters']=_[_0x5c90('0x34')](_0x57be9c[_0x5c90('0x31')],_0x57be9c['query']);_0x141ff3[_0x5c90('0x35')]=_[_0x5c90('0x34')](_0x57be9c[_0x5c90('0x31')],qs[_0x5c90('0x36')](_0x3846e6[_0x5c90('0x33')][_0x5c90('0x36')]));_0x141ff3[_0x5c90('0x35')]=_0x141ff3['attributes'][_0x5c90('0x37')]?_0x141ff3[_0x5c90('0x35')]:_0x57be9c[_0x5c90('0x31')];if(!_0x3846e6[_0x5c90('0x33')][_0x5c90('0x38')](_0x5c90('0x39'))){_0x141ff3[_0x5c90('0x1d')]=qs[_0x5c90('0x1d')](_0x3846e6[_0x5c90('0x33')]['limit']);_0x141ff3[_0x5c90('0x20')]=qs[_0x5c90('0x20')](_0x3846e6[_0x5c90('0x33')]['offset']);}_0x141ff3[_0x5c90('0x3a')]=qs['sort'](_0x3846e6['query'][_0x5c90('0x3b')]);_0x141ff3[_0x5c90('0x3c')]=qs[_0x5c90('0x3d')](_['pick'](_0x3846e6['query'],_0x57be9c[_0x5c90('0x3d')]),_0x56cd99);if(_0x3846e6[_0x5c90('0x33')]['filter']){_0x141ff3[_0x5c90('0x3c')]=_[_0x5c90('0x3e')](_0x141ff3[_0x5c90('0x3c')],{'$or':_[_0x5c90('0x2d')](_0x56cd99,function(_0x48722f){if(_0x48722f[_0x5c90('0x2f')]!==_0x5c90('0x3f')){var _0x1babe4={};_0x1babe4[_0x48722f[_0x5c90('0x2a')]]={'$like':'%'+_0x3846e6[_0x5c90('0x33')]['filter']+'%'};return _0x1babe4;}})});}_0x141ff3=_[_0x5c90('0x3e')]({},_0x141ff3,_0x3846e6['options']);var _0x4ee55c={'where':_0x141ff3['where']};return db[_0x5c90('0x40')]['count'](_0x4ee55c)[_0x5c90('0x26')](function(_0x36f491){_0x221c88[_0x5c90('0x1f')]=_0x36f491;if(_0x3846e6[_0x5c90('0x33')][_0x5c90('0x41')]){_0x141ff3[_0x5c90('0x42')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x5c90('0x43')](_0x141ff3);})[_0x5c90('0x26')](function(_0x4950ff){_0x221c88[_0x5c90('0x44')]=_0x4950ff;return _0x221c88;})['then'](respondWithFilteredResult(_0x449528,_0x141ff3))[_0x5c90('0x45')](handleError(_0x449528,null));};exports['show']=function(_0x4fc96a,_0x5457eb){var _0x33eca0={'raw':![],'where':{'id':_0x4fc96a['params']['id']}},_0x5214e5={};_0x5214e5[_0x5c90('0x31')]=_[_0x5c90('0x32')](db['ServicenowAccount']['rawAttributes']);_0x5214e5[_0x5c90('0x33')]=_[_0x5c90('0x32')](_0x4fc96a[_0x5c90('0x33')]);_0x5214e5[_0x5c90('0x3d')]=_['intersection'](_0x5214e5[_0x5c90('0x31')],_0x5214e5[_0x5c90('0x33')]);_0x33eca0[_0x5c90('0x35')]=_[_0x5c90('0x34')](_0x5214e5[_0x5c90('0x31')],qs['fields'](_0x4fc96a[_0x5c90('0x33')][_0x5c90('0x36')]));_0x33eca0[_0x5c90('0x35')]=_0x33eca0[_0x5c90('0x35')][_0x5c90('0x37')]?_0x33eca0[_0x5c90('0x35')]:_0x5214e5['model'];if(_0x4fc96a[_0x5c90('0x33')][_0x5c90('0x41')]){_0x33eca0[_0x5c90('0x42')]=[{'all':!![]}];}_0x33eca0=_[_0x5c90('0x3e')]({},_0x33eca0,_0x4fc96a[_0x5c90('0x46')]);return db[_0x5c90('0x40')][_0x5c90('0x47')](_0x33eca0)['then'](handleEntityNotFound(_0x5457eb,null))[_0x5c90('0x26')](respondWithResult(_0x5457eb,null))[_0x5c90('0x45')](handleError(_0x5457eb,null));};exports[_0x5c90('0x48')]=function(_0xf3822c,_0x9d043f){return db['ServicenowAccount'][_0x5c90('0x48')](_0xf3822c['body'],{})[_0x5c90('0x26')](respondWithResult(_0x9d043f,0xc9))['catch'](handleError(_0x9d043f,null));};exports[_0x5c90('0x25')]=function(_0x36bf27,_0xbd82a8){if(_0x36bf27['body']['id']){delete _0x36bf27[_0x5c90('0x49')]['id'];}return db['ServicenowAccount'][_0x5c90('0x47')]({'where':{'id':_0x36bf27['params']['id']}})[_0x5c90('0x26')](handleEntityNotFound(_0xbd82a8,null))[_0x5c90('0x26')](saveUpdates(_0x36bf27['body'],null))[_0x5c90('0x26')](respondWithResult(_0xbd82a8,null))['catch'](handleError(_0xbd82a8,null));};exports['destroy']=function(_0x545dd4,_0x594caa){return db[_0x5c90('0x40')][_0x5c90('0x47')]({'where':{'id':_0x545dd4['params']['id']}})[_0x5c90('0x26')](handleEntityNotFound(_0x594caa,null))['then'](removeEntity(_0x594caa,null))[_0x5c90('0x45')](handleError(_0x594caa,null));};exports['getConfigurations']=function(_0x587453,_0x4bb412,_0x1f38b0){var _0x438371={};var _0xd92dea={};var _0x5d1428;var _0x9aa1a6;return db[_0x5c90('0x40')][_0x5c90('0x4a')]({'where':{'id':_0x587453[_0x5c90('0x4b')]['id']}})[_0x5c90('0x26')](handleEntityNotFound(_0x4bb412,null))[_0x5c90('0x26')](function(_0x283c6d){if(_0x283c6d){_0x5d1428=_0x283c6d;_0xd92dea['model']=_[_0x5c90('0x32')](db[_0x5c90('0x4c')]['rawAttributes']);_0xd92dea[_0x5c90('0x33')]=_[_0x5c90('0x32')](_0x587453[_0x5c90('0x33')]);_0xd92dea[_0x5c90('0x3d')]=_['intersection'](_0xd92dea['model'],_0xd92dea[_0x5c90('0x33')]);_0x438371[_0x5c90('0x35')]=_[_0x5c90('0x34')](_0xd92dea[_0x5c90('0x31')],qs[_0x5c90('0x36')](_0x587453[_0x5c90('0x33')][_0x5c90('0x36')]));_0x438371['attributes']=_0x438371[_0x5c90('0x35')][_0x5c90('0x37')]?_0x438371[_0x5c90('0x35')]:_0xd92dea[_0x5c90('0x31')];_0x438371[_0x5c90('0x3a')]=qs[_0x5c90('0x3b')](_0x587453['query'][_0x5c90('0x3b')]);_0x438371['where']=qs[_0x5c90('0x3d')](_[_0x5c90('0x4d')](_0x587453[_0x5c90('0x33')],_0xd92dea[_0x5c90('0x3d')]));if(_0x587453[_0x5c90('0x33')][_0x5c90('0x4e')]){_0x438371[_0x5c90('0x3c')]=_[_0x5c90('0x3e')](_0x438371[_0x5c90('0x3c')],{'$or':_[_0x5c90('0x2d')](_0x438371[_0x5c90('0x35')],function(_0x72f5b1){var _0x4c2133={};_0x4c2133[_0x72f5b1]={'$like':'%'+_0x587453['query']['filter']+'%'};return _0x4c2133;})});}_0x438371=_['merge']({},_0x438371,_0x587453[_0x5c90('0x46')]);return _0x5d1428['getConfigurations'](_0x438371);}})[_0x5c90('0x26')](function(_0x21eb3d){if(_0x21eb3d){_0x9aa1a6=_0x21eb3d[_0x5c90('0x37')];if(!_0x587453[_0x5c90('0x33')][_0x5c90('0x38')](_0x5c90('0x39'))){_0x438371['limit']=qs[_0x5c90('0x1d')](_0x587453['query']['limit']);_0x438371[_0x5c90('0x20')]=qs[_0x5c90('0x20')](_0x587453[_0x5c90('0x33')]['offset']);}return _0x5d1428[_0x5c90('0x4f')](_0x438371);}})[_0x5c90('0x26')](function(_0x32d5c7){if(_0x32d5c7){return _0x32d5c7?{'count':_0x9aa1a6,'rows':_0x32d5c7}:null;}})[_0x5c90('0x26')](respondWithResult(_0x4bb412,null))[_0x5c90('0x45')](handleError(_0x4bb412,null));};exports[_0x5c90('0x50')]=function(_0x5ec722,_0x1df2ac,_0x534573){if(_0x5ec722[_0x5c90('0x49')]['id']){delete _0x5ec722[_0x5c90('0x49')]['id'];}return db['ServicenowAccount'][_0x5c90('0x4a')]({'where':{'id':_0x5ec722[_0x5c90('0x4b')]['id']}})[_0x5c90('0x26')](handleEntityNotFound(_0x1df2ac,null))['then'](function(_0x48b1ff){if(_0x48b1ff){_0x5ec722[_0x5c90('0x49')][_0x5c90('0x51')]=_0x48b1ff['id'];_0x5ec722[_0x5c90('0x49')][_0x5c90('0x52')]=integrations[_0x5c90('0x53')](_0x5ec722[_0x5c90('0x49')][_0x5c90('0x54')],_0x5ec722['body'][_0x5c90('0x2f')]);_0x5ec722[_0x5c90('0x49')][_0x5c90('0x55')]=integrations['getDescriptions'](_0x5ec722[_0x5c90('0x49')][_0x5c90('0x54')],_0x5ec722['body'][_0x5c90('0x2f')]);return db['ServicenowConfiguration']['create'](_0x5ec722[_0x5c90('0x49')],{'include':[{'model':db[_0x5c90('0x56')],'as':_0x5c90('0x52')},{'model':db[_0x5c90('0x56')],'as':_0x5c90('0x55')}]});}return null;})['then'](respondWithResult(_0x1df2ac,null))[_0x5c90('0x45')](handleError(_0x1df2ac,null));};exports[_0x5c90('0x57')]=function(_0x31457a,_0x2d0252,_0x12f5e6){var _0x4f4c54=[_0x5c90('0x58'),_0x5c90('0x59'),'knowledge',_0x5c90('0x5a'),_0x5c90('0x5b'),'notify',_0x5c90('0x5c'),'severity',_0x5c90('0x5d')];var _0x28a20d=[_0x5c90('0x5e'),_0x5c90('0x58'),_0x5c90('0x5f'),_0x5c90('0x60'),_0x5c90('0x61'),'sys_updated_on',_0x5c90('0x62'),_0x5c90('0x59'),'approval_history','number',_0x5c90('0x63'),_0x5c90('0x64'),'opened_by',_0x5c90('0x65'),_0x5c90('0x66'),_0x5c90('0x67'),_0x5c90('0x68'),_0x5c90('0x69'),_0x5c90('0x6a'),'order','calendar_stc','closed_at',_0x5c90('0x6b'),_0x5c90('0x6c'),'impact','active',_0x5c90('0x6d'),'business_service',_0x5c90('0x6e'),_0x5c90('0x6f'),'rfc',_0x5c90('0x70'),'expected_start',_0x5c90('0x71'),_0x5c90('0x72'),_0x5c90('0x73'),_0x5c90('0x74'),_0x5c90('0x75'),_0x5c90('0x76'),'caller_id',_0x5c90('0x77'),'subcategory','work_notes',_0x5c90('0x78'),_0x5c90('0x5b'),_0x5c90('0x79'),'delivery_task',_0x5c90('0x7a'),'assignment_group','business_stc',_0x5c90('0x7b'),'description','calendar_duration',_0x5c90('0x7c'),_0x5c90('0x7d'),_0x5c90('0x7e'),_0x5c90('0x7f'),_0x5c90('0x80'),_0x5c90('0x81'),_0x5c90('0x82'),_0x5c90('0x83'),_0x5c90('0x84'),_0x5c90('0x5c'),_0x5c90('0x85'),_0x5c90('0x86'),_0x5c90('0x87'),_0x5c90('0x88'),_0x5c90('0x89'),'assigned_to',_0x5c90('0x8a'),_0x5c90('0x8b'),_0x5c90('0x8c'),_0x5c90('0x8d'),_0x5c90('0x8e'),'due_date',_0x5c90('0x8f'),_0x5c90('0x90'),'sys_tags','escalation',_0x5c90('0x91'),_0x5c90('0x92'),'location','category'];var _0x3a6b42='';var _0x12cbf6='';var _0xc8ec4a=[];var _0x29627f='';var _0x48c806='';var _0x3e5734=[];var _0x44c0cd='';var _0x500bec='';var _0x395b21={};var _0x59a2f7='';return db[_0x5c90('0x40')][_0x5c90('0x4a')]({'where':{'id':_0x31457a[_0x5c90('0x4b')]['id']},'attributes':['id',_0x5c90('0x93'),'password',_0x5c90('0x94'),_0x5c90('0x95'),_0x5c90('0x96')]})[_0x5c90('0x26')](handleEntityNotFound(_0x2d0252,null))[_0x5c90('0x26')](function(_0x5779a1){if(_0x5779a1){_0x59a2f7=_0x5779a1[_0x5c90('0x95')];var _0x23a813=_0x59a2f7[_0x5c90('0x97')](-0x1);if(_0x23a813==='/'){_0x59a2f7=_0x59a2f7[_0x5c90('0x98')](0x0,_0x59a2f7[_0x5c90('0x99')](_0x23a813));}_0x500bec=util['format'](_0x5c90('0x9a'),_0x59a2f7);_0x44c0cd=util['format'](_0x5c90('0x9b'),_0x59a2f7);_0x395b21={'user':_0x5779a1['username'],'pass':_0x5779a1[_0x5c90('0x9c')]};var _0x13e386={'method':_0x5c90('0x9d'),'uri':_0x500bec+_0x5c90('0x9e'),'auth':_0x395b21,'json':!![]};return rp(_0x13e386);}})[_0x5c90('0x26')](function(_0x48f1f0){if(_0x48f1f0[_0x5c90('0x9f')][_0x5c90('0x37')]>0x0){_0x3a6b42=_0x48f1f0[_0x5c90('0x9f')];}console[_0x5c90('0xa0')](_0x5c90('0xa1'),_0x3a6b42);_0x3e5734=[];_0x12cbf6=Object[_0x5c90('0xa2')]([],_0x3a6b42);_[_0x5c90('0xa3')](_0x12cbf6,function(_0x3be754){return!_0x4f4c54[_0x5c90('0xa4')](_0x3be754[_0x5c90('0x2a')]);});_0x12cbf6[_0x5c90('0xa5')](function(_0x4012eb){var _0x13b8d5=createFieldObject(_0x44c0cd,_0x395b21,_0x4012eb[_0x5c90('0xa6')],_0x4012eb[_0x5c90('0x2a')],_0x4012eb[_0x5c90('0xa7')],![]);_0x3e5734[_0x5c90('0xa8')](_0x13b8d5);});return Promise[_0x5c90('0xa9')](_0x3e5734);})['then'](function(_0x423880){_0xc8ec4a=_0x423880;_0x29627f=Object[_0x5c90('0xa2')]([],_0x3a6b42);console[_0x5c90('0xa0')](_0x5c90('0xaa'),_0x3a6b42);_[_0x5c90('0xa3')](_0x29627f,function(_0x3ac6fe){return _0x28a20d['includes'](_0x3ac6fe[_0x5c90('0x2a')]);});console[_0x5c90('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x29627f);_0x3e5734=[];_0x29627f[_0x5c90('0xa5')](function(_0x5ea41d){var _0x3a6c8b=createFieldObject(_0x44c0cd,_0x395b21,_0x5ea41d[_0x5c90('0xa6')],_0x5ea41d[_0x5c90('0x2a')],_0x5ea41d[_0x5c90('0xa7')],!![]);_0x3e5734[_0x5c90('0xa8')](_0x3a6c8b);});return Promise[_0x5c90('0xa9')](_0x3e5734);})[_0x5c90('0x26')](function(_0xb9f6be){_0x48c806=_0xb9f6be;var _0x1c7d67=_0xc8ec4a['concat'](_0x48c806);return{'count':_0x1c7d67[_0x5c90('0x37')],'rows':_0x1c7d67};})['then'](respondWithResult(_0x2d0252,null))['catch'](function(_0x396960){console[_0x5c90('0xa0')]('ServiceNow\x20error:\x20'+_0x396960);var _0x234c25=_0x31457a[_0x5c90('0x33')][_0x5c90('0xab')]?0x1f4:_0x396960[_0x5c90('0xac')]||0x1f4;logger[_0x5c90('0xad')](_0x396960[_0x5c90('0x29')]);delete _0x396960[_0x5c90('0x2a')];if(_0x234c25===0x191){_0x234c25=0x190;}_0x2d0252['status'](_0x234c25)[_0x5c90('0x2b')](_0x31457a[_0x5c90('0x33')][_0x5c90('0xab')]?{'message':'Wrong\x20credentials','statusCode':_0x396960[_0x5c90('0xac')]}:_0x396960);});};function createFieldObject(_0x102a1a,_0x1e6e6a,_0x4699e5,_0x1a7683,_0x34d260,_0x340fa0){return new Promise(function(_0x4ba42b,_0x449d21){var _0x36b6d9={'id':_0x1a7683,'name':_0x34d260,'custom':_0x340fa0};if(_0x4699e5===_0x5c90('0xae')){_0x36b6d9[_0x5c90('0x46')]=[{'name':'True','value':'true'},{'name':_0x5c90('0xaf'),'value':'false'}];_0x4ba42b(_0x36b6d9);}else{var _0xc2b15f={'method':_0x5c90('0x9d'),'uri':_0x102a1a+'sys_choice?sysparm_query=name=incident^element='+_0x1a7683,'auth':_0x1e6e6a,'json':!![]};return rp(_0xc2b15f)[_0x5c90('0x26')](function(_0x546466){var _0x41847f=[];if(_0x546466['result'][_0x5c90('0x37')]>0x0){_0x546466[_0x5c90('0x9f')]['forEach'](function(_0x19881f){if(_0x19881f[_0x5c90('0xb0')]===_0x5c90('0xb1')){var _0x5e13df={'name':_0x19881f['label'],'value':_0x19881f[_0x5c90('0xb2')]};_0x41847f[_0x5c90('0xa8')](_0x5e13df);}});}_0x36b6d9[_0x5c90('0x46')]=_0x41847f;if(_0x36b6d9['options'][_0x5c90('0x37')]>0x0){_0x4ba42b(_0x36b6d9);}else{if(_0x340fa0==![]){_0x4ba42b();}else{_0x4ba42b(_0x36b6d9);}}});}});} \ No newline at end of file +var _0x03f2=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','ServicenowAccount','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','time_worked','expected_start','opened_at','work_end','resolved_at','approval_set','work_notes','short_description','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','statusCode','true','False','false','forEach','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x529f35,_0x5e4d65){var _0x50bb44=function(_0x58bb2b){while(--_0x58bb2b){_0x529f35['push'](_0x529f35['shift']());}};_0x50bb44(++_0x5e4d65);}(_0x03f2,0x159));var _0x203f=function(_0x255294,_0x2acf58){_0x255294=_0x255294-0x0;var _0x51d8c6=_0x03f2[_0x255294];return _0x51d8c6;};'use strict';var emlformat=require(_0x203f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x203f('0x1'));var jsonpatch=require(_0x203f('0x2'));var rp=require('request-promise');var moment=require(_0x203f('0x3'));var BPromise=require(_0x203f('0x4'));var Mustache=require(_0x203f('0x5'));var util=require('util');var path=require(_0x203f('0x6'));var sox=require(_0x203f('0x7'));var csv=require(_0x203f('0x8'));var ejs=require(_0x203f('0x9'));var fs=require('fs');var fs_extra=require(_0x203f('0xa'));var _=require(_0x203f('0xb'));var squel=require(_0x203f('0xc'));var crypto=require('crypto');var jsforce=require(_0x203f('0xd'));var deskjs=require(_0x203f('0xe'));var toCsv=require(_0x203f('0x8'));var querystring=require(_0x203f('0xf'));var Papa=require(_0x203f('0x10'));var Redis=require(_0x203f('0x11'));var authService=require(_0x203f('0x12'));var qs=require(_0x203f('0x13'));var as=require(_0x203f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x203f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x203f('0x16'))['db'];var integrations=require(_0x203f('0x17'));function respondWithStatusCode(_0x2d3a7a,_0x2b42e7){_0x2b42e7=_0x2b42e7||0xcc;return function(_0x3683d){if(_0x3683d){return _0x2d3a7a[_0x203f('0x18')](_0x2b42e7);}return _0x2d3a7a[_0x203f('0x19')](_0x2b42e7)['end']();};}function respondWithResult(_0x56db32,_0x4ad3f2){_0x4ad3f2=_0x4ad3f2||0xc8;return function(_0x173c2f){if(_0x173c2f){return _0x56db32['status'](_0x4ad3f2)[_0x203f('0x1a')](_0x173c2f);}};}function respondWithFilteredResult(_0x5e30a4,_0x13f1e7){return function(_0x33b18e){if(_0x33b18e){var _0x394c50=typeof _0x13f1e7['offset']===_0x203f('0x1b')&&typeof _0x13f1e7['limit']===_0x203f('0x1b');var _0x8984ea=_0x33b18e[_0x203f('0x1c')];var _0x418b6c=_0x394c50?0x0:_0x13f1e7[_0x203f('0x1d')];var _0x309671=_0x394c50?_0x33b18e[_0x203f('0x1c')]:_0x13f1e7['offset']+_0x13f1e7[_0x203f('0x1e')];var _0x30557e;if(_0x309671>=_0x8984ea){_0x309671=_0x8984ea;_0x30557e=0xc8;}else{_0x30557e=0xce;}_0x5e30a4[_0x203f('0x19')](_0x30557e);return _0x5e30a4[_0x203f('0x1f')](_0x203f('0x20'),_0x418b6c+'-'+_0x309671+'/'+_0x8984ea)[_0x203f('0x1a')](_0x33b18e);}return null;};}function patchUpdates(_0x5050f6){return function(_0x582b5d){try{jsonpatch['apply'](_0x582b5d,_0x5050f6,!![]);}catch(_0xbff14f){return BPromise[_0x203f('0x21')](_0xbff14f);}return _0x582b5d[_0x203f('0x22')]();};}function saveUpdates(_0x5b25a5,_0xded991){return function(_0x974774){if(_0x974774){return _0x974774[_0x203f('0x23')](_0x5b25a5)[_0x203f('0x24')](function(_0x4102fe){return _0x4102fe;});}return null;};}function removeEntity(_0x40ae00,_0x459a83){return function(_0xd61a85){if(_0xd61a85){return _0xd61a85[_0x203f('0x25')]()[_0x203f('0x24')](function(){_0x40ae00[_0x203f('0x19')](0xcc)[_0x203f('0x26')]();});}};}function handleEntityNotFound(_0x5309e6,_0x22b400){return function(_0x265b5d){if(!_0x265b5d){_0x5309e6[_0x203f('0x18')](0x194);}return _0x265b5d;};}function handleError(_0x390cf6,_0x1dc2bc){_0x1dc2bc=_0x1dc2bc||0x1f4;return function(_0x3f12f2){logger[_0x203f('0x27')](_0x3f12f2[_0x203f('0x28')]);if(_0x3f12f2['name']){delete _0x3f12f2[_0x203f('0x29')];}_0x390cf6[_0x203f('0x19')](_0x1dc2bc)[_0x203f('0x2a')](_0x3f12f2);};}exports[_0x203f('0x2b')]=function(_0x5be40c,_0x3e8fb1){var _0x1e79f4={},_0x2d1414={},_0x3d11d5={'count':0x0,'rows':[]};var _0x2f8323=_[_0x203f('0x2c')](db['ServicenowAccount'][_0x203f('0x2d')],function(_0x1a831e){return{'name':_0x1a831e['fieldName'],'type':_0x1a831e[_0x203f('0x2e')][_0x203f('0x2f')]};});_0x2d1414[_0x203f('0x30')]=_[_0x203f('0x2c')](_0x2f8323,_0x203f('0x29'));_0x2d1414[_0x203f('0x31')]=_[_0x203f('0x32')](_0x5be40c[_0x203f('0x31')]);_0x2d1414[_0x203f('0x33')]=_[_0x203f('0x34')](_0x2d1414['model'],_0x2d1414[_0x203f('0x31')]);_0x1e79f4['attributes']=_[_0x203f('0x34')](_0x2d1414['model'],qs[_0x203f('0x35')](_0x5be40c[_0x203f('0x31')][_0x203f('0x35')]));_0x1e79f4[_0x203f('0x36')]=_0x1e79f4[_0x203f('0x36')][_0x203f('0x37')]?_0x1e79f4['attributes']:_0x2d1414[_0x203f('0x30')];if(!_0x5be40c[_0x203f('0x31')][_0x203f('0x38')]('nolimit')){_0x1e79f4[_0x203f('0x1e')]=qs[_0x203f('0x1e')](_0x5be40c[_0x203f('0x31')]['limit']);_0x1e79f4['offset']=qs[_0x203f('0x1d')](_0x5be40c[_0x203f('0x31')][_0x203f('0x1d')]);}_0x1e79f4[_0x203f('0x39')]=qs[_0x203f('0x3a')](_0x5be40c[_0x203f('0x31')][_0x203f('0x3a')]);_0x1e79f4[_0x203f('0x3b')]=qs[_0x203f('0x33')](_['pick'](_0x5be40c[_0x203f('0x31')],_0x2d1414[_0x203f('0x33')]),_0x2f8323);if(_0x5be40c[_0x203f('0x31')][_0x203f('0x3c')]){_0x1e79f4[_0x203f('0x3b')]=_['merge'](_0x1e79f4[_0x203f('0x3b')],{'$or':_[_0x203f('0x2c')](_0x2f8323,function(_0x58f1d2){if(_0x58f1d2['type']!==_0x203f('0x3d')){var _0xf721b2={};_0xf721b2[_0x58f1d2['name']]={'$like':'%'+_0x5be40c[_0x203f('0x31')]['filter']+'%'};return _0xf721b2;}})});}_0x1e79f4=_[_0x203f('0x3e')]({},_0x1e79f4,_0x5be40c[_0x203f('0x3f')]);var _0x1de51c={'where':_0x1e79f4[_0x203f('0x3b')]};return db['ServicenowAccount'][_0x203f('0x1c')](_0x1de51c)[_0x203f('0x24')](function(_0x39bdc5){_0x3d11d5[_0x203f('0x1c')]=_0x39bdc5;if(_0x5be40c[_0x203f('0x31')][_0x203f('0x40')]){_0x1e79f4[_0x203f('0x41')]=[{'all':!![]}];}return db[_0x203f('0x42')][_0x203f('0x43')](_0x1e79f4);})['then'](function(_0x38cb21){_0x3d11d5[_0x203f('0x44')]=_0x38cb21;return _0x3d11d5;})[_0x203f('0x24')](respondWithFilteredResult(_0x3e8fb1,_0x1e79f4))[_0x203f('0x45')](handleError(_0x3e8fb1,null));};exports[_0x203f('0x46')]=function(_0x1e1280,_0x3fd4ba){var _0x4e239c={'raw':![],'where':{'id':_0x1e1280['params']['id']}},_0x331707={};_0x331707['model']=_[_0x203f('0x32')](db[_0x203f('0x42')][_0x203f('0x2d')]);_0x331707[_0x203f('0x31')]=_[_0x203f('0x32')](_0x1e1280[_0x203f('0x31')]);_0x331707['filters']=_['intersection'](_0x331707[_0x203f('0x30')],_0x331707[_0x203f('0x31')]);_0x4e239c['attributes']=_[_0x203f('0x34')](_0x331707['model'],qs['fields'](_0x1e1280['query'][_0x203f('0x35')]));_0x4e239c[_0x203f('0x36')]=_0x4e239c[_0x203f('0x36')][_0x203f('0x37')]?_0x4e239c[_0x203f('0x36')]:_0x331707[_0x203f('0x30')];if(_0x1e1280[_0x203f('0x31')][_0x203f('0x40')]){_0x4e239c[_0x203f('0x41')]=[{'all':!![]}];}_0x4e239c=_[_0x203f('0x3e')]({},_0x4e239c,_0x1e1280[_0x203f('0x3f')]);return db[_0x203f('0x42')][_0x203f('0x47')](_0x4e239c)[_0x203f('0x24')](handleEntityNotFound(_0x3fd4ba,null))['then'](respondWithResult(_0x3fd4ba,null))[_0x203f('0x45')](handleError(_0x3fd4ba,null));};exports['create']=function(_0x11af3e,_0x41ae16){return db[_0x203f('0x42')][_0x203f('0x48')](_0x11af3e[_0x203f('0x49')],{})['then'](respondWithResult(_0x41ae16,0xc9))[_0x203f('0x45')](handleError(_0x41ae16,null));};exports[_0x203f('0x23')]=function(_0x4a4806,_0xe988ca){if(_0x4a4806[_0x203f('0x49')]['id']){delete _0x4a4806[_0x203f('0x49')]['id'];}return db[_0x203f('0x42')][_0x203f('0x47')]({'where':{'id':_0x4a4806[_0x203f('0x4a')]['id']}})[_0x203f('0x24')](handleEntityNotFound(_0xe988ca,null))[_0x203f('0x24')](saveUpdates(_0x4a4806['body'],null))[_0x203f('0x24')](respondWithResult(_0xe988ca,null))[_0x203f('0x45')](handleError(_0xe988ca,null));};exports['destroy']=function(_0x12b3af,_0x137116){return db[_0x203f('0x42')]['find']({'where':{'id':_0x12b3af[_0x203f('0x4a')]['id']}})[_0x203f('0x24')](handleEntityNotFound(_0x137116,null))[_0x203f('0x24')](removeEntity(_0x137116,null))[_0x203f('0x45')](handleError(_0x137116,null));};exports[_0x203f('0x4b')]=function(_0x3b0f1b,_0x45e385,_0x3ee778){var _0x413e18={};var _0x5da2a9={};var _0xe8c69e;var _0x226f4c;return db[_0x203f('0x42')][_0x203f('0x4c')]({'where':{'id':_0x3b0f1b['params']['id']}})[_0x203f('0x24')](handleEntityNotFound(_0x45e385,null))[_0x203f('0x24')](function(_0x3931a4){if(_0x3931a4){_0xe8c69e=_0x3931a4;_0x5da2a9[_0x203f('0x30')]=_[_0x203f('0x32')](db[_0x203f('0x4d')][_0x203f('0x2d')]);_0x5da2a9[_0x203f('0x31')]=_['keys'](_0x3b0f1b[_0x203f('0x31')]);_0x5da2a9['filters']=_[_0x203f('0x34')](_0x5da2a9[_0x203f('0x30')],_0x5da2a9['query']);_0x413e18[_0x203f('0x36')]=_[_0x203f('0x34')](_0x5da2a9[_0x203f('0x30')],qs[_0x203f('0x35')](_0x3b0f1b[_0x203f('0x31')][_0x203f('0x35')]));_0x413e18[_0x203f('0x36')]=_0x413e18['attributes']['length']?_0x413e18[_0x203f('0x36')]:_0x5da2a9['model'];_0x413e18[_0x203f('0x39')]=qs['sort'](_0x3b0f1b[_0x203f('0x31')]['sort']);_0x413e18[_0x203f('0x3b')]=qs[_0x203f('0x33')](_[_0x203f('0x4e')](_0x3b0f1b['query'],_0x5da2a9[_0x203f('0x33')]));if(_0x3b0f1b[_0x203f('0x31')][_0x203f('0x3c')]){_0x413e18[_0x203f('0x3b')]=_[_0x203f('0x3e')](_0x413e18[_0x203f('0x3b')],{'$or':_[_0x203f('0x2c')](_0x413e18[_0x203f('0x36')],function(_0x1e85ef){var _0x45760b={};_0x45760b[_0x1e85ef]={'$like':'%'+_0x3b0f1b[_0x203f('0x31')][_0x203f('0x3c')]+'%'};return _0x45760b;})});}_0x413e18=_['merge']({},_0x413e18,_0x3b0f1b[_0x203f('0x3f')]);return _0xe8c69e[_0x203f('0x4b')](_0x413e18);}})[_0x203f('0x24')](function(_0x1e5c03){if(_0x1e5c03){_0x226f4c=_0x1e5c03[_0x203f('0x37')];if(!_0x3b0f1b['query'][_0x203f('0x38')](_0x203f('0x4f'))){_0x413e18['limit']=qs[_0x203f('0x1e')](_0x3b0f1b[_0x203f('0x31')][_0x203f('0x1e')]);_0x413e18[_0x203f('0x1d')]=qs[_0x203f('0x1d')](_0x3b0f1b['query'][_0x203f('0x1d')]);}return _0xe8c69e[_0x203f('0x4b')](_0x413e18);}})[_0x203f('0x24')](function(_0x5627a9){if(_0x5627a9){return _0x5627a9?{'count':_0x226f4c,'rows':_0x5627a9}:null;}})[_0x203f('0x24')](respondWithResult(_0x45e385,null))[_0x203f('0x45')](handleError(_0x45e385,null));};exports[_0x203f('0x50')]=function(_0x511be1,_0x13861a,_0x9cada3){if(_0x511be1[_0x203f('0x49')]['id']){delete _0x511be1['body']['id'];}return db[_0x203f('0x42')]['findOne']({'where':{'id':_0x511be1[_0x203f('0x4a')]['id']}})[_0x203f('0x24')](handleEntityNotFound(_0x13861a,null))[_0x203f('0x24')](function(_0x267f62){if(_0x267f62){_0x511be1[_0x203f('0x49')]['AccountId']=_0x267f62['id'];_0x511be1[_0x203f('0x49')][_0x203f('0x51')]=integrations[_0x203f('0x52')](_0x511be1[_0x203f('0x49')][_0x203f('0x53')],_0x511be1[_0x203f('0x49')]['type']);_0x511be1['body'][_0x203f('0x54')]=integrations[_0x203f('0x55')](_0x511be1[_0x203f('0x49')]['channel'],_0x511be1['body']['type']);return db['ServicenowConfiguration']['create'](_0x511be1[_0x203f('0x49')],{'include':[{'model':db[_0x203f('0x56')],'as':_0x203f('0x51')},{'model':db[_0x203f('0x56')],'as':_0x203f('0x54')}]});}return null;})[_0x203f('0x24')](respondWithResult(_0x13861a,null))[_0x203f('0x45')](handleError(_0x13861a,null));};exports['getFields']=function(_0x38cc2f,_0x190b82,_0x18d986){var _0x121d5f=[_0x203f('0x57'),_0x203f('0x58'),_0x203f('0x59'),_0x203f('0x5a'),_0x203f('0x5b'),'notify',_0x203f('0x5c'),_0x203f('0x5d'),_0x203f('0x5e')];var _0x32f6e1=['parent',_0x203f('0x57'),_0x203f('0x5f'),'watch_list',_0x203f('0x60'),_0x203f('0x61'),_0x203f('0x62'),'hold_reason',_0x203f('0x63'),'number','resolved_by','sys_updated_by','opened_by',_0x203f('0x64'),'sys_created_on',_0x203f('0x65'),_0x203f('0x66'),_0x203f('0x67'),_0x203f('0x59'),_0x203f('0x39'),_0x203f('0x68'),_0x203f('0x69'),_0x203f('0x6a'),_0x203f('0x6b'),'impact',_0x203f('0x6c'),_0x203f('0x6d'),'business_service',_0x203f('0x6e'),_0x203f('0x6f'),'rfc',_0x203f('0x70'),_0x203f('0x71'),_0x203f('0x72'),'business_duration','group_list',_0x203f('0x73'),'reopened_time',_0x203f('0x74'),'caller_id',_0x203f('0x75'),_0x203f('0x5a'),_0x203f('0x76'),_0x203f('0x77'),_0x203f('0x5b'),'correlation_display','delivery_task',_0x203f('0x78'),_0x203f('0x79'),_0x203f('0x7a'),_0x203f('0x7b'),_0x203f('0x7c'),_0x203f('0x7d'),_0x203f('0x7e'),'sys_class_name',_0x203f('0x7f'),_0x203f('0x80'),'follow_up',_0x203f('0x81'),_0x203f('0x82'),_0x203f('0x83'),_0x203f('0x84'),_0x203f('0x5c'),_0x203f('0x85'),_0x203f('0x86'),_0x203f('0x87'),_0x203f('0x88'),_0x203f('0x89'),_0x203f('0x8a'),_0x203f('0x5d'),_0x203f('0x8b'),_0x203f('0x8c'),'approval',_0x203f('0x8d'),'due_date',_0x203f('0x8e'),'reopen_count',_0x203f('0x8f'),_0x203f('0x90'),_0x203f('0x91'),_0x203f('0x92'),_0x203f('0x93'),_0x203f('0x5e')];var _0x7e2825='';var _0x408c7f='';var _0x1f7299=[];var _0x38694d='';var _0x454aea='';var _0x57a33c=[];var _0xbd1b57='';var _0x2abee2='';var _0x3c0806={};var _0x452207='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x38cc2f['params']['id']},'attributes':['id','username',_0x203f('0x94'),_0x203f('0x95'),'remoteUri','serverUrl']})[_0x203f('0x24')](handleEntityNotFound(_0x190b82,null))['then'](function(_0x491fdd){if(_0x491fdd){_0x452207=_0x491fdd[_0x203f('0x96')];var _0x3a9ae2=_0x452207[_0x203f('0x97')](-0x1);if(_0x3a9ae2==='/'){_0x452207=_0x452207[_0x203f('0x98')](0x0,_0x452207[_0x203f('0x99')](_0x3a9ae2));}_0x2abee2=util[_0x203f('0x9a')](_0x203f('0x9b'),_0x452207);_0xbd1b57=util[_0x203f('0x9a')](_0x203f('0x9c'),_0x452207);_0x3c0806={'user':_0x491fdd[_0x203f('0x9d')],'pass':_0x491fdd[_0x203f('0x94')]};var _0x516277={'method':_0x203f('0x9e'),'uri':_0x2abee2+_0x203f('0x9f'),'auth':_0x3c0806,'json':!![]};return rp(_0x516277);}})[_0x203f('0x24')](function(_0x4b1824){if(_0x4b1824['result']['length']>0x0){_0x7e2825=_0x4b1824[_0x203f('0xa0')];}console[_0x203f('0xa1')](_0x203f('0xa2'),_0x7e2825);_0x57a33c=[];_0x408c7f=Object[_0x203f('0xa3')]([],_0x7e2825);_[_0x203f('0xa4')](_0x408c7f,function(_0x71651e){return!_0x121d5f[_0x203f('0xa5')](_0x71651e[_0x203f('0x29')]);});_0x408c7f['forEach'](function(_0x335427){var _0x21e171=createFieldObject(_0xbd1b57,_0x3c0806,_0x335427[_0x203f('0xa6')],_0x335427[_0x203f('0x29')],_0x335427[_0x203f('0xa7')],![]);_0x57a33c[_0x203f('0xa8')](_0x21e171);});return Promise[_0x203f('0xa9')](_0x57a33c);})[_0x203f('0x24')](function(_0x1c816e){_0x1f7299=_0x1c816e;_0x38694d=Object[_0x203f('0xa3')]([],_0x7e2825);console['log'](_0x203f('0xaa'),_0x7e2825);_[_0x203f('0xa4')](_0x38694d,function(_0x38b798){return _0x32f6e1[_0x203f('0xa5')](_0x38b798[_0x203f('0x29')]);});console[_0x203f('0xa1')](_0x203f('0xab'),_0x38694d);_0x57a33c=[];_0x38694d['forEach'](function(_0x47ac85){var _0x3fbd98=createFieldObject(_0xbd1b57,_0x3c0806,_0x47ac85[_0x203f('0xa6')],_0x47ac85[_0x203f('0x29')],_0x47ac85[_0x203f('0xa7')],!![]);_0x57a33c['push'](_0x3fbd98);});return Promise[_0x203f('0xa9')](_0x57a33c);})[_0x203f('0x24')](function(_0x31dde2){_0x454aea=_0x31dde2;var _0x2e5be5=_0x1f7299['concat'](_0x454aea);return{'count':_0x2e5be5[_0x203f('0x37')],'rows':_0x2e5be5};})[_0x203f('0x24')](respondWithResult(_0x190b82,null))[_0x203f('0x45')](function(_0x42595d){console['log']('ServiceNow\x20error:\x20'+_0x42595d);var _0x22395b=_0x38cc2f[_0x203f('0x31')][_0x203f('0xac')]?0x1f4:_0x42595d[_0x203f('0xad')]||0x1f4;logger[_0x203f('0x27')](_0x42595d[_0x203f('0x28')]);delete _0x42595d['name'];if(_0x22395b===0x191){_0x22395b=0x190;}_0x190b82['status'](_0x22395b)[_0x203f('0x2a')](_0x38cc2f[_0x203f('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x42595d[_0x203f('0xad')]}:_0x42595d);});};function createFieldObject(_0x56f34d,_0x3a70c4,_0x46e573,_0x9f12b2,_0x45fa6c,_0x594d08){return new Promise(function(_0x3fb63a,_0x438111){var _0x57a77c={'id':_0x9f12b2,'name':_0x45fa6c,'custom':_0x594d08};if(_0x46e573==='boolean'){_0x57a77c['options']=[{'name':'True','value':_0x203f('0xae')},{'name':_0x203f('0xaf'),'value':_0x203f('0xb0')}];_0x3fb63a(_0x57a77c);}else{var _0x3057f1={'method':_0x203f('0x9e'),'uri':_0x56f34d+'sys_choice?sysparm_query=name=incident^element='+_0x9f12b2,'auth':_0x3a70c4,'json':!![]};return rp(_0x3057f1)[_0x203f('0x24')](function(_0x3cd0c1){var _0x44df8f=[];if(_0x3cd0c1[_0x203f('0xa0')][_0x203f('0x37')]>0x0){_0x3cd0c1['result'][_0x203f('0xb1')](function(_0xf60220){if(_0xf60220['inactive']===_0x203f('0xb0')){var _0x3de614={'name':_0xf60220[_0x203f('0xa7')],'value':_0xf60220['value']};_0x44df8f[_0x203f('0xa8')](_0x3de614);}});}_0x57a77c[_0x203f('0x3f')]=_0x44df8f;if(_0x57a77c['options']['length']>0x0){_0x3fb63a(_0x57a77c);}else{if(_0x594d08==![]){_0x3fb63a();}else{_0x3fb63a(_0x57a77c);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7bdb5ff..c96bac6 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 _0x2eb2=['request-promise','rimraf','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x484963,_0xfe4bc7){var _0x378e64=function(_0x24d3ad){while(--_0x24d3ad){_0x484963['push'](_0x484963['shift']());}};_0x378e64(++_0xfe4bc7);}(_0x2eb2,0x19f));var _0x22eb=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x2eb2[_0x53cf8e];return _0x459197;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x22eb('0x7'));module[_0x22eb('0x8')]=function(_0x35dd5b,_0x2a9850){return _0x35dd5b[_0x22eb('0x9')](_0x22eb('0xa'),attributes,{'tableName':_0x22eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8958=['exports','define','ServicenowAccount','util','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes'];(function(_0x144659,_0x617b0a){var _0x2a15e3=function(_0x223d35){while(--_0x223d35){_0x144659['push'](_0x144659['shift']());}};_0x2a15e3(++_0x617b0a);}(_0x8958,0x93));var _0x8895=function(_0x55e67b,_0x57fbed){_0x55e67b=_0x55e67b-0x0;var _0x4b71c2=_0x8958[_0x55e67b];return _0x4b71c2;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8895('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var attributes=require(_0x8895('0x4'));var integrations=require('../../components/integrations/configuration');module[_0x8895('0x5')]=function(_0x2f03ad,_0x124e1e){return _0x2f03ad[_0x8895('0x6')](_0x8895('0x7'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index ea1edd4..df35bc7 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 _0x9fcf=['find','ShowServicenowAccount','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','include','model','attributes','map'];(function(_0x1afedc,_0x17ee2f){var _0x3520db=function(_0x46b771){while(--_0x46b771){_0x1afedc['push'](_0x1afedc['shift']());}};_0x3520db(++_0x17ee2f);}(_0x9fcf,0x10a));var _0xf9fc=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x9fcf[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require(_0xf9fc('0x0'));var util=require(_0xf9fc('0x1'));var moment=require('moment');var BPromise=require(_0xf9fc('0x2'));var rs=require(_0xf9fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf9fc('0x4'));var logger=require(_0xf9fc('0x5'))('rpc');var config=require(_0xf9fc('0x6'));var jayson=require(_0xf9fc('0x7'));var client=jayson[_0xf9fc('0x8')][_0xf9fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf1dff4,_0x497e19,_0x4f8b64){return new BPromise(function(_0x58cd92,_0x5cdfb0){return client[_0xf9fc('0xa')](_0xf1dff4,_0x4f8b64)[_0xf9fc('0xb')](function(_0x1a324e){logger['info'](_0xf9fc('0xc'),_0x497e19,_0xf9fc('0xd'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x497e19,'request\x20sent',JSON[_0xf9fc('0xe')](_0x1a324e));if(_0x1a324e[_0xf9fc('0xf')]){if(_0x1a324e[_0xf9fc('0xf')][_0xf9fc('0x10')]===0x1f4){logger[_0xf9fc('0xf')](_0xf9fc('0xc'),_0x497e19,_0x1a324e['error'][_0xf9fc('0x11')]);return _0x5cdfb0(_0x1a324e[_0xf9fc('0xf')][_0xf9fc('0x11')]);}logger[_0xf9fc('0xf')](_0xf9fc('0xc'),_0x497e19,_0x1a324e[_0xf9fc('0xf')]['message']);return _0x58cd92(_0x1a324e[_0xf9fc('0xf')][_0xf9fc('0x11')]);}else{logger[_0xf9fc('0x12')](_0xf9fc('0xc'),_0x497e19,_0xf9fc('0xd'));_0x58cd92(_0x1a324e[_0xf9fc('0x13')][_0xf9fc('0x11')]);}})[_0xf9fc('0x14')](function(_0x5b3996){logger[_0xf9fc('0xf')](_0xf9fc('0xc'),_0x497e19,_0x5b3996);_0x5cdfb0(_0x5b3996);});});}exports[_0xf9fc('0x15')]=function(_0x3c31f5){var _0x57ee7c=this;return new Promise(function(_0x45c701,_0x531953){return db[_0xf9fc('0x16')][_0xf9fc('0x17')]({'raw':_0x3c31f5[_0xf9fc('0x18')]?_0x3c31f5[_0xf9fc('0x18')][_0xf9fc('0x19')]===undefined?!![]:![]:!![],'where':_0x3c31f5[_0xf9fc('0x18')]?_0x3c31f5[_0xf9fc('0x18')][_0xf9fc('0x1a')]||null:null,'attributes':_0x3c31f5[_0xf9fc('0x18')]?_0x3c31f5[_0xf9fc('0x18')]['attributes']||null:null,'limit':_0x3c31f5[_0xf9fc('0x18')]?_0x3c31f5['options']['limit']||null:null,'include':_0x3c31f5[_0xf9fc('0x18')]?_0x3c31f5['options'][_0xf9fc('0x1b')]?_['map'](_0x3c31f5[_0xf9fc('0x18')]['include'],function(_0x4162fe){return{'model':db[_0x4162fe[_0xf9fc('0x1c')]],'as':_0x4162fe['as'],'attributes':_0x4162fe[_0xf9fc('0x1d')],'include':_0x4162fe[_0xf9fc('0x1b')]?_[_0xf9fc('0x1e')](_0x4162fe['include'],function(_0xcbc18c){return{'model':db[_0xcbc18c[_0xf9fc('0x1c')]],'as':_0xcbc18c['as'],'attributes':_0xcbc18c['attributes'],'include':_0xcbc18c[_0xf9fc('0x1b')]?_[_0xf9fc('0x1e')](_0xcbc18c[_0xf9fc('0x1b')],function(_0x24280a){return{'model':db[_0x24280a['model']],'as':_0x24280a['as'],'attributes':_0x24280a[_0xf9fc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf9fc('0xb')](function(_0x149962){logger[_0xf9fc('0x12')]('GetServicenowAccount',_0x3c31f5);logger['debug'](_0xf9fc('0x15'),_0x3c31f5,JSON[_0xf9fc('0xe')](_0x149962));_0x45c701(_0x149962);})[_0xf9fc('0x14')](function(_0x1f1a69){logger[_0xf9fc('0xf')](_0xf9fc('0x15'),_0x1f1a69['message'],_0x3c31f5);_0x531953(_0x57ee7c[_0xf9fc('0xf')](0x1f4,_0x1f1a69[_0xf9fc('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x45cd10){var _0x4ad6d1=this;return new Promise(function(_0x1341e0,_0x420e00){return db[_0xf9fc('0x16')][_0xf9fc('0x1f')]({'raw':_0x45cd10[_0xf9fc('0x18')]?_0x45cd10[_0xf9fc('0x18')][_0xf9fc('0x19')]===undefined?!![]:![]:!![],'where':_0x45cd10[_0xf9fc('0x18')]?_0x45cd10[_0xf9fc('0x18')][_0xf9fc('0x1a')]||null:null,'attributes':_0x45cd10[_0xf9fc('0x18')]?_0x45cd10[_0xf9fc('0x18')]['attributes']||null:null,'include':_0x45cd10[_0xf9fc('0x18')]?_0x45cd10[_0xf9fc('0x18')]['include']?_[_0xf9fc('0x1e')](_0x45cd10[_0xf9fc('0x18')][_0xf9fc('0x1b')],function(_0x345c00){return{'model':db[_0x345c00['model']],'as':_0x345c00['as'],'attributes':_0x345c00[_0xf9fc('0x1d')],'include':_0x345c00['include']?_[_0xf9fc('0x1e')](_0x345c00[_0xf9fc('0x1b')],function(_0xb352fb){return{'model':db[_0xb352fb[_0xf9fc('0x1c')]],'as':_0xb352fb['as'],'attributes':_0xb352fb[_0xf9fc('0x1d')],'include':_0xb352fb[_0xf9fc('0x1b')]?_[_0xf9fc('0x1e')](_0xb352fb[_0xf9fc('0x1b')],function(_0x2d7181){return{'model':db[_0x2d7181[_0xf9fc('0x1c')]],'as':_0x2d7181['as'],'attributes':_0x2d7181[_0xf9fc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf9fc('0xb')](function(_0x3a2092){logger[_0xf9fc('0x12')]('ShowServicenowAccount',_0x45cd10);logger['debug'](_0xf9fc('0x20'),_0x45cd10,JSON[_0xf9fc('0xe')](_0x3a2092));_0x1341e0(_0x3a2092);})[_0xf9fc('0x14')](function(_0x47ae9e){logger[_0xf9fc('0xf')](_0xf9fc('0x20'),_0x47ae9e['message'],_0x45cd10);_0x420e00(_0x4ad6d1['error'](0x1f4,_0x47ae9e['message']));});});}; \ No newline at end of file +var _0x8c6e=['find','raw','ShowServicenowAccount','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','map','include','model'];(function(_0x249b9e,_0x507c10){var _0x32a24a=function(_0x45cbf8){while(--_0x45cbf8){_0x249b9e['push'](_0x249b9e['shift']());}};_0x32a24a(++_0x507c10);}(_0x8c6e,0x1d1));var _0xe8c6=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0x8c6e[_0x39f097];return _0x544f6a;};'use strict';var _=require(_0xe8c6('0x0'));var util=require(_0xe8c6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8c6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8c6('0x3'))['db'];var utils=require(_0xe8c6('0x4'));var logger=require(_0xe8c6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe8c6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x411c80,_0x1e6dbd,_0x9fe0f7){return new BPromise(function(_0x8f436d,_0x549d5c){return client[_0xe8c6('0x7')](_0x411c80,_0x9fe0f7)[_0xe8c6('0x8')](function(_0x3d1261){logger[_0xe8c6('0x9')](_0xe8c6('0xa'),_0x1e6dbd,_0xe8c6('0xb'));logger[_0xe8c6('0xc')](_0xe8c6('0xd'),_0x1e6dbd,_0xe8c6('0xb'),JSON[_0xe8c6('0xe')](_0x3d1261));if(_0x3d1261[_0xe8c6('0xf')]){if(_0x3d1261[_0xe8c6('0xf')][_0xe8c6('0x10')]===0x1f4){logger[_0xe8c6('0xf')](_0xe8c6('0xa'),_0x1e6dbd,_0x3d1261[_0xe8c6('0xf')][_0xe8c6('0x11')]);return _0x549d5c(_0x3d1261[_0xe8c6('0xf')][_0xe8c6('0x11')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1e6dbd,_0x3d1261[_0xe8c6('0xf')][_0xe8c6('0x11')]);return _0x8f436d(_0x3d1261['error'][_0xe8c6('0x11')]);}else{logger[_0xe8c6('0x9')]('ServicenowAccount,\x20%s,\x20%s',_0x1e6dbd,'request\x20sent');_0x8f436d(_0x3d1261[_0xe8c6('0x12')][_0xe8c6('0x11')]);}})[_0xe8c6('0x13')](function(_0x4706ce){logger[_0xe8c6('0xf')](_0xe8c6('0xa'),_0x1e6dbd,_0x4706ce);_0x549d5c(_0x4706ce);});});}exports[_0xe8c6('0x14')]=function(_0x2289d6){var _0x4fce86=this;return new Promise(function(_0xd99786,_0x4ca106){return db[_0xe8c6('0x15')][_0xe8c6('0x16')]({'raw':_0x2289d6[_0xe8c6('0x17')]?_0x2289d6[_0xe8c6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2289d6[_0xe8c6('0x17')]?_0x2289d6[_0xe8c6('0x17')][_0xe8c6('0x18')]||null:null,'attributes':_0x2289d6['options']?_0x2289d6['options'][_0xe8c6('0x19')]||null:null,'limit':_0x2289d6[_0xe8c6('0x17')]?_0x2289d6[_0xe8c6('0x17')][_0xe8c6('0x1a')]||null:null,'include':_0x2289d6['options']?_0x2289d6[_0xe8c6('0x17')]['include']?_[_0xe8c6('0x1b')](_0x2289d6['options'][_0xe8c6('0x1c')],function(_0x39eb95){return{'model':db[_0x39eb95[_0xe8c6('0x1d')]],'as':_0x39eb95['as'],'attributes':_0x39eb95[_0xe8c6('0x19')],'include':_0x39eb95[_0xe8c6('0x1c')]?_[_0xe8c6('0x1b')](_0x39eb95['include'],function(_0x41c62c){return{'model':db[_0x41c62c[_0xe8c6('0x1d')]],'as':_0x41c62c['as'],'attributes':_0x41c62c[_0xe8c6('0x19')],'include':_0x41c62c[_0xe8c6('0x1c')]?_[_0xe8c6('0x1b')](_0x41c62c['include'],function(_0x231d0b){return{'model':db[_0x231d0b[_0xe8c6('0x1d')]],'as':_0x231d0b['as'],'attributes':_0x231d0b[_0xe8c6('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe8c6('0x8')](function(_0x412dc7){logger[_0xe8c6('0x9')](_0xe8c6('0x14'),_0x2289d6);logger[_0xe8c6('0xc')]('GetServicenowAccount',_0x2289d6,JSON['stringify'](_0x412dc7));_0xd99786(_0x412dc7);})[_0xe8c6('0x13')](function(_0x395375){logger['error'](_0xe8c6('0x14'),_0x395375[_0xe8c6('0x11')],_0x2289d6);_0x4ca106(_0x4fce86[_0xe8c6('0xf')](0x1f4,_0x395375[_0xe8c6('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x5246d8){var _0x4d9f12=this;return new Promise(function(_0x44c23a,_0x5d0fd4){return db['ServicenowAccount'][_0xe8c6('0x1e')]({'raw':_0x5246d8[_0xe8c6('0x17')]?_0x5246d8['options'][_0xe8c6('0x1f')]===undefined?!![]:![]:!![],'where':_0x5246d8[_0xe8c6('0x17')]?_0x5246d8[_0xe8c6('0x17')][_0xe8c6('0x18')]||null:null,'attributes':_0x5246d8[_0xe8c6('0x17')]?_0x5246d8[_0xe8c6('0x17')][_0xe8c6('0x19')]||null:null,'include':_0x5246d8['options']?_0x5246d8['options'][_0xe8c6('0x1c')]?_[_0xe8c6('0x1b')](_0x5246d8[_0xe8c6('0x17')][_0xe8c6('0x1c')],function(_0x48ef46){return{'model':db[_0x48ef46[_0xe8c6('0x1d')]],'as':_0x48ef46['as'],'attributes':_0x48ef46[_0xe8c6('0x19')],'include':_0x48ef46[_0xe8c6('0x1c')]?_[_0xe8c6('0x1b')](_0x48ef46[_0xe8c6('0x1c')],function(_0x2e5803){return{'model':db[_0x2e5803[_0xe8c6('0x1d')]],'as':_0x2e5803['as'],'attributes':_0x2e5803[_0xe8c6('0x19')],'include':_0x2e5803[_0xe8c6('0x1c')]?_[_0xe8c6('0x1b')](_0x2e5803[_0xe8c6('0x1c')],function(_0x2e281b){return{'model':db[_0x2e281b[_0xe8c6('0x1d')]],'as':_0x2e281b['as'],'attributes':_0x2e281b[_0xe8c6('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe8c6('0x8')](function(_0x5e3e21){logger[_0xe8c6('0x9')](_0xe8c6('0x20'),_0x5246d8);logger[_0xe8c6('0xc')](_0xe8c6('0x20'),_0x5246d8,JSON[_0xe8c6('0xe')](_0x5e3e21));_0x44c23a(_0x5e3e21);})[_0xe8c6('0x13')](function(_0x24474e){logger[_0xe8c6('0xf')]('ShowServicenowAccount',_0x24474e['message'],_0x5246d8);_0x5d0fd4(_0x4d9f12[_0xe8c6('0xf')](0x1f4,_0x24474e[_0xe8c6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 2ceaa49..aaf2362 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 _0x99e5=['isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0xfaf5ba,_0x1ee57b){var _0x5220f2=function(_0x481bc8){while(--_0x481bc8){_0xfaf5ba['push'](_0xfaf5ba['shift']());}};_0x5220f2(++_0x1ee57b);}(_0x99e5,0xf5));var _0x599e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x99e5[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x599e('0x0'));var util=require(_0x599e('0x1'));var path=require(_0x599e('0x2'));var timeout=require(_0x599e('0x3'));var express=require('express');var router=express[_0x599e('0x4')]();var fs_extra=require(_0x599e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x599e('0x6'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x599e('0x7')](),controller[_0x599e('0x8')]);router[_0x599e('0x9')](_0x599e('0xa'),auth['isAuthenticated'](),controller[_0x599e('0xb')]);router[_0x599e('0x9')](_0x599e('0xc'),auth[_0x599e('0x7')](),controller[_0x599e('0xd')]);router[_0x599e('0x9')](_0x599e('0xe'),auth[_0x599e('0x7')](),controller[_0x599e('0xf')]);router['get']('/:id/descriptions',auth[_0x599e('0x7')](),controller['getDescriptions']);router[_0x599e('0x10')]('/',auth[_0x599e('0x7')](),controller['create']);router[_0x599e('0x11')](_0x599e('0xa'),auth[_0x599e('0x7')](),controller['update']);router[_0x599e('0x12')]('/:id',auth[_0x599e('0x7')](),controller[_0x599e('0x13')]);module[_0x599e('0x14')]=router; \ No newline at end of file +var _0xab52=['getFields','getSubjects','/:id/descriptions','getDescriptions','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0xc94c2b,_0x1eb9c0){var _0x274cf0=function(_0x388dec){while(--_0x388dec){_0xc94c2b['push'](_0xc94c2b['shift']());}};_0x274cf0(++_0x1eb9c0);}(_0xab52,0x126));var _0x2ab5=function(_0x595b20,_0x3ca289){_0x595b20=_0x595b20-0x0;var _0x51c7d0=_0xab52[_0x595b20];return _0x51c7d0;};'use strict';var multer=require('multer');var util=require(_0x2ab5('0x0'));var path=require(_0x2ab5('0x1'));var timeout=require(_0x2ab5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ab5('0x3'));var auth=require(_0x2ab5('0x4'));var interaction=require(_0x2ab5('0x5'));var config=require(_0x2ab5('0x6'));var controller=require(_0x2ab5('0x7'));router[_0x2ab5('0x8')]('/',auth[_0x2ab5('0x9')](),controller[_0x2ab5('0xa')]);router['get'](_0x2ab5('0xb'),auth[_0x2ab5('0x9')](),controller[_0x2ab5('0xc')]);router[_0x2ab5('0x8')](_0x2ab5('0xd'),auth[_0x2ab5('0x9')](),controller[_0x2ab5('0xe')]);router[_0x2ab5('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x2ab5('0xf')]);router[_0x2ab5('0x8')](_0x2ab5('0x10'),auth[_0x2ab5('0x9')](),controller[_0x2ab5('0x11')]);router['post']('/',auth[_0x2ab5('0x9')](),controller['create']);router['put'](_0x2ab5('0xb'),auth[_0x2ab5('0x9')](),controller[_0x2ab5('0x12')]);router[_0x2ab5('0x13')](_0x2ab5('0xb'),auth[_0x2ab5('0x9')](),controller[_0x2ab5('0x14')]);module[_0x2ab5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index e6698bb..29e0ea4 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 _0x0872=['STRING','sequelize'];(function(_0x49fedc,_0x51a37f){var _0x16f383=function(_0x3848e4){while(--_0x3848e4){_0x49fedc['push'](_0x49fedc['shift']());}};_0x16f383(++_0x51a37f);}(_0x0872,0x93));var _0x2087=function(_0x165648,_0x284f0a){_0x165648=_0x165648-0x0;var _0x441e05=_0x0872[_0x165648];return _0x441e05;};'use strict';var Sequelize=require(_0x2087('0x0'));module['exports']={'name':{'type':Sequelize[_0x2087('0x1')]},'description':{'type':Sequelize[_0x2087('0x1')]}}; \ No newline at end of file +var _0x176e=['exports','sequelize'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x176e,0x18b));var _0xe176=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x176e[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xe176('0x0'));module[_0xe176('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f99bec2..f97019d 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 _0x2e61=['show','rawAttributes','include','options','find','create','body','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','end','stack','name','send','ServicenowConfiguration','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','then','includeAll','catch'];(function(_0x6411f7,_0x359f58){var _0x46a6dc=function(_0x34ee3d){while(--_0x34ee3d){_0x6411f7['push'](_0x6411f7['shift']());}};_0x46a6dc(++_0x359f58);}(_0x2e61,0x1e7));var _0x12e6=function(_0x16b3bf,_0x2aca42){_0x16b3bf=_0x16b3bf-0x0;var _0x566eb2=_0x2e61[_0x16b3bf];return _0x566eb2;};'use strict';var emlformat=require(_0x12e6('0x0'));var rimraf=require(_0x12e6('0x1'));var zipdir=require(_0x12e6('0x2'));var jsonpatch=require(_0x12e6('0x3'));var rp=require('request-promise');var moment=require(_0x12e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x12e6('0x5'));var util=require(_0x12e6('0x6'));var path=require(_0x12e6('0x7'));var sox=require('sox');var csv=require(_0x12e6('0x8'));var ejs=require(_0x12e6('0x9'));var fs=require('fs');var fs_extra=require(_0x12e6('0xa'));var _=require(_0x12e6('0xb'));var squel=require(_0x12e6('0xc'));var crypto=require(_0x12e6('0xd'));var jsforce=require(_0x12e6('0xe'));var deskjs=require(_0x12e6('0xf'));var toCsv=require(_0x12e6('0x8'));var querystring=require(_0x12e6('0x10'));var Papa=require(_0x12e6('0x11'));var Redis=require('ioredis');var authService=require(_0x12e6('0x12'));var qs=require(_0x12e6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12e6('0x14'));var logger=require(_0x12e6('0x15'))(_0x12e6('0x16'));var utils=require(_0x12e6('0x17'));var config=require(_0x12e6('0x18'));var licenseUtil=require(_0x12e6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x372dc1,_0x69ca3a){_0x69ca3a=_0x69ca3a||0xcc;return function(_0x22ec10){if(_0x22ec10){return _0x372dc1[_0x12e6('0x1a')](_0x69ca3a);}return _0x372dc1[_0x12e6('0x1b')](_0x69ca3a)['end']();};}function respondWithResult(_0x17f0fa,_0x5ac750){_0x5ac750=_0x5ac750||0xc8;return function(_0xae3331){if(_0xae3331){return _0x17f0fa[_0x12e6('0x1b')](_0x5ac750)['json'](_0xae3331);}};}function respondWithFilteredResult(_0xd2783e,_0x51624f){return function(_0x26dc4e){if(_0x26dc4e){var _0x57c3da=typeof _0x51624f[_0x12e6('0x1c')]===_0x12e6('0x1d')&&typeof _0x51624f[_0x12e6('0x1e')]==='undefined';var _0x1c47c9=_0x26dc4e['count'];var _0x49a321=_0x57c3da?0x0:_0x51624f[_0x12e6('0x1c')];var _0x495916=_0x57c3da?_0x26dc4e[_0x12e6('0x1f')]:_0x51624f[_0x12e6('0x1c')]+_0x51624f[_0x12e6('0x1e')];var _0xf1151;if(_0x495916>=_0x1c47c9){_0x495916=_0x1c47c9;_0xf1151=0xc8;}else{_0xf1151=0xce;}_0xd2783e[_0x12e6('0x1b')](_0xf1151);return _0xd2783e[_0x12e6('0x20')](_0x12e6('0x21'),_0x49a321+'-'+_0x495916+'/'+_0x1c47c9)[_0x12e6('0x22')](_0x26dc4e);}return null;};}function patchUpdates(_0x9d00be){return function(_0x16d68a){try{jsonpatch[_0x12e6('0x23')](_0x16d68a,_0x9d00be,!![]);}catch(_0x137a7e){return BPromise['reject'](_0x137a7e);}return _0x16d68a[_0x12e6('0x24')]();};}function saveUpdates(_0x1b74d2,_0x288982){return function(_0x232705){if(_0x232705){return _0x232705[_0x12e6('0x25')](_0x1b74d2)['then'](function(_0x136639){return _0x136639;});}return null;};}function removeEntity(_0x28434d,_0x367829){return function(_0xfce8f0){if(_0xfce8f0){return _0xfce8f0[_0x12e6('0x26')]()['then'](function(){_0x28434d[_0x12e6('0x1b')](0xcc)[_0x12e6('0x27')]();});}};}function handleEntityNotFound(_0x459f95,_0x23a735){return function(_0x300269){if(!_0x300269){_0x459f95['sendStatus'](0x194);}return _0x300269;};}function handleError(_0x2545e6,_0x57c12d){_0x57c12d=_0x57c12d||0x1f4;return function(_0x2524df){logger['error'](_0x2524df[_0x12e6('0x28')]);if(_0x2524df[_0x12e6('0x29')]){delete _0x2524df[_0x12e6('0x29')];}_0x2545e6[_0x12e6('0x1b')](_0x57c12d)[_0x12e6('0x2a')](_0x2524df);};}exports['index']=function(_0x17958c,_0x18c393){var _0x45529e={},_0xa7c796={},_0x470db6={'count':0x0,'rows':[]};var _0xc661b4=_['map'](db[_0x12e6('0x2b')]['rawAttributes'],function(_0xaa94ce){return{'name':_0xaa94ce[_0x12e6('0x2c')],'type':_0xaa94ce[_0x12e6('0x2d')]['key']};});_0xa7c796[_0x12e6('0x2e')]=_[_0x12e6('0x2f')](_0xc661b4,_0x12e6('0x29'));_0xa7c796[_0x12e6('0x30')]=_[_0x12e6('0x31')](_0x17958c[_0x12e6('0x30')]);_0xa7c796[_0x12e6('0x32')]=_['intersection'](_0xa7c796[_0x12e6('0x2e')],_0xa7c796[_0x12e6('0x30')]);_0x45529e['attributes']=_[_0x12e6('0x33')](_0xa7c796['model'],qs['fields'](_0x17958c[_0x12e6('0x30')][_0x12e6('0x34')]));_0x45529e[_0x12e6('0x35')]=_0x45529e[_0x12e6('0x35')][_0x12e6('0x36')]?_0x45529e[_0x12e6('0x35')]:_0xa7c796[_0x12e6('0x2e')];if(!_0x17958c['query'][_0x12e6('0x37')](_0x12e6('0x38'))){_0x45529e['limit']=qs[_0x12e6('0x1e')](_0x17958c[_0x12e6('0x30')][_0x12e6('0x1e')]);_0x45529e[_0x12e6('0x1c')]=qs[_0x12e6('0x1c')](_0x17958c[_0x12e6('0x30')]['offset']);}_0x45529e[_0x12e6('0x39')]=qs[_0x12e6('0x3a')](_0x17958c[_0x12e6('0x30')][_0x12e6('0x3a')]);_0x45529e[_0x12e6('0x3b')]=qs['filters'](_[_0x12e6('0x3c')](_0x17958c['query'],_0xa7c796[_0x12e6('0x32')]),_0xc661b4);if(_0x17958c['query']['filter']){_0x45529e[_0x12e6('0x3b')]=_[_0x12e6('0x3d')](_0x45529e[_0x12e6('0x3b')],{'$or':_[_0x12e6('0x2f')](_0xc661b4,function(_0x19e7ac){if(_0x19e7ac[_0x12e6('0x2d')]!=='VIRTUAL'){var _0xb954e0={};_0xb954e0[_0x19e7ac[_0x12e6('0x29')]]={'$like':'%'+_0x17958c['query'][_0x12e6('0x3e')]+'%'};return _0xb954e0;}})});}_0x45529e=_[_0x12e6('0x3d')]({},_0x45529e,_0x17958c['options']);var _0x29d8eb={'where':_0x45529e[_0x12e6('0x3b')]};return db[_0x12e6('0x2b')][_0x12e6('0x1f')](_0x29d8eb)[_0x12e6('0x3f')](function(_0x4f3a34){_0x470db6[_0x12e6('0x1f')]=_0x4f3a34;if(_0x17958c[_0x12e6('0x30')][_0x12e6('0x40')]){_0x45529e['include']=[{'all':!![]}];}return db[_0x12e6('0x2b')]['findAll'](_0x45529e);})['then'](function(_0x5b369){_0x470db6['rows']=_0x5b369;return _0x470db6;})[_0x12e6('0x3f')](respondWithFilteredResult(_0x18c393,_0x45529e))[_0x12e6('0x41')](handleError(_0x18c393,null));};exports[_0x12e6('0x42')]=function(_0x40177a,_0x5d78e1){var _0x5b0012={'raw':![],'where':{'id':_0x40177a['params']['id']}},_0x3ab462={};_0x3ab462['model']=_[_0x12e6('0x31')](db[_0x12e6('0x2b')][_0x12e6('0x43')]);_0x3ab462[_0x12e6('0x30')]=_[_0x12e6('0x31')](_0x40177a[_0x12e6('0x30')]);_0x3ab462[_0x12e6('0x32')]=_[_0x12e6('0x33')](_0x3ab462[_0x12e6('0x2e')],_0x3ab462[_0x12e6('0x30')]);_0x5b0012[_0x12e6('0x35')]=_['intersection'](_0x3ab462['model'],qs[_0x12e6('0x34')](_0x40177a[_0x12e6('0x30')][_0x12e6('0x34')]));_0x5b0012[_0x12e6('0x35')]=_0x5b0012[_0x12e6('0x35')][_0x12e6('0x36')]?_0x5b0012[_0x12e6('0x35')]:_0x3ab462['model'];if(_0x40177a[_0x12e6('0x30')][_0x12e6('0x40')]){_0x5b0012[_0x12e6('0x44')]=[{'all':!![]}];}_0x5b0012=_[_0x12e6('0x3d')]({},_0x5b0012,_0x40177a[_0x12e6('0x45')]);return db[_0x12e6('0x2b')][_0x12e6('0x46')](_0x5b0012)[_0x12e6('0x3f')](handleEntityNotFound(_0x5d78e1,null))[_0x12e6('0x3f')](respondWithResult(_0x5d78e1,null))['catch'](handleError(_0x5d78e1,null));};exports[_0x12e6('0x47')]=function(_0x37da4c,_0x733bf9){return db['ServicenowConfiguration'][_0x12e6('0x47')](_0x37da4c[_0x12e6('0x48')],{})[_0x12e6('0x3f')](respondWithResult(_0x733bf9,0xc9))[_0x12e6('0x41')](handleError(_0x733bf9,null));};exports[_0x12e6('0x25')]=function(_0x5864a7,_0x5ed3ee){if(_0x5864a7['body']['id']){delete _0x5864a7[_0x12e6('0x48')]['id'];}return db[_0x12e6('0x2b')][_0x12e6('0x46')]({'where':{'id':_0x5864a7['params']['id']}})[_0x12e6('0x3f')](handleEntityNotFound(_0x5ed3ee,null))['then'](saveUpdates(_0x5864a7['body'],null))[_0x12e6('0x3f')](respondWithResult(_0x5ed3ee,null))['catch'](handleError(_0x5ed3ee,null));};exports['destroy']=function(_0xdb2fb6,_0x2e096b){return db['ServicenowConfiguration'][_0x12e6('0x46')]({'where':{'id':_0xdb2fb6[_0x12e6('0x49')]['id']}})[_0x12e6('0x3f')](handleEntityNotFound(_0x2e096b,null))[_0x12e6('0x3f')](removeEntity(_0x2e096b,null))[_0x12e6('0x41')](handleError(_0x2e096b,null));};exports[_0x12e6('0x4a')]=function(_0x3c4ac3,_0x41ce7b,_0x5411c2){var _0x1c7e7e={};var _0x55455d={};var _0x1d7ee3;var _0x10c9bd;return db['ServicenowConfiguration'][_0x12e6('0x4b')]({'where':{'id':_0x3c4ac3['params']['id']}})[_0x12e6('0x3f')](handleEntityNotFound(_0x41ce7b,null))[_0x12e6('0x3f')](function(_0x494c18){if(_0x494c18){_0x1d7ee3=_0x494c18;_0x55455d[_0x12e6('0x2e')]=_[_0x12e6('0x31')](db[_0x12e6('0x4c')][_0x12e6('0x43')]);_0x55455d[_0x12e6('0x30')]=_[_0x12e6('0x31')](_0x3c4ac3[_0x12e6('0x30')]);_0x55455d[_0x12e6('0x32')]=_['intersection'](_0x55455d[_0x12e6('0x2e')],_0x55455d['query']);_0x1c7e7e[_0x12e6('0x35')]=_['intersection'](_0x55455d['model'],qs[_0x12e6('0x34')](_0x3c4ac3[_0x12e6('0x30')][_0x12e6('0x34')]));_0x1c7e7e[_0x12e6('0x35')]=_0x1c7e7e[_0x12e6('0x35')][_0x12e6('0x36')]?_0x1c7e7e[_0x12e6('0x35')]:_0x55455d[_0x12e6('0x2e')];_0x1c7e7e[_0x12e6('0x39')]=qs[_0x12e6('0x3a')](_0x3c4ac3[_0x12e6('0x30')]['sort']);_0x1c7e7e[_0x12e6('0x3b')]=qs[_0x12e6('0x32')](_[_0x12e6('0x3c')](_0x3c4ac3[_0x12e6('0x30')],_0x55455d['filters']));if(_0x3c4ac3['query'][_0x12e6('0x3e')]){_0x1c7e7e[_0x12e6('0x3b')]=_['merge'](_0x1c7e7e[_0x12e6('0x3b')],{'$or':_[_0x12e6('0x2f')](_0x1c7e7e[_0x12e6('0x35')],function(_0xa58bd5){var _0x3045ad={};_0x3045ad[_0xa58bd5]={'$like':'%'+_0x3c4ac3[_0x12e6('0x30')][_0x12e6('0x3e')]+'%'};return _0x3045ad;})});}_0x1c7e7e=_['merge']({},_0x1c7e7e,_0x3c4ac3['options']);return _0x1d7ee3['getFields'](_0x1c7e7e);}})[_0x12e6('0x3f')](function(_0x46cbab){if(_0x46cbab){_0x10c9bd=_0x46cbab[_0x12e6('0x36')];if(!_0x3c4ac3[_0x12e6('0x30')][_0x12e6('0x37')](_0x12e6('0x38'))){_0x1c7e7e[_0x12e6('0x1e')]=qs['limit'](_0x3c4ac3['query'][_0x12e6('0x1e')]);_0x1c7e7e[_0x12e6('0x1c')]=qs['offset'](_0x3c4ac3[_0x12e6('0x30')][_0x12e6('0x1c')]);}return _0x1d7ee3['getFields'](_0x1c7e7e);}})[_0x12e6('0x3f')](function(_0x586847){if(_0x586847){return _0x586847?{'count':_0x10c9bd,'rows':_0x586847}:null;}})[_0x12e6('0x3f')](respondWithResult(_0x41ce7b,null))[_0x12e6('0x41')](handleError(_0x41ce7b,null));};exports[_0x12e6('0x4d')]=function(_0x3f1b3a,_0x3c9e8d,_0x2cde6e){var _0x2df730={};var _0x51af09={};var _0x5aaef3;var _0x4e4bf6;return db[_0x12e6('0x2b')]['findOne']({'where':{'id':_0x3f1b3a[_0x12e6('0x49')]['id']}})[_0x12e6('0x3f')](handleEntityNotFound(_0x3c9e8d,null))[_0x12e6('0x3f')](function(_0x20a3f3){if(_0x20a3f3){_0x5aaef3=_0x20a3f3;_0x51af09[_0x12e6('0x2e')]=_[_0x12e6('0x31')](db[_0x12e6('0x4c')][_0x12e6('0x43')]);_0x51af09[_0x12e6('0x30')]=_['keys'](_0x3f1b3a['query']);_0x51af09[_0x12e6('0x32')]=_['intersection'](_0x51af09[_0x12e6('0x2e')],_0x51af09[_0x12e6('0x30')]);_0x2df730[_0x12e6('0x35')]=_[_0x12e6('0x33')](_0x51af09[_0x12e6('0x2e')],qs[_0x12e6('0x34')](_0x3f1b3a[_0x12e6('0x30')][_0x12e6('0x34')]));_0x2df730[_0x12e6('0x35')]=_0x2df730[_0x12e6('0x35')]['length']?_0x2df730['attributes']:_0x51af09[_0x12e6('0x2e')];_0x2df730[_0x12e6('0x39')]=qs['sort'](_0x3f1b3a['query'][_0x12e6('0x3a')]);_0x2df730[_0x12e6('0x3b')]=qs['filters'](_[_0x12e6('0x3c')](_0x3f1b3a[_0x12e6('0x30')],_0x51af09[_0x12e6('0x32')]));if(_0x3f1b3a['query']['filter']){_0x2df730['where']=_[_0x12e6('0x3d')](_0x2df730[_0x12e6('0x3b')],{'$or':_[_0x12e6('0x2f')](_0x2df730[_0x12e6('0x35')],function(_0x3aea3f){var _0x442dbc={};_0x442dbc[_0x3aea3f]={'$like':'%'+_0x3f1b3a[_0x12e6('0x30')][_0x12e6('0x3e')]+'%'};return _0x442dbc;})});}_0x2df730=_[_0x12e6('0x3d')]({},_0x2df730,_0x3f1b3a['options']);return _0x5aaef3[_0x12e6('0x4d')](_0x2df730);}})[_0x12e6('0x3f')](function(_0x5da616){if(_0x5da616){_0x4e4bf6=_0x5da616[_0x12e6('0x36')];if(!_0x3f1b3a['query'][_0x12e6('0x37')](_0x12e6('0x38'))){_0x2df730[_0x12e6('0x1e')]=qs[_0x12e6('0x1e')](_0x3f1b3a[_0x12e6('0x30')][_0x12e6('0x1e')]);_0x2df730['offset']=qs[_0x12e6('0x1c')](_0x3f1b3a[_0x12e6('0x30')][_0x12e6('0x1c')]);}return _0x5aaef3[_0x12e6('0x4d')](_0x2df730);}})['then'](function(_0x3415aa){if(_0x3415aa){return _0x3415aa?{'count':_0x4e4bf6,'rows':_0x3415aa}:null;}})[_0x12e6('0x3f')](respondWithResult(_0x3c9e8d,null))['catch'](handleError(_0x3c9e8d,null));};exports[_0x12e6('0x4e')]=function(_0x2ab8b0,_0x5dc82f,_0x2d25d6){var _0x14cb90={};var _0x270bc9={};var _0x173837;var _0x888eed;return db[_0x12e6('0x2b')][_0x12e6('0x4b')]({'where':{'id':_0x2ab8b0[_0x12e6('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dc82f,null))[_0x12e6('0x3f')](function(_0x105a40){if(_0x105a40){_0x173837=_0x105a40;_0x270bc9['model']=_['keys'](db['ServicenowField'][_0x12e6('0x43')]);_0x270bc9['query']=_[_0x12e6('0x31')](_0x2ab8b0[_0x12e6('0x30')]);_0x270bc9[_0x12e6('0x32')]=_[_0x12e6('0x33')](_0x270bc9['model'],_0x270bc9['query']);_0x14cb90[_0x12e6('0x35')]=_['intersection'](_0x270bc9[_0x12e6('0x2e')],qs[_0x12e6('0x34')](_0x2ab8b0[_0x12e6('0x30')][_0x12e6('0x34')]));_0x14cb90[_0x12e6('0x35')]=_0x14cb90[_0x12e6('0x35')]['length']?_0x14cb90[_0x12e6('0x35')]:_0x270bc9[_0x12e6('0x2e')];_0x14cb90[_0x12e6('0x39')]=qs['sort'](_0x2ab8b0[_0x12e6('0x30')][_0x12e6('0x3a')]);_0x14cb90[_0x12e6('0x3b')]=qs[_0x12e6('0x32')](_['pick'](_0x2ab8b0[_0x12e6('0x30')],_0x270bc9[_0x12e6('0x32')]));if(_0x2ab8b0[_0x12e6('0x30')][_0x12e6('0x3e')]){_0x14cb90[_0x12e6('0x3b')]=_['merge'](_0x14cb90[_0x12e6('0x3b')],{'$or':_[_0x12e6('0x2f')](_0x14cb90['attributes'],function(_0x4cf636){var _0x16d119={};_0x16d119[_0x4cf636]={'$like':'%'+_0x2ab8b0[_0x12e6('0x30')][_0x12e6('0x3e')]+'%'};return _0x16d119;})});}_0x14cb90=_[_0x12e6('0x3d')]({},_0x14cb90,_0x2ab8b0[_0x12e6('0x45')]);return _0x173837[_0x12e6('0x4e')](_0x14cb90);}})[_0x12e6('0x3f')](function(_0x285a04){if(_0x285a04){_0x888eed=_0x285a04[_0x12e6('0x36')];if(!_0x2ab8b0[_0x12e6('0x30')]['hasOwnProperty'](_0x12e6('0x38'))){_0x14cb90['limit']=qs[_0x12e6('0x1e')](_0x2ab8b0[_0x12e6('0x30')][_0x12e6('0x1e')]);_0x14cb90[_0x12e6('0x1c')]=qs[_0x12e6('0x1c')](_0x2ab8b0[_0x12e6('0x30')][_0x12e6('0x1c')]);}return _0x173837[_0x12e6('0x4e')](_0x14cb90);}})[_0x12e6('0x3f')](function(_0xd9576a){if(_0xd9576a){return _0xd9576a?{'count':_0x888eed,'rows':_0xd9576a}:null;}})['then'](respondWithResult(_0x5dc82f,null))[_0x12e6('0x41')](handleError(_0x5dc82f,null));}; \ No newline at end of file +var _0x5dde=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ServicenowConfiguration','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','getFields','findOne','ServicenowField','rawAttributes','length','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x5dde,0x1cf));var _0xe5dd=function(_0x3ed666,_0x3345f9){_0x3ed666=_0x3ed666-0x0;var _0x1587f5=_0x5dde[_0x3ed666];return _0x1587f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe5dd('0x0'));var zipdir=require(_0xe5dd('0x1'));var jsonpatch=require(_0xe5dd('0x2'));var rp=require(_0xe5dd('0x3'));var moment=require(_0xe5dd('0x4'));var BPromise=require(_0xe5dd('0x5'));var Mustache=require(_0xe5dd('0x6'));var util=require('util');var path=require(_0xe5dd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5dd('0x8'));var _=require(_0xe5dd('0x9'));var squel=require('squel');var crypto=require(_0xe5dd('0xa'));var jsforce=require(_0xe5dd('0xb'));var deskjs=require(_0xe5dd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe5dd('0xd'));var Papa=require(_0xe5dd('0xe'));var Redis=require(_0xe5dd('0xf'));var authService=require(_0xe5dd('0x10'));var qs=require(_0xe5dd('0x11'));var as=require(_0xe5dd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5dd('0x13'))(_0xe5dd('0x14'));var utils=require(_0xe5dd('0x15'));var config=require(_0xe5dd('0x16'));var licenseUtil=require(_0xe5dd('0x17'));var db=require(_0xe5dd('0x18'))['db'];function respondWithStatusCode(_0x3dd911,_0x2b18bd){_0x2b18bd=_0x2b18bd||0xcc;return function(_0xdcafad){if(_0xdcafad){return _0x3dd911[_0xe5dd('0x19')](_0x2b18bd);}return _0x3dd911[_0xe5dd('0x1a')](_0x2b18bd)[_0xe5dd('0x1b')]();};}function respondWithResult(_0x580558,_0x5caeef){_0x5caeef=_0x5caeef||0xc8;return function(_0x552f12){if(_0x552f12){return _0x580558[_0xe5dd('0x1a')](_0x5caeef)[_0xe5dd('0x1c')](_0x552f12);}};}function respondWithFilteredResult(_0x439fb8,_0x105a69){return function(_0x260281){if(_0x260281){var _0x48228d=typeof _0x105a69[_0xe5dd('0x1d')]==='undefined'&&typeof _0x105a69['limit']===_0xe5dd('0x1e');var _0x548442=_0x260281[_0xe5dd('0x1f')];var _0x1f14df=_0x48228d?0x0:_0x105a69['offset'];var _0x2fc919=_0x48228d?_0x260281[_0xe5dd('0x1f')]:_0x105a69[_0xe5dd('0x1d')]+_0x105a69[_0xe5dd('0x20')];var _0x4dd540;if(_0x2fc919>=_0x548442){_0x2fc919=_0x548442;_0x4dd540=0xc8;}else{_0x4dd540=0xce;}_0x439fb8[_0xe5dd('0x1a')](_0x4dd540);return _0x439fb8[_0xe5dd('0x21')](_0xe5dd('0x22'),_0x1f14df+'-'+_0x2fc919+'/'+_0x548442)[_0xe5dd('0x1c')](_0x260281);}return null;};}function patchUpdates(_0x2288b0){return function(_0x32014f){try{jsonpatch[_0xe5dd('0x23')](_0x32014f,_0x2288b0,!![]);}catch(_0x525ac1){return BPromise['reject'](_0x525ac1);}return _0x32014f[_0xe5dd('0x24')]();};}function saveUpdates(_0x48eaa9,_0x2fed3e){return function(_0x124158){if(_0x124158){return _0x124158[_0xe5dd('0x25')](_0x48eaa9)[_0xe5dd('0x26')](function(_0x2b95ea){return _0x2b95ea;});}return null;};}function removeEntity(_0x21fa2f,_0xe11bac){return function(_0x58bd5f){if(_0x58bd5f){return _0x58bd5f[_0xe5dd('0x27')]()[_0xe5dd('0x26')](function(){_0x21fa2f[_0xe5dd('0x1a')](0xcc)[_0xe5dd('0x1b')]();});}};}function handleEntityNotFound(_0x42a817,_0x3d1c3b){return function(_0x1633c2){if(!_0x1633c2){_0x42a817[_0xe5dd('0x19')](0x194);}return _0x1633c2;};}function handleError(_0x3775a9,_0x556624){_0x556624=_0x556624||0x1f4;return function(_0x3479fe){logger[_0xe5dd('0x28')](_0x3479fe[_0xe5dd('0x29')]);if(_0x3479fe[_0xe5dd('0x2a')]){delete _0x3479fe[_0xe5dd('0x2a')];}_0x3775a9[_0xe5dd('0x1a')](_0x556624)['send'](_0x3479fe);};}exports[_0xe5dd('0x2b')]=function(_0x548820,_0x460204){var _0x690af7={},_0x591210={},_0x379bf7={'count':0x0,'rows':[]};var _0x2c2192=_[_0xe5dd('0x2c')](db[_0xe5dd('0x2d')]['rawAttributes'],function(_0x28afcb){return{'name':_0x28afcb['fieldName'],'type':_0x28afcb[_0xe5dd('0x2e')][_0xe5dd('0x2f')]};});_0x591210[_0xe5dd('0x30')]=_['map'](_0x2c2192,'name');_0x591210[_0xe5dd('0x31')]=_[_0xe5dd('0x32')](_0x548820['query']);_0x591210['filters']=_[_0xe5dd('0x33')](_0x591210[_0xe5dd('0x30')],_0x591210[_0xe5dd('0x31')]);_0x690af7['attributes']=_['intersection'](_0x591210[_0xe5dd('0x30')],qs[_0xe5dd('0x34')](_0x548820[_0xe5dd('0x31')]['fields']));_0x690af7[_0xe5dd('0x35')]=_0x690af7[_0xe5dd('0x35')]['length']?_0x690af7[_0xe5dd('0x35')]:_0x591210[_0xe5dd('0x30')];if(!_0x548820[_0xe5dd('0x31')][_0xe5dd('0x36')](_0xe5dd('0x37'))){_0x690af7['limit']=qs[_0xe5dd('0x20')](_0x548820[_0xe5dd('0x31')][_0xe5dd('0x20')]);_0x690af7[_0xe5dd('0x1d')]=qs[_0xe5dd('0x1d')](_0x548820[_0xe5dd('0x31')][_0xe5dd('0x1d')]);}_0x690af7[_0xe5dd('0x38')]=qs[_0xe5dd('0x39')](_0x548820[_0xe5dd('0x31')][_0xe5dd('0x39')]);_0x690af7[_0xe5dd('0x3a')]=qs[_0xe5dd('0x3b')](_[_0xe5dd('0x3c')](_0x548820[_0xe5dd('0x31')],_0x591210[_0xe5dd('0x3b')]),_0x2c2192);if(_0x548820['query'][_0xe5dd('0x3d')]){_0x690af7['where']=_[_0xe5dd('0x3e')](_0x690af7[_0xe5dd('0x3a')],{'$or':_['map'](_0x2c2192,function(_0x284072){if(_0x284072['type']!==_0xe5dd('0x3f')){var _0x20b7e0={};_0x20b7e0[_0x284072['name']]={'$like':'%'+_0x548820['query'][_0xe5dd('0x3d')]+'%'};return _0x20b7e0;}})});}_0x690af7=_[_0xe5dd('0x3e')]({},_0x690af7,_0x548820['options']);var _0x4db94c={'where':_0x690af7[_0xe5dd('0x3a')]};return db['ServicenowConfiguration']['count'](_0x4db94c)[_0xe5dd('0x26')](function(_0x401083){_0x379bf7[_0xe5dd('0x1f')]=_0x401083;if(_0x548820[_0xe5dd('0x31')][_0xe5dd('0x40')]){_0x690af7[_0xe5dd('0x41')]=[{'all':!![]}];}return db[_0xe5dd('0x2d')]['findAll'](_0x690af7);})['then'](function(_0x2dbd0e){_0x379bf7[_0xe5dd('0x42')]=_0x2dbd0e;return _0x379bf7;})[_0xe5dd('0x26')](respondWithFilteredResult(_0x460204,_0x690af7))[_0xe5dd('0x43')](handleError(_0x460204,null));};exports['show']=function(_0x58396d,_0x3ad81a){var _0x49c7d5={'raw':![],'where':{'id':_0x58396d[_0xe5dd('0x44')]['id']}},_0x366f48={};_0x366f48[_0xe5dd('0x30')]=_['keys'](db[_0xe5dd('0x2d')]['rawAttributes']);_0x366f48['query']=_[_0xe5dd('0x32')](_0x58396d['query']);_0x366f48[_0xe5dd('0x3b')]=_[_0xe5dd('0x33')](_0x366f48[_0xe5dd('0x30')],_0x366f48[_0xe5dd('0x31')]);_0x49c7d5['attributes']=_[_0xe5dd('0x33')](_0x366f48[_0xe5dd('0x30')],qs[_0xe5dd('0x34')](_0x58396d[_0xe5dd('0x31')][_0xe5dd('0x34')]));_0x49c7d5[_0xe5dd('0x35')]=_0x49c7d5[_0xe5dd('0x35')]['length']?_0x49c7d5[_0xe5dd('0x35')]:_0x366f48[_0xe5dd('0x30')];if(_0x58396d['query'][_0xe5dd('0x40')]){_0x49c7d5[_0xe5dd('0x41')]=[{'all':!![]}];}_0x49c7d5=_[_0xe5dd('0x3e')]({},_0x49c7d5,_0x58396d[_0xe5dd('0x45')]);return db[_0xe5dd('0x2d')][_0xe5dd('0x46')](_0x49c7d5)[_0xe5dd('0x26')](handleEntityNotFound(_0x3ad81a,null))['then'](respondWithResult(_0x3ad81a,null))[_0xe5dd('0x43')](handleError(_0x3ad81a,null));};exports['create']=function(_0x1de606,_0x4bda34){return db[_0xe5dd('0x2d')][_0xe5dd('0x47')](_0x1de606[_0xe5dd('0x48')],{})[_0xe5dd('0x26')](respondWithResult(_0x4bda34,0xc9))['catch'](handleError(_0x4bda34,null));};exports[_0xe5dd('0x25')]=function(_0x3d30ba,_0x372036){if(_0x3d30ba[_0xe5dd('0x48')]['id']){delete _0x3d30ba[_0xe5dd('0x48')]['id'];}return db[_0xe5dd('0x2d')][_0xe5dd('0x46')]({'where':{'id':_0x3d30ba[_0xe5dd('0x44')]['id']}})[_0xe5dd('0x26')](handleEntityNotFound(_0x372036,null))[_0xe5dd('0x26')](saveUpdates(_0x3d30ba[_0xe5dd('0x48')],null))['then'](respondWithResult(_0x372036,null))[_0xe5dd('0x43')](handleError(_0x372036,null));};exports[_0xe5dd('0x27')]=function(_0x2e50fb,_0xef7e51){return db[_0xe5dd('0x2d')]['find']({'where':{'id':_0x2e50fb[_0xe5dd('0x44')]['id']}})['then'](handleEntityNotFound(_0xef7e51,null))[_0xe5dd('0x26')](removeEntity(_0xef7e51,null))[_0xe5dd('0x43')](handleError(_0xef7e51,null));};exports[_0xe5dd('0x49')]=function(_0x5359d6,_0x3a2e8d,_0x413f4a){var _0x288867={};var _0x323cda={};var _0x460b81;var _0x251805;return db[_0xe5dd('0x2d')][_0xe5dd('0x4a')]({'where':{'id':_0x5359d6['params']['id']}})[_0xe5dd('0x26')](handleEntityNotFound(_0x3a2e8d,null))[_0xe5dd('0x26')](function(_0x3456be){if(_0x3456be){_0x460b81=_0x3456be;_0x323cda[_0xe5dd('0x30')]=_[_0xe5dd('0x32')](db[_0xe5dd('0x4b')][_0xe5dd('0x4c')]);_0x323cda[_0xe5dd('0x31')]=_[_0xe5dd('0x32')](_0x5359d6[_0xe5dd('0x31')]);_0x323cda[_0xe5dd('0x3b')]=_['intersection'](_0x323cda['model'],_0x323cda[_0xe5dd('0x31')]);_0x288867[_0xe5dd('0x35')]=_['intersection'](_0x323cda['model'],qs['fields'](_0x5359d6[_0xe5dd('0x31')][_0xe5dd('0x34')]));_0x288867['attributes']=_0x288867[_0xe5dd('0x35')][_0xe5dd('0x4d')]?_0x288867[_0xe5dd('0x35')]:_0x323cda['model'];_0x288867[_0xe5dd('0x38')]=qs[_0xe5dd('0x39')](_0x5359d6[_0xe5dd('0x31')][_0xe5dd('0x39')]);_0x288867[_0xe5dd('0x3a')]=qs[_0xe5dd('0x3b')](_[_0xe5dd('0x3c')](_0x5359d6[_0xe5dd('0x31')],_0x323cda['filters']));if(_0x5359d6[_0xe5dd('0x31')][_0xe5dd('0x3d')]){_0x288867[_0xe5dd('0x3a')]=_[_0xe5dd('0x3e')](_0x288867['where'],{'$or':_[_0xe5dd('0x2c')](_0x288867[_0xe5dd('0x35')],function(_0x40e688){var _0x266273={};_0x266273[_0x40e688]={'$like':'%'+_0x5359d6['query']['filter']+'%'};return _0x266273;})});}_0x288867=_[_0xe5dd('0x3e')]({},_0x288867,_0x5359d6[_0xe5dd('0x45')]);return _0x460b81[_0xe5dd('0x49')](_0x288867);}})[_0xe5dd('0x26')](function(_0x1718c6){if(_0x1718c6){_0x251805=_0x1718c6[_0xe5dd('0x4d')];if(!_0x5359d6[_0xe5dd('0x31')][_0xe5dd('0x36')]('nolimit')){_0x288867[_0xe5dd('0x20')]=qs[_0xe5dd('0x20')](_0x5359d6[_0xe5dd('0x31')][_0xe5dd('0x20')]);_0x288867['offset']=qs[_0xe5dd('0x1d')](_0x5359d6['query'][_0xe5dd('0x1d')]);}return _0x460b81['getFields'](_0x288867);}})[_0xe5dd('0x26')](function(_0x273cbc){if(_0x273cbc){return _0x273cbc?{'count':_0x251805,'rows':_0x273cbc}:null;}})[_0xe5dd('0x26')](respondWithResult(_0x3a2e8d,null))[_0xe5dd('0x43')](handleError(_0x3a2e8d,null));};exports[_0xe5dd('0x4e')]=function(_0x44c11c,_0x3ef042,_0x2cf55f){var _0x2a42cb={};var _0x3ac8f7={};var _0xb562f7;var _0x64eb6e;return db['ServicenowConfiguration'][_0xe5dd('0x4a')]({'where':{'id':_0x44c11c[_0xe5dd('0x44')]['id']}})[_0xe5dd('0x26')](handleEntityNotFound(_0x3ef042,null))['then'](function(_0x43dba4){if(_0x43dba4){_0xb562f7=_0x43dba4;_0x3ac8f7[_0xe5dd('0x30')]=_[_0xe5dd('0x32')](db[_0xe5dd('0x4b')][_0xe5dd('0x4c')]);_0x3ac8f7[_0xe5dd('0x31')]=_[_0xe5dd('0x32')](_0x44c11c[_0xe5dd('0x31')]);_0x3ac8f7[_0xe5dd('0x3b')]=_['intersection'](_0x3ac8f7[_0xe5dd('0x30')],_0x3ac8f7['query']);_0x2a42cb[_0xe5dd('0x35')]=_[_0xe5dd('0x33')](_0x3ac8f7[_0xe5dd('0x30')],qs[_0xe5dd('0x34')](_0x44c11c[_0xe5dd('0x31')][_0xe5dd('0x34')]));_0x2a42cb[_0xe5dd('0x35')]=_0x2a42cb[_0xe5dd('0x35')][_0xe5dd('0x4d')]?_0x2a42cb[_0xe5dd('0x35')]:_0x3ac8f7[_0xe5dd('0x30')];_0x2a42cb[_0xe5dd('0x38')]=qs['sort'](_0x44c11c[_0xe5dd('0x31')][_0xe5dd('0x39')]);_0x2a42cb[_0xe5dd('0x3a')]=qs[_0xe5dd('0x3b')](_[_0xe5dd('0x3c')](_0x44c11c['query'],_0x3ac8f7['filters']));if(_0x44c11c[_0xe5dd('0x31')][_0xe5dd('0x3d')]){_0x2a42cb['where']=_[_0xe5dd('0x3e')](_0x2a42cb[_0xe5dd('0x3a')],{'$or':_[_0xe5dd('0x2c')](_0x2a42cb[_0xe5dd('0x35')],function(_0x1b4d47){var _0xe09149={};_0xe09149[_0x1b4d47]={'$like':'%'+_0x44c11c[_0xe5dd('0x31')][_0xe5dd('0x3d')]+'%'};return _0xe09149;})});}_0x2a42cb=_[_0xe5dd('0x3e')]({},_0x2a42cb,_0x44c11c[_0xe5dd('0x45')]);return _0xb562f7[_0xe5dd('0x4e')](_0x2a42cb);}})[_0xe5dd('0x26')](function(_0x4271c3){if(_0x4271c3){_0x64eb6e=_0x4271c3['length'];if(!_0x44c11c[_0xe5dd('0x31')][_0xe5dd('0x36')]('nolimit')){_0x2a42cb['limit']=qs[_0xe5dd('0x20')](_0x44c11c['query'][_0xe5dd('0x20')]);_0x2a42cb[_0xe5dd('0x1d')]=qs[_0xe5dd('0x1d')](_0x44c11c[_0xe5dd('0x31')][_0xe5dd('0x1d')]);}return _0xb562f7['getSubjects'](_0x2a42cb);}})[_0xe5dd('0x26')](function(_0x2f6428){if(_0x2f6428){return _0x2f6428?{'count':_0x64eb6e,'rows':_0x2f6428}:null;}})[_0xe5dd('0x26')](respondWithResult(_0x3ef042,null))[_0xe5dd('0x43')](handleError(_0x3ef042,null));};exports[_0xe5dd('0x4f')]=function(_0x50218c,_0x201c4e,_0x1bb109){var _0x56cb1c={};var _0x39d464={};var _0x1b6b5f;var _0x5ad6cf;return db[_0xe5dd('0x2d')][_0xe5dd('0x4a')]({'where':{'id':_0x50218c[_0xe5dd('0x44')]['id']}})[_0xe5dd('0x26')](handleEntityNotFound(_0x201c4e,null))['then'](function(_0x21e225){if(_0x21e225){_0x1b6b5f=_0x21e225;_0x39d464[_0xe5dd('0x30')]=_[_0xe5dd('0x32')](db[_0xe5dd('0x4b')][_0xe5dd('0x4c')]);_0x39d464[_0xe5dd('0x31')]=_[_0xe5dd('0x32')](_0x50218c[_0xe5dd('0x31')]);_0x39d464['filters']=_[_0xe5dd('0x33')](_0x39d464[_0xe5dd('0x30')],_0x39d464['query']);_0x56cb1c[_0xe5dd('0x35')]=_[_0xe5dd('0x33')](_0x39d464[_0xe5dd('0x30')],qs[_0xe5dd('0x34')](_0x50218c['query']['fields']));_0x56cb1c[_0xe5dd('0x35')]=_0x56cb1c['attributes'][_0xe5dd('0x4d')]?_0x56cb1c[_0xe5dd('0x35')]:_0x39d464[_0xe5dd('0x30')];_0x56cb1c[_0xe5dd('0x38')]=qs[_0xe5dd('0x39')](_0x50218c['query']['sort']);_0x56cb1c[_0xe5dd('0x3a')]=qs['filters'](_['pick'](_0x50218c[_0xe5dd('0x31')],_0x39d464[_0xe5dd('0x3b')]));if(_0x50218c['query'][_0xe5dd('0x3d')]){_0x56cb1c[_0xe5dd('0x3a')]=_[_0xe5dd('0x3e')](_0x56cb1c[_0xe5dd('0x3a')],{'$or':_[_0xe5dd('0x2c')](_0x56cb1c[_0xe5dd('0x35')],function(_0x4beccc){var _0x20d2bc={};_0x20d2bc[_0x4beccc]={'$like':'%'+_0x50218c['query'][_0xe5dd('0x3d')]+'%'};return _0x20d2bc;})});}_0x56cb1c=_['merge']({},_0x56cb1c,_0x50218c[_0xe5dd('0x45')]);return _0x1b6b5f['getDescriptions'](_0x56cb1c);}})[_0xe5dd('0x26')](function(_0x47b144){if(_0x47b144){_0x5ad6cf=_0x47b144['length'];if(!_0x50218c['query'][_0xe5dd('0x36')](_0xe5dd('0x37'))){_0x56cb1c['limit']=qs['limit'](_0x50218c['query']['limit']);_0x56cb1c[_0xe5dd('0x1d')]=qs[_0xe5dd('0x1d')](_0x50218c[_0xe5dd('0x31')][_0xe5dd('0x1d')]);}return _0x1b6b5f[_0xe5dd('0x4f')](_0x56cb1c);}})[_0xe5dd('0x26')](function(_0x5066d0){if(_0x5066d0){return _0x5066d0?{'count':_0x5ad6cf,'rows':_0x5066d0}:null;}})[_0xe5dd('0x26')](respondWithResult(_0x201c4e,null))['catch'](handleError(_0x201c4e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 07bc5ba..6ab9b1d 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 _0xa702=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x7227bc,_0x293459){var _0x591deb=function(_0x35d3fb){while(--_0x35d3fb){_0x7227bc['push'](_0x7227bc['shift']());}};_0x591deb(++_0x293459);}(_0xa702,0x1ae));var _0x2a70=function(_0x33233d,_0x2244fc){_0x33233d=_0x33233d-0x0;var _0x2dded0=_0xa702[_0x33233d];return _0x2dded0;};'use strict';var _=require(_0x2a70('0x0'));var util=require(_0x2a70('0x1'));var logger=require(_0x2a70('0x2'))(_0x2a70('0x3'));var moment=require(_0x2a70('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a70('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x2a70('0x7')]=function(_0x16cdc3,_0x4b2915){return _0x16cdc3['define'](_0x2a70('0x8'),attributes,{'tableName':_0x2a70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab40=['rimraf','../../config/environment','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','bluebird','request-promise','path'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xab40,0xcd));var _0x0ab4=function(_0x324079,_0x1f2841){_0x324079=_0x324079-0x0;var _0x479186=_0xab40[_0x324079];return _0x479186;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0ab4('0x2'));var rp=require(_0x0ab4('0x3'));var fs=require('fs');var path=require(_0x0ab4('0x4'));var rimraf=require(_0x0ab4('0x5'));var config=require(_0x0ab4('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x28b17a,_0x4ba9d2){return _0x28b17a[_0x0ab4('0x7')](_0x0ab4('0x8'),attributes,{'tableName':_0x0ab4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index c6745bc..a71f768 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 _0x553a=['message','result','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','then','info','debug','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x553a,0x192));var _0xa553=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x553a[_0x2650e9];return _0x3511c8;};'use strict';var _=require('lodash');var util=require(_0xa553('0x0'));var moment=require('moment');var BPromise=require(_0xa553('0x1'));var rs=require(_0xa553('0x2'));var fs=require('fs');var Redis=require(_0xa553('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa553('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa553('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18da5d,_0x3da5c7,_0xaae97){return new BPromise(function(_0x48f7d2,_0x25bbb7){return client['request'](_0x18da5d,_0xaae97)[_0xa553('0x6')](function(_0xf6e0db){logger[_0xa553('0x7')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3da5c7,'request\x20sent');logger[_0xa553('0x8')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3da5c7,_0xa553('0x9'),JSON[_0xa553('0xa')](_0xf6e0db));if(_0xf6e0db[_0xa553('0xb')]){if(_0xf6e0db['error'][_0xa553('0xc')]===0x1f4){logger[_0xa553('0xb')](_0xa553('0xd'),_0x3da5c7,_0xf6e0db['error'][_0xa553('0xe')]);return _0x25bbb7(_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3da5c7,_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);return _0x48f7d2(_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);}else{logger['info'](_0xa553('0xd'),_0x3da5c7,'request\x20sent');_0x48f7d2(_0xf6e0db[_0xa553('0xf')]['message']);}})['catch'](function(_0x1d0f4e){logger['error'](_0xa553('0xd'),_0x3da5c7,_0x1d0f4e);_0x25bbb7(_0x1d0f4e);});});} \ No newline at end of file +var _0x444e=['client','http','request','then','request\x20sent','debug','error','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xdbfe11,_0x5cfa1e){var _0x28438d=function(_0x1e2235){while(--_0x1e2235){_0xdbfe11['push'](_0xdbfe11['shift']());}};_0x28438d(++_0x5cfa1e);}(_0x444e,0xe8));var _0xe444=function(_0x73f12e,_0x118e09){_0x73f12e=_0x73f12e-0x0;var _0x3f2d18=_0x444e[_0x73f12e];return _0x3f2d18;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var moment=require(_0xe444('0x1'));var BPromise=require('bluebird');var rs=require(_0xe444('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe444('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe444('0x4'))(_0xe444('0x5'));var config=require(_0xe444('0x6'));var jayson=require(_0xe444('0x7'));var client=jayson[_0xe444('0x8')][_0xe444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4834c7,_0xfbd88b,_0x4b5b7d){return new BPromise(function(_0x29a2b7,_0x482b98){return client[_0xe444('0xa')](_0x4834c7,_0x4b5b7d)[_0xe444('0xb')](function(_0x40a368){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'));logger[_0xe444('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'),JSON['stringify'](_0x40a368));if(_0x40a368['error']){if(_0x40a368[_0xe444('0xe')]['code']===0x1f4){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x482b98(_0x40a368['error']['message']);}logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x29a2b7(_0x40a368['error'][_0xe444('0x10')]);}else{logger[_0xe444('0x11')](_0xe444('0xf'),_0xfbd88b,_0xe444('0xc'));_0x29a2b7(_0x40a368[_0xe444('0x12')][_0xe444('0x10')]);}})[_0xe444('0x13')](function(_0x3e1b57){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x3e1b57);_0x482b98(_0x3e1b57);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 55ec384..c83a186 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 _0x1cb0=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0xb7dcf4,_0x27fcc6){var _0x3cc047=function(_0x58282b){while(--_0x58282b){_0xb7dcf4['push'](_0xb7dcf4['shift']());}};_0x3cc047(++_0x27fcc6);}(_0x1cb0,0xb1));var _0x01cb=function(_0x33dcc4,_0x4078dc){_0x33dcc4=_0x33dcc4-0x0;var _0x352924=_0x1cb0[_0x33dcc4];return _0x352924;};'use strict';var multer=require(_0x01cb('0x0'));var util=require(_0x01cb('0x1'));var path=require(_0x01cb('0x2'));var timeout=require(_0x01cb('0x3'));var express=require(_0x01cb('0x4'));var router=express[_0x01cb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x01cb('0x6'));var interaction=require(_0x01cb('0x7'));var config=require(_0x01cb('0x8'));var controller=require(_0x01cb('0x9'));router['get']('/',auth[_0x01cb('0xa')](),controller[_0x01cb('0xb')]);router[_0x01cb('0xc')](_0x01cb('0xd'),auth[_0x01cb('0xa')](),controller[_0x01cb('0xe')]);router[_0x01cb('0xf')]('/',auth[_0x01cb('0xa')](),controller[_0x01cb('0x10')]);router[_0x01cb('0x11')](_0x01cb('0xd'),auth['isAuthenticated'](),controller[_0x01cb('0x12')]);router[_0x01cb('0x13')](_0x01cb('0xd'),auth['isAuthenticated'](),controller[_0x01cb('0x14')]);module[_0x01cb('0x15')]=router; \ No newline at end of file +var _0xc146=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','path'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xc146,0x96));var _0x6c14=function(_0x502f87,_0x4d208d){_0x502f87=_0x502f87-0x0;var _0xe53eef=_0xc146[_0x502f87];return _0xe53eef;};'use strict';var multer=require(_0x6c14('0x0'));var util=require('util');var path=require(_0x6c14('0x1'));var timeout=require(_0x6c14('0x2'));var express=require(_0x6c14('0x3'));var router=express['Router']();var fs_extra=require(_0x6c14('0x4'));var auth=require(_0x6c14('0x5'));var interaction=require(_0x6c14('0x6'));var config=require(_0x6c14('0x7'));var controller=require('./intServicenowField.controller');router[_0x6c14('0x8')]('/',auth[_0x6c14('0x9')](),controller[_0x6c14('0xa')]);router[_0x6c14('0x8')](_0x6c14('0xb'),auth[_0x6c14('0x9')](),controller[_0x6c14('0xc')]);router[_0x6c14('0xd')]('/',auth[_0x6c14('0x9')](),controller[_0x6c14('0xe')]);router[_0x6c14('0xf')](_0x6c14('0xb'),auth[_0x6c14('0x9')](),controller[_0x6c14('0x10')]);router[_0x6c14('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6c14('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index fc92a98..41d3c8e 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 _0xe300=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xe300,0x15d));var _0x0e30=function(_0x5f4762,_0x931cca){_0x5f4762=_0x5f4762-0x0;var _0x2c939e=_0xe300[_0x5f4762];return _0x2c939e;};'use strict';var Sequelize=require(_0x0e30('0x0'));module[_0x0e30('0x1')]={'type':{'type':Sequelize[_0x0e30('0x2')](_0x0e30('0x3'),_0x0e30('0x4'),_0x0e30('0x5'),_0x0e30('0x6'),'picklist'),'defaultValue':_0x0e30('0x3')},'content':{'type':Sequelize[_0x0e30('0x7')]},'key':{'type':Sequelize[_0x0e30('0x7')]},'keyType':{'type':Sequelize[_0x0e30('0x2')](_0x0e30('0x3'),_0x0e30('0x4'),_0x0e30('0x5'))},'keyContent':{'type':Sequelize[_0x0e30('0x7')]},'idField':{'type':Sequelize[_0x0e30('0x7')]},'nameField':{'type':Sequelize[_0x0e30('0x7')]},'customField':{'type':Sequelize[_0x0e30('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0e30('0x7')]}}; \ No newline at end of file +var _0xa34d=['BOOLEAN','ENUM','variable','picklist','string','customVariable','STRING'];(function(_0x1fb038,_0xc3f69b){var _0x1600dc=function(_0x2a040e){while(--_0x2a040e){_0x1fb038['push'](_0x1fb038['shift']());}};_0x1600dc(++_0xc3f69b);}(_0xa34d,0x7f));var _0xda34=function(_0x1b8d1c,_0x395b3b){_0x1b8d1c=_0x1b8d1c-0x0;var _0x159a0b=_0xa34d[_0x1b8d1c];return _0x159a0b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xda34('0x0')]('string',_0xda34('0x1'),'customVariable','keyValue',_0xda34('0x2')),'defaultValue':_0xda34('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xda34('0x0')](_0xda34('0x3'),_0xda34('0x1'),_0xda34('0x4'))},'keyContent':{'type':Sequelize[_0xda34('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xda34('0x5')]},'customField':{'type':Sequelize[_0xda34('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xda34('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c25f5f5..a050165 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 _0xee9c=['merge','options','ServicenowField','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','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','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','fieldName','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','where','pick','filter','type','VIRTUAL'];(function(_0x4b528b,_0x4926f7){var _0x52418b=function(_0x7fbc20){while(--_0x7fbc20){_0x4b528b['push'](_0x4b528b['shift']());}};_0x52418b(++_0x4926f7);}(_0xee9c,0xaa));var _0xcee9=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0xee9c[_0x25c326];return _0x762452;};'use strict';var emlformat=require(_0xcee9('0x0'));var rimraf=require(_0xcee9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcee9('0x2'));var rp=require(_0xcee9('0x3'));var moment=require(_0xcee9('0x4'));var BPromise=require(_0xcee9('0x5'));var Mustache=require('mustache');var util=require(_0xcee9('0x6'));var path=require(_0xcee9('0x7'));var sox=require(_0xcee9('0x8'));var csv=require(_0xcee9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcee9('0xa'));var _=require(_0xcee9('0xb'));var squel=require(_0xcee9('0xc'));var crypto=require(_0xcee9('0xd'));var jsforce=require(_0xcee9('0xe'));var deskjs=require(_0xcee9('0xf'));var toCsv=require(_0xcee9('0x9'));var querystring=require(_0xcee9('0x10'));var Papa=require(_0xcee9('0x11'));var Redis=require(_0xcee9('0x12'));var authService=require(_0xcee9('0x13'));var qs=require(_0xcee9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcee9('0x15'));var logger=require(_0xcee9('0x16'))('api');var utils=require(_0xcee9('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcee9('0x18'))['db'];function respondWithStatusCode(_0xb96165,_0x3b274b){_0x3b274b=_0x3b274b||0xcc;return function(_0x2f3d1e){if(_0x2f3d1e){return _0xb96165[_0xcee9('0x19')](_0x3b274b);}return _0xb96165[_0xcee9('0x1a')](_0x3b274b)[_0xcee9('0x1b')]();};}function respondWithResult(_0x3bfc5a,_0x516d83){_0x516d83=_0x516d83||0xc8;return function(_0x57fad2){if(_0x57fad2){return _0x3bfc5a[_0xcee9('0x1a')](_0x516d83)[_0xcee9('0x1c')](_0x57fad2);}};}function respondWithFilteredResult(_0x41bfe3,_0x371709){return function(_0x5abadd){if(_0x5abadd){var _0x501d7=typeof _0x371709[_0xcee9('0x1d')]===_0xcee9('0x1e')&&typeof _0x371709['limit']===_0xcee9('0x1e');var _0x3d99cb=_0x5abadd[_0xcee9('0x1f')];var _0x3e9df1=_0x501d7?0x0:_0x371709[_0xcee9('0x1d')];var _0x43ab6b=_0x501d7?_0x5abadd[_0xcee9('0x1f')]:_0x371709[_0xcee9('0x1d')]+_0x371709['limit'];var _0x3ce312;if(_0x43ab6b>=_0x3d99cb){_0x43ab6b=_0x3d99cb;_0x3ce312=0xc8;}else{_0x3ce312=0xce;}_0x41bfe3[_0xcee9('0x1a')](_0x3ce312);return _0x41bfe3[_0xcee9('0x20')](_0xcee9('0x21'),_0x3e9df1+'-'+_0x43ab6b+'/'+_0x3d99cb)['json'](_0x5abadd);}return null;};}function patchUpdates(_0x49437b){return function(_0xf1dd49){try{jsonpatch[_0xcee9('0x22')](_0xf1dd49,_0x49437b,!![]);}catch(_0x37fcce){return BPromise['reject'](_0x37fcce);}return _0xf1dd49[_0xcee9('0x23')]();};}function saveUpdates(_0x3630d3,_0xf6fdea){return function(_0x5b6cea){if(_0x5b6cea){return _0x5b6cea[_0xcee9('0x24')](_0x3630d3)[_0xcee9('0x25')](function(_0x2cf643){return _0x2cf643;});}return null;};}function removeEntity(_0x392c2e,_0x163db7){return function(_0xb33691){if(_0xb33691){return _0xb33691[_0xcee9('0x26')]()[_0xcee9('0x25')](function(){_0x392c2e[_0xcee9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e0d96,_0x501a4a){return function(_0x1b653b){if(!_0x1b653b){_0x3e0d96[_0xcee9('0x19')](0x194);}return _0x1b653b;};}function handleError(_0x16c08e,_0x576cf6){_0x576cf6=_0x576cf6||0x1f4;return function(_0x5a4328){logger['error'](_0x5a4328[_0xcee9('0x27')]);if(_0x5a4328[_0xcee9('0x28')]){delete _0x5a4328['name'];}_0x16c08e[_0xcee9('0x1a')](_0x576cf6)[_0xcee9('0x29')](_0x5a4328);};}exports[_0xcee9('0x2a')]=function(_0x576a4f,_0x132494){var _0x10aeda={},_0x2fd3e2={},_0x519a6b={'count':0x0,'rows':[]};var _0x2333bc=_['map'](db['ServicenowField']['rawAttributes'],function(_0x277722){return{'name':_0x277722[_0xcee9('0x2b')],'type':_0x277722['type'][_0xcee9('0x2c')]};});_0x2fd3e2[_0xcee9('0x2d')]=_[_0xcee9('0x2e')](_0x2333bc,_0xcee9('0x28'));_0x2fd3e2[_0xcee9('0x2f')]=_['keys'](_0x576a4f[_0xcee9('0x2f')]);_0x2fd3e2[_0xcee9('0x30')]=_['intersection'](_0x2fd3e2[_0xcee9('0x2d')],_0x2fd3e2[_0xcee9('0x2f')]);_0x10aeda['attributes']=_[_0xcee9('0x31')](_0x2fd3e2[_0xcee9('0x2d')],qs['fields'](_0x576a4f['query'][_0xcee9('0x32')]));_0x10aeda[_0xcee9('0x33')]=_0x10aeda[_0xcee9('0x33')]['length']?_0x10aeda[_0xcee9('0x33')]:_0x2fd3e2[_0xcee9('0x2d')];if(!_0x576a4f['query'][_0xcee9('0x34')](_0xcee9('0x35'))){_0x10aeda['limit']=qs['limit'](_0x576a4f[_0xcee9('0x2f')][_0xcee9('0x36')]);_0x10aeda[_0xcee9('0x1d')]=qs['offset'](_0x576a4f[_0xcee9('0x2f')]['offset']);}_0x10aeda[_0xcee9('0x37')]=qs['sort'](_0x576a4f[_0xcee9('0x2f')]['sort']);_0x10aeda[_0xcee9('0x38')]=qs[_0xcee9('0x30')](_[_0xcee9('0x39')](_0x576a4f[_0xcee9('0x2f')],_0x2fd3e2[_0xcee9('0x30')]),_0x2333bc);if(_0x576a4f[_0xcee9('0x2f')][_0xcee9('0x3a')]){_0x10aeda[_0xcee9('0x38')]=_['merge'](_0x10aeda[_0xcee9('0x38')],{'$or':_[_0xcee9('0x2e')](_0x2333bc,function(_0x3bfc0d){if(_0x3bfc0d[_0xcee9('0x3b')]!==_0xcee9('0x3c')){var _0x5f5d7e={};_0x5f5d7e[_0x3bfc0d[_0xcee9('0x28')]]={'$like':'%'+_0x576a4f[_0xcee9('0x2f')][_0xcee9('0x3a')]+'%'};return _0x5f5d7e;}})});}_0x10aeda=_[_0xcee9('0x3d')]({},_0x10aeda,_0x576a4f[_0xcee9('0x3e')]);var _0x4546e2={'where':_0x10aeda['where']};return db[_0xcee9('0x3f')][_0xcee9('0x1f')](_0x4546e2)[_0xcee9('0x25')](function(_0x3f9d7d){_0x519a6b[_0xcee9('0x1f')]=_0x3f9d7d;if(_0x576a4f[_0xcee9('0x2f')][_0xcee9('0x40')]){_0x10aeda[_0xcee9('0x41')]=[{'all':!![]}];}return db['ServicenowField'][_0xcee9('0x42')](_0x10aeda);})[_0xcee9('0x25')](function(_0x5b5c3e){_0x519a6b[_0xcee9('0x43')]=_0x5b5c3e;return _0x519a6b;})[_0xcee9('0x25')](respondWithFilteredResult(_0x132494,_0x10aeda))[_0xcee9('0x44')](handleError(_0x132494,null));};exports[_0xcee9('0x45')]=function(_0x4caef6,_0x8a8f25){var _0x163a24={'raw':!![],'where':{'id':_0x4caef6[_0xcee9('0x46')]['id']}},_0x4ad9db={};_0x4ad9db[_0xcee9('0x2d')]=_[_0xcee9('0x47')](db['ServicenowField'][_0xcee9('0x48')]);_0x4ad9db['query']=_[_0xcee9('0x47')](_0x4caef6['query']);_0x4ad9db[_0xcee9('0x30')]=_[_0xcee9('0x31')](_0x4ad9db[_0xcee9('0x2d')],_0x4ad9db['query']);_0x163a24[_0xcee9('0x33')]=_[_0xcee9('0x31')](_0x4ad9db[_0xcee9('0x2d')],qs[_0xcee9('0x32')](_0x4caef6['query']['fields']));_0x163a24[_0xcee9('0x33')]=_0x163a24[_0xcee9('0x33')][_0xcee9('0x49')]?_0x163a24[_0xcee9('0x33')]:_0x4ad9db[_0xcee9('0x2d')];if(_0x4caef6['query'][_0xcee9('0x40')]){_0x163a24[_0xcee9('0x41')]=[{'all':!![]}];}_0x163a24=_[_0xcee9('0x3d')]({},_0x163a24,_0x4caef6['options']);return db[_0xcee9('0x3f')]['find'](_0x163a24)[_0xcee9('0x25')](handleEntityNotFound(_0x8a8f25,null))[_0xcee9('0x25')](respondWithResult(_0x8a8f25,null))['catch'](handleError(_0x8a8f25,null));};exports[_0xcee9('0x4a')]=function(_0x488b19,_0x47389d){return db[_0xcee9('0x3f')]['create'](_0x488b19[_0xcee9('0x4b')],{})[_0xcee9('0x25')](respondWithResult(_0x47389d,0xc9))[_0xcee9('0x44')](handleError(_0x47389d,null));};exports[_0xcee9('0x24')]=function(_0x310184,_0x13734f){if(_0x310184[_0xcee9('0x4b')]['id']){delete _0x310184[_0xcee9('0x4b')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x310184['params']['id']}})[_0xcee9('0x25')](handleEntityNotFound(_0x13734f,null))['then'](saveUpdates(_0x310184[_0xcee9('0x4b')],null))[_0xcee9('0x25')](respondWithResult(_0x13734f,null))[_0xcee9('0x44')](handleError(_0x13734f,null));};exports[_0xcee9('0x26')]=function(_0x245602,_0x16d689){return db[_0xcee9('0x3f')][_0xcee9('0x4c')]({'where':{'id':_0x245602[_0xcee9('0x46')]['id']}})[_0xcee9('0x25')](handleEntityNotFound(_0x16d689,null))[_0xcee9('0x25')](removeEntity(_0x16d689,null))['catch'](handleError(_0x16d689,null));}; \ No newline at end of file +var _0x228a=['key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','create','body','find','destroy','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type'];(function(_0x2a64ab,_0x589ac){var _0x3eb56a=function(_0x3434f9){while(--_0x3434f9){_0x2a64ab['push'](_0x2a64ab['shift']());}};_0x3eb56a(++_0x589ac);}(_0x228a,0x65));var _0xa228=function(_0x3db0d8,_0x4ede3c){_0x3db0d8=_0x3db0d8-0x0;var _0x227491=_0x228a[_0x3db0d8];return _0x227491;};'use strict';var emlformat=require(_0xa228('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa228('0x1'));var jsonpatch=require(_0xa228('0x2'));var rp=require(_0xa228('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa228('0x4'));var util=require(_0xa228('0x5'));var path=require('path');var sox=require(_0xa228('0x6'));var csv=require(_0xa228('0x7'));var ejs=require(_0xa228('0x8'));var fs=require('fs');var fs_extra=require(_0xa228('0x9'));var _=require('lodash');var squel=require(_0xa228('0xa'));var crypto=require(_0xa228('0xb'));var jsforce=require(_0xa228('0xc'));var deskjs=require(_0xa228('0xd'));var toCsv=require(_0xa228('0x7'));var querystring=require(_0xa228('0xe'));var Papa=require(_0xa228('0xf'));var Redis=require(_0xa228('0x10'));var authService=require(_0xa228('0x11'));var qs=require(_0xa228('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa228('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa228('0x14'));var config=require(_0xa228('0x15'));var licenseUtil=require(_0xa228('0x16'));var db=require(_0xa228('0x17'))['db'];function respondWithStatusCode(_0xf86e2f,_0x50346b){_0x50346b=_0x50346b||0xcc;return function(_0x2bc90e){if(_0x2bc90e){return _0xf86e2f[_0xa228('0x18')](_0x50346b);}return _0xf86e2f['status'](_0x50346b)[_0xa228('0x19')]();};}function respondWithResult(_0x2a7dc7,_0x23bacd){_0x23bacd=_0x23bacd||0xc8;return function(_0x4acdb7){if(_0x4acdb7){return _0x2a7dc7[_0xa228('0x1a')](_0x23bacd)[_0xa228('0x1b')](_0x4acdb7);}};}function respondWithFilteredResult(_0x23e6cd,_0x407af0){return function(_0x4a6e52){if(_0x4a6e52){var _0x9ab4cc=typeof _0x407af0[_0xa228('0x1c')]===_0xa228('0x1d')&&typeof _0x407af0[_0xa228('0x1e')]==='undefined';var _0x59009e=_0x4a6e52['count'];var _0x27d004=_0x9ab4cc?0x0:_0x407af0[_0xa228('0x1c')];var _0x5c966d=_0x9ab4cc?_0x4a6e52[_0xa228('0x1f')]:_0x407af0[_0xa228('0x1c')]+_0x407af0[_0xa228('0x1e')];var _0x2a7d85;if(_0x5c966d>=_0x59009e){_0x5c966d=_0x59009e;_0x2a7d85=0xc8;}else{_0x2a7d85=0xce;}_0x23e6cd['status'](_0x2a7d85);return _0x23e6cd[_0xa228('0x20')](_0xa228('0x21'),_0x27d004+'-'+_0x5c966d+'/'+_0x59009e)[_0xa228('0x1b')](_0x4a6e52);}return null;};}function patchUpdates(_0x43e41b){return function(_0x5c835e){try{jsonpatch[_0xa228('0x22')](_0x5c835e,_0x43e41b,!![]);}catch(_0x13c043){return BPromise['reject'](_0x13c043);}return _0x5c835e[_0xa228('0x23')]();};}function saveUpdates(_0x508c76,_0x2edf9f){return function(_0x5b5b88){if(_0x5b5b88){return _0x5b5b88[_0xa228('0x24')](_0x508c76)['then'](function(_0x1c6c79){return _0x1c6c79;});}return null;};}function removeEntity(_0xea211e,_0x568094){return function(_0x27c08b){if(_0x27c08b){return _0x27c08b['destroy']()[_0xa228('0x25')](function(){_0xea211e[_0xa228('0x1a')](0xcc)[_0xa228('0x19')]();});}};}function handleEntityNotFound(_0x160ea1,_0x418c83){return function(_0x2c6fea){if(!_0x2c6fea){_0x160ea1[_0xa228('0x18')](0x194);}return _0x2c6fea;};}function handleError(_0x4b4b1b,_0x156cd9){_0x156cd9=_0x156cd9||0x1f4;return function(_0x3b0b82){logger[_0xa228('0x26')](_0x3b0b82['stack']);if(_0x3b0b82[_0xa228('0x27')]){delete _0x3b0b82[_0xa228('0x27')];}_0x4b4b1b['status'](_0x156cd9)[_0xa228('0x28')](_0x3b0b82);};}exports[_0xa228('0x29')]=function(_0x73478b,_0x56e3f9){var _0x2f5099={},_0x54c5c5={},_0x4bb2ff={'count':0x0,'rows':[]};var _0x5730a8=_[_0xa228('0x2a')](db[_0xa228('0x2b')][_0xa228('0x2c')],function(_0x3117cd){return{'name':_0x3117cd[_0xa228('0x2d')],'type':_0x3117cd[_0xa228('0x2e')][_0xa228('0x2f')]};});_0x54c5c5[_0xa228('0x30')]=_['map'](_0x5730a8,_0xa228('0x27'));_0x54c5c5[_0xa228('0x31')]=_[_0xa228('0x32')](_0x73478b[_0xa228('0x31')]);_0x54c5c5[_0xa228('0x33')]=_[_0xa228('0x34')](_0x54c5c5[_0xa228('0x30')],_0x54c5c5['query']);_0x2f5099['attributes']=_[_0xa228('0x34')](_0x54c5c5[_0xa228('0x30')],qs[_0xa228('0x35')](_0x73478b[_0xa228('0x31')][_0xa228('0x35')]));_0x2f5099['attributes']=_0x2f5099[_0xa228('0x36')]['length']?_0x2f5099[_0xa228('0x36')]:_0x54c5c5[_0xa228('0x30')];if(!_0x73478b[_0xa228('0x31')]['hasOwnProperty'](_0xa228('0x37'))){_0x2f5099[_0xa228('0x1e')]=qs['limit'](_0x73478b[_0xa228('0x31')][_0xa228('0x1e')]);_0x2f5099[_0xa228('0x1c')]=qs[_0xa228('0x1c')](_0x73478b['query']['offset']);}_0x2f5099[_0xa228('0x38')]=qs[_0xa228('0x39')](_0x73478b[_0xa228('0x31')][_0xa228('0x39')]);_0x2f5099[_0xa228('0x3a')]=qs['filters'](_[_0xa228('0x3b')](_0x73478b[_0xa228('0x31')],_0x54c5c5[_0xa228('0x33')]),_0x5730a8);if(_0x73478b[_0xa228('0x31')][_0xa228('0x3c')]){_0x2f5099['where']=_[_0xa228('0x3d')](_0x2f5099[_0xa228('0x3a')],{'$or':_['map'](_0x5730a8,function(_0x417649){if(_0x417649[_0xa228('0x2e')]!=='VIRTUAL'){var _0x1d918e={};_0x1d918e[_0x417649[_0xa228('0x27')]]={'$like':'%'+_0x73478b[_0xa228('0x31')]['filter']+'%'};return _0x1d918e;}})});}_0x2f5099=_['merge']({},_0x2f5099,_0x73478b[_0xa228('0x3e')]);var _0x300e53={'where':_0x2f5099['where']};return db[_0xa228('0x2b')][_0xa228('0x1f')](_0x300e53)[_0xa228('0x25')](function(_0x196757){_0x4bb2ff[_0xa228('0x1f')]=_0x196757;if(_0x73478b[_0xa228('0x31')][_0xa228('0x3f')]){_0x2f5099['include']=[{'all':!![]}];}return db[_0xa228('0x2b')][_0xa228('0x40')](_0x2f5099);})['then'](function(_0xd78162){_0x4bb2ff[_0xa228('0x41')]=_0xd78162;return _0x4bb2ff;})[_0xa228('0x25')](respondWithFilteredResult(_0x56e3f9,_0x2f5099))[_0xa228('0x42')](handleError(_0x56e3f9,null));};exports[_0xa228('0x43')]=function(_0x25eccd,_0x296782){var _0x42eecd={'raw':!![],'where':{'id':_0x25eccd['params']['id']}},_0x4d39aa={};_0x4d39aa[_0xa228('0x30')]=_[_0xa228('0x32')](db[_0xa228('0x2b')][_0xa228('0x2c')]);_0x4d39aa[_0xa228('0x31')]=_[_0xa228('0x32')](_0x25eccd[_0xa228('0x31')]);_0x4d39aa[_0xa228('0x33')]=_[_0xa228('0x34')](_0x4d39aa[_0xa228('0x30')],_0x4d39aa[_0xa228('0x31')]);_0x42eecd['attributes']=_[_0xa228('0x34')](_0x4d39aa[_0xa228('0x30')],qs[_0xa228('0x35')](_0x25eccd['query'][_0xa228('0x35')]));_0x42eecd[_0xa228('0x36')]=_0x42eecd[_0xa228('0x36')]['length']?_0x42eecd[_0xa228('0x36')]:_0x4d39aa['model'];if(_0x25eccd[_0xa228('0x31')]['includeAll']){_0x42eecd[_0xa228('0x44')]=[{'all':!![]}];}_0x42eecd=_['merge']({},_0x42eecd,_0x25eccd[_0xa228('0x3e')]);return db[_0xa228('0x2b')]['find'](_0x42eecd)[_0xa228('0x25')](handleEntityNotFound(_0x296782,null))['then'](respondWithResult(_0x296782,null))[_0xa228('0x42')](handleError(_0x296782,null));};exports[_0xa228('0x45')]=function(_0xb21fe7,_0xc6550c){return db[_0xa228('0x2b')][_0xa228('0x45')](_0xb21fe7[_0xa228('0x46')],{})[_0xa228('0x25')](respondWithResult(_0xc6550c,0xc9))[_0xa228('0x42')](handleError(_0xc6550c,null));};exports[_0xa228('0x24')]=function(_0x21aedb,_0x2e9bcb){if(_0x21aedb[_0xa228('0x46')]['id']){delete _0x21aedb[_0xa228('0x46')]['id'];}return db[_0xa228('0x2b')][_0xa228('0x47')]({'where':{'id':_0x21aedb['params']['id']}})[_0xa228('0x25')](handleEntityNotFound(_0x2e9bcb,null))['then'](saveUpdates(_0x21aedb[_0xa228('0x46')],null))[_0xa228('0x25')](respondWithResult(_0x2e9bcb,null))[_0xa228('0x42')](handleError(_0x2e9bcb,null));};exports[_0xa228('0x48')]=function(_0x2bc153,_0x11f262){return db[_0xa228('0x2b')][_0xa228('0x47')]({'where':{'id':_0x2bc153[_0xa228('0x49')]['id']}})[_0xa228('0x25')](handleEntityNotFound(_0x11f262,null))['then'](removeEntity(_0x11f262,null))[_0xa228('0x42')](handleError(_0x11f262,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7edcafa..d7aa29e 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 _0x20af=['bluebird','path','rimraf','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x19097c,_0x27b065){var _0x4013cf=function(_0x5e9699){while(--_0x5e9699){_0x19097c['push'](_0x19097c['shift']());}};_0x4013cf(++_0x27b065);}(_0x20af,0x99));var _0xf20a=function(_0x41b378,_0xe15e7d){_0x41b378=_0x41b378-0x0;var _0x5d94bd=_0x20af[_0x41b378];return _0x5d94bd;};'use strict';var _=require(_0xf20a('0x0'));var util=require(_0xf20a('0x1'));var logger=require(_0xf20a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf20a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf20a('0x4'));var rimraf=require(_0xf20a('0x5'));var config=require('../../config/environment');var attributes=require(_0xf20a('0x6'));module[_0xf20a('0x7')]=function(_0x4730f5,_0x1625c3){return _0x4730f5[_0xf20a('0x8')]('ServicenowField',attributes,{'tableName':_0xf20a('0x9'),'paranoid':![],'indexes':[{'name':_0xf20a('0xa'),'fields':[_0xf20a('0xb'),_0xf20a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4dfa=['./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5b25af,_0x121dd7){var _0x181a07=function(_0x2462e1){while(--_0x2462e1){_0x5b25af['push'](_0x5b25af['shift']());}};_0x181a07(++_0x121dd7);}(_0x4dfa,0x7a));var _0xa4df=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4dfa[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xa4df('0x0'));var util=require(_0xa4df('0x1'));var logger=require('../../config/logger')(_0xa4df('0x2'));var moment=require(_0xa4df('0x3'));var BPromise=require(_0xa4df('0x4'));var rp=require(_0xa4df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4df('0x6'));var config=require(_0xa4df('0x7'));var attributes=require(_0xa4df('0x8'));module[_0xa4df('0x9')]=function(_0xb37745,_0x42dbc6){return _0xb37745[_0xa4df('0xa')](_0xa4df('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xa4df('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 7fef669..c934893 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 _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x360b23,_0x3e1b4e){var _0x14aced=function(_0x2c7b1b){while(--_0x2c7b1b){_0x360b23['push'](_0x360b23['shift']());}};_0x14aced(++_0x3e1b4e);}(_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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +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(_0x368178,_0x2d5678){var _0x10a228=function(_0x130364){while(--_0x130364){_0x368178['push'](_0x368178['shift']());}};_0x10a228(++_0x2d5678);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1a101a,_0x5c787b){_0x1a101a=_0x1a101a-0x0;var _0x4f6d1d=_0xf4eb[_0x1a101a];return _0x4f6d1d;};'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 diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index aa4882e..56966d7 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(_0x4c09d8,_0x396187){var _0x408de9=function(_0x1803ec){while(--_0x1803ec){_0x4c09d8['push'](_0x4c09d8['shift']());}};_0x408de9(++_0x396187);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x28c938,_0x5624b4){var _0x2a97b2=function(_0x17f959){while(--_0x17f959){_0x28c938['push'](_0x28c938['shift']());}};_0x2a97b2(++_0x5624b4);}(_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/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 9aa0f5f..a719c81 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(_0xc1fb80,_0x317905){var _0x41fc88=function(_0x25ba90){while(--_0x25ba90){_0xc1fb80['push'](_0xc1fb80['shift']());}};_0x41fc88(++_0x317905);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x121f92,_0x564112){var _0x4b2dc1=function(_0xe6ff7){while(--_0xe6ff7){_0x121f92['push'](_0x121f92['shift']());}};_0x4b2dc1(++_0x564112);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 c85a56a..5475578 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 _0x1852=['getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','sendStatus','error','name','send','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','VIRTUAL','filter','merge','options','SugarcrmAccount','include','findAll','catch','keys','includeAll','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','SugarcrmField','created_by','description','date_start','duration_hours','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','Invalid\x20Login','Password\x20Expired','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','test'];(function(_0xbc3ba,_0x5ecfd0){var _0x20514f=function(_0x130ac8){while(--_0x130ac8){_0xbc3ba['push'](_0xbc3ba['shift']());}};_0x20514f(++_0x5ecfd0);}(_0x1852,0xea));var _0x2185=function(_0x2e8710,_0x2804e4){_0x2e8710=_0x2e8710-0x0;var _0x2a58d1=_0x1852[_0x2e8710];return _0x2a58d1;};'use strict';var emlformat=require(_0x2185('0x0'));var rimraf=require(_0x2185('0x1'));var zipdir=require(_0x2185('0x2'));var jsonpatch=require(_0x2185('0x3'));var rp=require('request-promise');var moment=require(_0x2185('0x4'));var BPromise=require(_0x2185('0x5'));var Mustache=require(_0x2185('0x6'));var util=require(_0x2185('0x7'));var path=require(_0x2185('0x8'));var sox=require(_0x2185('0x9'));var csv=require(_0x2185('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2185('0xb'));var squel=require(_0x2185('0xc'));var crypto=require(_0x2185('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2185('0xa'));var querystring=require('querystring');var Papa=require(_0x2185('0xe'));var Redis=require(_0x2185('0xf'));var authService=require(_0x2185('0x10'));var qs=require(_0x2185('0x11'));var as=require(_0x2185('0x12'));var hardwareService=require(_0x2185('0x13'));var logger=require(_0x2185('0x14'))('api');var utils=require(_0x2185('0x15'));var config=require(_0x2185('0x16'));var licenseUtil=require(_0x2185('0x17'));var db=require(_0x2185('0x18'))['db'];var integrations=require(_0x2185('0x19'));function respondWithStatusCode(_0x94832d,_0xda1c2f){_0xda1c2f=_0xda1c2f||0xcc;return function(_0x1abfd6){if(_0x1abfd6){return _0x94832d['sendStatus'](_0xda1c2f);}return _0x94832d[_0x2185('0x1a')](_0xda1c2f)[_0x2185('0x1b')]();};}function respondWithResult(_0x10a403,_0x262561){_0x262561=_0x262561||0xc8;return function(_0x508fdd){if(_0x508fdd){return _0x10a403[_0x2185('0x1a')](_0x262561)[_0x2185('0x1c')](_0x508fdd);}};}function respondWithFilteredResult(_0x38c836,_0x17f223){return function(_0x5539a7){if(_0x5539a7){var _0xe28e05=typeof _0x17f223[_0x2185('0x1d')]===_0x2185('0x1e')&&typeof _0x17f223[_0x2185('0x1f')]==='undefined';var _0x404012=_0x5539a7[_0x2185('0x20')];var _0x4a0330=_0xe28e05?0x0:_0x17f223[_0x2185('0x1d')];var _0xe91dbc=_0xe28e05?_0x5539a7[_0x2185('0x20')]:_0x17f223[_0x2185('0x1d')]+_0x17f223['limit'];var _0x474bc6;if(_0xe91dbc>=_0x404012){_0xe91dbc=_0x404012;_0x474bc6=0xc8;}else{_0x474bc6=0xce;}_0x38c836[_0x2185('0x1a')](_0x474bc6);return _0x38c836[_0x2185('0x21')](_0x2185('0x22'),_0x4a0330+'-'+_0xe91dbc+'/'+_0x404012)[_0x2185('0x1c')](_0x5539a7);}return null;};}function patchUpdates(_0x2daab5){return function(_0x2f02c1){try{jsonpatch['apply'](_0x2f02c1,_0x2daab5,!![]);}catch(_0x261a92){return BPromise['reject'](_0x261a92);}return _0x2f02c1[_0x2185('0x23')]();};}function saveUpdates(_0x5d7e37,_0x596fd7){return function(_0xd8f57c){if(_0xd8f57c){return _0xd8f57c[_0x2185('0x24')](_0x5d7e37)['then'](function(_0x3d699a){return _0x3d699a;});}return null;};}function removeEntity(_0x598327,_0x4dba89){return function(_0x19185a){if(_0x19185a){return _0x19185a[_0x2185('0x25')]()[_0x2185('0x26')](function(){_0x598327[_0x2185('0x1a')](0xcc)[_0x2185('0x1b')]();});}};}function handleEntityNotFound(_0x238bb6,_0x51c17a){return function(_0x172030){if(!_0x172030){_0x238bb6[_0x2185('0x27')](0x194);}return _0x172030;};}function handleError(_0x2f282b,_0x144a17){_0x144a17=_0x144a17||0x1f4;return function(_0x5b676a){logger[_0x2185('0x28')](_0x5b676a['stack']);if(_0x5b676a[_0x2185('0x29')]){delete _0x5b676a[_0x2185('0x29')];}_0x2f282b['status'](_0x144a17)[_0x2185('0x2a')](_0x5b676a);};}exports['index']=function(_0x41fa15,_0x49e73c){var _0x11d65e={},_0x352b5e={},_0x2ad9c1={'count':0x0,'rows':[]};var _0x302c60=_[_0x2185('0x2b')](db['SugarcrmAccount'][_0x2185('0x2c')],function(_0x5ef4b0){return{'name':_0x5ef4b0[_0x2185('0x2d')],'type':_0x5ef4b0['type']['key']};});_0x352b5e[_0x2185('0x2e')]=_[_0x2185('0x2b')](_0x302c60,_0x2185('0x29'));_0x352b5e[_0x2185('0x2f')]=_['keys'](_0x41fa15[_0x2185('0x2f')]);_0x352b5e[_0x2185('0x30')]=_[_0x2185('0x31')](_0x352b5e['model'],_0x352b5e[_0x2185('0x2f')]);_0x11d65e[_0x2185('0x32')]=_['intersection'](_0x352b5e[_0x2185('0x2e')],qs[_0x2185('0x33')](_0x41fa15[_0x2185('0x2f')][_0x2185('0x33')]));_0x11d65e[_0x2185('0x32')]=_0x11d65e[_0x2185('0x32')][_0x2185('0x34')]?_0x11d65e['attributes']:_0x352b5e[_0x2185('0x2e')];if(!_0x41fa15['query']['hasOwnProperty']('nolimit')){_0x11d65e[_0x2185('0x1f')]=qs[_0x2185('0x1f')](_0x41fa15[_0x2185('0x2f')][_0x2185('0x1f')]);_0x11d65e['offset']=qs[_0x2185('0x1d')](_0x41fa15[_0x2185('0x2f')]['offset']);}_0x11d65e[_0x2185('0x35')]=qs[_0x2185('0x36')](_0x41fa15[_0x2185('0x2f')]['sort']);_0x11d65e[_0x2185('0x37')]=qs[_0x2185('0x30')](_[_0x2185('0x38')](_0x41fa15['query'],_0x352b5e[_0x2185('0x30')]),_0x302c60);if(_0x41fa15[_0x2185('0x2f')]['filter']){_0x11d65e[_0x2185('0x37')]=_['merge'](_0x11d65e[_0x2185('0x37')],{'$or':_[_0x2185('0x2b')](_0x302c60,function(_0x22c4fb){if(_0x22c4fb['type']!==_0x2185('0x39')){var _0x3bb7cd={};_0x3bb7cd[_0x22c4fb['name']]={'$like':'%'+_0x41fa15[_0x2185('0x2f')][_0x2185('0x3a')]+'%'};return _0x3bb7cd;}})});}_0x11d65e=_[_0x2185('0x3b')]({},_0x11d65e,_0x41fa15[_0x2185('0x3c')]);var _0x4d4c3f={'where':_0x11d65e[_0x2185('0x37')]};return db[_0x2185('0x3d')][_0x2185('0x20')](_0x4d4c3f)[_0x2185('0x26')](function(_0x190d60){_0x2ad9c1['count']=_0x190d60;if(_0x41fa15[_0x2185('0x2f')]['includeAll']){_0x11d65e[_0x2185('0x3e')]=[{'all':!![]}];}return db[_0x2185('0x3d')][_0x2185('0x3f')](_0x11d65e);})['then'](function(_0x1e99ea){_0x2ad9c1['rows']=_0x1e99ea;return _0x2ad9c1;})[_0x2185('0x26')](respondWithFilteredResult(_0x49e73c,_0x11d65e))[_0x2185('0x40')](handleError(_0x49e73c,null));};exports['show']=function(_0x41091a,_0x1dee5b){var _0x4eead4={'raw':![],'where':{'id':_0x41091a['params']['id']}},_0x465652={};_0x465652['model']=_[_0x2185('0x41')](db['SugarcrmAccount'][_0x2185('0x2c')]);_0x465652[_0x2185('0x2f')]=_[_0x2185('0x41')](_0x41091a[_0x2185('0x2f')]);_0x465652[_0x2185('0x30')]=_['intersection'](_0x465652[_0x2185('0x2e')],_0x465652[_0x2185('0x2f')]);_0x4eead4['attributes']=_[_0x2185('0x31')](_0x465652['model'],qs[_0x2185('0x33')](_0x41091a[_0x2185('0x2f')][_0x2185('0x33')]));_0x4eead4[_0x2185('0x32')]=_0x4eead4['attributes'][_0x2185('0x34')]?_0x4eead4[_0x2185('0x32')]:_0x465652[_0x2185('0x2e')];if(_0x41091a[_0x2185('0x2f')][_0x2185('0x42')]){_0x4eead4[_0x2185('0x3e')]=[{'all':!![]}];}_0x4eead4=_[_0x2185('0x3b')]({},_0x4eead4,_0x41091a[_0x2185('0x3c')]);return db[_0x2185('0x3d')][_0x2185('0x43')](_0x4eead4)['then'](handleEntityNotFound(_0x1dee5b,null))[_0x2185('0x26')](respondWithResult(_0x1dee5b,null))['catch'](handleError(_0x1dee5b,null));};exports[_0x2185('0x44')]=function(_0x1c008e,_0x3e289d){return db[_0x2185('0x3d')][_0x2185('0x44')](_0x1c008e['body'],{})[_0x2185('0x26')](respondWithResult(_0x3e289d,0xc9))['catch'](handleError(_0x3e289d,null));};exports[_0x2185('0x24')]=function(_0x4d3738,_0x52726e){if(_0x4d3738['body']['id']){delete _0x4d3738[_0x2185('0x45')]['id'];}return db[_0x2185('0x3d')][_0x2185('0x43')]({'where':{'id':_0x4d3738[_0x2185('0x46')]['id']}})[_0x2185('0x26')](handleEntityNotFound(_0x52726e,null))[_0x2185('0x26')](saveUpdates(_0x4d3738[_0x2185('0x45')],null))[_0x2185('0x26')](respondWithResult(_0x52726e,null))['catch'](handleError(_0x52726e,null));};exports[_0x2185('0x25')]=function(_0x5bc451,_0x2a2920){return db['SugarcrmAccount'][_0x2185('0x43')]({'where':{'id':_0x5bc451['params']['id']}})['then'](handleEntityNotFound(_0x2a2920,null))[_0x2185('0x26')](removeEntity(_0x2a2920,null))[_0x2185('0x40')](handleError(_0x2a2920,null));};exports[_0x2185('0x47')]=function(_0xcb636d,_0x2c35b1,_0x308c2c){var _0x4e4352={};var _0xe2b5e8={};var _0x284e46;var _0x562d43;return db['SugarcrmAccount'][_0x2185('0x48')]({'where':{'id':_0xcb636d[_0x2185('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c35b1,null))[_0x2185('0x26')](function(_0x16bfef){if(_0x16bfef){_0x284e46=_0x16bfef;_0xe2b5e8[_0x2185('0x2e')]=_[_0x2185('0x41')](db[_0x2185('0x49')][_0x2185('0x2c')]);_0xe2b5e8[_0x2185('0x2f')]=_['keys'](_0xcb636d['query']);_0xe2b5e8[_0x2185('0x30')]=_[_0x2185('0x31')](_0xe2b5e8[_0x2185('0x2e')],_0xe2b5e8[_0x2185('0x2f')]);_0x4e4352['attributes']=_[_0x2185('0x31')](_0xe2b5e8[_0x2185('0x2e')],qs[_0x2185('0x33')](_0xcb636d['query'][_0x2185('0x33')]));_0x4e4352[_0x2185('0x32')]=_0x4e4352[_0x2185('0x32')][_0x2185('0x34')]?_0x4e4352[_0x2185('0x32')]:_0xe2b5e8['model'];_0x4e4352[_0x2185('0x35')]=qs[_0x2185('0x36')](_0xcb636d['query']['sort']);_0x4e4352['where']=qs[_0x2185('0x30')](_[_0x2185('0x38')](_0xcb636d[_0x2185('0x2f')],_0xe2b5e8[_0x2185('0x30')]));if(_0xcb636d[_0x2185('0x2f')]['filter']){_0x4e4352[_0x2185('0x37')]=_[_0x2185('0x3b')](_0x4e4352['where'],{'$or':_['map'](_0x4e4352[_0x2185('0x32')],function(_0x495d38){var _0x19d7d2={};_0x19d7d2[_0x495d38]={'$like':'%'+_0xcb636d[_0x2185('0x2f')][_0x2185('0x3a')]+'%'};return _0x19d7d2;})});}_0x4e4352=_[_0x2185('0x3b')]({},_0x4e4352,_0xcb636d[_0x2185('0x3c')]);return _0x284e46[_0x2185('0x47')](_0x4e4352);}})[_0x2185('0x26')](function(_0x3c5b4c){if(_0x3c5b4c){_0x562d43=_0x3c5b4c[_0x2185('0x34')];if(!_0xcb636d[_0x2185('0x2f')]['hasOwnProperty']('nolimit')){_0x4e4352[_0x2185('0x1f')]=qs[_0x2185('0x1f')](_0xcb636d[_0x2185('0x2f')][_0x2185('0x1f')]);_0x4e4352[_0x2185('0x1d')]=qs[_0x2185('0x1d')](_0xcb636d[_0x2185('0x2f')][_0x2185('0x1d')]);}return _0x284e46[_0x2185('0x47')](_0x4e4352);}})[_0x2185('0x26')](function(_0x13c8de){if(_0x13c8de){return _0x13c8de?{'count':_0x562d43,'rows':_0x13c8de}:null;}})[_0x2185('0x26')](respondWithResult(_0x2c35b1,null))['catch'](handleError(_0x2c35b1,null));};exports['addConfiguration']=function(_0x482c32,_0x4a83f0,_0x136644){if(_0x482c32[_0x2185('0x45')]['id']){delete _0x482c32['body']['id'];}return db[_0x2185('0x3d')][_0x2185('0x48')]({'where':{'id':_0x482c32[_0x2185('0x46')]['id']}})[_0x2185('0x26')](handleEntityNotFound(_0x4a83f0,null))[_0x2185('0x26')](function(_0x5b03e1){if(_0x5b03e1){_0x482c32[_0x2185('0x45')][_0x2185('0x4a')]=_0x5b03e1['id'];_0x482c32[_0x2185('0x45')][_0x2185('0x4b')]=integrations['getSubjects'](_0x482c32[_0x2185('0x45')][_0x2185('0x4c')],_0x482c32[_0x2185('0x45')][_0x2185('0x4d')]);_0x482c32['body'][_0x2185('0x4e')]=integrations[_0x2185('0x4f')](_0x482c32[_0x2185('0x45')]['channel'],_0x482c32[_0x2185('0x45')][_0x2185('0x4d')]);return db['SugarcrmConfiguration']['create'](_0x482c32[_0x2185('0x45')],{'include':[{'model':db[_0x2185('0x50')],'as':_0x2185('0x4b')},{'model':db[_0x2185('0x50')],'as':'Descriptions'}]});}return null;})[_0x2185('0x26')](respondWithResult(_0x4a83f0,null))[_0x2185('0x40')](handleError(_0x4a83f0,null));};exports['getFields']=function(_0x19728c,_0x209a90,_0x1bf570){var _0x266bd6='';var _0x5578e6=['id',_0x2185('0x29'),'assigned_user_id',_0x2185('0x51'),_0x2185('0x52'),_0x2185('0x53'),_0x2185('0x54'),'duration_minutes','parent_id',_0x2185('0x55'),_0x2185('0x56'),_0x2185('0x57')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x19728c['params']['id']},'attributes':['id',_0x2185('0x58'),_0x2185('0x59'),'remoteUri']})[_0x2185('0x26')](handleEntityNotFound(_0x209a90,null))[_0x2185('0x26')](function(_0x28d1a7){if(_0x28d1a7){_0x266bd6=_0x28d1a7[_0x2185('0x5a')];var _0x53b4d2=_0x266bd6[_0x2185('0x5b')](-0x1);if(_0x53b4d2==='/'){_0x266bd6=_0x266bd6[_0x2185('0x5c')](0x0,_0x266bd6['lastIndexOf'](_0x53b4d2));}return rp({'method':_0x2185('0x5d'),'uri':util[_0x2185('0x5e')](_0x2185('0x5f'),_0x266bd6,_0x2185('0x60')),'json':!![],'form':{'method':_0x2185('0x61'),'input_type':_0x2185('0x62'),'response_type':_0x2185('0x62'),'rest_data':JSON[_0x2185('0x63')]({'user_auth':{'user_name':_0x28d1a7[_0x2185('0x58')],'password':_0x28d1a7[_0x2185('0x59')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x2185('0x26')](function(_0x2cb183){if(_0x2cb183&&_0x2cb183[_0x2185('0x29')]!==_0x2185('0x64')&&_0x2cb183[_0x2185('0x29')]!==_0x2185('0x65')){return rp({'method':_0x2185('0x5d'),'uri':util[_0x2185('0x5e')](_0x2185('0x5f'),_0x266bd6,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2185('0x66'),'input_type':_0x2185('0x62'),'response_type':_0x2185('0x62'),'rest_data':JSON[_0x2185('0x63')]({'session':_0x2cb183['id'],'module_name':'Calls'})}})[_0x2185('0x26')](function(_0x5b844e){if(_0x5b844e){var _0x1ba538=_[_0x2185('0x67')](_0x5b844e[_0x2185('0x68')]);_[_0x2185('0x69')](_0x1ba538,function(_0x528a9b){return _0x5578e6[_0x2185('0x6a')](_0x528a9b[_0x2185('0x29')]);});return{'count':_0x1ba538[_0x2185('0x34')],'rows':_[_0x2185('0x2b')](_0x1ba538,function(_0x160271){return{'id':_0x160271[_0x2185('0x29')],'name':_0x160271[_0x2185('0x6b')],'custom':_[_0x2185('0x6c')](_0x160271[_0x2185('0x29')],'_c')?!![]:![],'options':_0x160271[_0x2185('0x3c')]?_[_0x2185('0x2b')](_['values'](_0x160271['options']),function(_0x160fd3){return{'name':_0x160fd3[_0x2185('0x6d')],'value':_0x160fd3['name']};}):[]};})};}})[_0x2185('0x26')](respondWithResult(_0x209a90,null))[_0x2185('0x40')](function(_0x126ef7){var _0x5d5dd0=_0x19728c['query'][_0x2185('0x6e')]?0x1f4:_0x126ef7['statusCode']||0x1f4;logger['error'](_0x2185('0x6f'),_0x2185('0x70'),_0x5d5dd0,JSON[_0x2185('0x63')](_0x126ef7));delete _0x126ef7[_0x2185('0x29')];if(_0x5d5dd0===0x191){_0x5d5dd0=0x190;}_0x209a90[_0x2185('0x1a')](_0x5d5dd0)[_0x2185('0x2a')](_0x19728c['query'][_0x2185('0x6e')]?{'message':_0x2185('0x71'),'statusCode':_0x126ef7[_0x2185('0x72')]}:_0x126ef7);});}else{var _0x2e327c=0x1f4;_0x209a90[_0x2185('0x1a')](_0x2e327c)[_0x2185('0x2a')]({'message':_0x2185('0x71'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x5cd2=['model','query','keys','intersection','attributes','fields','length','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','create','body','catch','find','params','destroy','SugarcrmConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','slice','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','options','values','value','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key'];(function(_0x7d7b53,_0x267aba){var _0x3d3964=function(_0x401a34){while(--_0x401a34){_0x7d7b53['push'](_0x7d7b53['shift']());}};_0x3d3964(++_0x267aba);}(_0x5cd2,0xc3));var _0x25cd=function(_0x455df2,_0x442307){_0x455df2=_0x455df2-0x0;var _0x229ec6=_0x5cd2[_0x455df2];return _0x229ec6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x25cd('0x0'));var jsonpatch=require(_0x25cd('0x1'));var rp=require(_0x25cd('0x2'));var moment=require(_0x25cd('0x3'));var BPromise=require(_0x25cd('0x4'));var Mustache=require(_0x25cd('0x5'));var util=require(_0x25cd('0x6'));var path=require(_0x25cd('0x7'));var sox=require('sox');var csv=require(_0x25cd('0x8'));var ejs=require(_0x25cd('0x9'));var fs=require('fs');var fs_extra=require(_0x25cd('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x25cd('0xb'));var jsforce=require(_0x25cd('0xc'));var deskjs=require(_0x25cd('0xd'));var toCsv=require(_0x25cd('0x8'));var querystring=require(_0x25cd('0xe'));var Papa=require(_0x25cd('0xf'));var Redis=require(_0x25cd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x25cd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25cd('0x12'));var logger=require(_0x25cd('0x13'))('api');var utils=require(_0x25cd('0x14'));var config=require(_0x25cd('0x15'));var licenseUtil=require(_0x25cd('0x16'));var db=require(_0x25cd('0x17'))['db'];var integrations=require(_0x25cd('0x18'));function respondWithStatusCode(_0x5d6bf7,_0x1146df){_0x1146df=_0x1146df||0xcc;return function(_0x1f8759){if(_0x1f8759){return _0x5d6bf7[_0x25cd('0x19')](_0x1146df);}return _0x5d6bf7['status'](_0x1146df)[_0x25cd('0x1a')]();};}function respondWithResult(_0x414a80,_0x21c953){_0x21c953=_0x21c953||0xc8;return function(_0x3b7675){if(_0x3b7675){return _0x414a80[_0x25cd('0x1b')](_0x21c953)[_0x25cd('0x1c')](_0x3b7675);}};}function respondWithFilteredResult(_0x2d707e,_0x5016d6){return function(_0x4bd651){if(_0x4bd651){var _0x3d9a1f=typeof _0x5016d6[_0x25cd('0x1d')]===_0x25cd('0x1e')&&typeof _0x5016d6['limit']===_0x25cd('0x1e');var _0x22e134=_0x4bd651[_0x25cd('0x1f')];var _0x3e16ba=_0x3d9a1f?0x0:_0x5016d6['offset'];var _0x36274f=_0x3d9a1f?_0x4bd651[_0x25cd('0x1f')]:_0x5016d6[_0x25cd('0x1d')]+_0x5016d6['limit'];var _0x45b7d9;if(_0x36274f>=_0x22e134){_0x36274f=_0x22e134;_0x45b7d9=0xc8;}else{_0x45b7d9=0xce;}_0x2d707e[_0x25cd('0x1b')](_0x45b7d9);return _0x2d707e[_0x25cd('0x20')](_0x25cd('0x21'),_0x3e16ba+'-'+_0x36274f+'/'+_0x22e134)[_0x25cd('0x1c')](_0x4bd651);}return null;};}function patchUpdates(_0x49bd97){return function(_0xbff958){try{jsonpatch[_0x25cd('0x22')](_0xbff958,_0x49bd97,!![]);}catch(_0x27d021){return BPromise[_0x25cd('0x23')](_0x27d021);}return _0xbff958['save']();};}function saveUpdates(_0x23334a,_0x2e80a0){return function(_0xb30534){if(_0xb30534){return _0xb30534[_0x25cd('0x24')](_0x23334a)[_0x25cd('0x25')](function(_0x248cf6){return _0x248cf6;});}return null;};}function removeEntity(_0x518d81,_0x45f0f6){return function(_0x119aa3){if(_0x119aa3){return _0x119aa3['destroy']()[_0x25cd('0x25')](function(){_0x518d81[_0x25cd('0x1b')](0xcc)[_0x25cd('0x1a')]();});}};}function handleEntityNotFound(_0x100d7e,_0x2f2fe9){return function(_0x7c9a23){if(!_0x7c9a23){_0x100d7e[_0x25cd('0x19')](0x194);}return _0x7c9a23;};}function handleError(_0x139f81,_0x5cf7fd){_0x5cf7fd=_0x5cf7fd||0x1f4;return function(_0x14c080){logger[_0x25cd('0x26')](_0x14c080[_0x25cd('0x27')]);if(_0x14c080[_0x25cd('0x28')]){delete _0x14c080[_0x25cd('0x28')];}_0x139f81[_0x25cd('0x1b')](_0x5cf7fd)[_0x25cd('0x29')](_0x14c080);};}exports[_0x25cd('0x2a')]=function(_0x324b38,_0x3529c4){var _0x1213ef={},_0x5b9a62={},_0x1419c9={'count':0x0,'rows':[]};var _0xb4d9a4=_[_0x25cd('0x2b')](db[_0x25cd('0x2c')][_0x25cd('0x2d')],function(_0x1ab948){return{'name':_0x1ab948[_0x25cd('0x2e')],'type':_0x1ab948[_0x25cd('0x2f')][_0x25cd('0x30')]};});_0x5b9a62[_0x25cd('0x31')]=_[_0x25cd('0x2b')](_0xb4d9a4,_0x25cd('0x28'));_0x5b9a62[_0x25cd('0x32')]=_[_0x25cd('0x33')](_0x324b38[_0x25cd('0x32')]);_0x5b9a62['filters']=_[_0x25cd('0x34')](_0x5b9a62[_0x25cd('0x31')],_0x5b9a62[_0x25cd('0x32')]);_0x1213ef[_0x25cd('0x35')]=_[_0x25cd('0x34')](_0x5b9a62['model'],qs['fields'](_0x324b38[_0x25cd('0x32')][_0x25cd('0x36')]));_0x1213ef[_0x25cd('0x35')]=_0x1213ef[_0x25cd('0x35')][_0x25cd('0x37')]?_0x1213ef['attributes']:_0x5b9a62['model'];if(!_0x324b38[_0x25cd('0x32')]['hasOwnProperty'](_0x25cd('0x38'))){_0x1213ef['limit']=qs[_0x25cd('0x39')](_0x324b38[_0x25cd('0x32')][_0x25cd('0x39')]);_0x1213ef['offset']=qs[_0x25cd('0x1d')](_0x324b38[_0x25cd('0x32')][_0x25cd('0x1d')]);}_0x1213ef['order']=qs[_0x25cd('0x3a')](_0x324b38[_0x25cd('0x32')]['sort']);_0x1213ef[_0x25cd('0x3b')]=qs[_0x25cd('0x3c')](_[_0x25cd('0x3d')](_0x324b38['query'],_0x5b9a62[_0x25cd('0x3c')]),_0xb4d9a4);if(_0x324b38[_0x25cd('0x32')][_0x25cd('0x3e')]){_0x1213ef[_0x25cd('0x3b')]=_[_0x25cd('0x3f')](_0x1213ef[_0x25cd('0x3b')],{'$or':_[_0x25cd('0x2b')](_0xb4d9a4,function(_0x47f693){if(_0x47f693[_0x25cd('0x2f')]!==_0x25cd('0x40')){var _0x545470={};_0x545470[_0x47f693[_0x25cd('0x28')]]={'$like':'%'+_0x324b38[_0x25cd('0x32')][_0x25cd('0x3e')]+'%'};return _0x545470;}})});}_0x1213ef=_[_0x25cd('0x3f')]({},_0x1213ef,_0x324b38['options']);var _0x5b605c={'where':_0x1213ef['where']};return db[_0x25cd('0x2c')][_0x25cd('0x1f')](_0x5b605c)[_0x25cd('0x25')](function(_0x24952a){_0x1419c9[_0x25cd('0x1f')]=_0x24952a;if(_0x324b38[_0x25cd('0x32')][_0x25cd('0x41')]){_0x1213ef[_0x25cd('0x42')]=[{'all':!![]}];}return db[_0x25cd('0x2c')][_0x25cd('0x43')](_0x1213ef);})[_0x25cd('0x25')](function(_0x1c954e){_0x1419c9[_0x25cd('0x44')]=_0x1c954e;return _0x1419c9;})['then'](respondWithFilteredResult(_0x3529c4,_0x1213ef))['catch'](handleError(_0x3529c4,null));};exports[_0x25cd('0x45')]=function(_0x383b8d,_0x54e6bc){var _0x4b864a={'raw':![],'where':{'id':_0x383b8d['params']['id']}},_0x3e25de={};_0x3e25de['model']=_[_0x25cd('0x33')](db[_0x25cd('0x2c')][_0x25cd('0x2d')]);_0x3e25de[_0x25cd('0x32')]=_[_0x25cd('0x33')](_0x383b8d[_0x25cd('0x32')]);_0x3e25de[_0x25cd('0x3c')]=_[_0x25cd('0x34')](_0x3e25de[_0x25cd('0x31')],_0x3e25de['query']);_0x4b864a[_0x25cd('0x35')]=_[_0x25cd('0x34')](_0x3e25de['model'],qs[_0x25cd('0x36')](_0x383b8d[_0x25cd('0x32')][_0x25cd('0x36')]));_0x4b864a[_0x25cd('0x35')]=_0x4b864a[_0x25cd('0x35')][_0x25cd('0x37')]?_0x4b864a[_0x25cd('0x35')]:_0x3e25de['model'];if(_0x383b8d[_0x25cd('0x32')][_0x25cd('0x41')]){_0x4b864a[_0x25cd('0x42')]=[{'all':!![]}];}_0x4b864a=_[_0x25cd('0x3f')]({},_0x4b864a,_0x383b8d['options']);return db['SugarcrmAccount']['find'](_0x4b864a)[_0x25cd('0x25')](handleEntityNotFound(_0x54e6bc,null))[_0x25cd('0x25')](respondWithResult(_0x54e6bc,null))['catch'](handleError(_0x54e6bc,null));};exports[_0x25cd('0x46')]=function(_0x1d464a,_0x5bb1fa){return db[_0x25cd('0x2c')]['create'](_0x1d464a[_0x25cd('0x47')],{})[_0x25cd('0x25')](respondWithResult(_0x5bb1fa,0xc9))[_0x25cd('0x48')](handleError(_0x5bb1fa,null));};exports[_0x25cd('0x24')]=function(_0x548479,_0x10798a){if(_0x548479[_0x25cd('0x47')]['id']){delete _0x548479[_0x25cd('0x47')]['id'];}return db[_0x25cd('0x2c')][_0x25cd('0x49')]({'where':{'id':_0x548479[_0x25cd('0x4a')]['id']}})[_0x25cd('0x25')](handleEntityNotFound(_0x10798a,null))['then'](saveUpdates(_0x548479[_0x25cd('0x47')],null))[_0x25cd('0x25')](respondWithResult(_0x10798a,null))['catch'](handleError(_0x10798a,null));};exports[_0x25cd('0x4b')]=function(_0x53d7ae,_0x834944){return db[_0x25cd('0x2c')][_0x25cd('0x49')]({'where':{'id':_0x53d7ae[_0x25cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x834944,null))['then'](removeEntity(_0x834944,null))['catch'](handleError(_0x834944,null));};exports['getConfigurations']=function(_0x4b6996,_0x219033,_0x373a88){var _0x436bf1={};var _0x584513={};var _0x2ae115;var _0x8abdf7;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x4b6996[_0x25cd('0x4a')]['id']}})[_0x25cd('0x25')](handleEntityNotFound(_0x219033,null))[_0x25cd('0x25')](function(_0x3f1dd8){if(_0x3f1dd8){_0x2ae115=_0x3f1dd8;_0x584513[_0x25cd('0x31')]=_[_0x25cd('0x33')](db[_0x25cd('0x4c')][_0x25cd('0x2d')]);_0x584513[_0x25cd('0x32')]=_['keys'](_0x4b6996['query']);_0x584513['filters']=_[_0x25cd('0x34')](_0x584513[_0x25cd('0x31')],_0x584513['query']);_0x436bf1['attributes']=_['intersection'](_0x584513[_0x25cd('0x31')],qs[_0x25cd('0x36')](_0x4b6996['query']['fields']));_0x436bf1[_0x25cd('0x35')]=_0x436bf1[_0x25cd('0x35')]['length']?_0x436bf1[_0x25cd('0x35')]:_0x584513[_0x25cd('0x31')];_0x436bf1[_0x25cd('0x4d')]=qs[_0x25cd('0x3a')](_0x4b6996[_0x25cd('0x32')][_0x25cd('0x3a')]);_0x436bf1[_0x25cd('0x3b')]=qs[_0x25cd('0x3c')](_['pick'](_0x4b6996[_0x25cd('0x32')],_0x584513[_0x25cd('0x3c')]));if(_0x4b6996['query'][_0x25cd('0x3e')]){_0x436bf1[_0x25cd('0x3b')]=_[_0x25cd('0x3f')](_0x436bf1[_0x25cd('0x3b')],{'$or':_[_0x25cd('0x2b')](_0x436bf1['attributes'],function(_0x4ffa26){var _0x5246d4={};_0x5246d4[_0x4ffa26]={'$like':'%'+_0x4b6996[_0x25cd('0x32')]['filter']+'%'};return _0x5246d4;})});}_0x436bf1=_[_0x25cd('0x3f')]({},_0x436bf1,_0x4b6996['options']);return _0x2ae115[_0x25cd('0x4e')](_0x436bf1);}})['then'](function(_0x17e350){if(_0x17e350){_0x8abdf7=_0x17e350[_0x25cd('0x37')];if(!_0x4b6996[_0x25cd('0x32')][_0x25cd('0x4f')]('nolimit')){_0x436bf1[_0x25cd('0x39')]=qs[_0x25cd('0x39')](_0x4b6996['query'][_0x25cd('0x39')]);_0x436bf1[_0x25cd('0x1d')]=qs['offset'](_0x4b6996[_0x25cd('0x32')]['offset']);}return _0x2ae115[_0x25cd('0x4e')](_0x436bf1);}})[_0x25cd('0x25')](function(_0x2b84e6){if(_0x2b84e6){return _0x2b84e6?{'count':_0x8abdf7,'rows':_0x2b84e6}:null;}})[_0x25cd('0x25')](respondWithResult(_0x219033,null))[_0x25cd('0x48')](handleError(_0x219033,null));};exports[_0x25cd('0x50')]=function(_0x9e5f9d,_0x455b28,_0x1b0f09){if(_0x9e5f9d['body']['id']){delete _0x9e5f9d[_0x25cd('0x47')]['id'];}return db[_0x25cd('0x2c')][_0x25cd('0x51')]({'where':{'id':_0x9e5f9d[_0x25cd('0x4a')]['id']}})[_0x25cd('0x25')](handleEntityNotFound(_0x455b28,null))[_0x25cd('0x25')](function(_0x9c26b4){if(_0x9c26b4){_0x9e5f9d[_0x25cd('0x47')][_0x25cd('0x52')]=_0x9c26b4['id'];_0x9e5f9d[_0x25cd('0x47')][_0x25cd('0x53')]=integrations[_0x25cd('0x54')](_0x9e5f9d['body'][_0x25cd('0x55')],_0x9e5f9d['body'][_0x25cd('0x2f')]);_0x9e5f9d['body']['Descriptions']=integrations[_0x25cd('0x56')](_0x9e5f9d[_0x25cd('0x47')]['channel'],_0x9e5f9d[_0x25cd('0x47')]['type']);return db[_0x25cd('0x4c')][_0x25cd('0x46')](_0x9e5f9d[_0x25cd('0x47')],{'include':[{'model':db[_0x25cd('0x57')],'as':_0x25cd('0x53')},{'model':db[_0x25cd('0x57')],'as':_0x25cd('0x58')}]});}return null;})[_0x25cd('0x25')](respondWithResult(_0x455b28,null))[_0x25cd('0x48')](handleError(_0x455b28,null));};exports[_0x25cd('0x59')]=function(_0xe52fd3,_0x4a8e2a,_0x2666b3){var _0x2328e3='';var _0x57fa7f=['id','name','assigned_user_id',_0x25cd('0x5a'),_0x25cd('0x5b'),_0x25cd('0x5c'),_0x25cd('0x5d'),_0x25cd('0x5e'),_0x25cd('0x5f'),_0x25cd('0x60'),_0x25cd('0x61'),'direction'];return db[_0x25cd('0x2c')][_0x25cd('0x51')]({'where':{'id':_0xe52fd3[_0x25cd('0x4a')]['id']},'attributes':['id',_0x25cd('0x62'),_0x25cd('0x63'),'remoteUri']})[_0x25cd('0x25')](handleEntityNotFound(_0x4a8e2a,null))[_0x25cd('0x25')](function(_0x2f15ad){if(_0x2f15ad){_0x2328e3=_0x2f15ad['remoteUri'];var _0x3935da=_0x2328e3[_0x25cd('0x64')](-0x1);if(_0x3935da==='/'){_0x2328e3=_0x2328e3['substring'](0x0,_0x2328e3['lastIndexOf'](_0x3935da));}return rp({'method':_0x25cd('0x65'),'uri':util[_0x25cd('0x66')](_0x25cd('0x67'),_0x2328e3,_0x25cd('0x68')),'json':!![],'form':{'method':_0x25cd('0x69'),'input_type':_0x25cd('0x6a'),'response_type':_0x25cd('0x6a'),'rest_data':JSON[_0x25cd('0x6b')]({'user_auth':{'user_name':_0x2f15ad[_0x25cd('0x62')],'password':_0x2f15ad['password'],'encryption':'PLAIN'},'application':_0x25cd('0x6c')})}});}})[_0x25cd('0x25')](function(_0x8fee3){if(_0x8fee3&&_0x8fee3[_0x25cd('0x28')]!==_0x25cd('0x6d')&&_0x8fee3[_0x25cd('0x28')]!==_0x25cd('0x6e')){return rp({'method':_0x25cd('0x65'),'uri':util['format'](_0x25cd('0x67'),_0x2328e3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x25cd('0x6f'),'input_type':_0x25cd('0x6a'),'response_type':_0x25cd('0x6a'),'rest_data':JSON[_0x25cd('0x6b')]({'session':_0x8fee3['id'],'module_name':_0x25cd('0x70')})}})['then'](function(_0x2e3949){if(_0x2e3949){var _0x8a0c0a=_['values'](_0x2e3949[_0x25cd('0x71')]);_[_0x25cd('0x72')](_0x8a0c0a,function(_0x441eec){return _0x57fa7f[_0x25cd('0x73')](_0x441eec[_0x25cd('0x28')]);});return{'count':_0x8a0c0a[_0x25cd('0x37')],'rows':_['map'](_0x8a0c0a,function(_0x75ac8e){return{'id':_0x75ac8e[_0x25cd('0x28')],'name':_0x75ac8e['label'],'custom':_['endsWith'](_0x75ac8e[_0x25cd('0x28')],'_c')?!![]:![],'options':_0x75ac8e[_0x25cd('0x74')]?_['map'](_[_0x25cd('0x75')](_0x75ac8e[_0x25cd('0x74')]),function(_0x386912){return{'name':_0x386912[_0x25cd('0x76')],'value':_0x386912[_0x25cd('0x28')]};}):[]};})};}})[_0x25cd('0x25')](respondWithResult(_0x4a8e2a,null))[_0x25cd('0x48')](function(_0xac5fba){var _0x10761f=_0xe52fd3[_0x25cd('0x32')][_0x25cd('0x77')]?0x1f4:_0xac5fba['statusCode']||0x1f4;logger[_0x25cd('0x26')](_0x25cd('0x78'),_0x25cd('0x59'),_0x10761f,JSON[_0x25cd('0x6b')](_0xac5fba));delete _0xac5fba[_0x25cd('0x28')];if(_0x10761f===0x191){_0x10761f=0x190;}_0x4a8e2a[_0x25cd('0x1b')](_0x10761f)[_0x25cd('0x29')](_0xe52fd3[_0x25cd('0x32')][_0x25cd('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0xac5fba[_0x25cd('0x79')]}:_0xac5fba);});}else{var _0x49360f=0x1f4;_0x4a8e2a[_0x25cd('0x1b')](_0x49360f)[_0x25cd('0x29')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 3748a2a..c46ab43 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 _0xdab3=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','util','api','moment','bluebird'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0xdab3,0xeb));var _0x3dab=function(_0x49eee6,_0x497a4f){_0x49eee6=_0x49eee6-0x0;var _0x9febd2=_0xdab3[_0x49eee6];return _0x9febd2;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var logger=require('../../config/logger')(_0x3dab('0x2'));var moment=require(_0x3dab('0x3'));var BPromise=require(_0x3dab('0x4'));var rp=require(_0x3dab('0x5'));var fs=require('fs');var path=require(_0x3dab('0x6'));var rimraf=require(_0x3dab('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x3dab('0x8'));module[_0x3dab('0x9')]=function(_0x2e3718,_0x415608){return _0x2e3718[_0x3dab('0xa')](_0x3dab('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1669=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','lodash','util','../../config/logger'];(function(_0x1c69f0,_0x1b1385){var _0x437044=function(_0x4da23d){while(--_0x4da23d){_0x1c69f0['push'](_0x1c69f0['shift']());}};_0x437044(++_0x1b1385);}(_0x1669,0x1e9));var _0x9166=function(_0x11b240,_0x22e83d){_0x11b240=_0x11b240-0x0;var _0x25b4da=_0x1669[_0x11b240];return _0x25b4da;};'use strict';var _=require(_0x9166('0x0'));var util=require(_0x9166('0x1'));var logger=require(_0x9166('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9166('0x3'));var rp=require(_0x9166('0x4'));var fs=require('fs');var path=require(_0x9166('0x5'));var rimraf=require(_0x9166('0x6'));var config=require(_0x9166('0x7'));var attributes=require(_0x9166('0x8'));var integrations=require(_0x9166('0x9'));module['exports']=function(_0x35db6c,_0x581a63){return _0x35db6c[_0x9166('0xa')](_0x9166('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','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 1bbc304..904e49b 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 _0xb145=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','model','map','ShowSugarcrmAccount','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xb145,0xe7));var _0x5b14=function(_0x5f3554,_0x387d11){_0x5f3554=_0x5f3554-0x0;var _0xb75646=_0xb145[_0x5f3554];return _0xb75646;};'use strict';var _=require(_0x5b14('0x0'));var util=require(_0x5b14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b14('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b14('0x3'))['db'];var utils=require(_0x5b14('0x4'));var logger=require(_0x5b14('0x5'))(_0x5b14('0x6'));var config=require(_0x5b14('0x7'));var jayson=require(_0x5b14('0x8'));var client=jayson[_0x5b14('0x9')][_0x5b14('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44790c,_0x1bf220,_0x26bf29){return new BPromise(function(_0x2fab63,_0x4a1971){return client[_0x5b14('0xb')](_0x44790c,_0x26bf29)[_0x5b14('0xc')](function(_0x4a489d){logger[_0x5b14('0xd')](_0x5b14('0xe'),_0x1bf220,_0x5b14('0xf'));logger[_0x5b14('0x10')](_0x5b14('0x11'),_0x1bf220,_0x5b14('0xf'),JSON[_0x5b14('0x12')](_0x4a489d));if(_0x4a489d[_0x5b14('0x13')]){if(_0x4a489d[_0x5b14('0x13')][_0x5b14('0x14')]===0x1f4){logger[_0x5b14('0x13')](_0x5b14('0xe'),_0x1bf220,_0x4a489d[_0x5b14('0x13')][_0x5b14('0x15')]);return _0x4a1971(_0x4a489d['error'][_0x5b14('0x15')]);}logger[_0x5b14('0x13')](_0x5b14('0xe'),_0x1bf220,_0x4a489d['error']['message']);return _0x2fab63(_0x4a489d['error']['message']);}else{logger[_0x5b14('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x1bf220,'request\x20sent');_0x2fab63(_0x4a489d[_0x5b14('0x16')][_0x5b14('0x15')]);}})[_0x5b14('0x17')](function(_0x3b4318){logger['error'](_0x5b14('0xe'),_0x1bf220,_0x3b4318);_0x4a1971(_0x3b4318);});});}exports[_0x5b14('0x18')]=function(_0x5be00a){var _0x4a5738=this;return new Promise(function(_0x49bbc0,_0xa7f13e){return db[_0x5b14('0x19')]['findAll']({'raw':_0x5be00a['options']?_0x5be00a[_0x5b14('0x1a')][_0x5b14('0x1b')]===undefined?!![]:![]:!![],'where':_0x5be00a[_0x5b14('0x1a')]?_0x5be00a[_0x5b14('0x1a')][_0x5b14('0x1c')]||null:null,'attributes':_0x5be00a[_0x5b14('0x1a')]?_0x5be00a[_0x5b14('0x1a')][_0x5b14('0x1d')]||null:null,'limit':_0x5be00a['options']?_0x5be00a[_0x5b14('0x1a')][_0x5b14('0x1e')]||null:null,'include':_0x5be00a[_0x5b14('0x1a')]?_0x5be00a[_0x5b14('0x1a')][_0x5b14('0x1f')]?_['map'](_0x5be00a[_0x5b14('0x1a')][_0x5b14('0x1f')],function(_0x44995b){return{'model':db[_0x44995b[_0x5b14('0x20')]],'as':_0x44995b['as'],'attributes':_0x44995b[_0x5b14('0x1d')],'include':_0x44995b['include']?_['map'](_0x44995b['include'],function(_0x5a8120){return{'model':db[_0x5a8120['model']],'as':_0x5a8120['as'],'attributes':_0x5a8120['attributes'],'include':_0x5a8120['include']?_[_0x5b14('0x21')](_0x5a8120['include'],function(_0x1b218c){return{'model':db[_0x1b218c[_0x5b14('0x20')]],'as':_0x1b218c['as'],'attributes':_0x1b218c[_0x5b14('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5b14('0xc')](function(_0x522ed2){logger['info']('GetSugarcrmAccount',_0x5be00a);logger[_0x5b14('0x10')]('GetSugarcrmAccount',_0x5be00a,JSON[_0x5b14('0x12')](_0x522ed2));_0x49bbc0(_0x522ed2);})['catch'](function(_0x2127c8){logger['error'](_0x5b14('0x18'),_0x2127c8[_0x5b14('0x15')],_0x5be00a);_0xa7f13e(_0x4a5738[_0x5b14('0x13')](0x1f4,_0x2127c8[_0x5b14('0x15')]));});});};exports[_0x5b14('0x22')]=function(_0x3e551e){var _0x1e2ecb=this;return new Promise(function(_0x304ac3,_0x43a2ef){return db[_0x5b14('0x19')]['find']({'raw':_0x3e551e[_0x5b14('0x1a')]?_0x3e551e[_0x5b14('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3e551e['options']?_0x3e551e[_0x5b14('0x1a')][_0x5b14('0x1c')]||null:null,'attributes':_0x3e551e[_0x5b14('0x1a')]?_0x3e551e['options']['attributes']||null:null,'include':_0x3e551e['options']?_0x3e551e[_0x5b14('0x1a')][_0x5b14('0x1f')]?_[_0x5b14('0x21')](_0x3e551e[_0x5b14('0x1a')][_0x5b14('0x1f')],function(_0x4e9746){return{'model':db[_0x4e9746['model']],'as':_0x4e9746['as'],'attributes':_0x4e9746[_0x5b14('0x1d')],'include':_0x4e9746[_0x5b14('0x1f')]?_[_0x5b14('0x21')](_0x4e9746[_0x5b14('0x1f')],function(_0x23a1ed){return{'model':db[_0x23a1ed[_0x5b14('0x20')]],'as':_0x23a1ed['as'],'attributes':_0x23a1ed[_0x5b14('0x1d')],'include':_0x23a1ed[_0x5b14('0x1f')]?_['map'](_0x23a1ed[_0x5b14('0x1f')],function(_0x3bdeff){return{'model':db[_0x3bdeff[_0x5b14('0x20')]],'as':_0x3bdeff['as'],'attributes':_0x3bdeff[_0x5b14('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5b14('0xc')](function(_0x9b429f){logger[_0x5b14('0xd')]('ShowSugarcrmAccount',_0x3e551e);logger[_0x5b14('0x10')](_0x5b14('0x22'),_0x3e551e,JSON['stringify'](_0x9b429f));_0x304ac3(_0x9b429f);})[_0x5b14('0x17')](function(_0x2b2104){logger[_0x5b14('0x13')](_0x5b14('0x22'),_0x2b2104[_0x5b14('0x15')],_0x3e551e);_0x43a2ef(_0x1e2ecb['error'](0x1f4,_0x2b2104[_0x5b14('0x15')]));});});}; \ No newline at end of file +var _0x3ffb=['stringify','error','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x3ffb,0xc0));var _0xb3ff=function(_0x4f7e48,_0x46c49f){_0x4f7e48=_0x4f7e48-0x0;var _0x5132f8=_0x3ffb[_0x4f7e48];return _0x5132f8;};'use strict';var _=require('lodash');var util=require(_0xb3ff('0x0'));var moment=require(_0xb3ff('0x1'));var BPromise=require(_0xb3ff('0x2'));var rs=require(_0xb3ff('0x3'));var fs=require('fs');var Redis=require(_0xb3ff('0x4'));var db=require(_0xb3ff('0x5'))['db'];var utils=require(_0xb3ff('0x6'));var logger=require(_0xb3ff('0x7'))('rpc');var config=require(_0xb3ff('0x8'));var jayson=require(_0xb3ff('0x9'));var client=jayson[_0xb3ff('0xa')][_0xb3ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x375610,_0x18b1be,_0x33f987){return new BPromise(function(_0x1d3174,_0x5d3450){return client['request'](_0x375610,_0x33f987)[_0xb3ff('0xc')](function(_0x50144f){logger[_0xb3ff('0xd')](_0xb3ff('0xe'),_0x18b1be,_0xb3ff('0xf'));logger[_0xb3ff('0x10')](_0xb3ff('0x11'),_0x18b1be,_0xb3ff('0xf'),JSON[_0xb3ff('0x12')](_0x50144f));if(_0x50144f['error']){if(_0x50144f[_0xb3ff('0x13')]['code']===0x1f4){logger[_0xb3ff('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x18b1be,_0x50144f[_0xb3ff('0x13')][_0xb3ff('0x14')]);return _0x5d3450(_0x50144f[_0xb3ff('0x13')][_0xb3ff('0x14')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x18b1be,_0x50144f[_0xb3ff('0x13')][_0xb3ff('0x14')]);return _0x1d3174(_0x50144f[_0xb3ff('0x13')][_0xb3ff('0x14')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x18b1be,'request\x20sent');_0x1d3174(_0x50144f['result'][_0xb3ff('0x14')]);}})[_0xb3ff('0x15')](function(_0x2bdfb5){logger[_0xb3ff('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x18b1be,_0x2bdfb5);_0x5d3450(_0x2bdfb5);});});}exports['GetSugarcrmAccount']=function(_0x1ec6ee){var _0x5a9ddf=this;return new Promise(function(_0x1f59ff,_0x2d6660){return db['SugarcrmAccount'][_0xb3ff('0x16')]({'raw':_0x1ec6ee['options']?_0x1ec6ee[_0xb3ff('0x17')][_0xb3ff('0x18')]===undefined?!![]:![]:!![],'where':_0x1ec6ee[_0xb3ff('0x17')]?_0x1ec6ee[_0xb3ff('0x17')][_0xb3ff('0x19')]||null:null,'attributes':_0x1ec6ee[_0xb3ff('0x17')]?_0x1ec6ee[_0xb3ff('0x17')][_0xb3ff('0x1a')]||null:null,'limit':_0x1ec6ee[_0xb3ff('0x17')]?_0x1ec6ee['options'][_0xb3ff('0x1b')]||null:null,'include':_0x1ec6ee[_0xb3ff('0x17')]?_0x1ec6ee[_0xb3ff('0x17')][_0xb3ff('0x1c')]?_[_0xb3ff('0x1d')](_0x1ec6ee[_0xb3ff('0x17')][_0xb3ff('0x1c')],function(_0x18fdde){return{'model':db[_0x18fdde[_0xb3ff('0x1e')]],'as':_0x18fdde['as'],'attributes':_0x18fdde[_0xb3ff('0x1a')],'include':_0x18fdde[_0xb3ff('0x1c')]?_['map'](_0x18fdde['include'],function(_0x38c698){return{'model':db[_0x38c698[_0xb3ff('0x1e')]],'as':_0x38c698['as'],'attributes':_0x38c698[_0xb3ff('0x1a')],'include':_0x38c698['include']?_[_0xb3ff('0x1d')](_0x38c698[_0xb3ff('0x1c')],function(_0x4292d8){return{'model':db[_0x4292d8[_0xb3ff('0x1e')]],'as':_0x4292d8['as'],'attributes':_0x4292d8[_0xb3ff('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb3ff('0xc')](function(_0x1b6674){logger['info'](_0xb3ff('0x1f'),_0x1ec6ee);logger[_0xb3ff('0x10')](_0xb3ff('0x1f'),_0x1ec6ee,JSON[_0xb3ff('0x12')](_0x1b6674));_0x1f59ff(_0x1b6674);})[_0xb3ff('0x15')](function(_0x2a6876){logger[_0xb3ff('0x13')](_0xb3ff('0x1f'),_0x2a6876[_0xb3ff('0x14')],_0x1ec6ee);_0x2d6660(_0x5a9ddf[_0xb3ff('0x13')](0x1f4,_0x2a6876['message']));});});};exports[_0xb3ff('0x20')]=function(_0x765a8d){var _0x435122=this;return new Promise(function(_0x56d22d,_0x3a0154){return db[_0xb3ff('0x21')][_0xb3ff('0x22')]({'raw':_0x765a8d[_0xb3ff('0x17')]?_0x765a8d[_0xb3ff('0x17')][_0xb3ff('0x18')]===undefined?!![]:![]:!![],'where':_0x765a8d[_0xb3ff('0x17')]?_0x765a8d['options'][_0xb3ff('0x19')]||null:null,'attributes':_0x765a8d[_0xb3ff('0x17')]?_0x765a8d[_0xb3ff('0x17')][_0xb3ff('0x1a')]||null:null,'include':_0x765a8d[_0xb3ff('0x17')]?_0x765a8d[_0xb3ff('0x17')][_0xb3ff('0x1c')]?_[_0xb3ff('0x1d')](_0x765a8d[_0xb3ff('0x17')][_0xb3ff('0x1c')],function(_0x5bf4cc){return{'model':db[_0x5bf4cc[_0xb3ff('0x1e')]],'as':_0x5bf4cc['as'],'attributes':_0x5bf4cc[_0xb3ff('0x1a')],'include':_0x5bf4cc[_0xb3ff('0x1c')]?_[_0xb3ff('0x1d')](_0x5bf4cc[_0xb3ff('0x1c')],function(_0x90513c){return{'model':db[_0x90513c[_0xb3ff('0x1e')]],'as':_0x90513c['as'],'attributes':_0x90513c['attributes'],'include':_0x90513c[_0xb3ff('0x1c')]?_[_0xb3ff('0x1d')](_0x90513c[_0xb3ff('0x1c')],function(_0x37a1e1){return{'model':db[_0x37a1e1[_0xb3ff('0x1e')]],'as':_0x37a1e1['as'],'attributes':_0x37a1e1[_0xb3ff('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b779c){logger[_0xb3ff('0xd')](_0xb3ff('0x20'),_0x765a8d);logger[_0xb3ff('0x10')](_0xb3ff('0x20'),_0x765a8d,JSON['stringify'](_0x2b779c));_0x56d22d(_0x2b779c);})[_0xb3ff('0x15')](function(_0x2bfd5f){logger[_0xb3ff('0x13')](_0xb3ff('0x20'),_0x2bfd5f[_0xb3ff('0x14')],_0x765a8d);_0x3a0154(_0x435122[_0xb3ff('0x13')](0x1f4,_0x2bfd5f[_0xb3ff('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 604234c..4edd7f8 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 _0x1445=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','exports'];(function(_0x5de8fc,_0x21c1e5){var _0xaa63f=function(_0x2f2507){while(--_0x2f2507){_0x5de8fc['push'](_0x5de8fc['shift']());}};_0xaa63f(++_0x21c1e5);}(_0x1445,0x90));var _0x5144=function(_0x983937,_0x1296f6){_0x983937=_0x983937-0x0;var _0x33ad78=_0x1445[_0x983937];return _0x33ad78;};'use strict';var multer=require(_0x5144('0x0'));var util=require(_0x5144('0x1'));var path=require(_0x5144('0x2'));var timeout=require('connect-timeout');var express=require(_0x5144('0x3'));var router=express[_0x5144('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5144('0x5'));var interaction=require(_0x5144('0x6'));var config=require(_0x5144('0x7'));var controller=require(_0x5144('0x8'));router[_0x5144('0x9')]('/',auth[_0x5144('0xa')](),controller[_0x5144('0xb')]);router[_0x5144('0x9')](_0x5144('0xc'),auth['isAuthenticated'](),controller[_0x5144('0xd')]);router['get']('/:id/fields',auth[_0x5144('0xa')](),controller[_0x5144('0xe')]);router[_0x5144('0x9')](_0x5144('0xf'),auth[_0x5144('0xa')](),controller[_0x5144('0x10')]);router[_0x5144('0x9')]('/:id/descriptions',auth[_0x5144('0xa')](),controller[_0x5144('0x11')]);router[_0x5144('0x12')]('/',auth[_0x5144('0xa')](),controller[_0x5144('0x13')]);router[_0x5144('0x14')](_0x5144('0xc'),auth[_0x5144('0xa')](),controller[_0x5144('0x15')]);router[_0x5144('0x16')](_0x5144('0xc'),auth[_0x5144('0xa')](),controller['destroy']);module[_0x5144('0x17')]=router; \ No newline at end of file +var _0x78cc=['/:id/descriptions','post','create','put','update','delete','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x78cc,0x1cf));var _0xc78c=function(_0x296dc5,_0x4fe9cb){_0x296dc5=_0x296dc5-0x0;var _0x1e0b61=_0x78cc[_0x296dc5];return _0x1e0b61;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc78c('0x0'));var express=require(_0xc78c('0x1'));var router=express[_0xc78c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc78c('0x3'));var config=require(_0xc78c('0x4'));var controller=require(_0xc78c('0x5'));router[_0xc78c('0x6')]('/',auth[_0xc78c('0x7')](),controller['index']);router['get'](_0xc78c('0x8'),auth[_0xc78c('0x7')](),controller[_0xc78c('0x9')]);router[_0xc78c('0x6')]('/:id/fields',auth[_0xc78c('0x7')](),controller[_0xc78c('0xa')]);router[_0xc78c('0x6')](_0xc78c('0xb'),auth[_0xc78c('0x7')](),controller['getSubjects']);router['get'](_0xc78c('0xc'),auth[_0xc78c('0x7')](),controller['getDescriptions']);router[_0xc78c('0xd')]('/',auth[_0xc78c('0x7')](),controller[_0xc78c('0xe')]);router[_0xc78c('0xf')](_0xc78c('0x8'),auth[_0xc78c('0x7')](),controller[_0xc78c('0x10')]);router[_0xc78c('0x11')](_0xc78c('0x8'),auth[_0xc78c('0x7')](),controller['destroy']);module[_0xc78c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 4cc8713..97946ac 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 _0x81ec=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x81ec,0x1b7));var _0xc81e=function(_0x2b44b7,_0x336323){_0x2b44b7=_0x2b44b7-0x0;var _0x1bee43=_0x81ec[_0x2b44b7];return _0x1bee43;};'use strict';var Sequelize=require(_0xc81e('0x0'));module[_0xc81e('0x1')]={'name':{'type':Sequelize[_0xc81e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8e6f=['STRING'];(function(_0x32fd22,_0x4aa736){var _0x4dedd0=function(_0x2dc298){while(--_0x2dc298){_0x32fd22['push'](_0x32fd22['shift']());}};_0x4dedd0(++_0x4aa736);}(_0x8e6f,0x1e1));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf8e6('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4659b7a..cc81f96 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 _0xc01b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','keys','intersection','find','create','body','params','findOne','SugarcrmField','order','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0xfbc2d8,_0x35f099){var _0x1db4b1=function(_0x31813a){while(--_0x31813a){_0xfbc2d8['push'](_0xfbc2d8['shift']());}};_0x1db4b1(++_0x35f099);}(_0xc01b,0x96));var _0xbc01=function(_0x48f60e,_0x1a6e23){_0x48f60e=_0x48f60e-0x0;var _0x58170a=_0xc01b[_0x48f60e];return _0x58170a;};'use strict';var emlformat=require(_0xbc01('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc01('0x1'));var jsonpatch=require(_0xbc01('0x2'));var rp=require('request-promise');var moment=require(_0xbc01('0x3'));var BPromise=require(_0xbc01('0x4'));var Mustache=require(_0xbc01('0x5'));var util=require(_0xbc01('0x6'));var path=require(_0xbc01('0x7'));var sox=require('sox');var csv=require(_0xbc01('0x8'));var ejs=require(_0xbc01('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc01('0xa'));var squel=require(_0xbc01('0xb'));var crypto=require(_0xbc01('0xc'));var jsforce=require(_0xbc01('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbc01('0x8'));var querystring=require('querystring');var Papa=require(_0xbc01('0xe'));var Redis=require(_0xbc01('0xf'));var authService=require(_0xbc01('0x10'));var qs=require(_0xbc01('0x11'));var as=require(_0xbc01('0x12'));var hardwareService=require(_0xbc01('0x13'));var logger=require(_0xbc01('0x14'))('api');var utils=require(_0xbc01('0x15'));var config=require(_0xbc01('0x16'));var licenseUtil=require(_0xbc01('0x17'));var db=require(_0xbc01('0x18'))['db'];function respondWithStatusCode(_0x5872b5,_0x215c20){_0x215c20=_0x215c20||0xcc;return function(_0x1249a9){if(_0x1249a9){return _0x5872b5[_0xbc01('0x19')](_0x215c20);}return _0x5872b5[_0xbc01('0x1a')](_0x215c20)[_0xbc01('0x1b')]();};}function respondWithResult(_0x21dedc,_0x38c8d8){_0x38c8d8=_0x38c8d8||0xc8;return function(_0x212386){if(_0x212386){return _0x21dedc[_0xbc01('0x1a')](_0x38c8d8)['json'](_0x212386);}};}function respondWithFilteredResult(_0x4af085,_0x68a006){return function(_0x228aaf){if(_0x228aaf){var _0x3532db=typeof _0x68a006[_0xbc01('0x1c')]===_0xbc01('0x1d')&&typeof _0x68a006[_0xbc01('0x1e')]===_0xbc01('0x1d');var _0x129a7b=_0x228aaf[_0xbc01('0x1f')];var _0x36cb5f=_0x3532db?0x0:_0x68a006[_0xbc01('0x1c')];var _0x3c1ee5=_0x3532db?_0x228aaf[_0xbc01('0x1f')]:_0x68a006[_0xbc01('0x1c')]+_0x68a006[_0xbc01('0x1e')];var _0x202461;if(_0x3c1ee5>=_0x129a7b){_0x3c1ee5=_0x129a7b;_0x202461=0xc8;}else{_0x202461=0xce;}_0x4af085[_0xbc01('0x1a')](_0x202461);return _0x4af085[_0xbc01('0x20')](_0xbc01('0x21'),_0x36cb5f+'-'+_0x3c1ee5+'/'+_0x129a7b)[_0xbc01('0x22')](_0x228aaf);}return null;};}function patchUpdates(_0x57837b){return function(_0x228b8c){try{jsonpatch[_0xbc01('0x23')](_0x228b8c,_0x57837b,!![]);}catch(_0x32edf0){return BPromise[_0xbc01('0x24')](_0x32edf0);}return _0x228b8c[_0xbc01('0x25')]();};}function saveUpdates(_0x258529,_0x3c74a8){return function(_0x51d3c0){if(_0x51d3c0){return _0x51d3c0[_0xbc01('0x26')](_0x258529)[_0xbc01('0x27')](function(_0x117631){return _0x117631;});}return null;};}function removeEntity(_0x1be602,_0x1e1a85){return function(_0x24fb90){if(_0x24fb90){return _0x24fb90[_0xbc01('0x28')]()['then'](function(){_0x1be602['status'](0xcc)[_0xbc01('0x1b')]();});}};}function handleEntityNotFound(_0x1a05fc,_0x365230){return function(_0x5b935e){if(!_0x5b935e){_0x1a05fc[_0xbc01('0x19')](0x194);}return _0x5b935e;};}function handleError(_0xe01050,_0x4d9d4b){_0x4d9d4b=_0x4d9d4b||0x1f4;return function(_0x14588a){logger[_0xbc01('0x29')](_0x14588a[_0xbc01('0x2a')]);if(_0x14588a[_0xbc01('0x2b')]){delete _0x14588a['name'];}_0xe01050['status'](_0x4d9d4b)[_0xbc01('0x2c')](_0x14588a);};}exports['index']=function(_0x20fdea,_0x117480){var _0x328dd5={},_0x3d84df={},_0x578599={'count':0x0,'rows':[]};var _0x5377ce=_['map'](db[_0xbc01('0x2d')][_0xbc01('0x2e')],function(_0x1543be){return{'name':_0x1543be[_0xbc01('0x2f')],'type':_0x1543be[_0xbc01('0x30')][_0xbc01('0x31')]};});_0x3d84df[_0xbc01('0x32')]=_[_0xbc01('0x33')](_0x5377ce,_0xbc01('0x2b'));_0x3d84df['query']=_['keys'](_0x20fdea['query']);_0x3d84df[_0xbc01('0x34')]=_['intersection'](_0x3d84df[_0xbc01('0x32')],_0x3d84df[_0xbc01('0x35')]);_0x328dd5[_0xbc01('0x36')]=_['intersection'](_0x3d84df[_0xbc01('0x32')],qs[_0xbc01('0x37')](_0x20fdea[_0xbc01('0x35')]['fields']));_0x328dd5[_0xbc01('0x36')]=_0x328dd5[_0xbc01('0x36')][_0xbc01('0x38')]?_0x328dd5[_0xbc01('0x36')]:_0x3d84df[_0xbc01('0x32')];if(!_0x20fdea['query'][_0xbc01('0x39')](_0xbc01('0x3a'))){_0x328dd5[_0xbc01('0x1e')]=qs['limit'](_0x20fdea[_0xbc01('0x35')]['limit']);_0x328dd5[_0xbc01('0x1c')]=qs[_0xbc01('0x1c')](_0x20fdea[_0xbc01('0x35')][_0xbc01('0x1c')]);}_0x328dd5['order']=qs[_0xbc01('0x3b')](_0x20fdea[_0xbc01('0x35')][_0xbc01('0x3b')]);_0x328dd5[_0xbc01('0x3c')]=qs['filters'](_[_0xbc01('0x3d')](_0x20fdea[_0xbc01('0x35')],_0x3d84df[_0xbc01('0x34')]),_0x5377ce);if(_0x20fdea[_0xbc01('0x35')][_0xbc01('0x3e')]){_0x328dd5['where']=_[_0xbc01('0x3f')](_0x328dd5[_0xbc01('0x3c')],{'$or':_[_0xbc01('0x33')](_0x5377ce,function(_0x9c023d){if(_0x9c023d[_0xbc01('0x30')]!=='VIRTUAL'){var _0x5a63cf={};_0x5a63cf[_0x9c023d[_0xbc01('0x2b')]]={'$like':'%'+_0x20fdea[_0xbc01('0x35')][_0xbc01('0x3e')]+'%'};return _0x5a63cf;}})});}_0x328dd5=_['merge']({},_0x328dd5,_0x20fdea[_0xbc01('0x40')]);var _0x416038={'where':_0x328dd5[_0xbc01('0x3c')]};return db['SugarcrmConfiguration'][_0xbc01('0x1f')](_0x416038)[_0xbc01('0x27')](function(_0x4cd052){_0x578599[_0xbc01('0x1f')]=_0x4cd052;if(_0x20fdea[_0xbc01('0x35')][_0xbc01('0x41')]){_0x328dd5[_0xbc01('0x42')]=[{'all':!![]}];}return db[_0xbc01('0x2d')]['findAll'](_0x328dd5);})['then'](function(_0x3051f7){_0x578599[_0xbc01('0x43')]=_0x3051f7;return _0x578599;})[_0xbc01('0x27')](respondWithFilteredResult(_0x117480,_0x328dd5))[_0xbc01('0x44')](handleError(_0x117480,null));};exports[_0xbc01('0x45')]=function(_0x1a5633,_0x5414c5){var _0x37ef98={'raw':![],'where':{'id':_0x1a5633['params']['id']}},_0x4d009f={};_0x4d009f['model']=_[_0xbc01('0x46')](db[_0xbc01('0x2d')][_0xbc01('0x2e')]);_0x4d009f[_0xbc01('0x35')]=_['keys'](_0x1a5633[_0xbc01('0x35')]);_0x4d009f[_0xbc01('0x34')]=_[_0xbc01('0x47')](_0x4d009f['model'],_0x4d009f[_0xbc01('0x35')]);_0x37ef98[_0xbc01('0x36')]=_[_0xbc01('0x47')](_0x4d009f[_0xbc01('0x32')],qs[_0xbc01('0x37')](_0x1a5633[_0xbc01('0x35')][_0xbc01('0x37')]));_0x37ef98[_0xbc01('0x36')]=_0x37ef98[_0xbc01('0x36')][_0xbc01('0x38')]?_0x37ef98[_0xbc01('0x36')]:_0x4d009f[_0xbc01('0x32')];if(_0x1a5633[_0xbc01('0x35')]['includeAll']){_0x37ef98[_0xbc01('0x42')]=[{'all':!![]}];}_0x37ef98=_[_0xbc01('0x3f')]({},_0x37ef98,_0x1a5633[_0xbc01('0x40')]);return db[_0xbc01('0x2d')][_0xbc01('0x48')](_0x37ef98)[_0xbc01('0x27')](handleEntityNotFound(_0x5414c5,null))['then'](respondWithResult(_0x5414c5,null))['catch'](handleError(_0x5414c5,null));};exports[_0xbc01('0x49')]=function(_0x32f194,_0x50d798){return db[_0xbc01('0x2d')][_0xbc01('0x49')](_0x32f194[_0xbc01('0x4a')],{})[_0xbc01('0x27')](respondWithResult(_0x50d798,0xc9))[_0xbc01('0x44')](handleError(_0x50d798,null));};exports[_0xbc01('0x26')]=function(_0x3befca,_0x521b8a){if(_0x3befca['body']['id']){delete _0x3befca['body']['id'];}return db['SugarcrmConfiguration'][_0xbc01('0x48')]({'where':{'id':_0x3befca[_0xbc01('0x4b')]['id']}})['then'](handleEntityNotFound(_0x521b8a,null))[_0xbc01('0x27')](saveUpdates(_0x3befca[_0xbc01('0x4a')],null))[_0xbc01('0x27')](respondWithResult(_0x521b8a,null))['catch'](handleError(_0x521b8a,null));};exports['destroy']=function(_0x33fd22,_0x9c12ba){return db['SugarcrmConfiguration'][_0xbc01('0x48')]({'where':{'id':_0x33fd22[_0xbc01('0x4b')]['id']}})[_0xbc01('0x27')](handleEntityNotFound(_0x9c12ba,null))['then'](removeEntity(_0x9c12ba,null))[_0xbc01('0x44')](handleError(_0x9c12ba,null));};exports['getFields']=function(_0x230fe5,_0x39e901,_0x53a65e){var _0x307561={};var _0x12ae2e={};var _0x50cd73;var _0x286cc7;return db[_0xbc01('0x2d')][_0xbc01('0x4c')]({'where':{'id':_0x230fe5[_0xbc01('0x4b')]['id']}})[_0xbc01('0x27')](handleEntityNotFound(_0x39e901,null))[_0xbc01('0x27')](function(_0xba171f){if(_0xba171f){_0x50cd73=_0xba171f;_0x12ae2e[_0xbc01('0x32')]=_[_0xbc01('0x46')](db[_0xbc01('0x4d')][_0xbc01('0x2e')]);_0x12ae2e['query']=_['keys'](_0x230fe5[_0xbc01('0x35')]);_0x12ae2e[_0xbc01('0x34')]=_[_0xbc01('0x47')](_0x12ae2e['model'],_0x12ae2e[_0xbc01('0x35')]);_0x307561['attributes']=_[_0xbc01('0x47')](_0x12ae2e['model'],qs[_0xbc01('0x37')](_0x230fe5[_0xbc01('0x35')][_0xbc01('0x37')]));_0x307561['attributes']=_0x307561[_0xbc01('0x36')][_0xbc01('0x38')]?_0x307561[_0xbc01('0x36')]:_0x12ae2e['model'];_0x307561[_0xbc01('0x4e')]=qs[_0xbc01('0x3b')](_0x230fe5[_0xbc01('0x35')][_0xbc01('0x3b')]);_0x307561[_0xbc01('0x3c')]=qs[_0xbc01('0x34')](_[_0xbc01('0x3d')](_0x230fe5['query'],_0x12ae2e['filters']));if(_0x230fe5[_0xbc01('0x35')][_0xbc01('0x3e')]){_0x307561[_0xbc01('0x3c')]=_['merge'](_0x307561[_0xbc01('0x3c')],{'$or':_[_0xbc01('0x33')](_0x307561[_0xbc01('0x36')],function(_0x52a8eb){var _0x2e3622={};_0x2e3622[_0x52a8eb]={'$like':'%'+_0x230fe5[_0xbc01('0x35')][_0xbc01('0x3e')]+'%'};return _0x2e3622;})});}_0x307561=_['merge']({},_0x307561,_0x230fe5['options']);return _0x50cd73[_0xbc01('0x4f')](_0x307561);}})[_0xbc01('0x27')](function(_0x3760f2){if(_0x3760f2){_0x286cc7=_0x3760f2[_0xbc01('0x38')];if(!_0x230fe5[_0xbc01('0x35')][_0xbc01('0x39')](_0xbc01('0x3a'))){_0x307561['limit']=qs[_0xbc01('0x1e')](_0x230fe5[_0xbc01('0x35')]['limit']);_0x307561[_0xbc01('0x1c')]=qs[_0xbc01('0x1c')](_0x230fe5['query']['offset']);}return _0x50cd73[_0xbc01('0x4f')](_0x307561);}})[_0xbc01('0x27')](function(_0x171da8){if(_0x171da8){return _0x171da8?{'count':_0x286cc7,'rows':_0x171da8}:null;}})[_0xbc01('0x27')](respondWithResult(_0x39e901,null))[_0xbc01('0x44')](handleError(_0x39e901,null));};exports['getSubjects']=function(_0x42f0f8,_0x2af878,_0x5236a8){var _0x1a0b51={};var _0x280ab7={};var _0x492bf1;var _0x99b2b;return db[_0xbc01('0x2d')][_0xbc01('0x4c')]({'where':{'id':_0x42f0f8[_0xbc01('0x4b')]['id']}})[_0xbc01('0x27')](handleEntityNotFound(_0x2af878,null))[_0xbc01('0x27')](function(_0x599951){if(_0x599951){_0x492bf1=_0x599951;_0x280ab7[_0xbc01('0x32')]=_[_0xbc01('0x46')](db[_0xbc01('0x4d')][_0xbc01('0x2e')]);_0x280ab7[_0xbc01('0x35')]=_[_0xbc01('0x46')](_0x42f0f8[_0xbc01('0x35')]);_0x280ab7['filters']=_[_0xbc01('0x47')](_0x280ab7[_0xbc01('0x32')],_0x280ab7['query']);_0x1a0b51[_0xbc01('0x36')]=_[_0xbc01('0x47')](_0x280ab7['model'],qs[_0xbc01('0x37')](_0x42f0f8['query'][_0xbc01('0x37')]));_0x1a0b51[_0xbc01('0x36')]=_0x1a0b51[_0xbc01('0x36')][_0xbc01('0x38')]?_0x1a0b51['attributes']:_0x280ab7[_0xbc01('0x32')];_0x1a0b51[_0xbc01('0x4e')]=qs[_0xbc01('0x3b')](_0x42f0f8[_0xbc01('0x35')][_0xbc01('0x3b')]);_0x1a0b51[_0xbc01('0x3c')]=qs['filters'](_[_0xbc01('0x3d')](_0x42f0f8[_0xbc01('0x35')],_0x280ab7[_0xbc01('0x34')]));if(_0x42f0f8[_0xbc01('0x35')]['filter']){_0x1a0b51[_0xbc01('0x3c')]=_[_0xbc01('0x3f')](_0x1a0b51['where'],{'$or':_[_0xbc01('0x33')](_0x1a0b51[_0xbc01('0x36')],function(_0x12b836){var _0x1e537d={};_0x1e537d[_0x12b836]={'$like':'%'+_0x42f0f8[_0xbc01('0x35')]['filter']+'%'};return _0x1e537d;})});}_0x1a0b51=_['merge']({},_0x1a0b51,_0x42f0f8[_0xbc01('0x40')]);return _0x492bf1[_0xbc01('0x50')](_0x1a0b51);}})[_0xbc01('0x27')](function(_0x4ab3d4){if(_0x4ab3d4){_0x99b2b=_0x4ab3d4[_0xbc01('0x38')];if(!_0x42f0f8[_0xbc01('0x35')][_0xbc01('0x39')]('nolimit')){_0x1a0b51['limit']=qs[_0xbc01('0x1e')](_0x42f0f8[_0xbc01('0x35')][_0xbc01('0x1e')]);_0x1a0b51[_0xbc01('0x1c')]=qs[_0xbc01('0x1c')](_0x42f0f8['query'][_0xbc01('0x1c')]);}return _0x492bf1[_0xbc01('0x50')](_0x1a0b51);}})[_0xbc01('0x27')](function(_0x3792ca){if(_0x3792ca){return _0x3792ca?{'count':_0x99b2b,'rows':_0x3792ca}:null;}})[_0xbc01('0x27')](respondWithResult(_0x2af878,null))[_0xbc01('0x44')](handleError(_0x2af878,null));};exports[_0xbc01('0x51')]=function(_0x3334fe,_0x4fabdd,_0x46b37f){var _0x20bcfd={};var _0x407273={};var _0xc5d999;var _0x2ae59e;return db[_0xbc01('0x2d')][_0xbc01('0x4c')]({'where':{'id':_0x3334fe[_0xbc01('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fabdd,null))[_0xbc01('0x27')](function(_0xf27f34){if(_0xf27f34){_0xc5d999=_0xf27f34;_0x407273[_0xbc01('0x32')]=_[_0xbc01('0x46')](db['SugarcrmField']['rawAttributes']);_0x407273[_0xbc01('0x35')]=_[_0xbc01('0x46')](_0x3334fe[_0xbc01('0x35')]);_0x407273[_0xbc01('0x34')]=_[_0xbc01('0x47')](_0x407273[_0xbc01('0x32')],_0x407273[_0xbc01('0x35')]);_0x20bcfd[_0xbc01('0x36')]=_[_0xbc01('0x47')](_0x407273['model'],qs[_0xbc01('0x37')](_0x3334fe['query'][_0xbc01('0x37')]));_0x20bcfd[_0xbc01('0x36')]=_0x20bcfd[_0xbc01('0x36')][_0xbc01('0x38')]?_0x20bcfd[_0xbc01('0x36')]:_0x407273[_0xbc01('0x32')];_0x20bcfd[_0xbc01('0x4e')]=qs[_0xbc01('0x3b')](_0x3334fe[_0xbc01('0x35')][_0xbc01('0x3b')]);_0x20bcfd['where']=qs[_0xbc01('0x34')](_[_0xbc01('0x3d')](_0x3334fe[_0xbc01('0x35')],_0x407273['filters']));if(_0x3334fe['query'][_0xbc01('0x3e')]){_0x20bcfd[_0xbc01('0x3c')]=_[_0xbc01('0x3f')](_0x20bcfd[_0xbc01('0x3c')],{'$or':_[_0xbc01('0x33')](_0x20bcfd['attributes'],function(_0x972521){var _0x1fece4={};_0x1fece4[_0x972521]={'$like':'%'+_0x3334fe[_0xbc01('0x35')]['filter']+'%'};return _0x1fece4;})});}_0x20bcfd=_[_0xbc01('0x3f')]({},_0x20bcfd,_0x3334fe[_0xbc01('0x40')]);return _0xc5d999[_0xbc01('0x51')](_0x20bcfd);}})['then'](function(_0x62974e){if(_0x62974e){_0x2ae59e=_0x62974e[_0xbc01('0x38')];if(!_0x3334fe['query'][_0xbc01('0x39')](_0xbc01('0x3a'))){_0x20bcfd[_0xbc01('0x1e')]=qs[_0xbc01('0x1e')](_0x3334fe[_0xbc01('0x35')][_0xbc01('0x1e')]);_0x20bcfd['offset']=qs[_0xbc01('0x1c')](_0x3334fe['query'][_0xbc01('0x1c')]);}return _0xc5d999[_0xbc01('0x51')](_0x20bcfd);}})[_0xbc01('0x27')](function(_0x15a4de){if(_0x15a4de){return _0x15a4de?{'count':_0x2ae59e,'rows':_0x15a4de}:null;}})[_0xbc01('0x27')](respondWithResult(_0x4fabdd,null))[_0xbc01('0x44')](handleError(_0x4fabdd,null));}; \ No newline at end of file +var _0x0955=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','options','includeAll','include','rows','catch','show','find','create','body','update','getFields','findOne','SugarcrmField','sort','getSubjects','params','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../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','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration'];(function(_0x252527,_0x195605){var _0x8b5629=function(_0x1828d4){while(--_0x1828d4){_0x252527['push'](_0x252527['shift']());}};_0x8b5629(++_0x195605);}(_0x0955,0x15c));var _0x5095=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x0955[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5095('0x0'));var jsonpatch=require(_0x5095('0x1'));var rp=require(_0x5095('0x2'));var moment=require(_0x5095('0x3'));var BPromise=require(_0x5095('0x4'));var Mustache=require(_0x5095('0x5'));var util=require(_0x5095('0x6'));var path=require('path');var sox=require(_0x5095('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5095('0x8'));var _=require(_0x5095('0x9'));var squel=require('squel');var crypto=require(_0x5095('0xa'));var jsforce=require(_0x5095('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5095('0xc'));var querystring=require('querystring');var Papa=require(_0x5095('0xd'));var Redis=require('ioredis');var authService=require(_0x5095('0xe'));var qs=require(_0x5095('0xf'));var as=require(_0x5095('0x10'));var hardwareService=require(_0x5095('0x11'));var logger=require('../../config/logger')(_0x5095('0x12'));var utils=require(_0x5095('0x13'));var config=require(_0x5095('0x14'));var licenseUtil=require(_0x5095('0x15'));var db=require(_0x5095('0x16'))['db'];function respondWithStatusCode(_0x4f5999,_0x4b67d1){_0x4b67d1=_0x4b67d1||0xcc;return function(_0x3d3fa1){if(_0x3d3fa1){return _0x4f5999['sendStatus'](_0x4b67d1);}return _0x4f5999[_0x5095('0x17')](_0x4b67d1)[_0x5095('0x18')]();};}function respondWithResult(_0x5ce95d,_0x48af22){_0x48af22=_0x48af22||0xc8;return function(_0x2187b7){if(_0x2187b7){return _0x5ce95d[_0x5095('0x17')](_0x48af22)[_0x5095('0x19')](_0x2187b7);}};}function respondWithFilteredResult(_0x3012d0,_0x3695f6){return function(_0x25d3be){if(_0x25d3be){var _0x5cab38=typeof _0x3695f6[_0x5095('0x1a')]===_0x5095('0x1b')&&typeof _0x3695f6[_0x5095('0x1c')]==='undefined';var _0x4cf83f=_0x25d3be[_0x5095('0x1d')];var _0x15f5f1=_0x5cab38?0x0:_0x3695f6[_0x5095('0x1a')];var _0x51d5ee=_0x5cab38?_0x25d3be[_0x5095('0x1d')]:_0x3695f6['offset']+_0x3695f6['limit'];var _0xab79d6;if(_0x51d5ee>=_0x4cf83f){_0x51d5ee=_0x4cf83f;_0xab79d6=0xc8;}else{_0xab79d6=0xce;}_0x3012d0[_0x5095('0x17')](_0xab79d6);return _0x3012d0['set'](_0x5095('0x1e'),_0x15f5f1+'-'+_0x51d5ee+'/'+_0x4cf83f)[_0x5095('0x19')](_0x25d3be);}return null;};}function patchUpdates(_0x1d87c4){return function(_0x263861){try{jsonpatch['apply'](_0x263861,_0x1d87c4,!![]);}catch(_0x156c28){return BPromise[_0x5095('0x1f')](_0x156c28);}return _0x263861[_0x5095('0x20')]();};}function saveUpdates(_0x9c91ed,_0x4f05bb){return function(_0x132e63){if(_0x132e63){return _0x132e63['update'](_0x9c91ed)[_0x5095('0x21')](function(_0x505d0e){return _0x505d0e;});}return null;};}function removeEntity(_0x5b9206,_0x3b058f){return function(_0x199761){if(_0x199761){return _0x199761[_0x5095('0x22')]()['then'](function(){_0x5b9206['status'](0xcc)[_0x5095('0x18')]();});}};}function handleEntityNotFound(_0x201bf0,_0xf28a8){return function(_0x277277){if(!_0x277277){_0x201bf0['sendStatus'](0x194);}return _0x277277;};}function handleError(_0x856ffb,_0x1f8b1a){_0x1f8b1a=_0x1f8b1a||0x1f4;return function(_0x366d6a){logger[_0x5095('0x23')](_0x366d6a[_0x5095('0x24')]);if(_0x366d6a[_0x5095('0x25')]){delete _0x366d6a[_0x5095('0x25')];}_0x856ffb[_0x5095('0x17')](_0x1f8b1a)[_0x5095('0x26')](_0x366d6a);};}exports[_0x5095('0x27')]=function(_0x4367d6,_0x5be8f8){var _0x232419={},_0x34ba18={},_0x1ad2a6={'count':0x0,'rows':[]};var _0x13fc25=_[_0x5095('0x28')](db[_0x5095('0x29')][_0x5095('0x2a')],function(_0x1df797){return{'name':_0x1df797[_0x5095('0x2b')],'type':_0x1df797[_0x5095('0x2c')][_0x5095('0x2d')]};});_0x34ba18[_0x5095('0x2e')]=_[_0x5095('0x28')](_0x13fc25,_0x5095('0x25'));_0x34ba18[_0x5095('0x2f')]=_[_0x5095('0x30')](_0x4367d6[_0x5095('0x2f')]);_0x34ba18[_0x5095('0x31')]=_[_0x5095('0x32')](_0x34ba18[_0x5095('0x2e')],_0x34ba18[_0x5095('0x2f')]);_0x232419[_0x5095('0x33')]=_['intersection'](_0x34ba18[_0x5095('0x2e')],qs[_0x5095('0x34')](_0x4367d6[_0x5095('0x2f')][_0x5095('0x34')]));_0x232419[_0x5095('0x33')]=_0x232419['attributes'][_0x5095('0x35')]?_0x232419[_0x5095('0x33')]:_0x34ba18[_0x5095('0x2e')];if(!_0x4367d6['query'][_0x5095('0x36')](_0x5095('0x37'))){_0x232419[_0x5095('0x1c')]=qs['limit'](_0x4367d6[_0x5095('0x2f')][_0x5095('0x1c')]);_0x232419[_0x5095('0x1a')]=qs[_0x5095('0x1a')](_0x4367d6[_0x5095('0x2f')][_0x5095('0x1a')]);}_0x232419[_0x5095('0x38')]=qs['sort'](_0x4367d6[_0x5095('0x2f')]['sort']);_0x232419['where']=qs['filters'](_[_0x5095('0x39')](_0x4367d6[_0x5095('0x2f')],_0x34ba18['filters']),_0x13fc25);if(_0x4367d6[_0x5095('0x2f')][_0x5095('0x3a')]){_0x232419['where']=_[_0x5095('0x3b')](_0x232419[_0x5095('0x3c')],{'$or':_['map'](_0x13fc25,function(_0x3ea136){if(_0x3ea136[_0x5095('0x2c')]!=='VIRTUAL'){var _0xfae66f={};_0xfae66f[_0x3ea136[_0x5095('0x25')]]={'$like':'%'+_0x4367d6[_0x5095('0x2f')][_0x5095('0x3a')]+'%'};return _0xfae66f;}})});}_0x232419=_[_0x5095('0x3b')]({},_0x232419,_0x4367d6[_0x5095('0x3d')]);var _0xb3c08f={'where':_0x232419[_0x5095('0x3c')]};return db[_0x5095('0x29')][_0x5095('0x1d')](_0xb3c08f)[_0x5095('0x21')](function(_0x3fea7f){_0x1ad2a6[_0x5095('0x1d')]=_0x3fea7f;if(_0x4367d6[_0x5095('0x2f')][_0x5095('0x3e')]){_0x232419[_0x5095('0x3f')]=[{'all':!![]}];}return db[_0x5095('0x29')]['findAll'](_0x232419);})['then'](function(_0x568e88){_0x1ad2a6[_0x5095('0x40')]=_0x568e88;return _0x1ad2a6;})['then'](respondWithFilteredResult(_0x5be8f8,_0x232419))[_0x5095('0x41')](handleError(_0x5be8f8,null));};exports[_0x5095('0x42')]=function(_0x5b822d,_0x3b2ce8){var _0x2817b8={'raw':![],'where':{'id':_0x5b822d['params']['id']}},_0x2eb7b4={};_0x2eb7b4[_0x5095('0x2e')]=_[_0x5095('0x30')](db['SugarcrmConfiguration'][_0x5095('0x2a')]);_0x2eb7b4[_0x5095('0x2f')]=_[_0x5095('0x30')](_0x5b822d[_0x5095('0x2f')]);_0x2eb7b4[_0x5095('0x31')]=_[_0x5095('0x32')](_0x2eb7b4[_0x5095('0x2e')],_0x2eb7b4[_0x5095('0x2f')]);_0x2817b8[_0x5095('0x33')]=_[_0x5095('0x32')](_0x2eb7b4[_0x5095('0x2e')],qs['fields'](_0x5b822d[_0x5095('0x2f')][_0x5095('0x34')]));_0x2817b8[_0x5095('0x33')]=_0x2817b8[_0x5095('0x33')][_0x5095('0x35')]?_0x2817b8['attributes']:_0x2eb7b4[_0x5095('0x2e')];if(_0x5b822d[_0x5095('0x2f')][_0x5095('0x3e')]){_0x2817b8['include']=[{'all':!![]}];}_0x2817b8=_['merge']({},_0x2817b8,_0x5b822d[_0x5095('0x3d')]);return db[_0x5095('0x29')][_0x5095('0x43')](_0x2817b8)[_0x5095('0x21')](handleEntityNotFound(_0x3b2ce8,null))[_0x5095('0x21')](respondWithResult(_0x3b2ce8,null))[_0x5095('0x41')](handleError(_0x3b2ce8,null));};exports[_0x5095('0x44')]=function(_0x55f68e,_0x2f8c9d){return db['SugarcrmConfiguration'][_0x5095('0x44')](_0x55f68e[_0x5095('0x45')],{})['then'](respondWithResult(_0x2f8c9d,0xc9))[_0x5095('0x41')](handleError(_0x2f8c9d,null));};exports[_0x5095('0x46')]=function(_0x404cd0,_0x1b7679){if(_0x404cd0[_0x5095('0x45')]['id']){delete _0x404cd0[_0x5095('0x45')]['id'];}return db[_0x5095('0x29')][_0x5095('0x43')]({'where':{'id':_0x404cd0['params']['id']}})[_0x5095('0x21')](handleEntityNotFound(_0x1b7679,null))[_0x5095('0x21')](saveUpdates(_0x404cd0[_0x5095('0x45')],null))[_0x5095('0x21')](respondWithResult(_0x1b7679,null))[_0x5095('0x41')](handleError(_0x1b7679,null));};exports[_0x5095('0x22')]=function(_0x47a1d9,_0x516537){return db[_0x5095('0x29')]['find']({'where':{'id':_0x47a1d9['params']['id']}})['then'](handleEntityNotFound(_0x516537,null))['then'](removeEntity(_0x516537,null))[_0x5095('0x41')](handleError(_0x516537,null));};exports[_0x5095('0x47')]=function(_0x552acb,_0x544492,_0x3c11bb){var _0xd6d917={};var _0x33d3d0={};var _0x1653f7;var _0x33be54;return db[_0x5095('0x29')][_0x5095('0x48')]({'where':{'id':_0x552acb['params']['id']}})[_0x5095('0x21')](handleEntityNotFound(_0x544492,null))[_0x5095('0x21')](function(_0x410ccf){if(_0x410ccf){_0x1653f7=_0x410ccf;_0x33d3d0[_0x5095('0x2e')]=_[_0x5095('0x30')](db[_0x5095('0x49')]['rawAttributes']);_0x33d3d0['query']=_['keys'](_0x552acb['query']);_0x33d3d0[_0x5095('0x31')]=_[_0x5095('0x32')](_0x33d3d0['model'],_0x33d3d0[_0x5095('0x2f')]);_0xd6d917['attributes']=_[_0x5095('0x32')](_0x33d3d0[_0x5095('0x2e')],qs[_0x5095('0x34')](_0x552acb[_0x5095('0x2f')][_0x5095('0x34')]));_0xd6d917[_0x5095('0x33')]=_0xd6d917[_0x5095('0x33')][_0x5095('0x35')]?_0xd6d917[_0x5095('0x33')]:_0x33d3d0[_0x5095('0x2e')];_0xd6d917[_0x5095('0x38')]=qs[_0x5095('0x4a')](_0x552acb['query'][_0x5095('0x4a')]);_0xd6d917[_0x5095('0x3c')]=qs[_0x5095('0x31')](_[_0x5095('0x39')](_0x552acb[_0x5095('0x2f')],_0x33d3d0[_0x5095('0x31')]));if(_0x552acb['query'][_0x5095('0x3a')]){_0xd6d917[_0x5095('0x3c')]=_[_0x5095('0x3b')](_0xd6d917[_0x5095('0x3c')],{'$or':_[_0x5095('0x28')](_0xd6d917[_0x5095('0x33')],function(_0x56a3f3){var _0x74dff={};_0x74dff[_0x56a3f3]={'$like':'%'+_0x552acb[_0x5095('0x2f')]['filter']+'%'};return _0x74dff;})});}_0xd6d917=_[_0x5095('0x3b')]({},_0xd6d917,_0x552acb[_0x5095('0x3d')]);return _0x1653f7['getFields'](_0xd6d917);}})[_0x5095('0x21')](function(_0x44d879){if(_0x44d879){_0x33be54=_0x44d879[_0x5095('0x35')];if(!_0x552acb[_0x5095('0x2f')][_0x5095('0x36')](_0x5095('0x37'))){_0xd6d917[_0x5095('0x1c')]=qs[_0x5095('0x1c')](_0x552acb[_0x5095('0x2f')]['limit']);_0xd6d917[_0x5095('0x1a')]=qs[_0x5095('0x1a')](_0x552acb[_0x5095('0x2f')][_0x5095('0x1a')]);}return _0x1653f7[_0x5095('0x47')](_0xd6d917);}})['then'](function(_0x228353){if(_0x228353){return _0x228353?{'count':_0x33be54,'rows':_0x228353}:null;}})['then'](respondWithResult(_0x544492,null))[_0x5095('0x41')](handleError(_0x544492,null));};exports[_0x5095('0x4b')]=function(_0x147ba5,_0x757ec6,_0x2150f4){var _0x658946={};var _0x3be69a={};var _0x189758;var _0x29c60d;return db[_0x5095('0x29')]['findOne']({'where':{'id':_0x147ba5[_0x5095('0x4c')]['id']}})['then'](handleEntityNotFound(_0x757ec6,null))[_0x5095('0x21')](function(_0x420593){if(_0x420593){_0x189758=_0x420593;_0x3be69a['model']=_['keys'](db[_0x5095('0x49')]['rawAttributes']);_0x3be69a[_0x5095('0x2f')]=_[_0x5095('0x30')](_0x147ba5[_0x5095('0x2f')]);_0x3be69a[_0x5095('0x31')]=_[_0x5095('0x32')](_0x3be69a[_0x5095('0x2e')],_0x3be69a[_0x5095('0x2f')]);_0x658946[_0x5095('0x33')]=_[_0x5095('0x32')](_0x3be69a[_0x5095('0x2e')],qs['fields'](_0x147ba5[_0x5095('0x2f')][_0x5095('0x34')]));_0x658946['attributes']=_0x658946['attributes']['length']?_0x658946[_0x5095('0x33')]:_0x3be69a[_0x5095('0x2e')];_0x658946['order']=qs[_0x5095('0x4a')](_0x147ba5[_0x5095('0x2f')][_0x5095('0x4a')]);_0x658946[_0x5095('0x3c')]=qs[_0x5095('0x31')](_[_0x5095('0x39')](_0x147ba5['query'],_0x3be69a[_0x5095('0x31')]));if(_0x147ba5[_0x5095('0x2f')][_0x5095('0x3a')]){_0x658946[_0x5095('0x3c')]=_['merge'](_0x658946[_0x5095('0x3c')],{'$or':_['map'](_0x658946[_0x5095('0x33')],function(_0x4b3417){var _0x55d64a={};_0x55d64a[_0x4b3417]={'$like':'%'+_0x147ba5['query'][_0x5095('0x3a')]+'%'};return _0x55d64a;})});}_0x658946=_[_0x5095('0x3b')]({},_0x658946,_0x147ba5['options']);return _0x189758['getSubjects'](_0x658946);}})[_0x5095('0x21')](function(_0x1fc735){if(_0x1fc735){_0x29c60d=_0x1fc735[_0x5095('0x35')];if(!_0x147ba5[_0x5095('0x2f')][_0x5095('0x36')](_0x5095('0x37'))){_0x658946[_0x5095('0x1c')]=qs[_0x5095('0x1c')](_0x147ba5[_0x5095('0x2f')][_0x5095('0x1c')]);_0x658946[_0x5095('0x1a')]=qs[_0x5095('0x1a')](_0x147ba5[_0x5095('0x2f')][_0x5095('0x1a')]);}return _0x189758[_0x5095('0x4b')](_0x658946);}})[_0x5095('0x21')](function(_0x120739){if(_0x120739){return _0x120739?{'count':_0x29c60d,'rows':_0x120739}:null;}})[_0x5095('0x21')](respondWithResult(_0x757ec6,null))[_0x5095('0x41')](handleError(_0x757ec6,null));};exports['getDescriptions']=function(_0x53b547,_0x42fece,_0x6feb41){var _0xafd710={};var _0xae5264={};var _0x37472a;var _0x554f01;return db[_0x5095('0x29')][_0x5095('0x48')]({'where':{'id':_0x53b547[_0x5095('0x4c')]['id']}})[_0x5095('0x21')](handleEntityNotFound(_0x42fece,null))[_0x5095('0x21')](function(_0x193fdf){if(_0x193fdf){_0x37472a=_0x193fdf;_0xae5264[_0x5095('0x2e')]=_[_0x5095('0x30')](db['SugarcrmField'][_0x5095('0x2a')]);_0xae5264[_0x5095('0x2f')]=_[_0x5095('0x30')](_0x53b547['query']);_0xae5264['filters']=_[_0x5095('0x32')](_0xae5264[_0x5095('0x2e')],_0xae5264[_0x5095('0x2f')]);_0xafd710[_0x5095('0x33')]=_[_0x5095('0x32')](_0xae5264[_0x5095('0x2e')],qs[_0x5095('0x34')](_0x53b547[_0x5095('0x2f')]['fields']));_0xafd710[_0x5095('0x33')]=_0xafd710[_0x5095('0x33')][_0x5095('0x35')]?_0xafd710['attributes']:_0xae5264[_0x5095('0x2e')];_0xafd710[_0x5095('0x38')]=qs[_0x5095('0x4a')](_0x53b547[_0x5095('0x2f')][_0x5095('0x4a')]);_0xafd710[_0x5095('0x3c')]=qs[_0x5095('0x31')](_['pick'](_0x53b547[_0x5095('0x2f')],_0xae5264[_0x5095('0x31')]));if(_0x53b547[_0x5095('0x2f')][_0x5095('0x3a')]){_0xafd710['where']=_[_0x5095('0x3b')](_0xafd710[_0x5095('0x3c')],{'$or':_[_0x5095('0x28')](_0xafd710[_0x5095('0x33')],function(_0x32f047){var _0x2a3ec8={};_0x2a3ec8[_0x32f047]={'$like':'%'+_0x53b547[_0x5095('0x2f')][_0x5095('0x3a')]+'%'};return _0x2a3ec8;})});}_0xafd710=_[_0x5095('0x3b')]({},_0xafd710,_0x53b547[_0x5095('0x3d')]);return _0x37472a['getDescriptions'](_0xafd710);}})[_0x5095('0x21')](function(_0xddca3d){if(_0xddca3d){_0x554f01=_0xddca3d[_0x5095('0x35')];if(!_0x53b547['query']['hasOwnProperty'](_0x5095('0x37'))){_0xafd710[_0x5095('0x1c')]=qs[_0x5095('0x1c')](_0x53b547['query'][_0x5095('0x1c')]);_0xafd710[_0x5095('0x1a')]=qs[_0x5095('0x1a')](_0x53b547[_0x5095('0x2f')][_0x5095('0x1a')]);}return _0x37472a[_0x5095('0x4d')](_0xafd710);}})['then'](function(_0x1ebc8c){if(_0x1ebc8c){return _0x1ebc8c?{'count':_0x554f01,'rows':_0x1ebc8c}:null;}})[_0x5095('0x21')](respondWithResult(_0x42fece,null))[_0x5095('0x41')](handleError(_0x42fece,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 91f36a4..b511396 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 _0x7d34=['../../config/environment','exports','define','int_sugarcrm_configurations','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x31bb29,_0x35d0d6){var _0x3ab4ae=function(_0x57ceb9){while(--_0x57ceb9){_0x31bb29['push'](_0x31bb29['shift']());}};_0x3ab4ae(++_0x35d0d6);}(_0x7d34,0x14e));var _0x47d3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7d34[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x47d3('0x0'));var logger=require('../../config/logger')(_0x47d3('0x1'));var moment=require(_0x47d3('0x2'));var BPromise=require(_0x47d3('0x3'));var rp=require(_0x47d3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47d3('0x5'));var config=require(_0x47d3('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x47d3('0x7')]=function(_0x227d71,_0x27f338){return _0x227d71[_0x47d3('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0x47d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x403b=['../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','util','api','path','rimraf'];(function(_0x21481e,_0x36f518){var _0x4e7ef8=function(_0x4e4b62){while(--_0x4e4b62){_0x21481e['push'](_0x21481e['shift']());}};_0x4e7ef8(++_0x36f518);}(_0x403b,0x1a4));var _0xb403=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x403b[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xb403('0x0'));var logger=require('../../config/logger')(_0xb403('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb403('0x2'));var rimraf=require(_0xb403('0x3'));var config=require(_0xb403('0x4'));var attributes=require(_0xb403('0x5'));module['exports']=function(_0x5a4de8,_0x25e0dd){return _0x5a4de8[_0xb403('0x6')]('SugarcrmConfiguration',attributes,{'tableName':_0xb403('0x7'),'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 43c673a..c453996 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 _0xfd2b=['../../config/logger','rpc','jayson/promise','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x28040c,_0x98746b){var _0x8f1713=function(_0x4a2eea){while(--_0x4a2eea){_0x28040c['push'](_0x28040c['shift']());}};_0x8f1713(++_0x98746b);}(_0xfd2b,0x1f1));var _0xbfd2=function(_0x33a496,_0x192c3f){_0x33a496=_0x33a496-0x0;var _0x3b22d2=_0xfd2b[_0x33a496];return _0x3b22d2;};'use strict';var _=require(_0xbfd2('0x0'));var util=require(_0xbfd2('0x1'));var moment=require(_0xbfd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfd2('0x3'));var fs=require('fs');var Redis=require(_0xbfd2('0x4'));var db=require(_0xbfd2('0x5'))['db'];var utils=require(_0xbfd2('0x6'));var logger=require(_0xbfd2('0x7'))(_0xbfd2('0x8'));var config=require('../../config/environment');var jayson=require(_0xbfd2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5b9d,_0x254a3f,_0x4cc7e3){return new BPromise(function(_0x123de2,_0x360e32){return client['request'](_0x5b5b9d,_0x4cc7e3)['then'](function(_0x37d380){logger[_0xbfd2('0xa')](_0xbfd2('0xb'),_0x254a3f,_0xbfd2('0xc'));logger[_0xbfd2('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x254a3f,_0xbfd2('0xc'),JSON['stringify'](_0x37d380));if(_0x37d380['error']){if(_0x37d380['error']['code']===0x1f4){logger[_0xbfd2('0xe')](_0xbfd2('0xb'),_0x254a3f,_0x37d380[_0xbfd2('0xe')][_0xbfd2('0xf')]);return _0x360e32(_0x37d380[_0xbfd2('0xe')][_0xbfd2('0xf')]);}logger[_0xbfd2('0xe')](_0xbfd2('0xb'),_0x254a3f,_0x37d380[_0xbfd2('0xe')][_0xbfd2('0xf')]);return _0x123de2(_0x37d380['error']['message']);}else{logger[_0xbfd2('0xa')](_0xbfd2('0xb'),_0x254a3f,'request\x20sent');_0x123de2(_0x37d380[_0xbfd2('0x10')][_0xbfd2('0xf')]);}})[_0xbfd2('0x11')](function(_0x5699e6){logger[_0xbfd2('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x254a3f,_0x5699e6);_0x360e32(_0x5699e6);});});} \ No newline at end of file +var _0x4ef7=['then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x13f5ac,_0x303066){var _0x163d97=function(_0x1c2c3e){while(--_0x1c2c3e){_0x13f5ac['push'](_0x13f5ac['shift']());}};_0x163d97(++_0x303066);}(_0x4ef7,0x127));var _0x74ef=function(_0x2670ca,_0x55c94a){_0x2670ca=_0x2670ca-0x0;var _0x50c0db=_0x4ef7[_0x2670ca];return _0x50c0db;};'use strict';var _=require(_0x74ef('0x0'));var util=require('util');var moment=require(_0x74ef('0x1'));var BPromise=require(_0x74ef('0x2'));var rs=require(_0x74ef('0x3'));var fs=require('fs');var Redis=require(_0x74ef('0x4'));var db=require(_0x74ef('0x5'))['db'];var utils=require(_0x74ef('0x6'));var logger=require(_0x74ef('0x7'))(_0x74ef('0x8'));var config=require(_0x74ef('0x9'));var jayson=require(_0x74ef('0xa'));var client=jayson[_0x74ef('0xb')][_0x74ef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4db8f4,_0x30aed1,_0x3cae86){return new BPromise(function(_0x1bbf00,_0x42a82d){return client['request'](_0x4db8f4,_0x3cae86)[_0x74ef('0xd')](function(_0x25e971){logger[_0x74ef('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x30aed1,_0x74ef('0xf'));logger[_0x74ef('0x10')](_0x74ef('0x11'),_0x30aed1,'request\x20sent',JSON[_0x74ef('0x12')](_0x25e971));if(_0x25e971[_0x74ef('0x13')]){if(_0x25e971[_0x74ef('0x13')]['code']===0x1f4){logger[_0x74ef('0x13')](_0x74ef('0x14'),_0x30aed1,_0x25e971[_0x74ef('0x13')]['message']);return _0x42a82d(_0x25e971[_0x74ef('0x13')][_0x74ef('0x15')]);}logger['error'](_0x74ef('0x14'),_0x30aed1,_0x25e971[_0x74ef('0x13')][_0x74ef('0x15')]);return _0x1bbf00(_0x25e971[_0x74ef('0x13')]['message']);}else{logger[_0x74ef('0xe')](_0x74ef('0x14'),_0x30aed1,_0x74ef('0xf'));_0x1bbf00(_0x25e971['result'][_0x74ef('0x15')]);}})['catch'](function(_0x5baf01){logger['error'](_0x74ef('0x14'),_0x30aed1,_0x5baf01);_0x42a82d(_0x5baf01);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 8609b7c..8bdb4ae 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 _0x0804=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0804,0x14d));var _0x4080=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x0804[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require(_0x4080('0x0'));var path=require(_0x4080('0x1'));var timeout=require('connect-timeout');var express=require(_0x4080('0x2'));var router=express[_0x4080('0x3')]();var fs_extra=require(_0x4080('0x4'));var auth=require(_0x4080('0x5'));var interaction=require(_0x4080('0x6'));var config=require(_0x4080('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x4080('0x8')]('/',auth[_0x4080('0x9')](),controller[_0x4080('0xa')]);router[_0x4080('0x8')](_0x4080('0xb'),auth[_0x4080('0x9')](),controller[_0x4080('0xc')]);router[_0x4080('0xd')]('/',auth['isAuthenticated'](),controller[_0x4080('0xe')]);router[_0x4080('0xf')](_0x4080('0xb'),auth[_0x4080('0x9')](),controller['update']);router[_0x4080('0x10')](_0x4080('0xb'),auth[_0x4080('0x9')](),controller[_0x4080('0x11')]);module[_0x4080('0x12')]=router; \ No newline at end of file +var _0xb574=['Router','fs-extra','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create','update','exports','multer','util','connect-timeout','express'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0xb574,0x10c));var _0x4b57=function(_0x1210b1,_0x2b867b){_0x1210b1=_0x1210b1-0x0;var _0x176d32=_0xb574[_0x1210b1];return _0x176d32;};'use strict';var multer=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var path=require('path');var timeout=require(_0x4b57('0x2'));var express=require(_0x4b57('0x3'));var router=express[_0x4b57('0x4')]();var fs_extra=require(_0x4b57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4b57('0x6'));var controller=require(_0x4b57('0x7'));router[_0x4b57('0x8')]('/',auth[_0x4b57('0x9')](),controller[_0x4b57('0xa')]);router[_0x4b57('0x8')](_0x4b57('0xb'),auth['isAuthenticated'](),controller[_0x4b57('0xc')]);router['post']('/',auth[_0x4b57('0x9')](),controller[_0x4b57('0xd')]);router['put'](_0x4b57('0xb'),auth['isAuthenticated'](),controller[_0x4b57('0xe')]);router['delete'](_0x4b57('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4b57('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 65272a5..45ca512 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 _0x5f4a=['ENUM','BOOLEAN','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3c4e9f,_0x31ccd4){var _0x26a50a=function(_0x39151d){while(--_0x39151d){_0x3c4e9f['push'](_0x3c4e9f['shift']());}};_0x26a50a(++_0x31ccd4);}(_0x5f4a,0x16a));var _0xa5f4=function(_0x2ca7dd,_0x538a53){_0x2ca7dd=_0x2ca7dd-0x0;var _0x4e58e6=_0x5f4a[_0x2ca7dd];return _0x4e58e6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xa5f4('0x0'),_0xa5f4('0x1'),_0xa5f4('0x2'),_0xa5f4('0x3'),_0xa5f4('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa5f4('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa5f4('0x6')]('string',_0xa5f4('0x1'),_0xa5f4('0x2'))},'keyContent':{'type':Sequelize[_0xa5f4('0x5')]},'idField':{'type':Sequelize[_0xa5f4('0x5')]},'nameField':{'type':Sequelize[_0xa5f4('0x5')]},'customField':{'type':Sequelize[_0xa5f4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa5f4('0x5')]}}; \ No newline at end of file +var _0xabb1=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x247029,_0xc70a75){var _0x28a33f=function(_0x4ce93c){while(--_0x4ce93c){_0x247029['push'](_0x247029['shift']());}};_0x28a33f(++_0xc70a75);}(_0xabb1,0x77));var _0x1abb=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xabb1[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require('sequelize');module[_0x1abb('0x0')]={'type':{'type':Sequelize[_0x1abb('0x1')](_0x1abb('0x2'),_0x1abb('0x3'),_0x1abb('0x4'),_0x1abb('0x5'),_0x1abb('0x6')),'defaultValue':_0x1abb('0x2')},'content':{'type':Sequelize[_0x1abb('0x7')]},'key':{'type':Sequelize[_0x1abb('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x1abb('0x2'),'variable',_0x1abb('0x4'))},'keyContent':{'type':Sequelize[_0x1abb('0x7')]},'idField':{'type':Sequelize[_0x1abb('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1abb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1abb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 390792c..514cafa 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 _0x1d58=['filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SugarcrmField','includeAll','include','findAll','then','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','index','map','rawAttributes','type','query','keys'];(function(_0x231b51,_0x214976){var _0x60bbea=function(_0x27d9a3){while(--_0x27d9a3){_0x231b51['push'](_0x231b51['shift']());}};_0x60bbea(++_0x214976);}(_0x1d58,0x137));var _0x81d5=function(_0x2c2cbe,_0x43c534){_0x2c2cbe=_0x2c2cbe-0x0;var _0x3a7444=_0x1d58[_0x2c2cbe];return _0x3a7444;};'use strict';var emlformat=require(_0x81d5('0x0'));var rimraf=require(_0x81d5('0x1'));var zipdir=require(_0x81d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81d5('0x3'));var moment=require(_0x81d5('0x4'));var BPromise=require(_0x81d5('0x5'));var Mustache=require('mustache');var util=require(_0x81d5('0x6'));var path=require(_0x81d5('0x7'));var sox=require(_0x81d5('0x8'));var csv=require(_0x81d5('0x9'));var ejs=require(_0x81d5('0xa'));var fs=require('fs');var fs_extra=require(_0x81d5('0xb'));var _=require(_0x81d5('0xc'));var squel=require(_0x81d5('0xd'));var crypto=require(_0x81d5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x81d5('0xf'));var toCsv=require(_0x81d5('0x9'));var querystring=require('querystring');var Papa=require(_0x81d5('0x10'));var Redis=require('ioredis');var authService=require(_0x81d5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81d5('0x12'));var logger=require('../../config/logger')(_0x81d5('0x13'));var utils=require(_0x81d5('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x81d5('0x15'))['db'];function respondWithStatusCode(_0x340e27,_0x2bd91e){_0x2bd91e=_0x2bd91e||0xcc;return function(_0x45ce01){if(_0x45ce01){return _0x340e27[_0x81d5('0x16')](_0x2bd91e);}return _0x340e27[_0x81d5('0x17')](_0x2bd91e)[_0x81d5('0x18')]();};}function respondWithResult(_0x4e9699,_0x25e460){_0x25e460=_0x25e460||0xc8;return function(_0x7f834d){if(_0x7f834d){return _0x4e9699['status'](_0x25e460)[_0x81d5('0x19')](_0x7f834d);}};}function respondWithFilteredResult(_0x4c49c9,_0x37110e){return function(_0x1a5eee){if(_0x1a5eee){var _0x1984ff=typeof _0x37110e[_0x81d5('0x1a')]==='undefined'&&typeof _0x37110e[_0x81d5('0x1b')]==='undefined';var _0x5cb641=_0x1a5eee[_0x81d5('0x1c')];var _0x14342d=_0x1984ff?0x0:_0x37110e[_0x81d5('0x1a')];var _0x4706a3=_0x1984ff?_0x1a5eee[_0x81d5('0x1c')]:_0x37110e['offset']+_0x37110e[_0x81d5('0x1b')];var _0x17b28b;if(_0x4706a3>=_0x5cb641){_0x4706a3=_0x5cb641;_0x17b28b=0xc8;}else{_0x17b28b=0xce;}_0x4c49c9['status'](_0x17b28b);return _0x4c49c9[_0x81d5('0x1d')](_0x81d5('0x1e'),_0x14342d+'-'+_0x4706a3+'/'+_0x5cb641)[_0x81d5('0x19')](_0x1a5eee);}return null;};}function patchUpdates(_0x416a41){return function(_0x53732e){try{jsonpatch[_0x81d5('0x1f')](_0x53732e,_0x416a41,!![]);}catch(_0x50b78b){return BPromise[_0x81d5('0x20')](_0x50b78b);}return _0x53732e[_0x81d5('0x21')]();};}function saveUpdates(_0x19aa66,_0x2e6dd1){return function(_0x2bc3be){if(_0x2bc3be){return _0x2bc3be[_0x81d5('0x22')](_0x19aa66)['then'](function(_0x473348){return _0x473348;});}return null;};}function removeEntity(_0x3c8583,_0x53f7cf){return function(_0x37cec1){if(_0x37cec1){return _0x37cec1['destroy']()['then'](function(){_0x3c8583[_0x81d5('0x17')](0xcc)[_0x81d5('0x18')]();});}};}function handleEntityNotFound(_0xc57abd,_0x30dc2a){return function(_0x11e101){if(!_0x11e101){_0xc57abd['sendStatus'](0x194);}return _0x11e101;};}function handleError(_0x8a4776,_0x7b5d64){_0x7b5d64=_0x7b5d64||0x1f4;return function(_0x1c92c8){logger[_0x81d5('0x23')](_0x1c92c8[_0x81d5('0x24')]);if(_0x1c92c8['name']){delete _0x1c92c8[_0x81d5('0x25')];}_0x8a4776[_0x81d5('0x17')](_0x7b5d64)['send'](_0x1c92c8);};}exports[_0x81d5('0x26')]=function(_0x9ba09d,_0x5bd575){var _0x2ae279={},_0x26b002={},_0x1c5829={'count':0x0,'rows':[]};var _0x284463=_[_0x81d5('0x27')](db['SugarcrmField'][_0x81d5('0x28')],function(_0x307d90){return{'name':_0x307d90['fieldName'],'type':_0x307d90[_0x81d5('0x29')]['key']};});_0x26b002['model']=_[_0x81d5('0x27')](_0x284463,'name');_0x26b002[_0x81d5('0x2a')]=_[_0x81d5('0x2b')](_0x9ba09d[_0x81d5('0x2a')]);_0x26b002[_0x81d5('0x2c')]=_['intersection'](_0x26b002[_0x81d5('0x2d')],_0x26b002['query']);_0x2ae279[_0x81d5('0x2e')]=_[_0x81d5('0x2f')](_0x26b002['model'],qs[_0x81d5('0x30')](_0x9ba09d[_0x81d5('0x2a')]['fields']));_0x2ae279[_0x81d5('0x2e')]=_0x2ae279[_0x81d5('0x2e')][_0x81d5('0x31')]?_0x2ae279[_0x81d5('0x2e')]:_0x26b002[_0x81d5('0x2d')];if(!_0x9ba09d[_0x81d5('0x2a')][_0x81d5('0x32')](_0x81d5('0x33'))){_0x2ae279['limit']=qs['limit'](_0x9ba09d[_0x81d5('0x2a')][_0x81d5('0x1b')]);_0x2ae279[_0x81d5('0x1a')]=qs['offset'](_0x9ba09d['query'][_0x81d5('0x1a')]);}_0x2ae279[_0x81d5('0x34')]=qs[_0x81d5('0x35')](_0x9ba09d['query'][_0x81d5('0x35')]);_0x2ae279[_0x81d5('0x36')]=qs['filters'](_[_0x81d5('0x37')](_0x9ba09d[_0x81d5('0x2a')],_0x26b002[_0x81d5('0x2c')]),_0x284463);if(_0x9ba09d[_0x81d5('0x2a')][_0x81d5('0x38')]){_0x2ae279[_0x81d5('0x36')]=_[_0x81d5('0x39')](_0x2ae279[_0x81d5('0x36')],{'$or':_[_0x81d5('0x27')](_0x284463,function(_0x583b4d){if(_0x583b4d['type']!==_0x81d5('0x3a')){var _0x2a11c5={};_0x2a11c5[_0x583b4d[_0x81d5('0x25')]]={'$like':'%'+_0x9ba09d[_0x81d5('0x2a')][_0x81d5('0x38')]+'%'};return _0x2a11c5;}})});}_0x2ae279=_[_0x81d5('0x39')]({},_0x2ae279,_0x9ba09d['options']);var _0x52ee37={'where':_0x2ae279['where']};return db[_0x81d5('0x3b')]['count'](_0x52ee37)['then'](function(_0x1ae456){_0x1c5829[_0x81d5('0x1c')]=_0x1ae456;if(_0x9ba09d['query'][_0x81d5('0x3c')]){_0x2ae279[_0x81d5('0x3d')]=[{'all':!![]}];}return db['SugarcrmField'][_0x81d5('0x3e')](_0x2ae279);})[_0x81d5('0x3f')](function(_0x157f97){_0x1c5829[_0x81d5('0x40')]=_0x157f97;return _0x1c5829;})[_0x81d5('0x3f')](respondWithFilteredResult(_0x5bd575,_0x2ae279))[_0x81d5('0x41')](handleError(_0x5bd575,null));};exports[_0x81d5('0x42')]=function(_0x1bfd8e,_0x129af7){var _0x3c38d2={'raw':!![],'where':{'id':_0x1bfd8e[_0x81d5('0x43')]['id']}},_0x2a9c6c={};_0x2a9c6c[_0x81d5('0x2d')]=_['keys'](db[_0x81d5('0x3b')][_0x81d5('0x28')]);_0x2a9c6c[_0x81d5('0x2a')]=_[_0x81d5('0x2b')](_0x1bfd8e['query']);_0x2a9c6c[_0x81d5('0x2c')]=_[_0x81d5('0x2f')](_0x2a9c6c[_0x81d5('0x2d')],_0x2a9c6c['query']);_0x3c38d2[_0x81d5('0x2e')]=_['intersection'](_0x2a9c6c[_0x81d5('0x2d')],qs['fields'](_0x1bfd8e[_0x81d5('0x2a')][_0x81d5('0x30')]));_0x3c38d2[_0x81d5('0x2e')]=_0x3c38d2['attributes'][_0x81d5('0x31')]?_0x3c38d2[_0x81d5('0x2e')]:_0x2a9c6c[_0x81d5('0x2d')];if(_0x1bfd8e[_0x81d5('0x2a')][_0x81d5('0x3c')]){_0x3c38d2[_0x81d5('0x3d')]=[{'all':!![]}];}_0x3c38d2=_['merge']({},_0x3c38d2,_0x1bfd8e['options']);return db[_0x81d5('0x3b')][_0x81d5('0x44')](_0x3c38d2)[_0x81d5('0x3f')](handleEntityNotFound(_0x129af7,null))[_0x81d5('0x3f')](respondWithResult(_0x129af7,null))[_0x81d5('0x41')](handleError(_0x129af7,null));};exports[_0x81d5('0x45')]=function(_0x7a8707,_0x14aefb){return db[_0x81d5('0x3b')]['create'](_0x7a8707[_0x81d5('0x46')],{})[_0x81d5('0x3f')](respondWithResult(_0x14aefb,0xc9))[_0x81d5('0x41')](handleError(_0x14aefb,null));};exports[_0x81d5('0x22')]=function(_0x575a44,_0x115fca){if(_0x575a44[_0x81d5('0x46')]['id']){delete _0x575a44[_0x81d5('0x46')]['id'];}return db[_0x81d5('0x3b')]['find']({'where':{'id':_0x575a44['params']['id']}})[_0x81d5('0x3f')](handleEntityNotFound(_0x115fca,null))['then'](saveUpdates(_0x575a44[_0x81d5('0x46')],null))[_0x81d5('0x3f')](respondWithResult(_0x115fca,null))[_0x81d5('0x41')](handleError(_0x115fca,null));};exports['destroy']=function(_0x3dcbf8,_0x13b98a){return db[_0x81d5('0x3b')][_0x81d5('0x44')]({'where':{'id':_0x3dcbf8[_0x81d5('0x43')]['id']}})[_0x81d5('0x3f')](handleEntityNotFound(_0x13b98a,null))[_0x81d5('0x3f')](removeEntity(_0x13b98a,null))[_0x81d5('0x41')](handleError(_0x13b98a,null));}; \ No newline at end of file +var _0xfca8=['desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfca8,0xcd));var _0x8fca=function(_0x1a65f0,_0x468668){_0x1a65f0=_0x1a65f0-0x0;var _0x24f151=_0xfca8[_0x1a65f0];return _0x24f151;};'use strict';var emlformat=require(_0x8fca('0x0'));var rimraf=require(_0x8fca('0x1'));var zipdir=require(_0x8fca('0x2'));var jsonpatch=require(_0x8fca('0x3'));var rp=require(_0x8fca('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8fca('0x5'));var ejs=require(_0x8fca('0x6'));var fs=require('fs');var fs_extra=require(_0x8fca('0x7'));var _=require('lodash');var squel=require(_0x8fca('0x8'));var crypto=require(_0x8fca('0x9'));var jsforce=require(_0x8fca('0xa'));var deskjs=require(_0x8fca('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8fca('0xc'));var Papa=require('papaparse');var Redis=require(_0x8fca('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x8fca('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fca('0xf'));var logger=require(_0x8fca('0x10'))(_0x8fca('0x11'));var utils=require(_0x8fca('0x12'));var config=require(_0x8fca('0x13'));var licenseUtil=require(_0x8fca('0x14'));var db=require(_0x8fca('0x15'))['db'];function respondWithStatusCode(_0x54a258,_0x113b56){_0x113b56=_0x113b56||0xcc;return function(_0x175e2d){if(_0x175e2d){return _0x54a258[_0x8fca('0x16')](_0x113b56);}return _0x54a258[_0x8fca('0x17')](_0x113b56)[_0x8fca('0x18')]();};}function respondWithResult(_0x20f732,_0x530cf2){_0x530cf2=_0x530cf2||0xc8;return function(_0x348516){if(_0x348516){return _0x20f732['status'](_0x530cf2)[_0x8fca('0x19')](_0x348516);}};}function respondWithFilteredResult(_0x417d48,_0x35ef2c){return function(_0x119135){if(_0x119135){var _0x16c951=typeof _0x35ef2c[_0x8fca('0x1a')]===_0x8fca('0x1b')&&typeof _0x35ef2c['limit']==='undefined';var _0x4cfc17=_0x119135[_0x8fca('0x1c')];var _0x50ce9d=_0x16c951?0x0:_0x35ef2c[_0x8fca('0x1a')];var _0x41bce0=_0x16c951?_0x119135[_0x8fca('0x1c')]:_0x35ef2c[_0x8fca('0x1a')]+_0x35ef2c[_0x8fca('0x1d')];var _0x4a463b;if(_0x41bce0>=_0x4cfc17){_0x41bce0=_0x4cfc17;_0x4a463b=0xc8;}else{_0x4a463b=0xce;}_0x417d48[_0x8fca('0x17')](_0x4a463b);return _0x417d48[_0x8fca('0x1e')](_0x8fca('0x1f'),_0x50ce9d+'-'+_0x41bce0+'/'+_0x4cfc17)['json'](_0x119135);}return null;};}function patchUpdates(_0xe9135b){return function(_0x332c77){try{jsonpatch['apply'](_0x332c77,_0xe9135b,!![]);}catch(_0x33f3ff){return BPromise[_0x8fca('0x20')](_0x33f3ff);}return _0x332c77['save']();};}function saveUpdates(_0x55aa81,_0x1addd2){return function(_0x11ef67){if(_0x11ef67){return _0x11ef67[_0x8fca('0x21')](_0x55aa81)[_0x8fca('0x22')](function(_0x110503){return _0x110503;});}return null;};}function removeEntity(_0x4fd98a,_0x11c3c0){return function(_0x435a8b){if(_0x435a8b){return _0x435a8b['destroy']()[_0x8fca('0x22')](function(){_0x4fd98a[_0x8fca('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x321418,_0x20419e){return function(_0x5233c1){if(!_0x5233c1){_0x321418[_0x8fca('0x16')](0x194);}return _0x5233c1;};}function handleError(_0x59d9ff,_0x5c861d){_0x5c861d=_0x5c861d||0x1f4;return function(_0x1ca893){logger[_0x8fca('0x23')](_0x1ca893[_0x8fca('0x24')]);if(_0x1ca893[_0x8fca('0x25')]){delete _0x1ca893[_0x8fca('0x25')];}_0x59d9ff[_0x8fca('0x17')](_0x5c861d)[_0x8fca('0x26')](_0x1ca893);};}exports[_0x8fca('0x27')]=function(_0x5eeae5,_0x268631){var _0x49eb6f={},_0x53e279={},_0x5330ec={'count':0x0,'rows':[]};var _0x358806=_[_0x8fca('0x28')](db[_0x8fca('0x29')][_0x8fca('0x2a')],function(_0x4f407b){return{'name':_0x4f407b[_0x8fca('0x2b')],'type':_0x4f407b['type'][_0x8fca('0x2c')]};});_0x53e279[_0x8fca('0x2d')]=_[_0x8fca('0x28')](_0x358806,_0x8fca('0x25'));_0x53e279['query']=_[_0x8fca('0x2e')](_0x5eeae5[_0x8fca('0x2f')]);_0x53e279['filters']=_[_0x8fca('0x30')](_0x53e279['model'],_0x53e279[_0x8fca('0x2f')]);_0x49eb6f[_0x8fca('0x31')]=_[_0x8fca('0x30')](_0x53e279['model'],qs[_0x8fca('0x32')](_0x5eeae5['query'][_0x8fca('0x32')]));_0x49eb6f[_0x8fca('0x31')]=_0x49eb6f[_0x8fca('0x31')][_0x8fca('0x33')]?_0x49eb6f[_0x8fca('0x31')]:_0x53e279[_0x8fca('0x2d')];if(!_0x5eeae5[_0x8fca('0x2f')][_0x8fca('0x34')](_0x8fca('0x35'))){_0x49eb6f[_0x8fca('0x1d')]=qs[_0x8fca('0x1d')](_0x5eeae5[_0x8fca('0x2f')][_0x8fca('0x1d')]);_0x49eb6f[_0x8fca('0x1a')]=qs[_0x8fca('0x1a')](_0x5eeae5[_0x8fca('0x2f')][_0x8fca('0x1a')]);}_0x49eb6f['order']=qs['sort'](_0x5eeae5[_0x8fca('0x2f')][_0x8fca('0x36')]);_0x49eb6f[_0x8fca('0x37')]=qs[_0x8fca('0x38')](_[_0x8fca('0x39')](_0x5eeae5[_0x8fca('0x2f')],_0x53e279[_0x8fca('0x38')]),_0x358806);if(_0x5eeae5[_0x8fca('0x2f')][_0x8fca('0x3a')]){_0x49eb6f[_0x8fca('0x37')]=_[_0x8fca('0x3b')](_0x49eb6f[_0x8fca('0x37')],{'$or':_[_0x8fca('0x28')](_0x358806,function(_0xceaf){if(_0xceaf['type']!==_0x8fca('0x3c')){var _0x2fb383={};_0x2fb383[_0xceaf[_0x8fca('0x25')]]={'$like':'%'+_0x5eeae5['query'][_0x8fca('0x3a')]+'%'};return _0x2fb383;}})});}_0x49eb6f=_[_0x8fca('0x3b')]({},_0x49eb6f,_0x5eeae5['options']);var _0x37a84f={'where':_0x49eb6f[_0x8fca('0x37')]};return db['SugarcrmField'][_0x8fca('0x1c')](_0x37a84f)[_0x8fca('0x22')](function(_0x97faea){_0x5330ec[_0x8fca('0x1c')]=_0x97faea;if(_0x5eeae5[_0x8fca('0x2f')][_0x8fca('0x3d')]){_0x49eb6f[_0x8fca('0x3e')]=[{'all':!![]}];}return db[_0x8fca('0x29')][_0x8fca('0x3f')](_0x49eb6f);})['then'](function(_0x128485){_0x5330ec[_0x8fca('0x40')]=_0x128485;return _0x5330ec;})[_0x8fca('0x22')](respondWithFilteredResult(_0x268631,_0x49eb6f))[_0x8fca('0x41')](handleError(_0x268631,null));};exports[_0x8fca('0x42')]=function(_0x3078fc,_0x3f979b){var _0x305111={'raw':!![],'where':{'id':_0x3078fc[_0x8fca('0x43')]['id']}},_0x3daae8={};_0x3daae8[_0x8fca('0x2d')]=_[_0x8fca('0x2e')](db[_0x8fca('0x29')][_0x8fca('0x2a')]);_0x3daae8[_0x8fca('0x2f')]=_[_0x8fca('0x2e')](_0x3078fc['query']);_0x3daae8['filters']=_['intersection'](_0x3daae8[_0x8fca('0x2d')],_0x3daae8['query']);_0x305111['attributes']=_['intersection'](_0x3daae8[_0x8fca('0x2d')],qs[_0x8fca('0x32')](_0x3078fc[_0x8fca('0x2f')][_0x8fca('0x32')]));_0x305111[_0x8fca('0x31')]=_0x305111[_0x8fca('0x31')][_0x8fca('0x33')]?_0x305111[_0x8fca('0x31')]:_0x3daae8['model'];if(_0x3078fc[_0x8fca('0x2f')][_0x8fca('0x3d')]){_0x305111[_0x8fca('0x3e')]=[{'all':!![]}];}_0x305111=_[_0x8fca('0x3b')]({},_0x305111,_0x3078fc[_0x8fca('0x44')]);return db[_0x8fca('0x29')][_0x8fca('0x45')](_0x305111)[_0x8fca('0x22')](handleEntityNotFound(_0x3f979b,null))['then'](respondWithResult(_0x3f979b,null))[_0x8fca('0x41')](handleError(_0x3f979b,null));};exports[_0x8fca('0x46')]=function(_0x431486,_0x1c840a){return db[_0x8fca('0x29')][_0x8fca('0x46')](_0x431486[_0x8fca('0x47')],{})[_0x8fca('0x22')](respondWithResult(_0x1c840a,0xc9))[_0x8fca('0x41')](handleError(_0x1c840a,null));};exports[_0x8fca('0x21')]=function(_0x1ca96d,_0x30ffdf){if(_0x1ca96d[_0x8fca('0x47')]['id']){delete _0x1ca96d[_0x8fca('0x47')]['id'];}return db[_0x8fca('0x29')]['find']({'where':{'id':_0x1ca96d['params']['id']}})['then'](handleEntityNotFound(_0x30ffdf,null))[_0x8fca('0x22')](saveUpdates(_0x1ca96d[_0x8fca('0x47')],null))[_0x8fca('0x22')](respondWithResult(_0x30ffdf,null))['catch'](handleError(_0x30ffdf,null));};exports['destroy']=function(_0x2c7703,_0x174c5f){return db['SugarcrmField'][_0x8fca('0x45')]({'where':{'id':_0x2c7703[_0x8fca('0x43')]['id']}})['then'](handleEntityNotFound(_0x174c5f,null))[_0x8fca('0x22')](removeEntity(_0x174c5f,null))['catch'](handleError(_0x174c5f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5eb20b5..34bc2f9 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 _0x61c9=['idField','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x2e0967,_0x594fb9){var _0x21aa40=function(_0x515be0){while(--_0x515be0){_0x2e0967['push'](_0x2e0967['shift']());}};_0x21aa40(++_0x594fb9);}(_0x61c9,0x177));var _0x961c=function(_0x4b47fa,_0x5816d1){_0x4b47fa=_0x4b47fa-0x0;var _0x49fb27=_0x61c9[_0x4b47fa];return _0x49fb27;};'use strict';var _=require('lodash');var util=require(_0x961c('0x0'));var logger=require(_0x961c('0x1'))(_0x961c('0x2'));var moment=require(_0x961c('0x3'));var BPromise=require('bluebird');var rp=require(_0x961c('0x4'));var fs=require('fs');var path=require(_0x961c('0x5'));var rimraf=require('rimraf');var config=require(_0x961c('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x961c('0x7')]=function(_0x310afb,_0x3036e6){return _0x310afb['define']('SugarcrmField',attributes,{'tableName':_0x961c('0x8'),'paranoid':![],'indexes':[{'name':_0x961c('0x9'),'fields':[_0x961c('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8486=['idField','FieldId','util','../../config/logger','api','moment','./intSugarcrmField.attributes','define','SugarcrmField','sugarcrm_unique_index'];(function(_0x2603d5,_0x211fda){var _0x58d434=function(_0x5b9567){while(--_0x5b9567){_0x2603d5['push'](_0x2603d5['shift']());}};_0x58d434(++_0x211fda);}(_0x8486,0x1e2));var _0x6848=function(_0x24c245,_0x5e590b){_0x24c245=_0x24c245-0x0;var _0x732cd5=_0x8486[_0x24c245];return _0x732cd5;};'use strict';var _=require('lodash');var util=require(_0x6848('0x0'));var logger=require(_0x6848('0x1'))(_0x6848('0x2'));var moment=require(_0x6848('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('../../config/environment');var attributes=require(_0x6848('0x4'));module['exports']=function(_0x8bac4b,_0xa3466a){return _0x8bac4b[_0x6848('0x5')](_0x6848('0x6'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x6848('0x7'),'fields':[_0x6848('0x8'),_0x6848('0x9')],'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 c11994f..914ef3e 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 _0xa56f=['rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3b791a,_0x400f19){var _0x154c99=function(_0x2f0c02){while(--_0x2f0c02){_0x3b791a['push'](_0x3b791a['shift']());}};_0x154c99(++_0x400f19);}(_0xa56f,0xf7));var _0xfa56=function(_0xdf238a,_0x511bfd){_0xdf238a=_0xdf238a-0x0;var _0x367f11=_0xa56f[_0xdf238a];return _0x367f11;};'use strict';var _=require(_0xfa56('0x0'));var util=require(_0xfa56('0x1'));var moment=require(_0xfa56('0x2'));var BPromise=require(_0xfa56('0x3'));var rs=require(_0xfa56('0x4'));var fs=require('fs');var Redis=require(_0xfa56('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfa56('0x6'));var config=require(_0xfa56('0x7'));var jayson=require(_0xfa56('0x8'));var client=jayson[_0xfa56('0x9')][_0xfa56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58cc8e,_0x2589b2,_0x22a9c2){return new BPromise(function(_0x5aa48f,_0x5c652f){return client[_0xfa56('0xb')](_0x58cc8e,_0x22a9c2)['then'](function(_0x3afe08){logger[_0xfa56('0xc')](_0xfa56('0xd'),_0x2589b2,_0xfa56('0xe'));logger[_0xfa56('0xf')](_0xfa56('0x10'),_0x2589b2,_0xfa56('0xe'),JSON[_0xfa56('0x11')](_0x3afe08));if(_0x3afe08[_0xfa56('0x12')]){if(_0x3afe08[_0xfa56('0x12')][_0xfa56('0x13')]===0x1f4){logger[_0xfa56('0x12')](_0xfa56('0xd'),_0x2589b2,_0x3afe08[_0xfa56('0x12')][_0xfa56('0x14')]);return _0x5c652f(_0x3afe08[_0xfa56('0x12')][_0xfa56('0x14')]);}logger[_0xfa56('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x2589b2,_0x3afe08[_0xfa56('0x12')][_0xfa56('0x14')]);return _0x5aa48f(_0x3afe08[_0xfa56('0x12')]['message']);}else{logger[_0xfa56('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x2589b2,_0xfa56('0xe'));_0x5aa48f(_0x3afe08[_0xfa56('0x15')][_0xfa56('0x14')]);}})[_0xfa56('0x16')](function(_0x2533ec){logger['error'](_0xfa56('0xd'),_0x2589b2,_0x2533ec);_0x5c652f(_0x2533ec);});});} \ No newline at end of file +var _0x86c0=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment'];(function(_0x262baa,_0x283058){var _0x4f2257=function(_0x2cd1c6){while(--_0x2cd1c6){_0x262baa['push'](_0x262baa['shift']());}};_0x4f2257(++_0x283058);}(_0x86c0,0x141));var _0x086c=function(_0x1f4511,_0x2cb089){_0x1f4511=_0x1f4511-0x0;var _0x141939=_0x86c0[_0x1f4511];return _0x141939;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require(_0x086c('0x1'));var BPromise=require(_0x086c('0x2'));var rs=require(_0x086c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x086c('0x4'))['db'];var utils=require(_0x086c('0x5'));var logger=require('../../config/logger')(_0x086c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x086c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4579ed,_0x101626,_0x5bcc7e){return new BPromise(function(_0x257de5,_0x59cb0d){return client[_0x086c('0x8')](_0x4579ed,_0x5bcc7e)['then'](function(_0x17b129){logger[_0x086c('0x9')](_0x086c('0xa'),_0x101626,_0x086c('0xb'));logger[_0x086c('0xc')](_0x086c('0xd'),_0x101626,'request\x20sent',JSON['stringify'](_0x17b129));if(_0x17b129['error']){if(_0x17b129['error'][_0x086c('0xe')]===0x1f4){logger[_0x086c('0xf')](_0x086c('0xa'),_0x101626,_0x17b129[_0x086c('0xf')][_0x086c('0x10')]);return _0x59cb0d(_0x17b129[_0x086c('0xf')][_0x086c('0x10')]);}logger[_0x086c('0xf')](_0x086c('0xa'),_0x101626,_0x17b129[_0x086c('0xf')][_0x086c('0x10')]);return _0x257de5(_0x17b129[_0x086c('0xf')][_0x086c('0x10')]);}else{logger[_0x086c('0x9')](_0x086c('0xa'),_0x101626,'request\x20sent');_0x257de5(_0x17b129[_0x086c('0x11')]['message']);}})[_0x086c('0x12')](function(_0x1515a4){logger[_0x086c('0xf')](_0x086c('0xa'),_0x101626,_0x1515a4);_0x59cb0d(_0x1515a4);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 168a050..e9b763b 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 _0xc3d8=['getFields','post','create','put','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x5c2b1f,_0x266443){var _0x55d367=function(_0xeb5790){while(--_0xeb5790){_0x5c2b1f['push'](_0x5c2b1f['shift']());}};_0x55d367(++_0x266443);}(_0xc3d8,0x70));var _0x8c3d=function(_0x508cf8,_0x4e70d1){_0x508cf8=_0x508cf8-0x0;var _0x27434e=_0xc3d8[_0x508cf8];return _0x27434e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8c3d('0x0'));var timeout=require(_0x8c3d('0x1'));var express=require('express');var router=express[_0x8c3d('0x2')]();var fs_extra=require(_0x8c3d('0x3'));var auth=require(_0x8c3d('0x4'));var interaction=require(_0x8c3d('0x5'));var config=require(_0x8c3d('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x8c3d('0x7')]('/',auth[_0x8c3d('0x8')](),controller[_0x8c3d('0x9')]);router[_0x8c3d('0x7')](_0x8c3d('0xa'),auth[_0x8c3d('0x8')](),controller['show']);router[_0x8c3d('0x7')](_0x8c3d('0xb'),auth[_0x8c3d('0x8')](),controller[_0x8c3d('0xc')]);router['get'](_0x8c3d('0xd'),auth[_0x8c3d('0x8')](),controller[_0x8c3d('0xe')]);router[_0x8c3d('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c3d('0x10')]);router['post'](_0x8c3d('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8c3d('0x11')](_0x8c3d('0xa'),auth[_0x8c3d('0x8')](),controller[_0x8c3d('0x12')]);router[_0x8c3d('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8c3d('0x14')]=router; \ No newline at end of file +var _0x6315=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x6315,0x65));var _0x5631=function(_0x49e56b,_0x466665){_0x49e56b=_0x49e56b-0x0;var _0x2e776f=_0x6315[_0x49e56b];return _0x2e776f;};'use strict';var multer=require('multer');var util=require(_0x5631('0x0'));var path=require(_0x5631('0x1'));var timeout=require(_0x5631('0x2'));var express=require(_0x5631('0x3'));var router=express[_0x5631('0x4')]();var fs_extra=require(_0x5631('0x5'));var auth=require(_0x5631('0x6'));var interaction=require(_0x5631('0x7'));var config=require(_0x5631('0x8'));var controller=require(_0x5631('0x9'));router[_0x5631('0xa')]('/',auth['isAuthenticated'](),controller[_0x5631('0xb')]);router[_0x5631('0xa')]('/:id',auth[_0x5631('0xc')](),controller[_0x5631('0xd')]);router[_0x5631('0xa')](_0x5631('0xe'),auth[_0x5631('0xc')](),controller[_0x5631('0xf')]);router['get'](_0x5631('0x10'),auth['isAuthenticated'](),controller[_0x5631('0x11')]);router[_0x5631('0x12')]('/',auth[_0x5631('0xc')](),controller[_0x5631('0x13')]);router['post'](_0x5631('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5631('0x14')](_0x5631('0x15'),auth[_0x5631('0xc')](),controller[_0x5631('0x16')]);router[_0x5631('0x17')](_0x5631('0x15'),auth['isAuthenticated'](),controller[_0x5631('0x18')]);module[_0x5631('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f52c32d..a60ab9b 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 _0x374d=['sequelize','exports','STRING','HelpDesk'];(function(_0x3173c3,_0x43a716){var _0x288cf1=function(_0x518926){while(--_0x518926){_0x3173c3['push'](_0x3173c3['shift']());}};_0x288cf1(++_0x43a716);}(_0x374d,0x124));var _0xd374=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x374d[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0xd374('0x0'));module[_0xd374('0x1')]={'name':{'type':Sequelize[_0xd374('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd374('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd374('0x2')],'allowNull':![],'defaultValue':_0xd374('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd374('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdf69=['STRING','HelpDesk','sequelize','exports'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xdf69,0x6a));var _0x9df6=function(_0x41f0b6,_0x1c0e9a){_0x41f0b6=_0x41f0b6-0x0;var _0x5741f2=_0xdf69[_0x41f0b6];return _0x5741f2;};'use strict';var Sequelize=require(_0x9df6('0x0'));module[_0x9df6('0x1')]={'name':{'type':Sequelize[_0x9df6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9df6('0x2')]},'username':{'type':Sequelize[_0x9df6('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9df6('0x2')],'allowNull':![],'defaultValue':_0x9df6('0x3')},'remoteUri':{'type':Sequelize[_0x9df6('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9df6('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 8dd82e7..32b4181 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 _0x62db=['sessionName','autogenerated','reference','remove','includes','editable','false','label','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','VtigerAccount','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','findOne','length','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerConfiguration','VtigerField','md5','username','description','moduleName','serverUrl','accessKey','slice','substring','lastIndexOf','format','getchallenge','success','POST','login','result','token','GET','describe'];(function(_0x7fd1de,_0xe40950){var _0x562dbc=function(_0x36fcb7){while(--_0x36fcb7){_0x7fd1de['push'](_0x7fd1de['shift']());}};_0x562dbc(++_0xe40950);}(_0x62db,0x8e));var _0xb62d=function(_0xc73bb6,_0x3f0157){_0xc73bb6=_0xc73bb6-0x0;var _0x5e270b=_0x62db[_0xc73bb6];return _0x5e270b;};'use strict';var emlformat=require(_0xb62d('0x0'));var rimraf=require(_0xb62d('0x1'));var zipdir=require(_0xb62d('0x2'));var jsonpatch=require(_0xb62d('0x3'));var rp=require('request-promise');var moment=require(_0xb62d('0x4'));var BPromise=require(_0xb62d('0x5'));var Mustache=require(_0xb62d('0x6'));var util=require(_0xb62d('0x7'));var path=require('path');var sox=require(_0xb62d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb62d('0x9'));var squel=require(_0xb62d('0xa'));var crypto=require(_0xb62d('0xb'));var jsforce=require(_0xb62d('0xc'));var deskjs=require(_0xb62d('0xd'));var toCsv=require(_0xb62d('0xe'));var querystring=require(_0xb62d('0xf'));var Papa=require(_0xb62d('0x10'));var Redis=require('ioredis');var authService=require(_0xb62d('0x11'));var qs=require(_0xb62d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb62d('0x13'));var logger=require(_0xb62d('0x14'))(_0xb62d('0x15'));var utils=require(_0xb62d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb62d('0x17'));var db=require(_0xb62d('0x18'))['db'];var integrations=require(_0xb62d('0x19'));function respondWithStatusCode(_0xb907af,_0x3b399c){_0x3b399c=_0x3b399c||0xcc;return function(_0x1c2691){if(_0x1c2691){return _0xb907af['sendStatus'](_0x3b399c);}return _0xb907af['status'](_0x3b399c)[_0xb62d('0x1a')]();};}function respondWithResult(_0x38709d,_0x5a188c){_0x5a188c=_0x5a188c||0xc8;return function(_0x280f62){if(_0x280f62){return _0x38709d[_0xb62d('0x1b')](_0x5a188c)['json'](_0x280f62);}};}function respondWithFilteredResult(_0x150731,_0x12d934){return function(_0x6fd76f){if(_0x6fd76f){var _0x4329e0=typeof _0x12d934[_0xb62d('0x1c')]===_0xb62d('0x1d')&&typeof _0x12d934[_0xb62d('0x1e')]==='undefined';var _0x473a26=_0x6fd76f[_0xb62d('0x1f')];var _0x2a4f21=_0x4329e0?0x0:_0x12d934[_0xb62d('0x1c')];var _0x480036=_0x4329e0?_0x6fd76f[_0xb62d('0x1f')]:_0x12d934[_0xb62d('0x1c')]+_0x12d934[_0xb62d('0x1e')];var _0x2d83f8;if(_0x480036>=_0x473a26){_0x480036=_0x473a26;_0x2d83f8=0xc8;}else{_0x2d83f8=0xce;}_0x150731[_0xb62d('0x1b')](_0x2d83f8);return _0x150731[_0xb62d('0x20')](_0xb62d('0x21'),_0x2a4f21+'-'+_0x480036+'/'+_0x473a26)['json'](_0x6fd76f);}return null;};}function patchUpdates(_0x1c4198){return function(_0x5418fe){try{jsonpatch[_0xb62d('0x22')](_0x5418fe,_0x1c4198,!![]);}catch(_0x1ea8d3){return BPromise[_0xb62d('0x23')](_0x1ea8d3);}return _0x5418fe[_0xb62d('0x24')]();};}function saveUpdates(_0x2c526d,_0x7bb84){return function(_0x55daff){if(_0x55daff){return _0x55daff[_0xb62d('0x25')](_0x2c526d)[_0xb62d('0x26')](function(_0x1e7256){return _0x1e7256;});}return null;};}function removeEntity(_0x411b78,_0x44395b){return function(_0x612c5c){if(_0x612c5c){return _0x612c5c[_0xb62d('0x27')]()[_0xb62d('0x26')](function(){_0x411b78[_0xb62d('0x1b')](0xcc)[_0xb62d('0x1a')]();});}};}function handleEntityNotFound(_0x12c2dc,_0x50df66){return function(_0x1ba55c){if(!_0x1ba55c){_0x12c2dc[_0xb62d('0x28')](0x194);}return _0x1ba55c;};}function handleError(_0x104706,_0x4af15d){_0x4af15d=_0x4af15d||0x1f4;return function(_0x5087d8){logger[_0xb62d('0x29')](_0x5087d8[_0xb62d('0x2a')]);if(_0x5087d8[_0xb62d('0x2b')]){delete _0x5087d8[_0xb62d('0x2b')];}_0x104706[_0xb62d('0x1b')](_0x4af15d)[_0xb62d('0x2c')](_0x5087d8);};}exports[_0xb62d('0x2d')]=function(_0xbecf42,_0x258107){var _0x20d1c5={},_0x2f88a9={},_0x1cb451={'count':0x0,'rows':[]};var _0x3eb96c=_[_0xb62d('0x2e')](db['VtigerAccount'][_0xb62d('0x2f')],function(_0x237bce){return{'name':_0x237bce[_0xb62d('0x30')],'type':_0x237bce['type'][_0xb62d('0x31')]};});_0x2f88a9[_0xb62d('0x32')]=_[_0xb62d('0x2e')](_0x3eb96c,_0xb62d('0x2b'));_0x2f88a9[_0xb62d('0x33')]=_[_0xb62d('0x34')](_0xbecf42[_0xb62d('0x33')]);_0x2f88a9[_0xb62d('0x35')]=_[_0xb62d('0x36')](_0x2f88a9[_0xb62d('0x32')],_0x2f88a9[_0xb62d('0x33')]);_0x20d1c5[_0xb62d('0x37')]=_[_0xb62d('0x36')](_0x2f88a9[_0xb62d('0x32')],qs[_0xb62d('0x38')](_0xbecf42[_0xb62d('0x33')][_0xb62d('0x38')]));_0x20d1c5[_0xb62d('0x37')]=_0x20d1c5[_0xb62d('0x37')]['length']?_0x20d1c5[_0xb62d('0x37')]:_0x2f88a9[_0xb62d('0x32')];if(!_0xbecf42[_0xb62d('0x33')][_0xb62d('0x39')](_0xb62d('0x3a'))){_0x20d1c5[_0xb62d('0x1e')]=qs[_0xb62d('0x1e')](_0xbecf42['query'][_0xb62d('0x1e')]);_0x20d1c5[_0xb62d('0x1c')]=qs['offset'](_0xbecf42[_0xb62d('0x33')][_0xb62d('0x1c')]);}_0x20d1c5[_0xb62d('0x3b')]=qs['sort'](_0xbecf42[_0xb62d('0x33')][_0xb62d('0x3c')]);_0x20d1c5[_0xb62d('0x3d')]=qs[_0xb62d('0x35')](_['pick'](_0xbecf42['query'],_0x2f88a9['filters']),_0x3eb96c);if(_0xbecf42[_0xb62d('0x33')][_0xb62d('0x3e')]){_0x20d1c5[_0xb62d('0x3d')]=_[_0xb62d('0x3f')](_0x20d1c5[_0xb62d('0x3d')],{'$or':_[_0xb62d('0x2e')](_0x3eb96c,function(_0x3700eb){if(_0x3700eb[_0xb62d('0x40')]!=='VIRTUAL'){var _0x3d7a40={};_0x3d7a40[_0x3700eb[_0xb62d('0x2b')]]={'$like':'%'+_0xbecf42[_0xb62d('0x33')][_0xb62d('0x3e')]+'%'};return _0x3d7a40;}})});}_0x20d1c5=_[_0xb62d('0x3f')]({},_0x20d1c5,_0xbecf42[_0xb62d('0x41')]);var _0x9f6d98={'where':_0x20d1c5['where']};return db[_0xb62d('0x42')][_0xb62d('0x1f')](_0x9f6d98)[_0xb62d('0x26')](function(_0x495fd8){_0x1cb451[_0xb62d('0x1f')]=_0x495fd8;if(_0xbecf42[_0xb62d('0x33')][_0xb62d('0x43')]){_0x20d1c5[_0xb62d('0x44')]=[{'all':!![]}];}return db[_0xb62d('0x42')][_0xb62d('0x45')](_0x20d1c5);})[_0xb62d('0x26')](function(_0x185819){_0x1cb451['rows']=_0x185819;return _0x1cb451;})[_0xb62d('0x26')](respondWithFilteredResult(_0x258107,_0x20d1c5))[_0xb62d('0x46')](handleError(_0x258107,null));};exports[_0xb62d('0x47')]=function(_0xa44723,_0x1936f0){var _0x57a476={'raw':![],'where':{'id':_0xa44723[_0xb62d('0x48')]['id']}},_0x2b6c12={};_0x2b6c12[_0xb62d('0x32')]=_['keys'](db['VtigerAccount'][_0xb62d('0x2f')]);_0x2b6c12[_0xb62d('0x33')]=_[_0xb62d('0x34')](_0xa44723[_0xb62d('0x33')]);_0x2b6c12[_0xb62d('0x35')]=_['intersection'](_0x2b6c12[_0xb62d('0x32')],_0x2b6c12[_0xb62d('0x33')]);_0x57a476[_0xb62d('0x37')]=_['intersection'](_0x2b6c12['model'],qs[_0xb62d('0x38')](_0xa44723['query'][_0xb62d('0x38')]));_0x57a476[_0xb62d('0x37')]=_0x57a476[_0xb62d('0x37')]['length']?_0x57a476[_0xb62d('0x37')]:_0x2b6c12[_0xb62d('0x32')];if(_0xa44723[_0xb62d('0x33')][_0xb62d('0x43')]){_0x57a476[_0xb62d('0x44')]=[{'all':!![]}];}_0x57a476=_[_0xb62d('0x3f')]({},_0x57a476,_0xa44723[_0xb62d('0x41')]);return db[_0xb62d('0x42')][_0xb62d('0x49')](_0x57a476)[_0xb62d('0x26')](handleEntityNotFound(_0x1936f0,null))[_0xb62d('0x26')](respondWithResult(_0x1936f0,null))[_0xb62d('0x46')](handleError(_0x1936f0,null));};exports[_0xb62d('0x4a')]=function(_0x3e5049,_0x1bfcda){return db[_0xb62d('0x42')][_0xb62d('0x4a')](_0x3e5049[_0xb62d('0x4b')],{})[_0xb62d('0x26')](respondWithResult(_0x1bfcda,0xc9))[_0xb62d('0x46')](handleError(_0x1bfcda,null));};exports['update']=function(_0x32cdbd,_0xac38ae){if(_0x32cdbd['body']['id']){delete _0x32cdbd[_0xb62d('0x4b')]['id'];}return db[_0xb62d('0x42')][_0xb62d('0x49')]({'where':{'id':_0x32cdbd[_0xb62d('0x48')]['id']}})[_0xb62d('0x26')](handleEntityNotFound(_0xac38ae,null))[_0xb62d('0x26')](saveUpdates(_0x32cdbd['body'],null))[_0xb62d('0x26')](respondWithResult(_0xac38ae,null))[_0xb62d('0x46')](handleError(_0xac38ae,null));};exports[_0xb62d('0x27')]=function(_0x46785b,_0x15f5f3){return db[_0xb62d('0x42')][_0xb62d('0x49')]({'where':{'id':_0x46785b['params']['id']}})['then'](handleEntityNotFound(_0x15f5f3,null))[_0xb62d('0x26')](removeEntity(_0x15f5f3,null))['catch'](handleError(_0x15f5f3,null));};exports[_0xb62d('0x4c')]=function(_0x1b7109,_0x5dbbfe,_0x13f6de){var _0x4b9528={};var _0x43b004={};var _0x5cec6a;var _0x2268f1;return db['VtigerAccount'][_0xb62d('0x4d')]({'where':{'id':_0x1b7109[_0xb62d('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dbbfe,null))['then'](function(_0x3a1143){if(_0x3a1143){_0x5cec6a=_0x3a1143;_0x43b004[_0xb62d('0x32')]=_[_0xb62d('0x34')](db['VtigerConfiguration'][_0xb62d('0x2f')]);_0x43b004[_0xb62d('0x33')]=_[_0xb62d('0x34')](_0x1b7109[_0xb62d('0x33')]);_0x43b004['filters']=_[_0xb62d('0x36')](_0x43b004[_0xb62d('0x32')],_0x43b004[_0xb62d('0x33')]);_0x4b9528[_0xb62d('0x37')]=_[_0xb62d('0x36')](_0x43b004[_0xb62d('0x32')],qs[_0xb62d('0x38')](_0x1b7109['query'][_0xb62d('0x38')]));_0x4b9528[_0xb62d('0x37')]=_0x4b9528[_0xb62d('0x37')][_0xb62d('0x4e')]?_0x4b9528['attributes']:_0x43b004[_0xb62d('0x32')];_0x4b9528[_0xb62d('0x3b')]=qs[_0xb62d('0x3c')](_0x1b7109[_0xb62d('0x33')][_0xb62d('0x3c')]);_0x4b9528[_0xb62d('0x3d')]=qs[_0xb62d('0x35')](_[_0xb62d('0x4f')](_0x1b7109[_0xb62d('0x33')],_0x43b004[_0xb62d('0x35')]));if(_0x1b7109[_0xb62d('0x33')][_0xb62d('0x3e')]){_0x4b9528['where']=_['merge'](_0x4b9528[_0xb62d('0x3d')],{'$or':_[_0xb62d('0x2e')](_0x4b9528['attributes'],function(_0xda9c7){var _0x344a83={};_0x344a83[_0xda9c7]={'$like':'%'+_0x1b7109['query'][_0xb62d('0x3e')]+'%'};return _0x344a83;})});}_0x4b9528=_['merge']({},_0x4b9528,_0x1b7109[_0xb62d('0x41')]);return _0x5cec6a[_0xb62d('0x4c')](_0x4b9528);}})[_0xb62d('0x26')](function(_0x48c7f2){if(_0x48c7f2){_0x2268f1=_0x48c7f2['length'];if(!_0x1b7109[_0xb62d('0x33')]['hasOwnProperty'](_0xb62d('0x3a'))){_0x4b9528[_0xb62d('0x1e')]=qs[_0xb62d('0x1e')](_0x1b7109['query'][_0xb62d('0x1e')]);_0x4b9528[_0xb62d('0x1c')]=qs[_0xb62d('0x1c')](_0x1b7109[_0xb62d('0x33')][_0xb62d('0x1c')]);}return _0x5cec6a[_0xb62d('0x4c')](_0x4b9528);}})[_0xb62d('0x26')](function(_0x564251){if(_0x564251){return _0x564251?{'count':_0x2268f1,'rows':_0x564251}:null;}})[_0xb62d('0x26')](respondWithResult(_0x5dbbfe,null))[_0xb62d('0x46')](handleError(_0x5dbbfe,null));};exports[_0xb62d('0x50')]=function(_0x53b4e7,_0x5e7f70,_0x432b26){if(_0x53b4e7[_0xb62d('0x4b')]['id']){delete _0x53b4e7[_0xb62d('0x4b')]['id'];}return db[_0xb62d('0x42')][_0xb62d('0x4d')]({'where':{'id':_0x53b4e7[_0xb62d('0x48')]['id']}})[_0xb62d('0x26')](handleEntityNotFound(_0x5e7f70,null))[_0xb62d('0x26')](function(_0x1e036f){if(_0x1e036f){_0x53b4e7[_0xb62d('0x4b')][_0xb62d('0x51')]=_0x1e036f['id'];_0x53b4e7[_0xb62d('0x4b')][_0xb62d('0x52')]=integrations[_0xb62d('0x53')](_0x53b4e7[_0xb62d('0x4b')][_0xb62d('0x54')],_0x53b4e7[_0xb62d('0x4b')][_0xb62d('0x40')]);_0x53b4e7[_0xb62d('0x4b')][_0xb62d('0x55')]=integrations['getDescriptions'](_0x53b4e7['body']['channel'],_0x53b4e7[_0xb62d('0x4b')]['type']);return db[_0xb62d('0x56')][_0xb62d('0x4a')](_0x53b4e7[_0xb62d('0x4b')],{'include':[{'model':db[_0xb62d('0x57')],'as':'Subjects'},{'model':db[_0xb62d('0x57')],'as':_0xb62d('0x55')}]});}return null;})['then'](respondWithResult(_0x5e7f70,null))[_0xb62d('0x46')](handleError(_0x5e7f70,null));};var md5=require(_0xb62d('0x58'));exports['getFields']=function(_0x101069,_0x1e30eb,_0x31978e){var _0x41dfe3=null;var _0x4179de=null;var _0x18f74d=null;var _0x1891f0=null;var _0x353182='';return db[_0xb62d('0x42')][_0xb62d('0x4d')]({'where':{'id':_0x101069['params']['id']},'attributes':['id',_0xb62d('0x2b'),_0xb62d('0x59'),_0xb62d('0x5a'),_0xb62d('0x5b'),'remoteUri',_0xb62d('0x5c'),_0xb62d('0x5d')]})[_0xb62d('0x26')](handleEntityNotFound(_0x1e30eb,null))[_0xb62d('0x26')](function(_0x5cb09e){if(_0x5cb09e){_0x41dfe3=_0x5cb09e['username'];_0x4179de=_0x5cb09e['accessKey'];_0x18f74d=_0x5cb09e[_0xb62d('0x5b')];_0x353182=_0x5cb09e['remoteUri'];var _0x58c6b3=_0x353182[_0xb62d('0x5e')](-0x1);if(_0x58c6b3==='/'){_0x353182=_0x353182[_0xb62d('0x5f')](0x0,_0x353182[_0xb62d('0x60')](_0x58c6b3));}_0x1891f0=util[_0xb62d('0x61')]('%s/webservice.php',_0x353182);var _0xfbf583={'method':'GET','uri':_0x1891f0,'qs':{'operation':_0xb62d('0x62'),'username':_0x5cb09e['username']},'json':!![]};return rp(_0xfbf583);}})['then'](function(_0x4cb159){if(_0x4cb159[_0xb62d('0x63')]){var _0xdfb4ea={'method':_0xb62d('0x64'),'uri':_0x1891f0,'form':{'operation':_0xb62d('0x65'),'username':_0x41dfe3,'accessKey':md5(_0x4cb159[_0xb62d('0x66')][_0xb62d('0x67')]+_0x4179de)},'json':!![]};return rp(_0xdfb4ea);}})[_0xb62d('0x26')](function(_0x52f991){if(_0x52f991[_0xb62d('0x63')]){var _0x12dfcf={'method':_0xb62d('0x68'),'uri':_0x1891f0,'qs':{'operation':_0xb62d('0x69'),'username':_0x41dfe3,'sessionName':_0x52f991['result'][_0xb62d('0x6a')],'elementType':_0x18f74d},'json':!![]};return rp(_0x12dfcf);}})['then'](function(_0x114a99){if(_0x114a99[_0xb62d('0x63')]){var _0x4595b5=[_0xb62d('0x6b'),_0xb62d('0x6c'),'owner'];_[_0xb62d('0x6d')](_0x114a99[_0xb62d('0x66')]['fields'],function(_0x4243cf){return _0x4595b5[_0xb62d('0x6e')](_0x4243cf[_0xb62d('0x40')][_0xb62d('0x2b')]);});_['remove'](_0x114a99[_0xb62d('0x66')]['fields'],function(_0x3110f1){return _0x3110f1[_0xb62d('0x6f')]===_0xb62d('0x70');});return{'count':_0x114a99[_0xb62d('0x66')][_0xb62d('0x38')]['length'],'rows':_[_0xb62d('0x2e')](_0x114a99[_0xb62d('0x66')]['fields'],function(_0x5e1b49){return{'id':_0x5e1b49[_0xb62d('0x2b')],'name':_0x5e1b49[_0xb62d('0x71')],'custom':_['startsWith'](_0x5e1b49[_0xb62d('0x2b')],'cf_')?!![]:![],'options':_0x5e1b49[_0xb62d('0x40')][_0xb62d('0x2b')]===_0xb62d('0x72')&&_0x5e1b49[_0xb62d('0x40')][_0xb62d('0x73')][_0xb62d('0x4e')]>0x0?_[_0xb62d('0x2e')](_0x5e1b49[_0xb62d('0x40')]['picklistValues'],function(_0x424125){return{'name':_0x424125[_0xb62d('0x71')],'value':_0x424125[_0xb62d('0x74')]};}):[]};})};}})[_0xb62d('0x26')](respondWithResult(_0x1e30eb,null))[_0xb62d('0x46')](function(_0x407929){console['log'](_0xb62d('0x75')+_0x407929);var _0x3ff327=_0x101069['query'][_0xb62d('0x76')]?0x1f4:_0x407929[_0xb62d('0x77')]||0x1f4;logger[_0xb62d('0x29')](_0xb62d('0x78'),_0xb62d('0x79'),_0x3ff327,JSON[_0xb62d('0x7a')](_0x407929));delete _0x407929[_0xb62d('0x2b')];if(_0x3ff327===0x191){_0x3ff327=0x190;}_0x1e30eb[_0xb62d('0x1b')](_0x3ff327)[_0xb62d('0x2c')](_0x101069[_0xb62d('0x33')][_0xb62d('0x76')]?{'message':_0xb62d('0x7b'),'statusCode':_0x407929[_0xb62d('0x77')]}:_0x407929);});}; \ No newline at end of file +var _0x9fa3=['getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','success','login','result','token','describe','sessionName','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','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','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','then','rows','catch','show','include','find','create','body','params','getConfigurations','VtigerConfiguration','pick','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5'];(function(_0x2b6fd0,_0x2a62a7){var _0x16dda3=function(_0x4b875c){while(--_0x4b875c){_0x2b6fd0['push'](_0x2b6fd0['shift']());}};_0x16dda3(++_0x2a62a7);}(_0x9fa3,0x18d));var _0x39fa=function(_0x3c2034,_0x95bd2){_0x3c2034=_0x3c2034-0x0;var _0x1406f8=_0x9fa3[_0x3c2034];return _0x1406f8;};'use strict';var emlformat=require(_0x39fa('0x0'));var rimraf=require(_0x39fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x39fa('0x2'));var rp=require(_0x39fa('0x3'));var moment=require(_0x39fa('0x4'));var BPromise=require(_0x39fa('0x5'));var Mustache=require(_0x39fa('0x6'));var util=require(_0x39fa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x39fa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39fa('0x9'));var _=require('lodash');var squel=require(_0x39fa('0xa'));var crypto=require(_0x39fa('0xb'));var jsforce=require(_0x39fa('0xc'));var deskjs=require(_0x39fa('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x39fa('0xe'));var authService=require(_0x39fa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x39fa('0x10'));var hardwareService=require(_0x39fa('0x11'));var logger=require(_0x39fa('0x12'))(_0x39fa('0x13'));var utils=require(_0x39fa('0x14'));var config=require(_0x39fa('0x15'));var licenseUtil=require(_0x39fa('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3c793a,_0x3ce817){_0x3ce817=_0x3ce817||0xcc;return function(_0x402c48){if(_0x402c48){return _0x3c793a[_0x39fa('0x17')](_0x3ce817);}return _0x3c793a[_0x39fa('0x18')](_0x3ce817)[_0x39fa('0x19')]();};}function respondWithResult(_0x63b24f,_0x3c8fc2){_0x3c8fc2=_0x3c8fc2||0xc8;return function(_0x1ef1a7){if(_0x1ef1a7){return _0x63b24f[_0x39fa('0x18')](_0x3c8fc2)[_0x39fa('0x1a')](_0x1ef1a7);}};}function respondWithFilteredResult(_0x326976,_0x477d74){return function(_0x136102){if(_0x136102){var _0x3e1b99=typeof _0x477d74['offset']==='undefined'&&typeof _0x477d74[_0x39fa('0x1b')]===_0x39fa('0x1c');var _0x492efb=_0x136102[_0x39fa('0x1d')];var _0x80cff1=_0x3e1b99?0x0:_0x477d74['offset'];var _0x157d1a=_0x3e1b99?_0x136102[_0x39fa('0x1d')]:_0x477d74['offset']+_0x477d74['limit'];var _0x45fb08;if(_0x157d1a>=_0x492efb){_0x157d1a=_0x492efb;_0x45fb08=0xc8;}else{_0x45fb08=0xce;}_0x326976[_0x39fa('0x18')](_0x45fb08);return _0x326976[_0x39fa('0x1e')](_0x39fa('0x1f'),_0x80cff1+'-'+_0x157d1a+'/'+_0x492efb)[_0x39fa('0x1a')](_0x136102);}return null;};}function patchUpdates(_0x3f1c27){return function(_0x401961){try{jsonpatch[_0x39fa('0x20')](_0x401961,_0x3f1c27,!![]);}catch(_0x3be94e){return BPromise[_0x39fa('0x21')](_0x3be94e);}return _0x401961[_0x39fa('0x22')]();};}function saveUpdates(_0x3987b3,_0x361f18){return function(_0x20f5ec){if(_0x20f5ec){return _0x20f5ec['update'](_0x3987b3)['then'](function(_0x1f0e93){return _0x1f0e93;});}return null;};}function removeEntity(_0x5dd727,_0x1e22bf){return function(_0x231f78){if(_0x231f78){return _0x231f78[_0x39fa('0x23')]()['then'](function(){_0x5dd727[_0x39fa('0x18')](0xcc)[_0x39fa('0x19')]();});}};}function handleEntityNotFound(_0x314fa8,_0x5b8995){return function(_0x13fedf){if(!_0x13fedf){_0x314fa8[_0x39fa('0x17')](0x194);}return _0x13fedf;};}function handleError(_0x27ca19,_0x145d87){_0x145d87=_0x145d87||0x1f4;return function(_0x5d718d){logger['error'](_0x5d718d[_0x39fa('0x24')]);if(_0x5d718d[_0x39fa('0x25')]){delete _0x5d718d[_0x39fa('0x25')];}_0x27ca19[_0x39fa('0x18')](_0x145d87)[_0x39fa('0x26')](_0x5d718d);};}exports[_0x39fa('0x27')]=function(_0x239249,_0x2545ee){var _0x4f8c44={},_0x5bc0d9={},_0x38e97a={'count':0x0,'rows':[]};var _0x4ec054=_[_0x39fa('0x28')](db[_0x39fa('0x29')][_0x39fa('0x2a')],function(_0x12a883){return{'name':_0x12a883[_0x39fa('0x2b')],'type':_0x12a883['type'][_0x39fa('0x2c')]};});_0x5bc0d9[_0x39fa('0x2d')]=_[_0x39fa('0x28')](_0x4ec054,_0x39fa('0x25'));_0x5bc0d9[_0x39fa('0x2e')]=_[_0x39fa('0x2f')](_0x239249[_0x39fa('0x2e')]);_0x5bc0d9[_0x39fa('0x30')]=_[_0x39fa('0x31')](_0x5bc0d9[_0x39fa('0x2d')],_0x5bc0d9[_0x39fa('0x2e')]);_0x4f8c44[_0x39fa('0x32')]=_[_0x39fa('0x31')](_0x5bc0d9['model'],qs['fields'](_0x239249[_0x39fa('0x2e')][_0x39fa('0x33')]));_0x4f8c44[_0x39fa('0x32')]=_0x4f8c44['attributes'][_0x39fa('0x34')]?_0x4f8c44[_0x39fa('0x32')]:_0x5bc0d9[_0x39fa('0x2d')];if(!_0x239249['query'][_0x39fa('0x35')](_0x39fa('0x36'))){_0x4f8c44[_0x39fa('0x1b')]=qs[_0x39fa('0x1b')](_0x239249[_0x39fa('0x2e')][_0x39fa('0x1b')]);_0x4f8c44[_0x39fa('0x37')]=qs['offset'](_0x239249[_0x39fa('0x2e')]['offset']);}_0x4f8c44[_0x39fa('0x38')]=qs[_0x39fa('0x39')](_0x239249[_0x39fa('0x2e')][_0x39fa('0x39')]);_0x4f8c44[_0x39fa('0x3a')]=qs[_0x39fa('0x30')](_['pick'](_0x239249[_0x39fa('0x2e')],_0x5bc0d9[_0x39fa('0x30')]),_0x4ec054);if(_0x239249[_0x39fa('0x2e')][_0x39fa('0x3b')]){_0x4f8c44['where']=_[_0x39fa('0x3c')](_0x4f8c44[_0x39fa('0x3a')],{'$or':_['map'](_0x4ec054,function(_0x11c3e5){if(_0x11c3e5[_0x39fa('0x3d')]!==_0x39fa('0x3e')){var _0x1a0f98={};_0x1a0f98[_0x11c3e5['name']]={'$like':'%'+_0x239249[_0x39fa('0x2e')][_0x39fa('0x3b')]+'%'};return _0x1a0f98;}})});}_0x4f8c44=_[_0x39fa('0x3c')]({},_0x4f8c44,_0x239249[_0x39fa('0x3f')]);var _0x43ab95={'where':_0x4f8c44[_0x39fa('0x3a')]};return db['VtigerAccount'][_0x39fa('0x1d')](_0x43ab95)['then'](function(_0xae757a){_0x38e97a[_0x39fa('0x1d')]=_0xae757a;if(_0x239249['query'][_0x39fa('0x40')]){_0x4f8c44['include']=[{'all':!![]}];}return db[_0x39fa('0x29')][_0x39fa('0x41')](_0x4f8c44);})[_0x39fa('0x42')](function(_0x13950e){_0x38e97a[_0x39fa('0x43')]=_0x13950e;return _0x38e97a;})['then'](respondWithFilteredResult(_0x2545ee,_0x4f8c44))[_0x39fa('0x44')](handleError(_0x2545ee,null));};exports[_0x39fa('0x45')]=function(_0x472a69,_0x27b72e){var _0x368bf1={'raw':![],'where':{'id':_0x472a69['params']['id']}},_0x4acf19={};_0x4acf19['model']=_['keys'](db[_0x39fa('0x29')][_0x39fa('0x2a')]);_0x4acf19['query']=_[_0x39fa('0x2f')](_0x472a69['query']);_0x4acf19[_0x39fa('0x30')]=_[_0x39fa('0x31')](_0x4acf19[_0x39fa('0x2d')],_0x4acf19[_0x39fa('0x2e')]);_0x368bf1['attributes']=_[_0x39fa('0x31')](_0x4acf19['model'],qs[_0x39fa('0x33')](_0x472a69[_0x39fa('0x2e')]['fields']));_0x368bf1['attributes']=_0x368bf1[_0x39fa('0x32')][_0x39fa('0x34')]?_0x368bf1[_0x39fa('0x32')]:_0x4acf19[_0x39fa('0x2d')];if(_0x472a69[_0x39fa('0x2e')][_0x39fa('0x40')]){_0x368bf1[_0x39fa('0x46')]=[{'all':!![]}];}_0x368bf1=_[_0x39fa('0x3c')]({},_0x368bf1,_0x472a69[_0x39fa('0x3f')]);return db[_0x39fa('0x29')][_0x39fa('0x47')](_0x368bf1)[_0x39fa('0x42')](handleEntityNotFound(_0x27b72e,null))[_0x39fa('0x42')](respondWithResult(_0x27b72e,null))[_0x39fa('0x44')](handleError(_0x27b72e,null));};exports[_0x39fa('0x48')]=function(_0x5d47be,_0x682879){return db[_0x39fa('0x29')][_0x39fa('0x48')](_0x5d47be['body'],{})[_0x39fa('0x42')](respondWithResult(_0x682879,0xc9))['catch'](handleError(_0x682879,null));};exports['update']=function(_0x43eff9,_0x4119e1){if(_0x43eff9[_0x39fa('0x49')]['id']){delete _0x43eff9[_0x39fa('0x49')]['id'];}return db[_0x39fa('0x29')]['find']({'where':{'id':_0x43eff9[_0x39fa('0x4a')]['id']}})[_0x39fa('0x42')](handleEntityNotFound(_0x4119e1,null))[_0x39fa('0x42')](saveUpdates(_0x43eff9[_0x39fa('0x49')],null))[_0x39fa('0x42')](respondWithResult(_0x4119e1,null))[_0x39fa('0x44')](handleError(_0x4119e1,null));};exports[_0x39fa('0x23')]=function(_0x1ebef8,_0xc84f13){return db[_0x39fa('0x29')][_0x39fa('0x47')]({'where':{'id':_0x1ebef8[_0x39fa('0x4a')]['id']}})['then'](handleEntityNotFound(_0xc84f13,null))['then'](removeEntity(_0xc84f13,null))['catch'](handleError(_0xc84f13,null));};exports[_0x39fa('0x4b')]=function(_0x5909eb,_0x535fc9,_0x1ba4eb){var _0x5a4ee9={};var _0x1d7f7c={};var _0x427d6b;var _0x252736;return db[_0x39fa('0x29')]['findOne']({'where':{'id':_0x5909eb[_0x39fa('0x4a')]['id']}})[_0x39fa('0x42')](handleEntityNotFound(_0x535fc9,null))[_0x39fa('0x42')](function(_0x5f2d42){if(_0x5f2d42){_0x427d6b=_0x5f2d42;_0x1d7f7c[_0x39fa('0x2d')]=_[_0x39fa('0x2f')](db[_0x39fa('0x4c')][_0x39fa('0x2a')]);_0x1d7f7c[_0x39fa('0x2e')]=_[_0x39fa('0x2f')](_0x5909eb[_0x39fa('0x2e')]);_0x1d7f7c[_0x39fa('0x30')]=_['intersection'](_0x1d7f7c[_0x39fa('0x2d')],_0x1d7f7c['query']);_0x5a4ee9[_0x39fa('0x32')]=_[_0x39fa('0x31')](_0x1d7f7c['model'],qs[_0x39fa('0x33')](_0x5909eb[_0x39fa('0x2e')][_0x39fa('0x33')]));_0x5a4ee9[_0x39fa('0x32')]=_0x5a4ee9['attributes'][_0x39fa('0x34')]?_0x5a4ee9[_0x39fa('0x32')]:_0x1d7f7c[_0x39fa('0x2d')];_0x5a4ee9[_0x39fa('0x38')]=qs[_0x39fa('0x39')](_0x5909eb[_0x39fa('0x2e')][_0x39fa('0x39')]);_0x5a4ee9['where']=qs['filters'](_[_0x39fa('0x4d')](_0x5909eb['query'],_0x1d7f7c['filters']));if(_0x5909eb['query']['filter']){_0x5a4ee9[_0x39fa('0x3a')]=_['merge'](_0x5a4ee9['where'],{'$or':_[_0x39fa('0x28')](_0x5a4ee9[_0x39fa('0x32')],function(_0x5273e1){var _0x432b07={};_0x432b07[_0x5273e1]={'$like':'%'+_0x5909eb[_0x39fa('0x2e')][_0x39fa('0x3b')]+'%'};return _0x432b07;})});}_0x5a4ee9=_[_0x39fa('0x3c')]({},_0x5a4ee9,_0x5909eb[_0x39fa('0x3f')]);return _0x427d6b[_0x39fa('0x4b')](_0x5a4ee9);}})[_0x39fa('0x42')](function(_0xe97c2d){if(_0xe97c2d){_0x252736=_0xe97c2d['length'];if(!_0x5909eb['query'][_0x39fa('0x35')](_0x39fa('0x36'))){_0x5a4ee9['limit']=qs[_0x39fa('0x1b')](_0x5909eb[_0x39fa('0x2e')]['limit']);_0x5a4ee9[_0x39fa('0x37')]=qs[_0x39fa('0x37')](_0x5909eb['query']['offset']);}return _0x427d6b['getConfigurations'](_0x5a4ee9);}})[_0x39fa('0x42')](function(_0xd05f86){if(_0xd05f86){return _0xd05f86?{'count':_0x252736,'rows':_0xd05f86}:null;}})[_0x39fa('0x42')](respondWithResult(_0x535fc9,null))[_0x39fa('0x44')](handleError(_0x535fc9,null));};exports[_0x39fa('0x4e')]=function(_0x43e662,_0x4303ce,_0x4744c3){if(_0x43e662['body']['id']){delete _0x43e662[_0x39fa('0x49')]['id'];}return db[_0x39fa('0x29')][_0x39fa('0x4f')]({'where':{'id':_0x43e662[_0x39fa('0x4a')]['id']}})[_0x39fa('0x42')](handleEntityNotFound(_0x4303ce,null))['then'](function(_0x5c8029){if(_0x5c8029){_0x43e662['body']['AccountId']=_0x5c8029['id'];_0x43e662[_0x39fa('0x49')][_0x39fa('0x50')]=integrations[_0x39fa('0x51')](_0x43e662[_0x39fa('0x49')][_0x39fa('0x52')],_0x43e662['body'][_0x39fa('0x3d')]);_0x43e662[_0x39fa('0x49')]['Descriptions']=integrations[_0x39fa('0x53')](_0x43e662[_0x39fa('0x49')][_0x39fa('0x52')],_0x43e662[_0x39fa('0x49')][_0x39fa('0x3d')]);return db['VtigerConfiguration']['create'](_0x43e662[_0x39fa('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x39fa('0x50')},{'model':db[_0x39fa('0x54')],'as':_0x39fa('0x55')}]});}return null;})[_0x39fa('0x42')](respondWithResult(_0x4303ce,null))[_0x39fa('0x44')](handleError(_0x4303ce,null));};var md5=require(_0x39fa('0x56'));exports[_0x39fa('0x57')]=function(_0xa1a1c8,_0x10bec4,_0x539636){var _0x46ba8c=null;var _0x47839d=null;var _0x43e285=null;var _0x400990=null;var _0x83d84b='';return db[_0x39fa('0x29')][_0x39fa('0x4f')]({'where':{'id':_0xa1a1c8['params']['id']},'attributes':['id',_0x39fa('0x25'),_0x39fa('0x58'),_0x39fa('0x59'),_0x39fa('0x5a'),_0x39fa('0x5b'),_0x39fa('0x5c'),_0x39fa('0x5d')]})[_0x39fa('0x42')](handleEntityNotFound(_0x10bec4,null))[_0x39fa('0x42')](function(_0x2ddecc){if(_0x2ddecc){_0x46ba8c=_0x2ddecc['username'];_0x47839d=_0x2ddecc[_0x39fa('0x5d')];_0x43e285=_0x2ddecc['moduleName'];_0x83d84b=_0x2ddecc[_0x39fa('0x5b')];var _0x57c1fb=_0x83d84b[_0x39fa('0x5e')](-0x1);if(_0x57c1fb==='/'){_0x83d84b=_0x83d84b[_0x39fa('0x5f')](0x0,_0x83d84b[_0x39fa('0x60')](_0x57c1fb));}_0x400990=util[_0x39fa('0x61')]('%s/webservice.php',_0x83d84b);var _0x2ae48a={'method':'GET','uri':_0x400990,'qs':{'operation':'getchallenge','username':_0x2ddecc[_0x39fa('0x58')]},'json':!![]};return rp(_0x2ae48a);}})[_0x39fa('0x42')](function(_0x1a5acc){if(_0x1a5acc[_0x39fa('0x62')]){var _0x18471d={'method':'POST','uri':_0x400990,'form':{'operation':_0x39fa('0x63'),'username':_0x46ba8c,'accessKey':md5(_0x1a5acc[_0x39fa('0x64')][_0x39fa('0x65')]+_0x47839d)},'json':!![]};return rp(_0x18471d);}})[_0x39fa('0x42')](function(_0x32aff7){if(_0x32aff7['success']){var _0x275a2d={'method':'GET','uri':_0x400990,'qs':{'operation':_0x39fa('0x66'),'username':_0x46ba8c,'sessionName':_0x32aff7[_0x39fa('0x64')][_0x39fa('0x67')],'elementType':_0x43e285},'json':!![]};return rp(_0x275a2d);}})[_0x39fa('0x42')](function(_0x3e72c9){if(_0x3e72c9[_0x39fa('0x62')]){var _0xf0274a=['autogenerated',_0x39fa('0x68'),_0x39fa('0x69')];_[_0x39fa('0x6a')](_0x3e72c9[_0x39fa('0x64')][_0x39fa('0x33')],function(_0x1d85ad){return _0xf0274a[_0x39fa('0x6b')](_0x1d85ad[_0x39fa('0x3d')][_0x39fa('0x25')]);});_['remove'](_0x3e72c9[_0x39fa('0x64')][_0x39fa('0x33')],function(_0x842407){return _0x842407[_0x39fa('0x6c')]===_0x39fa('0x6d');});return{'count':_0x3e72c9[_0x39fa('0x64')]['fields'][_0x39fa('0x34')],'rows':_[_0x39fa('0x28')](_0x3e72c9['result'][_0x39fa('0x33')],function(_0x185e50){return{'id':_0x185e50[_0x39fa('0x25')],'name':_0x185e50[_0x39fa('0x6e')],'custom':_[_0x39fa('0x6f')](_0x185e50[_0x39fa('0x25')],_0x39fa('0x70'))?!![]:![],'options':_0x185e50['type'][_0x39fa('0x25')]==='picklist'&&_0x185e50[_0x39fa('0x3d')][_0x39fa('0x71')][_0x39fa('0x34')]>0x0?_[_0x39fa('0x28')](_0x185e50['type']['picklistValues'],function(_0x41e297){return{'name':_0x41e297[_0x39fa('0x6e')],'value':_0x41e297[_0x39fa('0x72')]};}):[]};})};}})[_0x39fa('0x42')](respondWithResult(_0x10bec4,null))[_0x39fa('0x44')](function(_0x43bdde){console['log'](_0x39fa('0x73')+_0x43bdde);var _0x4cdff1=_0xa1a1c8[_0x39fa('0x2e')][_0x39fa('0x74')]?0x1f4:_0x43bdde[_0x39fa('0x75')]||0x1f4;logger['error'](_0x39fa('0x76'),'getFields',_0x4cdff1,JSON[_0x39fa('0x77')](_0x43bdde));delete _0x43bdde['name'];if(_0x4cdff1===0x191){_0x4cdff1=0x190;}_0x10bec4[_0x39fa('0x18')](_0x4cdff1)['send'](_0xa1a1c8[_0x39fa('0x2e')][_0x39fa('0x74')]?{'message':_0x39fa('0x78'),'statusCode':_0x43bdde[_0x39fa('0x75')]}:_0x43bdde);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 91b6929..d93ba5e 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 _0xa2ae=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x5dfa0e,_0x534a91){var _0x3cb5d9=function(_0x8c0325){while(--_0x8c0325){_0x5dfa0e['push'](_0x5dfa0e['shift']());}};_0x3cb5d9(++_0x534a91);}(_0xa2ae,0x191));var _0xea2a=function(_0x2157ab,_0x379b9d){_0x2157ab=_0x2157ab-0x0;var _0x4d1011=_0xa2ae[_0x2157ab];return _0x4d1011;};'use strict';var _=require(_0xea2a('0x0'));var util=require(_0xea2a('0x1'));var logger=require(_0xea2a('0x2'))(_0xea2a('0x3'));var moment=require(_0xea2a('0x4'));var BPromise=require(_0xea2a('0x5'));var rp=require(_0xea2a('0x6'));var fs=require('fs');var path=require(_0xea2a('0x7'));var rimraf=require(_0xea2a('0x8'));var config=require(_0xea2a('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xea2a('0xa'));module[_0xea2a('0xb')]=function(_0x3b7a45,_0x2c80cd){return _0x3b7a45[_0xea2a('0xc')](_0xea2a('0xd'),attributes,{'tableName':_0xea2a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x703b=['../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes'];(function(_0x233b2a,_0xf0270){var _0xb41055=function(_0x4fc3c6){while(--_0x4fc3c6){_0x233b2a['push'](_0x233b2a['shift']());}};_0xb41055(++_0xf0270);}(_0x703b,0xd5));var _0xb703=function(_0x5dafad,_0x592aae){_0x5dafad=_0x5dafad-0x0;var _0x238068=_0x703b[_0x5dafad];return _0x238068;};'use strict';var _=require(_0xb703('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb703('0x1'));var moment=require(_0xb703('0x2'));var BPromise=require(_0xb703('0x3'));var rp=require(_0xb703('0x4'));var fs=require('fs');var path=require(_0xb703('0x5'));var rimraf=require('rimraf');var config=require(_0xb703('0x6'));var attributes=require(_0xb703('0x7'));var integrations=require(_0xb703('0x8'));module[_0xb703('0x9')]=function(_0x2aca56,_0x1a271e){return _0x2aca56[_0xb703('0xa')](_0xb703('0xb'),attributes,{'tableName':_0xb703('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index b44aa91..c095bd5 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 _0xb688=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','GetVtigerAccount','stringify','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb688,0xcf));var _0x8b68=function(_0xe6c6f6,_0x5d27ee){_0xe6c6f6=_0xe6c6f6-0x0;var _0x3bb6d2=_0xb688[_0xe6c6f6];return _0x3bb6d2;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});}exports['GetVtigerAccount']=function(_0xd17693){var _0x203dd4=this;return new Promise(function(_0x4a68c7,_0x42b3bd){return db[_0x8b68('0x17')][_0x8b68('0x18')]({'raw':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1a')]||null:null,'attributes':_0xd17693[_0x8b68('0x19')]?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'limit':_0xd17693['options']?_0xd17693['options'][_0x8b68('0x1c')]||null:null,'include':_0xd17693['options']?_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0xd17693[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x173524){return{'model':db[_0x173524['model']],'as':_0x173524['as'],'attributes':_0x173524[_0x8b68('0x1b')],'include':_0x173524[_0x8b68('0x1d')]?_['map'](_0x173524[_0x8b68('0x1d')],function(_0x3cf8d2){return{'model':db[_0x3cf8d2[_0x8b68('0x1f')]],'as':_0x3cf8d2['as'],'attributes':_0x3cf8d2['attributes'],'include':_0x3cf8d2['include']?_['map'](_0x3cf8d2[_0x8b68('0x1d')],function(_0x448e43){return{'model':db[_0x448e43[_0x8b68('0x1f')]],'as':_0x448e43['as'],'attributes':_0x448e43['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x53aaa2){logger['info'](_0x8b68('0x20'),_0xd17693);logger['debug'](_0x8b68('0x20'),_0xd17693,JSON[_0x8b68('0x21')](_0x53aaa2));_0x4a68c7(_0x53aaa2);})['catch'](function(_0x494ce4){logger[_0x8b68('0x12')](_0x8b68('0x20'),_0x494ce4[_0x8b68('0x14')],_0xd17693);_0x42b3bd(_0x203dd4[_0x8b68('0x12')](0x1f4,_0x494ce4[_0x8b68('0x14')]));});});};exports[_0x8b68('0x22')]=function(_0x460c37){var _0x5b7ed1=this;return new Promise(function(_0x3b6d1b,_0x50a1e9){return db[_0x8b68('0x17')][_0x8b68('0x23')]({'raw':_0x460c37['options']?_0x460c37[_0x8b68('0x19')][_0x8b68('0x24')]===undefined?!![]:![]:!![],'where':_0x460c37[_0x8b68('0x19')]?_0x460c37['options']['where']||null:null,'attributes':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1b')]||null:null,'include':_0x460c37[_0x8b68('0x19')]?_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x460c37[_0x8b68('0x19')][_0x8b68('0x1d')],function(_0x7fe301){return{'model':db[_0x7fe301[_0x8b68('0x1f')]],'as':_0x7fe301['as'],'attributes':_0x7fe301[_0x8b68('0x1b')],'include':_0x7fe301[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x7fe301[_0x8b68('0x1d')],function(_0x151277){return{'model':db[_0x151277[_0x8b68('0x1f')]],'as':_0x151277['as'],'attributes':_0x151277[_0x8b68('0x1b')],'include':_0x151277[_0x8b68('0x1d')]?_[_0x8b68('0x1e')](_0x151277[_0x8b68('0x1d')],function(_0x43b971){return{'model':db[_0x43b971['model']],'as':_0x43b971['as'],'attributes':_0x43b971['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b68('0xc')](function(_0x262d6c){logger[_0x8b68('0xd')](_0x8b68('0x22'),_0x460c37);logger[_0x8b68('0x10')](_0x8b68('0x22'),_0x460c37,JSON[_0x8b68('0x21')](_0x262d6c));_0x3b6d1b(_0x262d6c);})[_0x8b68('0x16')](function(_0x5b628e){logger[_0x8b68('0x12')](_0x8b68('0x22'),_0x5b628e[_0x8b68('0x14')],_0x460c37);_0x50a1e9(_0x5b7ed1[_0x8b68('0x12')](0x1f4,_0x5b628e[_0x8b68('0x14')]));});});}; \ No newline at end of file +var _0x282b=['map','model','ShowVtigerAccount','VtigerAccount','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes','include'];(function(_0x470771,_0x103f7b){var _0x2729d9=function(_0x59c928){while(--_0x59c928){_0x470771['push'](_0x470771['shift']());}};_0x2729d9(++_0x103f7b);}(_0x282b,0xec));var _0xb282=function(_0x4f3363,_0x2f9b47){_0x4f3363=_0x4f3363-0x0;var _0x1d6c5d=_0x282b[_0x4f3363];return _0x1d6c5d;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});}exports[_0xb282('0x15')]=function(_0xca5f12){var _0x45b070=this;return new Promise(function(_0x3f8a3f,_0x492d20){return db['VtigerAccount'][_0xb282('0x16')]({'raw':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x19')]||null:null,'attributes':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x1a')]||null:null,'limit':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')]['limit']||null:null,'include':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x1b')]?_[_0xb282('0x1c')](_0xca5f12[_0xb282('0x17')]['include'],function(_0x4d624f){return{'model':db[_0x4d624f[_0xb282('0x1d')]],'as':_0x4d624f['as'],'attributes':_0x4d624f[_0xb282('0x1a')],'include':_0x4d624f['include']?_['map'](_0x4d624f[_0xb282('0x1b')],function(_0x114f77){return{'model':db[_0x114f77[_0xb282('0x1d')]],'as':_0x114f77['as'],'attributes':_0x114f77[_0xb282('0x1a')],'include':_0x114f77[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x114f77['include'],function(_0xa0d7fb){return{'model':db[_0xa0d7fb[_0xb282('0x1d')]],'as':_0xa0d7fb['as'],'attributes':_0xa0d7fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xb282('0xb')](function(_0x38a1f8){logger[_0xb282('0xc')](_0xb282('0x15'),_0xca5f12);logger['debug'](_0xb282('0x15'),_0xca5f12,JSON[_0xb282('0x10')](_0x38a1f8));_0x3f8a3f(_0x38a1f8);})[_0xb282('0x14')](function(_0x433ad5){logger[_0xb282('0x11')](_0xb282('0x15'),_0x433ad5[_0xb282('0x12')],_0xca5f12);_0x492d20(_0x45b070['error'](0x1f4,_0x433ad5[_0xb282('0x12')]));});});};exports[_0xb282('0x1e')]=function(_0x3eb294){var _0xd8780b=this;return new Promise(function(_0x42ef75,_0x5f3ddf){return db[_0xb282('0x1f')]['find']({'raw':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0x3eb294['options']?_0x3eb294[_0xb282('0x17')]['where']||null:null,'attributes':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1a')]||null:null,'include':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')]?_['map'](_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')],function(_0x4ede9d){return{'model':db[_0x4ede9d['model']],'as':_0x4ede9d['as'],'attributes':_0x4ede9d[_0xb282('0x1a')],'include':_0x4ede9d[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4ede9d['include'],function(_0x4a76ce){return{'model':db[_0x4a76ce['model']],'as':_0x4a76ce['as'],'attributes':_0x4a76ce[_0xb282('0x1a')],'include':_0x4a76ce[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4a76ce[_0xb282('0x1b')],function(_0x17c1e4){return{'model':db[_0x17c1e4[_0xb282('0x1d')]],'as':_0x17c1e4['as'],'attributes':_0x17c1e4[_0xb282('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dc171){logger['info'](_0xb282('0x1e'),_0x3eb294);logger[_0xb282('0x20')](_0xb282('0x1e'),_0x3eb294,JSON['stringify'](_0x3dc171));_0x42ef75(_0x3dc171);})[_0xb282('0x14')](function(_0x4beef2){logger[_0xb282('0x11')](_0xb282('0x1e'),_0x4beef2[_0xb282('0x12')],_0x3eb294);_0x5f3ddf(_0xd8780b[_0xb282('0x11')](0x1f4,_0x4beef2['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index d9209da..56a03a3 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 _0xf65a=['/:id/subjects','getSubjects','/:id/descriptions','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1dfaa8,_0x9e69b3){var _0x3c2109=function(_0x4379dd){while(--_0x4379dd){_0x1dfaa8['push'](_0x1dfaa8['shift']());}};_0x3c2109(++_0x9e69b3);}(_0xf65a,0x92));var _0xaf65=function(_0x1fcc20,_0x1fdb1e){_0x1fcc20=_0x1fcc20-0x0;var _0x3f4e4e=_0xf65a[_0x1fcc20];return _0x3f4e4e;};'use strict';var multer=require(_0xaf65('0x0'));var util=require(_0xaf65('0x1'));var path=require(_0xaf65('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf65('0x3'));var router=express[_0xaf65('0x4')]();var fs_extra=require(_0xaf65('0x5'));var auth=require(_0xaf65('0x6'));var interaction=require(_0xaf65('0x7'));var config=require(_0xaf65('0x8'));var controller=require(_0xaf65('0x9'));router[_0xaf65('0xa')]('/',auth[_0xaf65('0xb')](),controller[_0xaf65('0xc')]);router[_0xaf65('0xa')](_0xaf65('0xd'),auth[_0xaf65('0xb')](),controller[_0xaf65('0xe')]);router[_0xaf65('0xa')]('/:id/fields',auth[_0xaf65('0xb')](),controller['getFields']);router[_0xaf65('0xa')](_0xaf65('0xf'),auth[_0xaf65('0xb')](),controller[_0xaf65('0x10')]);router['get'](_0xaf65('0x11'),auth[_0xaf65('0xb')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xaf65('0x12')]);router[_0xaf65('0x13')](_0xaf65('0xd'),auth['isAuthenticated'](),controller[_0xaf65('0x14')]);router['delete']('/:id',auth[_0xaf65('0xb')](),controller[_0xaf65('0x15')]);module[_0xaf65('0x16')]=router; \ No newline at end of file +var _0x54f5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','exports','multer','util','connect-timeout','express'];(function(_0x11e60e,_0x39b8d1){var _0x1c023e=function(_0x40ffd6){while(--_0x40ffd6){_0x11e60e['push'](_0x11e60e['shift']());}};_0x1c023e(++_0x39b8d1);}(_0x54f5,0xd4));var _0x554f=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x54f5[_0x75f869];return _0x10af8b;};'use strict';var multer=require(_0x554f('0x0'));var util=require(_0x554f('0x1'));var path=require('path');var timeout=require(_0x554f('0x2'));var express=require(_0x554f('0x3'));var router=express[_0x554f('0x4')]();var fs_extra=require(_0x554f('0x5'));var auth=require(_0x554f('0x6'));var interaction=require(_0x554f('0x7'));var config=require(_0x554f('0x8'));var controller=require(_0x554f('0x9'));router[_0x554f('0xa')]('/',auth[_0x554f('0xb')](),controller['index']);router['get'](_0x554f('0xc'),auth[_0x554f('0xb')](),controller[_0x554f('0xd')]);router[_0x554f('0xa')](_0x554f('0xe'),auth[_0x554f('0xb')](),controller[_0x554f('0xf')]);router[_0x554f('0xa')](_0x554f('0x10'),auth['isAuthenticated'](),controller[_0x554f('0x11')]);router[_0x554f('0xa')](_0x554f('0x12'),auth[_0x554f('0xb')](),controller['getDescriptions']);router[_0x554f('0x13')]('/',auth[_0x554f('0xb')](),controller[_0x554f('0x14')]);router[_0x554f('0x15')](_0x554f('0xc'),auth[_0x554f('0xb')](),controller['update']);router[_0x554f('0x16')](_0x554f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x554f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index f9af668..4effec7 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 _0xb898=['STRING'];(function(_0x292911,_0x279a2e){var _0x18dee9=function(_0x43ccf8){while(--_0x43ccf8){_0x292911['push'](_0x292911['shift']());}};_0x18dee9(++_0x279a2e);}(_0xb898,0x171));var _0x8b89=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0xb898[_0x3794a0];return _0x5bdaba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b89('0x0')]}}; \ No newline at end of file +var _0x081c=['exports','STRING','sequelize'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0x081c,0xad));var _0xc081=function(_0x9a8878,_0x2ef1b8){_0x9a8878=_0x9a8878-0x0;var _0x5f36a8=_0x081c[_0x9a8878];return _0x5f36a8;};'use strict';var Sequelize=require(_0xc081('0x0'));module[_0xc081('0x1')]={'name':{'type':Sequelize[_0xc081('0x2')]},'description':{'type':Sequelize[_0xc081('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7a6a170..a973229 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 _0x414d=['error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','keys','options','find','create','body','getFields','VtigerField','findOne','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus'];(function(_0xafccf1,_0x810b19){var _0x10fec6=function(_0x2c8c0b){while(--_0x2c8c0b){_0xafccf1['push'](_0xafccf1['shift']());}};_0x10fec6(++_0x810b19);}(_0x414d,0xc6));var _0xd414=function(_0x461e08,_0x32ea15){_0x461e08=_0x461e08-0x0;var _0x19a69c=_0x414d[_0x461e08];return _0x19a69c;};'use strict';var emlformat=require(_0xd414('0x0'));var rimraf=require(_0xd414('0x1'));var zipdir=require(_0xd414('0x2'));var jsonpatch=require(_0xd414('0x3'));var rp=require(_0xd414('0x4'));var moment=require(_0xd414('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd414('0x6'));var util=require(_0xd414('0x7'));var path=require(_0xd414('0x8'));var sox=require('sox');var csv=require(_0xd414('0x9'));var ejs=require(_0xd414('0xa'));var fs=require('fs');var fs_extra=require(_0xd414('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd414('0xc'));var deskjs=require(_0xd414('0xd'));var toCsv=require(_0xd414('0x9'));var querystring=require(_0xd414('0xe'));var Papa=require(_0xd414('0xf'));var Redis=require(_0xd414('0x10'));var authService=require(_0xd414('0x11'));var qs=require(_0xd414('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd414('0x13'));var logger=require(_0xd414('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd414('0x15'));var licenseUtil=require(_0xd414('0x16'));var db=require(_0xd414('0x17'))['db'];function respondWithStatusCode(_0x47e284,_0x2c4b76){_0x2c4b76=_0x2c4b76||0xcc;return function(_0x475ac3){if(_0x475ac3){return _0x47e284['sendStatus'](_0x2c4b76);}return _0x47e284[_0xd414('0x18')](_0x2c4b76)[_0xd414('0x19')]();};}function respondWithResult(_0x3d04f9,_0x2f03fe){_0x2f03fe=_0x2f03fe||0xc8;return function(_0x407fb4){if(_0x407fb4){return _0x3d04f9[_0xd414('0x18')](_0x2f03fe)[_0xd414('0x1a')](_0x407fb4);}};}function respondWithFilteredResult(_0x5bd904,_0x53d020){return function(_0x2817d0){if(_0x2817d0){var _0x244730=typeof _0x53d020['offset']===_0xd414('0x1b')&&typeof _0x53d020['limit']===_0xd414('0x1b');var _0x405b88=_0x2817d0[_0xd414('0x1c')];var _0x12f959=_0x244730?0x0:_0x53d020[_0xd414('0x1d')];var _0x30cca8=_0x244730?_0x2817d0[_0xd414('0x1c')]:_0x53d020[_0xd414('0x1d')]+_0x53d020[_0xd414('0x1e')];var _0x29231e;if(_0x30cca8>=_0x405b88){_0x30cca8=_0x405b88;_0x29231e=0xc8;}else{_0x29231e=0xce;}_0x5bd904['status'](_0x29231e);return _0x5bd904[_0xd414('0x1f')]('Content-Range',_0x12f959+'-'+_0x30cca8+'/'+_0x405b88)[_0xd414('0x1a')](_0x2817d0);}return null;};}function patchUpdates(_0x45c832){return function(_0x4f8c54){try{jsonpatch[_0xd414('0x20')](_0x4f8c54,_0x45c832,!![]);}catch(_0x347ae5){return BPromise[_0xd414('0x21')](_0x347ae5);}return _0x4f8c54[_0xd414('0x22')]();};}function saveUpdates(_0xa11719,_0x4318dc){return function(_0x1c23db){if(_0x1c23db){return _0x1c23db[_0xd414('0x23')](_0xa11719)[_0xd414('0x24')](function(_0x182e39){return _0x182e39;});}return null;};}function removeEntity(_0x25774a,_0xeb11f2){return function(_0x350a18){if(_0x350a18){return _0x350a18[_0xd414('0x25')]()[_0xd414('0x24')](function(){_0x25774a[_0xd414('0x18')](0xcc)[_0xd414('0x19')]();});}};}function handleEntityNotFound(_0x8d5314,_0x434884){return function(_0xac9841){if(!_0xac9841){_0x8d5314[_0xd414('0x26')](0x194);}return _0xac9841;};}function handleError(_0x3f41a5,_0x36c66e){_0x36c66e=_0x36c66e||0x1f4;return function(_0x1dc6b0){logger[_0xd414('0x27')](_0x1dc6b0[_0xd414('0x28')]);if(_0x1dc6b0['name']){delete _0x1dc6b0[_0xd414('0x29')];}_0x3f41a5['status'](_0x36c66e)[_0xd414('0x2a')](_0x1dc6b0);};}exports[_0xd414('0x2b')]=function(_0x5e28a9,_0x59adaf){var _0x3ef8f7={},_0x2ad4ed={},_0x5a132f={'count':0x0,'rows':[]};var _0x470d22=_[_0xd414('0x2c')](db[_0xd414('0x2d')][_0xd414('0x2e')],function(_0x50e9b0){return{'name':_0x50e9b0['fieldName'],'type':_0x50e9b0[_0xd414('0x2f')]['key']};});_0x2ad4ed[_0xd414('0x30')]=_['map'](_0x470d22,'name');_0x2ad4ed['query']=_['keys'](_0x5e28a9[_0xd414('0x31')]);_0x2ad4ed[_0xd414('0x32')]=_[_0xd414('0x33')](_0x2ad4ed['model'],_0x2ad4ed[_0xd414('0x31')]);_0x3ef8f7[_0xd414('0x34')]=_[_0xd414('0x33')](_0x2ad4ed['model'],qs[_0xd414('0x35')](_0x5e28a9[_0xd414('0x31')][_0xd414('0x35')]));_0x3ef8f7[_0xd414('0x34')]=_0x3ef8f7[_0xd414('0x34')][_0xd414('0x36')]?_0x3ef8f7[_0xd414('0x34')]:_0x2ad4ed[_0xd414('0x30')];if(!_0x5e28a9[_0xd414('0x31')][_0xd414('0x37')](_0xd414('0x38'))){_0x3ef8f7[_0xd414('0x1e')]=qs['limit'](_0x5e28a9[_0xd414('0x31')][_0xd414('0x1e')]);_0x3ef8f7[_0xd414('0x1d')]=qs[_0xd414('0x1d')](_0x5e28a9[_0xd414('0x31')][_0xd414('0x1d')]);}_0x3ef8f7['order']=qs[_0xd414('0x39')](_0x5e28a9[_0xd414('0x31')]['sort']);_0x3ef8f7[_0xd414('0x3a')]=qs[_0xd414('0x32')](_[_0xd414('0x3b')](_0x5e28a9[_0xd414('0x31')],_0x2ad4ed[_0xd414('0x32')]),_0x470d22);if(_0x5e28a9['query'][_0xd414('0x3c')]){_0x3ef8f7['where']=_[_0xd414('0x3d')](_0x3ef8f7['where'],{'$or':_[_0xd414('0x2c')](_0x470d22,function(_0x37a811){if(_0x37a811[_0xd414('0x2f')]!==_0xd414('0x3e')){var _0x41748d={};_0x41748d[_0x37a811['name']]={'$like':'%'+_0x5e28a9[_0xd414('0x31')][_0xd414('0x3c')]+'%'};return _0x41748d;}})});}_0x3ef8f7=_[_0xd414('0x3d')]({},_0x3ef8f7,_0x5e28a9['options']);var _0x48a5cf={'where':_0x3ef8f7['where']};return db[_0xd414('0x2d')][_0xd414('0x1c')](_0x48a5cf)[_0xd414('0x24')](function(_0x4f9209){_0x5a132f[_0xd414('0x1c')]=_0x4f9209;if(_0x5e28a9['query']['includeAll']){_0x3ef8f7[_0xd414('0x3f')]=[{'all':!![]}];}return db[_0xd414('0x2d')][_0xd414('0x40')](_0x3ef8f7);})[_0xd414('0x24')](function(_0x1a2f88){_0x5a132f['rows']=_0x1a2f88;return _0x5a132f;})[_0xd414('0x24')](respondWithFilteredResult(_0x59adaf,_0x3ef8f7))[_0xd414('0x41')](handleError(_0x59adaf,null));};exports[_0xd414('0x42')]=function(_0x21c5f9,_0x1e3056){var _0x368a16={'raw':![],'where':{'id':_0x21c5f9[_0xd414('0x43')]['id']}},_0x1705a4={};_0x1705a4[_0xd414('0x30')]=_[_0xd414('0x44')](db[_0xd414('0x2d')][_0xd414('0x2e')]);_0x1705a4[_0xd414('0x31')]=_[_0xd414('0x44')](_0x21c5f9[_0xd414('0x31')]);_0x1705a4[_0xd414('0x32')]=_[_0xd414('0x33')](_0x1705a4['model'],_0x1705a4[_0xd414('0x31')]);_0x368a16[_0xd414('0x34')]=_[_0xd414('0x33')](_0x1705a4[_0xd414('0x30')],qs[_0xd414('0x35')](_0x21c5f9[_0xd414('0x31')][_0xd414('0x35')]));_0x368a16[_0xd414('0x34')]=_0x368a16[_0xd414('0x34')][_0xd414('0x36')]?_0x368a16['attributes']:_0x1705a4[_0xd414('0x30')];if(_0x21c5f9['query']['includeAll']){_0x368a16['include']=[{'all':!![]}];}_0x368a16=_[_0xd414('0x3d')]({},_0x368a16,_0x21c5f9[_0xd414('0x45')]);return db[_0xd414('0x2d')][_0xd414('0x46')](_0x368a16)[_0xd414('0x24')](handleEntityNotFound(_0x1e3056,null))[_0xd414('0x24')](respondWithResult(_0x1e3056,null))[_0xd414('0x41')](handleError(_0x1e3056,null));};exports[_0xd414('0x47')]=function(_0x591f4f,_0x279c0c){return db[_0xd414('0x2d')][_0xd414('0x47')](_0x591f4f[_0xd414('0x48')],{})[_0xd414('0x24')](respondWithResult(_0x279c0c,0xc9))[_0xd414('0x41')](handleError(_0x279c0c,null));};exports['update']=function(_0x45c9f2,_0x1d1719){if(_0x45c9f2['body']['id']){delete _0x45c9f2[_0xd414('0x48')]['id'];}return db[_0xd414('0x2d')][_0xd414('0x46')]({'where':{'id':_0x45c9f2[_0xd414('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d1719,null))['then'](saveUpdates(_0x45c9f2[_0xd414('0x48')],null))[_0xd414('0x24')](respondWithResult(_0x1d1719,null))['catch'](handleError(_0x1d1719,null));};exports[_0xd414('0x25')]=function(_0x436b97,_0x4f5711){return db[_0xd414('0x2d')][_0xd414('0x46')]({'where':{'id':_0x436b97[_0xd414('0x43')]['id']}})[_0xd414('0x24')](handleEntityNotFound(_0x4f5711,null))['then'](removeEntity(_0x4f5711,null))[_0xd414('0x41')](handleError(_0x4f5711,null));};exports[_0xd414('0x49')]=function(_0x53240d,_0x16ec97,_0x11fe3a){var _0x307488={};var _0x292744={};var _0x473cc0;var _0x42030b;return db[_0xd414('0x2d')]['findOne']({'where':{'id':_0x53240d['params']['id']}})['then'](handleEntityNotFound(_0x16ec97,null))['then'](function(_0x12d3b2){if(_0x12d3b2){_0x473cc0=_0x12d3b2;_0x292744[_0xd414('0x30')]=_[_0xd414('0x44')](db[_0xd414('0x4a')][_0xd414('0x2e')]);_0x292744[_0xd414('0x31')]=_[_0xd414('0x44')](_0x53240d[_0xd414('0x31')]);_0x292744[_0xd414('0x32')]=_[_0xd414('0x33')](_0x292744[_0xd414('0x30')],_0x292744[_0xd414('0x31')]);_0x307488[_0xd414('0x34')]=_['intersection'](_0x292744[_0xd414('0x30')],qs[_0xd414('0x35')](_0x53240d[_0xd414('0x31')][_0xd414('0x35')]));_0x307488[_0xd414('0x34')]=_0x307488[_0xd414('0x34')][_0xd414('0x36')]?_0x307488['attributes']:_0x292744[_0xd414('0x30')];_0x307488['order']=qs['sort'](_0x53240d['query'][_0xd414('0x39')]);_0x307488['where']=qs['filters'](_[_0xd414('0x3b')](_0x53240d[_0xd414('0x31')],_0x292744[_0xd414('0x32')]));if(_0x53240d[_0xd414('0x31')]['filter']){_0x307488[_0xd414('0x3a')]=_[_0xd414('0x3d')](_0x307488[_0xd414('0x3a')],{'$or':_[_0xd414('0x2c')](_0x307488[_0xd414('0x34')],function(_0x41ee08){var _0xe41898={};_0xe41898[_0x41ee08]={'$like':'%'+_0x53240d['query'][_0xd414('0x3c')]+'%'};return _0xe41898;})});}_0x307488=_[_0xd414('0x3d')]({},_0x307488,_0x53240d[_0xd414('0x45')]);return _0x473cc0[_0xd414('0x49')](_0x307488);}})['then'](function(_0x450609){if(_0x450609){_0x42030b=_0x450609['length'];if(!_0x53240d['query'][_0xd414('0x37')](_0xd414('0x38'))){_0x307488['limit']=qs[_0xd414('0x1e')](_0x53240d[_0xd414('0x31')][_0xd414('0x1e')]);_0x307488['offset']=qs[_0xd414('0x1d')](_0x53240d[_0xd414('0x31')][_0xd414('0x1d')]);}return _0x473cc0[_0xd414('0x49')](_0x307488);}})[_0xd414('0x24')](function(_0x31845c){if(_0x31845c){return _0x31845c?{'count':_0x42030b,'rows':_0x31845c}:null;}})[_0xd414('0x24')](respondWithResult(_0x16ec97,null))[_0xd414('0x41')](handleError(_0x16ec97,null));};exports['getSubjects']=function(_0x490af3,_0x3981c1,_0x5901db){var _0x1ea31c={};var _0x45f6bf={};var _0x1959aa;var _0x307c30;return db['VtigerConfiguration'][_0xd414('0x4b')]({'where':{'id':_0x490af3[_0xd414('0x43')]['id']}})[_0xd414('0x24')](handleEntityNotFound(_0x3981c1,null))[_0xd414('0x24')](function(_0x26bbc9){if(_0x26bbc9){_0x1959aa=_0x26bbc9;_0x45f6bf[_0xd414('0x30')]=_['keys'](db[_0xd414('0x4a')][_0xd414('0x2e')]);_0x45f6bf[_0xd414('0x31')]=_[_0xd414('0x44')](_0x490af3[_0xd414('0x31')]);_0x45f6bf['filters']=_['intersection'](_0x45f6bf[_0xd414('0x30')],_0x45f6bf[_0xd414('0x31')]);_0x1ea31c['attributes']=_[_0xd414('0x33')](_0x45f6bf[_0xd414('0x30')],qs[_0xd414('0x35')](_0x490af3[_0xd414('0x31')]['fields']));_0x1ea31c[_0xd414('0x34')]=_0x1ea31c[_0xd414('0x34')]['length']?_0x1ea31c[_0xd414('0x34')]:_0x45f6bf[_0xd414('0x30')];_0x1ea31c[_0xd414('0x4c')]=qs['sort'](_0x490af3[_0xd414('0x31')][_0xd414('0x39')]);_0x1ea31c[_0xd414('0x3a')]=qs[_0xd414('0x32')](_[_0xd414('0x3b')](_0x490af3[_0xd414('0x31')],_0x45f6bf[_0xd414('0x32')]));if(_0x490af3['query'][_0xd414('0x3c')]){_0x1ea31c[_0xd414('0x3a')]=_['merge'](_0x1ea31c[_0xd414('0x3a')],{'$or':_[_0xd414('0x2c')](_0x1ea31c[_0xd414('0x34')],function(_0x57d193){var _0x402ea6={};_0x402ea6[_0x57d193]={'$like':'%'+_0x490af3['query'][_0xd414('0x3c')]+'%'};return _0x402ea6;})});}_0x1ea31c=_[_0xd414('0x3d')]({},_0x1ea31c,_0x490af3[_0xd414('0x45')]);return _0x1959aa['getSubjects'](_0x1ea31c);}})[_0xd414('0x24')](function(_0x4f6c78){if(_0x4f6c78){_0x307c30=_0x4f6c78[_0xd414('0x36')];if(!_0x490af3[_0xd414('0x31')][_0xd414('0x37')](_0xd414('0x38'))){_0x1ea31c[_0xd414('0x1e')]=qs[_0xd414('0x1e')](_0x490af3[_0xd414('0x31')][_0xd414('0x1e')]);_0x1ea31c[_0xd414('0x1d')]=qs['offset'](_0x490af3[_0xd414('0x31')]['offset']);}return _0x1959aa[_0xd414('0x4d')](_0x1ea31c);}})[_0xd414('0x24')](function(_0x5e68da){if(_0x5e68da){return _0x5e68da?{'count':_0x307c30,'rows':_0x5e68da}:null;}})['then'](respondWithResult(_0x3981c1,null))[_0xd414('0x41')](handleError(_0x3981c1,null));};exports['getDescriptions']=function(_0x5ba056,_0x5e7e92,_0xb269c8){var _0x427c8d={};var _0xf7f722={};var _0x7d5a9e;var _0x16da12;return db[_0xd414('0x2d')][_0xd414('0x4b')]({'where':{'id':_0x5ba056['params']['id']}})[_0xd414('0x24')](handleEntityNotFound(_0x5e7e92,null))[_0xd414('0x24')](function(_0xf1957f){if(_0xf1957f){_0x7d5a9e=_0xf1957f;_0xf7f722[_0xd414('0x30')]=_[_0xd414('0x44')](db[_0xd414('0x4a')][_0xd414('0x2e')]);_0xf7f722[_0xd414('0x31')]=_[_0xd414('0x44')](_0x5ba056[_0xd414('0x31')]);_0xf7f722[_0xd414('0x32')]=_[_0xd414('0x33')](_0xf7f722[_0xd414('0x30')],_0xf7f722[_0xd414('0x31')]);_0x427c8d['attributes']=_[_0xd414('0x33')](_0xf7f722[_0xd414('0x30')],qs[_0xd414('0x35')](_0x5ba056[_0xd414('0x31')][_0xd414('0x35')]));_0x427c8d[_0xd414('0x34')]=_0x427c8d[_0xd414('0x34')][_0xd414('0x36')]?_0x427c8d[_0xd414('0x34')]:_0xf7f722[_0xd414('0x30')];_0x427c8d['order']=qs[_0xd414('0x39')](_0x5ba056[_0xd414('0x31')][_0xd414('0x39')]);_0x427c8d[_0xd414('0x3a')]=qs[_0xd414('0x32')](_[_0xd414('0x3b')](_0x5ba056[_0xd414('0x31')],_0xf7f722[_0xd414('0x32')]));if(_0x5ba056[_0xd414('0x31')]['filter']){_0x427c8d[_0xd414('0x3a')]=_[_0xd414('0x3d')](_0x427c8d[_0xd414('0x3a')],{'$or':_[_0xd414('0x2c')](_0x427c8d[_0xd414('0x34')],function(_0x555024){var _0x132558={};_0x132558[_0x555024]={'$like':'%'+_0x5ba056[_0xd414('0x31')][_0xd414('0x3c')]+'%'};return _0x132558;})});}_0x427c8d=_[_0xd414('0x3d')]({},_0x427c8d,_0x5ba056['options']);return _0x7d5a9e[_0xd414('0x4e')](_0x427c8d);}})[_0xd414('0x24')](function(_0x18a31c){if(_0x18a31c){_0x16da12=_0x18a31c['length'];if(!_0x5ba056['query'][_0xd414('0x37')]('nolimit')){_0x427c8d[_0xd414('0x1e')]=qs[_0xd414('0x1e')](_0x5ba056[_0xd414('0x31')][_0xd414('0x1e')]);_0x427c8d['offset']=qs['offset'](_0x5ba056['query'][_0xd414('0x1d')]);}return _0x7d5a9e[_0xd414('0x4e')](_0x427c8d);}})[_0xd414('0x24')](function(_0x136d7b){if(_0x136d7b){return _0x136d7b?{'count':_0x16da12,'rows':_0x136d7b}:null;}})[_0xd414('0x24')](respondWithResult(_0x5e7e92,null))[_0xd414('0x41')](handleError(_0x5e7e92,null));}; \ No newline at end of file +var _0x3ef0=['includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','getFields','findOne','hasOwnProperty','nolimit','getSubjects','VtigerField','getDescriptions','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','VtigerConfiguration','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','where','merge','options'];(function(_0x4709a3,_0xc066e7){var _0x4c6427=function(_0x4a633d){while(--_0x4a633d){_0x4709a3['push'](_0x4709a3['shift']());}};_0x4c6427(++_0xc066e7);}(_0x3ef0,0x19a));var _0x03ef=function(_0x264a90,_0x4816d6){_0x264a90=_0x264a90-0x0;var _0x3e3e61=_0x3ef0[_0x264a90];return _0x3e3e61;};'use strict';var emlformat=require(_0x03ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ef('0x2'));var moment=require('moment');var BPromise=require(_0x03ef('0x3'));var Mustache=require(_0x03ef('0x4'));var util=require(_0x03ef('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x03ef('0x6'));var ejs=require(_0x03ef('0x7'));var fs=require('fs');var fs_extra=require(_0x03ef('0x8'));var _=require('lodash');var squel=require(_0x03ef('0x9'));var crypto=require(_0x03ef('0xa'));var jsforce=require(_0x03ef('0xb'));var deskjs=require(_0x03ef('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03ef('0xd'));var Redis=require(_0x03ef('0xe'));var authService=require(_0x03ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03ef('0x10'));var hardwareService=require(_0x03ef('0x11'));var logger=require('../../config/logger')(_0x03ef('0x12'));var utils=require(_0x03ef('0x13'));var config=require(_0x03ef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ef('0x15'))['db'];function respondWithStatusCode(_0x8f3fb,_0x390cc2){_0x390cc2=_0x390cc2||0xcc;return function(_0x1e138e){if(_0x1e138e){return _0x8f3fb[_0x03ef('0x16')](_0x390cc2);}return _0x8f3fb[_0x03ef('0x17')](_0x390cc2)[_0x03ef('0x18')]();};}function respondWithResult(_0x39ed69,_0x1702a0){_0x1702a0=_0x1702a0||0xc8;return function(_0x3390ae){if(_0x3390ae){return _0x39ed69[_0x03ef('0x17')](_0x1702a0)['json'](_0x3390ae);}};}function respondWithFilteredResult(_0x531025,_0x16282b){return function(_0x17b6ec){if(_0x17b6ec){var _0x1a0113=typeof _0x16282b[_0x03ef('0x19')]===_0x03ef('0x1a')&&typeof _0x16282b['limit']==='undefined';var _0x343bf0=_0x17b6ec[_0x03ef('0x1b')];var _0x501d87=_0x1a0113?0x0:_0x16282b['offset'];var _0x277f0d=_0x1a0113?_0x17b6ec[_0x03ef('0x1b')]:_0x16282b[_0x03ef('0x19')]+_0x16282b[_0x03ef('0x1c')];var _0x1776d8;if(_0x277f0d>=_0x343bf0){_0x277f0d=_0x343bf0;_0x1776d8=0xc8;}else{_0x1776d8=0xce;}_0x531025['status'](_0x1776d8);return _0x531025[_0x03ef('0x1d')](_0x03ef('0x1e'),_0x501d87+'-'+_0x277f0d+'/'+_0x343bf0)['json'](_0x17b6ec);}return null;};}function patchUpdates(_0xb663d){return function(_0x39f693){try{jsonpatch[_0x03ef('0x1f')](_0x39f693,_0xb663d,!![]);}catch(_0xde0e02){return BPromise[_0x03ef('0x20')](_0xde0e02);}return _0x39f693['save']();};}function saveUpdates(_0x5cddb6,_0x41d7d7){return function(_0x5d56e1){if(_0x5d56e1){return _0x5d56e1[_0x03ef('0x21')](_0x5cddb6)['then'](function(_0x5c1a36){return _0x5c1a36;});}return null;};}function removeEntity(_0x13b033,_0x27ac0d){return function(_0x5efaf0){if(_0x5efaf0){return _0x5efaf0['destroy']()[_0x03ef('0x22')](function(){_0x13b033[_0x03ef('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x305829,_0x4d3908){return function(_0x2a4c7f){if(!_0x2a4c7f){_0x305829['sendStatus'](0x194);}return _0x2a4c7f;};}function handleError(_0x16e6ee,_0x3dd14f){_0x3dd14f=_0x3dd14f||0x1f4;return function(_0x31fd6f){logger[_0x03ef('0x23')](_0x31fd6f[_0x03ef('0x24')]);if(_0x31fd6f[_0x03ef('0x25')]){delete _0x31fd6f['name'];}_0x16e6ee['status'](_0x3dd14f)[_0x03ef('0x26')](_0x31fd6f);};}exports['index']=function(_0x39f762,_0x2b77cd){var _0x391f82={},_0x4d9e6a={},_0x627997={'count':0x0,'rows':[]};var _0x732b3a=_[_0x03ef('0x27')](db[_0x03ef('0x28')]['rawAttributes'],function(_0x4711df){return{'name':_0x4711df[_0x03ef('0x29')],'type':_0x4711df[_0x03ef('0x2a')][_0x03ef('0x2b')]};});_0x4d9e6a['model']=_[_0x03ef('0x27')](_0x732b3a,_0x03ef('0x25'));_0x4d9e6a[_0x03ef('0x2c')]=_['keys'](_0x39f762[_0x03ef('0x2c')]);_0x4d9e6a[_0x03ef('0x2d')]=_[_0x03ef('0x2e')](_0x4d9e6a[_0x03ef('0x2f')],_0x4d9e6a[_0x03ef('0x2c')]);_0x391f82['attributes']=_[_0x03ef('0x2e')](_0x4d9e6a[_0x03ef('0x2f')],qs[_0x03ef('0x30')](_0x39f762[_0x03ef('0x2c')][_0x03ef('0x30')]));_0x391f82['attributes']=_0x391f82[_0x03ef('0x31')][_0x03ef('0x32')]?_0x391f82[_0x03ef('0x31')]:_0x4d9e6a[_0x03ef('0x2f')];if(!_0x39f762[_0x03ef('0x2c')]['hasOwnProperty']('nolimit')){_0x391f82[_0x03ef('0x1c')]=qs[_0x03ef('0x1c')](_0x39f762['query'][_0x03ef('0x1c')]);_0x391f82['offset']=qs[_0x03ef('0x19')](_0x39f762[_0x03ef('0x2c')]['offset']);}_0x391f82[_0x03ef('0x33')]=qs['sort'](_0x39f762[_0x03ef('0x2c')][_0x03ef('0x34')]);_0x391f82['where']=qs['filters'](_[_0x03ef('0x35')](_0x39f762[_0x03ef('0x2c')],_0x4d9e6a['filters']),_0x732b3a);if(_0x39f762[_0x03ef('0x2c')][_0x03ef('0x36')]){_0x391f82[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x391f82[_0x03ef('0x37')],{'$or':_[_0x03ef('0x27')](_0x732b3a,function(_0x15b618){if(_0x15b618[_0x03ef('0x2a')]!=='VIRTUAL'){var _0x473f41={};_0x473f41[_0x15b618[_0x03ef('0x25')]]={'$like':'%'+_0x39f762[_0x03ef('0x2c')]['filter']+'%'};return _0x473f41;}})});}_0x391f82=_[_0x03ef('0x38')]({},_0x391f82,_0x39f762[_0x03ef('0x39')]);var _0x3e76fa={'where':_0x391f82[_0x03ef('0x37')]};return db['VtigerConfiguration'][_0x03ef('0x1b')](_0x3e76fa)[_0x03ef('0x22')](function(_0x336809){_0x627997[_0x03ef('0x1b')]=_0x336809;if(_0x39f762['query'][_0x03ef('0x3a')]){_0x391f82[_0x03ef('0x3b')]=[{'all':!![]}];}return db[_0x03ef('0x28')][_0x03ef('0x3c')](_0x391f82);})[_0x03ef('0x22')](function(_0x177e8b){_0x627997[_0x03ef('0x3d')]=_0x177e8b;return _0x627997;})[_0x03ef('0x22')](respondWithFilteredResult(_0x2b77cd,_0x391f82))[_0x03ef('0x3e')](handleError(_0x2b77cd,null));};exports[_0x03ef('0x3f')]=function(_0x252328,_0x134200){var _0x1a6ba6={'raw':![],'where':{'id':_0x252328[_0x03ef('0x40')]['id']}},_0x8f7f42={};_0x8f7f42[_0x03ef('0x2f')]=_[_0x03ef('0x41')](db[_0x03ef('0x28')][_0x03ef('0x42')]);_0x8f7f42[_0x03ef('0x2c')]=_[_0x03ef('0x41')](_0x252328[_0x03ef('0x2c')]);_0x8f7f42['filters']=_[_0x03ef('0x2e')](_0x8f7f42[_0x03ef('0x2f')],_0x8f7f42[_0x03ef('0x2c')]);_0x1a6ba6[_0x03ef('0x31')]=_[_0x03ef('0x2e')](_0x8f7f42[_0x03ef('0x2f')],qs[_0x03ef('0x30')](_0x252328[_0x03ef('0x2c')][_0x03ef('0x30')]));_0x1a6ba6[_0x03ef('0x31')]=_0x1a6ba6[_0x03ef('0x31')][_0x03ef('0x32')]?_0x1a6ba6['attributes']:_0x8f7f42[_0x03ef('0x2f')];if(_0x252328[_0x03ef('0x2c')]['includeAll']){_0x1a6ba6[_0x03ef('0x3b')]=[{'all':!![]}];}_0x1a6ba6=_[_0x03ef('0x38')]({},_0x1a6ba6,_0x252328['options']);return db[_0x03ef('0x28')][_0x03ef('0x43')](_0x1a6ba6)[_0x03ef('0x22')](handleEntityNotFound(_0x134200,null))['then'](respondWithResult(_0x134200,null))[_0x03ef('0x3e')](handleError(_0x134200,null));};exports[_0x03ef('0x44')]=function(_0x53bd07,_0x535607){return db[_0x03ef('0x28')][_0x03ef('0x44')](_0x53bd07[_0x03ef('0x45')],{})[_0x03ef('0x22')](respondWithResult(_0x535607,0xc9))[_0x03ef('0x3e')](handleError(_0x535607,null));};exports[_0x03ef('0x21')]=function(_0x27c6ca,_0x2e3145){if(_0x27c6ca[_0x03ef('0x45')]['id']){delete _0x27c6ca['body']['id'];}return db[_0x03ef('0x28')]['find']({'where':{'id':_0x27c6ca[_0x03ef('0x40')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x2e3145,null))['then'](saveUpdates(_0x27c6ca[_0x03ef('0x45')],null))[_0x03ef('0x22')](respondWithResult(_0x2e3145,null))[_0x03ef('0x3e')](handleError(_0x2e3145,null));};exports[_0x03ef('0x46')]=function(_0x390483,_0x4a052d){return db[_0x03ef('0x28')][_0x03ef('0x43')]({'where':{'id':_0x390483['params']['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x4a052d,null))[_0x03ef('0x22')](removeEntity(_0x4a052d,null))['catch'](handleError(_0x4a052d,null));};exports[_0x03ef('0x47')]=function(_0x5bdd12,_0x48361c,_0xf4ed23){var _0x1d6df5={};var _0x5a0c23={};var _0x4a1d9b;var _0x1eda74;return db['VtigerConfiguration'][_0x03ef('0x48')]({'where':{'id':_0x5bdd12[_0x03ef('0x40')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x48361c,null))[_0x03ef('0x22')](function(_0x17bd74){if(_0x17bd74){_0x4a1d9b=_0x17bd74;_0x5a0c23['model']=_[_0x03ef('0x41')](db['VtigerField'][_0x03ef('0x42')]);_0x5a0c23[_0x03ef('0x2c')]=_[_0x03ef('0x41')](_0x5bdd12[_0x03ef('0x2c')]);_0x5a0c23[_0x03ef('0x2d')]=_[_0x03ef('0x2e')](_0x5a0c23[_0x03ef('0x2f')],_0x5a0c23[_0x03ef('0x2c')]);_0x1d6df5[_0x03ef('0x31')]=_['intersection'](_0x5a0c23['model'],qs[_0x03ef('0x30')](_0x5bdd12[_0x03ef('0x2c')][_0x03ef('0x30')]));_0x1d6df5[_0x03ef('0x31')]=_0x1d6df5['attributes'][_0x03ef('0x32')]?_0x1d6df5[_0x03ef('0x31')]:_0x5a0c23[_0x03ef('0x2f')];_0x1d6df5[_0x03ef('0x33')]=qs[_0x03ef('0x34')](_0x5bdd12[_0x03ef('0x2c')]['sort']);_0x1d6df5[_0x03ef('0x37')]=qs[_0x03ef('0x2d')](_[_0x03ef('0x35')](_0x5bdd12['query'],_0x5a0c23[_0x03ef('0x2d')]));if(_0x5bdd12[_0x03ef('0x2c')][_0x03ef('0x36')]){_0x1d6df5[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x1d6df5[_0x03ef('0x37')],{'$or':_['map'](_0x1d6df5[_0x03ef('0x31')],function(_0x1194ad){var _0x4dad13={};_0x4dad13[_0x1194ad]={'$like':'%'+_0x5bdd12[_0x03ef('0x2c')][_0x03ef('0x36')]+'%'};return _0x4dad13;})});}_0x1d6df5=_[_0x03ef('0x38')]({},_0x1d6df5,_0x5bdd12[_0x03ef('0x39')]);return _0x4a1d9b['getFields'](_0x1d6df5);}})[_0x03ef('0x22')](function(_0x1c3ab8){if(_0x1c3ab8){_0x1eda74=_0x1c3ab8[_0x03ef('0x32')];if(!_0x5bdd12[_0x03ef('0x2c')][_0x03ef('0x49')](_0x03ef('0x4a'))){_0x1d6df5[_0x03ef('0x1c')]=qs[_0x03ef('0x1c')](_0x5bdd12[_0x03ef('0x2c')][_0x03ef('0x1c')]);_0x1d6df5[_0x03ef('0x19')]=qs['offset'](_0x5bdd12[_0x03ef('0x2c')][_0x03ef('0x19')]);}return _0x4a1d9b[_0x03ef('0x47')](_0x1d6df5);}})[_0x03ef('0x22')](function(_0x88eaca){if(_0x88eaca){return _0x88eaca?{'count':_0x1eda74,'rows':_0x88eaca}:null;}})[_0x03ef('0x22')](respondWithResult(_0x48361c,null))[_0x03ef('0x3e')](handleError(_0x48361c,null));};exports[_0x03ef('0x4b')]=function(_0x26a22a,_0x6193f1,_0x5d9059){var _0x365c2a={};var _0xeb4629={};var _0x417e71;var _0xdcb70;return db[_0x03ef('0x28')][_0x03ef('0x48')]({'where':{'id':_0x26a22a[_0x03ef('0x40')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x6193f1,null))[_0x03ef('0x22')](function(_0x236b2){if(_0x236b2){_0x417e71=_0x236b2;_0xeb4629['model']=_[_0x03ef('0x41')](db[_0x03ef('0x4c')][_0x03ef('0x42')]);_0xeb4629[_0x03ef('0x2c')]=_[_0x03ef('0x41')](_0x26a22a[_0x03ef('0x2c')]);_0xeb4629[_0x03ef('0x2d')]=_[_0x03ef('0x2e')](_0xeb4629[_0x03ef('0x2f')],_0xeb4629[_0x03ef('0x2c')]);_0x365c2a[_0x03ef('0x31')]=_[_0x03ef('0x2e')](_0xeb4629['model'],qs[_0x03ef('0x30')](_0x26a22a[_0x03ef('0x2c')][_0x03ef('0x30')]));_0x365c2a[_0x03ef('0x31')]=_0x365c2a[_0x03ef('0x31')][_0x03ef('0x32')]?_0x365c2a[_0x03ef('0x31')]:_0xeb4629[_0x03ef('0x2f')];_0x365c2a[_0x03ef('0x33')]=qs[_0x03ef('0x34')](_0x26a22a['query'][_0x03ef('0x34')]);_0x365c2a[_0x03ef('0x37')]=qs['filters'](_[_0x03ef('0x35')](_0x26a22a[_0x03ef('0x2c')],_0xeb4629[_0x03ef('0x2d')]));if(_0x26a22a['query'][_0x03ef('0x36')]){_0x365c2a[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x365c2a[_0x03ef('0x37')],{'$or':_[_0x03ef('0x27')](_0x365c2a['attributes'],function(_0x12e6ee){var _0x90fc79={};_0x90fc79[_0x12e6ee]={'$like':'%'+_0x26a22a[_0x03ef('0x2c')][_0x03ef('0x36')]+'%'};return _0x90fc79;})});}_0x365c2a=_[_0x03ef('0x38')]({},_0x365c2a,_0x26a22a[_0x03ef('0x39')]);return _0x417e71[_0x03ef('0x4b')](_0x365c2a);}})['then'](function(_0x3ae2ca){if(_0x3ae2ca){_0xdcb70=_0x3ae2ca[_0x03ef('0x32')];if(!_0x26a22a['query']['hasOwnProperty'](_0x03ef('0x4a'))){_0x365c2a[_0x03ef('0x1c')]=qs['limit'](_0x26a22a[_0x03ef('0x2c')][_0x03ef('0x1c')]);_0x365c2a[_0x03ef('0x19')]=qs[_0x03ef('0x19')](_0x26a22a[_0x03ef('0x2c')][_0x03ef('0x19')]);}return _0x417e71[_0x03ef('0x4b')](_0x365c2a);}})[_0x03ef('0x22')](function(_0x39b84e){if(_0x39b84e){return _0x39b84e?{'count':_0xdcb70,'rows':_0x39b84e}:null;}})['then'](respondWithResult(_0x6193f1,null))['catch'](handleError(_0x6193f1,null));};exports[_0x03ef('0x4d')]=function(_0x3b1f7c,_0x31f755,_0x4ddce2){var _0x12513={};var _0x38838e={};var _0x2f0e72;var _0x56549d;return db[_0x03ef('0x28')]['findOne']({'where':{'id':_0x3b1f7c[_0x03ef('0x40')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x31f755,null))['then'](function(_0x8099a2){if(_0x8099a2){_0x2f0e72=_0x8099a2;_0x38838e['model']=_[_0x03ef('0x41')](db[_0x03ef('0x4c')][_0x03ef('0x42')]);_0x38838e[_0x03ef('0x2c')]=_['keys'](_0x3b1f7c[_0x03ef('0x2c')]);_0x38838e['filters']=_['intersection'](_0x38838e['model'],_0x38838e[_0x03ef('0x2c')]);_0x12513[_0x03ef('0x31')]=_[_0x03ef('0x2e')](_0x38838e[_0x03ef('0x2f')],qs[_0x03ef('0x30')](_0x3b1f7c[_0x03ef('0x2c')][_0x03ef('0x30')]));_0x12513[_0x03ef('0x31')]=_0x12513[_0x03ef('0x31')]['length']?_0x12513['attributes']:_0x38838e['model'];_0x12513['order']=qs['sort'](_0x3b1f7c[_0x03ef('0x2c')][_0x03ef('0x34')]);_0x12513[_0x03ef('0x37')]=qs[_0x03ef('0x2d')](_[_0x03ef('0x35')](_0x3b1f7c[_0x03ef('0x2c')],_0x38838e['filters']));if(_0x3b1f7c[_0x03ef('0x2c')][_0x03ef('0x36')]){_0x12513[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x12513[_0x03ef('0x37')],{'$or':_[_0x03ef('0x27')](_0x12513[_0x03ef('0x31')],function(_0x2b7ec0){var _0x2d5cd2={};_0x2d5cd2[_0x2b7ec0]={'$like':'%'+_0x3b1f7c[_0x03ef('0x2c')][_0x03ef('0x36')]+'%'};return _0x2d5cd2;})});}_0x12513=_[_0x03ef('0x38')]({},_0x12513,_0x3b1f7c[_0x03ef('0x39')]);return _0x2f0e72['getDescriptions'](_0x12513);}})[_0x03ef('0x22')](function(_0x1112ab){if(_0x1112ab){_0x56549d=_0x1112ab[_0x03ef('0x32')];if(!_0x3b1f7c[_0x03ef('0x2c')][_0x03ef('0x49')](_0x03ef('0x4a'))){_0x12513['limit']=qs['limit'](_0x3b1f7c['query'][_0x03ef('0x1c')]);_0x12513['offset']=qs[_0x03ef('0x19')](_0x3b1f7c[_0x03ef('0x2c')][_0x03ef('0x19')]);}return _0x2f0e72[_0x03ef('0x4d')](_0x12513);}})[_0x03ef('0x22')](function(_0x2edf1b){if(_0x2edf1b){return _0x2edf1b?{'count':_0x56549d,'rows':_0x2edf1b}:null;}})['then'](respondWithResult(_0x31f755,null))['catch'](handleError(_0x31f755,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 128b526..455ede1 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 _0x20ef=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x77b66c,_0x3556ec){var _0x3e7710=function(_0xca551a){while(--_0xca551a){_0x77b66c['push'](_0x77b66c['shift']());}};_0x3e7710(++_0x3556ec);}(_0x20ef,0xd0));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf20e('0x0'));var util=require('util');var logger=require(_0xf20e('0x1'))(_0xf20e('0x2'));var moment=require(_0xf20e('0x3'));var BPromise=require(_0xf20e('0x4'));var rp=require(_0xf20e('0x5'));var fs=require('fs');var path=require(_0xf20e('0x6'));var rimraf=require('rimraf');var config=require(_0xf20e('0x7'));var attributes=require(_0xf20e('0x8'));module[_0xf20e('0x9')]=function(_0x58abfe,_0x124240){return _0x58abfe[_0xf20e('0xa')](_0xf20e('0xb'),attributes,{'tableName':_0xf20e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb46d=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','request-promise'];(function(_0x4aaa5b,_0x1cfdb2){var _0x48f19b=function(_0x50d788){while(--_0x50d788){_0x4aaa5b['push'](_0x4aaa5b['shift']());}};_0x48f19b(++_0x1cfdb2);}(_0xb46d,0xf7));var _0xdb46=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xb46d[_0x35fb56];return _0x2fd52c;};'use strict';var _=require(_0xdb46('0x0'));var util=require(_0xdb46('0x1'));var logger=require('../../config/logger')(_0xdb46('0x2'));var moment=require(_0xdb46('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb46('0x4'));var fs=require('fs');var path=require(_0xdb46('0x5'));var rimraf=require(_0xdb46('0x6'));var config=require(_0xdb46('0x7'));var attributes=require(_0xdb46('0x8'));module[_0xdb46('0x9')]=function(_0x114e29,_0x503aaa){return _0x114e29['define'](_0xdb46('0xa'),attributes,{'tableName':_0xdb46('0xb'),'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 e4fd90c..f1f6a57 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 _0x9c52=['http','request','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x4ce780,_0x2faa31){var _0x4f8e81=function(_0x1a0e9c){while(--_0x1a0e9c){_0x4ce780['push'](_0x4ce780['shift']());}};_0x4f8e81(++_0x2faa31);}(_0x9c52,0x123));var _0x29c5=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c52[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x29c5('0x0'));var util=require(_0x29c5('0x1'));var moment=require(_0x29c5('0x2'));var BPromise=require(_0x29c5('0x3'));var rs=require(_0x29c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29c5('0x6'));var config=require(_0x29c5('0x7'));var jayson=require(_0x29c5('0x8'));var client=jayson['client'][_0x29c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a2929,_0x39f532,_0x185d33){return new BPromise(function(_0x285d74,_0x2c2e85){return client[_0x29c5('0xa')](_0x3a2929,_0x185d33)['then'](function(_0x3d9eba){logger[_0x29c5('0xb')](_0x29c5('0xc'),_0x39f532,'request\x20sent');logger['debug'](_0x29c5('0xd'),_0x39f532,_0x29c5('0xe'),JSON[_0x29c5('0xf')](_0x3d9eba));if(_0x3d9eba[_0x29c5('0x10')]){if(_0x3d9eba['error'][_0x29c5('0x11')]===0x1f4){logger[_0x29c5('0x10')](_0x29c5('0xc'),_0x39f532,_0x3d9eba['error'][_0x29c5('0x12')]);return _0x2c2e85(_0x3d9eba[_0x29c5('0x10')][_0x29c5('0x12')]);}logger['error'](_0x29c5('0xc'),_0x39f532,_0x3d9eba[_0x29c5('0x10')][_0x29c5('0x12')]);return _0x285d74(_0x3d9eba['error'][_0x29c5('0x12')]);}else{logger[_0x29c5('0xb')](_0x29c5('0xc'),_0x39f532,_0x29c5('0xe'));_0x285d74(_0x3d9eba['result']['message']);}})[_0x29c5('0x13')](function(_0x5eb284){logger[_0x29c5('0x10')](_0x29c5('0xc'),_0x39f532,_0x5eb284);_0x2c2e85(_0x5eb284);});});} \ No newline at end of file +var _0x9107=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3bf9c4,_0x465c61){var _0x2b5f7b=function(_0x280563){while(--_0x280563){_0x3bf9c4['push'](_0x3bf9c4['shift']());}};_0x2b5f7b(++_0x465c61);}(_0x9107,0x126));var _0x7910=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0x9107[_0x5d88c0];return _0x1b40f0;};'use strict';var _=require(_0x7910('0x0'));var util=require(_0x7910('0x1'));var moment=require(_0x7910('0x2'));var BPromise=require('bluebird');var rs=require(_0x7910('0x3'));var fs=require('fs');var Redis=require(_0x7910('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7910('0x5'));var logger=require(_0x7910('0x6'))(_0x7910('0x7'));var config=require(_0x7910('0x8'));var jayson=require(_0x7910('0x9'));var client=jayson[_0x7910('0xa')][_0x7910('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43e5c9,_0x2cc692,_0x36542a){return new BPromise(function(_0xfe95e1,_0x465cdc){return client[_0x7910('0xc')](_0x43e5c9,_0x36542a)[_0x7910('0xd')](function(_0x258e37){logger[_0x7910('0xe')](_0x7910('0xf'),_0x2cc692,_0x7910('0x10'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x2cc692,_0x7910('0x10'),JSON[_0x7910('0x11')](_0x258e37));if(_0x258e37[_0x7910('0x12')]){if(_0x258e37[_0x7910('0x12')][_0x7910('0x13')]===0x1f4){logger[_0x7910('0x12')](_0x7910('0xf'),_0x2cc692,_0x258e37[_0x7910('0x12')][_0x7910('0x14')]);return _0x465cdc(_0x258e37[_0x7910('0x12')][_0x7910('0x14')]);}logger[_0x7910('0x12')](_0x7910('0xf'),_0x2cc692,_0x258e37[_0x7910('0x12')][_0x7910('0x14')]);return _0xfe95e1(_0x258e37['error']['message']);}else{logger['info'](_0x7910('0xf'),_0x2cc692,'request\x20sent');_0xfe95e1(_0x258e37['result'][_0x7910('0x14')]);}})[_0x7910('0x15')](function(_0x5209bd){logger[_0x7910('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x2cc692,_0x5209bd);_0x465cdc(_0x5209bd);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 3ffcea9..46e825c 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 _0xdf4d=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x2c0011,_0x41391b){var _0x850b00=function(_0x2394e6){while(--_0x2394e6){_0x2c0011['push'](_0x2c0011['shift']());}};_0x850b00(++_0x41391b);}(_0xdf4d,0xd2));var _0xddf4=function(_0x48365f,_0x4a956d){_0x48365f=_0x48365f-0x0;var _0x583a8e=_0xdf4d[_0x48365f];return _0x583a8e;};'use strict';var multer=require(_0xddf4('0x0'));var util=require(_0xddf4('0x1'));var path=require(_0xddf4('0x2'));var timeout=require(_0xddf4('0x3'));var express=require('express');var router=express[_0xddf4('0x4')]();var fs_extra=require(_0xddf4('0x5'));var auth=require(_0xddf4('0x6'));var interaction=require(_0xddf4('0x7'));var config=require('../../config/environment');var controller=require(_0xddf4('0x8'));router['get']('/',auth[_0xddf4('0x9')](),controller[_0xddf4('0xa')]);router['get'](_0xddf4('0xb'),auth[_0xddf4('0x9')](),controller['show']);router[_0xddf4('0xc')]('/',auth[_0xddf4('0x9')](),controller[_0xddf4('0xd')]);router[_0xddf4('0xe')](_0xddf4('0xb'),auth['isAuthenticated'](),controller[_0xddf4('0xf')]);router[_0xddf4('0x10')](_0xddf4('0xb'),auth[_0xddf4('0x9')](),controller[_0xddf4('0x11')]);module[_0xddf4('0x12')]=router; \ No newline at end of file +var _0xe3a6=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3a6,0xd7));var _0x6e3a=function(_0x1d6cb8,_0x31a3f3){_0x1d6cb8=_0x1d6cb8-0x0;var _0x38a43f=_0xe3a6[_0x1d6cb8];return _0x38a43f;};'use strict';var multer=require(_0x6e3a('0x0'));var util=require(_0x6e3a('0x1'));var path=require('path');var timeout=require(_0x6e3a('0x2'));var express=require(_0x6e3a('0x3'));var router=express[_0x6e3a('0x4')]();var fs_extra=require(_0x6e3a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6e3a('0x6'));var config=require(_0x6e3a('0x7'));var controller=require(_0x6e3a('0x8'));router[_0x6e3a('0x9')]('/',auth[_0x6e3a('0xa')](),controller[_0x6e3a('0xb')]);router['get'](_0x6e3a('0xc'),auth[_0x6e3a('0xa')](),controller['show']);router['post']('/',auth[_0x6e3a('0xa')](),controller[_0x6e3a('0xd')]);router['put']('/:id',auth[_0x6e3a('0xa')](),controller[_0x6e3a('0xe')]);router[_0x6e3a('0xf')]('/:id',auth[_0x6e3a('0xa')](),controller[_0x6e3a('0x10')]);module[_0x6e3a('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 4ee06b6..0ef91d7 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 _0x59fc=['variable','exports','ENUM','customVariable','keyValue','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59fc,0xbb));var _0xc59f=function(_0x5dada7,_0x2eeac3){_0x5dada7=_0x5dada7-0x0;var _0x185a2b=_0x59fc[_0x5dada7];return _0x185a2b;};'use strict';var Sequelize=require('sequelize');module[_0xc59f('0x0')]={'type':{'type':Sequelize[_0xc59f('0x1')]('string','variable',_0xc59f('0x2'),_0xc59f('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xc59f('0x4')]},'key':{'type':Sequelize[_0xc59f('0x4')]},'keyType':{'type':Sequelize[_0xc59f('0x1')]('string',_0xc59f('0x5'),_0xc59f('0x2'))},'keyContent':{'type':Sequelize[_0xc59f('0x4')]},'idField':{'type':Sequelize[_0xc59f('0x4')]},'nameField':{'type':Sequelize[_0xc59f('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc59f('0x4')]}}; \ No newline at end of file +var _0x49ea=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1c9dc9,_0x5bc8d0){var _0x58a559=function(_0x341fac){while(--_0x341fac){_0x1c9dc9['push'](_0x1c9dc9['shift']());}};_0x58a559(++_0x5bc8d0);}(_0x49ea,0x1d4));var _0xa49e=function(_0x58a620,_0x1218b2){_0x58a620=_0x58a620-0x0;var _0x57a560=_0x49ea[_0x58a620];return _0x57a560;};'use strict';var Sequelize=require(_0xa49e('0x0'));module[_0xa49e('0x1')]={'type':{'type':Sequelize[_0xa49e('0x2')](_0xa49e('0x3'),_0xa49e('0x4'),_0xa49e('0x5'),_0xa49e('0x6'),_0xa49e('0x7')),'defaultValue':_0xa49e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa49e('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xa49e('0x3'),_0xa49e('0x4'),_0xa49e('0x5'))},'keyContent':{'type':Sequelize[_0xa49e('0x8')]},'idField':{'type':Sequelize[_0xa49e('0x8')]},'nameField':{'type':Sequelize[_0xa49e('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa49e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index c67ca41..c96f117 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 _0x0fec=['offset','undefined','limit','count','set','Content-Range','reject','save','then','name','send','index','map','VtigerField','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x1877f6,_0x2157c5){var _0x33055f=function(_0x55eb88){while(--_0x55eb88){_0x1877f6['push'](_0x1877f6['shift']());}};_0x33055f(++_0x2157c5);}(_0x0fec,0x143));var _0xc0fe=function(_0x56fd65,_0xf2b34b){_0x56fd65=_0x56fd65-0x0;var _0x3bcb50=_0x0fec[_0x56fd65];return _0x3bcb50;};'use strict';var emlformat=require(_0xc0fe('0x0'));var rimraf=require(_0xc0fe('0x1'));var zipdir=require(_0xc0fe('0x2'));var jsonpatch=require(_0xc0fe('0x3'));var rp=require(_0xc0fe('0x4'));var moment=require(_0xc0fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc0fe('0x6'));var util=require('util');var path=require(_0xc0fe('0x7'));var sox=require(_0xc0fe('0x8'));var csv=require(_0xc0fe('0x9'));var ejs=require(_0xc0fe('0xa'));var fs=require('fs');var fs_extra=require(_0xc0fe('0xb'));var _=require('lodash');var squel=require(_0xc0fe('0xc'));var crypto=require(_0xc0fe('0xd'));var jsforce=require(_0xc0fe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc0fe('0x9'));var querystring=require(_0xc0fe('0xf'));var Papa=require('papaparse');var Redis=require(_0xc0fe('0x10'));var authService=require(_0xc0fe('0x11'));var qs=require(_0xc0fe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0fe('0x13'));var logger=require('../../config/logger')(_0xc0fe('0x14'));var utils=require('../../config/utils');var config=require(_0xc0fe('0x15'));var licenseUtil=require(_0xc0fe('0x16'));var db=require(_0xc0fe('0x17'))['db'];function respondWithStatusCode(_0x5188b6,_0x24f538){_0x24f538=_0x24f538||0xcc;return function(_0xb565c5){if(_0xb565c5){return _0x5188b6['sendStatus'](_0x24f538);}return _0x5188b6[_0xc0fe('0x18')](_0x24f538)[_0xc0fe('0x19')]();};}function respondWithResult(_0x10be4e,_0x31b6f4){_0x31b6f4=_0x31b6f4||0xc8;return function(_0x505a4d){if(_0x505a4d){return _0x10be4e[_0xc0fe('0x18')](_0x31b6f4)[_0xc0fe('0x1a')](_0x505a4d);}};}function respondWithFilteredResult(_0x34ce86,_0x11ceeb){return function(_0x509f78){if(_0x509f78){var _0x33c0f9=typeof _0x11ceeb[_0xc0fe('0x1b')]===_0xc0fe('0x1c')&&typeof _0x11ceeb[_0xc0fe('0x1d')]===_0xc0fe('0x1c');var _0x3197fe=_0x509f78[_0xc0fe('0x1e')];var _0x3f995e=_0x33c0f9?0x0:_0x11ceeb[_0xc0fe('0x1b')];var _0x3ba841=_0x33c0f9?_0x509f78[_0xc0fe('0x1e')]:_0x11ceeb[_0xc0fe('0x1b')]+_0x11ceeb[_0xc0fe('0x1d')];var _0x4f633c;if(_0x3ba841>=_0x3197fe){_0x3ba841=_0x3197fe;_0x4f633c=0xc8;}else{_0x4f633c=0xce;}_0x34ce86[_0xc0fe('0x18')](_0x4f633c);return _0x34ce86[_0xc0fe('0x1f')](_0xc0fe('0x20'),_0x3f995e+'-'+_0x3ba841+'/'+_0x3197fe)['json'](_0x509f78);}return null;};}function patchUpdates(_0x357702){return function(_0x5c7768){try{jsonpatch['apply'](_0x5c7768,_0x357702,!![]);}catch(_0x1c1232){return BPromise[_0xc0fe('0x21')](_0x1c1232);}return _0x5c7768[_0xc0fe('0x22')]();};}function saveUpdates(_0x5d6c1d,_0x5659c7){return function(_0x339f8e){if(_0x339f8e){return _0x339f8e['update'](_0x5d6c1d)[_0xc0fe('0x23')](function(_0x2e6ad6){return _0x2e6ad6;});}return null;};}function removeEntity(_0x282264,_0x2e12e8){return function(_0x528245){if(_0x528245){return _0x528245['destroy']()['then'](function(){_0x282264[_0xc0fe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x394e58,_0x374be6){return function(_0x19edbd){if(!_0x19edbd){_0x394e58['sendStatus'](0x194);}return _0x19edbd;};}function handleError(_0x54323d,_0x1b1af3){_0x1b1af3=_0x1b1af3||0x1f4;return function(_0x595fed){logger['error'](_0x595fed['stack']);if(_0x595fed[_0xc0fe('0x24')]){delete _0x595fed[_0xc0fe('0x24')];}_0x54323d['status'](_0x1b1af3)[_0xc0fe('0x25')](_0x595fed);};}exports[_0xc0fe('0x26')]=function(_0x468cbd,_0x34f5e3){var _0x3f6ed8={},_0x3780b5={},_0x315870={'count':0x0,'rows':[]};var _0x2014cf=_[_0xc0fe('0x27')](db[_0xc0fe('0x28')][_0xc0fe('0x29')],function(_0x2eb8ad){return{'name':_0x2eb8ad['fieldName'],'type':_0x2eb8ad['type']['key']};});_0x3780b5['model']=_[_0xc0fe('0x27')](_0x2014cf,_0xc0fe('0x24'));_0x3780b5[_0xc0fe('0x2a')]=_[_0xc0fe('0x2b')](_0x468cbd[_0xc0fe('0x2a')]);_0x3780b5[_0xc0fe('0x2c')]=_[_0xc0fe('0x2d')](_0x3780b5[_0xc0fe('0x2e')],_0x3780b5['query']);_0x3f6ed8['attributes']=_[_0xc0fe('0x2d')](_0x3780b5[_0xc0fe('0x2e')],qs['fields'](_0x468cbd[_0xc0fe('0x2a')][_0xc0fe('0x2f')]));_0x3f6ed8[_0xc0fe('0x30')]=_0x3f6ed8[_0xc0fe('0x30')][_0xc0fe('0x31')]?_0x3f6ed8['attributes']:_0x3780b5[_0xc0fe('0x2e')];if(!_0x468cbd['query'][_0xc0fe('0x32')]('nolimit')){_0x3f6ed8['limit']=qs[_0xc0fe('0x1d')](_0x468cbd[_0xc0fe('0x2a')][_0xc0fe('0x1d')]);_0x3f6ed8[_0xc0fe('0x1b')]=qs[_0xc0fe('0x1b')](_0x468cbd[_0xc0fe('0x2a')]['offset']);}_0x3f6ed8[_0xc0fe('0x33')]=qs[_0xc0fe('0x34')](_0x468cbd[_0xc0fe('0x2a')][_0xc0fe('0x34')]);_0x3f6ed8[_0xc0fe('0x35')]=qs[_0xc0fe('0x2c')](_[_0xc0fe('0x36')](_0x468cbd['query'],_0x3780b5[_0xc0fe('0x2c')]),_0x2014cf);if(_0x468cbd[_0xc0fe('0x2a')][_0xc0fe('0x37')]){_0x3f6ed8[_0xc0fe('0x35')]=_[_0xc0fe('0x38')](_0x3f6ed8['where'],{'$or':_[_0xc0fe('0x27')](_0x2014cf,function(_0x5df375){if(_0x5df375['type']!==_0xc0fe('0x39')){var _0x125d52={};_0x125d52[_0x5df375[_0xc0fe('0x24')]]={'$like':'%'+_0x468cbd[_0xc0fe('0x2a')]['filter']+'%'};return _0x125d52;}})});}_0x3f6ed8=_[_0xc0fe('0x38')]({},_0x3f6ed8,_0x468cbd[_0xc0fe('0x3a')]);var _0x200b40={'where':_0x3f6ed8[_0xc0fe('0x35')]};return db[_0xc0fe('0x28')][_0xc0fe('0x1e')](_0x200b40)[_0xc0fe('0x23')](function(_0x2c97ca){_0x315870[_0xc0fe('0x1e')]=_0x2c97ca;if(_0x468cbd['query'][_0xc0fe('0x3b')]){_0x3f6ed8[_0xc0fe('0x3c')]=[{'all':!![]}];}return db[_0xc0fe('0x28')][_0xc0fe('0x3d')](_0x3f6ed8);})['then'](function(_0x3c5c79){_0x315870[_0xc0fe('0x3e')]=_0x3c5c79;return _0x315870;})[_0xc0fe('0x23')](respondWithFilteredResult(_0x34f5e3,_0x3f6ed8))[_0xc0fe('0x3f')](handleError(_0x34f5e3,null));};exports['show']=function(_0x202999,_0x186e8e){var _0x112b44={'raw':!![],'where':{'id':_0x202999['params']['id']}},_0x10573b={};_0x10573b['model']=_['keys'](db['VtigerField'][_0xc0fe('0x29')]);_0x10573b[_0xc0fe('0x2a')]=_[_0xc0fe('0x2b')](_0x202999[_0xc0fe('0x2a')]);_0x10573b[_0xc0fe('0x2c')]=_[_0xc0fe('0x2d')](_0x10573b[_0xc0fe('0x2e')],_0x10573b['query']);_0x112b44[_0xc0fe('0x30')]=_[_0xc0fe('0x2d')](_0x10573b[_0xc0fe('0x2e')],qs[_0xc0fe('0x2f')](_0x202999[_0xc0fe('0x2a')][_0xc0fe('0x2f')]));_0x112b44[_0xc0fe('0x30')]=_0x112b44[_0xc0fe('0x30')]['length']?_0x112b44['attributes']:_0x10573b['model'];if(_0x202999[_0xc0fe('0x2a')][_0xc0fe('0x3b')]){_0x112b44[_0xc0fe('0x3c')]=[{'all':!![]}];}_0x112b44=_[_0xc0fe('0x38')]({},_0x112b44,_0x202999[_0xc0fe('0x3a')]);return db['VtigerField'][_0xc0fe('0x40')](_0x112b44)[_0xc0fe('0x23')](handleEntityNotFound(_0x186e8e,null))[_0xc0fe('0x23')](respondWithResult(_0x186e8e,null))[_0xc0fe('0x3f')](handleError(_0x186e8e,null));};exports['create']=function(_0xf36764,_0x3322aa){return db[_0xc0fe('0x28')][_0xc0fe('0x41')](_0xf36764[_0xc0fe('0x42')],{})['then'](respondWithResult(_0x3322aa,0xc9))[_0xc0fe('0x3f')](handleError(_0x3322aa,null));};exports[_0xc0fe('0x43')]=function(_0x3b5a6b,_0x4f974a){if(_0x3b5a6b['body']['id']){delete _0x3b5a6b[_0xc0fe('0x42')]['id'];}return db[_0xc0fe('0x28')]['find']({'where':{'id':_0x3b5a6b[_0xc0fe('0x44')]['id']}})[_0xc0fe('0x23')](handleEntityNotFound(_0x4f974a,null))['then'](saveUpdates(_0x3b5a6b[_0xc0fe('0x42')],null))[_0xc0fe('0x23')](respondWithResult(_0x4f974a,null))[_0xc0fe('0x3f')](handleError(_0x4f974a,null));};exports[_0xc0fe('0x45')]=function(_0x11b2ce,_0x76ce5b){return db[_0xc0fe('0x28')][_0xc0fe('0x40')]({'where':{'id':_0x11b2ce['params']['id']}})[_0xc0fe('0x23')](handleEntityNotFound(_0x76ce5b,null))[_0xc0fe('0x23')](removeEntity(_0x76ce5b,null))[_0xc0fe('0x3f')](handleError(_0x76ce5b,null));}; \ No newline at end of file +var _0xa2f9=['model','query','keys','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','update','destroy','then','error','stack','name','map','VtigerField','rawAttributes','fieldName','type','key'];(function(_0x263596,_0x454b7c){var _0x52bceb=function(_0x8490a0){while(--_0x8490a0){_0x263596['push'](_0x263596['shift']());}};_0x52bceb(++_0x454b7c);}(_0xa2f9,0xe9));var _0x9a2f=function(_0x55667c,_0x511ec7){_0x55667c=_0x55667c-0x0;var _0x48b4eb=_0xa2f9[_0x55667c];return _0x48b4eb;};'use strict';var emlformat=require(_0x9a2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a2f('0x1'));var jsonpatch=require(_0x9a2f('0x2'));var rp=require('request-promise');var moment=require(_0x9a2f('0x3'));var BPromise=require(_0x9a2f('0x4'));var Mustache=require(_0x9a2f('0x5'));var util=require(_0x9a2f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9a2f('0x7'));var ejs=require(_0x9a2f('0x8'));var fs=require('fs');var fs_extra=require(_0x9a2f('0x9'));var _=require(_0x9a2f('0xa'));var squel=require(_0x9a2f('0xb'));var crypto=require(_0x9a2f('0xc'));var jsforce=require(_0x9a2f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9a2f('0x7'));var querystring=require(_0x9a2f('0xe'));var Papa=require(_0x9a2f('0xf'));var Redis=require('ioredis');var authService=require(_0x9a2f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9a2f('0x11'));var hardwareService=require(_0x9a2f('0x12'));var logger=require(_0x9a2f('0x13'))(_0x9a2f('0x14'));var utils=require(_0x9a2f('0x15'));var config=require(_0x9a2f('0x16'));var licenseUtil=require(_0x9a2f('0x17'));var db=require(_0x9a2f('0x18'))['db'];function respondWithStatusCode(_0x5afc20,_0x2d0bfa){_0x2d0bfa=_0x2d0bfa||0xcc;return function(_0x243d16){if(_0x243d16){return _0x5afc20[_0x9a2f('0x19')](_0x2d0bfa);}return _0x5afc20['status'](_0x2d0bfa)[_0x9a2f('0x1a')]();};}function respondWithResult(_0x346da2,_0x36e40f){_0x36e40f=_0x36e40f||0xc8;return function(_0x46d51f){if(_0x46d51f){return _0x346da2[_0x9a2f('0x1b')](_0x36e40f)[_0x9a2f('0x1c')](_0x46d51f);}};}function respondWithFilteredResult(_0x2b5eb5,_0x153374){return function(_0x21e45f){if(_0x21e45f){var _0x296712=typeof _0x153374[_0x9a2f('0x1d')]===_0x9a2f('0x1e')&&typeof _0x153374['limit']===_0x9a2f('0x1e');var _0x47c322=_0x21e45f[_0x9a2f('0x1f')];var _0xf1b9aa=_0x296712?0x0:_0x153374[_0x9a2f('0x1d')];var _0x56bb80=_0x296712?_0x21e45f[_0x9a2f('0x1f')]:_0x153374[_0x9a2f('0x1d')]+_0x153374[_0x9a2f('0x20')];var _0x2374dd;if(_0x56bb80>=_0x47c322){_0x56bb80=_0x47c322;_0x2374dd=0xc8;}else{_0x2374dd=0xce;}_0x2b5eb5['status'](_0x2374dd);return _0x2b5eb5['set'](_0x9a2f('0x21'),_0xf1b9aa+'-'+_0x56bb80+'/'+_0x47c322)[_0x9a2f('0x1c')](_0x21e45f);}return null;};}function patchUpdates(_0x3bba03){return function(_0x76a559){try{jsonpatch[_0x9a2f('0x22')](_0x76a559,_0x3bba03,!![]);}catch(_0x3a4dda){return BPromise['reject'](_0x3a4dda);}return _0x76a559['save']();};}function saveUpdates(_0x33c444,_0x29e820){return function(_0x3b283f){if(_0x3b283f){return _0x3b283f[_0x9a2f('0x23')](_0x33c444)['then'](function(_0x23f411){return _0x23f411;});}return null;};}function removeEntity(_0x13828d,_0x29808b){return function(_0x4dd19a){if(_0x4dd19a){return _0x4dd19a[_0x9a2f('0x24')]()[_0x9a2f('0x25')](function(){_0x13828d[_0x9a2f('0x1b')](0xcc)[_0x9a2f('0x1a')]();});}};}function handleEntityNotFound(_0x4fd7bd,_0x2bbf76){return function(_0xa552c8){if(!_0xa552c8){_0x4fd7bd[_0x9a2f('0x19')](0x194);}return _0xa552c8;};}function handleError(_0x3cfb85,_0x4e59cb){_0x4e59cb=_0x4e59cb||0x1f4;return function(_0x29ce80){logger[_0x9a2f('0x26')](_0x29ce80[_0x9a2f('0x27')]);if(_0x29ce80[_0x9a2f('0x28')]){delete _0x29ce80[_0x9a2f('0x28')];}_0x3cfb85['status'](_0x4e59cb)['send'](_0x29ce80);};}exports['index']=function(_0x2e5703,_0x11bf09){var _0x5f53e9={},_0x509c23={},_0x58bd88={'count':0x0,'rows':[]};var _0x370335=_[_0x9a2f('0x29')](db[_0x9a2f('0x2a')][_0x9a2f('0x2b')],function(_0x8e63a6){return{'name':_0x8e63a6[_0x9a2f('0x2c')],'type':_0x8e63a6[_0x9a2f('0x2d')][_0x9a2f('0x2e')]};});_0x509c23[_0x9a2f('0x2f')]=_[_0x9a2f('0x29')](_0x370335,_0x9a2f('0x28'));_0x509c23[_0x9a2f('0x30')]=_[_0x9a2f('0x31')](_0x2e5703[_0x9a2f('0x30')]);_0x509c23['filters']=_['intersection'](_0x509c23[_0x9a2f('0x2f')],_0x509c23[_0x9a2f('0x30')]);_0x5f53e9[_0x9a2f('0x32')]=_['intersection'](_0x509c23[_0x9a2f('0x2f')],qs[_0x9a2f('0x33')](_0x2e5703[_0x9a2f('0x30')][_0x9a2f('0x33')]));_0x5f53e9['attributes']=_0x5f53e9[_0x9a2f('0x32')][_0x9a2f('0x34')]?_0x5f53e9[_0x9a2f('0x32')]:_0x509c23[_0x9a2f('0x2f')];if(!_0x2e5703['query']['hasOwnProperty'](_0x9a2f('0x35'))){_0x5f53e9[_0x9a2f('0x20')]=qs['limit'](_0x2e5703[_0x9a2f('0x30')][_0x9a2f('0x20')]);_0x5f53e9[_0x9a2f('0x1d')]=qs[_0x9a2f('0x1d')](_0x2e5703['query'][_0x9a2f('0x1d')]);}_0x5f53e9['order']=qs[_0x9a2f('0x36')](_0x2e5703[_0x9a2f('0x30')][_0x9a2f('0x36')]);_0x5f53e9[_0x9a2f('0x37')]=qs[_0x9a2f('0x38')](_['pick'](_0x2e5703['query'],_0x509c23[_0x9a2f('0x38')]),_0x370335);if(_0x2e5703[_0x9a2f('0x30')][_0x9a2f('0x39')]){_0x5f53e9[_0x9a2f('0x37')]=_[_0x9a2f('0x3a')](_0x5f53e9['where'],{'$or':_[_0x9a2f('0x29')](_0x370335,function(_0x545e2f){if(_0x545e2f[_0x9a2f('0x2d')]!==_0x9a2f('0x3b')){var _0x2d2cc3={};_0x2d2cc3[_0x545e2f[_0x9a2f('0x28')]]={'$like':'%'+_0x2e5703[_0x9a2f('0x30')][_0x9a2f('0x39')]+'%'};return _0x2d2cc3;}})});}_0x5f53e9=_[_0x9a2f('0x3a')]({},_0x5f53e9,_0x2e5703[_0x9a2f('0x3c')]);var _0x592ace={'where':_0x5f53e9[_0x9a2f('0x37')]};return db[_0x9a2f('0x2a')][_0x9a2f('0x1f')](_0x592ace)[_0x9a2f('0x25')](function(_0x155130){_0x58bd88[_0x9a2f('0x1f')]=_0x155130;if(_0x2e5703[_0x9a2f('0x30')][_0x9a2f('0x3d')]){_0x5f53e9[_0x9a2f('0x3e')]=[{'all':!![]}];}return db[_0x9a2f('0x2a')]['findAll'](_0x5f53e9);})[_0x9a2f('0x25')](function(_0x5cf6e0){_0x58bd88[_0x9a2f('0x3f')]=_0x5cf6e0;return _0x58bd88;})[_0x9a2f('0x25')](respondWithFilteredResult(_0x11bf09,_0x5f53e9))[_0x9a2f('0x40')](handleError(_0x11bf09,null));};exports['show']=function(_0x22cfdb,_0x106da3){var _0x4affc3={'raw':!![],'where':{'id':_0x22cfdb[_0x9a2f('0x41')]['id']}},_0x1828bd={};_0x1828bd[_0x9a2f('0x2f')]=_[_0x9a2f('0x31')](db[_0x9a2f('0x2a')][_0x9a2f('0x2b')]);_0x1828bd[_0x9a2f('0x30')]=_['keys'](_0x22cfdb['query']);_0x1828bd['filters']=_[_0x9a2f('0x42')](_0x1828bd[_0x9a2f('0x2f')],_0x1828bd['query']);_0x4affc3['attributes']=_['intersection'](_0x1828bd[_0x9a2f('0x2f')],qs['fields'](_0x22cfdb[_0x9a2f('0x30')][_0x9a2f('0x33')]));_0x4affc3[_0x9a2f('0x32')]=_0x4affc3[_0x9a2f('0x32')]['length']?_0x4affc3[_0x9a2f('0x32')]:_0x1828bd[_0x9a2f('0x2f')];if(_0x22cfdb['query']['includeAll']){_0x4affc3[_0x9a2f('0x3e')]=[{'all':!![]}];}_0x4affc3=_[_0x9a2f('0x3a')]({},_0x4affc3,_0x22cfdb[_0x9a2f('0x3c')]);return db[_0x9a2f('0x2a')][_0x9a2f('0x43')](_0x4affc3)[_0x9a2f('0x25')](handleEntityNotFound(_0x106da3,null))[_0x9a2f('0x25')](respondWithResult(_0x106da3,null))[_0x9a2f('0x40')](handleError(_0x106da3,null));};exports[_0x9a2f('0x44')]=function(_0x3f6031,_0x44b436){return db[_0x9a2f('0x2a')][_0x9a2f('0x44')](_0x3f6031['body'],{})[_0x9a2f('0x25')](respondWithResult(_0x44b436,0xc9))[_0x9a2f('0x40')](handleError(_0x44b436,null));};exports[_0x9a2f('0x23')]=function(_0x4e6aec,_0x11057e){if(_0x4e6aec[_0x9a2f('0x45')]['id']){delete _0x4e6aec[_0x9a2f('0x45')]['id'];}return db[_0x9a2f('0x2a')]['find']({'where':{'id':_0x4e6aec[_0x9a2f('0x41')]['id']}})[_0x9a2f('0x25')](handleEntityNotFound(_0x11057e,null))[_0x9a2f('0x25')](saveUpdates(_0x4e6aec[_0x9a2f('0x45')],null))[_0x9a2f('0x25')](respondWithResult(_0x11057e,null))[_0x9a2f('0x40')](handleError(_0x11057e,null));};exports[_0x9a2f('0x24')]=function(_0x34d875,_0x2e886f){return db[_0x9a2f('0x2a')][_0x9a2f('0x43')]({'where':{'id':_0x34d875[_0x9a2f('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e886f,null))[_0x9a2f('0x25')](removeEntity(_0x2e886f,null))[_0x9a2f('0x40')](handleError(_0x2e886f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 2ddbf28..8a66a23 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 _0x1884=['rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','api','moment','bluebird'];(function(_0x346626,_0x43a58e){var _0x58ad1b=function(_0x44da30){while(--_0x44da30){_0x346626['push'](_0x346626['shift']());}};_0x58ad1b(++_0x43a58e);}(_0x1884,0x105));var _0x4188=function(_0x123c4a,_0x46690b){_0x123c4a=_0x123c4a-0x0;var _0x62dd61=_0x1884[_0x123c4a];return _0x62dd61;};'use strict';var _=require(_0x4188('0x0'));var util=require(_0x4188('0x1'));var logger=require('../../config/logger')(_0x4188('0x2'));var moment=require(_0x4188('0x3'));var BPromise=require(_0x4188('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4188('0x5'));var config=require(_0x4188('0x6'));var attributes=require(_0x4188('0x7'));module[_0x4188('0x8')]=function(_0x3f8eeb,_0x1b5ac5){return _0x3f8eeb[_0x4188('0x9')](_0x4188('0xa'),attributes,{'tableName':_0x4188('0xb'),'paranoid':![],'indexes':[{'name':_0x4188('0xc'),'fields':['idField',_0x4188('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb27=['bluebird','request-promise','path','rimraf','./intVtigerField.attributes','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x3321c7,_0x1388b5){var _0x56513d=function(_0x1f5dad){while(--_0x1f5dad){_0x3321c7['push'](_0x3321c7['shift']());}};_0x56513d(++_0x1388b5);}(_0xfb27,0xe0));var _0x7fb2=function(_0x3c7152,_0x302b29){_0x3c7152=_0x3c7152-0x0;var _0x43aea5=_0xfb27[_0x3c7152];return _0x43aea5;};'use strict';var _=require(_0x7fb2('0x0'));var util=require(_0x7fb2('0x1'));var logger=require(_0x7fb2('0x2'))(_0x7fb2('0x3'));var moment=require('moment');var BPromise=require(_0x7fb2('0x4'));var rp=require(_0x7fb2('0x5'));var fs=require('fs');var path=require(_0x7fb2('0x6'));var rimraf=require(_0x7fb2('0x7'));var config=require('../../config/environment');var attributes=require(_0x7fb2('0x8'));module['exports']=function(_0x2df83c,_0x3e66e2){return _0x2df83c['define']('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7fb2('0x9'),'fields':[_0x7fb2('0xa'),_0x7fb2('0xb')],'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 5ff094b..ed49791 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 _0x5b65=['http','request','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5a8fc9,_0x503fdc){var _0x108d1d=function(_0x3852ae){while(--_0x3852ae){_0x5a8fc9['push'](_0x5a8fc9['shift']());}};_0x108d1d(++_0x503fdc);}(_0x5b65,0x80));var _0x55b6=function(_0x4dba07,_0x59e068){_0x4dba07=_0x4dba07-0x0;var _0x4f5c25=_0x5b65[_0x4dba07];return _0x4f5c25;};'use strict';var _=require(_0x55b6('0x0'));var util=require(_0x55b6('0x1'));var moment=require(_0x55b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x55b6('0x3'));var fs=require('fs');var Redis=require(_0x55b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x55b6('0x5'));var logger=require(_0x55b6('0x6'))('rpc');var config=require(_0x55b6('0x7'));var jayson=require(_0x55b6('0x8'));var client=jayson[_0x55b6('0x9')][_0x55b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e9676,_0x215ec4,_0x523564){return new BPromise(function(_0x32407b,_0x41aee6){return client[_0x55b6('0xb')](_0x2e9676,_0x523564)[_0x55b6('0xc')](function(_0x17449f){logger[_0x55b6('0xd')](_0x55b6('0xe'),_0x215ec4,'request\x20sent');logger['debug'](_0x55b6('0xf'),_0x215ec4,_0x55b6('0x10'),JSON[_0x55b6('0x11')](_0x17449f));if(_0x17449f[_0x55b6('0x12')]){if(_0x17449f[_0x55b6('0x12')][_0x55b6('0x13')]===0x1f4){logger[_0x55b6('0x12')](_0x55b6('0xe'),_0x215ec4,_0x17449f[_0x55b6('0x12')]['message']);return _0x41aee6(_0x17449f['error'][_0x55b6('0x14')]);}logger['error'](_0x55b6('0xe'),_0x215ec4,_0x17449f[_0x55b6('0x12')][_0x55b6('0x14')]);return _0x32407b(_0x17449f[_0x55b6('0x12')][_0x55b6('0x14')]);}else{logger['info'](_0x55b6('0xe'),_0x215ec4,_0x55b6('0x10'));_0x32407b(_0x17449f[_0x55b6('0x15')][_0x55b6('0x14')]);}})[_0x55b6('0x16')](function(_0x4449bc){logger[_0x55b6('0x12')]('VtigerField,\x20%s,\x20%s',_0x215ec4,_0x4449bc);_0x41aee6(_0x4449bc);});});} \ No newline at end of file +var _0xcebc=['VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45ce30,_0x2b5ec7){var _0x2eeafb=function(_0x3faf9d){while(--_0x3faf9d){_0x45ce30['push'](_0x45ce30['shift']());}};_0x2eeafb(++_0x2b5ec7);}(_0xcebc,0xce));var _0xcceb=function(_0x9d36ce,_0x6aa1a7){_0x9d36ce=_0x9d36ce-0x0;var _0x1ab979=_0xcebc[_0x9d36ce];return _0x1ab979;};'use strict';var _=require(_0xcceb('0x0'));var util=require(_0xcceb('0x1'));var moment=require(_0xcceb('0x2'));var BPromise=require('bluebird');var rs=require(_0xcceb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcceb('0x4'));var logger=require('../../config/logger')(_0xcceb('0x5'));var config=require(_0xcceb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcceb('0x7')][_0xcceb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e151f,_0x537abb,_0x2d5564){return new BPromise(function(_0x316526,_0x167a2){return client[_0xcceb('0x9')](_0x1e151f,_0x2d5564)[_0xcceb('0xa')](function(_0x337581){logger['info'](_0xcceb('0xb'),_0x537abb,_0xcceb('0xc'));logger[_0xcceb('0xd')](_0xcceb('0xe'),_0x537abb,_0xcceb('0xc'),JSON['stringify'](_0x337581));if(_0x337581[_0xcceb('0xf')]){if(_0x337581[_0xcceb('0xf')][_0xcceb('0x10')]===0x1f4){logger['error'](_0xcceb('0xb'),_0x537abb,_0x337581[_0xcceb('0xf')][_0xcceb('0x11')]);return _0x167a2(_0x337581['error'][_0xcceb('0x11')]);}logger[_0xcceb('0xf')](_0xcceb('0xb'),_0x537abb,_0x337581[_0xcceb('0xf')]['message']);return _0x316526(_0x337581[_0xcceb('0xf')][_0xcceb('0x11')]);}else{logger[_0xcceb('0x12')](_0xcceb('0xb'),_0x537abb,_0xcceb('0xc'));_0x316526(_0x337581['result'][_0xcceb('0x11')]);}})[_0xcceb('0x13')](function(_0x326e48){logger[_0xcceb('0xf')]('VtigerField,\x20%s,\x20%s',_0x537abb,_0x326e48);_0x167a2(_0x326e48);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index a1fa09f..9ead15f 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 _0x6fcd=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x17fe77,_0x3ed5ca){var _0x5efa87=function(_0x1fe411){while(--_0x1fe411){_0x17fe77['push'](_0x17fe77['shift']());}};_0x5efa87(++_0x3ed5ca);}(_0x6fcd,0x19b));var _0xd6fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6fcd[_0x122ef9];return _0x42fba0;};'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')]('/',auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x11')]);router[_0xd6fc('0x10')](_0xd6fc('0xc'),auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x12')]);router[_0xd6fc('0x13')]('/:id',auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x14')]);router['delete'](_0xd6fc('0xa'),auth[_0xd6fc('0x9')](),controller[_0xd6fc('0x15')]);module[_0xd6fc('0x16')]=router; \ No newline at end of file +var _0x5188=['/:id','show','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','index','get'];(function(_0x2b0ad1,_0x12348f){var _0x42c1ee=function(_0x215fd3){while(--_0x215fd3){_0x2b0ad1['push'](_0x2b0ad1['shift']());}};_0x42c1ee(++_0x12348f);}(_0x5188,0xe6));var _0x8518=function(_0x30e8db,_0x7be04b){_0x30e8db=_0x30e8db-0x0;var _0x5d96f5=_0x5188[_0x30e8db];return _0x5d96f5;};'use strict';var multer=require(_0x8518('0x0'));var util=require(_0x8518('0x1'));var path=require('path');var timeout=require(_0x8518('0x2'));var express=require(_0x8518('0x3'));var router=express[_0x8518('0x4')]();var fs_extra=require(_0x8518('0x5'));var auth=require(_0x8518('0x6'));var interaction=require(_0x8518('0x7'));var config=require('../../config/environment');var controller=require(_0x8518('0x8'));router['get']('/',auth[_0x8518('0x9')](),controller[_0x8518('0xa')]);router[_0x8518('0xb')](_0x8518('0xc'),auth[_0x8518('0x9')](),controller[_0x8518('0xd')]);router[_0x8518('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8518('0xe')]);router[_0x8518('0xb')](_0x8518('0xf'),auth['isAuthenticated'](),controller[_0x8518('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8518('0x11')]);router[_0x8518('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8518('0x13')]);router['put'](_0x8518('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8518('0xc'),auth['isAuthenticated'](),controller[_0x8518('0x14')]);module[_0x8518('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 650cc66..52e6348 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 _0x4137=['sequelize','exports','STRING','username','remoteUri','ENUM','password','integrationTab'];(function(_0x4548bb,_0x3cb9b3){var _0x310687=function(_0x5859dc){while(--_0x5859dc){_0x4548bb['push'](_0x4548bb['shift']());}};_0x310687(++_0x3cb9b3);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize[_0x7413('0x2')]},'description':{'type':Sequelize[_0x7413('0x2')]},'username':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x3')},'password':{'type':Sequelize[_0x7413('0x2')]},'token':{'type':Sequelize[_0x7413('0x2')]},'remoteUri':{'type':Sequelize[_0x7413('0x2')],'unique':_0x7413('0x4')},'authType':{'type':Sequelize[_0x7413('0x5')](_0x7413('0x6'),'token'),'defaultValue':_0x7413('0x6')},'serverUrl':{'type':Sequelize[_0x7413('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7413('0x5')](_0x7413('0x7'),'newTab'),'defaultValue':_0x7413('0x7')}}; \ No newline at end of file +var _0x4991=['STRING','username','remoteUri','ENUM','password','integrationTab','newTab','sequelize'];(function(_0x3ff063,_0x2facc5){var _0x23effc=function(_0x3d31f6){while(--_0x3d31f6){_0x3ff063['push'](_0x3ff063['shift']());}};_0x23effc(++_0x2facc5);}(_0x4991,0xf7));var _0x1499=function(_0x4ad879,_0x5ec7c4){_0x4ad879=_0x4ad879-0x0;var _0x86d2d9=_0x4991[_0x4ad879];return _0x86d2d9;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'password':{'type':Sequelize[_0x1499('0x1')]},'token':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'authType':{'type':Sequelize[_0x1499('0x4')](_0x1499('0x5'),'token'),'defaultValue':_0x1499('0x5')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1499('0x4')](_0x1499('0x6'),_0x1499('0x7')),'defaultValue':_0x1499('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 668aa92..df16ef4 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 _0xd87e=['undefined','count','limit','set','Content-Range','reject','update','destroy','error','stack','name','index','ZendeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','then','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','order','pick','filter','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x1ad68e,_0x16562f){var _0x82d21e=function(_0x755572){while(--_0x755572){_0x1ad68e['push'](_0x1ad68e['shift']());}};_0x82d21e(++_0x16562f);}(_0xd87e,0x1bf));var _0xed87=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xd87e[_0x34b821];return _0x5e00a0;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4ffc2d,_0x466f35){_0x466f35=_0x466f35||0xcc;return function(_0x32276e){if(_0x32276e){return _0x4ffc2d[_0xed87('0x18')](_0x466f35);}return _0x4ffc2d[_0xed87('0x19')](_0x466f35)[_0xed87('0x1a')]();};}function respondWithResult(_0x3865c5,_0x52dfe8){_0x52dfe8=_0x52dfe8||0xc8;return function(_0x4494da){if(_0x4494da){return _0x3865c5[_0xed87('0x19')](_0x52dfe8)[_0xed87('0x1b')](_0x4494da);}};}function respondWithFilteredResult(_0x1e9a3d,_0x2f2fd3){return function(_0xd34e0e){if(_0xd34e0e){var _0x173413=typeof _0x2f2fd3[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x2f2fd3['limit']===_0xed87('0x1d');var _0x18ab7d=_0xd34e0e[_0xed87('0x1e')];var _0xfb8a44=_0x173413?0x0:_0x2f2fd3['offset'];var _0x211085=_0x173413?_0xd34e0e[_0xed87('0x1e')]:_0x2f2fd3[_0xed87('0x1c')]+_0x2f2fd3[_0xed87('0x1f')];var _0x98a2ca;if(_0x211085>=_0x18ab7d){_0x211085=_0x18ab7d;_0x98a2ca=0xc8;}else{_0x98a2ca=0xce;}_0x1e9a3d[_0xed87('0x19')](_0x98a2ca);return _0x1e9a3d[_0xed87('0x20')](_0xed87('0x21'),_0xfb8a44+'-'+_0x211085+'/'+_0x18ab7d)[_0xed87('0x1b')](_0xd34e0e);}return null;};}function patchUpdates(_0x52e81c){return function(_0x5a7329){try{jsonpatch['apply'](_0x5a7329,_0x52e81c,!![]);}catch(_0x47c121){return BPromise[_0xed87('0x22')](_0x47c121);}return _0x5a7329['save']();};}function saveUpdates(_0x4191a7,_0x2b0b98){return function(_0x5b1659){if(_0x5b1659){return _0x5b1659[_0xed87('0x23')](_0x4191a7)['then'](function(_0x3d1641){return _0x3d1641;});}return null;};}function removeEntity(_0x24962e,_0x27799a){return function(_0x2a8733){if(_0x2a8733){return _0x2a8733[_0xed87('0x24')]()['then'](function(){_0x24962e[_0xed87('0x19')](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x41e0d4,_0x320bcc){return function(_0x31c600){if(!_0x31c600){_0x41e0d4[_0xed87('0x18')](0x194);}return _0x31c600;};}function handleError(_0x25a6f7,_0x4735b3){_0x4735b3=_0x4735b3||0x1f4;return function(_0x40b2fa){logger[_0xed87('0x25')](_0x40b2fa[_0xed87('0x26')]);if(_0x40b2fa[_0xed87('0x27')]){delete _0x40b2fa[_0xed87('0x27')];}_0x25a6f7[_0xed87('0x19')](_0x4735b3)['send'](_0x40b2fa);};}exports[_0xed87('0x28')]=function(_0x1c4a65,_0x4eaa44){var _0x3dff74={},_0x33c367={},_0x21c93b={'count':0x0,'rows':[]};var _0x4b259e=_['map'](db[_0xed87('0x29')][_0xed87('0x2a')],function(_0x21ab8a){return{'name':_0x21ab8a['fieldName'],'type':_0x21ab8a[_0xed87('0x2b')][_0xed87('0x2c')]};});_0x33c367[_0xed87('0x2d')]=_[_0xed87('0x2e')](_0x4b259e,_0xed87('0x27'));_0x33c367[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x1c4a65[_0xed87('0x2f')]);_0x33c367[_0xed87('0x31')]=_['intersection'](_0x33c367[_0xed87('0x2d')],_0x33c367[_0xed87('0x2f')]);_0x3dff74['attributes']=_[_0xed87('0x32')](_0x33c367['model'],qs[_0xed87('0x33')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x33')]));_0x3dff74[_0xed87('0x34')]=_0x3dff74[_0xed87('0x34')][_0xed87('0x35')]?_0x3dff74[_0xed87('0x34')]:_0x33c367[_0xed87('0x2d')];if(!_0x1c4a65[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x3dff74['limit']=qs[_0xed87('0x1f')](_0x1c4a65[_0xed87('0x2f')]['limit']);_0x3dff74[_0xed87('0x1c')]=qs['offset'](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x1c')]);}_0x3dff74['order']=qs[_0xed87('0x38')](_0x1c4a65[_0xed87('0x2f')][_0xed87('0x38')]);_0x3dff74[_0xed87('0x39')]=qs[_0xed87('0x31')](_['pick'](_0x1c4a65[_0xed87('0x2f')],_0x33c367['filters']),_0x4b259e);if(_0x1c4a65[_0xed87('0x2f')]['filter']){_0x3dff74[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x3dff74[_0xed87('0x39')],{'$or':_[_0xed87('0x2e')](_0x4b259e,function(_0x319f69){if(_0x319f69[_0xed87('0x2b')]!==_0xed87('0x3b')){var _0x161491={};_0x161491[_0x319f69[_0xed87('0x27')]]={'$like':'%'+_0x1c4a65['query']['filter']+'%'};return _0x161491;}})});}_0x3dff74=_[_0xed87('0x3a')]({},_0x3dff74,_0x1c4a65[_0xed87('0x3c')]);var _0x1f16a8={'where':_0x3dff74[_0xed87('0x39')]};return db[_0xed87('0x29')][_0xed87('0x1e')](_0x1f16a8)['then'](function(_0x4398a0){_0x21c93b[_0xed87('0x1e')]=_0x4398a0;if(_0x1c4a65[_0xed87('0x2f')]['includeAll']){_0x3dff74[_0xed87('0x3d')]=[{'all':!![]}];}return db[_0xed87('0x29')][_0xed87('0x3e')](_0x3dff74);})[_0xed87('0x3f')](function(_0x1d1e99){_0x21c93b[_0xed87('0x40')]=_0x1d1e99;return _0x21c93b;})[_0xed87('0x3f')](respondWithFilteredResult(_0x4eaa44,_0x3dff74))[_0xed87('0x41')](handleError(_0x4eaa44,null));};exports[_0xed87('0x42')]=function(_0x406b73,_0x5c6925){var _0x7e6cbb={'raw':![],'where':{'id':_0x406b73[_0xed87('0x43')]['id']}},_0x3c7fcc={};_0x3c7fcc['model']=_['keys'](db[_0xed87('0x29')][_0xed87('0x2a')]);_0x3c7fcc[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x406b73['query']);_0x3c7fcc[_0xed87('0x31')]=_[_0xed87('0x32')](_0x3c7fcc['model'],_0x3c7fcc[_0xed87('0x2f')]);_0x7e6cbb[_0xed87('0x34')]=_[_0xed87('0x32')](_0x3c7fcc[_0xed87('0x2d')],qs[_0xed87('0x33')](_0x406b73[_0xed87('0x2f')][_0xed87('0x33')]));_0x7e6cbb[_0xed87('0x34')]=_0x7e6cbb[_0xed87('0x34')][_0xed87('0x35')]?_0x7e6cbb[_0xed87('0x34')]:_0x3c7fcc['model'];if(_0x406b73[_0xed87('0x2f')][_0xed87('0x44')]){_0x7e6cbb[_0xed87('0x3d')]=[{'all':!![]}];}_0x7e6cbb=_[_0xed87('0x3a')]({},_0x7e6cbb,_0x406b73[_0xed87('0x3c')]);return db[_0xed87('0x29')][_0xed87('0x45')](_0x7e6cbb)[_0xed87('0x3f')](handleEntityNotFound(_0x5c6925,null))[_0xed87('0x3f')](respondWithResult(_0x5c6925,null))[_0xed87('0x41')](handleError(_0x5c6925,null));};exports[_0xed87('0x46')]=function(_0x26c8f4,_0x27ed22){return db[_0xed87('0x29')][_0xed87('0x46')](_0x26c8f4[_0xed87('0x47')],{})[_0xed87('0x3f')](respondWithResult(_0x27ed22,0xc9))['catch'](handleError(_0x27ed22,null));};exports[_0xed87('0x23')]=function(_0x1a68a7,_0x3a91c5){if(_0x1a68a7['body']['id']){delete _0x1a68a7[_0xed87('0x47')]['id'];}return db[_0xed87('0x29')]['find']({'where':{'id':_0x1a68a7[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3a91c5,null))[_0xed87('0x3f')](saveUpdates(_0x1a68a7[_0xed87('0x47')],null))['then'](respondWithResult(_0x3a91c5,null))[_0xed87('0x41')](handleError(_0x3a91c5,null));};exports[_0xed87('0x24')]=function(_0x3ca34c,_0x272a07){return db[_0xed87('0x29')][_0xed87('0x45')]({'where':{'id':_0x3ca34c[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x272a07,null))[_0xed87('0x3f')](removeEntity(_0x272a07,null))[_0xed87('0x41')](handleError(_0x272a07,null));};exports[_0xed87('0x48')]=function(_0x18846f,_0x2e5a9f,_0x4df105){var _0x43ffa4={};var _0x4ea4e3={};var _0x17cad7;var _0x329973;return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x18846f[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x2e5a9f,null))[_0xed87('0x3f')](function(_0xccdbb6){if(_0xccdbb6){_0x17cad7=_0xccdbb6;_0x4ea4e3[_0xed87('0x2d')]=_[_0xed87('0x30')](db['ZendeskConfiguration'][_0xed87('0x2a')]);_0x4ea4e3[_0xed87('0x2f')]=_[_0xed87('0x30')](_0x18846f[_0xed87('0x2f')]);_0x4ea4e3[_0xed87('0x31')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],_0x4ea4e3[_0xed87('0x2f')]);_0x43ffa4[_0xed87('0x34')]=_[_0xed87('0x32')](_0x4ea4e3[_0xed87('0x2d')],qs['fields'](_0x18846f['query'][_0xed87('0x33')]));_0x43ffa4[_0xed87('0x34')]=_0x43ffa4[_0xed87('0x34')][_0xed87('0x35')]?_0x43ffa4[_0xed87('0x34')]:_0x4ea4e3['model'];_0x43ffa4[_0xed87('0x4a')]=qs[_0xed87('0x38')](_0x18846f[_0xed87('0x2f')][_0xed87('0x38')]);_0x43ffa4[_0xed87('0x39')]=qs[_0xed87('0x31')](_[_0xed87('0x4b')](_0x18846f[_0xed87('0x2f')],_0x4ea4e3[_0xed87('0x31')]));if(_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]){_0x43ffa4[_0xed87('0x39')]=_[_0xed87('0x3a')](_0x43ffa4[_0xed87('0x39')],{'$or':_['map'](_0x43ffa4[_0xed87('0x34')],function(_0x10a19c){var _0x2f03d4={};_0x2f03d4[_0x10a19c]={'$like':'%'+_0x18846f[_0xed87('0x2f')][_0xed87('0x4c')]+'%'};return _0x2f03d4;})});}_0x43ffa4=_[_0xed87('0x3a')]({},_0x43ffa4,_0x18846f[_0xed87('0x3c')]);return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})['then'](function(_0x4367c3){if(_0x4367c3){_0x329973=_0x4367c3[_0xed87('0x35')];if(!_0x18846f[_0xed87('0x2f')][_0xed87('0x36')](_0xed87('0x37'))){_0x43ffa4[_0xed87('0x1f')]=qs['limit'](_0x18846f['query'][_0xed87('0x1f')]);_0x43ffa4[_0xed87('0x1c')]=qs[_0xed87('0x1c')](_0x18846f[_0xed87('0x2f')][_0xed87('0x1c')]);}return _0x17cad7[_0xed87('0x48')](_0x43ffa4);}})[_0xed87('0x3f')](function(_0x3bdf7c){if(_0x3bdf7c){return _0x3bdf7c?{'count':_0x329973,'rows':_0x3bdf7c}:null;}})['then'](respondWithResult(_0x2e5a9f,null))[_0xed87('0x41')](handleError(_0x2e5a9f,null));};exports['addConfiguration']=function(_0xd3b300,_0x3c82de,_0x4e5055){if(_0xd3b300[_0xed87('0x47')]['id']){delete _0xd3b300[_0xed87('0x47')]['id'];}return db['ZendeskAccount'][_0xed87('0x49')]({'where':{'id':_0xd3b300[_0xed87('0x43')]['id']}})[_0xed87('0x3f')](handleEntityNotFound(_0x3c82de,null))[_0xed87('0x3f')](function(_0x112685){if(_0x112685){_0xd3b300['body'][_0xed87('0x4d')]=_0x112685['id'];_0xd3b300[_0xed87('0x47')][_0xed87('0x4e')]=integrations[_0xed87('0x4f')](_0xd3b300['body']['channel'],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);_0xd3b300['body'][_0xed87('0x50')]=integrations[_0xed87('0x51')](_0xd3b300[_0xed87('0x47')][_0xed87('0x52')],_0xd3b300[_0xed87('0x47')][_0xed87('0x2b')]);return db[_0xed87('0x53')][_0xed87('0x46')](_0xd3b300[_0xed87('0x47')],{'include':[{'model':db[_0xed87('0x54')],'as':_0xed87('0x4e')},{'model':db[_0xed87('0x54')],'as':_0xed87('0x50')}]});}return null;})[_0xed87('0x3f')](respondWithResult(_0x3c82de,null))['catch'](handleError(_0x3c82de,null));};exports[_0xed87('0x55')]=function(_0x2686cd,_0x566ace,_0x4f7b92){var _0x5136c9='';return db[_0xed87('0x29')][_0xed87('0x49')]({'where':{'id':_0x2686cd[_0xed87('0x43')]['id']},'attributes':['id',_0xed87('0x56'),_0xed87('0x57'),_0xed87('0x58'),_0xed87('0x59'),'remoteUri']})[_0xed87('0x3f')](handleEntityNotFound(_0x566ace,null))[_0xed87('0x3f')](function(_0x3b6a9b){if(_0x3b6a9b){_0x5136c9=_0x3b6a9b[_0xed87('0x5a')];var _0xc35cab=_0x5136c9[_0xed87('0x5b')](-0x1);if(_0xc35cab==='/'){_0x5136c9=_0x5136c9[_0xed87('0x5c')](0x0,_0x5136c9[_0xed87('0x5d')](_0xc35cab));}var _0x116198={'method':_0xed87('0x5e'),'uri':util['format']('%s/%s',_0x5136c9,'ticket_fields'),'json':!![]};switch(_0x3b6a9b[_0xed87('0x59')]){case _0xed87('0x57'):_0x116198[_0xed87('0x5f')]={'Authorization':util[_0xed87('0x60')](_0xed87('0x61'),new Buffer(util['format'](_0xed87('0x62'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x57')]))[_0xed87('0x63')](_0xed87('0x64')))};break;case _0xed87('0x58'):_0x116198['headers']={'Authorization':util['format'](_0xed87('0x61'),new Buffer(util[_0xed87('0x60')](_0xed87('0x65'),_0x3b6a9b[_0xed87('0x56')],_0x3b6a9b[_0xed87('0x58')]))[_0xed87('0x63')](_0xed87('0x64')))};break;default:throw new db[(_0xed87('0x66'))][(_0xed87('0x67'))](_0xed87('0x68'));}return rp(_0x116198);}})[_0xed87('0x3f')](function(_0x1a1f95){if(_0x1a1f95){var _0x52af5c=[_0xed87('0x69'),_0xed87('0x6a'),_0xed87('0x6b'),_0xed87('0x6c')];_[_0xed87('0x6d')](_0x1a1f95[_0xed87('0x6e')],function(_0x4ae84c){return _0x52af5c[_0xed87('0x6f')](_0x4ae84c[_0xed87('0x2b')]);});return{'count':_0x1a1f95[_0xed87('0x6e')][_0xed87('0x35')],'rows':_['map'](_0x1a1f95['ticket_fields'],function(_0x4bfca0){return{'id':_0x4bfca0['id'],'name':_0x4bfca0['position']>0x7?_0x4bfca0['title']:_0x4bfca0[_0xed87('0x2b')],'custom':_0x4bfca0[_0xed87('0x70')]>0x7?!![]:![],'options':_0x4bfca0[_0xed87('0x71')]?_0x4bfca0[_0xed87('0x71')]:_0x4bfca0[_0xed87('0x72')]?_0x4bfca0[_0xed87('0x72')]:[]};})};}})[_0xed87('0x3f')](respondWithResult(_0x566ace,null))[_0xed87('0x41')](function(_0x1b223b){var _0x510066=_0x2686cd['query'][_0xed87('0x73')]?0x1f4:_0x1b223b[_0xed87('0x74')]||0x1f4;logger[_0xed87('0x25')](_0xed87('0x75'),_0xed87('0x55'),_0x510066,JSON['stringify'](_0x1b223b));delete _0x1b223b['name'];if(_0x510066===0x191){_0x510066=0x190;}_0x566ace[_0xed87('0x19')](_0x510066)[_0xed87('0x76')](_0x2686cd['query'][_0xed87('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1b223b[_0xed87('0x74')]}:_0x1b223b);});}; \ No newline at end of file +var _0x0972=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','error','name','send','index','map','ZendeskAccount','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','AccountId','channel','Descriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','stringify','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x37b8b8,_0xe02810){var _0x1e31a6=function(_0x20bbaa){while(--_0x20bbaa){_0x37b8b8['push'](_0x37b8b8['shift']());}};_0x1e31a6(++_0xe02810);}(_0x0972,0x64));var _0x2097=function(_0x19c0fc,_0x2757b6){_0x19c0fc=_0x19c0fc-0x0;var _0x120ad7=_0x0972[_0x19c0fc];return _0x120ad7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];var integrations=require(_0x2097('0x1a'));function respondWithStatusCode(_0x170005,_0x16871b){_0x16871b=_0x16871b||0xcc;return function(_0x24ca42){if(_0x24ca42){return _0x170005[_0x2097('0x1b')](_0x16871b);}return _0x170005[_0x2097('0x1c')](_0x16871b)[_0x2097('0x1d')]();};}function respondWithResult(_0x2c3e41,_0x354387){_0x354387=_0x354387||0xc8;return function(_0x5d0a43){if(_0x5d0a43){return _0x2c3e41[_0x2097('0x1c')](_0x354387)[_0x2097('0x1e')](_0x5d0a43);}};}function respondWithFilteredResult(_0x4d31bc,_0x4eec05){return function(_0x4fc8c5){if(_0x4fc8c5){var _0x409deb=typeof _0x4eec05['offset']===_0x2097('0x1f')&&typeof _0x4eec05[_0x2097('0x20')]===_0x2097('0x1f');var _0x1347e4=_0x4fc8c5[_0x2097('0x21')];var _0x53e2b4=_0x409deb?0x0:_0x4eec05[_0x2097('0x22')];var _0x140094=_0x409deb?_0x4fc8c5[_0x2097('0x21')]:_0x4eec05[_0x2097('0x22')]+_0x4eec05[_0x2097('0x20')];var _0x235304;if(_0x140094>=_0x1347e4){_0x140094=_0x1347e4;_0x235304=0xc8;}else{_0x235304=0xce;}_0x4d31bc[_0x2097('0x1c')](_0x235304);return _0x4d31bc[_0x2097('0x23')]('Content-Range',_0x53e2b4+'-'+_0x140094+'/'+_0x1347e4)['json'](_0x4fc8c5);}return null;};}function patchUpdates(_0xf65dc6){return function(_0x569c21){try{jsonpatch[_0x2097('0x24')](_0x569c21,_0xf65dc6,!![]);}catch(_0x1ac5f1){return BPromise['reject'](_0x1ac5f1);}return _0x569c21[_0x2097('0x25')]();};}function saveUpdates(_0x5b0582,_0x2e17c8){return function(_0xf32d3f){if(_0xf32d3f){return _0xf32d3f[_0x2097('0x26')](_0x5b0582)[_0x2097('0x27')](function(_0x36b15e){return _0x36b15e;});}return null;};}function removeEntity(_0x35047b,_0x56390a){return function(_0xae5f9){if(_0xae5f9){return _0xae5f9['destroy']()[_0x2097('0x27')](function(){_0x35047b[_0x2097('0x1c')](0xcc)[_0x2097('0x1d')]();});}};}function handleEntityNotFound(_0x9f59bc,_0x499988){return function(_0x2d683a){if(!_0x2d683a){_0x9f59bc[_0x2097('0x1b')](0x194);}return _0x2d683a;};}function handleError(_0x56af3b,_0x1229fc){_0x1229fc=_0x1229fc||0x1f4;return function(_0x5ed0fa){logger[_0x2097('0x28')](_0x5ed0fa['stack']);if(_0x5ed0fa[_0x2097('0x29')]){delete _0x5ed0fa[_0x2097('0x29')];}_0x56af3b[_0x2097('0x1c')](_0x1229fc)[_0x2097('0x2a')](_0x5ed0fa);};}exports[_0x2097('0x2b')]=function(_0x36228c,_0x450e0b){var _0x4b443d={},_0x11242f={},_0x14d964={'count':0x0,'rows':[]};var _0x5cce55=_[_0x2097('0x2c')](db[_0x2097('0x2d')]['rawAttributes'],function(_0x4d0916){return{'name':_0x4d0916[_0x2097('0x2e')],'type':_0x4d0916[_0x2097('0x2f')][_0x2097('0x30')]};});_0x11242f[_0x2097('0x31')]=_[_0x2097('0x2c')](_0x5cce55,_0x2097('0x29'));_0x11242f['query']=_[_0x2097('0x32')](_0x36228c['query']);_0x11242f[_0x2097('0x33')]=_[_0x2097('0x34')](_0x11242f[_0x2097('0x31')],_0x11242f[_0x2097('0x35')]);_0x4b443d[_0x2097('0x36')]=_[_0x2097('0x34')](_0x11242f[_0x2097('0x31')],qs[_0x2097('0x37')](_0x36228c[_0x2097('0x35')]['fields']));_0x4b443d[_0x2097('0x36')]=_0x4b443d[_0x2097('0x36')][_0x2097('0x38')]?_0x4b443d['attributes']:_0x11242f[_0x2097('0x31')];if(!_0x36228c[_0x2097('0x35')][_0x2097('0x39')](_0x2097('0x3a'))){_0x4b443d['limit']=qs['limit'](_0x36228c['query'][_0x2097('0x20')]);_0x4b443d[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x36228c[_0x2097('0x35')][_0x2097('0x22')]);}_0x4b443d[_0x2097('0x3b')]=qs['sort'](_0x36228c[_0x2097('0x35')][_0x2097('0x3c')]);_0x4b443d[_0x2097('0x3d')]=qs[_0x2097('0x33')](_[_0x2097('0x3e')](_0x36228c[_0x2097('0x35')],_0x11242f['filters']),_0x5cce55);if(_0x36228c[_0x2097('0x35')][_0x2097('0x3f')]){_0x4b443d[_0x2097('0x3d')]=_['merge'](_0x4b443d['where'],{'$or':_[_0x2097('0x2c')](_0x5cce55,function(_0x372693){if(_0x372693[_0x2097('0x2f')]!==_0x2097('0x40')){var _0x41c9e6={};_0x41c9e6[_0x372693[_0x2097('0x29')]]={'$like':'%'+_0x36228c[_0x2097('0x35')][_0x2097('0x3f')]+'%'};return _0x41c9e6;}})});}_0x4b443d=_[_0x2097('0x41')]({},_0x4b443d,_0x36228c[_0x2097('0x42')]);var _0x337979={'where':_0x4b443d[_0x2097('0x3d')]};return db['ZendeskAccount'][_0x2097('0x21')](_0x337979)[_0x2097('0x27')](function(_0x7b556c){_0x14d964['count']=_0x7b556c;if(_0x36228c[_0x2097('0x35')][_0x2097('0x43')]){_0x4b443d[_0x2097('0x44')]=[{'all':!![]}];}return db[_0x2097('0x2d')][_0x2097('0x45')](_0x4b443d);})[_0x2097('0x27')](function(_0x29dab3){_0x14d964[_0x2097('0x46')]=_0x29dab3;return _0x14d964;})['then'](respondWithFilteredResult(_0x450e0b,_0x4b443d))[_0x2097('0x47')](handleError(_0x450e0b,null));};exports[_0x2097('0x48')]=function(_0x186ca5,_0x3288ae){var _0x12e0e2={'raw':![],'where':{'id':_0x186ca5[_0x2097('0x49')]['id']}},_0xe3ac1b={};_0xe3ac1b[_0x2097('0x31')]=_['keys'](db[_0x2097('0x2d')]['rawAttributes']);_0xe3ac1b[_0x2097('0x35')]=_[_0x2097('0x32')](_0x186ca5[_0x2097('0x35')]);_0xe3ac1b[_0x2097('0x33')]=_[_0x2097('0x34')](_0xe3ac1b['model'],_0xe3ac1b[_0x2097('0x35')]);_0x12e0e2[_0x2097('0x36')]=_[_0x2097('0x34')](_0xe3ac1b[_0x2097('0x31')],qs[_0x2097('0x37')](_0x186ca5['query'][_0x2097('0x37')]));_0x12e0e2[_0x2097('0x36')]=_0x12e0e2[_0x2097('0x36')][_0x2097('0x38')]?_0x12e0e2[_0x2097('0x36')]:_0xe3ac1b[_0x2097('0x31')];if(_0x186ca5[_0x2097('0x35')][_0x2097('0x43')]){_0x12e0e2['include']=[{'all':!![]}];}_0x12e0e2=_[_0x2097('0x41')]({},_0x12e0e2,_0x186ca5[_0x2097('0x42')]);return db[_0x2097('0x2d')][_0x2097('0x4a')](_0x12e0e2)['then'](handleEntityNotFound(_0x3288ae,null))['then'](respondWithResult(_0x3288ae,null))['catch'](handleError(_0x3288ae,null));};exports[_0x2097('0x4b')]=function(_0x396979,_0x4c4ef9){return db[_0x2097('0x2d')][_0x2097('0x4b')](_0x396979['body'],{})['then'](respondWithResult(_0x4c4ef9,0xc9))[_0x2097('0x47')](handleError(_0x4c4ef9,null));};exports[_0x2097('0x26')]=function(_0x1b4de6,_0x5a0c05){if(_0x1b4de6[_0x2097('0x4c')]['id']){delete _0x1b4de6[_0x2097('0x4c')]['id'];}return db['ZendeskAccount'][_0x2097('0x4a')]({'where':{'id':_0x1b4de6[_0x2097('0x49')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x5a0c05,null))[_0x2097('0x27')](saveUpdates(_0x1b4de6[_0x2097('0x4c')],null))['then'](respondWithResult(_0x5a0c05,null))['catch'](handleError(_0x5a0c05,null));};exports[_0x2097('0x4d')]=function(_0x39f9cb,_0x329632){return db['ZendeskAccount']['find']({'where':{'id':_0x39f9cb[_0x2097('0x49')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x329632,null))['then'](removeEntity(_0x329632,null))[_0x2097('0x47')](handleError(_0x329632,null));};exports[_0x2097('0x4e')]=function(_0x12bdbd,_0x33490e,_0x390a52){var _0x4a709a={};var _0x42b222={};var _0x228b60;var _0x190859;return db['ZendeskAccount'][_0x2097('0x4f')]({'where':{'id':_0x12bdbd[_0x2097('0x49')]['id']}})['then'](handleEntityNotFound(_0x33490e,null))[_0x2097('0x27')](function(_0x4d6ed6){if(_0x4d6ed6){_0x228b60=_0x4d6ed6;_0x42b222[_0x2097('0x31')]=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x42b222[_0x2097('0x35')]=_['keys'](_0x12bdbd['query']);_0x42b222[_0x2097('0x33')]=_['intersection'](_0x42b222[_0x2097('0x31')],_0x42b222[_0x2097('0x35')]);_0x4a709a['attributes']=_[_0x2097('0x34')](_0x42b222[_0x2097('0x31')],qs[_0x2097('0x37')](_0x12bdbd[_0x2097('0x35')][_0x2097('0x37')]));_0x4a709a['attributes']=_0x4a709a[_0x2097('0x36')]['length']?_0x4a709a[_0x2097('0x36')]:_0x42b222[_0x2097('0x31')];_0x4a709a[_0x2097('0x3b')]=qs['sort'](_0x12bdbd[_0x2097('0x35')][_0x2097('0x3c')]);_0x4a709a[_0x2097('0x3d')]=qs[_0x2097('0x33')](_[_0x2097('0x3e')](_0x12bdbd['query'],_0x42b222['filters']));if(_0x12bdbd[_0x2097('0x35')][_0x2097('0x3f')]){_0x4a709a['where']=_['merge'](_0x4a709a['where'],{'$or':_['map'](_0x4a709a[_0x2097('0x36')],function(_0x4cdc65){var _0x4445ff={};_0x4445ff[_0x4cdc65]={'$like':'%'+_0x12bdbd[_0x2097('0x35')]['filter']+'%'};return _0x4445ff;})});}_0x4a709a=_[_0x2097('0x41')]({},_0x4a709a,_0x12bdbd[_0x2097('0x42')]);return _0x228b60[_0x2097('0x4e')](_0x4a709a);}})[_0x2097('0x27')](function(_0x2a2673){if(_0x2a2673){_0x190859=_0x2a2673[_0x2097('0x38')];if(!_0x12bdbd[_0x2097('0x35')][_0x2097('0x39')](_0x2097('0x3a'))){_0x4a709a['limit']=qs[_0x2097('0x20')](_0x12bdbd[_0x2097('0x35')][_0x2097('0x20')]);_0x4a709a[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x12bdbd[_0x2097('0x35')]['offset']);}return _0x228b60[_0x2097('0x4e')](_0x4a709a);}})[_0x2097('0x27')](function(_0xcabda7){if(_0xcabda7){return _0xcabda7?{'count':_0x190859,'rows':_0xcabda7}:null;}})[_0x2097('0x27')](respondWithResult(_0x33490e,null))[_0x2097('0x47')](handleError(_0x33490e,null));};exports['addConfiguration']=function(_0x437b79,_0x28dd95,_0x5ea02c){if(_0x437b79['body']['id']){delete _0x437b79['body']['id'];}return db[_0x2097('0x2d')][_0x2097('0x4f')]({'where':{'id':_0x437b79[_0x2097('0x49')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x28dd95,null))[_0x2097('0x27')](function(_0x18d90a){if(_0x18d90a){_0x437b79[_0x2097('0x4c')][_0x2097('0x50')]=_0x18d90a['id'];_0x437b79[_0x2097('0x4c')]['Subjects']=integrations['getSubjects'](_0x437b79[_0x2097('0x4c')][_0x2097('0x51')],_0x437b79[_0x2097('0x4c')][_0x2097('0x2f')]);_0x437b79[_0x2097('0x4c')][_0x2097('0x52')]=integrations['getDescriptions'](_0x437b79[_0x2097('0x4c')][_0x2097('0x51')],_0x437b79[_0x2097('0x4c')][_0x2097('0x2f')]);return db['ZendeskConfiguration']['create'](_0x437b79[_0x2097('0x4c')],{'include':[{'model':db[_0x2097('0x53')],'as':'Subjects'},{'model':db[_0x2097('0x53')],'as':_0x2097('0x52')}]});}return null;})[_0x2097('0x27')](respondWithResult(_0x28dd95,null))[_0x2097('0x47')](handleError(_0x28dd95,null));};exports[_0x2097('0x54')]=function(_0x3b5519,_0x10f891,_0x2c6f24){var _0x54159e='';return db[_0x2097('0x2d')][_0x2097('0x4f')]({'where':{'id':_0x3b5519['params']['id']},'attributes':['id',_0x2097('0x55'),_0x2097('0x56'),_0x2097('0x57'),_0x2097('0x58'),_0x2097('0x59')]})[_0x2097('0x27')](handleEntityNotFound(_0x10f891,null))[_0x2097('0x27')](function(_0x22d1ce){if(_0x22d1ce){_0x54159e=_0x22d1ce[_0x2097('0x59')];var _0x1b7021=_0x54159e[_0x2097('0x5a')](-0x1);if(_0x1b7021==='/'){_0x54159e=_0x54159e['substring'](0x0,_0x54159e[_0x2097('0x5b')](_0x1b7021));}var _0x41abda={'method':_0x2097('0x5c'),'uri':util[_0x2097('0x5d')](_0x2097('0x5e'),_0x54159e,'ticket_fields'),'json':!![]};switch(_0x22d1ce[_0x2097('0x58')]){case _0x2097('0x56'):_0x41abda[_0x2097('0x5f')]={'Authorization':util['format'](_0x2097('0x60'),new Buffer(util['format'](_0x2097('0x61'),_0x22d1ce['username'],_0x22d1ce[_0x2097('0x56')]))['toString'](_0x2097('0x62')))};break;case'token':_0x41abda[_0x2097('0x5f')]={'Authorization':util[_0x2097('0x5d')](_0x2097('0x60'),new Buffer(util[_0x2097('0x5d')](_0x2097('0x63'),_0x22d1ce['username'],_0x22d1ce[_0x2097('0x57')]))[_0x2097('0x64')](_0x2097('0x62')))};break;default:throw new db[(_0x2097('0x65'))][(_0x2097('0x66'))](_0x2097('0x67'));}return rp(_0x41abda);}})[_0x2097('0x27')](function(_0x360dd5){if(_0x360dd5){var _0xd4e39d=[_0x2097('0x68'),_0x2097('0x69'),_0x2097('0x6a'),_0x2097('0x6b')];_[_0x2097('0x6c')](_0x360dd5[_0x2097('0x6d')],function(_0xf3831c){return _0xd4e39d['includes'](_0xf3831c[_0x2097('0x2f')]);});return{'count':_0x360dd5['ticket_fields']['length'],'rows':_[_0x2097('0x2c')](_0x360dd5[_0x2097('0x6d')],function(_0x107fab){return{'id':_0x107fab['id'],'name':_0x107fab['position']>0x7?_0x107fab[_0x2097('0x6e')]:_0x107fab[_0x2097('0x2f')],'custom':_0x107fab[_0x2097('0x6f')]>0x7?!![]:![],'options':_0x107fab[_0x2097('0x70')]?_0x107fab['system_field_options']:_0x107fab[_0x2097('0x71')]?_0x107fab['custom_field_options']:[]};})};}})[_0x2097('0x27')](respondWithResult(_0x10f891,null))[_0x2097('0x47')](function(_0x2619db){var _0x1e380e=_0x3b5519['query'][_0x2097('0x72')]?0x1f4:_0x2619db[_0x2097('0x73')]||0x1f4;logger[_0x2097('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x2097('0x54'),_0x1e380e,JSON[_0x2097('0x74')](_0x2619db));delete _0x2619db[_0x2097('0x29')];if(_0x1e380e===0x191){_0x1e380e=0x190;}_0x10f891['status'](_0x1e380e)[_0x2097('0x2a')](_0x3b5519[_0x2097('0x35')][_0x2097('0x72')]?{'message':_0x2097('0x75'),'statusCode':_0x2619db[_0x2097('0x73')]}:_0x2619db);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 72538aa..a65c519 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 _0x9edf=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','lodash','util'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x9edf,0xd6));var _0xf9ed=function(_0x220b2d,_0x28cc65){_0x220b2d=_0x220b2d-0x0;var _0x524267=_0x9edf[_0x220b2d];return _0x524267;};'use strict';var _=require(_0xf9ed('0x0'));var util=require(_0xf9ed('0x1'));var logger=require(_0xf9ed('0x2'))('api');var moment=require(_0xf9ed('0x3'));var BPromise=require(_0xf9ed('0x4'));var rp=require(_0xf9ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9ed('0x6'));var config=require(_0xf9ed('0x7'));var attributes=require(_0xf9ed('0x8'));var integrations=require(_0xf9ed('0x9'));module[_0xf9ed('0xa')]=function(_0x4ed71e,_0x25ef9e){return _0x4ed71e['define'](_0xf9ed('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6922=['ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4b161f,_0x218a3f){var _0x3bc0b3=function(_0x13ec0f){while(--_0x13ec0f){_0x4b161f['push'](_0x4b161f['shift']());}};_0x3bc0b3(++_0x218a3f);}(_0x6922,0x8e));var _0x2692=function(_0x3ae86d,_0x2d4c3f){_0x3ae86d=_0x3ae86d-0x0;var _0x1af903=_0x6922[_0x3ae86d];return _0x1af903;};'use strict';var _=require(_0x2692('0x0'));var util=require('util');var logger=require(_0x2692('0x1'))(_0x2692('0x2'));var moment=require(_0x2692('0x3'));var BPromise=require(_0x2692('0x4'));var rp=require(_0x2692('0x5'));var fs=require('fs');var path=require(_0x2692('0x6'));var rimraf=require(_0x2692('0x7'));var config=require(_0x2692('0x8'));var attributes=require(_0x2692('0x9'));var integrations=require(_0x2692('0xa'));module[_0x2692('0xb')]=function(_0x31b875,_0xc79093){return _0x31b875['define'](_0x2692('0xc'),attributes,{'tableName':_0x2692('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 e4e03af..be9fab5 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 _0x3124=['debug','stringify','ShowZendeskAccount','find','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','map','model','include','then'];(function(_0x30c76e,_0x334845){var _0x39d828=function(_0x2a9c90){while(--_0x2a9c90){_0x30c76e['push'](_0x30c76e['shift']());}};_0x39d828(++_0x334845);}(_0x3124,0x6e));var _0x4312=function(_0x3d33d5,_0x4ff929){_0x3d33d5=_0x3d33d5-0x0;var _0x4de05b=_0x3124[_0x3d33d5];return _0x4de05b;};'use strict';var _=require(_0x4312('0x0'));var util=require(_0x4312('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4312('0x2'));var fs=require('fs');var Redis=require(_0x4312('0x3'));var db=require(_0x4312('0x4'))['db'];var utils=require(_0x4312('0x5'));var logger=require(_0x4312('0x6'))(_0x4312('0x7'));var config=require(_0x4312('0x8'));var jayson=require(_0x4312('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfc4d7e,_0x46bd5b,_0x80ebc3){return new BPromise(function(_0x18f128,_0x27ac1a){return client[_0x4312('0xa')](_0xfc4d7e,_0x80ebc3)['then'](function(_0x21b056){logger['info'](_0x4312('0xb'),_0x46bd5b,_0x4312('0xc'));logger['debug'](_0x4312('0xd'),_0x46bd5b,'request\x20sent',JSON['stringify'](_0x21b056));if(_0x21b056[_0x4312('0xe')]){if(_0x21b056[_0x4312('0xe')]['code']===0x1f4){logger[_0x4312('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x46bd5b,_0x21b056[_0x4312('0xe')][_0x4312('0xf')]);return _0x27ac1a(_0x21b056[_0x4312('0xe')][_0x4312('0xf')]);}logger[_0x4312('0xe')](_0x4312('0xb'),_0x46bd5b,_0x21b056[_0x4312('0xe')][_0x4312('0xf')]);return _0x18f128(_0x21b056[_0x4312('0xe')][_0x4312('0xf')]);}else{logger[_0x4312('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x46bd5b,_0x4312('0xc'));_0x18f128(_0x21b056[_0x4312('0x11')][_0x4312('0xf')]);}})[_0x4312('0x12')](function(_0xad9ff3){logger['error'](_0x4312('0xb'),_0x46bd5b,_0xad9ff3);_0x27ac1a(_0xad9ff3);});});}exports[_0x4312('0x13')]=function(_0xe926f5){var _0x1bd1b5=this;return new Promise(function(_0x549b8d,_0x553cf8){return db[_0x4312('0x14')][_0x4312('0x15')]({'raw':_0xe926f5[_0x4312('0x16')]?_0xe926f5[_0x4312('0x16')][_0x4312('0x17')]===undefined?!![]:![]:!![],'where':_0xe926f5[_0x4312('0x16')]?_0xe926f5[_0x4312('0x16')]['where']||null:null,'attributes':_0xe926f5['options']?_0xe926f5[_0x4312('0x16')][_0x4312('0x18')]||null:null,'limit':_0xe926f5[_0x4312('0x16')]?_0xe926f5['options'][_0x4312('0x19')]||null:null,'include':_0xe926f5['options']?_0xe926f5[_0x4312('0x16')]['include']?_[_0x4312('0x1a')](_0xe926f5[_0x4312('0x16')]['include'],function(_0x3266e3){return{'model':db[_0x3266e3[_0x4312('0x1b')]],'as':_0x3266e3['as'],'attributes':_0x3266e3[_0x4312('0x18')],'include':_0x3266e3['include']?_[_0x4312('0x1a')](_0x3266e3[_0x4312('0x1c')],function(_0x4e3c9e){return{'model':db[_0x4e3c9e[_0x4312('0x1b')]],'as':_0x4e3c9e['as'],'attributes':_0x4e3c9e[_0x4312('0x18')],'include':_0x4e3c9e[_0x4312('0x1c')]?_['map'](_0x4e3c9e[_0x4312('0x1c')],function(_0xa6142e){return{'model':db[_0xa6142e['model']],'as':_0xa6142e['as'],'attributes':_0xa6142e[_0x4312('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4312('0x1d')](function(_0x4546db){logger[_0x4312('0x10')](_0x4312('0x13'),_0xe926f5);logger[_0x4312('0x1e')](_0x4312('0x13'),_0xe926f5,JSON[_0x4312('0x1f')](_0x4546db));_0x549b8d(_0x4546db);})[_0x4312('0x12')](function(_0x2355d9){logger[_0x4312('0xe')]('GetZendeskAccount',_0x2355d9[_0x4312('0xf')],_0xe926f5);_0x553cf8(_0x1bd1b5[_0x4312('0xe')](0x1f4,_0x2355d9[_0x4312('0xf')]));});});};exports[_0x4312('0x20')]=function(_0x2350a1){var _0x394c32=this;return new Promise(function(_0x5d7c54,_0x5e952e){return db[_0x4312('0x14')][_0x4312('0x21')]({'raw':_0x2350a1['options']?_0x2350a1[_0x4312('0x16')][_0x4312('0x17')]===undefined?!![]:![]:!![],'where':_0x2350a1[_0x4312('0x16')]?_0x2350a1[_0x4312('0x16')][_0x4312('0x22')]||null:null,'attributes':_0x2350a1[_0x4312('0x16')]?_0x2350a1[_0x4312('0x16')][_0x4312('0x18')]||null:null,'include':_0x2350a1['options']?_0x2350a1[_0x4312('0x16')][_0x4312('0x1c')]?_[_0x4312('0x1a')](_0x2350a1[_0x4312('0x16')][_0x4312('0x1c')],function(_0xcf3efd){return{'model':db[_0xcf3efd[_0x4312('0x1b')]],'as':_0xcf3efd['as'],'attributes':_0xcf3efd[_0x4312('0x18')],'include':_0xcf3efd[_0x4312('0x1c')]?_[_0x4312('0x1a')](_0xcf3efd[_0x4312('0x1c')],function(_0x513b35){return{'model':db[_0x513b35[_0x4312('0x1b')]],'as':_0x513b35['as'],'attributes':_0x513b35[_0x4312('0x18')],'include':_0x513b35[_0x4312('0x1c')]?_[_0x4312('0x1a')](_0x513b35['include'],function(_0x1aae5e){return{'model':db[_0x1aae5e[_0x4312('0x1b')]],'as':_0x1aae5e['as'],'attributes':_0x1aae5e[_0x4312('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4312('0x1d')](function(_0xc02d73){logger['info'](_0x4312('0x20'),_0x2350a1);logger[_0x4312('0x1e')](_0x4312('0x20'),_0x2350a1,JSON['stringify'](_0xc02d73));_0x5d7c54(_0xc02d73);})['catch'](function(_0x1317c5){logger[_0x4312('0xe')](_0x4312('0x20'),_0x1317c5[_0x4312('0xf')],_0x2350a1);_0x5e952e(_0x394c32[_0x4312('0xe')](0x1f4,_0x1317c5[_0x4312('0xf')]));});});}; \ No newline at end of file +var _0xca27=['rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xca27,0x1a9));var _0x7ca2=function(_0x4cb3b3,_0x1c23a9){_0x4cb3b3=_0x4cb3b3-0x0;var _0xa9c3ac=_0xca27[_0x4cb3b3];return _0xa9c3ac;};'use strict';var _=require(_0x7ca2('0x0'));var util=require(_0x7ca2('0x1'));var moment=require(_0x7ca2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ca2('0x3'));var db=require(_0x7ca2('0x4'))['db'];var utils=require(_0x7ca2('0x5'));var logger=require(_0x7ca2('0x6'))(_0x7ca2('0x7'));var config=require(_0x7ca2('0x8'));var jayson=require(_0x7ca2('0x9'));var client=jayson[_0x7ca2('0xa')][_0x7ca2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a8c73,_0x1797f7,_0x546da1){return new BPromise(function(_0xdabfbf,_0x259cc3){return client['request'](_0x2a8c73,_0x546da1)[_0x7ca2('0xc')](function(_0x37d7a0){logger[_0x7ca2('0xd')](_0x7ca2('0xe'),_0x1797f7,_0x7ca2('0xf'));logger[_0x7ca2('0x10')](_0x7ca2('0x11'),_0x1797f7,'request\x20sent',JSON[_0x7ca2('0x12')](_0x37d7a0));if(_0x37d7a0['error']){if(_0x37d7a0['error']['code']===0x1f4){logger[_0x7ca2('0x13')](_0x7ca2('0xe'),_0x1797f7,_0x37d7a0[_0x7ca2('0x13')][_0x7ca2('0x14')]);return _0x259cc3(_0x37d7a0[_0x7ca2('0x13')][_0x7ca2('0x14')]);}logger[_0x7ca2('0x13')](_0x7ca2('0xe'),_0x1797f7,_0x37d7a0[_0x7ca2('0x13')][_0x7ca2('0x14')]);return _0xdabfbf(_0x37d7a0[_0x7ca2('0x13')][_0x7ca2('0x14')]);}else{logger['info'](_0x7ca2('0xe'),_0x1797f7,_0x7ca2('0xf'));_0xdabfbf(_0x37d7a0[_0x7ca2('0x15')][_0x7ca2('0x14')]);}})[_0x7ca2('0x16')](function(_0x3811b3){logger[_0x7ca2('0x13')](_0x7ca2('0xe'),_0x1797f7,_0x3811b3);_0x259cc3(_0x3811b3);});});}exports[_0x7ca2('0x17')]=function(_0x4dfb8b){var _0x262ecd=this;return new Promise(function(_0x3dd65c,_0x3503a9){return db[_0x7ca2('0x18')][_0x7ca2('0x19')]({'raw':_0x4dfb8b[_0x7ca2('0x1a')]?_0x4dfb8b[_0x7ca2('0x1a')][_0x7ca2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4dfb8b['options']?_0x4dfb8b['options'][_0x7ca2('0x1c')]||null:null,'attributes':_0x4dfb8b[_0x7ca2('0x1a')]?_0x4dfb8b[_0x7ca2('0x1a')]['attributes']||null:null,'limit':_0x4dfb8b['options']?_0x4dfb8b[_0x7ca2('0x1a')][_0x7ca2('0x1d')]||null:null,'include':_0x4dfb8b['options']?_0x4dfb8b[_0x7ca2('0x1a')][_0x7ca2('0x1e')]?_[_0x7ca2('0x1f')](_0x4dfb8b[_0x7ca2('0x1a')][_0x7ca2('0x1e')],function(_0x414bed){return{'model':db[_0x414bed[_0x7ca2('0x20')]],'as':_0x414bed['as'],'attributes':_0x414bed[_0x7ca2('0x21')],'include':_0x414bed[_0x7ca2('0x1e')]?_['map'](_0x414bed[_0x7ca2('0x1e')],function(_0x494957){return{'model':db[_0x494957[_0x7ca2('0x20')]],'as':_0x494957['as'],'attributes':_0x494957[_0x7ca2('0x21')],'include':_0x494957['include']?_[_0x7ca2('0x1f')](_0x494957[_0x7ca2('0x1e')],function(_0x345125){return{'model':db[_0x345125['model']],'as':_0x345125['as'],'attributes':_0x345125[_0x7ca2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7ca2('0xc')](function(_0x3e8418){logger['info'](_0x7ca2('0x17'),_0x4dfb8b);logger[_0x7ca2('0x10')](_0x7ca2('0x17'),_0x4dfb8b,JSON[_0x7ca2('0x12')](_0x3e8418));_0x3dd65c(_0x3e8418);})[_0x7ca2('0x16')](function(_0x5be78a){logger[_0x7ca2('0x13')](_0x7ca2('0x17'),_0x5be78a[_0x7ca2('0x14')],_0x4dfb8b);_0x3503a9(_0x262ecd[_0x7ca2('0x13')](0x1f4,_0x5be78a['message']));});});};exports[_0x7ca2('0x22')]=function(_0xdb5883){var _0x22ba94=this;return new Promise(function(_0x4fea7d,_0x244904){return db[_0x7ca2('0x18')][_0x7ca2('0x23')]({'raw':_0xdb5883[_0x7ca2('0x1a')]?_0xdb5883[_0x7ca2('0x1a')][_0x7ca2('0x1b')]===undefined?!![]:![]:!![],'where':_0xdb5883[_0x7ca2('0x1a')]?_0xdb5883['options'][_0x7ca2('0x1c')]||null:null,'attributes':_0xdb5883[_0x7ca2('0x1a')]?_0xdb5883[_0x7ca2('0x1a')][_0x7ca2('0x21')]||null:null,'include':_0xdb5883[_0x7ca2('0x1a')]?_0xdb5883[_0x7ca2('0x1a')]['include']?_['map'](_0xdb5883['options'][_0x7ca2('0x1e')],function(_0x1f6035){return{'model':db[_0x1f6035['model']],'as':_0x1f6035['as'],'attributes':_0x1f6035['attributes'],'include':_0x1f6035[_0x7ca2('0x1e')]?_[_0x7ca2('0x1f')](_0x1f6035[_0x7ca2('0x1e')],function(_0x4e6388){return{'model':db[_0x4e6388[_0x7ca2('0x20')]],'as':_0x4e6388['as'],'attributes':_0x4e6388[_0x7ca2('0x21')],'include':_0x4e6388[_0x7ca2('0x1e')]?_[_0x7ca2('0x1f')](_0x4e6388[_0x7ca2('0x1e')],function(_0x4b3d8d){return{'model':db[_0x4b3d8d['model']],'as':_0x4b3d8d['as'],'attributes':_0x4b3d8d[_0x7ca2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7ca2('0xc')](function(_0x2db073){logger[_0x7ca2('0xd')](_0x7ca2('0x22'),_0xdb5883);logger[_0x7ca2('0x10')](_0x7ca2('0x22'),_0xdb5883,JSON[_0x7ca2('0x12')](_0x2db073));_0x4fea7d(_0x2db073);})['catch'](function(_0x32e6c2){logger[_0x7ca2('0x13')]('ShowZendeskAccount',_0x32e6c2[_0x7ca2('0x14')],_0xdb5883);_0x244904(_0x22ba94[_0x7ca2('0x13')](0x1f4,_0x32e6c2[_0x7ca2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 9c837ef..477d1eb 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(_0x145859,_0x2da9cd){var _0x13c753=function(_0xc2c274){while(--_0xc2c274){_0x145859['push'](_0x145859['shift']());}};_0x13c753(++_0x2da9cd);}(_0xda3f,0xec));var _0xfda3=function(_0x4331b2,_0x5645c4){_0x4331b2=_0x4331b2-0x0;var _0x3963b9=_0xda3f[_0x4331b2];return _0x3963b9;};'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 _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x53a8d3,_0x1a0799){var _0x15e434=function(_0x21f7ac){while(--_0x21f7ac){_0x53a8d3['push'](_0x53a8d3['shift']());}};_0x15e434(++_0x1a0799);}(_0xea28,0x13a));var _0x8ea2=function(_0x37dd97,_0x38c368){_0x37dd97=_0x37dd97-0x0;var _0x581d78=_0xea28[_0x37dd97];return _0x581d78;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getSubjects']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['get'](_0x8ea2('0x14'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x15')]);router[_0x8ea2('0x16')]('/',auth[_0x8ea2('0xd')](),controller['create']);router[_0x8ea2('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);router[_0x8ea2('0x18')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x1b')]);module[_0x8ea2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 53809f9..bd8310e 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 _0x3c34=['STRING','sequelize','exports'];(function(_0x1dc01f,_0x157a75){var _0x298041=function(_0x47fce1){while(--_0x47fce1){_0x1dc01f['push'](_0x1dc01f['shift']());}};_0x298041(++_0x157a75);}(_0x3c34,0xbe));var _0x43c3=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x3c34[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0x43c3('0x0'));module[_0x43c3('0x1')]={'name':{'type':Sequelize[_0x43c3('0x2')]},'description':{'type':Sequelize[_0x43c3('0x2')]}}; \ No newline at end of file +var _0x0b66=['exports'];(function(_0x186e68,_0x1edfb9){var _0x23ea31=function(_0x5cb1b8){while(--_0x5cb1b8){_0x186e68['push'](_0x186e68['shift']());}};_0x23ea31(++_0x1edfb9);}(_0x0b66,0xd1));var _0x60b6=function(_0x80e88d,_0x1e4ba7){_0x80e88d=_0x80e88d-0x0;var _0x2988bb=_0x0b66[_0x80e88d];return _0x2988bb;};'use strict';var Sequelize=require('sequelize');module[_0x60b6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f21b690..efa02fd 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 _0x2427=['includeAll','include','findAll','rows','show','find','catch','create','body','params','getFields','findOne','ZendeskField','rawAttributes','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x31f89b,_0x8aa488){var _0x173458=function(_0x2ccb0f){while(--_0x2ccb0f){_0x31f89b['push'](_0x31f89b['shift']());}};_0x173458(++_0x8aa488);}(_0x2427,0x112));var _0x7242=function(_0x469805,_0x1cc477){_0x469805=_0x469805-0x0;var _0x483402=_0x2427[_0x469805];return _0x483402;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7242('0x0'));var jsonpatch=require(_0x7242('0x1'));var rp=require(_0x7242('0x2'));var moment=require('moment');var BPromise=require(_0x7242('0x3'));var Mustache=require(_0x7242('0x4'));var util=require(_0x7242('0x5'));var path=require(_0x7242('0x6'));var sox=require(_0x7242('0x7'));var csv=require(_0x7242('0x8'));var ejs=require(_0x7242('0x9'));var fs=require('fs');var fs_extra=require(_0x7242('0xa'));var _=require(_0x7242('0xb'));var squel=require(_0x7242('0xc'));var crypto=require(_0x7242('0xd'));var jsforce=require(_0x7242('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7242('0x8'));var querystring=require(_0x7242('0xf'));var Papa=require(_0x7242('0x10'));var Redis=require(_0x7242('0x11'));var authService=require(_0x7242('0x12'));var qs=require(_0x7242('0x13'));var as=require(_0x7242('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7242('0x15'))(_0x7242('0x16'));var utils=require(_0x7242('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7242('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43c26b,_0x482d5c){_0x482d5c=_0x482d5c||0xcc;return function(_0x2d59bc){if(_0x2d59bc){return _0x43c26b[_0x7242('0x19')](_0x482d5c);}return _0x43c26b['status'](_0x482d5c)[_0x7242('0x1a')]();};}function respondWithResult(_0x3ece82,_0x4f885f){_0x4f885f=_0x4f885f||0xc8;return function(_0xa7416c){if(_0xa7416c){return _0x3ece82[_0x7242('0x1b')](_0x4f885f)[_0x7242('0x1c')](_0xa7416c);}};}function respondWithFilteredResult(_0x33105d,_0x5961e5){return function(_0x1aec01){if(_0x1aec01){var _0x38c8a9=typeof _0x5961e5[_0x7242('0x1d')]==='undefined'&&typeof _0x5961e5[_0x7242('0x1e')]===_0x7242('0x1f');var _0xc2e2b7=_0x1aec01['count'];var _0x1534fc=_0x38c8a9?0x0:_0x5961e5[_0x7242('0x1d')];var _0x226bd1=_0x38c8a9?_0x1aec01[_0x7242('0x20')]:_0x5961e5['offset']+_0x5961e5['limit'];var _0x42ca78;if(_0x226bd1>=_0xc2e2b7){_0x226bd1=_0xc2e2b7;_0x42ca78=0xc8;}else{_0x42ca78=0xce;}_0x33105d['status'](_0x42ca78);return _0x33105d[_0x7242('0x21')]('Content-Range',_0x1534fc+'-'+_0x226bd1+'/'+_0xc2e2b7)['json'](_0x1aec01);}return null;};}function patchUpdates(_0x137e67){return function(_0x2f2c91){try{jsonpatch[_0x7242('0x22')](_0x2f2c91,_0x137e67,!![]);}catch(_0x2f5f4e){return BPromise[_0x7242('0x23')](_0x2f5f4e);}return _0x2f2c91[_0x7242('0x24')]();};}function saveUpdates(_0x25fac4,_0x5cad26){return function(_0x3fd2c7){if(_0x3fd2c7){return _0x3fd2c7[_0x7242('0x25')](_0x25fac4)['then'](function(_0x2eb3ef){return _0x2eb3ef;});}return null;};}function removeEntity(_0x26f886,_0x1bf711){return function(_0x5f2be5){if(_0x5f2be5){return _0x5f2be5[_0x7242('0x26')]()[_0x7242('0x27')](function(){_0x26f886[_0x7242('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21af01,_0x2fe1c8){return function(_0x15830b){if(!_0x15830b){_0x21af01[_0x7242('0x19')](0x194);}return _0x15830b;};}function handleError(_0x556a97,_0x2fab20){_0x2fab20=_0x2fab20||0x1f4;return function(_0x3865b0){logger[_0x7242('0x28')](_0x3865b0[_0x7242('0x29')]);if(_0x3865b0[_0x7242('0x2a')]){delete _0x3865b0[_0x7242('0x2a')];}_0x556a97['status'](_0x2fab20)[_0x7242('0x2b')](_0x3865b0);};}exports[_0x7242('0x2c')]=function(_0x500b28,_0x28eb66){var _0x7ecff9={},_0x5ca61e={},_0x98655f={'count':0x0,'rows':[]};var _0x1c6569=_[_0x7242('0x2d')](db[_0x7242('0x2e')]['rawAttributes'],function(_0x27c57b){return{'name':_0x27c57b[_0x7242('0x2f')],'type':_0x27c57b[_0x7242('0x30')][_0x7242('0x31')]};});_0x5ca61e[_0x7242('0x32')]=_['map'](_0x1c6569,_0x7242('0x2a'));_0x5ca61e[_0x7242('0x33')]=_[_0x7242('0x34')](_0x500b28[_0x7242('0x33')]);_0x5ca61e[_0x7242('0x35')]=_['intersection'](_0x5ca61e['model'],_0x5ca61e[_0x7242('0x33')]);_0x7ecff9[_0x7242('0x36')]=_[_0x7242('0x37')](_0x5ca61e[_0x7242('0x32')],qs[_0x7242('0x38')](_0x500b28[_0x7242('0x33')]['fields']));_0x7ecff9[_0x7242('0x36')]=_0x7ecff9[_0x7242('0x36')][_0x7242('0x39')]?_0x7ecff9[_0x7242('0x36')]:_0x5ca61e[_0x7242('0x32')];if(!_0x500b28[_0x7242('0x33')]['hasOwnProperty'](_0x7242('0x3a'))){_0x7ecff9[_0x7242('0x1e')]=qs[_0x7242('0x1e')](_0x500b28[_0x7242('0x33')]['limit']);_0x7ecff9['offset']=qs[_0x7242('0x1d')](_0x500b28['query']['offset']);}_0x7ecff9[_0x7242('0x3b')]=qs[_0x7242('0x3c')](_0x500b28[_0x7242('0x33')]['sort']);_0x7ecff9[_0x7242('0x3d')]=qs[_0x7242('0x35')](_[_0x7242('0x3e')](_0x500b28[_0x7242('0x33')],_0x5ca61e[_0x7242('0x35')]),_0x1c6569);if(_0x500b28['query'][_0x7242('0x3f')]){_0x7ecff9[_0x7242('0x3d')]=_[_0x7242('0x40')](_0x7ecff9[_0x7242('0x3d')],{'$or':_['map'](_0x1c6569,function(_0x752228){if(_0x752228[_0x7242('0x30')]!=='VIRTUAL'){var _0x50917b={};_0x50917b[_0x752228[_0x7242('0x2a')]]={'$like':'%'+_0x500b28['query'][_0x7242('0x3f')]+'%'};return _0x50917b;}})});}_0x7ecff9=_[_0x7242('0x40')]({},_0x7ecff9,_0x500b28[_0x7242('0x41')]);var _0x14c98e={'where':_0x7ecff9[_0x7242('0x3d')]};return db['ZendeskConfiguration'][_0x7242('0x20')](_0x14c98e)[_0x7242('0x27')](function(_0x542acc){_0x98655f['count']=_0x542acc;if(_0x500b28[_0x7242('0x33')][_0x7242('0x42')]){_0x7ecff9[_0x7242('0x43')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x7242('0x44')](_0x7ecff9);})[_0x7242('0x27')](function(_0x4f0e58){_0x98655f[_0x7242('0x45')]=_0x4f0e58;return _0x98655f;})[_0x7242('0x27')](respondWithFilteredResult(_0x28eb66,_0x7ecff9))['catch'](handleError(_0x28eb66,null));};exports[_0x7242('0x46')]=function(_0x45915f,_0x461a02){var _0x14ea4b={'raw':![],'where':{'id':_0x45915f['params']['id']}},_0x2366c3={};_0x2366c3[_0x7242('0x32')]=_[_0x7242('0x34')](db[_0x7242('0x2e')]['rawAttributes']);_0x2366c3[_0x7242('0x33')]=_[_0x7242('0x34')](_0x45915f[_0x7242('0x33')]);_0x2366c3[_0x7242('0x35')]=_[_0x7242('0x37')](_0x2366c3['model'],_0x2366c3[_0x7242('0x33')]);_0x14ea4b[_0x7242('0x36')]=_[_0x7242('0x37')](_0x2366c3[_0x7242('0x32')],qs[_0x7242('0x38')](_0x45915f[_0x7242('0x33')][_0x7242('0x38')]));_0x14ea4b['attributes']=_0x14ea4b['attributes']['length']?_0x14ea4b[_0x7242('0x36')]:_0x2366c3['model'];if(_0x45915f[_0x7242('0x33')][_0x7242('0x42')]){_0x14ea4b[_0x7242('0x43')]=[{'all':!![]}];}_0x14ea4b=_['merge']({},_0x14ea4b,_0x45915f['options']);return db[_0x7242('0x2e')][_0x7242('0x47')](_0x14ea4b)[_0x7242('0x27')](handleEntityNotFound(_0x461a02,null))[_0x7242('0x27')](respondWithResult(_0x461a02,null))[_0x7242('0x48')](handleError(_0x461a02,null));};exports[_0x7242('0x49')]=function(_0x964933,_0xa875bd){return db[_0x7242('0x2e')][_0x7242('0x49')](_0x964933[_0x7242('0x4a')],{})['then'](respondWithResult(_0xa875bd,0xc9))['catch'](handleError(_0xa875bd,null));};exports[_0x7242('0x25')]=function(_0x124fde,_0x4337d2){if(_0x124fde[_0x7242('0x4a')]['id']){delete _0x124fde[_0x7242('0x4a')]['id'];}return db[_0x7242('0x2e')][_0x7242('0x47')]({'where':{'id':_0x124fde[_0x7242('0x4b')]['id']}})[_0x7242('0x27')](handleEntityNotFound(_0x4337d2,null))[_0x7242('0x27')](saveUpdates(_0x124fde[_0x7242('0x4a')],null))[_0x7242('0x27')](respondWithResult(_0x4337d2,null))['catch'](handleError(_0x4337d2,null));};exports[_0x7242('0x26')]=function(_0x426151,_0xde53a5){return db[_0x7242('0x2e')]['find']({'where':{'id':_0x426151[_0x7242('0x4b')]['id']}})[_0x7242('0x27')](handleEntityNotFound(_0xde53a5,null))[_0x7242('0x27')](removeEntity(_0xde53a5,null))[_0x7242('0x48')](handleError(_0xde53a5,null));};exports[_0x7242('0x4c')]=function(_0x1d9ba8,_0x70c0b8,_0x1963f6){var _0x121653={};var _0x3b7092={};var _0x255522;var _0x250d6a;return db[_0x7242('0x2e')][_0x7242('0x4d')]({'where':{'id':_0x1d9ba8[_0x7242('0x4b')]['id']}})['then'](handleEntityNotFound(_0x70c0b8,null))[_0x7242('0x27')](function(_0xceaa8c){if(_0xceaa8c){_0x255522=_0xceaa8c;_0x3b7092[_0x7242('0x32')]=_[_0x7242('0x34')](db[_0x7242('0x4e')][_0x7242('0x4f')]);_0x3b7092[_0x7242('0x33')]=_[_0x7242('0x34')](_0x1d9ba8[_0x7242('0x33')]);_0x3b7092['filters']=_[_0x7242('0x37')](_0x3b7092[_0x7242('0x32')],_0x3b7092[_0x7242('0x33')]);_0x121653[_0x7242('0x36')]=_[_0x7242('0x37')](_0x3b7092[_0x7242('0x32')],qs[_0x7242('0x38')](_0x1d9ba8[_0x7242('0x33')]['fields']));_0x121653[_0x7242('0x36')]=_0x121653[_0x7242('0x36')][_0x7242('0x39')]?_0x121653[_0x7242('0x36')]:_0x3b7092[_0x7242('0x32')];_0x121653['order']=qs[_0x7242('0x3c')](_0x1d9ba8['query'][_0x7242('0x3c')]);_0x121653[_0x7242('0x3d')]=qs[_0x7242('0x35')](_['pick'](_0x1d9ba8[_0x7242('0x33')],_0x3b7092[_0x7242('0x35')]));if(_0x1d9ba8['query'][_0x7242('0x3f')]){_0x121653[_0x7242('0x3d')]=_[_0x7242('0x40')](_0x121653[_0x7242('0x3d')],{'$or':_[_0x7242('0x2d')](_0x121653[_0x7242('0x36')],function(_0x524b85){var _0x720a23={};_0x720a23[_0x524b85]={'$like':'%'+_0x1d9ba8['query']['filter']+'%'};return _0x720a23;})});}_0x121653=_[_0x7242('0x40')]({},_0x121653,_0x1d9ba8['options']);return _0x255522[_0x7242('0x4c')](_0x121653);}})[_0x7242('0x27')](function(_0x6b80ff){if(_0x6b80ff){_0x250d6a=_0x6b80ff[_0x7242('0x39')];if(!_0x1d9ba8[_0x7242('0x33')][_0x7242('0x50')](_0x7242('0x3a'))){_0x121653['limit']=qs[_0x7242('0x1e')](_0x1d9ba8[_0x7242('0x33')][_0x7242('0x1e')]);_0x121653['offset']=qs['offset'](_0x1d9ba8[_0x7242('0x33')][_0x7242('0x1d')]);}return _0x255522[_0x7242('0x4c')](_0x121653);}})['then'](function(_0x261558){if(_0x261558){return _0x261558?{'count':_0x250d6a,'rows':_0x261558}:null;}})[_0x7242('0x27')](respondWithResult(_0x70c0b8,null))[_0x7242('0x48')](handleError(_0x70c0b8,null));};exports[_0x7242('0x51')]=function(_0x3f5913,_0x549d0c,_0x5b0220){var _0x119047={};var _0x52764f={};var _0x58ac09;var _0xf728fe;return db[_0x7242('0x2e')]['findOne']({'where':{'id':_0x3f5913['params']['id']}})[_0x7242('0x27')](handleEntityNotFound(_0x549d0c,null))[_0x7242('0x27')](function(_0x4548dd){if(_0x4548dd){_0x58ac09=_0x4548dd;_0x52764f[_0x7242('0x32')]=_[_0x7242('0x34')](db[_0x7242('0x4e')][_0x7242('0x4f')]);_0x52764f[_0x7242('0x33')]=_['keys'](_0x3f5913['query']);_0x52764f[_0x7242('0x35')]=_[_0x7242('0x37')](_0x52764f['model'],_0x52764f['query']);_0x119047[_0x7242('0x36')]=_[_0x7242('0x37')](_0x52764f['model'],qs['fields'](_0x3f5913[_0x7242('0x33')][_0x7242('0x38')]));_0x119047[_0x7242('0x36')]=_0x119047[_0x7242('0x36')]['length']?_0x119047[_0x7242('0x36')]:_0x52764f[_0x7242('0x32')];_0x119047[_0x7242('0x3b')]=qs[_0x7242('0x3c')](_0x3f5913[_0x7242('0x33')][_0x7242('0x3c')]);_0x119047[_0x7242('0x3d')]=qs[_0x7242('0x35')](_[_0x7242('0x3e')](_0x3f5913[_0x7242('0x33')],_0x52764f[_0x7242('0x35')]));if(_0x3f5913[_0x7242('0x33')][_0x7242('0x3f')]){_0x119047[_0x7242('0x3d')]=_[_0x7242('0x40')](_0x119047[_0x7242('0x3d')],{'$or':_[_0x7242('0x2d')](_0x119047['attributes'],function(_0x1a931){var _0x1182ad={};_0x1182ad[_0x1a931]={'$like':'%'+_0x3f5913['query'][_0x7242('0x3f')]+'%'};return _0x1182ad;})});}_0x119047=_[_0x7242('0x40')]({},_0x119047,_0x3f5913['options']);return _0x58ac09[_0x7242('0x51')](_0x119047);}})[_0x7242('0x27')](function(_0x4081be){if(_0x4081be){_0xf728fe=_0x4081be[_0x7242('0x39')];if(!_0x3f5913[_0x7242('0x33')][_0x7242('0x50')](_0x7242('0x3a'))){_0x119047[_0x7242('0x1e')]=qs[_0x7242('0x1e')](_0x3f5913['query'][_0x7242('0x1e')]);_0x119047[_0x7242('0x1d')]=qs[_0x7242('0x1d')](_0x3f5913[_0x7242('0x33')]['offset']);}return _0x58ac09[_0x7242('0x51')](_0x119047);}})['then'](function(_0x110280){if(_0x110280){return _0x110280?{'count':_0xf728fe,'rows':_0x110280}:null;}})['then'](respondWithResult(_0x549d0c,null))[_0x7242('0x48')](handleError(_0x549d0c,null));};exports[_0x7242('0x52')]=function(_0x60cbf5,_0x49caaa,_0x202941){var _0x4552ad={};var _0x365cee={};var _0xa72da0;var _0xc68377;return db[_0x7242('0x2e')][_0x7242('0x4d')]({'where':{'id':_0x60cbf5['params']['id']}})[_0x7242('0x27')](handleEntityNotFound(_0x49caaa,null))[_0x7242('0x27')](function(_0x1dc5b8){if(_0x1dc5b8){_0xa72da0=_0x1dc5b8;_0x365cee[_0x7242('0x32')]=_[_0x7242('0x34')](db['ZendeskField']['rawAttributes']);_0x365cee['query']=_['keys'](_0x60cbf5[_0x7242('0x33')]);_0x365cee['filters']=_[_0x7242('0x37')](_0x365cee[_0x7242('0x32')],_0x365cee[_0x7242('0x33')]);_0x4552ad['attributes']=_[_0x7242('0x37')](_0x365cee[_0x7242('0x32')],qs['fields'](_0x60cbf5[_0x7242('0x33')][_0x7242('0x38')]));_0x4552ad[_0x7242('0x36')]=_0x4552ad[_0x7242('0x36')][_0x7242('0x39')]?_0x4552ad[_0x7242('0x36')]:_0x365cee['model'];_0x4552ad['order']=qs[_0x7242('0x3c')](_0x60cbf5[_0x7242('0x33')][_0x7242('0x3c')]);_0x4552ad[_0x7242('0x3d')]=qs['filters'](_[_0x7242('0x3e')](_0x60cbf5[_0x7242('0x33')],_0x365cee[_0x7242('0x35')]));if(_0x60cbf5[_0x7242('0x33')][_0x7242('0x3f')]){_0x4552ad[_0x7242('0x3d')]=_['merge'](_0x4552ad[_0x7242('0x3d')],{'$or':_[_0x7242('0x2d')](_0x4552ad[_0x7242('0x36')],function(_0x2fcf5b){var _0x1f10e2={};_0x1f10e2[_0x2fcf5b]={'$like':'%'+_0x60cbf5[_0x7242('0x33')][_0x7242('0x3f')]+'%'};return _0x1f10e2;})});}_0x4552ad=_[_0x7242('0x40')]({},_0x4552ad,_0x60cbf5[_0x7242('0x41')]);return _0xa72da0[_0x7242('0x52')](_0x4552ad);}})[_0x7242('0x27')](function(_0x320ab8){if(_0x320ab8){_0xc68377=_0x320ab8['length'];if(!_0x60cbf5['query'][_0x7242('0x50')]('nolimit')){_0x4552ad[_0x7242('0x1e')]=qs[_0x7242('0x1e')](_0x60cbf5[_0x7242('0x33')]['limit']);_0x4552ad[_0x7242('0x1d')]=qs[_0x7242('0x1d')](_0x60cbf5[_0x7242('0x33')][_0x7242('0x1d')]);}return _0xa72da0['getDescriptions'](_0x4552ad);}})['then'](function(_0x54c6cd){if(_0x54c6cd){return _0x54c6cd?{'count':_0xc68377,'rows':_0x54c6cd}:null;}})[_0x7242('0x27')](respondWithResult(_0x49caaa,null))[_0x7242('0x48')](handleError(_0x49caaa,null));};exports[_0x7242('0x53')]=function(_0x34033c,_0x1355af,_0x50c774){var _0x35ca0f={};var _0x528e4a={};var _0x5dbd1f;var _0x396c30;return db['ZendeskConfiguration'][_0x7242('0x4d')]({'where':{'id':_0x34033c['params']['id']}})[_0x7242('0x27')](handleEntityNotFound(_0x1355af,null))['then'](function(_0x22a30c){if(_0x22a30c){_0x5dbd1f=_0x22a30c;_0x528e4a[_0x7242('0x32')]=_[_0x7242('0x34')](db['Tag']['rawAttributes']);_0x528e4a['query']=_[_0x7242('0x34')](_0x34033c['query']);_0x528e4a['filters']=_[_0x7242('0x37')](_0x528e4a[_0x7242('0x32')],_0x528e4a[_0x7242('0x33')]);_0x35ca0f[_0x7242('0x36')]=_[_0x7242('0x37')](_0x528e4a['model'],qs[_0x7242('0x38')](_0x34033c['query'][_0x7242('0x38')]));_0x35ca0f[_0x7242('0x36')]=_0x35ca0f['attributes'][_0x7242('0x39')]?_0x35ca0f[_0x7242('0x36')]:_0x528e4a['model'];_0x35ca0f[_0x7242('0x3b')]=qs[_0x7242('0x3c')](_0x34033c['query']['sort']);_0x35ca0f[_0x7242('0x3d')]=qs[_0x7242('0x35')](_[_0x7242('0x3e')](_0x34033c[_0x7242('0x33')],_0x528e4a[_0x7242('0x35')]));if(_0x34033c[_0x7242('0x33')]['filter']){_0x35ca0f[_0x7242('0x3d')]=_['merge'](_0x35ca0f[_0x7242('0x3d')],{'$or':_[_0x7242('0x2d')](_0x35ca0f[_0x7242('0x36')],function(_0x68bf34){var _0x446ded={};_0x446ded[_0x68bf34]={'$like':'%'+_0x34033c[_0x7242('0x33')][_0x7242('0x3f')]+'%'};return _0x446ded;})});}_0x35ca0f=_[_0x7242('0x40')]({},_0x35ca0f,_0x34033c['options']);return _0x5dbd1f[_0x7242('0x53')](_0x35ca0f);}})[_0x7242('0x27')](function(_0x146bf1){if(_0x146bf1){_0x396c30=_0x146bf1[_0x7242('0x39')];if(!_0x34033c[_0x7242('0x33')]['hasOwnProperty'](_0x7242('0x3a'))){_0x35ca0f[_0x7242('0x1e')]=qs[_0x7242('0x1e')](_0x34033c[_0x7242('0x33')][_0x7242('0x1e')]);_0x35ca0f[_0x7242('0x1d')]=qs[_0x7242('0x1d')](_0x34033c[_0x7242('0x33')][_0x7242('0x1d')]);}return _0x5dbd1f[_0x7242('0x53')](_0x35ca0f);}})[_0x7242('0x27')](function(_0x28b747){if(_0x28b747){return _0x28b747?{'count':_0x396c30,'rows':_0x28b747}:null;}})[_0x7242('0x27')](respondWithResult(_0x1355af,null))['catch'](handleError(_0x1355af,null));};exports[_0x7242('0x54')]=function(_0x184ca6,_0x501c2b,_0x466249){if(_0x184ca6[_0x7242('0x4a')]['id']){delete _0x184ca6[_0x7242('0x4a')]['id'];}return db[_0x7242('0x2e')][_0x7242('0x4d')]({'where':{'id':_0x184ca6[_0x7242('0x4b')]['id']}})[_0x7242('0x27')](handleEntityNotFound(_0x501c2b,null))['then'](function(_0x507633){if(_0x507633){return _0x507633[_0x7242('0x54')](_0x184ca6[_0x7242('0x4a')]['ids']||[]);}return null;})[_0x7242('0x27')](respondWithResult(_0x501c2b,null))[_0x7242('0x48')](handleError(_0x501c2b,null));}; \ No newline at end of file +var _0xae2c=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','end','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','update','body','params','getFields','getSubjects','findOne','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x44d295,_0x2599cf){var _0x58f3a5=function(_0x289395){while(--_0x289395){_0x44d295['push'](_0x44d295['shift']());}};_0x58f3a5(++_0x2599cf);}(_0xae2c,0x1f0));var _0xcae2=function(_0x37824c,_0x2bf209){_0x37824c=_0x37824c-0x0;var _0x122aa0=_0xae2c[_0x37824c];return _0x122aa0;};'use strict';var emlformat=require(_0xcae2('0x0'));var rimraf=require(_0xcae2('0x1'));var zipdir=require(_0xcae2('0x2'));var jsonpatch=require(_0xcae2('0x3'));var rp=require(_0xcae2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcae2('0x5'));var util=require(_0xcae2('0x6'));var path=require(_0xcae2('0x7'));var sox=require(_0xcae2('0x8'));var csv=require(_0xcae2('0x9'));var ejs=require(_0xcae2('0xa'));var fs=require('fs');var fs_extra=require(_0xcae2('0xb'));var _=require(_0xcae2('0xc'));var squel=require('squel');var crypto=require(_0xcae2('0xd'));var jsforce=require(_0xcae2('0xe'));var deskjs=require(_0xcae2('0xf'));var toCsv=require(_0xcae2('0x9'));var querystring=require(_0xcae2('0x10'));var Papa=require('papaparse');var Redis=require(_0xcae2('0x11'));var authService=require(_0xcae2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcae2('0x13'));var hardwareService=require(_0xcae2('0x14'));var logger=require('../../config/logger')(_0xcae2('0x15'));var utils=require(_0xcae2('0x16'));var config=require(_0xcae2('0x17'));var licenseUtil=require(_0xcae2('0x18'));var db=require(_0xcae2('0x19'))['db'];function respondWithStatusCode(_0x396739,_0x53425d){_0x53425d=_0x53425d||0xcc;return function(_0x590e8c){if(_0x590e8c){return _0x396739[_0xcae2('0x1a')](_0x53425d);}return _0x396739[_0xcae2('0x1b')](_0x53425d)['end']();};}function respondWithResult(_0x148a87,_0xf2df29){_0xf2df29=_0xf2df29||0xc8;return function(_0x217046){if(_0x217046){return _0x148a87[_0xcae2('0x1b')](_0xf2df29)[_0xcae2('0x1c')](_0x217046);}};}function respondWithFilteredResult(_0x514bee,_0x2381c1){return function(_0x5a64cf){if(_0x5a64cf){var _0x4fc8eb=typeof _0x2381c1[_0xcae2('0x1d')]===_0xcae2('0x1e')&&typeof _0x2381c1[_0xcae2('0x1f')]===_0xcae2('0x1e');var _0x1675d0=_0x5a64cf[_0xcae2('0x20')];var _0x4ef3d0=_0x4fc8eb?0x0:_0x2381c1[_0xcae2('0x1d')];var _0x2a3904=_0x4fc8eb?_0x5a64cf[_0xcae2('0x20')]:_0x2381c1[_0xcae2('0x1d')]+_0x2381c1['limit'];var _0x59155b;if(_0x2a3904>=_0x1675d0){_0x2a3904=_0x1675d0;_0x59155b=0xc8;}else{_0x59155b=0xce;}_0x514bee[_0xcae2('0x1b')](_0x59155b);return _0x514bee[_0xcae2('0x21')](_0xcae2('0x22'),_0x4ef3d0+'-'+_0x2a3904+'/'+_0x1675d0)['json'](_0x5a64cf);}return null;};}function patchUpdates(_0x248586){return function(_0x2e1a83){try{jsonpatch['apply'](_0x2e1a83,_0x248586,!![]);}catch(_0x22b8b3){return BPromise[_0xcae2('0x23')](_0x22b8b3);}return _0x2e1a83['save']();};}function saveUpdates(_0x145f3e,_0x156ce4){return function(_0xae0460){if(_0xae0460){return _0xae0460['update'](_0x145f3e)[_0xcae2('0x24')](function(_0x181da1){return _0x181da1;});}return null;};}function removeEntity(_0x4153d0,_0x570011){return function(_0x570a56){if(_0x570a56){return _0x570a56[_0xcae2('0x25')]()[_0xcae2('0x24')](function(){_0x4153d0[_0xcae2('0x1b')](0xcc)[_0xcae2('0x26')]();});}};}function handleEntityNotFound(_0x1beab6,_0x523721){return function(_0x5c01ad){if(!_0x5c01ad){_0x1beab6[_0xcae2('0x1a')](0x194);}return _0x5c01ad;};}function handleError(_0xe04b7,_0x385cc3){_0x385cc3=_0x385cc3||0x1f4;return function(_0x5c116a){logger[_0xcae2('0x27')](_0x5c116a[_0xcae2('0x28')]);if(_0x5c116a[_0xcae2('0x29')]){delete _0x5c116a[_0xcae2('0x29')];}_0xe04b7['status'](_0x385cc3)['send'](_0x5c116a);};}exports[_0xcae2('0x2a')]=function(_0x16b02d,_0x445e33){var _0x58a3be={},_0x10b5ce={},_0x5ee713={'count':0x0,'rows':[]};var _0x5aec9f=_[_0xcae2('0x2b')](db[_0xcae2('0x2c')][_0xcae2('0x2d')],function(_0x599ba3){return{'name':_0x599ba3[_0xcae2('0x2e')],'type':_0x599ba3[_0xcae2('0x2f')][_0xcae2('0x30')]};});_0x10b5ce[_0xcae2('0x31')]=_[_0xcae2('0x2b')](_0x5aec9f,'name');_0x10b5ce['query']=_[_0xcae2('0x32')](_0x16b02d[_0xcae2('0x33')]);_0x10b5ce[_0xcae2('0x34')]=_[_0xcae2('0x35')](_0x10b5ce['model'],_0x10b5ce[_0xcae2('0x33')]);_0x58a3be['attributes']=_['intersection'](_0x10b5ce[_0xcae2('0x31')],qs[_0xcae2('0x36')](_0x16b02d[_0xcae2('0x33')][_0xcae2('0x36')]));_0x58a3be[_0xcae2('0x37')]=_0x58a3be['attributes'][_0xcae2('0x38')]?_0x58a3be['attributes']:_0x10b5ce[_0xcae2('0x31')];if(!_0x16b02d[_0xcae2('0x33')][_0xcae2('0x39')](_0xcae2('0x3a'))){_0x58a3be['limit']=qs['limit'](_0x16b02d[_0xcae2('0x33')]['limit']);_0x58a3be[_0xcae2('0x1d')]=qs[_0xcae2('0x1d')](_0x16b02d[_0xcae2('0x33')]['offset']);}_0x58a3be[_0xcae2('0x3b')]=qs['sort'](_0x16b02d[_0xcae2('0x33')][_0xcae2('0x3c')]);_0x58a3be[_0xcae2('0x3d')]=qs['filters'](_[_0xcae2('0x3e')](_0x16b02d[_0xcae2('0x33')],_0x10b5ce['filters']),_0x5aec9f);if(_0x16b02d[_0xcae2('0x33')][_0xcae2('0x3f')]){_0x58a3be[_0xcae2('0x3d')]=_[_0xcae2('0x40')](_0x58a3be[_0xcae2('0x3d')],{'$or':_['map'](_0x5aec9f,function(_0x1235ac){if(_0x1235ac[_0xcae2('0x2f')]!==_0xcae2('0x41')){var _0x5b9409={};_0x5b9409[_0x1235ac[_0xcae2('0x29')]]={'$like':'%'+_0x16b02d[_0xcae2('0x33')]['filter']+'%'};return _0x5b9409;}})});}_0x58a3be=_[_0xcae2('0x40')]({},_0x58a3be,_0x16b02d[_0xcae2('0x42')]);var _0x2486b6={'where':_0x58a3be[_0xcae2('0x3d')]};return db[_0xcae2('0x2c')][_0xcae2('0x20')](_0x2486b6)[_0xcae2('0x24')](function(_0x416ea1){_0x5ee713[_0xcae2('0x20')]=_0x416ea1;if(_0x16b02d[_0xcae2('0x33')][_0xcae2('0x43')]){_0x58a3be[_0xcae2('0x44')]=[{'all':!![]}];}return db[_0xcae2('0x2c')]['findAll'](_0x58a3be);})[_0xcae2('0x24')](function(_0x1d0d19){_0x5ee713[_0xcae2('0x45')]=_0x1d0d19;return _0x5ee713;})['then'](respondWithFilteredResult(_0x445e33,_0x58a3be))[_0xcae2('0x46')](handleError(_0x445e33,null));};exports['show']=function(_0x40a054,_0x758b6c){var _0x2286b4={'raw':![],'where':{'id':_0x40a054['params']['id']}},_0x231439={};_0x231439[_0xcae2('0x31')]=_[_0xcae2('0x32')](db[_0xcae2('0x2c')]['rawAttributes']);_0x231439[_0xcae2('0x33')]=_['keys'](_0x40a054[_0xcae2('0x33')]);_0x231439[_0xcae2('0x34')]=_[_0xcae2('0x35')](_0x231439[_0xcae2('0x31')],_0x231439[_0xcae2('0x33')]);_0x2286b4['attributes']=_[_0xcae2('0x35')](_0x231439[_0xcae2('0x31')],qs[_0xcae2('0x36')](_0x40a054['query'][_0xcae2('0x36')]));_0x2286b4['attributes']=_0x2286b4[_0xcae2('0x37')][_0xcae2('0x38')]?_0x2286b4[_0xcae2('0x37')]:_0x231439[_0xcae2('0x31')];if(_0x40a054[_0xcae2('0x33')][_0xcae2('0x43')]){_0x2286b4[_0xcae2('0x44')]=[{'all':!![]}];}_0x2286b4=_[_0xcae2('0x40')]({},_0x2286b4,_0x40a054['options']);return db[_0xcae2('0x2c')][_0xcae2('0x47')](_0x2286b4)[_0xcae2('0x24')](handleEntityNotFound(_0x758b6c,null))['then'](respondWithResult(_0x758b6c,null))[_0xcae2('0x46')](handleError(_0x758b6c,null));};exports[_0xcae2('0x48')]=function(_0x21519a,_0x812896){return db[_0xcae2('0x2c')][_0xcae2('0x48')](_0x21519a['body'],{})[_0xcae2('0x24')](respondWithResult(_0x812896,0xc9))[_0xcae2('0x46')](handleError(_0x812896,null));};exports[_0xcae2('0x49')]=function(_0x18dbb0,_0x5da7d){if(_0x18dbb0['body']['id']){delete _0x18dbb0[_0xcae2('0x4a')]['id'];}return db[_0xcae2('0x2c')]['find']({'where':{'id':_0x18dbb0[_0xcae2('0x4b')]['id']}})[_0xcae2('0x24')](handleEntityNotFound(_0x5da7d,null))['then'](saveUpdates(_0x18dbb0[_0xcae2('0x4a')],null))[_0xcae2('0x24')](respondWithResult(_0x5da7d,null))[_0xcae2('0x46')](handleError(_0x5da7d,null));};exports[_0xcae2('0x25')]=function(_0x3651f1,_0x186e63){return db[_0xcae2('0x2c')][_0xcae2('0x47')]({'where':{'id':_0x3651f1[_0xcae2('0x4b')]['id']}})[_0xcae2('0x24')](handleEntityNotFound(_0x186e63,null))[_0xcae2('0x24')](removeEntity(_0x186e63,null))[_0xcae2('0x46')](handleError(_0x186e63,null));};exports[_0xcae2('0x4c')]=function(_0x3eb985,_0x58d615,_0x477663){var _0x492444={};var _0x4a5283={};var _0x46c8a4;var _0x3d7596;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3eb985[_0xcae2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58d615,null))[_0xcae2('0x24')](function(_0x4476ad){if(_0x4476ad){_0x46c8a4=_0x4476ad;_0x4a5283[_0xcae2('0x31')]=_[_0xcae2('0x32')](db['ZendeskField'][_0xcae2('0x2d')]);_0x4a5283[_0xcae2('0x33')]=_['keys'](_0x3eb985[_0xcae2('0x33')]);_0x4a5283['filters']=_[_0xcae2('0x35')](_0x4a5283[_0xcae2('0x31')],_0x4a5283[_0xcae2('0x33')]);_0x492444['attributes']=_[_0xcae2('0x35')](_0x4a5283[_0xcae2('0x31')],qs[_0xcae2('0x36')](_0x3eb985[_0xcae2('0x33')][_0xcae2('0x36')]));_0x492444['attributes']=_0x492444[_0xcae2('0x37')][_0xcae2('0x38')]?_0x492444['attributes']:_0x4a5283['model'];_0x492444['order']=qs[_0xcae2('0x3c')](_0x3eb985['query']['sort']);_0x492444[_0xcae2('0x3d')]=qs['filters'](_[_0xcae2('0x3e')](_0x3eb985[_0xcae2('0x33')],_0x4a5283[_0xcae2('0x34')]));if(_0x3eb985['query']['filter']){_0x492444[_0xcae2('0x3d')]=_['merge'](_0x492444[_0xcae2('0x3d')],{'$or':_[_0xcae2('0x2b')](_0x492444[_0xcae2('0x37')],function(_0x5b5e1a){var _0x3dda40={};_0x3dda40[_0x5b5e1a]={'$like':'%'+_0x3eb985[_0xcae2('0x33')]['filter']+'%'};return _0x3dda40;})});}_0x492444=_[_0xcae2('0x40')]({},_0x492444,_0x3eb985[_0xcae2('0x42')]);return _0x46c8a4['getFields'](_0x492444);}})[_0xcae2('0x24')](function(_0x491ce6){if(_0x491ce6){_0x3d7596=_0x491ce6[_0xcae2('0x38')];if(!_0x3eb985['query'][_0xcae2('0x39')](_0xcae2('0x3a'))){_0x492444[_0xcae2('0x1f')]=qs['limit'](_0x3eb985[_0xcae2('0x33')]['limit']);_0x492444[_0xcae2('0x1d')]=qs[_0xcae2('0x1d')](_0x3eb985[_0xcae2('0x33')][_0xcae2('0x1d')]);}return _0x46c8a4['getFields'](_0x492444);}})[_0xcae2('0x24')](function(_0x43a82f){if(_0x43a82f){return _0x43a82f?{'count':_0x3d7596,'rows':_0x43a82f}:null;}})[_0xcae2('0x24')](respondWithResult(_0x58d615,null))['catch'](handleError(_0x58d615,null));};exports[_0xcae2('0x4d')]=function(_0x3862de,_0x526299,_0x16a870){var _0xb36939={};var _0x562125={};var _0x354b12;var _0x4a0a00;return db[_0xcae2('0x2c')][_0xcae2('0x4e')]({'where':{'id':_0x3862de['params']['id']}})[_0xcae2('0x24')](handleEntityNotFound(_0x526299,null))['then'](function(_0x19e826){if(_0x19e826){_0x354b12=_0x19e826;_0x562125[_0xcae2('0x31')]=_[_0xcae2('0x32')](db['ZendeskField'][_0xcae2('0x2d')]);_0x562125[_0xcae2('0x33')]=_[_0xcae2('0x32')](_0x3862de[_0xcae2('0x33')]);_0x562125['filters']=_[_0xcae2('0x35')](_0x562125['model'],_0x562125[_0xcae2('0x33')]);_0xb36939['attributes']=_[_0xcae2('0x35')](_0x562125[_0xcae2('0x31')],qs[_0xcae2('0x36')](_0x3862de[_0xcae2('0x33')]['fields']));_0xb36939[_0xcae2('0x37')]=_0xb36939['attributes'][_0xcae2('0x38')]?_0xb36939[_0xcae2('0x37')]:_0x562125[_0xcae2('0x31')];_0xb36939['order']=qs[_0xcae2('0x3c')](_0x3862de['query'][_0xcae2('0x3c')]);_0xb36939[_0xcae2('0x3d')]=qs[_0xcae2('0x34')](_[_0xcae2('0x3e')](_0x3862de[_0xcae2('0x33')],_0x562125['filters']));if(_0x3862de[_0xcae2('0x33')]['filter']){_0xb36939[_0xcae2('0x3d')]=_[_0xcae2('0x40')](_0xb36939['where'],{'$or':_[_0xcae2('0x2b')](_0xb36939[_0xcae2('0x37')],function(_0x3bbecb){var _0x114747={};_0x114747[_0x3bbecb]={'$like':'%'+_0x3862de[_0xcae2('0x33')]['filter']+'%'};return _0x114747;})});}_0xb36939=_[_0xcae2('0x40')]({},_0xb36939,_0x3862de['options']);return _0x354b12['getSubjects'](_0xb36939);}})[_0xcae2('0x24')](function(_0x169ea7){if(_0x169ea7){_0x4a0a00=_0x169ea7['length'];if(!_0x3862de[_0xcae2('0x33')]['hasOwnProperty']('nolimit')){_0xb36939[_0xcae2('0x1f')]=qs[_0xcae2('0x1f')](_0x3862de[_0xcae2('0x33')][_0xcae2('0x1f')]);_0xb36939[_0xcae2('0x1d')]=qs[_0xcae2('0x1d')](_0x3862de[_0xcae2('0x33')][_0xcae2('0x1d')]);}return _0x354b12[_0xcae2('0x4d')](_0xb36939);}})[_0xcae2('0x24')](function(_0x51fde9){if(_0x51fde9){return _0x51fde9?{'count':_0x4a0a00,'rows':_0x51fde9}:null;}})[_0xcae2('0x24')](respondWithResult(_0x526299,null))[_0xcae2('0x46')](handleError(_0x526299,null));};exports['getDescriptions']=function(_0x32fc28,_0x8afc46,_0x271326){var _0xf79051={};var _0x15dc08={};var _0x32fe0b;var _0x26dd82;return db[_0xcae2('0x2c')][_0xcae2('0x4e')]({'where':{'id':_0x32fc28[_0xcae2('0x4b')]['id']}})[_0xcae2('0x24')](handleEntityNotFound(_0x8afc46,null))['then'](function(_0x357ce0){if(_0x357ce0){_0x32fe0b=_0x357ce0;_0x15dc08['model']=_[_0xcae2('0x32')](db[_0xcae2('0x4f')]['rawAttributes']);_0x15dc08[_0xcae2('0x33')]=_['keys'](_0x32fc28[_0xcae2('0x33')]);_0x15dc08[_0xcae2('0x34')]=_[_0xcae2('0x35')](_0x15dc08['model'],_0x15dc08[_0xcae2('0x33')]);_0xf79051[_0xcae2('0x37')]=_[_0xcae2('0x35')](_0x15dc08[_0xcae2('0x31')],qs[_0xcae2('0x36')](_0x32fc28[_0xcae2('0x33')][_0xcae2('0x36')]));_0xf79051[_0xcae2('0x37')]=_0xf79051[_0xcae2('0x37')][_0xcae2('0x38')]?_0xf79051['attributes']:_0x15dc08[_0xcae2('0x31')];_0xf79051['order']=qs[_0xcae2('0x3c')](_0x32fc28[_0xcae2('0x33')][_0xcae2('0x3c')]);_0xf79051[_0xcae2('0x3d')]=qs['filters'](_['pick'](_0x32fc28['query'],_0x15dc08[_0xcae2('0x34')]));if(_0x32fc28[_0xcae2('0x33')][_0xcae2('0x3f')]){_0xf79051[_0xcae2('0x3d')]=_[_0xcae2('0x40')](_0xf79051[_0xcae2('0x3d')],{'$or':_[_0xcae2('0x2b')](_0xf79051['attributes'],function(_0x14fe54){var _0xc39f17={};_0xc39f17[_0x14fe54]={'$like':'%'+_0x32fc28['query']['filter']+'%'};return _0xc39f17;})});}_0xf79051=_['merge']({},_0xf79051,_0x32fc28[_0xcae2('0x42')]);return _0x32fe0b[_0xcae2('0x50')](_0xf79051);}})[_0xcae2('0x24')](function(_0x414d34){if(_0x414d34){_0x26dd82=_0x414d34['length'];if(!_0x32fc28[_0xcae2('0x33')][_0xcae2('0x39')](_0xcae2('0x3a'))){_0xf79051[_0xcae2('0x1f')]=qs[_0xcae2('0x1f')](_0x32fc28[_0xcae2('0x33')][_0xcae2('0x1f')]);_0xf79051[_0xcae2('0x1d')]=qs['offset'](_0x32fc28[_0xcae2('0x33')][_0xcae2('0x1d')]);}return _0x32fe0b['getDescriptions'](_0xf79051);}})['then'](function(_0x481b24){if(_0x481b24){return _0x481b24?{'count':_0x26dd82,'rows':_0x481b24}:null;}})['then'](respondWithResult(_0x8afc46,null))['catch'](handleError(_0x8afc46,null));};exports[_0xcae2('0x51')]=function(_0x432c99,_0x526d37,_0x24c29a){var _0x15403d={};var _0x54f7d7={};var _0x3a43d5;var _0x22d9cd;return db['ZendeskConfiguration'][_0xcae2('0x4e')]({'where':{'id':_0x432c99[_0xcae2('0x4b')]['id']}})[_0xcae2('0x24')](handleEntityNotFound(_0x526d37,null))[_0xcae2('0x24')](function(_0x4963d9){if(_0x4963d9){_0x3a43d5=_0x4963d9;_0x54f7d7[_0xcae2('0x31')]=_['keys'](db[_0xcae2('0x52')][_0xcae2('0x2d')]);_0x54f7d7['query']=_['keys'](_0x432c99[_0xcae2('0x33')]);_0x54f7d7[_0xcae2('0x34')]=_[_0xcae2('0x35')](_0x54f7d7[_0xcae2('0x31')],_0x54f7d7[_0xcae2('0x33')]);_0x15403d[_0xcae2('0x37')]=_[_0xcae2('0x35')](_0x54f7d7[_0xcae2('0x31')],qs[_0xcae2('0x36')](_0x432c99[_0xcae2('0x33')]['fields']));_0x15403d['attributes']=_0x15403d[_0xcae2('0x37')][_0xcae2('0x38')]?_0x15403d[_0xcae2('0x37')]:_0x54f7d7[_0xcae2('0x31')];_0x15403d[_0xcae2('0x3b')]=qs[_0xcae2('0x3c')](_0x432c99[_0xcae2('0x33')][_0xcae2('0x3c')]);_0x15403d[_0xcae2('0x3d')]=qs['filters'](_[_0xcae2('0x3e')](_0x432c99[_0xcae2('0x33')],_0x54f7d7[_0xcae2('0x34')]));if(_0x432c99['query'][_0xcae2('0x3f')]){_0x15403d[_0xcae2('0x3d')]=_[_0xcae2('0x40')](_0x15403d[_0xcae2('0x3d')],{'$or':_['map'](_0x15403d[_0xcae2('0x37')],function(_0x3698c5){var _0x4c0141={};_0x4c0141[_0x3698c5]={'$like':'%'+_0x432c99[_0xcae2('0x33')][_0xcae2('0x3f')]+'%'};return _0x4c0141;})});}_0x15403d=_[_0xcae2('0x40')]({},_0x15403d,_0x432c99[_0xcae2('0x42')]);return _0x3a43d5[_0xcae2('0x51')](_0x15403d);}})['then'](function(_0x2d2356){if(_0x2d2356){_0x22d9cd=_0x2d2356[_0xcae2('0x38')];if(!_0x432c99[_0xcae2('0x33')][_0xcae2('0x39')](_0xcae2('0x3a'))){_0x15403d['limit']=qs[_0xcae2('0x1f')](_0x432c99['query']['limit']);_0x15403d[_0xcae2('0x1d')]=qs[_0xcae2('0x1d')](_0x432c99[_0xcae2('0x33')][_0xcae2('0x1d')]);}return _0x3a43d5['getTags'](_0x15403d);}})['then'](function(_0x2f27ae){if(_0x2f27ae){return _0x2f27ae?{'count':_0x22d9cd,'rows':_0x2f27ae}:null;}})[_0xcae2('0x24')](respondWithResult(_0x526d37,null))['catch'](handleError(_0x526d37,null));};exports[_0xcae2('0x53')]=function(_0xfe636e,_0x45d884,_0x1a4ec3){if(_0xfe636e[_0xcae2('0x4a')]['id']){delete _0xfe636e['body']['id'];}return db[_0xcae2('0x2c')]['findOne']({'where':{'id':_0xfe636e[_0xcae2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45d884,null))[_0xcae2('0x24')](function(_0x17a78f){if(_0x17a78f){return _0x17a78f[_0xcae2('0x53')](_0xfe636e[_0xcae2('0x4a')][_0xcae2('0x54')]||[]);}return null;})[_0xcae2('0x24')](respondWithResult(_0x45d884,null))[_0xcae2('0x46')](handleError(_0x45d884,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 004dd41..9e1f666 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 _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x69d3,0xda));var _0x369d=function(_0x279de0,_0x28b948){_0x279de0=_0x279de0-0x0;var _0x31fe39=_0x69d3[_0x279de0];return _0x31fe39;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe511=['bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','api'];(function(_0x1f4c08,_0x22422b){var _0xbbd65=function(_0x4f79c1){while(--_0x4f79c1){_0x1f4c08['push'](_0x1f4c08['shift']());}};_0xbbd65(++_0x22422b);}(_0xe511,0x16f));var _0x1e51=function(_0x1d7973,_0x357676){_0x1d7973=_0x1d7973-0x0;var _0x43190c=_0xe511[_0x1d7973];return _0x43190c;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index a946b56..0886223 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 _0x5cee=['../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4c2a73,_0x2835cd){var _0x121267=function(_0x30e8ad){while(--_0x30e8ad){_0x4c2a73['push'](_0x4c2a73['shift']());}};_0x121267(++_0x2835cd);}(_0x5cee,0xb8));var _0xe5ce=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x5cee[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require(_0xe5ce('0x0'));var moment=require(_0xe5ce('0x1'));var BPromise=require(_0xe5ce('0x2'));var rs=require(_0xe5ce('0x3'));var fs=require('fs');var Redis=require(_0xe5ce('0x4'));var db=require(_0xe5ce('0x5'))['db'];var utils=require(_0xe5ce('0x6'));var logger=require('../../config/logger')(_0xe5ce('0x7'));var config=require(_0xe5ce('0x8'));var jayson=require(_0xe5ce('0x9'));var client=jayson[_0xe5ce('0xa')][_0xe5ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x385139,_0x28ac8d,_0x43aa7e){return new BPromise(function(_0xee115a,_0x2d44f3){return client[_0xe5ce('0xc')](_0x385139,_0x43aa7e)[_0xe5ce('0xd')](function(_0x230f39){logger[_0xe5ce('0xe')](_0xe5ce('0xf'),_0x28ac8d,_0xe5ce('0x10'));logger[_0xe5ce('0x11')](_0xe5ce('0x12'),_0x28ac8d,_0xe5ce('0x10'),JSON['stringify'](_0x230f39));if(_0x230f39[_0xe5ce('0x13')]){if(_0x230f39[_0xe5ce('0x13')][_0xe5ce('0x14')]===0x1f4){logger[_0xe5ce('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x28ac8d,_0x230f39[_0xe5ce('0x13')][_0xe5ce('0x15')]);return _0x2d44f3(_0x230f39[_0xe5ce('0x13')][_0xe5ce('0x15')]);}logger[_0xe5ce('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x28ac8d,_0x230f39['error'][_0xe5ce('0x15')]);return _0xee115a(_0x230f39['error'][_0xe5ce('0x15')]);}else{logger['info'](_0xe5ce('0xf'),_0x28ac8d,_0xe5ce('0x10'));_0xee115a(_0x230f39[_0xe5ce('0x16')]['message']);}})[_0xe5ce('0x17')](function(_0x2eb379){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x28ac8d,_0x2eb379);_0x2d44f3(_0x2eb379);});});} \ No newline at end of file +var _0x9804=['request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x28fbfc,_0x3257f1){var _0x1e1f04=function(_0x33551d){while(--_0x33551d){_0x28fbfc['push'](_0x28fbfc['shift']());}};_0x1e1f04(++_0x3257f1);}(_0x9804,0x16c));var _0x4980=function(_0x311aad,_0x54d658){_0x311aad=_0x311aad-0x0;var _0x1779bd=_0x9804[_0x311aad];return _0x1779bd;};'use strict';var _=require('lodash');var util=require(_0x4980('0x0'));var moment=require(_0x4980('0x1'));var BPromise=require('bluebird');var rs=require(_0x4980('0x2'));var fs=require('fs');var Redis=require(_0x4980('0x3'));var db=require(_0x4980('0x4'))['db'];var utils=require(_0x4980('0x5'));var logger=require(_0x4980('0x6'))('rpc');var config=require(_0x4980('0x7'));var jayson=require(_0x4980('0x8'));var client=jayson['client'][_0x4980('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25ab26,_0xcfedb7,_0xb7469e){return new BPromise(function(_0x3e19ed,_0x663342){return client[_0x4980('0xa')](_0x25ab26,_0xb7469e)[_0x4980('0xb')](function(_0x110cf6){logger[_0x4980('0xc')](_0x4980('0xd'),_0xcfedb7,_0x4980('0xe'));logger[_0x4980('0xf')](_0x4980('0x10'),_0xcfedb7,_0x4980('0xe'),JSON[_0x4980('0x11')](_0x110cf6));if(_0x110cf6[_0x4980('0x12')]){if(_0x110cf6['error'][_0x4980('0x13')]===0x1f4){logger['error'](_0x4980('0xd'),_0xcfedb7,_0x110cf6['error'][_0x4980('0x14')]);return _0x663342(_0x110cf6['error'][_0x4980('0x14')]);}logger[_0x4980('0x12')](_0x4980('0xd'),_0xcfedb7,_0x110cf6[_0x4980('0x12')][_0x4980('0x14')]);return _0x3e19ed(_0x110cf6['error'][_0x4980('0x14')]);}else{logger[_0x4980('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0xcfedb7,_0x4980('0xe'));_0x3e19ed(_0x110cf6['result'][_0x4980('0x14')]);}})[_0x4980('0x15')](function(_0x567a6e){logger[_0x4980('0x12')](_0x4980('0xd'),_0xcfedb7,_0x567a6e);_0x663342(_0x567a6e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 260c522..077f7d0 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 _0xaf9d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports'];(function(_0x2e3f49,_0x2b7d8b){var _0x440e5a=function(_0x53e7de){while(--_0x53e7de){_0x2e3f49['push'](_0x2e3f49['shift']());}};_0x440e5a(++_0x2b7d8b);}(_0xaf9d,0x19e));var _0xdaf9=function(_0x39e58d,_0x16d631){_0x39e58d=_0x39e58d-0x0;var _0x1d0b26=_0xaf9d[_0x39e58d];return _0x1d0b26;};'use strict';var multer=require(_0xdaf9('0x0'));var util=require(_0xdaf9('0x1'));var path=require('path');var timeout=require(_0xdaf9('0x2'));var express=require(_0xdaf9('0x3'));var router=express[_0xdaf9('0x4')]();var fs_extra=require(_0xdaf9('0x5'));var auth=require(_0xdaf9('0x6'));var interaction=require(_0xdaf9('0x7'));var config=require('../../config/environment');var controller=require(_0xdaf9('0x8'));router[_0xdaf9('0x9')]('/',auth[_0xdaf9('0xa')](),controller['index']);router[_0xdaf9('0x9')](_0xdaf9('0xb'),auth[_0xdaf9('0xa')](),controller['show']);router[_0xdaf9('0xc')]('/',auth[_0xdaf9('0xa')](),controller[_0xdaf9('0xd')]);router[_0xdaf9('0xe')](_0xdaf9('0xb'),auth[_0xdaf9('0xa')](),controller[_0xdaf9('0xf')]);router[_0xdaf9('0x10')](_0xdaf9('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xdaf9('0x11')]=router; \ No newline at end of file +var _0x8114=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x8114,0x19a));var _0x4811=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x8114[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require(_0x4811('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4811('0x1'));var router=express[_0x4811('0x2')]();var fs_extra=require(_0x4811('0x3'));var auth=require(_0x4811('0x4'));var interaction=require(_0x4811('0x5'));var config=require(_0x4811('0x6'));var controller=require(_0x4811('0x7'));router[_0x4811('0x8')]('/',auth[_0x4811('0x9')](),controller[_0x4811('0xa')]);router[_0x4811('0x8')](_0x4811('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4811('0xc')]('/',auth[_0x4811('0x9')](),controller[_0x4811('0xd')]);router[_0x4811('0xe')]('/:id',auth[_0x4811('0x9')](),controller[_0x4811('0xf')]);router[_0x4811('0x10')](_0x4811('0xb'),auth['isAuthenticated'](),controller[_0x4811('0x11')]);module[_0x4811('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 7abb5c8..de096ba 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 _0x42a8=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING'];(function(_0x4c8cc3,_0x3f8595){var _0x2da384=function(_0x177aaa){while(--_0x177aaa){_0x4c8cc3['push'](_0x4c8cc3['shift']());}};_0x2da384(++_0x3f8595);}(_0x42a8,0x1af));var _0x842a=function(_0x5e9383,_0x268888){_0x5e9383=_0x5e9383-0x0;var _0x4e830a=_0x42a8[_0x5e9383];return _0x4e830a;};'use strict';var Sequelize=require(_0x842a('0x0'));module[_0x842a('0x1')]={'type':{'type':Sequelize[_0x842a('0x2')]('string',_0x842a('0x3'),_0x842a('0x4'),_0x842a('0x5'),_0x842a('0x6')),'defaultValue':_0x842a('0x7')},'content':{'type':Sequelize[_0x842a('0x8')]},'key':{'type':Sequelize[_0x842a('0x8')]},'keyType':{'type':Sequelize[_0x842a('0x2')](_0x842a('0x7'),_0x842a('0x3'),_0x842a('0x4'))},'keyContent':{'type':Sequelize[_0x842a('0x8')]},'idField':{'type':Sequelize[_0x842a('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x842a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x842a('0x8')]}}; \ No newline at end of file +var _0x4d20=['variable','string','STRING','customVariable','BOOLEAN','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d20,0x1c5));var _0x04d2=function(_0x41c320,_0x3b92fa){_0x41c320=_0x41c320-0x0;var _0x170c6c=_0x4d20[_0x41c320];return _0x170c6c;};'use strict';var Sequelize=require('sequelize');module[_0x04d2('0x0')]={'type':{'type':Sequelize[_0x04d2('0x1')]('string',_0x04d2('0x2'),'customVariable','keyValue','picklist'),'defaultValue':_0x04d2('0x3')},'content':{'type':Sequelize[_0x04d2('0x4')]},'key':{'type':Sequelize[_0x04d2('0x4')]},'keyType':{'type':Sequelize[_0x04d2('0x1')](_0x04d2('0x3'),'variable',_0x04d2('0x5'))},'keyContent':{'type':Sequelize[_0x04d2('0x4')]},'idField':{'type':Sequelize[_0x04d2('0x4')]},'nameField':{'type':Sequelize[_0x04d2('0x4')]},'customField':{'type':Sequelize[_0x04d2('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x04d2('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index ab54b19..19db402 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 _0xfaba=['intersection','model','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','fields','length','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','query','filters'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xafab('0x0'));var rimraf=require(_0xafab('0x1'));var zipdir=require(_0xafab('0x2'));var jsonpatch=require(_0xafab('0x3'));var rp=require('request-promise');var moment=require(_0xafab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xafab('0x5'));var path=require('path');var sox=require(_0xafab('0x6'));var csv=require('to-csv');var ejs=require(_0xafab('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafab('0x8'));var squel=require(_0xafab('0x9'));var crypto=require('crypto');var jsforce=require(_0xafab('0xa'));var deskjs=require(_0xafab('0xb'));var toCsv=require('to-csv');var querystring=require(_0xafab('0xc'));var Papa=require(_0xafab('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafab('0xe'));var as=require(_0xafab('0xf'));var hardwareService=require(_0xafab('0x10'));var logger=require('../../config/logger')(_0xafab('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xafab('0x12'));var db=require(_0xafab('0x13'))['db'];function respondWithStatusCode(_0x3eb9e7,_0xe437ef){_0xe437ef=_0xe437ef||0xcc;return function(_0x45aa37){if(_0x45aa37){return _0x3eb9e7[_0xafab('0x14')](_0xe437ef);}return _0x3eb9e7[_0xafab('0x15')](_0xe437ef)['end']();};}function respondWithResult(_0x42c4e7,_0x300448){_0x300448=_0x300448||0xc8;return function(_0x5074a7){if(_0x5074a7){return _0x42c4e7[_0xafab('0x15')](_0x300448)[_0xafab('0x16')](_0x5074a7);}};}function respondWithFilteredResult(_0x599f2f,_0x192f1b){return function(_0x307c5e){if(_0x307c5e){var _0x5bb925=typeof _0x192f1b['offset']===_0xafab('0x17')&&typeof _0x192f1b[_0xafab('0x18')]===_0xafab('0x17');var _0x254751=_0x307c5e['count'];var _0x3b8140=_0x5bb925?0x0:_0x192f1b['offset'];var _0x38cd9a=_0x5bb925?_0x307c5e[_0xafab('0x19')]:_0x192f1b[_0xafab('0x1a')]+_0x192f1b['limit'];var _0x139ec7;if(_0x38cd9a>=_0x254751){_0x38cd9a=_0x254751;_0x139ec7=0xc8;}else{_0x139ec7=0xce;}_0x599f2f[_0xafab('0x15')](_0x139ec7);return _0x599f2f[_0xafab('0x1b')](_0xafab('0x1c'),_0x3b8140+'-'+_0x38cd9a+'/'+_0x254751)[_0xafab('0x16')](_0x307c5e);}return null;};}function patchUpdates(_0x599e54){return function(_0x4a52ac){try{jsonpatch[_0xafab('0x1d')](_0x4a52ac,_0x599e54,!![]);}catch(_0x19cfc1){return BPromise[_0xafab('0x1e')](_0x19cfc1);}return _0x4a52ac[_0xafab('0x1f')]();};}function saveUpdates(_0x4e9adb,_0x2ae5df){return function(_0x3106bf){if(_0x3106bf){return _0x3106bf[_0xafab('0x20')](_0x4e9adb)[_0xafab('0x21')](function(_0x50a3e3){return _0x50a3e3;});}return null;};}function removeEntity(_0x4049e1,_0x353a3d){return function(_0x19cf4e){if(_0x19cf4e){return _0x19cf4e['destroy']()['then'](function(){_0x4049e1[_0xafab('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233fdd,_0x95c7a7){return function(_0x3fa273){if(!_0x3fa273){_0x233fdd[_0xafab('0x14')](0x194);}return _0x3fa273;};}function handleError(_0x5b84ab,_0x4e0edd){_0x4e0edd=_0x4e0edd||0x1f4;return function(_0x3c0dbd){logger[_0xafab('0x22')](_0x3c0dbd['stack']);if(_0x3c0dbd['name']){delete _0x3c0dbd[_0xafab('0x23')];}_0x5b84ab[_0xafab('0x15')](_0x4e0edd)[_0xafab('0x24')](_0x3c0dbd);};}exports[_0xafab('0x25')]=function(_0x531b36,_0x47ec50){var _0x3ab4c8={},_0x4554ec={},_0x30ea5e={'count':0x0,'rows':[]};var _0x1908d4=_[_0xafab('0x26')](db[_0xafab('0x27')][_0xafab('0x28')],function(_0x525762){return{'name':_0x525762[_0xafab('0x29')],'type':_0x525762['type'][_0xafab('0x2a')]};});_0x4554ec['model']=_[_0xafab('0x26')](_0x1908d4,_0xafab('0x23'));_0x4554ec[_0xafab('0x2b')]=_['keys'](_0x531b36[_0xafab('0x2b')]);_0x4554ec[_0xafab('0x2c')]=_[_0xafab('0x2d')](_0x4554ec[_0xafab('0x2e')],_0x4554ec[_0xafab('0x2b')]);_0x3ab4c8[_0xafab('0x2f')]=_[_0xafab('0x2d')](_0x4554ec['model'],qs['fields'](_0x531b36['query']['fields']));_0x3ab4c8[_0xafab('0x2f')]=_0x3ab4c8[_0xafab('0x2f')]['length']?_0x3ab4c8[_0xafab('0x2f')]:_0x4554ec[_0xafab('0x2e')];if(!_0x531b36[_0xafab('0x2b')][_0xafab('0x30')](_0xafab('0x31'))){_0x3ab4c8[_0xafab('0x18')]=qs[_0xafab('0x18')](_0x531b36[_0xafab('0x2b')][_0xafab('0x18')]);_0x3ab4c8['offset']=qs['offset'](_0x531b36[_0xafab('0x2b')][_0xafab('0x1a')]);}_0x3ab4c8[_0xafab('0x32')]=qs[_0xafab('0x33')](_0x531b36['query'][_0xafab('0x33')]);_0x3ab4c8['where']=qs[_0xafab('0x2c')](_[_0xafab('0x34')](_0x531b36[_0xafab('0x2b')],_0x4554ec[_0xafab('0x2c')]),_0x1908d4);if(_0x531b36[_0xafab('0x2b')][_0xafab('0x35')]){_0x3ab4c8['where']=_[_0xafab('0x36')](_0x3ab4c8['where'],{'$or':_[_0xafab('0x26')](_0x1908d4,function(_0x51fd4c){if(_0x51fd4c['type']!==_0xafab('0x37')){var _0xf52de={};_0xf52de[_0x51fd4c['name']]={'$like':'%'+_0x531b36[_0xafab('0x2b')][_0xafab('0x35')]+'%'};return _0xf52de;}})});}_0x3ab4c8=_[_0xafab('0x36')]({},_0x3ab4c8,_0x531b36[_0xafab('0x38')]);var _0x1bece9={'where':_0x3ab4c8['where']};return db['ZendeskField'][_0xafab('0x19')](_0x1bece9)[_0xafab('0x21')](function(_0x119aac){_0x30ea5e[_0xafab('0x19')]=_0x119aac;if(_0x531b36[_0xafab('0x2b')]['includeAll']){_0x3ab4c8[_0xafab('0x39')]=[{'all':!![]}];}return db[_0xafab('0x27')][_0xafab('0x3a')](_0x3ab4c8);})[_0xafab('0x21')](function(_0x30dc8c){_0x30ea5e['rows']=_0x30dc8c;return _0x30ea5e;})[_0xafab('0x21')](respondWithFilteredResult(_0x47ec50,_0x3ab4c8))[_0xafab('0x3b')](handleError(_0x47ec50,null));};exports[_0xafab('0x3c')]=function(_0x595a1b,_0x5b09c6){var _0x3f1631={'raw':!![],'where':{'id':_0x595a1b['params']['id']}},_0x57cebb={};_0x57cebb[_0xafab('0x2e')]=_[_0xafab('0x3d')](db[_0xafab('0x27')][_0xafab('0x28')]);_0x57cebb[_0xafab('0x2b')]=_[_0xafab('0x3d')](_0x595a1b[_0xafab('0x2b')]);_0x57cebb[_0xafab('0x2c')]=_[_0xafab('0x2d')](_0x57cebb[_0xafab('0x2e')],_0x57cebb[_0xafab('0x2b')]);_0x3f1631[_0xafab('0x2f')]=_['intersection'](_0x57cebb[_0xafab('0x2e')],qs[_0xafab('0x3e')](_0x595a1b['query'][_0xafab('0x3e')]));_0x3f1631[_0xafab('0x2f')]=_0x3f1631[_0xafab('0x2f')][_0xafab('0x3f')]?_0x3f1631[_0xafab('0x2f')]:_0x57cebb['model'];if(_0x595a1b[_0xafab('0x2b')]['includeAll']){_0x3f1631[_0xafab('0x39')]=[{'all':!![]}];}_0x3f1631=_[_0xafab('0x36')]({},_0x3f1631,_0x595a1b[_0xafab('0x38')]);return db[_0xafab('0x27')][_0xafab('0x40')](_0x3f1631)[_0xafab('0x21')](handleEntityNotFound(_0x5b09c6,null))[_0xafab('0x21')](respondWithResult(_0x5b09c6,null))[_0xafab('0x3b')](handleError(_0x5b09c6,null));};exports[_0xafab('0x41')]=function(_0x1ee8d9,_0x1d518e){return db['ZendeskField'][_0xafab('0x41')](_0x1ee8d9['body'],{})[_0xafab('0x21')](respondWithResult(_0x1d518e,0xc9))[_0xafab('0x3b')](handleError(_0x1d518e,null));};exports['update']=function(_0x47856a,_0x5ae92e){if(_0x47856a[_0xafab('0x42')]['id']){delete _0x47856a['body']['id'];}return db['ZendeskField'][_0xafab('0x40')]({'where':{'id':_0x47856a[_0xafab('0x43')]['id']}})[_0xafab('0x21')](handleEntityNotFound(_0x5ae92e,null))[_0xafab('0x21')](saveUpdates(_0x47856a[_0xafab('0x42')],null))[_0xafab('0x21')](respondWithResult(_0x5ae92e,null))[_0xafab('0x3b')](handleError(_0x5ae92e,null));};exports[_0xafab('0x44')]=function(_0x5d021a,_0x5ea623){return db[_0xafab('0x27')]['find']({'where':{'id':_0x5d021a[_0xafab('0x43')]['id']}})[_0xafab('0x21')](handleEntityNotFound(_0x5ea623,null))[_0xafab('0x21')](removeEntity(_0x5ea623,null))[_0xafab('0x3b')](handleError(_0x5ea623,null));}; \ No newline at end of file +var _0xcb47=['util','path','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','update','then','stack','name','send','index','map','ZendeskField','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','options','include','catch','params','rawAttributes','fields','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcb47,0x1d5));var _0x7cb4=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0xcb47[_0x33c1b1];return _0x2c2037;};'use strict';var emlformat=require(_0x7cb4('0x0'));var rimraf=require(_0x7cb4('0x1'));var zipdir=require(_0x7cb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cb4('0x3'));var moment=require(_0x7cb4('0x4'));var BPromise=require(_0x7cb4('0x5'));var Mustache=require(_0x7cb4('0x6'));var util=require(_0x7cb4('0x7'));var path=require(_0x7cb4('0x8'));var sox=require(_0x7cb4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7cb4('0xa'));var _=require('lodash');var squel=require(_0x7cb4('0xb'));var crypto=require(_0x7cb4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7cb4('0xd'));var toCsv=require(_0x7cb4('0xe'));var querystring=require(_0x7cb4('0xf'));var Papa=require('papaparse');var Redis=require(_0x7cb4('0x10'));var authService=require(_0x7cb4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7cb4('0x12'));var logger=require(_0x7cb4('0x13'))(_0x7cb4('0x14'));var utils=require('../../config/utils');var config=require(_0x7cb4('0x15'));var licenseUtil=require(_0x7cb4('0x16'));var db=require(_0x7cb4('0x17'))['db'];function respondWithStatusCode(_0x4142d2,_0x1d8fc3){_0x1d8fc3=_0x1d8fc3||0xcc;return function(_0x57a226){if(_0x57a226){return _0x4142d2[_0x7cb4('0x18')](_0x1d8fc3);}return _0x4142d2['status'](_0x1d8fc3)[_0x7cb4('0x19')]();};}function respondWithResult(_0x216d04,_0x5d3b67){_0x5d3b67=_0x5d3b67||0xc8;return function(_0x521dbe){if(_0x521dbe){return _0x216d04[_0x7cb4('0x1a')](_0x5d3b67)['json'](_0x521dbe);}};}function respondWithFilteredResult(_0x52f5a5,_0x391d55){return function(_0x35c44d){if(_0x35c44d){var _0x5aa65c=typeof _0x391d55[_0x7cb4('0x1b')]===_0x7cb4('0x1c')&&typeof _0x391d55[_0x7cb4('0x1d')]===_0x7cb4('0x1c');var _0x50d704=_0x35c44d[_0x7cb4('0x1e')];var _0x4c8adf=_0x5aa65c?0x0:_0x391d55[_0x7cb4('0x1b')];var _0x20bdab=_0x5aa65c?_0x35c44d[_0x7cb4('0x1e')]:_0x391d55[_0x7cb4('0x1b')]+_0x391d55[_0x7cb4('0x1d')];var _0x1945c8;if(_0x20bdab>=_0x50d704){_0x20bdab=_0x50d704;_0x1945c8=0xc8;}else{_0x1945c8=0xce;}_0x52f5a5[_0x7cb4('0x1a')](_0x1945c8);return _0x52f5a5['set'](_0x7cb4('0x1f'),_0x4c8adf+'-'+_0x20bdab+'/'+_0x50d704)[_0x7cb4('0x20')](_0x35c44d);}return null;};}function patchUpdates(_0xf4599e){return function(_0xf70b3a){try{jsonpatch['apply'](_0xf70b3a,_0xf4599e,!![]);}catch(_0x3afc29){return BPromise[_0x7cb4('0x21')](_0x3afc29);}return _0xf70b3a['save']();};}function saveUpdates(_0x185aeb,_0x29df47){return function(_0x204cba){if(_0x204cba){return _0x204cba[_0x7cb4('0x22')](_0x185aeb)['then'](function(_0x389e78){return _0x389e78;});}return null;};}function removeEntity(_0x26c134,_0x21b4b2){return function(_0x4d94aa){if(_0x4d94aa){return _0x4d94aa['destroy']()[_0x7cb4('0x23')](function(){_0x26c134[_0x7cb4('0x1a')](0xcc)[_0x7cb4('0x19')]();});}};}function handleEntityNotFound(_0x490b09,_0x1669a1){return function(_0x2fe302){if(!_0x2fe302){_0x490b09['sendStatus'](0x194);}return _0x2fe302;};}function handleError(_0x11b50f,_0x33fc31){_0x33fc31=_0x33fc31||0x1f4;return function(_0xed3a5d){logger['error'](_0xed3a5d[_0x7cb4('0x24')]);if(_0xed3a5d[_0x7cb4('0x25')]){delete _0xed3a5d['name'];}_0x11b50f['status'](_0x33fc31)[_0x7cb4('0x26')](_0xed3a5d);};}exports[_0x7cb4('0x27')]=function(_0x44490e,_0x25ae05){var _0x4ef8d4={},_0x1f8497={},_0x2aa227={'count':0x0,'rows':[]};var _0x387491=_[_0x7cb4('0x28')](db[_0x7cb4('0x29')]['rawAttributes'],function(_0x45bea0){return{'name':_0x45bea0[_0x7cb4('0x2a')],'type':_0x45bea0[_0x7cb4('0x2b')]['key']};});_0x1f8497[_0x7cb4('0x2c')]=_[_0x7cb4('0x28')](_0x387491,'name');_0x1f8497[_0x7cb4('0x2d')]=_[_0x7cb4('0x2e')](_0x44490e[_0x7cb4('0x2d')]);_0x1f8497[_0x7cb4('0x2f')]=_[_0x7cb4('0x30')](_0x1f8497['model'],_0x1f8497[_0x7cb4('0x2d')]);_0x4ef8d4[_0x7cb4('0x31')]=_[_0x7cb4('0x30')](_0x1f8497[_0x7cb4('0x2c')],qs['fields'](_0x44490e['query']['fields']));_0x4ef8d4[_0x7cb4('0x31')]=_0x4ef8d4[_0x7cb4('0x31')][_0x7cb4('0x32')]?_0x4ef8d4['attributes']:_0x1f8497[_0x7cb4('0x2c')];if(!_0x44490e['query'][_0x7cb4('0x33')](_0x7cb4('0x34'))){_0x4ef8d4[_0x7cb4('0x1d')]=qs[_0x7cb4('0x1d')](_0x44490e['query'][_0x7cb4('0x1d')]);_0x4ef8d4[_0x7cb4('0x1b')]=qs[_0x7cb4('0x1b')](_0x44490e[_0x7cb4('0x2d')][_0x7cb4('0x1b')]);}_0x4ef8d4['order']=qs['sort'](_0x44490e[_0x7cb4('0x2d')]['sort']);_0x4ef8d4[_0x7cb4('0x35')]=qs['filters'](_[_0x7cb4('0x36')](_0x44490e[_0x7cb4('0x2d')],_0x1f8497[_0x7cb4('0x2f')]),_0x387491);if(_0x44490e[_0x7cb4('0x2d')]['filter']){_0x4ef8d4[_0x7cb4('0x35')]=_[_0x7cb4('0x37')](_0x4ef8d4[_0x7cb4('0x35')],{'$or':_[_0x7cb4('0x28')](_0x387491,function(_0x3132b8){if(_0x3132b8[_0x7cb4('0x2b')]!==_0x7cb4('0x38')){var _0x29b3a9={};_0x29b3a9[_0x3132b8[_0x7cb4('0x25')]]={'$like':'%'+_0x44490e[_0x7cb4('0x2d')]['filter']+'%'};return _0x29b3a9;}})});}_0x4ef8d4=_[_0x7cb4('0x37')]({},_0x4ef8d4,_0x44490e[_0x7cb4('0x39')]);var _0x28f945={'where':_0x4ef8d4['where']};return db['ZendeskField'][_0x7cb4('0x1e')](_0x28f945)[_0x7cb4('0x23')](function(_0x4ed6a2){_0x2aa227[_0x7cb4('0x1e')]=_0x4ed6a2;if(_0x44490e[_0x7cb4('0x2d')]['includeAll']){_0x4ef8d4[_0x7cb4('0x3a')]=[{'all':!![]}];}return db[_0x7cb4('0x29')]['findAll'](_0x4ef8d4);})[_0x7cb4('0x23')](function(_0x24db05){_0x2aa227['rows']=_0x24db05;return _0x2aa227;})[_0x7cb4('0x23')](respondWithFilteredResult(_0x25ae05,_0x4ef8d4))[_0x7cb4('0x3b')](handleError(_0x25ae05,null));};exports['show']=function(_0x3e068c,_0x485cfc){var _0x587258={'raw':!![],'where':{'id':_0x3e068c[_0x7cb4('0x3c')]['id']}},_0x542761={};_0x542761[_0x7cb4('0x2c')]=_[_0x7cb4('0x2e')](db[_0x7cb4('0x29')][_0x7cb4('0x3d')]);_0x542761[_0x7cb4('0x2d')]=_[_0x7cb4('0x2e')](_0x3e068c[_0x7cb4('0x2d')]);_0x542761[_0x7cb4('0x2f')]=_[_0x7cb4('0x30')](_0x542761[_0x7cb4('0x2c')],_0x542761[_0x7cb4('0x2d')]);_0x587258[_0x7cb4('0x31')]=_[_0x7cb4('0x30')](_0x542761[_0x7cb4('0x2c')],qs['fields'](_0x3e068c[_0x7cb4('0x2d')][_0x7cb4('0x3e')]));_0x587258[_0x7cb4('0x31')]=_0x587258[_0x7cb4('0x31')]['length']?_0x587258['attributes']:_0x542761['model'];if(_0x3e068c[_0x7cb4('0x2d')][_0x7cb4('0x3f')]){_0x587258[_0x7cb4('0x3a')]=[{'all':!![]}];}_0x587258=_[_0x7cb4('0x37')]({},_0x587258,_0x3e068c['options']);return db[_0x7cb4('0x29')][_0x7cb4('0x40')](_0x587258)[_0x7cb4('0x23')](handleEntityNotFound(_0x485cfc,null))[_0x7cb4('0x23')](respondWithResult(_0x485cfc,null))[_0x7cb4('0x3b')](handleError(_0x485cfc,null));};exports[_0x7cb4('0x41')]=function(_0x5da7ba,_0x5263f9){return db[_0x7cb4('0x29')][_0x7cb4('0x41')](_0x5da7ba[_0x7cb4('0x42')],{})[_0x7cb4('0x23')](respondWithResult(_0x5263f9,0xc9))[_0x7cb4('0x3b')](handleError(_0x5263f9,null));};exports[_0x7cb4('0x22')]=function(_0x56d14c,_0x3b093a){if(_0x56d14c[_0x7cb4('0x42')]['id']){delete _0x56d14c['body']['id'];}return db['ZendeskField'][_0x7cb4('0x40')]({'where':{'id':_0x56d14c[_0x7cb4('0x3c')]['id']}})[_0x7cb4('0x23')](handleEntityNotFound(_0x3b093a,null))['then'](saveUpdates(_0x56d14c[_0x7cb4('0x42')],null))[_0x7cb4('0x23')](respondWithResult(_0x3b093a,null))['catch'](handleError(_0x3b093a,null));};exports[_0x7cb4('0x43')]=function(_0x356374,_0x2d2f52){return db['ZendeskField']['find']({'where':{'id':_0x356374[_0x7cb4('0x3c')]['id']}})[_0x7cb4('0x23')](handleEntityNotFound(_0x2d2f52,null))[_0x7cb4('0x23')](removeEntity(_0x2d2f52,null))[_0x7cb4('0x3b')](handleError(_0x2d2f52,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e3a07d1..8d8ff1c 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 _0x660b=['zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','path','rimraf','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields'];(function(_0x36717b,_0x5009e4){var _0x988367=function(_0x22382b){while(--_0x22382b){_0x36717b['push'](_0x36717b['shift']());}};_0x988367(++_0x5009e4);}(_0x660b,0x78));var _0xb660=function(_0x5da09b,_0x218f99){_0x5da09b=_0x5da09b-0x0;var _0x2619e4=_0x660b[_0x5da09b];return _0x2619e4;};'use strict';var _=require(_0xb660('0x0'));var util=require(_0xb660('0x1'));var logger=require(_0xb660('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb660('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb660('0x4'));var rimraf=require(_0xb660('0x5'));var config=require('../../config/environment');var attributes=require(_0xb660('0x6'));module['exports']=function(_0x9abad1,_0x284fb1){return _0x9abad1[_0xb660('0x7')](_0xb660('0x8'),attributes,{'tableName':_0xb660('0x9'),'paranoid':![],'indexes':[{'name':_0xb660('0xa'),'fields':[_0xb660('0xb'),_0xb660('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9545=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9545,0xf7));var _0x5954=function(_0x480afe,_0x175253){_0x480afe=_0x480afe-0x0;var _0x19e5f9=_0x9545[_0x480afe];return _0x19e5f9;};'use strict';var _=require(_0x5954('0x0'));var util=require(_0x5954('0x1'));var logger=require(_0x5954('0x2'))(_0x5954('0x3'));var moment=require('moment');var BPromise=require(_0x5954('0x4'));var rp=require(_0x5954('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5954('0x6'));var config=require('../../config/environment');var attributes=require(_0x5954('0x7'));module[_0x5954('0x8')]=function(_0xb4e7b0,_0x133f0b){return _0xb4e7b0[_0x5954('0x9')](_0x5954('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x5954('0xb'),'fields':[_0x5954('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 612bf52..18c26db 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 _0xaf3a=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskField,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0xd10b43,_0x440ec1){var _0x369090=function(_0x5ae495){while(--_0x5ae495){_0xd10b43['push'](_0xd10b43['shift']());}};_0x369090(++_0x440ec1);}(_0xaf3a,0x98));var _0xaaf3=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0xaf3a[_0x3a7634];return _0x23bbe9;};'use strict';var _=require('lodash');var util=require(_0xaaf3('0x0'));var moment=require(_0xaaf3('0x1'));var BPromise=require(_0xaaf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaf3('0x3'));var db=require(_0xaaf3('0x4'))['db'];var utils=require(_0xaaf3('0x5'));var logger=require(_0xaaf3('0x6'))('rpc');var config=require(_0xaaf3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaaf3('0x8')][_0xaaf3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34af3a,_0xc227e,_0x368d72){return new BPromise(function(_0x1ffe75,_0x5c4e5a){return client[_0xaaf3('0xa')](_0x34af3a,_0x368d72)[_0xaaf3('0xb')](function(_0x226b54){logger[_0xaaf3('0xc')]('ZendeskField,\x20%s,\x20%s',_0xc227e,_0xaaf3('0xd'));logger[_0xaaf3('0xe')](_0xaaf3('0xf'),_0xc227e,'request\x20sent',JSON[_0xaaf3('0x10')](_0x226b54));if(_0x226b54['error']){if(_0x226b54[_0xaaf3('0x11')]['code']===0x1f4){logger['error'](_0xaaf3('0x12'),_0xc227e,_0x226b54[_0xaaf3('0x11')]['message']);return _0x5c4e5a(_0x226b54[_0xaaf3('0x11')]['message']);}logger[_0xaaf3('0x11')](_0xaaf3('0x12'),_0xc227e,_0x226b54['error'][_0xaaf3('0x13')]);return _0x1ffe75(_0x226b54[_0xaaf3('0x11')]['message']);}else{logger[_0xaaf3('0xc')](_0xaaf3('0x12'),_0xc227e,_0xaaf3('0xd'));_0x1ffe75(_0x226b54[_0xaaf3('0x14')][_0xaaf3('0x13')]);}})[_0xaaf3('0x15')](function(_0x540500){logger[_0xaaf3('0x11')](_0xaaf3('0x12'),_0xc227e,_0x540500);_0x5c4e5a(_0x540500);});});} \ No newline at end of file +var _0x7fde=['jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a04c7,_0x65e356){var _0x127b4d=function(_0x226052){while(--_0x226052){_0x5a04c7['push'](_0x5a04c7['shift']());}};_0x127b4d(++_0x65e356);}(_0x7fde,0xde));var _0xe7fd=function(_0x13bb7b,_0x1dbb27){_0x13bb7b=_0x13bb7b-0x0;var _0x4080bb=_0x7fde[_0x13bb7b];return _0x4080bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fd('0x0'));var BPromise=require(_0xe7fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7fd('0x2'));var db=require(_0xe7fd('0x3'))['db'];var utils=require(_0xe7fd('0x4'));var logger=require(_0xe7fd('0x5'))(_0xe7fd('0x6'));var config=require(_0xe7fd('0x7'));var jayson=require(_0xe7fd('0x8'));var client=jayson['client'][_0xe7fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f5341,_0x49a03b,_0x1798ce){return new BPromise(function(_0x3926d,_0x15ef89){return client[_0xe7fd('0xa')](_0x3f5341,_0x1798ce)[_0xe7fd('0xb')](function(_0x3f233a){logger[_0xe7fd('0xc')](_0xe7fd('0xd'),_0x49a03b,_0xe7fd('0xe'));logger[_0xe7fd('0xf')](_0xe7fd('0x10'),_0x49a03b,_0xe7fd('0xe'),JSON[_0xe7fd('0x11')](_0x3f233a));if(_0x3f233a[_0xe7fd('0x12')]){if(_0x3f233a['error'][_0xe7fd('0x13')]===0x1f4){logger[_0xe7fd('0x12')](_0xe7fd('0xd'),_0x49a03b,_0x3f233a['error']['message']);return _0x15ef89(_0x3f233a[_0xe7fd('0x12')]['message']);}logger[_0xe7fd('0x12')](_0xe7fd('0xd'),_0x49a03b,_0x3f233a[_0xe7fd('0x12')]['message']);return _0x3926d(_0x3f233a['error'][_0xe7fd('0x14')]);}else{logger[_0xe7fd('0xc')](_0xe7fd('0xd'),_0x49a03b,_0xe7fd('0xe'));_0x3926d(_0x3f233a[_0xe7fd('0x15')][_0xe7fd('0x14')]);}})[_0xe7fd('0x16')](function(_0xec218e){logger['error']('ZendeskField,\x20%s,\x20%s',_0x49a03b,_0xec218e);_0x15ef89(_0xec218e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 32df55b..fd79f94 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 _0xa876=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x54c034,_0x39ae1b){var _0x3ebd1b=function(_0x17e426){while(--_0x17e426){_0x54c034['push'](_0x54c034['shift']());}};_0x3ebd1b(++_0x39ae1b);}(_0xa876,0x169));var _0x6a87=function(_0x54e637,_0x240639){_0x54e637=_0x54e637-0x0;var _0x55be64=_0xa876[_0x54e637];return _0x55be64;};'use strict';var multer=require(_0x6a87('0x0'));var util=require(_0x6a87('0x1'));var path=require('path');var timeout=require(_0x6a87('0x2'));var express=require(_0x6a87('0x3'));var router=express[_0x6a87('0x4')]();var fs_extra=require(_0x6a87('0x5'));var auth=require(_0x6a87('0x6'));var interaction=require(_0x6a87('0x7'));var config=require(_0x6a87('0x8'));var controller=require(_0x6a87('0x9'));router[_0x6a87('0xa')]('/',auth[_0x6a87('0xb')](),controller[_0x6a87('0xc')]);router[_0x6a87('0xa')](_0x6a87('0xd'),auth[_0x6a87('0xb')](),controller[_0x6a87('0xe')]);router[_0x6a87('0xa')]('/:id/configurations',auth[_0x6a87('0xb')](),controller[_0x6a87('0xf')]);router[_0x6a87('0xa')](_0x6a87('0x10'),auth[_0x6a87('0xb')](),controller[_0x6a87('0x11')]);router[_0x6a87('0x12')]('/',auth['isAuthenticated'](),controller[_0x6a87('0x13')]);router[_0x6a87('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6a87('0x14')]);router[_0x6a87('0x15')]('/:id',auth[_0x6a87('0xb')](),controller[_0x6a87('0x16')]);router[_0x6a87('0x17')](_0x6a87('0xd'),auth['isAuthenticated'](),controller[_0x6a87('0x18')]);module[_0x6a87('0x19')]=router; \ No newline at end of file +var _0xc1c2=['isAuthenticated','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0xc1c2,0x17c));var _0x2c1c=function(_0x4fea71,_0x2376a8){_0x4fea71=_0x4fea71-0x0;var _0x2464ad=_0xc1c2[_0x4fea71];return _0x2464ad;};'use strict';var multer=require(_0x2c1c('0x0'));var util=require(_0x2c1c('0x1'));var path=require(_0x2c1c('0x2'));var timeout=require(_0x2c1c('0x3'));var express=require(_0x2c1c('0x4'));var router=express[_0x2c1c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2c1c('0x6'));var interaction=require(_0x2c1c('0x7'));var config=require(_0x2c1c('0x8'));var controller=require(_0x2c1c('0x9'));router[_0x2c1c('0xa')]('/',auth[_0x2c1c('0xb')](),controller['index']);router['get'](_0x2c1c('0xc'),auth[_0x2c1c('0xb')](),controller[_0x2c1c('0xd')]);router[_0x2c1c('0xa')](_0x2c1c('0xe'),auth[_0x2c1c('0xb')](),controller['getConfigurations']);router[_0x2c1c('0xa')]('/:id/fields',auth[_0x2c1c('0xb')](),controller[_0x2c1c('0xf')]);router[_0x2c1c('0x10')]('/',auth[_0x2c1c('0xb')](),controller[_0x2c1c('0x11')]);router[_0x2c1c('0x10')](_0x2c1c('0xe'),auth['isAuthenticated'](),controller[_0x2c1c('0x12')]);router[_0x2c1c('0x13')]('/:id',auth[_0x2c1c('0xb')](),controller[_0x2c1c('0x14')]);router['delete'](_0x2c1c('0xc'),auth[_0x2c1c('0xb')](),controller[_0x2c1c('0x15')]);module[_0x2c1c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 4d4a0d5..e8b1fc5 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 _0x41bb=['exports','STRING','sequelize'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x41bb,0xc5));var _0xb41b=function(_0x471a52,_0x30b98b){_0x471a52=_0x471a52-0x0;var _0x47e617=_0x41bb[_0x471a52];return _0x47e617;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file +var _0xedd9=['exports','STRING'];(function(_0x496166,_0x1842af){var _0x3d1d15=function(_0x17a0e0){while(--_0x17a0e0){_0x496166['push'](_0x496166['shift']());}};_0x3d1d15(++_0x1842af);}(_0xedd9,0xfc));var _0x9edd=function(_0x31aa00,_0xeeb655){_0x31aa00=_0x31aa00-0x0;var _0x7b9106=_0xedd9[_0x31aa00];return _0x7b9106;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')]},'description':{'type':Sequelize[_0x9edd('0x1')]},'host':{'type':Sequelize[_0x9edd('0x1')]},'zone':{'type':Sequelize[_0x9edd('0x1')]},'clientId':{'type':Sequelize[_0x9edd('0x1')]},'clientSecret':{'type':Sequelize[_0x9edd('0x1')]},'serverUrl':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x9edd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 638a880..86c6b30 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 _0xecc7=['lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','map','query','attributes','model','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','catch','show','params','keys','intersection','length','include','find','create','body','getConfigurations','ZohoConfiguration','pick','findOne','AccountId','channel','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','slice','substring','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','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0x37d724,_0x5d82c9){var _0x4be297=function(_0x11fa7b){while(--_0x11fa7b){_0x37d724['push'](_0x37d724['shift']());}};_0x4be297(++_0x5d82c9);}(_0xecc7,0x167));var _0x7ecc=function(_0x557acb,_0x2505a6){_0x557acb=_0x557acb-0x0;var _0x2c572b=_0xecc7[_0x557acb];return _0x2c572b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7ecc('0x0'));var jsonpatch=require(_0x7ecc('0x1'));var rp=require(_0x7ecc('0x2'));var moment=require(_0x7ecc('0x3'));var BPromise=require(_0x7ecc('0x4'));var Mustache=require('mustache');var util=require(_0x7ecc('0x5'));var path=require(_0x7ecc('0x6'));var sox=require('sox');var csv=require(_0x7ecc('0x7'));var ejs=require(_0x7ecc('0x8'));var fs=require('fs');var fs_extra=require(_0x7ecc('0x9'));var _=require(_0x7ecc('0xa'));var squel=require('squel');var crypto=require(_0x7ecc('0xb'));var jsforce=require(_0x7ecc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7ecc('0x7'));var querystring=require('querystring');var Papa=require(_0x7ecc('0xd'));var Redis=require(_0x7ecc('0xe'));var authService=require(_0x7ecc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7ecc('0x10'));var hardwareService=require(_0x7ecc('0x11'));var logger=require(_0x7ecc('0x12'))('api');var utils=require(_0x7ecc('0x13'));var config=require(_0x7ecc('0x14'));var licenseUtil=require(_0x7ecc('0x15'));var db=require(_0x7ecc('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2cacc7,_0x111b0e){_0x111b0e=_0x111b0e||0xcc;return function(_0x3e30b2){if(_0x3e30b2){return _0x2cacc7[_0x7ecc('0x17')](_0x111b0e);}return _0x2cacc7[_0x7ecc('0x18')](_0x111b0e)[_0x7ecc('0x19')]();};}function respondWithResult(_0x2c1904,_0x51327b){_0x51327b=_0x51327b||0xc8;return function(_0x31e7f0){if(_0x31e7f0){return _0x2c1904['status'](_0x51327b)['json'](_0x31e7f0);}};}function respondWithFilteredResult(_0x2727f6,_0x33c8f6){return function(_0x501329){if(_0x501329){var _0x32f012=typeof _0x33c8f6[_0x7ecc('0x1a')]===_0x7ecc('0x1b')&&typeof _0x33c8f6[_0x7ecc('0x1c')]===_0x7ecc('0x1b');var _0xb722e8=_0x501329['count'];var _0x378882=_0x32f012?0x0:_0x33c8f6['offset'];var _0x5b07f0=_0x32f012?_0x501329['count']:_0x33c8f6[_0x7ecc('0x1a')]+_0x33c8f6[_0x7ecc('0x1c')];var _0x17bb8a;if(_0x5b07f0>=_0xb722e8){_0x5b07f0=_0xb722e8;_0x17bb8a=0xc8;}else{_0x17bb8a=0xce;}_0x2727f6['status'](_0x17bb8a);return _0x2727f6[_0x7ecc('0x1d')](_0x7ecc('0x1e'),_0x378882+'-'+_0x5b07f0+'/'+_0xb722e8)[_0x7ecc('0x1f')](_0x501329);}return null;};}function patchUpdates(_0x3b752d){return function(_0x4656f7){try{jsonpatch[_0x7ecc('0x20')](_0x4656f7,_0x3b752d,!![]);}catch(_0x100b2a){return BPromise[_0x7ecc('0x21')](_0x100b2a);}return _0x4656f7['save']();};}function saveUpdates(_0x3abb37,_0x4ac3ed){return function(_0x5eca11){if(_0x5eca11){return _0x5eca11[_0x7ecc('0x22')](_0x3abb37)[_0x7ecc('0x23')](function(_0x3d602e){return _0x3d602e;});}return null;};}function removeEntity(_0x574d69,_0x25a5ef){return function(_0x1efce6){if(_0x1efce6){return _0x1efce6[_0x7ecc('0x24')]()[_0x7ecc('0x23')](function(){_0x574d69[_0x7ecc('0x18')](0xcc)[_0x7ecc('0x19')]();});}};}function handleEntityNotFound(_0x2e2208,_0x191d6c){return function(_0x477a7c){if(!_0x477a7c){_0x2e2208[_0x7ecc('0x17')](0x194);}return _0x477a7c;};}function handleError(_0x465b85,_0x5139b0){_0x5139b0=_0x5139b0||0x1f4;return function(_0x1f0a55){logger['error'](_0x1f0a55['stack']);if(_0x1f0a55[_0x7ecc('0x25')]){delete _0x1f0a55[_0x7ecc('0x25')];}_0x465b85[_0x7ecc('0x18')](_0x5139b0)[_0x7ecc('0x26')](_0x1f0a55);};}exports[_0x7ecc('0x27')]=function(_0x329275,_0x3f7e1c){var _0x3d760f={},_0x5e9f3e={},_0x24602b={'count':0x0,'rows':[]};var _0x307e62=_['map'](db[_0x7ecc('0x28')][_0x7ecc('0x29')],function(_0x395b05){return{'name':_0x395b05[_0x7ecc('0x2a')],'type':_0x395b05[_0x7ecc('0x2b')][_0x7ecc('0x2c')]};});_0x5e9f3e['model']=_[_0x7ecc('0x2d')](_0x307e62,_0x7ecc('0x25'));_0x5e9f3e['query']=_['keys'](_0x329275['query']);_0x5e9f3e['filters']=_['intersection'](_0x5e9f3e['model'],_0x5e9f3e[_0x7ecc('0x2e')]);_0x3d760f[_0x7ecc('0x2f')]=_['intersection'](_0x5e9f3e[_0x7ecc('0x30')],qs[_0x7ecc('0x31')](_0x329275['query']['fields']));_0x3d760f[_0x7ecc('0x2f')]=_0x3d760f[_0x7ecc('0x2f')]['length']?_0x3d760f[_0x7ecc('0x2f')]:_0x5e9f3e['model'];if(!_0x329275[_0x7ecc('0x2e')]['hasOwnProperty'](_0x7ecc('0x32'))){_0x3d760f[_0x7ecc('0x1c')]=qs[_0x7ecc('0x1c')](_0x329275['query']['limit']);_0x3d760f['offset']=qs[_0x7ecc('0x1a')](_0x329275[_0x7ecc('0x2e')][_0x7ecc('0x1a')]);}_0x3d760f[_0x7ecc('0x33')]=qs[_0x7ecc('0x34')](_0x329275[_0x7ecc('0x2e')][_0x7ecc('0x34')]);_0x3d760f[_0x7ecc('0x35')]=qs[_0x7ecc('0x36')](_['pick'](_0x329275[_0x7ecc('0x2e')],_0x5e9f3e[_0x7ecc('0x36')]),_0x307e62);if(_0x329275[_0x7ecc('0x2e')]['filter']){_0x3d760f[_0x7ecc('0x35')]=_[_0x7ecc('0x37')](_0x3d760f[_0x7ecc('0x35')],{'$or':_['map'](_0x307e62,function(_0x255206){if(_0x255206[_0x7ecc('0x2b')]!==_0x7ecc('0x38')){var _0x3a38f1={};_0x3a38f1[_0x255206[_0x7ecc('0x25')]]={'$like':'%'+_0x329275['query'][_0x7ecc('0x39')]+'%'};return _0x3a38f1;}})});}_0x3d760f=_['merge']({},_0x3d760f,_0x329275[_0x7ecc('0x3a')]);var _0x318201={'where':_0x3d760f[_0x7ecc('0x35')]};return db[_0x7ecc('0x28')][_0x7ecc('0x3b')](_0x318201)[_0x7ecc('0x23')](function(_0x2972a7){_0x24602b['count']=_0x2972a7;if(_0x329275[_0x7ecc('0x2e')][_0x7ecc('0x3c')]){_0x3d760f['include']=[{'all':!![]}];}return db[_0x7ecc('0x28')][_0x7ecc('0x3d')](_0x3d760f);})[_0x7ecc('0x23')](function(_0x16c680){_0x24602b[_0x7ecc('0x3e')]=_0x16c680;return _0x24602b;})[_0x7ecc('0x23')](respondWithFilteredResult(_0x3f7e1c,_0x3d760f))[_0x7ecc('0x3f')](handleError(_0x3f7e1c,null));};exports[_0x7ecc('0x40')]=function(_0x2fa598,_0x5b3ba3){var _0x198380={'raw':![],'where':{'id':_0x2fa598[_0x7ecc('0x41')]['id']}},_0x568cc0={};_0x568cc0[_0x7ecc('0x30')]=_[_0x7ecc('0x42')](db[_0x7ecc('0x28')][_0x7ecc('0x29')]);_0x568cc0[_0x7ecc('0x2e')]=_[_0x7ecc('0x42')](_0x2fa598[_0x7ecc('0x2e')]);_0x568cc0[_0x7ecc('0x36')]=_[_0x7ecc('0x43')](_0x568cc0[_0x7ecc('0x30')],_0x568cc0[_0x7ecc('0x2e')]);_0x198380[_0x7ecc('0x2f')]=_[_0x7ecc('0x43')](_0x568cc0[_0x7ecc('0x30')],qs[_0x7ecc('0x31')](_0x2fa598[_0x7ecc('0x2e')]['fields']));_0x198380[_0x7ecc('0x2f')]=_0x198380[_0x7ecc('0x2f')][_0x7ecc('0x44')]?_0x198380[_0x7ecc('0x2f')]:_0x568cc0[_0x7ecc('0x30')];if(_0x2fa598[_0x7ecc('0x2e')]['includeAll']){_0x198380[_0x7ecc('0x45')]=[{'all':!![]}];}_0x198380=_['merge']({},_0x198380,_0x2fa598['options']);return db['ZohoAccount'][_0x7ecc('0x46')](_0x198380)[_0x7ecc('0x23')](handleEntityNotFound(_0x5b3ba3,null))[_0x7ecc('0x23')](respondWithResult(_0x5b3ba3,null))['catch'](handleError(_0x5b3ba3,null));};exports[_0x7ecc('0x47')]=function(_0x36f966,_0x20a514){return db[_0x7ecc('0x28')][_0x7ecc('0x47')](_0x36f966['body'],{})[_0x7ecc('0x23')](respondWithResult(_0x20a514,0xc9))['catch'](handleError(_0x20a514,null));};exports['update']=function(_0x3ebc44,_0x2945a3){if(_0x3ebc44['body']['id']){delete _0x3ebc44[_0x7ecc('0x48')]['id'];}return db[_0x7ecc('0x28')]['find']({'where':{'id':_0x3ebc44[_0x7ecc('0x41')]['id']}})[_0x7ecc('0x23')](handleEntityNotFound(_0x2945a3,null))[_0x7ecc('0x23')](saveUpdates(_0x3ebc44['body'],null))['then'](respondWithResult(_0x2945a3,null))['catch'](handleError(_0x2945a3,null));};exports[_0x7ecc('0x24')]=function(_0x4ff16b,_0xc1549){return db[_0x7ecc('0x28')][_0x7ecc('0x46')]({'where':{'id':_0x4ff16b['params']['id']}})[_0x7ecc('0x23')](handleEntityNotFound(_0xc1549,null))[_0x7ecc('0x23')](removeEntity(_0xc1549,null))[_0x7ecc('0x3f')](handleError(_0xc1549,null));};exports[_0x7ecc('0x49')]=function(_0x1cd4a9,_0x592551,_0x3d3665){var _0x288adf={};var _0x50b584={};var _0x1a9795;var _0x59afe4;return db[_0x7ecc('0x28')]['findOne']({'where':{'id':_0x1cd4a9['params']['id']}})[_0x7ecc('0x23')](handleEntityNotFound(_0x592551,null))['then'](function(_0x4e4849){if(_0x4e4849){_0x1a9795=_0x4e4849;_0x50b584[_0x7ecc('0x30')]=_[_0x7ecc('0x42')](db[_0x7ecc('0x4a')][_0x7ecc('0x29')]);_0x50b584[_0x7ecc('0x2e')]=_['keys'](_0x1cd4a9['query']);_0x50b584[_0x7ecc('0x36')]=_['intersection'](_0x50b584[_0x7ecc('0x30')],_0x50b584[_0x7ecc('0x2e')]);_0x288adf[_0x7ecc('0x2f')]=_[_0x7ecc('0x43')](_0x50b584[_0x7ecc('0x30')],qs[_0x7ecc('0x31')](_0x1cd4a9['query']['fields']));_0x288adf['attributes']=_0x288adf['attributes']['length']?_0x288adf['attributes']:_0x50b584[_0x7ecc('0x30')];_0x288adf[_0x7ecc('0x33')]=qs['sort'](_0x1cd4a9['query'][_0x7ecc('0x34')]);_0x288adf['where']=qs[_0x7ecc('0x36')](_[_0x7ecc('0x4b')](_0x1cd4a9[_0x7ecc('0x2e')],_0x50b584[_0x7ecc('0x36')]));if(_0x1cd4a9['query'][_0x7ecc('0x39')]){_0x288adf[_0x7ecc('0x35')]=_['merge'](_0x288adf[_0x7ecc('0x35')],{'$or':_[_0x7ecc('0x2d')](_0x288adf[_0x7ecc('0x2f')],function(_0x4de084){var _0x49293b={};_0x49293b[_0x4de084]={'$like':'%'+_0x1cd4a9[_0x7ecc('0x2e')][_0x7ecc('0x39')]+'%'};return _0x49293b;})});}_0x288adf=_[_0x7ecc('0x37')]({},_0x288adf,_0x1cd4a9[_0x7ecc('0x3a')]);return _0x1a9795[_0x7ecc('0x49')](_0x288adf);}})[_0x7ecc('0x23')](function(_0x5617ad){if(_0x5617ad){_0x59afe4=_0x5617ad[_0x7ecc('0x44')];if(!_0x1cd4a9['query']['hasOwnProperty'](_0x7ecc('0x32'))){_0x288adf['limit']=qs[_0x7ecc('0x1c')](_0x1cd4a9[_0x7ecc('0x2e')][_0x7ecc('0x1c')]);_0x288adf['offset']=qs[_0x7ecc('0x1a')](_0x1cd4a9[_0x7ecc('0x2e')][_0x7ecc('0x1a')]);}return _0x1a9795['getConfigurations'](_0x288adf);}})[_0x7ecc('0x23')](function(_0xfdc8cd){if(_0xfdc8cd){return _0xfdc8cd?{'count':_0x59afe4,'rows':_0xfdc8cd}:null;}})['then'](respondWithResult(_0x592551,null))['catch'](handleError(_0x592551,null));};exports['addConfiguration']=function(_0x25e0fe,_0x405221,_0x356b0b){if(_0x25e0fe['body']['id']){delete _0x25e0fe[_0x7ecc('0x48')]['id'];}return db[_0x7ecc('0x28')][_0x7ecc('0x4c')]({'where':{'id':_0x25e0fe[_0x7ecc('0x41')]['id']}})['then'](handleEntityNotFound(_0x405221,null))[_0x7ecc('0x23')](function(_0x271563){if(_0x271563){_0x25e0fe[_0x7ecc('0x48')][_0x7ecc('0x4d')]=_0x271563['id'];_0x25e0fe[_0x7ecc('0x48')]['Subjects']=integrations['getSubjects'](_0x25e0fe[_0x7ecc('0x48')][_0x7ecc('0x4e')],_0x25e0fe['body'][_0x7ecc('0x2b')]);_0x25e0fe[_0x7ecc('0x48')]['Descriptions']=integrations[_0x7ecc('0x4f')](_0x25e0fe['body'][_0x7ecc('0x4e')],_0x25e0fe['body'][_0x7ecc('0x2b')]);return db[_0x7ecc('0x4a')][_0x7ecc('0x47')](_0x25e0fe[_0x7ecc('0x48')],{'include':[{'model':db[_0x7ecc('0x50')],'as':_0x7ecc('0x51')},{'model':db[_0x7ecc('0x50')],'as':'Descriptions'}]});}return null;})[_0x7ecc('0x23')](respondWithResult(_0x405221,null))[_0x7ecc('0x3f')](handleError(_0x405221,null));};function getAccessToken(_0x141825){return new Promise(function(_0x5fe97e,_0x5b1c10){var _0x5de274;switch(_0x141825[_0x7ecc('0x52')]){case'US':_0x5de274='https://accounts.zoho.com';break;case'AU':_0x5de274=_0x7ecc('0x53');break;case'EU':_0x5de274=_0x7ecc('0x54');break;case'IN':_0x5de274=_0x7ecc('0x55');break;case'CN':_0x5de274=_0x7ecc('0x56');break;default:_0x5de274=_0x7ecc('0x54');break;}var _0x13bb59={'method':'POST','uri':_0x5de274+_0x7ecc('0x57'),'qs':{'refresh_token':_0x141825[_0x7ecc('0x58')],'client_id':_0x141825[_0x7ecc('0x59')],'client_secret':_0x141825[_0x7ecc('0x5a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x13bb59)[_0x7ecc('0x23')](function(_0x20d731){if(_0x20d731[_0x7ecc('0x5b')]){_0x5fe97e(_0x20d731[_0x7ecc('0x5b')]);}else{_0x5b1c10(_0x7ecc('0x5c'));}})['catch'](function(_0x528e18){_0x5b1c10(_0x528e18);});});}exports[_0x7ecc('0x5d')]=function(_0x191efd,_0x4fe744,_0x269187){var _0x1faa36,_0x4b7143,_0x2c28dd,_0x3a83fe,_0x25b39b;return db[_0x7ecc('0x28')]['findOne']({'where':{'id':_0x191efd[_0x7ecc('0x41')]['id']},'attributes':['id',_0x7ecc('0x5e'),_0x7ecc('0x52'),_0x7ecc('0x59'),_0x7ecc('0x5a'),_0x7ecc('0x5f'),_0x7ecc('0x60'),'refreshToken']})[_0x7ecc('0x23')](handleEntityNotFound(_0x4fe744,null))['then'](function(_0x186a74){_0x25b39b=_0x186a74;_0x1faa36=_0x25b39b['host'];_0x4b7143=_0x1faa36===_0x7ecc('0x61')?'eu':'com';_0x2c28dd=_0x25b39b[_0x7ecc('0x5f')];var _0x1925c4=_0x2c28dd[_0x7ecc('0x62')](-0x1);if(_0x1925c4==='/'||_0x1925c4==='\x5c'||_0x1925c4===':'){_0x2c28dd=_0x2c28dd[_0x7ecc('0x63')](0x0,_0x2c28dd['lastIndexOf'](_0x1925c4));}if(!_0x25b39b[_0x7ecc('0x58')]){throw new Error(_0x7ecc('0x64'));}return getAccessToken(_0x25b39b);})[_0x7ecc('0x23')](function(_0x2ffda2){if(_0x2ffda2){return rp({'method':_0x7ecc('0x65'),'uri':util[_0x7ecc('0x66')](_0x7ecc('0x67'),_0x4b7143),'qs':{'module':'Calls'},'headers':{'Authorization':_0x7ecc('0x68')+_0x2ffda2},'json':!![]});}})[_0x7ecc('0x23')](function(_0x6e3851){if(_0x6e3851){if(_0x6e3851[_0x7ecc('0x69')]&&_0x6e3851[_0x7ecc('0x69')]['error']){throw new Error(_0x6e3851[_0x7ecc('0x69')][_0x7ecc('0x6a')][_0x7ecc('0x6b')]);}var _0x108adf=[];var _0x19bb86=[];var _0x245fb3=[_0x7ecc('0x6c'),'Subject','Description',_0x7ecc('0x6d'),_0x7ecc('0x6e'),_0x7ecc('0x6f'),_0x7ecc('0x70'),'Call_Type'];_0x19bb86=_['remove'](_0x6e3851[_0x7ecc('0x31')],function(_0x543c84){return _0x245fb3[_0x7ecc('0x71')](_0x543c84[_0x7ecc('0x72')]);});for(var _0x1540b7=0x0;_0x1540b7<_0x19bb86[_0x7ecc('0x44')];_0x1540b7++){if(_0x19bb86[_0x1540b7][_0x7ecc('0x73')]===![]){_0x108adf[_0x7ecc('0x74')]({'id':_0x19bb86[_0x1540b7]['id'],'name':_0x19bb86[_0x1540b7][_0x7ecc('0x75')],'custom':_0x19bb86[_0x1540b7][_0x7ecc('0x76')],'options':_0x19bb86[_0x1540b7][_0x7ecc('0x77')]===_0x7ecc('0x78')&&_0x19bb86[_0x1540b7][_0x7ecc('0x79')][_0x7ecc('0x44')]>-0x1?_[_0x7ecc('0x2d')](_0x19bb86[_0x1540b7]['pick_list_values'],function(_0x3cdbb8){return{'name':_0x3cdbb8,'value':_0x3cdbb8};}):[]});}}return{'count':_0x108adf['length'],'rows':_0x108adf};}else{return{'count':0x0,'rows':[]};}})[_0x7ecc('0x23')](respondWithResult(_0x4fe744,null))['catch'](function(_0x1a99eb){var _0x223fac=_0x191efd['query']['test']?0x1f4:_0x1a99eb[_0x7ecc('0x7a')]||0x1f4;logger[_0x7ecc('0x6a')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x223fac,JSON['stringify'](_0x1a99eb));delete _0x1a99eb[_0x7ecc('0x25')];if(_0x223fac===0x191){_0x223fac=0x190;}_0x4fe744[_0x7ecc('0x18')](_0x223fac)[_0x7ecc('0x26')](_0x191efd['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x1a99eb[_0x7ecc('0x7a')]}:_0x1a99eb);});}; \ No newline at end of file +var _0xcfbf=['then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','ZohoAccount','includeAll','include','findAll','catch','params','keys','find','create','update','body','getConfigurations','findOne','ZohoConfiguration','nolimit','AccountId','Descriptions','channel','ZohoField','Subjects','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save'];(function(_0x14d88d,_0x37d8c8){var _0x7f638a=function(_0x377c59){while(--_0x377c59){_0x14d88d['push'](_0x14d88d['shift']());}};_0x7f638a(++_0x37d8c8);}(_0xcfbf,0x1e7));var _0xfcfb=function(_0x446bd8,_0x241478){_0x446bd8=_0x446bd8-0x0;var _0x591c7=_0xcfbf[_0x446bd8];return _0x591c7;};'use strict';var emlformat=require(_0xfcfb('0x0'));var rimraf=require(_0xfcfb('0x1'));var zipdir=require(_0xfcfb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcfb('0x3'));var moment=require('moment');var BPromise=require(_0xfcfb('0x4'));var Mustache=require('mustache');var util=require(_0xfcfb('0x5'));var path=require(_0xfcfb('0x6'));var sox=require(_0xfcfb('0x7'));var csv=require(_0xfcfb('0x8'));var ejs=require(_0xfcfb('0x9'));var fs=require('fs');var fs_extra=require(_0xfcfb('0xa'));var _=require(_0xfcfb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfcfb('0xc'));var deskjs=require(_0xfcfb('0xd'));var toCsv=require(_0xfcfb('0x8'));var querystring=require(_0xfcfb('0xe'));var Papa=require(_0xfcfb('0xf'));var Redis=require(_0xfcfb('0x10'));var authService=require(_0xfcfb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfcfb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcfb('0x13'))('api');var utils=require(_0xfcfb('0x14'));var config=require(_0xfcfb('0x15'));var licenseUtil=require(_0xfcfb('0x16'));var db=require(_0xfcfb('0x17'))['db'];var integrations=require(_0xfcfb('0x18'));function respondWithStatusCode(_0x101363,_0x9d6dc4){_0x9d6dc4=_0x9d6dc4||0xcc;return function(_0x1eaf0c){if(_0x1eaf0c){return _0x101363[_0xfcfb('0x19')](_0x9d6dc4);}return _0x101363[_0xfcfb('0x1a')](_0x9d6dc4)[_0xfcfb('0x1b')]();};}function respondWithResult(_0x58f6d9,_0x233b72){_0x233b72=_0x233b72||0xc8;return function(_0x3b61b){if(_0x3b61b){return _0x58f6d9['status'](_0x233b72)['json'](_0x3b61b);}};}function respondWithFilteredResult(_0xbea5af,_0x5e2d2f){return function(_0x8420f1){if(_0x8420f1){var _0x44f7a7=typeof _0x5e2d2f['offset']===_0xfcfb('0x1c')&&typeof _0x5e2d2f[_0xfcfb('0x1d')]===_0xfcfb('0x1c');var _0x2a1a65=_0x8420f1[_0xfcfb('0x1e')];var _0x1b4725=_0x44f7a7?0x0:_0x5e2d2f[_0xfcfb('0x1f')];var _0x15bcfc=_0x44f7a7?_0x8420f1[_0xfcfb('0x1e')]:_0x5e2d2f['offset']+_0x5e2d2f['limit'];var _0xc33431;if(_0x15bcfc>=_0x2a1a65){_0x15bcfc=_0x2a1a65;_0xc33431=0xc8;}else{_0xc33431=0xce;}_0xbea5af[_0xfcfb('0x1a')](_0xc33431);return _0xbea5af[_0xfcfb('0x20')](_0xfcfb('0x21'),_0x1b4725+'-'+_0x15bcfc+'/'+_0x2a1a65)[_0xfcfb('0x22')](_0x8420f1);}return null;};}function patchUpdates(_0x8b9ef7){return function(_0x2fc203){try{jsonpatch[_0xfcfb('0x23')](_0x2fc203,_0x8b9ef7,!![]);}catch(_0x4b0151){return BPromise['reject'](_0x4b0151);}return _0x2fc203[_0xfcfb('0x24')]();};}function saveUpdates(_0x319a17,_0x3f07b0){return function(_0x1d25ab){if(_0x1d25ab){return _0x1d25ab['update'](_0x319a17)[_0xfcfb('0x25')](function(_0x4164a7){return _0x4164a7;});}return null;};}function removeEntity(_0x2dce6b,_0x2b0344){return function(_0x518223){if(_0x518223){return _0x518223[_0xfcfb('0x26')]()['then'](function(){_0x2dce6b[_0xfcfb('0x1a')](0xcc)[_0xfcfb('0x1b')]();});}};}function handleEntityNotFound(_0x2857f7,_0x498427){return function(_0x112592){if(!_0x112592){_0x2857f7[_0xfcfb('0x19')](0x194);}return _0x112592;};}function handleError(_0x24ae85,_0x57d8e1){_0x57d8e1=_0x57d8e1||0x1f4;return function(_0x27bbb1){logger['error'](_0x27bbb1[_0xfcfb('0x27')]);if(_0x27bbb1[_0xfcfb('0x28')]){delete _0x27bbb1[_0xfcfb('0x28')];}_0x24ae85[_0xfcfb('0x1a')](_0x57d8e1)[_0xfcfb('0x29')](_0x27bbb1);};}exports[_0xfcfb('0x2a')]=function(_0x32125d,_0x4d835e){var _0x1958c6={},_0x1d14b2={},_0x1d71fb={'count':0x0,'rows':[]};var _0x5955df=_[_0xfcfb('0x2b')](db['ZohoAccount'][_0xfcfb('0x2c')],function(_0x2c121b){return{'name':_0x2c121b[_0xfcfb('0x2d')],'type':_0x2c121b[_0xfcfb('0x2e')][_0xfcfb('0x2f')]};});_0x1d14b2[_0xfcfb('0x30')]=_[_0xfcfb('0x2b')](_0x5955df,'name');_0x1d14b2[_0xfcfb('0x31')]=_['keys'](_0x32125d['query']);_0x1d14b2['filters']=_[_0xfcfb('0x32')](_0x1d14b2['model'],_0x1d14b2[_0xfcfb('0x31')]);_0x1958c6[_0xfcfb('0x33')]=_[_0xfcfb('0x32')](_0x1d14b2[_0xfcfb('0x30')],qs[_0xfcfb('0x34')](_0x32125d[_0xfcfb('0x31')]['fields']));_0x1958c6[_0xfcfb('0x33')]=_0x1958c6['attributes'][_0xfcfb('0x35')]?_0x1958c6[_0xfcfb('0x33')]:_0x1d14b2[_0xfcfb('0x30')];if(!_0x32125d[_0xfcfb('0x31')][_0xfcfb('0x36')]('nolimit')){_0x1958c6[_0xfcfb('0x1d')]=qs[_0xfcfb('0x1d')](_0x32125d['query'][_0xfcfb('0x1d')]);_0x1958c6['offset']=qs[_0xfcfb('0x1f')](_0x32125d[_0xfcfb('0x31')][_0xfcfb('0x1f')]);}_0x1958c6[_0xfcfb('0x37')]=qs[_0xfcfb('0x38')](_0x32125d[_0xfcfb('0x31')]['sort']);_0x1958c6['where']=qs['filters'](_[_0xfcfb('0x39')](_0x32125d[_0xfcfb('0x31')],_0x1d14b2[_0xfcfb('0x3a')]),_0x5955df);if(_0x32125d[_0xfcfb('0x31')]['filter']){_0x1958c6[_0xfcfb('0x3b')]=_[_0xfcfb('0x3c')](_0x1958c6[_0xfcfb('0x3b')],{'$or':_[_0xfcfb('0x2b')](_0x5955df,function(_0x3ae24c){if(_0x3ae24c[_0xfcfb('0x2e')]!==_0xfcfb('0x3d')){var _0x5f0262={};_0x5f0262[_0x3ae24c[_0xfcfb('0x28')]]={'$like':'%'+_0x32125d['query'][_0xfcfb('0x3e')]+'%'};return _0x5f0262;}})});}_0x1958c6=_[_0xfcfb('0x3c')]({},_0x1958c6,_0x32125d[_0xfcfb('0x3f')]);var _0x13023f={'where':_0x1958c6[_0xfcfb('0x3b')]};return db[_0xfcfb('0x40')]['count'](_0x13023f)['then'](function(_0x3043f2){_0x1d71fb['count']=_0x3043f2;if(_0x32125d[_0xfcfb('0x31')][_0xfcfb('0x41')]){_0x1958c6[_0xfcfb('0x42')]=[{'all':!![]}];}return db[_0xfcfb('0x40')][_0xfcfb('0x43')](_0x1958c6);})['then'](function(_0x35c5a0){_0x1d71fb['rows']=_0x35c5a0;return _0x1d71fb;})[_0xfcfb('0x25')](respondWithFilteredResult(_0x4d835e,_0x1958c6))[_0xfcfb('0x44')](handleError(_0x4d835e,null));};exports['show']=function(_0x59e2bf,_0x45f910){var _0x1d9ef5={'raw':![],'where':{'id':_0x59e2bf[_0xfcfb('0x45')]['id']}},_0x352d5b={};_0x352d5b[_0xfcfb('0x30')]=_[_0xfcfb('0x46')](db[_0xfcfb('0x40')][_0xfcfb('0x2c')]);_0x352d5b[_0xfcfb('0x31')]=_[_0xfcfb('0x46')](_0x59e2bf[_0xfcfb('0x31')]);_0x352d5b[_0xfcfb('0x3a')]=_[_0xfcfb('0x32')](_0x352d5b[_0xfcfb('0x30')],_0x352d5b[_0xfcfb('0x31')]);_0x1d9ef5[_0xfcfb('0x33')]=_[_0xfcfb('0x32')](_0x352d5b[_0xfcfb('0x30')],qs[_0xfcfb('0x34')](_0x59e2bf['query']['fields']));_0x1d9ef5[_0xfcfb('0x33')]=_0x1d9ef5[_0xfcfb('0x33')][_0xfcfb('0x35')]?_0x1d9ef5['attributes']:_0x352d5b[_0xfcfb('0x30')];if(_0x59e2bf['query'][_0xfcfb('0x41')]){_0x1d9ef5[_0xfcfb('0x42')]=[{'all':!![]}];}_0x1d9ef5=_['merge']({},_0x1d9ef5,_0x59e2bf[_0xfcfb('0x3f')]);return db['ZohoAccount'][_0xfcfb('0x47')](_0x1d9ef5)[_0xfcfb('0x25')](handleEntityNotFound(_0x45f910,null))[_0xfcfb('0x25')](respondWithResult(_0x45f910,null))['catch'](handleError(_0x45f910,null));};exports['create']=function(_0x57790d,_0x5aeaaf){return db[_0xfcfb('0x40')][_0xfcfb('0x48')](_0x57790d['body'],{})[_0xfcfb('0x25')](respondWithResult(_0x5aeaaf,0xc9))[_0xfcfb('0x44')](handleError(_0x5aeaaf,null));};exports[_0xfcfb('0x49')]=function(_0x209d4f,_0x37e10b){if(_0x209d4f[_0xfcfb('0x4a')]['id']){delete _0x209d4f[_0xfcfb('0x4a')]['id'];}return db['ZohoAccount'][_0xfcfb('0x47')]({'where':{'id':_0x209d4f['params']['id']}})['then'](handleEntityNotFound(_0x37e10b,null))[_0xfcfb('0x25')](saveUpdates(_0x209d4f[_0xfcfb('0x4a')],null))['then'](respondWithResult(_0x37e10b,null))[_0xfcfb('0x44')](handleError(_0x37e10b,null));};exports[_0xfcfb('0x26')]=function(_0xe12cbe,_0x166f15){return db[_0xfcfb('0x40')][_0xfcfb('0x47')]({'where':{'id':_0xe12cbe[_0xfcfb('0x45')]['id']}})[_0xfcfb('0x25')](handleEntityNotFound(_0x166f15,null))['then'](removeEntity(_0x166f15,null))[_0xfcfb('0x44')](handleError(_0x166f15,null));};exports[_0xfcfb('0x4b')]=function(_0x3a4d59,_0x4414bb,_0x32af91){var _0x5167aa={};var _0x49d685={};var _0xc740a7;var _0x20b320;return db[_0xfcfb('0x40')][_0xfcfb('0x4c')]({'where':{'id':_0x3a4d59[_0xfcfb('0x45')]['id']}})['then'](handleEntityNotFound(_0x4414bb,null))[_0xfcfb('0x25')](function(_0xd76c52){if(_0xd76c52){_0xc740a7=_0xd76c52;_0x49d685[_0xfcfb('0x30')]=_[_0xfcfb('0x46')](db[_0xfcfb('0x4d')]['rawAttributes']);_0x49d685['query']=_['keys'](_0x3a4d59['query']);_0x49d685[_0xfcfb('0x3a')]=_[_0xfcfb('0x32')](_0x49d685[_0xfcfb('0x30')],_0x49d685[_0xfcfb('0x31')]);_0x5167aa['attributes']=_['intersection'](_0x49d685[_0xfcfb('0x30')],qs[_0xfcfb('0x34')](_0x3a4d59['query'][_0xfcfb('0x34')]));_0x5167aa[_0xfcfb('0x33')]=_0x5167aa['attributes'][_0xfcfb('0x35')]?_0x5167aa[_0xfcfb('0x33')]:_0x49d685[_0xfcfb('0x30')];_0x5167aa['order']=qs[_0xfcfb('0x38')](_0x3a4d59['query'][_0xfcfb('0x38')]);_0x5167aa[_0xfcfb('0x3b')]=qs['filters'](_['pick'](_0x3a4d59[_0xfcfb('0x31')],_0x49d685[_0xfcfb('0x3a')]));if(_0x3a4d59[_0xfcfb('0x31')]['filter']){_0x5167aa[_0xfcfb('0x3b')]=_[_0xfcfb('0x3c')](_0x5167aa[_0xfcfb('0x3b')],{'$or':_[_0xfcfb('0x2b')](_0x5167aa[_0xfcfb('0x33')],function(_0x5c7e74){var _0x2aebb7={};_0x2aebb7[_0x5c7e74]={'$like':'%'+_0x3a4d59[_0xfcfb('0x31')][_0xfcfb('0x3e')]+'%'};return _0x2aebb7;})});}_0x5167aa=_[_0xfcfb('0x3c')]({},_0x5167aa,_0x3a4d59['options']);return _0xc740a7[_0xfcfb('0x4b')](_0x5167aa);}})[_0xfcfb('0x25')](function(_0x3f877e){if(_0x3f877e){_0x20b320=_0x3f877e['length'];if(!_0x3a4d59[_0xfcfb('0x31')]['hasOwnProperty'](_0xfcfb('0x4e'))){_0x5167aa[_0xfcfb('0x1d')]=qs['limit'](_0x3a4d59['query'][_0xfcfb('0x1d')]);_0x5167aa[_0xfcfb('0x1f')]=qs[_0xfcfb('0x1f')](_0x3a4d59[_0xfcfb('0x31')][_0xfcfb('0x1f')]);}return _0xc740a7[_0xfcfb('0x4b')](_0x5167aa);}})[_0xfcfb('0x25')](function(_0x5caf68){if(_0x5caf68){return _0x5caf68?{'count':_0x20b320,'rows':_0x5caf68}:null;}})[_0xfcfb('0x25')](respondWithResult(_0x4414bb,null))[_0xfcfb('0x44')](handleError(_0x4414bb,null));};exports['addConfiguration']=function(_0x5c01c6,_0x31feca,_0x3c22f9){if(_0x5c01c6[_0xfcfb('0x4a')]['id']){delete _0x5c01c6[_0xfcfb('0x4a')]['id'];}return db[_0xfcfb('0x40')]['findOne']({'where':{'id':_0x5c01c6[_0xfcfb('0x45')]['id']}})[_0xfcfb('0x25')](handleEntityNotFound(_0x31feca,null))[_0xfcfb('0x25')](function(_0x36ce45){if(_0x36ce45){_0x5c01c6[_0xfcfb('0x4a')][_0xfcfb('0x4f')]=_0x36ce45['id'];_0x5c01c6['body']['Subjects']=integrations['getSubjects'](_0x5c01c6[_0xfcfb('0x4a')]['channel'],_0x5c01c6[_0xfcfb('0x4a')][_0xfcfb('0x2e')]);_0x5c01c6[_0xfcfb('0x4a')][_0xfcfb('0x50')]=integrations['getDescriptions'](_0x5c01c6[_0xfcfb('0x4a')][_0xfcfb('0x51')],_0x5c01c6[_0xfcfb('0x4a')]['type']);return db[_0xfcfb('0x4d')]['create'](_0x5c01c6[_0xfcfb('0x4a')],{'include':[{'model':db[_0xfcfb('0x52')],'as':_0xfcfb('0x53')},{'model':db[_0xfcfb('0x52')],'as':_0xfcfb('0x50')}]});}return null;})[_0xfcfb('0x25')](respondWithResult(_0x31feca,null))[_0xfcfb('0x44')](handleError(_0x31feca,null));};function getAccessToken(_0x2f9b51){return new Promise(function(_0x3e1d46,_0x26bfd0){var _0x1cdb3a;switch(_0x2f9b51[_0xfcfb('0x54')]){case'US':_0x1cdb3a='https://accounts.zoho.com';break;case'AU':_0x1cdb3a=_0xfcfb('0x55');break;case'EU':_0x1cdb3a=_0xfcfb('0x56');break;case'IN':_0x1cdb3a=_0xfcfb('0x57');break;case'CN':_0x1cdb3a=_0xfcfb('0x58');break;default:_0x1cdb3a=_0xfcfb('0x56');break;}var _0x3e0a5f={'method':'POST','uri':_0x1cdb3a+_0xfcfb('0x59'),'qs':{'refresh_token':_0x2f9b51[_0xfcfb('0x5a')],'client_id':_0x2f9b51[_0xfcfb('0x5b')],'client_secret':_0x2f9b51[_0xfcfb('0x5c')],'grant_type':_0xfcfb('0x5d')},'json':!![]};return rp(_0x3e0a5f)['then'](function(_0x1bd33c){if(_0x1bd33c[_0xfcfb('0x5e')]){_0x3e1d46(_0x1bd33c[_0xfcfb('0x5e')]);}else{_0x26bfd0(_0xfcfb('0x5f'));}})[_0xfcfb('0x44')](function(_0x3102b9){_0x26bfd0(_0x3102b9);});});}exports[_0xfcfb('0x60')]=function(_0x4c56e7,_0x3c6ee1,_0x117bf0){var _0x4d15bf,_0x2fa90a,_0x41ad14,_0x4f40f9,_0x51caf0;return db[_0xfcfb('0x40')][_0xfcfb('0x4c')]({'where':{'id':_0x4c56e7[_0xfcfb('0x45')]['id']},'attributes':['id','host',_0xfcfb('0x54'),_0xfcfb('0x5b'),_0xfcfb('0x5c'),_0xfcfb('0x61'),_0xfcfb('0x62'),'refreshToken']})[_0xfcfb('0x25')](handleEntityNotFound(_0x3c6ee1,null))[_0xfcfb('0x25')](function(_0x57a31c){_0x51caf0=_0x57a31c;_0x4d15bf=_0x51caf0[_0xfcfb('0x63')];_0x2fa90a=_0x4d15bf===_0xfcfb('0x64')?'eu':'com';_0x41ad14=_0x51caf0[_0xfcfb('0x61')];var _0x1665c2=_0x41ad14[_0xfcfb('0x65')](-0x1);if(_0x1665c2==='/'||_0x1665c2==='\x5c'||_0x1665c2===':'){_0x41ad14=_0x41ad14['substring'](0x0,_0x41ad14[_0xfcfb('0x66')](_0x1665c2));}if(!_0x51caf0['refreshToken']){throw new Error(_0xfcfb('0x67'));}return getAccessToken(_0x51caf0);})['then'](function(_0x5159a4){if(_0x5159a4){return rp({'method':_0xfcfb('0x68'),'uri':util[_0xfcfb('0x69')](_0xfcfb('0x6a'),_0x2fa90a),'qs':{'module':_0xfcfb('0x6b')},'headers':{'Authorization':_0xfcfb('0x6c')+_0x5159a4},'json':!![]});}})[_0xfcfb('0x25')](function(_0x5b4ae2){if(_0x5b4ae2){if(_0x5b4ae2[_0xfcfb('0x6d')]&&_0x5b4ae2[_0xfcfb('0x6d')][_0xfcfb('0x6e')]){throw new Error(_0x5b4ae2[_0xfcfb('0x6d')][_0xfcfb('0x6e')]['message']);}var _0x2c7d4f=[];var _0x30b697=[];var _0x23c5aa=[_0xfcfb('0x6f'),_0xfcfb('0x70'),_0xfcfb('0x71'),_0xfcfb('0x72'),'Call_Duration',_0xfcfb('0x73'),_0xfcfb('0x74'),_0xfcfb('0x75')];_0x30b697=_[_0xfcfb('0x76')](_0x5b4ae2[_0xfcfb('0x34')],function(_0x50673e){return _0x23c5aa[_0xfcfb('0x77')](_0x50673e['api_name']);});for(var _0xe87e8a=0x0;_0xe87e8a<_0x30b697['length'];_0xe87e8a++){if(_0x30b697[_0xe87e8a][_0xfcfb('0x78')]===![]){_0x2c7d4f[_0xfcfb('0x79')]({'id':_0x30b697[_0xe87e8a]['id'],'name':_0x30b697[_0xe87e8a][_0xfcfb('0x7a')],'custom':_0x30b697[_0xe87e8a][_0xfcfb('0x7b')],'options':_0x30b697[_0xe87e8a][_0xfcfb('0x7c')]===_0xfcfb('0x7d')&&_0x30b697[_0xe87e8a][_0xfcfb('0x7e')][_0xfcfb('0x35')]>-0x1?_[_0xfcfb('0x2b')](_0x30b697[_0xe87e8a][_0xfcfb('0x7e')],function(_0x28f417){return{'name':_0x28f417,'value':_0x28f417};}):[]});}}return{'count':_0x2c7d4f[_0xfcfb('0x35')],'rows':_0x2c7d4f};}else{return{'count':0x0,'rows':[]};}})[_0xfcfb('0x25')](respondWithResult(_0x3c6ee1,null))[_0xfcfb('0x44')](function(_0x1307fd){var _0x26794e=_0x4c56e7[_0xfcfb('0x31')]['test']?0x1f4:_0x1307fd[_0xfcfb('0x7f')]||0x1f4;logger[_0xfcfb('0x6e')](_0xfcfb('0x80'),_0xfcfb('0x60'),_0x26794e,JSON[_0xfcfb('0x81')](_0x1307fd));delete _0x1307fd['name'];if(_0x26794e===0x191){_0x26794e=0x190;}_0x3c6ee1[_0xfcfb('0x1a')](_0x26794e)[_0xfcfb('0x29')](_0x4c56e7[_0xfcfb('0x31')][_0xfcfb('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x1307fd[_0xfcfb('0x7f')]}:_0x1307fd);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 2fd9c60..82e25c6 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 _0x96e8=['define','ZohoAccount','changed','zone','clientId','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','serverUrl','host','https://accounts.zoho.in','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x35e44d,_0x34def6){var _0x35ec48=function(_0xb33742){while(--_0xb33742){_0x35e44d['push'](_0x35e44d['shift']());}};_0x35ec48(++_0x34def6);}(_0x96e8,0x99));var _0x896e=function(_0x571cae,_0x19187e){_0x571cae=_0x571cae-0x0;var _0x30abb5=_0x96e8[_0x571cae];return _0x30abb5;};'use strict';var _=require(_0x896e('0x0'));var util=require(_0x896e('0x1'));var logger=require(_0x896e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x896e('0x3'));var rp=require(_0x896e('0x4'));var fs=require('fs');var path=require(_0x896e('0x5'));var rimraf=require(_0x896e('0x6'));var config=require(_0x896e('0x7'));var attributes=require(_0x896e('0x8'));var integrations=require(_0x896e('0x9'));module[_0x896e('0xa')]=function(_0x535783,_0x29dac4){return _0x535783[_0x896e('0xb')](_0x896e('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2277cf,_0xdffb11,_0xf50dd3){if(_0x2277cf[_0x896e('0xd')](_0x896e('0xe'))||_0x2277cf[_0x896e('0xd')]('serverUrl')||_0x2277cf[_0x896e('0xd')](_0x896e('0xf'))||_0x2277cf[_0x896e('0xd')](_0x896e('0x10'))||_0x2277cf[_0x896e('0xd')](_0x896e('0x11'))||_0x2277cf['changed']('host')){var _0x2ece2d,_0x1d9da8;_0x2ece2d=_0x2277cf['serverUrl'];var _0x4b5d56=_0x2ece2d[_0x896e('0x12')](-0x1);if(_0x4b5d56==='/'||_0x4b5d56==='\x5c'||_0x4b5d56===':'){_0x2ece2d=_0x2ece2d[_0x896e('0x13')](0x0,_0x2ece2d[_0x896e('0x14')](_0x4b5d56));}switch(_0x2277cf[_0x896e('0xe')]){case'US':_0x1d9da8=_0x896e('0x15');break;case'AU':_0x1d9da8=_0x896e('0x16');break;case'IN':_0x1d9da8='https://accounts.zoho.in';break;case'CN':_0x1d9da8=_0x896e('0x17');break;default:_0x1d9da8=_0x896e('0x18');break;}var _0x4af2b3={'method':_0x896e('0x19'),'uri':_0x1d9da8+_0x896e('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x2277cf['clientId'],'client_secret':_0x2277cf[_0x896e('0x10')],'redirect_uri':_0x2277cf['serverUrl'],'code':_0x2277cf[_0x896e('0x11')]},'headers':{'Content-Type':_0x896e('0x1b')}};return rp(_0x4af2b3)[_0x896e('0x1c')](function(_0x32d9b9){var _0x2493d0=JSON[_0x896e('0x1d')](_0x32d9b9);if(_0x2493d0[_0x896e('0x1e')]){_0x2277cf['refreshToken']=_0x2493d0['refresh_token'];logger['info'](util['format'](_0x896e('0x1f'),_0x2277cf[_0x896e('0x20')],_0x2277cf['id']));}else{logger[_0x896e('0x21')](util[_0x896e('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2277cf[_0x896e('0x20')],_0x2277cf['id']),util[_0x896e('0x23')](_0x2493d0,{'showHidden':![],'depth':null}));}return _0xf50dd3(null,_0xdffb11);})[_0x896e('0x24')](function(_0x3d63eb){logger[_0x896e('0x21')](util[_0x896e('0x22')](_0x896e('0x25'),_0x2277cf['name'],_0x2277cf['id']),util[_0x896e('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xf50dd3(_0x3d63eb);});}else{return _0xf50dd3(null,_0xdffb11);}},'beforeUpdate':function(_0x1585fc,_0x2c3343,_0x575c37){if(_0x1585fc[_0x896e('0xd')](_0x896e('0xe'))||_0x1585fc[_0x896e('0xd')](_0x896e('0x26'))||_0x1585fc[_0x896e('0xd')](_0x896e('0xf'))||_0x1585fc[_0x896e('0xd')]('clientSecret')||_0x1585fc[_0x896e('0xd')]('code')||_0x1585fc[_0x896e('0xd')](_0x896e('0x27'))){var _0x444070,_0x2ed634;_0x444070=_0x1585fc[_0x896e('0x26')];var _0x3ddc52=_0x444070[_0x896e('0x12')](-0x1);if(_0x3ddc52==='/'||_0x3ddc52==='\x5c'||_0x3ddc52===':'){_0x444070=_0x444070[_0x896e('0x13')](0x0,_0x444070[_0x896e('0x14')](_0x3ddc52));}switch(_0x1585fc[_0x896e('0xe')]){case'US':_0x2ed634=_0x896e('0x15');break;case'AU':_0x2ed634=_0x896e('0x16');break;case'IN':_0x2ed634=_0x896e('0x28');break;case'CN':_0x2ed634=_0x896e('0x17');break;default:_0x2ed634=_0x896e('0x18');break;}var _0x4f9dad={'method':'POST','uri':_0x2ed634+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x1585fc[_0x896e('0xf')],'client_secret':_0x1585fc[_0x896e('0x10')],'redirect_uri':_0x1585fc['serverUrl'],'code':_0x1585fc['code']},'headers':{'Content-Type':_0x896e('0x1b')}};return rp(_0x4f9dad)[_0x896e('0x1c')](function(_0x2c7f39){var _0x1ba817=JSON[_0x896e('0x1d')](_0x2c7f39);if(_0x1ba817['refresh_token']){_0x1585fc['refreshToken']=_0x1ba817[_0x896e('0x1e')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1585fc[_0x896e('0x20')],_0x1585fc['id']));}else{logger[_0x896e('0x21')](util['format'](_0x896e('0x25'),_0x1585fc[_0x896e('0x20')],_0x1585fc['id']),util[_0x896e('0x23')](_0x1ba817,{'showHidden':![],'depth':null}));}return _0x575c37(null,_0x2c3343);})[_0x896e('0x24')](function(_0x4f09c7){logger[_0x896e('0x21')](util['format'](_0x896e('0x25'),_0x1585fc[_0x896e('0x20')],_0x1585fc['id']),util[_0x896e('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x575c37(_0x4f09c7);});}else{return _0x575c37(null,_0x2c3343);}}}});}; \ No newline at end of file +var _0x22a8=['changed','zone','serverUrl','clientSecret','code','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','clientId','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','define','ZohoAccount','int_zoho_accounts'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x22a8,0x6e));var _0x822a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x22a8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x822a('0x0'));var util=require(_0x822a('0x1'));var logger=require(_0x822a('0x2'))(_0x822a('0x3'));var moment=require(_0x822a('0x4'));var BPromise=require(_0x822a('0x5'));var rp=require(_0x822a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x822a('0x7'));var config=require(_0x822a('0x8'));var attributes=require(_0x822a('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2edf90,_0x1effe4){return _0x2edf90[_0x822a('0xa')](_0x822a('0xb'),attributes,{'tableName':_0x822a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4466d9,_0x74fb00,_0x14526e){if(_0x4466d9[_0x822a('0xd')](_0x822a('0xe'))||_0x4466d9[_0x822a('0xd')](_0x822a('0xf'))||_0x4466d9[_0x822a('0xd')]('clientId')||_0x4466d9['changed'](_0x822a('0x10'))||_0x4466d9['changed'](_0x822a('0x11'))||_0x4466d9['changed'](_0x822a('0x12'))){var _0x22b35b,_0x443829;_0x22b35b=_0x4466d9[_0x822a('0xf')];var _0x145276=_0x22b35b[_0x822a('0x13')](-0x1);if(_0x145276==='/'||_0x145276==='\x5c'||_0x145276===':'){_0x22b35b=_0x22b35b['substring'](0x0,_0x22b35b['lastIndexOf'](_0x145276));}switch(_0x4466d9['zone']){case'US':_0x443829=_0x822a('0x14');break;case'AU':_0x443829=_0x822a('0x15');break;case'IN':_0x443829=_0x822a('0x16');break;case'CN':_0x443829='https://accounts.zoho.com.cn';break;default:_0x443829=_0x822a('0x17');break;}var _0x92e5e5={'method':'POST','uri':_0x443829+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x4466d9[_0x822a('0x18')],'client_secret':_0x4466d9[_0x822a('0x10')],'redirect_uri':_0x4466d9['serverUrl'],'code':_0x4466d9[_0x822a('0x11')]},'headers':{'Content-Type':_0x822a('0x19')}};return rp(_0x92e5e5)[_0x822a('0x1a')](function(_0x19a8f0){var _0x19da02=JSON[_0x822a('0x1b')](_0x19a8f0);if(_0x19da02['refresh_token']){_0x4466d9[_0x822a('0x1c')]=_0x19da02[_0x822a('0x1d')];logger[_0x822a('0x1e')](util[_0x822a('0x1f')](_0x822a('0x20'),_0x4466d9[_0x822a('0x21')],_0x4466d9['id']));}else{logger['error'](util['format'](_0x822a('0x22'),_0x4466d9[_0x822a('0x21')],_0x4466d9['id']),util[_0x822a('0x23')](_0x19da02,{'showHidden':![],'depth':null}));}return _0x14526e(null,_0x74fb00);})[_0x822a('0x24')](function(_0x595abd){logger['error'](util['format'](_0x822a('0x22'),_0x4466d9[_0x822a('0x21')],_0x4466d9['id']),util[_0x822a('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x14526e(_0x595abd);});}else{return _0x14526e(null,_0x74fb00);}},'beforeUpdate':function(_0x15676e,_0x40a959,_0x4c0b1a){if(_0x15676e[_0x822a('0xd')](_0x822a('0xe'))||_0x15676e[_0x822a('0xd')](_0x822a('0xf'))||_0x15676e[_0x822a('0xd')]('clientId')||_0x15676e[_0x822a('0xd')](_0x822a('0x10'))||_0x15676e[_0x822a('0xd')](_0x822a('0x11'))||_0x15676e[_0x822a('0xd')](_0x822a('0x12'))){var _0x3a7881,_0x21ffeb;_0x3a7881=_0x15676e[_0x822a('0xf')];var _0x4f580f=_0x3a7881[_0x822a('0x13')](-0x1);if(_0x4f580f==='/'||_0x4f580f==='\x5c'||_0x4f580f===':'){_0x3a7881=_0x3a7881[_0x822a('0x25')](0x0,_0x3a7881['lastIndexOf'](_0x4f580f));}switch(_0x15676e[_0x822a('0xe')]){case'US':_0x21ffeb=_0x822a('0x14');break;case'AU':_0x21ffeb=_0x822a('0x15');break;case'IN':_0x21ffeb=_0x822a('0x16');break;case'CN':_0x21ffeb=_0x822a('0x26');break;default:_0x21ffeb=_0x822a('0x17');break;}var _0x501062={'method':'POST','uri':_0x21ffeb+_0x822a('0x27'),'form':{'grant_type':_0x822a('0x28'),'client_id':_0x15676e[_0x822a('0x18')],'client_secret':_0x15676e[_0x822a('0x10')],'redirect_uri':_0x15676e[_0x822a('0xf')],'code':_0x15676e[_0x822a('0x11')]},'headers':{'Content-Type':_0x822a('0x19')}};return rp(_0x501062)[_0x822a('0x1a')](function(_0x13c042){var _0x50e8b9=JSON[_0x822a('0x1b')](_0x13c042);if(_0x50e8b9[_0x822a('0x1d')]){_0x15676e[_0x822a('0x1c')]=_0x50e8b9[_0x822a('0x1d')];logger[_0x822a('0x1e')](util[_0x822a('0x1f')](_0x822a('0x20'),_0x15676e['name'],_0x15676e['id']));}else{logger['error'](util[_0x822a('0x1f')](_0x822a('0x22'),_0x15676e[_0x822a('0x21')],_0x15676e['id']),util[_0x822a('0x23')](_0x50e8b9,{'showHidden':![],'depth':null}));}return _0x4c0b1a(null,_0x40a959);})[_0x822a('0x24')](function(_0x1d8889){logger['error'](util[_0x822a('0x1f')](_0x822a('0x22'),_0x15676e[_0x822a('0x21')],_0x15676e['id']),util[_0x822a('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4c0b1a(_0x1d8889);});}else{return _0x4c0b1a(null,_0x40a959);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index a4db83d..36939f4 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 _0x49db=['ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x44346c,_0x58a5cc){var _0x134d5a=function(_0x10f739){while(--_0x10f739){_0x44346c['push'](_0x44346c['shift']());}};_0x134d5a(++_0x58a5cc);}(_0x49db,0xc5));var _0xb49d=function(_0x3840f2,_0xc2d3a2){_0x3840f2=_0x3840f2-0x0;var _0x5176d4=_0x49db[_0x3840f2];return _0x5176d4;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var moment=require(_0xb49d('0x2'));var BPromise=require(_0xb49d('0x3'));var rs=require(_0xb49d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb49d('0x5'))['db'];var utils=require(_0xb49d('0x6'));var logger=require(_0xb49d('0x7'))('rpc');var config=require(_0xb49d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb49d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4180c8,_0x15f52f,_0x572ee4){return new BPromise(function(_0x12e114,_0x128caa){return client[_0xb49d('0xa')](_0x4180c8,_0x572ee4)[_0xb49d('0xb')](function(_0x3d4825){logger[_0xb49d('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x15f52f,'request\x20sent');logger[_0xb49d('0xd')](_0xb49d('0xe'),_0x15f52f,_0xb49d('0xf'),JSON[_0xb49d('0x10')](_0x3d4825));if(_0x3d4825[_0xb49d('0x11')]){if(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x12')]===0x1f4){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x3d4825['error'][_0xb49d('0x14')]);return _0x128caa(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);}logger[_0xb49d('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x15f52f,_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);return _0x12e114(_0x3d4825['error'][_0xb49d('0x14')]);}else{logger[_0xb49d('0xc')](_0xb49d('0x13'),_0x15f52f,_0xb49d('0xf'));_0x12e114(_0x3d4825[_0xb49d('0x15')][_0xb49d('0x14')]);}})[_0xb49d('0x16')](function(_0x584ade){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x584ade);_0x128caa(_0x584ade);});});}exports[_0xb49d('0x17')]=function(_0xf0bdff){var _0x4abce4=this;return new Promise(function(_0x4f3988,_0xfd7a95){return db[_0xb49d('0x18')][_0xb49d('0x19')]({'raw':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1b')]||null:null,'attributes':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1c')]||null:null,'limit':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1d')]||null:null,'include':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1e')],function(_0x2ccce8){return{'model':db[_0x2ccce8[_0xb49d('0x20')]],'as':_0x2ccce8['as'],'attributes':_0x2ccce8[_0xb49d('0x1c')],'include':_0x2ccce8[_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0x2ccce8[_0xb49d('0x1e')],function(_0x395c9f){return{'model':db[_0x395c9f['model']],'as':_0x395c9f['as'],'attributes':_0x395c9f[_0xb49d('0x1c')],'include':_0x395c9f['include']?_[_0xb49d('0x1f')](_0x395c9f[_0xb49d('0x1e')],function(_0x56163c){return{'model':db[_0x56163c[_0xb49d('0x20')]],'as':_0x56163c['as'],'attributes':_0x56163c[_0xb49d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb49d('0xb')](function(_0x3af956){logger[_0xb49d('0xc')](_0xb49d('0x17'),_0xf0bdff);logger['debug'](_0xb49d('0x17'),_0xf0bdff,JSON[_0xb49d('0x10')](_0x3af956));_0x4f3988(_0x3af956);})[_0xb49d('0x16')](function(_0x37901b){logger[_0xb49d('0x11')](_0xb49d('0x17'),_0x37901b[_0xb49d('0x14')],_0xf0bdff);_0xfd7a95(_0x4abce4['error'](0x1f4,_0x37901b[_0xb49d('0x14')]));});});};exports['ShowZohoAccount']=function(_0xf232e1){var _0x2fbcfa=this;return new Promise(function(_0x978e19,_0x1e66a6){return db[_0xb49d('0x18')][_0xb49d('0x21')]({'raw':_0xf232e1[_0xb49d('0x1a')]?_0xf232e1['options'][_0xb49d('0x22')]===undefined?!![]:![]:!![],'where':_0xf232e1[_0xb49d('0x1a')]?_0xf232e1[_0xb49d('0x1a')]['where']||null:null,'attributes':_0xf232e1['options']?_0xf232e1[_0xb49d('0x1a')][_0xb49d('0x1c')]||null:null,'include':_0xf232e1[_0xb49d('0x1a')]?_0xf232e1[_0xb49d('0x1a')][_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0xf232e1[_0xb49d('0x1a')][_0xb49d('0x1e')],function(_0x594dcb){return{'model':db[_0x594dcb['model']],'as':_0x594dcb['as'],'attributes':_0x594dcb[_0xb49d('0x1c')],'include':_0x594dcb['include']?_['map'](_0x594dcb['include'],function(_0x423399){return{'model':db[_0x423399[_0xb49d('0x20')]],'as':_0x423399['as'],'attributes':_0x423399[_0xb49d('0x1c')],'include':_0x423399[_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0x423399[_0xb49d('0x1e')],function(_0x52b44f){return{'model':db[_0x52b44f[_0xb49d('0x20')]],'as':_0x52b44f['as'],'attributes':_0x52b44f[_0xb49d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35ae2e){logger[_0xb49d('0xc')](_0xb49d('0x23'),_0xf232e1);logger['debug'](_0xb49d('0x23'),_0xf232e1,JSON[_0xb49d('0x10')](_0x35ae2e));_0x978e19(_0x35ae2e);})[_0xb49d('0x16')](function(_0x5671e6){logger[_0xb49d('0x11')]('ShowZohoAccount',_0x5671e6['message'],_0xf232e1);_0x1e66a6(_0x2fbcfa['error'](0x1f4,_0x5671e6['message']));});});}; \ No newline at end of file +var _0x50a5=['findAll','options','where','attributes','limit','include','map','model','stringify','ShowZohoAccount','find','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount'];(function(_0x4e56a8,_0x3b17dc){var _0x2f9ab6=function(_0x5bf42c){while(--_0x5bf42c){_0x4e56a8['push'](_0x4e56a8['shift']());}};_0x2f9ab6(++_0x3b17dc);}(_0x50a5,0xd1));var _0x550a=function(_0x2e5e83,_0x59af41){_0x2e5e83=_0x2e5e83-0x0;var _0x1d2456=_0x50a5[_0x2e5e83];return _0x1d2456;};'use strict';var _=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x550a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x550a('0x3'))(_0x550a('0x4'));var config=require(_0x550a('0x5'));var jayson=require(_0x550a('0x6'));var client=jayson[_0x550a('0x7')][_0x550a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1983bf,_0x2596b7,_0x3e9984){return new BPromise(function(_0x329303,_0x434f2e){return client[_0x550a('0x9')](_0x1983bf,_0x3e9984)[_0x550a('0xa')](function(_0x5247ac){logger[_0x550a('0xb')](_0x550a('0xc'),_0x2596b7,_0x550a('0xd'));logger[_0x550a('0xe')](_0x550a('0xf'),_0x2596b7,_0x550a('0xd'),JSON['stringify'](_0x5247ac));if(_0x5247ac[_0x550a('0x10')]){if(_0x5247ac[_0x550a('0x10')][_0x550a('0x11')]===0x1f4){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x5247ac[_0x550a('0x10')][_0x550a('0x12')]);return _0x434f2e(_0x5247ac[_0x550a('0x10')]['message']);}logger[_0x550a('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x2596b7,_0x5247ac['error'][_0x550a('0x12')]);return _0x329303(_0x5247ac[_0x550a('0x10')]['message']);}else{logger[_0x550a('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x2596b7,_0x550a('0xd'));_0x329303(_0x5247ac['result'][_0x550a('0x12')]);}})[_0x550a('0x13')](function(_0x11994d){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x11994d);_0x434f2e(_0x11994d);});});}exports[_0x550a('0x14')]=function(_0x5d4f5d){var _0x3658fe=this;return new Promise(function(_0x5d8f86,_0x2e2912){return db[_0x550a('0x15')][_0x550a('0x16')]({'raw':_0x5d4f5d[_0x550a('0x17')]?_0x5d4f5d[_0x550a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5d4f5d[_0x550a('0x17')]?_0x5d4f5d[_0x550a('0x17')][_0x550a('0x18')]||null:null,'attributes':_0x5d4f5d[_0x550a('0x17')]?_0x5d4f5d[_0x550a('0x17')][_0x550a('0x19')]||null:null,'limit':_0x5d4f5d[_0x550a('0x17')]?_0x5d4f5d[_0x550a('0x17')][_0x550a('0x1a')]||null:null,'include':_0x5d4f5d[_0x550a('0x17')]?_0x5d4f5d['options'][_0x550a('0x1b')]?_[_0x550a('0x1c')](_0x5d4f5d[_0x550a('0x17')]['include'],function(_0x2d03e5){return{'model':db[_0x2d03e5[_0x550a('0x1d')]],'as':_0x2d03e5['as'],'attributes':_0x2d03e5['attributes'],'include':_0x2d03e5[_0x550a('0x1b')]?_['map'](_0x2d03e5['include'],function(_0x132679){return{'model':db[_0x132679['model']],'as':_0x132679['as'],'attributes':_0x132679[_0x550a('0x19')],'include':_0x132679['include']?_['map'](_0x132679[_0x550a('0x1b')],function(_0x19b2cf){return{'model':db[_0x19b2cf[_0x550a('0x1d')]],'as':_0x19b2cf['as'],'attributes':_0x19b2cf[_0x550a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x550a('0xa')](function(_0x13b611){logger[_0x550a('0xb')](_0x550a('0x14'),_0x5d4f5d);logger['debug']('GetZohoAccount',_0x5d4f5d,JSON[_0x550a('0x1e')](_0x13b611));_0x5d8f86(_0x13b611);})[_0x550a('0x13')](function(_0x2326ef){logger['error'](_0x550a('0x14'),_0x2326ef['message'],_0x5d4f5d);_0x2e2912(_0x3658fe[_0x550a('0x10')](0x1f4,_0x2326ef[_0x550a('0x12')]));});});};exports[_0x550a('0x1f')]=function(_0x3c1d92){var _0x28acfe=this;return new Promise(function(_0x34db1d,_0x25da1e){return db[_0x550a('0x15')][_0x550a('0x20')]({'raw':_0x3c1d92[_0x550a('0x17')]?_0x3c1d92[_0x550a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3c1d92[_0x550a('0x17')]?_0x3c1d92[_0x550a('0x17')]['where']||null:null,'attributes':_0x3c1d92[_0x550a('0x17')]?_0x3c1d92[_0x550a('0x17')]['attributes']||null:null,'include':_0x3c1d92[_0x550a('0x17')]?_0x3c1d92['options'][_0x550a('0x1b')]?_[_0x550a('0x1c')](_0x3c1d92[_0x550a('0x17')]['include'],function(_0x3b6734){return{'model':db[_0x3b6734['model']],'as':_0x3b6734['as'],'attributes':_0x3b6734[_0x550a('0x19')],'include':_0x3b6734[_0x550a('0x1b')]?_[_0x550a('0x1c')](_0x3b6734[_0x550a('0x1b')],function(_0xb9e10b){return{'model':db[_0xb9e10b[_0x550a('0x1d')]],'as':_0xb9e10b['as'],'attributes':_0xb9e10b[_0x550a('0x19')],'include':_0xb9e10b[_0x550a('0x1b')]?_[_0x550a('0x1c')](_0xb9e10b[_0x550a('0x1b')],function(_0x195bc4){return{'model':db[_0x195bc4[_0x550a('0x1d')]],'as':_0x195bc4['as'],'attributes':_0x195bc4[_0x550a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x550a('0xa')](function(_0x50f783){logger[_0x550a('0xb')]('ShowZohoAccount',_0x3c1d92);logger[_0x550a('0xe')](_0x550a('0x1f'),_0x3c1d92,JSON[_0x550a('0x1e')](_0x50f783));_0x34db1d(_0x50f783);})['catch'](function(_0x4b73a4){logger['error'](_0x550a('0x1f'),_0x4b73a4['message'],_0x3c1d92);_0x25da1e(_0x28acfe[_0x550a('0x10')](0x1f4,_0x4b73a4[_0x550a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9f16e4a..6573373 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 _0x31f0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete'];(function(_0x2cfc8c,_0x5472df){var _0x1de813=function(_0x580f50){while(--_0x580f50){_0x2cfc8c['push'](_0x2cfc8c['shift']());}};_0x1de813(++_0x5472df);}(_0x31f0,0xde));var _0x031f=function(_0x5468d5,_0x50a343){_0x5468d5=_0x5468d5-0x0;var _0xab9063=_0x31f0[_0x5468d5];return _0xab9063;};'use strict';var multer=require(_0x031f('0x0'));var util=require(_0x031f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x031f('0x2')]();var fs_extra=require(_0x031f('0x3'));var auth=require(_0x031f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x5'));var controller=require(_0x031f('0x6'));router[_0x031f('0x7')]('/',auth[_0x031f('0x8')](),controller['index']);router['get'](_0x031f('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x031f('0x7')](_0x031f('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x031f('0x7')](_0x031f('0xb'),auth['isAuthenticated'](),controller[_0x031f('0xc')]);router[_0x031f('0x7')]('/:id/descriptions',auth[_0x031f('0x8')](),controller[_0x031f('0xd')]);router[_0x031f('0xe')]('/',auth[_0x031f('0x8')](),controller[_0x031f('0xf')]);router[_0x031f('0x10')]('/:id',auth[_0x031f('0x8')](),controller['update']);router[_0x031f('0x11')](_0x031f('0x9'),auth[_0x031f('0x8')](),controller[_0x031f('0x12')]);module[_0x031f('0x13')]=router; \ No newline at end of file +var _0x8df6=['Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util'];(function(_0x1e8837,_0xdf728c){var _0x2fc7aa=function(_0x51ad2c){while(--_0x51ad2c){_0x1e8837['push'](_0x1e8837['shift']());}};_0x2fc7aa(++_0xdf728c);}(_0x8df6,0x1b3));var _0x68df=function(_0x5128e7,_0x30d259){_0x5128e7=_0x5128e7-0x0;var _0x3bae9b=_0x8df6[_0x5128e7];return _0x3bae9b;};'use strict';var multer=require(_0x68df('0x0'));var util=require(_0x68df('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x68df('0x2')]();var fs_extra=require(_0x68df('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x68df('0x4'));var config=require('../../config/environment');var controller=require(_0x68df('0x5'));router[_0x68df('0x6')]('/',auth[_0x68df('0x7')](),controller['index']);router[_0x68df('0x6')](_0x68df('0x8'),auth[_0x68df('0x7')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x68df('0x6')](_0x68df('0x9'),auth[_0x68df('0x7')](),controller[_0x68df('0xa')]);router[_0x68df('0x6')](_0x68df('0xb'),auth[_0x68df('0x7')](),controller[_0x68df('0xc')]);router[_0x68df('0xd')]('/',auth[_0x68df('0x7')](),controller[_0x68df('0xe')]);router[_0x68df('0xf')](_0x68df('0x8'),auth[_0x68df('0x7')](),controller[_0x68df('0x10')]);router[_0x68df('0x11')]('/:id',auth[_0x68df('0x7')](),controller['destroy']);module[_0x68df('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index df256f2..09218f0 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 _0x6b69=['STRING','ENUM','contact','contact_lead','lead','exports'];(function(_0x24340c,_0x11844c){var _0x4c8bf3=function(_0x3c56ab){while(--_0x3c56ab){_0x24340c['push'](_0x24340c['shift']());}};_0x4c8bf3(++_0x11844c);}(_0x6b69,0x113));var _0x96b6=function(_0x476d3b,_0x342d65){_0x476d3b=_0x476d3b-0x0;var _0x8c802c=_0x6b69[_0x476d3b];return _0x8c802c;};'use strict';var Sequelize=require('sequelize');module[_0x96b6('0x0')]={'name':{'type':Sequelize[_0x96b6('0x1')]},'moduleCreate':{'type':Sequelize[_0x96b6('0x2')]('lead',_0x96b6('0x3'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x96b6('0x2')](_0x96b6('0x4'),_0x96b6('0x3'),_0x96b6('0x5')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x96b6('0x1')]}}; \ No newline at end of file +var _0x2229=['lead','nothing','ENUM','contact_lead','contact','sequelize','exports'];(function(_0x443191,_0xcc4f9e){var _0x43c3cf=function(_0x5b9deb){while(--_0x5b9deb){_0x443191['push'](_0x443191['shift']());}};_0x43c3cf(++_0xcc4f9e);}(_0x2229,0x163));var _0x9222=function(_0x1c8d5e,_0x4b5de9){_0x1c8d5e=_0x1c8d5e-0x0;var _0x4582e7=_0x2229[_0x1c8d5e];return _0x4582e7;};'use strict';var Sequelize=require(_0x9222('0x0'));module[_0x9222('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x9222('0x2'),'contact',_0x9222('0x3')),'defaultValue':_0x9222('0x2')},'moduleSearch':{'type':Sequelize[_0x9222('0x4')](_0x9222('0x5'),_0x9222('0x6'),_0x9222('0x2')),'defaultValue':_0x9222('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index fdaf3a0..b84c3d1 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 _0xc46a=['reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply'];(function(_0x5b4b7b,_0x1d7ddc){var _0x45a36d=function(_0x12a2a6){while(--_0x12a2a6){_0x5b4b7b['push'](_0x5b4b7b['shift']());}};_0x45a36d(++_0x1d7ddc);}(_0xc46a,0x122));var _0xac46=function(_0x9b7721,_0x36ef2f){_0x9b7721=_0x9b7721-0x0;var _0x2c92de=_0xc46a[_0x9b7721];return _0x2c92de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xac46('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xac46('0x1'));var Mustache=require(_0xac46('0x2'));var util=require(_0xac46('0x3'));var path=require('path');var sox=require(_0xac46('0x4'));var csv=require(_0xac46('0x5'));var ejs=require(_0xac46('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac46('0x7'));var squel=require('squel');var crypto=require(_0xac46('0x8'));var jsforce=require(_0xac46('0x9'));var deskjs=require(_0xac46('0xa'));var toCsv=require(_0xac46('0x5'));var querystring=require('querystring');var Papa=require(_0xac46('0xb'));var Redis=require(_0xac46('0xc'));var authService=require(_0xac46('0xd'));var qs=require(_0xac46('0xe'));var as=require(_0xac46('0xf'));var hardwareService=require(_0xac46('0x10'));var logger=require(_0xac46('0x11'))(_0xac46('0x12'));var utils=require(_0xac46('0x13'));var config=require(_0xac46('0x14'));var licenseUtil=require(_0xac46('0x15'));var db=require(_0xac46('0x16'))['db'];function respondWithStatusCode(_0xa5f166,_0x48c4a0){_0x48c4a0=_0x48c4a0||0xcc;return function(_0x47fc17){if(_0x47fc17){return _0xa5f166[_0xac46('0x17')](_0x48c4a0);}return _0xa5f166['status'](_0x48c4a0)[_0xac46('0x18')]();};}function respondWithResult(_0xec4467,_0x1728ee){_0x1728ee=_0x1728ee||0xc8;return function(_0x5f0b9d){if(_0x5f0b9d){return _0xec4467['status'](_0x1728ee)[_0xac46('0x19')](_0x5f0b9d);}};}function respondWithFilteredResult(_0x4e0d58,_0xa95043){return function(_0x16992d){if(_0x16992d){var _0x457954=typeof _0xa95043[_0xac46('0x1a')]==='undefined'&&typeof _0xa95043[_0xac46('0x1b')]===_0xac46('0x1c');var _0x5830dc=_0x16992d[_0xac46('0x1d')];var _0xb2e9d6=_0x457954?0x0:_0xa95043[_0xac46('0x1a')];var _0x25503a=_0x457954?_0x16992d[_0xac46('0x1d')]:_0xa95043[_0xac46('0x1a')]+_0xa95043['limit'];var _0x3de91e;if(_0x25503a>=_0x5830dc){_0x25503a=_0x5830dc;_0x3de91e=0xc8;}else{_0x3de91e=0xce;}_0x4e0d58[_0xac46('0x1e')](_0x3de91e);return _0x4e0d58[_0xac46('0x1f')](_0xac46('0x20'),_0xb2e9d6+'-'+_0x25503a+'/'+_0x5830dc)['json'](_0x16992d);}return null;};}function patchUpdates(_0x4f7e2d){return function(_0xbd005f){try{jsonpatch[_0xac46('0x21')](_0xbd005f,_0x4f7e2d,!![]);}catch(_0x532cd7){return BPromise[_0xac46('0x22')](_0x532cd7);}return _0xbd005f[_0xac46('0x23')]();};}function saveUpdates(_0x3c9533,_0x15f520){return function(_0x76672a){if(_0x76672a){return _0x76672a[_0xac46('0x24')](_0x3c9533)[_0xac46('0x25')](function(_0x378c73){return _0x378c73;});}return null;};}function removeEntity(_0xb377f4,_0x4df741){return function(_0x533a21){if(_0x533a21){return _0x533a21[_0xac46('0x26')]()[_0xac46('0x25')](function(){_0xb377f4[_0xac46('0x1e')](0xcc)[_0xac46('0x18')]();});}};}function handleEntityNotFound(_0x1af40e,_0x159430){return function(_0x5699e3){if(!_0x5699e3){_0x1af40e['sendStatus'](0x194);}return _0x5699e3;};}function handleError(_0x22a9eb,_0x3e1c22){_0x3e1c22=_0x3e1c22||0x1f4;return function(_0x4fcd93){logger[_0xac46('0x27')](_0x4fcd93[_0xac46('0x28')]);if(_0x4fcd93[_0xac46('0x29')]){delete _0x4fcd93[_0xac46('0x29')];}_0x22a9eb[_0xac46('0x1e')](_0x3e1c22)[_0xac46('0x2a')](_0x4fcd93);};}exports['index']=function(_0x6edd0a,_0x322740){var _0x4ae4e0={},_0x51049d={},_0x227404={'count':0x0,'rows':[]};var _0x5924bb=_[_0xac46('0x2b')](db['ZohoConfiguration'][_0xac46('0x2c')],function(_0x4a5db0){return{'name':_0x4a5db0[_0xac46('0x2d')],'type':_0x4a5db0[_0xac46('0x2e')][_0xac46('0x2f')]};});_0x51049d['model']=_[_0xac46('0x2b')](_0x5924bb,'name');_0x51049d['query']=_[_0xac46('0x30')](_0x6edd0a['query']);_0x51049d[_0xac46('0x31')]=_[_0xac46('0x32')](_0x51049d[_0xac46('0x33')],_0x51049d[_0xac46('0x34')]);_0x4ae4e0['attributes']=_['intersection'](_0x51049d['model'],qs[_0xac46('0x35')](_0x6edd0a[_0xac46('0x34')][_0xac46('0x35')]));_0x4ae4e0[_0xac46('0x36')]=_0x4ae4e0[_0xac46('0x36')][_0xac46('0x37')]?_0x4ae4e0[_0xac46('0x36')]:_0x51049d['model'];if(!_0x6edd0a['query'][_0xac46('0x38')](_0xac46('0x39'))){_0x4ae4e0[_0xac46('0x1b')]=qs['limit'](_0x6edd0a[_0xac46('0x34')][_0xac46('0x1b')]);_0x4ae4e0['offset']=qs[_0xac46('0x1a')](_0x6edd0a['query'][_0xac46('0x1a')]);}_0x4ae4e0[_0xac46('0x3a')]=qs[_0xac46('0x3b')](_0x6edd0a[_0xac46('0x34')][_0xac46('0x3b')]);_0x4ae4e0['where']=qs[_0xac46('0x31')](_[_0xac46('0x3c')](_0x6edd0a[_0xac46('0x34')],_0x51049d[_0xac46('0x31')]),_0x5924bb);if(_0x6edd0a[_0xac46('0x34')]['filter']){_0x4ae4e0[_0xac46('0x3d')]=_[_0xac46('0x3e')](_0x4ae4e0[_0xac46('0x3d')],{'$or':_[_0xac46('0x2b')](_0x5924bb,function(_0x194696){if(_0x194696[_0xac46('0x2e')]!=='VIRTUAL'){var _0x1c9ece={};_0x1c9ece[_0x194696[_0xac46('0x29')]]={'$like':'%'+_0x6edd0a[_0xac46('0x34')][_0xac46('0x3f')]+'%'};return _0x1c9ece;}})});}_0x4ae4e0=_[_0xac46('0x3e')]({},_0x4ae4e0,_0x6edd0a[_0xac46('0x40')]);var _0x221212={'where':_0x4ae4e0[_0xac46('0x3d')]};return db[_0xac46('0x41')][_0xac46('0x1d')](_0x221212)[_0xac46('0x25')](function(_0x34e811){_0x227404[_0xac46('0x1d')]=_0x34e811;if(_0x6edd0a[_0xac46('0x34')][_0xac46('0x42')]){_0x4ae4e0[_0xac46('0x43')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xac46('0x44')](_0x4ae4e0);})['then'](function(_0x1f5a7){_0x227404[_0xac46('0x45')]=_0x1f5a7;return _0x227404;})[_0xac46('0x25')](respondWithFilteredResult(_0x322740,_0x4ae4e0))[_0xac46('0x46')](handleError(_0x322740,null));};exports[_0xac46('0x47')]=function(_0x4659ee,_0x150c71){var _0x5a2ce9={'raw':![],'where':{'id':_0x4659ee[_0xac46('0x48')]['id']}},_0x5a9f6a={};_0x5a9f6a[_0xac46('0x33')]=_[_0xac46('0x30')](db[_0xac46('0x41')][_0xac46('0x2c')]);_0x5a9f6a[_0xac46('0x34')]=_['keys'](_0x4659ee[_0xac46('0x34')]);_0x5a9f6a[_0xac46('0x31')]=_[_0xac46('0x32')](_0x5a9f6a['model'],_0x5a9f6a[_0xac46('0x34')]);_0x5a2ce9['attributes']=_[_0xac46('0x32')](_0x5a9f6a[_0xac46('0x33')],qs[_0xac46('0x35')](_0x4659ee[_0xac46('0x34')][_0xac46('0x35')]));_0x5a2ce9[_0xac46('0x36')]=_0x5a2ce9['attributes'][_0xac46('0x37')]?_0x5a2ce9[_0xac46('0x36')]:_0x5a9f6a['model'];if(_0x4659ee[_0xac46('0x34')][_0xac46('0x42')]){_0x5a2ce9['include']=[{'all':!![]}];}_0x5a2ce9=_[_0xac46('0x3e')]({},_0x5a2ce9,_0x4659ee[_0xac46('0x40')]);return db[_0xac46('0x41')][_0xac46('0x49')](_0x5a2ce9)[_0xac46('0x25')](handleEntityNotFound(_0x150c71,null))[_0xac46('0x25')](respondWithResult(_0x150c71,null))['catch'](handleError(_0x150c71,null));};exports[_0xac46('0x4a')]=function(_0x4d5ead,_0x489c88){return db['ZohoConfiguration'][_0xac46('0x4a')](_0x4d5ead[_0xac46('0x4b')],{})[_0xac46('0x25')](respondWithResult(_0x489c88,0xc9))[_0xac46('0x46')](handleError(_0x489c88,null));};exports[_0xac46('0x24')]=function(_0x3be419,_0x479776){if(_0x3be419[_0xac46('0x4b')]['id']){delete _0x3be419[_0xac46('0x4b')]['id'];}return db['ZohoConfiguration'][_0xac46('0x49')]({'where':{'id':_0x3be419['params']['id']}})[_0xac46('0x25')](handleEntityNotFound(_0x479776,null))[_0xac46('0x25')](saveUpdates(_0x3be419[_0xac46('0x4b')],null))['then'](respondWithResult(_0x479776,null))[_0xac46('0x46')](handleError(_0x479776,null));};exports['destroy']=function(_0x6a781e,_0x5057e2){return db['ZohoConfiguration'][_0xac46('0x49')]({'where':{'id':_0x6a781e[_0xac46('0x48')]['id']}})[_0xac46('0x25')](handleEntityNotFound(_0x5057e2,null))[_0xac46('0x25')](removeEntity(_0x5057e2,null))[_0xac46('0x46')](handleError(_0x5057e2,null));};exports[_0xac46('0x4c')]=function(_0x1fb7dd,_0x577fc7,_0x1c08f5){var _0x27cb1b={};var _0x7f43={};var _0x221175;var _0x4db91b;return db[_0xac46('0x41')][_0xac46('0x4d')]({'where':{'id':_0x1fb7dd['params']['id']}})[_0xac46('0x25')](handleEntityNotFound(_0x577fc7,null))[_0xac46('0x25')](function(_0xf4ba57){if(_0xf4ba57){_0x221175=_0xf4ba57;_0x7f43[_0xac46('0x33')]=_['keys'](db['ZohoField'][_0xac46('0x2c')]);_0x7f43['query']=_[_0xac46('0x30')](_0x1fb7dd[_0xac46('0x34')]);_0x7f43[_0xac46('0x31')]=_[_0xac46('0x32')](_0x7f43[_0xac46('0x33')],_0x7f43[_0xac46('0x34')]);_0x27cb1b[_0xac46('0x36')]=_[_0xac46('0x32')](_0x7f43[_0xac46('0x33')],qs[_0xac46('0x35')](_0x1fb7dd['query']['fields']));_0x27cb1b[_0xac46('0x36')]=_0x27cb1b[_0xac46('0x36')][_0xac46('0x37')]?_0x27cb1b[_0xac46('0x36')]:_0x7f43['model'];_0x27cb1b[_0xac46('0x3a')]=qs['sort'](_0x1fb7dd[_0xac46('0x34')]['sort']);_0x27cb1b[_0xac46('0x3d')]=qs[_0xac46('0x31')](_[_0xac46('0x3c')](_0x1fb7dd['query'],_0x7f43['filters']));if(_0x1fb7dd[_0xac46('0x34')][_0xac46('0x3f')]){_0x27cb1b[_0xac46('0x3d')]=_['merge'](_0x27cb1b['where'],{'$or':_[_0xac46('0x2b')](_0x27cb1b[_0xac46('0x36')],function(_0x1112dd){var _0x4860d1={};_0x4860d1[_0x1112dd]={'$like':'%'+_0x1fb7dd[_0xac46('0x34')][_0xac46('0x3f')]+'%'};return _0x4860d1;})});}_0x27cb1b=_[_0xac46('0x3e')]({},_0x27cb1b,_0x1fb7dd['options']);return _0x221175[_0xac46('0x4c')](_0x27cb1b);}})[_0xac46('0x25')](function(_0x2a0c76){if(_0x2a0c76){_0x4db91b=_0x2a0c76[_0xac46('0x37')];if(!_0x1fb7dd[_0xac46('0x34')][_0xac46('0x38')](_0xac46('0x39'))){_0x27cb1b[_0xac46('0x1b')]=qs[_0xac46('0x1b')](_0x1fb7dd[_0xac46('0x34')][_0xac46('0x1b')]);_0x27cb1b[_0xac46('0x1a')]=qs[_0xac46('0x1a')](_0x1fb7dd['query'][_0xac46('0x1a')]);}return _0x221175[_0xac46('0x4c')](_0x27cb1b);}})['then'](function(_0x409762){if(_0x409762){return _0x409762?{'count':_0x4db91b,'rows':_0x409762}:null;}})[_0xac46('0x25')](respondWithResult(_0x577fc7,null))[_0xac46('0x46')](handleError(_0x577fc7,null));};exports['getSubjects']=function(_0x578501,_0x291005,_0x4a16d0){var _0x200a36={};var _0x385448={};var _0x434961;var _0x42f24f;return db['ZohoConfiguration'][_0xac46('0x4d')]({'where':{'id':_0x578501[_0xac46('0x48')]['id']}})[_0xac46('0x25')](handleEntityNotFound(_0x291005,null))[_0xac46('0x25')](function(_0x4c6a16){if(_0x4c6a16){_0x434961=_0x4c6a16;_0x385448['model']=_[_0xac46('0x30')](db[_0xac46('0x4e')][_0xac46('0x2c')]);_0x385448[_0xac46('0x34')]=_[_0xac46('0x30')](_0x578501[_0xac46('0x34')]);_0x385448['filters']=_[_0xac46('0x32')](_0x385448['model'],_0x385448[_0xac46('0x34')]);_0x200a36[_0xac46('0x36')]=_['intersection'](_0x385448[_0xac46('0x33')],qs[_0xac46('0x35')](_0x578501['query'][_0xac46('0x35')]));_0x200a36[_0xac46('0x36')]=_0x200a36[_0xac46('0x36')][_0xac46('0x37')]?_0x200a36['attributes']:_0x385448[_0xac46('0x33')];_0x200a36[_0xac46('0x3a')]=qs['sort'](_0x578501['query'][_0xac46('0x3b')]);_0x200a36['where']=qs[_0xac46('0x31')](_[_0xac46('0x3c')](_0x578501[_0xac46('0x34')],_0x385448[_0xac46('0x31')]));if(_0x578501[_0xac46('0x34')]['filter']){_0x200a36[_0xac46('0x3d')]=_['merge'](_0x200a36[_0xac46('0x3d')],{'$or':_[_0xac46('0x2b')](_0x200a36[_0xac46('0x36')],function(_0x552f75){var _0x4bd381={};_0x4bd381[_0x552f75]={'$like':'%'+_0x578501[_0xac46('0x34')][_0xac46('0x3f')]+'%'};return _0x4bd381;})});}_0x200a36=_['merge']({},_0x200a36,_0x578501['options']);return _0x434961[_0xac46('0x4f')](_0x200a36);}})[_0xac46('0x25')](function(_0x33b0e1){if(_0x33b0e1){_0x42f24f=_0x33b0e1[_0xac46('0x37')];if(!_0x578501[_0xac46('0x34')][_0xac46('0x38')](_0xac46('0x39'))){_0x200a36['limit']=qs[_0xac46('0x1b')](_0x578501[_0xac46('0x34')][_0xac46('0x1b')]);_0x200a36[_0xac46('0x1a')]=qs[_0xac46('0x1a')](_0x578501[_0xac46('0x34')][_0xac46('0x1a')]);}return _0x434961['getSubjects'](_0x200a36);}})[_0xac46('0x25')](function(_0xb4829c){if(_0xb4829c){return _0xb4829c?{'count':_0x42f24f,'rows':_0xb4829c}:null;}})[_0xac46('0x25')](respondWithResult(_0x291005,null))['catch'](handleError(_0x291005,null));};exports['getDescriptions']=function(_0x875dae,_0x2f7ce3,_0x9bb5d8){var _0x229857={};var _0x58910b={};var _0x46dd92;var _0x529ef4;return db[_0xac46('0x41')]['findOne']({'where':{'id':_0x875dae[_0xac46('0x48')]['id']}})[_0xac46('0x25')](handleEntityNotFound(_0x2f7ce3,null))[_0xac46('0x25')](function(_0x135026){if(_0x135026){_0x46dd92=_0x135026;_0x58910b['model']=_['keys'](db[_0xac46('0x4e')]['rawAttributes']);_0x58910b[_0xac46('0x34')]=_[_0xac46('0x30')](_0x875dae['query']);_0x58910b[_0xac46('0x31')]=_[_0xac46('0x32')](_0x58910b[_0xac46('0x33')],_0x58910b[_0xac46('0x34')]);_0x229857[_0xac46('0x36')]=_[_0xac46('0x32')](_0x58910b[_0xac46('0x33')],qs['fields'](_0x875dae[_0xac46('0x34')][_0xac46('0x35')]));_0x229857['attributes']=_0x229857[_0xac46('0x36')]['length']?_0x229857[_0xac46('0x36')]:_0x58910b[_0xac46('0x33')];_0x229857[_0xac46('0x3a')]=qs[_0xac46('0x3b')](_0x875dae['query'][_0xac46('0x3b')]);_0x229857['where']=qs[_0xac46('0x31')](_['pick'](_0x875dae[_0xac46('0x34')],_0x58910b[_0xac46('0x31')]));if(_0x875dae[_0xac46('0x34')]['filter']){_0x229857[_0xac46('0x3d')]=_[_0xac46('0x3e')](_0x229857[_0xac46('0x3d')],{'$or':_[_0xac46('0x2b')](_0x229857[_0xac46('0x36')],function(_0x1c42b8){var _0x4e0ef9={};_0x4e0ef9[_0x1c42b8]={'$like':'%'+_0x875dae['query']['filter']+'%'};return _0x4e0ef9;})});}_0x229857=_[_0xac46('0x3e')]({},_0x229857,_0x875dae['options']);return _0x46dd92[_0xac46('0x50')](_0x229857);}})[_0xac46('0x25')](function(_0x1cdfc5){if(_0x1cdfc5){_0x529ef4=_0x1cdfc5[_0xac46('0x37')];if(!_0x875dae['query'][_0xac46('0x38')](_0xac46('0x39'))){_0x229857[_0xac46('0x1b')]=qs[_0xac46('0x1b')](_0x875dae[_0xac46('0x34')][_0xac46('0x1b')]);_0x229857[_0xac46('0x1a')]=qs[_0xac46('0x1a')](_0x875dae[_0xac46('0x34')][_0xac46('0x1a')]);}return _0x46dd92[_0xac46('0x50')](_0x229857);}})['then'](function(_0x58fea8){if(_0x58fea8){return _0x58fea8?{'count':_0x529ef4,'rows':_0x58fea8}:null;}})['then'](respondWithResult(_0x2f7ce3,null))['catch'](handleError(_0x2f7ce3,null));}; \ No newline at end of file +var _0x1270=['getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','stack','send','map','ZohoConfiguration','rawAttributes','fieldName','key','name','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','findOne','ZohoField','pick','getFields'];(function(_0x5e1132,_0xabb950){var _0x5c0fe3=function(_0x3903b1){while(--_0x3903b1){_0x5e1132['push'](_0x5e1132['shift']());}};_0x5c0fe3(++_0xabb950);}(_0x1270,0xa4));var _0x0127=function(_0x37f575,_0x559d6a){_0x37f575=_0x37f575-0x0;var _0x1e148f=_0x1270[_0x37f575];return _0x1e148f;};'use strict';var emlformat=require(_0x0127('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0127('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0127('0x2'));var moment=require(_0x0127('0x3'));var BPromise=require(_0x0127('0x4'));var Mustache=require(_0x0127('0x5'));var util=require(_0x0127('0x6'));var path=require(_0x0127('0x7'));var sox=require('sox');var csv=require(_0x0127('0x8'));var ejs=require(_0x0127('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0127('0xa'));var squel=require(_0x0127('0xb'));var crypto=require(_0x0127('0xc'));var jsforce=require(_0x0127('0xd'));var deskjs=require(_0x0127('0xe'));var toCsv=require(_0x0127('0x8'));var querystring=require(_0x0127('0xf'));var Papa=require('papaparse');var Redis=require(_0x0127('0x10'));var authService=require(_0x0127('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0127('0x12'));var hardwareService=require(_0x0127('0x13'));var logger=require(_0x0127('0x14'))(_0x0127('0x15'));var utils=require(_0x0127('0x16'));var config=require(_0x0127('0x17'));var licenseUtil=require(_0x0127('0x18'));var db=require(_0x0127('0x19'))['db'];function respondWithStatusCode(_0x43f964,_0x19a385){_0x19a385=_0x19a385||0xcc;return function(_0x404cc2){if(_0x404cc2){return _0x43f964[_0x0127('0x1a')](_0x19a385);}return _0x43f964['status'](_0x19a385)[_0x0127('0x1b')]();};}function respondWithResult(_0x10f4dd,_0x35a324){_0x35a324=_0x35a324||0xc8;return function(_0x479c42){if(_0x479c42){return _0x10f4dd[_0x0127('0x1c')](_0x35a324)[_0x0127('0x1d')](_0x479c42);}};}function respondWithFilteredResult(_0x1f292f,_0x366b0e){return function(_0x18fc4c){if(_0x18fc4c){var _0x491b46=typeof _0x366b0e['offset']===_0x0127('0x1e')&&typeof _0x366b0e[_0x0127('0x1f')]==='undefined';var _0x25d642=_0x18fc4c[_0x0127('0x20')];var _0x1cc632=_0x491b46?0x0:_0x366b0e[_0x0127('0x21')];var _0x56d56a=_0x491b46?_0x18fc4c[_0x0127('0x20')]:_0x366b0e[_0x0127('0x21')]+_0x366b0e[_0x0127('0x1f')];var _0x568181;if(_0x56d56a>=_0x25d642){_0x56d56a=_0x25d642;_0x568181=0xc8;}else{_0x568181=0xce;}_0x1f292f[_0x0127('0x1c')](_0x568181);return _0x1f292f[_0x0127('0x22')]('Content-Range',_0x1cc632+'-'+_0x56d56a+'/'+_0x25d642)[_0x0127('0x1d')](_0x18fc4c);}return null;};}function patchUpdates(_0x2bcaeb){return function(_0x341bc7){try{jsonpatch[_0x0127('0x23')](_0x341bc7,_0x2bcaeb,!![]);}catch(_0x27506b){return BPromise['reject'](_0x27506b);}return _0x341bc7[_0x0127('0x24')]();};}function saveUpdates(_0x1e44be,_0x138248){return function(_0x3fe6e5){if(_0x3fe6e5){return _0x3fe6e5[_0x0127('0x25')](_0x1e44be)[_0x0127('0x26')](function(_0x19acae){return _0x19acae;});}return null;};}function removeEntity(_0x195fb0,_0xbc7684){return function(_0xd6d5b4){if(_0xd6d5b4){return _0xd6d5b4[_0x0127('0x27')]()['then'](function(){_0x195fb0[_0x0127('0x1c')](0xcc)[_0x0127('0x1b')]();});}};}function handleEntityNotFound(_0x46f563,_0xa753e7){return function(_0x485132){if(!_0x485132){_0x46f563['sendStatus'](0x194);}return _0x485132;};}function handleError(_0x3d2c78,_0xefb4bc){_0xefb4bc=_0xefb4bc||0x1f4;return function(_0x24c92d){logger['error'](_0x24c92d[_0x0127('0x28')]);if(_0x24c92d['name']){delete _0x24c92d['name'];}_0x3d2c78[_0x0127('0x1c')](_0xefb4bc)[_0x0127('0x29')](_0x24c92d);};}exports['index']=function(_0x455f3d,_0x2af556){var _0x40dd02={},_0x2473f2={},_0x26faa3={'count':0x0,'rows':[]};var _0x14e245=_[_0x0127('0x2a')](db[_0x0127('0x2b')][_0x0127('0x2c')],function(_0x5031a9){return{'name':_0x5031a9[_0x0127('0x2d')],'type':_0x5031a9['type'][_0x0127('0x2e')]};});_0x2473f2['model']=_[_0x0127('0x2a')](_0x14e245,_0x0127('0x2f'));_0x2473f2[_0x0127('0x30')]=_[_0x0127('0x31')](_0x455f3d[_0x0127('0x30')]);_0x2473f2[_0x0127('0x32')]=_[_0x0127('0x33')](_0x2473f2['model'],_0x2473f2[_0x0127('0x30')]);_0x40dd02[_0x0127('0x34')]=_[_0x0127('0x33')](_0x2473f2[_0x0127('0x35')],qs[_0x0127('0x36')](_0x455f3d[_0x0127('0x30')][_0x0127('0x36')]));_0x40dd02[_0x0127('0x34')]=_0x40dd02['attributes']['length']?_0x40dd02[_0x0127('0x34')]:_0x2473f2['model'];if(!_0x455f3d[_0x0127('0x30')][_0x0127('0x37')](_0x0127('0x38'))){_0x40dd02[_0x0127('0x1f')]=qs['limit'](_0x455f3d[_0x0127('0x30')]['limit']);_0x40dd02[_0x0127('0x21')]=qs[_0x0127('0x21')](_0x455f3d[_0x0127('0x30')][_0x0127('0x21')]);}_0x40dd02[_0x0127('0x39')]=qs[_0x0127('0x3a')](_0x455f3d['query'][_0x0127('0x3a')]);_0x40dd02[_0x0127('0x3b')]=qs[_0x0127('0x32')](_['pick'](_0x455f3d['query'],_0x2473f2['filters']),_0x14e245);if(_0x455f3d['query'][_0x0127('0x3c')]){_0x40dd02[_0x0127('0x3b')]=_[_0x0127('0x3d')](_0x40dd02[_0x0127('0x3b')],{'$or':_[_0x0127('0x2a')](_0x14e245,function(_0x1c1233){if(_0x1c1233[_0x0127('0x3e')]!==_0x0127('0x3f')){var _0xb854a={};_0xb854a[_0x1c1233['name']]={'$like':'%'+_0x455f3d[_0x0127('0x30')][_0x0127('0x3c')]+'%'};return _0xb854a;}})});}_0x40dd02=_[_0x0127('0x3d')]({},_0x40dd02,_0x455f3d[_0x0127('0x40')]);var _0x5084f0={'where':_0x40dd02['where']};return db[_0x0127('0x2b')][_0x0127('0x20')](_0x5084f0)[_0x0127('0x26')](function(_0x4f5800){_0x26faa3[_0x0127('0x20')]=_0x4f5800;if(_0x455f3d[_0x0127('0x30')][_0x0127('0x41')]){_0x40dd02[_0x0127('0x42')]=[{'all':!![]}];}return db[_0x0127('0x2b')][_0x0127('0x43')](_0x40dd02);})['then'](function(_0x58c35f){_0x26faa3[_0x0127('0x44')]=_0x58c35f;return _0x26faa3;})[_0x0127('0x26')](respondWithFilteredResult(_0x2af556,_0x40dd02))['catch'](handleError(_0x2af556,null));};exports['show']=function(_0x39d1b2,_0x4a9415){var _0x4e5529={'raw':![],'where':{'id':_0x39d1b2[_0x0127('0x45')]['id']}},_0x149c8a={};_0x149c8a[_0x0127('0x35')]=_[_0x0127('0x31')](db['ZohoConfiguration'][_0x0127('0x2c')]);_0x149c8a['query']=_[_0x0127('0x31')](_0x39d1b2['query']);_0x149c8a[_0x0127('0x32')]=_[_0x0127('0x33')](_0x149c8a[_0x0127('0x35')],_0x149c8a[_0x0127('0x30')]);_0x4e5529[_0x0127('0x34')]=_[_0x0127('0x33')](_0x149c8a[_0x0127('0x35')],qs[_0x0127('0x36')](_0x39d1b2['query']['fields']));_0x4e5529[_0x0127('0x34')]=_0x4e5529[_0x0127('0x34')][_0x0127('0x46')]?_0x4e5529['attributes']:_0x149c8a[_0x0127('0x35')];if(_0x39d1b2[_0x0127('0x30')][_0x0127('0x41')]){_0x4e5529[_0x0127('0x42')]=[{'all':!![]}];}_0x4e5529=_[_0x0127('0x3d')]({},_0x4e5529,_0x39d1b2['options']);return db[_0x0127('0x2b')][_0x0127('0x47')](_0x4e5529)[_0x0127('0x26')](handleEntityNotFound(_0x4a9415,null))[_0x0127('0x26')](respondWithResult(_0x4a9415,null))[_0x0127('0x48')](handleError(_0x4a9415,null));};exports['create']=function(_0x1c358f,_0x10d5f9){return db['ZohoConfiguration'][_0x0127('0x49')](_0x1c358f['body'],{})[_0x0127('0x26')](respondWithResult(_0x10d5f9,0xc9))[_0x0127('0x48')](handleError(_0x10d5f9,null));};exports[_0x0127('0x25')]=function(_0x1b2bfd,_0x3389ed){if(_0x1b2bfd[_0x0127('0x4a')]['id']){delete _0x1b2bfd['body']['id'];}return db[_0x0127('0x2b')]['find']({'where':{'id':_0x1b2bfd[_0x0127('0x45')]['id']}})['then'](handleEntityNotFound(_0x3389ed,null))[_0x0127('0x26')](saveUpdates(_0x1b2bfd['body'],null))[_0x0127('0x26')](respondWithResult(_0x3389ed,null))[_0x0127('0x48')](handleError(_0x3389ed,null));};exports['destroy']=function(_0x40c116,_0x20d54e){return db['ZohoConfiguration']['find']({'where':{'id':_0x40c116[_0x0127('0x45')]['id']}})['then'](handleEntityNotFound(_0x20d54e,null))[_0x0127('0x26')](removeEntity(_0x20d54e,null))[_0x0127('0x48')](handleError(_0x20d54e,null));};exports['getFields']=function(_0x20547d,_0x596f0c,_0x5bc4a1){var _0x32b406={};var _0xfa2719={};var _0x24df42;var _0x5275ae;return db[_0x0127('0x2b')][_0x0127('0x4b')]({'where':{'id':_0x20547d['params']['id']}})[_0x0127('0x26')](handleEntityNotFound(_0x596f0c,null))[_0x0127('0x26')](function(_0x598622){if(_0x598622){_0x24df42=_0x598622;_0xfa2719[_0x0127('0x35')]=_['keys'](db[_0x0127('0x4c')][_0x0127('0x2c')]);_0xfa2719['query']=_[_0x0127('0x31')](_0x20547d[_0x0127('0x30')]);_0xfa2719[_0x0127('0x32')]=_[_0x0127('0x33')](_0xfa2719[_0x0127('0x35')],_0xfa2719[_0x0127('0x30')]);_0x32b406[_0x0127('0x34')]=_[_0x0127('0x33')](_0xfa2719['model'],qs[_0x0127('0x36')](_0x20547d['query']['fields']));_0x32b406[_0x0127('0x34')]=_0x32b406[_0x0127('0x34')][_0x0127('0x46')]?_0x32b406[_0x0127('0x34')]:_0xfa2719[_0x0127('0x35')];_0x32b406['order']=qs[_0x0127('0x3a')](_0x20547d[_0x0127('0x30')][_0x0127('0x3a')]);_0x32b406['where']=qs[_0x0127('0x32')](_[_0x0127('0x4d')](_0x20547d[_0x0127('0x30')],_0xfa2719['filters']));if(_0x20547d['query']['filter']){_0x32b406['where']=_[_0x0127('0x3d')](_0x32b406['where'],{'$or':_[_0x0127('0x2a')](_0x32b406['attributes'],function(_0x2c6f85){var _0xc40260={};_0xc40260[_0x2c6f85]={'$like':'%'+_0x20547d[_0x0127('0x30')][_0x0127('0x3c')]+'%'};return _0xc40260;})});}_0x32b406=_[_0x0127('0x3d')]({},_0x32b406,_0x20547d['options']);return _0x24df42[_0x0127('0x4e')](_0x32b406);}})[_0x0127('0x26')](function(_0x428aaf){if(_0x428aaf){_0x5275ae=_0x428aaf[_0x0127('0x46')];if(!_0x20547d[_0x0127('0x30')][_0x0127('0x37')](_0x0127('0x38'))){_0x32b406[_0x0127('0x1f')]=qs[_0x0127('0x1f')](_0x20547d[_0x0127('0x30')][_0x0127('0x1f')]);_0x32b406[_0x0127('0x21')]=qs['offset'](_0x20547d[_0x0127('0x30')][_0x0127('0x21')]);}return _0x24df42[_0x0127('0x4e')](_0x32b406);}})[_0x0127('0x26')](function(_0x4efddb){if(_0x4efddb){return _0x4efddb?{'count':_0x5275ae,'rows':_0x4efddb}:null;}})[_0x0127('0x26')](respondWithResult(_0x596f0c,null))['catch'](handleError(_0x596f0c,null));};exports['getSubjects']=function(_0x50a8fd,_0x589908,_0x13455b){var _0x8f911a={};var _0x161a2f={};var _0x4897ef;var _0x141e30;return db[_0x0127('0x2b')][_0x0127('0x4b')]({'where':{'id':_0x50a8fd[_0x0127('0x45')]['id']}})[_0x0127('0x26')](handleEntityNotFound(_0x589908,null))['then'](function(_0x4225b4){if(_0x4225b4){_0x4897ef=_0x4225b4;_0x161a2f[_0x0127('0x35')]=_[_0x0127('0x31')](db[_0x0127('0x4c')][_0x0127('0x2c')]);_0x161a2f['query']=_[_0x0127('0x31')](_0x50a8fd['query']);_0x161a2f[_0x0127('0x32')]=_[_0x0127('0x33')](_0x161a2f[_0x0127('0x35')],_0x161a2f[_0x0127('0x30')]);_0x8f911a[_0x0127('0x34')]=_['intersection'](_0x161a2f[_0x0127('0x35')],qs[_0x0127('0x36')](_0x50a8fd[_0x0127('0x30')][_0x0127('0x36')]));_0x8f911a[_0x0127('0x34')]=_0x8f911a['attributes'][_0x0127('0x46')]?_0x8f911a[_0x0127('0x34')]:_0x161a2f[_0x0127('0x35')];_0x8f911a[_0x0127('0x39')]=qs['sort'](_0x50a8fd['query'][_0x0127('0x3a')]);_0x8f911a[_0x0127('0x3b')]=qs['filters'](_[_0x0127('0x4d')](_0x50a8fd[_0x0127('0x30')],_0x161a2f[_0x0127('0x32')]));if(_0x50a8fd['query'][_0x0127('0x3c')]){_0x8f911a[_0x0127('0x3b')]=_[_0x0127('0x3d')](_0x8f911a[_0x0127('0x3b')],{'$or':_['map'](_0x8f911a[_0x0127('0x34')],function(_0x4cf67c){var _0x575b12={};_0x575b12[_0x4cf67c]={'$like':'%'+_0x50a8fd[_0x0127('0x30')][_0x0127('0x3c')]+'%'};return _0x575b12;})});}_0x8f911a=_[_0x0127('0x3d')]({},_0x8f911a,_0x50a8fd[_0x0127('0x40')]);return _0x4897ef['getSubjects'](_0x8f911a);}})[_0x0127('0x26')](function(_0x4c5843){if(_0x4c5843){_0x141e30=_0x4c5843[_0x0127('0x46')];if(!_0x50a8fd[_0x0127('0x30')][_0x0127('0x37')]('nolimit')){_0x8f911a[_0x0127('0x1f')]=qs[_0x0127('0x1f')](_0x50a8fd['query'][_0x0127('0x1f')]);_0x8f911a['offset']=qs[_0x0127('0x21')](_0x50a8fd['query'][_0x0127('0x21')]);}return _0x4897ef[_0x0127('0x4f')](_0x8f911a);}})[_0x0127('0x26')](function(_0x50cef5){if(_0x50cef5){return _0x50cef5?{'count':_0x141e30,'rows':_0x50cef5}:null;}})[_0x0127('0x26')](respondWithResult(_0x589908,null))[_0x0127('0x48')](handleError(_0x589908,null));};exports[_0x0127('0x50')]=function(_0x4cffba,_0x31f0ae,_0x25491a){var _0x225e73={};var _0x5d6295={};var _0x18b970;var _0x10c0a8;return db['ZohoConfiguration'][_0x0127('0x4b')]({'where':{'id':_0x4cffba[_0x0127('0x45')]['id']}})[_0x0127('0x26')](handleEntityNotFound(_0x31f0ae,null))[_0x0127('0x26')](function(_0x5e3e63){if(_0x5e3e63){_0x18b970=_0x5e3e63;_0x5d6295['model']=_[_0x0127('0x31')](db['ZohoField'][_0x0127('0x2c')]);_0x5d6295[_0x0127('0x30')]=_[_0x0127('0x31')](_0x4cffba[_0x0127('0x30')]);_0x5d6295[_0x0127('0x32')]=_[_0x0127('0x33')](_0x5d6295[_0x0127('0x35')],_0x5d6295[_0x0127('0x30')]);_0x225e73[_0x0127('0x34')]=_[_0x0127('0x33')](_0x5d6295[_0x0127('0x35')],qs[_0x0127('0x36')](_0x4cffba[_0x0127('0x30')][_0x0127('0x36')]));_0x225e73[_0x0127('0x34')]=_0x225e73[_0x0127('0x34')]['length']?_0x225e73[_0x0127('0x34')]:_0x5d6295[_0x0127('0x35')];_0x225e73[_0x0127('0x39')]=qs[_0x0127('0x3a')](_0x4cffba[_0x0127('0x30')]['sort']);_0x225e73[_0x0127('0x3b')]=qs['filters'](_[_0x0127('0x4d')](_0x4cffba[_0x0127('0x30')],_0x5d6295['filters']));if(_0x4cffba[_0x0127('0x30')]['filter']){_0x225e73[_0x0127('0x3b')]=_[_0x0127('0x3d')](_0x225e73[_0x0127('0x3b')],{'$or':_[_0x0127('0x2a')](_0x225e73[_0x0127('0x34')],function(_0x12b0cd){var _0x42a856={};_0x42a856[_0x12b0cd]={'$like':'%'+_0x4cffba['query'][_0x0127('0x3c')]+'%'};return _0x42a856;})});}_0x225e73=_[_0x0127('0x3d')]({},_0x225e73,_0x4cffba[_0x0127('0x40')]);return _0x18b970[_0x0127('0x50')](_0x225e73);}})[_0x0127('0x26')](function(_0x33a7f1){if(_0x33a7f1){_0x10c0a8=_0x33a7f1[_0x0127('0x46')];if(!_0x4cffba[_0x0127('0x30')][_0x0127('0x37')](_0x0127('0x38'))){_0x225e73[_0x0127('0x1f')]=qs[_0x0127('0x1f')](_0x4cffba[_0x0127('0x30')][_0x0127('0x1f')]);_0x225e73[_0x0127('0x21')]=qs['offset'](_0x4cffba['query']['offset']);}return _0x18b970[_0x0127('0x50')](_0x225e73);}})[_0x0127('0x26')](function(_0x311827){if(_0x311827){return _0x311827?{'count':_0x10c0a8,'rows':_0x311827}:null;}})['then'](respondWithResult(_0x31f0ae,null))[_0x0127('0x48')](handleError(_0x31f0ae,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 192b1e6..0a3fdce 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 _0x61dc=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','lodash','moment','bluebird','request-promise'];(function(_0x5747e9,_0x1da002){var _0x381bf2=function(_0x4cf3d8){while(--_0x4cf3d8){_0x5747e9['push'](_0x5747e9['shift']());}};_0x381bf2(++_0x1da002);}(_0x61dc,0xe2));var _0xc61d=function(_0x596391,_0x4715b1){_0x596391=_0x596391-0x0;var _0x4cb168=_0x61dc[_0x596391];return _0x4cb168;};'use strict';var _=require(_0xc61d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc61d('0x1'));var BPromise=require(_0xc61d('0x2'));var rp=require(_0xc61d('0x3'));var fs=require('fs');var path=require(_0xc61d('0x4'));var rimraf=require(_0xc61d('0x5'));var config=require(_0xc61d('0x6'));var attributes=require(_0xc61d('0x7'));module['exports']=function(_0x53bb79,_0x44b4a0){return _0x53bb79[_0xc61d('0x8')](_0xc61d('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40d9=['define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports'];(function(_0x399ce0,_0x4b04ef){var _0x5389e5=function(_0x162904){while(--_0x162904){_0x399ce0['push'](_0x399ce0['shift']());}};_0x5389e5(++_0x4b04ef);}(_0x40d9,0xdf));var _0x940d=function(_0x58b659,_0x33a971){_0x58b659=_0x58b659-0x0;var _0x4a2a78=_0x40d9[_0x58b659];return _0x4a2a78;};'use strict';var _=require('lodash');var util=require(_0x940d('0x0'));var logger=require(_0x940d('0x1'))(_0x940d('0x2'));var moment=require('moment');var BPromise=require(_0x940d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x940d('0x4'));var config=require(_0x940d('0x5'));var attributes=require('./intZohoConfiguration.attributes');module[_0x940d('0x6')]=function(_0x3ebbdc,_0x5a7b31){return _0x3ebbdc[_0x940d('0x7')](_0x940d('0x8'),attributes,{'tableName':_0x940d('0x9'),'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 537c151..715c559 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 _0x4c5e=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5c7d2e,_0x5049a7){var _0x2b7333=function(_0x3d4f3a){while(--_0x3d4f3a){_0x5c7d2e['push'](_0x5c7d2e['shift']());}};_0x2b7333(++_0x5049a7);}(_0x4c5e,0xcd));var _0xe4c5=function(_0x4ad6fd,_0x2100a5){_0x4ad6fd=_0x4ad6fd-0x0;var _0x304919=_0x4c5e[_0x4ad6fd];return _0x304919;};'use strict';var _=require(_0xe4c5('0x0'));var util=require('util');var moment=require(_0xe4c5('0x1'));var BPromise=require(_0xe4c5('0x2'));var rs=require(_0xe4c5('0x3'));var fs=require('fs');var Redis=require(_0xe4c5('0x4'));var db=require(_0xe4c5('0x5'))['db'];var utils=require(_0xe4c5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe4c5('0x7'));var jayson=require(_0xe4c5('0x8'));var client=jayson[_0xe4c5('0x9')][_0xe4c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab1c4,_0x56b552,_0x3a7782){return new BPromise(function(_0x564f60,_0x7c720b){return client[_0xe4c5('0xb')](_0x4ab1c4,_0x3a7782)[_0xe4c5('0xc')](function(_0x48c004){logger[_0xe4c5('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x56b552,_0xe4c5('0xe'));logger['debug'](_0xe4c5('0xf'),_0x56b552,_0xe4c5('0xe'),JSON[_0xe4c5('0x10')](_0x48c004));if(_0x48c004['error']){if(_0x48c004[_0xe4c5('0x11')]['code']===0x1f4){logger[_0xe4c5('0x11')](_0xe4c5('0x12'),_0x56b552,_0x48c004[_0xe4c5('0x11')][_0xe4c5('0x13')]);return _0x7c720b(_0x48c004[_0xe4c5('0x11')][_0xe4c5('0x13')]);}logger[_0xe4c5('0x11')](_0xe4c5('0x12'),_0x56b552,_0x48c004['error'][_0xe4c5('0x13')]);return _0x564f60(_0x48c004['error']['message']);}else{logger['info'](_0xe4c5('0x12'),_0x56b552,_0xe4c5('0xe'));_0x564f60(_0x48c004[_0xe4c5('0x14')]['message']);}})[_0xe4c5('0x15')](function(_0x34a5c4){logger[_0xe4c5('0x11')](_0xe4c5('0x12'),_0x56b552,_0x34a5c4);_0x7c720b(_0x34a5c4);});});} \ No newline at end of file +var _0x04da=['../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x388d68,_0x47e0dd){var _0x2fce03=function(_0x22c7f1){while(--_0x22c7f1){_0x388d68['push'](_0x388d68['shift']());}};_0x2fce03(++_0x47e0dd);}(_0x04da,0x1dd));var _0xa04d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x04da[_0x432682];return _0x463d05;};'use strict';var _=require(_0xa04d('0x0'));var util=require(_0xa04d('0x1'));var moment=require(_0xa04d('0x2'));var BPromise=require('bluebird');var rs=require(_0xa04d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa04d('0x4'))['db'];var utils=require(_0xa04d('0x5'));var logger=require('../../config/logger')(_0xa04d('0x6'));var config=require(_0xa04d('0x7'));var jayson=require(_0xa04d('0x8'));var client=jayson[_0xa04d('0x9')][_0xa04d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d71eb,_0x5193a0,_0x2d4e45){return new BPromise(function(_0x1b3f21,_0x49cc9f){return client[_0xa04d('0xb')](_0x1d71eb,_0x2d4e45)['then'](function(_0x504d2c){logger[_0xa04d('0xc')](_0xa04d('0xd'),_0x5193a0,_0xa04d('0xe'));logger[_0xa04d('0xf')](_0xa04d('0x10'),_0x5193a0,_0xa04d('0xe'),JSON[_0xa04d('0x11')](_0x504d2c));if(_0x504d2c[_0xa04d('0x12')]){if(_0x504d2c[_0xa04d('0x12')][_0xa04d('0x13')]===0x1f4){logger[_0xa04d('0x12')](_0xa04d('0xd'),_0x5193a0,_0x504d2c[_0xa04d('0x12')][_0xa04d('0x14')]);return _0x49cc9f(_0x504d2c[_0xa04d('0x12')][_0xa04d('0x14')]);}logger[_0xa04d('0x12')](_0xa04d('0xd'),_0x5193a0,_0x504d2c[_0xa04d('0x12')][_0xa04d('0x14')]);return _0x1b3f21(_0x504d2c[_0xa04d('0x12')][_0xa04d('0x14')]);}else{logger['info'](_0xa04d('0xd'),_0x5193a0,_0xa04d('0xe'));_0x1b3f21(_0x504d2c['result'][_0xa04d('0x14')]);}})[_0xa04d('0x15')](function(_0x597982){logger['error'](_0xa04d('0xd'),_0x5193a0,_0x597982);_0x49cc9f(_0x597982);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index d09c6a6..5ef013a 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 _0x405c=['update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post','put','/:id'];(function(_0x5173f3,_0x25bdf7){var _0xccc40=function(_0x2ab651){while(--_0x2ab651){_0x5173f3['push'](_0x5173f3['shift']());}};_0xccc40(++_0x25bdf7);}(_0x405c,0x1ef));var _0xc405=function(_0x599a80,_0xa7ef49){_0x599a80=_0x599a80-0x0;var _0x2abb58=_0x405c[_0x599a80];return _0x2abb58;};'use strict';var multer=require(_0xc405('0x0'));var util=require('util');var path=require(_0xc405('0x1'));var timeout=require('connect-timeout');var express=require(_0xc405('0x2'));var router=express[_0xc405('0x3')]();var fs_extra=require(_0xc405('0x4'));var auth=require(_0xc405('0x5'));var interaction=require(_0xc405('0x6'));var config=require(_0xc405('0x7'));var controller=require(_0xc405('0x8'));router[_0xc405('0x9')]('/',auth[_0xc405('0xa')](),controller['index']);router[_0xc405('0x9')]('/:id',auth[_0xc405('0xa')](),controller[_0xc405('0xb')]);router[_0xc405('0xc')]('/',auth[_0xc405('0xa')](),controller['create']);router[_0xc405('0xd')](_0xc405('0xe'),auth[_0xc405('0xa')](),controller[_0xc405('0xf')]);router['delete'](_0xc405('0xe'),auth[_0xc405('0xa')](),controller[_0xc405('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa415=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x23866f,_0x2715b2){var _0x578d23=function(_0x3a894a){while(--_0x3a894a){_0x23866f['push'](_0x23866f['shift']());}};_0x578d23(++_0x2715b2);}(_0xa415,0x1d3));var _0x5a41=function(_0x3854a5,_0xa71af7){_0x3854a5=_0x3854a5-0x0;var _0x136f83=_0xa415[_0x3854a5];return _0x136f83;};'use strict';var multer=require('multer');var util=require(_0x5a41('0x0'));var path=require(_0x5a41('0x1'));var timeout=require(_0x5a41('0x2'));var express=require(_0x5a41('0x3'));var router=express[_0x5a41('0x4')]();var fs_extra=require(_0x5a41('0x5'));var auth=require(_0x5a41('0x6'));var interaction=require(_0x5a41('0x7'));var config=require(_0x5a41('0x8'));var controller=require(_0x5a41('0x9'));router['get']('/',auth[_0x5a41('0xa')](),controller[_0x5a41('0xb')]);router[_0x5a41('0xc')](_0x5a41('0xd'),auth[_0x5a41('0xa')](),controller[_0x5a41('0xe')]);router[_0x5a41('0xf')]('/',auth[_0x5a41('0xa')](),controller[_0x5a41('0x10')]);router[_0x5a41('0x11')]('/:id',auth[_0x5a41('0xa')](),controller['update']);router[_0x5a41('0x12')](_0x5a41('0xd'),auth[_0x5a41('0xa')](),controller[_0x5a41('0x13')]);module[_0x5a41('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index a2dab40..a54b956 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 _0x6154=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x3c5fd8,_0x25457d){var _0x4130bb=function(_0x988b37){while(--_0x988b37){_0x3c5fd8['push'](_0x3c5fd8['shift']());}};_0x4130bb(++_0x25457d);}(_0x6154,0xc0));var _0x4615=function(_0x6d2aca,_0x52fb16){_0x6d2aca=_0x6d2aca-0x0;var _0x4e51b1=_0x6154[_0x6d2aca];return _0x4e51b1;};'use strict';var Sequelize=require(_0x4615('0x0'));module[_0x4615('0x1')]={'type':{'type':Sequelize[_0x4615('0x2')](_0x4615('0x3'),_0x4615('0x4'),_0x4615('0x5'),'keyValue',_0x4615('0x6')),'defaultValue':_0x4615('0x3')},'content':{'type':Sequelize[_0x4615('0x7')]},'key':{'type':Sequelize[_0x4615('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4615('0x3'),_0x4615('0x4'),_0x4615('0x5'))},'keyContent':{'type':Sequelize[_0x4615('0x7')]},'idField':{'type':Sequelize[_0x4615('0x7')]},'nameField':{'type':Sequelize[_0x4615('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4615('0x7')]}}; \ No newline at end of file +var _0x9608=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9608,0x1d8));var _0x8960=function(_0x2f85e1,_0x1dabfd){_0x2f85e1=_0x2f85e1-0x0;var _0x473afe=_0x9608[_0x2f85e1];return _0x473afe;};'use strict';var Sequelize=require(_0x8960('0x0'));module[_0x8960('0x1')]={'type':{'type':Sequelize[_0x8960('0x2')](_0x8960('0x3'),_0x8960('0x4'),_0x8960('0x5'),_0x8960('0x6'),_0x8960('0x7')),'defaultValue':_0x8960('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8960('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x8960('0x3'),_0x8960('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x8960('0x8')]},'idField':{'type':Sequelize[_0x8960('0x8')]},'nameField':{'type':Sequelize[_0x8960('0x8')]},'customField':{'type':Sequelize[_0x8960('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8960('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index bae98cc..1284f28 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 _0x57ca=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','ZohoField','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','rimraf','zip-dir','request-promise','moment'];(function(_0x517fe0,_0x47035b){var _0x189231=function(_0x3499a9){while(--_0x3499a9){_0x517fe0['push'](_0x517fe0['shift']());}};_0x189231(++_0x47035b);}(_0x57ca,0x108));var _0xa57c=function(_0x45fda4,_0x47ff73){_0x45fda4=_0x45fda4-0x0;var _0x1ab8fc=_0x57ca[_0x45fda4];return _0x1ab8fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':!![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['ZohoField']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['ZohoField'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));}; \ No newline at end of file +var _0xb876=['destroy','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','include','rows','catch','show','params','find','create','update','body','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','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','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xb876,0xb4));var _0x6b87=function(_0x37fd9d,_0x35d574){_0x37fd9d=_0x37fd9d-0x0;var _0x5de521=_0xb876[_0x37fd9d];return _0x5de521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b87('0x0'));var zipdir=require(_0x6b87('0x1'));var jsonpatch=require(_0x6b87('0x2'));var rp=require('request-promise');var moment=require(_0x6b87('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6b87('0x4'));var util=require('util');var path=require('path');var sox=require(_0x6b87('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b87('0x6'));var _=require(_0x6b87('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b87('0x8'));var deskjs=require(_0x6b87('0x9'));var toCsv=require('to-csv');var querystring=require(_0x6b87('0xa'));var Papa=require(_0x6b87('0xb'));var Redis=require(_0x6b87('0xc'));var authService=require(_0x6b87('0xd'));var qs=require(_0x6b87('0xe'));var as=require(_0x6b87('0xf'));var hardwareService=require(_0x6b87('0x10'));var logger=require(_0x6b87('0x11'))(_0x6b87('0x12'));var utils=require(_0x6b87('0x13'));var config=require(_0x6b87('0x14'));var licenseUtil=require(_0x6b87('0x15'));var db=require(_0x6b87('0x16'))['db'];function respondWithStatusCode(_0x3a7f52,_0xf91723){_0xf91723=_0xf91723||0xcc;return function(_0x207b4e){if(_0x207b4e){return _0x3a7f52[_0x6b87('0x17')](_0xf91723);}return _0x3a7f52['status'](_0xf91723)[_0x6b87('0x18')]();};}function respondWithResult(_0x30bd13,_0x1fd375){_0x1fd375=_0x1fd375||0xc8;return function(_0x21cbe8){if(_0x21cbe8){return _0x30bd13[_0x6b87('0x19')](_0x1fd375)[_0x6b87('0x1a')](_0x21cbe8);}};}function respondWithFilteredResult(_0x12babb,_0x5b6c94){return function(_0x3b0075){if(_0x3b0075){var _0x54747b=typeof _0x5b6c94[_0x6b87('0x1b')]===_0x6b87('0x1c')&&typeof _0x5b6c94['limit']==='undefined';var _0x210a34=_0x3b0075[_0x6b87('0x1d')];var _0x5bdfa8=_0x54747b?0x0:_0x5b6c94[_0x6b87('0x1b')];var _0x1079cd=_0x54747b?_0x3b0075[_0x6b87('0x1d')]:_0x5b6c94[_0x6b87('0x1b')]+_0x5b6c94[_0x6b87('0x1e')];var _0xc514a3;if(_0x1079cd>=_0x210a34){_0x1079cd=_0x210a34;_0xc514a3=0xc8;}else{_0xc514a3=0xce;}_0x12babb[_0x6b87('0x19')](_0xc514a3);return _0x12babb[_0x6b87('0x1f')](_0x6b87('0x20'),_0x5bdfa8+'-'+_0x1079cd+'/'+_0x210a34)[_0x6b87('0x1a')](_0x3b0075);}return null;};}function patchUpdates(_0x5a857c){return function(_0x3d4853){try{jsonpatch[_0x6b87('0x21')](_0x3d4853,_0x5a857c,!![]);}catch(_0x2b46cb){return BPromise['reject'](_0x2b46cb);}return _0x3d4853[_0x6b87('0x22')]();};}function saveUpdates(_0x5f4709,_0x5910de){return function(_0x585969){if(_0x585969){return _0x585969['update'](_0x5f4709)[_0x6b87('0x23')](function(_0x1258a0){return _0x1258a0;});}return null;};}function removeEntity(_0x5f300e,_0x23c222){return function(_0x29dca7){if(_0x29dca7){return _0x29dca7[_0x6b87('0x24')]()[_0x6b87('0x23')](function(){_0x5f300e[_0x6b87('0x19')](0xcc)[_0x6b87('0x18')]();});}};}function handleEntityNotFound(_0x37829a,_0x582011){return function(_0x516874){if(!_0x516874){_0x37829a[_0x6b87('0x17')](0x194);}return _0x516874;};}function handleError(_0x33ddfe,_0xb19046){_0xb19046=_0xb19046||0x1f4;return function(_0x197d27){logger[_0x6b87('0x25')](_0x197d27[_0x6b87('0x26')]);if(_0x197d27[_0x6b87('0x27')]){delete _0x197d27['name'];}_0x33ddfe[_0x6b87('0x19')](_0xb19046)['send'](_0x197d27);};}exports[_0x6b87('0x28')]=function(_0x1ce7a2,_0x26950d){var _0x47b6b2={},_0xd008={},_0x4259a3={'count':0x0,'rows':[]};var _0x26eddd=_[_0x6b87('0x29')](db[_0x6b87('0x2a')][_0x6b87('0x2b')],function(_0x29474f){return{'name':_0x29474f[_0x6b87('0x2c')],'type':_0x29474f[_0x6b87('0x2d')][_0x6b87('0x2e')]};});_0xd008['model']=_[_0x6b87('0x29')](_0x26eddd,'name');_0xd008['query']=_[_0x6b87('0x2f')](_0x1ce7a2[_0x6b87('0x30')]);_0xd008['filters']=_[_0x6b87('0x31')](_0xd008[_0x6b87('0x32')],_0xd008[_0x6b87('0x30')]);_0x47b6b2[_0x6b87('0x33')]=_[_0x6b87('0x31')](_0xd008['model'],qs[_0x6b87('0x34')](_0x1ce7a2['query'][_0x6b87('0x34')]));_0x47b6b2[_0x6b87('0x33')]=_0x47b6b2[_0x6b87('0x33')][_0x6b87('0x35')]?_0x47b6b2[_0x6b87('0x33')]:_0xd008['model'];if(!_0x1ce7a2[_0x6b87('0x30')][_0x6b87('0x36')](_0x6b87('0x37'))){_0x47b6b2['limit']=qs[_0x6b87('0x1e')](_0x1ce7a2[_0x6b87('0x30')]['limit']);_0x47b6b2[_0x6b87('0x1b')]=qs[_0x6b87('0x1b')](_0x1ce7a2[_0x6b87('0x30')]['offset']);}_0x47b6b2[_0x6b87('0x38')]=qs[_0x6b87('0x39')](_0x1ce7a2['query'][_0x6b87('0x39')]);_0x47b6b2[_0x6b87('0x3a')]=qs[_0x6b87('0x3b')](_['pick'](_0x1ce7a2[_0x6b87('0x30')],_0xd008[_0x6b87('0x3b')]),_0x26eddd);if(_0x1ce7a2[_0x6b87('0x30')]['filter']){_0x47b6b2[_0x6b87('0x3a')]=_[_0x6b87('0x3c')](_0x47b6b2[_0x6b87('0x3a')],{'$or':_[_0x6b87('0x29')](_0x26eddd,function(_0x4158f9){if(_0x4158f9['type']!=='VIRTUAL'){var _0x556047={};_0x556047[_0x4158f9[_0x6b87('0x27')]]={'$like':'%'+_0x1ce7a2[_0x6b87('0x30')][_0x6b87('0x3d')]+'%'};return _0x556047;}})});}_0x47b6b2=_[_0x6b87('0x3c')]({},_0x47b6b2,_0x1ce7a2[_0x6b87('0x3e')]);var _0x20a304={'where':_0x47b6b2[_0x6b87('0x3a')]};return db[_0x6b87('0x2a')][_0x6b87('0x1d')](_0x20a304)[_0x6b87('0x23')](function(_0x2f5522){_0x4259a3[_0x6b87('0x1d')]=_0x2f5522;if(_0x1ce7a2[_0x6b87('0x30')]['includeAll']){_0x47b6b2[_0x6b87('0x3f')]=[{'all':!![]}];}return db[_0x6b87('0x2a')]['findAll'](_0x47b6b2);})[_0x6b87('0x23')](function(_0x3dc9a8){_0x4259a3[_0x6b87('0x40')]=_0x3dc9a8;return _0x4259a3;})[_0x6b87('0x23')](respondWithFilteredResult(_0x26950d,_0x47b6b2))[_0x6b87('0x41')](handleError(_0x26950d,null));};exports[_0x6b87('0x42')]=function(_0x428a0c,_0x46daf2){var _0x5334c3={'raw':!![],'where':{'id':_0x428a0c[_0x6b87('0x43')]['id']}},_0x2dbc3d={};_0x2dbc3d['model']=_[_0x6b87('0x2f')](db[_0x6b87('0x2a')][_0x6b87('0x2b')]);_0x2dbc3d['query']=_[_0x6b87('0x2f')](_0x428a0c[_0x6b87('0x30')]);_0x2dbc3d[_0x6b87('0x3b')]=_[_0x6b87('0x31')](_0x2dbc3d[_0x6b87('0x32')],_0x2dbc3d[_0x6b87('0x30')]);_0x5334c3[_0x6b87('0x33')]=_[_0x6b87('0x31')](_0x2dbc3d['model'],qs[_0x6b87('0x34')](_0x428a0c[_0x6b87('0x30')][_0x6b87('0x34')]));_0x5334c3[_0x6b87('0x33')]=_0x5334c3[_0x6b87('0x33')][_0x6b87('0x35')]?_0x5334c3[_0x6b87('0x33')]:_0x2dbc3d['model'];if(_0x428a0c['query']['includeAll']){_0x5334c3['include']=[{'all':!![]}];}_0x5334c3=_[_0x6b87('0x3c')]({},_0x5334c3,_0x428a0c[_0x6b87('0x3e')]);return db['ZohoField'][_0x6b87('0x44')](_0x5334c3)[_0x6b87('0x23')](handleEntityNotFound(_0x46daf2,null))[_0x6b87('0x23')](respondWithResult(_0x46daf2,null))[_0x6b87('0x41')](handleError(_0x46daf2,null));};exports[_0x6b87('0x45')]=function(_0xe8248,_0x1e7d95){return db[_0x6b87('0x2a')][_0x6b87('0x45')](_0xe8248['body'],{})['then'](respondWithResult(_0x1e7d95,0xc9))['catch'](handleError(_0x1e7d95,null));};exports[_0x6b87('0x46')]=function(_0x284a8e,_0x3186a7){if(_0x284a8e['body']['id']){delete _0x284a8e[_0x6b87('0x47')]['id'];}return db[_0x6b87('0x2a')]['find']({'where':{'id':_0x284a8e[_0x6b87('0x43')]['id']}})[_0x6b87('0x23')](handleEntityNotFound(_0x3186a7,null))[_0x6b87('0x23')](saveUpdates(_0x284a8e['body'],null))[_0x6b87('0x23')](respondWithResult(_0x3186a7,null))[_0x6b87('0x41')](handleError(_0x3186a7,null));};exports[_0x6b87('0x24')]=function(_0x15db1a,_0x29d51c){return db[_0x6b87('0x2a')][_0x6b87('0x44')]({'where':{'id':_0x15db1a[_0x6b87('0x43')]['id']}})[_0x6b87('0x23')](handleEntityNotFound(_0x29d51c,null))[_0x6b87('0x23')](removeEntity(_0x29d51c,null))[_0x6b87('0x41')](handleError(_0x29d51c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index e49db8d..21eb7af 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 _0xba34=['FieldId','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xba34,0x119));var _0x4ba3=function(_0x48f861,_0x585f65){_0x48f861=_0x48f861-0x0;var _0x178d23=_0xba34[_0x48f861];return _0x178d23;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('ZohoField',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xc'),_0x4ba3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7b84=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x2c46aa,_0x3daee8){var _0x208260=function(_0x1467a9){while(--_0x1467a9){_0x2c46aa['push'](_0x2c46aa['shift']());}};_0x208260(++_0x3daee8);}(_0x7b84,0x17c));var _0x47b8=function(_0x538a79,_0x16ad4f){_0x538a79=_0x538a79-0x0;var _0x51ecb8=_0x7b84[_0x538a79];return _0x51ecb8;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var logger=require(_0x47b8('0x2'))(_0x47b8('0x3'));var moment=require(_0x47b8('0x4'));var BPromise=require(_0x47b8('0x5'));var rp=require(_0x47b8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var attributes=require(_0x47b8('0x9'));module[_0x47b8('0xa')]=function(_0x2e6853,_0xafe88a){return _0x2e6853['define'](_0x47b8('0xb'),attributes,{'tableName':_0x47b8('0xc'),'paranoid':![],'indexes':[{'name':_0x47b8('0xd'),'fields':[_0x47b8('0xe'),_0x47b8('0xf')],'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 65e5341..6741f66 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 _0x46af=['ZohoField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x46af,0xf9));var _0xf46a=function(_0x4f7ad1,_0x4f43e0){_0x4f7ad1=_0x4f7ad1-0x0;var _0x26f6f7=_0x46af[_0x4f7ad1];return _0x26f6f7;};'use strict';var _=require(_0xf46a('0x0'));var util=require('util');var moment=require(_0xf46a('0x1'));var BPromise=require(_0xf46a('0x2'));var rs=require(_0xf46a('0x3'));var fs=require('fs');var Redis=require(_0xf46a('0x4'));var db=require(_0xf46a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf46a('0x6'))(_0xf46a('0x7'));var config=require(_0xf46a('0x8'));var jayson=require(_0xf46a('0x9'));var client=jayson['client'][_0xf46a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b6e40,_0x3e41b5,_0x240de5){return new BPromise(function(_0x270bf2,_0x499d72){return client['request'](_0x1b6e40,_0x240de5)['then'](function(_0x90aa65){logger['info'](_0xf46a('0xb'),_0x3e41b5,'request\x20sent');logger[_0xf46a('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x3e41b5,'request\x20sent',JSON[_0xf46a('0xd')](_0x90aa65));if(_0x90aa65['error']){if(_0x90aa65[_0xf46a('0xe')][_0xf46a('0xf')]===0x1f4){logger['error'](_0xf46a('0xb'),_0x3e41b5,_0x90aa65[_0xf46a('0xe')][_0xf46a('0x10')]);return _0x499d72(_0x90aa65[_0xf46a('0xe')][_0xf46a('0x10')]);}logger['error'](_0xf46a('0xb'),_0x3e41b5,_0x90aa65[_0xf46a('0xe')][_0xf46a('0x10')]);return _0x270bf2(_0x90aa65[_0xf46a('0xe')]['message']);}else{logger['info'](_0xf46a('0xb'),_0x3e41b5,_0xf46a('0x11'));_0x270bf2(_0x90aa65[_0xf46a('0x12')][_0xf46a('0x10')]);}})[_0xf46a('0x13')](function(_0x1854de){logger[_0xf46a('0xe')](_0xf46a('0xb'),_0x3e41b5,_0x1854de);_0x499d72(_0x1854de);});});} \ No newline at end of file +var _0xf0da=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','lodash','moment','randomstring'];(function(_0x32f2b5,_0x3e7573){var _0x4acddb=function(_0x2358bb){while(--_0x2358bb){_0x32f2b5['push'](_0x32f2b5['shift']());}};_0x4acddb(++_0x3e7573);}(_0xf0da,0x14d));var _0xaf0d=function(_0x414b85,_0x2a030e){_0x414b85=_0x414b85-0x0;var _0x371e81=_0xf0da[_0x414b85];return _0x371e81;};'use strict';var _=require(_0xaf0d('0x0'));var util=require('util');var moment=require(_0xaf0d('0x1'));var BPromise=require('bluebird');var rs=require(_0xaf0d('0x2'));var fs=require('fs');var Redis=require(_0xaf0d('0x3'));var db=require(_0xaf0d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf0d('0x5'))(_0xaf0d('0x6'));var config=require(_0xaf0d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf0d('0x8')][_0xaf0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ddc6a,_0x620504,_0x17dd26){return new BPromise(function(_0x48c316,_0x16334b){return client[_0xaf0d('0xa')](_0x4ddc6a,_0x17dd26)[_0xaf0d('0xb')](function(_0x261bb0){logger[_0xaf0d('0xc')]('ZohoField,\x20%s,\x20%s',_0x620504,_0xaf0d('0xd'));logger[_0xaf0d('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x620504,_0xaf0d('0xd'),JSON[_0xaf0d('0xf')](_0x261bb0));if(_0x261bb0[_0xaf0d('0x10')]){if(_0x261bb0[_0xaf0d('0x10')][_0xaf0d('0x11')]===0x1f4){logger[_0xaf0d('0x10')](_0xaf0d('0x12'),_0x620504,_0x261bb0[_0xaf0d('0x10')]['message']);return _0x16334b(_0x261bb0[_0xaf0d('0x10')]['message']);}logger[_0xaf0d('0x10')]('ZohoField,\x20%s,\x20%s',_0x620504,_0x261bb0['error'][_0xaf0d('0x13')]);return _0x48c316(_0x261bb0[_0xaf0d('0x10')][_0xaf0d('0x13')]);}else{logger[_0xaf0d('0xc')](_0xaf0d('0x12'),_0x620504,'request\x20sent');_0x48c316(_0x261bb0[_0xaf0d('0x14')][_0xaf0d('0x13')]);}})['catch'](function(_0x24f819){logger[_0xaf0d('0x10')](_0xaf0d('0x12'),_0x620504,_0x24f819);_0x16334b(_0x24f819);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index ab3bcc5..6411fcb 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xab2f46,_0xf5cd3c){var _0x13e330=function(_0x1ec28a){while(--_0x1ec28a){_0xab2f46['push'](_0xab2f46['shift']());}};_0x13e330(++_0xf5cd3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 3b24342..9723bb0 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 _0x47a0=['INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x1eb898,_0x19d1e1){var _0x3f9c55=function(_0x5dfc58){while(--_0x5dfc58){_0x1eb898['push'](_0x1eb898['shift']());}};_0x3f9c55(++_0x19d1e1);}(_0x47a0,0x15a));var _0x047a=function(_0x646bc4,_0x519e2c){_0x646bc4=_0x646bc4-0x0;var _0x1c8adf=_0x47a0[_0x646bc4];return _0x1c8adf;};'use strict';var Sequelize=require(_0x047a('0x0'));module['exports']={'name':{'type':Sequelize[_0x047a('0x1')],'allowNull':![],'unique':_0x047a('0x2')},'version':{'type':Sequelize[_0x047a('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x047a('0x1')],'defaultValue':_0x047a('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x047a('0x1')]},'size':{'type':Sequelize[_0x047a('0x4')]},'active':{'type':Sequelize[_0x047a('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x047a('0x1')]},'state':{'type':Sequelize[_0x047a('0x1')],'unique':_0x047a('0x6')},'description':{'type':Sequelize[_0x047a('0x1')]},'title':{'type':Sequelize[_0x047a('0x1')]},'remoteUri':{'type':Sequelize[_0x047a('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x90aa=['INTEGER','state','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x90aa,0x152));var _0xa90a=function(_0x4bd4b8,_0xfe3c50){_0x4bd4b8=_0x4bd4b8-0x0;var _0x5d7d7f=_0x90aa[_0x4bd4b8];return _0x5d7d7f;};'use strict';var Sequelize=require(_0xa90a('0x0'));module[_0xa90a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa90a('0x2')},'version':{'type':Sequelize[_0xa90a('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xa90a('0x3')],'defaultValue':_0xa90a('0x4')},'filename':{'type':Sequelize[_0xa90a('0x3')]},'path':{'type':Sequelize[_0xa90a('0x3')]},'type':{'type':Sequelize[_0xa90a('0x3')]},'size':{'type':Sequelize[_0xa90a('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xa90a('0x3')]},'logo':{'type':Sequelize[_0xa90a('0x3')]},'state':{'type':Sequelize[_0xa90a('0x3')],'unique':_0xa90a('0x6')},'description':{'type':Sequelize[_0xa90a('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa90a('0x3')]},'link':{'type':Sequelize[_0xa90a('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index b0408d9..ddb736f 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 _0x53ec=['count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','Integration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x53ec,0x192));var _0xc53e=function(_0x1fc512,_0x1996db){_0x1fc512=_0x1fc512-0x0;var _0xae94b9=_0x53ec[_0x1fc512];return _0xae94b9;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')](_0x4458c8['body'],{})[_0xc53e('0x24')](respondWithResult(_0x15e744,0xc9))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x5a6e41,_0x33d45c){if(_0x5a6e41[_0xc53e('0x46')]['id']){delete _0x5a6e41[_0xc53e('0x46')]['id'];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x5a6e41[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x33d45c,null))[_0xc53e('0x24')](saveUpdates(_0x5a6e41[_0xc53e('0x46')],null))[_0xc53e('0x24')](respondWithResult(_0x33d45c,null))['catch'](handleError(_0x33d45c,null));};exports[_0xc53e('0x47')]=function(_0x17cf13,_0x38520c){return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x17cf13['params']['id']}})['then'](handleEntityNotFound(_0x38520c,null))[_0xc53e('0x24')](removeEntity(_0x38520c,null))['catch'](handleError(_0x38520c,null));}; \ No newline at end of file +var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','Integration','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5e4053,_0x26f5c2){var _0x307c8b=function(_0x152651){while(--_0x152651){_0x5e4053['push'](_0x5e4053['shift']());}};_0x307c8b(++_0x26f5c2);}(_0x2ef3,0xba));var _0x32ef=function(_0x520fa4,_0x1754e3){_0x520fa4=_0x520fa4-0x0;var _0x106099=_0x2ef3[_0x520fa4];return _0x106099;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['Integration'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['Integration'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['Integration']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 7e9e8ab..5685a43 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 _0x64c9=['exports','define','Integration','integrations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x1132ef,_0xc791b4){var _0x2c3242=function(_0x10b97f){while(--_0x10b97f){_0x1132ef['push'](_0x1132ef['shift']());}};_0x2c3242(++_0xc791b4);}(_0x64c9,0xc8));var _0x964c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x64c9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x964c('0x0'));var logger=require(_0x964c('0x1'))(_0x964c('0x2'));var moment=require(_0x964c('0x3'));var BPromise=require(_0x964c('0x4'));var rp=require(_0x964c('0x5'));var fs=require('fs');var path=require(_0x964c('0x6'));var rimraf=require(_0x964c('0x7'));var config=require(_0x964c('0x8'));var attributes=require(_0x964c('0x9'));module[_0x964c('0xa')]=function(_0x3a8bab,_0x594f5e){return _0x3a8bab[_0x964c('0xb')](_0x964c('0xc'),attributes,{'tableName':_0x964c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1bd=['rimraf','../../config/environment','define','Integration','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0xd1bd,0x1dd));var _0xdd1b=function(_0x5c0e61,_0x111c67){_0x5c0e61=_0x5c0e61-0x0;var _0x3af9c7=_0xd1bd[_0x5c0e61];return _0x3af9c7;};'use strict';var _=require(_0xdd1b('0x0'));var util=require(_0xdd1b('0x1'));var logger=require(_0xdd1b('0x2'))(_0xdd1b('0x3'));var moment=require(_0xdd1b('0x4'));var BPromise=require(_0xdd1b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd1b('0x6'));var rimraf=require(_0xdd1b('0x7'));var config=require(_0xdd1b('0x8'));var attributes=require('./integration.attributes');module['exports']=function(_0x5c266e,_0x810747){return _0x5c266e[_0xdd1b('0x9')](_0xdd1b('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 728d016..b701fc5 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2f4f15,_0x1786f3){var _0x3f163c=function(_0xef9a4c){while(--_0xef9a4c){_0x2f4f15['push'](_0x2f4f15['shift']());}};_0x3f163c(++_0x1786f3);}(_0x9f0e,0x116));var _0xe9f0=function(_0x234c65,_0x29a326){_0x234c65=_0x234c65-0x0;var _0x15de8d=_0x9f0e[_0x234c65];return _0x15de8d;};'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')]('Integration,\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);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x511000,_0x4b6553){var _0x175e7c=function(_0xb6480a){while(--_0xb6480a){_0x511000['push'](_0x511000['shift']());}};_0x175e7c(++_0x4b6553);}(_0xba34,0x119));var _0x4ba3=function(_0x4a545c,_0x12f535){_0x4a545c=_0x4a545c-0x0;var _0x2e4f01=_0xba34[_0x4a545c];return _0x2e4f01;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 20a7e3c..3a4271c 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 _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34fe09,_0x30562c){_0x34fe09=_0x34fe09-0x0;var _0x16d058=_0x5f2f[_0x34fe09];return _0x16d058;};'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')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xda2d,0x102));var _0xdda2=function(_0x1bca69,_0x26fa06){_0x1bca69=_0x1bca69-0x0;var _0x57a3e3=_0xda2d[_0x1bca69];return _0x57a3e3;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 3cb51aa..dd86248 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 _0x8997=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED'];(function(_0x4a7458,_0x5e0843){var _0x35226d=function(_0x13f47a){while(--_0x13f47a){_0x4a7458['push'](_0x4a7458['shift']());}};_0x35226d(++_0x5e0843);}(_0x8997,0xa5));var _0x7899=function(_0x72a183,_0x401973){_0x72a183=_0x72a183-0x0;var _0x42d1e6=_0x8997[_0x72a183];return _0x42d1e6;};'use strict';var Sequelize=require(_0x7899('0x0'));module[_0x7899('0x1')]={'integration':{'type':Sequelize[_0x7899('0x2')]},'eventChannel':{'type':Sequelize[_0x7899('0x2')]},'exitStatus':{'type':Sequelize[_0x7899('0x2')]},'ticketId':{'type':Sequelize[_0x7899('0x2')]},'integrationId':{'type':Sequelize[_0x7899('0x3')]},'contacts':{'type':Sequelize[_0x7899('0x2')]},'uniqueid':{'type':Sequelize[_0x7899('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7899('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7899('0x2')]},'membername':{'type':Sequelize[_0x7899('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7899('0x4')]},'agentconnectAt':{'type':Sequelize[_0x7899('0x4')]},'holdtime':{'type':Sequelize[_0x7899('0x3')]},'agentcomplete':{'type':Sequelize[_0x7899('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x7899('0x3')]},'agentacw':{'type':Sequelize[_0x7899('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7899('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x7899('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7899('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7899('0x4')]},'lastevent':{'type':Sequelize[_0x7899('0x2')]},'channel':{'type':Sequelize[_0x7899('0x2')]},'channelstate':{'type':Sequelize[_0x7899('0x3')]},'channelstatedesc':{'type':Sequelize[_0x7899('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7899('0x2')]},'exten':{'type':Sequelize[_0x7899('0x2')]},'priority':{'type':Sequelize[_0x7899('0x2')]},'destchannel':{'type':Sequelize[_0x7899('0x2')]},'destchannelstate':{'type':Sequelize[_0x7899('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7899('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7899('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7899('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7899('0x2')]},'destaccountcode':{'type':Sequelize[_0x7899('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7899('0x2')]},'destpriority':{'type':Sequelize[_0x7899('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x7899('0x2')]},'inReplyTo':{'type':Sequelize[_0x7899('0x2')]},'subject':{'type':Sequelize[_0x7899('0x2')]},'from':{'type':Sequelize[_0x7899('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x7899('0x2')]},'attachment':{'type':Sequelize[_0x7899('0x6')]},'html':{'type':Sequelize[_0x7899('0x6')]},'text':{'type':Sequelize[_0x7899('0x6')]},'status':{'type':Sequelize['ENUM'](_0x7899('0x7'),_0x7899('0x8'),_0x7899('0x9'),_0x7899('0xa'))},'url':{'type':Sequelize[_0x7899('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x7899('0x2')]},'projectId':{'type':Sequelize[_0x7899('0x3')]}}; \ No newline at end of file +var _0x0a2a=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x7740b5,_0x511a50){var _0x50fe36=function(_0x4eb6c4){while(--_0x4eb6c4){_0x7740b5['push'](_0x7740b5['shift']());}};_0x50fe36(++_0x511a50);}(_0x0a2a,0xc3));var _0xa0a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a2a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa0a2('0x0'));module[_0xa0a2('0x1')]={'integration':{'type':Sequelize[_0xa0a2('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xa0a2('0x2')]},'integrationId':{'type':Sequelize[_0xa0a2('0x3')]},'contacts':{'type':Sequelize[_0xa0a2('0x2')]},'uniqueid':{'type':Sequelize[_0xa0a2('0x2')]},'calleridnum':{'type':Sequelize[_0xa0a2('0x2')]},'calleridname':{'type':Sequelize[_0xa0a2('0x2')]},'queue':{'type':Sequelize[_0xa0a2('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa0a2('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa0a2('0x4')]},'agentconnectAt':{'type':Sequelize[_0xa0a2('0x4')]},'holdtime':{'type':Sequelize[_0xa0a2('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa0a2('0x4')]},'talktime':{'type':Sequelize[_0xa0a2('0x3')]},'agentacw':{'type':Sequelize[_0xa0a2('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa0a2('0x3')]},'reason':{'type':Sequelize[_0xa0a2('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa0a2('0x4')]},'agentdump':{'type':Sequelize[_0xa0a2('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa0a2('0x4')]},'lastevent':{'type':Sequelize[_0xa0a2('0x2')]},'channel':{'type':Sequelize[_0xa0a2('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa0a2('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa0a2('0x2')]},'connectedlinename':{'type':Sequelize[_0xa0a2('0x2')]},'language':{'type':Sequelize[_0xa0a2('0x2')]},'accountcode':{'type':Sequelize[_0xa0a2('0x2')]},'context':{'type':Sequelize[_0xa0a2('0x2')]},'exten':{'type':Sequelize[_0xa0a2('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xa0a2('0x2')]},'destchannelstate':{'type':Sequelize[_0xa0a2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xa0a2('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa0a2('0x2')]},'destcalleridname':{'type':Sequelize[_0xa0a2('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa0a2('0x2')]},'destlanguage':{'type':Sequelize[_0xa0a2('0x2')]},'destaccountcode':{'type':Sequelize[_0xa0a2('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xa0a2('0x2')]},'destpriority':{'type':Sequelize[_0xa0a2('0x2')]},'destuniqueid':{'type':Sequelize[_0xa0a2('0x2')]},'messageId':{'type':Sequelize[_0xa0a2('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xa0a2('0x2')]},'from':{'type':Sequelize[_0xa0a2('0x2')]},'to':{'type':Sequelize[_0xa0a2('0x2')]},'cc':{'type':Sequelize[_0xa0a2('0x2')]},'attachment':{'type':Sequelize[_0xa0a2('0x6')]},'html':{'type':Sequelize[_0xa0a2('0x6')]},'text':{'type':Sequelize[_0xa0a2('0x6')]},'status':{'type':Sequelize[_0xa0a2('0x7')](_0xa0a2('0x8'),_0xa0a2('0x9'),_0xa0a2('0xa'),_0xa0a2('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xa0a2('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 200addc..b85eb31 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 _0xbaf8=['moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','find','create','body','params','destroy','eml-format','zip-dir','request-promise'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xbaf8,0x95));var _0x8baf=function(_0x522ea3,_0x2384bd){_0x522ea3=_0x522ea3-0x0;var _0x4eb4cb=_0xbaf8[_0x522ea3];return _0x4eb4cb;};'use strict';var emlformat=require(_0x8baf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8baf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8baf('0x2'));var moment=require(_0x8baf('0x3'));var BPromise=require(_0x8baf('0x4'));var Mustache=require('mustache');var util=require(_0x8baf('0x5'));var path=require(_0x8baf('0x6'));var sox=require('sox');var csv=require(_0x8baf('0x7'));var ejs=require(_0x8baf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8baf('0x9'));var crypto=require(_0x8baf('0xa'));var jsforce=require(_0x8baf('0xb'));var deskjs=require(_0x8baf('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8baf('0xd'));var Papa=require(_0x8baf('0xe'));var Redis=require(_0x8baf('0xf'));var authService=require(_0x8baf('0x10'));var qs=require(_0x8baf('0x11'));var as=require(_0x8baf('0x12'));var hardwareService=require(_0x8baf('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8baf('0x14'));var config=require(_0x8baf('0x15'));var licenseUtil=require(_0x8baf('0x16'));var db=require(_0x8baf('0x17'))['db'];function respondWithStatusCode(_0x1bb581,_0x1005ef){_0x1005ef=_0x1005ef||0xcc;return function(_0x3e48b4){if(_0x3e48b4){return _0x1bb581[_0x8baf('0x18')](_0x1005ef);}return _0x1bb581[_0x8baf('0x19')](_0x1005ef)[_0x8baf('0x1a')]();};}function respondWithResult(_0x3bb86d,_0x4529b2){_0x4529b2=_0x4529b2||0xc8;return function(_0x305c79){if(_0x305c79){return _0x3bb86d[_0x8baf('0x19')](_0x4529b2)['json'](_0x305c79);}};}function respondWithFilteredResult(_0x14ce6f,_0x3b4236){return function(_0x2c8827){if(_0x2c8827){var _0x2da8fa=typeof _0x3b4236['offset']===_0x8baf('0x1b')&&typeof _0x3b4236[_0x8baf('0x1c')]==='undefined';var _0x2f4bb7=_0x2c8827[_0x8baf('0x1d')];var _0x43b9c1=_0x2da8fa?0x0:_0x3b4236['offset'];var _0x2d295b=_0x2da8fa?_0x2c8827['count']:_0x3b4236[_0x8baf('0x1e')]+_0x3b4236[_0x8baf('0x1c')];var _0x1eaa02;if(_0x2d295b>=_0x2f4bb7){_0x2d295b=_0x2f4bb7;_0x1eaa02=0xc8;}else{_0x1eaa02=0xce;}_0x14ce6f[_0x8baf('0x19')](_0x1eaa02);return _0x14ce6f['set'](_0x8baf('0x1f'),_0x43b9c1+'-'+_0x2d295b+'/'+_0x2f4bb7)[_0x8baf('0x20')](_0x2c8827);}return null;};}function patchUpdates(_0x18c3e2){return function(_0x59f3d9){try{jsonpatch[_0x8baf('0x21')](_0x59f3d9,_0x18c3e2,!![]);}catch(_0x28cdcd){return BPromise[_0x8baf('0x22')](_0x28cdcd);}return _0x59f3d9[_0x8baf('0x23')]();};}function saveUpdates(_0x265f41,_0x22db08){return function(_0x540a7f){if(_0x540a7f){return _0x540a7f[_0x8baf('0x24')](_0x265f41)['then'](function(_0x360528){return _0x360528;});}return null;};}function removeEntity(_0x2b6ade,_0x4c3cfc){return function(_0x117ac2){if(_0x117ac2){return _0x117ac2['destroy']()[_0x8baf('0x25')](function(){_0x2b6ade['status'](0xcc)[_0x8baf('0x1a')]();});}};}function handleEntityNotFound(_0x5648a3,_0x596750){return function(_0x3147a8){if(!_0x3147a8){_0x5648a3[_0x8baf('0x18')](0x194);}return _0x3147a8;};}function handleError(_0x4dcb64,_0x1e1d7e){_0x1e1d7e=_0x1e1d7e||0x1f4;return function(_0x2173ee){logger[_0x8baf('0x26')](_0x2173ee['stack']);if(_0x2173ee[_0x8baf('0x27')]){delete _0x2173ee[_0x8baf('0x27')];}_0x4dcb64[_0x8baf('0x19')](_0x1e1d7e)[_0x8baf('0x28')](_0x2173ee);};}exports[_0x8baf('0x29')]=function(_0x43ff8c,_0x206191){var _0x1a403e={},_0x2c9d89={},_0x1ff08a={'count':0x0,'rows':[]};var _0x4e4da0=_[_0x8baf('0x2a')](db[_0x8baf('0x2b')][_0x8baf('0x2c')],function(_0x5faa9e){return{'name':_0x5faa9e[_0x8baf('0x2d')],'type':_0x5faa9e[_0x8baf('0x2e')][_0x8baf('0x2f')]};});_0x2c9d89[_0x8baf('0x30')]=_[_0x8baf('0x2a')](_0x4e4da0,_0x8baf('0x27'));_0x2c9d89[_0x8baf('0x31')]=_[_0x8baf('0x32')](_0x43ff8c[_0x8baf('0x31')]);_0x2c9d89[_0x8baf('0x33')]=_[_0x8baf('0x34')](_0x2c9d89['model'],_0x2c9d89[_0x8baf('0x31')]);_0x1a403e[_0x8baf('0x35')]=_[_0x8baf('0x34')](_0x2c9d89[_0x8baf('0x30')],qs[_0x8baf('0x36')](_0x43ff8c['query'][_0x8baf('0x36')]));_0x1a403e['attributes']=_0x1a403e[_0x8baf('0x35')]['length']?_0x1a403e[_0x8baf('0x35')]:_0x2c9d89['model'];if(!_0x43ff8c[_0x8baf('0x31')][_0x8baf('0x37')](_0x8baf('0x38'))){_0x1a403e[_0x8baf('0x1c')]=qs[_0x8baf('0x1c')](_0x43ff8c['query']['limit']);_0x1a403e[_0x8baf('0x1e')]=qs[_0x8baf('0x1e')](_0x43ff8c['query'][_0x8baf('0x1e')]);}_0x1a403e[_0x8baf('0x39')]=qs[_0x8baf('0x3a')](_0x43ff8c[_0x8baf('0x31')][_0x8baf('0x3a')]);_0x1a403e['where']=qs[_0x8baf('0x33')](_[_0x8baf('0x3b')](_0x43ff8c[_0x8baf('0x31')],_0x2c9d89['filters']),_0x4e4da0);if(_0x43ff8c[_0x8baf('0x31')][_0x8baf('0x3c')]){_0x1a403e[_0x8baf('0x3d')]=_[_0x8baf('0x3e')](_0x1a403e[_0x8baf('0x3d')],{'$or':_[_0x8baf('0x2a')](_0x4e4da0,function(_0x517b8f){if(_0x517b8f[_0x8baf('0x2e')]!==_0x8baf('0x3f')){var _0x3d421a={};_0x3d421a[_0x517b8f[_0x8baf('0x27')]]={'$like':'%'+_0x43ff8c['query'][_0x8baf('0x3c')]+'%'};return _0x3d421a;}})});}_0x1a403e=_['merge']({},_0x1a403e,_0x43ff8c[_0x8baf('0x40')]);var _0x358d12={'where':_0x1a403e[_0x8baf('0x3d')]};return db['IntegrationReport'][_0x8baf('0x1d')](_0x358d12)[_0x8baf('0x25')](function(_0x1adda3){_0x1ff08a[_0x8baf('0x1d')]=_0x1adda3;if(_0x43ff8c[_0x8baf('0x31')][_0x8baf('0x41')]){_0x1a403e['include']=[{'all':!![]}];}return db[_0x8baf('0x2b')][_0x8baf('0x42')](_0x1a403e);})[_0x8baf('0x25')](function(_0x417bb){_0x1ff08a[_0x8baf('0x43')]=_0x417bb;return _0x1ff08a;})[_0x8baf('0x25')](respondWithFilteredResult(_0x206191,_0x1a403e))[_0x8baf('0x44')](handleError(_0x206191,null));};exports[_0x8baf('0x45')]=function(_0x329af3,_0x30c2fa){var _0x283c5c={'raw':![],'where':{'id':_0x329af3['params']['id']}},_0x288383={};_0x288383['model']=_[_0x8baf('0x32')](db[_0x8baf('0x2b')][_0x8baf('0x2c')]);_0x288383[_0x8baf('0x31')]=_[_0x8baf('0x32')](_0x329af3['query']);_0x288383['filters']=_['intersection'](_0x288383[_0x8baf('0x30')],_0x288383[_0x8baf('0x31')]);_0x283c5c[_0x8baf('0x35')]=_[_0x8baf('0x34')](_0x288383['model'],qs[_0x8baf('0x36')](_0x329af3['query'][_0x8baf('0x36')]));_0x283c5c[_0x8baf('0x35')]=_0x283c5c[_0x8baf('0x35')][_0x8baf('0x46')]?_0x283c5c[_0x8baf('0x35')]:_0x288383[_0x8baf('0x30')];if(_0x329af3[_0x8baf('0x31')][_0x8baf('0x41')]){_0x283c5c['include']=[{'all':!![]}];}_0x283c5c=_[_0x8baf('0x3e')]({},_0x283c5c,_0x329af3['options']);return db['IntegrationReport'][_0x8baf('0x47')](_0x283c5c)[_0x8baf('0x25')](handleEntityNotFound(_0x30c2fa,null))[_0x8baf('0x25')](respondWithResult(_0x30c2fa,null))[_0x8baf('0x44')](handleError(_0x30c2fa,null));};exports[_0x8baf('0x48')]=function(_0x12922d,_0x54b76c){return db[_0x8baf('0x2b')][_0x8baf('0x48')](_0x12922d[_0x8baf('0x49')],{})[_0x8baf('0x25')](respondWithResult(_0x54b76c,0xc9))[_0x8baf('0x44')](handleError(_0x54b76c,null));};exports[_0x8baf('0x24')]=function(_0x532af8,_0x5573d4){if(_0x532af8[_0x8baf('0x49')]['id']){delete _0x532af8['body']['id'];}return db[_0x8baf('0x2b')][_0x8baf('0x47')]({'where':{'id':_0x532af8[_0x8baf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5573d4,null))[_0x8baf('0x25')](saveUpdates(_0x532af8[_0x8baf('0x49')],null))['then'](respondWithResult(_0x5573d4,null))['catch'](handleError(_0x5573d4,null));};exports[_0x8baf('0x4b')]=function(_0x4779e0,_0x5d2269){return db[_0x8baf('0x2b')][_0x8baf('0x47')]({'where':{'id':_0x4779e0[_0x8baf('0x4a')]['id']}})[_0x8baf('0x25')](handleEntityNotFound(_0x5d2269,null))[_0x8baf('0x25')](removeEntity(_0x5d2269,null))['catch'](handleError(_0x5d2269,null));};exports['describe']=function(_0x242097,_0x3a9c23){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x3a9c23,null))[_0x8baf('0x44')](handleError(_0x3a9c23,null));}; \ No newline at end of file +var _0x5275=['error','name','send','map','fieldName','type','query','keys','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','IntegrationReport','include','findAll','catch','rawAttributes','create','body','update','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end'];(function(_0xbb5c52,_0x360a9f){var _0x5ee494=function(_0x59388a){while(--_0x59388a){_0xbb5c52['push'](_0xbb5c52['shift']());}};_0x5ee494(++_0x360a9f);}(_0x5275,0x147));var _0x5527=function(_0x34cea1,_0x16d860){_0x34cea1=_0x34cea1-0x0;var _0x2d796a=_0x5275[_0x34cea1];return _0x2d796a;};'use strict';var emlformat=require(_0x5527('0x0'));var rimraf=require(_0x5527('0x1'));var zipdir=require(_0x5527('0x2'));var jsonpatch=require(_0x5527('0x3'));var rp=require(_0x5527('0x4'));var moment=require(_0x5527('0x5'));var BPromise=require(_0x5527('0x6'));var Mustache=require(_0x5527('0x7'));var util=require(_0x5527('0x8'));var path=require(_0x5527('0x9'));var sox=require('sox');var csv=require(_0x5527('0xa'));var ejs=require(_0x5527('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5527('0xc'));var squel=require(_0x5527('0xd'));var crypto=require(_0x5527('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5527('0xf'));var toCsv=require(_0x5527('0xa'));var querystring=require(_0x5527('0x10'));var Papa=require(_0x5527('0x11'));var Redis=require(_0x5527('0x12'));var authService=require(_0x5527('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5527('0x14'));var logger=require(_0x5527('0x15'))(_0x5527('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5527('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2962eb,_0x53f5e8){_0x53f5e8=_0x53f5e8||0xcc;return function(_0x5e35b){if(_0x5e35b){return _0x2962eb[_0x5527('0x18')](_0x53f5e8);}return _0x2962eb[_0x5527('0x19')](_0x53f5e8)['end']();};}function respondWithResult(_0x1e8042,_0x29e05e){_0x29e05e=_0x29e05e||0xc8;return function(_0x33d40e){if(_0x33d40e){return _0x1e8042[_0x5527('0x19')](_0x29e05e)[_0x5527('0x1a')](_0x33d40e);}};}function respondWithFilteredResult(_0x3b038a,_0x268868){return function(_0x27fa37){if(_0x27fa37){var _0x455a41=typeof _0x268868[_0x5527('0x1b')]===_0x5527('0x1c')&&typeof _0x268868[_0x5527('0x1d')]==='undefined';var _0x50c127=_0x27fa37[_0x5527('0x1e')];var _0x447e3a=_0x455a41?0x0:_0x268868[_0x5527('0x1b')];var _0xb96163=_0x455a41?_0x27fa37[_0x5527('0x1e')]:_0x268868[_0x5527('0x1b')]+_0x268868['limit'];var _0x413891;if(_0xb96163>=_0x50c127){_0xb96163=_0x50c127;_0x413891=0xc8;}else{_0x413891=0xce;}_0x3b038a[_0x5527('0x19')](_0x413891);return _0x3b038a[_0x5527('0x1f')](_0x5527('0x20'),_0x447e3a+'-'+_0xb96163+'/'+_0x50c127)[_0x5527('0x1a')](_0x27fa37);}return null;};}function patchUpdates(_0x1e13d2){return function(_0x36f456){try{jsonpatch[_0x5527('0x21')](_0x36f456,_0x1e13d2,!![]);}catch(_0x1aa2fd){return BPromise[_0x5527('0x22')](_0x1aa2fd);}return _0x36f456[_0x5527('0x23')]();};}function saveUpdates(_0x4de057,_0x3e9348){return function(_0x1fd3e7){if(_0x1fd3e7){return _0x1fd3e7['update'](_0x4de057)[_0x5527('0x24')](function(_0x251387){return _0x251387;});}return null;};}function removeEntity(_0x9210c,_0x53b542){return function(_0x123543){if(_0x123543){return _0x123543['destroy']()[_0x5527('0x24')](function(){_0x9210c[_0x5527('0x19')](0xcc)[_0x5527('0x25')]();});}};}function handleEntityNotFound(_0x322a1b,_0x5c293c){return function(_0x2cca77){if(!_0x2cca77){_0x322a1b[_0x5527('0x18')](0x194);}return _0x2cca77;};}function handleError(_0x68d7d8,_0x286118){_0x286118=_0x286118||0x1f4;return function(_0x520506){logger[_0x5527('0x26')](_0x520506['stack']);if(_0x520506[_0x5527('0x27')]){delete _0x520506[_0x5527('0x27')];}_0x68d7d8[_0x5527('0x19')](_0x286118)[_0x5527('0x28')](_0x520506);};}exports['index']=function(_0x27997b,_0x3f80d8){var _0x43dcd8={},_0x3075f8={},_0x40af6e={'count':0x0,'rows':[]};var _0x40c762=_[_0x5527('0x29')](db['IntegrationReport']['rawAttributes'],function(_0xecb5c5){return{'name':_0xecb5c5[_0x5527('0x2a')],'type':_0xecb5c5[_0x5527('0x2b')]['key']};});_0x3075f8['model']=_[_0x5527('0x29')](_0x40c762,_0x5527('0x27'));_0x3075f8[_0x5527('0x2c')]=_[_0x5527('0x2d')](_0x27997b['query']);_0x3075f8['filters']=_[_0x5527('0x2e')](_0x3075f8[_0x5527('0x2f')],_0x3075f8[_0x5527('0x2c')]);_0x43dcd8['attributes']=_[_0x5527('0x2e')](_0x3075f8[_0x5527('0x2f')],qs[_0x5527('0x30')](_0x27997b['query'][_0x5527('0x30')]));_0x43dcd8['attributes']=_0x43dcd8['attributes'][_0x5527('0x31')]?_0x43dcd8[_0x5527('0x32')]:_0x3075f8[_0x5527('0x2f')];if(!_0x27997b[_0x5527('0x2c')][_0x5527('0x33')](_0x5527('0x34'))){_0x43dcd8[_0x5527('0x1d')]=qs['limit'](_0x27997b['query'][_0x5527('0x1d')]);_0x43dcd8[_0x5527('0x1b')]=qs[_0x5527('0x1b')](_0x27997b[_0x5527('0x2c')]['offset']);}_0x43dcd8[_0x5527('0x35')]=qs['sort'](_0x27997b[_0x5527('0x2c')][_0x5527('0x36')]);_0x43dcd8[_0x5527('0x37')]=qs[_0x5527('0x38')](_[_0x5527('0x39')](_0x27997b[_0x5527('0x2c')],_0x3075f8['filters']),_0x40c762);if(_0x27997b[_0x5527('0x2c')][_0x5527('0x3a')]){_0x43dcd8[_0x5527('0x37')]=_['merge'](_0x43dcd8['where'],{'$or':_['map'](_0x40c762,function(_0xd84698){if(_0xd84698[_0x5527('0x2b')]!=='VIRTUAL'){var _0x49c2ff={};_0x49c2ff[_0xd84698[_0x5527('0x27')]]={'$like':'%'+_0x27997b['query'][_0x5527('0x3a')]+'%'};return _0x49c2ff;}})});}_0x43dcd8=_[_0x5527('0x3b')]({},_0x43dcd8,_0x27997b[_0x5527('0x3c')]);var _0x523491={'where':_0x43dcd8[_0x5527('0x37')]};return db[_0x5527('0x3d')][_0x5527('0x1e')](_0x523491)[_0x5527('0x24')](function(_0x5df30b){_0x40af6e[_0x5527('0x1e')]=_0x5df30b;if(_0x27997b['query']['includeAll']){_0x43dcd8[_0x5527('0x3e')]=[{'all':!![]}];}return db[_0x5527('0x3d')][_0x5527('0x3f')](_0x43dcd8);})[_0x5527('0x24')](function(_0xab7392){_0x40af6e['rows']=_0xab7392;return _0x40af6e;})[_0x5527('0x24')](respondWithFilteredResult(_0x3f80d8,_0x43dcd8))[_0x5527('0x40')](handleError(_0x3f80d8,null));};exports['show']=function(_0x2929f4,_0x3c28c9){var _0x68f77d={'raw':![],'where':{'id':_0x2929f4['params']['id']}},_0x220597={};_0x220597[_0x5527('0x2f')]=_[_0x5527('0x2d')](db['IntegrationReport'][_0x5527('0x41')]);_0x220597[_0x5527('0x2c')]=_[_0x5527('0x2d')](_0x2929f4[_0x5527('0x2c')]);_0x220597['filters']=_[_0x5527('0x2e')](_0x220597['model'],_0x220597[_0x5527('0x2c')]);_0x68f77d[_0x5527('0x32')]=_['intersection'](_0x220597['model'],qs[_0x5527('0x30')](_0x2929f4[_0x5527('0x2c')][_0x5527('0x30')]));_0x68f77d[_0x5527('0x32')]=_0x68f77d[_0x5527('0x32')][_0x5527('0x31')]?_0x68f77d[_0x5527('0x32')]:_0x220597[_0x5527('0x2f')];if(_0x2929f4[_0x5527('0x2c')]['includeAll']){_0x68f77d[_0x5527('0x3e')]=[{'all':!![]}];}_0x68f77d=_[_0x5527('0x3b')]({},_0x68f77d,_0x2929f4[_0x5527('0x3c')]);return db[_0x5527('0x3d')]['find'](_0x68f77d)[_0x5527('0x24')](handleEntityNotFound(_0x3c28c9,null))[_0x5527('0x24')](respondWithResult(_0x3c28c9,null))[_0x5527('0x40')](handleError(_0x3c28c9,null));};exports[_0x5527('0x42')]=function(_0x395ebb,_0x11f9eb){return db[_0x5527('0x3d')][_0x5527('0x42')](_0x395ebb[_0x5527('0x43')],{})[_0x5527('0x24')](respondWithResult(_0x11f9eb,0xc9))[_0x5527('0x40')](handleError(_0x11f9eb,null));};exports[_0x5527('0x44')]=function(_0x5b2eb2,_0x4d377b){if(_0x5b2eb2[_0x5527('0x43')]['id']){delete _0x5b2eb2[_0x5527('0x43')]['id'];}return db[_0x5527('0x3d')][_0x5527('0x45')]({'where':{'id':_0x5b2eb2[_0x5527('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d377b,null))[_0x5527('0x24')](saveUpdates(_0x5b2eb2[_0x5527('0x43')],null))['then'](respondWithResult(_0x4d377b,null))[_0x5527('0x40')](handleError(_0x4d377b,null));};exports[_0x5527('0x47')]=function(_0x20f08a,_0x42baa9){return db[_0x5527('0x3d')][_0x5527('0x45')]({'where':{'id':_0x20f08a[_0x5527('0x46')]['id']}})[_0x5527('0x24')](handleEntityNotFound(_0x42baa9,null))[_0x5527('0x24')](removeEntity(_0x42baa9,null))[_0x5527('0x40')](handleError(_0x42baa9,null));};exports[_0x5527('0x48')]=function(_0x1e75e1,_0x1b0473){return db[_0x5527('0x3d')][_0x5527('0x48')]()['then'](respondWithResult(_0x1b0473,null))['catch'](handleError(_0x1b0473,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 8e6aa34..9f6a123 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 _0xb034=['exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xb034,0x185));var _0x4b03=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb034[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x4b03('0x0'));var util=require(_0x4b03('0x1'));var logger=require(_0x4b03('0x2'))(_0x4b03('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b03('0x4'));var fs=require('fs');var path=require(_0x4b03('0x5'));var rimraf=require(_0x4b03('0x6'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x4b03('0x7')]=function(_0x7ed0be,_0x337e87){return _0x7ed0be[_0x4b03('0x8')](_0x4b03('0x9'),attributes,{'tableName':_0x4b03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x487c=['util','api','moment','bluebird','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash'];(function(_0x965af2,_0x26310a){var _0x3528bb=function(_0x5bb6c9){while(--_0x5bb6c9){_0x965af2['push'](_0x965af2['shift']());}};_0x3528bb(++_0x26310a);}(_0x487c,0x1e3));var _0xc487=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x487c[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0xc487('0x0'));var util=require(_0xc487('0x1'));var logger=require('../../config/logger')(_0xc487('0x2'));var moment=require(_0xc487('0x3'));var BPromise=require(_0xc487('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc487('0x5'));var config=require(_0xc487('0x6'));var attributes=require(_0xc487('0x7'));module[_0xc487('0x8')]=function(_0x43f310,_0x2addb2){return _0x43f310[_0xc487('0x9')](_0xc487('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 77d6714..4c64991 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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x3910c2,_0xf6f22b){var _0x452a9e=function(_0x3b13b9){while(--_0x3b13b9){_0x3910c2['push'](_0x3910c2['shift']());}};_0x452a9e(++_0xf6f22b);}(_0x2675,0x75));var _0x5267=function(_0x1706fc,_0x4da9bc){_0x1706fc=_0x1706fc-0x0;var _0x492e4f=_0x2675[_0x1706fc];return _0x492e4f;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x127543,_0x264de5){var _0x3b07bd=function(_0x5ac097){while(--_0x5ac097){_0x127543['push'](_0x127543['shift']());}};_0x3b07bd(++_0x264de5);}(_0x57ca,0x108));var _0xa57c=function(_0x4dc00b,_0x229642){_0x4dc00b=_0x4dc00b-0x0;var _0x38a107=_0x57ca[_0x4dc00b];return _0x38a107;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c4150e9..80a276b 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 _0x78b7=['index','/:id','show','/:id/sub_intervals','getIntervals','create','addInterval','post','/:id/sub_intervals/create_many','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x78b7,0x194));var _0x778b=function(_0x4dbbd4,_0x50e909){_0x4dbbd4=_0x4dbbd4-0x0;var _0x155d0b=_0x78b7[_0x4dbbd4];return _0x155d0b;};'use strict';var multer=require(_0x778b('0x0'));var util=require(_0x778b('0x1'));var path=require('path');var timeout=require(_0x778b('0x2'));var express=require(_0x778b('0x3'));var router=express[_0x778b('0x4')]();var fs_extra=require(_0x778b('0x5'));var auth=require(_0x778b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x778b('0x7'));router[_0x778b('0x8')]('/',auth[_0x778b('0x9')](),controller[_0x778b('0xa')]);router[_0x778b('0x8')](_0x778b('0xb'),auth['isAuthenticated'](),controller[_0x778b('0xc')]);router[_0x778b('0x8')](_0x778b('0xd'),auth[_0x778b('0x9')](),controller[_0x778b('0xe')]);router['post']('/',auth[_0x778b('0x9')](),controller[_0x778b('0xf')]);router['post'](_0x778b('0xd'),auth[_0x778b('0x9')](),controller[_0x778b('0x10')]);router[_0x778b('0x11')](_0x778b('0x12'),auth['isAuthenticated'](),controller['addIntervals']);router[_0x778b('0x13')](_0x778b('0xb'),auth[_0x778b('0x9')](),controller[_0x778b('0x14')]);router[_0x778b('0x15')](_0x778b('0xb'),auth[_0x778b('0x9')](),controller['destroy']);module[_0x778b('0x16')]=router; \ No newline at end of file +var _0xe626=['isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x30bb7c,_0x27a364){var _0x3b32be=function(_0x4b031d){while(--_0x4b031d){_0x30bb7c['push'](_0x30bb7c['shift']());}};_0x3b32be(++_0x27a364);}(_0xe626,0x9d));var _0x6e62=function(_0x35804d,_0x51e87c){_0x35804d=_0x35804d-0x0;var _0x5e710d=_0xe626[_0x35804d];return _0x5e710d;};'use strict';var multer=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var path=require(_0x6e62('0x2'));var timeout=require(_0x6e62('0x3'));var express=require('express');var router=express[_0x6e62('0x4')]();var fs_extra=require(_0x6e62('0x5'));var auth=require(_0x6e62('0x6'));var interaction=require(_0x6e62('0x7'));var config=require(_0x6e62('0x8'));var controller=require('./interval.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6e62('0x9')]);router[_0x6e62('0xa')]('/:id',auth[_0x6e62('0xb')](),controller[_0x6e62('0xc')]);router[_0x6e62('0xa')](_0x6e62('0xd'),auth['isAuthenticated'](),controller[_0x6e62('0xe')]);router[_0x6e62('0xf')]('/',auth['isAuthenticated'](),controller[_0x6e62('0x10')]);router['post'](_0x6e62('0xd'),auth['isAuthenticated'](),controller[_0x6e62('0x11')]);router['post'](_0x6e62('0x12'),auth[_0x6e62('0xb')](),controller[_0x6e62('0x13')]);router[_0x6e62('0x14')](_0x6e62('0x15'),auth[_0x6e62('0xb')](),controller[_0x6e62('0x16')]);router['delete']('/:id',auth[_0x6e62('0xb')](),controller[_0x6e62('0x17')]);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 45a9b64..fbcc500 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 _0x7c90=['STRING'];(function(_0x3cbf12,_0x4b9dd0){var _0x507ae7=function(_0x41e907){while(--_0x41e907){_0x3cbf12['push'](_0x3cbf12['shift']());}};_0x507ae7(++_0x4b9dd0);}(_0x7c90,0x1b2));var _0x07c9=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x7c90[_0x628eee];return _0x447718;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x07c9('0x0')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x07c9('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0x027c=['STRING','exports'];(function(_0x1b6427,_0x1628b3){var _0x44bf9f=function(_0x569b12){while(--_0x569b12){_0x1b6427['push'](_0x1b6427['shift']());}};_0x44bf9f(++_0x1628b3);}(_0x027c,0x1e7));var _0xc027=function(_0x81ad96,_0x44fede){_0x81ad96=_0x81ad96-0x0;var _0x4741fe=_0x027c[_0x81ad96];return _0x4741fe;};'use strict';var Sequelize=require('sequelize');module[_0xc027('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc027('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index f18be29..ed5b7da 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 _0x582d=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','name','filter','merge','includeAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','findOne','options','addIntervals','transaction','findAll','eml-format','rimraf','zip-dir','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','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','set','Content-Range','save','update','then','destroy','get','Intervals','UserProfileResource','stack','index','map','Interval','rawAttributes','fieldName','type'];(function(_0x20658e,_0x404a03){var _0xb901=function(_0x72e736){while(--_0x72e736){_0x20658e['push'](_0x20658e['shift']());}};_0xb901(++_0x404a03);}(_0x582d,0x7e));var _0xd582=function(_0x146c23,_0x568c04){_0x146c23=_0x146c23-0x0;var _0x413950=_0x582d[_0x146c23];return _0x413950;};'use strict';var emlformat=require(_0xd582('0x0'));var rimraf=require(_0xd582('0x1'));var zipdir=require(_0xd582('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd582('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd582('0x4'));var path=require(_0xd582('0x5'));var sox=require('sox');var csv=require(_0xd582('0x6'));var ejs=require(_0xd582('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd582('0x8'));var squel=require(_0xd582('0x9'));var crypto=require(_0xd582('0xa'));var jsforce=require(_0xd582('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd582('0x6'));var querystring=require('querystring');var Papa=require(_0xd582('0xc'));var Redis=require(_0xd582('0xd'));var authService=require(_0xd582('0xe'));var qs=require(_0xd582('0xf'));var as=require(_0xd582('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd582('0x11'))(_0xd582('0x12'));var utils=require(_0xd582('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd582('0x14'));var db=require(_0xd582('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4f7b3b,_0xc415fa){_0xc415fa=_0xc415fa||0xcc;return function(_0xc045ce){if(_0xc045ce){return _0x4f7b3b[_0xd582('0x16')](_0xc415fa);}return _0x4f7b3b[_0xd582('0x17')](_0xc415fa)[_0xd582('0x18')]();};}function respondWithResult(_0x1464ff,_0x2037c4){_0x2037c4=_0x2037c4||0xc8;return function(_0x49dfbc){if(_0x49dfbc){return _0x1464ff['status'](_0x2037c4)[_0xd582('0x19')](_0x49dfbc);}};}function respondWithFilteredResult(_0x31ccd3,_0x45d499){return function(_0x1a990c){if(_0x1a990c){var _0x6511da=typeof _0x45d499[_0xd582('0x1a')]===_0xd582('0x1b')&&typeof _0x45d499[_0xd582('0x1c')]==='undefined';var _0x584eed=_0x1a990c[_0xd582('0x1d')];var _0x1a0d19=_0x6511da?0x0:_0x45d499['offset'];var _0x1f298f=_0x6511da?_0x1a990c[_0xd582('0x1d')]:_0x45d499['offset']+_0x45d499[_0xd582('0x1c')];var _0x54a31e;if(_0x1f298f>=_0x584eed){_0x1f298f=_0x584eed;_0x54a31e=0xc8;}else{_0x54a31e=0xce;}_0x31ccd3[_0xd582('0x17')](_0x54a31e);return _0x31ccd3[_0xd582('0x1e')](_0xd582('0x1f'),_0x1a0d19+'-'+_0x1f298f+'/'+_0x584eed)[_0xd582('0x19')](_0x1a990c);}return null;};}function patchUpdates(_0x4389fc){return function(_0x3b7063){try{jsonpatch['apply'](_0x3b7063,_0x4389fc,!![]);}catch(_0x4cbf77){return BPromise['reject'](_0x4cbf77);}return _0x3b7063[_0xd582('0x20')]();};}function saveUpdates(_0x5269eb,_0x460c07){return function(_0x4aa1a9){if(_0x4aa1a9){return _0x4aa1a9[_0xd582('0x21')](_0x5269eb)[_0xd582('0x22')](function(_0x5b6134){return _0x5b6134;});}return null;};}function removeEntity(_0x2bad1f,_0x3ed198){return function(_0x5a575b){if(_0x5a575b){return _0x5a575b[_0xd582('0x23')]()['then'](function(){var _0x20a70b=_0x5a575b[_0xd582('0x24')]({'plain':!![]});var _0x1db92f=_0xd582('0x25');return db[_0xd582('0x26')]['destroy']({'where':{'type':_0x1db92f,'resourceId':_0x20a70b['id']}})[_0xd582('0x22')](function(){return _0x5a575b;});})[_0xd582('0x22')](function(){_0x2bad1f['status'](0xcc)[_0xd582('0x18')]();});}};}function handleEntityNotFound(_0x79703c,_0x5a5b3f){return function(_0x13047b){if(!_0x13047b){_0x79703c[_0xd582('0x16')](0x194);}return _0x13047b;};}function handleError(_0xe8bbdd,_0x4dd280){_0x4dd280=_0x4dd280||0x1f4;return function(_0x48e1f9){logger['error'](_0x48e1f9[_0xd582('0x27')]);if(_0x48e1f9['name']){delete _0x48e1f9['name'];}_0xe8bbdd[_0xd582('0x17')](_0x4dd280)['send'](_0x48e1f9);};}exports[_0xd582('0x28')]=function(_0x4e3b4b,_0x102cad){var _0x1c6969={},_0x32ec03={},_0x2959bc={'count':0x0,'rows':[]};var _0x4d94e7=_[_0xd582('0x29')](db[_0xd582('0x2a')][_0xd582('0x2b')],function(_0x5f0648){return{'name':_0x5f0648[_0xd582('0x2c')],'type':_0x5f0648[_0xd582('0x2d')]['key']};});_0x32ec03['model']=_[_0xd582('0x29')](_0x4d94e7,'name');_0x32ec03[_0xd582('0x2e')]=_[_0xd582('0x2f')](_0x4e3b4b[_0xd582('0x2e')]);_0x32ec03[_0xd582('0x30')]=_[_0xd582('0x31')](_0x32ec03[_0xd582('0x32')],_0x32ec03[_0xd582('0x2e')]);_0x1c6969['attributes']=_['intersection'](_0x32ec03['model'],qs[_0xd582('0x33')](_0x4e3b4b['query'][_0xd582('0x33')]));_0x1c6969[_0xd582('0x34')]=_0x1c6969[_0xd582('0x34')][_0xd582('0x35')]?_0x1c6969['attributes']:_0x32ec03[_0xd582('0x32')];if(!_0x4e3b4b[_0xd582('0x2e')][_0xd582('0x36')](_0xd582('0x37'))){_0x1c6969['limit']=qs[_0xd582('0x1c')](_0x4e3b4b[_0xd582('0x2e')][_0xd582('0x1c')]);_0x1c6969[_0xd582('0x1a')]=qs[_0xd582('0x1a')](_0x4e3b4b['query'][_0xd582('0x1a')]);}_0x1c6969[_0xd582('0x38')]=qs[_0xd582('0x39')](_0x4e3b4b['query'][_0xd582('0x39')]);_0x1c6969[_0xd582('0x3a')]=qs[_0xd582('0x30')](_['pick'](_0x4e3b4b[_0xd582('0x2e')],_0x32ec03[_0xd582('0x30')]),_0x4d94e7);if(_0x4e3b4b[_0xd582('0x2e')]['filter']){_0x1c6969[_0xd582('0x3a')]=_['merge'](_0x1c6969[_0xd582('0x3a')],{'$or':_['map'](_0x4d94e7,function(_0x1da4f6){if(_0x1da4f6[_0xd582('0x2d')]!==_0xd582('0x3b')){var _0x1547b5={};_0x1547b5[_0x1da4f6[_0xd582('0x3c')]]={'$like':'%'+_0x4e3b4b[_0xd582('0x2e')][_0xd582('0x3d')]+'%'};return _0x1547b5;}})});}_0x1c6969=_[_0xd582('0x3e')]({},_0x1c6969,_0x4e3b4b['options']);var _0x3a0e86={'where':_0x1c6969[_0xd582('0x3a')]};return db[_0xd582('0x2a')][_0xd582('0x1d')](_0x3a0e86)[_0xd582('0x22')](function(_0x1fb714){_0x2959bc[_0xd582('0x1d')]=_0x1fb714;if(_0x4e3b4b['query'][_0xd582('0x3f')]){_0x1c6969['include']=[{'all':!![]}];}return db[_0xd582('0x2a')]['findAll'](_0x1c6969);})[_0xd582('0x22')](function(_0x4f817a){_0x2959bc[_0xd582('0x40')]=_0x4f817a;return _0x2959bc;})[_0xd582('0x22')](respondWithFilteredResult(_0x102cad,_0x1c6969))[_0xd582('0x41')](handleError(_0x102cad,null));};exports[_0xd582('0x42')]=function(_0x54f1dd,_0x3c7eee){var _0x1ffe02={'raw':!![],'where':{'id':_0x54f1dd['params']['id']}},_0x14176e={};_0x14176e['model']=_[_0xd582('0x2f')](db[_0xd582('0x2a')]['rawAttributes']);_0x14176e[_0xd582('0x2e')]=_[_0xd582('0x2f')](_0x54f1dd[_0xd582('0x2e')]);_0x14176e[_0xd582('0x30')]=_['intersection'](_0x14176e[_0xd582('0x32')],_0x14176e[_0xd582('0x2e')]);_0x1ffe02[_0xd582('0x34')]=_[_0xd582('0x31')](_0x14176e[_0xd582('0x32')],qs[_0xd582('0x33')](_0x54f1dd['query']['fields']));_0x1ffe02[_0xd582('0x34')]=_0x1ffe02[_0xd582('0x34')][_0xd582('0x35')]?_0x1ffe02[_0xd582('0x34')]:_0x14176e[_0xd582('0x32')];if(_0x54f1dd[_0xd582('0x2e')][_0xd582('0x3f')]){_0x1ffe02[_0xd582('0x43')]=[{'all':!![]}];}_0x1ffe02=_['merge']({},_0x1ffe02,_0x54f1dd['options']);return db[_0xd582('0x2a')][_0xd582('0x44')](_0x1ffe02)[_0xd582('0x22')](handleEntityNotFound(_0x3c7eee,null))[_0xd582('0x22')](respondWithResult(_0x3c7eee,null))[_0xd582('0x41')](handleError(_0x3c7eee,null));};exports[_0xd582('0x45')]=function(_0x454167,_0x512235){return db[_0xd582('0x2a')][_0xd582('0x45')](_0x454167[_0xd582('0x46')],{})[_0xd582('0x22')](function(_0x475507){var _0x3586f1=_0x454167[_0xd582('0x47')][_0xd582('0x24')]({'plain':!![]});if(!_0x3586f1)throw new Error(_0xd582('0x48'));if(_0x3586f1[_0xd582('0x49')]===_0xd582('0x47')){var _0x1195a4=_0x475507['get']({'plain':!![]});var _0x2d24a3=_0xd582('0x25');return db['UserProfileSection'][_0xd582('0x44')]({'where':{'name':_0x2d24a3,'userProfileId':_0x3586f1['userProfileId']},'raw':!![]})[_0xd582('0x22')](function(_0x2f6728){if(_0x2f6728&&_0x2f6728[_0xd582('0x4a')]===0x0){return db[_0xd582('0x26')][_0xd582('0x45')]({'name':_0x1195a4['name'],'resourceId':_0x1195a4['id'],'type':_0x2f6728[_0xd582('0x3c')],'sectionId':_0x2f6728['id']},{})[_0xd582('0x22')](function(){return _0x475507;});}else{return _0x475507;}})[_0xd582('0x41')](function(_0x1b1a26){logger[_0xd582('0x4b')](_0xd582('0x4c'),_0x1b1a26);throw _0x1b1a26;});}return _0x475507;})[_0xd582('0x22')](respondWithResult(_0x512235,0xc9))['catch'](handleError(_0x512235,null));};exports[_0xd582('0x21')]=function(_0x13469a,_0x5734bf){if(_0x13469a[_0xd582('0x46')]['id']){delete _0x13469a[_0xd582('0x46')]['id'];}return db['Interval'][_0xd582('0x44')]({'where':{'id':_0x13469a[_0xd582('0x4d')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x5734bf,null))[_0xd582('0x22')](saveUpdates(_0x13469a['body'],null))['then'](respondWithResult(_0x5734bf,null))[_0xd582('0x41')](handleError(_0x5734bf,null));};exports[_0xd582('0x23')]=function(_0x5a36bb,_0x351d19){return db['Interval'][_0xd582('0x44')]({'where':{'id':_0x5a36bb[_0xd582('0x4d')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x351d19,null))[_0xd582('0x22')](removeEntity(_0x351d19,null))[_0xd582('0x41')](handleError(_0x351d19,null));};exports[_0xd582('0x4e')]=function(_0x551094,_0x4f6128,_0x46190f){if(_0x551094[_0xd582('0x46')]['id']){delete _0x551094['body']['id'];}return db[_0xd582('0x2a')][_0xd582('0x44')]({'where':{'id':_0x551094['params']['id']}})['then'](handleEntityNotFound(_0x4f6128,null))[_0xd582('0x22')](function(_0x4c9f21){if(_0x4c9f21){_0x551094[_0xd582('0x46')][_0xd582('0x4f')]=_0x4c9f21['id'];return db[_0xd582('0x2a')][_0xd582('0x45')](_0x551094[_0xd582('0x46')]);}})[_0xd582('0x22')](respondWithResult(_0x4f6128,null))['catch'](handleError(_0x4f6128,null));};exports[_0xd582('0x50')]=function(_0x4dd642,_0x15246b,_0x177741){var _0x3c86c2={};var _0x288aa2={};var _0x2076f2;var _0x28fed0;return db['Interval'][_0xd582('0x51')]({'where':{'id':_0x4dd642['params']['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x15246b,null))[_0xd582('0x22')](function(_0x413c9b){if(_0x413c9b){_0x2076f2=_0x413c9b;_0x288aa2[_0xd582('0x32')]=_[_0xd582('0x2f')](db[_0xd582('0x2a')][_0xd582('0x2b')]);_0x288aa2['query']=_[_0xd582('0x2f')](_0x4dd642[_0xd582('0x2e')]);_0x288aa2[_0xd582('0x30')]=_[_0xd582('0x31')](_0x288aa2['model'],_0x288aa2[_0xd582('0x2e')]);_0x3c86c2[_0xd582('0x34')]=_['intersection'](_0x288aa2['model'],qs[_0xd582('0x33')](_0x4dd642[_0xd582('0x2e')][_0xd582('0x33')]));_0x3c86c2[_0xd582('0x34')]=_0x3c86c2[_0xd582('0x34')]['length']?_0x3c86c2[_0xd582('0x34')]:_0x288aa2[_0xd582('0x32')];_0x3c86c2[_0xd582('0x38')]=qs['sort'](_0x4dd642['query']['sort']);_0x3c86c2[_0xd582('0x3a')]=qs['filters'](_['pick'](_0x4dd642['query'],_0x288aa2[_0xd582('0x30')]));if(_0x4dd642['query'][_0xd582('0x3d')]){_0x3c86c2['where']=_[_0xd582('0x3e')](_0x3c86c2[_0xd582('0x3a')],{'$or':_['map'](_0x3c86c2[_0xd582('0x34')],function(_0x5d8b41){var _0x456b20={};_0x456b20[_0x5d8b41]={'$like':'%'+_0x4dd642[_0xd582('0x2e')][_0xd582('0x3d')]+'%'};return _0x456b20;})});}_0x3c86c2=_[_0xd582('0x3e')]({},_0x3c86c2,_0x4dd642[_0xd582('0x52')]);return _0x2076f2[_0xd582('0x50')](_0x3c86c2);}})[_0xd582('0x22')](function(_0x1aba18){if(_0x1aba18){_0x28fed0=_0x1aba18[_0xd582('0x35')];if(!_0x4dd642[_0xd582('0x2e')][_0xd582('0x36')]('nolimit')){_0x3c86c2[_0xd582('0x1c')]=qs[_0xd582('0x1c')](_0x4dd642[_0xd582('0x2e')][_0xd582('0x1c')]);_0x3c86c2[_0xd582('0x1a')]=qs[_0xd582('0x1a')](_0x4dd642[_0xd582('0x2e')][_0xd582('0x1a')]);}return _0x2076f2[_0xd582('0x50')](_0x3c86c2);}})[_0xd582('0x22')](function(_0x16cd8a){if(_0x16cd8a){return _0x16cd8a?{'count':_0x28fed0,'rows':_0x16cd8a}:null;}})[_0xd582('0x22')](respondWithResult(_0x15246b,null))[_0xd582('0x41')](handleError(_0x15246b,null));};exports[_0xd582('0x53')]=function(_0x2aa0a4,_0x496e69,_0x3a3021){return db[_0xd582('0x2a')][_0xd582('0x51')]({'where':{'id':_0x2aa0a4[_0xd582('0x4d')]['id']}})['then'](handleEntityNotFound(_0x496e69,null))[_0xd582('0x22')](function(_0x55bf54){if(_0x55bf54){return db['sequelize'][_0xd582('0x54')](function(_0xba01f9){return db[_0xd582('0x2a')]['destroy']({'where':{'IntervalId':_0x2aa0a4[_0xd582('0x4d')]['id']},'transaction':_0xba01f9})[_0xd582('0x22')](function(_0x534bc0){var _0x4b534b=_[_0xd582('0x29')](_0x2aa0a4[_0xd582('0x46')],function(_0x2628db){delete _0x2628db['id'];_0x2628db[_0xd582('0x4f')]=_0x2aa0a4[_0xd582('0x4d')]['id'];return _0x2628db;});return db[_0xd582('0x2a')]['bulkCreate'](_0x4b534b,{'transaction':_0xba01f9});});})['then'](function(){return db[_0xd582('0x2a')][_0xd582('0x55')]({'where':{'IntervalId':_0x2aa0a4[_0xd582('0x4d')]['id']}});});}})[_0xd582('0x22')](respondWithResult(_0x496e69,null))[_0xd582('0x41')](handleError(_0x496e69,null));}; \ No newline at end of file +var _0x9e95=['includeAll','include','findAll','rows','show','params','Interval','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','addIntervals','transaction','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','undefined','count','limit','Content-Range','reject','save','update','destroy','Intervals','UserProfileResource','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x9e95,0xc2));var _0x59e9=function(_0x1b326e,_0x34ca8e){_0x1b326e=_0x1b326e-0x0;var _0x57700e=_0x9e95[_0x1b326e];return _0x57700e;};'use strict';var emlformat=require(_0x59e9('0x0'));var rimraf=require(_0x59e9('0x1'));var zipdir=require(_0x59e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59e9('0x3'));var moment=require(_0x59e9('0x4'));var BPromise=require(_0x59e9('0x5'));var Mustache=require(_0x59e9('0x6'));var util=require('util');var path=require(_0x59e9('0x7'));var sox=require(_0x59e9('0x8'));var csv=require(_0x59e9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59e9('0xa'));var _=require('lodash');var squel=require(_0x59e9('0xb'));var crypto=require('crypto');var jsforce=require(_0x59e9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x59e9('0xd'));var Papa=require(_0x59e9('0xe'));var Redis=require('ioredis');var authService=require(_0x59e9('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59e9('0x10'));var logger=require('../../config/logger')(_0x59e9('0x11'));var utils=require(_0x59e9('0x12'));var config=require(_0x59e9('0x13'));var licenseUtil=require(_0x59e9('0x14'));var db=require(_0x59e9('0x15'))['db'];var extensions=require(_0x59e9('0x16'));function respondWithStatusCode(_0x2ecb5c,_0x26c867){_0x26c867=_0x26c867||0xcc;return function(_0x669733){if(_0x669733){return _0x2ecb5c[_0x59e9('0x17')](_0x26c867);}return _0x2ecb5c['status'](_0x26c867)['end']();};}function respondWithResult(_0x133c49,_0x7e1351){_0x7e1351=_0x7e1351||0xc8;return function(_0x13e06c){if(_0x13e06c){return _0x133c49[_0x59e9('0x18')](_0x7e1351)[_0x59e9('0x19')](_0x13e06c);}};}function respondWithFilteredResult(_0x491dc2,_0xa71014){return function(_0x5ecba9){if(_0x5ecba9){var _0x2fd825=typeof _0xa71014['offset']===_0x59e9('0x1a')&&typeof _0xa71014['limit']==='undefined';var _0x53b614=_0x5ecba9[_0x59e9('0x1b')];var _0x1b19d6=_0x2fd825?0x0:_0xa71014['offset'];var _0x5effa5=_0x2fd825?_0x5ecba9[_0x59e9('0x1b')]:_0xa71014['offset']+_0xa71014[_0x59e9('0x1c')];var _0x3d4ae9;if(_0x5effa5>=_0x53b614){_0x5effa5=_0x53b614;_0x3d4ae9=0xc8;}else{_0x3d4ae9=0xce;}_0x491dc2[_0x59e9('0x18')](_0x3d4ae9);return _0x491dc2['set'](_0x59e9('0x1d'),_0x1b19d6+'-'+_0x5effa5+'/'+_0x53b614)[_0x59e9('0x19')](_0x5ecba9);}return null;};}function patchUpdates(_0x2b6a0c){return function(_0x14abeb){try{jsonpatch['apply'](_0x14abeb,_0x2b6a0c,!![]);}catch(_0x4ed725){return BPromise[_0x59e9('0x1e')](_0x4ed725);}return _0x14abeb[_0x59e9('0x1f')]();};}function saveUpdates(_0x3a4cb7,_0x1dccbd){return function(_0x4f975f){if(_0x4f975f){return _0x4f975f[_0x59e9('0x20')](_0x3a4cb7)['then'](function(_0xd7d6b7){return _0xd7d6b7;});}return null;};}function removeEntity(_0x2e223b,_0x241e50){return function(_0x9d1dac){if(_0x9d1dac){return _0x9d1dac[_0x59e9('0x21')]()['then'](function(){var _0x2e408a=_0x9d1dac['get']({'plain':!![]});var _0x4cde87=_0x59e9('0x22');return db[_0x59e9('0x23')]['destroy']({'where':{'type':_0x4cde87,'resourceId':_0x2e408a['id']}})[_0x59e9('0x24')](function(){return _0x9d1dac;});})[_0x59e9('0x24')](function(){_0x2e223b[_0x59e9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e882,_0x8edb35){return function(_0x274907){if(!_0x274907){_0x17e882[_0x59e9('0x17')](0x194);}return _0x274907;};}function handleError(_0xb56467,_0x1a24ba){_0x1a24ba=_0x1a24ba||0x1f4;return function(_0x1b7586){logger[_0x59e9('0x25')](_0x1b7586[_0x59e9('0x26')]);if(_0x1b7586[_0x59e9('0x27')]){delete _0x1b7586[_0x59e9('0x27')];}_0xb56467[_0x59e9('0x18')](_0x1a24ba)['send'](_0x1b7586);};}exports['index']=function(_0x267b5e,_0x119396){var _0x3298d9={},_0x354a99={},_0xb7ba80={'count':0x0,'rows':[]};var _0x4b0d98=_[_0x59e9('0x28')](db['Interval'][_0x59e9('0x29')],function(_0x2acd87){return{'name':_0x2acd87[_0x59e9('0x2a')],'type':_0x2acd87[_0x59e9('0x2b')][_0x59e9('0x2c')]};});_0x354a99[_0x59e9('0x2d')]=_[_0x59e9('0x28')](_0x4b0d98,'name');_0x354a99[_0x59e9('0x2e')]=_[_0x59e9('0x2f')](_0x267b5e[_0x59e9('0x2e')]);_0x354a99['filters']=_[_0x59e9('0x30')](_0x354a99[_0x59e9('0x2d')],_0x354a99['query']);_0x3298d9[_0x59e9('0x31')]=_[_0x59e9('0x30')](_0x354a99[_0x59e9('0x2d')],qs[_0x59e9('0x32')](_0x267b5e[_0x59e9('0x2e')][_0x59e9('0x32')]));_0x3298d9['attributes']=_0x3298d9[_0x59e9('0x31')][_0x59e9('0x33')]?_0x3298d9[_0x59e9('0x31')]:_0x354a99[_0x59e9('0x2d')];if(!_0x267b5e['query'][_0x59e9('0x34')](_0x59e9('0x35'))){_0x3298d9[_0x59e9('0x1c')]=qs['limit'](_0x267b5e['query']['limit']);_0x3298d9[_0x59e9('0x36')]=qs[_0x59e9('0x36')](_0x267b5e[_0x59e9('0x2e')][_0x59e9('0x36')]);}_0x3298d9[_0x59e9('0x37')]=qs[_0x59e9('0x38')](_0x267b5e[_0x59e9('0x2e')][_0x59e9('0x38')]);_0x3298d9[_0x59e9('0x39')]=qs[_0x59e9('0x3a')](_[_0x59e9('0x3b')](_0x267b5e[_0x59e9('0x2e')],_0x354a99['filters']),_0x4b0d98);if(_0x267b5e[_0x59e9('0x2e')][_0x59e9('0x3c')]){_0x3298d9[_0x59e9('0x39')]=_[_0x59e9('0x3d')](_0x3298d9[_0x59e9('0x39')],{'$or':_[_0x59e9('0x28')](_0x4b0d98,function(_0x5df43f){if(_0x5df43f[_0x59e9('0x2b')]!==_0x59e9('0x3e')){var _0x545aa8={};_0x545aa8[_0x5df43f['name']]={'$like':'%'+_0x267b5e[_0x59e9('0x2e')]['filter']+'%'};return _0x545aa8;}})});}_0x3298d9=_['merge']({},_0x3298d9,_0x267b5e[_0x59e9('0x3f')]);var _0x34f495={'where':_0x3298d9['where']};return db['Interval'][_0x59e9('0x1b')](_0x34f495)[_0x59e9('0x24')](function(_0x5579c6){_0xb7ba80[_0x59e9('0x1b')]=_0x5579c6;if(_0x267b5e[_0x59e9('0x2e')][_0x59e9('0x40')]){_0x3298d9[_0x59e9('0x41')]=[{'all':!![]}];}return db['Interval'][_0x59e9('0x42')](_0x3298d9);})['then'](function(_0x38632e){_0xb7ba80[_0x59e9('0x43')]=_0x38632e;return _0xb7ba80;})[_0x59e9('0x24')](respondWithFilteredResult(_0x119396,_0x3298d9))['catch'](handleError(_0x119396,null));};exports[_0x59e9('0x44')]=function(_0x2f584a,_0x50dc1e){var _0x297de9={'raw':!![],'where':{'id':_0x2f584a[_0x59e9('0x45')]['id']}},_0x15237d={};_0x15237d[_0x59e9('0x2d')]=_[_0x59e9('0x2f')](db['Interval'][_0x59e9('0x29')]);_0x15237d[_0x59e9('0x2e')]=_[_0x59e9('0x2f')](_0x2f584a[_0x59e9('0x2e')]);_0x15237d[_0x59e9('0x3a')]=_[_0x59e9('0x30')](_0x15237d[_0x59e9('0x2d')],_0x15237d[_0x59e9('0x2e')]);_0x297de9[_0x59e9('0x31')]=_[_0x59e9('0x30')](_0x15237d[_0x59e9('0x2d')],qs[_0x59e9('0x32')](_0x2f584a['query']['fields']));_0x297de9[_0x59e9('0x31')]=_0x297de9[_0x59e9('0x31')]['length']?_0x297de9[_0x59e9('0x31')]:_0x15237d[_0x59e9('0x2d')];if(_0x2f584a['query'][_0x59e9('0x40')]){_0x297de9[_0x59e9('0x41')]=[{'all':!![]}];}_0x297de9=_[_0x59e9('0x3d')]({},_0x297de9,_0x2f584a[_0x59e9('0x3f')]);return db[_0x59e9('0x46')][_0x59e9('0x47')](_0x297de9)[_0x59e9('0x24')](handleEntityNotFound(_0x50dc1e,null))[_0x59e9('0x24')](respondWithResult(_0x50dc1e,null))[_0x59e9('0x48')](handleError(_0x50dc1e,null));};exports[_0x59e9('0x49')]=function(_0xfaa78b,_0x4a3a78){return db[_0x59e9('0x46')][_0x59e9('0x49')](_0xfaa78b['body'],{})['then'](function(_0xe1544f){var _0x332848=_0xfaa78b['user'][_0x59e9('0x4a')]({'plain':!![]});if(!_0x332848)throw new Error(_0x59e9('0x4b'));if(_0x332848['role']==='user'){var _0x3e8fe3=_0xe1544f['get']({'plain':!![]});var _0x44edbe=_0x59e9('0x22');return db['UserProfileSection'][_0x59e9('0x47')]({'where':{'name':_0x44edbe,'userProfileId':_0x332848[_0x59e9('0x4c')]},'raw':!![]})[_0x59e9('0x24')](function(_0x24fd1b){if(_0x24fd1b&&_0x24fd1b[_0x59e9('0x4d')]===0x0){return db[_0x59e9('0x23')][_0x59e9('0x49')]({'name':_0x3e8fe3[_0x59e9('0x27')],'resourceId':_0x3e8fe3['id'],'type':_0x24fd1b[_0x59e9('0x27')],'sectionId':_0x24fd1b['id']},{})[_0x59e9('0x24')](function(){return _0xe1544f;});}else{return _0xe1544f;}})[_0x59e9('0x48')](function(_0x365fde){logger[_0x59e9('0x25')](_0x59e9('0x4e'),_0x365fde);throw _0x365fde;});}return _0xe1544f;})['then'](respondWithResult(_0x4a3a78,0xc9))['catch'](handleError(_0x4a3a78,null));};exports[_0x59e9('0x20')]=function(_0x4ab573,_0x2a463d){if(_0x4ab573[_0x59e9('0x4f')]['id']){delete _0x4ab573['body']['id'];}return db['Interval'][_0x59e9('0x47')]({'where':{'id':_0x4ab573['params']['id']}})[_0x59e9('0x24')](handleEntityNotFound(_0x2a463d,null))['then'](saveUpdates(_0x4ab573[_0x59e9('0x4f')],null))[_0x59e9('0x24')](respondWithResult(_0x2a463d,null))['catch'](handleError(_0x2a463d,null));};exports[_0x59e9('0x21')]=function(_0x3b2d08,_0x4980b1){return db[_0x59e9('0x46')][_0x59e9('0x47')]({'where':{'id':_0x3b2d08[_0x59e9('0x45')]['id']}})[_0x59e9('0x24')](handleEntityNotFound(_0x4980b1,null))['then'](removeEntity(_0x4980b1,null))[_0x59e9('0x48')](handleError(_0x4980b1,null));};exports[_0x59e9('0x50')]=function(_0x4c98fe,_0x4db555,_0x522dba){if(_0x4c98fe[_0x59e9('0x4f')]['id']){delete _0x4c98fe[_0x59e9('0x4f')]['id'];}return db['Interval'][_0x59e9('0x47')]({'where':{'id':_0x4c98fe[_0x59e9('0x45')]['id']}})[_0x59e9('0x24')](handleEntityNotFound(_0x4db555,null))[_0x59e9('0x24')](function(_0x5492d7){if(_0x5492d7){_0x4c98fe[_0x59e9('0x4f')][_0x59e9('0x51')]=_0x5492d7['id'];return db[_0x59e9('0x46')]['create'](_0x4c98fe[_0x59e9('0x4f')]);}})[_0x59e9('0x24')](respondWithResult(_0x4db555,null))[_0x59e9('0x48')](handleError(_0x4db555,null));};exports[_0x59e9('0x52')]=function(_0x325da4,_0x33ff35,_0x16cb19){var _0x3a332b={};var _0x2c249f={};var _0x3b05aa;var _0x317f92;return db[_0x59e9('0x46')][_0x59e9('0x53')]({'where':{'id':_0x325da4[_0x59e9('0x45')]['id']}})[_0x59e9('0x24')](handleEntityNotFound(_0x33ff35,null))[_0x59e9('0x24')](function(_0x313639){if(_0x313639){_0x3b05aa=_0x313639;_0x2c249f[_0x59e9('0x2d')]=_['keys'](db[_0x59e9('0x46')][_0x59e9('0x29')]);_0x2c249f[_0x59e9('0x2e')]=_['keys'](_0x325da4[_0x59e9('0x2e')]);_0x2c249f[_0x59e9('0x3a')]=_[_0x59e9('0x30')](_0x2c249f[_0x59e9('0x2d')],_0x2c249f['query']);_0x3a332b[_0x59e9('0x31')]=_[_0x59e9('0x30')](_0x2c249f[_0x59e9('0x2d')],qs['fields'](_0x325da4[_0x59e9('0x2e')][_0x59e9('0x32')]));_0x3a332b[_0x59e9('0x31')]=_0x3a332b['attributes']['length']?_0x3a332b[_0x59e9('0x31')]:_0x2c249f[_0x59e9('0x2d')];_0x3a332b[_0x59e9('0x37')]=qs['sort'](_0x325da4[_0x59e9('0x2e')]['sort']);_0x3a332b['where']=qs[_0x59e9('0x3a')](_[_0x59e9('0x3b')](_0x325da4['query'],_0x2c249f[_0x59e9('0x3a')]));if(_0x325da4[_0x59e9('0x2e')][_0x59e9('0x3c')]){_0x3a332b['where']=_[_0x59e9('0x3d')](_0x3a332b['where'],{'$or':_[_0x59e9('0x28')](_0x3a332b[_0x59e9('0x31')],function(_0x1af5af){var _0x13a846={};_0x13a846[_0x1af5af]={'$like':'%'+_0x325da4[_0x59e9('0x2e')][_0x59e9('0x3c')]+'%'};return _0x13a846;})});}_0x3a332b=_['merge']({},_0x3a332b,_0x325da4[_0x59e9('0x3f')]);return _0x3b05aa[_0x59e9('0x52')](_0x3a332b);}})[_0x59e9('0x24')](function(_0x2ed4b4){if(_0x2ed4b4){_0x317f92=_0x2ed4b4['length'];if(!_0x325da4[_0x59e9('0x2e')][_0x59e9('0x34')](_0x59e9('0x35'))){_0x3a332b[_0x59e9('0x1c')]=qs[_0x59e9('0x1c')](_0x325da4['query']['limit']);_0x3a332b['offset']=qs[_0x59e9('0x36')](_0x325da4['query'][_0x59e9('0x36')]);}return _0x3b05aa[_0x59e9('0x52')](_0x3a332b);}})[_0x59e9('0x24')](function(_0x4ee98a){if(_0x4ee98a){return _0x4ee98a?{'count':_0x317f92,'rows':_0x4ee98a}:null;}})[_0x59e9('0x24')](respondWithResult(_0x33ff35,null))[_0x59e9('0x48')](handleError(_0x33ff35,null));};exports[_0x59e9('0x54')]=function(_0x1cab20,_0xe7c30f,_0x5964f7){return db[_0x59e9('0x46')]['findOne']({'where':{'id':_0x1cab20['params']['id']}})[_0x59e9('0x24')](handleEntityNotFound(_0xe7c30f,null))[_0x59e9('0x24')](function(_0xa2046a){if(_0xa2046a){return db['sequelize'][_0x59e9('0x55')](function(_0x52bb96){return db[_0x59e9('0x46')][_0x59e9('0x21')]({'where':{'IntervalId':_0x1cab20[_0x59e9('0x45')]['id']},'transaction':_0x52bb96})['then'](function(_0x376d48){var _0xd852e9=_[_0x59e9('0x28')](_0x1cab20[_0x59e9('0x4f')],function(_0x16afa4){delete _0x16afa4['id'];_0x16afa4[_0x59e9('0x51')]=_0x1cab20[_0x59e9('0x45')]['id'];return _0x16afa4;});return db[_0x59e9('0x46')]['bulkCreate'](_0xd852e9,{'transaction':_0x52bb96});});})[_0x59e9('0x24')](function(){return db[_0x59e9('0x46')][_0x59e9('0x42')]({'where':{'IntervalId':_0x1cab20[_0x59e9('0x45')]['id']}});});}})[_0x59e9('0x24')](respondWithResult(_0xe7c30f,null))[_0x59e9('0x48')](handleError(_0xe7c30f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7ea0339..422a8ce 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 _0xd6e4=['rewrite','util','api','moment','bluebird','request-promise','../../config/environment','./interval.attributes','../../components/extensions/rewrite','Interval'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd6e4,0x83));var _0x4d6e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xd6e4[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x4d6e('0x0'));var logger=require('../../config/logger')(_0x4d6e('0x1'));var moment=require(_0x4d6e('0x2'));var BPromise=require(_0x4d6e('0x3'));var rp=require(_0x4d6e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d6e('0x5'));var attributes=require(_0x4d6e('0x6'));var extensions=require(_0x4d6e('0x7'));module['exports']=function(_0x43415a,_0xc0541b){return _0x43415a['define'](_0x4d6e('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4db40e,_0x156912){extensions[_0x4d6e('0x9')](_0x43415a,_0x4db40e);},'afterBulkCreate':function(_0x28c5e4,_0x25c242,_0x3bc06a){_0x3bc06a();extensions[_0x4d6e('0x9')](_0x43415a,_0x28c5e4[0x0]);},'afterUpdate':function(_0x2521f,_0x3aec12){extensions['rewrite'](_0x43415a,_0x2521f);},'afterDestroy':function(_0xbd0705,_0x4add5a){extensions['rewrite'](_0x43415a,_0xbd0705);}}});}; \ No newline at end of file +var _0x5aeb=['util','../../config/logger','api','moment','bluebird','path','exports','define','tools_intervals','rewrite','lodash'];(function(_0x2170e3,_0x39d8c4){var _0x4b1363=function(_0x1dd4c1){while(--_0x1dd4c1){_0x2170e3['push'](_0x2170e3['shift']());}};_0x4b1363(++_0x39d8c4);}(_0x5aeb,0xc5));var _0xb5ae=function(_0x5cc7b8,_0x4f05f2){_0x5cc7b8=_0x5cc7b8-0x0;var _0x258ed8=_0x5aeb[_0x5cc7b8];return _0x258ed8;};'use strict';var _=require(_0xb5ae('0x0'));var util=require(_0xb5ae('0x1'));var logger=require(_0xb5ae('0x2'))(_0xb5ae('0x3'));var moment=require(_0xb5ae('0x4'));var BPromise=require(_0xb5ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5ae('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xb5ae('0x7')]=function(_0x5e4b2f,_0x4aea34){return _0x5e4b2f[_0xb5ae('0x8')]('Interval',attributes,{'tableName':_0xb5ae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x486a15,_0xd78b8c){extensions[_0xb5ae('0xa')](_0x5e4b2f,_0x486a15);},'afterBulkCreate':function(_0x40079f,_0x1b8b0c,_0x2d2536){_0x2d2536();extensions['rewrite'](_0x5e4b2f,_0x40079f[0x0]);},'afterUpdate':function(_0x260dd4,_0x2dac65){extensions['rewrite'](_0x5e4b2f,_0x260dd4);},'afterDestroy':function(_0x4a67ab,_0x5643c3){extensions[_0xb5ae('0xa')](_0x5e4b2f,_0x4a67ab);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 2c53133..f3315e3 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index e4547ad..ddf0773 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x53e1cc,_0x1cfd18){var _0x311747=function(_0x3cb8e1){while(--_0x3cb8e1){_0x53e1cc['push'](_0x53e1cc['shift']());}};_0x311747(++_0x1cfd18);}(_0x2ef3,0xba));var _0x32ef=function(_0x5ad873,_0x64b432){_0x5ad873=_0x5ad873-0x0;var _0x4f1baa=_0x2ef3[_0x5ad873];return _0x4f1baa;};'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['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x4f1eec,_0x536335){var _0x5bc7ae=function(_0x4b3e8f){while(--_0x4b3e8f){_0x4f1eec['push'](_0x4f1eec['shift']());}};_0x5bc7ae(++_0x536335);}(_0x5f2f,0x73));var _0xf5f2=function(_0xf22003,_0x4daaad){_0xf22003=_0xf22003-0x0;var _0x1af727=_0x5f2f[_0xf22003];return _0x1af727;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 714ba2d..8a87993 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 _0xe34b=['oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','request','setEncoding','utf8','data','end','json','parse','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','headers','connection','remoteAddress','body','bluebird','../../config/logger','api','support','summary','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501'];(function(_0x4eff4f,_0x4cd440){var _0x46ea1f=function(_0x348c07){while(--_0x348c07){_0x4eff4f['push'](_0x4eff4f['shift']());}};_0x46ea1f(++_0x4cd440);}(_0xe34b,0x14a));var _0xbe34=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0xe34b[_0x16db8b];return _0x5ba017;};'use strict';var BPromise=require(_0xbe34('0x0'));var https=require('https');var logger=require(_0xbe34('0x1'))(_0xbe34('0x2'));var USERNAME=_0xbe34('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x29cdcb,_0x57aeec){var _0x3ffc98={'fields':{'project':{'key':_0x29cdcb['key']||'MOTGUI'},'summary':(_0x29cdcb[_0xbe34('0x4')]||_0xbe34('0x5'))+_0xbe34('0x6')+_0x29cdcb['ip'],'description':_0x29cdcb['description']||JSON[_0xbe34('0x7')](_0x29cdcb),'issuetype':{'name':_0x29cdcb[_0xbe34('0x8')]||_0xbe34('0x9')}}};_0x3ffc98[_0xbe34('0xa')][_0xbe34('0xb')]=_0x29cdcb[_0xbe34('0xc')];_0x3ffc98[_0xbe34('0xa')][_0xbe34('0xd')]=_0x29cdcb[_0xbe34('0xe')];_0x3ffc98[_0xbe34('0xa')][_0xbe34('0xf')]=_0x29cdcb[_0xbe34('0x10')];_0x3ffc98[_0xbe34('0xa')][_0xbe34('0x11')]=_0x29cdcb[_0xbe34('0x12')];_0x3ffc98[_0xbe34('0xa')]['customfield_11504']=_0x29cdcb[_0xbe34('0x13')];_0x3ffc98['fields'][_0xbe34('0x14')]=_0x29cdcb['ip'];var _0x3011e8={'host':_0xbe34('0x15'),'port':0x1bb,'path':_0xbe34('0x16'),'method':_0xbe34('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xbe34('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xbe34('0x19')](_0xbe34('0x1a'))}};var _0x4c8fe5=JSON['stringify'](_0x3ffc98);var _0x2b73e7=https[_0xbe34('0x1b')](_0x3011e8,function(_0x3bc4b2){_0x3bc4b2[_0xbe34('0x1c')](_0xbe34('0x1d'));var _0x37fd85='';_0x3bc4b2['on'](_0xbe34('0x1e'),function(_0x43fb61){_0x37fd85+=_0x43fb61;});_0x3bc4b2['on'](_0xbe34('0x1f'),function(){if(_0x57aeec){return _0x57aeec['status'](_0x3bc4b2['statusCode'])[_0xbe34('0x20')](JSON[_0xbe34('0x21')](_0x37fd85));}});});_0x2b73e7['on']('error',function(_0x5d5e47){if(_0x57aeec){return _0x57aeec[_0xbe34('0x22')](0x1f4)[_0xbe34('0x20')]({'errors':[{'message':_0xbe34('0x23'),'type':_0xbe34('0x24')}]});}});_0x2b73e7[_0xbe34('0x25')](_0x4c8fe5);_0x2b73e7[_0xbe34('0x1f')]();}exports['openIssue']=openIssue;exports[_0xbe34('0x26')]=function(_0x39b84c,_0x280337){_0x39b84c['body']['ip']=_0x39b84c[_0xbe34('0x27')]['x-forwarded-for']||_0x39b84c[_0xbe34('0x28')]['remoteAddress']||_0x39b84c['socket'][_0xbe34('0x29')]||_0x39b84c[_0xbe34('0x28')]['socket'][_0xbe34('0x29')];return openIssue(_0x39b84c[_0xbe34('0x2a')],_0x280337);}; \ No newline at end of file +var _0xe6df=['application/json','toString','base64','request','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','write','openIssue','send','body','headers','connection','remoteAddress','socket','https','../../config/logger','api','3eAmWpBVP0','key','summary','Report','stringify','issuetype','Bug','email','fields','customfield_11501','oldToken','newToken','reason','track.xcallymotion.com','/rest/api/2/issue'];(function(_0x5d84c6,_0x387ecd){var _0x7f30d0=function(_0x5a6233){while(--_0x5a6233){_0x5d84c6['push'](_0x5d84c6['shift']());}};_0x7f30d0(++_0x387ecd);}(_0xe6df,0x66));var _0xfe6d=function(_0x5f1e96,_0x50de39){_0x5f1e96=_0x5f1e96-0x0;var _0x154475=_0xe6df[_0x5f1e96];return _0x154475;};'use strict';var BPromise=require('bluebird');var https=require(_0xfe6d('0x0'));var logger=require(_0xfe6d('0x1'))(_0xfe6d('0x2'));var USERNAME='support';var PASSWORD=_0xfe6d('0x3');function openIssue(_0x2169e0,_0x55f8f6){var _0x4fbd3e={'fields':{'project':{'key':_0x2169e0[_0xfe6d('0x4')]||'MOTGUI'},'summary':(_0x2169e0[_0xfe6d('0x5')]||_0xfe6d('0x6'))+'\x20from\x20'+_0x2169e0['ip'],'description':_0x2169e0['description']||JSON[_0xfe6d('0x7')](_0x2169e0),'issuetype':{'name':_0x2169e0[_0xfe6d('0x8')]||_0xfe6d('0x9')}}};_0x4fbd3e['fields']['customfield_11500']=_0x2169e0[_0xfe6d('0xa')];_0x4fbd3e[_0xfe6d('0xb')][_0xfe6d('0xc')]=_0x2169e0[_0xfe6d('0xd')];_0x4fbd3e['fields']['customfield_11502']=_0x2169e0[_0xfe6d('0xe')];_0x4fbd3e['fields']['customfield_11503']=_0x2169e0['name'];_0x4fbd3e['fields']['customfield_11504']=_0x2169e0[_0xfe6d('0xf')];_0x4fbd3e['fields']['customfield_10102']=_0x2169e0['ip'];var _0x38e37a={'host':_0xfe6d('0x10'),'port':0x1bb,'path':_0xfe6d('0x11'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xfe6d('0x12'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xfe6d('0x13')](_0xfe6d('0x14'))}};var _0x883943=JSON[_0xfe6d('0x7')](_0x4fbd3e);var _0x32a91c=https[_0xfe6d('0x15')](_0x38e37a,function(_0xbb1a07){_0xbb1a07[_0xfe6d('0x16')](_0xfe6d('0x17'));var _0x3f5d39='';_0xbb1a07['on'](_0xfe6d('0x18'),function(_0xf8336a){_0x3f5d39+=_0xf8336a;});_0xbb1a07['on'](_0xfe6d('0x19'),function(){if(_0x55f8f6){return _0x55f8f6[_0xfe6d('0x1a')](_0xbb1a07[_0xfe6d('0x1b')])[_0xfe6d('0x1c')](JSON[_0xfe6d('0x1d')](_0x3f5d39));}});});_0x32a91c['on'](_0xfe6d('0x1e'),function(_0x2fb98b){if(_0x55f8f6){return _0x55f8f6['status'](0x1f4)[_0xfe6d('0x1c')]({'errors':[{'message':_0xfe6d('0x1f'),'type':'api.jira'}]});}});_0x32a91c[_0xfe6d('0x20')](_0x883943);_0x32a91c['end']();}exports[_0xfe6d('0x21')]=openIssue;exports[_0xfe6d('0x22')]=function(_0xefe78e,_0x5bdcae){_0xefe78e[_0xfe6d('0x23')]['ip']=_0xefe78e[_0xfe6d('0x24')]['x-forwarded-for']||_0xefe78e[_0xfe6d('0x25')][_0xfe6d('0x26')]||_0xefe78e[_0xfe6d('0x27')][_0xfe6d('0x26')]||_0xefe78e['connection'][_0xfe6d('0x27')][_0xfe6d('0x26')];return openIssue(_0xefe78e[_0xfe6d('0x23')],_0x5bdcae);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 563eae7..b19c4f3 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 _0xd64b=['../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','post','create','update','delete','exports','multer','path','express','Router','fs-extra'];(function(_0x458408,_0x47a56f){var _0x37966f=function(_0x4a530c){while(--_0x4a530c){_0x458408['push'](_0x458408['shift']());}};_0x37966f(++_0x47a56f);}(_0xd64b,0xc1));var _0xbd64=function(_0x3e7a1e,_0x1589be){_0x3e7a1e=_0x3e7a1e-0x0;var _0x267c30=_0xd64b[_0x3e7a1e];return _0x267c30;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var fs_extra=require(_0xbd64('0x4'));var auth=require(_0xbd64('0x5'));var interaction=require(_0xbd64('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbd64('0x7')]);router[_0xbd64('0x8')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xb')]);router[_0xbd64('0x8')](_0xbd64('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbd64('0xd')]('/',auth[_0xbd64('0xa')](),controller[_0xbd64('0xe')]);router['put'](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xf')]);router[_0xbd64('0x10')]('/:id',auth[_0xbd64('0xa')](),controller['destroy']);module[_0xbd64('0x11')]=router; \ No newline at end of file +var _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x1e667a,_0x48579d){var _0x3934ca=function(_0x5b3cea){while(--_0x5b3cea){_0x1e667a['push'](_0x1e667a['shift']());}};_0x3934ca(++_0x48579d);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 96f2bc1..cfaffda 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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x48813c,_0x21eefa){_0x48813c=_0x48813c-0x0;var _0x5a862a=_0x7a54[_0x48813c];return _0x5a862a;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x5d71fc,_0x4e7446){_0x5d71fc=_0x5d71fc-0x0;var _0x4beac3=_0x7a54[_0x5d71fc];return _0x4beac3;};'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 dd40098..b9568b9 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 _0xf23b=['where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','JscriptyAnswerReport','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter'];(function(_0x14d9d1,_0x47a109){var _0xc496eb=function(_0x4d7a5c){while(--_0x4d7a5c){_0x14d9d1['push'](_0x14d9d1['shift']());}};_0xc496eb(++_0x47a109);}(_0xf23b,0x133));var _0xbf23=function(_0x5ce531,_0x4c110f){_0x5ce531=_0x5ce531-0x0;var _0x4e08be=_0xf23b[_0x5ce531];return _0x4e08be;};'use strict';var emlformat=require(_0xbf23('0x0'));var rimraf=require(_0xbf23('0x1'));var zipdir=require(_0xbf23('0x2'));var jsonpatch=require(_0xbf23('0x3'));var rp=require(_0xbf23('0x4'));var moment=require('moment');var BPromise=require(_0xbf23('0x5'));var Mustache=require(_0xbf23('0x6'));var util=require(_0xbf23('0x7'));var path=require('path');var sox=require(_0xbf23('0x8'));var csv=require(_0xbf23('0x9'));var ejs=require(_0xbf23('0xa'));var fs=require('fs');var fs_extra=require(_0xbf23('0xb'));var _=require(_0xbf23('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf23('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf23('0x9'));var querystring=require(_0xbf23('0xe'));var Papa=require(_0xbf23('0xf'));var Redis=require(_0xbf23('0x10'));var authService=require(_0xbf23('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbf23('0x12'));var hardwareService=require(_0xbf23('0x13'));var logger=require(_0xbf23('0x14'))(_0xbf23('0x15'));var utils=require(_0xbf23('0x16'));var config=require(_0xbf23('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf23('0x18'))['db'];function respondWithStatusCode(_0x51e816,_0xd01a98){_0xd01a98=_0xd01a98||0xcc;return function(_0x4aea28){if(_0x4aea28){return _0x51e816[_0xbf23('0x19')](_0xd01a98);}return _0x51e816[_0xbf23('0x1a')](_0xd01a98)['end']();};}function respondWithResult(_0xb6880,_0x5a738f){_0x5a738f=_0x5a738f||0xc8;return function(_0x4db531){if(_0x4db531){return _0xb6880[_0xbf23('0x1a')](_0x5a738f)[_0xbf23('0x1b')](_0x4db531);}};}function respondWithFilteredResult(_0x5dd4f9,_0x4cb2a8){return function(_0x1cc52b){if(_0x1cc52b){var _0x581f9a=typeof _0x4cb2a8[_0xbf23('0x1c')]===_0xbf23('0x1d')&&typeof _0x4cb2a8[_0xbf23('0x1e')]===_0xbf23('0x1d');var _0x4c1cca=_0x1cc52b['count'];var _0x58b78f=_0x581f9a?0x0:_0x4cb2a8[_0xbf23('0x1c')];var _0x39f4f3=_0x581f9a?_0x1cc52b[_0xbf23('0x1f')]:_0x4cb2a8[_0xbf23('0x1c')]+_0x4cb2a8['limit'];var _0x9259ca;if(_0x39f4f3>=_0x4c1cca){_0x39f4f3=_0x4c1cca;_0x9259ca=0xc8;}else{_0x9259ca=0xce;}_0x5dd4f9[_0xbf23('0x1a')](_0x9259ca);return _0x5dd4f9[_0xbf23('0x20')]('Content-Range',_0x58b78f+'-'+_0x39f4f3+'/'+_0x4c1cca)[_0xbf23('0x1b')](_0x1cc52b);}return null;};}function patchUpdates(_0x3b6f7e){return function(_0x2bc340){try{jsonpatch[_0xbf23('0x21')](_0x2bc340,_0x3b6f7e,!![]);}catch(_0x570c84){return BPromise[_0xbf23('0x22')](_0x570c84);}return _0x2bc340['save']();};}function saveUpdates(_0xc683e8,_0x5858c7){return function(_0x190d99){if(_0x190d99){return _0x190d99[_0xbf23('0x23')](_0xc683e8)[_0xbf23('0x24')](function(_0x16e0f8){return _0x16e0f8;});}return null;};}function removeEntity(_0x5a4852,_0x5e65c8){return function(_0x5c6e8c){if(_0x5c6e8c){return _0x5c6e8c[_0xbf23('0x25')]()[_0xbf23('0x24')](function(){_0x5a4852['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1896f1,_0xa39dbc){return function(_0x130be4){if(!_0x130be4){_0x1896f1[_0xbf23('0x19')](0x194);}return _0x130be4;};}function handleError(_0x2faf90,_0x1fa3f3){_0x1fa3f3=_0x1fa3f3||0x1f4;return function(_0x30ce6a){logger[_0xbf23('0x26')](_0x30ce6a[_0xbf23('0x27')]);if(_0x30ce6a[_0xbf23('0x28')]){delete _0x30ce6a[_0xbf23('0x28')];}_0x2faf90['status'](_0x1fa3f3)['send'](_0x30ce6a);};}exports[_0xbf23('0x29')]=function(_0x5e6804,_0x2a7baf){var _0x16189f={},_0x58d130={},_0x9e2440={'count':0x0,'rows':[]};var _0x55b1e2=_['map'](db[_0xbf23('0x2a')]['rawAttributes'],function(_0xe59053){return{'name':_0xe59053[_0xbf23('0x2b')],'type':_0xe59053[_0xbf23('0x2c')][_0xbf23('0x2d')]};});_0x58d130[_0xbf23('0x2e')]=_[_0xbf23('0x2f')](_0x55b1e2,_0xbf23('0x28'));_0x58d130[_0xbf23('0x30')]=_['keys'](_0x5e6804[_0xbf23('0x30')]);_0x58d130[_0xbf23('0x31')]=_['intersection'](_0x58d130['model'],_0x58d130[_0xbf23('0x30')]);_0x16189f['attributes']=_[_0xbf23('0x32')](_0x58d130[_0xbf23('0x2e')],qs[_0xbf23('0x33')](_0x5e6804[_0xbf23('0x30')][_0xbf23('0x33')]));_0x16189f[_0xbf23('0x34')]=_0x16189f['attributes']['length']?_0x16189f[_0xbf23('0x34')]:_0x58d130[_0xbf23('0x2e')];if(!_0x5e6804['query'][_0xbf23('0x35')]('nolimit')){_0x16189f['limit']=qs[_0xbf23('0x1e')](_0x5e6804[_0xbf23('0x30')][_0xbf23('0x1e')]);_0x16189f[_0xbf23('0x1c')]=qs['offset'](_0x5e6804[_0xbf23('0x30')][_0xbf23('0x1c')]);}_0x16189f[_0xbf23('0x36')]=qs[_0xbf23('0x37')](_0x5e6804[_0xbf23('0x30')]['sort']);_0x16189f['where']=qs['filters'](_[_0xbf23('0x38')](_0x5e6804[_0xbf23('0x30')],_0x58d130['filters']),_0x55b1e2);if(_0x5e6804['query'][_0xbf23('0x39')]){_0x16189f[_0xbf23('0x3a')]=_['merge'](_0x16189f[_0xbf23('0x3a')],{'$or':_[_0xbf23('0x2f')](_0x55b1e2,function(_0x4d2ba4){if(_0x4d2ba4[_0xbf23('0x2c')]!==_0xbf23('0x3b')){var _0x122e9e={};_0x122e9e[_0x4d2ba4['name']]={'$like':'%'+_0x5e6804['query'][_0xbf23('0x39')]+'%'};return _0x122e9e;}})});}_0x16189f=_[_0xbf23('0x3c')]({},_0x16189f,_0x5e6804[_0xbf23('0x3d')]);var _0x2c361e={'where':_0x16189f[_0xbf23('0x3a')]};return db[_0xbf23('0x2a')]['count'](_0x2c361e)[_0xbf23('0x24')](function(_0x5881db){_0x9e2440[_0xbf23('0x1f')]=_0x5881db;if(_0x5e6804[_0xbf23('0x30')][_0xbf23('0x3e')]){_0x16189f[_0xbf23('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x16189f);})['then'](function(_0x5614b3){_0x9e2440[_0xbf23('0x40')]=_0x5614b3;return _0x9e2440;})['then'](respondWithFilteredResult(_0x2a7baf,_0x16189f))[_0xbf23('0x41')](handleError(_0x2a7baf,null));};exports[_0xbf23('0x42')]=function(_0x5cd2fd,_0x436337){var _0x2c9cf4={'raw':!![],'where':{'id':_0x5cd2fd[_0xbf23('0x43')]['id']}},_0x166054={};_0x166054[_0xbf23('0x2e')]=_[_0xbf23('0x44')](db['JscriptyAnswerReport']['rawAttributes']);_0x166054[_0xbf23('0x30')]=_[_0xbf23('0x44')](_0x5cd2fd[_0xbf23('0x30')]);_0x166054[_0xbf23('0x31')]=_['intersection'](_0x166054['model'],_0x166054['query']);_0x2c9cf4[_0xbf23('0x34')]=_[_0xbf23('0x32')](_0x166054[_0xbf23('0x2e')],qs[_0xbf23('0x33')](_0x5cd2fd[_0xbf23('0x30')][_0xbf23('0x33')]));_0x2c9cf4['attributes']=_0x2c9cf4[_0xbf23('0x34')]['length']?_0x2c9cf4[_0xbf23('0x34')]:_0x166054[_0xbf23('0x2e')];if(_0x5cd2fd[_0xbf23('0x30')][_0xbf23('0x3e')]){_0x2c9cf4[_0xbf23('0x3f')]=[{'all':!![]}];}_0x2c9cf4=_[_0xbf23('0x3c')]({},_0x2c9cf4,_0x5cd2fd[_0xbf23('0x3d')]);return db[_0xbf23('0x2a')]['find'](_0x2c9cf4)[_0xbf23('0x24')](handleEntityNotFound(_0x436337,null))['then'](respondWithResult(_0x436337,null))[_0xbf23('0x41')](handleError(_0x436337,null));};exports[_0xbf23('0x45')]=function(_0x3400ca,_0x5dc245){return db[_0xbf23('0x2a')][_0xbf23('0x45')](_0x3400ca[_0xbf23('0x46')],{})['then'](respondWithResult(_0x5dc245,0xc9))[_0xbf23('0x41')](handleError(_0x5dc245,null));};exports[_0xbf23('0x23')]=function(_0x58e991,_0x4c7254){if(_0x58e991[_0xbf23('0x46')]['id']){delete _0x58e991[_0xbf23('0x46')]['id'];}return db[_0xbf23('0x2a')][_0xbf23('0x47')]({'where':{'id':_0x58e991[_0xbf23('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c7254,null))[_0xbf23('0x24')](saveUpdates(_0x58e991['body'],null))['then'](respondWithResult(_0x4c7254,null))[_0xbf23('0x41')](handleError(_0x4c7254,null));};exports[_0xbf23('0x25')]=function(_0x3626e7,_0x168856){return db[_0xbf23('0x2a')][_0xbf23('0x47')]({'where':{'id':_0x3626e7[_0xbf23('0x43')]['id']}})[_0xbf23('0x24')](handleEntityNotFound(_0x168856,null))[_0xbf23('0x24')](removeEntity(_0x168856,null))[_0xbf23('0x41')](handleError(_0x168856,null));};exports[_0xbf23('0x48')]=function(_0x49f8be,_0x93199){return db[_0xbf23('0x2a')][_0xbf23('0x48')]()[_0xbf23('0x24')](respondWithResult(_0x93199,null))[_0xbf23('0x41')](handleError(_0x93199,null));}; \ No newline at end of file +var _0x8098=['set','Content-Range','apply','reject','save','then','end','error','stack','name','send','map','rawAttributes','type','model','query','keys','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','fields','length','find','create','body','update','params','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count'];(function(_0x7ca6ee,_0x230fd4){var _0x28b06b=function(_0x1e5479){while(--_0x1e5479){_0x7ca6ee['push'](_0x7ca6ee['shift']());}};_0x28b06b(++_0x230fd4);}(_0x8098,0x1ba));var _0x8809=function(_0x241ffe,_0x131524){_0x241ffe=_0x241ffe-0x0;var _0x221241=_0x8098[_0x241ffe];return _0x221241;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8809('0x0'));var jsonpatch=require(_0x8809('0x1'));var rp=require(_0x8809('0x2'));var moment=require(_0x8809('0x3'));var BPromise=require(_0x8809('0x4'));var Mustache=require('mustache');var util=require(_0x8809('0x5'));var path=require(_0x8809('0x6'));var sox=require(_0x8809('0x7'));var csv=require(_0x8809('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8809('0x9'));var _=require(_0x8809('0xa'));var squel=require('squel');var crypto=require(_0x8809('0xb'));var jsforce=require(_0x8809('0xc'));var deskjs=require(_0x8809('0xd'));var toCsv=require(_0x8809('0x8'));var querystring=require(_0x8809('0xe'));var Papa=require(_0x8809('0xf'));var Redis=require(_0x8809('0x10'));var authService=require(_0x8809('0x11'));var qs=require(_0x8809('0x12'));var as=require(_0x8809('0x13'));var hardwareService=require(_0x8809('0x14'));var logger=require(_0x8809('0x15'))(_0x8809('0x16'));var utils=require(_0x8809('0x17'));var config=require(_0x8809('0x18'));var licenseUtil=require(_0x8809('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x388b99,_0x455989){_0x455989=_0x455989||0xcc;return function(_0x4d3b4c){if(_0x4d3b4c){return _0x388b99[_0x8809('0x1a')](_0x455989);}return _0x388b99[_0x8809('0x1b')](_0x455989)['end']();};}function respondWithResult(_0x5d87df,_0x316f2c){_0x316f2c=_0x316f2c||0xc8;return function(_0x2e4279){if(_0x2e4279){return _0x5d87df[_0x8809('0x1b')](_0x316f2c)[_0x8809('0x1c')](_0x2e4279);}};}function respondWithFilteredResult(_0x131716,_0x3d4d7e){return function(_0x105bec){if(_0x105bec){var _0x5624b5=typeof _0x3d4d7e[_0x8809('0x1d')]===_0x8809('0x1e')&&typeof _0x3d4d7e['limit']===_0x8809('0x1e');var _0x369d58=_0x105bec['count'];var _0x3b0562=_0x5624b5?0x0:_0x3d4d7e[_0x8809('0x1d')];var _0x7ec1a6=_0x5624b5?_0x105bec[_0x8809('0x1f')]:_0x3d4d7e[_0x8809('0x1d')]+_0x3d4d7e['limit'];var _0x4826e2;if(_0x7ec1a6>=_0x369d58){_0x7ec1a6=_0x369d58;_0x4826e2=0xc8;}else{_0x4826e2=0xce;}_0x131716[_0x8809('0x1b')](_0x4826e2);return _0x131716[_0x8809('0x20')](_0x8809('0x21'),_0x3b0562+'-'+_0x7ec1a6+'/'+_0x369d58)[_0x8809('0x1c')](_0x105bec);}return null;};}function patchUpdates(_0x2ff4a1){return function(_0x91de1e){try{jsonpatch[_0x8809('0x22')](_0x91de1e,_0x2ff4a1,!![]);}catch(_0x404be9){return BPromise[_0x8809('0x23')](_0x404be9);}return _0x91de1e[_0x8809('0x24')]();};}function saveUpdates(_0x16893a,_0x1440aa){return function(_0x26b43e){if(_0x26b43e){return _0x26b43e['update'](_0x16893a)['then'](function(_0x34d2df){return _0x34d2df;});}return null;};}function removeEntity(_0x5984c6,_0x521840){return function(_0x54ddd8){if(_0x54ddd8){return _0x54ddd8['destroy']()[_0x8809('0x25')](function(){_0x5984c6[_0x8809('0x1b')](0xcc)[_0x8809('0x26')]();});}};}function handleEntityNotFound(_0x2bbf26,_0x2947f7){return function(_0x3d21fd){if(!_0x3d21fd){_0x2bbf26[_0x8809('0x1a')](0x194);}return _0x3d21fd;};}function handleError(_0x14f545,_0x125776){_0x125776=_0x125776||0x1f4;return function(_0x6e5dc8){logger[_0x8809('0x27')](_0x6e5dc8[_0x8809('0x28')]);if(_0x6e5dc8['name']){delete _0x6e5dc8[_0x8809('0x29')];}_0x14f545[_0x8809('0x1b')](_0x125776)[_0x8809('0x2a')](_0x6e5dc8);};}exports['index']=function(_0x13d74b,_0x443741){var _0xbba52b={},_0x296187={},_0xb9388f={'count':0x0,'rows':[]};var _0x539f32=_[_0x8809('0x2b')](db['JscriptyAnswerReport'][_0x8809('0x2c')],function(_0x197719){return{'name':_0x197719['fieldName'],'type':_0x197719[_0x8809('0x2d')]['key']};});_0x296187[_0x8809('0x2e')]=_[_0x8809('0x2b')](_0x539f32,_0x8809('0x29'));_0x296187[_0x8809('0x2f')]=_[_0x8809('0x30')](_0x13d74b[_0x8809('0x2f')]);_0x296187['filters']=_['intersection'](_0x296187[_0x8809('0x2e')],_0x296187[_0x8809('0x2f')]);_0xbba52b[_0x8809('0x31')]=_[_0x8809('0x32')](_0x296187[_0x8809('0x2e')],qs['fields'](_0x13d74b[_0x8809('0x2f')]['fields']));_0xbba52b['attributes']=_0xbba52b[_0x8809('0x31')]['length']?_0xbba52b[_0x8809('0x31')]:_0x296187['model'];if(!_0x13d74b[_0x8809('0x2f')][_0x8809('0x33')](_0x8809('0x34'))){_0xbba52b[_0x8809('0x35')]=qs[_0x8809('0x35')](_0x13d74b[_0x8809('0x2f')]['limit']);_0xbba52b[_0x8809('0x1d')]=qs[_0x8809('0x1d')](_0x13d74b['query'][_0x8809('0x1d')]);}_0xbba52b[_0x8809('0x36')]=qs[_0x8809('0x37')](_0x13d74b[_0x8809('0x2f')][_0x8809('0x37')]);_0xbba52b[_0x8809('0x38')]=qs['filters'](_[_0x8809('0x39')](_0x13d74b[_0x8809('0x2f')],_0x296187[_0x8809('0x3a')]),_0x539f32);if(_0x13d74b[_0x8809('0x2f')][_0x8809('0x3b')]){_0xbba52b[_0x8809('0x38')]=_[_0x8809('0x3c')](_0xbba52b[_0x8809('0x38')],{'$or':_['map'](_0x539f32,function(_0x13b530){if(_0x13b530[_0x8809('0x2d')]!==_0x8809('0x3d')){var _0x2b6380={};_0x2b6380[_0x13b530['name']]={'$like':'%'+_0x13d74b[_0x8809('0x2f')][_0x8809('0x3b')]+'%'};return _0x2b6380;}})});}_0xbba52b=_[_0x8809('0x3c')]({},_0xbba52b,_0x13d74b[_0x8809('0x3e')]);var _0x8e60e2={'where':_0xbba52b[_0x8809('0x38')]};return db[_0x8809('0x3f')][_0x8809('0x1f')](_0x8e60e2)[_0x8809('0x25')](function(_0x2319bb){_0xb9388f[_0x8809('0x1f')]=_0x2319bb;if(_0x13d74b[_0x8809('0x2f')][_0x8809('0x40')]){_0xbba52b[_0x8809('0x41')]=[{'all':!![]}];}return db[_0x8809('0x3f')][_0x8809('0x42')](_0xbba52b);})[_0x8809('0x25')](function(_0x16a0d1){_0xb9388f[_0x8809('0x43')]=_0x16a0d1;return _0xb9388f;})[_0x8809('0x25')](respondWithFilteredResult(_0x443741,_0xbba52b))[_0x8809('0x44')](handleError(_0x443741,null));};exports[_0x8809('0x45')]=function(_0x39a2d3,_0x5a346c){var _0x3aa95d={'raw':!![],'where':{'id':_0x39a2d3['params']['id']}},_0x2f1316={};_0x2f1316[_0x8809('0x2e')]=_[_0x8809('0x30')](db[_0x8809('0x3f')][_0x8809('0x2c')]);_0x2f1316[_0x8809('0x2f')]=_['keys'](_0x39a2d3['query']);_0x2f1316[_0x8809('0x3a')]=_[_0x8809('0x32')](_0x2f1316[_0x8809('0x2e')],_0x2f1316[_0x8809('0x2f')]);_0x3aa95d['attributes']=_['intersection'](_0x2f1316[_0x8809('0x2e')],qs[_0x8809('0x46')](_0x39a2d3['query'][_0x8809('0x46')]));_0x3aa95d[_0x8809('0x31')]=_0x3aa95d['attributes'][_0x8809('0x47')]?_0x3aa95d[_0x8809('0x31')]:_0x2f1316[_0x8809('0x2e')];if(_0x39a2d3[_0x8809('0x2f')]['includeAll']){_0x3aa95d[_0x8809('0x41')]=[{'all':!![]}];}_0x3aa95d=_['merge']({},_0x3aa95d,_0x39a2d3['options']);return db[_0x8809('0x3f')][_0x8809('0x48')](_0x3aa95d)[_0x8809('0x25')](handleEntityNotFound(_0x5a346c,null))[_0x8809('0x25')](respondWithResult(_0x5a346c,null))[_0x8809('0x44')](handleError(_0x5a346c,null));};exports[_0x8809('0x49')]=function(_0x47f7a2,_0x2bd916){return db[_0x8809('0x3f')][_0x8809('0x49')](_0x47f7a2[_0x8809('0x4a')],{})[_0x8809('0x25')](respondWithResult(_0x2bd916,0xc9))[_0x8809('0x44')](handleError(_0x2bd916,null));};exports[_0x8809('0x4b')]=function(_0x373bf4,_0x23f6f6){if(_0x373bf4[_0x8809('0x4a')]['id']){delete _0x373bf4['body']['id'];}return db[_0x8809('0x3f')][_0x8809('0x48')]({'where':{'id':_0x373bf4[_0x8809('0x4c')]['id']}})[_0x8809('0x25')](handleEntityNotFound(_0x23f6f6,null))[_0x8809('0x25')](saveUpdates(_0x373bf4[_0x8809('0x4a')],null))[_0x8809('0x25')](respondWithResult(_0x23f6f6,null))['catch'](handleError(_0x23f6f6,null));};exports[_0x8809('0x4d')]=function(_0x5496a3,_0x3ce100){return db[_0x8809('0x3f')][_0x8809('0x48')]({'where':{'id':_0x5496a3[_0x8809('0x4c')]['id']}})[_0x8809('0x25')](handleEntityNotFound(_0x3ce100,null))[_0x8809('0x25')](removeEntity(_0x3ce100,null))[_0x8809('0x44')](handleError(_0x3ce100,null));};exports[_0x8809('0x4e')]=function(_0x4dfa63,_0x46382e){return db[_0x8809('0x3f')]['describe']()['then'](respondWithResult(_0x46382e,null))[_0x8809('0x44')](handleError(_0x46382e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index dc03509..2dc31b2 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 _0x9125=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger'];(function(_0x25c820,_0x1de3ae){var _0x1837cc=function(_0x4d47d4){while(--_0x4d47d4){_0x25c820['push'](_0x25c820['shift']());}};_0x1837cc(++_0x1de3ae);}(_0x9125,0x1c5));var _0x5912=function(_0x472173,_0x140ece){_0x472173=_0x472173-0x0;var _0x5abc10=_0x9125[_0x472173];return _0x5abc10;};'use strict';var _=require(_0x5912('0x0'));var util=require(_0x5912('0x1'));var logger=require(_0x5912('0x2'))(_0x5912('0x3'));var moment=require(_0x5912('0x4'));var BPromise=require(_0x5912('0x5'));var rp=require(_0x5912('0x6'));var fs=require('fs');var path=require(_0x5912('0x7'));var rimraf=require('rimraf');var config=require(_0x5912('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x5912('0x9')]=function(_0x1da50e,_0x2d422e){return _0x1da50e[_0x5912('0xa')](_0x5912('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84bc=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x41ccb3,_0x21bc81){var _0x455da4=function(_0x4dcb67){while(--_0x4dcb67){_0x41ccb3['push'](_0x41ccb3['shift']());}};_0x455da4(++_0x21bc81);}(_0x84bc,0x64));var _0xc84b=function(_0x416c3a,_0x5ab571){_0x416c3a=_0x416c3a-0x0;var _0x6ff9fd=_0x84bc[_0x416c3a];return _0x6ff9fd;};'use strict';var _=require(_0xc84b('0x0'));var util=require('util');var logger=require(_0xc84b('0x1'))(_0xc84b('0x2'));var moment=require(_0xc84b('0x3'));var BPromise=require(_0xc84b('0x4'));var rp=require(_0xc84b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc84b('0x6'));var attributes=require(_0xc84b('0x7'));module[_0xc84b('0x8')]=function(_0x7d2ce0,_0x3e61f1){return _0x7d2ce0[_0xc84b('0x9')](_0xc84b('0xa'),attributes,{'tableName':_0xc84b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 2f1d437..71fe68e 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 _0xc584=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x4c322a,_0x41b13e){var _0x3a3be3=function(_0x55a6aa){while(--_0x55a6aa){_0x4c322a['push'](_0x4c322a['shift']());}};_0x3a3be3(++_0x41b13e);}(_0xc584,0x1e7));var _0x4c58=function(_0x3d3ddd,_0x59b504){_0x3d3ddd=_0x3d3ddd-0x0;var _0x52a4f9=_0xc584[_0x3d3ddd];return _0x52a4f9;};'use strict';var _=require(_0x4c58('0x0'));var util=require('util');var moment=require(_0x4c58('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c58('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c58('0x3'))['db'];var utils=require(_0x4c58('0x4'));var logger=require('../../config/logger')(_0x4c58('0x5'));var config=require(_0x4c58('0x6'));var jayson=require(_0x4c58('0x7'));var client=jayson[_0x4c58('0x8')][_0x4c58('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18a8e8,_0x2179d9,_0x3bef56){return new BPromise(function(_0x34a0b2,_0x58b2a5){return client['request'](_0x18a8e8,_0x3bef56)[_0x4c58('0xa')](function(_0x2753d1){logger['info'](_0x4c58('0xb'),_0x2179d9,'request\x20sent');logger[_0x4c58('0xc')](_0x4c58('0xd'),_0x2179d9,_0x4c58('0xe'),JSON['stringify'](_0x2753d1));if(_0x2753d1[_0x4c58('0xf')]){if(_0x2753d1[_0x4c58('0xf')][_0x4c58('0x10')]===0x1f4){logger['error'](_0x4c58('0xb'),_0x2179d9,_0x2753d1[_0x4c58('0xf')]['message']);return _0x58b2a5(_0x2753d1[_0x4c58('0xf')]['message']);}logger['error'](_0x4c58('0xb'),_0x2179d9,_0x2753d1[_0x4c58('0xf')]['message']);return _0x34a0b2(_0x2753d1['error'][_0x4c58('0x11')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2179d9,_0x4c58('0xe'));_0x34a0b2(_0x2753d1[_0x4c58('0x12')][_0x4c58('0x11')]);}})[_0x4c58('0x13')](function(_0x44a884){logger[_0x4c58('0xf')](_0x4c58('0xb'),_0x2179d9,_0x44a884);_0x58b2a5(_0x44a884);});});} \ No newline at end of file +var _0x9265=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x45a2a5,_0x475669){var _0x30e623=function(_0x55182d){while(--_0x55182d){_0x45a2a5['push'](_0x45a2a5['shift']());}};_0x30e623(++_0x475669);}(_0x9265,0x1b9));var _0x5926=function(_0x4f610d,_0x5d3f0f){_0x4f610d=_0x4f610d-0x0;var _0x32996a=_0x9265[_0x4f610d];return _0x32996a;};'use strict';var _=require(_0x5926('0x0'));var util=require(_0x5926('0x1'));var moment=require(_0x5926('0x2'));var BPromise=require(_0x5926('0x3'));var rs=require(_0x5926('0x4'));var fs=require('fs');var Redis=require(_0x5926('0x5'));var db=require(_0x5926('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5926('0x7'));var jayson=require(_0x5926('0x8'));var client=jayson[_0x5926('0x9')][_0x5926('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f3874,_0x41c80a,_0xb68f3){return new BPromise(function(_0x79e00a,_0x4fc29a){return client[_0x5926('0xb')](_0x4f3874,_0xb68f3)[_0x5926('0xc')](function(_0x4c812b){logger[_0x5926('0xd')](_0x5926('0xe'),_0x41c80a,_0x5926('0xf'));logger[_0x5926('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x41c80a,_0x5926('0xf'),JSON['stringify'](_0x4c812b));if(_0x4c812b[_0x5926('0x11')]){if(_0x4c812b['error']['code']===0x1f4){logger[_0x5926('0x11')](_0x5926('0xe'),_0x41c80a,_0x4c812b[_0x5926('0x11')][_0x5926('0x12')]);return _0x4fc29a(_0x4c812b[_0x5926('0x11')]['message']);}logger[_0x5926('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x41c80a,_0x4c812b['error'][_0x5926('0x12')]);return _0x79e00a(_0x4c812b['error']['message']);}else{logger[_0x5926('0xd')](_0x5926('0xe'),_0x41c80a,_0x5926('0xf'));_0x79e00a(_0x4c812b[_0x5926('0x13')][_0x5926('0x12')]);}})['catch'](function(_0x504c18){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x41c80a,_0x504c18);_0x4fc29a(_0x504c18);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 494bf39..b2a34cc 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 _0xdefb=['show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','clone','put','/:id','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get'];(function(_0x28bec0,_0x165a74){var _0x62a81d=function(_0x4a700b){while(--_0x4a700b){_0x28bec0['push'](_0x28bec0['shift']());}};_0x62a81d(++_0x165a74);}(_0xdefb,0x8c));var _0xbdef=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0xdefb[_0x2891d1];return _0x486948;};'use strict';var multer=require(_0xbdef('0x0'));var util=require(_0xbdef('0x1'));var path=require('path');var timeout=require(_0xbdef('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbdef('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbdef('0x4'));var config=require(_0xbdef('0x5'));var controller=require(_0xbdef('0x6'));router['get']('/',auth[_0xbdef('0x7')](),controller[_0xbdef('0x8')]);router[_0xbdef('0x9')]('/:id',auth[_0xbdef('0x7')](),controller[_0xbdef('0xa')]);router[_0xbdef('0x9')]('/:id/sessions',auth[_0xbdef('0x7')](),controller[_0xbdef('0xb')]);router['get'](_0xbdef('0xc'),auth[_0xbdef('0x7')](),controller[_0xbdef('0xd')]);router[_0xbdef('0x9')](_0xbdef('0xe'),auth['isAuthenticated'](),timeout(_0xbdef('0xf')),controller[_0xbdef('0x10')]);router[_0xbdef('0x11')]('/',auth[_0xbdef('0x7')](),controller[_0xbdef('0x12')]);router[_0xbdef('0x11')]('/:id/clone',auth[_0xbdef('0x7')](),controller[_0xbdef('0x13')]);router[_0xbdef('0x14')](_0xbdef('0x15'),auth[_0xbdef('0x7')](),controller[_0xbdef('0x16')]);router[_0xbdef('0x17')](_0xbdef('0x15'),auth[_0xbdef('0x7')](),controller['destroy']);module[_0xbdef('0x18')]=router; \ No newline at end of file +var _0x3f5a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','clone','put','delete','destroy','exports'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x3f5a,0x138));var _0xa3f5=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x3f5a[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0xa3f5('0x0'));var util=require(_0xa3f5('0x1'));var path=require(_0xa3f5('0x2'));var timeout=require(_0xa3f5('0x3'));var express=require(_0xa3f5('0x4'));var router=express[_0xa3f5('0x5')]();var fs_extra=require(_0xa3f5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa3f5('0x7'));var controller=require(_0xa3f5('0x8'));router[_0xa3f5('0x9')]('/',auth[_0xa3f5('0xa')](),controller[_0xa3f5('0xb')]);router[_0xa3f5('0x9')](_0xa3f5('0xc'),auth[_0xa3f5('0xa')](),controller[_0xa3f5('0xd')]);router['get']('/:id/sessions',auth[_0xa3f5('0xa')](),controller[_0xa3f5('0xe')]);router[_0xa3f5('0x9')](_0xa3f5('0xf'),auth[_0xa3f5('0xa')](),controller['getAnswers']);router[_0xa3f5('0x9')](_0xa3f5('0x10'),auth['isAuthenticated'](),timeout(_0xa3f5('0x11')),controller[_0xa3f5('0x12')]);router[_0xa3f5('0x13')]('/',auth[_0xa3f5('0xa')](),controller[_0xa3f5('0x14')]);router[_0xa3f5('0x13')]('/:id/clone',auth[_0xa3f5('0xa')](),controller[_0xa3f5('0x15')]);router[_0xa3f5('0x16')]('/:id',auth[_0xa3f5('0xa')](),controller['update']);router[_0xa3f5('0x17')](_0xa3f5('0xc'),auth['isAuthenticated'](),controller[_0xa3f5('0x18')]);module[_0xa3f5('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 72d5cfe..0ac469b 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 _0x52a5=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','isString','formData','format'];(function(_0x585ed5,_0x340e15){var _0x58b2a1=function(_0x5ee1fa){while(--_0x5ee1fa){_0x585ed5['push'](_0x585ed5['shift']());}};_0x58b2a1(++_0x340e15);}(_0x52a5,0x114));var _0x552a=function(_0x35f48e,_0x45264b){_0x35f48e=_0x35f48e-0x0;var _0x10f23f=_0x52a5[_0x35f48e];return _0x10f23f;};'use strict';var Sequelize=require(_0x552a('0x0'));var _=require(_0x552a('0x1'));var util=require(_0x552a('0x2'));module[_0x552a('0x3')]={'name':{'type':Sequelize[_0x552a('0x4')],'unique':_0x552a('0x5')},'description':{'type':Sequelize[_0x552a('0x4')]},'formData':{'type':Sequelize[_0x552a('0x6')](_0x552a('0x7')),'set':function(_0x5be5f2){if(_[_0x552a('0x8')](_0x5be5f2)){this[_0x552a('0x9')]('formData',JSON['stringify'](_0x5be5f2));}else if(_[_0x552a('0xa')](_0x5be5f2)){this['setDataValue'](_0x552a('0xb'),_0x5be5f2);}else{this[_0x552a('0x9')](_0x552a('0xb'),util[_0x552a('0xc')](_0x552a('0xd'),this[_0x552a('0xe')]('name')||'',this[_0x552a('0xe')](_0x552a('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x552a('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x552a('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xfc0e=['util','STRING','name','TEXT','long','isObjectLike','setDataValue','isString','formData','format','getDataValue','BOOLEAN','sequelize','lodash'];(function(_0x5b5cd5,_0x2ee80f){var _0x23b901=function(_0x4173f7){while(--_0x4173f7){_0x5b5cd5['push'](_0x5b5cd5['shift']());}};_0x23b901(++_0x2ee80f);}(_0xfc0e,0x178));var _0xefc0=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xfc0e[_0x1bc013];return _0x55df36;};'use strict';var Sequelize=require(_0xefc0('0x0'));var _=require(_0xefc0('0x1'));var util=require(_0xefc0('0x2'));module['exports']={'name':{'type':Sequelize[_0xefc0('0x3')],'unique':_0xefc0('0x4')},'description':{'type':Sequelize[_0xefc0('0x3')]},'formData':{'type':Sequelize[_0xefc0('0x5')](_0xefc0('0x6')),'set':function(_0x4128d5){if(_[_0xefc0('0x7')](_0x4128d5)){this[_0xefc0('0x8')]('formData',JSON['stringify'](_0x4128d5));}else if(_[_0xefc0('0x9')](_0x4128d5)){this['setDataValue']('formData',_0x4128d5);}else{this[_0xefc0('0x8')](_0xefc0('0xa'),util[_0xefc0('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xefc0('0xc')](_0xefc0('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xefc0('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xefc0('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 28efd38..4f09572 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 _0xb36f=['questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','setHeader','Content-disposition','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','JscriptyProject','findAll','rows','catch','show','keys','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Projects','UserProfileSection','params','getSessions','findOne','JscriptySessionReport','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','getSummary','starttime','startTime','-createdAt','hasOwnProperty'];(function(_0x5c5b4a,_0x557f92){var _0x9de325=function(_0x41b471){while(--_0x41b471){_0x5c5b4a['push'](_0x5c5b4a['shift']());}};_0x9de325(++_0x557f92);}(_0xb36f,0x1d6));var _0xfb36=function(_0x40f0a4,_0xed908d){_0x40f0a4=_0x40f0a4-0x0;var _0x38503e=_0xb36f[_0x40f0a4];return _0x38503e;};'use strict';var emlformat=require(_0xfb36('0x0'));var rimraf=require(_0xfb36('0x1'));var zipdir=require(_0xfb36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfb36('0x3'));var BPromise=require(_0xfb36('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfb36('0x5'));var sox=require(_0xfb36('0x6'));var csv=require('to-csv');var ejs=require(_0xfb36('0x7'));var fs=require('fs');var fs_extra=require(_0xfb36('0x8'));var _=require(_0xfb36('0x9'));var squel=require(_0xfb36('0xa'));var crypto=require('crypto');var jsforce=require(_0xfb36('0xb'));var deskjs=require(_0xfb36('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb36('0xd'));var authService=require(_0xfb36('0xe'));var qs=require(_0xfb36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb36('0x10'));var logger=require('../../config/logger')(_0xfb36('0x11'));var utils=require(_0xfb36('0x12'));var config=require(_0xfb36('0x13'));var licenseUtil=require(_0xfb36('0x14'));var db=require(_0xfb36('0x15'))['db'];function respondWithStatusCode(_0x241bf6,_0x4ff9b3){_0x4ff9b3=_0x4ff9b3||0xcc;return function(_0x46e0ad){if(_0x46e0ad){return _0x241bf6[_0xfb36('0x16')](_0x4ff9b3);}return _0x241bf6[_0xfb36('0x17')](_0x4ff9b3)[_0xfb36('0x18')]();};}function respondWithResult(_0x2b8cad,_0x53260c){_0x53260c=_0x53260c||0xc8;return function(_0x3c4149){if(_0x3c4149){return _0x2b8cad[_0xfb36('0x17')](_0x53260c)[_0xfb36('0x19')](_0x3c4149);}};}function respondWithFilteredResult(_0x5ca6a3,_0x1aa5ae){return function(_0x4b8474){if(_0x4b8474){var _0x23082f=typeof _0x1aa5ae['offset']===_0xfb36('0x1a')&&typeof _0x1aa5ae[_0xfb36('0x1b')]===_0xfb36('0x1a');var _0x5f3e31=_0x4b8474[_0xfb36('0x1c')];var _0x58ca4f=_0x23082f?0x0:_0x1aa5ae[_0xfb36('0x1d')];var _0x4b7d65=_0x23082f?_0x4b8474['count']:_0x1aa5ae[_0xfb36('0x1d')]+_0x1aa5ae[_0xfb36('0x1b')];var _0x43efe5;if(_0x4b7d65>=_0x5f3e31){_0x4b7d65=_0x5f3e31;_0x43efe5=0xc8;}else{_0x43efe5=0xce;}_0x5ca6a3['status'](_0x43efe5);return _0x5ca6a3[_0xfb36('0x1e')](_0xfb36('0x1f'),_0x58ca4f+'-'+_0x4b7d65+'/'+_0x5f3e31)[_0xfb36('0x19')](_0x4b8474);}return null;};}function patchUpdates(_0x324536){return function(_0x11f54f){try{jsonpatch['apply'](_0x11f54f,_0x324536,!![]);}catch(_0xcb10da){return BPromise['reject'](_0xcb10da);}return _0x11f54f['save']();};}function saveUpdates(_0x3903a7,_0x27c742){return function(_0x3496a0){if(_0x3496a0){return _0x3496a0[_0xfb36('0x20')](_0x3903a7)[_0xfb36('0x21')](function(_0x477c13){return _0x477c13;});}return null;};}function removeEntity(_0x177458,_0x1a28ef){return function(_0x306d37){if(_0x306d37){return _0x306d37[_0xfb36('0x22')]()[_0xfb36('0x21')](function(){var _0x2f49aa=_0x306d37[_0xfb36('0x23')]({'plain':!![]});var _0x47c315='Projects';return db[_0xfb36('0x24')]['destroy']({'where':{'type':_0x47c315,'resourceId':_0x2f49aa['id']}})['then'](function(){return _0x306d37;});})[_0xfb36('0x21')](function(){_0x177458['status'](0xcc)[_0xfb36('0x18')]();});}};}function handleEntityNotFound(_0x7e237e,_0xb82be2){return function(_0x168008){if(!_0x168008){_0x7e237e[_0xfb36('0x16')](0x194);}return _0x168008;};}function handleError(_0x5e4c07,_0x11686b){_0x11686b=_0x11686b||0x1f4;return function(_0x4a57b6){logger[_0xfb36('0x25')](_0x4a57b6[_0xfb36('0x26')]);if(_0x4a57b6[_0xfb36('0x27')]){delete _0x4a57b6[_0xfb36('0x27')];}_0x5e4c07['status'](_0x11686b)[_0xfb36('0x28')](_0x4a57b6);};}exports[_0xfb36('0x29')]=function(_0x3070d1,_0x16e59b){var _0x5a2462={},_0x515952={},_0x5e27a4={'count':0x0,'rows':[]};var _0x151a14=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x2f0d52){return{'name':_0x2f0d52[_0xfb36('0x2a')],'type':_0x2f0d52[_0xfb36('0x2b')][_0xfb36('0x2c')]};});_0x515952[_0xfb36('0x2d')]=_[_0xfb36('0x2e')](_0x151a14,_0xfb36('0x27'));_0x515952[_0xfb36('0x2f')]=_['keys'](_0x3070d1[_0xfb36('0x2f')]);_0x515952[_0xfb36('0x30')]=_[_0xfb36('0x31')](_0x515952[_0xfb36('0x2d')],_0x515952['query']);_0x5a2462[_0xfb36('0x32')]=_[_0xfb36('0x31')](_0x515952['model'],qs[_0xfb36('0x33')](_0x3070d1[_0xfb36('0x2f')]['fields']));_0x5a2462[_0xfb36('0x32')]=_0x5a2462[_0xfb36('0x32')][_0xfb36('0x34')]?_0x5a2462[_0xfb36('0x32')]:_0x515952[_0xfb36('0x2d')];if(!_0x3070d1[_0xfb36('0x2f')]['hasOwnProperty']('nolimit')){_0x5a2462['limit']=qs[_0xfb36('0x1b')](_0x3070d1[_0xfb36('0x2f')][_0xfb36('0x1b')]);_0x5a2462[_0xfb36('0x1d')]=qs[_0xfb36('0x1d')](_0x3070d1[_0xfb36('0x2f')][_0xfb36('0x1d')]);}_0x5a2462[_0xfb36('0x35')]=qs['sort'](_0x3070d1[_0xfb36('0x2f')][_0xfb36('0x36')]);_0x5a2462[_0xfb36('0x37')]=qs['filters'](_[_0xfb36('0x38')](_0x3070d1['query'],_0x515952[_0xfb36('0x30')]),_0x151a14);if(_0x3070d1[_0xfb36('0x2f')][_0xfb36('0x39')]){_0x5a2462[_0xfb36('0x37')]=_['merge'](_0x5a2462[_0xfb36('0x37')],{'$or':_[_0xfb36('0x2e')](_0x151a14,function(_0x198306){if(_0x198306[_0xfb36('0x2b')]!==_0xfb36('0x3a')){var _0x119258={};_0x119258[_0x198306[_0xfb36('0x27')]]={'$like':'%'+_0x3070d1[_0xfb36('0x2f')][_0xfb36('0x39')]+'%'};return _0x119258;}})});}_0x5a2462=_[_0xfb36('0x3b')]({},_0x5a2462,_0x3070d1[_0xfb36('0x3c')]);var _0x1239ec={'where':_0x5a2462[_0xfb36('0x37')]};return db[_0xfb36('0x3d')][_0xfb36('0x1c')](_0x1239ec)[_0xfb36('0x21')](function(_0x2a57e1){_0x5e27a4[_0xfb36('0x1c')]=_0x2a57e1;if(_0x3070d1['query']['includeAll']){_0x5a2462['include']=[{'all':!![]}];}return db[_0xfb36('0x3d')][_0xfb36('0x3e')](_0x5a2462);})[_0xfb36('0x21')](function(_0x585c3d){_0x5e27a4[_0xfb36('0x3f')]=_0x585c3d;return _0x5e27a4;})['then'](respondWithFilteredResult(_0x16e59b,_0x5a2462))[_0xfb36('0x40')](handleError(_0x16e59b,null));};exports[_0xfb36('0x41')]=function(_0x2170e6,_0x197faf){var _0x1f3f6e={'raw':![],'where':{'id':_0x2170e6['params']['id']}},_0xe7d7ba={};_0xe7d7ba['model']=_[_0xfb36('0x42')](db[_0xfb36('0x3d')][_0xfb36('0x43')]);_0xe7d7ba[_0xfb36('0x2f')]=_['keys'](_0x2170e6[_0xfb36('0x2f')]);_0xe7d7ba[_0xfb36('0x30')]=_['intersection'](_0xe7d7ba[_0xfb36('0x2d')],_0xe7d7ba[_0xfb36('0x2f')]);_0x1f3f6e[_0xfb36('0x32')]=_[_0xfb36('0x31')](_0xe7d7ba[_0xfb36('0x2d')],qs[_0xfb36('0x33')](_0x2170e6[_0xfb36('0x2f')][_0xfb36('0x33')]));_0x1f3f6e[_0xfb36('0x32')]=_0x1f3f6e['attributes'][_0xfb36('0x34')]?_0x1f3f6e[_0xfb36('0x32')]:_0xe7d7ba['model'];if(_0x2170e6['query'][_0xfb36('0x44')]){_0x1f3f6e[_0xfb36('0x45')]=[{'all':!![]}];}_0x1f3f6e=_[_0xfb36('0x3b')]({},_0x1f3f6e,_0x2170e6['options']);return db[_0xfb36('0x3d')][_0xfb36('0x46')](_0x1f3f6e)[_0xfb36('0x21')](handleEntityNotFound(_0x197faf,null))[_0xfb36('0x21')](respondWithResult(_0x197faf,null))[_0xfb36('0x40')](handleError(_0x197faf,null));};exports[_0xfb36('0x47')]=function(_0x13419e,_0x1927f0){return db[_0xfb36('0x3d')][_0xfb36('0x47')](_0x13419e[_0xfb36('0x48')],{})['then'](function(_0x51b727){var _0x5f035f=_0x13419e[_0xfb36('0x49')][_0xfb36('0x23')]({'plain':!![]});if(!_0x5f035f)throw new Error(_0xfb36('0x4a'));if(_0x5f035f[_0xfb36('0x4b')]===_0xfb36('0x49')){var _0x18ebf8=_0x51b727['get']({'plain':!![]});var _0x5beef3='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x5beef3,'userProfileId':_0x5f035f[_0xfb36('0x4c')]},'raw':!![]})['then'](function(_0x304b5b){if(_0x304b5b&&_0x304b5b['autoAssociation']===0x0){return db[_0xfb36('0x24')][_0xfb36('0x47')]({'name':_0x18ebf8[_0xfb36('0x27')],'resourceId':_0x18ebf8['id'],'type':_0x304b5b[_0xfb36('0x27')],'sectionId':_0x304b5b['id']},{})[_0xfb36('0x21')](function(){return _0x51b727;});}else{return _0x51b727;}})[_0xfb36('0x40')](function(_0x5c2a70){logger['error'](_0xfb36('0x4d'),_0x5c2a70);throw _0x5c2a70;});}return _0x51b727;})[_0xfb36('0x21')](respondWithResult(_0x1927f0,0xc9))[_0xfb36('0x40')](handleError(_0x1927f0,null));};exports[_0xfb36('0x4e')]=function(_0x24cbab,_0x44afb9){var _0x5807ee={'where':{'id':_0x24cbab['params']['id']}},_0x3f7e0e={};_0x3f7e0e[_0xfb36('0x2d')]=_['keys'](db[_0xfb36('0x3d')][_0xfb36('0x43')]);_0x5807ee[_0xfb36('0x32')]=_[_0xfb36('0x31')](_0x3f7e0e[_0xfb36('0x2d')],qs[_0xfb36('0x33')](_0x24cbab[_0xfb36('0x2f')][_0xfb36('0x33')]));_0x5807ee[_0xfb36('0x32')]=_0x5807ee[_0xfb36('0x32')]['length']?_0x5807ee[_0xfb36('0x32')]:_0x3f7e0e[_0xfb36('0x2d')];if(_0x24cbab[_0xfb36('0x2f')][_0xfb36('0x44')]){_0x5807ee[_0xfb36('0x45')]=[{'all':!![]}];}_0x5807ee=_[_0xfb36('0x3b')]({},_0x5807ee,_0x24cbab[_0xfb36('0x3c')]);return db[_0xfb36('0x3d')][_0xfb36('0x46')](_0x5807ee)['then'](handleEntityNotFound(_0x44afb9,null))[_0xfb36('0x21')](function(_0x5d62f4){if(_0x5d62f4){var _0x583591=_0x5d62f4['get']({'plain':!![]});_0x583591=qs['omit'](_0x583591,['id',_0xfb36('0x4f'),_0xfb36('0x50')]);_0x24cbab[_0xfb36('0x48')]=_[_0xfb36('0x51')](_0x24cbab['body'],['id',_0xfb36('0x4f'),_0xfb36('0x50')]);return db[_0xfb36('0x3d')][_0xfb36('0x47')](_['merge'](_0x583591,_0x24cbab[_0xfb36('0x48')]),{'include':_0x24cbab[_0xfb36('0x2f')][_0xfb36('0x44')]?[{'all':!![]}]:undefined})[_0xfb36('0x21')](function(_0x430b62){var _0x45c639=_0x24cbab[_0xfb36('0x49')][_0xfb36('0x23')]({'plain':!![]});if(!_0x45c639)throw new Error(_0xfb36('0x4a'));if(_0x45c639[_0xfb36('0x4b')]==='user'){var _0x1d6265=_0x430b62[_0xfb36('0x23')]({'plain':!![]});var _0x161d7d=_0xfb36('0x52');return db[_0xfb36('0x53')][_0xfb36('0x46')]({'where':{'name':_0x161d7d,'userProfileId':_0x45c639['userProfileId']},'raw':!![]})[_0xfb36('0x21')](function(_0x29f1a7){if(_0x29f1a7&&_0x29f1a7['autoAssociation']===0x0){return db[_0xfb36('0x24')][_0xfb36('0x47')]({'name':_0x1d6265[_0xfb36('0x27')],'resourceId':_0x1d6265['id'],'type':_0x29f1a7[_0xfb36('0x27')],'sectionId':_0x29f1a7['id']},{})[_0xfb36('0x21')](function(){return _0x430b62;});}else{return _0x430b62;}})[_0xfb36('0x40')](function(_0x3685ef){logger['error'](_0xfb36('0x4d'),_0x3685ef);throw _0x3685ef;});}return _0x430b62;});}})[_0xfb36('0x21')](respondWithResult(_0x44afb9,0xc9))[_0xfb36('0x40')](handleError(_0x44afb9,null));};exports['update']=function(_0x560549,_0xeecccf){if(_0x560549[_0xfb36('0x48')]['id']){delete _0x560549['body']['id'];}return db[_0xfb36('0x3d')]['find']({'where':{'id':_0x560549['params']['id']}})['then'](handleEntityNotFound(_0xeecccf,null))['then'](saveUpdates(_0x560549['body'],null))[_0xfb36('0x21')](respondWithResult(_0xeecccf,null))[_0xfb36('0x40')](handleError(_0xeecccf,null));};exports[_0xfb36('0x22')]=function(_0x3311c6,_0x2cea19){return db[_0xfb36('0x3d')][_0xfb36('0x46')]({'where':{'id':_0x3311c6[_0xfb36('0x54')]['id']}})[_0xfb36('0x21')](handleEntityNotFound(_0x2cea19,null))[_0xfb36('0x21')](removeEntity(_0x2cea19,null))[_0xfb36('0x40')](handleError(_0x2cea19,null));};exports[_0xfb36('0x55')]=function(_0x26e0af,_0x36cb9a,_0x4c2edc){var _0x60916={'raw':!![],'where':{}};var _0x4b3025={};var _0x5a3087={'count':0x0,'rows':[]};return db[_0xfb36('0x3d')][_0xfb36('0x56')]({'where':{'id':_0x26e0af[_0xfb36('0x54')]['id']}})[_0xfb36('0x21')](handleEntityNotFound(_0x36cb9a,null))['then'](function(_0x2d5579){if(_0x2d5579){_0x4b3025['model']=_[_0xfb36('0x42')](db[_0xfb36('0x57')][_0xfb36('0x43')]);_0x4b3025['query']=_[_0xfb36('0x42')](_0x26e0af[_0xfb36('0x2f')]);_0x4b3025[_0xfb36('0x30')]=_[_0xfb36('0x31')](_0x4b3025[_0xfb36('0x2d')],_0x4b3025['query']);_0x60916[_0xfb36('0x32')]=_[_0xfb36('0x31')](_0x4b3025[_0xfb36('0x2d')],qs[_0xfb36('0x33')](_0x26e0af[_0xfb36('0x2f')][_0xfb36('0x33')]));_0x60916[_0xfb36('0x32')]=_0x60916[_0xfb36('0x32')][_0xfb36('0x34')]?_0x60916['attributes']:_0x4b3025['model'];if(!_0x26e0af['query']['hasOwnProperty'](_0xfb36('0x58'))){_0x60916[_0xfb36('0x1b')]=qs[_0xfb36('0x1b')](_0x26e0af[_0xfb36('0x2f')][_0xfb36('0x1b')]);_0x60916[_0xfb36('0x1d')]=qs[_0xfb36('0x1d')](_0x26e0af[_0xfb36('0x2f')]['offset']);}_0x60916[_0xfb36('0x35')]=qs[_0xfb36('0x36')](_0x26e0af[_0xfb36('0x2f')]['sort']);_0x60916[_0xfb36('0x37')]=qs[_0xfb36('0x30')](_['pick'](_0x26e0af[_0xfb36('0x2f')],_0x4b3025['filters']));_0x60916[_0xfb36('0x37')][_0xfb36('0x59')]=_0x2d5579['id'];if(_0x26e0af['query'][_0xfb36('0x39')]){_0x60916[_0xfb36('0x37')]=_[_0xfb36('0x3b')](_0x60916[_0xfb36('0x37')],{'$or':_['map'](_0x60916[_0xfb36('0x32')],function(_0x240cab){var _0x272d97={};_0x272d97[_0x240cab]={'$like':'%'+_0x26e0af[_0xfb36('0x2f')]['filter']+'%'};return _0x272d97;})});}_0x60916=_['merge']({},_0x60916,_0x26e0af[_0xfb36('0x3c')]);return db[_0xfb36('0x57')][_0xfb36('0x1c')]({'where':_0x60916[_0xfb36('0x37')]})[_0xfb36('0x21')](function(_0x56e661){_0x5a3087[_0xfb36('0x1c')]=_0x56e661;if(_0x26e0af['query'][_0xfb36('0x44')]){_0x60916['include']=[{'all':!![]}];}return db[_0xfb36('0x57')]['findAll'](_0x60916);})[_0xfb36('0x21')](function(_0x4f12e0){_0x5a3087['rows']=_0x4f12e0;return _0x5a3087;});}})['then'](respondWithFilteredResult(_0x36cb9a,_0x60916))[_0xfb36('0x40')](handleError(_0x36cb9a,null));};exports[_0xfb36('0x5a')]=function(_0x5da9f1,_0x51e9f5,_0x4f05a5){var _0x207d2c={'raw':!![],'where':{}};var _0x3dd023={};var _0x1cf3ea={'count':0x0,'rows':[]};return db[_0xfb36('0x3d')][_0xfb36('0x56')]({'where':{'id':_0x5da9f1[_0xfb36('0x54')]['id']}})['then'](handleEntityNotFound(_0x51e9f5,null))['then'](function(_0x336b55){if(_0x336b55){_0x3dd023['model']=_['keys'](db[_0xfb36('0x5b')][_0xfb36('0x43')]);_0x3dd023[_0xfb36('0x2f')]=_[_0xfb36('0x42')](_0x5da9f1[_0xfb36('0x2f')]);_0x3dd023[_0xfb36('0x30')]=_[_0xfb36('0x31')](_0x3dd023['model'],_0x3dd023[_0xfb36('0x2f')]);_0x207d2c[_0xfb36('0x32')]=_[_0xfb36('0x31')](_0x3dd023['model'],qs[_0xfb36('0x33')](_0x5da9f1[_0xfb36('0x2f')][_0xfb36('0x33')]));_0x207d2c[_0xfb36('0x32')]=_0x207d2c[_0xfb36('0x32')][_0xfb36('0x34')]?_0x207d2c[_0xfb36('0x32')]:_0x3dd023['model'];if(!_0x5da9f1[_0xfb36('0x2f')]['hasOwnProperty'](_0xfb36('0x58'))){_0x207d2c[_0xfb36('0x1b')]=qs['limit'](_0x5da9f1[_0xfb36('0x2f')]['limit']);_0x207d2c[_0xfb36('0x1d')]=qs[_0xfb36('0x1d')](_0x5da9f1['query'][_0xfb36('0x1d')]);}_0x207d2c[_0xfb36('0x35')]=qs[_0xfb36('0x36')](_0x5da9f1[_0xfb36('0x2f')][_0xfb36('0x36')]);_0x207d2c['where']=qs[_0xfb36('0x30')](_[_0xfb36('0x38')](_0x5da9f1['query'],_0x3dd023[_0xfb36('0x30')]));_0x207d2c['where'][_0xfb36('0x59')]=_0x336b55['id'];if(_0x5da9f1['query']['filter']){_0x207d2c[_0xfb36('0x37')]=_[_0xfb36('0x3b')](_0x207d2c[_0xfb36('0x37')],{'$or':_[_0xfb36('0x2e')](_0x207d2c[_0xfb36('0x32')],function(_0x5296f8){var _0x1feba1={};_0x1feba1[_0x5296f8]={'$like':'%'+_0x5da9f1[_0xfb36('0x2f')][_0xfb36('0x39')]+'%'};return _0x1feba1;})});}_0x207d2c=_[_0xfb36('0x3b')]({},_0x207d2c,_0x5da9f1[_0xfb36('0x3c')]);return db[_0xfb36('0x5b')][_0xfb36('0x1c')]({'where':_0x207d2c['where']})[_0xfb36('0x21')](function(_0x37e077){_0x1cf3ea[_0xfb36('0x1c')]=_0x37e077;if(_0x5da9f1[_0xfb36('0x2f')][_0xfb36('0x44')]){_0x207d2c['include']=[{'all':!![]}];}return db[_0xfb36('0x5b')]['findAll'](_0x207d2c);})[_0xfb36('0x21')](function(_0x48039c){_0x1cf3ea[_0xfb36('0x3f')]=_0x48039c;return _0x1cf3ea;});}})['then'](respondWithFilteredResult(_0x51e9f5,_0x207d2c))[_0xfb36('0x40')](handleError(_0x51e9f5,null));};function char(_0x5642ac){return _0xfb36('0x5c')===typeof _0x5642ac?String['fromCharCode']['apply'](null,arguments):_0x5642ac;}function needsEncapsulation(_0x141d66){return!!_0x141d66&&(_0x141d66[_0xfb36('0x5d')]()[_0xfb36('0x5e')](char(0xd))>=0x0||_0x141d66['toString']()['indexOf'](char(0xa))>=0x0||_0x141d66[_0xfb36('0x5d')]()[_0xfb36('0x5e')](char(0x2c))>=0x0||_0x141d66['toString']()[_0xfb36('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x5cd903){var _0x3c2ad4=char(0x22),_0x3b02c5='\x5c'+char(0x22),_0x3b44a3=_0x5cd903[_0xfb36('0x5d')]()['replace'](new RegExp(_0x3c2ad4,'g'),_0x3b02c5);return _0x3c2ad4+_0x3b44a3+_0x3c2ad4;}exports[_0xfb36('0x5f')]=function(_0x41daa5,_0x24c1ff,_0x373c61){var _0x1a06e0,_0xfce1af;var _0x538c39={'where':{'ProjectId':_0x41daa5[_0xfb36('0x54')]['id']}};if(_0x41daa5[_0xfb36('0x2f')]['startTime']){_0x538c39['where'][_0xfb36('0x60')]=JSON['parse'](_0x41daa5['query'][_0xfb36('0x61')]);}return db[_0xfb36('0x57')][_0xfb36('0x3e')](_0x538c39)[_0xfb36('0x21')](handleEntityNotFound(_0x24c1ff,null))['then'](function(_0x56766d){if(_0x56766d){_0x1a06e0=_0x56766d;return db['JscriptyQuestionReport'][_0xfb36('0x3e')]({'where':{'SessionId':{'$in':_['map'](_0x1a06e0,'id')},'ProjectId':_0x41daa5[_0xfb36('0x54')]['id']},'order':_0xfb36('0x62')});}})['then'](handleEntityNotFound(_0x24c1ff,null))['then'](function(_0x2e0616){if(_0x2e0616){_0xfce1af=_0x2e0616;var _0x14c548={};for(var _0x5069b4=0x0,_0x718bfd=_0xfce1af[_0xfb36('0x34')];_0x5069b4<_0x718bfd;_0x5069b4++){if(!_0x14c548[_0xfb36('0x63')](_0xfce1af[_0x5069b4][_0xfb36('0x64')])){_0x14c548[_0xfce1af[_0x5069b4][_0xfb36('0x64')]]=needsEncapsulation(_0xfce1af[_0x5069b4]['question'])?encapsulate(_0xfce1af[_0x5069b4][_0xfb36('0x65')]):_0xfce1af[_0x5069b4][_0xfb36('0x65')];}}var _0x282ed6=[],_0x470540={};for(var _0x4c4dca=0x0,_0x2cfffb=_0x1a06e0['length'];_0x4c4dca<_0x2cfffb;_0x4c4dca++){_0x470540={'ProjectId':_0x41daa5[_0xfb36('0x54')]['id'],'SessionId':_0x1a06e0[_0x4c4dca]['id'],'StartTime':moment(_0x1a06e0[_0x4c4dca]['starttime'])[_0xfb36('0x66')](_0xfb36('0x67'))};for(var _0x1bbcb3=0x0,_0x5071dc=_0xfce1af['length'];_0x1bbcb3<_0x5071dc;_0x1bbcb3++){if(_0xfce1af[_0x1bbcb3][_0xfb36('0x68')]==_0x1a06e0[_0x4c4dca]['id']&&_0x14c548[_0xfb36('0x63')](_0xfce1af[_0x1bbcb3][_0xfb36('0x64')])){_0x470540[_0x14c548[_0xfce1af[_0x1bbcb3][_0xfb36('0x64')]]]=_0xfce1af[_0x1bbcb3][_0xfb36('0x69')];}}for(var _0x12f38f in _0x14c548){if(!_0x470540[_0xfb36('0x63')](_0x14c548[_0x12f38f])){_0x470540[_0x14c548[_0x12f38f]]=null;}}_0x282ed6[_0xfb36('0x6a')](_0x470540);}return _0x282ed6;}})[_0xfb36('0x21')](function(_0x48e8e8){if(!_['isEmpty'](_0x48e8e8)){var _0xa9ec1c=toCsv(_0x48e8e8);var _0x2c56a0=Date[_0xfb36('0x6b')]();fs[_0xfb36('0x6c')](util[_0xfb36('0x66')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x41daa5[_0xfb36('0x54')]['id'],_0x2c56a0),_0xa9ec1c);_0x24c1ff[_0xfb36('0x6d')](_0xfb36('0x6e'),'attachment;\x20filename='+util[_0xfb36('0x66')]('Jscripty_Project_%d_Summary_%s.csv',_0x41daa5['params']['id'],_0x2c56a0));_0x24c1ff[_0xfb36('0x6d')]('Content-type',_0xfb36('0x6f'));return _0x24c1ff[_0xfb36('0x70')](util[_0xfb36('0x66')](_0xfb36('0x71'),_0x41daa5['params']['id'],_0x2c56a0));}else{return _0x24c1ff['sendStatus'](0xcc);}})[_0xfb36('0x40')](handleError(_0x24c1ff,null));}; \ No newline at end of file +var _0xc29b=['include','findAll','rows','catch','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','nolimit','order','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','offset','sort','pick','filter','where','merge','VIRTUAL','options','JscriptyProject','includeAll'];(function(_0x485090,_0x4cc6db){var _0x384156=function(_0x220572){while(--_0x220572){_0x485090['push'](_0x485090['shift']());}};_0x384156(++_0x4cc6db);}(_0xc29b,0x12d));var _0xbc29=function(_0x4e3a71,_0x41dc0e){_0x4e3a71=_0x4e3a71-0x0;var _0x1ce30e=_0xc29b[_0x4e3a71];return _0x1ce30e;};'use strict';var emlformat=require(_0xbc29('0x0'));var rimraf=require(_0xbc29('0x1'));var zipdir=require(_0xbc29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc29('0x3'));var moment=require(_0xbc29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc29('0x5'));var util=require(_0xbc29('0x6'));var path=require(_0xbc29('0x7'));var sox=require(_0xbc29('0x8'));var csv=require(_0xbc29('0x9'));var ejs=require(_0xbc29('0xa'));var fs=require('fs');var fs_extra=require(_0xbc29('0xb'));var _=require(_0xbc29('0xc'));var squel=require(_0xbc29('0xd'));var crypto=require(_0xbc29('0xe'));var jsforce=require(_0xbc29('0xf'));var deskjs=require(_0xbc29('0x10'));var toCsv=require(_0xbc29('0x9'));var querystring=require(_0xbc29('0x11'));var Papa=require(_0xbc29('0x12'));var Redis=require(_0xbc29('0x13'));var authService=require(_0xbc29('0x14'));var qs=require(_0xbc29('0x15'));var as=require(_0xbc29('0x16'));var hardwareService=require(_0xbc29('0x17'));var logger=require('../../config/logger')(_0xbc29('0x18'));var utils=require(_0xbc29('0x19'));var config=require(_0xbc29('0x1a'));var licenseUtil=require(_0xbc29('0x1b'));var db=require(_0xbc29('0x1c'))['db'];function respondWithStatusCode(_0x2794c6,_0x352c9e){_0x352c9e=_0x352c9e||0xcc;return function(_0x5e581f){if(_0x5e581f){return _0x2794c6[_0xbc29('0x1d')](_0x352c9e);}return _0x2794c6[_0xbc29('0x1e')](_0x352c9e)[_0xbc29('0x1f')]();};}function respondWithResult(_0x515ea8,_0x483fbe){_0x483fbe=_0x483fbe||0xc8;return function(_0x1892fc){if(_0x1892fc){return _0x515ea8['status'](_0x483fbe)[_0xbc29('0x20')](_0x1892fc);}};}function respondWithFilteredResult(_0x3f0264,_0x46eb03){return function(_0x490030){if(_0x490030){var _0x3b31b1=typeof _0x46eb03['offset']===_0xbc29('0x21')&&typeof _0x46eb03[_0xbc29('0x22')]===_0xbc29('0x21');var _0x1e7f15=_0x490030[_0xbc29('0x23')];var _0x42b0be=_0x3b31b1?0x0:_0x46eb03['offset'];var _0x9e84e3=_0x3b31b1?_0x490030[_0xbc29('0x23')]:_0x46eb03['offset']+_0x46eb03['limit'];var _0x30c251;if(_0x9e84e3>=_0x1e7f15){_0x9e84e3=_0x1e7f15;_0x30c251=0xc8;}else{_0x30c251=0xce;}_0x3f0264['status'](_0x30c251);return _0x3f0264['set'](_0xbc29('0x24'),_0x42b0be+'-'+_0x9e84e3+'/'+_0x1e7f15)[_0xbc29('0x20')](_0x490030);}return null;};}function patchUpdates(_0x1912ea){return function(_0x371adc){try{jsonpatch[_0xbc29('0x25')](_0x371adc,_0x1912ea,!![]);}catch(_0x3b6304){return BPromise[_0xbc29('0x26')](_0x3b6304);}return _0x371adc[_0xbc29('0x27')]();};}function saveUpdates(_0x5cdc9e,_0x115592){return function(_0x35920d){if(_0x35920d){return _0x35920d[_0xbc29('0x28')](_0x5cdc9e)[_0xbc29('0x29')](function(_0x1ae3f2){return _0x1ae3f2;});}return null;};}function removeEntity(_0x5c6f6d,_0x24523f){return function(_0x3ca9dc){if(_0x3ca9dc){return _0x3ca9dc[_0xbc29('0x2a')]()[_0xbc29('0x29')](function(){var _0x56b31a=_0x3ca9dc[_0xbc29('0x2b')]({'plain':!![]});var _0x3ad136='Projects';return db[_0xbc29('0x2c')][_0xbc29('0x2a')]({'where':{'type':_0x3ad136,'resourceId':_0x56b31a['id']}})['then'](function(){return _0x3ca9dc;});})['then'](function(){_0x5c6f6d[_0xbc29('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b462a,_0x349dce){return function(_0xf9f8cf){if(!_0xf9f8cf){_0x4b462a[_0xbc29('0x1d')](0x194);}return _0xf9f8cf;};}function handleError(_0x5ba311,_0x2840ca){_0x2840ca=_0x2840ca||0x1f4;return function(_0x3febdf){logger[_0xbc29('0x2d')](_0x3febdf[_0xbc29('0x2e')]);if(_0x3febdf[_0xbc29('0x2f')]){delete _0x3febdf['name'];}_0x5ba311['status'](_0x2840ca)[_0xbc29('0x30')](_0x3febdf);};}exports[_0xbc29('0x31')]=function(_0x5a8d4d,_0x2d89e1){var _0x397152={},_0x415d2d={},_0x3ee6e3={'count':0x0,'rows':[]};var _0x2f9863=_[_0xbc29('0x32')](db['JscriptyProject'][_0xbc29('0x33')],function(_0x82912){return{'name':_0x82912[_0xbc29('0x34')],'type':_0x82912[_0xbc29('0x35')]['key']};});_0x415d2d[_0xbc29('0x36')]=_[_0xbc29('0x32')](_0x2f9863,_0xbc29('0x2f'));_0x415d2d['query']=_['keys'](_0x5a8d4d[_0xbc29('0x37')]);_0x415d2d[_0xbc29('0x38')]=_[_0xbc29('0x39')](_0x415d2d['model'],_0x415d2d[_0xbc29('0x37')]);_0x397152[_0xbc29('0x3a')]=_[_0xbc29('0x39')](_0x415d2d[_0xbc29('0x36')],qs['fields'](_0x5a8d4d['query']['fields']));_0x397152[_0xbc29('0x3a')]=_0x397152[_0xbc29('0x3a')][_0xbc29('0x3b')]?_0x397152['attributes']:_0x415d2d['model'];if(!_0x5a8d4d[_0xbc29('0x37')][_0xbc29('0x3c')]('nolimit')){_0x397152['limit']=qs[_0xbc29('0x22')](_0x5a8d4d[_0xbc29('0x37')][_0xbc29('0x22')]);_0x397152[_0xbc29('0x3d')]=qs[_0xbc29('0x3d')](_0x5a8d4d[_0xbc29('0x37')]['offset']);}_0x397152['order']=qs[_0xbc29('0x3e')](_0x5a8d4d['query'][_0xbc29('0x3e')]);_0x397152['where']=qs[_0xbc29('0x38')](_[_0xbc29('0x3f')](_0x5a8d4d[_0xbc29('0x37')],_0x415d2d[_0xbc29('0x38')]),_0x2f9863);if(_0x5a8d4d[_0xbc29('0x37')][_0xbc29('0x40')]){_0x397152[_0xbc29('0x41')]=_[_0xbc29('0x42')](_0x397152[_0xbc29('0x41')],{'$or':_['map'](_0x2f9863,function(_0x1d1079){if(_0x1d1079[_0xbc29('0x35')]!==_0xbc29('0x43')){var _0x3610b0={};_0x3610b0[_0x1d1079[_0xbc29('0x2f')]]={'$like':'%'+_0x5a8d4d['query'][_0xbc29('0x40')]+'%'};return _0x3610b0;}})});}_0x397152=_[_0xbc29('0x42')]({},_0x397152,_0x5a8d4d[_0xbc29('0x44')]);var _0x5d7bae={'where':_0x397152['where']};return db[_0xbc29('0x45')][_0xbc29('0x23')](_0x5d7bae)[_0xbc29('0x29')](function(_0xf8bd18){_0x3ee6e3[_0xbc29('0x23')]=_0xf8bd18;if(_0x5a8d4d[_0xbc29('0x37')][_0xbc29('0x46')]){_0x397152[_0xbc29('0x47')]=[{'all':!![]}];}return db[_0xbc29('0x45')][_0xbc29('0x48')](_0x397152);})[_0xbc29('0x29')](function(_0x33508d){_0x3ee6e3[_0xbc29('0x49')]=_0x33508d;return _0x3ee6e3;})['then'](respondWithFilteredResult(_0x2d89e1,_0x397152))[_0xbc29('0x4a')](handleError(_0x2d89e1,null));};exports['show']=function(_0x204668,_0x7826ed){var _0x2e94f8={'raw':![],'where':{'id':_0x204668['params']['id']}},_0x29306d={};_0x29306d[_0xbc29('0x36')]=_[_0xbc29('0x4b')](db[_0xbc29('0x45')][_0xbc29('0x33')]);_0x29306d[_0xbc29('0x37')]=_['keys'](_0x204668[_0xbc29('0x37')]);_0x29306d[_0xbc29('0x38')]=_[_0xbc29('0x39')](_0x29306d[_0xbc29('0x36')],_0x29306d[_0xbc29('0x37')]);_0x2e94f8['attributes']=_['intersection'](_0x29306d[_0xbc29('0x36')],qs[_0xbc29('0x4c')](_0x204668[_0xbc29('0x37')][_0xbc29('0x4c')]));_0x2e94f8['attributes']=_0x2e94f8[_0xbc29('0x3a')][_0xbc29('0x3b')]?_0x2e94f8['attributes']:_0x29306d[_0xbc29('0x36')];if(_0x204668['query'][_0xbc29('0x46')]){_0x2e94f8['include']=[{'all':!![]}];}_0x2e94f8=_[_0xbc29('0x42')]({},_0x2e94f8,_0x204668[_0xbc29('0x44')]);return db[_0xbc29('0x45')][_0xbc29('0x4d')](_0x2e94f8)[_0xbc29('0x29')](handleEntityNotFound(_0x7826ed,null))['then'](respondWithResult(_0x7826ed,null))[_0xbc29('0x4a')](handleError(_0x7826ed,null));};exports['create']=function(_0x55c0cc,_0x2ff594){return db[_0xbc29('0x45')][_0xbc29('0x4e')](_0x55c0cc[_0xbc29('0x4f')],{})[_0xbc29('0x29')](function(_0x24f611){var _0x447619=_0x55c0cc[_0xbc29('0x50')]['get']({'plain':!![]});if(!_0x447619)throw new Error(_0xbc29('0x51'));if(_0x447619[_0xbc29('0x52')]===_0xbc29('0x50')){var _0x599ba7=_0x24f611[_0xbc29('0x2b')]({'plain':!![]});var _0x3f0ad3='Projects';return db[_0xbc29('0x53')][_0xbc29('0x4d')]({'where':{'name':_0x3f0ad3,'userProfileId':_0x447619[_0xbc29('0x54')]},'raw':!![]})[_0xbc29('0x29')](function(_0x5b8791){if(_0x5b8791&&_0x5b8791[_0xbc29('0x55')]===0x0){return db[_0xbc29('0x2c')][_0xbc29('0x4e')]({'name':_0x599ba7[_0xbc29('0x2f')],'resourceId':_0x599ba7['id'],'type':_0x5b8791['name'],'sectionId':_0x5b8791['id']},{})[_0xbc29('0x29')](function(){return _0x24f611;});}else{return _0x24f611;}})['catch'](function(_0xbeb8f1){logger[_0xbc29('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbeb8f1);throw _0xbeb8f1;});}return _0x24f611;})[_0xbc29('0x29')](respondWithResult(_0x2ff594,0xc9))[_0xbc29('0x4a')](handleError(_0x2ff594,null));};exports['clone']=function(_0x33d09f,_0x1d72f8){var _0x2cb68f={'where':{'id':_0x33d09f[_0xbc29('0x56')]['id']}},_0x57db9b={};_0x57db9b[_0xbc29('0x36')]=_[_0xbc29('0x4b')](db['JscriptyProject'][_0xbc29('0x33')]);_0x2cb68f[_0xbc29('0x3a')]=_[_0xbc29('0x39')](_0x57db9b[_0xbc29('0x36')],qs[_0xbc29('0x4c')](_0x33d09f[_0xbc29('0x37')][_0xbc29('0x4c')]));_0x2cb68f[_0xbc29('0x3a')]=_0x2cb68f[_0xbc29('0x3a')]['length']?_0x2cb68f[_0xbc29('0x3a')]:_0x57db9b[_0xbc29('0x36')];if(_0x33d09f[_0xbc29('0x37')][_0xbc29('0x46')]){_0x2cb68f['include']=[{'all':!![]}];}_0x2cb68f=_[_0xbc29('0x42')]({},_0x2cb68f,_0x33d09f[_0xbc29('0x44')]);return db['JscriptyProject'][_0xbc29('0x4d')](_0x2cb68f)['then'](handleEntityNotFound(_0x1d72f8,null))[_0xbc29('0x29')](function(_0x1fcb31){if(_0x1fcb31){var _0x5e7b1e=_0x1fcb31[_0xbc29('0x2b')]({'plain':!![]});_0x5e7b1e=qs[_0xbc29('0x57')](_0x5e7b1e,['id',_0xbc29('0x58'),_0xbc29('0x59')]);_0x33d09f[_0xbc29('0x4f')]=_[_0xbc29('0x57')](_0x33d09f[_0xbc29('0x4f')],['id',_0xbc29('0x58'),'updatedAt']);return db[_0xbc29('0x45')][_0xbc29('0x4e')](_[_0xbc29('0x42')](_0x5e7b1e,_0x33d09f[_0xbc29('0x4f')]),{'include':_0x33d09f[_0xbc29('0x37')][_0xbc29('0x46')]?[{'all':!![]}]:undefined})[_0xbc29('0x29')](function(_0x4d94ff){var _0x50a5ad=_0x33d09f[_0xbc29('0x50')][_0xbc29('0x2b')]({'plain':!![]});if(!_0x50a5ad)throw new Error(_0xbc29('0x51'));if(_0x50a5ad[_0xbc29('0x52')]===_0xbc29('0x50')){var _0x21a0fc=_0x4d94ff['get']({'plain':!![]});var _0x4c3f19='Projects';return db[_0xbc29('0x53')][_0xbc29('0x4d')]({'where':{'name':_0x4c3f19,'userProfileId':_0x50a5ad['userProfileId']},'raw':!![]})[_0xbc29('0x29')](function(_0x3868ec){if(_0x3868ec&&_0x3868ec[_0xbc29('0x55')]===0x0){return db[_0xbc29('0x2c')][_0xbc29('0x4e')]({'name':_0x21a0fc[_0xbc29('0x2f')],'resourceId':_0x21a0fc['id'],'type':_0x3868ec[_0xbc29('0x2f')],'sectionId':_0x3868ec['id']},{})['then'](function(){return _0x4d94ff;});}else{return _0x4d94ff;}})['catch'](function(_0x10bb26){logger[_0xbc29('0x2d')](_0xbc29('0x5a'),_0x10bb26);throw _0x10bb26;});}return _0x4d94ff;});}})['then'](respondWithResult(_0x1d72f8,0xc9))[_0xbc29('0x4a')](handleError(_0x1d72f8,null));};exports[_0xbc29('0x28')]=function(_0x214900,_0x51c48b){if(_0x214900['body']['id']){delete _0x214900[_0xbc29('0x4f')]['id'];}return db[_0xbc29('0x45')][_0xbc29('0x4d')]({'where':{'id':_0x214900[_0xbc29('0x56')]['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x51c48b,null))[_0xbc29('0x29')](saveUpdates(_0x214900[_0xbc29('0x4f')],null))['then'](respondWithResult(_0x51c48b,null))[_0xbc29('0x4a')](handleError(_0x51c48b,null));};exports['destroy']=function(_0x133a66,_0x281c07){return db[_0xbc29('0x45')][_0xbc29('0x4d')]({'where':{'id':_0x133a66[_0xbc29('0x56')]['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x281c07,null))[_0xbc29('0x29')](removeEntity(_0x281c07,null))[_0xbc29('0x4a')](handleError(_0x281c07,null));};exports[_0xbc29('0x5b')]=function(_0x12a9a7,_0x444fe3,_0x3e54){var _0x2b840c={'raw':!![],'where':{}};var _0x137ca0={};var _0x1dd872={'count':0x0,'rows':[]};return db[_0xbc29('0x45')][_0xbc29('0x5c')]({'where':{'id':_0x12a9a7[_0xbc29('0x56')]['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x444fe3,null))[_0xbc29('0x29')](function(_0x72fffd){if(_0x72fffd){_0x137ca0[_0xbc29('0x36')]=_[_0xbc29('0x4b')](db[_0xbc29('0x5d')]['rawAttributes']);_0x137ca0[_0xbc29('0x37')]=_[_0xbc29('0x4b')](_0x12a9a7['query']);_0x137ca0['filters']=_[_0xbc29('0x39')](_0x137ca0[_0xbc29('0x36')],_0x137ca0[_0xbc29('0x37')]);_0x2b840c['attributes']=_[_0xbc29('0x39')](_0x137ca0['model'],qs[_0xbc29('0x4c')](_0x12a9a7['query'][_0xbc29('0x4c')]));_0x2b840c['attributes']=_0x2b840c[_0xbc29('0x3a')][_0xbc29('0x3b')]?_0x2b840c[_0xbc29('0x3a')]:_0x137ca0[_0xbc29('0x36')];if(!_0x12a9a7[_0xbc29('0x37')][_0xbc29('0x3c')](_0xbc29('0x5e'))){_0x2b840c[_0xbc29('0x22')]=qs[_0xbc29('0x22')](_0x12a9a7[_0xbc29('0x37')][_0xbc29('0x22')]);_0x2b840c[_0xbc29('0x3d')]=qs[_0xbc29('0x3d')](_0x12a9a7[_0xbc29('0x37')][_0xbc29('0x3d')]);}_0x2b840c[_0xbc29('0x5f')]=qs[_0xbc29('0x3e')](_0x12a9a7[_0xbc29('0x37')][_0xbc29('0x3e')]);_0x2b840c[_0xbc29('0x41')]=qs[_0xbc29('0x38')](_[_0xbc29('0x3f')](_0x12a9a7['query'],_0x137ca0[_0xbc29('0x38')]));_0x2b840c['where'][_0xbc29('0x60')]=_0x72fffd['id'];if(_0x12a9a7[_0xbc29('0x37')][_0xbc29('0x40')]){_0x2b840c[_0xbc29('0x41')]=_[_0xbc29('0x42')](_0x2b840c[_0xbc29('0x41')],{'$or':_[_0xbc29('0x32')](_0x2b840c[_0xbc29('0x3a')],function(_0x32946e){var _0x3015bb={};_0x3015bb[_0x32946e]={'$like':'%'+_0x12a9a7[_0xbc29('0x37')][_0xbc29('0x40')]+'%'};return _0x3015bb;})});}_0x2b840c=_[_0xbc29('0x42')]({},_0x2b840c,_0x12a9a7[_0xbc29('0x44')]);return db['JscriptySessionReport']['count']({'where':_0x2b840c[_0xbc29('0x41')]})[_0xbc29('0x29')](function(_0x11c585){_0x1dd872['count']=_0x11c585;if(_0x12a9a7[_0xbc29('0x37')][_0xbc29('0x46')]){_0x2b840c[_0xbc29('0x47')]=[{'all':!![]}];}return db[_0xbc29('0x5d')][_0xbc29('0x48')](_0x2b840c);})[_0xbc29('0x29')](function(_0x56e8d3){_0x1dd872[_0xbc29('0x49')]=_0x56e8d3;return _0x1dd872;});}})[_0xbc29('0x29')](respondWithFilteredResult(_0x444fe3,_0x2b840c))[_0xbc29('0x4a')](handleError(_0x444fe3,null));};exports[_0xbc29('0x61')]=function(_0x157e19,_0x59bc3a,_0x49be87){var _0x1185c7={'raw':!![],'where':{}};var _0x23bf7e={};var _0x48ac78={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbc29('0x5c')]({'where':{'id':_0x157e19['params']['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x59bc3a,null))[_0xbc29('0x29')](function(_0x2ab3f9){if(_0x2ab3f9){_0x23bf7e['model']=_[_0xbc29('0x4b')](db[_0xbc29('0x62')]['rawAttributes']);_0x23bf7e[_0xbc29('0x37')]=_[_0xbc29('0x4b')](_0x157e19[_0xbc29('0x37')]);_0x23bf7e['filters']=_[_0xbc29('0x39')](_0x23bf7e[_0xbc29('0x36')],_0x23bf7e[_0xbc29('0x37')]);_0x1185c7['attributes']=_[_0xbc29('0x39')](_0x23bf7e['model'],qs[_0xbc29('0x4c')](_0x157e19['query'][_0xbc29('0x4c')]));_0x1185c7[_0xbc29('0x3a')]=_0x1185c7[_0xbc29('0x3a')][_0xbc29('0x3b')]?_0x1185c7[_0xbc29('0x3a')]:_0x23bf7e[_0xbc29('0x36')];if(!_0x157e19[_0xbc29('0x37')]['hasOwnProperty'](_0xbc29('0x5e'))){_0x1185c7[_0xbc29('0x22')]=qs['limit'](_0x157e19[_0xbc29('0x37')][_0xbc29('0x22')]);_0x1185c7[_0xbc29('0x3d')]=qs['offset'](_0x157e19[_0xbc29('0x37')][_0xbc29('0x3d')]);}_0x1185c7[_0xbc29('0x5f')]=qs[_0xbc29('0x3e')](_0x157e19[_0xbc29('0x37')][_0xbc29('0x3e')]);_0x1185c7[_0xbc29('0x41')]=qs[_0xbc29('0x38')](_[_0xbc29('0x3f')](_0x157e19[_0xbc29('0x37')],_0x23bf7e[_0xbc29('0x38')]));_0x1185c7[_0xbc29('0x41')][_0xbc29('0x60')]=_0x2ab3f9['id'];if(_0x157e19[_0xbc29('0x37')][_0xbc29('0x40')]){_0x1185c7[_0xbc29('0x41')]=_['merge'](_0x1185c7[_0xbc29('0x41')],{'$or':_['map'](_0x1185c7['attributes'],function(_0x440a91){var _0x36d682={};_0x36d682[_0x440a91]={'$like':'%'+_0x157e19['query'][_0xbc29('0x40')]+'%'};return _0x36d682;})});}_0x1185c7=_['merge']({},_0x1185c7,_0x157e19[_0xbc29('0x44')]);return db['JscriptyAnswerReport']['count']({'where':_0x1185c7[_0xbc29('0x41')]})[_0xbc29('0x29')](function(_0xb2d416){_0x48ac78[_0xbc29('0x23')]=_0xb2d416;if(_0x157e19['query']['includeAll']){_0x1185c7[_0xbc29('0x47')]=[{'all':!![]}];}return db[_0xbc29('0x62')]['findAll'](_0x1185c7);})['then'](function(_0x191a01){_0x48ac78[_0xbc29('0x49')]=_0x191a01;return _0x48ac78;});}})['then'](respondWithFilteredResult(_0x59bc3a,_0x1185c7))['catch'](handleError(_0x59bc3a,null));};function char(_0x4e645e){return _0xbc29('0x63')===typeof _0x4e645e?String[_0xbc29('0x64')][_0xbc29('0x25')](null,arguments):_0x4e645e;}function needsEncapsulation(_0x44292f){return!!_0x44292f&&(_0x44292f[_0xbc29('0x65')]()[_0xbc29('0x66')](char(0xd))>=0x0||_0x44292f['toString']()[_0xbc29('0x66')](char(0xa))>=0x0||_0x44292f['toString']()[_0xbc29('0x66')](char(0x2c))>=0x0||_0x44292f[_0xbc29('0x65')]()[_0xbc29('0x66')](char(0x22))>=0x0);}function encapsulate(_0xbb5c70){var _0x10007d=char(0x22),_0x467461='\x5c'+char(0x22),_0x28c6ae=_0xbb5c70[_0xbc29('0x65')]()['replace'](new RegExp(_0x10007d,'g'),_0x467461);return _0x10007d+_0x28c6ae+_0x10007d;}exports[_0xbc29('0x67')]=function(_0x5c07cf,_0x18cb60,_0x253ba4){var _0x10a789,_0x33b8d3;var _0xe5ce2c={'where':{'ProjectId':_0x5c07cf[_0xbc29('0x56')]['id']}};if(_0x5c07cf[_0xbc29('0x37')]['startTime']){_0xe5ce2c[_0xbc29('0x41')][_0xbc29('0x68')]=JSON[_0xbc29('0x69')](_0x5c07cf[_0xbc29('0x37')][_0xbc29('0x6a')]);}return db['JscriptySessionReport'][_0xbc29('0x48')](_0xe5ce2c)[_0xbc29('0x29')](handleEntityNotFound(_0x18cb60,null))[_0xbc29('0x29')](function(_0x1d603c){if(_0x1d603c){_0x10a789=_0x1d603c;return db[_0xbc29('0x6b')][_0xbc29('0x48')]({'where':{'SessionId':{'$in':_[_0xbc29('0x32')](_0x10a789,'id')},'ProjectId':_0x5c07cf[_0xbc29('0x56')]['id']},'order':_0xbc29('0x6c')});}})[_0xbc29('0x29')](handleEntityNotFound(_0x18cb60,null))[_0xbc29('0x29')](function(_0x29f5a0){if(_0x29f5a0){_0x33b8d3=_0x29f5a0;var _0x9017c5={};for(var _0x5b9631=0x0,_0x5cc2c5=_0x33b8d3['length'];_0x5b9631<_0x5cc2c5;_0x5b9631++){if(!_0x9017c5['hasOwnProperty'](_0x33b8d3[_0x5b9631][_0xbc29('0x6d')])){_0x9017c5[_0x33b8d3[_0x5b9631][_0xbc29('0x6d')]]=needsEncapsulation(_0x33b8d3[_0x5b9631][_0xbc29('0x6e')])?encapsulate(_0x33b8d3[_0x5b9631][_0xbc29('0x6e')]):_0x33b8d3[_0x5b9631][_0xbc29('0x6e')];}}var _0x48fb48=[],_0x3e8dbb={};for(var _0x1fb337=0x0,_0x3763f7=_0x10a789['length'];_0x1fb337<_0x3763f7;_0x1fb337++){_0x3e8dbb={'ProjectId':_0x5c07cf[_0xbc29('0x56')]['id'],'SessionId':_0x10a789[_0x1fb337]['id'],'StartTime':moment(_0x10a789[_0x1fb337][_0xbc29('0x68')])[_0xbc29('0x6f')](_0xbc29('0x70'))};for(var _0xd8a929=0x0,_0x432bf4=_0x33b8d3['length'];_0xd8a929<_0x432bf4;_0xd8a929++){if(_0x33b8d3[_0xd8a929][_0xbc29('0x71')]==_0x10a789[_0x1fb337]['id']&&_0x9017c5[_0xbc29('0x3c')](_0x33b8d3[_0xd8a929]['questionId'])){_0x3e8dbb[_0x9017c5[_0x33b8d3[_0xd8a929][_0xbc29('0x6d')]]]=_0x33b8d3[_0xd8a929]['answer'];}}for(var _0x309607 in _0x9017c5){if(!_0x3e8dbb['hasOwnProperty'](_0x9017c5[_0x309607])){_0x3e8dbb[_0x9017c5[_0x309607]]=null;}}_0x48fb48[_0xbc29('0x72')](_0x3e8dbb);}return _0x48fb48;}})[_0xbc29('0x29')](function(_0x1b28c4){if(!_[_0xbc29('0x73')](_0x1b28c4)){var _0x11b5e7=toCsv(_0x1b28c4);var _0x3ad4e0=Date[_0xbc29('0x74')]();fs['writeFileSync'](util[_0xbc29('0x6f')](_0xbc29('0x75'),_0x5c07cf[_0xbc29('0x56')]['id'],_0x3ad4e0),_0x11b5e7);_0x18cb60[_0xbc29('0x76')](_0xbc29('0x77'),_0xbc29('0x78')+util[_0xbc29('0x6f')](_0xbc29('0x79'),_0x5c07cf['params']['id'],_0x3ad4e0));_0x18cb60[_0xbc29('0x76')]('Content-type',_0xbc29('0x7a'));return _0x18cb60[_0xbc29('0x7b')](util[_0xbc29('0x6f')](_0xbc29('0x75'),_0x5c07cf['params']['id'],_0x3ad4e0));}else{return _0x18cb60[_0xbc29('0x1d')](0xcc);}})[_0xbc29('0x4a')](handleError(_0x18cb60,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4d1420d..b22fd73 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 _0xe4b8=['./jscriptyProject.attributes','exports','JscriptyProject','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x110ca4,_0x3f17fe){var _0x40226a=function(_0x4266de){while(--_0x4266de){_0x110ca4['push'](_0x110ca4['shift']());}};_0x40226a(++_0x3f17fe);}(_0xe4b8,0x179));var _0x8e4b=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xe4b8[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var logger=require(_0x8e4b('0x2'))(_0x8e4b('0x3'));var moment=require(_0x8e4b('0x4'));var BPromise=require(_0x8e4b('0x5'));var rp=require(_0x8e4b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e4b('0x7'));var attributes=require(_0x8e4b('0x8'));module[_0x8e4b('0x9')]=function(_0x47e630,_0x2796f8){return _0x47e630['define'](_0x8e4b('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27c5=['request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','../../config/logger','api','moment'];(function(_0x3e1ac8,_0x5e6f0e){var _0x3c72c9=function(_0x458823){while(--_0x458823){_0x3e1ac8['push'](_0x3e1ac8['shift']());}};_0x3c72c9(++_0x5e6f0e);}(_0x27c5,0x173));var _0x527c=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x27c5[_0x3f4891];return _0x54f2d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x527c('0x0'))(_0x527c('0x1'));var moment=require(_0x527c('0x2'));var BPromise=require('bluebird');var rp=require(_0x527c('0x3'));var fs=require('fs');var path=require(_0x527c('0x4'));var rimraf=require(_0x527c('0x5'));var config=require(_0x527c('0x6'));var attributes=require(_0x527c('0x7'));module[_0x527c('0x8')]=function(_0x37bd95,_0x552d9b){return _0x37bd95[_0x527c('0x9')]('JscriptyProject',attributes,{'tableName':_0x527c('0xa'),'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 bb207b1..64a7460 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x547001,_0x5f46e4){var _0x56cf18=function(_0x5244bf){while(--_0x5244bf){_0x547001['push'](_0x547001['shift']());}};_0x56cf18(++_0x5f46e4);}(_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 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x35c134,_0x1ec327){var _0x9187b1=function(_0x495941){while(--_0x495941){_0x35c134['push'](_0x35c134['shift']());}};_0x9187b1(++_0x1ec327);}(_0xaa88,0x137));var _0x8aa8=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0xaa88[_0x483e3a];return _0x43fca9;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 5d73dba..7f4c3be 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 _0x9f71=['destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','create','put','delete'];(function(_0x13b796,_0x19507b){var _0x54757d=function(_0x5805ea){while(--_0x5805ea){_0x13b796['push'](_0x13b796['shift']());}};_0x54757d(++_0x19507b);}(_0x9f71,0xb5));var _0x19f7=function(_0xe6ba3b,_0x58e953){_0xe6ba3b=_0xe6ba3b-0x0;var _0x19adbe=_0x9f71[_0xe6ba3b];return _0x19adbe;};'use strict';var multer=require(_0x19f7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x19f7('0x1'));var express=require(_0x19f7('0x2'));var router=express[_0x19f7('0x3')]();var fs_extra=require(_0x19f7('0x4'));var auth=require(_0x19f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x19f7('0x6'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x19f7('0x7')](),controller[_0x19f7('0x8')]);router[_0x19f7('0x9')](_0x19f7('0xa'),auth[_0x19f7('0x7')](),controller[_0x19f7('0xb')]);router[_0x19f7('0x9')]('/:id',auth[_0x19f7('0x7')](),controller[_0x19f7('0xc')]);router[_0x19f7('0xd')]('/',auth[_0x19f7('0x7')](),controller[_0x19f7('0xe')]);router[_0x19f7('0xf')]('/:id',auth[_0x19f7('0x7')](),controller['update']);router[_0x19f7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x19f7('0x11')]);module['exports']=router; \ No newline at end of file +var _0xed4b=['put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./jscriptyQuestionReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create'];(function(_0x28a9e5,_0x44ae3c){var _0x56f081=function(_0x38bbcf){while(--_0x38bbcf){_0x28a9e5['push'](_0x28a9e5['shift']());}};_0x56f081(++_0x44ae3c);}(_0xed4b,0x1bc));var _0xbed4=function(_0x523fe4,_0x44e4b6){_0x523fe4=_0x523fe4-0x0;var _0x2513ce=_0xed4b[_0x523fe4];return _0x2513ce;};'use strict';var multer=require('multer');var util=require(_0xbed4('0x0'));var path=require(_0xbed4('0x1'));var timeout=require(_0xbed4('0x2'));var express=require(_0xbed4('0x3'));var router=express[_0xbed4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbed4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbed4('0x6'));router['get']('/',auth[_0xbed4('0x7')](),controller[_0xbed4('0x8')]);router['get'](_0xbed4('0x9'),auth['isAuthenticated'](),controller[_0xbed4('0xa')]);router[_0xbed4('0xb')](_0xbed4('0xc'),auth[_0xbed4('0x7')](),controller[_0xbed4('0xd')]);router[_0xbed4('0xe')]('/',auth[_0xbed4('0x7')](),controller[_0xbed4('0xf')]);router[_0xbed4('0x10')](_0xbed4('0xc'),auth[_0xbed4('0x7')](),controller['update']);router[_0xbed4('0x11')](_0xbed4('0xc'),auth[_0xbed4('0x7')](),controller[_0xbed4('0x12')]);module[_0xbed4('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ca07498..10ed993 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(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7a54,0x106));var _0x47a5=function(_0x24c31c,_0x4600d9){_0x24c31c=_0x24c31c-0x0;var _0x47fe46=_0x7a54[_0x24c31c];return _0x47fe46;};'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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x470c64,_0x1e26a8){_0x470c64=_0x470c64-0x0;var _0x523fa5=_0x7a54[_0x470c64];return _0x523fa5;};'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 217697c..fe880ef 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 _0x5099=['request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','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','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5099,0xe6));var _0x9509=function(_0x49b5c6,_0x4c3049){_0x49b5c6=_0x49b5c6-0x0;var _0x3894e7=_0x5099[_0x49b5c6];return _0x3894e7;};'use strict';var emlformat=require(_0x9509('0x0'));var rimraf=require(_0x9509('0x1'));var zipdir=require(_0x9509('0x2'));var jsonpatch=require(_0x9509('0x3'));var rp=require(_0x9509('0x4'));var moment=require(_0x9509('0x5'));var BPromise=require(_0x9509('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9509('0x7'));var sox=require(_0x9509('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9509('0x9'));var _=require(_0x9509('0xa'));var squel=require(_0x9509('0xb'));var crypto=require(_0x9509('0xc'));var jsforce=require(_0x9509('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9509('0xe'));var querystring=require(_0x9509('0xf'));var Papa=require(_0x9509('0x10'));var Redis=require('ioredis');var authService=require(_0x9509('0x11'));var qs=require(_0x9509('0x12'));var as=require(_0x9509('0x13'));var hardwareService=require(_0x9509('0x14'));var logger=require(_0x9509('0x15'))('api');var utils=require(_0x9509('0x16'));var config=require(_0x9509('0x17'));var licenseUtil=require(_0x9509('0x18'));var db=require(_0x9509('0x19'))['db'];function respondWithStatusCode(_0x2b18cd,_0x2306d3){_0x2306d3=_0x2306d3||0xcc;return function(_0x47f49e){if(_0x47f49e){return _0x2b18cd[_0x9509('0x1a')](_0x2306d3);}return _0x2b18cd['status'](_0x2306d3)[_0x9509('0x1b')]();};}function respondWithResult(_0x19708e,_0x19758a){_0x19758a=_0x19758a||0xc8;return function(_0x5da9fe){if(_0x5da9fe){return _0x19708e[_0x9509('0x1c')](_0x19758a)[_0x9509('0x1d')](_0x5da9fe);}};}function respondWithFilteredResult(_0x442304,_0x37eeff){return function(_0x6b9205){if(_0x6b9205){var _0x39057d=typeof _0x37eeff['offset']===_0x9509('0x1e')&&typeof _0x37eeff[_0x9509('0x1f')]===_0x9509('0x1e');var _0x1cd606=_0x6b9205['count'];var _0x311ff4=_0x39057d?0x0:_0x37eeff[_0x9509('0x20')];var _0x30ae7f=_0x39057d?_0x6b9205['count']:_0x37eeff['offset']+_0x37eeff[_0x9509('0x1f')];var _0x45abe0;if(_0x30ae7f>=_0x1cd606){_0x30ae7f=_0x1cd606;_0x45abe0=0xc8;}else{_0x45abe0=0xce;}_0x442304[_0x9509('0x1c')](_0x45abe0);return _0x442304[_0x9509('0x21')](_0x9509('0x22'),_0x311ff4+'-'+_0x30ae7f+'/'+_0x1cd606)['json'](_0x6b9205);}return null;};}function patchUpdates(_0x116a4f){return function(_0x51880b){try{jsonpatch['apply'](_0x51880b,_0x116a4f,!![]);}catch(_0x3c3818){return BPromise[_0x9509('0x23')](_0x3c3818);}return _0x51880b[_0x9509('0x24')]();};}function saveUpdates(_0x4efdbf,_0x4211a6){return function(_0xba970b){if(_0xba970b){return _0xba970b[_0x9509('0x25')](_0x4efdbf)[_0x9509('0x26')](function(_0x13a2de){return _0x13a2de;});}return null;};}function removeEntity(_0x3a35bc,_0x65c727){return function(_0x5b421a){if(_0x5b421a){return _0x5b421a[_0x9509('0x27')]()['then'](function(){_0x3a35bc[_0x9509('0x1c')](0xcc)[_0x9509('0x1b')]();});}};}function handleEntityNotFound(_0xf4aad2,_0x4c9de0){return function(_0x3c4435){if(!_0x3c4435){_0xf4aad2[_0x9509('0x1a')](0x194);}return _0x3c4435;};}function handleError(_0x299696,_0x1aa508){_0x1aa508=_0x1aa508||0x1f4;return function(_0x366bb9){logger['error'](_0x366bb9[_0x9509('0x28')]);if(_0x366bb9['name']){delete _0x366bb9[_0x9509('0x29')];}_0x299696['status'](_0x1aa508)[_0x9509('0x2a')](_0x366bb9);};}exports[_0x9509('0x2b')]=function(_0x345441,_0x1f558c){var _0x137d4a={},_0x3a5008={},_0x5bdd2d={'count':0x0,'rows':[]};var _0x588490=_[_0x9509('0x2c')](db[_0x9509('0x2d')][_0x9509('0x2e')],function(_0x33fcf6){return{'name':_0x33fcf6['fieldName'],'type':_0x33fcf6['type'][_0x9509('0x2f')]};});_0x3a5008[_0x9509('0x30')]=_['map'](_0x588490,_0x9509('0x29'));_0x3a5008['query']=_['keys'](_0x345441['query']);_0x3a5008[_0x9509('0x31')]=_[_0x9509('0x32')](_0x3a5008[_0x9509('0x30')],_0x3a5008[_0x9509('0x33')]);_0x137d4a['attributes']=_[_0x9509('0x32')](_0x3a5008[_0x9509('0x30')],qs[_0x9509('0x34')](_0x345441['query']['fields']));_0x137d4a[_0x9509('0x35')]=_0x137d4a[_0x9509('0x35')][_0x9509('0x36')]?_0x137d4a[_0x9509('0x35')]:_0x3a5008['model'];if(!_0x345441[_0x9509('0x33')][_0x9509('0x37')](_0x9509('0x38'))){_0x137d4a[_0x9509('0x1f')]=qs[_0x9509('0x1f')](_0x345441['query'][_0x9509('0x1f')]);_0x137d4a[_0x9509('0x20')]=qs['offset'](_0x345441['query'][_0x9509('0x20')]);}_0x137d4a[_0x9509('0x39')]=qs[_0x9509('0x3a')](_0x345441[_0x9509('0x33')][_0x9509('0x3a')]);_0x137d4a[_0x9509('0x3b')]=qs[_0x9509('0x31')](_[_0x9509('0x3c')](_0x345441[_0x9509('0x33')],_0x3a5008['filters']),_0x588490);if(_0x345441[_0x9509('0x33')][_0x9509('0x3d')]){_0x137d4a[_0x9509('0x3b')]=_[_0x9509('0x3e')](_0x137d4a['where'],{'$or':_[_0x9509('0x2c')](_0x588490,function(_0xb08880){if(_0xb08880[_0x9509('0x3f')]!==_0x9509('0x40')){var _0x55edcc={};_0x55edcc[_0xb08880[_0x9509('0x29')]]={'$like':'%'+_0x345441['query']['filter']+'%'};return _0x55edcc;}})});}_0x137d4a=_[_0x9509('0x3e')]({},_0x137d4a,_0x345441[_0x9509('0x41')]);var _0x58d65b={'where':_0x137d4a[_0x9509('0x3b')]};return db['JscriptyQuestionReport']['count'](_0x58d65b)[_0x9509('0x26')](function(_0x40857e){_0x5bdd2d[_0x9509('0x42')]=_0x40857e;if(_0x345441[_0x9509('0x33')][_0x9509('0x43')]){_0x137d4a[_0x9509('0x44')]=[{'all':!![]}];}return db[_0x9509('0x2d')][_0x9509('0x45')](_0x137d4a);})[_0x9509('0x26')](function(_0x42a715){_0x5bdd2d[_0x9509('0x46')]=_0x42a715;return _0x5bdd2d;})[_0x9509('0x26')](respondWithFilteredResult(_0x1f558c,_0x137d4a))[_0x9509('0x47')](handleError(_0x1f558c,null));};exports['show']=function(_0x2e741f,_0x2f1e9c){var _0xf98bab={'raw':!![],'where':{'id':_0x2e741f[_0x9509('0x48')]['id']}},_0x54f118={};_0x54f118[_0x9509('0x30')]=_[_0x9509('0x49')](db[_0x9509('0x2d')][_0x9509('0x2e')]);_0x54f118[_0x9509('0x33')]=_[_0x9509('0x49')](_0x2e741f[_0x9509('0x33')]);_0x54f118[_0x9509('0x31')]=_['intersection'](_0x54f118['model'],_0x54f118[_0x9509('0x33')]);_0xf98bab[_0x9509('0x35')]=_[_0x9509('0x32')](_0x54f118[_0x9509('0x30')],qs[_0x9509('0x34')](_0x2e741f[_0x9509('0x33')][_0x9509('0x34')]));_0xf98bab[_0x9509('0x35')]=_0xf98bab[_0x9509('0x35')][_0x9509('0x36')]?_0xf98bab[_0x9509('0x35')]:_0x54f118['model'];if(_0x2e741f[_0x9509('0x33')][_0x9509('0x43')]){_0xf98bab[_0x9509('0x44')]=[{'all':!![]}];}_0xf98bab=_[_0x9509('0x3e')]({},_0xf98bab,_0x2e741f['options']);return db[_0x9509('0x2d')]['find'](_0xf98bab)[_0x9509('0x26')](handleEntityNotFound(_0x2f1e9c,null))[_0x9509('0x26')](respondWithResult(_0x2f1e9c,null))[_0x9509('0x47')](handleError(_0x2f1e9c,null));};exports[_0x9509('0x4a')]=function(_0xe748b2,_0x4a8e02){return db[_0x9509('0x2d')][_0x9509('0x4a')](_0xe748b2['body'],{})['then'](respondWithResult(_0x4a8e02,0xc9))[_0x9509('0x47')](handleError(_0x4a8e02,null));};exports[_0x9509('0x25')]=function(_0x42b5ee,_0x79021b){if(_0x42b5ee['body']['id']){delete _0x42b5ee[_0x9509('0x4b')]['id'];}return db[_0x9509('0x2d')][_0x9509('0x4c')]({'where':{'id':_0x42b5ee['params']['id']}})[_0x9509('0x26')](handleEntityNotFound(_0x79021b,null))[_0x9509('0x26')](saveUpdates(_0x42b5ee[_0x9509('0x4b')],null))[_0x9509('0x26')](respondWithResult(_0x79021b,null))[_0x9509('0x47')](handleError(_0x79021b,null));};exports['destroy']=function(_0x1cce01,_0x50bfe4){return db[_0x9509('0x2d')][_0x9509('0x4c')]({'where':{'id':_0x1cce01[_0x9509('0x48')]['id']}})[_0x9509('0x26')](handleEntityNotFound(_0x50bfe4,null))['then'](removeEntity(_0x50bfe4,null))[_0x9509('0x47')](handleError(_0x50bfe4,null));};exports[_0x9509('0x4d')]=function(_0xfd791d,_0x1eca26){return db[_0x9509('0x2d')][_0x9509('0x4d')]()[_0x9509('0x26')](respondWithResult(_0x1eca26,null))[_0x9509('0x47')](handleError(_0x1eca26,null));}; \ No newline at end of file +var _0x4890=['show','params','find','create','catch','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','then','destroy','error','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4890,0x157));var _0x0489=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0x4890[_0x48961c];return _0x1d895d;};'use strict';var emlformat=require(_0x0489('0x0'));var rimraf=require(_0x0489('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0489('0x2'));var rp=require(_0x0489('0x3'));var moment=require('moment');var BPromise=require(_0x0489('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0489('0x5'));var sox=require(_0x0489('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0489('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0489('0x8'));var deskjs=require(_0x0489('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0489('0xa'));var Papa=require(_0x0489('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0489('0xc'));var as=require(_0x0489('0xd'));var hardwareService=require(_0x0489('0xe'));var logger=require(_0x0489('0xf'))('api');var utils=require(_0x0489('0x10'));var config=require(_0x0489('0x11'));var licenseUtil=require(_0x0489('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x360954,_0x4a48e3){_0x4a48e3=_0x4a48e3||0xcc;return function(_0x41978f){if(_0x41978f){return _0x360954[_0x0489('0x13')](_0x4a48e3);}return _0x360954[_0x0489('0x14')](_0x4a48e3)[_0x0489('0x15')]();};}function respondWithResult(_0x21859d,_0x10a790){_0x10a790=_0x10a790||0xc8;return function(_0x46d0f3){if(_0x46d0f3){return _0x21859d[_0x0489('0x14')](_0x10a790)['json'](_0x46d0f3);}};}function respondWithFilteredResult(_0x6b7781,_0x594121){return function(_0x5ddc19){if(_0x5ddc19){var _0x2e2bc9=typeof _0x594121[_0x0489('0x16')]===_0x0489('0x17')&&typeof _0x594121[_0x0489('0x18')]===_0x0489('0x17');var _0x3865bf=_0x5ddc19['count'];var _0x406ba5=_0x2e2bc9?0x0:_0x594121[_0x0489('0x16')];var _0xd1db1=_0x2e2bc9?_0x5ddc19[_0x0489('0x19')]:_0x594121[_0x0489('0x16')]+_0x594121[_0x0489('0x18')];var _0x27492d;if(_0xd1db1>=_0x3865bf){_0xd1db1=_0x3865bf;_0x27492d=0xc8;}else{_0x27492d=0xce;}_0x6b7781[_0x0489('0x14')](_0x27492d);return _0x6b7781['set']('Content-Range',_0x406ba5+'-'+_0xd1db1+'/'+_0x3865bf)[_0x0489('0x1a')](_0x5ddc19);}return null;};}function patchUpdates(_0x30208e){return function(_0x11fd3b){try{jsonpatch['apply'](_0x11fd3b,_0x30208e,!![]);}catch(_0x39f810){return BPromise[_0x0489('0x1b')](_0x39f810);}return _0x11fd3b[_0x0489('0x1c')]();};}function saveUpdates(_0x258637,_0x4c4697){return function(_0x3468a1){if(_0x3468a1){return _0x3468a1['update'](_0x258637)[_0x0489('0x1d')](function(_0x374c79){return _0x374c79;});}return null;};}function removeEntity(_0x51c41c,_0x1ba0ff){return function(_0x10baa7){if(_0x10baa7){return _0x10baa7[_0x0489('0x1e')]()[_0x0489('0x1d')](function(){_0x51c41c[_0x0489('0x14')](0xcc)[_0x0489('0x15')]();});}};}function handleEntityNotFound(_0x24b956,_0x4e7522){return function(_0x232fa1){if(!_0x232fa1){_0x24b956[_0x0489('0x13')](0x194);}return _0x232fa1;};}function handleError(_0x472a36,_0x527d8){_0x527d8=_0x527d8||0x1f4;return function(_0x29f8bb){logger[_0x0489('0x1f')](_0x29f8bb['stack']);if(_0x29f8bb['name']){delete _0x29f8bb[_0x0489('0x20')];}_0x472a36[_0x0489('0x14')](_0x527d8)[_0x0489('0x21')](_0x29f8bb);};}exports[_0x0489('0x22')]=function(_0x4a3ab9,_0x33d03a){var _0xf3dab7={},_0x5a7f99={},_0x58eb87={'count':0x0,'rows':[]};var _0x194667=_['map'](db[_0x0489('0x23')][_0x0489('0x24')],function(_0x2ed755){return{'name':_0x2ed755[_0x0489('0x25')],'type':_0x2ed755[_0x0489('0x26')]['key']};});_0x5a7f99[_0x0489('0x27')]=_['map'](_0x194667,_0x0489('0x20'));_0x5a7f99[_0x0489('0x28')]=_[_0x0489('0x29')](_0x4a3ab9[_0x0489('0x28')]);_0x5a7f99[_0x0489('0x2a')]=_[_0x0489('0x2b')](_0x5a7f99[_0x0489('0x27')],_0x5a7f99[_0x0489('0x28')]);_0xf3dab7['attributes']=_['intersection'](_0x5a7f99[_0x0489('0x27')],qs[_0x0489('0x2c')](_0x4a3ab9[_0x0489('0x28')][_0x0489('0x2c')]));_0xf3dab7[_0x0489('0x2d')]=_0xf3dab7['attributes'][_0x0489('0x2e')]?_0xf3dab7[_0x0489('0x2d')]:_0x5a7f99[_0x0489('0x27')];if(!_0x4a3ab9['query'][_0x0489('0x2f')](_0x0489('0x30'))){_0xf3dab7[_0x0489('0x18')]=qs['limit'](_0x4a3ab9[_0x0489('0x28')]['limit']);_0xf3dab7['offset']=qs[_0x0489('0x16')](_0x4a3ab9[_0x0489('0x28')][_0x0489('0x16')]);}_0xf3dab7['order']=qs['sort'](_0x4a3ab9[_0x0489('0x28')][_0x0489('0x31')]);_0xf3dab7[_0x0489('0x32')]=qs['filters'](_[_0x0489('0x33')](_0x4a3ab9[_0x0489('0x28')],_0x5a7f99[_0x0489('0x2a')]),_0x194667);if(_0x4a3ab9['query']['filter']){_0xf3dab7[_0x0489('0x32')]=_[_0x0489('0x34')](_0xf3dab7[_0x0489('0x32')],{'$or':_['map'](_0x194667,function(_0x5b5ba9){if(_0x5b5ba9[_0x0489('0x26')]!==_0x0489('0x35')){var _0x34f0bc={};_0x34f0bc[_0x5b5ba9['name']]={'$like':'%'+_0x4a3ab9[_0x0489('0x28')][_0x0489('0x36')]+'%'};return _0x34f0bc;}})});}_0xf3dab7=_[_0x0489('0x34')]({},_0xf3dab7,_0x4a3ab9[_0x0489('0x37')]);var _0x263f5d={'where':_0xf3dab7[_0x0489('0x32')]};return db[_0x0489('0x23')]['count'](_0x263f5d)['then'](function(_0x41eaa8){_0x58eb87[_0x0489('0x19')]=_0x41eaa8;if(_0x4a3ab9['query'][_0x0489('0x38')]){_0xf3dab7[_0x0489('0x39')]=[{'all':!![]}];}return db[_0x0489('0x23')]['findAll'](_0xf3dab7);})['then'](function(_0x15b74d){_0x58eb87[_0x0489('0x3a')]=_0x15b74d;return _0x58eb87;})[_0x0489('0x1d')](respondWithFilteredResult(_0x33d03a,_0xf3dab7))['catch'](handleError(_0x33d03a,null));};exports[_0x0489('0x3b')]=function(_0x25e5da,_0x36d65b){var _0x34df19={'raw':!![],'where':{'id':_0x25e5da[_0x0489('0x3c')]['id']}},_0x4f40ad={};_0x4f40ad['model']=_[_0x0489('0x29')](db[_0x0489('0x23')][_0x0489('0x24')]);_0x4f40ad[_0x0489('0x28')]=_[_0x0489('0x29')](_0x25e5da['query']);_0x4f40ad[_0x0489('0x2a')]=_['intersection'](_0x4f40ad[_0x0489('0x27')],_0x4f40ad[_0x0489('0x28')]);_0x34df19[_0x0489('0x2d')]=_[_0x0489('0x2b')](_0x4f40ad['model'],qs[_0x0489('0x2c')](_0x25e5da[_0x0489('0x28')]['fields']));_0x34df19[_0x0489('0x2d')]=_0x34df19['attributes'][_0x0489('0x2e')]?_0x34df19[_0x0489('0x2d')]:_0x4f40ad['model'];if(_0x25e5da[_0x0489('0x28')][_0x0489('0x38')]){_0x34df19[_0x0489('0x39')]=[{'all':!![]}];}_0x34df19=_[_0x0489('0x34')]({},_0x34df19,_0x25e5da[_0x0489('0x37')]);return db[_0x0489('0x23')][_0x0489('0x3d')](_0x34df19)[_0x0489('0x1d')](handleEntityNotFound(_0x36d65b,null))[_0x0489('0x1d')](respondWithResult(_0x36d65b,null))['catch'](handleError(_0x36d65b,null));};exports[_0x0489('0x3e')]=function(_0x290166,_0x294f54){return db[_0x0489('0x23')][_0x0489('0x3e')](_0x290166['body'],{})[_0x0489('0x1d')](respondWithResult(_0x294f54,0xc9))[_0x0489('0x3f')](handleError(_0x294f54,null));};exports[_0x0489('0x40')]=function(_0x45bab4,_0x2cefd8){if(_0x45bab4[_0x0489('0x41')]['id']){delete _0x45bab4[_0x0489('0x41')]['id'];}return db[_0x0489('0x23')][_0x0489('0x3d')]({'where':{'id':_0x45bab4[_0x0489('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2cefd8,null))[_0x0489('0x1d')](saveUpdates(_0x45bab4['body'],null))[_0x0489('0x1d')](respondWithResult(_0x2cefd8,null))[_0x0489('0x3f')](handleError(_0x2cefd8,null));};exports['destroy']=function(_0x25ab5,_0x56413f){return db[_0x0489('0x23')][_0x0489('0x3d')]({'where':{'id':_0x25ab5[_0x0489('0x3c')]['id']}})[_0x0489('0x1d')](handleEntityNotFound(_0x56413f,null))['then'](removeEntity(_0x56413f,null))[_0x0489('0x3f')](handleError(_0x56413f,null));};exports['describe']=function(_0x16ce72,_0x522939){return db['JscriptyQuestionReport'][_0x0489('0x42')]()['then'](respondWithResult(_0x522939,null))[_0x0489('0x3f')](handleError(_0x522939,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 22310b2..0119867 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 _0x176f=['util','../../config/logger','api','bluebird','request-promise','path','./jscriptyQuestionReport.attributes','exports','report_jscripty_questions'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x176f,0xc6));var _0xf176=function(_0x1a7f64,_0x27fbd9){_0x1a7f64=_0x1a7f64-0x0;var _0x998c44=_0x176f[_0x1a7f64];return _0x998c44;};'use strict';var _=require('lodash');var util=require(_0xf176('0x0'));var logger=require(_0xf176('0x1'))(_0xf176('0x2'));var moment=require('moment');var BPromise=require(_0xf176('0x3'));var rp=require(_0xf176('0x4'));var fs=require('fs');var path=require(_0xf176('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf176('0x6'));module[_0xf176('0x7')]=function(_0x366202,_0x8cf4e0){return _0x366202['define']('JscriptyQuestionReport',attributes,{'tableName':_0xf176('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ff6=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x9ff6,0x68));var _0x69ff=function(_0x3f1230,_0x103236){_0x3f1230=_0x3f1230-0x0;var _0x4e61f7=_0x9ff6[_0x3f1230];return _0x4e61f7;};'use strict';var _=require(_0x69ff('0x0'));var util=require('util');var logger=require(_0x69ff('0x1'))(_0x69ff('0x2'));var moment=require(_0x69ff('0x3'));var BPromise=require(_0x69ff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x69ff('0x5'));var rimraf=require('rimraf');var config=require(_0x69ff('0x6'));var attributes=require(_0x69ff('0x7'));module[_0x69ff('0x8')]=function(_0x569d8e,_0x1f2557){return _0x569d8e[_0x69ff('0x9')](_0x69ff('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index e32c938..3a7b6f0 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 _0xb7b2=['rpc','jayson/promise','client','http','request','then','info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x471687,_0x3b54e2){var _0x3d06e7=function(_0x20ca6f){while(--_0x20ca6f){_0x471687['push'](_0x471687['shift']());}};_0x3d06e7(++_0x3b54e2);}(_0xb7b2,0xa8));var _0x2b7b=function(_0x209b59,_0x33fe12){_0x209b59=_0x209b59-0x0;var _0x4bf2d0=_0xb7b2[_0x209b59];return _0x4bf2d0;};'use strict';var _=require(_0x2b7b('0x0'));var util=require(_0x2b7b('0x1'));var moment=require(_0x2b7b('0x2'));var BPromise=require(_0x2b7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b7b('0x4'));var db=require(_0x2b7b('0x5'))['db'];var utils=require(_0x2b7b('0x6'));var logger=require(_0x2b7b('0x7'))(_0x2b7b('0x8'));var config=require('../../config/environment');var jayson=require(_0x2b7b('0x9'));var client=jayson[_0x2b7b('0xa')][_0x2b7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e7f5b,_0x5c435a,_0x4bb723){return new BPromise(function(_0x2872e1,_0x22cb35){return client[_0x2b7b('0xc')](_0x3e7f5b,_0x4bb723)[_0x2b7b('0xd')](function(_0x1a7f3c){logger[_0x2b7b('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5c435a,'request\x20sent');logger[_0x2b7b('0xf')](_0x2b7b('0x10'),_0x5c435a,'request\x20sent',JSON['stringify'](_0x1a7f3c));if(_0x1a7f3c[_0x2b7b('0x11')]){if(_0x1a7f3c[_0x2b7b('0x11')][_0x2b7b('0x12')]===0x1f4){logger[_0x2b7b('0x11')](_0x2b7b('0x13'),_0x5c435a,_0x1a7f3c[_0x2b7b('0x11')][_0x2b7b('0x14')]);return _0x22cb35(_0x1a7f3c[_0x2b7b('0x11')][_0x2b7b('0x14')]);}logger[_0x2b7b('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5c435a,_0x1a7f3c[_0x2b7b('0x11')][_0x2b7b('0x14')]);return _0x2872e1(_0x1a7f3c[_0x2b7b('0x11')][_0x2b7b('0x14')]);}else{logger[_0x2b7b('0xe')](_0x2b7b('0x13'),_0x5c435a,_0x2b7b('0x15'));_0x2872e1(_0x1a7f3c['result']['message']);}})['catch'](function(_0x1a23cf){logger[_0x2b7b('0x11')](_0x2b7b('0x13'),_0x5c435a,_0x1a23cf);_0x22cb35(_0x1a23cf);});});} \ No newline at end of file +var _0xa637=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x276e4a,_0x496b43){var _0x7c0ec0=function(_0x5aa59a){while(--_0x5aa59a){_0x276e4a['push'](_0x276e4a['shift']());}};_0x7c0ec0(++_0x496b43);}(_0xa637,0x19d));var _0x7a63=function(_0x3bcab3,_0x64a386){_0x3bcab3=_0x3bcab3-0x0;var _0x26d918=_0xa637[_0x3bcab3];return _0x26d918;};'use strict';var _=require(_0x7a63('0x0'));var util=require(_0x7a63('0x1'));var moment=require(_0x7a63('0x2'));var BPromise=require(_0x7a63('0x3'));var rs=require(_0x7a63('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a63('0x5'));var logger=require(_0x7a63('0x6'))(_0x7a63('0x7'));var config=require('../../config/environment');var jayson=require(_0x7a63('0x8'));var client=jayson[_0x7a63('0x9')][_0x7a63('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x479974,_0x10f8b3,_0x7d74db){return new BPromise(function(_0x31872a,_0x23c5bd){return client[_0x7a63('0xb')](_0x479974,_0x7d74db)[_0x7a63('0xc')](function(_0x26415e){logger[_0x7a63('0xd')](_0x7a63('0xe'),_0x10f8b3,_0x7a63('0xf'));logger[_0x7a63('0x10')](_0x7a63('0x11'),_0x10f8b3,_0x7a63('0xf'),JSON[_0x7a63('0x12')](_0x26415e));if(_0x26415e[_0x7a63('0x13')]){if(_0x26415e[_0x7a63('0x13')]['code']===0x1f4){logger[_0x7a63('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x10f8b3,_0x26415e[_0x7a63('0x13')][_0x7a63('0x14')]);return _0x23c5bd(_0x26415e[_0x7a63('0x13')][_0x7a63('0x14')]);}logger[_0x7a63('0x13')](_0x7a63('0xe'),_0x10f8b3,_0x26415e['error']['message']);return _0x31872a(_0x26415e[_0x7a63('0x13')][_0x7a63('0x14')]);}else{logger[_0x7a63('0xd')](_0x7a63('0xe'),_0x10f8b3,_0x7a63('0xf'));_0x31872a(_0x26415e[_0x7a63('0x15')][_0x7a63('0x14')]);}})[_0x7a63('0x16')](function(_0x5c5f42){logger[_0x7a63('0x13')](_0x7a63('0xe'),_0x10f8b3,_0x5c5f42);_0x23c5bd(_0x5c5f42);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ef01efb..93ac0f4 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 _0x7fd2=['/:id','show','/:id/questions','post','put','delete','destroy','exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x7fd2,0x67));var _0x27fd=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x7fd2[_0x186376];return _0x2dbdd9;};'use strict';var multer=require(_0x27fd('0x0'));var util=require(_0x27fd('0x1'));var path=require(_0x27fd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x27fd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x27fd('0x4'));var config=require(_0x27fd('0x5'));var controller=require(_0x27fd('0x6'));router['get']('/',auth[_0x27fd('0x7')](),controller['index']);router[_0x27fd('0x8')](_0x27fd('0x9'),auth[_0x27fd('0x7')](),controller[_0x27fd('0xa')]);router[_0x27fd('0x8')](_0x27fd('0xb'),auth[_0x27fd('0x7')](),controller[_0x27fd('0xc')]);router[_0x27fd('0x8')](_0x27fd('0xd'),auth[_0x27fd('0x7')](),controller['getQuestions']);router[_0x27fd('0xe')]('/',auth[_0x27fd('0x7')](),controller['create']);router[_0x27fd('0xf')]('/:id',auth[_0x27fd('0x7')](),controller['update']);router[_0x27fd('0x10')](_0x27fd('0xb'),auth[_0x27fd('0x7')](),controller[_0x27fd('0x11')]);module[_0x27fd('0x12')]=router; \ No newline at end of file +var _0x26cf=['show','/:id/questions','getQuestions','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x2dd512,_0xb1d12c){var _0x53ee03=function(_0x284040){while(--_0x284040){_0x2dd512['push'](_0x2dd512['shift']());}};_0x53ee03(++_0xb1d12c);}(_0x26cf,0x10a));var _0xf26c=function(_0x1fda7d,_0x1c469a){_0x1fda7d=_0x1fda7d-0x0;var _0x4cbf77=_0x26cf[_0x1fda7d];return _0x4cbf77;};'use strict';var multer=require(_0xf26c('0x0'));var util=require('util');var path=require(_0xf26c('0x1'));var timeout=require(_0xf26c('0x2'));var express=require(_0xf26c('0x3'));var router=express[_0xf26c('0x4')]();var fs_extra=require(_0xf26c('0x5'));var auth=require(_0xf26c('0x6'));var interaction=require(_0xf26c('0x7'));var config=require(_0xf26c('0x8'));var controller=require('./jscriptySessionReport.controller');router[_0xf26c('0x9')]('/',auth[_0xf26c('0xa')](),controller[_0xf26c('0xb')]);router[_0xf26c('0x9')](_0xf26c('0xc'),auth['isAuthenticated'](),controller[_0xf26c('0xd')]);router['get']('/:id',auth[_0xf26c('0xa')](),controller[_0xf26c('0xe')]);router[_0xf26c('0x9')](_0xf26c('0xf'),auth[_0xf26c('0xa')](),controller[_0xf26c('0x10')]);router['post']('/',auth[_0xf26c('0xa')](),controller['create']);router['put'](_0xf26c('0x11'),auth[_0xf26c('0xa')](),controller[_0xf26c('0x12')]);router['delete'](_0xf26c('0x11'),auth[_0xf26c('0xa')](),controller[_0xf26c('0x13')]);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 08a9a6e..446d27f 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 _0x6020=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6020,0x15b));var _0x0602=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x6020[_0x2f3848];return _0x102668;};'use strict';var moment=require(_0x0602('0x0'));var Sequelize=require(_0x0602('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x0602('0x2')],'set':function(_0x165b2b){this[_0x0602('0x3')](_0x0602('0x4'),_0x165b2b);this[_0x0602('0x3')](_0x0602('0x5'),moment()[_0x0602('0x6')](_0x0602('0x7')));}},'endtime':{'type':Sequelize[_0x0602('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x0602('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0602('0x8')]},'calleridnum':{'type':Sequelize[_0x0602('0x8')]},'completed':{'type':Sequelize[_0x0602('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xfbb1=['DATE','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xfbb1,0x1e3));var _0x1fbb=function(_0x172660,_0x260d9b){_0x172660=_0x172660-0x0;var _0x83204f=_0xfbb1[_0x172660];return _0x83204f;};'use strict';var moment=require(_0x1fbb('0x0'));var Sequelize=require(_0x1fbb('0x1'));module[_0x1fbb('0x2')]={'starttime':{'type':Sequelize[_0x1fbb('0x3')],'set':function(_0x4f491a){this[_0x1fbb('0x4')](_0x1fbb('0x5'),_0x4f491a);this['setDataValue']('endtime',moment()['format'](_0x1fbb('0x6')));}},'endtime':{'type':Sequelize[_0x1fbb('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1fbb('0x7')]},'uniqueid':{'type':Sequelize[_0x1fbb('0x7')]},'calleridname':{'type':Sequelize[_0x1fbb('0x7')]},'calleridnum':{'type':Sequelize[_0x1fbb('0x7')]},'completed':{'type':Sequelize[_0x1fbb('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 8a4da4e..fd86f97 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 _0x225e=['count','Content-Range','save','destroy','then','error','name','send','index','JscriptySessionReport','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','catch','create','body','update','find','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','pick','SessionId','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset'];(function(_0x4f3328,_0x18016e){var _0x129009=function(_0x41f44b){while(--_0x41f44b){_0x4f3328['push'](_0x4f3328['shift']());}};_0x129009(++_0x18016e);}(_0x225e,0x116));var _0xe225=function(_0x83d844,_0x84101f){_0x83d844=_0x83d844-0x0;var _0x5850be=_0x225e[_0x83d844];return _0x5850be;};'use strict';var emlformat=require(_0xe225('0x0'));var rimraf=require(_0xe225('0x1'));var zipdir=require(_0xe225('0x2'));var jsonpatch=require(_0xe225('0x3'));var rp=require(_0xe225('0x4'));var moment=require('moment');var BPromise=require(_0xe225('0x5'));var Mustache=require(_0xe225('0x6'));var util=require(_0xe225('0x7'));var path=require(_0xe225('0x8'));var sox=require('sox');var csv=require(_0xe225('0x9'));var ejs=require(_0xe225('0xa'));var fs=require('fs');var fs_extra=require(_0xe225('0xb'));var _=require('lodash');var squel=require(_0xe225('0xc'));var crypto=require(_0xe225('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe225('0xe'));var toCsv=require(_0xe225('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe225('0xf'));var qs=require(_0xe225('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe225('0x11'));var logger=require(_0xe225('0x12'))(_0xe225('0x13'));var utils=require(_0xe225('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe225('0x15'));var db=require(_0xe225('0x16'))['db'];function respondWithStatusCode(_0x176917,_0x10e706){_0x10e706=_0x10e706||0xcc;return function(_0x1ff003){if(_0x1ff003){return _0x176917[_0xe225('0x17')](_0x10e706);}return _0x176917[_0xe225('0x18')](_0x10e706)[_0xe225('0x19')]();};}function respondWithResult(_0x64fc43,_0x226304){_0x226304=_0x226304||0xc8;return function(_0x13e04d){if(_0x13e04d){return _0x64fc43[_0xe225('0x18')](_0x226304)[_0xe225('0x1a')](_0x13e04d);}};}function respondWithFilteredResult(_0x5c3228,_0xc94d3a){return function(_0x550d49){if(_0x550d49){var _0x1c4576=typeof _0xc94d3a['offset']===_0xe225('0x1b')&&typeof _0xc94d3a[_0xe225('0x1c')]===_0xe225('0x1b');var _0x84a1be=_0x550d49['count'];var _0x38178b=_0x1c4576?0x0:_0xc94d3a[_0xe225('0x1d')];var _0x36a821=_0x1c4576?_0x550d49[_0xe225('0x1e')]:_0xc94d3a[_0xe225('0x1d')]+_0xc94d3a[_0xe225('0x1c')];var _0x26acad;if(_0x36a821>=_0x84a1be){_0x36a821=_0x84a1be;_0x26acad=0xc8;}else{_0x26acad=0xce;}_0x5c3228['status'](_0x26acad);return _0x5c3228['set'](_0xe225('0x1f'),_0x38178b+'-'+_0x36a821+'/'+_0x84a1be)[_0xe225('0x1a')](_0x550d49);}return null;};}function patchUpdates(_0x15a61d){return function(_0xaea4fd){try{jsonpatch['apply'](_0xaea4fd,_0x15a61d,!![]);}catch(_0x287ab1){return BPromise['reject'](_0x287ab1);}return _0xaea4fd[_0xe225('0x20')]();};}function saveUpdates(_0x2b44a4,_0x1aba8c){return function(_0x7def38){if(_0x7def38){return _0x7def38['update'](_0x2b44a4)['then'](function(_0x43a17d){return _0x43a17d;});}return null;};}function removeEntity(_0xecf790,_0x2d4638){return function(_0x5655c1){if(_0x5655c1){return _0x5655c1[_0xe225('0x21')]()[_0xe225('0x22')](function(){_0xecf790[_0xe225('0x18')](0xcc)[_0xe225('0x19')]();});}};}function handleEntityNotFound(_0x27990f,_0x5f2d35){return function(_0x2667b3){if(!_0x2667b3){_0x27990f[_0xe225('0x17')](0x194);}return _0x2667b3;};}function handleError(_0x11e767,_0x4a6304){_0x4a6304=_0x4a6304||0x1f4;return function(_0x35abcc){logger[_0xe225('0x23')](_0x35abcc['stack']);if(_0x35abcc[_0xe225('0x24')]){delete _0x35abcc['name'];}_0x11e767[_0xe225('0x18')](_0x4a6304)[_0xe225('0x25')](_0x35abcc);};}exports[_0xe225('0x26')]=function(_0x554c71,_0x5b15fe){var _0x11bd1f={},_0xefb58e={},_0x32a0fa={'count':0x0,'rows':[]};var _0x2dc719=_['map'](db[_0xe225('0x27')]['rawAttributes'],function(_0xc05b7){return{'name':_0xc05b7['fieldName'],'type':_0xc05b7[_0xe225('0x28')][_0xe225('0x29')]};});_0xefb58e['model']=_['map'](_0x2dc719,_0xe225('0x24'));_0xefb58e['query']=_[_0xe225('0x2a')](_0x554c71[_0xe225('0x2b')]);_0xefb58e['filters']=_[_0xe225('0x2c')](_0xefb58e['model'],_0xefb58e[_0xe225('0x2b')]);_0x11bd1f[_0xe225('0x2d')]=_[_0xe225('0x2c')](_0xefb58e[_0xe225('0x2e')],qs[_0xe225('0x2f')](_0x554c71[_0xe225('0x2b')]['fields']));_0x11bd1f['attributes']=_0x11bd1f[_0xe225('0x2d')][_0xe225('0x30')]?_0x11bd1f[_0xe225('0x2d')]:_0xefb58e[_0xe225('0x2e')];if(!_0x554c71[_0xe225('0x2b')][_0xe225('0x31')](_0xe225('0x32'))){_0x11bd1f[_0xe225('0x1c')]=qs[_0xe225('0x1c')](_0x554c71[_0xe225('0x2b')][_0xe225('0x1c')]);_0x11bd1f[_0xe225('0x1d')]=qs[_0xe225('0x1d')](_0x554c71['query'][_0xe225('0x1d')]);}_0x11bd1f[_0xe225('0x33')]=qs[_0xe225('0x34')](_0x554c71['query'][_0xe225('0x34')]);_0x11bd1f[_0xe225('0x35')]=qs[_0xe225('0x36')](_['pick'](_0x554c71[_0xe225('0x2b')],_0xefb58e[_0xe225('0x36')]),_0x2dc719);if(_0x554c71[_0xe225('0x2b')][_0xe225('0x37')]){_0x11bd1f[_0xe225('0x35')]=_[_0xe225('0x38')](_0x11bd1f['where'],{'$or':_['map'](_0x2dc719,function(_0x32eac6){if(_0x32eac6['type']!==_0xe225('0x39')){var _0x244c9a={};_0x244c9a[_0x32eac6[_0xe225('0x24')]]={'$like':'%'+_0x554c71[_0xe225('0x2b')][_0xe225('0x37')]+'%'};return _0x244c9a;}})});}_0x11bd1f=_[_0xe225('0x38')]({},_0x11bd1f,_0x554c71[_0xe225('0x3a')]);var _0x4ac27f={'where':_0x11bd1f[_0xe225('0x35')]};return db[_0xe225('0x27')]['count'](_0x4ac27f)['then'](function(_0xf61a4e){_0x32a0fa[_0xe225('0x1e')]=_0xf61a4e;if(_0x554c71['query']['includeAll']){_0x11bd1f[_0xe225('0x3b')]=[{'all':!![]}];}return db[_0xe225('0x27')][_0xe225('0x3c')](_0x11bd1f);})[_0xe225('0x22')](function(_0x304bf6){_0x32a0fa[_0xe225('0x3d')]=_0x304bf6;return _0x32a0fa;})[_0xe225('0x22')](respondWithFilteredResult(_0x5b15fe,_0x11bd1f))['catch'](handleError(_0x5b15fe,null));};exports['show']=function(_0xa1a28b,_0xb03dd2){var _0x49a0c5={'raw':!![],'where':{'id':_0xa1a28b[_0xe225('0x3e')]['id']}},_0x24c48c={};_0x24c48c[_0xe225('0x2e')]=_[_0xe225('0x2a')](db[_0xe225('0x27')]['rawAttributes']);_0x24c48c[_0xe225('0x2b')]=_[_0xe225('0x2a')](_0xa1a28b[_0xe225('0x2b')]);_0x24c48c[_0xe225('0x36')]=_[_0xe225('0x2c')](_0x24c48c[_0xe225('0x2e')],_0x24c48c[_0xe225('0x2b')]);_0x49a0c5['attributes']=_[_0xe225('0x2c')](_0x24c48c['model'],qs[_0xe225('0x2f')](_0xa1a28b[_0xe225('0x2b')]['fields']));_0x49a0c5['attributes']=_0x49a0c5['attributes']['length']?_0x49a0c5[_0xe225('0x2d')]:_0x24c48c[_0xe225('0x2e')];if(_0xa1a28b[_0xe225('0x2b')][_0xe225('0x3f')]){_0x49a0c5[_0xe225('0x3b')]=[{'all':!![]}];}_0x49a0c5=_[_0xe225('0x38')]({},_0x49a0c5,_0xa1a28b[_0xe225('0x3a')]);return db[_0xe225('0x27')]['find'](_0x49a0c5)['then'](handleEntityNotFound(_0xb03dd2,null))['then'](respondWithResult(_0xb03dd2,null))[_0xe225('0x40')](handleError(_0xb03dd2,null));};exports[_0xe225('0x41')]=function(_0x20a937,_0x2bba43){return db[_0xe225('0x27')][_0xe225('0x41')](_0x20a937[_0xe225('0x42')],{})[_0xe225('0x22')](respondWithResult(_0x2bba43,0xc9))[_0xe225('0x40')](handleError(_0x2bba43,null));};exports[_0xe225('0x43')]=function(_0x3c4e8c,_0x10ee80){if(_0x3c4e8c[_0xe225('0x42')]['id']){delete _0x3c4e8c['body']['id'];}return db[_0xe225('0x27')][_0xe225('0x44')]({'where':{'id':_0x3c4e8c[_0xe225('0x3e')]['id']}})[_0xe225('0x22')](handleEntityNotFound(_0x10ee80,null))[_0xe225('0x22')](saveUpdates(_0x3c4e8c[_0xe225('0x42')],null))[_0xe225('0x22')](respondWithResult(_0x10ee80,null))[_0xe225('0x40')](handleError(_0x10ee80,null));};exports[_0xe225('0x21')]=function(_0x3e1d97,_0xbcf97c){return db['JscriptySessionReport'][_0xe225('0x44')]({'where':{'id':_0x3e1d97[_0xe225('0x3e')]['id']}})[_0xe225('0x22')](handleEntityNotFound(_0xbcf97c,null))['then'](removeEntity(_0xbcf97c,null))['catch'](handleError(_0xbcf97c,null));};exports[_0xe225('0x45')]=function(_0x4462e4,_0x27b7dd){return db[_0xe225('0x27')][_0xe225('0x45')]()[_0xe225('0x22')](respondWithResult(_0x27b7dd,null))[_0xe225('0x40')](handleError(_0x27b7dd,null));};exports[_0xe225('0x46')]=function(_0x58dd98,_0x32910a,_0x285c85){var _0x1a502a={'raw':!![],'where':{}};var _0x2efae3={};var _0x171738={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xe225('0x47')]({'where':{'id':_0x58dd98[_0xe225('0x3e')]['id']}})[_0xe225('0x22')](handleEntityNotFound(_0x32910a,null))['then'](function(_0x4c41ec){if(_0x4c41ec){_0x2efae3[_0xe225('0x2e')]=_[_0xe225('0x2a')](db[_0xe225('0x48')][_0xe225('0x49')]);_0x2efae3[_0xe225('0x2b')]=_['keys'](_0x58dd98[_0xe225('0x2b')]);_0x2efae3[_0xe225('0x36')]=_[_0xe225('0x2c')](_0x2efae3[_0xe225('0x2e')],_0x2efae3[_0xe225('0x2b')]);_0x1a502a[_0xe225('0x2d')]=_[_0xe225('0x2c')](_0x2efae3['model'],qs[_0xe225('0x2f')](_0x58dd98['query'][_0xe225('0x2f')]));_0x1a502a['attributes']=_0x1a502a[_0xe225('0x2d')][_0xe225('0x30')]?_0x1a502a[_0xe225('0x2d')]:_0x2efae3[_0xe225('0x2e')];if(!_0x58dd98[_0xe225('0x2b')]['hasOwnProperty'](_0xe225('0x32'))){_0x1a502a[_0xe225('0x1c')]=qs[_0xe225('0x1c')](_0x58dd98[_0xe225('0x2b')][_0xe225('0x1c')]);_0x1a502a[_0xe225('0x1d')]=qs[_0xe225('0x1d')](_0x58dd98[_0xe225('0x2b')][_0xe225('0x1d')]);}_0x1a502a[_0xe225('0x33')]=qs[_0xe225('0x34')](_0x58dd98[_0xe225('0x2b')][_0xe225('0x34')]);_0x1a502a[_0xe225('0x35')]=qs[_0xe225('0x36')](_[_0xe225('0x4a')](_0x58dd98[_0xe225('0x2b')],_0x2efae3[_0xe225('0x36')]));_0x1a502a['where'][_0xe225('0x4b')]=_0x4c41ec['id'];if(_0x58dd98[_0xe225('0x2b')][_0xe225('0x37')]){_0x1a502a[_0xe225('0x35')]=_[_0xe225('0x38')](_0x1a502a[_0xe225('0x35')],{'$or':_[_0xe225('0x4c')](_0x1a502a[_0xe225('0x2d')],function(_0x548702){var _0x274ecd={};_0x274ecd[_0x548702]={'$like':'%'+_0x58dd98['query'][_0xe225('0x37')]+'%'};return _0x274ecd;})});}_0x1a502a=_[_0xe225('0x38')]({},_0x1a502a,_0x58dd98[_0xe225('0x3a')]);return db[_0xe225('0x48')][_0xe225('0x1e')]({'where':_0x1a502a[_0xe225('0x35')]})[_0xe225('0x22')](function(_0xa38adf){_0x171738[_0xe225('0x1e')]=_0xa38adf;if(_0x58dd98['query'][_0xe225('0x3f')]){_0x1a502a[_0xe225('0x3b')]=[{'all':!![]}];}return db[_0xe225('0x48')][_0xe225('0x3c')](_0x1a502a);})[_0xe225('0x22')](function(_0x295289){_0x171738[_0xe225('0x3d')]=_0x295289;return _0x171738;});}})[_0xe225('0x22')](respondWithFilteredResult(_0x32910a,_0x1a502a))[_0xe225('0x40')](handleError(_0x32910a,null));}; \ No newline at end of file +var _0x2563=['path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','JscriptySessionReport','type','key','keys','filters','intersection','query','attributes','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','fields','find','create','body','describe','getQuestions','JscriptyQuestionReport','nolimit','findAll','rows','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x2563,0x12e));var _0x3256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2563[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3256('0x0'));var zipdir=require(_0x3256('0x1'));var jsonpatch=require(_0x3256('0x2'));var rp=require(_0x3256('0x3'));var moment=require('moment');var BPromise=require(_0x3256('0x4'));var Mustache=require('mustache');var util=require(_0x3256('0x5'));var path=require(_0x3256('0x6'));var sox=require('sox');var csv=require(_0x3256('0x7'));var ejs=require(_0x3256('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3256('0x9'));var squel=require(_0x3256('0xa'));var crypto=require(_0x3256('0xb'));var jsforce=require(_0x3256('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3256('0x7'));var querystring=require(_0x3256('0xd'));var Papa=require('papaparse');var Redis=require(_0x3256('0xe'));var authService=require(_0x3256('0xf'));var qs=require(_0x3256('0x10'));var as=require(_0x3256('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3256('0x12'))(_0x3256('0x13'));var utils=require(_0x3256('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3256('0x15'));var db=require(_0x3256('0x16'))['db'];function respondWithStatusCode(_0x5b4524,_0x5bce1a){_0x5bce1a=_0x5bce1a||0xcc;return function(_0x31a44b){if(_0x31a44b){return _0x5b4524[_0x3256('0x17')](_0x5bce1a);}return _0x5b4524['status'](_0x5bce1a)[_0x3256('0x18')]();};}function respondWithResult(_0xe45e51,_0x3ea439){_0x3ea439=_0x3ea439||0xc8;return function(_0x5aacd3){if(_0x5aacd3){return _0xe45e51[_0x3256('0x19')](_0x3ea439)[_0x3256('0x1a')](_0x5aacd3);}};}function respondWithFilteredResult(_0x563265,_0x1830f1){return function(_0x27d53f){if(_0x27d53f){var _0x2d37f3=typeof _0x1830f1[_0x3256('0x1b')]===_0x3256('0x1c')&&typeof _0x1830f1[_0x3256('0x1d')]==='undefined';var _0xac609a=_0x27d53f[_0x3256('0x1e')];var _0x5d396b=_0x2d37f3?0x0:_0x1830f1[_0x3256('0x1b')];var _0x1f3315=_0x2d37f3?_0x27d53f['count']:_0x1830f1[_0x3256('0x1b')]+_0x1830f1['limit'];var _0x220bbe;if(_0x1f3315>=_0xac609a){_0x1f3315=_0xac609a;_0x220bbe=0xc8;}else{_0x220bbe=0xce;}_0x563265[_0x3256('0x19')](_0x220bbe);return _0x563265[_0x3256('0x1f')](_0x3256('0x20'),_0x5d396b+'-'+_0x1f3315+'/'+_0xac609a)['json'](_0x27d53f);}return null;};}function patchUpdates(_0x499e83){return function(_0x485be2){try{jsonpatch['apply'](_0x485be2,_0x499e83,!![]);}catch(_0x43db85){return BPromise[_0x3256('0x21')](_0x43db85);}return _0x485be2[_0x3256('0x22')]();};}function saveUpdates(_0x261ce9,_0x58adda){return function(_0x55fe68){if(_0x55fe68){return _0x55fe68[_0x3256('0x23')](_0x261ce9)['then'](function(_0x6e366e){return _0x6e366e;});}return null;};}function removeEntity(_0x1d5812,_0x2b47ff){return function(_0x5152a7){if(_0x5152a7){return _0x5152a7[_0x3256('0x24')]()[_0x3256('0x25')](function(){_0x1d5812[_0x3256('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad1fa,_0x454b20){return function(_0x3642b5){if(!_0x3642b5){_0x3ad1fa[_0x3256('0x17')](0x194);}return _0x3642b5;};}function handleError(_0x18d767,_0x5969f6){_0x5969f6=_0x5969f6||0x1f4;return function(_0x3c0737){logger[_0x3256('0x26')](_0x3c0737['stack']);if(_0x3c0737[_0x3256('0x27')]){delete _0x3c0737[_0x3256('0x27')];}_0x18d767[_0x3256('0x19')](_0x5969f6)[_0x3256('0x28')](_0x3c0737);};}exports[_0x3256('0x29')]=function(_0x513f5,_0x22d579){var _0x40777c={},_0x121659={},_0x52b3fe={'count':0x0,'rows':[]};var _0x4c54e3=_[_0x3256('0x2a')](db[_0x3256('0x2b')]['rawAttributes'],function(_0x4a1944){return{'name':_0x4a1944['fieldName'],'type':_0x4a1944[_0x3256('0x2c')][_0x3256('0x2d')]};});_0x121659['model']=_[_0x3256('0x2a')](_0x4c54e3,_0x3256('0x27'));_0x121659['query']=_[_0x3256('0x2e')](_0x513f5['query']);_0x121659[_0x3256('0x2f')]=_[_0x3256('0x30')](_0x121659['model'],_0x121659[_0x3256('0x31')]);_0x40777c[_0x3256('0x32')]=_[_0x3256('0x30')](_0x121659['model'],qs['fields'](_0x513f5[_0x3256('0x31')]['fields']));_0x40777c[_0x3256('0x32')]=_0x40777c[_0x3256('0x32')][_0x3256('0x33')]?_0x40777c[_0x3256('0x32')]:_0x121659[_0x3256('0x34')];if(!_0x513f5[_0x3256('0x31')][_0x3256('0x35')]('nolimit')){_0x40777c[_0x3256('0x1d')]=qs[_0x3256('0x1d')](_0x513f5[_0x3256('0x31')][_0x3256('0x1d')]);_0x40777c[_0x3256('0x1b')]=qs[_0x3256('0x1b')](_0x513f5[_0x3256('0x31')]['offset']);}_0x40777c[_0x3256('0x36')]=qs[_0x3256('0x37')](_0x513f5[_0x3256('0x31')][_0x3256('0x37')]);_0x40777c[_0x3256('0x38')]=qs[_0x3256('0x2f')](_[_0x3256('0x39')](_0x513f5[_0x3256('0x31')],_0x121659[_0x3256('0x2f')]),_0x4c54e3);if(_0x513f5[_0x3256('0x31')][_0x3256('0x3a')]){_0x40777c['where']=_[_0x3256('0x3b')](_0x40777c[_0x3256('0x38')],{'$or':_['map'](_0x4c54e3,function(_0x56821b){if(_0x56821b[_0x3256('0x2c')]!=='VIRTUAL'){var _0x44d9db={};_0x44d9db[_0x56821b[_0x3256('0x27')]]={'$like':'%'+_0x513f5[_0x3256('0x31')][_0x3256('0x3a')]+'%'};return _0x44d9db;}})});}_0x40777c=_[_0x3256('0x3b')]({},_0x40777c,_0x513f5[_0x3256('0x3c')]);var _0x51f737={'where':_0x40777c['where']};return db[_0x3256('0x2b')][_0x3256('0x1e')](_0x51f737)[_0x3256('0x25')](function(_0xd87406){_0x52b3fe[_0x3256('0x1e')]=_0xd87406;if(_0x513f5[_0x3256('0x31')][_0x3256('0x3d')]){_0x40777c[_0x3256('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x40777c);})[_0x3256('0x25')](function(_0x5572da){_0x52b3fe['rows']=_0x5572da;return _0x52b3fe;})[_0x3256('0x25')](respondWithFilteredResult(_0x22d579,_0x40777c))[_0x3256('0x3f')](handleError(_0x22d579,null));};exports[_0x3256('0x40')]=function(_0x24995c,_0x493d89){var _0x54f356={'raw':!![],'where':{'id':_0x24995c[_0x3256('0x41')]['id']}},_0x1fe211={};_0x1fe211[_0x3256('0x34')]=_[_0x3256('0x2e')](db['JscriptySessionReport'][_0x3256('0x42')]);_0x1fe211[_0x3256('0x31')]=_[_0x3256('0x2e')](_0x24995c[_0x3256('0x31')]);_0x1fe211[_0x3256('0x2f')]=_['intersection'](_0x1fe211[_0x3256('0x34')],_0x1fe211[_0x3256('0x31')]);_0x54f356['attributes']=_[_0x3256('0x30')](_0x1fe211[_0x3256('0x34')],qs[_0x3256('0x43')](_0x24995c[_0x3256('0x31')][_0x3256('0x43')]));_0x54f356['attributes']=_0x54f356[_0x3256('0x32')][_0x3256('0x33')]?_0x54f356[_0x3256('0x32')]:_0x1fe211[_0x3256('0x34')];if(_0x24995c[_0x3256('0x31')][_0x3256('0x3d')]){_0x54f356[_0x3256('0x3e')]=[{'all':!![]}];}_0x54f356=_['merge']({},_0x54f356,_0x24995c['options']);return db['JscriptySessionReport'][_0x3256('0x44')](_0x54f356)['then'](handleEntityNotFound(_0x493d89,null))[_0x3256('0x25')](respondWithResult(_0x493d89,null))[_0x3256('0x3f')](handleError(_0x493d89,null));};exports['create']=function(_0x57e5cb,_0x8c6be4){return db[_0x3256('0x2b')][_0x3256('0x45')](_0x57e5cb[_0x3256('0x46')],{})[_0x3256('0x25')](respondWithResult(_0x8c6be4,0xc9))[_0x3256('0x3f')](handleError(_0x8c6be4,null));};exports[_0x3256('0x23')]=function(_0x5ed3c1,_0x301f8e){if(_0x5ed3c1[_0x3256('0x46')]['id']){delete _0x5ed3c1['body']['id'];}return db[_0x3256('0x2b')][_0x3256('0x44')]({'where':{'id':_0x5ed3c1[_0x3256('0x41')]['id']}})[_0x3256('0x25')](handleEntityNotFound(_0x301f8e,null))[_0x3256('0x25')](saveUpdates(_0x5ed3c1['body'],null))[_0x3256('0x25')](respondWithResult(_0x301f8e,null))['catch'](handleError(_0x301f8e,null));};exports[_0x3256('0x24')]=function(_0x2ec1aa,_0x344355){return db[_0x3256('0x2b')][_0x3256('0x44')]({'where':{'id':_0x2ec1aa[_0x3256('0x41')]['id']}})['then'](handleEntityNotFound(_0x344355,null))[_0x3256('0x25')](removeEntity(_0x344355,null))[_0x3256('0x3f')](handleError(_0x344355,null));};exports[_0x3256('0x47')]=function(_0x234653,_0x23caa4){return db['JscriptySessionReport'][_0x3256('0x47')]()['then'](respondWithResult(_0x23caa4,null))['catch'](handleError(_0x23caa4,null));};exports[_0x3256('0x48')]=function(_0x51861c,_0x50cc6c,_0x49bc8d){var _0x1ab190={'raw':!![],'where':{}};var _0x5652e2={};var _0x1d17e7={'count':0x0,'rows':[]};return db[_0x3256('0x2b')]['findOne']({'where':{'id':_0x51861c[_0x3256('0x41')]['id']}})[_0x3256('0x25')](handleEntityNotFound(_0x50cc6c,null))[_0x3256('0x25')](function(_0x3fff91){if(_0x3fff91){_0x5652e2[_0x3256('0x34')]=_[_0x3256('0x2e')](db[_0x3256('0x49')][_0x3256('0x42')]);_0x5652e2[_0x3256('0x31')]=_['keys'](_0x51861c[_0x3256('0x31')]);_0x5652e2[_0x3256('0x2f')]=_[_0x3256('0x30')](_0x5652e2[_0x3256('0x34')],_0x5652e2[_0x3256('0x31')]);_0x1ab190[_0x3256('0x32')]=_[_0x3256('0x30')](_0x5652e2[_0x3256('0x34')],qs['fields'](_0x51861c[_0x3256('0x31')]['fields']));_0x1ab190[_0x3256('0x32')]=_0x1ab190['attributes'][_0x3256('0x33')]?_0x1ab190[_0x3256('0x32')]:_0x5652e2[_0x3256('0x34')];if(!_0x51861c[_0x3256('0x31')]['hasOwnProperty'](_0x3256('0x4a'))){_0x1ab190['limit']=qs[_0x3256('0x1d')](_0x51861c['query'][_0x3256('0x1d')]);_0x1ab190[_0x3256('0x1b')]=qs['offset'](_0x51861c['query'][_0x3256('0x1b')]);}_0x1ab190[_0x3256('0x36')]=qs['sort'](_0x51861c[_0x3256('0x31')][_0x3256('0x37')]);_0x1ab190[_0x3256('0x38')]=qs[_0x3256('0x2f')](_['pick'](_0x51861c[_0x3256('0x31')],_0x5652e2[_0x3256('0x2f')]));_0x1ab190[_0x3256('0x38')]['SessionId']=_0x3fff91['id'];if(_0x51861c[_0x3256('0x31')][_0x3256('0x3a')]){_0x1ab190['where']=_[_0x3256('0x3b')](_0x1ab190['where'],{'$or':_[_0x3256('0x2a')](_0x1ab190[_0x3256('0x32')],function(_0x3a9315){var _0x1f3ada={};_0x1f3ada[_0x3a9315]={'$like':'%'+_0x51861c[_0x3256('0x31')][_0x3256('0x3a')]+'%'};return _0x1f3ada;})});}_0x1ab190=_['merge']({},_0x1ab190,_0x51861c[_0x3256('0x3c')]);return db[_0x3256('0x49')]['count']({'where':_0x1ab190[_0x3256('0x38')]})['then'](function(_0x361fd5){_0x1d17e7[_0x3256('0x1e')]=_0x361fd5;if(_0x51861c[_0x3256('0x31')]['includeAll']){_0x1ab190[_0x3256('0x3e')]=[{'all':!![]}];}return db[_0x3256('0x49')][_0x3256('0x4b')](_0x1ab190);})[_0x3256('0x25')](function(_0x5d829d){_0x1d17e7[_0x3256('0x4c')]=_0x5d829d;return _0x1d17e7;});}})['then'](respondWithFilteredResult(_0x50cc6c,_0x1ab190))[_0x3256('0x3f')](handleError(_0x50cc6c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c60008b..c8d955e 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 _0xbd51=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','./jscriptySessionReport.attributes'];(function(_0x57ac58,_0x80366c){var _0x3ce39c=function(_0x3bcaa6){while(--_0x3bcaa6){_0x57ac58['push'](_0x57ac58['shift']());}};_0x3ce39c(++_0x80366c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x34c424,_0x496cd3){_0x34c424=_0x34c424-0x0;var _0x3d587c=_0xbd51[_0x34c424];return _0x3d587c;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44e8=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash'];(function(_0x5d115e,_0x35ce96){var _0x420939=function(_0x597832){while(--_0x597832){_0x5d115e['push'](_0x5d115e['shift']());}};_0x420939(++_0x35ce96);}(_0x44e8,0xd7));var _0x844e=function(_0x528ceb,_0x3d2226){_0x528ceb=_0x528ceb-0x0;var _0x49a9e4=_0x44e8[_0x528ceb];return _0x49a9e4;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var BPromise=require(_0x844e('0x3'));var rp=require(_0x844e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var attributes=require(_0x844e('0x7'));module[_0x844e('0x8')]=function(_0x5c8f67,_0x2f6539){return _0x5c8f67[_0x844e('0x9')](_0x844e('0xa'),attributes,{'tableName':_0x844e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index daaad03..73ae6e7 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 _0x3d04=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','info'];(function(_0x73a0c,_0x361948){var _0x1108fc=function(_0x488e76){while(--_0x488e76){_0x73a0c['push'](_0x73a0c['shift']());}};_0x1108fc(++_0x361948);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var BPromise=require(_0x43d0('0x3'));var rs=require(_0x43d0('0x4'));var fs=require('fs');var Redis=require(_0x43d0('0x5'));var db=require(_0x43d0('0x6'))['db'];var utils=require(_0x43d0('0x7'));var logger=require('../../config/logger')(_0x43d0('0x8'));var config=require(_0x43d0('0x9'));var jayson=require(_0x43d0('0xa'));var client=jayson[_0x43d0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484271,_0x50919e,_0x5efb95){return new BPromise(function(_0x457550,_0x3344d3){return client[_0x43d0('0xc')](_0x484271,_0x5efb95)[_0x43d0('0xd')](function(_0x44a763){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'),JSON[_0x43d0('0xf')](_0x44a763));if(_0x44a763[_0x43d0('0x10')]){if(_0x44a763[_0x43d0('0x10')]['code']===0x1f4){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x44a763['error'][_0x43d0('0x12')]);return _0x3344d3(_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);}logger['error'](_0x43d0('0x11'),_0x50919e,_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);return _0x457550(_0x44a763['error'][_0x43d0('0x12')]);}else{logger[_0x43d0('0x13')](_0x43d0('0x11'),_0x50919e,_0x43d0('0xe'));_0x457550(_0x44a763[_0x43d0('0x14')]['message']);}})['catch'](function(_0x1e91a7){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x1e91a7);_0x3344d3(_0x1e91a7);});});} \ No newline at end of file +var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3f7744,_0x3744fc){var _0x420a41=function(_0x1439c0){while(--_0x1439c0){_0x3f7744['push'](_0x3f7744['shift']());}};_0x420a41(++_0x3744fc);}(_0xef0f,0x168));var _0xfef0=function(_0x296982,_0x1310b4){_0x296982=_0x296982-0x0;var _0x360049=_0xef0f[_0x296982];return _0x360049;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b5a4dac..5af601f 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 _0xdf5d=['get','put','/:id','isAuthenticated','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./license.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf5d,0xb7));var _0xddf5=function(_0xd606e1,_0x200842){_0xd606e1=_0xd606e1-0x0;var _0x4fff57=_0xdf5d[_0xd606e1];return _0x4fff57;};'use strict';var multer=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var path=require(_0xddf5('0x2'));var timeout=require(_0xddf5('0x3'));var express=require(_0xddf5('0x4'));var router=express[_0xddf5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xddf5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xddf5('0x7'));var controller=require(_0xddf5('0x8'));router[_0xddf5('0x9')]('/',controller['index']);router[_0xddf5('0xa')](_0xddf5('0xb'),auth[_0xddf5('0xc')](),controller['update']);router[_0xddf5('0x9')](_0xddf5('0xd'),auth['isAuthenticated'](),controller[_0xddf5('0xe')]);module[_0xddf5('0xf')]=router; \ No newline at end of file +var _0x9387=['../../components/auth/service','../../components/interaction/service','./license.controller','put','/:id','update','get','isAuthenticated','downloadLogFile','exports','multer','util','express','Router','fs-extra'];(function(_0x4407a1,_0x200f3a){var _0xfdbd45=function(_0x2d8f76){while(--_0x2d8f76){_0x4407a1['push'](_0x4407a1['shift']());}};_0xfdbd45(++_0x200f3a);}(_0x9387,0x172));var _0x7938=function(_0x4c9956,_0x5c6847){_0x4c9956=_0x4c9956-0x0;var _0x190afd=_0x9387[_0x4c9956];return _0x190afd;};'use strict';var multer=require(_0x7938('0x0'));var util=require(_0x7938('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7938('0x2'));var router=express[_0x7938('0x3')]();var fs_extra=require(_0x7938('0x4'));var auth=require(_0x7938('0x5'));var interaction=require(_0x7938('0x6'));var config=require('../../config/environment');var controller=require(_0x7938('0x7'));router['get']('/',controller['index']);router[_0x7938('0x8')](_0x7938('0x9'),auth['isAuthenticated'](),controller[_0x7938('0xa')]);router[_0x7938('0xb')]('/download_log_file',auth[_0x7938('0xc')](),controller[_0x7938('0xd')]);module[_0x7938('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 8bfefd0..382a43f 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 _0x9979=['TEXT','STRING','INTEGER','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9979,0xdf));var _0x9997=function(_0x2a81cb,_0xa8c94a){_0x2a81cb=_0x2a81cb-0x0;var _0xe02861=_0x9979[_0x2a81cb];return _0xe02861;};'use strict';var Sequelize=require(_0x9997('0x0'));module['exports']={'license':{'type':Sequelize[_0x9997('0x1')]},'data1':{'type':Sequelize[_0x9997('0x2')]},'data2':{'type':Sequelize[_0x9997('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x9997('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x76e2=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x304471,_0x361864){var _0x2b6563=function(_0x2ec573){while(--_0x2ec573){_0x304471['push'](_0x304471['shift']());}};_0x2b6563(++_0x361864);}(_0x76e2,0x194));var _0x276e=function(_0x5e77d7,_0x44d1fa){_0x5e77d7=_0x5e77d7-0x0;var _0x4e0661=_0x76e2[_0x5e77d7];return _0x4e0661;};'use strict';var Sequelize=require(_0x276e('0x0'));module[_0x276e('0x1')]={'license':{'type':Sequelize[_0x276e('0x2')]},'data1':{'type':Sequelize[_0x276e('0x3')]},'data2':{'type':Sequelize[_0x276e('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x276e('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 576850a..07e5daa 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 _0x386f=['sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','params','get','checkLicense','key','demo','license-info.log','join','/var','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x36a9c5,_0x510cd4){var _0x21a178=function(_0x3ca99c){while(--_0x3ca99c){_0x36a9c5['push'](_0x36a9c5['shift']());}};_0x21a178(++_0x510cd4);}(_0x386f,0x194));var _0xf386=function(_0x1b65d8,_0x1b37b0){_0x1b65d8=_0x1b65d8-0x0;var _0x3620bf=_0x386f[_0x1b65d8];return _0x3620bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf386('0x0'));var zipdir=require(_0xf386('0x1'));var jsonpatch=require(_0xf386('0x2'));var rp=require(_0xf386('0x3'));var moment=require(_0xf386('0x4'));var BPromise=require(_0xf386('0x5'));var Mustache=require(_0xf386('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf386('0x7'));var csv=require(_0xf386('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf386('0x9'));var crypto=require('crypto');var jsforce=require(_0xf386('0xa'));var deskjs=require(_0xf386('0xb'));var toCsv=require(_0xf386('0x8'));var querystring=require(_0xf386('0xc'));var Papa=require(_0xf386('0xd'));var Redis=require(_0xf386('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf386('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf386('0x10'));var logger=require('../../config/logger')(_0xf386('0x11'));var utils=require(_0xf386('0x12'));var config=require(_0xf386('0x13'));var licenseUtil=require(_0xf386('0x14'));var db=require(_0xf386('0x15'))['db'];function respondWithStatusCode(_0x130634,_0x5273a9){_0x5273a9=_0x5273a9||0xcc;return function(_0x3ab7fb){if(_0x3ab7fb){return _0x130634[_0xf386('0x16')](_0x5273a9);}return _0x130634[_0xf386('0x17')](_0x5273a9)[_0xf386('0x18')]();};}function respondWithResult(_0x4020d1,_0x32fad3){_0x32fad3=_0x32fad3||0xc8;return function(_0x4b2b21){if(_0x4b2b21){return _0x4020d1[_0xf386('0x17')](_0x32fad3)[_0xf386('0x19')](_0x4b2b21);}};}function respondWithFilteredResult(_0x32eae7,_0x528912){return function(_0x4423bb){if(_0x4423bb){var _0x3478b3=typeof _0x528912[_0xf386('0x1a')]===_0xf386('0x1b')&&typeof _0x528912['limit']===_0xf386('0x1b');var _0x3d35d3=_0x4423bb[_0xf386('0x1c')];var _0xcb009c=_0x3478b3?0x0:_0x528912['offset'];var _0x3366d8=_0x3478b3?_0x4423bb['count']:_0x528912[_0xf386('0x1a')]+_0x528912[_0xf386('0x1d')];var _0x4fdb72;if(_0x3366d8>=_0x3d35d3){_0x3366d8=_0x3d35d3;_0x4fdb72=0xc8;}else{_0x4fdb72=0xce;}_0x32eae7['status'](_0x4fdb72);return _0x32eae7[_0xf386('0x1e')]('Content-Range',_0xcb009c+'-'+_0x3366d8+'/'+_0x3d35d3)[_0xf386('0x19')](_0x4423bb);}return null;};}function patchUpdates(_0x326854){return function(_0x4fd67b){try{jsonpatch[_0xf386('0x1f')](_0x4fd67b,_0x326854,!![]);}catch(_0x51e815){return BPromise[_0xf386('0x20')](_0x51e815);}return _0x4fd67b[_0xf386('0x21')]();};}function saveUpdates(_0x499039,_0x2470f8){return function(_0x593ba9){if(_0x593ba9){return _0x593ba9[_0xf386('0x22')](_0x499039)[_0xf386('0x23')](function(_0xf3fea4){return _0xf3fea4;});}return null;};}function removeEntity(_0x4d00b7,_0x4b3ee8){return function(_0xee073f){if(_0xee073f){return _0xee073f[_0xf386('0x24')]()[_0xf386('0x23')](function(){_0x4d00b7[_0xf386('0x17')](0xcc)[_0xf386('0x18')]();});}};}function handleEntityNotFound(_0x4dc263,_0x35daec){return function(_0x66dbe8){if(!_0x66dbe8){_0x4dc263['sendStatus'](0x194);}return _0x66dbe8;};}function handleError(_0x5b066c,_0x1b6fe6){_0x1b6fe6=_0x1b6fe6||0x1f4;return function(_0x1fdaca){logger[_0xf386('0x25')](_0x1fdaca[_0xf386('0x26')]);if(_0x1fdaca[_0xf386('0x27')]){delete _0x1fdaca[_0xf386('0x27')];}_0x5b066c['status'](_0x1b6fe6)[_0xf386('0x28')](_0x1fdaca);};}var utilLicense=require('../../config/license/util');exports[_0xf386('0x29')]=function(_0x3afcad,_0x13e52b){var _0x17e0b7={'raw':!![],'where':{'id':0x1}},_0x14cfbc={};_0x14cfbc[_0xf386('0x2a')]=_[_0xf386('0x2b')](db['License'][_0xf386('0x2c')]);_0x14cfbc[_0xf386('0x2d')]=_[_0xf386('0x2b')](_0x3afcad[_0xf386('0x2d')]);_0x14cfbc[_0xf386('0x2e')]=_[_0xf386('0x2f')](_0x14cfbc['model'],_0x14cfbc[_0xf386('0x2d')]);_0x17e0b7[_0xf386('0x30')]=_[_0xf386('0x2f')](_0x14cfbc[_0xf386('0x2a')],qs['fields'](_0x3afcad[_0xf386('0x2d')][_0xf386('0x31')]));_0x17e0b7['attributes']=_0x17e0b7[_0xf386('0x30')][_0xf386('0x32')]?_0x17e0b7[_0xf386('0x30')]:_0x14cfbc[_0xf386('0x2a')];_0x17e0b7=_['merge']({},_0x17e0b7,_0x3afcad[_0xf386('0x33')]);return utilLicense[_0xf386('0x34')](_0x17e0b7)['then'](respondWithResult(_0x13e52b,null))[_0xf386('0x35')](handleError(_0x13e52b,null));};exports[_0xf386('0x22')]=function(_0x4035f3,_0x58f8d5){if(_0x4035f3[_0xf386('0x36')]['id']){delete _0x4035f3[_0xf386('0x36')]['id'];}return db[_0xf386('0x37')][_0xf386('0x38')]({'where':{'id':_0x4035f3[_0xf386('0x39')]['id']}})['then'](handleEntityNotFound(_0x58f8d5,null))[_0xf386('0x23')](function(_0x10a624){var _0x11c808=_0x10a624[_0xf386('0x3a')]({'plain':!![]});return utilLicense[_0xf386('0x3b')](_0x11c808,_0x4035f3[_0xf386('0x36')][_0xf386('0x3c')]);})[_0xf386('0x23')](function(_0x56ccc9){if(!_0x56ccc9[_0xf386('0x3d')]){return saveUpdates(_0x4035f3[_0xf386('0x36')],null);}return _0x56ccc9;})['then'](respondWithResult(_0x58f8d5,null))[_0xf386('0x35')](handleError(_0x58f8d5,null));};exports['downloadLogFile']=function(_0x11940a,_0x1a7589){var _0x2e1611=_0xf386('0x3e');var _0x3ef923=path[_0xf386('0x3f')](_0xf386('0x40'),'log',_0xf386('0x41'),_0x2e1611);_0x1a7589['setHeader'](_0xf386('0x42'),_0xf386('0x43')+_0x2e1611);_0x1a7589[_0xf386('0x1e')](_0xf386('0x44'),_0xf386('0x45'));_0x1a7589[_0xf386('0x46')](_0x3ef923);}; \ No newline at end of file +var _0x93ef=['keys','License','query','model','intersection','fields','attributes','length','merge','options','catch','body','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','log','xcally','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x11a45,_0x1e40c3){var _0x48d1e6=function(_0x1bd617){while(--_0x1bd617){_0x11a45['push'](_0x11a45['shift']());}};_0x48d1e6(++_0x1e40c3);}(_0x93ef,0x12b));var _0xf93e=function(_0x446bd4,_0x40fb4e){_0x446bd4=_0x446bd4-0x0;var _0x2e8901=_0x93ef[_0x446bd4];return _0x2e8901;};'use strict';var emlformat=require(_0xf93e('0x0'));var rimraf=require(_0xf93e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf93e('0x2'));var rp=require(_0xf93e('0x3'));var moment=require(_0xf93e('0x4'));var BPromise=require(_0xf93e('0x5'));var Mustache=require(_0xf93e('0x6'));var util=require(_0xf93e('0x7'));var path=require(_0xf93e('0x8'));var sox=require(_0xf93e('0x9'));var csv=require(_0xf93e('0xa'));var ejs=require(_0xf93e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf93e('0xc'));var squel=require('squel');var crypto=require(_0xf93e('0xd'));var jsforce=require(_0xf93e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf93e('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf93e('0xf'));var qs=require(_0xf93e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf93e('0x11'));var logger=require(_0xf93e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf93e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33f576,_0x5643fc){_0x5643fc=_0x5643fc||0xcc;return function(_0x37c734){if(_0x37c734){return _0x33f576[_0xf93e('0x14')](_0x5643fc);}return _0x33f576[_0xf93e('0x15')](_0x5643fc)[_0xf93e('0x16')]();};}function respondWithResult(_0x5ee6fd,_0x24b35b){_0x24b35b=_0x24b35b||0xc8;return function(_0x546573){if(_0x546573){return _0x5ee6fd[_0xf93e('0x15')](_0x24b35b)[_0xf93e('0x17')](_0x546573);}};}function respondWithFilteredResult(_0x25f04d,_0x119111){return function(_0x394ba1){if(_0x394ba1){var _0x1e926d=typeof _0x119111['offset']===_0xf93e('0x18')&&typeof _0x119111[_0xf93e('0x19')]===_0xf93e('0x18');var _0x251bc7=_0x394ba1[_0xf93e('0x1a')];var _0x2ca26b=_0x1e926d?0x0:_0x119111[_0xf93e('0x1b')];var _0x32b6a5=_0x1e926d?_0x394ba1[_0xf93e('0x1a')]:_0x119111[_0xf93e('0x1b')]+_0x119111['limit'];var _0x16d3dd;if(_0x32b6a5>=_0x251bc7){_0x32b6a5=_0x251bc7;_0x16d3dd=0xc8;}else{_0x16d3dd=0xce;}_0x25f04d[_0xf93e('0x15')](_0x16d3dd);return _0x25f04d[_0xf93e('0x1c')](_0xf93e('0x1d'),_0x2ca26b+'-'+_0x32b6a5+'/'+_0x251bc7)[_0xf93e('0x17')](_0x394ba1);}return null;};}function patchUpdates(_0x3a9996){return function(_0x388de4){try{jsonpatch[_0xf93e('0x1e')](_0x388de4,_0x3a9996,!![]);}catch(_0x232b52){return BPromise[_0xf93e('0x1f')](_0x232b52);}return _0x388de4[_0xf93e('0x20')]();};}function saveUpdates(_0x4d2279,_0x4184ed){return function(_0x23e13a){if(_0x23e13a){return _0x23e13a[_0xf93e('0x21')](_0x4d2279)[_0xf93e('0x22')](function(_0xbfa3d1){return _0xbfa3d1;});}return null;};}function removeEntity(_0xfaf5ea,_0x20dbcf){return function(_0x18f5c4){if(_0x18f5c4){return _0x18f5c4[_0xf93e('0x23')]()[_0xf93e('0x22')](function(){_0xfaf5ea[_0xf93e('0x15')](0xcc)[_0xf93e('0x16')]();});}};}function handleEntityNotFound(_0x29a209,_0x3f3d49){return function(_0xbfe5e9){if(!_0xbfe5e9){_0x29a209['sendStatus'](0x194);}return _0xbfe5e9;};}function handleError(_0x1dc5f5,_0x5c1d0c){_0x5c1d0c=_0x5c1d0c||0x1f4;return function(_0x29da96){logger[_0xf93e('0x24')](_0x29da96[_0xf93e('0x25')]);if(_0x29da96[_0xf93e('0x26')]){delete _0x29da96[_0xf93e('0x26')];}_0x1dc5f5['status'](_0x5c1d0c)[_0xf93e('0x27')](_0x29da96);};}var utilLicense=require(_0xf93e('0x13'));exports[_0xf93e('0x28')]=function(_0x462454,_0x4ae535){var _0x38de4e={'raw':!![],'where':{'id':0x1}},_0x2a71de={};_0x2a71de['model']=_[_0xf93e('0x29')](db[_0xf93e('0x2a')]['rawAttributes']);_0x2a71de[_0xf93e('0x2b')]=_[_0xf93e('0x29')](_0x462454[_0xf93e('0x2b')]);_0x2a71de['filters']=_['intersection'](_0x2a71de[_0xf93e('0x2c')],_0x2a71de[_0xf93e('0x2b')]);_0x38de4e['attributes']=_[_0xf93e('0x2d')](_0x2a71de[_0xf93e('0x2c')],qs[_0xf93e('0x2e')](_0x462454[_0xf93e('0x2b')][_0xf93e('0x2e')]));_0x38de4e[_0xf93e('0x2f')]=_0x38de4e['attributes'][_0xf93e('0x30')]?_0x38de4e[_0xf93e('0x2f')]:_0x2a71de['model'];_0x38de4e=_[_0xf93e('0x31')]({},_0x38de4e,_0x462454[_0xf93e('0x32')]);return utilLicense['getLicense'](_0x38de4e)[_0xf93e('0x22')](respondWithResult(_0x4ae535,null))[_0xf93e('0x33')](handleError(_0x4ae535,null));};exports[_0xf93e('0x21')]=function(_0x413279,_0xc1972f){if(_0x413279[_0xf93e('0x34')]['id']){delete _0x413279[_0xf93e('0x34')]['id'];}return db['License'][_0xf93e('0x35')]({'where':{'id':_0x413279[_0xf93e('0x36')]['id']}})['then'](handleEntityNotFound(_0xc1972f,null))[_0xf93e('0x22')](function(_0x951bc){var _0x1afe68=_0x951bc[_0xf93e('0x37')]({'plain':!![]});return utilLicense[_0xf93e('0x38')](_0x1afe68,_0x413279[_0xf93e('0x34')][_0xf93e('0x39')]);})[_0xf93e('0x22')](function(_0x11a695){if(!_0x11a695[_0xf93e('0x3a')]){return saveUpdates(_0x413279['body'],null);}return _0x11a695;})['then'](respondWithResult(_0xc1972f,null))[_0xf93e('0x33')](handleError(_0xc1972f,null));};exports[_0xf93e('0x3b')]=function(_0x43df0f,_0x861f6e){var _0x36f0f4=_0xf93e('0x3c');var _0x45bbfa=path[_0xf93e('0x3d')]('/var',_0xf93e('0x3e'),_0xf93e('0x3f'),_0x36f0f4);_0x861f6e['setHeader'](_0xf93e('0x40'),_0xf93e('0x41')+_0x36f0f4);_0x861f6e[_0xf93e('0x1c')](_0xf93e('0x42'),'text/plain');_0x861f6e[_0xf93e('0x43')](_0x45bbfa);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index a72908e..2abe7dd 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 _0xf539=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./license.attributes','define','License','license'];(function(_0x8be9fb,_0x2f90d9){var _0x3b41ac=function(_0x369a8f){while(--_0x369a8f){_0x8be9fb['push'](_0x8be9fb['shift']());}};_0x3b41ac(++_0x2f90d9);}(_0xf539,0x180));var _0x9f53=function(_0x5b3e27,_0xa94d3d){_0x5b3e27=_0x5b3e27-0x0;var _0x231fe9=_0xf539[_0x5b3e27];return _0x231fe9;};'use strict';var _=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var logger=require(_0x9f53('0x2'))(_0x9f53('0x3'));var moment=require('moment');var BPromise=require(_0x9f53('0x4'));var rp=require(_0x9f53('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f53('0x6'));var config=require(_0x9f53('0x7'));var attributes=require(_0x9f53('0x8'));module['exports']=function(_0x12220b,_0x23a2c8){return _0x12220b[_0x9f53('0x9')](_0x9f53('0xa'),attributes,{'tableName':_0x9f53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b8c=['lodash','util','../../config/logger','api','bluebird','rimraf','./license.attributes','exports','define','License','license'];(function(_0x4ddef,_0x56ce56){var _0x62232d=function(_0x16f5c6){while(--_0x16f5c6){_0x4ddef['push'](_0x4ddef['shift']());}};_0x62232d(++_0x56ce56);}(_0x0b8c,0x1d9));var _0xc0b8=function(_0x35eaca,_0x154e42){_0x35eaca=_0x35eaca-0x0;var _0x54ae8b=_0x0b8c[_0x35eaca];return _0x54ae8b;};'use strict';var _=require(_0xc0b8('0x0'));var util=require(_0xc0b8('0x1'));var logger=require(_0xc0b8('0x2'))(_0xc0b8('0x3'));var moment=require('moment');var BPromise=require(_0xc0b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0b8('0x5'));var config=require('../../config/environment');var attributes=require(_0xc0b8('0x6'));module[_0xc0b8('0x7')]=function(_0x3e8a40,_0x50f71e){return _0x3e8a40[_0xc0b8('0x8')](_0xc0b8('0x9'),attributes,{'tableName':_0xc0b8('0xa'),'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 01ed16c..bb79f87 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 _0xaa80=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','License,\x20%s,\x20%s'];(function(_0x335d63,_0x5d8378){var _0x49bcda=function(_0x4b3ea4){while(--_0x4b3ea4){_0x335d63['push'](_0x335d63['shift']());}};_0x49bcda(++_0x5d8378);}(_0xaa80,0xab));var _0x0aa8=function(_0x2aa18d,_0x367b3f){_0x2aa18d=_0x2aa18d-0x0;var _0x30c427=_0xaa80[_0x2aa18d];return _0x30c427;};'use strict';var _=require(_0x0aa8('0x0'));var util=require(_0x0aa8('0x1'));var moment=require(_0x0aa8('0x2'));var BPromise=require(_0x0aa8('0x3'));var rs=require(_0x0aa8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0aa8('0x5'))['db'];var utils=require(_0x0aa8('0x6'));var logger=require('../../config/logger')(_0x0aa8('0x7'));var config=require('../../config/environment');var jayson=require(_0x0aa8('0x8'));var client=jayson['client'][_0x0aa8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ba85c,_0x1bb2c7,_0x521ed4){return new BPromise(function(_0x58c420,_0x20501f){return client[_0x0aa8('0xa')](_0x4ba85c,_0x521ed4)[_0x0aa8('0xb')](function(_0xe7420c){logger['info'](_0x0aa8('0xc'),_0x1bb2c7,_0x0aa8('0xd'));logger[_0x0aa8('0xe')](_0x0aa8('0xf'),_0x1bb2c7,'request\x20sent',JSON[_0x0aa8('0x10')](_0xe7420c));if(_0xe7420c[_0x0aa8('0x11')]){if(_0xe7420c[_0x0aa8('0x11')][_0x0aa8('0x12')]===0x1f4){logger[_0x0aa8('0x11')]('License,\x20%s,\x20%s',_0x1bb2c7,_0xe7420c[_0x0aa8('0x11')]['message']);return _0x20501f(_0xe7420c[_0x0aa8('0x11')]['message']);}logger[_0x0aa8('0x11')](_0x0aa8('0xc'),_0x1bb2c7,_0xe7420c['error'][_0x0aa8('0x13')]);return _0x58c420(_0xe7420c[_0x0aa8('0x11')][_0x0aa8('0x13')]);}else{logger[_0x0aa8('0x14')](_0x0aa8('0xc'),_0x1bb2c7,'request\x20sent');_0x58c420(_0xe7420c[_0x0aa8('0x15')][_0x0aa8('0x13')]);}})[_0x0aa8('0x16')](function(_0x13eb2a){logger[_0x0aa8('0x11')](_0x0aa8('0xc'),_0x1bb2c7,_0x13eb2a);_0x20501f(_0x13eb2a);});});} \ No newline at end of file +var _0xb7e9=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x4dbb84,_0x5707b8){var _0x21f6f5=function(_0x158901){while(--_0x158901){_0x4dbb84['push'](_0x4dbb84['shift']());}};_0x21f6f5(++_0x5707b8);}(_0xb7e9,0x11f));var _0x9b7e=function(_0x30bb30,_0x564af1){_0x30bb30=_0x30bb30-0x0;var _0xce44e7=_0xb7e9[_0x30bb30];return _0xce44e7;};'use strict';var _=require(_0x9b7e('0x0'));var util=require(_0x9b7e('0x1'));var moment=require(_0x9b7e('0x2'));var BPromise=require(_0x9b7e('0x3'));var rs=require(_0x9b7e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b7e('0x5'))['db'];var utils=require(_0x9b7e('0x6'));var logger=require(_0x9b7e('0x7'))(_0x9b7e('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b7e('0x9'));var client=jayson[_0x9b7e('0xa')][_0x9b7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x68cd28,_0x1440fd,_0x240031){return new BPromise(function(_0x279524,_0x5a2373){return client[_0x9b7e('0xc')](_0x68cd28,_0x240031)[_0x9b7e('0xd')](function(_0x310be8){logger['info'](_0x9b7e('0xe'),_0x1440fd,_0x9b7e('0xf'));logger[_0x9b7e('0x10')](_0x9b7e('0x11'),_0x1440fd,_0x9b7e('0xf'),JSON[_0x9b7e('0x12')](_0x310be8));if(_0x310be8[_0x9b7e('0x13')]){if(_0x310be8[_0x9b7e('0x13')]['code']===0x1f4){logger[_0x9b7e('0x13')](_0x9b7e('0xe'),_0x1440fd,_0x310be8[_0x9b7e('0x13')][_0x9b7e('0x14')]);return _0x5a2373(_0x310be8[_0x9b7e('0x13')][_0x9b7e('0x14')]);}logger[_0x9b7e('0x13')](_0x9b7e('0xe'),_0x1440fd,_0x310be8[_0x9b7e('0x13')][_0x9b7e('0x14')]);return _0x279524(_0x310be8[_0x9b7e('0x13')][_0x9b7e('0x14')]);}else{logger[_0x9b7e('0x15')](_0x9b7e('0xe'),_0x1440fd,'request\x20sent');_0x279524(_0x310be8[_0x9b7e('0x16')][_0x9b7e('0x14')]);}})[_0x9b7e('0x17')](function(_0x403741){logger[_0x9b7e('0x13')]('License,\x20%s,\x20%s',_0x1440fd,_0x403741);_0x5a2373(_0x403741);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 50f92a7..c99d7c8 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 _0x5ce9=['addApplications','send','/:id','update','removeDispositions','delete','removeImap','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addSmtp'];(function(_0x597138,_0x52aa5b){var _0x2964cc=function(_0x18bbff){while(--_0x18bbff){_0x597138['push'](_0x597138['shift']());}};_0x2964cc(++_0x52aa5b);}(_0x5ce9,0x19f));var _0x95ce=function(_0x246380,_0x4b2a12){_0x246380=_0x246380-0x0;var _0x10fef8=_0x5ce9[_0x246380];return _0x10fef8;};'use strict';var multer=require(_0x95ce('0x0'));var util=require(_0x95ce('0x1'));var path=require(_0x95ce('0x2'));var timeout=require(_0x95ce('0x3'));var express=require('express');var router=express[_0x95ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x95ce('0x5'));var interaction=require(_0x95ce('0x6'));var config=require('../../config/environment');var controller=require(_0x95ce('0x7'));router[_0x95ce('0x8')]('/',auth[_0x95ce('0x9')](),controller[_0x95ce('0xa')]);router[_0x95ce('0x8')](_0x95ce('0xb'),auth[_0x95ce('0x9')](),controller[_0x95ce('0xc')]);router[_0x95ce('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x95ce('0xd')]);router[_0x95ce('0x8')](_0x95ce('0xe'),auth[_0x95ce('0x9')](),controller['getDispositions']);router[_0x95ce('0x8')](_0x95ce('0xf'),auth['isAuthenticated'](),controller[_0x95ce('0x10')]);router[_0x95ce('0x8')](_0x95ce('0x11'),auth['isAuthenticated'](),controller[_0x95ce('0x12')]);router[_0x95ce('0x8')](_0x95ce('0x13'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x14')]);router[_0x95ce('0x8')](_0x95ce('0x15'),auth['isAuthenticated'](),controller[_0x95ce('0x16')]);router[_0x95ce('0x8')](_0x95ce('0x17'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x18')]);router[_0x95ce('0x8')](_0x95ce('0x19'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x1a')]);router['get'](_0x95ce('0x1b'),auth[_0x95ce('0x9')](),controller['verifySmtp']);router[_0x95ce('0x8')](_0x95ce('0x1c'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x1d')]);router[_0x95ce('0x1e')](_0x95ce('0xe'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x1f')]);router[_0x95ce('0x1e')](_0x95ce('0xf'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x20')]);router[_0x95ce('0x1e')]('/',auth[_0x95ce('0x9')](),controller[_0x95ce('0x21')]);router[_0x95ce('0x1e')](_0x95ce('0x11'),auth[_0x95ce('0x9')](),controller['addImap']);router[_0x95ce('0x1e')](_0x95ce('0x13'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x22')]);router['post'](_0x95ce('0x15'),auth[_0x95ce('0x9')](),controller['addInteraction']);router[_0x95ce('0x1e')](_0x95ce('0x17'),auth['isAuthenticated'](),controller[_0x95ce('0x23')]);router[_0x95ce('0x1e')]('/:id/send',auth[_0x95ce('0x9')](),controller[_0x95ce('0x24')]);router[_0x95ce('0x1e')]('/:id/users',auth[_0x95ce('0x9')](),controller['addAgents']);router['put'](_0x95ce('0x25'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x26')]);router['delete'](_0x95ce('0xe'),auth['isAuthenticated'](),controller[_0x95ce('0x27')]);router[_0x95ce('0x28')](_0x95ce('0xf'),auth[_0x95ce('0x9')](),controller['removeAnswers']);router[_0x95ce('0x28')](_0x95ce('0x11'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x29')]);router[_0x95ce('0x28')]('/:id/out_servers',auth['isAuthenticated'](),controller['removeSmtp']);router[_0x95ce('0x28')]('/:id',auth['isAuthenticated'](),controller[_0x95ce('0x2a')]);router['delete'](_0x95ce('0x1c'),auth[_0x95ce('0x9')](),controller[_0x95ce('0x2b')]);module[_0x95ce('0x2c')]=router; \ No newline at end of file +var _0xdfaa=['isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addInteraction','/:id/send','addAgents','put','update','removeDispositions','delete','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe'];(function(_0x361b62,_0x4dedbe){var _0x4bfc02=function(_0xbd1862){while(--_0xbd1862){_0x361b62['push'](_0x361b62['shift']());}};_0x4bfc02(++_0x4dedbe);}(_0xdfaa,0x120));var _0xadfa=function(_0x567d6b,_0x1a40f3){_0x567d6b=_0x567d6b-0x0;var _0x9068ab=_0xdfaa[_0x567d6b];return _0x9068ab;};'use strict';var multer=require('multer');var util=require(_0xadfa('0x0'));var path=require(_0xadfa('0x1'));var timeout=require(_0xadfa('0x2'));var express=require(_0xadfa('0x3'));var router=express[_0xadfa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xadfa('0x5'));var interaction=require(_0xadfa('0x6'));var config=require(_0xadfa('0x7'));var controller=require(_0xadfa('0x8'));router[_0xadfa('0x9')]('/',auth['isAuthenticated'](),controller[_0xadfa('0xa')]);router['get'](_0xadfa('0xb'),auth[_0xadfa('0xc')](),controller[_0xadfa('0xd')]);router[_0xadfa('0x9')](_0xadfa('0xe'),auth[_0xadfa('0xc')](),controller[_0xadfa('0xf')]);router[_0xadfa('0x9')](_0xadfa('0x10'),auth['isAuthenticated'](),controller[_0xadfa('0x11')]);router[_0xadfa('0x9')]('/:id/canned_answers',auth[_0xadfa('0xc')](),controller[_0xadfa('0x12')]);router[_0xadfa('0x9')](_0xadfa('0x13'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x14')]);router[_0xadfa('0x9')](_0xadfa('0x15'),auth['isAuthenticated'](),controller[_0xadfa('0x16')]);router[_0xadfa('0x9')](_0xadfa('0x17'),auth['isAuthenticated'](),controller[_0xadfa('0x18')]);router[_0xadfa('0x9')](_0xadfa('0x19'),auth[_0xadfa('0xc')](),controller['getApplications']);router[_0xadfa('0x9')](_0xadfa('0x1a'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x1b')]);router[_0xadfa('0x9')](_0xadfa('0x1c'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x1d')]);router['get'](_0xadfa('0x1e'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x1f')]);router[_0xadfa('0x20')](_0xadfa('0x10'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x21')]);router[_0xadfa('0x20')]('/:id/canned_answers',auth[_0xadfa('0xc')](),controller[_0xadfa('0x22')]);router[_0xadfa('0x20')]('/',auth[_0xadfa('0xc')](),controller['create']);router[_0xadfa('0x20')]('/:id/in_servers',auth[_0xadfa('0xc')](),controller[_0xadfa('0x23')]);router[_0xadfa('0x20')](_0xadfa('0x15'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x24')]);router[_0xadfa('0x20')]('/:id/interactions',auth[_0xadfa('0xc')](),controller[_0xadfa('0x25')]);router[_0xadfa('0x20')](_0xadfa('0x19'),auth['isAuthenticated'](),controller['addApplications']);router[_0xadfa('0x20')](_0xadfa('0x26'),auth[_0xadfa('0xc')](),controller['send']);router[_0xadfa('0x20')](_0xadfa('0x1e'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x27')]);router[_0xadfa('0x28')](_0xadfa('0xe'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x29')]);router['delete']('/:id/dispositions',auth[_0xadfa('0xc')](),controller[_0xadfa('0x2a')]);router[_0xadfa('0x2b')](_0xadfa('0x2c'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x2d')]);router['delete'](_0xadfa('0x13'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x2e')]);router[_0xadfa('0x2b')](_0xadfa('0x15'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x2f')]);router[_0xadfa('0x2b')](_0xadfa('0xe'),auth[_0xadfa('0xc')](),controller['destroy']);router[_0xadfa('0x2b')](_0xadfa('0x1e'),auth[_0xadfa('0xc')](),controller[_0xadfa('0x30')]);module[_0xadfa('0x31')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 206826b..7941967 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 _0x950a=['setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail','yahoo','outlook365','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x232019,_0x16402c){var _0x4d9203=function(_0x12bce6){while(--_0x12bce6){_0x232019['push'](_0x232019['shift']());}};_0x4d9203(++_0x16402c);}(_0x950a,0x1b9));var _0xa950=function(_0x15c1eb,_0x3c8cb8){_0x15c1eb=_0x15c1eb-0x0;var _0x630e54=_0x950a[_0x15c1eb];return _0x630e54;};'use strict';var Sequelize=require(_0xa950('0x0'));module[_0xa950('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa950('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa950('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa950('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xa950('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xa950('0x4')]},'markAsUnread':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa950('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xa950('0x5')](0x2)[_0xa950('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa950('0x7');}},'notificationSound':{'type':Sequelize[_0xa950('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa950('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa950('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa950('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa950('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![],'comment':_0xa950('0x8'),'set':function(_0x5c9fd3){if(!_0x5c9fd3)this[_0xa950('0x9')](_0xa950('0xa'),null);this[_0xa950('0x9')]('mandatoryDisposition',_0x5c9fd3);}},'provider':{'type':Sequelize[_0xa950('0xb')](_0xa950('0xc'),_0xa950('0xd'),_0xa950('0xe'),_0xa950('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0xa950('0x10');return this['getDataValue'](_0xa950('0x11'));},'set':function(_0x446ff7){if(_0x446ff7===_0xa950('0x10'))_0x446ff7=null;return this[_0xa950('0x9')](_0xa950('0x11'),_0x446ff7);}}}; \ No newline at end of file +var _0xbc74=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','TEXT','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','outlook365','provider','getDataValue','sequelize','exports'];(function(_0x23a417,_0x56ff8e){var _0x3c1651=function(_0x3e2b19){while(--_0x3e2b19){_0x23a417['push'](_0x23a417['shift']());}};_0x3c1651(++_0x56ff8e);}(_0xbc74,0xa0));var _0x4bc7=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xbc74[_0x485b5a];return _0xd2b34d;};'use strict';var Sequelize=require(_0x4bc7('0x0'));module[_0x4bc7('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4bc7('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x4bc7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x4bc7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4bc7('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x4bc7('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4bc7('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4bc7('0x5')],'defaultValue':function(){return _0x4bc7('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4bc7('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4bc7('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4bc7('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4bc7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4bc7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x4bc7('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x440654){if(!_0x440654)this[_0x4bc7('0x9')](_0x4bc7('0xa'),null);this[_0x4bc7('0x9')](_0x4bc7('0xb'),_0x440654);}},'provider':{'type':Sequelize['ENUM'](_0x4bc7('0xc'),_0x4bc7('0xd'),_0x4bc7('0xe'),_0x4bc7('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x4bc7('0x10')))return'custom';return this[_0x4bc7('0x11')](_0x4bc7('0x10'));},'set':function(_0x4d7287){if(_0x4d7287==='custom')_0x4d7287=null;return this[_0x4bc7('0x9')](_0x4bc7('0x10'),_0x4d7287);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 909123c..50601f4 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 _0x6c4e=['priority','getApplications','getMessages','MailMessage','$gte','format','true','split','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','destroy','ValidationError','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','update','get','UserProfileResource','stack','name','send','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','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','count','includeAll','include','rows','show','params','Pause','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','hasOwnProperty','CmContact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x6c4e,0x1ac));var _0xe6c4=function(_0x14596c,_0x3529b9){_0x14596c=_0x14596c-0x0;var _0x4ef184=_0x6c4e[_0x14596c];return _0x4ef184;};'use strict';var moment=require(_0xe6c4('0x0'));var BPromise=require(_0xe6c4('0x1'));var util=require('util');var path=require(_0xe6c4('0x2'));var _=require(_0xe6c4('0x3'));var juice=require(_0xe6c4('0x4'));var Redis=require(_0xe6c4('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xe6c4('0x6'))(_0xe6c4('0x7'));var config=require(_0xe6c4('0x8'));var db=require(_0xe6c4('0x9'))['db'];config[_0xe6c4('0xa')]=_[_0xe6c4('0xb')](config[_0xe6c4('0xa')],{'host':_0xe6c4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6c4('0xa')]));require('./mailAccount.socket')[_0xe6c4('0xd')](socket);var jayson=require(_0xe6c4('0xe'));var client=jayson[_0xe6c4('0xf')][_0xe6c4('0x10')]({'port':0x232b});function respondWithRpcPromise(_0xf636e3,_0xae21d8,_0x2941a5,_0x2c54ee){return new BPromise(function(_0x5b2fd0,_0x5c5ab6){var _0x2b829c=_0x2c54ee||client;return _0x2b829c['request'](_0xf636e3,_0x2941a5)[_0xe6c4('0x11')](function(_0x20e76d){logger[_0xe6c4('0x12')](_0xe6c4('0x13'),_0xae21d8,'request\x20sent');logger['debug'](_0xe6c4('0x14'),_0xae21d8,_0xe6c4('0x15'),JSON[_0xe6c4('0x16')](_0x20e76d));if(_0x20e76d[_0xe6c4('0x17')]){if(_0x20e76d[_0xe6c4('0x17')]['code']===0x1f4){logger[_0xe6c4('0x17')]('MailAccount,\x20%s,\x20%s',_0xae21d8,_0x20e76d[_0xe6c4('0x17')][_0xe6c4('0x18')]);return _0x5c5ab6(_0x20e76d[_0xe6c4('0x17')][_0xe6c4('0x18')]);}logger[_0xe6c4('0x17')](_0xe6c4('0x13'),_0xae21d8,_0x20e76d[_0xe6c4('0x17')][_0xe6c4('0x18')]);return _0x5b2fd0(_0x20e76d[_0xe6c4('0x17')][_0xe6c4('0x18')]);}else{logger[_0xe6c4('0x12')]('MailAccount,\x20%s,\x20%s',_0xae21d8,'request\x20sent');_0x5b2fd0(_0x20e76d['result']['message']);}})[_0xe6c4('0x19')](function(_0x2dc52d){logger[_0xe6c4('0x17')](_0xe6c4('0x13'),_0xae21d8,_0x2dc52d);_0x5c5ab6(_0x2dc52d);});});}function respondWithStatusCode(_0x5a87bf,_0x45befc){_0x45befc=_0x45befc||0xcc;return function(_0x24dbdf){if(_0x24dbdf){return _0x5a87bf[_0xe6c4('0x1a')](_0x45befc);}return _0x5a87bf[_0xe6c4('0x1b')](_0x45befc)[_0xe6c4('0x1c')]();};}function respondWithResult(_0x2b2d18,_0x5de3d1){_0x5de3d1=_0x5de3d1||0xc8;return function(_0x4f9d15){if(_0x4f9d15){return _0x2b2d18[_0xe6c4('0x1b')](_0x5de3d1)[_0xe6c4('0x1d')](_0x4f9d15);}};}function respondWithFilteredResult(_0x801de4,_0x5ee9b0){return function(_0x354827){if(_0x354827){var _0x2f3b3=typeof _0x5ee9b0['offset']===_0xe6c4('0x1e')&&typeof _0x5ee9b0[_0xe6c4('0x1f')]==='undefined';var _0x57354a=_0x354827['count'];var _0x358caf=_0x2f3b3?0x0:_0x5ee9b0[_0xe6c4('0x20')];var _0xe5a163=_0x2f3b3?_0x354827['count']:_0x5ee9b0[_0xe6c4('0x20')]+_0x5ee9b0['limit'];var _0x5e23fe;if(_0xe5a163>=_0x57354a){_0xe5a163=_0x57354a;_0x5e23fe=0xc8;}else{_0x5e23fe=0xce;}_0x801de4[_0xe6c4('0x1b')](_0x5e23fe);return _0x801de4[_0xe6c4('0x21')](_0xe6c4('0x22'),_0x358caf+'-'+_0xe5a163+'/'+_0x57354a)[_0xe6c4('0x1d')](_0x354827);}return null;};}function saveUpdates(_0x1b64fb){return function(_0x2b2b8a){if(_0x2b2b8a){return _0x2b2b8a[_0xe6c4('0x23')](_0x1b64fb)[_0xe6c4('0x11')](function(_0x51a199){return _0x51a199;});}return null;};}function removeEntity(_0x2ccf32){return function(_0x4a7b69){if(_0x4a7b69){return _0x4a7b69['destroy']()[_0xe6c4('0x11')](function(){var _0x46e7c8=_0x4a7b69[_0xe6c4('0x24')]({'plain':!![]});var _0x5551e1='MailAccounts';return db[_0xe6c4('0x25')]['destroy']({'where':{'type':_0x5551e1,'resourceId':_0x46e7c8['id']}})[_0xe6c4('0x11')](function(){return _0x4a7b69;});})[_0xe6c4('0x11')](function(){_0x2ccf32[_0xe6c4('0x1b')](0xcc)[_0xe6c4('0x1c')]();});}};}function handleEntityNotFound(_0x17cbee){return function(_0x196bbf){if(!_0x196bbf){_0x17cbee[_0xe6c4('0x1a')](0x194);}return _0x196bbf;};}function handleError(_0x26019d,_0x4c2407){_0x4c2407=_0x4c2407||0x1f4;return function(_0x974d1f){logger[_0xe6c4('0x17')](_0x974d1f[_0xe6c4('0x26')]);if(_0x974d1f[_0xe6c4('0x27')]){delete _0x974d1f['name'];}_0x26019d['status'](_0x4c2407)[_0xe6c4('0x28')](_0x974d1f);};}function getImapHost(_0x36a937){switch(_0x36a937){case _0xe6c4('0x29'):return _0xe6c4('0x2a');case _0xe6c4('0x2b'):return _0xe6c4('0x2c');case _0xe6c4('0x2d'):return'imap-mail.outlook.com';case _0xe6c4('0x2e'):return _0xe6c4('0x2f');}throw new Error(_0xe6c4('0x30'),_0x36a937);}function getSmtpHost(_0x16b531){switch(_0x16b531){case _0xe6c4('0x29'):return _0xe6c4('0x31');case'yahoo':return _0xe6c4('0x32');case'hotmail':return _0xe6c4('0x33');case _0xe6c4('0x2e'):return _0xe6c4('0x34');}throw new Error(_0xe6c4('0x30'),_0x16b531);}function getAuthenticationOptions(_0x55ae1a,_0x223dd3){var _0x1711c7={};var _0x26fd14={};if(_0x55ae1a){_0x1711c7['user']=_0x26fd14[_0xe6c4('0x35')]=_0x223dd3[_0xe6c4('0x36')];_0x1711c7[_0xe6c4('0x37')]=_0x26fd14[_0xe6c4('0x38')]=_0x223dd3['password'];if(_0x223dd3[_0xe6c4('0x39')]){_0x1711c7[_0xe6c4('0x39')]=_0x26fd14[_0xe6c4('0x39')]=!![];_0x1711c7[_0xe6c4('0x3a')]=_0x26fd14[_0xe6c4('0x3a')]=_0x223dd3[_0xe6c4('0x3a')];_0x1711c7[_0xe6c4('0x37')]=_0x26fd14['pass']=null;}else{_0x1711c7['CloudProviderId']=_0x26fd14[_0xe6c4('0x3a')]=null;}_0x1711c7[_0xe6c4('0x3b')]=getImapHost(_0x55ae1a);_0x1711c7[_0xe6c4('0x3c')]=0x3e1;_0x26fd14[_0xe6c4('0x3b')]=getSmtpHost(_0x55ae1a);_0x26fd14[_0xe6c4('0x3c')]=0x24b;_0x26fd14[_0xe6c4('0x3d')]=![];_0x1711c7['service']=_0x26fd14[_0xe6c4('0x3e')]=null;}else{if(_0x223dd3['authentication']){_0x1711c7[_0xe6c4('0x35')]=_0x26fd14[_0xe6c4('0x35')]=_0x223dd3[_0xe6c4('0x36')];_0x1711c7[_0xe6c4('0x37')]=_0x26fd14[_0xe6c4('0x38')]=_0x223dd3[_0xe6c4('0x37')];}else{_0x1711c7[_0xe6c4('0x3f')]=_0x26fd14[_0xe6c4('0x3f')]=![];_0x1711c7[_0xe6c4('0x35')]=_0x26fd14[_0xe6c4('0x35')]=null;_0x1711c7['password']=_0x26fd14[_0xe6c4('0x38')]=null;}_0x1711c7[_0xe6c4('0x3b')]=_0x223dd3[_0xe6c4('0x40')]['host'];_0x1711c7[_0xe6c4('0x3c')]=_0x223dd3[_0xe6c4('0x40')][_0xe6c4('0x3c')];_0x26fd14[_0xe6c4('0x3b')]=_0x223dd3[_0xe6c4('0x41')][_0xe6c4('0x3b')];_0x26fd14['port']=_0x223dd3[_0xe6c4('0x41')][_0xe6c4('0x3c')];}return{'Imap':_0x1711c7,'Smtp':_0x26fd14};}exports[_0xe6c4('0x42')]=function(_0x2d454d,_0x3e2555){var _0x2a2fb3={'include':[{'model':db[_0xe6c4('0x43')],'as':_0xe6c4('0x40')},{'model':db[_0xe6c4('0x44')],'as':_0xe6c4('0x41')},{'model':db['Pause'],'as':_0xe6c4('0x45')}]},_0x40998c={},_0x21ee39={'count':0x0,'rows':[]};var _0x5088d3=_['map'](db[_0xe6c4('0x46')][_0xe6c4('0x47')],function(_0x17a6cf){return{'name':_0x17a6cf[_0xe6c4('0x48')],'type':_0x17a6cf[_0xe6c4('0x49')][_0xe6c4('0x4a')]};});_0x40998c['model']=_[_0xe6c4('0x4b')](_0x5088d3,_0xe6c4('0x27'));_0x40998c[_0xe6c4('0x4c')]=_[_0xe6c4('0x4d')](_0x2d454d[_0xe6c4('0x4c')]);_0x40998c[_0xe6c4('0x4e')]=_[_0xe6c4('0x4f')](_0x40998c[_0xe6c4('0x50')],_0x40998c['query']);_0x2a2fb3[_0xe6c4('0x51')]=_[_0xe6c4('0x4f')](_0x40998c['model'],qs[_0xe6c4('0x52')](_0x2d454d[_0xe6c4('0x4c')][_0xe6c4('0x52')]));_0x2a2fb3[_0xe6c4('0x51')]=_0x2a2fb3[_0xe6c4('0x51')][_0xe6c4('0x53')]?_0x2a2fb3[_0xe6c4('0x51')]:_0x40998c[_0xe6c4('0x50')];if(!_0x2d454d['query']['hasOwnProperty'](_0xe6c4('0x54'))){_0x2a2fb3[_0xe6c4('0x1f')]=qs[_0xe6c4('0x1f')](_0x2d454d[_0xe6c4('0x4c')]['limit']);_0x2a2fb3[_0xe6c4('0x20')]=qs[_0xe6c4('0x20')](_0x2d454d[_0xe6c4('0x4c')][_0xe6c4('0x20')]);}_0x2a2fb3[_0xe6c4('0x55')]=qs[_0xe6c4('0x56')](_0x2d454d[_0xe6c4('0x4c')]['sort']);_0x2a2fb3['where']=qs[_0xe6c4('0x4e')](_[_0xe6c4('0x57')](_0x2d454d['query'],_0x40998c[_0xe6c4('0x4e')]),_0x5088d3);if(_0x2d454d[_0xe6c4('0x4c')][_0xe6c4('0x58')]){_0x2a2fb3['where']=_[_0xe6c4('0x59')](_0x2a2fb3['where'],{'$or':_['map'](_0x5088d3,function(_0x50d753){if(_0x50d753['type']!==_0xe6c4('0x5a')){var _0xbc988b={};_0xbc988b[_0x50d753[_0xe6c4('0x27')]]={'$like':'%'+_0x2d454d[_0xe6c4('0x4c')][_0xe6c4('0x58')]+'%'};return _0xbc988b;}})});}_0x2a2fb3=_[_0xe6c4('0x59')]({},_0x2a2fb3,_0x2d454d[_0xe6c4('0x5b')]);var _0x415e83={'where':_0x2a2fb3[_0xe6c4('0x5c')]};return db[_0xe6c4('0x46')][_0xe6c4('0x5d')](_0x415e83)['then'](function(_0x4bcbec){_0x21ee39[_0xe6c4('0x5d')]=_0x4bcbec;if(_0x2d454d[_0xe6c4('0x4c')][_0xe6c4('0x5e')]){_0x2a2fb3[_0xe6c4('0x5f')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x2a2fb3);})[_0xe6c4('0x11')](function(_0x38befd){_0x21ee39[_0xe6c4('0x60')]=_0x38befd;return _0x21ee39;})[_0xe6c4('0x11')](respondWithFilteredResult(_0x3e2555,_0x2a2fb3))[_0xe6c4('0x19')](handleError(_0x3e2555,null));};exports[_0xe6c4('0x61')]=function(_0x2d209f,_0x5ddd31){var _0x5e4e4b={'raw':![],'where':{'id':_0x2d209f[_0xe6c4('0x62')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xe6c4('0x40')},{'model':db['MailServerOut'],'as':_0xe6c4('0x41')},{'model':db[_0xe6c4('0x63')],'as':_0xe6c4('0x45')}]},_0x5bdc24={};_0x5bdc24[_0xe6c4('0x50')]=_['keys'](db[_0xe6c4('0x46')][_0xe6c4('0x47')]);_0x5bdc24[_0xe6c4('0x4c')]=_[_0xe6c4('0x4d')](_0x2d209f[_0xe6c4('0x4c')]);_0x5bdc24[_0xe6c4('0x4e')]=_[_0xe6c4('0x4f')](_0x5bdc24[_0xe6c4('0x50')],_0x5bdc24['query']);_0x5e4e4b[_0xe6c4('0x51')]=_[_0xe6c4('0x4f')](_0x5bdc24[_0xe6c4('0x50')],qs['fields'](_0x2d209f[_0xe6c4('0x4c')][_0xe6c4('0x52')]));_0x5e4e4b['attributes']=_0x5e4e4b[_0xe6c4('0x51')][_0xe6c4('0x53')]?_0x5e4e4b[_0xe6c4('0x51')]:_0x5bdc24[_0xe6c4('0x50')];if(_0x2d209f[_0xe6c4('0x4c')][_0xe6c4('0x5e')]){_0x5e4e4b[_0xe6c4('0x5f')]=[{'all':!![]}];}_0x5e4e4b=_[_0xe6c4('0x59')]({},_0x5e4e4b,_0x2d209f['options']);return db[_0xe6c4('0x46')][_0xe6c4('0x64')](_0x5e4e4b)[_0xe6c4('0x11')](handleEntityNotFound(_0x5ddd31,null))['then'](respondWithResult(_0x5ddd31,null))['catch'](handleError(_0x5ddd31,null));};exports[_0xe6c4('0x23')]=function(_0x48e165,_0x59d778){if(_0x48e165['body']['id']){delete _0x48e165[_0xe6c4('0x65')]['id'];}var _0x1abd1f=_0x48e165['body'][_0xe6c4('0x66')]===_0xe6c4('0x67')?null:_0x48e165[_0xe6c4('0x65')]['provider'];var _0xc2b82a=_0x48e165[_0xe6c4('0x65')]['Imap']||{};var _0x15656c=_0x48e165[_0xe6c4('0x65')][_0xe6c4('0x41')]||{};if(_0x1abd1f){_0xc2b82a[_0xe6c4('0x3b')]=getImapHost(_0x1abd1f);_0xc2b82a[_0xe6c4('0x3c')]=0x3e1;_0x15656c['host']=getSmtpHost(_0x1abd1f);_0x15656c[_0xe6c4('0x3c')]=0x24b;_0x15656c[_0xe6c4('0x3d')]=![];}if(_0x15656c['modernAuthentication']){_0x15656c[_0xe6c4('0x3d')]=![];}else{_0x15656c[_0xe6c4('0x3a')]=null;}if(!_0xc2b82a[_0xe6c4('0x39')])_0xc2b82a['CloudProviderId']=null;_0x48e165['body'][_0xe6c4('0x40')]=_0xc2b82a;_0x48e165[_0xe6c4('0x65')][_0xe6c4('0x41')]=_0x15656c;return db['MailAccount'][_0xe6c4('0x64')]({'where':{'id':_0x48e165[_0xe6c4('0x62')]['id']},'include':[{'model':db[_0xe6c4('0x43')],'as':_0xe6c4('0x40')},{'model':db[_0xe6c4('0x44')],'as':'Smtp'},{'model':db[_0xe6c4('0x63')],'as':_0xe6c4('0x45')}]})['then'](handleEntityNotFound(_0x59d778,null))[_0xe6c4('0x11')](function(_0x6bf47){if(!_0x6bf47)throw new Error(_0xe6c4('0x68'));if(_0x6bf47[_0xe6c4('0x3e')])delete _0x48e165[_0xe6c4('0x65')]['Imap'];return _0x6bf47;})[_0xe6c4('0x11')](saveUpdates(_0x48e165[_0xe6c4('0x65')],null))[_0xe6c4('0x11')](function(_0x2f2b87){if(!_0x48e165[_0xe6c4('0x65')]['Imap'])return _0x2f2b87;return db[_0xe6c4('0x43')][_0xe6c4('0x23')](_0x48e165[_0xe6c4('0x65')]['Imap'],{'where':{'MailAccountId':_0x2f2b87['id']}})[_0xe6c4('0x11')](function(){return _0x2f2b87;});})[_0xe6c4('0x11')](function(_0x1a886d){if(!_0x48e165[_0xe6c4('0x65')][_0xe6c4('0x41')])return _0x1a886d;return db[_0xe6c4('0x44')][_0xe6c4('0x23')](_0x48e165['body']['Smtp'],{'where':{'MailAccountId':_0x1a886d['id']}})[_0xe6c4('0x11')](function(){return _0x1a886d;});})[_0xe6c4('0x11')](respondWithResult(_0x59d778,null))[_0xe6c4('0x19')](handleError(_0x59d778,null));};exports[_0xe6c4('0x69')]=function(_0x2cfbc3,_0x4578fa){return db[_0xe6c4('0x46')]['describe']()['then'](respondWithResult(_0x4578fa,null))['catch'](handleError(_0x4578fa,null));};exports['addDisposition']=function(_0x41d8dd,_0x1c4063){if(_0x41d8dd[_0xe6c4('0x65')]['id']){delete _0x41d8dd[_0xe6c4('0x65')]['id'];}return db[_0xe6c4('0x46')][_0xe6c4('0x64')]({'where':{'id':_0x41d8dd['params']['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x1c4063,null))[_0xe6c4('0x11')](function(_0x135732){if(_0x135732){_0x41d8dd[_0xe6c4('0x65')][_0xe6c4('0x6a')]=_0x135732['id'];return db[_0xe6c4('0x6b')][_0xe6c4('0x6c')](_0x41d8dd[_0xe6c4('0x65')]);}})[_0xe6c4('0x11')](respondWithResult(_0x1c4063,null))[_0xe6c4('0x19')](handleError(_0x1c4063,null));};exports['getDispositions']=function(_0x374f89,_0x2babaa){var _0xeef46f={'raw':![],'where':{}};var _0x1cf9b3={};var _0x5b5d9a={'count':0x0,'rows':[]};return db[_0xe6c4('0x46')][_0xe6c4('0x6d')]({'where':{'id':_0x374f89[_0xe6c4('0x62')]['id']}})['then'](handleEntityNotFound(_0x2babaa,null))['then'](function(_0x48af62){if(_0x48af62){_0x1cf9b3[_0xe6c4('0x50')]=_[_0xe6c4('0x4d')](db[_0xe6c4('0x6b')][_0xe6c4('0x47')]);_0x1cf9b3[_0xe6c4('0x4c')]=_[_0xe6c4('0x4d')](_0x374f89[_0xe6c4('0x4c')]);_0x1cf9b3['filters']=_[_0xe6c4('0x4f')](_0x1cf9b3[_0xe6c4('0x50')],_0x1cf9b3[_0xe6c4('0x4c')]);_0xeef46f[_0xe6c4('0x51')]=_[_0xe6c4('0x4f')](_0x1cf9b3[_0xe6c4('0x50')],qs[_0xe6c4('0x52')](_0x374f89[_0xe6c4('0x4c')][_0xe6c4('0x52')]));_0xeef46f[_0xe6c4('0x51')]=_0xeef46f['attributes'][_0xe6c4('0x53')]?_0xeef46f[_0xe6c4('0x51')]:_0x1cf9b3[_0xe6c4('0x50')];if(!_0x374f89['query']['hasOwnProperty']('nolimit')){_0xeef46f['limit']=qs[_0xe6c4('0x1f')](_0x374f89[_0xe6c4('0x4c')][_0xe6c4('0x1f')]);_0xeef46f[_0xe6c4('0x20')]=qs['offset'](_0x374f89[_0xe6c4('0x4c')][_0xe6c4('0x20')]);}_0xeef46f[_0xe6c4('0x55')]=qs[_0xe6c4('0x56')](_0x374f89[_0xe6c4('0x4c')][_0xe6c4('0x56')]);_0xeef46f[_0xe6c4('0x5c')]=qs[_0xe6c4('0x4e')](_[_0xe6c4('0x57')](_0x374f89[_0xe6c4('0x4c')],_0x1cf9b3[_0xe6c4('0x4e')]));_0xeef46f[_0xe6c4('0x5c')][_0xe6c4('0x6a')]=_0x48af62['id'];if(_0x374f89[_0xe6c4('0x4c')][_0xe6c4('0x58')]){_0xeef46f['where']=_[_0xe6c4('0x59')](_0xeef46f[_0xe6c4('0x5c')],{'$or':_['map'](_0xeef46f[_0xe6c4('0x51')],function(_0x457662){var _0x5881e9={};_0x5881e9[_0x457662]={'$like':'%'+_0x374f89[_0xe6c4('0x4c')][_0xe6c4('0x58')]+'%'};return _0x5881e9;})});}_0xeef46f=_[_0xe6c4('0x59')]({},_0xeef46f,_0x374f89[_0xe6c4('0x5b')]);return db[_0xe6c4('0x6b')][_0xe6c4('0x5d')]({'where':_0xeef46f[_0xe6c4('0x5c')]})[_0xe6c4('0x11')](function(_0x204b19){_0x5b5d9a['count']=_0x204b19;if(_0x374f89[_0xe6c4('0x4c')][_0xe6c4('0x5e')]){_0xeef46f[_0xe6c4('0x5f')]=[{'all':!![]}];}return db[_0xe6c4('0x6b')][_0xe6c4('0x6e')](_0xeef46f);})[_0xe6c4('0x11')](function(_0x438974){_0x5b5d9a['rows']=_0x438974;return _0x5b5d9a;});}})[_0xe6c4('0x11')](respondWithFilteredResult(_0x2babaa,_0xeef46f))[_0xe6c4('0x19')](handleError(_0x2babaa,null));};exports[_0xe6c4('0x6f')]=function(_0x3925dc,_0x3968b1){return db[_0xe6c4('0x46')]['find']({'where':{'id':_0x3925dc[_0xe6c4('0x62')]['id']}})['then'](handleEntityNotFound(_0x3968b1,null))[_0xe6c4('0x11')](function(_0x2b684a){if(_0x2b684a){return _0x2b684a[_0xe6c4('0x6f')](_0x3925dc[_0xe6c4('0x4c')][_0xe6c4('0x70')]);}})[_0xe6c4('0x11')](respondWithStatusCode(_0x3968b1,null))[_0xe6c4('0x19')](handleError(_0x3968b1,null));};exports[_0xe6c4('0x71')]=function(_0xda9d52,_0x15281d){if(_0xda9d52[_0xe6c4('0x65')]['id']){delete _0xda9d52[_0xe6c4('0x65')]['id'];}return db['MailAccount'][_0xe6c4('0x64')]({'where':{'id':_0xda9d52[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x15281d,null))['then'](function(_0x2dba1a){if(_0x2dba1a){_0xda9d52[_0xe6c4('0x65')][_0xe6c4('0x6a')]=_0x2dba1a['id'];return db[_0xe6c4('0x72')][_0xe6c4('0x6c')](_0xda9d52[_0xe6c4('0x65')]);}})['then'](respondWithResult(_0x15281d,null))[_0xe6c4('0x19')](handleError(_0x15281d,null));};exports[_0xe6c4('0x73')]=function(_0x58b9b9,_0x3f3c59){var _0xadf791={'raw':![],'where':{}};var _0x5220ed={};var _0x421164={'count':0x0,'rows':[]};return db[_0xe6c4('0x46')][_0xe6c4('0x6d')]({'where':{'id':_0x58b9b9[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x3f3c59,null))[_0xe6c4('0x11')](function(_0x427588){if(_0x427588){_0x5220ed[_0xe6c4('0x50')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x5220ed['query']=_['keys'](_0x58b9b9[_0xe6c4('0x4c')]);_0x5220ed[_0xe6c4('0x4e')]=_[_0xe6c4('0x4f')](_0x5220ed['model'],_0x5220ed['query']);_0xadf791[_0xe6c4('0x51')]=_[_0xe6c4('0x4f')](_0x5220ed['model'],qs['fields'](_0x58b9b9[_0xe6c4('0x4c')][_0xe6c4('0x52')]));_0xadf791[_0xe6c4('0x51')]=_0xadf791[_0xe6c4('0x51')]['length']?_0xadf791[_0xe6c4('0x51')]:_0x5220ed['model'];if(!_0x58b9b9['query']['hasOwnProperty'](_0xe6c4('0x54'))){_0xadf791[_0xe6c4('0x1f')]=qs['limit'](_0x58b9b9[_0xe6c4('0x4c')][_0xe6c4('0x1f')]);_0xadf791[_0xe6c4('0x20')]=qs['offset'](_0x58b9b9[_0xe6c4('0x4c')][_0xe6c4('0x20')]);}_0xadf791[_0xe6c4('0x55')]=qs['sort'](_0x58b9b9[_0xe6c4('0x4c')]['sort']);_0xadf791['where']=qs[_0xe6c4('0x4e')](_[_0xe6c4('0x57')](_0x58b9b9[_0xe6c4('0x4c')],_0x5220ed[_0xe6c4('0x4e')]));_0xadf791[_0xe6c4('0x5c')]['MailAccountId']=_0x427588['id'];if(_0x58b9b9['query'][_0xe6c4('0x58')]){_0xadf791[_0xe6c4('0x5c')]=_[_0xe6c4('0x59')](_0xadf791[_0xe6c4('0x5c')],{'$or':_[_0xe6c4('0x4b')](_0xadf791['attributes'],function(_0x4f01ec){var _0x4559a1={};_0x4559a1[_0x4f01ec]={'$like':'%'+_0x58b9b9['query'][_0xe6c4('0x58')]+'%'};return _0x4559a1;})});}_0xadf791=_[_0xe6c4('0x59')]({},_0xadf791,_0x58b9b9[_0xe6c4('0x5b')]);return db[_0xe6c4('0x72')][_0xe6c4('0x5d')]({'where':_0xadf791[_0xe6c4('0x5c')]})[_0xe6c4('0x11')](function(_0x4aa5cf){_0x421164[_0xe6c4('0x5d')]=_0x4aa5cf;if(_0x58b9b9['query'][_0xe6c4('0x5e')]){_0xadf791[_0xe6c4('0x5f')]=[{'all':!![]}];}return db[_0xe6c4('0x72')][_0xe6c4('0x6e')](_0xadf791);})[_0xe6c4('0x11')](function(_0x497c4c){_0x421164[_0xe6c4('0x60')]=_0x497c4c;return _0x421164;});}})['then'](respondWithFilteredResult(_0x3f3c59,_0xadf791))[_0xe6c4('0x19')](handleError(_0x3f3c59,null));};exports[_0xe6c4('0x74')]=function(_0x15196d,_0x1575b4){return db[_0xe6c4('0x46')][_0xe6c4('0x64')]({'where':{'id':_0x15196d['params']['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x1575b4,null))[_0xe6c4('0x11')](function(_0x7cdaa9){if(_0x7cdaa9){return _0x7cdaa9[_0xe6c4('0x74')](_0x15196d[_0xe6c4('0x4c')]['ids']);}})[_0xe6c4('0x11')](respondWithStatusCode(_0x1575b4,null))['catch'](handleError(_0x1575b4,null));};exports['create']=function(_0x44fcbe,_0x19f1fb){var _0xb8a55e={'name':_0x44fcbe[_0xe6c4('0x65')]['name'],'key':_0x44fcbe[_0xe6c4('0x65')][_0xe6c4('0x4a')],'provider':_0x44fcbe[_0xe6c4('0x65')][_0xe6c4('0x66')]==='custom'?null:_0x44fcbe['body'][_0xe6c4('0x66')],'email':_0x44fcbe[_0xe6c4('0x65')][_0xe6c4('0x75')],'ListId':_0x44fcbe[_0xe6c4('0x65')][_0xe6c4('0x76')],'active':!_[_0xe6c4('0x77')](_0x44fcbe[_0xe6c4('0x65')]['active'])?_0x44fcbe[_0xe6c4('0x65')]['active']:!![],'description':_0x44fcbe['body']['description']||null};var _0x4e3e7b=getAuthenticationOptions(_0xb8a55e[_0xe6c4('0x66')],_0x44fcbe[_0xe6c4('0x65')]);_0xb8a55e[_0xe6c4('0x40')]=_0x4e3e7b[_0xe6c4('0x40')];_0xb8a55e[_0xe6c4('0x41')]=_0x4e3e7b[_0xe6c4('0x41')];return db[_0xe6c4('0x46')][_0xe6c4('0x6c')](_0xb8a55e,{'include':[{'model':db[_0xe6c4('0x44')],'as':_0xe6c4('0x41')},{'model':db[_0xe6c4('0x43')],'as':_0xe6c4('0x40')}]})[_0xe6c4('0x11')](function(_0xb67fe5){var _0x2614e5=_0x44fcbe['user'][_0xe6c4('0x24')]({'plain':!![]});if(!_0x2614e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2614e5[_0xe6c4('0x78')]===_0xe6c4('0x35')){var _0x135614=_0xb67fe5[_0xe6c4('0x24')]({'plain':!![]});return db[_0xe6c4('0x79')]['find']({'where':{'name':_0xe6c4('0x7a'),'userProfileId':_0x2614e5[_0xe6c4('0x7b')]},'raw':!![]})[_0xe6c4('0x11')](function(_0x47cdc3){if(_0x47cdc3&&_0x47cdc3['autoAssociation']===0x0){return db[_0xe6c4('0x25')]['create']({'name':_0x135614[_0xe6c4('0x27')],'resourceId':_0x135614['id'],'type':_0x47cdc3['name'],'sectionId':_0x47cdc3['id']},{})[_0xe6c4('0x11')](function(){return _0xb67fe5;});}else{return _0xb67fe5;}})['catch'](function(_0x23c87d){logger['error'](_0xe6c4('0x7c'),_0x23c87d);throw _0x23c87d;});}return _0xb67fe5;})['then'](respondWithResult(_0x19f1fb,0xc9))[_0xe6c4('0x19')](handleError(_0x19f1fb,null));};exports[_0xe6c4('0x7d')]=function(_0x493c19,_0x260572){return db[_0xe6c4('0x46')][_0xe6c4('0x6d')]({'where':{'id':_0x493c19[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x260572,null))[_0xe6c4('0x11')](function(_0x40c15e){if(_0x40c15e){return _0x40c15e[_0xe6c4('0x7d')]();}return null;})[_0xe6c4('0x11')](respondWithResult(_0x260572,null))['catch'](handleError(_0x260572,null));};exports['addImap']=function(_0x365b37,_0x5e97c3){if(_0x365b37['body']['id']){delete _0x365b37[_0xe6c4('0x65')]['id'];}return db[_0xe6c4('0x46')][_0xe6c4('0x64')]({'where':{'id':_0x365b37[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x5e97c3,null))[_0xe6c4('0x11')](function(_0x275a7c){if(_0x275a7c){_0x365b37[_0xe6c4('0x65')]['MailAccountId']=_0x275a7c['id'];return db[_0xe6c4('0x43')][_0xe6c4('0x6c')](_0x365b37['body']);}})['then'](respondWithResult(_0x5e97c3,null))[_0xe6c4('0x19')](handleError(_0x5e97c3,null));};exports['removeImap']=function(_0x258289,_0x18a37a){return db[_0xe6c4('0x46')][_0xe6c4('0x6d')]({'where':{'id':_0x258289[_0xe6c4('0x62')]['id']}})['then'](handleEntityNotFound(_0x18a37a,null))['then'](function(_0x9d8075){if(_0x9d8075){return _0x9d8075[_0xe6c4('0x7e')](null);}return null;})['then'](respondWithStatusCode(_0x18a37a,null))[_0xe6c4('0x19')](handleError(_0x18a37a,null));};exports[_0xe6c4('0x7f')]=function(_0x1b81f9,_0x1301db){return db[_0xe6c4('0x46')][_0xe6c4('0x6d')]({'where':{'id':_0x1b81f9[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x1301db,null))[_0xe6c4('0x11')](function(_0x3fcbae){if(_0x3fcbae){return _0x3fcbae['getSmtp']();}return null;})['then'](respondWithResult(_0x1301db,null))[_0xe6c4('0x19')](handleError(_0x1301db,null));};exports[_0xe6c4('0x80')]=function(_0x13cc10,_0x2b97d2){if(_0x13cc10[_0xe6c4('0x65')]['id']){delete _0x13cc10[_0xe6c4('0x65')]['id'];}return db[_0xe6c4('0x46')][_0xe6c4('0x64')]({'where':{'id':_0x13cc10[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x2b97d2,null))[_0xe6c4('0x11')](function(_0x1f1691){if(_0x1f1691){_0x13cc10[_0xe6c4('0x65')][_0xe6c4('0x6a')]=_0x1f1691['id'];return db['MailServerOut']['create'](_0x13cc10[_0xe6c4('0x65')]);}})['then'](respondWithResult(_0x2b97d2,null))[_0xe6c4('0x19')](handleError(_0x2b97d2,null));};exports[_0xe6c4('0x81')]=function(_0x1acad2,_0x33eaa8){return db['MailAccount']['findOne']({'where':{'id':_0x1acad2[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x33eaa8,null))[_0xe6c4('0x11')](function(_0x508f10){if(_0x508f10){return _0x508f10['setSmtp'](null);}return null;})[_0xe6c4('0x11')](respondWithStatusCode(_0x33eaa8,null))[_0xe6c4('0x19')](handleError(_0x33eaa8,null));};exports[_0xe6c4('0x82')]=function(_0x486a1c,_0x4df8b2){return db[_0xe6c4('0x83')][_0xe6c4('0x64')]({'where':{'id':_0x486a1c['params']['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x4df8b2,null))[_0xe6c4('0x11')](function(_0x294afd){if(_0x294afd){return _0x294afd[_0xe6c4('0x82')](_0x486a1c['body'][_0xe6c4('0x70')],_[_0xe6c4('0x84')](_0x486a1c['body'],[_0xe6c4('0x70'),'id'])||{});}})['then'](respondWithResult(_0x4df8b2,null))[_0xe6c4('0x19')](handleError(_0x4df8b2,null));};exports[_0xe6c4('0x85')]=function(_0x22828e,_0x54b5e0){var _0x38f0bd={'raw':![],'where':{}};var _0x195cd8={};var _0x3305e1={'count':0x0,'rows':[]};return db[_0xe6c4('0x46')][_0xe6c4('0x6d')]({'where':{'id':_0x22828e[_0xe6c4('0x62')]['id']}})['then'](handleEntityNotFound(_0x54b5e0,null))[_0xe6c4('0x11')](function(_0x72b3b8){if(_0x72b3b8){_0x195cd8[_0xe6c4('0x50')]=_[_0xe6c4('0x4d')](db[_0xe6c4('0x83')]['rawAttributes']);_0x195cd8[_0xe6c4('0x4c')]=_[_0xe6c4('0x4d')](_0x22828e[_0xe6c4('0x4c')]);_0x195cd8[_0xe6c4('0x4e')]=_[_0xe6c4('0x4f')](_0x195cd8['model'],_0x195cd8['query']);_0x38f0bd[_0xe6c4('0x51')]=_[_0xe6c4('0x4f')](_0x195cd8[_0xe6c4('0x50')],qs['fields'](_0x22828e[_0xe6c4('0x4c')]['fields']));_0x38f0bd[_0xe6c4('0x51')]=_0x38f0bd[_0xe6c4('0x51')]['length']?_0x38f0bd[_0xe6c4('0x51')]:_0x195cd8[_0xe6c4('0x50')];if(!_0x22828e[_0xe6c4('0x4c')][_0xe6c4('0x86')](_0xe6c4('0x54'))){_0x38f0bd[_0xe6c4('0x1f')]=qs[_0xe6c4('0x1f')](_0x22828e['query']['limit']);_0x38f0bd['offset']=qs[_0xe6c4('0x20')](_0x22828e[_0xe6c4('0x4c')][_0xe6c4('0x20')]);}_0x38f0bd[_0xe6c4('0x55')]=qs['sort'](_0x22828e['query'][_0xe6c4('0x56')]);_0x38f0bd[_0xe6c4('0x5c')]=qs[_0xe6c4('0x4e')](_[_0xe6c4('0x57')](_0x22828e['query'],_0x195cd8[_0xe6c4('0x4e')]));_0x38f0bd[_0xe6c4('0x5c')][_0xe6c4('0x6a')]=_0x72b3b8['id'];if(_0x22828e['query'][_0xe6c4('0x58')]){_0x38f0bd['where']=_[_0xe6c4('0x59')](_0x38f0bd[_0xe6c4('0x5c')],{'$or':_[_0xe6c4('0x4b')](_0x38f0bd['attributes'],function(_0x25eb76){var _0x35394e={};_0x35394e[_0x25eb76]={'$like':'%'+_0x22828e[_0xe6c4('0x4c')][_0xe6c4('0x58')]+'%'};return _0x35394e;})});}_0x38f0bd=_[_0xe6c4('0x59')]({},_0x38f0bd,_0x22828e[_0xe6c4('0x5b')]);return db['MailInteraction'][_0xe6c4('0x5d')]({'where':_0x38f0bd[_0xe6c4('0x5c')]})['then'](function(_0x15581b){_0x3305e1[_0xe6c4('0x5d')]=_0x15581b;if(_0x22828e[_0xe6c4('0x4c')][_0xe6c4('0x5e')]){_0x38f0bd[_0xe6c4('0x5f')]=[{'model':db[_0xe6c4('0x87')],'as':'Contact','required':![]},{'model':db[_0xe6c4('0x88')],'as':_0xe6c4('0x89'),'attributes':[_0xe6c4('0x27'),_0xe6c4('0x8a'),_0xe6c4('0x8b')],'required':![]},{'model':db[_0xe6c4('0x8c')],'as':'Tags','attributes':['id',_0xe6c4('0x27'),'color'],'where':_0x22828e[_0xe6c4('0x4c')][_0xe6c4('0x8d')]?{'id':_0x22828e['query']['tag']}:undefined,'required':_0x22828e[_0xe6c4('0x4c')]['tag']?!![]:![]}];}return db[_0xe6c4('0x83')][_0xe6c4('0x6e')](_0x38f0bd);})[_0xe6c4('0x11')](function(_0x5ed04f){_0x3305e1[_0xe6c4('0x60')]=_0x5ed04f;return _0x3305e1;});}})[_0xe6c4('0x11')](respondWithFilteredResult(_0x54b5e0,_0x38f0bd))[_0xe6c4('0x19')](handleError(_0x54b5e0,null));};exports[_0xe6c4('0x8e')]=function addApplications(_0x3f546f,_0xb8ecee){var _0x1ccb41=_0x3f546f[_0xe6c4('0x62')]['id'];var _0x4cbaba=_0x3f546f[_0xe6c4('0x65')];var _0x5105b8=0xc8;var _0xfa35a1=null;return db[_0xe6c4('0x8f')][_0xe6c4('0x90')]({'isolationLevel':db['sequelize'][_0xe6c4('0x91')][_0xe6c4('0x92')][_0xe6c4('0x93')]},function(_0x2441cf){return db['MailAccount'][_0xe6c4('0x6d')]({'where':{'id':_0x1ccb41},'transaction':_0x2441cf})[_0xe6c4('0x11')](function(_0x41a537){if(_0x41a537){return db[_0xe6c4('0x94')]['destroy']({'where':{'MailAccountId':_0x1ccb41},'transaction':_0x2441cf})[_0xe6c4('0x11')](function(){var _0x46fcf4=_['map'](_0x4cbaba,function(_0x259cab){_0x259cab[_0xe6c4('0x6a')]=_0x1ccb41;return _0x259cab;});return db[_0xe6c4('0x94')][_0xe6c4('0x95')](_0x46fcf4,{'transaction':_0x2441cf});});}else{_0x5105b8=0x194;_0xfa35a1=[];}});})['then'](function(){if(_0x5105b8!==0x194){return db[_0xe6c4('0x94')][_0xe6c4('0x96')]({'where':{'MailAccountId':_0x1ccb41},'order':_0xe6c4('0x97')})[_0xe6c4('0x11')](function(_0x3cedbe){_0xfa35a1=_0x3cedbe;});}})[_0xe6c4('0x19')](function(_0x8ce6d9){_0x5105b8=0x1f4;logger[_0xe6c4('0x17')](_0x8ce6d9[_0xe6c4('0x26')]);if(_0x8ce6d9[_0xe6c4('0x27')]){delete _0x8ce6d9[_0xe6c4('0x27')];}_0xfa35a1=_0x8ce6d9;})['finally'](function(){if(_0xfa35a1===null){_0xb8ecee[_0xe6c4('0x1a')](_0x5105b8);}else{if(_0x5105b8===0x1f4){_0xb8ecee[_0xe6c4('0x1b')](_0x5105b8)[_0xe6c4('0x28')](_0xfa35a1);}else{_0xb8ecee[_0xe6c4('0x1b')](_0x5105b8)[_0xe6c4('0x1d')](_0xfa35a1);}}});};exports[_0xe6c4('0x98')]=function(_0x5cbb94,_0x10763a){var _0x451122={};var _0x21d815={};var _0x575aa4;var _0x2ba6e6;return db[_0xe6c4('0x46')][_0xe6c4('0x6d')]({'where':{'id':_0x5cbb94[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x10763a,null))[_0xe6c4('0x11')](function(_0x4dd39a){if(_0x4dd39a){_0x575aa4=_0x4dd39a;_0x21d815[_0xe6c4('0x50')]=_[_0xe6c4('0x4d')](db[_0xe6c4('0x94')]['rawAttributes']);_0x21d815[_0xe6c4('0x4c')]=_[_0xe6c4('0x4d')](_0x5cbb94[_0xe6c4('0x4c')]);_0x21d815[_0xe6c4('0x4e')]=_['intersection'](_0x21d815[_0xe6c4('0x50')],_0x21d815[_0xe6c4('0x4c')]);_0x451122[_0xe6c4('0x51')]=_[_0xe6c4('0x4f')](_0x21d815['model'],qs[_0xe6c4('0x52')](_0x5cbb94[_0xe6c4('0x4c')][_0xe6c4('0x52')]));_0x451122[_0xe6c4('0x51')]=_0x451122[_0xe6c4('0x51')][_0xe6c4('0x53')]?_0x451122[_0xe6c4('0x51')]:_0x21d815['model'];_0x451122[_0xe6c4('0x55')]=qs[_0xe6c4('0x56')](_0x5cbb94['query'][_0xe6c4('0x56')]);_0x451122[_0xe6c4('0x5c')]=qs[_0xe6c4('0x4e')](_[_0xe6c4('0x57')](_0x5cbb94[_0xe6c4('0x4c')],_0x21d815[_0xe6c4('0x4e')]));if(_0x5cbb94[_0xe6c4('0x4c')]['filter']){_0x451122[_0xe6c4('0x5c')]=_[_0xe6c4('0x59')](_0x451122['where'],{'$or':_['map'](_0x451122['attributes'],function(_0x3ad57b){var _0x4d1ecf={};_0x4d1ecf[_0x3ad57b]={'$like':'%'+_0x5cbb94['query']['filter']+'%'};return _0x4d1ecf;})});}_0x451122=_[_0xe6c4('0x59')]({},_0x451122,_0x5cbb94[_0xe6c4('0x5b')]);return _0x575aa4[_0xe6c4('0x98')](_0x451122);}})['then'](function(_0x5aa4d3){if(_0x5aa4d3){_0x2ba6e6=_0x5aa4d3[_0xe6c4('0x53')];if(!_0x5cbb94[_0xe6c4('0x4c')][_0xe6c4('0x86')](_0xe6c4('0x54'))){_0x451122['limit']=qs[_0xe6c4('0x1f')](_0x5cbb94[_0xe6c4('0x4c')]['limit']);_0x451122[_0xe6c4('0x20')]=qs[_0xe6c4('0x20')](_0x5cbb94[_0xe6c4('0x4c')][_0xe6c4('0x20')]);}return _0x575aa4[_0xe6c4('0x98')](_0x451122);}})[_0xe6c4('0x11')](function(_0x2f9e45){if(_0x2f9e45){return _0x2f9e45?{'count':_0x2ba6e6,'rows':_0x2f9e45}:null;}})[_0xe6c4('0x11')](respondWithResult(_0x10763a,null))[_0xe6c4('0x19')](handleError(_0x10763a,null));};exports[_0xe6c4('0x99')]=function(_0x3e7dc7,_0x52b5b3){var _0x3fe971={'raw':!![],'where':{}};var _0x5f14c6={};var _0x52bc9e={'count':0x0,'rows':[]};return db[_0xe6c4('0x46')]['findOne']({'where':{'id':_0x3e7dc7['params']['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x52b5b3,null))[_0xe6c4('0x11')](function(_0x5a22d4){if(_0x5a22d4){_0x5f14c6['model']=_[_0xe6c4('0x4d')](db[_0xe6c4('0x9a')][_0xe6c4('0x47')]);_0x5f14c6[_0xe6c4('0x4c')]=_[_0xe6c4('0x4d')](_0x3e7dc7['query']);_0x5f14c6[_0xe6c4('0x4e')]=_['intersection'](_0x5f14c6[_0xe6c4('0x50')],_0x5f14c6[_0xe6c4('0x4c')]);_0x3fe971[_0xe6c4('0x51')]=_['intersection'](_0x5f14c6['model'],qs[_0xe6c4('0x52')](_0x3e7dc7['query'][_0xe6c4('0x52')]));_0x3fe971['attributes']=_0x3fe971[_0xe6c4('0x51')][_0xe6c4('0x53')]?_0x3fe971['attributes']:_0x5f14c6[_0xe6c4('0x50')];if(!_0x3e7dc7[_0xe6c4('0x4c')][_0xe6c4('0x86')](_0xe6c4('0x54'))){_0x3fe971['limit']=qs[_0xe6c4('0x1f')](_0x3e7dc7['query'][_0xe6c4('0x1f')]);_0x3fe971[_0xe6c4('0x20')]=qs['offset'](_0x3e7dc7['query'][_0xe6c4('0x20')]);}_0x3fe971[_0xe6c4('0x55')]=qs[_0xe6c4('0x56')](_0x3e7dc7[_0xe6c4('0x4c')][_0xe6c4('0x56')]);_0x3fe971[_0xe6c4('0x5c')]=qs['filters'](_[_0xe6c4('0x57')](_0x3e7dc7['query'],_0x5f14c6[_0xe6c4('0x4e')]));_0x3fe971[_0xe6c4('0x5c')][_0xe6c4('0x6a')]=_0x5a22d4['id'];if(_0x3e7dc7['query'][_0xe6c4('0x58')]){_0x3fe971[_0xe6c4('0x5c')]=_[_0xe6c4('0x59')](_0x3fe971['where'],{'$or':_['map'](_0x3fe971[_0xe6c4('0x51')],function(_0x28c1ae){var _0x159b0a={};_0x159b0a[_0x28c1ae]={'$like':'%'+_0x3e7dc7['query'][_0xe6c4('0x58')]+'%'};return _0x159b0a;})});}if(_0x3e7dc7[_0xe6c4('0x4c')][_0xe6c4('0x9b')]){var _0x94af36=_0x3e7dc7[_0xe6c4('0x4c')][_0xe6c4('0x9b')]['split'](',');var _0xb3fdf2={};_0xb3fdf2[_0x94af36[0x0]]={'$gte':moment(_0x94af36[0x1])[_0xe6c4('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3fe971[_0xe6c4('0x5c')]=_[_0xe6c4('0x59')](_0x3fe971['where'],_0xb3fdf2);}_0x3fe971=_['merge']({},_0x3fe971,_0x3e7dc7['options']);return db['MailMessage']['count']({'where':_0x3fe971[_0xe6c4('0x5c')]})[_0xe6c4('0x11')](function(_0xef5d04){_0x52bc9e['count']=_0xef5d04;if(_0x3e7dc7['query'][_0xe6c4('0x5e')]){_0x3fe971[_0xe6c4('0x5f')]=[{'all':!![]}];}return db[_0xe6c4('0x9a')][_0xe6c4('0x6e')](_0x3fe971);})[_0xe6c4('0x11')](function(_0x21d9aa){if(_0x3e7dc7[_0xe6c4('0x4c')]['inlineCss']===_0xe6c4('0x9d')){for(var _0x51b117=0x0;_0x51b117<_0x21d9aa[_0xe6c4('0x53')];_0x51b117++){_0x21d9aa[_0x51b117][_0xe6c4('0x65')]=juice(_0x21d9aa[_0x51b117][_0xe6c4('0x65')]);}}_0x52bc9e[_0xe6c4('0x60')]=_0x21d9aa;return _0x52bc9e;});}})[_0xe6c4('0x11')](respondWithFilteredResult(_0x52b5b3,_0x3fe971))['catch'](handleError(_0x52b5b3,null));};exports[_0xe6c4('0x28')]=function(_0x1b84a3,_0xb9dd6d){var _0x28fae3,_0xddd893={},_0x46bd39;if(_0x1b84a3[_0xe6c4('0x65')]['to']){_0x46bd39=_0x1b84a3[_0xe6c4('0x65')]['to'][_0xe6c4('0x9e')](',')[0x0];}return db[_0xe6c4('0x46')][_0xe6c4('0x64')]({'where':{'id':_0x1b84a3[_0xe6c4('0x62')]['id']},'include':[{'model':db[_0xe6c4('0x9f')],'as':_0xe6c4('0xa0'),'include':[{'model':db[_0xe6c4('0x87')],'as':_0xe6c4('0xa1'),'where':{'email':_0x46bd39},'limit':0x1,'order':[[_0xe6c4('0xa2'),_0xe6c4('0xa3')]]}]},{'model':db['MailServerOut'],'as':_0xe6c4('0x41'),'raw':!![],'include':[{'model':db[_0xe6c4('0xa4')],'as':_0xe6c4('0xa4'),'raw':!![]}]}]})[_0xe6c4('0x11')](handleEntityNotFound(_0xb9dd6d,null))[_0xe6c4('0x11')](function(_0x438820){if(!_0x438820)return;_0x28fae3=_0x438820;if(!_0x438820['Smtp'])throw new Error(_0xe6c4('0xa5'));if(_['isNil'](_0x1b84a3['body'][_0xe6c4('0xa6')])){_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xa6')]=util[_0xe6c4('0x9c')](_0xe6c4('0xa7'),_0x438820[_0xe6c4('0x27')],_0x438820[_0xe6c4('0x75')]||_0x438820['Smtp'][_0xe6c4('0x35')]);}if(_0x1b84a3[_0xe6c4('0x65')]['attachments']&&_0x1b84a3[_0xe6c4('0x65')]['attachments'][_0xe6c4('0x53')]){for(var _0x4bca83=0x0;_0x4bca83<_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xa8')]['length'];_0x4bca83+=0x1){_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xa8')][_0x4bca83]={'filename':_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xa8')][_0x4bca83][_0xe6c4('0x27')],'path':path['join'](config[_0xe6c4('0xa9')],_0xe6c4('0xaa'),_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xa8')][_0x4bca83][_0xe6c4('0xab')])};}}var _0x18b24e=_0x438820[_0xe6c4('0xac')]();return respondWithRpcPromise(_0xe6c4('0xad'),_0xe6c4('0xae'),{'account':_0x18b24e,'message':_0x1b84a3['body']});})[_0xe6c4('0x11')](function(_0x4bdb2e){if(!_0x4bdb2e)return;_0xddd893=_0x4bdb2e;if(!_0x28fae3[_0xe6c4('0xa0')])throw new Error(_0xe6c4('0xaf'));if(_0x28fae3[_0xe6c4('0xa0')][_0xe6c4('0xa1')]['length'])return _0x28fae3[_0xe6c4('0xa0')][_0xe6c4('0xa1')][0x0];return db[_0xe6c4('0x87')][_0xe6c4('0x6c')](_[_0xe6c4('0xb')](_0x1b84a3[_0xe6c4('0x65')],{'firstName':_0x1b84a3['body']['to'],'email':_0x1b84a3[_0xe6c4('0x65')]['to'],'phone':_0x1b84a3[_0xe6c4('0x65')]['to'],'ListId':_0x28fae3[_0xe6c4('0x76')]}));})[_0xe6c4('0x11')](function(_0x6df56f){if(!_0x6df56f)return;var _0x4df1a2={'UserId':_0x1b84a3[_0xe6c4('0x35')]['id'],'ContactId':_0x6df56f['id'],'MailAccountId':_0x28fae3['id'],'inReplyTo':_0xddd893[_0xe6c4('0xb0')],'to':_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xa6')],'cc':_0x1b84a3['body']['cc'],'subject':_0x1b84a3['body'][_0xe6c4('0xb1')],'attach':_0x1b84a3['body'][_0xe6c4('0xb2')],'firstMsgDirection':_0xe6c4('0xb3'),'lastMsgAt':moment()[_0xe6c4('0x9c')](_0xe6c4('0xb4')),'lastMsgDirection':_0xe6c4('0xb3'),'Messages':[_[_0xe6c4('0x59')](_0x1b84a3['body'],{'messageId':_0xddd893[_0xe6c4('0xb0')],'sentAt':moment()[_0xe6c4('0x9c')](_0xe6c4('0xb4')),'read':!![],'MailAccountId':_0x28fae3['id'],'UserId':_0x1b84a3[_0xe6c4('0x35')]['id'],'ContactId':_0x6df56f['id']})]};if(_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xb5')]){_0x4df1a2=_['merge'](_0x4df1a2,_0x1b84a3[_0xe6c4('0x65')][_0xe6c4('0xb5')]);}return db['MailInteraction'][_0xe6c4('0x6c')](_0x4df1a2,{'include':[{'model':db[_0xe6c4('0x9a')],'as':_0xe6c4('0xb6')}]});})['then'](respondWithResult(_0xb9dd6d,null))[_0xe6c4('0x19')](handleError(_0xb9dd6d,null));};exports[_0xe6c4('0xb7')]=function(_0x43d764,_0x19f911){return db[_0xe6c4('0x46')][_0xe6c4('0x64')]({'where':{'id':_0x43d764[_0xe6c4('0x62')]['id']},'include':[{'model':db[_0xe6c4('0x44')],'as':_0xe6c4('0x41'),'raw':!![],'include':[{'model':db[_0xe6c4('0xa4')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x19f911,null))[_0xe6c4('0x11')](function(_0x167fe7){if(!_0x167fe7[_0xe6c4('0x41')])return;var _0x110d74=_0x167fe7[_0xe6c4('0xac')]();return respondWithRpcPromise(_0xe6c4('0xb8'),_0xe6c4('0xb7'),{'account':_0x110d74});})['then'](respondWithResult(_0x19f911,null))[_0xe6c4('0x19')](handleError(_0x19f911,null));};exports[_0xe6c4('0xb9')]=function(_0x7361db,_0x41a3f7){return db[_0xe6c4('0x46')][_0xe6c4('0x64')]({'where':{'id':_0x7361db[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x41a3f7,null))['then'](function(_0x1d07d5){if(_0x1d07d5&&_0x1d07d5[_0xe6c4('0x3e')]){throw new db['Sequelize'][(_0xe6c4('0xba'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1d07d5;})[_0xe6c4('0x11')](removeEntity(_0x41a3f7,null))[_0xe6c4('0x19')](handleError(_0x41a3f7,null));};exports['addAgents']=function(_0x168d32,_0x3c4f3d){return db['MailAccount'][_0xe6c4('0x64')]({'where':{'id':_0x168d32[_0xe6c4('0x62')]['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x3c4f3d,null))['then'](function(_0xa98e5c){if(_0xa98e5c){return _0xa98e5c['addAgents'](_0x168d32[_0xe6c4('0x65')][_0xe6c4('0x70')],_[_0xe6c4('0x84')](_0x168d32['body'],[_0xe6c4('0x70'),'id'])||{})[_0xe6c4('0xbb')](function(_0x36be16){for(var _0x19b639=0x0;_0x19b639<_0x168d32[_0xe6c4('0x65')][_0xe6c4('0x70')][_0xe6c4('0x53')];_0x19b639+=0x1){socket[_0xe6c4('0xbc')]('userMailAccount:save',{'UserId':Number(_0x168d32[_0xe6c4('0x65')]['ids'][_0x19b639]),'MailAccountId':Number(_0x168d32[_0xe6c4('0x62')]['id'])});}return _0x36be16;});}})['then'](respondWithResult(_0x3c4f3d,null))['catch'](handleError(_0x3c4f3d,null));};exports[_0xe6c4('0xbd')]=function(_0x260a78,_0x8b5b28){return db[_0xe6c4('0x46')]['find']({'where':{'id':_0x260a78[_0xe6c4('0x62')]['id']}})['then'](handleEntityNotFound(_0x8b5b28,null))[_0xe6c4('0x11')](function(_0x5011b8){if(_0x5011b8){return _0x5011b8[_0xe6c4('0xbd')](_0x260a78[_0xe6c4('0x4c')]['ids'])[_0xe6c4('0x11')](function(){if(_[_0xe6c4('0xbe')](_0x260a78[_0xe6c4('0x4c')]['ids'])){for(var _0x3f946a=0x0;_0x3f946a<_0x260a78[_0xe6c4('0x4c')]['ids'][_0xe6c4('0x53')];_0x3f946a+=0x1){socket['emit'](_0xe6c4('0xbf'),{'UserId':Number(_0x260a78[_0xe6c4('0x4c')][_0xe6c4('0x70')][_0x3f946a]),'MailAccountId':Number(_0x260a78[_0xe6c4('0x62')]['id'])});}}else{socket['emit'](_0xe6c4('0xbf'),{'UserId':Number(_0x260a78[_0xe6c4('0x4c')][_0xe6c4('0x70')]),'MailAccountId':Number(_0x260a78[_0xe6c4('0x62')]['id'])});}});}})[_0xe6c4('0x11')](respondWithStatusCode(_0x8b5b28,null))[_0xe6c4('0x19')](handleError(_0x8b5b28,null));};exports[_0xe6c4('0xc0')]=function(_0x134b64,_0x49696a){var _0x34938b={};var _0xb9326a={};var _0xa51d5f;var _0x49186b;return db[_0xe6c4('0x46')]['findOne']({'where':{'id':_0x134b64['params']['id']}})[_0xe6c4('0x11')](handleEntityNotFound(_0x49696a,null))[_0xe6c4('0x11')](function(_0x6fce1b){if(_0x6fce1b){_0xa51d5f=_0x6fce1b;_0xb9326a[_0xe6c4('0x50')]=_[_0xe6c4('0x4d')](db[_0xe6c4('0x88')][_0xe6c4('0x47')]);_0xb9326a[_0xe6c4('0x4c')]=_['keys'](_0x134b64['query']);_0xb9326a['filters']=_[_0xe6c4('0x4f')](_0xb9326a[_0xe6c4('0x50')],_0xb9326a[_0xe6c4('0x4c')]);_0x34938b[_0xe6c4('0x51')]=_['intersection'](_0xb9326a[_0xe6c4('0x50')],qs[_0xe6c4('0x52')](_0x134b64[_0xe6c4('0x4c')][_0xe6c4('0x52')]));_0x34938b[_0xe6c4('0x51')]=_0x34938b[_0xe6c4('0x51')][_0xe6c4('0x53')]?_0x34938b[_0xe6c4('0x51')]:_0xb9326a[_0xe6c4('0x50')];_0x34938b['order']=qs[_0xe6c4('0x56')](_0x134b64[_0xe6c4('0x4c')][_0xe6c4('0x56')]);_0x34938b['where']=qs[_0xe6c4('0x4e')](_['pick'](_0x134b64[_0xe6c4('0x4c')],_0xb9326a[_0xe6c4('0x4e')]));if(_0x134b64[_0xe6c4('0x4c')]['filter']){_0x34938b[_0xe6c4('0x5c')]=_['merge'](_0x34938b['where'],{'$or':_[_0xe6c4('0x4b')](_0x34938b[_0xe6c4('0x51')],function(_0x103685){var _0x4fa011={};_0x4fa011[_0x103685]={'$like':'%'+_0x134b64[_0xe6c4('0x4c')][_0xe6c4('0x58')]+'%'};return _0x4fa011;})});}_0x34938b=_['merge']({},_0x34938b,_0x134b64[_0xe6c4('0x5b')]);return _0xa51d5f[_0xe6c4('0xc0')](_0x34938b);}})[_0xe6c4('0x11')](function(_0x4daf1e){if(_0x4daf1e){_0x49186b=_0x4daf1e[_0xe6c4('0x53')];if(!_0x134b64[_0xe6c4('0x4c')][_0xe6c4('0x86')](_0xe6c4('0x54'))){_0x34938b[_0xe6c4('0x1f')]=qs[_0xe6c4('0x1f')](_0x134b64['query'][_0xe6c4('0x1f')]);_0x34938b[_0xe6c4('0x20')]=qs[_0xe6c4('0x20')](_0x134b64['query'][_0xe6c4('0x20')]);}return _0xa51d5f['getAgents'](_0x34938b);}})['then'](function(_0x45621c){if(_0x45621c){return _0x45621c?{'count':_0x49186b,'rows':_0x45621c}:null;}})['then'](respondWithResult(_0x49696a,null))[_0xe6c4('0x19')](handleError(_0x49696a,null));}; \ No newline at end of file +var _0x98e2=['ids','MailAccountId','CannedAnswer','findAll','removeAnswers','email','ListId','isNil','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','rows','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','messageId','out','Interaction','Messages','verifySmtp','CloudProvider','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','User','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','secure','service','authentication','host','Smtp','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','nolimit','order','where','pick','filter','VIRTUAL','merge','options','MailAccount','include','show','rawAttributes','includeAll','find','body','provider','custom','describe','addDisposition','params','Disposition','create','getDispositions','findOne','length','hasOwnProperty','sort','removeDispositions'];(function(_0x2e191d,_0x4691e4){var _0xbe910d=function(_0x4fc067){while(--_0x4fc067){_0x2e191d['push'](_0x2e191d['shift']());}};_0xbe910d(++_0x4691e4);}(_0x98e2,0x113));var _0x298e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x98e2[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x298e('0x0'));var BPromise=require('bluebird');var util=require(_0x298e('0x1'));var path=require(_0x298e('0x2'));var _=require(_0x298e('0x3'));var juice=require(_0x298e('0x4'));var Redis=require(_0x298e('0x5'));var qs=require(_0x298e('0x6'));var logger=require(_0x298e('0x7'))('api');var config=require(_0x298e('0x8'));var db=require(_0x298e('0x9'))['db'];config['redis']=_[_0x298e('0xa')](config['redis'],{'host':_0x298e('0xb'),'port':0x18eb});var socket=require(_0x298e('0xc'))(new Redis(config['redis']));require(_0x298e('0xd'))['register'](socket);var jayson=require(_0x298e('0xe'));var client=jayson[_0x298e('0xf')][_0x298e('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x50796d,_0x4e8817,_0x532a01,_0x33561f){return new BPromise(function(_0x4e07ef,_0x17cf41){var _0x4e60a3=_0x33561f||client;return _0x4e60a3[_0x298e('0x11')](_0x50796d,_0x532a01)[_0x298e('0x12')](function(_0x4406e0){logger[_0x298e('0x13')](_0x298e('0x14'),_0x4e8817,_0x298e('0x15'));logger[_0x298e('0x16')](_0x298e('0x17'),_0x4e8817,_0x298e('0x15'),JSON[_0x298e('0x18')](_0x4406e0));if(_0x4406e0['error']){if(_0x4406e0[_0x298e('0x19')][_0x298e('0x1a')]===0x1f4){logger[_0x298e('0x19')](_0x298e('0x14'),_0x4e8817,_0x4406e0[_0x298e('0x19')][_0x298e('0x1b')]);return _0x17cf41(_0x4406e0[_0x298e('0x19')][_0x298e('0x1b')]);}logger['error'](_0x298e('0x14'),_0x4e8817,_0x4406e0['error']['message']);return _0x4e07ef(_0x4406e0[_0x298e('0x19')]['message']);}else{logger['info'](_0x298e('0x14'),_0x4e8817,'request\x20sent');_0x4e07ef(_0x4406e0[_0x298e('0x1c')]['message']);}})[_0x298e('0x1d')](function(_0x3ca23c){logger[_0x298e('0x19')]('MailAccount,\x20%s,\x20%s',_0x4e8817,_0x3ca23c);_0x17cf41(_0x3ca23c);});});}function respondWithStatusCode(_0x597de6,_0x49e7f6){_0x49e7f6=_0x49e7f6||0xcc;return function(_0x2be276){if(_0x2be276){return _0x597de6[_0x298e('0x1e')](_0x49e7f6);}return _0x597de6['status'](_0x49e7f6)[_0x298e('0x1f')]();};}function respondWithResult(_0x298398,_0x12bcc1){_0x12bcc1=_0x12bcc1||0xc8;return function(_0xfcd86d){if(_0xfcd86d){return _0x298398[_0x298e('0x20')](_0x12bcc1)[_0x298e('0x21')](_0xfcd86d);}};}function respondWithFilteredResult(_0x22de7a,_0x41e55f){return function(_0x52014d){if(_0x52014d){var _0x75f388=typeof _0x41e55f[_0x298e('0x22')]===_0x298e('0x23')&&typeof _0x41e55f[_0x298e('0x24')]===_0x298e('0x23');var _0x7deea2=_0x52014d[_0x298e('0x25')];var _0x3ab4c2=_0x75f388?0x0:_0x41e55f[_0x298e('0x22')];var _0x3bf76c=_0x75f388?_0x52014d[_0x298e('0x25')]:_0x41e55f[_0x298e('0x22')]+_0x41e55f[_0x298e('0x24')];var _0x1b01db;if(_0x3bf76c>=_0x7deea2){_0x3bf76c=_0x7deea2;_0x1b01db=0xc8;}else{_0x1b01db=0xce;}_0x22de7a['status'](_0x1b01db);return _0x22de7a['set'](_0x298e('0x26'),_0x3ab4c2+'-'+_0x3bf76c+'/'+_0x7deea2)['json'](_0x52014d);}return null;};}function saveUpdates(_0x1a4a5b){return function(_0x3854fd){if(_0x3854fd){return _0x3854fd[_0x298e('0x27')](_0x1a4a5b)[_0x298e('0x12')](function(_0x4f0e13){return _0x4f0e13;});}return null;};}function removeEntity(_0x59e018){return function(_0x2e245e){if(_0x2e245e){return _0x2e245e[_0x298e('0x28')]()[_0x298e('0x12')](function(){var _0x76db86=_0x2e245e[_0x298e('0x29')]({'plain':!![]});var _0x118e1f=_0x298e('0x2a');return db[_0x298e('0x2b')][_0x298e('0x28')]({'where':{'type':_0x118e1f,'resourceId':_0x76db86['id']}})['then'](function(){return _0x2e245e;});})[_0x298e('0x12')](function(){_0x59e018[_0x298e('0x20')](0xcc)[_0x298e('0x1f')]();});}};}function handleEntityNotFound(_0xe19167){return function(_0xbabefe){if(!_0xbabefe){_0xe19167[_0x298e('0x1e')](0x194);}return _0xbabefe;};}function handleError(_0x16b480,_0x4968ab){_0x4968ab=_0x4968ab||0x1f4;return function(_0x4686da){logger[_0x298e('0x19')](_0x4686da[_0x298e('0x2c')]);if(_0x4686da[_0x298e('0x2d')]){delete _0x4686da[_0x298e('0x2d')];}_0x16b480[_0x298e('0x20')](_0x4968ab)[_0x298e('0x2e')](_0x4686da);};}function getImapHost(_0x24399c){switch(_0x24399c){case _0x298e('0x2f'):return _0x298e('0x30');case _0x298e('0x31'):return _0x298e('0x32');case _0x298e('0x33'):return _0x298e('0x34');case _0x298e('0x35'):return _0x298e('0x36');}throw new Error(_0x298e('0x37'),_0x24399c);}function getSmtpHost(_0x3fcc16){switch(_0x3fcc16){case _0x298e('0x2f'):return _0x298e('0x38');case'yahoo':return _0x298e('0x39');case _0x298e('0x33'):return _0x298e('0x3a');case _0x298e('0x35'):return _0x298e('0x3b');}throw new Error(_0x298e('0x37'),_0x3fcc16);}function getAuthenticationOptions(_0xb15521,_0x4f5f63){var _0x14cd87={};var _0x410669={};if(_0xb15521){_0x14cd87[_0x298e('0x3c')]=_0x410669[_0x298e('0x3c')]=_0x4f5f63[_0x298e('0x3d')];_0x14cd87[_0x298e('0x3e')]=_0x410669[_0x298e('0x3f')]=_0x4f5f63[_0x298e('0x3e')];if(_0x4f5f63['modernAuthentication']){_0x14cd87[_0x298e('0x40')]=_0x410669['modernAuthentication']=!![];_0x14cd87[_0x298e('0x41')]=_0x410669['CloudProviderId']=_0x4f5f63[_0x298e('0x41')];_0x14cd87[_0x298e('0x3e')]=_0x410669[_0x298e('0x3f')]=null;}else{_0x14cd87['CloudProviderId']=_0x410669[_0x298e('0x41')]=null;}_0x14cd87['host']=getImapHost(_0xb15521);_0x14cd87[_0x298e('0x42')]=0x3e1;_0x410669['host']=getSmtpHost(_0xb15521);_0x410669[_0x298e('0x42')]=0x24b;_0x410669[_0x298e('0x43')]=![];_0x14cd87[_0x298e('0x44')]=_0x410669[_0x298e('0x44')]=null;}else{if(_0x4f5f63[_0x298e('0x45')]){_0x14cd87['user']=_0x410669[_0x298e('0x3c')]=_0x4f5f63['username'];_0x14cd87[_0x298e('0x3e')]=_0x410669[_0x298e('0x3f')]=_0x4f5f63[_0x298e('0x3e')];}else{_0x14cd87['authentication']=_0x410669[_0x298e('0x45')]=![];_0x14cd87[_0x298e('0x3c')]=_0x410669[_0x298e('0x3c')]=null;_0x14cd87[_0x298e('0x3e')]=_0x410669[_0x298e('0x3f')]=null;}_0x14cd87[_0x298e('0x46')]=_0x4f5f63['Imap'][_0x298e('0x46')];_0x14cd87[_0x298e('0x42')]=_0x4f5f63['Imap'][_0x298e('0x42')];_0x410669[_0x298e('0x46')]=_0x4f5f63[_0x298e('0x47')][_0x298e('0x46')];_0x410669[_0x298e('0x42')]=_0x4f5f63[_0x298e('0x47')][_0x298e('0x42')];}return{'Imap':_0x14cd87,'Smtp':_0x410669};}exports[_0x298e('0x48')]=function(_0x3ef049,_0x2942d8){var _0x962347={'include':[{'model':db[_0x298e('0x49')],'as':_0x298e('0x4a')},{'model':db[_0x298e('0x4b')],'as':_0x298e('0x47')},{'model':db[_0x298e('0x4c')],'as':_0x298e('0x4d')}]},_0x3bbaad={},_0x32ac74={'count':0x0,'rows':[]};var _0x192a7b=_['map'](db['MailAccount']['rawAttributes'],function(_0x3d090a){return{'name':_0x3d090a[_0x298e('0x4e')],'type':_0x3d090a[_0x298e('0x4f')][_0x298e('0x50')]};});_0x3bbaad[_0x298e('0x51')]=_[_0x298e('0x52')](_0x192a7b,_0x298e('0x2d'));_0x3bbaad[_0x298e('0x53')]=_[_0x298e('0x54')](_0x3ef049['query']);_0x3bbaad[_0x298e('0x55')]=_['intersection'](_0x3bbaad[_0x298e('0x51')],_0x3bbaad[_0x298e('0x53')]);_0x962347[_0x298e('0x56')]=_[_0x298e('0x57')](_0x3bbaad[_0x298e('0x51')],qs[_0x298e('0x58')](_0x3ef049[_0x298e('0x53')][_0x298e('0x58')]));_0x962347[_0x298e('0x56')]=_0x962347[_0x298e('0x56')]['length']?_0x962347['attributes']:_0x3bbaad[_0x298e('0x51')];if(!_0x3ef049['query']['hasOwnProperty'](_0x298e('0x59'))){_0x962347[_0x298e('0x24')]=qs[_0x298e('0x24')](_0x3ef049[_0x298e('0x53')]['limit']);_0x962347[_0x298e('0x22')]=qs[_0x298e('0x22')](_0x3ef049[_0x298e('0x53')][_0x298e('0x22')]);}_0x962347[_0x298e('0x5a')]=qs['sort'](_0x3ef049[_0x298e('0x53')]['sort']);_0x962347[_0x298e('0x5b')]=qs[_0x298e('0x55')](_[_0x298e('0x5c')](_0x3ef049[_0x298e('0x53')],_0x3bbaad['filters']),_0x192a7b);if(_0x3ef049[_0x298e('0x53')][_0x298e('0x5d')]){_0x962347[_0x298e('0x5b')]=_['merge'](_0x962347[_0x298e('0x5b')],{'$or':_[_0x298e('0x52')](_0x192a7b,function(_0x952643){if(_0x952643[_0x298e('0x4f')]!==_0x298e('0x5e')){var _0x5db427={};_0x5db427[_0x952643['name']]={'$like':'%'+_0x3ef049[_0x298e('0x53')]['filter']+'%'};return _0x5db427;}})});}_0x962347=_[_0x298e('0x5f')]({},_0x962347,_0x3ef049[_0x298e('0x60')]);var _0x50d223={'where':_0x962347[_0x298e('0x5b')]};return db[_0x298e('0x61')][_0x298e('0x25')](_0x50d223)[_0x298e('0x12')](function(_0x5985bf){_0x32ac74[_0x298e('0x25')]=_0x5985bf;if(_0x3ef049[_0x298e('0x53')]['includeAll']){_0x962347[_0x298e('0x62')]=[{'all':!![]}];}return db[_0x298e('0x61')]['findAll'](_0x962347);})['then'](function(_0xa872c9){_0x32ac74['rows']=_0xa872c9;return _0x32ac74;})[_0x298e('0x12')](respondWithFilteredResult(_0x2942d8,_0x962347))['catch'](handleError(_0x2942d8,null));};exports[_0x298e('0x63')]=function(_0x114eac,_0x41e263){var _0x2a6484={'raw':![],'where':{'id':_0x114eac['params']['id']},'include':[{'model':db[_0x298e('0x49')],'as':'Imap'},{'model':db[_0x298e('0x4b')],'as':_0x298e('0x47')},{'model':db[_0x298e('0x4c')],'as':_0x298e('0x4d')}]},_0x1c9aa2={};_0x1c9aa2[_0x298e('0x51')]=_[_0x298e('0x54')](db[_0x298e('0x61')][_0x298e('0x64')]);_0x1c9aa2[_0x298e('0x53')]=_[_0x298e('0x54')](_0x114eac[_0x298e('0x53')]);_0x1c9aa2[_0x298e('0x55')]=_[_0x298e('0x57')](_0x1c9aa2[_0x298e('0x51')],_0x1c9aa2[_0x298e('0x53')]);_0x2a6484['attributes']=_['intersection'](_0x1c9aa2['model'],qs[_0x298e('0x58')](_0x114eac['query'][_0x298e('0x58')]));_0x2a6484[_0x298e('0x56')]=_0x2a6484[_0x298e('0x56')]['length']?_0x2a6484['attributes']:_0x1c9aa2['model'];if(_0x114eac[_0x298e('0x53')][_0x298e('0x65')]){_0x2a6484[_0x298e('0x62')]=[{'all':!![]}];}_0x2a6484=_[_0x298e('0x5f')]({},_0x2a6484,_0x114eac['options']);return db[_0x298e('0x61')][_0x298e('0x66')](_0x2a6484)['then'](handleEntityNotFound(_0x41e263,null))[_0x298e('0x12')](respondWithResult(_0x41e263,null))[_0x298e('0x1d')](handleError(_0x41e263,null));};exports[_0x298e('0x27')]=function(_0x321cc9,_0x390c12){if(_0x321cc9[_0x298e('0x67')]['id']){delete _0x321cc9[_0x298e('0x67')]['id'];}var _0x584572=_0x321cc9[_0x298e('0x67')][_0x298e('0x68')]===_0x298e('0x69')?null:_0x321cc9[_0x298e('0x67')][_0x298e('0x68')];var _0x279a10=_0x321cc9[_0x298e('0x67')]['Imap']||{};var _0x24ad70=_0x321cc9[_0x298e('0x67')]['Smtp']||{};if(_0x584572){_0x279a10[_0x298e('0x46')]=getImapHost(_0x584572);_0x279a10['port']=0x3e1;_0x24ad70['host']=getSmtpHost(_0x584572);_0x24ad70[_0x298e('0x42')]=0x24b;_0x24ad70[_0x298e('0x43')]=![];}if(_0x24ad70[_0x298e('0x40')]){_0x24ad70[_0x298e('0x43')]=![];}else{_0x24ad70[_0x298e('0x41')]=null;}if(!_0x279a10['modernAuthentication'])_0x279a10['CloudProviderId']=null;_0x321cc9[_0x298e('0x67')][_0x298e('0x4a')]=_0x279a10;_0x321cc9[_0x298e('0x67')][_0x298e('0x47')]=_0x24ad70;return db[_0x298e('0x61')][_0x298e('0x66')]({'where':{'id':_0x321cc9['params']['id']},'include':[{'model':db[_0x298e('0x49')],'as':_0x298e('0x4a')},{'model':db[_0x298e('0x4b')],'as':_0x298e('0x47')},{'model':db[_0x298e('0x4c')],'as':_0x298e('0x4d')}]})[_0x298e('0x12')](handleEntityNotFound(_0x390c12,null))[_0x298e('0x12')](function(_0x1c09ad){if(!_0x1c09ad)throw new Error('Mail\x20Account\x20not\x20found');if(_0x1c09ad[_0x298e('0x44')])delete _0x321cc9[_0x298e('0x67')][_0x298e('0x4a')];return _0x1c09ad;})[_0x298e('0x12')](saveUpdates(_0x321cc9[_0x298e('0x67')],null))[_0x298e('0x12')](function(_0x2ce5f0){if(!_0x321cc9[_0x298e('0x67')]['Imap'])return _0x2ce5f0;return db[_0x298e('0x49')][_0x298e('0x27')](_0x321cc9[_0x298e('0x67')][_0x298e('0x4a')],{'where':{'MailAccountId':_0x2ce5f0['id']}})['then'](function(){return _0x2ce5f0;});})[_0x298e('0x12')](function(_0xdb5853){if(!_0x321cc9[_0x298e('0x67')][_0x298e('0x47')])return _0xdb5853;return db['MailServerOut'][_0x298e('0x27')](_0x321cc9['body']['Smtp'],{'where':{'MailAccountId':_0xdb5853['id']}})[_0x298e('0x12')](function(){return _0xdb5853;});})[_0x298e('0x12')](respondWithResult(_0x390c12,null))[_0x298e('0x1d')](handleError(_0x390c12,null));};exports[_0x298e('0x6a')]=function(_0x4f006b,_0xada7b){return db[_0x298e('0x61')][_0x298e('0x6a')]()['then'](respondWithResult(_0xada7b,null))[_0x298e('0x1d')](handleError(_0xada7b,null));};exports[_0x298e('0x6b')]=function(_0x215309,_0xc986f6){if(_0x215309[_0x298e('0x67')]['id']){delete _0x215309[_0x298e('0x67')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x215309[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0xc986f6,null))[_0x298e('0x12')](function(_0x33597f){if(_0x33597f){_0x215309[_0x298e('0x67')]['MailAccountId']=_0x33597f['id'];return db[_0x298e('0x6d')][_0x298e('0x6e')](_0x215309['body']);}})[_0x298e('0x12')](respondWithResult(_0xc986f6,null))['catch'](handleError(_0xc986f6,null));};exports[_0x298e('0x6f')]=function(_0x520c19,_0x425abe){var _0x38ad3e={'raw':![],'where':{}};var _0x2fa21d={};var _0x5e0b7e={'count':0x0,'rows':[]};return db['MailAccount'][_0x298e('0x70')]({'where':{'id':_0x520c19[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x425abe,null))[_0x298e('0x12')](function(_0x352a64){if(_0x352a64){_0x2fa21d[_0x298e('0x51')]=_[_0x298e('0x54')](db[_0x298e('0x6d')][_0x298e('0x64')]);_0x2fa21d[_0x298e('0x53')]=_[_0x298e('0x54')](_0x520c19[_0x298e('0x53')]);_0x2fa21d[_0x298e('0x55')]=_[_0x298e('0x57')](_0x2fa21d['model'],_0x2fa21d['query']);_0x38ad3e[_0x298e('0x56')]=_[_0x298e('0x57')](_0x2fa21d[_0x298e('0x51')],qs[_0x298e('0x58')](_0x520c19[_0x298e('0x53')][_0x298e('0x58')]));_0x38ad3e[_0x298e('0x56')]=_0x38ad3e['attributes'][_0x298e('0x71')]?_0x38ad3e[_0x298e('0x56')]:_0x2fa21d[_0x298e('0x51')];if(!_0x520c19[_0x298e('0x53')][_0x298e('0x72')](_0x298e('0x59'))){_0x38ad3e[_0x298e('0x24')]=qs[_0x298e('0x24')](_0x520c19['query'][_0x298e('0x24')]);_0x38ad3e[_0x298e('0x22')]=qs[_0x298e('0x22')](_0x520c19['query'][_0x298e('0x22')]);}_0x38ad3e['order']=qs[_0x298e('0x73')](_0x520c19['query']['sort']);_0x38ad3e[_0x298e('0x5b')]=qs[_0x298e('0x55')](_[_0x298e('0x5c')](_0x520c19['query'],_0x2fa21d[_0x298e('0x55')]));_0x38ad3e[_0x298e('0x5b')]['MailAccountId']=_0x352a64['id'];if(_0x520c19[_0x298e('0x53')][_0x298e('0x5d')]){_0x38ad3e[_0x298e('0x5b')]=_[_0x298e('0x5f')](_0x38ad3e[_0x298e('0x5b')],{'$or':_[_0x298e('0x52')](_0x38ad3e[_0x298e('0x56')],function(_0x2aa086){var _0x3efbd3={};_0x3efbd3[_0x2aa086]={'$like':'%'+_0x520c19[_0x298e('0x53')][_0x298e('0x5d')]+'%'};return _0x3efbd3;})});}_0x38ad3e=_[_0x298e('0x5f')]({},_0x38ad3e,_0x520c19['options']);return db[_0x298e('0x6d')]['count']({'where':_0x38ad3e[_0x298e('0x5b')]})[_0x298e('0x12')](function(_0x214245){_0x5e0b7e[_0x298e('0x25')]=_0x214245;if(_0x520c19[_0x298e('0x53')]['includeAll']){_0x38ad3e[_0x298e('0x62')]=[{'all':!![]}];}return db[_0x298e('0x6d')]['findAll'](_0x38ad3e);})['then'](function(_0x20f477){_0x5e0b7e['rows']=_0x20f477;return _0x5e0b7e;});}})[_0x298e('0x12')](respondWithFilteredResult(_0x425abe,_0x38ad3e))[_0x298e('0x1d')](handleError(_0x425abe,null));};exports[_0x298e('0x74')]=function(_0x4176eb,_0x27f391){return db[_0x298e('0x61')][_0x298e('0x66')]({'where':{'id':_0x4176eb[_0x298e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x27f391,null))[_0x298e('0x12')](function(_0x1fd357){if(_0x1fd357){return _0x1fd357[_0x298e('0x74')](_0x4176eb[_0x298e('0x53')][_0x298e('0x75')]);}})['then'](respondWithStatusCode(_0x27f391,null))['catch'](handleError(_0x27f391,null));};exports['addAnswer']=function(_0x3594ba,_0x2b0a37){if(_0x3594ba['body']['id']){delete _0x3594ba[_0x298e('0x67')]['id'];}return db[_0x298e('0x61')][_0x298e('0x66')]({'where':{'id':_0x3594ba['params']['id']}})['then'](handleEntityNotFound(_0x2b0a37,null))[_0x298e('0x12')](function(_0x31a900){if(_0x31a900){_0x3594ba[_0x298e('0x67')][_0x298e('0x76')]=_0x31a900['id'];return db[_0x298e('0x77')][_0x298e('0x6e')](_0x3594ba[_0x298e('0x67')]);}})[_0x298e('0x12')](respondWithResult(_0x2b0a37,null))['catch'](handleError(_0x2b0a37,null));};exports['getAnswers']=function(_0x49c079,_0x53ae59){var _0x2df3fb={'raw':![],'where':{}};var _0x1912b2={};var _0x154cf4={'count':0x0,'rows':[]};return db['MailAccount'][_0x298e('0x70')]({'where':{'id':_0x49c079[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x53ae59,null))[_0x298e('0x12')](function(_0x28f89c){if(_0x28f89c){_0x1912b2[_0x298e('0x51')]=_[_0x298e('0x54')](db[_0x298e('0x77')][_0x298e('0x64')]);_0x1912b2[_0x298e('0x53')]=_[_0x298e('0x54')](_0x49c079['query']);_0x1912b2[_0x298e('0x55')]=_['intersection'](_0x1912b2['model'],_0x1912b2['query']);_0x2df3fb[_0x298e('0x56')]=_[_0x298e('0x57')](_0x1912b2[_0x298e('0x51')],qs[_0x298e('0x58')](_0x49c079['query'][_0x298e('0x58')]));_0x2df3fb[_0x298e('0x56')]=_0x2df3fb['attributes'][_0x298e('0x71')]?_0x2df3fb[_0x298e('0x56')]:_0x1912b2[_0x298e('0x51')];if(!_0x49c079['query'][_0x298e('0x72')]('nolimit')){_0x2df3fb[_0x298e('0x24')]=qs['limit'](_0x49c079[_0x298e('0x53')][_0x298e('0x24')]);_0x2df3fb[_0x298e('0x22')]=qs[_0x298e('0x22')](_0x49c079['query'][_0x298e('0x22')]);}_0x2df3fb[_0x298e('0x5a')]=qs[_0x298e('0x73')](_0x49c079[_0x298e('0x53')][_0x298e('0x73')]);_0x2df3fb[_0x298e('0x5b')]=qs[_0x298e('0x55')](_[_0x298e('0x5c')](_0x49c079[_0x298e('0x53')],_0x1912b2[_0x298e('0x55')]));_0x2df3fb[_0x298e('0x5b')][_0x298e('0x76')]=_0x28f89c['id'];if(_0x49c079['query']['filter']){_0x2df3fb[_0x298e('0x5b')]=_['merge'](_0x2df3fb[_0x298e('0x5b')],{'$or':_[_0x298e('0x52')](_0x2df3fb[_0x298e('0x56')],function(_0x4191c5){var _0x51c372={};_0x51c372[_0x4191c5]={'$like':'%'+_0x49c079['query'][_0x298e('0x5d')]+'%'};return _0x51c372;})});}_0x2df3fb=_[_0x298e('0x5f')]({},_0x2df3fb,_0x49c079[_0x298e('0x60')]);return db['CannedAnswer'][_0x298e('0x25')]({'where':_0x2df3fb[_0x298e('0x5b')]})[_0x298e('0x12')](function(_0x223fc1){_0x154cf4[_0x298e('0x25')]=_0x223fc1;if(_0x49c079[_0x298e('0x53')][_0x298e('0x65')]){_0x2df3fb[_0x298e('0x62')]=[{'all':!![]}];}return db[_0x298e('0x77')][_0x298e('0x78')](_0x2df3fb);})[_0x298e('0x12')](function(_0x151fb8){_0x154cf4['rows']=_0x151fb8;return _0x154cf4;});}})['then'](respondWithFilteredResult(_0x53ae59,_0x2df3fb))['catch'](handleError(_0x53ae59,null));};exports['removeAnswers']=function(_0x3541cb,_0x2aa9ed){return db[_0x298e('0x61')]['find']({'where':{'id':_0x3541cb[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x2aa9ed,null))[_0x298e('0x12')](function(_0x210f27){if(_0x210f27){return _0x210f27[_0x298e('0x79')](_0x3541cb['query']['ids']);}})[_0x298e('0x12')](respondWithStatusCode(_0x2aa9ed,null))['catch'](handleError(_0x2aa9ed,null));};exports[_0x298e('0x6e')]=function(_0x22fcf9,_0x5d5a6d){var _0x3152a1={'name':_0x22fcf9[_0x298e('0x67')][_0x298e('0x2d')],'key':_0x22fcf9[_0x298e('0x67')][_0x298e('0x50')],'provider':_0x22fcf9[_0x298e('0x67')][_0x298e('0x68')]===_0x298e('0x69')?null:_0x22fcf9[_0x298e('0x67')][_0x298e('0x68')],'email':_0x22fcf9[_0x298e('0x67')][_0x298e('0x7a')],'ListId':_0x22fcf9[_0x298e('0x67')][_0x298e('0x7b')],'active':!_[_0x298e('0x7c')](_0x22fcf9[_0x298e('0x67')]['active'])?_0x22fcf9[_0x298e('0x67')]['active']:!![],'description':_0x22fcf9[_0x298e('0x67')][_0x298e('0x7d')]||null};var _0x5f1102=getAuthenticationOptions(_0x3152a1[_0x298e('0x68')],_0x22fcf9[_0x298e('0x67')]);_0x3152a1[_0x298e('0x4a')]=_0x5f1102[_0x298e('0x4a')];_0x3152a1['Smtp']=_0x5f1102['Smtp'];return db[_0x298e('0x61')][_0x298e('0x6e')](_0x3152a1,{'include':[{'model':db[_0x298e('0x4b')],'as':_0x298e('0x47')},{'model':db['MailServerIn'],'as':'Imap'}]})['then'](function(_0x76b19e){var _0x1904b2=_0x22fcf9['user'][_0x298e('0x29')]({'plain':!![]});if(!_0x1904b2)throw new Error(_0x298e('0x7e'));if(_0x1904b2[_0x298e('0x7f')]===_0x298e('0x3c')){var _0x29809b=_0x76b19e['get']({'plain':!![]});return db[_0x298e('0x80')][_0x298e('0x66')]({'where':{'name':_0x298e('0x2a'),'userProfileId':_0x1904b2[_0x298e('0x81')]},'raw':!![]})['then'](function(_0x2838b3){if(_0x2838b3&&_0x2838b3[_0x298e('0x82')]===0x0){return db[_0x298e('0x2b')][_0x298e('0x6e')]({'name':_0x29809b[_0x298e('0x2d')],'resourceId':_0x29809b['id'],'type':_0x2838b3[_0x298e('0x2d')],'sectionId':_0x2838b3['id']},{})['then'](function(){return _0x76b19e;});}else{return _0x76b19e;}})[_0x298e('0x1d')](function(_0x553c43){logger[_0x298e('0x19')](_0x298e('0x83'),_0x553c43);throw _0x553c43;});}return _0x76b19e;})[_0x298e('0x12')](respondWithResult(_0x5d5a6d,0xc9))['catch'](handleError(_0x5d5a6d,null));};exports[_0x298e('0x84')]=function(_0x371a35,_0x3004ed){return db[_0x298e('0x61')][_0x298e('0x70')]({'where':{'id':_0x371a35[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x3004ed,null))[_0x298e('0x12')](function(_0x47b274){if(_0x47b274){return _0x47b274[_0x298e('0x84')]();}return null;})[_0x298e('0x12')](respondWithResult(_0x3004ed,null))[_0x298e('0x1d')](handleError(_0x3004ed,null));};exports[_0x298e('0x85')]=function(_0x46ec79,_0x2a07e9){if(_0x46ec79['body']['id']){delete _0x46ec79[_0x298e('0x67')]['id'];}return db[_0x298e('0x61')]['find']({'where':{'id':_0x46ec79[_0x298e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2a07e9,null))[_0x298e('0x12')](function(_0x55d429){if(_0x55d429){_0x46ec79[_0x298e('0x67')][_0x298e('0x76')]=_0x55d429['id'];return db['MailServerIn'][_0x298e('0x6e')](_0x46ec79['body']);}})[_0x298e('0x12')](respondWithResult(_0x2a07e9,null))['catch'](handleError(_0x2a07e9,null));};exports[_0x298e('0x86')]=function(_0x17abb6,_0x9f90b9){return db[_0x298e('0x61')]['findOne']({'where':{'id':_0x17abb6['params']['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x9f90b9,null))[_0x298e('0x12')](function(_0xbe1eb7){if(_0xbe1eb7){return _0xbe1eb7[_0x298e('0x87')](null);}return null;})[_0x298e('0x12')](respondWithStatusCode(_0x9f90b9,null))['catch'](handleError(_0x9f90b9,null));};exports[_0x298e('0x88')]=function(_0x24c3df,_0x30ac7f){return db[_0x298e('0x61')][_0x298e('0x70')]({'where':{'id':_0x24c3df[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x30ac7f,null))['then'](function(_0x4d146a){if(_0x4d146a){return _0x4d146a[_0x298e('0x88')]();}return null;})['then'](respondWithResult(_0x30ac7f,null))['catch'](handleError(_0x30ac7f,null));};exports[_0x298e('0x89')]=function(_0x133de5,_0x8f66f3){if(_0x133de5[_0x298e('0x67')]['id']){delete _0x133de5[_0x298e('0x67')]['id'];}return db[_0x298e('0x61')][_0x298e('0x66')]({'where':{'id':_0x133de5[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x8f66f3,null))[_0x298e('0x12')](function(_0x3a05d2){if(_0x3a05d2){_0x133de5['body'][_0x298e('0x76')]=_0x3a05d2['id'];return db[_0x298e('0x4b')][_0x298e('0x6e')](_0x133de5[_0x298e('0x67')]);}})[_0x298e('0x12')](respondWithResult(_0x8f66f3,null))[_0x298e('0x1d')](handleError(_0x8f66f3,null));};exports[_0x298e('0x8a')]=function(_0x84d555,_0x53b377){return db[_0x298e('0x61')]['findOne']({'where':{'id':_0x84d555[_0x298e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x53b377,null))['then'](function(_0x22bf17){if(_0x22bf17){return _0x22bf17['setSmtp'](null);}return null;})[_0x298e('0x12')](respondWithStatusCode(_0x53b377,null))[_0x298e('0x1d')](handleError(_0x53b377,null));};exports[_0x298e('0x8b')]=function(_0x6cf80a,_0x11dfe0){return db[_0x298e('0x8c')][_0x298e('0x66')]({'where':{'id':_0x6cf80a[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x11dfe0,null))['then'](function(_0x42dae1){if(_0x42dae1){return _0x42dae1[_0x298e('0x8b')](_0x6cf80a[_0x298e('0x67')][_0x298e('0x75')],_[_0x298e('0x8d')](_0x6cf80a['body'],[_0x298e('0x75'),'id'])||{});}})[_0x298e('0x12')](respondWithResult(_0x11dfe0,null))[_0x298e('0x1d')](handleError(_0x11dfe0,null));};exports['getInteractions']=function(_0x383594,_0xc2d732){var _0xcdbf1b={'raw':![],'where':{}};var _0x450884={};var _0x4529a0={'count':0x0,'rows':[]};return db['MailAccount'][_0x298e('0x70')]({'where':{'id':_0x383594[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0xc2d732,null))[_0x298e('0x12')](function(_0x431ba3){if(_0x431ba3){_0x450884[_0x298e('0x51')]=_['keys'](db[_0x298e('0x8c')][_0x298e('0x64')]);_0x450884[_0x298e('0x53')]=_[_0x298e('0x54')](_0x383594[_0x298e('0x53')]);_0x450884['filters']=_[_0x298e('0x57')](_0x450884['model'],_0x450884[_0x298e('0x53')]);_0xcdbf1b[_0x298e('0x56')]=_[_0x298e('0x57')](_0x450884[_0x298e('0x51')],qs[_0x298e('0x58')](_0x383594[_0x298e('0x53')][_0x298e('0x58')]));_0xcdbf1b['attributes']=_0xcdbf1b['attributes'][_0x298e('0x71')]?_0xcdbf1b[_0x298e('0x56')]:_0x450884[_0x298e('0x51')];if(!_0x383594[_0x298e('0x53')][_0x298e('0x72')](_0x298e('0x59'))){_0xcdbf1b['limit']=qs[_0x298e('0x24')](_0x383594[_0x298e('0x53')]['limit']);_0xcdbf1b[_0x298e('0x22')]=qs[_0x298e('0x22')](_0x383594[_0x298e('0x53')][_0x298e('0x22')]);}_0xcdbf1b[_0x298e('0x5a')]=qs['sort'](_0x383594[_0x298e('0x53')][_0x298e('0x73')]);_0xcdbf1b[_0x298e('0x5b')]=qs['filters'](_[_0x298e('0x5c')](_0x383594[_0x298e('0x53')],_0x450884['filters']));_0xcdbf1b['where'][_0x298e('0x76')]=_0x431ba3['id'];if(_0x383594[_0x298e('0x53')][_0x298e('0x5d')]){_0xcdbf1b[_0x298e('0x5b')]=_[_0x298e('0x5f')](_0xcdbf1b[_0x298e('0x5b')],{'$or':_[_0x298e('0x52')](_0xcdbf1b[_0x298e('0x56')],function(_0x1f685b){var _0x1c21a3={};_0x1c21a3[_0x1f685b]={'$like':'%'+_0x383594['query'][_0x298e('0x5d')]+'%'};return _0x1c21a3;})});}_0xcdbf1b=_[_0x298e('0x5f')]({},_0xcdbf1b,_0x383594[_0x298e('0x60')]);return db[_0x298e('0x8c')]['count']({'where':_0xcdbf1b['where']})[_0x298e('0x12')](function(_0x14b7da){_0x4529a0[_0x298e('0x25')]=_0x14b7da;if(_0x383594[_0x298e('0x53')][_0x298e('0x65')]){_0xcdbf1b[_0x298e('0x62')]=[{'model':db[_0x298e('0x8e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x298e('0x8f'),'attributes':['name',_0x298e('0x90'),_0x298e('0x91')],'required':![]},{'model':db[_0x298e('0x92')],'as':_0x298e('0x93'),'attributes':['id',_0x298e('0x2d'),_0x298e('0x94')],'where':_0x383594[_0x298e('0x53')]['tag']?{'id':_0x383594[_0x298e('0x53')][_0x298e('0x95')]}:undefined,'required':_0x383594[_0x298e('0x53')]['tag']?!![]:![]}];}return db[_0x298e('0x8c')]['findAll'](_0xcdbf1b);})[_0x298e('0x12')](function(_0x1e8e4e){_0x4529a0[_0x298e('0x96')]=_0x1e8e4e;return _0x4529a0;});}})[_0x298e('0x12')](respondWithFilteredResult(_0xc2d732,_0xcdbf1b))['catch'](handleError(_0xc2d732,null));};exports['addApplications']=function addApplications(_0x48096e,_0x2db680){var _0x1e8b04=_0x48096e[_0x298e('0x6c')]['id'];var _0x4ed721=_0x48096e[_0x298e('0x67')];var _0x4e0668=0xc8;var _0x4e380e=null;return db[_0x298e('0x97')][_0x298e('0x98')]({'isolationLevel':db[_0x298e('0x97')][_0x298e('0x99')]['ISOLATION_LEVELS'][_0x298e('0x9a')]},function(_0x5c2be3){return db[_0x298e('0x61')][_0x298e('0x70')]({'where':{'id':_0x1e8b04},'transaction':_0x5c2be3})['then'](function(_0x3a4e0f){if(_0x3a4e0f){return db[_0x298e('0x9b')][_0x298e('0x28')]({'where':{'MailAccountId':_0x1e8b04},'transaction':_0x5c2be3})[_0x298e('0x12')](function(){var _0x2acdd8=_[_0x298e('0x52')](_0x4ed721,function(_0x85529e){_0x85529e[_0x298e('0x76')]=_0x1e8b04;return _0x85529e;});return db['MailApplication']['bulkCreate'](_0x2acdd8,{'transaction':_0x5c2be3});});}else{_0x4e0668=0x194;_0x4e380e=[];}});})['then'](function(){if(_0x4e0668!==0x194){return db[_0x298e('0x9b')][_0x298e('0x9c')]({'where':{'MailAccountId':_0x1e8b04},'order':_0x298e('0x9d')})[_0x298e('0x12')](function(_0x3bb295){_0x4e380e=_0x3bb295;});}})[_0x298e('0x1d')](function(_0x1a3320){_0x4e0668=0x1f4;logger[_0x298e('0x19')](_0x1a3320[_0x298e('0x2c')]);if(_0x1a3320[_0x298e('0x2d')]){delete _0x1a3320['name'];}_0x4e380e=_0x1a3320;})[_0x298e('0x9e')](function(){if(_0x4e380e===null){_0x2db680[_0x298e('0x1e')](_0x4e0668);}else{if(_0x4e0668===0x1f4){_0x2db680[_0x298e('0x20')](_0x4e0668)[_0x298e('0x2e')](_0x4e380e);}else{_0x2db680[_0x298e('0x20')](_0x4e0668)[_0x298e('0x21')](_0x4e380e);}}});};exports[_0x298e('0x9f')]=function(_0x43dc97,_0x27b777){var _0x8730db={};var _0x22d02c={};var _0x353e57;var _0x12a234;return db[_0x298e('0x61')]['findOne']({'where':{'id':_0x43dc97['params']['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x27b777,null))[_0x298e('0x12')](function(_0x5d1892){if(_0x5d1892){_0x353e57=_0x5d1892;_0x22d02c[_0x298e('0x51')]=_[_0x298e('0x54')](db[_0x298e('0x9b')][_0x298e('0x64')]);_0x22d02c['query']=_[_0x298e('0x54')](_0x43dc97[_0x298e('0x53')]);_0x22d02c['filters']=_['intersection'](_0x22d02c[_0x298e('0x51')],_0x22d02c['query']);_0x8730db['attributes']=_[_0x298e('0x57')](_0x22d02c[_0x298e('0x51')],qs[_0x298e('0x58')](_0x43dc97[_0x298e('0x53')][_0x298e('0x58')]));_0x8730db[_0x298e('0x56')]=_0x8730db[_0x298e('0x56')][_0x298e('0x71')]?_0x8730db[_0x298e('0x56')]:_0x22d02c[_0x298e('0x51')];_0x8730db[_0x298e('0x5a')]=qs[_0x298e('0x73')](_0x43dc97['query'][_0x298e('0x73')]);_0x8730db['where']=qs[_0x298e('0x55')](_[_0x298e('0x5c')](_0x43dc97[_0x298e('0x53')],_0x22d02c[_0x298e('0x55')]));if(_0x43dc97[_0x298e('0x53')][_0x298e('0x5d')]){_0x8730db[_0x298e('0x5b')]=_[_0x298e('0x5f')](_0x8730db['where'],{'$or':_[_0x298e('0x52')](_0x8730db[_0x298e('0x56')],function(_0x4c744f){var _0x4efc65={};_0x4efc65[_0x4c744f]={'$like':'%'+_0x43dc97[_0x298e('0x53')][_0x298e('0x5d')]+'%'};return _0x4efc65;})});}_0x8730db=_[_0x298e('0x5f')]({},_0x8730db,_0x43dc97['options']);return _0x353e57['getApplications'](_0x8730db);}})[_0x298e('0x12')](function(_0xfb5482){if(_0xfb5482){_0x12a234=_0xfb5482['length'];if(!_0x43dc97['query'][_0x298e('0x72')]('nolimit')){_0x8730db[_0x298e('0x24')]=qs['limit'](_0x43dc97[_0x298e('0x53')][_0x298e('0x24')]);_0x8730db[_0x298e('0x22')]=qs[_0x298e('0x22')](_0x43dc97[_0x298e('0x53')][_0x298e('0x22')]);}return _0x353e57[_0x298e('0x9f')](_0x8730db);}})['then'](function(_0x5687bb){if(_0x5687bb){return _0x5687bb?{'count':_0x12a234,'rows':_0x5687bb}:null;}})[_0x298e('0x12')](respondWithResult(_0x27b777,null))[_0x298e('0x1d')](handleError(_0x27b777,null));};exports[_0x298e('0xa0')]=function(_0x58c778,_0x387a6d){var _0x590009={'raw':!![],'where':{}};var _0x135614={};var _0x561c01={'count':0x0,'rows':[]};return db[_0x298e('0x61')][_0x298e('0x70')]({'where':{'id':_0x58c778[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x387a6d,null))['then'](function(_0x2332ae){if(_0x2332ae){_0x135614[_0x298e('0x51')]=_[_0x298e('0x54')](db['MailMessage'][_0x298e('0x64')]);_0x135614[_0x298e('0x53')]=_['keys'](_0x58c778[_0x298e('0x53')]);_0x135614[_0x298e('0x55')]=_[_0x298e('0x57')](_0x135614['model'],_0x135614['query']);_0x590009[_0x298e('0x56')]=_[_0x298e('0x57')](_0x135614[_0x298e('0x51')],qs[_0x298e('0x58')](_0x58c778[_0x298e('0x53')][_0x298e('0x58')]));_0x590009[_0x298e('0x56')]=_0x590009['attributes'][_0x298e('0x71')]?_0x590009[_0x298e('0x56')]:_0x135614[_0x298e('0x51')];if(!_0x58c778['query']['hasOwnProperty'](_0x298e('0x59'))){_0x590009[_0x298e('0x24')]=qs[_0x298e('0x24')](_0x58c778['query'][_0x298e('0x24')]);_0x590009[_0x298e('0x22')]=qs[_0x298e('0x22')](_0x58c778[_0x298e('0x53')][_0x298e('0x22')]);}_0x590009[_0x298e('0x5a')]=qs[_0x298e('0x73')](_0x58c778['query'][_0x298e('0x73')]);_0x590009[_0x298e('0x5b')]=qs[_0x298e('0x55')](_[_0x298e('0x5c')](_0x58c778[_0x298e('0x53')],_0x135614[_0x298e('0x55')]));_0x590009[_0x298e('0x5b')][_0x298e('0x76')]=_0x2332ae['id'];if(_0x58c778['query'][_0x298e('0x5d')]){_0x590009[_0x298e('0x5b')]=_[_0x298e('0x5f')](_0x590009['where'],{'$or':_[_0x298e('0x52')](_0x590009[_0x298e('0x56')],function(_0x52c51f){var _0xc463e4={};_0xc463e4[_0x52c51f]={'$like':'%'+_0x58c778[_0x298e('0x53')][_0x298e('0x5d')]+'%'};return _0xc463e4;})});}if(_0x58c778[_0x298e('0x53')][_0x298e('0xa1')]){var _0x1366f0=_0x58c778[_0x298e('0x53')][_0x298e('0xa1')][_0x298e('0xa2')](',');var _0x3f2606={};_0x3f2606[_0x1366f0[0x0]]={'$gte':moment(_0x1366f0[0x1])['format'](_0x298e('0xa3'))};_0x590009['where']=_[_0x298e('0x5f')](_0x590009[_0x298e('0x5b')],_0x3f2606);}_0x590009=_[_0x298e('0x5f')]({},_0x590009,_0x58c778['options']);return db[_0x298e('0xa4')][_0x298e('0x25')]({'where':_0x590009[_0x298e('0x5b')]})[_0x298e('0x12')](function(_0x5986a3){_0x561c01[_0x298e('0x25')]=_0x5986a3;if(_0x58c778[_0x298e('0x53')][_0x298e('0x65')]){_0x590009['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x590009);})[_0x298e('0x12')](function(_0x148897){if(_0x58c778[_0x298e('0x53')][_0x298e('0xa5')]==='true'){for(var _0x30265c=0x0;_0x30265c<_0x148897['length'];_0x30265c++){_0x148897[_0x30265c]['body']=juice(_0x148897[_0x30265c][_0x298e('0x67')]);}}_0x561c01[_0x298e('0x96')]=_0x148897;return _0x561c01;});}})[_0x298e('0x12')](respondWithFilteredResult(_0x387a6d,_0x590009))[_0x298e('0x1d')](handleError(_0x387a6d,null));};exports['send']=function(_0x194fdf,_0x388f76){var _0x56ea61,_0x5b8ed4={},_0x20a0e5;if(_0x194fdf[_0x298e('0x67')]['to']){_0x20a0e5=_0x194fdf['body']['to'][_0x298e('0xa2')](',')[0x0];}return db[_0x298e('0x61')]['find']({'where':{'id':_0x194fdf[_0x298e('0x6c')]['id']},'include':[{'model':db[_0x298e('0xa6')],'as':_0x298e('0xa7'),'include':[{'model':db['CmContact'],'as':_0x298e('0xa8'),'where':{'email':_0x20a0e5},'limit':0x1,'order':[[_0x298e('0xa9'),_0x298e('0xaa')]]}]},{'model':db[_0x298e('0x4b')],'as':_0x298e('0x47'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x298e('0x12')](handleEntityNotFound(_0x388f76,null))[_0x298e('0x12')](function(_0x2a1faa){if(!_0x2a1faa)return;_0x56ea61=_0x2a1faa;if(!_0x2a1faa[_0x298e('0x47')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x194fdf[_0x298e('0x67')][_0x298e('0xab')])){_0x194fdf[_0x298e('0x67')][_0x298e('0xab')]=util['format'](_0x298e('0xac'),_0x2a1faa['name'],_0x2a1faa[_0x298e('0x7a')]||_0x2a1faa[_0x298e('0x47')][_0x298e('0x3c')]);}if(_0x194fdf[_0x298e('0x67')]['attachments']&&_0x194fdf['body'][_0x298e('0xad')][_0x298e('0x71')]){for(var _0x45ef65=0x0;_0x45ef65<_0x194fdf['body'][_0x298e('0xad')][_0x298e('0x71')];_0x45ef65+=0x1){_0x194fdf[_0x298e('0x67')][_0x298e('0xad')][_0x45ef65]={'filename':_0x194fdf['body'][_0x298e('0xad')][_0x45ef65]['name'],'path':path['join'](config[_0x298e('0xae')],_0x298e('0xaf'),_0x194fdf['body']['attachments'][_0x45ef65][_0x298e('0xb0')])};}}var _0x236c34=_0x2a1faa['getSmtpOptions']();return respondWithRpcPromise(_0x298e('0xb1'),_0x298e('0xb2'),{'account':_0x236c34,'message':_0x194fdf[_0x298e('0x67')]});})['then'](function(_0x58e89b){if(!_0x58e89b)return;_0x5b8ed4=_0x58e89b;if(!_0x56ea61[_0x298e('0xa7')])throw new Error(_0x298e('0xb3'));if(_0x56ea61[_0x298e('0xa7')][_0x298e('0xa8')][_0x298e('0x71')])return _0x56ea61[_0x298e('0xa7')]['Contacts'][0x0];return db[_0x298e('0x8e')][_0x298e('0x6e')](_[_0x298e('0xa')](_0x194fdf[_0x298e('0x67')],{'firstName':_0x194fdf[_0x298e('0x67')]['to'],'email':_0x194fdf['body']['to'],'phone':_0x194fdf[_0x298e('0x67')]['to'],'ListId':_0x56ea61[_0x298e('0x7b')]}));})[_0x298e('0x12')](function(_0x28c7f3){if(!_0x28c7f3)return;var _0x22d56f={'UserId':_0x194fdf[_0x298e('0x3c')]['id'],'ContactId':_0x28c7f3['id'],'MailAccountId':_0x56ea61['id'],'inReplyTo':_0x5b8ed4[_0x298e('0xb4')],'to':_0x194fdf[_0x298e('0x67')][_0x298e('0xab')],'cc':_0x194fdf['body']['cc'],'subject':_0x194fdf[_0x298e('0x67')]['subject'],'attach':_0x194fdf['body']['attach'],'firstMsgDirection':_0x298e('0xb5'),'lastMsgAt':moment()['format'](_0x298e('0xa3')),'lastMsgDirection':'out','Messages':[_[_0x298e('0x5f')](_0x194fdf['body'],{'messageId':_0x5b8ed4[_0x298e('0xb4')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x56ea61['id'],'UserId':_0x194fdf[_0x298e('0x3c')]['id'],'ContactId':_0x28c7f3['id']})]};if(_0x194fdf[_0x298e('0x67')][_0x298e('0xb6')]){_0x22d56f=_[_0x298e('0x5f')](_0x22d56f,_0x194fdf['body'][_0x298e('0xb6')]);}return db[_0x298e('0x8c')][_0x298e('0x6e')](_0x22d56f,{'include':[{'model':db[_0x298e('0xa4')],'as':_0x298e('0xb7')}]});})[_0x298e('0x12')](respondWithResult(_0x388f76,null))['catch'](handleError(_0x388f76,null));};exports[_0x298e('0xb8')]=function(_0x15d0e4,_0xd4ff55){return db['MailAccount']['find']({'where':{'id':_0x15d0e4[_0x298e('0x6c')]['id']},'include':[{'model':db[_0x298e('0x4b')],'as':_0x298e('0x47'),'raw':!![],'include':[{'model':db[_0x298e('0xb9')],'as':_0x298e('0xb9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0xd4ff55,null))[_0x298e('0x12')](function(_0xe0fd15){if(!_0xe0fd15[_0x298e('0x47')])return;var _0x4792a8=_0xe0fd15['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x298e('0xb8'),{'account':_0x4792a8});})[_0x298e('0x12')](respondWithResult(_0xd4ff55,null))[_0x298e('0x1d')](handleError(_0xd4ff55,null));};exports['destroy']=function(_0x2dfa4d,_0x4e4858){return db[_0x298e('0x61')][_0x298e('0x66')]({'where':{'id':_0x2dfa4d['params']['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x4e4858,null))[_0x298e('0x12')](function(_0x197701){if(_0x197701&&_0x197701[_0x298e('0x44')]){throw new db[(_0x298e('0xba'))]['ValidationError'](_0x298e('0xbb'));}return _0x197701;})['then'](removeEntity(_0x4e4858,null))['catch'](handleError(_0x4e4858,null));};exports[_0x298e('0xbc')]=function(_0x3ef423,_0x52fb5d){return db[_0x298e('0x61')][_0x298e('0x66')]({'where':{'id':_0x3ef423[_0x298e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x52fb5d,null))[_0x298e('0x12')](function(_0x4fa432){if(_0x4fa432){return _0x4fa432[_0x298e('0xbc')](_0x3ef423[_0x298e('0x67')][_0x298e('0x75')],_[_0x298e('0x8d')](_0x3ef423[_0x298e('0x67')],[_0x298e('0x75'),'id'])||{})[_0x298e('0xbd')](function(_0x2856d8){for(var _0x4b36fd=0x0;_0x4b36fd<_0x3ef423[_0x298e('0x67')][_0x298e('0x75')][_0x298e('0x71')];_0x4b36fd+=0x1){socket[_0x298e('0xbe')](_0x298e('0xbf'),{'UserId':Number(_0x3ef423[_0x298e('0x67')][_0x298e('0x75')][_0x4b36fd]),'MailAccountId':Number(_0x3ef423[_0x298e('0x6c')]['id'])});}return _0x2856d8;});}})['then'](respondWithResult(_0x52fb5d,null))[_0x298e('0x1d')](handleError(_0x52fb5d,null));};exports[_0x298e('0xc0')]=function(_0x158f99,_0x4c95a1){return db['MailAccount']['find']({'where':{'id':_0x158f99[_0x298e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x4c95a1,null))[_0x298e('0x12')](function(_0x2fceff){if(_0x2fceff){return _0x2fceff[_0x298e('0xc0')](_0x158f99[_0x298e('0x53')][_0x298e('0x75')])[_0x298e('0x12')](function(){if(_[_0x298e('0xc1')](_0x158f99['query']['ids'])){for(var _0x241798=0x0;_0x241798<_0x158f99[_0x298e('0x53')][_0x298e('0x75')][_0x298e('0x71')];_0x241798+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x158f99[_0x298e('0x53')]['ids'][_0x241798]),'MailAccountId':Number(_0x158f99[_0x298e('0x6c')]['id'])});}}else{socket[_0x298e('0xbe')]('userMailAccount:remove',{'UserId':Number(_0x158f99[_0x298e('0x53')]['ids']),'MailAccountId':Number(_0x158f99[_0x298e('0x6c')]['id'])});}});}})[_0x298e('0x12')](respondWithStatusCode(_0x4c95a1,null))['catch'](handleError(_0x4c95a1,null));};exports['getAgents']=function(_0x541a06,_0x26ee36){var _0x5b330d={};var _0x422372={};var _0x1bb5e4;var _0x54af20;return db[_0x298e('0x61')][_0x298e('0x70')]({'where':{'id':_0x541a06[_0x298e('0x6c')]['id']}})[_0x298e('0x12')](handleEntityNotFound(_0x26ee36,null))[_0x298e('0x12')](function(_0x44d744){if(_0x44d744){_0x1bb5e4=_0x44d744;_0x422372[_0x298e('0x51')]=_[_0x298e('0x54')](db[_0x298e('0xc2')][_0x298e('0x64')]);_0x422372[_0x298e('0x53')]=_[_0x298e('0x54')](_0x541a06['query']);_0x422372[_0x298e('0x55')]=_['intersection'](_0x422372['model'],_0x422372[_0x298e('0x53')]);_0x5b330d['attributes']=_[_0x298e('0x57')](_0x422372[_0x298e('0x51')],qs[_0x298e('0x58')](_0x541a06[_0x298e('0x53')][_0x298e('0x58')]));_0x5b330d[_0x298e('0x56')]=_0x5b330d[_0x298e('0x56')][_0x298e('0x71')]?_0x5b330d[_0x298e('0x56')]:_0x422372[_0x298e('0x51')];_0x5b330d[_0x298e('0x5a')]=qs['sort'](_0x541a06[_0x298e('0x53')][_0x298e('0x73')]);_0x5b330d[_0x298e('0x5b')]=qs[_0x298e('0x55')](_['pick'](_0x541a06[_0x298e('0x53')],_0x422372[_0x298e('0x55')]));if(_0x541a06[_0x298e('0x53')]['filter']){_0x5b330d[_0x298e('0x5b')]=_[_0x298e('0x5f')](_0x5b330d['where'],{'$or':_[_0x298e('0x52')](_0x5b330d[_0x298e('0x56')],function(_0x4c8ee9){var _0x32fc69={};_0x32fc69[_0x4c8ee9]={'$like':'%'+_0x541a06[_0x298e('0x53')][_0x298e('0x5d')]+'%'};return _0x32fc69;})});}_0x5b330d=_[_0x298e('0x5f')]({},_0x5b330d,_0x541a06[_0x298e('0x60')]);return _0x1bb5e4[_0x298e('0xc3')](_0x5b330d);}})[_0x298e('0x12')](function(_0x57e9e4){if(_0x57e9e4){_0x54af20=_0x57e9e4[_0x298e('0x71')];if(!_0x541a06['query'][_0x298e('0x72')](_0x298e('0x59'))){_0x5b330d['limit']=qs[_0x298e('0x24')](_0x541a06[_0x298e('0x53')]['limit']);_0x5b330d[_0x298e('0x22')]=qs['offset'](_0x541a06[_0x298e('0x53')][_0x298e('0x22')]);}return _0x1bb5e4['getAgents'](_0x5b330d);}})[_0x298e('0x12')](function(_0x4b4243){if(_0x4b4243){return _0x4b4243?{'count':_0x54af20,'rows':_0x4b4243}:null;}})[_0x298e('0x12')](respondWithResult(_0x26ee36,null))['catch'](handleError(_0x26ee36,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index e20c0eb..9fb5aac 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 _0x65cb=['hook','exports','events','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x65cb,0xa4));var _0xb65c=function(_0x1e0802,_0x2f2996){_0x1e0802=_0x1e0802-0x0;var _0x67232a=_0x65cb[_0x1e0802];return _0x67232a;};'use strict';var EventEmitter=require(_0xb65c('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xb65c('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb65c('0x2')](0x0);var events={'afterCreate':_0xb65c('0x3'),'afterUpdate':'update','afterDestroy':_0xb65c('0x4')};function emitEvent(_0x34c63c){return function(_0x24d54b,_0x418710,_0x9962ce){MailAccountEvents['emit'](_0x34c63c+':'+_0x24d54b['id'],_0x24d54b);MailAccountEvents[_0xb65c('0x5')](_0x34c63c,_0x24d54b);_0x9962ce(null);};}for(var e in events){if(events[_0xb65c('0x6')](e)){var event=events[e];MailAccount[_0xb65c('0x7')](e,emitEvent(event));}}module[_0xb65c('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xce14=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4e2e8e,_0x198fa9){var _0x2d02ca=function(_0x17e87b){while(--_0x17e87b){_0x4e2e8e['push'](_0x4e2e8e['shift']());}};_0x2d02ca(++_0x198fa9);}(_0xce14,0x17f));var _0x4ce1=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xce14[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4ce1('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4ce1('0x1')](0x0);var events={'afterCreate':_0x4ce1('0x2'),'afterUpdate':'update','afterDestroy':_0x4ce1('0x3')};function emitEvent(_0x7d84d1){return function(_0xdd9af4,_0x2701cd,_0x869ee3){MailAccountEvents['emit'](_0x7d84d1+':'+_0xdd9af4['id'],_0xdd9af4);MailAccountEvents[_0x4ce1('0x4')](_0x7d84d1,_0xdd9af4);_0x869ee3(null);};}for(var e in events){if(events[_0x4ce1('0x5')](e)){var event=events[e];MailAccount[_0x4ce1('0x6')](e,emitEvent(event));}}module[_0x4ce1('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index cf56a5c..7876cbd 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 _0xcc4d=['modernAuthentication','CloudProvider','OAuth2','data5','auth','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','Smtp','host','port','secure','authentication'];(function(_0x285743,_0xf9489e){var _0x4c66dc=function(_0x3e20fc){while(--_0x3e20fc){_0x285743['push'](_0x285743['shift']());}};_0x4c66dc(++_0xf9489e);}(_0xcc4d,0x6b));var _0xdcc4=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xcc4d[_0x110c3d];return _0x226d67;};'use strict';var attributes=require(_0xdcc4('0x0'));module[_0xdcc4('0x1')]=function(_0x46a2e8){return _0x46a2e8[_0xdcc4('0x2')](_0xdcc4('0x3'),attributes,{'tableName':_0xdcc4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1549ae=this;var _0xed7376={'id':_0x1549ae['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1549ae[_0xdcc4('0x5')]!==_0xdcc4('0x6')){_0xed7376[_0xdcc4('0x7')]=_0x1549ae['provider'];}else{_0xed7376['host']=_0x1549ae[_0xdcc4('0x8')][_0xdcc4('0x9')];_0xed7376[_0xdcc4('0xa')]=_0x1549ae['Smtp'][_0xdcc4('0xa')];_0xed7376[_0xdcc4('0xb')]=_0x1549ae[_0xdcc4('0x8')][_0xdcc4('0xb')];}if(_0x1549ae['Smtp'][_0xdcc4('0xc')]){if(_0x1549ae[_0xdcc4('0x8')][_0xdcc4('0xd')]){if(!_0x1549ae[_0xdcc4('0x8')][_0xdcc4('0xe')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0xed7376['auth']={'type':_0xdcc4('0xf'),'user':_0x1549ae[_0xdcc4('0x8')]['user'],'accessToken':_0x1549ae[_0xdcc4('0x8')][_0xdcc4('0xe')][_0xdcc4('0x10')]};}else{_0xed7376[_0xdcc4('0x11')]={'user':_0x1549ae[_0xdcc4('0x8')][_0xdcc4('0x12')],'pass':_0x1549ae['Smtp'][_0xdcc4('0x13')]};}}return _0xed7376;}}});}; \ No newline at end of file +var _0xb3ad=['service','provider','host','Smtp','port','secure','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','CloudProvider','data5','user','pass','define','mail_accounts','custom'];(function(_0x433ceb,_0x6a5958){var _0xa662c=function(_0x4562e3){while(--_0x4562e3){_0x433ceb['push'](_0x433ceb['shift']());}};_0xa662c(++_0x6a5958);}(_0xb3ad,0xda));var _0xdb3a=function(_0xfaec52,_0xd6b8f7){_0xfaec52=_0xfaec52-0x0;var _0x5d4cf8=_0xb3ad[_0xfaec52];return _0x5d4cf8;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x1a591b){return _0x1a591b[_0xdb3a('0x0')]('MailAccount',attributes,{'tableName':_0xdb3a('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5a8f74=this;var _0x2012b7={'id':_0x5a8f74['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5a8f74['provider']!==_0xdb3a('0x2')){_0x2012b7[_0xdb3a('0x3')]=_0x5a8f74[_0xdb3a('0x4')];}else{_0x2012b7[_0xdb3a('0x5')]=_0x5a8f74[_0xdb3a('0x6')][_0xdb3a('0x5')];_0x2012b7['port']=_0x5a8f74['Smtp'][_0xdb3a('0x7')];_0x2012b7[_0xdb3a('0x8')]=_0x5a8f74[_0xdb3a('0x6')][_0xdb3a('0x8')];}if(_0x5a8f74[_0xdb3a('0x6')]['authentication']){if(_0x5a8f74[_0xdb3a('0x6')][_0xdb3a('0x9')]){if(!_0x5a8f74[_0xdb3a('0x6')]['CloudProvider'])throw new Error(_0xdb3a('0xa'));_0x2012b7[_0xdb3a('0xb')]={'type':_0xdb3a('0xc'),'user':_0x5a8f74[_0xdb3a('0x6')]['user'],'accessToken':_0x5a8f74[_0xdb3a('0x6')][_0xdb3a('0xd')][_0xdb3a('0xe')]};}else{_0x2012b7[_0xdb3a('0xb')]={'user':_0x5a8f74[_0xdb3a('0x6')][_0xdb3a('0xf')],'pass':_0x5a8f74[_0xdb3a('0x6')][_0xdb3a('0x10')]};}}return _0x2012b7;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index e52e7fc..b77da92 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 _0x5f2f=['Attachments','UserId','User','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailAccount','options','where','limit','include','model','attributes','map','MailAccount','find','raw','then','smtp','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','applications','Applications','priority','asc','autoclose','push','close','Contacts','length','create','messageId','subject','format','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originCc','originChannel','Email','ChatOfflineMessageId','Attachment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1cf7d1,_0x395d36){_0x1cf7d1=_0x1cf7d1-0x0;var _0x28f291=_0x5f2f[_0x1cf7d1];return _0x28f291;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5f2('0x8')][_0xf5f2('0x9')]({'port':0x232c});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':_0xf5f2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x56a69f,_0x375da4,_0x15dd7c){return new BPromise(function(_0x218ae3,_0x4e0e6b){return client[_0xf5f2('0xf')](_0x56a69f,_0x15dd7c)['then'](function(_0x53fb33){logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,'request\x20sent');logger[_0xf5f2('0x12')](_0xf5f2('0x13'),_0x375da4,_0xf5f2('0x14'),JSON[_0xf5f2('0x15')](_0x53fb33));if(_0x53fb33[_0xf5f2('0x16')]){if(_0x53fb33[_0xf5f2('0x16')]['code']===0x1f4){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x4e0e6b(_0x53fb33[_0xf5f2('0x16')]['message']);}logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x218ae3(_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);}else{logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,_0xf5f2('0x14'));_0x218ae3(_0x53fb33[_0xf5f2('0x18')][_0xf5f2('0x17')]);}})[_0xf5f2('0x19')](function(_0x4ff59b){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x4ff59b);_0x4e0e6b(_0x4ff59b);});});}exports[_0xf5f2('0x1a')]=function(_0x1bf655){var _0x56acc5=this;return new Promise(function(_0x34706d,_0x47101e){return db['MailAccount']['findAll']({'raw':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1c')]||null:null,'attributes':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['attributes']||null:null,'limit':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1d')]||null:null,'include':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['include']?_['map'](_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')],'include':_0x294414[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x294414[_0xf5f2('0x1e')],function(_0x198c73){return{'model':db[_0x198c73[_0xf5f2('0x1f')]],'as':_0x198c73['as'],'attributes':_0x198c73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22c826){logger[_0xf5f2('0x10')](_0xf5f2('0x1a'),_0x1bf655);logger['debug']('GetMailAccount',_0x1bf655,JSON[_0xf5f2('0x15')](_0x22c826));_0x34706d(_0x22c826);})[_0xf5f2('0x19')](function(_0x17394a){logger[_0xf5f2('0x16')](_0xf5f2('0x1a'),_0x17394a['message'],_0x1bf655);_0x47101e(_0x56acc5['error'](0x1f4,_0x17394a[_0xf5f2('0x17')]));});});};exports['ShowMailAccount']=function(_0xb744b9){var _0x58a4df=this;return new Promise(function(_0x45b643,_0x31087c){return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'raw':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x24')]===undefined?!![]:![]:!![],'where':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9['options'][_0xf5f2('0x1c')]||null:null,'attributes':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null,'include':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')]?_['map'](_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes'],'include':_0x2e3cca[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x2e3cca[_0xf5f2('0x1e')],function(_0x4ec8fb){return{'model':db[_0x4ec8fb[_0xf5f2('0x1f')]],'as':_0x4ec8fb['as'],'attributes':_0x4ec8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x25')](function(_0x566c47){if(_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x26')]===!![])_0x566c47['setDataValue'](_0xf5f2('0x27'),_0x566c47[_0xf5f2('0x28')]());logger[_0xf5f2('0x10')](_0xf5f2('0x29'),_0xb744b9);logger['debug']('ShowMailAccount',_0xb744b9,JSON[_0xf5f2('0x15')](_0x566c47));_0x45b643(_0x566c47);})[_0xf5f2('0x19')](function(_0x22b20c){logger[_0xf5f2('0x16')](_0xf5f2('0x29'),_0x22b20c[_0xf5f2('0x17')],_0xb744b9);_0x31087c(_0x58a4df[_0xf5f2('0x16')](0x1f4,_0x22b20c['message']));});});};exports[_0xf5f2('0x2a')]=function(_0x3b4ea6){var _0x536501=this;return new Promise(function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'body':_0x3b4ea6[_0xf5f2('0x2b')],'channel':_0xf5f2('0x2c')};var _0x3b6372=_[_0xf5f2('0x2d')](_[_0xf5f2('0x2e')](db['CmContact'][_0xf5f2('0x2f')]),[_0xf5f2('0x30'),_0xf5f2('0x31'),'CompanyId','ListId']);var _0x59eb00=![];if(_0x3b4ea6[_0xf5f2('0x2b')]['id']){delete _0x3b4ea6[_0xf5f2('0x2b')]['id'];}if(_['isNil'](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x33')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')])||_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')]===''){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x35')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501['error'](0x1f4,_0xf5f2('0x37')+_0x3b6372));}if(!_['includes'](_0x3b6372,_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x38')+_0x3b6372));}var _0x31bf0e={};_0x31bf0e[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'where':{'id':_0x3b4ea6[_0xf5f2('0x39')]['id']},'include':[{'model':db[_0xf5f2('0x3a')],'as':_0xf5f2('0x3b'),'include':[{'model':db[_0xf5f2('0x3c')],'as':'Contacts','where':_0x31bf0e,'limit':0x1,'order':[[_0xf5f2('0x31'),_0xf5f2('0x3d')]]}]},{'model':db[_0xf5f2('0x3e')],'as':'Applications'},{'model':db[_0xf5f2('0x3f')],'as':_0xf5f2('0x40'),'include':[{'model':db[_0xf5f2('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x7bb942){if(_0x7bb942&&_0x7bb942[_0xf5f2('0x3b')]){var _0x5db519=_0x7bb942[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7['account']=_[_0xf5f2('0x43')](_0x5db519,['Applications',_0xf5f2('0x3b')]);_0x71b0e7['account'][_0xf5f2('0x27')]=_0x7bb942[_0xf5f2('0x28')]();_0x71b0e7[_0xf5f2('0x44')]=_0x5db519[_0xf5f2('0x45')];_0x71b0e7['list']=_0x5db519[_0xf5f2('0x3b')];_0x71b0e7[_0xf5f2('0x44')]=_['orderBy'](_0x71b0e7['applications'],[_0xf5f2('0x46')],[_0xf5f2('0x47')]);if(_0x71b0e7['account']&&_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x48')]){_0x71b0e7[_0xf5f2('0x44')][_0xf5f2('0x49')]({'id':0x0,'priority':_0x71b0e7['applications']['length']+0x1,'app':_0xf5f2('0x4a'),'appdata':_0xf5f2('0x48'),'interval':'*,*,*,*'});}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')]){delete _0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')];}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x3b')]){delete _0x71b0e7[_0xf5f2('0x39')]['List'];}if(_0x5db519['List'][_0xf5f2('0x4b')][_0xf5f2('0x4c')]){return _0x5db519[_0xf5f2('0x3b')][_0xf5f2('0x4b')][0x0];}var _0x21b0d3=_['defaults'](_0x3b4ea6[_0xf5f2('0x2b')],{'firstName':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')],'ListId':_0x5db519['ListId']});_0x21b0d3[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x3c')][_0xf5f2('0x4d')](_0x21b0d3);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x756f1f){_0x71b0e7['contact']=_0x756f1f;if(_0x756f1f){if(!_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['messageId']){_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4e')]=rs['generate']()+'\x20'+_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')];}var _0x4579f4={'ContactId':_0x756f1f['id'],'MailAccountId':_0x3b4ea6['account']['id'],'inReplyTo':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'cc':_0x3b4ea6[_0xf5f2('0x2b')]['message']['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['attach'],'lastMsgAt':moment()[_0xf5f2('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xf5f2('0x23')]({'where':{'closed':![],'MailAccountId':_0x3b4ea6['account']['id']},'include':[{'model':db[_0xf5f2('0x51')],'as':_0xf5f2('0x52'),'attributes':[_0xf5f2('0x4e')],'where':{'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x53')]}}]})[_0xf5f2('0x25')](function(_0x1ec682){if(_0x1ec682){return[_0x1ec682,![]];}return db[_0xf5f2('0x54')][_0xf5f2('0x4d')](_0x4579f4)[_0xf5f2('0x25')](function(_0x158768){return[_0x158768,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf5f2('0x55')](function(_0x2d171d,_0xb39a6e){if(_0x2d171d){_0x59eb00=_0xb39a6e;if(!_0xb39a6e){return _0x2d171d[_0xf5f2('0x56')]({'inReplyTo':_0x3b4ea6['body'][_0xf5f2('0x17')]['messageId'],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['from'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x2d171d['attach']?_0x2d171d[_0xf5f2('0x57')]:_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x57')],'substatus':null,'substatusAt':moment()[_0xf5f2('0x50')](_0xf5f2('0x58')),'lastMsgAt':moment()['format'](_0xf5f2('0x58')),'lastMsgDirection':'in'});}else{return _0x2d171d;}}})[_0xf5f2('0x25')](function(_0x4800fe){_0x71b0e7[_0xf5f2('0x59')]=_0x4800fe[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7[_0xf5f2('0x59')]['created']=_0x59eb00;return db['MailMessage']['create']({'body':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')],'MailAccountId':_0x3b4ea6[_0xf5f2('0x39')]['id'],'MailInteractionId':_0x4800fe['id'],'direction':'in','ContactId':_0x71b0e7[_0xf5f2('0x5a')]['id'],'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'from':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['to'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6['body']['message']['attach'],'Attachments':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5b')],'originTo':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['originTo'],'originCc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5c')],'bcc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['bcc'],'ChatWebsiteId':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['ChatWebsiteId']||null,'originChannel':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5d')]||_0xf5f2('0x5e'),'ChatOfflineMessageId':_0x3b4ea6['body'][_0xf5f2('0x17')][_0xf5f2('0x5f')]||null},{'include':[{'model':db[_0xf5f2('0x60')],'as':_0xf5f2('0x61')}]});})[_0xf5f2('0x25')](function(_0x4f47e1){_0x71b0e7['message']=_0x4f47e1;if(_0x71b0e7[_0xf5f2('0x59')][_0xf5f2('0x62')]){return db[_0xf5f2('0x63')][_0xf5f2('0x23')]({'attributes':['id','name'],'where':{'id':_0x71b0e7['interaction'][_0xf5f2('0x62')]}})['then'](function(_0x4c4420){if(_0x4c4420){_0x71b0e7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf5f2('0x64'),'appdata':_0x4c4420[_0xf5f2('0x65')]+','+(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x66')]||0xa),'interval':_0xf5f2('0x67')});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);})[_0xf5f2('0x25')](function(_0x9afb3c){_0xc6a1ae(_0x9afb3c);})[_0xf5f2('0x19')](function(_0x1ba503){_0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0x1ba503[_0xf5f2('0x17')]));});});}; \ No newline at end of file +var _0x7a54=['CloudProvider','get','omit','Applications','smtpOptions','list','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','Contacts','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','inReplyTo','MailInteraction','create','Contact\x20not\x20found','update','interaction','created','MailMessage','contact','subject','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowMailAccount','MailAccount','smtp','setDataValue','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','updatedAt','DESC','MailServerOut'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x7a54,0x106));var _0x47a5=function(_0x256095,_0x1d03f0){_0x256095=_0x256095-0x0;var _0x4455e3=_0x7a54[_0x256095];return _0x4455e3;};'use strict';var _=require(_0x47a5('0x0'));var moment=require(_0x47a5('0x1'));var BPromise=require(_0x47a5('0x2'));var rs=require('randomstring');var Redis=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var jayson=require(_0x47a5('0x7'));var client=jayson[_0x47a5('0x8')][_0x47a5('0x9')]({'port':0x232c});config['redis']=_[_0x47a5('0xa')](config['redis'],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require(_0x47a5('0xc'))(new Redis(config['redis']));require(_0x47a5('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d90b3,_0x582352,_0x2a0e98){return new BPromise(function(_0x2baee7,_0x5e31dd){return client[_0x47a5('0xe')](_0x5d90b3,_0x2a0e98)['then'](function(_0x5de6d7){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x582352,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x582352,_0x47a5('0x11'),JSON[_0x47a5('0x14')](_0x5de6d7));if(_0x5de6d7['error']){if(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x5e31dd(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}logger['error'](_0x47a5('0x10'),_0x582352,_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2baee7(_0x5de6d7[_0x47a5('0x15')][_0x47a5('0x17')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x582352,_0x47a5('0x11'));_0x2baee7(_0x5de6d7['result']['message']);}})[_0x47a5('0x18')](function(_0xaf70a6){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x582352,_0xaf70a6);_0x5e31dd(_0xaf70a6);});});}exports[_0x47a5('0x19')]=function(_0x12b98e){var _0x2763d6=this;return new Promise(function(_0xe3c618,_0x3aed38){return db['MailAccount'][_0x47a5('0x1a')]({'raw':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1d')]||null:null,'limit':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1e')]||null:null,'include':_0x12b98e[_0x47a5('0x1b')]?_0x12b98e['options'][_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x12b98e[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1f')]?_['map'](_0x3abd6a[_0x47a5('0x1f')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x21')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1d')],'include':_0x5b6c4e[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x5b6c4e[_0x47a5('0x1f')],function(_0x3ba0b7){return{'model':db[_0x3ba0b7[_0x47a5('0x21')]],'as':_0x3ba0b7['as'],'attributes':_0x3ba0b7[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x361bfa){logger[_0x47a5('0xf')](_0x47a5('0x19'),_0x12b98e);logger[_0x47a5('0x12')]('GetMailAccount',_0x12b98e,JSON[_0x47a5('0x14')](_0x361bfa));_0xe3c618(_0x361bfa);})['catch'](function(_0x2ef875){logger[_0x47a5('0x15')](_0x47a5('0x19'),_0x2ef875['message'],_0x12b98e);_0x3aed38(_0x2763d6[_0x47a5('0x15')](0x1f4,_0x2ef875[_0x47a5('0x17')]));});});};exports[_0x47a5('0x23')]=function(_0x1f1c68){var _0x51cc81=this;return new Promise(function(_0x50d875,_0x6f9a12){return db[_0x47a5('0x24')]['find']({'raw':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['where']||null:null,'attributes':_0x1f1c68[_0x47a5('0x1b')]?_0x1f1c68[_0x47a5('0x1b')]['attributes']||null:null,'include':_0x1f1c68['options']?_0x1f1c68[_0x47a5('0x1b')]['include']?_[_0x47a5('0x20')](_0x1f1c68[_0x47a5('0x1b')][_0x47a5('0x1f')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x21')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x20')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1d')],'include':_0x25cce0[_0x47a5('0x1f')]?_[_0x47a5('0x20')](_0x25cce0[_0x47a5('0x1f')],function(_0x36add5){return{'model':db[_0x36add5[_0x47a5('0x21')]],'as':_0x36add5['as'],'attributes':_0x36add5[_0x47a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x22')](function(_0x1a0d23){if(_0x1f1c68['options'][_0x47a5('0x25')]===!![])_0x1a0d23[_0x47a5('0x26')]('smtpOptions',_0x1a0d23[_0x47a5('0x27')]());logger[_0x47a5('0xf')](_0x47a5('0x23'),_0x1f1c68);logger['debug'](_0x47a5('0x23'),_0x1f1c68,JSON[_0x47a5('0x14')](_0x1a0d23));_0x50d875(_0x1a0d23);})['catch'](function(_0x2ebba0){logger[_0x47a5('0x15')]('ShowMailAccount',_0x2ebba0['message'],_0x1f1c68);_0x6f9a12(_0x51cc81['error'](0x1f4,_0x2ebba0[_0x47a5('0x17')]));});});};exports['NotifyMailAccount']=function(_0x9b5eaf){var _0x1f9631=this;return new Promise(function(_0x301a85,_0x111f0d){var _0x1b2c80={'body':_0x9b5eaf[_0x47a5('0x28')],'channel':_0x47a5('0x29')};var _0x1f3d01=_[_0x47a5('0x2a')](_[_0x47a5('0x2b')](db[_0x47a5('0x2c')][_0x47a5('0x2d')]),[_0x47a5('0x2e'),'updatedAt',_0x47a5('0x2f'),_0x47a5('0x30')]);var _0x331474=![];if(_0x9b5eaf[_0x47a5('0x28')]['id']){delete _0x9b5eaf['body']['id'];}if(_[_0x47a5('0x31')](_0x9b5eaf['body']['from'])){return _0x111f0d(_0x1f9631['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x47a5('0x31')](_0x9b5eaf['body'][_0x47a5('0x28')])||_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x28')]===''){return _0x111f0d(_0x1f9631['error'](0x1f4,_0x47a5('0x32')));}if(_[_0x47a5('0x31')](_0x9b5eaf['body']['mapKey'])){return _0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f3d01));}if(!_[_0x47a5('0x33')](_0x1f3d01,_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x34')])){return _0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,_0x47a5('0x35')+_0x1f3d01));}var _0xf0edbb={};_0xf0edbb[_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x34')]]=_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')];return db[_0x47a5('0x24')][_0x47a5('0x37')]({'where':{'id':_0x9b5eaf[_0x47a5('0x38')]['id']},'include':[{'model':db[_0x47a5('0x39')],'as':_0x47a5('0x3a'),'include':[{'model':db[_0x47a5('0x2c')],'as':'Contacts','where':_0xf0edbb,'limit':0x1,'order':[[_0x47a5('0x3b'),_0x47a5('0x3c')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x47a5('0x3d')],'as':'Smtp','include':[{'model':db[_0x47a5('0x3e')],'as':_0x47a5('0x3e')}]}]})['then'](function(_0x4f62d3){if(_0x4f62d3&&_0x4f62d3[_0x47a5('0x3a')]){var _0x52d409=_0x4f62d3[_0x47a5('0x3f')]({'plain':!![]});_0x1b2c80[_0x47a5('0x38')]=_[_0x47a5('0x40')](_0x52d409,[_0x47a5('0x41'),_0x47a5('0x3a')]);_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x42')]=_0x4f62d3['getSmtpOptions']();_0x1b2c80['applications']=_0x52d409[_0x47a5('0x41')];_0x1b2c80[_0x47a5('0x43')]=_0x52d409[_0x47a5('0x3a')];_0x1b2c80[_0x47a5('0x44')]=_[_0x47a5('0x45')](_0x1b2c80[_0x47a5('0x44')],[_0x47a5('0x46')],['asc']);if(_0x1b2c80[_0x47a5('0x38')]&&_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x47')]){_0x1b2c80['applications'][_0x47a5('0x48')]({'id':0x0,'priority':_0x1b2c80['applications'][_0x47a5('0x49')]+0x1,'app':_0x47a5('0x4a'),'appdata':_0x47a5('0x47'),'interval':_0x47a5('0x4b')});}if(_0x1b2c80['account'][_0x47a5('0x41')]){delete _0x1b2c80[_0x47a5('0x38')][_0x47a5('0x41')];}if(_0x1b2c80[_0x47a5('0x38')][_0x47a5('0x3a')]){delete _0x1b2c80[_0x47a5('0x38')][_0x47a5('0x3a')];}if(_0x52d409['List'][_0x47a5('0x4c')][_0x47a5('0x49')]){return _0x52d409[_0x47a5('0x3a')][_0x47a5('0x4c')][0x0];}var _0x3329aa=_[_0x47a5('0xa')](_0x9b5eaf['body'],{'firstName':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')],'ListId':_0x52d409[_0x47a5('0x30')]});_0x3329aa[_0x9b5eaf['body'][_0x47a5('0x34')]]=_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x36')];return db['CmContact']['create'](_0x3329aa);}else{throw new Error(_0x47a5('0x4d'));}})[_0x47a5('0x22')](function(_0x4fa1da){_0x1b2c80['contact']=_0x4fa1da;if(_0x4fa1da){if(!_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x4e')]){_0x9b5eaf['body']['message'][_0x47a5('0x4e')]=rs[_0x47a5('0x4f')]()+'\x20'+_0x9b5eaf['body'][_0x47a5('0x17')][_0x47a5('0x36')];}var _0x4b706a={'ContactId':_0x4fa1da['id'],'MailAccountId':_0x9b5eaf['account']['id'],'inReplyTo':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x4e')],'to':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x36')],'cc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['cc'],'subject':_0x9b5eaf['body'][_0x47a5('0x17')]['subject'],'attach':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x50')],'lastMsgAt':moment()[_0x47a5('0x51')](_0x47a5('0x52')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x47a5('0x37')]({'where':{'closed':![],'MailAccountId':_0x9b5eaf['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x53')]}}]})['then'](function(_0x4d3db1){if(_0x4d3db1){return[_0x4d3db1,![]];}return db[_0x47a5('0x54')][_0x47a5('0x55')](_0x4b706a)[_0x47a5('0x22')](function(_0x3c2b46){return[_0x3c2b46,!![]];});});}else{throw new Error(_0x47a5('0x56'));}})['spread'](function(_0x3474b7,_0x519e9e){if(_0x3474b7){_0x331474=_0x519e9e;if(!_0x519e9e){return _0x3474b7[_0x47a5('0x57')]({'inReplyTo':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x4e')],'to':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x36')],'cc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['cc'],'subject':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['subject'],'attach':_0x3474b7[_0x47a5('0x50')]?_0x3474b7[_0x47a5('0x50')]:_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x50')],'substatus':null,'substatusAt':moment()['format'](_0x47a5('0x52')),'lastMsgAt':moment()[_0x47a5('0x51')](_0x47a5('0x52')),'lastMsgDirection':'in'});}else{return _0x3474b7;}}})[_0x47a5('0x22')](function(_0x4228a3){_0x1b2c80[_0x47a5('0x58')]=_0x4228a3[_0x47a5('0x3f')]({'plain':!![]});_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x59')]=_0x331474;return db[_0x47a5('0x5a')][_0x47a5('0x55')]({'body':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x28')],'MailAccountId':_0x9b5eaf[_0x47a5('0x38')]['id'],'MailInteractionId':_0x4228a3['id'],'direction':'in','ContactId':_0x1b2c80[_0x47a5('0x5b')]['id'],'messageId':_0x9b5eaf['body'][_0x47a5('0x17')][_0x47a5('0x4e')],'from':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x36')],'to':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')]['to'],'cc':_0x9b5eaf[_0x47a5('0x28')]['message']['cc'],'subject':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x5c')],'attach':_0x9b5eaf['body'][_0x47a5('0x17')]['attach'],'Attachments':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x5d')],'originTo':_0x9b5eaf['body']['message']['originTo'],'originCc':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x5e')],'bcc':_0x9b5eaf[_0x47a5('0x28')]['message'][_0x47a5('0x5f')],'ChatWebsiteId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x60')]||null,'originChannel':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x61')]||_0x47a5('0x62'),'ChatOfflineMessageId':_0x9b5eaf[_0x47a5('0x28')][_0x47a5('0x17')][_0x47a5('0x63')]||null},{'include':[{'model':db[_0x47a5('0x64')],'as':'Attachments'}]});})[_0x47a5('0x22')](function(_0x4833be){_0x1b2c80[_0x47a5('0x17')]=_0x4833be;if(_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x65')]){return db[_0x47a5('0x66')][_0x47a5('0x37')]({'attributes':['id',_0x47a5('0x67')],'where':{'id':_0x1b2c80[_0x47a5('0x58')][_0x47a5('0x65')]}})[_0x47a5('0x22')](function(_0x254049){if(_0x254049){_0x1b2c80[_0x47a5('0x44')][_0x47a5('0x68')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x69'),'appdata':_0x254049[_0x47a5('0x67')]+','+(_0x1b2c80[_0x47a5('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x1b2c80);});}return respondWithRpcPromise(_0x47a5('0x6a'),_0x47a5('0x6b'),_0x1b2c80);})['then'](function(_0x732e00){_0x301a85(_0x732e00);})[_0x47a5('0x18')](function(_0x1baa5a){_0x111f0d(_0x1f9631[_0x47a5('0x15')](0x1f4,_0x1baa5a[_0x47a5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 294d22e..e5f196b 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 _0x5100=['remove','update','emit','removeListener','mailAccount:','./mailAccount.events','save'];(function(_0x714d60,_0x1ede1f){var _0x25b2f1=function(_0x12b209){while(--_0x12b209){_0x714d60['push'](_0x714d60['shift']());}};_0x25b2f1(++_0x1ede1f);}(_0x5100,0x132));var _0x0510=function(_0x2fa117,_0x8cc442){_0x2fa117=_0x2fa117-0x0;var _0x8bd821=_0x5100[_0x2fa117];return _0x8bd821;};'use strict';var MailAccountEvents=require(_0x0510('0x0'));var events=[_0x0510('0x1'),_0x0510('0x2'),_0x0510('0x3')];function createListener(_0x405178,_0x44e3ab){return function(_0x5d542b){_0x44e3ab[_0x0510('0x4')](_0x405178,_0x5d542b);};}function removeListener(_0x5605c2,_0xd7faa8){return function(){MailAccountEvents[_0x0510('0x5')](_0x5605c2,_0xd7faa8);};}exports['register']=function(_0x314bfe){for(var _0x187274=0x0,_0x5833d0=events['length'];_0x187274<_0x5833d0;_0x187274++){var _0xa321d5=events[_0x187274];var _0x5739ac=createListener(_0x0510('0x6')+_0xa321d5,_0x314bfe);MailAccountEvents['on'](_0xa321d5,_0x5739ac);}}; \ No newline at end of file +var _0xeeb4=['./mailAccount.events','update','emit','removeListener','register','length','mailAccount:'];(function(_0x3d43b2,_0x48b7a0){var _0x247406=function(_0x5e1709){while(--_0x5e1709){_0x3d43b2['push'](_0x3d43b2['shift']());}};_0x247406(++_0x48b7a0);}(_0xeeb4,0x1f1));var _0x4eeb=function(_0x291e73,_0x240beb){_0x291e73=_0x291e73-0x0;var _0x15a90f=_0xeeb4[_0x291e73];return _0x15a90f;};'use strict';var MailAccountEvents=require(_0x4eeb('0x0'));var events=['save','remove',_0x4eeb('0x1')];function createListener(_0x26019c,_0x1b484f){return function(_0x56ad8c){_0x1b484f[_0x4eeb('0x2')](_0x26019c,_0x56ad8c);};}function removeListener(_0xc14d71,_0x23e194){return function(){MailAccountEvents[_0x4eeb('0x3')](_0xc14d71,_0x23e194);};}exports[_0x4eeb('0x4')]=function(_0x188800){for(var _0x1306b7=0x0,_0x5be0fe=events[_0x4eeb('0x5')];_0x1306b7<_0x5be0fe;_0x1306b7++){var _0x365b58=events[_0x1306b7];var _0x37ee5=createListener(_0x4eeb('0x6')+_0x365b58,_0x188800);MailAccountEvents['on'](_0x365b58,_0x37ee5);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8f73d2c..c2ce3dd 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 _0x1e2f=['./mailApplication.controller','/:id','isAuthenticated','put','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x1e2f,0xd7));var _0xf1e2=function(_0x32bbd0,_0x374235){_0x32bbd0=_0x32bbd0-0x0;var _0x3774c3=_0x1e2f[_0x32bbd0];return _0x3774c3;};'use strict';var multer=require(_0xf1e2('0x0'));var util=require('util');var path=require(_0xf1e2('0x1'));var timeout=require('connect-timeout');var express=require(_0xf1e2('0x2'));var router=express[_0xf1e2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf1e2('0x4'));var interaction=require(_0xf1e2('0x5'));var config=require('../../config/environment');var controller=require(_0xf1e2('0x6'));router['get'](_0xf1e2('0x7'),auth[_0xf1e2('0x8')](),controller['show']);router[_0xf1e2('0x9')](_0xf1e2('0x7'),auth[_0xf1e2('0x8')](),controller[_0xf1e2('0xa')]);router[_0xf1e2('0xb')](_0xf1e2('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xf1e2('0xc')]=router; \ No newline at end of file +var _0x7400=['fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7400,0xa3));var _0x0740=function(_0x5eca6f,_0x76ec15){_0x5eca6f=_0x5eca6f-0x0;var _0x4c34b7=_0x7400[_0x5eca6f];return _0x4c34b7;};'use strict';var multer=require(_0x0740('0x0'));var util=require(_0x0740('0x1'));var path=require('path');var timeout=require(_0x0740('0x2'));var express=require(_0x0740('0x3'));var router=express[_0x0740('0x4')]();var fs_extra=require(_0x0740('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0740('0x6'));var config=require(_0x0740('0x7'));var controller=require(_0x0740('0x8'));router[_0x0740('0x9')](_0x0740('0xa'),auth[_0x0740('0xb')](),controller['show']);router['put']('/:id',auth[_0x0740('0xb')](),controller[_0x0740('0xc')]);router[_0x0740('0xd')](_0x0740('0xa'),auth['isAuthenticated'](),controller['destroy']);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 b74cb03..666ce35 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 _0x86bb=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x86bb,0xfb));var _0xb86b=function(_0x9e689c,_0x2600d8){_0x9e689c=_0x9e689c-0x0;var _0x13ee00=_0x86bb[_0x9e689c];return _0x13ee00;};'use strict';var Sequelize=require('sequelize');module[_0xb86b('0x0')]={'priority':{'type':Sequelize[_0xb86b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb86b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb86b('0x3')]()},'description':{'type':Sequelize[_0xb86b('0x2')]},'interval':{'type':Sequelize[_0xb86b('0x2')],'defaultValue':_0xb86b('0x4')}}; \ No newline at end of file +var _0x4a6f=['*,*,*,*','exports','STRING','noop','TEXT'];(function(_0x4ee9cd,_0xd375b0){var _0x328a5b=function(_0x3ad1f4){while(--_0x3ad1f4){_0x4ee9cd['push'](_0x4ee9cd['shift']());}};_0x328a5b(++_0xd375b0);}(_0x4a6f,0x10f));var _0xf4a6=function(_0x170b20,_0x49fc52){_0x170b20=_0x170b20-0x0;var _0xbe0395=_0x4a6f[_0x170b20];return _0xbe0395;};'use strict';var Sequelize=require('sequelize');module[_0xf4a6('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf4a6('0x1')],'allowNull':![],'defaultValue':_0xf4a6('0x2')},'appdata':{'type':Sequelize[_0xf4a6('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf4a6('0x1')],'defaultValue':_0xf4a6('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 6d0e62b..36878ae 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0xaa88[_0x187d80];return _0x498a77;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','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','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x5565e4,_0x445522){var _0xab071a=function(_0x2005e5){while(--_0x2005e5){_0x5565e4['push'](_0x5565e4['shift']());}};_0xab071a(++_0x445522);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0xcb91[_0x4599b6];return _0x2e014c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d6cd648..cc3138a 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 _0xbd3b=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','path','rimraf','define','MailApplication'];(function(_0x5b920c,_0x4243ce){var _0x401caf=function(_0x1eb62e){while(--_0x1eb62e){_0x5b920c['push'](_0x5b920c['shift']());}};_0x401caf(++_0x4243ce);}(_0xbd3b,0x18e));var _0xbbd3=function(_0x4ab4a2,_0x41b416){_0x4ab4a2=_0x4ab4a2-0x0;var _0x57f331=_0xbd3b[_0x4ab4a2];return _0x57f331;};'use strict';var _=require('lodash');var util=require(_0xbbd3('0x0'));var logger=require(_0xbbd3('0x1'))('api');var moment=require(_0xbbd3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbd3('0x3'));var rimraf=require(_0xbbd3('0x4'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module['exports']=function(_0x4074bb,_0x2f9ba4){return _0x4074bb[_0xbbd3('0x5')](_0xbbd3('0x6'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbbd3('0x7'),'collate':_0xbbd3('0x8')});}; \ No newline at end of file +var _0xecca=['path','rimraf','exports','define','MailApplication','utf8mb4','util','moment','bluebird','request-promise'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0xecca,0x11e));var _0xaecc=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xecca[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require(_0xaecc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xaecc('0x1'));var BPromise=require(_0xaecc('0x2'));var rp=require(_0xaecc('0x3'));var fs=require('fs');var path=require(_0xaecc('0x4'));var rimraf=require(_0xaecc('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xaecc('0x6')]=function(_0x4cc4ae,_0x36fa83){return _0x4cc4ae[_0xaecc('0x7')](_0xaecc('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaecc('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 62973b8..f203574 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 _0x35a0=['rpc','../../config/environment','jayson/promise','client','request','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','update','options','raw','where','attributes','limit','UpdateMailApplication','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x36d5fa,_0x3861a5){var _0x4e5b14=function(_0x292665){while(--_0x292665){_0x36d5fa['push'](_0x36d5fa['shift']());}};_0x4e5b14(++_0x3861a5);}(_0x35a0,0xff));var _0x035a=function(_0x3d6570,_0x482f5f){_0x3d6570=_0x3d6570-0x0;var _0x30b1c5=_0x35a0[_0x3d6570];return _0x30b1c5;};'use strict';var _=require(_0x035a('0x0'));var util=require('util');var moment=require(_0x035a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x035a('0x2'));var db=require(_0x035a('0x3'))['db'];var utils=require(_0x035a('0x4'));var logger=require('../../config/logger')(_0x035a('0x5'));var config=require(_0x035a('0x6'));var jayson=require(_0x035a('0x7'));var client=jayson[_0x035a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55fa9a,_0x1d7b2e,_0x4146a5){return new BPromise(function(_0x45a505,_0x29ee7b){return client[_0x035a('0x9')](_0x55fa9a,_0x4146a5)['then'](function(_0x47d2f3){logger['info'](_0x035a('0xa'),_0x1d7b2e,_0x035a('0xb'));logger[_0x035a('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1d7b2e,_0x035a('0xb'),JSON[_0x035a('0xd')](_0x47d2f3));if(_0x47d2f3[_0x035a('0xe')]){if(_0x47d2f3[_0x035a('0xe')][_0x035a('0xf')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x1d7b2e,_0x47d2f3[_0x035a('0xe')][_0x035a('0x10')]);return _0x29ee7b(_0x47d2f3[_0x035a('0xe')][_0x035a('0x10')]);}logger[_0x035a('0xe')]('MailApplication,\x20%s,\x20%s',_0x1d7b2e,_0x47d2f3['error']['message']);return _0x45a505(_0x47d2f3[_0x035a('0xe')][_0x035a('0x10')]);}else{logger['info'](_0x035a('0xa'),_0x1d7b2e,'request\x20sent');_0x45a505(_0x47d2f3[_0x035a('0x11')][_0x035a('0x10')]);}})['catch'](function(_0x57e1d6){logger[_0x035a('0xe')](_0x035a('0xa'),_0x1d7b2e,_0x57e1d6);_0x29ee7b(_0x57e1d6);});});}exports['UpdateMailApplication']=function(_0x3080ae){var _0x35f1ea=this;return new Promise(function(_0x182fdf,_0x37768e){return db['MailApplication'][_0x035a('0x12')](_0x3080ae['body'],{'raw':_0x3080ae[_0x035a('0x13')]?_0x3080ae['options'][_0x035a('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3080ae['options']?_0x3080ae[_0x035a('0x13')][_0x035a('0x15')]||null:null,'attributes':_0x3080ae[_0x035a('0x13')]?_0x3080ae[_0x035a('0x13')][_0x035a('0x16')]||null:null,'limit':_0x3080ae['options']?_0x3080ae[_0x035a('0x13')][_0x035a('0x17')]||null:null})['then'](function(_0x764cfd){logger['info'](_0x035a('0x18'),_0x3080ae);logger[_0x035a('0xc')](_0x035a('0x18'),_0x3080ae,JSON[_0x035a('0xd')](_0x764cfd));_0x182fdf(_0x764cfd);})[_0x035a('0x19')](function(_0x1a0287){logger[_0x035a('0xe')](_0x035a('0x18'),_0x1a0287['message'],_0x3080ae);_0x37768e(_0x35f1ea[_0x035a('0xe')](0x1f4,_0x1a0287['message']));});});}; \ No newline at end of file +var _0xc482=['UpdateMailApplication','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','update','body','options','raw','where','attributes','limit','then'];(function(_0x3ee4f0,_0x183cd0){var _0x2fc138=function(_0x2774e6){while(--_0x2774e6){_0x3ee4f0['push'](_0x3ee4f0['shift']());}};_0x2fc138(++_0x183cd0);}(_0xc482,0x1d2));var _0x2c48=function(_0x1c6669,_0x25d82f){_0x1c6669=_0x1c6669-0x0;var _0x261736=_0xc482[_0x1c6669];return _0x261736;};'use strict';var _=require('lodash');var util=require(_0x2c48('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2c48('0x1'));var fs=require('fs');var Redis=require(_0x2c48('0x2'));var db=require(_0x2c48('0x3'))['db'];var utils=require(_0x2c48('0x4'));var logger=require(_0x2c48('0x5'))(_0x2c48('0x6'));var config=require(_0x2c48('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2c48('0x8')][_0x2c48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363631,_0x48dc86,_0x58848f){return new BPromise(function(_0x52391a,_0x49094e){return client[_0x2c48('0xa')](_0x363631,_0x58848f)['then'](function(_0x16a782){logger['info'](_0x2c48('0xb'),_0x48dc86,'request\x20sent');logger[_0x2c48('0xc')](_0x2c48('0xd'),_0x48dc86,_0x2c48('0xe'),JSON[_0x2c48('0xf')](_0x16a782));if(_0x16a782['error']){if(_0x16a782[_0x2c48('0x10')][_0x2c48('0x11')]===0x1f4){logger[_0x2c48('0x10')](_0x2c48('0xb'),_0x48dc86,_0x16a782[_0x2c48('0x10')][_0x2c48('0x12')]);return _0x49094e(_0x16a782[_0x2c48('0x10')][_0x2c48('0x12')]);}logger[_0x2c48('0x10')]('MailApplication,\x20%s,\x20%s',_0x48dc86,_0x16a782['error']['message']);return _0x52391a(_0x16a782[_0x2c48('0x10')]['message']);}else{logger[_0x2c48('0x13')](_0x2c48('0xb'),_0x48dc86,'request\x20sent');_0x52391a(_0x16a782[_0x2c48('0x14')][_0x2c48('0x12')]);}})[_0x2c48('0x15')](function(_0x22b05b){logger[_0x2c48('0x10')](_0x2c48('0xb'),_0x48dc86,_0x22b05b);_0x49094e(_0x22b05b);});});}exports['UpdateMailApplication']=function(_0x351025){var _0x4685f3=this;return new Promise(function(_0x59980b,_0x3e2600){return db['MailApplication'][_0x2c48('0x16')](_0x351025[_0x2c48('0x17')],{'raw':_0x351025[_0x2c48('0x18')]?_0x351025[_0x2c48('0x18')][_0x2c48('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x351025[_0x2c48('0x18')]?_0x351025[_0x2c48('0x18')][_0x2c48('0x1a')]||null:null,'attributes':_0x351025[_0x2c48('0x18')]?_0x351025['options'][_0x2c48('0x1b')]||null:null,'limit':_0x351025[_0x2c48('0x18')]?_0x351025[_0x2c48('0x18')][_0x2c48('0x1c')]||null:null})[_0x2c48('0x1d')](function(_0x2eeeaa){logger['info'](_0x2c48('0x1e'),_0x351025);logger['debug'](_0x2c48('0x1e'),_0x351025,JSON[_0x2c48('0xf')](_0x2eeeaa));_0x59980b(_0x2eeeaa);})['catch'](function(_0x1e2039){logger[_0x2c48('0x10')](_0x2c48('0x1e'),_0x1e2039[_0x2c48('0x12')],_0x351025);_0x3e2600(_0x4685f3[_0x2c48('0x10')](0x1f4,_0x1e2039[_0x2c48('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d500156..02e3c51 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 _0xb41b=['delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xb41b,0xed));var _0xbb41=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb41b[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0xbb41('0x0')]();var auth=require(_0xbb41('0x1'));var interaction=require(_0xbb41('0x2'));var controller=require(_0xbb41('0x3'));router[_0xbb41('0x4')]('/',auth[_0xbb41('0x5')](),controller[_0xbb41('0x6')]);router[_0xbb41('0x4')](_0xbb41('0x7'),auth[_0xbb41('0x5')](),controller['describe']);router['get'](_0xbb41('0x8'),auth['isAuthenticated'](),controller[_0xbb41('0x9')]);router['get'](_0xbb41('0xa'),auth[_0xbb41('0x5')](),controller[_0xbb41('0xb')]);router[_0xbb41('0x4')](_0xbb41('0xc'),auth['isAuthenticated'](),controller[_0xbb41('0xd')]);router[_0xbb41('0xe')]('/',auth['isAuthenticated'](),controller[_0xbb41('0xf')]);router[_0xbb41('0xe')]('/:id/messages',auth[_0xbb41('0x5')](),controller['addMessage']);router[_0xbb41('0xe')](_0xbb41('0x10'),auth[_0xbb41('0x5')](),interaction[_0xbb41('0x11')](_0xbb41('0x12'),_0xbb41('0x13')),controller[_0xbb41('0x14')]);router[_0xbb41('0x15')](_0xbb41('0x8'),auth['isAuthenticated'](),interaction[_0xbb41('0x11')](_0xbb41('0x12'),_0xbb41('0x16')),controller[_0xbb41('0x17')]);router[_0xbb41('0x18')](_0xbb41('0x8'),auth[_0xbb41('0x5')](),interaction[_0xbb41('0x11')](_0xbb41('0x12'),_0xbb41('0x19')),controller[_0xbb41('0x1a')]);router[_0xbb41('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0xbb41('0x1b')]);module[_0xbb41('0x1c')]=router; \ No newline at end of file +var _0x695a=['/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','mail','mailinteraction:update','update','delete','mailinteraction:destroy','exports','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id'];(function(_0x3921c1,_0x551f77){var _0x5def28=function(_0x261b69){while(--_0x261b69){_0x3921c1['push'](_0x3921c1['shift']());}};_0x5def28(++_0x551f77);}(_0x695a,0x130));var _0xa695=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x695a[_0x3ab51d];return _0x29a04e;};'use strict';var express=require('express');var router=express[_0xa695('0x0')]();var auth=require(_0xa695('0x1'));var interaction=require(_0xa695('0x2'));var controller=require('./mailInteraction.controller');router[_0xa695('0x3')]('/',auth[_0xa695('0x4')](),controller['index']);router[_0xa695('0x3')](_0xa695('0x5'),auth[_0xa695('0x4')](),controller[_0xa695('0x6')]);router['get'](_0xa695('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xa695('0x3')](_0xa695('0x8'),auth['isAuthenticated'](),controller[_0xa695('0x9')]);router['get']('/:id/download',auth[_0xa695('0x4')](),controller[_0xa695('0xa')]);router[_0xa695('0xb')]('/',auth['isAuthenticated'](),controller[_0xa695('0xc')]);router[_0xa695('0xb')](_0xa695('0x8'),auth[_0xa695('0x4')](),controller[_0xa695('0xd')]);router['post'](_0xa695('0xe'),auth[_0xa695('0x4')](),interaction[_0xa695('0xf')]('mail',_0xa695('0x10')),controller['addTags']);router[_0xa695('0x11')](_0xa695('0x7'),auth['isAuthenticated'](),interaction[_0xa695('0xf')](_0xa695('0x12'),_0xa695('0x13')),controller[_0xa695('0x14')]);router[_0xa695('0x15')](_0xa695('0x7'),auth[_0xa695('0x4')](),interaction[_0xa695('0xf')](_0xa695('0x12'),_0xa695('0x16')),controller['destroy']);router[_0xa695('0x15')](_0xa695('0xe'),auth[_0xa695('0x4')](),controller['removeTags']);module[_0xa695('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 58c29ee..be8e6e4 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 _0x85d4=['iconv','exports','DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize'];(function(_0x471b84,_0x4c77a0){var _0x910d57=function(_0xf6f11e){while(--_0xf6f11e){_0x471b84['push'](_0x471b84['shift']());}};_0x910d57(++_0x4c77a0);}(_0x85d4,0x167));var _0x485d=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x85d4[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0x485d('0x0'));var iconv=require(_0x485d('0x1'));module[_0x485d('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x485d('0x3')]},'disposition':{'type':Sequelize[_0x485d('0x4')]},'secondDisposition':{'type':Sequelize[_0x485d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x485d('0x4')]},'note':{'type':Sequelize[_0x485d('0x4')]},'inReplyTo':{'type':Sequelize[_0x485d('0x4')](0x1fe)},'to':{'type':Sequelize[_0x485d('0x4')]},'cc':{'type':Sequelize[_0x485d('0x5')](_0x485d('0x6'))},'subject':{'type':Sequelize[_0x485d('0x5')]()},'attach':{'type':Sequelize[_0x485d('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x485d('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x485d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x485d('0x8')]('in',_0x485d('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x485d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x485d('0x8')]('in',_0x485d('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x485d('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xb950=['STRING','TEXT','BOOLEAN','out','ENUM','sequelize','exports','DATE'];(function(_0x4b9413,_0x5f3bd4){var _0x490046=function(_0x5230cb){while(--_0x5230cb){_0x4b9413['push'](_0x4b9413['shift']());}};_0x490046(++_0x5f3bd4);}(_0xb950,0x18d));var _0x0b95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb950[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0b95('0x0'));var iconv=require('iconv');module[_0x0b95('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0b95('0x2')]},'disposition':{'type':Sequelize[_0x0b95('0x3')]},'secondDisposition':{'type':Sequelize[_0x0b95('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0b95('0x3')]},'note':{'type':Sequelize[_0x0b95('0x3')]},'inReplyTo':{'type':Sequelize[_0x0b95('0x3')](0x1fe)},'to':{'type':Sequelize[_0x0b95('0x3')]},'cc':{'type':Sequelize[_0x0b95('0x4')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x0b95('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0b95('0x2')]},'substatus':{'type':Sequelize[_0x0b95('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x0b95('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0b95('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0b95('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0b95('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 1eb3e8f..39453f7 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 _0x0958=['text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','some','compact','isEmpty','MailAccountId','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','role','sequelize','toString','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.attach','i.lastMsgDirection','i.disposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','rows','show','params','includeAll','merge','create','body','describe','addMessage','omit','ids','getMessages','sort','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','true','addTags','spread','emit','removeTags','download','unix','root','server','files','join','transcript-%d-%s.zip','attachments','Attachment','Attachments','Messages','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','squel','juice','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','register','sendStatus','end','status','json','offset','undefined','count','Content-Range','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','catch','talking','answered','unmanaged','total','UserId','waiting','closed','index','MailInteraction','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','type'];(function(_0x46f66b,_0xc91f69){var _0x2754ed=function(_0x5e765c){while(--_0x5e765c){_0x46f66b['push'](_0x46f66b['shift']());}};_0x2754ed(++_0xc91f69);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x8095('0x0'));var rimraf=require(_0x8095('0x1'));var zipdir=require(_0x8095('0x2'));var moment=require('moment');var BPromise=require(_0x8095('0x3'));var util=require(_0x8095('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x8095('0x5'));var juice=require(_0x8095('0x6'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x8095('0x7'));var logger=require(_0x8095('0x8'))(_0x8095('0x9'));var config=require(_0x8095('0xa'));var db=require(_0x8095('0xb'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0x8095('0xc')](config[_0x8095('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8095('0xd')]));require('./mailInteraction.socket')[_0x8095('0xe')](socket);function respondWithStatusCode(_0x2c94a3,_0x206a86){_0x206a86=_0x206a86||0xcc;return function(_0x38982d){if(_0x38982d){return _0x2c94a3[_0x8095('0xf')](_0x206a86);}return _0x2c94a3['status'](_0x206a86)[_0x8095('0x10')]();};}function respondWithResult(_0x48806f,_0x2acacf){_0x2acacf=_0x2acacf||0xc8;return function(_0x4cf53f){if(_0x4cf53f){return _0x48806f[_0x8095('0x11')](_0x2acacf)[_0x8095('0x12')](_0x4cf53f);}};}function respondWithFilteredResult(_0x364980,_0x44417c){return function(_0x5cfc5f){if(_0x5cfc5f){var _0x8f6b26=typeof _0x44417c[_0x8095('0x13')]===_0x8095('0x14')&&typeof _0x44417c['limit']===_0x8095('0x14');var _0x3f446f=_0x5cfc5f[_0x8095('0x15')];var _0xb7c487=_0x8f6b26?0x0:_0x44417c[_0x8095('0x13')];var _0x5ae78f=_0x8f6b26?_0x5cfc5f[_0x8095('0x15')]:_0x44417c[_0x8095('0x13')]+_0x44417c['limit'];var _0x569278;if(_0x5ae78f>=_0x3f446f){_0x5ae78f=_0x3f446f;_0x569278=0xc8;}else{_0x569278=0xce;}_0x364980[_0x8095('0x11')](_0x569278);return _0x364980['set'](_0x8095('0x16'),_0xb7c487+'-'+_0x5ae78f+'/'+_0x3f446f)[_0x8095('0x12')](_0x5cfc5f);}return null;};}function saveUpdates(_0x1bcdf1){return function(_0x554d3e){if(_0x554d3e){return _0x554d3e[_0x8095('0x17')](_0x1bcdf1)[_0x8095('0x18')](function(_0x220b38){return _0x220b38;});}return null;};}function removeEntity(_0x589289){return function(_0x160e67){if(_0x160e67){return _0x160e67[_0x8095('0x19')]()[_0x8095('0x18')](function(){_0x589289['status'](0xcc)[_0x8095('0x10')]();});}};}function handleEntityNotFound(_0x506785){return function(_0x33e106){if(!_0x33e106){_0x506785[_0x8095('0xf')](0x194);}return _0x33e106;};}function handleError(_0x421792,_0x1c97c4){_0x1c97c4=_0x1c97c4||0x1f4;return function(_0x23ac15){logger[_0x8095('0x1a')](_0x23ac15[_0x8095('0x1b')]);if(_0x23ac15[_0x8095('0x1c')]){delete _0x23ac15[_0x8095('0x1c')];}_0x421792[_0x8095('0x11')](_0x1c97c4)[_0x8095('0x1d')](_0x23ac15);};}function getInteractionUsers(_0x3846f9,_0x33397a){return new BPromise(function(_0x28197e,_0x5896f4){try{if(_0x33397a[_0x3846f9['id']]){_0x3846f9['Users']=_[_0x8095('0x1e')](_0x33397a[_0x3846f9['id']],function(_0x190b0a){return{'id':_0x190b0a['id'],'fullname':_0x190b0a[_0x8095('0x1f')]};});}}catch(_0x39cde9){_0x5896f4(_0x39cde9);}_0x28197e(_0x3846f9);});}function getInteractionTags(_0x3bf5ce,_0x14370d){return new BPromise(function(_0x320f4f,_0xe39b50){try{if(_0x3bf5ce[_0x8095('0x20')]){_0x3bf5ce[_0x8095('0x21')]=[];_0x3bf5ce[_0x8095('0x20')][_0x8095('0x22')](',')[_0x8095('0x23')](function(_0x38d932){_0x3bf5ce[_0x8095('0x21')][_0x8095('0x24')](_0x14370d[_0x38d932]);});}delete _0x3bf5ce[_0x8095('0x20')];}catch(_0x575801){_0xe39b50(_0x575801);}_0x320f4f(_0x3bf5ce);});}function getLastMessageText(_0x514d49){return new BPromise(function(_0xfe6090,_0x24caa2){return db[_0x8095('0x25')][_0x8095('0x26')]({'where':{'$and':[{'MailInteractionId':_0x514d49['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x8095('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x8095('0x28')],'order':_0x8095('0x29'),'raw':!![]})['then'](function(_0x551a75){if(_0x551a75&&_0x551a75['plainBody']){_0x514d49[_0x8095('0x2a')]=_['trimStart'](_0x551a75[_0x8095('0x28')]);}_0xfe6090(_0x514d49);})[_0x8095('0x2b')](function(_0x6a7188){_0x24caa2(_0x6a7188);});});}function updateMailInteraction(_0x2a5599,_0x1a8dbd,_0x4f6b55,_0x537d37){return new BPromise(function(_0x5653c7,_0x407eb4){return getInteractionUsers(_0x2a5599,_0x4f6b55)[_0x8095('0x18')](function(_0x167828){return getInteractionTags(_0x167828,_0x1a8dbd);})[_0x8095('0x18')](function(_0x171bb1){return getStateInteraction(_0x171bb1);})['then'](function(_0xf83cdc){if(_0x537d37){_0x5653c7(getLastMessageText(_0xf83cdc));}else{_0x5653c7(_0xf83cdc);}})[_0x8095('0x2b')](function(_0x5b6ca9){_0x407eb4(_0x5b6ca9);});});}function getStateInteraction(_0xfb8912){return new BPromise(function(_0x442383){_0xfb8912['waiting']=0x0;_0xfb8912[_0x8095('0x2c')]=0x0;_0xfb8912[_0x8095('0x2d')]=0x0;_0xfb8912[_0x8095('0x2e')]=0x0;_0xfb8912[_0x8095('0x2f')]=0x0;if(!_0xfb8912['closed']&&!_0xfb8912[_0x8095('0x30')]){_0xfb8912[_0x8095('0x31')]+=0x1;}if(!_0xfb8912[_0x8095('0x32')]&&_0xfb8912[_0x8095('0x30')]){_0xfb8912[_0x8095('0x2c')]+=0x1;if(_0xfb8912[_0x8095('0x31')]){_0xfb8912[_0x8095('0x31')]-=0x1;}}if(_0xfb8912['closed']&&_0xfb8912[_0x8095('0x30')]){_0xfb8912[_0x8095('0x2d')]+=0x1;if(_0xfb8912['talking']){_0xfb8912[_0x8095('0x2c')]-=0x1;}}if(_0xfb8912[_0x8095('0x32')]&&!_0xfb8912[_0x8095('0x30')]){_0xfb8912['unmanaged']+=0x1;if(_0xfb8912[_0x8095('0x31')]){_0xfb8912[_0x8095('0x31')]-=0x1;}}_0xfb8912['total']+=0x1;_0x442383(_0xfb8912);});}exports[_0x8095('0x33')]=function(_0x1b12fe,_0x4808d0){var _0x3a9d72={},_0x5addef={},_0x45722c={'count':0x0,'rows':[]};var _0x4664ed=_[_0x8095('0x1e')](db[_0x8095('0x34')][_0x8095('0x35')],function(_0xcd3880){return{'name':_0xcd3880[_0x8095('0x36')],'type':_0xcd3880['type'][_0x8095('0x37')]};});_0x5addef[_0x8095('0x38')]=_[_0x8095('0x1e')](_0x4664ed,_0x8095('0x1c'));_0x5addef['query']=_[_0x8095('0x39')](_0x1b12fe[_0x8095('0x3a')]);_0x5addef['filters']=_[_0x8095('0x3b')](_0x5addef['model'],_0x5addef[_0x8095('0x3a')]);_0x3a9d72[_0x8095('0x3c')]=_[_0x8095('0x3b')](_0x5addef[_0x8095('0x38')],qs[_0x8095('0x3d')](_0x1b12fe['query']['fields']));_0x3a9d72['attributes']=_0x3a9d72[_0x8095('0x3c')][_0x8095('0x3e')]?_0x3a9d72[_0x8095('0x3c')]:_0x5addef[_0x8095('0x38')];if(!_0x1b12fe[_0x8095('0x3a')][_0x8095('0x3f')](_0x8095('0x40'))){_0x3a9d72[_0x8095('0x41')]=qs[_0x8095('0x41')](_0x1b12fe[_0x8095('0x3a')][_0x8095('0x41')]);_0x3a9d72[_0x8095('0x13')]=qs[_0x8095('0x13')](_0x1b12fe['query'][_0x8095('0x13')]);}_0x3a9d72[_0x8095('0x42')]=qs['sort'](_0x1b12fe[_0x8095('0x3a')]['sort']);_0x3a9d72[_0x8095('0x43')]=qs[_0x8095('0x44')](_[_0x8095('0x45')](_0x1b12fe[_0x8095('0x3a')],_0x5addef[_0x8095('0x44')]),_0x4664ed);var _0x205a2c=[];var _0x3a1486=squel[_0x8095('0x46')]()['field']('id')[_0x8095('0x47')](_0x8095('0x1c'))[_0x8095('0x47')](_0x8095('0x48'))[_0x8095('0x49')](_0x8095('0x4a'));var _0x2b9944=squel[_0x8095('0x46')]()[_0x8095('0x47')](_0x8095('0x4b'))[_0x8095('0x47')](_0x8095('0x4c'))['field'](_0x8095('0x4d'))['from']('user_has_mail_interactions','ui')[_0x8095('0x4e')](_0x8095('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x4b36e4=squel[_0x8095('0x46')]()[_0x8095('0x49')]('mail_interactions','i')[_0x8095('0x4e')](_0x8095('0x50'),'c',_0x8095('0x51'))[_0x8095('0x4e')](_0x8095('0x4f'),'o',_0x8095('0x52'))[_0x8095('0x4e')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x8095('0x4e')]('mail_messages','me',_0x8095('0x53'))['left_join'](_0x8095('0x54'),'it',_0x8095('0x55'))['left_join'](_0x8095('0x4a'),'t',_0x8095('0x56'));var _0x5404bf=squel[_0x8095('0x57')]();var _0x5569cf=[];var _0xb12207=squel['expr']();var _0x2cacd9;if(_0x1b12fe[_0x8095('0x3a')][_0x8095('0x58')]){_0x2cacd9=as[_0x8095('0x59')](_0x1b12fe[_0x8095('0x3a')][_0x8095('0x58')]);var _0x5a0578=_0x2cacd9[_0x8095('0x5a')];for(var _0x33fec2=0x0;_0x33fec2<_0x2cacd9[_0x8095('0x5b')][_0x8095('0x3e')];_0x33fec2++){var _0x142522=_0x2cacd9['conditions'][_0x33fec2];var _0x283722='i';var _0x3f80c0=_[_0x8095('0x5c')](_0x4664ed,[_0x8095('0x1c'),_0x142522[_0x8095('0x47')]]);if(!_0x3f80c0){switch(_0x142522['field']){case _0x8095('0x5d'):if(_0x142522['value']==0x1){_0x4b36e4[_0x8095('0x5e')]('`'+_0x142522['field']+'`\x20=\x200');}else{_0x4b36e4[_0x8095('0x5e')]('`'+_0x142522[_0x8095('0x47')]+_0x8095('0x5f'));}break;case _0x8095('0x60'):if(_0x142522[_0x8095('0x61')]===_0x8095('0x62')){if(_0x142522['value'][_0x8095('0x22')]('\x20')[_0x8095('0x3e')]>0x1){_0x5404bf[_0x5a0578](_0x8095('0x63'),qs[_0x8095('0x64')](_0x142522['value']),null);}else{var _0x2b30d2='%'+_0x142522[_0x8095('0x65')]+'%';_0x5404bf[_0x5a0578]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2b30d2,_0x2b30d2,_0x2b30d2);}}else{_0x3f80c0=_[_0x8095('0x5c')](_0x4664ed,[_0x8095('0x1c'),_0x8095('0x66')]);_0x142522[_0x8095('0x47')]=_0x8095('0x66');_0x545bb9=as[_0x8095('0x67')](_0x283722,_0x3f80c0[_0x8095('0x68')],_0x142522);_0x5404bf[_0x5a0578](_0x545bb9[_0x8095('0x69')],_0x545bb9[_0x8095('0x65')][_0x8095('0x6a')],_0x545bb9[_0x8095('0x65')][_0x8095('0x10')]);}break;case _0x8095('0x6b'):var _0x8f3a36=_0x142522[_0x8095('0x65')][_0x8095('0x22')](',')[_0x8095('0x1e')](function(_0x1dd87d){return Number(_0x1dd87d);});_0x8f3a36[_0x8095('0x23')](function(_0x2506b7){_0xb12207['or'](_0x8095('0x6c'),'%,'+_0x2506b7+',%');});_0x5569cf=_[_0x8095('0x6d')](_0x5569cf,_0x8f3a36);break;case _0x8095('0x6e'):if(_0x142522[_0x8095('0x61')]===_0x8095('0x62')){_0x5404bf[_0x5a0578]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x142522[_0x8095('0x65')]+'%',null);}else{_0x3f80c0=_['find'](_0x4664ed,[_0x8095('0x1c'),_0x8095('0x30')]);_0x142522[_0x8095('0x47')]='UserId';_0x545bb9=as[_0x8095('0x67')](_0x283722,_0x3f80c0[_0x8095('0x68')],_0x142522);_0x5404bf[_0x5a0578](_0x545bb9['text'],_0x545bb9[_0x8095('0x65')][_0x8095('0x6a')],_0x545bb9[_0x8095('0x65')][_0x8095('0x10')]);}break;case'plainBody':_0x545bb9=as[_0x8095('0x67')]('me',null,_0x142522);_0x5404bf[_0x5a0578](_0x545bb9[_0x8095('0x69')],_0x545bb9['value'][_0x8095('0x6a')],_0x545bb9[_0x8095('0x65')][_0x8095('0x10')]);break;}}else{var _0x545bb9=as['buildExpression'](_0x283722,_0x3f80c0['type'],_0x142522);_0x5404bf[_0x5a0578](_0x545bb9[_0x8095('0x69')],_0x545bb9[_0x8095('0x65')][_0x8095('0x6a')],_0x545bb9['value'][_0x8095('0x10')]);}}}else{var _0x4015ed=_(_0x1b12fe['query'])[_0x8095('0x39')]()[_0x8095('0x1e')](function(_0x4d133b){return _[_0x8095('0x6f')](_0x4664ed,['name',_0x4d133b])?_0x4d133b:undefined;})[_0x8095('0x70')]()[_0x8095('0x65')]();if(!_[_0x8095('0x71')](_0x4015ed)){_0x4015ed[_0x8095('0x23')](function(_0x3a8438){if(_0x3a8438===_0x8095('0x72')){_0x4b36e4['where']('i.MailAccountId\x20IN\x20?',[][_0x8095('0x73')](_0x1b12fe[_0x8095('0x3a')][_0x3a8438]));}else if(_0x3a8438===_0x8095('0x74')){var _0x2338dd=JSON[_0x8095('0x75')](_0x1b12fe['query'][_0x3a8438])[_0x8095('0x76')];var _0x521851=JSON['parse'](_0x1b12fe[_0x8095('0x3a')][_0x3a8438])['$lte'];_0x4b36e4[_0x8095('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2338dd,_0x521851);}else{if(_0x1b12fe[_0x8095('0x3a')][_0x3a8438]===_0x8095('0x77')){_0x4b36e4[_0x8095('0x43')]('i.'+_0x3a8438+_0x8095('0x78'));}else{_0x4b36e4[_0x8095('0x43')]('i.'+_0x3a8438+'\x20=\x20?',_0x1b12fe[_0x8095('0x3a')][_0x3a8438]);}}});}if(_0x1b12fe[_0x8095('0x3a')][_0x8095('0x79')]){if(_0x1b12fe['query'][_0x8095('0x79')]==0x1){_0x4b36e4[_0x8095('0x5e')](_0x8095('0x7a'));}else{_0x4b36e4['having'](_0x8095('0x7b'));}}if(_0x1b12fe['query'][_0x8095('0x7c')]){_0x5569cf=_['isArray'](_0x1b12fe['query']['tag'])?_0x1b12fe['query'][_0x8095('0x7c')]:new Array(_0x1b12fe[_0x8095('0x3a')][_0x8095('0x7c')]);_0x5569cf[_0x8095('0x23')](function(_0x9a2240){_0xb12207['or'](_0x8095('0x6c'),'%,'+_0x9a2240+',%');});}if(_0x1b12fe[_0x8095('0x3a')][_0x8095('0x7d')]){var _0x3a40f3=_0x1b12fe['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x8095('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3a40f3)){_0x5404bf['or'](_0x8095('0x7f'),_0x3a40f3+'%');}else if(qs[_0x8095('0x80')](_0x3a40f3)){_0x5404bf['or'](_0x8095('0x81'),_0x3a40f3+'%');}else{_0x5404bf['or'](_0x8095('0x82'),qs[_0x8095('0x64')](_0x3a40f3))['or'](_0x8095('0x83'),qs[_0x8095('0x64')](_0x3a40f3));}}}_0x4b36e4[_0x8095('0x43')](_0x5404bf);_0x4b36e4[_0x8095('0x84')]('i.id');var _0x39e32a={'type':db[_0x8095('0x85')]['QueryTypes'][_0x8095('0x86')],'raw':!![]};var _0xcbf63c=_0x4b36e4[_0x8095('0x87')]();_0xcbf63c['field'](_0x8095('0x88'));_0xcbf63c[_0x8095('0x47')](_0x8095('0x89'),_0x8095('0x5d'));if(_0x3a9d72['order']){_0x3a9d72[_0x8095('0x42')]['forEach'](function(_0x55019c){var _0xcf32df=_0x55019c[0x0]===_0x8095('0x8a')?_0x55019c[0x0]:'i.'+_0x55019c[0x0];_0x4b36e4[_0x8095('0x42')](_0xcf32df,_0x55019c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8095('0x71')](_0x5569cf)){_0x4b36e4[_0x8095('0x5e')](_0xb12207);_0xcbf63c[_0x8095('0x43')](_0x8095('0x8b'),_0x5569cf);}BPromise[_0x8095('0x8c')]()[_0x8095('0x18')](function(){if(!_0x2cacd9){if(_0x1b12fe[_0x8095('0x3a')][_0x8095('0x72')])return;_0xcbf63c[_0x8095('0x43')](_0x8095('0x8d'));_0x4b36e4[_0x8095('0x43')](_0x8095('0x8d'));return;}if(_0x1b12fe[_0x8095('0x8e')]['role']!==_0x8095('0x8f'))return;return _0x1b12fe[_0x8095('0x8e')][_0x8095('0x90')]({'attributes':['id'],'raw':!![]})[_0x8095('0x18')](function(_0x3c54df){if(_['isEmpty'](_0x3c54df)){_0xcbf63c[_0x8095('0x43')](_0x8095('0x91'));_0x4b36e4[_0x8095('0x43')](_0x8095('0x91'));}else{_0xcbf63c['where'](_0x8095('0x92'),_[_0x8095('0x1e')](_0x3c54df,'id'));_0x4b36e4[_0x8095('0x43')](_0x8095('0x92'),_[_0x8095('0x1e')](_0x3c54df,'id'));}});})[_0x8095('0x18')](function(){if(_0x1b12fe[_0x8095('0x8e')][_0x8095('0x93')]==='agent'&&!_0x2cacd9&&!_0x1b12fe[_0x8095('0x3a')][_0x8095('0x72')])return[];return db[_0x8095('0x94')]['query'](_0xcbf63c['toString'](),_0x39e32a);})[_0x8095('0x18')](function(_0x46d849){_0x45722c[_0x8095('0x15')]=_0x46d849[_0x8095('0x3e')];if(_0x45722c[_0x8095('0x15')]===0x0)return[];return db['sequelize'][_0x8095('0x3a')](_0x3a1486[_0x8095('0x95')](),_0x39e32a)[_0x8095('0x18')](function(_0x5085ca){_0x205a2c=_['keyBy'](_0x5085ca,'id');_0x39e32a=_['merge'](_0x39e32a,{'model':db[_0x8095('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1b12fe[_0x8095('0x3a')]['fields']){_0x3a9d72[_0x8095('0x3c')]['forEach'](function(_0x1841a0){_0x4b36e4[_0x8095('0x47')]('i.'+_0x1841a0);});}else{_0x4b36e4[_0x8095('0x47')](_0x8095('0x89'),_0x8095('0x5d'));_0x4b36e4[_0x8095('0x47')]('a.key',_0x8095('0x96'));_0x4b36e4['field'](_0x8095('0x97'),_0x8095('0x98'));_0x4b36e4[_0x8095('0x47')](_0x8095('0x99'),_0x8095('0x8a'));_0x4b36e4[_0x8095('0x47')](_0x8095('0x88'));_0x4b36e4[_0x8095('0x47')](_0x8095('0x9a'));_0x4b36e4[_0x8095('0x47')]('i.updatedAt');_0x4b36e4['field'](_0x8095('0x9b'));_0x4b36e4['field']('i.closedAt');_0x4b36e4['field'](_0x8095('0x9c'));_0x4b36e4[_0x8095('0x47')]('i.lastMsgAt');_0x4b36e4[_0x8095('0x47')](_0x8095('0x9d'));_0x4b36e4[_0x8095('0x47')]('i.subject');_0x4b36e4[_0x8095('0x47')](_0x8095('0x9e'));_0x4b36e4['field']('i.secondDisposition');_0x4b36e4[_0x8095('0x47')](_0x8095('0x9f'));_0x4b36e4['field']('i.substatus');_0x4b36e4[_0x8095('0x47')](_0x8095('0xa0'));_0x4b36e4[_0x8095('0x47')](_0x8095('0xa1'));_0x4b36e4[_0x8095('0x47')](_0x8095('0xa2'));_0x4b36e4[_0x8095('0x47')](_0x8095('0xa3'));_0x4b36e4['field'](_0x8095('0xa4'),_0x8095('0xa5'));_0x4b36e4[_0x8095('0x47')]('c.lastName','Contact.lastName');_0x4b36e4[_0x8095('0x47')](_0x8095('0xa6'),_0x8095('0xa7'));_0x4b36e4[_0x8095('0x47')](_0x8095('0xa8'),'Contact.phone');_0x4b36e4[_0x8095('0x47')]('c.mobile',_0x8095('0xa9'));_0x4b36e4['field'](_0x8095('0xaa'),_0x8095('0xab'));_0x4b36e4['field']('o.fullname',_0x8095('0xac'));_0x4b36e4['field'](_0x8095('0xad'),'Owner.internal');_0x4b36e4[_0x8095('0x47')](_0x8095('0xae'),'TagIds');}if(_0x3a9d72[_0x8095('0x41')])_0x4b36e4['limit'](_0x3a9d72[_0x8095('0x41')]);if(_0x3a9d72[_0x8095('0x13')])_0x4b36e4[_0x8095('0x13')](_0x3a9d72[_0x8095('0x13')]);return db['sequelize']['query'](_0x4b36e4['toString'](),_0x39e32a);})['then'](function(_0x39f096){if(_0x39f096['length']>0x0)_0x2b9944[_0x8095('0x43')](_0x8095('0xaf'),_['map'](_0x39f096,'id'));return db[_0x8095('0x94')]['query'](_0x2b9944[_0x8095('0x95')](),_0x39e32a)[_0x8095('0x18')](function(_0x5a21d4){var _0x7738ee=_['groupBy'](_0x5a21d4,_0x8095('0xb0'));var _0x2a6992=[];return db[_0x8095('0xb1')][_0x8095('0x26')]({'attributes':[_0x8095('0xb2')],'raw':!![]})[_0x8095('0x18')](function(_0x38ce2b){var _0x14b3bd=_0x38ce2b[_0x8095('0xb2')];_0x39f096[_0x8095('0x23')](function(_0x150931){_0x2a6992[_0x8095('0x24')](updateMailInteraction(_0x150931,_0x205a2c,_0x7738ee,_0x14b3bd));});return BPromise['all'](_0x2a6992);});});});})[_0x8095('0x18')](function(_0x37edae){_0x45722c[_0x8095('0xb3')]=_0x37edae;return _0x45722c;})[_0x8095('0x18')](respondWithFilteredResult(_0x4808d0,_0x3a9d72))[_0x8095('0x2b')](handleError(_0x4808d0,null));};exports[_0x8095('0xb4')]=function(_0x283d5f,_0x432f78){var _0x142cd4={'raw':![],'where':{'id':_0x283d5f[_0x8095('0xb5')]['id']}},_0x144e38={};_0x144e38[_0x8095('0x38')]=_[_0x8095('0x39')](db[_0x8095('0x34')]['rawAttributes']);_0x144e38['query']=_[_0x8095('0x39')](_0x283d5f['query']);_0x144e38[_0x8095('0x44')]=_[_0x8095('0x3b')](_0x144e38['model'],_0x144e38[_0x8095('0x3a')]);_0x142cd4['attributes']=_['intersection'](_0x144e38[_0x8095('0x38')],qs[_0x8095('0x3d')](_0x283d5f['query'][_0x8095('0x3d')]));_0x142cd4[_0x8095('0x3c')]=_0x142cd4[_0x8095('0x3c')][_0x8095('0x3e')]?_0x142cd4[_0x8095('0x3c')]:_0x144e38[_0x8095('0x38')];if(_0x283d5f[_0x8095('0x3a')][_0x8095('0xb6')]){_0x142cd4['include']=[{'all':!![]}];}_0x142cd4=_[_0x8095('0xb7')]({},_0x142cd4,_0x283d5f['options']);return db[_0x8095('0x34')][_0x8095('0x5c')](_0x142cd4)[_0x8095('0x18')](handleEntityNotFound(_0x432f78,null))[_0x8095('0x18')](respondWithResult(_0x432f78,null))[_0x8095('0x2b')](handleError(_0x432f78,null));};exports[_0x8095('0xb8')]=function(_0xf10508,_0x4fc4ba){return db[_0x8095('0x34')]['create'](_0xf10508['body'],{})[_0x8095('0x18')](respondWithResult(_0x4fc4ba,0xc9))[_0x8095('0x2b')](handleError(_0x4fc4ba,null));};exports[_0x8095('0x17')]=function(_0x606486,_0x2712f4){if(_0x606486[_0x8095('0xb9')]['id']){delete _0x606486[_0x8095('0xb9')]['id'];}return db[_0x8095('0x34')][_0x8095('0x5c')]({'where':{'id':_0x606486[_0x8095('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2712f4,null))[_0x8095('0x18')](saveUpdates(_0x606486['body'],null))[_0x8095('0x18')](respondWithResult(_0x2712f4,null))['catch'](handleError(_0x2712f4,null));};exports['destroy']=function(_0x5c51f1,_0x39040e){return db[_0x8095('0x34')][_0x8095('0x5c')]({'where':{'id':_0x5c51f1[_0x8095('0xb5')]['id']}})[_0x8095('0x18')](handleEntityNotFound(_0x39040e,null))[_0x8095('0x18')](removeEntity(_0x39040e,null))['catch'](handleError(_0x39040e,null));};exports[_0x8095('0xba')]=function(_0x39c13e,_0xffa96c){return db[_0x8095('0x34')][_0x8095('0xba')]()['then'](respondWithResult(_0xffa96c,null))[_0x8095('0x2b')](handleError(_0xffa96c,null));};exports[_0x8095('0xbb')]=function(_0x39e942,_0x3d2ac8){return db[_0x8095('0x25')][_0x8095('0x5c')]({'where':{'id':_0x39e942['params']['id']}})[_0x8095('0x18')](handleEntityNotFound(_0x3d2ac8,null))[_0x8095('0x18')](function(_0x43c790){if(_0x43c790){return _0x43c790['addMessage'](_0x39e942[_0x8095('0xb9')]['ids'],_[_0x8095('0xbc')](_0x39e942['body'],[_0x8095('0xbd'),'id'])||{});}})[_0x8095('0x18')](respondWithResult(_0x3d2ac8,null))[_0x8095('0x2b')](handleError(_0x3d2ac8,null));};exports[_0x8095('0xbe')]=function(_0x44866e,_0x44fd70){var _0x54102f={'raw':![],'where':{}};var _0x3e6430={};var _0x41a6c8={'count':0x0,'rows':[]};return db[_0x8095('0x34')][_0x8095('0x26')]({'where':{'id':_0x44866e[_0x8095('0xb5')]['id']}})[_0x8095('0x18')](handleEntityNotFound(_0x44fd70,null))[_0x8095('0x18')](function(_0x18a99a){if(_0x18a99a){_0x3e6430[_0x8095('0x38')]=_[_0x8095('0x39')](db[_0x8095('0x25')]['rawAttributes']);_0x3e6430[_0x8095('0x3a')]=_[_0x8095('0x39')](_0x44866e['query']);_0x3e6430[_0x8095('0x44')]=_[_0x8095('0x3b')](_0x3e6430[_0x8095('0x38')],_0x3e6430['query']);_0x54102f[_0x8095('0x3c')]=_[_0x8095('0x3b')](_0x3e6430['model'],qs[_0x8095('0x3d')](_0x44866e['query'][_0x8095('0x3d')]));_0x54102f['attributes']=_0x54102f[_0x8095('0x3c')]['length']?_0x54102f[_0x8095('0x3c')]:_0x3e6430[_0x8095('0x38')];if(!_0x44866e[_0x8095('0x3a')][_0x8095('0x3f')](_0x8095('0x40'))){_0x54102f[_0x8095('0x41')]=qs[_0x8095('0x41')](_0x44866e['query'][_0x8095('0x41')]);_0x54102f[_0x8095('0x13')]=qs[_0x8095('0x13')](_0x44866e['query'][_0x8095('0x13')]);}_0x54102f[_0x8095('0x42')]=qs[_0x8095('0xbf')](_0x44866e['query'][_0x8095('0xbf')]);_0x54102f['where']=qs[_0x8095('0x44')](_[_0x8095('0x45')](_0x44866e[_0x8095('0x3a')],_0x3e6430['filters']));_0x54102f[_0x8095('0x43')][_0x8095('0xb0')]=_0x18a99a['id'];if(_0x44866e[_0x8095('0x3a')]['filter']){_0x54102f[_0x8095('0x43')]=_[_0x8095('0xb7')](_0x54102f[_0x8095('0x43')],{'$or':_['map'](_0x54102f[_0x8095('0x3c')],function(_0x41d7fe){var _0x20b4a8={};_0x20b4a8[_0x41d7fe]={'$like':'%'+_0x44866e['query'][_0x8095('0x7d')]+'%'};return _0x20b4a8;})});}if(_0x44866e[_0x8095('0x3a')][_0x8095('0x76')]){var _0x222b14=_0x44866e[_0x8095('0x3a')][_0x8095('0x76')][_0x8095('0x22')](',');var _0x270ad8={};_0x270ad8[_0x222b14[0x0]]={'$gte':moment(_0x222b14[0x1])[_0x8095('0xc0')](_0x8095('0xc1'))};_0x54102f[_0x8095('0x43')]=_[_0x8095('0xb7')](_0x54102f[_0x8095('0x43')],_0x270ad8);}_0x54102f=_[_0x8095('0xb7')]({},_0x54102f,_0x44866e[_0x8095('0xc2')]);return db[_0x8095('0x25')]['count']({'where':_0x54102f['where']})[_0x8095('0x18')](function(_0x290b8b){_0x41a6c8[_0x8095('0x15')]=_0x290b8b;if(_0x44866e[_0x8095('0x3a')][_0x8095('0xb6')]){_0x54102f[_0x8095('0xc3')]=[{'all':!![]}];}return db[_0x8095('0x25')][_0x8095('0xc4')](_0x54102f);})[_0x8095('0x18')](function(_0xa33b9e){if(_0x44866e[_0x8095('0x3a')]['inlineCss']===_0x8095('0xc5')){for(var _0x555895=0x0;_0x555895<_0xa33b9e[_0x8095('0x3e')];_0x555895++){_0xa33b9e[_0x555895][_0x8095('0xb9')]=juice(_0xa33b9e[_0x555895][_0x8095('0xb9')]);}}_0x41a6c8[_0x8095('0xb3')]=_0xa33b9e;return _0x41a6c8;});}})['then'](respondWithFilteredResult(_0x44fd70,_0x54102f))[_0x8095('0x2b')](handleError(_0x44fd70,null));};exports[_0x8095('0xc6')]=function(_0x4a978b,_0x4c87c6){return db[_0x8095('0x34')][_0x8095('0x5c')]({'where':{'id':_0x4a978b[_0x8095('0xb5')]['id']}})[_0x8095('0x18')](handleEntityNotFound(_0x4c87c6,null))[_0x8095('0x18')](function(_0x3ed292){if(_0x3ed292){return _0x3ed292['setTags'](_0x4a978b[_0x8095('0xb9')][_0x8095('0xbd')],_[_0x8095('0xbc')](_0x4a978b[_0x8095('0xb9')],[_0x8095('0xbd'),'id'])||{})[_0x8095('0xc7')](function(){return db[_0x8095('0x6b')][_0x8095('0xc4')]({'attributes':['id',_0x8095('0x1c'),_0x8095('0x48')],'where':{'id':_0x4a978b[_0x8095('0xb9')][_0x8095('0xbd')]}});})[_0x8095('0x18')](function(_0x365105){socket[_0x8095('0xc8')]('mailInteractionTags:save',{'id':Number(_0x4a978b[_0x8095('0xb5')]['id']),'tags':_0x365105||[]});return{'id':Number(_0x4a978b[_0x8095('0xb5')]['id']),'tags':_0x365105||[]};});}})['then'](respondWithResult(_0x4c87c6,null))['catch'](handleError(_0x4c87c6,null));};exports['removeTags']=function(_0x941345,_0x34c585){return db[_0x8095('0x34')][_0x8095('0x5c')]({'where':{'id':_0x941345[_0x8095('0xb5')]['id']}})[_0x8095('0x18')](handleEntityNotFound(_0x34c585,null))[_0x8095('0x18')](function(_0x1015db){if(_0x1015db){return _0x1015db[_0x8095('0xc9')](_0x941345[_0x8095('0x3a')][_0x8095('0xbd')]);}})[_0x8095('0x18')](respondWithStatusCode(_0x34c585,null))[_0x8095('0x2b')](handleError(_0x34c585,null));};exports[_0x8095('0xca')]=function(_0x3e161c,_0x86bf3f){var _0x5c494f=moment()[_0x8095('0xcb')]()[_0x8095('0x95')]();var _0x4ea7c0=path['join'](config[_0x8095('0xcc')],_0x8095('0xcd'),_0x8095('0xce'),'tmp');var _0x564820=path[_0x8095('0xcf')](config[_0x8095('0xcc')],_0x8095('0xcd'),'files','attachments');var _0x16fd11=path[_0x8095('0xcf')](_0x4ea7c0,_0x5c494f);var _0x39fe8f=util[_0x8095('0xc0')](_0x8095('0xd0'),_0x3e161c['params']['id'],_0x5c494f);var _0x5486ca=path[_0x8095('0xcf')](_0x4ea7c0,_0x39fe8f);var _0x3be804=[];if(_0x3e161c[_0x8095('0x3a')][_0x8095('0xd1')]){_0x3be804[_0x8095('0x24')]({'model':db[_0x8095('0xd2')],'as':_0x8095('0xd3'),'raw':!![]});}var _0x2e9c1f=[{'model':db[_0x8095('0x25')],'as':_0x8095('0xd4'),'attributes':['id',_0x8095('0xb9'),_0x8095('0x49'),'to','cc','bcc','subject',_0x8095('0x74')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x3be804}];return db['MailInteraction']['find']({'where':{'id':_0x3e161c[_0x8095('0xb5')]['id']},'include':_0x2e9c1f})[_0x8095('0x18')](handleEntityNotFound(_0x86bf3f,null))[_0x8095('0x18')](function(_0x25b22b){if(_0x25b22b&&_0x25b22b[_0x8095('0xd4')]){var _0x39068d=_0x25b22b[_0x8095('0xd5')]({'plain':!![]});fs[_0x8095('0xd6')](_0x16fd11);return BPromise[_0x8095('0xd7')](_0x39068d[_0x8095('0xd4')],function(_0xc16b7a,_0xa041dd){var _0xe4599d={'from':_0xc16b7a[_0x8095('0x49')],'to':_0xc16b7a['to'],'subject':_0xc16b7a[_0x8095('0xd8')],'html':htmlEntities[_0x8095('0xd9')](_0xc16b7a['body']),'headers':{'Date':moment(_0xc16b7a['createdAt'])['format'](_0x8095('0xda'))},'attachments':[]};if(_0xc16b7a['cc']){_0xe4599d['headers']['Cc']=_0xc16b7a['cc'];}if(_0xc16b7a[_0x8095('0xdb')]){_0xe4599d[_0x8095('0xdc')][_0x8095('0xdd')]=_0xc16b7a[_0x8095('0xdb')];}return new BPromise(function(_0xa8805,_0xbcc4ed){if(_0xc16b7a[_0x8095('0xd3')]){for(var _0x3c19f2=0x0;_0x3c19f2<_0xc16b7a[_0x8095('0xd3')][_0x8095('0x3e')];_0x3c19f2++){var _0x1ce35c=_0xc16b7a[_0x8095('0xd3')][_0x3c19f2];var _0x19e20d=path[_0x8095('0xcf')](_0x564820,_0x1ce35c[_0x8095('0xde')]);if(fs[_0x8095('0xdf')](_0x19e20d)){_0xe4599d[_0x8095('0xd1')][_0x8095('0x24')]({'name':_0x1ce35c[_0x8095('0x1c')],'contentType':_0x1ce35c[_0x8095('0x68')],'data':fs[_0x8095('0xe0')](_0x19e20d)});}}}emlformat[_0x8095('0xe1')](_0xe4599d,function(_0x170401,_0x2f7206){if(_0x170401)return _0xbcc4ed(_0x170401);fs[_0x8095('0xe2')](path[_0x8095('0xcf')](_0x16fd11,util[_0x8095('0xc0')](_0x8095('0xe3'),_0xa041dd)),_0x2f7206);return _0xa8805(_0x2f7206);});});})[_0x8095('0x18')](function(){return new BPromise(function(_0x3ad3d3,_0x47ebd1){zipdir(_0x16fd11,{'saveTo':_0x5486ca},function(_0x137ee1,_0x37c09d){if(_0x137ee1)return _0x47ebd1(_0x137ee1);return _0x3ad3d3(_0x37c09d);});})[_0x8095('0x18')](function(){return new BPromise(function(_0x53fba0,_0x4245b9){rimraf(_0x16fd11,function(_0x513064){if(_0x513064)_0x4245b9(_0x513064);return _0x53fba0();});});})[_0x8095('0x18')](function(){return _0x86bf3f[_0x8095('0xca')](_0x5486ca,_0x39fe8f,function(_0x137994){if(!_0x137994)fs[_0x8095('0xe4')](_0x5486ca);});});});}else{return _0x86bf3f[_0x8095('0xf')](0xc8);}})[_0x8095('0x2b')](handleError(_0x86bf3f,null));}; \ No newline at end of file +var _0x2c8f=['model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.fullname','ui.MailInteractionId','left_join','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','having','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','unreadMessages','order','contactName','DESC','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','sequelize','merge','MailInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','push','all','show','keys','intersection','include','options','create','body','params','describe','addMessage','ids','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','rows','setTags','omit','spread','findAll','mailInteractionTags:save','removeTags','download','join','root','server','files','tmp','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','decode','headers','Bcc','basename','existsSync','readFileSync','message%d.eml','unlinkSync','rimraf','util','path','lodash','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','rawAttributes','type','key'];(function(_0x57fcd6,_0x70b457){var _0x5b6c73=function(_0x366b6a){while(--_0x366b6a){_0x57fcd6['push'](_0x57fcd6['shift']());}};_0x5b6c73(++_0x70b457);}(_0x2c8f,0x192));var _0xf2c8=function(_0x5c681b,_0x203c14){_0x5c681b=_0x5c681b-0x0;var _0x267823=_0x2c8f[_0x5c681b];return _0x267823;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2c8('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xf2c8('0x1'));var path=require(_0xf2c8('0x2'));var fs=require('fs');var _=require(_0xf2c8('0x3'));var squel=require('squel');var juice=require('juice');var Redis=require(_0xf2c8('0x4'));var qs=require(_0xf2c8('0x5'));var as=require(_0xf2c8('0x6'));var logger=require(_0xf2c8('0x7'))(_0xf2c8('0x8'));var config=require('../../config/environment');var db=require(_0xf2c8('0x9'))['db'];var htmlEntities=require(_0xf2c8('0xa'));config[_0xf2c8('0xb')]=_[_0xf2c8('0xc')](config[_0xf2c8('0xb')],{'host':_0xf2c8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2c8('0xb')]));require(_0xf2c8('0xe'))[_0xf2c8('0xf')](socket);function respondWithStatusCode(_0x22eacb,_0x174c79){_0x174c79=_0x174c79||0xcc;return function(_0x3ba8f5){if(_0x3ba8f5){return _0x22eacb[_0xf2c8('0x10')](_0x174c79);}return _0x22eacb[_0xf2c8('0x11')](_0x174c79)['end']();};}function respondWithResult(_0xd90704,_0x5ce572){_0x5ce572=_0x5ce572||0xc8;return function(_0x10bc2c){if(_0x10bc2c){return _0xd90704[_0xf2c8('0x11')](_0x5ce572)[_0xf2c8('0x12')](_0x10bc2c);}};}function respondWithFilteredResult(_0x46d0c6,_0x37db9b){return function(_0x40849c){if(_0x40849c){var _0x54dd36=typeof _0x37db9b[_0xf2c8('0x13')]===_0xf2c8('0x14')&&typeof _0x37db9b[_0xf2c8('0x15')]===_0xf2c8('0x14');var _0x3ed09e=_0x40849c[_0xf2c8('0x16')];var _0x1b8c5b=_0x54dd36?0x0:_0x37db9b['offset'];var _0x282094=_0x54dd36?_0x40849c[_0xf2c8('0x16')]:_0x37db9b[_0xf2c8('0x13')]+_0x37db9b[_0xf2c8('0x15')];var _0xe1ec71;if(_0x282094>=_0x3ed09e){_0x282094=_0x3ed09e;_0xe1ec71=0xc8;}else{_0xe1ec71=0xce;}_0x46d0c6['status'](_0xe1ec71);return _0x46d0c6['set'](_0xf2c8('0x17'),_0x1b8c5b+'-'+_0x282094+'/'+_0x3ed09e)[_0xf2c8('0x12')](_0x40849c);}return null;};}function saveUpdates(_0x2c6d7a){return function(_0x283ecf){if(_0x283ecf){return _0x283ecf['update'](_0x2c6d7a)[_0xf2c8('0x18')](function(_0x100542){return _0x100542;});}return null;};}function removeEntity(_0x197435){return function(_0x47b5e4){if(_0x47b5e4){return _0x47b5e4[_0xf2c8('0x19')]()[_0xf2c8('0x18')](function(){_0x197435['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43505f){return function(_0x3e7ceb){if(!_0x3e7ceb){_0x43505f[_0xf2c8('0x10')](0x194);}return _0x3e7ceb;};}function handleError(_0x57affa,_0xd2e728){_0xd2e728=_0xd2e728||0x1f4;return function(_0x43763e){logger[_0xf2c8('0x1a')](_0x43763e[_0xf2c8('0x1b')]);if(_0x43763e['name']){delete _0x43763e[_0xf2c8('0x1c')];}_0x57affa[_0xf2c8('0x11')](_0xd2e728)[_0xf2c8('0x1d')](_0x43763e);};}function getInteractionUsers(_0x440b41,_0x16938e){return new BPromise(function(_0x4d0e56,_0x93707c){try{if(_0x16938e[_0x440b41['id']]){_0x440b41['Users']=_[_0xf2c8('0x1e')](_0x16938e[_0x440b41['id']],function(_0x2e2305){return{'id':_0x2e2305['id'],'fullname':_0x2e2305[_0xf2c8('0x1f')]};});}}catch(_0x3bb777){_0x93707c(_0x3bb777);}_0x4d0e56(_0x440b41);});}function getInteractionTags(_0x1d2e74,_0x3160a5){return new BPromise(function(_0x3ffd20,_0x132343){try{if(_0x1d2e74[_0xf2c8('0x20')]){_0x1d2e74[_0xf2c8('0x21')]=[];_0x1d2e74[_0xf2c8('0x20')][_0xf2c8('0x22')](',')[_0xf2c8('0x23')](function(_0x4e12a2){_0x1d2e74[_0xf2c8('0x21')]['push'](_0x3160a5[_0x4e12a2]);});}delete _0x1d2e74['TagIds'];}catch(_0x3df45d){_0x132343(_0x3df45d);}_0x3ffd20(_0x1d2e74);});}function getLastMessageText(_0x48bcf9){return new BPromise(function(_0x3e9e8a,_0x3b7e23){return db[_0xf2c8('0x24')][_0xf2c8('0x25')]({'where':{'$and':[{'MailInteractionId':_0x48bcf9['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf2c8('0x26')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf2c8('0x27')],'order':_0xf2c8('0x28'),'raw':!![]})['then'](function(_0x27c02e){if(_0x27c02e&&_0x27c02e[_0xf2c8('0x27')]){_0x48bcf9[_0xf2c8('0x29')]=_[_0xf2c8('0x2a')](_0x27c02e[_0xf2c8('0x27')]);}_0x3e9e8a(_0x48bcf9);})[_0xf2c8('0x2b')](function(_0x5e0b43){_0x3b7e23(_0x5e0b43);});});}function updateMailInteraction(_0x104b3e,_0x5d530b,_0x3a01db,_0x4abc1e){return new BPromise(function(_0x25238f,_0x1da275){return getInteractionUsers(_0x104b3e,_0x3a01db)[_0xf2c8('0x18')](function(_0xf58eb3){return getInteractionTags(_0xf58eb3,_0x5d530b);})[_0xf2c8('0x18')](function(_0x5b6e0b){return getStateInteraction(_0x5b6e0b);})[_0xf2c8('0x18')](function(_0x1927bd){if(_0x4abc1e){_0x25238f(getLastMessageText(_0x1927bd));}else{_0x25238f(_0x1927bd);}})['catch'](function(_0x309232){_0x1da275(_0x309232);});});}function getStateInteraction(_0x23f6be){return new BPromise(function(_0x4a24e8){_0x23f6be[_0xf2c8('0x2c')]=0x0;_0x23f6be[_0xf2c8('0x2d')]=0x0;_0x23f6be[_0xf2c8('0x2e')]=0x0;_0x23f6be[_0xf2c8('0x2f')]=0x0;_0x23f6be[_0xf2c8('0x30')]=0x0;if(!_0x23f6be['closed']&&!_0x23f6be['UserId']){_0x23f6be[_0xf2c8('0x2c')]+=0x1;}if(!_0x23f6be[_0xf2c8('0x31')]&&_0x23f6be[_0xf2c8('0x32')]){_0x23f6be[_0xf2c8('0x2d')]+=0x1;if(_0x23f6be[_0xf2c8('0x2c')]){_0x23f6be[_0xf2c8('0x2c')]-=0x1;}}if(_0x23f6be[_0xf2c8('0x31')]&&_0x23f6be[_0xf2c8('0x32')]){_0x23f6be['answered']+=0x1;if(_0x23f6be[_0xf2c8('0x2d')]){_0x23f6be[_0xf2c8('0x2d')]-=0x1;}}if(_0x23f6be[_0xf2c8('0x31')]&&!_0x23f6be['UserId']){_0x23f6be['unmanaged']+=0x1;if(_0x23f6be['waiting']){_0x23f6be['waiting']-=0x1;}}_0x23f6be[_0xf2c8('0x30')]+=0x1;_0x4a24e8(_0x23f6be);});}exports['index']=function(_0x219318,_0x4b312b){var _0x372733={},_0x4d06da={},_0x5ac2dc={'count':0x0,'rows':[]};var _0x5cff24=_[_0xf2c8('0x1e')](db['MailInteraction'][_0xf2c8('0x33')],function(_0x93284c){return{'name':_0x93284c['fieldName'],'type':_0x93284c[_0xf2c8('0x34')][_0xf2c8('0x35')]};});_0x4d06da[_0xf2c8('0x36')]=_[_0xf2c8('0x1e')](_0x5cff24,_0xf2c8('0x1c'));_0x4d06da[_0xf2c8('0x37')]=_['keys'](_0x219318['query']);_0x4d06da[_0xf2c8('0x38')]=_['intersection'](_0x4d06da[_0xf2c8('0x36')],_0x4d06da['query']);_0x372733[_0xf2c8('0x39')]=_['intersection'](_0x4d06da[_0xf2c8('0x36')],qs[_0xf2c8('0x3a')](_0x219318[_0xf2c8('0x37')][_0xf2c8('0x3a')]));_0x372733['attributes']=_0x372733[_0xf2c8('0x39')][_0xf2c8('0x3b')]?_0x372733['attributes']:_0x4d06da[_0xf2c8('0x36')];if(!_0x219318[_0xf2c8('0x37')][_0xf2c8('0x3c')](_0xf2c8('0x3d'))){_0x372733[_0xf2c8('0x15')]=qs[_0xf2c8('0x15')](_0x219318[_0xf2c8('0x37')]['limit']);_0x372733[_0xf2c8('0x13')]=qs[_0xf2c8('0x13')](_0x219318[_0xf2c8('0x37')][_0xf2c8('0x13')]);}_0x372733['order']=qs['sort'](_0x219318[_0xf2c8('0x37')][_0xf2c8('0x3e')]);_0x372733[_0xf2c8('0x3f')]=qs['filters'](_[_0xf2c8('0x40')](_0x219318[_0xf2c8('0x37')],_0x4d06da['filters']),_0x5cff24);var _0x574476=[];var _0x1ecb56=squel[_0xf2c8('0x41')]()[_0xf2c8('0x42')]('id')[_0xf2c8('0x42')]('name')[_0xf2c8('0x42')](_0xf2c8('0x43'))[_0xf2c8('0x44')]('tools_tags');var _0xc78712=squel[_0xf2c8('0x41')]()[_0xf2c8('0x42')]('u.id')[_0xf2c8('0x42')](_0xf2c8('0x45'))[_0xf2c8('0x42')](_0xf2c8('0x46'))[_0xf2c8('0x44')]('user_has_mail_interactions','ui')[_0xf2c8('0x47')]('users','u','u.id\x20=\x20ui.UserId');var _0x168acb=squel[_0xf2c8('0x41')]()[_0xf2c8('0x44')](_0xf2c8('0x48'),'i')[_0xf2c8('0x47')]('cm_contacts','c',_0xf2c8('0x49'))[_0xf2c8('0x47')](_0xf2c8('0x4a'),'o',_0xf2c8('0x4b'))[_0xf2c8('0x47')](_0xf2c8('0x4c'),'a','a.id\x20=\x20i.MailAccountId')['left_join'](_0xf2c8('0x4d'),'me',_0xf2c8('0x4e'))[_0xf2c8('0x47')](_0xf2c8('0x4f'),'it',_0xf2c8('0x50'))[_0xf2c8('0x47')](_0xf2c8('0x51'),'t',_0xf2c8('0x52'));var _0x585cd3=squel[_0xf2c8('0x53')]();var _0x144483=[];var _0x5ebf58=squel['expr']();var _0x155fdb;if(_0x219318[_0xf2c8('0x37')]['search']){_0x155fdb=as[_0xf2c8('0x54')](_0x219318[_0xf2c8('0x37')][_0xf2c8('0x55')]);var _0x50ef02=_0x155fdb[_0xf2c8('0x56')];for(var _0x34cfc4=0x0;_0x34cfc4<_0x155fdb[_0xf2c8('0x57')][_0xf2c8('0x3b')];_0x34cfc4++){var _0x3b33fb=_0x155fdb[_0xf2c8('0x57')][_0x34cfc4];var _0x39e9e7='i';var _0x1b74e2=_['find'](_0x5cff24,[_0xf2c8('0x1c'),_0x3b33fb[_0xf2c8('0x42')]]);if(!_0x1b74e2){switch(_0x3b33fb[_0xf2c8('0x42')]){case'unreadMessages':if(_0x3b33fb['value']==0x1){_0x168acb[_0xf2c8('0x58')]('`'+_0x3b33fb[_0xf2c8('0x42')]+'`\x20=\x200');}else{_0x168acb[_0xf2c8('0x58')]('`'+_0x3b33fb['field']+'`\x20>\x200');}break;case _0xf2c8('0x59'):if(_0x3b33fb[_0xf2c8('0x5a')]==='$substring'){if(_0x3b33fb[_0xf2c8('0x5b')][_0xf2c8('0x22')]('\x20')[_0xf2c8('0x3b')]>0x1){_0x585cd3[_0x50ef02](_0xf2c8('0x5c'),qs[_0xf2c8('0x5d')](_0x3b33fb['value']),null);}else{var _0x19dc1b='%'+_0x3b33fb[_0xf2c8('0x5b')]+'%';_0x585cd3[_0x50ef02]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x19dc1b,_0x19dc1b,_0x19dc1b);}}else{_0x1b74e2=_[_0xf2c8('0x5e')](_0x5cff24,['name',_0xf2c8('0x5f')]);_0x3b33fb[_0xf2c8('0x42')]=_0xf2c8('0x5f');_0x443e06=as[_0xf2c8('0x60')](_0x39e9e7,_0x1b74e2[_0xf2c8('0x34')],_0x3b33fb);_0x585cd3[_0x50ef02](_0x443e06[_0xf2c8('0x61')],_0x443e06['value'][_0xf2c8('0x62')],_0x443e06[_0xf2c8('0x5b')][_0xf2c8('0x63')]);}break;case _0xf2c8('0x64'):var _0x3f8933=_0x3b33fb['value'][_0xf2c8('0x22')](',')[_0xf2c8('0x1e')](function(_0x10747d){return Number(_0x10747d);});_0x3f8933[_0xf2c8('0x23')](function(_0x4e11e5){_0x5ebf58['or'](_0xf2c8('0x65'),'%,'+_0x4e11e5+',%');});_0x144483=_[_0xf2c8('0x66')](_0x144483,_0x3f8933);break;case _0xf2c8('0x67'):if(_0x3b33fb[_0xf2c8('0x5a')]===_0xf2c8('0x68')){_0x585cd3[_0x50ef02](_0xf2c8('0x69'),'%'+_0x3b33fb[_0xf2c8('0x5b')]+'%',null);}else{_0x1b74e2=_[_0xf2c8('0x5e')](_0x5cff24,[_0xf2c8('0x1c'),'UserId']);_0x3b33fb[_0xf2c8('0x42')]=_0xf2c8('0x32');_0x443e06=as['buildExpression'](_0x39e9e7,_0x1b74e2[_0xf2c8('0x34')],_0x3b33fb);_0x585cd3[_0x50ef02](_0x443e06[_0xf2c8('0x61')],_0x443e06['value'][_0xf2c8('0x62')],_0x443e06[_0xf2c8('0x5b')][_0xf2c8('0x63')]);}break;case _0xf2c8('0x27'):_0x443e06=as['buildExpression']('me',null,_0x3b33fb);_0x585cd3[_0x50ef02](_0x443e06['text'],_0x443e06[_0xf2c8('0x5b')]['start'],_0x443e06[_0xf2c8('0x5b')][_0xf2c8('0x63')]);break;}}else{var _0x443e06=as[_0xf2c8('0x60')](_0x39e9e7,_0x1b74e2[_0xf2c8('0x34')],_0x3b33fb);_0x585cd3[_0x50ef02](_0x443e06[_0xf2c8('0x61')],_0x443e06['value'][_0xf2c8('0x62')],_0x443e06[_0xf2c8('0x5b')]['end']);}}}else{var _0x3fc45d=_(_0x219318[_0xf2c8('0x37')])['keys']()[_0xf2c8('0x1e')](function(_0x5c8557){return _[_0xf2c8('0x6a')](_0x5cff24,[_0xf2c8('0x1c'),_0x5c8557])?_0x5c8557:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x3fc45d)){_0x3fc45d[_0xf2c8('0x23')](function(_0x182df0){if(_0x182df0===_0xf2c8('0x6b')){_0x168acb[_0xf2c8('0x3f')](_0xf2c8('0x6c'),[][_0xf2c8('0x6d')](_0x219318['query'][_0x182df0]));}else if(_0x182df0===_0xf2c8('0x6e')){var _0x373d14=JSON[_0xf2c8('0x6f')](_0x219318[_0xf2c8('0x37')][_0x182df0])['$gte'];var _0x5b0b51=JSON[_0xf2c8('0x6f')](_0x219318[_0xf2c8('0x37')][_0x182df0])[_0xf2c8('0x70')];_0x168acb[_0xf2c8('0x3f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x373d14,_0x5b0b51);}else{if(_0x219318['query'][_0x182df0]===_0xf2c8('0x71')){_0x168acb[_0xf2c8('0x3f')]('i.'+_0x182df0+_0xf2c8('0x72'));}else{_0x168acb[_0xf2c8('0x3f')]('i.'+_0x182df0+'\x20=\x20?',_0x219318['query'][_0x182df0]);}}});}if(_0x219318[_0xf2c8('0x37')][_0xf2c8('0x73')]){if(_0x219318[_0xf2c8('0x37')][_0xf2c8('0x73')]==0x1){_0x168acb[_0xf2c8('0x58')](_0xf2c8('0x74'));}else{_0x168acb['having'](_0xf2c8('0x75'));}}if(_0x219318[_0xf2c8('0x37')]['tag']){_0x144483=_[_0xf2c8('0x76')](_0x219318['query'][_0xf2c8('0x77')])?_0x219318['query'][_0xf2c8('0x77')]:new Array(_0x219318[_0xf2c8('0x37')][_0xf2c8('0x77')]);_0x144483[_0xf2c8('0x23')](function(_0x2a3d84){_0x5ebf58['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a3d84+',%');});}if(_0x219318['query']['filter']){var _0xe24149=_0x219318[_0xf2c8('0x37')][_0xf2c8('0x78')]['replace']('\x5c','\x5c\x5c')[_0xf2c8('0x79')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xe24149)){_0x585cd3['or'](_0xf2c8('0x7a'),_0xe24149+'%');}else if(qs['isEmail'](_0xe24149)){_0x585cd3['or'](_0xf2c8('0x7b'),_0xe24149+'%');}else{_0x585cd3['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf2c8('0x5d')](_0xe24149))['or'](_0xf2c8('0x7c'),qs[_0xf2c8('0x5d')](_0xe24149));}}}_0x168acb[_0xf2c8('0x3f')](_0x585cd3);_0x168acb[_0xf2c8('0x7d')](_0xf2c8('0x7e'));var _0xb3f69a={'type':db[_0xf2c8('0x7f')]['QueryTypes'][_0xf2c8('0x80')],'raw':!![]};var _0x4f3522=_0x168acb[_0xf2c8('0x81')]();_0x4f3522['field']('i.id');_0x4f3522['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf2c8('0x82'));if(_0x372733[_0xf2c8('0x83')]){_0x372733[_0xf2c8('0x83')][_0xf2c8('0x23')](function(_0x58529d){var _0x344b9d=_0x58529d[0x0]===_0xf2c8('0x84')?_0x58529d[0x0]:'i.'+_0x58529d[0x0];_0x168acb[_0xf2c8('0x83')](_0x344b9d,_0x58529d[0x1]===_0xf2c8('0x85')?![]:!![]);});}if(!_['isEmpty'](_0x144483)){_0x168acb[_0xf2c8('0x58')](_0x5ebf58);_0x4f3522[_0xf2c8('0x3f')]('t.id\x20IN\x20?',_0x144483);}BPromise['resolve']()[_0xf2c8('0x18')](function(){if(!_0x155fdb){if(_0x219318[_0xf2c8('0x37')][_0xf2c8('0x6b')])return;_0x4f3522[_0xf2c8('0x3f')](_0xf2c8('0x86'));_0x168acb[_0xf2c8('0x3f')](_0xf2c8('0x86'));return;}if(_0x219318['user'][_0xf2c8('0x87')]!==_0xf2c8('0x88'))return;return _0x219318[_0xf2c8('0x89')][_0xf2c8('0x8a')]({'attributes':['id'],'raw':!![]})[_0xf2c8('0x18')](function(_0x9966cc){if(_['isEmpty'](_0x9966cc)){_0x4f3522[_0xf2c8('0x3f')](_0xf2c8('0x8b'));_0x168acb[_0xf2c8('0x3f')](_0xf2c8('0x8b'));}else{_0x4f3522[_0xf2c8('0x3f')](_0xf2c8('0x6c'),_['map'](_0x9966cc,'id'));_0x168acb[_0xf2c8('0x3f')](_0xf2c8('0x6c'),_[_0xf2c8('0x1e')](_0x9966cc,'id'));}});})[_0xf2c8('0x18')](function(){if(_0x219318[_0xf2c8('0x89')]['role']===_0xf2c8('0x88')&&!_0x155fdb&&!_0x219318[_0xf2c8('0x37')][_0xf2c8('0x6b')])return[];return db['sequelize'][_0xf2c8('0x37')](_0x4f3522[_0xf2c8('0x8c')](),_0xb3f69a);})[_0xf2c8('0x18')](function(_0x47bf36){_0x5ac2dc[_0xf2c8('0x16')]=_0x47bf36['length'];if(_0x5ac2dc['count']===0x0)return[];return db[_0xf2c8('0x8d')]['query'](_0x1ecb56[_0xf2c8('0x8c')](),_0xb3f69a)[_0xf2c8('0x18')](function(_0x295f52){_0x574476=_['keyBy'](_0x295f52,'id');_0xb3f69a=_[_0xf2c8('0x8e')](_0xb3f69a,{'model':db[_0xf2c8('0x8f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x219318[_0xf2c8('0x37')][_0xf2c8('0x3a')]){_0x372733[_0xf2c8('0x39')][_0xf2c8('0x23')](function(_0x8acd72){_0x168acb[_0xf2c8('0x42')]('i.'+_0x8acd72);});}else{_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x90'),_0xf2c8('0x82'));_0x168acb['field']('a.key',_0xf2c8('0x91'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x92'),_0xf2c8('0x93'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x94'),_0xf2c8('0x84'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x7e'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x95'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x96'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x97'));_0x168acb['field'](_0xf2c8('0x98'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x99'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x9a'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x9b'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x9c'));_0x168acb[_0xf2c8('0x42')]('i.disposition');_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x9d'));_0x168acb[_0xf2c8('0x42')]('i.thirdDisposition');_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x9e'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0x9f'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0xa0'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0xa1'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0xa2'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0xa3'),'Contact.firstName');_0x168acb['field'](_0xf2c8('0xa4'),_0xf2c8('0xa5'));_0x168acb[_0xf2c8('0x42')]('c.email',_0xf2c8('0xa6'));_0x168acb[_0xf2c8('0x42')]('c.phone',_0xf2c8('0xa7'));_0x168acb['field']('c.mobile',_0xf2c8('0xa8'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0xa9'),_0xf2c8('0xaa'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0xab'),_0xf2c8('0xac'));_0x168acb['field'](_0xf2c8('0xad'),_0xf2c8('0xae'));_0x168acb[_0xf2c8('0x42')](_0xf2c8('0xaf'),_0xf2c8('0x20'));}if(_0x372733['limit'])_0x168acb[_0xf2c8('0x15')](_0x372733[_0xf2c8('0x15')]);if(_0x372733[_0xf2c8('0x13')])_0x168acb['offset'](_0x372733['offset']);return db[_0xf2c8('0x8d')][_0xf2c8('0x37')](_0x168acb[_0xf2c8('0x8c')](),_0xb3f69a);})[_0xf2c8('0x18')](function(_0x3c41d9){if(_0x3c41d9['length']>0x0)_0xc78712['where'](_0xf2c8('0xb0'),_['map'](_0x3c41d9,'id'));return db[_0xf2c8('0x8d')][_0xf2c8('0x37')](_0xc78712[_0xf2c8('0x8c')](),_0xb3f69a)[_0xf2c8('0x18')](function(_0x293299){var _0x249f73=_['groupBy'](_0x293299,_0xf2c8('0xb1'));var _0x11c173=[];return db[_0xf2c8('0xb2')]['findOne']({'attributes':[_0xf2c8('0xb3')],'raw':!![]})[_0xf2c8('0x18')](function(_0x1e5a35){var _0x14a486=_0x1e5a35['enableEmailPreview'];_0x3c41d9['forEach'](function(_0x42bdc4){_0x11c173[_0xf2c8('0xb4')](updateMailInteraction(_0x42bdc4,_0x574476,_0x249f73,_0x14a486));});return BPromise[_0xf2c8('0xb5')](_0x11c173);});});});})[_0xf2c8('0x18')](function(_0x7f1b1c){_0x5ac2dc['rows']=_0x7f1b1c;return _0x5ac2dc;})[_0xf2c8('0x18')](respondWithFilteredResult(_0x4b312b,_0x372733))['catch'](handleError(_0x4b312b,null));};exports[_0xf2c8('0xb6')]=function(_0x4087f5,_0x4935db){var _0x72b3da={'raw':![],'where':{'id':_0x4087f5['params']['id']}},_0x212c4a={};_0x212c4a[_0xf2c8('0x36')]=_['keys'](db[_0xf2c8('0x8f')][_0xf2c8('0x33')]);_0x212c4a[_0xf2c8('0x37')]=_[_0xf2c8('0xb7')](_0x4087f5[_0xf2c8('0x37')]);_0x212c4a[_0xf2c8('0x38')]=_[_0xf2c8('0xb8')](_0x212c4a[_0xf2c8('0x36')],_0x212c4a['query']);_0x72b3da['attributes']=_[_0xf2c8('0xb8')](_0x212c4a[_0xf2c8('0x36')],qs[_0xf2c8('0x3a')](_0x4087f5[_0xf2c8('0x37')]['fields']));_0x72b3da[_0xf2c8('0x39')]=_0x72b3da[_0xf2c8('0x39')][_0xf2c8('0x3b')]?_0x72b3da['attributes']:_0x212c4a['model'];if(_0x4087f5[_0xf2c8('0x37')]['includeAll']){_0x72b3da[_0xf2c8('0xb9')]=[{'all':!![]}];}_0x72b3da=_[_0xf2c8('0x8e')]({},_0x72b3da,_0x4087f5[_0xf2c8('0xba')]);return db['MailInteraction'][_0xf2c8('0x5e')](_0x72b3da)[_0xf2c8('0x18')](handleEntityNotFound(_0x4935db,null))['then'](respondWithResult(_0x4935db,null))[_0xf2c8('0x2b')](handleError(_0x4935db,null));};exports['create']=function(_0x15c5bc,_0x594dd2){return db[_0xf2c8('0x8f')][_0xf2c8('0xbb')](_0x15c5bc[_0xf2c8('0xbc')],{})[_0xf2c8('0x18')](respondWithResult(_0x594dd2,0xc9))[_0xf2c8('0x2b')](handleError(_0x594dd2,null));};exports['update']=function(_0x3084c4,_0x3beebf){if(_0x3084c4['body']['id']){delete _0x3084c4[_0xf2c8('0xbc')]['id'];}return db[_0xf2c8('0x8f')][_0xf2c8('0x5e')]({'where':{'id':_0x3084c4[_0xf2c8('0xbd')]['id']}})[_0xf2c8('0x18')](handleEntityNotFound(_0x3beebf,null))['then'](saveUpdates(_0x3084c4[_0xf2c8('0xbc')],null))[_0xf2c8('0x18')](respondWithResult(_0x3beebf,null))[_0xf2c8('0x2b')](handleError(_0x3beebf,null));};exports[_0xf2c8('0x19')]=function(_0x907478,_0x304a28){return db['MailInteraction'][_0xf2c8('0x5e')]({'where':{'id':_0x907478[_0xf2c8('0xbd')]['id']}})[_0xf2c8('0x18')](handleEntityNotFound(_0x304a28,null))['then'](removeEntity(_0x304a28,null))[_0xf2c8('0x2b')](handleError(_0x304a28,null));};exports['describe']=function(_0x4229b5,_0x3981a5){return db[_0xf2c8('0x8f')][_0xf2c8('0xbe')]()[_0xf2c8('0x18')](respondWithResult(_0x3981a5,null))['catch'](handleError(_0x3981a5,null));};exports[_0xf2c8('0xbf')]=function(_0x44b502,_0x4fb2c1){return db[_0xf2c8('0x24')][_0xf2c8('0x5e')]({'where':{'id':_0x44b502[_0xf2c8('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4fb2c1,null))[_0xf2c8('0x18')](function(_0x3994ed){if(_0x3994ed){return _0x3994ed[_0xf2c8('0xbf')](_0x44b502[_0xf2c8('0xbc')][_0xf2c8('0xc0')],_['omit'](_0x44b502[_0xf2c8('0xbc')],[_0xf2c8('0xc0'),'id'])||{});}})[_0xf2c8('0x18')](respondWithResult(_0x4fb2c1,null))[_0xf2c8('0x2b')](handleError(_0x4fb2c1,null));};exports['getMessages']=function(_0x573f68,_0x5bc52a){var _0x58b68d={'raw':![],'where':{}};var _0x4dce83={};var _0x4db53d={'count':0x0,'rows':[]};return db[_0xf2c8('0x8f')][_0xf2c8('0x25')]({'where':{'id':_0x573f68[_0xf2c8('0xbd')]['id']}})['then'](handleEntityNotFound(_0x5bc52a,null))[_0xf2c8('0x18')](function(_0x3dd78c){if(_0x3dd78c){_0x4dce83[_0xf2c8('0x36')]=_[_0xf2c8('0xb7')](db[_0xf2c8('0x24')][_0xf2c8('0x33')]);_0x4dce83[_0xf2c8('0x37')]=_[_0xf2c8('0xb7')](_0x573f68[_0xf2c8('0x37')]);_0x4dce83[_0xf2c8('0x38')]=_[_0xf2c8('0xb8')](_0x4dce83['model'],_0x4dce83[_0xf2c8('0x37')]);_0x58b68d['attributes']=_[_0xf2c8('0xb8')](_0x4dce83[_0xf2c8('0x36')],qs['fields'](_0x573f68[_0xf2c8('0x37')][_0xf2c8('0x3a')]));_0x58b68d[_0xf2c8('0x39')]=_0x58b68d['attributes']['length']?_0x58b68d[_0xf2c8('0x39')]:_0x4dce83['model'];if(!_0x573f68['query']['hasOwnProperty']('nolimit')){_0x58b68d['limit']=qs[_0xf2c8('0x15')](_0x573f68[_0xf2c8('0x37')]['limit']);_0x58b68d['offset']=qs[_0xf2c8('0x13')](_0x573f68[_0xf2c8('0x37')]['offset']);}_0x58b68d[_0xf2c8('0x83')]=qs[_0xf2c8('0x3e')](_0x573f68[_0xf2c8('0x37')][_0xf2c8('0x3e')]);_0x58b68d[_0xf2c8('0x3f')]=qs[_0xf2c8('0x38')](_[_0xf2c8('0x40')](_0x573f68['query'],_0x4dce83[_0xf2c8('0x38')]));_0x58b68d[_0xf2c8('0x3f')][_0xf2c8('0xb1')]=_0x3dd78c['id'];if(_0x573f68['query'][_0xf2c8('0x78')]){_0x58b68d[_0xf2c8('0x3f')]=_[_0xf2c8('0x8e')](_0x58b68d[_0xf2c8('0x3f')],{'$or':_[_0xf2c8('0x1e')](_0x58b68d[_0xf2c8('0x39')],function(_0x329e4a){var _0x5bd56c={};_0x5bd56c[_0x329e4a]={'$like':'%'+_0x573f68[_0xf2c8('0x37')][_0xf2c8('0x78')]+'%'};return _0x5bd56c;})});}if(_0x573f68[_0xf2c8('0x37')][_0xf2c8('0xc1')]){var _0x4bc170=_0x573f68[_0xf2c8('0x37')][_0xf2c8('0xc1')][_0xf2c8('0x22')](',');var _0xc29c9b={};_0xc29c9b[_0x4bc170[0x0]]={'$gte':moment(_0x4bc170[0x1])[_0xf2c8('0xc2')](_0xf2c8('0xc3'))};_0x58b68d[_0xf2c8('0x3f')]=_[_0xf2c8('0x8e')](_0x58b68d[_0xf2c8('0x3f')],_0xc29c9b);}_0x58b68d=_[_0xf2c8('0x8e')]({},_0x58b68d,_0x573f68[_0xf2c8('0xba')]);return db[_0xf2c8('0x24')][_0xf2c8('0x16')]({'where':_0x58b68d['where']})[_0xf2c8('0x18')](function(_0x291d61){_0x4db53d[_0xf2c8('0x16')]=_0x291d61;if(_0x573f68['query'][_0xf2c8('0xc4')]){_0x58b68d[_0xf2c8('0xb9')]=[{'all':!![]}];}return db[_0xf2c8('0x24')]['findAll'](_0x58b68d);})[_0xf2c8('0x18')](function(_0x2daee9){if(_0x573f68['query'][_0xf2c8('0xc5')]===_0xf2c8('0xc6')){for(var _0x8554f7=0x0;_0x8554f7<_0x2daee9[_0xf2c8('0x3b')];_0x8554f7++){_0x2daee9[_0x8554f7][_0xf2c8('0xbc')]=juice(_0x2daee9[_0x8554f7]['body']);}}_0x4db53d[_0xf2c8('0xc7')]=_0x2daee9;return _0x4db53d;});}})[_0xf2c8('0x18')](respondWithFilteredResult(_0x5bc52a,_0x58b68d))[_0xf2c8('0x2b')](handleError(_0x5bc52a,null));};exports['addTags']=function(_0x1f8b25,_0x253ac3){return db[_0xf2c8('0x8f')][_0xf2c8('0x5e')]({'where':{'id':_0x1f8b25[_0xf2c8('0xbd')]['id']}})[_0xf2c8('0x18')](handleEntityNotFound(_0x253ac3,null))[_0xf2c8('0x18')](function(_0x2584f7){if(_0x2584f7){return _0x2584f7[_0xf2c8('0xc8')](_0x1f8b25['body'][_0xf2c8('0xc0')],_[_0xf2c8('0xc9')](_0x1f8b25['body'],[_0xf2c8('0xc0'),'id'])||{})[_0xf2c8('0xca')](function(){return db[_0xf2c8('0x64')][_0xf2c8('0xcb')]({'attributes':['id',_0xf2c8('0x1c'),_0xf2c8('0x43')],'where':{'id':_0x1f8b25[_0xf2c8('0xbc')][_0xf2c8('0xc0')]}});})['then'](function(_0x3583f8){socket['emit'](_0xf2c8('0xcc'),{'id':Number(_0x1f8b25[_0xf2c8('0xbd')]['id']),'tags':_0x3583f8||[]});return{'id':Number(_0x1f8b25[_0xf2c8('0xbd')]['id']),'tags':_0x3583f8||[]};});}})['then'](respondWithResult(_0x253ac3,null))['catch'](handleError(_0x253ac3,null));};exports[_0xf2c8('0xcd')]=function(_0x40893f,_0x48522c){return db[_0xf2c8('0x8f')]['find']({'where':{'id':_0x40893f[_0xf2c8('0xbd')]['id']}})['then'](handleEntityNotFound(_0x48522c,null))[_0xf2c8('0x18')](function(_0x24ef21){if(_0x24ef21){return _0x24ef21[_0xf2c8('0xcd')](_0x40893f[_0xf2c8('0x37')][_0xf2c8('0xc0')]);}})[_0xf2c8('0x18')](respondWithStatusCode(_0x48522c,null))[_0xf2c8('0x2b')](handleError(_0x48522c,null));};exports[_0xf2c8('0xce')]=function(_0x430e75,_0x2fa8a9){var _0x236754=moment()['unix']()['toString']();var _0x30b569=path[_0xf2c8('0xcf')](config[_0xf2c8('0xd0')],_0xf2c8('0xd1'),_0xf2c8('0xd2'),_0xf2c8('0xd3'));var _0x42bb2a=path[_0xf2c8('0xcf')](config[_0xf2c8('0xd0')],_0xf2c8('0xd1'),_0xf2c8('0xd2'),'attachments');var _0x48eeb5=path[_0xf2c8('0xcf')](_0x30b569,_0x236754);var _0x49eafa=util[_0xf2c8('0xc2')](_0xf2c8('0xd4'),_0x430e75[_0xf2c8('0xbd')]['id'],_0x236754);var _0x4dccc2=path['join'](_0x30b569,_0x49eafa);var _0x22785e=[];if(_0x430e75[_0xf2c8('0x37')]['attachments']){_0x22785e[_0xf2c8('0xb4')]({'model':db[_0xf2c8('0xd5')],'as':_0xf2c8('0xd6'),'raw':!![]});}var _0x4de363=[{'model':db['MailMessage'],'as':_0xf2c8('0xd7'),'attributes':['id','body',_0xf2c8('0x44'),'to','cc',_0xf2c8('0xd8'),_0xf2c8('0xd9'),_0xf2c8('0x6e')],'where':{'secret':![]},'order':qs[_0xf2c8('0x3e')]('id'),'include':_0x22785e}];return db['MailInteraction'][_0xf2c8('0x5e')]({'where':{'id':_0x430e75[_0xf2c8('0xbd')]['id']},'include':_0x4de363})[_0xf2c8('0x18')](handleEntityNotFound(_0x2fa8a9,null))[_0xf2c8('0x18')](function(_0x17bee3){if(_0x17bee3&&_0x17bee3[_0xf2c8('0xd7')]){var _0x41a4a9=_0x17bee3[_0xf2c8('0xda')]({'plain':!![]});fs[_0xf2c8('0xdb')](_0x48eeb5);return BPromise['each'](_0x41a4a9[_0xf2c8('0xd7')],function(_0x54944f,_0x360c7b){var _0x19d45e={'from':_0x54944f[_0xf2c8('0x44')],'to':_0x54944f['to'],'subject':_0x54944f[_0xf2c8('0xd9')],'html':htmlEntities[_0xf2c8('0xdc')](_0x54944f['body']),'headers':{'Date':moment(_0x54944f[_0xf2c8('0x6e')])[_0xf2c8('0xc2')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x54944f['cc']){_0x19d45e[_0xf2c8('0xdd')]['Cc']=_0x54944f['cc'];}if(_0x54944f[_0xf2c8('0xd8')]){_0x19d45e[_0xf2c8('0xdd')][_0xf2c8('0xde')]=_0x54944f[_0xf2c8('0xd8')];}return new BPromise(function(_0x28de3a,_0x25caa4){if(_0x54944f['Attachments']){for(var _0x1723c8=0x0;_0x1723c8<_0x54944f[_0xf2c8('0xd6')][_0xf2c8('0x3b')];_0x1723c8++){var _0x5569a1=_0x54944f[_0xf2c8('0xd6')][_0x1723c8];var _0x31882e=path[_0xf2c8('0xcf')](_0x42bb2a,_0x5569a1[_0xf2c8('0xdf')]);if(fs[_0xf2c8('0xe0')](_0x31882e)){_0x19d45e['attachments'][_0xf2c8('0xb4')]({'name':_0x5569a1[_0xf2c8('0x1c')],'contentType':_0x5569a1[_0xf2c8('0x34')],'data':fs[_0xf2c8('0xe1')](_0x31882e)});}}}emlformat['build'](_0x19d45e,function(_0x6bc3fd,_0x43eebe){if(_0x6bc3fd)return _0x25caa4(_0x6bc3fd);fs['writeFileSync'](path[_0xf2c8('0xcf')](_0x48eeb5,util[_0xf2c8('0xc2')](_0xf2c8('0xe2'),_0x360c7b)),_0x43eebe);return _0x28de3a(_0x43eebe);});});})[_0xf2c8('0x18')](function(){return new BPromise(function(_0x37f329,_0x5c1763){zipdir(_0x48eeb5,{'saveTo':_0x4dccc2},function(_0x3cf141,_0x210fcc){if(_0x3cf141)return _0x5c1763(_0x3cf141);return _0x37f329(_0x210fcc);});})['then'](function(){return new BPromise(function(_0x3cc479,_0xa34c18){rimraf(_0x48eeb5,function(_0xe6aa26){if(_0xe6aa26)_0xa34c18(_0xe6aa26);return _0x3cc479();});});})[_0xf2c8('0x18')](function(){return _0x2fa8a9[_0xf2c8('0xce')](_0x4dccc2,_0x49eafa,function(_0x2e888d){if(!_0x2e888d)fs[_0xf2c8('0xe3')](_0x4dccc2);});});});}else{return _0x2fa8a9[_0xf2c8('0x10')](0xc8);}})[_0xf2c8('0x2b')](handleError(_0x2fa8a9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 63f1091..e383378 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 _0xa84e=['then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers'];(function(_0x38b957,_0x4f4df0){var _0x2a8e06=function(_0x15ee87){while(--_0x15ee87){_0x38b957['push'](_0x38b957['shift']());}};_0x2a8e06(++_0x4f4df0);}(_0xa84e,0x184));var _0xea84=function(_0xbe41ba,_0x384563){_0xbe41ba=_0xbe41ba-0x0;var _0x2c2085=_0xa84e[_0xbe41ba];return _0x2c2085;};'use strict';var EventEmitter=require(_0xea84('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xea84('0x1')];var MailMessage=require(_0xea84('0x2'))['db'][_0xea84('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xea84('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea84('0x5'),'afterDestroy':_0xea84('0x6')};function emitEvent(_0x482bed){return function(_0x1fd609,_0x58737d,_0x36da34){_0x1fd609[_0xea84('0x7')]({'attributes':['id'],'raw':!![]})[_0xea84('0x8')](function(_0x2e67a3){_0x1fd609[_0xea84('0x9')](_0xea84('0xa'),_0x2e67a3['map'](function(_0x2859bf){return{'id':_0x2859bf['id']};}));return MailMessage[_0xea84('0xb')]({'where':{'MailInteractionId':_0x1fd609['id'],'direction':'in','read':![]},'raw':!![]});})[_0xea84('0x8')](function(_0x35ddaa){_0x1fd609['setDataValue'](_0xea84('0xc'),_0x35ddaa[_0xea84('0xd')]);MailInteractionEvents[_0xea84('0xe')](_0x482bed+':'+_0x1fd609['id'],_0x1fd609);MailInteractionEvents[_0xea84('0xe')](_0x482bed,_0x1fd609);_0x36da34(null);})[_0xea84('0xf')](_0x36da34(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xea84('0x10')](e,emitEvent(event));}}module[_0xea84('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x681c=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0x681c,0xea));var _0xc681=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x681c[_0x29b609];return _0x54c952;};'use strict';var EventEmitter=require(_0xc681('0x0'));var MailInteraction=require(_0xc681('0x1'))['db'][_0xc681('0x2')];var MailMessage=require(_0xc681('0x1'))['db'][_0xc681('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc681('0x4')](0x0);var events={'afterCreate':_0xc681('0x5'),'afterUpdate':_0xc681('0x6'),'afterDestroy':_0xc681('0x7')};function emitEvent(_0x54d966){return function(_0x7a22da,_0x3dd004,_0x5b50aa){_0x7a22da['getUsers']({'attributes':['id'],'raw':!![]})[_0xc681('0x8')](function(_0x53658f){_0x7a22da[_0xc681('0x9')](_0xc681('0xa'),_0x53658f[_0xc681('0xb')](function(_0x1ad0a5){return{'id':_0x1ad0a5['id']};}));return MailMessage[_0xc681('0xc')]({'where':{'MailInteractionId':_0x7a22da['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc681('0x8')](function(_0x595bed){_0x7a22da[_0xc681('0x9')]('unreadMessages',_0x595bed['length']);MailInteractionEvents[_0xc681('0xd')](_0x54d966+':'+_0x7a22da['id'],_0x7a22da);MailInteractionEvents[_0xc681('0xd')](_0x54d966,_0x7a22da);_0x5b50aa(null);})[_0xc681('0xe')](_0x5b50aa(null));};}for(var e in events){if(events[_0xc681('0xf')](e)){var event=events[e];MailInteraction[_0xc681('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8c8bb2f..df611cb 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 _0xdb21=['api','request-promise','path','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','get','MailMessage','update','utf8mb4','lodash','util'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0xdb21,0x67));var _0x1db2=function(_0x3fab8d,_0x3a43e0){_0x3fab8d=_0x3fab8d-0x0;var _0x652a13=_0xdb21[_0x3fab8d];return _0x652a13;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var logger=require('../../config/logger')(_0x1db2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1db2('0x3'));var fs=require('fs');var path=require(_0x1db2('0x4'));var rimraf=require('rimraf');var config=require(_0x1db2('0x5'));var attributes=require(_0x1db2('0x6'));module['exports']=function(_0x173237,_0x3b4f9f){return _0x173237[_0x1db2('0x7')](_0x1db2('0x8'),attributes,{'tableName':_0x1db2('0x9'),'paranoid':![],'indexes':[{'name':_0x1db2('0xa'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30957d,_0x4873e4,_0x49a174){if(_0x30957d[_0x1db2('0xb')]){_0x30957d[_0x1db2('0xc')]=moment()[_0x1db2('0xd')](_0x1db2('0xe'));}if(_0x30957d[_0x1db2('0xf')]){_0x30957d[_0x1db2('0x10')]=moment()[_0x1db2('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x49a174(null,_0x4873e4);},'beforeUpdate':function(_0x47f7e3,_0x5ef676,_0x16eb39){if(_0x47f7e3['changed'](_0x1db2('0xb'))){_0x47f7e3[_0x1db2('0xc')]=_0x47f7e3[_0x1db2('0xb')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x47f7e3['changed'](_0x1db2('0xf'))){_0x47f7e3['closedAt']=moment()[_0x1db2('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x47f7e3[_0x1db2('0xb')]=null;_0x47f7e3[_0x1db2('0xc')]=null;}_0x16eb39(null,_0x47f7e3);},'afterUpdate':function(_0x4e488c,_0x1fda12,_0x333ec3){var _0x21160a=_0x173237['models'];var _0x14d6ed=_0x4e488c[_0x1db2('0x11')]({'plain':!![]});if(_0x14d6ed[_0x1db2('0xf')]){return _0x21160a[_0x1db2('0x12')][_0x1db2('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x14d6ed['id']}})['then'](function(){_0x333ec3();})['catch'](function(_0xc2a9d0){_0x333ec3(_0xc2a9d0);});}else{_0x333ec3();}}},'charset':_0x1db2('0x14'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5131=['substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus'];(function(_0x1a990c,_0x5c43a6){var _0x282a13=function(_0x839484){while(--_0x839484){_0x1a990c['push'](_0x1a990c['shift']());}};_0x282a13(++_0x5c43a6);}(_0x5131,0xa3));var _0x1513=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5131[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require(_0x1513('0x0'));var logger=require(_0x1513('0x1'))(_0x1513('0x2'));var moment=require(_0x1513('0x3'));var BPromise=require(_0x1513('0x4'));var rp=require(_0x1513('0x5'));var fs=require('fs');var path=require(_0x1513('0x6'));var rimraf=require(_0x1513('0x7'));var config=require('../../config/environment');var attributes=require(_0x1513('0x8'));module[_0x1513('0x9')]=function(_0x29ca85,_0x39b887){return _0x29ca85[_0x1513('0xa')](_0x1513('0xb'),attributes,{'tableName':_0x1513('0xc'),'paranoid':![],'indexes':[{'name':_0x1513('0xd'),'fields':[_0x1513('0xe'),'to'],'type':_0x1513('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5eac9c,_0x2dc0b5,_0x4c8747){if(_0x5eac9c[_0x1513('0x10')]){_0x5eac9c[_0x1513('0x11')]=moment()[_0x1513('0x12')](_0x1513('0x13'));}if(_0x5eac9c['closed']){_0x5eac9c[_0x1513('0x14')]=moment()[_0x1513('0x12')](_0x1513('0x13'));}_0x4c8747(null,_0x2dc0b5);},'beforeUpdate':function(_0x3fc278,_0x85c494,_0x1141be){if(_0x3fc278[_0x1513('0x15')]('substatus')){_0x3fc278[_0x1513('0x11')]=_0x3fc278['substatus']?moment()[_0x1513('0x12')](_0x1513('0x13')):null;}if(_0x3fc278[_0x1513('0x15')](_0x1513('0x16'))){_0x3fc278[_0x1513('0x14')]=moment()[_0x1513('0x12')](_0x1513('0x13'));_0x3fc278[_0x1513('0x10')]=null;_0x3fc278[_0x1513('0x11')]=null;}_0x1141be(null,_0x3fc278);},'afterUpdate':function(_0x258342,_0x3ec797,_0x114132){var _0x30b2f3=_0x29ca85[_0x1513('0x17')];var _0x4fbb02=_0x258342['get']({'plain':!![]});if(_0x4fbb02[_0x1513('0x16')]){return _0x30b2f3[_0x1513('0x18')][_0x1513('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x4fbb02['id']}})[_0x1513('0x1a')](function(){_0x114132();})[_0x1513('0x1b')](function(_0x387169){_0x114132(_0x387169);});}else{_0x114132();}}},'charset':_0x1513('0x1c'),'collate':_0x1513('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 09a30da..4b09cd1 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 _0x5f4a=['ids','omit','spread','AddTags','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailInteraction','update','options','raw','where','attributes','UpdateMailInteraction','AddTagsToMailInteraction','addTags','body'];(function(_0x482b33,_0x3d4d3e){var _0x30fc48=function(_0x5463ae){while(--_0x5463ae){_0x482b33['push'](_0x482b33['shift']());}};_0x30fc48(++_0x3d4d3e);}(_0x5f4a,0x1bc));var _0xa5f4=function(_0x4bb719,_0x2fbaf3){_0x4bb719=_0x4bb719-0x0;var _0x369811=_0x5f4a[_0x4bb719];return _0x369811;};'use strict';var _=require(_0xa5f4('0x0'));var util=require(_0xa5f4('0x1'));var moment=require('moment');var BPromise=require(_0xa5f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa5f4('0x3'))(_0xa5f4('0x4'));var config=require(_0xa5f4('0x5'));var jayson=require(_0xa5f4('0x6'));var client=jayson[_0xa5f4('0x7')][_0xa5f4('0x8')]({'port':0x232a});config[_0xa5f4('0x9')]=_[_0xa5f4('0xa')](config[_0xa5f4('0x9')],{'host':_0xa5f4('0xb'),'port':0x18eb});var socket=require(_0xa5f4('0xc'))(new Redis(config[_0xa5f4('0x9')]));require('./mailInteraction.socket')[_0xa5f4('0xd')](socket);function respondWithRpcPromise(_0x605b81,_0x2cbb24,_0x94848d){return new BPromise(function(_0xd3324a,_0x5bbdb6){return client[_0xa5f4('0xe')](_0x605b81,_0x94848d)[_0xa5f4('0xf')](function(_0x2424f1){logger[_0xa5f4('0x10')](_0xa5f4('0x11'),_0x2cbb24,_0xa5f4('0x12'));logger[_0xa5f4('0x13')](_0xa5f4('0x14'),_0x2cbb24,_0xa5f4('0x12'),JSON[_0xa5f4('0x15')](_0x2424f1));if(_0x2424f1[_0xa5f4('0x16')]){if(_0x2424f1[_0xa5f4('0x16')][_0xa5f4('0x17')]===0x1f4){logger[_0xa5f4('0x16')](_0xa5f4('0x11'),_0x2cbb24,_0x2424f1[_0xa5f4('0x16')][_0xa5f4('0x18')]);return _0x5bbdb6(_0x2424f1[_0xa5f4('0x16')][_0xa5f4('0x18')]);}logger[_0xa5f4('0x16')](_0xa5f4('0x11'),_0x2cbb24,_0x2424f1['error'][_0xa5f4('0x18')]);return _0xd3324a(_0x2424f1[_0xa5f4('0x16')][_0xa5f4('0x18')]);}else{logger[_0xa5f4('0x10')]('MailInteraction,\x20%s,\x20%s',_0x2cbb24,_0xa5f4('0x12'));_0xd3324a(_0x2424f1['result'][_0xa5f4('0x18')]);}})[_0xa5f4('0x19')](function(_0x20061e){logger[_0xa5f4('0x16')](_0xa5f4('0x11'),_0x2cbb24,_0x20061e);_0x5bbdb6(_0x20061e);});});}exports['UpdateMailInteraction']=function(_0x34836f){var _0x1f4e4f=this;return new Promise(function(_0x13f8e3,_0x3f308f){return db[_0xa5f4('0x1a')][_0xa5f4('0x1b')](_0x34836f['body'],{'raw':_0x34836f[_0xa5f4('0x1c')]?_0x34836f[_0xa5f4('0x1c')][_0xa5f4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34836f['options']?_0x34836f[_0xa5f4('0x1c')][_0xa5f4('0x1e')]||null:null,'attributes':_0x34836f['options']?_0x34836f['options'][_0xa5f4('0x1f')]||null:null,'limit':_0x34836f[_0xa5f4('0x1c')]?_0x34836f['options']['limit']||null:null})[_0xa5f4('0xf')](function(_0x2538ec){logger[_0xa5f4('0x10')](_0xa5f4('0x20'),_0x34836f);logger['debug'](_0xa5f4('0x20'),_0x34836f,JSON[_0xa5f4('0x15')](_0x2538ec));_0x13f8e3(_0x2538ec);})['catch'](function(_0x29d318){logger['error'](_0xa5f4('0x20'),_0x29d318[_0xa5f4('0x18')],_0x34836f);_0x3f308f(_0x1f4e4f[_0xa5f4('0x16')](0x1f4,_0x29d318[_0xa5f4('0x18')]));});});};exports[_0xa5f4('0x21')]=function(_0x41a6aa){return new Promise(function(_0x1b9c10,_0x3837d7){return db['MailInteraction']['find']({'where':_0x41a6aa[_0xa5f4('0x1c')]?_0x41a6aa['options'][_0xa5f4('0x1e')]||null:null})[_0xa5f4('0xf')](function(_0xf40c98){if(_0xf40c98){return _0xf40c98[_0xa5f4('0x22')](_0x41a6aa[_0xa5f4('0x23')][_0xa5f4('0x24')],_[_0xa5f4('0x25')](_0x41a6aa[_0xa5f4('0x23')],['ids','id'])||{});}})[_0xa5f4('0x26')](function(_0xc57097){logger[_0xa5f4('0x10')](_0xa5f4('0x27'),_0x41a6aa);logger[_0xa5f4('0x13')](_0xa5f4('0x27'),_0x41a6aa,JSON[_0xa5f4('0x15')](_0xc57097));_0x1b9c10(_0xc57097);})[_0xa5f4('0x19')](function(_0x1ba67c){logger['error'](_0xa5f4('0x27'),_0x1ba67c['message'],_0x41a6aa);_0x3837d7(_this['error'](0x1f4,_0x1ba67c[_0xa5f4('0x18')]));});});}; \ No newline at end of file +var _0x2f78=['options','attributes','find','where','addTags','body','ids','omit','spread','AddTags','debug','stringify','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','code','error','MailInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateMailInteraction','update'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x2f78,0xa8));var _0x82f7=function(_0x1d9e65,_0x489805){_0x1d9e65=_0x1d9e65-0x0;var _0x21dac4=_0x2f78[_0x1d9e65];return _0x21dac4;};'use strict';var _=require(_0x82f7('0x0'));var util=require('util');var moment=require(_0x82f7('0x1'));var BPromise=require(_0x82f7('0x2'));var rs=require(_0x82f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x82f7('0x4'));var logger=require(_0x82f7('0x5'))(_0x82f7('0x6'));var config=require(_0x82f7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x82f7('0x8')][_0x82f7('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x82f7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x82f7('0xb'))(new Redis(config['redis']));require(_0x82f7('0xc'))[_0x82f7('0xd')](socket);function respondWithRpcPromise(_0x168d57,_0x55b234,_0x4181ee){return new BPromise(function(_0x5d13b4,_0x4c9120){return client[_0x82f7('0xe')](_0x168d57,_0x4181ee)[_0x82f7('0xf')](function(_0x40a3b3){logger['info']('MailInteraction,\x20%s,\x20%s',_0x55b234,_0x82f7('0x10'));logger['debug'](_0x82f7('0x11'),_0x55b234,'request\x20sent',JSON['stringify'](_0x40a3b3));if(_0x40a3b3['error']){if(_0x40a3b3['error'][_0x82f7('0x12')]===0x1f4){logger[_0x82f7('0x13')](_0x82f7('0x14'),_0x55b234,_0x40a3b3[_0x82f7('0x13')][_0x82f7('0x15')]);return _0x4c9120(_0x40a3b3['error'][_0x82f7('0x15')]);}logger[_0x82f7('0x13')](_0x82f7('0x14'),_0x55b234,_0x40a3b3[_0x82f7('0x13')]['message']);return _0x5d13b4(_0x40a3b3[_0x82f7('0x13')][_0x82f7('0x15')]);}else{logger[_0x82f7('0x16')](_0x82f7('0x14'),_0x55b234,_0x82f7('0x10'));_0x5d13b4(_0x40a3b3[_0x82f7('0x17')]['message']);}})[_0x82f7('0x18')](function(_0x3d6ea9){logger[_0x82f7('0x13')]('MailInteraction,\x20%s,\x20%s',_0x55b234,_0x3d6ea9);_0x4c9120(_0x3d6ea9);});});}exports[_0x82f7('0x19')]=function(_0x340a7e){var _0x250bae=this;return new Promise(function(_0x3bf33b,_0x1828ad){return db['MailInteraction'][_0x82f7('0x1a')](_0x340a7e['body'],{'raw':_0x340a7e[_0x82f7('0x1b')]?_0x340a7e[_0x82f7('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x340a7e[_0x82f7('0x1b')]?_0x340a7e[_0x82f7('0x1b')]['where']||null:null,'attributes':_0x340a7e[_0x82f7('0x1b')]?_0x340a7e[_0x82f7('0x1b')][_0x82f7('0x1c')]||null:null,'limit':_0x340a7e[_0x82f7('0x1b')]?_0x340a7e[_0x82f7('0x1b')]['limit']||null:null})[_0x82f7('0xf')](function(_0x497403){logger[_0x82f7('0x16')](_0x82f7('0x19'),_0x340a7e);logger['debug'](_0x82f7('0x19'),_0x340a7e,JSON['stringify'](_0x497403));_0x3bf33b(_0x497403);})[_0x82f7('0x18')](function(_0xa0b5e4){logger[_0x82f7('0x13')](_0x82f7('0x19'),_0xa0b5e4[_0x82f7('0x15')],_0x340a7e);_0x1828ad(_0x250bae[_0x82f7('0x13')](0x1f4,_0xa0b5e4[_0x82f7('0x15')]));});});};exports['AddTagsToMailInteraction']=function(_0x48c62f){return new Promise(function(_0x3fb3e0,_0x3f4782){return db['MailInteraction'][_0x82f7('0x1d')]({'where':_0x48c62f[_0x82f7('0x1b')]?_0x48c62f[_0x82f7('0x1b')][_0x82f7('0x1e')]||null:null})[_0x82f7('0xf')](function(_0x46915f){if(_0x46915f){return _0x46915f[_0x82f7('0x1f')](_0x48c62f[_0x82f7('0x20')][_0x82f7('0x21')],_[_0x82f7('0x22')](_0x48c62f[_0x82f7('0x20')],[_0x82f7('0x21'),'id'])||{});}})[_0x82f7('0x23')](function(_0x5e4129){logger[_0x82f7('0x16')](_0x82f7('0x24'),_0x48c62f);logger[_0x82f7('0x25')](_0x82f7('0x24'),_0x48c62f,JSON[_0x82f7('0x26')](_0x5e4129));_0x3fb3e0(_0x5e4129);})[_0x82f7('0x18')](function(_0x3c6523){logger[_0x82f7('0x13')](_0x82f7('0x24'),_0x3c6523[_0x82f7('0x15')],_0x48c62f);_0x3f4782(_this[_0x82f7('0x13')](0x1f4,_0x3c6523[_0x82f7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index be079b7..2848d40 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 _0x4d11=['save','remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4d11,0xd7));var _0x14d1=function(_0x30b58,_0x48df3b){_0x30b58=_0x30b58-0x0;var _0x9d210d=_0x4d11[_0x30b58];return _0x9d210d;};'use strict';var MailInteractionEvents=require(_0x14d1('0x0'));var events=[_0x14d1('0x1'),_0x14d1('0x2'),_0x14d1('0x3')];function createListener(_0x57eeee,_0x3b24d1){return function(_0x3f38f3){_0x3b24d1[_0x14d1('0x4')](_0x57eeee,_0x3f38f3);};}function removeListener(_0x1dd57e,_0x35b10b){return function(){MailInteractionEvents[_0x14d1('0x5')](_0x1dd57e,_0x35b10b);};}exports[_0x14d1('0x6')]=function(_0x326334){for(var _0x235b91=0x0,_0x53d2dd=events[_0x14d1('0x7')];_0x235b91<_0x53d2dd;_0x235b91++){var _0x43a92a=events[_0x235b91];var _0x1cfca0=createListener(_0x14d1('0x8')+_0x43a92a,_0x326334);MailInteractionEvents['on'](_0x43a92a,_0x1cfca0);}}; \ No newline at end of file +var _0xda9b=['removeListener','register','length','mailInteraction:','./mailInteraction.events','remove'];(function(_0x6d9c10,_0x5492c0){var _0xf88122=function(_0x5a6bbe){while(--_0x5a6bbe){_0x6d9c10['push'](_0x6d9c10['shift']());}};_0xf88122(++_0x5492c0);}(_0xda9b,0x1ae));var _0xbda9=function(_0x519bac,_0x453637){_0x519bac=_0x519bac-0x0;var _0x49c18c=_0xda9b[_0x519bac];return _0x49c18c;};'use strict';var MailInteractionEvents=require(_0xbda9('0x0'));var events=['save',_0xbda9('0x1'),'update'];function createListener(_0x2505d8,_0x1e21a0){return function(_0x4d22f1){_0x1e21a0['emit'](_0x2505d8,_0x4d22f1);};}function removeListener(_0x4b76dd,_0x4d5fe6){return function(){MailInteractionEvents[_0xbda9('0x2')](_0x4b76dd,_0x4d5fe6);};}exports[_0xbda9('0x3')]=function(_0x1f96a7){for(var _0x15338b=0x0,_0x4ba430=events[_0xbda9('0x4')];_0x15338b<_0x4ba430;_0x15338b++){var _0x42f528=events[_0x15338b];var _0x5bd211=createListener(_0xbda9('0x5')+_0x42f528,_0x1f96a7);MailInteractionEvents['on'](_0x42f528,_0x5bd211);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 74189a7..bc788c8 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 _0xcf14=['show','/:id/download','download','post','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x40bb9f,_0x181054){var _0x512c6b=function(_0x3dc008){while(--_0x3dc008){_0x40bb9f['push'](_0x40bb9f['shift']());}};_0x512c6b(++_0x181054);}(_0xcf14,0xa1));var _0x4cf1=function(_0x3168f8,_0x56bc1d){_0x3168f8=_0x3168f8-0x0;var _0x37364b=_0xcf14[_0x3168f8];return _0x37364b;};'use strict';var multer=require(_0x4cf1('0x0'));var util=require('util');var path=require(_0x4cf1('0x1'));var timeout=require(_0x4cf1('0x2'));var express=require('express');var router=express[_0x4cf1('0x3')]();var fs_extra=require(_0x4cf1('0x4'));var auth=require(_0x4cf1('0x5'));var interaction=require(_0x4cf1('0x6'));var config=require('../../config/environment');var controller=require(_0x4cf1('0x7'));router[_0x4cf1('0x8')]('/',auth[_0x4cf1('0x9')](),controller[_0x4cf1('0xa')]);router[_0x4cf1('0x8')](_0x4cf1('0xb'),auth[_0x4cf1('0x9')](),controller['describe']);router[_0x4cf1('0x8')](_0x4cf1('0xc'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0xd')]);router[_0x4cf1('0x8')](_0x4cf1('0xe'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0xf')]);router[_0x4cf1('0x10')]('/',auth[_0x4cf1('0x9')](),interaction[_0x4cf1('0x11')](_0x4cf1('0x12'),_0x4cf1('0x13')),controller[_0x4cf1('0x14')]);router['put'](_0x4cf1('0xc'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x15')]);router[_0x4cf1('0x16')](_0x4cf1('0x17'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x18')]);router[_0x4cf1('0x16')](_0x4cf1('0x19'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x1a')]);router[_0x4cf1('0x1b')](_0x4cf1('0xc'),auth[_0x4cf1('0x9')](),controller[_0x4cf1('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x9d02=['/describe','isAuthenticated','/:id','show','download','post','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get'];(function(_0x5bb907,_0xd54283){var _0x2e2c7d=function(_0x97878){while(--_0x97878){_0x5bb907['push'](_0x5bb907['shift']());}};_0x2e2c7d(++_0xd54283);}(_0x9d02,0x118));var _0x29d0=function(_0x20f313,_0x5b3aa2){_0x20f313=_0x20f313-0x0;var _0x17d883=_0x9d02[_0x20f313];return _0x17d883;};'use strict';var multer=require(_0x29d0('0x0'));var util=require('util');var path=require(_0x29d0('0x1'));var timeout=require('connect-timeout');var express=require(_0x29d0('0x2'));var router=express['Router']();var fs_extra=require(_0x29d0('0x3'));var auth=require(_0x29d0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x29d0('0x5'));var controller=require(_0x29d0('0x6'));router[_0x29d0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x29d0('0x8'),auth[_0x29d0('0x9')](),controller['describe']);router[_0x29d0('0x7')](_0x29d0('0xa'),auth['isAuthenticated'](),controller[_0x29d0('0xb')]);router[_0x29d0('0x7')]('/:id/download',auth[_0x29d0('0x9')](),controller[_0x29d0('0xc')]);router[_0x29d0('0xd')]('/',auth[_0x29d0('0x9')](),interaction['tracked']('mail',_0x29d0('0xe')),controller[_0x29d0('0xf')]);router[_0x29d0('0x10')](_0x29d0('0xa'),auth[_0x29d0('0x9')](),controller[_0x29d0('0x11')]);router[_0x29d0('0x10')](_0x29d0('0x12'),auth[_0x29d0('0x9')](),controller['accept']);router[_0x29d0('0x10')](_0x29d0('0x13'),auth[_0x29d0('0x9')](),controller[_0x29d0('0x14')]);router[_0x29d0('0x15')](_0x29d0('0xa'),auth['isAuthenticated'](),controller[_0x29d0('0x16')]);module[_0x29d0('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 70f264c..df16c20 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 _0x749d=['STRING','INTEGER','Chat','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x332067,_0x20ebf7){var _0x6fd6cf=function(_0xbd86d){while(--_0xbd86d){_0x332067['push'](_0x332067['shift']());}};_0x6fd6cf(++_0x20ebf7);}(_0x749d,0x87));var _0xd749=function(_0x4e7a58,_0x5104d9){_0x4e7a58=_0x4e7a58-0x0;var _0x22e4b6=_0x749d[_0x4e7a58];return _0x22e4b6;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd749('0x0'));module[_0xd749('0x1')]={'body':{'type':Sequelize[_0xd749('0x2')](_0xd749('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd749('0x2')](_0xd749('0x4'))},'read':{'type':Sequelize[_0xd749('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd749('0x6')]('in','out'),'defaultValue':_0xd749('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd749('0x8')](0x1fe)},'from':{'type':Sequelize[_0xd749('0x8')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0xd749('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0xd749('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xd749('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd749('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0xd749('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xd749('0x3'))},'originChannel':{'type':Sequelize[_0xd749('0x6')]('Email',_0xd749('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xd147=['lodash','exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x2b06e0,_0x560fc1){var _0x282628=function(_0x58764b){while(--_0x58764b){_0x2b06e0['push'](_0x2b06e0['shift']());}};_0x282628(++_0x560fc1);}(_0xd147,0xf2));var _0x7d14=function(_0x297dcb,_0x4ee7ce){_0x297dcb=_0x297dcb-0x0;var _0x32a68c=_0xd147[_0x297dcb];return _0x32a68c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7d14('0x0'));module[_0x7d14('0x1')]={'body':{'type':Sequelize[_0x7d14('0x2')](_0x7d14('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7d14('0x2')]('medium')},'read':{'type':Sequelize[_0x7d14('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7d14('0x5')]('in',_0x7d14('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x7d14('0x7')]},'to':{'type':Sequelize[_0x7d14('0x2')]('long')},'cc':{'type':Sequelize[_0x7d14('0x2')]('long')},'bcc':{'type':Sequelize[_0x7d14('0x2')]('long')},'subject':{'type':Sequelize[_0x7d14('0x2')]},'sentAt':{'type':Sequelize[_0x7d14('0x8')]},'attach':{'type':Sequelize[_0x7d14('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7d14('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7d14('0x8')]},'originTo':{'type':Sequelize[_0x7d14('0x2')](_0x7d14('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x7d14('0x3'))},'originChannel':{'type':Sequelize[_0x7d14('0x5')](_0x7d14('0xa'),'Chat'),'defaultValue':_0x7d14('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 ec468b6..ef705ef 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 _0x4a0f=['agent','MailInteraction','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','channel','motionChannel','event','fromString','EventManager','acceptmessage','mail','MailInteractionId','rejectMessage','contact','interface','SIP/%s','unix','toString','server','files','message-%s.eml','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','Attachments','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','bluebird','util','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','client','http','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','info','result','status','json','offset','undefined','limit','count','sendStatus','stack','name','index','map','MailMessage','rawAttributes','type','query','keys','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','intersection','length','includeAll','find','update','body','params','describe','create','direction','out','secret','split','MailAccount','MailAccountId','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','Contacts','defaults','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','user'];(function(_0x26742c,_0xe241ee){var _0x4d9df4=function(_0x5bf307){while(--_0x5bf307){_0x26742c['push'](_0x26742c['shift']());}};_0x4d9df4(++_0xe241ee);}(_0x4a0f,0xcb));var _0xf4a0=function(_0x1ac9e5,_0x595e44){_0x1ac9e5=_0x1ac9e5-0x0;var _0x2c0c0e=_0x4a0f[_0x1ac9e5];return _0x2c0c0e;};'use strict';var emlformat=require(_0xf4a0('0x0'));var moment=require('moment');var BPromise=require(_0xf4a0('0x1'));var util=require(_0xf4a0('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xf4a0('0x3'));var htmlToText=require(_0xf4a0('0x4'));var qs=require(_0xf4a0('0x5'));var logger=require(_0xf4a0('0x6'))(_0xf4a0('0x7'));var interaction_log=require('../../config/logger')(_0xf4a0('0x8'));var config=require(_0xf4a0('0x9'));var db=require('../../mysqldb')['db'];config[_0xf4a0('0xa')]=_['defaults'](config['redis'],{'host':_0xf4a0('0xb'),'port':0x18eb});var socket=require(_0xf4a0('0xc'))(new Redis(config[_0xf4a0('0xa')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf4a0('0xd')]['http']({'port':0x232c});var client9003=jayson[_0xf4a0('0xd')][_0xf4a0('0xe')]({'port':0x232b});var client9002=jayson[_0xf4a0('0xd')][_0xf4a0('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x2ede28,_0x4e8d8c,_0xb06440,_0x4d43f9){return new BPromise(function(_0x129c95,_0x19f8d0){var _0x5fb315=_0x4d43f9||client;return _0x5fb315[_0xf4a0('0xf')](_0x2ede28,_0xb06440)[_0xf4a0('0x10')](function(_0x4e4483){logger['info']('MailMessage,\x20%s,\x20%s',_0x4e8d8c,_0xf4a0('0x11'));logger[_0xf4a0('0x12')](_0xf4a0('0x13'),_0x4e8d8c,_0xf4a0('0x11'),JSON['stringify'](_0x4e4483));if(_0x4e4483[_0xf4a0('0x14')]){if(_0x4e4483['error'][_0xf4a0('0x15')]===0x1f4){logger['error'](_0xf4a0('0x16'),_0x4e8d8c,_0x4e4483[_0xf4a0('0x14')]['message']);return _0x19f8d0(_0x4e4483[_0xf4a0('0x14')]['message']);}logger['error'](_0xf4a0('0x16'),_0x4e8d8c,_0x4e4483[_0xf4a0('0x14')][_0xf4a0('0x17')]);return _0x129c95(_0x4e4483[_0xf4a0('0x14')][_0xf4a0('0x17')]);}else{logger[_0xf4a0('0x18')](_0xf4a0('0x16'),_0x4e8d8c,'request\x20sent');_0x129c95(_0x4e4483[_0xf4a0('0x19')]['message']);}})['catch'](function(_0x6d4cca){logger[_0xf4a0('0x14')](_0xf4a0('0x16'),_0x4e8d8c,_0x6d4cca);_0x19f8d0(_0x6d4cca);});});}function respondWithResult(_0x5b004e,_0x36df78){_0x36df78=_0x36df78||0xc8;return function(_0x1d2c01){if(_0x1d2c01){return _0x5b004e[_0xf4a0('0x1a')](_0x36df78)[_0xf4a0('0x1b')](_0x1d2c01);}};}function respondWithFilteredResult(_0x38c722,_0x2a7267){return function(_0x134614){if(_0x134614){var _0x40f08c=typeof _0x2a7267[_0xf4a0('0x1c')]===_0xf4a0('0x1d')&&typeof _0x2a7267[_0xf4a0('0x1e')]===_0xf4a0('0x1d');var _0x477ada=_0x134614[_0xf4a0('0x1f')];var _0x452f00=_0x40f08c?0x0:_0x2a7267['offset'];var _0x4938f3=_0x40f08c?_0x134614[_0xf4a0('0x1f')]:_0x2a7267[_0xf4a0('0x1c')]+_0x2a7267['limit'];var _0x2230e9;if(_0x4938f3>=_0x477ada){_0x4938f3=_0x477ada;_0x2230e9=0xc8;}else{_0x2230e9=0xce;}_0x38c722[_0xf4a0('0x1a')](_0x2230e9);return _0x38c722['set']('Content-Range',_0x452f00+'-'+_0x4938f3+'/'+_0x477ada)[_0xf4a0('0x1b')](_0x134614);}return null;};}function saveUpdates(_0x158259){return function(_0x5ed624){if(_0x5ed624){return _0x5ed624['update'](_0x158259)[_0xf4a0('0x10')](function(_0x2211e1){return _0x2211e1;});}return null;};}function removeEntity(_0x5c24c1){return function(_0x554d58){if(_0x554d58){return _0x554d58['destroy']()['then'](function(){_0x5c24c1[_0xf4a0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafd8f0){return function(_0x5041ae){if(!_0x5041ae){_0xafd8f0[_0xf4a0('0x20')](0x194);}return _0x5041ae;};}function handleError(_0x409d4e,_0x483c82){_0x483c82=_0x483c82||0x1f4;return function(_0x5e7f18){logger[_0xf4a0('0x14')](_0x5e7f18[_0xf4a0('0x21')]);if(_0x5e7f18[_0xf4a0('0x22')]){delete _0x5e7f18[_0xf4a0('0x22')];}_0x409d4e[_0xf4a0('0x1a')](_0x483c82)['send'](_0x5e7f18);};}exports[_0xf4a0('0x23')]=function(_0x55cdcf,_0x56a4d9){var _0x2974a6={},_0x580223={},_0xdc0c76={'count':0x0,'rows':[]};var _0x32d70f=_[_0xf4a0('0x24')](db[_0xf4a0('0x25')][_0xf4a0('0x26')],function(_0x9668d2){return{'name':_0x9668d2['fieldName'],'type':_0x9668d2[_0xf4a0('0x27')]['key']};});_0x580223['model']=_['map'](_0x32d70f,_0xf4a0('0x22'));_0x580223[_0xf4a0('0x28')]=_[_0xf4a0('0x29')](_0x55cdcf['query']);_0x580223['filters']=_['intersection'](_0x580223[_0xf4a0('0x2a')],_0x580223['query']);_0x2974a6[_0xf4a0('0x2b')]=_['intersection'](_0x580223[_0xf4a0('0x2a')],qs['fields'](_0x55cdcf[_0xf4a0('0x28')][_0xf4a0('0x2c')]));_0x2974a6[_0xf4a0('0x2b')]=_0x2974a6[_0xf4a0('0x2b')]['length']?_0x2974a6[_0xf4a0('0x2b')]:_0x580223[_0xf4a0('0x2a')];if(!_0x55cdcf[_0xf4a0('0x28')][_0xf4a0('0x2d')]('nolimit')){_0x2974a6['limit']=qs[_0xf4a0('0x1e')](_0x55cdcf['query'][_0xf4a0('0x1e')]);_0x2974a6['offset']=qs[_0xf4a0('0x1c')](_0x55cdcf[_0xf4a0('0x28')]['offset']);}_0x2974a6[_0xf4a0('0x2e')]=qs[_0xf4a0('0x2f')](_0x55cdcf[_0xf4a0('0x28')][_0xf4a0('0x2f')]);_0x2974a6[_0xf4a0('0x30')]=qs[_0xf4a0('0x31')](_[_0xf4a0('0x32')](_0x55cdcf[_0xf4a0('0x28')],_0x580223['filters']),_0x32d70f);if(_0x55cdcf['query'][_0xf4a0('0x33')]){_0x2974a6[_0xf4a0('0x30')]=_[_0xf4a0('0x34')](_0x2974a6[_0xf4a0('0x30')],{'$or':_[_0xf4a0('0x24')](_0x32d70f,function(_0x37f592){if(_0x37f592[_0xf4a0('0x27')]!==_0xf4a0('0x35')){var _0x1fb8c1={};_0x1fb8c1[_0x37f592[_0xf4a0('0x22')]]={'$like':'%'+_0x55cdcf[_0xf4a0('0x28')][_0xf4a0('0x33')]+'%'};return _0x1fb8c1;}})});}_0x2974a6=_[_0xf4a0('0x34')]({},_0x2974a6,_0x55cdcf[_0xf4a0('0x36')]);var _0x5960a1={'where':_0x2974a6[_0xf4a0('0x30')]};return db[_0xf4a0('0x25')][_0xf4a0('0x1f')](_0x5960a1)[_0xf4a0('0x10')](function(_0x2bba45){_0xdc0c76[_0xf4a0('0x1f')]=_0x2bba45;if(_0x55cdcf['query']['includeAll']){_0x2974a6[_0xf4a0('0x37')]=[{'all':!![]}];}return db[_0xf4a0('0x25')][_0xf4a0('0x38')](_0x2974a6);})[_0xf4a0('0x10')](function(_0x4a0232){_0xdc0c76[_0xf4a0('0x39')]=_0x4a0232;return _0xdc0c76;})[_0xf4a0('0x10')](respondWithFilteredResult(_0x56a4d9,_0x2974a6))[_0xf4a0('0x3a')](handleError(_0x56a4d9,null));};exports[_0xf4a0('0x3b')]=function(_0x281549,_0x225439){var _0x23dbfd={'raw':!![],'where':{'id':_0x281549['params']['id']}},_0x5e379e={};_0x5e379e[_0xf4a0('0x2a')]=_['keys'](db[_0xf4a0('0x25')]['rawAttributes']);_0x5e379e[_0xf4a0('0x28')]=_[_0xf4a0('0x29')](_0x281549[_0xf4a0('0x28')]);_0x5e379e['filters']=_[_0xf4a0('0x3c')](_0x5e379e[_0xf4a0('0x2a')],_0x5e379e[_0xf4a0('0x28')]);_0x23dbfd[_0xf4a0('0x2b')]=_[_0xf4a0('0x3c')](_0x5e379e[_0xf4a0('0x2a')],qs['fields'](_0x281549[_0xf4a0('0x28')][_0xf4a0('0x2c')]));_0x23dbfd[_0xf4a0('0x2b')]=_0x23dbfd[_0xf4a0('0x2b')][_0xf4a0('0x3d')]?_0x23dbfd[_0xf4a0('0x2b')]:_0x5e379e['model'];if(_0x281549[_0xf4a0('0x28')][_0xf4a0('0x3e')]){_0x23dbfd[_0xf4a0('0x37')]=[{'all':!![]}];}_0x23dbfd=_[_0xf4a0('0x34')]({},_0x23dbfd,_0x281549[_0xf4a0('0x36')]);return db[_0xf4a0('0x25')][_0xf4a0('0x3f')](_0x23dbfd)[_0xf4a0('0x10')](handleEntityNotFound(_0x225439,null))[_0xf4a0('0x10')](respondWithResult(_0x225439,null))['catch'](handleError(_0x225439,null));};exports[_0xf4a0('0x40')]=function(_0x2b0cc5,_0x36b33b){if(_0x2b0cc5[_0xf4a0('0x41')]['id']){delete _0x2b0cc5[_0xf4a0('0x41')]['id'];}return db['MailMessage'][_0xf4a0('0x3f')]({'where':{'id':_0x2b0cc5[_0xf4a0('0x42')]['id']}})['then'](handleEntityNotFound(_0x36b33b,null))[_0xf4a0('0x10')](saveUpdates(_0x2b0cc5[_0xf4a0('0x41')],null))['then'](respondWithResult(_0x36b33b,null))[_0xf4a0('0x3a')](handleError(_0x36b33b,null));};exports['destroy']=function(_0x5ed9fd,_0x3f1887){return db['MailMessage'][_0xf4a0('0x3f')]({'where':{'id':_0x5ed9fd[_0xf4a0('0x42')]['id']}})[_0xf4a0('0x10')](handleEntityNotFound(_0x3f1887,null))[_0xf4a0('0x10')](removeEntity(_0x3f1887,null))[_0xf4a0('0x3a')](handleError(_0x3f1887,null));};exports[_0xf4a0('0x43')]=function(_0x322580,_0x53cdf6){return db[_0xf4a0('0x25')]['describe']()[_0xf4a0('0x10')](respondWithResult(_0x53cdf6,null))[_0xf4a0('0x3a')](handleError(_0x53cdf6,null));};exports[_0xf4a0('0x44')]=function(_0x58c636,_0x2ca114){return db[_0xf4a0('0x25')][_0xf4a0('0x44')](_0x58c636[_0xf4a0('0x41')])[_0xf4a0('0x10')](function(_0x24abc3){if(_0x24abc3){if(_0x24abc3[_0xf4a0('0x45')]===_0xf4a0('0x46')&&!_0x24abc3[_0xf4a0('0x47')]){var _0x231b78,_0x2b9eeb,_0x4bb0de;if(_0x58c636['body']['to']){_0x2b9eeb=_0x58c636['body']['to'][_0xf4a0('0x48')](',')[0x0];}return db[_0xf4a0('0x49')]['findOne']({'where':{'id':_0x24abc3[_0xf4a0('0x4a')]},'include':[{'model':db['CmList'],'as':_0xf4a0('0x4b'),'include':[{'model':db[_0xf4a0('0x4c')],'as':'Contacts','where':{'email':_0x2b9eeb},'limit':0x1,'order':[[_0xf4a0('0x4d'),_0xf4a0('0x4e')]]}]},{'model':db[_0xf4a0('0x4f')],'as':_0xf4a0('0x50'),'raw':!![],'include':[{'model':db[_0xf4a0('0x51')],'as':_0xf4a0('0x51'),'raw':!![]}]}]})[_0xf4a0('0x10')](function(_0x3721a6){_0x231b78=_0x3721a6;if(!_0x231b78||!_0x231b78[_0xf4a0('0x50')])return;var _0x5e17e9=_0x231b78['getSmtpOptions']();if(_0x58c636[_0xf4a0('0x41')][_0xf4a0('0x52')]&&_0x58c636[_0xf4a0('0x41')]['attachments'][_0xf4a0('0x3d')]){for(var _0x12c507=0x0;_0x12c507<_0x58c636[_0xf4a0('0x41')][_0xf4a0('0x52')][_0xf4a0('0x3d')];_0x12c507+=0x1){_0x58c636[_0xf4a0('0x41')][_0xf4a0('0x52')][_0x12c507]={'filename':_0x58c636['body'][_0xf4a0('0x52')][_0x12c507][_0xf4a0('0x22')],'path':path[_0xf4a0('0x53')](config[_0xf4a0('0x54')],_0xf4a0('0x55'),_0x58c636[_0xf4a0('0x41')]['attachments'][_0x12c507][_0xf4a0('0x56')])};}}_0x4bb0de={'account':_0x5e17e9,'message':_0x58c636[_0xf4a0('0x41')]};return;})[_0xf4a0('0x10')](function(){if(_0x231b78[_0xf4a0('0x4b')]){if(_0x231b78[_0xf4a0('0x4b')][_0xf4a0('0x57')][_0xf4a0('0x3d')]){return _0x231b78['List'][_0xf4a0('0x57')][0x0];}else{return db[_0xf4a0('0x4c')][_0xf4a0('0x44')](_[_0xf4a0('0x58')](_0x58c636[_0xf4a0('0x41')],{'firstName':_0x58c636[_0xf4a0('0x41')]['to'],'email':_0x58c636['body']['to'],'phone':_0x58c636[_0xf4a0('0x41')]['to'],'ListId':_0x231b78['ListId']}));}}else{throw new Error(_0xf4a0('0x59'));}})[_0xf4a0('0x10')](function(){if(_0x4bb0de){return respondWithRpcPromise(_0xf4a0('0x5a'),_0xf4a0('0x5b'),_0x4bb0de,client9003)['then'](function(_0x344ab8){return _0x24abc3[_0xf4a0('0x40')]({'read':!![],'messageId':_0x344ab8[_0xf4a0('0x5c')],'sentAt':moment()[_0xf4a0('0x5d')](_0xf4a0('0x5e'))});})[_0xf4a0('0x3a')](function(_0x54bc80){logger[_0xf4a0('0x14')]('%s',JSON[_0xf4a0('0x5f')](_0x54bc80));return _0x24abc3;});}return _0x24abc3;});}return _0x24abc3;}})[_0xf4a0('0x10')](respondWithResult(_0x2ca114,0xc9))[_0xf4a0('0x3a')](handleError(_0x2ca114,null));};exports[_0xf4a0('0x60')]=function(_0x19863d,_0x3747fb){var _0x5c53d3={'agent':{},'channel':'mail'};if(_0x19863d['body']['id']){delete _0x19863d[_0xf4a0('0x41')]['id'];}_0x19863d[_0xf4a0('0x41')][_0xf4a0('0x61')]=!![];_0x19863d[_0xf4a0('0x41')][_0xf4a0('0x62')]=moment()[_0xf4a0('0x5d')](_0xf4a0('0x5e'));_0x19863d[_0xf4a0('0x41')]['UserId']=_0x19863d['body'][_0xf4a0('0x63')]||_0x19863d[_0xf4a0('0x64')]['id'];_0x5c53d3[_0xf4a0('0x65')]['id']=_0x19863d[_0xf4a0('0x41')][_0xf4a0('0x63')];return db['MailMessage']['find']({'where':{'id':_0x19863d['params']['id'],'UserId':null}})[_0xf4a0('0x10')](handleEntityNotFound(_0x3747fb,null))[_0xf4a0('0x10')](saveUpdates(_0x19863d[_0xf4a0('0x41')],null))['then'](function(_0x251502){if(_0x251502){_0x5c53d3['message']=_0x251502['get']({'plain':!![]});return db[_0xf4a0('0x66')][_0xf4a0('0x3f')]({'where':{'id':_0x251502['MailInteractionId']}});}return null;})[_0xf4a0('0x10')](handleEntityNotFound(_0x3747fb,null))[_0xf4a0('0x10')](function(_0x5cc15a){if(_0x5cc15a){return _0x5cc15a[_0xf4a0('0x40')]({'UserId':_0x19863d[_0xf4a0('0x41')][_0xf4a0('0x63')],'read1stAt':_[_0xf4a0('0x67')](_0x5cc15a[_0xf4a0('0x68')])?moment()['format'](_0xf4a0('0x5e')):undefined});}return null;})['then'](function(_0x2a83fc){if(_0x2a83fc){_0x5c53d3[_0xf4a0('0x69')]=_0x2a83fc[_0xf4a0('0x6a')]({'plain':!![]});interaction_log['info'](_0xf4a0('0x6b'),_0x19863d[_0xf4a0('0x64')]['id'],_0x19863d[_0xf4a0('0x64')][_0xf4a0('0x22')],_0x19863d[_0xf4a0('0x64')][_0xf4a0('0x6c')],_0x5c53d3['interaction']['id'],_0x19863d[_0xf4a0('0x41')]?JSON['stringify'](_0x19863d['body']):_0xf4a0('0x6d'));return respondWithRpcPromise(_0xf4a0('0x6e'),_0xf4a0('0x6f'),_0x5c53d3);}return null;})[_0xf4a0('0x10')](function(_0x438e9f){var _0x17dcf9=_0xf4a0('0x70')+_0x438e9f['message'][_0xf4a0('0x71')];return db[_0xf4a0('0x72')][_0xf4a0('0x28')](_0x17dcf9,{'type':db[_0xf4a0('0x73')][_0xf4a0('0x74')][_0xf4a0('0x75')],'raw':!![]})[_0xf4a0('0x10')](function(_0x5a2101){return _0x5a2101;});})[_0xf4a0('0x10')](function(_0x125b7a){if(_0x125b7a){_0x5c53d3[_0xf4a0('0x17')]['contact']=_0x125b7a[0x0];if(!_0x19863d[_0xf4a0('0x41')][_0xf4a0('0x63')])return;return db[_0xf4a0('0x76')][_0xf4a0('0x3f')]({'where':{'id':_0x19863d[_0xf4a0('0x41')][_0xf4a0('0x63')],'role':'agent'},'attributes':['id','name',_0xf4a0('0x77'),_0xf4a0('0x78'),_0xf4a0('0x79')],'raw':!![]});}return null;})[_0xf4a0('0x10')](function(_0x134024){if(!_0x134024)return null;_0x5c53d3[_0xf4a0('0x17')][_0xf4a0('0x65')]=_0x134024;return _0x5c53d3;})[_0xf4a0('0x10')](function(_0x95681e){if(_0x95681e){if(_0x19863d['body'][_0xf4a0('0x7a')]){_0x5c53d3['message']['interface']=util[_0xf4a0('0x5d')]('SIP/%s',_0x19863d[_0xf4a0('0x64')]['name']);_0x5c53d3[_0xf4a0('0x17')][_0xf4a0('0x7b')]=_0x5c53d3[_0xf4a0('0x7b')];_0x5c53d3[_0xf4a0('0x17')][_0xf4a0('0x7c')]=_0x5c53d3['channel'];_0x5c53d3[_0xf4a0('0x17')][_0xf4a0('0x7d')]=_0xf4a0('0x60');_0x5c53d3['message'][_0xf4a0('0x41')]=htmlToText[_0xf4a0('0x7e')](_0x5c53d3['message'][_0xf4a0('0x41')]);return respondWithRpcPromise('EventManager',_0xf4a0('0x7f'),{'event':_0xf4a0('0x80'),'message':_0x5c53d3[_0xf4a0('0x17')]},client9002)[_0xf4a0('0x10')](function(){return _0x5c53d3;});}return _0x5c53d3;}return null;})[_0xf4a0('0x10')](respondWithResult(_0x3747fb,null))[_0xf4a0('0x3a')](handleError(_0x3747fb,null));};exports['reject']=function(_0x2618c8,_0x239bca){var _0xedb7cb={'agent':{},'channel':_0xf4a0('0x81')};if(_0x2618c8[_0xf4a0('0x41')]['id']){delete _0x2618c8[_0xf4a0('0x41')]['id'];}_0x2618c8[_0xf4a0('0x41')]['UserId']=_0x2618c8[_0xf4a0('0x41')]['UserId']||_0x2618c8[_0xf4a0('0x64')]['id'];_0xedb7cb[_0xf4a0('0x65')]['id']=_0x2618c8[_0xf4a0('0x41')]['UserId'];return db[_0xf4a0('0x25')][_0xf4a0('0x3f')]({'where':{'id':_0x2618c8[_0xf4a0('0x42')]['id'],'UserId':null}})[_0xf4a0('0x10')](handleEntityNotFound(_0x239bca,null))[_0xf4a0('0x10')](function(_0x40e18d){if(_0x40e18d){_0xedb7cb[_0xf4a0('0x17')]=_0x40e18d['get']({'plain':!![]});return db[_0xf4a0('0x66')]['find']({'where':{'id':_0x40e18d[_0xf4a0('0x82')]}});}return null;})['then'](handleEntityNotFound(_0x239bca,null))[_0xf4a0('0x10')](function(_0x24b801){if(_0x24b801){_0xedb7cb[_0xf4a0('0x69')]=_0x24b801[_0xf4a0('0x6a')]({'plain':!![]});interaction_log[_0xf4a0('0x18')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2618c8[_0xf4a0('0x64')]['id'],_0x2618c8[_0xf4a0('0x64')][_0xf4a0('0x22')],_0x2618c8[_0xf4a0('0x64')][_0xf4a0('0x6c')],_0xedb7cb['interaction']['id'],_0x2618c8[_0xf4a0('0x41')]?JSON[_0xf4a0('0x5f')](_0x2618c8['body']):'null');return respondWithRpcPromise('RejectMessage',_0xf4a0('0x83'),_0xedb7cb);}return null;})[_0xf4a0('0x10')](function(_0xcec098){var _0x371343='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xcec098[_0xf4a0('0x17')][_0xf4a0('0x71')];return db[_0xf4a0('0x72')][_0xf4a0('0x28')](_0x371343,{'type':db['Sequelize'][_0xf4a0('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x2011ac){return _0x2011ac;});})['then'](function(_0x426c9f){if(_0x426c9f){_0xedb7cb[_0xf4a0('0x17')][_0xf4a0('0x84')]=_0x426c9f[0x0];if(!_0x2618c8[_0xf4a0('0x41')][_0xf4a0('0x63')])return;return db[_0xf4a0('0x76')][_0xf4a0('0x3f')]({'where':{'id':_0x2618c8[_0xf4a0('0x41')][_0xf4a0('0x63')],'role':_0xf4a0('0x65')},'attributes':['id',_0xf4a0('0x22'),_0xf4a0('0x77'),_0xf4a0('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3b52c4){if(!_0x3b52c4)return null;_0xedb7cb[_0xf4a0('0x17')][_0xf4a0('0x65')]=_0x3b52c4;return _0xedb7cb;})[_0xf4a0('0x10')](function(_0x334233){if(_0x334233){_0x334233[_0xf4a0('0x17')][_0xf4a0('0x85')]=util['format'](_0xf4a0('0x86'),_0x2618c8[_0xf4a0('0x64')][_0xf4a0('0x22')]);_0x334233[_0xf4a0('0x17')]['channel']=_0xedb7cb[_0xf4a0('0x7b')];_0x334233['message'][_0xf4a0('0x7c')]=_0xedb7cb[_0xf4a0('0x7b')];_0x334233[_0xf4a0('0x17')][_0xf4a0('0x7d')]='reject';_0x334233['message'][_0xf4a0('0x41')]=htmlToText[_0xf4a0('0x7e')](_0xedb7cb[_0xf4a0('0x17')][_0xf4a0('0x41')]);respondWithRpcPromise(_0xf4a0('0x7f'),_0xf4a0('0x7f'),{'event':'rejectmessage','message':_0x334233[_0xf4a0('0x17')]},client9002);return _0xedb7cb;}return null;})[_0xf4a0('0x10')](respondWithResult(_0x239bca,null))['catch'](handleError(_0x239bca,null));};exports['download']=function(_0x26dd9e,_0x4dd064){var _0x28ea6c=moment()[_0xf4a0('0x87')]()[_0xf4a0('0x88')]();var _0x24d9ed=path[_0xf4a0('0x53')](config[_0xf4a0('0x54')],_0xf4a0('0x89'),_0xf4a0('0x8a'),'tmp');var _0x36769d=path['join'](config[_0xf4a0('0x54')],_0xf4a0('0x89'),'files',_0xf4a0('0x52'));var _0x3522fe=util[_0xf4a0('0x5d')](_0xf4a0('0x8b'),_0x28ea6c);return db[_0xf4a0('0x25')][_0xf4a0('0x3f')]({'where':{'id':_0x26dd9e[_0xf4a0('0x42')]['id']},'attributes':['id',_0xf4a0('0x41'),'from','to','cc','bcc','subject','createdAt'],'include':_0x26dd9e['query'][_0xf4a0('0x52')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x4dd064,null))[_0xf4a0('0x10')](function(_0x5a285c){if(_0x5a285c){var _0xb06f03=_0x5a285c;var _0x190892={'from':_0xb06f03['from'],'to':_0xb06f03['to'],'subject':_0xb06f03[_0xf4a0('0x8c')],'html':htmlEntities[_0xf4a0('0x8d')](_0xb06f03[_0xf4a0('0x41')]),'headers':{'Date':moment(_0xb06f03['createdAt'])[_0xf4a0('0x5d')](_0xf4a0('0x8e'))},'attachments':[]};if(_0x5a285c['cc']){_0x190892[_0xf4a0('0x8f')]['Cc']=_0x5a285c['cc'];}if(_0x5a285c['bcc']){_0x190892[_0xf4a0('0x8f')][_0xf4a0('0x90')]=_0x5a285c[_0xf4a0('0x91')];}return new BPromise(function(_0x1b5370,_0x82b94c){if(_0x5a285c[_0xf4a0('0x92')]){for(var _0x35737f=0x0;_0x35737f<_0x5a285c[_0xf4a0('0x92')][_0xf4a0('0x3d')];_0x35737f++){var _0x24c24d=_0x5a285c[_0xf4a0('0x92')][_0x35737f];var _0xca6b39=path[_0xf4a0('0x53')](_0x36769d,_0x24c24d[_0xf4a0('0x56')]);if(fs[_0xf4a0('0x93')](_0xca6b39)){_0x190892['attachments'][_0xf4a0('0x94')]({'name':_0x24c24d[_0xf4a0('0x22')],'contentType':_0x24c24d['type'],'data':fs[_0xf4a0('0x95')](_0xca6b39)});}}}emlformat['build'](_0x190892,function(_0x53fd64,_0x2ad310){if(_0x53fd64)return _0x82b94c(_0x53fd64);fs[_0xf4a0('0x96')](path[_0xf4a0('0x53')](_0x24d9ed,_0x3522fe),_0x2ad310);return _0x1b5370(_0x2ad310);});});}})[_0xf4a0('0x10')](function(_0x5d5eea){if(_0x5d5eea){return _0x4dd064['download'](path[_0xf4a0('0x53')](_0x24d9ed,_0x3522fe),_0x3522fe,function(_0x3b46a0){if(!_0x3b46a0)fs[_0xf4a0('0x97')](path[_0xf4a0('0x53')](_0x24d9ed,_0x3522fe));});}})[_0xf4a0('0x3a')](handleError(_0x4dd064,null));}; \ No newline at end of file +var _0x6fb6=['message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','headers','Bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','then','sendStatus','name','map','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','MailMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','body','create','out','split','MailAccount','CmList','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','List','CmContact','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','reject','rejectmessage','unix','toString','join','server','files','tmp'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x6fb6,0xa9));var _0x66fb=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x6fb6[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x66fb('0x0'));var moment=require(_0x66fb('0x1'));var BPromise=require(_0x66fb('0x2'));var util=require(_0x66fb('0x3'));var path=require(_0x66fb('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x66fb('0x5'));var htmlToText=require(_0x66fb('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x66fb('0x7'))(_0x66fb('0x8'));var interaction_log=require('../../config/logger')(_0x66fb('0x9'));var config=require(_0x66fb('0xa'));var db=require(_0x66fb('0xb'))['db'];config[_0x66fb('0xc')]=_[_0x66fb('0xd')](config[_0x66fb('0xc')],{'host':_0x66fb('0xe'),'port':0x18eb});var socket=require(_0x66fb('0xf'))(new Redis(config[_0x66fb('0xc')]));var htmlEntities=require(_0x66fb('0x10'));require(_0x66fb('0x11'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x66fb('0x12')][_0x66fb('0x13')]({'port':0x232c});var client9003=jayson[_0x66fb('0x12')][_0x66fb('0x13')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ccb9d,_0x576daa,_0x42aac3,_0x3c3bca){return new BPromise(function(_0x28abd9,_0x5d6649){var _0x2d50fb=_0x3c3bca||client;return _0x2d50fb[_0x66fb('0x14')](_0x3ccb9d,_0x42aac3)['then'](function(_0x2a49be){logger[_0x66fb('0x15')](_0x66fb('0x16'),_0x576daa,_0x66fb('0x17'));logger[_0x66fb('0x18')](_0x66fb('0x19'),_0x576daa,'request\x20sent',JSON[_0x66fb('0x1a')](_0x2a49be));if(_0x2a49be[_0x66fb('0x1b')]){if(_0x2a49be[_0x66fb('0x1b')][_0x66fb('0x1c')]===0x1f4){logger[_0x66fb('0x1b')](_0x66fb('0x16'),_0x576daa,_0x2a49be[_0x66fb('0x1b')][_0x66fb('0x1d')]);return _0x5d6649(_0x2a49be[_0x66fb('0x1b')][_0x66fb('0x1d')]);}logger[_0x66fb('0x1b')](_0x66fb('0x16'),_0x576daa,_0x2a49be[_0x66fb('0x1b')]['message']);return _0x28abd9(_0x2a49be['error'][_0x66fb('0x1d')]);}else{logger[_0x66fb('0x15')](_0x66fb('0x16'),_0x576daa,'request\x20sent');_0x28abd9(_0x2a49be[_0x66fb('0x1e')]['message']);}})[_0x66fb('0x1f')](function(_0xfba222){logger[_0x66fb('0x1b')]('MailMessage,\x20%s,\x20%s',_0x576daa,_0xfba222);_0x5d6649(_0xfba222);});});}function respondWithResult(_0x4fa2db,_0x564ce0){_0x564ce0=_0x564ce0||0xc8;return function(_0x3e6be3){if(_0x3e6be3){return _0x4fa2db['status'](_0x564ce0)[_0x66fb('0x20')](_0x3e6be3);}};}function respondWithFilteredResult(_0x3ec5fe,_0x73cb22){return function(_0x3870a2){if(_0x3870a2){var _0x5c45e6=typeof _0x73cb22[_0x66fb('0x21')]===_0x66fb('0x22')&&typeof _0x73cb22[_0x66fb('0x23')]===_0x66fb('0x22');var _0xfc9279=_0x3870a2[_0x66fb('0x24')];var _0x346b0f=_0x5c45e6?0x0:_0x73cb22[_0x66fb('0x21')];var _0x3cbd66=_0x5c45e6?_0x3870a2[_0x66fb('0x24')]:_0x73cb22['offset']+_0x73cb22['limit'];var _0x169e57;if(_0x3cbd66>=_0xfc9279){_0x3cbd66=_0xfc9279;_0x169e57=0xc8;}else{_0x169e57=0xce;}_0x3ec5fe[_0x66fb('0x25')](_0x169e57);return _0x3ec5fe[_0x66fb('0x26')](_0x66fb('0x27'),_0x346b0f+'-'+_0x3cbd66+'/'+_0xfc9279)[_0x66fb('0x20')](_0x3870a2);}return null;};}function saveUpdates(_0x23c493){return function(_0xe7c024){if(_0xe7c024){return _0xe7c024[_0x66fb('0x28')](_0x23c493)['then'](function(_0x4ac80d){return _0x4ac80d;});}return null;};}function removeEntity(_0x25085d){return function(_0x7fe82){if(_0x7fe82){return _0x7fe82['destroy']()[_0x66fb('0x29')](function(){_0x25085d[_0x66fb('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x430103){return function(_0x25357f){if(!_0x25357f){_0x430103[_0x66fb('0x2a')](0x194);}return _0x25357f;};}function handleError(_0x294bd3,_0x35d82e){_0x35d82e=_0x35d82e||0x1f4;return function(_0x152f25){logger['error'](_0x152f25['stack']);if(_0x152f25[_0x66fb('0x2b')]){delete _0x152f25[_0x66fb('0x2b')];}_0x294bd3[_0x66fb('0x25')](_0x35d82e)['send'](_0x152f25);};}exports['index']=function(_0x1babe1,_0x235ada){var _0x1ca6dc={},_0x21ad49={},_0x2d5a0c={'count':0x0,'rows':[]};var _0x434a25=_[_0x66fb('0x2c')](db['MailMessage']['rawAttributes'],function(_0xcd08dc){return{'name':_0xcd08dc['fieldName'],'type':_0xcd08dc[_0x66fb('0x2d')][_0x66fb('0x2e')]};});_0x21ad49[_0x66fb('0x2f')]=_[_0x66fb('0x2c')](_0x434a25,_0x66fb('0x2b'));_0x21ad49[_0x66fb('0x30')]=_['keys'](_0x1babe1[_0x66fb('0x30')]);_0x21ad49[_0x66fb('0x31')]=_['intersection'](_0x21ad49[_0x66fb('0x2f')],_0x21ad49[_0x66fb('0x30')]);_0x1ca6dc[_0x66fb('0x32')]=_[_0x66fb('0x33')](_0x21ad49[_0x66fb('0x2f')],qs['fields'](_0x1babe1[_0x66fb('0x30')][_0x66fb('0x34')]));_0x1ca6dc['attributes']=_0x1ca6dc[_0x66fb('0x32')][_0x66fb('0x35')]?_0x1ca6dc[_0x66fb('0x32')]:_0x21ad49[_0x66fb('0x2f')];if(!_0x1babe1[_0x66fb('0x30')]['hasOwnProperty'](_0x66fb('0x36'))){_0x1ca6dc['limit']=qs[_0x66fb('0x23')](_0x1babe1[_0x66fb('0x30')][_0x66fb('0x23')]);_0x1ca6dc['offset']=qs[_0x66fb('0x21')](_0x1babe1[_0x66fb('0x30')][_0x66fb('0x21')]);}_0x1ca6dc[_0x66fb('0x37')]=qs[_0x66fb('0x38')](_0x1babe1[_0x66fb('0x30')][_0x66fb('0x38')]);_0x1ca6dc[_0x66fb('0x39')]=qs['filters'](_[_0x66fb('0x3a')](_0x1babe1['query'],_0x21ad49['filters']),_0x434a25);if(_0x1babe1[_0x66fb('0x30')][_0x66fb('0x3b')]){_0x1ca6dc[_0x66fb('0x39')]=_[_0x66fb('0x3c')](_0x1ca6dc[_0x66fb('0x39')],{'$or':_[_0x66fb('0x2c')](_0x434a25,function(_0x2d5941){if(_0x2d5941[_0x66fb('0x2d')]!=='VIRTUAL'){var _0x19bc03={};_0x19bc03[_0x2d5941[_0x66fb('0x2b')]]={'$like':'%'+_0x1babe1[_0x66fb('0x30')][_0x66fb('0x3b')]+'%'};return _0x19bc03;}})});}_0x1ca6dc=_[_0x66fb('0x3c')]({},_0x1ca6dc,_0x1babe1[_0x66fb('0x3d')]);var _0x17ae24={'where':_0x1ca6dc['where']};return db[_0x66fb('0x3e')]['count'](_0x17ae24)['then'](function(_0x2d31ff){_0x2d5a0c[_0x66fb('0x24')]=_0x2d31ff;if(_0x1babe1[_0x66fb('0x30')][_0x66fb('0x3f')]){_0x1ca6dc[_0x66fb('0x40')]=[{'all':!![]}];}return db[_0x66fb('0x3e')][_0x66fb('0x41')](_0x1ca6dc);})[_0x66fb('0x29')](function(_0x3c8c1f){_0x2d5a0c[_0x66fb('0x42')]=_0x3c8c1f;return _0x2d5a0c;})['then'](respondWithFilteredResult(_0x235ada,_0x1ca6dc))[_0x66fb('0x1f')](handleError(_0x235ada,null));};exports[_0x66fb('0x43')]=function(_0x34a525,_0x566750){var _0x587b04={'raw':!![],'where':{'id':_0x34a525[_0x66fb('0x44')]['id']}},_0x45c0dc={};_0x45c0dc[_0x66fb('0x2f')]=_[_0x66fb('0x45')](db['MailMessage'][_0x66fb('0x46')]);_0x45c0dc['query']=_[_0x66fb('0x45')](_0x34a525[_0x66fb('0x30')]);_0x45c0dc[_0x66fb('0x31')]=_[_0x66fb('0x33')](_0x45c0dc['model'],_0x45c0dc[_0x66fb('0x30')]);_0x587b04[_0x66fb('0x32')]=_[_0x66fb('0x33')](_0x45c0dc['model'],qs[_0x66fb('0x34')](_0x34a525[_0x66fb('0x30')][_0x66fb('0x34')]));_0x587b04[_0x66fb('0x32')]=_0x587b04[_0x66fb('0x32')][_0x66fb('0x35')]?_0x587b04[_0x66fb('0x32')]:_0x45c0dc[_0x66fb('0x2f')];if(_0x34a525[_0x66fb('0x30')][_0x66fb('0x3f')]){_0x587b04[_0x66fb('0x40')]=[{'all':!![]}];}_0x587b04=_['merge']({},_0x587b04,_0x34a525[_0x66fb('0x3d')]);return db['MailMessage'][_0x66fb('0x47')](_0x587b04)[_0x66fb('0x29')](handleEntityNotFound(_0x566750,null))[_0x66fb('0x29')](respondWithResult(_0x566750,null))[_0x66fb('0x1f')](handleError(_0x566750,null));};exports[_0x66fb('0x28')]=function(_0x39994e,_0x364999){if(_0x39994e[_0x66fb('0x48')]['id']){delete _0x39994e[_0x66fb('0x48')]['id'];}return db[_0x66fb('0x3e')]['find']({'where':{'id':_0x39994e[_0x66fb('0x44')]['id']}})[_0x66fb('0x29')](handleEntityNotFound(_0x364999,null))[_0x66fb('0x29')](saveUpdates(_0x39994e[_0x66fb('0x48')],null))[_0x66fb('0x29')](respondWithResult(_0x364999,null))['catch'](handleError(_0x364999,null));};exports['destroy']=function(_0x511246,_0x2c4756){return db[_0x66fb('0x3e')]['find']({'where':{'id':_0x511246['params']['id']}})[_0x66fb('0x29')](handleEntityNotFound(_0x2c4756,null))[_0x66fb('0x29')](removeEntity(_0x2c4756,null))['catch'](handleError(_0x2c4756,null));};exports['describe']=function(_0xb616,_0x159323){return db['MailMessage']['describe']()[_0x66fb('0x29')](respondWithResult(_0x159323,null))['catch'](handleError(_0x159323,null));};exports[_0x66fb('0x49')]=function(_0x436b77,_0x731d37){return db[_0x66fb('0x3e')][_0x66fb('0x49')](_0x436b77[_0x66fb('0x48')])['then'](function(_0xb28d24){if(_0xb28d24){if(_0xb28d24['direction']===_0x66fb('0x4a')&&!_0xb28d24['secret']){var _0x4cdedb,_0x41e624,_0x3096b2;if(_0x436b77['body']['to']){_0x41e624=_0x436b77['body']['to'][_0x66fb('0x4b')](',')[0x0];}return db[_0x66fb('0x4c')]['findOne']({'where':{'id':_0xb28d24['MailAccountId']},'include':[{'model':db[_0x66fb('0x4d')],'as':'List','include':[{'model':db['CmContact'],'as':_0x66fb('0x4e'),'where':{'email':_0x41e624},'limit':0x1,'order':[[_0x66fb('0x4f'),_0x66fb('0x50')]]}]},{'model':db['MailServerOut'],'as':_0x66fb('0x51'),'raw':!![],'include':[{'model':db[_0x66fb('0x52')],'as':'CloudProvider','raw':!![]}]}]})[_0x66fb('0x29')](function(_0x251742){_0x4cdedb=_0x251742;if(!_0x4cdedb||!_0x4cdedb['Smtp'])return;var _0x2e6843=_0x4cdedb[_0x66fb('0x53')]();if(_0x436b77[_0x66fb('0x48')][_0x66fb('0x54')]&&_0x436b77[_0x66fb('0x48')]['attachments']['length']){for(var _0x2b0fd5=0x0;_0x2b0fd5<_0x436b77[_0x66fb('0x48')][_0x66fb('0x54')]['length'];_0x2b0fd5+=0x1){_0x436b77[_0x66fb('0x48')]['attachments'][_0x2b0fd5]={'filename':_0x436b77[_0x66fb('0x48')][_0x66fb('0x54')][_0x2b0fd5]['name'],'path':path['join'](config[_0x66fb('0x55')],_0x66fb('0x56'),_0x436b77[_0x66fb('0x48')]['attachments'][_0x2b0fd5][_0x66fb('0x57')])};}}_0x3096b2={'account':_0x2e6843,'message':_0x436b77[_0x66fb('0x48')]};return;})[_0x66fb('0x29')](function(){if(_0x4cdedb[_0x66fb('0x58')]){if(_0x4cdedb['List'][_0x66fb('0x4e')]['length']){return _0x4cdedb['List'][_0x66fb('0x4e')][0x0];}else{return db[_0x66fb('0x59')]['create'](_[_0x66fb('0xd')](_0x436b77['body'],{'firstName':_0x436b77['body']['to'],'email':_0x436b77[_0x66fb('0x48')]['to'],'phone':_0x436b77[_0x66fb('0x48')]['to'],'ListId':_0x4cdedb['ListId']}));}}else{throw new Error(_0x66fb('0x5a'));}})[_0x66fb('0x29')](function(){if(_0x3096b2){return respondWithRpcPromise(_0x66fb('0x5b'),_0x66fb('0x5c'),_0x3096b2,client9003)[_0x66fb('0x29')](function(_0x6a1786){return _0xb28d24[_0x66fb('0x28')]({'read':!![],'messageId':_0x6a1786[_0x66fb('0x5d')],'sentAt':moment()[_0x66fb('0x5e')](_0x66fb('0x5f'))});})['catch'](function(_0x502dee){logger[_0x66fb('0x1b')]('%s',JSON['stringify'](_0x502dee));return _0xb28d24;});}return _0xb28d24;});}return _0xb28d24;}})[_0x66fb('0x29')](respondWithResult(_0x731d37,0xc9))[_0x66fb('0x1f')](handleError(_0x731d37,null));};exports[_0x66fb('0x60')]=function(_0x3de9ba,_0x4df479){var _0x13b98d={'agent':{},'channel':'mail'};if(_0x3de9ba['body']['id']){delete _0x3de9ba[_0x66fb('0x48')]['id'];}_0x3de9ba[_0x66fb('0x48')][_0x66fb('0x61')]=!![];_0x3de9ba[_0x66fb('0x48')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3de9ba[_0x66fb('0x48')][_0x66fb('0x62')]=_0x3de9ba[_0x66fb('0x48')][_0x66fb('0x62')]||_0x3de9ba[_0x66fb('0x63')]['id'];_0x13b98d[_0x66fb('0x64')]['id']=_0x3de9ba[_0x66fb('0x48')][_0x66fb('0x62')];return db['MailMessage'][_0x66fb('0x47')]({'where':{'id':_0x3de9ba[_0x66fb('0x44')]['id'],'UserId':null}})[_0x66fb('0x29')](handleEntityNotFound(_0x4df479,null))['then'](saveUpdates(_0x3de9ba['body'],null))[_0x66fb('0x29')](function(_0x24b65){if(_0x24b65){_0x13b98d[_0x66fb('0x1d')]=_0x24b65[_0x66fb('0x65')]({'plain':!![]});return db[_0x66fb('0x66')][_0x66fb('0x47')]({'where':{'id':_0x24b65[_0x66fb('0x67')]}});}return null;})[_0x66fb('0x29')](handleEntityNotFound(_0x4df479,null))['then'](function(_0x5f23a8){if(_0x5f23a8){return _0x5f23a8[_0x66fb('0x28')]({'UserId':_0x3de9ba[_0x66fb('0x48')][_0x66fb('0x62')],'read1stAt':_['isNil'](_0x5f23a8[_0x66fb('0x68')])?moment()[_0x66fb('0x5e')](_0x66fb('0x5f')):undefined});}return null;})['then'](function(_0x5717e8){if(_0x5717e8){_0x13b98d[_0x66fb('0x69')]=_0x5717e8[_0x66fb('0x65')]({'plain':!![]});interaction_log[_0x66fb('0x15')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3de9ba[_0x66fb('0x63')]['id'],_0x3de9ba[_0x66fb('0x63')]['name'],_0x3de9ba[_0x66fb('0x63')][_0x66fb('0x6a')],_0x13b98d[_0x66fb('0x69')]['id'],_0x3de9ba['body']?JSON[_0x66fb('0x1a')](_0x3de9ba[_0x66fb('0x48')]):_0x66fb('0x6b'));return respondWithRpcPromise(_0x66fb('0x6c'),_0x66fb('0x6d'),_0x13b98d);}return null;})['then'](function(_0x42ad4a){var _0x10cf22='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x42ad4a[_0x66fb('0x1d')][_0x66fb('0x6e')];return db[_0x66fb('0x6f')][_0x66fb('0x30')](_0x10cf22,{'type':db[_0x66fb('0x70')]['QueryTypes'][_0x66fb('0x71')],'raw':!![]})[_0x66fb('0x29')](function(_0x4e1f1f){return _0x4e1f1f;});})[_0x66fb('0x29')](function(_0x5b193c){if(_0x5b193c){_0x13b98d['message']['contact']=_0x5b193c[0x0];if(!_0x3de9ba[_0x66fb('0x48')][_0x66fb('0x62')])return;return db[_0x66fb('0x72')][_0x66fb('0x47')]({'where':{'id':_0x3de9ba[_0x66fb('0x48')][_0x66fb('0x62')],'role':_0x66fb('0x64')},'attributes':['id',_0x66fb('0x2b'),_0x66fb('0x73'),_0x66fb('0x74'),_0x66fb('0x75')],'raw':!![]});}return null;})[_0x66fb('0x29')](function(_0x2c0ea0){if(!_0x2c0ea0)return null;_0x13b98d[_0x66fb('0x1d')][_0x66fb('0x64')]=_0x2c0ea0;return _0x13b98d;})[_0x66fb('0x29')](function(_0x1d92e2){if(_0x1d92e2){if(_0x3de9ba[_0x66fb('0x48')]['manual']){_0x13b98d[_0x66fb('0x1d')][_0x66fb('0x76')]=util[_0x66fb('0x5e')](_0x66fb('0x77'),_0x3de9ba[_0x66fb('0x63')][_0x66fb('0x2b')]);_0x13b98d[_0x66fb('0x1d')][_0x66fb('0x78')]=_0x13b98d[_0x66fb('0x78')];_0x13b98d[_0x66fb('0x1d')][_0x66fb('0x79')]=_0x13b98d[_0x66fb('0x78')];_0x13b98d[_0x66fb('0x1d')][_0x66fb('0x7a')]='accept';_0x13b98d[_0x66fb('0x1d')][_0x66fb('0x48')]=htmlToText[_0x66fb('0x7b')](_0x13b98d[_0x66fb('0x1d')][_0x66fb('0x48')]);return respondWithRpcPromise('EventManager',_0x66fb('0x7c'),{'event':_0x66fb('0x7d'),'message':_0x13b98d['message']},client9002)[_0x66fb('0x29')](function(){return _0x13b98d;});}return _0x13b98d;}return null;})[_0x66fb('0x29')](respondWithResult(_0x4df479,null))[_0x66fb('0x1f')](handleError(_0x4df479,null));};exports['reject']=function(_0x513717,_0xb3ce68){var _0x4c6b6e={'agent':{},'channel':_0x66fb('0x7e')};if(_0x513717[_0x66fb('0x48')]['id']){delete _0x513717[_0x66fb('0x48')]['id'];}_0x513717['body'][_0x66fb('0x62')]=_0x513717[_0x66fb('0x48')][_0x66fb('0x62')]||_0x513717['user']['id'];_0x4c6b6e['agent']['id']=_0x513717['body'][_0x66fb('0x62')];return db[_0x66fb('0x3e')]['find']({'where':{'id':_0x513717[_0x66fb('0x44')]['id'],'UserId':null}})[_0x66fb('0x29')](handleEntityNotFound(_0xb3ce68,null))['then'](function(_0x2d85c9){if(_0x2d85c9){_0x4c6b6e['message']=_0x2d85c9[_0x66fb('0x65')]({'plain':!![]});return db[_0x66fb('0x66')]['find']({'where':{'id':_0x2d85c9['MailInteractionId']}});}return null;})[_0x66fb('0x29')](handleEntityNotFound(_0xb3ce68,null))[_0x66fb('0x29')](function(_0x434882){if(_0x434882){_0x4c6b6e[_0x66fb('0x69')]=_0x434882[_0x66fb('0x65')]({'plain':!![]});interaction_log[_0x66fb('0x15')](_0x66fb('0x7f'),_0x513717[_0x66fb('0x63')]['id'],_0x513717[_0x66fb('0x63')][_0x66fb('0x2b')],_0x513717[_0x66fb('0x63')][_0x66fb('0x6a')],_0x4c6b6e[_0x66fb('0x69')]['id'],_0x513717[_0x66fb('0x48')]?JSON['stringify'](_0x513717[_0x66fb('0x48')]):'null');return respondWithRpcPromise(_0x66fb('0x80'),_0x66fb('0x81'),_0x4c6b6e);}return null;})['then'](function(_0x47009d){var _0x1094bf=_0x66fb('0x82')+_0x47009d[_0x66fb('0x1d')][_0x66fb('0x6e')];return db[_0x66fb('0x6f')][_0x66fb('0x30')](_0x1094bf,{'type':db[_0x66fb('0x70')][_0x66fb('0x83')]['SELECT'],'raw':!![]})[_0x66fb('0x29')](function(_0x7bcb4a){return _0x7bcb4a;});})[_0x66fb('0x29')](function(_0x205d7e){if(_0x205d7e){_0x4c6b6e[_0x66fb('0x1d')][_0x66fb('0x84')]=_0x205d7e[0x0];if(!_0x513717[_0x66fb('0x48')][_0x66fb('0x62')])return;return db[_0x66fb('0x72')][_0x66fb('0x47')]({'where':{'id':_0x513717[_0x66fb('0x48')][_0x66fb('0x62')],'role':_0x66fb('0x64')},'attributes':['id',_0x66fb('0x2b'),'fullname',_0x66fb('0x74'),'internal'],'raw':!![]});}return null;})[_0x66fb('0x29')](function(_0xc3e632){if(!_0xc3e632)return null;_0x4c6b6e[_0x66fb('0x1d')][_0x66fb('0x64')]=_0xc3e632;return _0x4c6b6e;})['then'](function(_0x473860){if(_0x473860){_0x473860['message'][_0x66fb('0x76')]=util['format'](_0x66fb('0x77'),_0x513717['user']['name']);_0x473860[_0x66fb('0x1d')][_0x66fb('0x78')]=_0x4c6b6e[_0x66fb('0x78')];_0x473860['message']['motionChannel']=_0x4c6b6e[_0x66fb('0x78')];_0x473860[_0x66fb('0x1d')][_0x66fb('0x7a')]=_0x66fb('0x85');_0x473860[_0x66fb('0x1d')][_0x66fb('0x48')]=htmlToText[_0x66fb('0x7b')](_0x4c6b6e[_0x66fb('0x1d')][_0x66fb('0x48')]);respondWithRpcPromise(_0x66fb('0x7c'),_0x66fb('0x7c'),{'event':_0x66fb('0x86'),'message':_0x473860[_0x66fb('0x1d')]},client9002);return _0x4c6b6e;}return null;})[_0x66fb('0x29')](respondWithResult(_0xb3ce68,null))[_0x66fb('0x1f')](handleError(_0xb3ce68,null));};exports['download']=function(_0x3a8a3c,_0x4599d1){var _0x5b3f1a=moment()[_0x66fb('0x87')]()[_0x66fb('0x88')]();var _0x441891=path[_0x66fb('0x89')](config[_0x66fb('0x55')],_0x66fb('0x8a'),_0x66fb('0x8b'),_0x66fb('0x8c'));var _0x109268=path[_0x66fb('0x89')](config[_0x66fb('0x55')],'server','files',_0x66fb('0x54'));var _0x80144a=util[_0x66fb('0x5e')](_0x66fb('0x8d'),_0x5b3f1a);return db['MailMessage']['find']({'where':{'id':_0x3a8a3c[_0x66fb('0x44')]['id']},'attributes':['id','body',_0x66fb('0x8e'),'to','cc',_0x66fb('0x8f'),'subject',_0x66fb('0x90')],'include':_0x3a8a3c[_0x66fb('0x30')][_0x66fb('0x54')]?[{'model':db[_0x66fb('0x91')],'as':_0x66fb('0x92')}]:undefined})[_0x66fb('0x29')](handleEntityNotFound(_0x4599d1,null))['then'](function(_0x521080){if(_0x521080){var _0xb324c=_0x521080;var _0x2fbd8d={'from':_0xb324c[_0x66fb('0x8e')],'to':_0xb324c['to'],'subject':_0xb324c[_0x66fb('0x93')],'html':htmlEntities['decode'](_0xb324c[_0x66fb('0x48')]),'headers':{'Date':moment(_0xb324c[_0x66fb('0x90')])[_0x66fb('0x5e')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x521080['cc']){_0x2fbd8d[_0x66fb('0x94')]['Cc']=_0x521080['cc'];}if(_0x521080[_0x66fb('0x8f')]){_0x2fbd8d[_0x66fb('0x94')][_0x66fb('0x95')]=_0x521080[_0x66fb('0x8f')];}return new BPromise(function(_0x12879b,_0xbbe9d3){if(_0x521080[_0x66fb('0x92')]){for(var _0x87a09=0x0;_0x87a09<_0x521080[_0x66fb('0x92')]['length'];_0x87a09++){var _0x44c0bb=_0x521080[_0x66fb('0x92')][_0x87a09];var _0x28e2bd=path[_0x66fb('0x89')](_0x109268,_0x44c0bb[_0x66fb('0x57')]);if(fs[_0x66fb('0x96')](_0x28e2bd)){_0x2fbd8d[_0x66fb('0x54')]['push']({'name':_0x44c0bb[_0x66fb('0x2b')],'contentType':_0x44c0bb[_0x66fb('0x2d')],'data':fs[_0x66fb('0x97')](_0x28e2bd)});}}}emlformat[_0x66fb('0x98')](_0x2fbd8d,function(_0x390ba7,_0x317516){if(_0x390ba7)return _0xbbe9d3(_0x390ba7);fs[_0x66fb('0x99')](path['join'](_0x441891,_0x80144a),_0x317516);return _0x12879b(_0x317516);});});}})[_0x66fb('0x29')](function(_0x2166be){if(_0x2166be){return _0x4599d1['download'](path[_0x66fb('0x89')](_0x441891,_0x80144a),_0x80144a,function(_0x46d36e){if(!_0x46d36e)fs[_0x66fb('0x9a')](path[_0x66fb('0x89')](_0x441891,_0x80144a));});}})[_0x66fb('0x1f')](handleError(_0x4599d1,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 2e69042..2f67d76 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 _0xcdd9=['hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners','save','update','emit'];(function(_0x6d1eb6,_0x5869b6){var _0x155fad=function(_0x1f9b7b){while(--_0x1f9b7b){_0x6d1eb6['push'](_0x6d1eb6['shift']());}};_0x155fad(++_0x5869b6);}(_0xcdd9,0x6f));var _0x9cdd=function(_0x868206,_0x398ff2){_0x868206=_0x868206-0x0;var _0x3ba51f=_0xcdd9[_0x868206];return _0x3ba51f;};'use strict';var EventEmitter=require(_0x9cdd('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x9cdd('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9cdd('0x2')](0x0);var events={'afterCreate':_0x9cdd('0x3'),'afterUpdate':_0x9cdd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x12c7e2){return function(_0x159459,_0x27c065,_0x2a2fdd){MailMessageEvents[_0x9cdd('0x5')](_0x12c7e2+':'+_0x159459['id'],_0x159459);MailMessageEvents[_0x9cdd('0x5')](_0x12c7e2,_0x159459);_0x2a2fdd(null);};}for(var e in events){if(events[_0x9cdd('0x6')](e)){var event=events[e];MailMessage[_0x9cdd('0x7')](e,emitEvent(event));}}module[_0x9cdd('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x945b=['emit','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x2f5d33,_0x52e067){var _0x3acb90=function(_0x581cda){while(--_0x581cda){_0x2f5d33['push'](_0x2f5d33['shift']());}};_0x3acb90(++_0x52e067);}(_0x945b,0x89));var _0xb945=function(_0x523524,_0x271843){_0x523524=_0x523524-0x0;var _0x1597d9=_0x945b[_0x523524];return _0x1597d9;};'use strict';var EventEmitter=require(_0xb945('0x0'));var MailMessage=require(_0xb945('0x1'))['db'][_0xb945('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb945('0x3')](0x0);var events={'afterCreate':_0xb945('0x4'),'afterUpdate':_0xb945('0x5'),'afterDestroy':_0xb945('0x6')};function emitEvent(_0x123157){return function(_0x24ad87,_0x2646f1,_0x47f796){MailMessageEvents['emit'](_0x123157+':'+_0x24ad87['id'],_0x24ad87);MailMessageEvents[_0xb945('0x7')](_0x123157,_0x24ad87);_0x47f796(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xb945('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 5ea60c6..a4ec2b3 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 _0x50fc=['direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','error','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','exports','define','mail_messages','messageId','subject','fromString','body','models'];(function(_0xa0c655,_0x479a6a){var _0x3b8b6b=function(_0x2ad057){while(--_0x2ad057){_0xa0c655['push'](_0xa0c655['shift']());}};_0x3b8b6b(++_0x479a6a);}(_0x50fc,0x175));var _0xc50f=function(_0x1e8461,_0x5e1500){_0x1e8461=_0x1e8461-0x0;var _0x528f4d=_0x50fc[_0x1e8461];return _0x528f4d;};'use strict';var _=require(_0xc50f('0x0'));var util=require('util');var logger=require(_0xc50f('0x1'))(_0xc50f('0x2'));var moment=require(_0xc50f('0x3'));var BPromise=require(_0xc50f('0x4'));var rp=require(_0xc50f('0x5'));var htmlToText=require(_0xc50f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc50f('0x7'));var config=require(_0xc50f('0x8'));var attributes=require('./mailMessage.attributes');module[_0xc50f('0x9')]=function(_0x23d82c,_0x1c0490){return _0x23d82c[_0xc50f('0xa')]('MailMessage',attributes,{'tableName':_0xc50f('0xb'),'paranoid':![],'indexes':[{'name':_0xc50f('0xc'),'fields':[_0xc50f('0xc')]},{'name':'fti_mail_messages','fields':['plainBody',_0xc50f('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x15ea08,_0xe5040,_0x320cf2){if(_0x15ea08['body']){_0x15ea08['plainBody']=htmlToText[_0xc50f('0xe')](_0x15ea08[_0xc50f('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x320cf2(null,_0xe5040);},'afterCreate':function(_0x25c2a7,_0x522268,_0x496961){var _0x1ac618=_0x23d82c[_0xc50f('0x10')];var _0x49ba43=_0x25c2a7['get']({'plain':!![]});if(_0x49ba43[_0xc50f('0x11')][_0xc50f('0x12')]()==='in'||_0x49ba43[_0xc50f('0x11')][_0xc50f('0x12')]()==='out'&&!_0x49ba43[_0xc50f('0x13')]&&!_[_0xc50f('0x14')](_0x49ba43[_0xc50f('0x15')])){_0x1ac618[_0xc50f('0x16')][_0xc50f('0x17')]({'where':{'id':_0x49ba43[_0xc50f('0x18')]}})[_0xc50f('0x19')](function(_0x500467){if(_0x500467){_0x500467[_0xc50f('0x1a')]({'lastMsgAt':_0x49ba43['createdAt'],'lastMsgDirection':_0x49ba43[_0xc50f('0x11')][_0xc50f('0x12')]()});}})[_0xc50f('0x1b')](function(_0x23ecec){console[_0xc50f('0x1c')](_0x23ecec);});}_0x496961();}},'charset':_0xc50f('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc470=['toLowerCase','catch','error','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','fromString','body','models','direction','out','UserId','MailInteraction','MailInteractionId','then','update','createdAt'];(function(_0x529a0f,_0x328763){var _0x187a88=function(_0x1ea706){while(--_0x1ea706){_0x529a0f['push'](_0x529a0f['shift']());}};_0x187a88(++_0x328763);}(_0xc470,0x99));var _0x0c47=function(_0x230115,_0x522113){_0x230115=_0x230115-0x0;var _0x48de38=_0xc470[_0x230115];return _0x48de38;};'use strict';var _=require(_0x0c47('0x0'));var util=require('util');var logger=require(_0x0c47('0x1'))('api');var moment=require(_0x0c47('0x2'));var BPromise=require(_0x0c47('0x3'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x0c47('0x4'));var rimraf=require(_0x0c47('0x5'));var config=require(_0x0c47('0x6'));var attributes=require(_0x0c47('0x7'));module[_0x0c47('0x8')]=function(_0x5033a7,_0x128742){return _0x5033a7[_0x0c47('0x9')](_0x0c47('0xa'),attributes,{'tableName':_0x0c47('0xb'),'paranoid':![],'indexes':[{'name':_0x0c47('0xc'),'fields':[_0x0c47('0xc')]},{'name':_0x0c47('0xd'),'fields':[_0x0c47('0xe'),'subject'],'type':_0x0c47('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa1b4d9,_0x37d19b,_0x12c18f){if(_0xa1b4d9['body']){_0xa1b4d9[_0x0c47('0xe')]=htmlToText[_0x0c47('0x10')](_0xa1b4d9[_0x0c47('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x12c18f(null,_0x37d19b);},'afterCreate':function(_0x4f098f,_0x2c07af,_0x16f08c){var _0x50606e=_0x5033a7[_0x0c47('0x12')];var _0x3df69f=_0x4f098f['get']({'plain':!![]});if(_0x3df69f['direction']['toLowerCase']()==='in'||_0x3df69f[_0x0c47('0x13')]['toLowerCase']()===_0x0c47('0x14')&&!_0x3df69f['secret']&&!_['isNil'](_0x3df69f[_0x0c47('0x15')])){_0x50606e[_0x0c47('0x16')]['findOne']({'where':{'id':_0x3df69f[_0x0c47('0x17')]}})[_0x0c47('0x18')](function(_0x399c7c){if(_0x399c7c){_0x399c7c[_0x0c47('0x19')]({'lastMsgAt':_0x3df69f[_0x0c47('0x1a')],'lastMsgDirection':_0x3df69f[_0x0c47('0x13')][_0x0c47('0x1b')]()});}})[_0x0c47('0x1c')](function(_0x1cbe35){console[_0x0c47('0x1d')](_0x1cbe35);});}_0x16f08c();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 34952e7..2d79b78 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 _0x3de3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','CreateMailMessage','MailMessage','create','options','catch','lodash','moment','bluebird'];(function(_0x377e8a,_0x1eac5f){var _0x262b83=function(_0x46ee38){while(--_0x46ee38){_0x377e8a['push'](_0x377e8a['shift']());}};_0x262b83(++_0x1eac5f);}(_0x3de3,0x1ce));var _0x33de=function(_0x2bd93e,_0x417689){_0x2bd93e=_0x2bd93e-0x0;var _0x44461d=_0x3de3[_0x2bd93e];return _0x44461d;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});config['redis']=_[_0x33de('0xa')](config[_0x33de('0xb')],{'host':_0x33de('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33de('0xb')]));require(_0x33de('0xd'))[_0x33de('0xe')](socket);function respondWithRpcPromise(_0x5e1be7,_0x2cbf35,_0x348720){return new BPromise(function(_0x8b655d,_0x241211){return client[_0x33de('0xf')](_0x5e1be7,_0x348720)[_0x33de('0x10')](function(_0x8dfa3b){logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,_0x33de('0x13'));logger[_0x33de('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2cbf35,_0x33de('0x13'),JSON[_0x33de('0x15')](_0x8dfa3b));if(_0x8dfa3b['error']){if(_0x8dfa3b['error'][_0x33de('0x16')]===0x1f4){logger[_0x33de('0x17')](_0x33de('0x12'),_0x2cbf35,_0x8dfa3b[_0x33de('0x17')]['message']);return _0x241211(_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);return _0x8b655d(_0x8dfa3b[_0x33de('0x17')]['message']);}else{logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,'request\x20sent');_0x8b655d(_0x8dfa3b[_0x33de('0x19')][_0x33de('0x18')]);}})['catch'](function(_0x5bb74e){logger[_0x33de('0x17')]('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x5bb74e);_0x241211(_0x5bb74e);});});}exports[_0x33de('0x1a')]=function(_0x2f0529){var _0x3810b5=this;return new Promise(function(_0x315c9b,_0xc4f1a4){return db[_0x33de('0x1b')][_0x33de('0x1c')](_0x2f0529['body'],{'raw':_0x2f0529['options']?_0x2f0529[_0x33de('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x33de('0x10')](function(_0x4cd8db){logger[_0x33de('0x11')](_0x33de('0x1a'),_0x2f0529);logger['debug'](_0x33de('0x1a'),_0x2f0529,JSON['stringify'](_0x4cd8db));_0x315c9b(_0x4cd8db);})[_0x33de('0x1e')](function(_0x5c602d){logger[_0x33de('0x17')](_0x33de('0x1a'),_0x5c602d[_0x33de('0x18')],_0x2f0529);_0xc4f1a4(_0x3810b5['error'](0x1f4,_0x5c602d[_0x33de('0x18')]));});});}; \ No newline at end of file +var _0x63a5=['error','message','result','catch','body','options','raw','CreateMailMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x233001,_0x2c1ff2){var _0x1be5ee=function(_0x25c5ec){while(--_0x25c5ec){_0x233001['push'](_0x233001['shift']());}};_0x1be5ee(++_0x2c1ff2);}(_0x63a5,0x18e));var _0x563a=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x63a5[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});config[_0x563a('0x9')]=_[_0x563a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x563a('0xb'))(new Redis(config[_0x563a('0x9')]));require(_0x563a('0xc'))[_0x563a('0xd')](socket);function respondWithRpcPromise(_0x255922,_0xa61ffa,_0xd1b480){return new BPromise(function(_0x381fab,_0x3e97a8){return client[_0x563a('0xe')](_0x255922,_0xd1b480)[_0x563a('0xf')](function(_0x2361dd){logger[_0x563a('0x10')](_0x563a('0x11'),_0xa61ffa,'request\x20sent');logger[_0x563a('0x12')](_0x563a('0x13'),_0xa61ffa,_0x563a('0x14'),JSON[_0x563a('0x15')](_0x2361dd));if(_0x2361dd[_0x563a('0x16')]){if(_0x2361dd[_0x563a('0x16')]['code']===0x1f4){logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);return _0x3e97a8(_0x2361dd['error']['message']);}logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd['error'][_0x563a('0x17')]);return _0x381fab(_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);}else{logger[_0x563a('0x10')]('MailMessage,\x20%s,\x20%s',_0xa61ffa,'request\x20sent');_0x381fab(_0x2361dd[_0x563a('0x18')][_0x563a('0x17')]);}})[_0x563a('0x19')](function(_0x526a51){logger['error']('MailMessage,\x20%s,\x20%s',_0xa61ffa,_0x526a51);_0x3e97a8(_0x526a51);});});}exports['CreateMailMessage']=function(_0x40916a){var _0x300956=this;return new Promise(function(_0x26061f,_0x43b7a8){return db['MailMessage']['create'](_0x40916a[_0x563a('0x1a')],{'raw':_0x40916a[_0x563a('0x1b')]?_0x40916a[_0x563a('0x1b')][_0x563a('0x1c')]===undefined?!![]:![]:!![]})[_0x563a('0xf')](function(_0x2dc7e2){logger[_0x563a('0x10')](_0x563a('0x1d'),_0x40916a);logger['debug'](_0x563a('0x1d'),_0x40916a,JSON['stringify'](_0x2dc7e2));_0x26061f(_0x2dc7e2);})[_0x563a('0x19')](function(_0xd3e0ae){logger[_0x563a('0x16')](_0x563a('0x1d'),_0xd3e0ae[_0x563a('0x17')],_0x40916a);_0x43b7a8(_0x300956[_0x563a('0x16')](0x1f4,_0xd3e0ae[_0x563a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 7e28de6..4f923d1 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 _0xec56=['removeListener','register','length','mailMessage:','./mailMessage.events','update','emit'];(function(_0x431e6c,_0x210cda){var _0x4e42df=function(_0x367acb){while(--_0x367acb){_0x431e6c['push'](_0x431e6c['shift']());}};_0x4e42df(++_0x210cda);}(_0xec56,0x1bd));var _0x6ec5=function(_0x4eeb73,_0x2f8cf5){_0x4eeb73=_0x4eeb73-0x0;var _0x50c6be=_0xec56[_0x4eeb73];return _0x50c6be;};'use strict';var MailMessageEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){MailMessageEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);MailMessageEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file +var _0x4124=['length','./mailMessage.events','save','remove','update','emit','register'];(function(_0xf287e9,_0x2cb74e){var _0x1adfd6=function(_0x446b55){while(--_0x446b55){_0xf287e9['push'](_0xf287e9['shift']());}};_0x1adfd6(++_0x2cb74e);}(_0x4124,0x1c1));var _0x4412=function(_0x282a85,_0x52fb8b){_0x282a85=_0x282a85-0x0;var _0x544f40=_0x4124[_0x282a85];return _0x544f40;};'use strict';var MailMessageEvents=require(_0x4412('0x0'));var events=[_0x4412('0x1'),_0x4412('0x2'),_0x4412('0x3')];function createListener(_0x3bd0ad,_0x151cce){return function(_0x20894c){_0x151cce[_0x4412('0x4')](_0x3bd0ad,_0x20894c);};}function removeListener(_0x2e871b,_0x1f9976){return function(){MailMessageEvents['removeListener'](_0x2e871b,_0x1f9976);};}exports[_0x4412('0x5')]=function(_0x1bbb1c){for(var _0x2e7a6b=0x0,_0x4b5ed9=events[_0x4412('0x6')];_0x2e7a6b<_0x4b5ed9;_0x2e7a6b++){var _0x4e4d65=events[_0x2e7a6b];var _0x1674cf=createListener('mailMessage:'+_0x4e4d65,_0x1bbb1c);MailMessageEvents['on'](_0x4e4d65,_0x1674cf);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6be1bf7..df1f0f3 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 _0xeab2=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeab2,0x135));var _0x2eab=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0xeab2[_0x43f489];return _0x4134b4;};'use strict';var multer=require(_0x2eab('0x0'));var util=require(_0x2eab('0x1'));var path=require(_0x2eab('0x2'));var timeout=require(_0x2eab('0x3'));var express=require(_0x2eab('0x4'));var router=express[_0x2eab('0x5')]();var fs_extra=require(_0x2eab('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2eab('0x7'));var config=require('../../config/environment');var controller=require(_0x2eab('0x8'));router[_0x2eab('0x9')]('/',auth[_0x2eab('0xa')](),controller['index']);router[_0x2eab('0x9')](_0x2eab('0xb'),auth[_0x2eab('0xa')](),controller[_0x2eab('0xc')]);router[_0x2eab('0x9')](_0x2eab('0xd'),auth[_0x2eab('0xa')](),controller[_0x2eab('0xe')]);router[_0x2eab('0x9')](_0x2eab('0xf'),auth[_0x2eab('0xa')](),controller[_0x2eab('0x10')]);router['get'](_0x2eab('0x11'),auth[_0x2eab('0xa')](),controller[_0x2eab('0x12')]);router['get'](_0x2eab('0x13'),auth['isAuthenticated'](),controller[_0x2eab('0x14')]);router[_0x2eab('0x15')]('/',auth[_0x2eab('0xa')](),controller[_0x2eab('0x16')]);router[_0x2eab('0x15')]('/:id/teams',auth[_0x2eab('0xa')](),controller['addTeams']);router[_0x2eab('0x15')](_0x2eab('0x13'),auth[_0x2eab('0xa')](),controller[_0x2eab('0x17')]);router[_0x2eab('0x18')](_0x2eab('0xd'),auth[_0x2eab('0xa')](),controller[_0x2eab('0x19')]);router[_0x2eab('0x1a')](_0x2eab('0xd'),auth[_0x2eab('0xa')](),controller[_0x2eab('0x1b')]);router[_0x2eab('0x1a')](_0x2eab('0x11'),auth['isAuthenticated'](),controller[_0x2eab('0x1c')]);router[_0x2eab('0x1a')](_0x2eab('0x13'),auth[_0x2eab('0xa')](),controller[_0x2eab('0x1d')]);module[_0x2eab('0x1e')]=router; \ No newline at end of file +var _0xff9b=['../../components/interaction/service','./mailQueue.controller','get','/describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xff9b,0x1e5));var _0xbff9=function(_0x4d5672,_0x4517e7){_0x4d5672=_0x4d5672-0x0;var _0x4a7aec=_0xff9b[_0x4d5672];return _0x4a7aec;};'use strict';var multer=require(_0xbff9('0x0'));var util=require(_0xbff9('0x1'));var path=require(_0xbff9('0x2'));var timeout=require(_0xbff9('0x3'));var express=require(_0xbff9('0x4'));var router=express[_0xbff9('0x5')]();var fs_extra=require(_0xbff9('0x6'));var auth=require(_0xbff9('0x7'));var interaction=require(_0xbff9('0x8'));var config=require('../../config/environment');var controller=require(_0xbff9('0x9'));router[_0xbff9('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbff9('0xa')](_0xbff9('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xbff9('0xa')](_0xbff9('0xc'),auth[_0xbff9('0xd')](),controller[_0xbff9('0xe')]);router[_0xbff9('0xa')](_0xbff9('0xf'),auth[_0xbff9('0xd')](),controller[_0xbff9('0x10')]);router['get'](_0xbff9('0x11'),auth[_0xbff9('0xd')](),controller[_0xbff9('0x12')]);router['get'](_0xbff9('0x13'),auth[_0xbff9('0xd')](),controller['getAgents']);router[_0xbff9('0x14')]('/',auth[_0xbff9('0xd')](),controller[_0xbff9('0x15')]);router[_0xbff9('0x14')](_0xbff9('0x11'),auth[_0xbff9('0xd')](),controller[_0xbff9('0x16')]);router[_0xbff9('0x14')](_0xbff9('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0xbff9('0x17')](_0xbff9('0xc'),auth[_0xbff9('0xd')](),controller[_0xbff9('0x18')]);router[_0xbff9('0x19')](_0xbff9('0xc'),auth[_0xbff9('0xd')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbff9('0xd')](),controller[_0xbff9('0x1a')]);router['delete']('/:id/users',auth[_0xbff9('0xd')](),controller[_0xbff9('0x1b')]);module[_0xbff9('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index fa70cd8..a4f8ace 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 _0x43c4=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x151fbf,_0x303b6d){var _0x81ce0d=function(_0x36977c){while(--_0x36977c){_0x151fbf['push'](_0x151fbf['shift']());}};_0x81ce0d(++_0x303b6d);}(_0x43c4,0xea));var _0x443c=function(_0x142ba1,_0x430ec8){_0x142ba1=_0x142ba1-0x0;var _0x504260=_0x43c4[_0x142ba1];return _0x504260;};'use strict';var Sequelize=require(_0x443c('0x0'));module[_0x443c('0x1')]={'name':{'type':Sequelize[_0x443c('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x443c('0x2')]},'timeout':{'type':Sequelize[_0x443c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x443c('0x4'),_0x443c('0x5'),_0x443c('0x6'))}}; \ No newline at end of file +var _0xfaab=['exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x5271be,_0x46b33d){var _0xdd7afd=function(_0x31adf8){while(--_0x31adf8){_0x5271be['push'](_0x5271be['shift']());}};_0xdd7afd(++_0x46b33d);}(_0xfaab,0x126));var _0xbfaa=function(_0x1212e6,_0x51f0ad){_0x1212e6=_0x1212e6-0x0;var _0x526d83=_0xfaab[_0x1212e6];return _0x526d83;};'use strict';var Sequelize=require('sequelize');module[_0xbfaa('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbfaa('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbfaa('0x2')]},'timeout':{'type':Sequelize[_0xbfaa('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xbfaa('0x4'),_0xbfaa('0x5'),_0xbfaa('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a664af2..04b65a9 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 _0x1fda=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','MailQueues','destroy','error','stack','name','send','index','map','MailQueue','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','nolimit','pick','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','rawAttributes','ids','Agents','voicePause','flatMap','sequelize','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','clone','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userMailQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/parsers/qs'];(function(_0x26c699,_0x1fb541){var _0x3adc76=function(_0x318377){while(--_0x318377){_0x26c699['push'](_0x26c699['shift']());}};_0x3adc76(++_0x1fb541);}(_0x1fda,0x103));var _0xa1fd=function(_0x20b206,_0x38c3bf){_0x20b206=_0x20b206-0x0;var _0x4d5420=_0x1fda[_0x20b206];return _0x4d5420;};'use strict';var emlformat=require(_0xa1fd('0x0'));var rimraf=require(_0xa1fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa1fd('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa1fd('0x3'));var util=require(_0xa1fd('0x4'));var path=require(_0xa1fd('0x5'));var sox=require(_0xa1fd('0x6'));var csv=require(_0xa1fd('0x7'));var ejs=require(_0xa1fd('0x8'));var fs=require('fs');var fs_extra=require(_0xa1fd('0x9'));var _=require('lodash');var squel=require(_0xa1fd('0xa'));var crypto=require('crypto');var jsforce=require(_0xa1fd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa1fd('0x7'));var querystring=require('querystring');var Papa=require(_0xa1fd('0xc'));var Redis=require(_0xa1fd('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa1fd('0xe'));var as=require(_0xa1fd('0xf'));var hardwareService=require(_0xa1fd('0x10'));var logger=require(_0xa1fd('0x11'))(_0xa1fd('0x12'));var utils=require(_0xa1fd('0x13'));var config=require(_0xa1fd('0x14'));var licenseUtil=require(_0xa1fd('0x15'));var db=require(_0xa1fd('0x16'))['db'];config[_0xa1fd('0x17')]=_[_0xa1fd('0x18')](config[_0xa1fd('0x17')],{'host':_0xa1fd('0x19'),'port':0x18eb});var socket=require(_0xa1fd('0x1a'))(new Redis(config[_0xa1fd('0x17')]));require(_0xa1fd('0x1b'))[_0xa1fd('0x1c')](socket);function respondWithStatusCode(_0x55c89d,_0x242714){_0x242714=_0x242714||0xcc;return function(_0x545927){if(_0x545927){return _0x55c89d[_0xa1fd('0x1d')](_0x242714);}return _0x55c89d[_0xa1fd('0x1e')](_0x242714)[_0xa1fd('0x1f')]();};}function respondWithResult(_0x305ab1,_0x44b8f8){_0x44b8f8=_0x44b8f8||0xc8;return function(_0x3d7a16){if(_0x3d7a16){return _0x305ab1['status'](_0x44b8f8)['json'](_0x3d7a16);}};}function respondWithFilteredResult(_0x353dc2,_0x53b16e){return function(_0x560df8){if(_0x560df8){var _0x556191=typeof _0x53b16e['offset']===_0xa1fd('0x20')&&typeof _0x53b16e[_0xa1fd('0x21')]===_0xa1fd('0x20');var _0x1e23c1=_0x560df8[_0xa1fd('0x22')];var _0x5821d4=_0x556191?0x0:_0x53b16e[_0xa1fd('0x23')];var _0x3a122a=_0x556191?_0x560df8[_0xa1fd('0x22')]:_0x53b16e['offset']+_0x53b16e['limit'];var _0x36562d;if(_0x3a122a>=_0x1e23c1){_0x3a122a=_0x1e23c1;_0x36562d=0xc8;}else{_0x36562d=0xce;}_0x353dc2[_0xa1fd('0x1e')](_0x36562d);return _0x353dc2['set'](_0xa1fd('0x24'),_0x5821d4+'-'+_0x3a122a+'/'+_0x1e23c1)[_0xa1fd('0x25')](_0x560df8);}return null;};}function patchUpdates(_0x6e09dc){return function(_0x29d274){try{jsonpatch[_0xa1fd('0x26')](_0x29d274,_0x6e09dc,!![]);}catch(_0x558b0a){return BPromise['reject'](_0x558b0a);}return _0x29d274[_0xa1fd('0x27')]();};}function saveUpdates(_0x59a5ae,_0x53e029){return function(_0x307c34){if(_0x307c34){return _0x307c34[_0xa1fd('0x28')](_0x59a5ae)[_0xa1fd('0x29')](function(_0x552ed1){return _0x552ed1;});}return null;};}function removeEntity(_0x3329ed,_0x499811){return function(_0x425d50){if(_0x425d50){return _0x425d50['destroy']()[_0xa1fd('0x29')](function(){var _0xe4148e=_0x425d50['get']({'plain':!![]});var _0x50a2d6=_0xa1fd('0x2a');return db['UserProfileResource'][_0xa1fd('0x2b')]({'where':{'type':_0x50a2d6,'resourceId':_0xe4148e['id']}})[_0xa1fd('0x29')](function(){return _0x425d50;});})['then'](function(){_0x3329ed[_0xa1fd('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x499adc,_0x63ab01){return function(_0x28a172){if(!_0x28a172){_0x499adc[_0xa1fd('0x1d')](0x194);}return _0x28a172;};}function handleError(_0x24b188,_0x2bf8fa){_0x2bf8fa=_0x2bf8fa||0x1f4;return function(_0xa29982){logger[_0xa1fd('0x2c')](_0xa29982[_0xa1fd('0x2d')]);if(_0xa29982['name']){delete _0xa29982[_0xa1fd('0x2e')];}_0x24b188['status'](_0x2bf8fa)[_0xa1fd('0x2f')](_0xa29982);};}exports[_0xa1fd('0x30')]=function(_0x13c91d,_0x3d7641){var _0x190d7a={},_0x667ca5={},_0x1bc9e7={'count':0x0,'rows':[]};var _0x317203=_[_0xa1fd('0x31')](db[_0xa1fd('0x32')]['rawAttributes'],function(_0x15719c){return{'name':_0x15719c[_0xa1fd('0x33')],'type':_0x15719c[_0xa1fd('0x34')][_0xa1fd('0x35')]};});_0x667ca5[_0xa1fd('0x36')]=_[_0xa1fd('0x31')](_0x317203,_0xa1fd('0x2e'));_0x667ca5[_0xa1fd('0x37')]=_[_0xa1fd('0x38')](_0x13c91d[_0xa1fd('0x37')]);_0x667ca5[_0xa1fd('0x39')]=_['intersection'](_0x667ca5[_0xa1fd('0x36')],_0x667ca5[_0xa1fd('0x37')]);_0x190d7a[_0xa1fd('0x3a')]=_[_0xa1fd('0x3b')](_0x667ca5[_0xa1fd('0x36')],qs[_0xa1fd('0x3c')](_0x13c91d['query'][_0xa1fd('0x3c')]));_0x190d7a[_0xa1fd('0x3a')]=_0x190d7a[_0xa1fd('0x3a')][_0xa1fd('0x3d')]?_0x190d7a['attributes']:_0x667ca5[_0xa1fd('0x36')];if(!_0x13c91d[_0xa1fd('0x37')][_0xa1fd('0x3e')]('nolimit')){_0x190d7a['limit']=qs[_0xa1fd('0x21')](_0x13c91d[_0xa1fd('0x37')][_0xa1fd('0x21')]);_0x190d7a[_0xa1fd('0x23')]=qs[_0xa1fd('0x23')](_0x13c91d[_0xa1fd('0x37')][_0xa1fd('0x23')]);}_0x190d7a[_0xa1fd('0x3f')]=qs[_0xa1fd('0x40')](_0x13c91d[_0xa1fd('0x37')]['sort']);_0x190d7a[_0xa1fd('0x41')]=qs[_0xa1fd('0x39')](_['pick'](_0x13c91d['query'],_0x667ca5[_0xa1fd('0x39')]),_0x317203);if(_0x13c91d[_0xa1fd('0x37')][_0xa1fd('0x42')]){_0x190d7a[_0xa1fd('0x41')]=_['merge'](_0x190d7a[_0xa1fd('0x41')],{'$or':_[_0xa1fd('0x31')](_0x317203,function(_0x2c2d86){if(_0x2c2d86[_0xa1fd('0x34')]!==_0xa1fd('0x43')){var _0x348daf={};_0x348daf[_0x2c2d86[_0xa1fd('0x2e')]]={'$like':'%'+_0x13c91d[_0xa1fd('0x37')][_0xa1fd('0x42')]+'%'};return _0x348daf;}})});}_0x190d7a=_['merge']({},_0x190d7a,_0x13c91d['options']);var _0x2a2aff={'where':_0x190d7a['where']};return db[_0xa1fd('0x32')][_0xa1fd('0x22')](_0x2a2aff)[_0xa1fd('0x29')](function(_0x47d48f){_0x1bc9e7[_0xa1fd('0x22')]=_0x47d48f;if(_0x13c91d[_0xa1fd('0x37')][_0xa1fd('0x44')]){_0x190d7a[_0xa1fd('0x45')]=[{'all':!![]}];}return db['MailQueue'][_0xa1fd('0x46')](_0x190d7a);})[_0xa1fd('0x29')](function(_0x43b8e3){_0x1bc9e7[_0xa1fd('0x47')]=_0x43b8e3;return _0x1bc9e7;})[_0xa1fd('0x29')](respondWithFilteredResult(_0x3d7641,_0x190d7a))[_0xa1fd('0x48')](handleError(_0x3d7641,null));};exports[_0xa1fd('0x49')]=function(_0x433b13,_0x219000){var _0x113c0c={'raw':!![],'where':{'id':_0x433b13[_0xa1fd('0x4a')]['id']}},_0xdc524d={};_0xdc524d[_0xa1fd('0x36')]=_['keys'](db['MailQueue']['rawAttributes']);_0xdc524d['query']=_[_0xa1fd('0x38')](_0x433b13[_0xa1fd('0x37')]);_0xdc524d[_0xa1fd('0x39')]=_[_0xa1fd('0x3b')](_0xdc524d[_0xa1fd('0x36')],_0xdc524d['query']);_0x113c0c[_0xa1fd('0x3a')]=_[_0xa1fd('0x3b')](_0xdc524d[_0xa1fd('0x36')],qs['fields'](_0x433b13[_0xa1fd('0x37')][_0xa1fd('0x3c')]));_0x113c0c[_0xa1fd('0x3a')]=_0x113c0c[_0xa1fd('0x3a')]['length']?_0x113c0c[_0xa1fd('0x3a')]:_0xdc524d[_0xa1fd('0x36')];if(_0x433b13[_0xa1fd('0x37')][_0xa1fd('0x44')]){_0x113c0c['include']=[{'all':!![]}];}_0x113c0c=_[_0xa1fd('0x4b')]({},_0x113c0c,_0x433b13[_0xa1fd('0x4c')]);return db[_0xa1fd('0x32')][_0xa1fd('0x4d')](_0x113c0c)['then'](handleEntityNotFound(_0x219000,null))[_0xa1fd('0x29')](respondWithResult(_0x219000,null))['catch'](handleError(_0x219000,null));};exports[_0xa1fd('0x4e')]=function(_0x424bc6,_0x4a3e1f){return db[_0xa1fd('0x32')]['create'](_0x424bc6['body'],{})[_0xa1fd('0x29')](function(_0xb5b9a5){var _0x2cf21d=_0x424bc6[_0xa1fd('0x4f')][_0xa1fd('0x50')]({'plain':!![]});if(!_0x2cf21d)throw new Error(_0xa1fd('0x51'));if(_0x2cf21d[_0xa1fd('0x52')]==='user'){var _0x4ceadd=_0xb5b9a5[_0xa1fd('0x50')]({'plain':!![]});var _0x1f8332='MailQueues';return db[_0xa1fd('0x53')][_0xa1fd('0x4d')]({'where':{'name':_0x1f8332,'userProfileId':_0x2cf21d[_0xa1fd('0x54')]},'raw':!![]})[_0xa1fd('0x29')](function(_0x5d5715){if(_0x5d5715&&_0x5d5715[_0xa1fd('0x55')]===0x0){return db['UserProfileResource'][_0xa1fd('0x4e')]({'name':_0x4ceadd[_0xa1fd('0x2e')],'resourceId':_0x4ceadd['id'],'type':_0x5d5715[_0xa1fd('0x2e')],'sectionId':_0x5d5715['id']},{})['then'](function(){return _0xb5b9a5;});}else{return _0xb5b9a5;}})['catch'](function(_0xb2bedb){logger['error'](_0xa1fd('0x56'),_0xb2bedb);throw _0xb2bedb;});}return _0xb5b9a5;})['then'](respondWithResult(_0x4a3e1f,0xc9))[_0xa1fd('0x48')](handleError(_0x4a3e1f,null));};exports['update']=function(_0x12a13c,_0x3133b5){if(_0x12a13c[_0xa1fd('0x57')]['id']){delete _0x12a13c[_0xa1fd('0x57')]['id'];}return db[_0xa1fd('0x32')][_0xa1fd('0x4d')]({'where':{'id':_0x12a13c[_0xa1fd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3133b5,null))[_0xa1fd('0x29')](saveUpdates(_0x12a13c['body'],null))[_0xa1fd('0x29')](respondWithResult(_0x3133b5,null))[_0xa1fd('0x48')](handleError(_0x3133b5,null));};exports['destroy']=function(_0x5274dc,_0x33c726){return db['MailQueue']['find']({'where':{'id':_0x5274dc[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](handleEntityNotFound(_0x33c726,null))['then'](removeEntity(_0x33c726,null))[_0xa1fd('0x48')](handleError(_0x33c726,null));};exports['describe']=function(_0x59ee41,_0x296d81){return db['MailQueue'][_0xa1fd('0x58')]()['then'](respondWithResult(_0x296d81,null))[_0xa1fd('0x48')](handleError(_0x296d81,null));};exports[_0xa1fd('0x59')]=function(_0x583cd1,_0x1e6903,_0x2e165c){var _0x570189={'raw':!![],'where':{}},_0x2b5d55={},_0x3ce783;return db[_0xa1fd('0x32')][_0xa1fd('0x5a')]({'where':{'id':_0x583cd1[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](handleEntityNotFound(_0x1e6903,null))[_0xa1fd('0x29')](function(_0x24abbb){if(_0x24abbb){_0x3ce783=_0x24abbb[_0xa1fd('0x50')]({'plain':!![]});_0x2b5d55[_0xa1fd('0x36')]=_[_0xa1fd('0x38')](db[_0xa1fd('0x5b')]['rawAttributes']);_0x2b5d55[_0xa1fd('0x37')]=_[_0xa1fd('0x38')](_0x583cd1[_0xa1fd('0x37')]);_0x2b5d55[_0xa1fd('0x39')]=_[_0xa1fd('0x3b')](_0x2b5d55[_0xa1fd('0x36')],_0x2b5d55[_0xa1fd('0x37')]);_0x570189['attributes']=_['intersection'](_0x2b5d55[_0xa1fd('0x36')],qs[_0xa1fd('0x3c')](_0x583cd1[_0xa1fd('0x37')][_0xa1fd('0x3c')]));_0x570189[_0xa1fd('0x3a')]=_0x570189[_0xa1fd('0x3a')][_0xa1fd('0x3d')]?_0x570189[_0xa1fd('0x3a')]:_0x2b5d55[_0xa1fd('0x36')];if(!_0x583cd1[_0xa1fd('0x37')][_0xa1fd('0x3e')](_0xa1fd('0x5c'))){_0x570189[_0xa1fd('0x21')]=qs[_0xa1fd('0x21')](_0x583cd1[_0xa1fd('0x37')]['limit']);_0x570189[_0xa1fd('0x23')]=qs[_0xa1fd('0x23')](_0x583cd1[_0xa1fd('0x37')][_0xa1fd('0x23')]);}_0x570189[_0xa1fd('0x3f')]=qs[_0xa1fd('0x40')](_0x583cd1[_0xa1fd('0x37')][_0xa1fd('0x40')]);_0x570189[_0xa1fd('0x41')]=qs['filters'](_[_0xa1fd('0x5d')](_0x583cd1['query'],_0x2b5d55['filters']));_0x570189[_0xa1fd('0x41')][_0xa1fd('0x5e')]=_0x24abbb['id'];if(_0x583cd1[_0xa1fd('0x37')][_0xa1fd('0x42')]){_0x570189[_0xa1fd('0x41')]=_['merge'](_0x570189['where'],{'$or':_[_0xa1fd('0x31')](_0x570189[_0xa1fd('0x3a')],function(_0x15e85e){var _0x302e3d={};_0x302e3d[_0x15e85e]={'$like':'%'+_0x583cd1[_0xa1fd('0x37')][_0xa1fd('0x42')]+'%'};return _0x302e3d;})});}_0x570189=_[_0xa1fd('0x4b')]({},_0x570189,_0x583cd1[_0xa1fd('0x4c')]);return db[_0xa1fd('0x5b')][_0xa1fd('0x46')](_0x570189);}})[_0xa1fd('0x29')](function(_0x3f45b8){if(_0x3f45b8){return db[_0xa1fd('0x5f')][_0xa1fd('0x60')]({'where':{'id':_[_0xa1fd('0x31')](_0x3f45b8,_0xa1fd('0x61')),'role':_0xa1fd('0x62')},'attributes':['id','name',_0xa1fd('0x63'),_0xa1fd('0x64'),_0xa1fd('0x65')]});}})[_0xa1fd('0x29')](function(_0x575d97){if(_0x575d97){return{'count':_0x575d97[_0xa1fd('0x22')],'rows':_[_0xa1fd('0x31')](_0x575d97[_0xa1fd('0x47')],function(_0x5b83a5){return{'membername':_0x5b83a5[_0xa1fd('0x2e')],'UserId':_0x5b83a5['id'],'queue_name':_0x3ce783['name'],'MailQueueId':_0x3ce783['id'],'interface':util['format'](_0xa1fd('0x66'),_0xa1fd('0x67'),_0x5b83a5[_0xa1fd('0x2e')]),'penalty':0x0,'paused':_0x5b83a5[_0xa1fd('0x63')],'createdAt':_0x5b83a5[_0xa1fd('0x65')],'updatedAt':_0x5b83a5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa1fd('0x29')](respondWithFilteredResult(_0x1e6903,_0x570189))[_0xa1fd('0x48')](handleError(_0x1e6903,null));};exports[_0xa1fd('0x68')]=function(_0x4f73b4,_0x455d4b,_0x26b727){var _0x11d828={};var _0x1a1365={};var _0xd2ddeb;var _0xc02b41;return db['MailQueue'][_0xa1fd('0x5a')]({'where':{'id':_0x4f73b4[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](handleEntityNotFound(_0x455d4b,null))[_0xa1fd('0x29')](function(_0x42490b){if(_0x42490b){_0xd2ddeb=_0x42490b;_0x1a1365[_0xa1fd('0x36')]=_['keys'](db[_0xa1fd('0x69')][_0xa1fd('0x6a')]);_0x1a1365['query']=_['keys'](_0x4f73b4[_0xa1fd('0x37')]);_0x1a1365[_0xa1fd('0x39')]=_['intersection'](_0x1a1365[_0xa1fd('0x36')],_0x1a1365[_0xa1fd('0x37')]);_0x11d828[_0xa1fd('0x3a')]=_[_0xa1fd('0x3b')](_0x1a1365[_0xa1fd('0x36')],qs[_0xa1fd('0x3c')](_0x4f73b4[_0xa1fd('0x37')][_0xa1fd('0x3c')]));_0x11d828[_0xa1fd('0x3a')]=_0x11d828[_0xa1fd('0x3a')][_0xa1fd('0x3d')]?_0x11d828[_0xa1fd('0x3a')]:_0x1a1365['model'];_0x11d828[_0xa1fd('0x3f')]=qs[_0xa1fd('0x40')](_0x4f73b4[_0xa1fd('0x37')][_0xa1fd('0x40')]);_0x11d828[_0xa1fd('0x41')]=qs[_0xa1fd('0x39')](_[_0xa1fd('0x5d')](_0x4f73b4['query'],_0x1a1365['filters']));if(_0x4f73b4[_0xa1fd('0x37')]['filter']){_0x11d828[_0xa1fd('0x41')]=_[_0xa1fd('0x4b')](_0x11d828['where'],{'$or':_[_0xa1fd('0x31')](_0x11d828[_0xa1fd('0x3a')],function(_0x4da367){var _0x4bd435={};_0x4bd435[_0x4da367]={'$like':'%'+_0x4f73b4[_0xa1fd('0x37')][_0xa1fd('0x42')]+'%'};return _0x4bd435;})});}_0x11d828=_[_0xa1fd('0x4b')]({},_0x11d828,_0x4f73b4[_0xa1fd('0x4c')]);return _0xd2ddeb['getTeams'](_0x11d828);}})['then'](function(_0x1ab6f8){if(_0x1ab6f8){_0xc02b41=_0x1ab6f8[_0xa1fd('0x3d')];if(!_0x4f73b4[_0xa1fd('0x37')][_0xa1fd('0x3e')](_0xa1fd('0x5c'))){_0x11d828[_0xa1fd('0x21')]=qs[_0xa1fd('0x21')](_0x4f73b4[_0xa1fd('0x37')][_0xa1fd('0x21')]);_0x11d828[_0xa1fd('0x23')]=qs['offset'](_0x4f73b4[_0xa1fd('0x37')][_0xa1fd('0x23')]);}return _0xd2ddeb['getTeams'](_0x11d828);}})[_0xa1fd('0x29')](function(_0xc419ca){if(_0xc419ca){return _0xc419ca?{'count':_0xc02b41,'rows':_0xc419ca}:null;}})[_0xa1fd('0x29')](respondWithResult(_0x455d4b,null))[_0xa1fd('0x48')](handleError(_0x455d4b,null));};exports['addTeams']=function(_0x300d74,_0xe038e7,_0x3daf03){var _0x46cd70=_0x300d74[_0xa1fd('0x57')][_0xa1fd('0x6b')];return db['Team']['findAll']({'where':{'id':_0x46cd70},'attributes':['id'],'include':[{'model':db[_0xa1fd('0x5f')],'as':_0xa1fd('0x6c'),'attributes':['id',_0xa1fd('0x2e'),'online',_0xa1fd('0x6d'),'interface'],'raw':!![]}]})['then'](function(_0x399d7c){if(_0x399d7c){var _0x31f1b2=_[_0xa1fd('0x6e')](_0x399d7c,function(_0x311195){var _0x4aaaf4=_0x311195[_0xa1fd('0x50')]({'plain':!![]});return _0x4aaaf4[_0xa1fd('0x6c')];});return db[_0xa1fd('0x32')][_0xa1fd('0x4d')]({'where':{'id':_0x300d74[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](function(_0x2e2165){return db[_0xa1fd('0x6f')]['transaction'](function(_0x667367){return _0x2e2165['addTeams'](_0x46cd70,{'transaction':_0x667367})[_0xa1fd('0x29')](function(){return BPromise[_0xa1fd('0x70')](_0x31f1b2,function(_0x3735d6){return db[_0xa1fd('0x5b')][_0xa1fd('0x71')]({'where':{'UserId':_0x3735d6['id'],'MailQueueId':_0x300d74[_0xa1fd('0x4a')]['id']},'transaction':_0x667367});});})[_0xa1fd('0x29')](function(){_0x31f1b2['forEach'](function(_0x242ea5){socket[_0xa1fd('0x72')](_0xa1fd('0x73'),{'UserId':_0x242ea5['id'],'MailQueueId':_0x2e2165['id']});});});});});}})[_0xa1fd('0x29')](respondWithStatusCode(_0xe038e7,null))['catch'](handleError(_0xe038e7,null));};exports[_0xa1fd('0x74')]=function(_0x1e7ddc,_0x1bfbfc,_0x1e5390){return db[_0xa1fd('0x69')][_0xa1fd('0x46')]({'where':{'id':_0x1e7ddc[_0xa1fd('0x37')][_0xa1fd('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xa1fd('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa1fd('0x29')](handleEntityNotFound(_0x1bfbfc,null))['then'](function(_0x3556fa){var _0x2cef67=_['map'](_0x3556fa,'id');var _0x3f81f4=[];var _0x55809c=[];var _0x124a77=squel[_0xa1fd('0x75')]();_0x124a77['field'](_0xa1fd('0x76'))[_0xa1fd('0x77')](_0xa1fd('0x78'),'tq')['join'](_0xa1fd('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa1fd('0x41')]('MailQueueId\x20=\x20?',_0x1e7ddc[_0xa1fd('0x4a')]['id']);for(var _0x4cbc8d=0x0;_0x4cbc8d<_0x3556fa[_0xa1fd('0x3d')];_0x4cbc8d+=0x1){let _0x4dd966=_0x3556fa[_0x4cbc8d];for(var _0x472818=0x0;_0x472818<_0x4dd966['Agents'][_0xa1fd('0x3d')];_0x472818+=0x1){let _0x549adb=_0x4dd966[_0xa1fd('0x6c')][_0x472818];var _0x50af1e=_0x124a77[_0xa1fd('0x7a')]();_0x50af1e[_0xa1fd('0x41')]('ut.UserId\x20=\x20?',_0x549adb['id']);_0x55809c['push'](db[_0xa1fd('0x6f')][_0xa1fd('0x37')](_0x50af1e[_0xa1fd('0x7b')](),{'type':db['sequelize']['QueryTypes'][_0xa1fd('0x7c')]})['then'](function(_0x5a906f){if(_0x5a906f[_0xa1fd('0x3d')]===0x1){return _0x549adb['id'];}else{var _0x3c0db9=_[_0xa1fd('0x7d')](_[_0xa1fd('0x31')](_0x5a906f,_0xa1fd('0x7e')),function(_0x2daef7){return _[_0xa1fd('0x7f')](_0x2cef67,_0x2daef7);});if(_0x3c0db9){return _0x549adb['id'];}}}));}}return BPromise[_0xa1fd('0x80')](_0x55809c)['then'](function(_0x1d2f20){_0x3f81f4=_(_0x3f81f4)[_0xa1fd('0x81')](_0x1d2f20)[_0xa1fd('0x82')]()[_0xa1fd('0x83')]();return db[_0xa1fd('0x32')]['find']({'where':{'id':_0x1e7ddc[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](function(_0x383504){return db[_0xa1fd('0x6f')]['transaction'](function(_0x1b6d24){return _0x383504[_0xa1fd('0x74')](_0x1e7ddc['query'][_0xa1fd('0x6b')],{'transaction':_0x1b6d24})[_0xa1fd('0x29')](function(){if(!_['isEmpty'](_0x3f81f4)){return _0x383504[_0xa1fd('0x84')](_0x3f81f4,{'transaction':_0x1b6d24});}})[_0xa1fd('0x29')](function(){_0x3f81f4['forEach'](function(_0x39f585){socket['emit'](_0xa1fd('0x85'),{'UserId':_0x39f585,'MailQueueId':_0x383504['id']});});});});});});})[_0xa1fd('0x29')](respondWithStatusCode(_0x1bfbfc,null))['catch'](handleError(_0x1bfbfc,null));};exports[_0xa1fd('0x86')]=function(_0x9ced21,_0x18f64d,_0x542490){return db[_0xa1fd('0x32')][_0xa1fd('0x4d')]({'where':{'id':_0x9ced21[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](handleEntityNotFound(_0x18f64d,null))[_0xa1fd('0x29')](function(_0x14b19e){if(_0x14b19e){return _0x14b19e['addAgents'](_0x9ced21['body'][_0xa1fd('0x6b')],_['omit'](_0x9ced21[_0xa1fd('0x57')],['ids','id'])||{})[_0xa1fd('0x87')](function(_0x594f16){for(var _0x54ca41=0x0;_0x54ca41<_0x9ced21[_0xa1fd('0x57')][_0xa1fd('0x6b')][_0xa1fd('0x3d')];_0x54ca41+=0x1){socket['emit'](_0xa1fd('0x73'),{'UserId':Number(_0x9ced21[_0xa1fd('0x57')][_0xa1fd('0x6b')][_0x54ca41]),'MailQueueId':Number(_0x9ced21[_0xa1fd('0x4a')]['id'])});}return _0x594f16;});}})[_0xa1fd('0x29')](respondWithResult(_0x18f64d,null))[_0xa1fd('0x48')](handleError(_0x18f64d,null));};exports[_0xa1fd('0x84')]=function(_0x3437b6,_0xda6559,_0x37825b){return db[_0xa1fd('0x32')]['find']({'where':{'id':_0x3437b6[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](handleEntityNotFound(_0xda6559,null))[_0xa1fd('0x29')](function(_0x2b00a2){if(_0x2b00a2){return _0x2b00a2[_0xa1fd('0x84')](_0x3437b6[_0xa1fd('0x37')][_0xa1fd('0x6b')])[_0xa1fd('0x29')](function(){if(_['isArray'](_0x3437b6[_0xa1fd('0x37')][_0xa1fd('0x6b')])){for(var _0x2157e9=0x0;_0x2157e9<_0x3437b6['query']['ids'][_0xa1fd('0x3d')];_0x2157e9+=0x1){socket[_0xa1fd('0x72')](_0xa1fd('0x85'),{'UserId':Number(_0x3437b6[_0xa1fd('0x37')][_0xa1fd('0x6b')][_0x2157e9]),'MailQueueId':Number(_0x3437b6[_0xa1fd('0x4a')]['id'])});}}else{socket[_0xa1fd('0x72')]('userMailQueue:remove',{'UserId':Number(_0x3437b6[_0xa1fd('0x37')][_0xa1fd('0x6b')]),'MailQueueId':Number(_0x3437b6[_0xa1fd('0x4a')]['id'])});}});}})[_0xa1fd('0x29')](respondWithStatusCode(_0xda6559,null))[_0xa1fd('0x48')](handleError(_0xda6559,null));};exports[_0xa1fd('0x88')]=function(_0x3e2bda,_0xaf5aee,_0x5e74aa){var _0x43df2d={};var _0x5d577f={};var _0x4aae09;var _0x4dfcb2;return db[_0xa1fd('0x32')][_0xa1fd('0x5a')]({'where':{'id':_0x3e2bda[_0xa1fd('0x4a')]['id']}})[_0xa1fd('0x29')](handleEntityNotFound(_0xaf5aee,null))[_0xa1fd('0x29')](function(_0x3ba28f){if(_0x3ba28f){_0x4aae09=_0x3ba28f;_0x5d577f[_0xa1fd('0x36')]=_[_0xa1fd('0x38')](db['User'][_0xa1fd('0x6a')]);_0x5d577f[_0xa1fd('0x37')]=_[_0xa1fd('0x38')](_0x3e2bda['query']);_0x5d577f['filters']=_[_0xa1fd('0x3b')](_0x5d577f[_0xa1fd('0x36')],_0x5d577f[_0xa1fd('0x37')]);_0x43df2d[_0xa1fd('0x3a')]=_['intersection'](_0x5d577f['model'],qs[_0xa1fd('0x3c')](_0x3e2bda['query'][_0xa1fd('0x3c')]));_0x43df2d[_0xa1fd('0x3a')]=_0x43df2d[_0xa1fd('0x3a')][_0xa1fd('0x3d')]?_0x43df2d[_0xa1fd('0x3a')]:_0x5d577f[_0xa1fd('0x36')];_0x43df2d[_0xa1fd('0x3f')]=qs['sort'](_0x3e2bda[_0xa1fd('0x37')]['sort']);_0x43df2d[_0xa1fd('0x41')]=qs['filters'](_[_0xa1fd('0x5d')](_0x3e2bda['query'],_0x5d577f[_0xa1fd('0x39')]));if(_0x3e2bda[_0xa1fd('0x37')]['filter']){_0x43df2d[_0xa1fd('0x41')]=_[_0xa1fd('0x4b')](_0x43df2d['where'],{'$or':_[_0xa1fd('0x31')](_0x43df2d[_0xa1fd('0x3a')],function(_0x349d88){var _0x5251de={};_0x5251de[_0x349d88]={'$like':'%'+_0x3e2bda[_0xa1fd('0x37')][_0xa1fd('0x42')]+'%'};return _0x5251de;})});}_0x43df2d=_[_0xa1fd('0x4b')]({},_0x43df2d,_0x3e2bda['options']);return _0x4aae09[_0xa1fd('0x88')](_0x43df2d);}})[_0xa1fd('0x29')](function(_0x2589d3){if(_0x2589d3){_0x4dfcb2=_0x2589d3['length'];if(!_0x3e2bda['query'][_0xa1fd('0x3e')](_0xa1fd('0x5c'))){_0x43df2d['limit']=qs['limit'](_0x3e2bda[_0xa1fd('0x37')][_0xa1fd('0x21')]);_0x43df2d[_0xa1fd('0x23')]=qs[_0xa1fd('0x23')](_0x3e2bda[_0xa1fd('0x37')][_0xa1fd('0x23')]);}return _0x4aae09[_0xa1fd('0x88')](_0x43df2d);}})[_0xa1fd('0x29')](function(_0x5e80ad){if(_0x5e80ad){return _0x5e80ad?{'count':_0x4dfcb2,'rows':_0x5e80ad}:null;}})['then'](respondWithResult(_0xaf5aee,null))['catch'](handleError(_0xaf5aee,null));}; \ No newline at end of file +var _0xd624=['SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','then','destroy','get','MailQueues','stack','name','send','index','MailQueue','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','filter','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','createdAt','SIP','updatedAt','getTeams','pick','nolimit','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','userMailQueue:save','removeTeams','Team','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes'];(function(_0xb0afae,_0x2173a9){var _0x1ca1c9=function(_0x35fe44){while(--_0x35fe44){_0xb0afae['push'](_0xb0afae['shift']());}};_0x1ca1c9(++_0x2173a9);}(_0xd624,0x124));var _0x4d62=function(_0x21071b,_0x147784){_0x21071b=_0x21071b-0x0;var _0x184687=_0xd624[_0x21071b];return _0x184687;};'use strict';var emlformat=require(_0x4d62('0x0'));var rimraf=require(_0x4d62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d62('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d62('0x3'));var util=require(_0x4d62('0x4'));var path=require(_0x4d62('0x5'));var sox=require(_0x4d62('0x6'));var csv=require(_0x4d62('0x7'));var ejs=require(_0x4d62('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d62('0x9'));var crypto=require(_0x4d62('0xa'));var jsforce=require(_0x4d62('0xb'));var deskjs=require(_0x4d62('0xc'));var toCsv=require(_0x4d62('0x7'));var querystring=require('querystring');var Papa=require(_0x4d62('0xd'));var Redis=require(_0x4d62('0xe'));var authService=require(_0x4d62('0xf'));var qs=require(_0x4d62('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d62('0x11'));var logger=require(_0x4d62('0x12'))(_0x4d62('0x13'));var utils=require(_0x4d62('0x14'));var config=require(_0x4d62('0x15'));var licenseUtil=require(_0x4d62('0x16'));var db=require(_0x4d62('0x17'))['db'];config[_0x4d62('0x18')]=_[_0x4d62('0x19')](config[_0x4d62('0x18')],{'host':_0x4d62('0x1a'),'port':0x18eb});var socket=require(_0x4d62('0x1b'))(new Redis(config['redis']));require(_0x4d62('0x1c'))[_0x4d62('0x1d')](socket);function respondWithStatusCode(_0x1c6768,_0x5d9b93){_0x5d9b93=_0x5d9b93||0xcc;return function(_0x31af1d){if(_0x31af1d){return _0x1c6768[_0x4d62('0x1e')](_0x5d9b93);}return _0x1c6768[_0x4d62('0x1f')](_0x5d9b93)[_0x4d62('0x20')]();};}function respondWithResult(_0x4974f4,_0x36b786){_0x36b786=_0x36b786||0xc8;return function(_0x1a7c65){if(_0x1a7c65){return _0x4974f4['status'](_0x36b786)['json'](_0x1a7c65);}};}function respondWithFilteredResult(_0x2e8602,_0x14534d){return function(_0x54920b){if(_0x54920b){var _0x17a0e6=typeof _0x14534d[_0x4d62('0x21')]===_0x4d62('0x22')&&typeof _0x14534d[_0x4d62('0x23')]===_0x4d62('0x22');var _0x45f78f=_0x54920b[_0x4d62('0x24')];var _0x3dae47=_0x17a0e6?0x0:_0x14534d[_0x4d62('0x21')];var _0x3e656e=_0x17a0e6?_0x54920b['count']:_0x14534d['offset']+_0x14534d['limit'];var _0x435035;if(_0x3e656e>=_0x45f78f){_0x3e656e=_0x45f78f;_0x435035=0xc8;}else{_0x435035=0xce;}_0x2e8602[_0x4d62('0x1f')](_0x435035);return _0x2e8602[_0x4d62('0x25')]('Content-Range',_0x3dae47+'-'+_0x3e656e+'/'+_0x45f78f)[_0x4d62('0x26')](_0x54920b);}return null;};}function patchUpdates(_0x16fa3a){return function(_0xcb93b8){try{jsonpatch['apply'](_0xcb93b8,_0x16fa3a,!![]);}catch(_0x26c5e3){return BPromise[_0x4d62('0x27')](_0x26c5e3);}return _0xcb93b8[_0x4d62('0x28')]();};}function saveUpdates(_0x57987b,_0xf38665){return function(_0x1c7bc6){if(_0x1c7bc6){return _0x1c7bc6['update'](_0x57987b)[_0x4d62('0x29')](function(_0x3b4eee){return _0x3b4eee;});}return null;};}function removeEntity(_0x2a09f9,_0x414a9e){return function(_0x1cff73){if(_0x1cff73){return _0x1cff73[_0x4d62('0x2a')]()[_0x4d62('0x29')](function(){var _0x40c9c8=_0x1cff73[_0x4d62('0x2b')]({'plain':!![]});var _0x474c69=_0x4d62('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x474c69,'resourceId':_0x40c9c8['id']}})['then'](function(){return _0x1cff73;});})[_0x4d62('0x29')](function(){_0x2a09f9['status'](0xcc)[_0x4d62('0x20')]();});}};}function handleEntityNotFound(_0x2b76af,_0x132181){return function(_0x50e6f0){if(!_0x50e6f0){_0x2b76af[_0x4d62('0x1e')](0x194);}return _0x50e6f0;};}function handleError(_0x5aacba,_0x532c07){_0x532c07=_0x532c07||0x1f4;return function(_0x45458a){logger['error'](_0x45458a[_0x4d62('0x2d')]);if(_0x45458a[_0x4d62('0x2e')]){delete _0x45458a[_0x4d62('0x2e')];}_0x5aacba[_0x4d62('0x1f')](_0x532c07)[_0x4d62('0x2f')](_0x45458a);};}exports[_0x4d62('0x30')]=function(_0x3dd22b,_0x261872){var _0x5d28f4={},_0x466f6d={},_0x1fd171={'count':0x0,'rows':[]};var _0x2e3ce1=_['map'](db[_0x4d62('0x31')]['rawAttributes'],function(_0x5da311){return{'name':_0x5da311['fieldName'],'type':_0x5da311[_0x4d62('0x32')]['key']};});_0x466f6d['model']=_['map'](_0x2e3ce1,'name');_0x466f6d[_0x4d62('0x33')]=_[_0x4d62('0x34')](_0x3dd22b[_0x4d62('0x33')]);_0x466f6d[_0x4d62('0x35')]=_[_0x4d62('0x36')](_0x466f6d[_0x4d62('0x37')],_0x466f6d[_0x4d62('0x33')]);_0x5d28f4[_0x4d62('0x38')]=_[_0x4d62('0x36')](_0x466f6d['model'],qs[_0x4d62('0x39')](_0x3dd22b['query']['fields']));_0x5d28f4['attributes']=_0x5d28f4[_0x4d62('0x38')][_0x4d62('0x3a')]?_0x5d28f4[_0x4d62('0x38')]:_0x466f6d[_0x4d62('0x37')];if(!_0x3dd22b[_0x4d62('0x33')][_0x4d62('0x3b')]('nolimit')){_0x5d28f4[_0x4d62('0x23')]=qs['limit'](_0x3dd22b[_0x4d62('0x33')][_0x4d62('0x23')]);_0x5d28f4[_0x4d62('0x21')]=qs[_0x4d62('0x21')](_0x3dd22b['query'][_0x4d62('0x21')]);}_0x5d28f4[_0x4d62('0x3c')]=qs['sort'](_0x3dd22b['query'][_0x4d62('0x3d')]);_0x5d28f4[_0x4d62('0x3e')]=qs[_0x4d62('0x35')](_['pick'](_0x3dd22b['query'],_0x466f6d['filters']),_0x2e3ce1);if(_0x3dd22b['query']['filter']){_0x5d28f4['where']=_[_0x4d62('0x3f')](_0x5d28f4[_0x4d62('0x3e')],{'$or':_[_0x4d62('0x40')](_0x2e3ce1,function(_0x31b73e){if(_0x31b73e[_0x4d62('0x32')]!=='VIRTUAL'){var _0x139ecb={};_0x139ecb[_0x31b73e[_0x4d62('0x2e')]]={'$like':'%'+_0x3dd22b['query'][_0x4d62('0x41')]+'%'};return _0x139ecb;}})});}_0x5d28f4=_[_0x4d62('0x3f')]({},_0x5d28f4,_0x3dd22b[_0x4d62('0x42')]);var _0x2ce6c5={'where':_0x5d28f4[_0x4d62('0x3e')]};return db[_0x4d62('0x31')]['count'](_0x2ce6c5)[_0x4d62('0x29')](function(_0x570d11){_0x1fd171[_0x4d62('0x24')]=_0x570d11;if(_0x3dd22b[_0x4d62('0x33')]['includeAll']){_0x5d28f4[_0x4d62('0x43')]=[{'all':!![]}];}return db['MailQueue'][_0x4d62('0x44')](_0x5d28f4);})[_0x4d62('0x29')](function(_0x1165bd){_0x1fd171[_0x4d62('0x45')]=_0x1165bd;return _0x1fd171;})[_0x4d62('0x29')](respondWithFilteredResult(_0x261872,_0x5d28f4))['catch'](handleError(_0x261872,null));};exports[_0x4d62('0x46')]=function(_0x35a07d,_0x41bb67){var _0x3ea32f={'raw':!![],'where':{'id':_0x35a07d[_0x4d62('0x47')]['id']}},_0x2632be={};_0x2632be[_0x4d62('0x37')]=_[_0x4d62('0x34')](db[_0x4d62('0x31')][_0x4d62('0x48')]);_0x2632be[_0x4d62('0x33')]=_['keys'](_0x35a07d['query']);_0x2632be[_0x4d62('0x35')]=_[_0x4d62('0x36')](_0x2632be[_0x4d62('0x37')],_0x2632be[_0x4d62('0x33')]);_0x3ea32f[_0x4d62('0x38')]=_['intersection'](_0x2632be['model'],qs[_0x4d62('0x39')](_0x35a07d[_0x4d62('0x33')][_0x4d62('0x39')]));_0x3ea32f[_0x4d62('0x38')]=_0x3ea32f[_0x4d62('0x38')]['length']?_0x3ea32f['attributes']:_0x2632be[_0x4d62('0x37')];if(_0x35a07d['query'][_0x4d62('0x49')]){_0x3ea32f[_0x4d62('0x43')]=[{'all':!![]}];}_0x3ea32f=_[_0x4d62('0x3f')]({},_0x3ea32f,_0x35a07d['options']);return db[_0x4d62('0x31')][_0x4d62('0x4a')](_0x3ea32f)[_0x4d62('0x29')](handleEntityNotFound(_0x41bb67,null))[_0x4d62('0x29')](respondWithResult(_0x41bb67,null))[_0x4d62('0x4b')](handleError(_0x41bb67,null));};exports[_0x4d62('0x4c')]=function(_0x97b123,_0x363ec6){return db[_0x4d62('0x31')][_0x4d62('0x4c')](_0x97b123[_0x4d62('0x4d')],{})['then'](function(_0x1df6a5){var _0x9fe769=_0x97b123[_0x4d62('0x4e')]['get']({'plain':!![]});if(!_0x9fe769)throw new Error(_0x4d62('0x4f'));if(_0x9fe769[_0x4d62('0x50')]===_0x4d62('0x4e')){var _0x583cf5=_0x1df6a5['get']({'plain':!![]});var _0x412388=_0x4d62('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x412388,'userProfileId':_0x9fe769[_0x4d62('0x51')]},'raw':!![]})[_0x4d62('0x29')](function(_0x47e932){if(_0x47e932&&_0x47e932[_0x4d62('0x52')]===0x0){return db[_0x4d62('0x53')][_0x4d62('0x4c')]({'name':_0x583cf5['name'],'resourceId':_0x583cf5['id'],'type':_0x47e932[_0x4d62('0x2e')],'sectionId':_0x47e932['id']},{})['then'](function(){return _0x1df6a5;});}else{return _0x1df6a5;}})['catch'](function(_0x45841c){logger[_0x4d62('0x54')](_0x4d62('0x55'),_0x45841c);throw _0x45841c;});}return _0x1df6a5;})[_0x4d62('0x29')](respondWithResult(_0x363ec6,0xc9))[_0x4d62('0x4b')](handleError(_0x363ec6,null));};exports[_0x4d62('0x56')]=function(_0x4eb72f,_0x13f762){if(_0x4eb72f[_0x4d62('0x4d')]['id']){delete _0x4eb72f['body']['id'];}return db[_0x4d62('0x31')][_0x4d62('0x4a')]({'where':{'id':_0x4eb72f[_0x4d62('0x47')]['id']}})['then'](handleEntityNotFound(_0x13f762,null))[_0x4d62('0x29')](saveUpdates(_0x4eb72f[_0x4d62('0x4d')],null))[_0x4d62('0x29')](respondWithResult(_0x13f762,null))['catch'](handleError(_0x13f762,null));};exports[_0x4d62('0x2a')]=function(_0x1ed703,_0x14fc36){return db['MailQueue'][_0x4d62('0x4a')]({'where':{'id':_0x1ed703['params']['id']}})[_0x4d62('0x29')](handleEntityNotFound(_0x14fc36,null))['then'](removeEntity(_0x14fc36,null))[_0x4d62('0x4b')](handleError(_0x14fc36,null));};exports[_0x4d62('0x57')]=function(_0x579cf9,_0xc92d92){return db['MailQueue'][_0x4d62('0x57')]()[_0x4d62('0x29')](respondWithResult(_0xc92d92,null))['catch'](handleError(_0xc92d92,null));};exports['getMembers']=function(_0x33bafa,_0x44e25c,_0x23df59){var _0x1cb510={'raw':!![],'where':{}},_0x232ae8={},_0x4cb430;return db[_0x4d62('0x31')][_0x4d62('0x58')]({'where':{'id':_0x33bafa[_0x4d62('0x47')]['id']}})[_0x4d62('0x29')](handleEntityNotFound(_0x44e25c,null))['then'](function(_0x1e1aa5){if(_0x1e1aa5){_0x4cb430=_0x1e1aa5['get']({'plain':!![]});_0x232ae8[_0x4d62('0x37')]=_[_0x4d62('0x34')](db['UserMailQueue'][_0x4d62('0x48')]);_0x232ae8[_0x4d62('0x33')]=_[_0x4d62('0x34')](_0x33bafa[_0x4d62('0x33')]);_0x232ae8[_0x4d62('0x35')]=_[_0x4d62('0x36')](_0x232ae8[_0x4d62('0x37')],_0x232ae8['query']);_0x1cb510[_0x4d62('0x38')]=_[_0x4d62('0x36')](_0x232ae8[_0x4d62('0x37')],qs[_0x4d62('0x39')](_0x33bafa[_0x4d62('0x33')]['fields']));_0x1cb510[_0x4d62('0x38')]=_0x1cb510['attributes'][_0x4d62('0x3a')]?_0x1cb510['attributes']:_0x232ae8['model'];if(!_0x33bafa['query'][_0x4d62('0x3b')]('nolimit')){_0x1cb510[_0x4d62('0x23')]=qs[_0x4d62('0x23')](_0x33bafa[_0x4d62('0x33')][_0x4d62('0x23')]);_0x1cb510[_0x4d62('0x21')]=qs[_0x4d62('0x21')](_0x33bafa[_0x4d62('0x33')]['offset']);}_0x1cb510[_0x4d62('0x3c')]=qs['sort'](_0x33bafa[_0x4d62('0x33')][_0x4d62('0x3d')]);_0x1cb510[_0x4d62('0x3e')]=qs[_0x4d62('0x35')](_['pick'](_0x33bafa['query'],_0x232ae8['filters']));_0x1cb510['where'][_0x4d62('0x59')]=_0x1e1aa5['id'];if(_0x33bafa[_0x4d62('0x33')]['filter']){_0x1cb510['where']=_[_0x4d62('0x3f')](_0x1cb510['where'],{'$or':_['map'](_0x1cb510[_0x4d62('0x38')],function(_0x2f2c21){var _0x18dfb3={};_0x18dfb3[_0x2f2c21]={'$like':'%'+_0x33bafa['query'][_0x4d62('0x41')]+'%'};return _0x18dfb3;})});}_0x1cb510=_['merge']({},_0x1cb510,_0x33bafa[_0x4d62('0x42')]);return db[_0x4d62('0x5a')][_0x4d62('0x44')](_0x1cb510);}})[_0x4d62('0x29')](function(_0x2a05e1){if(_0x2a05e1){return db[_0x4d62('0x5b')][_0x4d62('0x5c')]({'where':{'id':_[_0x4d62('0x40')](_0x2a05e1,_0x4d62('0x5d')),'role':_0x4d62('0x5e')},'attributes':['id',_0x4d62('0x2e'),'mailPause','updatedAt',_0x4d62('0x5f')]});}})[_0x4d62('0x29')](function(_0x50acec){if(_0x50acec){return{'count':_0x50acec[_0x4d62('0x24')],'rows':_[_0x4d62('0x40')](_0x50acec[_0x4d62('0x45')],function(_0x455ce6){return{'membername':_0x455ce6['name'],'UserId':_0x455ce6['id'],'queue_name':_0x4cb430[_0x4d62('0x2e')],'MailQueueId':_0x4cb430['id'],'interface':util['format']('%s/%s',_0x4d62('0x60'),_0x455ce6[_0x4d62('0x2e')]),'penalty':0x0,'paused':_0x455ce6['mailPause'],'createdAt':_0x455ce6[_0x4d62('0x5f')],'updatedAt':_0x455ce6[_0x4d62('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4d62('0x29')](respondWithFilteredResult(_0x44e25c,_0x1cb510))[_0x4d62('0x4b')](handleError(_0x44e25c,null));};exports[_0x4d62('0x62')]=function(_0x5b3e9b,_0x5e15ab,_0x512a0c){var _0x391f2f={};var _0x6911ce={};var _0x344d54;var _0x5a6520;return db[_0x4d62('0x31')][_0x4d62('0x58')]({'where':{'id':_0x5b3e9b[_0x4d62('0x47')]['id']}})[_0x4d62('0x29')](handleEntityNotFound(_0x5e15ab,null))[_0x4d62('0x29')](function(_0x83077){if(_0x83077){_0x344d54=_0x83077;_0x6911ce[_0x4d62('0x37')]=_[_0x4d62('0x34')](db['Team'][_0x4d62('0x48')]);_0x6911ce['query']=_[_0x4d62('0x34')](_0x5b3e9b[_0x4d62('0x33')]);_0x6911ce[_0x4d62('0x35')]=_[_0x4d62('0x36')](_0x6911ce['model'],_0x6911ce[_0x4d62('0x33')]);_0x391f2f[_0x4d62('0x38')]=_[_0x4d62('0x36')](_0x6911ce[_0x4d62('0x37')],qs[_0x4d62('0x39')](_0x5b3e9b['query'][_0x4d62('0x39')]));_0x391f2f[_0x4d62('0x38')]=_0x391f2f[_0x4d62('0x38')][_0x4d62('0x3a')]?_0x391f2f['attributes']:_0x6911ce['model'];_0x391f2f[_0x4d62('0x3c')]=qs['sort'](_0x5b3e9b[_0x4d62('0x33')][_0x4d62('0x3d')]);_0x391f2f[_0x4d62('0x3e')]=qs[_0x4d62('0x35')](_[_0x4d62('0x63')](_0x5b3e9b[_0x4d62('0x33')],_0x6911ce[_0x4d62('0x35')]));if(_0x5b3e9b[_0x4d62('0x33')]['filter']){_0x391f2f[_0x4d62('0x3e')]=_[_0x4d62('0x3f')](_0x391f2f['where'],{'$or':_[_0x4d62('0x40')](_0x391f2f[_0x4d62('0x38')],function(_0x501d38){var _0x179975={};_0x179975[_0x501d38]={'$like':'%'+_0x5b3e9b['query'][_0x4d62('0x41')]+'%'};return _0x179975;})});}_0x391f2f=_[_0x4d62('0x3f')]({},_0x391f2f,_0x5b3e9b['options']);return _0x344d54[_0x4d62('0x62')](_0x391f2f);}})[_0x4d62('0x29')](function(_0x3da1ec){if(_0x3da1ec){_0x5a6520=_0x3da1ec[_0x4d62('0x3a')];if(!_0x5b3e9b['query'][_0x4d62('0x3b')](_0x4d62('0x64'))){_0x391f2f[_0x4d62('0x23')]=qs[_0x4d62('0x23')](_0x5b3e9b[_0x4d62('0x33')]['limit']);_0x391f2f[_0x4d62('0x21')]=qs[_0x4d62('0x21')](_0x5b3e9b['query']['offset']);}return _0x344d54[_0x4d62('0x62')](_0x391f2f);}})[_0x4d62('0x29')](function(_0x3a1bad){if(_0x3a1bad){return _0x3a1bad?{'count':_0x5a6520,'rows':_0x3a1bad}:null;}})[_0x4d62('0x29')](respondWithResult(_0x5e15ab,null))[_0x4d62('0x4b')](handleError(_0x5e15ab,null));};exports['addTeams']=function(_0x485114,_0x2e774a,_0x8b622b){var _0x4778a9=_0x485114[_0x4d62('0x4d')][_0x4d62('0x65')];return db['Team'][_0x4d62('0x44')]({'where':{'id':_0x4778a9},'attributes':['id'],'include':[{'model':db[_0x4d62('0x5b')],'as':_0x4d62('0x66'),'attributes':['id',_0x4d62('0x2e'),_0x4d62('0x67'),_0x4d62('0x68'),_0x4d62('0x69')],'raw':!![]}]})[_0x4d62('0x29')](function(_0x299697){if(_0x299697){var _0x12eea9=_['flatMap'](_0x299697,function(_0x222b35){var _0x13b5e2=_0x222b35[_0x4d62('0x2b')]({'plain':!![]});return _0x13b5e2[_0x4d62('0x66')];});return db[_0x4d62('0x31')][_0x4d62('0x4a')]({'where':{'id':_0x485114[_0x4d62('0x47')]['id']}})['then'](function(_0x221c98){return db[_0x4d62('0x6a')][_0x4d62('0x6b')](function(_0x458428){return _0x221c98[_0x4d62('0x6c')](_0x4778a9,{'transaction':_0x458428})[_0x4d62('0x29')](function(){return BPromise[_0x4d62('0x6d')](_0x12eea9,function(_0x290966){return db[_0x4d62('0x5a')][_0x4d62('0x6e')]({'where':{'UserId':_0x290966['id'],'MailQueueId':_0x485114[_0x4d62('0x47')]['id']},'transaction':_0x458428});});})[_0x4d62('0x29')](function(){_0x12eea9[_0x4d62('0x6f')](function(_0x1bfa32){socket['emit'](_0x4d62('0x70'),{'UserId':_0x1bfa32['id'],'MailQueueId':_0x221c98['id']});});});});});}})[_0x4d62('0x29')](respondWithStatusCode(_0x2e774a,null))['catch'](handleError(_0x2e774a,null));};exports[_0x4d62('0x71')]=function(_0x405253,_0x484be1,_0x2c6dc9){return db[_0x4d62('0x72')][_0x4d62('0x44')]({'where':{'id':_0x405253[_0x4d62('0x33')][_0x4d62('0x65')]},'attributes':['id'],'include':[{'model':db[_0x4d62('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x484be1,null))['then'](function(_0x5a8efd){var _0x338733=_['map'](_0x5a8efd,'id');var _0xe2ce73=[];var _0x43089a=[];var _0x57b630=squel['select']();_0x57b630[_0x4d62('0x73')](_0x4d62('0x74'))['from'](_0x4d62('0x75'),'tq')['join'](_0x4d62('0x76'),'ut',_0x4d62('0x77'))[_0x4d62('0x3e')]('MailQueueId\x20=\x20?',_0x405253['params']['id']);for(var _0x5355d1=0x0;_0x5355d1<_0x5a8efd[_0x4d62('0x3a')];_0x5355d1+=0x1){let _0x4ea3d9=_0x5a8efd[_0x5355d1];for(var _0x10db19=0x0;_0x10db19<_0x4ea3d9[_0x4d62('0x66')][_0x4d62('0x3a')];_0x10db19+=0x1){let _0x349fb2=_0x4ea3d9[_0x4d62('0x66')][_0x10db19];var _0x417690=_0x57b630[_0x4d62('0x78')]();_0x417690['where'](_0x4d62('0x79'),_0x349fb2['id']);_0x43089a[_0x4d62('0x7a')](db['sequelize'][_0x4d62('0x33')](_0x417690[_0x4d62('0x7b')](),{'type':db[_0x4d62('0x6a')][_0x4d62('0x7c')][_0x4d62('0x7d')]})['then'](function(_0x3ec7ec){if(_0x3ec7ec[_0x4d62('0x3a')]===0x1){return _0x349fb2['id'];}else{var _0x3749d7=_[_0x4d62('0x7e')](_[_0x4d62('0x40')](_0x3ec7ec,_0x4d62('0x7f')),function(_0x4af52b){return _['includes'](_0x338733,_0x4af52b);});if(_0x3749d7){return _0x349fb2['id'];}}}));}}return BPromise[_0x4d62('0x80')](_0x43089a)['then'](function(_0x195622){_0xe2ce73=_(_0xe2ce73)[_0x4d62('0x81')](_0x195622)[_0x4d62('0x82')]()[_0x4d62('0x83')]();return db[_0x4d62('0x31')][_0x4d62('0x4a')]({'where':{'id':_0x405253['params']['id']}})[_0x4d62('0x29')](function(_0x580586){return db[_0x4d62('0x6a')][_0x4d62('0x6b')](function(_0x5786c5){return _0x580586[_0x4d62('0x71')](_0x405253[_0x4d62('0x33')][_0x4d62('0x65')],{'transaction':_0x5786c5})[_0x4d62('0x29')](function(){if(!_[_0x4d62('0x84')](_0xe2ce73)){return _0x580586[_0x4d62('0x85')](_0xe2ce73,{'transaction':_0x5786c5});}})[_0x4d62('0x29')](function(){_0xe2ce73[_0x4d62('0x6f')](function(_0x5b60f8){socket[_0x4d62('0x86')](_0x4d62('0x87'),{'UserId':_0x5b60f8,'MailQueueId':_0x580586['id']});});});});});});})['then'](respondWithStatusCode(_0x484be1,null))[_0x4d62('0x4b')](handleError(_0x484be1,null));};exports['addAgents']=function(_0xc2ca7b,_0x400ee9,_0x375618){return db['MailQueue'][_0x4d62('0x4a')]({'where':{'id':_0xc2ca7b[_0x4d62('0x47')]['id']}})['then'](handleEntityNotFound(_0x400ee9,null))[_0x4d62('0x29')](function(_0x392c70){if(_0x392c70){return _0x392c70[_0x4d62('0x88')](_0xc2ca7b[_0x4d62('0x4d')][_0x4d62('0x65')],_['omit'](_0xc2ca7b[_0x4d62('0x4d')],[_0x4d62('0x65'),'id'])||{})['spread'](function(_0x3b7b07){for(var _0x4446c9=0x0;_0x4446c9<_0xc2ca7b[_0x4d62('0x4d')][_0x4d62('0x65')][_0x4d62('0x3a')];_0x4446c9+=0x1){socket[_0x4d62('0x86')]('userMailQueue:save',{'UserId':Number(_0xc2ca7b[_0x4d62('0x4d')][_0x4d62('0x65')][_0x4446c9]),'MailQueueId':Number(_0xc2ca7b[_0x4d62('0x47')]['id'])});}return _0x3b7b07;});}})['then'](respondWithResult(_0x400ee9,null))['catch'](handleError(_0x400ee9,null));};exports[_0x4d62('0x85')]=function(_0x564e8f,_0x498802,_0x1c04ed){return db[_0x4d62('0x31')][_0x4d62('0x4a')]({'where':{'id':_0x564e8f[_0x4d62('0x47')]['id']}})[_0x4d62('0x29')](handleEntityNotFound(_0x498802,null))[_0x4d62('0x29')](function(_0x371ab2){if(_0x371ab2){return _0x371ab2[_0x4d62('0x85')](_0x564e8f[_0x4d62('0x33')][_0x4d62('0x65')])[_0x4d62('0x29')](function(){if(_[_0x4d62('0x89')](_0x564e8f[_0x4d62('0x33')][_0x4d62('0x65')])){for(var _0xf1374=0x0;_0xf1374<_0x564e8f[_0x4d62('0x33')]['ids'][_0x4d62('0x3a')];_0xf1374+=0x1){socket[_0x4d62('0x86')]('userMailQueue:remove',{'UserId':Number(_0x564e8f[_0x4d62('0x33')][_0x4d62('0x65')][_0xf1374]),'MailQueueId':Number(_0x564e8f[_0x4d62('0x47')]['id'])});}}else{socket[_0x4d62('0x86')](_0x4d62('0x87'),{'UserId':Number(_0x564e8f[_0x4d62('0x33')][_0x4d62('0x65')]),'MailQueueId':Number(_0x564e8f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x498802,null))[_0x4d62('0x4b')](handleError(_0x498802,null));};exports[_0x4d62('0x8a')]=function(_0x5ef7a9,_0x56c7be,_0x599716){var _0x25ebd5={};var _0x59f907={};var _0x4c0116;var _0xf99247;return db[_0x4d62('0x31')][_0x4d62('0x58')]({'where':{'id':_0x5ef7a9['params']['id']}})[_0x4d62('0x29')](handleEntityNotFound(_0x56c7be,null))['then'](function(_0x6be257){if(_0x6be257){_0x4c0116=_0x6be257;_0x59f907[_0x4d62('0x37')]=_[_0x4d62('0x34')](db[_0x4d62('0x5b')][_0x4d62('0x48')]);_0x59f907[_0x4d62('0x33')]=_['keys'](_0x5ef7a9[_0x4d62('0x33')]);_0x59f907[_0x4d62('0x35')]=_[_0x4d62('0x36')](_0x59f907[_0x4d62('0x37')],_0x59f907[_0x4d62('0x33')]);_0x25ebd5[_0x4d62('0x38')]=_[_0x4d62('0x36')](_0x59f907[_0x4d62('0x37')],qs[_0x4d62('0x39')](_0x5ef7a9[_0x4d62('0x33')][_0x4d62('0x39')]));_0x25ebd5[_0x4d62('0x38')]=_0x25ebd5[_0x4d62('0x38')][_0x4d62('0x3a')]?_0x25ebd5[_0x4d62('0x38')]:_0x59f907[_0x4d62('0x37')];_0x25ebd5[_0x4d62('0x3c')]=qs[_0x4d62('0x3d')](_0x5ef7a9[_0x4d62('0x33')][_0x4d62('0x3d')]);_0x25ebd5[_0x4d62('0x3e')]=qs[_0x4d62('0x35')](_[_0x4d62('0x63')](_0x5ef7a9[_0x4d62('0x33')],_0x59f907[_0x4d62('0x35')]));if(_0x5ef7a9[_0x4d62('0x33')][_0x4d62('0x41')]){_0x25ebd5[_0x4d62('0x3e')]=_['merge'](_0x25ebd5[_0x4d62('0x3e')],{'$or':_[_0x4d62('0x40')](_0x25ebd5[_0x4d62('0x38')],function(_0x4a1a70){var _0xf7e78b={};_0xf7e78b[_0x4a1a70]={'$like':'%'+_0x5ef7a9[_0x4d62('0x33')][_0x4d62('0x41')]+'%'};return _0xf7e78b;})});}_0x25ebd5=_[_0x4d62('0x3f')]({},_0x25ebd5,_0x5ef7a9[_0x4d62('0x42')]);return _0x4c0116[_0x4d62('0x8a')](_0x25ebd5);}})['then'](function(_0x177436){if(_0x177436){_0xf99247=_0x177436[_0x4d62('0x3a')];if(!_0x5ef7a9[_0x4d62('0x33')][_0x4d62('0x3b')](_0x4d62('0x64'))){_0x25ebd5[_0x4d62('0x23')]=qs[_0x4d62('0x23')](_0x5ef7a9[_0x4d62('0x33')]['limit']);_0x25ebd5[_0x4d62('0x21')]=qs[_0x4d62('0x21')](_0x5ef7a9['query'][_0x4d62('0x21')]);}return _0x4c0116[_0x4d62('0x8a')](_0x25ebd5);}})[_0x4d62('0x29')](function(_0x40415f){if(_0x40415f){return _0x40415f?{'count':_0xf99247,'rows':_0x40415f}:null;}})[_0x4d62('0x29')](respondWithResult(_0x56c7be,null))[_0x4d62('0x4b')](handleError(_0x56c7be,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 69ef54e..11103ba 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 _0xa266=['remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save'];(function(_0x162fa5,_0x5a0159){var _0x2d3fca=function(_0x10acba){while(--_0x10acba){_0x162fa5['push'](_0x162fa5['shift']());}};_0x2d3fca(++_0x5a0159);}(_0xa266,0x123));var _0x6a26=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0xa266[_0x119d25];return _0x39cf30;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x6a26('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6a26('0x1')](0x0);var events={'afterCreate':_0x6a26('0x2'),'afterUpdate':'update','afterDestroy':_0x6a26('0x3')};function emitEvent(_0x89a35f){return function(_0x20a397,_0x12e234,_0x6d32d3){MailQueueEvents[_0x6a26('0x4')](_0x89a35f+':'+_0x20a397['id'],_0x20a397);MailQueueEvents['emit'](_0x89a35f,_0x20a397);_0x6d32d3(null);};}for(var e in events){if(events[_0x6a26('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x6a26('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x50fc=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x50fc,0x10e));var _0xc50f=function(_0x1c7f48,_0x255687){_0x1c7f48=_0x1c7f48-0x0;var _0x274c31=_0x50fc[_0x1c7f48];return _0x274c31;};'use strict';var EventEmitter=require(_0xc50f('0x0'));var MailQueue=require(_0xc50f('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xc50f('0x2')](0x0);var events={'afterCreate':_0xc50f('0x3'),'afterUpdate':_0xc50f('0x4'),'afterDestroy':_0xc50f('0x5')};function emitEvent(_0x32e9cc){return function(_0x339a16,_0x696f3b,_0x55a75a){MailQueueEvents['emit'](_0x32e9cc+':'+_0x339a16['id'],_0x339a16);MailQueueEvents[_0xc50f('0x6')](_0x32e9cc,_0x339a16);_0x55a75a(null);};}for(var e in events){if(events[_0xc50f('0x7')](e)){var event=events[e];MailQueue[_0xc50f('0x8')](e,emitEvent(event));}}module[_0xc50f('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index b29302a..8db086f 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 _0xb842=['request-promise','rimraf','./mailQueue.attributes','define','mail_queues','lodash','util','api','moment','bluebird'];(function(_0x398532,_0x34d29a){var _0x49a6b0=function(_0x58adbf){while(--_0x58adbf){_0x398532['push'](_0x398532['shift']());}};_0x49a6b0(++_0x34d29a);}(_0xb842,0xcd));var _0x2b84=function(_0x491468,_0x42f169){_0x491468=_0x491468-0x0;var _0x5b8c22=_0xb842[_0x491468];return _0x5b8c22;};'use strict';var _=require(_0x2b84('0x0'));var util=require(_0x2b84('0x1'));var logger=require('../../config/logger')(_0x2b84('0x2'));var moment=require(_0x2b84('0x3'));var BPromise=require(_0x2b84('0x4'));var rp=require(_0x2b84('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b84('0x6'));var config=require('../../config/environment');var attributes=require(_0x2b84('0x7'));module['exports']=function(_0x3816ff,_0x25d27e){return _0x3816ff[_0x2b84('0x8')]('MailQueue',attributes,{'tableName':_0x2b84('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f60=['mail_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8f60,0x146));var _0x08f6=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x8f60[_0x69a451];return _0x3d6ef5;};'use strict';var _=require(_0x08f6('0x0'));var util=require(_0x08f6('0x1'));var logger=require(_0x08f6('0x2'))(_0x08f6('0x3'));var moment=require('moment');var BPromise=require(_0x08f6('0x4'));var rp=require(_0x08f6('0x5'));var fs=require('fs');var path=require(_0x08f6('0x6'));var rimraf=require('rimraf');var config=require(_0x08f6('0x7'));var attributes=require(_0x08f6('0x8'));module[_0x08f6('0x9')]=function(_0x3fb04b,_0x59afb8){return _0x3fb04b[_0x08f6('0xa')](_0x08f6('0xb'),attributes,{'tableName':_0x08f6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 90c9b78..ed08a1f 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 _0x4a47=['./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','options','raw','where','attributes','map','model','include','debug','MailQueue','find','then','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','redis'];(function(_0x1e718c,_0x5e9904){var _0x2d75e8=function(_0x1a4a21){while(--_0x1a4a21){_0x1e718c['push'](_0x1e718c['shift']());}};_0x2d75e8(++_0x5e9904);}(_0x4a47,0xb5));var _0x74a4=function(_0x238b73,_0x5df76f){_0x238b73=_0x238b73-0x0;var _0x5966d9=_0x4a47[_0x238b73];return _0x5966d9;};'use strict';var _=require(_0x74a4('0x0'));var util=require(_0x74a4('0x1'));var moment=require(_0x74a4('0x2'));var BPromise=require(_0x74a4('0x3'));var rs=require(_0x74a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a4('0x6'))(_0x74a4('0x7'));var config=require('../../config/environment');var jayson=require(_0x74a4('0x8'));var client=jayson[_0x74a4('0x9')][_0x74a4('0xa')]({'port':0x232a});config['redis']=_[_0x74a4('0xb')](config['redis'],{'host':_0x74a4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74a4('0xd')]));require(_0x74a4('0xe'))[_0x74a4('0xf')](socket);function respondWithRpcPromise(_0x17c01f,_0x56a17a,_0x1efc67){return new BPromise(function(_0x65a4ef,_0x316f53){return client[_0x74a4('0x10')](_0x17c01f,_0x1efc67)['then'](function(_0x379351){logger[_0x74a4('0x11')](_0x74a4('0x12'),_0x56a17a,'request\x20sent');logger['debug'](_0x74a4('0x13'),_0x56a17a,_0x74a4('0x14'),JSON[_0x74a4('0x15')](_0x379351));if(_0x379351[_0x74a4('0x16')]){if(_0x379351[_0x74a4('0x16')][_0x74a4('0x17')]===0x1f4){logger[_0x74a4('0x16')](_0x74a4('0x12'),_0x56a17a,_0x379351[_0x74a4('0x16')][_0x74a4('0x18')]);return _0x316f53(_0x379351[_0x74a4('0x16')][_0x74a4('0x18')]);}logger[_0x74a4('0x16')](_0x74a4('0x12'),_0x56a17a,_0x379351[_0x74a4('0x16')][_0x74a4('0x18')]);return _0x65a4ef(_0x379351['error'][_0x74a4('0x18')]);}else{logger[_0x74a4('0x11')](_0x74a4('0x12'),_0x56a17a,_0x74a4('0x14'));_0x65a4ef(_0x379351['result'][_0x74a4('0x18')]);}})[_0x74a4('0x19')](function(_0x42d72a){logger[_0x74a4('0x16')]('MailQueue,\x20%s,\x20%s',_0x56a17a,_0x42d72a);_0x316f53(_0x42d72a);});});}exports[_0x74a4('0x1a')]=function(_0x3adb7c){var _0x59bb30=this;return new Promise(function(_0x12fc31,_0x2d3075){return db['MailQueue']['findAll']({'raw':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c[_0x74a4('0x1b')][_0x74a4('0x1c')]===undefined?!![]:![]:!![],'where':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c['options'][_0x74a4('0x1d')]||null:null,'attributes':_0x3adb7c['options']?_0x3adb7c['options'][_0x74a4('0x1e')]||null:null,'limit':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c[_0x74a4('0x1b')]['limit']||null:null,'include':_0x3adb7c[_0x74a4('0x1b')]?_0x3adb7c[_0x74a4('0x1b')]['include']?_[_0x74a4('0x1f')](_0x3adb7c[_0x74a4('0x1b')]['include'],function(_0x12895a){return{'model':db[_0x12895a[_0x74a4('0x20')]],'as':_0x12895a['as'],'attributes':_0x12895a[_0x74a4('0x1e')],'include':_0x12895a['include']?_[_0x74a4('0x1f')](_0x12895a[_0x74a4('0x21')],function(_0x1510fd){return{'model':db[_0x1510fd[_0x74a4('0x20')]],'as':_0x1510fd['as'],'attributes':_0x1510fd[_0x74a4('0x1e')],'include':_0x1510fd[_0x74a4('0x21')]?_['map'](_0x1510fd['include'],function(_0x36472e){return{'model':db[_0x36472e['model']],'as':_0x36472e['as'],'attributes':_0x36472e[_0x74a4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x446340){logger['info']('GetMailQueue',_0x3adb7c);logger[_0x74a4('0x22')](_0x74a4('0x1a'),_0x3adb7c,JSON[_0x74a4('0x15')](_0x446340));_0x12fc31(_0x446340);})['catch'](function(_0x4abc27){logger['error']('GetMailQueue',_0x4abc27['message'],_0x3adb7c);_0x2d3075(_0x59bb30['error'](0x1f4,_0x4abc27[_0x74a4('0x18')]));});});};exports['ShowMailQueue']=function(_0x1734b9){var _0x395e32=this;return new Promise(function(_0x3747f7,_0x5b277a){return db[_0x74a4('0x23')][_0x74a4('0x24')]({'raw':_0x1734b9[_0x74a4('0x1b')]?_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x1c')]===undefined?!![]:![]:!![],'where':_0x1734b9[_0x74a4('0x1b')]?_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x1d')]||null:null,'attributes':_0x1734b9['options']?_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x1e')]||null:null,'include':_0x1734b9['options']?_0x1734b9[_0x74a4('0x1b')]['include']?_['map'](_0x1734b9[_0x74a4('0x1b')][_0x74a4('0x21')],function(_0x2a79e1){return{'model':db[_0x2a79e1[_0x74a4('0x20')]],'as':_0x2a79e1['as'],'attributes':_0x2a79e1[_0x74a4('0x1e')],'include':_0x2a79e1[_0x74a4('0x21')]?_[_0x74a4('0x1f')](_0x2a79e1[_0x74a4('0x21')],function(_0xa52e2){return{'model':db[_0xa52e2['model']],'as':_0xa52e2['as'],'attributes':_0xa52e2[_0x74a4('0x1e')],'include':_0xa52e2[_0x74a4('0x21')]?_[_0x74a4('0x1f')](_0xa52e2[_0x74a4('0x21')],function(_0x1834cc){return{'model':db[_0x1834cc['model']],'as':_0x1834cc['as'],'attributes':_0x1834cc[_0x74a4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x74a4('0x25')](function(_0x5e2944){logger[_0x74a4('0x11')](_0x74a4('0x26'),_0x1734b9);logger[_0x74a4('0x22')](_0x74a4('0x26'),_0x1734b9,JSON[_0x74a4('0x15')](_0x5e2944));_0x3747f7(_0x5e2944);})[_0x74a4('0x19')](function(_0x5ef529){logger[_0x74a4('0x16')](_0x74a4('0x26'),_0x5ef529['message'],_0x1734b9);_0x5b277a(_0x395e32[_0x74a4('0x16')](0x1f4,_0x5ef529[_0x74a4('0x18')]));});});}; \ No newline at end of file +var _0x6a6e=['stringify','ShowMailQueue','MailQueue','raw','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','info','request\x20sent','error','code','message','MailQueue,\x20%s,\x20%s','result','catch','findAll','options','where','attributes','limit','include','map','model','GetMailQueue'];(function(_0x4c01f4,_0x1ba411){var _0x14e711=function(_0x24d668){while(--_0x24d668){_0x4c01f4['push'](_0x4c01f4['shift']());}};_0x14e711(++_0x1ba411);}(_0x6a6e,0xd3));var _0xe6a6=function(_0x3cac17,_0x174a50){_0x3cac17=_0x3cac17-0x0;var _0x38e3be=_0x6a6e[_0x3cac17];return _0x38e3be;};'use strict';var _=require('lodash');var util=require(_0xe6a6('0x0'));var moment=require(_0xe6a6('0x1'));var BPromise=require(_0xe6a6('0x2'));var rs=require(_0xe6a6('0x3'));var fs=require('fs');var Redis=require(_0xe6a6('0x4'));var db=require(_0xe6a6('0x5'))['db'];var utils=require(_0xe6a6('0x6'));var logger=require(_0xe6a6('0x7'))('rpc');var config=require(_0xe6a6('0x8'));var jayson=require(_0xe6a6('0x9'));var client=jayson[_0xe6a6('0xa')][_0xe6a6('0xb')]({'port':0x232a});config[_0xe6a6('0xc')]=_[_0xe6a6('0xd')](config[_0xe6a6('0xc')],{'host':_0xe6a6('0xe'),'port':0x18eb});var socket=require(_0xe6a6('0xf'))(new Redis(config[_0xe6a6('0xc')]));require(_0xe6a6('0x10'))[_0xe6a6('0x11')](socket);function respondWithRpcPromise(_0x4ba070,_0x166fae,_0xbf5948){return new BPromise(function(_0x18d80f,_0x2e3879){return client['request'](_0x4ba070,_0xbf5948)['then'](function(_0x2951f2){logger[_0xe6a6('0x12')]('MailQueue,\x20%s,\x20%s',_0x166fae,_0xe6a6('0x13'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x166fae,'request\x20sent',JSON['stringify'](_0x2951f2));if(_0x2951f2[_0xe6a6('0x14')]){if(_0x2951f2['error'][_0xe6a6('0x15')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x166fae,_0x2951f2[_0xe6a6('0x14')]['message']);return _0x2e3879(_0x2951f2[_0xe6a6('0x14')][_0xe6a6('0x16')]);}logger['error'](_0xe6a6('0x17'),_0x166fae,_0x2951f2[_0xe6a6('0x14')][_0xe6a6('0x16')]);return _0x18d80f(_0x2951f2['error']['message']);}else{logger[_0xe6a6('0x12')](_0xe6a6('0x17'),_0x166fae,_0xe6a6('0x13'));_0x18d80f(_0x2951f2[_0xe6a6('0x18')][_0xe6a6('0x16')]);}})[_0xe6a6('0x19')](function(_0x66d1a7){logger['error'](_0xe6a6('0x17'),_0x166fae,_0x66d1a7);_0x2e3879(_0x66d1a7);});});}exports['GetMailQueue']=function(_0x3f672a){var _0x113744=this;return new Promise(function(_0x3a6b34,_0x1fa7ff){return db['MailQueue'][_0xe6a6('0x1a')]({'raw':_0x3f672a['options']?_0x3f672a[_0xe6a6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3f672a['options']?_0x3f672a[_0xe6a6('0x1b')][_0xe6a6('0x1c')]||null:null,'attributes':_0x3f672a[_0xe6a6('0x1b')]?_0x3f672a[_0xe6a6('0x1b')][_0xe6a6('0x1d')]||null:null,'limit':_0x3f672a[_0xe6a6('0x1b')]?_0x3f672a[_0xe6a6('0x1b')][_0xe6a6('0x1e')]||null:null,'include':_0x3f672a['options']?_0x3f672a[_0xe6a6('0x1b')][_0xe6a6('0x1f')]?_[_0xe6a6('0x20')](_0x3f672a[_0xe6a6('0x1b')][_0xe6a6('0x1f')],function(_0x56d6e9){return{'model':db[_0x56d6e9['model']],'as':_0x56d6e9['as'],'attributes':_0x56d6e9['attributes'],'include':_0x56d6e9[_0xe6a6('0x1f')]?_[_0xe6a6('0x20')](_0x56d6e9[_0xe6a6('0x1f')],function(_0x2f558e){return{'model':db[_0x2f558e[_0xe6a6('0x21')]],'as':_0x2f558e['as'],'attributes':_0x2f558e[_0xe6a6('0x1d')],'include':_0x2f558e['include']?_[_0xe6a6('0x20')](_0x2f558e[_0xe6a6('0x1f')],function(_0x5b98ab){return{'model':db[_0x5b98ab['model']],'as':_0x5b98ab['as'],'attributes':_0x5b98ab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a7557){logger[_0xe6a6('0x12')](_0xe6a6('0x22'),_0x3f672a);logger['debug'](_0xe6a6('0x22'),_0x3f672a,JSON[_0xe6a6('0x23')](_0x2a7557));_0x3a6b34(_0x2a7557);})[_0xe6a6('0x19')](function(_0x513b3b){logger['error'](_0xe6a6('0x22'),_0x513b3b['message'],_0x3f672a);_0x1fa7ff(_0x113744[_0xe6a6('0x14')](0x1f4,_0x513b3b[_0xe6a6('0x16')]));});});};exports[_0xe6a6('0x24')]=function(_0x1334c7){var _0x731365=this;return new Promise(function(_0x2a6eba,_0x344927){return db[_0xe6a6('0x25')]['find']({'raw':_0x1334c7[_0xe6a6('0x1b')]?_0x1334c7[_0xe6a6('0x1b')][_0xe6a6('0x26')]===undefined?!![]:![]:!![],'where':_0x1334c7[_0xe6a6('0x1b')]?_0x1334c7[_0xe6a6('0x1b')]['where']||null:null,'attributes':_0x1334c7[_0xe6a6('0x1b')]?_0x1334c7[_0xe6a6('0x1b')][_0xe6a6('0x1d')]||null:null,'include':_0x1334c7[_0xe6a6('0x1b')]?_0x1334c7[_0xe6a6('0x1b')][_0xe6a6('0x1f')]?_[_0xe6a6('0x20')](_0x1334c7['options'][_0xe6a6('0x1f')],function(_0x3f438f){return{'model':db[_0x3f438f[_0xe6a6('0x21')]],'as':_0x3f438f['as'],'attributes':_0x3f438f[_0xe6a6('0x1d')],'include':_0x3f438f[_0xe6a6('0x1f')]?_[_0xe6a6('0x20')](_0x3f438f[_0xe6a6('0x1f')],function(_0x43738a){return{'model':db[_0x43738a[_0xe6a6('0x21')]],'as':_0x43738a['as'],'attributes':_0x43738a[_0xe6a6('0x1d')],'include':_0x43738a['include']?_[_0xe6a6('0x20')](_0x43738a['include'],function(_0x2d5507){return{'model':db[_0x2d5507[_0xe6a6('0x21')]],'as':_0x2d5507['as'],'attributes':_0x2d5507[_0xe6a6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe6a6('0x27')](function(_0x3dd987){logger[_0xe6a6('0x12')](_0xe6a6('0x24'),_0x1334c7);logger[_0xe6a6('0x28')]('ShowMailQueue',_0x1334c7,JSON['stringify'](_0x3dd987));_0x2a6eba(_0x3dd987);})[_0xe6a6('0x19')](function(_0x19f9f1){logger['error'](_0xe6a6('0x24'),_0x19f9f1[_0xe6a6('0x16')],_0x1334c7);_0x344927(_0x731365[_0xe6a6('0x14')](0x1f4,_0x19f9f1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c14e3c9..4722d06 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 _0x4e8d=['remove','update','emit','removeListener','register','mailQueue:','./mailQueue.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e8d,0x11e));var _0xd4e8=function(_0xc92168,_0x1fdb87){_0xc92168=_0xc92168-0x0;var _0x3df304=_0x4e8d[_0xc92168];return _0x3df304;};'use strict';var MailQueueEvents=require(_0xd4e8('0x0'));var events=[_0xd4e8('0x1'),_0xd4e8('0x2'),_0xd4e8('0x3')];function createListener(_0x25017b,_0x117af1){return function(_0x5d6fd8){_0x117af1[_0xd4e8('0x4')](_0x25017b,_0x5d6fd8);};}function removeListener(_0x95f04c,_0x131227){return function(){MailQueueEvents[_0xd4e8('0x5')](_0x95f04c,_0x131227);};}exports[_0xd4e8('0x6')]=function(_0x582778){for(var _0x459ce0=0x0,_0x5c8a29=events['length'];_0x459ce0<_0x5c8a29;_0x459ce0++){var _0x22c8ee=events[_0x459ce0];var _0x16c492=createListener(_0xd4e8('0x7')+_0x22c8ee,_0x582778);MailQueueEvents['on'](_0x22c8ee,_0x16c492);}}; \ No newline at end of file +var _0x9d1d=['emit','removeListener','length','mailQueue:','./mailQueue.events','update'];(function(_0x5a3adc,_0x5c1f5d){var _0x288044=function(_0x9d56ce){while(--_0x9d56ce){_0x5a3adc['push'](_0x5a3adc['shift']());}};_0x288044(++_0x5c1f5d);}(_0x9d1d,0x118));var _0xd9d1=function(_0x415163,_0x5cc5da){_0x415163=_0x415163-0x0;var _0x4b9f43=_0x9d1d[_0x415163];return _0x4b9f43;};'use strict';var MailQueueEvents=require(_0xd9d1('0x0'));var events=['save','remove',_0xd9d1('0x1')];function createListener(_0x563b79,_0x57e33e){return function(_0x55cd16){_0x57e33e[_0xd9d1('0x2')](_0x563b79,_0x55cd16);};}function removeListener(_0x39c2ad,_0x577d03){return function(){MailQueueEvents[_0xd9d1('0x3')](_0x39c2ad,_0x577d03);};}exports['register']=function(_0x2450de){for(var _0x1ddd64=0x0,_0x5aa4fe=events[_0xd9d1('0x4')];_0x1ddd64<_0x5aa4fe;_0x1ddd64++){var _0x44f5e9=events[_0x1ddd64];var _0x18dd92=createListener(_0xd9d1('0x5')+_0x44f5e9,_0x2450de);MailQueueEvents['on'](_0x44f5e9,_0x18dd92);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index c4554bb..a526fb9 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 _0x85b3=['/:id','post','create','put','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','/describe','describe'];(function(_0x334122,_0x41aa8f){var _0x10c82f=function(_0x4afcbe){while(--_0x4afcbe){_0x334122['push'](_0x334122['shift']());}};_0x10c82f(++_0x41aa8f);}(_0x85b3,0xe6));var _0x385b=function(_0x33b611,_0x3fc1a8){_0x33b611=_0x33b611-0x0;var _0x547dcb=_0x85b3[_0x33b611];return _0x547dcb;};'use strict';var multer=require(_0x385b('0x0'));var util=require(_0x385b('0x1'));var path=require(_0x385b('0x2'));var timeout=require(_0x385b('0x3'));var express=require('express');var router=express[_0x385b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x385b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x385b('0x6')]('/',auth[_0x385b('0x7')](),controller['index']);router['get'](_0x385b('0x8'),auth[_0x385b('0x7')](),controller[_0x385b('0x9')]);router[_0x385b('0x6')](_0x385b('0xa'),auth[_0x385b('0x7')](),controller['show']);router[_0x385b('0xb')]('/',auth['isAuthenticated'](),controller[_0x385b('0xc')]);router[_0x385b('0xd')](_0x385b('0xa'),auth[_0x385b('0x7')](),controller[_0x385b('0xe')]);router['delete'](_0x385b('0xa'),auth['isAuthenticated'](),controller[_0x385b('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5930=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller'];(function(_0xdf0655,_0x3b4f0f){var _0x4d5749=function(_0x45ea34){while(--_0x45ea34){_0xdf0655['push'](_0xdf0655['shift']());}};_0x4d5749(++_0x3b4f0f);}(_0x5930,0x1b0));var _0x0593=function(_0x4aa314,_0x1fa2b6){_0x4aa314=_0x4aa314-0x0;var _0x338e0e=_0x5930[_0x4aa314];return _0x338e0e;};'use strict';var multer=require(_0x0593('0x0'));var util=require('util');var path=require(_0x0593('0x1'));var timeout=require(_0x0593('0x2'));var express=require(_0x0593('0x3'));var router=express['Router']();var fs_extra=require(_0x0593('0x4'));var auth=require(_0x0593('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0593('0x6'));var controller=require(_0x0593('0x7'));router[_0x0593('0x8')]('/',auth[_0x0593('0x9')](),controller[_0x0593('0xa')]);router[_0x0593('0x8')](_0x0593('0xb'),auth['isAuthenticated'](),controller[_0x0593('0xc')]);router[_0x0593('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0593('0xd')]);router[_0x0593('0xe')]('/',auth[_0x0593('0x9')](),controller[_0x0593('0xf')]);router[_0x0593('0x10')](_0x0593('0x11'),auth[_0x0593('0x9')](),controller['update']);router['delete'](_0x0593('0x11'),auth[_0x0593('0x9')](),controller[_0x0593('0x12')]);module[_0x0593('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ba4247a..4af05e8 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 _0x1d5f=['STRING','DATE','sequelize','exports'];(function(_0x310f6c,_0x23a242){var _0x46a515=function(_0x1484c6){while(--_0x1484c6){_0x310f6c['push'](_0x310f6c['shift']());}};_0x46a515(++_0x23a242);}(_0x1d5f,0x8a));var _0xf1d5=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0x1d5f[_0x1857c6];return _0x51011c;};'use strict';var moment=require('moment');var Sequelize=require(_0xf1d5('0x0'));module[_0xf1d5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf1d5('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf1d5('0x3')]},'acceptAt':{'type':Sequelize[_0xf1d5('0x3')]},'exitAt':{'type':Sequelize[_0xf1d5('0x3')]},'reason':{'type':Sequelize[_0xf1d5('0x2')]}}; \ No newline at end of file +var _0x289f=['DATE','moment','exports','STRING'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x289f,0x7d));var _0xf289=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x289f[_0x29d915];return _0x160f86;};'use strict';var moment=require(_0xf289('0x0'));var Sequelize=require('sequelize');module[_0xf289('0x1')]={'uniqueid':{'type':Sequelize[_0xf289('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf289('0x3')]},'leaveAt':{'type':Sequelize[_0xf289('0x3')]},'acceptAt':{'type':Sequelize[_0xf289('0x3')]},'exitAt':{'type':Sequelize[_0xf289('0x3')]},'reason':{'type':Sequelize[_0xf289('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 514f57f..75d5c49 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 _0xbff5=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','MailQueueReport','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x466b80,_0x49fb2b){var _0x3804bd=function(_0x2dbb11){while(--_0x2dbb11){_0x466b80['push'](_0x466b80['shift']());}};_0x3804bd(++_0x49fb2b);}(_0xbff5,0x1bc));var _0x5bff=function(_0x5975d3,_0x5c386b){_0x5975d3=_0x5975d3-0x0;var _0x2203ac=_0xbff5[_0x5975d3];return _0x2203ac;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){_0x352b1f['status'](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x17')](0x194);}return _0xcc091d;};}function handleError(_0x6f18f1,_0xfa361d){_0xfa361d=_0xfa361d||0x1f4;return function(_0x1140eb){logger[_0x5bff('0x26')](_0x1140eb[_0x5bff('0x27')]);if(_0x1140eb['name']){delete _0x1140eb['name'];}_0x6f18f1[_0x5bff('0x19')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=_[_0x5bff('0x29')](db[_0x5bff('0x2a')][_0x5bff('0x2b')],function(_0x48aee1){return{'name':_0x48aee1[_0x5bff('0x2c')],'type':_0x48aee1['type'][_0x5bff('0x2d')]};});_0x3eda3a['model']=_[_0x5bff('0x29')](_0x3ed23b,_0x5bff('0x2e'));_0x3eda3a[_0x5bff('0x2f')]=_[_0x5bff('0x30')](_0x36a7d2[_0x5bff('0x2f')]);_0x3eda3a[_0x5bff('0x31')]=_['intersection'](_0x3eda3a[_0x5bff('0x32')],_0x3eda3a[_0x5bff('0x2f')]);_0x5470cb[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x3eda3a[_0x5bff('0x32')],qs[_0x5bff('0x35')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x35')]));_0x5470cb['attributes']=_0x5470cb[_0x5bff('0x33')][_0x5bff('0x36')]?_0x5470cb[_0x5bff('0x33')]:_0x3eda3a[_0x5bff('0x32')];if(!_0x36a7d2['query'][_0x5bff('0x37')](_0x5bff('0x38'))){_0x5470cb['limit']=qs[_0x5bff('0x1c')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1c')]);_0x5470cb[_0x5bff('0x1b')]=qs['offset'](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1b')]);}_0x5470cb[_0x5bff('0x39')]=qs['sort'](_0x36a7d2[_0x5bff('0x2f')]['sort']);_0x5470cb[_0x5bff('0x3a')]=qs[_0x5bff('0x31')](_[_0x5bff('0x3b')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x31')]),_0x3ed23b);if(_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x3c')]){_0x5470cb['where']=_[_0x5bff('0x3d')](_0x5470cb[_0x5bff('0x3a')],{'$or':_['map'](_0x3ed23b,function(_0x265cdb){if(_0x265cdb[_0x5bff('0x3e')]!==_0x5bff('0x3f')){var _0x77a071={};_0x77a071[_0x265cdb[_0x5bff('0x2e')]]={'$like':'%'+_0x36a7d2['query'][_0x5bff('0x3c')]+'%'};return _0x77a071;}})});}_0x5470cb=_['merge']({},_0x5470cb,_0x36a7d2[_0x5bff('0x40')]);var _0x2fecb9={'where':_0x5470cb[_0x5bff('0x3a')]};return db[_0x5bff('0x2a')][_0x5bff('0x1e')](_0x2fecb9)[_0x5bff('0x24')](function(_0x1d0346){_0x5cf207['count']=_0x1d0346;if(_0x36a7d2['query'][_0x5bff('0x41')]){_0x5470cb[_0x5bff('0x42')]=[{'all':!![]}];}return db[_0x5bff('0x2a')][_0x5bff('0x43')](_0x5470cb);})[_0x5bff('0x24')](function(_0xb7b82a){_0x5cf207[_0x5bff('0x44')]=_0xb7b82a;return _0x5cf207;})[_0x5bff('0x24')](respondWithFilteredResult(_0x588078,_0x5470cb))['catch'](handleError(_0x588078,null));};exports[_0x5bff('0x45')]=function(_0x49676f,_0x3dc13f){var _0x1b8c7f={'raw':!![],'where':{'id':_0x49676f[_0x5bff('0x46')]['id']}},_0x543517={};_0x543517[_0x5bff('0x32')]=_['keys'](db[_0x5bff('0x2a')][_0x5bff('0x2b')]);_0x543517[_0x5bff('0x2f')]=_['keys'](_0x49676f[_0x5bff('0x2f')]);_0x543517[_0x5bff('0x31')]=_[_0x5bff('0x34')](_0x543517['model'],_0x543517[_0x5bff('0x2f')]);_0x1b8c7f[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x543517[_0x5bff('0x32')],qs['fields'](_0x49676f[_0x5bff('0x2f')]['fields']));_0x1b8c7f['attributes']=_0x1b8c7f[_0x5bff('0x33')][_0x5bff('0x36')]?_0x1b8c7f['attributes']:_0x543517[_0x5bff('0x32')];if(_0x49676f[_0x5bff('0x2f')]['includeAll']){_0x1b8c7f[_0x5bff('0x42')]=[{'all':!![]}];}_0x1b8c7f=_[_0x5bff('0x3d')]({},_0x1b8c7f,_0x49676f[_0x5bff('0x40')]);return db[_0x5bff('0x2a')]['find'](_0x1b8c7f)[_0x5bff('0x24')](handleEntityNotFound(_0x3dc13f,null))[_0x5bff('0x24')](respondWithResult(_0x3dc13f,null))[_0x5bff('0x47')](handleError(_0x3dc13f,null));};exports[_0x5bff('0x48')]=function(_0x1e94c5,_0x2588b8){return db['MailQueueReport'][_0x5bff('0x48')](_0x1e94c5[_0x5bff('0x49')],{})['then'](respondWithResult(_0x2588b8,0xc9))[_0x5bff('0x47')](handleError(_0x2588b8,null));};exports['update']=function(_0x47fc14,_0x4ff13a){if(_0x47fc14[_0x5bff('0x49')]['id']){delete _0x47fc14[_0x5bff('0x49')]['id'];}return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x47fc14[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x4ff13a,null))[_0x5bff('0x24')](saveUpdates(_0x47fc14[_0x5bff('0x49')],null))['then'](respondWithResult(_0x4ff13a,null))[_0x5bff('0x47')](handleError(_0x4ff13a,null));};exports[_0x5bff('0x25')]=function(_0x5e99f5,_0x16c61e){return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x5e99f5[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x16c61e,null))[_0x5bff('0x24')](removeEntity(_0x16c61e,null))[_0x5bff('0x47')](handleError(_0x16c61e,null));};exports['describe']=function(_0x36089e,_0x18018e){return db['MailQueueReport'][_0x5bff('0x4b')]()[_0x5bff('0x24')](respondWithResult(_0x18018e,null))['catch'](handleError(_0x18018e,null));}; \ No newline at end of file +var _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','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'];(function(_0x22157e,_0x7c5edd){var _0x26eb78=function(_0x20db6c){while(--_0x20db6c){_0x22157e['push'](_0x22157e['shift']());}};_0x26eb78(++_0x7c5edd);}(_0x524e,0x15e));var _0xe524=function(_0x2edee3,_0x26f9b4){_0x2edee3=_0x2edee3-0x0;var _0x2797dd=_0x524e[_0x2edee3];return _0x2797dd;};'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'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['MailQueueReport'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['MailQueueReport'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['MailQueueReport'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c4a2b94..6c6387d 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 _0x50a3=['bluebird','request-promise','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','api','moment'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x50a3,0x1d6));var _0x350a=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x50a3[_0x420d8d];return _0x4865d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x350a('0x0'));var moment=require(_0x350a('0x1'));var BPromise=require(_0x350a('0x2'));var rp=require(_0x350a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x350a('0x4'));var attributes=require(_0x350a('0x5'));module['exports']=function(_0x407d14,_0x4e3c36){return _0x407d14[_0x350a('0x6')](_0x350a('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa9f=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue'];(function(_0x303864,_0x1a0eaf){var _0x250c15=function(_0x362a9a){while(--_0x362a9a){_0x303864['push'](_0x303864['shift']());}};_0x250c15(++_0x1a0eaf);}(_0xfa9f,0xde));var _0xffa9=function(_0x6cf3b6,_0x4b7560){_0x6cf3b6=_0x6cf3b6-0x0;var _0xdbe948=_0xfa9f[_0x6cf3b6];return _0xdbe948;};'use strict';var _=require(_0xffa9('0x0'));var util=require(_0xffa9('0x1'));var logger=require(_0xffa9('0x2'))(_0xffa9('0x3'));var moment=require(_0xffa9('0x4'));var BPromise=require(_0xffa9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffa9('0x6'));var rimraf=require(_0xffa9('0x7'));var config=require('../../config/environment');var attributes=require(_0xffa9('0x8'));module[_0xffa9('0x9')]=function(_0x386932,_0x17b1d0){return _0x386932['define'](_0xffa9('0xa'),attributes,{'tableName':_0xffa9('0xb'),'paranoid':![],'indexes':[{'name':_0xffa9('0xc'),'fields':[_0xffa9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index d90c2a7..b9a05e1 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4b2ce3,_0x2c895c){var _0x330bd5=function(_0x42a880){while(--_0x42a880){_0x4b2ce3['push'](_0x4b2ce3['shift']());}};_0x330bd5(++_0x2c895c);}(_0x326f,0xd1));var _0xf326=function(_0x2c96fd,_0x5490d6){_0x2c96fd=_0x2c96fd-0x0;var _0x16ad0c=_0x326f[_0x2c96fd];return _0x16ad0c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x41e699,_0x353d4f){var _0x5d4429=function(_0x15a78b){while(--_0x15a78b){_0x41e699['push'](_0x41e699['shift']());}};_0x5d4429(++_0x353d4f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x12d329,_0x11e76f){_0x12d329=_0x12d329-0x0;var _0x193e7a=_0x5f2f[_0x12d329];return _0x193e7a;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 4e2cfec..e82d977 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5d60cf,_0x13bdd4){var _0x1101e7=function(_0x3c1236){while(--_0x3c1236){_0x5d60cf['push'](_0x5d60cf['shift']());}};_0x1101e7(++_0x13bdd4);}(_0x70e0,0x17b));var _0x070e=function(_0x4f8425,_0x2d8eec){_0x4f8425=_0x4f8425-0x0;var _0xb21e3e=_0x70e0[_0x4f8425];return _0xb21e3e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3f6333,_0x22aa90){var _0x493111=function(_0x189b60){while(--_0x189b60){_0x3f6333['push'](_0x3f6333['shift']());}};_0x493111(++_0x22aa90);}(_0xe706,0xa3));var _0x6e70=function(_0x4279e1,_0x39cda4){_0x4279e1=_0x4279e1-0x0;var _0x1e33ea=_0xe706[_0x4279e1];return _0x1e33ea;};'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 3474644..e0f8288 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 _0xa829=['STRING','BOOLEAN','INTEGER','INBOX','exports'];(function(_0x2cbbc8,_0x144465){var _0x46390a=function(_0x10df66){while(--_0x10df66){_0x2cbbc8['push'](_0x2cbbc8['shift']());}};_0x46390a(++_0x144465);}(_0xa829,0x13a));var _0x9a82=function(_0x40f561,_0x59f99b){_0x40f561=_0x40f561-0x0;var _0x198812=_0xa829[_0x40f561];return _0x198812;};'use strict';var Sequelize=require('sequelize');module[_0x9a82('0x0')]={'description':{'type':Sequelize[_0x9a82('0x1')]},'host':{'type':Sequelize[_0x9a82('0x1')]},'authentication':{'type':Sequelize[_0x9a82('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9a82('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9a82('0x1')],'defaultValue':_0x9a82('0x4')},'connTimeout':{'type':Sequelize[_0x9a82('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9a82('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x9a82('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbb19=['STRING','INTEGER','BOOLEAN','INBOX'];(function(_0x27b542,_0x1107db){var _0x59207e=function(_0x339b6a){while(--_0x339b6a){_0x27b542['push'](_0x27b542['shift']());}};_0x59207e(++_0x1107db);}(_0xbb19,0xf4));var _0x9bb1=function(_0x168563,_0x29c63a){_0x168563=_0x168563-0x0;var _0x4617b4=_0xbb19[_0x168563];return _0x4617b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9bb1('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x9bb1('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9bb1('0x1')]},'tls':{'type':Sequelize[_0x9bb1('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x9bb1('0x3')},'connTimeout':{'type':Sequelize[_0x9bb1('0x1')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9bb1('0x1')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9bb1('0x0')]},'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 321991f..27d6cc3 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 _0x1cf0=['MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0xa2a9c7,_0x5f35e1){var _0x4aa279=function(_0x519fe3){while(--_0x519fe3){_0xa2a9c7['push'](_0xa2a9c7['shift']());}};_0x4aa279(++_0x5f35e1);}(_0x1cf0,0x147));var _0x01cf=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x1cf0[_0x31a938];return _0x1bf341;};'use strict';var _=require(_0x01cf('0x0'));var util=require('util');var logger=require(_0x01cf('0x1'))(_0x01cf('0x2'));var moment=require(_0x01cf('0x3'));var BPromise=require('bluebird');var rp=require(_0x01cf('0x4'));var fs=require('fs');var path=require(_0x01cf('0x5'));var rimraf=require(_0x01cf('0x6'));var config=require(_0x01cf('0x7'));var attributes=require(_0x01cf('0x8'));module[_0x01cf('0x9')]=function(_0x263a1d,_0x2faa7b){return _0x263a1d[_0x01cf('0xa')](_0x01cf('0xb'),attributes,{'tableName':_0x01cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea39=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x434e06,_0x33d878){var _0x4bdb6e=function(_0x11c96a){while(--_0x11c96a){_0x434e06['push'](_0x434e06['shift']());}};_0x4bdb6e(++_0x33d878);}(_0xea39,0x19a));var _0x9ea3=function(_0x1ab0b0,_0x221c2f){_0x1ab0b0=_0x1ab0b0-0x0;var _0x22ba7f=_0xea39[_0x1ab0b0];return _0x22ba7f;};'use strict';var _=require(_0x9ea3('0x0'));var util=require(_0x9ea3('0x1'));var logger=require(_0x9ea3('0x2'))(_0x9ea3('0x3'));var moment=require(_0x9ea3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ea3('0x5'));var rimraf=require('rimraf');var config=require(_0x9ea3('0x6'));var attributes=require(_0x9ea3('0x7'));module[_0x9ea3('0x8')]=function(_0x2fe2e0,_0x18e552){return _0x2fe2e0[_0x9ea3('0x9')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index b06fc2f..69d764b 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 _0x252f=['lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','findAll','raw','options','where','attributes','include','map','model','GetMailServerIn'];(function(_0x3fd6bf,_0x5db114){var _0x2b179e=function(_0x5936b6){while(--_0x5936b6){_0x3fd6bf['push'](_0x3fd6bf['shift']());}};_0x2b179e(++_0x5db114);}(_0x252f,0xd0));var _0xf252=function(_0x343aa1,_0x443588){_0x343aa1=_0x343aa1-0x0;var _0x145484=_0x252f[_0x343aa1];return _0x145484;};'use strict';var _=require(_0xf252('0x0'));var util=require(_0xf252('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf252('0x2'));var fs=require('fs');var Redis=require(_0xf252('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf252('0x4'))(_0xf252('0x5'));var config=require(_0xf252('0x6'));var jayson=require(_0xf252('0x7'));var client=jayson[_0xf252('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fad52,_0x18282c,_0x271d94){return new BPromise(function(_0xc8ae97,_0x25e8af){return client['request'](_0x3fad52,_0x271d94)[_0xf252('0x9')](function(_0x352951){logger['info'](_0xf252('0xa'),_0x18282c,'request\x20sent');logger[_0xf252('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x18282c,_0xf252('0xc'),JSON[_0xf252('0xd')](_0x352951));if(_0x352951[_0xf252('0xe')]){if(_0x352951[_0xf252('0xe')]['code']===0x1f4){logger[_0xf252('0xe')](_0xf252('0xa'),_0x18282c,_0x352951[_0xf252('0xe')][_0xf252('0xf')]);return _0x25e8af(_0x352951[_0xf252('0xe')][_0xf252('0xf')]);}logger['error'](_0xf252('0xa'),_0x18282c,_0x352951[_0xf252('0xe')][_0xf252('0xf')]);return _0xc8ae97(_0x352951['error'][_0xf252('0xf')]);}else{logger[_0xf252('0x10')](_0xf252('0xa'),_0x18282c,_0xf252('0xc'));_0xc8ae97(_0x352951['result'][_0xf252('0xf')]);}})['catch'](function(_0x32a8e9){logger[_0xf252('0xe')](_0xf252('0xa'),_0x18282c,_0x32a8e9);_0x25e8af(_0x32a8e9);});});}exports['GetMailServerIn']=function(_0x4f6bd5){var _0x1d98dd=this;return new Promise(function(_0x34ce46,_0x2a8497){return db['MailServerIn'][_0xf252('0x11')]({'raw':_0x4f6bd5['options']?_0x4f6bd5['options'][_0xf252('0x12')]===undefined?!![]:![]:!![],'where':_0x4f6bd5[_0xf252('0x13')]?_0x4f6bd5[_0xf252('0x13')][_0xf252('0x14')]||null:null,'attributes':_0x4f6bd5['options']?_0x4f6bd5[_0xf252('0x13')][_0xf252('0x15')]||null:null,'limit':_0x4f6bd5[_0xf252('0x13')]?_0x4f6bd5[_0xf252('0x13')]['limit']||null:null,'include':_0x4f6bd5['options']?_0x4f6bd5[_0xf252('0x13')][_0xf252('0x16')]?_[_0xf252('0x17')](_0x4f6bd5['options'][_0xf252('0x16')],function(_0x2ba040){return{'model':db[_0x2ba040[_0xf252('0x18')]],'as':_0x2ba040['as'],'attributes':_0x2ba040['attributes'],'include':_0x2ba040[_0xf252('0x16')]?_[_0xf252('0x17')](_0x2ba040[_0xf252('0x16')],function(_0x36f8a5){return{'model':db[_0x36f8a5[_0xf252('0x18')]],'as':_0x36f8a5['as'],'attributes':_0x36f8a5[_0xf252('0x15')],'include':_0x36f8a5['include']?_[_0xf252('0x17')](_0x36f8a5[_0xf252('0x16')],function(_0x2c6073){return{'model':db[_0x2c6073[_0xf252('0x18')]],'as':_0x2c6073['as'],'attributes':_0x2c6073[_0xf252('0x15')]};}):[]};}):[]};}):[]:[]})[_0xf252('0x9')](function(_0x147111){logger[_0xf252('0x10')](_0xf252('0x19'),_0x4f6bd5);logger[_0xf252('0xb')]('GetMailServerIn',_0x4f6bd5,JSON[_0xf252('0xd')](_0x147111));_0x34ce46(_0x147111);})['catch'](function(_0x534c98){logger[_0xf252('0xe')](_0xf252('0x19'),_0x534c98['message'],_0x4f6bd5);_0x2a8497(_0x1d98dd['error'](0x1f4,_0x534c98['message']));});});}; \ No newline at end of file +var _0x9011=['client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','model','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2895ac,_0x5c9f61){var _0x5d8ab4=function(_0x1e38a9){while(--_0x1e38a9){_0x2895ac['push'](_0x2895ac['shift']());}};_0x5d8ab4(++_0x5c9f61);}(_0x9011,0x1f4));var _0x1901=function(_0x33cbfe,_0x1d046f){_0x33cbfe=_0x33cbfe-0x0;var _0x2af792=_0x9011[_0x33cbfe];return _0x2af792;};'use strict';var _=require('lodash');var util=require(_0x1901('0x0'));var moment=require(_0x1901('0x1'));var BPromise=require(_0x1901('0x2'));var rs=require(_0x1901('0x3'));var fs=require('fs');var Redis=require(_0x1901('0x4'));var db=require(_0x1901('0x5'))['db'];var utils=require(_0x1901('0x6'));var logger=require(_0x1901('0x7'))('rpc');var config=require(_0x1901('0x8'));var jayson=require(_0x1901('0x9'));var client=jayson[_0x1901('0xa')][_0x1901('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55260b,_0x30246e,_0x1baab6){return new BPromise(function(_0xa94186,_0x3f2260){return client['request'](_0x55260b,_0x1baab6)[_0x1901('0xc')](function(_0x51082d){logger[_0x1901('0xd')](_0x1901('0xe'),_0x30246e,_0x1901('0xf'));logger[_0x1901('0x10')](_0x1901('0x11'),_0x30246e,_0x1901('0xf'),JSON[_0x1901('0x12')](_0x51082d));if(_0x51082d[_0x1901('0x13')]){if(_0x51082d[_0x1901('0x13')][_0x1901('0x14')]===0x1f4){logger[_0x1901('0x13')](_0x1901('0xe'),_0x30246e,_0x51082d[_0x1901('0x13')][_0x1901('0x15')]);return _0x3f2260(_0x51082d[_0x1901('0x13')]['message']);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x30246e,_0x51082d[_0x1901('0x13')][_0x1901('0x15')]);return _0xa94186(_0x51082d[_0x1901('0x13')][_0x1901('0x15')]);}else{logger[_0x1901('0xd')](_0x1901('0xe'),_0x30246e,'request\x20sent');_0xa94186(_0x51082d[_0x1901('0x16')]['message']);}})[_0x1901('0x17')](function(_0xf5748a){logger[_0x1901('0x13')]('MailServerIn,\x20%s,\x20%s',_0x30246e,_0xf5748a);_0x3f2260(_0xf5748a);});});}exports[_0x1901('0x18')]=function(_0x13063b){var _0x18298c=this;return new Promise(function(_0x14402b,_0x31a2cf){return db[_0x1901('0x19')][_0x1901('0x1a')]({'raw':_0x13063b['options']?_0x13063b[_0x1901('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x13063b[_0x1901('0x1b')]?_0x13063b[_0x1901('0x1b')][_0x1901('0x1c')]||null:null,'attributes':_0x13063b[_0x1901('0x1b')]?_0x13063b['options'][_0x1901('0x1d')]||null:null,'limit':_0x13063b['options']?_0x13063b[_0x1901('0x1b')][_0x1901('0x1e')]||null:null,'include':_0x13063b[_0x1901('0x1b')]?_0x13063b['options'][_0x1901('0x1f')]?_['map'](_0x13063b[_0x1901('0x1b')][_0x1901('0x1f')],function(_0x4fc8db){return{'model':db[_0x4fc8db[_0x1901('0x20')]],'as':_0x4fc8db['as'],'attributes':_0x4fc8db[_0x1901('0x1d')],'include':_0x4fc8db[_0x1901('0x1f')]?_['map'](_0x4fc8db[_0x1901('0x1f')],function(_0x5ae246){return{'model':db[_0x5ae246[_0x1901('0x20')]],'as':_0x5ae246['as'],'attributes':_0x5ae246[_0x1901('0x1d')],'include':_0x5ae246['include']?_[_0x1901('0x21')](_0x5ae246[_0x1901('0x1f')],function(_0x38a88e){return{'model':db[_0x38a88e['model']],'as':_0x38a88e['as'],'attributes':_0x38a88e[_0x1901('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1901('0xc')](function(_0x1ed152){logger[_0x1901('0xd')](_0x1901('0x18'),_0x13063b);logger[_0x1901('0x10')](_0x1901('0x18'),_0x13063b,JSON[_0x1901('0x12')](_0x1ed152));_0x14402b(_0x1ed152);})[_0x1901('0x17')](function(_0x1dc165){logger[_0x1901('0x13')](_0x1901('0x18'),_0x1dc165[_0x1901('0x15')],_0x13063b);_0x31a2cf(_0x18298c[_0x1901('0x13')](0x1f4,_0x1dc165[_0x1901('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 3c143db..fb91c3a 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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x288f97,_0x5864df){_0x288f97=_0x288f97-0x0;var _0x5a085e=_0x7a54[_0x288f97];return _0x5a085e;};'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(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 453b6b4..25b76d0 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 _0x1be1=['STRING','INTEGER','BOOLEAN'];(function(_0x29f667,_0x2caf13){var _0x549a80=function(_0x29ee69){while(--_0x29ee69){_0x29f667['push'](_0x29f667['shift']());}};_0x549a80(++_0x2caf13);}(_0x1be1,0x192));var _0x11be=function(_0x5e8499,_0x3306ab){_0x5e8499=_0x5e8499-0x0;var _0x20984c=_0x1be1[_0x5e8499];return _0x20984c;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x11be('0x0')]},'host':{'type':Sequelize[_0x11be('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x11be('0x0')]},'port':{'type':Sequelize[_0x11be('0x1')]},'secure':{'type':Sequelize[_0x11be('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x11be('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x11be('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b20=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x59e843,_0x49b7ab){var _0xad5402=function(_0x12e7ee){while(--_0x12e7ee){_0x59e843['push'](_0x59e843['shift']());}};_0xad5402(++_0x49b7ab);}(_0x6b20,0xd1));var _0x06b2=function(_0x38c2d0,_0x50b93c){_0x38c2d0=_0x38c2d0-0x0;var _0x30490a=_0x6b20[_0x38c2d0];return _0x30490a;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x06b2('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x06b2('0x2')]},'port':{'type':Sequelize[_0x06b2('0x3')]},'secure':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x06b2('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 734509a..c7304e9 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 _0xbff6=['count','offset','limit','set','Content-Range','reject','then','destroy','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','order','sort','pick','filter','where','type','VIRTUAL','merge','rows','catch','keys','includeAll','include','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x5b2135,_0x2b550a){var _0x3c5237=function(_0x326c75){while(--_0x326c75){_0x5b2135['push'](_0x5b2135['shift']());}};_0x3c5237(++_0x2b550a);}(_0xbff6,0x145));var _0x6bff=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xbff6[_0x16771d];return _0x386f11;};'use strict';var emlformat=require(_0x6bff('0x0'));var rimraf=require(_0x6bff('0x1'));var zipdir=require(_0x6bff('0x2'));var jsonpatch=require(_0x6bff('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6bff('0x4'));var Mustache=require(_0x6bff('0x5'));var util=require('util');var path=require(_0x6bff('0x6'));var sox=require(_0x6bff('0x7'));var csv=require(_0x6bff('0x8'));var ejs=require(_0x6bff('0x9'));var fs=require('fs');var fs_extra=require(_0x6bff('0xa'));var _=require('lodash');var squel=require(_0x6bff('0xb'));var crypto=require(_0x6bff('0xc'));var jsforce=require(_0x6bff('0xd'));var deskjs=require(_0x6bff('0xe'));var toCsv=require(_0x6bff('0x8'));var querystring=require(_0x6bff('0xf'));var Papa=require(_0x6bff('0x10'));var Redis=require(_0x6bff('0x11'));var authService=require(_0x6bff('0x12'));var qs=require(_0x6bff('0x13'));var as=require(_0x6bff('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bff('0x15'))(_0x6bff('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6bff('0x17'));var db=require(_0x6bff('0x18'))['db'];function respondWithStatusCode(_0x2157d2,_0x80c901){_0x80c901=_0x80c901||0xcc;return function(_0x4354b2){if(_0x4354b2){return _0x2157d2[_0x6bff('0x19')](_0x80c901);}return _0x2157d2[_0x6bff('0x1a')](_0x80c901)[_0x6bff('0x1b')]();};}function respondWithResult(_0x28ca06,_0x1832f1){_0x1832f1=_0x1832f1||0xc8;return function(_0xb0a00){if(_0xb0a00){return _0x28ca06['status'](_0x1832f1)[_0x6bff('0x1c')](_0xb0a00);}};}function respondWithFilteredResult(_0x29dfa4,_0x2e4cd4){return function(_0x53eb74){if(_0x53eb74){var _0x4790a0=typeof _0x2e4cd4['offset']===_0x6bff('0x1d')&&typeof _0x2e4cd4['limit']===_0x6bff('0x1d');var _0x9f5a9f=_0x53eb74[_0x6bff('0x1e')];var _0x10f1c7=_0x4790a0?0x0:_0x2e4cd4[_0x6bff('0x1f')];var _0x4c0294=_0x4790a0?_0x53eb74[_0x6bff('0x1e')]:_0x2e4cd4[_0x6bff('0x1f')]+_0x2e4cd4[_0x6bff('0x20')];var _0x424c88;if(_0x4c0294>=_0x9f5a9f){_0x4c0294=_0x9f5a9f;_0x424c88=0xc8;}else{_0x424c88=0xce;}_0x29dfa4['status'](_0x424c88);return _0x29dfa4[_0x6bff('0x21')](_0x6bff('0x22'),_0x10f1c7+'-'+_0x4c0294+'/'+_0x9f5a9f)['json'](_0x53eb74);}return null;};}function patchUpdates(_0x45cdb8){return function(_0x2ba971){try{jsonpatch['apply'](_0x2ba971,_0x45cdb8,!![]);}catch(_0x198506){return BPromise[_0x6bff('0x23')](_0x198506);}return _0x2ba971['save']();};}function saveUpdates(_0x557868,_0x1efb48){return function(_0x445f41){if(_0x445f41){return _0x445f41['update'](_0x557868)[_0x6bff('0x24')](function(_0x3fcf29){return _0x3fcf29;});}return null;};}function removeEntity(_0x1019a8,_0xfcfed6){return function(_0x28aead){if(_0x28aead){return _0x28aead[_0x6bff('0x25')]()[_0x6bff('0x24')](function(){_0x1019a8['status'](0xcc)[_0x6bff('0x1b')]();});}};}function handleEntityNotFound(_0x539447,_0x392527){return function(_0x339ef6){if(!_0x339ef6){_0x539447[_0x6bff('0x19')](0x194);}return _0x339ef6;};}function handleError(_0x5e967b,_0x5b25b4){_0x5b25b4=_0x5b25b4||0x1f4;return function(_0x4b9ca3){logger[_0x6bff('0x26')](_0x4b9ca3['stack']);if(_0x4b9ca3['name']){delete _0x4b9ca3[_0x6bff('0x27')];}_0x5e967b[_0x6bff('0x1a')](_0x5b25b4)[_0x6bff('0x28')](_0x4b9ca3);};}exports[_0x6bff('0x29')]=function(_0x4d4b7e,_0x12f158){var _0x4c22c2={},_0x54e3a0={},_0x4cac5f={'count':0x0,'rows':[]};var _0x5e4063=_[_0x6bff('0x2a')](db[_0x6bff('0x2b')][_0x6bff('0x2c')],function(_0x3e3bbb){return{'name':_0x3e3bbb[_0x6bff('0x2d')],'type':_0x3e3bbb['type']['key']};});_0x54e3a0[_0x6bff('0x2e')]=_[_0x6bff('0x2a')](_0x5e4063,_0x6bff('0x27'));_0x54e3a0[_0x6bff('0x2f')]=_['keys'](_0x4d4b7e[_0x6bff('0x2f')]);_0x54e3a0[_0x6bff('0x30')]=_[_0x6bff('0x31')](_0x54e3a0[_0x6bff('0x2e')],_0x54e3a0[_0x6bff('0x2f')]);_0x4c22c2['attributes']=_[_0x6bff('0x31')](_0x54e3a0[_0x6bff('0x2e')],qs['fields'](_0x4d4b7e['query'][_0x6bff('0x32')]));_0x4c22c2[_0x6bff('0x33')]=_0x4c22c2['attributes'][_0x6bff('0x34')]?_0x4c22c2[_0x6bff('0x33')]:_0x54e3a0[_0x6bff('0x2e')];if(!_0x4d4b7e[_0x6bff('0x2f')]['hasOwnProperty']('nolimit')){_0x4c22c2[_0x6bff('0x20')]=qs[_0x6bff('0x20')](_0x4d4b7e[_0x6bff('0x2f')][_0x6bff('0x20')]);_0x4c22c2[_0x6bff('0x1f')]=qs['offset'](_0x4d4b7e['query'][_0x6bff('0x1f')]);}_0x4c22c2[_0x6bff('0x35')]=qs[_0x6bff('0x36')](_0x4d4b7e[_0x6bff('0x2f')][_0x6bff('0x36')]);_0x4c22c2['where']=qs['filters'](_[_0x6bff('0x37')](_0x4d4b7e[_0x6bff('0x2f')],_0x54e3a0[_0x6bff('0x30')]),_0x5e4063);if(_0x4d4b7e[_0x6bff('0x2f')][_0x6bff('0x38')]){_0x4c22c2['where']=_['merge'](_0x4c22c2[_0x6bff('0x39')],{'$or':_[_0x6bff('0x2a')](_0x5e4063,function(_0x17c791){if(_0x17c791[_0x6bff('0x3a')]!==_0x6bff('0x3b')){var _0x34592c={};_0x34592c[_0x17c791[_0x6bff('0x27')]]={'$like':'%'+_0x4d4b7e[_0x6bff('0x2f')][_0x6bff('0x38')]+'%'};return _0x34592c;}})});}_0x4c22c2=_[_0x6bff('0x3c')]({},_0x4c22c2,_0x4d4b7e['options']);var _0x540c8a={'where':_0x4c22c2[_0x6bff('0x39')]};return db[_0x6bff('0x2b')][_0x6bff('0x1e')](_0x540c8a)[_0x6bff('0x24')](function(_0x2d43c2){_0x4cac5f[_0x6bff('0x1e')]=_0x2d43c2;if(_0x4d4b7e['query']['includeAll']){_0x4c22c2['include']=[{'all':!![]}];}return db[_0x6bff('0x2b')]['findAll'](_0x4c22c2);})[_0x6bff('0x24')](function(_0x4c25ce){_0x4cac5f[_0x6bff('0x3d')]=_0x4c25ce;return _0x4cac5f;})[_0x6bff('0x24')](respondWithFilteredResult(_0x12f158,_0x4c22c2))[_0x6bff('0x3e')](handleError(_0x12f158,null));};exports['show']=function(_0x107c72,_0x277ced){var _0x511e6d={'raw':!![],'where':{'id':_0x107c72['params']['id']}},_0x4a7344={};_0x4a7344[_0x6bff('0x2e')]=_[_0x6bff('0x3f')](db[_0x6bff('0x2b')]['rawAttributes']);_0x4a7344[_0x6bff('0x2f')]=_[_0x6bff('0x3f')](_0x107c72[_0x6bff('0x2f')]);_0x4a7344[_0x6bff('0x30')]=_[_0x6bff('0x31')](_0x4a7344[_0x6bff('0x2e')],_0x4a7344[_0x6bff('0x2f')]);_0x511e6d[_0x6bff('0x33')]=_[_0x6bff('0x31')](_0x4a7344[_0x6bff('0x2e')],qs[_0x6bff('0x32')](_0x107c72[_0x6bff('0x2f')][_0x6bff('0x32')]));_0x511e6d[_0x6bff('0x33')]=_0x511e6d[_0x6bff('0x33')]['length']?_0x511e6d['attributes']:_0x4a7344[_0x6bff('0x2e')];if(_0x107c72['query'][_0x6bff('0x40')]){_0x511e6d[_0x6bff('0x41')]=[{'all':!![]}];}_0x511e6d=_[_0x6bff('0x3c')]({},_0x511e6d,_0x107c72[_0x6bff('0x42')]);return db[_0x6bff('0x2b')][_0x6bff('0x43')](_0x511e6d)[_0x6bff('0x24')](handleEntityNotFound(_0x277ced,null))[_0x6bff('0x24')](respondWithResult(_0x277ced,null))[_0x6bff('0x3e')](handleError(_0x277ced,null));};exports['create']=function(_0x172f41,_0x32d79c){return db[_0x6bff('0x2b')][_0x6bff('0x44')](_0x172f41[_0x6bff('0x45')],{})[_0x6bff('0x24')](respondWithResult(_0x32d79c,0xc9))[_0x6bff('0x3e')](handleError(_0x32d79c,null));};exports['update']=function(_0x3c31c5,_0x52af97){if(_0x3c31c5[_0x6bff('0x45')]['id']){delete _0x3c31c5[_0x6bff('0x45')]['id'];}return db[_0x6bff('0x2b')]['find']({'where':{'id':_0x3c31c5[_0x6bff('0x46')]['id']}})['then'](handleEntityNotFound(_0x52af97,null))['then'](saveUpdates(_0x3c31c5[_0x6bff('0x45')],null))['then'](respondWithResult(_0x52af97,null))[_0x6bff('0x3e')](handleError(_0x52af97,null));};exports[_0x6bff('0x25')]=function(_0x546dc5,_0x443b26){return db[_0x6bff('0x2b')][_0x6bff('0x43')]({'where':{'id':_0x546dc5[_0x6bff('0x46')]['id']}})[_0x6bff('0x24')](handleEntityNotFound(_0x443b26,null))[_0x6bff('0x24')](removeEntity(_0x443b26,null))[_0x6bff('0x3e')](handleError(_0x443b26,null));}; \ No newline at end of file +var _0xf07e=['sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','name','send','index','MailServerOut','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order'];(function(_0x9dca01,_0x1f41d7){var _0x59487a=function(_0x29079f){while(--_0x29079f){_0x9dca01['push'](_0x9dca01['shift']());}};_0x59487a(++_0x1f41d7);}(_0xf07e,0x185));var _0xef07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf07e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xef07('0x0'));var rimraf=require(_0xef07('0x1'));var zipdir=require(_0xef07('0x2'));var jsonpatch=require(_0xef07('0x3'));var rp=require(_0xef07('0x4'));var moment=require('moment');var BPromise=require(_0xef07('0x5'));var Mustache=require(_0xef07('0x6'));var util=require(_0xef07('0x7'));var path=require('path');var sox=require(_0xef07('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef07('0x9'));var _=require(_0xef07('0xa'));var squel=require(_0xef07('0xb'));var crypto=require(_0xef07('0xc'));var jsforce=require(_0xef07('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xef07('0xe'));var querystring=require('querystring');var Papa=require(_0xef07('0xf'));var Redis=require(_0xef07('0x10'));var authService=require(_0xef07('0x11'));var qs=require(_0xef07('0x12'));var as=require(_0xef07('0x13'));var hardwareService=require(_0xef07('0x14'));var logger=require(_0xef07('0x15'))(_0xef07('0x16'));var utils=require(_0xef07('0x17'));var config=require(_0xef07('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x882d4a,_0x450682){_0x450682=_0x450682||0xcc;return function(_0x539832){if(_0x539832){return _0x882d4a[_0xef07('0x19')](_0x450682);}return _0x882d4a[_0xef07('0x1a')](_0x450682)[_0xef07('0x1b')]();};}function respondWithResult(_0x2303cb,_0x5b2067){_0x5b2067=_0x5b2067||0xc8;return function(_0xba4715){if(_0xba4715){return _0x2303cb['status'](_0x5b2067)[_0xef07('0x1c')](_0xba4715);}};}function respondWithFilteredResult(_0x5d6c82,_0x50c1e7){return function(_0x32dae7){if(_0x32dae7){var _0x144892=typeof _0x50c1e7[_0xef07('0x1d')]===_0xef07('0x1e')&&typeof _0x50c1e7[_0xef07('0x1f')]===_0xef07('0x1e');var _0x40c5c1=_0x32dae7[_0xef07('0x20')];var _0x59cfee=_0x144892?0x0:_0x50c1e7[_0xef07('0x1d')];var _0x380468=_0x144892?_0x32dae7[_0xef07('0x20')]:_0x50c1e7[_0xef07('0x1d')]+_0x50c1e7[_0xef07('0x1f')];var _0x3ab47c;if(_0x380468>=_0x40c5c1){_0x380468=_0x40c5c1;_0x3ab47c=0xc8;}else{_0x3ab47c=0xce;}_0x5d6c82[_0xef07('0x1a')](_0x3ab47c);return _0x5d6c82['set']('Content-Range',_0x59cfee+'-'+_0x380468+'/'+_0x40c5c1)[_0xef07('0x1c')](_0x32dae7);}return null;};}function patchUpdates(_0x51417a){return function(_0x3db24a){try{jsonpatch[_0xef07('0x21')](_0x3db24a,_0x51417a,!![]);}catch(_0x213465){return BPromise[_0xef07('0x22')](_0x213465);}return _0x3db24a[_0xef07('0x23')]();};}function saveUpdates(_0x3353dd,_0x2f9a1c){return function(_0x32ceb6){if(_0x32ceb6){return _0x32ceb6['update'](_0x3353dd)[_0xef07('0x24')](function(_0x190bc9){return _0x190bc9;});}return null;};}function removeEntity(_0x3b9470,_0x2725e5){return function(_0x2455c3){if(_0x2455c3){return _0x2455c3[_0xef07('0x25')]()[_0xef07('0x24')](function(){_0x3b9470[_0xef07('0x1a')](0xcc)[_0xef07('0x1b')]();});}};}function handleEntityNotFound(_0x5e1137,_0xaa5c47){return function(_0x94adec){if(!_0x94adec){_0x5e1137['sendStatus'](0x194);}return _0x94adec;};}function handleError(_0x1f760e,_0x1561f0){_0x1561f0=_0x1561f0||0x1f4;return function(_0xd30e39){logger[_0xef07('0x26')](_0xd30e39['stack']);if(_0xd30e39['name']){delete _0xd30e39[_0xef07('0x27')];}_0x1f760e[_0xef07('0x1a')](_0x1561f0)[_0xef07('0x28')](_0xd30e39);};}exports[_0xef07('0x29')]=function(_0x2c5f9b,_0x58cb04){var _0x263d81={},_0x9c0a94={},_0x4e564b={'count':0x0,'rows':[]};var _0x4dd53e=_['map'](db[_0xef07('0x2a')]['rawAttributes'],function(_0x22e9d5){return{'name':_0x22e9d5[_0xef07('0x2b')],'type':_0x22e9d5['type'][_0xef07('0x2c')]};});_0x9c0a94[_0xef07('0x2d')]=_[_0xef07('0x2e')](_0x4dd53e,_0xef07('0x27'));_0x9c0a94[_0xef07('0x2f')]=_[_0xef07('0x30')](_0x2c5f9b[_0xef07('0x2f')]);_0x9c0a94[_0xef07('0x31')]=_[_0xef07('0x32')](_0x9c0a94[_0xef07('0x2d')],_0x9c0a94[_0xef07('0x2f')]);_0x263d81[_0xef07('0x33')]=_[_0xef07('0x32')](_0x9c0a94['model'],qs[_0xef07('0x34')](_0x2c5f9b['query'][_0xef07('0x34')]));_0x263d81[_0xef07('0x33')]=_0x263d81['attributes']['length']?_0x263d81[_0xef07('0x33')]:_0x9c0a94[_0xef07('0x2d')];if(!_0x2c5f9b[_0xef07('0x2f')]['hasOwnProperty'](_0xef07('0x35'))){_0x263d81['limit']=qs[_0xef07('0x1f')](_0x2c5f9b['query'][_0xef07('0x1f')]);_0x263d81[_0xef07('0x1d')]=qs[_0xef07('0x1d')](_0x2c5f9b['query'][_0xef07('0x1d')]);}_0x263d81[_0xef07('0x36')]=qs[_0xef07('0x37')](_0x2c5f9b['query'][_0xef07('0x37')]);_0x263d81['where']=qs[_0xef07('0x31')](_[_0xef07('0x38')](_0x2c5f9b['query'],_0x9c0a94[_0xef07('0x31')]),_0x4dd53e);if(_0x2c5f9b[_0xef07('0x2f')][_0xef07('0x39')]){_0x263d81[_0xef07('0x3a')]=_[_0xef07('0x3b')](_0x263d81['where'],{'$or':_[_0xef07('0x2e')](_0x4dd53e,function(_0x44dd6c){if(_0x44dd6c[_0xef07('0x3c')]!==_0xef07('0x3d')){var _0x2c3556={};_0x2c3556[_0x44dd6c[_0xef07('0x27')]]={'$like':'%'+_0x2c5f9b['query'][_0xef07('0x39')]+'%'};return _0x2c3556;}})});}_0x263d81=_[_0xef07('0x3b')]({},_0x263d81,_0x2c5f9b[_0xef07('0x3e')]);var _0x35e968={'where':_0x263d81[_0xef07('0x3a')]};return db[_0xef07('0x2a')][_0xef07('0x20')](_0x35e968)['then'](function(_0x2e9de2){_0x4e564b['count']=_0x2e9de2;if(_0x2c5f9b['query'][_0xef07('0x3f')]){_0x263d81[_0xef07('0x40')]=[{'all':!![]}];}return db[_0xef07('0x2a')][_0xef07('0x41')](_0x263d81);})[_0xef07('0x24')](function(_0x493fc1){_0x4e564b['rows']=_0x493fc1;return _0x4e564b;})[_0xef07('0x24')](respondWithFilteredResult(_0x58cb04,_0x263d81))[_0xef07('0x42')](handleError(_0x58cb04,null));};exports[_0xef07('0x43')]=function(_0x27a15d,_0x38c2e2){var _0x5b1ac9={'raw':!![],'where':{'id':_0x27a15d[_0xef07('0x44')]['id']}},_0x465a1e={};_0x465a1e[_0xef07('0x2d')]=_['keys'](db[_0xef07('0x2a')]['rawAttributes']);_0x465a1e[_0xef07('0x2f')]=_['keys'](_0x27a15d['query']);_0x465a1e[_0xef07('0x31')]=_['intersection'](_0x465a1e[_0xef07('0x2d')],_0x465a1e[_0xef07('0x2f')]);_0x5b1ac9['attributes']=_[_0xef07('0x32')](_0x465a1e[_0xef07('0x2d')],qs[_0xef07('0x34')](_0x27a15d[_0xef07('0x2f')][_0xef07('0x34')]));_0x5b1ac9[_0xef07('0x33')]=_0x5b1ac9['attributes'][_0xef07('0x45')]?_0x5b1ac9[_0xef07('0x33')]:_0x465a1e[_0xef07('0x2d')];if(_0x27a15d[_0xef07('0x2f')][_0xef07('0x3f')]){_0x5b1ac9[_0xef07('0x40')]=[{'all':!![]}];}_0x5b1ac9=_[_0xef07('0x3b')]({},_0x5b1ac9,_0x27a15d[_0xef07('0x3e')]);return db[_0xef07('0x2a')][_0xef07('0x46')](_0x5b1ac9)[_0xef07('0x24')](handleEntityNotFound(_0x38c2e2,null))[_0xef07('0x24')](respondWithResult(_0x38c2e2,null))[_0xef07('0x42')](handleError(_0x38c2e2,null));};exports[_0xef07('0x47')]=function(_0x55327a,_0x70ffb8){return db['MailServerOut'][_0xef07('0x47')](_0x55327a[_0xef07('0x48')],{})[_0xef07('0x24')](respondWithResult(_0x70ffb8,0xc9))[_0xef07('0x42')](handleError(_0x70ffb8,null));};exports[_0xef07('0x49')]=function(_0x435abf,_0x4c23ca){if(_0x435abf[_0xef07('0x48')]['id']){delete _0x435abf[_0xef07('0x48')]['id'];}return db[_0xef07('0x2a')][_0xef07('0x46')]({'where':{'id':_0x435abf[_0xef07('0x44')]['id']}})[_0xef07('0x24')](handleEntityNotFound(_0x4c23ca,null))['then'](saveUpdates(_0x435abf[_0xef07('0x48')],null))['then'](respondWithResult(_0x4c23ca,null))[_0xef07('0x42')](handleError(_0x4c23ca,null));};exports[_0xef07('0x25')]=function(_0x11d039,_0x2ab48e){return db['MailServerOut'][_0xef07('0x46')]({'where':{'id':_0x11d039[_0xef07('0x44')]['id']}})[_0xef07('0x24')](handleEntityNotFound(_0x2ab48e,null))[_0xef07('0x24')](removeEntity(_0x2ab48e,null))['catch'](handleError(_0x2ab48e,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 193b8a6..1f6491a 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 _0x7b4d=['exports','define','mail_servers_out','lodash','util','api','moment','bluebird','path','../../config/environment','./mailServerOut.attributes'];(function(_0x5b5b5f,_0x1d88f8){var _0x380741=function(_0x11ccc0){while(--_0x11ccc0){_0x5b5b5f['push'](_0x5b5b5f['shift']());}};_0x380741(++_0x1d88f8);}(_0x7b4d,0x92));var _0xd7b4=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x7b4d[_0x237546];return _0x233e29;};'use strict';var _=require(_0xd7b4('0x0'));var util=require(_0xd7b4('0x1'));var logger=require('../../config/logger')(_0xd7b4('0x2'));var moment=require(_0xd7b4('0x3'));var BPromise=require(_0xd7b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7b4('0x5'));var rimraf=require('rimraf');var config=require(_0xd7b4('0x6'));var attributes=require(_0xd7b4('0x7'));module[_0xd7b4('0x8')]=function(_0x1def14,_0x3dde7f){return _0x1def14[_0xd7b4('0x9')]('MailServerOut',attributes,{'tableName':_0xd7b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x949d=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x949d,0x168));var _0xd949=function(_0x51daf5,_0x53a7a6){_0x51daf5=_0x51daf5-0x0;var _0x4b5099=_0x949d[_0x51daf5];return _0x4b5099;};'use strict';var _=require(_0xd949('0x0'));var util=require(_0xd949('0x1'));var logger=require('../../config/logger')(_0xd949('0x2'));var moment=require('moment');var BPromise=require(_0xd949('0x3'));var rp=require(_0xd949('0x4'));var fs=require('fs');var path=require(_0xd949('0x5'));var rimraf=require(_0xd949('0x6'));var config=require(_0xd949('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xd949('0x8')]=function(_0x1ad70a,_0x566bbd){return _0x1ad70a[_0xd949('0x9')](_0xd949('0xa'),attributes,{'tableName':_0xd949('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 863b736..7e26186 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2e2d0a,_0x8e899b){var _0x3fcd14=function(_0x1de20d){while(--_0x1de20d){_0x2e2d0a['push'](_0x2e2d0a['shift']());}};_0x3fcd14(++_0x8e899b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37c2ad,_0x2faa18){_0x37c2ad=_0x37c2ad-0x0;var _0x4ab720=_0x5f2f[_0x37c2ad];return _0x4ab720;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ 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(_0x48a50a,_0x55deee){var _0x23d205=function(_0x19d577){while(--_0x19d577){_0x48a50a['push'](_0x48a50a['shift']());}};_0x23d205(++_0x55deee);}(_0xdb28,0x106));var _0x8db2=function(_0x38dfb7,_0x5be6ea){_0x38dfb7=_0x38dfb7-0x0;var _0x355751=_0xdb28[_0x38dfb7];return _0x355751;};'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 0c69192..3fea745 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 _0x2dd9=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','connect-timeout'];(function(_0x3eec45,_0x533bd0){var _0xa1a5a6=function(_0x17325a){while(--_0x17325a){_0x3eec45['push'](_0x3eec45['shift']());}};_0xa1a5a6(++_0x533bd0);}(_0x2dd9,0x131));var _0x92dd=function(_0x5b8a53,_0x8c5add){_0x5b8a53=_0x5b8a53-0x0;var _0x354857=_0x2dd9[_0x5b8a53];return _0x354857;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x92dd('0x0'));var express=require(_0x92dd('0x1'));var router=express[_0x92dd('0x2')]();var fs_extra=require(_0x92dd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x92dd('0x4'));var config=require(_0x92dd('0x5'));var controller=require('./mailSubstatus.controller');router[_0x92dd('0x6')]('/',auth[_0x92dd('0x7')](),controller[_0x92dd('0x8')]);router[_0x92dd('0x6')](_0x92dd('0x9'),auth[_0x92dd('0x7')](),controller['describe']);router['get'](_0x92dd('0xa'),auth[_0x92dd('0x7')](),controller[_0x92dd('0xb')]);router[_0x92dd('0xc')]('/',auth[_0x92dd('0x7')](),controller[_0x92dd('0xd')]);router[_0x92dd('0xe')]('/:id',auth[_0x92dd('0x7')](),controller[_0x92dd('0xf')]);router[_0x92dd('0x10')](_0x92dd('0xa'),auth[_0x92dd('0x7')](),controller['destroy']);module[_0x92dd('0x11')]=router; \ No newline at end of file +var _0xa16a=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa16a,0x66));var _0xaa16=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0xa16a[_0x482214];return _0x38d0cb;};'use strict';var multer=require(_0xaa16('0x0'));var util=require(_0xaa16('0x1'));var path=require(_0xaa16('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xaa16('0x3'));var auth=require(_0xaa16('0x4'));var interaction=require(_0xaa16('0x5'));var config=require(_0xaa16('0x6'));var controller=require('./mailSubstatus.controller');router[_0xaa16('0x7')]('/',auth[_0xaa16('0x8')](),controller[_0xaa16('0x9')]);router[_0xaa16('0x7')](_0xaa16('0xa'),auth[_0xaa16('0x8')](),controller[_0xaa16('0xb')]);router[_0xaa16('0x7')](_0xaa16('0xc'),auth[_0xaa16('0x8')](),controller[_0xaa16('0xd')]);router[_0xaa16('0xe')]('/',auth[_0xaa16('0x8')](),controller[_0xaa16('0xf')]);router[_0xaa16('0x10')](_0xaa16('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xaa16('0xc'),auth[_0xaa16('0x8')](),controller[_0xaa16('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index bed10d7..ea0de43 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 _0x8f9d=['STRING','sequelize'];(function(_0x34a14d,_0xc49d24){var _0x2015f2=function(_0x2a0b48){while(--_0x2a0b48){_0x34a14d['push'](_0x34a14d['shift']());}};_0x2015f2(++_0xc49d24);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xd8f9('0x0'));module['exports']={'name':{'type':Sequelize[_0xd8f9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd8f9('0x1')]}}; \ No newline at end of file +var _0x1261=['exports','STRING','name'];(function(_0x399f28,_0x51d58a){var _0x454f00=function(_0x298eff){while(--_0x298eff){_0x399f28['push'](_0x399f28['shift']());}};_0x454f00(++_0x51d58a);}(_0x1261,0x144));var _0x1126=function(_0x4216ba,_0x5739c5){_0x4216ba=_0x4216ba-0x0;var _0x2592ca=_0x1261[_0x4216ba];return _0x2592ca;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1126('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 2d38bfe..e6aa8dd 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 _0x141f=['set','Content-Range','json','apply','save','update','destroy','then','end','error','stack','name','send','MailSubstatus','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','rawAttributes','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count'];(function(_0x41f264,_0x230576){var _0x3d9e52=function(_0x3b12df){while(--_0x3b12df){_0x41f264['push'](_0x41f264['shift']());}};_0x3d9e52(++_0x230576);}(_0x141f,0x7b));var _0xf141=function(_0x1be143,_0x2f58ed){_0x1be143=_0x1be143-0x0;var _0xaa3f65=_0x141f[_0x1be143];return _0xaa3f65;};'use strict';var emlformat=require(_0xf141('0x0'));var rimraf=require(_0xf141('0x1'));var zipdir=require(_0xf141('0x2'));var jsonpatch=require(_0xf141('0x3'));var rp=require(_0xf141('0x4'));var moment=require(_0xf141('0x5'));var BPromise=require(_0xf141('0x6'));var Mustache=require(_0xf141('0x7'));var util=require(_0xf141('0x8'));var path=require(_0xf141('0x9'));var sox=require(_0xf141('0xa'));var csv=require('to-csv');var ejs=require(_0xf141('0xb'));var fs=require('fs');var fs_extra=require(_0xf141('0xc'));var _=require(_0xf141('0xd'));var squel=require('squel');var crypto=require(_0xf141('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf141('0xf'));var toCsv=require(_0xf141('0x10'));var querystring=require('querystring');var Papa=require(_0xf141('0x11'));var Redis=require(_0xf141('0x12'));var authService=require(_0xf141('0x13'));var qs=require(_0xf141('0x14'));var as=require(_0xf141('0x15'));var hardwareService=require(_0xf141('0x16'));var logger=require(_0xf141('0x17'))(_0xf141('0x18'));var utils=require(_0xf141('0x19'));var config=require(_0xf141('0x1a'));var licenseUtil=require(_0xf141('0x1b'));var db=require(_0xf141('0x1c'))['db'];function respondWithStatusCode(_0x4d2fde,_0x29761e){_0x29761e=_0x29761e||0xcc;return function(_0x225f60){if(_0x225f60){return _0x4d2fde[_0xf141('0x1d')](_0x29761e);}return _0x4d2fde['status'](_0x29761e)['end']();};}function respondWithResult(_0x178a14,_0x3316ad){_0x3316ad=_0x3316ad||0xc8;return function(_0x576ded){if(_0x576ded){return _0x178a14[_0xf141('0x1e')](_0x3316ad)['json'](_0x576ded);}};}function respondWithFilteredResult(_0x20d205,_0x2ef30f){return function(_0x24f56c){if(_0x24f56c){var _0x517e05=typeof _0x2ef30f[_0xf141('0x1f')]===_0xf141('0x20')&&typeof _0x2ef30f[_0xf141('0x21')]===_0xf141('0x20');var _0x17134d=_0x24f56c[_0xf141('0x22')];var _0xc2c382=_0x517e05?0x0:_0x2ef30f[_0xf141('0x1f')];var _0xc768b0=_0x517e05?_0x24f56c['count']:_0x2ef30f[_0xf141('0x1f')]+_0x2ef30f[_0xf141('0x21')];var _0x2a7238;if(_0xc768b0>=_0x17134d){_0xc768b0=_0x17134d;_0x2a7238=0xc8;}else{_0x2a7238=0xce;}_0x20d205[_0xf141('0x1e')](_0x2a7238);return _0x20d205[_0xf141('0x23')](_0xf141('0x24'),_0xc2c382+'-'+_0xc768b0+'/'+_0x17134d)[_0xf141('0x25')](_0x24f56c);}return null;};}function patchUpdates(_0xcd3197){return function(_0x59f3a8){try{jsonpatch[_0xf141('0x26')](_0x59f3a8,_0xcd3197,!![]);}catch(_0x1b5096){return BPromise['reject'](_0x1b5096);}return _0x59f3a8[_0xf141('0x27')]();};}function saveUpdates(_0x52747d,_0x520a19){return function(_0x3b781d){if(_0x3b781d){return _0x3b781d[_0xf141('0x28')](_0x52747d)['then'](function(_0x431697){return _0x431697;});}return null;};}function removeEntity(_0xe44f79,_0x4b31de){return function(_0x3f76db){if(_0x3f76db){return _0x3f76db[_0xf141('0x29')]()[_0xf141('0x2a')](function(){_0xe44f79['status'](0xcc)[_0xf141('0x2b')]();});}};}function handleEntityNotFound(_0x12d5c7,_0x50e8b2){return function(_0x3a7447){if(!_0x3a7447){_0x12d5c7[_0xf141('0x1d')](0x194);}return _0x3a7447;};}function handleError(_0x2debd8,_0x5e0eb7){_0x5e0eb7=_0x5e0eb7||0x1f4;return function(_0x5b1360){logger[_0xf141('0x2c')](_0x5b1360[_0xf141('0x2d')]);if(_0x5b1360['name']){delete _0x5b1360[_0xf141('0x2e')];}_0x2debd8['status'](_0x5e0eb7)[_0xf141('0x2f')](_0x5b1360);};}exports['index']=function(_0x8e60ab,_0x554fce){var _0x5e5294={},_0x42eb3e={},_0x23239f={'count':0x0,'rows':[]};var _0xf99cc3=_['map'](db[_0xf141('0x30')]['rawAttributes'],function(_0x285d41){return{'name':_0x285d41[_0xf141('0x31')],'type':_0x285d41[_0xf141('0x32')][_0xf141('0x33')]};});_0x42eb3e[_0xf141('0x34')]=_[_0xf141('0x35')](_0xf99cc3,_0xf141('0x2e'));_0x42eb3e[_0xf141('0x36')]=_['keys'](_0x8e60ab[_0xf141('0x36')]);_0x42eb3e[_0xf141('0x37')]=_[_0xf141('0x38')](_0x42eb3e['model'],_0x42eb3e[_0xf141('0x36')]);_0x5e5294[_0xf141('0x39')]=_[_0xf141('0x38')](_0x42eb3e[_0xf141('0x34')],qs[_0xf141('0x3a')](_0x8e60ab[_0xf141('0x36')][_0xf141('0x3a')]));_0x5e5294[_0xf141('0x39')]=_0x5e5294[_0xf141('0x39')]['length']?_0x5e5294['attributes']:_0x42eb3e['model'];if(!_0x8e60ab[_0xf141('0x36')]['hasOwnProperty']('nolimit')){_0x5e5294['limit']=qs['limit'](_0x8e60ab[_0xf141('0x36')]['limit']);_0x5e5294[_0xf141('0x1f')]=qs['offset'](_0x8e60ab[_0xf141('0x36')][_0xf141('0x1f')]);}_0x5e5294[_0xf141('0x3b')]=qs[_0xf141('0x3c')](_0x8e60ab['query'][_0xf141('0x3c')]);_0x5e5294[_0xf141('0x3d')]=qs[_0xf141('0x37')](_['pick'](_0x8e60ab['query'],_0x42eb3e[_0xf141('0x37')]),_0xf99cc3);if(_0x8e60ab['query'][_0xf141('0x3e')]){_0x5e5294['where']=_[_0xf141('0x3f')](_0x5e5294['where'],{'$or':_[_0xf141('0x35')](_0xf99cc3,function(_0x7e7a39){if(_0x7e7a39[_0xf141('0x32')]!==_0xf141('0x40')){var _0x282e6f={};_0x282e6f[_0x7e7a39['name']]={'$like':'%'+_0x8e60ab[_0xf141('0x36')][_0xf141('0x3e')]+'%'};return _0x282e6f;}})});}_0x5e5294=_[_0xf141('0x3f')]({},_0x5e5294,_0x8e60ab['options']);var _0x179726={'where':_0x5e5294[_0xf141('0x3d')]};return db[_0xf141('0x30')][_0xf141('0x22')](_0x179726)[_0xf141('0x2a')](function(_0x1a0054){_0x23239f[_0xf141('0x22')]=_0x1a0054;if(_0x8e60ab[_0xf141('0x36')][_0xf141('0x41')]){_0x5e5294[_0xf141('0x42')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x5e5294);})[_0xf141('0x2a')](function(_0x1ced0c){_0x23239f[_0xf141('0x43')]=_0x1ced0c;return _0x23239f;})[_0xf141('0x2a')](respondWithFilteredResult(_0x554fce,_0x5e5294))[_0xf141('0x44')](handleError(_0x554fce,null));};exports[_0xf141('0x45')]=function(_0x2d9a6a,_0x5c7e6a){var _0x38832b={'raw':!![],'where':{'id':_0x2d9a6a['params']['id']}},_0x2a04c3={};_0x2a04c3[_0xf141('0x34')]=_['keys'](db[_0xf141('0x30')][_0xf141('0x46')]);_0x2a04c3[_0xf141('0x36')]=_[_0xf141('0x47')](_0x2d9a6a[_0xf141('0x36')]);_0x2a04c3[_0xf141('0x37')]=_[_0xf141('0x38')](_0x2a04c3[_0xf141('0x34')],_0x2a04c3[_0xf141('0x36')]);_0x38832b[_0xf141('0x39')]=_['intersection'](_0x2a04c3[_0xf141('0x34')],qs[_0xf141('0x3a')](_0x2d9a6a[_0xf141('0x36')][_0xf141('0x3a')]));_0x38832b['attributes']=_0x38832b[_0xf141('0x39')][_0xf141('0x48')]?_0x38832b[_0xf141('0x39')]:_0x2a04c3['model'];if(_0x2d9a6a[_0xf141('0x36')][_0xf141('0x41')]){_0x38832b['include']=[{'all':!![]}];}_0x38832b=_['merge']({},_0x38832b,_0x2d9a6a[_0xf141('0x49')]);return db[_0xf141('0x30')][_0xf141('0x4a')](_0x38832b)[_0xf141('0x2a')](handleEntityNotFound(_0x5c7e6a,null))['then'](respondWithResult(_0x5c7e6a,null))[_0xf141('0x44')](handleError(_0x5c7e6a,null));};exports[_0xf141('0x4b')]=function(_0x235066,_0xba47ad){return db[_0xf141('0x30')][_0xf141('0x4b')](_0x235066['body'],{})[_0xf141('0x2a')](respondWithResult(_0xba47ad,0xc9))[_0xf141('0x44')](handleError(_0xba47ad,null));};exports[_0xf141('0x28')]=function(_0x55ce2f,_0x2bc01a){if(_0x55ce2f[_0xf141('0x4c')]['id']){delete _0x55ce2f[_0xf141('0x4c')]['id'];}return db[_0xf141('0x30')]['find']({'where':{'id':_0x55ce2f[_0xf141('0x4d')]['id']}})[_0xf141('0x2a')](handleEntityNotFound(_0x2bc01a,null))[_0xf141('0x2a')](saveUpdates(_0x55ce2f[_0xf141('0x4c')],null))[_0xf141('0x2a')](respondWithResult(_0x2bc01a,null))[_0xf141('0x44')](handleError(_0x2bc01a,null));};exports[_0xf141('0x29')]=function(_0x82d54,_0x1e8578){return db[_0xf141('0x30')][_0xf141('0x4a')]({'where':{'id':_0x82d54[_0xf141('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1e8578,null))[_0xf141('0x2a')](removeEntity(_0x1e8578,null))[_0xf141('0x44')](handleError(_0x1e8578,null));};exports[_0xf141('0x4e')]=function(_0x139db2,_0x510dc9){return db[_0xf141('0x30')][_0xf141('0x4e')]()[_0xf141('0x2a')](respondWithResult(_0x510dc9,null))['catch'](handleError(_0x510dc9,null));}; \ No newline at end of file +var _0xcda0=['filter','where','VIRTUAL','merge','include','MailSubstatus','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','status','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x56b430,_0x121813){var _0x2e3e70=function(_0x80619e){while(--_0x80619e){_0x56b430['push'](_0x56b430['shift']());}};_0x2e3e70(++_0x121813);}(_0xcda0,0x101));var _0x0cda=function(_0x126b62,_0x5a17b5){_0x126b62=_0x126b62-0x0;var _0x32c1ab=_0xcda0[_0x126b62];return _0x32c1ab;};'use strict';var emlformat=require(_0x0cda('0x0'));var rimraf=require(_0x0cda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cda('0x2'));var rp=require(_0x0cda('0x3'));var moment=require('moment');var BPromise=require(_0x0cda('0x4'));var Mustache=require('mustache');var util=require(_0x0cda('0x5'));var path=require(_0x0cda('0x6'));var sox=require(_0x0cda('0x7'));var csv=require(_0x0cda('0x8'));var ejs=require(_0x0cda('0x9'));var fs=require('fs');var fs_extra=require(_0x0cda('0xa'));var _=require(_0x0cda('0xb'));var squel=require(_0x0cda('0xc'));var crypto=require(_0x0cda('0xd'));var jsforce=require(_0x0cda('0xe'));var deskjs=require(_0x0cda('0xf'));var toCsv=require(_0x0cda('0x8'));var querystring=require(_0x0cda('0x10'));var Papa=require('papaparse');var Redis=require(_0x0cda('0x11'));var authService=require(_0x0cda('0x12'));var qs=require(_0x0cda('0x13'));var as=require(_0x0cda('0x14'));var hardwareService=require(_0x0cda('0x15'));var logger=require(_0x0cda('0x16'))(_0x0cda('0x17'));var utils=require(_0x0cda('0x18'));var config=require(_0x0cda('0x19'));var licenseUtil=require(_0x0cda('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3551ad,_0x8dfdc){_0x8dfdc=_0x8dfdc||0xcc;return function(_0x718df6){if(_0x718df6){return _0x3551ad[_0x0cda('0x1b')](_0x8dfdc);}return _0x3551ad['status'](_0x8dfdc)['end']();};}function respondWithResult(_0x3948da,_0x43989d){_0x43989d=_0x43989d||0xc8;return function(_0x1a9082){if(_0x1a9082){return _0x3948da['status'](_0x43989d)[_0x0cda('0x1c')](_0x1a9082);}};}function respondWithFilteredResult(_0x25645b,_0xd2e034){return function(_0x160613){if(_0x160613){var _0x57f0a9=typeof _0xd2e034['offset']===_0x0cda('0x1d')&&typeof _0xd2e034[_0x0cda('0x1e')]===_0x0cda('0x1d');var _0x3839de=_0x160613[_0x0cda('0x1f')];var _0x4d87f0=_0x57f0a9?0x0:_0xd2e034[_0x0cda('0x20')];var _0x14e216=_0x57f0a9?_0x160613['count']:_0xd2e034[_0x0cda('0x20')]+_0xd2e034[_0x0cda('0x1e')];var _0x17f364;if(_0x14e216>=_0x3839de){_0x14e216=_0x3839de;_0x17f364=0xc8;}else{_0x17f364=0xce;}_0x25645b['status'](_0x17f364);return _0x25645b['set'](_0x0cda('0x21'),_0x4d87f0+'-'+_0x14e216+'/'+_0x3839de)[_0x0cda('0x1c')](_0x160613);}return null;};}function patchUpdates(_0x11ad1c){return function(_0x324400){try{jsonpatch[_0x0cda('0x22')](_0x324400,_0x11ad1c,!![]);}catch(_0x291c96){return BPromise[_0x0cda('0x23')](_0x291c96);}return _0x324400[_0x0cda('0x24')]();};}function saveUpdates(_0x1e5ad9,_0x12081d){return function(_0x1b332c){if(_0x1b332c){return _0x1b332c[_0x0cda('0x25')](_0x1e5ad9)[_0x0cda('0x26')](function(_0x405b1f){return _0x405b1f;});}return null;};}function removeEntity(_0x1bd8be,_0x41cfe2){return function(_0x56c0de){if(_0x56c0de){return _0x56c0de[_0x0cda('0x27')]()[_0x0cda('0x26')](function(){_0x1bd8be[_0x0cda('0x28')](0xcc)[_0x0cda('0x29')]();});}};}function handleEntityNotFound(_0x559092,_0x484e4c){return function(_0x522088){if(!_0x522088){_0x559092['sendStatus'](0x194);}return _0x522088;};}function handleError(_0x5b52d9,_0x111a93){_0x111a93=_0x111a93||0x1f4;return function(_0x4a1e33){logger[_0x0cda('0x2a')](_0x4a1e33['stack']);if(_0x4a1e33[_0x0cda('0x2b')]){delete _0x4a1e33['name'];}_0x5b52d9['status'](_0x111a93)[_0x0cda('0x2c')](_0x4a1e33);};}exports[_0x0cda('0x2d')]=function(_0x5274ab,_0x375e9a){var _0x252a61={},_0x167ef0={},_0x3bf2ec={'count':0x0,'rows':[]};var _0x36e339=_[_0x0cda('0x2e')](db['MailSubstatus'][_0x0cda('0x2f')],function(_0x5c4f8c){return{'name':_0x5c4f8c[_0x0cda('0x30')],'type':_0x5c4f8c[_0x0cda('0x31')][_0x0cda('0x32')]};});_0x167ef0[_0x0cda('0x33')]=_['map'](_0x36e339,_0x0cda('0x2b'));_0x167ef0[_0x0cda('0x34')]=_[_0x0cda('0x35')](_0x5274ab[_0x0cda('0x34')]);_0x167ef0[_0x0cda('0x36')]=_[_0x0cda('0x37')](_0x167ef0['model'],_0x167ef0['query']);_0x252a61[_0x0cda('0x38')]=_['intersection'](_0x167ef0[_0x0cda('0x33')],qs[_0x0cda('0x39')](_0x5274ab['query'][_0x0cda('0x39')]));_0x252a61[_0x0cda('0x38')]=_0x252a61['attributes'][_0x0cda('0x3a')]?_0x252a61[_0x0cda('0x38')]:_0x167ef0[_0x0cda('0x33')];if(!_0x5274ab['query'][_0x0cda('0x3b')](_0x0cda('0x3c'))){_0x252a61['limit']=qs[_0x0cda('0x1e')](_0x5274ab[_0x0cda('0x34')][_0x0cda('0x1e')]);_0x252a61[_0x0cda('0x20')]=qs[_0x0cda('0x20')](_0x5274ab[_0x0cda('0x34')][_0x0cda('0x20')]);}_0x252a61['order']=qs[_0x0cda('0x3d')](_0x5274ab[_0x0cda('0x34')][_0x0cda('0x3d')]);_0x252a61['where']=qs[_0x0cda('0x36')](_[_0x0cda('0x3e')](_0x5274ab[_0x0cda('0x34')],_0x167ef0['filters']),_0x36e339);if(_0x5274ab[_0x0cda('0x34')][_0x0cda('0x3f')]){_0x252a61[_0x0cda('0x40')]=_['merge'](_0x252a61['where'],{'$or':_['map'](_0x36e339,function(_0x2f8ea9){if(_0x2f8ea9['type']!==_0x0cda('0x41')){var _0x31a21b={};_0x31a21b[_0x2f8ea9[_0x0cda('0x2b')]]={'$like':'%'+_0x5274ab[_0x0cda('0x34')]['filter']+'%'};return _0x31a21b;}})});}_0x252a61=_[_0x0cda('0x42')]({},_0x252a61,_0x5274ab['options']);var _0x127f2b={'where':_0x252a61[_0x0cda('0x40')]};return db['MailSubstatus'][_0x0cda('0x1f')](_0x127f2b)[_0x0cda('0x26')](function(_0x241d4b){_0x3bf2ec[_0x0cda('0x1f')]=_0x241d4b;if(_0x5274ab[_0x0cda('0x34')]['includeAll']){_0x252a61[_0x0cda('0x43')]=[{'all':!![]}];}return db[_0x0cda('0x44')][_0x0cda('0x45')](_0x252a61);})[_0x0cda('0x26')](function(_0x341620){_0x3bf2ec[_0x0cda('0x46')]=_0x341620;return _0x3bf2ec;})['then'](respondWithFilteredResult(_0x375e9a,_0x252a61))[_0x0cda('0x47')](handleError(_0x375e9a,null));};exports[_0x0cda('0x48')]=function(_0x498ecd,_0xb95d61){var _0x2d737a={'raw':!![],'where':{'id':_0x498ecd[_0x0cda('0x49')]['id']}},_0x562e60={};_0x562e60[_0x0cda('0x33')]=_['keys'](db['MailSubstatus'][_0x0cda('0x2f')]);_0x562e60[_0x0cda('0x34')]=_['keys'](_0x498ecd[_0x0cda('0x34')]);_0x562e60['filters']=_['intersection'](_0x562e60[_0x0cda('0x33')],_0x562e60[_0x0cda('0x34')]);_0x2d737a['attributes']=_[_0x0cda('0x37')](_0x562e60[_0x0cda('0x33')],qs['fields'](_0x498ecd[_0x0cda('0x34')][_0x0cda('0x39')]));_0x2d737a['attributes']=_0x2d737a['attributes']['length']?_0x2d737a[_0x0cda('0x38')]:_0x562e60[_0x0cda('0x33')];if(_0x498ecd['query'][_0x0cda('0x4a')]){_0x2d737a[_0x0cda('0x43')]=[{'all':!![]}];}_0x2d737a=_[_0x0cda('0x42')]({},_0x2d737a,_0x498ecd[_0x0cda('0x4b')]);return db[_0x0cda('0x44')][_0x0cda('0x4c')](_0x2d737a)[_0x0cda('0x26')](handleEntityNotFound(_0xb95d61,null))[_0x0cda('0x26')](respondWithResult(_0xb95d61,null))[_0x0cda('0x47')](handleError(_0xb95d61,null));};exports[_0x0cda('0x4d')]=function(_0x17bf1f,_0x1428fb){return db[_0x0cda('0x44')][_0x0cda('0x4d')](_0x17bf1f[_0x0cda('0x4e')],{})['then'](respondWithResult(_0x1428fb,0xc9))[_0x0cda('0x47')](handleError(_0x1428fb,null));};exports[_0x0cda('0x25')]=function(_0x35de98,_0x332b51){if(_0x35de98[_0x0cda('0x4e')]['id']){delete _0x35de98[_0x0cda('0x4e')]['id'];}return db[_0x0cda('0x44')][_0x0cda('0x4c')]({'where':{'id':_0x35de98[_0x0cda('0x49')]['id']}})[_0x0cda('0x26')](handleEntityNotFound(_0x332b51,null))['then'](saveUpdates(_0x35de98['body'],null))['then'](respondWithResult(_0x332b51,null))[_0x0cda('0x47')](handleError(_0x332b51,null));};exports[_0x0cda('0x27')]=function(_0xc5930b,_0x86c4e8){return db[_0x0cda('0x44')][_0x0cda('0x4c')]({'where':{'id':_0xc5930b[_0x0cda('0x49')]['id']}})[_0x0cda('0x26')](handleEntityNotFound(_0x86c4e8,null))[_0x0cda('0x26')](removeEntity(_0x86c4e8,null))[_0x0cda('0x47')](handleError(_0x86c4e8,null));};exports['describe']=function(_0x7a269e,_0x46e84e){return db[_0x0cda('0x44')][_0x0cda('0x4f')]()[_0x0cda('0x26')](respondWithResult(_0x46e84e,null))[_0x0cda('0x47')](handleError(_0x46e84e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 1f33be0..cef225a 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 _0xa5b1=['update','emit','hasOwnProperty','hook','exports','events'];(function(_0x384e5f,_0x493075){var _0x3eb285=function(_0x1682ff){while(--_0x1682ff){_0x384e5f['push'](_0x384e5f['shift']());}};_0x3eb285(++_0x493075);}(_0xa5b1,0x179));var _0x1a5b=function(_0x58a975,_0x4f7451){_0x58a975=_0x58a975-0x0;var _0x47f055=_0xa5b1[_0x58a975];return _0x47f055;};'use strict';var EventEmitter=require(_0x1a5b('0x0'));var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x1a5b('0x1')};function emitEvent(_0xe4d463){return function(_0x305703,_0x839915,_0x4b13c6){MailSubstatusEvents[_0x1a5b('0x2')](_0xe4d463+':'+_0x305703['id'],_0x305703);MailSubstatusEvents['emit'](_0xe4d463,_0x305703);_0x4b13c6(null);};}for(var e in events){if(events[_0x1a5b('0x3')](e)){var event=events[e];MailSubstatus[_0x1a5b('0x4')](e,emitEvent(event));}}module[_0x1a5b('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x7186=['setMaxListeners','update','emit','hook','../../mysqldb'];(function(_0x3fdde0,_0x4c4bcc){var _0xb1b7a3=function(_0x47590c){while(--_0x47590c){_0x3fdde0['push'](_0x3fdde0['shift']());}};_0xb1b7a3(++_0x4c4bcc);}(_0x7186,0xdb));var _0x6718=function(_0x462ef2,_0x5d1381){_0x462ef2=_0x462ef2-0x0;var _0x4d5fc4=_0x7186[_0x462ef2];return _0x4d5fc4;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x6718('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6718('0x1')](0x0);var events={'afterUpdate':_0x6718('0x2')};function emitEvent(_0x2944f9){return function(_0x5d107a,_0x237948,_0x725bf5){MailSubstatusEvents['emit'](_0x2944f9+':'+_0x5d107a['id'],_0x5d107a);MailSubstatusEvents[_0x6718('0x3')](_0x2944f9,_0x5d107a);_0x725bf5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x6718('0x4')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5932645..d1e339f 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 _0xefaa=['models','define','MailSubstatus','mail_substatuses','update','name','mailSubstatus','catch','./mailSubstatus.attributes'];(function(_0x3c462c,_0x37c21f){var _0x6fe9a8=function(_0x2b0c49){while(--_0x2b0c49){_0x3c462c['push'](_0x3c462c['shift']());}};_0x6fe9a8(++_0x37c21f);}(_0xefaa,0x128));var _0xaefa=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xefaa[_0x411add];return _0x238242;};'use strict';var attributes=require(_0xaefa('0x0'));module['exports']=function(_0x18abe4){var _0x148f08=_0x18abe4[_0xaefa('0x1')];return _0x18abe4[_0xaefa('0x2')](_0xaefa('0x3'),attributes,{'tableName':_0xaefa('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x272ece,_0x2da6fe,_0x14541c){return _0x148f08['Condition'][_0xaefa('0x5')]({'value':_0x272ece[_0xaefa('0x6')]},{'where':{'field':_0xaefa('0x7'),'value':_0x272ece['_previousDataValues'][_0xaefa('0x6')]}})['then'](function(){_0x14541c();})[_0xaefa('0x8')](function(_0xb24385){_0x14541c(_0xb24385);});}}});}; \ No newline at end of file +var _0x68f2=['_previousDataValues','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','name','mailSubstatus'];(function(_0x408951,_0xafcd73){var _0x211c3a=function(_0x2e6bd2){while(--_0x2e6bd2){_0x408951['push'](_0x408951['shift']());}};_0x211c3a(++_0xafcd73);}(_0x68f2,0x10f));var _0x268f=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x68f2[_0x4e1d03];return _0x362d4b;};'use strict';var attributes=require(_0x268f('0x0'));module[_0x268f('0x1')]=function(_0x28b2f2){var _0x5a98b8=_0x28b2f2[_0x268f('0x2')];return _0x28b2f2[_0x268f('0x3')](_0x268f('0x4'),attributes,{'tableName':_0x268f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5aef72,_0x3ba57a,_0x39856c){return _0x5a98b8['Condition']['update']({'value':_0x5aef72[_0x268f('0x6')]},{'where':{'field':_0x268f('0x7'),'value':_0x5aef72[_0x268f('0x8')][_0x268f('0x6')]}})['then'](function(){_0x39856c();})['catch'](function(_0x4b2745){_0x39856c(_0x4b2745);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index c93a85e..79abd3f 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 _0x56c0=['info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x404d33,_0x4e4772){var _0x1e0846=function(_0x5794b4){while(--_0x5794b4){_0x404d33['push'](_0x404d33['shift']());}};_0x1e0846(++_0x4e4772);}(_0x56c0,0xf9));var _0x056c=function(_0x104651,_0xc9839d){_0x104651=_0x104651-0x0;var _0x387659=_0x56c0[_0x104651];return _0x387659;};'use strict';var _=require(_0x056c('0x0'));var util=require(_0x056c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x056c('0x2'));var fs=require('fs');var Redis=require(_0x056c('0x3'));var db=require(_0x056c('0x4'))['db'];var utils=require(_0x056c('0x5'));var logger=require(_0x056c('0x6'))('rpc');var config=require(_0x056c('0x7'));var jayson=require(_0x056c('0x8'));var client=jayson[_0x056c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba8e5,_0x109967,_0x5dd3d6){return new BPromise(function(_0x484ece,_0x2bb58a){return client[_0x056c('0xa')](_0x4ba8e5,_0x5dd3d6)['then'](function(_0x272801){logger[_0x056c('0xb')](_0x056c('0xc'),_0x109967,_0x056c('0xd'));logger['debug'](_0x056c('0xe'),_0x109967,_0x056c('0xd'),JSON[_0x056c('0xf')](_0x272801));if(_0x272801[_0x056c('0x10')]){if(_0x272801[_0x056c('0x10')]['code']===0x1f4){logger[_0x056c('0x10')](_0x056c('0xc'),_0x109967,_0x272801[_0x056c('0x10')][_0x056c('0x11')]);return _0x2bb58a(_0x272801[_0x056c('0x10')]['message']);}logger[_0x056c('0x10')](_0x056c('0xc'),_0x109967,_0x272801[_0x056c('0x10')]['message']);return _0x484ece(_0x272801['error'][_0x056c('0x11')]);}else{logger[_0x056c('0xb')](_0x056c('0xc'),_0x109967,_0x056c('0xd'));_0x484ece(_0x272801[_0x056c('0x12')]['message']);}})[_0x056c('0x13')](function(_0x2965a2){logger[_0x056c('0x10')](_0x056c('0xc'),_0x109967,_0x2965a2);_0x2bb58a(_0x2965a2);});});} \ No newline at end of file +var _0xd4ce=['client','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1551b6,_0x278954){var _0x1c0b77=function(_0x252ba8){while(--_0x252ba8){_0x1551b6['push'](_0x1551b6['shift']());}};_0x1c0b77(++_0x278954);}(_0xd4ce,0xb3));var _0xed4c=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xd4ce[_0x521929];return _0x632436;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xed4c('0x0'));var BPromise=require(_0xed4c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed4c('0x2'));var db=require(_0xed4c('0x3'))['db'];var utils=require(_0xed4c('0x4'));var logger=require(_0xed4c('0x5'))(_0xed4c('0x6'));var config=require('../../config/environment');var jayson=require(_0xed4c('0x7'));var client=jayson[_0xed4c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x232be3,_0x163f6e,_0x35a46b){return new BPromise(function(_0x2b75f7,_0xcee765){return client[_0xed4c('0x9')](_0x232be3,_0x35a46b)['then'](function(_0x953902){logger['info'](_0xed4c('0xa'),_0x163f6e,_0xed4c('0xb'));logger[_0xed4c('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x163f6e,'request\x20sent',JSON['stringify'](_0x953902));if(_0x953902[_0xed4c('0xd')]){if(_0x953902[_0xed4c('0xd')][_0xed4c('0xe')]===0x1f4){logger[_0xed4c('0xd')](_0xed4c('0xa'),_0x163f6e,_0x953902['error'][_0xed4c('0xf')]);return _0xcee765(_0x953902[_0xed4c('0xd')][_0xed4c('0xf')]);}logger[_0xed4c('0xd')](_0xed4c('0xa'),_0x163f6e,_0x953902[_0xed4c('0xd')]['message']);return _0x2b75f7(_0x953902['error'][_0xed4c('0xf')]);}else{logger[_0xed4c('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x163f6e,_0xed4c('0xb'));_0x2b75f7(_0x953902['result'][_0xed4c('0xf')]);}})['catch'](function(_0x42a7b1){logger['error'](_0xed4c('0xa'),_0x163f6e,_0x42a7b1);_0xcee765(_0x42a7b1);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 5d3c7d5..2d2c88b 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 _0xf173=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','update','delete','exports','multer'];(function(_0x25de1a,_0x366ddc){var _0x4e1d72=function(_0x2b44a1){while(--_0x2b44a1){_0x25de1a['push'](_0x25de1a['shift']());}};_0x4e1d72(++_0x366ddc);}(_0xf173,0x107));var _0x3f17=function(_0x23086b,_0x51df19){_0x23086b=_0x23086b-0x0;var _0x4efac2=_0xf173[_0x23086b];return _0x4efac2;};'use strict';var multer=require(_0x3f17('0x0'));var util=require(_0x3f17('0x1'));var path=require(_0x3f17('0x2'));var timeout=require(_0x3f17('0x3'));var express=require(_0x3f17('0x4'));var router=express[_0x3f17('0x5')]();var fs_extra=require(_0x3f17('0x6'));var auth=require(_0x3f17('0x7'));var interaction=require(_0x3f17('0x8'));var config=require(_0x3f17('0x9'));var controller=require(_0x3f17('0xa'));router['get']('/',auth[_0x3f17('0xb')](),controller[_0x3f17('0xc')]);router[_0x3f17('0xd')]('/describe',auth[_0x3f17('0xb')](),controller[_0x3f17('0xe')]);router[_0x3f17('0xd')](_0x3f17('0xf'),auth['isAuthenticated'](),controller[_0x3f17('0x10')]);router[_0x3f17('0x11')]('/',auth[_0x3f17('0xb')](),controller['create']);router[_0x3f17('0x12')]('/:id',auth[_0x3f17('0xb')](),controller[_0x3f17('0x13')]);router[_0x3f17('0x14')]('/:id',auth[_0x3f17('0xb')](),controller['destroy']);module[_0x3f17('0x15')]=router; \ No newline at end of file +var _0xe758=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id'];(function(_0x1c5b75,_0x5c4ba0){var _0x2d7db1=function(_0x209de){while(--_0x209de){_0x1c5b75['push'](_0x1c5b75['shift']());}};_0x2d7db1(++_0x5c4ba0);}(_0xe758,0x12e));var _0x8e75=function(_0x273f32,_0x2c8013){_0x273f32=_0x273f32-0x0;var _0x151600=_0xe758[_0x273f32];return _0x151600;};'use strict';var multer=require(_0x8e75('0x0'));var util=require(_0x8e75('0x1'));var path=require(_0x8e75('0x2'));var timeout=require(_0x8e75('0x3'));var express=require(_0x8e75('0x4'));var router=express['Router']();var fs_extra=require(_0x8e75('0x5'));var auth=require(_0x8e75('0x6'));var interaction=require(_0x8e75('0x7'));var config=require(_0x8e75('0x8'));var controller=require('./mailTransferReport.controller');router[_0x8e75('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e75('0xa')]);router['get']('/describe',auth[_0x8e75('0xb')](),controller['describe']);router[_0x8e75('0x9')](_0x8e75('0xc'),auth['isAuthenticated'](),controller[_0x8e75('0xd')]);router[_0x8e75('0xe')]('/',auth[_0x8e75('0xb')](),controller[_0x8e75('0xf')]);router[_0x8e75('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8e75('0x11')]);router[_0x8e75('0x12')](_0x8e75('0xc'),auth[_0x8e75('0xb')](),controller[_0x8e75('0x13')]);module[_0x8e75('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 54faf08..6d22249 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x25f7fd,_0x4661df){var _0x37d16f=function(_0x1b9c73){while(--_0x1b9c73){_0x25f7fd['push'](_0x25f7fd['shift']());}};_0x37d16f(++_0x4661df);}(_0x70e0,0x17b));var _0x070e=function(_0x321185,_0x3b8c28){_0x321185=_0x321185-0x0;var _0x5829fd=_0x70e0[_0x321185];return _0x5829fd;};'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 +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4108f7,_0x51d271){var _0x4c394c=function(_0x2725ef){while(--_0x2725ef){_0x4108f7['push'](_0x4108f7['shift']());}};_0x4c394c(++_0x51d271);}(_0x54ef,0x112));var _0xf54e=function(_0x2c1a88,_0x16da91){_0x2c1a88=_0x2c1a88-0x0;var _0x3d4fec=_0x54ef[_0x2c1a88];return _0x3d4fec;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a8c3da8..8a3dbb1 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 _0x9914=['body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','MailTransferReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','show','params','options','catch'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9914,0xdb));var _0x4991=function(_0x345bba,_0x5ad112){_0x345bba=_0x345bba-0x0;var _0x2dd311=_0x9914[_0x345bba];return _0x2dd311;};'use strict';var emlformat=require(_0x4991('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4991('0x1'));var jsonpatch=require(_0x4991('0x2'));var rp=require(_0x4991('0x3'));var moment=require(_0x4991('0x4'));var BPromise=require(_0x4991('0x5'));var Mustache=require('mustache');var util=require(_0x4991('0x6'));var path=require('path');var sox=require(_0x4991('0x7'));var csv=require(_0x4991('0x8'));var ejs=require(_0x4991('0x9'));var fs=require('fs');var fs_extra=require(_0x4991('0xa'));var _=require(_0x4991('0xb'));var squel=require(_0x4991('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4991('0xd'));var toCsv=require(_0x4991('0x8'));var querystring=require(_0x4991('0xe'));var Papa=require(_0x4991('0xf'));var Redis=require(_0x4991('0x10'));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(_0x4991('0x11'))(_0x4991('0x12'));var utils=require(_0x4991('0x13'));var config=require(_0x4991('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4991('0x15'))['db'];function respondWithStatusCode(_0x416680,_0x2530b9){_0x2530b9=_0x2530b9||0xcc;return function(_0x3ec447){if(_0x3ec447){return _0x416680[_0x4991('0x16')](_0x2530b9);}return _0x416680[_0x4991('0x17')](_0x2530b9)['end']();};}function respondWithResult(_0x3165c8,_0x1857fc){_0x1857fc=_0x1857fc||0xc8;return function(_0x30aea8){if(_0x30aea8){return _0x3165c8[_0x4991('0x17')](_0x1857fc)[_0x4991('0x18')](_0x30aea8);}};}function respondWithFilteredResult(_0x4b287e,_0x3b41ac){return function(_0x4250a1){if(_0x4250a1){var _0x2ea6a7=typeof _0x3b41ac[_0x4991('0x19')]===_0x4991('0x1a')&&typeof _0x3b41ac['limit']===_0x4991('0x1a');var _0x55c26a=_0x4250a1[_0x4991('0x1b')];var _0x3400d9=_0x2ea6a7?0x0:_0x3b41ac[_0x4991('0x19')];var _0x5d725f=_0x2ea6a7?_0x4250a1[_0x4991('0x1b')]:_0x3b41ac[_0x4991('0x19')]+_0x3b41ac['limit'];var _0x6312d8;if(_0x5d725f>=_0x55c26a){_0x5d725f=_0x55c26a;_0x6312d8=0xc8;}else{_0x6312d8=0xce;}_0x4b287e[_0x4991('0x17')](_0x6312d8);return _0x4b287e[_0x4991('0x1c')](_0x4991('0x1d'),_0x3400d9+'-'+_0x5d725f+'/'+_0x55c26a)[_0x4991('0x18')](_0x4250a1);}return null;};}function patchUpdates(_0x22029c){return function(_0x29c781){try{jsonpatch[_0x4991('0x1e')](_0x29c781,_0x22029c,!![]);}catch(_0x268032){return BPromise[_0x4991('0x1f')](_0x268032);}return _0x29c781[_0x4991('0x20')]();};}function saveUpdates(_0x577b48,_0x33f554){return function(_0x124682){if(_0x124682){return _0x124682[_0x4991('0x21')](_0x577b48)[_0x4991('0x22')](function(_0x33fc86){return _0x33fc86;});}return null;};}function removeEntity(_0x391556,_0x44f59f){return function(_0x5e0eda){if(_0x5e0eda){return _0x5e0eda[_0x4991('0x23')]()[_0x4991('0x22')](function(){_0x391556[_0x4991('0x17')](0xcc)[_0x4991('0x24')]();});}};}function handleEntityNotFound(_0x4c9fc6,_0x2bd430){return function(_0x19832c){if(!_0x19832c){_0x4c9fc6['sendStatus'](0x194);}return _0x19832c;};}function handleError(_0x4d0f6e,_0x1f6151){_0x1f6151=_0x1f6151||0x1f4;return function(_0x4b6d7b){logger[_0x4991('0x25')](_0x4b6d7b[_0x4991('0x26')]);if(_0x4b6d7b[_0x4991('0x27')]){delete _0x4b6d7b[_0x4991('0x27')];}_0x4d0f6e[_0x4991('0x17')](_0x1f6151)[_0x4991('0x28')](_0x4b6d7b);};}exports['index']=function(_0x15128d,_0xcda2){var _0x426c5={},_0x4d33c1={},_0x19a7ff={'count':0x0,'rows':[]};var _0x413969=_['map'](db[_0x4991('0x29')][_0x4991('0x2a')],function(_0x28a2a3){return{'name':_0x28a2a3[_0x4991('0x2b')],'type':_0x28a2a3[_0x4991('0x2c')]['key']};});_0x4d33c1[_0x4991('0x2d')]=_[_0x4991('0x2e')](_0x413969,'name');_0x4d33c1[_0x4991('0x2f')]=_[_0x4991('0x30')](_0x15128d[_0x4991('0x2f')]);_0x4d33c1['filters']=_[_0x4991('0x31')](_0x4d33c1[_0x4991('0x2d')],_0x4d33c1['query']);_0x426c5[_0x4991('0x32')]=_[_0x4991('0x31')](_0x4d33c1[_0x4991('0x2d')],qs[_0x4991('0x33')](_0x15128d['query'][_0x4991('0x33')]));_0x426c5[_0x4991('0x32')]=_0x426c5[_0x4991('0x32')][_0x4991('0x34')]?_0x426c5[_0x4991('0x32')]:_0x4d33c1[_0x4991('0x2d')];if(!_0x15128d['query'][_0x4991('0x35')](_0x4991('0x36'))){_0x426c5[_0x4991('0x37')]=qs[_0x4991('0x37')](_0x15128d['query'][_0x4991('0x37')]);_0x426c5[_0x4991('0x19')]=qs[_0x4991('0x19')](_0x15128d[_0x4991('0x2f')][_0x4991('0x19')]);}_0x426c5[_0x4991('0x38')]=qs['sort'](_0x15128d[_0x4991('0x2f')][_0x4991('0x39')]);_0x426c5[_0x4991('0x3a')]=qs[_0x4991('0x3b')](_['pick'](_0x15128d[_0x4991('0x2f')],_0x4d33c1['filters']),_0x413969);if(_0x15128d[_0x4991('0x2f')][_0x4991('0x3c')]){_0x426c5[_0x4991('0x3a')]=_[_0x4991('0x3d')](_0x426c5['where'],{'$or':_[_0x4991('0x2e')](_0x413969,function(_0x1ae4f5){if(_0x1ae4f5[_0x4991('0x2c')]!==_0x4991('0x3e')){var _0x3c6009={};_0x3c6009[_0x1ae4f5[_0x4991('0x27')]]={'$like':'%'+_0x15128d[_0x4991('0x2f')]['filter']+'%'};return _0x3c6009;}})});}_0x426c5=_['merge']({},_0x426c5,_0x15128d['options']);var _0x204670={'where':_0x426c5[_0x4991('0x3a')]};return db[_0x4991('0x29')][_0x4991('0x1b')](_0x204670)[_0x4991('0x22')](function(_0x25cffe){_0x19a7ff[_0x4991('0x1b')]=_0x25cffe;if(_0x15128d[_0x4991('0x2f')][_0x4991('0x3f')]){_0x426c5[_0x4991('0x40')]=[{'all':!![]}];}return db[_0x4991('0x29')]['findAll'](_0x426c5);})['then'](function(_0x3924f6){_0x19a7ff['rows']=_0x3924f6;return _0x19a7ff;})[_0x4991('0x22')](respondWithFilteredResult(_0xcda2,_0x426c5))['catch'](handleError(_0xcda2,null));};exports[_0x4991('0x41')]=function(_0x5f463c,_0x436393){var _0x21d5d2={'raw':!![],'where':{'id':_0x5f463c[_0x4991('0x42')]['id']}},_0x47bd37={};_0x47bd37['model']=_[_0x4991('0x30')](db[_0x4991('0x29')][_0x4991('0x2a')]);_0x47bd37['query']=_[_0x4991('0x30')](_0x5f463c[_0x4991('0x2f')]);_0x47bd37[_0x4991('0x3b')]=_[_0x4991('0x31')](_0x47bd37[_0x4991('0x2d')],_0x47bd37[_0x4991('0x2f')]);_0x21d5d2[_0x4991('0x32')]=_[_0x4991('0x31')](_0x47bd37[_0x4991('0x2d')],qs[_0x4991('0x33')](_0x5f463c[_0x4991('0x2f')][_0x4991('0x33')]));_0x21d5d2[_0x4991('0x32')]=_0x21d5d2[_0x4991('0x32')][_0x4991('0x34')]?_0x21d5d2[_0x4991('0x32')]:_0x47bd37['model'];if(_0x5f463c[_0x4991('0x2f')]['includeAll']){_0x21d5d2['include']=[{'all':!![]}];}_0x21d5d2=_[_0x4991('0x3d')]({},_0x21d5d2,_0x5f463c[_0x4991('0x43')]);return db[_0x4991('0x29')]['find'](_0x21d5d2)[_0x4991('0x22')](handleEntityNotFound(_0x436393,null))[_0x4991('0x22')](respondWithResult(_0x436393,null))[_0x4991('0x44')](handleError(_0x436393,null));};exports['create']=function(_0x684008,_0xa9711){return db[_0x4991('0x29')]['create'](_0x684008[_0x4991('0x45')],{})[_0x4991('0x22')](respondWithResult(_0xa9711,0xc9))[_0x4991('0x44')](handleError(_0xa9711,null));};exports['update']=function(_0x2089ce,_0x235494){if(_0x2089ce[_0x4991('0x45')]['id']){delete _0x2089ce[_0x4991('0x45')]['id'];}return db[_0x4991('0x29')][_0x4991('0x46')]({'where':{'id':_0x2089ce[_0x4991('0x42')]['id']}})[_0x4991('0x22')](handleEntityNotFound(_0x235494,null))[_0x4991('0x22')](saveUpdates(_0x2089ce['body'],null))['then'](respondWithResult(_0x235494,null))[_0x4991('0x44')](handleError(_0x235494,null));};exports[_0x4991('0x23')]=function(_0x43341d,_0x5abf24){return db['MailTransferReport'][_0x4991('0x46')]({'where':{'id':_0x43341d[_0x4991('0x42')]['id']}})[_0x4991('0x22')](handleEntityNotFound(_0x5abf24,null))[_0x4991('0x22')](removeEntity(_0x5abf24,null))[_0x4991('0x44')](handleError(_0x5abf24,null));};exports[_0x4991('0x47')]=function(_0x25cdc4,_0xb0ec4b){return db[_0x4991('0x29')][_0x4991('0x47')]()['then'](respondWithResult(_0xb0ec4b,null))['catch'](handleError(_0xb0ec4b,null));}; \ No newline at end of file +var _0x3c57=['attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','findAll','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','status','sendStatus','error','name','index','map','MailTransferReport','rawAttributes','type','key','query','filters','intersection','model'];(function(_0x121c8a,_0x26cffe){var _0x14e39d=function(_0x3017db){while(--_0x3017db){_0x121c8a['push'](_0x121c8a['shift']());}};_0x14e39d(++_0x26cffe);}(_0x3c57,0x186));var _0x73c5=function(_0x16caa0,_0x30b783){_0x16caa0=_0x16caa0-0x0;var _0x2e408a=_0x3c57[_0x16caa0];return _0x2e408a;};'use strict';var emlformat=require(_0x73c5('0x0'));var rimraf=require(_0x73c5('0x1'));var zipdir=require(_0x73c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73c5('0x3'));var moment=require(_0x73c5('0x4'));var BPromise=require(_0x73c5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x73c5('0x6'));var csv=require(_0x73c5('0x7'));var ejs=require(_0x73c5('0x8'));var fs=require('fs');var fs_extra=require(_0x73c5('0x9'));var _=require(_0x73c5('0xa'));var squel=require(_0x73c5('0xb'));var crypto=require(_0x73c5('0xc'));var jsforce=require(_0x73c5('0xd'));var deskjs=require(_0x73c5('0xe'));var toCsv=require(_0x73c5('0x7'));var querystring=require(_0x73c5('0xf'));var Papa=require(_0x73c5('0x10'));var Redis=require(_0x73c5('0x11'));var authService=require(_0x73c5('0x12'));var qs=require(_0x73c5('0x13'));var as=require(_0x73c5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73c5('0x15'))(_0x73c5('0x16'));var utils=require(_0x73c5('0x17'));var config=require(_0x73c5('0x18'));var licenseUtil=require(_0x73c5('0x19'));var db=require(_0x73c5('0x1a'))['db'];function respondWithStatusCode(_0x120a43,_0x3a05ca){_0x3a05ca=_0x3a05ca||0xcc;return function(_0x16331b){if(_0x16331b){return _0x120a43['sendStatus'](_0x3a05ca);}return _0x120a43['status'](_0x3a05ca)[_0x73c5('0x1b')]();};}function respondWithResult(_0x4beeda,_0x3a4c37){_0x3a4c37=_0x3a4c37||0xc8;return function(_0x333d99){if(_0x333d99){return _0x4beeda['status'](_0x3a4c37)[_0x73c5('0x1c')](_0x333d99);}};}function respondWithFilteredResult(_0x71922f,_0x54b36c){return function(_0x595190){if(_0x595190){var _0x1fb08d=typeof _0x54b36c[_0x73c5('0x1d')]==='undefined'&&typeof _0x54b36c[_0x73c5('0x1e')]===_0x73c5('0x1f');var _0xae9c16=_0x595190[_0x73c5('0x20')];var _0x4d0e97=_0x1fb08d?0x0:_0x54b36c[_0x73c5('0x1d')];var _0x34b5b2=_0x1fb08d?_0x595190[_0x73c5('0x20')]:_0x54b36c[_0x73c5('0x1d')]+_0x54b36c['limit'];var _0x1eacb3;if(_0x34b5b2>=_0xae9c16){_0x34b5b2=_0xae9c16;_0x1eacb3=0xc8;}else{_0x1eacb3=0xce;}_0x71922f['status'](_0x1eacb3);return _0x71922f[_0x73c5('0x21')](_0x73c5('0x22'),_0x4d0e97+'-'+_0x34b5b2+'/'+_0xae9c16)['json'](_0x595190);}return null;};}function patchUpdates(_0x4b7954){return function(_0x40c2ba){try{jsonpatch[_0x73c5('0x23')](_0x40c2ba,_0x4b7954,!![]);}catch(_0x5650f2){return BPromise[_0x73c5('0x24')](_0x5650f2);}return _0x40c2ba['save']();};}function saveUpdates(_0x5be15c,_0x427474){return function(_0x3d74e8){if(_0x3d74e8){return _0x3d74e8[_0x73c5('0x25')](_0x5be15c)[_0x73c5('0x26')](function(_0xe0cca3){return _0xe0cca3;});}return null;};}function removeEntity(_0x291e36,_0x363bde){return function(_0x5f2ae4){if(_0x5f2ae4){return _0x5f2ae4[_0x73c5('0x27')]()[_0x73c5('0x26')](function(){_0x291e36[_0x73c5('0x28')](0xcc)[_0x73c5('0x1b')]();});}};}function handleEntityNotFound(_0x36b227,_0x2605fa){return function(_0x1c8ccb){if(!_0x1c8ccb){_0x36b227[_0x73c5('0x29')](0x194);}return _0x1c8ccb;};}function handleError(_0x214f5c,_0x40c739){_0x40c739=_0x40c739||0x1f4;return function(_0x437c5c){logger[_0x73c5('0x2a')](_0x437c5c['stack']);if(_0x437c5c[_0x73c5('0x2b')]){delete _0x437c5c[_0x73c5('0x2b')];}_0x214f5c[_0x73c5('0x28')](_0x40c739)['send'](_0x437c5c);};}exports[_0x73c5('0x2c')]=function(_0xc88bf6,_0x321c27){var _0x4dd32f={},_0x88883d={},_0x239ee5={'count':0x0,'rows':[]};var _0x542ff7=_[_0x73c5('0x2d')](db[_0x73c5('0x2e')][_0x73c5('0x2f')],function(_0x3470c8){return{'name':_0x3470c8['fieldName'],'type':_0x3470c8[_0x73c5('0x30')][_0x73c5('0x31')]};});_0x88883d['model']=_['map'](_0x542ff7,_0x73c5('0x2b'));_0x88883d[_0x73c5('0x32')]=_['keys'](_0xc88bf6[_0x73c5('0x32')]);_0x88883d[_0x73c5('0x33')]=_[_0x73c5('0x34')](_0x88883d[_0x73c5('0x35')],_0x88883d['query']);_0x4dd32f[_0x73c5('0x36')]=_[_0x73c5('0x34')](_0x88883d['model'],qs[_0x73c5('0x37')](_0xc88bf6[_0x73c5('0x32')][_0x73c5('0x37')]));_0x4dd32f[_0x73c5('0x36')]=_0x4dd32f['attributes'][_0x73c5('0x38')]?_0x4dd32f['attributes']:_0x88883d[_0x73c5('0x35')];if(!_0xc88bf6['query'][_0x73c5('0x39')]('nolimit')){_0x4dd32f[_0x73c5('0x1e')]=qs[_0x73c5('0x1e')](_0xc88bf6[_0x73c5('0x32')]['limit']);_0x4dd32f[_0x73c5('0x1d')]=qs[_0x73c5('0x1d')](_0xc88bf6[_0x73c5('0x32')][_0x73c5('0x1d')]);}_0x4dd32f['order']=qs[_0x73c5('0x3a')](_0xc88bf6['query'][_0x73c5('0x3a')]);_0x4dd32f['where']=qs[_0x73c5('0x33')](_[_0x73c5('0x3b')](_0xc88bf6[_0x73c5('0x32')],_0x88883d[_0x73c5('0x33')]),_0x542ff7);if(_0xc88bf6[_0x73c5('0x32')][_0x73c5('0x3c')]){_0x4dd32f[_0x73c5('0x3d')]=_[_0x73c5('0x3e')](_0x4dd32f[_0x73c5('0x3d')],{'$or':_['map'](_0x542ff7,function(_0x23d834){if(_0x23d834[_0x73c5('0x30')]!==_0x73c5('0x3f')){var _0x3fa6b8={};_0x3fa6b8[_0x23d834[_0x73c5('0x2b')]]={'$like':'%'+_0xc88bf6[_0x73c5('0x32')][_0x73c5('0x3c')]+'%'};return _0x3fa6b8;}})});}_0x4dd32f=_['merge']({},_0x4dd32f,_0xc88bf6[_0x73c5('0x40')]);var _0x3b61f6={'where':_0x4dd32f[_0x73c5('0x3d')]};return db[_0x73c5('0x2e')][_0x73c5('0x20')](_0x3b61f6)[_0x73c5('0x26')](function(_0x4404d6){_0x239ee5['count']=_0x4404d6;if(_0xc88bf6[_0x73c5('0x32')]['includeAll']){_0x4dd32f['include']=[{'all':!![]}];}return db[_0x73c5('0x2e')][_0x73c5('0x41')](_0x4dd32f);})[_0x73c5('0x26')](function(_0x5a0e5a){_0x239ee5['rows']=_0x5a0e5a;return _0x239ee5;})['then'](respondWithFilteredResult(_0x321c27,_0x4dd32f))[_0x73c5('0x42')](handleError(_0x321c27,null));};exports['show']=function(_0x3bcf30,_0x10cbab){var _0x39a01f={'raw':!![],'where':{'id':_0x3bcf30[_0x73c5('0x43')]['id']}},_0x4a03d4={};_0x4a03d4['model']=_[_0x73c5('0x44')](db[_0x73c5('0x2e')][_0x73c5('0x2f')]);_0x4a03d4[_0x73c5('0x32')]=_[_0x73c5('0x44')](_0x3bcf30[_0x73c5('0x32')]);_0x4a03d4['filters']=_[_0x73c5('0x34')](_0x4a03d4[_0x73c5('0x35')],_0x4a03d4[_0x73c5('0x32')]);_0x39a01f[_0x73c5('0x36')]=_['intersection'](_0x4a03d4[_0x73c5('0x35')],qs[_0x73c5('0x37')](_0x3bcf30['query'][_0x73c5('0x37')]));_0x39a01f['attributes']=_0x39a01f[_0x73c5('0x36')][_0x73c5('0x38')]?_0x39a01f['attributes']:_0x4a03d4['model'];if(_0x3bcf30[_0x73c5('0x32')][_0x73c5('0x45')]){_0x39a01f['include']=[{'all':!![]}];}_0x39a01f=_[_0x73c5('0x3e')]({},_0x39a01f,_0x3bcf30['options']);return db[_0x73c5('0x2e')][_0x73c5('0x46')](_0x39a01f)[_0x73c5('0x26')](handleEntityNotFound(_0x10cbab,null))[_0x73c5('0x26')](respondWithResult(_0x10cbab,null))[_0x73c5('0x42')](handleError(_0x10cbab,null));};exports['create']=function(_0x1b52b3,_0xf5b567){return db[_0x73c5('0x2e')][_0x73c5('0x47')](_0x1b52b3[_0x73c5('0x48')],{})[_0x73c5('0x26')](respondWithResult(_0xf5b567,0xc9))[_0x73c5('0x42')](handleError(_0xf5b567,null));};exports[_0x73c5('0x25')]=function(_0x1c50a2,_0x32bbbc){if(_0x1c50a2[_0x73c5('0x48')]['id']){delete _0x1c50a2[_0x73c5('0x48')]['id'];}return db[_0x73c5('0x2e')]['find']({'where':{'id':_0x1c50a2[_0x73c5('0x43')]['id']}})[_0x73c5('0x26')](handleEntityNotFound(_0x32bbbc,null))[_0x73c5('0x26')](saveUpdates(_0x1c50a2[_0x73c5('0x48')],null))[_0x73c5('0x26')](respondWithResult(_0x32bbbc,null))[_0x73c5('0x42')](handleError(_0x32bbbc,null));};exports[_0x73c5('0x27')]=function(_0x3c5646,_0x2631de){return db[_0x73c5('0x2e')][_0x73c5('0x46')]({'where':{'id':_0x3c5646[_0x73c5('0x43')]['id']}})[_0x73c5('0x26')](handleEntityNotFound(_0x2631de,null))[_0x73c5('0x26')](removeEntity(_0x2631de,null))[_0x73c5('0x42')](handleError(_0x2631de,null));};exports[_0x73c5('0x49')]=function(_0x5cf129,_0x250755){return db[_0x73c5('0x2e')][_0x73c5('0x49')]()[_0x73c5('0x26')](respondWithResult(_0x250755,null))[_0x73c5('0x42')](handleError(_0x250755,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 30db522..ef2fbfd 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 _0x1353=['api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x149882,_0x39b6be){var _0x43c6ee=function(_0x42d925){while(--_0x42d925){_0x149882['push'](_0x149882['shift']());}};_0x43c6ee(++_0x39b6be);}(_0x1353,0xb3));var _0x3135=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x1353[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x3135('0x0'));var util=require(_0x3135('0x1'));var logger=require(_0x3135('0x2'))(_0x3135('0x3'));var moment=require(_0x3135('0x4'));var BPromise=require(_0x3135('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3135('0x6'));var rimraf=require(_0x3135('0x7'));var config=require(_0x3135('0x8'));var attributes=require(_0x3135('0x9'));module[_0x3135('0xa')]=function(_0x4fd947,_0x2106cb){return _0x4fd947[_0x3135('0xb')]('MailTransferReport',attributes,{'tableName':_0x3135('0xc'),'paranoid':![],'indexes':[{'name':_0x3135('0xd'),'fields':[_0x3135('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7aaf=['rimraf','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','../../config/logger','api','request-promise'];(function(_0x37f796,_0x7147cc){var _0x301a71=function(_0x955074){while(--_0x955074){_0x37f796['push'](_0x37f796['shift']());}};_0x301a71(++_0x7147cc);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x34da37,_0x20c2d7){_0x34da37=_0x34da37-0x0;var _0x30691f=_0x7aaf[_0x34da37];return _0x30691f;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var logger=require(_0xf7aa('0x1'))(_0xf7aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7aa('0x4'));var config=require('../../config/environment');var attributes=require(_0xf7aa('0x5'));module[_0xf7aa('0x6')]=function(_0x1babcd,_0xf02ed5){return _0x1babcd['define'](_0xf7aa('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf7aa('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index f4a3648..fb28a38 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 _0xdb2d=['result','catch','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x14b46c,_0x573d42){var _0x437b62=function(_0x7b716a){while(--_0x7b716a){_0x14b46c['push'](_0x14b46c['shift']());}};_0x437b62(++_0x573d42);}(_0xdb2d,0x6b));var _0xddb2=function(_0x3e9324,_0x59ee4f){_0x3e9324=_0x3e9324-0x0;var _0x526712=_0xdb2d[_0x3e9324];return _0x526712;};'use strict';var _=require(_0xddb2('0x0'));var util=require(_0xddb2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xddb2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddb2('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xddb2('0x4'));var config=require(_0xddb2('0x5'));var jayson=require(_0xddb2('0x6'));var client=jayson[_0xddb2('0x7')][_0xddb2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1fb414,_0x4b95a2,_0x2efe6b){return new BPromise(function(_0x184c42,_0x3b7458){return client[_0xddb2('0x9')](_0x1fb414,_0x2efe6b)[_0xddb2('0xa')](function(_0x516b3c){logger[_0xddb2('0xb')](_0xddb2('0xc'),_0x4b95a2,_0xddb2('0xd'));logger[_0xddb2('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4b95a2,'request\x20sent',JSON[_0xddb2('0xf')](_0x516b3c));if(_0x516b3c[_0xddb2('0x10')]){if(_0x516b3c[_0xddb2('0x10')][_0xddb2('0x11')]===0x1f4){logger[_0xddb2('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x4b95a2,_0x516b3c[_0xddb2('0x10')][_0xddb2('0x12')]);return _0x3b7458(_0x516b3c[_0xddb2('0x10')][_0xddb2('0x12')]);}logger['error'](_0xddb2('0xc'),_0x4b95a2,_0x516b3c[_0xddb2('0x10')]['message']);return _0x184c42(_0x516b3c[_0xddb2('0x10')][_0xddb2('0x12')]);}else{logger[_0xddb2('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x4b95a2,'request\x20sent');_0x184c42(_0x516b3c[_0xddb2('0x13')][_0xddb2('0x12')]);}})[_0xddb2('0x14')](function(_0x56f1d5){logger[_0xddb2('0x10')](_0xddb2('0xc'),_0x4b95a2,_0x56f1d5);_0x3b7458(_0x56f1d5);});});} \ No newline at end of file +var _0xa429=['client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa429,0x1c4));var _0x9a42=function(_0x4f7695,_0x36b7b4){_0x4f7695=_0x4f7695-0x0;var _0x35204c=_0xa429[_0x4f7695];return _0x35204c;};'use strict';var _=require(_0x9a42('0x0'));var util=require(_0x9a42('0x1'));var moment=require(_0x9a42('0x2'));var BPromise=require(_0x9a42('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a42('0x4'));var db=require(_0x9a42('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a42('0x6'))(_0x9a42('0x7'));var config=require(_0x9a42('0x8'));var jayson=require(_0x9a42('0x9'));var client=jayson[_0x9a42('0xa')][_0x9a42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa84736,_0xe918f0,_0x147484){return new BPromise(function(_0x48ce70,_0x1ee325){return client[_0x9a42('0xc')](_0xa84736,_0x147484)['then'](function(_0x50d998){logger[_0x9a42('0xd')](_0x9a42('0xe'),_0xe918f0,_0x9a42('0xf'));logger[_0x9a42('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xe918f0,_0x9a42('0xf'),JSON[_0x9a42('0x11')](_0x50d998));if(_0x50d998['error']){if(_0x50d998[_0x9a42('0x12')][_0x9a42('0x13')]===0x1f4){logger[_0x9a42('0x12')](_0x9a42('0xe'),_0xe918f0,_0x50d998[_0x9a42('0x12')][_0x9a42('0x14')]);return _0x1ee325(_0x50d998[_0x9a42('0x12')]['message']);}logger[_0x9a42('0x12')]('MailTransferReport,\x20%s,\x20%s',_0xe918f0,_0x50d998[_0x9a42('0x12')][_0x9a42('0x14')]);return _0x48ce70(_0x50d998['error'][_0x9a42('0x14')]);}else{logger[_0x9a42('0xd')](_0x9a42('0xe'),_0xe918f0,_0x9a42('0xf'));_0x48ce70(_0x50d998[_0x9a42('0x15')]['message']);}})['catch'](function(_0x136a56){logger['error'](_0x9a42('0xe'),_0xe918f0,_0x136a56);_0x1ee325(_0x136a56);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5ea6491..7faad68 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 _0x3db9=['exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','delete'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x3db9,0xfd));var _0x93db=function(_0x59701b,_0x41c78b){_0x59701b=_0x59701b-0x0;var _0x3cfc4a=_0x3db9[_0x59701b];return _0x3cfc4a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x93db('0x0'));var express=require('express');var router=express[_0x93db('0x1')]();var fs_extra=require(_0x93db('0x2'));var auth=require(_0x93db('0x3'));var interaction=require(_0x93db('0x4'));var config=require(_0x93db('0x5'));var controller=require(_0x93db('0x6'));router[_0x93db('0x7')]('/',auth['isAuthenticated'](),controller[_0x93db('0x8')]);router['get'](_0x93db('0x9'),auth[_0x93db('0xa')](),controller[_0x93db('0xb')]);router['get'](_0x93db('0xc'),auth['isAuthenticated'](),controller[_0x93db('0xd')]);router['post']('/',auth[_0x93db('0xa')](),controller[_0x93db('0xe')]);router[_0x93db('0xf')](_0x93db('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x93db('0x10')](_0x93db('0xc'),auth[_0x93db('0xa')](),controller['destroy']);module[_0x93db('0x11')]=router; \ No newline at end of file +var _0xb9f3=['../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','get','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xb9f3,0x142));var _0x3b9f=function(_0x5192ac,_0x589699){_0x5192ac=_0x5192ac-0x0;var _0x52dd64=_0xb9f3[_0x5192ac];return _0x52dd64;};'use strict';var multer=require(_0x3b9f('0x0'));var util=require(_0x3b9f('0x1'));var path=require(_0x3b9f('0x2'));var timeout=require(_0x3b9f('0x3'));var express=require(_0x3b9f('0x4'));var router=express[_0x3b9f('0x5')]();var fs_extra=require(_0x3b9f('0x6'));var auth=require(_0x3b9f('0x7'));var interaction=require(_0x3b9f('0x8'));var config=require(_0x3b9f('0x9'));var controller=require(_0x3b9f('0xa'));router['get']('/',auth[_0x3b9f('0xb')](),controller['index']);router[_0x3b9f('0xc')](_0x3b9f('0xd'),auth[_0x3b9f('0xb')](),controller['describe']);router[_0x3b9f('0xc')](_0x3b9f('0xe'),auth[_0x3b9f('0xb')](),controller[_0x3b9f('0xf')]);router[_0x3b9f('0x10')]('/',auth[_0x3b9f('0xb')](),controller[_0x3b9f('0x11')]);router[_0x3b9f('0x12')](_0x3b9f('0xe'),auth[_0x3b9f('0xb')](),controller[_0x3b9f('0x13')]);router[_0x3b9f('0x14')](_0x3b9f('0xe'),auth[_0x3b9f('0xb')](),controller['destroy']);module[_0x3b9f('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 58890e2..739cea2 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 _0xa024=['INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x1109bc,_0x41796f){var _0x58bb44=function(_0x25434f){while(--_0x25434f){_0x1109bc['push'](_0x1109bc['shift']());}};_0x58bb44(++_0x41796f);}(_0xa024,0x1de));var _0x4a02=function(_0x2963fe,_0x4910e9){_0x2963fe=_0x2963fe-0x0;var _0x33e0c2=_0xa024[_0x2963fe];return _0x33e0c2;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4a02('0x0')]},'interface':{'type':Sequelize[_0x4a02('0x0')]},'type':{'type':Sequelize[_0x4a02('0x0')],'defaultValue':_0x4a02('0x1'),'comment':_0x4a02('0x2')},'duration':{'type':Sequelize[_0x4a02('0x3')]},'enterAt':{'type':Sequelize[_0x4a02('0x4')]},'exitAt':{'type':Sequelize[_0x4a02('0x4')],'set':function(_0x3de20a){var _0x265dc4=moment(_0x3de20a);var _0x52e778=moment(this[_0x4a02('0x5')](_0x4a02('0x6')));var _0x1efed2=_0x265dc4['diff'](_0x52e778,_0x4a02('0x7'));this[_0x4a02('0x8')](_0x4a02('0x9'),_0x3de20a);this['setDataValue']('duration',_0x1efed2>=0x0?_0x1efed2:null);}},'data1':{'type':Sequelize[_0x4a02('0x0')],'comment':_0x4a02('0xa')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x4a02('0x0')],'comment':_0x4a02('0xb')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x4a02('0x0')],'comment':_0x4a02('0xc')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x4a02('0x3')]},'uniqueid':{'type':Sequelize[_0x4a02('0x0')]}}; \ No newline at end of file +var _0x951a=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','duration'];(function(_0x485b14,_0x1a1601){var _0x4f840f=function(_0x394f19){while(--_0x394f19){_0x485b14['push'](_0x485b14['shift']());}};_0x4f840f(++_0x1a1601);}(_0x951a,0x17e));var _0xa951=function(_0x2759bf,_0x5d72a3){_0x2759bf=_0x2759bf-0x0;var _0x322f2a=_0x951a[_0x2759bf];return _0x322f2a;};'use strict';var Sequelize=require(_0xa951('0x0'));var moment=require(_0xa951('0x1'));module[_0xa951('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa951('0x3')]},'interface':{'type':Sequelize[_0xa951('0x3')]},'type':{'type':Sequelize[_0xa951('0x3')],'defaultValue':_0xa951('0x4'),'comment':_0xa951('0x5')},'duration':{'type':Sequelize[_0xa951('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa951('0x7')],'set':function(_0x243ad1){var _0x23f33e=moment(_0x243ad1);var _0x4e45b5=moment(this[_0xa951('0x8')]('enterAt'));var _0xcb4ef4=_0x23f33e[_0xa951('0x9')](_0x4e45b5,_0xa951('0xa'));this[_0xa951('0xb')](_0xa951('0xc'),_0x243ad1);this[_0xa951('0xb')](_0xa951('0xd'),_0xcb4ef4>=0x0?_0xcb4ef4:null);}},'data1':{'type':Sequelize[_0xa951('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0xa951('0xe')},'data3':{'type':Sequelize[_0xa951('0x3')],'comment':_0xa951('0xf')},'data4':{'type':Sequelize[_0xa951('0x3')],'comment':_0xa951('0x10')},'data5':{'type':Sequelize[_0xa951('0x3')],'comment':_0xa951('0x11')},'role':{'type':Sequelize[_0xa951('0x3')]},'internal':{'type':Sequelize[_0xa951('0x6')]},'uniqueid':{'type':Sequelize[_0xa951('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 318495f..cce70b3 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x161997,_0x57fc9c){var _0x2765ea=function(_0x3138f0){while(--_0x3138f0){_0x161997['push'](_0x161997['shift']());}};_0x2765ea(++_0x57fc9c);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x55ca,0x126));var _0xa55c=function(_0x4fb1b8,_0x32d98d){_0x4fb1b8=_0x4fb1b8-0x0;var _0x146c71=_0x55ca[_0x4fb1b8];return _0x146c71;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index be85d04..b63c3be 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 _0x853e=['util','api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface'];(function(_0x2b47ad,_0x55c7cc){var _0x1a2426=function(_0x47285b){while(--_0x47285b){_0x2b47ad['push'](_0x2b47ad['shift']());}};_0x1a2426(++_0x55c7cc);}(_0x853e,0x1ea));var _0xe853=function(_0x138041,_0xb09aa8){_0x138041=_0x138041-0x0;var _0x1e15a1=_0x853e[_0x138041];return _0x1e15a1;};'use strict';var _=require('lodash');var util=require(_0xe853('0x0'));var logger=require('../../config/logger')(_0xe853('0x1'));var moment=require('moment');var BPromise=require(_0xe853('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe853('0x3'));var rimraf=require(_0xe853('0x4'));var config=require(_0xe853('0x5'));var attributes=require(_0xe853('0x6'));module[_0xe853('0x7')]=function(_0x4b4efa,_0x2605fc){return _0x4b4efa[_0xe853('0x8')](_0xe853('0x9'),attributes,{'tableName':_0xe853('0xa'),'paranoid':![],'indexes':[{'name':_0xe853('0xb'),'fields':[_0xe853('0xc'),_0xe853('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7aa=['./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa7aa,0x133));var _0xaa7a=function(_0x4f98d1,_0x343fb8){_0x4f98d1=_0x4f98d1-0x0;var _0x33d33=_0xa7aa[_0x4f98d1];return _0x33d33;};'use strict';var _=require('lodash');var util=require(_0xaa7a('0x0'));var logger=require(_0xaa7a('0x1'))(_0xaa7a('0x2'));var moment=require(_0xaa7a('0x3'));var BPromise=require(_0xaa7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa7a('0x5'));var rimraf=require(_0xaa7a('0x6'));var config=require(_0xaa7a('0x7'));var attributes=require(_0xaa7a('0x8'));module[_0xaa7a('0x9')]=function(_0x372c05,_0xd38df6){return _0x372c05[_0xaa7a('0xa')]('MemberReport',attributes,{'tableName':_0xaa7a('0xb'),'paranoid':![],'indexes':[{'name':_0xaa7a('0xc'),'fields':[_0xaa7a('0xd'),_0xaa7a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index bc325ad..bcd3cb7 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 _0x8ace=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','attributes','limit','include','map','model','then','CreateMemberReport','body','raw','UpdateMemberReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x47a8c4,_0x1181e4){var _0x460098=function(_0x47d958){while(--_0x47d958){_0x47a8c4['push'](_0x47a8c4['shift']());}};_0x460098(++_0x1181e4);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x482815,_0x3601b1){_0x482815=_0x482815-0x0;var _0x272d11=_0x8ace[_0x482815];return _0x272d11;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('MemberReport,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});}exports[_0xe8ac('0x19')]=function(_0x36759c){var _0x4892d0=this;return new Promise(function(_0x59df3d,_0x5f3433){return db[_0xe8ac('0x1a')][_0xe8ac('0x1b')]({'raw':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')]['where']||null:null,'attributes':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1d')]||null:null,'limit':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1e')]||null:null,'include':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')]?_[_0xe8ac('0x20')](_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')],function(_0x31956a){return{'model':db[_0x31956a[_0xe8ac('0x21')]],'as':_0x31956a['as'],'attributes':_0x31956a['attributes'],'include':_0x31956a[_0xe8ac('0x1f')]?_[_0xe8ac('0x20')](_0x31956a[_0xe8ac('0x1f')],function(_0x7c3450){return{'model':db[_0x7c3450[_0xe8ac('0x21')]],'as':_0x7c3450['as'],'attributes':_0x7c3450[_0xe8ac('0x1d')],'include':_0x7c3450[_0xe8ac('0x1f')]?_[_0xe8ac('0x20')](_0x7c3450[_0xe8ac('0x1f')],function(_0x562e44){return{'model':db[_0x562e44['model']],'as':_0x562e44['as'],'attributes':_0x562e44[_0xe8ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe8ac('0x22')](function(_0x59512c){logger[_0xe8ac('0xf')](_0xe8ac('0x19'),_0x36759c);logger['debug']('GetMemberReport',_0x36759c,JSON[_0xe8ac('0x14')](_0x59512c));_0x59df3d(_0x59512c);})[_0xe8ac('0x18')](function(_0x3798c5){logger[_0xe8ac('0x15')](_0xe8ac('0x19'),_0x3798c5[_0xe8ac('0x16')],_0x36759c);_0x5f3433(_0x4892d0[_0xe8ac('0x15')](0x1f4,_0x3798c5['message']));});});};exports[_0xe8ac('0x23')]=function(_0x5459e5){var _0x2aef04=this;return new Promise(function(_0x5c4089,_0x498427){return db['MemberReport']['create'](_0x5459e5[_0xe8ac('0x24')],{'raw':_0x5459e5[_0xe8ac('0x1c')]?_0x5459e5[_0xe8ac('0x1c')][_0xe8ac('0x25')]===undefined?!![]:![]:!![]})[_0xe8ac('0x22')](function(_0xce819c){logger[_0xe8ac('0xf')]('CreateMemberReport',_0x5459e5);logger[_0xe8ac('0x12')]('CreateMemberReport',_0x5459e5,JSON['stringify'](_0xce819c));_0x5c4089(_0xce819c);})['catch'](function(_0x8a4478){logger[_0xe8ac('0x15')](_0xe8ac('0x23'),_0x8a4478['message'],_0x5459e5);_0x498427(_0x2aef04['error'](0x1f4,_0x8a4478[_0xe8ac('0x16')]));});});};exports[_0xe8ac('0x26')]=function(_0x307f67){var _0x2850a7=this;return new Promise(function(_0x54605b,_0x194e17){return db[_0xe8ac('0x1a')][_0xe8ac('0x27')](_0x307f67[_0xe8ac('0x24')],{'raw':_0x307f67[_0xe8ac('0x1c')]?_0x307f67[_0xe8ac('0x1c')][_0xe8ac('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x307f67['options']?_0x307f67[_0xe8ac('0x1c')][_0xe8ac('0x28')]||null:null,'attributes':_0x307f67['options']?_0x307f67[_0xe8ac('0x1c')][_0xe8ac('0x1d')]||null:null,'limit':_0x307f67[_0xe8ac('0x1c')]?_0x307f67[_0xe8ac('0x1c')]['limit']||null:null})[_0xe8ac('0x22')](function(_0x5e63b3){logger['info'](_0xe8ac('0x26'),_0x307f67);logger[_0xe8ac('0x12')](_0xe8ac('0x26'),_0x307f67,JSON[_0xe8ac('0x14')](_0x5e63b3));_0x54605b(_0x5e63b3);})[_0xe8ac('0x18')](function(_0x22d90b){logger[_0xe8ac('0x15')](_0xe8ac('0x26'),_0x22d90b[_0xe8ac('0x16')],_0x307f67);_0x194e17(_0x2850a7['error'](0x1f4,_0x22d90b['message']));});});}; \ No newline at end of file +var _0xa751=['MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','GetMemberReport','options','where','attributes','include','map','model','then','catch','CreateMemberReport','MemberReport','raw','update','body','limit','UpdateMemberReport','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info'];(function(_0x185ff6,_0x200517){var _0x36af8e=function(_0x4c8a89){while(--_0x4c8a89){_0x185ff6['push'](_0x185ff6['shift']());}};_0x36af8e(++_0x200517);}(_0xa751,0x175));var _0x1a75=function(_0x29513f,_0x1be91c){_0x29513f=_0x29513f-0x0;var _0x29d8fb=_0xa751[_0x29513f];return _0x29d8fb;};'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});function respondWithRpcPromise(_0x2af95b,_0x1ec106,_0x692ac0){return new BPromise(function(_0x4537f6,_0x5d6faa){return client['request'](_0x2af95b,_0x692ac0)['then'](function(_0x41aa8f){logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));logger[_0x1a75('0xe')](_0x1a75('0xf'),_0x1ec106,_0x1a75('0xd'),JSON[_0x1a75('0x10')](_0x41aa8f));if(_0x41aa8f['error']){if(_0x41aa8f['error']['code']===0x1f4){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f[_0x1a75('0x11')][_0x1a75('0x12')]);return _0x5d6faa(_0x41aa8f['error']['message']);}logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f['error'][_0x1a75('0x12')]);return _0x4537f6(_0x41aa8f[_0x1a75('0x11')]['message']);}else{logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));_0x4537f6(_0x41aa8f['result']['message']);}})['catch'](function(_0x471b90){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x471b90);_0x5d6faa(_0x471b90);});});}exports[_0x1a75('0x13')]=function(_0x1b1af2){var _0x1d11dc=this;return new Promise(function(_0x47f384,_0x42e4cf){return db['MemberReport']['findAll']({'raw':_0x1b1af2[_0x1a75('0x14')]?_0x1b1af2[_0x1a75('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1b1af2[_0x1a75('0x14')]?_0x1b1af2['options'][_0x1a75('0x15')]||null:null,'attributes':_0x1b1af2[_0x1a75('0x14')]?_0x1b1af2[_0x1a75('0x14')][_0x1a75('0x16')]||null:null,'limit':_0x1b1af2[_0x1a75('0x14')]?_0x1b1af2[_0x1a75('0x14')]['limit']||null:null,'include':_0x1b1af2[_0x1a75('0x14')]?_0x1b1af2['options'][_0x1a75('0x17')]?_[_0x1a75('0x18')](_0x1b1af2[_0x1a75('0x14')]['include'],function(_0x443ff8){return{'model':db[_0x443ff8['model']],'as':_0x443ff8['as'],'attributes':_0x443ff8[_0x1a75('0x16')],'include':_0x443ff8[_0x1a75('0x17')]?_[_0x1a75('0x18')](_0x443ff8['include'],function(_0x9fe9fe){return{'model':db[_0x9fe9fe[_0x1a75('0x19')]],'as':_0x9fe9fe['as'],'attributes':_0x9fe9fe['attributes'],'include':_0x9fe9fe[_0x1a75('0x17')]?_[_0x1a75('0x18')](_0x9fe9fe['include'],function(_0x168e06){return{'model':db[_0x168e06[_0x1a75('0x19')]],'as':_0x168e06['as'],'attributes':_0x168e06[_0x1a75('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1a75('0x1a')](function(_0x4ba38b){logger[_0x1a75('0xb')](_0x1a75('0x13'),_0x1b1af2);logger[_0x1a75('0xe')](_0x1a75('0x13'),_0x1b1af2,JSON[_0x1a75('0x10')](_0x4ba38b));_0x47f384(_0x4ba38b);})[_0x1a75('0x1b')](function(_0x3b6e1d){logger[_0x1a75('0x11')]('GetMemberReport',_0x3b6e1d['message'],_0x1b1af2);_0x42e4cf(_0x1d11dc[_0x1a75('0x11')](0x1f4,_0x3b6e1d[_0x1a75('0x12')]));});});};exports[_0x1a75('0x1c')]=function(_0x11f25b){var _0x6f02dc=this;return new Promise(function(_0x2ab8ba,_0x1db620){return db[_0x1a75('0x1d')]['create'](_0x11f25b['body'],{'raw':_0x11f25b['options']?_0x11f25b[_0x1a75('0x14')][_0x1a75('0x1e')]===undefined?!![]:![]:!![]})[_0x1a75('0x1a')](function(_0xad9c4){logger['info']('CreateMemberReport',_0x11f25b);logger['debug'](_0x1a75('0x1c'),_0x11f25b,JSON[_0x1a75('0x10')](_0xad9c4));_0x2ab8ba(_0xad9c4);})['catch'](function(_0x5e0ccd){logger[_0x1a75('0x11')]('CreateMemberReport',_0x5e0ccd[_0x1a75('0x12')],_0x11f25b);_0x1db620(_0x6f02dc[_0x1a75('0x11')](0x1f4,_0x5e0ccd[_0x1a75('0x12')]));});});};exports['UpdateMemberReport']=function(_0x4ff4aa){var _0x38bb35=this;return new Promise(function(_0x2a2a44,_0x935dd8){return db[_0x1a75('0x1d')][_0x1a75('0x1f')](_0x4ff4aa[_0x1a75('0x20')],{'raw':_0x4ff4aa[_0x1a75('0x14')]?_0x4ff4aa[_0x1a75('0x14')][_0x1a75('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ff4aa[_0x1a75('0x14')]?_0x4ff4aa[_0x1a75('0x14')][_0x1a75('0x15')]||null:null,'attributes':_0x4ff4aa[_0x1a75('0x14')]?_0x4ff4aa[_0x1a75('0x14')][_0x1a75('0x16')]||null:null,'limit':_0x4ff4aa[_0x1a75('0x14')]?_0x4ff4aa['options'][_0x1a75('0x21')]||null:null})['then'](function(_0x53d457){logger[_0x1a75('0xb')](_0x1a75('0x22'),_0x4ff4aa);logger[_0x1a75('0xe')](_0x1a75('0x22'),_0x4ff4aa,JSON[_0x1a75('0x10')](_0x53d457));_0x2a2a44(_0x53d457);})['catch'](function(_0x6834e5){logger[_0x1a75('0x11')](_0x1a75('0x22'),_0x6834e5[_0x1a75('0x12')],_0x4ff4aa);_0x935dd8(_0x38bb35[_0x1a75('0x11')](0x1f4,_0x6834e5['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 610f7cd..3166aa0 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 _0x8b3b=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','exports'];(function(_0x13c6e2,_0x351586){var _0x38c9c7=function(_0x539181){while(--_0x539181){_0x13c6e2['push'](_0x13c6e2['shift']());}};_0x38c9c7(++_0x351586);}(_0x8b3b,0x6e));var _0xb8b3=function(_0x2c1524,_0x311a60){_0x2c1524=_0x2c1524-0x0;var _0x4ddd51=_0x8b3b[_0x2c1524];return _0x4ddd51;};'use strict';var multer=require('multer');var util=require(_0xb8b3('0x0'));var path=require('path');var timeout=require(_0xb8b3('0x1'));var express=require(_0xb8b3('0x2'));var router=express[_0xb8b3('0x3')]();var fs_extra=require(_0xb8b3('0x4'));var auth=require(_0xb8b3('0x5'));var interaction=require(_0xb8b3('0x6'));var config=require(_0xb8b3('0x7'));var controller=require(_0xb8b3('0x8'));router[_0xb8b3('0x9')]('/',controller['index']);module[_0xb8b3('0xa')]=router; \ No newline at end of file +var _0x07b6=['../../components/auth/service','../../config/environment','./migration.controller','index','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b9b65,_0x3457bf){var _0x1905c2=function(_0x15595d){while(--_0x15595d){_0x5b9b65['push'](_0x5b9b65['shift']());}};_0x1905c2(++_0x3457bf);}(_0x07b6,0xb5));var _0x607b=function(_0x2ceedb,_0x3d4af3){_0x2ceedb=_0x2ceedb-0x0;var _0x1eef5c=_0x07b6[_0x2ceedb];return _0x1eef5c;};'use strict';var multer=require(_0x607b('0x0'));var util=require('util');var path=require(_0x607b('0x1'));var timeout=require(_0x607b('0x2'));var express=require(_0x607b('0x3'));var router=express[_0x607b('0x4')]();var fs_extra=require(_0x607b('0x5'));var auth=require(_0x607b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x607b('0x7'));var controller=require(_0x607b('0x8'));router['get']('/',controller[_0x607b('0x9')]);module[_0x607b('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index ef11c68..ba22091 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 _0x41c6=['exports','STRING','version','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41c6,0xeb));var _0x641c=function(_0x6a3729,_0x5b2bbf){_0x6a3729=_0x6a3729-0x0;var _0x5da8ca=_0x41c6[_0x6a3729];return _0x5da8ca;};'use strict';var Sequelize=require(_0x641c('0x0'));module[_0x641c('0x1')]={'version':{'type':Sequelize[_0x641c('0x2')],'unique':_0x641c('0x3')}}; \ No newline at end of file +var _0xc984=['STRING','version','exports'];(function(_0x2d6fdc,_0x35e4c7){var _0x25a112=function(_0x2f3242){while(--_0x2f3242){_0x2d6fdc['push'](_0x2d6fdc['shift']());}};_0x25a112(++_0x35e4c7);}(_0xc984,0x134));var _0x4c98=function(_0x20c88d,_0x3ce4cb){_0x20c88d=_0x20c88d-0x0;var _0x513290=_0xc984[_0x20c88d];return _0x513290;};'use strict';var Sequelize=require('sequelize');module[_0x4c98('0x0')]={'version':{'type':Sequelize[_0x4c98('0x1')],'unique':_0x4c98('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 8dd2269..3679da5 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 _0x4ae3=['findAll','rows','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','Migration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x30922c,_0x5365e3){var _0x58ba06=function(_0x523458){while(--_0x523458){_0x30922c['push'](_0x30922c['shift']());}};_0x58ba06(++_0x5365e3);}(_0x4ae3,0x19a));var _0x34ae=function(_0x2b63c9,_0x9b77ef){_0x2b63c9=_0x2b63c9-0x0;var _0x5928c6=_0x4ae3[_0x2b63c9];return _0x5928c6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x34ae('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x34ae('0x1'));var BPromise=require(_0x34ae('0x2'));var Mustache=require(_0x34ae('0x3'));var util=require(_0x34ae('0x4'));var path=require('path');var sox=require(_0x34ae('0x5'));var csv=require('to-csv');var ejs=require(_0x34ae('0x6'));var fs=require('fs');var fs_extra=require(_0x34ae('0x7'));var _=require(_0x34ae('0x8'));var squel=require(_0x34ae('0x9'));var crypto=require('crypto');var jsforce=require(_0x34ae('0xa'));var deskjs=require(_0x34ae('0xb'));var toCsv=require(_0x34ae('0xc'));var querystring=require(_0x34ae('0xd'));var Papa=require(_0x34ae('0xe'));var Redis=require(_0x34ae('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x34ae('0x10'));var as=require(_0x34ae('0x11'));var hardwareService=require(_0x34ae('0x12'));var logger=require(_0x34ae('0x13'))(_0x34ae('0x14'));var utils=require('../../config/utils');var config=require(_0x34ae('0x15'));var licenseUtil=require(_0x34ae('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f1035,_0x1e7421){_0x1e7421=_0x1e7421||0xcc;return function(_0x3fa21c){if(_0x3fa21c){return _0x3f1035[_0x34ae('0x17')](_0x1e7421);}return _0x3f1035[_0x34ae('0x18')](_0x1e7421)[_0x34ae('0x19')]();};}function respondWithResult(_0x1693aa,_0x3fda91){_0x3fda91=_0x3fda91||0xc8;return function(_0x20f341){if(_0x20f341){return _0x1693aa[_0x34ae('0x18')](_0x3fda91)[_0x34ae('0x1a')](_0x20f341);}};}function respondWithFilteredResult(_0xe56a42,_0x1c9ef8){return function(_0xf53514){if(_0xf53514){var _0x4b4e12=typeof _0x1c9ef8[_0x34ae('0x1b')]===_0x34ae('0x1c')&&typeof _0x1c9ef8[_0x34ae('0x1d')]===_0x34ae('0x1c');var _0x98c5d=_0xf53514[_0x34ae('0x1e')];var _0x3c0999=_0x4b4e12?0x0:_0x1c9ef8[_0x34ae('0x1b')];var _0x15ccfc=_0x4b4e12?_0xf53514[_0x34ae('0x1e')]:_0x1c9ef8[_0x34ae('0x1b')]+_0x1c9ef8['limit'];var _0x433d81;if(_0x15ccfc>=_0x98c5d){_0x15ccfc=_0x98c5d;_0x433d81=0xc8;}else{_0x433d81=0xce;}_0xe56a42[_0x34ae('0x18')](_0x433d81);return _0xe56a42[_0x34ae('0x1f')](_0x34ae('0x20'),_0x3c0999+'-'+_0x15ccfc+'/'+_0x98c5d)['json'](_0xf53514);}return null;};}function patchUpdates(_0x3ed039){return function(_0x3bc937){try{jsonpatch[_0x34ae('0x21')](_0x3bc937,_0x3ed039,!![]);}catch(_0x4b13bd){return BPromise[_0x34ae('0x22')](_0x4b13bd);}return _0x3bc937[_0x34ae('0x23')]();};}function saveUpdates(_0x15e940,_0x5d8355){return function(_0x2a89f8){if(_0x2a89f8){return _0x2a89f8['update'](_0x15e940)[_0x34ae('0x24')](function(_0x489a6d){return _0x489a6d;});}return null;};}function removeEntity(_0x515e9c,_0x4fb114){return function(_0x46e7c7){if(_0x46e7c7){return _0x46e7c7[_0x34ae('0x25')]()[_0x34ae('0x24')](function(){_0x515e9c[_0x34ae('0x18')](0xcc)[_0x34ae('0x19')]();});}};}function handleEntityNotFound(_0x341f0d,_0x3500c8){return function(_0x28a5d5){if(!_0x28a5d5){_0x341f0d[_0x34ae('0x17')](0x194);}return _0x28a5d5;};}function handleError(_0x3d88ec,_0x508134){_0x508134=_0x508134||0x1f4;return function(_0x4240fc){logger[_0x34ae('0x26')](_0x4240fc[_0x34ae('0x27')]);if(_0x4240fc[_0x34ae('0x28')]){delete _0x4240fc[_0x34ae('0x28')];}_0x3d88ec[_0x34ae('0x18')](_0x508134)[_0x34ae('0x29')](_0x4240fc);};}exports['index']=function(_0x5d6b9a,_0x59bf3a){var _0x275c48={},_0x2ca34a={},_0x427edb={'count':0x0,'rows':[]};var _0x3ca1d1=_['map'](db[_0x34ae('0x2a')][_0x34ae('0x2b')],function(_0x54e87e){return{'name':_0x54e87e[_0x34ae('0x2c')],'type':_0x54e87e[_0x34ae('0x2d')][_0x34ae('0x2e')]};});_0x2ca34a[_0x34ae('0x2f')]=_[_0x34ae('0x30')](_0x3ca1d1,_0x34ae('0x28'));_0x2ca34a['query']=_['keys'](_0x5d6b9a[_0x34ae('0x31')]);_0x2ca34a[_0x34ae('0x32')]=_[_0x34ae('0x33')](_0x2ca34a[_0x34ae('0x2f')],_0x2ca34a[_0x34ae('0x31')]);_0x275c48['attributes']=_['intersection'](_0x2ca34a['model'],qs[_0x34ae('0x34')](_0x5d6b9a['query']['fields']));_0x275c48[_0x34ae('0x35')]=_0x275c48[_0x34ae('0x35')][_0x34ae('0x36')]?_0x275c48[_0x34ae('0x35')]:_0x2ca34a[_0x34ae('0x2f')];if(!_0x5d6b9a[_0x34ae('0x31')][_0x34ae('0x37')](_0x34ae('0x38'))){_0x275c48[_0x34ae('0x1d')]=qs[_0x34ae('0x1d')](_0x5d6b9a[_0x34ae('0x31')]['limit']);_0x275c48[_0x34ae('0x1b')]=qs['offset'](_0x5d6b9a[_0x34ae('0x31')]['offset']);}_0x275c48[_0x34ae('0x39')]=qs[_0x34ae('0x3a')](_0x5d6b9a['query'][_0x34ae('0x3a')]);_0x275c48[_0x34ae('0x3b')]=qs[_0x34ae('0x32')](_['pick'](_0x5d6b9a[_0x34ae('0x31')],_0x2ca34a[_0x34ae('0x32')]),_0x3ca1d1);if(_0x5d6b9a[_0x34ae('0x31')][_0x34ae('0x3c')]){_0x275c48['where']=_['merge'](_0x275c48['where'],{'$or':_[_0x34ae('0x30')](_0x3ca1d1,function(_0x31f72c){if(_0x31f72c[_0x34ae('0x2d')]!==_0x34ae('0x3d')){var _0x4f951c={};_0x4f951c[_0x31f72c[_0x34ae('0x28')]]={'$like':'%'+_0x5d6b9a[_0x34ae('0x31')][_0x34ae('0x3c')]+'%'};return _0x4f951c;}})});}_0x275c48=_[_0x34ae('0x3e')]({},_0x275c48,_0x5d6b9a[_0x34ae('0x3f')]);var _0x35e2c3={'where':_0x275c48[_0x34ae('0x3b')]};return db[_0x34ae('0x2a')]['count'](_0x35e2c3)[_0x34ae('0x24')](function(_0x188587){_0x427edb['count']=_0x188587;if(_0x5d6b9a[_0x34ae('0x31')][_0x34ae('0x40')]){_0x275c48[_0x34ae('0x41')]=[{'all':!![]}];}return db[_0x34ae('0x2a')][_0x34ae('0x42')](_0x275c48);})['then'](function(_0x8d3c6){_0x427edb[_0x34ae('0x43')]=_0x8d3c6;return _0x427edb;})[_0x34ae('0x24')](respondWithFilteredResult(_0x59bf3a,_0x275c48))['catch'](handleError(_0x59bf3a,null));}; \ No newline at end of file +var _0xcbc5=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','Migration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','merge','filter','options','includeAll','findAll','rows','catch','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x511667,_0x32bd10){var _0x25dec1=function(_0x10617f){while(--_0x10617f){_0x511667['push'](_0x511667['shift']());}};_0x25dec1(++_0x32bd10);}(_0xcbc5,0x7b));var _0x5cbc=function(_0x143d34,_0x462642){_0x143d34=_0x143d34-0x0;var _0x4234d3=_0xcbc5[_0x143d34];return _0x4234d3;};'use strict';var emlformat=require(_0x5cbc('0x0'));var rimraf=require(_0x5cbc('0x1'));var zipdir=require(_0x5cbc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5cbc('0x3'));var moment=require(_0x5cbc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5cbc('0x5'));var util=require(_0x5cbc('0x6'));var path=require(_0x5cbc('0x7'));var sox=require(_0x5cbc('0x8'));var csv=require(_0x5cbc('0x9'));var ejs=require(_0x5cbc('0xa'));var fs=require('fs');var fs_extra=require(_0x5cbc('0xb'));var _=require('lodash');var squel=require(_0x5cbc('0xc'));var crypto=require(_0x5cbc('0xd'));var jsforce=require(_0x5cbc('0xe'));var deskjs=require(_0x5cbc('0xf'));var toCsv=require(_0x5cbc('0x9'));var querystring=require(_0x5cbc('0x10'));var Papa=require('papaparse');var Redis=require(_0x5cbc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5cbc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cbc('0x13'))(_0x5cbc('0x14'));var utils=require(_0x5cbc('0x15'));var config=require(_0x5cbc('0x16'));var licenseUtil=require(_0x5cbc('0x17'));var db=require(_0x5cbc('0x18'))['db'];function respondWithStatusCode(_0x635070,_0x592f69){_0x592f69=_0x592f69||0xcc;return function(_0x32092b){if(_0x32092b){return _0x635070[_0x5cbc('0x19')](_0x592f69);}return _0x635070[_0x5cbc('0x1a')](_0x592f69)['end']();};}function respondWithResult(_0x52e790,_0x253f67){_0x253f67=_0x253f67||0xc8;return function(_0x409348){if(_0x409348){return _0x52e790['status'](_0x253f67)[_0x5cbc('0x1b')](_0x409348);}};}function respondWithFilteredResult(_0x6ceab,_0x35bbfb){return function(_0x15d772){if(_0x15d772){var _0x442303=typeof _0x35bbfb['offset']===_0x5cbc('0x1c')&&typeof _0x35bbfb[_0x5cbc('0x1d')]===_0x5cbc('0x1c');var _0x4884b2=_0x15d772[_0x5cbc('0x1e')];var _0x17b009=_0x442303?0x0:_0x35bbfb[_0x5cbc('0x1f')];var _0x113c3d=_0x442303?_0x15d772['count']:_0x35bbfb[_0x5cbc('0x1f')]+_0x35bbfb['limit'];var _0x3aa9df;if(_0x113c3d>=_0x4884b2){_0x113c3d=_0x4884b2;_0x3aa9df=0xc8;}else{_0x3aa9df=0xce;}_0x6ceab[_0x5cbc('0x1a')](_0x3aa9df);return _0x6ceab['set'](_0x5cbc('0x20'),_0x17b009+'-'+_0x113c3d+'/'+_0x4884b2)[_0x5cbc('0x1b')](_0x15d772);}return null;};}function patchUpdates(_0x1e9407){return function(_0x24c1b3){try{jsonpatch['apply'](_0x24c1b3,_0x1e9407,!![]);}catch(_0x2247e9){return BPromise[_0x5cbc('0x21')](_0x2247e9);}return _0x24c1b3[_0x5cbc('0x22')]();};}function saveUpdates(_0x3cfbcd,_0x290def){return function(_0x29d9a8){if(_0x29d9a8){return _0x29d9a8[_0x5cbc('0x23')](_0x3cfbcd)[_0x5cbc('0x24')](function(_0x47fb99){return _0x47fb99;});}return null;};}function removeEntity(_0x4a7832,_0x402bbe){return function(_0x5eeedd){if(_0x5eeedd){return _0x5eeedd[_0x5cbc('0x25')]()[_0x5cbc('0x24')](function(){_0x4a7832[_0x5cbc('0x1a')](0xcc)[_0x5cbc('0x26')]();});}};}function handleEntityNotFound(_0x9e3942,_0x4ebbf2){return function(_0x39645c){if(!_0x39645c){_0x9e3942[_0x5cbc('0x19')](0x194);}return _0x39645c;};}function handleError(_0x2e86dc,_0xa5a88a){_0xa5a88a=_0xa5a88a||0x1f4;return function(_0xf9150c){logger[_0x5cbc('0x27')](_0xf9150c['stack']);if(_0xf9150c[_0x5cbc('0x28')]){delete _0xf9150c['name'];}_0x2e86dc['status'](_0xa5a88a)[_0x5cbc('0x29')](_0xf9150c);};}exports[_0x5cbc('0x2a')]=function(_0x531f93,_0x1c6410){var _0x2f0603={},_0x4fc55f={},_0x59c55d={'count':0x0,'rows':[]};var _0x1487a1=_[_0x5cbc('0x2b')](db[_0x5cbc('0x2c')][_0x5cbc('0x2d')],function(_0xc2e7f3){return{'name':_0xc2e7f3[_0x5cbc('0x2e')],'type':_0xc2e7f3[_0x5cbc('0x2f')]['key']};});_0x4fc55f['model']=_['map'](_0x1487a1,_0x5cbc('0x28'));_0x4fc55f['query']=_['keys'](_0x531f93[_0x5cbc('0x30')]);_0x4fc55f[_0x5cbc('0x31')]=_[_0x5cbc('0x32')](_0x4fc55f[_0x5cbc('0x33')],_0x4fc55f[_0x5cbc('0x30')]);_0x2f0603[_0x5cbc('0x34')]=_[_0x5cbc('0x32')](_0x4fc55f[_0x5cbc('0x33')],qs[_0x5cbc('0x35')](_0x531f93[_0x5cbc('0x30')][_0x5cbc('0x35')]));_0x2f0603[_0x5cbc('0x34')]=_0x2f0603[_0x5cbc('0x34')]['length']?_0x2f0603['attributes']:_0x4fc55f[_0x5cbc('0x33')];if(!_0x531f93[_0x5cbc('0x30')][_0x5cbc('0x36')]('nolimit')){_0x2f0603[_0x5cbc('0x1d')]=qs[_0x5cbc('0x1d')](_0x531f93[_0x5cbc('0x30')]['limit']);_0x2f0603[_0x5cbc('0x1f')]=qs[_0x5cbc('0x1f')](_0x531f93[_0x5cbc('0x30')][_0x5cbc('0x1f')]);}_0x2f0603['order']=qs['sort'](_0x531f93[_0x5cbc('0x30')][_0x5cbc('0x37')]);_0x2f0603[_0x5cbc('0x38')]=qs[_0x5cbc('0x31')](_['pick'](_0x531f93[_0x5cbc('0x30')],_0x4fc55f[_0x5cbc('0x31')]),_0x1487a1);if(_0x531f93['query']['filter']){_0x2f0603[_0x5cbc('0x38')]=_[_0x5cbc('0x39')](_0x2f0603['where'],{'$or':_['map'](_0x1487a1,function(_0x518634){if(_0x518634[_0x5cbc('0x2f')]!=='VIRTUAL'){var _0x4c6719={};_0x4c6719[_0x518634[_0x5cbc('0x28')]]={'$like':'%'+_0x531f93[_0x5cbc('0x30')][_0x5cbc('0x3a')]+'%'};return _0x4c6719;}})});}_0x2f0603=_['merge']({},_0x2f0603,_0x531f93[_0x5cbc('0x3b')]);var _0x52967c={'where':_0x2f0603[_0x5cbc('0x38')]};return db[_0x5cbc('0x2c')][_0x5cbc('0x1e')](_0x52967c)[_0x5cbc('0x24')](function(_0x316e8a){_0x59c55d[_0x5cbc('0x1e')]=_0x316e8a;if(_0x531f93[_0x5cbc('0x30')][_0x5cbc('0x3c')]){_0x2f0603['include']=[{'all':!![]}];}return db[_0x5cbc('0x2c')][_0x5cbc('0x3d')](_0x2f0603);})[_0x5cbc('0x24')](function(_0x5a752a){_0x59c55d[_0x5cbc('0x3e')]=_0x5a752a;return _0x59c55d;})[_0x5cbc('0x24')](respondWithFilteredResult(_0x1c6410,_0x2f0603))[_0x5cbc('0x3f')](handleError(_0x1c6410,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a24636d..c208801 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 _0xc336=['rimraf','./migration.attributes','exports','define','Migration','lodash','util','../../config/logger','bluebird','path'];(function(_0x38d06d,_0x3d0554){var _0x8d75db=function(_0x1ae60){while(--_0x1ae60){_0x38d06d['push'](_0x38d06d['shift']());}};_0x8d75db(++_0x3d0554);}(_0xc336,0x87));var _0x6c33=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0xc336[_0x1d5400];return _0x21d9fe;};'use strict';var _=require(_0x6c33('0x0'));var util=require(_0x6c33('0x1'));var logger=require(_0x6c33('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c33('0x4'));var rimraf=require(_0x6c33('0x5'));var config=require('../../config/environment');var attributes=require(_0x6c33('0x6'));module[_0x6c33('0x7')]=function(_0x8bbe8e,_0x1ee7e1){return _0x8bbe8e[_0x6c33('0x8')](_0x6c33('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeae9=['api','moment','bluebird','request-promise','./migration.attributes','define','lodash','../../config/logger'];(function(_0x2b2d36,_0x2cf2d8){var _0x58be1b=function(_0x5a5338){while(--_0x5a5338){_0x2b2d36['push'](_0x2b2d36['shift']());}};_0x58be1b(++_0x2cf2d8);}(_0xeae9,0x13e));var _0x9eae=function(_0xb27862,_0x4843a0){_0xb27862=_0xb27862-0x0;var _0x2ca1d1=_0xeae9[_0xb27862];return _0x2ca1d1;};'use strict';var _=require(_0x9eae('0x0'));var util=require('util');var logger=require(_0x9eae('0x1'))(_0x9eae('0x2'));var moment=require(_0x9eae('0x3'));var BPromise=require(_0x9eae('0x4'));var rp=require(_0x9eae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9eae('0x6'));module['exports']=function(_0x1b1c09,_0x250f29){return _0x1b1c09[_0x9eae('0x7')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 7f2ec93..80d4fca 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 _0x8b29=['then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0xaf38e,_0xe122ae){var _0x306267=function(_0xbf7479){while(--_0xbf7479){_0xaf38e['push'](_0xaf38e['shift']());}};_0x306267(++_0xe122ae);}(_0x8b29,0xbe));var _0x98b2=function(_0x3e9b9,_0x2faabc){_0x3e9b9=_0x3e9b9-0x0;var _0x2fd2a0=_0x8b29[_0x3e9b9];return _0x2fd2a0;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ef5,_0x221cee,_0x2cd0cb){return new BPromise(function(_0x417ca6,_0x388827){return client[_0x98b2('0x9')](_0x3e7ef5,_0x2cd0cb)[_0x98b2('0xa')](function(_0x501b51){logger['info'](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));logger[_0x98b2('0xd')](_0x98b2('0xe'),_0x221cee,_0x98b2('0xc'),JSON[_0x98b2('0xf')](_0x501b51));if(_0x501b51['error']){if(_0x501b51[_0x98b2('0x10')][_0x98b2('0x11')]===0x1f4){logger['error'](_0x98b2('0xb'),_0x221cee,_0x501b51[_0x98b2('0x10')][_0x98b2('0x12')]);return _0x388827(_0x501b51['error']['message']);}logger[_0x98b2('0x10')]('Migration,\x20%s,\x20%s',_0x221cee,_0x501b51[_0x98b2('0x10')]['message']);return _0x417ca6(_0x501b51['error']['message']);}else{logger[_0x98b2('0x13')](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));_0x417ca6(_0x501b51['result']['message']);}})['catch'](function(_0x389d22){logger[_0x98b2('0x10')](_0x98b2('0xb'),_0x221cee,_0x389d22);_0x388827(_0x389d22);});});} \ No newline at end of file +var _0x2a41=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b945f,_0xc97ea2){var _0x3f8b64=function(_0x4f1ebf){while(--_0x4f1ebf){_0x5b945f['push'](_0x5b945f['shift']());}};_0x3f8b64(++_0xc97ea2);}(_0x2a41,0x126));var _0x12a4=function(_0x4c4fda,_0x3b1a99){_0x4c4fda=_0x4c4fda-0x0;var _0x1a9bc4=_0x2a41[_0x4c4fda];return _0x1a9bc4;};'use strict';var _=require(_0x12a4('0x0'));var util=require('util');var moment=require(_0x12a4('0x1'));var BPromise=require(_0x12a4('0x2'));var rs=require(_0x12a4('0x3'));var fs=require('fs');var Redis=require(_0x12a4('0x4'));var db=require(_0x12a4('0x5'))['db'];var utils=require(_0x12a4('0x6'));var logger=require(_0x12a4('0x7'))(_0x12a4('0x8'));var config=require(_0x12a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x12a4('0xa')][_0x12a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58fffc,_0x5d2353,_0x2042cc){return new BPromise(function(_0x5ae867,_0x23bb59){return client[_0x12a4('0xc')](_0x58fffc,_0x2042cc)[_0x12a4('0xd')](function(_0x38d894){logger[_0x12a4('0xe')]('Migration,\x20%s,\x20%s',_0x5d2353,_0x12a4('0xf'));logger[_0x12a4('0x10')](_0x12a4('0x11'),_0x5d2353,_0x12a4('0xf'),JSON[_0x12a4('0x12')](_0x38d894));if(_0x38d894[_0x12a4('0x13')]){if(_0x38d894[_0x12a4('0x13')][_0x12a4('0x14')]===0x1f4){logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x38d894[_0x12a4('0x13')][_0x12a4('0x16')]);return _0x23bb59(_0x38d894['error'][_0x12a4('0x16')]);}logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x38d894[_0x12a4('0x13')][_0x12a4('0x16')]);return _0x5ae867(_0x38d894['error']['message']);}else{logger[_0x12a4('0xe')](_0x12a4('0x15'),_0x5d2353,_0x12a4('0xf'));_0x5ae867(_0x38d894[_0x12a4('0x17')]['message']);}})[_0x12a4('0x18')](function(_0x28d311){logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x28d311);_0x23bb59(_0x28d311);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 00678d0..71a92eb 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 _0x4dcb=['isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2be059,_0x1851df){var _0x44b71e=function(_0x3e3414){while(--_0x3e3414){_0x2be059['push'](_0x2be059['shift']());}};_0x44b71e(++_0x1851df);}(_0x4dcb,0x186));var _0xb4dc=function(_0x2bc049,_0x256396){_0x2bc049=_0x2bc049-0x0;var _0x572585=_0x4dcb[_0x2bc049];return _0x572585;};'use strict';var multer=require('multer');var util=require(_0xb4dc('0x0'));var path=require(_0xb4dc('0x1'));var timeout=require(_0xb4dc('0x2'));var express=require(_0xb4dc('0x3'));var router=express[_0xb4dc('0x4')]();var fs_extra=require(_0xb4dc('0x5'));var auth=require(_0xb4dc('0x6'));var interaction=require(_0xb4dc('0x7'));var config=require(_0xb4dc('0x8'));var controller=require('./network.controller');router['get']('/',auth[_0xb4dc('0x9')](),controller['index']);router[_0xb4dc('0xa')](_0xb4dc('0xb'),auth[_0xb4dc('0x9')](),controller[_0xb4dc('0xc')]);router[_0xb4dc('0xd')]('/',auth[_0xb4dc('0x9')](),controller['create']);router[_0xb4dc('0xe')](_0xb4dc('0xb'),auth[_0xb4dc('0x9')](),controller[_0xb4dc('0xf')]);router[_0xb4dc('0x10')](_0xb4dc('0xb'),auth[_0xb4dc('0x9')](),controller[_0xb4dc('0x11')]);module[_0xb4dc('0x12')]=router; \ No newline at end of file +var _0xf03a=['/:id','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','show','post','create','put','update','delete'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0xf03a,0x1a0));var _0xaf03=function(_0x264b91,_0x9c8a83){_0x264b91=_0x264b91-0x0;var _0x5c562d=_0xf03a[_0x264b91];return _0x5c562d;};'use strict';var multer=require('multer');var util=require(_0xaf03('0x0'));var path=require(_0xaf03('0x1'));var timeout=require(_0xaf03('0x2'));var express=require(_0xaf03('0x3'));var router=express['Router']();var fs_extra=require(_0xaf03('0x4'));var auth=require(_0xaf03('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf03('0x6'));var controller=require(_0xaf03('0x7'));router[_0xaf03('0x8')]('/',auth[_0xaf03('0x9')](),controller['index']);router[_0xaf03('0x8')]('/:id',auth[_0xaf03('0x9')](),controller[_0xaf03('0xa')]);router[_0xaf03('0xb')]('/',auth[_0xaf03('0x9')](),controller[_0xaf03('0xc')]);router[_0xaf03('0xd')]('/:id',auth[_0xaf03('0x9')](),controller[_0xaf03('0xe')]);router[_0xaf03('0xf')](_0xaf03('0x10'),auth[_0xaf03('0x9')](),controller['destroy']);module[_0xaf03('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 6c4fb3d..c1b924b 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 _0xd600=['localnet','turn','STRING','sequelize','exports','ENUM'];(function(_0x289092,_0x2fc156){var _0x16be02=function(_0x12c434){while(--_0x12c434){_0x289092['push'](_0x289092['shift']());}};_0x16be02(++_0x2fc156);}(_0xd600,0x1e3));var _0x0d60=function(_0x545c96,_0x377003){_0x545c96=_0x545c96-0x0;var _0x3d8c1f=_0xd600[_0x545c96];return _0x3d8c1f;};'use strict';var Sequelize=require(_0x0d60('0x0'));module[_0x0d60('0x1')]={'type':{'type':Sequelize[_0x0d60('0x2')](_0x0d60('0x3'),'externip','stun',_0x0d60('0x4'))},'value':{'type':Sequelize[_0x0d60('0x5')]},'username':{'type':Sequelize[_0x0d60('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x959f=['stun','turn','STRING','sequelize','localnet','externip'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x959f,0xc9));var _0xf959=function(_0x3d3fa1,_0x2624da){_0x3d3fa1=_0x3d3fa1-0x0;var _0x3cd49a=_0x959f[_0x3d3fa1];return _0x3cd49a;};'use strict';var Sequelize=require(_0xf959('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf959('0x1'),_0xf959('0x2'),_0xf959('0x3'),_0xf959('0x4'))},'value':{'type':Sequelize[_0xf959('0x5')]},'username':{'type':Sequelize[_0xf959('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index f17e807..6ac3a57 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 _0x9bfe=['chan_sip.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','zip-dir','fast-json-patch','moment','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/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','Network','find','create','sequelize','transaction','body','toUpperCase','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','join','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','format','toLowerCase'];(function(_0x250a15,_0xa91c1c){var _0xef6341=function(_0xbbf90a){while(--_0xbbf90a){_0x250a15['push'](_0x250a15['shift']());}};_0xef6341(++_0xa91c1c);}(_0x9bfe,0xdf));var _0xe9bf=function(_0x3b08d8,_0x831706){_0x3b08d8=_0x3b08d8-0x0;var _0x162f82=_0x9bfe[_0x3b08d8];return _0x162f82;};'use strict';var emlformat=require(_0xe9bf('0x0'));var rimraf=require(_0xe9bf('0x1'));var zipdir=require(_0xe9bf('0x2'));var jsonpatch=require(_0xe9bf('0x3'));var rp=require('request-promise');var moment=require(_0xe9bf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9bf('0x5'));var util=require(_0xe9bf('0x6'));var path=require(_0xe9bf('0x7'));var sox=require(_0xe9bf('0x8'));var csv=require(_0xe9bf('0x9'));var ejs=require(_0xe9bf('0xa'));var fs=require('fs');var fs_extra=require(_0xe9bf('0xb'));var _=require(_0xe9bf('0xc'));var squel=require(_0xe9bf('0xd'));var crypto=require(_0xe9bf('0xe'));var jsforce=require(_0xe9bf('0xf'));var deskjs=require(_0xe9bf('0x10'));var toCsv=require(_0xe9bf('0x9'));var querystring=require(_0xe9bf('0x11'));var Papa=require(_0xe9bf('0x12'));var Redis=require(_0xe9bf('0x13'));var authService=require(_0xe9bf('0x14'));var qs=require(_0xe9bf('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9bf('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe9bf('0x17'));var config=require(_0xe9bf('0x18'));var licenseUtil=require(_0xe9bf('0x19'));var db=require(_0xe9bf('0x1a'))['db'];var jayson=require(_0xe9bf('0x1b'));var client=jayson[_0xe9bf('0x1c')][_0xe9bf('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x58887e,_0x3f679a,_0xc950e3,_0x2402cb){return new BPromise(function(_0x511e18,_0x3d5bf9){var _0x35945a=_0x2402cb||client;return _0x35945a['request'](_0x58887e,_0xc950e3)['then'](function(_0x44531c){logger[_0xe9bf('0x1e')](_0xe9bf('0x1f'),_0x3f679a,_0xe9bf('0x20'));logger[_0xe9bf('0x21')](_0xe9bf('0x22'),_0x3f679a,_0xe9bf('0x20'),JSON[_0xe9bf('0x23')](_0x44531c));if(_0x44531c[_0xe9bf('0x24')]){if(_0x44531c['error'][_0xe9bf('0x25')]===0x1f4){logger[_0xe9bf('0x24')](_0xe9bf('0x1f'),_0x3f679a,_0x44531c[_0xe9bf('0x24')][_0xe9bf('0x26')]);return _0x3d5bf9(_0x44531c[_0xe9bf('0x24')]['message']);}logger[_0xe9bf('0x24')](_0xe9bf('0x1f'),_0x3f679a,_0x44531c[_0xe9bf('0x24')][_0xe9bf('0x26')]);return _0x511e18(_0x44531c[_0xe9bf('0x24')][_0xe9bf('0x26')]);}else{logger[_0xe9bf('0x1e')](_0xe9bf('0x1f'),_0x3f679a,_0xe9bf('0x20'));_0x511e18(_0x44531c['result'][_0xe9bf('0x26')]);}})[_0xe9bf('0x27')](function(_0x12fff6){logger[_0xe9bf('0x24')](_0xe9bf('0x1f'),_0x3f679a,_0x12fff6);_0x3d5bf9(_0x12fff6);});});}function respondWithStatusCode(_0x5630ae,_0x508250){_0x508250=_0x508250||0xcc;return function(_0x4cbaf0){if(_0x4cbaf0){return _0x5630ae[_0xe9bf('0x28')](_0x508250);}return _0x5630ae[_0xe9bf('0x29')](_0x508250)[_0xe9bf('0x2a')]();};}function respondWithResult(_0x426779,_0x1c7aa0){_0x1c7aa0=_0x1c7aa0||0xc8;return function(_0xc89e8){if(_0xc89e8){return _0x426779[_0xe9bf('0x29')](_0x1c7aa0)[_0xe9bf('0x2b')](_0xc89e8);}};}function respondWithFilteredResult(_0x4f8f57,_0x39d97d){return function(_0x5c10db){if(_0x5c10db){var _0x365b15=typeof _0x39d97d[_0xe9bf('0x2c')]===_0xe9bf('0x2d')&&typeof _0x39d97d['limit']===_0xe9bf('0x2d');var _0x771ae=_0x5c10db[_0xe9bf('0x2e')];var _0x2b0481=_0x365b15?0x0:_0x39d97d[_0xe9bf('0x2c')];var _0x29e15e=_0x365b15?_0x5c10db[_0xe9bf('0x2e')]:_0x39d97d['offset']+_0x39d97d['limit'];var _0x3ca5b5;if(_0x29e15e>=_0x771ae){_0x29e15e=_0x771ae;_0x3ca5b5=0xc8;}else{_0x3ca5b5=0xce;}_0x4f8f57[_0xe9bf('0x29')](_0x3ca5b5);return _0x4f8f57['set'](_0xe9bf('0x2f'),_0x2b0481+'-'+_0x29e15e+'/'+_0x771ae)[_0xe9bf('0x2b')](_0x5c10db);}return null;};}function patchUpdates(_0x53156f){return function(_0x54a5ba){try{jsonpatch[_0xe9bf('0x30')](_0x54a5ba,_0x53156f,!![]);}catch(_0x373db1){return BPromise[_0xe9bf('0x31')](_0x373db1);}return _0x54a5ba[_0xe9bf('0x32')]();};}function saveUpdates(_0x3c6ca5,_0x2f85dd){return function(_0x19a629){if(_0x19a629){return _0x19a629[_0xe9bf('0x33')](_0x3c6ca5)[_0xe9bf('0x34')](function(_0x35a156){return _0x35a156;});}return null;};}function removeEntity(_0x5cb12d,_0x38544b){return function(_0x234633){if(_0x234633){return _0x234633[_0xe9bf('0x35')]()[_0xe9bf('0x34')](function(){_0x5cb12d[_0xe9bf('0x29')](0xcc)[_0xe9bf('0x2a')]();});}};}function handleEntityNotFound(_0x54f7f2,_0x3a2c6a){return function(_0x10cdf6){if(!_0x10cdf6){_0x54f7f2['sendStatus'](0x194);}return _0x10cdf6;};}function handleError(_0x3505c2,_0x275057){_0x275057=_0x275057||0x1f4;return function(_0x2dfde6){logger[_0xe9bf('0x24')](_0x2dfde6[_0xe9bf('0x36')]);if(_0x2dfde6['name']){delete _0x2dfde6[_0xe9bf('0x37')];}_0x3505c2[_0xe9bf('0x29')](_0x275057)['send'](_0x2dfde6);};}exports[_0xe9bf('0x38')]=function(_0x14b028,_0x326ec2){var _0x3503b8={},_0x4c92ed={},_0x2290d1={'count':0x0,'rows':[]};var _0xf27cdf=_[_0xe9bf('0x39')](db['Network'][_0xe9bf('0x3a')],function(_0x2fd7e8){return{'name':_0x2fd7e8[_0xe9bf('0x3b')],'type':_0x2fd7e8[_0xe9bf('0x3c')][_0xe9bf('0x3d')]};});_0x4c92ed[_0xe9bf('0x3e')]=_['map'](_0xf27cdf,_0xe9bf('0x37'));_0x4c92ed[_0xe9bf('0x3f')]=_[_0xe9bf('0x40')](_0x14b028[_0xe9bf('0x3f')]);_0x4c92ed[_0xe9bf('0x41')]=_['intersection'](_0x4c92ed[_0xe9bf('0x3e')],_0x4c92ed['query']);_0x3503b8[_0xe9bf('0x42')]=_[_0xe9bf('0x43')](_0x4c92ed['model'],qs[_0xe9bf('0x44')](_0x14b028[_0xe9bf('0x3f')][_0xe9bf('0x44')]));_0x3503b8[_0xe9bf('0x42')]=_0x3503b8[_0xe9bf('0x42')][_0xe9bf('0x45')]?_0x3503b8['attributes']:_0x4c92ed[_0xe9bf('0x3e')];if(!_0x14b028['query'][_0xe9bf('0x46')](_0xe9bf('0x47'))){_0x3503b8[_0xe9bf('0x48')]=qs['limit'](_0x14b028[_0xe9bf('0x3f')][_0xe9bf('0x48')]);_0x3503b8['offset']=qs[_0xe9bf('0x2c')](_0x14b028[_0xe9bf('0x3f')][_0xe9bf('0x2c')]);}_0x3503b8['order']=qs[_0xe9bf('0x49')](_0x14b028['query'][_0xe9bf('0x49')]);_0x3503b8[_0xe9bf('0x4a')]=qs[_0xe9bf('0x41')](_[_0xe9bf('0x4b')](_0x14b028[_0xe9bf('0x3f')],_0x4c92ed[_0xe9bf('0x41')]),_0xf27cdf);if(_0x14b028['query'][_0xe9bf('0x4c')]){_0x3503b8[_0xe9bf('0x4a')]=_[_0xe9bf('0x4d')](_0x3503b8[_0xe9bf('0x4a')],{'$or':_[_0xe9bf('0x39')](_0xf27cdf,function(_0x43351a){if(_0x43351a[_0xe9bf('0x3c')]!==_0xe9bf('0x4e')){var _0x5a3a37={};_0x5a3a37[_0x43351a[_0xe9bf('0x37')]]={'$like':'%'+_0x14b028[_0xe9bf('0x3f')]['filter']+'%'};return _0x5a3a37;}})});}_0x3503b8=_[_0xe9bf('0x4d')]({},_0x3503b8,_0x14b028[_0xe9bf('0x4f')]);var _0x5be82a={'where':_0x3503b8['where']};return db['Network']['count'](_0x5be82a)[_0xe9bf('0x34')](function(_0x32d6a4){_0x2290d1[_0xe9bf('0x2e')]=_0x32d6a4;if(_0x14b028[_0xe9bf('0x3f')][_0xe9bf('0x50')]){_0x3503b8[_0xe9bf('0x51')]=[{'all':!![]}];}return db['Network'][_0xe9bf('0x52')](_0x3503b8);})[_0xe9bf('0x34')](function(_0x1c8aeb){_0x2290d1[_0xe9bf('0x53')]=_0x1c8aeb;return _0x2290d1;})['then'](respondWithFilteredResult(_0x326ec2,_0x3503b8))[_0xe9bf('0x27')](handleError(_0x326ec2,null));};exports['show']=function(_0x44797f,_0x37c3c1){var _0x555404={'raw':!![],'where':{'id':_0x44797f[_0xe9bf('0x54')]['id']}},_0x16016a={};_0x16016a[_0xe9bf('0x3e')]=_[_0xe9bf('0x40')](db[_0xe9bf('0x55')][_0xe9bf('0x3a')]);_0x16016a[_0xe9bf('0x3f')]=_[_0xe9bf('0x40')](_0x44797f[_0xe9bf('0x3f')]);_0x16016a[_0xe9bf('0x41')]=_[_0xe9bf('0x43')](_0x16016a[_0xe9bf('0x3e')],_0x16016a[_0xe9bf('0x3f')]);_0x555404[_0xe9bf('0x42')]=_['intersection'](_0x16016a[_0xe9bf('0x3e')],qs[_0xe9bf('0x44')](_0x44797f[_0xe9bf('0x3f')][_0xe9bf('0x44')]));_0x555404[_0xe9bf('0x42')]=_0x555404[_0xe9bf('0x42')][_0xe9bf('0x45')]?_0x555404[_0xe9bf('0x42')]:_0x16016a['model'];if(_0x44797f[_0xe9bf('0x3f')][_0xe9bf('0x50')]){_0x555404[_0xe9bf('0x51')]=[{'all':!![]}];}_0x555404=_[_0xe9bf('0x4d')]({},_0x555404,_0x44797f[_0xe9bf('0x4f')]);return db[_0xe9bf('0x55')][_0xe9bf('0x56')](_0x555404)[_0xe9bf('0x34')](handleEntityNotFound(_0x37c3c1,null))[_0xe9bf('0x34')](respondWithResult(_0x37c3c1,null))[_0xe9bf('0x27')](handleError(_0x37c3c1,null));};exports[_0xe9bf('0x57')]=function(_0x1f2b24,_0x1cb825,_0x190cc2){var _0x3bc98c;return db[_0xe9bf('0x58')][_0xe9bf('0x59')](function(_0x331c46){return db[_0xe9bf('0x55')][_0xe9bf('0x57')](_0x1f2b24['body'],{'raw':!![]})[_0xe9bf('0x34')](function(_0x4ab4f2){_0x3bc98c=_0x4ab4f2;return db[_0xe9bf('0x55')]['findAll']({'where':{'type':_0x1f2b24[_0xe9bf('0x5a')][_0xe9bf('0x3c')]},'raw':!![]});})[_0xe9bf('0x34')](function(_0x4d8602){if(_0x3bc98c[_0xe9bf('0x3c')][_0xe9bf('0x5b')]()=='STUN'){var _0x8b4974=fs[_0xe9bf('0x5c')](path['join'](config['root'],_0xe9bf('0x5d')),_0xe9bf('0x5e'));var _0xfcaff8=ejs[_0xe9bf('0x5f')](_0x8b4974,{'networks':_0x4d8602||[]});fs[_0xe9bf('0x60')](_0xe9bf('0x61'),_0xfcaff8);return respondWithRpcPromise('Reload',_0xe9bf('0x57'),{'module':_0xe9bf('0x62')});}else if(_0x3bc98c[_0xe9bf('0x3c')][_0xe9bf('0x5b')]()==_0xe9bf('0x63')){var _0x8f94d6=fs['readFileSync'](path[_0xe9bf('0x64')](config[_0xe9bf('0x65')],_0xe9bf('0x66')),'utf8');var _0x49c4f1=ejs[_0xe9bf('0x5f')](_0x8f94d6,{'networks':_0x4d8602||[]});fs[_0xe9bf('0x60')](_0xe9bf('0x67'),_0x49c4f1);return respondWithRpcPromise(_0xe9bf('0x68'),'create',{'module':'res_stun_monitor.so'});}else{var _0x538349=fs[_0xe9bf('0x5c')](path['join'](config['root'],'server/files/templates/network.ejs'),_0xe9bf('0x5e'));var _0xce555d=ejs[_0xe9bf('0x5f')](_0x538349,{'networks':_0x4d8602||[]});fs[_0xe9bf('0x60')](util[_0xe9bf('0x69')]('/etc/asterisk/sip_xcally_%s.conf',_0x1f2b24[_0xe9bf('0x5a')][_0xe9bf('0x3c')][_0xe9bf('0x6a')]()),_0xce555d);return respondWithRpcPromise(_0xe9bf('0x68'),_0xe9bf('0x57'),{'module':_0xe9bf('0x6b')});}return null;})['then'](function(){return _0x3bc98c;});})[_0xe9bf('0x34')](respondWithResult(_0x1cb825,0xc9))[_0xe9bf('0x27')](handleError(_0x1cb825,null));};exports[_0xe9bf('0x33')]=function(_0x16d554,_0x5efab4,_0x438cf9){var _0x292545;return db[_0xe9bf('0x58')]['transaction'](function(_0x4ce01c){return db[_0xe9bf('0x55')]['find']({'where':{'id':_0x16d554[_0xe9bf('0x54')]['id']}})[_0xe9bf('0x34')](handleEntityNotFound(_0x5efab4,null))[_0xe9bf('0x34')](saveUpdates(_0x16d554['body'],null))[_0xe9bf('0x34')](function(_0x5c137f){if(_0x5c137f){_0x292545=_0x5c137f;return db[_0xe9bf('0x55')]['findAll']({'where':{'type':_0x292545[_0xe9bf('0x3c')]},'raw':!![]});}return null;})[_0xe9bf('0x34')](function(_0x57c944){if(_0x292545[_0xe9bf('0x3c')][_0xe9bf('0x5b')]()=='STUN'){var _0x38eb82=fs['readFileSync'](path[_0xe9bf('0x64')](config[_0xe9bf('0x65')],_0xe9bf('0x5d')),_0xe9bf('0x5e'));var _0x1b1cb7=ejs[_0xe9bf('0x5f')](_0x38eb82,{'networks':_0x57c944||[]});fs[_0xe9bf('0x60')](_0xe9bf('0x61'),_0x1b1cb7);return respondWithRpcPromise(_0xe9bf('0x68'),_0xe9bf('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x292545[_0xe9bf('0x3c')][_0xe9bf('0x5b')]()==_0xe9bf('0x63')){var _0x321987=fs[_0xe9bf('0x5c')](path[_0xe9bf('0x64')](config[_0xe9bf('0x65')],_0xe9bf('0x66')),_0xe9bf('0x5e'));var _0x17d18f=ejs[_0xe9bf('0x5f')](_0x321987,{'networks':_0x57c944||[]});fs[_0xe9bf('0x60')](_0xe9bf('0x67'),_0x17d18f);return respondWithRpcPromise(_0xe9bf('0x68'),'update',{'module':_0xe9bf('0x62')});}else{var _0x309de2=fs['readFileSync'](path[_0xe9bf('0x64')](config[_0xe9bf('0x65')],_0xe9bf('0x6c')),_0xe9bf('0x5e'));var _0x5a594d=ejs[_0xe9bf('0x5f')](_0x309de2,{'networks':_0x57c944||[]});fs[_0xe9bf('0x60')](util[_0xe9bf('0x69')](_0xe9bf('0x6d'),_0x16d554[_0xe9bf('0x5a')]['type'][_0xe9bf('0x6a')]()),_0x5a594d);return respondWithRpcPromise(_0xe9bf('0x68'),_0xe9bf('0x33'),{'module':'chan_sip.so'});}return null;})[_0xe9bf('0x34')](function(_0x8b0574){if(_0x8b0574){return _0x292545;}return null;});})[_0xe9bf('0x34')](respondWithResult(_0x5efab4,null))[_0xe9bf('0x27')](handleError(_0x5efab4,null));};exports[_0xe9bf('0x35')]=function(_0x4e67d6,_0x4679d6,_0x56cbd9){var _0x585088;return db[_0xe9bf('0x55')][_0xe9bf('0x56')]({'where':{'id':_0x4e67d6[_0xe9bf('0x54')]['id']}})['then'](function(_0x249ecc){_0x585088=_0x249ecc;return _0x249ecc;})[_0xe9bf('0x34')](handleEntityNotFound(_0x4679d6,null))[_0xe9bf('0x34')](removeEntity(_0x4679d6,null))[_0xe9bf('0x34')](function(){if(_0x585088){return db[_0xe9bf('0x55')][_0xe9bf('0x52')]({'where':{'type':_0x585088[_0xe9bf('0x3c')]},'raw':!![]});}})['then'](function(_0x2c7ba5){if(_0x585088[_0xe9bf('0x3c')]['toUpperCase']()=='STUN'){var _0x1b1131=fs[_0xe9bf('0x5c')](path[_0xe9bf('0x64')](config['root'],_0xe9bf('0x5d')),_0xe9bf('0x5e'));var _0x3623ce=ejs[_0xe9bf('0x5f')](_0x1b1131,{'networks':_0x2c7ba5||[]});fs[_0xe9bf('0x60')]('/etc/asterisk/stun_xcally.conf',_0x3623ce);return respondWithRpcPromise(_0xe9bf('0x68'),_0xe9bf('0x35'),{'module':'res_stun_monitor.so'});}else if(_0x585088['type']['toUpperCase']()==_0xe9bf('0x63')){var _0x499b7d=fs[_0xe9bf('0x5c')](path[_0xe9bf('0x64')](config[_0xe9bf('0x65')],_0xe9bf('0x66')),_0xe9bf('0x5e'));var _0x238615=ejs[_0xe9bf('0x5f')](_0x499b7d,{'networks':_0x2c7ba5||[]});fs[_0xe9bf('0x60')](_0xe9bf('0x67'),_0x238615);return respondWithRpcPromise(_0xe9bf('0x68'),_0xe9bf('0x35'),{'module':_0xe9bf('0x62')});}else{var _0x2505e1=fs[_0xe9bf('0x5c')](path[_0xe9bf('0x64')](config[_0xe9bf('0x65')],'server/files/templates/network.ejs'),_0xe9bf('0x5e'));var _0x5c087=ejs[_0xe9bf('0x5f')](_0x2505e1,{'networks':_0x2c7ba5||[]});fs[_0xe9bf('0x60')](util[_0xe9bf('0x69')](_0xe9bf('0x6d'),_0x4e67d6['body'][_0xe9bf('0x3c')][_0xe9bf('0x6a')]()),_0x5c087);return respondWithRpcPromise(_0xe9bf('0x68'),_0xe9bf('0x35'),{'module':_0xe9bf('0x6b')});}return null;})[_0xe9bf('0x27')](handleError(_0x4679d6,null));}; \ No newline at end of file +var _0x9bae=['render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','name','send','index','map','Network','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','fields','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8'];(function(_0x286cc9,_0x509d5e){var _0x3a6f79=function(_0x1b97a2){while(--_0x1b97a2){_0x286cc9['push'](_0x286cc9['shift']());}};_0x3a6f79(++_0x509d5e);}(_0x9bae,0x7c));var _0xe9ba=function(_0x14f071,_0x3291be){_0x14f071=_0x14f071-0x0;var _0x1007d0=_0x9bae[_0x14f071];return _0x1007d0;};'use strict';var emlformat=require(_0xe9ba('0x0'));var rimraf=require(_0xe9ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9ba('0x2'));var rp=require(_0xe9ba('0x3'));var moment=require(_0xe9ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9ba('0x5'));var util=require(_0xe9ba('0x6'));var path=require(_0xe9ba('0x7'));var sox=require('sox');var csv=require(_0xe9ba('0x8'));var ejs=require(_0xe9ba('0x9'));var fs=require('fs');var fs_extra=require(_0xe9ba('0xa'));var _=require(_0xe9ba('0xb'));var squel=require(_0xe9ba('0xc'));var crypto=require(_0xe9ba('0xd'));var jsforce=require(_0xe9ba('0xe'));var deskjs=require(_0xe9ba('0xf'));var toCsv=require(_0xe9ba('0x8'));var querystring=require(_0xe9ba('0x10'));var Papa=require('papaparse');var Redis=require(_0xe9ba('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe9ba('0x12'));var as=require(_0xe9ba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9ba('0x14'))(_0xe9ba('0x15'));var utils=require(_0xe9ba('0x16'));var config=require(_0xe9ba('0x17'));var licenseUtil=require(_0xe9ba('0x18'));var db=require(_0xe9ba('0x19'))['db'];var jayson=require(_0xe9ba('0x1a'));var client=jayson[_0xe9ba('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ff854,_0x6edc7,_0x137af5,_0x1ea690){return new BPromise(function(_0x517bdd,_0x482dbc){var _0x34bae6=_0x1ea690||client;return _0x34bae6[_0xe9ba('0x1c')](_0x2ff854,_0x137af5)[_0xe9ba('0x1d')](function(_0x48247d){logger[_0xe9ba('0x1e')](_0xe9ba('0x1f'),_0x6edc7,_0xe9ba('0x20'));logger[_0xe9ba('0x21')](_0xe9ba('0x22'),_0x6edc7,_0xe9ba('0x20'),JSON[_0xe9ba('0x23')](_0x48247d));if(_0x48247d[_0xe9ba('0x24')]){if(_0x48247d[_0xe9ba('0x24')][_0xe9ba('0x25')]===0x1f4){logger['error'](_0xe9ba('0x1f'),_0x6edc7,_0x48247d[_0xe9ba('0x24')][_0xe9ba('0x26')]);return _0x482dbc(_0x48247d['error'][_0xe9ba('0x26')]);}logger['error']('Network,\x20%s,\x20%s',_0x6edc7,_0x48247d[_0xe9ba('0x24')][_0xe9ba('0x26')]);return _0x517bdd(_0x48247d[_0xe9ba('0x24')][_0xe9ba('0x26')]);}else{logger[_0xe9ba('0x1e')](_0xe9ba('0x1f'),_0x6edc7,_0xe9ba('0x20'));_0x517bdd(_0x48247d[_0xe9ba('0x27')][_0xe9ba('0x26')]);}})[_0xe9ba('0x28')](function(_0x36d65b){logger[_0xe9ba('0x24')]('Network,\x20%s,\x20%s',_0x6edc7,_0x36d65b);_0x482dbc(_0x36d65b);});});}function respondWithStatusCode(_0x27fd40,_0xbe7e8c){_0xbe7e8c=_0xbe7e8c||0xcc;return function(_0x420051){if(_0x420051){return _0x27fd40[_0xe9ba('0x29')](_0xbe7e8c);}return _0x27fd40[_0xe9ba('0x2a')](_0xbe7e8c)[_0xe9ba('0x2b')]();};}function respondWithResult(_0x90b5a8,_0x1a1056){_0x1a1056=_0x1a1056||0xc8;return function(_0x5a60f1){if(_0x5a60f1){return _0x90b5a8[_0xe9ba('0x2a')](_0x1a1056)[_0xe9ba('0x2c')](_0x5a60f1);}};}function respondWithFilteredResult(_0x162fef,_0x3a775c){return function(_0xfcd2d1){if(_0xfcd2d1){var _0x4ec446=typeof _0x3a775c['offset']==='undefined'&&typeof _0x3a775c[_0xe9ba('0x2d')]===_0xe9ba('0x2e');var _0xa3d510=_0xfcd2d1[_0xe9ba('0x2f')];var _0x34d206=_0x4ec446?0x0:_0x3a775c['offset'];var _0x1247db=_0x4ec446?_0xfcd2d1[_0xe9ba('0x2f')]:_0x3a775c[_0xe9ba('0x30')]+_0x3a775c[_0xe9ba('0x2d')];var _0x4dcfd9;if(_0x1247db>=_0xa3d510){_0x1247db=_0xa3d510;_0x4dcfd9=0xc8;}else{_0x4dcfd9=0xce;}_0x162fef[_0xe9ba('0x2a')](_0x4dcfd9);return _0x162fef['set'](_0xe9ba('0x31'),_0x34d206+'-'+_0x1247db+'/'+_0xa3d510)[_0xe9ba('0x2c')](_0xfcd2d1);}return null;};}function patchUpdates(_0x354b80){return function(_0x26d057){try{jsonpatch[_0xe9ba('0x32')](_0x26d057,_0x354b80,!![]);}catch(_0x26d53a){return BPromise[_0xe9ba('0x33')](_0x26d53a);}return _0x26d057['save']();};}function saveUpdates(_0x4d3055,_0x163b41){return function(_0x57273b){if(_0x57273b){return _0x57273b[_0xe9ba('0x34')](_0x4d3055)['then'](function(_0x429738){return _0x429738;});}return null;};}function removeEntity(_0x11436f,_0x2a671e){return function(_0x58265e){if(_0x58265e){return _0x58265e['destroy']()[_0xe9ba('0x1d')](function(){_0x11436f[_0xe9ba('0x2a')](0xcc)[_0xe9ba('0x2b')]();});}};}function handleEntityNotFound(_0x5b285b,_0x3f11e3){return function(_0x1f16b8){if(!_0x1f16b8){_0x5b285b[_0xe9ba('0x29')](0x194);}return _0x1f16b8;};}function handleError(_0x41b32e,_0xa3e040){_0xa3e040=_0xa3e040||0x1f4;return function(_0x24bc78){logger['error'](_0x24bc78['stack']);if(_0x24bc78[_0xe9ba('0x35')]){delete _0x24bc78['name'];}_0x41b32e['status'](_0xa3e040)[_0xe9ba('0x36')](_0x24bc78);};}exports[_0xe9ba('0x37')]=function(_0x8f0a17,_0x5e44af){var _0x7d955e={},_0x4c8620={},_0x274424={'count':0x0,'rows':[]};var _0x3dfd3b=_[_0xe9ba('0x38')](db[_0xe9ba('0x39')][_0xe9ba('0x3a')],function(_0x1f6e2c){return{'name':_0x1f6e2c[_0xe9ba('0x3b')],'type':_0x1f6e2c[_0xe9ba('0x3c')]['key']};});_0x4c8620[_0xe9ba('0x3d')]=_['map'](_0x3dfd3b,_0xe9ba('0x35'));_0x4c8620[_0xe9ba('0x3e')]=_[_0xe9ba('0x3f')](_0x8f0a17['query']);_0x4c8620[_0xe9ba('0x40')]=_[_0xe9ba('0x41')](_0x4c8620[_0xe9ba('0x3d')],_0x4c8620['query']);_0x7d955e[_0xe9ba('0x42')]=_['intersection'](_0x4c8620[_0xe9ba('0x3d')],qs['fields'](_0x8f0a17[_0xe9ba('0x3e')]['fields']));_0x7d955e[_0xe9ba('0x42')]=_0x7d955e[_0xe9ba('0x42')][_0xe9ba('0x43')]?_0x7d955e['attributes']:_0x4c8620[_0xe9ba('0x3d')];if(!_0x8f0a17[_0xe9ba('0x3e')][_0xe9ba('0x44')](_0xe9ba('0x45'))){_0x7d955e[_0xe9ba('0x2d')]=qs['limit'](_0x8f0a17[_0xe9ba('0x3e')][_0xe9ba('0x2d')]);_0x7d955e[_0xe9ba('0x30')]=qs[_0xe9ba('0x30')](_0x8f0a17['query'][_0xe9ba('0x30')]);}_0x7d955e[_0xe9ba('0x46')]=qs[_0xe9ba('0x47')](_0x8f0a17[_0xe9ba('0x3e')][_0xe9ba('0x47')]);_0x7d955e[_0xe9ba('0x48')]=qs[_0xe9ba('0x40')](_[_0xe9ba('0x49')](_0x8f0a17[_0xe9ba('0x3e')],_0x4c8620[_0xe9ba('0x40')]),_0x3dfd3b);if(_0x8f0a17[_0xe9ba('0x3e')][_0xe9ba('0x4a')]){_0x7d955e[_0xe9ba('0x48')]=_[_0xe9ba('0x4b')](_0x7d955e[_0xe9ba('0x48')],{'$or':_['map'](_0x3dfd3b,function(_0x37dd7b){if(_0x37dd7b[_0xe9ba('0x3c')]!==_0xe9ba('0x4c')){var _0x2a8467={};_0x2a8467[_0x37dd7b[_0xe9ba('0x35')]]={'$like':'%'+_0x8f0a17[_0xe9ba('0x3e')][_0xe9ba('0x4a')]+'%'};return _0x2a8467;}})});}_0x7d955e=_[_0xe9ba('0x4b')]({},_0x7d955e,_0x8f0a17[_0xe9ba('0x4d')]);var _0x954dd2={'where':_0x7d955e[_0xe9ba('0x48')]};return db['Network'][_0xe9ba('0x2f')](_0x954dd2)[_0xe9ba('0x1d')](function(_0x548b53){_0x274424[_0xe9ba('0x2f')]=_0x548b53;if(_0x8f0a17[_0xe9ba('0x3e')][_0xe9ba('0x4e')]){_0x7d955e[_0xe9ba('0x4f')]=[{'all':!![]}];}return db[_0xe9ba('0x39')][_0xe9ba('0x50')](_0x7d955e);})[_0xe9ba('0x1d')](function(_0x591558){_0x274424['rows']=_0x591558;return _0x274424;})[_0xe9ba('0x1d')](respondWithFilteredResult(_0x5e44af,_0x7d955e))[_0xe9ba('0x28')](handleError(_0x5e44af,null));};exports[_0xe9ba('0x51')]=function(_0x233c99,_0x486145){var _0x2d19da={'raw':!![],'where':{'id':_0x233c99[_0xe9ba('0x52')]['id']}},_0x5b36d4={};_0x5b36d4['model']=_['keys'](db[_0xe9ba('0x39')][_0xe9ba('0x3a')]);_0x5b36d4[_0xe9ba('0x3e')]=_[_0xe9ba('0x3f')](_0x233c99['query']);_0x5b36d4['filters']=_[_0xe9ba('0x41')](_0x5b36d4['model'],_0x5b36d4[_0xe9ba('0x3e')]);_0x2d19da[_0xe9ba('0x42')]=_[_0xe9ba('0x41')](_0x5b36d4['model'],qs[_0xe9ba('0x53')](_0x233c99['query'][_0xe9ba('0x53')]));_0x2d19da['attributes']=_0x2d19da[_0xe9ba('0x42')]['length']?_0x2d19da['attributes']:_0x5b36d4[_0xe9ba('0x3d')];if(_0x233c99[_0xe9ba('0x3e')][_0xe9ba('0x4e')]){_0x2d19da[_0xe9ba('0x4f')]=[{'all':!![]}];}_0x2d19da=_[_0xe9ba('0x4b')]({},_0x2d19da,_0x233c99[_0xe9ba('0x4d')]);return db[_0xe9ba('0x39')][_0xe9ba('0x54')](_0x2d19da)['then'](handleEntityNotFound(_0x486145,null))['then'](respondWithResult(_0x486145,null))[_0xe9ba('0x28')](handleError(_0x486145,null));};exports[_0xe9ba('0x55')]=function(_0x2f40be,_0x13ddea,_0x1e6501){var _0x1a27e6;return db[_0xe9ba('0x56')][_0xe9ba('0x57')](function(_0xd1bf34){return db[_0xe9ba('0x39')][_0xe9ba('0x55')](_0x2f40be[_0xe9ba('0x58')],{'raw':!![]})[_0xe9ba('0x1d')](function(_0x4f3908){_0x1a27e6=_0x4f3908;return db[_0xe9ba('0x39')][_0xe9ba('0x50')]({'where':{'type':_0x2f40be[_0xe9ba('0x58')][_0xe9ba('0x3c')]},'raw':!![]});})['then'](function(_0x165acb){if(_0x1a27e6[_0xe9ba('0x3c')][_0xe9ba('0x59')]()==_0xe9ba('0x5a')){var _0x3fa12c=fs[_0xe9ba('0x5b')](path[_0xe9ba('0x5c')](config[_0xe9ba('0x5d')],_0xe9ba('0x5e')),_0xe9ba('0x5f'));var _0x222a5d=ejs[_0xe9ba('0x60')](_0x3fa12c,{'networks':_0x165acb||[]});fs[_0xe9ba('0x61')](_0xe9ba('0x62'),_0x222a5d);return respondWithRpcPromise('Reload',_0xe9ba('0x55'),{'module':_0xe9ba('0x63')});}else if(_0x1a27e6[_0xe9ba('0x3c')]['toUpperCase']()==_0xe9ba('0x64')){var _0x29f50c=fs[_0xe9ba('0x5b')](path[_0xe9ba('0x5c')](config[_0xe9ba('0x5d')],_0xe9ba('0x65')),'utf8');var _0x36e852=ejs[_0xe9ba('0x60')](_0x29f50c,{'networks':_0x165acb||[]});fs['writeFileSync'](_0xe9ba('0x66'),_0x36e852);return respondWithRpcPromise(_0xe9ba('0x67'),_0xe9ba('0x55'),{'module':_0xe9ba('0x63')});}else{var _0x5b9d0f=fs[_0xe9ba('0x5b')](path[_0xe9ba('0x5c')](config['root'],_0xe9ba('0x68')),_0xe9ba('0x5f'));var _0x23889d=ejs['render'](_0x5b9d0f,{'networks':_0x165acb||[]});fs[_0xe9ba('0x61')](util[_0xe9ba('0x69')](_0xe9ba('0x6a'),_0x2f40be[_0xe9ba('0x58')][_0xe9ba('0x3c')][_0xe9ba('0x6b')]()),_0x23889d);return respondWithRpcPromise('Reload',_0xe9ba('0x55'),{'module':'chan_sip.so'});}return null;})[_0xe9ba('0x1d')](function(){return _0x1a27e6;});})[_0xe9ba('0x1d')](respondWithResult(_0x13ddea,0xc9))[_0xe9ba('0x28')](handleError(_0x13ddea,null));};exports['update']=function(_0xe99246,_0x54076a,_0x18cdc8){var _0x249edc;return db['sequelize']['transaction'](function(_0x28ff41){return db[_0xe9ba('0x39')]['find']({'where':{'id':_0xe99246[_0xe9ba('0x52')]['id']}})[_0xe9ba('0x1d')](handleEntityNotFound(_0x54076a,null))[_0xe9ba('0x1d')](saveUpdates(_0xe99246[_0xe9ba('0x58')],null))[_0xe9ba('0x1d')](function(_0x1677ee){if(_0x1677ee){_0x249edc=_0x1677ee;return db[_0xe9ba('0x39')]['findAll']({'where':{'type':_0x249edc['type']},'raw':!![]});}return null;})[_0xe9ba('0x1d')](function(_0x3298d7){if(_0x249edc['type'][_0xe9ba('0x59')]()==_0xe9ba('0x5a')){var _0x3ee210=fs['readFileSync'](path['join'](config[_0xe9ba('0x5d')],_0xe9ba('0x5e')),_0xe9ba('0x5f'));var _0x54ddb8=ejs[_0xe9ba('0x60')](_0x3ee210,{'networks':_0x3298d7||[]});fs[_0xe9ba('0x61')](_0xe9ba('0x62'),_0x54ddb8);return respondWithRpcPromise(_0xe9ba('0x67'),_0xe9ba('0x34'),{'module':_0xe9ba('0x63')});}else if(_0x249edc[_0xe9ba('0x3c')]['toUpperCase']()=='TURN'){var _0x42bbbd=fs[_0xe9ba('0x5b')](path[_0xe9ba('0x5c')](config[_0xe9ba('0x5d')],_0xe9ba('0x65')),_0xe9ba('0x5f'));var _0x303778=ejs[_0xe9ba('0x60')](_0x42bbbd,{'networks':_0x3298d7||[]});fs[_0xe9ba('0x61')](_0xe9ba('0x66'),_0x303778);return respondWithRpcPromise(_0xe9ba('0x67'),'update',{'module':'res_stun_monitor.so'});}else{var _0x4bb21a=fs[_0xe9ba('0x5b')](path[_0xe9ba('0x5c')](config['root'],_0xe9ba('0x68')),_0xe9ba('0x5f'));var _0x40383d=ejs[_0xe9ba('0x60')](_0x4bb21a,{'networks':_0x3298d7||[]});fs[_0xe9ba('0x61')](util[_0xe9ba('0x69')](_0xe9ba('0x6a'),_0xe99246['body']['type'][_0xe9ba('0x6b')]()),_0x40383d);return respondWithRpcPromise(_0xe9ba('0x67'),_0xe9ba('0x34'),{'module':_0xe9ba('0x6c')});}return null;})[_0xe9ba('0x1d')](function(_0x5a2027){if(_0x5a2027){return _0x249edc;}return null;});})['then'](respondWithResult(_0x54076a,null))[_0xe9ba('0x28')](handleError(_0x54076a,null));};exports[_0xe9ba('0x6d')]=function(_0x47c72d,_0x41c98d,_0x2b3424){var _0x2f67c4;return db[_0xe9ba('0x39')][_0xe9ba('0x54')]({'where':{'id':_0x47c72d['params']['id']}})[_0xe9ba('0x1d')](function(_0xba4721){_0x2f67c4=_0xba4721;return _0xba4721;})[_0xe9ba('0x1d')](handleEntityNotFound(_0x41c98d,null))[_0xe9ba('0x1d')](removeEntity(_0x41c98d,null))['then'](function(){if(_0x2f67c4){return db['Network'][_0xe9ba('0x50')]({'where':{'type':_0x2f67c4['type']},'raw':!![]});}})[_0xe9ba('0x1d')](function(_0x41ab95){if(_0x2f67c4['type'][_0xe9ba('0x59')]()=='STUN'){var _0x18fa63=fs['readFileSync'](path[_0xe9ba('0x5c')](config[_0xe9ba('0x5d')],_0xe9ba('0x5e')),'utf8');var _0x140ab3=ejs[_0xe9ba('0x60')](_0x18fa63,{'networks':_0x41ab95||[]});fs[_0xe9ba('0x61')]('/etc/asterisk/stun_xcally.conf',_0x140ab3);return respondWithRpcPromise(_0xe9ba('0x67'),'destroy',{'module':_0xe9ba('0x63')});}else if(_0x2f67c4[_0xe9ba('0x3c')][_0xe9ba('0x59')]()==_0xe9ba('0x64')){var _0x391070=fs[_0xe9ba('0x5b')](path[_0xe9ba('0x5c')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x41f55c=ejs[_0xe9ba('0x60')](_0x391070,{'networks':_0x41ab95||[]});fs['writeFileSync'](_0xe9ba('0x66'),_0x41f55c);return respondWithRpcPromise(_0xe9ba('0x67'),_0xe9ba('0x6d'),{'module':_0xe9ba('0x63')});}else{var _0x568140=fs[_0xe9ba('0x5b')](path[_0xe9ba('0x5c')](config[_0xe9ba('0x5d')],_0xe9ba('0x68')),_0xe9ba('0x5f'));var _0x4568a6=ejs['render'](_0x568140,{'networks':_0x41ab95||[]});fs[_0xe9ba('0x61')](util[_0xe9ba('0x69')]('/etc/asterisk/sip_xcally_%s.conf',_0x47c72d[_0xe9ba('0x58')][_0xe9ba('0x3c')][_0xe9ba('0x6b')]()),_0x4568a6);return respondWithRpcPromise(_0xe9ba('0x67'),_0xe9ba('0x6d'),{'module':_0xe9ba('0x6c')});}return null;})['catch'](handleError(_0x41c98d,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3985a0c..12de561 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 _0xbb53=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a16a2,_0x3cbf1c){var _0x564b20=function(_0x152dbe){while(--_0x152dbe){_0x4a16a2['push'](_0x4a16a2['shift']());}};_0x564b20(++_0x3cbf1c);}(_0xbb53,0x121));var _0x3bb5=function(_0x2fd157,_0x2f5ea1){_0x2fd157=_0x2fd157-0x0;var _0x1377cb=_0xbb53[_0x2fd157];return _0x1377cb;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var moment=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var rp=require(_0x3bb5('0x6'));var fs=require('fs');var path=require(_0x3bb5('0x7'));var rimraf=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var attributes=require('./network.attributes');module['exports']=function(_0x23f11e,_0x2460b0){return _0x23f11e[_0x3bb5('0xa')](_0x3bb5('0xb'),attributes,{'tableName':_0x3bb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc788=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Network','lodash','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc788,0xc4));var _0x8c78=function(_0x558414,_0x58ea6e){_0x558414=_0x558414-0x0;var _0x343829=_0xc788[_0x558414];return _0x343829;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c78('0x3'));var rp=require(_0x8c78('0x4'));var fs=require('fs');var path=require(_0x8c78('0x5'));var rimraf=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var attributes=require('./network.attributes');module[_0x8c78('0x8')]=function(_0x4555da,_0x329152){return _0x4555da[_0x8c78('0x9')](_0x8c78('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index e1873e7..021bb3e 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 _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(_0x4e1738,_0x574325){var _0x2dbe49=function(_0x554172){while(--_0x554172){_0x4e1738['push'](_0x4e1738['shift']());}};_0x2dbe49(++_0x574325);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 +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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x4da3d0,_0x206cd3){_0x4da3d0=_0x4da3d0-0x0;var _0x553fd1=_0x7a54[_0x4da3d0];return _0x553fd1;};'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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 48b240f..9fce893 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 _0xae47=['./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','addApplications','addAgents','/:id/send','send','put','delete','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x6b6fc8,_0x58bdef){var _0x565180=function(_0x2ca04f){while(--_0x2ca04f){_0x6b6fc8['push'](_0x6b6fc8['shift']());}};_0x565180(++_0x58bdef);}(_0xae47,0x143));var _0x7ae4=function(_0x1d9b7f,_0x28b039){_0x1d9b7f=_0x1d9b7f-0x0;var _0x23bf92=_0xae47[_0x1d9b7f];return _0x23bf92;};'use strict';var multer=require(_0x7ae4('0x0'));var util=require(_0x7ae4('0x1'));var path=require('path');var timeout=require(_0x7ae4('0x2'));var express=require('express');var router=express[_0x7ae4('0x3')]();var fs_extra=require(_0x7ae4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7ae4('0x5'));var config=require(_0x7ae4('0x6'));var controller=require(_0x7ae4('0x7'));router[_0x7ae4('0x8')]('/',auth[_0x7ae4('0x9')](),controller[_0x7ae4('0xa')]);router['get']('/describe',auth[_0x7ae4('0x9')](),controller[_0x7ae4('0xb')]);router[_0x7ae4('0x8')](_0x7ae4('0xc'),auth[_0x7ae4('0x9')](),controller[_0x7ae4('0xd')]);router[_0x7ae4('0x8')](_0x7ae4('0xe'),auth[_0x7ae4('0x9')](),controller['getDispositions']);router[_0x7ae4('0x8')](_0x7ae4('0xf'),auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x10')]);router[_0x7ae4('0x8')](_0x7ae4('0x11'),auth[_0x7ae4('0x9')](),controller['getApplications']);router[_0x7ae4('0x8')]('/:id/interactions',auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x12')]);router['get'](_0x7ae4('0x13'),auth[_0x7ae4('0x9')](),controller['getAgents']);router[_0x7ae4('0x14')]('/',auth['isAuthenticated'](),controller[_0x7ae4('0x15')]);router[_0x7ae4('0x14')](_0x7ae4('0xe'),auth[_0x7ae4('0x9')](),controller['addDisposition']);router[_0x7ae4('0x14')](_0x7ae4('0xf'),auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x16')]);router['post'](_0x7ae4('0x17'),controller['notify']);router[_0x7ae4('0x14')](_0x7ae4('0x11'),auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x18')]);router[_0x7ae4('0x14')](_0x7ae4('0x13'),auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x19')]);router['post'](_0x7ae4('0x1a'),auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x1b')]);router[_0x7ae4('0x1c')](_0x7ae4('0xc'),auth[_0x7ae4('0x9')](),controller['update']);router[_0x7ae4('0x1d')](_0x7ae4('0xc'),auth[_0x7ae4('0x9')](),controller['destroy']);router['delete'](_0x7ae4('0xe'),auth[_0x7ae4('0x9')](),controller['removeDispositions']);router[_0x7ae4('0x1d')]('/:id/canned_answers',auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x1e')]);router[_0x7ae4('0x1d')](_0x7ae4('0x13'),auth[_0x7ae4('0x9')](),controller[_0x7ae4('0x1f')]);module[_0x7ae4('0x20')]=router; \ No newline at end of file +var _0x688a=['/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions'];(function(_0x2cb68c,_0x4d22e8){var _0x4547ba=function(_0x836219){while(--_0x836219){_0x2cb68c['push'](_0x2cb68c['shift']());}};_0x4547ba(++_0x4d22e8);}(_0x688a,0x66));var _0xa688=function(_0x4dd613,_0x540950){_0x4dd613=_0x4dd613-0x0;var _0x24528e=_0x688a[_0x4dd613];return _0x24528e;};'use strict';var multer=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var path=require(_0xa688('0x2'));var timeout=require(_0xa688('0x3'));var express=require(_0xa688('0x4'));var router=express[_0xa688('0x5')]();var fs_extra=require(_0xa688('0x6'));var auth=require(_0xa688('0x7'));var interaction=require(_0xa688('0x8'));var config=require('../../config/environment');var controller=require(_0xa688('0x9'));router['get']('/',auth[_0xa688('0xa')](),controller[_0xa688('0xb')]);router[_0xa688('0xc')](_0xa688('0xd'),auth[_0xa688('0xa')](),controller[_0xa688('0xe')]);router[_0xa688('0xc')](_0xa688('0xf'),auth[_0xa688('0xa')](),controller[_0xa688('0x10')]);router[_0xa688('0xc')]('/:id/dispositions',auth[_0xa688('0xa')](),controller['getDispositions']);router[_0xa688('0xc')](_0xa688('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xa688('0xc')](_0xa688('0x12'),auth[_0xa688('0xa')](),controller[_0xa688('0x13')]);router[_0xa688('0xc')](_0xa688('0x14'),auth[_0xa688('0xa')](),controller['getInteractions']);router[_0xa688('0xc')](_0xa688('0x15'),auth[_0xa688('0xa')](),controller[_0xa688('0x16')]);router[_0xa688('0x17')]('/',auth['isAuthenticated'](),controller[_0xa688('0x18')]);router[_0xa688('0x17')](_0xa688('0x19'),auth[_0xa688('0xa')](),controller[_0xa688('0x1a')]);router[_0xa688('0x17')](_0xa688('0x11'),auth[_0xa688('0xa')](),controller[_0xa688('0x1b')]);router[_0xa688('0x17')](_0xa688('0x1c'),controller[_0xa688('0x1d')]);router['post'](_0xa688('0x12'),auth[_0xa688('0xa')](),controller[_0xa688('0x1e')]);router[_0xa688('0x17')]('/:id/users',auth[_0xa688('0xa')](),controller[_0xa688('0x1f')]);router[_0xa688('0x17')](_0xa688('0x20'),auth[_0xa688('0xa')](),controller['send']);router[_0xa688('0x21')](_0xa688('0xf'),auth[_0xa688('0xa')](),controller[_0xa688('0x22')]);router[_0xa688('0x23')](_0xa688('0xf'),auth[_0xa688('0xa')](),controller[_0xa688('0x24')]);router[_0xa688('0x23')]('/:id/dispositions',auth[_0xa688('0xa')](),controller[_0xa688('0x25')]);router[_0xa688('0x23')](_0xa688('0x11'),auth['isAuthenticated'](),controller[_0xa688('0x26')]);router[_0xa688('0x23')](_0xa688('0x15'),auth[_0xa688('0xa')](),controller[_0xa688('0x27')]);module[_0xa688('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 80eec0f..39dc916 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 _0x7529=['TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate'];(function(_0x1ce281,_0x3d6a82){var _0x51c932=function(_0x45d345){while(--_0x45d345){_0x1ce281['push'](_0x1ce281['shift']());}};_0x51c932(++_0x3d6a82);}(_0x7529,0x1c3));var _0x9752=function(_0x4dc2a2,_0x36a2bc){_0x4dc2a2=_0x4dc2a2-0x0;var _0x15a30a=_0x7529[_0x4dc2a2];return _0x15a30a;};'use strict';var Sequelize=require(_0x9752('0x0'));var rs=require(_0x9752('0x1'));module[_0x9752('0x2')]={'name':{'type':Sequelize[_0x9752('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9752('0x3')]},'token':{'type':Sequelize[_0x9752('0x3')],'defaultValue':function(){return rs[_0x9752('0x4')]();}},'replyUri':{'type':Sequelize[_0x9752('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9752('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9752('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9752('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9752('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9752('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9752('0x3')]},'queueTransfer':{'type':Sequelize[_0x9752('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9752('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9752('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9752('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9752('0x6')],'defaultValue':![],'comment':_0x9752('0x8'),'set':function(_0x516bef){if(!_0x516bef)this[_0x9752('0x9')](_0x9752('0xa'),null);this['setDataValue'](_0x9752('0xb'),_0x516bef);}}}; \ No newline at end of file +var _0x432e=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate','TEXT'];(function(_0x48cfb1,_0x48a886){var _0x2239d6=function(_0x412c84){while(--_0x412c84){_0x48cfb1['push'](_0x48cfb1['shift']());}};_0x2239d6(++_0x48a886);}(_0x432e,0x1cf));var _0xe432=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x432e[_0x491cbe];return _0x59449d;};'use strict';var Sequelize=require(_0xe432('0x0'));var rs=require(_0xe432('0x1'));module['exports']={'name':{'type':Sequelize[_0xe432('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xe432('0x2')]},'token':{'type':Sequelize[_0xe432('0x2')],'defaultValue':function(){return rs[_0xe432('0x3')]();}},'replyUri':{'type':Sequelize[_0xe432('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xe432('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe432('0x4')],'defaultValue':function(){return _0xe432('0x5');}},'notificationSound':{'type':Sequelize[_0xe432('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe432('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe432('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xe432('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe432('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe432('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe432('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe432('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xe432('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xe432('0x6')],'defaultValue':![],'comment':_0xe432('0x9'),'set':function(_0x449b69){if(!_0x449b69)this[_0xe432('0xa')](_0xe432('0xb'),null);this['setDataValue'](_0xe432('0xc'),_0x449b69);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index c1bbbf2..14cf3ff 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 _0x8875=['intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','fields','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','Disposition','getDispositions','findOne','order','OpenchannelAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','account','applications','Applications','list','priority','asc','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','push','close','OpenchannelMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','findAll','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','model','keys','filters','query','attributes'];(function(_0x416468,_0x2e7a72){var _0x2ee9b7=function(_0xf354ce){while(--_0xf354ce){_0x416468['push'](_0x416468['shift']());}};_0x2ee9b7(++_0x2e7a72);}(_0x8875,0x130));var _0x5887=function(_0xbfbef0,_0x218b21){_0xbfbef0=_0xbfbef0-0x0;var _0x3fdf6f=_0x8875[_0xbfbef0];return _0x3fdf6f;};'use strict';var emlformat=require(_0x5887('0x0'));var rimraf=require(_0x5887('0x1'));var zipdir=require(_0x5887('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5887('0x3'));var moment=require('moment');var BPromise=require(_0x5887('0x4'));var Mustache=require(_0x5887('0x5'));var util=require('util');var path=require(_0x5887('0x6'));var sox=require(_0x5887('0x7'));var csv=require(_0x5887('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5887('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5887('0xa'));var toCsv=require(_0x5887('0x8'));var querystring=require(_0x5887('0xb'));var Papa=require(_0x5887('0xc'));var Redis=require(_0x5887('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5887('0xe'))(_0x5887('0xf'));var utils=require(_0x5887('0x10'));var config=require(_0x5887('0x11'));var licenseUtil=require(_0x5887('0x12'));var db=require(_0x5887('0x13'))['db'];config[_0x5887('0x14')]=_[_0x5887('0x15')](config[_0x5887('0x14')],{'host':_0x5887('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5887('0x14')]));require(_0x5887('0x17'))[_0x5887('0x18')](socket);var jayson=require(_0x5887('0x19'));var client=jayson[_0x5887('0x1a')][_0x5887('0x1b')]({'port':0x232c});var client9002=jayson[_0x5887('0x1a')][_0x5887('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x569451,_0x26e969,_0x131605,_0x339e76){return new BPromise(function(_0x1f6136,_0x487a6f){var _0x597bfc=_0x339e76||client;return _0x597bfc[_0x5887('0x1c')](_0x569451,_0x131605)['then'](function(_0x130c87){logger[_0x5887('0x1d')](_0x5887('0x1e'),_0x26e969,_0x5887('0x1f'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x26e969,_0x5887('0x1f'),JSON[_0x5887('0x20')](_0x130c87));if(_0x130c87['error']){if(_0x130c87[_0x5887('0x21')]['code']===0x1f4){logger[_0x5887('0x21')](_0x5887('0x1e'),_0x26e969,_0x130c87[_0x5887('0x21')][_0x5887('0x22')]);return _0x487a6f(_0x130c87['error'][_0x5887('0x22')]);}logger[_0x5887('0x21')](_0x5887('0x1e'),_0x26e969,_0x130c87[_0x5887('0x21')][_0x5887('0x22')]);return _0x1f6136(_0x130c87[_0x5887('0x21')]['message']);}else{logger[_0x5887('0x1d')](_0x5887('0x1e'),_0x26e969,'request\x20sent');_0x1f6136(_0x130c87[_0x5887('0x23')]['message']);}})[_0x5887('0x24')](function(_0x32e94d){logger[_0x5887('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x26e969,_0x32e94d);_0x487a6f(_0x32e94d);});});}function respondWithStatusCode(_0x5c352f,_0x51200a){_0x51200a=_0x51200a||0xcc;return function(_0x18a19c){if(_0x18a19c){return _0x5c352f[_0x5887('0x25')](_0x51200a);}return _0x5c352f[_0x5887('0x26')](_0x51200a)[_0x5887('0x27')]();};}function respondWithResult(_0x77dcaa,_0x2e7223){_0x2e7223=_0x2e7223||0xc8;return function(_0xa9dd9b){if(_0xa9dd9b){return _0x77dcaa[_0x5887('0x26')](_0x2e7223)['json'](_0xa9dd9b);}};}function respondWithFilteredResult(_0x17b7ca,_0x34925b){return function(_0x3111fe){if(_0x3111fe){var _0x4166ae=typeof _0x34925b[_0x5887('0x28')]===_0x5887('0x29')&&typeof _0x34925b[_0x5887('0x2a')]==='undefined';var _0x717983=_0x3111fe[_0x5887('0x2b')];var _0xeb1085=_0x4166ae?0x0:_0x34925b[_0x5887('0x28')];var _0xb036df=_0x4166ae?_0x3111fe[_0x5887('0x2b')]:_0x34925b['offset']+_0x34925b[_0x5887('0x2a')];var _0x8cd50f;if(_0xb036df>=_0x717983){_0xb036df=_0x717983;_0x8cd50f=0xc8;}else{_0x8cd50f=0xce;}_0x17b7ca[_0x5887('0x26')](_0x8cd50f);return _0x17b7ca[_0x5887('0x2c')](_0x5887('0x2d'),_0xeb1085+'-'+_0xb036df+'/'+_0x717983)[_0x5887('0x2e')](_0x3111fe);}return null;};}function patchUpdates(_0x50029a){return function(_0x348c9c){try{jsonpatch[_0x5887('0x2f')](_0x348c9c,_0x50029a,!![]);}catch(_0x1b1c93){return BPromise[_0x5887('0x30')](_0x1b1c93);}return _0x348c9c['save']();};}function saveUpdates(_0x5a2713,_0x50393d){return function(_0x4f02ac){if(_0x4f02ac){return _0x4f02ac[_0x5887('0x31')](_0x5a2713)[_0x5887('0x32')](function(_0x124f7c){return _0x124f7c;});}return null;};}function removeEntity(_0x854cea,_0x506dd6){return function(_0x672f37){if(_0x672f37){return _0x672f37['destroy']()[_0x5887('0x32')](function(){var _0x17d739=_0x672f37[_0x5887('0x33')]({'plain':!![]});var _0x35e8b8=_0x5887('0x34');return db[_0x5887('0x35')]['destroy']({'where':{'type':_0x35e8b8,'resourceId':_0x17d739['id']}})[_0x5887('0x32')](function(){return _0x672f37;});})['then'](function(){_0x854cea[_0x5887('0x26')](0xcc)[_0x5887('0x27')]();});}};}function handleEntityNotFound(_0x44bf08,_0x9ad3ef){return function(_0xcaa188){if(!_0xcaa188){_0x44bf08['sendStatus'](0x194);}return _0xcaa188;};}function handleError(_0x4e74f2,_0x2bfb4a){_0x2bfb4a=_0x2bfb4a||0x1f4;return function(_0x391032){logger[_0x5887('0x21')](_0x391032[_0x5887('0x36')]);if(_0x391032[_0x5887('0x37')]){delete _0x391032[_0x5887('0x37')];}_0x4e74f2[_0x5887('0x26')](_0x2bfb4a)[_0x5887('0x38')](_0x391032);};}exports[_0x5887('0x39')]=function(_0x570305,_0x5dcb10){var _0x461318={'include':[{'model':db[_0x5887('0x3a')],'as':_0x5887('0x3b')}]},_0x4687c9={},_0x33c1b7={'count':0x0,'rows':[]};var _0xc1add7=_[_0x5887('0x3c')](db[_0x5887('0x3d')]['rawAttributes'],function(_0x1c152a){return{'name':_0x1c152a[_0x5887('0x3e')],'type':_0x1c152a[_0x5887('0x3f')][_0x5887('0x40')]};});_0x4687c9[_0x5887('0x41')]=_[_0x5887('0x3c')](_0xc1add7,_0x5887('0x37'));_0x4687c9['query']=_[_0x5887('0x42')](_0x570305['query']);_0x4687c9[_0x5887('0x43')]=_['intersection'](_0x4687c9['model'],_0x4687c9[_0x5887('0x44')]);_0x461318[_0x5887('0x45')]=_[_0x5887('0x46')](_0x4687c9[_0x5887('0x41')],qs['fields'](_0x570305[_0x5887('0x44')]['fields']));_0x461318[_0x5887('0x45')]=_0x461318['attributes'][_0x5887('0x47')]?_0x461318[_0x5887('0x45')]:_0x4687c9[_0x5887('0x41')];if(!_0x570305[_0x5887('0x44')][_0x5887('0x48')](_0x5887('0x49'))){_0x461318['limit']=qs[_0x5887('0x2a')](_0x570305[_0x5887('0x44')]['limit']);_0x461318[_0x5887('0x28')]=qs[_0x5887('0x28')](_0x570305[_0x5887('0x44')]['offset']);}_0x461318['order']=qs[_0x5887('0x4a')](_0x570305[_0x5887('0x44')][_0x5887('0x4a')]);_0x461318[_0x5887('0x4b')]=qs[_0x5887('0x43')](_[_0x5887('0x4c')](_0x570305[_0x5887('0x44')],_0x4687c9['filters']),_0xc1add7);if(_0x570305['query'][_0x5887('0x4d')]){_0x461318[_0x5887('0x4b')]=_[_0x5887('0x4e')](_0x461318['where'],{'$or':_['map'](_0xc1add7,function(_0x5be11e){if(_0x5be11e[_0x5887('0x3f')]!==_0x5887('0x4f')){var _0x29176d={};_0x29176d[_0x5be11e[_0x5887('0x37')]]={'$like':'%'+_0x570305[_0x5887('0x44')]['filter']+'%'};return _0x29176d;}})});}_0x461318=_[_0x5887('0x4e')]({},_0x461318,_0x570305[_0x5887('0x50')]);var _0x3fbbb4={'where':_0x461318['where']};return db[_0x5887('0x3d')]['count'](_0x3fbbb4)[_0x5887('0x32')](function(_0x1fd789){_0x33c1b7[_0x5887('0x2b')]=_0x1fd789;if(_0x570305[_0x5887('0x44')][_0x5887('0x51')]){_0x461318[_0x5887('0x52')]=[{'all':!![]}];}return db[_0x5887('0x3d')]['findAll'](_0x461318);})[_0x5887('0x32')](function(_0x568c70){_0x33c1b7[_0x5887('0x53')]=_0x568c70;return _0x33c1b7;})[_0x5887('0x32')](respondWithFilteredResult(_0x5dcb10,_0x461318))['catch'](handleError(_0x5dcb10,null));};exports[_0x5887('0x54')]=function(_0x462d97,_0x121ff7){var _0x4daf74={'raw':![],'where':{'id':_0x462d97[_0x5887('0x55')]['id']},'include':[{'model':db[_0x5887('0x3a')],'as':_0x5887('0x3b')}]},_0x2a692c={};_0x2a692c[_0x5887('0x41')]=_['keys'](db[_0x5887('0x3d')][_0x5887('0x56')]);_0x2a692c['query']=_['keys'](_0x462d97['query']);_0x2a692c['filters']=_[_0x5887('0x46')](_0x2a692c['model'],_0x2a692c['query']);_0x4daf74['attributes']=_['intersection'](_0x2a692c['model'],qs[_0x5887('0x57')](_0x462d97[_0x5887('0x44')]['fields']));_0x4daf74['attributes']=_0x4daf74['attributes'][_0x5887('0x47')]?_0x4daf74[_0x5887('0x45')]:_0x2a692c[_0x5887('0x41')];if(_0x462d97[_0x5887('0x44')][_0x5887('0x51')]){_0x4daf74[_0x5887('0x52')]=[{'all':!![]}];}_0x4daf74=_[_0x5887('0x4e')]({},_0x4daf74,_0x462d97[_0x5887('0x50')]);return db[_0x5887('0x3d')][_0x5887('0x58')](_0x4daf74)[_0x5887('0x32')](handleEntityNotFound(_0x121ff7,null))[_0x5887('0x32')](respondWithResult(_0x121ff7,null))[_0x5887('0x24')](handleError(_0x121ff7,null));};exports[_0x5887('0x59')]=function(_0x268bb1,_0xa1135){return db[_0x5887('0x3d')][_0x5887('0x59')](_0x268bb1[_0x5887('0x5a')],{})['then'](function(_0x3ec5d3){var _0x13d8d5=_0x268bb1['user'][_0x5887('0x33')]({'plain':!![]});if(!_0x13d8d5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d8d5[_0x5887('0x5b')]===_0x5887('0x5c')){var _0x3308f0=_0x3ec5d3[_0x5887('0x33')]({'plain':!![]});var _0x357099=_0x5887('0x34');return db[_0x5887('0x5d')][_0x5887('0x58')]({'where':{'name':_0x357099,'userProfileId':_0x13d8d5[_0x5887('0x5e')]},'raw':!![]})[_0x5887('0x32')](function(_0x1714da){if(_0x1714da&&_0x1714da['autoAssociation']===0x0){return db[_0x5887('0x35')]['create']({'name':_0x3308f0[_0x5887('0x37')],'resourceId':_0x3308f0['id'],'type':_0x1714da['name'],'sectionId':_0x1714da['id']},{})[_0x5887('0x32')](function(){return _0x3ec5d3;});}else{return _0x3ec5d3;}})[_0x5887('0x24')](function(_0x580e43){logger[_0x5887('0x21')](_0x5887('0x5f'),_0x580e43);throw _0x580e43;});}return _0x3ec5d3;})[_0x5887('0x32')](respondWithResult(_0xa1135,0xc9))[_0x5887('0x24')](handleError(_0xa1135,null));};exports[_0x5887('0x31')]=function(_0x57e0c7,_0x52a048){if(_0x57e0c7[_0x5887('0x5a')]['id']){delete _0x57e0c7[_0x5887('0x5a')]['id'];}return db[_0x5887('0x3d')][_0x5887('0x58')]({'where':{'id':_0x57e0c7[_0x5887('0x55')]['id']},'include':[{'model':db[_0x5887('0x3a')],'as':_0x5887('0x3b')}]})[_0x5887('0x32')](handleEntityNotFound(_0x52a048,null))['then'](saveUpdates(_0x57e0c7['body'],null))[_0x5887('0x32')](respondWithResult(_0x52a048,null))[_0x5887('0x24')](handleError(_0x52a048,null));};exports[_0x5887('0x60')]=function(_0x400c67,_0x4eb84b){return db[_0x5887('0x3d')][_0x5887('0x58')]({'where':{'id':_0x400c67['params']['id']}})['then'](handleEntityNotFound(_0x4eb84b,null))['then'](removeEntity(_0x4eb84b,null))[_0x5887('0x24')](handleError(_0x4eb84b,null));};exports[_0x5887('0x61')]=function(_0x615573,_0x3c76ac){return db[_0x5887('0x3d')][_0x5887('0x61')]()[_0x5887('0x32')](respondWithResult(_0x3c76ac,null))[_0x5887('0x24')](handleError(_0x3c76ac,null));};exports[_0x5887('0x62')]=function(_0x3ca310,_0x29efec,_0x477f1a){if(_0x3ca310[_0x5887('0x5a')]['id']){delete _0x3ca310[_0x5887('0x5a')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x3ca310[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x29efec,null))[_0x5887('0x32')](function(_0x2eadd4){if(_0x2eadd4){_0x3ca310['body']['OpenchannelAccountId']=_0x2eadd4['id'];return db[_0x5887('0x63')]['create'](_0x3ca310[_0x5887('0x5a')]);}})[_0x5887('0x32')](respondWithResult(_0x29efec,null))[_0x5887('0x24')](handleError(_0x29efec,null));};exports[_0x5887('0x64')]=function(_0x10125f,_0x4c49e6,_0x41ca70){var _0x18fb57={'raw':![],'where':{}};var _0x495d08={};var _0x11b41f={'count':0x0,'rows':[]};return db[_0x5887('0x3d')][_0x5887('0x65')]({'where':{'id':_0x10125f[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x4c49e6,null))[_0x5887('0x32')](function(_0x19090a){if(_0x19090a){_0x495d08[_0x5887('0x41')]=_[_0x5887('0x42')](db['Disposition']['rawAttributes']);_0x495d08[_0x5887('0x44')]=_[_0x5887('0x42')](_0x10125f[_0x5887('0x44')]);_0x495d08[_0x5887('0x43')]=_[_0x5887('0x46')](_0x495d08['model'],_0x495d08[_0x5887('0x44')]);_0x18fb57[_0x5887('0x45')]=_[_0x5887('0x46')](_0x495d08['model'],qs['fields'](_0x10125f[_0x5887('0x44')][_0x5887('0x57')]));_0x18fb57[_0x5887('0x45')]=_0x18fb57[_0x5887('0x45')]['length']?_0x18fb57['attributes']:_0x495d08[_0x5887('0x41')];if(!_0x10125f[_0x5887('0x44')][_0x5887('0x48')]('nolimit')){_0x18fb57[_0x5887('0x2a')]=qs[_0x5887('0x2a')](_0x10125f['query']['limit']);_0x18fb57[_0x5887('0x28')]=qs[_0x5887('0x28')](_0x10125f[_0x5887('0x44')][_0x5887('0x28')]);}_0x18fb57[_0x5887('0x66')]=qs['sort'](_0x10125f[_0x5887('0x44')][_0x5887('0x4a')]);_0x18fb57['where']=qs['filters'](_[_0x5887('0x4c')](_0x10125f[_0x5887('0x44')],_0x495d08[_0x5887('0x43')]));_0x18fb57[_0x5887('0x4b')][_0x5887('0x67')]=_0x19090a['id'];if(_0x10125f['query'][_0x5887('0x4d')]){_0x18fb57[_0x5887('0x4b')]=_[_0x5887('0x4e')](_0x18fb57[_0x5887('0x4b')],{'$or':_[_0x5887('0x3c')](_0x18fb57[_0x5887('0x45')],function(_0x12c9d9){var _0x24f1f4={};_0x24f1f4[_0x12c9d9]={'$like':'%'+_0x10125f[_0x5887('0x44')][_0x5887('0x4d')]+'%'};return _0x24f1f4;})});}_0x18fb57=_[_0x5887('0x4e')]({},_0x18fb57,_0x10125f[_0x5887('0x50')]);return db[_0x5887('0x63')][_0x5887('0x2b')]({'where':_0x18fb57[_0x5887('0x4b')]})[_0x5887('0x32')](function(_0xf35fa1){_0x11b41f['count']=_0xf35fa1;if(_0x10125f['query'][_0x5887('0x51')]){_0x18fb57[_0x5887('0x52')]=[{'all':!![]}];}return db[_0x5887('0x63')]['findAll'](_0x18fb57);})[_0x5887('0x32')](function(_0xb2dfc8){_0x11b41f[_0x5887('0x53')]=_0xb2dfc8;return _0x11b41f;});}})[_0x5887('0x32')](respondWithFilteredResult(_0x4c49e6,_0x18fb57))['catch'](handleError(_0x4c49e6,null));};exports[_0x5887('0x68')]=function(_0xde2faa,_0x333ea5,_0x567d10){return db['OpenchannelAccount']['find']({'where':{'id':_0xde2faa['params']['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x333ea5,null))['then'](function(_0x4179cb){if(_0x4179cb){return _0x4179cb[_0x5887('0x68')](_0xde2faa[_0x5887('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x333ea5,null))[_0x5887('0x24')](handleError(_0x333ea5,null));};exports[_0x5887('0x69')]=function(_0x78fef6,_0x8aba2f,_0x30661a){if(_0x78fef6[_0x5887('0x5a')]['id']){delete _0x78fef6[_0x5887('0x5a')]['id'];}return db[_0x5887('0x3d')][_0x5887('0x58')]({'where':{'id':_0x78fef6[_0x5887('0x55')]['id']}})['then'](handleEntityNotFound(_0x8aba2f,null))[_0x5887('0x32')](function(_0x31fff7){if(_0x31fff7){_0x78fef6[_0x5887('0x5a')][_0x5887('0x67')]=_0x31fff7['id'];return db[_0x5887('0x6a')][_0x5887('0x59')](_0x78fef6[_0x5887('0x5a')]);}})[_0x5887('0x32')](respondWithResult(_0x8aba2f,null))['catch'](handleError(_0x8aba2f,null));};exports['getAnswers']=function(_0x3f2f41,_0x4201a5,_0x1bc2ea){var _0x335ce0={'raw':![],'where':{}};var _0x3857ed={};var _0x4becb7={'count':0x0,'rows':[]};return db[_0x5887('0x3d')][_0x5887('0x65')]({'where':{'id':_0x3f2f41[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x4201a5,null))[_0x5887('0x32')](function(_0x5cd80c){if(_0x5cd80c){_0x3857ed[_0x5887('0x41')]=_[_0x5887('0x42')](db[_0x5887('0x6a')][_0x5887('0x56')]);_0x3857ed[_0x5887('0x44')]=_[_0x5887('0x42')](_0x3f2f41['query']);_0x3857ed['filters']=_[_0x5887('0x46')](_0x3857ed[_0x5887('0x41')],_0x3857ed[_0x5887('0x44')]);_0x335ce0[_0x5887('0x45')]=_['intersection'](_0x3857ed[_0x5887('0x41')],qs[_0x5887('0x57')](_0x3f2f41['query']['fields']));_0x335ce0['attributes']=_0x335ce0[_0x5887('0x45')][_0x5887('0x47')]?_0x335ce0[_0x5887('0x45')]:_0x3857ed['model'];if(!_0x3f2f41['query']['hasOwnProperty'](_0x5887('0x49'))){_0x335ce0[_0x5887('0x2a')]=qs['limit'](_0x3f2f41[_0x5887('0x44')]['limit']);_0x335ce0[_0x5887('0x28')]=qs[_0x5887('0x28')](_0x3f2f41[_0x5887('0x44')][_0x5887('0x28')]);}_0x335ce0[_0x5887('0x66')]=qs[_0x5887('0x4a')](_0x3f2f41[_0x5887('0x44')][_0x5887('0x4a')]);_0x335ce0['where']=qs[_0x5887('0x43')](_[_0x5887('0x4c')](_0x3f2f41[_0x5887('0x44')],_0x3857ed['filters']));_0x335ce0['where'][_0x5887('0x67')]=_0x5cd80c['id'];if(_0x3f2f41[_0x5887('0x44')]['filter']){_0x335ce0[_0x5887('0x4b')]=_[_0x5887('0x4e')](_0x335ce0['where'],{'$or':_['map'](_0x335ce0['attributes'],function(_0x1e7e31){var _0x3b2713={};_0x3b2713[_0x1e7e31]={'$like':'%'+_0x3f2f41[_0x5887('0x44')][_0x5887('0x4d')]+'%'};return _0x3b2713;})});}_0x335ce0=_[_0x5887('0x4e')]({},_0x335ce0,_0x3f2f41[_0x5887('0x50')]);return db[_0x5887('0x6a')][_0x5887('0x2b')]({'where':_0x335ce0[_0x5887('0x4b')]})[_0x5887('0x32')](function(_0x12f02d){_0x4becb7[_0x5887('0x2b')]=_0x12f02d;if(_0x3f2f41[_0x5887('0x44')]['includeAll']){_0x335ce0[_0x5887('0x52')]=[{'all':!![]}];}return db[_0x5887('0x6a')]['findAll'](_0x335ce0);})['then'](function(_0x36efda){_0x4becb7[_0x5887('0x53')]=_0x36efda;return _0x4becb7;});}})[_0x5887('0x32')](respondWithFilteredResult(_0x4201a5,_0x335ce0))[_0x5887('0x24')](handleError(_0x4201a5,null));};exports[_0x5887('0x6b')]=function(_0x36ca68,_0x157b5d,_0x262abd){return db['OpenchannelAccount'][_0x5887('0x58')]({'where':{'id':_0x36ca68[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x157b5d,null))['then'](function(_0x13b848){if(_0x13b848){return _0x13b848[_0x5887('0x6b')](_0x36ca68[_0x5887('0x44')][_0x5887('0x6c')]);}})[_0x5887('0x32')](respondWithStatusCode(_0x157b5d,null))[_0x5887('0x24')](handleError(_0x157b5d,null));};exports[_0x5887('0x6d')]=function(_0x3ef646,_0x5497fa,_0x39ca16){var _0x44512d={'body':_0x3ef646['body'],'channel':'openchannel'};var _0x21c49f=[];var _0x4ce77e=[];var _0x5a3983={};var _0x53b645=![];return db[_0x5887('0x6e')][_0x5887('0x61')]()[_0x5887('0x32')](function(_0x33ba0f){if(!_0x33ba0f){throw new db[(_0x5887('0x6f'))]['ValidationError'](_0x5887('0x70'));}_0x21c49f=_[_0x5887('0x71')](_[_0x5887('0x42')](_0x33ba0f),[_0x5887('0x72'),_0x5887('0x73')]);_0x4ce77e=_['difference'](_[_0x5887('0x42')](_0x33ba0f),[_0x5887('0x72'),_0x5887('0x73'),_0x5887('0x74'),'ListId']);if(_0x3ef646['body']['id']){delete _0x3ef646['body']['id'];}if(_[_0x5887('0x75')](_0x3ef646['body'][_0x5887('0x76')])){throw new db[(_0x5887('0x6f'))][(_0x5887('0x77'))](_0x5887('0x78'));}if(_[_0x5887('0x75')](_0x3ef646[_0x5887('0x5a')][_0x5887('0x5a')])||_0x3ef646[_0x5887('0x5a')]['body']===''){throw new db[(_0x5887('0x6f'))][(_0x5887('0x77'))](_0x5887('0x79'));}if(_['isNil'](_0x3ef646[_0x5887('0x5a')][_0x5887('0x7a')])){throw new db[(_0x5887('0x6f'))][(_0x5887('0x77'))](_0x5887('0x7b')+_0x4ce77e);}if(!_[_0x5887('0x7c')](_0x4ce77e,_0x3ef646[_0x5887('0x5a')][_0x5887('0x7a')])){throw new db[(_0x5887('0x6f'))][(_0x5887('0x77'))](_0x5887('0x7d')+_0x4ce77e);}_0x5a3983[_0x3ef646[_0x5887('0x5a')]['mapKey']]=_0x3ef646[_0x5887('0x5a')][_0x5887('0x76')];})[_0x5887('0x32')](function(){return db['OpenchannelAccount'][_0x5887('0x58')]({'where':{'id':_0x3ef646['params']['id']},'include':[{'model':db[_0x5887('0x7e')],'as':_0x5887('0x7f'),'include':[{'model':db[_0x5887('0x6e')],'as':'Contacts','where':_0x5a3983,'limit':0x1,'order':[[_0x5887('0x73'),_0x5887('0x80')]]}]},{'model':db[_0x5887('0x81')],'as':'Applications'}]});})[_0x5887('0x32')](handleEntityNotFound(_0x5497fa,null))[_0x5887('0x32')](function(_0x234b47){if(_0x234b47&&_0x234b47[_0x5887('0x7f')]){_0x44512d[_0x5887('0x82')]=_0x234b47;_0x44512d[_0x5887('0x83')]=_0x234b47[_0x5887('0x84')];_0x44512d[_0x5887('0x85')]=_0x234b47['List'];_0x44512d['applications']=_['orderBy'](_0x44512d[_0x5887('0x83')],[_0x5887('0x86')],[_0x5887('0x87')]);if(_0x44512d[_0x5887('0x82')]['Applications']){delete _0x44512d[_0x5887('0x82')][_0x5887('0x84')];}if(_0x44512d[_0x5887('0x82')]['List']&&_0x44512d[_0x5887('0x82')]['List'][_0x5887('0x88')][_0x5887('0x47')]){return _0x44512d['account'][_0x5887('0x7f')][_0x5887('0x88')][0x0];}var _0x5e3f0d=_[_0x5887('0x15')](_0x3ef646['body'],{'firstName':_0x3ef646[_0x5887('0x5a')][_0x5887('0x76')],'ListId':_0x234b47[_0x5887('0x89')]});_0x5e3f0d[_0x3ef646[_0x5887('0x5a')]['mapKey']]=_0x3ef646[_0x5887('0x5a')][_0x5887('0x76')];return db['CmContact'][_0x5887('0x59')](_0x5e3f0d,{'fields':_0x21c49f,'raw':!![]});}})[_0x5887('0x32')](handleEntityNotFound(_0x5497fa,null))['then'](function(_0x5b8f3f){_0x44512d[_0x5887('0x8a')]=_0x5b8f3f;if(_0x5b8f3f){var _0x8ed75d={'ContactId':_0x5b8f3f['id'],'OpenchannelAccountId':_0x3ef646[_0x5887('0x55')]['id'],'from':(_0x5b8f3f[_0x5887('0x8b')]||'')+'\x20'+(_0x5b8f3f[_0x5887('0x8c')]||'')};var _0x23683b={'OpenchannelAccountId':_0x3ef646[_0x5887('0x55')]['id'],'closed':![]};if(_0x3ef646[_0x5887('0x5a')][_0x5887('0x8d')]){_0x23683b[_0x5887('0x8d')]=_0x3ef646[_0x5887('0x5a')][_0x5887('0x8d')];return db[_0x5887('0x8e')][_0x5887('0x58')]({'where':_0x23683b})[_0x5887('0x32')](function(_0x2ead8a){if(_0x2ead8a){return[_0x2ead8a,![]];}_0x8ed75d[_0x5887('0x8d')]=_0x3ef646['body'][_0x5887('0x8d')];_0x8ed75d[_0x5887('0x8f')]=_0x3ef646[_0x5887('0x5a')][_0x5887('0x8f')];return db['OpenchannelInteraction'][_0x5887('0x59')](_0x8ed75d)['then'](function(_0xa7f13a){return[_0xa7f13a,!![]];});});}else{_0x23683b[_0x5887('0x8d')]=null;}_0x23683b['ContactId']=_0x5b8f3f['id'];return db[_0x5887('0x8e')][_0x5887('0x58')]({'where':_0x23683b})[_0x5887('0x32')](function(_0xbf4593){if(_0xbf4593){return[_0xbf4593,![]];}return db[_0x5887('0x8e')][_0x5887('0x59')](_0x8ed75d)['then'](function(_0x1138cd){return[_0x1138cd,!![]];});});}})[_0x5887('0x90')](function(_0xc3b8dd,_0x5e275b){if(_0xc3b8dd){_0x53b645=_0x5e275b;if(!_0x5e275b){var _0x1fb8a0={'from':(_0x44512d[_0x5887('0x8a')]['firstName']||'')+'\x20'+(_0x44512d[_0x5887('0x8a')][_0x5887('0x8c')]||'')};if(_0x3ef646[_0x5887('0x5a')][_0x5887('0x8d')]&&_0x3ef646[_0x5887('0x5a')][_0x5887('0x91')]&&_0x3ef646[_0x5887('0x5a')][_0x5887('0x8d')]!=_0x3ef646['body'][_0x5887('0x91')]){_0x1fb8a0[_0x5887('0x8d')]=_0x3ef646[_0x5887('0x5a')][_0x5887('0x91')];}return _0xc3b8dd[_0x5887('0x31')](_0x1fb8a0);}else{return _0xc3b8dd;}}})[_0x5887('0x32')](function(_0x2d88c0){_0x44512d[_0x5887('0x92')]=_0x2d88c0['get']({'plain':!![]});_0x44512d[_0x5887('0x92')][_0x5887('0x93')]=_0x53b645;if(_0x44512d['interaction'][_0x5887('0x93')]){if(_0x44512d['account']['autoclose']){_0x44512d[_0x5887('0x83')][_0x5887('0x94')]({'id':0x0,'priority':_0x44512d[_0x5887('0x83')][_0x5887('0x47')]+0x1,'app':_0x5887('0x95'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x5887('0x96')][_0x5887('0x59')]({'body':_0x3ef646[_0x5887('0x5a')][_0x5887('0x5a')],'OpenchannelAccountId':_0x3ef646['params']['id'],'OpenchannelInteractionId':_0x2d88c0['id'],'direction':'in','ContactId':_0x44512d[_0x5887('0x8a')]['id'],'AttachmentId':_0x3ef646['body'][_0x5887('0x97')]});})[_0x5887('0x32')](function(_0x18f4ec){_0x44512d['message']=_0x18f4ec;if(_0x44512d[_0x5887('0x92')][_0x5887('0x98')]){return db['User']['find']({'attributes':['id',_0x5887('0x37')],'where':{'id':_0x44512d['interaction']['UserId']}})[_0x5887('0x32')](function(_0x39c343){if(_0x39c343){_0x44512d['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x5887('0x99'),'appdata':_0x39c343['name']+','+(_0x44512d[_0x5887('0x82')][_0x5887('0x9a')]||0xa),'interval':'*,*,*,*'});_0x44512d[_0x5887('0x9b')]=![];}return respondWithRpcPromise(_0x5887('0x9c'),_0x5887('0x9d'),_0x44512d);});}return respondWithRpcPromise('Start','startRouting',_0x44512d);})[_0x5887('0x32')](function(_0x5f4812){respondWithRpcPromise(_0x5887('0x9e'),_0x5887('0x9e'),{'event':_0x5887('0x6d'),'message':_0x5f4812},client9002);return _0x5f4812;})[_0x5887('0x32')](respondWithResult(_0x5497fa,null))[_0x5887('0x24')](handleError(_0x5497fa,null));};exports[_0x5887('0x9f')]=function(_0x5255a0,_0x2d6388){var _0x4eee12=_0x5255a0[_0x5887('0x55')]['id'];var _0x5b236a=_0x5255a0[_0x5887('0x5a')];var _0x2e2279=0xc8;var _0xddab0c=null;return db[_0x5887('0xa0')]['transaction']({'isolationLevel':db[_0x5887('0xa0')][_0x5887('0xa1')][_0x5887('0xa2')]['READ_COMMITTED']},function(_0x3363c1){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4eee12},'transaction':_0x3363c1})[_0x5887('0x32')](function(_0x3a0814){if(_0x3a0814){return db['OpenchannelApplication'][_0x5887('0x60')]({'where':{'OpenchannelAccountId':_0x4eee12},'transaction':_0x3363c1})['then'](function(){var _0x3f7789=_['map'](_0x5b236a,function(_0x7efc69){_0x7efc69[_0x5887('0x67')]=_0x4eee12;return _0x7efc69;});return db[_0x5887('0x81')]['bulkCreate'](_0x3f7789,{'transaction':_0x3363c1});});}else{_0x2e2279=0x194;_0xddab0c=[];}});})['then'](function(){if(_0x2e2279!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4eee12},'order':_0x5887('0x86')})[_0x5887('0x32')](function(_0x17bc97){_0xddab0c=_0x17bc97;});}})['catch'](function(_0x2f6f21){_0x2e2279=0x1f4;logger['error'](_0x2f6f21[_0x5887('0x36')]);if(_0x2f6f21[_0x5887('0x37')]){delete _0x2f6f21['name'];}_0xddab0c=_0x2f6f21;})[_0x5887('0xa3')](function(){if(_0xddab0c===null){_0x2d6388[_0x5887('0x25')](_0x2e2279);}else{if(_0x2e2279===0x1f4){_0x2d6388[_0x5887('0x26')](_0x2e2279)[_0x5887('0x38')](_0xddab0c);}else{_0x2d6388[_0x5887('0x26')](_0x2e2279)[_0x5887('0x2e')](_0xddab0c);}}});};exports[_0x5887('0xa4')]=function(_0x4c2581,_0x1b2a45,_0x50347d){var _0x1b6a03={};var _0x5c2b75={};var _0x547c69;var _0x27d0b6;return db[_0x5887('0x3d')][_0x5887('0x65')]({'where':{'id':_0x4c2581['params']['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x1b2a45,null))['then'](function(_0x2ad4ae){if(_0x2ad4ae){_0x547c69=_0x2ad4ae;_0x5c2b75[_0x5887('0x41')]=_[_0x5887('0x42')](db[_0x5887('0x81')][_0x5887('0x56')]);_0x5c2b75[_0x5887('0x44')]=_['keys'](_0x4c2581['query']);_0x5c2b75[_0x5887('0x43')]=_[_0x5887('0x46')](_0x5c2b75[_0x5887('0x41')],_0x5c2b75[_0x5887('0x44')]);_0x1b6a03[_0x5887('0x45')]=_[_0x5887('0x46')](_0x5c2b75[_0x5887('0x41')],qs['fields'](_0x4c2581[_0x5887('0x44')][_0x5887('0x57')]));_0x1b6a03[_0x5887('0x45')]=_0x1b6a03[_0x5887('0x45')][_0x5887('0x47')]?_0x1b6a03[_0x5887('0x45')]:_0x5c2b75[_0x5887('0x41')];_0x1b6a03[_0x5887('0x66')]=qs[_0x5887('0x4a')](_0x4c2581['query']['sort']);_0x1b6a03[_0x5887('0x4b')]=qs['filters'](_[_0x5887('0x4c')](_0x4c2581[_0x5887('0x44')],_0x5c2b75[_0x5887('0x43')]));if(_0x4c2581['query']['filter']){_0x1b6a03[_0x5887('0x4b')]=_['merge'](_0x1b6a03['where'],{'$or':_[_0x5887('0x3c')](_0x1b6a03[_0x5887('0x45')],function(_0x57558f){var _0x13ec4e={};_0x13ec4e[_0x57558f]={'$like':'%'+_0x4c2581[_0x5887('0x44')][_0x5887('0x4d')]+'%'};return _0x13ec4e;})});}_0x1b6a03=_['merge']({},_0x1b6a03,_0x4c2581[_0x5887('0x50')]);return _0x547c69[_0x5887('0xa4')](_0x1b6a03);}})[_0x5887('0x32')](function(_0x538ce3){if(_0x538ce3){_0x27d0b6=_0x538ce3[_0x5887('0x47')];if(!_0x4c2581[_0x5887('0x44')]['hasOwnProperty'](_0x5887('0x49'))){_0x1b6a03['limit']=qs['limit'](_0x4c2581[_0x5887('0x44')][_0x5887('0x2a')]);_0x1b6a03['offset']=qs[_0x5887('0x28')](_0x4c2581[_0x5887('0x44')][_0x5887('0x28')]);}return _0x547c69[_0x5887('0xa4')](_0x1b6a03);}})['then'](function(_0x57aee7){if(_0x57aee7){return _0x57aee7?{'count':_0x27d0b6,'rows':_0x57aee7}:null;}})['then'](respondWithResult(_0x1b2a45,null))['catch'](handleError(_0x1b2a45,null));};exports[_0x5887('0xa5')]=function(_0x3fb9dc,_0x1d7c78,_0x1d6975){var _0x5d5467={'raw':![],'where':{}};var _0x4ea96c={};var _0x297f7d={'count':0x0,'rows':[]};return db[_0x5887('0x3d')][_0x5887('0x65')]({'where':{'id':_0x3fb9dc[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x1d7c78,null))['then'](function(_0x20dd79){if(_0x20dd79){_0x4ea96c[_0x5887('0x41')]=_[_0x5887('0x42')](db[_0x5887('0x8e')][_0x5887('0x56')]);_0x4ea96c[_0x5887('0x44')]=_['keys'](_0x3fb9dc[_0x5887('0x44')]);_0x4ea96c[_0x5887('0x43')]=_[_0x5887('0x46')](_0x4ea96c['model'],_0x4ea96c['query']);_0x5d5467['attributes']=_[_0x5887('0x46')](_0x4ea96c[_0x5887('0x41')],qs[_0x5887('0x57')](_0x3fb9dc['query'][_0x5887('0x57')]));_0x5d5467[_0x5887('0x45')]=_0x5d5467[_0x5887('0x45')][_0x5887('0x47')]?_0x5d5467[_0x5887('0x45')]:_0x4ea96c[_0x5887('0x41')];if(!_0x3fb9dc['query'][_0x5887('0x48')]('nolimit')){_0x5d5467[_0x5887('0x2a')]=qs[_0x5887('0x2a')](_0x3fb9dc[_0x5887('0x44')]['limit']);_0x5d5467[_0x5887('0x28')]=qs[_0x5887('0x28')](_0x3fb9dc[_0x5887('0x44')][_0x5887('0x28')]);}_0x5d5467[_0x5887('0x66')]=qs[_0x5887('0x4a')](_0x3fb9dc[_0x5887('0x44')][_0x5887('0x4a')]);_0x5d5467[_0x5887('0x4b')]=qs[_0x5887('0x43')](_[_0x5887('0x4c')](_0x3fb9dc[_0x5887('0x44')],_0x4ea96c['filters']));_0x5d5467['where'][_0x5887('0x67')]=_0x20dd79['id'];if(_0x3fb9dc['query'][_0x5887('0x4d')]){_0x5d5467[_0x5887('0x4b')]=_[_0x5887('0x4e')](_0x5d5467[_0x5887('0x4b')],{'$or':_['map'](_0x5d5467[_0x5887('0x45')],function(_0x2db321){var _0x47abf1={};_0x47abf1[_0x2db321]={'$like':'%'+_0x3fb9dc[_0x5887('0x44')][_0x5887('0x4d')]+'%'};return _0x47abf1;})});}_0x5d5467=_[_0x5887('0x4e')]({},_0x5d5467,_0x3fb9dc[_0x5887('0x50')]);return db['OpenchannelInteraction'][_0x5887('0x2b')]({'where':_0x5d5467[_0x5887('0x4b')]})[_0x5887('0x32')](function(_0x2e49d6){_0x297f7d[_0x5887('0x2b')]=_0x2e49d6;if(_0x3fb9dc['query'][_0x5887('0x51')]){_0x5d5467[_0x5887('0x52')]=[{'model':db[_0x5887('0x6e')],'as':_0x5887('0xa6'),'required':![]},{'model':db[_0x5887('0xa7')],'as':_0x5887('0xa8'),'attributes':['name',_0x5887('0xa9'),_0x5887('0xaa')],'required':![]},{'model':db[_0x5887('0xab')],'as':_0x5887('0xac'),'attributes':['id',_0x5887('0x37'),_0x5887('0xad')],'where':_0x3fb9dc[_0x5887('0x44')][_0x5887('0xae')]?{'id':_0x3fb9dc[_0x5887('0x44')][_0x5887('0xae')]}:undefined,'required':_0x3fb9dc['query'][_0x5887('0xae')]?!![]:![]}];}return db[_0x5887('0x8e')][_0x5887('0xaf')](_0x5d5467);})[_0x5887('0x32')](function(_0x3c6df1){_0x297f7d[_0x5887('0x53')]=_0x3c6df1;return _0x297f7d;});}})['then'](respondWithFilteredResult(_0x1d7c78,_0x5d5467))[_0x5887('0x24')](handleError(_0x1d7c78,null));};exports['addAgents']=function(_0x16d74b,_0x4fe107,_0xfcd2f8){return db[_0x5887('0x3d')][_0x5887('0x58')]({'where':{'id':_0x16d74b[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x4fe107,null))[_0x5887('0x32')](function(_0x271d83){if(_0x271d83){return _0x271d83[_0x5887('0xb0')](_0x16d74b['body'][_0x5887('0x6c')],_[_0x5887('0xb1')](_0x16d74b[_0x5887('0x5a')],[_0x5887('0x6c'),'id'])||{})['spread'](function(_0x514444){for(var _0x50cea2=0x0;_0x50cea2<_0x16d74b[_0x5887('0x5a')]['ids'][_0x5887('0x47')];_0x50cea2+=0x1){socket['emit'](_0x5887('0xb2'),{'UserId':Number(_0x16d74b[_0x5887('0x5a')][_0x5887('0x6c')][_0x50cea2]),'OpenchannelAccountId':Number(_0x16d74b[_0x5887('0x55')]['id'])});}return _0x514444;});}})[_0x5887('0x32')](respondWithResult(_0x4fe107,null))[_0x5887('0x24')](handleError(_0x4fe107,null));};exports[_0x5887('0xb3')]=function(_0x17e141,_0x440345,_0x404f48){return db[_0x5887('0x3d')][_0x5887('0x58')]({'where':{'id':_0x17e141[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x440345,null))['then'](function(_0x16ea94){if(_0x16ea94){return _0x16ea94[_0x5887('0xb3')](_0x17e141['query'][_0x5887('0x6c')])[_0x5887('0x32')](function(){if(_[_0x5887('0xb4')](_0x17e141[_0x5887('0x44')][_0x5887('0x6c')])){for(var _0xd2d0af=0x0;_0xd2d0af<_0x17e141['query'][_0x5887('0x6c')][_0x5887('0x47')];_0xd2d0af+=0x1){socket['emit'](_0x5887('0xb5'),{'UserId':Number(_0x17e141['query']['ids'][_0xd2d0af]),'OpenchannelAccountId':Number(_0x17e141[_0x5887('0x55')]['id'])});}}else{socket[_0x5887('0xb6')](_0x5887('0xb5'),{'UserId':Number(_0x17e141[_0x5887('0x44')][_0x5887('0x6c')]),'OpenchannelAccountId':Number(_0x17e141[_0x5887('0x55')]['id'])});}});}})[_0x5887('0x32')](respondWithStatusCode(_0x440345,null))['catch'](handleError(_0x440345,null));};exports[_0x5887('0xb7')]=function(_0x4cc63e,_0x491bfa,_0xbf5f37){var _0x506233={};var _0x32af33={};var _0x442788;var _0xba20d4;return db[_0x5887('0x3d')][_0x5887('0x65')]({'where':{'id':_0x4cc63e[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x491bfa,null))[_0x5887('0x32')](function(_0x920451){if(_0x920451){_0x442788=_0x920451;_0x32af33[_0x5887('0x41')]=_[_0x5887('0x42')](db[_0x5887('0xa7')][_0x5887('0x56')]);_0x32af33['query']=_[_0x5887('0x42')](_0x4cc63e[_0x5887('0x44')]);_0x32af33[_0x5887('0x43')]=_['intersection'](_0x32af33['model'],_0x32af33[_0x5887('0x44')]);_0x506233[_0x5887('0x45')]=_[_0x5887('0x46')](_0x32af33[_0x5887('0x41')],qs['fields'](_0x4cc63e[_0x5887('0x44')][_0x5887('0x57')]));_0x506233[_0x5887('0x45')]=_0x506233[_0x5887('0x45')][_0x5887('0x47')]?_0x506233[_0x5887('0x45')]:_0x32af33[_0x5887('0x41')];_0x506233[_0x5887('0x66')]=qs[_0x5887('0x4a')](_0x4cc63e[_0x5887('0x44')][_0x5887('0x4a')]);_0x506233['where']=qs[_0x5887('0x43')](_[_0x5887('0x4c')](_0x4cc63e['query'],_0x32af33[_0x5887('0x43')]));if(_0x4cc63e[_0x5887('0x44')]['filter']){_0x506233[_0x5887('0x4b')]=_['merge'](_0x506233[_0x5887('0x4b')],{'$or':_[_0x5887('0x3c')](_0x506233[_0x5887('0x45')],function(_0x3e67ad){var _0x3f7b66={};_0x3f7b66[_0x3e67ad]={'$like':'%'+_0x4cc63e[_0x5887('0x44')][_0x5887('0x4d')]+'%'};return _0x3f7b66;})});}_0x506233=_[_0x5887('0x4e')]({},_0x506233,_0x4cc63e[_0x5887('0x50')]);return _0x442788[_0x5887('0xb7')](_0x506233);}})[_0x5887('0x32')](function(_0x5c5934){if(_0x5c5934){_0xba20d4=_0x5c5934[_0x5887('0x47')];if(!_0x4cc63e[_0x5887('0x44')][_0x5887('0x48')](_0x5887('0x49'))){_0x506233[_0x5887('0x2a')]=qs[_0x5887('0x2a')](_0x4cc63e['query'][_0x5887('0x2a')]);_0x506233['offset']=qs[_0x5887('0x28')](_0x4cc63e[_0x5887('0x44')]['offset']);}return _0x442788[_0x5887('0xb7')](_0x506233);}})[_0x5887('0x32')](function(_0x5cd32a){if(_0x5cd32a){return _0x5cd32a?{'count':_0xba20d4,'rows':_0x5cd32a}:null;}})[_0x5887('0x32')](respondWithResult(_0x491bfa,null))['catch'](handleError(_0x491bfa,null));};exports['send']=function(_0x2067e8,_0x393eea,_0xa799e8){var _0x3c30ce,_0x4d3e05,_0x4558f1;if(_[_0x5887('0x75')](_0x2067e8[_0x5887('0x5a')][_0x5887('0x5a')])||_0x2067e8[_0x5887('0x5a')][_0x5887('0x5a')]===''){throw new db[(_0x5887('0x6f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5887('0x75')](_0x2067e8[_0x5887('0x5a')]['to'])){}_0x3c30ce=_0x2067e8[_0x5887('0x5a')]['to'];return db[_0x5887('0x3d')]['findOne']({'where':{'id':_0x2067e8[_0x5887('0x55')]['id']}})[_0x5887('0x32')](handleEntityNotFound(_0x393eea,null))[_0x5887('0x32')](function(_0x2d80fe){if(_0x2d80fe){return db[_0x5887('0x3d')][_0x5887('0x58')]({'where':{'id':_0x2d80fe['id']},'include':[{'model':db['CmList'],'as':_0x5887('0x7f'),'include':[{'model':db[_0x5887('0x6e')],'as':_0x5887('0x88'),'where':{[_0x2d80fe[_0x5887('0x7a')]]:_0x3c30ce},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x393eea,null))[_0x5887('0x32')](function(_0x75e445){if(_0x75e445&&_0x75e445[_0x5887('0x7f')]){_0x4d3e05=_0x75e445[_0x5887('0x33')]({'plain':!![]});if(_0x4d3e05[_0x5887('0x7f')]&&_0x4d3e05[_0x5887('0x7f')][_0x5887('0x88')][_0x5887('0x47')]){return _0x4d3e05['List'][_0x5887('0x88')][0x0];}return db[_0x5887('0x6e')][_0x5887('0x59')](_[_0x5887('0x15')](_0x2067e8[_0x5887('0x5a')],{'firstName':_0x3c30ce,[_0x75e445[_0x5887('0x7a')]]:_0x3c30ce,'phone':_0x3c30ce,'ListId':_0x4d3e05[_0x5887('0x89')]}));}})[_0x5887('0x32')](handleEntityNotFound(_0x393eea,null))['then'](function(_0x53f179){if(_0x53f179){_0x4558f1=_0x53f179;return db['OpenchannelInteraction'][_0x5887('0x58')]({'where':{'ContactId':_0x4558f1['id'],'closed':![],'OpenchannelAccountId':_0x4d3e05['id']}})[_0x5887('0x32')](function(_0x204f3e){if(_0x204f3e){return[_0x204f3e,![]];}return db[_0x5887('0x8e')][_0x5887('0x59')]({'UserId':_0x2067e8[_0x5887('0x5c')]['id'],'ContactId':_0x4558f1['id'],'OpenchannelAccountId':_0x4d3e05['id'],'lastMsgDirection':_0x5887('0xb8'),'Messages':[_[_0x5887('0x4e')](_0x2067e8['body'],{'read':![],'body':_0x2067e8[_0x5887('0x5a')]['body'],'OpenchannelAccountId':_0x4d3e05['id'],'UserId':_0x2067e8[_0x5887('0x5c')]['id'],'ContactId':_0x4558f1['id']})]},{'include':[{'model':db[_0x5887('0x96')],'as':_0x5887('0xb9')}]})['then'](function(_0x529775){return[_0x529775,!![]];});});}})[_0x5887('0x90')](function(_0x10258d,_0x23e427){if(_0x23e427){return _0x10258d;}return db[_0x5887('0x96')][_0x5887('0x59')](_[_0x5887('0x4e')](_0x2067e8['body'],{'read':![],'body':_0x2067e8[_0x5887('0x5a')][_0x5887('0x5a')],'OpenchannelAccountId':_0x4d3e05['id'],'OpenchannelInteractionId':_0x10258d['id'],'UserId':_0x2067e8['user']['id'],'ContactId':_0x4558f1['id']}))[_0x5887('0x32')](function(_0x4d83f4){_0x10258d[_0x5887('0xba')][_0x5887('0xb9')]=[];_0x10258d[_0x5887('0xba')][_0x5887('0xb9')][_0x5887('0x94')](_0x4d83f4['dataValues']);return _0x10258d;});});}})['then'](respondWithResult(_0x393eea,null))[_0x5887('0x24')](handleError(_0x393eea,null));}; \ No newline at end of file +var _0x5d6f=['OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','Start','EventManager','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','sendStatus','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','OpenchannelAccounts','UserProfileResource','destroy','stack','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','findAll','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*'];(function(_0x13d18f,_0x385fe5){var _0x506a2c=function(_0x2f9768){while(--_0x2f9768){_0x13d18f['push'](_0x13d18f['shift']());}};_0x506a2c(++_0x385fe5);}(_0x5d6f,0xe4));var _0xf5d6=function(_0x13c19c,_0x1d4a84){_0x13c19c=_0x13c19c-0x0;var _0x594ee4=_0x5d6f[_0x13c19c];return _0x594ee4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5d6('0x0'));var zipdir=require(_0xf5d6('0x1'));var jsonpatch=require(_0xf5d6('0x2'));var rp=require('request-promise');var moment=require(_0xf5d6('0x3'));var BPromise=require(_0xf5d6('0x4'));var Mustache=require(_0xf5d6('0x5'));var util=require(_0xf5d6('0x6'));var path=require(_0xf5d6('0x7'));var sox=require(_0xf5d6('0x8'));var csv=require(_0xf5d6('0x9'));var ejs=require(_0xf5d6('0xa'));var fs=require('fs');var fs_extra=require(_0xf5d6('0xb'));var _=require(_0xf5d6('0xc'));var squel=require('squel');var crypto=require(_0xf5d6('0xd'));var jsforce=require(_0xf5d6('0xe'));var deskjs=require(_0xf5d6('0xf'));var toCsv=require(_0xf5d6('0x9'));var querystring=require(_0xf5d6('0x10'));var Papa=require(_0xf5d6('0x11'));var Redis=require(_0xf5d6('0x12'));var authService=require(_0xf5d6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf5d6('0x14'));var hardwareService=require(_0xf5d6('0x15'));var logger=require(_0xf5d6('0x16'))(_0xf5d6('0x17'));var utils=require(_0xf5d6('0x18'));var config=require(_0xf5d6('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf5d6('0x1a')]=_[_0xf5d6('0x1b')](config[_0xf5d6('0x1a')],{'host':_0xf5d6('0x1c'),'port':0x18eb});var socket=require(_0xf5d6('0x1d'))(new Redis(config[_0xf5d6('0x1a')]));require(_0xf5d6('0x1e'))['register'](socket);var jayson=require(_0xf5d6('0x1f'));var client=jayson[_0xf5d6('0x20')][_0xf5d6('0x21')]({'port':0x232c});var client9002=jayson[_0xf5d6('0x20')][_0xf5d6('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x27053a,_0x9c9f61,_0x35a003,_0x3eecf6){return new BPromise(function(_0x548831,_0xb3fbd0){var _0xcea3e0=_0x3eecf6||client;return _0xcea3e0[_0xf5d6('0x22')](_0x27053a,_0x35a003)[_0xf5d6('0x23')](function(_0x7a9d71){logger['info'](_0xf5d6('0x24'),_0x9c9f61,_0xf5d6('0x25'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x9c9f61,_0xf5d6('0x25'),JSON[_0xf5d6('0x26')](_0x7a9d71));if(_0x7a9d71[_0xf5d6('0x27')]){if(_0x7a9d71[_0xf5d6('0x27')][_0xf5d6('0x28')]===0x1f4){logger[_0xf5d6('0x27')](_0xf5d6('0x24'),_0x9c9f61,_0x7a9d71[_0xf5d6('0x27')]['message']);return _0xb3fbd0(_0x7a9d71['error'][_0xf5d6('0x29')]);}logger[_0xf5d6('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x9c9f61,_0x7a9d71[_0xf5d6('0x27')][_0xf5d6('0x29')]);return _0x548831(_0x7a9d71[_0xf5d6('0x27')][_0xf5d6('0x29')]);}else{logger['info'](_0xf5d6('0x24'),_0x9c9f61,_0xf5d6('0x25'));_0x548831(_0x7a9d71[_0xf5d6('0x2a')][_0xf5d6('0x29')]);}})[_0xf5d6('0x2b')](function(_0x4c5ba5){logger[_0xf5d6('0x27')](_0xf5d6('0x24'),_0x9c9f61,_0x4c5ba5);_0xb3fbd0(_0x4c5ba5);});});}function respondWithStatusCode(_0x13745b,_0x6ad863){_0x6ad863=_0x6ad863||0xcc;return function(_0x639899){if(_0x639899){return _0x13745b['sendStatus'](_0x6ad863);}return _0x13745b['status'](_0x6ad863)[_0xf5d6('0x2c')]();};}function respondWithResult(_0x48d60a,_0x62c64b){_0x62c64b=_0x62c64b||0xc8;return function(_0x4b4a73){if(_0x4b4a73){return _0x48d60a[_0xf5d6('0x2d')](_0x62c64b)[_0xf5d6('0x2e')](_0x4b4a73);}};}function respondWithFilteredResult(_0x1d070b,_0x12480){return function(_0x4d4840){if(_0x4d4840){var _0x2c7c30=typeof _0x12480[_0xf5d6('0x2f')]===_0xf5d6('0x30')&&typeof _0x12480[_0xf5d6('0x31')]===_0xf5d6('0x30');var _0x271c93=_0x4d4840['count'];var _0x493bd9=_0x2c7c30?0x0:_0x12480['offset'];var _0x474c22=_0x2c7c30?_0x4d4840[_0xf5d6('0x32')]:_0x12480[_0xf5d6('0x2f')]+_0x12480[_0xf5d6('0x31')];var _0x192085;if(_0x474c22>=_0x271c93){_0x474c22=_0x271c93;_0x192085=0xc8;}else{_0x192085=0xce;}_0x1d070b[_0xf5d6('0x2d')](_0x192085);return _0x1d070b['set'](_0xf5d6('0x33'),_0x493bd9+'-'+_0x474c22+'/'+_0x271c93)[_0xf5d6('0x2e')](_0x4d4840);}return null;};}function patchUpdates(_0x28ead0){return function(_0xf5ad9c){try{jsonpatch['apply'](_0xf5ad9c,_0x28ead0,!![]);}catch(_0x3c16da){return BPromise[_0xf5d6('0x34')](_0x3c16da);}return _0xf5ad9c[_0xf5d6('0x35')]();};}function saveUpdates(_0x13585e,_0x368c09){return function(_0x28f1aa){if(_0x28f1aa){return _0x28f1aa[_0xf5d6('0x36')](_0x13585e)[_0xf5d6('0x23')](function(_0x175173){return _0x175173;});}return null;};}function removeEntity(_0x343273,_0x2f4e25){return function(_0xd5e754){if(_0xd5e754){return _0xd5e754['destroy']()[_0xf5d6('0x23')](function(){var _0x33153d=_0xd5e754['get']({'plain':!![]});var _0x4d847d=_0xf5d6('0x37');return db[_0xf5d6('0x38')][_0xf5d6('0x39')]({'where':{'type':_0x4d847d,'resourceId':_0x33153d['id']}})['then'](function(){return _0xd5e754;});})[_0xf5d6('0x23')](function(){_0x343273[_0xf5d6('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dd740,_0x46cca4){return function(_0x5afae7){if(!_0x5afae7){_0x5dd740['sendStatus'](0x194);}return _0x5afae7;};}function handleError(_0xf5e1ca,_0x5791bf){_0x5791bf=_0x5791bf||0x1f4;return function(_0x19fbe2){logger[_0xf5d6('0x27')](_0x19fbe2[_0xf5d6('0x3a')]);if(_0x19fbe2['name']){delete _0x19fbe2[_0xf5d6('0x3b')];}_0xf5e1ca['status'](_0x5791bf)['send'](_0x19fbe2);};}exports['index']=function(_0xe7186a,_0x23628c){var _0x5f02b9={'include':[{'model':db[_0xf5d6('0x3c')],'as':_0xf5d6('0x3d')}]},_0x14f44c={},_0x4bad31={'count':0x0,'rows':[]};var _0x2d3782=_[_0xf5d6('0x3e')](db[_0xf5d6('0x3f')][_0xf5d6('0x40')],function(_0x3b5b25){return{'name':_0x3b5b25['fieldName'],'type':_0x3b5b25['type']['key']};});_0x14f44c['model']=_[_0xf5d6('0x3e')](_0x2d3782,_0xf5d6('0x3b'));_0x14f44c[_0xf5d6('0x41')]=_['keys'](_0xe7186a[_0xf5d6('0x41')]);_0x14f44c['filters']=_['intersection'](_0x14f44c[_0xf5d6('0x42')],_0x14f44c[_0xf5d6('0x41')]);_0x5f02b9[_0xf5d6('0x43')]=_[_0xf5d6('0x44')](_0x14f44c['model'],qs[_0xf5d6('0x45')](_0xe7186a[_0xf5d6('0x41')]['fields']));_0x5f02b9[_0xf5d6('0x43')]=_0x5f02b9[_0xf5d6('0x43')][_0xf5d6('0x46')]?_0x5f02b9[_0xf5d6('0x43')]:_0x14f44c[_0xf5d6('0x42')];if(!_0xe7186a[_0xf5d6('0x41')][_0xf5d6('0x47')](_0xf5d6('0x48'))){_0x5f02b9[_0xf5d6('0x31')]=qs['limit'](_0xe7186a['query']['limit']);_0x5f02b9[_0xf5d6('0x2f')]=qs[_0xf5d6('0x2f')](_0xe7186a[_0xf5d6('0x41')][_0xf5d6('0x2f')]);}_0x5f02b9['order']=qs[_0xf5d6('0x49')](_0xe7186a[_0xf5d6('0x41')][_0xf5d6('0x49')]);_0x5f02b9[_0xf5d6('0x4a')]=qs[_0xf5d6('0x4b')](_[_0xf5d6('0x4c')](_0xe7186a[_0xf5d6('0x41')],_0x14f44c[_0xf5d6('0x4b')]),_0x2d3782);if(_0xe7186a['query'][_0xf5d6('0x4d')]){_0x5f02b9[_0xf5d6('0x4a')]=_[_0xf5d6('0x4e')](_0x5f02b9['where'],{'$or':_[_0xf5d6('0x3e')](_0x2d3782,function(_0x450d5e){if(_0x450d5e['type']!==_0xf5d6('0x4f')){var _0x4519b9={};_0x4519b9[_0x450d5e[_0xf5d6('0x3b')]]={'$like':'%'+_0xe7186a[_0xf5d6('0x41')][_0xf5d6('0x4d')]+'%'};return _0x4519b9;}})});}_0x5f02b9=_['merge']({},_0x5f02b9,_0xe7186a[_0xf5d6('0x50')]);var _0x30d377={'where':_0x5f02b9['where']};return db['OpenchannelAccount'][_0xf5d6('0x32')](_0x30d377)[_0xf5d6('0x23')](function(_0x5c3a01){_0x4bad31[_0xf5d6('0x32')]=_0x5c3a01;if(_0xe7186a[_0xf5d6('0x41')][_0xf5d6('0x51')]){_0x5f02b9[_0xf5d6('0x52')]=[{'all':!![]}];}return db[_0xf5d6('0x3f')]['findAll'](_0x5f02b9);})[_0xf5d6('0x23')](function(_0x3bd3a8){_0x4bad31[_0xf5d6('0x53')]=_0x3bd3a8;return _0x4bad31;})['then'](respondWithFilteredResult(_0x23628c,_0x5f02b9))['catch'](handleError(_0x23628c,null));};exports['show']=function(_0x4cec3a,_0x277f60){var _0x4bdd28={'raw':![],'where':{'id':_0x4cec3a['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5a3723={};_0x5a3723[_0xf5d6('0x42')]=_[_0xf5d6('0x54')](db[_0xf5d6('0x3f')][_0xf5d6('0x40')]);_0x5a3723[_0xf5d6('0x41')]=_[_0xf5d6('0x54')](_0x4cec3a[_0xf5d6('0x41')]);_0x5a3723[_0xf5d6('0x4b')]=_['intersection'](_0x5a3723[_0xf5d6('0x42')],_0x5a3723[_0xf5d6('0x41')]);_0x4bdd28[_0xf5d6('0x43')]=_['intersection'](_0x5a3723[_0xf5d6('0x42')],qs[_0xf5d6('0x45')](_0x4cec3a[_0xf5d6('0x41')][_0xf5d6('0x45')]));_0x4bdd28[_0xf5d6('0x43')]=_0x4bdd28[_0xf5d6('0x43')]['length']?_0x4bdd28[_0xf5d6('0x43')]:_0x5a3723[_0xf5d6('0x42')];if(_0x4cec3a[_0xf5d6('0x41')][_0xf5d6('0x51')]){_0x4bdd28['include']=[{'all':!![]}];}_0x4bdd28=_[_0xf5d6('0x4e')]({},_0x4bdd28,_0x4cec3a[_0xf5d6('0x50')]);return db[_0xf5d6('0x3f')][_0xf5d6('0x55')](_0x4bdd28)[_0xf5d6('0x23')](handleEntityNotFound(_0x277f60,null))[_0xf5d6('0x23')](respondWithResult(_0x277f60,null))[_0xf5d6('0x2b')](handleError(_0x277f60,null));};exports[_0xf5d6('0x56')]=function(_0x5de4a0,_0x3c912f){return db[_0xf5d6('0x3f')][_0xf5d6('0x56')](_0x5de4a0['body'],{})['then'](function(_0x25d60b){var _0x1fc3a4=_0x5de4a0['user']['get']({'plain':!![]});if(!_0x1fc3a4)throw new Error(_0xf5d6('0x57'));if(_0x1fc3a4['role']===_0xf5d6('0x58')){var _0x37a40f=_0x25d60b[_0xf5d6('0x59')]({'plain':!![]});var _0x490054=_0xf5d6('0x37');return db['UserProfileSection'][_0xf5d6('0x55')]({'where':{'name':_0x490054,'userProfileId':_0x1fc3a4['userProfileId']},'raw':!![]})[_0xf5d6('0x23')](function(_0x2bb35b){if(_0x2bb35b&&_0x2bb35b[_0xf5d6('0x5a')]===0x0){return db[_0xf5d6('0x38')]['create']({'name':_0x37a40f[_0xf5d6('0x3b')],'resourceId':_0x37a40f['id'],'type':_0x2bb35b[_0xf5d6('0x3b')],'sectionId':_0x2bb35b['id']},{})[_0xf5d6('0x23')](function(){return _0x25d60b;});}else{return _0x25d60b;}})[_0xf5d6('0x2b')](function(_0x34325a){logger['error'](_0xf5d6('0x5b'),_0x34325a);throw _0x34325a;});}return _0x25d60b;})[_0xf5d6('0x23')](respondWithResult(_0x3c912f,0xc9))[_0xf5d6('0x2b')](handleError(_0x3c912f,null));};exports[_0xf5d6('0x36')]=function(_0x4e3c90,_0x5d07f0){if(_0x4e3c90['body']['id']){delete _0x4e3c90[_0xf5d6('0x5c')]['id'];}return db[_0xf5d6('0x3f')]['find']({'where':{'id':_0x4e3c90[_0xf5d6('0x5d')]['id']},'include':[{'model':db[_0xf5d6('0x3c')],'as':_0xf5d6('0x3d')}]})[_0xf5d6('0x23')](handleEntityNotFound(_0x5d07f0,null))[_0xf5d6('0x23')](saveUpdates(_0x4e3c90[_0xf5d6('0x5c')],null))[_0xf5d6('0x23')](respondWithResult(_0x5d07f0,null))[_0xf5d6('0x2b')](handleError(_0x5d07f0,null));};exports[_0xf5d6('0x39')]=function(_0x5bbcd3,_0x25819a){return db[_0xf5d6('0x3f')][_0xf5d6('0x55')]({'where':{'id':_0x5bbcd3[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x25819a,null))[_0xf5d6('0x23')](removeEntity(_0x25819a,null))[_0xf5d6('0x2b')](handleError(_0x25819a,null));};exports[_0xf5d6('0x5e')]=function(_0x36599b,_0x133495){return db[_0xf5d6('0x3f')][_0xf5d6('0x5e')]()[_0xf5d6('0x23')](respondWithResult(_0x133495,null))[_0xf5d6('0x2b')](handleError(_0x133495,null));};exports[_0xf5d6('0x5f')]=function(_0x1f147c,_0x48ded2,_0x494d89){if(_0x1f147c[_0xf5d6('0x5c')]['id']){delete _0x1f147c[_0xf5d6('0x5c')]['id'];}return db[_0xf5d6('0x3f')][_0xf5d6('0x55')]({'where':{'id':_0x1f147c[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x48ded2,null))['then'](function(_0x20e48f){if(_0x20e48f){_0x1f147c['body'][_0xf5d6('0x60')]=_0x20e48f['id'];return db['Disposition'][_0xf5d6('0x56')](_0x1f147c[_0xf5d6('0x5c')]);}})[_0xf5d6('0x23')](respondWithResult(_0x48ded2,null))[_0xf5d6('0x2b')](handleError(_0x48ded2,null));};exports[_0xf5d6('0x61')]=function(_0x5cbfc6,_0x1d2020,_0x303760){var _0x592aa5={'raw':![],'where':{}};var _0x5c5ce0={};var _0x167924={'count':0x0,'rows':[]};return db[_0xf5d6('0x3f')][_0xf5d6('0x62')]({'where':{'id':_0x5cbfc6[_0xf5d6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1d2020,null))[_0xf5d6('0x23')](function(_0xb50d50){if(_0xb50d50){_0x5c5ce0['model']=_[_0xf5d6('0x54')](db[_0xf5d6('0x63')][_0xf5d6('0x40')]);_0x5c5ce0[_0xf5d6('0x41')]=_[_0xf5d6('0x54')](_0x5cbfc6[_0xf5d6('0x41')]);_0x5c5ce0['filters']=_['intersection'](_0x5c5ce0['model'],_0x5c5ce0[_0xf5d6('0x41')]);_0x592aa5[_0xf5d6('0x43')]=_[_0xf5d6('0x44')](_0x5c5ce0[_0xf5d6('0x42')],qs[_0xf5d6('0x45')](_0x5cbfc6['query'][_0xf5d6('0x45')]));_0x592aa5[_0xf5d6('0x43')]=_0x592aa5[_0xf5d6('0x43')][_0xf5d6('0x46')]?_0x592aa5['attributes']:_0x5c5ce0[_0xf5d6('0x42')];if(!_0x5cbfc6['query'][_0xf5d6('0x47')](_0xf5d6('0x48'))){_0x592aa5['limit']=qs['limit'](_0x5cbfc6[_0xf5d6('0x41')]['limit']);_0x592aa5[_0xf5d6('0x2f')]=qs[_0xf5d6('0x2f')](_0x5cbfc6['query']['offset']);}_0x592aa5['order']=qs[_0xf5d6('0x49')](_0x5cbfc6[_0xf5d6('0x41')][_0xf5d6('0x49')]);_0x592aa5['where']=qs[_0xf5d6('0x4b')](_[_0xf5d6('0x4c')](_0x5cbfc6[_0xf5d6('0x41')],_0x5c5ce0[_0xf5d6('0x4b')]));_0x592aa5[_0xf5d6('0x4a')][_0xf5d6('0x60')]=_0xb50d50['id'];if(_0x5cbfc6['query'][_0xf5d6('0x4d')]){_0x592aa5['where']=_['merge'](_0x592aa5['where'],{'$or':_[_0xf5d6('0x3e')](_0x592aa5[_0xf5d6('0x43')],function(_0xe4a6f1){var _0x32a778={};_0x32a778[_0xe4a6f1]={'$like':'%'+_0x5cbfc6[_0xf5d6('0x41')]['filter']+'%'};return _0x32a778;})});}_0x592aa5=_[_0xf5d6('0x4e')]({},_0x592aa5,_0x5cbfc6[_0xf5d6('0x50')]);return db['Disposition']['count']({'where':_0x592aa5[_0xf5d6('0x4a')]})[_0xf5d6('0x23')](function(_0x570749){_0x167924[_0xf5d6('0x32')]=_0x570749;if(_0x5cbfc6[_0xf5d6('0x41')][_0xf5d6('0x51')]){_0x592aa5[_0xf5d6('0x52')]=[{'all':!![]}];}return db[_0xf5d6('0x63')][_0xf5d6('0x64')](_0x592aa5);})['then'](function(_0x1cecf4){_0x167924[_0xf5d6('0x53')]=_0x1cecf4;return _0x167924;});}})[_0xf5d6('0x23')](respondWithFilteredResult(_0x1d2020,_0x592aa5))[_0xf5d6('0x2b')](handleError(_0x1d2020,null));};exports['removeDispositions']=function(_0x2509f9,_0x302c42,_0x122e93){return db[_0xf5d6('0x3f')][_0xf5d6('0x55')]({'where':{'id':_0x2509f9[_0xf5d6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x302c42,null))[_0xf5d6('0x23')](function(_0x4bdde5){if(_0x4bdde5){return _0x4bdde5['removeDispositions'](_0x2509f9[_0xf5d6('0x41')][_0xf5d6('0x65')]);}})[_0xf5d6('0x23')](respondWithStatusCode(_0x302c42,null))['catch'](handleError(_0x302c42,null));};exports[_0xf5d6('0x66')]=function(_0x333d83,_0x457401,_0x22f17c){if(_0x333d83[_0xf5d6('0x5c')]['id']){delete _0x333d83['body']['id'];}return db['OpenchannelAccount'][_0xf5d6('0x55')]({'where':{'id':_0x333d83[_0xf5d6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x457401,null))['then'](function(_0x3a3a98){if(_0x3a3a98){_0x333d83[_0xf5d6('0x5c')][_0xf5d6('0x60')]=_0x3a3a98['id'];return db['CannedAnswer']['create'](_0x333d83['body']);}})['then'](respondWithResult(_0x457401,null))[_0xf5d6('0x2b')](handleError(_0x457401,null));};exports[_0xf5d6('0x67')]=function(_0x1abde1,_0x353161,_0x2bcb0c){var _0x49f7e6={'raw':![],'where':{}};var _0x5f1374={};var _0x1aa749={'count':0x0,'rows':[]};return db[_0xf5d6('0x3f')][_0xf5d6('0x62')]({'where':{'id':_0x1abde1[_0xf5d6('0x5d')]['id']}})['then'](handleEntityNotFound(_0x353161,null))['then'](function(_0x4428a7){if(_0x4428a7){_0x5f1374[_0xf5d6('0x42')]=_['keys'](db[_0xf5d6('0x68')][_0xf5d6('0x40')]);_0x5f1374[_0xf5d6('0x41')]=_[_0xf5d6('0x54')](_0x1abde1[_0xf5d6('0x41')]);_0x5f1374[_0xf5d6('0x4b')]=_[_0xf5d6('0x44')](_0x5f1374['model'],_0x5f1374['query']);_0x49f7e6[_0xf5d6('0x43')]=_['intersection'](_0x5f1374[_0xf5d6('0x42')],qs['fields'](_0x1abde1[_0xf5d6('0x41')][_0xf5d6('0x45')]));_0x49f7e6['attributes']=_0x49f7e6[_0xf5d6('0x43')]['length']?_0x49f7e6[_0xf5d6('0x43')]:_0x5f1374[_0xf5d6('0x42')];if(!_0x1abde1[_0xf5d6('0x41')]['hasOwnProperty'](_0xf5d6('0x48'))){_0x49f7e6[_0xf5d6('0x31')]=qs[_0xf5d6('0x31')](_0x1abde1[_0xf5d6('0x41')][_0xf5d6('0x31')]);_0x49f7e6[_0xf5d6('0x2f')]=qs['offset'](_0x1abde1[_0xf5d6('0x41')][_0xf5d6('0x2f')]);}_0x49f7e6[_0xf5d6('0x69')]=qs[_0xf5d6('0x49')](_0x1abde1[_0xf5d6('0x41')]['sort']);_0x49f7e6[_0xf5d6('0x4a')]=qs['filters'](_[_0xf5d6('0x4c')](_0x1abde1['query'],_0x5f1374[_0xf5d6('0x4b')]));_0x49f7e6[_0xf5d6('0x4a')][_0xf5d6('0x60')]=_0x4428a7['id'];if(_0x1abde1['query']['filter']){_0x49f7e6[_0xf5d6('0x4a')]=_['merge'](_0x49f7e6['where'],{'$or':_[_0xf5d6('0x3e')](_0x49f7e6[_0xf5d6('0x43')],function(_0x209caf){var _0x312edf={};_0x312edf[_0x209caf]={'$like':'%'+_0x1abde1[_0xf5d6('0x41')][_0xf5d6('0x4d')]+'%'};return _0x312edf;})});}_0x49f7e6=_[_0xf5d6('0x4e')]({},_0x49f7e6,_0x1abde1['options']);return db['CannedAnswer'][_0xf5d6('0x32')]({'where':_0x49f7e6['where']})['then'](function(_0x133edf){_0x1aa749[_0xf5d6('0x32')]=_0x133edf;if(_0x1abde1['query'][_0xf5d6('0x51')]){_0x49f7e6[_0xf5d6('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf5d6('0x64')](_0x49f7e6);})[_0xf5d6('0x23')](function(_0x417cc8){_0x1aa749[_0xf5d6('0x53')]=_0x417cc8;return _0x1aa749;});}})['then'](respondWithFilteredResult(_0x353161,_0x49f7e6))[_0xf5d6('0x2b')](handleError(_0x353161,null));};exports[_0xf5d6('0x6a')]=function(_0x35c5b4,_0x4d6fff,_0x3d372d){return db[_0xf5d6('0x3f')]['find']({'where':{'id':_0x35c5b4[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x4d6fff,null))[_0xf5d6('0x23')](function(_0x219815){if(_0x219815){return _0x219815['removeAnswers'](_0x35c5b4[_0xf5d6('0x41')][_0xf5d6('0x65')]);}})[_0xf5d6('0x23')](respondWithStatusCode(_0x4d6fff,null))[_0xf5d6('0x2b')](handleError(_0x4d6fff,null));};exports[_0xf5d6('0x6b')]=function(_0x4fc4d3,_0x5a6613,_0x387118){var _0x1487b4={'body':_0x4fc4d3[_0xf5d6('0x5c')],'channel':'openchannel'};var _0x15c1d6=[];var _0x22a638=[];var _0x21a913={};var _0x413ec3=![];return db[_0xf5d6('0x6c')][_0xf5d6('0x5e')]()[_0xf5d6('0x23')](function(_0x5a419f){if(!_0x5a419f){throw new db[(_0xf5d6('0x6d'))][(_0xf5d6('0x6e'))](_0xf5d6('0x6f'));}_0x15c1d6=_['difference'](_[_0xf5d6('0x54')](_0x5a419f),[_0xf5d6('0x70'),'updatedAt']);_0x22a638=_[_0xf5d6('0x71')](_[_0xf5d6('0x54')](_0x5a419f),[_0xf5d6('0x70'),_0xf5d6('0x72'),_0xf5d6('0x73'),_0xf5d6('0x74')]);if(_0x4fc4d3[_0xf5d6('0x5c')]['id']){delete _0x4fc4d3['body']['id'];}if(_[_0xf5d6('0x75')](_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x76')])){throw new db[(_0xf5d6('0x6d'))][(_0xf5d6('0x6e'))](_0xf5d6('0x77'));}if(_[_0xf5d6('0x75')](_0x4fc4d3[_0xf5d6('0x5c')]['body'])||_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x5c')]===''){throw new db['Sequelize'][(_0xf5d6('0x6e'))](_0xf5d6('0x78'));}if(_[_0xf5d6('0x75')](_0x4fc4d3['body'][_0xf5d6('0x79')])){throw new db[(_0xf5d6('0x6d'))][(_0xf5d6('0x6e'))](_0xf5d6('0x7a')+_0x22a638);}if(!_[_0xf5d6('0x7b')](_0x22a638,_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x79')])){throw new db['Sequelize'][(_0xf5d6('0x6e'))](_0xf5d6('0x7c')+_0x22a638);}_0x21a913[_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x79')]]=_0x4fc4d3['body'][_0xf5d6('0x76')];})[_0xf5d6('0x23')](function(){return db['OpenchannelAccount'][_0xf5d6('0x55')]({'where':{'id':_0x4fc4d3[_0xf5d6('0x5d')]['id']},'include':[{'model':db[_0xf5d6('0x7d')],'as':_0xf5d6('0x7e'),'include':[{'model':db[_0xf5d6('0x6c')],'as':_0xf5d6('0x7f'),'where':_0x21a913,'limit':0x1,'order':[[_0xf5d6('0x72'),'DESC']]}]},{'model':db[_0xf5d6('0x80')],'as':_0xf5d6('0x81')}]});})[_0xf5d6('0x23')](handleEntityNotFound(_0x5a6613,null))[_0xf5d6('0x23')](function(_0x52fa2a){if(_0x52fa2a&&_0x52fa2a[_0xf5d6('0x7e')]){_0x1487b4[_0xf5d6('0x82')]=_0x52fa2a;_0x1487b4[_0xf5d6('0x83')]=_0x52fa2a['Applications'];_0x1487b4[_0xf5d6('0x84')]=_0x52fa2a[_0xf5d6('0x7e')];_0x1487b4[_0xf5d6('0x83')]=_[_0xf5d6('0x85')](_0x1487b4[_0xf5d6('0x83')],[_0xf5d6('0x86')],[_0xf5d6('0x87')]);if(_0x1487b4[_0xf5d6('0x82')]['Applications']){delete _0x1487b4['account'][_0xf5d6('0x81')];}if(_0x1487b4[_0xf5d6('0x82')][_0xf5d6('0x7e')]&&_0x1487b4[_0xf5d6('0x82')][_0xf5d6('0x7e')][_0xf5d6('0x7f')][_0xf5d6('0x46')]){return _0x1487b4[_0xf5d6('0x82')][_0xf5d6('0x7e')]['Contacts'][0x0];}var _0x1c1eda=_['defaults'](_0x4fc4d3[_0xf5d6('0x5c')],{'firstName':_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x76')],'ListId':_0x52fa2a[_0xf5d6('0x74')]});_0x1c1eda[_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x79')]]=_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x76')];return db[_0xf5d6('0x6c')][_0xf5d6('0x56')](_0x1c1eda,{'fields':_0x15c1d6,'raw':!![]});}})[_0xf5d6('0x23')](handleEntityNotFound(_0x5a6613,null))[_0xf5d6('0x23')](function(_0x2615f6){_0x1487b4['contact']=_0x2615f6;if(_0x2615f6){var _0x5c5e58={'ContactId':_0x2615f6['id'],'OpenchannelAccountId':_0x4fc4d3['params']['id'],'from':(_0x2615f6[_0xf5d6('0x88')]||'')+'\x20'+(_0x2615f6[_0xf5d6('0x89')]||'')};var _0x58be66={'OpenchannelAccountId':_0x4fc4d3[_0xf5d6('0x5d')]['id'],'closed':![]};if(_0x4fc4d3[_0xf5d6('0x5c')]['threadId']){_0x58be66[_0xf5d6('0x8a')]=_0x4fc4d3['body'][_0xf5d6('0x8a')];return db['OpenchannelInteraction'][_0xf5d6('0x55')]({'where':_0x58be66})['then'](function(_0x33c287){if(_0x33c287){return[_0x33c287,![]];}_0x5c5e58[_0xf5d6('0x8a')]=_0x4fc4d3['body'][_0xf5d6('0x8a')];_0x5c5e58[_0xf5d6('0x8b')]=_0x4fc4d3[_0xf5d6('0x5c')]['externalUrl'];return db[_0xf5d6('0x8c')][_0xf5d6('0x56')](_0x5c5e58)[_0xf5d6('0x23')](function(_0x160b8c){return[_0x160b8c,!![]];});});}else{_0x58be66[_0xf5d6('0x8a')]=null;}_0x58be66[_0xf5d6('0x8d')]=_0x2615f6['id'];return db[_0xf5d6('0x8c')][_0xf5d6('0x55')]({'where':_0x58be66})['then'](function(_0x50e49e){if(_0x50e49e){return[_0x50e49e,![]];}return db['OpenchannelInteraction'][_0xf5d6('0x56')](_0x5c5e58)[_0xf5d6('0x23')](function(_0x3333ce){return[_0x3333ce,!![]];});});}})[_0xf5d6('0x8e')](function(_0x4ebf13,_0x485559){if(_0x4ebf13){_0x413ec3=_0x485559;if(!_0x485559){var _0x2aebe1={'from':(_0x1487b4[_0xf5d6('0x8f')][_0xf5d6('0x88')]||'')+'\x20'+(_0x1487b4['contact'][_0xf5d6('0x89')]||'')};if(_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x8a')]&&_0x4fc4d3[_0xf5d6('0x5c')]['messageId']&&_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x8a')]!=_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x90')]){_0x2aebe1[_0xf5d6('0x8a')]=_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x90')];}return _0x4ebf13[_0xf5d6('0x36')](_0x2aebe1);}else{return _0x4ebf13;}}})[_0xf5d6('0x23')](function(_0x1f5061){_0x1487b4['interaction']=_0x1f5061[_0xf5d6('0x59')]({'plain':!![]});_0x1487b4[_0xf5d6('0x91')][_0xf5d6('0x92')]=_0x413ec3;if(_0x1487b4[_0xf5d6('0x91')][_0xf5d6('0x92')]){if(_0x1487b4['account'][_0xf5d6('0x93')]){_0x1487b4[_0xf5d6('0x83')][_0xf5d6('0x94')]({'id':0x0,'priority':_0x1487b4[_0xf5d6('0x83')][_0xf5d6('0x46')]+0x1,'app':_0xf5d6('0x95'),'appdata':_0xf5d6('0x96'),'interval':_0xf5d6('0x97')});}}return db[_0xf5d6('0x98')][_0xf5d6('0x56')]({'body':_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x5c')],'OpenchannelAccountId':_0x4fc4d3['params']['id'],'OpenchannelInteractionId':_0x1f5061['id'],'direction':'in','ContactId':_0x1487b4[_0xf5d6('0x8f')]['id'],'AttachmentId':_0x4fc4d3[_0xf5d6('0x5c')][_0xf5d6('0x99')]});})[_0xf5d6('0x23')](function(_0x1aa2db){_0x1487b4[_0xf5d6('0x29')]=_0x1aa2db;if(_0x1487b4['interaction'][_0xf5d6('0x9a')]){return db[_0xf5d6('0x9b')][_0xf5d6('0x55')]({'attributes':['id','name'],'where':{'id':_0x1487b4[_0xf5d6('0x91')][_0xf5d6('0x9a')]}})[_0xf5d6('0x23')](function(_0x4be5d2){if(_0x4be5d2){_0x1487b4['applications'][_0xf5d6('0x9c')]({'id':0x0,'priority':0x0,'app':_0xf5d6('0x9d'),'appdata':_0x4be5d2[_0xf5d6('0x3b')]+','+(_0x1487b4[_0xf5d6('0x82')]['waitForTheAssignedAgent']||0xa),'interval':_0xf5d6('0x97')});_0x1487b4[_0xf5d6('0x9e')]=![];}return respondWithRpcPromise('Start',_0xf5d6('0x9f'),_0x1487b4);});}return respondWithRpcPromise(_0xf5d6('0xa0'),_0xf5d6('0x9f'),_0x1487b4);})['then'](function(_0x52f168){respondWithRpcPromise(_0xf5d6('0xa1'),'EventManager',{'event':'notify','message':_0x52f168},client9002);return _0x52f168;})[_0xf5d6('0x23')](respondWithResult(_0x5a6613,null))[_0xf5d6('0x2b')](handleError(_0x5a6613,null));};exports['addApplications']=function(_0x2a9848,_0x5cd987){var _0x230b68=_0x2a9848[_0xf5d6('0x5d')]['id'];var _0x3b105e=_0x2a9848[_0xf5d6('0x5c')];var _0x246707=0xc8;var _0x1f8c34=null;return db[_0xf5d6('0xa2')]['transaction']({'isolationLevel':db[_0xf5d6('0xa2')][_0xf5d6('0xa3')][_0xf5d6('0xa4')][_0xf5d6('0xa5')]},function(_0x481964){return db['OpenchannelAccount'][_0xf5d6('0x62')]({'where':{'id':_0x230b68},'transaction':_0x481964})[_0xf5d6('0x23')](function(_0xe7bd85){if(_0xe7bd85){return db[_0xf5d6('0x80')][_0xf5d6('0x39')]({'where':{'OpenchannelAccountId':_0x230b68},'transaction':_0x481964})[_0xf5d6('0x23')](function(){var _0x562819=_[_0xf5d6('0x3e')](_0x3b105e,function(_0x4b90c6){_0x4b90c6[_0xf5d6('0x60')]=_0x230b68;return _0x4b90c6;});return db[_0xf5d6('0x80')][_0xf5d6('0xa6')](_0x562819,{'transaction':_0x481964});});}else{_0x246707=0x194;_0x1f8c34=[];}});})[_0xf5d6('0x23')](function(){if(_0x246707!==0x194){return db[_0xf5d6('0x80')][_0xf5d6('0xa7')]({'where':{'OpenchannelAccountId':_0x230b68},'order':_0xf5d6('0x86')})[_0xf5d6('0x23')](function(_0x3973f7){_0x1f8c34=_0x3973f7;});}})[_0xf5d6('0x2b')](function(_0x409ca1){_0x246707=0x1f4;logger[_0xf5d6('0x27')](_0x409ca1[_0xf5d6('0x3a')]);if(_0x409ca1[_0xf5d6('0x3b')]){delete _0x409ca1[_0xf5d6('0x3b')];}_0x1f8c34=_0x409ca1;})[_0xf5d6('0xa8')](function(){if(_0x1f8c34===null){_0x5cd987[_0xf5d6('0xa9')](_0x246707);}else{if(_0x246707===0x1f4){_0x5cd987[_0xf5d6('0x2d')](_0x246707)[_0xf5d6('0xaa')](_0x1f8c34);}else{_0x5cd987[_0xf5d6('0x2d')](_0x246707)[_0xf5d6('0x2e')](_0x1f8c34);}}});};exports[_0xf5d6('0xab')]=function(_0x5efad2,_0x5e3a,_0x1df0d2){var _0x30dddb={};var _0x5eb5cb={};var _0x3173d6;var _0x1dbab5;return db[_0xf5d6('0x3f')][_0xf5d6('0x62')]({'where':{'id':_0x5efad2[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x5e3a,null))[_0xf5d6('0x23')](function(_0x49d821){if(_0x49d821){_0x3173d6=_0x49d821;_0x5eb5cb['model']=_[_0xf5d6('0x54')](db[_0xf5d6('0x80')][_0xf5d6('0x40')]);_0x5eb5cb[_0xf5d6('0x41')]=_[_0xf5d6('0x54')](_0x5efad2[_0xf5d6('0x41')]);_0x5eb5cb['filters']=_['intersection'](_0x5eb5cb[_0xf5d6('0x42')],_0x5eb5cb[_0xf5d6('0x41')]);_0x30dddb[_0xf5d6('0x43')]=_[_0xf5d6('0x44')](_0x5eb5cb[_0xf5d6('0x42')],qs[_0xf5d6('0x45')](_0x5efad2[_0xf5d6('0x41')]['fields']));_0x30dddb['attributes']=_0x30dddb[_0xf5d6('0x43')][_0xf5d6('0x46')]?_0x30dddb['attributes']:_0x5eb5cb[_0xf5d6('0x42')];_0x30dddb[_0xf5d6('0x69')]=qs['sort'](_0x5efad2['query'][_0xf5d6('0x49')]);_0x30dddb['where']=qs[_0xf5d6('0x4b')](_[_0xf5d6('0x4c')](_0x5efad2[_0xf5d6('0x41')],_0x5eb5cb['filters']));if(_0x5efad2[_0xf5d6('0x41')][_0xf5d6('0x4d')]){_0x30dddb[_0xf5d6('0x4a')]=_[_0xf5d6('0x4e')](_0x30dddb[_0xf5d6('0x4a')],{'$or':_[_0xf5d6('0x3e')](_0x30dddb[_0xf5d6('0x43')],function(_0x354ba4){var _0x1bd87f={};_0x1bd87f[_0x354ba4]={'$like':'%'+_0x5efad2[_0xf5d6('0x41')]['filter']+'%'};return _0x1bd87f;})});}_0x30dddb=_['merge']({},_0x30dddb,_0x5efad2['options']);return _0x3173d6[_0xf5d6('0xab')](_0x30dddb);}})['then'](function(_0x7a3ef5){if(_0x7a3ef5){_0x1dbab5=_0x7a3ef5['length'];if(!_0x5efad2[_0xf5d6('0x41')][_0xf5d6('0x47')](_0xf5d6('0x48'))){_0x30dddb[_0xf5d6('0x31')]=qs[_0xf5d6('0x31')](_0x5efad2[_0xf5d6('0x41')][_0xf5d6('0x31')]);_0x30dddb[_0xf5d6('0x2f')]=qs[_0xf5d6('0x2f')](_0x5efad2['query'][_0xf5d6('0x2f')]);}return _0x3173d6['getApplications'](_0x30dddb);}})[_0xf5d6('0x23')](function(_0x1f510e){if(_0x1f510e){return _0x1f510e?{'count':_0x1dbab5,'rows':_0x1f510e}:null;}})[_0xf5d6('0x23')](respondWithResult(_0x5e3a,null))[_0xf5d6('0x2b')](handleError(_0x5e3a,null));};exports[_0xf5d6('0xac')]=function(_0x1954a7,_0x360374,_0x519c98){var _0x196f1f={'raw':![],'where':{}};var _0x1fc545={};var _0x1eb1b1={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf5d6('0x62')]({'where':{'id':_0x1954a7[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x360374,null))[_0xf5d6('0x23')](function(_0x13e685){if(_0x13e685){_0x1fc545['model']=_[_0xf5d6('0x54')](db[_0xf5d6('0x8c')]['rawAttributes']);_0x1fc545['query']=_[_0xf5d6('0x54')](_0x1954a7[_0xf5d6('0x41')]);_0x1fc545[_0xf5d6('0x4b')]=_[_0xf5d6('0x44')](_0x1fc545[_0xf5d6('0x42')],_0x1fc545[_0xf5d6('0x41')]);_0x196f1f[_0xf5d6('0x43')]=_[_0xf5d6('0x44')](_0x1fc545[_0xf5d6('0x42')],qs[_0xf5d6('0x45')](_0x1954a7[_0xf5d6('0x41')]['fields']));_0x196f1f[_0xf5d6('0x43')]=_0x196f1f[_0xf5d6('0x43')][_0xf5d6('0x46')]?_0x196f1f[_0xf5d6('0x43')]:_0x1fc545['model'];if(!_0x1954a7[_0xf5d6('0x41')][_0xf5d6('0x47')](_0xf5d6('0x48'))){_0x196f1f[_0xf5d6('0x31')]=qs['limit'](_0x1954a7[_0xf5d6('0x41')]['limit']);_0x196f1f[_0xf5d6('0x2f')]=qs[_0xf5d6('0x2f')](_0x1954a7[_0xf5d6('0x41')][_0xf5d6('0x2f')]);}_0x196f1f[_0xf5d6('0x69')]=qs['sort'](_0x1954a7[_0xf5d6('0x41')][_0xf5d6('0x49')]);_0x196f1f[_0xf5d6('0x4a')]=qs[_0xf5d6('0x4b')](_['pick'](_0x1954a7[_0xf5d6('0x41')],_0x1fc545[_0xf5d6('0x4b')]));_0x196f1f[_0xf5d6('0x4a')]['OpenchannelAccountId']=_0x13e685['id'];if(_0x1954a7[_0xf5d6('0x41')][_0xf5d6('0x4d')]){_0x196f1f['where']=_['merge'](_0x196f1f[_0xf5d6('0x4a')],{'$or':_[_0xf5d6('0x3e')](_0x196f1f[_0xf5d6('0x43')],function(_0x55094c){var _0x26f75a={};_0x26f75a[_0x55094c]={'$like':'%'+_0x1954a7[_0xf5d6('0x41')][_0xf5d6('0x4d')]+'%'};return _0x26f75a;})});}_0x196f1f=_['merge']({},_0x196f1f,_0x1954a7[_0xf5d6('0x50')]);return db[_0xf5d6('0x8c')][_0xf5d6('0x32')]({'where':_0x196f1f['where']})[_0xf5d6('0x23')](function(_0x7fee18){_0x1eb1b1[_0xf5d6('0x32')]=_0x7fee18;if(_0x1954a7['query'][_0xf5d6('0x51')]){_0x196f1f['include']=[{'model':db[_0xf5d6('0x6c')],'as':_0xf5d6('0xad'),'required':![]},{'model':db[_0xf5d6('0x9b')],'as':_0xf5d6('0xae'),'attributes':['name',_0xf5d6('0xaf'),_0xf5d6('0xb0')],'required':![]},{'model':db['Tag'],'as':_0xf5d6('0xb1'),'attributes':['id',_0xf5d6('0x3b'),'color'],'where':_0x1954a7[_0xf5d6('0x41')][_0xf5d6('0xb2')]?{'id':_0x1954a7[_0xf5d6('0x41')][_0xf5d6('0xb2')]}:undefined,'required':_0x1954a7[_0xf5d6('0x41')]['tag']?!![]:![]}];}return db[_0xf5d6('0x8c')][_0xf5d6('0x64')](_0x196f1f);})['then'](function(_0x274983){_0x1eb1b1[_0xf5d6('0x53')]=_0x274983;return _0x1eb1b1;});}})[_0xf5d6('0x23')](respondWithFilteredResult(_0x360374,_0x196f1f))[_0xf5d6('0x2b')](handleError(_0x360374,null));};exports['addAgents']=function(_0x4fc644,_0x30ab6f,_0x115cab){return db['OpenchannelAccount'][_0xf5d6('0x55')]({'where':{'id':_0x4fc644[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x30ab6f,null))[_0xf5d6('0x23')](function(_0xd339c1){if(_0xd339c1){return _0xd339c1[_0xf5d6('0xb3')](_0x4fc644[_0xf5d6('0x5c')][_0xf5d6('0x65')],_[_0xf5d6('0xb4')](_0x4fc644[_0xf5d6('0x5c')],['ids','id'])||{})[_0xf5d6('0x8e')](function(_0x27b192){for(var _0x2621a0=0x0;_0x2621a0<_0x4fc644[_0xf5d6('0x5c')]['ids'][_0xf5d6('0x46')];_0x2621a0+=0x1){socket[_0xf5d6('0xb5')]('userOpenchannelAccount:save',{'UserId':Number(_0x4fc644[_0xf5d6('0x5c')][_0xf5d6('0x65')][_0x2621a0]),'OpenchannelAccountId':Number(_0x4fc644[_0xf5d6('0x5d')]['id'])});}return _0x27b192;});}})[_0xf5d6('0x23')](respondWithResult(_0x30ab6f,null))[_0xf5d6('0x2b')](handleError(_0x30ab6f,null));};exports[_0xf5d6('0xb6')]=function(_0x787740,_0x316e50,_0xb65bef){return db[_0xf5d6('0x3f')][_0xf5d6('0x55')]({'where':{'id':_0x787740['params']['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x316e50,null))[_0xf5d6('0x23')](function(_0x23a9bf){if(_0x23a9bf){return _0x23a9bf[_0xf5d6('0xb6')](_0x787740['query'][_0xf5d6('0x65')])[_0xf5d6('0x23')](function(){if(_[_0xf5d6('0xb7')](_0x787740[_0xf5d6('0x41')]['ids'])){for(var _0x363339=0x0;_0x363339<_0x787740[_0xf5d6('0x41')][_0xf5d6('0x65')][_0xf5d6('0x46')];_0x363339+=0x1){socket['emit'](_0xf5d6('0xb8'),{'UserId':Number(_0x787740[_0xf5d6('0x41')][_0xf5d6('0x65')][_0x363339]),'OpenchannelAccountId':Number(_0x787740[_0xf5d6('0x5d')]['id'])});}}else{socket[_0xf5d6('0xb5')](_0xf5d6('0xb8'),{'UserId':Number(_0x787740[_0xf5d6('0x41')]['ids']),'OpenchannelAccountId':Number(_0x787740['params']['id'])});}});}})[_0xf5d6('0x23')](respondWithStatusCode(_0x316e50,null))[_0xf5d6('0x2b')](handleError(_0x316e50,null));};exports[_0xf5d6('0xb9')]=function(_0xfb3615,_0x3daa00,_0x46da6d){var _0x5e79ac={};var _0x12d537={};var _0x2e37a8;var _0x4e6a4d;return db[_0xf5d6('0x3f')][_0xf5d6('0x62')]({'where':{'id':_0xfb3615[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x3daa00,null))[_0xf5d6('0x23')](function(_0x18782a){if(_0x18782a){_0x2e37a8=_0x18782a;_0x12d537['model']=_[_0xf5d6('0x54')](db[_0xf5d6('0x9b')][_0xf5d6('0x40')]);_0x12d537[_0xf5d6('0x41')]=_[_0xf5d6('0x54')](_0xfb3615[_0xf5d6('0x41')]);_0x12d537[_0xf5d6('0x4b')]=_[_0xf5d6('0x44')](_0x12d537['model'],_0x12d537[_0xf5d6('0x41')]);_0x5e79ac['attributes']=_['intersection'](_0x12d537[_0xf5d6('0x42')],qs[_0xf5d6('0x45')](_0xfb3615[_0xf5d6('0x41')][_0xf5d6('0x45')]));_0x5e79ac['attributes']=_0x5e79ac['attributes'][_0xf5d6('0x46')]?_0x5e79ac['attributes']:_0x12d537[_0xf5d6('0x42')];_0x5e79ac['order']=qs[_0xf5d6('0x49')](_0xfb3615[_0xf5d6('0x41')]['sort']);_0x5e79ac[_0xf5d6('0x4a')]=qs[_0xf5d6('0x4b')](_[_0xf5d6('0x4c')](_0xfb3615[_0xf5d6('0x41')],_0x12d537[_0xf5d6('0x4b')]));if(_0xfb3615[_0xf5d6('0x41')][_0xf5d6('0x4d')]){_0x5e79ac[_0xf5d6('0x4a')]=_['merge'](_0x5e79ac[_0xf5d6('0x4a')],{'$or':_['map'](_0x5e79ac[_0xf5d6('0x43')],function(_0x4a31f5){var _0x26566e={};_0x26566e[_0x4a31f5]={'$like':'%'+_0xfb3615[_0xf5d6('0x41')][_0xf5d6('0x4d')]+'%'};return _0x26566e;})});}_0x5e79ac=_[_0xf5d6('0x4e')]({},_0x5e79ac,_0xfb3615['options']);return _0x2e37a8[_0xf5d6('0xb9')](_0x5e79ac);}})['then'](function(_0xd809e9){if(_0xd809e9){_0x4e6a4d=_0xd809e9[_0xf5d6('0x46')];if(!_0xfb3615[_0xf5d6('0x41')][_0xf5d6('0x47')]('nolimit')){_0x5e79ac['limit']=qs[_0xf5d6('0x31')](_0xfb3615[_0xf5d6('0x41')][_0xf5d6('0x31')]);_0x5e79ac[_0xf5d6('0x2f')]=qs[_0xf5d6('0x2f')](_0xfb3615[_0xf5d6('0x41')]['offset']);}return _0x2e37a8[_0xf5d6('0xb9')](_0x5e79ac);}})[_0xf5d6('0x23')](function(_0x2b2959){if(_0x2b2959){return _0x2b2959?{'count':_0x4e6a4d,'rows':_0x2b2959}:null;}})['then'](respondWithResult(_0x3daa00,null))[_0xf5d6('0x2b')](handleError(_0x3daa00,null));};exports[_0xf5d6('0xaa')]=function(_0x5b1a2c,_0x1bb9a9,_0x47bb6d){var _0xaa6fe7,_0x4f1745,_0x576514;if(_['isNil'](_0x5b1a2c[_0xf5d6('0x5c')][_0xf5d6('0x5c')])||_0x5b1a2c['body']['body']===''){throw new db[(_0xf5d6('0x6d'))][(_0xf5d6('0x6e'))](_0xf5d6('0x78'));}if(_[_0xf5d6('0x75')](_0x5b1a2c[_0xf5d6('0x5c')]['to'])){}_0xaa6fe7=_0x5b1a2c[_0xf5d6('0x5c')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5b1a2c[_0xf5d6('0x5d')]['id']}})[_0xf5d6('0x23')](handleEntityNotFound(_0x1bb9a9,null))[_0xf5d6('0x23')](function(_0x5e7756){if(_0x5e7756){return db[_0xf5d6('0x3f')][_0xf5d6('0x55')]({'where':{'id':_0x5e7756['id']},'include':[{'model':db[_0xf5d6('0x7d')],'as':_0xf5d6('0x7e'),'include':[{'model':db[_0xf5d6('0x6c')],'as':_0xf5d6('0x7f'),'where':{[_0x5e7756[_0xf5d6('0x79')]]:_0xaa6fe7},'limit':0x1,'order':[[_0xf5d6('0x72'),_0xf5d6('0xba')]]}]}]})[_0xf5d6('0x23')](handleEntityNotFound(_0x1bb9a9,null))['then'](function(_0x35fac0){if(_0x35fac0&&_0x35fac0[_0xf5d6('0x7e')]){_0x4f1745=_0x35fac0[_0xf5d6('0x59')]({'plain':!![]});if(_0x4f1745[_0xf5d6('0x7e')]&&_0x4f1745['List'][_0xf5d6('0x7f')][_0xf5d6('0x46')]){return _0x4f1745[_0xf5d6('0x7e')]['Contacts'][0x0];}return db[_0xf5d6('0x6c')][_0xf5d6('0x56')](_['defaults'](_0x5b1a2c[_0xf5d6('0x5c')],{'firstName':_0xaa6fe7,[_0x35fac0['mapKey']]:_0xaa6fe7,'phone':_0xaa6fe7,'ListId':_0x4f1745[_0xf5d6('0x74')]}));}})[_0xf5d6('0x23')](handleEntityNotFound(_0x1bb9a9,null))['then'](function(_0x2602f5){if(_0x2602f5){_0x576514=_0x2602f5;return db[_0xf5d6('0x8c')][_0xf5d6('0x55')]({'where':{'ContactId':_0x576514['id'],'closed':![],'OpenchannelAccountId':_0x4f1745['id']}})[_0xf5d6('0x23')](function(_0xc449d8){if(_0xc449d8){return[_0xc449d8,![]];}return db['OpenchannelInteraction'][_0xf5d6('0x56')]({'UserId':_0x5b1a2c['user']['id'],'ContactId':_0x576514['id'],'OpenchannelAccountId':_0x4f1745['id'],'lastMsgDirection':_0xf5d6('0xbb'),'Messages':[_[_0xf5d6('0x4e')](_0x5b1a2c[_0xf5d6('0x5c')],{'read':![],'body':_0x5b1a2c['body'][_0xf5d6('0x5c')],'OpenchannelAccountId':_0x4f1745['id'],'UserId':_0x5b1a2c[_0xf5d6('0x58')]['id'],'ContactId':_0x576514['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xf5d6('0xbc')}]})[_0xf5d6('0x23')](function(_0x3ddb75){return[_0x3ddb75,!![]];});});}})[_0xf5d6('0x8e')](function(_0x24e405,_0x947118){if(_0x947118){return _0x24e405;}return db[_0xf5d6('0x98')][_0xf5d6('0x56')](_[_0xf5d6('0x4e')](_0x5b1a2c['body'],{'read':![],'body':_0x5b1a2c[_0xf5d6('0x5c')][_0xf5d6('0x5c')],'OpenchannelAccountId':_0x4f1745['id'],'OpenchannelInteractionId':_0x24e405['id'],'UserId':_0x5b1a2c[_0xf5d6('0x58')]['id'],'ContactId':_0x576514['id']}))['then'](function(_0x239362){_0x24e405[_0xf5d6('0xbd')][_0xf5d6('0xbc')]=[];_0x24e405['dataValues']['Messages'][_0xf5d6('0x94')](_0x239362[_0xf5d6('0xbd')]);return _0x24e405;});});}})['then'](respondWithResult(_0x1bb9a9,null))[_0xf5d6('0x2b')](handleError(_0x1bb9a9,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 0991590..784d471 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 _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x22fb,0x192));var _0xb22f=function(_0x210b94,_0x2626a1){_0x210b94=_0x210b94-0x0;var _0x4bfff3=_0x22fb[_0x210b94];return _0x4bfff3;};'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 +var _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0x22fb,0x192));var _0xb22f=function(_0x174396,_0x571811){_0x174396=_0x174396-0x0;var _0x1422a4=_0x22fb[_0x174396];return _0x1422a4;};'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 b683471..5e2f5b7 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(_0x1f8d84,_0x5e13e6){var _0x17e0c7=function(_0x3b872){while(--_0x3b872){_0x1f8d84['push'](_0x1f8d84['shift']());}};_0x17e0c7(++_0x5e13e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0xb38976,_0x5c9b75){var _0x280905=function(_0x44de48){while(--_0x44de48){_0xb38976['push'](_0xb38976['shift']());}};_0x280905(++_0x5c9b75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 67db95c..478ec7f 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 _0xa74f=['info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then'];(function(_0x240800,_0x3ddd02){var _0x462cf6=function(_0x3174af){while(--_0x3174af){_0x240800['push'](_0x240800['shift']());}};_0x462cf6(++_0x3ddd02);}(_0xa74f,0x9a));var _0xfa74=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0xa74f[_0x28611e];return _0x530f69;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});config[_0xfa74('0x7')]=_[_0xfa74('0x8')](config[_0xfa74('0x7')],{'host':_0xfa74('0x9'),'port':0x18eb});var socket=require(_0xfa74('0xa'))(new Redis(config['redis']));require(_0xfa74('0xb'))[_0xfa74('0xc')](socket);function respondWithRpcPromise(_0x355e37,_0x2a405e,_0x4d118c){return new BPromise(function(_0x46117e,_0x4f8891){return client['request'](_0x355e37,_0x4d118c)[_0xfa74('0xd')](function(_0x1d919d){logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');logger[_0xfa74('0x10')](_0xfa74('0x11'),_0x2a405e,_0xfa74('0x12'),JSON[_0xfa74('0x13')](_0x1d919d));if(_0x1d919d['error']){if(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x15')]===0x1f4){logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')]['message']);return _0x4f8891(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);}logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);return _0x46117e(_0x1d919d[_0xfa74('0x14')]['message']);}else{logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');_0x46117e(_0x1d919d['result'][_0xfa74('0x16')]);}})[_0xfa74('0x17')](function(_0xb8fe6b){logger['error'](_0xfa74('0xf'),_0x2a405e,_0xb8fe6b);_0x4f8891(_0xb8fe6b);});});} \ No newline at end of file +var _0x4e81=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4e81,0x1bc));var _0x14e8=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x4e81[_0x528575];return _0x3063b7;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x14e8('0x9')]=_[_0x14e8('0xa')](config[_0x14e8('0x9')],{'host':_0x14e8('0xb'),'port':0x18eb});var socket=require(_0x14e8('0xc'))(new Redis(config[_0x14e8('0x9')]));require(_0x14e8('0xd'))[_0x14e8('0xe')](socket);function respondWithRpcPromise(_0x294b39,_0x5602cc,_0xbd3b87){return new BPromise(function(_0x3c6bdd,_0x43bfcd){return client[_0x14e8('0xf')](_0x294b39,_0xbd3b87)[_0x14e8('0x10')](function(_0x3ce648){logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,'request\x20sent');logger[_0x14e8('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5602cc,_0x14e8('0x14'),JSON[_0x14e8('0x15')](_0x3ce648));if(_0x3ce648[_0x14e8('0x16')]){if(_0x3ce648['error'][_0x14e8('0x17')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x5602cc,_0x3ce648['error'][_0x14e8('0x18')]);return _0x43bfcd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}logger[_0x14e8('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5602cc,_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);return _0x3c6bdd(_0x3ce648[_0x14e8('0x16')][_0x14e8('0x18')]);}else{logger[_0x14e8('0x11')](_0x14e8('0x12'),_0x5602cc,_0x14e8('0x14'));_0x3c6bdd(_0x3ce648[_0x14e8('0x19')]['message']);}})[_0x14e8('0x1a')](function(_0x233cd8){logger[_0x14e8('0x16')](_0x14e8('0x12'),_0x5602cc,_0x233cd8);_0x43bfcd(_0x233cd8);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c3ef2c7..136510a 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 _0xe13a=['update','emit','removeListener','register','openchannelAccount:','save','remove'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0xe13a,0x178));var _0xae13=function(_0x41ce6d,_0x3af520){_0x41ce6d=_0x41ce6d-0x0;var _0xc15bb9=_0xe13a[_0x41ce6d];return _0xc15bb9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xae13('0x0'),_0xae13('0x1'),_0xae13('0x2')];function createListener(_0x6066c0,_0x4cf961){return function(_0x3aaf90){_0x4cf961[_0xae13('0x3')](_0x6066c0,_0x3aaf90);};}function removeListener(_0x3ebbfe,_0x10abd7){return function(){OpenchannelAccountEvents[_0xae13('0x4')](_0x3ebbfe,_0x10abd7);};}exports[_0xae13('0x5')]=function(_0x412a07){for(var _0x3379ed=0x0,_0x341ba4=events['length'];_0x3379ed<_0x341ba4;_0x3379ed++){var _0x2f6d10=events[_0x3379ed];var _0x2b2e1f=createListener(_0xae13('0x6')+_0x2f6d10,_0x412a07);OpenchannelAccountEvents['on'](_0x2f6d10,_0x2b2e1f);}}; \ No newline at end of file +var _0x593e=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x1467ab,_0x3d5631){var _0x37dd34=function(_0x55aa03){while(--_0x55aa03){_0x1467ab['push'](_0x1467ab['shift']());}};_0x37dd34(++_0x3d5631);}(_0x593e,0xcb));var _0xe593=function(_0xc1e08a,_0x2c6ace){_0xc1e08a=_0xc1e08a-0x0;var _0x139ea9=_0x593e[_0xc1e08a];return _0x139ea9;};'use strict';var OpenchannelAccountEvents=require(_0xe593('0x0'));var events=[_0xe593('0x1'),_0xe593('0x2'),_0xe593('0x3')];function createListener(_0x43dabb,_0x184a6b){return function(_0x2c7c48){_0x184a6b[_0xe593('0x4')](_0x43dabb,_0x2c7c48);};}function removeListener(_0x550574,_0x8a87e8){return function(){OpenchannelAccountEvents[_0xe593('0x5')](_0x550574,_0x8a87e8);};}exports[_0xe593('0x6')]=function(_0x1e50d3){for(var _0x3b7082=0x0,_0x14cff3=events[_0xe593('0x7')];_0x3b7082<_0x14cff3;_0x3b7082++){var _0x307dad=events[_0x3b7082];var _0x169c08=createListener(_0xe593('0x8')+_0x307dad,_0x1e50d3);OpenchannelAccountEvents['on'](_0x307dad,_0x169c08);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 510bdf7..92f26e2 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 _0xf4d6=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','multer','util','path'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xf4d6,0xd5));var _0x6f4d=function(_0x46d5b1,_0x21da70){_0x46d5b1=_0x46d5b1-0x0;var _0x41437f=_0xf4d6[_0x46d5b1];return _0x41437f;};'use strict';var multer=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var path=require(_0x6f4d('0x2'));var timeout=require(_0x6f4d('0x3'));var express=require('express');var router=express[_0x6f4d('0x4')]();var fs_extra=require(_0x6f4d('0x5'));var auth=require(_0x6f4d('0x6'));var interaction=require(_0x6f4d('0x7'));var config=require('../../config/environment');var controller=require(_0x6f4d('0x8'));router[_0x6f4d('0x9')]('/',auth[_0x6f4d('0xa')](),controller[_0x6f4d('0xb')]);router[_0x6f4d('0x9')](_0x6f4d('0xc'),auth['isAuthenticated'](),controller[_0x6f4d('0xd')]);router[_0x6f4d('0xe')]('/',auth[_0x6f4d('0xa')](),controller['create']);router[_0x6f4d('0xf')](_0x6f4d('0xc'),auth[_0x6f4d('0xa')](),controller[_0x6f4d('0x10')]);router[_0x6f4d('0x11')](_0x6f4d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd089=['multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','post','put','delete','destroy','exports'];(function(_0x2059df,_0x367401){var _0xdd848b=function(_0x13055b){while(--_0x13055b){_0x2059df['push'](_0x2059df['shift']());}};_0xdd848b(++_0x367401);}(_0xd089,0x180));var _0x9d08=function(_0x169f89,_0x3f4c27){_0x169f89=_0x169f89-0x0;var _0x17b20e=_0xd089[_0x169f89];return _0x17b20e;};'use strict';var multer=require(_0x9d08('0x0'));var util=require(_0x9d08('0x1'));var path=require('path');var timeout=require(_0x9d08('0x2'));var express=require('express');var router=express[_0x9d08('0x3')]();var fs_extra=require(_0x9d08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9d08('0x5'));var config=require(_0x9d08('0x6'));var controller=require(_0x9d08('0x7'));router[_0x9d08('0x8')]('/',auth[_0x9d08('0x9')](),controller['index']);router[_0x9d08('0x8')](_0x9d08('0xa'),auth[_0x9d08('0x9')](),controller['show']);router[_0x9d08('0xb')]('/',auth[_0x9d08('0x9')](),controller['create']);router[_0x9d08('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9d08('0xd')](_0x9d08('0xa'),auth[_0x9d08('0x9')](),controller[_0x9d08('0xe')]);module[_0x9d08('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 50065e3..bc4322b 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 _0x32dc=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32dc,0x1b9));var _0xc32d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x32dc[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xc32d('0x0'));module[_0xc32d('0x1')]={'priority':{'type':Sequelize[_0xc32d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc32d('0x3')],'allowNull':![],'defaultValue':_0xc32d('0x4')},'appdata':{'type':Sequelize[_0xc32d('0x5')]()},'description':{'type':Sequelize[_0xc32d('0x3')]},'interval':{'type':Sequelize[_0xc32d('0x3')],'defaultValue':_0xc32d('0x6')}}; \ No newline at end of file +var _0xe0c9=['*,*,*,*','sequelize','exports','TEXT','STRING'];(function(_0x513c05,_0x503fed){var _0x584c18=function(_0x4d9242){while(--_0x4d9242){_0x513c05['push'](_0x513c05['shift']());}};_0x584c18(++_0x503fed);}(_0xe0c9,0x1d7));var _0x9e0c=function(_0x3dd111,_0x1d0545){_0x3dd111=_0x3dd111-0x0;var _0x444582=_0xe0c9[_0x3dd111];return _0x444582;};'use strict';var Sequelize=require(_0x9e0c('0x0'));module[_0x9e0c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9e0c('0x2')]()},'description':{'type':Sequelize[_0x9e0c('0x3')]},'interval':{'type':Sequelize[_0x9e0c('0x3')],'defaultValue':_0x9e0c('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index a1fd59a..51dd728 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 _0x7bbb=['rows','catch','show','params','intersection','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','jsforce','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','update','then','destroy','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1aca67,_0x18f2a7){var _0x432257=function(_0x36c0df){while(--_0x36c0df){_0x1aca67['push'](_0x1aca67['shift']());}};_0x432257(++_0x18f2a7);}(_0x7bbb,0x1ac));var _0xb7bb=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x7bbb[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb7bb('0x0'));var zipdir=require(_0xb7bb('0x1'));var jsonpatch=require(_0xb7bb('0x2'));var rp=require(_0xb7bb('0x3'));var moment=require(_0xb7bb('0x4'));var BPromise=require(_0xb7bb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb7bb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb7bb('0x7'));var fs=require('fs');var fs_extra=require(_0xb7bb('0x8'));var _=require(_0xb7bb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb7bb('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb7bb('0xb'));var querystring=require('querystring');var Papa=require(_0xb7bb('0xc'));var Redis=require('ioredis');var authService=require(_0xb7bb('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7bb('0xe'));var logger=require(_0xb7bb('0xf'))(_0xb7bb('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb7bb('0x11'));var db=require(_0xb7bb('0x12'))['db'];function respondWithStatusCode(_0x45ab49,_0x3e6a6c){_0x3e6a6c=_0x3e6a6c||0xcc;return function(_0x649ba3){if(_0x649ba3){return _0x45ab49[_0xb7bb('0x13')](_0x3e6a6c);}return _0x45ab49[_0xb7bb('0x14')](_0x3e6a6c)[_0xb7bb('0x15')]();};}function respondWithResult(_0x38bed8,_0x2c3269){_0x2c3269=_0x2c3269||0xc8;return function(_0x14acb7){if(_0x14acb7){return _0x38bed8[_0xb7bb('0x14')](_0x2c3269)['json'](_0x14acb7);}};}function respondWithFilteredResult(_0x3cd30a,_0x3cf4df){return function(_0xcb3375){if(_0xcb3375){var _0x24acf0=typeof _0x3cf4df['offset']===_0xb7bb('0x16')&&typeof _0x3cf4df[_0xb7bb('0x17')]===_0xb7bb('0x16');var _0x15a197=_0xcb3375[_0xb7bb('0x18')];var _0x39eee3=_0x24acf0?0x0:_0x3cf4df[_0xb7bb('0x19')];var _0x1826b0=_0x24acf0?_0xcb3375['count']:_0x3cf4df[_0xb7bb('0x19')]+_0x3cf4df[_0xb7bb('0x17')];var _0x402ec4;if(_0x1826b0>=_0x15a197){_0x1826b0=_0x15a197;_0x402ec4=0xc8;}else{_0x402ec4=0xce;}_0x3cd30a[_0xb7bb('0x14')](_0x402ec4);return _0x3cd30a[_0xb7bb('0x1a')]('Content-Range',_0x39eee3+'-'+_0x1826b0+'/'+_0x15a197)[_0xb7bb('0x1b')](_0xcb3375);}return null;};}function patchUpdates(_0x41742){return function(_0x430c57){try{jsonpatch['apply'](_0x430c57,_0x41742,!![]);}catch(_0x49a701){return BPromise[_0xb7bb('0x1c')](_0x49a701);}return _0x430c57['save']();};}function saveUpdates(_0x2fee6e,_0x3e3db8){return function(_0x1a55bd){if(_0x1a55bd){return _0x1a55bd[_0xb7bb('0x1d')](_0x2fee6e)[_0xb7bb('0x1e')](function(_0x31b7fc){return _0x31b7fc;});}return null;};}function removeEntity(_0x307b36,_0x2df17d){return function(_0x1c2b74){if(_0x1c2b74){return _0x1c2b74[_0xb7bb('0x1f')]()[_0xb7bb('0x1e')](function(){_0x307b36[_0xb7bb('0x14')](0xcc)[_0xb7bb('0x15')]();});}};}function handleEntityNotFound(_0x5c5e63,_0x493554){return function(_0x19709a){if(!_0x19709a){_0x5c5e63[_0xb7bb('0x13')](0x194);}return _0x19709a;};}function handleError(_0x535188,_0x45ea22){_0x45ea22=_0x45ea22||0x1f4;return function(_0x338ab7){logger[_0xb7bb('0x20')](_0x338ab7['stack']);if(_0x338ab7[_0xb7bb('0x21')]){delete _0x338ab7['name'];}_0x535188['status'](_0x45ea22)[_0xb7bb('0x22')](_0x338ab7);};}exports[_0xb7bb('0x23')]=function(_0x3d3f1c,_0x2dc94e){var _0x520f1d={},_0x24684d={},_0x3ebc92={'count':0x0,'rows':[]};var _0x369c15=_[_0xb7bb('0x24')](db[_0xb7bb('0x25')][_0xb7bb('0x26')],function(_0x2de077){return{'name':_0x2de077[_0xb7bb('0x27')],'type':_0x2de077['type'][_0xb7bb('0x28')]};});_0x24684d[_0xb7bb('0x29')]=_[_0xb7bb('0x24')](_0x369c15,_0xb7bb('0x21'));_0x24684d['query']=_[_0xb7bb('0x2a')](_0x3d3f1c[_0xb7bb('0x2b')]);_0x24684d[_0xb7bb('0x2c')]=_['intersection'](_0x24684d[_0xb7bb('0x29')],_0x24684d[_0xb7bb('0x2b')]);_0x520f1d[_0xb7bb('0x2d')]=_['intersection'](_0x24684d[_0xb7bb('0x29')],qs[_0xb7bb('0x2e')](_0x3d3f1c['query'][_0xb7bb('0x2e')]));_0x520f1d['attributes']=_0x520f1d[_0xb7bb('0x2d')][_0xb7bb('0x2f')]?_0x520f1d[_0xb7bb('0x2d')]:_0x24684d[_0xb7bb('0x29')];if(!_0x3d3f1c['query'][_0xb7bb('0x30')](_0xb7bb('0x31'))){_0x520f1d[_0xb7bb('0x17')]=qs[_0xb7bb('0x17')](_0x3d3f1c[_0xb7bb('0x2b')][_0xb7bb('0x17')]);_0x520f1d[_0xb7bb('0x19')]=qs[_0xb7bb('0x19')](_0x3d3f1c['query'][_0xb7bb('0x19')]);}_0x520f1d[_0xb7bb('0x32')]=qs[_0xb7bb('0x33')](_0x3d3f1c[_0xb7bb('0x2b')][_0xb7bb('0x33')]);_0x520f1d[_0xb7bb('0x34')]=qs['filters'](_[_0xb7bb('0x35')](_0x3d3f1c['query'],_0x24684d[_0xb7bb('0x2c')]),_0x369c15);if(_0x3d3f1c[_0xb7bb('0x2b')][_0xb7bb('0x36')]){_0x520f1d[_0xb7bb('0x34')]=_[_0xb7bb('0x37')](_0x520f1d[_0xb7bb('0x34')],{'$or':_['map'](_0x369c15,function(_0x23be91){if(_0x23be91[_0xb7bb('0x38')]!==_0xb7bb('0x39')){var _0x20918c={};_0x20918c[_0x23be91[_0xb7bb('0x21')]]={'$like':'%'+_0x3d3f1c[_0xb7bb('0x2b')]['filter']+'%'};return _0x20918c;}})});}_0x520f1d=_[_0xb7bb('0x37')]({},_0x520f1d,_0x3d3f1c[_0xb7bb('0x3a')]);var _0x302e8c={'where':_0x520f1d['where']};return db['OpenchannelApplication'][_0xb7bb('0x18')](_0x302e8c)[_0xb7bb('0x1e')](function(_0x4ce7bd){_0x3ebc92[_0xb7bb('0x18')]=_0x4ce7bd;if(_0x3d3f1c[_0xb7bb('0x2b')][_0xb7bb('0x3b')]){_0x520f1d[_0xb7bb('0x3c')]=[{'all':!![]}];}return db[_0xb7bb('0x25')][_0xb7bb('0x3d')](_0x520f1d);})[_0xb7bb('0x1e')](function(_0x32ad4e){_0x3ebc92[_0xb7bb('0x3e')]=_0x32ad4e;return _0x3ebc92;})['then'](respondWithFilteredResult(_0x2dc94e,_0x520f1d))[_0xb7bb('0x3f')](handleError(_0x2dc94e,null));};exports[_0xb7bb('0x40')]=function(_0x40e51c,_0x3e35f){var _0x32f3e7={'raw':!![],'where':{'id':_0x40e51c[_0xb7bb('0x41')]['id']}},_0x21543f={};_0x21543f[_0xb7bb('0x29')]=_[_0xb7bb('0x2a')](db[_0xb7bb('0x25')]['rawAttributes']);_0x21543f[_0xb7bb('0x2b')]=_['keys'](_0x40e51c[_0xb7bb('0x2b')]);_0x21543f['filters']=_[_0xb7bb('0x42')](_0x21543f[_0xb7bb('0x29')],_0x21543f[_0xb7bb('0x2b')]);_0x32f3e7[_0xb7bb('0x2d')]=_[_0xb7bb('0x42')](_0x21543f[_0xb7bb('0x29')],qs[_0xb7bb('0x2e')](_0x40e51c[_0xb7bb('0x2b')]['fields']));_0x32f3e7['attributes']=_0x32f3e7[_0xb7bb('0x2d')]['length']?_0x32f3e7[_0xb7bb('0x2d')]:_0x21543f[_0xb7bb('0x29')];if(_0x40e51c[_0xb7bb('0x2b')][_0xb7bb('0x3b')]){_0x32f3e7[_0xb7bb('0x3c')]=[{'all':!![]}];}_0x32f3e7=_['merge']({},_0x32f3e7,_0x40e51c[_0xb7bb('0x3a')]);return db[_0xb7bb('0x25')][_0xb7bb('0x43')](_0x32f3e7)[_0xb7bb('0x1e')](handleEntityNotFound(_0x3e35f,null))['then'](respondWithResult(_0x3e35f,null))[_0xb7bb('0x3f')](handleError(_0x3e35f,null));};exports['create']=function(_0x36b8a4,_0x5b338f){return db[_0xb7bb('0x25')][_0xb7bb('0x44')](_0x36b8a4['body'],{})[_0xb7bb('0x1e')](respondWithResult(_0x5b338f,0xc9))['catch'](handleError(_0x5b338f,null));};exports[_0xb7bb('0x1d')]=function(_0x7c46db,_0x451154){if(_0x7c46db[_0xb7bb('0x45')]['id']){delete _0x7c46db[_0xb7bb('0x45')]['id'];}return db[_0xb7bb('0x25')]['find']({'where':{'id':_0x7c46db[_0xb7bb('0x41')]['id']}})[_0xb7bb('0x1e')](handleEntityNotFound(_0x451154,null))[_0xb7bb('0x1e')](saveUpdates(_0x7c46db[_0xb7bb('0x45')],null))['then'](respondWithResult(_0x451154,null))[_0xb7bb('0x3f')](handleError(_0x451154,null));};exports[_0xb7bb('0x1f')]=function(_0x242f39,_0xd5c2e2){return db[_0xb7bb('0x25')][_0xb7bb('0x43')]({'where':{'id':_0x242f39[_0xb7bb('0x41')]['id']}})[_0xb7bb('0x1e')](handleEntityNotFound(_0xd5c2e2,null))[_0xb7bb('0x1e')](removeEntity(_0xd5c2e2,null))[_0xb7bb('0x3f')](handleError(_0xd5c2e2,null));}; \ No newline at end of file +var _0x524b=['offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','rawAttributes','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x325064,_0x35482f){var _0x5d9b73=function(_0x5d064a){while(--_0x5d064a){_0x325064['push'](_0x325064['shift']());}};_0x5d9b73(++_0x35482f);}(_0x524b,0x149));var _0xb524=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x524b[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb524('0x0'));var rimraf=require(_0xb524('0x1'));var zipdir=require(_0xb524('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb524('0x3'));var moment=require(_0xb524('0x4'));var BPromise=require(_0xb524('0x5'));var Mustache=require('mustache');var util=require(_0xb524('0x6'));var path=require(_0xb524('0x7'));var sox=require(_0xb524('0x8'));var csv=require('to-csv');var ejs=require(_0xb524('0x9'));var fs=require('fs');var fs_extra=require(_0xb524('0xa'));var _=require('lodash');var squel=require(_0xb524('0xb'));var crypto=require(_0xb524('0xc'));var jsforce=require(_0xb524('0xd'));var deskjs=require(_0xb524('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb524('0xf'));var Redis=require(_0xb524('0x10'));var authService=require(_0xb524('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb524('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb524('0x13'));var utils=require(_0xb524('0x14'));var config=require(_0xb524('0x15'));var licenseUtil=require(_0xb524('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bff2a,_0x132eba){_0x132eba=_0x132eba||0xcc;return function(_0x16dd1f){if(_0x16dd1f){return _0x2bff2a[_0xb524('0x17')](_0x132eba);}return _0x2bff2a[_0xb524('0x18')](_0x132eba)[_0xb524('0x19')]();};}function respondWithResult(_0xe2c818,_0x3d4a89){_0x3d4a89=_0x3d4a89||0xc8;return function(_0x1ea78f){if(_0x1ea78f){return _0xe2c818[_0xb524('0x18')](_0x3d4a89)['json'](_0x1ea78f);}};}function respondWithFilteredResult(_0x24239c,_0x335cb1){return function(_0x19d27c){if(_0x19d27c){var _0x2b663a=typeof _0x335cb1[_0xb524('0x1a')]===_0xb524('0x1b')&&typeof _0x335cb1[_0xb524('0x1c')]===_0xb524('0x1b');var _0x44c904=_0x19d27c[_0xb524('0x1d')];var _0x2e9717=_0x2b663a?0x0:_0x335cb1['offset'];var _0x1cf75b=_0x2b663a?_0x19d27c[_0xb524('0x1d')]:_0x335cb1['offset']+_0x335cb1['limit'];var _0x3ae259;if(_0x1cf75b>=_0x44c904){_0x1cf75b=_0x44c904;_0x3ae259=0xc8;}else{_0x3ae259=0xce;}_0x24239c['status'](_0x3ae259);return _0x24239c[_0xb524('0x1e')]('Content-Range',_0x2e9717+'-'+_0x1cf75b+'/'+_0x44c904)[_0xb524('0x1f')](_0x19d27c);}return null;};}function patchUpdates(_0x837e4){return function(_0x51d45d){try{jsonpatch[_0xb524('0x20')](_0x51d45d,_0x837e4,!![]);}catch(_0x2c3c3a){return BPromise[_0xb524('0x21')](_0x2c3c3a);}return _0x51d45d[_0xb524('0x22')]();};}function saveUpdates(_0x24b858,_0x454364){return function(_0x1d073d){if(_0x1d073d){return _0x1d073d[_0xb524('0x23')](_0x24b858)[_0xb524('0x24')](function(_0x322d6e){return _0x322d6e;});}return null;};}function removeEntity(_0x4a1cfc,_0x5426e9){return function(_0x526bc7){if(_0x526bc7){return _0x526bc7[_0xb524('0x25')]()['then'](function(){_0x4a1cfc[_0xb524('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4b61,_0xef27ee){return function(_0x36f9bd){if(!_0x36f9bd){_0x2a4b61[_0xb524('0x17')](0x194);}return _0x36f9bd;};}function handleError(_0x437a8d,_0x232f21){_0x232f21=_0x232f21||0x1f4;return function(_0x1e063f){logger[_0xb524('0x26')](_0x1e063f['stack']);if(_0x1e063f[_0xb524('0x27')]){delete _0x1e063f[_0xb524('0x27')];}_0x437a8d[_0xb524('0x18')](_0x232f21)[_0xb524('0x28')](_0x1e063f);};}exports[_0xb524('0x29')]=function(_0x38ad1a,_0x107f26){var _0x473f6c={},_0x3fb2a3={},_0x1d46d1={'count':0x0,'rows':[]};var _0x4c3ead=_[_0xb524('0x2a')](db[_0xb524('0x2b')]['rawAttributes'],function(_0x2a02b8){return{'name':_0x2a02b8[_0xb524('0x2c')],'type':_0x2a02b8[_0xb524('0x2d')][_0xb524('0x2e')]};});_0x3fb2a3[_0xb524('0x2f')]=_[_0xb524('0x2a')](_0x4c3ead,_0xb524('0x27'));_0x3fb2a3[_0xb524('0x30')]=_[_0xb524('0x31')](_0x38ad1a[_0xb524('0x30')]);_0x3fb2a3[_0xb524('0x32')]=_[_0xb524('0x33')](_0x3fb2a3[_0xb524('0x2f')],_0x3fb2a3['query']);_0x473f6c[_0xb524('0x34')]=_['intersection'](_0x3fb2a3[_0xb524('0x2f')],qs[_0xb524('0x35')](_0x38ad1a['query'][_0xb524('0x35')]));_0x473f6c[_0xb524('0x34')]=_0x473f6c['attributes'][_0xb524('0x36')]?_0x473f6c['attributes']:_0x3fb2a3[_0xb524('0x2f')];if(!_0x38ad1a[_0xb524('0x30')]['hasOwnProperty'](_0xb524('0x37'))){_0x473f6c[_0xb524('0x1c')]=qs['limit'](_0x38ad1a[_0xb524('0x30')]['limit']);_0x473f6c[_0xb524('0x1a')]=qs[_0xb524('0x1a')](_0x38ad1a[_0xb524('0x30')][_0xb524('0x1a')]);}_0x473f6c['order']=qs['sort'](_0x38ad1a[_0xb524('0x30')][_0xb524('0x38')]);_0x473f6c['where']=qs[_0xb524('0x32')](_[_0xb524('0x39')](_0x38ad1a[_0xb524('0x30')],_0x3fb2a3[_0xb524('0x32')]),_0x4c3ead);if(_0x38ad1a[_0xb524('0x30')]['filter']){_0x473f6c[_0xb524('0x3a')]=_[_0xb524('0x3b')](_0x473f6c[_0xb524('0x3a')],{'$or':_['map'](_0x4c3ead,function(_0xacda14){if(_0xacda14[_0xb524('0x2d')]!==_0xb524('0x3c')){var _0x1a9403={};_0x1a9403[_0xacda14[_0xb524('0x27')]]={'$like':'%'+_0x38ad1a[_0xb524('0x30')][_0xb524('0x3d')]+'%'};return _0x1a9403;}})});}_0x473f6c=_['merge']({},_0x473f6c,_0x38ad1a[_0xb524('0x3e')]);var _0xe68b1e={'where':_0x473f6c[_0xb524('0x3a')]};return db['OpenchannelApplication'][_0xb524('0x1d')](_0xe68b1e)[_0xb524('0x24')](function(_0x5c439b){_0x1d46d1[_0xb524('0x1d')]=_0x5c439b;if(_0x38ad1a[_0xb524('0x30')][_0xb524('0x3f')]){_0x473f6c[_0xb524('0x40')]=[{'all':!![]}];}return db[_0xb524('0x2b')]['findAll'](_0x473f6c);})[_0xb524('0x24')](function(_0x2e78d2){_0x1d46d1['rows']=_0x2e78d2;return _0x1d46d1;})[_0xb524('0x24')](respondWithFilteredResult(_0x107f26,_0x473f6c))[_0xb524('0x41')](handleError(_0x107f26,null));};exports[_0xb524('0x42')]=function(_0x3fd47b,_0x477fa6){var _0x22032d={'raw':!![],'where':{'id':_0x3fd47b[_0xb524('0x43')]['id']}},_0x179288={};_0x179288[_0xb524('0x2f')]=_[_0xb524('0x31')](db[_0xb524('0x2b')][_0xb524('0x44')]);_0x179288[_0xb524('0x30')]=_[_0xb524('0x31')](_0x3fd47b[_0xb524('0x30')]);_0x179288[_0xb524('0x32')]=_[_0xb524('0x33')](_0x179288[_0xb524('0x2f')],_0x179288[_0xb524('0x30')]);_0x22032d[_0xb524('0x34')]=_[_0xb524('0x33')](_0x179288[_0xb524('0x2f')],qs[_0xb524('0x35')](_0x3fd47b[_0xb524('0x30')][_0xb524('0x35')]));_0x22032d[_0xb524('0x34')]=_0x22032d[_0xb524('0x34')][_0xb524('0x36')]?_0x22032d['attributes']:_0x179288[_0xb524('0x2f')];if(_0x3fd47b[_0xb524('0x30')]['includeAll']){_0x22032d['include']=[{'all':!![]}];}_0x22032d=_[_0xb524('0x3b')]({},_0x22032d,_0x3fd47b[_0xb524('0x3e')]);return db[_0xb524('0x2b')]['find'](_0x22032d)[_0xb524('0x24')](handleEntityNotFound(_0x477fa6,null))[_0xb524('0x24')](respondWithResult(_0x477fa6,null))[_0xb524('0x41')](handleError(_0x477fa6,null));};exports[_0xb524('0x45')]=function(_0x351bbe,_0x2f0df5){return db[_0xb524('0x2b')][_0xb524('0x45')](_0x351bbe[_0xb524('0x46')],{})[_0xb524('0x24')](respondWithResult(_0x2f0df5,0xc9))[_0xb524('0x41')](handleError(_0x2f0df5,null));};exports[_0xb524('0x23')]=function(_0x4220ab,_0x53f0bc){if(_0x4220ab[_0xb524('0x46')]['id']){delete _0x4220ab[_0xb524('0x46')]['id'];}return db[_0xb524('0x2b')]['find']({'where':{'id':_0x4220ab['params']['id']}})[_0xb524('0x24')](handleEntityNotFound(_0x53f0bc,null))[_0xb524('0x24')](saveUpdates(_0x4220ab[_0xb524('0x46')],null))[_0xb524('0x24')](respondWithResult(_0x53f0bc,null))[_0xb524('0x41')](handleError(_0x53f0bc,null));};exports[_0xb524('0x25')]=function(_0x3597bf,_0x230425){return db[_0xb524('0x2b')]['find']({'where':{'id':_0x3597bf['params']['id']}})[_0xb524('0x24')](handleEntityNotFound(_0x230425,null))['then'](removeEntity(_0x230425,null))[_0xb524('0x41')](handleError(_0x230425,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 6e80909..b974635 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 _0x73a1=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x31e431,_0xe8984f){var _0x1dd7d=function(_0x206927){while(--_0x206927){_0x31e431['push'](_0x31e431['shift']());}};_0x1dd7d(++_0xe8984f);}(_0x73a1,0x1c7));var _0x173a=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x73a1[_0x1f5a63];return _0x30bb7a;};'use strict';var _=require('lodash');var util=require(_0x173a('0x0'));var logger=require('../../config/logger')(_0x173a('0x1'));var moment=require(_0x173a('0x2'));var BPromise=require(_0x173a('0x3'));var rp=require(_0x173a('0x4'));var fs=require('fs');var path=require(_0x173a('0x5'));var rimraf=require(_0x173a('0x6'));var config=require(_0x173a('0x7'));var attributes=require(_0x173a('0x8'));module['exports']=function(_0x5766db,_0x52c212){return _0x5766db['define'](_0x173a('0x9'),attributes,{'tableName':_0x173a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x173a('0xb'),'collate':_0x173a('0xc')});}; \ No newline at end of file +var _0x422c=['path','rimraf','./openchannelApplication.attributes','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x43c837,_0x468b0e){var _0x59e8b9=function(_0x5103a0){while(--_0x5103a0){_0x43c837['push'](_0x43c837['shift']());}};_0x59e8b9(++_0x468b0e);}(_0x422c,0x159));var _0xc422=function(_0x81e5d9,_0x4493fc){_0x81e5d9=_0x81e5d9-0x0;var _0x1d00f6=_0x422c[_0x81e5d9];return _0x1d00f6;};'use strict';var _=require(_0xc422('0x0'));var util=require(_0xc422('0x1'));var logger=require(_0xc422('0x2'))(_0xc422('0x3'));var moment=require(_0xc422('0x4'));var BPromise=require(_0xc422('0x5'));var rp=require(_0xc422('0x6'));var fs=require('fs');var path=require(_0xc422('0x7'));var rimraf=require(_0xc422('0x8'));var config=require('../../config/environment');var attributes=require(_0xc422('0x9'));module['exports']=function(_0xdfb536,_0x3830f2){return _0xdfb536['define']('OpenchannelApplication',attributes,{'tableName':_0xc422('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index c5abc9a..ed7bde3 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 _0x5b5b=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelApplication','update','body','options','raw','where','attributes','UpdateOpenchannelApplication','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info'];(function(_0x303862,_0x20b5ab){var _0xe6f228=function(_0x41fc5a){while(--_0x41fc5a){_0x303862['push'](_0x303862['shift']());}};_0xe6f228(++_0x20b5ab);}(_0x5b5b,0x155));var _0xb5b5=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x5b5b[_0x2a0350];return _0x425220;};'use strict';var _=require('lodash');var util=require(_0xb5b5('0x0'));var moment=require(_0xb5b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5b5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5b5('0x4'))('rpc');var config=require(_0xb5b5('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb5b5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3cd499,_0x23123c,_0x3f122e){return new BPromise(function(_0x42ffe6,_0x37f03b){return client[_0xb5b5('0x7')](_0x3cd499,_0x3f122e)[_0xb5b5('0x8')](function(_0x2eed8e){logger[_0xb5b5('0x9')](_0xb5b5('0xa'),_0x23123c,_0xb5b5('0xb'));logger[_0xb5b5('0xc')](_0xb5b5('0xd'),_0x23123c,_0xb5b5('0xb'),JSON[_0xb5b5('0xe')](_0x2eed8e));if(_0x2eed8e[_0xb5b5('0xf')]){if(_0x2eed8e['error']['code']===0x1f4){logger[_0xb5b5('0xf')](_0xb5b5('0xa'),_0x23123c,_0x2eed8e[_0xb5b5('0xf')][_0xb5b5('0x10')]);return _0x37f03b(_0x2eed8e['error'][_0xb5b5('0x10')]);}logger[_0xb5b5('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x23123c,_0x2eed8e[_0xb5b5('0xf')][_0xb5b5('0x10')]);return _0x42ffe6(_0x2eed8e[_0xb5b5('0xf')][_0xb5b5('0x10')]);}else{logger[_0xb5b5('0x9')](_0xb5b5('0xa'),_0x23123c,'request\x20sent');_0x42ffe6(_0x2eed8e[_0xb5b5('0x11')][_0xb5b5('0x10')]);}})[_0xb5b5('0x12')](function(_0x4c4919){logger[_0xb5b5('0xf')](_0xb5b5('0xa'),_0x23123c,_0x4c4919);_0x37f03b(_0x4c4919);});});}exports['UpdateOpenchannelApplication']=function(_0x3fff9f){var _0x305045=this;return new Promise(function(_0x1a9740,_0x442bd4){return db[_0xb5b5('0x13')][_0xb5b5('0x14')](_0x3fff9f[_0xb5b5('0x15')],{'raw':_0x3fff9f[_0xb5b5('0x16')]?_0x3fff9f[_0xb5b5('0x16')][_0xb5b5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff9f[_0xb5b5('0x16')]?_0x3fff9f[_0xb5b5('0x16')][_0xb5b5('0x18')]||null:null,'attributes':_0x3fff9f[_0xb5b5('0x16')]?_0x3fff9f[_0xb5b5('0x16')][_0xb5b5('0x19')]||null:null,'limit':_0x3fff9f[_0xb5b5('0x16')]?_0x3fff9f[_0xb5b5('0x16')]['limit']||null:null})[_0xb5b5('0x8')](function(_0x51b03c){logger['info']('UpdateOpenchannelApplication',_0x3fff9f);logger[_0xb5b5('0xc')](_0xb5b5('0x1a'),_0x3fff9f,JSON['stringify'](_0x51b03c));_0x1a9740(_0x51b03c);})[_0xb5b5('0x12')](function(_0x59e563){logger[_0xb5b5('0xf')]('UpdateOpenchannelApplication',_0x59e563[_0xb5b5('0x10')],_0x3fff9f);_0x442bd4(_0x305045[_0xb5b5('0xf')](0x1f4,_0x59e563[_0xb5b5('0x10')]));});});}; \ No newline at end of file +var _0x0724=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','info','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','moment'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x0724,0xa3));var _0x4072=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0724[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4072('0x0'));var util=require('util');var moment=require(_0x4072('0x1'));var BPromise=require(_0x4072('0x2'));var rs=require(_0x4072('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4072('0x4'))['db'];var utils=require(_0x4072('0x5'));var logger=require(_0x4072('0x6'))('rpc');var config=require(_0x4072('0x7'));var jayson=require(_0x4072('0x8'));var client=jayson[_0x4072('0x9')][_0x4072('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43a1dc,_0x16da7c,_0x4eee81){return new BPromise(function(_0x25e510,_0x4b3d58){return client[_0x4072('0xb')](_0x43a1dc,_0x4eee81)[_0x4072('0xc')](function(_0x30becc){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x16da7c,'request\x20sent');logger[_0x4072('0xd')](_0x4072('0xe'),_0x16da7c,'request\x20sent',JSON[_0x4072('0xf')](_0x30becc));if(_0x30becc['error']){if(_0x30becc[_0x4072('0x10')][_0x4072('0x11')]===0x1f4){logger[_0x4072('0x10')](_0x4072('0x12'),_0x16da7c,_0x30becc[_0x4072('0x10')][_0x4072('0x13')]);return _0x4b3d58(_0x30becc[_0x4072('0x10')][_0x4072('0x13')]);}logger[_0x4072('0x10')](_0x4072('0x12'),_0x16da7c,_0x30becc[_0x4072('0x10')][_0x4072('0x13')]);return _0x25e510(_0x30becc[_0x4072('0x10')]['message']);}else{logger[_0x4072('0x14')](_0x4072('0x12'),_0x16da7c,_0x4072('0x15'));_0x25e510(_0x30becc[_0x4072('0x16')]['message']);}})[_0x4072('0x17')](function(_0x64e5b5){logger['error'](_0x4072('0x12'),_0x16da7c,_0x64e5b5);_0x4b3d58(_0x64e5b5);});});}exports[_0x4072('0x18')]=function(_0x54cb81){var _0x5beefe=this;return new Promise(function(_0x1a3046,_0x33b63f){return db[_0x4072('0x19')][_0x4072('0x1a')](_0x54cb81[_0x4072('0x1b')],{'raw':_0x54cb81[_0x4072('0x1c')]?_0x54cb81[_0x4072('0x1c')][_0x4072('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54cb81[_0x4072('0x1c')]?_0x54cb81[_0x4072('0x1c')][_0x4072('0x1e')]||null:null,'attributes':_0x54cb81[_0x4072('0x1c')]?_0x54cb81[_0x4072('0x1c')][_0x4072('0x1f')]||null:null,'limit':_0x54cb81['options']?_0x54cb81[_0x4072('0x1c')][_0x4072('0x20')]||null:null})[_0x4072('0xc')](function(_0x578228){logger[_0x4072('0x14')](_0x4072('0x18'),_0x54cb81);logger[_0x4072('0xd')]('UpdateOpenchannelApplication',_0x54cb81,JSON[_0x4072('0xf')](_0x578228));_0x1a3046(_0x578228);})[_0x4072('0x17')](function(_0x31ee14){logger[_0x4072('0x10')](_0x4072('0x18'),_0x31ee14[_0x4072('0x13')],_0x54cb81);_0x33b63f(_0x5beefe['error'](0x1f4,_0x31ee14[_0x4072('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 2db1d16..b374882 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 _0xfa77=['/:id/download','download','post','create','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/messages'];(function(_0xfcfb6e,_0x1a00cf){var _0x5894e3=function(_0x21c444){while(--_0x21c444){_0xfcfb6e['push'](_0xfcfb6e['shift']());}};_0x5894e3(++_0x1a00cf);}(_0xfa77,0xb7));var _0x7fa7=function(_0x7cd4db,_0x25bf48){_0x7cd4db=_0x7cd4db-0x0;var _0x12dc4e=_0xfa77[_0x7cd4db];return _0x12dc4e;};'use strict';var multer=require('multer');var util=require(_0x7fa7('0x0'));var path=require('path');var timeout=require(_0x7fa7('0x1'));var express=require(_0x7fa7('0x2'));var router=express[_0x7fa7('0x3')]();var fs_extra=require(_0x7fa7('0x4'));var auth=require(_0x7fa7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7fa7('0x6'));router[_0x7fa7('0x7')]('/',auth[_0x7fa7('0x8')](),controller['index']);router['get'](_0x7fa7('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x7fa7('0x7')](_0x7fa7('0xa'),auth[_0x7fa7('0x8')](),controller[_0x7fa7('0xb')]);router['get'](_0x7fa7('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7fa7('0x7')](_0x7fa7('0xd'),auth['isAuthenticated'](),controller[_0x7fa7('0xe')]);router[_0x7fa7('0xf')]('/',auth[_0x7fa7('0x8')](),controller[_0x7fa7('0x10')]);router[_0x7fa7('0xf')]('/:id/messages',auth[_0x7fa7('0x8')](),controller['addMessage']);router[_0x7fa7('0xf')](_0x7fa7('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x7fa7('0x12'),_0x7fa7('0x13')),controller[_0x7fa7('0x14')]);router[_0x7fa7('0x15')](_0x7fa7('0xa'),auth['isAuthenticated'](),interaction[_0x7fa7('0x16')]('openchannel',_0x7fa7('0x17')),controller[_0x7fa7('0x18')]);router['delete'](_0x7fa7('0xa'),auth['isAuthenticated'](),interaction[_0x7fa7('0x16')](_0x7fa7('0x12'),_0x7fa7('0x19')),controller[_0x7fa7('0x1a')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x7fa7('0x1b')]=router; \ No newline at end of file +var _0xf5ec=['/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','delete','openchannelinteraction:destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x12a17c,_0x54d2c1){var _0x2b5648=function(_0x378afb){while(--_0x378afb){_0x12a17c['push'](_0x12a17c['shift']());}};_0x2b5648(++_0x54d2c1);}(_0xf5ec,0x80));var _0xcf5e=function(_0x21c36c,_0xb07874){_0x21c36c=_0x21c36c-0x0;var _0x2df703=_0xf5ec[_0x21c36c];return _0x2df703;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcf5e('0x0'));var timeout=require(_0xcf5e('0x1'));var express=require(_0xcf5e('0x2'));var router=express['Router']();var fs_extra=require(_0xcf5e('0x3'));var auth=require(_0xcf5e('0x4'));var interaction=require(_0xcf5e('0x5'));var config=require(_0xcf5e('0x6'));var controller=require('./openchannelInteraction.controller');router[_0xcf5e('0x7')]('/',auth[_0xcf5e('0x8')](),controller[_0xcf5e('0x9')]);router['get'](_0xcf5e('0xa'),auth[_0xcf5e('0x8')](),controller[_0xcf5e('0xb')]);router[_0xcf5e('0x7')](_0xcf5e('0xc'),auth[_0xcf5e('0x8')](),controller['show']);router[_0xcf5e('0x7')](_0xcf5e('0xd'),auth[_0xcf5e('0x8')](),controller[_0xcf5e('0xe')]);router['get'](_0xcf5e('0xf'),auth[_0xcf5e('0x8')](),controller[_0xcf5e('0x10')]);router[_0xcf5e('0x11')]('/',auth[_0xcf5e('0x8')](),controller[_0xcf5e('0x12')]);router['post'](_0xcf5e('0xd'),auth['isAuthenticated'](),controller[_0xcf5e('0x13')]);router['post'](_0xcf5e('0x14'),auth[_0xcf5e('0x8')](),interaction[_0xcf5e('0x15')](_0xcf5e('0x16'),'openchannelinteraction:addtags'),controller[_0xcf5e('0x17')]);router[_0xcf5e('0x18')](_0xcf5e('0xc'),auth[_0xcf5e('0x8')](),interaction[_0xcf5e('0x15')]('openchannel','openchannelinteraction:update'),controller['update']);router[_0xcf5e('0x19')](_0xcf5e('0xc'),auth[_0xcf5e('0x8')](),interaction[_0xcf5e('0x15')](_0xcf5e('0x16'),_0xcf5e('0x1a')),controller['destroy']);router[_0xcf5e('0x19')](_0xcf5e('0x14'),auth[_0xcf5e('0x8')](),controller['removeTags']);module[_0xcf5e('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 96d8dfa..0fa7776 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 _0xfd3a=['ENUM','out','BOOLEAN','STRING','DATE'];(function(_0x376a08,_0x15bd83){var _0x413fa5=function(_0x25f72d){while(--_0x25f72d){_0x376a08['push'](_0x376a08['shift']());}};_0x413fa5(++_0x15bd83);}(_0xfd3a,0xb1));var _0xafd3=function(_0x532e04,_0x453d11){_0x532e04=_0x532e04-0x0;var _0x38b88b=_0xfd3a[_0x532e04];return _0x38b88b;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xafd3('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xafd3('0x1')]},'thirdDisposition':{'type':Sequelize[_0xafd3('0x1')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xafd3('0x2')]},'threadId':{'type':Sequelize[_0xafd3('0x1')]},'externalUrl':{'type':Sequelize[_0xafd3('0x1')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xafd3('0x3')]('in',_0xafd3('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xafd3('0x1')]},'autoreplyExecuted':{'type':Sequelize[_0xafd3('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0xc252=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x24af1d,_0x45acd2){var _0x28b1c5=function(_0x3d8471){while(--_0x3d8471){_0x24af1d['push'](_0x24af1d['shift']());}};_0x28b1c5(++_0x45acd2);}(_0xc252,0x118));var _0x2c25=function(_0xf4b489,_0x2c16b1){_0xf4b489=_0xf4b489-0x0;var _0x2d9062=_0xc252[_0xf4b489];return _0x2d9062;};'use strict';var Sequelize=require(_0x2c25('0x0'));module[_0x2c25('0x1')]={'closed':{'type':Sequelize[_0x2c25('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c25('0x3')]},'disposition':{'type':Sequelize[_0x2c25('0x4')]},'secondDisposition':{'type':Sequelize[_0x2c25('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2c25('0x4')]},'note':{'type':Sequelize[_0x2c25('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x2c25('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2c25('0x5')]('in',_0x2c25('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2c25('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x2c25('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 7445cfe..61e5c6d 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 _0x6fa4=['CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','i.id','unreadMessages','contactName','DESC','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','merge','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','show','params','keys','includeAll','include','options','create','body','update','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','format','transcript-%d-%s.zip','CmContact','lastName','Attachment','secret','OpenchannelAccount','Account','Openchannel','Owner','N.A.','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','direction','out','System','firstName','renderFile','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','offset','undefined','count','limit','json','apply','reject','save','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','catch','waiting','talking','answered','unmanaged','total','UserId','closed','index','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','buildExpression','text','start','end','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x2f2ea6,_0x1b3c35){var _0xc8ec68=function(_0x5de8a9){while(--_0x5de8a9){_0x2f2ea6['push'](_0x2f2ea6['shift']());}};_0xc8ec68(++_0x1b3c35);}(_0x6fa4,0x154));var _0x46fa=function(_0x401f03,_0x1cd361){_0x401f03=_0x401f03-0x0;var _0xd1e6f9=_0x6fa4[_0x401f03];return _0xd1e6f9;};'use strict';var emlformat=require(_0x46fa('0x0'));var rimraf=require(_0x46fa('0x1'));var zipdir=require(_0x46fa('0x2'));var jsonpatch=require(_0x46fa('0x3'));var rp=require(_0x46fa('0x4'));var moment=require(_0x46fa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x46fa('0x6'));var util=require(_0x46fa('0x7'));var path=require(_0x46fa('0x8'));var sox=require('sox');var csv=require(_0x46fa('0x9'));var ejs=require(_0x46fa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46fa('0xb'));var squel=require(_0x46fa('0xc'));var crypto=require('crypto');var jsforce=require(_0x46fa('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x46fa('0xe'));var Redis=require(_0x46fa('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x46fa('0x10'));var as=require(_0x46fa('0x11'));var pdf=require(_0x46fa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46fa('0x13'))(_0x46fa('0x14'));var utils=require(_0x46fa('0x15'));var config=require(_0x46fa('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x46fa('0x17'))['db'];config[_0x46fa('0x18')]=_[_0x46fa('0x19')](config[_0x46fa('0x18')],{'host':_0x46fa('0x1a'),'port':0x18eb});var socket=require(_0x46fa('0x1b'))(new Redis(config[_0x46fa('0x18')]));require(_0x46fa('0x1c'))['register'](socket);function respondWithStatusCode(_0x139bc0,_0x1891fb){_0x1891fb=_0x1891fb||0xcc;return function(_0x586fe7){if(_0x586fe7){return _0x139bc0[_0x46fa('0x1d')](_0x1891fb);}return _0x139bc0[_0x46fa('0x1e')](_0x1891fb)['end']();};}function respondWithResult(_0x14756f,_0x40c54e){_0x40c54e=_0x40c54e||0xc8;return function(_0x3924da){if(_0x3924da){return _0x14756f[_0x46fa('0x1e')](_0x40c54e)['json'](_0x3924da);}};}function respondWithFilteredResult(_0x35c567,_0x54549f){return function(_0x447618){if(_0x447618){var _0x107c4f=typeof _0x54549f[_0x46fa('0x1f')]===_0x46fa('0x20')&&typeof _0x54549f['limit']===_0x46fa('0x20');var _0x5d8c04=_0x447618[_0x46fa('0x21')];var _0x3ef0d=_0x107c4f?0x0:_0x54549f[_0x46fa('0x1f')];var _0x1e42a4=_0x107c4f?_0x447618[_0x46fa('0x21')]:_0x54549f['offset']+_0x54549f[_0x46fa('0x22')];var _0x4bca7b;if(_0x1e42a4>=_0x5d8c04){_0x1e42a4=_0x5d8c04;_0x4bca7b=0xc8;}else{_0x4bca7b=0xce;}_0x35c567['status'](_0x4bca7b);return _0x35c567['set']('Content-Range',_0x3ef0d+'-'+_0x1e42a4+'/'+_0x5d8c04)[_0x46fa('0x23')](_0x447618);}return null;};}function patchUpdates(_0x13e2aa){return function(_0x41dd9e){try{jsonpatch[_0x46fa('0x24')](_0x41dd9e,_0x13e2aa,!![]);}catch(_0x36b9f9){return BPromise[_0x46fa('0x25')](_0x36b9f9);}return _0x41dd9e[_0x46fa('0x26')]();};}function saveUpdates(_0x3a87c7,_0x2df64a){return function(_0xa561c){if(_0xa561c){return _0xa561c['update'](_0x3a87c7)[_0x46fa('0x27')](function(_0x148111){return _0x148111;});}return null;};}function removeEntity(_0x26f3f9,_0x3dbfe6){return function(_0x2de412){if(_0x2de412){return _0x2de412[_0x46fa('0x28')]()['then'](function(){_0x26f3f9[_0x46fa('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43090e,_0x510e6c){return function(_0x30d4a0){if(!_0x30d4a0){_0x43090e[_0x46fa('0x1d')](0x194);}return _0x30d4a0;};}function handleError(_0xba7b6f,_0x24f3c7){_0x24f3c7=_0x24f3c7||0x1f4;return function(_0x18b077){logger[_0x46fa('0x29')](_0x18b077[_0x46fa('0x2a')]);if(_0x18b077['name']){delete _0x18b077[_0x46fa('0x2b')];}_0xba7b6f[_0x46fa('0x1e')](_0x24f3c7)[_0x46fa('0x2c')](_0x18b077);};}function getInteractionUsers(_0x3edf06,_0x35d053){return new BPromise(function(_0x5d4182,_0x29e0ec){try{if(_0x35d053[_0x3edf06['id']]){_0x3edf06[_0x46fa('0x2d')]=_[_0x46fa('0x2e')](_0x35d053[_0x3edf06['id']],function(_0x320b40){return{'id':_0x320b40['id'],'fullname':_0x320b40[_0x46fa('0x2f')]};});}}catch(_0x1e2704){_0x29e0ec(_0x1e2704);}_0x5d4182(_0x3edf06);});}function getInteractionTags(_0x4374b6,_0x3d4093){return new BPromise(function(_0x195b5b,_0x4f26be){try{if(_0x4374b6[_0x46fa('0x30')]){_0x4374b6[_0x46fa('0x31')]=[];_0x4374b6[_0x46fa('0x30')][_0x46fa('0x32')](',')['forEach'](function(_0x2e12da){_0x4374b6[_0x46fa('0x31')]['push'](_0x3d4093[_0x2e12da]);});}delete _0x4374b6[_0x46fa('0x30')];}catch(_0x195d18){_0x4f26be(_0x195d18);}_0x195b5b(_0x4374b6);});}function updateOpenchannelInteraction(_0x3bdc78,_0x16cfb7,_0x533d62){return new BPromise(function(_0x3bd64c,_0x187102){return getInteractionUsers(_0x3bdc78,_0x533d62)[_0x46fa('0x27')](function(_0x369aa2){return getInteractionTags(_0x369aa2,_0x16cfb7);})[_0x46fa('0x27')](function(_0x2f2f4c){return getStateInteraction(_0x2f2f4c);})[_0x46fa('0x27')](function(_0x38832e){_0x3bd64c(_0x38832e);})[_0x46fa('0x33')](function(_0x1f123d){_0x187102(_0x1f123d);});});}function getStateInteraction(_0x4a3760){return new BPromise(function(_0x5e59ce){_0x4a3760[_0x46fa('0x34')]=0x0;_0x4a3760[_0x46fa('0x35')]=0x0;_0x4a3760[_0x46fa('0x36')]=0x0;_0x4a3760[_0x46fa('0x37')]=0x0;_0x4a3760[_0x46fa('0x38')]=0x0;if(!_0x4a3760['closed']&&!_0x4a3760[_0x46fa('0x39')]){_0x4a3760[_0x46fa('0x34')]+=0x1;}if(!_0x4a3760[_0x46fa('0x3a')]&&_0x4a3760[_0x46fa('0x39')]){_0x4a3760[_0x46fa('0x35')]+=0x1;if(_0x4a3760['waiting']){_0x4a3760[_0x46fa('0x34')]-=0x1;}}if(_0x4a3760[_0x46fa('0x3a')]&&_0x4a3760['UserId']){_0x4a3760[_0x46fa('0x36')]+=0x1;if(_0x4a3760['talking']){_0x4a3760[_0x46fa('0x35')]-=0x1;}}if(_0x4a3760[_0x46fa('0x3a')]&&!_0x4a3760[_0x46fa('0x39')]){_0x4a3760[_0x46fa('0x37')]+=0x1;if(_0x4a3760[_0x46fa('0x34')]){_0x4a3760['waiting']-=0x1;}}_0x4a3760[_0x46fa('0x38')]+=0x1;_0x5e59ce(_0x4a3760);});}exports[_0x46fa('0x3b')]=function(_0x4d3607,_0xba2252){var _0x3ab9b2={},_0x2835d2={},_0xb1c99c={'count':0x0,'rows':[]};var _0x23742d=_[_0x46fa('0x2e')](db['OpenchannelInteraction'][_0x46fa('0x3c')],function(_0x31fd75){return{'name':_0x31fd75[_0x46fa('0x3d')],'type':_0x31fd75[_0x46fa('0x3e')][_0x46fa('0x3f')]};});_0x2835d2[_0x46fa('0x40')]=_[_0x46fa('0x2e')](_0x23742d,'name');_0x2835d2[_0x46fa('0x41')]=_['keys'](_0x4d3607[_0x46fa('0x41')]);_0x2835d2[_0x46fa('0x42')]=_['intersection'](_0x2835d2['model'],_0x2835d2[_0x46fa('0x41')]);_0x3ab9b2[_0x46fa('0x43')]=_[_0x46fa('0x44')](_0x2835d2[_0x46fa('0x40')],qs[_0x46fa('0x45')](_0x4d3607[_0x46fa('0x41')]['fields']));_0x3ab9b2['attributes']=_0x3ab9b2[_0x46fa('0x43')][_0x46fa('0x46')]?_0x3ab9b2[_0x46fa('0x43')]:_0x2835d2[_0x46fa('0x40')];if(!_0x4d3607[_0x46fa('0x41')]['hasOwnProperty'](_0x46fa('0x47'))){_0x3ab9b2[_0x46fa('0x22')]=qs['limit'](_0x4d3607[_0x46fa('0x41')][_0x46fa('0x22')]);_0x3ab9b2[_0x46fa('0x1f')]=qs['offset'](_0x4d3607[_0x46fa('0x41')]['offset']);}_0x3ab9b2[_0x46fa('0x48')]=qs['sort'](_0x4d3607[_0x46fa('0x41')][_0x46fa('0x49')]);_0x3ab9b2[_0x46fa('0x4a')]=qs[_0x46fa('0x42')](_[_0x46fa('0x4b')](_0x4d3607[_0x46fa('0x41')],_0x2835d2[_0x46fa('0x42')]),_0x23742d);var _0x419cb8=[];var _0x25f1b8=squel['select']()[_0x46fa('0x4c')]('id')['field'](_0x46fa('0x2b'))[_0x46fa('0x4c')]('color')[_0x46fa('0x4d')](_0x46fa('0x4e'));var _0x4495d4=squel[_0x46fa('0x4f')]()[_0x46fa('0x4c')]('u.id')['field'](_0x46fa('0x50'))['field'](_0x46fa('0x51'))[_0x46fa('0x4d')]('user_has_openchannel_interactions','ui')['left_join']('users','u',_0x46fa('0x52'));var _0x1af167=squel[_0x46fa('0x4f')]()[_0x46fa('0x4d')](_0x46fa('0x53'),'i')[_0x46fa('0x54')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x46fa('0x55'))['left_join'](_0x46fa('0x56'),'a',_0x46fa('0x57'))['left_join']('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x46fa('0x54')](_0x46fa('0x58'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x46fa('0x54')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x2e2c3a=squel['expr']();var _0x1b4d77=[];var _0xd6677b=squel[_0x46fa('0x59')]();var _0x49f512;if(_0x4d3607['query'][_0x46fa('0x5a')]){_0x49f512=as[_0x46fa('0x5b')](_0x4d3607[_0x46fa('0x41')][_0x46fa('0x5a')]);var _0x49dc72=_0x49f512[_0x46fa('0x5c')];for(var _0x5780ca=0x0;_0x5780ca<_0x49f512[_0x46fa('0x5d')]['length'];_0x5780ca++){var _0x3edb8c=_0x49f512[_0x46fa('0x5d')][_0x5780ca];var _0xe59e62='i';var _0x53c7b2=_[_0x46fa('0x5e')](_0x23742d,['name',_0x3edb8c[_0x46fa('0x4c')]]);if(!_0x53c7b2){switch(_0x3edb8c[_0x46fa('0x4c')]){case'unreadMessages':if(_0x3edb8c[_0x46fa('0x5f')]==0x1){_0x1af167[_0x46fa('0x60')]('`'+_0x3edb8c[_0x46fa('0x4c')]+_0x46fa('0x61'));}else{_0x1af167[_0x46fa('0x60')]('`'+_0x3edb8c[_0x46fa('0x4c')]+_0x46fa('0x62'));}break;case _0x46fa('0x63'):if(_0x3edb8c[_0x46fa('0x64')]===_0x46fa('0x65')){if(_0x3edb8c['value'][_0x46fa('0x32')]('\x20')[_0x46fa('0x46')]>0x1){_0x2e2c3a[_0x49dc72]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x46fa('0x66')](_0x3edb8c[_0x46fa('0x5f')]),null);}else{var _0x3b245b='%'+_0x3edb8c[_0x46fa('0x5f')]+'%';_0x2e2c3a[_0x49dc72]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3b245b,_0x3b245b,_0x3b245b);}}else{_0x53c7b2=_['find'](_0x23742d,[_0x46fa('0x2b'),_0x46fa('0x67')]);_0x3edb8c['field']=_0x46fa('0x67');_0x5da193=as[_0x46fa('0x68')](_0xe59e62,_0x53c7b2['type'],_0x3edb8c);_0x2e2c3a[_0x49dc72](_0x5da193[_0x46fa('0x69')],_0x5da193[_0x46fa('0x5f')][_0x46fa('0x6a')],_0x5da193['value'][_0x46fa('0x6b')]);}break;case _0x46fa('0x6c'):var _0x30c0cd=_0x3edb8c[_0x46fa('0x5f')]['split'](',')['map'](function(_0x438d03){return Number(_0x438d03);});_0x30c0cd[_0x46fa('0x6d')](function(_0x542ce3){_0xd6677b['or'](_0x46fa('0x6e'),'%,'+_0x542ce3+',%');});_0x1b4d77=_[_0x46fa('0x6f')](_0x1b4d77,_0x30c0cd);break;case _0x46fa('0x70'):if(_0x3edb8c[_0x46fa('0x64')]===_0x46fa('0x65')){_0x2e2c3a[_0x49dc72]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3edb8c[_0x46fa('0x5f')]+'%',null);}else{_0x53c7b2=_[_0x46fa('0x5e')](_0x23742d,[_0x46fa('0x2b'),'UserId']);_0x3edb8c[_0x46fa('0x4c')]=_0x46fa('0x39');_0x5da193=as[_0x46fa('0x68')](_0xe59e62,_0x53c7b2[_0x46fa('0x3e')],_0x3edb8c);_0x2e2c3a[_0x49dc72](_0x5da193[_0x46fa('0x69')],_0x5da193[_0x46fa('0x5f')][_0x46fa('0x6a')],_0x5da193[_0x46fa('0x5f')][_0x46fa('0x6b')]);}break;case'body':_0x5da193=as[_0x46fa('0x68')]('me',null,_0x3edb8c);_0x2e2c3a[_0x49dc72](_0x5da193[_0x46fa('0x69')],_0x5da193['value'][_0x46fa('0x6a')],_0x5da193['value'][_0x46fa('0x6b')]);break;}}else{var _0x5da193=as[_0x46fa('0x68')](_0xe59e62,_0x53c7b2[_0x46fa('0x3e')],_0x3edb8c);_0x2e2c3a[_0x49dc72](_0x5da193[_0x46fa('0x69')],_0x5da193[_0x46fa('0x5f')][_0x46fa('0x6a')],_0x5da193[_0x46fa('0x5f')][_0x46fa('0x6b')]);}}}else{var _0x287f46=_(_0x4d3607[_0x46fa('0x41')])['keys']()['map'](function(_0x25b3af){return _[_0x46fa('0x71')](_0x23742d,[_0x46fa('0x2b'),_0x25b3af])?_0x25b3af:undefined;})['compact']()['value']();if(!_[_0x46fa('0x72')](_0x287f46)){_0x287f46[_0x46fa('0x6d')](function(_0x2c0b0a){if(_0x2c0b0a===_0x46fa('0x73')){_0x1af167[_0x46fa('0x4a')](_0x46fa('0x74'),[]['concat'](_0x4d3607[_0x46fa('0x41')][_0x2c0b0a]));}else if(_0x2c0b0a===_0x46fa('0x75')){var _0x1afe97=JSON[_0x46fa('0x76')](_0x4d3607['query'][_0x2c0b0a])[_0x46fa('0x77')];var _0x22f224=JSON[_0x46fa('0x76')](_0x4d3607[_0x46fa('0x41')][_0x2c0b0a])[_0x46fa('0x78')];_0x1af167[_0x46fa('0x4a')](_0x46fa('0x79'),_0x1afe97,_0x22f224);}else{if(_0x4d3607[_0x46fa('0x41')][_0x2c0b0a]===_0x46fa('0x7a')){_0x1af167[_0x46fa('0x4a')]('i.'+_0x2c0b0a+_0x46fa('0x7b'));}else{_0x1af167[_0x46fa('0x4a')]('i.'+_0x2c0b0a+_0x46fa('0x7c'),_0x4d3607['query'][_0x2c0b0a]);}}});}if(_0x4d3607['query'][_0x46fa('0x7d')]){if(_0x4d3607[_0x46fa('0x41')]['read']==0x1){_0x1af167[_0x46fa('0x60')](_0x46fa('0x7e'));}else{_0x1af167[_0x46fa('0x60')](_0x46fa('0x7f'));}}if(_0x4d3607[_0x46fa('0x41')]['tag']){_0x1b4d77=_[_0x46fa('0x80')](_0x4d3607['query']['tag'])?_0x4d3607[_0x46fa('0x41')]['tag']:new Array(_0x4d3607[_0x46fa('0x41')]['tag']);_0x1b4d77[_0x46fa('0x6d')](function(_0x129538){_0xd6677b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x129538+',%');});}if(_0x4d3607[_0x46fa('0x41')][_0x46fa('0x81')]){var _0x11a79d=_0x4d3607[_0x46fa('0x41')]['filter'][_0x46fa('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x46fa('0x83')](_0x11a79d)){_0x2e2c3a['or'](_0x46fa('0x84'),_0x11a79d+'%');}else{_0x2e2c3a['or'](_0x46fa('0x85'),qs[_0x46fa('0x66')](_0x11a79d))['or']('i.from\x20LIKE\x20?',_0x11a79d+'%')['or'](_0x46fa('0x86'),_0x11a79d+'%');}}}_0x1af167['where'](_0x2e2c3a);_0x1af167[_0x46fa('0x87')]('i.id');var _0x111b25={'type':db[_0x46fa('0x88')][_0x46fa('0x89')]['SELECT'],'raw':!![]};var _0x58a1b4=_0x1af167['clone']();_0x58a1b4['field'](_0x46fa('0x8a'));_0x58a1b4[_0x46fa('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x46fa('0x8b'));if(_0x3ab9b2[_0x46fa('0x48')]){_0x3ab9b2[_0x46fa('0x48')][_0x46fa('0x6d')](function(_0x147285){var _0x261beb=_0x147285[0x0]===_0x46fa('0x8c')?_0x147285[0x0]:'i.'+_0x147285[0x0];_0x1af167[_0x46fa('0x48')](_0x261beb,_0x147285[0x1]===_0x46fa('0x8d')?![]:!![]);});}if(!_[_0x46fa('0x72')](_0x1b4d77)){_0x1af167[_0x46fa('0x60')](_0xd6677b);_0x58a1b4[_0x46fa('0x4a')]('t.id\x20IN\x20?',_0x1b4d77);}BPromise['resolve']()['then'](function(){if(!_0x49f512){if(_0x4d3607[_0x46fa('0x41')][_0x46fa('0x73')])return;_0x58a1b4[_0x46fa('0x4a')](_0x46fa('0x8e'));_0x1af167['where'](_0x46fa('0x8e'));return;}if(_0x4d3607[_0x46fa('0x8f')][_0x46fa('0x90')]!==_0x46fa('0x91'))return;return _0x4d3607[_0x46fa('0x8f')][_0x46fa('0x92')]({'attributes':['id'],'raw':!![]})[_0x46fa('0x27')](function(_0x5963fe){if(_[_0x46fa('0x72')](_0x5963fe)){_0x58a1b4['where'](_0x46fa('0x93'));_0x1af167[_0x46fa('0x4a')](_0x46fa('0x93'));}else{_0x58a1b4['where']('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x5963fe,'id'));_0x1af167[_0x46fa('0x4a')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x5963fe,'id'));}});})[_0x46fa('0x27')](function(){if(_0x4d3607[_0x46fa('0x8f')]['role']===_0x46fa('0x91')&&!_0x49f512&&!_0x4d3607[_0x46fa('0x41')][_0x46fa('0x73')])return[];return db['sequelize']['query'](_0x58a1b4[_0x46fa('0x94')](),_0x111b25);})[_0x46fa('0x27')](function(_0x387842){_0xb1c99c[_0x46fa('0x21')]=_0x387842[_0x46fa('0x46')];if(_0xb1c99c[_0x46fa('0x21')]===0x0)return[];return db[_0x46fa('0x95')]['query'](_0x25f1b8[_0x46fa('0x94')](),_0x111b25)['then'](function(_0x3a78d4){_0x419cb8=_['keyBy'](_0x3a78d4,'id');_0x111b25=_[_0x46fa('0x96')](_0x111b25,{'model':db[_0x46fa('0x97')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d3607[_0x46fa('0x41')][_0x46fa('0x45')]){_0x3ab9b2[_0x46fa('0x43')][_0x46fa('0x6d')](function(_0x367141){_0x1af167[_0x46fa('0x4c')]('i.'+_0x367141);});}else{_0x1af167[_0x46fa('0x4c')](_0x46fa('0x98'),_0x46fa('0x8b'));_0x1af167[_0x46fa('0x4c')](_0x46fa('0x99'),_0x46fa('0x9a'));_0x1af167[_0x46fa('0x4c')]('a.mandatoryDisposition',_0x46fa('0x9b'));_0x1af167[_0x46fa('0x4c')](_0x46fa('0x9c'),_0x46fa('0x8c'));_0x1af167[_0x46fa('0x4c')](_0x46fa('0x9d'));_0x1af167['field'](_0x46fa('0x9e'),_0x46fa('0x9f'));_0x1af167[_0x46fa('0x4c')](_0x46fa('0xa0'),_0x46fa('0xa1'));_0x1af167['field'](_0x46fa('0xa2'),_0x46fa('0xa3'));_0x1af167[_0x46fa('0x4c')](_0x46fa('0xa4'),_0x46fa('0xa5'));_0x1af167['field'](_0x46fa('0xa6'),'Contact.mobile');_0x1af167[_0x46fa('0x4c')](_0x46fa('0xa7'),'Contact.fax');_0x1af167[_0x46fa('0x4c')](_0x46fa('0xa8'),_0x46fa('0xa9'));_0x1af167[_0x46fa('0x4c')](_0x46fa('0xaa'),_0x46fa('0xab'));_0x1af167[_0x46fa('0x4c')](_0x46fa('0xac'),'TagIds');}if(_0x3ab9b2['limit'])_0x1af167[_0x46fa('0x22')](_0x3ab9b2[_0x46fa('0x22')]);if(_0x3ab9b2['offset'])_0x1af167[_0x46fa('0x1f')](_0x3ab9b2[_0x46fa('0x1f')]);return db[_0x46fa('0x95')]['query'](_0x1af167[_0x46fa('0x94')](),_0x111b25);})['then'](function(_0x14ad29){if(_0x14ad29['length']>0x0)_0x4495d4[_0x46fa('0x4a')](_0x46fa('0xad'),_['map'](_0x14ad29,'id'));return db['sequelize']['query'](_0x4495d4['toString'](),_0x111b25)[_0x46fa('0x27')](function(_0x32d03c){var _0x42abc0=_[_0x46fa('0xae')](_0x32d03c,_0x46fa('0xaf'));var _0x494c74=[];_0x14ad29[_0x46fa('0x6d')](function(_0x3ae945){_0x494c74[_0x46fa('0xb0')](updateOpenchannelInteraction(_0x3ae945,_0x419cb8,_0x42abc0));});return BPromise[_0x46fa('0xb1')](_0x494c74);});});})[_0x46fa('0x27')](function(_0x2719ea){_0xb1c99c['rows']=_0x2719ea;return _0xb1c99c;})[_0x46fa('0x27')](respondWithFilteredResult(_0xba2252,_0x3ab9b2))['catch'](handleError(_0xba2252,null));};exports[_0x46fa('0xb2')]=function(_0x46d6c8,_0x4232c1){var _0x3c194e={};if(_0x46d6c8[_0x46fa('0x41')][_0x46fa('0x3e')]&&_0x46d6c8[_0x46fa('0x41')][_0x46fa('0x3e')]===_0x46fa('0x4d')){_0x3c194e[_0x46fa('0x4d')]=_0x46d6c8['params']['id'];}else{_0x3c194e['id']=_0x46d6c8[_0x46fa('0xb3')]['id'];}var _0x17c68={'raw':![],'where':_0x3c194e},_0x222876={};_0x222876['model']=_[_0x46fa('0xb4')](db[_0x46fa('0x97')][_0x46fa('0x3c')]);_0x222876['query']=_[_0x46fa('0xb4')](_0x46d6c8[_0x46fa('0x41')]);_0x222876['filters']=_[_0x46fa('0x44')](_0x222876[_0x46fa('0x40')],_0x222876['query']);_0x17c68[_0x46fa('0x43')]=_[_0x46fa('0x44')](_0x222876[_0x46fa('0x40')],qs['fields'](_0x46d6c8[_0x46fa('0x41')][_0x46fa('0x45')]));_0x17c68[_0x46fa('0x43')]=_0x17c68[_0x46fa('0x43')][_0x46fa('0x46')]?_0x17c68['attributes']:_0x222876[_0x46fa('0x40')];if(_0x46d6c8['query'][_0x46fa('0xb5')]){_0x17c68[_0x46fa('0xb6')]=[{'all':!![]}];}_0x17c68=_['merge']({},_0x17c68,_0x46d6c8[_0x46fa('0xb7')]);return db[_0x46fa('0x97')][_0x46fa('0x5e')](_0x17c68)[_0x46fa('0x27')](handleEntityNotFound(_0x4232c1,null))[_0x46fa('0x27')](respondWithResult(_0x4232c1,null))[_0x46fa('0x33')](handleError(_0x4232c1,null));};exports[_0x46fa('0xb8')]=function(_0x1d46d6,_0x42cde6){return db[_0x46fa('0x97')][_0x46fa('0xb8')](_0x1d46d6[_0x46fa('0xb9')],{})[_0x46fa('0x27')](respondWithResult(_0x42cde6,0xc9))[_0x46fa('0x33')](handleError(_0x42cde6,null));};exports[_0x46fa('0xba')]=function(_0x2c7cc8,_0x125b0c){if(_0x2c7cc8[_0x46fa('0xb9')]['id']){delete _0x2c7cc8['body']['id'];}return db[_0x46fa('0x97')][_0x46fa('0x5e')]({'where':{'id':_0x2c7cc8[_0x46fa('0xb3')]['id']}})[_0x46fa('0x27')](handleEntityNotFound(_0x125b0c,null))[_0x46fa('0x27')](saveUpdates(_0x2c7cc8[_0x46fa('0xb9')],null))[_0x46fa('0x27')](respondWithResult(_0x125b0c,null))[_0x46fa('0x33')](handleError(_0x125b0c,null));};exports['destroy']=function(_0x508c82,_0x57f79e){return db[_0x46fa('0x97')][_0x46fa('0x5e')]({'where':{'id':_0x508c82[_0x46fa('0xb3')]['id']}})[_0x46fa('0x27')](handleEntityNotFound(_0x57f79e,null))['then'](removeEntity(_0x57f79e,null))['catch'](handleError(_0x57f79e,null));};exports[_0x46fa('0xbb')]=function(_0x2ec517,_0x3d899f){return db[_0x46fa('0x97')][_0x46fa('0xbb')]()[_0x46fa('0x27')](respondWithResult(_0x3d899f,null))[_0x46fa('0x33')](handleError(_0x3d899f,null));};exports['addMessage']=function(_0x56ddcc,_0x3c1e59,_0x4a06a1){return db[_0x46fa('0xbc')][_0x46fa('0x5e')]({'where':{'id':_0x56ddcc[_0x46fa('0xb3')]['id']}})[_0x46fa('0x27')](handleEntityNotFound(_0x3c1e59,null))[_0x46fa('0x27')](function(_0x484c85){if(_0x484c85){return _0x484c85[_0x46fa('0xbd')](_0x56ddcc['body'][_0x46fa('0xbe')],_[_0x46fa('0xbf')](_0x56ddcc[_0x46fa('0xb9')],['ids','id'])||{});}})[_0x46fa('0x27')](respondWithResult(_0x3c1e59,null))[_0x46fa('0x33')](handleError(_0x3c1e59,null));};exports[_0x46fa('0xc0')]=function(_0x47df5d,_0x5a74db,_0x352bcb){var _0x121ebc={'raw':![],'where':{}};var _0x4e75c9={};var _0x263576={'count':0x0,'rows':[]};return db[_0x46fa('0x97')][_0x46fa('0xc1')]({'where':{'id':_0x47df5d[_0x46fa('0xb3')]['id']}})[_0x46fa('0x27')](handleEntityNotFound(_0x5a74db,null))[_0x46fa('0x27')](function(_0x2fba85){if(_0x2fba85){_0x4e75c9[_0x46fa('0x40')]=_[_0x46fa('0xb4')](db[_0x46fa('0xbc')]['rawAttributes']);_0x4e75c9[_0x46fa('0x41')]=_[_0x46fa('0xb4')](_0x47df5d['query']);_0x4e75c9[_0x46fa('0x42')]=_[_0x46fa('0x44')](_0x4e75c9[_0x46fa('0x40')],_0x4e75c9[_0x46fa('0x41')]);_0x121ebc[_0x46fa('0x43')]=_[_0x46fa('0x44')](_0x4e75c9['model'],qs[_0x46fa('0x45')](_0x47df5d[_0x46fa('0x41')]['fields']));_0x121ebc[_0x46fa('0x43')]=_0x121ebc[_0x46fa('0x43')][_0x46fa('0x46')]?_0x121ebc[_0x46fa('0x43')]:_0x4e75c9[_0x46fa('0x40')];if(!_0x47df5d[_0x46fa('0x41')]['hasOwnProperty'](_0x46fa('0x47'))){_0x121ebc[_0x46fa('0x22')]=qs[_0x46fa('0x22')](_0x47df5d['query'][_0x46fa('0x22')]);_0x121ebc[_0x46fa('0x1f')]=qs[_0x46fa('0x1f')](_0x47df5d['query']['offset']);}_0x121ebc['order']=qs[_0x46fa('0x49')](_0x47df5d['query']['sort']);_0x121ebc[_0x46fa('0x4a')]=qs[_0x46fa('0x42')](_[_0x46fa('0x4b')](_0x47df5d[_0x46fa('0x41')],_0x4e75c9[_0x46fa('0x42')]));_0x121ebc[_0x46fa('0x4a')][_0x46fa('0xaf')]=_0x2fba85['id'];if(_0x47df5d['query'][_0x46fa('0x81')]){_0x121ebc[_0x46fa('0x4a')]=_[_0x46fa('0x96')](_0x121ebc[_0x46fa('0x4a')],{'$or':_['map'](_0x121ebc['attributes'],function(_0x4c3476){var _0x529d66={};_0x529d66[_0x4c3476]={'$like':'%'+_0x47df5d[_0x46fa('0x41')][_0x46fa('0x81')]+'%'};return _0x529d66;})});}if(_0x47df5d[_0x46fa('0x41')][_0x46fa('0x77')]){var _0x103fbb=_0x47df5d[_0x46fa('0x41')][_0x46fa('0x77')][_0x46fa('0x32')](',');var _0x10de15={};_0x10de15[_0x103fbb[0x0]]={'$gte':moment(_0x103fbb[0x1])['format'](_0x46fa('0xc2'))};_0x121ebc[_0x46fa('0x4a')]=_[_0x46fa('0x96')](_0x121ebc[_0x46fa('0x4a')],_0x10de15);}_0x121ebc=_['merge']({},_0x121ebc,_0x47df5d['options']);return db[_0x46fa('0xbc')]['count']({'where':_0x121ebc[_0x46fa('0x4a')]})[_0x46fa('0x27')](function(_0x464bda){_0x263576[_0x46fa('0x21')]=_0x464bda;if(_0x47df5d['query'][_0x46fa('0xb5')]){_0x121ebc[_0x46fa('0xb6')]=[{'all':!![]}];}return db[_0x46fa('0xbc')][_0x46fa('0xc3')](_0x121ebc);})[_0x46fa('0x27')](function(_0x230524){_0x263576['rows']=_0x230524;return _0x263576;});}})[_0x46fa('0x27')](respondWithFilteredResult(_0x5a74db,_0x121ebc))[_0x46fa('0x33')](handleError(_0x5a74db,null));};exports[_0x46fa('0xc4')]=function(_0x2426d3,_0x5a743a,_0x513de2){return db[_0x46fa('0x97')][_0x46fa('0x5e')]({'where':{'id':_0x2426d3[_0x46fa('0xb3')]['id']}})[_0x46fa('0x27')](handleEntityNotFound(_0x5a743a,null))['then'](function(_0x2ec479){if(_0x2ec479){return _0x2ec479[_0x46fa('0xc5')](_0x2426d3[_0x46fa('0xb9')][_0x46fa('0xbe')],_[_0x46fa('0xbf')](_0x2426d3[_0x46fa('0xb9')],[_0x46fa('0xbe'),'id'])||{})[_0x46fa('0xc6')](function(){return db[_0x46fa('0x6c')][_0x46fa('0xc3')]({'attributes':['id','name','color'],'where':{'id':_0x2426d3[_0x46fa('0xb9')]['ids']}});})['then'](function(_0x49e853){socket[_0x46fa('0xc7')](_0x46fa('0xc8'),{'id':Number(_0x2426d3[_0x46fa('0xb3')]['id']),'tags':_0x49e853||[]});return{'id':Number(_0x2426d3['params']['id']),'tags':_0x49e853||[]};});}})[_0x46fa('0x27')](respondWithResult(_0x5a743a,null))[_0x46fa('0x33')](handleError(_0x5a743a,null));};exports[_0x46fa('0xc9')]=function(_0x5cd80e,_0x1ae9e3,_0x65566e){return db[_0x46fa('0x97')][_0x46fa('0x5e')]({'where':{'id':_0x5cd80e[_0x46fa('0xb3')]['id']}})[_0x46fa('0x27')](handleEntityNotFound(_0x1ae9e3,null))[_0x46fa('0x27')](function(_0x422b23){if(_0x422b23){return _0x422b23[_0x46fa('0xc9')](_0x5cd80e[_0x46fa('0x41')][_0x46fa('0xbe')]);}})[_0x46fa('0x27')](respondWithStatusCode(_0x1ae9e3,null))[_0x46fa('0x33')](handleError(_0x1ae9e3,null));};exports[_0x46fa('0xca')]=function(_0x19c0ee,_0xcafb1e){var _0x24f9bc=moment()[_0x46fa('0xcb')]()[_0x46fa('0x94')]();var _0x16db59=path['join'](config[_0x46fa('0xcc')],_0x46fa('0xcd'),_0x46fa('0xce'),_0x46fa('0xcf'));var _0x14e6c5=path[_0x46fa('0xd0')](config[_0x46fa('0xcc')],_0x46fa('0xcd'),_0x46fa('0xce'),'attachments');var _0x22890f=path[_0x46fa('0xd0')](_0x16db59,_0x24f9bc);var _0x435ed1=util[_0x46fa('0xd1')](_0x46fa('0xd2'),_0x19c0ee[_0x46fa('0xb3')]['id'],_0x24f9bc);var _0x345163=path[_0x46fa('0xd0')](_0x16db59,_0x435ed1);var _0x9896b6=[];_0x9896b6[_0x46fa('0xb0')]({'model':db['User'],'as':_0x46fa('0x70'),'attributes':['id',_0x46fa('0x2f')],'raw':!![]});_0x9896b6['push']({'model':db[_0x46fa('0xd3')],'as':_0x46fa('0x63'),'attributes':['id','firstName',_0x46fa('0xd4')],'raw':!![]});if(_0x19c0ee[_0x46fa('0x41')]['attachments']){_0x9896b6[_0x46fa('0xb0')]({'model':db[_0x46fa('0xd5')],'as':'Attachment','raw':!![]});}var _0x4dd8b3=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x46fa('0xb9'),_0x46fa('0x75'),'direction',_0x46fa('0xd6'),_0x46fa('0x7d')],'include':_0x9896b6}];_0x4dd8b3[_0x46fa('0xb0')]({'model':db[_0x46fa('0xd7')],'as':_0x46fa('0xd8'),'attributes':['id',_0x46fa('0x2b')]});_0x4dd8b3[_0x46fa('0xb0')]({'model':db[_0x46fa('0x70')],'as':'Owner','attributes':['id',_0x46fa('0x2f')]});return db[_0x46fa('0x97')][_0x46fa('0x5e')]({'where':{'id':_0x19c0ee[_0x46fa('0xb3')]['id']},'include':_0x4dd8b3})[_0x46fa('0x27')](handleEntityNotFound(_0xcafb1e,null))[_0x46fa('0x27')](function(_0x4b3b9a){if(_0x4b3b9a){var _0x199cda=_0x4b3b9a['get']({'plain':!![]});fs['mkdirSync'](_0x22890f);var _0x430f13={'channel':_0x46fa('0xd9'),'account':_0x199cda[_0x46fa('0xd8')]['name'],'agent':_0x199cda[_0x46fa('0xda')]?_0x199cda[_0x46fa('0xda')][_0x46fa('0x2f')]:_0x46fa('0xdb'),'createdAt':moment(_0x199cda[_0x46fa('0x75')])[_0x46fa('0xd1')](_0x46fa('0xc2'))[_0x46fa('0x94')](),'closedAt':_0x199cda['closed']?moment(_0x199cda['closedAt'])[_0x46fa('0xd1')](_0x46fa('0xc2'))[_0x46fa('0x94')]():'','disposition':_0x199cda[_0x46fa('0xdc')],'visibility':_0x199cda[_0x46fa('0xdd')]?_0x46fa('0xde'):_0x46fa('0xdf'),'messages':_(_0x199cda['Messages'])[_0x46fa('0x81')]({'secret':![]})['map'](function(_0x5fa9de){if(_0x5fa9de[_0x46fa('0xd5')]){var _0x58f3f1=path[_0x46fa('0xd0')](_0x14e6c5,_0x5fa9de[_0x46fa('0xd5')][_0x46fa('0xe0')]);if(fs[_0x46fa('0xe1')](_0x58f3f1)){fs['createReadStream'](_0x58f3f1)[_0x46fa('0xe2')](fs[_0x46fa('0xe3')](path[_0x46fa('0xd0')](_0x22890f,_0x5fa9de['Attachment'][_0x46fa('0xe0')])));}}return{'date':moment(_0x5fa9de[_0x46fa('0x75')])['format'](_0x46fa('0xc2'))[_0x46fa('0x94')](),'sender':_0x5fa9de[_0x46fa('0xe4')]===_0x46fa('0xe5')?_0x5fa9de['User']?_0x5fa9de['User'][_0x46fa('0x2f')]:_0x46fa('0xe6'):_0x5fa9de['Contact'][_0x46fa('0xe7')]+(_0x5fa9de['Contact'][_0x46fa('0xd4')]?'\x20'+_0x5fa9de[_0x46fa('0x63')][_0x46fa('0xd4')]:''),'body':_0x5fa9de['Attachment']?_0x5fa9de[_0x46fa('0xd5')]['basename']:_0x5fa9de[_0x46fa('0xb9')],'direction':_0x5fa9de[_0x46fa('0xe4')]===_0x46fa('0xe5')?'A':'C','secret':_0x5fa9de[_0x46fa('0xd6')],'read':_0x5fa9de[_0x46fa('0x7d')],'attachment':_0x5fa9de['Attachment']};})['value']()};return ejs[_0x46fa('0xe8')](path[_0x46fa('0xd0')](config['root'],_0x46fa('0xcd'),'views','downloadInteraction.ejs'),{'interaction':_0x430f13})[_0x46fa('0x27')](function(_0x359366){var _0x4c061d=path[_0x46fa('0xd0')](_0x22890f,'transcript-'+_0x199cda['id']+'-'+_0x24f9bc+'.pdf');var _0x3366f6={'path':_0x4c061d,'channel':_0x46fa('0xd9'),'interactionId':_0x199cda['id']};return pdf[_0x46fa('0xe9')](_0x359366,_0x3366f6);})['then'](function(){return new BPromise(function(_0x267610,_0x272cd3){zipdir(_0x22890f,{'saveTo':_0x345163},function(_0x2d480e,_0x4e67f6){if(_0x2d480e)return _0x272cd3(_0x2d480e);return _0x267610(_0x4e67f6);});})[_0x46fa('0x27')](function(){return new BPromise(function(_0x4a50f6,_0x486b04){rimraf(_0x22890f,function(_0x881041){if(_0x881041)_0x486b04(_0x881041);return _0x4a50f6();});});})[_0x46fa('0x27')](function(){return _0xcafb1e[_0x46fa('0xca')](_0x345163,_0x435ed1,function(_0x3145f2){if(_0x3145f2){console[_0x46fa('0xea')](_0x46fa('0xeb'),_0x3145f2);}else{fs[_0x46fa('0xec')](_0x345163);}});});});}else{return _0xcafb1e[_0x46fa('0x1d')](0xc8);}})[_0x46fa('0x33')](handleError(_0xcafb1e,null));}; \ No newline at end of file +var _0xe4b4=['addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','emit','removeTags','download','unix','join','root','files','tmp','transcript-%d-%s.zip','User','firstName','lastName','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Account','get','Owner','disposition','threadId','Public','Private','createReadStream','createWriteStream','basename','out','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','split','push','waiting','total','closed','UserId','talking','answered','unmanaged','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','field','color','from','select','u.id','ui.OpenchannelInteractionId','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20>\x200','Contact','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','OpenchannelInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','catch','show','params','include','merge','create','describe'];(function(_0x378996,_0x528dce){var _0x46df9d=function(_0x5e2157){while(--_0x5e2157){_0x378996['push'](_0x378996['shift']());}};_0x46df9d(++_0x528dce);}(_0xe4b4,0x11d));var _0x4e4b=function(_0x29165d,_0x221063){_0x29165d=_0x29165d-0x0;var _0x3dd8f9=_0xe4b4[_0x29165d];return _0x3dd8f9;};'use strict';var emlformat=require(_0x4e4b('0x0'));var rimraf=require(_0x4e4b('0x1'));var zipdir=require(_0x4e4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e4b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4e4b('0x4'));var ejs=require(_0x4e4b('0x5'));var fs=require('fs');var fs_extra=require(_0x4e4b('0x6'));var _=require(_0x4e4b('0x7'));var squel=require(_0x4e4b('0x8'));var crypto=require('crypto');var jsforce=require(_0x4e4b('0x9'));var deskjs=require(_0x4e4b('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4e4b('0xb'));var Papa=require(_0x4e4b('0xc'));var Redis=require('ioredis');var authService=require(_0x4e4b('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x4e4b('0xe'));var pdf=require(_0x4e4b('0xf'));var hardwareService=require(_0x4e4b('0x10'));var logger=require(_0x4e4b('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x4e4b('0x12'));var licenseUtil=require(_0x4e4b('0x13'));var db=require(_0x4e4b('0x14'))['db'];config['redis']=_[_0x4e4b('0x15')](config[_0x4e4b('0x16')],{'host':_0x4e4b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4e4b('0x18'))['register'](socket);function respondWithStatusCode(_0x40bcbd,_0x16a90f){_0x16a90f=_0x16a90f||0xcc;return function(_0x1bcac4){if(_0x1bcac4){return _0x40bcbd[_0x4e4b('0x19')](_0x16a90f);}return _0x40bcbd[_0x4e4b('0x1a')](_0x16a90f)[_0x4e4b('0x1b')]();};}function respondWithResult(_0x248697,_0x3f0474){_0x3f0474=_0x3f0474||0xc8;return function(_0x48c476){if(_0x48c476){return _0x248697[_0x4e4b('0x1a')](_0x3f0474)[_0x4e4b('0x1c')](_0x48c476);}};}function respondWithFilteredResult(_0xea5076,_0x4486ea){return function(_0x1ec24e){if(_0x1ec24e){var _0x2a2b75=typeof _0x4486ea[_0x4e4b('0x1d')]===_0x4e4b('0x1e')&&typeof _0x4486ea['limit']===_0x4e4b('0x1e');var _0x164c7e=_0x1ec24e['count'];var _0x3d4ac9=_0x2a2b75?0x0:_0x4486ea[_0x4e4b('0x1d')];var _0x251501=_0x2a2b75?_0x1ec24e[_0x4e4b('0x1f')]:_0x4486ea[_0x4e4b('0x1d')]+_0x4486ea[_0x4e4b('0x20')];var _0x165760;if(_0x251501>=_0x164c7e){_0x251501=_0x164c7e;_0x165760=0xc8;}else{_0x165760=0xce;}_0xea5076[_0x4e4b('0x1a')](_0x165760);return _0xea5076[_0x4e4b('0x21')](_0x4e4b('0x22'),_0x3d4ac9+'-'+_0x251501+'/'+_0x164c7e)['json'](_0x1ec24e);}return null;};}function patchUpdates(_0x5a3579){return function(_0x2a892c){try{jsonpatch['apply'](_0x2a892c,_0x5a3579,!![]);}catch(_0x1e24ac){return BPromise[_0x4e4b('0x23')](_0x1e24ac);}return _0x2a892c['save']();};}function saveUpdates(_0xb00d2e,_0x32d278){return function(_0x29fb27){if(_0x29fb27){return _0x29fb27[_0x4e4b('0x24')](_0xb00d2e)[_0x4e4b('0x25')](function(_0x4fee36){return _0x4fee36;});}return null;};}function removeEntity(_0x120054,_0x49f17a){return function(_0x568235){if(_0x568235){return _0x568235[_0x4e4b('0x26')]()[_0x4e4b('0x25')](function(){_0x120054['status'](0xcc)[_0x4e4b('0x1b')]();});}};}function handleEntityNotFound(_0x110ac4,_0x423a3d){return function(_0x3af979){if(!_0x3af979){_0x110ac4['sendStatus'](0x194);}return _0x3af979;};}function handleError(_0x3865fd,_0xf856c5){_0xf856c5=_0xf856c5||0x1f4;return function(_0x23124f){logger['error'](_0x23124f[_0x4e4b('0x27')]);if(_0x23124f[_0x4e4b('0x28')]){delete _0x23124f[_0x4e4b('0x28')];}_0x3865fd[_0x4e4b('0x1a')](_0xf856c5)[_0x4e4b('0x29')](_0x23124f);};}function getInteractionUsers(_0x518f11,_0x3fb905){return new BPromise(function(_0x315f95,_0xce4049){try{if(_0x3fb905[_0x518f11['id']]){_0x518f11[_0x4e4b('0x2a')]=_['map'](_0x3fb905[_0x518f11['id']],function(_0x57cf6a){return{'id':_0x57cf6a['id'],'fullname':_0x57cf6a[_0x4e4b('0x2b')]};});}}catch(_0x102a05){_0xce4049(_0x102a05);}_0x315f95(_0x518f11);});}function getInteractionTags(_0x5edeac,_0x2af9df){return new BPromise(function(_0x4e1dce,_0x336bc){try{if(_0x5edeac[_0x4e4b('0x2c')]){_0x5edeac[_0x4e4b('0x2d')]=[];_0x5edeac[_0x4e4b('0x2c')][_0x4e4b('0x2e')](',')['forEach'](function(_0x335c4e){_0x5edeac[_0x4e4b('0x2d')][_0x4e4b('0x2f')](_0x2af9df[_0x335c4e]);});}delete _0x5edeac[_0x4e4b('0x2c')];}catch(_0xebdea5){_0x336bc(_0xebdea5);}_0x4e1dce(_0x5edeac);});}function updateOpenchannelInteraction(_0x172b3a,_0x123186,_0x126625){return new BPromise(function(_0x506a79,_0x4903eb){return getInteractionUsers(_0x172b3a,_0x126625)[_0x4e4b('0x25')](function(_0xc9d08e){return getInteractionTags(_0xc9d08e,_0x123186);})[_0x4e4b('0x25')](function(_0x42fb3c){return getStateInteraction(_0x42fb3c);})['then'](function(_0x5c213e){_0x506a79(_0x5c213e);})['catch'](function(_0x27ce39){_0x4903eb(_0x27ce39);});});}function getStateInteraction(_0xc135d1){return new BPromise(function(_0x31e79a){_0xc135d1[_0x4e4b('0x30')]=0x0;_0xc135d1['talking']=0x0;_0xc135d1['answered']=0x0;_0xc135d1['unmanaged']=0x0;_0xc135d1[_0x4e4b('0x31')]=0x0;if(!_0xc135d1[_0x4e4b('0x32')]&&!_0xc135d1[_0x4e4b('0x33')]){_0xc135d1[_0x4e4b('0x30')]+=0x1;}if(!_0xc135d1[_0x4e4b('0x32')]&&_0xc135d1[_0x4e4b('0x33')]){_0xc135d1[_0x4e4b('0x34')]+=0x1;if(_0xc135d1[_0x4e4b('0x30')]){_0xc135d1[_0x4e4b('0x30')]-=0x1;}}if(_0xc135d1[_0x4e4b('0x32')]&&_0xc135d1[_0x4e4b('0x33')]){_0xc135d1[_0x4e4b('0x35')]+=0x1;if(_0xc135d1[_0x4e4b('0x34')]){_0xc135d1[_0x4e4b('0x34')]-=0x1;}}if(_0xc135d1[_0x4e4b('0x32')]&&!_0xc135d1[_0x4e4b('0x33')]){_0xc135d1[_0x4e4b('0x36')]+=0x1;if(_0xc135d1[_0x4e4b('0x30')]){_0xc135d1['waiting']-=0x1;}}_0xc135d1[_0x4e4b('0x31')]+=0x1;_0x31e79a(_0xc135d1);});}exports[_0x4e4b('0x37')]=function(_0x4935a5,_0x2c7155){var _0x3576cf={},_0x466d97={},_0x2f5212={'count':0x0,'rows':[]};var _0xf59f38=_[_0x4e4b('0x38')](db['OpenchannelInteraction'][_0x4e4b('0x39')],function(_0x1e514d){return{'name':_0x1e514d[_0x4e4b('0x3a')],'type':_0x1e514d[_0x4e4b('0x3b')][_0x4e4b('0x3c')]};});_0x466d97['model']=_[_0x4e4b('0x38')](_0xf59f38,'name');_0x466d97[_0x4e4b('0x3d')]=_[_0x4e4b('0x3e')](_0x4935a5[_0x4e4b('0x3d')]);_0x466d97[_0x4e4b('0x3f')]=_[_0x4e4b('0x40')](_0x466d97[_0x4e4b('0x41')],_0x466d97[_0x4e4b('0x3d')]);_0x3576cf[_0x4e4b('0x42')]=_['intersection'](_0x466d97[_0x4e4b('0x41')],qs[_0x4e4b('0x43')](_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x43')]));_0x3576cf['attributes']=_0x3576cf[_0x4e4b('0x42')][_0x4e4b('0x44')]?_0x3576cf[_0x4e4b('0x42')]:_0x466d97[_0x4e4b('0x41')];if(!_0x4935a5[_0x4e4b('0x3d')]['hasOwnProperty'](_0x4e4b('0x45'))){_0x3576cf[_0x4e4b('0x20')]=qs[_0x4e4b('0x20')](_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x20')]);_0x3576cf[_0x4e4b('0x1d')]=qs['offset'](_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x1d')]);}_0x3576cf[_0x4e4b('0x46')]=qs[_0x4e4b('0x47')](_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x47')]);_0x3576cf[_0x4e4b('0x48')]=qs[_0x4e4b('0x3f')](_[_0x4e4b('0x49')](_0x4935a5[_0x4e4b('0x3d')],_0x466d97[_0x4e4b('0x3f')]),_0xf59f38);var _0x31eecd=[];var _0x321ece=squel['select']()[_0x4e4b('0x4a')]('id')[_0x4e4b('0x4a')]('name')[_0x4e4b('0x4a')](_0x4e4b('0x4b'))[_0x4e4b('0x4c')]('tools_tags');var _0x1aef2d=squel[_0x4e4b('0x4d')]()[_0x4e4b('0x4a')](_0x4e4b('0x4e'))['field']('u.fullname')[_0x4e4b('0x4a')](_0x4e4b('0x4f'))['from']('user_has_openchannel_interactions','ui')[_0x4e4b('0x50')](_0x4e4b('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x574f16=squel[_0x4e4b('0x4d')]()['from'](_0x4e4b('0x52'),'i')['left_join'](_0x4e4b('0x53'),'c',_0x4e4b('0x54'))['left_join'](_0x4e4b('0x51'),'o','o.id\x20=\x20i.UserId')[_0x4e4b('0x50')](_0x4e4b('0x55'),'a',_0x4e4b('0x56'))[_0x4e4b('0x50')](_0x4e4b('0x57'),'me',_0x4e4b('0x58'))[_0x4e4b('0x50')](_0x4e4b('0x59'),'it',_0x4e4b('0x5a'))['left_join'](_0x4e4b('0x5b'),'t',_0x4e4b('0x5c'));var _0x27598=squel[_0x4e4b('0x5d')]();var _0x385a19=[];var _0x1969df=squel[_0x4e4b('0x5d')]();var _0x352034;if(_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x5e')]){_0x352034=as[_0x4e4b('0x5f')](_0x4935a5['query'][_0x4e4b('0x5e')]);var _0x32c2ee=_0x352034[_0x4e4b('0x60')];for(var _0x17fa94=0x0;_0x17fa94<_0x352034['conditions'][_0x4e4b('0x44')];_0x17fa94++){var _0x345b67=_0x352034[_0x4e4b('0x61')][_0x17fa94];var _0x2bbe4d='i';var _0x522ef1=_[_0x4e4b('0x62')](_0xf59f38,[_0x4e4b('0x28'),_0x345b67['field']]);if(!_0x522ef1){switch(_0x345b67[_0x4e4b('0x4a')]){case'unreadMessages':if(_0x345b67['value']==0x1){_0x574f16[_0x4e4b('0x63')]('`'+_0x345b67[_0x4e4b('0x4a')]+'`\x20=\x200');}else{_0x574f16[_0x4e4b('0x63')]('`'+_0x345b67[_0x4e4b('0x4a')]+_0x4e4b('0x64'));}break;case _0x4e4b('0x65'):if(_0x345b67['operator']==='$substring'){if(_0x345b67[_0x4e4b('0x66')][_0x4e4b('0x2e')]('\x20')[_0x4e4b('0x44')]>0x1){_0x27598[_0x32c2ee](_0x4e4b('0x67'),qs[_0x4e4b('0x68')](_0x345b67[_0x4e4b('0x66')]),null);}else{var _0x5a0526='%'+_0x345b67[_0x4e4b('0x66')]+'%';_0x27598[_0x32c2ee](_0x4e4b('0x69'),_0x5a0526,_0x5a0526,_0x5a0526);}}else{_0x522ef1=_[_0x4e4b('0x62')](_0xf59f38,[_0x4e4b('0x28'),_0x4e4b('0x6a')]);_0x345b67['field']='ContactId';_0x518c1d=as[_0x4e4b('0x6b')](_0x2bbe4d,_0x522ef1['type'],_0x345b67);_0x27598[_0x32c2ee](_0x518c1d['text'],_0x518c1d['value'][_0x4e4b('0x6c')],_0x518c1d[_0x4e4b('0x66')][_0x4e4b('0x1b')]);}break;case _0x4e4b('0x6d'):var _0x3669fb=_0x345b67['value']['split'](',')[_0x4e4b('0x38')](function(_0x4959e7){return Number(_0x4959e7);});_0x3669fb[_0x4e4b('0x6e')](function(_0x132b46){_0x1969df['or'](_0x4e4b('0x6f'),'%,'+_0x132b46+',%');});_0x385a19=_[_0x4e4b('0x70')](_0x385a19,_0x3669fb);break;case'User':if(_0x345b67[_0x4e4b('0x71')]===_0x4e4b('0x72')){_0x27598[_0x32c2ee](_0x4e4b('0x73'),'%'+_0x345b67[_0x4e4b('0x66')]+'%',null);}else{_0x522ef1=_[_0x4e4b('0x62')](_0xf59f38,[_0x4e4b('0x28'),_0x4e4b('0x33')]);_0x345b67[_0x4e4b('0x4a')]=_0x4e4b('0x33');_0x518c1d=as[_0x4e4b('0x6b')](_0x2bbe4d,_0x522ef1['type'],_0x345b67);_0x27598[_0x32c2ee](_0x518c1d[_0x4e4b('0x74')],_0x518c1d[_0x4e4b('0x66')][_0x4e4b('0x6c')],_0x518c1d[_0x4e4b('0x66')][_0x4e4b('0x1b')]);}break;case _0x4e4b('0x75'):_0x518c1d=as[_0x4e4b('0x6b')]('me',null,_0x345b67);_0x27598[_0x32c2ee](_0x518c1d[_0x4e4b('0x74')],_0x518c1d[_0x4e4b('0x66')][_0x4e4b('0x6c')],_0x518c1d[_0x4e4b('0x66')][_0x4e4b('0x1b')]);break;}}else{var _0x518c1d=as['buildExpression'](_0x2bbe4d,_0x522ef1['type'],_0x345b67);_0x27598[_0x32c2ee](_0x518c1d[_0x4e4b('0x74')],_0x518c1d['value'][_0x4e4b('0x6c')],_0x518c1d[_0x4e4b('0x66')]['end']);}}}else{var _0x3a2f0c=_(_0x4935a5[_0x4e4b('0x3d')])['keys']()[_0x4e4b('0x38')](function(_0xdba014){return _[_0x4e4b('0x76')](_0xf59f38,[_0x4e4b('0x28'),_0xdba014])?_0xdba014:undefined;})[_0x4e4b('0x77')]()[_0x4e4b('0x66')]();if(!_['isEmpty'](_0x3a2f0c)){_0x3a2f0c['forEach'](function(_0x59c6db){if(_0x59c6db==='OpenchannelAccountId'){_0x574f16[_0x4e4b('0x48')](_0x4e4b('0x78'),[]['concat'](_0x4935a5[_0x4e4b('0x3d')][_0x59c6db]));}else if(_0x59c6db===_0x4e4b('0x79')){var _0x46c519=JSON[_0x4e4b('0x7a')](_0x4935a5[_0x4e4b('0x3d')][_0x59c6db])['$gte'];var _0x31c8a4=JSON[_0x4e4b('0x7a')](_0x4935a5[_0x4e4b('0x3d')][_0x59c6db])[_0x4e4b('0x7b')];_0x574f16['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x46c519,_0x31c8a4);}else{if(_0x4935a5['query'][_0x59c6db]===_0x4e4b('0x7c')){_0x574f16[_0x4e4b('0x48')]('i.'+_0x59c6db+_0x4e4b('0x7d'));}else{_0x574f16['where']('i.'+_0x59c6db+'\x20=\x20?',_0x4935a5['query'][_0x59c6db]);}}});}if(_0x4935a5[_0x4e4b('0x3d')]['read']){if(_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x7e')]==0x1){_0x574f16[_0x4e4b('0x63')]('`unreadMessages`\x20=\x200');}else{_0x574f16['having'](_0x4e4b('0x7f'));}}if(_0x4935a5[_0x4e4b('0x3d')]['tag']){_0x385a19=_[_0x4e4b('0x80')](_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x81')])?_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x81')]:new Array(_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x81')]);_0x385a19['forEach'](function(_0x24771c){_0x1969df['or'](_0x4e4b('0x6f'),'%,'+_0x24771c+',%');});}if(_0x4935a5[_0x4e4b('0x3d')][_0x4e4b('0x82')]){var _0x150707=_0x4935a5[_0x4e4b('0x3d')]['filter']['replace']('\x5c','\x5c\x5c')[_0x4e4b('0x83')](/'/g,'\x27\x27');if(qs[_0x4e4b('0x84')](_0x150707)){_0x27598['or'](_0x4e4b('0x85'),_0x150707+'%');}else{_0x27598['or'](_0x4e4b('0x86'),qs['getFullTextValue'](_0x150707))['or'](_0x4e4b('0x87'),_0x150707+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x150707+'%');}}}_0x574f16[_0x4e4b('0x48')](_0x27598);_0x574f16[_0x4e4b('0x88')](_0x4e4b('0x89'));var _0x5e4ec0={'type':db[_0x4e4b('0x8a')]['QueryTypes'][_0x4e4b('0x8b')],'raw':!![]};var _0x461f6a=_0x574f16['clone']();_0x461f6a[_0x4e4b('0x4a')](_0x4e4b('0x89'));_0x461f6a[_0x4e4b('0x4a')](_0x4e4b('0x8c'),_0x4e4b('0x8d'));if(_0x3576cf[_0x4e4b('0x46')]){_0x3576cf[_0x4e4b('0x46')][_0x4e4b('0x6e')](function(_0x1f862c){var _0x2e69a5=_0x1f862c[0x0]==='contactName'?_0x1f862c[0x0]:'i.'+_0x1f862c[0x0];_0x574f16['order'](_0x2e69a5,_0x1f862c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4e4b('0x8e')](_0x385a19)){_0x574f16[_0x4e4b('0x63')](_0x1969df);_0x461f6a[_0x4e4b('0x48')](_0x4e4b('0x8f'),_0x385a19);}BPromise[_0x4e4b('0x90')]()[_0x4e4b('0x25')](function(){if(!_0x352034){if(_0x4935a5['query']['OpenchannelAccountId'])return;_0x461f6a[_0x4e4b('0x48')](_0x4e4b('0x91'));_0x574f16['where'](_0x4e4b('0x91'));return;}if(_0x4935a5[_0x4e4b('0x92')][_0x4e4b('0x93')]!==_0x4e4b('0x94'))return;return _0x4935a5[_0x4e4b('0x92')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x4e4b('0x25')](function(_0x19301b){if(_[_0x4e4b('0x8e')](_0x19301b)){_0x461f6a[_0x4e4b('0x48')](_0x4e4b('0x95'));_0x574f16[_0x4e4b('0x48')](_0x4e4b('0x95'));}else{_0x461f6a[_0x4e4b('0x48')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x4e4b('0x38')](_0x19301b,'id'));_0x574f16['where'](_0x4e4b('0x78'),_['map'](_0x19301b,'id'));}});})[_0x4e4b('0x25')](function(){if(_0x4935a5[_0x4e4b('0x92')]['role']===_0x4e4b('0x94')&&!_0x352034&&!_0x4935a5[_0x4e4b('0x3d')]['OpenchannelAccountId'])return[];return db[_0x4e4b('0x96')][_0x4e4b('0x3d')](_0x461f6a[_0x4e4b('0x97')](),_0x5e4ec0);})[_0x4e4b('0x25')](function(_0x386ca1){_0x2f5212[_0x4e4b('0x1f')]=_0x386ca1[_0x4e4b('0x44')];if(_0x2f5212[_0x4e4b('0x1f')]===0x0)return[];return db[_0x4e4b('0x96')][_0x4e4b('0x3d')](_0x321ece[_0x4e4b('0x97')](),_0x5e4ec0)[_0x4e4b('0x25')](function(_0x2a02bc){_0x31eecd=_[_0x4e4b('0x98')](_0x2a02bc,'id');_0x5e4ec0=_['merge'](_0x5e4ec0,{'model':db[_0x4e4b('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4935a5[_0x4e4b('0x3d')]['fields']){_0x3576cf['attributes'][_0x4e4b('0x6e')](function(_0x7b69b5){_0x574f16['field']('i.'+_0x7b69b5);});}else{_0x574f16[_0x4e4b('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4e4b('0x8d'));_0x574f16['field']('a.key',_0x4e4b('0x9a'));_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0x9b'),_0x4e4b('0x9c'));_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0x9d'),'contactName');_0x574f16['field'](_0x4e4b('0x9e'));_0x574f16['field'](_0x4e4b('0x9f'),_0x4e4b('0xa0'));_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0xa1'),'Contact.lastName');_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0xa2'),_0x4e4b('0xa3'));_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0xa4'),_0x4e4b('0xa5'));_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0xa6'),_0x4e4b('0xa7'));_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0xa8'),_0x4e4b('0xa9'));_0x574f16[_0x4e4b('0x4a')]('o.fullname','Owner.fullname');_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0xaa'),_0x4e4b('0xab'));_0x574f16[_0x4e4b('0x4a')](_0x4e4b('0xac'),_0x4e4b('0x2c'));}if(_0x3576cf[_0x4e4b('0x20')])_0x574f16[_0x4e4b('0x20')](_0x3576cf[_0x4e4b('0x20')]);if(_0x3576cf['offset'])_0x574f16[_0x4e4b('0x1d')](_0x3576cf['offset']);return db[_0x4e4b('0x96')][_0x4e4b('0x3d')](_0x574f16[_0x4e4b('0x97')](),_0x5e4ec0);})[_0x4e4b('0x25')](function(_0x590382){if(_0x590382[_0x4e4b('0x44')]>0x0)_0x1aef2d[_0x4e4b('0x48')](_0x4e4b('0xad'),_[_0x4e4b('0x38')](_0x590382,'id'));return db['sequelize'][_0x4e4b('0x3d')](_0x1aef2d[_0x4e4b('0x97')](),_0x5e4ec0)[_0x4e4b('0x25')](function(_0x1b0bc8){var _0x40ebf1=_[_0x4e4b('0xae')](_0x1b0bc8,_0x4e4b('0xaf'));var _0x3b2cbd=[];_0x590382[_0x4e4b('0x6e')](function(_0x194c00){_0x3b2cbd[_0x4e4b('0x2f')](updateOpenchannelInteraction(_0x194c00,_0x31eecd,_0x40ebf1));});return BPromise[_0x4e4b('0xb0')](_0x3b2cbd);});});})[_0x4e4b('0x25')](function(_0x18aef5){_0x2f5212[_0x4e4b('0xb1')]=_0x18aef5;return _0x2f5212;})[_0x4e4b('0x25')](respondWithFilteredResult(_0x2c7155,_0x3576cf))[_0x4e4b('0xb2')](handleError(_0x2c7155,null));};exports[_0x4e4b('0xb3')]=function(_0x336930,_0x3a1bbe){var _0x401584={};if(_0x336930['query']['type']&&_0x336930[_0x4e4b('0x3d')][_0x4e4b('0x3b')]===_0x4e4b('0x4c')){_0x401584['from']=_0x336930[_0x4e4b('0xb4')]['id'];}else{_0x401584['id']=_0x336930['params']['id'];}var _0x34334c={'raw':![],'where':_0x401584},_0x20ac28={};_0x20ac28[_0x4e4b('0x41')]=_[_0x4e4b('0x3e')](db[_0x4e4b('0x99')]['rawAttributes']);_0x20ac28[_0x4e4b('0x3d')]=_['keys'](_0x336930[_0x4e4b('0x3d')]);_0x20ac28['filters']=_[_0x4e4b('0x40')](_0x20ac28[_0x4e4b('0x41')],_0x20ac28['query']);_0x34334c[_0x4e4b('0x42')]=_[_0x4e4b('0x40')](_0x20ac28[_0x4e4b('0x41')],qs[_0x4e4b('0x43')](_0x336930['query'][_0x4e4b('0x43')]));_0x34334c[_0x4e4b('0x42')]=_0x34334c[_0x4e4b('0x42')][_0x4e4b('0x44')]?_0x34334c[_0x4e4b('0x42')]:_0x20ac28['model'];if(_0x336930[_0x4e4b('0x3d')]['includeAll']){_0x34334c[_0x4e4b('0xb5')]=[{'all':!![]}];}_0x34334c=_[_0x4e4b('0xb6')]({},_0x34334c,_0x336930['options']);return db[_0x4e4b('0x99')][_0x4e4b('0x62')](_0x34334c)[_0x4e4b('0x25')](handleEntityNotFound(_0x3a1bbe,null))['then'](respondWithResult(_0x3a1bbe,null))[_0x4e4b('0xb2')](handleError(_0x3a1bbe,null));};exports[_0x4e4b('0xb7')]=function(_0x191d34,_0x256eb4){return db[_0x4e4b('0x99')]['create'](_0x191d34[_0x4e4b('0x75')],{})['then'](respondWithResult(_0x256eb4,0xc9))[_0x4e4b('0xb2')](handleError(_0x256eb4,null));};exports['update']=function(_0x4eb136,_0x515ffd){if(_0x4eb136[_0x4e4b('0x75')]['id']){delete _0x4eb136[_0x4e4b('0x75')]['id'];}return db['OpenchannelInteraction'][_0x4e4b('0x62')]({'where':{'id':_0x4eb136[_0x4e4b('0xb4')]['id']}})[_0x4e4b('0x25')](handleEntityNotFound(_0x515ffd,null))[_0x4e4b('0x25')](saveUpdates(_0x4eb136[_0x4e4b('0x75')],null))[_0x4e4b('0x25')](respondWithResult(_0x515ffd,null))['catch'](handleError(_0x515ffd,null));};exports['destroy']=function(_0x235f5e,_0x23ca48){return db[_0x4e4b('0x99')][_0x4e4b('0x62')]({'where':{'id':_0x235f5e[_0x4e4b('0xb4')]['id']}})[_0x4e4b('0x25')](handleEntityNotFound(_0x23ca48,null))['then'](removeEntity(_0x23ca48,null))[_0x4e4b('0xb2')](handleError(_0x23ca48,null));};exports[_0x4e4b('0xb8')]=function(_0x3a2ed0,_0x146f38){return db[_0x4e4b('0x99')][_0x4e4b('0xb8')]()['then'](respondWithResult(_0x146f38,null))[_0x4e4b('0xb2')](handleError(_0x146f38,null));};exports[_0x4e4b('0xb9')]=function(_0x4d6e0f,_0x817c1d,_0x4136d1){return db['OpenchannelMessage']['find']({'where':{'id':_0x4d6e0f['params']['id']}})[_0x4e4b('0x25')](handleEntityNotFound(_0x817c1d,null))[_0x4e4b('0x25')](function(_0x8ed52c){if(_0x8ed52c){return _0x8ed52c[_0x4e4b('0xb9')](_0x4d6e0f[_0x4e4b('0x75')][_0x4e4b('0xba')],_[_0x4e4b('0xbb')](_0x4d6e0f[_0x4e4b('0x75')],[_0x4e4b('0xba'),'id'])||{});}})[_0x4e4b('0x25')](respondWithResult(_0x817c1d,null))[_0x4e4b('0xb2')](handleError(_0x817c1d,null));};exports[_0x4e4b('0xbc')]=function(_0x1fb424,_0x13ef9c,_0x5874ec){var _0x29a5a7={'raw':![],'where':{}};var _0x475f14={};var _0x1499a0={'count':0x0,'rows':[]};return db[_0x4e4b('0x99')][_0x4e4b('0xbd')]({'where':{'id':_0x1fb424[_0x4e4b('0xb4')]['id']}})[_0x4e4b('0x25')](handleEntityNotFound(_0x13ef9c,null))[_0x4e4b('0x25')](function(_0xd2e4a2){if(_0xd2e4a2){_0x475f14['model']=_[_0x4e4b('0x3e')](db[_0x4e4b('0xbe')][_0x4e4b('0x39')]);_0x475f14[_0x4e4b('0x3d')]=_[_0x4e4b('0x3e')](_0x1fb424['query']);_0x475f14['filters']=_['intersection'](_0x475f14[_0x4e4b('0x41')],_0x475f14['query']);_0x29a5a7[_0x4e4b('0x42')]=_[_0x4e4b('0x40')](_0x475f14[_0x4e4b('0x41')],qs[_0x4e4b('0x43')](_0x1fb424[_0x4e4b('0x3d')]['fields']));_0x29a5a7['attributes']=_0x29a5a7[_0x4e4b('0x42')][_0x4e4b('0x44')]?_0x29a5a7[_0x4e4b('0x42')]:_0x475f14[_0x4e4b('0x41')];if(!_0x1fb424[_0x4e4b('0x3d')]['hasOwnProperty'](_0x4e4b('0x45'))){_0x29a5a7[_0x4e4b('0x20')]=qs[_0x4e4b('0x20')](_0x1fb424['query']['limit']);_0x29a5a7['offset']=qs[_0x4e4b('0x1d')](_0x1fb424['query']['offset']);}_0x29a5a7[_0x4e4b('0x46')]=qs['sort'](_0x1fb424[_0x4e4b('0x3d')][_0x4e4b('0x47')]);_0x29a5a7[_0x4e4b('0x48')]=qs[_0x4e4b('0x3f')](_[_0x4e4b('0x49')](_0x1fb424[_0x4e4b('0x3d')],_0x475f14[_0x4e4b('0x3f')]));_0x29a5a7[_0x4e4b('0x48')]['OpenchannelInteractionId']=_0xd2e4a2['id'];if(_0x1fb424[_0x4e4b('0x3d')]['filter']){_0x29a5a7[_0x4e4b('0x48')]=_['merge'](_0x29a5a7['where'],{'$or':_[_0x4e4b('0x38')](_0x29a5a7['attributes'],function(_0x2c5dd9){var _0x1ba5ad={};_0x1ba5ad[_0x2c5dd9]={'$like':'%'+_0x1fb424[_0x4e4b('0x3d')][_0x4e4b('0x82')]+'%'};return _0x1ba5ad;})});}if(_0x1fb424[_0x4e4b('0x3d')]['$gte']){var _0xab42e4=_0x1fb424['query']['$gte']['split'](',');var _0x2fb868={};_0x2fb868[_0xab42e4[0x0]]={'$gte':moment(_0xab42e4[0x1])[_0x4e4b('0xbf')](_0x4e4b('0xc0'))};_0x29a5a7[_0x4e4b('0x48')]=_['merge'](_0x29a5a7[_0x4e4b('0x48')],_0x2fb868);}_0x29a5a7=_[_0x4e4b('0xb6')]({},_0x29a5a7,_0x1fb424[_0x4e4b('0xc1')]);return db[_0x4e4b('0xbe')]['count']({'where':_0x29a5a7['where']})[_0x4e4b('0x25')](function(_0x20d159){_0x1499a0[_0x4e4b('0x1f')]=_0x20d159;if(_0x1fb424[_0x4e4b('0x3d')][_0x4e4b('0xc2')]){_0x29a5a7['include']=[{'all':!![]}];}return db[_0x4e4b('0xbe')][_0x4e4b('0xc3')](_0x29a5a7);})['then'](function(_0x31e5b7){_0x1499a0[_0x4e4b('0xb1')]=_0x31e5b7;return _0x1499a0;});}})[_0x4e4b('0x25')](respondWithFilteredResult(_0x13ef9c,_0x29a5a7))['catch'](handleError(_0x13ef9c,null));};exports['addTags']=function(_0x8fb0eb,_0x9d1747,_0x36504a){return db[_0x4e4b('0x99')][_0x4e4b('0x62')]({'where':{'id':_0x8fb0eb[_0x4e4b('0xb4')]['id']}})[_0x4e4b('0x25')](handleEntityNotFound(_0x9d1747,null))[_0x4e4b('0x25')](function(_0x5317b3){if(_0x5317b3){return _0x5317b3['setTags'](_0x8fb0eb['body'][_0x4e4b('0xba')],_[_0x4e4b('0xbb')](_0x8fb0eb[_0x4e4b('0x75')],[_0x4e4b('0xba'),'id'])||{})['spread'](function(){return db[_0x4e4b('0x6d')][_0x4e4b('0xc3')]({'attributes':['id',_0x4e4b('0x28'),_0x4e4b('0x4b')],'where':{'id':_0x8fb0eb[_0x4e4b('0x75')]['ids']}});})[_0x4e4b('0x25')](function(_0x35f8c2){socket[_0x4e4b('0xc4')]('openchannelInteractionTags:save',{'id':Number(_0x8fb0eb['params']['id']),'tags':_0x35f8c2||[]});return{'id':Number(_0x8fb0eb[_0x4e4b('0xb4')]['id']),'tags':_0x35f8c2||[]};});}})[_0x4e4b('0x25')](respondWithResult(_0x9d1747,null))['catch'](handleError(_0x9d1747,null));};exports[_0x4e4b('0xc5')]=function(_0x40552c,_0x2295bf,_0x3a83bf){return db['OpenchannelInteraction'][_0x4e4b('0x62')]({'where':{'id':_0x40552c['params']['id']}})[_0x4e4b('0x25')](handleEntityNotFound(_0x2295bf,null))[_0x4e4b('0x25')](function(_0x375fd3){if(_0x375fd3){return _0x375fd3[_0x4e4b('0xc5')](_0x40552c[_0x4e4b('0x3d')][_0x4e4b('0xba')]);}})[_0x4e4b('0x25')](respondWithStatusCode(_0x2295bf,null))[_0x4e4b('0xb2')](handleError(_0x2295bf,null));};exports[_0x4e4b('0xc6')]=function(_0x102429,_0x443ef2){var _0x43aeb3=moment()[_0x4e4b('0xc7')]()[_0x4e4b('0x97')]();var _0x306b9d=path[_0x4e4b('0xc8')](config[_0x4e4b('0xc9')],'server',_0x4e4b('0xca'),_0x4e4b('0xcb'));var _0xe7504a=path[_0x4e4b('0xc8')](config[_0x4e4b('0xc9')],'server',_0x4e4b('0xca'),'attachments');var _0x5516f5=path[_0x4e4b('0xc8')](_0x306b9d,_0x43aeb3);var _0x13a604=util[_0x4e4b('0xbf')](_0x4e4b('0xcc'),_0x102429[_0x4e4b('0xb4')]['id'],_0x43aeb3);var _0x55d42a=path['join'](_0x306b9d,_0x13a604);var _0x3094ed=[];_0x3094ed[_0x4e4b('0x2f')]({'model':db[_0x4e4b('0xcd')],'as':_0x4e4b('0xcd'),'attributes':['id','fullname'],'raw':!![]});_0x3094ed[_0x4e4b('0x2f')]({'model':db['CmContact'],'as':_0x4e4b('0x65'),'attributes':['id',_0x4e4b('0xce'),_0x4e4b('0xcf')],'raw':!![]});if(_0x102429[_0x4e4b('0x3d')][_0x4e4b('0xd0')]){_0x3094ed[_0x4e4b('0x2f')]({'model':db[_0x4e4b('0xd1')],'as':_0x4e4b('0xd1'),'raw':!![]});}var _0x2a6983=[{'model':db['OpenchannelMessage'],'as':_0x4e4b('0xd2'),'attributes':['id',_0x4e4b('0x75'),_0x4e4b('0x79'),_0x4e4b('0xd3'),_0x4e4b('0xd4'),'read'],'include':_0x3094ed}];_0x2a6983[_0x4e4b('0x2f')]({'model':db[_0x4e4b('0xd5')],'as':_0x4e4b('0xd6'),'attributes':['id',_0x4e4b('0x28')]});_0x2a6983[_0x4e4b('0x2f')]({'model':db[_0x4e4b('0xcd')],'as':'Owner','attributes':['id',_0x4e4b('0x2b')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x102429['params']['id']},'include':_0x2a6983})[_0x4e4b('0x25')](handleEntityNotFound(_0x443ef2,null))['then'](function(_0x40b273){if(_0x40b273){var _0x11042f=_0x40b273[_0x4e4b('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x5516f5);var _0x21fdc4={'channel':'Openchannel','account':_0x11042f[_0x4e4b('0xd6')]['name'],'agent':_0x11042f[_0x4e4b('0xd8')]?_0x11042f[_0x4e4b('0xd8')][_0x4e4b('0x2b')]:'N.A.','createdAt':moment(_0x11042f[_0x4e4b('0x79')])[_0x4e4b('0xbf')](_0x4e4b('0xc0'))[_0x4e4b('0x97')](),'closedAt':_0x11042f[_0x4e4b('0x32')]?moment(_0x11042f['closedAt'])[_0x4e4b('0xbf')](_0x4e4b('0xc0'))[_0x4e4b('0x97')]():'','disposition':_0x11042f[_0x4e4b('0xd9')],'visibility':_0x11042f[_0x4e4b('0xda')]?_0x4e4b('0xdb'):_0x4e4b('0xdc'),'messages':_(_0x11042f[_0x4e4b('0xd2')])[_0x4e4b('0x82')]({'secret':![]})[_0x4e4b('0x38')](function(_0x185781){if(_0x185781[_0x4e4b('0xd1')]){var _0xc0a00d=path['join'](_0xe7504a,_0x185781[_0x4e4b('0xd1')]['basename']);if(fs['existsSync'](_0xc0a00d)){fs[_0x4e4b('0xdd')](_0xc0a00d)['pipe'](fs[_0x4e4b('0xde')](path['join'](_0x5516f5,_0x185781[_0x4e4b('0xd1')][_0x4e4b('0xdf')])));}}return{'date':moment(_0x185781['createdAt'])[_0x4e4b('0xbf')](_0x4e4b('0xc0'))['toString'](),'sender':_0x185781[_0x4e4b('0xd3')]===_0x4e4b('0xe0')?_0x185781[_0x4e4b('0xcd')]?_0x185781[_0x4e4b('0xcd')][_0x4e4b('0x2b')]:'System':_0x185781[_0x4e4b('0x65')]['firstName']+(_0x185781[_0x4e4b('0x65')][_0x4e4b('0xcf')]?'\x20'+_0x185781[_0x4e4b('0x65')]['lastName']:''),'body':_0x185781[_0x4e4b('0xd1')]?_0x185781[_0x4e4b('0xd1')][_0x4e4b('0xdf')]:_0x185781['body'],'direction':_0x185781[_0x4e4b('0xd3')]===_0x4e4b('0xe0')?'A':'C','secret':_0x185781[_0x4e4b('0xd4')],'read':_0x185781['read'],'attachment':_0x185781[_0x4e4b('0xd1')]};})[_0x4e4b('0x66')]()};return ejs[_0x4e4b('0xe1')](path[_0x4e4b('0xc8')](config[_0x4e4b('0xc9')],_0x4e4b('0xe2'),_0x4e4b('0xe3'),_0x4e4b('0xe4')),{'interaction':_0x21fdc4})['then'](function(_0x164c39){var _0x1e01af=path['join'](_0x5516f5,_0x4e4b('0xe5')+_0x11042f['id']+'-'+_0x43aeb3+_0x4e4b('0xe6'));var _0x316968={'path':_0x1e01af,'channel':'Openchannel','interactionId':_0x11042f['id']};return pdf[_0x4e4b('0xe7')](_0x164c39,_0x316968);})[_0x4e4b('0x25')](function(){return new BPromise(function(_0x25faa8,_0x37acad){zipdir(_0x5516f5,{'saveTo':_0x55d42a},function(_0x211e0c,_0xb0c567){if(_0x211e0c)return _0x37acad(_0x211e0c);return _0x25faa8(_0xb0c567);});})['then'](function(){return new BPromise(function(_0x513860,_0x2eba4b){rimraf(_0x5516f5,function(_0x4c384a){if(_0x4c384a)_0x2eba4b(_0x4c384a);return _0x513860();});});})[_0x4e4b('0x25')](function(){return _0x443ef2[_0x4e4b('0xc6')](_0x55d42a,_0x13a604,function(_0x135fef){if(_0x135fef){console[_0x4e4b('0xe8')](_0x4e4b('0xe9'),_0x135fef);}else{fs[_0x4e4b('0xea')](_0x55d42a);}});});});}else{return _0x443ef2['sendStatus'](0xc8);}})['catch'](handleError(_0x443ef2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index d2d3a8d..cc9f112 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 _0x1483=['length','emit','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','save','update','remove','then','setDataValue','map','findAll','unreadMessages'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1483,0x75));var _0x3148=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x1483[_0x5627e1];return _0x2f013f;};'use strict';var EventEmitter=require(_0x3148('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3148('0x1')];var OpenchannelMessage=require(_0x3148('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3148('0x3'),'afterUpdate':_0x3148('0x4'),'afterDestroy':_0x3148('0x5')};function emitEvent(_0x283ef3){return function(_0xb828ee,_0x11e003,_0x54535d){_0xb828ee['getUsers']({'attributes':['id'],'raw':!![]})[_0x3148('0x6')](function(_0x560fd4){_0xb828ee[_0x3148('0x7')]('Users',_0x560fd4[_0x3148('0x8')](function(_0x38b825){return{'id':_0x38b825['id']};}));return OpenchannelMessage[_0x3148('0x9')]({'where':{'OpenchannelInteractionId':_0xb828ee['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3148('0x6')](function(_0x3346df){_0xb828ee[_0x3148('0x7')](_0x3148('0xa'),_0x3346df[_0x3148('0xb')]);OpenchannelInteractionEvents[_0x3148('0xc')](_0x283ef3+':'+_0xb828ee['id'],_0xb828ee);OpenchannelInteractionEvents['emit'](_0x283ef3,_0xb828ee);_0x54535d(null);})['catch'](_0x54535d(null));};}for(var e in events){if(events[_0x3148('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x3148('0xe')](e,emitEvent(event));}}module[_0x3148('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x471d=['OpenchannelMessage','setMaxListeners','update','remove','then','setDataValue','map','findAll','unreadMessages','emit','catch','hook','../../mysqldb','OpenchannelInteraction'];(function(_0x47edd2,_0x2fb47e){var _0x39674f=function(_0x4bf4d4){while(--_0x4bf4d4){_0x47edd2['push'](_0x47edd2['shift']());}};_0x39674f(++_0x2fb47e);}(_0x471d,0xa6));var _0xd471=function(_0x42f402,_0x2155ac){_0x42f402=_0x42f402-0x0;var _0x3bf339=_0x471d[_0x42f402];return _0x3bf339;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xd471('0x0'))['db'][_0xd471('0x1')];var OpenchannelMessage=require(_0xd471('0x0'))['db'][_0xd471('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd471('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd471('0x4'),'afterDestroy':_0xd471('0x5')};function emitEvent(_0x2df3c3){return function(_0x4b8214,_0x116be6,_0x183191){_0x4b8214['getUsers']({'attributes':['id'],'raw':!![]})[_0xd471('0x6')](function(_0xd3d3d5){_0x4b8214[_0xd471('0x7')]('Users',_0xd3d3d5[_0xd471('0x8')](function(_0x5cb4e1){return{'id':_0x5cb4e1['id']};}));return OpenchannelMessage[_0xd471('0x9')]({'where':{'OpenchannelInteractionId':_0x4b8214['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd471('0x6')](function(_0x5448c3){_0x4b8214[_0xd471('0x7')](_0xd471('0xa'),_0x5448c3['length']);OpenchannelInteractionEvents[_0xd471('0xb')](_0x2df3c3+':'+_0x4b8214['id'],_0x4b8214);OpenchannelInteractionEvents['emit'](_0x2df3c3,_0x4b8214);_0x183191(null);})[_0xd471('0xc')](_0x183191(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xd471('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3d40904..59979ad 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 _0x8e7c=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x134130,_0x530c05){var _0x3675c7=function(_0x591244){while(--_0x591244){_0x134130['push'](_0x134130['shift']());}};_0x3675c7(++_0x530c05);}(_0x8e7c,0x90));var _0xc8e7=function(_0xcde2ee,_0x4d32cc){_0xcde2ee=_0xcde2ee-0x0;var _0x6eb7b2=_0x8e7c[_0xcde2ee];return _0x6eb7b2;};'use strict';var _=require(_0xc8e7('0x0'));var util=require(_0xc8e7('0x1'));var logger=require(_0xc8e7('0x2'))(_0xc8e7('0x3'));var moment=require(_0xc8e7('0x4'));var BPromise=require(_0xc8e7('0x5'));var rp=require(_0xc8e7('0x6'));var fs=require('fs');var path=require(_0xc8e7('0x7'));var rimraf=require('rimraf');var config=require(_0xc8e7('0x8'));var attributes=require(_0xc8e7('0x9'));module[_0xc8e7('0xa')]=function(_0xd50521,_0x497ee6){return _0xd50521[_0xc8e7('0xb')](_0xc8e7('0xc'),attributes,{'tableName':_0xc8e7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8e7('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x138231,_0x77e25b,_0x428989){if(_0x138231['changed'](_0xc8e7('0xf'))){_0x138231[_0xc8e7('0x10')]=moment()[_0xc8e7('0x11')](_0xc8e7('0x12'));}_0x428989(null,_0x138231);}}});}; \ No newline at end of file +var _0x131b=['define','OpenchannelInteraction','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x577210,_0x102b03){var _0x52cd98=function(_0x41f9c1){while(--_0x41f9c1){_0x577210['push'](_0x577210['shift']());}};_0x52cd98(++_0x102b03);}(_0x131b,0x1c2));var _0xb131=function(_0x5d4e83,_0x23c49e){_0x5d4e83=_0x5d4e83-0x0;var _0x503b36=_0x131b[_0x5d4e83];return _0x503b36;};'use strict';var _=require(_0xb131('0x0'));var util=require(_0xb131('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb131('0x2'));var rp=require(_0xb131('0x3'));var fs=require('fs');var path=require(_0xb131('0x4'));var rimraf=require(_0xb131('0x5'));var config=require(_0xb131('0x6'));var attributes=require(_0xb131('0x7'));module[_0xb131('0x8')]=function(_0x4b53a7,_0x42f49c){return _0x4b53a7[_0xb131('0x9')](_0xb131('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb131('0xb'),'hooks':{'beforeUpdate':function(_0x84b2fb,_0x596505,_0xc11c4c){if(_0x84b2fb[_0xb131('0xc')](_0xb131('0xd'))){_0x84b2fb[_0xb131('0xe')]=moment()[_0xb131('0xf')](_0xb131('0x10'));}_0xc11c4c(null,_0x84b2fb);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 8a1c2bc..bbbb64c 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 _0xe2fe=['moment','randomstring','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','OpenchannelInteraction','update','options','raw','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','where','addTags','body','ids','omit','spread','AddTags','util'];(function(_0x3924bf,_0x1b8ade){var _0x6c3640=function(_0x44328c){while(--_0x44328c){_0x3924bf['push'](_0x3924bf['shift']());}};_0x6c3640(++_0x1b8ade);}(_0xe2fe,0x18f));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xee2f('0x0'));var moment=require(_0xee2f('0x1'));var BPromise=require('bluebird');var rs=require(_0xee2f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee2f('0x3'));var config=require(_0xee2f('0x4'));var jayson=require(_0xee2f('0x5'));var client=jayson[_0xee2f('0x6')][_0xee2f('0x7')]({'port':0x232a});config[_0xee2f('0x8')]=_['defaults'](config['redis'],{'host':_0xee2f('0x9'),'port':0x18eb});var socket=require(_0xee2f('0xa'))(new Redis(config[_0xee2f('0x8')]));require(_0xee2f('0xb'))[_0xee2f('0xc')](socket);function respondWithRpcPromise(_0x1a7689,_0x46bfed,_0x25818c){return new BPromise(function(_0x5d0c9c,_0x1feda9){return client[_0xee2f('0xd')](_0x1a7689,_0x25818c)[_0xee2f('0xe')](function(_0x5d16e6){logger[_0xee2f('0xf')](_0xee2f('0x10'),_0x46bfed,'request\x20sent');logger[_0xee2f('0x11')](_0xee2f('0x12'),_0x46bfed,'request\x20sent',JSON[_0xee2f('0x13')](_0x5d16e6));if(_0x5d16e6[_0xee2f('0x14')]){if(_0x5d16e6['error'][_0xee2f('0x15')]===0x1f4){logger[_0xee2f('0x14')](_0xee2f('0x10'),_0x46bfed,_0x5d16e6[_0xee2f('0x14')][_0xee2f('0x16')]);return _0x1feda9(_0x5d16e6[_0xee2f('0x14')][_0xee2f('0x16')]);}logger['error'](_0xee2f('0x10'),_0x46bfed,_0x5d16e6['error'][_0xee2f('0x16')]);return _0x5d0c9c(_0x5d16e6['error']['message']);}else{logger['info'](_0xee2f('0x10'),_0x46bfed,_0xee2f('0x17'));_0x5d0c9c(_0x5d16e6[_0xee2f('0x18')][_0xee2f('0x16')]);}})[_0xee2f('0x19')](function(_0x151e43){logger['error'](_0xee2f('0x10'),_0x46bfed,_0x151e43);_0x1feda9(_0x151e43);});});}exports['UpdateOpenchannelInteraction']=function(_0x321b67){var _0x582d50=this;return new Promise(function(_0x41c599,_0xd31c8c){return db[_0xee2f('0x1a')][_0xee2f('0x1b')](_0x321b67['body'],{'raw':_0x321b67[_0xee2f('0x1c')]?_0x321b67[_0xee2f('0x1c')][_0xee2f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321b67[_0xee2f('0x1c')]?_0x321b67['options']['where']||null:null,'attributes':_0x321b67[_0xee2f('0x1c')]?_0x321b67['options']['attributes']||null:null,'limit':_0x321b67[_0xee2f('0x1c')]?_0x321b67[_0xee2f('0x1c')]['limit']||null:null})[_0xee2f('0xe')](function(_0x2ff4ec){logger['info'](_0xee2f('0x1e'),_0x321b67);logger[_0xee2f('0x11')](_0xee2f('0x1e'),_0x321b67,JSON[_0xee2f('0x13')](_0x2ff4ec));_0x41c599(_0x2ff4ec);})[_0xee2f('0x19')](function(_0x5dd5e7){logger['error'](_0xee2f('0x1e'),_0x5dd5e7[_0xee2f('0x16')],_0x321b67);_0xd31c8c(_0x582d50[_0xee2f('0x14')](0x1f4,_0x5dd5e7[_0xee2f('0x16')]));});});};exports[_0xee2f('0x1f')]=function(_0x3ee065){return new Promise(function(_0x22587f,_0x41886b){return db[_0xee2f('0x1a')][_0xee2f('0x20')]({'where':_0x3ee065['options']?_0x3ee065[_0xee2f('0x1c')][_0xee2f('0x21')]||null:null})[_0xee2f('0xe')](function(_0x587042){if(_0x587042){return _0x587042[_0xee2f('0x22')](_0x3ee065[_0xee2f('0x23')][_0xee2f('0x24')],_[_0xee2f('0x25')](_0x3ee065[_0xee2f('0x23')],[_0xee2f('0x24'),'id'])||{});}})[_0xee2f('0x26')](function(_0x5a1220){logger[_0xee2f('0xf')](_0xee2f('0x27'),_0x3ee065);logger[_0xee2f('0x11')](_0xee2f('0x27'),_0x3ee065,JSON[_0xee2f('0x13')](_0x5a1220));_0x22587f(_0x5a1220);})[_0xee2f('0x19')](function(_0x4ffd26){logger[_0xee2f('0x14')]('AddTags',_0x4ffd26['message'],_0x3ee065);_0x41886b(_this[_0xee2f('0x14')](0x1f4,_0x4ffd26['message']));});});}; \ No newline at end of file +var _0x882b=['defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis'];(function(_0x21ac14,_0x3c9049){var _0x4491ba=function(_0x3e059c){while(--_0x3e059c){_0x21ac14['push'](_0x21ac14['shift']());}};_0x4491ba(++_0x3c9049);}(_0x882b,0x1d6));var _0xb882=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x882b[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xb882('0x0'));var util=require(_0xb882('0x1'));var moment=require('moment');var BPromise=require(_0xb882('0x2'));var rs=require(_0xb882('0x3'));var fs=require('fs');var Redis=require(_0xb882('0x4'));var db=require(_0xb882('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb882('0x6'))(_0xb882('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb882('0x8')]({'port':0x232a});config[_0xb882('0x9')]=_[_0xb882('0xa')](config['redis'],{'host':_0xb882('0xb'),'port':0x18eb});var socket=require(_0xb882('0xc'))(new Redis(config[_0xb882('0x9')]));require('./openchannelInteraction.socket')[_0xb882('0xd')](socket);function respondWithRpcPromise(_0x3f0688,_0x302364,_0x340145){return new BPromise(function(_0x50fb03,_0x31acc5){return client[_0xb882('0xe')](_0x3f0688,_0x340145)[_0xb882('0xf')](function(_0x18aa0d){logger[_0xb882('0x10')](_0xb882('0x11'),_0x302364,_0xb882('0x12'));logger[_0xb882('0x13')](_0xb882('0x14'),_0x302364,_0xb882('0x12'),JSON[_0xb882('0x15')](_0x18aa0d));if(_0x18aa0d[_0xb882('0x16')]){if(_0x18aa0d[_0xb882('0x16')][_0xb882('0x17')]===0x1f4){logger[_0xb882('0x16')](_0xb882('0x11'),_0x302364,_0x18aa0d['error'][_0xb882('0x18')]);return _0x31acc5(_0x18aa0d[_0xb882('0x16')]['message']);}logger[_0xb882('0x16')](_0xb882('0x11'),_0x302364,_0x18aa0d[_0xb882('0x16')][_0xb882('0x18')]);return _0x50fb03(_0x18aa0d[_0xb882('0x16')][_0xb882('0x18')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x302364,_0xb882('0x12'));_0x50fb03(_0x18aa0d[_0xb882('0x19')][_0xb882('0x18')]);}})[_0xb882('0x1a')](function(_0x1c08ae){logger[_0xb882('0x16')](_0xb882('0x11'),_0x302364,_0x1c08ae);_0x31acc5(_0x1c08ae);});});}exports[_0xb882('0x1b')]=function(_0x250b33){var _0xd36a94=this;return new Promise(function(_0x231ca8,_0x206a4f){return db[_0xb882('0x1c')][_0xb882('0x1d')](_0x250b33[_0xb882('0x1e')],{'raw':_0x250b33[_0xb882('0x1f')]?_0x250b33['options'][_0xb882('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250b33[_0xb882('0x1f')]?_0x250b33[_0xb882('0x1f')][_0xb882('0x21')]||null:null,'attributes':_0x250b33[_0xb882('0x1f')]?_0x250b33['options']['attributes']||null:null,'limit':_0x250b33[_0xb882('0x1f')]?_0x250b33['options'][_0xb882('0x22')]||null:null})['then'](function(_0x5b7f9a){logger[_0xb882('0x10')](_0xb882('0x1b'),_0x250b33);logger['debug'](_0xb882('0x1b'),_0x250b33,JSON['stringify'](_0x5b7f9a));_0x231ca8(_0x5b7f9a);})['catch'](function(_0x172d57){logger['error']('UpdateOpenchannelInteraction',_0x172d57[_0xb882('0x18')],_0x250b33);_0x206a4f(_0xd36a94[_0xb882('0x16')](0x1f4,_0x172d57['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x55be81){return new Promise(function(_0x330f63,_0x210add){return db[_0xb882('0x1c')][_0xb882('0x23')]({'where':_0x55be81['options']?_0x55be81['options'][_0xb882('0x21')]||null:null})[_0xb882('0xf')](function(_0x5030c3){if(_0x5030c3){return _0x5030c3[_0xb882('0x24')](_0x55be81[_0xb882('0x1e')][_0xb882('0x25')],_['omit'](_0x55be81[_0xb882('0x1e')],['ids','id'])||{});}})[_0xb882('0x26')](function(_0x2ca870){logger['info'](_0xb882('0x27'),_0x55be81);logger[_0xb882('0x13')](_0xb882('0x27'),_0x55be81,JSON[_0xb882('0x15')](_0x2ca870));_0x330f63(_0x2ca870);})[_0xb882('0x1a')](function(_0x31716c){logger[_0xb882('0x16')]('AddTags',_0x31716c[_0xb882('0x18')],_0x55be81);_0x210add(_this[_0xb882('0x16')](0x1f4,_0x31716c[_0xb882('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 56d4052..c0b1009 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 _0xef73=['remove','update','emit','removeListener','register','length','./openchannelInteraction.events','save'];(function(_0x4399bf,_0x15fe23){var _0xb031f7=function(_0x11b592){while(--_0x11b592){_0x4399bf['push'](_0x4399bf['shift']());}};_0xb031f7(++_0x15fe23);}(_0xef73,0x18e));var _0x3ef7=function(_0x2706da,_0x3856f5){_0x2706da=_0x2706da-0x0;var _0x3ba87e=_0xef73[_0x2706da];return _0x3ba87e;};'use strict';var OpenchannelInteractionEvents=require(_0x3ef7('0x0'));var events=[_0x3ef7('0x1'),_0x3ef7('0x2'),_0x3ef7('0x3')];function createListener(_0x2ddfe8,_0x22f8bb){return function(_0x13656e){_0x22f8bb[_0x3ef7('0x4')](_0x2ddfe8,_0x13656e);};}function removeListener(_0x161b18,_0xaa80c7){return function(){OpenchannelInteractionEvents[_0x3ef7('0x5')](_0x161b18,_0xaa80c7);};}exports[_0x3ef7('0x6')]=function(_0x497b7b){for(var _0x5e00d7=0x0,_0x36d7e0=events[_0x3ef7('0x7')];_0x5e00d7<_0x36d7e0;_0x5e00d7++){var _0x4b963b=events[_0x5e00d7];var _0x2c183d=createListener('openchannelInteraction:'+_0x4b963b,_0x497b7b);OpenchannelInteractionEvents['on'](_0x4b963b,_0x2c183d);}}; \ No newline at end of file +var _0x7553=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','update','emit'];(function(_0x4516dc,_0x360809){var _0x20c35d=function(_0x2443da){while(--_0x2443da){_0x4516dc['push'](_0x4516dc['shift']());}};_0x20c35d(++_0x360809);}(_0x7553,0xa4));var _0x3755=function(_0x7eee7,_0x3779a1){_0x7eee7=_0x7eee7-0x0;var _0x469f62=_0x7553[_0x7eee7];return _0x469f62;};'use strict';var OpenchannelInteractionEvents=require(_0x3755('0x0'));var events=[_0x3755('0x1'),'remove',_0x3755('0x2')];function createListener(_0x59feab,_0xff914e){return function(_0x17332b){_0xff914e[_0x3755('0x3')](_0x59feab,_0x17332b);};}function removeListener(_0x19990d,_0x1dfce3){return function(){OpenchannelInteractionEvents[_0x3755('0x4')](_0x19990d,_0x1dfce3);};}exports[_0x3755('0x5')]=function(_0x45525c){for(var _0x215a32=0x0,_0x40dcb8=events[_0x3755('0x6')];_0x215a32<_0x40dcb8;_0x215a32++){var _0x9c5527=events[_0x215a32];var _0xe1db65=createListener(_0x3755('0x7')+_0x9c5527,_0x45525c);OpenchannelInteractionEvents['on'](_0x9c5527,_0xe1db65);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 25fc24e..45fb3ce 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(_0x11948e,_0x54dae6){var _0x4f2d84=function(_0x2b4200){while(--_0x2b4200){_0x11948e['push'](_0x11948e['shift']());}};_0x4f2d84(++_0x54dae6);}(_0xe706,0xa3));var _0x6e70=function(_0x438e18,_0x52e2c5){_0x438e18=_0x438e18-0x0;var _0x50c6ea=_0xe706[_0x438e18];return _0x50c6ea;};'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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x5e200d,_0x2dba61){_0x5e200d=_0x5e200d-0x0;var _0x5e6fba=_0x70e0[_0x5e200d];return _0x5e6fba;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7b8fb82..8838b60 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 _0xc901=['sequelize','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x40716d,_0x38206c){var _0xb9fbb3=function(_0x3dae3a){while(--_0x3dae3a){_0x40716d['push'](_0x40716d['shift']());}};_0xb9fbb3(++_0x38206c);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1c90('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1c90('0x2')]('in','out'),'defaultValue':_0x1c90('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1c90('0x4')]},'providerName':{'type':Sequelize[_0x1c90('0x5')]},'providerResponse':{'type':Sequelize[_0x1c90('0x6')]}}; \ No newline at end of file +var _0x58a4=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4b999a,_0x3eb57c){var _0x391a3d=function(_0x75b1c9){while(--_0x75b1c9){_0x4b999a['push'](_0x4b999a['shift']());}};_0x391a3d(++_0x3eb57c);}(_0x58a4,0xbf));var _0x458a=function(_0x321d0f,_0xc41539){_0x321d0f=_0x321d0f-0x0;var _0xbe7682=_0x58a4[_0x321d0f];return _0xbe7682;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'body':{'type':Sequelize[_0x458a('0x2')](_0x458a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x458a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x458a('0x5')]('in',_0x458a('0x6')),'defaultValue':_0x458a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x458a('0x7')]},'providerName':{'type':Sequelize[_0x458a('0x8')]},'providerResponse':{'type':Sequelize[_0x458a('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b284bb4..9bb3e39 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 _0x724d=['message','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','null','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','agent','interaction','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','rejectmessage','eml-format','rimraf','zip-dir','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/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x34186e,_0x2e00a0){var _0x26c672=function(_0x3edd00){while(--_0x3edd00){_0x34186e['push'](_0x34186e['shift']());}};_0x26c672(++_0x2e00a0);}(_0x724d,0xe5));var _0xd724=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x724d[_0x2fff83];return _0xa2a722;};'use strict';var emlformat=require(_0xd724('0x0'));var rimraf=require(_0xd724('0x1'));var zipdir=require(_0xd724('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd724('0x3'));var moment=require(_0xd724('0x4'));var BPromise=require(_0xd724('0x5'));var Mustache=require(_0xd724('0x6'));var util=require(_0xd724('0x7'));var path=require(_0xd724('0x8'));var sox=require(_0xd724('0x9'));var csv=require(_0xd724('0xa'));var ejs=require(_0xd724('0xb'));var fs=require('fs');var fs_extra=require(_0xd724('0xc'));var _=require(_0xd724('0xd'));var squel=require(_0xd724('0xe'));var crypto=require(_0xd724('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd724('0x10'));var toCsv=require(_0xd724('0xa'));var querystring=require(_0xd724('0x11'));var Papa=require(_0xd724('0x12'));var Redis=require(_0xd724('0x13'));var authService=require(_0xd724('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd724('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd724('0x16'));var utils=require(_0xd724('0x17'));var config=require(_0xd724('0x18'));var licenseUtil=require(_0xd724('0x19'));var db=require(_0xd724('0x1a'))['db'];config[_0xd724('0x1b')]=_[_0xd724('0x1c')](config[_0xd724('0x1b')],{'host':_0xd724('0x1d'),'port':0x18eb});var socket=require(_0xd724('0x1e'))(new Redis(config[_0xd724('0x1b')]));require(_0xd724('0x1f'))[_0xd724('0x20')](socket);var jayson=require(_0xd724('0x21'));var client=jayson[_0xd724('0x22')][_0xd724('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xd724('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x29f82c,_0x394ffc,_0xef42aa,_0xf3eea4){return new BPromise(function(_0x23280,_0x2b3959){var _0x4572a9=_0xf3eea4||client;return _0x4572a9[_0xd724('0x24')](_0x29f82c,_0xef42aa)[_0xd724('0x25')](function(_0x1361c2){logger[_0xd724('0x26')](_0xd724('0x27'),_0x394ffc,_0xd724('0x28'));logger[_0xd724('0x29')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x394ffc,'request\x20sent',JSON[_0xd724('0x2a')](_0x1361c2));if(_0x1361c2[_0xd724('0x2b')]){if(_0x1361c2[_0xd724('0x2b')][_0xd724('0x2c')]===0x1f4){logger[_0xd724('0x2b')](_0xd724('0x27'),_0x394ffc,_0x1361c2[_0xd724('0x2b')][_0xd724('0x2d')]);return _0x2b3959(_0x1361c2[_0xd724('0x2b')][_0xd724('0x2d')]);}logger[_0xd724('0x2b')](_0xd724('0x27'),_0x394ffc,_0x1361c2[_0xd724('0x2b')]['message']);return _0x23280(_0x1361c2[_0xd724('0x2b')]['message']);}else{logger[_0xd724('0x26')](_0xd724('0x27'),_0x394ffc,'request\x20sent');_0x23280(_0x1361c2[_0xd724('0x2e')][_0xd724('0x2d')]);}})['catch'](function(_0x2af376){logger[_0xd724('0x2b')](_0xd724('0x27'),_0x394ffc,_0x2af376);_0x2b3959(_0x2af376);});});}function respondWithStatusCode(_0x307928,_0x18e4de){_0x18e4de=_0x18e4de||0xcc;return function(_0x450abe){if(_0x450abe){return _0x307928[_0xd724('0x2f')](_0x18e4de);}return _0x307928['status'](_0x18e4de)[_0xd724('0x30')]();};}function respondWithResult(_0x40ee07,_0x1bd735){_0x1bd735=_0x1bd735||0xc8;return function(_0x3884a4){if(_0x3884a4){return _0x40ee07[_0xd724('0x31')](_0x1bd735)[_0xd724('0x32')](_0x3884a4);}};}function respondWithFilteredResult(_0x26b09a,_0x58ef99){return function(_0x27a34e){if(_0x27a34e){var _0x244b2f=typeof _0x58ef99[_0xd724('0x33')]==='undefined'&&typeof _0x58ef99[_0xd724('0x34')]===_0xd724('0x35');var _0x1ccb4b=_0x27a34e[_0xd724('0x36')];var _0x398d77=_0x244b2f?0x0:_0x58ef99[_0xd724('0x33')];var _0x40f4e4=_0x244b2f?_0x27a34e['count']:_0x58ef99[_0xd724('0x33')]+_0x58ef99[_0xd724('0x34')];var _0x2c9aa9;if(_0x40f4e4>=_0x1ccb4b){_0x40f4e4=_0x1ccb4b;_0x2c9aa9=0xc8;}else{_0x2c9aa9=0xce;}_0x26b09a['status'](_0x2c9aa9);return _0x26b09a[_0xd724('0x37')](_0xd724('0x38'),_0x398d77+'-'+_0x40f4e4+'/'+_0x1ccb4b)['json'](_0x27a34e);}return null;};}function patchUpdates(_0x4fcc7d){return function(_0x233e8f){try{jsonpatch[_0xd724('0x39')](_0x233e8f,_0x4fcc7d,!![]);}catch(_0xa9cc99){return BPromise[_0xd724('0x3a')](_0xa9cc99);}return _0x233e8f['save']();};}function saveUpdates(_0x9c5102,_0x55d642){return function(_0x12f9dc){if(_0x12f9dc){return _0x12f9dc[_0xd724('0x3b')](_0x9c5102)[_0xd724('0x25')](function(_0x20b750){return _0x20b750;});}return null;};}function removeEntity(_0x21a61a,_0x2d9bd1){return function(_0x493b80){if(_0x493b80){return _0x493b80['destroy']()[_0xd724('0x25')](function(){_0x21a61a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cd18b,_0x376d36){return function(_0x3f1e06){if(!_0x3f1e06){_0x4cd18b[_0xd724('0x2f')](0x194);}return _0x3f1e06;};}function handleError(_0x3bd0ac,_0xf690b7){_0xf690b7=_0xf690b7||0x1f4;return function(_0x5ac8e8){logger[_0xd724('0x2b')](_0x5ac8e8[_0xd724('0x3c')]);if(_0x5ac8e8['name']){delete _0x5ac8e8[_0xd724('0x3d')];}_0x3bd0ac[_0xd724('0x31')](_0xf690b7)[_0xd724('0x3e')](_0x5ac8e8);};}exports[_0xd724('0x3f')]=function(_0x152a05,_0x33cad4){var _0x2c171e={},_0x246faa={},_0x4adf1e={'count':0x0,'rows':[]};var _0x4fe458=_[_0xd724('0x40')](db[_0xd724('0x41')][_0xd724('0x42')],function(_0x17c945){return{'name':_0x17c945[_0xd724('0x43')],'type':_0x17c945[_0xd724('0x44')][_0xd724('0x45')]};});_0x246faa['model']=_[_0xd724('0x40')](_0x4fe458,_0xd724('0x3d'));_0x246faa[_0xd724('0x46')]=_[_0xd724('0x47')](_0x152a05['query']);_0x246faa[_0xd724('0x48')]=_[_0xd724('0x49')](_0x246faa[_0xd724('0x4a')],_0x246faa[_0xd724('0x46')]);_0x2c171e[_0xd724('0x4b')]=_[_0xd724('0x49')](_0x246faa['model'],qs['fields'](_0x152a05[_0xd724('0x46')][_0xd724('0x4c')]));_0x2c171e[_0xd724('0x4b')]=_0x2c171e['attributes']['length']?_0x2c171e['attributes']:_0x246faa[_0xd724('0x4a')];if(!_0x152a05['query'][_0xd724('0x4d')](_0xd724('0x4e'))){_0x2c171e['limit']=qs['limit'](_0x152a05[_0xd724('0x46')][_0xd724('0x34')]);_0x2c171e[_0xd724('0x33')]=qs['offset'](_0x152a05[_0xd724('0x46')]['offset']);}_0x2c171e[_0xd724('0x4f')]=qs[_0xd724('0x50')](_0x152a05[_0xd724('0x46')][_0xd724('0x50')]);_0x2c171e[_0xd724('0x51')]=qs[_0xd724('0x48')](_[_0xd724('0x52')](_0x152a05[_0xd724('0x46')],_0x246faa[_0xd724('0x48')]),_0x4fe458);if(_0x152a05[_0xd724('0x46')][_0xd724('0x53')]){_0x2c171e[_0xd724('0x51')]=_[_0xd724('0x54')](_0x2c171e[_0xd724('0x51')],{'$or':_['map'](_0x4fe458,function(_0x5bae3b){if(_0x5bae3b[_0xd724('0x44')]!=='VIRTUAL'){var _0x1c31f9={};_0x1c31f9[_0x5bae3b['name']]={'$like':'%'+_0x152a05[_0xd724('0x46')]['filter']+'%'};return _0x1c31f9;}})});}_0x2c171e=_['merge']({},_0x2c171e,_0x152a05[_0xd724('0x55')]);var _0xce8e71={'where':_0x2c171e['where']};return db[_0xd724('0x41')][_0xd724('0x36')](_0xce8e71)[_0xd724('0x25')](function(_0x4f3299){_0x4adf1e[_0xd724('0x36')]=_0x4f3299;if(_0x152a05[_0xd724('0x46')][_0xd724('0x56')]){_0x2c171e[_0xd724('0x57')]=[{'all':!![]}];}return db[_0xd724('0x41')][_0xd724('0x58')](_0x2c171e);})[_0xd724('0x25')](function(_0x32b3e8){_0x4adf1e[_0xd724('0x59')]=_0x32b3e8;return _0x4adf1e;})[_0xd724('0x25')](respondWithFilteredResult(_0x33cad4,_0x2c171e))[_0xd724('0x5a')](handleError(_0x33cad4,null));};exports[_0xd724('0x5b')]=function(_0x11dcfb,_0x1464b7){var _0x2754d2={'raw':!![],'where':{'id':_0x11dcfb[_0xd724('0x5c')]['id']}},_0x54f36c={};_0x54f36c[_0xd724('0x4a')]=_['keys'](db[_0xd724('0x41')][_0xd724('0x42')]);_0x54f36c[_0xd724('0x46')]=_[_0xd724('0x47')](_0x11dcfb[_0xd724('0x46')]);_0x54f36c[_0xd724('0x48')]=_[_0xd724('0x49')](_0x54f36c[_0xd724('0x4a')],_0x54f36c[_0xd724('0x46')]);_0x2754d2[_0xd724('0x4b')]=_[_0xd724('0x49')](_0x54f36c[_0xd724('0x4a')],qs[_0xd724('0x4c')](_0x11dcfb[_0xd724('0x46')][_0xd724('0x4c')]));_0x2754d2[_0xd724('0x4b')]=_0x2754d2['attributes'][_0xd724('0x5d')]?_0x2754d2[_0xd724('0x4b')]:_0x54f36c[_0xd724('0x4a')];if(_0x11dcfb['query'][_0xd724('0x56')]){_0x2754d2['include']=[{'all':!![]}];}_0x2754d2=_[_0xd724('0x54')]({},_0x2754d2,_0x11dcfb[_0xd724('0x55')]);return db[_0xd724('0x41')][_0xd724('0x5e')](_0x2754d2)[_0xd724('0x25')](handleEntityNotFound(_0x1464b7,null))[_0xd724('0x25')](respondWithResult(_0x1464b7,null))[_0xd724('0x5a')](handleError(_0x1464b7,null));};exports[_0xd724('0x5f')]=function(_0x58de2f,_0x46944f){return db[_0xd724('0x41')][_0xd724('0x5f')](_0x58de2f[_0xd724('0x60')],{})[_0xd724('0x25')](respondWithResult(_0x46944f,0xc9))['catch'](handleError(_0x46944f,null));};exports['update']=function(_0x3a47dd,_0x5384b6){if(_0x3a47dd[_0xd724('0x60')]['id']){delete _0x3a47dd[_0xd724('0x60')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x3a47dd[_0xd724('0x5c')]['id']}})[_0xd724('0x25')](handleEntityNotFound(_0x5384b6,null))[_0xd724('0x25')](saveUpdates(_0x3a47dd[_0xd724('0x60')],null))[_0xd724('0x25')](respondWithResult(_0x5384b6,null))[_0xd724('0x5a')](handleError(_0x5384b6,null));};exports[_0xd724('0x61')]=function(_0x2a014d,_0xcba319){return db[_0xd724('0x41')][_0xd724('0x5e')]({'where':{'id':_0x2a014d['params']['id']}})[_0xd724('0x25')](handleEntityNotFound(_0xcba319,null))[_0xd724('0x25')](removeEntity(_0xcba319,null))['catch'](handleError(_0xcba319,null));};exports[_0xd724('0x62')]=function(_0x1f1bed,_0x1311ec){return db[_0xd724('0x41')][_0xd724('0x62')]()[_0xd724('0x25')](respondWithResult(_0x1311ec,null))[_0xd724('0x5a')](handleError(_0x1311ec,null));};var interaction_log=require(_0xd724('0x63'))(_0xd724('0x64'));exports[_0xd724('0x65')]=function(_0x23d2e9,_0x58865b,_0x325d85){var _0x46888a={'agent':{},'channel':_0xd724('0x66')};if(_0x23d2e9[_0xd724('0x60')]['id']){delete _0x23d2e9[_0xd724('0x60')]['id'];}_0x23d2e9[_0xd724('0x60')][_0xd724('0x67')]=!![];_0x23d2e9[_0xd724('0x60')][_0xd724('0x68')]=moment()[_0xd724('0x69')](_0xd724('0x6a'));_0x23d2e9[_0xd724('0x60')]['UserId']=_0x23d2e9[_0xd724('0x60')][_0xd724('0x6b')]||_0x23d2e9[_0xd724('0x6c')]['id'];_0x46888a['agent']['id']=_0x23d2e9[_0xd724('0x60')]['UserId'];return db[_0xd724('0x41')][_0xd724('0x5e')]({'where':{'id':_0x23d2e9[_0xd724('0x5c')]['id'],'UserId':null}})[_0xd724('0x25')](handleEntityNotFound(_0x58865b,null))['then'](saveUpdates(_0x23d2e9[_0xd724('0x60')],null))[_0xd724('0x25')](function(_0xc335cd){if(_0xc335cd){_0x46888a['message']=_0xc335cd[_0xd724('0x6d')]({'plain':!![]});return db[_0xd724('0x6e')][_0xd724('0x5e')]({'where':{'id':_0xc335cd[_0xd724('0x6f')]}});}return null;})[_0xd724('0x25')](handleEntityNotFound(_0x58865b,null))['then'](function(_0x446058){if(_0x446058){return _0x446058['update']({'UserId':_0x23d2e9[_0xd724('0x60')][_0xd724('0x6b')],'read1stAt':_[_0xd724('0x70')](_0x446058[_0xd724('0x71')])?moment()[_0xd724('0x69')](_0xd724('0x6a')):undefined});}return null;})[_0xd724('0x25')](function(_0x2e17b3){if(_0x2e17b3){_0x46888a['interaction']=_0x2e17b3[_0xd724('0x6d')]({'plain':!![]});interaction_log[_0xd724('0x26')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x23d2e9[_0xd724('0x6c')]['id'],_0x23d2e9[_0xd724('0x6c')][_0xd724('0x3d')],_0x23d2e9[_0xd724('0x6c')]['role'],_0x46888a['interaction']['id'],_0x23d2e9[_0xd724('0x60')]?JSON[_0xd724('0x2a')](_0x23d2e9[_0xd724('0x60')]):_0xd724('0x72'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x46888a);}return null;})['then'](function(_0x589351){var _0x132654='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x589351[_0xd724('0x2d')][_0xd724('0x73')];return db[_0xd724('0x74')]['query'](_0x132654,{'type':db['Sequelize'][_0xd724('0x75')][_0xd724('0x76')],'raw':!![]})['then'](function(_0x9ef09){return _0x9ef09;});})[_0xd724('0x25')](function(_0x4cca2d){if(_0x4cca2d){_0x46888a[_0xd724('0x2d')][_0xd724('0x77')]=_0x4cca2d[0x0];if(!_0x23d2e9[_0xd724('0x60')][_0xd724('0x6b')])return;return db[_0xd724('0x78')][_0xd724('0x5e')]({'where':{'id':_0x23d2e9[_0xd724('0x60')][_0xd724('0x6b')],'role':'agent'},'attributes':['id',_0xd724('0x3d'),_0xd724('0x79'),'email',_0xd724('0x7a')],'raw':!![]});}return null;})[_0xd724('0x25')](function(_0x14bd60){if(!_0x14bd60)return null;_0x46888a[_0xd724('0x2d')]['agent']=_0x14bd60;return _0x46888a;})[_0xd724('0x25')](function(_0x36a3a9){if(_0x36a3a9){if(_0x23d2e9[_0xd724('0x60')][_0xd724('0x7b')]){_0x46888a[_0xd724('0x2d')][_0xd724('0x7c')]=util[_0xd724('0x69')](_0xd724('0x7d'),_0x23d2e9[_0xd724('0x6c')][_0xd724('0x3d')]);_0x46888a[_0xd724('0x2d')]['channel']=_0x46888a[_0xd724('0x7e')];_0x46888a[_0xd724('0x2d')][_0xd724('0x7f')]=_0x46888a[_0xd724('0x7e')];_0x46888a[_0xd724('0x2d')]['event']='accept';return respondWithRpcPromise(_0xd724('0x80'),'EventManager',{'event':_0xd724('0x81'),'message':_0x46888a[_0xd724('0x2d')]},client9002)[_0xd724('0x25')](function(){return _0x46888a;});}return _0x46888a;}return null;})[_0xd724('0x25')](respondWithResult(_0x58865b,null))['catch'](handleError(_0x58865b,null));};var interaction_log=require(_0xd724('0x63'))(_0xd724('0x64'));exports[_0xd724('0x3a')]=function(_0x1bf814,_0x2316c4,_0x469bf6){var _0x1ea9db={'agent':{},'channel':_0xd724('0x66')};if(_0x1bf814[_0xd724('0x60')]['id']){delete _0x1bf814[_0xd724('0x60')]['id'];}_0x1bf814[_0xd724('0x60')]['UserId']=_0x1bf814['body'][_0xd724('0x6b')]||_0x1bf814['user']['id'];_0x1ea9db[_0xd724('0x82')]['id']=_0x1bf814[_0xd724('0x60')]['UserId'];return db['OpenchannelMessage'][_0xd724('0x5e')]({'where':{'id':_0x1bf814[_0xd724('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2316c4,null))[_0xd724('0x25')](function(_0x316203){if(_0x316203){_0x1ea9db['message']=_0x316203['get']({'plain':!![]});return db[_0xd724('0x6e')][_0xd724('0x5e')]({'where':{'id':_0x316203[_0xd724('0x6f')]}});}return null;})[_0xd724('0x25')](handleEntityNotFound(_0x2316c4,null))[_0xd724('0x25')](function(_0x11c6ec){if(_0x11c6ec){_0x1ea9db[_0xd724('0x83')]=_0x11c6ec[_0xd724('0x6d')]({'plain':!![]});interaction_log[_0xd724('0x26')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1bf814[_0xd724('0x6c')]['id'],_0x1bf814[_0xd724('0x6c')]['name'],_0x1bf814['user'][_0xd724('0x84')],_0x1ea9db['interaction']['id'],_0x1bf814[_0xd724('0x60')]?JSON['stringify'](_0x1bf814[_0xd724('0x60')]):_0xd724('0x72'));return respondWithRpcPromise(_0xd724('0x85'),'rejectMessage',_0x1ea9db);}return null;})[_0xd724('0x25')](function(_0x42530f){var _0x35b135=_0xd724('0x86')+_0x42530f[_0xd724('0x2d')]['ContactId'];return db[_0xd724('0x74')]['query'](_0x35b135,{'type':db['Sequelize'][_0xd724('0x75')][_0xd724('0x76')],'raw':!![]})[_0xd724('0x25')](function(_0x4438f6){return _0x4438f6;});})[_0xd724('0x25')](function(_0x458e06){if(_0x458e06){_0x1ea9db[_0xd724('0x2d')][_0xd724('0x77')]=_0x458e06[0x0];if(!_0x1bf814[_0xd724('0x60')][_0xd724('0x6b')])return;return db['User'][_0xd724('0x5e')]({'where':{'id':_0x1bf814[_0xd724('0x60')][_0xd724('0x6b')],'role':'agent'},'attributes':['id',_0xd724('0x3d'),'fullname',_0xd724('0x87'),_0xd724('0x7a')],'raw':!![]});}return null;})[_0xd724('0x25')](function(_0x33be37){if(!_0x33be37)return null;_0x1ea9db[_0xd724('0x2d')]['agent']=_0x33be37;return _0x1ea9db;})[_0xd724('0x25')](function(_0x285222){if(_0x285222){_0x285222[_0xd724('0x2d')][_0xd724('0x7c')]=util[_0xd724('0x69')](_0xd724('0x7d'),_0x1bf814[_0xd724('0x6c')][_0xd724('0x3d')]);_0x285222[_0xd724('0x2d')][_0xd724('0x7e')]=_0x1ea9db[_0xd724('0x7e')];_0x285222[_0xd724('0x2d')][_0xd724('0x7f')]=_0x1ea9db[_0xd724('0x7e')];_0x285222['message']['event']=_0xd724('0x3a');respondWithRpcPromise(_0xd724('0x80'),_0xd724('0x80'),{'event':_0xd724('0x88'),'message':_0x285222[_0xd724('0x2d')]},client9002);return _0x1ea9db;}return null;})[_0xd724('0x25')](respondWithResult(_0x2316c4,null))[_0xd724('0x5a')](handleError(_0x2316c4,null));}; \ No newline at end of file +var _0x9a9c=['send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','OpenchannelMessage','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9a9c,0x15f));var _0xc9a9=function(_0x117f29,_0x2820df){_0x117f29=_0x117f29-0x0;var _0x1b6934=_0x9a9c[_0x117f29];return _0x1b6934;};'use strict';var emlformat=require(_0xc9a9('0x0'));var rimraf=require(_0xc9a9('0x1'));var zipdir=require(_0xc9a9('0x2'));var jsonpatch=require(_0xc9a9('0x3'));var rp=require(_0xc9a9('0x4'));var moment=require(_0xc9a9('0x5'));var BPromise=require(_0xc9a9('0x6'));var Mustache=require(_0xc9a9('0x7'));var util=require(_0xc9a9('0x8'));var path=require(_0xc9a9('0x9'));var sox=require(_0xc9a9('0xa'));var csv=require(_0xc9a9('0xb'));var ejs=require(_0xc9a9('0xc'));var fs=require('fs');var fs_extra=require(_0xc9a9('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc9a9('0xe'));var jsforce=require(_0xc9a9('0xf'));var deskjs=require(_0xc9a9('0x10'));var toCsv=require(_0xc9a9('0xb'));var querystring=require('querystring');var Papa=require(_0xc9a9('0x11'));var Redis=require(_0xc9a9('0x12'));var authService=require(_0xc9a9('0x13'));var qs=require(_0xc9a9('0x14'));var as=require(_0xc9a9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9a9('0x16'))(_0xc9a9('0x17'));var utils=require(_0xc9a9('0x18'));var config=require(_0xc9a9('0x19'));var licenseUtil=require(_0xc9a9('0x1a'));var db=require(_0xc9a9('0x1b'))['db'];config[_0xc9a9('0x1c')]=_[_0xc9a9('0x1d')](config[_0xc9a9('0x1c')],{'host':_0xc9a9('0x1e'),'port':0x18eb});var socket=require(_0xc9a9('0x1f'))(new Redis(config['redis']));require(_0xc9a9('0x20'))['register'](socket);var jayson=require(_0xc9a9('0x21'));var client=jayson[_0xc9a9('0x22')][_0xc9a9('0x23')]({'port':0x232c});var client9002=jayson[_0xc9a9('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a5483,_0x1ceb3a,_0x454bf8,_0x379f74){return new BPromise(function(_0x3f2950,_0x342a37){var _0x2e7003=_0x379f74||client;return _0x2e7003[_0xc9a9('0x24')](_0x4a5483,_0x454bf8)[_0xc9a9('0x25')](function(_0x2017a4){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1ceb3a,_0xc9a9('0x26'));logger['debug'](_0xc9a9('0x27'),_0x1ceb3a,_0xc9a9('0x26'),JSON[_0xc9a9('0x28')](_0x2017a4));if(_0x2017a4[_0xc9a9('0x29')]){if(_0x2017a4['error'][_0xc9a9('0x2a')]===0x1f4){logger['error'](_0xc9a9('0x2b'),_0x1ceb3a,_0x2017a4[_0xc9a9('0x29')][_0xc9a9('0x2c')]);return _0x342a37(_0x2017a4['error'][_0xc9a9('0x2c')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x1ceb3a,_0x2017a4[_0xc9a9('0x29')][_0xc9a9('0x2c')]);return _0x3f2950(_0x2017a4[_0xc9a9('0x29')][_0xc9a9('0x2c')]);}else{logger[_0xc9a9('0x2d')](_0xc9a9('0x2b'),_0x1ceb3a,'request\x20sent');_0x3f2950(_0x2017a4[_0xc9a9('0x2e')][_0xc9a9('0x2c')]);}})['catch'](function(_0x3243aa){logger[_0xc9a9('0x29')](_0xc9a9('0x2b'),_0x1ceb3a,_0x3243aa);_0x342a37(_0x3243aa);});});}function respondWithStatusCode(_0x35a8e2,_0x5e3825){_0x5e3825=_0x5e3825||0xcc;return function(_0x138928){if(_0x138928){return _0x35a8e2[_0xc9a9('0x2f')](_0x5e3825);}return _0x35a8e2[_0xc9a9('0x30')](_0x5e3825)[_0xc9a9('0x31')]();};}function respondWithResult(_0x17daf2,_0x523255){_0x523255=_0x523255||0xc8;return function(_0x328752){if(_0x328752){return _0x17daf2[_0xc9a9('0x30')](_0x523255)[_0xc9a9('0x32')](_0x328752);}};}function respondWithFilteredResult(_0x3bfcd5,_0xe53b38){return function(_0x25d708){if(_0x25d708){var _0xe423d=typeof _0xe53b38[_0xc9a9('0x33')]===_0xc9a9('0x34')&&typeof _0xe53b38[_0xc9a9('0x35')]==='undefined';var _0x6ecd4a=_0x25d708[_0xc9a9('0x36')];var _0x575168=_0xe423d?0x0:_0xe53b38[_0xc9a9('0x33')];var _0x5f2477=_0xe423d?_0x25d708['count']:_0xe53b38['offset']+_0xe53b38[_0xc9a9('0x35')];var _0x258e6f;if(_0x5f2477>=_0x6ecd4a){_0x5f2477=_0x6ecd4a;_0x258e6f=0xc8;}else{_0x258e6f=0xce;}_0x3bfcd5[_0xc9a9('0x30')](_0x258e6f);return _0x3bfcd5[_0xc9a9('0x37')](_0xc9a9('0x38'),_0x575168+'-'+_0x5f2477+'/'+_0x6ecd4a)[_0xc9a9('0x32')](_0x25d708);}return null;};}function patchUpdates(_0x4fb280){return function(_0x32fa1e){try{jsonpatch[_0xc9a9('0x39')](_0x32fa1e,_0x4fb280,!![]);}catch(_0x5540e3){return BPromise[_0xc9a9('0x3a')](_0x5540e3);}return _0x32fa1e[_0xc9a9('0x3b')]();};}function saveUpdates(_0x3355ac,_0x5d019a){return function(_0x59878c){if(_0x59878c){return _0x59878c['update'](_0x3355ac)[_0xc9a9('0x25')](function(_0x3282ee){return _0x3282ee;});}return null;};}function removeEntity(_0x244e54,_0x273467){return function(_0x1bcf7d){if(_0x1bcf7d){return _0x1bcf7d[_0xc9a9('0x3c')]()[_0xc9a9('0x25')](function(){_0x244e54[_0xc9a9('0x30')](0xcc)[_0xc9a9('0x31')]();});}};}function handleEntityNotFound(_0x1075e5,_0x5a045d){return function(_0x209462){if(!_0x209462){_0x1075e5[_0xc9a9('0x2f')](0x194);}return _0x209462;};}function handleError(_0xd013ac,_0x41ac99){_0x41ac99=_0x41ac99||0x1f4;return function(_0x5ed14a){logger[_0xc9a9('0x29')](_0x5ed14a[_0xc9a9('0x3d')]);if(_0x5ed14a[_0xc9a9('0x3e')]){delete _0x5ed14a[_0xc9a9('0x3e')];}_0xd013ac[_0xc9a9('0x30')](_0x41ac99)[_0xc9a9('0x3f')](_0x5ed14a);};}exports[_0xc9a9('0x40')]=function(_0x38fde2,_0x539759){var _0x8c5d11={},_0x561f9c={},_0xfa6f10={'count':0x0,'rows':[]};var _0x23be2b=_[_0xc9a9('0x41')](db['OpenchannelMessage'][_0xc9a9('0x42')],function(_0x2c785f){return{'name':_0x2c785f['fieldName'],'type':_0x2c785f[_0xc9a9('0x43')][_0xc9a9('0x44')]};});_0x561f9c[_0xc9a9('0x45')]=_['map'](_0x23be2b,_0xc9a9('0x3e'));_0x561f9c[_0xc9a9('0x46')]=_[_0xc9a9('0x47')](_0x38fde2[_0xc9a9('0x46')]);_0x561f9c[_0xc9a9('0x48')]=_[_0xc9a9('0x49')](_0x561f9c[_0xc9a9('0x45')],_0x561f9c[_0xc9a9('0x46')]);_0x8c5d11[_0xc9a9('0x4a')]=_[_0xc9a9('0x49')](_0x561f9c['model'],qs[_0xc9a9('0x4b')](_0x38fde2[_0xc9a9('0x46')][_0xc9a9('0x4b')]));_0x8c5d11[_0xc9a9('0x4a')]=_0x8c5d11[_0xc9a9('0x4a')][_0xc9a9('0x4c')]?_0x8c5d11[_0xc9a9('0x4a')]:_0x561f9c[_0xc9a9('0x45')];if(!_0x38fde2[_0xc9a9('0x46')][_0xc9a9('0x4d')](_0xc9a9('0x4e'))){_0x8c5d11[_0xc9a9('0x35')]=qs[_0xc9a9('0x35')](_0x38fde2['query'][_0xc9a9('0x35')]);_0x8c5d11[_0xc9a9('0x33')]=qs[_0xc9a9('0x33')](_0x38fde2[_0xc9a9('0x46')][_0xc9a9('0x33')]);}_0x8c5d11['order']=qs['sort'](_0x38fde2['query'][_0xc9a9('0x4f')]);_0x8c5d11[_0xc9a9('0x50')]=qs[_0xc9a9('0x48')](_[_0xc9a9('0x51')](_0x38fde2[_0xc9a9('0x46')],_0x561f9c[_0xc9a9('0x48')]),_0x23be2b);if(_0x38fde2[_0xc9a9('0x46')]['filter']){_0x8c5d11[_0xc9a9('0x50')]=_['merge'](_0x8c5d11[_0xc9a9('0x50')],{'$or':_[_0xc9a9('0x41')](_0x23be2b,function(_0x581cae){if(_0x581cae[_0xc9a9('0x43')]!==_0xc9a9('0x52')){var _0x4f8f4d={};_0x4f8f4d[_0x581cae[_0xc9a9('0x3e')]]={'$like':'%'+_0x38fde2[_0xc9a9('0x46')]['filter']+'%'};return _0x4f8f4d;}})});}_0x8c5d11=_[_0xc9a9('0x53')]({},_0x8c5d11,_0x38fde2['options']);var _0x1b4207={'where':_0x8c5d11['where']};return db[_0xc9a9('0x54')][_0xc9a9('0x36')](_0x1b4207)[_0xc9a9('0x25')](function(_0x34ce7a){_0xfa6f10[_0xc9a9('0x36')]=_0x34ce7a;if(_0x38fde2[_0xc9a9('0x46')][_0xc9a9('0x55')]){_0x8c5d11[_0xc9a9('0x56')]=[{'all':!![]}];}return db[_0xc9a9('0x54')][_0xc9a9('0x57')](_0x8c5d11);})[_0xc9a9('0x25')](function(_0x20a412){_0xfa6f10[_0xc9a9('0x58')]=_0x20a412;return _0xfa6f10;})[_0xc9a9('0x25')](respondWithFilteredResult(_0x539759,_0x8c5d11))[_0xc9a9('0x59')](handleError(_0x539759,null));};exports[_0xc9a9('0x5a')]=function(_0x305077,_0x2f1a25){var _0x36efb4={'raw':!![],'where':{'id':_0x305077['params']['id']}},_0x2765dd={};_0x2765dd[_0xc9a9('0x45')]=_[_0xc9a9('0x47')](db[_0xc9a9('0x54')]['rawAttributes']);_0x2765dd[_0xc9a9('0x46')]=_[_0xc9a9('0x47')](_0x305077[_0xc9a9('0x46')]);_0x2765dd['filters']=_[_0xc9a9('0x49')](_0x2765dd[_0xc9a9('0x45')],_0x2765dd[_0xc9a9('0x46')]);_0x36efb4[_0xc9a9('0x4a')]=_[_0xc9a9('0x49')](_0x2765dd[_0xc9a9('0x45')],qs[_0xc9a9('0x4b')](_0x305077['query'][_0xc9a9('0x4b')]));_0x36efb4['attributes']=_0x36efb4[_0xc9a9('0x4a')]['length']?_0x36efb4[_0xc9a9('0x4a')]:_0x2765dd[_0xc9a9('0x45')];if(_0x305077['query'][_0xc9a9('0x55')]){_0x36efb4['include']=[{'all':!![]}];}_0x36efb4=_[_0xc9a9('0x53')]({},_0x36efb4,_0x305077['options']);return db[_0xc9a9('0x54')]['find'](_0x36efb4)['then'](handleEntityNotFound(_0x2f1a25,null))[_0xc9a9('0x25')](respondWithResult(_0x2f1a25,null))[_0xc9a9('0x59')](handleError(_0x2f1a25,null));};exports[_0xc9a9('0x5b')]=function(_0x1af927,_0x3ead56){return db[_0xc9a9('0x54')][_0xc9a9('0x5b')](_0x1af927[_0xc9a9('0x5c')],{})[_0xc9a9('0x25')](respondWithResult(_0x3ead56,0xc9))[_0xc9a9('0x59')](handleError(_0x3ead56,null));};exports[_0xc9a9('0x5d')]=function(_0x5d1c4c,_0x5403e5){if(_0x5d1c4c[_0xc9a9('0x5c')]['id']){delete _0x5d1c4c[_0xc9a9('0x5c')]['id'];}return db['OpenchannelMessage'][_0xc9a9('0x5e')]({'where':{'id':_0x5d1c4c[_0xc9a9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5403e5,null))[_0xc9a9('0x25')](saveUpdates(_0x5d1c4c[_0xc9a9('0x5c')],null))['then'](respondWithResult(_0x5403e5,null))[_0xc9a9('0x59')](handleError(_0x5403e5,null));};exports[_0xc9a9('0x3c')]=function(_0x1c9528,_0xbf79ba){return db[_0xc9a9('0x54')][_0xc9a9('0x5e')]({'where':{'id':_0x1c9528[_0xc9a9('0x5f')]['id']}})[_0xc9a9('0x25')](handleEntityNotFound(_0xbf79ba,null))[_0xc9a9('0x25')](removeEntity(_0xbf79ba,null))[_0xc9a9('0x59')](handleError(_0xbf79ba,null));};exports['describe']=function(_0x240914,_0x4d666f){return db[_0xc9a9('0x54')]['describe']()[_0xc9a9('0x25')](respondWithResult(_0x4d666f,null))[_0xc9a9('0x59')](handleError(_0x4d666f,null));};var interaction_log=require(_0xc9a9('0x16'))('openchannel-interactions');exports[_0xc9a9('0x60')]=function(_0x4b4773,_0x294518,_0x45d0a5){var _0x852436={'agent':{},'channel':_0xc9a9('0x61')};if(_0x4b4773[_0xc9a9('0x5c')]['id']){delete _0x4b4773[_0xc9a9('0x5c')]['id'];}_0x4b4773[_0xc9a9('0x5c')][_0xc9a9('0x62')]=!![];_0x4b4773[_0xc9a9('0x5c')][_0xc9a9('0x63')]=moment()[_0xc9a9('0x64')](_0xc9a9('0x65'));_0x4b4773['body']['UserId']=_0x4b4773[_0xc9a9('0x5c')][_0xc9a9('0x66')]||_0x4b4773[_0xc9a9('0x67')]['id'];_0x852436[_0xc9a9('0x68')]['id']=_0x4b4773[_0xc9a9('0x5c')][_0xc9a9('0x66')];return db['OpenchannelMessage'][_0xc9a9('0x5e')]({'where':{'id':_0x4b4773['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x294518,null))[_0xc9a9('0x25')](saveUpdates(_0x4b4773[_0xc9a9('0x5c')],null))[_0xc9a9('0x25')](function(_0x37d998){if(_0x37d998){_0x852436[_0xc9a9('0x2c')]=_0x37d998[_0xc9a9('0x69')]({'plain':!![]});return db['OpenchannelInteraction'][_0xc9a9('0x5e')]({'where':{'id':_0x37d998[_0xc9a9('0x6a')]}});}return null;})[_0xc9a9('0x25')](handleEntityNotFound(_0x294518,null))['then'](function(_0x5eb780){if(_0x5eb780){return _0x5eb780[_0xc9a9('0x5d')]({'UserId':_0x4b4773['body'][_0xc9a9('0x66')],'read1stAt':_[_0xc9a9('0x6b')](_0x5eb780['read1stAt'])?moment()['format'](_0xc9a9('0x65')):undefined});}return null;})[_0xc9a9('0x25')](function(_0x11e07b){if(_0x11e07b){_0x852436[_0xc9a9('0x6c')]=_0x11e07b[_0xc9a9('0x69')]({'plain':!![]});interaction_log[_0xc9a9('0x2d')](_0xc9a9('0x6d'),_0x4b4773[_0xc9a9('0x67')]['id'],_0x4b4773[_0xc9a9('0x67')][_0xc9a9('0x3e')],_0x4b4773['user']['role'],_0x852436[_0xc9a9('0x6c')]['id'],_0x4b4773[_0xc9a9('0x5c')]?JSON['stringify'](_0x4b4773[_0xc9a9('0x5c')]):_0xc9a9('0x6e'));return respondWithRpcPromise(_0xc9a9('0x6f'),_0xc9a9('0x70'),_0x852436);}return null;})[_0xc9a9('0x25')](function(_0xf4c11e){var _0x544360=_0xc9a9('0x71')+_0xf4c11e[_0xc9a9('0x2c')][_0xc9a9('0x72')];return db[_0xc9a9('0x73')][_0xc9a9('0x46')](_0x544360,{'type':db['Sequelize'][_0xc9a9('0x74')][_0xc9a9('0x75')],'raw':!![]})[_0xc9a9('0x25')](function(_0x2a7bb3){return _0x2a7bb3;});})['then'](function(_0x5f0250){if(_0x5f0250){_0x852436[_0xc9a9('0x2c')]['contact']=_0x5f0250[0x0];if(!_0x4b4773[_0xc9a9('0x5c')][_0xc9a9('0x66')])return;return db[_0xc9a9('0x76')]['find']({'where':{'id':_0x4b4773[_0xc9a9('0x5c')]['UserId'],'role':_0xc9a9('0x68')},'attributes':['id',_0xc9a9('0x3e'),_0xc9a9('0x77'),_0xc9a9('0x78'),'internal'],'raw':!![]});}return null;})[_0xc9a9('0x25')](function(_0x543265){if(!_0x543265)return null;_0x852436[_0xc9a9('0x2c')][_0xc9a9('0x68')]=_0x543265;return _0x852436;})[_0xc9a9('0x25')](function(_0x248bd2){if(_0x248bd2){if(_0x4b4773[_0xc9a9('0x5c')][_0xc9a9('0x79')]){_0x852436[_0xc9a9('0x2c')][_0xc9a9('0x7a')]=util['format'](_0xc9a9('0x7b'),_0x4b4773[_0xc9a9('0x67')][_0xc9a9('0x3e')]);_0x852436['message']['channel']=_0x852436[_0xc9a9('0x7c')];_0x852436['message'][_0xc9a9('0x7d')]=_0x852436[_0xc9a9('0x7c')];_0x852436['message'][_0xc9a9('0x7e')]=_0xc9a9('0x60');return respondWithRpcPromise(_0xc9a9('0x7f'),_0xc9a9('0x7f'),{'event':_0xc9a9('0x80'),'message':_0x852436['message']},client9002)[_0xc9a9('0x25')](function(){return _0x852436;});}return _0x852436;}return null;})[_0xc9a9('0x25')](respondWithResult(_0x294518,null))[_0xc9a9('0x59')](handleError(_0x294518,null));};var interaction_log=require(_0xc9a9('0x16'))(_0xc9a9('0x81'));exports[_0xc9a9('0x3a')]=function(_0x16e6de,_0x3b7ef8,_0x21a974){var _0x2da892={'agent':{},'channel':_0xc9a9('0x61')};if(_0x16e6de[_0xc9a9('0x5c')]['id']){delete _0x16e6de['body']['id'];}_0x16e6de[_0xc9a9('0x5c')][_0xc9a9('0x66')]=_0x16e6de[_0xc9a9('0x5c')][_0xc9a9('0x66')]||_0x16e6de[_0xc9a9('0x67')]['id'];_0x2da892[_0xc9a9('0x68')]['id']=_0x16e6de[_0xc9a9('0x5c')]['UserId'];return db[_0xc9a9('0x54')][_0xc9a9('0x5e')]({'where':{'id':_0x16e6de[_0xc9a9('0x5f')]['id'],'UserId':null}})[_0xc9a9('0x25')](handleEntityNotFound(_0x3b7ef8,null))['then'](function(_0xdfe792){if(_0xdfe792){_0x2da892[_0xc9a9('0x2c')]=_0xdfe792[_0xc9a9('0x69')]({'plain':!![]});return db[_0xc9a9('0x82')]['find']({'where':{'id':_0xdfe792[_0xc9a9('0x6a')]}});}return null;})[_0xc9a9('0x25')](handleEntityNotFound(_0x3b7ef8,null))[_0xc9a9('0x25')](function(_0xe0de9c){if(_0xe0de9c){_0x2da892['interaction']=_0xe0de9c[_0xc9a9('0x69')]({'plain':!![]});interaction_log[_0xc9a9('0x2d')](_0xc9a9('0x83'),_0x16e6de[_0xc9a9('0x67')]['id'],_0x16e6de['user']['name'],_0x16e6de['user'][_0xc9a9('0x84')],_0x2da892[_0xc9a9('0x6c')]['id'],_0x16e6de['body']?JSON['stringify'](_0x16e6de[_0xc9a9('0x5c')]):_0xc9a9('0x6e'));return respondWithRpcPromise(_0xc9a9('0x85'),_0xc9a9('0x86'),_0x2da892);}return null;})[_0xc9a9('0x25')](function(_0xc9302d){var _0x1d4812=_0xc9a9('0x71')+_0xc9302d[_0xc9a9('0x2c')][_0xc9a9('0x72')];return db[_0xc9a9('0x73')][_0xc9a9('0x46')](_0x1d4812,{'type':db[_0xc9a9('0x87')][_0xc9a9('0x74')]['SELECT'],'raw':!![]})[_0xc9a9('0x25')](function(_0x4bf933){return _0x4bf933;});})[_0xc9a9('0x25')](function(_0x20377d){if(_0x20377d){_0x2da892[_0xc9a9('0x2c')][_0xc9a9('0x88')]=_0x20377d[0x0];if(!_0x16e6de[_0xc9a9('0x5c')][_0xc9a9('0x66')])return;return db[_0xc9a9('0x76')][_0xc9a9('0x5e')]({'where':{'id':_0x16e6de[_0xc9a9('0x5c')][_0xc9a9('0x66')],'role':_0xc9a9('0x68')},'attributes':['id',_0xc9a9('0x3e'),_0xc9a9('0x77'),_0xc9a9('0x78'),'internal'],'raw':!![]});}return null;})[_0xc9a9('0x25')](function(_0x498bb0){if(!_0x498bb0)return null;_0x2da892[_0xc9a9('0x2c')][_0xc9a9('0x68')]=_0x498bb0;return _0x2da892;})[_0xc9a9('0x25')](function(_0x3ccd5b){if(_0x3ccd5b){_0x3ccd5b[_0xc9a9('0x2c')][_0xc9a9('0x7a')]=util[_0xc9a9('0x64')](_0xc9a9('0x7b'),_0x16e6de['user']['name']);_0x3ccd5b[_0xc9a9('0x2c')][_0xc9a9('0x7c')]=_0x2da892[_0xc9a9('0x7c')];_0x3ccd5b[_0xc9a9('0x2c')][_0xc9a9('0x7d')]=_0x2da892[_0xc9a9('0x7c')];_0x3ccd5b['message'][_0xc9a9('0x7e')]='reject';respondWithRpcPromise(_0xc9a9('0x7f'),'EventManager',{'event':_0xc9a9('0x89'),'message':_0x3ccd5b['message']},client9002);return _0x2da892;}return null;})[_0xc9a9('0x25')](respondWithResult(_0x3b7ef8,null))['catch'](handleError(_0x3b7ef8,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 20c2c0d..3d98583 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 _0x4bc7=['OpenchannelMessage','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x4bc7,0x1b7));var _0x74bc=function(_0x17049d,_0x345405){_0x17049d=_0x17049d-0x0;var _0xecc1dd=_0x4bc7[_0x17049d];return _0xecc1dd;};'use strict';var EventEmitter=require(_0x74bc('0x0'));var OpenchannelMessage=require(_0x74bc('0x1'))['db'][_0x74bc('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x74bc('0x3')](0x0);var events={'afterCreate':_0x74bc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1696e3){return function(_0x98d48,_0x2391bb,_0x3a4f49){OpenchannelMessageEvents[_0x74bc('0x5')](_0x1696e3+':'+_0x98d48['id'],_0x98d48);OpenchannelMessageEvents[_0x74bc('0x5')](_0x1696e3,_0x98d48);_0x3a4f49(null);};}for(var e in events){if(events[_0x74bc('0x6')](e)){var event=events[e];OpenchannelMessage[_0x74bc('0x7')](e,emitEvent(event));}}module[_0x74bc('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xa896=['hook','exports','events','OpenchannelMessage','save','update','emit','hasOwnProperty'];(function(_0x51d55b,_0x1466d2){var _0x3cd0f7=function(_0x46f0bd){while(--_0x46f0bd){_0x51d55b['push'](_0x51d55b['shift']());}};_0x3cd0f7(++_0x1466d2);}(_0xa896,0xa2));var _0x6a89=function(_0x5d5db4,_0x1cd222){_0x5d5db4=_0x5d5db4-0x0;var _0xf14a18=_0xa896[_0x5d5db4];return _0xf14a18;};'use strict';var EventEmitter=require(_0x6a89('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x6a89('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6a89('0x2'),'afterUpdate':_0x6a89('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5d2737){return function(_0x3cfe1b,_0x9f08a5,_0x137243){OpenchannelMessageEvents[_0x6a89('0x4')](_0x5d2737+':'+_0x3cfe1b['id'],_0x3cfe1b);OpenchannelMessageEvents[_0x6a89('0x4')](_0x5d2737,_0x3cfe1b);_0x137243(null);};}for(var e in events){if(events[_0x6a89('0x5')](e)){var event=events[e];OpenchannelMessage[_0x6a89('0x6')](e,emitEvent(event));}}module[_0x6a89('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 08b6e95..1b35d28 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 _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x5242cd,_0x492782){var _0x218aec=function(_0x177501){while(--_0x177501){_0x5242cd['push'](_0x5242cd['shift']());}};_0x218aec(++_0x492782);}(_0x2032,0xd9));var _0x2203=function(_0x1d30de,_0x49f1b4){_0x1d30de=_0x1d30de-0x0;var _0x23c4f1=_0x2032[_0x1d30de];return _0x23c4f1;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file +var _0x9348=['catch','error','CmContact','describe','find','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt'];(function(_0x5b80e7,_0x13c597){var _0x20f9c2=function(_0xf16b44){while(--_0xf16b44){_0x5b80e7['push'](_0x5b80e7['shift']());}};_0x20f9c2(++_0x13c597);}(_0x9348,0x10d));var _0x8934=function(_0x1d2e86,_0x54fd3b){_0x1d2e86=_0x1d2e86-0x0;var _0xc38301=_0x9348[_0x1d2e86];return _0xc38301;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[{'name':_0x8934('0xc'),'fields':[_0x8934('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b470d,_0x5ec16d,_0x5336f0){var _0x2c722b=_0x2bce03['models'];var _0xe1adf4=_0x4b470d[_0x8934('0xe')]({'plain':!![]});if(_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()==='in'||_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()===_0x8934('0x11')&&!_0xe1adf4[_0x8934('0x12')]&&!_['isNil'](_0xe1adf4[_0x8934('0x13')])){_0x2c722b[_0x8934('0x14')][_0x8934('0x15')]({'where':{'id':_0xe1adf4[_0x8934('0x16')]}})[_0x8934('0x17')](function(_0xdf59f4){if(_0xdf59f4){_0xdf59f4['update']({'lastMsgAt':_0xe1adf4[_0x8934('0x18')],'lastMsgDirection':_0xe1adf4[_0x8934('0xf')][_0x8934('0x10')]()});}})[_0x8934('0x19')](function(_0x34d4dc){console[_0x8934('0x1a')](_0x34d4dc);});}if(_0xe1adf4[_0x8934('0xf')]===_0x8934('0x11')&&!_0xe1adf4['secret']){var _0xb86bc9;_0x2c722b[_0x8934('0x1b')][_0x8934('0x1c')]()['then'](function(_0x47f25e){return _0x2c722b['OpenchannelAccount'][_0x8934('0x1d')]({'where':{'id':_0xe1adf4['OpenchannelAccountId']},'include':[{'model':_0x2c722b[_0x8934('0x14')],'as':_0x8934('0x1e'),'where':{'id':_0xe1adf4[_0x8934('0x16')]},'limit':0x1,'include':[{'model':_0x2c722b[_0x8934('0x1b')],'as':_0x8934('0x1f'),'attributes':_['keys'](_0x47f25e)}]}]});})[_0x8934('0x17')](function(_0x5ae49f){_0xb86bc9=_0x5ae49f[_0x8934('0xe')]({'plain':!![]});if(_0xb86bc9&&_0xb86bc9[_0x8934('0x20')]){logger[_0x8934('0x21')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x25'),_0xe1adf4['id'],_0xb86bc9['replyUri']));if(_0xb86bc9[_0x8934('0x1e')]&&_0xb86bc9[_0x8934('0x1e')][_0x8934('0x26')]){_0xe1adf4[_0x8934('0x27')]=_[_0x8934('0x28')](_0xb86bc9['Interactions'][0x0],_0x8934('0x1f'));_0xe1adf4[_0x8934('0x1f')]=_0xb86bc9[_0x8934('0x1e')][0x0]['Contact'];}var _0x5ec16d={'method':'POST','uri':encodeURI(_0xb86bc9[_0x8934('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5ec16d[_0x8934('0x29')]){case _0x8934('0x2a'):_0x5ec16d['qs']=_0xe1adf4;break;case'POST':_0x5ec16d[_0x8934('0xd')]=_0xe1adf4;break;}return rp(_0x5ec16d)[_0x8934('0x17')](function(_0x310454){logger[_0x8934('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x8934('0x23'),util[_0x8934('0x24')](_0x8934('0x2b'),_0xe1adf4['id'],_0xb86bc9[_0x8934('0x20')]));if(_0x310454[_0x8934('0xd')][_0x8934('0x2c')]&&_0x310454[_0x8934('0xd')][_0x8934('0x2c')]!=_0xe1adf4[_0x8934('0x27')][_0x8934('0x2c')]){return _0x2c722b['OpenchannelInteraction'][_0x8934('0x2d')]({'threadId':_0x310454[_0x8934('0xd')]['threadId']},{'logging':!![],'where':{'id':_0xe1adf4[_0x8934('0x27')]['id']}});}else{return;}})[_0x8934('0x17')](function(){return _0x4b470d[_0x8934('0x2d')]({'read':!![]});})[_0x8934('0x19')](function(_0x4b3cb9){logger[_0x8934('0x1a')](_0x8934('0x22'),_0x8934('0x23'),util[_0x8934('0x2e')](_0x4b3cb9,{'showHidden':![],'depth':null}));_0x5336f0();});}else{_0x5336f0();}})[_0x8934('0x2f')](function(){_0x5336f0();});}else{_0x5336f0();}}},'charset':'utf8mb4','collate':_0x8934('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 313dc8c..22a59f9 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 _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dd3e6,_0x76042e){var _0x3a1a5b=function(_0x18f7b0){while(--_0x18f7b0){_0x2dd3e6['push'](_0x2dd3e6['shift']());}};_0x3a1a5b(++_0x76042e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5eb496,_0x25bc44){_0x5eb496=_0x5eb496-0x0;var _0x4f513a=_0x5f2f[_0x5eb496];return _0x4f513a;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +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(_0x514aa7,_0x56ffa4){var _0x47f048=function(_0x5ebbd0){while(--_0x5ebbd0){_0x514aa7['push'](_0x514aa7['shift']());}};_0x47f048(++_0x56ffa4);}(_0xadb5,0xad));var _0x5adb=function(_0x820430,_0x418c28){_0x820430=_0x820430-0x0;var _0x4a5cd4=_0xadb5[_0x820430];return _0x4a5cd4;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 68d0bd0..b3bee3e 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 _0x7896=['remove','update','register','./openchannelMessage.events'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7896,0x127));var _0x6789=function(_0x5e7634,_0x5356a1){_0x5e7634=_0x5e7634-0x0;var _0x563eb3=_0x7896[_0x5e7634];return _0x563eb3;};'use strict';var OpenchannelMessageEvents=require(_0x6789('0x0'));var events=['save',_0x6789('0x1'),_0x6789('0x2')];function createListener(_0x359c8c,_0x4639d7){return function(_0x13ab6f){_0x4639d7['emit'](_0x359c8c,_0x13ab6f);};}function removeListener(_0x47a4e4,_0x1975b5){return function(){OpenchannelMessageEvents['removeListener'](_0x47a4e4,_0x1975b5);};}exports[_0x6789('0x3')]=function(_0x6298f4){for(var _0x448db0=0x0,_0x266755=events['length'];_0x448db0<_0x266755;_0x448db0++){var _0x141319=events[_0x448db0];var _0xb4720d=createListener('openchannelMessage:'+_0x141319,_0x6298f4);OpenchannelMessageEvents['on'](_0x141319,_0xb4720d);}}; \ No newline at end of file +var _0x99a3=['register','length','./openchannelMessage.events','save','remove','update','emit'];(function(_0x444a59,_0x21f0c3){var _0x569e99=function(_0x5a840c){while(--_0x5a840c){_0x444a59['push'](_0x444a59['shift']());}};_0x569e99(++_0x21f0c3);}(_0x99a3,0x14b));var _0x399a=function(_0x2f5a82,_0x537a16){_0x2f5a82=_0x2f5a82-0x0;var _0x1cced2=_0x99a3[_0x2f5a82];return _0x1cced2;};'use strict';var OpenchannelMessageEvents=require(_0x399a('0x0'));var events=[_0x399a('0x1'),_0x399a('0x2'),_0x399a('0x3')];function createListener(_0x505c55,_0x3d3ea8){return function(_0x1f5fb8){_0x3d3ea8[_0x399a('0x4')](_0x505c55,_0x1f5fb8);};}function removeListener(_0x4bf134,_0x438271){return function(){OpenchannelMessageEvents['removeListener'](_0x4bf134,_0x438271);};}exports[_0x399a('0x5')]=function(_0x3762a4){for(var _0x52e383=0x0,_0x6cf9e0=events[_0x399a('0x6')];_0x52e383<_0x6cf9e0;_0x52e383++){var _0x4f7e4d=events[_0x52e383];var _0xf65fcd=createListener('openchannelMessage:'+_0x4f7e4d,_0x3762a4);OpenchannelMessageEvents['on'](_0x4f7e4d,_0xf65fcd);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 3494bad..0f75432 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 _0x99ca=['./openchannelQueue.controller','isAuthenticated','get','/describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f7529,_0x43f869){var _0x2a8257=function(_0x46b173){while(--_0x46b173){_0x2f7529['push'](_0x2f7529['shift']());}};_0x2a8257(++_0x43f869);}(_0x99ca,0xa6));var _0xa99c=function(_0x387a02,_0xedc911){_0x387a02=_0x387a02-0x0;var _0x3e7eb0=_0x99ca[_0x387a02];return _0x3e7eb0;};'use strict';var multer=require(_0xa99c('0x0'));var util=require(_0xa99c('0x1'));var path=require(_0xa99c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa99c('0x3'));var router=express[_0xa99c('0x4')]();var fs_extra=require(_0xa99c('0x5'));var auth=require(_0xa99c('0x6'));var interaction=require(_0xa99c('0x7'));var config=require('../../config/environment');var controller=require(_0xa99c('0x8'));router['get']('/',auth[_0xa99c('0x9')](),controller['index']);router[_0xa99c('0xa')](_0xa99c('0xb'),auth[_0xa99c('0x9')](),controller['describe']);router[_0xa99c('0xa')](_0xa99c('0xc'),auth[_0xa99c('0x9')](),controller[_0xa99c('0xd')]);router[_0xa99c('0xa')](_0xa99c('0xe'),auth[_0xa99c('0x9')](),controller['getMembers']);router[_0xa99c('0xa')](_0xa99c('0xf'),auth[_0xa99c('0x9')](),controller[_0xa99c('0x10')]);router['get']('/:id/users',auth[_0xa99c('0x9')](),controller[_0xa99c('0x11')]);router['post']('/',auth[_0xa99c('0x9')](),controller[_0xa99c('0x12')]);router[_0xa99c('0x13')](_0xa99c('0xf'),auth[_0xa99c('0x9')](),controller[_0xa99c('0x14')]);router['post'](_0xa99c('0x15'),auth['isAuthenticated'](),controller[_0xa99c('0x16')]);router[_0xa99c('0x17')](_0xa99c('0xc'),auth['isAuthenticated'](),controller[_0xa99c('0x18')]);router[_0xa99c('0x19')](_0xa99c('0xc'),auth[_0xa99c('0x9')](),controller[_0xa99c('0x1a')]);router[_0xa99c('0x19')](_0xa99c('0xf'),auth['isAuthenticated'](),controller[_0xa99c('0x1b')]);router[_0xa99c('0x19')](_0xa99c('0x15'),auth[_0xa99c('0x9')](),controller[_0xa99c('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x1c49=['/:id/users','getAgents','post','create','/:id/teams','update','delete','removeTeams','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x1c49,0xce));var _0x91c4=function(_0x4776c9,_0x4917e6){_0x4776c9=_0x4776c9-0x0;var _0xccbd3b=_0x1c49[_0x4776c9];return _0xccbd3b;};'use strict';var multer=require(_0x91c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x91c4('0x1'));var express=require(_0x91c4('0x2'));var router=express[_0x91c4('0x3')]();var fs_extra=require(_0x91c4('0x4'));var auth=require(_0x91c4('0x5'));var interaction=require(_0x91c4('0x6'));var config=require(_0x91c4('0x7'));var controller=require('./openchannelQueue.controller');router[_0x91c4('0x8')]('/',auth[_0x91c4('0x9')](),controller[_0x91c4('0xa')]);router[_0x91c4('0x8')](_0x91c4('0xb'),auth[_0x91c4('0x9')](),controller[_0x91c4('0xc')]);router[_0x91c4('0x8')](_0x91c4('0xd'),auth[_0x91c4('0x9')](),controller[_0x91c4('0xe')]);router[_0x91c4('0x8')](_0x91c4('0xf'),auth[_0x91c4('0x9')](),controller[_0x91c4('0x10')]);router[_0x91c4('0x8')]('/:id/teams',auth[_0x91c4('0x9')](),controller[_0x91c4('0x11')]);router[_0x91c4('0x8')](_0x91c4('0x12'),auth[_0x91c4('0x9')](),controller[_0x91c4('0x13')]);router[_0x91c4('0x14')]('/',auth[_0x91c4('0x9')](),controller[_0x91c4('0x15')]);router[_0x91c4('0x14')](_0x91c4('0x16'),auth['isAuthenticated'](),controller['addTeams']);router[_0x91c4('0x14')](_0x91c4('0x12'),auth[_0x91c4('0x9')](),controller['addAgents']);router['put'](_0x91c4('0xd'),auth['isAuthenticated'](),controller[_0x91c4('0x17')]);router[_0x91c4('0x18')](_0x91c4('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x91c4('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x91c4('0x19')]);router[_0x91c4('0x18')]('/:id/users',auth[_0x91c4('0x9')](),controller[_0x91c4('0x1a')]);module[_0x91c4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 8922a14..7083f33 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 _0xfee7=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xb54086,_0x28304b){var _0x4d2b0f=function(_0x49753a){while(--_0x49753a){_0xb54086['push'](_0xb54086['shift']());}};_0x4d2b0f(++_0x28304b);}(_0xfee7,0x1ea));var _0x7fee=function(_0x55e304,_0x361e52){_0x55e304=_0x55e304-0x0;var _0x3d013f=_0xfee7[_0x55e304];return _0x3d013f;};'use strict';var Sequelize=require(_0x7fee('0x0'));module[_0x7fee('0x1')]={'name':{'type':Sequelize[_0x7fee('0x2')],'unique':_0x7fee('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7fee('0x2')]},'timeout':{'type':Sequelize[_0x7fee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7fee('0x5')](_0x7fee('0x6'),_0x7fee('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x365b=['STRING','name','rrmemory','roundrobin','sequelize'];(function(_0x8781ed,_0x18e9ef){var _0x3e284a=function(_0x17f1d3){while(--_0x17f1d3){_0x8781ed['push'](_0x8781ed['shift']());}};_0x3e284a(++_0x18e9ef);}(_0x365b,0xe5));var _0xb365=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x365b[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require(_0xb365('0x0'));module['exports']={'name':{'type':Sequelize[_0xb365('0x1')],'unique':_0xb365('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb365('0x3'),'beepall',_0xb365('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 2b5d8fb..0d2e331 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 _0x020c=['find','create','body','user','userProfileId','autoAssociation','describe','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','interface','sequelize','each','emit','userOpenchannelQueue:save','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','ids','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','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','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','index','map','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x5dbba0,_0x49bf32){var _0x43d1f2=function(_0x1acac2){while(--_0x1acac2){_0x5dbba0['push'](_0x5dbba0['shift']());}};_0x43d1f2(++_0x49bf32);}(_0x020c,0x14c));var _0xc020=function(_0x1852c8,_0x3e0467){_0x1852c8=_0x1852c8-0x0;var _0x319e59=_0x020c[_0x1852c8];return _0x319e59;};'use strict';var emlformat=require(_0xc020('0x0'));var rimraf=require(_0xc020('0x1'));var zipdir=require(_0xc020('0x2'));var jsonpatch=require(_0xc020('0x3'));var rp=require(_0xc020('0x4'));var moment=require(_0xc020('0x5'));var BPromise=require(_0xc020('0x6'));var Mustache=require(_0xc020('0x7'));var util=require(_0xc020('0x8'));var path=require(_0xc020('0x9'));var sox=require('sox');var csv=require(_0xc020('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc020('0xb'));var jsforce=require(_0xc020('0xc'));var deskjs=require(_0xc020('0xd'));var toCsv=require(_0xc020('0xa'));var querystring=require(_0xc020('0xe'));var Papa=require(_0xc020('0xf'));var Redis=require('ioredis');var authService=require(_0xc020('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc020('0x11'));var hardwareService=require(_0xc020('0x12'));var logger=require(_0xc020('0x13'))(_0xc020('0x14'));var utils=require(_0xc020('0x15'));var config=require(_0xc020('0x16'));var licenseUtil=require(_0xc020('0x17'));var db=require(_0xc020('0x18'))['db'];config[_0xc020('0x19')]=_[_0xc020('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc020('0x1b'))(new Redis(config[_0xc020('0x19')]));require(_0xc020('0x1c'))[_0xc020('0x1d')](socket);function respondWithStatusCode(_0x1d1095,_0x3ddf72){_0x3ddf72=_0x3ddf72||0xcc;return function(_0x48f476){if(_0x48f476){return _0x1d1095[_0xc020('0x1e')](_0x3ddf72);}return _0x1d1095[_0xc020('0x1f')](_0x3ddf72)[_0xc020('0x20')]();};}function respondWithResult(_0x3b212a,_0x46ad6a){_0x46ad6a=_0x46ad6a||0xc8;return function(_0x2034b0){if(_0x2034b0){return _0x3b212a['status'](_0x46ad6a)['json'](_0x2034b0);}};}function respondWithFilteredResult(_0x10fa1b,_0x5c0453){return function(_0x27e450){if(_0x27e450){var _0x53097e=typeof _0x5c0453[_0xc020('0x21')]===_0xc020('0x22')&&typeof _0x5c0453[_0xc020('0x23')]==='undefined';var _0x240f40=_0x27e450[_0xc020('0x24')];var _0x4656ec=_0x53097e?0x0:_0x5c0453['offset'];var _0x103e92=_0x53097e?_0x27e450['count']:_0x5c0453[_0xc020('0x21')]+_0x5c0453['limit'];var _0x13e7e2;if(_0x103e92>=_0x240f40){_0x103e92=_0x240f40;_0x13e7e2=0xc8;}else{_0x13e7e2=0xce;}_0x10fa1b['status'](_0x13e7e2);return _0x10fa1b['set'](_0xc020('0x25'),_0x4656ec+'-'+_0x103e92+'/'+_0x240f40)['json'](_0x27e450);}return null;};}function patchUpdates(_0x56361e){return function(_0x2091db){try{jsonpatch[_0xc020('0x26')](_0x2091db,_0x56361e,!![]);}catch(_0x1e8242){return BPromise[_0xc020('0x27')](_0x1e8242);}return _0x2091db[_0xc020('0x28')]();};}function saveUpdates(_0x356e81,_0x3896d3){return function(_0x478a1f){if(_0x478a1f){return _0x478a1f[_0xc020('0x29')](_0x356e81)[_0xc020('0x2a')](function(_0x37325a){return _0x37325a;});}return null;};}function removeEntity(_0x540163,_0x114298){return function(_0x3d0c51){if(_0x3d0c51){return _0x3d0c51[_0xc020('0x2b')]()[_0xc020('0x2a')](function(){var _0x2045b1=_0x3d0c51[_0xc020('0x2c')]({'plain':!![]});var _0x10211d=_0xc020('0x2d');return db[_0xc020('0x2e')][_0xc020('0x2b')]({'where':{'type':_0x10211d,'resourceId':_0x2045b1['id']}})['then'](function(){return _0x3d0c51;});})[_0xc020('0x2a')](function(){_0x540163['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43e70f,_0x3b6e42){return function(_0x192392){if(!_0x192392){_0x43e70f['sendStatus'](0x194);}return _0x192392;};}function handleError(_0xf2a841,_0x39370e){_0x39370e=_0x39370e||0x1f4;return function(_0x1bc5f0){logger[_0xc020('0x2f')](_0x1bc5f0[_0xc020('0x30')]);if(_0x1bc5f0[_0xc020('0x31')]){delete _0x1bc5f0[_0xc020('0x31')];}_0xf2a841[_0xc020('0x1f')](_0x39370e)['send'](_0x1bc5f0);};}exports[_0xc020('0x32')]=function(_0x2cc215,_0x4c7a3b){var _0x378ee1={},_0x5aec41={},_0x2929b7={'count':0x0,'rows':[]};var _0x7fe293=_[_0xc020('0x33')](db['OpenchannelQueue'][_0xc020('0x34')],function(_0xa16da8){return{'name':_0xa16da8['fieldName'],'type':_0xa16da8[_0xc020('0x35')]['key']};});_0x5aec41['model']=_['map'](_0x7fe293,'name');_0x5aec41[_0xc020('0x36')]=_['keys'](_0x2cc215[_0xc020('0x36')]);_0x5aec41[_0xc020('0x37')]=_[_0xc020('0x38')](_0x5aec41[_0xc020('0x39')],_0x5aec41[_0xc020('0x36')]);_0x378ee1[_0xc020('0x3a')]=_[_0xc020('0x38')](_0x5aec41[_0xc020('0x39')],qs['fields'](_0x2cc215[_0xc020('0x36')][_0xc020('0x3b')]));_0x378ee1['attributes']=_0x378ee1[_0xc020('0x3a')][_0xc020('0x3c')]?_0x378ee1[_0xc020('0x3a')]:_0x5aec41['model'];if(!_0x2cc215['query'][_0xc020('0x3d')](_0xc020('0x3e'))){_0x378ee1['limit']=qs[_0xc020('0x23')](_0x2cc215[_0xc020('0x36')][_0xc020('0x23')]);_0x378ee1[_0xc020('0x21')]=qs[_0xc020('0x21')](_0x2cc215[_0xc020('0x36')][_0xc020('0x21')]);}_0x378ee1['order']=qs[_0xc020('0x3f')](_0x2cc215['query'][_0xc020('0x3f')]);_0x378ee1[_0xc020('0x40')]=qs[_0xc020('0x37')](_[_0xc020('0x41')](_0x2cc215[_0xc020('0x36')],_0x5aec41[_0xc020('0x37')]),_0x7fe293);if(_0x2cc215[_0xc020('0x36')][_0xc020('0x42')]){_0x378ee1['where']=_[_0xc020('0x43')](_0x378ee1[_0xc020('0x40')],{'$or':_[_0xc020('0x33')](_0x7fe293,function(_0x5ab1be){if(_0x5ab1be['type']!==_0xc020('0x44')){var _0x3028bf={};_0x3028bf[_0x5ab1be[_0xc020('0x31')]]={'$like':'%'+_0x2cc215[_0xc020('0x36')][_0xc020('0x42')]+'%'};return _0x3028bf;}})});}_0x378ee1=_[_0xc020('0x43')]({},_0x378ee1,_0x2cc215[_0xc020('0x45')]);var _0x5e5b20={'where':_0x378ee1[_0xc020('0x40')]};return db[_0xc020('0x46')]['count'](_0x5e5b20)[_0xc020('0x2a')](function(_0x109b4d){_0x2929b7[_0xc020('0x24')]=_0x109b4d;if(_0x2cc215[_0xc020('0x36')][_0xc020('0x47')]){_0x378ee1[_0xc020('0x48')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xc020('0x49')](_0x378ee1);})[_0xc020('0x2a')](function(_0x26266e){_0x2929b7[_0xc020('0x4a')]=_0x26266e;return _0x2929b7;})['then'](respondWithFilteredResult(_0x4c7a3b,_0x378ee1))[_0xc020('0x4b')](handleError(_0x4c7a3b,null));};exports[_0xc020('0x4c')]=function(_0x165480,_0x188cb9){var _0x186007={'raw':!![],'where':{'id':_0x165480[_0xc020('0x4d')]['id']}},_0x42da14={};_0x42da14[_0xc020('0x39')]=_[_0xc020('0x4e')](db[_0xc020('0x46')][_0xc020('0x34')]);_0x42da14['query']=_[_0xc020('0x4e')](_0x165480[_0xc020('0x36')]);_0x42da14[_0xc020('0x37')]=_[_0xc020('0x38')](_0x42da14[_0xc020('0x39')],_0x42da14['query']);_0x186007[_0xc020('0x3a')]=_[_0xc020('0x38')](_0x42da14['model'],qs['fields'](_0x165480[_0xc020('0x36')][_0xc020('0x3b')]));_0x186007['attributes']=_0x186007[_0xc020('0x3a')]['length']?_0x186007[_0xc020('0x3a')]:_0x42da14['model'];if(_0x165480['query'][_0xc020('0x47')]){_0x186007[_0xc020('0x48')]=[{'all':!![]}];}_0x186007=_[_0xc020('0x43')]({},_0x186007,_0x165480[_0xc020('0x45')]);return db['OpenchannelQueue'][_0xc020('0x4f')](_0x186007)[_0xc020('0x2a')](handleEntityNotFound(_0x188cb9,null))[_0xc020('0x2a')](respondWithResult(_0x188cb9,null))['catch'](handleError(_0x188cb9,null));};exports[_0xc020('0x50')]=function(_0x4aa401,_0x118423){return db['OpenchannelQueue'][_0xc020('0x50')](_0x4aa401[_0xc020('0x51')],{})[_0xc020('0x2a')](function(_0x4c7a9f){var _0x3b6d00=_0x4aa401['user'][_0xc020('0x2c')]({'plain':!![]});if(!_0x3b6d00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b6d00['role']===_0xc020('0x52')){var _0x4356e4=_0x4c7a9f[_0xc020('0x2c')]({'plain':!![]});var _0x36d2cb=_0xc020('0x2d');return db['UserProfileSection'][_0xc020('0x4f')]({'where':{'name':_0x36d2cb,'userProfileId':_0x3b6d00[_0xc020('0x53')]},'raw':!![]})[_0xc020('0x2a')](function(_0x252d55){if(_0x252d55&&_0x252d55[_0xc020('0x54')]===0x0){return db[_0xc020('0x2e')]['create']({'name':_0x4356e4[_0xc020('0x31')],'resourceId':_0x4356e4['id'],'type':_0x252d55[_0xc020('0x31')],'sectionId':_0x252d55['id']},{})[_0xc020('0x2a')](function(){return _0x4c7a9f;});}else{return _0x4c7a9f;}})[_0xc020('0x4b')](function(_0x55c204){logger[_0xc020('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55c204);throw _0x55c204;});}return _0x4c7a9f;})[_0xc020('0x2a')](respondWithResult(_0x118423,0xc9))[_0xc020('0x4b')](handleError(_0x118423,null));};exports[_0xc020('0x29')]=function(_0x302bbb,_0x403bb7){if(_0x302bbb['body']['id']){delete _0x302bbb[_0xc020('0x51')]['id'];}return db[_0xc020('0x46')][_0xc020('0x4f')]({'where':{'id':_0x302bbb[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](handleEntityNotFound(_0x403bb7,null))[_0xc020('0x2a')](saveUpdates(_0x302bbb['body'],null))[_0xc020('0x2a')](respondWithResult(_0x403bb7,null))[_0xc020('0x4b')](handleError(_0x403bb7,null));};exports[_0xc020('0x2b')]=function(_0x1f1a4d,_0x29ecbf){return db[_0xc020('0x46')]['find']({'where':{'id':_0x1f1a4d[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](handleEntityNotFound(_0x29ecbf,null))[_0xc020('0x2a')](removeEntity(_0x29ecbf,null))[_0xc020('0x4b')](handleError(_0x29ecbf,null));};exports[_0xc020('0x55')]=function(_0x3856bb,_0x2d7217){return db[_0xc020('0x46')]['describe']()[_0xc020('0x2a')](respondWithResult(_0x2d7217,null))[_0xc020('0x4b')](handleError(_0x2d7217,null));};exports['getMembers']=function(_0x5c93cd,_0x7fe577,_0x5a32b4){var _0x3bcafc={'raw':!![],'where':{}},_0x264f3a={},_0x3c1432;return db[_0xc020('0x46')][_0xc020('0x56')]({'where':{'id':_0x5c93cd[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](handleEntityNotFound(_0x7fe577,null))[_0xc020('0x2a')](function(_0x411524){if(_0x411524){_0x3c1432=_0x411524[_0xc020('0x2c')]({'plain':!![]});_0x264f3a[_0xc020('0x39')]=_[_0xc020('0x4e')](db[_0xc020('0x57')][_0xc020('0x34')]);_0x264f3a[_0xc020('0x36')]=_['keys'](_0x5c93cd['query']);_0x264f3a[_0xc020('0x37')]=_[_0xc020('0x38')](_0x264f3a[_0xc020('0x39')],_0x264f3a[_0xc020('0x36')]);_0x3bcafc[_0xc020('0x3a')]=_[_0xc020('0x38')](_0x264f3a[_0xc020('0x39')],qs[_0xc020('0x3b')](_0x5c93cd[_0xc020('0x36')]['fields']));_0x3bcafc[_0xc020('0x3a')]=_0x3bcafc[_0xc020('0x3a')][_0xc020('0x3c')]?_0x3bcafc[_0xc020('0x3a')]:_0x264f3a['model'];if(!_0x5c93cd[_0xc020('0x36')]['hasOwnProperty']('nolimit')){_0x3bcafc[_0xc020('0x23')]=qs['limit'](_0x5c93cd[_0xc020('0x36')][_0xc020('0x23')]);_0x3bcafc[_0xc020('0x21')]=qs[_0xc020('0x21')](_0x5c93cd[_0xc020('0x36')][_0xc020('0x21')]);}_0x3bcafc[_0xc020('0x58')]=qs[_0xc020('0x3f')](_0x5c93cd[_0xc020('0x36')][_0xc020('0x3f')]);_0x3bcafc[_0xc020('0x40')]=qs[_0xc020('0x37')](_[_0xc020('0x41')](_0x5c93cd[_0xc020('0x36')],_0x264f3a[_0xc020('0x37')]));_0x3bcafc[_0xc020('0x40')][_0xc020('0x59')]=_0x411524['id'];if(_0x5c93cd[_0xc020('0x36')]['filter']){_0x3bcafc[_0xc020('0x40')]=_[_0xc020('0x43')](_0x3bcafc[_0xc020('0x40')],{'$or':_[_0xc020('0x33')](_0x3bcafc['attributes'],function(_0x204d6f){var _0x258022={};_0x258022[_0x204d6f]={'$like':'%'+_0x5c93cd[_0xc020('0x36')][_0xc020('0x42')]+'%'};return _0x258022;})});}_0x3bcafc=_[_0xc020('0x43')]({},_0x3bcafc,_0x5c93cd[_0xc020('0x45')]);return db[_0xc020('0x57')][_0xc020('0x49')](_0x3bcafc);}})[_0xc020('0x2a')](function(_0x59c942){if(_0x59c942){return db[_0xc020('0x5a')][_0xc020('0x5b')]({'where':{'id':_[_0xc020('0x33')](_0x59c942,_0xc020('0x5c')),'role':_0xc020('0x5d')},'attributes':['id',_0xc020('0x31'),_0xc020('0x5e'),_0xc020('0x5f'),'createdAt']});}})[_0xc020('0x2a')](function(_0x2ca4d8){if(_0x2ca4d8){return{'count':_0x2ca4d8[_0xc020('0x24')],'rows':_['map'](_0x2ca4d8[_0xc020('0x4a')],function(_0x26343a){return{'membername':_0x26343a[_0xc020('0x31')],'UserId':_0x26343a['id'],'queue_name':_0x3c1432[_0xc020('0x31')],'OpenchannelQueueId':_0x3c1432['id'],'interface':util[_0xc020('0x60')](_0xc020('0x61'),_0xc020('0x62'),_0x26343a[_0xc020('0x31')]),'penalty':0x0,'paused':_0x26343a[_0xc020('0x5e')],'createdAt':_0x26343a['createdAt'],'updatedAt':_0x26343a[_0xc020('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc020('0x2a')](respondWithFilteredResult(_0x7fe577,_0x3bcafc))[_0xc020('0x4b')](handleError(_0x7fe577,null));};exports['getTeams']=function(_0x5951be,_0x551597,_0x3a2e4d){var _0x35db6a={};var _0x312d4f={};var _0x286d6b;var _0x3778fe;return db[_0xc020('0x46')]['findOne']({'where':{'id':_0x5951be[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](handleEntityNotFound(_0x551597,null))[_0xc020('0x2a')](function(_0x1836d5){if(_0x1836d5){_0x286d6b=_0x1836d5;_0x312d4f['model']=_['keys'](db[_0xc020('0x63')][_0xc020('0x34')]);_0x312d4f[_0xc020('0x36')]=_[_0xc020('0x4e')](_0x5951be[_0xc020('0x36')]);_0x312d4f['filters']=_[_0xc020('0x38')](_0x312d4f[_0xc020('0x39')],_0x312d4f[_0xc020('0x36')]);_0x35db6a['attributes']=_[_0xc020('0x38')](_0x312d4f[_0xc020('0x39')],qs[_0xc020('0x3b')](_0x5951be[_0xc020('0x36')][_0xc020('0x3b')]));_0x35db6a[_0xc020('0x3a')]=_0x35db6a[_0xc020('0x3a')][_0xc020('0x3c')]?_0x35db6a['attributes']:_0x312d4f['model'];_0x35db6a['order']=qs['sort'](_0x5951be[_0xc020('0x36')][_0xc020('0x3f')]);_0x35db6a['where']=qs[_0xc020('0x37')](_[_0xc020('0x41')](_0x5951be[_0xc020('0x36')],_0x312d4f[_0xc020('0x37')]));if(_0x5951be[_0xc020('0x36')][_0xc020('0x42')]){_0x35db6a['where']=_['merge'](_0x35db6a[_0xc020('0x40')],{'$or':_['map'](_0x35db6a[_0xc020('0x3a')],function(_0x54669b){var _0x2b190b={};_0x2b190b[_0x54669b]={'$like':'%'+_0x5951be[_0xc020('0x36')][_0xc020('0x42')]+'%'};return _0x2b190b;})});}_0x35db6a=_[_0xc020('0x43')]({},_0x35db6a,_0x5951be[_0xc020('0x45')]);return _0x286d6b[_0xc020('0x64')](_0x35db6a);}})[_0xc020('0x2a')](function(_0x3f7a1e){if(_0x3f7a1e){_0x3778fe=_0x3f7a1e[_0xc020('0x3c')];if(!_0x5951be[_0xc020('0x36')]['hasOwnProperty'](_0xc020('0x3e'))){_0x35db6a['limit']=qs[_0xc020('0x23')](_0x5951be[_0xc020('0x36')]['limit']);_0x35db6a[_0xc020('0x21')]=qs['offset'](_0x5951be[_0xc020('0x36')][_0xc020('0x21')]);}return _0x286d6b[_0xc020('0x64')](_0x35db6a);}})['then'](function(_0xf47f3){if(_0xf47f3){return _0xf47f3?{'count':_0x3778fe,'rows':_0xf47f3}:null;}})['then'](respondWithResult(_0x551597,null))['catch'](handleError(_0x551597,null));};exports[_0xc020('0x65')]=function(_0xe2adc5,_0x2cc113,_0x450e94){var _0x315403=_0xe2adc5['body']['ids'];return db['Team'][_0xc020('0x49')]({'where':{'id':_0x315403},'attributes':['id'],'include':[{'model':db[_0xc020('0x5a')],'as':_0xc020('0x66'),'attributes':['id',_0xc020('0x31'),_0xc020('0x67'),'voicePause',_0xc020('0x68')],'raw':!![]}]})[_0xc020('0x2a')](function(_0x534704){if(_0x534704){var _0x3d5c7a=_['flatMap'](_0x534704,function(_0x4264e6){var _0x3eb5df=_0x4264e6[_0xc020('0x2c')]({'plain':!![]});return _0x3eb5df['Agents'];});return db[_0xc020('0x46')][_0xc020('0x4f')]({'where':{'id':_0xe2adc5[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](function(_0x4c3466){return db[_0xc020('0x69')]['transaction'](function(_0x49fec2){return _0x4c3466[_0xc020('0x65')](_0x315403,{'transaction':_0x49fec2})[_0xc020('0x2a')](function(){return BPromise[_0xc020('0x6a')](_0x3d5c7a,function(_0x190fc9){return db[_0xc020('0x57')]['findOrCreate']({'where':{'UserId':_0x190fc9['id'],'OpenchannelQueueId':_0xe2adc5['params']['id']},'transaction':_0x49fec2});});})[_0xc020('0x2a')](function(){_0x3d5c7a['forEach'](function(_0x4ac509){socket[_0xc020('0x6b')](_0xc020('0x6c'),{'UserId':_0x4ac509['id'],'OpenchannelQueueId':_0x4c3466['id']});});});});});}})[_0xc020('0x2a')](respondWithStatusCode(_0x2cc113,null))['catch'](handleError(_0x2cc113,null));};exports['removeTeams']=function(_0x978767,_0x3c2f70,_0x3f4d1c){return db['Team']['findAll']({'where':{'id':_0x978767['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xc020('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3c2f70,null))[_0xc020('0x2a')](function(_0x341c4b){var _0x20c870=_[_0xc020('0x33')](_0x341c4b,'id');var _0x103217=[];var _0x173a45=[];var _0x2a43a4=squel['select']();_0x2a43a4[_0xc020('0x6d')](_0xc020('0x6e'))[_0xc020('0x6f')](_0xc020('0x70'),'tq')[_0xc020('0x71')](_0xc020('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc020('0x40')]('OpenchannelQueueId\x20=\x20?',_0x978767[_0xc020('0x4d')]['id']);for(var _0x616f17=0x0;_0x616f17<_0x341c4b['length'];_0x616f17+=0x1){let _0x2d901e=_0x341c4b[_0x616f17];for(var _0x5b5927=0x0;_0x5b5927<_0x2d901e[_0xc020('0x66')][_0xc020('0x3c')];_0x5b5927+=0x1){let _0x54dd6a=_0x2d901e['Agents'][_0x5b5927];var _0x54b044=_0x2a43a4[_0xc020('0x73')]();_0x54b044[_0xc020('0x40')](_0xc020('0x74'),_0x54dd6a['id']);_0x173a45[_0xc020('0x75')](db['sequelize'][_0xc020('0x36')](_0x54b044[_0xc020('0x76')](),{'type':db[_0xc020('0x69')][_0xc020('0x77')][_0xc020('0x78')]})[_0xc020('0x2a')](function(_0x371510){if(_0x371510[_0xc020('0x3c')]===0x1){return _0x54dd6a['id'];}else{var _0x7f8c24=_[_0xc020('0x79')](_[_0xc020('0x33')](_0x371510,_0xc020('0x7a')),function(_0x3eecb2){return _[_0xc020('0x7b')](_0x20c870,_0x3eecb2);});if(_0x7f8c24){return _0x54dd6a['id'];}}}));}}return BPromise[_0xc020('0x7c')](_0x173a45)[_0xc020('0x2a')](function(_0x796473){_0x103217=_(_0x103217)[_0xc020('0x7d')](_0x796473)['compact']()[_0xc020('0x7e')]();return db[_0xc020('0x46')][_0xc020('0x4f')]({'where':{'id':_0x978767[_0xc020('0x4d')]['id']}})['then'](function(_0x1ec40d){return db[_0xc020('0x69')]['transaction'](function(_0x45c8ca){return _0x1ec40d[_0xc020('0x7f')](_0x978767[_0xc020('0x36')]['ids'],{'transaction':_0x45c8ca})['then'](function(){if(!_['isEmpty'](_0x103217)){return _0x1ec40d[_0xc020('0x80')](_0x103217,{'transaction':_0x45c8ca});}})['then'](function(){_0x103217[_0xc020('0x81')](function(_0x1f8d7e){socket[_0xc020('0x6b')](_0xc020('0x82'),{'UserId':_0x1f8d7e,'OpenchannelQueueId':_0x1ec40d['id']});});});});});});})[_0xc020('0x2a')](respondWithStatusCode(_0x3c2f70,null))['catch'](handleError(_0x3c2f70,null));};exports[_0xc020('0x83')]=function(_0x1c19a7,_0x45314d,_0x4fb2a1){return db[_0xc020('0x46')][_0xc020('0x4f')]({'where':{'id':_0x1c19a7[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](handleEntityNotFound(_0x45314d,null))[_0xc020('0x2a')](function(_0x4c13e7){if(_0x4c13e7){return _0x4c13e7[_0xc020('0x83')](_0x1c19a7[_0xc020('0x51')][_0xc020('0x84')],_[_0xc020('0x85')](_0x1c19a7[_0xc020('0x51')],[_0xc020('0x84'),'id'])||{})[_0xc020('0x86')](function(_0xc8bc59){for(var _0x470d8b=0x0;_0x470d8b<_0x1c19a7['body'][_0xc020('0x84')][_0xc020('0x3c')];_0x470d8b+=0x1){socket[_0xc020('0x6b')](_0xc020('0x6c'),{'UserId':Number(_0x1c19a7[_0xc020('0x51')][_0xc020('0x84')][_0x470d8b]),'OpenchannelQueueId':Number(_0x1c19a7['params']['id'])});}return _0xc8bc59;});}})[_0xc020('0x2a')](respondWithResult(_0x45314d,null))['catch'](handleError(_0x45314d,null));};exports[_0xc020('0x80')]=function(_0x2ccda3,_0x59cc25,_0x3ce9df){return db[_0xc020('0x46')]['find']({'where':{'id':_0x2ccda3[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](handleEntityNotFound(_0x59cc25,null))[_0xc020('0x2a')](function(_0x39b1cd){if(_0x39b1cd){return _0x39b1cd['removeAgents'](_0x2ccda3[_0xc020('0x36')][_0xc020('0x84')])[_0xc020('0x2a')](function(){if(_[_0xc020('0x87')](_0x2ccda3[_0xc020('0x36')][_0xc020('0x84')])){for(var _0x35b784=0x0;_0x35b784<_0x2ccda3['query'][_0xc020('0x84')][_0xc020('0x3c')];_0x35b784+=0x1){socket[_0xc020('0x6b')](_0xc020('0x82'),{'UserId':Number(_0x2ccda3[_0xc020('0x36')]['ids'][_0x35b784]),'OpenchannelQueueId':Number(_0x2ccda3[_0xc020('0x4d')]['id'])});}}else{socket[_0xc020('0x6b')](_0xc020('0x82'),{'UserId':Number(_0x2ccda3[_0xc020('0x36')][_0xc020('0x84')]),'OpenchannelQueueId':Number(_0x2ccda3[_0xc020('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x59cc25,null))['catch'](handleError(_0x59cc25,null));};exports['getAgents']=function(_0x347dd1,_0x4dfd4c,_0xb4692e){var _0x50a788={};var _0x3d25df={};var _0x2d44f3;var _0x138d0e;return db[_0xc020('0x46')][_0xc020('0x56')]({'where':{'id':_0x347dd1[_0xc020('0x4d')]['id']}})[_0xc020('0x2a')](handleEntityNotFound(_0x4dfd4c,null))[_0xc020('0x2a')](function(_0x531836){if(_0x531836){_0x2d44f3=_0x531836;_0x3d25df[_0xc020('0x39')]=_['keys'](db[_0xc020('0x5a')][_0xc020('0x34')]);_0x3d25df[_0xc020('0x36')]=_[_0xc020('0x4e')](_0x347dd1[_0xc020('0x36')]);_0x3d25df[_0xc020('0x37')]=_[_0xc020('0x38')](_0x3d25df[_0xc020('0x39')],_0x3d25df[_0xc020('0x36')]);_0x50a788[_0xc020('0x3a')]=_['intersection'](_0x3d25df[_0xc020('0x39')],qs[_0xc020('0x3b')](_0x347dd1['query']['fields']));_0x50a788[_0xc020('0x3a')]=_0x50a788[_0xc020('0x3a')]['length']?_0x50a788[_0xc020('0x3a')]:_0x3d25df[_0xc020('0x39')];_0x50a788[_0xc020('0x58')]=qs[_0xc020('0x3f')](_0x347dd1[_0xc020('0x36')][_0xc020('0x3f')]);_0x50a788[_0xc020('0x40')]=qs[_0xc020('0x37')](_['pick'](_0x347dd1['query'],_0x3d25df[_0xc020('0x37')]));if(_0x347dd1[_0xc020('0x36')][_0xc020('0x42')]){_0x50a788[_0xc020('0x40')]=_[_0xc020('0x43')](_0x50a788[_0xc020('0x40')],{'$or':_['map'](_0x50a788['attributes'],function(_0x395b69){var _0x38821f={};_0x38821f[_0x395b69]={'$like':'%'+_0x347dd1[_0xc020('0x36')][_0xc020('0x42')]+'%'};return _0x38821f;})});}_0x50a788=_[_0xc020('0x43')]({},_0x50a788,_0x347dd1[_0xc020('0x45')]);return _0x2d44f3[_0xc020('0x88')](_0x50a788);}})['then'](function(_0x339d01){if(_0x339d01){_0x138d0e=_0x339d01[_0xc020('0x3c')];if(!_0x347dd1['query'][_0xc020('0x3d')](_0xc020('0x3e'))){_0x50a788[_0xc020('0x23')]=qs[_0xc020('0x23')](_0x347dd1[_0xc020('0x36')][_0xc020('0x23')]);_0x50a788[_0xc020('0x21')]=qs[_0xc020('0x21')](_0x347dd1[_0xc020('0x36')][_0xc020('0x21')]);}return _0x2d44f3[_0xc020('0x88')](_0x50a788);}})[_0xc020('0x2a')](function(_0x129851){if(_0x129851){return _0x129851?{'count':_0x138d0e,'rows':_0x129851}:null;}})[_0xc020('0x2a')](respondWithResult(_0x4dfd4c,null))['catch'](handleError(_0x4dfd4c,null));}; \ No newline at end of file +var _0xb03e=['addTeams','Team','Agents','voicePause','interface','flatMap','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','ids','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','../../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','./openchannelQueue.socket','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','status','name','send','index','map','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueue','includeAll','include','findAll','catch','show','params','options','create','body','user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams'];(function(_0x44d43d,_0x393245){var _0x135f94=function(_0x37ee52){while(--_0x37ee52){_0x44d43d['push'](_0x44d43d['shift']());}};_0x135f94(++_0x393245);}(_0xb03e,0xb4));var _0xeb03=function(_0x212799,_0x42332b){_0x212799=_0x212799-0x0;var _0x4ab654=_0xb03e[_0x212799];return _0x4ab654;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb03('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb03('0x1'));var moment=require(_0xeb03('0x2'));var BPromise=require(_0xeb03('0x3'));var Mustache=require(_0xeb03('0x4'));var util=require('util');var path=require('path');var sox=require(_0xeb03('0x5'));var csv=require(_0xeb03('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb03('0x7'));var _=require('lodash');var squel=require(_0xeb03('0x8'));var crypto=require('crypto');var jsforce=require(_0xeb03('0x9'));var deskjs=require(_0xeb03('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeb03('0xb'));var Redis=require('ioredis');var authService=require(_0xeb03('0xc'));var qs=require(_0xeb03('0xd'));var as=require(_0xeb03('0xe'));var hardwareService=require(_0xeb03('0xf'));var logger=require(_0xeb03('0x10'))(_0xeb03('0x11'));var utils=require(_0xeb03('0x12'));var config=require(_0xeb03('0x13'));var licenseUtil=require(_0xeb03('0x14'));var db=require(_0xeb03('0x15'))['db'];config['redis']=_[_0xeb03('0x16')](config[_0xeb03('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb03('0x18'))(new Redis(config[_0xeb03('0x17')]));require(_0xeb03('0x19'))['register'](socket);function respondWithStatusCode(_0x966100,_0x1c21f5){_0x1c21f5=_0x1c21f5||0xcc;return function(_0x2d00d4){if(_0x2d00d4){return _0x966100[_0xeb03('0x1a')](_0x1c21f5);}return _0x966100['status'](_0x1c21f5)[_0xeb03('0x1b')]();};}function respondWithResult(_0x1e22f2,_0x42388c){_0x42388c=_0x42388c||0xc8;return function(_0x4652ab){if(_0x4652ab){return _0x1e22f2['status'](_0x42388c)[_0xeb03('0x1c')](_0x4652ab);}};}function respondWithFilteredResult(_0x404f97,_0x29c3f6){return function(_0x420b5f){if(_0x420b5f){var _0x3db56e=typeof _0x29c3f6[_0xeb03('0x1d')]===_0xeb03('0x1e')&&typeof _0x29c3f6[_0xeb03('0x1f')]==='undefined';var _0xe2160=_0x420b5f[_0xeb03('0x20')];var _0x3d8ae2=_0x3db56e?0x0:_0x29c3f6['offset'];var _0x528c4e=_0x3db56e?_0x420b5f[_0xeb03('0x20')]:_0x29c3f6[_0xeb03('0x1d')]+_0x29c3f6[_0xeb03('0x1f')];var _0x4e1443;if(_0x528c4e>=_0xe2160){_0x528c4e=_0xe2160;_0x4e1443=0xc8;}else{_0x4e1443=0xce;}_0x404f97['status'](_0x4e1443);return _0x404f97[_0xeb03('0x21')](_0xeb03('0x22'),_0x3d8ae2+'-'+_0x528c4e+'/'+_0xe2160)[_0xeb03('0x1c')](_0x420b5f);}return null;};}function patchUpdates(_0x2e755f){return function(_0x48fdec){try{jsonpatch[_0xeb03('0x23')](_0x48fdec,_0x2e755f,!![]);}catch(_0x32860e){return BPromise[_0xeb03('0x24')](_0x32860e);}return _0x48fdec[_0xeb03('0x25')]();};}function saveUpdates(_0x1497f0,_0x52c0fa){return function(_0x3dd011){if(_0x3dd011){return _0x3dd011[_0xeb03('0x26')](_0x1497f0)[_0xeb03('0x27')](function(_0x5ea682){return _0x5ea682;});}return null;};}function removeEntity(_0x79a8d5,_0x3a4624){return function(_0x3d601e){if(_0x3d601e){return _0x3d601e[_0xeb03('0x28')]()[_0xeb03('0x27')](function(){var _0xe052ec=_0x3d601e[_0xeb03('0x29')]({'plain':!![]});var _0xc8c92c='OpenchannelQueues';return db[_0xeb03('0x2a')][_0xeb03('0x28')]({'where':{'type':_0xc8c92c,'resourceId':_0xe052ec['id']}})[_0xeb03('0x27')](function(){return _0x3d601e;});})[_0xeb03('0x27')](function(){_0x79a8d5[_0xeb03('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x585c55,_0xf04bd0){return function(_0x4b78a0){if(!_0x4b78a0){_0x585c55[_0xeb03('0x1a')](0x194);}return _0x4b78a0;};}function handleError(_0x560d6c,_0x47a9dd){_0x47a9dd=_0x47a9dd||0x1f4;return function(_0x2afa17){logger['error'](_0x2afa17['stack']);if(_0x2afa17['name']){delete _0x2afa17[_0xeb03('0x2c')];}_0x560d6c[_0xeb03('0x2b')](_0x47a9dd)[_0xeb03('0x2d')](_0x2afa17);};}exports[_0xeb03('0x2e')]=function(_0x396ce8,_0x3e9c93){var _0x5c4dec={},_0x4f582b={},_0x9a57b={'count':0x0,'rows':[]};var _0x5568b0=_[_0xeb03('0x2f')](db['OpenchannelQueue'][_0xeb03('0x30')],function(_0x32892d){return{'name':_0x32892d['fieldName'],'type':_0x32892d[_0xeb03('0x31')]['key']};});_0x4f582b['model']=_[_0xeb03('0x2f')](_0x5568b0,_0xeb03('0x2c'));_0x4f582b[_0xeb03('0x32')]=_[_0xeb03('0x33')](_0x396ce8[_0xeb03('0x32')]);_0x4f582b[_0xeb03('0x34')]=_['intersection'](_0x4f582b[_0xeb03('0x35')],_0x4f582b[_0xeb03('0x32')]);_0x5c4dec[_0xeb03('0x36')]=_[_0xeb03('0x37')](_0x4f582b[_0xeb03('0x35')],qs[_0xeb03('0x38')](_0x396ce8[_0xeb03('0x32')][_0xeb03('0x38')]));_0x5c4dec['attributes']=_0x5c4dec[_0xeb03('0x36')][_0xeb03('0x39')]?_0x5c4dec[_0xeb03('0x36')]:_0x4f582b[_0xeb03('0x35')];if(!_0x396ce8['query'][_0xeb03('0x3a')]('nolimit')){_0x5c4dec[_0xeb03('0x1f')]=qs[_0xeb03('0x1f')](_0x396ce8[_0xeb03('0x32')][_0xeb03('0x1f')]);_0x5c4dec[_0xeb03('0x1d')]=qs[_0xeb03('0x1d')](_0x396ce8[_0xeb03('0x32')]['offset']);}_0x5c4dec['order']=qs[_0xeb03('0x3b')](_0x396ce8['query'][_0xeb03('0x3b')]);_0x5c4dec[_0xeb03('0x3c')]=qs[_0xeb03('0x34')](_[_0xeb03('0x3d')](_0x396ce8[_0xeb03('0x32')],_0x4f582b['filters']),_0x5568b0);if(_0x396ce8[_0xeb03('0x32')][_0xeb03('0x3e')]){_0x5c4dec[_0xeb03('0x3c')]=_[_0xeb03('0x3f')](_0x5c4dec[_0xeb03('0x3c')],{'$or':_[_0xeb03('0x2f')](_0x5568b0,function(_0x3aa1d8){if(_0x3aa1d8[_0xeb03('0x31')]!==_0xeb03('0x40')){var _0x2da2a7={};_0x2da2a7[_0x3aa1d8[_0xeb03('0x2c')]]={'$like':'%'+_0x396ce8[_0xeb03('0x32')]['filter']+'%'};return _0x2da2a7;}})});}_0x5c4dec=_['merge']({},_0x5c4dec,_0x396ce8['options']);var _0x34e706={'where':_0x5c4dec['where']};return db[_0xeb03('0x41')][_0xeb03('0x20')](_0x34e706)[_0xeb03('0x27')](function(_0x3994be){_0x9a57b[_0xeb03('0x20')]=_0x3994be;if(_0x396ce8['query'][_0xeb03('0x42')]){_0x5c4dec[_0xeb03('0x43')]=[{'all':!![]}];}return db[_0xeb03('0x41')][_0xeb03('0x44')](_0x5c4dec);})[_0xeb03('0x27')](function(_0x4a78b8){_0x9a57b['rows']=_0x4a78b8;return _0x9a57b;})[_0xeb03('0x27')](respondWithFilteredResult(_0x3e9c93,_0x5c4dec))[_0xeb03('0x45')](handleError(_0x3e9c93,null));};exports[_0xeb03('0x46')]=function(_0x29ea66,_0x534a4a){var _0x42ccdd={'raw':!![],'where':{'id':_0x29ea66[_0xeb03('0x47')]['id']}},_0xcc90b1={};_0xcc90b1[_0xeb03('0x35')]=_['keys'](db[_0xeb03('0x41')][_0xeb03('0x30')]);_0xcc90b1['query']=_[_0xeb03('0x33')](_0x29ea66['query']);_0xcc90b1[_0xeb03('0x34')]=_[_0xeb03('0x37')](_0xcc90b1['model'],_0xcc90b1[_0xeb03('0x32')]);_0x42ccdd[_0xeb03('0x36')]=_[_0xeb03('0x37')](_0xcc90b1['model'],qs[_0xeb03('0x38')](_0x29ea66[_0xeb03('0x32')][_0xeb03('0x38')]));_0x42ccdd[_0xeb03('0x36')]=_0x42ccdd[_0xeb03('0x36')]['length']?_0x42ccdd['attributes']:_0xcc90b1['model'];if(_0x29ea66['query'][_0xeb03('0x42')]){_0x42ccdd[_0xeb03('0x43')]=[{'all':!![]}];}_0x42ccdd=_[_0xeb03('0x3f')]({},_0x42ccdd,_0x29ea66[_0xeb03('0x48')]);return db['OpenchannelQueue']['find'](_0x42ccdd)[_0xeb03('0x27')](handleEntityNotFound(_0x534a4a,null))['then'](respondWithResult(_0x534a4a,null))[_0xeb03('0x45')](handleError(_0x534a4a,null));};exports[_0xeb03('0x49')]=function(_0x205ab5,_0x438c8f){return db['OpenchannelQueue'][_0xeb03('0x49')](_0x205ab5[_0xeb03('0x4a')],{})[_0xeb03('0x27')](function(_0x80531e){var _0x20cf8f=_0x205ab5[_0xeb03('0x4b')][_0xeb03('0x29')]({'plain':!![]});if(!_0x20cf8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20cf8f['role']===_0xeb03('0x4b')){var _0xcf40f7=_0x80531e['get']({'plain':!![]});var _0x25acc1=_0xeb03('0x4c');return db[_0xeb03('0x4d')]['find']({'where':{'name':_0x25acc1,'userProfileId':_0x20cf8f[_0xeb03('0x4e')]},'raw':!![]})[_0xeb03('0x27')](function(_0x5971f8){if(_0x5971f8&&_0x5971f8[_0xeb03('0x4f')]===0x0){return db[_0xeb03('0x2a')]['create']({'name':_0xcf40f7['name'],'resourceId':_0xcf40f7['id'],'type':_0x5971f8[_0xeb03('0x2c')],'sectionId':_0x5971f8['id']},{})[_0xeb03('0x27')](function(){return _0x80531e;});}else{return _0x80531e;}})[_0xeb03('0x45')](function(_0x20b184){logger[_0xeb03('0x50')](_0xeb03('0x51'),_0x20b184);throw _0x20b184;});}return _0x80531e;})[_0xeb03('0x27')](respondWithResult(_0x438c8f,0xc9))[_0xeb03('0x45')](handleError(_0x438c8f,null));};exports[_0xeb03('0x26')]=function(_0x1135f9,_0x32f384){if(_0x1135f9[_0xeb03('0x4a')]['id']){delete _0x1135f9['body']['id'];}return db['OpenchannelQueue'][_0xeb03('0x52')]({'where':{'id':_0x1135f9[_0xeb03('0x47')]['id']}})[_0xeb03('0x27')](handleEntityNotFound(_0x32f384,null))['then'](saveUpdates(_0x1135f9[_0xeb03('0x4a')],null))[_0xeb03('0x27')](respondWithResult(_0x32f384,null))[_0xeb03('0x45')](handleError(_0x32f384,null));};exports[_0xeb03('0x28')]=function(_0x1f183a,_0x52eb87){return db[_0xeb03('0x41')][_0xeb03('0x52')]({'where':{'id':_0x1f183a['params']['id']}})['then'](handleEntityNotFound(_0x52eb87,null))[_0xeb03('0x27')](removeEntity(_0x52eb87,null))[_0xeb03('0x45')](handleError(_0x52eb87,null));};exports[_0xeb03('0x53')]=function(_0x66d3f2,_0x421070){return db[_0xeb03('0x41')][_0xeb03('0x53')]()[_0xeb03('0x27')](respondWithResult(_0x421070,null))[_0xeb03('0x45')](handleError(_0x421070,null));};exports[_0xeb03('0x54')]=function(_0x2215bb,_0x54c1f4,_0x32e3f3){var _0x3e99ef={'raw':!![],'where':{}},_0x376a1c={},_0x5d9a6a;return db[_0xeb03('0x41')][_0xeb03('0x55')]({'where':{'id':_0x2215bb['params']['id']}})[_0xeb03('0x27')](handleEntityNotFound(_0x54c1f4,null))[_0xeb03('0x27')](function(_0x55f3bd){if(_0x55f3bd){_0x5d9a6a=_0x55f3bd[_0xeb03('0x29')]({'plain':!![]});_0x376a1c[_0xeb03('0x35')]=_['keys'](db[_0xeb03('0x56')][_0xeb03('0x30')]);_0x376a1c['query']=_[_0xeb03('0x33')](_0x2215bb[_0xeb03('0x32')]);_0x376a1c[_0xeb03('0x34')]=_['intersection'](_0x376a1c[_0xeb03('0x35')],_0x376a1c[_0xeb03('0x32')]);_0x3e99ef[_0xeb03('0x36')]=_[_0xeb03('0x37')](_0x376a1c[_0xeb03('0x35')],qs[_0xeb03('0x38')](_0x2215bb[_0xeb03('0x32')][_0xeb03('0x38')]));_0x3e99ef[_0xeb03('0x36')]=_0x3e99ef[_0xeb03('0x36')][_0xeb03('0x39')]?_0x3e99ef[_0xeb03('0x36')]:_0x376a1c[_0xeb03('0x35')];if(!_0x2215bb[_0xeb03('0x32')][_0xeb03('0x3a')](_0xeb03('0x57'))){_0x3e99ef['limit']=qs[_0xeb03('0x1f')](_0x2215bb[_0xeb03('0x32')][_0xeb03('0x1f')]);_0x3e99ef['offset']=qs[_0xeb03('0x1d')](_0x2215bb[_0xeb03('0x32')][_0xeb03('0x1d')]);}_0x3e99ef[_0xeb03('0x58')]=qs['sort'](_0x2215bb[_0xeb03('0x32')][_0xeb03('0x3b')]);_0x3e99ef[_0xeb03('0x3c')]=qs[_0xeb03('0x34')](_['pick'](_0x2215bb[_0xeb03('0x32')],_0x376a1c[_0xeb03('0x34')]));_0x3e99ef[_0xeb03('0x3c')][_0xeb03('0x59')]=_0x55f3bd['id'];if(_0x2215bb[_0xeb03('0x32')][_0xeb03('0x3e')]){_0x3e99ef[_0xeb03('0x3c')]=_['merge'](_0x3e99ef[_0xeb03('0x3c')],{'$or':_['map'](_0x3e99ef['attributes'],function(_0x47d532){var _0x5db3d0={};_0x5db3d0[_0x47d532]={'$like':'%'+_0x2215bb[_0xeb03('0x32')][_0xeb03('0x3e')]+'%'};return _0x5db3d0;})});}_0x3e99ef=_['merge']({},_0x3e99ef,_0x2215bb[_0xeb03('0x48')]);return db[_0xeb03('0x56')][_0xeb03('0x44')](_0x3e99ef);}})[_0xeb03('0x27')](function(_0x6b1c0a){if(_0x6b1c0a){return db[_0xeb03('0x5a')][_0xeb03('0x5b')]({'where':{'id':_[_0xeb03('0x2f')](_0x6b1c0a,_0xeb03('0x5c')),'role':_0xeb03('0x5d')},'attributes':['id',_0xeb03('0x2c'),_0xeb03('0x5e'),_0xeb03('0x5f'),'createdAt']});}})[_0xeb03('0x27')](function(_0x50ffb2){if(_0x50ffb2){return{'count':_0x50ffb2[_0xeb03('0x20')],'rows':_[_0xeb03('0x2f')](_0x50ffb2[_0xeb03('0x60')],function(_0x497f62){return{'membername':_0x497f62['name'],'UserId':_0x497f62['id'],'queue_name':_0x5d9a6a[_0xeb03('0x2c')],'OpenchannelQueueId':_0x5d9a6a['id'],'interface':util[_0xeb03('0x61')](_0xeb03('0x62'),_0xeb03('0x63'),_0x497f62[_0xeb03('0x2c')]),'penalty':0x0,'paused':_0x497f62[_0xeb03('0x5e')],'createdAt':_0x497f62[_0xeb03('0x64')],'updatedAt':_0x497f62[_0xeb03('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x54c1f4,_0x3e99ef))[_0xeb03('0x45')](handleError(_0x54c1f4,null));};exports[_0xeb03('0x65')]=function(_0x1fef7e,_0x57f965,_0x24eb51){var _0x43a39d={};var _0x240685={};var _0x432bee;var _0x3e6f4c;return db[_0xeb03('0x41')]['findOne']({'where':{'id':_0x1fef7e[_0xeb03('0x47')]['id']}})[_0xeb03('0x27')](handleEntityNotFound(_0x57f965,null))['then'](function(_0x52877c){if(_0x52877c){_0x432bee=_0x52877c;_0x240685['model']=_[_0xeb03('0x33')](db['Team']['rawAttributes']);_0x240685['query']=_[_0xeb03('0x33')](_0x1fef7e[_0xeb03('0x32')]);_0x240685['filters']=_[_0xeb03('0x37')](_0x240685[_0xeb03('0x35')],_0x240685[_0xeb03('0x32')]);_0x43a39d[_0xeb03('0x36')]=_[_0xeb03('0x37')](_0x240685['model'],qs[_0xeb03('0x38')](_0x1fef7e[_0xeb03('0x32')][_0xeb03('0x38')]));_0x43a39d[_0xeb03('0x36')]=_0x43a39d['attributes'][_0xeb03('0x39')]?_0x43a39d['attributes']:_0x240685['model'];_0x43a39d[_0xeb03('0x58')]=qs[_0xeb03('0x3b')](_0x1fef7e['query'][_0xeb03('0x3b')]);_0x43a39d[_0xeb03('0x3c')]=qs['filters'](_[_0xeb03('0x3d')](_0x1fef7e['query'],_0x240685[_0xeb03('0x34')]));if(_0x1fef7e[_0xeb03('0x32')][_0xeb03('0x3e')]){_0x43a39d[_0xeb03('0x3c')]=_[_0xeb03('0x3f')](_0x43a39d[_0xeb03('0x3c')],{'$or':_[_0xeb03('0x2f')](_0x43a39d[_0xeb03('0x36')],function(_0x451cfc){var _0x5c477e={};_0x5c477e[_0x451cfc]={'$like':'%'+_0x1fef7e[_0xeb03('0x32')][_0xeb03('0x3e')]+'%'};return _0x5c477e;})});}_0x43a39d=_[_0xeb03('0x3f')]({},_0x43a39d,_0x1fef7e[_0xeb03('0x48')]);return _0x432bee[_0xeb03('0x65')](_0x43a39d);}})['then'](function(_0x40d9a2){if(_0x40d9a2){_0x3e6f4c=_0x40d9a2['length'];if(!_0x1fef7e[_0xeb03('0x32')][_0xeb03('0x3a')](_0xeb03('0x57'))){_0x43a39d[_0xeb03('0x1f')]=qs[_0xeb03('0x1f')](_0x1fef7e[_0xeb03('0x32')][_0xeb03('0x1f')]);_0x43a39d['offset']=qs['offset'](_0x1fef7e[_0xeb03('0x32')][_0xeb03('0x1d')]);}return _0x432bee[_0xeb03('0x65')](_0x43a39d);}})[_0xeb03('0x27')](function(_0x102cac){if(_0x102cac){return _0x102cac?{'count':_0x3e6f4c,'rows':_0x102cac}:null;}})[_0xeb03('0x27')](respondWithResult(_0x57f965,null))[_0xeb03('0x45')](handleError(_0x57f965,null));};exports[_0xeb03('0x66')]=function(_0x1094ed,_0x7d2b11,_0x65f9d6){var _0x23fd93=_0x1094ed['body']['ids'];return db[_0xeb03('0x67')][_0xeb03('0x44')]({'where':{'id':_0x23fd93},'attributes':['id'],'include':[{'model':db[_0xeb03('0x5a')],'as':_0xeb03('0x68'),'attributes':['id',_0xeb03('0x2c'),'online',_0xeb03('0x69'),_0xeb03('0x6a')],'raw':!![]}]})[_0xeb03('0x27')](function(_0x2f816f){if(_0x2f816f){var _0x5d365f=_[_0xeb03('0x6b')](_0x2f816f,function(_0xf09915){var _0x1eb8a9=_0xf09915['get']({'plain':!![]});return _0x1eb8a9[_0xeb03('0x68')];});return db[_0xeb03('0x41')][_0xeb03('0x52')]({'where':{'id':_0x1094ed['params']['id']}})[_0xeb03('0x27')](function(_0x1fa9cc){return db['sequelize']['transaction'](function(_0x332d03){return _0x1fa9cc[_0xeb03('0x66')](_0x23fd93,{'transaction':_0x332d03})[_0xeb03('0x27')](function(){return BPromise[_0xeb03('0x6c')](_0x5d365f,function(_0x29bc96){return db[_0xeb03('0x56')]['findOrCreate']({'where':{'UserId':_0x29bc96['id'],'OpenchannelQueueId':_0x1094ed[_0xeb03('0x47')]['id']},'transaction':_0x332d03});});})[_0xeb03('0x27')](function(){_0x5d365f[_0xeb03('0x6d')](function(_0x54ae96){socket[_0xeb03('0x6e')](_0xeb03('0x6f'),{'UserId':_0x54ae96['id'],'OpenchannelQueueId':_0x1fa9cc['id']});});});});});}})['then'](respondWithStatusCode(_0x7d2b11,null))[_0xeb03('0x45')](handleError(_0x7d2b11,null));};exports[_0xeb03('0x70')]=function(_0x54d70d,_0x15e9e9,_0x41e388){return db[_0xeb03('0x67')][_0xeb03('0x44')]({'where':{'id':_0x54d70d[_0xeb03('0x32')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb03('0x68'),'attributes':['id'],'raw':!![]}]})[_0xeb03('0x27')](handleEntityNotFound(_0x15e9e9,null))[_0xeb03('0x27')](function(_0x37c5b7){var _0x1a802b=_['map'](_0x37c5b7,'id');var _0x3c76e0=[];var _0x5d2be5=[];var _0x16e113=squel[_0xeb03('0x71')]();_0x16e113[_0xeb03('0x72')](_0xeb03('0x73'))[_0xeb03('0x74')](_0xeb03('0x75'),'tq')[_0xeb03('0x76')](_0xeb03('0x77'),'ut',_0xeb03('0x78'))[_0xeb03('0x3c')]('OpenchannelQueueId\x20=\x20?',_0x54d70d[_0xeb03('0x47')]['id']);for(var _0x33175e=0x0;_0x33175e<_0x37c5b7[_0xeb03('0x39')];_0x33175e+=0x1){let _0x1d895a=_0x37c5b7[_0x33175e];for(var _0x26d7ae=0x0;_0x26d7ae<_0x1d895a[_0xeb03('0x68')][_0xeb03('0x39')];_0x26d7ae+=0x1){let _0x41e72c=_0x1d895a['Agents'][_0x26d7ae];var _0x457fd3=_0x16e113['clone']();_0x457fd3[_0xeb03('0x3c')](_0xeb03('0x79'),_0x41e72c['id']);_0x5d2be5['push'](db[_0xeb03('0x7a')][_0xeb03('0x32')](_0x457fd3[_0xeb03('0x7b')](),{'type':db['sequelize'][_0xeb03('0x7c')][_0xeb03('0x7d')]})[_0xeb03('0x27')](function(_0xd062c6){if(_0xd062c6[_0xeb03('0x39')]===0x1){return _0x41e72c['id'];}else{var _0x1dad1d=_[_0xeb03('0x7e')](_[_0xeb03('0x2f')](_0xd062c6,_0xeb03('0x7f')),function(_0x17a3ee){return _['includes'](_0x1a802b,_0x17a3ee);});if(_0x1dad1d){return _0x41e72c['id'];}}}));}}return BPromise[_0xeb03('0x80')](_0x5d2be5)['then'](function(_0x1e6cd9){_0x3c76e0=_(_0x3c76e0)[_0xeb03('0x81')](_0x1e6cd9)[_0xeb03('0x82')]()[_0xeb03('0x83')]();return db[_0xeb03('0x41')][_0xeb03('0x52')]({'where':{'id':_0x54d70d[_0xeb03('0x47')]['id']}})[_0xeb03('0x27')](function(_0x378200){return db[_0xeb03('0x7a')][_0xeb03('0x84')](function(_0x3757cf){return _0x378200[_0xeb03('0x70')](_0x54d70d[_0xeb03('0x32')][_0xeb03('0x85')],{'transaction':_0x3757cf})[_0xeb03('0x27')](function(){if(!_['isEmpty'](_0x3c76e0)){return _0x378200[_0xeb03('0x86')](_0x3c76e0,{'transaction':_0x3757cf});}})[_0xeb03('0x27')](function(){_0x3c76e0['forEach'](function(_0x5bed60){socket[_0xeb03('0x6e')](_0xeb03('0x87'),{'UserId':_0x5bed60,'OpenchannelQueueId':_0x378200['id']});});});});});});})[_0xeb03('0x27')](respondWithStatusCode(_0x15e9e9,null))['catch'](handleError(_0x15e9e9,null));};exports[_0xeb03('0x88')]=function(_0x51e400,_0x43e839,_0x315a72){return db[_0xeb03('0x41')][_0xeb03('0x52')]({'where':{'id':_0x51e400[_0xeb03('0x47')]['id']}})[_0xeb03('0x27')](handleEntityNotFound(_0x43e839,null))[_0xeb03('0x27')](function(_0x2e4815){if(_0x2e4815){return _0x2e4815[_0xeb03('0x88')](_0x51e400[_0xeb03('0x4a')][_0xeb03('0x85')],_[_0xeb03('0x89')](_0x51e400[_0xeb03('0x4a')],['ids','id'])||{})[_0xeb03('0x8a')](function(_0x11a6c0){for(var _0x34c5d9=0x0;_0x34c5d9<_0x51e400['body'][_0xeb03('0x85')][_0xeb03('0x39')];_0x34c5d9+=0x1){socket[_0xeb03('0x6e')](_0xeb03('0x6f'),{'UserId':Number(_0x51e400[_0xeb03('0x4a')][_0xeb03('0x85')][_0x34c5d9]),'OpenchannelQueueId':Number(_0x51e400['params']['id'])});}return _0x11a6c0;});}})[_0xeb03('0x27')](respondWithResult(_0x43e839,null))[_0xeb03('0x45')](handleError(_0x43e839,null));};exports['removeAgents']=function(_0xd01dee,_0x3cff17,_0x4c1eb5){return db[_0xeb03('0x41')][_0xeb03('0x52')]({'where':{'id':_0xd01dee[_0xeb03('0x47')]['id']}})[_0xeb03('0x27')](handleEntityNotFound(_0x3cff17,null))['then'](function(_0x223e23){if(_0x223e23){return _0x223e23[_0xeb03('0x86')](_0xd01dee['query'][_0xeb03('0x85')])[_0xeb03('0x27')](function(){if(_[_0xeb03('0x8b')](_0xd01dee[_0xeb03('0x32')][_0xeb03('0x85')])){for(var _0x1d4854=0x0;_0x1d4854<_0xd01dee['query']['ids']['length'];_0x1d4854+=0x1){socket[_0xeb03('0x6e')](_0xeb03('0x87'),{'UserId':Number(_0xd01dee[_0xeb03('0x32')][_0xeb03('0x85')][_0x1d4854]),'OpenchannelQueueId':Number(_0xd01dee[_0xeb03('0x47')]['id'])});}}else{socket[_0xeb03('0x6e')](_0xeb03('0x87'),{'UserId':Number(_0xd01dee[_0xeb03('0x32')][_0xeb03('0x85')]),'OpenchannelQueueId':Number(_0xd01dee['params']['id'])});}});}})[_0xeb03('0x27')](respondWithStatusCode(_0x3cff17,null))['catch'](handleError(_0x3cff17,null));};exports[_0xeb03('0x8c')]=function(_0x3d72e2,_0x3bcf3a,_0x12a6ea){var _0xd15551={};var _0x1e32a2={};var _0x256d2b;var _0x301cb5;return db[_0xeb03('0x41')][_0xeb03('0x55')]({'where':{'id':_0x3d72e2[_0xeb03('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bcf3a,null))['then'](function(_0x39f022){if(_0x39f022){_0x256d2b=_0x39f022;_0x1e32a2[_0xeb03('0x35')]=_[_0xeb03('0x33')](db[_0xeb03('0x5a')][_0xeb03('0x30')]);_0x1e32a2[_0xeb03('0x32')]=_['keys'](_0x3d72e2['query']);_0x1e32a2['filters']=_[_0xeb03('0x37')](_0x1e32a2[_0xeb03('0x35')],_0x1e32a2[_0xeb03('0x32')]);_0xd15551[_0xeb03('0x36')]=_[_0xeb03('0x37')](_0x1e32a2[_0xeb03('0x35')],qs[_0xeb03('0x38')](_0x3d72e2[_0xeb03('0x32')][_0xeb03('0x38')]));_0xd15551['attributes']=_0xd15551[_0xeb03('0x36')][_0xeb03('0x39')]?_0xd15551[_0xeb03('0x36')]:_0x1e32a2[_0xeb03('0x35')];_0xd15551[_0xeb03('0x58')]=qs[_0xeb03('0x3b')](_0x3d72e2[_0xeb03('0x32')]['sort']);_0xd15551[_0xeb03('0x3c')]=qs[_0xeb03('0x34')](_[_0xeb03('0x3d')](_0x3d72e2[_0xeb03('0x32')],_0x1e32a2[_0xeb03('0x34')]));if(_0x3d72e2[_0xeb03('0x32')][_0xeb03('0x3e')]){_0xd15551[_0xeb03('0x3c')]=_[_0xeb03('0x3f')](_0xd15551['where'],{'$or':_['map'](_0xd15551[_0xeb03('0x36')],function(_0x13ed16){var _0x58f271={};_0x58f271[_0x13ed16]={'$like':'%'+_0x3d72e2[_0xeb03('0x32')]['filter']+'%'};return _0x58f271;})});}_0xd15551=_['merge']({},_0xd15551,_0x3d72e2[_0xeb03('0x48')]);return _0x256d2b['getAgents'](_0xd15551);}})[_0xeb03('0x27')](function(_0x2f051e){if(_0x2f051e){_0x301cb5=_0x2f051e[_0xeb03('0x39')];if(!_0x3d72e2[_0xeb03('0x32')]['hasOwnProperty'](_0xeb03('0x57'))){_0xd15551['limit']=qs[_0xeb03('0x1f')](_0x3d72e2[_0xeb03('0x32')][_0xeb03('0x1f')]);_0xd15551[_0xeb03('0x1d')]=qs['offset'](_0x3d72e2[_0xeb03('0x32')]['offset']);}return _0x256d2b[_0xeb03('0x8c')](_0xd15551);}})[_0xeb03('0x27')](function(_0x12edb4){if(_0x12edb4){return _0x12edb4?{'count':_0x301cb5,'rows':_0x12edb4}:null;}})[_0xeb03('0x27')](respondWithResult(_0x3bcf3a,null))[_0xeb03('0x45')](handleError(_0x3bcf3a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e8ee661..7a3fff2 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 _0x69b7=['exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x69b7,0x1d5));var _0x769b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x69b7[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x769b('0x0'))['db'][_0x769b('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x769b('0x2')](0x0);var events={'afterCreate':_0x769b('0x3'),'afterUpdate':'update','afterDestroy':_0x769b('0x4')};function emitEvent(_0xe76d01){return function(_0x395d6e,_0x5db6fa,_0x585fed){OpenchannelQueueEvents['emit'](_0xe76d01+':'+_0x395d6e['id'],_0x395d6e);OpenchannelQueueEvents[_0x769b('0x5')](_0xe76d01,_0x395d6e);_0x585fed(null);};}for(var e in events){if(events[_0x769b('0x6')](e)){var event=events[e];OpenchannelQueue[_0x769b('0x7')](e,emitEvent(event));}}module[_0x769b('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x86e8=['hook','events','OpenchannelQueue','setMaxListeners','save','remove','emit'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0x86e8,0x189));var _0x886e=function(_0x124358,_0x1b7574){_0x124358=_0x124358-0x0;var _0x340f46=_0x86e8[_0x124358];return _0x340f46;};'use strict';var EventEmitter=require(_0x886e('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x886e('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x886e('0x2')](0x0);var events={'afterCreate':_0x886e('0x3'),'afterUpdate':'update','afterDestroy':_0x886e('0x4')};function emitEvent(_0x266e9b){return function(_0x38c567,_0x136cfb,_0x33dd2d){OpenchannelQueueEvents[_0x886e('0x5')](_0x266e9b+':'+_0x38c567['id'],_0x38c567);OpenchannelQueueEvents[_0x886e('0x5')](_0x266e9b,_0x38c567);_0x33dd2d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x886e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 27fec79..d216e7f 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 _0x17dc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger'];(function(_0x558184,_0xf25e7){var _0x512e4d=function(_0x394b83){while(--_0x394b83){_0x558184['push'](_0x558184['shift']());}};_0x512e4d(++_0xf25e7);}(_0x17dc,0x66));var _0xc17d=function(_0x46559e,_0x25fe3e){_0x46559e=_0x46559e-0x0;var _0x454a4e=_0x17dc[_0x46559e];return _0x454a4e;};'use strict';var _=require(_0xc17d('0x0'));var util=require('util');var logger=require(_0xc17d('0x1'))('api');var moment=require(_0xc17d('0x2'));var BPromise=require(_0xc17d('0x3'));var rp=require(_0xc17d('0x4'));var fs=require('fs');var path=require(_0xc17d('0x5'));var rimraf=require(_0xc17d('0x6'));var config=require(_0xc17d('0x7'));var attributes=require(_0xc17d('0x8'));module[_0xc17d('0x9')]=function(_0x16305f,_0x4dbb7e){return _0x16305f[_0xc17d('0xa')](_0xc17d('0xb'),attributes,{'tableName':_0xc17d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08a1=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x265aaa,_0x4a5aba){var _0x3cebe1=function(_0x13f717){while(--_0x13f717){_0x265aaa['push'](_0x265aaa['shift']());}};_0x3cebe1(++_0x4a5aba);}(_0x08a1,0x8f));var _0x108a=function(_0x1026df,_0x4dec18){_0x1026df=_0x1026df-0x0;var _0x20b113=_0x08a1[_0x1026df];return _0x20b113;};'use strict';var _=require(_0x108a('0x0'));var util=require(_0x108a('0x1'));var logger=require(_0x108a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x108a('0x3'));var rp=require(_0x108a('0x4'));var fs=require('fs');var path=require(_0x108a('0x5'));var rimraf=require(_0x108a('0x6'));var config=require(_0x108a('0x7'));var attributes=require(_0x108a('0x8'));module[_0x108a('0x9')]=function(_0x4d62d5,_0x4c4914){return _0x4d62d5[_0x108a('0xa')](_0x108a('0xb'),attributes,{'tableName':_0x108a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index a7ae867..62970fd 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 _0xe76d=['error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowOpenchannelQueue','stringify','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0xe76d,0x18e));var _0xde76=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xe76d[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xde76('0x0'));var util=require(_0xde76('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde76('0x2'));var db=require(_0xde76('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xde76('0x4'))(_0xde76('0x5'));var config=require(_0xde76('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xde76('0x7')][_0xde76('0x8')]({'port':0x232a});config['redis']=_[_0xde76('0x9')](config[_0xde76('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xde76('0xb'))(new Redis(config['redis']));require(_0xde76('0xc'))[_0xde76('0xd')](socket);function respondWithRpcPromise(_0x2f218c,_0x22f575,_0x4207ad){return new BPromise(function(_0x845a3a,_0x3e82a5){return client['request'](_0x2f218c,_0x4207ad)[_0xde76('0xe')](function(_0x4c6ccd){logger[_0xde76('0xf')](_0xde76('0x10'),_0x22f575,'request\x20sent');logger[_0xde76('0x11')](_0xde76('0x12'),_0x22f575,_0xde76('0x13'),JSON['stringify'](_0x4c6ccd));if(_0x4c6ccd['error']){if(_0x4c6ccd[_0xde76('0x14')][_0xde76('0x15')]===0x1f4){logger[_0xde76('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x22f575,_0x4c6ccd['error']['message']);return _0x3e82a5(_0x4c6ccd[_0xde76('0x14')]['message']);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x22f575,_0x4c6ccd[_0xde76('0x14')][_0xde76('0x16')]);return _0x845a3a(_0x4c6ccd[_0xde76('0x14')][_0xde76('0x16')]);}else{logger['info'](_0xde76('0x10'),_0x22f575,_0xde76('0x13'));_0x845a3a(_0x4c6ccd['result'][_0xde76('0x16')]);}})[_0xde76('0x17')](function(_0x3ba855){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x22f575,_0x3ba855);_0x3e82a5(_0x3ba855);});});}exports[_0xde76('0x18')]=function(_0x31e0da){var _0x1e9120=this;return new Promise(function(_0x351dd9,_0x14202b){return db[_0xde76('0x19')][_0xde76('0x1a')]({'raw':_0x31e0da[_0xde76('0x1b')]?_0x31e0da[_0xde76('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x31e0da[_0xde76('0x1b')]?_0x31e0da[_0xde76('0x1b')][_0xde76('0x1c')]||null:null,'attributes':_0x31e0da[_0xde76('0x1b')]?_0x31e0da[_0xde76('0x1b')][_0xde76('0x1d')]||null:null,'limit':_0x31e0da['options']?_0x31e0da[_0xde76('0x1b')][_0xde76('0x1e')]||null:null,'include':_0x31e0da[_0xde76('0x1b')]?_0x31e0da[_0xde76('0x1b')][_0xde76('0x1f')]?_[_0xde76('0x20')](_0x31e0da[_0xde76('0x1b')][_0xde76('0x1f')],function(_0x261d0c){return{'model':db[_0x261d0c[_0xde76('0x21')]],'as':_0x261d0c['as'],'attributes':_0x261d0c[_0xde76('0x1d')],'include':_0x261d0c[_0xde76('0x1f')]?_[_0xde76('0x20')](_0x261d0c[_0xde76('0x1f')],function(_0x5b7553){return{'model':db[_0x5b7553['model']],'as':_0x5b7553['as'],'attributes':_0x5b7553[_0xde76('0x1d')],'include':_0x5b7553['include']?_[_0xde76('0x20')](_0x5b7553['include'],function(_0x3edb31){return{'model':db[_0x3edb31[_0xde76('0x21')]],'as':_0x3edb31['as'],'attributes':_0x3edb31[_0xde76('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xde76('0xe')](function(_0x2ac280){logger['info'](_0xde76('0x18'),_0x31e0da);logger[_0xde76('0x11')](_0xde76('0x18'),_0x31e0da,JSON['stringify'](_0x2ac280));_0x351dd9(_0x2ac280);})[_0xde76('0x17')](function(_0x2f2bcb){logger[_0xde76('0x14')](_0xde76('0x18'),_0x2f2bcb['message'],_0x31e0da);_0x14202b(_0x1e9120[_0xde76('0x14')](0x1f4,_0x2f2bcb['message']));});});};exports['ShowOpenchannelQueue']=function(_0xd06ed){var _0x2fcfa3=this;return new Promise(function(_0x289c36,_0x2c8323){return db[_0xde76('0x19')][_0xde76('0x22')]({'raw':_0xd06ed[_0xde76('0x1b')]?_0xd06ed[_0xde76('0x1b')][_0xde76('0x23')]===undefined?!![]:![]:!![],'where':_0xd06ed['options']?_0xd06ed['options'][_0xde76('0x1c')]||null:null,'attributes':_0xd06ed[_0xde76('0x1b')]?_0xd06ed[_0xde76('0x1b')][_0xde76('0x1d')]||null:null,'include':_0xd06ed[_0xde76('0x1b')]?_0xd06ed[_0xde76('0x1b')]['include']?_[_0xde76('0x20')](_0xd06ed[_0xde76('0x1b')]['include'],function(_0x54e23e){return{'model':db[_0x54e23e[_0xde76('0x21')]],'as':_0x54e23e['as'],'attributes':_0x54e23e['attributes'],'include':_0x54e23e[_0xde76('0x1f')]?_[_0xde76('0x20')](_0x54e23e[_0xde76('0x1f')],function(_0x5a7e2a){return{'model':db[_0x5a7e2a['model']],'as':_0x5a7e2a['as'],'attributes':_0x5a7e2a[_0xde76('0x1d')],'include':_0x5a7e2a[_0xde76('0x1f')]?_[_0xde76('0x20')](_0x5a7e2a['include'],function(_0x32a39d){return{'model':db[_0x32a39d[_0xde76('0x21')]],'as':_0x32a39d['as'],'attributes':_0x32a39d[_0xde76('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xde76('0xe')](function(_0x5d8b8a){logger[_0xde76('0xf')](_0xde76('0x24'),_0xd06ed);logger['debug']('ShowOpenchannelQueue',_0xd06ed,JSON[_0xde76('0x25')](_0x5d8b8a));_0x289c36(_0x5d8b8a);})[_0xde76('0x17')](function(_0x23d64e){logger[_0xde76('0x14')]('ShowOpenchannelQueue',_0x23d64e[_0xde76('0x16')],_0xd06ed);_0x2c8323(_0x2fcfa3[_0xde76('0x14')](0x1f4,_0x23d64e[_0xde76('0x16')]));});});}; \ No newline at end of file +var _0x75f3=['map','model','attributes','include','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where'];(function(_0x45138b,_0xec2bd6){var _0x398884=function(_0x408309){while(--_0x408309){_0x45138b['push'](_0x45138b['shift']());}};_0x398884(++_0xec2bd6);}(_0x75f3,0x14f));var _0x375f=function(_0x7e2dfa,_0x38ed0e){_0x7e2dfa=_0x7e2dfa-0x0;var _0x2fd6d0=_0x75f3[_0x7e2dfa];return _0x2fd6d0;};'use strict';var _=require(_0x375f('0x0'));var util=require(_0x375f('0x1'));var moment=require(_0x375f('0x2'));var BPromise=require(_0x375f('0x3'));var rs=require(_0x375f('0x4'));var fs=require('fs');var Redis=require(_0x375f('0x5'));var db=require(_0x375f('0x6'))['db'];var utils=require(_0x375f('0x7'));var logger=require(_0x375f('0x8'))(_0x375f('0x9'));var config=require(_0x375f('0xa'));var jayson=require(_0x375f('0xb'));var client=jayson[_0x375f('0xc')]['http']({'port':0x232a});config[_0x375f('0xd')]=_[_0x375f('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x375f('0xf'))[_0x375f('0x10')](socket);function respondWithRpcPromise(_0xc61f54,_0x519ae9,_0x1729ed){return new BPromise(function(_0x522dbd,_0x4c105d){return client['request'](_0xc61f54,_0x1729ed)[_0x375f('0x11')](function(_0x5b2f68){logger[_0x375f('0x12')](_0x375f('0x13'),_0x519ae9,_0x375f('0x14'));logger[_0x375f('0x15')](_0x375f('0x16'),_0x519ae9,_0x375f('0x14'),JSON[_0x375f('0x17')](_0x5b2f68));if(_0x5b2f68[_0x375f('0x18')]){if(_0x5b2f68[_0x375f('0x18')][_0x375f('0x19')]===0x1f4){logger[_0x375f('0x18')](_0x375f('0x13'),_0x519ae9,_0x5b2f68[_0x375f('0x18')][_0x375f('0x1a')]);return _0x4c105d(_0x5b2f68[_0x375f('0x18')][_0x375f('0x1a')]);}logger[_0x375f('0x18')](_0x375f('0x13'),_0x519ae9,_0x5b2f68['error'][_0x375f('0x1a')]);return _0x522dbd(_0x5b2f68[_0x375f('0x18')][_0x375f('0x1a')]);}else{logger[_0x375f('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x519ae9,'request\x20sent');_0x522dbd(_0x5b2f68[_0x375f('0x1b')][_0x375f('0x1a')]);}})[_0x375f('0x1c')](function(_0x3b0950){logger[_0x375f('0x18')](_0x375f('0x13'),_0x519ae9,_0x3b0950);_0x4c105d(_0x3b0950);});});}exports[_0x375f('0x1d')]=function(_0xc0940c){var _0x546e12=this;return new Promise(function(_0x17df39,_0x3c1022){return db['OpenchannelQueue'][_0x375f('0x1e')]({'raw':_0xc0940c[_0x375f('0x1f')]?_0xc0940c[_0x375f('0x1f')][_0x375f('0x20')]===undefined?!![]:![]:!![],'where':_0xc0940c['options']?_0xc0940c[_0x375f('0x1f')][_0x375f('0x21')]||null:null,'attributes':_0xc0940c[_0x375f('0x1f')]?_0xc0940c[_0x375f('0x1f')]['attributes']||null:null,'limit':_0xc0940c['options']?_0xc0940c['options']['limit']||null:null,'include':_0xc0940c[_0x375f('0x1f')]?_0xc0940c[_0x375f('0x1f')]['include']?_[_0x375f('0x22')](_0xc0940c['options']['include'],function(_0x201a72){return{'model':db[_0x201a72[_0x375f('0x23')]],'as':_0x201a72['as'],'attributes':_0x201a72[_0x375f('0x24')],'include':_0x201a72[_0x375f('0x25')]?_[_0x375f('0x22')](_0x201a72[_0x375f('0x25')],function(_0xb1c77a){return{'model':db[_0xb1c77a[_0x375f('0x23')]],'as':_0xb1c77a['as'],'attributes':_0xb1c77a['attributes'],'include':_0xb1c77a['include']?_[_0x375f('0x22')](_0xb1c77a[_0x375f('0x25')],function(_0x3d351e){return{'model':db[_0x3d351e[_0x375f('0x23')]],'as':_0x3d351e['as'],'attributes':_0x3d351e[_0x375f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x375f('0x11')](function(_0x242102){logger['info'](_0x375f('0x1d'),_0xc0940c);logger['debug'](_0x375f('0x1d'),_0xc0940c,JSON[_0x375f('0x17')](_0x242102));_0x17df39(_0x242102);})[_0x375f('0x1c')](function(_0x3333f4){logger[_0x375f('0x18')](_0x375f('0x1d'),_0x3333f4[_0x375f('0x1a')],_0xc0940c);_0x3c1022(_0x546e12[_0x375f('0x18')](0x1f4,_0x3333f4[_0x375f('0x1a')]));});});};exports[_0x375f('0x26')]=function(_0x13dfec){var _0x38aa3f=this;return new Promise(function(_0x28793f,_0x1749d7){return db[_0x375f('0x27')][_0x375f('0x28')]({'raw':_0x13dfec[_0x375f('0x1f')]?_0x13dfec[_0x375f('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x13dfec[_0x375f('0x1f')]?_0x13dfec[_0x375f('0x1f')][_0x375f('0x21')]||null:null,'attributes':_0x13dfec['options']?_0x13dfec['options']['attributes']||null:null,'include':_0x13dfec[_0x375f('0x1f')]?_0x13dfec[_0x375f('0x1f')][_0x375f('0x25')]?_[_0x375f('0x22')](_0x13dfec[_0x375f('0x1f')][_0x375f('0x25')],function(_0x5d0037){return{'model':db[_0x5d0037[_0x375f('0x23')]],'as':_0x5d0037['as'],'attributes':_0x5d0037[_0x375f('0x24')],'include':_0x5d0037[_0x375f('0x25')]?_[_0x375f('0x22')](_0x5d0037[_0x375f('0x25')],function(_0x4581d2){return{'model':db[_0x4581d2[_0x375f('0x23')]],'as':_0x4581d2['as'],'attributes':_0x4581d2['attributes'],'include':_0x4581d2[_0x375f('0x25')]?_[_0x375f('0x22')](_0x4581d2[_0x375f('0x25')],function(_0x3a4f9a){return{'model':db[_0x3a4f9a[_0x375f('0x23')]],'as':_0x3a4f9a['as'],'attributes':_0x3a4f9a[_0x375f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x375f('0x11')](function(_0x40a587){logger['info'](_0x375f('0x26'),_0x13dfec);logger[_0x375f('0x15')]('ShowOpenchannelQueue',_0x13dfec,JSON[_0x375f('0x17')](_0x40a587));_0x28793f(_0x40a587);})[_0x375f('0x1c')](function(_0x56eeab){logger[_0x375f('0x18')](_0x375f('0x26'),_0x56eeab['message'],_0x13dfec);_0x1749d7(_0x38aa3f[_0x375f('0x18')](0x1f4,_0x56eeab[_0x375f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e27f902..ce67156 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 _0xe661=['remove','emit','removeListener','register','length','openchannelQueue:','save'];(function(_0x3cf8bd,_0x4fdd02){var _0x3fd6ab=function(_0x5dcee1){while(--_0x5dcee1){_0x3cf8bd['push'](_0x3cf8bd['shift']());}};_0x3fd6ab(++_0x4fdd02);}(_0xe661,0x8b));var _0x1e66=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe661[_0x1facfa];return _0x9ec701;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x1e66('0x0'),_0x1e66('0x1'),'update'];function createListener(_0x57a2fb,_0x5ab918){return function(_0x220acd){_0x5ab918[_0x1e66('0x2')](_0x57a2fb,_0x220acd);};}function removeListener(_0x454b2b,_0x45d09e){return function(){OpenchannelQueueEvents[_0x1e66('0x3')](_0x454b2b,_0x45d09e);};}exports[_0x1e66('0x4')]=function(_0x4044f0){for(var _0x102d22=0x0,_0x2c6f64=events[_0x1e66('0x5')];_0x102d22<_0x2c6f64;_0x102d22++){var _0x3ae73a=events[_0x102d22];var _0x254f7f=createListener(_0x1e66('0x6')+_0x3ae73a,_0x4044f0);OpenchannelQueueEvents['on'](_0x3ae73a,_0x254f7f);}}; \ No newline at end of file +var _0xfb93=['openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x33153c,_0x2adaad){var _0x4f2374=function(_0x322289){while(--_0x322289){_0x33153c['push'](_0x33153c['shift']());}};_0x4f2374(++_0x2adaad);}(_0xfb93,0x1b1));var _0x3fb9=function(_0x200327,_0x303d78){_0x200327=_0x200327-0x0;var _0x41115e=_0xfb93[_0x200327];return _0x41115e;};'use strict';var OpenchannelQueueEvents=require(_0x3fb9('0x0'));var events=[_0x3fb9('0x1'),_0x3fb9('0x2'),_0x3fb9('0x3')];function createListener(_0xbf4222,_0x2750ab){return function(_0x2d7f47){_0x2750ab[_0x3fb9('0x4')](_0xbf4222,_0x2d7f47);};}function removeListener(_0x302502,_0x569105){return function(){OpenchannelQueueEvents[_0x3fb9('0x5')](_0x302502,_0x569105);};}exports[_0x3fb9('0x6')]=function(_0xc693ec){for(var _0x589564=0x0,_0x2a7629=events[_0x3fb9('0x7')];_0x589564<_0x2a7629;_0x589564++){var _0x165bd2=events[_0x589564];var _0x3326ed=createListener(_0x3fb9('0x8')+_0x165bd2,_0xc693ec);OpenchannelQueueEvents['on'](_0x165bd2,_0x3326ed);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8a88dc9..a3b0a0f 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 _0xea84=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x124760,_0x330672){var _0x4d5132=function(_0x51ddfc){while(--_0x51ddfc){_0x124760['push'](_0x124760['shift']());}};_0x4d5132(++_0x330672);}(_0xea84,0x11e));var _0x4ea8=function(_0x4d03e1,_0x31d9a6){_0x4d03e1=_0x4d03e1-0x0;var _0x8015bf=_0xea84[_0x4d03e1];return _0x8015bf;};'use strict';var multer=require(_0x4ea8('0x0'));var util=require(_0x4ea8('0x1'));var path=require('path');var timeout=require(_0x4ea8('0x2'));var express=require(_0x4ea8('0x3'));var router=express[_0x4ea8('0x4')]();var fs_extra=require(_0x4ea8('0x5'));var auth=require(_0x4ea8('0x6'));var interaction=require(_0x4ea8('0x7'));var config=require(_0x4ea8('0x8'));var controller=require(_0x4ea8('0x9'));router[_0x4ea8('0xa')]('/',auth[_0x4ea8('0xb')](),controller[_0x4ea8('0xc')]);router[_0x4ea8('0xa')](_0x4ea8('0xd'),auth[_0x4ea8('0xb')](),controller['describe']);router['get']('/:id',auth[_0x4ea8('0xb')](),controller['show']);router[_0x4ea8('0xe')]('/',auth['isAuthenticated'](),controller[_0x4ea8('0xf')]);router[_0x4ea8('0x10')](_0x4ea8('0x11'),auth[_0x4ea8('0xb')](),controller[_0x4ea8('0x12')]);router[_0x4ea8('0x13')]('/:id',auth[_0x4ea8('0xb')](),controller[_0x4ea8('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdea5=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete'];(function(_0x6ceec2,_0x56e3ad){var _0x2294d9=function(_0x3ff8c6){while(--_0x3ff8c6){_0x6ceec2['push'](_0x6ceec2['shift']());}};_0x2294d9(++_0x56e3ad);}(_0xdea5,0xd9));var _0x5dea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdea5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5dea('0x0'));var util=require(_0x5dea('0x1'));var path=require('path');var timeout=require(_0x5dea('0x2'));var express=require(_0x5dea('0x3'));var router=express[_0x5dea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5dea('0x5'));var interaction=require(_0x5dea('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x5dea('0x7')](),controller[_0x5dea('0x8')]);router[_0x5dea('0x9')](_0x5dea('0xa'),auth[_0x5dea('0x7')](),controller[_0x5dea('0xb')]);router[_0x5dea('0x9')](_0x5dea('0xc'),auth[_0x5dea('0x7')](),controller[_0x5dea('0xd')]);router[_0x5dea('0xe')]('/',auth[_0x5dea('0x7')](),controller['create']);router['put'](_0x5dea('0xc'),auth[_0x5dea('0x7')](),controller[_0x5dea('0xf')]);router[_0x5dea('0x10')](_0x5dea('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x5dea('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 995c4bc..85e1d44 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 _0xf992=['sequelize','STRING','DATE'];(function(_0x169d61,_0x3ba6f7){var _0x4c5bee=function(_0xbabace){while(--_0xbabace){_0x169d61['push'](_0x169d61['shift']());}};_0x4c5bee(++_0x3ba6f7);}(_0xf992,0x1da));var _0x2f99=function(_0x1776fa,_0x55db79){_0x1776fa=_0x1776fa-0x0;var _0x4d4693=_0xf992[_0x1776fa];return _0x4d4693;};'use strict';var moment=require('moment');var Sequelize=require(_0x2f99('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2f99('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2f99('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2f99('0x2')]},'exitAt':{'type':Sequelize[_0x2f99('0x2')]},'reason':{'type':Sequelize[_0x2f99('0x1')]}}; \ No newline at end of file +var _0xd0fe=['sequelize','STRING','DATE','moment'];(function(_0x953b57,_0x11dd4e){var _0x258479=function(_0x3dbc3b){while(--_0x3dbc3b){_0x953b57['push'](_0x953b57['shift']());}};_0x258479(++_0x11dd4e);}(_0xd0fe,0xdb));var _0xed0f=function(_0x239edb,_0x46d217){_0x239edb=_0x239edb-0x0;var _0x4c758a=_0xd0fe[_0x239edb];return _0x4c758a;};'use strict';var moment=require(_0xed0f('0x0'));var Sequelize=require(_0xed0f('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xed0f('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xed0f('0x3')]},'leaveAt':{'type':Sequelize[_0xed0f('0x3')]},'acceptAt':{'type':Sequelize[_0xed0f('0x3')]},'exitAt':{'type':Sequelize[_0xed0f('0x3')]},'reason':{'type':Sequelize[_0xed0f('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 8282495..ad44b71 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 _0x2986=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','send','index','OpenchannelQueueReport','rawAttributes','fieldName','type','model','name','query','keys'];(function(_0x313dab,_0x53179c){var _0x18ee37=function(_0x5f43a0){while(--_0x5f43a0){_0x313dab['push'](_0x313dab['shift']());}};_0x18ee37(++_0x53179c);}(_0x2986,0x143));var _0x6298=function(_0x412b3f,_0x1c4a4f){_0x412b3f=_0x412b3f-0x0;var _0x31b0bc=_0x2986[_0x412b3f];return _0x31b0bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6298('0x0'));var zipdir=require(_0x6298('0x1'));var jsonpatch=require(_0x6298('0x2'));var rp=require(_0x6298('0x3'));var moment=require(_0x6298('0x4'));var BPromise=require(_0x6298('0x5'));var Mustache=require(_0x6298('0x6'));var util=require(_0x6298('0x7'));var path=require(_0x6298('0x8'));var sox=require('sox');var csv=require(_0x6298('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6298('0xa'));var _=require(_0x6298('0xb'));var squel=require(_0x6298('0xc'));var crypto=require('crypto');var jsforce=require(_0x6298('0xd'));var deskjs=require(_0x6298('0xe'));var toCsv=require(_0x6298('0x9'));var querystring=require(_0x6298('0xf'));var Papa=require(_0x6298('0x10'));var Redis=require(_0x6298('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6298('0x12'));var as=require(_0x6298('0x13'));var hardwareService=require(_0x6298('0x14'));var logger=require(_0x6298('0x15'))(_0x6298('0x16'));var utils=require(_0x6298('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6298('0x18'));var db=require(_0x6298('0x19'))['db'];function respondWithStatusCode(_0x229533,_0x21a840){_0x21a840=_0x21a840||0xcc;return function(_0x47fc56){if(_0x47fc56){return _0x229533['sendStatus'](_0x21a840);}return _0x229533['status'](_0x21a840)[_0x6298('0x1a')]();};}function respondWithResult(_0x43cd81,_0x179b61){_0x179b61=_0x179b61||0xc8;return function(_0x3769b7){if(_0x3769b7){return _0x43cd81[_0x6298('0x1b')](_0x179b61)[_0x6298('0x1c')](_0x3769b7);}};}function respondWithFilteredResult(_0x2468fc,_0x1c2605){return function(_0x44ed5c){if(_0x44ed5c){var _0x4cf2ea=typeof _0x1c2605[_0x6298('0x1d')]===_0x6298('0x1e')&&typeof _0x1c2605[_0x6298('0x1f')]===_0x6298('0x1e');var _0x17b2fd=_0x44ed5c[_0x6298('0x20')];var _0x16706=_0x4cf2ea?0x0:_0x1c2605[_0x6298('0x1d')];var _0x23487f=_0x4cf2ea?_0x44ed5c['count']:_0x1c2605[_0x6298('0x1d')]+_0x1c2605[_0x6298('0x1f')];var _0x8e1fe6;if(_0x23487f>=_0x17b2fd){_0x23487f=_0x17b2fd;_0x8e1fe6=0xc8;}else{_0x8e1fe6=0xce;}_0x2468fc[_0x6298('0x1b')](_0x8e1fe6);return _0x2468fc[_0x6298('0x21')](_0x6298('0x22'),_0x16706+'-'+_0x23487f+'/'+_0x17b2fd)[_0x6298('0x1c')](_0x44ed5c);}return null;};}function patchUpdates(_0x3b7f9f){return function(_0x5655ea){try{jsonpatch[_0x6298('0x23')](_0x5655ea,_0x3b7f9f,!![]);}catch(_0x117247){return BPromise['reject'](_0x117247);}return _0x5655ea[_0x6298('0x24')]();};}function saveUpdates(_0x2ca164,_0x186148){return function(_0x3f8610){if(_0x3f8610){return _0x3f8610[_0x6298('0x25')](_0x2ca164)[_0x6298('0x26')](function(_0x1f6b2e){return _0x1f6b2e;});}return null;};}function removeEntity(_0x437210,_0x522b07){return function(_0x49598b){if(_0x49598b){return _0x49598b[_0x6298('0x27')]()[_0x6298('0x26')](function(){_0x437210[_0x6298('0x1b')](0xcc)[_0x6298('0x1a')]();});}};}function handleEntityNotFound(_0x42dcb8,_0xedffaa){return function(_0x5396df){if(!_0x5396df){_0x42dcb8[_0x6298('0x28')](0x194);}return _0x5396df;};}function handleError(_0xafd1dd,_0x35f548){_0x35f548=_0x35f548||0x1f4;return function(_0x52f96e){logger['error'](_0x52f96e[_0x6298('0x29')]);if(_0x52f96e['name']){delete _0x52f96e['name'];}_0xafd1dd[_0x6298('0x1b')](_0x35f548)[_0x6298('0x2a')](_0x52f96e);};}exports[_0x6298('0x2b')]=function(_0x47c89f,_0x549c6c){var _0xad10c8={},_0x550307={},_0x4269f5={'count':0x0,'rows':[]};var _0x1e603d=_['map'](db[_0x6298('0x2c')][_0x6298('0x2d')],function(_0x4532d8){return{'name':_0x4532d8[_0x6298('0x2e')],'type':_0x4532d8[_0x6298('0x2f')]['key']};});_0x550307[_0x6298('0x30')]=_['map'](_0x1e603d,_0x6298('0x31'));_0x550307[_0x6298('0x32')]=_[_0x6298('0x33')](_0x47c89f['query']);_0x550307[_0x6298('0x34')]=_[_0x6298('0x35')](_0x550307[_0x6298('0x30')],_0x550307[_0x6298('0x32')]);_0xad10c8[_0x6298('0x36')]=_['intersection'](_0x550307[_0x6298('0x30')],qs['fields'](_0x47c89f[_0x6298('0x32')][_0x6298('0x37')]));_0xad10c8[_0x6298('0x36')]=_0xad10c8['attributes'][_0x6298('0x38')]?_0xad10c8[_0x6298('0x36')]:_0x550307[_0x6298('0x30')];if(!_0x47c89f[_0x6298('0x32')]['hasOwnProperty'](_0x6298('0x39'))){_0xad10c8['limit']=qs['limit'](_0x47c89f[_0x6298('0x32')]['limit']);_0xad10c8[_0x6298('0x1d')]=qs[_0x6298('0x1d')](_0x47c89f['query']['offset']);}_0xad10c8[_0x6298('0x3a')]=qs[_0x6298('0x3b')](_0x47c89f[_0x6298('0x32')][_0x6298('0x3b')]);_0xad10c8[_0x6298('0x3c')]=qs[_0x6298('0x34')](_[_0x6298('0x3d')](_0x47c89f[_0x6298('0x32')],_0x550307[_0x6298('0x34')]),_0x1e603d);if(_0x47c89f[_0x6298('0x32')][_0x6298('0x3e')]){_0xad10c8[_0x6298('0x3c')]=_[_0x6298('0x3f')](_0xad10c8[_0x6298('0x3c')],{'$or':_['map'](_0x1e603d,function(_0x2dd07e){if(_0x2dd07e['type']!==_0x6298('0x40')){var _0x2afc77={};_0x2afc77[_0x2dd07e[_0x6298('0x31')]]={'$like':'%'+_0x47c89f[_0x6298('0x32')][_0x6298('0x3e')]+'%'};return _0x2afc77;}})});}_0xad10c8=_[_0x6298('0x3f')]({},_0xad10c8,_0x47c89f[_0x6298('0x41')]);var _0x59344e={'where':_0xad10c8['where']};return db['OpenchannelQueueReport']['count'](_0x59344e)[_0x6298('0x26')](function(_0x372f34){_0x4269f5[_0x6298('0x20')]=_0x372f34;if(_0x47c89f[_0x6298('0x32')][_0x6298('0x42')]){_0xad10c8['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x6298('0x43')](_0xad10c8);})[_0x6298('0x26')](function(_0x5c7e59){_0x4269f5['rows']=_0x5c7e59;return _0x4269f5;})[_0x6298('0x26')](respondWithFilteredResult(_0x549c6c,_0xad10c8))[_0x6298('0x44')](handleError(_0x549c6c,null));};exports[_0x6298('0x45')]=function(_0x5d7642,_0x2cc876){var _0x585950={'raw':!![],'where':{'id':_0x5d7642[_0x6298('0x46')]['id']}},_0x539f8a={};_0x539f8a[_0x6298('0x30')]=_[_0x6298('0x33')](db[_0x6298('0x2c')][_0x6298('0x2d')]);_0x539f8a[_0x6298('0x32')]=_[_0x6298('0x33')](_0x5d7642['query']);_0x539f8a[_0x6298('0x34')]=_[_0x6298('0x35')](_0x539f8a[_0x6298('0x30')],_0x539f8a['query']);_0x585950[_0x6298('0x36')]=_['intersection'](_0x539f8a[_0x6298('0x30')],qs['fields'](_0x5d7642[_0x6298('0x32')]['fields']));_0x585950[_0x6298('0x36')]=_0x585950['attributes'][_0x6298('0x38')]?_0x585950['attributes']:_0x539f8a[_0x6298('0x30')];if(_0x5d7642[_0x6298('0x32')][_0x6298('0x42')]){_0x585950['include']=[{'all':!![]}];}_0x585950=_[_0x6298('0x3f')]({},_0x585950,_0x5d7642[_0x6298('0x41')]);return db[_0x6298('0x2c')][_0x6298('0x47')](_0x585950)[_0x6298('0x26')](handleEntityNotFound(_0x2cc876,null))[_0x6298('0x26')](respondWithResult(_0x2cc876,null))[_0x6298('0x44')](handleError(_0x2cc876,null));};exports[_0x6298('0x48')]=function(_0x1a1901,_0x3fa3ea){return db['OpenchannelQueueReport']['create'](_0x1a1901['body'],{})['then'](respondWithResult(_0x3fa3ea,0xc9))[_0x6298('0x44')](handleError(_0x3fa3ea,null));};exports[_0x6298('0x25')]=function(_0x1343b5,_0x4fc799){if(_0x1343b5[_0x6298('0x49')]['id']){delete _0x1343b5[_0x6298('0x49')]['id'];}return db['OpenchannelQueueReport'][_0x6298('0x47')]({'where':{'id':_0x1343b5[_0x6298('0x46')]['id']}})[_0x6298('0x26')](handleEntityNotFound(_0x4fc799,null))[_0x6298('0x26')](saveUpdates(_0x1343b5['body'],null))[_0x6298('0x26')](respondWithResult(_0x4fc799,null))['catch'](handleError(_0x4fc799,null));};exports[_0x6298('0x27')]=function(_0x38809f,_0x4d13ba){return db['OpenchannelQueueReport'][_0x6298('0x47')]({'where':{'id':_0x38809f[_0x6298('0x46')]['id']}})[_0x6298('0x26')](handleEntityNotFound(_0x4d13ba,null))[_0x6298('0x26')](removeEntity(_0x4d13ba,null))[_0x6298('0x44')](handleError(_0x4d13ba,null));};exports[_0x6298('0x4a')]=function(_0x560b1b,_0x1278ba){return db[_0x6298('0x2c')][_0x6298('0x4a')]()[_0x6298('0x26')](respondWithResult(_0x1278ba,null))[_0x6298('0x44')](handleError(_0x1278ba,null));}; \ No newline at end of file +var _0x4d38=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','destroy','then','end','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse'];(function(_0x3acc61,_0x1db811){var _0x58a58b=function(_0x4227ff){while(--_0x4227ff){_0x3acc61['push'](_0x3acc61['shift']());}};_0x58a58b(++_0x1db811);}(_0x4d38,0x163));var _0x84d3=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x4d38[_0xb6e43];return _0x47c40f;};'use strict';var emlformat=require(_0x84d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x84d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84d3('0x2'));var Mustache=require(_0x84d3('0x3'));var util=require(_0x84d3('0x4'));var path=require(_0x84d3('0x5'));var sox=require(_0x84d3('0x6'));var csv=require(_0x84d3('0x7'));var ejs=require(_0x84d3('0x8'));var fs=require('fs');var fs_extra=require(_0x84d3('0x9'));var _=require('lodash');var squel=require(_0x84d3('0xa'));var crypto=require(_0x84d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x84d3('0xc'));var toCsv=require(_0x84d3('0x7'));var querystring=require(_0x84d3('0xd'));var Papa=require(_0x84d3('0xe'));var Redis=require(_0x84d3('0xf'));var authService=require(_0x84d3('0x10'));var qs=require(_0x84d3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84d3('0x12'));var logger=require(_0x84d3('0x13'))(_0x84d3('0x14'));var utils=require(_0x84d3('0x15'));var config=require(_0x84d3('0x16'));var licenseUtil=require(_0x84d3('0x17'));var db=require(_0x84d3('0x18'))['db'];function respondWithStatusCode(_0x2ac394,_0x4ac9a7){_0x4ac9a7=_0x4ac9a7||0xcc;return function(_0x586501){if(_0x586501){return _0x2ac394[_0x84d3('0x19')](_0x4ac9a7);}return _0x2ac394[_0x84d3('0x1a')](_0x4ac9a7)['end']();};}function respondWithResult(_0x4d5b60,_0x5dc1a4){_0x5dc1a4=_0x5dc1a4||0xc8;return function(_0x9b4470){if(_0x9b4470){return _0x4d5b60[_0x84d3('0x1a')](_0x5dc1a4)['json'](_0x9b4470);}};}function respondWithFilteredResult(_0x2a73b2,_0x4717f7){return function(_0x47ca0f){if(_0x47ca0f){var _0x5d6c8c=typeof _0x4717f7[_0x84d3('0x1b')]===_0x84d3('0x1c')&&typeof _0x4717f7[_0x84d3('0x1d')]===_0x84d3('0x1c');var _0x26951a=_0x47ca0f['count'];var _0x5606e4=_0x5d6c8c?0x0:_0x4717f7[_0x84d3('0x1b')];var _0x3217f6=_0x5d6c8c?_0x47ca0f[_0x84d3('0x1e')]:_0x4717f7[_0x84d3('0x1b')]+_0x4717f7['limit'];var _0x5a9a13;if(_0x3217f6>=_0x26951a){_0x3217f6=_0x26951a;_0x5a9a13=0xc8;}else{_0x5a9a13=0xce;}_0x2a73b2['status'](_0x5a9a13);return _0x2a73b2['set'](_0x84d3('0x1f'),_0x5606e4+'-'+_0x3217f6+'/'+_0x26951a)[_0x84d3('0x20')](_0x47ca0f);}return null;};}function patchUpdates(_0x2d3c5d){return function(_0x5781ee){try{jsonpatch[_0x84d3('0x21')](_0x5781ee,_0x2d3c5d,!![]);}catch(_0x4653b5){return BPromise['reject'](_0x4653b5);}return _0x5781ee[_0x84d3('0x22')]();};}function saveUpdates(_0x1098b0,_0x15d05b){return function(_0x1d9119){if(_0x1d9119){return _0x1d9119['update'](_0x1098b0)['then'](function(_0x5b572c){return _0x5b572c;});}return null;};}function removeEntity(_0x37386c,_0x1375df){return function(_0x8d8e07){if(_0x8d8e07){return _0x8d8e07[_0x84d3('0x23')]()[_0x84d3('0x24')](function(){_0x37386c['status'](0xcc)[_0x84d3('0x25')]();});}};}function handleEntityNotFound(_0x166fd3,_0x44fb88){return function(_0x5190e9){if(!_0x5190e9){_0x166fd3['sendStatus'](0x194);}return _0x5190e9;};}function handleError(_0x1fdbad,_0xb414b5){_0xb414b5=_0xb414b5||0x1f4;return function(_0x186a55){logger[_0x84d3('0x26')](_0x186a55['stack']);if(_0x186a55[_0x84d3('0x27')]){delete _0x186a55[_0x84d3('0x27')];}_0x1fdbad[_0x84d3('0x1a')](_0xb414b5)[_0x84d3('0x28')](_0x186a55);};}exports[_0x84d3('0x29')]=function(_0x3a5aa2,_0x2fdb74){var _0x1a4e93={},_0x4cdbff={},_0x5a1a69={'count':0x0,'rows':[]};var _0x595319=_[_0x84d3('0x2a')](db[_0x84d3('0x2b')][_0x84d3('0x2c')],function(_0x25abec){return{'name':_0x25abec['fieldName'],'type':_0x25abec[_0x84d3('0x2d')]['key']};});_0x4cdbff[_0x84d3('0x2e')]=_['map'](_0x595319,_0x84d3('0x27'));_0x4cdbff[_0x84d3('0x2f')]=_[_0x84d3('0x30')](_0x3a5aa2[_0x84d3('0x2f')]);_0x4cdbff[_0x84d3('0x31')]=_[_0x84d3('0x32')](_0x4cdbff[_0x84d3('0x2e')],_0x4cdbff[_0x84d3('0x2f')]);_0x1a4e93[_0x84d3('0x33')]=_[_0x84d3('0x32')](_0x4cdbff[_0x84d3('0x2e')],qs[_0x84d3('0x34')](_0x3a5aa2['query'][_0x84d3('0x34')]));_0x1a4e93['attributes']=_0x1a4e93['attributes'][_0x84d3('0x35')]?_0x1a4e93[_0x84d3('0x33')]:_0x4cdbff[_0x84d3('0x2e')];if(!_0x3a5aa2['query'][_0x84d3('0x36')](_0x84d3('0x37'))){_0x1a4e93[_0x84d3('0x1d')]=qs['limit'](_0x3a5aa2[_0x84d3('0x2f')][_0x84d3('0x1d')]);_0x1a4e93[_0x84d3('0x1b')]=qs[_0x84d3('0x1b')](_0x3a5aa2[_0x84d3('0x2f')]['offset']);}_0x1a4e93[_0x84d3('0x38')]=qs[_0x84d3('0x39')](_0x3a5aa2[_0x84d3('0x2f')]['sort']);_0x1a4e93[_0x84d3('0x3a')]=qs['filters'](_['pick'](_0x3a5aa2[_0x84d3('0x2f')],_0x4cdbff[_0x84d3('0x31')]),_0x595319);if(_0x3a5aa2['query'][_0x84d3('0x3b')]){_0x1a4e93['where']=_['merge'](_0x1a4e93['where'],{'$or':_[_0x84d3('0x2a')](_0x595319,function(_0x57b5f1){if(_0x57b5f1['type']!==_0x84d3('0x3c')){var _0x46d1c9={};_0x46d1c9[_0x57b5f1[_0x84d3('0x27')]]={'$like':'%'+_0x3a5aa2[_0x84d3('0x2f')]['filter']+'%'};return _0x46d1c9;}})});}_0x1a4e93=_[_0x84d3('0x3d')]({},_0x1a4e93,_0x3a5aa2[_0x84d3('0x3e')]);var _0x34c915={'where':_0x1a4e93[_0x84d3('0x3a')]};return db[_0x84d3('0x2b')][_0x84d3('0x1e')](_0x34c915)[_0x84d3('0x24')](function(_0x492c62){_0x5a1a69[_0x84d3('0x1e')]=_0x492c62;if(_0x3a5aa2[_0x84d3('0x2f')]['includeAll']){_0x1a4e93['include']=[{'all':!![]}];}return db[_0x84d3('0x2b')][_0x84d3('0x3f')](_0x1a4e93);})[_0x84d3('0x24')](function(_0xc6ba0e){_0x5a1a69[_0x84d3('0x40')]=_0xc6ba0e;return _0x5a1a69;})['then'](respondWithFilteredResult(_0x2fdb74,_0x1a4e93))[_0x84d3('0x41')](handleError(_0x2fdb74,null));};exports[_0x84d3('0x42')]=function(_0x4a838b,_0xdf3cc2){var _0x3ac840={'raw':!![],'where':{'id':_0x4a838b[_0x84d3('0x43')]['id']}},_0x1979be={};_0x1979be['model']=_['keys'](db['OpenchannelQueueReport'][_0x84d3('0x2c')]);_0x1979be['query']=_['keys'](_0x4a838b[_0x84d3('0x2f')]);_0x1979be[_0x84d3('0x31')]=_[_0x84d3('0x32')](_0x1979be[_0x84d3('0x2e')],_0x1979be[_0x84d3('0x2f')]);_0x3ac840['attributes']=_[_0x84d3('0x32')](_0x1979be[_0x84d3('0x2e')],qs[_0x84d3('0x34')](_0x4a838b['query'][_0x84d3('0x34')]));_0x3ac840[_0x84d3('0x33')]=_0x3ac840[_0x84d3('0x33')][_0x84d3('0x35')]?_0x3ac840['attributes']:_0x1979be[_0x84d3('0x2e')];if(_0x4a838b['query'][_0x84d3('0x44')]){_0x3ac840[_0x84d3('0x45')]=[{'all':!![]}];}_0x3ac840=_[_0x84d3('0x3d')]({},_0x3ac840,_0x4a838b['options']);return db[_0x84d3('0x2b')][_0x84d3('0x46')](_0x3ac840)[_0x84d3('0x24')](handleEntityNotFound(_0xdf3cc2,null))['then'](respondWithResult(_0xdf3cc2,null))[_0x84d3('0x41')](handleError(_0xdf3cc2,null));};exports[_0x84d3('0x47')]=function(_0x51198b,_0x1e605a){return db[_0x84d3('0x2b')][_0x84d3('0x47')](_0x51198b['body'],{})[_0x84d3('0x24')](respondWithResult(_0x1e605a,0xc9))[_0x84d3('0x41')](handleError(_0x1e605a,null));};exports['update']=function(_0x121b8d,_0x2503cc){if(_0x121b8d[_0x84d3('0x48')]['id']){delete _0x121b8d[_0x84d3('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x84d3('0x46')]({'where':{'id':_0x121b8d['params']['id']}})[_0x84d3('0x24')](handleEntityNotFound(_0x2503cc,null))[_0x84d3('0x24')](saveUpdates(_0x121b8d[_0x84d3('0x48')],null))[_0x84d3('0x24')](respondWithResult(_0x2503cc,null))['catch'](handleError(_0x2503cc,null));};exports[_0x84d3('0x23')]=function(_0x155cfe,_0x36f786){return db[_0x84d3('0x2b')]['find']({'where':{'id':_0x155cfe[_0x84d3('0x43')]['id']}})['then'](handleEntityNotFound(_0x36f786,null))[_0x84d3('0x24')](removeEntity(_0x36f786,null))[_0x84d3('0x41')](handleError(_0x36f786,null));};exports[_0x84d3('0x49')]=function(_0x4b343c,_0x51a10a){return db[_0x84d3('0x2b')]['describe']()[_0x84d3('0x24')](respondWithResult(_0x51a10a,null))[_0x84d3('0x41')](handleError(_0x51a10a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index e7756a1..fb3230e 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x6a909,_0x21f24d){var _0x2fd29f=function(_0x2918c9){while(--_0x2918c9){_0x6a909['push'](_0x6a909['shift']());}};_0x2fd29f(++_0x21f24d);}(_0x1261,0x144));var _0x1126=function(_0x1c73ee,_0x49a9c9){_0x1c73ee=_0x1c73ee-0x0;var _0x154f05=_0x1261[_0x1c73ee];return _0x154f05;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'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(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x814b,0x1a2));var _0xb814=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x814b[_0xc4001c];return _0x49f7bc;};'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 b81a2e7..dad69a2 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 _0xccde=['limit','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','CreateOpenchannelQueueReport','create','body','options','raw','debug','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes'];(function(_0x20c6f2,_0x4785c0){var _0x41a07f=function(_0x1cd8bd){while(--_0x1cd8bd){_0x20c6f2['push'](_0x20c6f2['shift']());}};_0x41a07f(++_0x4785c0);}(_0xccde,0x1e1));var _0xeccd=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0xccde[_0x2e3dfc];return _0x4b1245;};'use strict';var _=require(_0xeccd('0x0'));var util=require('util');var moment=require(_0xeccd('0x1'));var BPromise=require('bluebird');var rs=require(_0xeccd('0x2'));var fs=require('fs');var Redis=require(_0xeccd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeccd('0x4'))(_0xeccd('0x5'));var config=require(_0xeccd('0x6'));var jayson=require(_0xeccd('0x7'));var client=jayson[_0xeccd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338742,_0x130f1c,_0x1b622f){return new BPromise(function(_0x1eebfb,_0x4b068e){return client[_0xeccd('0x9')](_0x338742,_0x1b622f)[_0xeccd('0xa')](function(_0x9dccd){logger[_0xeccd('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x130f1c,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'),JSON[_0xeccd('0xd')](_0x9dccd));if(_0x9dccd[_0xeccd('0xe')]){if(_0x9dccd[_0xeccd('0xe')][_0xeccd('0xf')]===0x1f4){logger['error'](_0xeccd('0x10'),_0x130f1c,_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);return _0x4b068e(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}logger[_0xeccd('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x130f1c,_0x9dccd['error'][_0xeccd('0x11')]);return _0x1eebfb(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}else{logger[_0xeccd('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'));_0x1eebfb(_0x9dccd[_0xeccd('0x12')]['message']);}})['catch'](function(_0x42e47e){logger[_0xeccd('0xe')](_0xeccd('0x10'),_0x130f1c,_0x42e47e);_0x4b068e(_0x42e47e);});});}exports[_0xeccd('0x13')]=function(_0xb0fad7){var _0x360d25=this;return new Promise(function(_0x466d98,_0x17596a){return db['OpenchannelQueueReport'][_0xeccd('0x14')](_0xb0fad7[_0xeccd('0x15')],{'raw':_0xb0fad7[_0xeccd('0x16')]?_0xb0fad7[_0xeccd('0x16')][_0xeccd('0x17')]===undefined?!![]:![]:!![]})[_0xeccd('0xa')](function(_0x508439){logger['info']('CreateOpenchannelQueueReport',_0xb0fad7);logger[_0xeccd('0x18')]('CreateOpenchannelQueueReport',_0xb0fad7,JSON[_0xeccd('0xd')](_0x508439));_0x466d98(_0x508439);})[_0xeccd('0x19')](function(_0x54083d){logger[_0xeccd('0xe')]('CreateOpenchannelQueueReport',_0x54083d[_0xeccd('0x11')],_0xb0fad7);_0x17596a(_0x360d25[_0xeccd('0xe')](0x1f4,_0x54083d[_0xeccd('0x11')]));});});};exports[_0xeccd('0x1a')]=function(_0x16e97a){var _0x5c4672=this;return new Promise(function(_0x4bc387,_0x560659){return db[_0xeccd('0x1b')][_0xeccd('0x1c')](_0x16e97a[_0xeccd('0x15')],{'raw':_0x16e97a[_0xeccd('0x16')]?_0x16e97a['options'][_0xeccd('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16e97a[_0xeccd('0x16')]?_0x16e97a[_0xeccd('0x16')][_0xeccd('0x1d')]||null:null,'attributes':_0x16e97a['options']?_0x16e97a[_0xeccd('0x16')][_0xeccd('0x1e')]||null:null,'limit':_0x16e97a[_0xeccd('0x16')]?_0x16e97a[_0xeccd('0x16')][_0xeccd('0x1f')]||null:null})[_0xeccd('0xa')](function(_0x2ea699){logger[_0xeccd('0xb')](_0xeccd('0x1a'),_0x16e97a);logger['debug'](_0xeccd('0x1a'),_0x16e97a,JSON['stringify'](_0x2ea699));_0x4bc387(_0x2ea699);})[_0xeccd('0x19')](function(_0x1817b7){logger[_0xeccd('0xe')](_0xeccd('0x1a'),_0x1817b7[_0xeccd('0x11')],_0x16e97a);_0x560659(_0x5c4672[_0xeccd('0xe')](0x1f4,_0x1817b7[_0xeccd('0x11')]));});});}; \ No newline at end of file +var _0x9158=['where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','debug','UpdateOpenchannelQueueReport','update'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x9158,0x16e));var _0x8915=function(_0x3b35f7,_0x5ce046){_0x3b35f7=_0x3b35f7-0x0;var _0x5da2cc=_0x9158[_0x3b35f7];return _0x5da2cc;};'use strict';var _=require(_0x8915('0x0'));var util=require(_0x8915('0x1'));var moment=require(_0x8915('0x2'));var BPromise=require('bluebird');var rs=require(_0x8915('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8915('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8915('0x5'));var config=require(_0x8915('0x6'));var jayson=require(_0x8915('0x7'));var client=jayson[_0x8915('0x8')][_0x8915('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20ff3d,_0x33abdd,_0x100d72){return new BPromise(function(_0x50d1f8,_0x41be04){return client[_0x8915('0xa')](_0x20ff3d,_0x100d72)[_0x8915('0xb')](function(_0x1a5403){logger[_0x8915('0xc')](_0x8915('0xd'),_0x33abdd,_0x8915('0xe'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x33abdd,_0x8915('0xe'),JSON[_0x8915('0xf')](_0x1a5403));if(_0x1a5403[_0x8915('0x10')]){if(_0x1a5403[_0x8915('0x10')][_0x8915('0x11')]===0x1f4){logger[_0x8915('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x33abdd,_0x1a5403[_0x8915('0x10')][_0x8915('0x12')]);return _0x41be04(_0x1a5403['error'][_0x8915('0x12')]);}logger['error'](_0x8915('0xd'),_0x33abdd,_0x1a5403['error'][_0x8915('0x12')]);return _0x50d1f8(_0x1a5403[_0x8915('0x10')][_0x8915('0x12')]);}else{logger[_0x8915('0xc')](_0x8915('0xd'),_0x33abdd,_0x8915('0xe'));_0x50d1f8(_0x1a5403[_0x8915('0x13')][_0x8915('0x12')]);}})[_0x8915('0x14')](function(_0x3f541c){logger[_0x8915('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x33abdd,_0x3f541c);_0x41be04(_0x3f541c);});});}exports[_0x8915('0x15')]=function(_0x913dc){var _0x5ccd36=this;return new Promise(function(_0x5987d4,_0x17bb6c){return db[_0x8915('0x16')][_0x8915('0x17')](_0x913dc[_0x8915('0x18')],{'raw':_0x913dc[_0x8915('0x19')]?_0x913dc[_0x8915('0x19')][_0x8915('0x1a')]===undefined?!![]:![]:!![]})[_0x8915('0xb')](function(_0x511dcd){logger['info'](_0x8915('0x15'),_0x913dc);logger[_0x8915('0x1b')](_0x8915('0x15'),_0x913dc,JSON[_0x8915('0xf')](_0x511dcd));_0x5987d4(_0x511dcd);})['catch'](function(_0x2eebe1){logger[_0x8915('0x10')](_0x8915('0x15'),_0x2eebe1[_0x8915('0x12')],_0x913dc);_0x17bb6c(_0x5ccd36[_0x8915('0x10')](0x1f4,_0x2eebe1[_0x8915('0x12')]));});});};exports[_0x8915('0x1c')]=function(_0x2568d8){var _0x5c061d=this;return new Promise(function(_0x4159c9,_0x4e5973){return db[_0x8915('0x16')][_0x8915('0x1d')](_0x2568d8['body'],{'raw':_0x2568d8[_0x8915('0x19')]?_0x2568d8[_0x8915('0x19')][_0x8915('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2568d8[_0x8915('0x19')]?_0x2568d8[_0x8915('0x19')][_0x8915('0x1e')]||null:null,'attributes':_0x2568d8[_0x8915('0x19')]?_0x2568d8['options'][_0x8915('0x1f')]||null:null,'limit':_0x2568d8[_0x8915('0x19')]?_0x2568d8['options'][_0x8915('0x20')]||null:null})['then'](function(_0x3b133c){logger['info'](_0x8915('0x1c'),_0x2568d8);logger[_0x8915('0x1b')]('UpdateOpenchannelQueueReport',_0x2568d8,JSON[_0x8915('0xf')](_0x3b133c));_0x4159c9(_0x3b133c);})[_0x8915('0x14')](function(_0x18296c){logger[_0x8915('0x10')](_0x8915('0x1c'),_0x18296c['message'],_0x2568d8);_0x4e5973(_0x5c061d[_0x8915('0x10')](0x1f4,_0x18296c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index cc1342d..c5a4ca5 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 _0x2715=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','describe','/:id','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3b013f,_0x58c82b){var _0x5a16c6=function(_0x8b2070){while(--_0x8b2070){_0x3b013f['push'](_0x3b013f['shift']());}};_0x5a16c6(++_0x58c82b);}(_0x2715,0xe2));var _0x5271=function(_0x186182,_0x10ea62){_0x186182=_0x186182-0x0;var _0x595d35=_0x2715[_0x186182];return _0x595d35;};'use strict';var multer=require(_0x5271('0x0'));var util=require(_0x5271('0x1'));var path=require(_0x5271('0x2'));var timeout=require('connect-timeout');var express=require(_0x5271('0x3'));var router=express[_0x5271('0x4')]();var fs_extra=require(_0x5271('0x5'));var auth=require(_0x5271('0x6'));var interaction=require(_0x5271('0x7'));var config=require(_0x5271('0x8'));var controller=require(_0x5271('0x9'));router[_0x5271('0xa')]('/',auth[_0x5271('0xb')](),controller['index']);router[_0x5271('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5271('0xc')]);router[_0x5271('0xa')](_0x5271('0xd'),auth[_0x5271('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5271('0xe')](_0x5271('0xd'),auth[_0x5271('0xb')](),controller[_0x5271('0xf')]);router[_0x5271('0x10')](_0x5271('0xd'),auth['isAuthenticated'](),controller[_0x5271('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf7b4=['../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','/describe','isAuthenticated','/:id','show','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x21b8db,_0x2593ee){var _0x2d14c8=function(_0x17c21){while(--_0x17c21){_0x21b8db['push'](_0x21b8db['shift']());}};_0x2d14c8(++_0x2593ee);}(_0xf7b4,0x12c));var _0x4f7b=function(_0x4c0c77,_0x3c609e){_0x4c0c77=_0x4c0c77-0x0;var _0x4b20b6=_0xf7b4[_0x4c0c77];return _0x4b20b6;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express[_0x4f7b('0x3')]();var fs_extra=require(_0x4f7b('0x4'));var auth=require(_0x4f7b('0x5'));var interaction=require(_0x4f7b('0x6'));var config=require(_0x4f7b('0x7'));var controller=require(_0x4f7b('0x8'));router[_0x4f7b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4f7b('0x9')](_0x4f7b('0xa'),auth[_0x4f7b('0xb')](),controller['describe']);router[_0x4f7b('0x9')](_0x4f7b('0xc'),auth[_0x4f7b('0xb')](),controller[_0x4f7b('0xd')]);router['post']('/',auth[_0x4f7b('0xb')](),controller['create']);router['put'](_0x4f7b('0xc'),auth[_0x4f7b('0xb')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4f7b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 5efe053..670789f 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4651bd,_0x12a42f){var _0xdf510d=function(_0x12e500){while(--_0x12e500){_0x4651bd['push'](_0x4651bd['shift']());}};_0xdf510d(++_0x12a42f);}(_0x34e8,0x12c));var _0x834e=function(_0x35a751,_0x393244){_0x35a751=_0x35a751-0x0;var _0x336e2f=_0x34e8[_0x35a751];return _0x336e2f;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4cbde1,_0x5785ec){var _0x37d42=function(_0x318af3){while(--_0x318af3){_0x4cbde1['push'](_0x4cbde1['shift']());}};_0x37d42(++_0x5785ec);}(_0x54ef,0x112));var _0xf54e=function(_0x5cbda6,_0x1115af){_0x5cbda6=_0x5cbda6-0x0;var _0x1dfbbb=_0x54ef[_0x5cbda6];return _0x1dfbbb;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ebb54c6..7badd03 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 _0x80d1=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','set','Content-Range','apply','reject','save','update','then','stack','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type','model','map','name','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','keys','body','catch','params','destroy','find'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x80d1,0x125));var _0x180d=function(_0x2eadf4,_0x592302){_0x2eadf4=_0x2eadf4-0x0;var _0x44ad1a=_0x80d1[_0x2eadf4];return _0x44ad1a;};'use strict';var emlformat=require(_0x180d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x180d('0x1'));var rp=require(_0x180d('0x2'));var moment=require(_0x180d('0x3'));var BPromise=require(_0x180d('0x4'));var Mustache=require(_0x180d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x180d('0x6'));var csv=require(_0x180d('0x7'));var ejs=require(_0x180d('0x8'));var fs=require('fs');var fs_extra=require(_0x180d('0x9'));var _=require(_0x180d('0xa'));var squel=require(_0x180d('0xb'));var crypto=require(_0x180d('0xc'));var jsforce=require(_0x180d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x180d('0x7'));var querystring=require(_0x180d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x180d('0xf'));var hardwareService=require(_0x180d('0x10'));var logger=require('../../config/logger')(_0x180d('0x11'));var utils=require(_0x180d('0x12'));var config=require(_0x180d('0x13'));var licenseUtil=require(_0x180d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b5ab7,_0x329217){_0x329217=_0x329217||0xcc;return function(_0x27ecf3){if(_0x27ecf3){return _0x2b5ab7[_0x180d('0x15')](_0x329217);}return _0x2b5ab7['status'](_0x329217)[_0x180d('0x16')]();};}function respondWithResult(_0x12a5ef,_0x3be5a){_0x3be5a=_0x3be5a||0xc8;return function(_0x59a438){if(_0x59a438){return _0x12a5ef[_0x180d('0x17')](_0x3be5a)[_0x180d('0x18')](_0x59a438);}};}function respondWithFilteredResult(_0x36658e,_0x350d89){return function(_0xc3d8a3){if(_0xc3d8a3){var _0x22017f=typeof _0x350d89['offset']===_0x180d('0x19')&&typeof _0x350d89[_0x180d('0x1a')]===_0x180d('0x19');var _0xcbbb0e=_0xc3d8a3['count'];var _0x37e7ea=_0x22017f?0x0:_0x350d89['offset'];var _0x54e447=_0x22017f?_0xc3d8a3['count']:_0x350d89['offset']+_0x350d89['limit'];var _0x60017c;if(_0x54e447>=_0xcbbb0e){_0x54e447=_0xcbbb0e;_0x60017c=0xc8;}else{_0x60017c=0xce;}_0x36658e[_0x180d('0x17')](_0x60017c);return _0x36658e[_0x180d('0x1b')](_0x180d('0x1c'),_0x37e7ea+'-'+_0x54e447+'/'+_0xcbbb0e)[_0x180d('0x18')](_0xc3d8a3);}return null;};}function patchUpdates(_0x45772b){return function(_0x5b7260){try{jsonpatch[_0x180d('0x1d')](_0x5b7260,_0x45772b,!![]);}catch(_0x2a8272){return BPromise[_0x180d('0x1e')](_0x2a8272);}return _0x5b7260[_0x180d('0x1f')]();};}function saveUpdates(_0xa871f1,_0x1f9ba7){return function(_0x1f72a2){if(_0x1f72a2){return _0x1f72a2[_0x180d('0x20')](_0xa871f1)[_0x180d('0x21')](function(_0x2cbbfb){return _0x2cbbfb;});}return null;};}function removeEntity(_0x15e94d,_0x102790){return function(_0x1c30b5){if(_0x1c30b5){return _0x1c30b5['destroy']()['then'](function(){_0x15e94d[_0x180d('0x17')](0xcc)[_0x180d('0x16')]();});}};}function handleEntityNotFound(_0x5dfc81,_0x128eb5){return function(_0x459f7b){if(!_0x459f7b){_0x5dfc81[_0x180d('0x15')](0x194);}return _0x459f7b;};}function handleError(_0x168124,_0x4e6988){_0x4e6988=_0x4e6988||0x1f4;return function(_0x609519){logger['error'](_0x609519[_0x180d('0x22')]);if(_0x609519['name']){delete _0x609519['name'];}_0x168124[_0x180d('0x17')](_0x4e6988)[_0x180d('0x23')](_0x609519);};}exports[_0x180d('0x24')]=function(_0x4c4784,_0x100f51){var _0x561d73={},_0x4098f9={},_0x49978f={'count':0x0,'rows':[]};var _0x51c8ff=_['map'](db[_0x180d('0x25')][_0x180d('0x26')],function(_0x924b87){return{'name':_0x924b87[_0x180d('0x27')],'type':_0x924b87[_0x180d('0x28')]['key']};});_0x4098f9[_0x180d('0x29')]=_[_0x180d('0x2a')](_0x51c8ff,_0x180d('0x2b'));_0x4098f9[_0x180d('0x2c')]=_['keys'](_0x4c4784['query']);_0x4098f9['filters']=_[_0x180d('0x2d')](_0x4098f9[_0x180d('0x29')],_0x4098f9[_0x180d('0x2c')]);_0x561d73[_0x180d('0x2e')]=_['intersection'](_0x4098f9[_0x180d('0x29')],qs[_0x180d('0x2f')](_0x4c4784[_0x180d('0x2c')]['fields']));_0x561d73[_0x180d('0x2e')]=_0x561d73['attributes'][_0x180d('0x30')]?_0x561d73[_0x180d('0x2e')]:_0x4098f9[_0x180d('0x29')];if(!_0x4c4784[_0x180d('0x2c')][_0x180d('0x31')]('nolimit')){_0x561d73[_0x180d('0x1a')]=qs['limit'](_0x4c4784[_0x180d('0x2c')][_0x180d('0x1a')]);_0x561d73[_0x180d('0x32')]=qs['offset'](_0x4c4784[_0x180d('0x2c')]['offset']);}_0x561d73[_0x180d('0x33')]=qs[_0x180d('0x34')](_0x4c4784['query']['sort']);_0x561d73['where']=qs[_0x180d('0x35')](_[_0x180d('0x36')](_0x4c4784[_0x180d('0x2c')],_0x4098f9[_0x180d('0x35')]),_0x51c8ff);if(_0x4c4784['query'][_0x180d('0x37')]){_0x561d73[_0x180d('0x38')]=_[_0x180d('0x39')](_0x561d73[_0x180d('0x38')],{'$or':_[_0x180d('0x2a')](_0x51c8ff,function(_0x9d68ef){if(_0x9d68ef[_0x180d('0x28')]!==_0x180d('0x3a')){var _0x508c89={};_0x508c89[_0x9d68ef[_0x180d('0x2b')]]={'$like':'%'+_0x4c4784[_0x180d('0x2c')][_0x180d('0x37')]+'%'};return _0x508c89;}})});}_0x561d73=_[_0x180d('0x39')]({},_0x561d73,_0x4c4784[_0x180d('0x3b')]);var _0x35dfae={'where':_0x561d73[_0x180d('0x38')]};return db[_0x180d('0x25')][_0x180d('0x3c')](_0x35dfae)[_0x180d('0x21')](function(_0x5e01d7){_0x49978f['count']=_0x5e01d7;if(_0x4c4784[_0x180d('0x2c')][_0x180d('0x3d')]){_0x561d73[_0x180d('0x3e')]=[{'all':!![]}];}return db[_0x180d('0x25')][_0x180d('0x3f')](_0x561d73);})[_0x180d('0x21')](function(_0x579206){_0x49978f[_0x180d('0x40')]=_0x579206;return _0x49978f;})[_0x180d('0x21')](respondWithFilteredResult(_0x100f51,_0x561d73))['catch'](handleError(_0x100f51,null));};exports[_0x180d('0x41')]=function(_0x33a42d,_0x1d21bc){var _0x3be5dc={'raw':!![],'where':{'id':_0x33a42d['params']['id']}},_0x45eea7={};_0x45eea7[_0x180d('0x29')]=_[_0x180d('0x42')](db['OpenchannelTransferReport'][_0x180d('0x26')]);_0x45eea7[_0x180d('0x2c')]=_[_0x180d('0x42')](_0x33a42d[_0x180d('0x2c')]);_0x45eea7[_0x180d('0x35')]=_[_0x180d('0x2d')](_0x45eea7['model'],_0x45eea7['query']);_0x3be5dc[_0x180d('0x2e')]=_[_0x180d('0x2d')](_0x45eea7[_0x180d('0x29')],qs[_0x180d('0x2f')](_0x33a42d['query'][_0x180d('0x2f')]));_0x3be5dc['attributes']=_0x3be5dc[_0x180d('0x2e')][_0x180d('0x30')]?_0x3be5dc[_0x180d('0x2e')]:_0x45eea7[_0x180d('0x29')];if(_0x33a42d[_0x180d('0x2c')]['includeAll']){_0x3be5dc[_0x180d('0x3e')]=[{'all':!![]}];}_0x3be5dc=_['merge']({},_0x3be5dc,_0x33a42d[_0x180d('0x3b')]);return db['OpenchannelTransferReport']['find'](_0x3be5dc)[_0x180d('0x21')](handleEntityNotFound(_0x1d21bc,null))[_0x180d('0x21')](respondWithResult(_0x1d21bc,null))['catch'](handleError(_0x1d21bc,null));};exports['create']=function(_0x4d2866,_0x33d2df){return db[_0x180d('0x25')]['create'](_0x4d2866[_0x180d('0x43')],{})[_0x180d('0x21')](respondWithResult(_0x33d2df,0xc9))[_0x180d('0x44')](handleError(_0x33d2df,null));};exports[_0x180d('0x20')]=function(_0x4fe7bd,_0x4810c6){if(_0x4fe7bd['body']['id']){delete _0x4fe7bd['body']['id'];}return db[_0x180d('0x25')]['find']({'where':{'id':_0x4fe7bd[_0x180d('0x45')]['id']}})[_0x180d('0x21')](handleEntityNotFound(_0x4810c6,null))[_0x180d('0x21')](saveUpdates(_0x4fe7bd[_0x180d('0x43')],null))['then'](respondWithResult(_0x4810c6,null))[_0x180d('0x44')](handleError(_0x4810c6,null));};exports[_0x180d('0x46')]=function(_0x1e07f3,_0x4e8715){return db['OpenchannelTransferReport'][_0x180d('0x47')]({'where':{'id':_0x1e07f3[_0x180d('0x45')]['id']}})[_0x180d('0x21')](handleEntityNotFound(_0x4e8715,null))[_0x180d('0x21')](removeEntity(_0x4e8715,null))[_0x180d('0x44')](handleError(_0x4e8715,null));};exports[_0x180d('0x48')]=function(_0x1f9bec,_0x330282){return db[_0x180d('0x25')][_0x180d('0x48')]()[_0x180d('0x21')](respondWithResult(_0x330282,null))['catch'](handleError(_0x330282,null));}; \ No newline at end of file +var _0x40c7=['intersection','model','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','rows','catch','show','params','length','include','options','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','query','keys','filters'];(function(_0x52a08b,_0x12388d){var _0x2c6670=function(_0x253827){while(--_0x253827){_0x52a08b['push'](_0x52a08b['shift']());}};_0x2c6670(++_0x12388d);}(_0x40c7,0xf9));var _0x740c=function(_0x22cc36,_0x2c8292){_0x22cc36=_0x22cc36-0x0;var _0x7fc85=_0x40c7[_0x22cc36];return _0x7fc85;};'use strict';var emlformat=require(_0x740c('0x0'));var rimraf=require(_0x740c('0x1'));var zipdir=require(_0x740c('0x2'));var jsonpatch=require(_0x740c('0x3'));var rp=require('request-promise');var moment=require(_0x740c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x740c('0x5'));var util=require(_0x740c('0x6'));var path=require(_0x740c('0x7'));var sox=require(_0x740c('0x8'));var csv=require(_0x740c('0x9'));var ejs=require(_0x740c('0xa'));var fs=require('fs');var fs_extra=require(_0x740c('0xb'));var _=require(_0x740c('0xc'));var squel=require(_0x740c('0xd'));var crypto=require('crypto');var jsforce=require(_0x740c('0xe'));var deskjs=require(_0x740c('0xf'));var toCsv=require(_0x740c('0x9'));var querystring=require(_0x740c('0x10'));var Papa=require(_0x740c('0x11'));var Redis=require('ioredis');var authService=require(_0x740c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x740c('0x13'));var hardwareService=require(_0x740c('0x14'));var logger=require(_0x740c('0x15'))(_0x740c('0x16'));var utils=require(_0x740c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x740c('0x18'));var db=require(_0x740c('0x19'))['db'];function respondWithStatusCode(_0x195bb5,_0x17d600){_0x17d600=_0x17d600||0xcc;return function(_0x567a12){if(_0x567a12){return _0x195bb5[_0x740c('0x1a')](_0x17d600);}return _0x195bb5[_0x740c('0x1b')](_0x17d600)[_0x740c('0x1c')]();};}function respondWithResult(_0x16aef2,_0x7661cd){_0x7661cd=_0x7661cd||0xc8;return function(_0x50d241){if(_0x50d241){return _0x16aef2['status'](_0x7661cd)[_0x740c('0x1d')](_0x50d241);}};}function respondWithFilteredResult(_0x28538f,_0x3a5e07){return function(_0x46db23){if(_0x46db23){var _0x25d5bb=typeof _0x3a5e07[_0x740c('0x1e')]==='undefined'&&typeof _0x3a5e07[_0x740c('0x1f')]===_0x740c('0x20');var _0xb32a27=_0x46db23[_0x740c('0x21')];var _0x37d243=_0x25d5bb?0x0:_0x3a5e07['offset'];var _0xa0afcc=_0x25d5bb?_0x46db23[_0x740c('0x21')]:_0x3a5e07['offset']+_0x3a5e07[_0x740c('0x1f')];var _0x7b6c87;if(_0xa0afcc>=_0xb32a27){_0xa0afcc=_0xb32a27;_0x7b6c87=0xc8;}else{_0x7b6c87=0xce;}_0x28538f[_0x740c('0x1b')](_0x7b6c87);return _0x28538f[_0x740c('0x22')]('Content-Range',_0x37d243+'-'+_0xa0afcc+'/'+_0xb32a27)['json'](_0x46db23);}return null;};}function patchUpdates(_0x4ba42){return function(_0x12e0ff){try{jsonpatch[_0x740c('0x23')](_0x12e0ff,_0x4ba42,!![]);}catch(_0x2147d4){return BPromise[_0x740c('0x24')](_0x2147d4);}return _0x12e0ff[_0x740c('0x25')]();};}function saveUpdates(_0x1f0124,_0x544744){return function(_0x3e1e63){if(_0x3e1e63){return _0x3e1e63['update'](_0x1f0124)[_0x740c('0x26')](function(_0x2f3fd4){return _0x2f3fd4;});}return null;};}function removeEntity(_0x14d576,_0x5ee52c){return function(_0x639716){if(_0x639716){return _0x639716[_0x740c('0x27')]()[_0x740c('0x26')](function(){_0x14d576['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d4e8,_0xf42ad6){return function(_0x52725e){if(!_0x52725e){_0x44d4e8[_0x740c('0x1a')](0x194);}return _0x52725e;};}function handleError(_0x9e4f70,_0x377b0f){_0x377b0f=_0x377b0f||0x1f4;return function(_0x30b5f9){logger['error'](_0x30b5f9['stack']);if(_0x30b5f9[_0x740c('0x28')]){delete _0x30b5f9[_0x740c('0x28')];}_0x9e4f70[_0x740c('0x1b')](_0x377b0f)[_0x740c('0x29')](_0x30b5f9);};}exports[_0x740c('0x2a')]=function(_0x53eb81,_0x36eb45){var _0x4d80a0={},_0x1b30c2={},_0x44c667={'count':0x0,'rows':[]};var _0x2c1970=_[_0x740c('0x2b')](db[_0x740c('0x2c')][_0x740c('0x2d')],function(_0x39d731){return{'name':_0x39d731['fieldName'],'type':_0x39d731[_0x740c('0x2e')][_0x740c('0x2f')]};});_0x1b30c2['model']=_[_0x740c('0x2b')](_0x2c1970,_0x740c('0x28'));_0x1b30c2[_0x740c('0x30')]=_[_0x740c('0x31')](_0x53eb81[_0x740c('0x30')]);_0x1b30c2[_0x740c('0x32')]=_[_0x740c('0x33')](_0x1b30c2[_0x740c('0x34')],_0x1b30c2['query']);_0x4d80a0[_0x740c('0x35')]=_[_0x740c('0x33')](_0x1b30c2[_0x740c('0x34')],qs['fields'](_0x53eb81[_0x740c('0x30')][_0x740c('0x36')]));_0x4d80a0[_0x740c('0x35')]=_0x4d80a0['attributes']['length']?_0x4d80a0['attributes']:_0x1b30c2['model'];if(!_0x53eb81['query']['hasOwnProperty'](_0x740c('0x37'))){_0x4d80a0[_0x740c('0x1f')]=qs[_0x740c('0x1f')](_0x53eb81['query'][_0x740c('0x1f')]);_0x4d80a0['offset']=qs['offset'](_0x53eb81['query'][_0x740c('0x1e')]);}_0x4d80a0[_0x740c('0x38')]=qs[_0x740c('0x39')](_0x53eb81[_0x740c('0x30')][_0x740c('0x39')]);_0x4d80a0[_0x740c('0x3a')]=qs[_0x740c('0x32')](_['pick'](_0x53eb81['query'],_0x1b30c2['filters']),_0x2c1970);if(_0x53eb81[_0x740c('0x30')]['filter']){_0x4d80a0[_0x740c('0x3a')]=_['merge'](_0x4d80a0['where'],{'$or':_[_0x740c('0x2b')](_0x2c1970,function(_0x242167){if(_0x242167[_0x740c('0x2e')]!==_0x740c('0x3b')){var _0xf1ce65={};_0xf1ce65[_0x242167[_0x740c('0x28')]]={'$like':'%'+_0x53eb81['query'][_0x740c('0x3c')]+'%'};return _0xf1ce65;}})});}_0x4d80a0=_[_0x740c('0x3d')]({},_0x4d80a0,_0x53eb81['options']);var _0x14077c={'where':_0x4d80a0[_0x740c('0x3a')]};return db[_0x740c('0x2c')]['count'](_0x14077c)[_0x740c('0x26')](function(_0x4e50e4){_0x44c667[_0x740c('0x21')]=_0x4e50e4;if(_0x53eb81[_0x740c('0x30')][_0x740c('0x3e')]){_0x4d80a0['include']=[{'all':!![]}];}return db[_0x740c('0x2c')]['findAll'](_0x4d80a0);})[_0x740c('0x26')](function(_0x699eca){_0x44c667[_0x740c('0x3f')]=_0x699eca;return _0x44c667;})[_0x740c('0x26')](respondWithFilteredResult(_0x36eb45,_0x4d80a0))[_0x740c('0x40')](handleError(_0x36eb45,null));};exports[_0x740c('0x41')]=function(_0x4b43bc,_0x26fd3d){var _0x9f4205={'raw':!![],'where':{'id':_0x4b43bc[_0x740c('0x42')]['id']}},_0xeb4124={};_0xeb4124[_0x740c('0x34')]=_['keys'](db[_0x740c('0x2c')][_0x740c('0x2d')]);_0xeb4124['query']=_[_0x740c('0x31')](_0x4b43bc[_0x740c('0x30')]);_0xeb4124['filters']=_[_0x740c('0x33')](_0xeb4124['model'],_0xeb4124[_0x740c('0x30')]);_0x9f4205[_0x740c('0x35')]=_['intersection'](_0xeb4124[_0x740c('0x34')],qs['fields'](_0x4b43bc[_0x740c('0x30')]['fields']));_0x9f4205['attributes']=_0x9f4205['attributes'][_0x740c('0x43')]?_0x9f4205[_0x740c('0x35')]:_0xeb4124[_0x740c('0x34')];if(_0x4b43bc[_0x740c('0x30')][_0x740c('0x3e')]){_0x9f4205[_0x740c('0x44')]=[{'all':!![]}];}_0x9f4205=_[_0x740c('0x3d')]({},_0x9f4205,_0x4b43bc[_0x740c('0x45')]);return db[_0x740c('0x2c')][_0x740c('0x46')](_0x9f4205)['then'](handleEntityNotFound(_0x26fd3d,null))['then'](respondWithResult(_0x26fd3d,null))[_0x740c('0x40')](handleError(_0x26fd3d,null));};exports[_0x740c('0x47')]=function(_0x4b55cc,_0x4b04ce){return db[_0x740c('0x2c')][_0x740c('0x47')](_0x4b55cc['body'],{})[_0x740c('0x26')](respondWithResult(_0x4b04ce,0xc9))[_0x740c('0x40')](handleError(_0x4b04ce,null));};exports[_0x740c('0x48')]=function(_0x274387,_0x3e7bd9){if(_0x274387['body']['id']){delete _0x274387[_0x740c('0x49')]['id'];}return db[_0x740c('0x2c')][_0x740c('0x46')]({'where':{'id':_0x274387[_0x740c('0x42')]['id']}})[_0x740c('0x26')](handleEntityNotFound(_0x3e7bd9,null))['then'](saveUpdates(_0x274387[_0x740c('0x49')],null))[_0x740c('0x26')](respondWithResult(_0x3e7bd9,null))[_0x740c('0x40')](handleError(_0x3e7bd9,null));};exports[_0x740c('0x27')]=function(_0x31d46d,_0x3dc0e0){return db['OpenchannelTransferReport'][_0x740c('0x46')]({'where':{'id':_0x31d46d[_0x740c('0x42')]['id']}})[_0x740c('0x26')](handleEntityNotFound(_0x3dc0e0,null))[_0x740c('0x26')](removeEntity(_0x3dc0e0,null))[_0x740c('0x40')](handleError(_0x3dc0e0,null));};exports[_0x740c('0x4a')]=function(_0x52d04d,_0x3d88ec){return db[_0x740c('0x2c')][_0x740c('0x4a')]()[_0x740c('0x26')](respondWithResult(_0x3d88ec,null))[_0x740c('0x40')](handleError(_0x3d88ec,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 04acc62..4098cda 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 _0x99fd=['uniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x1ec479,_0x54d127){var _0x43ca09=function(_0x18518f){while(--_0x18518f){_0x1ec479['push'](_0x1ec479['shift']());}};_0x43ca09(++_0x54d127);}(_0x99fd,0x1ae));var _0xd99f=function(_0x2de70a,_0xb5dc36){_0x2de70a=_0x2de70a-0x0;var _0x33bae2=_0x99fd[_0x2de70a];return _0x33bae2;};'use strict';var _=require(_0xd99f('0x0'));var util=require('util');var logger=require(_0xd99f('0x1'))(_0xd99f('0x2'));var moment=require('moment');var BPromise=require(_0xd99f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd99f('0x4'));var rimraf=require(_0xd99f('0x5'));var config=require('../../config/environment');var attributes=require(_0xd99f('0x6'));module['exports']=function(_0x5d03cd,_0x3df0f5){return _0x5d03cd[_0xd99f('0x7')](_0xd99f('0x8'),attributes,{'tableName':_0xd99f('0x9'),'paranoid':![],'indexes':[{'name':_0xd99f('0xa'),'fields':[_0xd99f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x04df=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x04df,0x155));var _0xf04d=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x04df[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xf04d('0x0'));var util=require(_0xf04d('0x1'));var logger=require(_0xf04d('0x2'))(_0xf04d('0x3'));var moment=require(_0xf04d('0x4'));var BPromise=require(_0xf04d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf04d('0x6'));var rimraf=require(_0xf04d('0x7'));var config=require(_0xf04d('0x8'));var attributes=require(_0xf04d('0x9'));module['exports']=function(_0x510732,_0x28bd00){return _0x510732['define'](_0xf04d('0xa'),attributes,{'tableName':_0xf04d('0xb'),'paranoid':![],'indexes':[{'name':_0xf04d('0xc'),'fields':[_0xf04d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 2030b60..86a8808 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 _0x14f5=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x436082,_0x358406){var _0x1455fd=function(_0x23f7e8){while(--_0x23f7e8){_0x436082['push'](_0x436082['shift']());}};_0x1455fd(++_0x358406);}(_0x14f5,0xae));var _0x514f=function(_0x4f0ee1,_0xf12678){_0x4f0ee1=_0x4f0ee1-0x0;var _0xff05aa=_0x14f5[_0x4f0ee1];return _0xff05aa;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var moment=require('moment');var BPromise=require(_0x514f('0x1'));var rs=require(_0x514f('0x2'));var fs=require('fs');var Redis=require(_0x514f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x514f('0x4'));var logger=require(_0x514f('0x5'))('rpc');var config=require(_0x514f('0x6'));var jayson=require(_0x514f('0x7'));var client=jayson[_0x514f('0x8')][_0x514f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x463985,_0x43ec42,_0xdb9614){return new BPromise(function(_0x4a5497,_0x203b02){return client['request'](_0x463985,_0xdb9614)[_0x514f('0xa')](function(_0x1e3fa7){logger[_0x514f('0xb')](_0x514f('0xc'),_0x43ec42,_0x514f('0xd'));logger[_0x514f('0xe')](_0x514f('0xf'),_0x43ec42,'request\x20sent',JSON['stringify'](_0x1e3fa7));if(_0x1e3fa7['error']){if(_0x1e3fa7[_0x514f('0x10')][_0x514f('0x11')]===0x1f4){logger[_0x514f('0x10')](_0x514f('0xc'),_0x43ec42,_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);return _0x203b02(_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);}logger[_0x514f('0x10')](_0x514f('0xc'),_0x43ec42,_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);return _0x4a5497(_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);}else{logger[_0x514f('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x43ec42,_0x514f('0xd'));_0x4a5497(_0x1e3fa7[_0x514f('0x13')]['message']);}})[_0x514f('0x14')](function(_0x53851d){logger[_0x514f('0x10')](_0x514f('0xc'),_0x43ec42,_0x53851d);_0x203b02(_0x53851d);});});} \ No newline at end of file +var _0x8ece=['client','http','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ece,0x195));var _0xe8ec=function(_0x245885,_0x15248e){_0x245885=_0x245885-0x0;var _0x5911e0=_0x8ece[_0x245885];return _0x5911e0;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x4'))['db'];var utils=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x64ed4c,_0x234b67,_0x3682cb){return new BPromise(function(_0x122f36,_0x406f7e){return client['request'](_0x64ed4c,_0x3682cb)[_0xe8ec('0xb')](function(_0x5e1fe9){logger[_0xe8ec('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x234b67,_0xe8ec('0xd'));logger[_0xe8ec('0xe')](_0xe8ec('0xf'),_0x234b67,_0xe8ec('0xd'),JSON[_0xe8ec('0x10')](_0x5e1fe9));if(_0x5e1fe9[_0xe8ec('0x11')]){if(_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x12')]===0x1f4){logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);return _0x406f7e(_0x5e1fe9[_0xe8ec('0x11')]['message']);}logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);return _0x122f36(_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);}else{logger[_0xe8ec('0xc')](_0xe8ec('0x13'),_0x234b67,'request\x20sent');_0x122f36(_0x5e1fe9[_0xe8ec('0x15')][_0xe8ec('0x14')]);}})[_0xe8ec('0x16')](function(_0x50f8ed){logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x50f8ed);_0x406f7e(_0x50f8ed);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 6ffdc81..73549fb 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 _0xa8b4=['put','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','show','create'];(function(_0x3a1f0f,_0x5b0b63){var _0x5cefe8=function(_0x3d5a41){while(--_0x3d5a41){_0x3a1f0f['push'](_0x3a1f0f['shift']());}};_0x5cefe8(++_0x5b0b63);}(_0xa8b4,0xcb));var _0x4a8b=function(_0x32d3cd,_0x5de78d){_0x32d3cd=_0x32d3cd-0x0;var _0x4552b4=_0xa8b4[_0x32d3cd];return _0x4552b4;};'use strict';var multer=require(_0x4a8b('0x0'));var util=require(_0x4a8b('0x1'));var path=require(_0x4a8b('0x2'));var timeout=require(_0x4a8b('0x3'));var express=require('express');var router=express[_0x4a8b('0x4')]();var fs_extra=require(_0x4a8b('0x5'));var auth=require(_0x4a8b('0x6'));var interaction=require(_0x4a8b('0x7'));var config=require('../../config/environment');var controller=require(_0x4a8b('0x8'));router[_0x4a8b('0x9')]('/',auth[_0x4a8b('0xa')](),controller['index']);router[_0x4a8b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4a8b('0xb')]);router['post']('/',auth[_0x4a8b('0xa')](),controller[_0x4a8b('0xc')]);router[_0x4a8b('0xd')]('/:id',auth[_0x4a8b('0xa')](),controller[_0x4a8b('0xe')]);router[_0x4a8b('0xf')](_0x4a8b('0x10'),auth[_0x4a8b('0xa')](),controller['destroy']);module[_0x4a8b('0x11')]=router; \ No newline at end of file +var _0xa537=['express','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','index','get','/:id','isAuthenticated','show','create','put','update','delete','exports','util','connect-timeout'];(function(_0x3b248a,_0x2eed41){var _0x29e371=function(_0x5ad2fb){while(--_0x5ad2fb){_0x3b248a['push'](_0x3b248a['shift']());}};_0x29e371(++_0x2eed41);}(_0xa537,0x152));var _0x7a53=function(_0x375d49,_0x4125d9){_0x375d49=_0x375d49-0x0;var _0x40b1ba=_0xa537[_0x375d49];return _0x40b1ba;};'use strict';var multer=require('multer');var util=require(_0x7a53('0x0'));var path=require('path');var timeout=require(_0x7a53('0x1'));var express=require(_0x7a53('0x2'));var router=express['Router']();var fs_extra=require(_0x7a53('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7a53('0x4'));var config=require(_0x7a53('0x5'));var controller=require(_0x7a53('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a53('0x7')]);router[_0x7a53('0x8')](_0x7a53('0x9'),auth[_0x7a53('0xa')](),controller[_0x7a53('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7a53('0xc')]);router[_0x7a53('0xd')](_0x7a53('0x9'),auth[_0x7a53('0xa')](),controller[_0x7a53('0xe')]);router[_0x7a53('0xf')]('/:id',auth[_0x7a53('0xa')](),controller['destroy']);module[_0x7a53('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 405b114..8120643 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 _0xff0f=['sequelize','exports','STRING','name'];(function(_0x14cab6,_0x2d6b31){var _0x1116a8=function(_0x45b802){while(--_0x45b802){_0x14cab6['push'](_0x14cab6['shift']());}};_0x1116a8(++_0x2d6b31);}(_0xff0f,0x1a4));var _0xfff0=function(_0x4a042d,_0x1cdc6d){_0x4a042d=_0x4a042d-0x0;var _0x186e87=_0xff0f[_0x4a042d];return _0x186e87;};'use strict';var Sequelize=require(_0xfff0('0x0'));module[_0xfff0('0x1')]={'name':{'type':Sequelize[_0xfff0('0x2')],'unique':_0xfff0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfff0('0x2')]}}; \ No newline at end of file +var _0xe80e=['STRING','name','exports'];(function(_0x542669,_0x580ed9){var _0x9def6d=function(_0x19cfa8){while(--_0x19cfa8){_0x542669['push'](_0x542669['shift']());}};_0x9def6d(++_0x580ed9);}(_0xe80e,0x101));var _0xee80=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xe80e[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require('sequelize');module[_0xee80('0x0')]={'name':{'type':Sequelize[_0xee80('0x1')],'unique':_0xee80('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xee80('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index a44275f..312c5e5 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 _0x3523=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','Pauses','UserProfileResource','then','end','sendStatus','name','send','map','Pause','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x386f75,_0x59c23a){var _0x20773b=function(_0x5c870b){while(--_0x5c870b){_0x386f75['push'](_0x386f75['shift']());}};_0x20773b(++_0x59c23a);}(_0x3523,0x1d2));var _0x3352=function(_0x594224,_0x3b3717){_0x594224=_0x594224-0x0;var _0x1bfca9=_0x3523[_0x594224];return _0x1bfca9;};'use strict';var emlformat=require(_0x3352('0x0'));var rimraf=require(_0x3352('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3352('0x2'));var moment=require(_0x3352('0x3'));var BPromise=require(_0x3352('0x4'));var Mustache=require(_0x3352('0x5'));var util=require(_0x3352('0x6'));var path=require('path');var sox=require(_0x3352('0x7'));var csv=require(_0x3352('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3352('0x9'));var _=require(_0x3352('0xa'));var squel=require(_0x3352('0xb'));var crypto=require(_0x3352('0xc'));var jsforce=require(_0x3352('0xd'));var deskjs=require(_0x3352('0xe'));var toCsv=require(_0x3352('0x8'));var querystring=require(_0x3352('0xf'));var Papa=require('papaparse');var Redis=require(_0x3352('0x10'));var authService=require(_0x3352('0x11'));var qs=require(_0x3352('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3352('0x13'))('api');var utils=require(_0x3352('0x14'));var config=require(_0x3352('0x15'));var licenseUtil=require(_0x3352('0x16'));var db=require(_0x3352('0x17'))['db'];function respondWithStatusCode(_0x5c9121,_0x3bc50f){_0x3bc50f=_0x3bc50f||0xcc;return function(_0x5bfd0a){if(_0x5bfd0a){return _0x5c9121['sendStatus'](_0x3bc50f);}return _0x5c9121[_0x3352('0x18')](_0x3bc50f)['end']();};}function respondWithResult(_0x14df54,_0x4d85f8){_0x4d85f8=_0x4d85f8||0xc8;return function(_0x20e010){if(_0x20e010){return _0x14df54[_0x3352('0x18')](_0x4d85f8)['json'](_0x20e010);}};}function respondWithFilteredResult(_0x45781d,_0x2c0003){return function(_0x103d4c){if(_0x103d4c){var _0x42b5d1=typeof _0x2c0003[_0x3352('0x19')]===_0x3352('0x1a')&&typeof _0x2c0003['limit']==='undefined';var _0x24f726=_0x103d4c[_0x3352('0x1b')];var _0x5955b5=_0x42b5d1?0x0:_0x2c0003[_0x3352('0x19')];var _0x4f5b4f=_0x42b5d1?_0x103d4c['count']:_0x2c0003[_0x3352('0x19')]+_0x2c0003[_0x3352('0x1c')];var _0x3baddf;if(_0x4f5b4f>=_0x24f726){_0x4f5b4f=_0x24f726;_0x3baddf=0xc8;}else{_0x3baddf=0xce;}_0x45781d[_0x3352('0x18')](_0x3baddf);return _0x45781d[_0x3352('0x1d')](_0x3352('0x1e'),_0x5955b5+'-'+_0x4f5b4f+'/'+_0x24f726)['json'](_0x103d4c);}return null;};}function patchUpdates(_0x5a614d){return function(_0x293800){try{jsonpatch[_0x3352('0x1f')](_0x293800,_0x5a614d,!![]);}catch(_0x346572){return BPromise[_0x3352('0x20')](_0x346572);}return _0x293800['save']();};}function saveUpdates(_0xa782ca,_0x138445){return function(_0x1b0438){if(_0x1b0438){return _0x1b0438[_0x3352('0x21')](_0xa782ca)['then'](function(_0x1a8564){return _0x1a8564;});}return null;};}function removeEntity(_0x3df543,_0x1e06eb){return function(_0x238fff){if(_0x238fff){return _0x238fff[_0x3352('0x22')]()['then'](function(){var _0x3e3c7c=_0x238fff[_0x3352('0x23')]({'plain':!![]});var _0x55af81=_0x3352('0x24');return db[_0x3352('0x25')]['destroy']({'where':{'type':_0x55af81,'resourceId':_0x3e3c7c['id']}})[_0x3352('0x26')](function(){return _0x238fff;});})['then'](function(){_0x3df543[_0x3352('0x18')](0xcc)[_0x3352('0x27')]();});}};}function handleEntityNotFound(_0x5f4440,_0x407471){return function(_0x239909){if(!_0x239909){_0x5f4440[_0x3352('0x28')](0x194);}return _0x239909;};}function handleError(_0x41999a,_0x1523f8){_0x1523f8=_0x1523f8||0x1f4;return function(_0x566256){logger['error'](_0x566256['stack']);if(_0x566256['name']){delete _0x566256[_0x3352('0x29')];}_0x41999a[_0x3352('0x18')](_0x1523f8)[_0x3352('0x2a')](_0x566256);};}exports['index']=function(_0x3c82b9,_0x329a2d){var _0x1fcd37={},_0x12e499={},_0x258f65={'count':0x0,'rows':[]};var _0x74a1b7=_[_0x3352('0x2b')](db[_0x3352('0x2c')]['rawAttributes'],function(_0x239d34){return{'name':_0x239d34['fieldName'],'type':_0x239d34[_0x3352('0x2d')][_0x3352('0x2e')]};});_0x12e499['model']=_['map'](_0x74a1b7,_0x3352('0x29'));_0x12e499[_0x3352('0x2f')]=_[_0x3352('0x30')](_0x3c82b9[_0x3352('0x2f')]);_0x12e499[_0x3352('0x31')]=_[_0x3352('0x32')](_0x12e499[_0x3352('0x33')],_0x12e499[_0x3352('0x2f')]);_0x1fcd37['attributes']=_[_0x3352('0x32')](_0x12e499['model'],qs[_0x3352('0x34')](_0x3c82b9[_0x3352('0x2f')][_0x3352('0x34')]));_0x1fcd37[_0x3352('0x35')]=_0x1fcd37[_0x3352('0x35')][_0x3352('0x36')]?_0x1fcd37[_0x3352('0x35')]:_0x12e499[_0x3352('0x33')];if(!_0x3c82b9['query']['hasOwnProperty'](_0x3352('0x37'))){_0x1fcd37[_0x3352('0x1c')]=qs['limit'](_0x3c82b9['query'][_0x3352('0x1c')]);_0x1fcd37[_0x3352('0x19')]=qs[_0x3352('0x19')](_0x3c82b9[_0x3352('0x2f')][_0x3352('0x19')]);}_0x1fcd37[_0x3352('0x38')]=qs['sort'](_0x3c82b9[_0x3352('0x2f')]['sort']);_0x1fcd37[_0x3352('0x39')]=qs[_0x3352('0x31')](_[_0x3352('0x3a')](_0x3c82b9[_0x3352('0x2f')],_0x12e499[_0x3352('0x31')]),_0x74a1b7);if(_0x3c82b9[_0x3352('0x2f')][_0x3352('0x3b')]){_0x1fcd37[_0x3352('0x39')]=_[_0x3352('0x3c')](_0x1fcd37[_0x3352('0x39')],{'$or':_[_0x3352('0x2b')](_0x74a1b7,function(_0x461867){if(_0x461867[_0x3352('0x2d')]!==_0x3352('0x3d')){var _0x50c48b={};_0x50c48b[_0x461867[_0x3352('0x29')]]={'$like':'%'+_0x3c82b9['query']['filter']+'%'};return _0x50c48b;}})});}_0x1fcd37=_[_0x3352('0x3c')]({},_0x1fcd37,_0x3c82b9['options']);var _0xfd7ee6={'where':_0x1fcd37[_0x3352('0x39')]};return db[_0x3352('0x2c')][_0x3352('0x1b')](_0xfd7ee6)[_0x3352('0x26')](function(_0x199171){_0x258f65[_0x3352('0x1b')]=_0x199171;if(_0x3c82b9[_0x3352('0x2f')][_0x3352('0x3e')]){_0x1fcd37[_0x3352('0x3f')]=[{'all':!![]}];}return db[_0x3352('0x2c')][_0x3352('0x40')](_0x1fcd37);})[_0x3352('0x26')](function(_0x3eb6c8){_0x258f65[_0x3352('0x41')]=_0x3eb6c8;return _0x258f65;})['then'](respondWithFilteredResult(_0x329a2d,_0x1fcd37))[_0x3352('0x42')](handleError(_0x329a2d,null));};exports[_0x3352('0x43')]=function(_0x24129b,_0x4e5850){var _0x446c92={'raw':!![],'where':{'id':_0x24129b[_0x3352('0x44')]['id']}},_0x1839ea={};_0x1839ea[_0x3352('0x33')]=_[_0x3352('0x30')](db['Pause']['rawAttributes']);_0x1839ea['query']=_['keys'](_0x24129b[_0x3352('0x2f')]);_0x1839ea[_0x3352('0x31')]=_[_0x3352('0x32')](_0x1839ea[_0x3352('0x33')],_0x1839ea[_0x3352('0x2f')]);_0x446c92['attributes']=_['intersection'](_0x1839ea[_0x3352('0x33')],qs['fields'](_0x24129b[_0x3352('0x2f')][_0x3352('0x34')]));_0x446c92[_0x3352('0x35')]=_0x446c92['attributes']['length']?_0x446c92['attributes']:_0x1839ea[_0x3352('0x33')];if(_0x24129b['query'][_0x3352('0x3e')]){_0x446c92[_0x3352('0x3f')]=[{'all':!![]}];}_0x446c92=_[_0x3352('0x3c')]({},_0x446c92,_0x24129b[_0x3352('0x45')]);return db[_0x3352('0x2c')][_0x3352('0x46')](_0x446c92)[_0x3352('0x26')](handleEntityNotFound(_0x4e5850,null))['then'](respondWithResult(_0x4e5850,null))[_0x3352('0x42')](handleError(_0x4e5850,null));};exports[_0x3352('0x47')]=function(_0x2c6b9f,_0xb54982){return db[_0x3352('0x2c')][_0x3352('0x47')](_0x2c6b9f[_0x3352('0x48')],{})['then'](function(_0x11ea02){var _0x279641=_0x2c6b9f[_0x3352('0x49')][_0x3352('0x23')]({'plain':!![]});if(!_0x279641)throw new Error(_0x3352('0x4a'));if(_0x279641[_0x3352('0x4b')]===_0x3352('0x49')){var _0x31bd61=_0x11ea02[_0x3352('0x23')]({'plain':!![]});var _0x703dde=_0x3352('0x24');return db[_0x3352('0x4c')][_0x3352('0x46')]({'where':{'name':_0x703dde,'userProfileId':_0x279641[_0x3352('0x4d')]},'raw':!![]})[_0x3352('0x26')](function(_0x212cdc){if(_0x212cdc&&_0x212cdc[_0x3352('0x4e')]===0x0){return db[_0x3352('0x25')][_0x3352('0x47')]({'name':_0x31bd61[_0x3352('0x29')],'resourceId':_0x31bd61['id'],'type':_0x212cdc['name'],'sectionId':_0x212cdc['id']},{})[_0x3352('0x26')](function(){return _0x11ea02;});}else{return _0x11ea02;}})[_0x3352('0x42')](function(_0x466d43){logger[_0x3352('0x4f')](_0x3352('0x50'),_0x466d43);throw _0x466d43;});}return _0x11ea02;})['then'](respondWithResult(_0xb54982,0xc9))[_0x3352('0x42')](handleError(_0xb54982,null));};exports[_0x3352('0x21')]=function(_0x44a37c,_0x548aaa){if(_0x44a37c[_0x3352('0x48')]['id']){delete _0x44a37c[_0x3352('0x48')]['id'];}return db[_0x3352('0x2c')][_0x3352('0x46')]({'where':{'id':_0x44a37c['params']['id']}})[_0x3352('0x26')](handleEntityNotFound(_0x548aaa,null))['then'](saveUpdates(_0x44a37c['body'],null))[_0x3352('0x26')](respondWithResult(_0x548aaa,null))['catch'](handleError(_0x548aaa,null));};exports['destroy']=function(_0x5e6352,_0xf5d33b){return db[_0x3352('0x2c')][_0x3352('0x46')]({'where':{'id':_0x5e6352['params']['id']}})['then'](handleEntityNotFound(_0xf5d33b,null))[_0x3352('0x26')](removeEntity(_0xf5d33b,null))[_0x3352('0x42')](handleError(_0xf5d33b,null));}; \ No newline at end of file +var _0xaf99=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','Pauses','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4cb639,_0x3eb2ec){var _0x258ef3=function(_0x37256e){while(--_0x37256e){_0x4cb639['push'](_0x4cb639['shift']());}};_0x258ef3(++_0x3eb2ec);}(_0xaf99,0xe0));var _0x9af9=function(_0x53e666,_0x5630c7){_0x53e666=_0x53e666-0x0;var _0x41cbef=_0xaf99[_0x53e666];return _0x41cbef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9af9('0x0'));var zipdir=require(_0x9af9('0x1'));var jsonpatch=require(_0x9af9('0x2'));var rp=require('request-promise');var moment=require(_0x9af9('0x3'));var BPromise=require(_0x9af9('0x4'));var Mustache=require(_0x9af9('0x5'));var util=require(_0x9af9('0x6'));var path=require(_0x9af9('0x7'));var sox=require(_0x9af9('0x8'));var csv=require('to-csv');var ejs=require(_0x9af9('0x9'));var fs=require('fs');var fs_extra=require(_0x9af9('0xa'));var _=require(_0x9af9('0xb'));var squel=require(_0x9af9('0xc'));var crypto=require(_0x9af9('0xd'));var jsforce=require(_0x9af9('0xe'));var deskjs=require(_0x9af9('0xf'));var toCsv=require(_0x9af9('0x10'));var querystring=require(_0x9af9('0x11'));var Papa=require(_0x9af9('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9af9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9af9('0x14'));var logger=require(_0x9af9('0x15'))(_0x9af9('0x16'));var utils=require(_0x9af9('0x17'));var config=require(_0x9af9('0x18'));var licenseUtil=require(_0x9af9('0x19'));var db=require(_0x9af9('0x1a'))['db'];function respondWithStatusCode(_0x5ec488,_0x3ad2bb){_0x3ad2bb=_0x3ad2bb||0xcc;return function(_0x4d2fc1){if(_0x4d2fc1){return _0x5ec488[_0x9af9('0x1b')](_0x3ad2bb);}return _0x5ec488[_0x9af9('0x1c')](_0x3ad2bb)[_0x9af9('0x1d')]();};}function respondWithResult(_0x2bec45,_0x226d63){_0x226d63=_0x226d63||0xc8;return function(_0x3df700){if(_0x3df700){return _0x2bec45['status'](_0x226d63)['json'](_0x3df700);}};}function respondWithFilteredResult(_0x1854de,_0x543f9c){return function(_0x13fef8){if(_0x13fef8){var _0x1ccbeb=typeof _0x543f9c[_0x9af9('0x1e')]===_0x9af9('0x1f')&&typeof _0x543f9c[_0x9af9('0x20')]===_0x9af9('0x1f');var _0x2d1884=_0x13fef8[_0x9af9('0x21')];var _0x16a68f=_0x1ccbeb?0x0:_0x543f9c['offset'];var _0x9bf3d=_0x1ccbeb?_0x13fef8[_0x9af9('0x21')]:_0x543f9c['offset']+_0x543f9c[_0x9af9('0x20')];var _0x508f2b;if(_0x9bf3d>=_0x2d1884){_0x9bf3d=_0x2d1884;_0x508f2b=0xc8;}else{_0x508f2b=0xce;}_0x1854de[_0x9af9('0x1c')](_0x508f2b);return _0x1854de[_0x9af9('0x22')](_0x9af9('0x23'),_0x16a68f+'-'+_0x9bf3d+'/'+_0x2d1884)[_0x9af9('0x24')](_0x13fef8);}return null;};}function patchUpdates(_0x544044){return function(_0x27f1d4){try{jsonpatch[_0x9af9('0x25')](_0x27f1d4,_0x544044,!![]);}catch(_0x37bae9){return BPromise['reject'](_0x37bae9);}return _0x27f1d4[_0x9af9('0x26')]();};}function saveUpdates(_0x259ad1,_0x36f681){return function(_0x4a9252){if(_0x4a9252){return _0x4a9252['update'](_0x259ad1)[_0x9af9('0x27')](function(_0x4cdc5e){return _0x4cdc5e;});}return null;};}function removeEntity(_0x5d7ced,_0xe6cefc){return function(_0x2a435e){if(_0x2a435e){return _0x2a435e[_0x9af9('0x28')]()['then'](function(){var _0x5739ca=_0x2a435e[_0x9af9('0x29')]({'plain':!![]});var _0x5b3781=_0x9af9('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x5b3781,'resourceId':_0x5739ca['id']}})[_0x9af9('0x27')](function(){return _0x2a435e;});})[_0x9af9('0x27')](function(){_0x5d7ced[_0x9af9('0x1c')](0xcc)[_0x9af9('0x1d')]();});}};}function handleEntityNotFound(_0x339a12,_0x2df2a0){return function(_0x5834fa){if(!_0x5834fa){_0x339a12[_0x9af9('0x1b')](0x194);}return _0x5834fa;};}function handleError(_0x484faf,_0x6ad0ec){_0x6ad0ec=_0x6ad0ec||0x1f4;return function(_0x18e124){logger[_0x9af9('0x2b')](_0x18e124[_0x9af9('0x2c')]);if(_0x18e124['name']){delete _0x18e124[_0x9af9('0x2d')];}_0x484faf['status'](_0x6ad0ec)[_0x9af9('0x2e')](_0x18e124);};}exports[_0x9af9('0x2f')]=function(_0x4edb5e,_0x552218){var _0x2d9dd8={},_0x100ab9={},_0x65cb63={'count':0x0,'rows':[]};var _0x4e477e=_[_0x9af9('0x30')](db[_0x9af9('0x31')][_0x9af9('0x32')],function(_0x3b766d){return{'name':_0x3b766d[_0x9af9('0x33')],'type':_0x3b766d[_0x9af9('0x34')][_0x9af9('0x35')]};});_0x100ab9['model']=_['map'](_0x4e477e,_0x9af9('0x2d'));_0x100ab9[_0x9af9('0x36')]=_['keys'](_0x4edb5e['query']);_0x100ab9[_0x9af9('0x37')]=_[_0x9af9('0x38')](_0x100ab9[_0x9af9('0x39')],_0x100ab9[_0x9af9('0x36')]);_0x2d9dd8['attributes']=_[_0x9af9('0x38')](_0x100ab9[_0x9af9('0x39')],qs[_0x9af9('0x3a')](_0x4edb5e[_0x9af9('0x36')][_0x9af9('0x3a')]));_0x2d9dd8['attributes']=_0x2d9dd8[_0x9af9('0x3b')][_0x9af9('0x3c')]?_0x2d9dd8[_0x9af9('0x3b')]:_0x100ab9[_0x9af9('0x39')];if(!_0x4edb5e[_0x9af9('0x36')]['hasOwnProperty'](_0x9af9('0x3d'))){_0x2d9dd8['limit']=qs[_0x9af9('0x20')](_0x4edb5e['query'][_0x9af9('0x20')]);_0x2d9dd8[_0x9af9('0x1e')]=qs[_0x9af9('0x1e')](_0x4edb5e[_0x9af9('0x36')][_0x9af9('0x1e')]);}_0x2d9dd8[_0x9af9('0x3e')]=qs[_0x9af9('0x3f')](_0x4edb5e[_0x9af9('0x36')][_0x9af9('0x3f')]);_0x2d9dd8[_0x9af9('0x40')]=qs['filters'](_[_0x9af9('0x41')](_0x4edb5e[_0x9af9('0x36')],_0x100ab9[_0x9af9('0x37')]),_0x4e477e);if(_0x4edb5e[_0x9af9('0x36')][_0x9af9('0x42')]){_0x2d9dd8[_0x9af9('0x40')]=_[_0x9af9('0x43')](_0x2d9dd8[_0x9af9('0x40')],{'$or':_[_0x9af9('0x30')](_0x4e477e,function(_0x441683){if(_0x441683[_0x9af9('0x34')]!=='VIRTUAL'){var _0x2ddee9={};_0x2ddee9[_0x441683[_0x9af9('0x2d')]]={'$like':'%'+_0x4edb5e[_0x9af9('0x36')][_0x9af9('0x42')]+'%'};return _0x2ddee9;}})});}_0x2d9dd8=_[_0x9af9('0x43')]({},_0x2d9dd8,_0x4edb5e[_0x9af9('0x44')]);var _0x1894a2={'where':_0x2d9dd8[_0x9af9('0x40')]};return db[_0x9af9('0x31')]['count'](_0x1894a2)['then'](function(_0x4b66dd){_0x65cb63[_0x9af9('0x21')]=_0x4b66dd;if(_0x4edb5e['query']['includeAll']){_0x2d9dd8[_0x9af9('0x45')]=[{'all':!![]}];}return db['Pause'][_0x9af9('0x46')](_0x2d9dd8);})['then'](function(_0x4cfe3b){_0x65cb63[_0x9af9('0x47')]=_0x4cfe3b;return _0x65cb63;})[_0x9af9('0x27')](respondWithFilteredResult(_0x552218,_0x2d9dd8))[_0x9af9('0x48')](handleError(_0x552218,null));};exports[_0x9af9('0x49')]=function(_0x299022,_0x1b8e8f){var _0x2ad31a={'raw':!![],'where':{'id':_0x299022['params']['id']}},_0x1ac563={};_0x1ac563['model']=_['keys'](db[_0x9af9('0x31')]['rawAttributes']);_0x1ac563['query']=_['keys'](_0x299022['query']);_0x1ac563[_0x9af9('0x37')]=_[_0x9af9('0x38')](_0x1ac563[_0x9af9('0x39')],_0x1ac563[_0x9af9('0x36')]);_0x2ad31a[_0x9af9('0x3b')]=_[_0x9af9('0x38')](_0x1ac563[_0x9af9('0x39')],qs[_0x9af9('0x3a')](_0x299022['query']['fields']));_0x2ad31a['attributes']=_0x2ad31a[_0x9af9('0x3b')][_0x9af9('0x3c')]?_0x2ad31a[_0x9af9('0x3b')]:_0x1ac563['model'];if(_0x299022[_0x9af9('0x36')]['includeAll']){_0x2ad31a[_0x9af9('0x45')]=[{'all':!![]}];}_0x2ad31a=_[_0x9af9('0x43')]({},_0x2ad31a,_0x299022[_0x9af9('0x44')]);return db[_0x9af9('0x31')][_0x9af9('0x4a')](_0x2ad31a)[_0x9af9('0x27')](handleEntityNotFound(_0x1b8e8f,null))[_0x9af9('0x27')](respondWithResult(_0x1b8e8f,null))['catch'](handleError(_0x1b8e8f,null));};exports[_0x9af9('0x4b')]=function(_0x46749d,_0x9a4aeb){return db['Pause'][_0x9af9('0x4b')](_0x46749d[_0x9af9('0x4c')],{})[_0x9af9('0x27')](function(_0x1d2093){var _0x5ddfb7=_0x46749d['user'][_0x9af9('0x29')]({'plain':!![]});if(!_0x5ddfb7)throw new Error(_0x9af9('0x4d'));if(_0x5ddfb7['role']==='user'){var _0x352ed4=_0x1d2093['get']({'plain':!![]});var _0x4be700=_0x9af9('0x2a');return db['UserProfileSection'][_0x9af9('0x4a')]({'where':{'name':_0x4be700,'userProfileId':_0x5ddfb7['userProfileId']},'raw':!![]})[_0x9af9('0x27')](function(_0x1657a2){if(_0x1657a2&&_0x1657a2['autoAssociation']===0x0){return db[_0x9af9('0x4e')]['create']({'name':_0x352ed4[_0x9af9('0x2d')],'resourceId':_0x352ed4['id'],'type':_0x1657a2[_0x9af9('0x2d')],'sectionId':_0x1657a2['id']},{})[_0x9af9('0x27')](function(){return _0x1d2093;});}else{return _0x1d2093;}})['catch'](function(_0x3794f1){logger[_0x9af9('0x2b')](_0x9af9('0x4f'),_0x3794f1);throw _0x3794f1;});}return _0x1d2093;})['then'](respondWithResult(_0x9a4aeb,0xc9))[_0x9af9('0x48')](handleError(_0x9a4aeb,null));};exports[_0x9af9('0x50')]=function(_0x34c245,_0x4079c7){if(_0x34c245[_0x9af9('0x4c')]['id']){delete _0x34c245[_0x9af9('0x4c')]['id'];}return db[_0x9af9('0x31')][_0x9af9('0x4a')]({'where':{'id':_0x34c245[_0x9af9('0x51')]['id']}})[_0x9af9('0x27')](handleEntityNotFound(_0x4079c7,null))[_0x9af9('0x27')](saveUpdates(_0x34c245['body'],null))[_0x9af9('0x27')](respondWithResult(_0x4079c7,null))['catch'](handleError(_0x4079c7,null));};exports[_0x9af9('0x28')]=function(_0x32938b,_0x1d16b7){return db[_0x9af9('0x31')][_0x9af9('0x4a')]({'where':{'id':_0x32938b[_0x9af9('0x51')]['id']}})[_0x9af9('0x27')](handleEntityNotFound(_0x1d16b7,null))['then'](removeEntity(_0x1d16b7,null))[_0x9af9('0x48')](handleError(_0x1d16b7,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 627f6ed..cf75f78 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 _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x5846ea,_0x651af7){var _0xf8ac43=function(_0x50e57f){while(--_0x50e57f){_0x5846ea['push'](_0x5846ea['shift']());}};_0xf8ac43(++_0x651af7);}(_0x53ec,0x192));var _0xc53e=function(_0x248fc8,_0x121ebf){_0x248fc8=_0x248fc8-0x0;var _0x1ec5d1=_0x53ec[_0x248fc8];return _0x1ec5d1;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6aa7,0x178));var _0x76aa=function(_0x30b486,_0xd24a61){_0x30b486=_0x30b486-0x0;var _0x569496=_0x6aa7[_0x30b486];return _0x569496;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'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 91e99da..b0db9ba 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x400add,_0x515d92){var _0x3d809a=function(_0x783fe4){while(--_0x783fe4){_0x400add['push'](_0x400add['shift']());}};_0x3d809a(++_0x515d92);}(_0xb10b,0x12a));var _0xbb10=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xb10b[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x41f76a,_0x51346e){var _0x47aeb4=function(_0x3c4c84){while(--_0x3c4c84){_0x41f76a['push'](_0x41f76a['shift']());}};_0x47aeb4(++_0x51346e);}(_0xb10b,0x12a));var _0xbb10=function(_0x547515,_0x41c2c4){_0x547515=_0x547515-0x0;var _0x2fdecf=_0xb10b[_0x547515];return _0x2fdecf;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 751c4c9..ec966b3 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 _0xd6d6=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','put','update','exports','multer','util'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3e6aed,_0x55f501){_0x3e6aed=_0x3e6aed-0x0;var _0x4fcced=_0xd6d6[_0x3e6aed];return _0x4fcced;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),controller[_0x6d6d('0xd')]);router[_0x6d6d('0xa')](_0x6d6d('0xe'),auth[_0x6d6d('0xf')](),controller['show']);router['get'](_0x6d6d('0x10'),auth[_0x6d6d('0xf')](),controller[_0x6d6d('0x11')]);var upload=multer({'storage':multer[_0x6d6d('0x12')]({'destination':function(_0xf84314,_0x576c88,_0x1f2b86){_0x1f2b86(null,path[_0x6d6d('0x13')](config['root'],'server/files/plugins'));},'filename':function(_0x176618,_0x32146d,_0xe61c36){_0x32146d[_0x6d6d('0x14')]=_0x32146d[_0x6d6d('0x14')][_0x6d6d('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe61c36(null,util[_0x6d6d('0x16')](_0x6d6d('0x17'),path['basename'](_0x32146d[_0x6d6d('0x14')],path[_0x6d6d('0x18')](_0x32146d[_0x6d6d('0x14')])),Date[_0x6d6d('0x19')](),path[_0x6d6d('0x18')](_0x32146d['originalname'])));}})});router[_0x6d6d('0x1a')]('/',upload['single'](_0x6d6d('0x1b')),controller[_0x6d6d('0x1c')]);router[_0x6d6d('0x1a')]('/webhook',controller['webhookPost']);router[_0x6d6d('0x1d')](_0x6d6d('0xe'),auth[_0x6d6d('0xf')](),controller[_0x6d6d('0x1e')]);router['delete']('/:id',auth[_0x6d6d('0xf')](),controller['delete']);module[_0x6d6d('0x1f')]=router; \ No newline at end of file +var _0xb66c=['/:id','show','/:id/download','isAuthenticated','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','extname','single','file','upload','post','webhookPost','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet'];(function(_0x47aad8,_0xac209d){var _0x463c39=function(_0x704f12){while(--_0x704f12){_0x47aad8['push'](_0x47aad8['shift']());}};_0x463c39(++_0xac209d);}(_0xb66c,0x175));var _0xcb66=function(_0x273e51,_0x45bef9){_0x273e51=_0x273e51-0x0;var _0x1df00e=_0xb66c[_0x273e51];return _0x1df00e;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require(_0xcb66('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var fs_extra=require(_0xcb66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var controller=require(_0xcb66('0x7'));router[_0xcb66('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb66('0x8')](_0xcb66('0x9'),controller[_0xcb66('0xa')]);router[_0xcb66('0x8')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0xc')]);router[_0xcb66('0x8')](_0xcb66('0xd'),auth[_0xcb66('0xe')](),controller[_0xcb66('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x393bde,_0x2b32ec,_0xf12828){_0xf12828(null,path[_0xcb66('0x10')](config['root'],_0xcb66('0x11')));},'filename':function(_0x3471f3,_0x4105d2,_0x2339bb){_0x4105d2['originalname']=_0x4105d2[_0xcb66('0x12')][_0xcb66('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2339bb(null,util[_0xcb66('0x14')](_0xcb66('0x15'),path['basename'](_0x4105d2[_0xcb66('0x12')],path['extname'](_0x4105d2[_0xcb66('0x12')])),Date['now'](),path[_0xcb66('0x16')](_0x4105d2['originalname'])));}})});router['post']('/',upload[_0xcb66('0x17')](_0xcb66('0x18')),controller[_0xcb66('0x19')]);router[_0xcb66('0x1a')]('/webhook',controller[_0xcb66('0x1b')]);router[_0xcb66('0x1c')](_0xcb66('0xb'),auth['isAuthenticated'](),controller[_0xcb66('0x1d')]);router['delete'](_0xcb66('0xb'),auth[_0xcb66('0xe')](),controller[_0xcb66('0x1e')]);module[_0xcb66('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 0f9d58f..8f70889 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 _0x176e=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','agentOnly'];(function(_0x3891de,_0x55cfe5){var _0x521696=function(_0x1a8b8e){while(--_0x1a8b8e){_0x3891de['push'](_0x3891de['shift']());}};_0x521696(++_0x55cfe5);}(_0x176e,0x10a));var _0xe176=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x176e[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xe176('0x0'));module[_0xe176('0x1')]={'name':{'type':Sequelize[_0xe176('0x2')]},'type':{'type':Sequelize['ENUM'](_0xe176('0x3'),_0xe176('0x4'))},'description':{'type':Sequelize[_0xe176('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xe176('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xe176('0x6')],'defaultValue':0x0,'comment':_0xe176('0x7')},'sidebar':{'type':Sequelize[_0xe176('0x8')]('adminOnly',_0xe176('0x9'),_0xe176('0xa'),'never'),'defaultValue':_0xe176('0xa'),'comment':_0xe176('0xb')},'icon':{'type':Sequelize[_0xe176('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xe176('0x2')]},'scriptName':{'type':Sequelize[_0xe176('0x2')]},'scriptPath':{'type':Sequelize[_0xe176('0x2')]}}; \ No newline at end of file +var _0x328c=['ENUM','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING'];(function(_0x4c6b77,_0x1e2193){var _0x171184=function(_0x4bbec7){while(--_0x4bbec7){_0x4c6b77['push'](_0x4c6b77['shift']());}};_0x171184(++_0x1e2193);}(_0x328c,0xa6));var _0xc328=function(_0x37dac8,_0x183f30){_0x37dac8=_0x37dac8-0x0;var _0x44c503=_0x328c[_0x37dac8];return _0x44c503;};'use strict';var Sequelize=require('sequelize');module[_0xc328('0x0')]={'name':{'type':Sequelize[_0xc328('0x1')]},'type':{'type':Sequelize[_0xc328('0x2')]('html',_0xc328('0x3'))},'description':{'type':Sequelize[_0xc328('0x4')]},'version':{'type':Sequelize[_0xc328('0x4')]},'path':{'type':Sequelize[_0xc328('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xc328('0x5')],'defaultValue':0x0,'comment':_0xc328('0x6')},'sidebar':{'type':Sequelize[_0xc328('0x2')](_0xc328('0x7'),_0xc328('0x8'),_0xc328('0x9'),_0xc328('0xa')),'defaultValue':_0xc328('0x9'),'comment':_0xc328('0xb')},'icon':{'type':Sequelize[_0xc328('0x1')]},'adminUrl':{'type':Sequelize[_0xc328('0x1')]},'agentUrl':{'type':Sequelize[_0xc328('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xc328('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 84f459f..203b5cd 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 _0x0407=['fs-extra','squel','crypto','papaparse','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','localhost','./plugin.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','include','rows','show','includeAll','find','catch','download','params','server/files/plugins','format','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','description','sidebar','always','icon','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','send','resolve','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x0407,0x9b));var _0x7040=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x0407[_0x18a436];return _0x5c2cf8;};'use strict';var emlformat=require(_0x7040('0x0'));var rimraf=require(_0x7040('0x1'));var zipdir=require(_0x7040('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7040('0x3'));var moment=require('moment');var BPromise=require(_0x7040('0x4'));var Mustache=require('mustache');var util=require(_0x7040('0x5'));var path=require(_0x7040('0x6'));var sox=require('sox');var csv=require(_0x7040('0x7'));var ejs=require(_0x7040('0x8'));var fs=require('fs');var fs_extra=require(_0x7040('0x9'));var _=require('lodash');var squel=require(_0x7040('0xa'));var crypto=require(_0x7040('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7040('0x7'));var querystring=require('querystring');var Papa=require(_0x7040('0xc'));var extract=require('extract-zip');var rimraf=require(_0x7040('0x1'));var archiver=require(_0x7040('0xd'));var Redis=require(_0x7040('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7040('0xf'));var as=require(_0x7040('0x10'));var hardwareService=require(_0x7040('0x11'));var logger=require(_0x7040('0x12'))(_0x7040('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7040('0x14'));var db=require('../../mysqldb')['db'];config[_0x7040('0x15')]=_['defaults'](config['redis'],{'host':_0x7040('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7040('0x15')]));require(_0x7040('0x17'))['register'](socket);function respondWithStatusCode(_0x12a9d2,_0x445693){_0x445693=_0x445693||0xcc;return function(_0x57ffd8){if(_0x57ffd8){return _0x12a9d2['sendStatus'](_0x445693);}return _0x12a9d2[_0x7040('0x18')](_0x445693)[_0x7040('0x19')]();};}function respondWithResult(_0x23eae4,_0x5e50f4){_0x5e50f4=_0x5e50f4||0xc8;return function(_0xf553c8){if(_0xf553c8){return _0x23eae4[_0x7040('0x18')](_0x5e50f4)[_0x7040('0x1a')](_0xf553c8);}};}function respondWithFilteredResult(_0x3c2cce,_0x5de6a3){return function(_0x2df2a5){if(_0x2df2a5){var _0x3aa94f=typeof _0x5de6a3[_0x7040('0x1b')]===_0x7040('0x1c')&&typeof _0x5de6a3['limit']===_0x7040('0x1c');var _0x5054a2=_0x2df2a5[_0x7040('0x1d')];var _0x283374=_0x3aa94f?0x0:_0x5de6a3[_0x7040('0x1b')];var _0x447118=_0x3aa94f?_0x2df2a5[_0x7040('0x1d')]:_0x5de6a3[_0x7040('0x1b')]+_0x5de6a3[_0x7040('0x1e')];var _0x4d4edf;if(_0x447118>=_0x5054a2){_0x447118=_0x5054a2;_0x4d4edf=0xc8;}else{_0x4d4edf=0xce;}_0x3c2cce[_0x7040('0x18')](_0x4d4edf);return _0x3c2cce[_0x7040('0x1f')](_0x7040('0x20'),_0x283374+'-'+_0x447118+'/'+_0x5054a2)[_0x7040('0x1a')](_0x2df2a5);}return null;};}function patchUpdates(_0x583569){return function(_0x83b008){try{jsonpatch[_0x7040('0x21')](_0x83b008,_0x583569,!![]);}catch(_0x51fe4d){return BPromise[_0x7040('0x22')](_0x51fe4d);}return _0x83b008[_0x7040('0x23')]();};}function saveUpdates(_0x234b17,_0x5a1308){return function(_0x56db5a){if(_0x56db5a){return _0x56db5a[_0x7040('0x24')](_0x234b17)[_0x7040('0x25')](function(_0x5a9b97){return _0x5a9b97;});}return null;};}function removeEntity(_0x5d36b5,_0x14f208){return function(_0x48f659){if(_0x48f659){return _0x48f659[_0x7040('0x26')]()[_0x7040('0x25')](function(){var _0x592b14=_0x48f659[_0x7040('0x27')]({'plain':!![]});var _0x54c6aa='Plugins';return db[_0x7040('0x28')]['destroy']({'where':{'type':_0x54c6aa,'resourceId':_0x592b14['id']}})[_0x7040('0x25')](function(){return _0x48f659;});})[_0x7040('0x25')](function(){_0x5d36b5['status'](0xcc)[_0x7040('0x19')]();});}};}function handleEntityNotFound(_0x5b786d,_0x4fc29a){return function(_0x485683){if(!_0x485683){_0x5b786d[_0x7040('0x29')](0x194);}return _0x485683;};}function handleError(_0x635d98,_0x58d831){_0x58d831=_0x58d831||0x1f4;return function(_0x463f49){logger[_0x7040('0x2a')](_0x463f49[_0x7040('0x2b')]);if(_0x463f49[_0x7040('0x2c')]){delete _0x463f49['name'];}_0x635d98[_0x7040('0x18')](_0x58d831)['send'](_0x463f49);};}exports[_0x7040('0x2d')]=function(_0x561cfc,_0xf02c49){var _0x2aad27={},_0x897822={},_0x4e90d4={'count':0x0,'rows':[]};var _0x2c8502=_['map'](db['Plugin'][_0x7040('0x2e')],function(_0x4c2b9a){return{'name':_0x4c2b9a[_0x7040('0x2f')],'type':_0x4c2b9a[_0x7040('0x30')][_0x7040('0x31')]};});_0x897822[_0x7040('0x32')]=_[_0x7040('0x33')](_0x2c8502,_0x7040('0x2c'));_0x897822['query']=_[_0x7040('0x34')](_0x561cfc['query']);_0x897822[_0x7040('0x35')]=_[_0x7040('0x36')](_0x897822['model'],_0x897822[_0x7040('0x37')]);_0x2aad27[_0x7040('0x38')]=_['intersection'](_0x897822[_0x7040('0x32')],qs[_0x7040('0x39')](_0x561cfc[_0x7040('0x37')][_0x7040('0x39')]));_0x2aad27['attributes']=_0x2aad27['attributes'][_0x7040('0x3a')]?_0x2aad27['attributes']:_0x897822[_0x7040('0x32')];if(!_0x561cfc[_0x7040('0x37')][_0x7040('0x3b')](_0x7040('0x3c'))){_0x2aad27[_0x7040('0x1e')]=qs[_0x7040('0x1e')](_0x561cfc[_0x7040('0x37')]['limit']);_0x2aad27[_0x7040('0x1b')]=qs[_0x7040('0x1b')](_0x561cfc[_0x7040('0x37')][_0x7040('0x1b')]);}_0x2aad27['order']=qs[_0x7040('0x3d')](_0x561cfc[_0x7040('0x37')]['sort']);_0x2aad27[_0x7040('0x3e')]=qs['filters'](_[_0x7040('0x3f')](_0x561cfc['query'],_0x897822['filters']),_0x2c8502);if(_0x561cfc['query'][_0x7040('0x40')]){_0x2aad27[_0x7040('0x3e')]=_[_0x7040('0x41')](_0x2aad27['where'],{'$or':_['map'](_0x2c8502,function(_0x2d7edb){if(_0x2d7edb[_0x7040('0x30')]!==_0x7040('0x42')){var _0x4139a6={};_0x4139a6[_0x2d7edb[_0x7040('0x2c')]]={'$like':'%'+_0x561cfc[_0x7040('0x37')]['filter']+'%'};return _0x4139a6;}})});}_0x2aad27=_[_0x7040('0x41')]({},_0x2aad27,_0x561cfc[_0x7040('0x43')]);var _0x53dcb8={'where':_0x2aad27[_0x7040('0x3e')]};return db[_0x7040('0x44')][_0x7040('0x1d')](_0x53dcb8)[_0x7040('0x25')](function(_0xf6bf87){_0x4e90d4[_0x7040('0x1d')]=_0xf6bf87;if(_0x561cfc[_0x7040('0x37')]['includeAll']){_0x2aad27[_0x7040('0x45')]=[{'all':!![]}];}return db[_0x7040('0x44')]['findAll'](_0x2aad27);})[_0x7040('0x25')](function(_0x4ad505){_0x4e90d4[_0x7040('0x46')]=_0x4ad505;return _0x4e90d4;})['then'](respondWithFilteredResult(_0xf02c49,_0x2aad27))['catch'](handleError(_0xf02c49,null));};exports[_0x7040('0x47')]=function(_0x112ffb,_0x380181){var _0x258d40={'raw':!![],'where':{'id':_0x112ffb['params']['id']}},_0x5cbcb7={};_0x5cbcb7[_0x7040('0x32')]=_[_0x7040('0x34')](db[_0x7040('0x44')]['rawAttributes']);_0x5cbcb7[_0x7040('0x37')]=_['keys'](_0x112ffb[_0x7040('0x37')]);_0x5cbcb7[_0x7040('0x35')]=_[_0x7040('0x36')](_0x5cbcb7[_0x7040('0x32')],_0x5cbcb7[_0x7040('0x37')]);_0x258d40[_0x7040('0x38')]=_[_0x7040('0x36')](_0x5cbcb7[_0x7040('0x32')],qs['fields'](_0x112ffb[_0x7040('0x37')][_0x7040('0x39')]));_0x258d40[_0x7040('0x38')]=_0x258d40[_0x7040('0x38')][_0x7040('0x3a')]?_0x258d40['attributes']:_0x5cbcb7[_0x7040('0x32')];if(_0x112ffb['query'][_0x7040('0x48')]){_0x258d40[_0x7040('0x45')]=[{'all':!![]}];}_0x258d40=_[_0x7040('0x41')]({},_0x258d40,_0x112ffb[_0x7040('0x43')]);return db[_0x7040('0x44')][_0x7040('0x49')](_0x258d40)[_0x7040('0x25')](handleEntityNotFound(_0x380181,null))[_0x7040('0x25')](respondWithResult(_0x380181,null))[_0x7040('0x4a')](handleError(_0x380181,null));};exports[_0x7040('0x4b')]=function(_0x29890b,_0x4169f8,_0x28c76a){return db['Plugin'][_0x7040('0x49')]({'where':{'id':_0x29890b[_0x7040('0x4c')]['id']},'attributes':[_0x7040('0x2c'),_0x7040('0x6')],'raw':!![]})[_0x7040('0x25')](handleEntityNotFound(_0x4169f8,null))[_0x7040('0x25')](function(_0x54f42d){if(_0x54f42d){var _0x326d7c=path['join'](config['root'],_0x7040('0x4d'),util[_0x7040('0x4e')]('%s.zip',path[_0x7040('0x4f')](_0x54f42d[_0x7040('0x6')])));var _0x2e8344=fs[_0x7040('0x50')](_0x326d7c);var _0x317ddf=archiver(_0x7040('0x51'),{'zlib':{'level':0x9}});_0x317ddf['on'](_0x7040('0x52'),function(_0x54ced4){if(_0x54ced4['code']===_0x7040('0x53')){logger[_0x7040('0x2a')](_0x54ced4);}else{throw new db[(_0x7040('0x54'))][(_0x7040('0x55'))](_0x7040('0x56'));}});_0x317ddf['on'](_0x7040('0x2a'),function(_0x508972){throw new db[(_0x7040('0x54'))][(_0x7040('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x317ddf['pipe'](_0x2e8344);_0x317ddf[_0x7040('0x57')](_0x7040('0x58'),{'cwd':path[_0x7040('0x59')](config[_0x7040('0x5a')],_0x7040('0x4d'),path[_0x7040('0x5b')](_0x54f42d['path'])),'ignore':[path[_0x7040('0x59')](path[_0x7040('0x4f')](_0x54f42d[_0x7040('0x6')]),_0x7040('0x5c')),path['join'](path[_0x7040('0x4f')](_0x54f42d[_0x7040('0x6')]),_0x7040('0x5d'))],'nodir':!![]})[_0x7040('0x5e')]();_0x2e8344['on'](_0x7040('0x5f'),function(){if(!fs[_0x7040('0x60')](_0x326d7c)){throw new db['Sequelize'][(_0x7040('0x55'))](_0x7040('0x61'));}return _0x4169f8[_0x7040('0x4b')](_0x326d7c,util['format'](_0x7040('0x62'),path[_0x7040('0x4f')](_0x54f42d[_0x7040('0x6')])),function(_0x129990){if(_0x129990){throw new db[(_0x7040('0x54'))][(_0x7040('0x55'))](_0x7040('0x63'));}fs[_0x7040('0x64')](_0x326d7c);logger[_0x7040('0x65')](_0x7040('0x66'));logger['info'](_0x7040('0x67'));});});}return null;})[_0x7040('0x4a')](handleError(_0x4169f8,null));};exports[_0x7040('0x68')]=function(_0x3f4fc4,_0x4f0d23,_0xb91ef2){var _0x3d79bf=path[_0x7040('0x4f')](_0x3f4fc4['file'][_0x7040('0x69')],path[_0x7040('0x6a')](_0x3f4fc4[_0x7040('0x6b')][_0x7040('0x69')]));var _0x3f5f44=path['join'](config[_0x7040('0x5a')],'server/files/plugins',_0x3f4fc4[_0x7040('0x6b')][_0x7040('0x69')]);var _0x43c54e=path[_0x7040('0x59')](config['root'],_0x7040('0x4d'),_0x3d79bf);logger[_0x7040('0x65')](_0x7040('0x6c'),_0x3f5f44);logger[_0x7040('0x65')](_0x7040('0x6d'),_0x43c54e);try{fs[_0x7040('0x6e')](_0x3f5f44,parseInt('0777',0x8));extract(_0x3f5f44,{'dir':_0x43c54e},function(_0xac4cf9){if(_0xac4cf9){logger[_0x7040('0x2a')](_0xac4cf9);handleError(_0xac4cf9,!![]);};var _0x59afed=fs['readdirSync'](_0x43c54e);if(_0x59afed['length']>0x1){removeReferences(_0x3f5f44,_0x43c54e);logger[_0x7040('0x2a')](_0x7040('0x6f'));return _0xb91ef2(new Error(_0x7040('0x6f')));}var _0x445b1a=fs[_0x7040('0x70')](path[_0x7040('0x59')](_0x43c54e,_0x59afed[0x0]));if(_0x445b1a['isFile']()){removeReferences(_0x3f5f44,_0x43c54e);logger[_0x7040('0x2a')](_0x7040('0x6f'));return _0xb91ef2(new Error(_0x7040('0x6f')));}if(_0x445b1a['isDirectory']()){var _0x3dc252=fs[_0x7040('0x71')](path[_0x7040('0x59')](_0x43c54e,_0x59afed[0x0]));if(_0x3dc252[_0x7040('0x3a')]===0x0){removeReferences(_0x3f5f44,_0x43c54e);logger[_0x7040('0x2a')](_0x7040('0x6f'));return _0xb91ef2(new Error(_0x7040('0x6f')));}var _0x250001=_0x3dc252[_0x7040('0x72')](function(_0x549538){return _0x549538===_0x7040('0x73');});if(!_0x250001){return _0xb91ef2(new Error(_0x7040('0x74')));}var _0x39754a=fs['readFileSync'](path[_0x7040('0x59')](_0x43c54e,_0x59afed[0x0],_0x7040('0x73')));var _0x1da290=JSON[_0x7040('0x75')](_0x39754a);if('undefined'==typeof _0x1da290[_0x7040('0x2c')]){return _0xb91ef2(new Error(_0x7040('0x76')));}if(_0x7040('0x1c')==typeof _0x1da290[_0x7040('0x30')]){return _0xb91ef2(new Error(_0x7040('0x77')));}if('undefined'==typeof _0x1da290[_0x7040('0x78')]){return _0xb91ef2(new Error(_0x7040('0x79')));}if(_0x7040('0x1c')==typeof _0x1da290[_0x7040('0x7a')]){return _0xb91ef2(new Error(_0x7040('0x7b')));}if(_0x1da290[_0x7040('0x30')]===_0x7040('0x7c')){if(_0x7040('0x1c')==typeof _0x1da290[_0x7040('0x7a')][_0x7040('0x7d')]){return _0xb91ef2(new Error(_0x7040('0x7e')));}if(_0x7040('0x1c')==typeof _0x1da290['parameters'][_0x7040('0x7d')][_0x7040('0x7f')]&&_0x7040('0x1c')==typeof _0x1da290['parameters'][_0x7040('0x7d')]['agent']){return _0xb91ef2(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1da290[_0x7040('0x30')]===_0x7040('0x80')){if(_0x7040('0x1c')==typeof _0x1da290[_0x7040('0x7a')][_0x7040('0x81')]){return _0xb91ef2(new Error(_0x7040('0x82')));}if('undefined'==typeof _0x1da290['parameters']['scriptPath']){return _0xb91ef2(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xb91ef2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x5551a4=_0x1da290[_0x7040('0x2c')];var _0x583650=_0x1da290[_0x7040('0x83')];var _0xac0a37=_0x1da290[_0x7040('0x30')];var _0x90f21e=_0x1da290[_0x7040('0x84')]?_0x1da290[_0x7040('0x84')]:_0x7040('0x85');var _0x230c74=_0x1da290[_0x7040('0x86')]?_0x1da290[_0x7040('0x86')]:'icon-apps';var _0x3a3460='';var _0x7d40fc='';var _0x16303c='';var _0x33e7dc='';var _0x21c725=_0x1da290[_0x7040('0x78')];if(_0xac0a37==='html'){if(_0x7040('0x1c')!=typeof _0x1da290[_0x7040('0x7a')][_0x7040('0x7d')][_0x7040('0x7f')]){var _0x814e20=_0x1da290[_0x7040('0x7a')][_0x7040('0x7d')][_0x7040('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x7040('0x87')](_0x814e20)){_0x3a3460=path[_0x7040('0x59')](_0x7040('0x88'),_0x3d79bf,_0x59afed[0x0],_0x814e20);}else{_0x3a3460=_0x814e20;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x7040('0x1c')!=typeof _0x1da290['parameters'][_0x7040('0x7d')][_0x7040('0x89')]){var _0x254357=_0x1da290['parameters'][_0x7040('0x7d')][_0x7040('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x7040('0x87')](_0x254357)){_0x7d40fc=path['join'](_0x7040('0x88'),_0x3d79bf,_0x59afed[0x0],_0x254357);}else{_0x7d40fc=_0x254357;}}else{logger['info'](_0x7040('0x8a'));}}else if(_0xac0a37===_0x7040('0x80')){_0x16303c=_0x1da290[_0x7040('0x7a')]['scriptName'];_0x33e7dc=_0x1da290[_0x7040('0x7a')]['scriptPath'];if(_0x7040('0x1c')!=typeof _0x1da290[_0x7040('0x7a')][_0x7040('0x7d')]){if('undefined'!=typeof _0x1da290[_0x7040('0x7a')][_0x7040('0x7d')][_0x7040('0x7f')]){var _0x814e20=_0x1da290['parameters'][_0x7040('0x7d')][_0x7040('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x814e20)){_0x3a3460=path[_0x7040('0x59')](_0x7040('0x88'),_0x3d79bf,_0x59afed[0x0],_0x814e20);}else{_0x3a3460=_0x814e20;}}if(_0x7040('0x1c')!=typeof _0x1da290[_0x7040('0x7a')][_0x7040('0x7d')][_0x7040('0x89')]){var _0x254357=_0x1da290[_0x7040('0x7a')]['views'][_0x7040('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x7040('0x87')](_0x254357)){_0x7d40fc=path[_0x7040('0x59')](_0x7040('0x88'),_0x3d79bf,_0x59afed[0x0],_0x254357);}else{_0x7d40fc=_0x254357;}}}}var _0x250683={'name':_0x5551a4,'description':_0x583650,'path':path[_0x7040('0x59')](_0x3d79bf,_0x59afed[0x0]),'type':_0xac0a37,'sidebar':_0x90f21e,'icon':_0x230c74,'adminUrl':_0x3a3460,'agentUrl':_0x7d40fc,'scriptName':_0x16303c,'scriptPath':_0x33e7dc,'version':_0x21c725};removeReferences(_0x3f5f44,null);return db[_0x7040('0x44')][_0x7040('0x8b')](_0x250683)['then'](function(_0x30da26){var _0x5cf198={'role':_0x3f4fc4[_0x7040('0x8c')][_0x7040('0x8d')],'userProfileId':_0x3f4fc4[_0x7040('0x8c')][_0x7040('0x8e')]};if(!_0x5cf198)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cf198[_0x7040('0x8d')]===_0x7040('0x8f')){var _0x894423=_0x30da26[_0x7040('0x27')]({'plain':!![]});return db[_0x7040('0x90')][_0x7040('0x49')]({'where':{'name':'Plugins','userProfileId':_0x5cf198['userProfileId']},'raw':!![]})[_0x7040('0x25')](function(_0x223a84){if(_0x223a84&&_0x223a84[_0x7040('0x91')]===0x0){return db[_0x7040('0x28')][_0x7040('0x8b')]({'name':_0x894423[_0x7040('0x2c')],'resourceId':_0x894423['id'],'type':_0x223a84['name'],'sectionId':_0x223a84['id']},{})[_0x7040('0x25')](function(){return _0x30da26;});}else{return _0x30da26;}})[_0x7040('0x4a')](function(_0x535669){logger['error'](_0x7040('0x92'),_0x535669);throw _0x535669;});}return _0x30da26;})[_0x7040('0x25')](respondWithResult(_0x4f0d23,null))[_0x7040('0x4a')](handleError(_0x4f0d23,null));}});}catch(_0x2e1d14){_0x4f0d23['status'](0x1f4)['send'](_0x2e1d14);}};function removeReferences(_0xe0acd2,_0x30de18){try{if(_0xe0acd2){fs[_0x7040('0x64')](_0xe0acd2);logger[_0x7040('0x65')](_0x7040('0x93'));}if(_0x30de18){rimraf(_0x30de18,function(){});logger[_0x7040('0x65')](_0x7040('0x94'));}}catch(_0x1db137){logger[_0x7040('0x2a')](_0x1db137);}}exports['update']=function(_0x4b494b,_0xf7459d,_0x308e0c){return db[_0x7040('0x44')][_0x7040('0x49')]({'where':{'id':_0x4b494b[_0x7040('0x4c')]['id']}})[_0x7040('0x25')](handleEntityNotFound(_0xf7459d,null))['then'](saveUpdates(_0x4b494b['body'],null))[_0x7040('0x25')](respondWithResult(_0xf7459d,null))[_0x7040('0x4a')](handleError(_0xf7459d,null));};exports['delete']=function(_0x60ad25,_0x2c7cf8,_0x35aa09){return db[_0x7040('0x44')][_0x7040('0x49')]({'where':{'id':_0x60ad25['params']['id']}})[_0x7040('0x25')](function(_0x5d1b97){if(_0x5d1b97){return _0x5d1b97['destroy']();}})[_0x7040('0x25')](function(_0x1595f1){rimraf(path[_0x7040('0x59')](config[_0x7040('0x5a')],_0x7040('0x4d'),path[_0x7040('0x5b')](_0x1595f1[_0x7040('0x6')])),function(){});return _0x1595f1;})[_0x7040('0x25')](handleEntityNotFound(_0x2c7cf8,null))[_0x7040('0x25')](respondWithStatusCode(_0x2c7cf8,null))['catch'](handleError(_0x2c7cf8,null));};exports[_0x7040('0x95')]=function(_0x5a2529,_0x249974,_0x579fdd){return BPromise['resolve']()[_0x7040('0x25')](function(){if(!_0x5a2529[_0x7040('0x37')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5a2529[_0x7040('0x37')][_0x7040('0x96')]){throw new Error(_0x7040('0x97'));}var _0x529e15=_0x5a2529['query'][_0x7040('0x98')]?_0x5a2529[_0x7040('0x37')]['hostname']+':'+_0x5a2529[_0x7040('0x37')][_0x7040('0x96')]:_0x7040('0x99')+_0x5a2529[_0x7040('0x37')][_0x7040('0x96')];var _0x434bda=_0x5a2529[_0x7040('0x37')][_0x7040('0x1a')]?_0x5a2529[_0x7040('0x37')][_0x7040('0x1a')]:!![];var _0x4e71ab=_0x5a2529[_0x7040('0x37')][_0x7040('0x9a')]?_0x5a2529[_0x7040('0x37')]['encoding']:null;var _0x1255cb={'method':_0x5a2529[_0x7040('0x9b')],'uri':util[_0x7040('0x4e')](_0x7040('0x9c'),_0x529e15,_0x5a2529[_0x7040('0x37')][_0x7040('0x6')]),'json':_0x434bda,'resolveWithFullResponse':!![],'encoding':_0x4e71ab,'qs':_0x5a2529[_0x7040('0x37')]};if(_0x5a2529['headers']){_0x1255cb[_0x7040('0x9d')]=_0x5a2529[_0x7040('0x9d')];if(_0x1255cb['headers'][_0x7040('0x9e')]){delete _0x1255cb[_0x7040('0x9d')][_0x7040('0x9e')];}}if(_0x1255cb[_0x7040('0x9d')][_0x7040('0x9f')]){delete _0x1255cb[_0x7040('0x9d')][_0x7040('0x9f')];}return rp(_0x1255cb);})['then'](function(_0x2e7eaa){if(_0x2e7eaa){_0x249974[_0x7040('0x1f')](_0x2e7eaa[_0x7040('0x9d')]);logger[_0x7040('0x65')](_0x2e7eaa['body']);if(_[_0x7040('0xa0')](_0x5a2529['query']['path'],_0x7040('0x4b'))&&_0x2e7eaa[_0x7040('0xa1')]==0x1f4){return _0x249974[_0x7040('0x29')](_0x2e7eaa[_0x7040('0xa1')]);}else{return _0x249974['status'](_0x2e7eaa[_0x7040('0xa1')])[_0x7040('0xa2')](_0x2e7eaa[_0x7040('0x8c')]);}}else{return _0x249974[_0x7040('0x29')](0xc8);}})['catch'](handleError(_0x249974,null));};exports['webhookPost']=function(_0x26dc58,_0x444e0b,_0x1dc52f){return BPromise[_0x7040('0xa3')]()[_0x7040('0x25')](function(){if(!_0x26dc58[_0x7040('0x37')][_0x7040('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x26dc58[_0x7040('0x37')][_0x7040('0x96')]){throw new Error(_0x7040('0x97'));}var _0x46641a=_0x26dc58[_0x7040('0x37')][_0x7040('0x98')]?_0x26dc58[_0x7040('0x37')][_0x7040('0x98')]+':'+_0x26dc58[_0x7040('0x37')][_0x7040('0x96')]:'http://localhost:'+_0x26dc58[_0x7040('0x37')]['port'];var _0x363edf=_0x26dc58['query']['json']?_0x26dc58[_0x7040('0x37')][_0x7040('0x1a')]:!![];var _0x2a9f11=_0x26dc58[_0x7040('0x37')][_0x7040('0x9a')]?_0x26dc58[_0x7040('0x37')][_0x7040('0x9a')]:null;var _0x346034={'method':_0x26dc58['method'],'uri':util[_0x7040('0x4e')]('%s%s',_0x46641a,_0x26dc58[_0x7040('0x37')]['path']),'json':_0x363edf,'resolveWithFullResponse':!![],'encoding':_0x2a9f11,'body':_0x26dc58['body']};if(_0x26dc58[_0x7040('0x9d')]){_0x346034[_0x7040('0x9d')]=_0x26dc58[_0x7040('0x9d')];if(_0x346034['headers'][_0x7040('0x9e')]){delete _0x346034[_0x7040('0x9d')][_0x7040('0x9e')];}}if(_0x346034[_0x7040('0x9d')][_0x7040('0x9f')]){delete _0x346034[_0x7040('0x9d')]['content-type'];}return rp(_0x346034);})[_0x7040('0x25')](function(_0x289b31){if(_0x289b31){_0x444e0b['set'](_0x289b31['headers']);logger[_0x7040('0x65')](_0x289b31[_0x7040('0x8c')]);return _0x444e0b[_0x7040('0x18')](_0x289b31[_0x7040('0xa1')])[_0x7040('0xa2')](_0x289b31[_0x7040('0x8c')]);}else{return _0x444e0b[_0x7040('0x29')](0xc8);}})[_0x7040('0x4a')](handleError(_0x444e0b,null));}; \ No newline at end of file +var _0x97b3=['zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','filename','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','port','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','sendStatus','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','extract-zip','archiver','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','register','end','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','get','Plugins','UserProfileResource','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','name','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','catch','show','params','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream'];(function(_0x4a7059,_0x256eb9){var _0x4a90b1=function(_0x406cbc){while(--_0x406cbc){_0x4a7059['push'](_0x4a7059['shift']());}};_0x4a90b1(++_0x256eb9);}(_0x97b3,0xfd));var _0x397b=function(_0x145c99,_0x3fdb01){_0x145c99=_0x145c99-0x0;var _0x52a05f=_0x97b3[_0x145c99];return _0x52a05f;};'use strict';var emlformat=require(_0x397b('0x0'));var rimraf=require(_0x397b('0x1'));var zipdir=require(_0x397b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x397b('0x3'));var moment=require(_0x397b('0x4'));var BPromise=require(_0x397b('0x5'));var Mustache=require(_0x397b('0x6'));var util=require('util');var path=require(_0x397b('0x7'));var sox=require(_0x397b('0x8'));var csv=require(_0x397b('0x9'));var ejs=require(_0x397b('0xa'));var fs=require('fs');var fs_extra=require(_0x397b('0xb'));var _=require(_0x397b('0xc'));var squel=require('squel');var crypto=require(_0x397b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x397b('0xe'));var toCsv=require(_0x397b('0x9'));var querystring=require(_0x397b('0xf'));var Papa=require(_0x397b('0x10'));var extract=require(_0x397b('0x11'));var rimraf=require(_0x397b('0x1'));var archiver=require(_0x397b('0x12'));var Redis=require(_0x397b('0x13'));var authService=require(_0x397b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x397b('0x15'));var hardwareService=require(_0x397b('0x16'));var logger=require(_0x397b('0x17'))(_0x397b('0x18'));var utils=require(_0x397b('0x19'));var config=require(_0x397b('0x1a'));var licenseUtil=require(_0x397b('0x1b'));var db=require(_0x397b('0x1c'))['db'];config[_0x397b('0x1d')]=_[_0x397b('0x1e')](config['redis'],{'host':_0x397b('0x1f'),'port':0x18eb});var socket=require(_0x397b('0x20'))(new Redis(config[_0x397b('0x1d')]));require(_0x397b('0x21'))[_0x397b('0x22')](socket);function respondWithStatusCode(_0xbb844f,_0x17b433){_0x17b433=_0x17b433||0xcc;return function(_0x4b9340){if(_0x4b9340){return _0xbb844f['sendStatus'](_0x17b433);}return _0xbb844f['status'](_0x17b433)[_0x397b('0x23')]();};}function respondWithResult(_0x38ca41,_0x410a8e){_0x410a8e=_0x410a8e||0xc8;return function(_0x111171){if(_0x111171){return _0x38ca41['status'](_0x410a8e)[_0x397b('0x24')](_0x111171);}};}function respondWithFilteredResult(_0x921345,_0x2487f3){return function(_0x232177){if(_0x232177){var _0x244c6f=typeof _0x2487f3['offset']===_0x397b('0x25')&&typeof _0x2487f3[_0x397b('0x26')]===_0x397b('0x25');var _0x24d953=_0x232177[_0x397b('0x27')];var _0xbfd9=_0x244c6f?0x0:_0x2487f3['offset'];var _0x4779e7=_0x244c6f?_0x232177[_0x397b('0x27')]:_0x2487f3[_0x397b('0x28')]+_0x2487f3[_0x397b('0x26')];var _0x38c6f0;if(_0x4779e7>=_0x24d953){_0x4779e7=_0x24d953;_0x38c6f0=0xc8;}else{_0x38c6f0=0xce;}_0x921345[_0x397b('0x29')](_0x38c6f0);return _0x921345[_0x397b('0x2a')]('Content-Range',_0xbfd9+'-'+_0x4779e7+'/'+_0x24d953)['json'](_0x232177);}return null;};}function patchUpdates(_0x3434c2){return function(_0x1fe98b){try{jsonpatch[_0x397b('0x2b')](_0x1fe98b,_0x3434c2,!![]);}catch(_0x3f077d){return BPromise[_0x397b('0x2c')](_0x3f077d);}return _0x1fe98b[_0x397b('0x2d')]();};}function saveUpdates(_0x257aca,_0x47ebc7){return function(_0x2fca8d){if(_0x2fca8d){return _0x2fca8d[_0x397b('0x2e')](_0x257aca)[_0x397b('0x2f')](function(_0xffc6e9){return _0xffc6e9;});}return null;};}function removeEntity(_0x1e1324,_0x148279){return function(_0x267b77){if(_0x267b77){return _0x267b77['destroy']()[_0x397b('0x2f')](function(){var _0x45911a=_0x267b77[_0x397b('0x30')]({'plain':!![]});var _0x829624=_0x397b('0x31');return db[_0x397b('0x32')][_0x397b('0x33')]({'where':{'type':_0x829624,'resourceId':_0x45911a['id']}})[_0x397b('0x2f')](function(){return _0x267b77;});})[_0x397b('0x2f')](function(){_0x1e1324[_0x397b('0x29')](0xcc)[_0x397b('0x23')]();});}};}function handleEntityNotFound(_0x45bd56,_0x252f22){return function(_0x2af38b){if(!_0x2af38b){_0x45bd56['sendStatus'](0x194);}return _0x2af38b;};}function handleError(_0x5d9ea9,_0x1bccee){_0x1bccee=_0x1bccee||0x1f4;return function(_0x22acaa){logger[_0x397b('0x34')](_0x22acaa[_0x397b('0x35')]);if(_0x22acaa['name']){delete _0x22acaa['name'];}_0x5d9ea9[_0x397b('0x29')](_0x1bccee)['send'](_0x22acaa);};}exports[_0x397b('0x36')]=function(_0x31f4f9,_0x17ce42){var _0x1b5645={},_0x538048={},_0x4373cc={'count':0x0,'rows':[]};var _0x3a1bfb=_[_0x397b('0x37')](db['Plugin'][_0x397b('0x38')],function(_0x16fb4f){return{'name':_0x16fb4f[_0x397b('0x39')],'type':_0x16fb4f[_0x397b('0x3a')][_0x397b('0x3b')]};});_0x538048['model']=_[_0x397b('0x37')](_0x3a1bfb,_0x397b('0x3c'));_0x538048['query']=_[_0x397b('0x3d')](_0x31f4f9[_0x397b('0x3e')]);_0x538048['filters']=_[_0x397b('0x3f')](_0x538048[_0x397b('0x40')],_0x538048[_0x397b('0x3e')]);_0x1b5645[_0x397b('0x41')]=_[_0x397b('0x3f')](_0x538048[_0x397b('0x40')],qs[_0x397b('0x42')](_0x31f4f9[_0x397b('0x3e')]['fields']));_0x1b5645[_0x397b('0x41')]=_0x1b5645[_0x397b('0x41')][_0x397b('0x43')]?_0x1b5645[_0x397b('0x41')]:_0x538048[_0x397b('0x40')];if(!_0x31f4f9[_0x397b('0x3e')]['hasOwnProperty'](_0x397b('0x44'))){_0x1b5645[_0x397b('0x26')]=qs[_0x397b('0x26')](_0x31f4f9[_0x397b('0x3e')][_0x397b('0x26')]);_0x1b5645[_0x397b('0x28')]=qs['offset'](_0x31f4f9[_0x397b('0x3e')][_0x397b('0x28')]);}_0x1b5645[_0x397b('0x45')]=qs[_0x397b('0x46')](_0x31f4f9[_0x397b('0x3e')][_0x397b('0x46')]);_0x1b5645[_0x397b('0x47')]=qs[_0x397b('0x48')](_['pick'](_0x31f4f9[_0x397b('0x3e')],_0x538048[_0x397b('0x48')]),_0x3a1bfb);if(_0x31f4f9[_0x397b('0x3e')][_0x397b('0x49')]){_0x1b5645[_0x397b('0x47')]=_[_0x397b('0x4a')](_0x1b5645[_0x397b('0x47')],{'$or':_[_0x397b('0x37')](_0x3a1bfb,function(_0x32b54b){if(_0x32b54b[_0x397b('0x3a')]!==_0x397b('0x4b')){var _0x3b6be3={};_0x3b6be3[_0x32b54b['name']]={'$like':'%'+_0x31f4f9['query'][_0x397b('0x49')]+'%'};return _0x3b6be3;}})});}_0x1b5645=_[_0x397b('0x4a')]({},_0x1b5645,_0x31f4f9[_0x397b('0x4c')]);var _0x4cb857={'where':_0x1b5645[_0x397b('0x47')]};return db[_0x397b('0x4d')][_0x397b('0x27')](_0x4cb857)[_0x397b('0x2f')](function(_0x503915){_0x4373cc[_0x397b('0x27')]=_0x503915;if(_0x31f4f9[_0x397b('0x3e')][_0x397b('0x4e')]){_0x1b5645[_0x397b('0x4f')]=[{'all':!![]}];}return db['Plugin'][_0x397b('0x50')](_0x1b5645);})['then'](function(_0x2d06c2){_0x4373cc['rows']=_0x2d06c2;return _0x4373cc;})['then'](respondWithFilteredResult(_0x17ce42,_0x1b5645))[_0x397b('0x51')](handleError(_0x17ce42,null));};exports[_0x397b('0x52')]=function(_0x5596a9,_0x317d10){var _0x26e0ba={'raw':!![],'where':{'id':_0x5596a9[_0x397b('0x53')]['id']}},_0x290581={};_0x290581[_0x397b('0x40')]=_[_0x397b('0x3d')](db[_0x397b('0x4d')][_0x397b('0x38')]);_0x290581[_0x397b('0x3e')]=_[_0x397b('0x3d')](_0x5596a9['query']);_0x290581[_0x397b('0x48')]=_['intersection'](_0x290581[_0x397b('0x40')],_0x290581['query']);_0x26e0ba['attributes']=_[_0x397b('0x3f')](_0x290581[_0x397b('0x40')],qs['fields'](_0x5596a9['query'][_0x397b('0x42')]));_0x26e0ba[_0x397b('0x41')]=_0x26e0ba[_0x397b('0x41')][_0x397b('0x43')]?_0x26e0ba['attributes']:_0x290581['model'];if(_0x5596a9[_0x397b('0x3e')][_0x397b('0x4e')]){_0x26e0ba[_0x397b('0x4f')]=[{'all':!![]}];}_0x26e0ba=_['merge']({},_0x26e0ba,_0x5596a9[_0x397b('0x4c')]);return db[_0x397b('0x4d')][_0x397b('0x54')](_0x26e0ba)[_0x397b('0x2f')](handleEntityNotFound(_0x317d10,null))[_0x397b('0x2f')](respondWithResult(_0x317d10,null))['catch'](handleError(_0x317d10,null));};exports[_0x397b('0x55')]=function(_0x2eacb7,_0xd2eea3,_0x265f01){return db[_0x397b('0x4d')][_0x397b('0x54')]({'where':{'id':_0x2eacb7['params']['id']},'attributes':[_0x397b('0x3c'),_0x397b('0x7')],'raw':!![]})[_0x397b('0x2f')](handleEntityNotFound(_0xd2eea3,null))['then'](function(_0x2037b2){if(_0x2037b2){var _0x282f0f=path[_0x397b('0x56')](config[_0x397b('0x57')],_0x397b('0x58'),util[_0x397b('0x59')](_0x397b('0x5a'),path[_0x397b('0x5b')](_0x2037b2[_0x397b('0x7')])));var _0x1338c3=fs[_0x397b('0x5c')](_0x282f0f);var _0x55f41f=archiver(_0x397b('0x5d'),{'zlib':{'level':0x9}});_0x55f41f['on'](_0x397b('0x5e'),function(_0x903182){if(_0x903182[_0x397b('0x5f')]===_0x397b('0x60')){logger[_0x397b('0x34')](_0x903182);}else{throw new db[(_0x397b('0x61'))][(_0x397b('0x62'))](_0x397b('0x63'));}});_0x55f41f['on'](_0x397b('0x34'),function(_0x2baf41){throw new db[(_0x397b('0x61'))][(_0x397b('0x62'))](_0x397b('0x63'));});_0x55f41f[_0x397b('0x64')](_0x1338c3);_0x55f41f['glob']('**/*',{'cwd':path[_0x397b('0x56')](config[_0x397b('0x57')],_0x397b('0x58'),path[_0x397b('0x65')](_0x2037b2['path'])),'ignore':[path['join'](path[_0x397b('0x5b')](_0x2037b2[_0x397b('0x7')]),_0x397b('0x66')),path[_0x397b('0x56')](path[_0x397b('0x5b')](_0x2037b2[_0x397b('0x7')]),_0x397b('0x67'))],'nodir':!![]})['finalize']();_0x1338c3['on'](_0x397b('0x68'),function(){if(!fs[_0x397b('0x69')](_0x282f0f)){throw new db[(_0x397b('0x61'))][(_0x397b('0x62'))](_0x397b('0x6a'));}return _0xd2eea3[_0x397b('0x55')](_0x282f0f,util[_0x397b('0x59')]('%s.zip',path[_0x397b('0x5b')](_0x2037b2[_0x397b('0x7')])),function(_0x4ce54b){if(_0x4ce54b){throw new db['Sequelize'][(_0x397b('0x62'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x397b('0x6b')](_0x282f0f);logger[_0x397b('0x6c')]('Download\x20completed');logger[_0x397b('0x6c')]('Temporary\x20file\x20removed');});});}return null;})[_0x397b('0x51')](handleError(_0xd2eea3,null));};exports['upload']=function(_0x756647,_0x593661,_0x3e7d36){var _0x257456=path[_0x397b('0x5b')](_0x756647['file'][_0x397b('0x6d')],path['extname'](_0x756647[_0x397b('0x6e')][_0x397b('0x6d')]));var _0xabf1a8=path[_0x397b('0x56')](config[_0x397b('0x57')],'server/files/plugins',_0x756647['file']['filename']);var _0x21b0de=path[_0x397b('0x56')](config[_0x397b('0x57')],_0x397b('0x58'),_0x257456);logger['info'](_0x397b('0x6f'),_0xabf1a8);logger[_0x397b('0x6c')](_0x397b('0x70'),_0x21b0de);try{fs[_0x397b('0x71')](_0xabf1a8,parseInt(_0x397b('0x72'),0x8));extract(_0xabf1a8,{'dir':_0x21b0de},function(_0x3a1575){if(_0x3a1575){logger[_0x397b('0x34')](_0x3a1575);handleError(_0x3a1575,!![]);};var _0x5dfd5b=fs[_0x397b('0x73')](_0x21b0de);if(_0x5dfd5b[_0x397b('0x43')]>0x1){removeReferences(_0xabf1a8,_0x21b0de);logger[_0x397b('0x34')](_0x397b('0x74'));return _0x3e7d36(new Error(_0x397b('0x74')));}var _0x1a3079=fs['lstatSync'](path['join'](_0x21b0de,_0x5dfd5b[0x0]));if(_0x1a3079[_0x397b('0x75')]()){removeReferences(_0xabf1a8,_0x21b0de);logger[_0x397b('0x34')](_0x397b('0x74'));return _0x3e7d36(new Error('Invalid\x20plugin\x20structure'));}if(_0x1a3079[_0x397b('0x76')]()){var _0xc5c414=fs[_0x397b('0x73')](path[_0x397b('0x56')](_0x21b0de,_0x5dfd5b[0x0]));if(_0xc5c414['length']===0x0){removeReferences(_0xabf1a8,_0x21b0de);logger['error'](_0x397b('0x74'));return _0x3e7d36(new Error(_0x397b('0x74')));}var _0x229254=_0xc5c414['some'](function(_0x57a150){return _0x57a150===_0x397b('0x77');});if(!_0x229254){return _0x3e7d36(new Error('Plugin\x20manifest\x20missing'));}var _0x4faccf=fs['readFileSync'](path[_0x397b('0x56')](_0x21b0de,_0x5dfd5b[0x0],_0x397b('0x77')));var _0x3963d6=JSON[_0x397b('0x78')](_0x4faccf);if(_0x397b('0x25')==typeof _0x3963d6[_0x397b('0x3c')]){return _0x3e7d36(new Error(_0x397b('0x79')));}if(_0x397b('0x25')==typeof _0x3963d6['type']){return _0x3e7d36(new Error(_0x397b('0x7a')));}if(_0x397b('0x25')==typeof _0x3963d6[_0x397b('0x7b')]){return _0x3e7d36(new Error(_0x397b('0x7c')));}if(_0x397b('0x25')==typeof _0x3963d6[_0x397b('0x7d')]){return _0x3e7d36(new Error(_0x397b('0x7e')));}if(_0x3963d6[_0x397b('0x3a')]===_0x397b('0x7f')){if(_0x397b('0x25')==typeof _0x3963d6[_0x397b('0x7d')]['views']){return _0x3e7d36(new Error(_0x397b('0x80')));}if(_0x397b('0x25')==typeof _0x3963d6['parameters'][_0x397b('0x81')]['admin']&&_0x397b('0x25')==typeof _0x3963d6[_0x397b('0x7d')][_0x397b('0x81')][_0x397b('0x82')]){return _0x3e7d36(new Error(_0x397b('0x83')));}}else if(_0x3963d6[_0x397b('0x3a')]===_0x397b('0x84')){if(_0x397b('0x25')==typeof _0x3963d6['parameters']['scriptName']){return _0x3e7d36(new Error(_0x397b('0x85')));}if(_0x397b('0x25')==typeof _0x3963d6[_0x397b('0x7d')][_0x397b('0x86')]){return _0x3e7d36(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3e7d36(new Error(_0x397b('0x87')));}var _0x499a51=_0x3963d6[_0x397b('0x3c')];var _0x59c6ef=_0x3963d6[_0x397b('0x88')];var _0x1c922b=_0x3963d6[_0x397b('0x3a')];var _0x1871a5=_0x3963d6[_0x397b('0x89')]?_0x3963d6[_0x397b('0x89')]:_0x397b('0x8a');var _0x20b9c0=_0x3963d6[_0x397b('0x8b')]?_0x3963d6[_0x397b('0x8b')]:_0x397b('0x8c');var _0x3e0276='';var _0x54286d='';var _0x244c4a='';var _0x4a9f01='';var _0x18c000=_0x3963d6[_0x397b('0x7b')];if(_0x1c922b==='html'){if(_0x397b('0x25')!=typeof _0x3963d6['parameters'][_0x397b('0x81')][_0x397b('0x8d')]){var _0x175f28=_0x3963d6['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x397b('0x8e')](_0x175f28)){_0x3e0276=path['join'](_0x397b('0x8f'),_0x257456,_0x5dfd5b[0x0],_0x175f28);}else{_0x3e0276=_0x175f28;}}else{logger[_0x397b('0x6c')](_0x397b('0x90'));}if(_0x397b('0x25')!=typeof _0x3963d6['parameters'][_0x397b('0x81')][_0x397b('0x82')]){var _0x30e24c=_0x3963d6['parameters'][_0x397b('0x81')][_0x397b('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x397b('0x8e')](_0x30e24c)){_0x54286d=path['join']('plugins',_0x257456,_0x5dfd5b[0x0],_0x30e24c);}else{_0x54286d=_0x30e24c;}}else{logger[_0x397b('0x6c')](_0x397b('0x91'));}}else if(_0x1c922b===_0x397b('0x84')){_0x244c4a=_0x3963d6[_0x397b('0x7d')][_0x397b('0x92')];_0x4a9f01=_0x3963d6[_0x397b('0x7d')]['scriptPath'];if(_0x397b('0x25')!=typeof _0x3963d6[_0x397b('0x7d')][_0x397b('0x81')]){if(_0x397b('0x25')!=typeof _0x3963d6[_0x397b('0x7d')][_0x397b('0x81')][_0x397b('0x8d')]){var _0x175f28=_0x3963d6['parameters'][_0x397b('0x81')][_0x397b('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0x397b('0x8e')](_0x175f28)){_0x3e0276=path[_0x397b('0x56')](_0x397b('0x8f'),_0x257456,_0x5dfd5b[0x0],_0x175f28);}else{_0x3e0276=_0x175f28;}}if(_0x397b('0x25')!=typeof _0x3963d6[_0x397b('0x7d')]['views']['agent']){var _0x30e24c=_0x3963d6[_0x397b('0x7d')][_0x397b('0x81')][_0x397b('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x30e24c)){_0x54286d=path[_0x397b('0x56')](_0x397b('0x8f'),_0x257456,_0x5dfd5b[0x0],_0x30e24c);}else{_0x54286d=_0x30e24c;}}}}var _0x12c58c={'name':_0x499a51,'description':_0x59c6ef,'path':path['join'](_0x257456,_0x5dfd5b[0x0]),'type':_0x1c922b,'sidebar':_0x1871a5,'icon':_0x20b9c0,'adminUrl':_0x3e0276,'agentUrl':_0x54286d,'scriptName':_0x244c4a,'scriptPath':_0x4a9f01,'version':_0x18c000};removeReferences(_0xabf1a8,null);return db['Plugin'][_0x397b('0x93')](_0x12c58c)[_0x397b('0x2f')](function(_0x386834){var _0x1e9d26={'role':_0x756647[_0x397b('0x94')][_0x397b('0x95')],'userProfileId':_0x756647[_0x397b('0x94')][_0x397b('0x96')]};if(!_0x1e9d26)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e9d26['role']===_0x397b('0x97')){var _0x2dfbf5=_0x386834[_0x397b('0x30')]({'plain':!![]});return db['UserProfileSection'][_0x397b('0x54')]({'where':{'name':_0x397b('0x31'),'userProfileId':_0x1e9d26[_0x397b('0x96')]},'raw':!![]})[_0x397b('0x2f')](function(_0xa6b6aa){if(_0xa6b6aa&&_0xa6b6aa[_0x397b('0x98')]===0x0){return db['UserProfileResource'][_0x397b('0x93')]({'name':_0x2dfbf5[_0x397b('0x3c')],'resourceId':_0x2dfbf5['id'],'type':_0xa6b6aa[_0x397b('0x3c')],'sectionId':_0xa6b6aa['id']},{})['then'](function(){return _0x386834;});}else{return _0x386834;}})[_0x397b('0x51')](function(_0x443ba5){logger[_0x397b('0x34')](_0x397b('0x99'),_0x443ba5);throw _0x443ba5;});}return _0x386834;})[_0x397b('0x2f')](respondWithResult(_0x593661,null))[_0x397b('0x51')](handleError(_0x593661,null));}});}catch(_0x9721ac){_0x593661[_0x397b('0x29')](0x1f4)['send'](_0x9721ac);}};function removeReferences(_0x44ae9b,_0x5c722d){try{if(_0x44ae9b){fs['unlinkSync'](_0x44ae9b);logger['info'](_0x397b('0x9a'));}if(_0x5c722d){rimraf(_0x5c722d,function(){});logger[_0x397b('0x6c')](_0x397b('0x9b'));}}catch(_0x52f394){logger[_0x397b('0x34')](_0x52f394);}}exports[_0x397b('0x2e')]=function(_0x798aa8,_0x25b3fa,_0x482ff1){return db[_0x397b('0x4d')][_0x397b('0x54')]({'where':{'id':_0x798aa8['params']['id']}})[_0x397b('0x2f')](handleEntityNotFound(_0x25b3fa,null))[_0x397b('0x2f')](saveUpdates(_0x798aa8[_0x397b('0x94')],null))['then'](respondWithResult(_0x25b3fa,null))['catch'](handleError(_0x25b3fa,null));};exports[_0x397b('0x9c')]=function(_0x52d7ca,_0x301e8d,_0x115b19){return db[_0x397b('0x4d')]['find']({'where':{'id':_0x52d7ca[_0x397b('0x53')]['id']}})[_0x397b('0x2f')](function(_0x48c574){if(_0x48c574){return _0x48c574[_0x397b('0x33')]();}})['then'](function(_0x138d4d){rimraf(path[_0x397b('0x56')](config[_0x397b('0x57')],_0x397b('0x58'),path[_0x397b('0x65')](_0x138d4d['path'])),function(){});return _0x138d4d;})[_0x397b('0x2f')](handleEntityNotFound(_0x301e8d,null))[_0x397b('0x2f')](respondWithStatusCode(_0x301e8d,null))[_0x397b('0x51')](handleError(_0x301e8d,null));};exports[_0x397b('0x9d')]=function(_0x2a425e,_0x31a473,_0x481b41){return BPromise[_0x397b('0x9e')]()[_0x397b('0x2f')](function(){if(!_0x2a425e['query'][_0x397b('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2a425e['query'][_0x397b('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2d531e=_0x2a425e['query'][_0x397b('0xa0')]?_0x2a425e[_0x397b('0x3e')][_0x397b('0xa0')]+':'+_0x2a425e[_0x397b('0x3e')][_0x397b('0x9f')]:'http://localhost:'+_0x2a425e['query']['port'];var _0x809e6=_0x2a425e[_0x397b('0x3e')][_0x397b('0x24')]?_0x2a425e[_0x397b('0x3e')][_0x397b('0x24')]:!![];var _0x90c360=_0x2a425e['query'][_0x397b('0xa1')]?_0x2a425e[_0x397b('0x3e')][_0x397b('0xa1')]:null;var _0xe8da88={'method':_0x2a425e[_0x397b('0xa2')],'uri':util['format'](_0x397b('0xa3'),_0x2d531e,_0x2a425e[_0x397b('0x3e')][_0x397b('0x7')]),'json':_0x809e6,'resolveWithFullResponse':!![],'encoding':_0x90c360,'qs':_0x2a425e['query']};if(_0x2a425e['headers']){_0xe8da88[_0x397b('0xa4')]=_0x2a425e[_0x397b('0xa4')];if(_0xe8da88['headers'][_0x397b('0xa5')]){delete _0xe8da88['headers']['content-length'];}}if(_0xe8da88['headers']['content-type']){delete _0xe8da88[_0x397b('0xa4')][_0x397b('0xa6')];}return rp(_0xe8da88);})[_0x397b('0x2f')](function(_0x25a516){if(_0x25a516){_0x31a473[_0x397b('0x2a')](_0x25a516['headers']);logger[_0x397b('0x6c')](_0x25a516[_0x397b('0x94')]);if(_[_0x397b('0xa7')](_0x2a425e[_0x397b('0x3e')][_0x397b('0x7')],_0x397b('0x55'))&&_0x25a516['statusCode']==0x1f4){return _0x31a473[_0x397b('0xa8')](_0x25a516[_0x397b('0xa9')]);}else{return _0x31a473[_0x397b('0x29')](_0x25a516[_0x397b('0xa9')])['send'](_0x25a516[_0x397b('0x94')]);}}else{return _0x31a473[_0x397b('0xa8')](0xc8);}})[_0x397b('0x51')](handleError(_0x31a473,null));};exports[_0x397b('0xaa')]=function(_0x2d7af1,_0x2345f6,_0x5945f0){return BPromise[_0x397b('0x9e')]()[_0x397b('0x2f')](function(){if(!_0x2d7af1[_0x397b('0x3e')][_0x397b('0x7')]){throw new Error(_0x397b('0xab'));}if(!_0x2d7af1['query'][_0x397b('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5e4fe4=_0x2d7af1[_0x397b('0x3e')]['hostname']?_0x2d7af1[_0x397b('0x3e')][_0x397b('0xa0')]+':'+_0x2d7af1['query'][_0x397b('0x9f')]:_0x397b('0xac')+_0x2d7af1[_0x397b('0x3e')][_0x397b('0x9f')];var _0x118f72=_0x2d7af1[_0x397b('0x3e')][_0x397b('0x24')]?_0x2d7af1[_0x397b('0x3e')][_0x397b('0x24')]:!![];var _0x4f6516=_0x2d7af1[_0x397b('0x3e')]['encoding']?_0x2d7af1[_0x397b('0x3e')][_0x397b('0xa1')]:null;var _0x41014f={'method':_0x2d7af1['method'],'uri':util['format'](_0x397b('0xa3'),_0x5e4fe4,_0x2d7af1[_0x397b('0x3e')][_0x397b('0x7')]),'json':_0x118f72,'resolveWithFullResponse':!![],'encoding':_0x4f6516,'body':_0x2d7af1['body']};if(_0x2d7af1[_0x397b('0xa4')]){_0x41014f['headers']=_0x2d7af1[_0x397b('0xa4')];if(_0x41014f['headers'][_0x397b('0xa5')]){delete _0x41014f[_0x397b('0xa4')][_0x397b('0xa5')];}}if(_0x41014f[_0x397b('0xa4')][_0x397b('0xa6')]){delete _0x41014f[_0x397b('0xa4')][_0x397b('0xa6')];}return rp(_0x41014f);})['then'](function(_0x5ab12a){if(_0x5ab12a){_0x2345f6[_0x397b('0x2a')](_0x5ab12a[_0x397b('0xa4')]);logger[_0x397b('0x6c')](_0x5ab12a[_0x397b('0x94')]);return _0x2345f6[_0x397b('0x29')](_0x5ab12a[_0x397b('0xa9')])['send'](_0x5ab12a['body']);}else{return _0x2345f6[_0x397b('0xa8')](0xc8);}})[_0x397b('0x51')](handleError(_0x2345f6,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index afedfbc..bb96500 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 _0x960c=['emit','hasOwnProperty','hook','events','Plugin','save','update','remove'];(function(_0x164442,_0x5279ea){var _0x349e25=function(_0x2584bf){while(--_0x2584bf){_0x164442['push'](_0x164442['shift']());}};_0x349e25(++_0x5279ea);}(_0x960c,0x113));var _0xc960=function(_0x25d1d7,_0x38e0d1){_0x25d1d7=_0x25d1d7-0x0;var _0x4c3245=_0x960c[_0x25d1d7];return _0x4c3245;};'use strict';var EventEmitter=require(_0xc960('0x0'));var Plugin=require('../../mysqldb')['db'][_0xc960('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc960('0x2'),'afterUpdate':_0xc960('0x3'),'afterDestroy':_0xc960('0x4')};function emitEvent(_0x5c6ea5){return function(_0x1b54d7,_0x3ff69d,_0x485db9){PluginEvents['emit'](_0x5c6ea5+':'+_0x1b54d7['id'],_0x1b54d7);PluginEvents[_0xc960('0x5')](_0x5c6ea5,_0x1b54d7);_0x485db9(null);};}for(var e in events){if(events[_0xc960('0x6')](e)){var event=events[e];Plugin[_0xc960('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x423b=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3cfe05,_0x5799dd){var _0x1c4bee=function(_0x38dee6){while(--_0x38dee6){_0x3cfe05['push'](_0x3cfe05['shift']());}};_0x1c4bee(++_0x5799dd);}(_0x423b,0x12b));var _0xb423=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x423b[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xb423('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xb423('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb423('0x2'),'afterDestroy':'remove'};function emitEvent(_0x57cd26){return function(_0x50f31a,_0x2fa5da,_0x5f207d){PluginEvents['emit'](_0x57cd26+':'+_0x50f31a['id'],_0x50f31a);PluginEvents[_0xb423('0x3')](_0x57cd26,_0x50f31a);_0x5f207d(null);};}for(var e in events){if(events[_0xb423('0x4')](e)){var event=events[e];Plugin[_0xb423('0x5')](e,emitEvent(event));}}module[_0xb423('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 52777a9..cd09b92 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 _0xd2bc=['api','moment','path','../../config/environment','./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x5e5f2d,_0x300ae9){var _0xd4835=function(_0x369bd0){while(--_0x369bd0){_0x5e5f2d['push'](_0x5e5f2d['shift']());}};_0xd4835(++_0x300ae9);}(_0xd2bc,0x1ec));var _0xcd2b=function(_0x1d7efb,_0x11d3fd){_0x1d7efb=_0x1d7efb-0x0;var _0x435535=_0xd2bc[_0x1d7efb];return _0x435535;};'use strict';var _=require(_0xcd2b('0x0'));var util=require(_0xcd2b('0x1'));var logger=require(_0xcd2b('0x2'))(_0xcd2b('0x3'));var moment=require(_0xcd2b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd2b('0x5'));var rimraf=require('rimraf');var config=require(_0xcd2b('0x6'));var attributes=require(_0xcd2b('0x7'));module[_0xcd2b('0x8')]=function(_0xd347e9,_0x13cfba){return _0xd347e9['define'](_0xcd2b('0x9'),attributes,{'tableName':_0xcd2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf120=['./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2371cd,_0x18bb8d){var _0x48e5f3=function(_0x3e29bd){while(--_0x3e29bd){_0x2371cd['push'](_0x2371cd['shift']());}};_0x48e5f3(++_0x18bb8d);}(_0xf120,0x179));var _0x0f12=function(_0x1f429c,_0x1a0c8a){_0x1f429c=_0x1f429c-0x0;var _0x3921a4=_0xf120[_0x1f429c];return _0x3921a4;};'use strict';var _=require('lodash');var util=require(_0x0f12('0x0'));var logger=require(_0x0f12('0x1'))(_0x0f12('0x2'));var moment=require('moment');var BPromise=require(_0x0f12('0x3'));var rp=require(_0x0f12('0x4'));var fs=require('fs');var path=require(_0x0f12('0x5'));var rimraf=require('rimraf');var config=require(_0x0f12('0x6'));var attributes=require(_0x0f12('0x7'));module[_0x0f12('0x8')]=function(_0x308941,_0x21f951){return _0x308941[_0x0f12('0x9')](_0x0f12('0xa'),attributes,{'tableName':_0x0f12('0xb'),'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 6996c7a..e51392f 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 _0xc06a=['Plugin','create','body','raw','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreatePlugin'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xc06a,0x9a));var _0xac06=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc06a[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0xac06('0x0'));var moment=require(_0xac06('0x1'));var BPromise=require(_0xac06('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac06('0x3'));var db=require(_0xac06('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac06('0x5'));var config=require(_0xac06('0x6'));var jayson=require(_0xac06('0x7'));var client=jayson[_0xac06('0x8')][_0xac06('0x9')]({'port':0x232a});config[_0xac06('0xa')]=_[_0xac06('0xb')](config[_0xac06('0xa')],{'host':_0xac06('0xc'),'port':0x18eb});var socket=require(_0xac06('0xd'))(new Redis(config['redis']));require(_0xac06('0xe'))[_0xac06('0xf')](socket);function respondWithRpcPromise(_0x9f5113,_0x2b71d6,_0x39fb6c){return new BPromise(function(_0x155338,_0x352e41){return client['request'](_0x9f5113,_0x39fb6c)[_0xac06('0x10')](function(_0xddfb84){logger['info'](_0xac06('0x11'),_0x2b71d6,_0xac06('0x12'));logger['debug'](_0xac06('0x13'),_0x2b71d6,'request\x20sent',JSON[_0xac06('0x14')](_0xddfb84));if(_0xddfb84[_0xac06('0x15')]){if(_0xddfb84[_0xac06('0x15')][_0xac06('0x16')]===0x1f4){logger[_0xac06('0x15')](_0xac06('0x11'),_0x2b71d6,_0xddfb84[_0xac06('0x15')][_0xac06('0x17')]);return _0x352e41(_0xddfb84[_0xac06('0x15')][_0xac06('0x17')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x2b71d6,_0xddfb84[_0xac06('0x15')][_0xac06('0x17')]);return _0x155338(_0xddfb84[_0xac06('0x15')]['message']);}else{logger[_0xac06('0x18')](_0xac06('0x11'),_0x2b71d6,_0xac06('0x12'));_0x155338(_0xddfb84['result'][_0xac06('0x17')]);}})['catch'](function(_0x167491){logger[_0xac06('0x15')](_0xac06('0x11'),_0x2b71d6,_0x167491);_0x352e41(_0x167491);});});}exports[_0xac06('0x19')]=function(_0x515a35){var _0x4a0fef=this;return new Promise(function(_0x307fa1,_0x17ff61){return db[_0xac06('0x1a')][_0xac06('0x1b')](_0x515a35[_0xac06('0x1c')],{'raw':_0x515a35['options']?_0x515a35['options'][_0xac06('0x1d')]===undefined?!![]:![]:!![]})[_0xac06('0x10')](function(_0x15d2ca){logger['info'](_0xac06('0x19'),_0x515a35);logger['debug'](_0xac06('0x19'),_0x515a35,JSON['stringify'](_0x15d2ca));_0x307fa1(_0x15d2ca);})['catch'](function(_0x4d23bf){logger[_0xac06('0x15')](_0xac06('0x19'),_0x4d23bf['message'],_0x515a35);_0x17ff61(_0x4a0fef[_0xac06('0x15')](0x1f4,_0x4d23bf[_0xac06('0x17')]));});});}; \ No newline at end of file +var _0xa269=['CreatePlugin','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','body','options'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa269,0xd3));var _0x9a26=function(_0x1555ef,_0x27007e){_0x1555ef=_0x1555ef-0x0;var _0x143755=_0xa269[_0x1555ef];return _0x143755;};'use strict';var _=require(_0x9a26('0x0'));var util=require(_0x9a26('0x1'));var moment=require(_0x9a26('0x2'));var BPromise=require(_0x9a26('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a26('0x4'));var db=require(_0x9a26('0x5'))['db'];var utils=require(_0x9a26('0x6'));var logger=require('../../config/logger')(_0x9a26('0x7'));var config=require(_0x9a26('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9a26('0x9')][_0x9a26('0xa')]({'port':0x232a});config[_0x9a26('0xb')]=_[_0x9a26('0xc')](config[_0x9a26('0xb')],{'host':_0x9a26('0xd'),'port':0x18eb});var socket=require(_0x9a26('0xe'))(new Redis(config[_0x9a26('0xb')]));require(_0x9a26('0xf'))[_0x9a26('0x10')](socket);function respondWithRpcPromise(_0x50b98f,_0x518f8f,_0x3d8422){return new BPromise(function(_0x3f2ec8,_0x3fce55){return client[_0x9a26('0x11')](_0x50b98f,_0x3d8422)[_0x9a26('0x12')](function(_0x1d3fa9){logger[_0x9a26('0x13')](_0x9a26('0x14'),_0x518f8f,_0x9a26('0x15'));logger[_0x9a26('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0x518f8f,_0x9a26('0x15'),JSON[_0x9a26('0x17')](_0x1d3fa9));if(_0x1d3fa9[_0x9a26('0x18')]){if(_0x1d3fa9['error']['code']===0x1f4){logger[_0x9a26('0x18')](_0x9a26('0x14'),_0x518f8f,_0x1d3fa9[_0x9a26('0x18')][_0x9a26('0x19')]);return _0x3fce55(_0x1d3fa9['error']['message']);}logger['error'](_0x9a26('0x14'),_0x518f8f,_0x1d3fa9[_0x9a26('0x18')]['message']);return _0x3f2ec8(_0x1d3fa9[_0x9a26('0x18')][_0x9a26('0x19')]);}else{logger[_0x9a26('0x13')](_0x9a26('0x14'),_0x518f8f,_0x9a26('0x15'));_0x3f2ec8(_0x1d3fa9['result']['message']);}})[_0x9a26('0x1a')](function(_0x48c651){logger[_0x9a26('0x18')](_0x9a26('0x14'),_0x518f8f,_0x48c651);_0x3fce55(_0x48c651);});});}exports['CreatePlugin']=function(_0x4ef8af){var _0x4de744=this;return new Promise(function(_0x30539a,_0x931dbf){return db['Plugin']['create'](_0x4ef8af[_0x9a26('0x1b')],{'raw':_0x4ef8af['options']?_0x4ef8af[_0x9a26('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x9a26('0x12')](function(_0x379450){logger[_0x9a26('0x13')]('CreatePlugin',_0x4ef8af);logger['debug'](_0x9a26('0x1d'),_0x4ef8af,JSON[_0x9a26('0x17')](_0x379450));_0x30539a(_0x379450);})['catch'](function(_0x3aaee8){logger[_0x9a26('0x18')](_0x9a26('0x1d'),_0x3aaee8[_0x9a26('0x19')],_0x4ef8af);_0x931dbf(_0x4de744[_0x9a26('0x18')](0x1f4,_0x3aaee8['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 39e5b07..515d3a0 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 _0x2bc7=['./plugin.events','save','remove','emit','removeListener','register','length','plugin:'];(function(_0x469fd4,_0x45a820){var _0x2d40fc=function(_0x21c30f){while(--_0x21c30f){_0x469fd4['push'](_0x469fd4['shift']());}};_0x2d40fc(++_0x45a820);}(_0x2bc7,0xd0));var _0x72bc=function(_0x3159b9,_0x39e388){_0x3159b9=_0x3159b9-0x0;var _0x5b9573=_0x2bc7[_0x3159b9];return _0x5b9573;};'use strict';var PluginEvents=require(_0x72bc('0x0'));var events=[_0x72bc('0x1'),_0x72bc('0x2'),'update'];function createListener(_0x3f896f,_0x554e89){return function(_0x21f93f){_0x554e89[_0x72bc('0x3')](_0x3f896f,_0x21f93f);};}function removeListener(_0x729184,_0x23126c){return function(){PluginEvents[_0x72bc('0x4')](_0x729184,_0x23126c);};}exports[_0x72bc('0x5')]=function(_0x5a9ba9){for(var _0x57ba2d=0x0,_0x56eed0=events[_0x72bc('0x6')];_0x57ba2d<_0x56eed0;_0x57ba2d++){var _0x4444c4=events[_0x57ba2d];var _0x2be493=createListener(_0x72bc('0x7')+_0x4444c4,_0x5a9ba9);PluginEvents['on'](_0x4444c4,_0x2be493);}}; \ No newline at end of file +var _0x87f6=['plugin:','save','remove','emit','removeListener','register','length'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x87f6,0x119));var _0x687f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x87f6[_0x3bf83f];return _0x22c4a9;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x687f('0x0'),_0x687f('0x1'),'update'];function createListener(_0x412edd,_0x40e460){return function(_0x28af1b){_0x40e460[_0x687f('0x2')](_0x412edd,_0x28af1b);};}function removeListener(_0x49ec27,_0x394b77){return function(){PluginEvents[_0x687f('0x3')](_0x49ec27,_0x394b77);};}exports[_0x687f('0x4')]=function(_0x314702){for(var _0x5cd710=0x0,_0xefc7a3=events[_0x687f('0x5')];_0x5cd710<_0xefc7a3;_0x5cd710++){var _0x1a1ea5=events[_0x5cd710];var _0x4f79f1=createListener(_0x687f('0x6')+_0x1a1ea5,_0x314702);PluginEvents['on'](_0x1a1ea5,_0x4f79f1);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index fb1889c..758e502 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(_0x2312ad,_0x247009){var _0x2fedfe=function(_0x28b8c4){while(--_0x28b8c4){_0x2312ad['push'](_0x2312ad['shift']());}};_0x2fedfe(++_0x247009);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x169c86,_0x438e8d){var _0x1d01c9=function(_0x1a5461){while(--_0x1a5461){_0x169c86['push'](_0x169c86['shift']());}};_0x1d01c9(++_0x438e8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 ecdd477..dbff34e 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 _0x41bb=['restart','stop','hasOwnProperty','Unknown\x20status','delete','dump','Unknown\x20id','lodash','../../config/pm2','api','child_process','exec','bluebird','sendStatus','json','error','stack','name','status','send','info','index','list','then','express','motion2','catch','show','describe','params','create','body','join','../../files/plugins','script','dirname','start','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x41bb,0xc5));var _0xb41b=function(_0x144c33,_0x4f7860){_0x144c33=_0x144c33-0x0;var _0x5e6f01=_0x41bb[_0x144c33];return _0x5e6f01;};'use strict';var _=require(_0xb41b('0x0'));var pm2=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var path=require('path');var exec=require(_0xb41b('0x3'))[_0xb41b('0x4')];var BPromise=require(_0xb41b('0x5'));function handleEntityNotFound(_0x448c8e,_0x4ee21b){return function(_0x12cea3){if(!_0x12cea3){_0x448c8e[_0xb41b('0x6')](0x194);;}return _0x12cea3;};}function respondWithResult(_0x2dbaa3,_0x50bc62){_0x50bc62=_0x50bc62||0xc8;return function(_0x5455ce){if(_0x5455ce){return _0x2dbaa3['status'](_0x50bc62)[_0xb41b('0x7')](_0x5455ce);}return null;};}function handleError(_0x29c30d,_0x53722a){_0x53722a=_0x53722a||0x1f4;return function(_0x13d44e){logger[_0xb41b('0x8')](_0x13d44e[_0xb41b('0x9')]);if(_0x13d44e[_0xb41b('0xa')]){delete _0x13d44e[_0xb41b('0xa')];}_0x29c30d[_0xb41b('0xb')](_0x53722a)[_0xb41b('0xc')](_0x13d44e);};}function execChildProcess(){return new BPromise(function(_0x4baa03,_0x1a9e2c){exec('npm\x20install',function(_0x2e906c,_0xb02d60,_0x1e1c82){logger[_0xb41b('0xd')](_0xb02d60);logger[_0xb41b('0xd')](_0x1e1c82);if(_0x2e906c){logger['error'](_0x2e906c);return _0x1a9e2c(_0x2e906c);}return _0x4baa03(_0xb02d60);});});}exports[_0xb41b('0xe')]=function(_0x2d947a,_0x33d1b5){return pm2[_0xb41b('0xf')]()[_0xb41b('0x10')](function(_0x4e8603){if(_0x4e8603){var _0x4e7f11=_['reject'](_0x4e8603,function(_0x1a09ec){return _0x1a09ec[_0xb41b('0xa')]===_0xb41b('0x11')||_0x1a09ec[_0xb41b('0xa')]===_0xb41b('0x12');});return{'rows':_0x4e7f11,'count':_0x4e7f11['length']};}return null;})[_0xb41b('0x10')](respondWithResult(_0x33d1b5,null))[_0xb41b('0x13')](handleError(_0x33d1b5,null));};exports[_0xb41b('0x14')]=function(_0xcf0728,_0x43f4ea){return pm2[_0xb41b('0x15')](_0xcf0728[_0xb41b('0x16')]['id'])['then'](respondWithResult(_0x43f4ea,null))['then'](handleEntityNotFound(_0x43f4ea,null))['catch'](handleError(_0x43f4ea,null));};exports[_0xb41b('0x17')]=function(_0x503e86,_0x307633){if(_0x503e86[_0xb41b('0x18')][_0xb41b('0xa')]&&_0x503e86['body']['script']){var _0x1a1386=path[_0xb41b('0x19')](__dirname,_0xb41b('0x1a'),_0x503e86[_0xb41b('0x18')][_0xb41b('0x1b')]);var _0x42dccb=process['cwd']();process['chdir'](path[_0xb41b('0x1c')](_0x1a1386));return execChildProcess()[_0xb41b('0x10')](function(_0x871b35){process['chdir'](_0x42dccb);return pm2[_0xb41b('0x1d')]({'name':_0x503e86[_0xb41b('0x18')]['name'],'script':_0x1a1386});})[_0xb41b('0x10')](function(_0x34f908){pm2['dump']();return _0x34f908[0x0];})[_0xb41b('0x10')](respondWithResult(_0x307633,0xc9))['catch'](handleError(_0x307633,null));}else{return _0x307633[_0xb41b('0xb')](0x1f4)[_0xb41b('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xb41b('0x1e')]=function(_0x4265b8,_0x583099){if(_0x4265b8['body']['id']){delete _0x4265b8[_0xb41b('0x18')]['id'];}var _0x46aecf={'online':_0xb41b('0x1f'),'stopped':_0xb41b('0x20')};if(_0x46aecf[_0xb41b('0x21')](_0x4265b8[_0xb41b('0x18')][_0xb41b('0xb')])){return pm2[_0x46aecf[_0x4265b8['body'][_0xb41b('0xb')]]](_0x4265b8[_0xb41b('0x16')]['id'])['then'](respondWithResult(_0x583099,0xc8))[_0xb41b('0x13')](handleError(_0x583099,null));}else{return _0x583099['status'](0x1f4)[_0xb41b('0xc')]({'message':_0xb41b('0x22')});}};exports['destroy']=function(_0x23a6ed,_0x4a95e7){if(_0x23a6ed[_0xb41b('0x18')]['id']){delete _0x23a6ed[_0xb41b('0x18')]['id'];}if(_0x23a6ed['params']['id']){return pm2[_0xb41b('0x23')](_0x23a6ed[_0xb41b('0x16')]['id'])[_0xb41b('0x10')](function(_0x4503cf){pm2[_0xb41b('0x24')]();return _0x4503cf[0x0];})[_0xb41b('0x10')](respondWithResult(_0x4a95e7,null))[_0xb41b('0x13')](handleError(_0x4a95e7,null));}else{return _0x4a95e7[_0xb41b('0xb')](0x1f4)[_0xb41b('0xc')]({'message':_0xb41b('0x25')});}}; \ No newline at end of file +var _0x3667=['lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','create','body','join','script','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','params','destroy','delete'];(function(_0x1063f0,_0x53980d){var _0x4698ce=function(_0x21d966){while(--_0x21d966){_0x1063f0['push'](_0x1063f0['shift']());}};_0x4698ce(++_0x53980d);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var pm2=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var path=require(_0x7366('0x4'));var exec=require('child_process')[_0x7366('0x5')];var BPromise=require(_0x7366('0x6'));function handleEntityNotFound(_0x4b32a7,_0x27726b){return function(_0x22bfc0){if(!_0x22bfc0){_0x4b32a7[_0x7366('0x7')](0x194);;}return _0x22bfc0;};}function respondWithResult(_0x1c0cf4,_0x101e3d){_0x101e3d=_0x101e3d||0xc8;return function(_0x589397){if(_0x589397){return _0x1c0cf4[_0x7366('0x8')](_0x101e3d)[_0x7366('0x9')](_0x589397);}return null;};}function handleError(_0x2dd32b,_0x26e9a9){_0x26e9a9=_0x26e9a9||0x1f4;return function(_0x171fe2){logger[_0x7366('0xa')](_0x171fe2[_0x7366('0xb')]);if(_0x171fe2[_0x7366('0xc')]){delete _0x171fe2[_0x7366('0xc')];}_0x2dd32b[_0x7366('0x8')](_0x26e9a9)[_0x7366('0xd')](_0x171fe2);};}function execChildProcess(){return new BPromise(function(_0x2d7e38,_0x57ea7f){exec(_0x7366('0xe'),function(_0x2694fc,_0xbcd488,_0x4718db){logger[_0x7366('0xf')](_0xbcd488);logger[_0x7366('0xf')](_0x4718db);if(_0x2694fc){logger[_0x7366('0xa')](_0x2694fc);return _0x57ea7f(_0x2694fc);}return _0x2d7e38(_0xbcd488);});});}exports[_0x7366('0x10')]=function(_0x37e47e,_0x1813b7){return pm2[_0x7366('0x11')]()[_0x7366('0x12')](function(_0x27500c){if(_0x27500c){var _0x22562f=_[_0x7366('0x13')](_0x27500c,function(_0x4dd111){return _0x4dd111[_0x7366('0xc')]===_0x7366('0x14')||_0x4dd111[_0x7366('0xc')]===_0x7366('0x15');});return{'rows':_0x22562f,'count':_0x22562f[_0x7366('0x16')]};}return null;})[_0x7366('0x12')](respondWithResult(_0x1813b7,null))[_0x7366('0x17')](handleError(_0x1813b7,null));};exports[_0x7366('0x18')]=function(_0x83e5d5,_0x41113f){return pm2[_0x7366('0x19')](_0x83e5d5['params']['id'])[_0x7366('0x12')](respondWithResult(_0x41113f,null))['then'](handleEntityNotFound(_0x41113f,null))[_0x7366('0x17')](handleError(_0x41113f,null));};exports[_0x7366('0x1a')]=function(_0x3f23cd,_0x52b43e){if(_0x3f23cd[_0x7366('0x1b')][_0x7366('0xc')]&&_0x3f23cd[_0x7366('0x1b')]['script']){var _0x16e038=path[_0x7366('0x1c')](__dirname,'../../files/plugins',_0x3f23cd[_0x7366('0x1b')][_0x7366('0x1d')]);var _0xaab659=process[_0x7366('0x1e')]();process[_0x7366('0x1f')](path[_0x7366('0x20')](_0x16e038));return execChildProcess()[_0x7366('0x12')](function(_0x22ed7e){process[_0x7366('0x1f')](_0xaab659);return pm2[_0x7366('0x21')]({'name':_0x3f23cd[_0x7366('0x1b')][_0x7366('0xc')],'script':_0x16e038});})[_0x7366('0x12')](function(_0x563b22){pm2[_0x7366('0x22')]();return _0x563b22[0x0];})['then'](respondWithResult(_0x52b43e,0xc9))[_0x7366('0x17')](handleError(_0x52b43e,null));}else{return _0x52b43e['status'](0x1f4)['send']({'message':_0x7366('0x23')});}};exports['update']=function(_0x254374,_0x4ac138){if(_0x254374[_0x7366('0x1b')]['id']){delete _0x254374[_0x7366('0x1b')]['id'];}var _0x5c37e2={'online':_0x7366('0x24'),'stopped':'stop'};if(_0x5c37e2[_0x7366('0x25')](_0x254374[_0x7366('0x1b')]['status'])){return pm2[_0x5c37e2[_0x254374[_0x7366('0x1b')]['status']]](_0x254374[_0x7366('0x26')]['id'])[_0x7366('0x12')](respondWithResult(_0x4ac138,0xc8))[_0x7366('0x17')](handleError(_0x4ac138,null));}else{return _0x4ac138[_0x7366('0x8')](0x1f4)[_0x7366('0xd')]({'message':'Unknown\x20status'});}};exports[_0x7366('0x27')]=function(_0x447807,_0x538d42){if(_0x447807['body']['id']){delete _0x447807['body']['id'];}if(_0x447807['params']['id']){return pm2[_0x7366('0x28')](_0x447807[_0x7366('0x26')]['id'])[_0x7366('0x12')](function(_0x15286a){pm2['dump']();return _0x15286a[0x0];})[_0x7366('0x12')](respondWithResult(_0x538d42,null))[_0x7366('0x17')](handleError(_0x538d42,null));}else{return _0x538d42[_0x7366('0x8')](0x1f4)[_0x7366('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index b6169b3..292e800 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 _0x1b0a=['exports','Router','../../components/auth/service','get','isAuthenticated','getAgents','getQueues'];(function(_0x213f84,_0x188052){var _0x28d5ee=function(_0x33b4e1){while(--_0x33b4e1){_0x213f84['push'](_0x213f84['shift']());}};_0x28d5ee(++_0x188052);}(_0x1b0a,0x1e4));var _0xa1b0=function(_0x1576ed,_0xfd8bab){_0x1576ed=_0x1576ed-0x0;var _0x4e5b48=_0x1b0a[_0x1576ed];return _0x4e5b48;};'use strict';var express=require('express');var router=express[_0xa1b0('0x0')]();var auth=require(_0xa1b0('0x1'));var controller=require('./realtime.controller');router[_0xa1b0('0x2')]('/agents',auth[_0xa1b0('0x3')](),controller[_0xa1b0('0x4')]);router[_0xa1b0('0x2')]('/queues',auth[_0xa1b0('0x3')](),controller[_0xa1b0('0x5')]);module[_0xa1b0('0x6')]=router; \ No newline at end of file +var _0xaa03=['../../components/auth/service','./realtime.controller','/agents','isAuthenticated','getAgents','/queues','exports','Router'];(function(_0x5d4543,_0x47ee68){var _0x3f3e08=function(_0x133268){while(--_0x133268){_0x5d4543['push'](_0x5d4543['shift']());}};_0x3f3e08(++_0x47ee68);}(_0xaa03,0x16f));var _0x3aa0=function(_0x43f75e,_0x2ebc56){_0x43f75e=_0x43f75e-0x0;var _0x5aee33=_0xaa03[_0x43f75e];return _0x5aee33;};'use strict';var express=require('express');var router=express[_0x3aa0('0x0')]();var auth=require(_0x3aa0('0x1'));var controller=require(_0x3aa0('0x2'));router['get'](_0x3aa0('0x3'),auth[_0x3aa0('0x4')](),controller[_0x3aa0('0x5')]);router['get'](_0x3aa0('0x6'),auth[_0x3aa0('0x4')](),controller['getQueues']);module[_0x3aa0('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 4715527..f624c36 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 _0x9c49=['mailStatus','openchannelStatus','smsStatus','whatsappStatus','unknown','getAgents','lastLoginAt','lastPauseAt','pauseType','internal','address','mailPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','query','sort','resolve','fieldName','type','role','agent','raw','user','userProfileId','UserProfile','getResources','findAndCountAll','rows','includes','globalStatus','desc','orderBy','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','whatsapp','channel','toLowerCase','rawAttributes','key','getOptions','QueueCampaigns','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','client','http','undefined','limit','count','offset','status','set','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','startCase','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','waiting','talking','paused','voice','outbound','push','originated','message','dialMethod','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','available','busy','pTalking','find','pick','filter','queue','length','connectedlinenum','toString','getMembers','UserId','online','voiceStatus','agents','User','Queue','Pause','findAll','loggedInDb','idle','ringing','isNil','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','every','voicePause','pause','faxStatus'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9c49,0xd2));var _0x99c4=function(_0xab39c2,_0x5d13f7){_0xab39c2=_0xab39c2-0x0;var _0x4ca79e=_0x9c49[_0xab39c2];return _0x4ca79e;};'use strict';var util=require(_0x99c4('0x0'));var _=require(_0x99c4('0x1'));var jayson=require(_0x99c4('0x2'));var qs=require(_0x99c4('0x3'));var logger=require(_0x99c4('0x4'))('api');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x99c4('0x5')][_0x99c4('0x6')]({'port':0x232a});var routingClient=jayson[_0x99c4('0x5')][_0x99c4('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x4f077f,_0x2be37e){return function(_0x3fa326){if(_0x3fa326){var _0x319426=typeof _0x2be37e['offset']===_0x99c4('0x7')&&typeof _0x2be37e[_0x99c4('0x8')]===_0x99c4('0x7');var _0x359783=_0x3fa326[_0x99c4('0x9')];var _0x2bae44=_0x319426?0x0:_0x2be37e[_0x99c4('0xa')];var _0xabd508=_0x319426?_0x3fa326[_0x99c4('0x9')]:_0x2be37e[_0x99c4('0xa')]+_0x2be37e[_0x99c4('0x8')];var _0x4c6e70;if(_0xabd508>=_0x359783){_0xabd508=_0x359783;_0x4c6e70=0xc8;}else{_0x4c6e70=0xce;}_0x4f077f[_0x99c4('0xb')](_0x4c6e70);return _0x4f077f[_0x99c4('0xc')](_0x99c4('0xd'),_0x2bae44+'-'+_0xabd508+'/'+_0x359783)[_0x99c4('0xe')](_0x3fa326);}return null;};}function handleError(_0x51cb1e,_0x2cccbf){_0x2cccbf=_0x2cccbf||0x1f4;return function(_0x1eaf64){logger[_0x99c4('0xf')](_0x1eaf64[_0x99c4('0x10')]);if(_0x1eaf64['name']){delete _0x1eaf64[_0x99c4('0x11')];}_0x51cb1e[_0x99c4('0xb')](_0x2cccbf)[_0x99c4('0x12')](_0x1eaf64);};}function getRealtimeAgents(){return new Promise(function(_0x48dc4d,_0x27c385){return amiClient[_0x99c4('0x13')](_0x99c4('0x14'),{})[_0x99c4('0x15')](function(_0x2f5764){if(_0x2f5764[_0x99c4('0xf')])throw new Error(_0x99c4('0x16'));var _0x4b28b4=_0x2f5764['result'];return routingClient['request'](_0x99c4('0x14'),{})['then'](function(_0x218c6c){if(_0x218c6c[_0x99c4('0xf')])throw new Error(_0x99c4('0x17'));var _0x4bdcd6=_0x218c6c[_0x99c4('0x18')];return _0x48dc4d(_[_0x99c4('0x19')]({},_0x4b28b4,_0x4bdcd6));});})[_0x99c4('0x1a')](function(_0x310a44){_0x27c385(_0x310a44);});});}function getRealtimeQueues(_0x5d28b9,_0xe80748){return new Promise(function(_0x435645,_0x3aee87){var _0x4316e7=_0xe80748==='voice'?amiClient:routingClient;return _0x4316e7[_0x99c4('0x13')](_[_0x99c4('0x1b')](_0xe80748)+'Queues',_0x5d28b9)[_0x99c4('0x15')](function(_0x478690){if(_0x478690[_0x99c4('0xf')])throw new Error(util[_0x99c4('0x1c')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xe80748));return _0x435645(_0x478690[_0x99c4('0x18')]);})['catch'](function(_0x21cbf9){_0x3aee87(_0x21cbf9);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4daadb,_0x5e2b2d){return amiClient['request'](_0x99c4('0x1d'),{})[_0x99c4('0x15')](function(_0x2871e2){if(_0x2871e2[_0x99c4('0xf')])throw new Error(_0x99c4('0x1e'));return _0x4daadb(_0x2871e2['result']);})[_0x99c4('0x1a')](function(_0x3109d9){_0x5e2b2d(_0x3109d9);});});}function initializeQueues(_0x2aa02f,_0x4e56ed,_0x47ee60,_0x3a5378){var _0x1b2108=[_0x99c4('0x1f'),'available',_0x99c4('0x20'),_0x99c4('0x21'),_0x99c4('0x22')];if(_0x47ee60===_0x99c4('0x23')&&_0x3a5378===_0x99c4('0x24')){_0x1b2108[_0x99c4('0x25')]('pTalking',_0x99c4('0x26'),_0x99c4('0x27'),'dialActive',_0x99c4('0x28'),'Trunk',_0x99c4('0x29'),_0x99c4('0x2a'),'erlangCalls',_0x99c4('0x2b'),_0x99c4('0x2c'),'erlangBusyFactor',_0x99c4('0x2d'),_0x99c4('0x2e'),_0x99c4('0x2f'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x99c4('0x30'),_0x99c4('0x31'),_0x99c4('0x32'),_0x99c4('0x33'),'predictiveIntervalAvgTalktime');}return _0x2aa02f[_0x99c4('0x34')](function(_0x50c5bd){var _0x1dee1e=_0x50c5bd[_0x99c4('0x35')]({'plain':!![]});_0x1dee1e['agents']=[];_0x1dee1e[_0x99c4('0x22')]=0x0;_0x1dee1e['loggedInDb']=0x0;_0x1dee1e['loggedIn']=0x0;_0x1dee1e[_0x99c4('0x36')]=0x0;_0x1dee1e['waiting']=0x0;if(_0x47ee60===_0x99c4('0x23')){_0x1dee1e[_0x99c4('0x21')]=0x0;_0x1dee1e[_0x99c4('0x37')]=0x0;if(_0x3a5378===_0x99c4('0x24')){_0x1dee1e[_0x99c4('0x38')]=0x0;_0x1dee1e[_0x99c4('0x26')]=0x0;}}var _0x48fff7=_[_0x99c4('0x39')](_0x4e56ed,['id',_0x1dee1e['id']]);if(_0x48fff7)_[_0x99c4('0x19')](_0x1dee1e,_[_0x99c4('0x3a')](_0x48fff7,_0x1b2108));return _0x1dee1e;});}function updateAgentVoiceStatus(_0x4822a8,_0x1f2769,_0x4e7b4e){var _0x2a639e=_[_0x99c4('0x3b')](_0x4e7b4e,[_0x99c4('0x3c'),_0x1f2769['name']]);if(_0x2a639e[_0x99c4('0x3d')]===0x0)return _0x4822a8[_0x99c4('0x37')]=!![];if(_['some'](_0x2a639e,[_0x99c4('0x3e'),_0x4822a8['internal'][_0x99c4('0x3f')]()]))return _0x4822a8[_0x99c4('0x21')]=!![];if(!_0x4822a8[_0x99c4('0x21')])return _0x4822a8['busy']=!![];}function getVoiceQueueAgents(_0x3c499c,_0x4a4a21,_0x6c0fb5,_0x1edf5e){var _0x483d76=_['find'](_0x4a4a21,['id',_0x3c499c['id']]);if(!_0x483d76)return _0x3c499c;return _0x483d76[_0x99c4('0x40')]({'raw':!![]})[_0x99c4('0x15')](function(_0x23deea){for(var _0x214c4b=0x0;_0x214c4b<_0x23deea['length'];_0x214c4b++){var _0x10f2d9=_[_0x99c4('0x39')](_0x6c0fb5,['id',_0x23deea[_0x214c4b][_0x99c4('0x41')]]);if(!_0x10f2d9){_0x10f2d9={'id':_0x23deea[_0x214c4b][_0x99c4('0x41')],'name':_0x23deea[_0x214c4b][_0x99c4('0x41')],'accountcode':'','online':![]};}var _0x19ebd6={'id':_0x10f2d9['id'],'name':_0x10f2d9[_0x99c4('0x11')],'internal':_0x10f2d9['accountcode'],'online':Boolean(_0x10f2d9[_0x99c4('0x42')]),'paused':Boolean(_0x23deea[_0x214c4b][_0x99c4('0x22')])};if(_0x10f2d9[_0x99c4('0x43')]==='talking')updateAgentVoiceStatus(_0x19ebd6,_0x3c499c,_0x1edf5e);if(_0x19ebd6[_0x99c4('0x42')])_0x3c499c['loggedInDb']++;if(_0x19ebd6[_0x99c4('0x37')])_0x3c499c[_0x99c4('0x37')]++;if(_0x19ebd6['paused']&&!_0x19ebd6[_0x99c4('0x37')]&&!_0x19ebd6['talking'])_0x3c499c[_0x99c4('0x22')]++;_0x3c499c[_0x99c4('0x44')]['push'](_0x19ebd6);}return _0x3c499c;});}function getQueueAgents(_0xbf7fb3,_0x515d4d,_0x987291){var _0x2fde35=_0x99c4('0x45')+_[_0x99c4('0x1b')](_0x987291)+_0x99c4('0x46');var _0x1d464e=_0x987291+_0x99c4('0x47');return db[_0x2fde35][_0x99c4('0x48')]({'where':{[_[_0x99c4('0x1b')](_0x987291)+'QueueId']:_0xbf7fb3['id']},'raw':!![]})[_0x99c4('0x15')](function(_0x678c50){for(var _0x133a31=0x0;_0x133a31<_0x678c50['length'];_0x133a31++){var _0x1b6fe4=_['find'](_0x515d4d,['id',_0x678c50[_0x133a31]['UserId']]);if(!_0x1b6fe4){_0x1b6fe4={'id':_0x678c50[_0x133a31]['UserId'],'name':_0x678c50[_0x133a31][_0x99c4('0x41')],'online':![],['pauseField']:![]};}var _0x46b30e={'id':_0x1b6fe4['id'],'name':_0x1b6fe4[_0x99c4('0x11')],'online':Boolean(_0x1b6fe4[_0x99c4('0x42')]),'paused':Boolean(_0x1b6fe4[_0x1d464e])};if(_0x46b30e['online'])_0xbf7fb3[_0x99c4('0x49')]++;_0xbf7fb3[_0x99c4('0x44')][_0x99c4('0x25')](_0x46b30e);}return _0xbf7fb3;});}function isIdle(_0x1ae914){return _0x1ae914===_0x99c4('0x4a')||_0x1ae914==='unknown'||_0x1ae914==='unavailable'||_0x1ae914===_0x99c4('0x4b')||_[_0x99c4('0x4c')](_0x1ae914);}function isAgentPaused(_0x306077,_0x4db12a){var _0x416a1f=[_0x306077[_0x99c4('0x4d')],_0x306077[_0x99c4('0x4e')],_0x306077['mailPause'],_0x306077[_0x99c4('0x4f')],_0x306077[_0x99c4('0x50')],_0x306077['voicePause'],_0x306077[_0x99c4('0x51')]];if(!_0x4db12a)return _[_0x99c4('0x52')](_0x416a1f);var _0x3d5a4f=_[_0x99c4('0x3b')](_0x416a1f);return _0x3d5a4f[_0x99c4('0x3d')]>0x0&&_0x3d5a4f[_0x99c4('0x3d')]<_0x416a1f[_0x99c4('0x3d')]?!![]:![];}function isAgentIdle(_0xab832f){if(_0xab832f['voiceStatus']!==_0x99c4('0x4a')&&_0xab832f[_0x99c4('0x53')]){_0xab832f[_0x99c4('0x43')]=_0x99c4('0x54');return![];}return _[_0x99c4('0x52')]([_0xab832f['chatStatus'],_0xab832f[_0x99c4('0x55')],_0xab832f[_0x99c4('0x56')],_0xab832f[_0x99c4('0x57')],_0xab832f[_0x99c4('0x58')],_0xab832f[_0x99c4('0x43')],_0xab832f[_0x99c4('0x59')]],isIdle);}function getAgentStatus(_0x570a74){var _0x19e255=_0x99c4('0x5a');if(isAgentPaused(_0x570a74))_0x19e255=_0x99c4('0x54');else if(isAgentPaused(_0x570a74,!![]))_0x19e255='*pause';else if(isAgentIdle(_0x570a74))_0x19e255=_0x99c4('0x4a');else _0x19e255=_0x99c4('0x37');return _0x19e255;}exports[_0x99c4('0x5b')]=function(_0x9869ea,_0x5656bc){var _0x250bff='';var _0x19b686={'count':0x0,'rows':[]},_0x37b12e={},_0x1b60c7,_0x5b6a22,_0x3d77a9=['userpic',_0x99c4('0x42'),_0x99c4('0x5c'),_0x99c4('0x5d'),_0x99c4('0x5e'),_0x99c4('0x5d'),_0x99c4('0x5f'),_0x99c4('0x60'),_0x99c4('0x4d'),'openchannelPause',_0x99c4('0x61'),_0x99c4('0x50'),_0x99c4('0x51'),_0x99c4('0x4e'),'voicePause',_0x99c4('0x62'),_0x99c4('0x63'),_0x99c4('0x64'),_0x99c4('0x65'),'whatsappCapacity',_0x99c4('0x66'),_0x99c4('0x67'),_0x99c4('0x68'),_0x99c4('0x69'),_0x99c4('0x6a'),_0x99c4('0x6b'),_0x99c4('0x6c'),'chatStatus',_0x99c4('0x57'),_0x99c4('0x56'),_0x99c4('0x58'),_0x99c4('0x59'),_0x99c4('0x55'),_0x99c4('0x43'),'chatStatusTime',_0x99c4('0x6d'),_0x99c4('0x6e'),'smsStatusTime','whatsappStatusTime',_0x99c4('0x6f'),_0x99c4('0x70'),_0x99c4('0x3c'),_0x99c4('0x71'),_0x99c4('0x72'),_0x99c4('0x73'),'phoneBarEnableAutomaticScreenRecording','routealias'],_0x10bf84=[_0x99c4('0x4d'),_0x99c4('0x4f'),_0x99c4('0x61'),_0x99c4('0x50'),_0x99c4('0x51'),'faxPause',_0x99c4('0x53'),_0x99c4('0x42')];if(_0x9869ea[_0x99c4('0x74')][_0x99c4('0x75')]&&_0x9869ea[_0x99c4('0x74')][_0x99c4('0x75')]['includes']('globalStatus')){_0x250bff=_0x9869ea[_0x99c4('0x74')][_0x99c4('0x75')];_0x9869ea[_0x99c4('0x74')]['sort']='';}Promise[_0x99c4('0x76')]()[_0x99c4('0x15')](function(){var _0x1fa74e=_[_0x99c4('0x34')](db[_0x99c4('0x45')]['rawAttributes'],function(_0x282cee){return{'name':_0x282cee[_0x99c4('0x77')],'type':_0x282cee[_0x99c4('0x78')]['key']};});_0x9869ea[_0x99c4('0x74')][_0x99c4('0x79')]=_0x99c4('0x7a');_0x9869ea[_0x99c4('0x74')][_0x99c4('0x42')]=!![];_0x37b12e=qs['getOptions'](_0x1fa74e,_0x9869ea);_0x37b12e[_0x99c4('0x7b')]=!![];if(_0x9869ea[_0x99c4('0x7c')][_0x99c4('0x79')]===_0x99c4('0x7c')){var _0x534066={'params':{'id':_0x9869ea['user'][_0x99c4('0x7d')]},'query':{'section':_0x99c4('0x14'),'role':_0x99c4('0x7a'),'online':!![],'nolimit':_0x9869ea[_0x99c4('0x74')]['nolimit'],'sort':_0x9869ea[_0x99c4('0x74')][_0x99c4('0x75')],'filter':_0x9869ea[_0x99c4('0x74')][_0x99c4('0x3b')],'raw':!![]}};return db[_0x99c4('0x7e')][_0x99c4('0x7f')](_0x534066);}return db[_0x99c4('0x45')][_0x99c4('0x80')](_0x37b12e);})['then'](function(_0x28ce28){_0x19b686[_0x99c4('0x9')]=_0x28ce28['count'];_0x1b60c7=_0x28ce28[_0x99c4('0x81')];return getRealtimeAgents();})[_0x99c4('0x15')](function(_0x14ccc1){_0x5b6a22=_0x14ccc1[_0x99c4('0x81')];return _0x1b60c7[_0x99c4('0x34')](function(_0x5919f5){var _0x50a059=_[_0x99c4('0x39')](_0x5b6a22,['id',_0x5919f5['id']]);if(_0x50a059)_['merge'](_0x5919f5,_[_0x99c4('0x3a')](_['omit'](_0x50a059,_0x10bf84),_0x3d77a9));_0x5919f5['globalStatus']=getAgentStatus(_0x5919f5);return _0x5919f5;});})['then'](function(_0x2ce39a){if(_0x250bff[_0x99c4('0x82')](_0x99c4('0x83'))){var _0x1dca8e;if(_0x250bff[_0x99c4('0x82')]('-'))_0x1dca8e=_['orderBy'](_0x2ce39a,_0x99c4('0x83'),_0x99c4('0x84'));else _0x1dca8e=_[_0x99c4('0x85')](_0x2ce39a,'globalStatus','asc');return _0x1dca8e;}return _0x2ce39a;})['then'](function(_0x97bbcc){if(_0x9869ea[_0x99c4('0x74')][_0x99c4('0x86')]){var _0x4b7f7c=_[_0x99c4('0x3b')](_0x97bbcc,['globalStatus',_0x9869ea[_0x99c4('0x74')]['globalStatusFilter']]);if(_0x9869ea['query'][_0x99c4('0x87')]){_0x4b7f7c=_[_0x99c4('0x3b')](_0x4b7f7c,['pauseType',_0x9869ea[_0x99c4('0x74')][_0x99c4('0x87')]]);}}_0x19b686[_0x99c4('0x81')]=_0x4b7f7c||_0x97bbcc;return _0x19b686;})[_0x99c4('0x15')](respondWithFilteredResult(_0x5656bc,_0x37b12e))[_0x99c4('0x1a')](handleError(_0x5656bc,null));};exports[_0x99c4('0x88')]=function(_0x4ba267,_0x49615b){var _0x34666a=[_0x99c4('0x89'),_0x99c4('0x8a'),_0x99c4('0x8b'),_0x99c4('0x8c'),'fax',_0x99c4('0x8d'),_0x99c4('0x23')];var _0x47c4c9={'count':0x0,'rows':[]},_0x54374a={},_0x5da962,_0x5ca256,_0x385dd1,_0x4c4161,_0x11d130;Promise['resolve']()[_0x99c4('0x15')](function(){if(_0x4ba267['query'][_0x99c4('0x8e')]){if(!_['includes'](_0x34666a,_0x4ba267[_0x99c4('0x74')][_0x99c4('0x8e')][_0x99c4('0x8f')]()))throw new Error('Invalid\x20channel');_0x5da962=_0x4ba267[_0x99c4('0x74')][_0x99c4('0x8e')][_0x99c4('0x8f')]();}var _0x2f133f=_['startCase'](_0x5da962)+_0x99c4('0x46');var _0x2b0b2b=_['map'](db[_0x2f133f][_0x99c4('0x90')],function(_0x376f46){return{'name':_0x376f46['fieldName'],'type':_0x376f46['type'][_0x99c4('0x91')]};});_0x54374a=qs[_0x99c4('0x92')](_0x2b0b2b,_0x4ba267);if(_0x4ba267['user'][_0x99c4('0x79')]===_0x99c4('0x7c')){var _0xfe524b={'params':{'id':_0x4ba267[_0x99c4('0x7c')]['userProfileId']},'query':{'section':_0x5da962===_0x99c4('0x23')&&_0x4ba267[_0x99c4('0x74')][_0x99c4('0x78')]===_0x99c4('0x24')?_0x99c4('0x93'):_[_0x99c4('0x1b')](_0x5da962)+'Queues','type':_0x4ba267[_0x99c4('0x74')][_0x99c4('0x78')],'nolimit':!![],'sort':_0x99c4('0x11'),'filter':_0x4ba267[_0x99c4('0x74')][_0x99c4('0x3b')]}};return db[_0x99c4('0x7e')][_0x99c4('0x7f')](_0xfe524b);}return db[_0x2f133f][_0x99c4('0x80')](_0x54374a);})[_0x99c4('0x15')](function(_0x2acb58){_0x47c4c9['count']=_0x2acb58['count'];_0x5ca256=_0x2acb58[_0x99c4('0x81')];return getRealtimeQueues(_0x4ba267,_0x5da962);})[_0x99c4('0x15')](function(_0x4ebc89){_0x4c4161=_0x4ebc89[_0x99c4('0x81')];return getRealtimeAgents();})['then'](function(_0x2dcb57){_0x385dd1=_0x2dcb57['rows'];if(_0x5da962!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x99c4('0x15')](function(_0x4bf2e5){_0x11d130=_0x4bf2e5?_0x4bf2e5[_0x99c4('0x81')]:[];return initializeQueues(_0x5ca256,_0x4c4161,_0x5da962,_0x4ba267[_0x99c4('0x74')]['type']);})['then'](function(_0x41693f){var _0x1ef485=_0x41693f['map'](function(_0x56fe2d){if(_0x5da962===_0x99c4('0x23'))return getVoiceQueueAgents(_0x56fe2d,_0x5ca256,_0x385dd1,_0x11d130);else return getQueueAgents(_0x56fe2d,_0x385dd1,_0x5da962);});return Promise['all'](_0x1ef485);})[_0x99c4('0x15')](function(_0x5eca9f){_0x47c4c9[_0x99c4('0x81')]=_0x5eca9f;return _0x47c4c9;})[_0x99c4('0x15')](respondWithFilteredResult(_0x49615b,_0x54374a))[_0x99c4('0x1a')](handleError(_0x49615b,null));}; \ No newline at end of file +var _0x95eb=['faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','query','sort','resolve','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','user','nolimit','UserProfile','getResources','findAndCountAll','rows','globalStatus','includes','orderBy','asc','globalStatusFilter','pauseTypeFilter','getQueues','chat','sms','openchannel','fax','whatsapp','channel','toLowerCase','Invalid\x20channel','Queue','userProfileId','QueueCampaigns','all','util','lodash','jayson/promise','../../config/logger','api','client','offset','undefined','count','limit','status','Content-Range','json','error','stack','name','send','request','Agents','then','result','merge','catch','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','voice','outbound','originated','message','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','paused','loggedInDb','waiting','busy','pTalking','find','filter','queue','length','some','internal','toString','talking','getMembers','UserId','accountcode','online','push','Pause','findAll','QueueId','unknown','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','voiceStatus','idle','pause','every','chatStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','getAgents','pauseType','address','chatCapacity','openchannelCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatus'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x95eb,0x1ed));var _0xb95e=function(_0x1e7b3b,_0x356335){_0x1e7b3b=_0x1e7b3b-0x0;var _0x3be80a=_0x95eb[_0x1e7b3b];return _0x3be80a;};'use strict';var util=require(_0xb95e('0x0'));var _=require(_0xb95e('0x1'));var jayson=require(_0xb95e('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xb95e('0x3'))(_0xb95e('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xb95e('0x5')]['http']({'port':0x232a});var routingClient=jayson[_0xb95e('0x5')]['http']({'port':0x232c});function respondWithFilteredResult(_0x2bed1d,_0x166ef6){return function(_0x280f88){if(_0x280f88){var _0x42c34c=typeof _0x166ef6[_0xb95e('0x6')]===_0xb95e('0x7')&&typeof _0x166ef6['limit']==='undefined';var _0x427742=_0x280f88[_0xb95e('0x8')];var _0x3f6f4d=_0x42c34c?0x0:_0x166ef6[_0xb95e('0x6')];var _0x4245ca=_0x42c34c?_0x280f88[_0xb95e('0x8')]:_0x166ef6[_0xb95e('0x6')]+_0x166ef6[_0xb95e('0x9')];var _0x2e5d6f;if(_0x4245ca>=_0x427742){_0x4245ca=_0x427742;_0x2e5d6f=0xc8;}else{_0x2e5d6f=0xce;}_0x2bed1d[_0xb95e('0xa')](_0x2e5d6f);return _0x2bed1d['set'](_0xb95e('0xb'),_0x3f6f4d+'-'+_0x4245ca+'/'+_0x427742)[_0xb95e('0xc')](_0x280f88);}return null;};}function handleError(_0x435261,_0x2e6324){_0x2e6324=_0x2e6324||0x1f4;return function(_0x5a7789){logger[_0xb95e('0xd')](_0x5a7789[_0xb95e('0xe')]);if(_0x5a7789[_0xb95e('0xf')]){delete _0x5a7789[_0xb95e('0xf')];}_0x435261['status'](_0x2e6324)[_0xb95e('0x10')](_0x5a7789);};}function getRealtimeAgents(){return new Promise(function(_0x146145,_0x518258){return amiClient[_0xb95e('0x11')](_0xb95e('0x12'),{})[_0xb95e('0x13')](function(_0x15bd0a){if(_0x15bd0a['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x15d426=_0x15bd0a[_0xb95e('0x14')];return routingClient[_0xb95e('0x11')](_0xb95e('0x12'),{})[_0xb95e('0x13')](function(_0x4e9967){if(_0x4e9967[_0xb95e('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x12b87d=_0x4e9967[_0xb95e('0x14')];return _0x146145(_[_0xb95e('0x15')]({},_0x15d426,_0x12b87d));});})[_0xb95e('0x16')](function(_0x4fd900){_0x518258(_0x4fd900);});});}function getRealtimeQueues(_0x4c7b02,_0x2d0193){return new Promise(function(_0x3769d5,_0x5a0c62){var _0x56f9f7=_0x2d0193==='voice'?amiClient:routingClient;return _0x56f9f7[_0xb95e('0x11')](_[_0xb95e('0x17')](_0x2d0193)+_0xb95e('0x18'),_0x4c7b02)['then'](function(_0x2d2c4c){if(_0x2d2c4c[_0xb95e('0xd')])throw new Error(util[_0xb95e('0x19')](_0xb95e('0x1a'),_0x2d0193));return _0x3769d5(_0x2d2c4c[_0xb95e('0x14')]);})[_0xb95e('0x16')](function(_0x23c9ca){_0x5a0c62(_0x23c9ca);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x27c4f8,_0x26a0fb){return amiClient[_0xb95e('0x11')](_0xb95e('0x1b'),{})[_0xb95e('0x13')](function(_0x255fd1){if(_0x255fd1['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x27c4f8(_0x255fd1[_0xb95e('0x14')]);})[_0xb95e('0x16')](function(_0x4e316a){_0x26a0fb(_0x4e316a);});});}function initializeQueues(_0x1042ee,_0x2d8aeb,_0x5931c9,_0x5d1e41){var _0x4f75db=[_0xb95e('0x1c'),_0xb95e('0x1d'),'waiting','talking','paused'];if(_0x5931c9===_0xb95e('0x1e')&&_0x5d1e41===_0xb95e('0x1f')){_0x4f75db['push']('pTalking',_0xb95e('0x20'),_0xb95e('0x21'),'dialActive',_0xb95e('0x22'),'Trunk',_0xb95e('0x23'),_0xb95e('0x24'),_0xb95e('0x25'),_0xb95e('0x26'),'erlangAbandonmentRate',_0xb95e('0x27'),_0xb95e('0x28'),_0xb95e('0x29'),_0xb95e('0x2a'),_0xb95e('0x2b'),_0xb95e('0x2c'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0xb95e('0x2d'),'predictiveIntervalAvgHoldtime',_0xb95e('0x2e'));}return _0x1042ee[_0xb95e('0x2f')](function(_0x1b767d){var _0x4b79bc=_0x1b767d['get']({'plain':!![]});_0x4b79bc[_0xb95e('0x30')]=[];_0x4b79bc[_0xb95e('0x31')]=0x0;_0x4b79bc[_0xb95e('0x32')]=0x0;_0x4b79bc[_0xb95e('0x1c')]=0x0;_0x4b79bc['available']=0x0;_0x4b79bc[_0xb95e('0x33')]=0x0;if(_0x5931c9===_0xb95e('0x1e')){_0x4b79bc['talking']=0x0;_0x4b79bc[_0xb95e('0x34')]=0x0;if(_0x5d1e41===_0xb95e('0x1f')){_0x4b79bc[_0xb95e('0x35')]=0x0;_0x4b79bc['originated']=0x0;}}var _0x2dbb8a=_[_0xb95e('0x36')](_0x2d8aeb,['id',_0x4b79bc['id']]);if(_0x2dbb8a)_[_0xb95e('0x15')](_0x4b79bc,_['pick'](_0x2dbb8a,_0x4f75db));return _0x4b79bc;});}function updateAgentVoiceStatus(_0x438635,_0x4b2a2c,_0x26907c){var _0x30ef99=_[_0xb95e('0x37')](_0x26907c,[_0xb95e('0x38'),_0x4b2a2c[_0xb95e('0xf')]]);if(_0x30ef99[_0xb95e('0x39')]===0x0)return _0x438635[_0xb95e('0x34')]=!![];if(_[_0xb95e('0x3a')](_0x30ef99,['connectedlinenum',_0x438635[_0xb95e('0x3b')][_0xb95e('0x3c')]()]))return _0x438635[_0xb95e('0x3d')]=!![];if(!_0x438635[_0xb95e('0x3d')])return _0x438635[_0xb95e('0x34')]=!![];}function getVoiceQueueAgents(_0x804af7,_0x3907e2,_0x2b0dee,_0x32c123){var _0x596900=_[_0xb95e('0x36')](_0x3907e2,['id',_0x804af7['id']]);if(!_0x596900)return _0x804af7;return _0x596900[_0xb95e('0x3e')]({'raw':!![]})[_0xb95e('0x13')](function(_0x31f2d9){for(var _0x2fbc15=0x0;_0x2fbc15<_0x31f2d9[_0xb95e('0x39')];_0x2fbc15++){var _0x235080=_['find'](_0x2b0dee,['id',_0x31f2d9[_0x2fbc15][_0xb95e('0x3f')]]);if(!_0x235080){_0x235080={'id':_0x31f2d9[_0x2fbc15][_0xb95e('0x3f')],'name':_0x31f2d9[_0x2fbc15]['UserId'],'accountcode':'','online':![]};}var _0x476e1a={'id':_0x235080['id'],'name':_0x235080[_0xb95e('0xf')],'internal':_0x235080[_0xb95e('0x40')],'online':Boolean(_0x235080[_0xb95e('0x41')]),'paused':Boolean(_0x31f2d9[_0x2fbc15][_0xb95e('0x31')])};if(_0x235080['voiceStatus']===_0xb95e('0x3d'))updateAgentVoiceStatus(_0x476e1a,_0x804af7,_0x32c123);if(_0x476e1a[_0xb95e('0x41')])_0x804af7[_0xb95e('0x32')]++;if(_0x476e1a['busy'])_0x804af7['busy']++;if(_0x476e1a['paused']&&!_0x476e1a[_0xb95e('0x34')]&&!_0x476e1a[_0xb95e('0x3d')])_0x804af7[_0xb95e('0x31')]++;_0x804af7[_0xb95e('0x30')][_0xb95e('0x42')](_0x476e1a);}return _0x804af7;});}function getQueueAgents(_0x34b830,_0x52b8c3,_0x2d56a4){var _0x3cf836='User'+_[_0xb95e('0x17')](_0x2d56a4)+'Queue';var _0x40e807=_0x2d56a4+_0xb95e('0x43');return db[_0x3cf836][_0xb95e('0x44')]({'where':{[_[_0xb95e('0x17')](_0x2d56a4)+_0xb95e('0x45')]:_0x34b830['id']},'raw':!![]})[_0xb95e('0x13')](function(_0x1ec6c5){for(var _0x49077a=0x0;_0x49077a<_0x1ec6c5[_0xb95e('0x39')];_0x49077a++){var _0x3378ac=_[_0xb95e('0x36')](_0x52b8c3,['id',_0x1ec6c5[_0x49077a][_0xb95e('0x3f')]]);if(!_0x3378ac){_0x3378ac={'id':_0x1ec6c5[_0x49077a][_0xb95e('0x3f')],'name':_0x1ec6c5[_0x49077a]['UserId'],'online':![],['pauseField']:![]};}var _0x2d6eca={'id':_0x3378ac['id'],'name':_0x3378ac['name'],'online':Boolean(_0x3378ac[_0xb95e('0x41')]),'paused':Boolean(_0x3378ac[_0x40e807])};if(_0x2d6eca[_0xb95e('0x41')])_0x34b830[_0xb95e('0x32')]++;_0x34b830[_0xb95e('0x30')][_0xb95e('0x42')](_0x2d6eca);}return _0x34b830;});}function isIdle(_0x7701f2){return _0x7701f2==='idle'||_0x7701f2===_0xb95e('0x46')||_0x7701f2==='unavailable'||_0x7701f2===_0xb95e('0x47')||_[_0xb95e('0x48')](_0x7701f2);}function isAgentPaused(_0x886885,_0x357120){var _0x686bd=[_0x886885[_0xb95e('0x49')],_0x886885[_0xb95e('0x4a')],_0x886885[_0xb95e('0x4b')],_0x886885[_0xb95e('0x4c')],_0x886885[_0xb95e('0x4d')],_0x886885[_0xb95e('0x4e')],_0x886885[_0xb95e('0x4f')]];if(!_0x357120)return _['every'](_0x686bd);var _0x1f6a67=_[_0xb95e('0x37')](_0x686bd);return _0x1f6a67['length']>0x0&&_0x1f6a67[_0xb95e('0x39')]<_0x686bd[_0xb95e('0x39')]?!![]:![];}function isAgentIdle(_0x33a470){if(_0x33a470[_0xb95e('0x50')]!==_0xb95e('0x51')&&_0x33a470[_0xb95e('0x4e')]){_0x33a470[_0xb95e('0x50')]=_0xb95e('0x52');return![];}return _[_0xb95e('0x53')]([_0x33a470[_0xb95e('0x54')],_0x33a470['faxStatus'],_0x33a470['mailStatus'],_0x33a470[_0xb95e('0x55')],_0x33a470[_0xb95e('0x56')],_0x33a470[_0xb95e('0x50')],_0x33a470[_0xb95e('0x57')]],isIdle);}function getAgentStatus(_0x47c7c3){var _0x242c03='unknown';if(isAgentPaused(_0x47c7c3))_0x242c03='pause';else if(isAgentPaused(_0x47c7c3,!![]))_0x242c03=_0xb95e('0x58');else if(isAgentIdle(_0x47c7c3))_0x242c03='idle';else _0x242c03='busy';return _0x242c03;}exports[_0xb95e('0x59')]=function(_0x1184a1,_0x2e78c1){var _0x554eaf='';var _0x5b3380={'count':0x0,'rows':[]},_0x323c41={},_0x2759b3,_0x4ffa7c,_0x42d24b=['userpic',_0xb95e('0x41'),'lastLoginAt','lastPauseAt',_0xb95e('0x5a'),'lastPauseAt',_0xb95e('0x3b'),_0xb95e('0x5b'),_0xb95e('0x49'),_0xb95e('0x4c'),_0xb95e('0x4b'),_0xb95e('0x4d'),_0xb95e('0x4f'),_0xb95e('0x4a'),'voicePause',_0xb95e('0x5c'),_0xb95e('0x5d'),'mailCapacity','smsCapacity','whatsappCapacity','faxCapacity',_0xb95e('0x5e'),_0xb95e('0x5f'),'mailCurrentCapacity',_0xb95e('0x60'),_0xb95e('0x61'),'faxCurrentCapacity','chatStatus',_0xb95e('0x55'),_0xb95e('0x62'),'smsStatus','whatsappStatus',_0xb95e('0x63'),_0xb95e('0x50'),_0xb95e('0x64'),_0xb95e('0x65'),_0xb95e('0x66'),_0xb95e('0x67'),_0xb95e('0x68'),_0xb95e('0x69'),_0xb95e('0x6a'),_0xb95e('0x38'),_0xb95e('0x6b'),_0xb95e('0x6c'),_0xb95e('0x6d'),'phoneBarEnableAutomaticScreenRecording',_0xb95e('0x6e')],_0x478ea7=['chatPause',_0xb95e('0x4c'),_0xb95e('0x4b'),_0xb95e('0x4d'),_0xb95e('0x4f'),_0xb95e('0x4a'),_0xb95e('0x4e'),_0xb95e('0x41')];if(_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x70')]&&_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x70')]['includes']('globalStatus')){_0x554eaf=_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x70')];_0x1184a1[_0xb95e('0x6f')]['sort']='';}Promise[_0xb95e('0x71')]()['then'](function(){var _0x3acb62=_[_0xb95e('0x2f')](db[_0xb95e('0x72')][_0xb95e('0x73')],function(_0x3b568a){return{'name':_0x3b568a[_0xb95e('0x74')],'type':_0x3b568a[_0xb95e('0x75')][_0xb95e('0x76')]};});_0x1184a1['query'][_0xb95e('0x77')]=_0xb95e('0x78');_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x41')]=!![];_0x323c41=qs[_0xb95e('0x79')](_0x3acb62,_0x1184a1);_0x323c41[_0xb95e('0x7a')]=!![];if(_0x1184a1['user'][_0xb95e('0x77')]===_0xb95e('0x7b')){var _0x5cc7b2={'params':{'id':_0x1184a1['user']['userProfileId']},'query':{'section':_0xb95e('0x12'),'role':_0xb95e('0x78'),'online':!![],'nolimit':_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x7c')],'sort':_0x1184a1['query']['sort'],'filter':_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x37')],'raw':!![]}};return db[_0xb95e('0x7d')][_0xb95e('0x7e')](_0x5cc7b2);}return db['User'][_0xb95e('0x7f')](_0x323c41);})[_0xb95e('0x13')](function(_0xb5dd60){_0x5b3380[_0xb95e('0x8')]=_0xb5dd60['count'];_0x2759b3=_0xb5dd60[_0xb95e('0x80')];return getRealtimeAgents();})['then'](function(_0x1b7fe0){_0x4ffa7c=_0x1b7fe0['rows'];return _0x2759b3[_0xb95e('0x2f')](function(_0x85e07c){var _0x14e271=_['find'](_0x4ffa7c,['id',_0x85e07c['id']]);if(_0x14e271)_['merge'](_0x85e07c,_['pick'](_['omit'](_0x14e271,_0x478ea7),_0x42d24b));_0x85e07c[_0xb95e('0x81')]=getAgentStatus(_0x85e07c);return _0x85e07c;});})[_0xb95e('0x13')](function(_0x5adbd7){if(_0x554eaf[_0xb95e('0x82')]('globalStatus')){var _0x391578;if(_0x554eaf['includes']('-'))_0x391578=_[_0xb95e('0x83')](_0x5adbd7,'globalStatus','desc');else _0x391578=_[_0xb95e('0x83')](_0x5adbd7,_0xb95e('0x81'),_0xb95e('0x84'));return _0x391578;}return _0x5adbd7;})['then'](function(_0x304aa1){if(_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x85')]){var _0x1328ca=_[_0xb95e('0x37')](_0x304aa1,[_0xb95e('0x81'),_0x1184a1['query'][_0xb95e('0x85')]]);if(_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x86')]){_0x1328ca=_[_0xb95e('0x37')](_0x1328ca,[_0xb95e('0x5a'),_0x1184a1[_0xb95e('0x6f')][_0xb95e('0x86')]]);}}_0x5b3380[_0xb95e('0x80')]=_0x1328ca||_0x304aa1;return _0x5b3380;})[_0xb95e('0x13')](respondWithFilteredResult(_0x2e78c1,_0x323c41))[_0xb95e('0x16')](handleError(_0x2e78c1,null));};exports[_0xb95e('0x87')]=function(_0x55bab0,_0x3d4320){var _0x4cffaa=['mail',_0xb95e('0x88'),_0xb95e('0x89'),_0xb95e('0x8a'),_0xb95e('0x8b'),_0xb95e('0x8c'),_0xb95e('0x1e')];var _0x1a9a27={'count':0x0,'rows':[]},_0x176739={},_0x1cf558,_0xdd382a,_0xffe301,_0x2c547b,_0x134f9f;Promise[_0xb95e('0x71')]()[_0xb95e('0x13')](function(){if(_0x55bab0[_0xb95e('0x6f')][_0xb95e('0x8d')]){if(!_[_0xb95e('0x82')](_0x4cffaa,_0x55bab0[_0xb95e('0x6f')]['channel'][_0xb95e('0x8e')]()))throw new Error(_0xb95e('0x8f'));_0x1cf558=_0x55bab0[_0xb95e('0x6f')][_0xb95e('0x8d')]['toLowerCase']();}var _0x2de298=_[_0xb95e('0x17')](_0x1cf558)+_0xb95e('0x90');var _0x1da5a8=_[_0xb95e('0x2f')](db[_0x2de298][_0xb95e('0x73')],function(_0x4ddae6){return{'name':_0x4ddae6[_0xb95e('0x74')],'type':_0x4ddae6[_0xb95e('0x75')][_0xb95e('0x76')]};});_0x176739=qs[_0xb95e('0x79')](_0x1da5a8,_0x55bab0);if(_0x55bab0[_0xb95e('0x7b')][_0xb95e('0x77')]==='user'){var _0x115a34={'params':{'id':_0x55bab0[_0xb95e('0x7b')][_0xb95e('0x91')]},'query':{'section':_0x1cf558===_0xb95e('0x1e')&&_0x55bab0[_0xb95e('0x6f')][_0xb95e('0x75')]===_0xb95e('0x1f')?_0xb95e('0x92'):_[_0xb95e('0x17')](_0x1cf558)+_0xb95e('0x18'),'type':_0x55bab0[_0xb95e('0x6f')]['type'],'nolimit':!![],'sort':_0xb95e('0xf'),'filter':_0x55bab0[_0xb95e('0x6f')][_0xb95e('0x37')]}};return db['UserProfile'][_0xb95e('0x7e')](_0x115a34);}return db[_0x2de298][_0xb95e('0x7f')](_0x176739);})[_0xb95e('0x13')](function(_0x221470){_0x1a9a27[_0xb95e('0x8')]=_0x221470[_0xb95e('0x8')];_0xdd382a=_0x221470['rows'];return getRealtimeQueues(_0x55bab0,_0x1cf558);})[_0xb95e('0x13')](function(_0x22c68b){_0x2c547b=_0x22c68b[_0xb95e('0x80')];return getRealtimeAgents();})[_0xb95e('0x13')](function(_0x18e73b){_0xffe301=_0x18e73b[_0xb95e('0x80')];if(_0x1cf558!=_0xb95e('0x1e'))return;return getRealtimeVoiceQueueChannels();})[_0xb95e('0x13')](function(_0x331bd7){_0x134f9f=_0x331bd7?_0x331bd7['rows']:[];return initializeQueues(_0xdd382a,_0x2c547b,_0x1cf558,_0x55bab0['query'][_0xb95e('0x75')]);})[_0xb95e('0x13')](function(_0x4e9867){var _0x5c6d94=_0x4e9867[_0xb95e('0x2f')](function(_0x54ce9a){if(_0x1cf558==='voice')return getVoiceQueueAgents(_0x54ce9a,_0xdd382a,_0xffe301,_0x134f9f);else return getQueueAgents(_0x54ce9a,_0xffe301,_0x1cf558);});return Promise[_0xb95e('0x93')](_0x5c6d94);})[_0xb95e('0x13')](function(_0x5ddca3){_0x1a9a27['rows']=_0x5ddca3;return _0x1a9a27;})['then'](respondWithFilteredResult(_0x3d4320,_0x176739))['catch'](handleError(_0x3d4320,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 1d73c2a..411a033 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x436a2,_0x4d0382){var _0x3fb9c9=function(_0x47e5e3){while(--_0x47e5e3){_0x436a2['push'](_0x436a2['shift']());}};_0x3fb9c9(++_0x4d0382);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x57402d,_0x3ebd30){var _0x224071=function(_0x5c8d23){while(--_0x5c8d23){_0x57402d['push'](_0x57402d['shift']());}};_0x224071(++_0x3ebd30);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('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 d8578c6..7604215 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 _0xc03e=['DATE','INTEGER','sequelize','STRING'];(function(_0x55f245,_0x449413){var _0x283c23=function(_0xb6577a){while(--_0xb6577a){_0x55f245['push'](_0x55f245['shift']());}};_0x283c23(++_0x449413);}(_0xc03e,0x15a));var _0xec03=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0xc03e[_0x2998db];return _0x115fea;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xec03('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xec03('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xec03('0x2')]},'ringtime':{'type':Sequelize[_0xec03('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xec03('0x1')]},'campaigntype':{'type':Sequelize[_0xec03('0x1')]},'membername':{'type':Sequelize[_0xec03('0x1')]}}; \ No newline at end of file +var _0x3c03=['DATE','STRING','sequelize'];(function(_0x10a941,_0x164217){var _0x505f2b=function(_0x599523){while(--_0x599523){_0x10a941['push'](_0x10a941['shift']());}};_0x505f2b(++_0x164217);}(_0x3c03,0x16d));var _0x33c0=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x3c03[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require(_0x33c0('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x33c0('0x1')]},'uniqueid':{'type':Sequelize[_0x33c0('0x2')]},'starttime':{'type':Sequelize[_0x33c0('0x1')]},'responsetime':{'type':Sequelize[_0x33c0('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x33c0('0x2')]},'campaigntype':{'type':Sequelize[_0x33c0('0x2')]},'membername':{'type':Sequelize[_0x33c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 6360cab..41a240c 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 _0x6f04=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5a9100,_0x247817){var _0x46e164=function(_0x57b531){while(--_0x57b531){_0x5a9100['push'](_0x5a9100['shift']());}};_0x46e164(++_0x247817);}(_0x6f04,0x1cd));var _0x46f0=function(_0x191636,_0x5d7cbf){_0x191636=_0x191636-0x0;var _0x5d0d30=_0x6f04[_0x191636];return _0x5d0d30;};'use strict';var _=require(_0x46f0('0x0'));var util=require(_0x46f0('0x1'));var logger=require('../../config/logger')(_0x46f0('0x2'));var moment=require(_0x46f0('0x3'));var BPromise=require(_0x46f0('0x4'));var rp=require(_0x46f0('0x5'));var fs=require('fs');var path=require(_0x46f0('0x6'));var rimraf=require(_0x46f0('0x7'));var config=require(_0x46f0('0x8'));var attributes=require(_0x46f0('0x9'));module[_0x46f0('0xa')]=function(_0x279f81,_0x3d470d){return _0x279f81['define'](_0x46f0('0xb'),attributes,{'tableName':_0x46f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf25=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x79e146,_0xf576f0){var _0x3718d3=function(_0x5102b5){while(--_0x5102b5){_0x79e146['push'](_0x79e146['shift']());}};_0x3718d3(++_0xf576f0);}(_0xdf25,0x182));var _0x5df2=function(_0x39e9df,_0x1d79c9){_0x39e9df=_0x39e9df-0x0;var _0x230b89=_0xdf25[_0x39e9df];return _0x230b89;};'use strict';var _=require(_0x5df2('0x0'));var util=require('util');var logger=require(_0x5df2('0x1'))(_0x5df2('0x2'));var moment=require(_0x5df2('0x3'));var BPromise=require(_0x5df2('0x4'));var rp=require(_0x5df2('0x5'));var fs=require('fs');var path=require(_0x5df2('0x6'));var rimraf=require(_0x5df2('0x7'));var config=require(_0x5df2('0x8'));var attributes=require(_0x5df2('0x9'));module[_0x5df2('0xa')]=function(_0x2c9a60,_0x251662){return _0x2c9a60[_0x5df2('0xb')](_0x5df2('0xc'),attributes,{'tableName':_0x5df2('0xd'),'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 4ce3c66..0c67f86 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 _0x3685=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','options','raw','catch','lodash','moment','bluebird','randomstring'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5368('0x0'));var util=require('util');var moment=require(_0x5368('0x1'));var BPromise=require(_0x5368('0x2'));var rs=require(_0x5368('0x3'));var fs=require('fs');var Redis=require(_0x5368('0x4'));var db=require(_0x5368('0x5'))['db'];var utils=require(_0x5368('0x6'));var logger=require(_0x5368('0x7'))(_0x5368('0x8'));var config=require(_0x5368('0x9'));var jayson=require(_0x5368('0xa'));var client=jayson['client'][_0x5368('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2529a2,_0x39223d,_0xaf4549){return new BPromise(function(_0x55fb7d,_0x14e621){return client[_0x5368('0xc')](_0x2529a2,_0xaf4549)[_0x5368('0xd')](function(_0x2a6ce8){logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,_0x5368('0x10'));logger[_0x5368('0x11')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x39223d,_0x5368('0x10'),JSON[_0x5368('0x12')](_0x2a6ce8));if(_0x2a6ce8[_0x5368('0x13')]){if(_0x2a6ce8['error'][_0x5368('0x14')]===0x1f4){logger[_0x5368('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x39223d,_0x2a6ce8['error']['message']);return _0x14e621(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);return _0x55fb7d(_0x2a6ce8[_0x5368('0x13')][_0x5368('0x15')]);}else{logger[_0x5368('0xe')](_0x5368('0xf'),_0x39223d,'request\x20sent');_0x55fb7d(_0x2a6ce8[_0x5368('0x16')][_0x5368('0x15')]);}})['catch'](function(_0x19790d){logger[_0x5368('0x13')](_0x5368('0xf'),_0x39223d,_0x19790d);_0x14e621(_0x19790d);});});}exports[_0x5368('0x17')]=function(_0x5b10e9){var _0x3fcae0=this;return new Promise(function(_0x56ac4d,_0x4baaa9){return db[_0x5368('0x18')]['create'](_0x5b10e9['body'],{'raw':_0x5b10e9['options']?_0x5b10e9[_0x5368('0x19')][_0x5368('0x1a')]===undefined?!![]:![]:!![]})[_0x5368('0xd')](function(_0x5cef40){logger['info'](_0x5368('0x17'),_0x5b10e9);logger[_0x5368('0x11')](_0x5368('0x17'),_0x5b10e9,JSON[_0x5368('0x12')](_0x5cef40));_0x56ac4d(_0x5cef40);})[_0x5368('0x1b')](function(_0x1093e2){logger[_0x5368('0x13')](_0x5368('0x17'),_0x1093e2[_0x5368('0x15')],_0x5b10e9);_0x4baaa9(_0x3fcae0[_0x5368('0x13')](0x1f4,_0x1093e2['message']));});});}; \ No newline at end of file +var _0xd89a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','create','body','options','CreateReportAgentPreview','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x4aa7c3,_0x1bed49){var _0x12de5e=function(_0x4ed25f){while(--_0x4ed25f){_0x4aa7c3['push'](_0x4aa7c3['shift']());}};_0x12de5e(++_0x1bed49);}(_0xd89a,0x173));var _0xad89=function(_0x357633,_0x254610){_0x357633=_0x357633-0x0;var _0x261faf=_0xd89a[_0x357633];return _0x261faf;};'use strict';var _=require(_0xad89('0x0'));var util=require(_0xad89('0x1'));var moment=require(_0xad89('0x2'));var BPromise=require('bluebird');var rs=require(_0xad89('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad89('0x4'))['db'];var utils=require(_0xad89('0x5'));var logger=require(_0xad89('0x6'))(_0xad89('0x7'));var config=require(_0xad89('0x8'));var jayson=require(_0xad89('0x9'));var client=jayson[_0xad89('0xa')][_0xad89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3117f0,_0x5c7d3f,_0x4c3bf1){return new BPromise(function(_0x25faf5,_0x441337){return client[_0xad89('0xc')](_0x3117f0,_0x4c3bf1)[_0xad89('0xd')](function(_0x1eebf3){logger[_0xad89('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x5c7d3f,'request\x20sent');logger[_0xad89('0xf')](_0xad89('0x10'),_0x5c7d3f,_0xad89('0x11'),JSON[_0xad89('0x12')](_0x1eebf3));if(_0x1eebf3['error']){if(_0x1eebf3[_0xad89('0x13')][_0xad89('0x14')]===0x1f4){logger[_0xad89('0x13')](_0xad89('0x15'),_0x5c7d3f,_0x1eebf3['error'][_0xad89('0x16')]);return _0x441337(_0x1eebf3['error']['message']);}logger[_0xad89('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x5c7d3f,_0x1eebf3[_0xad89('0x13')][_0xad89('0x16')]);return _0x25faf5(_0x1eebf3['error']['message']);}else{logger['info'](_0xad89('0x15'),_0x5c7d3f,_0xad89('0x11'));_0x25faf5(_0x1eebf3[_0xad89('0x17')][_0xad89('0x16')]);}})[_0xad89('0x18')](function(_0x1a37e1){logger['error'](_0xad89('0x15'),_0x5c7d3f,_0x1a37e1);_0x441337(_0x1a37e1);});});}exports['CreateReportAgentPreview']=function(_0x3dd9bd){var _0x49fd22=this;return new Promise(function(_0x2aa469,_0x5d8af6){return db['ReportAgentPreview'][_0xad89('0x19')](_0x3dd9bd[_0xad89('0x1a')],{'raw':_0x3dd9bd['options']?_0x3dd9bd[_0xad89('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xcce036){logger['info'](_0xad89('0x1c'),_0x3dd9bd);logger[_0xad89('0xf')](_0xad89('0x1c'),_0x3dd9bd,JSON[_0xad89('0x12')](_0xcce036));_0x2aa469(_0xcce036);})[_0xad89('0x18')](function(_0x80e6d1){logger[_0xad89('0x13')](_0xad89('0x1c'),_0x80e6d1[_0xad89('0x16')],_0x3dd9bd);_0x5d8af6(_0x49fd22[_0xad89('0x13')](0x1f4,_0x80e6d1[_0xad89('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index a19d5a6..cae73d5 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 _0x18f8=['/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','queueNotify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x18f8,0x1bf));var _0x818f=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x18f8[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x818f('0x0'));var util=require('util');var path=require(_0x818f('0x1'));var express=require(_0x818f('0x2'));var router=express[_0x818f('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x818f('0x4')]('/voice/channels',auth['isAuthenticated'](),controller[_0x818f('0x5')]);router['get'](_0x818f('0x6'),auth['isAuthenticated'](),controller[_0x818f('0x7')]);router[_0x818f('0x4')](_0x818f('0x8'),auth[_0x818f('0x9')](),controller[_0x818f('0xa')]);router[_0x818f('0x4')](_0x818f('0xb'),auth[_0x818f('0x9')](),controller[_0x818f('0xc')]);router[_0x818f('0x4')](_0x818f('0xd'),auth[_0x818f('0x9')](),controller[_0x818f('0xe')]);router['get'](_0x818f('0xf'),auth[_0x818f('0x9')](),controller[_0x818f('0x10')]);router[_0x818f('0x4')](_0x818f('0x11'),auth[_0x818f('0x9')](),controller[_0x818f('0x12')]);router['get'](_0x818f('0x13'),auth[_0x818f('0x9')](),controller['openchannelQueues']);router[_0x818f('0x4')](_0x818f('0x14'),auth[_0x818f('0x9')](),controller[_0x818f('0x15')]);router[_0x818f('0x4')](_0x818f('0x16'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x818f('0x4')](_0x818f('0x17'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x818f('0x4')](_0x818f('0x18'),auth[_0x818f('0x9')](),controller[_0x818f('0x19')]);router[_0x818f('0x4')](_0x818f('0x1a'),auth['isAuthenticated'](),controller[_0x818f('0x1b')]);router[_0x818f('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x818f('0x1c')]);router[_0x818f('0x4')](_0x818f('0x1d'),auth[_0x818f('0x9')](),controller[_0x818f('0x1e')]);router['get'](_0x818f('0x1f'),auth[_0x818f('0x9')](),controller[_0x818f('0x20')]);router['get'](_0x818f('0x21'),auth['isAuthenticated'](),controller[_0x818f('0x22')]);router[_0x818f('0x23')]('/voice/queues/:id',auth[_0x818f('0x9')](),controller[_0x818f('0x24')]);router['get']('/outbound',auth[_0x818f('0x9')](),controller['outbound']);router[_0x818f('0x4')](_0x818f('0x25'),auth[_0x818f('0x9')](),controller['outboundChannels']);router[_0x818f('0x4')](_0x818f('0x26'),auth[_0x818f('0x9')](),controller[_0x818f('0x27')]);router[_0x818f('0x23')](_0x818f('0x28'),auth[_0x818f('0x9')](),controller[_0x818f('0x29')]);router[_0x818f('0x4')](_0x818f('0x2a'),auth[_0x818f('0x9')](),controller[_0x818f('0x2b')]);router[_0x818f('0x4')]('/trunks',auth[_0x818f('0x9')](),controller[_0x818f('0x2c')]);router['get']('/campaigns',auth[_0x818f('0x9')](),controller['campaigns']);router[_0x818f('0x4')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x818f('0x2d')]);router[_0x818f('0x4')]('/chat/queues/waitinginteractions',auth[_0x818f('0x9')](),controller[_0x818f('0x2e')]);router[_0x818f('0x4')](_0x818f('0x2f'),auth[_0x818f('0x9')](),controller[_0x818f('0x30')]);router[_0x818f('0x4')]('/openchannel/queues/waitinginteractions',auth[_0x818f('0x9')](),controller[_0x818f('0x31')]);router[_0x818f('0x4')](_0x818f('0x32'),auth[_0x818f('0x9')](),controller[_0x818f('0x33')]);router[_0x818f('0x4')]('/sms/queues/waitinginteractions',auth[_0x818f('0x9')](),controller[_0x818f('0x34')]);router[_0x818f('0x4')](_0x818f('0x35'),auth['isAuthenticated'](),controller[_0x818f('0x36')]);router[_0x818f('0x4')]('/fax/queues/waitinginteractions',auth[_0x818f('0x9')](),controller[_0x818f('0x37')]);router[_0x818f('0x38')](_0x818f('0x39'),auth[_0x818f('0x9')](),controller['queueNotify'](_0x818f('0x3a')));router[_0x818f('0x4')]('/mail/queues/:id',auth[_0x818f('0x9')](),controller[_0x818f('0x3b')]);router[_0x818f('0x38')](_0x818f('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0x818f('0x3d')));router[_0x818f('0x4')](_0x818f('0x3e'),auth[_0x818f('0x9')](),controller[_0x818f('0x3f')]);router[_0x818f('0x38')](_0x818f('0x40'),auth[_0x818f('0x9')](),controller[_0x818f('0x41')](_0x818f('0x42')));router[_0x818f('0x4')]('/fax/queues/:id',auth[_0x818f('0x9')](),controller[_0x818f('0x43')]);router[_0x818f('0x38')](_0x818f('0x44'),auth['isAuthenticated'](),controller[_0x818f('0x41')](_0x818f('0x45')));router['get']('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x818f('0x46')]);router[_0x818f('0x38')](_0x818f('0x47'),auth['isAuthenticated'](),controller[_0x818f('0x41')](_0x818f('0x48')));router[_0x818f('0x38')]('/whatsapp/queues/:id/notify',auth[_0x818f('0x9')](),controller[_0x818f('0x41')](_0x818f('0x49')));router[_0x818f('0x4')](_0x818f('0x4a'),auth[_0x818f('0x9')](),controller[_0x818f('0x4b')]);router[_0x818f('0x4')]('/whatsapp/queues/:id',auth[_0x818f('0x9')](),controller[_0x818f('0x4c')]);router[_0x818f('0x38')](_0x818f('0x4d'),auth[_0x818f('0x9')](),controller[_0x818f('0x4e')]);module[_0x818f('0x4f')]=router; \ No newline at end of file +var _0xd00e=['/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','queueNotify','mail','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','agentNotify','multer','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity'];(function(_0x250186,_0x4cfecc){var _0x37415a=function(_0x19f893){while(--_0x19f893){_0x250186['push'](_0x250186['shift']());}};_0x37415a(++_0x4cfecc);}(_0xd00e,0x10d));var _0xed00=function(_0xd95342,_0xb75bf6){_0xd95342=_0xd95342-0x0;var _0x54d694=_0xd00e[_0xd95342];return _0x54d694;};'use strict';var multer=require(_0xed00('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(_0xed00('0x1'));router[_0xed00('0x2')]('/voice/channels',auth['isAuthenticated'](),controller[_0xed00('0x3')]);router[_0xed00('0x2')](_0xed00('0x4'),auth[_0xed00('0x5')](),controller[_0xed00('0x6')]);router['get'](_0xed00('0x7'),auth[_0xed00('0x5')](),controller[_0xed00('0x8')]);router['get'](_0xed00('0x9'),auth[_0xed00('0x5')](),controller[_0xed00('0xa')]);router[_0xed00('0x2')](_0xed00('0xb'),auth[_0xed00('0x5')](),controller['chatQueues']);router['get']('/mail/queues',auth[_0xed00('0x5')](),controller[_0xed00('0xc')]);router[_0xed00('0x2')](_0xed00('0xd'),auth[_0xed00('0x5')](),controller[_0xed00('0xe')]);router[_0xed00('0x2')](_0xed00('0xf'),auth['isAuthenticated'](),controller[_0xed00('0x10')]);router['get'](_0xed00('0x11'),auth[_0xed00('0x5')](),controller['smsQueues']);router[_0xed00('0x2')](_0xed00('0x12'),auth[_0xed00('0x5')](),controller[_0xed00('0x13')]);router['get'](_0xed00('0x14'),auth[_0xed00('0x5')](),controller[_0xed00('0x15')]);router[_0xed00('0x2')](_0xed00('0x16'),auth[_0xed00('0x5')](),controller[_0xed00('0x17')]);router[_0xed00('0x2')](_0xed00('0x18'),auth[_0xed00('0x5')](),controller[_0xed00('0x19')]);router[_0xed00('0x2')](_0xed00('0x1a'),auth[_0xed00('0x5')](),controller[_0xed00('0x1b')]);router[_0xed00('0x2')](_0xed00('0x1c'),auth[_0xed00('0x5')](),controller[_0xed00('0x1d')]);router[_0xed00('0x2')](_0xed00('0x1e'),auth[_0xed00('0x5')](),controller[_0xed00('0x1f')]);router[_0xed00('0x2')](_0xed00('0x20'),auth[_0xed00('0x5')](),controller[_0xed00('0x21')]);router['put'](_0xed00('0x20'),auth['isAuthenticated'](),controller[_0xed00('0x22')]);router[_0xed00('0x2')](_0xed00('0x23'),auth['isAuthenticated'](),controller[_0xed00('0x24')]);router['get'](_0xed00('0x25'),auth['isAuthenticated'](),controller['outboundChannels']);router['get'](_0xed00('0x26'),auth[_0xed00('0x5')](),controller[_0xed00('0x27')]);router[_0xed00('0x28')](_0xed00('0x29'),auth[_0xed00('0x5')](),controller[_0xed00('0x2a')]);router['get'](_0xed00('0x2b'),auth[_0xed00('0x5')](),controller[_0xed00('0x2c')]);router[_0xed00('0x2')](_0xed00('0x2d'),auth['isAuthenticated'](),controller[_0xed00('0x2e')]);router[_0xed00('0x2')](_0xed00('0x2f'),auth[_0xed00('0x5')](),controller[_0xed00('0x30')]);router[_0xed00('0x2')](_0xed00('0x31'),auth[_0xed00('0x5')](),controller[_0xed00('0x32')]);router['get'](_0xed00('0x33'),auth[_0xed00('0x5')](),controller[_0xed00('0x34')]);router[_0xed00('0x2')]('/mail/queues/waitinginteractions',auth[_0xed00('0x5')](),controller['mailQueuesWaitingInteractions']);router[_0xed00('0x2')](_0xed00('0x35'),auth[_0xed00('0x5')](),controller[_0xed00('0x36')]);router['get'](_0xed00('0x37'),auth['isAuthenticated'](),controller[_0xed00('0x38')]);router[_0xed00('0x2')](_0xed00('0x39'),auth[_0xed00('0x5')](),controller[_0xed00('0x3a')]);router[_0xed00('0x2')](_0xed00('0x3b'),auth[_0xed00('0x5')](),controller['whatsappQueuesWaitingInteractions']);router[_0xed00('0x2')]('/fax/queues/waitinginteractions',auth[_0xed00('0x5')](),controller['faxQueuesWaitingInteractions']);router['post']('/mail/queues/:id/notify',auth[_0xed00('0x5')](),controller[_0xed00('0x3c')](_0xed00('0x3d')));router[_0xed00('0x2')]('/mail/queues/:id',auth[_0xed00('0x5')](),controller[_0xed00('0x3e')]);router[_0xed00('0x3f')](_0xed00('0x40'),auth[_0xed00('0x5')](),controller[_0xed00('0x3c')](_0xed00('0x41')));router['get'](_0xed00('0x42'),auth[_0xed00('0x5')](),controller[_0xed00('0x43')]);router[_0xed00('0x3f')](_0xed00('0x44'),auth[_0xed00('0x5')](),controller[_0xed00('0x3c')](_0xed00('0x45')));router[_0xed00('0x2')]('/fax/queues/:id',auth[_0xed00('0x5')](),controller['showFaxQueues']);router['post'](_0xed00('0x46'),auth[_0xed00('0x5')](),controller['queueNotify'](_0xed00('0x47')));router[_0xed00('0x2')](_0xed00('0x48'),auth[_0xed00('0x5')](),controller['showOpenchannelQueues']);router[_0xed00('0x3f')](_0xed00('0x49'),auth[_0xed00('0x5')](),controller[_0xed00('0x3c')](_0xed00('0x4a')));router[_0xed00('0x3f')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0xed00('0x3c')]('whatsapp'));router[_0xed00('0x2')](_0xed00('0x4b'),auth[_0xed00('0x5')](),controller[_0xed00('0x4c')]);router[_0xed00('0x2')]('/whatsapp/queues/:id',auth[_0xed00('0x5')](),controller['showWhatsappQueues']);router[_0xed00('0x3f')]('/agents/:id/notify',auth[_0xed00('0x5')](),controller[_0xed00('0x4d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 7c1b62d..1fb4791 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 _0xe14b=['MessageId','InteractionId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Website','User','agent','Agent\x20not\x20found','Message','update','From','bluebird','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found'];(function(_0x2244af,_0x84d2ed){var _0x2b183a=function(_0x35978c){while(--_0x35978c){_0x2244af['push'](_0x2244af['shift']());}};_0x2b183a(++_0x84d2ed);}(_0xe14b,0x93));var _0xbe14=function(_0x133238,_0x159ee0){_0x133238=_0x133238-0x0;var _0x107fcd=_0xe14b[_0x133238];return _0x107fcd;};'use strict';var BPromise=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var _=require('lodash');var util=require('util');var db=require(_0xbe14('0x2'))['db'];var logger=require(_0xbe14('0x3'))('api');var jayson=require(_0xbe14('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232b});var routingClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){var _0x496063=_0x196fca?_0x196fca:amiClient;return _0x496063[_0xbe14('0x7')](_0x1d9ade,_0x39387e)[_0xbe14('0x8')](function(_0xd68cd7){if(_0xd68cd7[_0xbe14('0x9')]){if(_0xd68cd7['error']['code']===0x1f4){return _0x50f909(_0xd68cd7[_0xbe14('0x9')][_0xbe14('0xa')]);}return _0x566ae7(_0xd68cd7['error'][_0xbe14('0xa')]);}else{_0x566ae7(_0xd68cd7[_0xbe14('0xb')]);}})[_0xbe14('0xc')](function(_0x3d38c2){_0x50f909(_0x3d38c2);});});}function respondWithResult(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xc8;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0xd')](_0x3b898d)[_0xbe14('0xe')](_0x23a730);}return _0x27792f[_0xbe14('0xf')](0x194);};}function handleError(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0x1f4;return function(_0x813399){logger['error'](_0x813399['stack']);if(_0x813399[_0xbe14('0x10')]){delete _0x813399[_0xbe14('0x10')];}_0x1e4826[_0xbe14('0xd')](_0x33fd54)[_0xbe14('0x11')](_0x813399);};}function findById(_0x4e8f34){return function(_0x21c789){if(!_[_0xbe14('0x12')](_0x4e8f34)&&!_[_0xbe14('0x12')](_0x21c789)&&!_[_0xbe14('0x12')](_0x21c789[_0xbe14('0x13')])){return _[_0xbe14('0x14')](_0x21c789[_0xbe14('0x13')],function(_0x5ea1f8){return _0x5ea1f8['id']==_0x4e8f34;});}return null;};}exports[_0xbe14('0x15')]=function(_0x456ca8,_0x329588){return respondWithRpcPromise(_0xbe14('0x16'),_0x456ca8[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x329588,null))['catch'](handleError(_0x329588,null));};exports[_0xbe14('0x18')]=function(_0x4a1bbd,_0x417c8d){return respondWithRpcPromise(_0xbe14('0x19'),_[_0xbe14('0x1a')](_0x4a1bbd['query'],_0x4a1bbd[_0xbe14('0x1b')]))['then'](respondWithResult(_0x417c8d,null))[_0xbe14('0xc')](handleError(_0x417c8d,null));};exports['voiceChannelStopMixMonitor']=function(_0x32e8eb,_0x4a25fa){return respondWithRpcPromise(_0xbe14('0x1c'),_[_0xbe14('0x1a')](_0x32e8eb['query'],_0x32e8eb[_0xbe14('0x1b')]))['then'](respondWithResult(_0x4a25fa,null))[_0xbe14('0xc')](handleError(_0x4a25fa,null));};exports['voiceQueues']=function(_0x36a21e,_0x5fa043){return respondWithRpcPromise(_0xbe14('0x1d'),_0x36a21e[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x5fa043,null))[_0xbe14('0xc')](handleError(_0x5fa043,null));};exports['showVoiceQueues']=function(_0x1822e0,_0x1ba46a){return respondWithRpcPromise(_0xbe14('0x1d'),_0x1822e0[_0xbe14('0x17')])['then'](findById(_0x1822e0[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x1ba46a,null))['catch'](handleError(_0x1ba46a,null));};exports[_0xbe14('0x1e')]=function(_0x3b3e84,_0x1c7cc7){return respondWithRpcPromise(_0xbe14('0x1f'),_[_0xbe14('0x1a')](_0x3b3e84[_0xbe14('0x20')],_0x3b3e84[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x1c7cc7,null))[_0xbe14('0xc')](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x21')]=function(_0x40538f,_0x3bf43c){return respondWithRpcPromise(_0xbe14('0x22'),_[_0xbe14('0x1a')](_0x40538f[_0xbe14('0x17')],_0x40538f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x3bf43c,null))[_0xbe14('0xc')](handleError(_0x3bf43c,null));};exports[_0xbe14('0x23')]=function(_0x14e7c4,_0x581e86){return respondWithRpcPromise(_0xbe14('0x24'),_0x14e7c4['query'])['then'](respondWithResult(_0x581e86,null))[_0xbe14('0xc')](handleError(_0x581e86,null));};exports['voiceQueuesChannel']=function(_0x243524,_0x345b0){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x243524['query'],_0x243524[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x345b0,null))['catch'](handleError(_0x345b0,null));};exports[_0xbe14('0x25')]=function(_0x1faf3e,_0x452635){return respondWithRpcPromise(_0xbe14('0x26'),_[_0xbe14('0x1a')](_0x1faf3e['query'],_0x1faf3e['params']))[_0xbe14('0x8')](respondWithResult(_0x452635,null))['catch'](handleError(_0x452635,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c5e9f,_0x163ef7){return respondWithRpcPromise(_0xbe14('0x27'),_[_0xbe14('0x1a')](_0x5c5e9f[_0xbe14('0x17')],_0x5c5e9f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x163ef7,null))[_0xbe14('0xc')](handleError(_0x163ef7,null));};exports[_0xbe14('0x28')]=function(_0x2d9c12,_0x2dfd5a){return respondWithRpcPromise(_0xbe14('0x29'),_0x2d9c12[_0xbe14('0x17')])['then'](respondWithResult(_0x2dfd5a,null))['catch'](handleError(_0x2dfd5a,null));};exports[_0xbe14('0x2a')]=function(_0x2951e1,_0x13bfcf){return respondWithRpcPromise('OutboundChannels',_0x2951e1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x13bfcf,null))[_0xbe14('0xc')](handleError(_0x13bfcf,null));};exports[_0xbe14('0x2b')]=function(_0x3bd454,_0x25ee1f){var _0x19fa30;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')])['then'](function(_0xe51424){_0x19fa30=_0xe51424;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')],routingClient);})[_0xbe14('0x8')](function(_0x3287b9){return _[_0xbe14('0x1a')]({},_0x3287b9,_0x19fa30);})['then'](respondWithResult(_0x25ee1f,null))[_0xbe14('0xc')](handleError(_0x25ee1f,null));};exports[_0xbe14('0x2d')]=function(_0x1220c9,_0x36263c){if(_0x1220c9['body']&&_0x1220c9['body'][_0xbe14('0x2e')]&&_0x1220c9[_0xbe14('0x2f')]&&_0x1220c9[_0xbe14('0x2f')]['name']){for(var _0x5d5318 in _0x1220c9[_0xbe14('0x20')]['interaction']){if(_0x1220c9['body'][_0xbe14('0x2e')][_0xbe14('0x30')](_0x5d5318)){db[_0xbe14('0x31')]['findAll']({'where':{'channel':_0x5d5318,'membername':_0x1220c9['user']['name'],'type':_0xbe14('0x32'),'exitAt':null,'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]&&_0x1220c9['body'][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')]?{'$notIn':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]}:{'$ne':null}}})['then'](function(_0x4a1a4b){var _0x3e2fd3=moment()[_0xbe14('0x34')](_0xbe14('0x35'));for(var _0xb2b285=0x0,_0x2550dc=_0x4a1a4b['length'];_0xb2b285<_0x2550dc;_0xb2b285+=0x1){_0x4a1a4b[_0xb2b285]['updateAttributes']({'exitAt':_0x3e2fd3});}});for(var _0x46af81=0x0;_0x46af81<_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')];_0x46af81+=0x1){db['MemberReport'][_0xbe14('0x36')]({'where':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'type':_0xbe14('0x32'),'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81],'exitAt':null},'defaults':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'interface':_['isNil'](_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')])?util['format']('SIP/%s',_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x10')]):_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')],'type':_0xbe14('0x32'),'enterAt':moment()[_0xbe14('0x34')](_0xbe14('0x35')),'role':'agent','internal':_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x38')],'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81]}});}}}}return respondWithRpcPromise(_0xbe14('0x39'),{'id':_0x1220c9['params']['id'],'capacity':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x3a')]},routingClient)[_0xbe14('0x8')](respondWithResult(_0x36263c,null))[_0xbe14('0xc')](handleError(_0x36263c,null));};exports[_0xbe14('0x3b')]=function(_0x2dbeb1,_0x505829){return respondWithRpcPromise('Telephones',_0x2dbeb1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x505829,null))[_0xbe14('0xc')](handleError(_0x505829,null));};exports['trunks']=function(_0x497b00,_0x44fe0d){return respondWithRpcPromise(_0xbe14('0x3c'),_0x497b00['query'])[_0xbe14('0x8')](respondWithResult(_0x44fe0d,null))[_0xbe14('0xc')](handleError(_0x44fe0d,null));};exports['campaigns']=function(_0x28f995,_0x4a40d2){return respondWithRpcPromise(_0xbe14('0x3d'),_0x28f995[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x4a40d2,null))['catch'](handleError(_0x4a40d2,null));};exports[_0xbe14('0x3e')]=function(_0x404212,_0x5dc78a){return respondWithRpcPromise(_0xbe14('0x3f'),_0x404212[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x5dc78a,null))[_0xbe14('0xc')](handleError(_0x5dc78a,null));};exports[_0xbe14('0x40')]=function(_0x4f06a3,_0x42a346){return respondWithRpcPromise(_0xbe14('0x3f'),_0x4f06a3[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x4f06a3[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x42a346,null))[_0xbe14('0xc')](handleError(_0x42a346,null));};exports['mailQueues']=function(_0x72c875,_0x1b47a4){return respondWithRpcPromise(_0xbe14('0x41'),_0x72c875[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1b47a4,null))[_0xbe14('0xc')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x42')]=function(_0x32df3c,_0x285b6e){return respondWithRpcPromise(_0xbe14('0x41'),_0x32df3c[_0xbe14('0x17')],routingClient)['then'](findById(_0x32df3c['params']['id']))['then'](respondWithResult(_0x285b6e,null))[_0xbe14('0xc')](handleError(_0x285b6e,null));};exports[_0xbe14('0x43')]=function(_0x2f4e52,_0xf79b21){return respondWithRpcPromise(_0xbe14('0x44'),_0x2f4e52[_0xbe14('0x17')],mailClient)[_0xbe14('0x8')](respondWithResult(_0xf79b21,null))[_0xbe14('0xc')](handleError(_0xf79b21,null));};exports[_0xbe14('0x45')]=function(_0x451b0b,_0x603816){return respondWithRpcPromise(_0xbe14('0x46'),_0x451b0b[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x603816,null))[_0xbe14('0xc')](handleError(_0x603816,null));};exports[_0xbe14('0x47')]=function(_0x179077,_0x2225d9){return respondWithRpcPromise(_0xbe14('0x46'),_0x179077[_0xbe14('0x17')],routingClient)['then'](findById(_0x179077[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x2225d9,null))[_0xbe14('0xc')](handleError(_0x2225d9,null));};exports[_0xbe14('0x48')]=function(_0x3ee6b7,_0x222944){return respondWithRpcPromise(_0xbe14('0x49'),_0x3ee6b7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x222944,null))[_0xbe14('0xc')](handleError(_0x222944,null));};exports['showSmsQueues']=function(_0x18be56,_0x442ec4){return respondWithRpcPromise(_0xbe14('0x49'),_0x18be56[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x18be56['params']['id']))[_0xbe14('0x8')](respondWithResult(_0x442ec4,null))[_0xbe14('0xc')](handleError(_0x442ec4,null));};exports[_0xbe14('0x4a')]=function(_0xd4e1c7,_0x46ac9c){return respondWithRpcPromise('WhatsappQueues',_0xd4e1c7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x46ac9c,null))[_0xbe14('0xc')](handleError(_0x46ac9c,null));};exports[_0xbe14('0x4b')]=function(_0xaebce8,_0x289c4d){return respondWithRpcPromise(_0xbe14('0x4c'),_0xaebce8[_0xbe14('0x17')],routingClient)['then'](findById(_0xaebce8[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x289c4d,null))[_0xbe14('0xc')](handleError(_0x289c4d,null));};exports[_0xbe14('0x4d')]=function(_0x5982b7,_0xa4b2a3){return respondWithRpcPromise(_0xbe14('0x4e'),_0x5982b7['query'],routingClient)['then'](respondWithResult(_0xa4b2a3,null))[_0xbe14('0xc')](handleError(_0xa4b2a3,null));};exports[_0xbe14('0x4f')]=function(_0x2d2643,_0x2510a0){return respondWithRpcPromise(_0xbe14('0x4e'),_0x2d2643[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x2d2643[_0xbe14('0x1b')]['id']))['then'](respondWithResult(_0x2510a0,null))['catch'](handleError(_0x2510a0,null));};exports[_0xbe14('0x50')]=function(_0x1c18b6,_0x29aa52){return respondWithRpcPromise('FaxAccounts',_0x1c18b6[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x29aa52,null))[_0xbe14('0xc')](handleError(_0x29aa52,null));};exports[_0xbe14('0x51')]=function(_0x468e9f,_0x1ef09b){return respondWithRpcPromise(_0xbe14('0x52'),_0x468e9f['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1ef09b,null))[_0xbe14('0xc')](handleError(_0x1ef09b,null));};exports[_0xbe14('0x53')]=function(_0x3afc5a,_0x469555){return respondWithRpcPromise(_0xbe14('0x54'),_0x3afc5a[_0xbe14('0x17')],routingClient)['then'](respondWithResult(_0x469555,null))[_0xbe14('0xc')](handleError(_0x469555,null));};exports[_0xbe14('0x55')]=function(_0x3cd17e,_0x1c0932){return respondWithRpcPromise(_0xbe14('0x56'),_0x3cd17e[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1c0932,null))[_0xbe14('0xc')](handleError(_0x1c0932,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x1e5ce1,_0x401968){return respondWithRpcPromise(_0xbe14('0x56'),_0x1e5ce1[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](function(_0x17576b){if(_0x1e5ce1['query'][_0xbe14('0x57')]!==undefined){var _0x175213=_(_0x17576b[_0xbe14('0x13')])[_0xbe14('0x58')]([_0x1e5ce1['query'][_0xbe14('0x57')],_0x1e5ce1[_0xbe14('0x1b')]['id']])[_0xbe14('0x59')](_0xbe14('0x5a'))[_0xbe14('0x5b')]()[_0xbe14('0x5c')]();return _0x17576b[_0xbe14('0x13')]['filter'](function(_0x70ed08){return _0x175213['indexOf'](_0x70ed08[_0xbe14('0x5a')])>-0x1;});}else{return _0x17576b['rows'][_0xbe14('0x58')](function(_0x21837c){return _0x21837c[_0xbe14('0x5a')]===parseInt(_0x1e5ce1['params']['id']);});}})[_0xbe14('0x8')](respondWithResult(_0x401968,null))[_0xbe14('0xc')](handleError(_0x401968,null));};exports[_0xbe14('0x5d')]=function(_0x546f22,_0x41a896){return respondWithRpcPromise(_0xbe14('0x5e'),_0x546f22[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x41a896,null))['catch'](handleError(_0x41a896,null));};exports[_0xbe14('0x5f')]=function(_0x39bc54,_0x34f90b){return respondWithRpcPromise(_0xbe14('0x60'),_0x39bc54[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x34f90b,null))[_0xbe14('0xc')](handleError(_0x34f90b,null));};exports['faxQueuesWaitingInteractions']=function(_0x2ff94c,_0x123f4f){return respondWithRpcPromise(_0xbe14('0x61'),_0x2ff94c['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x123f4f,null))[_0xbe14('0xc')](handleError(_0x123f4f,null));};exports[_0xbe14('0x62')]=function(_0x5bc52b){return function(_0xa53262,_0x1205d1){var _0x47d7bb,_0x2be969;var _0x49990b=_[_0xbe14('0x63')](_0x5bc52b);var _0x337073=_0x5bc52b==='chat'?'Website':_0xbe14('0x64');return db[_0x49990b+_0xbe14('0x65')][_0xbe14('0x66')]({'raw':!![],'where':{'id':_0xa53262['params']['id']}})[_0xbe14('0x8')](function(_0x30c03b){if(_[_0xbe14('0x12')](_0x30c03b)){throw new Error(_0x49990b+_0xbe14('0x67'));}_0x47d7bb=_0x30c03b;return db[_0x49990b+'Message']['findOne']({'where':{'id':_0xa53262[_0xbe14('0x20')][_0xbe14('0x68')]},'include':[{'model':db[_0x49990b+_0xbe14('0x69')],'as':_0xbe14('0x69')},{'model':db[_0x49990b+_0x337073],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x139aab){if(_['isNil'](_0x139aab)){throw new Error(_0x49990b+_0xbe14('0x6a'));}_0x2be969=_0x139aab;return _0x139aab['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x3a01bb={'uniqueid':_0x5bc52b+'.'+_0x2be969['id']+'.'+_0x2be969[_0xbe14('0x69')]['id'],'FromUserId':_0xa53262[_0xbe14('0x2f')]['id'],'type':'queue'};_0x3a01bb[_0x49990b+_0xbe14('0x6b')]=_0x2be969['id'];_0x3a01bb[_0x49990b+_0xbe14('0x6c')]=_0x2be969[_0xbe14('0x69')]['id'];_0x3a01bb['From'+_0x49990b+_0x337073+'Id']=_0x2be969[_0xbe14('0x64')]['id'];_0x3a01bb['To'+_0x49990b+_0xbe14('0x6d')]=_0x47d7bb['id'];return db[_0x49990b+_0xbe14('0x6e')][_0xbe14('0x6f')](_0x3a01bb);})[_0xbe14('0x8')](function(){return respondWithRpcPromise(_0xbe14('0x70'),{'channel':_0x5bc52b,'interaction':_0x2be969[_0xbe14('0x69')],'message':_0x2be969,'account':_0x2be969[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbe14('0x71'),'appdata':_0x47d7bb[_0xbe14('0x10')]+','+(_0x2be969[_0xbe14('0x64')][_0xbe14('0x72')]||0x12c),'interval':_0xbe14('0x73')}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x1205d1,null))[_0xbe14('0xc')](handleError(_0x1205d1,null));};};exports[_0xbe14('0x74')]=function(_0x1de70d,_0x30be9e){var _0x1679bd,_0x2ca6e6;if(_['isNil'](_0x1de70d[_0xbe14('0x20')]['channel'])){throw new Error(_0xbe14('0x75'));}var _0x1b8733=_0x1de70d[_0xbe14('0x20')][_0xbe14('0x76')];var _0x1d7b08=_['capitalize'](_0x1b8733);var _0x5868d7=_0x1b8733===_0xbe14('0x77')?_0xbe14('0x78'):_0xbe14('0x64');return db[_0xbe14('0x79')]['findOne']({'raw':!![],'where':{'id':_0x1de70d[_0xbe14('0x1b')]['id'],'role':_0xbe14('0x7a')}})['then'](function(_0x186225){if(_[_0xbe14('0x12')](_0x186225)){throw new Error(_0xbe14('0x7b'));}_0x1679bd=_0x186225;return db[_0x1d7b08+_0xbe14('0x7c')]['findOne']({'where':{'id':_0x1de70d[_0xbe14('0x20')]['messageId']},'include':[{'model':db[_0x1d7b08+'Interaction'],'as':_0xbe14('0x69')},{'model':db[_0x1d7b08+_0x5868d7],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x3d890b){if(_[_0xbe14('0x12')](_0x3d890b)){throw new Error(_0x1d7b08+'\x20Message\x20not\x20found');}_0x2ca6e6=_0x3d890b;return _0x3d890b[_0xbe14('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x5dc793={'uniqueid':_0x1b8733+'.'+_0x2ca6e6['id']+'.'+_0x2ca6e6['Interaction']['id'],'FromUserId':_0x1de70d[_0xbe14('0x2f')]['id'],'type':_0xbe14('0x71'),'ToUserId':_0x1679bd['id']};_0x5dc793[_0x1d7b08+'MessageId']=_0x2ca6e6['id'];_0x5dc793[_0x1d7b08+_0xbe14('0x6c')]=_0x2ca6e6['Interaction']['id'];_0x5dc793[_0xbe14('0x7e')+_0x1d7b08+_0x5868d7+'Id']=_0x2ca6e6['Account']['id'];return db[_0x1d7b08+_0xbe14('0x6e')]['create'](_0x5dc793);})[_0xbe14('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1b8733,'interaction':_0x2ca6e6[_0xbe14('0x69')],'message':_0x2ca6e6,'account':_0x2ca6e6[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1679bd['name']+','+(_0x2ca6e6[_0xbe14('0x64')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x30be9e,null))[_0xbe14('0xc')](handleError(_0x30be9e,null));}; \ No newline at end of file +var _0xdbf5=['SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','Account','QueueId','TransferReport','create','agentNotify','Website','Agent\x20not\x20found','MessageId','Start','moment','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','catch','status','json','stack','name','send','isNil','rows','find','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','query','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','interaction','user','MemberReport','findAll','INTERACTION','length','findOrCreate','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','agent','internal','capacity','telephones','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1d8aaa,_0x1c6d89){_0x1d8aaa=_0x1d8aaa-0x0;var _0x127577=_0xdbf5[_0x1d8aaa];return _0x127577;};'use strict';var BPromise=require('bluebird');var moment=require(_0x5dbf('0x0'));var _=require('lodash');var util=require('util');var db=require(_0x5dbf('0x1'))['db'];var logger=require(_0x5dbf('0x2'))(_0x5dbf('0x3'));var jayson=require(_0x5dbf('0x4'));var amiClient=jayson[_0x5dbf('0x5')][_0x5dbf('0x6')]({'port':0x232a});var mailClient=jayson[_0x5dbf('0x5')][_0x5dbf('0x6')]({'port':0x232b});var routingClient=jayson[_0x5dbf('0x5')][_0x5dbf('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){var _0x501cb1=_0x93e657?_0x93e657:amiClient;return _0x501cb1[_0x5dbf('0x7')](_0x209b7d,_0x88128e)[_0x5dbf('0x8')](function(_0x264007){if(_0x264007[_0x5dbf('0x9')]){if(_0x264007['error'][_0x5dbf('0xa')]===0x1f4){return _0x134810(_0x264007['error']['message']);}return _0x52b039(_0x264007[_0x5dbf('0x9')]['message']);}else{_0x52b039(_0x264007['result']);}})[_0x5dbf('0xb')](function(_0x490b38){_0x134810(_0x490b38);});});}function respondWithResult(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xc8;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0xc')](_0x2bb7ed)[_0x5dbf('0xd')](_0x1453a9);}return _0x182cec['sendStatus'](0x194);};}function handleError(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0x1f4;return function(_0x3480c8){logger['error'](_0x3480c8[_0x5dbf('0xe')]);if(_0x3480c8[_0x5dbf('0xf')]){delete _0x3480c8[_0x5dbf('0xf')];}_0x4803ca[_0x5dbf('0xc')](_0x2b4e1c)[_0x5dbf('0x10')](_0x3480c8);};}function findById(_0x472eb9){return function(_0x2d32cc){if(!_['isNil'](_0x472eb9)&&!_['isNil'](_0x2d32cc)&&!_[_0x5dbf('0x11')](_0x2d32cc[_0x5dbf('0x12')])){return _[_0x5dbf('0x13')](_0x2d32cc[_0x5dbf('0x12')],function(_0x20c2b0){return _0x20c2b0['id']==_0x472eb9;});}return null;};}exports['voiceChannels']=function(_0x11cd00,_0x4dd03c){return respondWithRpcPromise('VoiceChannels',_0x11cd00['query'])[_0x5dbf('0x8')](respondWithResult(_0x4dd03c,null))[_0x5dbf('0xb')](handleError(_0x4dd03c,null));};exports[_0x5dbf('0x14')]=function(_0x2ab57c,_0x1e3cce){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x5dbf('0x15')](_0x2ab57c['query'],_0x2ab57c[_0x5dbf('0x16')]))[_0x5dbf('0x8')](respondWithResult(_0x1e3cce,null))[_0x5dbf('0xb')](handleError(_0x1e3cce,null));};exports[_0x5dbf('0x17')]=function(_0x3b763c,_0x2f154e){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x5dbf('0x15')](_0x3b763c[_0x5dbf('0x18')],_0x3b763c[_0x5dbf('0x16')]))[_0x5dbf('0x8')](respondWithResult(_0x2f154e,null))[_0x5dbf('0xb')](handleError(_0x2f154e,null));};exports[_0x5dbf('0x19')]=function(_0x290456,_0x20ab1b){return respondWithRpcPromise(_0x5dbf('0x1a'),_0x290456[_0x5dbf('0x18')])[_0x5dbf('0x8')](respondWithResult(_0x20ab1b,null))[_0x5dbf('0xb')](handleError(_0x20ab1b,null));};exports[_0x5dbf('0x1b')]=function(_0x407741,_0x729d8f){return respondWithRpcPromise(_0x5dbf('0x1a'),_0x407741[_0x5dbf('0x18')])[_0x5dbf('0x8')](findById(_0x407741[_0x5dbf('0x16')]['id']))[_0x5dbf('0x8')](respondWithResult(_0x729d8f,null))[_0x5dbf('0xb')](handleError(_0x729d8f,null));};exports[_0x5dbf('0x1c')]=function(_0x21cd00,_0x5768b7){return respondWithRpcPromise(_0x5dbf('0x1d'),_[_0x5dbf('0x15')](_0x21cd00[_0x5dbf('0x1e')],_0x21cd00[_0x5dbf('0x16')]))[_0x5dbf('0x8')](respondWithResult(_0x5768b7,null))[_0x5dbf('0xb')](handleError(_0x5768b7,null));};exports[_0x5dbf('0x1f')]=function(_0x31d57a,_0x406ce6){return respondWithRpcPromise(_0x5dbf('0x20'),_[_0x5dbf('0x15')](_0x31d57a['query'],_0x31d57a['params']))[_0x5dbf('0x8')](respondWithResult(_0x406ce6,null))[_0x5dbf('0xb')](handleError(_0x406ce6,null));};exports[_0x5dbf('0x21')]=function(_0x3b73ad,_0x37cf25){return respondWithRpcPromise('VoiceQueuesChannels',_0x3b73ad['query'])[_0x5dbf('0x8')](respondWithResult(_0x37cf25,null))[_0x5dbf('0xb')](handleError(_0x37cf25,null));};exports['voiceQueuesChannel']=function(_0x3531a2,_0x2a0491){return respondWithRpcPromise(_0x5dbf('0x22'),_[_0x5dbf('0x15')](_0x3531a2[_0x5dbf('0x18')],_0x3531a2['params']))[_0x5dbf('0x8')](respondWithResult(_0x2a0491,null))[_0x5dbf('0xb')](handleError(_0x2a0491,null));};exports[_0x5dbf('0x23')]=function(_0x273577,_0x3a8196){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x5dbf('0x15')](_0x273577[_0x5dbf('0x18')],_0x273577[_0x5dbf('0x16')]))[_0x5dbf('0x8')](respondWithResult(_0x3a8196,null))['catch'](handleError(_0x3a8196,null));};exports[_0x5dbf('0x24')]=function(_0x1e9a4e,_0x302dda){return respondWithRpcPromise(_0x5dbf('0x25'),_[_0x5dbf('0x15')](_0x1e9a4e[_0x5dbf('0x18')],_0x1e9a4e[_0x5dbf('0x16')]))[_0x5dbf('0x8')](respondWithResult(_0x302dda,null))[_0x5dbf('0xb')](handleError(_0x302dda,null));};exports[_0x5dbf('0x26')]=function(_0x1ba835,_0x51c667){return respondWithRpcPromise(_0x5dbf('0x27'),_0x1ba835[_0x5dbf('0x18')])[_0x5dbf('0x8')](respondWithResult(_0x51c667,null))['catch'](handleError(_0x51c667,null));};exports[_0x5dbf('0x28')]=function(_0x43954b,_0x2e4e67){return respondWithRpcPromise('OutboundChannels',_0x43954b[_0x5dbf('0x18')])[_0x5dbf('0x8')](respondWithResult(_0x2e4e67,null))[_0x5dbf('0xb')](handleError(_0x2e4e67,null));};exports['agents']=function(_0x4527fb,_0x29a62d){var _0x2ac162;return respondWithRpcPromise(_0x5dbf('0x29'),_0x4527fb[_0x5dbf('0x18')])[_0x5dbf('0x8')](function(_0x321ae3){_0x2ac162=_0x321ae3;return respondWithRpcPromise(_0x5dbf('0x29'),_0x4527fb['query'],routingClient);})['then'](function(_0x57ee72){return _['merge']({},_0x57ee72,_0x2ac162);})[_0x5dbf('0x8')](respondWithResult(_0x29a62d,null))[_0x5dbf('0xb')](handleError(_0x29a62d,null));};exports['agentCapacity']=function(_0x3ef0eb,_0x229abf){if(_0x3ef0eb['body']&&_0x3ef0eb[_0x5dbf('0x1e')][_0x5dbf('0x2a')]&&_0x3ef0eb[_0x5dbf('0x2b')]&&_0x3ef0eb[_0x5dbf('0x2b')][_0x5dbf('0xf')]){for(var _0x7c390d in _0x3ef0eb[_0x5dbf('0x1e')][_0x5dbf('0x2a')]){if(_0x3ef0eb[_0x5dbf('0x1e')][_0x5dbf('0x2a')]['hasOwnProperty'](_0x7c390d)){db[_0x5dbf('0x2c')][_0x5dbf('0x2d')]({'where':{'channel':_0x7c390d,'membername':_0x3ef0eb[_0x5dbf('0x2b')]['name'],'type':_0x5dbf('0x2e'),'exitAt':null,'uniqueid':_0x3ef0eb[_0x5dbf('0x1e')][_0x5dbf('0x2a')][_0x7c390d]&&_0x3ef0eb[_0x5dbf('0x1e')]['interaction'][_0x7c390d][_0x5dbf('0x2f')]?{'$notIn':_0x3ef0eb['body'][_0x5dbf('0x2a')][_0x7c390d]}:{'$ne':null}}})[_0x5dbf('0x8')](function(_0x2d046b){var _0xcc1815=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x118ae6=0x0,_0x43f5e8=_0x2d046b[_0x5dbf('0x2f')];_0x118ae6<_0x43f5e8;_0x118ae6+=0x1){_0x2d046b[_0x118ae6]['updateAttributes']({'exitAt':_0xcc1815});}});for(var _0x2e241d=0x0;_0x2e241d<_0x3ef0eb['body']['interaction'][_0x7c390d]['length'];_0x2e241d+=0x1){db['MemberReport'][_0x5dbf('0x30')]({'where':{'channel':_0x7c390d,'membername':_0x3ef0eb[_0x5dbf('0x2b')]['name'],'type':_0x5dbf('0x2e'),'uniqueid':_0x3ef0eb[_0x5dbf('0x1e')]['interaction'][_0x7c390d][_0x2e241d],'exitAt':null},'defaults':{'channel':_0x7c390d,'membername':_0x3ef0eb[_0x5dbf('0x2b')][_0x5dbf('0xf')],'interface':_['isNil'](_0x3ef0eb[_0x5dbf('0x2b')]['interface'])?util['format'](_0x5dbf('0x31'),_0x3ef0eb[_0x5dbf('0x2b')][_0x5dbf('0xf')]):_0x3ef0eb['user']['interface'],'type':_0x5dbf('0x2e'),'enterAt':moment()[_0x5dbf('0x32')](_0x5dbf('0x33')),'role':_0x5dbf('0x34'),'internal':_0x3ef0eb[_0x5dbf('0x2b')][_0x5dbf('0x35')],'uniqueid':_0x3ef0eb[_0x5dbf('0x1e')][_0x5dbf('0x2a')][_0x7c390d][_0x2e241d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3ef0eb[_0x5dbf('0x16')]['id'],'capacity':_0x3ef0eb[_0x5dbf('0x1e')][_0x5dbf('0x36')]},routingClient)[_0x5dbf('0x8')](respondWithResult(_0x229abf,null))[_0x5dbf('0xb')](handleError(_0x229abf,null));};exports[_0x5dbf('0x37')]=function(_0x328dc5,_0x59f825){return respondWithRpcPromise(_0x5dbf('0x38'),_0x328dc5['query'])[_0x5dbf('0x8')](respondWithResult(_0x59f825,null))[_0x5dbf('0xb')](handleError(_0x59f825,null));};exports[_0x5dbf('0x39')]=function(_0x770c54,_0x78ab84){return respondWithRpcPromise(_0x5dbf('0x3a'),_0x770c54[_0x5dbf('0x18')])['then'](respondWithResult(_0x78ab84,null))['catch'](handleError(_0x78ab84,null));};exports['campaigns']=function(_0x1e1876,_0xfdacc7){return respondWithRpcPromise(_0x5dbf('0x3b'),_0x1e1876['query'])['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0xb')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x3c')]=function(_0x344df5,_0x5d70cc){return respondWithRpcPromise(_0x5dbf('0x3d'),_0x344df5['query'],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x5d70cc,null))[_0x5dbf('0xb')](handleError(_0x5d70cc,null));};exports[_0x5dbf('0x3e')]=function(_0x5da14b,_0x55fd51){return respondWithRpcPromise(_0x5dbf('0x3d'),_0x5da14b[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](findById(_0x5da14b[_0x5dbf('0x16')]['id']))['then'](respondWithResult(_0x55fd51,null))[_0x5dbf('0xb')](handleError(_0x55fd51,null));};exports[_0x5dbf('0x3f')]=function(_0x478cc1,_0x5485f3){return respondWithRpcPromise(_0x5dbf('0x40'),_0x478cc1[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x5485f3,null))[_0x5dbf('0xb')](handleError(_0x5485f3,null));};exports[_0x5dbf('0x41')]=function(_0x4711d5,_0x50a029){return respondWithRpcPromise(_0x5dbf('0x40'),_0x4711d5['query'],routingClient)['then'](findById(_0x4711d5['params']['id']))[_0x5dbf('0x8')](respondWithResult(_0x50a029,null))['catch'](handleError(_0x50a029,null));};exports[_0x5dbf('0x42')]=function(_0x275c1d,_0x1c60ac){return respondWithRpcPromise(_0x5dbf('0x43'),_0x275c1d[_0x5dbf('0x18')],mailClient)[_0x5dbf('0x8')](respondWithResult(_0x1c60ac,null))[_0x5dbf('0xb')](handleError(_0x1c60ac,null));};exports[_0x5dbf('0x44')]=function(_0x2c84d6,_0x1d91de){return respondWithRpcPromise(_0x5dbf('0x45'),_0x2c84d6[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x1d91de,null))[_0x5dbf('0xb')](handleError(_0x1d91de,null));};exports[_0x5dbf('0x46')]=function(_0x53ab1a,_0x3fbc3d){return respondWithRpcPromise('OpenchannelQueues',_0x53ab1a[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](findById(_0x53ab1a[_0x5dbf('0x16')]['id']))[_0x5dbf('0x8')](respondWithResult(_0x3fbc3d,null))['catch'](handleError(_0x3fbc3d,null));};exports[_0x5dbf('0x47')]=function(_0x1ade34,_0x4362c6){return respondWithRpcPromise(_0x5dbf('0x48'),_0x1ade34[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x4362c6,null))['catch'](handleError(_0x4362c6,null));};exports[_0x5dbf('0x49')]=function(_0x3e5a96,_0x3b0465){return respondWithRpcPromise(_0x5dbf('0x48'),_0x3e5a96[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](findById(_0x3e5a96[_0x5dbf('0x16')]['id']))[_0x5dbf('0x8')](respondWithResult(_0x3b0465,null))[_0x5dbf('0xb')](handleError(_0x3b0465,null));};exports[_0x5dbf('0x4a')]=function(_0x13c8ab,_0x2997a8){return respondWithRpcPromise('WhatsappQueues',_0x13c8ab['query'],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x2997a8,null))[_0x5dbf('0xb')](handleError(_0x2997a8,null));};exports[_0x5dbf('0x4b')]=function(_0x110713,_0xc000ee){return respondWithRpcPromise(_0x5dbf('0x4c'),_0x110713[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](findById(_0x110713[_0x5dbf('0x16')]['id']))['then'](respondWithResult(_0xc000ee,null))['catch'](handleError(_0xc000ee,null));};exports['faxQueues']=function(_0x4f4aa3,_0x408b51){return respondWithRpcPromise(_0x5dbf('0x4d'),_0x4f4aa3[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x408b51,null))[_0x5dbf('0xb')](handleError(_0x408b51,null));};exports[_0x5dbf('0x4e')]=function(_0x5331ff,_0x5bb990){return respondWithRpcPromise(_0x5dbf('0x4d'),_0x5331ff[_0x5dbf('0x18')],routingClient)['then'](findById(_0x5331ff[_0x5dbf('0x16')]['id']))[_0x5dbf('0x8')](respondWithResult(_0x5bb990,null))[_0x5dbf('0xb')](handleError(_0x5bb990,null));};exports[_0x5dbf('0x4f')]=function(_0x569d9c,_0x431f08){return respondWithRpcPromise(_0x5dbf('0x50'),_0x569d9c[_0x5dbf('0x18')])[_0x5dbf('0x8')](respondWithResult(_0x431f08,null))[_0x5dbf('0xb')](handleError(_0x431f08,null));};exports['chatQueuesWaitingInteractions']=function(_0x42478c,_0x3fce29){return respondWithRpcPromise(_0x5dbf('0x51'),_0x42478c[_0x5dbf('0x18')],routingClient)['then'](respondWithResult(_0x3fce29,null))[_0x5dbf('0xb')](handleError(_0x3fce29,null));};exports['mailQueuesWaitingInteractions']=function(_0x2ba37f,_0x118e56){return respondWithRpcPromise(_0x5dbf('0x52'),_0x2ba37f['query'],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x118e56,null))[_0x5dbf('0xb')](handleError(_0x118e56,null));};exports[_0x5dbf('0x53')]=function(_0x1270f3,_0x50db0b){return respondWithRpcPromise(_0x5dbf('0x54'),_0x1270f3[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x50db0b,null))[_0x5dbf('0xb')](handleError(_0x50db0b,null));};exports[_0x5dbf('0x55')]=function(_0xf84095,_0x560d62){return respondWithRpcPromise(_0x5dbf('0x54'),_0xf84095[_0x5dbf('0x18')],routingClient)['then'](function(_0x30469c){if(_0xf84095[_0x5dbf('0x18')][_0x5dbf('0x56')]!==undefined){var _0x3457de=_(_0x30469c[_0x5dbf('0x12')])[_0x5dbf('0x57')]([_0xf84095[_0x5dbf('0x18')][_0x5dbf('0x56')],_0xf84095[_0x5dbf('0x16')]['id']])[_0x5dbf('0x58')](_0x5dbf('0x59'))[_0x5dbf('0x5a')]()[_0x5dbf('0x5b')]();return _0x30469c[_0x5dbf('0x12')][_0x5dbf('0x57')](function(_0x37c1a3){return _0x3457de['indexOf'](_0x37c1a3[_0x5dbf('0x59')])>-0x1;});}else{return _0x30469c[_0x5dbf('0x12')][_0x5dbf('0x57')](function(_0x2e7115){return _0x2e7115['queue_id']===parseInt(_0xf84095[_0x5dbf('0x16')]['id']);});}})[_0x5dbf('0x8')](respondWithResult(_0x560d62,null))[_0x5dbf('0xb')](handleError(_0x560d62,null));};exports[_0x5dbf('0x5c')]=function(_0x1ccdae,_0x525930){return respondWithRpcPromise(_0x5dbf('0x5d'),_0x1ccdae[_0x5dbf('0x18')],routingClient)['then'](respondWithResult(_0x525930,null))['catch'](handleError(_0x525930,null));};exports[_0x5dbf('0x5e')]=function(_0x39c0a7,_0x1efe3f){return respondWithRpcPromise(_0x5dbf('0x5f'),_0x39c0a7[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x1efe3f,null))[_0x5dbf('0xb')](handleError(_0x1efe3f,null));};exports['faxQueuesWaitingInteractions']=function(_0x310078,_0x3b01c0){return respondWithRpcPromise(_0x5dbf('0x60'),_0x310078[_0x5dbf('0x18')],routingClient)[_0x5dbf('0x8')](respondWithResult(_0x3b01c0,null))[_0x5dbf('0xb')](handleError(_0x3b01c0,null));};exports['queueNotify']=function(_0x625875){return function(_0x2a0c11,_0x43ca42){var _0x2c5a6e,_0x255ab0;var _0x5a27d2=_[_0x5dbf('0x61')](_0x625875);var _0x550bd1=_0x625875==='chat'?'Website':'Account';return db[_0x5a27d2+_0x5dbf('0x62')][_0x5dbf('0x63')]({'raw':!![],'where':{'id':_0x2a0c11[_0x5dbf('0x16')]['id']}})[_0x5dbf('0x8')](function(_0x4333db){if(_['isNil'](_0x4333db)){throw new Error(_0x5a27d2+'\x20Queue\x20not\x20found');}_0x2c5a6e=_0x4333db;return db[_0x5a27d2+_0x5dbf('0x64')]['findOne']({'where':{'id':_0x2a0c11[_0x5dbf('0x1e')][_0x5dbf('0x65')]},'include':[{'model':db[_0x5a27d2+'Interaction'],'as':_0x5dbf('0x66')},{'model':db[_0x5a27d2+_0x550bd1],'as':'Account'}]});})[_0x5dbf('0x8')](function(_0x24d90a){if(_[_0x5dbf('0x11')](_0x24d90a)){throw new Error(_0x5a27d2+_0x5dbf('0x67'));}_0x255ab0=_0x24d90a;return _0x24d90a[_0x5dbf('0x68')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x22b520={'uniqueid':_0x625875+'.'+_0x255ab0['id']+'.'+_0x255ab0[_0x5dbf('0x66')]['id'],'FromUserId':_0x2a0c11[_0x5dbf('0x2b')]['id'],'type':_0x5dbf('0x69')};_0x22b520[_0x5a27d2+'MessageId']=_0x255ab0['id'];_0x22b520[_0x5a27d2+_0x5dbf('0x6a')]=_0x255ab0[_0x5dbf('0x66')]['id'];_0x22b520[_0x5dbf('0x6b')+_0x5a27d2+_0x550bd1+'Id']=_0x255ab0[_0x5dbf('0x6c')]['id'];_0x22b520['To'+_0x5a27d2+_0x5dbf('0x6d')]=_0x2c5a6e['id'];return db[_0x5a27d2+_0x5dbf('0x6e')][_0x5dbf('0x6f')](_0x22b520);})[_0x5dbf('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x625875,'interaction':_0x255ab0['Interaction'],'message':_0x255ab0,'account':_0x255ab0[_0x5dbf('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5dbf('0x69'),'appdata':_0x2c5a6e[_0x5dbf('0xf')]+','+(_0x255ab0['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x5dbf('0x8')](respondWithResult(_0x43ca42,null))[_0x5dbf('0xb')](handleError(_0x43ca42,null));};};exports[_0x5dbf('0x70')]=function(_0x4713b4,_0x12757d){var _0x13fcf5,_0x5ba5bb;if(_[_0x5dbf('0x11')](_0x4713b4[_0x5dbf('0x1e')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x289cc1=_0x4713b4['body']['channel'];var _0x3a27c4=_[_0x5dbf('0x61')](_0x289cc1);var _0x3722b9=_0x289cc1==='chat'?_0x5dbf('0x71'):_0x5dbf('0x6c');return db['User'][_0x5dbf('0x63')]({'raw':!![],'where':{'id':_0x4713b4[_0x5dbf('0x16')]['id'],'role':_0x5dbf('0x34')}})[_0x5dbf('0x8')](function(_0x7957cb){if(_[_0x5dbf('0x11')](_0x7957cb)){throw new Error(_0x5dbf('0x72'));}_0x13fcf5=_0x7957cb;return db[_0x3a27c4+_0x5dbf('0x64')]['findOne']({'where':{'id':_0x4713b4['body']['messageId']},'include':[{'model':db[_0x3a27c4+_0x5dbf('0x66')],'as':_0x5dbf('0x66')},{'model':db[_0x3a27c4+_0x3722b9],'as':_0x5dbf('0x6c')}]});})[_0x5dbf('0x8')](function(_0x400d98){if(_[_0x5dbf('0x11')](_0x400d98)){throw new Error(_0x3a27c4+_0x5dbf('0x67'));}_0x5ba5bb=_0x400d98;return _0x400d98[_0x5dbf('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5dbf('0x8')](function(){var _0x990814={'uniqueid':_0x289cc1+'.'+_0x5ba5bb['id']+'.'+_0x5ba5bb['Interaction']['id'],'FromUserId':_0x4713b4[_0x5dbf('0x2b')]['id'],'type':_0x5dbf('0x69'),'ToUserId':_0x13fcf5['id']};_0x990814[_0x3a27c4+_0x5dbf('0x73')]=_0x5ba5bb['id'];_0x990814[_0x3a27c4+_0x5dbf('0x6a')]=_0x5ba5bb[_0x5dbf('0x66')]['id'];_0x990814[_0x5dbf('0x6b')+_0x3a27c4+_0x3722b9+'Id']=_0x5ba5bb[_0x5dbf('0x6c')]['id'];return db[_0x3a27c4+_0x5dbf('0x6e')]['create'](_0x990814);})['then'](function(){return respondWithRpcPromise(_0x5dbf('0x74'),{'channel':_0x289cc1,'interaction':_0x5ba5bb['Interaction'],'message':_0x5ba5bb,'account':_0x5ba5bb['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x5dbf('0x34'),'appdata':_0x13fcf5['name']+','+(_0x5ba5bb['Account']['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x5dbf('0x8')](respondWithResult(_0x12757d,null))['catch'](handleError(_0x12757d,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a8da8cd..f59617e 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 _0xe0b7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','run','post','create','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x58466e,_0x3fcaaa){var _0x3ce485=function(_0xfa47f8){while(--_0xfa47f8){_0x58466e['push'](_0x58466e['shift']());}};_0x3ce485(++_0x3fcaaa);}(_0xe0b7,0x119));var _0x7e0b=function(_0x2d3fc7,_0x29ecff){_0x2d3fc7=_0x2d3fc7-0x0;var _0x534a06=_0xe0b7[_0x2d3fc7];return _0x534a06;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e0b('0x0'));var timeout=require(_0x7e0b('0x1'));var express=require(_0x7e0b('0x2'));var router=express[_0x7e0b('0x3')]();var fs_extra=require(_0x7e0b('0x4'));var auth=require(_0x7e0b('0x5'));var interaction=require(_0x7e0b('0x6'));var config=require(_0x7e0b('0x7'));var controller=require('./schedule.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7e0b('0x8')]);router[_0x7e0b('0x9')](_0x7e0b('0xa'),auth[_0x7e0b('0xb')](),controller[_0x7e0b('0xc')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x7e0b('0xd')]);router[_0x7e0b('0xe')]('/',auth[_0x7e0b('0xb')](),controller[_0x7e0b('0xf')]);router['put'](_0x7e0b('0xa'),auth[_0x7e0b('0xb')](),controller[_0x7e0b('0x10')]);router[_0x7e0b('0x11')](_0x7e0b('0xa'),auth[_0x7e0b('0xb')](),controller['destroy']);module[_0x7e0b('0x12')]=router; \ No newline at end of file +var _0x07d0=['post','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x07d0,0x15a));var _0x007d=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x07d0[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0x007d('0x0'));var util=require(_0x007d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x007d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x007d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x007d('0x4'));router['get']('/',auth[_0x007d('0x5')](),controller[_0x007d('0x6')]);router[_0x007d('0x7')](_0x007d('0x8'),auth[_0x007d('0x5')](),controller[_0x007d('0x9')]);router['get'](_0x007d('0xa'),auth[_0x007d('0x5')](),controller['run']);router[_0x007d('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x007d('0xc')](_0x007d('0x8'),auth[_0x007d('0x5')](),controller[_0x007d('0xd')]);router[_0x007d('0xe')]('/:id',auth[_0x007d('0x5')](),controller[_0x007d('0xf')]);module[_0x007d('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 9055f99..e066027 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 _0x7e2f=['minutes','ENUM','csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','quarters','months','days','hours'];(function(_0x144c33,_0x4f7860){var _0x5e6f01=function(_0x482e8e){while(--_0x482e8e){_0x144c33['push'](_0x144c33['shift']());}};_0x5e6f01(++_0x4f7860);}(_0x7e2f,0x136));var _0xf7e2=function(_0xc28702,_0x145b87){_0xc28702=_0xc28702-0x0;var _0x3b6e9e=_0x7e2f[_0xc28702];return _0x3b6e9e;};'use strict';var Sequelize=require(_0xf7e2('0x0'));module[_0xf7e2('0x1')]={'name':{'type':Sequelize[_0xf7e2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf7e2('0x2')]},'active':{'type':Sequelize[_0xf7e2('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf7e2('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xf7e2('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf7e2('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf7e2('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xf7e2('0x6'),_0xf7e2('0x7'),'weeks',_0xf7e2('0x8'),_0xf7e2('0x9'),_0xf7e2('0xa')),'allowNull':![],'defaultValue':_0xf7e2('0x8')},'output':{'type':Sequelize[_0xf7e2('0xb')](_0xf7e2('0xc'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xf7e2('0xc')},'type':{'type':Sequelize[_0xf7e2('0xb')](_0xf7e2('0xd'),_0xf7e2('0xe')),'allowNull':![],'defaultValue':_0xf7e2('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf7e2('0xf')]},'bcc':{'type':Sequelize[_0xf7e2('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xf7e2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa9a2=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','csv','pdf','xlsx','custom','default','TEXT','exports'];(function(_0x176794,_0x64b705){var _0x3f4dfe=function(_0x274673){while(--_0x274673){_0x176794['push'](_0x176794['shift']());}};_0x3f4dfe(++_0x64b705);}(_0xa9a2,0x1e5));var _0x2a9a=function(_0x31fed9,_0x30dd29){_0x31fed9=_0x31fed9-0x0;var _0x11e83c=_0xa9a2[_0x31fed9];return _0x11e83c;};'use strict';var Sequelize=require('sequelize');module[_0x2a9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2a9a('0x1')]},'active':{'type':Sequelize[_0x2a9a('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2a9a('0x1')],'allowNull':![],'defaultValue':_0x2a9a('0x3')},'startAt':{'type':Sequelize[_0x2a9a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2a9a('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2a9a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2a9a('0x6')](_0x2a9a('0x7'),_0x2a9a('0x8'),'months',_0x2a9a('0x9'),_0x2a9a('0xa'),_0x2a9a('0xb'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x2a9a('0xc'),_0x2a9a('0xd'),_0x2a9a('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x2a9a('0x6')](_0x2a9a('0xf'),_0x2a9a('0x10')),'allowNull':![],'defaultValue':_0x2a9a('0xf')},'sendMail':{'type':Sequelize[_0x2a9a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2a9a('0x1')]},'cc':{'type':Sequelize[_0x2a9a('0x11')]},'bcc':{'type':Sequelize[_0x2a9a('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x2a9a('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 31fa869..5d25e28 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 _0x9501=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','Scheduler','sendStatus','stack','name','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','filter','Schedule','include','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9501,0x147));var _0x1950=function(_0x4b5a6b,_0x5234cb){_0x4b5a6b=_0x4b5a6b-0x0;var _0xaf0a92=_0x9501[_0x4b5a6b];return _0xaf0a92;};'use strict';var emlformat=require(_0x1950('0x0'));var rimraf=require(_0x1950('0x1'));var zipdir=require(_0x1950('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1950('0x3'));var moment=require('moment');var BPromise=require(_0x1950('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1950('0x5'));var sox=require('sox');var csv=require(_0x1950('0x6'));var ejs=require(_0x1950('0x7'));var fs=require('fs');var fs_extra=require(_0x1950('0x8'));var _=require(_0x1950('0x9'));var squel=require(_0x1950('0xa'));var crypto=require(_0x1950('0xb'));var jsforce=require(_0x1950('0xc'));var deskjs=require(_0x1950('0xd'));var toCsv=require(_0x1950('0x6'));var querystring=require(_0x1950('0xe'));var Papa=require(_0x1950('0xf'));var Redis=require(_0x1950('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1950('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1950('0x12'));var logger=require(_0x1950('0x13'))(_0x1950('0x14'));var utils=require(_0x1950('0x15'));var config=require(_0x1950('0x16'));var licenseUtil=require(_0x1950('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218418,_0x3c2c55){_0x3c2c55=_0x3c2c55||0xcc;return function(_0x587ae7){if(_0x587ae7){return _0x218418['sendStatus'](_0x3c2c55);}return _0x218418[_0x1950('0x18')](_0x3c2c55)[_0x1950('0x19')]();};}function respondWithResult(_0x5104a1,_0x5c43ed){_0x5c43ed=_0x5c43ed||0xc8;return function(_0x2314a8){if(_0x2314a8){return _0x5104a1[_0x1950('0x18')](_0x5c43ed)[_0x1950('0x1a')](_0x2314a8);}};}function respondWithFilteredResult(_0x3d803a,_0x40954c){return function(_0x2e0419){if(_0x2e0419){var _0x525cec=typeof _0x40954c[_0x1950('0x1b')]===_0x1950('0x1c')&&typeof _0x40954c[_0x1950('0x1d')]==='undefined';var _0x544503=_0x2e0419[_0x1950('0x1e')];var _0x45ff69=_0x525cec?0x0:_0x40954c[_0x1950('0x1b')];var _0x251343=_0x525cec?_0x2e0419['count']:_0x40954c[_0x1950('0x1b')]+_0x40954c[_0x1950('0x1d')];var _0x2c47d9;if(_0x251343>=_0x544503){_0x251343=_0x544503;_0x2c47d9=0xc8;}else{_0x2c47d9=0xce;}_0x3d803a['status'](_0x2c47d9);return _0x3d803a[_0x1950('0x1f')](_0x1950('0x20'),_0x45ff69+'-'+_0x251343+'/'+_0x544503)[_0x1950('0x1a')](_0x2e0419);}return null;};}function patchUpdates(_0x2d29a3){return function(_0x4a1844){try{jsonpatch[_0x1950('0x21')](_0x4a1844,_0x2d29a3,!![]);}catch(_0x175d76){return BPromise[_0x1950('0x22')](_0x175d76);}return _0x4a1844[_0x1950('0x23')]();};}function saveUpdates(_0x138bca,_0xe4e7cb){return function(_0x57d9eb){if(_0x57d9eb){return _0x57d9eb[_0x1950('0x24')](_0x138bca)[_0x1950('0x25')](function(_0x5c000d){return _0x5c000d;});}return null;};}function removeEntity(_0x432c2a,_0x13deba){return function(_0x2ede2a){if(_0x2ede2a){return _0x2ede2a['destroy']()[_0x1950('0x25')](function(){var _0x24ad38=_0x2ede2a['get']({'plain':!![]});var _0x106cd3=_0x1950('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x106cd3,'resourceId':_0x24ad38['id']}})[_0x1950('0x25')](function(){return _0x2ede2a;});})['then'](function(){_0x432c2a[_0x1950('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6ebc,_0x4ab73b){return function(_0x109476){if(!_0x109476){_0x5e6ebc[_0x1950('0x27')](0x194);}return _0x109476;};}function handleError(_0x36f3e4,_0x5642e2){_0x5642e2=_0x5642e2||0x1f4;return function(_0x55995f){logger['error'](_0x55995f[_0x1950('0x28')]);if(_0x55995f[_0x1950('0x29')]){delete _0x55995f['name'];}_0x36f3e4[_0x1950('0x18')](_0x5642e2)['send'](_0x55995f);};}exports['index']=function(_0x123b68,_0x28a99b){var _0x9329d5={},_0x1060bf={},_0x1ac490={'count':0x0,'rows':[]};var _0x31304a=_[_0x1950('0x2a')](db['Schedule']['rawAttributes'],function(_0x3280a9){return{'name':_0x3280a9[_0x1950('0x2b')],'type':_0x3280a9[_0x1950('0x2c')][_0x1950('0x2d')]};});_0x1060bf[_0x1950('0x2e')]=_[_0x1950('0x2a')](_0x31304a,_0x1950('0x29'));_0x1060bf[_0x1950('0x2f')]=_[_0x1950('0x30')](_0x123b68[_0x1950('0x2f')]);_0x1060bf['filters']=_[_0x1950('0x31')](_0x1060bf[_0x1950('0x2e')],_0x1060bf[_0x1950('0x2f')]);_0x9329d5[_0x1950('0x32')]=_[_0x1950('0x31')](_0x1060bf['model'],qs['fields'](_0x123b68[_0x1950('0x2f')][_0x1950('0x33')]));_0x9329d5['attributes']=_0x9329d5[_0x1950('0x32')][_0x1950('0x34')]?_0x9329d5[_0x1950('0x32')]:_0x1060bf[_0x1950('0x2e')];if(!_0x123b68[_0x1950('0x2f')][_0x1950('0x35')](_0x1950('0x36'))){_0x9329d5[_0x1950('0x1d')]=qs['limit'](_0x123b68[_0x1950('0x2f')][_0x1950('0x1d')]);_0x9329d5['offset']=qs['offset'](_0x123b68['query']['offset']);}_0x9329d5['order']=qs[_0x1950('0x37')](_0x123b68[_0x1950('0x2f')][_0x1950('0x37')]);_0x9329d5[_0x1950('0x38')]=qs[_0x1950('0x39')](_['pick'](_0x123b68[_0x1950('0x2f')],_0x1060bf[_0x1950('0x39')]),_0x31304a);if(_0x123b68[_0x1950('0x2f')]['filter']){_0x9329d5[_0x1950('0x38')]=_['merge'](_0x9329d5['where'],{'$or':_[_0x1950('0x2a')](_0x31304a,function(_0x21a93d){if(_0x21a93d['type']!==_0x1950('0x3a')){var _0x3d8e8d={};_0x3d8e8d[_0x21a93d[_0x1950('0x29')]]={'$like':'%'+_0x123b68[_0x1950('0x2f')][_0x1950('0x3b')]+'%'};return _0x3d8e8d;}})});}_0x9329d5=_['merge']({},_0x9329d5,_0x123b68['options']);var _0x52894d={'where':_0x9329d5['where']};return db[_0x1950('0x3c')][_0x1950('0x1e')](_0x52894d)[_0x1950('0x25')](function(_0x350f96){_0x1ac490[_0x1950('0x1e')]=_0x350f96;if(_0x123b68[_0x1950('0x2f')]['includeAll']){_0x9329d5[_0x1950('0x3d')]=[{'all':!![]}];}return db[_0x1950('0x3c')][_0x1950('0x3e')](_0x9329d5);})[_0x1950('0x25')](function(_0x359210){_0x1ac490[_0x1950('0x3f')]=_0x359210;return _0x1ac490;})[_0x1950('0x25')](respondWithFilteredResult(_0x28a99b,_0x9329d5))[_0x1950('0x40')](handleError(_0x28a99b,null));};exports[_0x1950('0x41')]=function(_0x416a78,_0x21af1c){var _0x17c617={'raw':![],'where':{'id':_0x416a78[_0x1950('0x42')]['id']}},_0xd5b92b={};_0xd5b92b['model']=_['keys'](db[_0x1950('0x3c')][_0x1950('0x43')]);_0xd5b92b[_0x1950('0x2f')]=_[_0x1950('0x30')](_0x416a78[_0x1950('0x2f')]);_0xd5b92b[_0x1950('0x39')]=_['intersection'](_0xd5b92b[_0x1950('0x2e')],_0xd5b92b['query']);_0x17c617['attributes']=_[_0x1950('0x31')](_0xd5b92b[_0x1950('0x2e')],qs['fields'](_0x416a78['query'][_0x1950('0x33')]));_0x17c617['attributes']=_0x17c617[_0x1950('0x32')][_0x1950('0x34')]?_0x17c617[_0x1950('0x32')]:_0xd5b92b[_0x1950('0x2e')];if(_0x416a78[_0x1950('0x2f')][_0x1950('0x44')]){_0x17c617[_0x1950('0x3d')]=[{'all':!![]}];}_0x17c617=_[_0x1950('0x45')]({},_0x17c617,_0x416a78[_0x1950('0x46')]);return db[_0x1950('0x3c')][_0x1950('0x47')](_0x17c617)['then'](handleEntityNotFound(_0x21af1c,null))['then'](respondWithResult(_0x21af1c,null))[_0x1950('0x40')](handleError(_0x21af1c,null));};exports[_0x1950('0x48')]=function(_0x43fa92,_0x137e7c){return db[_0x1950('0x3c')][_0x1950('0x48')](_0x43fa92[_0x1950('0x49')],{})[_0x1950('0x25')](function(_0x1a0225){var _0x24ec8f=_0x43fa92[_0x1950('0x4a')][_0x1950('0x4b')]({'plain':!![]});if(!_0x24ec8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24ec8f[_0x1950('0x4c')]===_0x1950('0x4a')){var _0x150bf6=_0x1a0225['get']({'plain':!![]});var _0x64483a=_0x1950('0x26');return db[_0x1950('0x4d')][_0x1950('0x47')]({'where':{'name':_0x64483a,'userProfileId':_0x24ec8f[_0x1950('0x4e')]},'raw':!![]})[_0x1950('0x25')](function(_0x34ecff){if(_0x34ecff&&_0x34ecff[_0x1950('0x4f')]===0x0){return db['UserProfileResource'][_0x1950('0x48')]({'name':_0x150bf6[_0x1950('0x29')],'resourceId':_0x150bf6['id'],'type':_0x34ecff[_0x1950('0x29')],'sectionId':_0x34ecff['id']},{})[_0x1950('0x25')](function(){return _0x1a0225;});}else{return _0x1a0225;}})[_0x1950('0x40')](function(_0x40657f){logger[_0x1950('0x50')](_0x1950('0x51'),_0x40657f);throw _0x40657f;});}return _0x1a0225;})[_0x1950('0x25')](respondWithResult(_0x137e7c,0xc9))[_0x1950('0x40')](handleError(_0x137e7c,null));};exports[_0x1950('0x24')]=function(_0x3bff54,_0x136fe2){if(_0x3bff54['body']['id']){delete _0x3bff54[_0x1950('0x49')]['id'];}return db[_0x1950('0x3c')][_0x1950('0x47')]({'where':{'id':_0x3bff54[_0x1950('0x42')]['id']}})[_0x1950('0x25')](handleEntityNotFound(_0x136fe2,null))[_0x1950('0x25')](saveUpdates(_0x3bff54[_0x1950('0x49')],null))[_0x1950('0x25')](respondWithResult(_0x136fe2,null))[_0x1950('0x40')](handleError(_0x136fe2,null));};exports[_0x1950('0x52')]=function(_0x3dd3d1,_0x455ed3){return db[_0x1950('0x3c')][_0x1950('0x47')]({'where':{'id':_0x3dd3d1[_0x1950('0x42')]['id']}})[_0x1950('0x25')](handleEntityNotFound(_0x455ed3,null))[_0x1950('0x25')](removeEntity(_0x455ed3,null))[_0x1950('0x40')](handleError(_0x455ed3,null));};exports[_0x1950('0x53')]=function(_0x3a42f0,_0x2b6f06,_0x394b1f){var _0x33ffb0=require(_0x1950('0x54'));return db[_0x1950('0x3c')][_0x1950('0x47')]({'where':{'id':_0x3a42f0[_0x1950('0x42')]['id']},'raw':!![]})[_0x1950('0x25')](handleEntityNotFound(_0x2b6f06,null))[_0x1950('0x25')](function(){_0x33ffb0[_0x1950('0x53')](_0x3a42f0[_0x1950('0x42')]['id']);})[_0x1950('0x25')](respondWithStatusCode(_0x2b6f06,null))['catch'](handleError(_0x2b6f06,null));}; \ No newline at end of file +var _0x9aff=['offset','undefined','count','limit','set','apply','save','destroy','then','get','Scheduler','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','update','run','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json'];(function(_0x4af43b,_0x46ddfc){var _0xb20e01=function(_0x43e2ad){while(--_0x43e2ad){_0x4af43b['push'](_0x4af43b['shift']());}};_0xb20e01(++_0x46ddfc);}(_0x9aff,0x88));var _0xf9af=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x9aff[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0xf9af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf9af('0x1'));var jsonpatch=require(_0xf9af('0x2'));var rp=require(_0xf9af('0x3'));var moment=require('moment');var BPromise=require(_0xf9af('0x4'));var Mustache=require(_0xf9af('0x5'));var util=require(_0xf9af('0x6'));var path=require(_0xf9af('0x7'));var sox=require(_0xf9af('0x8'));var csv=require(_0xf9af('0x9'));var ejs=require(_0xf9af('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9af('0xb'));var squel=require(_0xf9af('0xc'));var crypto=require(_0xf9af('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf9af('0xe'));var Papa=require(_0xf9af('0xf'));var Redis=require(_0xf9af('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf9af('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9af('0x12'))(_0xf9af('0x13'));var utils=require(_0xf9af('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf9af('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d4272,_0xdd6dd4){_0xdd6dd4=_0xdd6dd4||0xcc;return function(_0x3a7017){if(_0x3a7017){return _0x1d4272[_0xf9af('0x16')](_0xdd6dd4);}return _0x1d4272[_0xf9af('0x17')](_0xdd6dd4)[_0xf9af('0x18')]();};}function respondWithResult(_0x12bfcd,_0x45451b){_0x45451b=_0x45451b||0xc8;return function(_0x2aa775){if(_0x2aa775){return _0x12bfcd[_0xf9af('0x17')](_0x45451b)[_0xf9af('0x19')](_0x2aa775);}};}function respondWithFilteredResult(_0x25b03e,_0x529b9f){return function(_0x26876a){if(_0x26876a){var _0x2eb1da=typeof _0x529b9f[_0xf9af('0x1a')]===_0xf9af('0x1b')&&typeof _0x529b9f['limit']==='undefined';var _0x23ba2b=_0x26876a[_0xf9af('0x1c')];var _0x34a3a5=_0x2eb1da?0x0:_0x529b9f[_0xf9af('0x1a')];var _0x38990e=_0x2eb1da?_0x26876a[_0xf9af('0x1c')]:_0x529b9f[_0xf9af('0x1a')]+_0x529b9f[_0xf9af('0x1d')];var _0x16fe44;if(_0x38990e>=_0x23ba2b){_0x38990e=_0x23ba2b;_0x16fe44=0xc8;}else{_0x16fe44=0xce;}_0x25b03e[_0xf9af('0x17')](_0x16fe44);return _0x25b03e[_0xf9af('0x1e')]('Content-Range',_0x34a3a5+'-'+_0x38990e+'/'+_0x23ba2b)[_0xf9af('0x19')](_0x26876a);}return null;};}function patchUpdates(_0x4e07ef){return function(_0x5cd290){try{jsonpatch[_0xf9af('0x1f')](_0x5cd290,_0x4e07ef,!![]);}catch(_0x4aff68){return BPromise['reject'](_0x4aff68);}return _0x5cd290[_0xf9af('0x20')]();};}function saveUpdates(_0xfa012,_0x31b6e4){return function(_0x499db8){if(_0x499db8){return _0x499db8['update'](_0xfa012)['then'](function(_0x3528d4){return _0x3528d4;});}return null;};}function removeEntity(_0x4a58c1,_0x276b3f){return function(_0x54990b){if(_0x54990b){return _0x54990b[_0xf9af('0x21')]()[_0xf9af('0x22')](function(){var _0x545f86=_0x54990b[_0xf9af('0x23')]({'plain':!![]});var _0x5c1e8c=_0xf9af('0x24');return db['UserProfileResource'][_0xf9af('0x21')]({'where':{'type':_0x5c1e8c,'resourceId':_0x545f86['id']}})['then'](function(){return _0x54990b;});})[_0xf9af('0x22')](function(){_0x4a58c1[_0xf9af('0x17')](0xcc)[_0xf9af('0x18')]();});}};}function handleEntityNotFound(_0x2a52bf,_0x58866b){return function(_0x3d2066){if(!_0x3d2066){_0x2a52bf[_0xf9af('0x16')](0x194);}return _0x3d2066;};}function handleError(_0x358404,_0x56e653){_0x56e653=_0x56e653||0x1f4;return function(_0x543f99){logger['error'](_0x543f99[_0xf9af('0x25')]);if(_0x543f99[_0xf9af('0x26')]){delete _0x543f99['name'];}_0x358404[_0xf9af('0x17')](_0x56e653)[_0xf9af('0x27')](_0x543f99);};}exports[_0xf9af('0x28')]=function(_0x1c8f9e,_0x7c54ba){var _0x700116={},_0x1f90f2={},_0x5ec452={'count':0x0,'rows':[]};var _0x3efcd3=_['map'](db[_0xf9af('0x29')][_0xf9af('0x2a')],function(_0x705bcb){return{'name':_0x705bcb[_0xf9af('0x2b')],'type':_0x705bcb[_0xf9af('0x2c')][_0xf9af('0x2d')]};});_0x1f90f2[_0xf9af('0x2e')]=_[_0xf9af('0x2f')](_0x3efcd3,_0xf9af('0x26'));_0x1f90f2['query']=_['keys'](_0x1c8f9e[_0xf9af('0x30')]);_0x1f90f2[_0xf9af('0x31')]=_[_0xf9af('0x32')](_0x1f90f2[_0xf9af('0x2e')],_0x1f90f2[_0xf9af('0x30')]);_0x700116[_0xf9af('0x33')]=_['intersection'](_0x1f90f2[_0xf9af('0x2e')],qs[_0xf9af('0x34')](_0x1c8f9e['query']['fields']));_0x700116[_0xf9af('0x33')]=_0x700116[_0xf9af('0x33')]['length']?_0x700116[_0xf9af('0x33')]:_0x1f90f2[_0xf9af('0x2e')];if(!_0x1c8f9e[_0xf9af('0x30')][_0xf9af('0x35')]('nolimit')){_0x700116[_0xf9af('0x1d')]=qs[_0xf9af('0x1d')](_0x1c8f9e[_0xf9af('0x30')][_0xf9af('0x1d')]);_0x700116['offset']=qs['offset'](_0x1c8f9e[_0xf9af('0x30')]['offset']);}_0x700116[_0xf9af('0x36')]=qs[_0xf9af('0x37')](_0x1c8f9e[_0xf9af('0x30')][_0xf9af('0x37')]);_0x700116['where']=qs[_0xf9af('0x31')](_['pick'](_0x1c8f9e[_0xf9af('0x30')],_0x1f90f2[_0xf9af('0x31')]),_0x3efcd3);if(_0x1c8f9e['query'][_0xf9af('0x38')]){_0x700116['where']=_[_0xf9af('0x39')](_0x700116[_0xf9af('0x3a')],{'$or':_[_0xf9af('0x2f')](_0x3efcd3,function(_0x31e90d){if(_0x31e90d[_0xf9af('0x2c')]!=='VIRTUAL'){var _0x2f3497={};_0x2f3497[_0x31e90d[_0xf9af('0x26')]]={'$like':'%'+_0x1c8f9e[_0xf9af('0x30')][_0xf9af('0x38')]+'%'};return _0x2f3497;}})});}_0x700116=_[_0xf9af('0x39')]({},_0x700116,_0x1c8f9e[_0xf9af('0x3b')]);var _0x7f878a={'where':_0x700116['where']};return db[_0xf9af('0x29')][_0xf9af('0x1c')](_0x7f878a)[_0xf9af('0x22')](function(_0x4cc1e4){_0x5ec452['count']=_0x4cc1e4;if(_0x1c8f9e[_0xf9af('0x30')][_0xf9af('0x3c')]){_0x700116[_0xf9af('0x3d')]=[{'all':!![]}];}return db['Schedule'][_0xf9af('0x3e')](_0x700116);})[_0xf9af('0x22')](function(_0x5258){_0x5ec452[_0xf9af('0x3f')]=_0x5258;return _0x5ec452;})[_0xf9af('0x22')](respondWithFilteredResult(_0x7c54ba,_0x700116))[_0xf9af('0x40')](handleError(_0x7c54ba,null));};exports[_0xf9af('0x41')]=function(_0x5eaf2e,_0x478075){var _0x2b1135={'raw':![],'where':{'id':_0x5eaf2e[_0xf9af('0x42')]['id']}},_0x5c8dca={};_0x5c8dca[_0xf9af('0x2e')]=_[_0xf9af('0x43')](db[_0xf9af('0x29')][_0xf9af('0x2a')]);_0x5c8dca['query']=_[_0xf9af('0x43')](_0x5eaf2e[_0xf9af('0x30')]);_0x5c8dca[_0xf9af('0x31')]=_[_0xf9af('0x32')](_0x5c8dca[_0xf9af('0x2e')],_0x5c8dca[_0xf9af('0x30')]);_0x2b1135[_0xf9af('0x33')]=_['intersection'](_0x5c8dca[_0xf9af('0x2e')],qs['fields'](_0x5eaf2e['query']['fields']));_0x2b1135[_0xf9af('0x33')]=_0x2b1135[_0xf9af('0x33')][_0xf9af('0x44')]?_0x2b1135[_0xf9af('0x33')]:_0x5c8dca[_0xf9af('0x2e')];if(_0x5eaf2e[_0xf9af('0x30')][_0xf9af('0x3c')]){_0x2b1135[_0xf9af('0x3d')]=[{'all':!![]}];}_0x2b1135=_[_0xf9af('0x39')]({},_0x2b1135,_0x5eaf2e[_0xf9af('0x3b')]);return db[_0xf9af('0x29')][_0xf9af('0x45')](_0x2b1135)[_0xf9af('0x22')](handleEntityNotFound(_0x478075,null))[_0xf9af('0x22')](respondWithResult(_0x478075,null))[_0xf9af('0x40')](handleError(_0x478075,null));};exports['create']=function(_0xbb730,_0x2908cc){return db[_0xf9af('0x29')][_0xf9af('0x46')](_0xbb730[_0xf9af('0x47')],{})[_0xf9af('0x22')](function(_0x54b671){var _0x14cb13=_0xbb730[_0xf9af('0x48')][_0xf9af('0x23')]({'plain':!![]});if(!_0x14cb13)throw new Error(_0xf9af('0x49'));if(_0x14cb13[_0xf9af('0x4a')]===_0xf9af('0x48')){var _0x1dc44f=_0x54b671[_0xf9af('0x23')]({'plain':!![]});var _0x50f808='Scheduler';return db[_0xf9af('0x4b')][_0xf9af('0x45')]({'where':{'name':_0x50f808,'userProfileId':_0x14cb13[_0xf9af('0x4c')]},'raw':!![]})[_0xf9af('0x22')](function(_0x510973){if(_0x510973&&_0x510973['autoAssociation']===0x0){return db[_0xf9af('0x4d')][_0xf9af('0x46')]({'name':_0x1dc44f[_0xf9af('0x26')],'resourceId':_0x1dc44f['id'],'type':_0x510973[_0xf9af('0x26')],'sectionId':_0x510973['id']},{})[_0xf9af('0x22')](function(){return _0x54b671;});}else{return _0x54b671;}})[_0xf9af('0x40')](function(_0x4db677){logger[_0xf9af('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4db677);throw _0x4db677;});}return _0x54b671;})['then'](respondWithResult(_0x2908cc,0xc9))[_0xf9af('0x40')](handleError(_0x2908cc,null));};exports[_0xf9af('0x4f')]=function(_0xf2f43f,_0x25df80){if(_0xf2f43f[_0xf9af('0x47')]['id']){delete _0xf2f43f['body']['id'];}return db['Schedule'][_0xf9af('0x45')]({'where':{'id':_0xf2f43f[_0xf9af('0x42')]['id']}})[_0xf9af('0x22')](handleEntityNotFound(_0x25df80,null))['then'](saveUpdates(_0xf2f43f['body'],null))['then'](respondWithResult(_0x25df80,null))[_0xf9af('0x40')](handleError(_0x25df80,null));};exports[_0xf9af('0x21')]=function(_0x383bda,_0x554ac8){return db['Schedule'][_0xf9af('0x45')]({'where':{'id':_0x383bda[_0xf9af('0x42')]['id']}})[_0xf9af('0x22')](handleEntityNotFound(_0x554ac8,null))[_0xf9af('0x22')](removeEntity(_0x554ac8,null))['catch'](handleError(_0x554ac8,null));};exports[_0xf9af('0x50')]=function(_0x43d266,_0x1c614a,_0x309d3e){var _0x29b9e1=require('../../config/schedule');return db[_0xf9af('0x29')]['find']({'where':{'id':_0x43d266[_0xf9af('0x42')]['id']},'raw':!![]})[_0xf9af('0x22')](handleEntityNotFound(_0x1c614a,null))[_0xf9af('0x22')](function(){_0x29b9e1['run'](_0x43d266[_0xf9af('0x42')]['id']);})[_0xf9af('0x22')](respondWithStatusCode(_0x1c614a,null))['catch'](handleError(_0x1c614a,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 6446de0..77597dc 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 _0x76be=['request-promise','path','rimraf','./schedule.attributes','exports','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14dc6b,_0x107c04){var _0x380733=function(_0x54df43){while(--_0x54df43){_0x14dc6b['push'](_0x14dc6b['shift']());}};_0x380733(++_0x107c04);}(_0x76be,0xd2));var _0xe76b=function(_0x8bf54,_0x4207f5){_0x8bf54=_0x8bf54-0x0;var _0x139079=_0x76be[_0x8bf54];return _0x139079;};'use strict';var _=require(_0xe76b('0x0'));var util=require(_0xe76b('0x1'));var logger=require(_0xe76b('0x2'))(_0xe76b('0x3'));var moment=require(_0xe76b('0x4'));var BPromise=require(_0xe76b('0x5'));var rp=require(_0xe76b('0x6'));var fs=require('fs');var path=require(_0xe76b('0x7'));var rimraf=require(_0xe76b('0x8'));var config=require('../../config/environment');var attributes=require(_0xe76b('0x9'));module[_0xe76b('0xa')]=function(_0x1e9290,_0x40dfb0){return _0x1e9290['define']('Schedule',attributes,{'tableName':_0xe76b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb34b=['../../config/logger','api','bluebird','request-promise','rimraf','define','tools_schedules','util'];(function(_0x3c69a0,_0x4f4e32){var _0x171884=function(_0x4caa47){while(--_0x4caa47){_0x3c69a0['push'](_0x3c69a0['shift']());}};_0x171884(++_0x4f4e32);}(_0xb34b,0x9f));var _0xbb34=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb34b[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xbb34('0x0'));var logger=require(_0xbb34('0x1'))(_0xbb34('0x2'));var moment=require('moment');var BPromise=require(_0xbb34('0x3'));var rp=require(_0xbb34('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb34('0x5'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module['exports']=function(_0x344a81,_0x2356a1){return _0x344a81[_0xbb34('0x6')]('Schedule',attributes,{'tableName':_0xbb34('0x7'),'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 9cccfdd..51453bb 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 _0xff5a=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0xff5a,0x11e));var _0xaff5=function(_0x2e87d4,_0x216747){_0x2e87d4=_0x2e87d4-0x0;var _0x735420=_0xff5a[_0x2e87d4];return _0x735420;};'use strict';var _=require(_0xaff5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaff5('0x1'));var rs=require(_0xaff5('0x2'));var fs=require('fs');var Redis=require(_0xaff5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaff5('0x4'));var logger=require('../../config/logger')(_0xaff5('0x5'));var config=require(_0xaff5('0x6'));var jayson=require(_0xaff5('0x7'));var client=jayson[_0xaff5('0x8')][_0xaff5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15c62c,_0x1121f8,_0x469c2e){return new BPromise(function(_0x44eef2,_0x39f950){return client[_0xaff5('0xa')](_0x15c62c,_0x469c2e)[_0xaff5('0xb')](function(_0x24d574){logger[_0xaff5('0xc')](_0xaff5('0xd'),_0x1121f8,'request\x20sent');logger[_0xaff5('0xe')](_0xaff5('0xf'),_0x1121f8,'request\x20sent',JSON[_0xaff5('0x10')](_0x24d574));if(_0x24d574[_0xaff5('0x11')]){if(_0x24d574['error']['code']===0x1f4){logger[_0xaff5('0x11')](_0xaff5('0xd'),_0x1121f8,_0x24d574['error'][_0xaff5('0x12')]);return _0x39f950(_0x24d574[_0xaff5('0x11')][_0xaff5('0x12')]);}logger[_0xaff5('0x11')](_0xaff5('0xd'),_0x1121f8,_0x24d574[_0xaff5('0x11')][_0xaff5('0x12')]);return _0x44eef2(_0x24d574[_0xaff5('0x11')][_0xaff5('0x12')]);}else{logger[_0xaff5('0xc')](_0xaff5('0xd'),_0x1121f8,'request\x20sent');_0x44eef2(_0x24d574[_0xaff5('0x13')]['message']);}})['catch'](function(_0x140358){logger[_0xaff5('0x11')](_0xaff5('0xd'),_0x1121f8,_0x140358);_0x39f950(_0x140358);});});} \ No newline at end of file +var _0xf3de=['request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','info','Schedule,\x20%s,\x20%s'];(function(_0x4845a4,_0x14dbe5){var _0x444afb=function(_0x55a002){while(--_0x55a002){_0x4845a4['push'](_0x4845a4['shift']());}};_0x444afb(++_0x14dbe5);}(_0xf3de,0x114));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef3d('0x0'));var util=require(_0xef3d('0x1'));var moment=require(_0xef3d('0x2'));var BPromise=require(_0xef3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef3d('0x4'))['db'];var utils=require(_0xef3d('0x5'));var logger=require(_0xef3d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xef3d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cf33b,_0xc62861,_0x187620){return new BPromise(function(_0x248fe6,_0x3f2297){return client[_0xef3d('0x8')](_0x3cf33b,_0x187620)[_0xef3d('0x9')](function(_0x4a3e95){logger[_0xef3d('0xa')](_0xef3d('0xb'),_0xc62861,_0xef3d('0xc'));logger[_0xef3d('0xd')](_0xef3d('0xe'),_0xc62861,_0xef3d('0xc'),JSON['stringify'](_0x4a3e95));if(_0x4a3e95[_0xef3d('0xf')]){if(_0x4a3e95[_0xef3d('0xf')]['code']===0x1f4){logger[_0xef3d('0xf')](_0xef3d('0xb'),_0xc62861,_0x4a3e95[_0xef3d('0xf')][_0xef3d('0x10')]);return _0x3f2297(_0x4a3e95['error']['message']);}logger['error'](_0xef3d('0xb'),_0xc62861,_0x4a3e95[_0xef3d('0xf')][_0xef3d('0x10')]);return _0x248fe6(_0x4a3e95[_0xef3d('0xf')][_0xef3d('0x10')]);}else{logger['info'](_0xef3d('0xb'),_0xc62861,_0xef3d('0xc'));_0x248fe6(_0x4a3e95[_0xef3d('0x11')][_0xef3d('0x10')]);}})['catch'](function(_0x264d26){logger[_0xef3d('0xf')](_0xef3d('0xb'),_0xc62861,_0x264d26);_0x3f2297(_0x264d26);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 25c8087..ed26e73 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 _0x5c10=['/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','/describe','describe','get'];(function(_0x3cb1f9,_0x8cd9ce){var _0x3971d7=function(_0x5aed49){while(--_0x5aed49){_0x3cb1f9['push'](_0x3cb1f9['shift']());}};_0x3971d7(++_0x8cd9ce);}(_0x5c10,0x148));var _0x05c1=function(_0x18fcc3,_0x540e38){_0x18fcc3=_0x18fcc3-0x0;var _0x146bcd=_0x5c10[_0x18fcc3];return _0x146bcd;};'use strict';var multer=require(_0x05c1('0x0'));var util=require(_0x05c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x05c1('0x2'));var router=express[_0x05c1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05c1('0x4'));var interaction=require(_0x05c1('0x5'));var config=require(_0x05c1('0x6'));var controller=require(_0x05c1('0x7'));router['get']('/',auth[_0x05c1('0x8')](),controller['index']);router['get'](_0x05c1('0x9'),auth['isAuthenticated'](),controller[_0x05c1('0xa')]);router[_0x05c1('0xb')](_0x05c1('0xc'),auth[_0x05c1('0x8')](),controller[_0x05c1('0xd')]);router[_0x05c1('0xb')]('/:id/download',auth[_0x05c1('0x8')](),controller['download']);router[_0x05c1('0xe')]('/',auth[_0x05c1('0x8')](),controller[_0x05c1('0xf')]);router['put'](_0x05c1('0xc'),auth[_0x05c1('0x8')](),controller[_0x05c1('0x10')]);router[_0x05c1('0x11')](_0x05c1('0xc'),auth[_0x05c1('0x8')](),controller[_0x05c1('0x12')]);module[_0x05c1('0x13')]=router; \ No newline at end of file +var _0x02c1=['./screenRecording.controller','get','index','/describe','isAuthenticated','show','/:id/download','post','create','put','/:id','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x48266c,_0x3441b1){var _0xd549f2=function(_0x44d1a0){while(--_0x44d1a0){_0x48266c['push'](_0x48266c['shift']());}};_0xd549f2(++_0x3441b1);}(_0x02c1,0xdf));var _0x102c=function(_0x30283b,_0x2c5d43){_0x30283b=_0x30283b-0x0;var _0x1a0718=_0x02c1[_0x30283b];return _0x1a0718;};'use strict';var multer=require(_0x102c('0x0'));var util=require(_0x102c('0x1'));var path=require(_0x102c('0x2'));var timeout=require('connect-timeout');var express=require(_0x102c('0x3'));var router=express[_0x102c('0x4')]();var fs_extra=require(_0x102c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x102c('0x6'));var config=require(_0x102c('0x7'));var controller=require(_0x102c('0x8'));router[_0x102c('0x9')]('/',auth['isAuthenticated'](),controller[_0x102c('0xa')]);router[_0x102c('0x9')](_0x102c('0xb'),auth[_0x102c('0xc')](),controller['describe']);router[_0x102c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x102c('0xd')]);router[_0x102c('0x9')](_0x102c('0xe'),auth[_0x102c('0xc')](),controller['download']);router[_0x102c('0xf')]('/',auth[_0x102c('0xc')](),controller[_0x102c('0x10')]);router[_0x102c('0x11')](_0x102c('0x12'),auth['isAuthenticated'](),controller[_0x102c('0x13')]);router['delete'](_0x102c('0x12'),auth[_0x102c('0xc')](),controller['destroy']);module[_0x102c('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 9c51dd4..b95773f 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 _0xf3a8=['subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','path','exports','value','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x14084f,_0x14bbb8){_0x14084f=_0x14084f-0x0;var _0x34a710=_0xf3a8[_0x14084f];return _0x34a710;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8f3a('0x0'));var path=require(_0x8f3a('0x1'));var config=require('../../config/environment');module[_0x8f3a('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x8f3a('0x3'))?path['extname'](this[_0x8f3a('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x8f3a('0x5')]},'channel':{'type':Sequelize[_0x8f3a('0x5')]},'value':{'type':Sequelize[_0x8f3a('0x5')],'set':function(_0x32bb3a){var _0xc50ed8=_0x32bb3a[_0x8f3a('0x6')](/\\/g,'/');this[_0x8f3a('0x7')](_0x8f3a('0x3'),_0xc50ed8);}},'rating':{'type':Sequelize[_0x8f3a('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x2164ba){this['setDataValue'](_0x8f3a('0x9'),moment()[_0x8f3a('0xa')](_0x2164ba,'ms'));this[_0x8f3a('0x7')](_0x8f3a('0xb'),moment());this[_0x8f3a('0x7')]('duration',_0x2164ba);}},'startedAt':{'type':Sequelize[_0x8f3a('0xc')],'get':function(){return moment(this[_0x8f3a('0x4')]('startedAt'))[_0x8f3a('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x8f3a('0xc')],'get':function(){return moment(this[_0x8f3a('0x4')]('closedAt'))[_0x8f3a('0xd')](_0x8f3a('0xe'))[_0x8f3a('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8f3a('0x4')](_0x8f3a('0x10')))['format'](_0x8f3a('0xe'))[_0x8f3a('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8f3a('0x4')](_0x8f3a('0x11')))[_0x8f3a('0xd')](_0x8f3a('0xe'))[_0x8f3a('0xf')]();}}}; \ No newline at end of file +var _0xa9e1=['VIRTUAL','value','getDataValue','STRING','replace','setDataValue','INTEGER','closedAt','duration','startedAt','MM-DD-YYYY\x20HH:mm','DATE','format','toString','sequelize','moment','../../config/environment','exports'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0xa9e1[_0x48c615];return _0x3d9e22;};'use strict';var Sequelize=require(_0x1a9e('0x0'));var moment=require(_0x1a9e('0x1'));var path=require('path');var config=require(_0x1a9e('0x2'));module[_0x1a9e('0x3')]={'format':{'type':Sequelize[_0x1a9e('0x4')],'get':function(){return this['getDataValue'](_0x1a9e('0x5'))?path['extname'](this[_0x1a9e('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x1a9e('0x7')]},'channel':{'type':Sequelize[_0x1a9e('0x7')]},'value':{'type':Sequelize[_0x1a9e('0x7')],'set':function(_0xc9409c){var _0x2b8600=_0xc9409c[_0x1a9e('0x8')](/\\/g,'/');this[_0x1a9e('0x9')](_0x1a9e('0x5'),_0x2b8600);}},'rating':{'type':Sequelize[_0x1a9e('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1a9e('0xa')],'set':function(_0x4f9f78){this[_0x1a9e('0x9')]('startedAt',moment()['subtract'](_0x4f9f78,'ms'));this['setDataValue'](_0x1a9e('0xb'),moment());this['setDataValue'](_0x1a9e('0xc'),_0x4f9f78);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x1a9e('0xd')))['format'](_0x1a9e('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0x1a9e('0xf')],'get':function(){return moment(this[_0x1a9e('0x6')](_0x1a9e('0xb')))[_0x1a9e('0x10')](_0x1a9e('0xe'))[_0x1a9e('0x11')]();}},'createdAt':{'type':Sequelize[_0x1a9e('0xf')],'get':function(){return moment(this[_0x1a9e('0x6')]('createdAt'))[_0x1a9e('0x10')](_0x1a9e('0xe'))[_0x1a9e('0x11')]();}},'updatedAt':{'type':Sequelize[_0x1a9e('0xf')],'get':function(){return moment(this[_0x1a9e('0x6')]('updatedAt'))[_0x1a9e('0x10')](_0x1a9e('0xe'))[_0x1a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 7dc130d..344eaa0 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 _0x55ca=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','moment','bluebird','util','path'];(function(_0x4496ea,_0x115097){var _0xc6afd5=function(_0x3de319){while(--_0x3de319){_0x4496ea['push'](_0x4496ea['shift']());}};_0xc6afd5(++_0x115097);}(_0x55ca,0x126));var _0xa55c=function(_0x4efe55,_0x6174ea){_0x4efe55=_0x4efe55-0x0;var _0x3a15da=_0x55ca[_0x4efe55];return _0x3a15da;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_['map'](_0x201941,_0xa55c('0x25')),[_0xa55c('0x2e')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2f')]);_0x22f6b6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2f')]);_0x1377b0[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x22f6b6['model'],qs['fields'](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x1377b0['attributes']=_0x1377b0[_0xa55c('0x33')][_0xa55c('0x35')]?_0x1377b0[_0xa55c('0x33')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2f')][_0xa55c('0x36')](_0xa55c('0x37'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa['query']['limit']);_0x1377b0['offset']=qs[_0xa55c('0x1a')](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x1a')]);}_0x1377b0['order']=qs[_0xa55c('0x38')](_0x906caa['query'][_0xa55c('0x38')]);_0x1377b0['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x39')](_0x906caa[_0xa55c('0x2f')],_0x22f6b6['filters']),_0x201941);if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3a')]){_0x1377b0['where']=_[_0xa55c('0x3b')](_0x1377b0[_0xa55c('0x3c')],{'$or':_['map'](_0x201941,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2a')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x25')]]={'$like':'%'+_0x906caa['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x3b3308={'where':_0x1377b0[_0xa55c('0x3c')]};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x3b3308)[_0xa55c('0x20')](function(_0x56d17c){_0x1b8388[_0xa55c('0x1d')]=_0x56d17c;if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x386e34){_0x1b8388['rows']=_0x386e34;return _0x1b8388;})['then'](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x40')](handleError(_0x5d940d,null));};exports[_0xa55c('0x41')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':![],'where':{'id':_0x496920[_0xa55c('0x42')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x2c')]=_[_0xa55c('0x30')](db['ScreenRecording'][_0xa55c('0x43')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x2c')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x34')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x33')]['length']?_0x508bd3[_0xa55c('0x33')]:_0x5f25f7[_0xa55c('0x2c')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3e')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3b')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x29')][_0xa55c('0x44')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x20')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x40')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x29')][_0xa55c('0x45')](_0x46f839['body'],{})[_0xa55c('0x20')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x1f')]=function(_0x213100,_0x194a79){if(_0x213100['body']['id']){delete _0x213100[_0xa55c('0x46')]['id'];}delete _0x213100[_0xa55c('0x46')]['duration'];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x47')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x48')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x49')];return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x213100[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x194a79,null))['then'](saveUpdates(_0x213100[_0xa55c('0x46')],null))[_0xa55c('0x20')](respondWithResult(_0x194a79,null))[_0xa55c('0x40')](handleError(_0x194a79,null));};exports['describe']=function(_0x4c3095,_0x35bf0a){return db['ScreenRecording'][_0xa55c('0x4a')]()['then'](respondWithResult(_0x35bf0a,null))[_0xa55c('0x40')](handleError(_0x35bf0a,null));};exports[_0xa55c('0x4b')]=function(_0x181802,_0x3f9313,_0x2ecf79){var _0x5b1cf3=require(_0xa55c('0x4c'));var _0x4607ca=![];var _0x4b85cc={};if(_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]&&_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]==='uniqueid'){_0x4b85cc['uniqueid']=_0x181802[_0xa55c('0x42')]['id'];}else{_0x4b85cc['id']=_0x181802[_0xa55c('0x42')]['id'];}return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':_0x4b85cc,'attributes':['id','value'],'raw':!![]})[_0xa55c('0x20')](handleEntityNotFound(_0x3f9313,null))['then'](function(_0x2742e4){if(_0x2742e4){var _0x437ced=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x2742e4['value']);var _0x1cb73b=util['format'](_0xa55c('0x50'),_0x437ced);if(fs[_0xa55c('0x51')](_0x1cb73b)){_0x4607ca=!![];return _0x5b1cf3[_0xa55c('0x52')](_0x1cb73b,_0x437ced,config[_0xa55c('0x53')][_0xa55c('0x54')])[_0xa55c('0x20')](function(){return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x20')](function(_0x53e2be){if(_0x53e2be){var _0x450567=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x53e2be[_0xa55c('0x49')]);if(!fs['existsSync'](_0x450567)){throw new db[(_0xa55c('0x55'))][(_0xa55c('0x56'))](_0xa55c('0x57'));}if(_0x53e2be[_0xa55c('0x58')]){return _0x3f9313[_0xa55c('0x4b')](_0x450567,_0x53e2be['filename']+path[_0xa55c('0x59')](_0x450567),function(){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}else{return _0x3f9313[_0xa55c('0x4b')](_0x450567,function(_0x16d9b2){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}}})['catch'](function(_0x419fc3){if(_0x419fc3['message']===_0xa55c('0x57')){_0x3f9313['status'](0x194)[_0xa55c('0x26')]('Not\x20found');}else{return handleError(_0x3f9313,null);}});};exports[_0xa55c('0x5b')]=function(_0x1333da,_0x21d6b4){return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x1333da[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](function(_0x2f2226){if(_[_0xa55c('0x5c')](_0x2f2226)){throw new ReferenceError(_0xa55c('0x5d'));}return _0x2f2226;})['then'](function(_0x150a07){var _0x311bb9=path['join'](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x150a07[_0xa55c('0x49')]);logger[_0xa55c('0x5e')](_0xa55c('0x5f'),_0x311bb9);if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger['info'](_0xa55c('0x60')+_0x311bb9+_0xa55c('0x61'));fs[_0xa55c('0x62')](_0x311bb9);}_0x311bb9=_0x311bb9+_0xa55c('0x63');if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger[_0xa55c('0x5e')](_0xa55c('0x60')+_0x311bb9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa55c('0x62')](_0x311bb9);}return _0x150a07;})[_0xa55c('0x20')](function(_0x40c56a){if(!_0x40c56a)throw new InternalError();return _0x40c56a[_0xa55c('0x5b')]();})[_0xa55c('0x20')](function(){_0x21d6b4[_0xa55c('0x18')](0xcc)[_0xa55c('0x21')]();})[_0xa55c('0x40')](handleError(_0x21d6b4,null));}; \ No newline at end of file +var _0x33c5=['download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','duration','createdAt','closedAt','value','describe'];(function(_0x2653db,_0x581f7a){var _0x462dcb=function(_0x2a340c){while(--_0x2a340c){_0x2653db['push'](_0x2653db['shift']());}};_0x462dcb(++_0x581f7a);}(_0x33c5,0xe6));var _0x533c=function(_0x406115,_0x19f7a1){_0x406115=_0x406115-0x0;var _0xbbabdb=_0x33c5[_0x406115];return _0xbbabdb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x533c('0x0'));var zipdir=require(_0x533c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x533c('0x2'));var moment=require(_0x533c('0x3'));var BPromise=require(_0x533c('0x4'));var Mustache=require(_0x533c('0x5'));var util=require(_0x533c('0x6'));var path=require('path');var sox=require(_0x533c('0x7'));var csv=require(_0x533c('0x8'));var ejs=require(_0x533c('0x9'));var fs=require('fs');var fs_extra=require(_0x533c('0xa'));var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x8'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var licenseUtil=require(_0x533c('0x1a'));var db=require(_0x533c('0x1b'))['db'];function respondWithStatusCode(_0x530e10,_0x5c9462){_0x5c9462=_0x5c9462||0xcc;return function(_0xf93007){if(_0xf93007){return _0x530e10[_0x533c('0x1c')](_0x5c9462);}return _0x530e10[_0x533c('0x1d')](_0x5c9462)[_0x533c('0x1e')]();};}function respondWithResult(_0x1a2a83,_0x8d7c66){_0x8d7c66=_0x8d7c66||0xc8;return function(_0xa616ca){if(_0xa616ca){return _0x1a2a83['status'](_0x8d7c66)[_0x533c('0x1f')](_0xa616ca);}};}function respondWithFilteredResult(_0x7c1d33,_0x3f4a5c){return function(_0x3e544f){if(_0x3e544f){var _0x56dfb7=typeof _0x3f4a5c[_0x533c('0x20')]===_0x533c('0x21')&&typeof _0x3f4a5c[_0x533c('0x22')]===_0x533c('0x21');var _0x2854ab=_0x3e544f[_0x533c('0x23')];var _0x1f0a72=_0x56dfb7?0x0:_0x3f4a5c[_0x533c('0x20')];var _0x1f9f85=_0x56dfb7?_0x3e544f[_0x533c('0x23')]:_0x3f4a5c[_0x533c('0x20')]+_0x3f4a5c[_0x533c('0x22')];var _0x78dd72;if(_0x1f9f85>=_0x2854ab){_0x1f9f85=_0x2854ab;_0x78dd72=0xc8;}else{_0x78dd72=0xce;}_0x7c1d33[_0x533c('0x1d')](_0x78dd72);return _0x7c1d33[_0x533c('0x24')](_0x533c('0x25'),_0x1f0a72+'-'+_0x1f9f85+'/'+_0x2854ab)[_0x533c('0x1f')](_0x3e544f);}return null;};}function patchUpdates(_0x2bc58f){return function(_0x4ba0bd){try{jsonpatch[_0x533c('0x26')](_0x4ba0bd,_0x2bc58f,!![]);}catch(_0x51785c){return BPromise['reject'](_0x51785c);}return _0x4ba0bd[_0x533c('0x27')]();};}function saveUpdates(_0x36d4e4,_0x5f5090){return function(_0x21dfd3){if(_0x21dfd3){return _0x21dfd3[_0x533c('0x28')](_0x36d4e4)[_0x533c('0x29')](function(_0x3dd249){return _0x3dd249;});}return null;};}function removeEntity(_0x5ebbe0,_0x3762f7){return function(_0x42c87b){if(_0x42c87b){return _0x42c87b[_0x533c('0x2a')]()[_0x533c('0x29')](function(){_0x5ebbe0[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();});}};}function handleEntityNotFound(_0xb51a5,_0x43f669){return function(_0xb1c937){if(!_0xb1c937){_0xb51a5[_0x533c('0x1c')](0x194);}return _0xb1c937;};}function handleError(_0x4d47d0,_0x11d775){_0x11d775=_0x11d775||0x1f4;return function(_0xfab4da){logger['error'](_0xfab4da[_0x533c('0x2b')]);if(_0xfab4da['name']){delete _0xfab4da[_0x533c('0x2c')];}_0x4d47d0[_0x533c('0x1d')](_0x11d775)[_0x533c('0x2d')](_0xfab4da);};}exports[_0x533c('0x2e')]=function(_0x425f60,_0x146a8e){var _0x212d1b={},_0x38d886={},_0x3c559b={'count':0x0,'rows':[]};var _0x2fc7fa=_[_0x533c('0x2f')](db[_0x533c('0x30')]['rawAttributes'],function(_0x370263){return{'name':_0x370263['fieldName'],'type':_0x370263[_0x533c('0x31')][_0x533c('0x32')]};});_0x38d886[_0x533c('0x33')]=_[_0x533c('0x34')](_[_0x533c('0x2f')](_0x2fc7fa,_0x533c('0x2c')),[_0x533c('0x35')]);_0x38d886[_0x533c('0x36')]=_[_0x533c('0x37')](_0x425f60[_0x533c('0x36')]);_0x38d886[_0x533c('0x38')]=_[_0x533c('0x39')](_0x38d886[_0x533c('0x33')],_0x38d886[_0x533c('0x36')]);_0x212d1b[_0x533c('0x3a')]=_['intersection'](_0x38d886[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x425f60[_0x533c('0x36')][_0x533c('0x3b')]));_0x212d1b['attributes']=_0x212d1b[_0x533c('0x3a')][_0x533c('0x3c')]?_0x212d1b[_0x533c('0x3a')]:_0x38d886[_0x533c('0x33')];if(!_0x425f60[_0x533c('0x36')]['hasOwnProperty']('nolimit')){_0x212d1b['limit']=qs['limit'](_0x425f60['query'][_0x533c('0x22')]);_0x212d1b['offset']=qs[_0x533c('0x20')](_0x425f60['query'][_0x533c('0x20')]);}_0x212d1b[_0x533c('0x3d')]=qs[_0x533c('0x3e')](_0x425f60['query'][_0x533c('0x3e')]);_0x212d1b[_0x533c('0x3f')]=qs[_0x533c('0x38')](_['pick'](_0x425f60[_0x533c('0x36')],_0x38d886[_0x533c('0x38')]),_0x2fc7fa);if(_0x425f60[_0x533c('0x36')]['filter']){_0x212d1b[_0x533c('0x3f')]=_[_0x533c('0x40')](_0x212d1b[_0x533c('0x3f')],{'$or':_[_0x533c('0x2f')](_0x2fc7fa,function(_0x454dbc){if(_0x454dbc[_0x533c('0x31')]!==_0x533c('0x41')){var _0x2dbd81={};_0x2dbd81[_0x454dbc[_0x533c('0x2c')]]={'$like':'%'+_0x425f60[_0x533c('0x36')][_0x533c('0x42')]+'%'};return _0x2dbd81;}})});}_0x212d1b=_['merge']({},_0x212d1b,_0x425f60[_0x533c('0x43')]);var _0x784493={'where':_0x212d1b[_0x533c('0x3f')]};return db[_0x533c('0x30')][_0x533c('0x23')](_0x784493)[_0x533c('0x29')](function(_0x5d2bf9){_0x3c559b[_0x533c('0x23')]=_0x5d2bf9;if(_0x425f60[_0x533c('0x36')][_0x533c('0x44')]){_0x212d1b['include']=[{'all':!![]}];}return db[_0x533c('0x30')][_0x533c('0x45')](_0x212d1b);})[_0x533c('0x29')](function(_0x1abd47){_0x3c559b['rows']=_0x1abd47;return _0x3c559b;})[_0x533c('0x29')](respondWithFilteredResult(_0x146a8e,_0x212d1b))['catch'](handleError(_0x146a8e,null));};exports[_0x533c('0x46')]=function(_0x39034e,_0x55a372){var _0x3f4015={'raw':![],'where':{'id':_0x39034e[_0x533c('0x47')]['id']}},_0x3f1e47={};_0x3f1e47['model']=_['keys'](db['ScreenRecording']['rawAttributes']);_0x3f1e47[_0x533c('0x36')]=_['keys'](_0x39034e[_0x533c('0x36')]);_0x3f1e47['filters']=_[_0x533c('0x39')](_0x3f1e47['model'],_0x3f1e47[_0x533c('0x36')]);_0x3f4015[_0x533c('0x3a')]=_['intersection'](_0x3f1e47[_0x533c('0x33')],qs[_0x533c('0x3b')](_0x39034e[_0x533c('0x36')][_0x533c('0x3b')]));_0x3f4015[_0x533c('0x3a')]=_0x3f4015['attributes'][_0x533c('0x3c')]?_0x3f4015[_0x533c('0x3a')]:_0x3f1e47[_0x533c('0x33')];if(_0x39034e[_0x533c('0x36')]['includeAll']){_0x3f4015[_0x533c('0x48')]=[{'all':!![]}];}_0x3f4015=_[_0x533c('0x40')]({},_0x3f4015,_0x39034e['options']);return db['ScreenRecording'][_0x533c('0x49')](_0x3f4015)['then'](handleEntityNotFound(_0x55a372,null))[_0x533c('0x29')](respondWithResult(_0x55a372,null))[_0x533c('0x4a')](handleError(_0x55a372,null));};exports[_0x533c('0x4b')]=function(_0x471c59,_0xe9354a){return db[_0x533c('0x30')][_0x533c('0x4b')](_0x471c59[_0x533c('0x4c')],{})['then'](respondWithResult(_0xe9354a,0xc9))[_0x533c('0x4a')](handleError(_0xe9354a,null));};exports[_0x533c('0x28')]=function(_0xaaf682,_0x57c6c6){if(_0xaaf682[_0x533c('0x4c')]['id']){delete _0xaaf682[_0x533c('0x4c')]['id'];}delete _0xaaf682['body'][_0x533c('0x4d')];delete _0xaaf682['body'][_0x533c('0x4e')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x4f')];delete _0xaaf682[_0x533c('0x4c')][_0x533c('0x50')];return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0xaaf682['params']['id']}})[_0x533c('0x29')](handleEntityNotFound(_0x57c6c6,null))[_0x533c('0x29')](saveUpdates(_0xaaf682[_0x533c('0x4c')],null))[_0x533c('0x29')](respondWithResult(_0x57c6c6,null))[_0x533c('0x4a')](handleError(_0x57c6c6,null));};exports[_0x533c('0x51')]=function(_0x3eb174,_0x50d5a2){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x50d5a2,null))[_0x533c('0x4a')](handleError(_0x50d5a2,null));};exports[_0x533c('0x52')]=function(_0x5c5dd0,_0xac086b,_0x1da579){var _0x2f6794=require('../../components/encryptor');var _0x1de19e=![];var _0x564a31={};if(_0x5c5dd0['query'][_0x533c('0x31')]&&_0x5c5dd0[_0x533c('0x36')][_0x533c('0x31')]===_0x533c('0x53')){_0x564a31[_0x533c('0x53')]=_0x5c5dd0[_0x533c('0x47')]['id'];}else{_0x564a31['id']=_0x5c5dd0[_0x533c('0x47')]['id'];}return db['ScreenRecording'][_0x533c('0x49')]({'where':_0x564a31,'attributes':['id','value'],'raw':!![]})[_0x533c('0x29')](handleEntityNotFound(_0xac086b,null))[_0x533c('0x29')](function(_0x274686){if(_0x274686){var _0x2c7600=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x274686[_0x533c('0x50')]);var _0x58f528=util[_0x533c('0x35')](_0x533c('0x57'),_0x2c7600);if(fs[_0x533c('0x58')](_0x58f528)){_0x1de19e=!![];return _0x2f6794[_0x533c('0x59')](_0x58f528,_0x2c7600,config[_0x533c('0x5a')][_0x533c('0x5b')])['then'](function(){return _0x274686;});}return _0x274686;}})[_0x533c('0x29')](function(_0x554a9f){if(_0x554a9f){var _0x43383e=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0x554a9f[_0x533c('0x50')]);if(!fs[_0x533c('0x58')](_0x43383e)){throw new db['Sequelize']['ValidationError'](_0x533c('0x5c'));}if(_0x554a9f[_0x533c('0x5d')]){return _0xac086b[_0x533c('0x52')](_0x43383e,_0x554a9f[_0x533c('0x5d')]+path['extname'](_0x43383e),function(){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}else{return _0xac086b[_0x533c('0x52')](_0x43383e,function(_0x8e04c7){if(_0x1de19e){fs[_0x533c('0x5e')](_0x43383e);}});}}})[_0x533c('0x4a')](function(_0x2f2863){if(_0x2f2863[_0x533c('0x5f')]===_0x533c('0x5c')){_0xac086b[_0x533c('0x1d')](0x194)[_0x533c('0x2d')](_0x533c('0x60'));}else{return handleError(_0xac086b,null);}});};exports[_0x533c('0x2a')]=function(_0x13a7f2,_0xea6ea2){return db[_0x533c('0x30')][_0x533c('0x49')]({'where':{'id':_0x13a7f2[_0x533c('0x47')]['id']}})['then'](function(_0x31bba1){if(_['isNil'](_0x31bba1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x31bba1;})[_0x533c('0x29')](function(_0xb23f94){var _0x965b85=path[_0x533c('0x54')](config[_0x533c('0x55')],_0x533c('0x56'),_0xb23f94[_0x533c('0x50')]);logger['info'](_0x533c('0x61'),_0x965b85);if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')](_0x533c('0x64')+_0x965b85+_0x533c('0x65'));fs['unlinkSync'](_0x965b85);}_0x965b85=_0x965b85+_0x533c('0x66');if(!_[_0x533c('0x62')](_0xb23f94['value'])&&fs[_0x533c('0x58')](_0x965b85)){logger[_0x533c('0x63')]('File:\x20\x22'+_0x965b85+_0x533c('0x65'));fs[_0x533c('0x67')](_0x965b85);}return _0xb23f94;})['then'](function(_0x444f46){if(!_0x444f46)throw new InternalError();return _0x444f46['destroy']();})['then'](function(){_0xea6ea2[_0x533c('0x1d')](0xcc)[_0x533c('0x1e')]();})[_0x533c('0x4a')](handleError(_0xea6ea2,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 2d1c931..b3485e7 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 _0x82ae=['screen_recordings','interactionid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./screenRecording.attributes','define','ScreenRecording'];(function(_0xe809a5,_0xab46c0){var _0x420442=function(_0x552daf){while(--_0x552daf){_0xe809a5['push'](_0xe809a5['shift']());}};_0x420442(++_0xab46c0);}(_0x82ae,0x1e3));var _0xe82a=function(_0x5521e8,_0x4641c1){_0x5521e8=_0x5521e8-0x0;var _0x186208=_0x82ae[_0x5521e8];return _0x186208;};'use strict';var _=require(_0xe82a('0x0'));var util=require(_0xe82a('0x1'));var logger=require(_0xe82a('0x2'))(_0xe82a('0x3'));var moment=require('moment');var BPromise=require(_0xe82a('0x4'));var rp=require(_0xe82a('0x5'));var fs=require('fs');var path=require(_0xe82a('0x6'));var rimraf=require(_0xe82a('0x7'));var config=require('../../config/environment');var attributes=require(_0xe82a('0x8'));module['exports']=function(_0x6aff89,_0xa7db8e){return _0x6aff89[_0xe82a('0x9')](_0xe82a('0xa'),attributes,{'tableName':_0xe82a('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xe82a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa711=['request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','lodash','util','api','moment','bluebird'];(function(_0x33f3f8,_0x51b47a){var _0x2122db=function(_0x52fa7e){while(--_0x52fa7e){_0x33f3f8['push'](_0x33f3f8['shift']());}};_0x2122db(++_0x51b47a);}(_0xa711,0x7f));var _0x1a71=function(_0x1d219c,_0x50820a){_0x1d219c=_0x1d219c-0x0;var _0x3d9fde=_0xa711[_0x1d219c];return _0x3d9fde;};'use strict';var _=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var logger=require('../../config/logger')(_0x1a71('0x2'));var moment=require(_0x1a71('0x3'));var BPromise=require(_0x1a71('0x4'));var rp=require(_0x1a71('0x5'));var fs=require('fs');var path=require(_0x1a71('0x6'));var rimraf=require(_0x1a71('0x7'));var config=require(_0x1a71('0x8'));var attributes=require('./screenRecording.attributes');module[_0x1a71('0x9')]=function(_0x593003,_0x5db425){return _0x593003[_0x1a71('0xa')](_0x1a71('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 16d101a..2914605 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 _0xa145=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x735560,_0x20cda1){var _0x453d54=function(_0x349546){while(--_0x349546){_0x735560['push'](_0x735560['shift']());}};_0x453d54(++_0x20cda1);}(_0xa145,0x174));var _0x5a14=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xa145[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require('lodash');var util=require(_0x5a14('0x0'));var moment=require(_0x5a14('0x1'));var BPromise=require(_0x5a14('0x2'));var rs=require(_0x5a14('0x3'));var fs=require('fs');var Redis=require(_0x5a14('0x4'));var db=require(_0x5a14('0x5'))['db'];var utils=require(_0x5a14('0x6'));var logger=require(_0x5a14('0x7'))(_0x5a14('0x8'));var config=require(_0x5a14('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5a14('0xa')][_0x5a14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c1cd5,_0x2ecfc8,_0x2ed669){return new BPromise(function(_0x298140,_0x445eb7){return client['request'](_0x5c1cd5,_0x2ed669)[_0x5a14('0xc')](function(_0x153c74){logger[_0x5a14('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x2ecfc8,_0x5a14('0xe'));logger[_0x5a14('0xf')](_0x5a14('0x10'),_0x2ecfc8,_0x5a14('0xe'),JSON['stringify'](_0x153c74));if(_0x153c74[_0x5a14('0x11')]){if(_0x153c74[_0x5a14('0x11')][_0x5a14('0x12')]===0x1f4){logger[_0x5a14('0x11')](_0x5a14('0x13'),_0x2ecfc8,_0x153c74[_0x5a14('0x11')][_0x5a14('0x14')]);return _0x445eb7(_0x153c74[_0x5a14('0x11')][_0x5a14('0x14')]);}logger[_0x5a14('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x2ecfc8,_0x153c74[_0x5a14('0x11')][_0x5a14('0x14')]);return _0x298140(_0x153c74['error'][_0x5a14('0x14')]);}else{logger[_0x5a14('0xd')](_0x5a14('0x13'),_0x2ecfc8,_0x5a14('0xe'));_0x298140(_0x153c74['result'][_0x5a14('0x14')]);}})['catch'](function(_0x3fb956){logger[_0x5a14('0x11')](_0x5a14('0x13'),_0x2ecfc8,_0x3fb956);_0x445eb7(_0x3fb956);});});} \ No newline at end of file +var _0xabee=['request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s'];(function(_0x1f1db7,_0x23432e){var _0x5909ae=function(_0x54f62c){while(--_0x54f62c){_0x1f1db7['push'](_0x1f1db7['shift']());}};_0x5909ae(++_0x23432e);}(_0xabee,0x1e8));var _0xeabe=function(_0x32ee8f,_0x26da8a){_0x32ee8f=_0x32ee8f-0x0;var _0x2fc956=_0xabee[_0x32ee8f];return _0x2fc956;};'use strict';var _=require(_0xeabe('0x0'));var util=require(_0xeabe('0x1'));var moment=require(_0xeabe('0x2'));var BPromise=require(_0xeabe('0x3'));var rs=require(_0xeabe('0x4'));var fs=require('fs');var Redis=require(_0xeabe('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xeabe('0x6'));var jayson=require(_0xeabe('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x285353,_0x5908f9,_0x3b53f7){return new BPromise(function(_0x16dba0,_0x4fe758){return client[_0xeabe('0x8')](_0x285353,_0x3b53f7)[_0xeabe('0x9')](function(_0x5ca3f1){logger[_0xeabe('0xa')](_0xeabe('0xb'),_0x5908f9,_0xeabe('0xc'));logger[_0xeabe('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x5908f9,_0xeabe('0xc'),JSON[_0xeabe('0xe')](_0x5ca3f1));if(_0x5ca3f1['error']){if(_0x5ca3f1['error'][_0xeabe('0xf')]===0x1f4){logger[_0xeabe('0x10')](_0xeabe('0xb'),_0x5908f9,_0x5ca3f1['error'][_0xeabe('0x11')]);return _0x4fe758(_0x5ca3f1[_0xeabe('0x10')][_0xeabe('0x11')]);}logger[_0xeabe('0x10')](_0xeabe('0xb'),_0x5908f9,_0x5ca3f1[_0xeabe('0x10')][_0xeabe('0x11')]);return _0x16dba0(_0x5ca3f1[_0xeabe('0x10')][_0xeabe('0x11')]);}else{logger[_0xeabe('0xa')](_0xeabe('0xb'),_0x5908f9,_0xeabe('0xc'));_0x16dba0(_0x5ca3f1[_0xeabe('0x12')][_0xeabe('0x11')]);}})[_0xeabe('0x13')](function(_0x47cb18){logger[_0xeabe('0x10')](_0xeabe('0xb'),_0x5908f9,_0x47cb18);_0x4fe758(_0x47cb18);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 21f8fb2..10c9f1a 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 _0x1e44=['/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','post','/:id/logo','single','addLogo','join','file','addLogoLogin','preferred','addPreferred','favicon','originalname','addFavicon','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1e44,0x1b5));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x41e4('0x0'));var util=require(_0x41e4('0x1'));var path=require('path');var timeout=require(_0x41e4('0x2'));var express=require(_0x41e4('0x3'));var router=express[_0x41e4('0x4')]();var fs_extra=require(_0x41e4('0x5'));var auth=require(_0x41e4('0x6'));var interaction=require(_0x41e4('0x7'));var config=require(_0x41e4('0x8'));var controller=require(_0x41e4('0x9'));router['get']('/',auth[_0x41e4('0xa')](),controller[_0x41e4('0xb')]);router[_0x41e4('0xc')](_0x41e4('0xd'),controller[_0x41e4('0xe')]);router[_0x41e4('0xc')](_0x41e4('0xf'),controller[_0x41e4('0x10')]);router[_0x41e4('0xc')]('/:id/logo',controller[_0x41e4('0x11')]);router[_0x41e4('0xc')](_0x41e4('0x12'),controller[_0x41e4('0x13')]);router[_0x41e4('0xc')](_0x41e4('0x14'),controller['gdpr']);router[_0x41e4('0xc')](_0x41e4('0x15'),controller[_0x41e4('0x16')]);router[_0x41e4('0xc')](_0x41e4('0x17'),controller['getFavicon']);var upload=multer({'storage':multer[_0x41e4('0x18')]({'destination':function(_0x803dec,_0x523d32,_0x537f7e){_0x537f7e(null,path['join'](config[_0x41e4('0x19')],_0x41e4('0x1a')));},'filename':function(_0x3ede40,_0x774237,_0x1c0d67){_0x1c0d67(null,util[_0x41e4('0x1b')](_0x41e4('0x1c'),_0x41e4('0x1d'),path[_0x41e4('0x1e')](_0x774237['originalname'])));}})});router[_0x41e4('0x1f')](_0x41e4('0x20'),upload[_0x41e4('0x21')]('file'),controller[_0x41e4('0x22')]);var upload=multer({'storage':multer[_0x41e4('0x18')]({'destination':function(_0x501a31,_0x132e8b,_0x594ca1){_0x594ca1(null,path[_0x41e4('0x23')](config[_0x41e4('0x19')],_0x41e4('0x1a')));},'filename':function(_0x3339f8,_0x1dd079,_0x187ad4){_0x187ad4(null,util['format']('%s%s','logologin',path[_0x41e4('0x1e')](_0x1dd079['originalname'])));}})});router[_0x41e4('0x1f')]('/:id/logo_login',upload[_0x41e4('0x21')](_0x41e4('0x24')),controller[_0x41e4('0x25')]);var upload=multer({'storage':multer[_0x41e4('0x18')]({'destination':function(_0x1d8d4c,_0x3f9fc5,_0x1e2d10){_0x1e2d10(null,path[_0x41e4('0x23')](config[_0x41e4('0x19')],_0x41e4('0x1a')));},'filename':function(_0x28a4b9,_0x1126ed,_0x52f911){_0x52f911(null,util[_0x41e4('0x1b')](_0x41e4('0x1c'),_0x41e4('0x26'),path['extname'](_0x1126ed['originalname'])));}})});router[_0x41e4('0x1f')](_0x41e4('0x15'),upload[_0x41e4('0x21')](_0x41e4('0x24')),controller[_0x41e4('0x27')]);var upload=multer({'storage':multer[_0x41e4('0x18')]({'destination':function(_0x15f48b,_0x11293b,_0x279138){_0x279138(null,path[_0x41e4('0x23')](config['root'],_0x41e4('0x1a')));},'filename':function(_0x264592,_0x1762a1,_0x430b7d){_0x430b7d(null,util[_0x41e4('0x1b')](_0x41e4('0x1c'),_0x41e4('0x28'),path[_0x41e4('0x1e')](_0x1762a1[_0x41e4('0x29')])));}})});router[_0x41e4('0x1f')](_0x41e4('0x17'),upload[_0x41e4('0x21')](_0x41e4('0x24')),controller[_0x41e4('0x2a')]);router[_0x41e4('0x2b')]('/:id',auth['isAuthenticated'](),controller[_0x41e4('0x2c')]);module['exports']=router; \ No newline at end of file +var _0x1915=['get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getFavicon','diskStorage','join','root','%s%s','logo','extname','originalname','single','file','addLogo','format','logologin','post','addLogoLogin','server/files/images/logos/','preferred','addPreferred','/:id/favicon','addFavicon','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1915,0xae));var _0x5191=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1915[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x5191('0x0'));var path=require(_0x5191('0x1'));var timeout=require(_0x5191('0x2'));var express=require(_0x5191('0x3'));var router=express[_0x5191('0x4')]();var fs_extra=require(_0x5191('0x5'));var auth=require(_0x5191('0x6'));var interaction=require(_0x5191('0x7'));var config=require(_0x5191('0x8'));var controller=require(_0x5191('0x9'));router[_0x5191('0xa')]('/',auth[_0x5191('0xb')](),controller[_0x5191('0xc')]);router['get'](_0x5191('0xd'),controller[_0x5191('0xe')]);router['get'](_0x5191('0xf'),controller[_0x5191('0x10')]);router[_0x5191('0xa')](_0x5191('0x11'),controller[_0x5191('0x12')]);router['get'](_0x5191('0x13'),controller[_0x5191('0x14')]);router[_0x5191('0xa')](_0x5191('0x15'),controller['gdpr']);router['get'](_0x5191('0x16'),controller['getPreferred']);router[_0x5191('0xa')]('/:id/favicon',controller[_0x5191('0x17')]);var upload=multer({'storage':multer[_0x5191('0x18')]({'destination':function(_0x9b9d6d,_0x27e90c,_0x224d89){_0x224d89(null,path[_0x5191('0x19')](config[_0x5191('0x1a')],'server/files/images/logos/'));},'filename':function(_0x15729e,_0x513097,_0x516619){_0x516619(null,util['format'](_0x5191('0x1b'),_0x5191('0x1c'),path[_0x5191('0x1d')](_0x513097[_0x5191('0x1e')])));}})});router['post'](_0x5191('0x11'),upload[_0x5191('0x1f')](_0x5191('0x20')),controller[_0x5191('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12fe17,_0x9f287b,_0x48c888){_0x48c888(null,path[_0x5191('0x19')](config[_0x5191('0x1a')],'server/files/images/logos/'));},'filename':function(_0x369df8,_0x43d557,_0xe95db5){_0xe95db5(null,util[_0x5191('0x22')](_0x5191('0x1b'),_0x5191('0x23'),path['extname'](_0x43d557[_0x5191('0x1e')])));}})});router[_0x5191('0x24')](_0x5191('0x13'),upload[_0x5191('0x1f')]('file'),controller[_0x5191('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x47bb1d,_0x4c5c04,_0x474a44){_0x474a44(null,path[_0x5191('0x19')](config[_0x5191('0x1a')],_0x5191('0x26')));},'filename':function(_0x29ab16,_0x3b396b,_0xffed8d){_0xffed8d(null,util[_0x5191('0x22')](_0x5191('0x1b'),_0x5191('0x27'),path[_0x5191('0x1d')](_0x3b396b[_0x5191('0x1e')])));}})});router[_0x5191('0x24')](_0x5191('0x16'),upload[_0x5191('0x1f')](_0x5191('0x20')),controller[_0x5191('0x28')]);var upload=multer({'storage':multer[_0x5191('0x18')]({'destination':function(_0x37cb85,_0x4b1773,_0x14bd58){_0x14bd58(null,path[_0x5191('0x19')](config[_0x5191('0x1a')],'server/files/images/logos/'));},'filename':function(_0x1caa7a,_0xfe1953,_0x54ad4c){_0x54ad4c(null,util[_0x5191('0x22')]('%s%s','favicon',path[_0x5191('0x1d')](_0xfe1953[_0x5191('0x1e')])));}})});router[_0x5191('0x24')](_0x5191('0x29'),upload['single'](_0x5191('0x20')),controller[_0x5191('0x2a')]);router[_0x5191('0x2b')](_0x5191('0xf'),auth[_0x5191('0xb')](),controller[_0x5191('0x2c')]);module[_0x5191('0x2d')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 838c404..9491a13 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 _0x814b=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x10244a,_0x3e96f4){var _0x4daacd=function(_0x3ef358){while(--_0x3ef358){_0x10244a['push'](_0x10244a['shift']());}};_0x4daacd(++_0x3e96f4);}(_0x814b,0x1a2));var _0xb814=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0x814b[_0x1177d5];return _0xc3ddc2;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'min_internal':{'type':Sequelize[_0xb814('0x2')](0xb),'unique':_0xb814('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb814('0x2')](0xb),'unique':_0xb814('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb814('0x5')],'defaultValue':_0xb814('0x6')},'logo':{'type':Sequelize[_0xb814('0x5')]},'defaultLogo':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb814('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xb814('0x5')]},'turnaddr':{'type':Sequelize[_0xb814('0x5')]},'turnusername':{'type':Sequelize[_0xb814('0x5')]},'turnpassword':{'type':Sequelize[_0xb814('0x5')]},'pageTitle':{'type':Sequelize[_0xb814('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xb814('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb814('0x5')],'defaultValue':_0xb814('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb814('0x5')],'defaultValue':_0xb814('0x9')},'chatTimeout':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb814('0x5')]},'defaultPreferred':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb814('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb814('0x5')]},'defaultFavicon':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xb814('0x2')]},'transcribeRegion':{'type':Sequelize[_0xb814('0x5')]},'sentiment':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xb814('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xb814('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xb814('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xb814('0x2')](0x2)[_0xb814('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xb814('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xb814('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xb814('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0xb814('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'disconnectionTimeout':{'type':Sequelize[_0xb814('0x2')]()[_0xb814('0xa')],'defaultValue':0x5,'validate':{'min':0x1}}}; \ No newline at end of file +var _0x7217=['sequelize','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0x7217,0x19e));var _0x7721=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x7217[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x7721('0x1')](0xb),'unique':_0x7721('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x7721('0x1')](0xb),'unique':_0x7721('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x7721('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x7721('0x4')]},'defaultLogo':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x7721('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x7721('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x7721('0x4')]},'turnaddr':{'type':Sequelize[_0x7721('0x4')]},'turnusername':{'type':Sequelize[_0x7721('0x4')]},'turnpassword':{'type':Sequelize[_0x7721('0x4')]},'pageTitle':{'type':Sequelize[_0x7721('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x7721('0x4')],'defaultValue':_0x7721('0x6')},'enableEmailPreview':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x7721('0x7')},'chatTimeout':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x7721('0x4')]},'defaultPreferred':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x7721('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x7721('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x7721('0x1')]},'transcribeRegion':{'type':Sequelize[_0x7721('0x4')]},'sentiment':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x7721('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7721('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x7721('0x1')](0x2)[_0x7721('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x7721('0x1')](0x2)[_0x7721('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x7721('0x1')](0x2)[_0x7721('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x7721('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x7721('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x7721('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x7721('0x1')],'defaultValue':0x14},'disconnectionTimeout':{'type':Sequelize[_0x7721('0x1')]()[_0x7721('0x8')],'defaultValue':0x5,'validate':{'min':0x1}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 084d162..9492083 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 _0x215d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','update','destroy','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','Setting','includeAll','findAll','rows','show','fields','include','find','params','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','toLower','root','default','upperFirst','custom','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','favicon','defaultFavicon','default_loginLogo.svg','Sequelize','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x49f31c,_0x4b8027){var _0x2df03d=function(_0x59cc2a){while(--_0x59cc2a){_0x49f31c['push'](_0x49f31c['shift']());}};_0x2df03d(++_0x4b8027);}(_0x215d,0xdb));var _0xd215=function(_0xa62278,_0x4c3e55){_0xa62278=_0xa62278-0x0;var _0x36ec4e=_0x215d[_0xa62278];return _0x36ec4e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd215('0x0'));var jsonpatch=require(_0xd215('0x1'));var rp=require(_0xd215('0x2'));var moment=require('moment');var BPromise=require(_0xd215('0x3'));var Mustache=require('mustache');var util=require(_0xd215('0x4'));var path=require(_0xd215('0x5'));var sox=require(_0xd215('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd215('0x7'));var _=require(_0xd215('0x8'));var squel=require('squel');var crypto=require(_0xd215('0x9'));var jsforce=require(_0xd215('0xa'));var deskjs=require(_0xd215('0xb'));var toCsv=require(_0xd215('0xc'));var querystring=require('querystring');var Papa=require(_0xd215('0xd'));var Redis=require(_0xd215('0xe'));var authService=require(_0xd215('0xf'));var qs=require(_0xd215('0x10'));var as=require(_0xd215('0x11'));var hardwareService=require(_0xd215('0x12'));var logger=require(_0xd215('0x13'))(_0xd215('0x14'));var utils=require(_0xd215('0x15'));var config=require(_0xd215('0x16'));var licenseUtil=require(_0xd215('0x17'));var db=require(_0xd215('0x18'))['db'];var jayson=require(_0xd215('0x19'));var client=jayson[_0xd215('0x1a')][_0xd215('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1679c2,_0xf81c69,_0x21d80e,_0x2355ea){return new BPromise(function(_0xe71d7a,_0x47e631){var _0x11a9f3=_0x2355ea||client;return _0x11a9f3['request'](_0x1679c2,_0x21d80e)[_0xd215('0x1c')](function(_0x4e2776){logger[_0xd215('0x1d')](_0xd215('0x1e'),_0xf81c69,_0xd215('0x1f'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0xf81c69,_0xd215('0x1f'),JSON[_0xd215('0x20')](_0x4e2776));if(_0x4e2776[_0xd215('0x21')]){if(_0x4e2776[_0xd215('0x21')][_0xd215('0x22')]===0x1f4){logger[_0xd215('0x21')](_0xd215('0x1e'),_0xf81c69,_0x4e2776[_0xd215('0x21')][_0xd215('0x23')]);return _0x47e631(_0x4e2776[_0xd215('0x21')]['message']);}logger[_0xd215('0x21')]('Setting,\x20%s,\x20%s',_0xf81c69,_0x4e2776[_0xd215('0x21')]['message']);return _0xe71d7a(_0x4e2776[_0xd215('0x21')]['message']);}else{logger[_0xd215('0x1d')](_0xd215('0x1e'),_0xf81c69,_0xd215('0x1f'));_0xe71d7a(_0x4e2776[_0xd215('0x24')][_0xd215('0x23')]);}})[_0xd215('0x25')](function(_0x1fcbc8){logger[_0xd215('0x21')]('Setting,\x20%s,\x20%s',_0xf81c69,_0x1fcbc8);_0x47e631(_0x1fcbc8);});});}function respondWithStatusCode(_0x350dea,_0x47dfa5){_0x47dfa5=_0x47dfa5||0xcc;return function(_0x121bef){if(_0x121bef){return _0x350dea[_0xd215('0x26')](_0x47dfa5);}return _0x350dea[_0xd215('0x27')](_0x47dfa5)[_0xd215('0x28')]();};}function respondWithResult(_0x5b8ad4,_0x21640a){_0x21640a=_0x21640a||0xc8;return function(_0x2573e7){if(_0x2573e7){return _0x5b8ad4[_0xd215('0x27')](_0x21640a)['json'](_0x2573e7);}};}function respondWithFilteredResult(_0x2a28eb,_0x27207a){return function(_0x58fe5a){if(_0x58fe5a){var _0x160eac=typeof _0x27207a[_0xd215('0x29')]==='undefined'&&typeof _0x27207a[_0xd215('0x2a')]===_0xd215('0x2b');var _0x33253a=_0x58fe5a[_0xd215('0x2c')];var _0x1bc2b6=_0x160eac?0x0:_0x27207a[_0xd215('0x29')];var _0x13e497=_0x160eac?_0x58fe5a[_0xd215('0x2c')]:_0x27207a['offset']+_0x27207a[_0xd215('0x2a')];var _0x185c98;if(_0x13e497>=_0x33253a){_0x13e497=_0x33253a;_0x185c98=0xc8;}else{_0x185c98=0xce;}_0x2a28eb[_0xd215('0x27')](_0x185c98);return _0x2a28eb[_0xd215('0x2d')]('Content-Range',_0x1bc2b6+'-'+_0x13e497+'/'+_0x33253a)[_0xd215('0x2e')](_0x58fe5a);}return null;};}function patchUpdates(_0x1058e6){return function(_0x256796){try{jsonpatch[_0xd215('0x2f')](_0x256796,_0x1058e6,!![]);}catch(_0x4f9e3d){return BPromise['reject'](_0x4f9e3d);}return _0x256796['save']();};}function saveUpdates(_0x289114,_0x5037b3){return function(_0x523518){if(_0x523518){return _0x523518[_0xd215('0x30')](_0x289114)['then'](function(_0x2ddc83){return _0x2ddc83;});}return null;};}function removeEntity(_0x473066,_0x542a34){return function(_0x30acbd){if(_0x30acbd){return _0x30acbd[_0xd215('0x31')]()['then'](function(){_0x473066[_0xd215('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d785,_0x19f987){return function(_0x2548a6){if(!_0x2548a6){_0x21d785[_0xd215('0x26')](0x194);}return _0x2548a6;};}function handleError(_0x3e3e1a,_0x8ef319){_0x8ef319=_0x8ef319||0x1f4;return function(_0x139c26){logger['error'](_0x139c26['stack']);if(_0x139c26[_0xd215('0x32')]){delete _0x139c26[_0xd215('0x32')];}_0x3e3e1a['status'](_0x8ef319)[_0xd215('0x33')](_0x139c26);};}exports[_0xd215('0x34')]=function(_0x3c3ceb,_0x58559c){var _0x3dc750={},_0x244469={},_0x521ba3={'count':0x0,'rows':[]};var _0x5b85ce=_[_0xd215('0x35')](db['Setting'][_0xd215('0x36')],function(_0x5f5bb7){return{'name':_0x5f5bb7['fieldName'],'type':_0x5f5bb7['type'][_0xd215('0x37')]};});_0x244469[_0xd215('0x38')]=_[_0xd215('0x35')](_0x5b85ce,'name');_0x244469[_0xd215('0x39')]=_[_0xd215('0x3a')](_0x3c3ceb[_0xd215('0x39')]);_0x244469[_0xd215('0x3b')]=_[_0xd215('0x3c')](_0x244469[_0xd215('0x38')],_0x244469[_0xd215('0x39')]);_0x3dc750['attributes']=_[_0xd215('0x3c')](_0x244469['model'],qs['fields'](_0x3c3ceb['query']['fields']));_0x3dc750[_0xd215('0x3d')]=_0x3dc750['attributes'][_0xd215('0x3e')]?_0x3dc750[_0xd215('0x3d')]:_0x244469[_0xd215('0x38')];if(!_0x3c3ceb[_0xd215('0x39')][_0xd215('0x3f')](_0xd215('0x40'))){_0x3dc750[_0xd215('0x2a')]=qs[_0xd215('0x2a')](_0x3c3ceb['query'][_0xd215('0x2a')]);_0x3dc750['offset']=qs[_0xd215('0x29')](_0x3c3ceb[_0xd215('0x39')][_0xd215('0x29')]);}_0x3dc750[_0xd215('0x41')]=qs[_0xd215('0x42')](_0x3c3ceb[_0xd215('0x39')][_0xd215('0x42')]);_0x3dc750['where']=qs[_0xd215('0x3b')](_['pick'](_0x3c3ceb['query'],_0x244469[_0xd215('0x3b')]),_0x5b85ce);if(_0x3c3ceb[_0xd215('0x39')][_0xd215('0x43')]){_0x3dc750[_0xd215('0x44')]=_['merge'](_0x3dc750[_0xd215('0x44')],{'$or':_[_0xd215('0x35')](_0x5b85ce,function(_0x1d76e7){if(_0x1d76e7['type']!=='VIRTUAL'){var _0x56930b={};_0x56930b[_0x1d76e7[_0xd215('0x32')]]={'$like':'%'+_0x3c3ceb[_0xd215('0x39')][_0xd215('0x43')]+'%'};return _0x56930b;}})});}_0x3dc750=_[_0xd215('0x45')]({},_0x3dc750,_0x3c3ceb[_0xd215('0x46')]);var _0x584e28={'where':_0x3dc750[_0xd215('0x44')]};return db[_0xd215('0x47')][_0xd215('0x2c')](_0x584e28)[_0xd215('0x1c')](function(_0x2512f0){_0x521ba3[_0xd215('0x2c')]=_0x2512f0;if(_0x3c3ceb[_0xd215('0x39')][_0xd215('0x48')]){_0x3dc750['include']=[{'all':!![]}];}return db[_0xd215('0x47')][_0xd215('0x49')](_0x3dc750);})[_0xd215('0x1c')](function(_0x52b11f){_0x521ba3[_0xd215('0x4a')]=_0x52b11f;return _0x521ba3;})['then'](respondWithFilteredResult(_0x58559c,_0x3dc750))[_0xd215('0x25')](handleError(_0x58559c,null));};exports[_0xd215('0x4b')]=function(_0x2eba87,_0x136e35){var _0x4cd886={'raw':![],'where':{'id':_0x2eba87['params']['id']}},_0x231846={};_0x231846['model']=_[_0xd215('0x3a')](db['Setting']['rawAttributes']);_0x231846[_0xd215('0x39')]=_[_0xd215('0x3a')](_0x2eba87[_0xd215('0x39')]);_0x231846[_0xd215('0x3b')]=_[_0xd215('0x3c')](_0x231846[_0xd215('0x38')],_0x231846[_0xd215('0x39')]);_0x4cd886[_0xd215('0x3d')]=_['intersection'](_0x231846['model'],qs[_0xd215('0x4c')](_0x2eba87[_0xd215('0x39')][_0xd215('0x4c')]));_0x4cd886[_0xd215('0x3d')]=_0x4cd886[_0xd215('0x3d')][_0xd215('0x3e')]?_0x4cd886[_0xd215('0x3d')]:_0x231846[_0xd215('0x38')];if(_0x2eba87['query'][_0xd215('0x48')]){_0x4cd886[_0xd215('0x4d')]=[{'all':!![]}];}_0x4cd886=_[_0xd215('0x45')]({},_0x4cd886,_0x2eba87[_0xd215('0x46')]);return db[_0xd215('0x47')][_0xd215('0x4e')](_0x4cd886)[_0xd215('0x1c')](handleEntityNotFound(_0x136e35,null))[_0xd215('0x1c')](respondWithResult(_0x136e35,null))[_0xd215('0x25')](handleError(_0x136e35,null));};exports[_0xd215('0x30')]=function(_0x2ccba1,_0x413bae){if(_0x2ccba1['body']['id']){delete _0x2ccba1['body']['id'];}return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0x2ccba1[_0xd215('0x4f')]['id']}})[_0xd215('0x1c')](handleEntityNotFound(_0x413bae,null))[_0xd215('0x1c')](saveUpdates(_0x2ccba1[_0xd215('0x50')],null))['then'](respondWithResult(_0x413bae,null))[_0xd215('0x25')](handleError(_0x413bae,null));};exports[_0xd215('0x51')]=function(_0xb3de21,_0x26e8cf,_0x3ce663){if(_0xb3de21[_0xd215('0x52')]&&_0xb3de21['file'][_0xd215('0x53')]){_0xb3de21[_0xd215('0x50')][_0xd215('0x54')]=_0xb3de21[_0xd215('0x52')][_0xd215('0x53')];}return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0xb3de21[_0xd215('0x4f')]['id']}})[_0xd215('0x1c')](handleEntityNotFound(_0x26e8cf,null))[_0xd215('0x1c')](saveUpdates(_0xb3de21[_0xd215('0x50')],null))[_0xd215('0x1c')](respondWithResult(_0x26e8cf,null))['catch'](handleError(_0x26e8cf,null));};exports[_0xd215('0x55')]=function(_0x242121,_0x47e408,_0x1e1b82){if(_0x242121['file']&&_0x242121[_0xd215('0x52')][_0xd215('0x53')]){_0x242121[_0xd215('0x50')][_0xd215('0x56')]=_0x242121[_0xd215('0x52')][_0xd215('0x53')];}return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0x242121[_0xd215('0x4f')]['id']}})[_0xd215('0x1c')](handleEntityNotFound(_0x47e408,null))[_0xd215('0x1c')](saveUpdates(_0x242121[_0xd215('0x50')],null))['then'](respondWithResult(_0x47e408,null))[_0xd215('0x25')](handleError(_0x47e408,null));};var utilLicense=require(_0xd215('0x17'));exports[_0xd215('0x57')]=function(_0x19ed02,_0x1dbe58,_0x3a4c63){var _0x31e287=_0xd215('0x58');var _0x1a15ff={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x3487b3){if(_0x3487b3){_0x1a15ff=_0x3487b3;}return db[_0xd215('0x47')]['find']({'where':{'id':_0x19ed02[_0xd215('0x4f')]['id']},'attributes':[_0xd215('0x54'),_0xd215('0x56'),_0xd215('0x59'),'favicon',_0xd215('0x5a'),_0xd215('0x5b'),_0xd215('0x5c'),'defaultFavicon'],'raw':!![]});})[_0xd215('0x1c')](handleEntityNotFound(_0x1dbe58,null))['then'](function(_0x333035){if(_0x333035){var _0x421ce0=_0x333035[_0xd215('0x54')]&&fs[_0xd215('0x5d')](path[_0xd215('0x5e')](config['root'],_0x31e287,_[_0xd215('0x5f')](_0x333035[_0xd215('0x54')])))?path['join'](config[_0xd215('0x60')],_0x31e287,_[_0xd215('0x5f')](_0x333035['logo'])):path['join'](config[_0xd215('0x60')],_0x31e287,_[_0xd215('0x5f')]('default_logo.svg'));var _0x5c42f4=_0xd215('0x61')+_[_0xd215('0x62')](_0xd215('0x54'));if(_0x333035[_0x5c42f4]||!_0x1a15ff[_0xd215('0x63')]){_0x421ce0=path[_0xd215('0x5e')](config['root'],_0x31e287,_['toLower']('default_logo.svg'));}if(!fs[_0xd215('0x5d')](_0x421ce0)){throw new db['Sequelize'][(_0xd215('0x64'))](_['upperFirst'](_0xd215('0x54'))+_0xd215('0x65'));}return _0x1dbe58[_0xd215('0x66')](_0x421ce0);}})[_0xd215('0x25')](handleError(_0x1dbe58,null));};var utilLicense=require(_0xd215('0x17'));exports[_0xd215('0x67')]=function(_0x10475b,_0x27a3e2,_0x2cf373){var _0x572841='server/files/images/logos';var _0xa1e684={'custom':![]};return utilLicense[_0xd215('0x68')]()['then'](function(_0xe33a6f){if(_0xe33a6f){_0xa1e684=_0xe33a6f;}return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0x10475b['params']['id']},'attributes':[_0xd215('0x54'),'loginLogo',_0xd215('0x59'),_0xd215('0x69'),_0xd215('0x5a'),_0xd215('0x5b'),_0xd215('0x5c'),_0xd215('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x27a3e2,null))[_0xd215('0x1c')](function(_0x123ed4){if(_0x123ed4){var _0x1f5b8c=_0x123ed4[_0xd215('0x56')]&&fs[_0xd215('0x5d')](path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x572841,_[_0xd215('0x5f')](_0x123ed4['loginLogo'])))?path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x572841,_[_0xd215('0x5f')](_0x123ed4[_0xd215('0x56')])):path[_0xd215('0x5e')](config['root'],_0x572841,_[_0xd215('0x5f')](_0xd215('0x6b')));var _0xb84b79=_0xd215('0x61')+_[_0xd215('0x62')](_0xd215('0x56'));if(_0x123ed4[_0xb84b79]||!_0xa1e684[_0xd215('0x63')]){_0x1f5b8c=path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x572841,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xd215('0x5d')](_0x1f5b8c)){throw new db[(_0xd215('0x6c'))]['ValidationError'](_[_0xd215('0x62')](_0xd215('0x56'))+_0xd215('0x65'));}return _0x27a3e2[_0xd215('0x66')](_0x1f5b8c);}})['catch'](handleError(_0x27a3e2,null));};exports[_0xd215('0x6d')]=function(_0x2a10ad,_0x58a93d){return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0x2a10ad[_0xd215('0x4f')]['id']},'attributes':['securePassword']})[_0xd215('0x1c')](respondWithResult(_0x58a93d,null))[_0xd215('0x25')](handleError(_0x58a93d,null));};exports[_0xd215('0x6e')]=function(_0x3546a3,_0x3cb52d,_0x4ceb66){if(_0x3546a3['file']&&_0x3546a3['file'][_0xd215('0x53')]){_0x3546a3['body'][_0xd215('0x59')]=_0x3546a3[_0xd215('0x52')][_0xd215('0x53')];}return db['Setting']['find']({'where':{'id':_0x3546a3[_0xd215('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3cb52d,null))[_0xd215('0x1c')](saveUpdates(_0x3546a3['body'],null))[_0xd215('0x1c')](respondWithResult(_0x3cb52d,null))[_0xd215('0x25')](handleError(_0x3cb52d,null));};var utilLicense=require(_0xd215('0x17'));exports[_0xd215('0x6f')]=function(_0x427abd,_0x152df9,_0x3aeb0b){var _0x2c6144=_0xd215('0x58');var _0x597d9b={'custom':![]};return utilLicense[_0xd215('0x68')]()['then'](function(_0x17b6f9){if(_0x17b6f9){_0x597d9b=_0x17b6f9;}return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0x427abd[_0xd215('0x4f')]['id']},'attributes':['logo',_0xd215('0x56'),_0xd215('0x59'),_0xd215('0x69'),_0xd215('0x5a'),_0xd215('0x5b'),'defaultPreferred',_0xd215('0x6a')],'raw':!![]});})[_0xd215('0x1c')](handleEntityNotFound(_0x152df9,null))[_0xd215('0x1c')](function(_0x2d1396){if(_0x2d1396){var _0x121020=_0x2d1396[_0xd215('0x59')]&&fs['existsSync'](path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x2c6144,_[_0xd215('0x5f')](_0x2d1396[_0xd215('0x59')])))?path['join'](config['root'],_0x2c6144,_['toLower'](_0x2d1396[_0xd215('0x59')])):path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x2c6144,_[_0xd215('0x5f')](_0xd215('0x70')));var _0x26fdf7=_0xd215('0x61')+_[_0xd215('0x62')](_0xd215('0x59'));if(_0x2d1396[_0x26fdf7]||!_0x597d9b[_0xd215('0x63')]||!_0x597d9b['preferred']){_0x121020=path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x2c6144,_['toLower'](_0xd215('0x70')));}if(!fs[_0xd215('0x5d')](_0x121020)){throw new db[(_0xd215('0x6c'))]['ValidationError'](_[_0xd215('0x62')]('preferred')+_0xd215('0x65'));}return _0x152df9['download'](_0x121020);}})[_0xd215('0x25')](handleError(_0x152df9,null));};exports[_0xd215('0x71')]=function(_0x286d96,_0x36bc41,_0x4cfb8c){if(_0x286d96[_0xd215('0x52')]&&_0x286d96[_0xd215('0x52')][_0xd215('0x53')]){_0x286d96[_0xd215('0x50')][_0xd215('0x69')]=_0x286d96['file'][_0xd215('0x53')];}return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0x286d96[_0xd215('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36bc41,null))[_0xd215('0x1c')](saveUpdates(_0x286d96[_0xd215('0x50')],null))[_0xd215('0x1c')](respondWithResult(_0x36bc41,null))['catch'](handleError(_0x36bc41,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x39c11f,_0x268541,_0x28c51f){var _0x1ab594=_0xd215('0x58');var _0x29383e={'custom':![]};return utilLicense['getLicense']()[_0xd215('0x1c')](function(_0x339ca2){if(_0x339ca2){_0x29383e=_0x339ca2;}return db[_0xd215('0x47')][_0xd215('0x4e')]({'where':{'id':_0x39c11f[_0xd215('0x4f')]['id']},'attributes':[_0xd215('0x54'),_0xd215('0x56'),_0xd215('0x59'),_0xd215('0x69'),'defaultLogo',_0xd215('0x5b'),_0xd215('0x5c'),_0xd215('0x6a')],'raw':!![]});})[_0xd215('0x1c')](handleEntityNotFound(_0x268541,null))[_0xd215('0x1c')](function(_0x2f88d7){if(_0x2f88d7){var _0x134182=_0x2f88d7['favicon']&&fs[_0xd215('0x5d')](path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x1ab594,_[_0xd215('0x5f')](_0x2f88d7['favicon'])))?path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x1ab594,_['toLower'](_0x2f88d7[_0xd215('0x69')])):path['join'](config[_0xd215('0x60')],_0x1ab594,_[_0xd215('0x5f')](_0xd215('0x72')));var _0x300294=_0xd215('0x61')+_[_0xd215('0x62')]('favicon');if(_0x2f88d7[_0x300294]||!_0x29383e[_0xd215('0x63')]){_0x134182=path[_0xd215('0x5e')](config[_0xd215('0x60')],_0x1ab594,_[_0xd215('0x5f')](_0xd215('0x72')));}if(!fs[_0xd215('0x5d')](_0x134182)){throw new db['Sequelize'][(_0xd215('0x64'))](_[_0xd215('0x62')](_0xd215('0x69'))+_0xd215('0x65'));}return _0x268541[_0xd215('0x66')](_0x134182);}})[_0xd215('0x25')](handleError(_0x268541,null));};exports[_0xd215('0x73')]=function(_0x311289,_0x337dd2){var _0x169560={'offset':moment()['utcOffset']()};_0x169560[_0xd215('0x74')]=moment()[_0xd215('0x75')](_0x169560[_0xd215('0x29')])['format'](_0xd215('0x76'));return _0x337dd2[_0xd215('0x27')](0xc8)['send'](_0x169560);}; \ No newline at end of file +var _0xf874=['lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','jayson/promise','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','VIRTUAL','filter','merge','where','Setting','includeAll','include','findAll','rows','params','options','find','body','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x466e45,_0x4367fe){var _0x90c013=function(_0xb0f7fc){while(--_0xb0f7fc){_0x466e45['push'](_0x466e45['shift']());}};_0x90c013(++_0x4367fe);}(_0xf874,0xed));var _0x4f87=function(_0x32c4e3,_0x4d34a0){_0x32c4e3=_0x32c4e3-0x0;var _0x5de342=_0xf874[_0x32c4e3];return _0x5de342;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f87('0x0'));var jsonpatch=require(_0x4f87('0x1'));var rp=require(_0x4f87('0x2'));var moment=require(_0x4f87('0x3'));var BPromise=require(_0x4f87('0x4'));var Mustache=require(_0x4f87('0x5'));var util=require('util');var path=require(_0x4f87('0x6'));var sox=require(_0x4f87('0x7'));var csv=require(_0x4f87('0x8'));var ejs=require(_0x4f87('0x9'));var fs=require('fs');var fs_extra=require(_0x4f87('0xa'));var _=require(_0x4f87('0xb'));var squel=require('squel');var crypto=require(_0x4f87('0xc'));var jsforce=require(_0x4f87('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4f87('0x8'));var querystring=require(_0x4f87('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f87('0xf'));var authService=require(_0x4f87('0x10'));var qs=require(_0x4f87('0x11'));var as=require(_0x4f87('0x12'));var hardwareService=require(_0x4f87('0x13'));var logger=require(_0x4f87('0x14'))(_0x4f87('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4f87('0x16'));var db=require(_0x4f87('0x17'))['db'];var jayson=require(_0x4f87('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1cfc27,_0x430bc4,_0x3c4afd,_0x482c6e){return new BPromise(function(_0x2f11d2,_0x4a0e2f){var _0x3d6dcb=_0x482c6e||client;return _0x3d6dcb[_0x4f87('0x19')](_0x1cfc27,_0x3c4afd)['then'](function(_0x2907f6){logger[_0x4f87('0x1a')](_0x4f87('0x1b'),_0x430bc4,_0x4f87('0x1c'));logger[_0x4f87('0x1d')](_0x4f87('0x1e'),_0x430bc4,'request\x20sent',JSON[_0x4f87('0x1f')](_0x2907f6));if(_0x2907f6['error']){if(_0x2907f6[_0x4f87('0x20')][_0x4f87('0x21')]===0x1f4){logger[_0x4f87('0x20')](_0x4f87('0x1b'),_0x430bc4,_0x2907f6[_0x4f87('0x20')][_0x4f87('0x22')]);return _0x4a0e2f(_0x2907f6[_0x4f87('0x20')][_0x4f87('0x22')]);}logger[_0x4f87('0x20')](_0x4f87('0x1b'),_0x430bc4,_0x2907f6[_0x4f87('0x20')][_0x4f87('0x22')]);return _0x2f11d2(_0x2907f6[_0x4f87('0x20')]['message']);}else{logger['info'](_0x4f87('0x1b'),_0x430bc4,_0x4f87('0x1c'));_0x2f11d2(_0x2907f6['result']['message']);}})[_0x4f87('0x23')](function(_0x5d1e62){logger['error'](_0x4f87('0x1b'),_0x430bc4,_0x5d1e62);_0x4a0e2f(_0x5d1e62);});});}function respondWithStatusCode(_0x3c4450,_0x2a382c){_0x2a382c=_0x2a382c||0xcc;return function(_0x3cf180){if(_0x3cf180){return _0x3c4450[_0x4f87('0x24')](_0x2a382c);}return _0x3c4450[_0x4f87('0x25')](_0x2a382c)[_0x4f87('0x26')]();};}function respondWithResult(_0x5c5861,_0x234106){_0x234106=_0x234106||0xc8;return function(_0x11eb83){if(_0x11eb83){return _0x5c5861[_0x4f87('0x25')](_0x234106)['json'](_0x11eb83);}};}function respondWithFilteredResult(_0x211104,_0x3ebff5){return function(_0x51b8dd){if(_0x51b8dd){var _0x19e3ba=typeof _0x3ebff5[_0x4f87('0x27')]===_0x4f87('0x28')&&typeof _0x3ebff5[_0x4f87('0x29')]==='undefined';var _0x4f60dc=_0x51b8dd[_0x4f87('0x2a')];var _0x208f0a=_0x19e3ba?0x0:_0x3ebff5[_0x4f87('0x27')];var _0x39f311=_0x19e3ba?_0x51b8dd[_0x4f87('0x2a')]:_0x3ebff5['offset']+_0x3ebff5[_0x4f87('0x29')];var _0x4ca7c2;if(_0x39f311>=_0x4f60dc){_0x39f311=_0x4f60dc;_0x4ca7c2=0xc8;}else{_0x4ca7c2=0xce;}_0x211104[_0x4f87('0x25')](_0x4ca7c2);return _0x211104[_0x4f87('0x2b')](_0x4f87('0x2c'),_0x208f0a+'-'+_0x39f311+'/'+_0x4f60dc)[_0x4f87('0x2d')](_0x51b8dd);}return null;};}function patchUpdates(_0x3e04ce){return function(_0x23e54a){try{jsonpatch[_0x4f87('0x2e')](_0x23e54a,_0x3e04ce,!![]);}catch(_0x4acb24){return BPromise[_0x4f87('0x2f')](_0x4acb24);}return _0x23e54a['save']();};}function saveUpdates(_0x1d3bec,_0x34b2b0){return function(_0x41f51c){if(_0x41f51c){return _0x41f51c[_0x4f87('0x30')](_0x1d3bec)[_0x4f87('0x31')](function(_0x15eb79){return _0x15eb79;});}return null;};}function removeEntity(_0x2d9683,_0x2bf324){return function(_0xddddfb){if(_0xddddfb){return _0xddddfb[_0x4f87('0x32')]()[_0x4f87('0x31')](function(){_0x2d9683[_0x4f87('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386ffc,_0x409363){return function(_0x5c18a7){if(!_0x5c18a7){_0x386ffc[_0x4f87('0x24')](0x194);}return _0x5c18a7;};}function handleError(_0x989b95,_0x36215a){_0x36215a=_0x36215a||0x1f4;return function(_0x573236){logger[_0x4f87('0x20')](_0x573236[_0x4f87('0x33')]);if(_0x573236['name']){delete _0x573236[_0x4f87('0x34')];}_0x989b95['status'](_0x36215a)[_0x4f87('0x35')](_0x573236);};}exports[_0x4f87('0x36')]=function(_0xa273c7,_0x49f7d0){var _0x2b99fa={},_0x4f0758={},_0x47b7d0={'count':0x0,'rows':[]};var _0x45651a=_[_0x4f87('0x37')](db['Setting'][_0x4f87('0x38')],function(_0x43c9f8){return{'name':_0x43c9f8[_0x4f87('0x39')],'type':_0x43c9f8[_0x4f87('0x3a')]['key']};});_0x4f0758['model']=_['map'](_0x45651a,'name');_0x4f0758[_0x4f87('0x3b')]=_[_0x4f87('0x3c')](_0xa273c7['query']);_0x4f0758[_0x4f87('0x3d')]=_[_0x4f87('0x3e')](_0x4f0758[_0x4f87('0x3f')],_0x4f0758[_0x4f87('0x3b')]);_0x2b99fa[_0x4f87('0x40')]=_[_0x4f87('0x3e')](_0x4f0758['model'],qs[_0x4f87('0x41')](_0xa273c7[_0x4f87('0x3b')]['fields']));_0x2b99fa[_0x4f87('0x40')]=_0x2b99fa[_0x4f87('0x40')][_0x4f87('0x42')]?_0x2b99fa['attributes']:_0x4f0758[_0x4f87('0x3f')];if(!_0xa273c7[_0x4f87('0x3b')]['hasOwnProperty'](_0x4f87('0x43'))){_0x2b99fa[_0x4f87('0x29')]=qs[_0x4f87('0x29')](_0xa273c7[_0x4f87('0x3b')][_0x4f87('0x29')]);_0x2b99fa[_0x4f87('0x27')]=qs['offset'](_0xa273c7[_0x4f87('0x3b')][_0x4f87('0x27')]);}_0x2b99fa[_0x4f87('0x44')]=qs[_0x4f87('0x45')](_0xa273c7['query'][_0x4f87('0x45')]);_0x2b99fa['where']=qs[_0x4f87('0x3d')](_[_0x4f87('0x46')](_0xa273c7[_0x4f87('0x3b')],_0x4f0758[_0x4f87('0x3d')]),_0x45651a);if(_0xa273c7['query']['filter']){_0x2b99fa['where']=_['merge'](_0x2b99fa['where'],{'$or':_['map'](_0x45651a,function(_0x2c90fd){if(_0x2c90fd[_0x4f87('0x3a')]!==_0x4f87('0x47')){var _0x45457c={};_0x45457c[_0x2c90fd[_0x4f87('0x34')]]={'$like':'%'+_0xa273c7[_0x4f87('0x3b')][_0x4f87('0x48')]+'%'};return _0x45457c;}})});}_0x2b99fa=_[_0x4f87('0x49')]({},_0x2b99fa,_0xa273c7['options']);var _0x258698={'where':_0x2b99fa[_0x4f87('0x4a')]};return db[_0x4f87('0x4b')][_0x4f87('0x2a')](_0x258698)[_0x4f87('0x31')](function(_0x704464){_0x47b7d0[_0x4f87('0x2a')]=_0x704464;if(_0xa273c7[_0x4f87('0x3b')][_0x4f87('0x4c')]){_0x2b99fa[_0x4f87('0x4d')]=[{'all':!![]}];}return db[_0x4f87('0x4b')][_0x4f87('0x4e')](_0x2b99fa);})[_0x4f87('0x31')](function(_0x2399ac){_0x47b7d0[_0x4f87('0x4f')]=_0x2399ac;return _0x47b7d0;})[_0x4f87('0x31')](respondWithFilteredResult(_0x49f7d0,_0x2b99fa))[_0x4f87('0x23')](handleError(_0x49f7d0,null));};exports['show']=function(_0x2766d3,_0x4bf596){var _0x59a7ce={'raw':![],'where':{'id':_0x2766d3[_0x4f87('0x50')]['id']}},_0x3e7383={};_0x3e7383[_0x4f87('0x3f')]=_[_0x4f87('0x3c')](db[_0x4f87('0x4b')][_0x4f87('0x38')]);_0x3e7383[_0x4f87('0x3b')]=_[_0x4f87('0x3c')](_0x2766d3[_0x4f87('0x3b')]);_0x3e7383[_0x4f87('0x3d')]=_['intersection'](_0x3e7383['model'],_0x3e7383[_0x4f87('0x3b')]);_0x59a7ce[_0x4f87('0x40')]=_[_0x4f87('0x3e')](_0x3e7383['model'],qs['fields'](_0x2766d3[_0x4f87('0x3b')][_0x4f87('0x41')]));_0x59a7ce[_0x4f87('0x40')]=_0x59a7ce[_0x4f87('0x40')][_0x4f87('0x42')]?_0x59a7ce[_0x4f87('0x40')]:_0x3e7383['model'];if(_0x2766d3[_0x4f87('0x3b')]['includeAll']){_0x59a7ce[_0x4f87('0x4d')]=[{'all':!![]}];}_0x59a7ce=_['merge']({},_0x59a7ce,_0x2766d3[_0x4f87('0x51')]);return db[_0x4f87('0x4b')][_0x4f87('0x52')](_0x59a7ce)[_0x4f87('0x31')](handleEntityNotFound(_0x4bf596,null))[_0x4f87('0x31')](respondWithResult(_0x4bf596,null))[_0x4f87('0x23')](handleError(_0x4bf596,null));};exports[_0x4f87('0x30')]=function(_0x526c78,_0x375809){if(_0x526c78[_0x4f87('0x53')]['id']){delete _0x526c78[_0x4f87('0x53')]['id'];}return db['Setting'][_0x4f87('0x52')]({'where':{'id':_0x526c78['params']['id']}})[_0x4f87('0x31')](handleEntityNotFound(_0x375809,null))[_0x4f87('0x31')](saveUpdates(_0x526c78[_0x4f87('0x53')],null))[_0x4f87('0x31')](respondWithResult(_0x375809,null))[_0x4f87('0x23')](handleError(_0x375809,null));};exports['addLogo']=function(_0x16e323,_0x471025,_0x5bdb9b){if(_0x16e323[_0x4f87('0x54')]&&_0x16e323[_0x4f87('0x54')][_0x4f87('0x55')]){_0x16e323[_0x4f87('0x53')][_0x4f87('0x56')]=_0x16e323[_0x4f87('0x54')][_0x4f87('0x55')];}return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x16e323[_0x4f87('0x50')]['id']}})[_0x4f87('0x31')](handleEntityNotFound(_0x471025,null))[_0x4f87('0x31')](saveUpdates(_0x16e323[_0x4f87('0x53')],null))[_0x4f87('0x31')](respondWithResult(_0x471025,null))[_0x4f87('0x23')](handleError(_0x471025,null));};exports[_0x4f87('0x57')]=function(_0x11df16,_0x3e3871,_0x4080b3){if(_0x11df16[_0x4f87('0x54')]&&_0x11df16[_0x4f87('0x54')][_0x4f87('0x55')]){_0x11df16[_0x4f87('0x53')][_0x4f87('0x58')]=_0x11df16[_0x4f87('0x54')][_0x4f87('0x55')];}return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x11df16[_0x4f87('0x50')]['id']}})[_0x4f87('0x31')](handleEntityNotFound(_0x3e3871,null))[_0x4f87('0x31')](saveUpdates(_0x11df16[_0x4f87('0x53')],null))[_0x4f87('0x31')](respondWithResult(_0x3e3871,null))[_0x4f87('0x23')](handleError(_0x3e3871,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x9ccc0a,_0x4490e7,_0x26a7a9){var _0x55e12f=_0x4f87('0x59');var _0xdb7fe7={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x379e4c){if(_0x379e4c){_0xdb7fe7=_0x379e4c;}return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x9ccc0a['params']['id']},'attributes':[_0x4f87('0x56'),_0x4f87('0x58'),_0x4f87('0x5a'),_0x4f87('0x5b'),_0x4f87('0x5c'),_0x4f87('0x5d'),'defaultPreferred',_0x4f87('0x5e')],'raw':!![]});})[_0x4f87('0x31')](handleEntityNotFound(_0x4490e7,null))[_0x4f87('0x31')](function(_0x589183){if(_0x589183){var _0x4108ac=_0x589183[_0x4f87('0x56')]&&fs[_0x4f87('0x5f')](path['join'](config[_0x4f87('0x60')],_0x55e12f,_[_0x4f87('0x61')](_0x589183[_0x4f87('0x56')])))?path['join'](config[_0x4f87('0x60')],_0x55e12f,_[_0x4f87('0x61')](_0x589183['logo'])):path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x55e12f,_[_0x4f87('0x61')](_0x4f87('0x63')));var _0x45a671=_0x4f87('0x64')+_[_0x4f87('0x65')](_0x4f87('0x56'));if(_0x589183[_0x45a671]||!_0xdb7fe7[_0x4f87('0x66')]){_0x4108ac=path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x55e12f,_[_0x4f87('0x61')](_0x4f87('0x63')));}if(!fs[_0x4f87('0x5f')](_0x4108ac)){throw new db[(_0x4f87('0x67'))][(_0x4f87('0x68'))](_['upperFirst'](_0x4f87('0x56'))+_0x4f87('0x69'));}return _0x4490e7[_0x4f87('0x6a')](_0x4108ac);}})[_0x4f87('0x23')](handleError(_0x4490e7,null));};var utilLicense=require(_0x4f87('0x16'));exports[_0x4f87('0x6b')]=function(_0x42c724,_0x52de13,_0xa4a6e8){var _0x415111=_0x4f87('0x59');var _0x154784={'custom':![]};return utilLicense[_0x4f87('0x6c')]()[_0x4f87('0x31')](function(_0x5530df){if(_0x5530df){_0x154784=_0x5530df;}return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x42c724[_0x4f87('0x50')]['id']},'attributes':['logo',_0x4f87('0x58'),_0x4f87('0x5a'),'favicon','defaultLogo',_0x4f87('0x5d'),'defaultPreferred',_0x4f87('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x52de13,null))[_0x4f87('0x31')](function(_0x22042f){if(_0x22042f){var _0x4a15fe=_0x22042f['loginLogo']&&fs[_0x4f87('0x5f')](path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x415111,_['toLower'](_0x22042f['loginLogo'])))?path[_0x4f87('0x62')](config['root'],_0x415111,_[_0x4f87('0x61')](_0x22042f[_0x4f87('0x58')])):path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x415111,_[_0x4f87('0x61')](_0x4f87('0x6d')));var _0x58abdf=_0x4f87('0x64')+_[_0x4f87('0x65')](_0x4f87('0x58'));if(_0x22042f[_0x58abdf]||!_0x154784['custom']){_0x4a15fe=path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x415111,_[_0x4f87('0x61')]('default_loginLogo.svg'));}if(!fs[_0x4f87('0x5f')](_0x4a15fe)){throw new db['Sequelize'][(_0x4f87('0x68'))](_[_0x4f87('0x65')](_0x4f87('0x58'))+'\x20not\x20found');}return _0x52de13[_0x4f87('0x6a')](_0x4a15fe);}})['catch'](handleError(_0x52de13,null));};exports[_0x4f87('0x6e')]=function(_0x13cb14,_0x17f11e){return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x13cb14['params']['id']},'attributes':[_0x4f87('0x6f')]})[_0x4f87('0x31')](respondWithResult(_0x17f11e,null))[_0x4f87('0x23')](handleError(_0x17f11e,null));};exports[_0x4f87('0x70')]=function(_0x12f372,_0x61e2bb,_0x439757){if(_0x12f372['file']&&_0x12f372[_0x4f87('0x54')]['filename']){_0x12f372[_0x4f87('0x53')]['preferred']=_0x12f372['file']['filename'];}return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x12f372['params']['id']}})['then'](handleEntityNotFound(_0x61e2bb,null))[_0x4f87('0x31')](saveUpdates(_0x12f372[_0x4f87('0x53')],null))['then'](respondWithResult(_0x61e2bb,null))[_0x4f87('0x23')](handleError(_0x61e2bb,null));};var utilLicense=require(_0x4f87('0x16'));exports[_0x4f87('0x71')]=function(_0x29ce5b,_0x289531,_0x475a81){var _0x1842e3=_0x4f87('0x59');var _0x54b994={'custom':![]};return utilLicense[_0x4f87('0x6c')]()[_0x4f87('0x31')](function(_0x576565){if(_0x576565){_0x54b994=_0x576565;}return db['Setting'][_0x4f87('0x52')]({'where':{'id':_0x29ce5b[_0x4f87('0x50')]['id']},'attributes':[_0x4f87('0x56'),_0x4f87('0x58'),_0x4f87('0x5a'),_0x4f87('0x5b'),_0x4f87('0x5c'),_0x4f87('0x5d'),_0x4f87('0x72'),'defaultFavicon'],'raw':!![]});})[_0x4f87('0x31')](handleEntityNotFound(_0x289531,null))['then'](function(_0x3b1b12){if(_0x3b1b12){var _0x5bc69c=_0x3b1b12[_0x4f87('0x5a')]&&fs[_0x4f87('0x5f')](path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x1842e3,_[_0x4f87('0x61')](_0x3b1b12[_0x4f87('0x5a')])))?path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x1842e3,_['toLower'](_0x3b1b12[_0x4f87('0x5a')])):path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x1842e3,_['toLower'](_0x4f87('0x73')));var _0x19c9d8='default'+_['upperFirst'](_0x4f87('0x5a'));if(_0x3b1b12[_0x19c9d8]||!_0x54b994[_0x4f87('0x66')]||!_0x54b994['preferred']){_0x5bc69c=path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x1842e3,_[_0x4f87('0x61')](_0x4f87('0x73')));}if(!fs[_0x4f87('0x5f')](_0x5bc69c)){throw new db['Sequelize'][(_0x4f87('0x68'))](_['upperFirst'](_0x4f87('0x5a'))+_0x4f87('0x69'));}return _0x289531['download'](_0x5bc69c);}})[_0x4f87('0x23')](handleError(_0x289531,null));};exports[_0x4f87('0x74')]=function(_0x199265,_0x3934b0,_0x36b228){if(_0x199265[_0x4f87('0x54')]&&_0x199265[_0x4f87('0x54')][_0x4f87('0x55')]){_0x199265[_0x4f87('0x53')]['favicon']=_0x199265[_0x4f87('0x54')][_0x4f87('0x55')];}return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x199265[_0x4f87('0x50')]['id']}})[_0x4f87('0x31')](handleEntityNotFound(_0x3934b0,null))['then'](saveUpdates(_0x199265['body'],null))[_0x4f87('0x31')](respondWithResult(_0x3934b0,null))[_0x4f87('0x23')](handleError(_0x3934b0,null));};var utilLicense=require(_0x4f87('0x16'));exports[_0x4f87('0x75')]=function(_0x46929b,_0x301523,_0x999fb8){var _0x500872='server/files/images/logos';var _0x341fc3={'custom':![]};return utilLicense['getLicense']()[_0x4f87('0x31')](function(_0x30b099){if(_0x30b099){_0x341fc3=_0x30b099;}return db[_0x4f87('0x4b')][_0x4f87('0x52')]({'where':{'id':_0x46929b[_0x4f87('0x50')]['id']},'attributes':['logo',_0x4f87('0x58'),_0x4f87('0x5a'),_0x4f87('0x5b'),'defaultLogo',_0x4f87('0x5d'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x4f87('0x31')](handleEntityNotFound(_0x301523,null))['then'](function(_0x1a3f52){if(_0x1a3f52){var _0x1cb731=_0x1a3f52[_0x4f87('0x5b')]&&fs[_0x4f87('0x5f')](path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x500872,_['toLower'](_0x1a3f52[_0x4f87('0x5b')])))?path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x500872,_[_0x4f87('0x61')](_0x1a3f52[_0x4f87('0x5b')])):path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x500872,_['toLower']('default_favicon.ico'));var _0x12d208='default'+_[_0x4f87('0x65')](_0x4f87('0x5b'));if(_0x1a3f52[_0x12d208]||!_0x341fc3[_0x4f87('0x66')]){_0x1cb731=path[_0x4f87('0x62')](config[_0x4f87('0x60')],_0x500872,_[_0x4f87('0x61')](_0x4f87('0x76')));}if(!fs[_0x4f87('0x5f')](_0x1cb731)){throw new db['Sequelize'][(_0x4f87('0x68'))](_[_0x4f87('0x65')]('favicon')+_0x4f87('0x69'));}return _0x301523['download'](_0x1cb731);}})[_0x4f87('0x23')](handleError(_0x301523,null));};exports[_0x4f87('0x77')]=function(_0x4422b7,_0x2f3dd2){var _0x146f3e={'offset':moment()[_0x4f87('0x78')]()};_0x146f3e[_0x4f87('0x79')]=moment()[_0x4f87('0x78')](_0x146f3e[_0x4f87('0x27')])[_0x4f87('0x7a')](_0x4f87('0x7b'));return _0x2f3dd2['status'](0xc8)[_0x4f87('0x35')](_0x146f3e);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index efaa1e9..9259d67 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0x55ca,0x126));var _0xa55c=function(_0x11ba32,_0x5a7ba6){_0x11ba32=_0x11ba32-0x0;var _0x296558=_0x55ca[_0x11ba32];return _0x296558;};'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')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x52a78a,_0x365f1e){var _0x486241=function(_0x4cb2c8){while(--_0x4cb2c8){_0x52a78a['push'](_0x52a78a['shift']());}};_0x486241(++_0x365f1e);}(_0xedd9,0xfc));var _0x9edd=function(_0x29c0ae,_0x38c3e8){_0x29c0ae=_0x29c0ae-0x0;var _0x38e110=_0xedd9[_0x29c0ae];return _0x38e110;};'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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 28e2dff..588048f 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 _0x8140=['message','catch','ShowSetting','Setting','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8140,0x6b));var _0x0814=function(_0xad05f4,_0x22d143){_0xad05f4=_0xad05f4-0x0;var _0x488a7d=_0x8140[_0xad05f4];return _0x488a7d;};'use strict';var _=require(_0x0814('0x0'));var util=require(_0x0814('0x1'));var moment=require(_0x0814('0x2'));var BPromise=require(_0x0814('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0814('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0814('0x5'));var logger=require(_0x0814('0x6'))(_0x0814('0x7'));var config=require(_0x0814('0x8'));var jayson=require(_0x0814('0x9'));var client=jayson[_0x0814('0xa')][_0x0814('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2127f5,_0x17a2f3,_0x168d4d){return new BPromise(function(_0x1e583c,_0x16643e){return client[_0x0814('0xc')](_0x2127f5,_0x168d4d)[_0x0814('0xd')](function(_0x5d8536){logger[_0x0814('0xe')](_0x0814('0xf'),_0x17a2f3,_0x0814('0x10'));logger['debug'](_0x0814('0x11'),_0x17a2f3,_0x0814('0x10'),JSON[_0x0814('0x12')](_0x5d8536));if(_0x5d8536['error']){if(_0x5d8536['error'][_0x0814('0x13')]===0x1f4){logger[_0x0814('0x14')](_0x0814('0xf'),_0x17a2f3,_0x5d8536[_0x0814('0x14')]['message']);return _0x16643e(_0x5d8536['error'][_0x0814('0x15')]);}logger['error'](_0x0814('0xf'),_0x17a2f3,_0x5d8536[_0x0814('0x14')]['message']);return _0x1e583c(_0x5d8536['error'][_0x0814('0x15')]);}else{logger[_0x0814('0xe')](_0x0814('0xf'),_0x17a2f3,_0x0814('0x10'));_0x1e583c(_0x5d8536['result']['message']);}})[_0x0814('0x16')](function(_0x156817){logger[_0x0814('0x14')](_0x0814('0xf'),_0x17a2f3,_0x156817);_0x16643e(_0x156817);});});}exports[_0x0814('0x17')]=function(_0xc8f11c){var _0x364668=this;return new Promise(function(_0x4aee15,_0x3aa0da){return db[_0x0814('0x18')][_0x0814('0x19')]({'raw':_0xc8f11c[_0x0814('0x1a')]?_0xc8f11c[_0x0814('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xc8f11c[_0x0814('0x1a')]?_0xc8f11c['options'][_0x0814('0x1b')]||null:null,'attributes':_0xc8f11c[_0x0814('0x1a')]?_0xc8f11c['options'][_0x0814('0x1c')]||null:null,'include':_0xc8f11c[_0x0814('0x1a')]?_0xc8f11c[_0x0814('0x1a')][_0x0814('0x1d')]?_[_0x0814('0x1e')](_0xc8f11c[_0x0814('0x1a')][_0x0814('0x1d')],function(_0x5a4013){return{'model':db[_0x5a4013['model']],'as':_0x5a4013['as'],'attributes':_0x5a4013[_0x0814('0x1c')],'include':_0x5a4013['include']?_[_0x0814('0x1e')](_0x5a4013[_0x0814('0x1d')],function(_0x3b93e1){return{'model':db[_0x3b93e1[_0x0814('0x1f')]],'as':_0x3b93e1['as'],'attributes':_0x3b93e1[_0x0814('0x1c')],'include':_0x3b93e1[_0x0814('0x1d')]?_[_0x0814('0x1e')](_0x3b93e1[_0x0814('0x1d')],function(_0x421796){return{'model':db[_0x421796[_0x0814('0x1f')]],'as':_0x421796['as'],'attributes':_0x421796[_0x0814('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x578c7a){logger[_0x0814('0xe')](_0x0814('0x17'),_0xc8f11c);logger['debug'](_0x0814('0x17'),_0xc8f11c,JSON['stringify'](_0x578c7a));_0x4aee15(_0x578c7a);})[_0x0814('0x16')](function(_0x2edf01){logger[_0x0814('0x14')](_0x0814('0x17'),_0x2edf01['message'],_0xc8f11c);_0x3aa0da(_0x364668['error'](0x1f4,_0x2edf01[_0x0814('0x15')]));});});}; \ No newline at end of file +var _0x8a29=['catch','ShowSetting','options','raw','where','attributes','map','include','model','then','stringify','lodash','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','error','message','Setting,\x20%s,\x20%s'];(function(_0x17a8b5,_0x2842bd){var _0x3c05c6=function(_0x3d85ee){while(--_0x3d85ee){_0x17a8b5['push'](_0x17a8b5['shift']());}};_0x3c05c6(++_0x2842bd);}(_0x8a29,0xc1));var _0x98a2=function(_0x4baeff,_0x358da8){_0x4baeff=_0x4baeff-0x0;var _0x2288f7=_0x8a29[_0x4baeff];return _0x2288f7;};'use strict';var _=require(_0x98a2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x98a2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98a2('0x2'))['db'];var utils=require(_0x98a2('0x3'));var logger=require('../../config/logger')(_0x98a2('0x4'));var config=require('../../config/environment');var jayson=require(_0x98a2('0x5'));var client=jayson[_0x98a2('0x6')][_0x98a2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x446fdf,_0x560cac,_0x79d57c){return new BPromise(function(_0x15fbd8,_0x22e9ba){return client[_0x98a2('0x8')](_0x446fdf,_0x79d57c)['then'](function(_0x1b4885){logger[_0x98a2('0x9')]('Setting,\x20%s,\x20%s',_0x560cac,_0x98a2('0xa'));logger[_0x98a2('0xb')]('Setting,\x20%s,\x20%s,\x20%s',_0x560cac,_0x98a2('0xa'),JSON['stringify'](_0x1b4885));if(_0x1b4885[_0x98a2('0xc')]){if(_0x1b4885[_0x98a2('0xc')]['code']===0x1f4){logger[_0x98a2('0xc')]('Setting,\x20%s,\x20%s',_0x560cac,_0x1b4885['error'][_0x98a2('0xd')]);return _0x22e9ba(_0x1b4885[_0x98a2('0xc')][_0x98a2('0xd')]);}logger[_0x98a2('0xc')](_0x98a2('0xe'),_0x560cac,_0x1b4885['error']['message']);return _0x15fbd8(_0x1b4885[_0x98a2('0xc')][_0x98a2('0xd')]);}else{logger[_0x98a2('0x9')](_0x98a2('0xe'),_0x560cac,_0x98a2('0xa'));_0x15fbd8(_0x1b4885['result'][_0x98a2('0xd')]);}})[_0x98a2('0xf')](function(_0x44ed5a){logger['error'](_0x98a2('0xe'),_0x560cac,_0x44ed5a);_0x22e9ba(_0x44ed5a);});});}exports[_0x98a2('0x10')]=function(_0x41a600){var _0xcc0f10=this;return new Promise(function(_0x590061,_0x3a28e3){return db['Setting']['find']({'raw':_0x41a600[_0x98a2('0x11')]?_0x41a600['options'][_0x98a2('0x12')]===undefined?!![]:![]:!![],'where':_0x41a600[_0x98a2('0x11')]?_0x41a600[_0x98a2('0x11')][_0x98a2('0x13')]||null:null,'attributes':_0x41a600[_0x98a2('0x11')]?_0x41a600[_0x98a2('0x11')][_0x98a2('0x14')]||null:null,'include':_0x41a600[_0x98a2('0x11')]?_0x41a600['options']['include']?_[_0x98a2('0x15')](_0x41a600[_0x98a2('0x11')][_0x98a2('0x16')],function(_0x3c17cb){return{'model':db[_0x3c17cb[_0x98a2('0x17')]],'as':_0x3c17cb['as'],'attributes':_0x3c17cb[_0x98a2('0x14')],'include':_0x3c17cb[_0x98a2('0x16')]?_['map'](_0x3c17cb[_0x98a2('0x16')],function(_0x2d1133){return{'model':db[_0x2d1133[_0x98a2('0x17')]],'as':_0x2d1133['as'],'attributes':_0x2d1133['attributes'],'include':_0x2d1133['include']?_[_0x98a2('0x15')](_0x2d1133[_0x98a2('0x16')],function(_0x508060){return{'model':db[_0x508060[_0x98a2('0x17')]],'as':_0x508060['as'],'attributes':_0x508060[_0x98a2('0x14')]};}):[]};}):[]};}):[]:[]})[_0x98a2('0x18')](function(_0x297c9a){logger[_0x98a2('0x9')]('ShowSetting',_0x41a600);logger[_0x98a2('0xb')](_0x98a2('0x10'),_0x41a600,JSON[_0x98a2('0x19')](_0x297c9a));_0x590061(_0x297c9a);})[_0x98a2('0xf')](function(_0x3c5421){logger[_0x98a2('0xc')](_0x98a2('0x10'),_0x3c5421[_0x98a2('0xd')],_0x41a600);_0x3a28e3(_0xcc0f10[_0x98a2('0xc')](0x1f4,_0x3c5421[_0x98a2('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 73635fe..bb32213 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 _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x56b2a8,_0x4185ea){_0x56b2a8=_0x56b2a8-0x0;var _0x42ff54=_0x1cb9[_0x56b2a8];return _0x42ff54;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file +var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x1aa4b0,_0x652db6){var _0x55fe29=function(_0x9db784){while(--_0x9db784){_0x1aa4b0['push'](_0x1aa4b0['shift']());}};_0x55fe29(++_0x652db6);}(_0x6aa7,0x178));var _0x76aa=function(_0x1f7391,_0x176415){_0x1f7391=_0x1f7391-0x0;var _0x5ea1e5=_0x6aa7[_0x1f7391];return _0x5ea1e5;};'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('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('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 8eaf82a..23f862e 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 _0xc94f=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','skebby','connectel','plivo','clickatell','bandwidth','csc'];(function(_0x3f149c,_0x2fc990){var _0x2b0cd8=function(_0x2e52df){while(--_0x2e52df){_0x3f149c['push'](_0x3f149c['shift']());}};_0x2b0cd8(++_0x2fc990);}(_0xc94f,0x71));var _0xfc94=function(_0x562bc7,_0x35e50e){_0x562bc7=_0x562bc7-0x0;var _0x2096aa=_0xc94f[_0x562bc7];return _0x2096aa;};'use strict';var Sequelize=require(_0xfc94('0x0'));var rs=require(_0xfc94('0x1'));module[_0xfc94('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc94('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xfc94('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xfc94('0x4')],'defaultValue':function(){return rs[_0xfc94('0x5')]();}},'phone':{'type':Sequelize[_0xfc94('0x4')]},'type':{'type':Sequelize[_0xfc94('0x6')]('twilio',_0xfc94('0x7'),_0xfc94('0x8'),'clicksend',_0xfc94('0x9'),_0xfc94('0xa'),_0xfc94('0xb'),_0xfc94('0xc'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xfc94('0x4')]},'authId':{'type':Sequelize[_0xfc94('0x4')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xfc94('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xfc94('0x4')]},'apiKey':{'type':Sequelize[_0xfc94('0x4')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xfc94('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xfc94('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfc94('0xd');}},'notificationSound':{'type':Sequelize[_0xfc94('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfc94('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfc94('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfc94('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc94('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc94('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfc94('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfc94('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xfc94('0xe')],'defaultValue':![],'comment':_0xfc94('0x11'),'set':function(_0x49f30b){if(!_0x49f30b)this['setDataValue'](_0xfc94('0x12'),null);this[_0xfc94('0x13')](_0xfc94('0x14'),_0x49f30b);}}}; \ No newline at end of file +var _0x0ff4=['exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x448f50,_0x5587ba){var _0x2af4c3=function(_0x5f2616){while(--_0x5f2616){_0x448f50['push'](_0x448f50['shift']());}};_0x2af4c3(++_0x5587ba);}(_0x0ff4,0x1b3));var _0x40ff=function(_0x132889,_0x2207a8){_0x132889=_0x132889-0x0;var _0xd93752=_0x0ff4[_0x132889];return _0xd93752;};'use strict';var Sequelize=require(_0x40ff('0x0'));var rs=require(_0x40ff('0x1'));module[_0x40ff('0x2')]={'name':{'type':Sequelize[_0x40ff('0x3')],'unique':_0x40ff('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x40ff('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x40ff('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x40ff('0x5')]();}},'phone':{'type':Sequelize[_0x40ff('0x3')]},'type':{'type':Sequelize[_0x40ff('0x6')](_0x40ff('0x7'),_0x40ff('0x8'),_0x40ff('0x9'),_0x40ff('0xa'),_0x40ff('0xb'),'clickatell',_0x40ff('0xc'),'csc',_0x40ff('0xd'),_0x40ff('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x40ff('0x3')]},'authToken':{'type':Sequelize[_0x40ff('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x40ff('0x3')]},'password':{'type':Sequelize[_0x40ff('0x3')]},'apiKey':{'type':Sequelize[_0x40ff('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x40ff('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x40ff('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x40ff('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x40ff('0x10');}},'notificationSound':{'type':Sequelize[_0x40ff('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x40ff('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x40ff('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x40ff('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x40ff('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x40ff('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x40ff('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x40ff('0x11')],'comment':_0x40ff('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x40ff('0xf')],'defaultValue':![],'comment':_0x40ff('0x13'),'set':function(_0x5471be){if(!_0x5471be)this[_0x40ff('0x14')](_0x40ff('0x15'),null);this[_0x40ff('0x14')](_0x40ff('0x16'),_0x5471be);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 29d2922..e3d110b 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 _0x582d=['rows','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','clicksend','message_id','plivo','Text','results','text','csc','originatingAddress','segmentedMessage','fromNumber','bandwidth','intelepeer','refid','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','Contacts','DESC','list','omit','contact','SmsInteraction','spread','push','close','unmanaged','interaction','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','infobip','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','DELIVRD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../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','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','sendStatus','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','show','params','mandatoryDispositionPause','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','SmsAccountId','Disposition','findOne','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x582d,0x7b));var _0xd582=function(_0x19fb1c,_0x29b30d){_0x19fb1c=_0x19fb1c-0x0;var _0x2036b2=_0x582d[_0x19fb1c];return _0x2036b2;};'use strict';var emlformat=require(_0xd582('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd582('0x1'));var jsonpatch=require(_0xd582('0x2'));var rp=require('request-promise');var moment=require(_0xd582('0x3'));var BPromise=require(_0xd582('0x4'));var Mustache=require(_0xd582('0x5'));var util=require(_0xd582('0x6'));var path=require(_0xd582('0x7'));var sox=require('sox');var csv=require(_0xd582('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd582('0x9'));var _=require(_0xd582('0xa'));var squel=require('squel');var crypto=require(_0xd582('0xb'));var jsforce=require(_0xd582('0xc'));var deskjs=require(_0xd582('0xd'));var toCsv=require(_0xd582('0x8'));var querystring=require('querystring');var Papa=require(_0xd582('0xe'));var Redis=require('ioredis');var authService=require(_0xd582('0xf'));var qs=require(_0xd582('0x10'));var as=require(_0xd582('0x11'));var hardwareService=require(_0xd582('0x12'));var logger=require(_0xd582('0x13'))(_0xd582('0x14'));var utils=require(_0xd582('0x15'));var config=require(_0xd582('0x16'));var licenseUtil=require(_0xd582('0x17'));var db=require(_0xd582('0x18'))['db'];config[_0xd582('0x19')]=_[_0xd582('0x1a')](config[_0xd582('0x19')],{'host':_0xd582('0x1b'),'port':0x18eb});var socket=require(_0xd582('0x1c'))(new Redis(config['redis']));require(_0xd582('0x1d'))[_0xd582('0x1e')](socket);var jayson=require(_0xd582('0x1f'));var client=jayson['client'][_0xd582('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x43d733,_0x5c11ba,_0x2bdccd,_0x53a85c){return new BPromise(function(_0x16cd61,_0x44bbaa){var _0x5e6350=_0x53a85c||client;return _0x5e6350[_0xd582('0x21')](_0x43d733,_0x2bdccd)[_0xd582('0x22')](function(_0x2e6e8e){logger['info'](_0xd582('0x23'),_0x5c11ba,_0xd582('0x24'));logger[_0xd582('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5c11ba,_0xd582('0x24'),JSON[_0xd582('0x26')](_0x2e6e8e));if(_0x2e6e8e[_0xd582('0x27')]){if(_0x2e6e8e['error'][_0xd582('0x28')]===0x1f4){logger[_0xd582('0x27')](_0xd582('0x23'),_0x5c11ba,_0x2e6e8e['error']['message']);return _0x44bbaa(_0x2e6e8e[_0xd582('0x27')][_0xd582('0x29')]);}logger[_0xd582('0x27')](_0xd582('0x23'),_0x5c11ba,_0x2e6e8e[_0xd582('0x27')]['message']);return _0x16cd61(_0x2e6e8e[_0xd582('0x27')][_0xd582('0x29')]);}else{logger[_0xd582('0x2a')](_0xd582('0x23'),_0x5c11ba,_0xd582('0x24'));_0x16cd61(_0x2e6e8e['result']['message']);}})[_0xd582('0x2b')](function(_0x1e247d){logger[_0xd582('0x27')](_0xd582('0x23'),_0x5c11ba,_0x1e247d);_0x44bbaa(_0x1e247d);});});}function respondWithStatusCode(_0x2e730f,_0x50e650){_0x50e650=_0x50e650||0xcc;return function(_0x27ee19){if(_0x27ee19){return _0x2e730f['sendStatus'](_0x50e650);}return _0x2e730f[_0xd582('0x2c')](_0x50e650)[_0xd582('0x2d')]();};}function respondWithResult(_0x2bed67,_0x58e9e9){_0x58e9e9=_0x58e9e9||0xc8;return function(_0x4a4e28){if(_0x4a4e28){return _0x2bed67[_0xd582('0x2c')](_0x58e9e9)[_0xd582('0x2e')](_0x4a4e28);}};}function respondWithFilteredResult(_0x15c22b,_0x54842d){return function(_0x2148c2){if(_0x2148c2){var _0x3078b2=typeof _0x54842d[_0xd582('0x2f')]==='undefined'&&typeof _0x54842d[_0xd582('0x30')]===_0xd582('0x31');var _0x57cb8c=_0x2148c2[_0xd582('0x32')];var _0x35b683=_0x3078b2?0x0:_0x54842d['offset'];var _0x148f6c=_0x3078b2?_0x2148c2['count']:_0x54842d['offset']+_0x54842d['limit'];var _0x47ed21;if(_0x148f6c>=_0x57cb8c){_0x148f6c=_0x57cb8c;_0x47ed21=0xc8;}else{_0x47ed21=0xce;}_0x15c22b[_0xd582('0x2c')](_0x47ed21);return _0x15c22b[_0xd582('0x33')](_0xd582('0x34'),_0x35b683+'-'+_0x148f6c+'/'+_0x57cb8c)['json'](_0x2148c2);}return null;};}function patchUpdates(_0x2e0771){return function(_0x5ca31d){try{jsonpatch[_0xd582('0x35')](_0x5ca31d,_0x2e0771,!![]);}catch(_0xa866a9){return BPromise[_0xd582('0x36')](_0xa866a9);}return _0x5ca31d[_0xd582('0x37')]();};}function saveUpdates(_0x113d4f,_0x35f44c){return function(_0x54b2c4){if(_0x54b2c4){return _0x54b2c4[_0xd582('0x38')](_0x113d4f)[_0xd582('0x22')](function(_0x33c14f){return _0x33c14f;});}return null;};}function removeEntity(_0x44b5fb,_0x4842ce){return function(_0x4e7c0c){if(_0x4e7c0c){return _0x4e7c0c[_0xd582('0x39')]()[_0xd582('0x22')](function(){var _0x4aad4c=_0x4e7c0c[_0xd582('0x3a')]({'plain':!![]});var _0x3bd6a5='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x3bd6a5,'resourceId':_0x4aad4c['id']}})[_0xd582('0x22')](function(){return _0x4e7c0c;});})[_0xd582('0x22')](function(){_0x44b5fb[_0xd582('0x2c')](0xcc)[_0xd582('0x2d')]();});}};}function handleEntityNotFound(_0x480da6,_0xab40df){return function(_0x1e8996){if(!_0x1e8996){_0x480da6[_0xd582('0x3b')](0x194);}return _0x1e8996;};}function handleError(_0x1b6b67,_0x366759){_0x366759=_0x366759||0x1f4;return function(_0x2e64db){logger[_0xd582('0x27')](_0x2e64db[_0xd582('0x3c')]);if(_0x2e64db['name']){delete _0x2e64db[_0xd582('0x3d')];}_0x1b6b67[_0xd582('0x2c')](_0x366759)[_0xd582('0x3e')](_0x2e64db);};}exports[_0xd582('0x3f')]=function(_0x5513ea,_0x30c8ff){var _0x56bf65={'include':[{'model':db[_0xd582('0x40')],'as':'mandatoryDispositionPause'}]},_0x5428e4={},_0x357e5c={'count':0x0,'rows':[]};var _0x4bd4a3=_[_0xd582('0x41')](db[_0xd582('0x42')][_0xd582('0x43')],function(_0x4d59b9){return{'name':_0x4d59b9['fieldName'],'type':_0x4d59b9[_0xd582('0x44')][_0xd582('0x45')]};});_0x5428e4['model']=_[_0xd582('0x41')](_0x4bd4a3,'name');_0x5428e4[_0xd582('0x46')]=_['keys'](_0x5513ea[_0xd582('0x46')]);_0x5428e4[_0xd582('0x47')]=_[_0xd582('0x48')](_0x5428e4[_0xd582('0x49')],_0x5428e4[_0xd582('0x46')]);_0x56bf65[_0xd582('0x4a')]=_['intersection'](_0x5428e4['model'],qs[_0xd582('0x4b')](_0x5513ea[_0xd582('0x46')][_0xd582('0x4b')]));_0x56bf65[_0xd582('0x4a')]=_0x56bf65[_0xd582('0x4a')][_0xd582('0x4c')]?_0x56bf65[_0xd582('0x4a')]:_0x5428e4[_0xd582('0x49')];if(!_0x5513ea['query'][_0xd582('0x4d')](_0xd582('0x4e'))){_0x56bf65[_0xd582('0x30')]=qs[_0xd582('0x30')](_0x5513ea[_0xd582('0x46')][_0xd582('0x30')]);_0x56bf65[_0xd582('0x2f')]=qs[_0xd582('0x2f')](_0x5513ea[_0xd582('0x46')][_0xd582('0x2f')]);}_0x56bf65[_0xd582('0x4f')]=qs[_0xd582('0x50')](_0x5513ea['query']['sort']);_0x56bf65[_0xd582('0x51')]=qs[_0xd582('0x47')](_[_0xd582('0x52')](_0x5513ea[_0xd582('0x46')],_0x5428e4[_0xd582('0x47')]),_0x4bd4a3);if(_0x5513ea[_0xd582('0x46')][_0xd582('0x53')]){_0x56bf65[_0xd582('0x51')]=_['merge'](_0x56bf65['where'],{'$or':_[_0xd582('0x41')](_0x4bd4a3,function(_0x553b66){if(_0x553b66[_0xd582('0x44')]!=='VIRTUAL'){var _0x12182d={};_0x12182d[_0x553b66[_0xd582('0x3d')]]={'$like':'%'+_0x5513ea[_0xd582('0x46')][_0xd582('0x53')]+'%'};return _0x12182d;}})});}_0x56bf65=_['merge']({},_0x56bf65,_0x5513ea[_0xd582('0x54')]);var _0x3c72f6={'where':_0x56bf65[_0xd582('0x51')]};return db[_0xd582('0x42')]['count'](_0x3c72f6)['then'](function(_0x1f6a8f){_0x357e5c[_0xd582('0x32')]=_0x1f6a8f;if(_0x5513ea[_0xd582('0x46')]['includeAll']){_0x56bf65[_0xd582('0x55')]=[{'all':!![]}];}return db['SmsAccount'][_0xd582('0x56')](_0x56bf65);})[_0xd582('0x22')](function(_0x3ba05e){_0x357e5c['rows']=_0x3ba05e;return _0x357e5c;})[_0xd582('0x22')](respondWithFilteredResult(_0x30c8ff,_0x56bf65))['catch'](handleError(_0x30c8ff,null));};exports[_0xd582('0x57')]=function(_0x23df7a,_0x47ef44){var _0x4d8c14={'raw':![],'where':{'id':_0x23df7a[_0xd582('0x58')]['id']},'include':[{'model':db[_0xd582('0x40')],'as':_0xd582('0x59')}]},_0x20eb68={};_0x20eb68[_0xd582('0x49')]=_[_0xd582('0x5a')](db[_0xd582('0x42')][_0xd582('0x43')]);_0x20eb68['query']=_[_0xd582('0x5a')](_0x23df7a[_0xd582('0x46')]);_0x20eb68[_0xd582('0x47')]=_['intersection'](_0x20eb68[_0xd582('0x49')],_0x20eb68[_0xd582('0x46')]);_0x4d8c14['attributes']=_[_0xd582('0x48')](_0x20eb68[_0xd582('0x49')],qs[_0xd582('0x4b')](_0x23df7a[_0xd582('0x46')]['fields']));_0x4d8c14[_0xd582('0x4a')]=_0x4d8c14['attributes']['length']?_0x4d8c14['attributes']:_0x20eb68[_0xd582('0x49')];if(_0x23df7a['query'][_0xd582('0x5b')]){_0x4d8c14['include']=[{'all':!![]}];}_0x4d8c14=_['merge']({},_0x4d8c14,_0x23df7a[_0xd582('0x54')]);return db[_0xd582('0x42')][_0xd582('0x5c')](_0x4d8c14)[_0xd582('0x22')](handleEntityNotFound(_0x47ef44,null))[_0xd582('0x22')](respondWithResult(_0x47ef44,null))[_0xd582('0x2b')](handleError(_0x47ef44,null));};exports[_0xd582('0x5d')]=function(_0x20dd51,_0x534045){return db['SmsAccount'][_0xd582('0x5d')](_0x20dd51[_0xd582('0x5e')],{})[_0xd582('0x22')](function(_0x301efd){var _0x4ce859=_0x20dd51[_0xd582('0x5f')][_0xd582('0x3a')]({'plain':!![]});if(!_0x4ce859)throw new Error(_0xd582('0x60'));if(_0x4ce859[_0xd582('0x61')]===_0xd582('0x5f')){var _0x330193=_0x301efd[_0xd582('0x3a')]({'plain':!![]});var _0x174cf2=_0xd582('0x62');return db[_0xd582('0x63')]['find']({'where':{'name':_0x174cf2,'userProfileId':_0x4ce859[_0xd582('0x64')]},'raw':!![]})[_0xd582('0x22')](function(_0x312be3){if(_0x312be3&&_0x312be3[_0xd582('0x65')]===0x0){return db[_0xd582('0x66')][_0xd582('0x5d')]({'name':_0x330193[_0xd582('0x3d')],'resourceId':_0x330193['id'],'type':_0x312be3[_0xd582('0x3d')],'sectionId':_0x312be3['id']},{})[_0xd582('0x22')](function(){return _0x301efd;});}else{return _0x301efd;}})[_0xd582('0x2b')](function(_0x27d383){logger[_0xd582('0x27')](_0xd582('0x67'),_0x27d383);throw _0x27d383;});}return _0x301efd;})[_0xd582('0x22')](respondWithResult(_0x534045,0xc9))['catch'](handleError(_0x534045,null));};exports[_0xd582('0x38')]=function(_0xcf52a,_0xf08db){if(_0xcf52a[_0xd582('0x5e')]['id']){delete _0xcf52a[_0xd582('0x5e')]['id'];}return db['SmsAccount'][_0xd582('0x5c')]({'where':{'id':_0xcf52a[_0xd582('0x58')]['id']},'include':[{'model':db[_0xd582('0x40')],'as':_0xd582('0x59')}]})[_0xd582('0x22')](handleEntityNotFound(_0xf08db,null))[_0xd582('0x22')](saveUpdates(_0xcf52a[_0xd582('0x5e')],null))[_0xd582('0x22')](respondWithResult(_0xf08db,null))[_0xd582('0x2b')](handleError(_0xf08db,null));};exports['destroy']=function(_0x38b278,_0x3588bd){return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0x38b278[_0xd582('0x58')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x3588bd,null))[_0xd582('0x22')](removeEntity(_0x3588bd,null))[_0xd582('0x2b')](handleError(_0x3588bd,null));};exports['describe']=function(_0x161e20,_0x505d69){return db[_0xd582('0x42')]['describe']()['then'](respondWithResult(_0x505d69,null))[_0xd582('0x2b')](handleError(_0x505d69,null));};exports[_0xd582('0x68')]=function(_0x54083d,_0x258130,_0x24c378){if(_0x54083d['body']['id']){delete _0x54083d[_0xd582('0x5e')]['id'];}return db[_0xd582('0x42')]['find']({'where':{'id':_0x54083d['params']['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x258130,null))['then'](function(_0x1be2f8){if(_0x1be2f8){_0x54083d[_0xd582('0x5e')][_0xd582('0x69')]=_0x1be2f8['id'];return db[_0xd582('0x6a')][_0xd582('0x5d')](_0x54083d[_0xd582('0x5e')]);}})[_0xd582('0x22')](respondWithResult(_0x258130,null))[_0xd582('0x2b')](handleError(_0x258130,null));};exports['getDispositions']=function(_0x40aec5,_0x1bc25b,_0x8ac66b){var _0x7465a7={'raw':![],'where':{}};var _0xacea77={};var _0x1254ec={'count':0x0,'rows':[]};return db[_0xd582('0x42')][_0xd582('0x6b')]({'where':{'id':_0x40aec5['params']['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x1bc25b,null))[_0xd582('0x22')](function(_0x5748a7){if(_0x5748a7){_0xacea77[_0xd582('0x49')]=_[_0xd582('0x5a')](db['Disposition']['rawAttributes']);_0xacea77['query']=_[_0xd582('0x5a')](_0x40aec5[_0xd582('0x46')]);_0xacea77[_0xd582('0x47')]=_[_0xd582('0x48')](_0xacea77['model'],_0xacea77[_0xd582('0x46')]);_0x7465a7[_0xd582('0x4a')]=_[_0xd582('0x48')](_0xacea77[_0xd582('0x49')],qs[_0xd582('0x4b')](_0x40aec5[_0xd582('0x46')][_0xd582('0x4b')]));_0x7465a7['attributes']=_0x7465a7[_0xd582('0x4a')][_0xd582('0x4c')]?_0x7465a7['attributes']:_0xacea77['model'];if(!_0x40aec5[_0xd582('0x46')][_0xd582('0x4d')]('nolimit')){_0x7465a7[_0xd582('0x30')]=qs[_0xd582('0x30')](_0x40aec5[_0xd582('0x46')][_0xd582('0x30')]);_0x7465a7[_0xd582('0x2f')]=qs[_0xd582('0x2f')](_0x40aec5['query'][_0xd582('0x2f')]);}_0x7465a7[_0xd582('0x4f')]=qs[_0xd582('0x50')](_0x40aec5[_0xd582('0x46')][_0xd582('0x50')]);_0x7465a7['where']=qs[_0xd582('0x47')](_[_0xd582('0x52')](_0x40aec5[_0xd582('0x46')],_0xacea77[_0xd582('0x47')]));_0x7465a7[_0xd582('0x51')]['SmsAccountId']=_0x5748a7['id'];if(_0x40aec5['query']['filter']){_0x7465a7['where']=_[_0xd582('0x6c')](_0x7465a7[_0xd582('0x51')],{'$or':_['map'](_0x7465a7[_0xd582('0x4a')],function(_0x52985f){var _0x7fc066={};_0x7fc066[_0x52985f]={'$like':'%'+_0x40aec5[_0xd582('0x46')][_0xd582('0x53')]+'%'};return _0x7fc066;})});}_0x7465a7=_[_0xd582('0x6c')]({},_0x7465a7,_0x40aec5[_0xd582('0x54')]);return db[_0xd582('0x6a')]['count']({'where':_0x7465a7[_0xd582('0x51')]})[_0xd582('0x22')](function(_0x17a3f7){_0x1254ec[_0xd582('0x32')]=_0x17a3f7;if(_0x40aec5['query'][_0xd582('0x5b')]){_0x7465a7[_0xd582('0x55')]=[{'all':!![]}];}return db[_0xd582('0x6a')]['findAll'](_0x7465a7);})[_0xd582('0x22')](function(_0x35efaa){_0x1254ec[_0xd582('0x6d')]=_0x35efaa;return _0x1254ec;});}})[_0xd582('0x22')](respondWithFilteredResult(_0x1bc25b,_0x7465a7))[_0xd582('0x2b')](handleError(_0x1bc25b,null));};exports['removeDispositions']=function(_0x2e15c2,_0x226b40,_0x36bf22){return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0x2e15c2[_0xd582('0x58')]['id']}})['then'](handleEntityNotFound(_0x226b40,null))['then'](function(_0x472558){if(_0x472558){return _0x472558['removeDispositions'](_0x2e15c2[_0xd582('0x46')][_0xd582('0x6e')]);}})[_0xd582('0x22')](respondWithStatusCode(_0x226b40,null))[_0xd582('0x2b')](handleError(_0x226b40,null));};exports[_0xd582('0x6f')]=function(_0x510a3f,_0x34e0b5,_0xc631d7){if(_0x510a3f[_0xd582('0x5e')]['id']){delete _0x510a3f[_0xd582('0x5e')]['id'];}return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0x510a3f['params']['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x34e0b5,null))[_0xd582('0x22')](function(_0x304571){if(_0x304571){_0x510a3f[_0xd582('0x5e')][_0xd582('0x69')]=_0x304571['id'];return db['CannedAnswer']['create'](_0x510a3f[_0xd582('0x5e')]);}})[_0xd582('0x22')](respondWithResult(_0x34e0b5,null))[_0xd582('0x2b')](handleError(_0x34e0b5,null));};exports[_0xd582('0x70')]=function(_0x5c9850,_0x44682c,_0x4df976){var _0x2be358={'raw':![],'where':{}};var _0x31e6ea={};var _0x1fac22={'count':0x0,'rows':[]};return db[_0xd582('0x42')][_0xd582('0x6b')]({'where':{'id':_0x5c9850[_0xd582('0x58')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x44682c,null))['then'](function(_0x161ec3){if(_0x161ec3){_0x31e6ea['model']=_[_0xd582('0x5a')](db[_0xd582('0x71')][_0xd582('0x43')]);_0x31e6ea[_0xd582('0x46')]=_[_0xd582('0x5a')](_0x5c9850[_0xd582('0x46')]);_0x31e6ea['filters']=_['intersection'](_0x31e6ea[_0xd582('0x49')],_0x31e6ea[_0xd582('0x46')]);_0x2be358['attributes']=_[_0xd582('0x48')](_0x31e6ea[_0xd582('0x49')],qs[_0xd582('0x4b')](_0x5c9850[_0xd582('0x46')]['fields']));_0x2be358[_0xd582('0x4a')]=_0x2be358[_0xd582('0x4a')][_0xd582('0x4c')]?_0x2be358['attributes']:_0x31e6ea[_0xd582('0x49')];if(!_0x5c9850[_0xd582('0x46')][_0xd582('0x4d')](_0xd582('0x4e'))){_0x2be358[_0xd582('0x30')]=qs[_0xd582('0x30')](_0x5c9850[_0xd582('0x46')]['limit']);_0x2be358[_0xd582('0x2f')]=qs[_0xd582('0x2f')](_0x5c9850[_0xd582('0x46')]['offset']);}_0x2be358[_0xd582('0x4f')]=qs[_0xd582('0x50')](_0x5c9850[_0xd582('0x46')]['sort']);_0x2be358[_0xd582('0x51')]=qs[_0xd582('0x47')](_['pick'](_0x5c9850[_0xd582('0x46')],_0x31e6ea['filters']));_0x2be358[_0xd582('0x51')][_0xd582('0x69')]=_0x161ec3['id'];if(_0x5c9850[_0xd582('0x46')][_0xd582('0x53')]){_0x2be358[_0xd582('0x51')]=_[_0xd582('0x6c')](_0x2be358[_0xd582('0x51')],{'$or':_['map'](_0x2be358['attributes'],function(_0x44d6b6){var _0x343eba={};_0x343eba[_0x44d6b6]={'$like':'%'+_0x5c9850['query'][_0xd582('0x53')]+'%'};return _0x343eba;})});}_0x2be358=_[_0xd582('0x6c')]({},_0x2be358,_0x5c9850['options']);return db[_0xd582('0x71')][_0xd582('0x32')]({'where':_0x2be358[_0xd582('0x51')]})['then'](function(_0x4aa61f){_0x1fac22[_0xd582('0x32')]=_0x4aa61f;if(_0x5c9850[_0xd582('0x46')][_0xd582('0x5b')]){_0x2be358[_0xd582('0x55')]=[{'all':!![]}];}return db[_0xd582('0x71')][_0xd582('0x56')](_0x2be358);})[_0xd582('0x22')](function(_0x53b737){_0x1fac22[_0xd582('0x6d')]=_0x53b737;return _0x1fac22;});}})[_0xd582('0x22')](respondWithFilteredResult(_0x44682c,_0x2be358))[_0xd582('0x2b')](handleError(_0x44682c,null));};exports[_0xd582('0x72')]=function(_0xfa090f,_0x57a01d,_0x72b19a){return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0xfa090f[_0xd582('0x58')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x57a01d,null))[_0xd582('0x22')](function(_0x5cb7c9){if(_0x5cb7c9){return _0x5cb7c9['removeAnswers'](_0xfa090f[_0xd582('0x46')]['ids']);}})[_0xd582('0x22')](respondWithStatusCode(_0x57a01d,null))[_0xd582('0x2b')](handleError(_0x57a01d,null));};exports[_0xd582('0x73')]=function(_0x59983e,_0x2aca7f,_0x5616eb){var _0x45c5f7={'channel':_0xd582('0x74')};var _0x5220a7=[];var _0x173004=[];var _0x1a3c3c={};return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0x59983e[_0xd582('0x58')]['id']},'include':[{'model':db[_0xd582('0x75')],'as':_0xd582('0x76')}]})['then'](handleEntityNotFound(_0x2aca7f,null))[_0xd582('0x22')](function(_0x118ac4){_0x45c5f7[_0xd582('0x77')]=_0x118ac4;_0x45c5f7[_0xd582('0x78')]=_[_0xd582('0x79')](_0x118ac4[_0xd582('0x76')],[_0xd582('0x7a')],[_0xd582('0x7b')]);if(_0x45c5f7['account'][_0xd582('0x76')]){delete _0x45c5f7[_0xd582('0x77')]['Applications'];}return db[_0xd582('0x7c')][_0xd582('0x7d')]();})[_0xd582('0x22')](function(_0x1380e1){if(!_0x1380e1){throw new db[(_0xd582('0x7e'))][(_0xd582('0x7f'))](_0xd582('0x80'));}_0x5220a7=_['difference'](_[_0xd582('0x5a')](_0x1380e1),[_0xd582('0x81'),'updatedAt']);_0x173004=_[_0xd582('0x82')](_[_0xd582('0x5a')](_0x1380e1),[_0xd582('0x81'),_0xd582('0x83'),'CompanyId',_0xd582('0x84')]);_0x45c5f7[_0xd582('0x5e')]={'mapKey':_0xd582('0x85')};if(_0x45c5f7[_0xd582('0x77')][_0xd582('0x44')]){switch(_0x45c5f7[_0xd582('0x77')][_0xd582('0x44')]){case _0xd582('0x86'):_0x45c5f7['body']['from']=_0x59983e[_0xd582('0x5e')][_0xd582('0x87')];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x88')];_0x45c5f7['body'][_0xd582('0x89')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x8a')];break;case _0xd582('0x8b'):_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')]='+'+_0x59983e[_0xd582('0x5e')]['sender'];_0x45c5f7['body'][_0xd582('0x5e')]=_0x59983e['body']['text'];break;case'connectel':_0x45c5f7['body'][_0xd582('0x8c')]=_0x59983e['body'][_0xd582('0x8c')];_0x45c5f7['body'][_0xd582('0x5e')]=_0x59983e['body'][_0xd582('0x29')];break;case _0xd582('0x8d'):_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')]=_0x59983e['body']['from'];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x5e')];_0x45c5f7['body'][_0xd582('0x89')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x8e')];break;case _0xd582('0x8f'):_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x87')];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x90')];_0x45c5f7[_0xd582('0x5e')]['messageId']=_0x59983e[_0xd582('0x5e')]['MessageUUID'];break;case'infobip':_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')]='+'+_0x59983e[_0xd582('0x5e')]['results'][0x0][_0xd582('0x8c')];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')]=_0x59983e['body'][_0xd582('0x91')][0x0][_0xd582('0x92')];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x89')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x91')][0x0][_0xd582('0x89')];break;case _0xd582('0x93'):_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x94')];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x95')][_0xd582('0x29')];break;case'clickatell':_0x45c5f7['body'][_0xd582('0x8c')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x96')];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')]=_0x59983e['body']['text'];_0x45c5f7['body'][_0xd582('0x89')]=_0x59983e['body']['replyMessageId'];break;case _0xd582('0x97'):_0x45c5f7[_0xd582('0x5e')][_0xd582('0x89')]=_0x59983e['body'][0x0][_0xd582('0x29')]['id'];_0x45c5f7[_0xd582('0x5e')]['from']=_0x59983e[_0xd582('0x5e')][0x0][_0xd582('0x29')][_0xd582('0x8c')];_0x45c5f7['body'][_0xd582('0x5e')]=_0x59983e[_0xd582('0x5e')][0x0]['message'][_0xd582('0x92')];break;case _0xd582('0x98'):_0x45c5f7[_0xd582('0x5e')]['from']=_0x59983e[_0xd582('0x5e')]['from'];_0x45c5f7['body'][_0xd582('0x5e')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x29')];_0x45c5f7[_0xd582('0x5e')][_0xd582('0x89')]=_0x59983e[_0xd582('0x5e')][_0xd582('0x99')];break;}}if(_0x45c5f7[_0xd582('0x5e')]['id']){delete _0x45c5f7[_0xd582('0x5e')]['id'];}if(_[_0xd582('0x9a')](_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')])){throw new db[(_0xd582('0x7e'))][(_0xd582('0x7f'))](_0xd582('0x9b'));}if(_[_0xd582('0x9a')](_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')])||_0x45c5f7[_0xd582('0x5e')][_0xd582('0x5e')]===''){throw new db['Sequelize'][(_0xd582('0x7f'))](_0xd582('0x9c'));}if(_['isNil'](_0x45c5f7[_0xd582('0x5e')][_0xd582('0x9d')])){throw new db[(_0xd582('0x7e'))][(_0xd582('0x7f'))](_0xd582('0x9e')+_0x173004);}if(!_[_0xd582('0x9f')](_0x173004,_0x45c5f7[_0xd582('0x5e')][_0xd582('0x9d')])){throw new db['Sequelize'][(_0xd582('0x7f'))](_0xd582('0xa0')+_0x173004);}_0x1a3c3c[_0x45c5f7[_0xd582('0x5e')][_0xd582('0x9d')]]=_0x45c5f7['body'][_0xd582('0x8c')];return db['CmList'][_0xd582('0x5c')]({'where':{'id':_0x45c5f7['account'][_0xd582('0x84')]},'include':[{'model':db[_0xd582('0x7c')],'as':_0xd582('0xa1'),'where':_0x1a3c3c,'limit':0x1,'order':[[_0xd582('0x83'),_0xd582('0xa2')]]}]});})[_0xd582('0x22')](handleEntityNotFound(_0x2aca7f,null))['then'](function(_0x63b7a9){if(_0x63b7a9){_0x45c5f7[_0xd582('0xa3')]=_[_0xd582('0xa4')](_0x63b7a9,[_0xd582('0xa1')]);if(_0x63b7a9[_0xd582('0xa1')][_0xd582('0x4c')]){return _0x63b7a9[_0xd582('0xa1')][0x0];}var _0x6b5017=_[_0xd582('0x1a')](_0x45c5f7['body'],{'firstName':_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')],'ListId':_0x63b7a9['id']});_0x6b5017[_0x45c5f7['body'][_0xd582('0x9d')]]=_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')];return db[_0xd582('0x7c')][_0xd582('0x5d')](_0x6b5017,{'fields':_0x5220a7,'raw':!![]});}})['then'](handleEntityNotFound(_0x2aca7f,null))['then'](function(_0x597544){if(_0x597544){_0x45c5f7[_0xd582('0xa5')]=_0x597544;var _0xcd84e1={'ContactId':_0x597544['id'],'phone':_0x45c5f7['body'][_0xd582('0x8c')],'SmsAccountId':_0x59983e[_0xd582('0x58')]['id']};var _0x17b01c={'ContactId':_0x597544['id'],'SmsAccountId':_0x59983e[_0xd582('0x58')]['id'],'closed':![]};return db[_0xd582('0xa6')][_0xd582('0x5c')]({'where':_0x17b01c})[_0xd582('0x22')](function(_0x213658){if(_0x213658){return[_0x213658,![]];}return db[_0xd582('0xa6')][_0xd582('0x5d')](_0xcd84e1)[_0xd582('0x22')](function(_0x4a66aa){return[_0x4a66aa,!![]];});});}})[_0xd582('0xa7')](function(_0x434319,_0x53995e){_0x45c5f7['interaction']=_0x434319[_0xd582('0x3a')]({'plain':!![]});_0x45c5f7['interaction']['created']=![];if(_0x53995e){if(_0x45c5f7['account']['autoclose']){_0x45c5f7['applications'][_0xd582('0xa8')]({'id':0x0,'priority':_0x45c5f7[_0xd582('0x78')][_0xd582('0x4c')]+0x1,'app':_0xd582('0xa9'),'appdata':_0xd582('0xaa'),'interval':'*,*,*,*'});}_0x45c5f7[_0xd582('0xab')]['created']=!![];}return db[_0xd582('0xac')][_0xd582('0x5d')]({'phone':_0x45c5f7[_0xd582('0x5e')][_0xd582('0x8c')],'messageId':_0x45c5f7[_0xd582('0x5e')]['messageId'],'body':_0x45c5f7[_0xd582('0x5e')]['body'],'SmsAccountId':_0x59983e[_0xd582('0x58')]['id'],'SmsInteractionId':_0x434319['id'],'direction':'in','ContactId':_0x434319[_0xd582('0xad')],'AttachmentId':_0x45c5f7[_0xd582('0x5e')][_0xd582('0xae')]});})['then'](function(_0x5784db){_0x45c5f7['message']=_0x5784db;if(_0x45c5f7['interaction'][_0xd582('0xaf')]){return db[_0xd582('0xb0')]['find']({'attributes':['id',_0xd582('0x3d')],'where':{'id':_0x45c5f7['interaction'][_0xd582('0xaf')]}})['then'](function(_0x1982ed){if(_0x1982ed){_0x45c5f7['applications'][_0xd582('0xb1')]({'id':0x0,'priority':0x0,'app':_0xd582('0xb2'),'appdata':_0x1982ed[_0xd582('0x3d')]+','+(_0x45c5f7['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd582('0xb3'),_0xd582('0xb4'),_0x45c5f7);});}return respondWithRpcPromise(_0xd582('0xb3'),_0xd582('0xb4'),_0x45c5f7);})['then'](function(_0x1bf837){if(_0x1bf837){var _0x1246f0=0xc8;var _0x2c006f=_0xd582('0xb5');logger[_0xd582('0x2a')](_0xd582('0xb6'),_0x2c006f,_0x1246f0,_0xd582('0xb7'));logger[_0xd582('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2c006f,_0x1246f0,_0xd582('0xb7'),JSON[_0xd582('0x26')](_0x1bf837));if(_0x45c5f7['account'][_0xd582('0x44')]===_0xd582('0x86')){return _0x2aca7f[_0xd582('0x2c')](_0x1246f0)['set']('Content-Type',_0xd582('0xb8'))[_0xd582('0x3e')](_0xd582('0xb9'));}else{return _0x2aca7f['status'](_0x1246f0)['json'](_0x1bf837);}}})['catch'](handleError(_0x2aca7f,null));};exports[_0xd582('0xba')]=function(_0x1f592f,_0x29d37a){var _0x33c882=_0x1f592f[_0xd582('0x58')]['id'];var _0x47817a=_0x1f592f['body'];var _0xc6532f=0xc8;var _0x35e8a4=null;return db[_0xd582('0xbb')][_0xd582('0xbc')]({'isolationLevel':db[_0xd582('0xbb')][_0xd582('0xbd')]['ISOLATION_LEVELS'][_0xd582('0xbe')]},function(_0x36d196){return db[_0xd582('0x42')][_0xd582('0x6b')]({'where':{'id':_0x33c882},'transaction':_0x36d196})['then'](function(_0x3a1f56){if(_0x3a1f56){return db[_0xd582('0x75')][_0xd582('0x39')]({'where':{'SmsAccountId':_0x33c882},'transaction':_0x36d196})[_0xd582('0x22')](function(){var _0x32dc91=_[_0xd582('0x41')](_0x47817a,function(_0x395283){_0x395283[_0xd582('0x69')]=_0x33c882;return _0x395283;});return db[_0xd582('0x75')][_0xd582('0xbf')](_0x32dc91,{'transaction':_0x36d196});});}else{_0xc6532f=0x194;_0x35e8a4=[];}});})[_0xd582('0x22')](function(){if(_0xc6532f!==0x194){return db[_0xd582('0x75')]['findAndCountAll']({'where':{'SmsAccountId':_0x33c882},'order':'priority'})[_0xd582('0x22')](function(_0x8e04c){_0x35e8a4=_0x8e04c;});}})['catch'](function(_0x52a7d7){_0xc6532f=0x1f4;logger[_0xd582('0x27')](_0x52a7d7[_0xd582('0x3c')]);if(_0x52a7d7[_0xd582('0x3d')]){delete _0x52a7d7[_0xd582('0x3d')];}_0x35e8a4=_0x52a7d7;})[_0xd582('0xc0')](function(){if(_0x35e8a4===null){_0x29d37a[_0xd582('0x3b')](_0xc6532f);}else{if(_0xc6532f===0x1f4){_0x29d37a[_0xd582('0x2c')](_0xc6532f)[_0xd582('0x3e')](_0x35e8a4);}else{_0x29d37a[_0xd582('0x2c')](_0xc6532f)[_0xd582('0x2e')](_0x35e8a4);}}});};exports[_0xd582('0xc1')]=function(_0x168e58,_0x51803f,_0x5bc8f5){var _0x3da6a3={};var _0x2543fd={};var _0x577bd3;var _0x5c4e35;return db[_0xd582('0x42')][_0xd582('0x6b')]({'where':{'id':_0x168e58[_0xd582('0x58')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x51803f,null))[_0xd582('0x22')](function(_0xc75a74){if(_0xc75a74){_0x577bd3=_0xc75a74;_0x2543fd[_0xd582('0x49')]=_[_0xd582('0x5a')](db[_0xd582('0x75')]['rawAttributes']);_0x2543fd[_0xd582('0x46')]=_[_0xd582('0x5a')](_0x168e58[_0xd582('0x46')]);_0x2543fd[_0xd582('0x47')]=_[_0xd582('0x48')](_0x2543fd[_0xd582('0x49')],_0x2543fd[_0xd582('0x46')]);_0x3da6a3[_0xd582('0x4a')]=_['intersection'](_0x2543fd['model'],qs[_0xd582('0x4b')](_0x168e58[_0xd582('0x46')][_0xd582('0x4b')]));_0x3da6a3['attributes']=_0x3da6a3[_0xd582('0x4a')][_0xd582('0x4c')]?_0x3da6a3[_0xd582('0x4a')]:_0x2543fd[_0xd582('0x49')];_0x3da6a3[_0xd582('0x4f')]=qs[_0xd582('0x50')](_0x168e58[_0xd582('0x46')][_0xd582('0x50')]);_0x3da6a3['where']=qs['filters'](_[_0xd582('0x52')](_0x168e58['query'],_0x2543fd[_0xd582('0x47')]));if(_0x168e58[_0xd582('0x46')]['filter']){_0x3da6a3['where']=_[_0xd582('0x6c')](_0x3da6a3[_0xd582('0x51')],{'$or':_[_0xd582('0x41')](_0x3da6a3['attributes'],function(_0x294f5f){var _0x2d2c65={};_0x2d2c65[_0x294f5f]={'$like':'%'+_0x168e58[_0xd582('0x46')][_0xd582('0x53')]+'%'};return _0x2d2c65;})});}_0x3da6a3=_[_0xd582('0x6c')]({},_0x3da6a3,_0x168e58[_0xd582('0x54')]);return _0x577bd3[_0xd582('0xc1')](_0x3da6a3);}})['then'](function(_0x54b44d){if(_0x54b44d){_0x5c4e35=_0x54b44d[_0xd582('0x4c')];if(!_0x168e58[_0xd582('0x46')]['hasOwnProperty']('nolimit')){_0x3da6a3[_0xd582('0x30')]=qs['limit'](_0x168e58[_0xd582('0x46')][_0xd582('0x30')]);_0x3da6a3[_0xd582('0x2f')]=qs[_0xd582('0x2f')](_0x168e58[_0xd582('0x46')][_0xd582('0x2f')]);}return _0x577bd3[_0xd582('0xc1')](_0x3da6a3);}})[_0xd582('0x22')](function(_0x12252f){if(_0x12252f){return _0x12252f?{'count':_0x5c4e35,'rows':_0x12252f}:null;}})['then'](respondWithResult(_0x51803f,null))['catch'](handleError(_0x51803f,null));};exports[_0xd582('0xc2')]=function(_0xebfad8,_0x15cca1,_0x552d76){var _0x405953={'raw':![],'where':{}};var _0x46bf06={};var _0x55be10={'count':0x0,'rows':[]};return db['SmsAccount'][_0xd582('0x6b')]({'where':{'id':_0xebfad8[_0xd582('0x58')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x15cca1,null))[_0xd582('0x22')](function(_0x3f9444){if(_0x3f9444){_0x46bf06[_0xd582('0x49')]=_[_0xd582('0x5a')](db[_0xd582('0xa6')][_0xd582('0x43')]);_0x46bf06['query']=_[_0xd582('0x5a')](_0xebfad8['query']);_0x46bf06[_0xd582('0x47')]=_[_0xd582('0x48')](_0x46bf06[_0xd582('0x49')],_0x46bf06[_0xd582('0x46')]);_0x405953[_0xd582('0x4a')]=_[_0xd582('0x48')](_0x46bf06[_0xd582('0x49')],qs[_0xd582('0x4b')](_0xebfad8[_0xd582('0x46')][_0xd582('0x4b')]));_0x405953[_0xd582('0x4a')]=_0x405953[_0xd582('0x4a')][_0xd582('0x4c')]?_0x405953['attributes']:_0x46bf06[_0xd582('0x49')];if(!_0xebfad8[_0xd582('0x46')][_0xd582('0x4d')](_0xd582('0x4e'))){_0x405953[_0xd582('0x30')]=qs[_0xd582('0x30')](_0xebfad8[_0xd582('0x46')]['limit']);_0x405953[_0xd582('0x2f')]=qs['offset'](_0xebfad8[_0xd582('0x46')][_0xd582('0x2f')]);}_0x405953[_0xd582('0x4f')]=qs[_0xd582('0x50')](_0xebfad8['query'][_0xd582('0x50')]);_0x405953[_0xd582('0x51')]=qs[_0xd582('0x47')](_[_0xd582('0x52')](_0xebfad8[_0xd582('0x46')],_0x46bf06[_0xd582('0x47')]));_0x405953[_0xd582('0x51')]['SmsAccountId']=_0x3f9444['id'];if(_0xebfad8[_0xd582('0x46')][_0xd582('0x53')]){_0x405953[_0xd582('0x51')]=_[_0xd582('0x6c')](_0x405953[_0xd582('0x51')],{'$or':_[_0xd582('0x41')](_0x405953[_0xd582('0x4a')],function(_0xe84d75){var _0x4dc6b7={};_0x4dc6b7[_0xe84d75]={'$like':'%'+_0xebfad8[_0xd582('0x46')][_0xd582('0x53')]+'%'};return _0x4dc6b7;})});}_0x405953=_[_0xd582('0x6c')]({},_0x405953,_0xebfad8[_0xd582('0x54')]);return db[_0xd582('0xa6')][_0xd582('0x32')]({'where':_0x405953[_0xd582('0x51')]})[_0xd582('0x22')](function(_0xd2a9e5){_0x55be10[_0xd582('0x32')]=_0xd2a9e5;if(_0xebfad8[_0xd582('0x46')]['includeAll']){_0x405953[_0xd582('0x55')]=[{'model':db[_0xd582('0x7c')],'as':_0xd582('0xc3'),'required':![]},{'model':db['User'],'as':_0xd582('0xc4'),'attributes':[_0xd582('0x3d'),_0xd582('0xc5'),_0xd582('0xc6')],'required':![]},{'model':db[_0xd582('0xc7')],'as':_0xd582('0xc8'),'attributes':['id',_0xd582('0x3d'),_0xd582('0xc9')],'where':_0xebfad8[_0xd582('0x46')][_0xd582('0xca')]?{'id':_0xebfad8[_0xd582('0x46')]['tag']}:undefined,'required':_0xebfad8['query'][_0xd582('0xca')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x405953);})[_0xd582('0x22')](function(_0x329c53){_0x55be10[_0xd582('0x6d')]=_0x329c53;return _0x55be10;});}})[_0xd582('0x22')](respondWithFilteredResult(_0x15cca1,_0x405953))['catch'](handleError(_0x15cca1,null));};exports['send']=function(_0x5974b1,_0x384ab9,_0xa6ef1f){var _0x132a8a,_0x567187,_0x4cc0a3;if(_[_0xd582('0x9a')](_0x5974b1[_0xd582('0x5e')][_0xd582('0x5e')])||_0x5974b1[_0xd582('0x5e')][_0xd582('0x5e')]===''){throw new db[(_0xd582('0x7e'))]['ValidationError'](_0xd582('0x9c'));}if(_[_0xd582('0x9a')](_0x5974b1['body']['to'])){throw new db[(_0xd582('0x7e'))][(_0xd582('0x7f'))](_0xd582('0xcb'));}_0x132a8a=_0x5974b1['body']['to'];return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0x5974b1[_0xd582('0x58')]['id']},'include':[{'model':db[_0xd582('0xcc')],'as':_0xd582('0xcd'),'include':[{'model':db[_0xd582('0x7c')],'as':_0xd582('0xa1'),'where':{'mobile':_0x132a8a},'limit':0x1,'order':[[_0xd582('0x83'),_0xd582('0xa2')]]}]}]})[_0xd582('0x22')](handleEntityNotFound(_0x384ab9,null))['then'](function(_0x3d76cd){if(_0x3d76cd&&_0x3d76cd[_0xd582('0xcd')]){_0x567187=_0x3d76cd[_0xd582('0x3a')]({'plain':!![]});if(_0x567187[_0xd582('0xcd')]&&_0x567187[_0xd582('0xcd')][_0xd582('0xa1')]['length']){return _0x567187[_0xd582('0xcd')]['Contacts'][0x0];}return db[_0xd582('0x7c')][_0xd582('0x5d')](_['defaults'](_0x5974b1[_0xd582('0x5e')],{'firstName':_0x132a8a,'mobile':_0x132a8a,'phone':_0x132a8a,'ListId':_0x567187[_0xd582('0x84')]}));}})[_0xd582('0x22')](handleEntityNotFound(_0x384ab9,null))['then'](function(_0x356c5f){if(_0x356c5f){_0x4cc0a3=_0x356c5f;return db[_0xd582('0xa6')][_0xd582('0x5c')]({'where':{'ContactId':_0x4cc0a3['id'],'closed':![],'SmsAccountId':_0x567187['id']}})['then'](function(_0xf2bcd7){if(_0xf2bcd7){return[_0xf2bcd7,![]];}return db[_0xd582('0xa6')][_0xd582('0x5d')]({'UserId':_0x5974b1[_0xd582('0x5f')]['id'],'ContactId':_0x4cc0a3['id'],'SmsAccountId':_0x567187['id'],'phone':_0x132a8a,'firstMsgDirection':_0xd582('0xce'),'Messages':[_[_0xd582('0x6c')](_0x5974b1[_0xd582('0x5e')],{'read':![],'body':_0x5974b1[_0xd582('0x5e')]['body'],'phone':_0x132a8a,'SmsAccountId':_0x567187['id'],'UserId':_0x5974b1[_0xd582('0x5f')]['id'],'ContactId':_0x4cc0a3['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xd582('0x22')](function(_0x5bca6f){return[_0x5bca6f,!![]];});});}})[_0xd582('0xa7')](function(_0x566763,_0x2faa3b){if(_0x2faa3b){return _0x566763;}return db[_0xd582('0xac')][_0xd582('0x5d')](_['merge'](_0x5974b1['body'],{'read':![],'body':_0x5974b1[_0xd582('0x5e')][_0xd582('0x5e')],'phone':_0x132a8a,'SmsAccountId':_0x567187['id'],'SmsInteractionId':_0x566763['id'],'UserId':_0x5974b1['user']['id'],'ContactId':_0x4cc0a3['id']}))[_0xd582('0x22')](function(_0x474bfe){_0x566763[_0xd582('0xcf')][_0xd582('0xd0')]=[];_0x566763['dataValues'][_0xd582('0xd0')][_0xd582('0xa8')](_0x474bfe[_0xd582('0xcf')]);return _0x566763;});})[_0xd582('0x22')](respondWithResult(_0x384ab9,null))[_0xd582('0x2b')](handleError(_0x384ab9,null));};exports[_0xd582('0x2c')]=function(_0x4b6a73,_0x5cc233,_0x28a605){if(_0x4b6a73[_0xd582('0x5e')]['id']){delete _0x4b6a73[_0xd582('0x5e')]['id'];}var _0xc46d7d,_0x3194b5,_0x53af26;return db[_0xd582('0x42')]['find']({'where':{'id':_0x4b6a73[_0xd582('0x58')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x5cc233,null))[_0xd582('0x22')](function(_0x362655){if(_0x362655){_0x53af26=_0x362655;logger['debug'](_0xd582('0xb6'),_0xd582('0x2c'),_0xd582('0xd1'),_0x362655[_0xd582('0x44')],util[_0xd582('0xd2')](_0x4b6a73['body'],{'showHidden':![],'depth':null}));switch(_0x362655[_0xd582('0x44')]){case _0xd582('0x8b'):if(_0x4b6a73[_0xd582('0x5e')]['skebby_dispatch_id']&&_0x4b6a73[_0xd582('0x5e')][_0xd582('0x2c')]){_0x3194b5=_0x4b6a73[_0xd582('0x5e')]['status'];return db[_0xd582('0xac')][_0xd582('0x5c')]({'where':{'messageId':_0x4b6a73[_0xd582('0x5e')][_0xd582('0xd3')]}});}break;case _0xd582('0xd4'):if(_0x4b6a73[_0xd582('0x5e')][_0xd582('0xd5')]&&_0x4b6a73['body'][_0xd582('0xd6')]){_0x3194b5=_0x4b6a73[_0xd582('0x5e')][_0xd582('0xd6')];return db[_0xd582('0xac')][_0xd582('0x5c')]({'where':{'messageId':_0x4b6a73[_0xd582('0x5e')][_0xd582('0xd5')]}});}break;case _0xd582('0x8d'):if(_0x4b6a73[_0xd582('0x5e')][_0xd582('0x8e')]&&_0x4b6a73['body']['status_code']){_0x3194b5=_0x4b6a73[_0xd582('0x5e')][_0xd582('0xd7')];return db[_0xd582('0xac')][_0xd582('0x5c')]({'where':{'messageId':_0x4b6a73[_0xd582('0x5e')]['message_id']}});}break;case _0xd582('0xd8'):var _0x8e9554=_0x4b6a73[_0xd582('0x5e')]['results'][0x0];if(_0x8e9554[_0xd582('0x89')]&&_0x8e9554['status'][_0xd582('0xd9')]===_0xd582('0xda')){_0x3194b5=_0x8e9554[_0xd582('0x2c')][_0xd582('0xd9')];return db[_0xd582('0xac')][_0xd582('0x5c')]({'where':{'messageId':_0x8e9554[_0xd582('0x89')]}});}break;case _0xd582('0xdb'):if(_0x4b6a73[_0xd582('0x5e')][_0xd582('0x89')]&&_0x4b6a73[_0xd582('0x5e')][_0xd582('0x2c')]){_0x3194b5=_0x4b6a73[_0xd582('0x5e')][_0xd582('0x2c')];return db['SmsMessage'][_0xd582('0x5c')]({'where':{'messageId':_0x4b6a73[_0xd582('0x5e')][_0xd582('0x89')]}});}break;case _0xd582('0x97'):if(_0x4b6a73[_0xd582('0x5e')][0x0]['message']['id']){_0x3194b5=_0x4b6a73[_0xd582('0x5e')][0x0][_0xd582('0x44')];return db[_0xd582('0xac')][_0xd582('0x5c')]({'where':{'messageId':_0x4b6a73[_0xd582('0x5e')][0x0][_0xd582('0x29')]['id']}});}break;case'intelepeer':if(_0x4b6a73[_0xd582('0x5e')][_0xd582('0xdc')]&&_0x4b6a73[_0xd582('0x5e')][_0xd582('0x2c')]){_0x3194b5=_0x4b6a73[_0xd582('0x5e')][_0xd582('0x2c')];return db[_0xd582('0xac')]['find']({'where':{'messageId':_0x4b6a73[_0xd582('0x5e')][_0xd582('0xdc')]}});}break;}}})[_0xd582('0x22')](handleEntityNotFound(_0x5cc233,null))['then'](function(_0x572f12){if(_0x572f12){_0xc46d7d=_0x572f12;switch(_0x53af26['type']){case _0xd582('0x8b'):if(_0x3194b5==='DELIVERED'){return _0xc46d7d[_0xd582('0x38')]({'read':!![]});}else{logger[_0xd582('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd582('0x2c'),_0xd582('0x8b'),util['inspect'](_0x4b6a73[_0xd582('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd582('0xd4'):if(_0x3194b5==='1'){return _0xc46d7d[_0xd582('0x38')]({'read':!![]});}else{logger[_0xd582('0x27')](_0xd582('0xb6'),_0xd582('0x2c'),_0xd582('0x8b'),util[_0xd582('0xd2')](_0x4b6a73[_0xd582('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd582('0x8d'):if(!_0x4b6a73[_0xd582('0x5e')][_0xd582('0xdd')]&&_0x3194b5>=0xc8&&_0x3194b5<=0xce){return _0xc46d7d[_0xd582('0x38')]({'read':!![]});}else{logger[_0xd582('0x27')](_0xd582('0xb6'),'status',_0xd582('0x8d'),util[_0xd582('0xd2')](_0x4b6a73[_0xd582('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd582('0xd8'):var _0x2047db=_0x4b6a73[_0xd582('0x5e')][_0xd582('0x91')][0x0];if(_0x2047db['status'][_0xd582('0xd9')]==='DELIVERED'){return _0xc46d7d[_0xd582('0x38')]({'read':!![]});}else{logger[_0xd582('0x27')](_0xd582('0xb6'),_0xd582('0x2c'),_0xd582('0xd8'),util[_0xd582('0xd2')](_0x4b6a73['body'],{'showHidden':![],'depth':null}));}break;case _0xd582('0xdb'):if(_0x3194b5==_0xd582('0xde')||_0x3194b5=='RECEIVED_BY_RECIPIENT'){return _0xc46d7d[_0xd582('0x38')]({'read':!![]});}else{logger[_0xd582('0x27')](_0xd582('0xb6'),_0xd582('0x2c'),_0xd582('0xdb'),util['inspect'](_0x4b6a73[_0xd582('0x5e')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3194b5=='message-delivered'){return _0xc46d7d[_0xd582('0x38')]({'read':!![]});}else{logger['error'](_0xd582('0xb6'),_0xd582('0x2c'),_0xd582('0x97'),util[_0xd582('0xd2')](_0x4b6a73[_0xd582('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd582('0x98'):if(_0x3194b5===_0xd582('0xdf')||_0x3194b5==='ACCEPTD'){return _0xc46d7d[_0xd582('0x38')]({'read':!![]});}else{logger['error'](_0xd582('0xb6'),_0xd582('0x2c'),_0xd582('0x98'),util[_0xd582('0xd2')](_0x4b6a73['body'],{'showHidden':![],'depth':null}));}break;}return _0xc46d7d;}})['then'](respondWithResult(_0x5cc233,null))[_0xd582('0x2b')](handleError(_0x5cc233,null));};exports['statusGet']=function(_0x3aa7c6,_0x3a9e5e,_0x298017){var _0x478ee5,_0x4695e7,_0xcc823b;return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0x3aa7c6[_0xd582('0x58')]['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x3a9e5e,null))[_0xd582('0x22')](function(_0x419730){if(_0x419730){_0xcc823b=_0x419730;logger[_0xd582('0x25')](_0xd582('0xb6'),'status',_0xd582('0xd1'),_0x419730[_0xd582('0x44')],util[_0xd582('0xd2')](_0x3aa7c6['query'],{'showHidden':![],'depth':null}));switch(_0x419730[_0xd582('0x44')]){case _0xd582('0x93'):if(_0x3aa7c6[_0xd582('0x46')][_0xd582('0xe0')]&&_0x3aa7c6[_0xd582('0x46')][_0xd582('0xe1')]){_0x4695e7=_0x3aa7c6['query'][_0xd582('0xe1')];return db[_0xd582('0xac')][_0xd582('0x5c')]({'where':{'messageId':_0x3aa7c6['query'][_0xd582('0xe0')]}});}break;}}})[_0xd582('0x22')](handleEntityNotFound(_0x3a9e5e,null))['then'](function(_0x42e3fc){if(_0x42e3fc){_0x478ee5=_0x42e3fc;switch(_0xcc823b[_0xd582('0x44')]){case _0xd582('0x93'):if(_0x4695e7==='2'||_0x4695e7==='6'){return _0x478ee5['update']({'read':!![]});}else{logger[_0xd582('0x27')](_0xd582('0xb6'),'status',_0xd582('0x93'),util['inspect'](_0x3aa7c6[_0xd582('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x478ee5;}})[_0xd582('0x22')](respondWithResult(_0x3a9e5e,null))[_0xd582('0x2b')](handleError(_0x3a9e5e,null));};exports['addAgents']=function(_0x21ca24,_0x402b0b,_0xed71d8){return db[_0xd582('0x42')][_0xd582('0x5c')]({'where':{'id':_0x21ca24['params']['id']}})['then'](handleEntityNotFound(_0x402b0b,null))[_0xd582('0x22')](function(_0x2ee4fa){if(_0x2ee4fa){return _0x2ee4fa[_0xd582('0xe2')](_0x21ca24['body'][_0xd582('0x6e')],_[_0xd582('0xa4')](_0x21ca24[_0xd582('0x5e')],['ids','id'])||{})['spread'](function(_0x1f72ef){for(var _0x19a606=0x0;_0x19a606<_0x21ca24[_0xd582('0x5e')][_0xd582('0x6e')][_0xd582('0x4c')];_0x19a606+=0x1){socket[_0xd582('0xe3')](_0xd582('0xe4'),{'UserId':Number(_0x21ca24[_0xd582('0x5e')][_0xd582('0x6e')][_0x19a606]),'SmsAccountId':Number(_0x21ca24[_0xd582('0x58')]['id'])});}return _0x1f72ef;});}})[_0xd582('0x22')](respondWithResult(_0x402b0b,null))['catch'](handleError(_0x402b0b,null));};exports[_0xd582('0xe5')]=function(_0xff4416,_0x45fe8b,_0x24f686){return db[_0xd582('0x42')]['find']({'where':{'id':_0xff4416['params']['id']}})[_0xd582('0x22')](handleEntityNotFound(_0x45fe8b,null))[_0xd582('0x22')](function(_0x8fbb95){if(_0x8fbb95){return _0x8fbb95['removeAgents'](_0xff4416[_0xd582('0x46')][_0xd582('0x6e')])[_0xd582('0x22')](function(){if(_['isArray'](_0xff4416[_0xd582('0x46')][_0xd582('0x6e')])){for(var _0x582df0=0x0;_0x582df0<_0xff4416['query'][_0xd582('0x6e')][_0xd582('0x4c')];_0x582df0+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0xff4416[_0xd582('0x46')][_0xd582('0x6e')][_0x582df0]),'SmsAccountId':Number(_0xff4416['params']['id'])});}}else{socket[_0xd582('0xe3')](_0xd582('0xe6'),{'UserId':Number(_0xff4416[_0xd582('0x46')][_0xd582('0x6e')]),'SmsAccountId':Number(_0xff4416[_0xd582('0x58')]['id'])});}});}})[_0xd582('0x22')](respondWithStatusCode(_0x45fe8b,null))[_0xd582('0x2b')](handleError(_0x45fe8b,null));};exports[_0xd582('0xe7')]=function(_0x4dc315,_0xee8c60,_0x3949df){var _0x144bbc={};var _0x1a5eb1={};var _0x1fe813;var _0x664543;return db[_0xd582('0x42')][_0xd582('0x6b')]({'where':{'id':_0x4dc315['params']['id']}})[_0xd582('0x22')](handleEntityNotFound(_0xee8c60,null))[_0xd582('0x22')](function(_0x104372){if(_0x104372){_0x1fe813=_0x104372;_0x1a5eb1[_0xd582('0x49')]=_[_0xd582('0x5a')](db[_0xd582('0xb0')][_0xd582('0x43')]);_0x1a5eb1[_0xd582('0x46')]=_[_0xd582('0x5a')](_0x4dc315['query']);_0x1a5eb1[_0xd582('0x47')]=_['intersection'](_0x1a5eb1[_0xd582('0x49')],_0x1a5eb1[_0xd582('0x46')]);_0x144bbc[_0xd582('0x4a')]=_[_0xd582('0x48')](_0x1a5eb1[_0xd582('0x49')],qs[_0xd582('0x4b')](_0x4dc315[_0xd582('0x46')][_0xd582('0x4b')]));_0x144bbc[_0xd582('0x4a')]=_0x144bbc['attributes'][_0xd582('0x4c')]?_0x144bbc[_0xd582('0x4a')]:_0x1a5eb1[_0xd582('0x49')];_0x144bbc[_0xd582('0x4f')]=qs[_0xd582('0x50')](_0x4dc315[_0xd582('0x46')][_0xd582('0x50')]);_0x144bbc[_0xd582('0x51')]=qs[_0xd582('0x47')](_['pick'](_0x4dc315['query'],_0x1a5eb1[_0xd582('0x47')]));if(_0x4dc315[_0xd582('0x46')][_0xd582('0x53')]){_0x144bbc[_0xd582('0x51')]=_[_0xd582('0x6c')](_0x144bbc[_0xd582('0x51')],{'$or':_[_0xd582('0x41')](_0x144bbc[_0xd582('0x4a')],function(_0x9a937f){var _0x4c3e15={};_0x4c3e15[_0x9a937f]={'$like':'%'+_0x4dc315[_0xd582('0x46')][_0xd582('0x53')]+'%'};return _0x4c3e15;})});}_0x144bbc=_[_0xd582('0x6c')]({},_0x144bbc,_0x4dc315['options']);return _0x1fe813[_0xd582('0xe7')](_0x144bbc);}})[_0xd582('0x22')](function(_0x5a6617){if(_0x5a6617){_0x664543=_0x5a6617[_0xd582('0x4c')];if(!_0x4dc315['query']['hasOwnProperty'](_0xd582('0x4e'))){_0x144bbc['limit']=qs['limit'](_0x4dc315[_0xd582('0x46')]['limit']);_0x144bbc[_0xd582('0x2f')]=qs[_0xd582('0x2f')](_0x4dc315[_0xd582('0x46')]['offset']);}return _0x1fe813[_0xd582('0xe7')](_0x144bbc);}})[_0xd582('0x22')](function(_0x4f1159){if(_0x4f1159){return _0x4f1159?{'count':_0x664543,'rows':_0x4f1159}:null;}})[_0xd582('0x22')](respondWithResult(_0xee8c60,null))[_0xd582('0x2b')](handleError(_0xee8c60,null));}; \ No newline at end of file +var _0x322a=['no\x20available\x20attributes','createdAt','updatedAt','difference','from','From','Body','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','refid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','*,*,*,*','created','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','findAndCountAll','finally','getApplications','order','getInteractions','Contact','Owner','fullname','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','undefined','count','offset','set','json','apply','reject','then','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','Pause','map','SmsAccount','fieldName','keys','query','model','attributes','intersection','fields','limit','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','nolimit','sort','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError'];(function(_0x15b150,_0x1b9417){var _0x1b1ada=function(_0x13923f){while(--_0x13923f){_0x15b150['push'](_0x15b150['shift']());}};_0x1b1ada(++_0x1b9417);}(_0x322a,0x147));var _0xa322=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x322a[_0x55c1f0];return _0x1530fa;};'use strict';var emlformat=require(_0xa322('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa322('0x1'));var jsonpatch=require(_0xa322('0x2'));var rp=require(_0xa322('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa322('0x4'));var util=require(_0xa322('0x5'));var path=require(_0xa322('0x6'));var sox=require(_0xa322('0x7'));var csv=require(_0xa322('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa322('0x9'));var squel=require(_0xa322('0xa'));var crypto=require('crypto');var jsforce=require(_0xa322('0xb'));var deskjs=require(_0xa322('0xc'));var toCsv=require(_0xa322('0x8'));var querystring=require('querystring');var Papa=require(_0xa322('0xd'));var Redis=require(_0xa322('0xe'));var authService=require(_0xa322('0xf'));var qs=require(_0xa322('0x10'));var as=require(_0xa322('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa322('0x12'))('api');var utils=require(_0xa322('0x13'));var config=require(_0xa322('0x14'));var licenseUtil=require(_0xa322('0x15'));var db=require(_0xa322('0x16'))['db'];config[_0xa322('0x17')]=_[_0xa322('0x18')](config[_0xa322('0x17')],{'host':_0xa322('0x19'),'port':0x18eb});var socket=require(_0xa322('0x1a'))(new Redis(config[_0xa322('0x17')]));require(_0xa322('0x1b'))[_0xa322('0x1c')](socket);var jayson=require(_0xa322('0x1d'));var client=jayson[_0xa322('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0xba0ccc,_0x2cb799,_0x4a6546,_0x1cbf76){return new BPromise(function(_0x1ca8d4,_0xfd5738){var _0x1b2d08=_0x1cbf76||client;return _0x1b2d08[_0xa322('0x1f')](_0xba0ccc,_0x4a6546)['then'](function(_0x472c0a){logger[_0xa322('0x20')]('SmsAccount,\x20%s,\x20%s',_0x2cb799,_0xa322('0x21'));logger[_0xa322('0x22')](_0xa322('0x23'),_0x2cb799,'request\x20sent',JSON[_0xa322('0x24')](_0x472c0a));if(_0x472c0a['error']){if(_0x472c0a['error']['code']===0x1f4){logger[_0xa322('0x25')](_0xa322('0x26'),_0x2cb799,_0x472c0a[_0xa322('0x25')]['message']);return _0xfd5738(_0x472c0a[_0xa322('0x25')][_0xa322('0x27')]);}logger[_0xa322('0x25')]('SmsAccount,\x20%s,\x20%s',_0x2cb799,_0x472c0a[_0xa322('0x25')]['message']);return _0x1ca8d4(_0x472c0a['error']['message']);}else{logger['info'](_0xa322('0x26'),_0x2cb799,_0xa322('0x21'));_0x1ca8d4(_0x472c0a[_0xa322('0x28')][_0xa322('0x27')]);}})[_0xa322('0x29')](function(_0x18450c){logger[_0xa322('0x25')](_0xa322('0x26'),_0x2cb799,_0x18450c);_0xfd5738(_0x18450c);});});}function respondWithStatusCode(_0x4f3530,_0x5245d3){_0x5245d3=_0x5245d3||0xcc;return function(_0x43387d){if(_0x43387d){return _0x4f3530[_0xa322('0x2a')](_0x5245d3);}return _0x4f3530[_0xa322('0x2b')](_0x5245d3)['end']();};}function respondWithResult(_0x457449,_0x1ef891){_0x1ef891=_0x1ef891||0xc8;return function(_0x116da8){if(_0x116da8){return _0x457449[_0xa322('0x2b')](_0x1ef891)['json'](_0x116da8);}};}function respondWithFilteredResult(_0x4a4567,_0x23fcbd){return function(_0x4981f9){if(_0x4981f9){var _0x3dd572=typeof _0x23fcbd['offset']===_0xa322('0x2c')&&typeof _0x23fcbd['limit']===_0xa322('0x2c');var _0x33db6d=_0x4981f9[_0xa322('0x2d')];var _0x396134=_0x3dd572?0x0:_0x23fcbd[_0xa322('0x2e')];var _0x40c9b0=_0x3dd572?_0x4981f9[_0xa322('0x2d')]:_0x23fcbd['offset']+_0x23fcbd['limit'];var _0x4b87b5;if(_0x40c9b0>=_0x33db6d){_0x40c9b0=_0x33db6d;_0x4b87b5=0xc8;}else{_0x4b87b5=0xce;}_0x4a4567[_0xa322('0x2b')](_0x4b87b5);return _0x4a4567[_0xa322('0x2f')]('Content-Range',_0x396134+'-'+_0x40c9b0+'/'+_0x33db6d)[_0xa322('0x30')](_0x4981f9);}return null;};}function patchUpdates(_0x1446a1){return function(_0x3faa9a){try{jsonpatch[_0xa322('0x31')](_0x3faa9a,_0x1446a1,!![]);}catch(_0x57d0b6){return BPromise[_0xa322('0x32')](_0x57d0b6);}return _0x3faa9a['save']();};}function saveUpdates(_0x4bb0c7,_0x5ca857){return function(_0x5a827f){if(_0x5a827f){return _0x5a827f['update'](_0x4bb0c7)[_0xa322('0x33')](function(_0x2c9745){return _0x2c9745;});}return null;};}function removeEntity(_0xff9c1d,_0x2063ee){return function(_0x32957e){if(_0x32957e){return _0x32957e[_0xa322('0x34')]()[_0xa322('0x33')](function(){var _0x2a3524=_0x32957e[_0xa322('0x35')]({'plain':!![]});var _0x55aaf7=_0xa322('0x36');return db[_0xa322('0x37')]['destroy']({'where':{'type':_0x55aaf7,'resourceId':_0x2a3524['id']}})[_0xa322('0x33')](function(){return _0x32957e;});})[_0xa322('0x33')](function(){_0xff9c1d['status'](0xcc)[_0xa322('0x38')]();});}};}function handleEntityNotFound(_0x66e573,_0x534e62){return function(_0x46e54e){if(!_0x46e54e){_0x66e573[_0xa322('0x2a')](0x194);}return _0x46e54e;};}function handleError(_0x29646c,_0xcb436e){_0xcb436e=_0xcb436e||0x1f4;return function(_0x269ab7){logger['error'](_0x269ab7[_0xa322('0x39')]);if(_0x269ab7[_0xa322('0x3a')]){delete _0x269ab7[_0xa322('0x3a')];}_0x29646c[_0xa322('0x2b')](_0xcb436e)[_0xa322('0x3b')](_0x269ab7);};}exports['index']=function(_0x22ade3,_0xf79c3){var _0x15bc95={'include':[{'model':db[_0xa322('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4dbe0f={},_0x36b3b3={'count':0x0,'rows':[]};var _0x2aa721=_[_0xa322('0x3d')](db[_0xa322('0x3e')]['rawAttributes'],function(_0x59491b){return{'name':_0x59491b[_0xa322('0x3f')],'type':_0x59491b['type']['key']};});_0x4dbe0f['model']=_['map'](_0x2aa721,'name');_0x4dbe0f['query']=_[_0xa322('0x40')](_0x22ade3[_0xa322('0x41')]);_0x4dbe0f['filters']=_['intersection'](_0x4dbe0f[_0xa322('0x42')],_0x4dbe0f[_0xa322('0x41')]);_0x15bc95[_0xa322('0x43')]=_[_0xa322('0x44')](_0x4dbe0f[_0xa322('0x42')],qs[_0xa322('0x45')](_0x22ade3[_0xa322('0x41')]['fields']));_0x15bc95[_0xa322('0x43')]=_0x15bc95[_0xa322('0x43')]['length']?_0x15bc95['attributes']:_0x4dbe0f[_0xa322('0x42')];if(!_0x22ade3[_0xa322('0x41')]['hasOwnProperty']('nolimit')){_0x15bc95[_0xa322('0x46')]=qs[_0xa322('0x46')](_0x22ade3[_0xa322('0x41')][_0xa322('0x46')]);_0x15bc95[_0xa322('0x2e')]=qs[_0xa322('0x2e')](_0x22ade3['query'][_0xa322('0x2e')]);}_0x15bc95['order']=qs['sort'](_0x22ade3[_0xa322('0x41')]['sort']);_0x15bc95[_0xa322('0x47')]=qs[_0xa322('0x48')](_[_0xa322('0x49')](_0x22ade3[_0xa322('0x41')],_0x4dbe0f[_0xa322('0x48')]),_0x2aa721);if(_0x22ade3[_0xa322('0x41')]['filter']){_0x15bc95[_0xa322('0x47')]=_[_0xa322('0x4a')](_0x15bc95['where'],{'$or':_[_0xa322('0x3d')](_0x2aa721,function(_0x15845e){if(_0x15845e[_0xa322('0x4b')]!==_0xa322('0x4c')){var _0x1f636b={};_0x1f636b[_0x15845e[_0xa322('0x3a')]]={'$like':'%'+_0x22ade3[_0xa322('0x41')][_0xa322('0x4d')]+'%'};return _0x1f636b;}})});}_0x15bc95=_[_0xa322('0x4a')]({},_0x15bc95,_0x22ade3[_0xa322('0x4e')]);var _0xca12d7={'where':_0x15bc95[_0xa322('0x47')]};return db[_0xa322('0x3e')][_0xa322('0x2d')](_0xca12d7)[_0xa322('0x33')](function(_0x258bd9){_0x36b3b3[_0xa322('0x2d')]=_0x258bd9;if(_0x22ade3[_0xa322('0x41')][_0xa322('0x4f')]){_0x15bc95[_0xa322('0x50')]=[{'all':!![]}];}return db[_0xa322('0x3e')][_0xa322('0x51')](_0x15bc95);})['then'](function(_0x34b477){_0x36b3b3[_0xa322('0x52')]=_0x34b477;return _0x36b3b3;})[_0xa322('0x33')](respondWithFilteredResult(_0xf79c3,_0x15bc95))[_0xa322('0x29')](handleError(_0xf79c3,null));};exports[_0xa322('0x53')]=function(_0x2f92ac,_0x31cc90){var _0x1e449a={'raw':![],'where':{'id':_0x2f92ac[_0xa322('0x54')]['id']},'include':[{'model':db[_0xa322('0x3c')],'as':_0xa322('0x55')}]},_0x10b4da={};_0x10b4da[_0xa322('0x42')]=_[_0xa322('0x40')](db['SmsAccount']['rawAttributes']);_0x10b4da[_0xa322('0x41')]=_[_0xa322('0x40')](_0x2f92ac[_0xa322('0x41')]);_0x10b4da['filters']=_[_0xa322('0x44')](_0x10b4da[_0xa322('0x42')],_0x10b4da['query']);_0x1e449a[_0xa322('0x43')]=_[_0xa322('0x44')](_0x10b4da[_0xa322('0x42')],qs[_0xa322('0x45')](_0x2f92ac[_0xa322('0x41')][_0xa322('0x45')]));_0x1e449a[_0xa322('0x43')]=_0x1e449a[_0xa322('0x43')][_0xa322('0x56')]?_0x1e449a['attributes']:_0x10b4da['model'];if(_0x2f92ac['query'][_0xa322('0x4f')]){_0x1e449a[_0xa322('0x50')]=[{'all':!![]}];}_0x1e449a=_['merge']({},_0x1e449a,_0x2f92ac[_0xa322('0x4e')]);return db[_0xa322('0x3e')][_0xa322('0x57')](_0x1e449a)[_0xa322('0x33')](handleEntityNotFound(_0x31cc90,null))[_0xa322('0x33')](respondWithResult(_0x31cc90,null))[_0xa322('0x29')](handleError(_0x31cc90,null));};exports['create']=function(_0x9aee3b,_0x47da93){return db[_0xa322('0x3e')][_0xa322('0x58')](_0x9aee3b[_0xa322('0x59')],{})[_0xa322('0x33')](function(_0x133aa2){var _0x4d08b8=_0x9aee3b[_0xa322('0x5a')][_0xa322('0x35')]({'plain':!![]});if(!_0x4d08b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d08b8[_0xa322('0x5b')]===_0xa322('0x5a')){var _0x1d91a8=_0x133aa2[_0xa322('0x35')]({'plain':!![]});var _0x195627=_0xa322('0x36');return db[_0xa322('0x5c')][_0xa322('0x57')]({'where':{'name':_0x195627,'userProfileId':_0x4d08b8[_0xa322('0x5d')]},'raw':!![]})[_0xa322('0x33')](function(_0x5d7252){if(_0x5d7252&&_0x5d7252[_0xa322('0x5e')]===0x0){return db[_0xa322('0x37')][_0xa322('0x58')]({'name':_0x1d91a8[_0xa322('0x3a')],'resourceId':_0x1d91a8['id'],'type':_0x5d7252['name'],'sectionId':_0x5d7252['id']},{})[_0xa322('0x33')](function(){return _0x133aa2;});}else{return _0x133aa2;}})[_0xa322('0x29')](function(_0x3671bb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3671bb);throw _0x3671bb;});}return _0x133aa2;})['then'](respondWithResult(_0x47da93,0xc9))['catch'](handleError(_0x47da93,null));};exports[_0xa322('0x5f')]=function(_0x5b7be5,_0x3d0155){if(_0x5b7be5[_0xa322('0x59')]['id']){delete _0x5b7be5[_0xa322('0x59')]['id'];}return db[_0xa322('0x3e')][_0xa322('0x57')]({'where':{'id':_0x5b7be5[_0xa322('0x54')]['id']},'include':[{'model':db[_0xa322('0x3c')],'as':_0xa322('0x55')}]})[_0xa322('0x33')](handleEntityNotFound(_0x3d0155,null))[_0xa322('0x33')](saveUpdates(_0x5b7be5['body'],null))[_0xa322('0x33')](respondWithResult(_0x3d0155,null))[_0xa322('0x29')](handleError(_0x3d0155,null));};exports[_0xa322('0x34')]=function(_0x274a35,_0x108ac7){return db['SmsAccount'][_0xa322('0x57')]({'where':{'id':_0x274a35['params']['id']}})['then'](handleEntityNotFound(_0x108ac7,null))[_0xa322('0x33')](removeEntity(_0x108ac7,null))[_0xa322('0x29')](handleError(_0x108ac7,null));};exports[_0xa322('0x60')]=function(_0x46b993,_0x5b5958){return db[_0xa322('0x3e')]['describe']()[_0xa322('0x33')](respondWithResult(_0x5b5958,null))['catch'](handleError(_0x5b5958,null));};exports[_0xa322('0x61')]=function(_0xd51152,_0x2f932b,_0x5dcdbc){if(_0xd51152[_0xa322('0x59')]['id']){delete _0xd51152[_0xa322('0x59')]['id'];}return db[_0xa322('0x3e')]['find']({'where':{'id':_0xd51152['params']['id']}})['then'](handleEntityNotFound(_0x2f932b,null))[_0xa322('0x33')](function(_0x417f25){if(_0x417f25){_0xd51152[_0xa322('0x59')]['SmsAccountId']=_0x417f25['id'];return db[_0xa322('0x62')]['create'](_0xd51152[_0xa322('0x59')]);}})[_0xa322('0x33')](respondWithResult(_0x2f932b,null))[_0xa322('0x29')](handleError(_0x2f932b,null));};exports[_0xa322('0x63')]=function(_0x1ba3f1,_0x1c7f46,_0x18ba4c){var _0x3131f9={'raw':![],'where':{}};var _0x5b9ccf={};var _0x53078f={'count':0x0,'rows':[]};return db[_0xa322('0x3e')][_0xa322('0x64')]({'where':{'id':_0x1ba3f1[_0xa322('0x54')]['id']}})['then'](handleEntityNotFound(_0x1c7f46,null))[_0xa322('0x33')](function(_0x2fd326){if(_0x2fd326){_0x5b9ccf[_0xa322('0x42')]=_[_0xa322('0x40')](db[_0xa322('0x62')][_0xa322('0x65')]);_0x5b9ccf[_0xa322('0x41')]=_[_0xa322('0x40')](_0x1ba3f1[_0xa322('0x41')]);_0x5b9ccf[_0xa322('0x48')]=_[_0xa322('0x44')](_0x5b9ccf[_0xa322('0x42')],_0x5b9ccf[_0xa322('0x41')]);_0x3131f9['attributes']=_['intersection'](_0x5b9ccf['model'],qs[_0xa322('0x45')](_0x1ba3f1['query'][_0xa322('0x45')]));_0x3131f9['attributes']=_0x3131f9[_0xa322('0x43')][_0xa322('0x56')]?_0x3131f9[_0xa322('0x43')]:_0x5b9ccf[_0xa322('0x42')];if(!_0x1ba3f1[_0xa322('0x41')][_0xa322('0x66')](_0xa322('0x67'))){_0x3131f9[_0xa322('0x46')]=qs[_0xa322('0x46')](_0x1ba3f1[_0xa322('0x41')][_0xa322('0x46')]);_0x3131f9[_0xa322('0x2e')]=qs[_0xa322('0x2e')](_0x1ba3f1[_0xa322('0x41')][_0xa322('0x2e')]);}_0x3131f9['order']=qs[_0xa322('0x68')](_0x1ba3f1[_0xa322('0x41')][_0xa322('0x68')]);_0x3131f9['where']=qs['filters'](_['pick'](_0x1ba3f1[_0xa322('0x41')],_0x5b9ccf[_0xa322('0x48')]));_0x3131f9[_0xa322('0x47')][_0xa322('0x69')]=_0x2fd326['id'];if(_0x1ba3f1[_0xa322('0x41')][_0xa322('0x4d')]){_0x3131f9[_0xa322('0x47')]=_[_0xa322('0x4a')](_0x3131f9['where'],{'$or':_[_0xa322('0x3d')](_0x3131f9[_0xa322('0x43')],function(_0x28f8cf){var _0x2206c2={};_0x2206c2[_0x28f8cf]={'$like':'%'+_0x1ba3f1[_0xa322('0x41')]['filter']+'%'};return _0x2206c2;})});}_0x3131f9=_[_0xa322('0x4a')]({},_0x3131f9,_0x1ba3f1[_0xa322('0x4e')]);return db[_0xa322('0x62')][_0xa322('0x2d')]({'where':_0x3131f9[_0xa322('0x47')]})['then'](function(_0x3c2920){_0x53078f[_0xa322('0x2d')]=_0x3c2920;if(_0x1ba3f1[_0xa322('0x41')][_0xa322('0x4f')]){_0x3131f9[_0xa322('0x50')]=[{'all':!![]}];}return db[_0xa322('0x62')]['findAll'](_0x3131f9);})[_0xa322('0x33')](function(_0x49aeb2){_0x53078f[_0xa322('0x52')]=_0x49aeb2;return _0x53078f;});}})['then'](respondWithFilteredResult(_0x1c7f46,_0x3131f9))['catch'](handleError(_0x1c7f46,null));};exports[_0xa322('0x6a')]=function(_0x3c726d,_0x1e62f6,_0x496f07){return db[_0xa322('0x3e')][_0xa322('0x57')]({'where':{'id':_0x3c726d[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x1e62f6,null))[_0xa322('0x33')](function(_0x5460a8){if(_0x5460a8){return _0x5460a8[_0xa322('0x6a')](_0x3c726d[_0xa322('0x41')][_0xa322('0x6b')]);}})[_0xa322('0x33')](respondWithStatusCode(_0x1e62f6,null))[_0xa322('0x29')](handleError(_0x1e62f6,null));};exports[_0xa322('0x6c')]=function(_0x31ae69,_0x1828e2,_0xd8b48){if(_0x31ae69[_0xa322('0x59')]['id']){delete _0x31ae69['body']['id'];}return db[_0xa322('0x3e')]['find']({'where':{'id':_0x31ae69[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x1828e2,null))[_0xa322('0x33')](function(_0x564c2e){if(_0x564c2e){_0x31ae69['body'][_0xa322('0x69')]=_0x564c2e['id'];return db[_0xa322('0x6d')][_0xa322('0x58')](_0x31ae69[_0xa322('0x59')]);}})[_0xa322('0x33')](respondWithResult(_0x1828e2,null))[_0xa322('0x29')](handleError(_0x1828e2,null));};exports[_0xa322('0x6e')]=function(_0x46364e,_0x313984,_0x19fd82){var _0x13931e={'raw':![],'where':{}};var _0x49bde9={};var _0x3b749f={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa322('0x64')]({'where':{'id':_0x46364e[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x313984,null))[_0xa322('0x33')](function(_0x12cda3){if(_0x12cda3){_0x49bde9[_0xa322('0x42')]=_[_0xa322('0x40')](db[_0xa322('0x6d')][_0xa322('0x65')]);_0x49bde9['query']=_['keys'](_0x46364e['query']);_0x49bde9[_0xa322('0x48')]=_[_0xa322('0x44')](_0x49bde9[_0xa322('0x42')],_0x49bde9[_0xa322('0x41')]);_0x13931e[_0xa322('0x43')]=_[_0xa322('0x44')](_0x49bde9[_0xa322('0x42')],qs[_0xa322('0x45')](_0x46364e[_0xa322('0x41')][_0xa322('0x45')]));_0x13931e[_0xa322('0x43')]=_0x13931e[_0xa322('0x43')][_0xa322('0x56')]?_0x13931e['attributes']:_0x49bde9['model'];if(!_0x46364e[_0xa322('0x41')][_0xa322('0x66')](_0xa322('0x67'))){_0x13931e[_0xa322('0x46')]=qs[_0xa322('0x46')](_0x46364e[_0xa322('0x41')]['limit']);_0x13931e[_0xa322('0x2e')]=qs[_0xa322('0x2e')](_0x46364e['query'][_0xa322('0x2e')]);}_0x13931e['order']=qs[_0xa322('0x68')](_0x46364e['query'][_0xa322('0x68')]);_0x13931e['where']=qs[_0xa322('0x48')](_[_0xa322('0x49')](_0x46364e[_0xa322('0x41')],_0x49bde9['filters']));_0x13931e[_0xa322('0x47')][_0xa322('0x69')]=_0x12cda3['id'];if(_0x46364e[_0xa322('0x41')][_0xa322('0x4d')]){_0x13931e['where']=_['merge'](_0x13931e[_0xa322('0x47')],{'$or':_[_0xa322('0x3d')](_0x13931e[_0xa322('0x43')],function(_0x4b7c65){var _0x3c7241={};_0x3c7241[_0x4b7c65]={'$like':'%'+_0x46364e[_0xa322('0x41')][_0xa322('0x4d')]+'%'};return _0x3c7241;})});}_0x13931e=_[_0xa322('0x4a')]({},_0x13931e,_0x46364e[_0xa322('0x4e')]);return db[_0xa322('0x6d')][_0xa322('0x2d')]({'where':_0x13931e[_0xa322('0x47')]})[_0xa322('0x33')](function(_0x20aa60){_0x3b749f['count']=_0x20aa60;if(_0x46364e['query']['includeAll']){_0x13931e[_0xa322('0x50')]=[{'all':!![]}];}return db[_0xa322('0x6d')][_0xa322('0x51')](_0x13931e);})['then'](function(_0x15edbe){_0x3b749f['rows']=_0x15edbe;return _0x3b749f;});}})[_0xa322('0x33')](respondWithFilteredResult(_0x313984,_0x13931e))['catch'](handleError(_0x313984,null));};exports['removeAnswers']=function(_0x197449,_0x19abd3,_0x211e91){return db['SmsAccount'][_0xa322('0x57')]({'where':{'id':_0x197449[_0xa322('0x54')]['id']}})['then'](handleEntityNotFound(_0x19abd3,null))['then'](function(_0x2db357){if(_0x2db357){return _0x2db357['removeAnswers'](_0x197449[_0xa322('0x41')][_0xa322('0x6b')]);}})[_0xa322('0x33')](respondWithStatusCode(_0x19abd3,null))[_0xa322('0x29')](handleError(_0x19abd3,null));};exports['notify']=function(_0x193b5b,_0x5d3a94,_0x199106){var _0x10b8f4={'channel':_0xa322('0x6f')};var _0x21de79=[];var _0x25e1fc=[];var _0x51f908={};return db[_0xa322('0x3e')][_0xa322('0x57')]({'where':{'id':_0x193b5b[_0xa322('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xa322('0x70')}]})[_0xa322('0x33')](handleEntityNotFound(_0x5d3a94,null))[_0xa322('0x33')](function(_0x4b4ae){_0x10b8f4[_0xa322('0x71')]=_0x4b4ae;_0x10b8f4[_0xa322('0x72')]=_[_0xa322('0x73')](_0x4b4ae[_0xa322('0x70')],[_0xa322('0x74')],[_0xa322('0x75')]);if(_0x10b8f4[_0xa322('0x71')][_0xa322('0x70')]){delete _0x10b8f4[_0xa322('0x71')]['Applications'];}return db[_0xa322('0x76')]['describe']();})[_0xa322('0x33')](function(_0x393556){if(!_0x393556){throw new db[(_0xa322('0x77'))][(_0xa322('0x78'))](_0xa322('0x79'));}_0x21de79=_['difference'](_[_0xa322('0x40')](_0x393556),[_0xa322('0x7a'),_0xa322('0x7b')]);_0x25e1fc=_[_0xa322('0x7c')](_[_0xa322('0x40')](_0x393556),[_0xa322('0x7a'),_0xa322('0x7b'),'CompanyId','ListId']);_0x10b8f4[_0xa322('0x59')]={'mapKey':'mobile'};if(_0x10b8f4[_0xa322('0x71')]['type']){switch(_0x10b8f4[_0xa322('0x71')][_0xa322('0x4b')]){case'twilio':_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x7e')];_0x10b8f4[_0xa322('0x59')][_0xa322('0x59')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x7f')];_0x10b8f4[_0xa322('0x59')]['messageId']=_0x193b5b[_0xa322('0x59')]['MessageSid'];break;case'skebby':_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')]='+'+_0x193b5b['body'][_0xa322('0x80')];_0x10b8f4[_0xa322('0x59')][_0xa322('0x59')]=_0x193b5b['body'][_0xa322('0x81')];break;case _0xa322('0x82'):_0x10b8f4[_0xa322('0x59')]['from']=_0x193b5b[_0xa322('0x59')][_0xa322('0x7d')];_0x10b8f4[_0xa322('0x59')][_0xa322('0x59')]=_0x193b5b[_0xa322('0x59')]['message'];break;case _0xa322('0x83'):_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x7d')];_0x10b8f4[_0xa322('0x59')]['body']=_0x193b5b[_0xa322('0x59')][_0xa322('0x59')];_0x10b8f4[_0xa322('0x59')][_0xa322('0x84')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x85')];break;case _0xa322('0x86'):_0x10b8f4[_0xa322('0x59')]['from']=_0x193b5b[_0xa322('0x59')][_0xa322('0x7e')];_0x10b8f4[_0xa322('0x59')]['body']=_0x193b5b[_0xa322('0x59')][_0xa322('0x87')];_0x10b8f4[_0xa322('0x59')][_0xa322('0x84')]=_0x193b5b[_0xa322('0x59')]['MessageUUID'];break;case _0xa322('0x88'):_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')]='+'+_0x193b5b[_0xa322('0x59')][_0xa322('0x89')][0x0][_0xa322('0x7d')];_0x10b8f4['body']['body']=_0x193b5b[_0xa322('0x59')][_0xa322('0x89')][0x0][_0xa322('0x81')];_0x10b8f4[_0xa322('0x59')]['messageId']=_0x193b5b[_0xa322('0x59')][_0xa322('0x89')][0x0][_0xa322('0x84')];break;case _0xa322('0x8a'):_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x8b')];_0x10b8f4[_0xa322('0x59')][_0xa322('0x59')]=_0x193b5b['body'][_0xa322('0x8c')]['message'];break;case _0xa322('0x8d'):_0x10b8f4['body'][_0xa322('0x7d')]=_0x193b5b[_0xa322('0x59')]['fromNumber'];_0x10b8f4['body'][_0xa322('0x59')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x81')];_0x10b8f4[_0xa322('0x59')]['messageId']=_0x193b5b[_0xa322('0x59')][_0xa322('0x8e')];break;case _0xa322('0x8f'):_0x10b8f4[_0xa322('0x59')][_0xa322('0x84')]=_0x193b5b[_0xa322('0x59')][0x0][_0xa322('0x27')]['id'];_0x10b8f4['body'][_0xa322('0x7d')]=_0x193b5b[_0xa322('0x59')][0x0][_0xa322('0x27')][_0xa322('0x7d')];_0x10b8f4[_0xa322('0x59')]['body']=_0x193b5b[_0xa322('0x59')][0x0]['message'][_0xa322('0x81')];break;case'intelepeer':_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')]=_0x193b5b['body'][_0xa322('0x7d')];_0x10b8f4['body'][_0xa322('0x59')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x27')];_0x10b8f4[_0xa322('0x59')][_0xa322('0x84')]=_0x193b5b[_0xa322('0x59')][_0xa322('0x90')];break;}}if(_0x10b8f4[_0xa322('0x59')]['id']){delete _0x10b8f4[_0xa322('0x59')]['id'];}if(_[_0xa322('0x91')](_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')])){throw new db[(_0xa322('0x77'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xa322('0x91')](_0x10b8f4[_0xa322('0x59')][_0xa322('0x59')])||_0x10b8f4[_0xa322('0x59')][_0xa322('0x59')]===''){throw new db[(_0xa322('0x77'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa322('0x91')](_0x10b8f4[_0xa322('0x59')][_0xa322('0x92')])){throw new db['Sequelize'][(_0xa322('0x78'))](_0xa322('0x93')+_0x25e1fc);}if(!_[_0xa322('0x94')](_0x25e1fc,_0x10b8f4['body']['mapKey'])){throw new db[(_0xa322('0x77'))][(_0xa322('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25e1fc);}_0x51f908[_0x10b8f4['body'][_0xa322('0x92')]]=_0x10b8f4['body'][_0xa322('0x7d')];return db['CmList']['find']({'where':{'id':_0x10b8f4[_0xa322('0x71')][_0xa322('0x95')]},'include':[{'model':db[_0xa322('0x76')],'as':_0xa322('0x96'),'where':_0x51f908,'limit':0x1,'order':[[_0xa322('0x7b'),_0xa322('0x97')]]}]});})['then'](handleEntityNotFound(_0x5d3a94,null))[_0xa322('0x33')](function(_0x40df70){if(_0x40df70){_0x10b8f4[_0xa322('0x98')]=_[_0xa322('0x99')](_0x40df70,['Contacts']);if(_0x40df70[_0xa322('0x96')][_0xa322('0x56')]){return _0x40df70[_0xa322('0x96')][0x0];}var _0x281021=_[_0xa322('0x18')](_0x10b8f4['body'],{'firstName':_0x10b8f4[_0xa322('0x59')]['from'],'ListId':_0x40df70['id']});_0x281021[_0x10b8f4[_0xa322('0x59')][_0xa322('0x92')]]=_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')];return db[_0xa322('0x76')][_0xa322('0x58')](_0x281021,{'fields':_0x21de79,'raw':!![]});}})[_0xa322('0x33')](handleEntityNotFound(_0x5d3a94,null))[_0xa322('0x33')](function(_0x5330e6){if(_0x5330e6){_0x10b8f4[_0xa322('0x9a')]=_0x5330e6;var _0x2e148a={'ContactId':_0x5330e6['id'],'phone':_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')],'SmsAccountId':_0x193b5b[_0xa322('0x54')]['id']};var _0x38cf35={'ContactId':_0x5330e6['id'],'SmsAccountId':_0x193b5b['params']['id'],'closed':![]};return db[_0xa322('0x9b')]['find']({'where':_0x38cf35})[_0xa322('0x33')](function(_0x1afae5){if(_0x1afae5){return[_0x1afae5,![]];}return db[_0xa322('0x9b')][_0xa322('0x58')](_0x2e148a)[_0xa322('0x33')](function(_0x1cb348){return[_0x1cb348,!![]];});});}})[_0xa322('0x9c')](function(_0x4b741b,_0x144473){_0x10b8f4[_0xa322('0x9d')]=_0x4b741b[_0xa322('0x35')]({'plain':!![]});_0x10b8f4[_0xa322('0x9d')]['created']=![];if(_0x144473){if(_0x10b8f4[_0xa322('0x71')][_0xa322('0x9e')]){_0x10b8f4[_0xa322('0x72')][_0xa322('0x9f')]({'id':0x0,'priority':_0x10b8f4[_0xa322('0x72')][_0xa322('0x56')]+0x1,'app':_0xa322('0xa0'),'appdata':'unmanaged','interval':_0xa322('0xa1')});}_0x10b8f4['interaction'][_0xa322('0xa2')]=!![];}return db[_0xa322('0xa3')]['create']({'phone':_0x10b8f4[_0xa322('0x59')][_0xa322('0x7d')],'messageId':_0x10b8f4['body'][_0xa322('0x84')],'body':_0x10b8f4['body'][_0xa322('0x59')],'SmsAccountId':_0x193b5b[_0xa322('0x54')]['id'],'SmsInteractionId':_0x4b741b['id'],'direction':'in','ContactId':_0x4b741b['ContactId'],'AttachmentId':_0x10b8f4['body'][_0xa322('0xa4')]});})[_0xa322('0x33')](function(_0x1c9725){_0x10b8f4[_0xa322('0x27')]=_0x1c9725;if(_0x10b8f4['interaction'][_0xa322('0xa5')]){return db[_0xa322('0xa6')]['find']({'attributes':['id',_0xa322('0x3a')],'where':{'id':_0x10b8f4['interaction'][_0xa322('0xa5')]}})[_0xa322('0x33')](function(_0x2a33bb){if(_0x2a33bb){_0x10b8f4['applications'][_0xa322('0xa7')]({'id':0x0,'priority':0x0,'app':_0xa322('0xa8'),'appdata':_0x2a33bb['name']+','+(_0x10b8f4[_0xa322('0x71')][_0xa322('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xa322('0xaa'),_0x10b8f4);});}return respondWithRpcPromise(_0xa322('0xab'),'startRouting',_0x10b8f4);})[_0xa322('0x33')](function(_0x1b5e36){if(_0x1b5e36){var _0x13c88=0xc8;var _0x289892=_0xa322('0xac');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x289892,_0x13c88,_0xa322('0xad'));logger['debug'](_0xa322('0xae'),_0x289892,_0x13c88,'entity\x20found',JSON[_0xa322('0x24')](_0x1b5e36));if(_0x10b8f4[_0xa322('0x71')][_0xa322('0x4b')]===_0xa322('0xaf')){return _0x5d3a94['status'](_0x13c88)[_0xa322('0x2f')](_0xa322('0xb0'),'text/xml')[_0xa322('0x3b')](_0xa322('0xb1'));}else{return _0x5d3a94[_0xa322('0x2b')](_0x13c88)[_0xa322('0x30')](_0x1b5e36);}}})[_0xa322('0x29')](handleError(_0x5d3a94,null));};exports['addApplications']=function(_0x21dfde,_0x25df95){var _0x5cf4fc=_0x21dfde[_0xa322('0x54')]['id'];var _0x31ca6b=_0x21dfde[_0xa322('0x59')];var _0x23007e=0xc8;var _0x202aba=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xa322('0xb2')][_0xa322('0xb3')][_0xa322('0xb4')][_0xa322('0xb5')]},function(_0x573284){return db['SmsAccount']['findOne']({'where':{'id':_0x5cf4fc},'transaction':_0x573284})[_0xa322('0x33')](function(_0x273f93){if(_0x273f93){return db[_0xa322('0xb6')]['destroy']({'where':{'SmsAccountId':_0x5cf4fc},'transaction':_0x573284})[_0xa322('0x33')](function(){var _0x1b5302=_[_0xa322('0x3d')](_0x31ca6b,function(_0x40b06a){_0x40b06a[_0xa322('0x69')]=_0x5cf4fc;return _0x40b06a;});return db['SmsApplication']['bulkCreate'](_0x1b5302,{'transaction':_0x573284});});}else{_0x23007e=0x194;_0x202aba=[];}});})['then'](function(){if(_0x23007e!==0x194){return db[_0xa322('0xb6')][_0xa322('0xb7')]({'where':{'SmsAccountId':_0x5cf4fc},'order':_0xa322('0x74')})[_0xa322('0x33')](function(_0x4cb454){_0x202aba=_0x4cb454;});}})['catch'](function(_0x25949a){_0x23007e=0x1f4;logger[_0xa322('0x25')](_0x25949a['stack']);if(_0x25949a[_0xa322('0x3a')]){delete _0x25949a[_0xa322('0x3a')];}_0x202aba=_0x25949a;})[_0xa322('0xb8')](function(){if(_0x202aba===null){_0x25df95[_0xa322('0x2a')](_0x23007e);}else{if(_0x23007e===0x1f4){_0x25df95[_0xa322('0x2b')](_0x23007e)[_0xa322('0x3b')](_0x202aba);}else{_0x25df95[_0xa322('0x2b')](_0x23007e)[_0xa322('0x30')](_0x202aba);}}});};exports[_0xa322('0xb9')]=function(_0x385e7b,_0x3a7056,_0xf5110f){var _0x45dbb9={};var _0x3ab58c={};var _0x477a3d;var _0x48f644;return db[_0xa322('0x3e')][_0xa322('0x64')]({'where':{'id':_0x385e7b[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x3a7056,null))[_0xa322('0x33')](function(_0x2b35d0){if(_0x2b35d0){_0x477a3d=_0x2b35d0;_0x3ab58c[_0xa322('0x42')]=_[_0xa322('0x40')](db[_0xa322('0xb6')][_0xa322('0x65')]);_0x3ab58c['query']=_[_0xa322('0x40')](_0x385e7b[_0xa322('0x41')]);_0x3ab58c[_0xa322('0x48')]=_['intersection'](_0x3ab58c[_0xa322('0x42')],_0x3ab58c[_0xa322('0x41')]);_0x45dbb9[_0xa322('0x43')]=_[_0xa322('0x44')](_0x3ab58c[_0xa322('0x42')],qs[_0xa322('0x45')](_0x385e7b[_0xa322('0x41')][_0xa322('0x45')]));_0x45dbb9[_0xa322('0x43')]=_0x45dbb9[_0xa322('0x43')]['length']?_0x45dbb9[_0xa322('0x43')]:_0x3ab58c[_0xa322('0x42')];_0x45dbb9[_0xa322('0xba')]=qs[_0xa322('0x68')](_0x385e7b[_0xa322('0x41')][_0xa322('0x68')]);_0x45dbb9[_0xa322('0x47')]=qs[_0xa322('0x48')](_['pick'](_0x385e7b[_0xa322('0x41')],_0x3ab58c['filters']));if(_0x385e7b[_0xa322('0x41')]['filter']){_0x45dbb9['where']=_[_0xa322('0x4a')](_0x45dbb9[_0xa322('0x47')],{'$or':_['map'](_0x45dbb9[_0xa322('0x43')],function(_0x4594ac){var _0x1b96b5={};_0x1b96b5[_0x4594ac]={'$like':'%'+_0x385e7b[_0xa322('0x41')]['filter']+'%'};return _0x1b96b5;})});}_0x45dbb9=_[_0xa322('0x4a')]({},_0x45dbb9,_0x385e7b['options']);return _0x477a3d['getApplications'](_0x45dbb9);}})[_0xa322('0x33')](function(_0x16a251){if(_0x16a251){_0x48f644=_0x16a251[_0xa322('0x56')];if(!_0x385e7b[_0xa322('0x41')][_0xa322('0x66')]('nolimit')){_0x45dbb9[_0xa322('0x46')]=qs[_0xa322('0x46')](_0x385e7b['query']['limit']);_0x45dbb9['offset']=qs[_0xa322('0x2e')](_0x385e7b['query'][_0xa322('0x2e')]);}return _0x477a3d[_0xa322('0xb9')](_0x45dbb9);}})[_0xa322('0x33')](function(_0x4846a4){if(_0x4846a4){return _0x4846a4?{'count':_0x48f644,'rows':_0x4846a4}:null;}})['then'](respondWithResult(_0x3a7056,null))[_0xa322('0x29')](handleError(_0x3a7056,null));};exports[_0xa322('0xbb')]=function(_0x396a67,_0x227796,_0x1859bf){var _0xc43f13={'raw':![],'where':{}};var _0x557143={};var _0x5705de={'count':0x0,'rows':[]};return db[_0xa322('0x3e')][_0xa322('0x64')]({'where':{'id':_0x396a67[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x227796,null))['then'](function(_0x9230cd){if(_0x9230cd){_0x557143[_0xa322('0x42')]=_['keys'](db[_0xa322('0x9b')][_0xa322('0x65')]);_0x557143[_0xa322('0x41')]=_[_0xa322('0x40')](_0x396a67[_0xa322('0x41')]);_0x557143[_0xa322('0x48')]=_[_0xa322('0x44')](_0x557143['model'],_0x557143[_0xa322('0x41')]);_0xc43f13[_0xa322('0x43')]=_[_0xa322('0x44')](_0x557143[_0xa322('0x42')],qs[_0xa322('0x45')](_0x396a67['query'][_0xa322('0x45')]));_0xc43f13[_0xa322('0x43')]=_0xc43f13[_0xa322('0x43')][_0xa322('0x56')]?_0xc43f13[_0xa322('0x43')]:_0x557143[_0xa322('0x42')];if(!_0x396a67[_0xa322('0x41')][_0xa322('0x66')](_0xa322('0x67'))){_0xc43f13[_0xa322('0x46')]=qs[_0xa322('0x46')](_0x396a67[_0xa322('0x41')]['limit']);_0xc43f13[_0xa322('0x2e')]=qs[_0xa322('0x2e')](_0x396a67['query'][_0xa322('0x2e')]);}_0xc43f13['order']=qs[_0xa322('0x68')](_0x396a67[_0xa322('0x41')]['sort']);_0xc43f13[_0xa322('0x47')]=qs[_0xa322('0x48')](_[_0xa322('0x49')](_0x396a67['query'],_0x557143[_0xa322('0x48')]));_0xc43f13[_0xa322('0x47')][_0xa322('0x69')]=_0x9230cd['id'];if(_0x396a67[_0xa322('0x41')]['filter']){_0xc43f13[_0xa322('0x47')]=_[_0xa322('0x4a')](_0xc43f13[_0xa322('0x47')],{'$or':_['map'](_0xc43f13['attributes'],function(_0x1e3a4a){var _0x1dab48={};_0x1dab48[_0x1e3a4a]={'$like':'%'+_0x396a67[_0xa322('0x41')][_0xa322('0x4d')]+'%'};return _0x1dab48;})});}_0xc43f13=_[_0xa322('0x4a')]({},_0xc43f13,_0x396a67['options']);return db[_0xa322('0x9b')]['count']({'where':_0xc43f13['where']})[_0xa322('0x33')](function(_0x2a3319){_0x5705de['count']=_0x2a3319;if(_0x396a67[_0xa322('0x41')][_0xa322('0x4f')]){_0xc43f13[_0xa322('0x50')]=[{'model':db['CmContact'],'as':_0xa322('0xbc'),'required':![]},{'model':db[_0xa322('0xa6')],'as':_0xa322('0xbd'),'attributes':[_0xa322('0x3a'),_0xa322('0xbe'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x396a67[_0xa322('0x41')]['tag']?{'id':_0x396a67[_0xa322('0x41')][_0xa322('0xbf')]}:undefined,'required':_0x396a67[_0xa322('0x41')][_0xa322('0xbf')]?!![]:![]}];}return db[_0xa322('0x9b')][_0xa322('0x51')](_0xc43f13);})[_0xa322('0x33')](function(_0x286676){_0x5705de[_0xa322('0x52')]=_0x286676;return _0x5705de;});}})[_0xa322('0x33')](respondWithFilteredResult(_0x227796,_0xc43f13))[_0xa322('0x29')](handleError(_0x227796,null));};exports['send']=function(_0x32977b,_0x25782c,_0x367d62){var _0x4f015f,_0x3fd5ac,_0x4cd2d0;if(_['isNil'](_0x32977b['body'][_0xa322('0x59')])||_0x32977b[_0xa322('0x59')]['body']===''){throw new db[(_0xa322('0x77'))][(_0xa322('0x78'))](_0xa322('0xc0'));}if(_[_0xa322('0x91')](_0x32977b[_0xa322('0x59')]['to'])){throw new db['Sequelize'][(_0xa322('0x78'))](_0xa322('0xc1'));}_0x4f015f=_0x32977b[_0xa322('0x59')]['to'];return db[_0xa322('0x3e')][_0xa322('0x57')]({'where':{'id':_0x32977b['params']['id']},'include':[{'model':db[_0xa322('0xc2')],'as':'List','include':[{'model':db[_0xa322('0x76')],'as':'Contacts','where':{'mobile':_0x4f015f},'limit':0x1,'order':[[_0xa322('0x7b'),_0xa322('0x97')]]}]}]})[_0xa322('0x33')](handleEntityNotFound(_0x25782c,null))['then'](function(_0x3cd835){if(_0x3cd835&&_0x3cd835['List']){_0x3fd5ac=_0x3cd835[_0xa322('0x35')]({'plain':!![]});if(_0x3fd5ac[_0xa322('0xc3')]&&_0x3fd5ac[_0xa322('0xc3')][_0xa322('0x96')][_0xa322('0x56')]){return _0x3fd5ac[_0xa322('0xc3')][_0xa322('0x96')][0x0];}return db['CmContact']['create'](_[_0xa322('0x18')](_0x32977b['body'],{'firstName':_0x4f015f,'mobile':_0x4f015f,'phone':_0x4f015f,'ListId':_0x3fd5ac['ListId']}));}})[_0xa322('0x33')](handleEntityNotFound(_0x25782c,null))[_0xa322('0x33')](function(_0x41bdfc){if(_0x41bdfc){_0x4cd2d0=_0x41bdfc;return db['SmsInteraction']['find']({'where':{'ContactId':_0x4cd2d0['id'],'closed':![],'SmsAccountId':_0x3fd5ac['id']}})['then'](function(_0x41f753){if(_0x41f753){return[_0x41f753,![]];}return db['SmsInteraction']['create']({'UserId':_0x32977b[_0xa322('0x5a')]['id'],'ContactId':_0x4cd2d0['id'],'SmsAccountId':_0x3fd5ac['id'],'phone':_0x4f015f,'firstMsgDirection':_0xa322('0xc4'),'Messages':[_['merge'](_0x32977b['body'],{'read':![],'body':_0x32977b[_0xa322('0x59')][_0xa322('0x59')],'phone':_0x4f015f,'SmsAccountId':_0x3fd5ac['id'],'UserId':_0x32977b[_0xa322('0x5a')]['id'],'ContactId':_0x4cd2d0['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xa322('0xc5')}]})[_0xa322('0x33')](function(_0x3a0c60){return[_0x3a0c60,!![]];});});}})['spread'](function(_0xb639b5,_0x3232a1){if(_0x3232a1){return _0xb639b5;}return db[_0xa322('0xa3')][_0xa322('0x58')](_[_0xa322('0x4a')](_0x32977b[_0xa322('0x59')],{'read':![],'body':_0x32977b[_0xa322('0x59')][_0xa322('0x59')],'phone':_0x4f015f,'SmsAccountId':_0x3fd5ac['id'],'SmsInteractionId':_0xb639b5['id'],'UserId':_0x32977b[_0xa322('0x5a')]['id'],'ContactId':_0x4cd2d0['id']}))[_0xa322('0x33')](function(_0x273b21){_0xb639b5[_0xa322('0xc6')][_0xa322('0xc5')]=[];_0xb639b5['dataValues'][_0xa322('0xc5')][_0xa322('0x9f')](_0x273b21[_0xa322('0xc6')]);return _0xb639b5;});})[_0xa322('0x33')](respondWithResult(_0x25782c,null))['catch'](handleError(_0x25782c,null));};exports[_0xa322('0x2b')]=function(_0x2ef0cd,_0x819e91,_0x2970e4){if(_0x2ef0cd[_0xa322('0x59')]['id']){delete _0x2ef0cd[_0xa322('0x59')]['id'];}var _0x1c0949,_0x1f7bf1,_0x2ce69f;return db['SmsAccount']['find']({'where':{'id':_0x2ef0cd['params']['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x819e91,null))[_0xa322('0x33')](function(_0x526f69){if(_0x526f69){_0x2ce69f=_0x526f69;logger[_0xa322('0x22')](_0xa322('0x23'),_0xa322('0x2b'),'received\x20delivery\x20report\x20from',_0x526f69[_0xa322('0x4b')],util[_0xa322('0xc7')](_0x2ef0cd[_0xa322('0x59')],{'showHidden':![],'depth':null}));switch(_0x526f69[_0xa322('0x4b')]){case _0xa322('0xc8'):if(_0x2ef0cd[_0xa322('0x59')][_0xa322('0xc9')]&&_0x2ef0cd[_0xa322('0x59')][_0xa322('0x2b')]){_0x1f7bf1=_0x2ef0cd['body'][_0xa322('0x2b')];return db['SmsMessage']['find']({'where':{'messageId':_0x2ef0cd[_0xa322('0x59')][_0xa322('0xc9')]}});}break;case _0xa322('0x82'):if(_0x2ef0cd[_0xa322('0x59')][_0xa322('0xca')]&&_0x2ef0cd[_0xa322('0x59')][_0xa322('0xcb')]){_0x1f7bf1=_0x2ef0cd['body'][_0xa322('0xcb')];return db['SmsMessage'][_0xa322('0x57')]({'where':{'messageId':_0x2ef0cd[_0xa322('0x59')][_0xa322('0xca')]}});}break;case _0xa322('0x83'):if(_0x2ef0cd[_0xa322('0x59')][_0xa322('0x85')]&&_0x2ef0cd[_0xa322('0x59')][_0xa322('0xcc')]){_0x1f7bf1=_0x2ef0cd[_0xa322('0x59')][_0xa322('0xcc')];return db[_0xa322('0xa3')][_0xa322('0x57')]({'where':{'messageId':_0x2ef0cd[_0xa322('0x59')]['message_id']}});}break;case _0xa322('0x88'):var _0x4f4b2f=_0x2ef0cd[_0xa322('0x59')][_0xa322('0x89')][0x0];if(_0x4f4b2f[_0xa322('0x84')]&&_0x4f4b2f['status'][_0xa322('0xcd')]===_0xa322('0xce')){_0x1f7bf1=_0x4f4b2f[_0xa322('0x2b')][_0xa322('0xcd')];return db[_0xa322('0xa3')][_0xa322('0x57')]({'where':{'messageId':_0x4f4b2f['messageId']}});}break;case _0xa322('0x8d'):if(_0x2ef0cd[_0xa322('0x59')][_0xa322('0x84')]&&_0x2ef0cd['body'][_0xa322('0x2b')]){_0x1f7bf1=_0x2ef0cd['body'][_0xa322('0x2b')];return db[_0xa322('0xa3')]['find']({'where':{'messageId':_0x2ef0cd[_0xa322('0x59')][_0xa322('0x84')]}});}break;case _0xa322('0x8f'):if(_0x2ef0cd[_0xa322('0x59')][0x0][_0xa322('0x27')]['id']){_0x1f7bf1=_0x2ef0cd[_0xa322('0x59')][0x0]['type'];return db[_0xa322('0xa3')]['find']({'where':{'messageId':_0x2ef0cd[_0xa322('0x59')][0x0][_0xa322('0x27')]['id']}});}break;case _0xa322('0xcf'):if(_0x2ef0cd[_0xa322('0x59')][_0xa322('0xd0')]&&_0x2ef0cd[_0xa322('0x59')]['status']){_0x1f7bf1=_0x2ef0cd[_0xa322('0x59')][_0xa322('0x2b')];return db[_0xa322('0xa3')][_0xa322('0x57')]({'where':{'messageId':_0x2ef0cd[_0xa322('0x59')]['redif']}});}break;}}})[_0xa322('0x33')](handleEntityNotFound(_0x819e91,null))[_0xa322('0x33')](function(_0x14682b){if(_0x14682b){_0x1c0949=_0x14682b;switch(_0x2ce69f[_0xa322('0x4b')]){case _0xa322('0xc8'):if(_0x1f7bf1===_0xa322('0xce')){return _0x1c0949[_0xa322('0x5f')]({'read':!![]});}else{logger['error'](_0xa322('0x23'),'status',_0xa322('0xc8'),util[_0xa322('0xc7')](_0x2ef0cd[_0xa322('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa322('0x82'):if(_0x1f7bf1==='1'){return _0x1c0949[_0xa322('0x5f')]({'read':!![]});}else{logger[_0xa322('0x25')](_0xa322('0x23'),_0xa322('0x2b'),_0xa322('0xc8'),util[_0xa322('0xc7')](_0x2ef0cd[_0xa322('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa322('0x83'):if(!_0x2ef0cd[_0xa322('0x59')]['error_code']&&_0x1f7bf1>=0xc8&&_0x1f7bf1<=0xce){return _0x1c0949[_0xa322('0x5f')]({'read':!![]});}else{logger[_0xa322('0x25')](_0xa322('0x23'),'status',_0xa322('0x83'),util[_0xa322('0xc7')](_0x2ef0cd[_0xa322('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa322('0x88'):var _0x4e3672=_0x2ef0cd[_0xa322('0x59')]['results'][0x0];if(_0x4e3672[_0xa322('0x2b')][_0xa322('0xcd')]===_0xa322('0xce')){return _0x1c0949[_0xa322('0x5f')]({'read':!![]});}else{logger['error'](_0xa322('0x23'),'status',_0xa322('0x88'),util[_0xa322('0xc7')](_0x2ef0cd[_0xa322('0x59')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x1f7bf1==_0xa322('0xd1')||_0x1f7bf1==_0xa322('0xd2')){return _0x1c0949[_0xa322('0x5f')]({'read':!![]});}else{logger[_0xa322('0x25')](_0xa322('0x23'),_0xa322('0x2b'),_0xa322('0x8d'),util[_0xa322('0xc7')](_0x2ef0cd['body'],{'showHidden':![],'depth':null}));}break;case _0xa322('0x8f'):if(_0x1f7bf1==_0xa322('0xd3')){return _0x1c0949[_0xa322('0x5f')]({'read':!![]});}else{logger[_0xa322('0x25')](_0xa322('0x23'),'status',_0xa322('0x8f'),util[_0xa322('0xc7')](_0x2ef0cd[_0xa322('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa322('0xcf'):if(_0x1f7bf1===_0xa322('0xd4')||_0x1f7bf1===_0xa322('0xd5')){return _0x1c0949['update']({'read':!![]});}else{logger[_0xa322('0x25')](_0xa322('0x23'),'status',_0xa322('0xcf'),util[_0xa322('0xc7')](_0x2ef0cd[_0xa322('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1c0949;}})[_0xa322('0x33')](respondWithResult(_0x819e91,null))[_0xa322('0x29')](handleError(_0x819e91,null));};exports['statusGet']=function(_0x5445b0,_0x56b99b,_0x515997){var _0x571560,_0xb53f31,_0x3d344b;return db[_0xa322('0x3e')]['find']({'where':{'id':_0x5445b0[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x56b99b,null))['then'](function(_0x49a8c7){if(_0x49a8c7){_0x3d344b=_0x49a8c7;logger[_0xa322('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa322('0x2b'),_0xa322('0xd6'),_0x49a8c7[_0xa322('0x4b')],util[_0xa322('0xc7')](_0x5445b0[_0xa322('0x41')],{'showHidden':![],'depth':null}));switch(_0x49a8c7[_0xa322('0x4b')]){case _0xa322('0x8a'):if(_0x5445b0[_0xa322('0x41')]['message-id']&&_0x5445b0[_0xa322('0x41')][_0xa322('0xd7')]){_0xb53f31=_0x5445b0[_0xa322('0x41')][_0xa322('0xd7')];return db[_0xa322('0xa3')][_0xa322('0x57')]({'where':{'messageId':_0x5445b0[_0xa322('0x41')][_0xa322('0xd8')]}});}break;}}})[_0xa322('0x33')](handleEntityNotFound(_0x56b99b,null))['then'](function(_0x346ac8){if(_0x346ac8){_0x571560=_0x346ac8;switch(_0x3d344b[_0xa322('0x4b')]){case _0xa322('0x8a'):if(_0xb53f31==='2'||_0xb53f31==='6'){return _0x571560[_0xa322('0x5f')]({'read':!![]});}else{logger[_0xa322('0x25')](_0xa322('0x23'),_0xa322('0x2b'),_0xa322('0x8a'),util['inspect'](_0x5445b0['query'],{'showHidden':![],'depth':null}));};break;}return _0x571560;}})[_0xa322('0x33')](respondWithResult(_0x56b99b,null))[_0xa322('0x29')](handleError(_0x56b99b,null));};exports[_0xa322('0xd9')]=function(_0x2eb4c3,_0x487344,_0x229250){return db[_0xa322('0x3e')][_0xa322('0x57')]({'where':{'id':_0x2eb4c3[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x487344,null))[_0xa322('0x33')](function(_0x3cb0fc){if(_0x3cb0fc){return _0x3cb0fc[_0xa322('0xd9')](_0x2eb4c3[_0xa322('0x59')][_0xa322('0x6b')],_[_0xa322('0x99')](_0x2eb4c3[_0xa322('0x59')],[_0xa322('0x6b'),'id'])||{})[_0xa322('0x9c')](function(_0x2a8417){for(var _0x1fdc13=0x0;_0x1fdc13<_0x2eb4c3[_0xa322('0x59')][_0xa322('0x6b')][_0xa322('0x56')];_0x1fdc13+=0x1){socket['emit'](_0xa322('0xda'),{'UserId':Number(_0x2eb4c3[_0xa322('0x59')][_0xa322('0x6b')][_0x1fdc13]),'SmsAccountId':Number(_0x2eb4c3['params']['id'])});}return _0x2a8417;});}})[_0xa322('0x33')](respondWithResult(_0x487344,null))[_0xa322('0x29')](handleError(_0x487344,null));};exports[_0xa322('0xdb')]=function(_0x183293,_0x281a8f,_0x56ba9c){return db[_0xa322('0x3e')][_0xa322('0x57')]({'where':{'id':_0x183293[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x281a8f,null))[_0xa322('0x33')](function(_0x3c9916){if(_0x3c9916){return _0x3c9916[_0xa322('0xdb')](_0x183293['query'][_0xa322('0x6b')])[_0xa322('0x33')](function(){if(_[_0xa322('0xdc')](_0x183293['query'][_0xa322('0x6b')])){for(var _0x3596ec=0x0;_0x3596ec<_0x183293['query'][_0xa322('0x6b')][_0xa322('0x56')];_0x3596ec+=0x1){socket[_0xa322('0xdd')](_0xa322('0xde'),{'UserId':Number(_0x183293[_0xa322('0x41')][_0xa322('0x6b')][_0x3596ec]),'SmsAccountId':Number(_0x183293[_0xa322('0x54')]['id'])});}}else{socket['emit'](_0xa322('0xde'),{'UserId':Number(_0x183293['query'][_0xa322('0x6b')]),'SmsAccountId':Number(_0x183293['params']['id'])});}});}})['then'](respondWithStatusCode(_0x281a8f,null))[_0xa322('0x29')](handleError(_0x281a8f,null));};exports[_0xa322('0xdf')]=function(_0x56f891,_0x1b106a,_0x9ad06e){var _0x5da870={};var _0x3f292b={};var _0x4a9808;var _0x58f10b;return db['SmsAccount'][_0xa322('0x64')]({'where':{'id':_0x56f891[_0xa322('0x54')]['id']}})[_0xa322('0x33')](handleEntityNotFound(_0x1b106a,null))[_0xa322('0x33')](function(_0x39dfe0){if(_0x39dfe0){_0x4a9808=_0x39dfe0;_0x3f292b['model']=_[_0xa322('0x40')](db[_0xa322('0xa6')][_0xa322('0x65')]);_0x3f292b[_0xa322('0x41')]=_[_0xa322('0x40')](_0x56f891[_0xa322('0x41')]);_0x3f292b[_0xa322('0x48')]=_[_0xa322('0x44')](_0x3f292b['model'],_0x3f292b[_0xa322('0x41')]);_0x5da870['attributes']=_[_0xa322('0x44')](_0x3f292b[_0xa322('0x42')],qs[_0xa322('0x45')](_0x56f891[_0xa322('0x41')]['fields']));_0x5da870[_0xa322('0x43')]=_0x5da870[_0xa322('0x43')]['length']?_0x5da870[_0xa322('0x43')]:_0x3f292b['model'];_0x5da870[_0xa322('0xba')]=qs['sort'](_0x56f891['query'][_0xa322('0x68')]);_0x5da870[_0xa322('0x47')]=qs['filters'](_[_0xa322('0x49')](_0x56f891[_0xa322('0x41')],_0x3f292b[_0xa322('0x48')]));if(_0x56f891[_0xa322('0x41')]['filter']){_0x5da870['where']=_[_0xa322('0x4a')](_0x5da870['where'],{'$or':_[_0xa322('0x3d')](_0x5da870[_0xa322('0x43')],function(_0x1d5f2d){var _0x36c606={};_0x36c606[_0x1d5f2d]={'$like':'%'+_0x56f891[_0xa322('0x41')][_0xa322('0x4d')]+'%'};return _0x36c606;})});}_0x5da870=_[_0xa322('0x4a')]({},_0x5da870,_0x56f891[_0xa322('0x4e')]);return _0x4a9808[_0xa322('0xdf')](_0x5da870);}})[_0xa322('0x33')](function(_0xc88e86){if(_0xc88e86){_0x58f10b=_0xc88e86[_0xa322('0x56')];if(!_0x56f891[_0xa322('0x41')]['hasOwnProperty'](_0xa322('0x67'))){_0x5da870[_0xa322('0x46')]=qs[_0xa322('0x46')](_0x56f891[_0xa322('0x41')]['limit']);_0x5da870[_0xa322('0x2e')]=qs['offset'](_0x56f891['query'][_0xa322('0x2e')]);}return _0x4a9808[_0xa322('0xdf')](_0x5da870);}})[_0xa322('0x33')](function(_0x1bdb68){if(_0x1bdb68){return _0x1bdb68?{'count':_0x58f10b,'rows':_0x1bdb68}:null;}})[_0xa322('0x33')](respondWithResult(_0x1b106a,null))['catch'](handleError(_0x1b106a,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index c8b253f..ac7f510 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 _0x6eb4=['SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x111ec5,_0x162c53){var _0x164557=function(_0x453845){while(--_0x453845){_0x111ec5['push'](_0x111ec5['shift']());}};_0x164557(++_0x162c53);}(_0x6eb4,0x170));var _0x46eb=function(_0x2e7afe,_0x466497){_0x2e7afe=_0x2e7afe-0x0;var _0x1e8223=_0x6eb4[_0x2e7afe];return _0x1e8223;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x46eb('0x0'))['db'][_0x46eb('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x46eb('0x2')](0x0);var events={'afterCreate':_0x46eb('0x3'),'afterUpdate':'update','afterDestroy':_0x46eb('0x4')};function emitEvent(_0x14d0d3){return function(_0x2ccb04,_0x59a1cf,_0x1a836f){SmsAccountEvents[_0x46eb('0x5')](_0x14d0d3+':'+_0x2ccb04['id'],_0x2ccb04);SmsAccountEvents['emit'](_0x14d0d3,_0x2ccb04);_0x1a836f(null);};}for(var e in events){if(events[_0x46eb('0x6')](e)){var event=events[e];SmsAccount[_0x46eb('0x7')](e,emitEvent(event));}}module[_0x46eb('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x62b0=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x62b0,0x9e));var _0x062b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62b0[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x062b('0x0'));var SmsAccount=require(_0x062b('0x1'))['db'][_0x062b('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x062b('0x3')](0x0);var events={'afterCreate':_0x062b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1edf2b){return function(_0x4a5381,_0x1a2f66,_0x48b2ae){SmsAccountEvents[_0x062b('0x5')](_0x1edf2b+':'+_0x4a5381['id'],_0x4a5381);SmsAccountEvents[_0x062b('0x5')](_0x1edf2b,_0x4a5381);_0x48b2ae(null);};}for(var e in events){if(events[_0x062b('0x6')](e)){var event=events[e];SmsAccount[_0x062b('0x7')](e,emitEvent(event));}}module[_0x062b('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 0206752..53c2e9c 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 _0xc993=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0x2c8543,_0x2c2b3e){var _0x516ba2=function(_0x251bbb){while(--_0x251bbb){_0x2c8543['push'](_0x2c8543['shift']());}};_0x516ba2(++_0x2c2b3e);}(_0xc993,0x16d));var _0x3c99=function(_0x588839,_0x510f5f){_0x588839=_0x588839-0x0;var _0x1d3c62=_0xc993[_0x588839];return _0x1d3c62;};'use strict';var _=require(_0x3c99('0x0'));var util=require(_0x3c99('0x1'));var logger=require(_0x3c99('0x2'))(_0x3c99('0x3'));var moment=require(_0x3c99('0x4'));var BPromise=require(_0x3c99('0x5'));var rp=require(_0x3c99('0x6'));var fs=require('fs');var path=require(_0x3c99('0x7'));var rimraf=require(_0x3c99('0x8'));var config=require(_0x3c99('0x9'));var attributes=require(_0x3c99('0xa'));module[_0x3c99('0xb')]=function(_0x29fe38,_0x565182){return _0x29fe38[_0x3c99('0xc')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbc2=['path','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','api','bluebird','request-promise'];(function(_0x44e7b6,_0x227953){var _0x325047=function(_0x5ccc8a){while(--_0x5ccc8a){_0x44e7b6['push'](_0x44e7b6['shift']());}};_0x325047(++_0x227953);}(_0xfbc2,0x125));var _0x2fbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbc2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2fbc('0x0'));var logger=require('../../config/logger')(_0x2fbc('0x1'));var moment=require('moment');var BPromise=require(_0x2fbc('0x2'));var rp=require(_0x2fbc('0x3'));var fs=require('fs');var path=require(_0x2fbc('0x4'));var rimraf=require('rimraf');var config=require(_0x2fbc('0x5'));var attributes=require(_0x2fbc('0x6'));module[_0x2fbc('0x7')]=function(_0x475178,_0x1fab0e){return _0x475178[_0x2fbc('0x8')](_0x2fbc('0x9'),attributes,{'tableName':_0x2fbc('0xa'),'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 258f5e7..4a29604 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 _0x1610=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSmsAccount','SmsAccount','options','where','attributes','include','map','model','stringify','lodash','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1610,0x6d));var _0x0161=function(_0x16af09,_0x123df1){_0x16af09=_0x16af09-0x0;var _0x549013=_0x1610[_0x16af09];return _0x549013;};'use strict';var _=require(_0x0161('0x0'));var util=require(_0x0161('0x1'));var moment=require(_0x0161('0x2'));var BPromise=require(_0x0161('0x3'));var rs=require(_0x0161('0x4'));var fs=require('fs');var Redis=require(_0x0161('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0161('0x6'));var logger=require('../../config/logger')(_0x0161('0x7'));var config=require(_0x0161('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0161('0x9')][_0x0161('0xa')]({'port':0x232a});config[_0x0161('0xb')]=_[_0x0161('0xc')](config[_0x0161('0xb')],{'host':_0x0161('0xd'),'port':0x18eb});var socket=require(_0x0161('0xe'))(new Redis(config[_0x0161('0xb')]));require(_0x0161('0xf'))[_0x0161('0x10')](socket);function respondWithRpcPromise(_0x33591e,_0x2a57a5,_0x474612){return new BPromise(function(_0x4a21bb,_0x53c638){return client[_0x0161('0x11')](_0x33591e,_0x474612)[_0x0161('0x12')](function(_0x5b7c19){logger[_0x0161('0x13')](_0x0161('0x14'),_0x2a57a5,_0x0161('0x15'));logger[_0x0161('0x16')](_0x0161('0x17'),_0x2a57a5,_0x0161('0x15'),JSON['stringify'](_0x5b7c19));if(_0x5b7c19[_0x0161('0x18')]){if(_0x5b7c19[_0x0161('0x18')][_0x0161('0x19')]===0x1f4){logger['error'](_0x0161('0x14'),_0x2a57a5,_0x5b7c19[_0x0161('0x18')][_0x0161('0x1a')]);return _0x53c638(_0x5b7c19['error'][_0x0161('0x1a')]);}logger[_0x0161('0x18')](_0x0161('0x14'),_0x2a57a5,_0x5b7c19['error']['message']);return _0x4a21bb(_0x5b7c19[_0x0161('0x18')][_0x0161('0x1a')]);}else{logger[_0x0161('0x13')](_0x0161('0x14'),_0x2a57a5,_0x0161('0x15'));_0x4a21bb(_0x5b7c19[_0x0161('0x1b')][_0x0161('0x1a')]);}})['catch'](function(_0x79e330){logger[_0x0161('0x18')]('SmsAccount,\x20%s,\x20%s',_0x2a57a5,_0x79e330);_0x53c638(_0x79e330);});});}exports[_0x0161('0x1c')]=function(_0x3e4182){var _0x1595a3=this;return new Promise(function(_0x44d545,_0x5a0d70){return db[_0x0161('0x1d')]['find']({'raw':_0x3e4182[_0x0161('0x1e')]?_0x3e4182[_0x0161('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3e4182[_0x0161('0x1e')]?_0x3e4182[_0x0161('0x1e')][_0x0161('0x1f')]||null:null,'attributes':_0x3e4182[_0x0161('0x1e')]?_0x3e4182[_0x0161('0x1e')][_0x0161('0x20')]||null:null,'include':_0x3e4182[_0x0161('0x1e')]?_0x3e4182[_0x0161('0x1e')][_0x0161('0x21')]?_[_0x0161('0x22')](_0x3e4182[_0x0161('0x1e')][_0x0161('0x21')],function(_0x4f5b95){return{'model':db[_0x4f5b95['model']],'as':_0x4f5b95['as'],'attributes':_0x4f5b95[_0x0161('0x20')],'include':_0x4f5b95[_0x0161('0x21')]?_[_0x0161('0x22')](_0x4f5b95[_0x0161('0x21')],function(_0x431e88){return{'model':db[_0x431e88['model']],'as':_0x431e88['as'],'attributes':_0x431e88[_0x0161('0x20')],'include':_0x431e88[_0x0161('0x21')]?_[_0x0161('0x22')](_0x431e88[_0x0161('0x21')],function(_0x466012){return{'model':db[_0x466012[_0x0161('0x23')]],'as':_0x466012['as'],'attributes':_0x466012[_0x0161('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0161('0x12')](function(_0x29b45f){logger[_0x0161('0x13')](_0x0161('0x1c'),_0x3e4182);logger[_0x0161('0x16')]('ShowSmsAccount',_0x3e4182,JSON[_0x0161('0x24')](_0x29b45f));_0x44d545(_0x29b45f);})['catch'](function(_0x17218e){logger[_0x0161('0x18')]('ShowSmsAccount',_0x17218e[_0x0161('0x1a')],_0x3e4182);_0x5a0d70(_0x1595a3[_0x0161('0x18')](0x1f4,_0x17218e['message']));});});}; \ No newline at end of file +var _0x6e13=['result','catch','find','where','options','map','include','model','attributes','then','ShowSmsAccount','lodash','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3732cf,_0x1277c1){var _0x4a51d2=function(_0x74e47b){while(--_0x74e47b){_0x3732cf['push'](_0x3732cf['shift']());}};_0x4a51d2(++_0x1277c1);}(_0x6e13,0x17f));var _0x36e1=function(_0x4bc9ec,_0x418142){_0x4bc9ec=_0x4bc9ec-0x0;var _0x2404db=_0x6e13[_0x4bc9ec];return _0x2404db;};'use strict';var _=require(_0x36e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36e1('0x1'));var db=require(_0x36e1('0x2'))['db'];var utils=require(_0x36e1('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x36e1('0x4'));var client=jayson['client'][_0x36e1('0x5')]({'port':0x232a});config[_0x36e1('0x6')]=_['defaults'](config[_0x36e1('0x6')],{'host':_0x36e1('0x7'),'port':0x18eb});var socket=require(_0x36e1('0x8'))(new Redis(config[_0x36e1('0x6')]));require('./smsAccount.socket')[_0x36e1('0x9')](socket);function respondWithRpcPromise(_0x2e6668,_0xe25552,_0x467a2b){return new BPromise(function(_0x208b77,_0x342e44){return client[_0x36e1('0xa')](_0x2e6668,_0x467a2b)['then'](function(_0x585d6e){logger['info'](_0x36e1('0xb'),_0xe25552,_0x36e1('0xc'));logger[_0x36e1('0xd')](_0x36e1('0xe'),_0xe25552,'request\x20sent',JSON[_0x36e1('0xf')](_0x585d6e));if(_0x585d6e[_0x36e1('0x10')]){if(_0x585d6e[_0x36e1('0x10')][_0x36e1('0x11')]===0x1f4){logger['error'](_0x36e1('0xb'),_0xe25552,_0x585d6e[_0x36e1('0x10')][_0x36e1('0x12')]);return _0x342e44(_0x585d6e['error']['message']);}logger[_0x36e1('0x10')](_0x36e1('0xb'),_0xe25552,_0x585d6e[_0x36e1('0x10')][_0x36e1('0x12')]);return _0x208b77(_0x585d6e[_0x36e1('0x10')][_0x36e1('0x12')]);}else{logger[_0x36e1('0x13')](_0x36e1('0xb'),_0xe25552,_0x36e1('0xc'));_0x208b77(_0x585d6e[_0x36e1('0x14')][_0x36e1('0x12')]);}})[_0x36e1('0x15')](function(_0x2db4c1){logger[_0x36e1('0x10')](_0x36e1('0xb'),_0xe25552,_0x2db4c1);_0x342e44(_0x2db4c1);});});}exports['ShowSmsAccount']=function(_0x30d833){var _0x600ef4=this;return new Promise(function(_0x2f43d9,_0x3f3524){return db['SmsAccount'][_0x36e1('0x16')]({'raw':_0x30d833['options']?_0x30d833['options']['raw']===undefined?!![]:![]:!![],'where':_0x30d833['options']?_0x30d833['options'][_0x36e1('0x17')]||null:null,'attributes':_0x30d833[_0x36e1('0x18')]?_0x30d833[_0x36e1('0x18')]['attributes']||null:null,'include':_0x30d833[_0x36e1('0x18')]?_0x30d833[_0x36e1('0x18')]['include']?_[_0x36e1('0x19')](_0x30d833[_0x36e1('0x18')][_0x36e1('0x1a')],function(_0x31b8db){return{'model':db[_0x31b8db[_0x36e1('0x1b')]],'as':_0x31b8db['as'],'attributes':_0x31b8db[_0x36e1('0x1c')],'include':_0x31b8db[_0x36e1('0x1a')]?_['map'](_0x31b8db[_0x36e1('0x1a')],function(_0x56335c){return{'model':db[_0x56335c[_0x36e1('0x1b')]],'as':_0x56335c['as'],'attributes':_0x56335c[_0x36e1('0x1c')],'include':_0x56335c['include']?_['map'](_0x56335c[_0x36e1('0x1a')],function(_0x276a85){return{'model':db[_0x276a85[_0x36e1('0x1b')]],'as':_0x276a85['as'],'attributes':_0x276a85[_0x36e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x36e1('0x1d')](function(_0x2ee833){logger['info']('ShowSmsAccount',_0x30d833);logger[_0x36e1('0xd')](_0x36e1('0x1e'),_0x30d833,JSON[_0x36e1('0xf')](_0x2ee833));_0x2f43d9(_0x2ee833);})[_0x36e1('0x15')](function(_0x210ad5){logger['error']('ShowSmsAccount',_0x210ad5[_0x36e1('0x12')],_0x30d833);_0x3f3524(_0x600ef4[_0x36e1('0x10')](0x1f4,_0x210ad5[_0x36e1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 3ffca8f..149cd1f 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 6464f70..24baba1 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x9cf14e,_0x57d04f){var _0x14877a=function(_0x35e94f){while(--_0x35e94f){_0x9cf14e['push'](_0x9cf14e['shift']());}};_0x14877a(++_0x57d04f);}(_0x34e8,0x12c));var _0x834e=function(_0x125485,_0x48fa5d){_0x125485=_0x125485-0x0;var _0x1dff38=_0x34e8[_0x125485];return _0x1dff38;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x550e1a,_0x319eb8){var _0x1aafbf=function(_0x4af1b4){while(--_0x4af1b4){_0x550e1a['push'](_0x550e1a['shift']());}};_0x1aafbf(++_0x319eb8);}(_0xedd9,0xfc));var _0x9edd=function(_0x5d26ba,_0x2fcf4c){_0x5d26ba=_0x5d26ba-0x0;var _0x324fe0=_0xedd9[_0x5d26ba];return _0x324fe0;};'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('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 9065df1..912bcbc 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 _0x3b1f=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x180881,_0x50bac9){var _0x5db664=function(_0x3d10c4){while(--_0x3d10c4){_0x180881['push'](_0x180881['shift']());}};_0x5db664(++_0x50bac9);}(_0x3b1f,0x94));var _0xf3b1=function(_0x220b9e,_0x44d7c4){_0x220b9e=_0x220b9e-0x0;var _0x3ab445=_0x3b1f[_0x220b9e];return _0x3ab445;};'use strict';var Sequelize=require(_0xf3b1('0x0'));module[_0xf3b1('0x1')]={'priority':{'type':Sequelize[_0xf3b1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf3b1('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf3b1('0x4')]},'interval':{'type':Sequelize[_0xf3b1('0x4')],'defaultValue':_0xf3b1('0x5')}}; \ No newline at end of file +var _0xa5d5=['STRING','TEXT','sequelize','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xa5d5,0x1a6));var _0x5a5d=function(_0x4b145f,_0x28d3e6){_0x4b145f=_0x4b145f-0x0;var _0x41f02c=_0xa5d5[_0x4b145f];return _0x41f02c;};'use strict';var Sequelize=require(_0x5a5d('0x0'));module[_0x5a5d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5a5d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5a5d('0x3')]()},'description':{'type':Sequelize[_0x5a5d('0x2')]},'interval':{'type':Sequelize[_0x5a5d('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 99e210b..764dd22 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 _0x2b23=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','error','name','send','map','SmsApplication','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','then','include','findAll','rows','show','params','length','includeAll','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse'];(function(_0x49a3bc,_0x75f567){var _0x26c84c=function(_0xfbb285){while(--_0xfbb285){_0x49a3bc['push'](_0x49a3bc['shift']());}};_0x26c84c(++_0x75f567);}(_0x2b23,0x107));var _0x32b2=function(_0x54c193,_0x730bf){_0x54c193=_0x54c193-0x0;var _0x159dc2=_0x2b23[_0x54c193];return _0x159dc2;};'use strict';var emlformat=require(_0x32b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32b2('0x1'));var jsonpatch=require(_0x32b2('0x2'));var rp=require(_0x32b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x32b2('0x4'));var util=require('util');var path=require(_0x32b2('0x5'));var sox=require(_0x32b2('0x6'));var csv=require(_0x32b2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32b2('0x8'));var _=require('lodash');var squel=require(_0x32b2('0x9'));var crypto=require('crypto');var jsforce=require(_0x32b2('0xa'));var deskjs=require(_0x32b2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x32b2('0xc'));var Redis=require(_0x32b2('0xd'));var authService=require(_0x32b2('0xe'));var qs=require(_0x32b2('0xf'));var as=require(_0x32b2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32b2('0x11'))(_0x32b2('0x12'));var utils=require('../../config/utils');var config=require(_0x32b2('0x13'));var licenseUtil=require(_0x32b2('0x14'));var db=require(_0x32b2('0x15'))['db'];function respondWithStatusCode(_0xf06f58,_0x214b84){_0x214b84=_0x214b84||0xcc;return function(_0x18b04c){if(_0x18b04c){return _0xf06f58[_0x32b2('0x16')](_0x214b84);}return _0xf06f58[_0x32b2('0x17')](_0x214b84)[_0x32b2('0x18')]();};}function respondWithResult(_0x18be2a,_0x45251d){_0x45251d=_0x45251d||0xc8;return function(_0x4eabfd){if(_0x4eabfd){return _0x18be2a['status'](_0x45251d)[_0x32b2('0x19')](_0x4eabfd);}};}function respondWithFilteredResult(_0x1dd8be,_0x4db61e){return function(_0x26bf4e){if(_0x26bf4e){var _0x47c109=typeof _0x4db61e[_0x32b2('0x1a')]===_0x32b2('0x1b')&&typeof _0x4db61e[_0x32b2('0x1c')]===_0x32b2('0x1b');var _0x44771c=_0x26bf4e[_0x32b2('0x1d')];var _0x5e9d96=_0x47c109?0x0:_0x4db61e[_0x32b2('0x1a')];var _0x159f97=_0x47c109?_0x26bf4e[_0x32b2('0x1d')]:_0x4db61e[_0x32b2('0x1a')]+_0x4db61e[_0x32b2('0x1c')];var _0x2deebc;if(_0x159f97>=_0x44771c){_0x159f97=_0x44771c;_0x2deebc=0xc8;}else{_0x2deebc=0xce;}_0x1dd8be[_0x32b2('0x17')](_0x2deebc);return _0x1dd8be[_0x32b2('0x1e')](_0x32b2('0x1f'),_0x5e9d96+'-'+_0x159f97+'/'+_0x44771c)[_0x32b2('0x19')](_0x26bf4e);}return null;};}function patchUpdates(_0x3e19cf){return function(_0x4d9d03){try{jsonpatch['apply'](_0x4d9d03,_0x3e19cf,!![]);}catch(_0x2fa3ce){return BPromise[_0x32b2('0x20')](_0x2fa3ce);}return _0x4d9d03['save']();};}function saveUpdates(_0x363c20,_0x558b99){return function(_0x59b6f1){if(_0x59b6f1){return _0x59b6f1[_0x32b2('0x21')](_0x363c20)['then'](function(_0x4d5bb4){return _0x4d5bb4;});}return null;};}function removeEntity(_0x937d7d,_0x3a1e75){return function(_0x4154e7){if(_0x4154e7){return _0x4154e7[_0x32b2('0x22')]()['then'](function(){_0x937d7d['status'](0xcc)[_0x32b2('0x18')]();});}};}function handleEntityNotFound(_0x1f68a7,_0x4f456f){return function(_0x4d439a){if(!_0x4d439a){_0x1f68a7['sendStatus'](0x194);}return _0x4d439a;};}function handleError(_0x2d277c,_0x23754c){_0x23754c=_0x23754c||0x1f4;return function(_0x34f92e){logger[_0x32b2('0x23')](_0x34f92e['stack']);if(_0x34f92e[_0x32b2('0x24')]){delete _0x34f92e[_0x32b2('0x24')];}_0x2d277c[_0x32b2('0x17')](_0x23754c)[_0x32b2('0x25')](_0x34f92e);};}exports['index']=function(_0x3d07ab,_0x87d22b){var _0x419ea3={},_0x1cb94c={},_0x32fd12={'count':0x0,'rows':[]};var _0x1ce343=_[_0x32b2('0x26')](db[_0x32b2('0x27')]['rawAttributes'],function(_0x310c94){return{'name':_0x310c94[_0x32b2('0x28')],'type':_0x310c94[_0x32b2('0x29')]['key']};});_0x1cb94c[_0x32b2('0x2a')]=_[_0x32b2('0x26')](_0x1ce343,'name');_0x1cb94c['query']=_[_0x32b2('0x2b')](_0x3d07ab[_0x32b2('0x2c')]);_0x1cb94c['filters']=_[_0x32b2('0x2d')](_0x1cb94c['model'],_0x1cb94c[_0x32b2('0x2c')]);_0x419ea3[_0x32b2('0x2e')]=_[_0x32b2('0x2d')](_0x1cb94c[_0x32b2('0x2a')],qs['fields'](_0x3d07ab[_0x32b2('0x2c')][_0x32b2('0x2f')]));_0x419ea3[_0x32b2('0x2e')]=_0x419ea3['attributes']['length']?_0x419ea3[_0x32b2('0x2e')]:_0x1cb94c[_0x32b2('0x2a')];if(!_0x3d07ab[_0x32b2('0x2c')][_0x32b2('0x30')]('nolimit')){_0x419ea3[_0x32b2('0x1c')]=qs[_0x32b2('0x1c')](_0x3d07ab[_0x32b2('0x2c')][_0x32b2('0x1c')]);_0x419ea3['offset']=qs['offset'](_0x3d07ab[_0x32b2('0x2c')][_0x32b2('0x1a')]);}_0x419ea3[_0x32b2('0x31')]=qs['sort'](_0x3d07ab[_0x32b2('0x2c')][_0x32b2('0x32')]);_0x419ea3[_0x32b2('0x33')]=qs[_0x32b2('0x34')](_['pick'](_0x3d07ab[_0x32b2('0x2c')],_0x1cb94c[_0x32b2('0x34')]),_0x1ce343);if(_0x3d07ab['query'][_0x32b2('0x35')]){_0x419ea3[_0x32b2('0x33')]=_[_0x32b2('0x36')](_0x419ea3[_0x32b2('0x33')],{'$or':_[_0x32b2('0x26')](_0x1ce343,function(_0x49e778){if(_0x49e778['type']!==_0x32b2('0x37')){var _0x178f3a={};_0x178f3a[_0x49e778[_0x32b2('0x24')]]={'$like':'%'+_0x3d07ab[_0x32b2('0x2c')][_0x32b2('0x35')]+'%'};return _0x178f3a;}})});}_0x419ea3=_['merge']({},_0x419ea3,_0x3d07ab['options']);var _0x1b971c={'where':_0x419ea3[_0x32b2('0x33')]};return db[_0x32b2('0x27')]['count'](_0x1b971c)[_0x32b2('0x38')](function(_0x193ecd){_0x32fd12[_0x32b2('0x1d')]=_0x193ecd;if(_0x3d07ab[_0x32b2('0x2c')]['includeAll']){_0x419ea3[_0x32b2('0x39')]=[{'all':!![]}];}return db['SmsApplication'][_0x32b2('0x3a')](_0x419ea3);})[_0x32b2('0x38')](function(_0x20c051){_0x32fd12[_0x32b2('0x3b')]=_0x20c051;return _0x32fd12;})['then'](respondWithFilteredResult(_0x87d22b,_0x419ea3))['catch'](handleError(_0x87d22b,null));};exports[_0x32b2('0x3c')]=function(_0x44eeba,_0x332ec5){var _0x2bca75={'raw':!![],'where':{'id':_0x44eeba[_0x32b2('0x3d')]['id']}},_0x3ba861={};_0x3ba861[_0x32b2('0x2a')]=_[_0x32b2('0x2b')](db[_0x32b2('0x27')]['rawAttributes']);_0x3ba861[_0x32b2('0x2c')]=_['keys'](_0x44eeba[_0x32b2('0x2c')]);_0x3ba861[_0x32b2('0x34')]=_[_0x32b2('0x2d')](_0x3ba861['model'],_0x3ba861[_0x32b2('0x2c')]);_0x2bca75[_0x32b2('0x2e')]=_[_0x32b2('0x2d')](_0x3ba861[_0x32b2('0x2a')],qs[_0x32b2('0x2f')](_0x44eeba[_0x32b2('0x2c')][_0x32b2('0x2f')]));_0x2bca75['attributes']=_0x2bca75['attributes'][_0x32b2('0x3e')]?_0x2bca75[_0x32b2('0x2e')]:_0x3ba861['model'];if(_0x44eeba[_0x32b2('0x2c')][_0x32b2('0x3f')]){_0x2bca75['include']=[{'all':!![]}];}_0x2bca75=_['merge']({},_0x2bca75,_0x44eeba[_0x32b2('0x40')]);return db[_0x32b2('0x27')][_0x32b2('0x41')](_0x2bca75)[_0x32b2('0x38')](handleEntityNotFound(_0x332ec5,null))[_0x32b2('0x38')](respondWithResult(_0x332ec5,null))[_0x32b2('0x42')](handleError(_0x332ec5,null));};exports[_0x32b2('0x43')]=function(_0x528963,_0x392819){return db[_0x32b2('0x27')][_0x32b2('0x43')](_0x528963[_0x32b2('0x44')],{})[_0x32b2('0x38')](respondWithResult(_0x392819,0xc9))[_0x32b2('0x42')](handleError(_0x392819,null));};exports[_0x32b2('0x21')]=function(_0x74a9d2,_0x3a515f){if(_0x74a9d2[_0x32b2('0x44')]['id']){delete _0x74a9d2[_0x32b2('0x44')]['id'];}return db[_0x32b2('0x27')][_0x32b2('0x41')]({'where':{'id':_0x74a9d2[_0x32b2('0x3d')]['id']}})[_0x32b2('0x38')](handleEntityNotFound(_0x3a515f,null))[_0x32b2('0x38')](saveUpdates(_0x74a9d2['body'],null))[_0x32b2('0x38')](respondWithResult(_0x3a515f,null))[_0x32b2('0x42')](handleError(_0x3a515f,null));};exports['destroy']=function(_0x266ae0,_0x2aa2cc){return db[_0x32b2('0x27')][_0x32b2('0x41')]({'where':{'id':_0x266ae0[_0x32b2('0x3d')]['id']}})[_0x32b2('0x38')](handleEntityNotFound(_0x2aa2cc,null))[_0x32b2('0x38')](removeEntity(_0x2aa2cc,null))[_0x32b2('0x42')](handleError(_0x2aa2cc,null));}; \ No newline at end of file +var _0x6122=['keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','SmsApplication','includeAll','include','findAll','rows','catch','show','model','fields','create','body','params','find','eml-format','moment','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','query'];(function(_0x37b549,_0x4b33bb){var _0x5d34eb=function(_0x594d99){while(--_0x594d99){_0x37b549['push'](_0x37b549['shift']());}};_0x5d34eb(++_0x4b33bb);}(_0x6122,0x1b2));var _0x2612=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x6122[_0x258b93];return _0x35484b;};'use strict';var emlformat=require(_0x2612('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2612('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2612('0x2'));var sox=require(_0x2612('0x3'));var csv=require('to-csv');var ejs=require(_0x2612('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2612('0x5'));var squel=require(_0x2612('0x6'));var crypto=require(_0x2612('0x7'));var jsforce=require(_0x2612('0x8'));var deskjs=require(_0x2612('0x9'));var toCsv=require(_0x2612('0xa'));var querystring=require('querystring');var Papa=require(_0x2612('0xb'));var Redis=require(_0x2612('0xc'));var authService=require(_0x2612('0xd'));var qs=require(_0x2612('0xe'));var as=require(_0x2612('0xf'));var hardwareService=require(_0x2612('0x10'));var logger=require(_0x2612('0x11'))('api');var utils=require(_0x2612('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2612('0x13'))['db'];function respondWithStatusCode(_0x33427d,_0x9fce0c){_0x9fce0c=_0x9fce0c||0xcc;return function(_0x3d219e){if(_0x3d219e){return _0x33427d[_0x2612('0x14')](_0x9fce0c);}return _0x33427d[_0x2612('0x15')](_0x9fce0c)['end']();};}function respondWithResult(_0x24523d,_0x435d77){_0x435d77=_0x435d77||0xc8;return function(_0x19007a){if(_0x19007a){return _0x24523d[_0x2612('0x15')](_0x435d77)[_0x2612('0x16')](_0x19007a);}};}function respondWithFilteredResult(_0x5007d7,_0x43dd6c){return function(_0x1e0039){if(_0x1e0039){var _0x3029dd=typeof _0x43dd6c['offset']===_0x2612('0x17')&&typeof _0x43dd6c[_0x2612('0x18')]===_0x2612('0x17');var _0x3e3794=_0x1e0039[_0x2612('0x19')];var _0x1bc2e4=_0x3029dd?0x0:_0x43dd6c[_0x2612('0x1a')];var _0x5dc676=_0x3029dd?_0x1e0039[_0x2612('0x19')]:_0x43dd6c['offset']+_0x43dd6c[_0x2612('0x18')];var _0xb7b5d8;if(_0x5dc676>=_0x3e3794){_0x5dc676=_0x3e3794;_0xb7b5d8=0xc8;}else{_0xb7b5d8=0xce;}_0x5007d7['status'](_0xb7b5d8);return _0x5007d7[_0x2612('0x1b')](_0x2612('0x1c'),_0x1bc2e4+'-'+_0x5dc676+'/'+_0x3e3794)['json'](_0x1e0039);}return null;};}function patchUpdates(_0x13afe1){return function(_0x5c9a28){try{jsonpatch['apply'](_0x5c9a28,_0x13afe1,!![]);}catch(_0x3c8a0f){return BPromise['reject'](_0x3c8a0f);}return _0x5c9a28[_0x2612('0x1d')]();};}function saveUpdates(_0xdc9ae7,_0xf8f7d4){return function(_0x17bd67){if(_0x17bd67){return _0x17bd67[_0x2612('0x1e')](_0xdc9ae7)[_0x2612('0x1f')](function(_0x37fbbb){return _0x37fbbb;});}return null;};}function removeEntity(_0x5b01b2,_0x2effdd){return function(_0x7d6ff9){if(_0x7d6ff9){return _0x7d6ff9[_0x2612('0x20')]()[_0x2612('0x1f')](function(){_0x5b01b2['status'](0xcc)[_0x2612('0x21')]();});}};}function handleEntityNotFound(_0x1c9074,_0x59e4a3){return function(_0x5d5f27){if(!_0x5d5f27){_0x1c9074[_0x2612('0x14')](0x194);}return _0x5d5f27;};}function handleError(_0x412203,_0x3218e5){_0x3218e5=_0x3218e5||0x1f4;return function(_0x41cb14){logger[_0x2612('0x22')](_0x41cb14[_0x2612('0x23')]);if(_0x41cb14[_0x2612('0x24')]){delete _0x41cb14[_0x2612('0x24')];}_0x412203['status'](_0x3218e5)['send'](_0x41cb14);};}exports['index']=function(_0x499280,_0x4b4c3a){var _0xfa0824={},_0x130dba={},_0x28d0d9={'count':0x0,'rows':[]};var _0x3ebd22=_[_0x2612('0x25')](db['SmsApplication'][_0x2612('0x26')],function(_0xf076bb){return{'name':_0xf076bb[_0x2612('0x27')],'type':_0xf076bb['type'][_0x2612('0x28')]};});_0x130dba['model']=_['map'](_0x3ebd22,_0x2612('0x24'));_0x130dba[_0x2612('0x29')]=_[_0x2612('0x2a')](_0x499280[_0x2612('0x29')]);_0x130dba[_0x2612('0x2b')]=_[_0x2612('0x2c')](_0x130dba['model'],_0x130dba[_0x2612('0x29')]);_0xfa0824[_0x2612('0x2d')]=_[_0x2612('0x2c')](_0x130dba['model'],qs['fields'](_0x499280['query']['fields']));_0xfa0824[_0x2612('0x2d')]=_0xfa0824[_0x2612('0x2d')]['length']?_0xfa0824[_0x2612('0x2d')]:_0x130dba['model'];if(!_0x499280[_0x2612('0x29')][_0x2612('0x2e')](_0x2612('0x2f'))){_0xfa0824[_0x2612('0x18')]=qs[_0x2612('0x18')](_0x499280['query'][_0x2612('0x18')]);_0xfa0824[_0x2612('0x1a')]=qs[_0x2612('0x1a')](_0x499280[_0x2612('0x29')][_0x2612('0x1a')]);}_0xfa0824[_0x2612('0x30')]=qs[_0x2612('0x31')](_0x499280[_0x2612('0x29')][_0x2612('0x31')]);_0xfa0824[_0x2612('0x32')]=qs['filters'](_[_0x2612('0x33')](_0x499280[_0x2612('0x29')],_0x130dba['filters']),_0x3ebd22);if(_0x499280[_0x2612('0x29')]['filter']){_0xfa0824[_0x2612('0x32')]=_[_0x2612('0x34')](_0xfa0824['where'],{'$or':_[_0x2612('0x25')](_0x3ebd22,function(_0x4fd2e7){if(_0x4fd2e7[_0x2612('0x35')]!=='VIRTUAL'){var _0x12a294={};_0x12a294[_0x4fd2e7[_0x2612('0x24')]]={'$like':'%'+_0x499280[_0x2612('0x29')]['filter']+'%'};return _0x12a294;}})});}_0xfa0824=_[_0x2612('0x34')]({},_0xfa0824,_0x499280[_0x2612('0x36')]);var _0x47b5b8={'where':_0xfa0824[_0x2612('0x32')]};return db[_0x2612('0x37')][_0x2612('0x19')](_0x47b5b8)[_0x2612('0x1f')](function(_0x572599){_0x28d0d9[_0x2612('0x19')]=_0x572599;if(_0x499280['query'][_0x2612('0x38')]){_0xfa0824[_0x2612('0x39')]=[{'all':!![]}];}return db[_0x2612('0x37')][_0x2612('0x3a')](_0xfa0824);})[_0x2612('0x1f')](function(_0x1789eb){_0x28d0d9[_0x2612('0x3b')]=_0x1789eb;return _0x28d0d9;})[_0x2612('0x1f')](respondWithFilteredResult(_0x4b4c3a,_0xfa0824))[_0x2612('0x3c')](handleError(_0x4b4c3a,null));};exports[_0x2612('0x3d')]=function(_0x3611a9,_0x2b12ac){var _0xdf59bf={'raw':!![],'where':{'id':_0x3611a9['params']['id']}},_0x32c677={};_0x32c677[_0x2612('0x3e')]=_[_0x2612('0x2a')](db[_0x2612('0x37')][_0x2612('0x26')]);_0x32c677['query']=_['keys'](_0x3611a9[_0x2612('0x29')]);_0x32c677['filters']=_[_0x2612('0x2c')](_0x32c677['model'],_0x32c677['query']);_0xdf59bf[_0x2612('0x2d')]=_[_0x2612('0x2c')](_0x32c677[_0x2612('0x3e')],qs[_0x2612('0x3f')](_0x3611a9['query'][_0x2612('0x3f')]));_0xdf59bf['attributes']=_0xdf59bf['attributes']['length']?_0xdf59bf[_0x2612('0x2d')]:_0x32c677['model'];if(_0x3611a9[_0x2612('0x29')][_0x2612('0x38')]){_0xdf59bf[_0x2612('0x39')]=[{'all':!![]}];}_0xdf59bf=_[_0x2612('0x34')]({},_0xdf59bf,_0x3611a9[_0x2612('0x36')]);return db['SmsApplication']['find'](_0xdf59bf)[_0x2612('0x1f')](handleEntityNotFound(_0x2b12ac,null))[_0x2612('0x1f')](respondWithResult(_0x2b12ac,null))[_0x2612('0x3c')](handleError(_0x2b12ac,null));};exports[_0x2612('0x40')]=function(_0x5d47f0,_0x19f73a){return db['SmsApplication'][_0x2612('0x40')](_0x5d47f0[_0x2612('0x41')],{})[_0x2612('0x1f')](respondWithResult(_0x19f73a,0xc9))[_0x2612('0x3c')](handleError(_0x19f73a,null));};exports['update']=function(_0x4afbaf,_0x5435a2){if(_0x4afbaf['body']['id']){delete _0x4afbaf[_0x2612('0x41')]['id'];}return db[_0x2612('0x37')]['find']({'where':{'id':_0x4afbaf[_0x2612('0x42')]['id']}})['then'](handleEntityNotFound(_0x5435a2,null))['then'](saveUpdates(_0x4afbaf['body'],null))[_0x2612('0x1f')](respondWithResult(_0x5435a2,null))[_0x2612('0x3c')](handleError(_0x5435a2,null));};exports[_0x2612('0x20')]=function(_0x586c67,_0x336964){return db['SmsApplication'][_0x2612('0x43')]({'where':{'id':_0x586c67[_0x2612('0x42')]['id']}})[_0x2612('0x1f')](handleEntityNotFound(_0x336964,null))[_0x2612('0x1f')](removeEntity(_0x336964,null))[_0x2612('0x3c')](handleError(_0x336964,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 7335477..d47daee 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 _0x6fd5=['sms_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication'];(function(_0x258d81,_0x41ebde){var _0x7d0e3c=function(_0x1bd40f){while(--_0x1bd40f){_0x258d81['push'](_0x258d81['shift']());}};_0x7d0e3c(++_0x41ebde);}(_0x6fd5,0xf0));var _0x56fd=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x6fd5[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x56fd('0x0'));var util=require('util');var logger=require(_0x56fd('0x1'))(_0x56fd('0x2'));var moment=require(_0x56fd('0x3'));var BPromise=require(_0x56fd('0x4'));var rp=require(_0x56fd('0x5'));var fs=require('fs');var path=require(_0x56fd('0x6'));var rimraf=require(_0x56fd('0x7'));var config=require('../../config/environment');var attributes=require(_0x56fd('0x8'));module[_0x56fd('0x9')]=function(_0x1ae776,_0x649fcd){return _0x1ae776[_0x56fd('0xa')](_0x56fd('0xb'),attributes,{'tableName':_0x56fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x56fd('0xd')});}; \ No newline at end of file +var _0x891b=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x891b,0xfe));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb891('0x0'));var util=require(_0xb891('0x1'));var logger=require(_0xb891('0x2'))('api');var moment=require(_0xb891('0x3'));var BPromise=require('bluebird');var rp=require(_0xb891('0x4'));var fs=require('fs');var path=require(_0xb891('0x5'));var rimraf=require(_0xb891('0x6'));var config=require(_0xb891('0x7'));var attributes=require(_0xb891('0x8'));module[_0xb891('0x9')]=function(_0x1be320,_0x21f757){return _0x1be320[_0xb891('0xa')](_0xb891('0xb'),attributes,{'tableName':_0xb891('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb891('0xd'),'collate':_0xb891('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 001e86e..7ede2d9 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 _0x97db=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x3196e4,_0x563f8a){var _0x382fd5=function(_0x39803b){while(--_0x39803b){_0x3196e4['push'](_0x3196e4['shift']());}};_0x382fd5(++_0x563f8a);}(_0x97db,0x1b4));var _0xb97d=function(_0x1d204d,_0x23496c){_0x1d204d=_0x1d204d-0x0;var _0x1bbd53=_0x97db[_0x1d204d];return _0x1bbd53;};'use strict';var _=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var moment=require(_0xb97d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb97d('0x3'));var db=require(_0xb97d('0x4'))['db'];var utils=require(_0xb97d('0x5'));var logger=require(_0xb97d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb97d('0x7'));var client=jayson[_0xb97d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533149,_0x2ff80e,_0x57cbd4){return new BPromise(function(_0x20f1e1,_0x2e1230){return client['request'](_0x533149,_0x57cbd4)[_0xb97d('0x9')](function(_0xe9acff){logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,'request\x20sent');logger[_0xb97d('0xc')](_0xb97d('0xd'),_0x2ff80e,_0xb97d('0xe'),JSON[_0xb97d('0xf')](_0xe9acff));if(_0xe9acff[_0xb97d('0x10')]){if(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x11')]===0x1f4){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x2e1230(_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);}logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0xe9acff[_0xb97d('0x10')][_0xb97d('0x12')]);return _0x20f1e1(_0xe9acff[_0xb97d('0x10')]['message']);}else{logger[_0xb97d('0xa')](_0xb97d('0xb'),_0x2ff80e,_0xb97d('0xe'));_0x20f1e1(_0xe9acff[_0xb97d('0x13')][_0xb97d('0x12')]);}})['catch'](function(_0x416d6a){logger[_0xb97d('0x10')](_0xb97d('0xb'),_0x2ff80e,_0x416d6a);_0x2e1230(_0x416d6a);});});} \ No newline at end of file +var _0x4b74=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','SmsApplication,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis'];(function(_0xf04c6d,_0xe98786){var _0x4a804e=function(_0x431a0a){while(--_0x431a0a){_0xf04c6d['push'](_0xf04c6d['shift']());}};_0x4a804e(++_0xe98786);}(_0x4b74,0x103));var _0x44b7=function(_0xa5d6fb,_0x2329c2){_0xa5d6fb=_0xa5d6fb-0x0;var _0x303e3f=_0x4b74[_0xa5d6fb];return _0x303e3f;};'use strict';var _=require(_0x44b7('0x0'));var util=require(_0x44b7('0x1'));var moment=require(_0x44b7('0x2'));var BPromise=require('bluebird');var rs=require(_0x44b7('0x3'));var fs=require('fs');var Redis=require(_0x44b7('0x4'));var db=require(_0x44b7('0x5'))['db'];var utils=require(_0x44b7('0x6'));var logger=require(_0x44b7('0x7'))(_0x44b7('0x8'));var config=require(_0x44b7('0x9'));var jayson=require(_0x44b7('0xa'));var client=jayson['client'][_0x44b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2174f2,_0x7b80e9,_0x4a582b){return new BPromise(function(_0x45dfbe,_0xabf05c){return client[_0x44b7('0xc')](_0x2174f2,_0x4a582b)['then'](function(_0x7d4b17){logger[_0x44b7('0xd')]('SmsApplication,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'));logger[_0x44b7('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'),JSON[_0x44b7('0x10')](_0x7d4b17));if(_0x7d4b17[_0x44b7('0x11')]){if(_0x7d4b17['error'][_0x44b7('0x12')]===0x1f4){logger[_0x44b7('0x11')]('SmsApplication,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17[_0x44b7('0x11')]['message']);return _0xabf05c(_0x7d4b17[_0x44b7('0x11')][_0x44b7('0x13')]);}logger[_0x44b7('0x11')]('SmsApplication,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17['error'][_0x44b7('0x13')]);return _0x45dfbe(_0x7d4b17['error']['message']);}else{logger['info'](_0x44b7('0x14'),_0x7b80e9,_0x44b7('0xe'));_0x45dfbe(_0x7d4b17['result'][_0x44b7('0x13')]);}})[_0x44b7('0x15')](function(_0x3528c8){logger[_0x44b7('0x11')](_0x44b7('0x14'),_0x7b80e9,_0x3528c8);_0xabf05c(_0x3528c8);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 82aead6..b437701 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 _0x1eba=['put','/:id','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x3cbb14,_0x3c95a7){var _0x2bfb35=function(_0x384c4d){while(--_0x384c4d){_0x3cbb14['push'](_0x3cbb14['shift']());}};_0x2bfb35(++_0x3c95a7);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x1eba[_0x27530d];return _0x59e561;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0x9')]('/:id',auth[_0xa1eb('0xa')](),controller['show']);router[_0xa1eb('0x9')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['getMessages']);router[_0xa1eb('0x9')]('/:id/download',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xe')]);router[_0xa1eb('0xf')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router[_0xa1eb('0xf')]('/:id/messages',auth[_0xa1eb('0xa')](),controller['addMessage']);router['post'](_0xa1eb('0x11'),auth['isAuthenticated'](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),_0xa1eb('0x14')),controller[_0xa1eb('0x15')]);router[_0xa1eb('0x16')](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:update'),controller[_0xa1eb('0x18')]);router['delete'](_0xa1eb('0x17'),auth[_0xa1eb('0xa')](),interaction[_0xa1eb('0x12')](_0xa1eb('0x13'),'smsinteraction:destroy'),controller[_0xa1eb('0x19')]);router[_0xa1eb('0x1a')](_0xa1eb('0x11'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0x1b')]);module[_0xa1eb('0x1c')]=router; \ No newline at end of file +var _0xac4a=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','get','describe','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','multer'];(function(_0x26dc8f,_0x39d186){var _0x125877=function(_0x1a5abc){while(--_0x1a5abc){_0x26dc8f['push'](_0x26dc8f['shift']());}};_0x125877(++_0x39d186);}(_0xac4a,0x13f));var _0xaac4=function(_0x36d374,_0x32af8d){_0x36d374=_0x36d374-0x0;var _0x3f17cb=_0xac4a[_0x36d374];return _0x3f17cb;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/describe',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id',auth[_0xaac4('0x9')](),controller['show']);router[_0xaac4('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')](_0xaac4('0x11'),auth['isAuthenticated'](),controller[_0xaac4('0x12')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),interaction[_0xaac4('0x13')](_0xaac4('0x14'),_0xaac4('0x15')),controller[_0xaac4('0x16')]);router[_0xaac4('0x17')](_0xaac4('0x18'),auth[_0xaac4('0x9')](),interaction[_0xaac4('0x13')](_0xaac4('0x14'),_0xaac4('0x19')),controller[_0xaac4('0x1a')]);router[_0xaac4('0x1b')]('/:id',auth[_0xaac4('0x9')](),interaction['tracked'](_0xaac4('0x14'),'smsinteraction:destroy'),controller[_0xaac4('0x1c')]);router[_0xaac4('0x1b')](_0xaac4('0x1d'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x1e')]);module[_0xaac4('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 7a43dc4..63e610f 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 _0xfd8f=['moment','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3f1937,_0x37d49c){var _0x46733e=function(_0x32e9df){while(--_0x32e9df){_0x3f1937['push'](_0x3f1937['shift']());}};_0x46733e(++_0x37d49c);}(_0xfd8f,0xae));var _0xffd8=function(_0x343c1e,_0x5d4f3e){_0x343c1e=_0x343c1e-0x0;var _0x576381=_0xfd8f[_0x343c1e];return _0x576381;};'use strict';var Sequelize=require(_0xffd8('0x0'));var moment=require(_0xffd8('0x1'));module['exports']={'closed':{'type':Sequelize[_0xffd8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xffd8('0x3')]},'disposition':{'type':Sequelize[_0xffd8('0x4')]},'secondDisposition':{'type':Sequelize[_0xffd8('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xffd8('0x4')]},'phone':{'type':Sequelize[_0xffd8('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xffd8('0x5')]('in',_0xffd8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xffd8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xffd8('0x5')]('in',_0xffd8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xffd8('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x943c=['sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x48445f,_0x2cc3e3){var _0x27e0dc=function(_0x1369fe){while(--_0x1369fe){_0x48445f['push'](_0x48445f['shift']());}};_0x27e0dc(++_0x2cc3e3);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc943('0x0'));var moment=require(_0xc943('0x1'));module[_0xc943('0x2')]={'closed':{'type':Sequelize[_0xc943('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc943('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc943('0x4')]},'note':{'type':Sequelize[_0xc943('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc943('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xc943('0x6')]('in',_0xc943('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc943('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xc943('0x6')]('in',_0xc943('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc943('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 6d62eaa..076084d 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 _0xd771=['stack','name','Users','fullname','TagIds','forEach','Tags','push','waiting','talking','unmanaged','closed','UserId','answered','total','index','map','SmsInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','length','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rawAttributes','options','catch','create','update','body','params','describe','addMessage','SmsMessage','ids','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','Sms','N.A.','disposition','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x29b31b,_0x174685){var _0x576e15=function(_0x4f1fce){while(--_0x4f1fce){_0x29b31b['push'](_0x29b31b['shift']());}};_0x576e15(++_0x174685);}(_0xd771,0xc5));var _0x1d77=function(_0x5c4d5a,_0x273de8){_0x5c4d5a=_0x5c4d5a-0x0;var _0x3cc624=_0xd771[_0x5c4d5a];return _0x3cc624;};'use strict';var emlformat=require(_0x1d77('0x0'));var rimraf=require(_0x1d77('0x1'));var zipdir=require(_0x1d77('0x2'));var jsonpatch=require(_0x1d77('0x3'));var rp=require(_0x1d77('0x4'));var moment=require(_0x1d77('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1d77('0x6'));var util=require(_0x1d77('0x7'));var path=require(_0x1d77('0x8'));var sox=require(_0x1d77('0x9'));var csv=require(_0x1d77('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d77('0xb'));var squel=require(_0x1d77('0xc'));var crypto=require(_0x1d77('0xd'));var jsforce=require(_0x1d77('0xe'));var deskjs=require(_0x1d77('0xf'));var toCsv=require(_0x1d77('0xa'));var querystring=require(_0x1d77('0x10'));var Papa=require(_0x1d77('0x11'));var Redis=require('ioredis');var authService=require(_0x1d77('0x12'));var qs=require(_0x1d77('0x13'));var as=require(_0x1d77('0x14'));var pdf=require(_0x1d77('0x15'));var hardwareService=require(_0x1d77('0x16'));var logger=require('../../config/logger')(_0x1d77('0x17'));var utils=require(_0x1d77('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1d77('0x19'));var db=require(_0x1d77('0x1a'))['db'];config[_0x1d77('0x1b')]=_[_0x1d77('0x1c')](config[_0x1d77('0x1b')],{'host':_0x1d77('0x1d'),'port':0x18eb});var socket=require(_0x1d77('0x1e'))(new Redis(config[_0x1d77('0x1b')]));require(_0x1d77('0x1f'))[_0x1d77('0x20')](socket);function respondWithStatusCode(_0x6e3c68,_0x2e2b52){_0x2e2b52=_0x2e2b52||0xcc;return function(_0x4755a2){if(_0x4755a2){return _0x6e3c68[_0x1d77('0x21')](_0x2e2b52);}return _0x6e3c68[_0x1d77('0x22')](_0x2e2b52)[_0x1d77('0x23')]();};}function respondWithResult(_0x1ee356,_0x1706c0){_0x1706c0=_0x1706c0||0xc8;return function(_0x2fdc39){if(_0x2fdc39){return _0x1ee356['status'](_0x1706c0)[_0x1d77('0x24')](_0x2fdc39);}};}function respondWithFilteredResult(_0x1d8773,_0x379cc2){return function(_0x5b0576){if(_0x5b0576){var _0x28bab8=typeof _0x379cc2['offset']===_0x1d77('0x25')&&typeof _0x379cc2[_0x1d77('0x26')]===_0x1d77('0x25');var _0x1adadd=_0x5b0576[_0x1d77('0x27')];var _0x120de6=_0x28bab8?0x0:_0x379cc2[_0x1d77('0x28')];var _0xaf16c6=_0x28bab8?_0x5b0576[_0x1d77('0x27')]:_0x379cc2[_0x1d77('0x28')]+_0x379cc2['limit'];var _0x57b0ae;if(_0xaf16c6>=_0x1adadd){_0xaf16c6=_0x1adadd;_0x57b0ae=0xc8;}else{_0x57b0ae=0xce;}_0x1d8773[_0x1d77('0x22')](_0x57b0ae);return _0x1d8773[_0x1d77('0x29')](_0x1d77('0x2a'),_0x120de6+'-'+_0xaf16c6+'/'+_0x1adadd)[_0x1d77('0x24')](_0x5b0576);}return null;};}function patchUpdates(_0x4a17bd){return function(_0x19ac40){try{jsonpatch[_0x1d77('0x2b')](_0x19ac40,_0x4a17bd,!![]);}catch(_0x518d39){return BPromise[_0x1d77('0x2c')](_0x518d39);}return _0x19ac40[_0x1d77('0x2d')]();};}function saveUpdates(_0x49312a,_0x5e9e59){return function(_0xff9d5d){if(_0xff9d5d){return _0xff9d5d['update'](_0x49312a)[_0x1d77('0x2e')](function(_0x531cf3){return _0x531cf3;});}return null;};}function removeEntity(_0x6466b5,_0x245176){return function(_0x285513){if(_0x285513){return _0x285513[_0x1d77('0x2f')]()['then'](function(){_0x6466b5[_0x1d77('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5891f7,_0x3322d8){return function(_0x450745){if(!_0x450745){_0x5891f7[_0x1d77('0x21')](0x194);}return _0x450745;};}function handleError(_0x597611,_0x5ddf1b){_0x5ddf1b=_0x5ddf1b||0x1f4;return function(_0x21c157){logger[_0x1d77('0x30')](_0x21c157[_0x1d77('0x31')]);if(_0x21c157[_0x1d77('0x32')]){delete _0x21c157[_0x1d77('0x32')];}_0x597611[_0x1d77('0x22')](_0x5ddf1b)['send'](_0x21c157);};}function getInteractionUsers(_0x9f3f4b,_0x8a359){return new BPromise(function(_0x19502f,_0x2c9f2e){try{if(_0x8a359[_0x9f3f4b['id']]){_0x9f3f4b[_0x1d77('0x33')]=_['map'](_0x8a359[_0x9f3f4b['id']],function(_0xc7d0a){return{'id':_0xc7d0a['id'],'fullname':_0xc7d0a[_0x1d77('0x34')]};});}}catch(_0x733f8f){_0x2c9f2e(_0x733f8f);}_0x19502f(_0x9f3f4b);});}function getInteractionTags(_0x5346a6,_0x5cf4cc){return new BPromise(function(_0x310357,_0x4c56c5){try{if(_0x5346a6[_0x1d77('0x35')]){_0x5346a6['Tags']=[];_0x5346a6[_0x1d77('0x35')]['split'](',')[_0x1d77('0x36')](function(_0x43da93){_0x5346a6[_0x1d77('0x37')][_0x1d77('0x38')](_0x5cf4cc[_0x43da93]);});}delete _0x5346a6['TagIds'];}catch(_0x1bd268){_0x4c56c5(_0x1bd268);}_0x310357(_0x5346a6);});}function updateSmsInteraction(_0x40e352,_0x73a165,_0x562a7f){return new BPromise(function(_0x5bf476,_0x14ad9b){return getInteractionUsers(_0x40e352,_0x562a7f)[_0x1d77('0x2e')](function(_0x5a53eb){return getInteractionTags(_0x5a53eb,_0x73a165);})[_0x1d77('0x2e')](function(_0x9d3410){return getStateInteraction(_0x9d3410);})['then'](function(_0x19db3e){_0x5bf476(_0x19db3e);})['catch'](function(_0x434e2f){_0x14ad9b(_0x434e2f);});});}function getStateInteraction(_0x131c04){return new BPromise(function(_0x24537d){_0x131c04[_0x1d77('0x39')]=0x0;_0x131c04[_0x1d77('0x3a')]=0x0;_0x131c04['answered']=0x0;_0x131c04[_0x1d77('0x3b')]=0x0;_0x131c04['total']=0x0;if(!_0x131c04[_0x1d77('0x3c')]&&!_0x131c04[_0x1d77('0x3d')]){_0x131c04['waiting']+=0x1;}if(!_0x131c04[_0x1d77('0x3c')]&&_0x131c04[_0x1d77('0x3d')]){_0x131c04[_0x1d77('0x3a')]+=0x1;if(_0x131c04[_0x1d77('0x39')]){_0x131c04[_0x1d77('0x39')]-=0x1;}}if(_0x131c04['closed']&&_0x131c04[_0x1d77('0x3d')]){_0x131c04[_0x1d77('0x3e')]+=0x1;if(_0x131c04[_0x1d77('0x3a')]){_0x131c04[_0x1d77('0x3a')]-=0x1;}}if(_0x131c04[_0x1d77('0x3c')]&&!_0x131c04['UserId']){_0x131c04[_0x1d77('0x3b')]+=0x1;if(_0x131c04[_0x1d77('0x39')]){_0x131c04[_0x1d77('0x39')]-=0x1;}}_0x131c04[_0x1d77('0x3f')]+=0x1;_0x24537d(_0x131c04);});}exports[_0x1d77('0x40')]=function(_0x1afe26,_0x49d735){var _0x29f019={},_0x138e6d={},_0x1cfb74={'count':0x0,'rows':[]};var _0x402511=_[_0x1d77('0x41')](db[_0x1d77('0x42')]['rawAttributes'],function(_0x136508){return{'name':_0x136508[_0x1d77('0x43')],'type':_0x136508[_0x1d77('0x44')][_0x1d77('0x45')]};});_0x138e6d[_0x1d77('0x46')]=_[_0x1d77('0x41')](_0x402511,_0x1d77('0x32'));_0x138e6d[_0x1d77('0x47')]=_[_0x1d77('0x48')](_0x1afe26[_0x1d77('0x47')]);_0x138e6d[_0x1d77('0x49')]=_[_0x1d77('0x4a')](_0x138e6d[_0x1d77('0x46')],_0x138e6d[_0x1d77('0x47')]);_0x29f019[_0x1d77('0x4b')]=_[_0x1d77('0x4a')](_0x138e6d[_0x1d77('0x46')],qs[_0x1d77('0x4c')](_0x1afe26[_0x1d77('0x47')][_0x1d77('0x4c')]));_0x29f019['attributes']=_0x29f019[_0x1d77('0x4b')]['length']?_0x29f019['attributes']:_0x138e6d[_0x1d77('0x46')];if(!_0x1afe26['query'][_0x1d77('0x4d')]('nolimit')){_0x29f019[_0x1d77('0x26')]=qs[_0x1d77('0x26')](_0x1afe26[_0x1d77('0x47')][_0x1d77('0x26')]);_0x29f019[_0x1d77('0x28')]=qs[_0x1d77('0x28')](_0x1afe26[_0x1d77('0x47')][_0x1d77('0x28')]);}_0x29f019[_0x1d77('0x4e')]=qs[_0x1d77('0x4f')](_0x1afe26[_0x1d77('0x47')][_0x1d77('0x4f')]);_0x29f019['where']=qs[_0x1d77('0x49')](_['pick'](_0x1afe26[_0x1d77('0x47')],_0x138e6d[_0x1d77('0x49')]),_0x402511);var _0x2b748a=[];var _0x374b8d=squel[_0x1d77('0x50')]()['field']('id')['field'](_0x1d77('0x32'))[_0x1d77('0x51')](_0x1d77('0x52'))[_0x1d77('0x53')](_0x1d77('0x54'));var _0x16776b=squel[_0x1d77('0x50')]()['field'](_0x1d77('0x55'))['field'](_0x1d77('0x56'))[_0x1d77('0x51')](_0x1d77('0x57'))[_0x1d77('0x53')](_0x1d77('0x58'),'ui')[_0x1d77('0x59')](_0x1d77('0x5a'),'u',_0x1d77('0x5b'));var _0x13e078=squel[_0x1d77('0x50')]()['from'](_0x1d77('0x5c'),'i')[_0x1d77('0x59')]('cm_contacts','c',_0x1d77('0x5d'))['left_join'](_0x1d77('0x5a'),'o',_0x1d77('0x5e'))[_0x1d77('0x59')](_0x1d77('0x5f'),'a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me',_0x1d77('0x60'))[_0x1d77('0x59')]('sms_interaction_has_tags','it',_0x1d77('0x61'))[_0x1d77('0x59')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0xf85a89=squel[_0x1d77('0x62')]();var _0x4b7c56=[];var _0x53fba9=squel[_0x1d77('0x62')]();var _0x3cf34a;if(_0x1afe26[_0x1d77('0x47')][_0x1d77('0x63')]){_0x3cf34a=as[_0x1d77('0x64')](_0x1afe26[_0x1d77('0x47')]['search']);var _0x27d8a3=_0x3cf34a[_0x1d77('0x65')];for(var _0x337b8f=0x0;_0x337b8f<_0x3cf34a[_0x1d77('0x66')]['length'];_0x337b8f++){var _0x2fda27=_0x3cf34a[_0x1d77('0x66')][_0x337b8f];var _0x158fc9='i';var _0x1a4397=_[_0x1d77('0x67')](_0x402511,[_0x1d77('0x32'),_0x2fda27[_0x1d77('0x51')]]);if(!_0x1a4397){switch(_0x2fda27[_0x1d77('0x51')]){case _0x1d77('0x68'):if(_0x2fda27[_0x1d77('0x69')]==0x1){_0x13e078[_0x1d77('0x6a')]('`'+_0x2fda27[_0x1d77('0x51')]+_0x1d77('0x6b'));}else{_0x13e078[_0x1d77('0x6a')]('`'+_0x2fda27[_0x1d77('0x51')]+_0x1d77('0x6c'));}break;case _0x1d77('0x6d'):if(_0x2fda27[_0x1d77('0x6e')]===_0x1d77('0x6f')){if(_0x2fda27[_0x1d77('0x69')]['split']('\x20')['length']>0x1){_0xf85a89[_0x27d8a3](_0x1d77('0x70'),qs[_0x1d77('0x71')](_0x2fda27[_0x1d77('0x69')]),null);}else{var _0x3c77da='%'+_0x2fda27[_0x1d77('0x69')]+'%';_0xf85a89[_0x27d8a3](_0x1d77('0x72'),_0x3c77da,_0x3c77da,_0x3c77da);}}else{_0x1a4397=_[_0x1d77('0x67')](_0x402511,[_0x1d77('0x32'),'ContactId']);_0x2fda27[_0x1d77('0x51')]=_0x1d77('0x73');_0x30828c=as[_0x1d77('0x74')](_0x158fc9,_0x1a4397[_0x1d77('0x44')],_0x2fda27);_0xf85a89[_0x27d8a3](_0x30828c['text'],_0x30828c[_0x1d77('0x69')][_0x1d77('0x75')],_0x30828c[_0x1d77('0x69')]['end']);}break;case'Tag':var _0x1377b2=_0x2fda27[_0x1d77('0x69')][_0x1d77('0x76')](',')[_0x1d77('0x41')](function(_0x32f335){return Number(_0x32f335);});_0x1377b2[_0x1d77('0x36')](function(_0x410f52){_0x53fba9['or'](_0x1d77('0x77'),'%,'+_0x410f52+',%');});_0x4b7c56=_[_0x1d77('0x78')](_0x4b7c56,_0x1377b2);break;case _0x1d77('0x79'):if(_0x2fda27[_0x1d77('0x6e')]==='$substring'){_0xf85a89[_0x27d8a3](_0x1d77('0x7a'),'%'+_0x2fda27[_0x1d77('0x69')]+'%',null);}else{_0x1a4397=_[_0x1d77('0x67')](_0x402511,[_0x1d77('0x32'),_0x1d77('0x3d')]);_0x2fda27[_0x1d77('0x51')]=_0x1d77('0x3d');_0x30828c=as[_0x1d77('0x74')](_0x158fc9,_0x1a4397[_0x1d77('0x44')],_0x2fda27);_0xf85a89[_0x27d8a3](_0x30828c['text'],_0x30828c[_0x1d77('0x69')][_0x1d77('0x75')],_0x30828c[_0x1d77('0x69')][_0x1d77('0x23')]);}break;case'body':_0x30828c=as['buildExpression']('me',null,_0x2fda27);_0xf85a89[_0x27d8a3](_0x30828c[_0x1d77('0x7b')],_0x30828c[_0x1d77('0x69')]['start'],_0x30828c['value']['end']);break;}}else{var _0x30828c=as[_0x1d77('0x74')](_0x158fc9,_0x1a4397[_0x1d77('0x44')],_0x2fda27);_0xf85a89[_0x27d8a3](_0x30828c[_0x1d77('0x7b')],_0x30828c[_0x1d77('0x69')][_0x1d77('0x75')],_0x30828c[_0x1d77('0x69')][_0x1d77('0x23')]);}}}else{var _0xf5fec7=_(_0x1afe26['query'])[_0x1d77('0x48')]()[_0x1d77('0x41')](function(_0x13b4a2){return _['some'](_0x402511,['name',_0x13b4a2])?_0x13b4a2:undefined;})[_0x1d77('0x7c')]()['value']();if(!_[_0x1d77('0x7d')](_0xf5fec7)){_0xf5fec7[_0x1d77('0x36')](function(_0x35d89e){if(_0x35d89e===_0x1d77('0x7e')){_0x13e078[_0x1d77('0x7f')](_0x1d77('0x80'),[][_0x1d77('0x81')](_0x1afe26['query'][_0x35d89e]));}else if(_0x35d89e===_0x1d77('0x82')){var _0x59fbdb=JSON[_0x1d77('0x83')](_0x1afe26[_0x1d77('0x47')][_0x35d89e])[_0x1d77('0x84')];var _0x223168=JSON['parse'](_0x1afe26['query'][_0x35d89e])[_0x1d77('0x85')];_0x13e078[_0x1d77('0x7f')](_0x1d77('0x86'),_0x59fbdb,_0x223168);}else{if(_0x1afe26[_0x1d77('0x47')][_0x35d89e]===_0x1d77('0x87')){_0x13e078[_0x1d77('0x7f')]('i.'+_0x35d89e+_0x1d77('0x88'));}else{_0x13e078['where']('i.'+_0x35d89e+'\x20=\x20?',_0x1afe26[_0x1d77('0x47')][_0x35d89e]);}}});}if(_0x1afe26[_0x1d77('0x47')][_0x1d77('0x89')]){if(_0x1afe26[_0x1d77('0x47')][_0x1d77('0x89')]==0x1){_0x13e078[_0x1d77('0x6a')](_0x1d77('0x8a'));}else{_0x13e078[_0x1d77('0x6a')](_0x1d77('0x8b'));}}if(_0x1afe26['query'][_0x1d77('0x8c')]){_0x4b7c56=_[_0x1d77('0x8d')](_0x1afe26[_0x1d77('0x47')]['tag'])?_0x1afe26['query'][_0x1d77('0x8c')]:new Array(_0x1afe26[_0x1d77('0x47')][_0x1d77('0x8c')]);_0x4b7c56[_0x1d77('0x36')](function(_0x4135ef){_0x53fba9['or'](_0x1d77('0x77'),'%,'+_0x4135ef+',%');});}if(_0x1afe26['query']['filter']){var _0x1c7477=_0x1afe26[_0x1d77('0x47')][_0x1d77('0x8e')][_0x1d77('0x8f')]('\x5c','\x5c\x5c')[_0x1d77('0x8f')](/'/g,'\x27\x27');if(qs[_0x1d77('0x90')](_0x1c7477)){_0xf85a89['or'](_0x1d77('0x91'),_0x1c7477+'%')['or'](_0x1d77('0x92'),_0x1c7477+'%');}else{_0xf85a89['or'](_0x1d77('0x93'),qs[_0x1d77('0x71')](_0x1c7477))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1c7477+'%');}}}_0x13e078[_0x1d77('0x7f')](_0xf85a89);_0x13e078[_0x1d77('0x94')](_0x1d77('0x95'));var _0x96410d={'type':db[_0x1d77('0x96')][_0x1d77('0x97')][_0x1d77('0x98')],'raw':!![]};var _0x267afa=_0x13e078[_0x1d77('0x99')]();_0x267afa[_0x1d77('0x51')](_0x1d77('0x95'));_0x267afa[_0x1d77('0x51')](_0x1d77('0x9a'),_0x1d77('0x68'));if(_0x29f019['order']){_0x29f019[_0x1d77('0x4e')][_0x1d77('0x36')](function(_0x285007){var _0x56aa15=_0x285007[0x0]==='contactName'?_0x285007[0x0]:'i.'+_0x285007[0x0];_0x13e078[_0x1d77('0x4e')](_0x56aa15,_0x285007[0x1]===_0x1d77('0x9b')?![]:!![]);});}if(!_[_0x1d77('0x7d')](_0x4b7c56)){_0x13e078[_0x1d77('0x6a')](_0x53fba9);_0x267afa['where'](_0x1d77('0x9c'),_0x4b7c56);}BPromise['resolve']()['then'](function(){if(!_0x3cf34a){if(_0x1afe26['query'][_0x1d77('0x7e')])return;_0x267afa[_0x1d77('0x7f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x13e078['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1afe26[_0x1d77('0x9d')][_0x1d77('0x9e')]!=='agent')return;return _0x1afe26['user'][_0x1d77('0x9f')]({'attributes':['id'],'raw':!![]})[_0x1d77('0x2e')](function(_0x3bfac3){if(_[_0x1d77('0x7d')](_0x3bfac3)){_0x267afa['where']('i.SmsAccountId\x20IS\x20NULL');_0x13e078[_0x1d77('0x7f')](_0x1d77('0xa0'));}else{_0x267afa[_0x1d77('0x7f')](_0x1d77('0x80'),_[_0x1d77('0x41')](_0x3bfac3,'id'));_0x13e078[_0x1d77('0x7f')]('i.SmsAccountId\x20IN\x20?',_[_0x1d77('0x41')](_0x3bfac3,'id'));}});})[_0x1d77('0x2e')](function(){if(_0x1afe26['user'][_0x1d77('0x9e')]===_0x1d77('0xa1')&&!_0x3cf34a&&!_0x1afe26[_0x1d77('0x47')]['SmsAccountId'])return[];return db[_0x1d77('0xa2')][_0x1d77('0x47')](_0x267afa[_0x1d77('0xa3')](),_0x96410d);})[_0x1d77('0x2e')](function(_0x48091f){_0x1cfb74[_0x1d77('0x27')]=_0x48091f[_0x1d77('0xa4')];if(_0x1cfb74[_0x1d77('0x27')]===0x0)return[];return db[_0x1d77('0xa2')]['query'](_0x374b8d[_0x1d77('0xa3')](),_0x96410d)[_0x1d77('0x2e')](function(_0x16e2ac){_0x2b748a=_['keyBy'](_0x16e2ac,'id');_0x96410d=_[_0x1d77('0xa5')](_0x96410d,{'model':db[_0x1d77('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1afe26[_0x1d77('0x47')]['fields']){_0x29f019[_0x1d77('0x4b')][_0x1d77('0x36')](function(_0x20ab80){_0x13e078[_0x1d77('0x51')]('i.'+_0x20ab80);});}else{_0x13e078[_0x1d77('0x51')](_0x1d77('0x9a'),_0x1d77('0x68'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xa6'),'Account.key');_0x13e078[_0x1d77('0x51')](_0x1d77('0xa7'),_0x1d77('0xa8'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xa9'),'contactName');_0x13e078[_0x1d77('0x51')](_0x1d77('0xaa'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xab'),_0x1d77('0xac'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xad'),_0x1d77('0xae'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xaf'),_0x1d77('0xb0'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xb1'),_0x1d77('0xb2'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xb3'),_0x1d77('0xb4'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xb5'),_0x1d77('0xb6'));_0x13e078['field'](_0x1d77('0xb7'),_0x1d77('0xb8'));_0x13e078[_0x1d77('0x51')](_0x1d77('0xb9'),_0x1d77('0xba'));_0x13e078[_0x1d77('0x51')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1d77('0x35'));}if(_0x29f019[_0x1d77('0x26')])_0x13e078[_0x1d77('0x26')](_0x29f019[_0x1d77('0x26')]);if(_0x29f019[_0x1d77('0x28')])_0x13e078[_0x1d77('0x28')](_0x29f019[_0x1d77('0x28')]);return db[_0x1d77('0xa2')][_0x1d77('0x47')](_0x13e078[_0x1d77('0xa3')](),_0x96410d);})[_0x1d77('0x2e')](function(_0x11551a){if(_0x11551a[_0x1d77('0xa4')]>0x0)_0x16776b[_0x1d77('0x7f')](_0x1d77('0xbb'),_[_0x1d77('0x41')](_0x11551a,'id'));return db[_0x1d77('0xa2')]['query'](_0x16776b[_0x1d77('0xa3')](),_0x96410d)[_0x1d77('0x2e')](function(_0x4f9dfd){var _0x5815f5=_[_0x1d77('0xbc')](_0x4f9dfd,_0x1d77('0xbd'));var _0x40a0cb=[];_0x11551a['forEach'](function(_0x2070ae){_0x40a0cb[_0x1d77('0x38')](updateSmsInteraction(_0x2070ae,_0x2b748a,_0x5815f5));});return BPromise[_0x1d77('0xbe')](_0x40a0cb);});});})[_0x1d77('0x2e')](function(_0x3233a1){_0x1cfb74['rows']=_0x3233a1;return _0x1cfb74;})[_0x1d77('0x2e')](respondWithFilteredResult(_0x49d735,_0x29f019))['catch'](handleError(_0x49d735,null));};exports['show']=function(_0x9bf6b8,_0x31e2a9){var _0x2619b4={'raw':![],'where':{'id':_0x9bf6b8['params']['id']}},_0x5e23ea={};_0x5e23ea['model']=_[_0x1d77('0x48')](db[_0x1d77('0x42')][_0x1d77('0xbf')]);_0x5e23ea[_0x1d77('0x47')]=_[_0x1d77('0x48')](_0x9bf6b8[_0x1d77('0x47')]);_0x5e23ea['filters']=_[_0x1d77('0x4a')](_0x5e23ea[_0x1d77('0x46')],_0x5e23ea[_0x1d77('0x47')]);_0x2619b4['attributes']=_[_0x1d77('0x4a')](_0x5e23ea['model'],qs[_0x1d77('0x4c')](_0x9bf6b8[_0x1d77('0x47')][_0x1d77('0x4c')]));_0x2619b4['attributes']=_0x2619b4[_0x1d77('0x4b')][_0x1d77('0xa4')]?_0x2619b4[_0x1d77('0x4b')]:_0x5e23ea[_0x1d77('0x46')];if(_0x9bf6b8[_0x1d77('0x47')]['includeAll']){_0x2619b4['include']=[{'all':!![]}];}_0x2619b4=_[_0x1d77('0xa5')]({},_0x2619b4,_0x9bf6b8[_0x1d77('0xc0')]);return db[_0x1d77('0x42')][_0x1d77('0x67')](_0x2619b4)[_0x1d77('0x2e')](handleEntityNotFound(_0x31e2a9,null))['then'](respondWithResult(_0x31e2a9,null))[_0x1d77('0xc1')](handleError(_0x31e2a9,null));};exports[_0x1d77('0xc2')]=function(_0x2b9822,_0x49f7ce){return db['SmsInteraction'][_0x1d77('0xc2')](_0x2b9822['body'],{})[_0x1d77('0x2e')](respondWithResult(_0x49f7ce,0xc9))[_0x1d77('0xc1')](handleError(_0x49f7ce,null));};exports[_0x1d77('0xc3')]=function(_0x48db5b,_0x48ae12){if(_0x48db5b['body']['id']){delete _0x48db5b[_0x1d77('0xc4')]['id'];}return db[_0x1d77('0x42')][_0x1d77('0x67')]({'where':{'id':_0x48db5b[_0x1d77('0xc5')]['id']}})[_0x1d77('0x2e')](handleEntityNotFound(_0x48ae12,null))['then'](saveUpdates(_0x48db5b['body'],null))[_0x1d77('0x2e')](respondWithResult(_0x48ae12,null))['catch'](handleError(_0x48ae12,null));};exports[_0x1d77('0x2f')]=function(_0x22a7bd,_0x23a074){return db['SmsInteraction'][_0x1d77('0x67')]({'where':{'id':_0x22a7bd[_0x1d77('0xc5')]['id']}})['then'](handleEntityNotFound(_0x23a074,null))[_0x1d77('0x2e')](removeEntity(_0x23a074,null))[_0x1d77('0xc1')](handleError(_0x23a074,null));};exports[_0x1d77('0xc6')]=function(_0x5e8e6c,_0x4e4cb4){return db[_0x1d77('0x42')][_0x1d77('0xc6')]()[_0x1d77('0x2e')](respondWithResult(_0x4e4cb4,null))[_0x1d77('0xc1')](handleError(_0x4e4cb4,null));};exports[_0x1d77('0xc7')]=function(_0x4b6d6a,_0xe720a,_0xdc4658){return db[_0x1d77('0xc8')]['find']({'where':{'id':_0x4b6d6a[_0x1d77('0xc5')]['id']}})[_0x1d77('0x2e')](handleEntityNotFound(_0xe720a,null))[_0x1d77('0x2e')](function(_0x2180b7){if(_0x2180b7){return _0x2180b7[_0x1d77('0xc7')](_0x4b6d6a[_0x1d77('0xc4')][_0x1d77('0xc9')],_['omit'](_0x4b6d6a[_0x1d77('0xc4')],[_0x1d77('0xc9'),'id'])||{});}})[_0x1d77('0x2e')](respondWithResult(_0xe720a,null))[_0x1d77('0xc1')](handleError(_0xe720a,null));};exports[_0x1d77('0xca')]=function(_0x438dd5,_0xc5c0da,_0x2d7886){var _0x164c11={'raw':![],'where':{}};var _0x1f3039={};var _0x296ecd={'count':0x0,'rows':[]};return db[_0x1d77('0x42')][_0x1d77('0xcb')]({'where':{'id':_0x438dd5['params']['id']}})[_0x1d77('0x2e')](handleEntityNotFound(_0xc5c0da,null))[_0x1d77('0x2e')](function(_0x56babf){if(_0x56babf){_0x1f3039['model']=_[_0x1d77('0x48')](db[_0x1d77('0xc8')][_0x1d77('0xbf')]);_0x1f3039[_0x1d77('0x47')]=_[_0x1d77('0x48')](_0x438dd5[_0x1d77('0x47')]);_0x1f3039['filters']=_[_0x1d77('0x4a')](_0x1f3039[_0x1d77('0x46')],_0x1f3039[_0x1d77('0x47')]);_0x164c11['attributes']=_[_0x1d77('0x4a')](_0x1f3039[_0x1d77('0x46')],qs[_0x1d77('0x4c')](_0x438dd5[_0x1d77('0x47')][_0x1d77('0x4c')]));_0x164c11['attributes']=_0x164c11[_0x1d77('0x4b')][_0x1d77('0xa4')]?_0x164c11[_0x1d77('0x4b')]:_0x1f3039[_0x1d77('0x46')];if(!_0x438dd5[_0x1d77('0x47')][_0x1d77('0x4d')]('nolimit')){_0x164c11['limit']=qs[_0x1d77('0x26')](_0x438dd5[_0x1d77('0x47')][_0x1d77('0x26')]);_0x164c11[_0x1d77('0x28')]=qs[_0x1d77('0x28')](_0x438dd5['query']['offset']);}_0x164c11[_0x1d77('0x4e')]=qs[_0x1d77('0x4f')](_0x438dd5['query'][_0x1d77('0x4f')]);_0x164c11[_0x1d77('0x7f')]=qs[_0x1d77('0x49')](_[_0x1d77('0xcc')](_0x438dd5[_0x1d77('0x47')],_0x1f3039[_0x1d77('0x49')]));_0x164c11['where']['SmsInteractionId']=_0x56babf['id'];if(_0x438dd5[_0x1d77('0x47')][_0x1d77('0x8e')]){_0x164c11['where']=_[_0x1d77('0xa5')](_0x164c11[_0x1d77('0x7f')],{'$or':_['map'](_0x164c11[_0x1d77('0x4b')],function(_0x1f9c49){var _0xe0b476={};_0xe0b476[_0x1f9c49]={'$like':'%'+_0x438dd5[_0x1d77('0x47')]['filter']+'%'};return _0xe0b476;})});}if(_0x438dd5[_0x1d77('0x47')][_0x1d77('0x84')]){var _0x5b3206=_0x438dd5[_0x1d77('0x47')][_0x1d77('0x84')][_0x1d77('0x76')](',');var _0x425bc0={};_0x425bc0[_0x5b3206[0x0]]={'$gte':moment(_0x5b3206[0x1])[_0x1d77('0xcd')](_0x1d77('0xce'))};_0x164c11[_0x1d77('0x7f')]=_['merge'](_0x164c11[_0x1d77('0x7f')],_0x425bc0);}_0x164c11=_[_0x1d77('0xa5')]({},_0x164c11,_0x438dd5['options']);return db[_0x1d77('0xc8')][_0x1d77('0x27')]({'where':_0x164c11[_0x1d77('0x7f')]})[_0x1d77('0x2e')](function(_0x2a09c0){_0x296ecd['count']=_0x2a09c0;if(_0x438dd5[_0x1d77('0x47')]['includeAll']){_0x164c11[_0x1d77('0xcf')]=[{'all':!![]}];}return db[_0x1d77('0xc8')][_0x1d77('0xd0')](_0x164c11);})[_0x1d77('0x2e')](function(_0x50f938){_0x296ecd['rows']=_0x50f938;return _0x296ecd;});}})[_0x1d77('0x2e')](respondWithFilteredResult(_0xc5c0da,_0x164c11))[_0x1d77('0xc1')](handleError(_0xc5c0da,null));};exports[_0x1d77('0xd1')]=function(_0x4d26d1,_0x2cc4d0,_0x8abff0){return db[_0x1d77('0x42')]['find']({'where':{'id':_0x4d26d1[_0x1d77('0xc5')]['id']}})[_0x1d77('0x2e')](handleEntityNotFound(_0x2cc4d0,null))[_0x1d77('0x2e')](function(_0x1f2143){if(_0x1f2143){return _0x1f2143[_0x1d77('0xd2')](_0x4d26d1[_0x1d77('0xc4')][_0x1d77('0xc9')],_[_0x1d77('0xd3')](_0x4d26d1[_0x1d77('0xc4')],['ids','id'])||{})[_0x1d77('0xd4')](function(){return db[_0x1d77('0xd5')][_0x1d77('0xd0')]({'attributes':['id',_0x1d77('0x32'),_0x1d77('0x52')],'where':{'id':_0x4d26d1['body'][_0x1d77('0xc9')]}});})['then'](function(_0x3a3198){socket[_0x1d77('0xd6')](_0x1d77('0xd7'),{'id':Number(_0x4d26d1['params']['id']),'tags':_0x3a3198||[]});return{'id':Number(_0x4d26d1[_0x1d77('0xc5')]['id']),'tags':_0x3a3198||[]};});}})[_0x1d77('0x2e')](respondWithResult(_0x2cc4d0,null))[_0x1d77('0xc1')](handleError(_0x2cc4d0,null));};exports[_0x1d77('0xd8')]=function(_0x8061f,_0x1fcd22,_0x1a0f3e){return db['SmsInteraction'][_0x1d77('0x67')]({'where':{'id':_0x8061f[_0x1d77('0xc5')]['id']}})[_0x1d77('0x2e')](handleEntityNotFound(_0x1fcd22,null))['then'](function(_0x4066b5){if(_0x4066b5){return _0x4066b5[_0x1d77('0xd8')](_0x8061f[_0x1d77('0x47')][_0x1d77('0xc9')]);}})[_0x1d77('0x2e')](respondWithStatusCode(_0x1fcd22,null))[_0x1d77('0xc1')](handleError(_0x1fcd22,null));};exports[_0x1d77('0xd9')]=function(_0x95d816,_0x3c8b0e){var _0x90373d=moment()[_0x1d77('0xda')]()[_0x1d77('0xa3')]();var _0x2c0105=path[_0x1d77('0xdb')](config[_0x1d77('0xdc')],_0x1d77('0xdd'),'files',_0x1d77('0xde'));var _0x2ae441=path[_0x1d77('0xdb')](config['root'],_0x1d77('0xdd'),_0x1d77('0xdf'),_0x1d77('0xe0'));var _0x5e9529=path['join'](_0x2c0105,_0x90373d);var _0x47fc35=util[_0x1d77('0xcd')]('transcript-%d-%s.zip',_0x95d816[_0x1d77('0xc5')]['id'],_0x90373d);var _0x165b09=path[_0x1d77('0xdb')](_0x2c0105,_0x47fc35);var _0x43e425=[];_0x43e425[_0x1d77('0x38')]({'model':db[_0x1d77('0x79')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x43e425[_0x1d77('0x38')]({'model':db[_0x1d77('0xe1')],'as':'Contact','attributes':['id',_0x1d77('0xe2'),_0x1d77('0xe3')],'raw':!![]});var _0x1b9fc5=[{'model':db[_0x1d77('0xc8')],'as':_0x1d77('0xe4'),'attributes':['id',_0x1d77('0xc4'),_0x1d77('0x82'),_0x1d77('0xe5'),_0x1d77('0xe6'),_0x1d77('0x89')],'include':_0x43e425}];_0x1b9fc5[_0x1d77('0x38')]({'model':db[_0x1d77('0xe7')],'as':_0x1d77('0xe8'),'attributes':['id',_0x1d77('0x32')]});_0x1b9fc5[_0x1d77('0x38')]({'model':db[_0x1d77('0x79')],'as':_0x1d77('0xe9'),'attributes':['id',_0x1d77('0x34')]});return db[_0x1d77('0x42')][_0x1d77('0x67')]({'where':{'id':_0x95d816[_0x1d77('0xc5')]['id']},'include':_0x1b9fc5})[_0x1d77('0x2e')](handleEntityNotFound(_0x3c8b0e,null))['then'](function(_0x3b3734){if(_0x3b3734){var _0x4d293a=_0x3b3734[_0x1d77('0xea')]({'plain':!![]});fs['mkdirSync'](_0x5e9529);var _0x1c75e8={'channel':_0x1d77('0xeb'),'account':_0x4d293a[_0x1d77('0xe8')][_0x1d77('0x32')],'agent':_0x4d293a[_0x1d77('0xe9')]?_0x4d293a[_0x1d77('0xe9')][_0x1d77('0x34')]:_0x1d77('0xec'),'createdAt':moment(_0x4d293a[_0x1d77('0x82')])[_0x1d77('0xcd')](_0x1d77('0xce'))['toString'](),'closedAt':_0x4d293a[_0x1d77('0x3c')]?moment(_0x4d293a['closedAt'])[_0x1d77('0xcd')](_0x1d77('0xce'))[_0x1d77('0xa3')]():'','disposition':_0x4d293a[_0x1d77('0xed')],'messages':_(_0x4d293a['Messages'])[_0x1d77('0x8e')]({'secret':![]})[_0x1d77('0x41')](function(_0xa03229){return{'date':moment(_0xa03229['createdAt'])['format'](_0x1d77('0xce'))[_0x1d77('0xa3')](),'sender':_0xa03229['direction']===_0x1d77('0xee')?_0xa03229['User']?_0xa03229[_0x1d77('0x79')][_0x1d77('0x34')]:_0x1d77('0xef'):_0xa03229[_0x1d77('0x6d')]['firstName']+(_0xa03229[_0x1d77('0x6d')][_0x1d77('0xe3')]?'\x20'+_0xa03229[_0x1d77('0x6d')]['lastName']:''),'body':_0xa03229[_0x1d77('0xc4')],'direction':_0xa03229[_0x1d77('0xe5')]==='out'?'A':'C','secret':_0xa03229[_0x1d77('0xe6')],'read':_0xa03229[_0x1d77('0x89')]};})[_0x1d77('0x69')]()};return ejs[_0x1d77('0xf0')](path[_0x1d77('0xdb')](config[_0x1d77('0xdc')],_0x1d77('0xdd'),_0x1d77('0xf1'),'downloadInteraction.ejs'),{'interaction':_0x1c75e8})[_0x1d77('0x2e')](function(_0x5a976c){var _0x15bf2f=path['join'](_0x5e9529,_0x1d77('0xf2')+_0x4d293a['id']+'-'+_0x90373d+_0x1d77('0xf3'));var _0x3684ee={'path':_0x15bf2f,'channel':_0x1d77('0xeb'),'interactionId':_0x4d293a['id']};return pdf[_0x1d77('0xf4')](_0x5a976c,_0x3684ee);})[_0x1d77('0x2e')](function(){return new BPromise(function(_0x5d2b6f,_0x565c43){zipdir(_0x5e9529,{'saveTo':_0x165b09},function(_0x507695,_0x2ae031){if(_0x507695)return _0x565c43(_0x507695);return _0x5d2b6f(_0x2ae031);});})[_0x1d77('0x2e')](function(){return new BPromise(function(_0x35a274,_0x27b627){rimraf(_0x5e9529,function(_0x5cecb1){if(_0x5cecb1)_0x27b627(_0x5cecb1);return _0x35a274();});});})['then'](function(){return _0x3c8b0e[_0x1d77('0xd9')](_0x165b09,_0x47fc35,function(_0x42a809){if(_0x42a809){console['log'](_0x1d77('0xf5'),_0x42a809);}else{fs['unlinkSync'](_0x165b09);}});});});}else{return _0x3c8b0e['sendStatus'](0xc8);}})['catch'](handleError(_0x3c8b0e,null));}; \ No newline at end of file +var _0xd9d2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','TagIds','Tags','split','forEach','catch','answered','unmanaged','total','closed','UserId','talking','waiting','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','ui.SmsInteractionId','left_join','users','from','sms_interactions','cm_contacts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','count','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','push','all','rows','params','SmsInteraction','includeAll','options','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','emit','smsInteractionTags:save','unix','join','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','disposition','out','System','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf'];(function(_0x29c93a,_0x349acc){var _0x4054e5=function(_0x531e96){while(--_0x531e96){_0x29c93a['push'](_0x29c93a['shift']());}};_0x4054e5(++_0x349acc);}(_0xd9d2,0xea));var _0x2d9d=function(_0x1e398d,_0x368d3c){_0x1e398d=_0x1e398d-0x0;var _0x299b6d=_0xd9d2[_0x1e398d];return _0x299b6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d9d('0x0'));var zipdir=require(_0x2d9d('0x1'));var jsonpatch=require(_0x2d9d('0x2'));var rp=require(_0x2d9d('0x3'));var moment=require(_0x2d9d('0x4'));var BPromise=require(_0x2d9d('0x5'));var Mustache=require('mustache');var util=require(_0x2d9d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2d9d('0x7'));var ejs=require(_0x2d9d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d9d('0x9'));var squel=require('squel');var crypto=require(_0x2d9d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2d9d('0x7'));var querystring=require(_0x2d9d('0xb'));var Papa=require(_0x2d9d('0xc'));var Redis=require(_0x2d9d('0xd'));var authService=require(_0x2d9d('0xe'));var qs=require(_0x2d9d('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x2d9d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d9d('0x11'))(_0x2d9d('0x12'));var utils=require(_0x2d9d('0x13'));var config=require(_0x2d9d('0x14'));var licenseUtil=require(_0x2d9d('0x15'));var db=require(_0x2d9d('0x16'))['db'];config[_0x2d9d('0x17')]=_['defaults'](config['redis'],{'host':_0x2d9d('0x18'),'port':0x18eb});var socket=require(_0x2d9d('0x19'))(new Redis(config[_0x2d9d('0x17')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x12426a,_0x2a37d6){_0x2a37d6=_0x2a37d6||0xcc;return function(_0x658d89){if(_0x658d89){return _0x12426a['sendStatus'](_0x2a37d6);}return _0x12426a[_0x2d9d('0x1a')](_0x2a37d6)[_0x2d9d('0x1b')]();};}function respondWithResult(_0x48901d,_0xb6340e){_0xb6340e=_0xb6340e||0xc8;return function(_0x28f89c){if(_0x28f89c){return _0x48901d[_0x2d9d('0x1a')](_0xb6340e)['json'](_0x28f89c);}};}function respondWithFilteredResult(_0x17c4c3,_0x475227){return function(_0x19408c){if(_0x19408c){var _0x301eee=typeof _0x475227[_0x2d9d('0x1c')]===_0x2d9d('0x1d')&&typeof _0x475227[_0x2d9d('0x1e')]===_0x2d9d('0x1d');var _0xc52a8=_0x19408c['count'];var _0x8835ef=_0x301eee?0x0:_0x475227[_0x2d9d('0x1c')];var _0x259a69=_0x301eee?_0x19408c['count']:_0x475227[_0x2d9d('0x1c')]+_0x475227[_0x2d9d('0x1e')];var _0x22c865;if(_0x259a69>=_0xc52a8){_0x259a69=_0xc52a8;_0x22c865=0xc8;}else{_0x22c865=0xce;}_0x17c4c3[_0x2d9d('0x1a')](_0x22c865);return _0x17c4c3[_0x2d9d('0x1f')](_0x2d9d('0x20'),_0x8835ef+'-'+_0x259a69+'/'+_0xc52a8)[_0x2d9d('0x21')](_0x19408c);}return null;};}function patchUpdates(_0x2f4438){return function(_0x119936){try{jsonpatch[_0x2d9d('0x22')](_0x119936,_0x2f4438,!![]);}catch(_0xde8e62){return BPromise[_0x2d9d('0x23')](_0xde8e62);}return _0x119936[_0x2d9d('0x24')]();};}function saveUpdates(_0x3d5851,_0x2e1102){return function(_0x5d8751){if(_0x5d8751){return _0x5d8751[_0x2d9d('0x25')](_0x3d5851)[_0x2d9d('0x26')](function(_0x45b731){return _0x45b731;});}return null;};}function removeEntity(_0x4d49b9,_0x571a28){return function(_0xf6eae2){if(_0xf6eae2){return _0xf6eae2[_0x2d9d('0x27')]()['then'](function(){_0x4d49b9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x583693,_0x1ca376){return function(_0x269fcd){if(!_0x269fcd){_0x583693[_0x2d9d('0x28')](0x194);}return _0x269fcd;};}function handleError(_0x4de7db,_0x401d4f){_0x401d4f=_0x401d4f||0x1f4;return function(_0x1a89a5){logger[_0x2d9d('0x29')](_0x1a89a5[_0x2d9d('0x2a')]);if(_0x1a89a5['name']){delete _0x1a89a5[_0x2d9d('0x2b')];}_0x4de7db[_0x2d9d('0x1a')](_0x401d4f)[_0x2d9d('0x2c')](_0x1a89a5);};}function getInteractionUsers(_0x543941,_0x531b3a){return new BPromise(function(_0x8b143c,_0x3e3f9f){try{if(_0x531b3a[_0x543941['id']]){_0x543941[_0x2d9d('0x2d')]=_['map'](_0x531b3a[_0x543941['id']],function(_0xfe8217){return{'id':_0xfe8217['id'],'fullname':_0xfe8217['fullname']};});}}catch(_0x316be5){_0x3e3f9f(_0x316be5);}_0x8b143c(_0x543941);});}function getInteractionTags(_0x5a7220,_0x38b2e7){return new BPromise(function(_0x52330b,_0xd8cc37){try{if(_0x5a7220[_0x2d9d('0x2e')]){_0x5a7220[_0x2d9d('0x2f')]=[];_0x5a7220[_0x2d9d('0x2e')][_0x2d9d('0x30')](',')[_0x2d9d('0x31')](function(_0x594766){_0x5a7220[_0x2d9d('0x2f')]['push'](_0x38b2e7[_0x594766]);});}delete _0x5a7220['TagIds'];}catch(_0x123bac){_0xd8cc37(_0x123bac);}_0x52330b(_0x5a7220);});}function updateSmsInteraction(_0x3cf7b7,_0x148860,_0x248d73){return new BPromise(function(_0x164217,_0x3efc4d){return getInteractionUsers(_0x3cf7b7,_0x248d73)['then'](function(_0x47329d){return getInteractionTags(_0x47329d,_0x148860);})[_0x2d9d('0x26')](function(_0x3dc72b){return getStateInteraction(_0x3dc72b);})['then'](function(_0x2d26a2){_0x164217(_0x2d26a2);})[_0x2d9d('0x32')](function(_0x4b732d){_0x3efc4d(_0x4b732d);});});}function getStateInteraction(_0x2e3cd1){return new BPromise(function(_0x3025a9){_0x2e3cd1['waiting']=0x0;_0x2e3cd1['talking']=0x0;_0x2e3cd1[_0x2d9d('0x33')]=0x0;_0x2e3cd1[_0x2d9d('0x34')]=0x0;_0x2e3cd1[_0x2d9d('0x35')]=0x0;if(!_0x2e3cd1[_0x2d9d('0x36')]&&!_0x2e3cd1['UserId']){_0x2e3cd1['waiting']+=0x1;}if(!_0x2e3cd1[_0x2d9d('0x36')]&&_0x2e3cd1[_0x2d9d('0x37')]){_0x2e3cd1[_0x2d9d('0x38')]+=0x1;if(_0x2e3cd1[_0x2d9d('0x39')]){_0x2e3cd1['waiting']-=0x1;}}if(_0x2e3cd1['closed']&&_0x2e3cd1[_0x2d9d('0x37')]){_0x2e3cd1['answered']+=0x1;if(_0x2e3cd1[_0x2d9d('0x38')]){_0x2e3cd1[_0x2d9d('0x38')]-=0x1;}}if(_0x2e3cd1[_0x2d9d('0x36')]&&!_0x2e3cd1['UserId']){_0x2e3cd1[_0x2d9d('0x34')]+=0x1;if(_0x2e3cd1['waiting']){_0x2e3cd1[_0x2d9d('0x39')]-=0x1;}}_0x2e3cd1[_0x2d9d('0x35')]+=0x1;_0x3025a9(_0x2e3cd1);});}exports[_0x2d9d('0x3a')]=function(_0x181dc8,_0x54b7d2){var _0x268788={},_0x2f2e1d={},_0x9d9abc={'count':0x0,'rows':[]};var _0x425fcb=_[_0x2d9d('0x3b')](db['SmsInteraction'][_0x2d9d('0x3c')],function(_0x4358ff){return{'name':_0x4358ff['fieldName'],'type':_0x4358ff[_0x2d9d('0x3d')][_0x2d9d('0x3e')]};});_0x2f2e1d[_0x2d9d('0x3f')]=_['map'](_0x425fcb,'name');_0x2f2e1d['query']=_['keys'](_0x181dc8[_0x2d9d('0x40')]);_0x2f2e1d['filters']=_[_0x2d9d('0x41')](_0x2f2e1d[_0x2d9d('0x3f')],_0x2f2e1d['query']);_0x268788[_0x2d9d('0x42')]=_[_0x2d9d('0x41')](_0x2f2e1d[_0x2d9d('0x3f')],qs['fields'](_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x43')]));_0x268788['attributes']=_0x268788[_0x2d9d('0x42')][_0x2d9d('0x44')]?_0x268788['attributes']:_0x2f2e1d[_0x2d9d('0x3f')];if(!_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x45')](_0x2d9d('0x46'))){_0x268788[_0x2d9d('0x1e')]=qs[_0x2d9d('0x1e')](_0x181dc8['query']['limit']);_0x268788[_0x2d9d('0x1c')]=qs[_0x2d9d('0x1c')](_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x1c')]);}_0x268788[_0x2d9d('0x47')]=qs[_0x2d9d('0x48')](_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x48')]);_0x268788[_0x2d9d('0x49')]=qs[_0x2d9d('0x4a')](_[_0x2d9d('0x4b')](_0x181dc8[_0x2d9d('0x40')],_0x2f2e1d[_0x2d9d('0x4a')]),_0x425fcb);var _0x2a6218=[];var _0x1625ae=squel[_0x2d9d('0x4c')]()['field']('id')[_0x2d9d('0x4d')](_0x2d9d('0x2b'))[_0x2d9d('0x4d')](_0x2d9d('0x4e'))['from'](_0x2d9d('0x4f'));var _0x25c6ab=squel[_0x2d9d('0x4c')]()[_0x2d9d('0x4d')]('u.id')[_0x2d9d('0x4d')](_0x2d9d('0x50'))[_0x2d9d('0x4d')](_0x2d9d('0x51'))['from']('user_has_sms_interactions','ui')[_0x2d9d('0x52')](_0x2d9d('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x3fe7ba=squel[_0x2d9d('0x4c')]()[_0x2d9d('0x54')](_0x2d9d('0x55'),'i')[_0x2d9d('0x52')](_0x2d9d('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2d9d('0x52')]('users','o','o.id\x20=\x20i.UserId')[_0x2d9d('0x52')]('sms_accounts','a',_0x2d9d('0x57'))[_0x2d9d('0x52')](_0x2d9d('0x58'),'me',_0x2d9d('0x59'))[_0x2d9d('0x52')](_0x2d9d('0x5a'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x2d9d('0x52')]('tools_tags','t',_0x2d9d('0x5b'));var _0x17ca9a=squel[_0x2d9d('0x5c')]();var _0x410fe2=[];var _0x4ed654=squel[_0x2d9d('0x5c')]();var _0x1d74f1;if(_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x5d')]){_0x1d74f1=as[_0x2d9d('0x5e')](_0x181dc8[_0x2d9d('0x40')]['search']);var _0x370f52=_0x1d74f1[_0x2d9d('0x5f')];for(var _0x5bdca0=0x0;_0x5bdca0<_0x1d74f1['conditions'][_0x2d9d('0x44')];_0x5bdca0++){var _0x30ee34=_0x1d74f1[_0x2d9d('0x60')][_0x5bdca0];var _0x5429bc='i';var _0x1a9c04=_[_0x2d9d('0x61')](_0x425fcb,[_0x2d9d('0x2b'),_0x30ee34[_0x2d9d('0x4d')]]);if(!_0x1a9c04){switch(_0x30ee34[_0x2d9d('0x4d')]){case _0x2d9d('0x62'):if(_0x30ee34[_0x2d9d('0x63')]==0x1){_0x3fe7ba['having']('`'+_0x30ee34[_0x2d9d('0x4d')]+_0x2d9d('0x64'));}else{_0x3fe7ba['having']('`'+_0x30ee34[_0x2d9d('0x4d')]+'`\x20>\x200');}break;case'Contact':if(_0x30ee34[_0x2d9d('0x65')]===_0x2d9d('0x66')){if(_0x30ee34[_0x2d9d('0x63')][_0x2d9d('0x30')]('\x20')[_0x2d9d('0x44')]>0x1){_0x17ca9a[_0x370f52](_0x2d9d('0x67'),qs[_0x2d9d('0x68')](_0x30ee34[_0x2d9d('0x63')]),null);}else{var _0x40e38e='%'+_0x30ee34['value']+'%';_0x17ca9a[_0x370f52](_0x2d9d('0x69'),_0x40e38e,_0x40e38e,_0x40e38e);}}else{_0x1a9c04=_[_0x2d9d('0x61')](_0x425fcb,[_0x2d9d('0x2b'),'ContactId']);_0x30ee34[_0x2d9d('0x4d')]=_0x2d9d('0x6a');_0x3966c4=as[_0x2d9d('0x6b')](_0x5429bc,_0x1a9c04[_0x2d9d('0x3d')],_0x30ee34);_0x17ca9a[_0x370f52](_0x3966c4[_0x2d9d('0x6c')],_0x3966c4[_0x2d9d('0x63')][_0x2d9d('0x6d')],_0x3966c4['value'][_0x2d9d('0x1b')]);}break;case _0x2d9d('0x6e'):var _0x48a55e=_0x30ee34[_0x2d9d('0x63')][_0x2d9d('0x30')](',')[_0x2d9d('0x3b')](function(_0x2b74ea){return Number(_0x2b74ea);});_0x48a55e[_0x2d9d('0x31')](function(_0xa13b2e){_0x4ed654['or'](_0x2d9d('0x6f'),'%,'+_0xa13b2e+',%');});_0x410fe2=_[_0x2d9d('0x70')](_0x410fe2,_0x48a55e);break;case _0x2d9d('0x71'):if(_0x30ee34[_0x2d9d('0x65')]===_0x2d9d('0x66')){_0x17ca9a[_0x370f52](_0x2d9d('0x72'),'%'+_0x30ee34[_0x2d9d('0x63')]+'%',null);}else{_0x1a9c04=_[_0x2d9d('0x61')](_0x425fcb,[_0x2d9d('0x2b'),_0x2d9d('0x37')]);_0x30ee34[_0x2d9d('0x4d')]=_0x2d9d('0x37');_0x3966c4=as['buildExpression'](_0x5429bc,_0x1a9c04[_0x2d9d('0x3d')],_0x30ee34);_0x17ca9a[_0x370f52](_0x3966c4[_0x2d9d('0x6c')],_0x3966c4[_0x2d9d('0x63')][_0x2d9d('0x6d')],_0x3966c4[_0x2d9d('0x63')][_0x2d9d('0x1b')]);}break;case _0x2d9d('0x73'):_0x3966c4=as[_0x2d9d('0x6b')]('me',null,_0x30ee34);_0x17ca9a[_0x370f52](_0x3966c4[_0x2d9d('0x6c')],_0x3966c4['value']['start'],_0x3966c4[_0x2d9d('0x63')][_0x2d9d('0x1b')]);break;}}else{var _0x3966c4=as['buildExpression'](_0x5429bc,_0x1a9c04[_0x2d9d('0x3d')],_0x30ee34);_0x17ca9a[_0x370f52](_0x3966c4[_0x2d9d('0x6c')],_0x3966c4['value'][_0x2d9d('0x6d')],_0x3966c4[_0x2d9d('0x63')][_0x2d9d('0x1b')]);}}}else{var _0x2ebb81=_(_0x181dc8[_0x2d9d('0x40')])[_0x2d9d('0x74')]()[_0x2d9d('0x3b')](function(_0x25c21f){return _[_0x2d9d('0x75')](_0x425fcb,['name',_0x25c21f])?_0x25c21f:undefined;})[_0x2d9d('0x76')]()[_0x2d9d('0x63')]();if(!_[_0x2d9d('0x77')](_0x2ebb81)){_0x2ebb81[_0x2d9d('0x31')](function(_0x3fc4fe){if(_0x3fc4fe===_0x2d9d('0x78')){_0x3fe7ba[_0x2d9d('0x49')](_0x2d9d('0x79'),[][_0x2d9d('0x7a')](_0x181dc8[_0x2d9d('0x40')][_0x3fc4fe]));}else if(_0x3fc4fe===_0x2d9d('0x7b')){var _0x4bf19b=JSON[_0x2d9d('0x7c')](_0x181dc8[_0x2d9d('0x40')][_0x3fc4fe])[_0x2d9d('0x7d')];var _0x1dc95d=JSON[_0x2d9d('0x7c')](_0x181dc8[_0x2d9d('0x40')][_0x3fc4fe])[_0x2d9d('0x7e')];_0x3fe7ba[_0x2d9d('0x49')](_0x2d9d('0x7f'),_0x4bf19b,_0x1dc95d);}else{if(_0x181dc8[_0x2d9d('0x40')][_0x3fc4fe]===_0x2d9d('0x80')){_0x3fe7ba['where']('i.'+_0x3fc4fe+_0x2d9d('0x81'));}else{_0x3fe7ba[_0x2d9d('0x49')]('i.'+_0x3fc4fe+_0x2d9d('0x82'),_0x181dc8[_0x2d9d('0x40')][_0x3fc4fe]);}}});}if(_0x181dc8[_0x2d9d('0x40')]['read']){if(_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x83')]==0x1){_0x3fe7ba[_0x2d9d('0x84')]('`unreadMessages`\x20=\x200');}else{_0x3fe7ba['having'](_0x2d9d('0x85'));}}if(_0x181dc8[_0x2d9d('0x40')]['tag']){_0x410fe2=_['isArray'](_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x86')])?_0x181dc8[_0x2d9d('0x40')]['tag']:new Array(_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x86')]);_0x410fe2[_0x2d9d('0x31')](function(_0x4b845a){_0x4ed654['or'](_0x2d9d('0x6f'),'%,'+_0x4b845a+',%');});}if(_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x87')]){var _0x34ece6=_0x181dc8['query'][_0x2d9d('0x87')][_0x2d9d('0x88')]('\x5c','\x5c\x5c')[_0x2d9d('0x88')](/'/g,'\x27\x27');if(qs[_0x2d9d('0x89')](_0x34ece6)){_0x17ca9a['or'](_0x2d9d('0x8a'),_0x34ece6+'%')['or']('i.phone\x20LIKE\x20?',_0x34ece6+'%');}else{_0x17ca9a['or'](_0x2d9d('0x8b'),qs['getFullTextValue'](_0x34ece6))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x34ece6+'%');}}}_0x3fe7ba[_0x2d9d('0x49')](_0x17ca9a);_0x3fe7ba[_0x2d9d('0x8c')](_0x2d9d('0x8d'));var _0x321720={'type':db['Sequelize'][_0x2d9d('0x8e')]['SELECT'],'raw':!![]};var _0x1a8c1c=_0x3fe7ba[_0x2d9d('0x8f')]();_0x1a8c1c[_0x2d9d('0x4d')](_0x2d9d('0x8d'));_0x1a8c1c[_0x2d9d('0x4d')](_0x2d9d('0x90'),_0x2d9d('0x62'));if(_0x268788[_0x2d9d('0x47')]){_0x268788[_0x2d9d('0x47')][_0x2d9d('0x31')](function(_0x19db31){var _0x10db1a=_0x19db31[0x0]===_0x2d9d('0x91')?_0x19db31[0x0]:'i.'+_0x19db31[0x0];_0x3fe7ba[_0x2d9d('0x47')](_0x10db1a,_0x19db31[0x1]===_0x2d9d('0x92')?![]:!![]);});}if(!_[_0x2d9d('0x77')](_0x410fe2)){_0x3fe7ba[_0x2d9d('0x84')](_0x4ed654);_0x1a8c1c['where'](_0x2d9d('0x93'),_0x410fe2);}BPromise['resolve']()[_0x2d9d('0x26')](function(){if(!_0x1d74f1){if(_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x78')])return;_0x1a8c1c[_0x2d9d('0x49')](_0x2d9d('0x94'));_0x3fe7ba['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x181dc8[_0x2d9d('0x95')][_0x2d9d('0x96')]!==_0x2d9d('0x97'))return;return _0x181dc8[_0x2d9d('0x95')][_0x2d9d('0x98')]({'attributes':['id'],'raw':!![]})[_0x2d9d('0x26')](function(_0x64313){if(_[_0x2d9d('0x77')](_0x64313)){_0x1a8c1c[_0x2d9d('0x49')](_0x2d9d('0x99'));_0x3fe7ba[_0x2d9d('0x49')](_0x2d9d('0x99'));}else{_0x1a8c1c[_0x2d9d('0x49')]('i.SmsAccountId\x20IN\x20?',_[_0x2d9d('0x3b')](_0x64313,'id'));_0x3fe7ba['where'](_0x2d9d('0x79'),_['map'](_0x64313,'id'));}});})[_0x2d9d('0x26')](function(){if(_0x181dc8[_0x2d9d('0x95')][_0x2d9d('0x96')]==='agent'&&!_0x1d74f1&&!_0x181dc8[_0x2d9d('0x40')][_0x2d9d('0x78')])return[];return db[_0x2d9d('0x9a')][_0x2d9d('0x40')](_0x1a8c1c['toString'](),_0x321720);})[_0x2d9d('0x26')](function(_0x3f40b0){_0x9d9abc[_0x2d9d('0x9b')]=_0x3f40b0[_0x2d9d('0x44')];if(_0x9d9abc[_0x2d9d('0x9b')]===0x0)return[];return db[_0x2d9d('0x9a')][_0x2d9d('0x40')](_0x1625ae[_0x2d9d('0x9c')](),_0x321720)['then'](function(_0x194de9){_0x2a6218=_[_0x2d9d('0x9d')](_0x194de9,'id');_0x321720=_[_0x2d9d('0x9e')](_0x321720,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x181dc8['query'][_0x2d9d('0x43')]){_0x268788[_0x2d9d('0x42')]['forEach'](function(_0x384ba0){_0x3fe7ba[_0x2d9d('0x4d')]('i.'+_0x384ba0);});}else{_0x3fe7ba[_0x2d9d('0x4d')](_0x2d9d('0x90'),'unreadMessages');_0x3fe7ba['field'](_0x2d9d('0x9f'),_0x2d9d('0xa0'));_0x3fe7ba[_0x2d9d('0x4d')]('a.mandatoryDisposition',_0x2d9d('0xa1'));_0x3fe7ba[_0x2d9d('0x4d')](_0x2d9d('0xa2'),_0x2d9d('0x91'));_0x3fe7ba[_0x2d9d('0x4d')]('i.*');_0x3fe7ba[_0x2d9d('0x4d')]('c.firstName','Contact.firstName');_0x3fe7ba[_0x2d9d('0x4d')](_0x2d9d('0xa3'),_0x2d9d('0xa4'));_0x3fe7ba[_0x2d9d('0x4d')](_0x2d9d('0xa5'),_0x2d9d('0xa6'));_0x3fe7ba[_0x2d9d('0x4d')](_0x2d9d('0xa7'),_0x2d9d('0xa8'));_0x3fe7ba['field'](_0x2d9d('0xa9'),'Contact.mobile');_0x3fe7ba['field'](_0x2d9d('0xaa'),_0x2d9d('0xab'));_0x3fe7ba[_0x2d9d('0x4d')](_0x2d9d('0xac'),'Owner.fullname');_0x3fe7ba[_0x2d9d('0x4d')]('o.internal',_0x2d9d('0xad'));_0x3fe7ba[_0x2d9d('0x4d')](_0x2d9d('0xae'),_0x2d9d('0x2e'));}if(_0x268788[_0x2d9d('0x1e')])_0x3fe7ba[_0x2d9d('0x1e')](_0x268788[_0x2d9d('0x1e')]);if(_0x268788[_0x2d9d('0x1c')])_0x3fe7ba[_0x2d9d('0x1c')](_0x268788[_0x2d9d('0x1c')]);return db[_0x2d9d('0x9a')][_0x2d9d('0x40')](_0x3fe7ba[_0x2d9d('0x9c')](),_0x321720);})[_0x2d9d('0x26')](function(_0x4e7d99){if(_0x4e7d99[_0x2d9d('0x44')]>0x0)_0x25c6ab['where'](_0x2d9d('0xaf'),_[_0x2d9d('0x3b')](_0x4e7d99,'id'));return db['sequelize']['query'](_0x25c6ab[_0x2d9d('0x9c')](),_0x321720)[_0x2d9d('0x26')](function(_0x2d728e){var _0x284e17=_['groupBy'](_0x2d728e,_0x2d9d('0xb0'));var _0x388823=[];_0x4e7d99[_0x2d9d('0x31')](function(_0x157ab){_0x388823[_0x2d9d('0xb1')](updateSmsInteraction(_0x157ab,_0x2a6218,_0x284e17));});return BPromise[_0x2d9d('0xb2')](_0x388823);});});})['then'](function(_0x16401f){_0x9d9abc[_0x2d9d('0xb3')]=_0x16401f;return _0x9d9abc;})[_0x2d9d('0x26')](respondWithFilteredResult(_0x54b7d2,_0x268788))[_0x2d9d('0x32')](handleError(_0x54b7d2,null));};exports['show']=function(_0x23447b,_0x44e237){var _0x30dafb={'raw':![],'where':{'id':_0x23447b[_0x2d9d('0xb4')]['id']}},_0x1eae80={};_0x1eae80[_0x2d9d('0x3f')]=_['keys'](db[_0x2d9d('0xb5')][_0x2d9d('0x3c')]);_0x1eae80[_0x2d9d('0x40')]=_[_0x2d9d('0x74')](_0x23447b[_0x2d9d('0x40')]);_0x1eae80[_0x2d9d('0x4a')]=_[_0x2d9d('0x41')](_0x1eae80[_0x2d9d('0x3f')],_0x1eae80['query']);_0x30dafb['attributes']=_[_0x2d9d('0x41')](_0x1eae80[_0x2d9d('0x3f')],qs[_0x2d9d('0x43')](_0x23447b[_0x2d9d('0x40')][_0x2d9d('0x43')]));_0x30dafb[_0x2d9d('0x42')]=_0x30dafb[_0x2d9d('0x42')]['length']?_0x30dafb[_0x2d9d('0x42')]:_0x1eae80[_0x2d9d('0x3f')];if(_0x23447b[_0x2d9d('0x40')][_0x2d9d('0xb6')]){_0x30dafb['include']=[{'all':!![]}];}_0x30dafb=_[_0x2d9d('0x9e')]({},_0x30dafb,_0x23447b[_0x2d9d('0xb7')]);return db[_0x2d9d('0xb5')][_0x2d9d('0x61')](_0x30dafb)[_0x2d9d('0x26')](handleEntityNotFound(_0x44e237,null))[_0x2d9d('0x26')](respondWithResult(_0x44e237,null))[_0x2d9d('0x32')](handleError(_0x44e237,null));};exports[_0x2d9d('0xb8')]=function(_0x48a2b2,_0xd29bb){return db[_0x2d9d('0xb5')][_0x2d9d('0xb8')](_0x48a2b2['body'],{})[_0x2d9d('0x26')](respondWithResult(_0xd29bb,0xc9))['catch'](handleError(_0xd29bb,null));};exports[_0x2d9d('0x25')]=function(_0x780ed6,_0x3631c4){if(_0x780ed6[_0x2d9d('0x73')]['id']){delete _0x780ed6[_0x2d9d('0x73')]['id'];}return db['SmsInteraction'][_0x2d9d('0x61')]({'where':{'id':_0x780ed6['params']['id']}})[_0x2d9d('0x26')](handleEntityNotFound(_0x3631c4,null))[_0x2d9d('0x26')](saveUpdates(_0x780ed6[_0x2d9d('0x73')],null))['then'](respondWithResult(_0x3631c4,null))[_0x2d9d('0x32')](handleError(_0x3631c4,null));};exports[_0x2d9d('0x27')]=function(_0x250d14,_0x636a1){return db['SmsInteraction'][_0x2d9d('0x61')]({'where':{'id':_0x250d14[_0x2d9d('0xb4')]['id']}})[_0x2d9d('0x26')](handleEntityNotFound(_0x636a1,null))[_0x2d9d('0x26')](removeEntity(_0x636a1,null))[_0x2d9d('0x32')](handleError(_0x636a1,null));};exports[_0x2d9d('0xb9')]=function(_0x5cdd36,_0x387499){return db[_0x2d9d('0xb5')][_0x2d9d('0xb9')]()[_0x2d9d('0x26')](respondWithResult(_0x387499,null))[_0x2d9d('0x32')](handleError(_0x387499,null));};exports[_0x2d9d('0xba')]=function(_0x27815d,_0x1f8931,_0x4b5494){return db[_0x2d9d('0xbb')]['find']({'where':{'id':_0x27815d[_0x2d9d('0xb4')]['id']}})['then'](handleEntityNotFound(_0x1f8931,null))[_0x2d9d('0x26')](function(_0x111ef0){if(_0x111ef0){return _0x111ef0[_0x2d9d('0xba')](_0x27815d['body']['ids'],_['omit'](_0x27815d[_0x2d9d('0x73')],[_0x2d9d('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x1f8931,null))['catch'](handleError(_0x1f8931,null));};exports[_0x2d9d('0xbd')]=function(_0xafa12f,_0x77f7aa,_0x20fc9d){var _0x54e4c8={'raw':![],'where':{}};var _0x16a914={};var _0x10a998={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x2d9d('0xbe')]({'where':{'id':_0xafa12f['params']['id']}})['then'](handleEntityNotFound(_0x77f7aa,null))[_0x2d9d('0x26')](function(_0xd72ea2){if(_0xd72ea2){_0x16a914[_0x2d9d('0x3f')]=_['keys'](db[_0x2d9d('0xbb')][_0x2d9d('0x3c')]);_0x16a914[_0x2d9d('0x40')]=_[_0x2d9d('0x74')](_0xafa12f[_0x2d9d('0x40')]);_0x16a914[_0x2d9d('0x4a')]=_['intersection'](_0x16a914[_0x2d9d('0x3f')],_0x16a914[_0x2d9d('0x40')]);_0x54e4c8[_0x2d9d('0x42')]=_['intersection'](_0x16a914[_0x2d9d('0x3f')],qs[_0x2d9d('0x43')](_0xafa12f['query'][_0x2d9d('0x43')]));_0x54e4c8['attributes']=_0x54e4c8['attributes']['length']?_0x54e4c8[_0x2d9d('0x42')]:_0x16a914[_0x2d9d('0x3f')];if(!_0xafa12f['query'][_0x2d9d('0x45')](_0x2d9d('0x46'))){_0x54e4c8[_0x2d9d('0x1e')]=qs['limit'](_0xafa12f[_0x2d9d('0x40')][_0x2d9d('0x1e')]);_0x54e4c8[_0x2d9d('0x1c')]=qs[_0x2d9d('0x1c')](_0xafa12f[_0x2d9d('0x40')][_0x2d9d('0x1c')]);}_0x54e4c8[_0x2d9d('0x47')]=qs[_0x2d9d('0x48')](_0xafa12f['query']['sort']);_0x54e4c8[_0x2d9d('0x49')]=qs[_0x2d9d('0x4a')](_[_0x2d9d('0x4b')](_0xafa12f[_0x2d9d('0x40')],_0x16a914[_0x2d9d('0x4a')]));_0x54e4c8[_0x2d9d('0x49')][_0x2d9d('0xb0')]=_0xd72ea2['id'];if(_0xafa12f[_0x2d9d('0x40')][_0x2d9d('0x87')]){_0x54e4c8[_0x2d9d('0x49')]=_['merge'](_0x54e4c8['where'],{'$or':_[_0x2d9d('0x3b')](_0x54e4c8['attributes'],function(_0x1978ca){var _0x17bb0b={};_0x17bb0b[_0x1978ca]={'$like':'%'+_0xafa12f['query']['filter']+'%'};return _0x17bb0b;})});}if(_0xafa12f[_0x2d9d('0x40')][_0x2d9d('0x7d')]){var _0x368b57=_0xafa12f['query'][_0x2d9d('0x7d')]['split'](',');var _0x109a6c={};_0x109a6c[_0x368b57[0x0]]={'$gte':moment(_0x368b57[0x1])[_0x2d9d('0xbf')](_0x2d9d('0xc0'))};_0x54e4c8['where']=_[_0x2d9d('0x9e')](_0x54e4c8[_0x2d9d('0x49')],_0x109a6c);}_0x54e4c8=_['merge']({},_0x54e4c8,_0xafa12f[_0x2d9d('0xb7')]);return db[_0x2d9d('0xbb')]['count']({'where':_0x54e4c8['where']})[_0x2d9d('0x26')](function(_0x53a8a){_0x10a998[_0x2d9d('0x9b')]=_0x53a8a;if(_0xafa12f['query'][_0x2d9d('0xb6')]){_0x54e4c8['include']=[{'all':!![]}];}return db[_0x2d9d('0xbb')][_0x2d9d('0xc1')](_0x54e4c8);})[_0x2d9d('0x26')](function(_0x217d38){_0x10a998['rows']=_0x217d38;return _0x10a998;});}})[_0x2d9d('0x26')](respondWithFilteredResult(_0x77f7aa,_0x54e4c8))[_0x2d9d('0x32')](handleError(_0x77f7aa,null));};exports[_0x2d9d('0xc2')]=function(_0x599ce5,_0x4cc5bb,_0xd7084e){return db[_0x2d9d('0xb5')][_0x2d9d('0x61')]({'where':{'id':_0x599ce5[_0x2d9d('0xb4')]['id']}})[_0x2d9d('0x26')](handleEntityNotFound(_0x4cc5bb,null))[_0x2d9d('0x26')](function(_0x3d4399){if(_0x3d4399){return _0x3d4399[_0x2d9d('0xc3')](_0x599ce5[_0x2d9d('0x73')][_0x2d9d('0xbc')],_[_0x2d9d('0xc4')](_0x599ce5[_0x2d9d('0x73')],['ids','id'])||{})[_0x2d9d('0xc5')](function(){return db['Tag'][_0x2d9d('0xc1')]({'attributes':['id',_0x2d9d('0x2b'),_0x2d9d('0x4e')],'where':{'id':_0x599ce5[_0x2d9d('0x73')][_0x2d9d('0xbc')]}});})[_0x2d9d('0x26')](function(_0x3d0e61){socket[_0x2d9d('0xc6')](_0x2d9d('0xc7'),{'id':Number(_0x599ce5['params']['id']),'tags':_0x3d0e61||[]});return{'id':Number(_0x599ce5[_0x2d9d('0xb4')]['id']),'tags':_0x3d0e61||[]};});}})[_0x2d9d('0x26')](respondWithResult(_0x4cc5bb,null))[_0x2d9d('0x32')](handleError(_0x4cc5bb,null));};exports['removeTags']=function(_0x154be5,_0x2429eb,_0x35261e){return db['SmsInteraction'][_0x2d9d('0x61')]({'where':{'id':_0x154be5['params']['id']}})['then'](handleEntityNotFound(_0x2429eb,null))['then'](function(_0x9473bf){if(_0x9473bf){return _0x9473bf['removeTags'](_0x154be5[_0x2d9d('0x40')][_0x2d9d('0xbc')]);}})['then'](respondWithStatusCode(_0x2429eb,null))[_0x2d9d('0x32')](handleError(_0x2429eb,null));};exports['download']=function(_0xc25468,_0x3e665b){var _0x4abd76=moment()[_0x2d9d('0xc8')]()[_0x2d9d('0x9c')]();var _0xdddc85=path[_0x2d9d('0xc9')](config['root'],_0x2d9d('0xca'),_0x2d9d('0xcb'),_0x2d9d('0xcc'));var _0x2c92b3=path[_0x2d9d('0xc9')](config['root'],_0x2d9d('0xca'),_0x2d9d('0xcb'),_0x2d9d('0xcd'));var _0x1f4ba8=path[_0x2d9d('0xc9')](_0xdddc85,_0x4abd76);var _0x1583fc=util[_0x2d9d('0xbf')](_0x2d9d('0xce'),_0xc25468[_0x2d9d('0xb4')]['id'],_0x4abd76);var _0xbf7897=path[_0x2d9d('0xc9')](_0xdddc85,_0x1583fc);var _0xa3c0f0=[];_0xa3c0f0['push']({'model':db[_0x2d9d('0x71')],'as':_0x2d9d('0x71'),'attributes':['id',_0x2d9d('0xcf')],'raw':!![]});_0xa3c0f0['push']({'model':db[_0x2d9d('0xd0')],'as':_0x2d9d('0xd1'),'attributes':['id',_0x2d9d('0xd2'),_0x2d9d('0xd3')],'raw':!![]});var _0x267f5c=[{'model':db[_0x2d9d('0xbb')],'as':_0x2d9d('0xd4'),'attributes':['id','body',_0x2d9d('0x7b'),_0x2d9d('0xd5'),_0x2d9d('0xd6'),_0x2d9d('0x83')],'include':_0xa3c0f0}];_0x267f5c['push']({'model':db[_0x2d9d('0xd7')],'as':_0x2d9d('0xd8'),'attributes':['id',_0x2d9d('0x2b')]});_0x267f5c[_0x2d9d('0xb1')]({'model':db[_0x2d9d('0x71')],'as':'Owner','attributes':['id','fullname']});return db[_0x2d9d('0xb5')][_0x2d9d('0x61')]({'where':{'id':_0xc25468[_0x2d9d('0xb4')]['id']},'include':_0x267f5c})[_0x2d9d('0x26')](handleEntityNotFound(_0x3e665b,null))[_0x2d9d('0x26')](function(_0xcc016b){if(_0xcc016b){var _0x3c1ea0=_0xcc016b[_0x2d9d('0xd9')]({'plain':!![]});fs[_0x2d9d('0xda')](_0x1f4ba8);var _0x126059={'channel':_0x2d9d('0xdb'),'account':_0x3c1ea0[_0x2d9d('0xd8')][_0x2d9d('0x2b')],'agent':_0x3c1ea0['Owner']?_0x3c1ea0[_0x2d9d('0xdc')][_0x2d9d('0xcf')]:_0x2d9d('0xdd'),'createdAt':moment(_0x3c1ea0[_0x2d9d('0x7b')])[_0x2d9d('0xbf')](_0x2d9d('0xc0'))['toString'](),'closedAt':_0x3c1ea0['closed']?moment(_0x3c1ea0['closedAt'])[_0x2d9d('0xbf')](_0x2d9d('0xc0'))[_0x2d9d('0x9c')]():'','disposition':_0x3c1ea0[_0x2d9d('0xde')],'messages':_(_0x3c1ea0['Messages'])[_0x2d9d('0x87')]({'secret':![]})[_0x2d9d('0x3b')](function(_0x1f3d45){return{'date':moment(_0x1f3d45['createdAt'])[_0x2d9d('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1f3d45['direction']===_0x2d9d('0xdf')?_0x1f3d45['User']?_0x1f3d45['User']['fullname']:_0x2d9d('0xe0'):_0x1f3d45[_0x2d9d('0xd1')][_0x2d9d('0xd2')]+(_0x1f3d45[_0x2d9d('0xd1')]['lastName']?'\x20'+_0x1f3d45[_0x2d9d('0xd1')][_0x2d9d('0xd3')]:''),'body':_0x1f3d45[_0x2d9d('0x73')],'direction':_0x1f3d45[_0x2d9d('0xd5')]==='out'?'A':'C','secret':_0x1f3d45[_0x2d9d('0xd6')],'read':_0x1f3d45[_0x2d9d('0x83')]};})[_0x2d9d('0x63')]()};return ejs[_0x2d9d('0xe1')](path[_0x2d9d('0xc9')](config[_0x2d9d('0xe2')],'server',_0x2d9d('0xe3'),_0x2d9d('0xe4')),{'interaction':_0x126059})['then'](function(_0x4439b1){var _0x47b10f=path[_0x2d9d('0xc9')](_0x1f4ba8,_0x2d9d('0xe5')+_0x3c1ea0['id']+'-'+_0x4abd76+_0x2d9d('0xe6'));var _0x1b552b={'path':_0x47b10f,'channel':_0x2d9d('0xdb'),'interactionId':_0x3c1ea0['id']};return pdf[_0x2d9d('0xe7')](_0x4439b1,_0x1b552b);})[_0x2d9d('0x26')](function(){return new BPromise(function(_0x35cb71,_0x221bcc){zipdir(_0x1f4ba8,{'saveTo':_0xbf7897},function(_0x439508,_0x1a24ad){if(_0x439508)return _0x221bcc(_0x439508);return _0x35cb71(_0x1a24ad);});})[_0x2d9d('0x26')](function(){return new BPromise(function(_0x108bf1,_0x7c82a4){rimraf(_0x1f4ba8,function(_0x5d3273){if(_0x5d3273)_0x7c82a4(_0x5d3273);return _0x108bf1();});});})[_0x2d9d('0x26')](function(){return _0x3e665b[_0x2d9d('0xe8')](_0xbf7897,_0x1583fc,function(_0x1092bf){if(_0x1092bf){console['log'](_0x2d9d('0xe9'),_0x1092bf);}else{fs[_0x2d9d('0xea')](_0xbf7897);}});});});}else{return _0x3e665b[_0x2d9d('0x28')](0xc8);}})['catch'](handleError(_0x3e665b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index beb00bf..3f35bb6 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 _0x5b12=['exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3482e0,_0x1e1b65){var _0x125fe5=function(_0x30411b){while(--_0x30411b){_0x3482e0['push'](_0x3482e0['shift']());}};_0x125fe5(++_0x1e1b65);}(_0x5b12,0xa3));var _0x25b1=function(_0x54ad47,_0x1f0ef4){_0x54ad47=_0x54ad47-0x0;var _0x4b87cd=_0x5b12[_0x54ad47];return _0x4b87cd;};'use strict';var EventEmitter=require(_0x25b1('0x0'));var SmsInteraction=require(_0x25b1('0x1'))['db'][_0x25b1('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x25b1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25b1('0x4'),'afterUpdate':_0x25b1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31f3fc){return function(_0x56378e,_0x5248c2,_0x35d90b){_0x56378e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1f715d){_0x56378e[_0x25b1('0x6')](_0x25b1('0x7'),_0x1f715d[_0x25b1('0x8')](function(_0x1ed594){return{'id':_0x1ed594['id']};}));return SmsMessage[_0x25b1('0x9')]({'where':{'SmsInteractionId':_0x56378e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x25b1('0xa')](function(_0x6235e2){_0x56378e['setDataValue'](_0x25b1('0xb'),_0x6235e2[_0x25b1('0xc')]);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc+':'+_0x56378e['id'],_0x56378e);SmsInteractionEvents[_0x25b1('0xd')](_0x31f3fc,_0x56378e);_0x35d90b(null);})[_0x25b1('0xe')](_0x35d90b(null));};}for(var e in events){if(events[_0x25b1('0xf')](e)){var event=events[e];SmsInteraction[_0x25b1('0x10')](e,emitEvent(event));}}module[_0x25b1('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x958a=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0x45112,_0x1c9353){var _0x70a34d=function(_0x430260){while(--_0x430260){_0x45112['push'](_0x45112['shift']());}};_0x70a34d(++_0x1c9353);}(_0x958a,0x128));var _0xa958=function(_0x37ac12,_0x52ea1c){_0x37ac12=_0x37ac12-0x0;var _0x44be7d=_0x958a[_0x37ac12];return _0x44be7d;};'use strict';var EventEmitter=require(_0xa958('0x0'));var SmsInteraction=require(_0xa958('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xa958('0x1'))['db'][_0xa958('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa958('0x3')](0x0);var events={'afterCreate':_0xa958('0x4'),'afterUpdate':_0xa958('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3424b0){return function(_0x578481,_0x2024b8,_0x9b7d9e){_0x578481[_0xa958('0x6')]({'attributes':['id'],'raw':!![]})[_0xa958('0x7')](function(_0x3ca01f){_0x578481[_0xa958('0x8')](_0xa958('0x9'),_0x3ca01f['map'](function(_0x514b4f){return{'id':_0x514b4f['id']};}));return SmsMessage[_0xa958('0xa')]({'where':{'SmsInteractionId':_0x578481['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa958('0x7')](function(_0x11f090){_0x578481[_0xa958('0x8')](_0xa958('0xb'),_0x11f090[_0xa958('0xc')]);SmsInteractionEvents[_0xa958('0xd')](_0x3424b0+':'+_0x578481['id'],_0x578481);SmsInteractionEvents[_0xa958('0xd')](_0x3424b0,_0x578481);_0x9b7d9e(null);})[_0xa958('0xe')](_0x9b7d9e(null));};}for(var e in events){if(events[_0xa958('0xf')](e)){var event=events[e];SmsInteraction[_0xa958('0x10')](e,emitEvent(event));}}module[_0xa958('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 89467b5..0b298f6 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 _0x6f1c=['request-promise','path','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f1c,0x6b));var _0xc6f1=function(_0x4d40d8,_0x221cc2){_0x4d40d8=_0x4d40d8-0x0;var _0x39da4b=_0x6f1c[_0x4d40d8];return _0x39da4b;};'use strict';var _=require(_0xc6f1('0x0'));var util=require('util');var logger=require(_0xc6f1('0x1'))(_0xc6f1('0x2'));var moment=require(_0xc6f1('0x3'));var BPromise=require(_0xc6f1('0x4'));var rp=require(_0xc6f1('0x5'));var fs=require('fs');var path=require(_0xc6f1('0x6'));var rimraf=require(_0xc6f1('0x7'));var config=require(_0xc6f1('0x8'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x149a85,_0x28a1a8){return _0x149a85[_0xc6f1('0x9')](_0xc6f1('0xa'),attributes,{'tableName':_0xc6f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4df673,_0x26893c,_0x1a3f72){if(_0x4df673[_0xc6f1('0xc')]('closed')){_0x4df673[_0xc6f1('0xd')]=moment()[_0xc6f1('0xe')](_0xc6f1('0xf'));}_0x1a3f72(null,_0x4df673);}}});}; \ No newline at end of file +var _0x68e7=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','format'];(function(_0x2b76de,_0x2c174c){var _0x4bbf3e=function(_0x422977){while(--_0x422977){_0x2b76de['push'](_0x2b76de['shift']());}};_0x4bbf3e(++_0x2c174c);}(_0x68e7,0x1f1));var _0x768e=function(_0x95ea88,_0x36632a){_0x95ea88=_0x95ea88-0x0;var _0x4b1d91=_0x68e7[_0x95ea88];return _0x4b1d91;};'use strict';var _=require(_0x768e('0x0'));var util=require(_0x768e('0x1'));var logger=require('../../config/logger')(_0x768e('0x2'));var moment=require(_0x768e('0x3'));var BPromise=require(_0x768e('0x4'));var rp=require(_0x768e('0x5'));var fs=require('fs');var path=require(_0x768e('0x6'));var rimraf=require(_0x768e('0x7'));var config=require(_0x768e('0x8'));var attributes=require(_0x768e('0x9'));module[_0x768e('0xa')]=function(_0x37e85f,_0x402e2f){return _0x37e85f['define'](_0x768e('0xb'),attributes,{'tableName':_0x768e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27226f,_0x3c2baa,_0x1efcca){if(_0x27226f[_0x768e('0xd')]('closed')){_0x27226f['closedAt']=moment()[_0x768e('0xe')](_0x768e('0xf'));}_0x1efcca(null,_0x27226f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9627e40..d684260 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 _0xbe39=['omit','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','UpdateSmsInteraction','SmsInteraction','options','raw','where','attributes','info','catch','AddTagsToSmsInteraction','find','addTags','ids'];(function(_0x4d01c4,_0x4a9db1){var _0x57219d=function(_0x2d9dcb){while(--_0x2d9dcb){_0x4d01c4['push'](_0x4d01c4['shift']());}};_0x57219d(++_0x4a9db1);}(_0xbe39,0x1bf));var _0x9be3=function(_0x5ef41f,_0x21ce21){_0x5ef41f=_0x5ef41f-0x0;var _0x157763=_0xbe39[_0x5ef41f];return _0x157763;};'use strict';var _=require('lodash');var util=require(_0x9be3('0x0'));var moment=require(_0x9be3('0x1'));var BPromise=require(_0x9be3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9be3('0x3'))['db'];var utils=require(_0x9be3('0x4'));var logger=require(_0x9be3('0x5'))('rpc');var config=require(_0x9be3('0x6'));var jayson=require(_0x9be3('0x7'));var client=jayson['client'][_0x9be3('0x8')]({'port':0x232a});config[_0x9be3('0x9')]=_[_0x9be3('0xa')](config[_0x9be3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9be3('0xb'))(new Redis(config[_0x9be3('0x9')]));require(_0x9be3('0xc'))['register'](socket);function respondWithRpcPromise(_0x520935,_0x28b570,_0x209bee){return new BPromise(function(_0xb42eb9,_0x7f08c2){return client[_0x9be3('0xd')](_0x520935,_0x209bee)[_0x9be3('0xe')](function(_0x309c77){logger['info'](_0x9be3('0xf'),_0x28b570,_0x9be3('0x10'));logger[_0x9be3('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x28b570,_0x9be3('0x10'),JSON[_0x9be3('0x12')](_0x309c77));if(_0x309c77[_0x9be3('0x13')]){if(_0x309c77[_0x9be3('0x13')]['code']===0x1f4){logger[_0x9be3('0x13')](_0x9be3('0xf'),_0x28b570,_0x309c77[_0x9be3('0x13')][_0x9be3('0x14')]);return _0x7f08c2(_0x309c77[_0x9be3('0x13')]['message']);}logger[_0x9be3('0x13')](_0x9be3('0xf'),_0x28b570,_0x309c77[_0x9be3('0x13')]['message']);return _0xb42eb9(_0x309c77[_0x9be3('0x13')][_0x9be3('0x14')]);}else{logger['info'](_0x9be3('0xf'),_0x28b570,_0x9be3('0x10'));_0xb42eb9(_0x309c77[_0x9be3('0x15')][_0x9be3('0x14')]);}})['catch'](function(_0x153dc2){logger[_0x9be3('0x13')](_0x9be3('0xf'),_0x28b570,_0x153dc2);_0x7f08c2(_0x153dc2);});});}exports[_0x9be3('0x16')]=function(_0x2f4871){var _0x22b8be=this;return new Promise(function(_0x1f52fd,_0x3866a0){return db[_0x9be3('0x17')]['update'](_0x2f4871['body'],{'raw':_0x2f4871['options']?_0x2f4871[_0x9be3('0x18')][_0x9be3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f4871[_0x9be3('0x18')]?_0x2f4871[_0x9be3('0x18')][_0x9be3('0x1a')]||null:null,'attributes':_0x2f4871[_0x9be3('0x18')]?_0x2f4871[_0x9be3('0x18')][_0x9be3('0x1b')]||null:null,'limit':_0x2f4871[_0x9be3('0x18')]?_0x2f4871[_0x9be3('0x18')]['limit']||null:null})[_0x9be3('0xe')](function(_0x1d4606){logger[_0x9be3('0x1c')]('UpdateSmsInteraction',_0x2f4871);logger[_0x9be3('0x11')]('UpdateSmsInteraction',_0x2f4871,JSON[_0x9be3('0x12')](_0x1d4606));_0x1f52fd(_0x1d4606);})[_0x9be3('0x1d')](function(_0x43f7f8){logger['error'](_0x9be3('0x16'),_0x43f7f8[_0x9be3('0x14')],_0x2f4871);_0x3866a0(_0x22b8be['error'](0x1f4,_0x43f7f8['message']));});});};exports[_0x9be3('0x1e')]=function(_0x15a553){return new Promise(function(_0x3e7cc3,_0x3f028a){return db[_0x9be3('0x17')][_0x9be3('0x1f')]({'where':_0x15a553['options']?_0x15a553['options'][_0x9be3('0x1a')]||null:null})[_0x9be3('0xe')](function(_0x5c75ae){if(_0x5c75ae){return _0x5c75ae[_0x9be3('0x20')](_0x15a553['body'][_0x9be3('0x21')],_[_0x9be3('0x22')](_0x15a553['body'],['ids','id'])||{});}})[_0x9be3('0x23')](function(_0x5ce58a){logger[_0x9be3('0x1c')](_0x9be3('0x24'),_0x15a553);logger[_0x9be3('0x11')](_0x9be3('0x24'),_0x15a553,JSON[_0x9be3('0x12')](_0x5ce58a));_0x3e7cc3(_0x5ce58a);})[_0x9be3('0x1d')](function(_0x2ea2f5){logger[_0x9be3('0x13')](_0x9be3('0x24'),_0x2ea2f5[_0x9be3('0x14')],_0x15a553);_0x3f028a(_this[_0x9be3('0x13')](0x1f4,_0x2ea2f5[_0x9be3('0x14')]));});});}; \ No newline at end of file +var _0xe10d=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40f30e,_0x4729dc){var _0x2ea85a=function(_0x5e43e6){while(--_0x5e43e6){_0x40f30e['push'](_0x40f30e['shift']());}};_0x2ea85a(++_0x4729dc);}(_0xe10d,0x184));var _0xde10=function(_0x3683c5,_0x8281e2){_0x3683c5=_0x3683c5-0x0;var _0x4cb9a1=_0xe10d[_0x3683c5];return _0x4cb9a1;};'use strict';var _=require(_0xde10('0x0'));var util=require(_0xde10('0x1'));var moment=require(_0xde10('0x2'));var BPromise=require('bluebird');var rs=require(_0xde10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde10('0x4'))['db'];var utils=require(_0xde10('0x5'));var logger=require(_0xde10('0x6'))(_0xde10('0x7'));var config=require(_0xde10('0x8'));var jayson=require(_0xde10('0x9'));var client=jayson[_0xde10('0xa')][_0xde10('0xb')]({'port':0x232a});config[_0xde10('0xc')]=_[_0xde10('0xd')](config['redis'],{'host':_0xde10('0xe'),'port':0x18eb});var socket=require(_0xde10('0xf'))(new Redis(config['redis']));require(_0xde10('0x10'))[_0xde10('0x11')](socket);function respondWithRpcPromise(_0x39c484,_0xdb759d,_0x720ff0){return new BPromise(function(_0x1ebaf8,_0x5ed1d7){return client['request'](_0x39c484,_0x720ff0)[_0xde10('0x12')](function(_0x3ce658){logger[_0xde10('0x13')](_0xde10('0x14'),_0xdb759d,_0xde10('0x15'));logger[_0xde10('0x16')](_0xde10('0x17'),_0xdb759d,_0xde10('0x15'),JSON[_0xde10('0x18')](_0x3ce658));if(_0x3ce658[_0xde10('0x19')]){if(_0x3ce658['error'][_0xde10('0x1a')]===0x1f4){logger['error'](_0xde10('0x14'),_0xdb759d,_0x3ce658[_0xde10('0x19')][_0xde10('0x1b')]);return _0x5ed1d7(_0x3ce658['error'][_0xde10('0x1b')]);}logger[_0xde10('0x19')](_0xde10('0x14'),_0xdb759d,_0x3ce658[_0xde10('0x19')][_0xde10('0x1b')]);return _0x1ebaf8(_0x3ce658['error'][_0xde10('0x1b')]);}else{logger[_0xde10('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xdb759d,_0xde10('0x15'));_0x1ebaf8(_0x3ce658[_0xde10('0x1c')][_0xde10('0x1b')]);}})[_0xde10('0x1d')](function(_0x45f589){logger[_0xde10('0x19')](_0xde10('0x14'),_0xdb759d,_0x45f589);_0x5ed1d7(_0x45f589);});});}exports[_0xde10('0x1e')]=function(_0x4a9a79){var _0x287ea6=this;return new Promise(function(_0x51c0a3,_0x18188c){return db[_0xde10('0x1f')]['update'](_0x4a9a79[_0xde10('0x20')],{'raw':_0x4a9a79[_0xde10('0x21')]?_0x4a9a79[_0xde10('0x21')][_0xde10('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a9a79[_0xde10('0x21')]?_0x4a9a79['options'][_0xde10('0x23')]||null:null,'attributes':_0x4a9a79['options']?_0x4a9a79[_0xde10('0x21')][_0xde10('0x24')]||null:null,'limit':_0x4a9a79[_0xde10('0x21')]?_0x4a9a79[_0xde10('0x21')][_0xde10('0x25')]||null:null})[_0xde10('0x12')](function(_0x2bf2fe){logger[_0xde10('0x13')](_0xde10('0x1e'),_0x4a9a79);logger['debug'](_0xde10('0x1e'),_0x4a9a79,JSON[_0xde10('0x18')](_0x2bf2fe));_0x51c0a3(_0x2bf2fe);})['catch'](function(_0x5af091){logger[_0xde10('0x19')](_0xde10('0x1e'),_0x5af091[_0xde10('0x1b')],_0x4a9a79);_0x18188c(_0x287ea6[_0xde10('0x19')](0x1f4,_0x5af091[_0xde10('0x1b')]));});});};exports[_0xde10('0x26')]=function(_0x33b23a){return new Promise(function(_0x3d1942,_0xf0a195){return db['SmsInteraction'][_0xde10('0x27')]({'where':_0x33b23a[_0xde10('0x21')]?_0x33b23a['options'][_0xde10('0x23')]||null:null})[_0xde10('0x12')](function(_0x3de9d9){if(_0x3de9d9){return _0x3de9d9['addTags'](_0x33b23a[_0xde10('0x20')][_0xde10('0x28')],_[_0xde10('0x29')](_0x33b23a['body'],[_0xde10('0x28'),'id'])||{});}})[_0xde10('0x2a')](function(_0x527575){logger[_0xde10('0x13')](_0xde10('0x2b'),_0x33b23a);logger[_0xde10('0x16')](_0xde10('0x2b'),_0x33b23a,JSON[_0xde10('0x18')](_0x527575));_0x3d1942(_0x527575);})['catch'](function(_0x1aa1fc){logger['error'](_0xde10('0x2b'),_0x1aa1fc[_0xde10('0x1b')],_0x33b23a);_0xf0a195(_this[_0xde10('0x19')](0x1f4,_0x1aa1fc[_0xde10('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index dc0387e..579f7b7 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 _0x0210=['save','remove','update','removeListener','register','length'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0210,0x1ce));var _0x0021=function(_0x22c29e,_0x2490cf){_0x22c29e=_0x22c29e-0x0;var _0x1633d5=_0x0210[_0x22c29e];return _0x1633d5;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0021('0x0'),_0x0021('0x1'),_0x0021('0x2')];function createListener(_0x1054e7,_0x3aada0){return function(_0xe3903a){_0x3aada0['emit'](_0x1054e7,_0xe3903a);};}function removeListener(_0x261773,_0x16e298){return function(){SmsInteractionEvents[_0x0021('0x3')](_0x261773,_0x16e298);};}exports[_0x0021('0x4')]=function(_0x1bf2f8){for(var _0x790d65=0x0,_0x33d058=events[_0x0021('0x5')];_0x790d65<_0x33d058;_0x790d65++){var _0x10eb82=events[_0x790d65];var _0x2b3ca4=createListener('smsInteraction:'+_0x10eb82,_0x1bf2f8);SmsInteractionEvents['on'](_0x10eb82,_0x2b3ca4);}}; \ No newline at end of file +var _0x9f29=['length','smsInteraction:','./smsInteraction.events','update','emit','removeListener'];(function(_0x4de86c,_0x1decae){var _0x2656f8=function(_0x34481e){while(--_0x34481e){_0x4de86c['push'](_0x4de86c['shift']());}};_0x2656f8(++_0x1decae);}(_0x9f29,0x122));var _0x99f2=function(_0x1b2741,_0x1db6f2){_0x1b2741=_0x1b2741-0x0;var _0x184ce7=_0x9f29[_0x1b2741];return _0x184ce7;};'use strict';var SmsInteractionEvents=require(_0x99f2('0x0'));var events=['save','remove',_0x99f2('0x1')];function createListener(_0x1e1061,_0x5d22ac){return function(_0x566722){_0x5d22ac[_0x99f2('0x2')](_0x1e1061,_0x566722);};}function removeListener(_0x52abb6,_0x8d31a3){return function(){SmsInteractionEvents[_0x99f2('0x3')](_0x52abb6,_0x8d31a3);};}exports['register']=function(_0x5c9c50){for(var _0xdd1bb8=0x0,_0x2ce92f=events[_0x99f2('0x4')];_0xdd1bb8<_0x2ce92f;_0xdd1bb8++){var _0x2515e0=events[_0xdd1bb8];var _0x37e423=createListener(_0x99f2('0x5')+_0x2515e0,_0x5c9c50);SmsInteractionEvents['on'](_0x2515e0,_0x37e423);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index ce1c401..5a0d39a 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 _0xb7f1=['get','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','path','connect-timeout','express','fs-extra','isAuthenticated'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xb7f1,0xa3));var _0x1b7f=function(_0x54af60,_0x2e0b52){_0x54af60=_0x54af60-0x0;var _0x5b674d=_0xb7f1[_0x54af60];return _0x5b674d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b7f('0x0'));var timeout=require(_0x1b7f('0x1'));var express=require(_0x1b7f('0x2'));var router=express['Router']();var fs_extra=require(_0x1b7f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth[_0x1b7f('0x4')](),controller['index']);router[_0x1b7f('0x5')](_0x1b7f('0x6'),auth[_0x1b7f('0x4')](),controller[_0x1b7f('0x7')]);router['get'](_0x1b7f('0x8'),auth[_0x1b7f('0x4')](),controller[_0x1b7f('0x9')]);router[_0x1b7f('0xa')]('/',auth[_0x1b7f('0x4')](),interaction[_0x1b7f('0xb')](_0x1b7f('0xc'),_0x1b7f('0xd')),controller[_0x1b7f('0xe')]);router['post'](_0x1b7f('0xf'),controller[_0x1b7f('0x10')]);router[_0x1b7f('0x11')]('/:id',auth[_0x1b7f('0x4')](),controller[_0x1b7f('0x12')]);router[_0x1b7f('0x11')](_0x1b7f('0x13'),auth[_0x1b7f('0x4')](),controller[_0x1b7f('0x14')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x1b7f('0x15')]);router[_0x1b7f('0x16')](_0x1b7f('0x8'),auth[_0x1b7f('0x4')](),controller[_0x1b7f('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2a6f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','sms','create','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x58bb87,_0x1b702c){var _0x4cab9c=function(_0x3a141f){while(--_0x3a141f){_0x58bb87['push'](_0x58bb87['shift']());}};_0x4cab9c(++_0x1b702c);}(_0x2a6f,0x15b));var _0xf2a6=function(_0x30ceee,_0x2cfcc5){_0x30ceee=_0x30ceee-0x0;var _0x527df1=_0x2a6f[_0x30ceee];return _0x527df1;};'use strict';var multer=require(_0xf2a6('0x0'));var util=require(_0xf2a6('0x1'));var path=require(_0xf2a6('0x2'));var timeout=require(_0xf2a6('0x3'));var express=require('express');var router=express[_0xf2a6('0x4')]();var fs_extra=require(_0xf2a6('0x5'));var auth=require(_0xf2a6('0x6'));var interaction=require(_0xf2a6('0x7'));var config=require(_0xf2a6('0x8'));var controller=require(_0xf2a6('0x9'));router[_0xf2a6('0xa')]('/',auth[_0xf2a6('0xb')](),controller[_0xf2a6('0xc')]);router[_0xf2a6('0xa')]('/describe',auth[_0xf2a6('0xb')](),controller[_0xf2a6('0xd')]);router['get'](_0xf2a6('0xe'),auth[_0xf2a6('0xb')](),controller[_0xf2a6('0xf')]);router[_0xf2a6('0x10')]('/',auth[_0xf2a6('0xb')](),interaction['tracked'](_0xf2a6('0x11'),'smsmessage:create'),controller[_0xf2a6('0x12')]);router[_0xf2a6('0x10')]('/:id/status',controller[_0xf2a6('0x13')]);router[_0xf2a6('0x14')](_0xf2a6('0xe'),auth[_0xf2a6('0xb')](),controller['update']);router[_0xf2a6('0x14')](_0xf2a6('0x15'),auth[_0xf2a6('0xb')](),controller[_0xf2a6('0x16')]);router[_0xf2a6('0x14')](_0xf2a6('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0xf2a6('0x18')](_0xf2a6('0xe'),auth['isAuthenticated'](),controller[_0xf2a6('0x19')]);module[_0xf2a6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index f161bdc..6b11496 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 _0x90c8=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x1e7345,_0x18bcce){var _0x33017c=function(_0x2b274f){while(--_0x2b274f){_0x1e7345['push'](_0x1e7345['shift']());}};_0x33017c(++_0x18bcce);}(_0x90c8,0x1eb));var _0x890c=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x90c8[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0x890c('0x0'));module[_0x890c('0x1')]={'body':{'type':Sequelize[_0x890c('0x2')](_0x890c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x890c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x890c('0x5')]('in','out'),'defaultValue':_0x890c('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x890c('0x7')](0xbe)},'phone':{'type':Sequelize[_0x890c('0x7')]},'readAt':{'type':Sequelize[_0x890c('0x8')]},'secret':{'type':Sequelize[_0x890c('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x890c('0x7')]},'providerResponse':{'type':Sequelize[_0x890c('0x2')]}}; \ No newline at end of file +var _0xf903=['out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x4c4e25,_0x10352a){var _0x270ccc=function(_0x537e92){while(--_0x537e92){_0x4c4e25['push'](_0x4c4e25['shift']());}};_0x270ccc(++_0x10352a);}(_0xf903,0x174));var _0x3f90=function(_0x5247c6,_0x104de2){_0x5247c6=_0x5247c6-0x0;var _0x312312=_0xf903[_0x5247c6];return _0x312312;};'use strict';var Sequelize=require(_0x3f90('0x0'));module[_0x3f90('0x1')]={'body':{'type':Sequelize[_0x3f90('0x2')](_0x3f90('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3f90('0x4')),'defaultValue':_0x3f90('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3f90('0x5')](0xbe)},'phone':{'type':Sequelize[_0x3f90('0x5')]},'readAt':{'type':Sequelize[_0x3f90('0x6')]},'secret':{'type':Sequelize[_0x3f90('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3f90('0x5')]},'providerResponse':{'type':Sequelize[_0x3f90('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index fea093a..03d778d 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 _0xda20=['interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','rejectMessage','QueryTypes','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','plivio','infobip','results','groupName','DELIVERED','eml-format','zip-dir','moment','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','http','client','request','then','SmsMessage,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','end','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','show','includeAll','find','body','params','../../config/logger','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda20,0x1d9));var _0x0da2=function(_0x3680e6,_0xeecc2e){_0x3680e6=_0x3680e6-0x0;var _0x511190=_0xda20[_0x3680e6];return _0x511190;};'use strict';var emlformat=require(_0x0da2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0da2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0da2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0da2('0x3'));var util=require(_0x0da2('0x4'));var path=require('path');var sox=require(_0x0da2('0x5'));var csv=require(_0x0da2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0da2('0x7'));var _=require(_0x0da2('0x8'));var squel=require(_0x0da2('0x9'));var crypto=require(_0x0da2('0xa'));var jsforce=require(_0x0da2('0xb'));var deskjs=require(_0x0da2('0xc'));var toCsv=require(_0x0da2('0x6'));var querystring=require(_0x0da2('0xd'));var Papa=require(_0x0da2('0xe'));var Redis=require('ioredis');var authService=require(_0x0da2('0xf'));var qs=require(_0x0da2('0x10'));var as=require(_0x0da2('0x11'));var hardwareService=require(_0x0da2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0da2('0x13'));var config=require(_0x0da2('0x14'));var licenseUtil=require(_0x0da2('0x15'));var db=require(_0x0da2('0x16'))['db'];config[_0x0da2('0x17')]=_[_0x0da2('0x18')](config[_0x0da2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0da2('0x19'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x0da2('0x1a'));var client=jayson['client'][_0x0da2('0x1b')]({'port':0x232c});var client9002=jayson[_0x0da2('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0613c,_0x65f77,_0x52c310,_0x10e8f7){return new BPromise(function(_0x192772,_0x2150ed){var _0x5bd0a7=_0x10e8f7||client;return _0x5bd0a7[_0x0da2('0x1d')](_0xa0613c,_0x52c310)[_0x0da2('0x1e')](function(_0x484c1a){logger['info'](_0x0da2('0x1f'),_0x65f77,'request\x20sent');logger[_0x0da2('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x65f77,'request\x20sent',JSON['stringify'](_0x484c1a));if(_0x484c1a['error']){if(_0x484c1a[_0x0da2('0x21')][_0x0da2('0x22')]===0x1f4){logger[_0x0da2('0x21')]('SmsMessage,\x20%s,\x20%s',_0x65f77,_0x484c1a['error']['message']);return _0x2150ed(_0x484c1a[_0x0da2('0x21')][_0x0da2('0x23')]);}logger[_0x0da2('0x21')](_0x0da2('0x1f'),_0x65f77,_0x484c1a[_0x0da2('0x21')]['message']);return _0x192772(_0x484c1a[_0x0da2('0x21')][_0x0da2('0x23')]);}else{logger[_0x0da2('0x24')](_0x0da2('0x1f'),_0x65f77,_0x0da2('0x25'));_0x192772(_0x484c1a[_0x0da2('0x26')][_0x0da2('0x23')]);}})[_0x0da2('0x27')](function(_0x3604d3){logger['error'](_0x0da2('0x1f'),_0x65f77,_0x3604d3);_0x2150ed(_0x3604d3);});});}function respondWithStatusCode(_0x4a98a9,_0x40fc6a){_0x40fc6a=_0x40fc6a||0xcc;return function(_0x437090){if(_0x437090){return _0x4a98a9[_0x0da2('0x28')](_0x40fc6a);}return _0x4a98a9[_0x0da2('0x29')](_0x40fc6a)['end']();};}function respondWithResult(_0x1e9ac4,_0x2a931d){_0x2a931d=_0x2a931d||0xc8;return function(_0x2ea8c2){if(_0x2ea8c2){return _0x1e9ac4[_0x0da2('0x29')](_0x2a931d)[_0x0da2('0x2a')](_0x2ea8c2);}};}function respondWithFilteredResult(_0x5083e0,_0x1b657d){return function(_0x538970){if(_0x538970){var _0x525dc=typeof _0x1b657d[_0x0da2('0x2b')]===_0x0da2('0x2c')&&typeof _0x1b657d[_0x0da2('0x2d')]===_0x0da2('0x2c');var _0x103857=_0x538970[_0x0da2('0x2e')];var _0x3c5460=_0x525dc?0x0:_0x1b657d[_0x0da2('0x2b')];var _0x20d591=_0x525dc?_0x538970[_0x0da2('0x2e')]:_0x1b657d['offset']+_0x1b657d['limit'];var _0x51a83e;if(_0x20d591>=_0x103857){_0x20d591=_0x103857;_0x51a83e=0xc8;}else{_0x51a83e=0xce;}_0x5083e0[_0x0da2('0x29')](_0x51a83e);return _0x5083e0[_0x0da2('0x2f')]('Content-Range',_0x3c5460+'-'+_0x20d591+'/'+_0x103857)['json'](_0x538970);}return null;};}function patchUpdates(_0x1c4ea4){return function(_0x1c50ed){try{jsonpatch[_0x0da2('0x30')](_0x1c50ed,_0x1c4ea4,!![]);}catch(_0x1e6a75){return BPromise['reject'](_0x1e6a75);}return _0x1c50ed[_0x0da2('0x31')]();};}function saveUpdates(_0x533ded,_0x281829){return function(_0x5fccd){if(_0x5fccd){return _0x5fccd[_0x0da2('0x32')](_0x533ded)[_0x0da2('0x1e')](function(_0x22bc34){return _0x22bc34;});}return null;};}function removeEntity(_0x411fa2,_0x292053){return function(_0x51ffe0){if(_0x51ffe0){return _0x51ffe0[_0x0da2('0x33')]()[_0x0da2('0x1e')](function(){_0x411fa2[_0x0da2('0x29')](0xcc)[_0x0da2('0x34')]();});}};}function handleEntityNotFound(_0x2cfddc,_0x1b3c60){return function(_0x540c8f){if(!_0x540c8f){_0x2cfddc[_0x0da2('0x28')](0x194);}return _0x540c8f;};}function handleError(_0x390cb9,_0x314ea2){_0x314ea2=_0x314ea2||0x1f4;return function(_0x21caef){logger['error'](_0x21caef['stack']);if(_0x21caef[_0x0da2('0x35')]){delete _0x21caef[_0x0da2('0x35')];}_0x390cb9[_0x0da2('0x29')](_0x314ea2)[_0x0da2('0x36')](_0x21caef);};}exports[_0x0da2('0x37')]=function(_0x124dbc,_0xe4bf41){var _0x306704={},_0x267333={},_0x52c64b={'count':0x0,'rows':[]};var _0x3e1e0f=_[_0x0da2('0x38')](db[_0x0da2('0x39')][_0x0da2('0x3a')],function(_0x296f9c){return{'name':_0x296f9c[_0x0da2('0x3b')],'type':_0x296f9c[_0x0da2('0x3c')][_0x0da2('0x3d')]};});_0x267333['model']=_[_0x0da2('0x38')](_0x3e1e0f,'name');_0x267333['query']=_[_0x0da2('0x3e')](_0x124dbc['query']);_0x267333[_0x0da2('0x3f')]=_[_0x0da2('0x40')](_0x267333[_0x0da2('0x41')],_0x267333[_0x0da2('0x42')]);_0x306704['attributes']=_[_0x0da2('0x40')](_0x267333[_0x0da2('0x41')],qs[_0x0da2('0x43')](_0x124dbc[_0x0da2('0x42')][_0x0da2('0x43')]));_0x306704[_0x0da2('0x44')]=_0x306704[_0x0da2('0x44')][_0x0da2('0x45')]?_0x306704['attributes']:_0x267333['model'];if(!_0x124dbc[_0x0da2('0x42')]['hasOwnProperty'](_0x0da2('0x46'))){_0x306704['limit']=qs[_0x0da2('0x2d')](_0x124dbc['query']['limit']);_0x306704['offset']=qs[_0x0da2('0x2b')](_0x124dbc[_0x0da2('0x42')][_0x0da2('0x2b')]);}_0x306704[_0x0da2('0x47')]=qs['sort'](_0x124dbc[_0x0da2('0x42')]['sort']);_0x306704[_0x0da2('0x48')]=qs[_0x0da2('0x3f')](_['pick'](_0x124dbc[_0x0da2('0x42')],_0x267333[_0x0da2('0x3f')]),_0x3e1e0f);if(_0x124dbc[_0x0da2('0x42')][_0x0da2('0x49')]){_0x306704['where']=_[_0x0da2('0x4a')](_0x306704[_0x0da2('0x48')],{'$or':_['map'](_0x3e1e0f,function(_0x3bddc9){if(_0x3bddc9[_0x0da2('0x3c')]!==_0x0da2('0x4b')){var _0x1b35da={};_0x1b35da[_0x3bddc9['name']]={'$like':'%'+_0x124dbc[_0x0da2('0x42')]['filter']+'%'};return _0x1b35da;}})});}_0x306704=_[_0x0da2('0x4a')]({},_0x306704,_0x124dbc[_0x0da2('0x4c')]);var _0x1cb401={'where':_0x306704[_0x0da2('0x48')]};return db[_0x0da2('0x39')]['count'](_0x1cb401)[_0x0da2('0x1e')](function(_0xbdcb74){_0x52c64b[_0x0da2('0x2e')]=_0xbdcb74;if(_0x124dbc[_0x0da2('0x42')]['includeAll']){_0x306704[_0x0da2('0x4d')]=[{'all':!![]}];}return db[_0x0da2('0x39')][_0x0da2('0x4e')](_0x306704);})[_0x0da2('0x1e')](function(_0x30d2b8){_0x52c64b['rows']=_0x30d2b8;return _0x52c64b;})[_0x0da2('0x1e')](respondWithFilteredResult(_0xe4bf41,_0x306704))[_0x0da2('0x27')](handleError(_0xe4bf41,null));};exports[_0x0da2('0x4f')]=function(_0x340465,_0x11d253){var _0x2cf49d={'raw':!![],'where':{'id':_0x340465['params']['id']}},_0xd3d356={};_0xd3d356[_0x0da2('0x41')]=_['keys'](db['SmsMessage']['rawAttributes']);_0xd3d356[_0x0da2('0x42')]=_[_0x0da2('0x3e')](_0x340465[_0x0da2('0x42')]);_0xd3d356[_0x0da2('0x3f')]=_['intersection'](_0xd3d356[_0x0da2('0x41')],_0xd3d356['query']);_0x2cf49d['attributes']=_['intersection'](_0xd3d356[_0x0da2('0x41')],qs[_0x0da2('0x43')](_0x340465[_0x0da2('0x42')][_0x0da2('0x43')]));_0x2cf49d['attributes']=_0x2cf49d[_0x0da2('0x44')][_0x0da2('0x45')]?_0x2cf49d[_0x0da2('0x44')]:_0xd3d356[_0x0da2('0x41')];if(_0x340465[_0x0da2('0x42')][_0x0da2('0x50')]){_0x2cf49d[_0x0da2('0x4d')]=[{'all':!![]}];}_0x2cf49d=_['merge']({},_0x2cf49d,_0x340465[_0x0da2('0x4c')]);return db[_0x0da2('0x39')][_0x0da2('0x51')](_0x2cf49d)[_0x0da2('0x1e')](handleEntityNotFound(_0x11d253,null))[_0x0da2('0x1e')](respondWithResult(_0x11d253,null))['catch'](handleError(_0x11d253,null));};exports['create']=function(_0x3ef997,_0x34f672){return db['SmsMessage']['create'](_0x3ef997[_0x0da2('0x52')],{})[_0x0da2('0x1e')](respondWithResult(_0x34f672,0xc9))[_0x0da2('0x27')](handleError(_0x34f672,null));};exports[_0x0da2('0x32')]=function(_0x8c48d6,_0x103d11){if(_0x8c48d6[_0x0da2('0x52')]['id']){delete _0x8c48d6[_0x0da2('0x52')]['id'];}return db[_0x0da2('0x39')][_0x0da2('0x51')]({'where':{'id':_0x8c48d6[_0x0da2('0x53')]['id']}})[_0x0da2('0x1e')](handleEntityNotFound(_0x103d11,null))[_0x0da2('0x1e')](saveUpdates(_0x8c48d6[_0x0da2('0x52')],null))['then'](respondWithResult(_0x103d11,null))[_0x0da2('0x27')](handleError(_0x103d11,null));};exports['destroy']=function(_0x47abf2,_0x3a2295){return db[_0x0da2('0x39')][_0x0da2('0x51')]({'where':{'id':_0x47abf2[_0x0da2('0x53')]['id']}})[_0x0da2('0x1e')](handleEntityNotFound(_0x3a2295,null))[_0x0da2('0x1e')](removeEntity(_0x3a2295,null))[_0x0da2('0x27')](handleError(_0x3a2295,null));};exports['describe']=function(_0x50abf1,_0x46fa1a){return db['SmsMessage']['describe']()[_0x0da2('0x1e')](respondWithResult(_0x46fa1a,null))[_0x0da2('0x27')](handleError(_0x46fa1a,null));};var interaction_log=require(_0x0da2('0x54'))(_0x0da2('0x55'));exports[_0x0da2('0x56')]=function(_0x148280,_0x571728,_0x3afc3f){var _0xd2d895={'agent':{},'channel':_0x0da2('0x57')};if(_0x148280[_0x0da2('0x52')]['id']){delete _0x148280['body']['id'];}_0x148280[_0x0da2('0x52')][_0x0da2('0x58')]=!![];_0x148280['body'][_0x0da2('0x59')]=moment()['format'](_0x0da2('0x5a'));_0x148280[_0x0da2('0x52')][_0x0da2('0x5b')]=_0x148280[_0x0da2('0x52')][_0x0da2('0x5b')]||_0x148280[_0x0da2('0x5c')]['id'];_0xd2d895['agent']['id']=_0x148280['body']['UserId'];return db[_0x0da2('0x39')][_0x0da2('0x51')]({'where':{'id':_0x148280[_0x0da2('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x571728,null))['then'](saveUpdates(_0x148280[_0x0da2('0x52')],null))['then'](function(_0x3e4681){if(_0x3e4681){_0xd2d895[_0x0da2('0x23')]=_0x3e4681[_0x0da2('0x5d')]({'plain':!![]});return db[_0x0da2('0x5e')][_0x0da2('0x51')]({'where':{'id':_0x3e4681[_0x0da2('0x5f')]}});}return null;})[_0x0da2('0x1e')](handleEntityNotFound(_0x571728,null))[_0x0da2('0x1e')](function(_0x5c3944){if(_0x5c3944){return _0x5c3944['update']({'UserId':_0x148280['body'][_0x0da2('0x5b')],'read1stAt':_[_0x0da2('0x60')](_0x5c3944[_0x0da2('0x61')])?moment()[_0x0da2('0x62')](_0x0da2('0x5a')):undefined});}return null;})[_0x0da2('0x1e')](function(_0x220d4d){if(_0x220d4d){_0xd2d895[_0x0da2('0x63')]=_0x220d4d[_0x0da2('0x5d')]({'plain':!![]});interaction_log[_0x0da2('0x24')](_0x0da2('0x64'),_0x148280[_0x0da2('0x5c')]['id'],_0x148280[_0x0da2('0x5c')][_0x0da2('0x35')],_0x148280[_0x0da2('0x5c')]['role'],_0xd2d895[_0x0da2('0x63')]['id'],_0x148280[_0x0da2('0x52')]?JSON['stringify'](_0x148280[_0x0da2('0x52')]):_0x0da2('0x65'));return respondWithRpcPromise(_0x0da2('0x66'),_0x0da2('0x67'),_0xd2d895);}return null;})['then'](function(_0x521368){var _0x415ce3=_0x0da2('0x68')+_0x521368[_0x0da2('0x23')][_0x0da2('0x69')];return db[_0x0da2('0x6a')][_0x0da2('0x42')](_0x415ce3,{'type':db[_0x0da2('0x6b')]['QueryTypes'][_0x0da2('0x6c')],'raw':!![]})[_0x0da2('0x1e')](function(_0x1806df){return _0x1806df;});})[_0x0da2('0x1e')](function(_0x19cfd0){if(_0x19cfd0){_0xd2d895['message'][_0x0da2('0x6d')]=_0x19cfd0[0x0];if(!_0x148280[_0x0da2('0x52')]['UserId'])return;return db[_0x0da2('0x6e')][_0x0da2('0x51')]({'where':{'id':_0x148280[_0x0da2('0x52')][_0x0da2('0x5b')],'role':_0x0da2('0x6f')},'attributes':['id',_0x0da2('0x35'),_0x0da2('0x70'),_0x0da2('0x71'),_0x0da2('0x72')],'raw':!![]});}return null;})[_0x0da2('0x1e')](function(_0x169f2b){if(!_0x169f2b)return null;_0xd2d895[_0x0da2('0x23')]['agent']=_0x169f2b;return _0xd2d895;})['then'](function(_0xbf4feb){if(_0xbf4feb){if(_0x148280[_0x0da2('0x52')]['manual']){_0xd2d895[_0x0da2('0x23')][_0x0da2('0x73')]=util[_0x0da2('0x62')](_0x0da2('0x74'),_0x148280[_0x0da2('0x5c')][_0x0da2('0x35')]);_0xd2d895[_0x0da2('0x23')][_0x0da2('0x75')]=_0xd2d895['channel'];_0xd2d895[_0x0da2('0x23')][_0x0da2('0x76')]=_0xd2d895[_0x0da2('0x75')];_0xd2d895[_0x0da2('0x23')][_0x0da2('0x77')]=_0x0da2('0x56');return respondWithRpcPromise(_0x0da2('0x78'),_0x0da2('0x78'),{'event':_0x0da2('0x79'),'message':_0xd2d895['message']},client9002)['then'](function(){return _0xd2d895;});}return _0xd2d895;}return null;})[_0x0da2('0x1e')](respondWithResult(_0x571728,null))['catch'](handleError(_0x571728,null));};var interaction_log=require('../../config/logger')(_0x0da2('0x55'));exports[_0x0da2('0x7a')]=function(_0x125ee2,_0x2acf0b,_0xf4fdc1){var _0xb9a70b={'agent':{},'channel':_0x0da2('0x57')};if(_0x125ee2[_0x0da2('0x52')]['id']){delete _0x125ee2[_0x0da2('0x52')]['id'];}_0x125ee2['body'][_0x0da2('0x5b')]=_0x125ee2[_0x0da2('0x52')][_0x0da2('0x5b')]||_0x125ee2['user']['id'];_0xb9a70b[_0x0da2('0x6f')]['id']=_0x125ee2[_0x0da2('0x52')][_0x0da2('0x5b')];return db[_0x0da2('0x39')][_0x0da2('0x51')]({'where':{'id':_0x125ee2[_0x0da2('0x53')]['id'],'UserId':null}})[_0x0da2('0x1e')](handleEntityNotFound(_0x2acf0b,null))[_0x0da2('0x1e')](function(_0x420c04){if(_0x420c04){_0xb9a70b[_0x0da2('0x23')]=_0x420c04[_0x0da2('0x5d')]({'plain':!![]});return db['SmsInteraction'][_0x0da2('0x51')]({'where':{'id':_0x420c04[_0x0da2('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x2acf0b,null))[_0x0da2('0x1e')](function(_0x5b0cf0){if(_0x5b0cf0){_0xb9a70b[_0x0da2('0x63')]=_0x5b0cf0[_0x0da2('0x5d')]({'plain':!![]});interaction_log[_0x0da2('0x24')](_0x0da2('0x7b'),_0x125ee2[_0x0da2('0x5c')]['id'],_0x125ee2[_0x0da2('0x5c')][_0x0da2('0x35')],_0x125ee2['user'][_0x0da2('0x7c')],_0xb9a70b[_0x0da2('0x63')]['id'],_0x125ee2['body']?JSON[_0x0da2('0x7d')](_0x125ee2[_0x0da2('0x52')]):_0x0da2('0x65'));return respondWithRpcPromise('RejectMessage',_0x0da2('0x7e'),_0xb9a70b);}return null;})[_0x0da2('0x1e')](function(_0x1c62a0){var _0x4abdd6=_0x0da2('0x68')+_0x1c62a0[_0x0da2('0x23')][_0x0da2('0x69')];return db[_0x0da2('0x6a')][_0x0da2('0x42')](_0x4abdd6,{'type':db[_0x0da2('0x6b')][_0x0da2('0x7f')][_0x0da2('0x6c')],'raw':!![]})[_0x0da2('0x1e')](function(_0x35ffcd){return _0x35ffcd;});})[_0x0da2('0x1e')](function(_0x70da18){if(_0x70da18){_0xb9a70b[_0x0da2('0x23')][_0x0da2('0x6d')]=_0x70da18[0x0];if(!_0x125ee2[_0x0da2('0x52')][_0x0da2('0x5b')])return;return db['User'][_0x0da2('0x51')]({'where':{'id':_0x125ee2[_0x0da2('0x52')][_0x0da2('0x5b')],'role':_0x0da2('0x6f')},'attributes':['id',_0x0da2('0x35'),_0x0da2('0x70'),_0x0da2('0x71'),_0x0da2('0x72')],'raw':!![]});}return null;})[_0x0da2('0x1e')](function(_0x5b4095){if(!_0x5b4095)return null;_0xb9a70b[_0x0da2('0x23')][_0x0da2('0x6f')]=_0x5b4095;return _0xb9a70b;})[_0x0da2('0x1e')](function(_0x274896){if(_0x274896){_0x274896['message']['interface']=util[_0x0da2('0x62')](_0x0da2('0x74'),_0x125ee2[_0x0da2('0x5c')][_0x0da2('0x35')]);_0x274896['message'][_0x0da2('0x75')]=_0xb9a70b[_0x0da2('0x75')];_0x274896[_0x0da2('0x23')][_0x0da2('0x76')]=_0xb9a70b[_0x0da2('0x75')];_0x274896['message'][_0x0da2('0x77')]='reject';respondWithRpcPromise(_0x0da2('0x78'),_0x0da2('0x78'),{'event':'rejectmessage','message':_0x274896[_0x0da2('0x23')]},client9002);return _0xb9a70b;}return null;})['then'](respondWithResult(_0x2acf0b,null))['catch'](handleError(_0x2acf0b,null));};exports[_0x0da2('0x29')]=function(_0x2100cd,_0x9000eb,_0x4dad70){if(_0x2100cd[_0x0da2('0x52')]['id']){delete _0x2100cd[_0x0da2('0x52')]['id'];}var _0x55953c;return db[_0x0da2('0x39')][_0x0da2('0x51')]({'where':{'id':_0x2100cd[_0x0da2('0x53')]['id']}})[_0x0da2('0x1e')](handleEntityNotFound(_0x9000eb,null))[_0x0da2('0x1e')](function(_0x32ddab){if(_0x32ddab){_0x55953c=_0x32ddab;return db['SmsAccount'][_0x0da2('0x51')]({'where':{'id':_0x32ddab[_0x0da2('0x80')]}});}})[_0x0da2('0x1e')](handleEntityNotFound(_0x9000eb,null))[_0x0da2('0x1e')](function(_0x4f8825){if(_0x4f8825){logger[_0x0da2('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x4f8825[_0x0da2('0x3c')],util[_0x0da2('0x81')](_0x2100cd[_0x0da2('0x52')],{'showHidden':![],'depth':null}));switch(_0x4f8825[_0x0da2('0x3c')]){case _0x0da2('0x82'):if(_0x2100cd['body'][_0x0da2('0x83')]&&_0x2100cd[_0x0da2('0x52')]['MessageSid']===_0x55953c[_0x0da2('0x84')]){return _0x55953c[_0x0da2('0x32')]({'read':!![]});}else{logger[_0x0da2('0x21')](_0x0da2('0x85'),_0x0da2('0x29'),'twilio',util[_0x0da2('0x81')](_0x2100cd['body'],{'showHidden':![],'depth':null}));}break;case _0x0da2('0x86'):if(_0x2100cd[_0x0da2('0x52')][_0x0da2('0x87')]&&_0x2100cd['body']['MessageUUID']===_0x55953c[_0x0da2('0x84')]&&_['indexOf']([_0x0da2('0x88'),_0x0da2('0x89')],_0x2100cd['body']['Status'])>=0x0){return _0x55953c[_0x0da2('0x32')]({'read':!![]});}else{logger[_0x0da2('0x21')](_0x0da2('0x85'),_0x0da2('0x29'),_0x0da2('0x8a'),util[_0x0da2('0x81')](_0x2100cd['body'],{'showHidden':![],'depth':null}));}break;case _0x0da2('0x8b'):var _0xf1b6eb=_0x2100cd[_0x0da2('0x52')][_0x0da2('0x8c')][0x0];if(_0xf1b6eb[_0x0da2('0x29')][_0x0da2('0x8d')]===_0x0da2('0x8e')){return _0x55953c[_0x0da2('0x32')]({'read':!![]});}else{logger[_0x0da2('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0da2('0x29'),_0x0da2('0x8b'),util[_0x0da2('0x81')](_0x2100cd[_0x0da2('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x55953c;}})['then'](respondWithResult(_0x9000eb,null))[_0x0da2('0x27')](handleError(_0x9000eb,null));}; \ No newline at end of file +var _0x2542=['SmsInteractionId','isNil','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','Sequelize','SELECT','contact','User','email','internal','manual','interface','channel','event','EventManager','acceptmessage','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SIP/%s','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','request','then','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s','result','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','SmsInteraction'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x2542,0x169));var _0x2254=function(_0x45a9b8,_0x2f30ac){_0x45a9b8=_0x45a9b8-0x0;var _0x1b4ae3=_0x2542[_0x45a9b8];return _0x1b4ae3;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];config[_0x2254('0x1a')]=_[_0x2254('0x1b')](config[_0x2254('0x1a')],{'host':_0x2254('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2254('0x1a')]));require(_0x2254('0x1d'))['register'](socket);var jayson=require(_0x2254('0x1e'));var client=jayson[_0x2254('0x1f')][_0x2254('0x20')]({'port':0x232c});var client9002=jayson[_0x2254('0x1f')][_0x2254('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xbc5548,_0x50f137,_0x18baf4,_0x57247a){return new BPromise(function(_0x327d6d,_0x2a2470){var _0x170ffa=_0x57247a||client;return _0x170ffa[_0x2254('0x21')](_0xbc5548,_0x18baf4)[_0x2254('0x22')](function(_0x34f90e){logger['info']('SmsMessage,\x20%s,\x20%s',_0x50f137,'request\x20sent');logger[_0x2254('0x23')](_0x2254('0x24'),_0x50f137,_0x2254('0x25'),JSON[_0x2254('0x26')](_0x34f90e));if(_0x34f90e[_0x2254('0x27')]){if(_0x34f90e[_0x2254('0x27')]['code']===0x1f4){logger[_0x2254('0x27')](_0x2254('0x28'),_0x50f137,_0x34f90e[_0x2254('0x27')]['message']);return _0x2a2470(_0x34f90e['error']['message']);}logger[_0x2254('0x27')](_0x2254('0x28'),_0x50f137,_0x34f90e[_0x2254('0x27')]['message']);return _0x327d6d(_0x34f90e['error']['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x50f137,'request\x20sent');_0x327d6d(_0x34f90e[_0x2254('0x29')][_0x2254('0x2a')]);}})[_0x2254('0x2b')](function(_0x265467){logger[_0x2254('0x27')](_0x2254('0x28'),_0x50f137,_0x265467);_0x2a2470(_0x265467);});});}function respondWithStatusCode(_0x51b578,_0x4a8274){_0x4a8274=_0x4a8274||0xcc;return function(_0x1ada42){if(_0x1ada42){return _0x51b578['sendStatus'](_0x4a8274);}return _0x51b578[_0x2254('0x2c')](_0x4a8274)[_0x2254('0x2d')]();};}function respondWithResult(_0x31a543,_0x3aa0bd){_0x3aa0bd=_0x3aa0bd||0xc8;return function(_0x19043b){if(_0x19043b){return _0x31a543['status'](_0x3aa0bd)[_0x2254('0x2e')](_0x19043b);}};}function respondWithFilteredResult(_0x2a789b,_0x21285d){return function(_0x37af8b){if(_0x37af8b){var _0x13366a=typeof _0x21285d[_0x2254('0x2f')]===_0x2254('0x30')&&typeof _0x21285d[_0x2254('0x31')]===_0x2254('0x30');var _0x221db9=_0x37af8b[_0x2254('0x32')];var _0xad7774=_0x13366a?0x0:_0x21285d[_0x2254('0x2f')];var _0x27d30a=_0x13366a?_0x37af8b[_0x2254('0x32')]:_0x21285d[_0x2254('0x2f')]+_0x21285d[_0x2254('0x31')];var _0x291894;if(_0x27d30a>=_0x221db9){_0x27d30a=_0x221db9;_0x291894=0xc8;}else{_0x291894=0xce;}_0x2a789b[_0x2254('0x2c')](_0x291894);return _0x2a789b['set'](_0x2254('0x33'),_0xad7774+'-'+_0x27d30a+'/'+_0x221db9)[_0x2254('0x2e')](_0x37af8b);}return null;};}function patchUpdates(_0x765e8e){return function(_0x157f4d){try{jsonpatch[_0x2254('0x34')](_0x157f4d,_0x765e8e,!![]);}catch(_0x1d275b){return BPromise[_0x2254('0x35')](_0x1d275b);}return _0x157f4d[_0x2254('0x36')]();};}function saveUpdates(_0x5b84ce,_0x59c6c9){return function(_0x835a0e){if(_0x835a0e){return _0x835a0e[_0x2254('0x37')](_0x5b84ce)['then'](function(_0x240d4e){return _0x240d4e;});}return null;};}function removeEntity(_0x135e7c,_0x21df8c){return function(_0x16d8f3){if(_0x16d8f3){return _0x16d8f3['destroy']()['then'](function(){_0x135e7c[_0x2254('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d620a,_0x10d749){return function(_0x2ba6a1){if(!_0x2ba6a1){_0x3d620a[_0x2254('0x38')](0x194);}return _0x2ba6a1;};}function handleError(_0x12428a,_0x2707f4){_0x2707f4=_0x2707f4||0x1f4;return function(_0x198b82){logger['error'](_0x198b82[_0x2254('0x39')]);if(_0x198b82[_0x2254('0x3a')]){delete _0x198b82[_0x2254('0x3a')];}_0x12428a[_0x2254('0x2c')](_0x2707f4)[_0x2254('0x3b')](_0x198b82);};}exports[_0x2254('0x3c')]=function(_0x3e7ccb,_0x24744a){var _0x122314={},_0x34543d={},_0x4f33de={'count':0x0,'rows':[]};var _0x2ce9bf=_[_0x2254('0x3d')](db[_0x2254('0x3e')][_0x2254('0x3f')],function(_0x4c7cc3){return{'name':_0x4c7cc3[_0x2254('0x40')],'type':_0x4c7cc3[_0x2254('0x41')][_0x2254('0x42')]};});_0x34543d[_0x2254('0x43')]=_[_0x2254('0x3d')](_0x2ce9bf,_0x2254('0x3a'));_0x34543d[_0x2254('0x44')]=_[_0x2254('0x45')](_0x3e7ccb['query']);_0x34543d[_0x2254('0x46')]=_['intersection'](_0x34543d[_0x2254('0x43')],_0x34543d[_0x2254('0x44')]);_0x122314[_0x2254('0x47')]=_[_0x2254('0x48')](_0x34543d[_0x2254('0x43')],qs[_0x2254('0x49')](_0x3e7ccb[_0x2254('0x44')]['fields']));_0x122314[_0x2254('0x47')]=_0x122314[_0x2254('0x47')][_0x2254('0x4a')]?_0x122314[_0x2254('0x47')]:_0x34543d[_0x2254('0x43')];if(!_0x3e7ccb['query'][_0x2254('0x4b')](_0x2254('0x4c'))){_0x122314[_0x2254('0x31')]=qs[_0x2254('0x31')](_0x3e7ccb[_0x2254('0x44')]['limit']);_0x122314[_0x2254('0x2f')]=qs['offset'](_0x3e7ccb[_0x2254('0x44')][_0x2254('0x2f')]);}_0x122314[_0x2254('0x4d')]=qs[_0x2254('0x4e')](_0x3e7ccb[_0x2254('0x44')][_0x2254('0x4e')]);_0x122314[_0x2254('0x4f')]=qs[_0x2254('0x46')](_[_0x2254('0x50')](_0x3e7ccb[_0x2254('0x44')],_0x34543d[_0x2254('0x46')]),_0x2ce9bf);if(_0x3e7ccb[_0x2254('0x44')][_0x2254('0x51')]){_0x122314['where']=_[_0x2254('0x52')](_0x122314[_0x2254('0x4f')],{'$or':_[_0x2254('0x3d')](_0x2ce9bf,function(_0x5cc8fc){if(_0x5cc8fc[_0x2254('0x41')]!==_0x2254('0x53')){var _0x400bb3={};_0x400bb3[_0x5cc8fc[_0x2254('0x3a')]]={'$like':'%'+_0x3e7ccb[_0x2254('0x44')][_0x2254('0x51')]+'%'};return _0x400bb3;}})});}_0x122314=_[_0x2254('0x52')]({},_0x122314,_0x3e7ccb[_0x2254('0x54')]);var _0x27eb3b={'where':_0x122314['where']};return db[_0x2254('0x3e')][_0x2254('0x32')](_0x27eb3b)[_0x2254('0x22')](function(_0x32515f){_0x4f33de[_0x2254('0x32')]=_0x32515f;if(_0x3e7ccb[_0x2254('0x44')][_0x2254('0x55')]){_0x122314[_0x2254('0x56')]=[{'all':!![]}];}return db[_0x2254('0x3e')][_0x2254('0x57')](_0x122314);})['then'](function(_0x36b977){_0x4f33de[_0x2254('0x58')]=_0x36b977;return _0x4f33de;})['then'](respondWithFilteredResult(_0x24744a,_0x122314))[_0x2254('0x2b')](handleError(_0x24744a,null));};exports[_0x2254('0x59')]=function(_0x12e2ff,_0x4331a9){var _0x5debf6={'raw':!![],'where':{'id':_0x12e2ff[_0x2254('0x5a')]['id']}},_0x102e4b={};_0x102e4b['model']=_[_0x2254('0x45')](db[_0x2254('0x3e')][_0x2254('0x3f')]);_0x102e4b[_0x2254('0x44')]=_['keys'](_0x12e2ff[_0x2254('0x44')]);_0x102e4b[_0x2254('0x46')]=_[_0x2254('0x48')](_0x102e4b['model'],_0x102e4b['query']);_0x5debf6[_0x2254('0x47')]=_[_0x2254('0x48')](_0x102e4b['model'],qs[_0x2254('0x49')](_0x12e2ff['query']['fields']));_0x5debf6[_0x2254('0x47')]=_0x5debf6[_0x2254('0x47')][_0x2254('0x4a')]?_0x5debf6[_0x2254('0x47')]:_0x102e4b[_0x2254('0x43')];if(_0x12e2ff['query']['includeAll']){_0x5debf6[_0x2254('0x56')]=[{'all':!![]}];}_0x5debf6=_['merge']({},_0x5debf6,_0x12e2ff[_0x2254('0x54')]);return db[_0x2254('0x3e')][_0x2254('0x5b')](_0x5debf6)[_0x2254('0x22')](handleEntityNotFound(_0x4331a9,null))['then'](respondWithResult(_0x4331a9,null))[_0x2254('0x2b')](handleError(_0x4331a9,null));};exports[_0x2254('0x5c')]=function(_0x49fe68,_0x4ec44b){return db[_0x2254('0x3e')]['create'](_0x49fe68[_0x2254('0x5d')],{})[_0x2254('0x22')](respondWithResult(_0x4ec44b,0xc9))[_0x2254('0x2b')](handleError(_0x4ec44b,null));};exports[_0x2254('0x37')]=function(_0x301a12,_0x53f65c){if(_0x301a12['body']['id']){delete _0x301a12[_0x2254('0x5d')]['id'];}return db['SmsMessage'][_0x2254('0x5b')]({'where':{'id':_0x301a12['params']['id']}})['then'](handleEntityNotFound(_0x53f65c,null))['then'](saveUpdates(_0x301a12[_0x2254('0x5d')],null))[_0x2254('0x22')](respondWithResult(_0x53f65c,null))[_0x2254('0x2b')](handleError(_0x53f65c,null));};exports[_0x2254('0x5e')]=function(_0x13606e,_0x1cf757){return db[_0x2254('0x3e')][_0x2254('0x5b')]({'where':{'id':_0x13606e[_0x2254('0x5a')]['id']}})[_0x2254('0x22')](handleEntityNotFound(_0x1cf757,null))[_0x2254('0x22')](removeEntity(_0x1cf757,null))[_0x2254('0x2b')](handleError(_0x1cf757,null));};exports[_0x2254('0x5f')]=function(_0x24e57a,_0x2f391d){return db[_0x2254('0x3e')][_0x2254('0x5f')]()[_0x2254('0x22')](respondWithResult(_0x2f391d,null))[_0x2254('0x2b')](handleError(_0x2f391d,null));};var interaction_log=require('../../config/logger')(_0x2254('0x60'));exports[_0x2254('0x61')]=function(_0x3b1aae,_0x38be3b,_0x4c966a){var _0x494347={'agent':{},'channel':_0x2254('0x62')};if(_0x3b1aae[_0x2254('0x5d')]['id']){delete _0x3b1aae[_0x2254('0x5d')]['id'];}_0x3b1aae[_0x2254('0x5d')][_0x2254('0x63')]=!![];_0x3b1aae['body'][_0x2254('0x64')]=moment()[_0x2254('0x65')](_0x2254('0x66'));_0x3b1aae['body']['UserId']=_0x3b1aae[_0x2254('0x5d')]['UserId']||_0x3b1aae[_0x2254('0x67')]['id'];_0x494347[_0x2254('0x68')]['id']=_0x3b1aae['body'][_0x2254('0x69')];return db[_0x2254('0x3e')]['find']({'where':{'id':_0x3b1aae[_0x2254('0x5a')]['id'],'UserId':null}})[_0x2254('0x22')](handleEntityNotFound(_0x38be3b,null))['then'](saveUpdates(_0x3b1aae['body'],null))[_0x2254('0x22')](function(_0xa159a4){if(_0xa159a4){_0x494347['message']=_0xa159a4['get']({'plain':!![]});return db[_0x2254('0x6a')]['find']({'where':{'id':_0xa159a4[_0x2254('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x38be3b,null))[_0x2254('0x22')](function(_0x7bdd46){if(_0x7bdd46){return _0x7bdd46[_0x2254('0x37')]({'UserId':_0x3b1aae[_0x2254('0x5d')]['UserId'],'read1stAt':_[_0x2254('0x6c')](_0x7bdd46['read1stAt'])?moment()[_0x2254('0x65')](_0x2254('0x66')):undefined});}return null;})['then'](function(_0x43211c){if(_0x43211c){_0x494347[_0x2254('0x6d')]=_0x43211c['get']({'plain':!![]});interaction_log[_0x2254('0x6e')](_0x2254('0x6f'),_0x3b1aae[_0x2254('0x67')]['id'],_0x3b1aae[_0x2254('0x67')]['name'],_0x3b1aae[_0x2254('0x67')][_0x2254('0x70')],_0x494347['interaction']['id'],_0x3b1aae[_0x2254('0x5d')]?JSON[_0x2254('0x26')](_0x3b1aae['body']):_0x2254('0x71'));return respondWithRpcPromise('AcceptMessage',_0x2254('0x72'),_0x494347);}return null;})['then'](function(_0x3cbd35){var _0x1f95b2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cbd35[_0x2254('0x2a')]['ContactId'];return db[_0x2254('0x73')][_0x2254('0x44')](_0x1f95b2,{'type':db[_0x2254('0x74')]['QueryTypes'][_0x2254('0x75')],'raw':!![]})['then'](function(_0x30966){return _0x30966;});})[_0x2254('0x22')](function(_0x4d4891){if(_0x4d4891){_0x494347['message'][_0x2254('0x76')]=_0x4d4891[0x0];if(!_0x3b1aae[_0x2254('0x5d')][_0x2254('0x69')])return;return db[_0x2254('0x77')]['find']({'where':{'id':_0x3b1aae[_0x2254('0x5d')][_0x2254('0x69')],'role':_0x2254('0x68')},'attributes':['id',_0x2254('0x3a'),'fullname',_0x2254('0x78'),_0x2254('0x79')],'raw':!![]});}return null;})['then'](function(_0x38e393){if(!_0x38e393)return null;_0x494347['message'][_0x2254('0x68')]=_0x38e393;return _0x494347;})['then'](function(_0x58861d){if(_0x58861d){if(_0x3b1aae['body'][_0x2254('0x7a')]){_0x494347['message'][_0x2254('0x7b')]=util[_0x2254('0x65')]('SIP/%s',_0x3b1aae[_0x2254('0x67')][_0x2254('0x3a')]);_0x494347[_0x2254('0x2a')][_0x2254('0x7c')]=_0x494347[_0x2254('0x7c')];_0x494347[_0x2254('0x2a')]['motionChannel']=_0x494347['channel'];_0x494347[_0x2254('0x2a')][_0x2254('0x7d')]=_0x2254('0x61');return respondWithRpcPromise(_0x2254('0x7e'),_0x2254('0x7e'),{'event':_0x2254('0x7f'),'message':_0x494347[_0x2254('0x2a')]},client9002)[_0x2254('0x22')](function(){return _0x494347;});}return _0x494347;}return null;})[_0x2254('0x22')](respondWithResult(_0x38be3b,null))[_0x2254('0x2b')](handleError(_0x38be3b,null));};var interaction_log=require('../../config/logger')(_0x2254('0x60'));exports[_0x2254('0x35')]=function(_0x53cf03,_0x447e4f,_0x57fb43){var _0x3b9514={'agent':{},'channel':_0x2254('0x62')};if(_0x53cf03['body']['id']){delete _0x53cf03[_0x2254('0x5d')]['id'];}_0x53cf03['body'][_0x2254('0x69')]=_0x53cf03[_0x2254('0x5d')][_0x2254('0x69')]||_0x53cf03[_0x2254('0x67')]['id'];_0x3b9514['agent']['id']=_0x53cf03[_0x2254('0x5d')][_0x2254('0x69')];return db[_0x2254('0x3e')][_0x2254('0x5b')]({'where':{'id':_0x53cf03['params']['id'],'UserId':null}})[_0x2254('0x22')](handleEntityNotFound(_0x447e4f,null))[_0x2254('0x22')](function(_0x5a3df9){if(_0x5a3df9){_0x3b9514[_0x2254('0x2a')]=_0x5a3df9[_0x2254('0x80')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x5a3df9[_0x2254('0x6b')]}});}return null;})[_0x2254('0x22')](handleEntityNotFound(_0x447e4f,null))[_0x2254('0x22')](function(_0x3058d9){if(_0x3058d9){_0x3b9514[_0x2254('0x6d')]=_0x3058d9[_0x2254('0x80')]({'plain':!![]});interaction_log[_0x2254('0x6e')](_0x2254('0x81'),_0x53cf03[_0x2254('0x67')]['id'],_0x53cf03['user'][_0x2254('0x3a')],_0x53cf03['user'][_0x2254('0x70')],_0x3b9514['interaction']['id'],_0x53cf03[_0x2254('0x5d')]?JSON[_0x2254('0x26')](_0x53cf03[_0x2254('0x5d')]):'null');return respondWithRpcPromise(_0x2254('0x82'),_0x2254('0x83'),_0x3b9514);}return null;})[_0x2254('0x22')](function(_0x472758){var _0x227e29=_0x2254('0x84')+_0x472758[_0x2254('0x2a')][_0x2254('0x85')];return db[_0x2254('0x73')][_0x2254('0x44')](_0x227e29,{'type':db[_0x2254('0x74')][_0x2254('0x86')][_0x2254('0x75')],'raw':!![]})['then'](function(_0x806221){return _0x806221;});})['then'](function(_0x64c4f5){if(_0x64c4f5){_0x3b9514[_0x2254('0x2a')][_0x2254('0x76')]=_0x64c4f5[0x0];if(!_0x53cf03[_0x2254('0x5d')][_0x2254('0x69')])return;return db[_0x2254('0x77')][_0x2254('0x5b')]({'where':{'id':_0x53cf03['body'][_0x2254('0x69')],'role':'agent'},'attributes':['id',_0x2254('0x3a'),'fullname',_0x2254('0x78'),_0x2254('0x79')],'raw':!![]});}return null;})[_0x2254('0x22')](function(_0x4a6c9e){if(!_0x4a6c9e)return null;_0x3b9514[_0x2254('0x2a')][_0x2254('0x68')]=_0x4a6c9e;return _0x3b9514;})[_0x2254('0x22')](function(_0x14f121){if(_0x14f121){_0x14f121[_0x2254('0x2a')][_0x2254('0x7b')]=util[_0x2254('0x65')](_0x2254('0x87'),_0x53cf03['user']['name']);_0x14f121[_0x2254('0x2a')]['channel']=_0x3b9514[_0x2254('0x7c')];_0x14f121[_0x2254('0x2a')][_0x2254('0x88')]=_0x3b9514[_0x2254('0x7c')];_0x14f121[_0x2254('0x2a')][_0x2254('0x7d')]=_0x2254('0x35');respondWithRpcPromise('EventManager',_0x2254('0x7e'),{'event':_0x2254('0x89'),'message':_0x14f121[_0x2254('0x2a')]},client9002);return _0x3b9514;}return null;})['then'](respondWithResult(_0x447e4f,null))[_0x2254('0x2b')](handleError(_0x447e4f,null));};exports[_0x2254('0x2c')]=function(_0x2be280,_0x1426d6,_0x2733b2){if(_0x2be280[_0x2254('0x5d')]['id']){delete _0x2be280[_0x2254('0x5d')]['id'];}var _0x109350;return db[_0x2254('0x3e')]['find']({'where':{'id':_0x2be280[_0x2254('0x5a')]['id']}})[_0x2254('0x22')](handleEntityNotFound(_0x1426d6,null))['then'](function(_0x4cec5b){if(_0x4cec5b){_0x109350=_0x4cec5b;return db[_0x2254('0x8a')]['find']({'where':{'id':_0x4cec5b[_0x2254('0x8b')]}});}})[_0x2254('0x22')](handleEntityNotFound(_0x1426d6,null))[_0x2254('0x22')](function(_0x3e64c5){if(_0x3e64c5){logger[_0x2254('0x23')](_0x2254('0x24'),_0x2254('0x2c'),_0x2254('0x8c'),_0x3e64c5['type'],util['inspect'](_0x2be280[_0x2254('0x5d')],{'showHidden':![],'depth':null}));switch(_0x3e64c5[_0x2254('0x41')]){case _0x2254('0x8d'):if(_0x2be280[_0x2254('0x5d')][_0x2254('0x8e')]&&_0x2be280['body']['MessageSid']===_0x109350[_0x2254('0x8f')]){return _0x109350['update']({'read':!![]});}else{logger[_0x2254('0x27')](_0x2254('0x90'),_0x2254('0x2c'),_0x2254('0x8d'),util[_0x2254('0x91')](_0x2be280[_0x2254('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x2254('0x92'):if(_0x2be280['body'][_0x2254('0x93')]&&_0x2be280[_0x2254('0x5d')]['MessageUUID']===_0x109350[_0x2254('0x8f')]&&_[_0x2254('0x94')]([_0x2254('0x95'),_0x2254('0x96')],_0x2be280[_0x2254('0x5d')][_0x2254('0x97')])>=0x0){return _0x109350[_0x2254('0x37')]({'read':!![]});}else{logger[_0x2254('0x27')](_0x2254('0x90'),_0x2254('0x2c'),_0x2254('0x98'),util['inspect'](_0x2be280[_0x2254('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x2254('0x99'):var _0x2c5f98=_0x2be280[_0x2254('0x5d')][_0x2254('0x9a')][0x0];if(_0x2c5f98[_0x2254('0x2c')][_0x2254('0x9b')]==='DELIVERED'){return _0x109350[_0x2254('0x37')]({'read':!![]});}else{logger[_0x2254('0x27')](_0x2254('0x90'),'status',_0x2254('0x99'),util[_0x2254('0x91')](_0x2be280[_0x2254('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x109350;}})[_0x2254('0x22')](respondWithResult(_0x1426d6,null))[_0x2254('0x2b')](handleError(_0x1426d6,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 3cb43f5..9e9db31 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 _0xaba5=['../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xaba5,0xa4));var _0x5aba=function(_0x3e19bb,_0x58e992){_0x3e19bb=_0x3e19bb-0x0;var _0x77b175=_0xaba5[_0x3e19bb];return _0x77b175;};'use strict';var EventEmitter=require(_0x5aba('0x0'));var SmsMessage=require(_0x5aba('0x1'))['db'][_0x5aba('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5aba('0x3')](0x0);var events={'afterCreate':_0x5aba('0x4'),'afterUpdate':_0x5aba('0x5'),'afterDestroy':_0x5aba('0x6')};function emitEvent(_0x58d992){return function(_0x140768,_0x12578c,_0x292d56){SmsMessageEvents['emit'](_0x58d992+':'+_0x140768['id'],_0x140768);SmsMessageEvents[_0x5aba('0x7')](_0x58d992,_0x140768);_0x292d56(null);};}for(var e in events){if(events[_0x5aba('0x8')](e)){var event=events[e];SmsMessage[_0x5aba('0x9')](e,emitEvent(event));}}module[_0x5aba('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0xc75a=['../../mysqldb','SmsMessage','save','update','remove','emit','exports','events'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xc75a,0x1e7));var _0xac75=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0xc75a[_0x54b396];return _0x532e6d;};'use strict';var EventEmitter=require(_0xac75('0x0'));var SmsMessage=require(_0xac75('0x1'))['db'][_0xac75('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac75('0x3'),'afterUpdate':_0xac75('0x4'),'afterDestroy':_0xac75('0x5')};function emitEvent(_0x483622){return function(_0x162b73,_0x59c3aa,_0x14a6ad){SmsMessageEvents[_0xac75('0x6')](_0x483622+':'+_0x162b73['id'],_0x162b73);SmsMessageEvents[_0xac75('0x6')](_0x483622,_0x162b73);_0x14a6ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xac75('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index ad9f890..da5eb83 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 _0x8b31=['plivo','authId','remote','/status?token=','token','https://api.plivo.com/v1/Account/%s/Message/','format','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','length','md5','digest','hex','signature=','/external/get/send.php?','id_sms','clickatell','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','accountId','/messages','applicationId','bandwidth','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','then','update','catch','error','out','SmsAccount','find','twilio','accountSid','phone','authToken','messages','create','/api/sms/messages/','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','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','read','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','clickSend','Missing\x20parameters:\x20username,\x20password'];(function(_0x243af6,_0x1bfae8){var _0xf9b8e3=function(_0xe7eeb){while(--_0xe7eeb){_0x243af6['push'](_0x243af6['shift']());}};_0xf9b8e3(++_0x1bfae8);}(_0x8b31,0xab));var _0x18b3=function(_0x38ea30,_0x209855){_0x38ea30=_0x38ea30-0x0;var _0x22cdc5=_0x8b31[_0x38ea30];return _0x22cdc5;};'use strict';var _=require(_0x18b3('0x0'));var util=require(_0x18b3('0x1'));var logger=require(_0x18b3('0x2'))(_0x18b3('0x3'));var moment=require(_0x18b3('0x4'));var BPromise=require(_0x18b3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18b3('0x6'));var rimraf=require(_0x18b3('0x7'));var config=require(_0x18b3('0x8'));var attributes=require(_0x18b3('0x9'));module[_0x18b3('0xa')]=function(_0x3fa8cc,_0x384ca6){return _0x3fa8cc['define'](_0x18b3('0xb'),attributes,{'tableName':_0x18b3('0xc'),'paranoid':![],'indexes':[{'name':_0x18b3('0xd'),'fields':[_0x18b3('0xd')]},{'name':_0x18b3('0xe'),'fields':[_0x18b3('0xf')],'type':_0x18b3('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25ae62,_0x4ea14c,_0x445162){var _0x5f3413=_0x3fa8cc[_0x18b3('0x11')];var _0x21a6ad=_0x25ae62['get']({'plain':!![]});if(_0x21a6ad[_0x18b3('0x12')]['toLowerCase']()==='in'||_0x21a6ad['direction'][_0x18b3('0x13')]()==='out'&&!_0x21a6ad[_0x18b3('0x14')]&&!_[_0x18b3('0x15')](_0x21a6ad[_0x18b3('0x16')])&&!_[_0x18b3('0x15')](_0x21a6ad['SmsInteractionId'])){_0x5f3413[_0x18b3('0x17')][_0x18b3('0x18')]({'where':{'id':_0x21a6ad['SmsInteractionId']}})[_0x18b3('0x19')](function(_0x558f2f){if(_0x558f2f){_0x558f2f[_0x18b3('0x1a')]({'lastMsgAt':_0x21a6ad['createdAt'],'lastMsgDirection':_0x21a6ad[_0x18b3('0x12')][_0x18b3('0x13')]()});}})[_0x18b3('0x1b')](function(_0x4ae2a3){console[_0x18b3('0x1c')](_0x4ae2a3);});}if(_0x21a6ad['direction']===_0x18b3('0x1d')&&!_0x21a6ad[_0x18b3('0x14')]){var _0x65555e;_0x5f3413[_0x18b3('0x1e')][_0x18b3('0x1f')]({'where':{'id':_0x21a6ad['SmsAccountId']},'raw':!![]})[_0x18b3('0x19')](function(_0x4c24c3){_0x65555e=_0x4c24c3;if(_0x65555e&&_0x65555e['type']){switch(_0x65555e['type']){case _0x18b3('0x20'):var _0x114639=require(_0x18b3('0x20'));if(_0x65555e[_0x18b3('0x21')]&&_0x65555e['authToken']&&_0x65555e[_0x18b3('0x22')]){var _0xe74d71=new _0x114639(_0x65555e[_0x18b3('0x21')],_0x65555e[_0x18b3('0x23')]);_0xe74d71[_0x18b3('0x24')][_0x18b3('0x25')]({'body':_0x21a6ad['body'],'to':_0x21a6ad[_0x18b3('0x22')],'from':_0x65555e[_0x18b3('0x22')],'statusCallback':_0x65555e['remote']+_0x18b3('0x26')+_0x21a6ad['id']+'/status?token='+_0x65555e['token']})[_0x18b3('0x19')](function(_0x4792e6){if(_0x4792e6[_0x18b3('0x27')]){return _0x25ae62[_0x18b3('0x1a')]({'messageId':_0x4792e6[_0x18b3('0x27')]});}})['catch'](function(_0x41c384){logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),'twilio',util[_0x18b3('0x2a')](_0x41c384,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x20'),_0x18b3('0x2b'));}break;case _0x18b3('0x2c'):var _0x151010=_0x18b3('0x2d');if(_0x65555e[_0x18b3('0x2e')]&&_0x65555e[_0x18b3('0x2f')]){var _0x4434af={'recipient':[_0x21a6ad[_0x18b3('0x22')]],'message':_0x21a6ad['body'],'message_type':_0x65555e['smsMethod']};if(_0x65555e['smsMethod']&&_0x65555e['smsMethod']!=='SI'){_0x4434af[_0x18b3('0x30')]=_0x65555e['phone'];}var _0x18f17e={'url':_0x151010+_0x18b3('0x31')+_0x65555e[_0x18b3('0x2e')]+_0x18b3('0x32')+_0x65555e[_0x18b3('0x2f')],'method':_0x18b3('0x33')};rp(_0x18f17e)['then'](function(_0x1f49c4){var _0x3382b8=_0x1f49c4['split'](';');var _0x16087d={'user_key':_0x3382b8[0x0],'session_key':_0x3382b8[0x1]};_0x18f17e={'url':_0x151010+_0x18b3('0x34'),'method':_0x18b3('0x35'),'headers':{'user_key':_0x16087d[_0x18b3('0x36')],'Session_key':_0x16087d[_0x18b3('0x37')]},'json':!![],'body':_0x4434af};return rp(_0x18f17e);})[_0x18b3('0x19')](function(_0x56b41d){if(_0x56b41d[_0x18b3('0x38')]>=0x1){var _0x1bb97c={'messageId':_0x56b41d[_0x18b3('0x39')]};if(_0x65555e['smsMethod']!=='GP'||!_0x65555e['deliveryReport']){_0x1bb97c[_0x18b3('0x3a')]=!![];}return _0x25ae62[_0x18b3('0x1a')](_0x1bb97c);}else{return logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x2c'),util[_0x18b3('0x2a')](_0x56b41d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x23b1b1){return logger['error'](_0x18b3('0x28'),'afterCreate','skebby',util[_0x18b3('0x2a')](_0x23b1b1,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x65555e['authToken']){var _0x1fce08={'recipient':_0x21a6ad['phone'],'message':_0x21a6ad['body'],'sender':_0x65555e[_0x18b3('0x3b')]||_0x65555e[_0x18b3('0x22')],'authorization':_0x65555e[_0x18b3('0x23')]};var _0x4ea14c={'method':'POST','uri':_0x18b3('0x3c'),'body':_0x1fce08,'json':!![]};rp(_0x4ea14c)[_0x18b3('0x19')](function(_0x46243e){var _0x2980f0={'messageId':_0x46243e[_0x18b3('0x3d')]};if(!_0x65555e[_0x18b3('0x3e')]){_0x2980f0['read']=!![];}return _0x25ae62['update'](_0x2980f0);})[_0x18b3('0x1b')](function(_0x5edca0){logger[_0x18b3('0x1c')](_0x18b3('0x28'),'afterCreate','connectel',util[_0x18b3('0x2a')](_0x5edca0,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x3f'),_0x18b3('0x40'));}break;case _0x18b3('0x41'):if(_0x65555e[_0x18b3('0x2e')]&&_0x65555e[_0x18b3('0x2f')]){var _0x1fce08={'messages':[{'source':_0x18b3('0x42'),'to':_0x21a6ad[_0x18b3('0x22')],'body':_0x21a6ad[_0x18b3('0xf')],'from':_0x65555e[_0x18b3('0x3b')]||_0x65555e['phone']}]};var _0x1cea86=util['format'](_0x18b3('0x43'),_0x65555e[_0x18b3('0x2e')],_0x65555e[_0x18b3('0x2f')]);var _0x4ea14c={'method':_0x18b3('0x35'),'uri':_0x18b3('0x44'),'body':_0x1fce08,'headers':{'Authorization':util['format'](_0x18b3('0x45'),new Buffer(_0x1cea86)[_0x18b3('0x46')](_0x18b3('0x47')))},'json':!![]};rp(_0x4ea14c)['then'](function(_0x1dca78){if(_0x1dca78['http_code']>=0xc8&&_0x1dca78[_0x18b3('0x48')]<=0xce){if(_0x1dca78[_0x18b3('0x49')]&&_0x1dca78[_0x18b3('0x49')][_0x18b3('0x4a')]>0x0){var _0x322935=_['head'](_0x1dca78[_0x18b3('0x49')][_0x18b3('0x24')]);var _0x35fdfe={'messageId':_0x322935['message_id']};if(!_0x65555e[_0x18b3('0x3e')]){_0x35fdfe['read']=!![];}return _0x25ae62[_0x18b3('0x1a')](_0x35fdfe);}else{logger['error'](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x4b'),util['inspect'](_0x1dca78,{'showHidden':![],'depth':null}));}}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x4b'),util['inspect'](_0x1dca78,{'showHidden':![],'depth':null}));}})['catch'](function(_0x11286f){logger[_0x18b3('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x18b3('0x29'),_0x18b3('0x4b'),util[_0x18b3('0x2a')](_0x11286f,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x4b'),_0x18b3('0x4c'));}break;case _0x18b3('0x4d'):if(_0x65555e[_0x18b3('0x4e')]&&_0x65555e['authToken']){var _0x1fce08={'dst':_0x21a6ad[_0x18b3('0x22')],'text':_0x21a6ad[_0x18b3('0xf')],'src':_0x65555e['senderString']||_0x65555e['phone'],'url':_0x65555e[_0x18b3('0x4f')]+_0x18b3('0x26')+_0x21a6ad['id']+_0x18b3('0x50')+_0x65555e[_0x18b3('0x51')]};var _0x1cea86=util['format'](_0x18b3('0x43'),_0x65555e[_0x18b3('0x4e')],_0x65555e['authToken']);var _0x4ea14c={'method':'POST','uri':util['format'](_0x18b3('0x52'),_0x65555e[_0x18b3('0x4e')]),'body':_0x1fce08,'headers':{'Authorization':util[_0x18b3('0x53')]('Basic\x20%s',new Buffer(_0x1cea86)[_0x18b3('0x46')](_0x18b3('0x47')))},'json':!![]};rp(_0x4ea14c)[_0x18b3('0x19')](function(_0x1bb4cb){var _0x57eef1={'messageId':_0x1bb4cb[_0x18b3('0x54')][0x0]};return _0x25ae62[_0x18b3('0x1a')](_0x57eef1);})[_0x18b3('0x1b')](function(_0x2aceb9){logger[_0x18b3('0x1c')](_0x18b3('0x28'),'afterCreate','plivo',util['inspect'](_0x2aceb9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x18b3('0x28'),'afterCreate','plivo',_0x18b3('0x55'));}break;case _0x18b3('0x56'):if(_0x65555e[_0x18b3('0x2e')]&&_0x65555e[_0x18b3('0x2f')]){if(_0x65555e[_0x18b3('0x57')]){var _0x5d42b6={'method':'POST','uri':_0x65555e[_0x18b3('0x57')]+_0x18b3('0x58'),'body':{'username':_0x65555e[_0x18b3('0x2e')],'password':_0x65555e[_0x18b3('0x2f')]},'json':!![]};return rp(_0x5d42b6)[_0x18b3('0x19')](function(_0x51d5d2){var _0x3f3f9e={'method':_0x18b3('0x35'),'uri':_0x65555e[_0x18b3('0x57')]+_0x18b3('0x59'),'body':{'messages':[{'from':_0x65555e['phone'],'destinations':[{'to':_0x21a6ad[_0x18b3('0x22')]}],'text':_0x21a6ad[_0x18b3('0xf')],'notifyUrl':_0x65555e[_0x18b3('0x4f')]+_0x18b3('0x26')+_0x21a6ad['id']+'/status?token='+_0x65555e['token'],'notifyContentType':_0x18b3('0x5a'),'callbackData':_0x65555e[_0x18b3('0x22')]+';'+_0x21a6ad[_0x18b3('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x51d5d2[_0x18b3('0x51')]},'json':!![]};return rp(_0x3f3f9e)[_0x18b3('0x19')](function(_0x3a1013){if(_0x3a1013[_0x18b3('0x24')]){var _0x1de1f5={'messageId':_0x3a1013[_0x18b3('0x24')][0x0][_0x18b3('0xd')]};if(!_0x65555e['deliveryReport']){_0x1de1f5[_0x18b3('0x3a')]=!![];}return _0x25ae62[_0x18b3('0x1a')](_0x1de1f5);}else{return logger[_0x18b3('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x18b3('0x29'),_0x18b3('0x56'),util[_0x18b3('0x2a')](_0x3a1013,{'showHidden':![],'depth':null}));}});})[_0x18b3('0x1b')](function(_0x103024){return logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x56'),util[_0x18b3('0x2a')](_0x103024,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),'afterCreate',_0x18b3('0x56'),_0x18b3('0x5b'));}}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x56'),_0x18b3('0x4c'));}break;case _0x18b3('0x5c'):var _0xb75e40=require('crypto');if(_0x65555e[_0x18b3('0x5d')]){var _0x3229fc={};_0x3229fc[_0x18b3('0x5e')]=_0x65555e[_0x18b3('0x2e')];_0x3229fc[_0x18b3('0x22')]=_0x21a6ad['phone'];_0x3229fc[_0x18b3('0x30')]=_0x65555e[_0x18b3('0x22')];_0x3229fc[_0x18b3('0x5f')]=_0x21a6ad[_0x18b3('0xf')];_0x3229fc[_0x18b3('0x60')]=+new Date();var _0x4e1081='';var _0x2c5259='';var _0x1cb0e9=Object[_0x18b3('0x61')](_0x3229fc);_0x1cb0e9[_0x18b3('0x62')]();for(var _0x65baad=0x0;_0x65baad<_0x1cb0e9[_0x18b3('0x63')];_0x65baad++){if(_0x4e1081!=''){_0x4e1081+='&';}_0x4e1081+=_0x1cb0e9[_0x65baad]+'='+encodeURIComponent(_0x3229fc[_0x1cb0e9[_0x65baad]]);_0x2c5259+=_0x3229fc[_0x1cb0e9[_0x65baad]];}_0x2c5259+=_0x65555e[_0x18b3('0x5d')];_0x2c5259=_0xb75e40['createHash'](_0x18b3('0x64'))[_0x18b3('0x1a')](_0x2c5259)[_0x18b3('0x65')](_0x18b3('0x66'));if(_0x4e1081!==''){_0x4e1081+='&';}_0x4e1081+=_0x18b3('0x67')+_0x2c5259;var _0x18f17e={'method':_0x18b3('0x33'),'uri':_0x65555e[_0x18b3('0x57')]+_0x18b3('0x68')+_0x4e1081,'json':!![]};return rp(_0x18f17e)[_0x18b3('0x19')](function(_0x33fbe2){var _0x4c695d=Object['keys'](_0x33fbe2);if(_0x33fbe2[_0x4c695d[0x0]][_0x18b3('0x1c')]&&parseInt(_0x33fbe2[_0x4c695d[0x0]][_0x18b3('0x1c')])===0x0){var _0x4b585c={'messageId':_0x33fbe2[_0x4c695d[0x0]][_0x18b3('0x69')]};if(!_0x65555e[_0x18b3('0x3e')]){_0x4b585c[_0x18b3('0x3a')]=!![];}return _0x25ae62[_0x18b3('0x1a')](_0x4b585c);}else{return logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),'csc',util[_0x18b3('0x2a')](_0x33fbe2[_0x18b3('0x1c')],{'showHidden':![],'depth':null}));}})[_0x18b3('0x1b')](function(_0x3a210d){return logger[_0x18b3('0x1c')](_0x18b3('0x28'),'afterCreate',_0x18b3('0x5c'),util['inspect'](_0x3a210d,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x18b3('0x29'),_0x18b3('0x5c'),'Missing\x20parameters:\x20apiKey');}break;case _0x18b3('0x6a'):if(_0x65555e[_0x18b3('0x5d')]){var _0x347aa2={'method':_0x18b3('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x65555e['apiKey']},'body':{'content':_0x21a6ad[_0x18b3('0xf')],'to':[_0x21a6ad[_0x18b3('0x22')]],'from':_0x65555e[_0x18b3('0x22')],'binary':![],'clientMessageId':_0x18b3('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x347aa2)['then'](function(_0x32cf21){if(!_0x32cf21['error']){var _0x131c2b={'messageId':_0x32cf21[_0x18b3('0x24')][0x0][_0x18b3('0x6c')]};if(!_0x65555e['deliveryReport']){_0x131c2b['read']=!![];}return _0x25ae62[_0x18b3('0x1a')](_0x131c2b);}else{return logger[_0x18b3('0x1c')](_0x18b3('0x28'),'afterCreate',_0x18b3('0x6a'),util[_0x18b3('0x2a')](_0x32cf21[_0x18b3('0x1c')],{'showHidden':![],'depth':null}));}})[_0x18b3('0x1b')](function(_0xb59af1){return logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x6a'),util['inspect'](_0xb59af1,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x6a'),_0x18b3('0x6d'));}break;case'bandwidth':if(_0x65555e[_0x18b3('0x2e')]&&_0x65555e[_0x18b3('0x2f')]){var _0x1cea86=util[_0x18b3('0x53')]('%s:%s',_0x65555e[_0x18b3('0x2e')],_0x65555e[_0x18b3('0x2f')]);var _0x4ea14c={'method':_0x18b3('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x65555e[_0x18b3('0x6e')]+_0x18b3('0x6f'),'body':{'to':[_0x21a6ad[_0x18b3('0x22')]],'text':_0x21a6ad[_0x18b3('0xf')],'from':_0x65555e[_0x18b3('0x22')],'applicationId':_0x65555e[_0x18b3('0x70')]},'headers':{'Authorization':util[_0x18b3('0x53')](_0x18b3('0x45'),new Buffer(_0x1cea86)[_0x18b3('0x46')](_0x18b3('0x47')))},'json':!![]};rp(_0x4ea14c)['then'](function(_0x41eac1){if(_0x41eac1['id']){var _0x403b3d={'messageId':_0x41eac1['id']};return _0x25ae62[_0x18b3('0x1a')](_0x403b3d);}else{logger['error'](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x71'),util['inspect'](_0x41eac1,{'showHidden':![],'depth':null}));}})[_0x18b3('0x1b')](function(_0x5aa49c){logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x71'),util[_0x18b3('0x2a')](_0x5aa49c,{'showHidden':![],'depth':null}));});}else{logger[_0x18b3('0x1c')](_0x18b3('0x28'),'afterCreate',_0x18b3('0x71'),_0x18b3('0x4c'));}break;case'intelepeer':if(_0x65555e[_0x18b3('0x5d')]){var _0x491555={};var _0x18f17e={'method':_0x18b3('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x18b3('0x72')+_0x65555e[_0x18b3('0x5d')],'Content-Type':_0x18b3('0x5a')},'body':{'from':_0x65555e[_0x18b3('0x22')],'to':_0x21a6ad['phone'],'text':_0x21a6ad[_0x18b3('0xf')]},'json':!![]};return rp(_0x18f17e)['then'](function(_0x5f441c){if(_0x5f441c[_0x18b3('0x73')]==0xca){_0x491555[_0x18b3('0x74')]=_0x5f441c;var _0x575703={'method':_0x18b3('0x35'),'uri':_0x18b3('0x75'),'headers':{'Authorization':_0x18b3('0x72')+_0x65555e[_0x18b3('0x5d')],'Content-Type':_0x18b3('0x5a')},'body':{'refid':_0x491555[_0x18b3('0x74')]['refid']},'json':!![]};return rp(_0x575703)[_0x18b3('0x19')](function(_0x363f67){_0x491555[_0x18b3('0x76')]=_0x363f67;var _0x183e88={'messageId':_0x491555[_0x18b3('0x74')][_0x18b3('0x77')],'read':!![]};return _0x25ae62[_0x18b3('0x1a')](_0x183e88);});}else{return logger[_0x18b3('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x18b3('0x78'),util[_0x18b3('0x2a')](_0x5f441c,{'showHidden':![],'depth':null}));}})[_0x18b3('0x1b')](function(_0x6589e0){return logger[_0x18b3('0x1c')](_0x18b3('0x28'),_0x18b3('0x29'),_0x18b3('0x78'),util[_0x18b3('0x2a')](_0x6589e0,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x18b3('0x78'),_0x18b3('0x79'));}break;}}})[_0x18b3('0x7a')](function(){_0x445162();});}else{_0x445162();}}},'charset':'utf8mb4','collate':_0x18b3('0x7b')});}; \ No newline at end of file +var _0xfa33=['phone','authToken','messages','create','remote','sid','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','token','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','length','createHash','md5','signature=','/external/get/send.php?','keys','id_sms','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','error','find','SmsAccountId','type','twilio'];(function(_0x32958f,_0x192ee9){var _0x18e10c=function(_0x53ca46){while(--_0x53ca46){_0x32958f['push'](_0x32958f['shift']());}};_0x18e10c(++_0x192ee9);}(_0xfa33,0xd7));var _0x3fa3=function(_0x34af74,_0x59ab9d){_0x34af74=_0x34af74-0x0;var _0x12d74b=_0xfa33[_0x34af74];return _0x12d74b;};'use strict';var _=require(_0x3fa3('0x0'));var util=require(_0x3fa3('0x1'));var logger=require(_0x3fa3('0x2'))(_0x3fa3('0x3'));var moment=require(_0x3fa3('0x4'));var BPromise=require('bluebird');var rp=require(_0x3fa3('0x5'));var fs=require('fs');var path=require(_0x3fa3('0x6'));var rimraf=require(_0x3fa3('0x7'));var config=require(_0x3fa3('0x8'));var attributes=require(_0x3fa3('0x9'));module['exports']=function(_0xddba49,_0x54088f){return _0xddba49[_0x3fa3('0xa')](_0x3fa3('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3fa3('0xc'),'fields':[_0x3fa3('0xc')]},{'name':_0x3fa3('0xd'),'fields':[_0x3fa3('0xe')],'type':_0x3fa3('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x333a99,_0x434e07,_0xcc7b5f){var _0x526995=_0xddba49['models'];var _0x5406a8=_0x333a99[_0x3fa3('0x10')]({'plain':!![]});if(_0x5406a8['direction']['toLowerCase']()==='in'||_0x5406a8[_0x3fa3('0x11')][_0x3fa3('0x12')]()===_0x3fa3('0x13')&&!_0x5406a8['secret']&&!_[_0x3fa3('0x14')](_0x5406a8[_0x3fa3('0x15')])&&!_[_0x3fa3('0x14')](_0x5406a8[_0x3fa3('0x16')])){_0x526995[_0x3fa3('0x17')][_0x3fa3('0x18')]({'where':{'id':_0x5406a8[_0x3fa3('0x16')]}})[_0x3fa3('0x19')](function(_0x19b560){if(_0x19b560){_0x19b560['update']({'lastMsgAt':_0x5406a8['createdAt'],'lastMsgDirection':_0x5406a8[_0x3fa3('0x11')][_0x3fa3('0x12')]()});}})['catch'](function(_0x1bbcec){console[_0x3fa3('0x1a')](_0x1bbcec);});}if(_0x5406a8[_0x3fa3('0x11')]===_0x3fa3('0x13')&&!_0x5406a8['secret']){var _0x1b2330;_0x526995['SmsAccount'][_0x3fa3('0x1b')]({'where':{'id':_0x5406a8[_0x3fa3('0x1c')]},'raw':!![]})['then'](function(_0x545377){_0x1b2330=_0x545377;if(_0x1b2330&&_0x1b2330[_0x3fa3('0x1d')]){switch(_0x1b2330[_0x3fa3('0x1d')]){case _0x3fa3('0x1e'):var _0x487b86=require('twilio');if(_0x1b2330['accountSid']&&_0x1b2330['authToken']&&_0x1b2330[_0x3fa3('0x1f')]){var _0x589736=new _0x487b86(_0x1b2330['accountSid'],_0x1b2330[_0x3fa3('0x20')]);_0x589736[_0x3fa3('0x21')][_0x3fa3('0x22')]({'body':_0x5406a8['body'],'to':_0x5406a8[_0x3fa3('0x1f')],'from':_0x1b2330[_0x3fa3('0x1f')],'statusCallback':_0x1b2330[_0x3fa3('0x23')]+'/api/sms/messages/'+_0x5406a8['id']+'/status?token='+_0x1b2330['token']})[_0x3fa3('0x19')](function(_0x2440a8){if(_0x2440a8[_0x3fa3('0x24')]){return _0x333a99[_0x3fa3('0x25')]({'messageId':_0x2440a8[_0x3fa3('0x24')]});}})[_0x3fa3('0x26')](function(_0x553da2){logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),'twilio',util[_0x3fa3('0x29')](_0x553da2,{'showHidden':![],'depth':null}));});}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x1e'),_0x3fa3('0x2a'));}break;case _0x3fa3('0x2b'):var _0x287213=_0x3fa3('0x2c');if(_0x1b2330['username']&&_0x1b2330[_0x3fa3('0x2d')]){var _0x9d7cd4={'recipient':[_0x5406a8[_0x3fa3('0x1f')]],'message':_0x5406a8['body'],'message_type':_0x1b2330[_0x3fa3('0x2e')]};if(_0x1b2330[_0x3fa3('0x2e')]&&_0x1b2330[_0x3fa3('0x2e')]!=='SI'){_0x9d7cd4[_0x3fa3('0x2f')]=_0x1b2330['phone'];}var _0x263609={'url':_0x287213+_0x3fa3('0x30')+_0x1b2330[_0x3fa3('0x31')]+_0x3fa3('0x32')+_0x1b2330['password'],'method':_0x3fa3('0x33')};rp(_0x263609)[_0x3fa3('0x19')](function(_0x361858){var _0x498071=_0x361858[_0x3fa3('0x34')](';');var _0x356925={'user_key':_0x498071[0x0],'session_key':_0x498071[0x1]};_0x263609={'url':_0x287213+_0x3fa3('0x35'),'method':_0x3fa3('0x36'),'headers':{'user_key':_0x356925[_0x3fa3('0x37')],'Session_key':_0x356925[_0x3fa3('0x38')]},'json':!![],'body':_0x9d7cd4};return rp(_0x263609);})['then'](function(_0x1c1be9){if(_0x1c1be9[_0x3fa3('0x39')]>=0x1){var _0x2183d2={'messageId':_0x1c1be9[_0x3fa3('0x3a')]};if(_0x1b2330[_0x3fa3('0x2e')]!=='GP'||!_0x1b2330['deliveryReport']){_0x2183d2['read']=!![];}return _0x333a99[_0x3fa3('0x25')](_0x2183d2);}else{return logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),'skebby',util[_0x3fa3('0x29')](_0x1c1be9,{'showHidden':![],'depth':null}));}})[_0x3fa3('0x26')](function(_0x5d0933){return logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),'afterCreate',_0x3fa3('0x2b'),util['inspect'](_0x5d0933,{'showHidden':![],'depth':null}));});}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),'skebby',_0x3fa3('0x3b'));}break;case _0x3fa3('0x3c'):if(_0x1b2330['authToken']){var _0xbd1ef9={'recipient':_0x5406a8[_0x3fa3('0x1f')],'message':_0x5406a8[_0x3fa3('0xe')],'sender':_0x1b2330[_0x3fa3('0x3d')]||_0x1b2330[_0x3fa3('0x1f')],'authorization':_0x1b2330[_0x3fa3('0x20')]};var _0x434e07={'method':_0x3fa3('0x36'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xbd1ef9,'json':!![]};rp(_0x434e07)[_0x3fa3('0x19')](function(_0x2afbce){var _0x53facb={'messageId':_0x2afbce[_0x3fa3('0x3e')]};if(!_0x1b2330[_0x3fa3('0x3f')]){_0x53facb[_0x3fa3('0x40')]=!![];}return _0x333a99[_0x3fa3('0x25')](_0x53facb);})['catch'](function(_0x1bf5f6){logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),'afterCreate','connectel',util['inspect'](_0x1bf5f6,{'showHidden':![],'depth':null}));});}else{logger[_0x3fa3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fa3('0x28'),_0x3fa3('0x3c'),_0x3fa3('0x41'));}break;case _0x3fa3('0x42'):if(_0x1b2330[_0x3fa3('0x31')]&&_0x1b2330[_0x3fa3('0x2d')]){var _0xbd1ef9={'messages':[{'source':_0x3fa3('0x43'),'to':_0x5406a8['phone'],'body':_0x5406a8[_0x3fa3('0xe')],'from':_0x1b2330[_0x3fa3('0x3d')]||_0x1b2330[_0x3fa3('0x1f')]}]};var _0x5486ba=util[_0x3fa3('0x44')](_0x3fa3('0x45'),_0x1b2330[_0x3fa3('0x31')],_0x1b2330[_0x3fa3('0x2d')]);var _0x434e07={'method':_0x3fa3('0x36'),'uri':_0x3fa3('0x46'),'body':_0xbd1ef9,'headers':{'Authorization':util[_0x3fa3('0x44')](_0x3fa3('0x47'),new Buffer(_0x5486ba)['toString'](_0x3fa3('0x48')))},'json':!![]};rp(_0x434e07)['then'](function(_0x50d994){if(_0x50d994[_0x3fa3('0x49')]>=0xc8&&_0x50d994[_0x3fa3('0x49')]<=0xce){if(_0x50d994[_0x3fa3('0x4a')]&&_0x50d994[_0x3fa3('0x4a')][_0x3fa3('0x4b')]>0x0){var _0xe31e00=_[_0x3fa3('0x4c')](_0x50d994[_0x3fa3('0x4a')]['messages']);var _0x516085={'messageId':_0xe31e00[_0x3fa3('0x4d')]};if(!_0x1b2330[_0x3fa3('0x3f')]){_0x516085[_0x3fa3('0x40')]=!![];}return _0x333a99[_0x3fa3('0x25')](_0x516085);}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),'afterCreate',_0x3fa3('0x4e'),util[_0x3fa3('0x29')](_0x50d994,{'showHidden':![],'depth':null}));}}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x4e'),util[_0x3fa3('0x29')](_0x50d994,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4de1bc){logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x4e'),util[_0x3fa3('0x29')](_0x4de1bc,{'showHidden':![],'depth':null}));});}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x4e'),_0x3fa3('0x3b'));}break;case _0x3fa3('0x4f'):if(_0x1b2330[_0x3fa3('0x50')]&&_0x1b2330[_0x3fa3('0x20')]){var _0xbd1ef9={'dst':_0x5406a8[_0x3fa3('0x1f')],'text':_0x5406a8['body'],'src':_0x1b2330[_0x3fa3('0x3d')]||_0x1b2330[_0x3fa3('0x1f')],'url':_0x1b2330[_0x3fa3('0x23')]+_0x3fa3('0x51')+_0x5406a8['id']+_0x3fa3('0x52')+_0x1b2330['token']};var _0x5486ba=util[_0x3fa3('0x44')]('%s:%s',_0x1b2330[_0x3fa3('0x50')],_0x1b2330[_0x3fa3('0x20')]);var _0x434e07={'method':_0x3fa3('0x36'),'uri':util[_0x3fa3('0x44')](_0x3fa3('0x53'),_0x1b2330['authId']),'body':_0xbd1ef9,'headers':{'Authorization':util[_0x3fa3('0x44')]('Basic\x20%s',new Buffer(_0x5486ba)[_0x3fa3('0x54')](_0x3fa3('0x48')))},'json':!![]};rp(_0x434e07)[_0x3fa3('0x19')](function(_0x98fd68){var _0x46dae8={'messageId':_0x98fd68[_0x3fa3('0x55')][0x0]};return _0x333a99[_0x3fa3('0x25')](_0x46dae8);})[_0x3fa3('0x26')](function(_0x5e4e91){logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),'plivo',util[_0x3fa3('0x29')](_0x5e4e91,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x4f'),_0x3fa3('0x56'));}break;case'infobip':if(_0x1b2330[_0x3fa3('0x31')]&&_0x1b2330[_0x3fa3('0x2d')]){if(_0x1b2330['baseUrl']){var _0x56414c={'method':_0x3fa3('0x36'),'uri':_0x1b2330['baseUrl']+'/auth/1/session','body':{'username':_0x1b2330[_0x3fa3('0x31')],'password':_0x1b2330['password']},'json':!![]};return rp(_0x56414c)[_0x3fa3('0x19')](function(_0x2416e6){var _0x383b76={'method':'POST','uri':_0x1b2330[_0x3fa3('0x57')]+_0x3fa3('0x58'),'body':{'messages':[{'from':_0x1b2330[_0x3fa3('0x1f')],'destinations':[{'to':_0x5406a8['phone']}],'text':_0x5406a8[_0x3fa3('0xe')],'notifyUrl':_0x1b2330[_0x3fa3('0x23')]+_0x3fa3('0x51')+_0x5406a8['id']+'/status?token='+_0x1b2330[_0x3fa3('0x59')],'notifyContentType':_0x3fa3('0x5a'),'callbackData':_0x1b2330[_0x3fa3('0x1f')]+';'+_0x5406a8[_0x3fa3('0xe')]}]},'headers':{'Authorization':_0x3fa3('0x5b')+_0x2416e6[_0x3fa3('0x59')]},'json':!![]};return rp(_0x383b76)['then'](function(_0x3b2faf){if(_0x3b2faf[_0x3fa3('0x21')]){var _0x24dfb4={'messageId':_0x3b2faf[_0x3fa3('0x21')][0x0][_0x3fa3('0xc')]};if(!_0x1b2330[_0x3fa3('0x3f')]){_0x24dfb4[_0x3fa3('0x40')]=!![];}return _0x333a99['update'](_0x24dfb4);}else{return logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),'afterCreate',_0x3fa3('0x5c'),util[_0x3fa3('0x29')](_0x3b2faf,{'showHidden':![],'depth':null}));}});})[_0x3fa3('0x26')](function(_0x444579){return logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),'infobip',util[_0x3fa3('0x29')](_0x444579,{'showHidden':![],'depth':null}));});}else{logger[_0x3fa3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fa3('0x28'),_0x3fa3('0x5c'),_0x3fa3('0x5d'));}}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),'afterCreate',_0x3fa3('0x5c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3fa3('0x5e'):var _0x280f4e=require(_0x3fa3('0x5f'));if(_0x1b2330[_0x3fa3('0x60')]){var _0x1e4100={};_0x1e4100['login']=_0x1b2330[_0x3fa3('0x31')];_0x1e4100['phone']=_0x5406a8['phone'];_0x1e4100[_0x3fa3('0x2f')]=_0x1b2330[_0x3fa3('0x1f')];_0x1e4100[_0x3fa3('0x61')]=_0x5406a8[_0x3fa3('0xe')];_0x1e4100[_0x3fa3('0x62')]=+new Date();var _0x7474fd='';var _0x44913c='';var _0x35d1da=Object['keys'](_0x1e4100);_0x35d1da['sort']();for(var _0x2cbeee=0x0;_0x2cbeee<_0x35d1da[_0x3fa3('0x63')];_0x2cbeee++){if(_0x7474fd!=''){_0x7474fd+='&';}_0x7474fd+=_0x35d1da[_0x2cbeee]+'='+encodeURIComponent(_0x1e4100[_0x35d1da[_0x2cbeee]]);_0x44913c+=_0x1e4100[_0x35d1da[_0x2cbeee]];}_0x44913c+=_0x1b2330[_0x3fa3('0x60')];_0x44913c=_0x280f4e[_0x3fa3('0x64')](_0x3fa3('0x65'))[_0x3fa3('0x25')](_0x44913c)['digest']('hex');if(_0x7474fd!==''){_0x7474fd+='&';}_0x7474fd+=_0x3fa3('0x66')+_0x44913c;var _0x263609={'method':'GET','uri':_0x1b2330['baseUrl']+_0x3fa3('0x67')+_0x7474fd,'json':!![]};return rp(_0x263609)[_0x3fa3('0x19')](function(_0x52a8ea){var _0x5b9b1e=Object[_0x3fa3('0x68')](_0x52a8ea);if(_0x52a8ea[_0x5b9b1e[0x0]][_0x3fa3('0x1a')]&&parseInt(_0x52a8ea[_0x5b9b1e[0x0]]['error'])===0x0){var _0x453ae5={'messageId':_0x52a8ea[_0x5b9b1e[0x0]][_0x3fa3('0x69')]};if(!_0x1b2330[_0x3fa3('0x3f')]){_0x453ae5[_0x3fa3('0x40')]=!![];}return _0x333a99['update'](_0x453ae5);}else{return logger['error'](_0x3fa3('0x27'),'afterCreate','csc',util['inspect'](_0x52a8ea[_0x3fa3('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4b8f54){return logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),'afterCreate',_0x3fa3('0x5e'),util[_0x3fa3('0x29')](_0x4b8f54,{'showHidden':![],'depth':null}));});}else{logger[_0x3fa3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fa3('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case _0x3fa3('0x6a'):if(_0x1b2330[_0x3fa3('0x60')]){var _0x4c4999={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1b2330[_0x3fa3('0x60')]},'body':{'content':_0x5406a8[_0x3fa3('0xe')],'to':[_0x5406a8['phone']],'from':_0x1b2330['phone'],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x4c4999)[_0x3fa3('0x19')](function(_0x3f2493){if(!_0x3f2493[_0x3fa3('0x1a')]){var _0x55c849={'messageId':_0x3f2493[_0x3fa3('0x21')][0x0]['apiMessageId']};if(!_0x1b2330[_0x3fa3('0x3f')]){_0x55c849[_0x3fa3('0x40')]=!![];}return _0x333a99[_0x3fa3('0x25')](_0x55c849);}else{return logger['error'](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x6a'),util[_0x3fa3('0x29')](_0x3f2493[_0x3fa3('0x1a')],{'showHidden':![],'depth':null}));}})[_0x3fa3('0x26')](function(_0xa1f7da){return logger[_0x3fa3('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fa3('0x6a'),util[_0x3fa3('0x29')](_0xa1f7da,{'showHidden':![],'depth':null}));});}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x6a'),_0x3fa3('0x6b'));}break;case _0x3fa3('0x6c'):if(_0x1b2330[_0x3fa3('0x31')]&&_0x1b2330[_0x3fa3('0x2d')]){var _0x5486ba=util['format'](_0x3fa3('0x45'),_0x1b2330[_0x3fa3('0x31')],_0x1b2330[_0x3fa3('0x2d')]);var _0x434e07={'method':'POST','uri':_0x3fa3('0x6d')+_0x1b2330[_0x3fa3('0x6e')]+'/messages','body':{'to':[_0x5406a8[_0x3fa3('0x1f')]],'text':_0x5406a8[_0x3fa3('0xe')],'from':_0x1b2330[_0x3fa3('0x1f')],'applicationId':_0x1b2330[_0x3fa3('0x6f')]},'headers':{'Authorization':util[_0x3fa3('0x44')](_0x3fa3('0x47'),new Buffer(_0x5486ba)[_0x3fa3('0x54')]('base64'))},'json':!![]};rp(_0x434e07)[_0x3fa3('0x19')](function(_0xe57520){if(_0xe57520['id']){var _0x3305d2={'messageId':_0xe57520['id']};return _0x333a99['update'](_0x3305d2);}else{logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x6c'),util[_0x3fa3('0x29')](_0xe57520,{'showHidden':![],'depth':null}));}})[_0x3fa3('0x26')](function(_0x41affe){logger['error'](_0x3fa3('0x27'),_0x3fa3('0x28'),_0x3fa3('0x6c'),util[_0x3fa3('0x29')](_0x41affe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fa3('0x27'),_0x3fa3('0x28'),'bandwidth',_0x3fa3('0x3b'));}break;case _0x3fa3('0x70'):if(_0x1b2330['apiKey']){var _0x3697c7={};var _0x263609={'method':_0x3fa3('0x36'),'uri':_0x3fa3('0x71'),'headers':{'Authorization':_0x3fa3('0x72')+_0x1b2330['apiKey'],'Content-Type':_0x3fa3('0x5a')},'body':{'from':_0x1b2330['phone'],'to':_0x5406a8[_0x3fa3('0x1f')],'text':_0x5406a8[_0x3fa3('0xe')]},'json':!![]};return rp(_0x263609)[_0x3fa3('0x19')](function(_0x4c92d9){if(_0x4c92d9[_0x3fa3('0x73')]==0xca){_0x3697c7['message']=_0x4c92d9;var _0x288abe={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3fa3('0x72')+_0x1b2330['apiKey'],'Content-Type':_0x3fa3('0x5a')},'body':{'refid':_0x3697c7[_0x3fa3('0x74')]['refid']},'json':!![]};return rp(_0x288abe)[_0x3fa3('0x19')](function(_0x37013f){_0x3697c7[_0x3fa3('0x75')]=_0x37013f;var _0x18f6aa={'messageId':_0x3697c7[_0x3fa3('0x74')][_0x3fa3('0x76')],'read':!![]};return _0x333a99[_0x3fa3('0x25')](_0x18f6aa);});}else{return logger[_0x3fa3('0x1a')](_0x3fa3('0x27'),'afterCreate','intelepeer',util[_0x3fa3('0x29')](_0x4c92d9,{'showHidden':![],'depth':null}));}})[_0x3fa3('0x26')](function(_0x36b71d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fa3('0x28'),_0x3fa3('0x70'),util[_0x3fa3('0x29')](_0x36b71d,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fa3('0x70'),_0x3fa3('0x77'));}break;}}})[_0x3fa3('0x78')](function(){_0xcc7b5f();});}else{_0xcc7b5f();}}},'charset':_0x3fa3('0x79'),'collate':_0x3fa3('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 51a5f24..5039ca5 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 _0x1773=['body','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x8f036c,_0x3ceea9){var _0x350049=function(_0x6d27f6){while(--_0x6d27f6){_0x8f036c['push'](_0x8f036c['shift']());}};_0x350049(++_0x3ceea9);}(_0x1773,0x135));var _0x3177=function(_0x3190b5,_0x182208){_0x3190b5=_0x3190b5-0x0;var _0x5cec54=_0x1773[_0x3190b5];return _0x5cec54;};'use strict';var _=require(_0x3177('0x0'));var util=require(_0x3177('0x1'));var moment=require(_0x3177('0x2'));var BPromise=require('bluebird');var rs=require(_0x3177('0x3'));var fs=require('fs');var Redis=require(_0x3177('0x4'));var db=require(_0x3177('0x5'))['db'];var utils=require(_0x3177('0x6'));var logger=require(_0x3177('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3177('0x8'));var client=jayson[_0x3177('0x9')][_0x3177('0xa')]({'port':0x232a});config[_0x3177('0xb')]=_[_0x3177('0xc')](config[_0x3177('0xb')],{'host':_0x3177('0xd'),'port':0x18eb});var socket=require(_0x3177('0xe'))(new Redis(config[_0x3177('0xb')]));require(_0x3177('0xf'))[_0x3177('0x10')](socket);function respondWithRpcPromise(_0x206267,_0x42541e,_0x47743e){return new BPromise(function(_0x55d47a,_0x1197bd){return client[_0x3177('0x11')](_0x206267,_0x47743e)['then'](function(_0x296ce3){logger[_0x3177('0x12')](_0x3177('0x13'),_0x42541e,_0x3177('0x14'));logger[_0x3177('0x15')](_0x3177('0x16'),_0x42541e,_0x3177('0x14'),JSON[_0x3177('0x17')](_0x296ce3));if(_0x296ce3['error']){if(_0x296ce3[_0x3177('0x18')][_0x3177('0x19')]===0x1f4){logger[_0x3177('0x18')](_0x3177('0x13'),_0x42541e,_0x296ce3[_0x3177('0x18')][_0x3177('0x1a')]);return _0x1197bd(_0x296ce3['error'][_0x3177('0x1a')]);}logger['error'](_0x3177('0x13'),_0x42541e,_0x296ce3['error'][_0x3177('0x1a')]);return _0x55d47a(_0x296ce3[_0x3177('0x18')][_0x3177('0x1a')]);}else{logger[_0x3177('0x12')](_0x3177('0x13'),_0x42541e,'request\x20sent');_0x55d47a(_0x296ce3[_0x3177('0x1b')][_0x3177('0x1a')]);}})[_0x3177('0x1c')](function(_0x2c693e){logger[_0x3177('0x18')]('SmsMessage,\x20%s,\x20%s',_0x42541e,_0x2c693e);_0x1197bd(_0x2c693e);});});}exports[_0x3177('0x1d')]=function(_0x1ee0d0){var _0x52aa4e=this;return new Promise(function(_0x36af43,_0x10c3ff){return db[_0x3177('0x1e')]['create'](_0x1ee0d0[_0x3177('0x1f')],{'raw':_0x1ee0d0['options']?_0x1ee0d0['options'][_0x3177('0x20')]===undefined?!![]:![]:!![]})[_0x3177('0x21')](function(_0x4e151d){logger[_0x3177('0x12')](_0x3177('0x1d'),_0x1ee0d0);logger[_0x3177('0x15')](_0x3177('0x1d'),_0x1ee0d0,JSON[_0x3177('0x17')](_0x4e151d));_0x36af43(_0x4e151d);})[_0x3177('0x1c')](function(_0x402a40){logger[_0x3177('0x18')]('CreateSmsMessage',_0x402a40[_0x3177('0x1a')],_0x1ee0d0);_0x10c3ff(_0x52aa4e['error'](0x1f4,_0x402a40['message']));});});}; \ No newline at end of file +var _0x17be=['raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','socket.io-emitter','./smsMessage.socket','register','then','debug','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','CreateSmsMessage','SmsMessage','create','options'];(function(_0x11fd42,_0x340400){var _0xd0b27e=function(_0x14e719){while(--_0x14e719){_0x11fd42['push'](_0x11fd42['shift']());}};_0xd0b27e(++_0x340400);}(_0x17be,0x14b));var _0xe17b=function(_0x29b6f1,_0x458f92){_0x29b6f1=_0x29b6f1-0x0;var _0x32bd1a=_0x17be[_0x29b6f1];return _0x32bd1a;};'use strict';var _=require(_0xe17b('0x0'));var util=require('util');var moment=require(_0xe17b('0x1'));var BPromise=require(_0xe17b('0x2'));var rs=require(_0xe17b('0x3'));var fs=require('fs');var Redis=require(_0xe17b('0x4'));var db=require(_0xe17b('0x5'))['db'];var utils=require(_0xe17b('0x6'));var logger=require('../../config/logger')(_0xe17b('0x7'));var config=require(_0xe17b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe17b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe17b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe17b('0xb'))(new Redis(config[_0xe17b('0xa')]));require(_0xe17b('0xc'))[_0xe17b('0xd')](socket);function respondWithRpcPromise(_0x3ded39,_0x138513,_0x2e6b7d){return new BPromise(function(_0x47e5d8,_0x20ca50){return client['request'](_0x3ded39,_0x2e6b7d)[_0xe17b('0xe')](function(_0x3e1563){logger['info']('SmsMessage,\x20%s,\x20%s',_0x138513,'request\x20sent');logger[_0xe17b('0xf')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x138513,_0xe17b('0x10'),JSON[_0xe17b('0x11')](_0x3e1563));if(_0x3e1563[_0xe17b('0x12')]){if(_0x3e1563[_0xe17b('0x12')][_0xe17b('0x13')]===0x1f4){logger[_0xe17b('0x12')](_0xe17b('0x14'),_0x138513,_0x3e1563['error'][_0xe17b('0x15')]);return _0x20ca50(_0x3e1563[_0xe17b('0x12')]['message']);}logger[_0xe17b('0x12')](_0xe17b('0x14'),_0x138513,_0x3e1563['error']['message']);return _0x47e5d8(_0x3e1563[_0xe17b('0x12')][_0xe17b('0x15')]);}else{logger[_0xe17b('0x16')](_0xe17b('0x14'),_0x138513,_0xe17b('0x10'));_0x47e5d8(_0x3e1563[_0xe17b('0x17')]['message']);}})[_0xe17b('0x18')](function(_0xb79abc){logger[_0xe17b('0x12')](_0xe17b('0x14'),_0x138513,_0xb79abc);_0x20ca50(_0xb79abc);});});}exports[_0xe17b('0x19')]=function(_0x37a35a){var _0x5bf778=this;return new Promise(function(_0x15ffd8,_0x12e7db){return db[_0xe17b('0x1a')][_0xe17b('0x1b')](_0x37a35a['body'],{'raw':_0x37a35a[_0xe17b('0x1c')]?_0x37a35a['options'][_0xe17b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4e2872){logger['info'](_0xe17b('0x19'),_0x37a35a);logger[_0xe17b('0xf')]('CreateSmsMessage',_0x37a35a,JSON[_0xe17b('0x11')](_0x4e2872));_0x15ffd8(_0x4e2872);})[_0xe17b('0x18')](function(_0x489d5e){logger[_0xe17b('0x12')](_0xe17b('0x19'),_0x489d5e['message'],_0x37a35a);_0x12e7db(_0x5bf778[_0xe17b('0x12')](0x1f4,_0x489d5e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6af1b66..dc3c8ae 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 _0xfc1f=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','remove','update'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0xfc1f,0x8d));var _0xffc1=function(_0x4a68d6,_0x59ec70){_0x4a68d6=_0x4a68d6-0x0;var _0x56de3e=_0xfc1f[_0x4a68d6];return _0x56de3e;};'use strict';var SmsMessageEvents=require(_0xffc1('0x0'));var events=['save',_0xffc1('0x1'),_0xffc1('0x2')];function createListener(_0x37617a,_0x3b66e7){return function(_0x5c3726){_0x3b66e7[_0xffc1('0x3')](_0x37617a,_0x5c3726);};}function removeListener(_0x5768b8,_0x21d19b){return function(){SmsMessageEvents[_0xffc1('0x4')](_0x5768b8,_0x21d19b);};}exports[_0xffc1('0x5')]=function(_0x457a8d){for(var _0x53d0d9=0x0,_0x8259ee=events[_0xffc1('0x6')];_0x53d0d9<_0x8259ee;_0x53d0d9++){var _0x53bfbb=events[_0x53d0d9];var _0x1acad1=createListener(_0xffc1('0x7')+_0x53bfbb,_0x457a8d);SmsMessageEvents['on'](_0x53bfbb,_0x1acad1);}}; \ No newline at end of file +var _0xe5a2=['smsMessage:','./smsMessage.events','save','remove','update','emit','register'];(function(_0x3ce97b,_0x21ed63){var _0x13fca8=function(_0xae1404){while(--_0xae1404){_0x3ce97b['push'](_0x3ce97b['shift']());}};_0x13fca8(++_0x21ed63);}(_0xe5a2,0x19e));var _0x2e5a=function(_0x5daa3e,_0x41d04b){_0x5daa3e=_0x5daa3e-0x0;var _0x1832d7=_0xe5a2[_0x5daa3e];return _0x1832d7;};'use strict';var SmsMessageEvents=require(_0x2e5a('0x0'));var events=[_0x2e5a('0x1'),_0x2e5a('0x2'),_0x2e5a('0x3')];function createListener(_0x2f1219,_0x4e3d73){return function(_0x195d78){_0x4e3d73[_0x2e5a('0x4')](_0x2f1219,_0x195d78);};}function removeListener(_0x2b0ad6,_0x153b89){return function(){SmsMessageEvents['removeListener'](_0x2b0ad6,_0x153b89);};}exports[_0x2e5a('0x5')]=function(_0xdb10a2){for(var _0x1ea986=0x0,_0x2ac818=events['length'];_0x1ea986<_0x2ac818;_0x1ea986++){var _0x37049c=events[_0x1ea986];var _0x191b7d=createListener(_0x2e5a('0x6')+_0x37049c,_0xdb10a2);SmsMessageEvents['on'](_0x37049c,_0x191b7d);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9a7f954..2aa71ac 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 _0x3fdd=['../../components/auth/service','./smsQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x413db5,_0x2cdd70){var _0x5f5a3c=function(_0x371121){while(--_0x371121){_0x413db5['push'](_0x413db5['shift']());}};_0x5f5a3c(++_0x2cdd70);}(_0x3fdd,0xcb));var _0xd3fd=function(_0x84e387,_0x4a90d4){_0x84e387=_0x84e387-0x0;var _0x2866be=_0x3fdd[_0x84e387];return _0x2866be;};'use strict';var multer=require(_0xd3fd('0x0'));var util=require(_0xd3fd('0x1'));var path=require(_0xd3fd('0x2'));var timeout=require(_0xd3fd('0x3'));var express=require(_0xd3fd('0x4'));var router=express[_0xd3fd('0x5')]();var fs_extra=require(_0xd3fd('0x6'));var auth=require(_0xd3fd('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd3fd('0x8'));router[_0xd3fd('0x9')]('/',auth['isAuthenticated'](),controller[_0xd3fd('0xa')]);router[_0xd3fd('0x9')](_0xd3fd('0xb'),auth['isAuthenticated'](),controller[_0xd3fd('0xc')]);router[_0xd3fd('0x9')](_0xd3fd('0xd'),auth[_0xd3fd('0xe')](),controller[_0xd3fd('0xf')]);router[_0xd3fd('0x9')](_0xd3fd('0x10'),auth[_0xd3fd('0xe')](),controller[_0xd3fd('0x11')]);router['get'](_0xd3fd('0x12'),auth[_0xd3fd('0xe')](),controller[_0xd3fd('0x13')]);router[_0xd3fd('0x9')](_0xd3fd('0x14'),auth['isAuthenticated'](),controller[_0xd3fd('0x15')]);router[_0xd3fd('0x16')]('/',auth[_0xd3fd('0xe')](),controller['create']);router[_0xd3fd('0x16')](_0xd3fd('0x12'),auth[_0xd3fd('0xe')](),controller[_0xd3fd('0x17')]);router[_0xd3fd('0x16')](_0xd3fd('0x14'),auth['isAuthenticated'](),controller[_0xd3fd('0x18')]);router['put']('/:id',auth[_0xd3fd('0xe')](),controller[_0xd3fd('0x19')]);router[_0xd3fd('0x1a')](_0xd3fd('0xd'),auth[_0xd3fd('0xe')](),controller[_0xd3fd('0x1b')]);router[_0xd3fd('0x1a')](_0xd3fd('0x12'),auth[_0xd3fd('0xe')](),controller[_0xd3fd('0x1c')]);router['delete'](_0xd3fd('0x14'),auth[_0xd3fd('0xe')](),controller[_0xd3fd('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x25f8=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeAgents'];(function(_0x4ac669,_0x2e30c2){var _0x3bb327=function(_0x3f1e07){while(--_0x3f1e07){_0x4ac669['push'](_0x4ac669['shift']());}};_0x3bb327(++_0x2e30c2);}(_0x25f8,0x1ee));var _0x825f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x25f8[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x825f('0x0'));var util=require(_0x825f('0x1'));var path=require(_0x825f('0x2'));var timeout=require(_0x825f('0x3'));var express=require(_0x825f('0x4'));var router=express[_0x825f('0x5')]();var fs_extra=require(_0x825f('0x6'));var auth=require(_0x825f('0x7'));var interaction=require(_0x825f('0x8'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x825f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x825f('0x9')](_0x825f('0xa'),auth[_0x825f('0xb')](),controller[_0x825f('0xc')]);router[_0x825f('0x9')](_0x825f('0xd'),auth[_0x825f('0xb')](),controller[_0x825f('0xe')]);router[_0x825f('0x9')](_0x825f('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x825f('0x9')](_0x825f('0x10'),auth[_0x825f('0xb')](),controller[_0x825f('0x11')]);router[_0x825f('0x9')](_0x825f('0x12'),auth['isAuthenticated'](),controller[_0x825f('0x13')]);router[_0x825f('0x14')]('/',auth[_0x825f('0xb')](),controller[_0x825f('0x15')]);router[_0x825f('0x14')](_0x825f('0x10'),auth['isAuthenticated'](),controller[_0x825f('0x16')]);router['post']('/:id/users',auth[_0x825f('0xb')](),controller[_0x825f('0x17')]);router[_0x825f('0x18')](_0x825f('0xd'),auth[_0x825f('0xb')](),controller['update']);router[_0x825f('0x19')](_0x825f('0xd'),auth['isAuthenticated'](),controller[_0x825f('0x1a')]);router[_0x825f('0x19')](_0x825f('0x10'),auth[_0x825f('0xb')](),controller['removeTeams']);router[_0x825f('0x19')](_0x825f('0x12'),auth[_0x825f('0xb')](),controller[_0x825f('0x1b')]);module[_0x825f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 1cb3e7a..16d07bc 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 _0x94a1=['exports','STRING','name','INTEGER','beepall','roundrobin'];(function(_0x2637d2,_0x309a4a){var _0x1b2d8a=function(_0x35d2da){while(--_0x35d2da){_0x2637d2['push'](_0x2637d2['shift']());}};_0x1b2d8a(++_0x309a4a);}(_0x94a1,0xde));var _0x194a=function(_0x4b71fd,_0x4afc12){_0x4b71fd=_0x4b71fd-0x0;var _0x35f4ac=_0x94a1[_0x4b71fd];return _0x35f4ac;};'use strict';var Sequelize=require('sequelize');module[_0x194a('0x0')]={'name':{'type':Sequelize[_0x194a('0x1')],'unique':_0x194a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x194a('0x1')]},'timeout':{'type':Sequelize[_0x194a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x194a('0x4'),_0x194a('0x5'))}}; \ No newline at end of file +var _0x5768=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x5768,0xdf));var _0x8576=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x5768[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require(_0x8576('0x0'));module[_0x8576('0x1')]={'name':{'type':Sequelize[_0x8576('0x2')],'unique':_0x8576('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8576('0x2')]},'timeout':{'type':Sequelize[_0x8576('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8576('0x5')](_0x8576('0x6'),_0x8576('0x7'),_0x8576('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b52a751..b6015b8 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 _0x6659=['role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','SmsQueueId','UserSmsQueue','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','join','user_has_teams','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x582d5a,_0x3b57c0){var _0x5625ef=function(_0x509d83){while(--_0x509d83){_0x582d5a['push'](_0x582d5a['shift']());}};_0x5625ef(++_0x3b57c0);}(_0x6659,0x169));var _0x9665=function(_0x216150,_0xcd13eb){_0x216150=_0x216150-0x0;var _0x39daae=_0x6659[_0x216150];return _0x39daae;};'use strict';var emlformat=require(_0x9665('0x0'));var rimraf=require(_0x9665('0x1'));var zipdir=require(_0x9665('0x2'));var jsonpatch=require(_0x9665('0x3'));var rp=require(_0x9665('0x4'));var moment=require(_0x9665('0x5'));var BPromise=require(_0x9665('0x6'));var Mustache=require(_0x9665('0x7'));var util=require('util');var path=require(_0x9665('0x8'));var sox=require(_0x9665('0x9'));var csv=require(_0x9665('0xa'));var ejs=require(_0x9665('0xb'));var fs=require('fs');var fs_extra=require(_0x9665('0xc'));var _=require(_0x9665('0xd'));var squel=require('squel');var crypto=require(_0x9665('0xe'));var jsforce=require(_0x9665('0xf'));var deskjs=require(_0x9665('0x10'));var toCsv=require(_0x9665('0xa'));var querystring=require(_0x9665('0x11'));var Papa=require(_0x9665('0x12'));var Redis=require(_0x9665('0x13'));var authService=require(_0x9665('0x14'));var qs=require(_0x9665('0x15'));var as=require(_0x9665('0x16'));var hardwareService=require(_0x9665('0x17'));var logger=require(_0x9665('0x18'))('api');var utils=require(_0x9665('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9665('0x1a'));var db=require(_0x9665('0x1b'))['db'];config[_0x9665('0x1c')]=_[_0x9665('0x1d')](config['redis'],{'host':_0x9665('0x1e'),'port':0x18eb});var socket=require(_0x9665('0x1f'))(new Redis(config[_0x9665('0x1c')]));require(_0x9665('0x20'))[_0x9665('0x21')](socket);function respondWithStatusCode(_0x13b45a,_0x1bcd86){_0x1bcd86=_0x1bcd86||0xcc;return function(_0x523143){if(_0x523143){return _0x13b45a[_0x9665('0x22')](_0x1bcd86);}return _0x13b45a['status'](_0x1bcd86)[_0x9665('0x23')]();};}function respondWithResult(_0x5479f8,_0x4d24d0){_0x4d24d0=_0x4d24d0||0xc8;return function(_0x12077b){if(_0x12077b){return _0x5479f8['status'](_0x4d24d0)['json'](_0x12077b);}};}function respondWithFilteredResult(_0xfae8dd,_0x2f24b9){return function(_0x4f38e6){if(_0x4f38e6){var _0x532ac9=typeof _0x2f24b9[_0x9665('0x24')]===_0x9665('0x25')&&typeof _0x2f24b9[_0x9665('0x26')]===_0x9665('0x25');var _0x273ad3=_0x4f38e6[_0x9665('0x27')];var _0xbd028=_0x532ac9?0x0:_0x2f24b9[_0x9665('0x24')];var _0x3579a8=_0x532ac9?_0x4f38e6['count']:_0x2f24b9[_0x9665('0x24')]+_0x2f24b9[_0x9665('0x26')];var _0x117090;if(_0x3579a8>=_0x273ad3){_0x3579a8=_0x273ad3;_0x117090=0xc8;}else{_0x117090=0xce;}_0xfae8dd[_0x9665('0x28')](_0x117090);return _0xfae8dd[_0x9665('0x29')](_0x9665('0x2a'),_0xbd028+'-'+_0x3579a8+'/'+_0x273ad3)['json'](_0x4f38e6);}return null;};}function patchUpdates(_0x286d6d){return function(_0x410b1a){try{jsonpatch[_0x9665('0x2b')](_0x410b1a,_0x286d6d,!![]);}catch(_0x3b987b){return BPromise[_0x9665('0x2c')](_0x3b987b);}return _0x410b1a[_0x9665('0x2d')]();};}function saveUpdates(_0x29dca8,_0x5b7b8b){return function(_0x38db97){if(_0x38db97){return _0x38db97[_0x9665('0x2e')](_0x29dca8)[_0x9665('0x2f')](function(_0x4903d9){return _0x4903d9;});}return null;};}function removeEntity(_0x137654,_0x2f7ff5){return function(_0x56847b){if(_0x56847b){return _0x56847b['destroy']()[_0x9665('0x2f')](function(){var _0x3d89eb=_0x56847b[_0x9665('0x30')]({'plain':!![]});var _0x1cf48f='SmsQueues';return db[_0x9665('0x31')][_0x9665('0x32')]({'where':{'type':_0x1cf48f,'resourceId':_0x3d89eb['id']}})['then'](function(){return _0x56847b;});})[_0x9665('0x2f')](function(){_0x137654[_0x9665('0x28')](0xcc)[_0x9665('0x23')]();});}};}function handleEntityNotFound(_0xac6037,_0x1e09d6){return function(_0x1ec9cc){if(!_0x1ec9cc){_0xac6037[_0x9665('0x22')](0x194);}return _0x1ec9cc;};}function handleError(_0x48840e,_0x37161e){_0x37161e=_0x37161e||0x1f4;return function(_0x109e25){logger['error'](_0x109e25[_0x9665('0x33')]);if(_0x109e25[_0x9665('0x34')]){delete _0x109e25[_0x9665('0x34')];}_0x48840e[_0x9665('0x28')](_0x37161e)[_0x9665('0x35')](_0x109e25);};}exports[_0x9665('0x36')]=function(_0xac1df6,_0x210f78){var _0x1f2bf7={},_0x6f6425={},_0x30dcb6={'count':0x0,'rows':[]};var _0x46761e=_[_0x9665('0x37')](db[_0x9665('0x38')][_0x9665('0x39')],function(_0x2a619b){return{'name':_0x2a619b[_0x9665('0x3a')],'type':_0x2a619b[_0x9665('0x3b')]['key']};});_0x6f6425[_0x9665('0x3c')]=_['map'](_0x46761e,_0x9665('0x34'));_0x6f6425[_0x9665('0x3d')]=_[_0x9665('0x3e')](_0xac1df6[_0x9665('0x3d')]);_0x6f6425[_0x9665('0x3f')]=_[_0x9665('0x40')](_0x6f6425['model'],_0x6f6425[_0x9665('0x3d')]);_0x1f2bf7[_0x9665('0x41')]=_[_0x9665('0x40')](_0x6f6425[_0x9665('0x3c')],qs[_0x9665('0x42')](_0xac1df6['query'][_0x9665('0x42')]));_0x1f2bf7['attributes']=_0x1f2bf7[_0x9665('0x41')][_0x9665('0x43')]?_0x1f2bf7[_0x9665('0x41')]:_0x6f6425[_0x9665('0x3c')];if(!_0xac1df6[_0x9665('0x3d')][_0x9665('0x44')](_0x9665('0x45'))){_0x1f2bf7[_0x9665('0x26')]=qs[_0x9665('0x26')](_0xac1df6[_0x9665('0x3d')][_0x9665('0x26')]);_0x1f2bf7['offset']=qs[_0x9665('0x24')](_0xac1df6[_0x9665('0x3d')][_0x9665('0x24')]);}_0x1f2bf7[_0x9665('0x46')]=qs[_0x9665('0x47')](_0xac1df6[_0x9665('0x3d')]['sort']);_0x1f2bf7[_0x9665('0x48')]=qs[_0x9665('0x3f')](_[_0x9665('0x49')](_0xac1df6[_0x9665('0x3d')],_0x6f6425['filters']),_0x46761e);if(_0xac1df6[_0x9665('0x3d')][_0x9665('0x4a')]){_0x1f2bf7['where']=_['merge'](_0x1f2bf7['where'],{'$or':_['map'](_0x46761e,function(_0x2ec3c7){if(_0x2ec3c7[_0x9665('0x3b')]!==_0x9665('0x4b')){var _0x2a33bf={};_0x2a33bf[_0x2ec3c7['name']]={'$like':'%'+_0xac1df6[_0x9665('0x3d')]['filter']+'%'};return _0x2a33bf;}})});}_0x1f2bf7=_[_0x9665('0x4c')]({},_0x1f2bf7,_0xac1df6[_0x9665('0x4d')]);var _0x3102ee={'where':_0x1f2bf7[_0x9665('0x48')]};return db[_0x9665('0x38')][_0x9665('0x27')](_0x3102ee)['then'](function(_0x36c084){_0x30dcb6['count']=_0x36c084;if(_0xac1df6[_0x9665('0x3d')][_0x9665('0x4e')]){_0x1f2bf7[_0x9665('0x4f')]=[{'all':!![]}];}return db[_0x9665('0x38')][_0x9665('0x50')](_0x1f2bf7);})[_0x9665('0x2f')](function(_0x4d95bf){_0x30dcb6[_0x9665('0x51')]=_0x4d95bf;return _0x30dcb6;})[_0x9665('0x2f')](respondWithFilteredResult(_0x210f78,_0x1f2bf7))[_0x9665('0x52')](handleError(_0x210f78,null));};exports['show']=function(_0xd04de4,_0x483af1){var _0x30dac4={'raw':!![],'where':{'id':_0xd04de4[_0x9665('0x53')]['id']}},_0x31fea5={};_0x31fea5['model']=_[_0x9665('0x3e')](db['SmsQueue'][_0x9665('0x39')]);_0x31fea5['query']=_['keys'](_0xd04de4['query']);_0x31fea5[_0x9665('0x3f')]=_[_0x9665('0x40')](_0x31fea5[_0x9665('0x3c')],_0x31fea5[_0x9665('0x3d')]);_0x30dac4[_0x9665('0x41')]=_[_0x9665('0x40')](_0x31fea5[_0x9665('0x3c')],qs['fields'](_0xd04de4[_0x9665('0x3d')]['fields']));_0x30dac4['attributes']=_0x30dac4['attributes']['length']?_0x30dac4[_0x9665('0x41')]:_0x31fea5['model'];if(_0xd04de4['query'][_0x9665('0x4e')]){_0x30dac4[_0x9665('0x4f')]=[{'all':!![]}];}_0x30dac4=_['merge']({},_0x30dac4,_0xd04de4[_0x9665('0x4d')]);return db[_0x9665('0x38')][_0x9665('0x54')](_0x30dac4)[_0x9665('0x2f')](handleEntityNotFound(_0x483af1,null))[_0x9665('0x2f')](respondWithResult(_0x483af1,null))['catch'](handleError(_0x483af1,null));};exports['create']=function(_0x147205,_0x23c75d){return db[_0x9665('0x38')][_0x9665('0x55')](_0x147205[_0x9665('0x56')],{})['then'](function(_0x4f95b4){var _0x57da99=_0x147205[_0x9665('0x57')][_0x9665('0x30')]({'plain':!![]});if(!_0x57da99)throw new Error(_0x9665('0x58'));if(_0x57da99[_0x9665('0x59')]==='user'){var _0x390923=_0x4f95b4[_0x9665('0x30')]({'plain':!![]});var _0x421045=_0x9665('0x5a');return db[_0x9665('0x5b')]['find']({'where':{'name':_0x421045,'userProfileId':_0x57da99[_0x9665('0x5c')]},'raw':!![]})[_0x9665('0x2f')](function(_0x3f0b40){if(_0x3f0b40&&_0x3f0b40[_0x9665('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x390923[_0x9665('0x34')],'resourceId':_0x390923['id'],'type':_0x3f0b40['name'],'sectionId':_0x3f0b40['id']},{})[_0x9665('0x2f')](function(){return _0x4f95b4;});}else{return _0x4f95b4;}})[_0x9665('0x52')](function(_0x423fb9){logger[_0x9665('0x5e')](_0x9665('0x5f'),_0x423fb9);throw _0x423fb9;});}return _0x4f95b4;})[_0x9665('0x2f')](respondWithResult(_0x23c75d,0xc9))[_0x9665('0x52')](handleError(_0x23c75d,null));};exports['update']=function(_0xfd654f,_0x21a6f4){if(_0xfd654f[_0x9665('0x56')]['id']){delete _0xfd654f[_0x9665('0x56')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0xfd654f[_0x9665('0x53')]['id']}})['then'](handleEntityNotFound(_0x21a6f4,null))[_0x9665('0x2f')](saveUpdates(_0xfd654f['body'],null))[_0x9665('0x2f')](respondWithResult(_0x21a6f4,null))[_0x9665('0x52')](handleError(_0x21a6f4,null));};exports[_0x9665('0x32')]=function(_0x514919,_0x3f3003){return db['SmsQueue'][_0x9665('0x54')]({'where':{'id':_0x514919[_0x9665('0x53')]['id']}})[_0x9665('0x2f')](handleEntityNotFound(_0x3f3003,null))[_0x9665('0x2f')](removeEntity(_0x3f3003,null))[_0x9665('0x52')](handleError(_0x3f3003,null));};exports['describe']=function(_0x5c6848,_0x4df240){return db[_0x9665('0x38')]['describe']()['then'](respondWithResult(_0x4df240,null))[_0x9665('0x52')](handleError(_0x4df240,null));};exports['getMembers']=function(_0xc7649d,_0x5d47f2,_0x5c2048){var _0x22fd85={'raw':!![],'where':{}},_0x5194c2={},_0x4f637e;return db['SmsQueue'][_0x9665('0x60')]({'where':{'id':_0xc7649d[_0x9665('0x53')]['id']}})[_0x9665('0x2f')](handleEntityNotFound(_0x5d47f2,null))[_0x9665('0x2f')](function(_0x188eea){if(_0x188eea){_0x4f637e=_0x188eea[_0x9665('0x30')]({'plain':!![]});_0x5194c2[_0x9665('0x3c')]=_[_0x9665('0x3e')](db['UserSmsQueue'][_0x9665('0x39')]);_0x5194c2['query']=_[_0x9665('0x3e')](_0xc7649d['query']);_0x5194c2[_0x9665('0x3f')]=_[_0x9665('0x40')](_0x5194c2['model'],_0x5194c2[_0x9665('0x3d')]);_0x22fd85[_0x9665('0x41')]=_['intersection'](_0x5194c2[_0x9665('0x3c')],qs[_0x9665('0x42')](_0xc7649d[_0x9665('0x3d')][_0x9665('0x42')]));_0x22fd85['attributes']=_0x22fd85[_0x9665('0x41')][_0x9665('0x43')]?_0x22fd85[_0x9665('0x41')]:_0x5194c2[_0x9665('0x3c')];if(!_0xc7649d[_0x9665('0x3d')][_0x9665('0x44')](_0x9665('0x45'))){_0x22fd85[_0x9665('0x26')]=qs[_0x9665('0x26')](_0xc7649d[_0x9665('0x3d')]['limit']);_0x22fd85[_0x9665('0x24')]=qs[_0x9665('0x24')](_0xc7649d['query'][_0x9665('0x24')]);}_0x22fd85[_0x9665('0x46')]=qs[_0x9665('0x47')](_0xc7649d[_0x9665('0x3d')][_0x9665('0x47')]);_0x22fd85[_0x9665('0x48')]=qs[_0x9665('0x3f')](_['pick'](_0xc7649d['query'],_0x5194c2[_0x9665('0x3f')]));_0x22fd85[_0x9665('0x48')][_0x9665('0x61')]=_0x188eea['id'];if(_0xc7649d[_0x9665('0x3d')][_0x9665('0x4a')]){_0x22fd85['where']=_[_0x9665('0x4c')](_0x22fd85[_0x9665('0x48')],{'$or':_[_0x9665('0x37')](_0x22fd85[_0x9665('0x41')],function(_0x47cb28){var _0x6a8050={};_0x6a8050[_0x47cb28]={'$like':'%'+_0xc7649d[_0x9665('0x3d')][_0x9665('0x4a')]+'%'};return _0x6a8050;})});}_0x22fd85=_[_0x9665('0x4c')]({},_0x22fd85,_0xc7649d[_0x9665('0x4d')]);return db[_0x9665('0x62')][_0x9665('0x50')](_0x22fd85);}})[_0x9665('0x2f')](function(_0x28f5c9){if(_0x28f5c9){return db['User'][_0x9665('0x63')]({'where':{'id':_[_0x9665('0x37')](_0x28f5c9,_0x9665('0x64')),'role':'agent'},'attributes':['id',_0x9665('0x34'),_0x9665('0x65'),_0x9665('0x66'),_0x9665('0x67')]});}})['then'](function(_0x12b314){if(_0x12b314){return{'count':_0x12b314[_0x9665('0x27')],'rows':_[_0x9665('0x37')](_0x12b314[_0x9665('0x51')],function(_0x4f7506){return{'membername':_0x4f7506[_0x9665('0x34')],'UserId':_0x4f7506['id'],'queue_name':_0x4f637e['name'],'SmsQueueId':_0x4f637e['id'],'interface':util[_0x9665('0x68')](_0x9665('0x69'),_0x9665('0x6a'),_0x4f7506[_0x9665('0x34')]),'penalty':0x0,'paused':_0x4f7506[_0x9665('0x65')],'createdAt':_0x4f7506['createdAt'],'updatedAt':_0x4f7506['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9665('0x2f')](respondWithFilteredResult(_0x5d47f2,_0x22fd85))[_0x9665('0x52')](handleError(_0x5d47f2,null));};exports[_0x9665('0x6b')]=function(_0x25ab78,_0x34d03f,_0x462298){var _0x1d42dc={};var _0x3200d2={};var _0x5eb32e;var _0x3c0f5d;return db['SmsQueue'][_0x9665('0x60')]({'where':{'id':_0x25ab78['params']['id']}})['then'](handleEntityNotFound(_0x34d03f,null))[_0x9665('0x2f')](function(_0x3d7948){if(_0x3d7948){_0x5eb32e=_0x3d7948;_0x3200d2[_0x9665('0x3c')]=_[_0x9665('0x3e')](db['Team']['rawAttributes']);_0x3200d2['query']=_[_0x9665('0x3e')](_0x25ab78[_0x9665('0x3d')]);_0x3200d2[_0x9665('0x3f')]=_[_0x9665('0x40')](_0x3200d2[_0x9665('0x3c')],_0x3200d2[_0x9665('0x3d')]);_0x1d42dc[_0x9665('0x41')]=_['intersection'](_0x3200d2[_0x9665('0x3c')],qs['fields'](_0x25ab78[_0x9665('0x3d')][_0x9665('0x42')]));_0x1d42dc[_0x9665('0x41')]=_0x1d42dc[_0x9665('0x41')][_0x9665('0x43')]?_0x1d42dc[_0x9665('0x41')]:_0x3200d2['model'];_0x1d42dc['order']=qs[_0x9665('0x47')](_0x25ab78['query']['sort']);_0x1d42dc[_0x9665('0x48')]=qs[_0x9665('0x3f')](_['pick'](_0x25ab78[_0x9665('0x3d')],_0x3200d2[_0x9665('0x3f')]));if(_0x25ab78[_0x9665('0x3d')][_0x9665('0x4a')]){_0x1d42dc[_0x9665('0x48')]=_[_0x9665('0x4c')](_0x1d42dc[_0x9665('0x48')],{'$or':_[_0x9665('0x37')](_0x1d42dc[_0x9665('0x41')],function(_0x411a2){var _0x1dcc55={};_0x1dcc55[_0x411a2]={'$like':'%'+_0x25ab78[_0x9665('0x3d')][_0x9665('0x4a')]+'%'};return _0x1dcc55;})});}_0x1d42dc=_[_0x9665('0x4c')]({},_0x1d42dc,_0x25ab78['options']);return _0x5eb32e[_0x9665('0x6b')](_0x1d42dc);}})['then'](function(_0x288424){if(_0x288424){_0x3c0f5d=_0x288424[_0x9665('0x43')];if(!_0x25ab78[_0x9665('0x3d')][_0x9665('0x44')](_0x9665('0x45'))){_0x1d42dc[_0x9665('0x26')]=qs[_0x9665('0x26')](_0x25ab78[_0x9665('0x3d')][_0x9665('0x26')]);_0x1d42dc[_0x9665('0x24')]=qs[_0x9665('0x24')](_0x25ab78[_0x9665('0x3d')][_0x9665('0x24')]);}return _0x5eb32e[_0x9665('0x6b')](_0x1d42dc);}})[_0x9665('0x2f')](function(_0x572202){if(_0x572202){return _0x572202?{'count':_0x3c0f5d,'rows':_0x572202}:null;}})[_0x9665('0x2f')](respondWithResult(_0x34d03f,null))[_0x9665('0x52')](handleError(_0x34d03f,null));};exports[_0x9665('0x6c')]=function(_0x5ecceb,_0x354a22,_0x360fba){var _0x329ffc=_0x5ecceb[_0x9665('0x56')][_0x9665('0x6d')];return db['Team']['findAll']({'where':{'id':_0x329ffc},'attributes':['id'],'include':[{'model':db[_0x9665('0x6e')],'as':_0x9665('0x6f'),'attributes':['id',_0x9665('0x34'),_0x9665('0x70'),_0x9665('0x71'),_0x9665('0x72')],'raw':!![]}]})[_0x9665('0x2f')](function(_0x416768){if(_0x416768){var _0xa408e=_[_0x9665('0x73')](_0x416768,function(_0x16623e){var _0x4f2bb8=_0x16623e['get']({'plain':!![]});return _0x4f2bb8[_0x9665('0x6f')];});return db[_0x9665('0x38')]['find']({'where':{'id':_0x5ecceb[_0x9665('0x53')]['id']}})[_0x9665('0x2f')](function(_0x21b21b){return db[_0x9665('0x74')]['transaction'](function(_0x686371){return _0x21b21b[_0x9665('0x6c')](_0x329ffc,{'transaction':_0x686371})['then'](function(){return BPromise[_0x9665('0x75')](_0xa408e,function(_0x22e69c){return db[_0x9665('0x62')][_0x9665('0x76')]({'where':{'UserId':_0x22e69c['id'],'SmsQueueId':_0x5ecceb[_0x9665('0x53')]['id']},'transaction':_0x686371});});})[_0x9665('0x2f')](function(){_0xa408e[_0x9665('0x77')](function(_0x48e4fe){socket[_0x9665('0x78')](_0x9665('0x79'),{'UserId':_0x48e4fe['id'],'SmsQueueId':_0x21b21b['id']});});});});});}})[_0x9665('0x2f')](respondWithStatusCode(_0x354a22,null))[_0x9665('0x52')](handleError(_0x354a22,null));};exports[_0x9665('0x7a')]=function(_0x488707,_0x181e73,_0x127e70){return db[_0x9665('0x7b')][_0x9665('0x50')]({'where':{'id':_0x488707[_0x9665('0x3d')][_0x9665('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9665('0x2f')](handleEntityNotFound(_0x181e73,null))[_0x9665('0x2f')](function(_0x33b90e){var _0x5b4b78=_['map'](_0x33b90e,'id');var _0x84119d=[];var _0x50a93d=[];var _0x1f14b0=squel['select']();_0x1f14b0[_0x9665('0x7c')](_0x9665('0x7d'))['from']('team_has_sms_queues','tq')[_0x9665('0x7e')](_0x9665('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9665('0x48')](_0x9665('0x80'),_0x488707['params']['id']);for(var _0x3fe8d9=0x0;_0x3fe8d9<_0x33b90e['length'];_0x3fe8d9+=0x1){let _0x464176=_0x33b90e[_0x3fe8d9];for(var _0x235a61=0x0;_0x235a61<_0x464176[_0x9665('0x6f')][_0x9665('0x43')];_0x235a61+=0x1){let _0x3f72e7=_0x464176[_0x9665('0x6f')][_0x235a61];var _0x3ba9a2=_0x1f14b0[_0x9665('0x81')]();_0x3ba9a2[_0x9665('0x48')]('ut.UserId\x20=\x20?',_0x3f72e7['id']);_0x50a93d[_0x9665('0x82')](db['sequelize']['query'](_0x3ba9a2[_0x9665('0x83')](),{'type':db['sequelize'][_0x9665('0x84')][_0x9665('0x85')]})[_0x9665('0x2f')](function(_0x14d021){if(_0x14d021[_0x9665('0x43')]===0x1){return _0x3f72e7['id'];}else{var _0x38cdf5=_[_0x9665('0x86')](_[_0x9665('0x37')](_0x14d021,_0x9665('0x87')),function(_0x42b955){return _[_0x9665('0x88')](_0x5b4b78,_0x42b955);});if(_0x38cdf5){return _0x3f72e7['id'];}}}));}}return BPromise[_0x9665('0x89')](_0x50a93d)[_0x9665('0x2f')](function(_0x136c25){_0x84119d=_(_0x84119d)[_0x9665('0x8a')](_0x136c25)[_0x9665('0x8b')]()[_0x9665('0x8c')]();return db[_0x9665('0x38')]['find']({'where':{'id':_0x488707[_0x9665('0x53')]['id']}})[_0x9665('0x2f')](function(_0x237b79){return db[_0x9665('0x74')][_0x9665('0x8d')](function(_0x244480){return _0x237b79[_0x9665('0x7a')](_0x488707[_0x9665('0x3d')]['ids'],{'transaction':_0x244480})[_0x9665('0x2f')](function(){if(!_[_0x9665('0x8e')](_0x84119d)){return _0x237b79[_0x9665('0x8f')](_0x84119d,{'transaction':_0x244480});}})['then'](function(){_0x84119d[_0x9665('0x77')](function(_0x3419ab){socket[_0x9665('0x78')](_0x9665('0x90'),{'UserId':_0x3419ab,'SmsQueueId':_0x237b79['id']});});});});});});})['then'](respondWithStatusCode(_0x181e73,null))['catch'](handleError(_0x181e73,null));};exports['addAgents']=function(_0x1c748b,_0x76bbe2,_0xd1ed1d){return db[_0x9665('0x38')][_0x9665('0x54')]({'where':{'id':_0x1c748b[_0x9665('0x53')]['id']}})[_0x9665('0x2f')](handleEntityNotFound(_0x76bbe2,null))[_0x9665('0x2f')](function(_0x2a775a){if(_0x2a775a){return _0x2a775a[_0x9665('0x91')](_0x1c748b[_0x9665('0x56')][_0x9665('0x6d')],_[_0x9665('0x92')](_0x1c748b[_0x9665('0x56')],['ids','id'])||{})[_0x9665('0x93')](function(_0x252281){for(var _0x56b2de=0x0;_0x56b2de<_0x1c748b['body'][_0x9665('0x6d')][_0x9665('0x43')];_0x56b2de+=0x1){socket[_0x9665('0x78')](_0x9665('0x79'),{'UserId':Number(_0x1c748b[_0x9665('0x56')][_0x9665('0x6d')][_0x56b2de]),'SmsQueueId':Number(_0x1c748b[_0x9665('0x53')]['id'])});}return _0x252281;});}})[_0x9665('0x2f')](respondWithResult(_0x76bbe2,null))[_0x9665('0x52')](handleError(_0x76bbe2,null));};exports['removeAgents']=function(_0x5327c3,_0x3fc213,_0x4c5111){return db[_0x9665('0x38')][_0x9665('0x54')]({'where':{'id':_0x5327c3[_0x9665('0x53')]['id']}})[_0x9665('0x2f')](handleEntityNotFound(_0x3fc213,null))[_0x9665('0x2f')](function(_0x47895d){if(_0x47895d){return _0x47895d['removeAgents'](_0x5327c3['query'][_0x9665('0x6d')])['then'](function(){if(_[_0x9665('0x94')](_0x5327c3[_0x9665('0x3d')]['ids'])){for(var _0x3d6759=0x0;_0x3d6759<_0x5327c3[_0x9665('0x3d')][_0x9665('0x6d')][_0x9665('0x43')];_0x3d6759+=0x1){socket[_0x9665('0x78')](_0x9665('0x90'),{'UserId':Number(_0x5327c3[_0x9665('0x3d')]['ids'][_0x3d6759]),'SmsQueueId':Number(_0x5327c3['params']['id'])});}}else{socket[_0x9665('0x78')](_0x9665('0x90'),{'UserId':Number(_0x5327c3[_0x9665('0x3d')]['ids']),'SmsQueueId':Number(_0x5327c3['params']['id'])});}});}})[_0x9665('0x2f')](respondWithStatusCode(_0x3fc213,null))['catch'](handleError(_0x3fc213,null));};exports[_0x9665('0x95')]=function(_0x525f71,_0x30abb1,_0x512ffa){var _0x3f6427={};var _0x114f28={};var _0xde6636;var _0x5cb55f;return db[_0x9665('0x38')][_0x9665('0x60')]({'where':{'id':_0x525f71[_0x9665('0x53')]['id']}})['then'](handleEntityNotFound(_0x30abb1,null))[_0x9665('0x2f')](function(_0xaca876){if(_0xaca876){_0xde6636=_0xaca876;_0x114f28[_0x9665('0x3c')]=_[_0x9665('0x3e')](db[_0x9665('0x6e')][_0x9665('0x39')]);_0x114f28['query']=_['keys'](_0x525f71[_0x9665('0x3d')]);_0x114f28['filters']=_[_0x9665('0x40')](_0x114f28[_0x9665('0x3c')],_0x114f28[_0x9665('0x3d')]);_0x3f6427[_0x9665('0x41')]=_[_0x9665('0x40')](_0x114f28[_0x9665('0x3c')],qs[_0x9665('0x42')](_0x525f71['query']['fields']));_0x3f6427['attributes']=_0x3f6427[_0x9665('0x41')][_0x9665('0x43')]?_0x3f6427['attributes']:_0x114f28[_0x9665('0x3c')];_0x3f6427[_0x9665('0x46')]=qs[_0x9665('0x47')](_0x525f71[_0x9665('0x3d')][_0x9665('0x47')]);_0x3f6427[_0x9665('0x48')]=qs[_0x9665('0x3f')](_['pick'](_0x525f71[_0x9665('0x3d')],_0x114f28['filters']));if(_0x525f71[_0x9665('0x3d')][_0x9665('0x4a')]){_0x3f6427[_0x9665('0x48')]=_[_0x9665('0x4c')](_0x3f6427[_0x9665('0x48')],{'$or':_[_0x9665('0x37')](_0x3f6427[_0x9665('0x41')],function(_0x224e89){var _0x2c0abd={};_0x2c0abd[_0x224e89]={'$like':'%'+_0x525f71[_0x9665('0x3d')][_0x9665('0x4a')]+'%'};return _0x2c0abd;})});}_0x3f6427=_['merge']({},_0x3f6427,_0x525f71['options']);return _0xde6636[_0x9665('0x95')](_0x3f6427);}})['then'](function(_0x3b92a8){if(_0x3b92a8){_0x5cb55f=_0x3b92a8[_0x9665('0x43')];if(!_0x525f71[_0x9665('0x3d')][_0x9665('0x44')](_0x9665('0x45'))){_0x3f6427[_0x9665('0x26')]=qs['limit'](_0x525f71[_0x9665('0x3d')][_0x9665('0x26')]);_0x3f6427[_0x9665('0x24')]=qs[_0x9665('0x24')](_0x525f71[_0x9665('0x3d')][_0x9665('0x24')]);}return _0xde6636['getAgents'](_0x3f6427);}})[_0x9665('0x2f')](function(_0x2a195f){if(_0x2a195f){return _0x2a195f?{'count':_0x5cb55f,'rows':_0x2a195f}:null;}})[_0x9665('0x2f')](respondWithResult(_0x30abb1,null))[_0x9665('0x52')](handleError(_0x30abb1,null));}; \ No newline at end of file +var _0x031e=['socket.io-emitter','./smsQueue.socket','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','SmsQueues','sendStatus','error','name','send','index','map','SmsQueue','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','catch','show','rawAttributes','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','UserId','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','User','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','forEach','userSmsQueue:remove','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0xce6743,_0x4e33d7){var _0x2e7989=function(_0x584eb0){while(--_0x584eb0){_0xce6743['push'](_0xce6743['shift']());}};_0x2e7989(++_0x4e33d7);}(_0x031e,0x75));var _0xe031=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x031e[_0x4aa838];return _0x3abff0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe031('0x0'));var zipdir=require(_0xe031('0x1'));var jsonpatch=require(_0xe031('0x2'));var rp=require(_0xe031('0x3'));var moment=require('moment');var BPromise=require(_0xe031('0x4'));var Mustache=require(_0xe031('0x5'));var util=require(_0xe031('0x6'));var path=require(_0xe031('0x7'));var sox=require(_0xe031('0x8'));var csv=require(_0xe031('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe031('0xa'));var squel=require('squel');var crypto=require(_0xe031('0xb'));var jsforce=require(_0xe031('0xc'));var deskjs=require(_0xe031('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe031('0xe'));var Papa=require(_0xe031('0xf'));var Redis=require(_0xe031('0x10'));var authService=require(_0xe031('0x11'));var qs=require(_0xe031('0x12'));var as=require(_0xe031('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe031('0x14'))(_0xe031('0x15'));var utils=require(_0xe031('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe031('0x17'));var db=require(_0xe031('0x18'))['db'];config[_0xe031('0x19')]=_[_0xe031('0x1a')](config['redis'],{'host':_0xe031('0x1b'),'port':0x18eb});var socket=require(_0xe031('0x1c'))(new Redis(config[_0xe031('0x19')]));require(_0xe031('0x1d'))['register'](socket);function respondWithStatusCode(_0x4309c5,_0x5eb323){_0x5eb323=_0x5eb323||0xcc;return function(_0x504e7a){if(_0x504e7a){return _0x4309c5['sendStatus'](_0x5eb323);}return _0x4309c5[_0xe031('0x1e')](_0x5eb323)[_0xe031('0x1f')]();};}function respondWithResult(_0x54a57c,_0x381e75){_0x381e75=_0x381e75||0xc8;return function(_0x432594){if(_0x432594){return _0x54a57c[_0xe031('0x1e')](_0x381e75)['json'](_0x432594);}};}function respondWithFilteredResult(_0x4ffe8f,_0x3f7c46){return function(_0x21db71){if(_0x21db71){var _0x52c5a4=typeof _0x3f7c46['offset']===_0xe031('0x20')&&typeof _0x3f7c46[_0xe031('0x21')]===_0xe031('0x20');var _0x3767d0=_0x21db71['count'];var _0x5733d4=_0x52c5a4?0x0:_0x3f7c46['offset'];var _0x36ed47=_0x52c5a4?_0x21db71['count']:_0x3f7c46[_0xe031('0x22')]+_0x3f7c46[_0xe031('0x21')];var _0x59a764;if(_0x36ed47>=_0x3767d0){_0x36ed47=_0x3767d0;_0x59a764=0xc8;}else{_0x59a764=0xce;}_0x4ffe8f[_0xe031('0x1e')](_0x59a764);return _0x4ffe8f[_0xe031('0x23')](_0xe031('0x24'),_0x5733d4+'-'+_0x36ed47+'/'+_0x3767d0)[_0xe031('0x25')](_0x21db71);}return null;};}function patchUpdates(_0x316338){return function(_0x423053){try{jsonpatch[_0xe031('0x26')](_0x423053,_0x316338,!![]);}catch(_0x2aeb39){return BPromise[_0xe031('0x27')](_0x2aeb39);}return _0x423053['save']();};}function saveUpdates(_0x326475,_0x132077){return function(_0x3e9dce){if(_0x3e9dce){return _0x3e9dce[_0xe031('0x28')](_0x326475)[_0xe031('0x29')](function(_0x4e8f76){return _0x4e8f76;});}return null;};}function removeEntity(_0x5e7929,_0x1332ab){return function(_0xbfea81){if(_0xbfea81){return _0xbfea81[_0xe031('0x2a')]()[_0xe031('0x29')](function(){var _0x3d82dc=_0xbfea81[_0xe031('0x2b')]({'plain':!![]});var _0x2596d5=_0xe031('0x2c');return db['UserProfileResource'][_0xe031('0x2a')]({'where':{'type':_0x2596d5,'resourceId':_0x3d82dc['id']}})['then'](function(){return _0xbfea81;});})['then'](function(){_0x5e7929[_0xe031('0x1e')](0xcc)[_0xe031('0x1f')]();});}};}function handleEntityNotFound(_0x1fef84,_0x18bec6){return function(_0x521571){if(!_0x521571){_0x1fef84[_0xe031('0x2d')](0x194);}return _0x521571;};}function handleError(_0x44e4b8,_0x5d2ecf){_0x5d2ecf=_0x5d2ecf||0x1f4;return function(_0x36e383){logger[_0xe031('0x2e')](_0x36e383['stack']);if(_0x36e383['name']){delete _0x36e383[_0xe031('0x2f')];}_0x44e4b8[_0xe031('0x1e')](_0x5d2ecf)[_0xe031('0x30')](_0x36e383);};}exports[_0xe031('0x31')]=function(_0x2148e1,_0x377c58){var _0x35e203={},_0x59e679={},_0x12b95b={'count':0x0,'rows':[]};var _0x1a18f8=_[_0xe031('0x32')](db[_0xe031('0x33')]['rawAttributes'],function(_0x478edc){return{'name':_0x478edc['fieldName'],'type':_0x478edc[_0xe031('0x34')][_0xe031('0x35')]};});_0x59e679['model']=_[_0xe031('0x32')](_0x1a18f8,_0xe031('0x2f'));_0x59e679[_0xe031('0x36')]=_[_0xe031('0x37')](_0x2148e1['query']);_0x59e679[_0xe031('0x38')]=_[_0xe031('0x39')](_0x59e679[_0xe031('0x3a')],_0x59e679[_0xe031('0x36')]);_0x35e203[_0xe031('0x3b')]=_[_0xe031('0x39')](_0x59e679[_0xe031('0x3a')],qs['fields'](_0x2148e1['query'][_0xe031('0x3c')]));_0x35e203[_0xe031('0x3b')]=_0x35e203[_0xe031('0x3b')][_0xe031('0x3d')]?_0x35e203[_0xe031('0x3b')]:_0x59e679[_0xe031('0x3a')];if(!_0x2148e1[_0xe031('0x36')]['hasOwnProperty'](_0xe031('0x3e'))){_0x35e203[_0xe031('0x21')]=qs['limit'](_0x2148e1[_0xe031('0x36')][_0xe031('0x21')]);_0x35e203[_0xe031('0x22')]=qs['offset'](_0x2148e1['query'][_0xe031('0x22')]);}_0x35e203[_0xe031('0x3f')]=qs['sort'](_0x2148e1[_0xe031('0x36')][_0xe031('0x40')]);_0x35e203[_0xe031('0x41')]=qs[_0xe031('0x38')](_[_0xe031('0x42')](_0x2148e1[_0xe031('0x36')],_0x59e679['filters']),_0x1a18f8);if(_0x2148e1[_0xe031('0x36')][_0xe031('0x43')]){_0x35e203[_0xe031('0x41')]=_[_0xe031('0x44')](_0x35e203[_0xe031('0x41')],{'$or':_[_0xe031('0x32')](_0x1a18f8,function(_0x4f7c09){if(_0x4f7c09[_0xe031('0x34')]!=='VIRTUAL'){var _0x2bee2a={};_0x2bee2a[_0x4f7c09[_0xe031('0x2f')]]={'$like':'%'+_0x2148e1[_0xe031('0x36')][_0xe031('0x43')]+'%'};return _0x2bee2a;}})});}_0x35e203=_['merge']({},_0x35e203,_0x2148e1[_0xe031('0x45')]);var _0x340306={'where':_0x35e203[_0xe031('0x41')]};return db[_0xe031('0x33')][_0xe031('0x46')](_0x340306)[_0xe031('0x29')](function(_0x3aa1ed){_0x12b95b[_0xe031('0x46')]=_0x3aa1ed;if(_0x2148e1[_0xe031('0x36')]['includeAll']){_0x35e203[_0xe031('0x47')]=[{'all':!![]}];}return db[_0xe031('0x33')][_0xe031('0x48')](_0x35e203);})['then'](function(_0x1c30a9){_0x12b95b['rows']=_0x1c30a9;return _0x12b95b;})[_0xe031('0x29')](respondWithFilteredResult(_0x377c58,_0x35e203))[_0xe031('0x49')](handleError(_0x377c58,null));};exports[_0xe031('0x4a')]=function(_0x59e756,_0x232585){var _0x6fd3fd={'raw':!![],'where':{'id':_0x59e756['params']['id']}},_0x363e29={};_0x363e29['model']=_[_0xe031('0x37')](db[_0xe031('0x33')][_0xe031('0x4b')]);_0x363e29[_0xe031('0x36')]=_[_0xe031('0x37')](_0x59e756[_0xe031('0x36')]);_0x363e29[_0xe031('0x38')]=_[_0xe031('0x39')](_0x363e29[_0xe031('0x3a')],_0x363e29[_0xe031('0x36')]);_0x6fd3fd[_0xe031('0x3b')]=_['intersection'](_0x363e29[_0xe031('0x3a')],qs[_0xe031('0x3c')](_0x59e756[_0xe031('0x36')][_0xe031('0x3c')]));_0x6fd3fd[_0xe031('0x3b')]=_0x6fd3fd[_0xe031('0x3b')][_0xe031('0x3d')]?_0x6fd3fd[_0xe031('0x3b')]:_0x363e29[_0xe031('0x3a')];if(_0x59e756[_0xe031('0x36')][_0xe031('0x4c')]){_0x6fd3fd[_0xe031('0x47')]=[{'all':!![]}];}_0x6fd3fd=_[_0xe031('0x44')]({},_0x6fd3fd,_0x59e756[_0xe031('0x45')]);return db[_0xe031('0x33')]['find'](_0x6fd3fd)[_0xe031('0x29')](handleEntityNotFound(_0x232585,null))[_0xe031('0x29')](respondWithResult(_0x232585,null))[_0xe031('0x49')](handleError(_0x232585,null));};exports['create']=function(_0x3cd696,_0x3e085b){return db[_0xe031('0x33')]['create'](_0x3cd696[_0xe031('0x4d')],{})[_0xe031('0x29')](function(_0x25c7ea){var _0x19d6bd=_0x3cd696[_0xe031('0x4e')][_0xe031('0x2b')]({'plain':!![]});if(!_0x19d6bd)throw new Error(_0xe031('0x4f'));if(_0x19d6bd[_0xe031('0x50')]===_0xe031('0x4e')){var _0xbb97ea=_0x25c7ea[_0xe031('0x2b')]({'plain':!![]});var _0x1c6677='SmsQueues';return db['UserProfileSection'][_0xe031('0x51')]({'where':{'name':_0x1c6677,'userProfileId':_0x19d6bd[_0xe031('0x52')]},'raw':!![]})[_0xe031('0x29')](function(_0x3f01e6){if(_0x3f01e6&&_0x3f01e6[_0xe031('0x53')]===0x0){return db[_0xe031('0x54')][_0xe031('0x55')]({'name':_0xbb97ea['name'],'resourceId':_0xbb97ea['id'],'type':_0x3f01e6['name'],'sectionId':_0x3f01e6['id']},{})[_0xe031('0x29')](function(){return _0x25c7ea;});}else{return _0x25c7ea;}})[_0xe031('0x49')](function(_0x52d9e4){logger[_0xe031('0x2e')](_0xe031('0x56'),_0x52d9e4);throw _0x52d9e4;});}return _0x25c7ea;})[_0xe031('0x29')](respondWithResult(_0x3e085b,0xc9))[_0xe031('0x49')](handleError(_0x3e085b,null));};exports[_0xe031('0x28')]=function(_0x47dca7,_0x32d4da){if(_0x47dca7['body']['id']){delete _0x47dca7[_0xe031('0x4d')]['id'];}return db[_0xe031('0x33')][_0xe031('0x51')]({'where':{'id':_0x47dca7[_0xe031('0x57')]['id']}})['then'](handleEntityNotFound(_0x32d4da,null))[_0xe031('0x29')](saveUpdates(_0x47dca7[_0xe031('0x4d')],null))[_0xe031('0x29')](respondWithResult(_0x32d4da,null))[_0xe031('0x49')](handleError(_0x32d4da,null));};exports[_0xe031('0x2a')]=function(_0x5f26c3,_0x13c46c){return db[_0xe031('0x33')][_0xe031('0x51')]({'where':{'id':_0x5f26c3[_0xe031('0x57')]['id']}})['then'](handleEntityNotFound(_0x13c46c,null))[_0xe031('0x29')](removeEntity(_0x13c46c,null))[_0xe031('0x49')](handleError(_0x13c46c,null));};exports[_0xe031('0x58')]=function(_0x3e5117,_0x30b836){return db[_0xe031('0x33')]['describe']()[_0xe031('0x29')](respondWithResult(_0x30b836,null))['catch'](handleError(_0x30b836,null));};exports[_0xe031('0x59')]=function(_0x5794a2,_0x420337,_0xfeb543){var _0x31ef28={'raw':!![],'where':{}},_0x3b2784={},_0x38b320;return db[_0xe031('0x33')][_0xe031('0x5a')]({'where':{'id':_0x5794a2[_0xe031('0x57')]['id']}})[_0xe031('0x29')](handleEntityNotFound(_0x420337,null))['then'](function(_0x40e831){if(_0x40e831){_0x38b320=_0x40e831[_0xe031('0x2b')]({'plain':!![]});_0x3b2784[_0xe031('0x3a')]=_[_0xe031('0x37')](db[_0xe031('0x5b')][_0xe031('0x4b')]);_0x3b2784['query']=_[_0xe031('0x37')](_0x5794a2[_0xe031('0x36')]);_0x3b2784[_0xe031('0x38')]=_[_0xe031('0x39')](_0x3b2784[_0xe031('0x3a')],_0x3b2784[_0xe031('0x36')]);_0x31ef28[_0xe031('0x3b')]=_[_0xe031('0x39')](_0x3b2784[_0xe031('0x3a')],qs[_0xe031('0x3c')](_0x5794a2[_0xe031('0x36')]['fields']));_0x31ef28[_0xe031('0x3b')]=_0x31ef28['attributes'][_0xe031('0x3d')]?_0x31ef28[_0xe031('0x3b')]:_0x3b2784['model'];if(!_0x5794a2[_0xe031('0x36')]['hasOwnProperty'](_0xe031('0x3e'))){_0x31ef28[_0xe031('0x21')]=qs[_0xe031('0x21')](_0x5794a2['query']['limit']);_0x31ef28[_0xe031('0x22')]=qs['offset'](_0x5794a2['query'][_0xe031('0x22')]);}_0x31ef28[_0xe031('0x3f')]=qs[_0xe031('0x40')](_0x5794a2[_0xe031('0x36')][_0xe031('0x40')]);_0x31ef28[_0xe031('0x41')]=qs[_0xe031('0x38')](_[_0xe031('0x42')](_0x5794a2[_0xe031('0x36')],_0x3b2784[_0xe031('0x38')]));_0x31ef28[_0xe031('0x41')][_0xe031('0x5c')]=_0x40e831['id'];if(_0x5794a2['query'][_0xe031('0x43')]){_0x31ef28[_0xe031('0x41')]=_['merge'](_0x31ef28[_0xe031('0x41')],{'$or':_[_0xe031('0x32')](_0x31ef28[_0xe031('0x3b')],function(_0x2ca5f8){var _0x38aaf9={};_0x38aaf9[_0x2ca5f8]={'$like':'%'+_0x5794a2['query']['filter']+'%'};return _0x38aaf9;})});}_0x31ef28=_[_0xe031('0x44')]({},_0x31ef28,_0x5794a2['options']);return db[_0xe031('0x5b')]['findAll'](_0x31ef28);}})[_0xe031('0x29')](function(_0x525bfb){if(_0x525bfb){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x525bfb,_0xe031('0x5d')),'role':'agent'},'attributes':['id',_0xe031('0x2f'),_0xe031('0x5e'),_0xe031('0x5f'),_0xe031('0x60')]});}})['then'](function(_0x20d00b){if(_0x20d00b){return{'count':_0x20d00b['count'],'rows':_['map'](_0x20d00b[_0xe031('0x61')],function(_0x4226f8){return{'membername':_0x4226f8[_0xe031('0x2f')],'UserId':_0x4226f8['id'],'queue_name':_0x38b320['name'],'SmsQueueId':_0x38b320['id'],'interface':util[_0xe031('0x62')](_0xe031('0x63'),_0xe031('0x64'),_0x4226f8[_0xe031('0x2f')]),'penalty':0x0,'paused':_0x4226f8[_0xe031('0x5e')],'createdAt':_0x4226f8[_0xe031('0x60')],'updatedAt':_0x4226f8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe031('0x29')](respondWithFilteredResult(_0x420337,_0x31ef28))[_0xe031('0x49')](handleError(_0x420337,null));};exports[_0xe031('0x65')]=function(_0x55a2cc,_0x20c003,_0x224501){var _0x214f2b={};var _0x7fb702={};var _0x1c8ea6;var _0x193dfd;return db[_0xe031('0x33')]['findOne']({'where':{'id':_0x55a2cc[_0xe031('0x57')]['id']}})[_0xe031('0x29')](handleEntityNotFound(_0x20c003,null))[_0xe031('0x29')](function(_0x3f48bd){if(_0x3f48bd){_0x1c8ea6=_0x3f48bd;_0x7fb702[_0xe031('0x3a')]=_[_0xe031('0x37')](db[_0xe031('0x66')][_0xe031('0x4b')]);_0x7fb702[_0xe031('0x36')]=_[_0xe031('0x37')](_0x55a2cc[_0xe031('0x36')]);_0x7fb702[_0xe031('0x38')]=_[_0xe031('0x39')](_0x7fb702[_0xe031('0x3a')],_0x7fb702['query']);_0x214f2b['attributes']=_[_0xe031('0x39')](_0x7fb702[_0xe031('0x3a')],qs['fields'](_0x55a2cc[_0xe031('0x36')][_0xe031('0x3c')]));_0x214f2b[_0xe031('0x3b')]=_0x214f2b[_0xe031('0x3b')][_0xe031('0x3d')]?_0x214f2b[_0xe031('0x3b')]:_0x7fb702[_0xe031('0x3a')];_0x214f2b['order']=qs[_0xe031('0x40')](_0x55a2cc[_0xe031('0x36')]['sort']);_0x214f2b[_0xe031('0x41')]=qs[_0xe031('0x38')](_[_0xe031('0x42')](_0x55a2cc[_0xe031('0x36')],_0x7fb702[_0xe031('0x38')]));if(_0x55a2cc['query'][_0xe031('0x43')]){_0x214f2b['where']=_[_0xe031('0x44')](_0x214f2b[_0xe031('0x41')],{'$or':_['map'](_0x214f2b[_0xe031('0x3b')],function(_0x14ed07){var _0x58a43a={};_0x58a43a[_0x14ed07]={'$like':'%'+_0x55a2cc[_0xe031('0x36')][_0xe031('0x43')]+'%'};return _0x58a43a;})});}_0x214f2b=_[_0xe031('0x44')]({},_0x214f2b,_0x55a2cc[_0xe031('0x45')]);return _0x1c8ea6[_0xe031('0x65')](_0x214f2b);}})['then'](function(_0x50eb72){if(_0x50eb72){_0x193dfd=_0x50eb72['length'];if(!_0x55a2cc[_0xe031('0x36')][_0xe031('0x67')]('nolimit')){_0x214f2b[_0xe031('0x21')]=qs['limit'](_0x55a2cc['query'][_0xe031('0x21')]);_0x214f2b[_0xe031('0x22')]=qs['offset'](_0x55a2cc[_0xe031('0x36')][_0xe031('0x22')]);}return _0x1c8ea6[_0xe031('0x65')](_0x214f2b);}})[_0xe031('0x29')](function(_0x567f20){if(_0x567f20){return _0x567f20?{'count':_0x193dfd,'rows':_0x567f20}:null;}})['then'](respondWithResult(_0x20c003,null))[_0xe031('0x49')](handleError(_0x20c003,null));};exports[_0xe031('0x68')]=function(_0x1bca0c,_0x3bcb59,_0x1254e4){var _0x4a0a30=_0x1bca0c[_0xe031('0x4d')][_0xe031('0x69')];return db[_0xe031('0x66')][_0xe031('0x48')]({'where':{'id':_0x4a0a30},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe031('0x2f'),_0xe031('0x6a'),_0xe031('0x6b'),_0xe031('0x6c')],'raw':!![]}]})[_0xe031('0x29')](function(_0x155c3b){if(_0x155c3b){var _0x5c295a=_[_0xe031('0x6d')](_0x155c3b,function(_0x141bda){var _0x392f66=_0x141bda[_0xe031('0x2b')]({'plain':!![]});return _0x392f66['Agents'];});return db[_0xe031('0x33')][_0xe031('0x51')]({'where':{'id':_0x1bca0c[_0xe031('0x57')]['id']}})['then'](function(_0x44267a){return db[_0xe031('0x6e')][_0xe031('0x6f')](function(_0x1599ee){return _0x44267a[_0xe031('0x68')](_0x4a0a30,{'transaction':_0x1599ee})['then'](function(){return BPromise[_0xe031('0x70')](_0x5c295a,function(_0x18cd25){return db[_0xe031('0x5b')][_0xe031('0x71')]({'where':{'UserId':_0x18cd25['id'],'SmsQueueId':_0x1bca0c['params']['id']},'transaction':_0x1599ee});});})[_0xe031('0x29')](function(){_0x5c295a['forEach'](function(_0x57a1b9){socket[_0xe031('0x72')](_0xe031('0x73'),{'UserId':_0x57a1b9['id'],'SmsQueueId':_0x44267a['id']});});});});});}})[_0xe031('0x29')](respondWithStatusCode(_0x3bcb59,null))[_0xe031('0x49')](handleError(_0x3bcb59,null));};exports[_0xe031('0x74')]=function(_0x2c48d1,_0x1330bc,_0x40d45d){return db[_0xe031('0x66')][_0xe031('0x48')]({'where':{'id':_0x2c48d1[_0xe031('0x36')][_0xe031('0x69')]},'attributes':['id'],'include':[{'model':db[_0xe031('0x75')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1330bc,null))[_0xe031('0x29')](function(_0x35191f){var _0x1bd6c3=_[_0xe031('0x32')](_0x35191f,'id');var _0x364f06=[];var _0x479f91=[];var _0x24b285=squel[_0xe031('0x76')]();_0x24b285[_0xe031('0x77')]('tq.TeamId')[_0xe031('0x78')](_0xe031('0x79'),'tq')[_0xe031('0x7a')](_0xe031('0x7b'),'ut',_0xe031('0x7c'))[_0xe031('0x41')](_0xe031('0x7d'),_0x2c48d1[_0xe031('0x57')]['id']);for(var _0x28112a=0x0;_0x28112a<_0x35191f[_0xe031('0x3d')];_0x28112a+=0x1){let _0x518370=_0x35191f[_0x28112a];for(var _0x30effa=0x0;_0x30effa<_0x518370['Agents']['length'];_0x30effa+=0x1){let _0x540c09=_0x518370[_0xe031('0x7e')][_0x30effa];var _0x1f226f=_0x24b285[_0xe031('0x7f')]();_0x1f226f['where'](_0xe031('0x80'),_0x540c09['id']);_0x479f91[_0xe031('0x81')](db[_0xe031('0x6e')]['query'](_0x1f226f['toString'](),{'type':db[_0xe031('0x6e')][_0xe031('0x82')]['SELECT']})[_0xe031('0x29')](function(_0x36fb87){if(_0x36fb87[_0xe031('0x3d')]===0x1){return _0x540c09['id'];}else{var _0x1b2388=_[_0xe031('0x83')](_['map'](_0x36fb87,_0xe031('0x84')),function(_0x1fe326){return _[_0xe031('0x85')](_0x1bd6c3,_0x1fe326);});if(_0x1b2388){return _0x540c09['id'];}}}));}}return BPromise[_0xe031('0x86')](_0x479f91)[_0xe031('0x29')](function(_0x54b298){_0x364f06=_(_0x364f06)[_0xe031('0x87')](_0x54b298)[_0xe031('0x88')]()['value']();return db[_0xe031('0x33')]['find']({'where':{'id':_0x2c48d1[_0xe031('0x57')]['id']}})[_0xe031('0x29')](function(_0x69e176){return db[_0xe031('0x6e')][_0xe031('0x6f')](function(_0x573fbb){return _0x69e176[_0xe031('0x74')](_0x2c48d1[_0xe031('0x36')]['ids'],{'transaction':_0x573fbb})[_0xe031('0x29')](function(){if(!_[_0xe031('0x89')](_0x364f06)){return _0x69e176[_0xe031('0x8a')](_0x364f06,{'transaction':_0x573fbb});}})[_0xe031('0x29')](function(){_0x364f06[_0xe031('0x8b')](function(_0x5abb86){socket[_0xe031('0x72')](_0xe031('0x8c'),{'UserId':_0x5abb86,'SmsQueueId':_0x69e176['id']});});});});});});})['then'](respondWithStatusCode(_0x1330bc,null))[_0xe031('0x49')](handleError(_0x1330bc,null));};exports['addAgents']=function(_0xbd60d2,_0x249e3a,_0x259313){return db[_0xe031('0x33')][_0xe031('0x51')]({'where':{'id':_0xbd60d2[_0xe031('0x57')]['id']}})[_0xe031('0x29')](handleEntityNotFound(_0x249e3a,null))[_0xe031('0x29')](function(_0x43e441){if(_0x43e441){return _0x43e441['addAgents'](_0xbd60d2[_0xe031('0x4d')][_0xe031('0x69')],_[_0xe031('0x8d')](_0xbd60d2[_0xe031('0x4d')],['ids','id'])||{})[_0xe031('0x8e')](function(_0x36d94e){for(var _0xb4d839=0x0;_0xb4d839<_0xbd60d2[_0xe031('0x4d')][_0xe031('0x69')]['length'];_0xb4d839+=0x1){socket[_0xe031('0x72')]('userSmsQueue:save',{'UserId':Number(_0xbd60d2[_0xe031('0x4d')]['ids'][_0xb4d839]),'SmsQueueId':Number(_0xbd60d2[_0xe031('0x57')]['id'])});}return _0x36d94e;});}})[_0xe031('0x29')](respondWithResult(_0x249e3a,null))[_0xe031('0x49')](handleError(_0x249e3a,null));};exports[_0xe031('0x8a')]=function(_0x111636,_0x1299f1,_0x2ca36c){return db[_0xe031('0x33')][_0xe031('0x51')]({'where':{'id':_0x111636[_0xe031('0x57')]['id']}})[_0xe031('0x29')](handleEntityNotFound(_0x1299f1,null))[_0xe031('0x29')](function(_0x115de7){if(_0x115de7){return _0x115de7['removeAgents'](_0x111636[_0xe031('0x36')][_0xe031('0x69')])[_0xe031('0x29')](function(){if(_[_0xe031('0x8f')](_0x111636[_0xe031('0x36')][_0xe031('0x69')])){for(var _0xa25094=0x0;_0xa25094<_0x111636[_0xe031('0x36')][_0xe031('0x69')]['length'];_0xa25094+=0x1){socket[_0xe031('0x72')](_0xe031('0x8c'),{'UserId':Number(_0x111636[_0xe031('0x36')][_0xe031('0x69')][_0xa25094]),'SmsQueueId':Number(_0x111636['params']['id'])});}}else{socket['emit'](_0xe031('0x8c'),{'UserId':Number(_0x111636[_0xe031('0x36')][_0xe031('0x69')]),'SmsQueueId':Number(_0x111636[_0xe031('0x57')]['id'])});}});}})[_0xe031('0x29')](respondWithStatusCode(_0x1299f1,null))[_0xe031('0x49')](handleError(_0x1299f1,null));};exports[_0xe031('0x90')]=function(_0x472fd9,_0x2f7165,_0x5ead09){var _0x5d60f7={};var _0x122b5b={};var _0x51c1ad;var _0x1a51b9;return db[_0xe031('0x33')][_0xe031('0x5a')]({'where':{'id':_0x472fd9[_0xe031('0x57')]['id']}})[_0xe031('0x29')](handleEntityNotFound(_0x2f7165,null))['then'](function(_0x3bb709){if(_0x3bb709){_0x51c1ad=_0x3bb709;_0x122b5b['model']=_[_0xe031('0x37')](db[_0xe031('0x75')][_0xe031('0x4b')]);_0x122b5b[_0xe031('0x36')]=_['keys'](_0x472fd9[_0xe031('0x36')]);_0x122b5b[_0xe031('0x38')]=_[_0xe031('0x39')](_0x122b5b['model'],_0x122b5b[_0xe031('0x36')]);_0x5d60f7[_0xe031('0x3b')]=_['intersection'](_0x122b5b[_0xe031('0x3a')],qs[_0xe031('0x3c')](_0x472fd9[_0xe031('0x36')][_0xe031('0x3c')]));_0x5d60f7[_0xe031('0x3b')]=_0x5d60f7[_0xe031('0x3b')][_0xe031('0x3d')]?_0x5d60f7[_0xe031('0x3b')]:_0x122b5b[_0xe031('0x3a')];_0x5d60f7[_0xe031('0x3f')]=qs[_0xe031('0x40')](_0x472fd9[_0xe031('0x36')]['sort']);_0x5d60f7[_0xe031('0x41')]=qs['filters'](_[_0xe031('0x42')](_0x472fd9['query'],_0x122b5b['filters']));if(_0x472fd9['query'][_0xe031('0x43')]){_0x5d60f7['where']=_['merge'](_0x5d60f7['where'],{'$or':_[_0xe031('0x32')](_0x5d60f7[_0xe031('0x3b')],function(_0x3fb032){var _0x24d783={};_0x24d783[_0x3fb032]={'$like':'%'+_0x472fd9['query']['filter']+'%'};return _0x24d783;})});}_0x5d60f7=_[_0xe031('0x44')]({},_0x5d60f7,_0x472fd9['options']);return _0x51c1ad[_0xe031('0x90')](_0x5d60f7);}})[_0xe031('0x29')](function(_0x208163){if(_0x208163){_0x1a51b9=_0x208163[_0xe031('0x3d')];if(!_0x472fd9[_0xe031('0x36')]['hasOwnProperty'](_0xe031('0x3e'))){_0x5d60f7['limit']=qs[_0xe031('0x21')](_0x472fd9[_0xe031('0x36')][_0xe031('0x21')]);_0x5d60f7[_0xe031('0x22')]=qs['offset'](_0x472fd9[_0xe031('0x36')][_0xe031('0x22')]);}return _0x51c1ad['getAgents'](_0x5d60f7);}})[_0xe031('0x29')](function(_0x432076){if(_0x432076){return _0x432076?{'count':_0x1a51b9,'rows':_0x432076}:null;}})[_0xe031('0x29')](respondWithResult(_0x2f7165,null))[_0xe031('0x49')](handleError(_0x2f7165,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 18805cd..d55b61b 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 _0x78f4=['../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x5d6083,_0x4cd6e0){var _0x547fea=function(_0x93bd0b){while(--_0x93bd0b){_0x5d6083['push'](_0x5d6083['shift']());}};_0x547fea(++_0x4cd6e0);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x478f('0x0'))['db'][_0x478f('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x478f('0x2')](0x0);var events={'afterCreate':_0x478f('0x3'),'afterUpdate':'update','afterDestroy':_0x478f('0x4')};function emitEvent(_0x4d004a){return function(_0x1965e3,_0xc3eb,_0x229f69){SmsQueueEvents['emit'](_0x4d004a+':'+_0x1965e3['id'],_0x1965e3);SmsQueueEvents[_0x478f('0x5')](_0x4d004a,_0x1965e3);_0x229f69(null);};}for(var e in events){if(events[_0x478f('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x478f('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xe512=['events','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x383440,_0x19bb4c){var _0x4ffc43=function(_0x5196fc){while(--_0x5196fc){_0x383440['push'](_0x383440['shift']());}};_0x4ffc43(++_0x19bb4c);}(_0xe512,0x104));var _0x2e51=function(_0x1b5bf0,_0x5b9af0){_0x1b5bf0=_0x1b5bf0-0x0;var _0x3e3456=_0xe512[_0x1b5bf0];return _0x3e3456;};'use strict';var EventEmitter=require(_0x2e51('0x0'));var SmsQueue=require(_0x2e51('0x1'))['db'][_0x2e51('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2e51('0x3')](0x0);var events={'afterCreate':_0x2e51('0x4'),'afterUpdate':'update','afterDestroy':_0x2e51('0x5')};function emitEvent(_0x3c9807){return function(_0x1a2383,_0x3216eb,_0x2dc26f){SmsQueueEvents[_0x2e51('0x6')](_0x3c9807+':'+_0x1a2383['id'],_0x1a2383);SmsQueueEvents[_0x2e51('0x6')](_0x3c9807,_0x1a2383);_0x2dc26f(null);};}for(var e in events){if(events[_0x2e51('0x7')](e)){var event=events[e];SmsQueue[_0x2e51('0x8')](e,emitEvent(event));}}module[_0x2e51('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 a6a979b..73f6bd0 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 _0x2bda=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2bda,0x1cb));var _0xa2bd=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x2bda[_0x1e2080];return _0x260111;};'use strict';var _=require(_0xa2bd('0x0'));var util=require(_0xa2bd('0x1'));var logger=require(_0xa2bd('0x2'))(_0xa2bd('0x3'));var moment=require(_0xa2bd('0x4'));var BPromise=require(_0xa2bd('0x5'));var rp=require(_0xa2bd('0x6'));var fs=require('fs');var path=require(_0xa2bd('0x7'));var rimraf=require(_0xa2bd('0x8'));var config=require(_0xa2bd('0x9'));var attributes=require(_0xa2bd('0xa'));module[_0xa2bd('0xb')]=function(_0x4b8869,_0x2666ff){return _0x4b8869[_0xa2bd('0xc')]('SmsQueue',attributes,{'tableName':_0xa2bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9a2=['api','moment','request-promise','path','rimraf','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb9a2,0x129));var _0x2b9a=function(_0x319815,_0x3210a3){_0x319815=_0x319815-0x0;var _0x4b7dcd=_0xb9a2[_0x319815];return _0x4b7dcd;};'use strict';var _=require(_0x2b9a('0x0'));var util=require(_0x2b9a('0x1'));var logger=require(_0x2b9a('0x2'))(_0x2b9a('0x3'));var moment=require(_0x2b9a('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b9a('0x5'));var fs=require('fs');var path=require(_0x2b9a('0x6'));var rimraf=require(_0x2b9a('0x7'));var config=require('../../config/environment');var attributes=require(_0x2b9a('0x8'));module[_0x2b9a('0x9')]=function(_0x1a5549,_0x80b3f9){return _0x1a5549[_0x2b9a('0xa')]('SmsQueue',attributes,{'tableName':_0x2b9a('0xb'),'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 df85ec7..24fd984 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 _0xda6d=['register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowSmsQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','localhost','./smsQueue.socket'];(function(_0x1acd1d,_0x3c8c1a){var _0x59f5a7=function(_0x431aec){while(--_0x431aec){_0x1acd1d['push'](_0x1acd1d['shift']());}};_0x59f5a7(++_0x3c8c1a);}(_0xda6d,0xea));var _0xdda6=function(_0x31e70e,_0x44f9d8){_0x31e70e=_0x31e70e-0x0;var _0x298e33=_0xda6d[_0x31e70e];return _0x298e33;};'use strict';var _=require(_0xdda6('0x0'));var util=require(_0xdda6('0x1'));var moment=require('moment');var BPromise=require(_0xdda6('0x2'));var rs=require(_0xdda6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdda6('0x4'))['db'];var utils=require(_0xdda6('0x5'));var logger=require('../../config/logger')(_0xdda6('0x6'));var config=require('../../config/environment');var jayson=require(_0xdda6('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xdda6('0x8')]=_['defaults'](config[_0xdda6('0x8')],{'host':_0xdda6('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdda6('0x8')]));require(_0xdda6('0xa'))[_0xdda6('0xb')](socket);function respondWithRpcPromise(_0x16f81d,_0x2aff36,_0x30a895){return new BPromise(function(_0x33ddfe,_0x1d0ab4){return client[_0xdda6('0xc')](_0x16f81d,_0x30a895)['then'](function(_0x47ad59){logger[_0xdda6('0xd')](_0xdda6('0xe'),_0x2aff36,_0xdda6('0xf'));logger[_0xdda6('0x10')](_0xdda6('0x11'),_0x2aff36,_0xdda6('0xf'),JSON[_0xdda6('0x12')](_0x47ad59));if(_0x47ad59[_0xdda6('0x13')]){if(_0x47ad59[_0xdda6('0x13')]['code']===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x2aff36,_0x47ad59[_0xdda6('0x13')][_0xdda6('0x14')]);return _0x1d0ab4(_0x47ad59[_0xdda6('0x13')][_0xdda6('0x14')]);}logger['error'](_0xdda6('0xe'),_0x2aff36,_0x47ad59[_0xdda6('0x13')]['message']);return _0x33ddfe(_0x47ad59[_0xdda6('0x13')]['message']);}else{logger['info'](_0xdda6('0xe'),_0x2aff36,_0xdda6('0xf'));_0x33ddfe(_0x47ad59['result'][_0xdda6('0x14')]);}})[_0xdda6('0x15')](function(_0x1ffa73){logger[_0xdda6('0x13')](_0xdda6('0xe'),_0x2aff36,_0x1ffa73);_0x1d0ab4(_0x1ffa73);});});}exports[_0xdda6('0x16')]=function(_0x5462ca){var _0x2813c9=this;return new Promise(function(_0x3fb426,_0x1f5239){return db[_0xdda6('0x17')][_0xdda6('0x18')]({'raw':_0x5462ca['options']?_0x5462ca[_0xdda6('0x19')][_0xdda6('0x1a')]===undefined?!![]:![]:!![],'where':_0x5462ca[_0xdda6('0x19')]?_0x5462ca['options'][_0xdda6('0x1b')]||null:null,'attributes':_0x5462ca[_0xdda6('0x19')]?_0x5462ca[_0xdda6('0x19')][_0xdda6('0x1c')]||null:null,'limit':_0x5462ca[_0xdda6('0x19')]?_0x5462ca[_0xdda6('0x19')][_0xdda6('0x1d')]||null:null,'include':_0x5462ca[_0xdda6('0x19')]?_0x5462ca[_0xdda6('0x19')][_0xdda6('0x1e')]?_[_0xdda6('0x1f')](_0x5462ca['options']['include'],function(_0x1e40fc){return{'model':db[_0x1e40fc['model']],'as':_0x1e40fc['as'],'attributes':_0x1e40fc['attributes'],'include':_0x1e40fc['include']?_[_0xdda6('0x1f')](_0x1e40fc['include'],function(_0x56824d){return{'model':db[_0x56824d[_0xdda6('0x20')]],'as':_0x56824d['as'],'attributes':_0x56824d[_0xdda6('0x1c')],'include':_0x56824d[_0xdda6('0x1e')]?_['map'](_0x56824d[_0xdda6('0x1e')],function(_0x143a0a){return{'model':db[_0x143a0a['model']],'as':_0x143a0a['as'],'attributes':_0x143a0a[_0xdda6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdda6('0x21')](function(_0x2e708a){logger['info']('GetSmsQueue',_0x5462ca);logger[_0xdda6('0x10')]('GetSmsQueue',_0x5462ca,JSON[_0xdda6('0x12')](_0x2e708a));_0x3fb426(_0x2e708a);})['catch'](function(_0x2d8c14){logger[_0xdda6('0x13')](_0xdda6('0x16'),_0x2d8c14[_0xdda6('0x14')],_0x5462ca);_0x1f5239(_0x2813c9[_0xdda6('0x13')](0x1f4,_0x2d8c14[_0xdda6('0x14')]));});});};exports[_0xdda6('0x22')]=function(_0x2e46cf){var _0x290fa9=this;return new Promise(function(_0x419791,_0x521ccc){return db[_0xdda6('0x17')]['find']({'raw':_0x2e46cf[_0xdda6('0x19')]?_0x2e46cf['options'][_0xdda6('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e46cf[_0xdda6('0x19')]?_0x2e46cf[_0xdda6('0x19')]['where']||null:null,'attributes':_0x2e46cf[_0xdda6('0x19')]?_0x2e46cf[_0xdda6('0x19')][_0xdda6('0x1c')]||null:null,'include':_0x2e46cf[_0xdda6('0x19')]?_0x2e46cf[_0xdda6('0x19')][_0xdda6('0x1e')]?_['map'](_0x2e46cf['options'][_0xdda6('0x1e')],function(_0x1260ab){return{'model':db[_0x1260ab[_0xdda6('0x20')]],'as':_0x1260ab['as'],'attributes':_0x1260ab[_0xdda6('0x1c')],'include':_0x1260ab[_0xdda6('0x1e')]?_['map'](_0x1260ab['include'],function(_0xcfbc86){return{'model':db[_0xcfbc86[_0xdda6('0x20')]],'as':_0xcfbc86['as'],'attributes':_0xcfbc86[_0xdda6('0x1c')],'include':_0xcfbc86['include']?_[_0xdda6('0x1f')](_0xcfbc86[_0xdda6('0x1e')],function(_0xc2002d){return{'model':db[_0xc2002d[_0xdda6('0x20')]],'as':_0xc2002d['as'],'attributes':_0xc2002d[_0xdda6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54ebed){logger[_0xdda6('0xd')](_0xdda6('0x22'),_0x2e46cf);logger[_0xdda6('0x10')](_0xdda6('0x22'),_0x2e46cf,JSON['stringify'](_0x54ebed));_0x419791(_0x54ebed);})[_0xdda6('0x15')](function(_0x3fd524){logger[_0xdda6('0x13')](_0xdda6('0x22'),_0x3fd524[_0xdda6('0x14')],_0x2e46cf);_0x521ccc(_0x290fa9[_0xdda6('0x13')](0x1f4,_0x3fd524[_0xdda6('0x14')]));});});}; \ No newline at end of file +var _0xa66a=['socket.io-emitter','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','raw','options','where','attributes','limit','map','include','model','info','ShowSmsQueue','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x2bbf5b,_0x52f838){var _0x214271=function(_0xb24b65){while(--_0xb24b65){_0x2bbf5b['push'](_0x2bbf5b['shift']());}};_0x214271(++_0x52f838);}(_0xa66a,0x1c7));var _0xaa66=function(_0x239c31,_0x288d7d){_0x239c31=_0x239c31-0x0;var _0x2a7784=_0xa66a[_0x239c31];return _0x2a7784;};'use strict';var _=require(_0xaa66('0x0'));var util=require(_0xaa66('0x1'));var moment=require(_0xaa66('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa66('0x4'))['db'];var utils=require(_0xaa66('0x5'));var logger=require(_0xaa66('0x6'))('rpc');var config=require(_0xaa66('0x7'));var jayson=require(_0xaa66('0x8'));var client=jayson[_0xaa66('0x9')][_0xaa66('0xa')]({'port':0x232a});config[_0xaa66('0xb')]=_['defaults'](config[_0xaa66('0xb')],{'host':_0xaa66('0xc'),'port':0x18eb});var socket=require(_0xaa66('0xd'))(new Redis(config[_0xaa66('0xb')]));require(_0xaa66('0xe'))['register'](socket);function respondWithRpcPromise(_0x5eb317,_0x460996,_0x1fdb8e){return new BPromise(function(_0x1bba1f,_0x32ada7){return client[_0xaa66('0xf')](_0x5eb317,_0x1fdb8e)[_0xaa66('0x10')](function(_0x223129){logger['info'](_0xaa66('0x11'),_0x460996,_0xaa66('0x12'));logger[_0xaa66('0x13')](_0xaa66('0x14'),_0x460996,_0xaa66('0x12'),JSON[_0xaa66('0x15')](_0x223129));if(_0x223129[_0xaa66('0x16')]){if(_0x223129[_0xaa66('0x16')][_0xaa66('0x17')]===0x1f4){logger['error'](_0xaa66('0x11'),_0x460996,_0x223129[_0xaa66('0x16')]['message']);return _0x32ada7(_0x223129[_0xaa66('0x16')][_0xaa66('0x18')]);}logger['error'](_0xaa66('0x11'),_0x460996,_0x223129[_0xaa66('0x16')][_0xaa66('0x18')]);return _0x1bba1f(_0x223129[_0xaa66('0x16')][_0xaa66('0x18')]);}else{logger['info'](_0xaa66('0x11'),_0x460996,_0xaa66('0x12'));_0x1bba1f(_0x223129[_0xaa66('0x19')][_0xaa66('0x18')]);}})['catch'](function(_0x57b0fc){logger[_0xaa66('0x16')](_0xaa66('0x11'),_0x460996,_0x57b0fc);_0x32ada7(_0x57b0fc);});});}exports[_0xaa66('0x1a')]=function(_0x2229ca){var _0x204a5d=this;return new Promise(function(_0x4c12a5,_0x5539e4){return db[_0xaa66('0x1b')]['findAll']({'raw':_0x2229ca['options']?_0x2229ca['options'][_0xaa66('0x1c')]===undefined?!![]:![]:!![],'where':_0x2229ca[_0xaa66('0x1d')]?_0x2229ca[_0xaa66('0x1d')][_0xaa66('0x1e')]||null:null,'attributes':_0x2229ca[_0xaa66('0x1d')]?_0x2229ca[_0xaa66('0x1d')][_0xaa66('0x1f')]||null:null,'limit':_0x2229ca[_0xaa66('0x1d')]?_0x2229ca[_0xaa66('0x1d')][_0xaa66('0x20')]||null:null,'include':_0x2229ca['options']?_0x2229ca[_0xaa66('0x1d')]['include']?_[_0xaa66('0x21')](_0x2229ca[_0xaa66('0x1d')][_0xaa66('0x22')],function(_0x5cae14){return{'model':db[_0x5cae14['model']],'as':_0x5cae14['as'],'attributes':_0x5cae14['attributes'],'include':_0x5cae14['include']?_[_0xaa66('0x21')](_0x5cae14['include'],function(_0x3d3b27){return{'model':db[_0x3d3b27['model']],'as':_0x3d3b27['as'],'attributes':_0x3d3b27['attributes'],'include':_0x3d3b27['include']?_[_0xaa66('0x21')](_0x3d3b27[_0xaa66('0x22')],function(_0x2613a4){return{'model':db[_0x2613a4[_0xaa66('0x23')]],'as':_0x2613a4['as'],'attributes':_0x2613a4[_0xaa66('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfdb09d){logger[_0xaa66('0x24')](_0xaa66('0x1a'),_0x2229ca);logger[_0xaa66('0x13')](_0xaa66('0x1a'),_0x2229ca,JSON[_0xaa66('0x15')](_0xfdb09d));_0x4c12a5(_0xfdb09d);})['catch'](function(_0x2b83c5){logger['error']('GetSmsQueue',_0x2b83c5[_0xaa66('0x18')],_0x2229ca);_0x5539e4(_0x204a5d['error'](0x1f4,_0x2b83c5[_0xaa66('0x18')]));});});};exports[_0xaa66('0x25')]=function(_0x2aa438){var _0x31b735=this;return new Promise(function(_0x1347f7,_0x3c1ebc){return db[_0xaa66('0x1b')]['find']({'raw':_0x2aa438[_0xaa66('0x1d')]?_0x2aa438['options']['raw']===undefined?!![]:![]:!![],'where':_0x2aa438['options']?_0x2aa438[_0xaa66('0x1d')][_0xaa66('0x1e')]||null:null,'attributes':_0x2aa438[_0xaa66('0x1d')]?_0x2aa438[_0xaa66('0x1d')]['attributes']||null:null,'include':_0x2aa438[_0xaa66('0x1d')]?_0x2aa438[_0xaa66('0x1d')][_0xaa66('0x22')]?_[_0xaa66('0x21')](_0x2aa438[_0xaa66('0x1d')][_0xaa66('0x22')],function(_0x21a130){return{'model':db[_0x21a130[_0xaa66('0x23')]],'as':_0x21a130['as'],'attributes':_0x21a130['attributes'],'include':_0x21a130[_0xaa66('0x22')]?_[_0xaa66('0x21')](_0x21a130['include'],function(_0x2b8a11){return{'model':db[_0x2b8a11['model']],'as':_0x2b8a11['as'],'attributes':_0x2b8a11[_0xaa66('0x1f')],'include':_0x2b8a11[_0xaa66('0x22')]?_[_0xaa66('0x21')](_0x2b8a11[_0xaa66('0x22')],function(_0x54c471){return{'model':db[_0x54c471[_0xaa66('0x23')]],'as':_0x54c471['as'],'attributes':_0x54c471[_0xaa66('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaa66('0x10')](function(_0x3c9b31){logger[_0xaa66('0x24')](_0xaa66('0x25'),_0x2aa438);logger[_0xaa66('0x13')](_0xaa66('0x25'),_0x2aa438,JSON[_0xaa66('0x15')](_0x3c9b31));_0x1347f7(_0x3c9b31);})[_0xaa66('0x26')](function(_0x362b1a){logger['error'](_0xaa66('0x25'),_0x362b1a[_0xaa66('0x18')],_0x2aa438);_0x3c1ebc(_0x31b735[_0xaa66('0x16')](0x1f4,_0x362b1a[_0xaa66('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 1406d9e..25e6133 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 _0xc82d=['removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','emit'];(function(_0x5df2df,_0x34d2f5){var _0x69a0af=function(_0x5241d2){while(--_0x5241d2){_0x5df2df['push'](_0x5df2df['shift']());}};_0x69a0af(++_0x34d2f5);}(_0xc82d,0xa4));var _0xdc82=function(_0x4b1eda,_0x1ca265){_0x4b1eda=_0x4b1eda-0x0;var _0x520e6b=_0xc82d[_0x4b1eda];return _0x520e6b;};'use strict';var SmsQueueEvents=require(_0xdc82('0x0'));var events=[_0xdc82('0x1'),_0xdc82('0x2'),'update'];function createListener(_0x363389,_0x3ccdc0){return function(_0x103b4a){_0x3ccdc0[_0xdc82('0x3')](_0x363389,_0x103b4a);};}function removeListener(_0x3ac082,_0x45ec89){return function(){SmsQueueEvents[_0xdc82('0x4')](_0x3ac082,_0x45ec89);};}exports[_0xdc82('0x5')]=function(_0x120eaf){for(var _0x39ead8=0x0,_0x308f75=events[_0xdc82('0x6')];_0x39ead8<_0x308f75;_0x39ead8++){var _0x2e5f21=events[_0x39ead8];var _0x3559cc=createListener(_0xdc82('0x7')+_0x2e5f21,_0x120eaf);SmsQueueEvents['on'](_0x2e5f21,_0x3559cc);}}; \ No newline at end of file +var _0xe046=['register','smsQueue:','./smsQueue.events','update','emit','removeListener'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0xe046,0x98));var _0x6e04=function(_0x161802,_0x5d29cc){_0x161802=_0x161802-0x0;var _0x31d1bf=_0xe046[_0x161802];return _0x31d1bf;};'use strict';var SmsQueueEvents=require(_0x6e04('0x0'));var events=['save','remove',_0x6e04('0x1')];function createListener(_0x51f58b,_0xa8a218){return function(_0x545fef){_0xa8a218[_0x6e04('0x2')](_0x51f58b,_0x545fef);};}function removeListener(_0x5b4a1f,_0x359525){return function(){SmsQueueEvents[_0x6e04('0x3')](_0x5b4a1f,_0x359525);};}exports[_0x6e04('0x4')]=function(_0x5ce6d3){for(var _0x532b3d=0x0,_0x580df9=events['length'];_0x532b3d<_0x580df9;_0x532b3d++){var _0x67c1fd=events[_0x532b3d];var _0x3be066=createListener(_0x6e04('0x5')+_0x67c1fd,_0x5ce6d3);SmsQueueEvents['on'](_0x67c1fd,_0x3be066);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 70a723d..6eba6da 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 _0x1353=['get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x390883,_0x5bcef7){var _0x4f9322=function(_0x21ffac){while(--_0x21ffac){_0x390883['push'](_0x390883['shift']());}};_0x4f9322(++_0x5bcef7);}(_0x1353,0xb3));var _0x3135=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x1353[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x3135('0x0'));var util=require(_0x3135('0x1'));var path=require(_0x3135('0x2'));var timeout=require(_0x3135('0x3'));var express=require(_0x3135('0x4'));var router=express[_0x3135('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3135('0x6'));var interaction=require(_0x3135('0x7'));var config=require(_0x3135('0x8'));var controller=require(_0x3135('0x9'));router[_0x3135('0xa')]('/',auth['isAuthenticated'](),controller[_0x3135('0xb')]);router[_0x3135('0xa')]('/describe',auth[_0x3135('0xc')](),controller[_0x3135('0xd')]);router[_0x3135('0xa')](_0x3135('0xe'),auth[_0x3135('0xc')](),controller['show']);router[_0x3135('0xf')]('/',auth[_0x3135('0xc')](),controller[_0x3135('0x10')]);router[_0x3135('0x11')](_0x3135('0xe'),auth['isAuthenticated'](),controller[_0x3135('0x12')]);router['delete'](_0x3135('0xe'),auth['isAuthenticated'](),controller[_0x3135('0x13')]);module[_0x3135('0x14')]=router; \ No newline at end of file +var _0x8ff3=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsQueueReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x55a802,_0x10ab3a){var _0x1a0461=function(_0x43d162){while(--_0x43d162){_0x55a802['push'](_0x55a802['shift']());}};_0x1a0461(++_0x10ab3a);}(_0x8ff3,0x72));var _0x38ff=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x8ff3[_0x2bbc07];return _0x6879e4;};'use strict';var multer=require(_0x38ff('0x0'));var util=require(_0x38ff('0x1'));var path=require('path');var timeout=require(_0x38ff('0x2'));var express=require(_0x38ff('0x3'));var router=express[_0x38ff('0x4')]();var fs_extra=require(_0x38ff('0x5'));var auth=require(_0x38ff('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38ff('0x7'));router['get']('/',auth[_0x38ff('0x8')](),controller['index']);router[_0x38ff('0x9')](_0x38ff('0xa'),auth[_0x38ff('0x8')](),controller[_0x38ff('0xb')]);router[_0x38ff('0x9')](_0x38ff('0xc'),auth[_0x38ff('0x8')](),controller[_0x38ff('0xd')]);router[_0x38ff('0xe')]('/',auth[_0x38ff('0x8')](),controller[_0x38ff('0xf')]);router[_0x38ff('0x10')](_0x38ff('0xc'),auth['isAuthenticated'](),controller[_0x38ff('0x11')]);router[_0x38ff('0x12')](_0x38ff('0xc'),auth['isAuthenticated'](),controller[_0x38ff('0x13')]);module[_0x38ff('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 89b2bd8..0c1ced4 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 _0x40d9=['DATE','sequelize','exports','STRING'];(function(_0x46fba4,_0x5f0cbf){var _0x5e6888=function(_0x21f2f8){while(--_0x21f2f8){_0x46fba4['push'](_0x46fba4['shift']());}};_0x5e6888(++_0x5f0cbf);}(_0x40d9,0xa1));var _0x940d=function(_0x38e2a7,_0x3ea0e9){_0x38e2a7=_0x38e2a7-0x0;var _0x2e4bd3=_0x40d9[_0x38e2a7];return _0x2e4bd3;};'use strict';var moment=require('moment');var Sequelize=require(_0x940d('0x0'));module[_0x940d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x940d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x940d('0x3')]},'acceptAt':{'type':Sequelize[_0x940d('0x3')]},'exitAt':{'type':Sequelize[_0x940d('0x3')]},'reason':{'type':Sequelize[_0x940d('0x2')]}}; \ No newline at end of file +var _0xd06a=['moment','sequelize','STRING','DATE'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xd06a,0xe0));var _0xad06=function(_0x21602f,_0x390717){_0x21602f=_0x21602f-0x0;var _0xef0d76=_0xd06a[_0x21602f];return _0xef0d76;};'use strict';var moment=require(_0xad06('0x0'));var Sequelize=require(_0xad06('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xad06('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xad06('0x2')]},'joinAt':{'type':Sequelize[_0xad06('0x3')]},'leaveAt':{'type':Sequelize[_0xad06('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xad06('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 7439860..51f9781 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 _0x9acb=['bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x26797a,_0x104240){var _0xeb5295=function(_0x238784){while(--_0x238784){_0x26797a['push'](_0x26797a['shift']());}};_0xeb5295(++_0x104240);}(_0x9acb,0x95));var _0xb9ac=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x9acb[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0xb9ac('0x0'));var rimraf=require(_0xb9ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9ac('0x2'));var rp=require(_0xb9ac('0x3'));var moment=require(_0xb9ac('0x4'));var BPromise=require(_0xb9ac('0x5'));var Mustache=require('mustache');var util=require(_0xb9ac('0x6'));var path=require('path');var sox=require(_0xb9ac('0x7'));var csv=require(_0xb9ac('0x8'));var ejs=require(_0xb9ac('0x9'));var fs=require('fs');var fs_extra=require(_0xb9ac('0xa'));var _=require(_0xb9ac('0xb'));var squel=require(_0xb9ac('0xc'));var crypto=require(_0xb9ac('0xd'));var jsforce=require(_0xb9ac('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb9ac('0x8'));var querystring=require(_0xb9ac('0xf'));var Papa=require('papaparse');var Redis=require(_0xb9ac('0x10'));var authService=require(_0xb9ac('0x11'));var qs=require(_0xb9ac('0x12'));var as=require(_0xb9ac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9ac('0x14'))(_0xb9ac('0x15'));var utils=require(_0xb9ac('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb9ac('0x17'));var db=require(_0xb9ac('0x18'))['db'];function respondWithStatusCode(_0x550020,_0x18ac4a){_0x18ac4a=_0x18ac4a||0xcc;return function(_0x1341d2){if(_0x1341d2){return _0x550020[_0xb9ac('0x19')](_0x18ac4a);}return _0x550020[_0xb9ac('0x1a')](_0x18ac4a)[_0xb9ac('0x1b')]();};}function respondWithResult(_0x206568,_0x2c55d0){_0x2c55d0=_0x2c55d0||0xc8;return function(_0x398417){if(_0x398417){return _0x206568['status'](_0x2c55d0)[_0xb9ac('0x1c')](_0x398417);}};}function respondWithFilteredResult(_0x35af31,_0x560ffb){return function(_0xd10fde){if(_0xd10fde){var _0x15a62c=typeof _0x560ffb['offset']===_0xb9ac('0x1d')&&typeof _0x560ffb['limit']===_0xb9ac('0x1d');var _0x4a2d63=_0xd10fde[_0xb9ac('0x1e')];var _0x416901=_0x15a62c?0x0:_0x560ffb[_0xb9ac('0x1f')];var _0x453956=_0x15a62c?_0xd10fde[_0xb9ac('0x1e')]:_0x560ffb[_0xb9ac('0x1f')]+_0x560ffb['limit'];var _0x4a8a1a;if(_0x453956>=_0x4a2d63){_0x453956=_0x4a2d63;_0x4a8a1a=0xc8;}else{_0x4a8a1a=0xce;}_0x35af31[_0xb9ac('0x1a')](_0x4a8a1a);return _0x35af31[_0xb9ac('0x20')](_0xb9ac('0x21'),_0x416901+'-'+_0x453956+'/'+_0x4a2d63)['json'](_0xd10fde);}return null;};}function patchUpdates(_0x48b027){return function(_0xf1736a){try{jsonpatch[_0xb9ac('0x22')](_0xf1736a,_0x48b027,!![]);}catch(_0x4283a6){return BPromise[_0xb9ac('0x23')](_0x4283a6);}return _0xf1736a[_0xb9ac('0x24')]();};}function saveUpdates(_0x38015d,_0xca81bf){return function(_0x44c026){if(_0x44c026){return _0x44c026['update'](_0x38015d)[_0xb9ac('0x25')](function(_0x3b00ba){return _0x3b00ba;});}return null;};}function removeEntity(_0x4a0864,_0x116ceb){return function(_0x36ed8b){if(_0x36ed8b){return _0x36ed8b[_0xb9ac('0x26')]()[_0xb9ac('0x25')](function(){_0x4a0864['status'](0xcc)[_0xb9ac('0x1b')]();});}};}function handleEntityNotFound(_0x58f16b,_0xaa1347){return function(_0xd77641){if(!_0xd77641){_0x58f16b[_0xb9ac('0x19')](0x194);}return _0xd77641;};}function handleError(_0x555695,_0x59b23c){_0x59b23c=_0x59b23c||0x1f4;return function(_0x56b6b5){logger[_0xb9ac('0x27')](_0x56b6b5[_0xb9ac('0x28')]);if(_0x56b6b5['name']){delete _0x56b6b5['name'];}_0x555695['status'](_0x59b23c)['send'](_0x56b6b5);};}exports[_0xb9ac('0x29')]=function(_0x36aa7c,_0x3a7ea4){var _0x5a752c={},_0x14ae4f={},_0x304902={'count':0x0,'rows':[]};var _0xf6623e=_[_0xb9ac('0x2a')](db[_0xb9ac('0x2b')][_0xb9ac('0x2c')],function(_0x48945f){return{'name':_0x48945f[_0xb9ac('0x2d')],'type':_0x48945f[_0xb9ac('0x2e')][_0xb9ac('0x2f')]};});_0x14ae4f[_0xb9ac('0x30')]=_[_0xb9ac('0x2a')](_0xf6623e,_0xb9ac('0x31'));_0x14ae4f[_0xb9ac('0x32')]=_[_0xb9ac('0x33')](_0x36aa7c[_0xb9ac('0x32')]);_0x14ae4f['filters']=_['intersection'](_0x14ae4f['model'],_0x14ae4f['query']);_0x5a752c[_0xb9ac('0x34')]=_[_0xb9ac('0x35')](_0x14ae4f['model'],qs[_0xb9ac('0x36')](_0x36aa7c[_0xb9ac('0x32')][_0xb9ac('0x36')]));_0x5a752c[_0xb9ac('0x34')]=_0x5a752c['attributes'][_0xb9ac('0x37')]?_0x5a752c[_0xb9ac('0x34')]:_0x14ae4f['model'];if(!_0x36aa7c['query'][_0xb9ac('0x38')](_0xb9ac('0x39'))){_0x5a752c['limit']=qs[_0xb9ac('0x3a')](_0x36aa7c[_0xb9ac('0x32')][_0xb9ac('0x3a')]);_0x5a752c['offset']=qs['offset'](_0x36aa7c[_0xb9ac('0x32')][_0xb9ac('0x1f')]);}_0x5a752c['order']=qs[_0xb9ac('0x3b')](_0x36aa7c['query'][_0xb9ac('0x3b')]);_0x5a752c['where']=qs['filters'](_[_0xb9ac('0x3c')](_0x36aa7c[_0xb9ac('0x32')],_0x14ae4f[_0xb9ac('0x3d')]),_0xf6623e);if(_0x36aa7c[_0xb9ac('0x32')][_0xb9ac('0x3e')]){_0x5a752c[_0xb9ac('0x3f')]=_[_0xb9ac('0x40')](_0x5a752c['where'],{'$or':_[_0xb9ac('0x2a')](_0xf6623e,function(_0x191e93){if(_0x191e93['type']!==_0xb9ac('0x41')){var _0x540238={};_0x540238[_0x191e93[_0xb9ac('0x31')]]={'$like':'%'+_0x36aa7c[_0xb9ac('0x32')][_0xb9ac('0x3e')]+'%'};return _0x540238;}})});}_0x5a752c=_['merge']({},_0x5a752c,_0x36aa7c['options']);var _0x3686e7={'where':_0x5a752c[_0xb9ac('0x3f')]};return db[_0xb9ac('0x2b')]['count'](_0x3686e7)[_0xb9ac('0x25')](function(_0x2f877a){_0x304902[_0xb9ac('0x1e')]=_0x2f877a;if(_0x36aa7c[_0xb9ac('0x32')][_0xb9ac('0x42')]){_0x5a752c[_0xb9ac('0x43')]=[{'all':!![]}];}return db[_0xb9ac('0x2b')][_0xb9ac('0x44')](_0x5a752c);})[_0xb9ac('0x25')](function(_0xf8dc88){_0x304902[_0xb9ac('0x45')]=_0xf8dc88;return _0x304902;})[_0xb9ac('0x25')](respondWithFilteredResult(_0x3a7ea4,_0x5a752c))[_0xb9ac('0x46')](handleError(_0x3a7ea4,null));};exports['show']=function(_0x55009f,_0x4442f8){var _0xd6f300={'raw':!![],'where':{'id':_0x55009f[_0xb9ac('0x47')]['id']}},_0x337822={};_0x337822[_0xb9ac('0x30')]=_[_0xb9ac('0x33')](db['SmsQueueReport'][_0xb9ac('0x2c')]);_0x337822[_0xb9ac('0x32')]=_[_0xb9ac('0x33')](_0x55009f[_0xb9ac('0x32')]);_0x337822[_0xb9ac('0x3d')]=_['intersection'](_0x337822[_0xb9ac('0x30')],_0x337822[_0xb9ac('0x32')]);_0xd6f300[_0xb9ac('0x34')]=_[_0xb9ac('0x35')](_0x337822[_0xb9ac('0x30')],qs['fields'](_0x55009f[_0xb9ac('0x32')][_0xb9ac('0x36')]));_0xd6f300[_0xb9ac('0x34')]=_0xd6f300['attributes']['length']?_0xd6f300[_0xb9ac('0x34')]:_0x337822[_0xb9ac('0x30')];if(_0x55009f['query'][_0xb9ac('0x42')]){_0xd6f300['include']=[{'all':!![]}];}_0xd6f300=_[_0xb9ac('0x40')]({},_0xd6f300,_0x55009f['options']);return db[_0xb9ac('0x2b')][_0xb9ac('0x48')](_0xd6f300)[_0xb9ac('0x25')](handleEntityNotFound(_0x4442f8,null))[_0xb9ac('0x25')](respondWithResult(_0x4442f8,null))[_0xb9ac('0x46')](handleError(_0x4442f8,null));};exports[_0xb9ac('0x49')]=function(_0x11d4eb,_0x1f3709){return db[_0xb9ac('0x2b')][_0xb9ac('0x49')](_0x11d4eb['body'],{})[_0xb9ac('0x25')](respondWithResult(_0x1f3709,0xc9))[_0xb9ac('0x46')](handleError(_0x1f3709,null));};exports[_0xb9ac('0x4a')]=function(_0x472706,_0x8b1487){if(_0x472706[_0xb9ac('0x4b')]['id']){delete _0x472706['body']['id'];}return db[_0xb9ac('0x2b')][_0xb9ac('0x48')]({'where':{'id':_0x472706['params']['id']}})['then'](handleEntityNotFound(_0x8b1487,null))[_0xb9ac('0x25')](saveUpdates(_0x472706[_0xb9ac('0x4b')],null))[_0xb9ac('0x25')](respondWithResult(_0x8b1487,null))[_0xb9ac('0x46')](handleError(_0x8b1487,null));};exports['destroy']=function(_0x6649ac,_0x180bf0){return db[_0xb9ac('0x2b')][_0xb9ac('0x48')]({'where':{'id':_0x6649ac[_0xb9ac('0x47')]['id']}})[_0xb9ac('0x25')](handleEntityNotFound(_0x180bf0,null))[_0xb9ac('0x25')](removeEntity(_0x180bf0,null))[_0xb9ac('0x46')](handleError(_0x180bf0,null));};exports[_0xb9ac('0x4c')]=function(_0x259022,_0x448718){return db[_0xb9ac('0x2b')]['describe']()[_0xb9ac('0x25')](respondWithResult(_0x448718,null))[_0xb9ac('0x46')](handleError(_0x448718,null));}; \ No newline at end of file +var _0x159a=['show','params','keys','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','catch'];(function(_0x7adb13,_0x1a4023){var _0x3d53dd=function(_0x3bf5c6){while(--_0x3bf5c6){_0x7adb13['push'](_0x7adb13['shift']());}};_0x3d53dd(++_0x1a4023);}(_0x159a,0x144));var _0xa159=function(_0x1bba1a,_0xdb4f8b){_0x1bba1a=_0x1bba1a-0x0;var _0x4ed799=_0x159a[_0x1bba1a];return _0x4ed799;};'use strict';var emlformat=require(_0xa159('0x0'));var rimraf=require(_0xa159('0x1'));var zipdir=require(_0xa159('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa159('0x3'));var moment=require(_0xa159('0x4'));var BPromise=require(_0xa159('0x5'));var Mustache=require(_0xa159('0x6'));var util=require('util');var path=require(_0xa159('0x7'));var sox=require(_0xa159('0x8'));var csv=require(_0xa159('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa159('0xa'));var _=require(_0xa159('0xb'));var squel=require(_0xa159('0xc'));var crypto=require(_0xa159('0xd'));var jsforce=require(_0xa159('0xe'));var deskjs=require(_0xa159('0xf'));var toCsv=require(_0xa159('0x9'));var querystring=require(_0xa159('0x10'));var Papa=require(_0xa159('0x11'));var Redis=require(_0xa159('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa159('0x13'));var as=require(_0xa159('0x14'));var hardwareService=require(_0xa159('0x15'));var logger=require(_0xa159('0x16'))(_0xa159('0x17'));var utils=require(_0xa159('0x18'));var config=require(_0xa159('0x19'));var licenseUtil=require(_0xa159('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3de62c,_0x328938){_0x328938=_0x328938||0xcc;return function(_0xc2d2c8){if(_0xc2d2c8){return _0x3de62c['sendStatus'](_0x328938);}return _0x3de62c[_0xa159('0x1b')](_0x328938)[_0xa159('0x1c')]();};}function respondWithResult(_0x2048f1,_0xbe28ed){_0xbe28ed=_0xbe28ed||0xc8;return function(_0x22bf80){if(_0x22bf80){return _0x2048f1[_0xa159('0x1b')](_0xbe28ed)[_0xa159('0x1d')](_0x22bf80);}};}function respondWithFilteredResult(_0x13a240,_0x587de7){return function(_0x18dab2){if(_0x18dab2){var _0x59bece=typeof _0x587de7[_0xa159('0x1e')]===_0xa159('0x1f')&&typeof _0x587de7[_0xa159('0x20')]===_0xa159('0x1f');var _0xedd74=_0x18dab2[_0xa159('0x21')];var _0x12f98c=_0x59bece?0x0:_0x587de7['offset'];var _0x481f88=_0x59bece?_0x18dab2[_0xa159('0x21')]:_0x587de7[_0xa159('0x1e')]+_0x587de7[_0xa159('0x20')];var _0x67b95e;if(_0x481f88>=_0xedd74){_0x481f88=_0xedd74;_0x67b95e=0xc8;}else{_0x67b95e=0xce;}_0x13a240['status'](_0x67b95e);return _0x13a240[_0xa159('0x22')](_0xa159('0x23'),_0x12f98c+'-'+_0x481f88+'/'+_0xedd74)[_0xa159('0x1d')](_0x18dab2);}return null;};}function patchUpdates(_0x21b1dc){return function(_0x54eb80){try{jsonpatch[_0xa159('0x24')](_0x54eb80,_0x21b1dc,!![]);}catch(_0x2ed554){return BPromise[_0xa159('0x25')](_0x2ed554);}return _0x54eb80[_0xa159('0x26')]();};}function saveUpdates(_0x5e62ad,_0x2254f4){return function(_0xd105bb){if(_0xd105bb){return _0xd105bb['update'](_0x5e62ad)[_0xa159('0x27')](function(_0x424abb){return _0x424abb;});}return null;};}function removeEntity(_0x3622a3,_0x220544){return function(_0x202441){if(_0x202441){return _0x202441[_0xa159('0x28')]()[_0xa159('0x27')](function(){_0x3622a3[_0xa159('0x1b')](0xcc)[_0xa159('0x1c')]();});}};}function handleEntityNotFound(_0x1d37d2,_0x5dffbb){return function(_0x4f7724){if(!_0x4f7724){_0x1d37d2[_0xa159('0x29')](0x194);}return _0x4f7724;};}function handleError(_0x489fc5,_0x5b2c6d){_0x5b2c6d=_0x5b2c6d||0x1f4;return function(_0x5e1116){logger[_0xa159('0x2a')](_0x5e1116[_0xa159('0x2b')]);if(_0x5e1116[_0xa159('0x2c')]){delete _0x5e1116[_0xa159('0x2c')];}_0x489fc5[_0xa159('0x1b')](_0x5b2c6d)[_0xa159('0x2d')](_0x5e1116);};}exports['index']=function(_0x4dc2d3,_0x682854){var _0x1d4bc7={},_0x54358e={},_0x5a3764={'count':0x0,'rows':[]};var _0xba37d3=_['map'](db[_0xa159('0x2e')][_0xa159('0x2f')],function(_0x4bd95c){return{'name':_0x4bd95c[_0xa159('0x30')],'type':_0x4bd95c[_0xa159('0x31')][_0xa159('0x32')]};});_0x54358e[_0xa159('0x33')]=_[_0xa159('0x34')](_0xba37d3,_0xa159('0x2c'));_0x54358e[_0xa159('0x35')]=_['keys'](_0x4dc2d3[_0xa159('0x35')]);_0x54358e['filters']=_[_0xa159('0x36')](_0x54358e[_0xa159('0x33')],_0x54358e['query']);_0x1d4bc7[_0xa159('0x37')]=_[_0xa159('0x36')](_0x54358e['model'],qs[_0xa159('0x38')](_0x4dc2d3[_0xa159('0x35')][_0xa159('0x38')]));_0x1d4bc7['attributes']=_0x1d4bc7[_0xa159('0x37')][_0xa159('0x39')]?_0x1d4bc7[_0xa159('0x37')]:_0x54358e[_0xa159('0x33')];if(!_0x4dc2d3[_0xa159('0x35')][_0xa159('0x3a')]('nolimit')){_0x1d4bc7[_0xa159('0x20')]=qs[_0xa159('0x20')](_0x4dc2d3['query'][_0xa159('0x20')]);_0x1d4bc7[_0xa159('0x1e')]=qs[_0xa159('0x1e')](_0x4dc2d3[_0xa159('0x35')][_0xa159('0x1e')]);}_0x1d4bc7[_0xa159('0x3b')]=qs['sort'](_0x4dc2d3[_0xa159('0x35')][_0xa159('0x3c')]);_0x1d4bc7['where']=qs[_0xa159('0x3d')](_[_0xa159('0x3e')](_0x4dc2d3['query'],_0x54358e['filters']),_0xba37d3);if(_0x4dc2d3[_0xa159('0x35')][_0xa159('0x3f')]){_0x1d4bc7['where']=_['merge'](_0x1d4bc7[_0xa159('0x40')],{'$or':_[_0xa159('0x34')](_0xba37d3,function(_0x3431ea){if(_0x3431ea['type']!=='VIRTUAL'){var _0x4dca1c={};_0x4dca1c[_0x3431ea[_0xa159('0x2c')]]={'$like':'%'+_0x4dc2d3[_0xa159('0x35')][_0xa159('0x3f')]+'%'};return _0x4dca1c;}})});}_0x1d4bc7=_[_0xa159('0x41')]({},_0x1d4bc7,_0x4dc2d3[_0xa159('0x42')]);var _0x524698={'where':_0x1d4bc7[_0xa159('0x40')]};return db[_0xa159('0x2e')][_0xa159('0x21')](_0x524698)[_0xa159('0x27')](function(_0x49061c){_0x5a3764[_0xa159('0x21')]=_0x49061c;if(_0x4dc2d3['query'][_0xa159('0x43')]){_0x1d4bc7[_0xa159('0x44')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xa159('0x45')](_0x1d4bc7);})[_0xa159('0x27')](function(_0x4b4297){_0x5a3764['rows']=_0x4b4297;return _0x5a3764;})[_0xa159('0x27')](respondWithFilteredResult(_0x682854,_0x1d4bc7))[_0xa159('0x46')](handleError(_0x682854,null));};exports[_0xa159('0x47')]=function(_0x30a62e,_0x295f82){var _0x103cb2={'raw':!![],'where':{'id':_0x30a62e[_0xa159('0x48')]['id']}},_0x2dd46b={};_0x2dd46b[_0xa159('0x33')]=_[_0xa159('0x49')](db[_0xa159('0x2e')][_0xa159('0x2f')]);_0x2dd46b['query']=_[_0xa159('0x49')](_0x30a62e['query']);_0x2dd46b[_0xa159('0x3d')]=_['intersection'](_0x2dd46b[_0xa159('0x33')],_0x2dd46b[_0xa159('0x35')]);_0x103cb2[_0xa159('0x37')]=_[_0xa159('0x36')](_0x2dd46b[_0xa159('0x33')],qs['fields'](_0x30a62e[_0xa159('0x35')][_0xa159('0x38')]));_0x103cb2[_0xa159('0x37')]=_0x103cb2[_0xa159('0x37')][_0xa159('0x39')]?_0x103cb2[_0xa159('0x37')]:_0x2dd46b[_0xa159('0x33')];if(_0x30a62e[_0xa159('0x35')][_0xa159('0x43')]){_0x103cb2[_0xa159('0x44')]=[{'all':!![]}];}_0x103cb2=_[_0xa159('0x41')]({},_0x103cb2,_0x30a62e[_0xa159('0x42')]);return db['SmsQueueReport'][_0xa159('0x4a')](_0x103cb2)[_0xa159('0x27')](handleEntityNotFound(_0x295f82,null))[_0xa159('0x27')](respondWithResult(_0x295f82,null))[_0xa159('0x46')](handleError(_0x295f82,null));};exports[_0xa159('0x4b')]=function(_0x551589,_0x24838d){return db[_0xa159('0x2e')]['create'](_0x551589[_0xa159('0x4c')],{})[_0xa159('0x27')](respondWithResult(_0x24838d,0xc9))[_0xa159('0x46')](handleError(_0x24838d,null));};exports[_0xa159('0x4d')]=function(_0x4c65d7,_0x350865){if(_0x4c65d7[_0xa159('0x4c')]['id']){delete _0x4c65d7[_0xa159('0x4c')]['id'];}return db['SmsQueueReport'][_0xa159('0x4a')]({'where':{'id':_0x4c65d7['params']['id']}})[_0xa159('0x27')](handleEntityNotFound(_0x350865,null))['then'](saveUpdates(_0x4c65d7[_0xa159('0x4c')],null))[_0xa159('0x27')](respondWithResult(_0x350865,null))[_0xa159('0x46')](handleError(_0x350865,null));};exports[_0xa159('0x28')]=function(_0x31c562,_0x3b460d){return db['SmsQueueReport']['find']({'where':{'id':_0x31c562[_0xa159('0x48')]['id']}})[_0xa159('0x27')](handleEntityNotFound(_0x3b460d,null))[_0xa159('0x27')](removeEntity(_0x3b460d,null))[_0xa159('0x46')](handleError(_0x3b460d,null));};exports['describe']=function(_0x3a157e,_0x5bae2a){return db[_0xa159('0x2e')][_0xa159('0x4e')]()[_0xa159('0x27')](respondWithResult(_0x5bae2a,null))[_0xa159('0x46')](handleError(_0x5bae2a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bda6822..24eafb3 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(_0x21b8b6,_0x5e68f4){var _0x1ac143=function(_0xb7587f){while(--_0xb7587f){_0x21b8b6['push'](_0x21b8b6['shift']());}};_0x1ac143(++_0x5e68f4);}(_0xb7e7,0x121));var _0x7b7e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb7e7[_0xbd08b4];return _0x314f1e;};'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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x39e3cc,_0x424c31){var _0x2a86a5=function(_0x305c20){while(--_0x305c20){_0x39e3cc['push'](_0x39e3cc['shift']());}};_0x2a86a5(++_0x424c31);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index e631be8..71c7998 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 _0x3eb9=['where','attributes','limit','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport'];(function(_0x1f4202,_0x5350da){var _0x47bb0d=function(_0x3052e9){while(--_0x3052e9){_0x1f4202['push'](_0x1f4202['shift']());}};_0x47bb0d(++_0x5350da);}(_0x3eb9,0x10b));var _0x93eb=function(_0x484bf4,_0x2b975c){_0x484bf4=_0x484bf4-0x0;var _0x31c683=_0x3eb9[_0x484bf4];return _0x31c683;};'use strict';var _=require(_0x93eb('0x0'));var util=require('util');var moment=require(_0x93eb('0x1'));var BPromise=require(_0x93eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93eb('0x3'))['db'];var utils=require(_0x93eb('0x4'));var logger=require(_0x93eb('0x5'))(_0x93eb('0x6'));var config=require(_0x93eb('0x7'));var jayson=require(_0x93eb('0x8'));var client=jayson[_0x93eb('0x9')][_0x93eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x292fd1,_0x22fa50,_0x17b612){return new BPromise(function(_0x54c7b8,_0x407650){return client[_0x93eb('0xb')](_0x292fd1,_0x17b612)[_0x93eb('0xc')](function(_0x5a7a0d){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x22fa50,_0x93eb('0xd'));logger[_0x93eb('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x22fa50,_0x93eb('0xd'),JSON[_0x93eb('0xf')](_0x5a7a0d));if(_0x5a7a0d[_0x93eb('0x10')]){if(_0x5a7a0d[_0x93eb('0x10')][_0x93eb('0x11')]===0x1f4){logger[_0x93eb('0x10')](_0x93eb('0x12'),_0x22fa50,_0x5a7a0d[_0x93eb('0x10')][_0x93eb('0x13')]);return _0x407650(_0x5a7a0d[_0x93eb('0x10')][_0x93eb('0x13')]);}logger[_0x93eb('0x10')](_0x93eb('0x12'),_0x22fa50,_0x5a7a0d['error'][_0x93eb('0x13')]);return _0x54c7b8(_0x5a7a0d[_0x93eb('0x10')][_0x93eb('0x13')]);}else{logger[_0x93eb('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x22fa50,'request\x20sent');_0x54c7b8(_0x5a7a0d[_0x93eb('0x15')][_0x93eb('0x13')]);}})[_0x93eb('0x16')](function(_0x12332d){logger[_0x93eb('0x10')](_0x93eb('0x12'),_0x22fa50,_0x12332d);_0x407650(_0x12332d);});});}exports[_0x93eb('0x17')]=function(_0x97c509){var _0x426d95=this;return new Promise(function(_0x34fcf6,_0x1bb03f){return db[_0x93eb('0x18')][_0x93eb('0x19')](_0x97c509[_0x93eb('0x1a')],{'raw':_0x97c509[_0x93eb('0x1b')]?_0x97c509[_0x93eb('0x1b')][_0x93eb('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x188787){logger['info'](_0x93eb('0x17'),_0x97c509);logger[_0x93eb('0xe')]('CreateSmsQueueReport',_0x97c509,JSON[_0x93eb('0xf')](_0x188787));_0x34fcf6(_0x188787);})[_0x93eb('0x16')](function(_0xeae576){logger[_0x93eb('0x10')](_0x93eb('0x17'),_0xeae576[_0x93eb('0x13')],_0x97c509);_0x1bb03f(_0x426d95[_0x93eb('0x10')](0x1f4,_0xeae576[_0x93eb('0x13')]));});});};exports[_0x93eb('0x1d')]=function(_0x407600){var _0x58c714=this;return new Promise(function(_0x214312,_0x52cd31){return db[_0x93eb('0x18')]['update'](_0x407600[_0x93eb('0x1a')],{'raw':_0x407600['options']?_0x407600['options'][_0x93eb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x407600['options']?_0x407600[_0x93eb('0x1b')][_0x93eb('0x1e')]||null:null,'attributes':_0x407600['options']?_0x407600['options'][_0x93eb('0x1f')]||null:null,'limit':_0x407600[_0x93eb('0x1b')]?_0x407600['options'][_0x93eb('0x20')]||null:null})[_0x93eb('0xc')](function(_0x27538c){logger['info'](_0x93eb('0x1d'),_0x407600);logger[_0x93eb('0xe')](_0x93eb('0x1d'),_0x407600,JSON[_0x93eb('0xf')](_0x27538c));_0x214312(_0x27538c);})[_0x93eb('0x16')](function(_0x1bd928){logger[_0x93eb('0x10')](_0x93eb('0x1d'),_0x1bd928[_0x93eb('0x13')],_0x407600);_0x52cd31(_0x58c714['error'](0x1f4,_0x1bd928['message']));});});}; \ No newline at end of file +var _0x0427=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','CreateSmsQueueReport','SmsQueueReport','options','raw','catch','UpdateSmsQueueReport','update','where','limit','lodash'];(function(_0x2464cf,_0x4fb3b0){var _0x4195c5=function(_0x5c1744){while(--_0x5c1744){_0x2464cf['push'](_0x2464cf['shift']());}};_0x4195c5(++_0x4fb3b0);}(_0x0427,0xd1));var _0x7042=function(_0x46d8df,_0x2e189e){_0x46d8df=_0x46d8df-0x0;var _0x407ab0=_0x0427[_0x46d8df];return _0x407ab0;};'use strict';var _=require(_0x7042('0x0'));var util=require(_0x7042('0x1'));var moment=require('moment');var BPromise=require(_0x7042('0x2'));var rs=require(_0x7042('0x3'));var fs=require('fs');var Redis=require(_0x7042('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7042('0x5'));var logger=require('../../config/logger')(_0x7042('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7042('0x7')][_0x7042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf4d0a5,_0x3e606c,_0xb738b3){return new BPromise(function(_0x484001,_0x4c85a7){return client[_0x7042('0x9')](_0xf4d0a5,_0xb738b3)[_0x7042('0xa')](function(_0x15a303){logger[_0x7042('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x3e606c,_0x7042('0xc'));logger[_0x7042('0xd')](_0x7042('0xe'),_0x3e606c,'request\x20sent',JSON[_0x7042('0xf')](_0x15a303));if(_0x15a303[_0x7042('0x10')]){if(_0x15a303[_0x7042('0x10')][_0x7042('0x11')]===0x1f4){logger['error'](_0x7042('0x12'),_0x3e606c,_0x15a303[_0x7042('0x10')]['message']);return _0x4c85a7(_0x15a303[_0x7042('0x10')][_0x7042('0x13')]);}logger[_0x7042('0x10')](_0x7042('0x12'),_0x3e606c,_0x15a303[_0x7042('0x10')]['message']);return _0x484001(_0x15a303['error'][_0x7042('0x13')]);}else{logger[_0x7042('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x3e606c,_0x7042('0xc'));_0x484001(_0x15a303[_0x7042('0x14')][_0x7042('0x13')]);}})['catch'](function(_0x55edf2){logger['error'](_0x7042('0x12'),_0x3e606c,_0x55edf2);_0x4c85a7(_0x55edf2);});});}exports[_0x7042('0x15')]=function(_0x36a014){var _0x527005=this;return new Promise(function(_0x517d61,_0x25a558){return db[_0x7042('0x16')]['create'](_0x36a014['body'],{'raw':_0x36a014[_0x7042('0x17')]?_0x36a014[_0x7042('0x17')][_0x7042('0x18')]===undefined?!![]:![]:!![]})[_0x7042('0xa')](function(_0x478f87){logger['info']('CreateSmsQueueReport',_0x36a014);logger[_0x7042('0xd')](_0x7042('0x15'),_0x36a014,JSON[_0x7042('0xf')](_0x478f87));_0x517d61(_0x478f87);})[_0x7042('0x19')](function(_0x533889){logger[_0x7042('0x10')](_0x7042('0x15'),_0x533889[_0x7042('0x13')],_0x36a014);_0x25a558(_0x527005[_0x7042('0x10')](0x1f4,_0x533889[_0x7042('0x13')]));});});};exports[_0x7042('0x1a')]=function(_0x486040){var _0x4454c7=this;return new Promise(function(_0x5ee4ad,_0x6ca767){return db[_0x7042('0x16')][_0x7042('0x1b')](_0x486040['body'],{'raw':_0x486040[_0x7042('0x17')]?_0x486040['options'][_0x7042('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x486040[_0x7042('0x17')]?_0x486040[_0x7042('0x17')][_0x7042('0x1c')]||null:null,'attributes':_0x486040[_0x7042('0x17')]?_0x486040[_0x7042('0x17')]['attributes']||null:null,'limit':_0x486040[_0x7042('0x17')]?_0x486040[_0x7042('0x17')][_0x7042('0x1d')]||null:null})[_0x7042('0xa')](function(_0x130ea8){logger[_0x7042('0xb')](_0x7042('0x1a'),_0x486040);logger[_0x7042('0xd')](_0x7042('0x1a'),_0x486040,JSON['stringify'](_0x130ea8));_0x5ee4ad(_0x130ea8);})['catch'](function(_0x561d8c){logger[_0x7042('0x10')]('UpdateSmsQueueReport',_0x561d8c[_0x7042('0x13')],_0x486040);_0x6ca767(_0x4454c7[_0x7042('0x10')](0x1f4,_0x561d8c[_0x7042('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 95918d8..1b0a946 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 _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x563168,_0x277605){var _0x3ff15d=function(_0x104813){while(--_0x104813){_0x563168['push'](_0x563168['shift']());}};_0x3ff15d(++_0x277605);}(_0x85d0,0x164));var _0x085d=function(_0x2cd25f,_0x434862){_0x2cd25f=_0x2cd25f-0x0;var _0x5aecd0=_0x85d0[_0x2cd25f];return _0x5aecd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x085d('0x0'));var router=express[_0x085d('0x1')]();var fs_extra=require(_0x085d('0x2'));var auth=require(_0x085d('0x3'));var interaction=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var controller=require('./smsTransferReport.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0x6')](_0x085d('0xa'),auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0xd')]('/',auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router[_0x085d('0xf')]('/:id',auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);router[_0x085d('0x11')](_0x085d('0xa'),auth['isAuthenticated'](),controller[_0x085d('0x12')]);module[_0x085d('0x13')]=router; \ No newline at end of file +var _0xf2ca=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','delete'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xc1263e,_0x56d738){_0xc1263e=_0xc1263e-0x0;var _0x471f07=_0xf2ca[_0xc1263e];return _0x471f07;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./smsTransferReport.controller');router[_0xaf2c('0x9')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0x9')]('/describe',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xc')]);router['get'](_0xaf2c('0xd'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['post']('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaf2c('0x11')](_0xaf2c('0xd'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x12')]);module[_0xaf2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 48c4fd1..145af88 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x535083,_0x39e774){var _0x1086b6=function(_0x595f00){while(--_0x595f00){_0x535083['push'](_0x535083['shift']());}};_0x1086b6(++_0x39e774);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0xf3cd[_0x4e7af4];return _0x2548f1;};'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 +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x335cc0,_0x5b433c){var _0xf941aa=function(_0x4aa613){while(--_0x4aa613){_0x335cc0['push'](_0x335cc0['shift']());}};_0xf941aa(++_0x5b433c);}(_0x70e0,0x17b));var _0x070e=function(_0x29e1b9,_0x30570e){_0x29e1b9=_0x29e1b9-0x0;var _0x520c2d=_0x70e0[_0x29e1b9];return _0x520c2d;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index b27f668..b3c0cfb 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 _0x67d1=['status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','index','SmsTransferReport','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x67d1,0x15a));var _0x167d=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x67d1[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0x167d('0x0'));var rimraf=require(_0x167d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x167d('0x2'));var rp=require(_0x167d('0x3'));var moment=require(_0x167d('0x4'));var BPromise=require(_0x167d('0x5'));var Mustache=require(_0x167d('0x6'));var util=require(_0x167d('0x7'));var path=require(_0x167d('0x8'));var sox=require(_0x167d('0x9'));var csv=require(_0x167d('0xa'));var ejs=require(_0x167d('0xb'));var fs=require('fs');var fs_extra=require(_0x167d('0xc'));var _=require(_0x167d('0xd'));var squel=require(_0x167d('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x167d('0xf'));var toCsv=require(_0x167d('0xa'));var querystring=require('querystring');var Papa=require(_0x167d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x167d('0x11'));var as=require(_0x167d('0x12'));var hardwareService=require(_0x167d('0x13'));var logger=require(_0x167d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x167d('0x15'));var licenseUtil=require(_0x167d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d9a8d,_0x38fbe6){_0x38fbe6=_0x38fbe6||0xcc;return function(_0x30516a){if(_0x30516a){return _0x5d9a8d[_0x167d('0x17')](_0x38fbe6);}return _0x5d9a8d[_0x167d('0x18')](_0x38fbe6)[_0x167d('0x19')]();};}function respondWithResult(_0x532d6b,_0xd8b9db){_0xd8b9db=_0xd8b9db||0xc8;return function(_0x155084){if(_0x155084){return _0x532d6b[_0x167d('0x18')](_0xd8b9db)[_0x167d('0x1a')](_0x155084);}};}function respondWithFilteredResult(_0x3072a7,_0x501ade){return function(_0x160524){if(_0x160524){var _0x2386bc=typeof _0x501ade['offset']===_0x167d('0x1b')&&typeof _0x501ade[_0x167d('0x1c')]==='undefined';var _0x58deae=_0x160524[_0x167d('0x1d')];var _0x2dffbc=_0x2386bc?0x0:_0x501ade['offset'];var _0x52054c=_0x2386bc?_0x160524[_0x167d('0x1d')]:_0x501ade['offset']+_0x501ade[_0x167d('0x1c')];var _0x215676;if(_0x52054c>=_0x58deae){_0x52054c=_0x58deae;_0x215676=0xc8;}else{_0x215676=0xce;}_0x3072a7['status'](_0x215676);return _0x3072a7['set'](_0x167d('0x1e'),_0x2dffbc+'-'+_0x52054c+'/'+_0x58deae)['json'](_0x160524);}return null;};}function patchUpdates(_0x1c0f32){return function(_0x56d60e){try{jsonpatch[_0x167d('0x1f')](_0x56d60e,_0x1c0f32,!![]);}catch(_0x2fc01c){return BPromise[_0x167d('0x20')](_0x2fc01c);}return _0x56d60e[_0x167d('0x21')]();};}function saveUpdates(_0x526c4f,_0x52c1a2){return function(_0x294963){if(_0x294963){return _0x294963[_0x167d('0x22')](_0x526c4f)['then'](function(_0x37c605){return _0x37c605;});}return null;};}function removeEntity(_0x4a6fc6,_0x42928c){return function(_0x1de0c8){if(_0x1de0c8){return _0x1de0c8[_0x167d('0x23')]()['then'](function(){_0x4a6fc6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x369a0b,_0x477e12){return function(_0x4b85bf){if(!_0x4b85bf){_0x369a0b['sendStatus'](0x194);}return _0x4b85bf;};}function handleError(_0x1f48ff,_0x3e9e1c){_0x3e9e1c=_0x3e9e1c||0x1f4;return function(_0x40983d){logger['error'](_0x40983d[_0x167d('0x24')]);if(_0x40983d[_0x167d('0x25')]){delete _0x40983d[_0x167d('0x25')];}_0x1f48ff[_0x167d('0x18')](_0x3e9e1c)['send'](_0x40983d);};}exports[_0x167d('0x26')]=function(_0x54d1cc,_0x2de933){var _0x39b007={},_0x418cf4={},_0x268bd5={'count':0x0,'rows':[]};var _0x303b86=_['map'](db[_0x167d('0x27')][_0x167d('0x28')],function(_0x233c68){return{'name':_0x233c68['fieldName'],'type':_0x233c68[_0x167d('0x29')]['key']};});_0x418cf4['model']=_['map'](_0x303b86,_0x167d('0x25'));_0x418cf4[_0x167d('0x2a')]=_[_0x167d('0x2b')](_0x54d1cc[_0x167d('0x2a')]);_0x418cf4[_0x167d('0x2c')]=_[_0x167d('0x2d')](_0x418cf4[_0x167d('0x2e')],_0x418cf4['query']);_0x39b007[_0x167d('0x2f')]=_[_0x167d('0x2d')](_0x418cf4[_0x167d('0x2e')],qs[_0x167d('0x30')](_0x54d1cc[_0x167d('0x2a')]['fields']));_0x39b007['attributes']=_0x39b007[_0x167d('0x2f')][_0x167d('0x31')]?_0x39b007[_0x167d('0x2f')]:_0x418cf4['model'];if(!_0x54d1cc['query'][_0x167d('0x32')](_0x167d('0x33'))){_0x39b007[_0x167d('0x1c')]=qs[_0x167d('0x1c')](_0x54d1cc[_0x167d('0x2a')][_0x167d('0x1c')]);_0x39b007[_0x167d('0x34')]=qs[_0x167d('0x34')](_0x54d1cc[_0x167d('0x2a')][_0x167d('0x34')]);}_0x39b007[_0x167d('0x35')]=qs[_0x167d('0x36')](_0x54d1cc['query'][_0x167d('0x36')]);_0x39b007[_0x167d('0x37')]=qs['filters'](_[_0x167d('0x38')](_0x54d1cc[_0x167d('0x2a')],_0x418cf4[_0x167d('0x2c')]),_0x303b86);if(_0x54d1cc[_0x167d('0x2a')][_0x167d('0x39')]){_0x39b007[_0x167d('0x37')]=_[_0x167d('0x3a')](_0x39b007[_0x167d('0x37')],{'$or':_[_0x167d('0x3b')](_0x303b86,function(_0x524f9a){if(_0x524f9a['type']!==_0x167d('0x3c')){var _0x5da623={};_0x5da623[_0x524f9a[_0x167d('0x25')]]={'$like':'%'+_0x54d1cc[_0x167d('0x2a')][_0x167d('0x39')]+'%'};return _0x5da623;}})});}_0x39b007=_[_0x167d('0x3a')]({},_0x39b007,_0x54d1cc[_0x167d('0x3d')]);var _0x374cfb={'where':_0x39b007[_0x167d('0x37')]};return db[_0x167d('0x27')][_0x167d('0x1d')](_0x374cfb)[_0x167d('0x3e')](function(_0x27ab71){_0x268bd5[_0x167d('0x1d')]=_0x27ab71;if(_0x54d1cc[_0x167d('0x2a')][_0x167d('0x3f')]){_0x39b007[_0x167d('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x167d('0x41')](_0x39b007);})[_0x167d('0x3e')](function(_0x4ad6cf){_0x268bd5[_0x167d('0x42')]=_0x4ad6cf;return _0x268bd5;})[_0x167d('0x3e')](respondWithFilteredResult(_0x2de933,_0x39b007))[_0x167d('0x43')](handleError(_0x2de933,null));};exports[_0x167d('0x44')]=function(_0x1296fc,_0xf05cf){var _0x37afda={'raw':!![],'where':{'id':_0x1296fc[_0x167d('0x45')]['id']}},_0x19c3c7={};_0x19c3c7['model']=_[_0x167d('0x2b')](db[_0x167d('0x27')][_0x167d('0x28')]);_0x19c3c7[_0x167d('0x2a')]=_['keys'](_0x1296fc['query']);_0x19c3c7[_0x167d('0x2c')]=_['intersection'](_0x19c3c7[_0x167d('0x2e')],_0x19c3c7['query']);_0x37afda[_0x167d('0x2f')]=_[_0x167d('0x2d')](_0x19c3c7[_0x167d('0x2e')],qs[_0x167d('0x30')](_0x1296fc[_0x167d('0x2a')][_0x167d('0x30')]));_0x37afda['attributes']=_0x37afda[_0x167d('0x2f')][_0x167d('0x31')]?_0x37afda[_0x167d('0x2f')]:_0x19c3c7[_0x167d('0x2e')];if(_0x1296fc[_0x167d('0x2a')][_0x167d('0x3f')]){_0x37afda[_0x167d('0x40')]=[{'all':!![]}];}_0x37afda=_[_0x167d('0x3a')]({},_0x37afda,_0x1296fc[_0x167d('0x3d')]);return db[_0x167d('0x27')][_0x167d('0x46')](_0x37afda)['then'](handleEntityNotFound(_0xf05cf,null))[_0x167d('0x3e')](respondWithResult(_0xf05cf,null))[_0x167d('0x43')](handleError(_0xf05cf,null));};exports[_0x167d('0x47')]=function(_0x482a4e,_0xba6248){return db['SmsTransferReport'][_0x167d('0x47')](_0x482a4e[_0x167d('0x48')],{})[_0x167d('0x3e')](respondWithResult(_0xba6248,0xc9))[_0x167d('0x43')](handleError(_0xba6248,null));};exports[_0x167d('0x22')]=function(_0x1bbb8e,_0x75442c){if(_0x1bbb8e[_0x167d('0x48')]['id']){delete _0x1bbb8e[_0x167d('0x48')]['id'];}return db[_0x167d('0x27')]['find']({'where':{'id':_0x1bbb8e['params']['id']}})[_0x167d('0x3e')](handleEntityNotFound(_0x75442c,null))[_0x167d('0x3e')](saveUpdates(_0x1bbb8e[_0x167d('0x48')],null))[_0x167d('0x3e')](respondWithResult(_0x75442c,null))[_0x167d('0x43')](handleError(_0x75442c,null));};exports[_0x167d('0x23')]=function(_0x5ef972,_0x4a09f3){return db[_0x167d('0x27')][_0x167d('0x46')]({'where':{'id':_0x5ef972[_0x167d('0x45')]['id']}})[_0x167d('0x3e')](handleEntityNotFound(_0x4a09f3,null))[_0x167d('0x3e')](removeEntity(_0x4a09f3,null))[_0x167d('0x43')](handleError(_0x4a09f3,null));};exports[_0x167d('0x49')]=function(_0x17db03,_0x10e670){return db[_0x167d('0x27')][_0x167d('0x49')]()[_0x167d('0x3e')](respondWithResult(_0x10e670,null))[_0x167d('0x43')](handleError(_0x10e670,null));}; \ No newline at end of file +var _0xee9e=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','SmsTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','VIRTUAL','where','includeAll','include','rows','rawAttributes','keys','options','find','create','body','catch','destroy','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x4ed204,_0x3e95b1){var _0xfe82dd=function(_0xbc788e){while(--_0xbc788e){_0x4ed204['push'](_0x4ed204['shift']());}};_0xfe82dd(++_0x3e95b1);}(_0xee9e,0xc8));var _0xeee9=function(_0x5bd3f9,_0x5552af){_0x5bd3f9=_0x5bd3f9-0x0;var _0x277e55=_0xee9e[_0x5bd3f9];return _0x277e55;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeee9('0x0'));var jsonpatch=require(_0xeee9('0x1'));var rp=require(_0xeee9('0x2'));var moment=require(_0xeee9('0x3'));var BPromise=require(_0xeee9('0x4'));var Mustache=require(_0xeee9('0x5'));var util=require(_0xeee9('0x6'));var path=require('path');var sox=require(_0xeee9('0x7'));var csv=require('to-csv');var ejs=require(_0xeee9('0x8'));var fs=require('fs');var fs_extra=require(_0xeee9('0x9'));var _=require(_0xeee9('0xa'));var squel=require(_0xeee9('0xb'));var crypto=require(_0xeee9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeee9('0xd'));var toCsv=require(_0xeee9('0xe'));var querystring=require(_0xeee9('0xf'));var Papa=require('papaparse');var Redis=require(_0xeee9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeee9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeee9('0x12'));var logger=require(_0xeee9('0x13'))(_0xeee9('0x14'));var utils=require(_0xeee9('0x15'));var config=require(_0xeee9('0x16'));var licenseUtil=require(_0xeee9('0x17'));var db=require(_0xeee9('0x18'))['db'];function respondWithStatusCode(_0x680c7c,_0x3eb362){_0x3eb362=_0x3eb362||0xcc;return function(_0x2b2401){if(_0x2b2401){return _0x680c7c[_0xeee9('0x19')](_0x3eb362);}return _0x680c7c[_0xeee9('0x1a')](_0x3eb362)[_0xeee9('0x1b')]();};}function respondWithResult(_0x47c452,_0x45bafb){_0x45bafb=_0x45bafb||0xc8;return function(_0x223891){if(_0x223891){return _0x47c452[_0xeee9('0x1a')](_0x45bafb)[_0xeee9('0x1c')](_0x223891);}};}function respondWithFilteredResult(_0x3d0862,_0xb25c0d){return function(_0x2ce10f){if(_0x2ce10f){var _0x524ab5=typeof _0xb25c0d[_0xeee9('0x1d')]===_0xeee9('0x1e')&&typeof _0xb25c0d[_0xeee9('0x1f')]==='undefined';var _0x561e9d=_0x2ce10f['count'];var _0x5413ac=_0x524ab5?0x0:_0xb25c0d['offset'];var _0x2ef95e=_0x524ab5?_0x2ce10f[_0xeee9('0x20')]:_0xb25c0d[_0xeee9('0x1d')]+_0xb25c0d[_0xeee9('0x1f')];var _0x5e6a4c;if(_0x2ef95e>=_0x561e9d){_0x2ef95e=_0x561e9d;_0x5e6a4c=0xc8;}else{_0x5e6a4c=0xce;}_0x3d0862[_0xeee9('0x1a')](_0x5e6a4c);return _0x3d0862['set'](_0xeee9('0x21'),_0x5413ac+'-'+_0x2ef95e+'/'+_0x561e9d)[_0xeee9('0x1c')](_0x2ce10f);}return null;};}function patchUpdates(_0x38a2ad){return function(_0x521532){try{jsonpatch[_0xeee9('0x22')](_0x521532,_0x38a2ad,!![]);}catch(_0x35bb04){return BPromise[_0xeee9('0x23')](_0x35bb04);}return _0x521532[_0xeee9('0x24')]();};}function saveUpdates(_0x2f8835,_0x438435){return function(_0x6eaec9){if(_0x6eaec9){return _0x6eaec9[_0xeee9('0x25')](_0x2f8835)['then'](function(_0x256e86){return _0x256e86;});}return null;};}function removeEntity(_0xfa480,_0x48b03d){return function(_0x1497d4){if(_0x1497d4){return _0x1497d4['destroy']()[_0xeee9('0x26')](function(){_0xfa480['status'](0xcc)[_0xeee9('0x1b')]();});}};}function handleEntityNotFound(_0x54e054,_0x463537){return function(_0x5981f2){if(!_0x5981f2){_0x54e054[_0xeee9('0x19')](0x194);}return _0x5981f2;};}function handleError(_0x4ba8c0,_0xabd555){_0xabd555=_0xabd555||0x1f4;return function(_0x4b9ec5){logger[_0xeee9('0x27')](_0x4b9ec5[_0xeee9('0x28')]);if(_0x4b9ec5[_0xeee9('0x29')]){delete _0x4b9ec5[_0xeee9('0x29')];}_0x4ba8c0['status'](_0xabd555)['send'](_0x4b9ec5);};}exports[_0xeee9('0x2a')]=function(_0x3cb98a,_0x19bca3){var _0x4bc0af={},_0x2a0897={},_0xbac093={'count':0x0,'rows':[]};var _0x3292f1=_[_0xeee9('0x2b')](db[_0xeee9('0x2c')]['rawAttributes'],function(_0x30f378){return{'name':_0x30f378[_0xeee9('0x2d')],'type':_0x30f378[_0xeee9('0x2e')][_0xeee9('0x2f')]};});_0x2a0897[_0xeee9('0x30')]=_[_0xeee9('0x2b')](_0x3292f1,'name');_0x2a0897[_0xeee9('0x31')]=_['keys'](_0x3cb98a['query']);_0x2a0897[_0xeee9('0x32')]=_[_0xeee9('0x33')](_0x2a0897[_0xeee9('0x30')],_0x2a0897[_0xeee9('0x31')]);_0x4bc0af[_0xeee9('0x34')]=_[_0xeee9('0x33')](_0x2a0897[_0xeee9('0x30')],qs[_0xeee9('0x35')](_0x3cb98a[_0xeee9('0x31')][_0xeee9('0x35')]));_0x4bc0af[_0xeee9('0x34')]=_0x4bc0af[_0xeee9('0x34')][_0xeee9('0x36')]?_0x4bc0af[_0xeee9('0x34')]:_0x2a0897[_0xeee9('0x30')];if(!_0x3cb98a[_0xeee9('0x31')][_0xeee9('0x37')](_0xeee9('0x38'))){_0x4bc0af[_0xeee9('0x1f')]=qs[_0xeee9('0x1f')](_0x3cb98a[_0xeee9('0x31')][_0xeee9('0x1f')]);_0x4bc0af['offset']=qs[_0xeee9('0x1d')](_0x3cb98a[_0xeee9('0x31')]['offset']);}_0x4bc0af[_0xeee9('0x39')]=qs['sort'](_0x3cb98a[_0xeee9('0x31')]['sort']);_0x4bc0af['where']=qs[_0xeee9('0x32')](_[_0xeee9('0x3a')](_0x3cb98a[_0xeee9('0x31')],_0x2a0897[_0xeee9('0x32')]),_0x3292f1);if(_0x3cb98a[_0xeee9('0x31')][_0xeee9('0x3b')]){_0x4bc0af['where']=_[_0xeee9('0x3c')](_0x4bc0af['where'],{'$or':_[_0xeee9('0x2b')](_0x3292f1,function(_0x2fc21a){if(_0x2fc21a['type']!==_0xeee9('0x3d')){var _0x1e5f2b={};_0x1e5f2b[_0x2fc21a[_0xeee9('0x29')]]={'$like':'%'+_0x3cb98a[_0xeee9('0x31')]['filter']+'%'};return _0x1e5f2b;}})});}_0x4bc0af=_[_0xeee9('0x3c')]({},_0x4bc0af,_0x3cb98a['options']);var _0x1c4492={'where':_0x4bc0af[_0xeee9('0x3e')]};return db[_0xeee9('0x2c')][_0xeee9('0x20')](_0x1c4492)[_0xeee9('0x26')](function(_0x3f3423){_0xbac093['count']=_0x3f3423;if(_0x3cb98a[_0xeee9('0x31')][_0xeee9('0x3f')]){_0x4bc0af[_0xeee9('0x40')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x4bc0af);})[_0xeee9('0x26')](function(_0x3eb089){_0xbac093[_0xeee9('0x41')]=_0x3eb089;return _0xbac093;})[_0xeee9('0x26')](respondWithFilteredResult(_0x19bca3,_0x4bc0af))['catch'](handleError(_0x19bca3,null));};exports['show']=function(_0x31fe13,_0x44ad39){var _0x2ea8af={'raw':!![],'where':{'id':_0x31fe13['params']['id']}},_0x24e0e4={};_0x24e0e4['model']=_['keys'](db[_0xeee9('0x2c')][_0xeee9('0x42')]);_0x24e0e4[_0xeee9('0x31')]=_[_0xeee9('0x43')](_0x31fe13[_0xeee9('0x31')]);_0x24e0e4[_0xeee9('0x32')]=_[_0xeee9('0x33')](_0x24e0e4[_0xeee9('0x30')],_0x24e0e4[_0xeee9('0x31')]);_0x2ea8af[_0xeee9('0x34')]=_[_0xeee9('0x33')](_0x24e0e4[_0xeee9('0x30')],qs[_0xeee9('0x35')](_0x31fe13[_0xeee9('0x31')][_0xeee9('0x35')]));_0x2ea8af[_0xeee9('0x34')]=_0x2ea8af[_0xeee9('0x34')][_0xeee9('0x36')]?_0x2ea8af[_0xeee9('0x34')]:_0x24e0e4[_0xeee9('0x30')];if(_0x31fe13[_0xeee9('0x31')]['includeAll']){_0x2ea8af[_0xeee9('0x40')]=[{'all':!![]}];}_0x2ea8af=_[_0xeee9('0x3c')]({},_0x2ea8af,_0x31fe13[_0xeee9('0x44')]);return db[_0xeee9('0x2c')][_0xeee9('0x45')](_0x2ea8af)[_0xeee9('0x26')](handleEntityNotFound(_0x44ad39,null))['then'](respondWithResult(_0x44ad39,null))['catch'](handleError(_0x44ad39,null));};exports[_0xeee9('0x46')]=function(_0x7f51a0,_0x55f2ae){return db[_0xeee9('0x2c')][_0xeee9('0x46')](_0x7f51a0[_0xeee9('0x47')],{})['then'](respondWithResult(_0x55f2ae,0xc9))['catch'](handleError(_0x55f2ae,null));};exports['update']=function(_0xc32653,_0x1df500){if(_0xc32653[_0xeee9('0x47')]['id']){delete _0xc32653['body']['id'];}return db['SmsTransferReport'][_0xeee9('0x45')]({'where':{'id':_0xc32653['params']['id']}})[_0xeee9('0x26')](handleEntityNotFound(_0x1df500,null))[_0xeee9('0x26')](saveUpdates(_0xc32653[_0xeee9('0x47')],null))['then'](respondWithResult(_0x1df500,null))[_0xeee9('0x48')](handleError(_0x1df500,null));};exports[_0xeee9('0x49')]=function(_0x463d75,_0x39ff75){return db[_0xeee9('0x2c')][_0xeee9('0x45')]({'where':{'id':_0x463d75[_0xeee9('0x4a')]['id']}})[_0xeee9('0x26')](handleEntityNotFound(_0x39ff75,null))[_0xeee9('0x26')](removeEntity(_0x39ff75,null))[_0xeee9('0x48')](handleError(_0x39ff75,null));};exports[_0xeee9('0x4b')]=function(_0xecc431,_0x11eba3){return db[_0xeee9('0x2c')]['describe']()['then'](respondWithResult(_0x11eba3,null))['catch'](handleError(_0x11eba3,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2e96472..e595228 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 _0x4a9c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','SmsTransferReport','uniqueid'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x338134,_0x4c98fa){_0x338134=_0x338134-0x0;var _0x30343c=_0x4a9c[_0x338134];return _0x30343c;};'use strict';var _=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var logger=require(_0xc4a9('0x2'))(_0xc4a9('0x3'));var moment=require(_0xc4a9('0x4'));var BPromise=require(_0xc4a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4a9('0x6'));var rimraf=require(_0xc4a9('0x7'));var config=require(_0xc4a9('0x8'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x95d3f6,_0x2f35e4){return _0x95d3f6[_0xc4a9('0x9')](_0xc4a9('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xc4a9('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4958=['path','rimraf','../../config/environment','./smsTransferReport.attributes','define','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x3b2bfb,_0x2fabce){var _0x4a3498=function(_0x392c8c){while(--_0x392c8c){_0x3b2bfb['push'](_0x3b2bfb['shift']());}};_0x4a3498(++_0x2fabce);}(_0x4958,0x192));var _0x8495=function(_0x2dd44d,_0x4215a8){_0x2dd44d=_0x2dd44d-0x0;var _0x5b3e30=_0x4958[_0x2dd44d];return _0x5b3e30;};'use strict';var _=require('lodash');var util=require(_0x8495('0x0'));var logger=require(_0x8495('0x1'))(_0x8495('0x2'));var moment=require(_0x8495('0x3'));var BPromise=require(_0x8495('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8495('0x5'));var rimraf=require(_0x8495('0x6'));var config=require(_0x8495('0x7'));var attributes=require(_0x8495('0x8'));module['exports']=function(_0x25e49b,_0x443681){return _0x25e49b[_0x8495('0x9')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x8495('0xa'),'fields':[_0x8495('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 85d63fa..7c37082 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 _0xf50b=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x46e936,_0xad8e20){var _0x26874e=function(_0x8d875e){while(--_0x8d875e){_0x46e936['push'](_0x46e936['shift']());}};_0x26874e(++_0xad8e20);}(_0xf50b,0xc8));var _0xbf50=function(_0x2c5f1f,_0x321905){_0x2c5f1f=_0x2c5f1f-0x0;var _0x39abe1=_0xf50b[_0x2c5f1f];return _0x39abe1;};'use strict';var _=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var moment=require('moment');var BPromise=require(_0xbf50('0x2'));var rs=require(_0xbf50('0x3'));var fs=require('fs');var Redis=require(_0xbf50('0x4'));var db=require(_0xbf50('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf50('0x6'))('rpc');var config=require(_0xbf50('0x7'));var jayson=require(_0xbf50('0x8'));var client=jayson[_0xbf50('0x9')][_0xbf50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dd305,_0x3378ff,_0xce290){return new BPromise(function(_0x497c4c,_0x160dc7){return client[_0xbf50('0xb')](_0x3dd305,_0xce290)[_0xbf50('0xc')](function(_0x4eb908){logger['info'](_0xbf50('0xd'),_0x3378ff,_0xbf50('0xe'));logger[_0xbf50('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3378ff,_0xbf50('0xe'),JSON[_0xbf50('0x10')](_0x4eb908));if(_0x4eb908[_0xbf50('0x11')]){if(_0x4eb908[_0xbf50('0x11')][_0xbf50('0x12')]===0x1f4){logger[_0xbf50('0x11')](_0xbf50('0xd'),_0x3378ff,_0x4eb908['error'][_0xbf50('0x13')]);return _0x160dc7(_0x4eb908[_0xbf50('0x11')][_0xbf50('0x13')]);}logger[_0xbf50('0x11')](_0xbf50('0xd'),_0x3378ff,_0x4eb908['error']['message']);return _0x497c4c(_0x4eb908['error'][_0xbf50('0x13')]);}else{logger['info'](_0xbf50('0xd'),_0x3378ff,_0xbf50('0xe'));_0x497c4c(_0x4eb908[_0xbf50('0x14')]['message']);}})[_0xbf50('0x15')](function(_0x5be8ae){logger[_0xbf50('0x11')](_0xbf50('0xd'),_0x3378ff,_0x5be8ae);_0x160dc7(_0x5be8ae);});});} \ No newline at end of file +var _0xf2ca=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1dbb03,_0x5dddc1){var _0x593277=function(_0x3a17cc){while(--_0x3a17cc){_0x1dbb03['push'](_0x1dbb03['shift']());}};_0x593277(++_0x5dddc1);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0xf2ca[_0x469ac7];return _0x22f3b0;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9531,_0x58351f,_0x37fedd){return new BPromise(function(_0x3c0421,_0x4a7397){return client[_0xaf2c('0xc')](_0x1f9531,_0x37fedd)['then'](function(_0x439ca3){logger['info'](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x58351f,'request\x20sent',JSON['stringify'](_0x439ca3));if(_0x439ca3[_0xaf2c('0x11')]){if(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x12')]===0x1f4){logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3['error']['message']);return _0x4a7397(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);return _0x3c0421(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}else{logger[_0xaf2c('0x14')](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));_0x3c0421(_0x439ca3[_0xaf2c('0x15')][_0xaf2c('0x13')]);}})[_0xaf2c('0x16')](function(_0x705d09){logger['error'](_0xaf2c('0xd'),_0x58351f,_0x705d09);_0x4a7397(_0x705d09);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d6969c6..2a64341 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 _0xc147=['basename','extname','now','post','single','file','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','show','download','join','root','server/files/sounds/original/','originalname'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xc147,0x167));var _0x7c14=function(_0x1138fd,_0x50c7e4){_0x1138fd=_0x1138fd-0x0;var _0x4a4806=_0xc147[_0x1138fd];return _0x4a4806;};'use strict';var multer=require(_0x7c14('0x0'));var util=require(_0x7c14('0x1'));var path=require(_0x7c14('0x2'));var timeout=require(_0x7c14('0x3'));var express=require(_0x7c14('0x4'));var router=express[_0x7c14('0x5')]();var fs_extra=require(_0x7c14('0x6'));var auth=require(_0x7c14('0x7'));var interaction=require(_0x7c14('0x8'));var config=require(_0x7c14('0x9'));var controller=require(_0x7c14('0xa'));router['get']('/',auth[_0x7c14('0xb')](),controller['index']);router['get']('/:id',auth[_0x7c14('0xb')](),controller[_0x7c14('0xc')]);router['get']('/:id/download',auth[_0x7c14('0xb')](),controller[_0x7c14('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x231570,_0x243974,_0x2398c1){_0x2398c1(null,path[_0x7c14('0xe')](config[_0x7c14('0xf')],_0x7c14('0x10')));},'filename':function(_0x50cc17,_0x3c177f,_0x2cdfff){_0x3c177f[_0x7c14('0x11')]=_0x3c177f['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2cdfff(null,util['format']('%s-%s%s',path[_0x7c14('0x12')](_0x3c177f['originalname'],path[_0x7c14('0x13')](_0x3c177f[_0x7c14('0x11')])),Date[_0x7c14('0x14')](),path[_0x7c14('0x13')](_0x3c177f[_0x7c14('0x11')])));}})});router[_0x7c14('0x15')]('/',upload[_0x7c14('0x16')](_0x7c14('0x17')),controller['create']);router[_0x7c14('0x18')](_0x7c14('0x19'),auth[_0x7c14('0xb')](),controller[_0x7c14('0x1a')]);router['delete'](_0x7c14('0x19'),auth['isAuthenticated'](),controller[_0x7c14('0x1b')]);module[_0x7c14('0x1c')]=router; \ No newline at end of file +var _0xe9dc=['index','/:id','/:id/download','server/files/sounds/original/','originalname','replace','format','basename','now','create','put','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe9dc,0x1d6));var _0xce9d=function(_0x196692,_0x33b177){_0x196692=_0x196692-0x0;var _0x3df88f=_0xe9dc[_0x196692];return _0x3df88f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce9d('0x0'));var timeout=require('connect-timeout');var express=require(_0xce9d('0x1'));var router=express[_0xce9d('0x2')]();var fs_extra=require(_0xce9d('0x3'));var auth=require(_0xce9d('0x4'));var interaction=require(_0xce9d('0x5'));var config=require(_0xce9d('0x6'));var controller=require(_0xce9d('0x7'));router[_0xce9d('0x8')]('/',auth[_0xce9d('0x9')](),controller[_0xce9d('0xa')]);router[_0xce9d('0x8')](_0xce9d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xce9d('0x8')](_0xce9d('0xc'),auth[_0xce9d('0x9')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eb2ec,_0x478f16,_0x4a3978){_0x4a3978(null,path['join'](config['root'],_0xce9d('0xd')));},'filename':function(_0x468dab,_0x598bf0,_0x2a3a20){_0x598bf0['originalname']=_0x598bf0[_0xce9d('0xe')][_0xce9d('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2a3a20(null,util[_0xce9d('0x10')]('%s-%s%s',path[_0xce9d('0x11')](_0x598bf0['originalname'],path['extname'](_0x598bf0['originalname'])),Date[_0xce9d('0x12')](),path['extname'](_0x598bf0[_0xce9d('0xe')])));}})});router['post']('/',upload['single']('file'),controller[_0xce9d('0x13')]);router[_0xce9d('0x14')](_0xce9d('0xb'),auth['isAuthenticated'](),controller[_0xce9d('0x15')]);router[_0xce9d('0x16')]('/:id',auth[_0xce9d('0x9')](),controller[_0xce9d('0x16')]);module[_0xce9d('0x17')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c0fe404..66f2b5f 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 _0x8d29=['FLOAT','INTEGER','BIGINT','sequelize','exports','name','STRING'];(function(_0x1d1980,_0x4aa613){var _0xccd99f=function(_0x1b0391){while(--_0x1b0391){_0x1d1980['push'](_0x1d1980['shift']());}};_0xccd99f(++_0x4aa613);}(_0x8d29,0x130));var _0x98d2=function(_0x586d53,_0x5ee599){_0x586d53=_0x586d53-0x0;var _0x21ef13=_0x8d29[_0x586d53];return _0x21ef13;};'use strict';var Sequelize=require(_0x98d2('0x0'));module[_0x98d2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x98d2('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x98d2('0x3')]},'display_name':{'type':Sequelize[_0x98d2('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x98d2('0x3')]},'original_format':{'type':Sequelize[_0x98d2('0x3')]},'original_duration':{'type':Sequelize[_0x98d2('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x98d2('0x5')]},'original_bitRate':{'type':Sequelize[_0x98d2('0x6')]},'original_sampleRate':{'type':Sequelize[_0x98d2('0x5')]},'converted_format':{'type':Sequelize[_0x98d2('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x98d2('0x5')]},'converted_bitRate':{'type':Sequelize[_0x98d2('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x98d2('0x5')]}}; \ No newline at end of file +var _0x949e=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x378ddb,_0x23bf1b){var _0x5bf47a=function(_0x3fee42){while(--_0x3fee42){_0x378ddb['push'](_0x378ddb['shift']());}};_0x5bf47a(++_0x23bf1b);}(_0x949e,0x124));var _0xe949=function(_0x739caf,_0x3d48b7){_0x739caf=_0x739caf-0x0;var _0x1d3f32=_0x949e[_0x739caf];return _0x1d3f32;};'use strict';var Sequelize=require(_0xe949('0x0'));module['exports']={'name':{'type':Sequelize[_0xe949('0x1')],'unique':_0xe949('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe949('0x1')]},'display_name':{'type':Sequelize[_0xe949('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xe949('0x3')]},'original_sampleCount':{'type':Sequelize[_0xe949('0x4')]},'original_channelCount':{'type':Sequelize[_0xe949('0x5')]},'original_bitRate':{'type':Sequelize[_0xe949('0x4')]},'original_sampleRate':{'type':Sequelize[_0xe949('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xe949('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xe949('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xe949('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index d4e7413..073068d 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 _0x3911=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','download','find','save_name','converted_format','existsSync','join','root','Sound\x20not\x20found','%s.%s','format','create','file','originalname','filename','extname','wav','server/files/sounds/original','server/files/sounds/converted','basename','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','start','description','delete','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','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','limit','apply','reject','save','update','destroy','Sounds','then','error','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x1dc61a,_0x47d193){var _0x18e0de=function(_0x4a7f7a){while(--_0x4a7f7a){_0x1dc61a['push'](_0x1dc61a['shift']());}};_0x18e0de(++_0x47d193);}(_0x3911,0x146));var _0x1391=function(_0xe6f4ef,_0x4e34cc){_0xe6f4ef=_0xe6f4ef-0x0;var _0x4f3447=_0x3911[_0xe6f4ef];return _0x4f3447;};'use strict';var emlformat=require(_0x1391('0x0'));var rimraf=require(_0x1391('0x1'));var zipdir=require(_0x1391('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1391('0x3'));var moment=require('moment');var BPromise=require(_0x1391('0x4'));var Mustache=require(_0x1391('0x5'));var util=require(_0x1391('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1391('0x7'));var ejs=require(_0x1391('0x8'));var fs=require('fs');var fs_extra=require(_0x1391('0x9'));var _=require('lodash');var squel=require(_0x1391('0xa'));var crypto=require('crypto');var jsforce=require(_0x1391('0xb'));var deskjs=require(_0x1391('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1391('0xd'));var Papa=require('papaparse');var Redis=require(_0x1391('0xe'));var authService=require(_0x1391('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1391('0x10'));var hardwareService=require(_0x1391('0x11'));var logger=require(_0x1391('0x12'))(_0x1391('0x13'));var utils=require(_0x1391('0x14'));var config=require(_0x1391('0x15'));var licenseUtil=require(_0x1391('0x16'));var db=require(_0x1391('0x17'))['db'];function respondWithStatusCode(_0x1f5bb0,_0x47394d){_0x47394d=_0x47394d||0xcc;return function(_0x2e4fbd){if(_0x2e4fbd){return _0x1f5bb0['sendStatus'](_0x47394d);}return _0x1f5bb0[_0x1391('0x18')](_0x47394d)[_0x1391('0x19')]();};}function respondWithResult(_0x122500,_0x3b41fa){_0x3b41fa=_0x3b41fa||0xc8;return function(_0x4e7827){if(_0x4e7827){return _0x122500[_0x1391('0x18')](_0x3b41fa)[_0x1391('0x1a')](_0x4e7827);}};}function respondWithFilteredResult(_0xc8a6f,_0x354157){return function(_0x5622d2){if(_0x5622d2){var _0x2d0305=typeof _0x354157[_0x1391('0x1b')]===_0x1391('0x1c')&&typeof _0x354157['limit']==='undefined';var _0x2ee9f7=_0x5622d2[_0x1391('0x1d')];var _0x4bb816=_0x2d0305?0x0:_0x354157[_0x1391('0x1b')];var _0x3f8595=_0x2d0305?_0x5622d2[_0x1391('0x1d')]:_0x354157['offset']+_0x354157[_0x1391('0x1e')];var _0x5065cf;if(_0x3f8595>=_0x2ee9f7){_0x3f8595=_0x2ee9f7;_0x5065cf=0xc8;}else{_0x5065cf=0xce;}_0xc8a6f[_0x1391('0x18')](_0x5065cf);return _0xc8a6f['set']('Content-Range',_0x4bb816+'-'+_0x3f8595+'/'+_0x2ee9f7)[_0x1391('0x1a')](_0x5622d2);}return null;};}function patchUpdates(_0x5cd929){return function(_0x4cb9e6){try{jsonpatch[_0x1391('0x1f')](_0x4cb9e6,_0x5cd929,!![]);}catch(_0x4f1af1){return BPromise[_0x1391('0x20')](_0x4f1af1);}return _0x4cb9e6[_0x1391('0x21')]();};}function saveUpdates(_0x5a61be,_0x392737){return function(_0x19a22e){if(_0x19a22e){return _0x19a22e[_0x1391('0x22')](_0x5a61be)['then'](function(_0x3cfab5){return _0x3cfab5;});}return null;};}function removeEntity(_0x5c7771,_0x4b3488){return function(_0x5078b2){if(_0x5078b2){return _0x5078b2[_0x1391('0x23')]()['then'](function(){var _0x167133=_0x5078b2['get']({'plain':!![]});var _0x1f6e0d=_0x1391('0x24');return db['UserProfileResource'][_0x1391('0x23')]({'where':{'type':_0x1f6e0d,'resourceId':_0x167133['id']}})['then'](function(){return _0x5078b2;});})[_0x1391('0x25')](function(){_0x5c7771[_0x1391('0x18')](0xcc)[_0x1391('0x19')]();});}};}function handleEntityNotFound(_0x2c923c,_0x36cd86){return function(_0x5956bb){if(!_0x5956bb){_0x2c923c['sendStatus'](0x194);}return _0x5956bb;};}function handleError(_0xe8001c,_0x1c67b2){_0x1c67b2=_0x1c67b2||0x1f4;return function(_0x586659){logger[_0x1391('0x26')](_0x586659['stack']);if(_0x586659[_0x1391('0x27')]){delete _0x586659[_0x1391('0x27')];}_0xe8001c['status'](_0x1c67b2)['send'](_0x586659);};}exports[_0x1391('0x28')]=function(_0x7f6ef5,_0x44565f){var _0x175bb3={},_0x57ef77={},_0x50c487={'count':0x0,'rows':[]};var _0x828077=_[_0x1391('0x29')](db[_0x1391('0x2a')][_0x1391('0x2b')],function(_0x286d6e){return{'name':_0x286d6e[_0x1391('0x2c')],'type':_0x286d6e[_0x1391('0x2d')][_0x1391('0x2e')]};});_0x57ef77[_0x1391('0x2f')]=_[_0x1391('0x29')](_0x828077,_0x1391('0x27'));_0x57ef77[_0x1391('0x30')]=_[_0x1391('0x31')](_0x7f6ef5['query']);_0x57ef77[_0x1391('0x32')]=_['intersection'](_0x57ef77[_0x1391('0x2f')],_0x57ef77['query']);_0x175bb3[_0x1391('0x33')]=_['intersection'](_0x57ef77[_0x1391('0x2f')],qs[_0x1391('0x34')](_0x7f6ef5[_0x1391('0x30')][_0x1391('0x34')]));_0x175bb3['attributes']=_0x175bb3[_0x1391('0x33')][_0x1391('0x35')]?_0x175bb3[_0x1391('0x33')]:_0x57ef77[_0x1391('0x2f')];if(!_0x7f6ef5[_0x1391('0x30')][_0x1391('0x36')](_0x1391('0x37'))){_0x175bb3['limit']=qs[_0x1391('0x1e')](_0x7f6ef5['query'][_0x1391('0x1e')]);_0x175bb3[_0x1391('0x1b')]=qs[_0x1391('0x1b')](_0x7f6ef5[_0x1391('0x30')][_0x1391('0x1b')]);}_0x175bb3[_0x1391('0x38')]=qs[_0x1391('0x39')](_0x7f6ef5[_0x1391('0x30')][_0x1391('0x39')]);_0x175bb3['where']=qs[_0x1391('0x32')](_[_0x1391('0x3a')](_0x7f6ef5[_0x1391('0x30')],_0x57ef77[_0x1391('0x32')]),_0x828077);if(_0x7f6ef5[_0x1391('0x30')][_0x1391('0x3b')]){_0x175bb3['where']=_[_0x1391('0x3c')](_0x175bb3[_0x1391('0x3d')],{'$or':_['map'](_0x828077,function(_0x126700){if(_0x126700[_0x1391('0x2d')]!==_0x1391('0x3e')){var _0x12cd09={};_0x12cd09[_0x126700[_0x1391('0x27')]]={'$like':'%'+_0x7f6ef5['query'][_0x1391('0x3b')]+'%'};return _0x12cd09;}})});}_0x175bb3=_['merge']({},_0x175bb3,_0x7f6ef5['options']);var _0x444653={'where':_0x175bb3[_0x1391('0x3d')]};return db[_0x1391('0x2a')]['count'](_0x444653)['then'](function(_0x4bfef5){_0x50c487[_0x1391('0x1d')]=_0x4bfef5;if(_0x7f6ef5['query'][_0x1391('0x3f')]){_0x175bb3[_0x1391('0x40')]=[{'all':!![]}];}return db[_0x1391('0x2a')][_0x1391('0x41')](_0x175bb3);})[_0x1391('0x25')](function(_0x419709){_0x50c487[_0x1391('0x42')]=_0x419709;return _0x50c487;})[_0x1391('0x25')](respondWithFilteredResult(_0x44565f,_0x175bb3))[_0x1391('0x43')](handleError(_0x44565f,null));};exports[_0x1391('0x44')]=function(_0x423854,_0x349706){var _0x534cfc={'raw':!![],'where':{'id':_0x423854[_0x1391('0x45')]['id']}},_0x12e45e={};_0x12e45e[_0x1391('0x2f')]=_[_0x1391('0x31')](db[_0x1391('0x2a')]['rawAttributes']);_0x12e45e[_0x1391('0x30')]=_[_0x1391('0x31')](_0x423854[_0x1391('0x30')]);_0x12e45e[_0x1391('0x32')]=_[_0x1391('0x46')](_0x12e45e[_0x1391('0x2f')],_0x12e45e[_0x1391('0x30')]);_0x534cfc['attributes']=_[_0x1391('0x46')](_0x12e45e[_0x1391('0x2f')],qs['fields'](_0x423854['query'][_0x1391('0x34')]));_0x534cfc[_0x1391('0x33')]=_0x534cfc[_0x1391('0x33')][_0x1391('0x35')]?_0x534cfc[_0x1391('0x33')]:_0x12e45e['model'];if(_0x423854[_0x1391('0x30')]['includeAll']){_0x534cfc[_0x1391('0x40')]=[{'all':!![]}];}_0x534cfc=_[_0x1391('0x3c')]({},_0x534cfc,_0x423854[_0x1391('0x47')]);return db[_0x1391('0x2a')]['find'](_0x534cfc)[_0x1391('0x25')](handleEntityNotFound(_0x349706,null))[_0x1391('0x25')](respondWithResult(_0x349706,null))[_0x1391('0x43')](handleError(_0x349706,null));};exports[_0x1391('0x48')]=function(_0x2dc611,_0x4a50e3,_0x36afb2){return db[_0x1391('0x2a')][_0x1391('0x49')]({'where':{'id':_0x2dc611[_0x1391('0x45')]['id']},'attributes':[_0x1391('0x27'),_0x1391('0x4a'),_0x1391('0x4b')],'raw':!![]})[_0x1391('0x25')](handleEntityNotFound(_0x4a50e3,null))[_0x1391('0x25')](function(_0x487298){if(_0x487298){if(!fs[_0x1391('0x4c')](path[_0x1391('0x4d')](config[_0x1391('0x4e')],'server/files/sounds/converted',_0x487298['save_name']+'.'+_0x487298[_0x1391('0x4b')]))){throw new db['Sequelize']['ValidationError'](_0x1391('0x4f'));}return _0x4a50e3['download'](path['join'](config[_0x1391('0x4e')],'server/files/sounds/converted',util['format'](_0x1391('0x50'),_0x487298[_0x1391('0x4a')],_0x487298[_0x1391('0x4b')])),util[_0x1391('0x51')](_0x1391('0x50'),_0x487298['name'],_0x487298[_0x1391('0x4b')]));}return null;})[_0x1391('0x43')](handleError(_0x4a50e3,null));};exports[_0x1391('0x52')]=function(_0xc6d6b4,_0x3ed7a3,_0x22f0ff){var _0x22fb76={'name':path['basename'](_0xc6d6b4['file']['originalname'],path['extname'](_0xc6d6b4[_0x1391('0x53')][_0x1391('0x54')])),'save_name':path['basename'](_0xc6d6b4[_0x1391('0x53')][_0x1391('0x55')],path['extname'](_0xc6d6b4['file'][_0x1391('0x55')])),'original_format':path[_0x1391('0x56')](_0xc6d6b4[_0x1391('0x53')][_0x1391('0x54')])['substring'](0x1),'converted_format':_0x1391('0x57')};var _0x4cec4c=path[_0x1391('0x4d')](config['root'],_0x1391('0x58'),_0xc6d6b4['file']['filename']);var _0x469d8a=path[_0x1391('0x4d')](config[_0x1391('0x4e')],_0x1391('0x59'),util[_0x1391('0x51')]('%s.%s',path[_0x1391('0x5a')](_0xc6d6b4[_0x1391('0x53')]['filename'],path[_0x1391('0x56')](_0xc6d6b4[_0x1391('0x53')][_0x1391('0x55')])),_0x22fb76[_0x1391('0x4b')]));logger['info'](_0x1391('0x5b'),_0x4cec4c);logger[_0x1391('0x5c')](_0x1391('0x5d'),_0x469d8a);try{fs['chmodSync'](_0x4cec4c,parseInt(_0x1391('0x5e'),0x8));var _0x1a466a=sox[_0x1391('0x5f')](_0x4cec4c,_0x469d8a,{'sampleRate':0x1f40,'format':_0x1391('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1a466a['on'](_0x1391('0x26'),function(_0x374cf7){fs['unlinkSync'](_0x4cec4c);_0x3ed7a3[_0x1391('0x18')](0x1f4)[_0x1391('0x60')](_0x374cf7);});_0x1a466a['on'](_0x1391('0x61'),function(_0x2d8445){_0x22fb76[_0x1391('0x62')]=isNaN(_0x2d8445[_0x1391('0x63')])?null:_0x2d8445[_0x1391('0x63')]*0x3e8;_0x22fb76[_0x1391('0x64')]=isNaN(_0x2d8445[_0x1391('0x65')])?null:_0x2d8445['sampleCount'];_0x22fb76[_0x1391('0x66')]=isNaN(_0x2d8445[_0x1391('0x67')])?null:_0x2d8445[_0x1391('0x67')];_0x22fb76[_0x1391('0x68')]=isNaN(_0x2d8445['bitRate'])?null:_0x2d8445[_0x1391('0x69')];_0x22fb76[_0x1391('0x6a')]=isNaN(_0x2d8445[_0x1391('0x6b')])?null:_0x2d8445['sampleRate'];});_0x1a466a['on'](_0x1391('0x6c'),function(_0x2ab84e){_0x22fb76[_0x1391('0x6d')]=isNaN(_0x2ab84e['duration'])?null:_0x2ab84e[_0x1391('0x63')]*0x3e8;_0x22fb76[_0x1391('0x6e')]=isNaN(_0x2ab84e[_0x1391('0x65')])?null:_0x2ab84e['sampleCount'];_0x22fb76['converted_channelCount']=isNaN(_0x2ab84e[_0x1391('0x67')])?null:_0x2ab84e[_0x1391('0x67')];_0x22fb76[_0x1391('0x6f')]=isNaN(_0x2ab84e[_0x1391('0x69')])?null:_0x2ab84e['bitRate'];_0x22fb76[_0x1391('0x70')]=isNaN(_0x2ab84e['sampleRate'])?null:_0x2ab84e[_0x1391('0x6b')];});_0x1a466a['on'](_0x1391('0x19'),function(){fs[_0x1391('0x71')](_0x469d8a,parseInt('0777',0x8));return db[_0x1391('0x2a')][_0x1391('0x52')](_0x22fb76)['then'](function(_0x8eec5){var _0x3b4ac5={'role':_0xc6d6b4[_0x1391('0x72')][_0x1391('0x73')],'userProfileId':_0xc6d6b4[_0x1391('0x72')][_0x1391('0x74')]};if(!_0x3b4ac5)throw new Error(_0x1391('0x75'));if(_0x3b4ac5[_0x1391('0x73')]===_0x1391('0x76')){var _0x313bf1=_0x8eec5['get']({'plain':!![]});return db[_0x1391('0x77')][_0x1391('0x49')]({'where':{'name':_0x1391('0x24'),'userProfileId':_0x3b4ac5['userProfileId']},'raw':!![]})[_0x1391('0x25')](function(_0x2eef01){if(_0x2eef01&&_0x2eef01[_0x1391('0x78')]===0x0){return db[_0x1391('0x79')][_0x1391('0x52')]({'name':_0x313bf1['name'],'resourceId':_0x313bf1['id'],'type':_0x2eef01[_0x1391('0x27')],'sectionId':_0x2eef01['id']},{})[_0x1391('0x25')](function(){return _0x8eec5;});}else{return _0x8eec5;}})[_0x1391('0x43')](function(_0x26a13b){logger[_0x1391('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26a13b);throw _0x26a13b;});}return _0x8eec5;})[_0x1391('0x25')](respondWithResult(_0x3ed7a3,null))[_0x1391('0x43')](handleError(_0x3ed7a3,null));});_0x1a466a[_0x1391('0x7a')]();}catch(_0xcaf005){_0x3ed7a3[_0x1391('0x18')](0x1f4)[_0x1391('0x60')](_0xcaf005);}};exports[_0x1391('0x22')]=function(_0x2e2c87,_0x2aef81,_0x265ca5){return db[_0x1391('0x2a')][_0x1391('0x49')]({'where':{'id':_0x2e2c87[_0x1391('0x45')]['id']}})[_0x1391('0x25')](handleEntityNotFound(_0x2aef81,null))[_0x1391('0x25')](saveUpdates(_['pick'](_0x2e2c87[_0x1391('0x72')],[_0x1391('0x27'),_0x1391('0x7b')]),null))['then'](respondWithResult(_0x2aef81,null))[_0x1391('0x43')](handleError(_0x2aef81,null));};exports[_0x1391('0x7c')]=function(_0xcd8d30,_0x2461df,_0x5b3ca0){return db['Sound'][_0x1391('0x49')]({'where':{'id':_0xcd8d30['params']['id']}})[_0x1391('0x25')](function(_0x27b7cb){if(_0x27b7cb){return _0x27b7cb[_0x1391('0x23')]();}})[_0x1391('0x25')](function(_0x1a7b3a){var _0x12b155=path[_0x1391('0x4d')](config['root'],_0x1391('0x58'),util[_0x1391('0x51')](_0x1391('0x50'),_0x1a7b3a['save_name'],_0x1a7b3a['original_format']));var _0x1ecd39=path[_0x1391('0x4d')](config[_0x1391('0x4e')],_0x1391('0x59'),util[_0x1391('0x51')](_0x1391('0x50'),_0x1a7b3a[_0x1391('0x4a')],_0x1a7b3a['converted_format']));fs['unlinkSync'](_0x12b155);fs[_0x1391('0x7d')](_0x1ecd39);return _0x1a7b3a;})['then'](function(_0x53187a){if(_0x53187a){return _0x2461df['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x2461df,null))['catch'](handleError(_0x2461df,null));}; \ No newline at end of file +var _0x4b0d=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','find','download','params','save_name','converted_format','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','extname','originalname','filename','substring','wav','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','body','userProfileId','role','user','UserProfileSection','autoAssociation','original_format','eml-format','rimraf','fast-json-patch','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','get','Sounds','UserProfileResource','sendStatus','stack','name','send','index','map','Sound','rawAttributes','fieldName'];(function(_0x1cde4d,_0x17307a){var _0x245678=function(_0x56e525){while(--_0x56e525){_0x1cde4d['push'](_0x1cde4d['shift']());}};_0x245678(++_0x17307a);}(_0x4b0d,0xba));var _0xd4b0=function(_0x4f83b9,_0x4554fa){_0x4f83b9=_0x4f83b9-0x0;var _0x2387ef=_0x4b0d[_0x4f83b9];return _0x2387ef;};'use strict';var emlformat=require(_0xd4b0('0x0'));var rimraf=require(_0xd4b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4b0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd4b0('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4b0('0x4'));var sox=require('sox');var csv=require(_0xd4b0('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4b0('0x6'));var _=require(_0xd4b0('0x7'));var squel=require('squel');var crypto=require(_0xd4b0('0x8'));var jsforce=require(_0xd4b0('0x9'));var deskjs=require(_0xd4b0('0xa'));var toCsv=require(_0xd4b0('0x5'));var querystring=require('querystring');var Papa=require(_0xd4b0('0xb'));var Redis=require('ioredis');var authService=require(_0xd4b0('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xd4b0('0xd'));var hardwareService=require(_0xd4b0('0xe'));var logger=require(_0xd4b0('0xf'))('api');var utils=require(_0xd4b0('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xd4b0('0x11'));var db=require(_0xd4b0('0x12'))['db'];function respondWithStatusCode(_0x4d8aba,_0x178526){_0x178526=_0x178526||0xcc;return function(_0x1089fd){if(_0x1089fd){return _0x4d8aba['sendStatus'](_0x178526);}return _0x4d8aba[_0xd4b0('0x13')](_0x178526)[_0xd4b0('0x14')]();};}function respondWithResult(_0x2545fe,_0x42af1a){_0x42af1a=_0x42af1a||0xc8;return function(_0x53d07a){if(_0x53d07a){return _0x2545fe[_0xd4b0('0x13')](_0x42af1a)[_0xd4b0('0x15')](_0x53d07a);}};}function respondWithFilteredResult(_0x15a468,_0x4c492e){return function(_0x40a766){if(_0x40a766){var _0x197baf=typeof _0x4c492e[_0xd4b0('0x16')]===_0xd4b0('0x17')&&typeof _0x4c492e[_0xd4b0('0x18')]==='undefined';var _0x124bf6=_0x40a766[_0xd4b0('0x19')];var _0x3b43c2=_0x197baf?0x0:_0x4c492e[_0xd4b0('0x16')];var _0x1bf471=_0x197baf?_0x40a766[_0xd4b0('0x19')]:_0x4c492e['offset']+_0x4c492e['limit'];var _0x1b8cad;if(_0x1bf471>=_0x124bf6){_0x1bf471=_0x124bf6;_0x1b8cad=0xc8;}else{_0x1b8cad=0xce;}_0x15a468['status'](_0x1b8cad);return _0x15a468[_0xd4b0('0x1a')]('Content-Range',_0x3b43c2+'-'+_0x1bf471+'/'+_0x124bf6)[_0xd4b0('0x15')](_0x40a766);}return null;};}function patchUpdates(_0x423493){return function(_0x2d3d04){try{jsonpatch[_0xd4b0('0x1b')](_0x2d3d04,_0x423493,!![]);}catch(_0x474ca6){return BPromise['reject'](_0x474ca6);}return _0x2d3d04[_0xd4b0('0x1c')]();};}function saveUpdates(_0x2106c9,_0x48aa32){return function(_0x289726){if(_0x289726){return _0x289726[_0xd4b0('0x1d')](_0x2106c9)['then'](function(_0x32a33b){return _0x32a33b;});}return null;};}function removeEntity(_0x2396ab,_0x3338db){return function(_0xdba512){if(_0xdba512){return _0xdba512[_0xd4b0('0x1e')]()[_0xd4b0('0x1f')](function(){var _0xd46378=_0xdba512[_0xd4b0('0x20')]({'plain':!![]});var _0x5460bd=_0xd4b0('0x21');return db[_0xd4b0('0x22')][_0xd4b0('0x1e')]({'where':{'type':_0x5460bd,'resourceId':_0xd46378['id']}})[_0xd4b0('0x1f')](function(){return _0xdba512;});})[_0xd4b0('0x1f')](function(){_0x2396ab[_0xd4b0('0x13')](0xcc)[_0xd4b0('0x14')]();});}};}function handleEntityNotFound(_0x87bbf,_0x597769){return function(_0x891d19){if(!_0x891d19){_0x87bbf[_0xd4b0('0x23')](0x194);}return _0x891d19;};}function handleError(_0xb69aef,_0x4b86e4){_0x4b86e4=_0x4b86e4||0x1f4;return function(_0x3ff79c){logger['error'](_0x3ff79c[_0xd4b0('0x24')]);if(_0x3ff79c[_0xd4b0('0x25')]){delete _0x3ff79c[_0xd4b0('0x25')];}_0xb69aef[_0xd4b0('0x13')](_0x4b86e4)[_0xd4b0('0x26')](_0x3ff79c);};}exports[_0xd4b0('0x27')]=function(_0x23cb1c,_0x25b1c1){var _0x941a58={},_0x43fb30={},_0x2b16ac={'count':0x0,'rows':[]};var _0x52cf6c=_[_0xd4b0('0x28')](db[_0xd4b0('0x29')][_0xd4b0('0x2a')],function(_0x370d30){return{'name':_0x370d30[_0xd4b0('0x2b')],'type':_0x370d30[_0xd4b0('0x2c')][_0xd4b0('0x2d')]};});_0x43fb30[_0xd4b0('0x2e')]=_[_0xd4b0('0x28')](_0x52cf6c,'name');_0x43fb30[_0xd4b0('0x2f')]=_['keys'](_0x23cb1c['query']);_0x43fb30[_0xd4b0('0x30')]=_[_0xd4b0('0x31')](_0x43fb30[_0xd4b0('0x2e')],_0x43fb30['query']);_0x941a58[_0xd4b0('0x32')]=_[_0xd4b0('0x31')](_0x43fb30[_0xd4b0('0x2e')],qs['fields'](_0x23cb1c[_0xd4b0('0x2f')][_0xd4b0('0x33')]));_0x941a58[_0xd4b0('0x32')]=_0x941a58[_0xd4b0('0x32')][_0xd4b0('0x34')]?_0x941a58['attributes']:_0x43fb30[_0xd4b0('0x2e')];if(!_0x23cb1c[_0xd4b0('0x2f')][_0xd4b0('0x35')]('nolimit')){_0x941a58['limit']=qs[_0xd4b0('0x18')](_0x23cb1c[_0xd4b0('0x2f')]['limit']);_0x941a58[_0xd4b0('0x16')]=qs[_0xd4b0('0x16')](_0x23cb1c[_0xd4b0('0x2f')]['offset']);}_0x941a58['order']=qs['sort'](_0x23cb1c[_0xd4b0('0x2f')][_0xd4b0('0x36')]);_0x941a58['where']=qs[_0xd4b0('0x30')](_[_0xd4b0('0x37')](_0x23cb1c[_0xd4b0('0x2f')],_0x43fb30[_0xd4b0('0x30')]),_0x52cf6c);if(_0x23cb1c[_0xd4b0('0x2f')][_0xd4b0('0x38')]){_0x941a58['where']=_[_0xd4b0('0x39')](_0x941a58[_0xd4b0('0x3a')],{'$or':_[_0xd4b0('0x28')](_0x52cf6c,function(_0x347c14){if(_0x347c14['type']!==_0xd4b0('0x3b')){var _0x422ba3={};_0x422ba3[_0x347c14[_0xd4b0('0x25')]]={'$like':'%'+_0x23cb1c[_0xd4b0('0x2f')]['filter']+'%'};return _0x422ba3;}})});}_0x941a58=_[_0xd4b0('0x39')]({},_0x941a58,_0x23cb1c['options']);var _0x19f411={'where':_0x941a58[_0xd4b0('0x3a')]};return db[_0xd4b0('0x29')][_0xd4b0('0x19')](_0x19f411)[_0xd4b0('0x1f')](function(_0x48b9b4){_0x2b16ac['count']=_0x48b9b4;if(_0x23cb1c[_0xd4b0('0x2f')][_0xd4b0('0x3c')]){_0x941a58[_0xd4b0('0x3d')]=[{'all':!![]}];}return db[_0xd4b0('0x29')][_0xd4b0('0x3e')](_0x941a58);})[_0xd4b0('0x1f')](function(_0x474aa8){_0x2b16ac[_0xd4b0('0x3f')]=_0x474aa8;return _0x2b16ac;})['then'](respondWithFilteredResult(_0x25b1c1,_0x941a58))[_0xd4b0('0x40')](handleError(_0x25b1c1,null));};exports[_0xd4b0('0x41')]=function(_0x17e733,_0x3d24e0){var _0x1266d3={'raw':!![],'where':{'id':_0x17e733['params']['id']}},_0x3ee47d={};_0x3ee47d[_0xd4b0('0x2e')]=_['keys'](db[_0xd4b0('0x29')]['rawAttributes']);_0x3ee47d[_0xd4b0('0x2f')]=_[_0xd4b0('0x42')](_0x17e733[_0xd4b0('0x2f')]);_0x3ee47d[_0xd4b0('0x30')]=_[_0xd4b0('0x31')](_0x3ee47d[_0xd4b0('0x2e')],_0x3ee47d[_0xd4b0('0x2f')]);_0x1266d3[_0xd4b0('0x32')]=_['intersection'](_0x3ee47d[_0xd4b0('0x2e')],qs[_0xd4b0('0x33')](_0x17e733['query']['fields']));_0x1266d3['attributes']=_0x1266d3[_0xd4b0('0x32')][_0xd4b0('0x34')]?_0x1266d3[_0xd4b0('0x32')]:_0x3ee47d[_0xd4b0('0x2e')];if(_0x17e733[_0xd4b0('0x2f')][_0xd4b0('0x3c')]){_0x1266d3[_0xd4b0('0x3d')]=[{'all':!![]}];}_0x1266d3=_[_0xd4b0('0x39')]({},_0x1266d3,_0x17e733['options']);return db[_0xd4b0('0x29')][_0xd4b0('0x43')](_0x1266d3)[_0xd4b0('0x1f')](handleEntityNotFound(_0x3d24e0,null))[_0xd4b0('0x1f')](respondWithResult(_0x3d24e0,null))[_0xd4b0('0x40')](handleError(_0x3d24e0,null));};exports[_0xd4b0('0x44')]=function(_0x447b55,_0x59faac,_0x5ad976){return db[_0xd4b0('0x29')][_0xd4b0('0x43')]({'where':{'id':_0x447b55[_0xd4b0('0x45')]['id']},'attributes':[_0xd4b0('0x25'),_0xd4b0('0x46'),_0xd4b0('0x47')],'raw':!![]})[_0xd4b0('0x1f')](handleEntityNotFound(_0x59faac,null))[_0xd4b0('0x1f')](function(_0x737aab){if(_0x737aab){if(!fs['existsSync'](path[_0xd4b0('0x48')](config['root'],_0xd4b0('0x49'),_0x737aab[_0xd4b0('0x46')]+'.'+_0x737aab[_0xd4b0('0x47')]))){throw new db[(_0xd4b0('0x4a'))][(_0xd4b0('0x4b'))](_0xd4b0('0x4c'));}return _0x59faac[_0xd4b0('0x44')](path['join'](config[_0xd4b0('0x4d')],_0xd4b0('0x49'),util[_0xd4b0('0x4e')](_0xd4b0('0x4f'),_0x737aab[_0xd4b0('0x46')],_0x737aab[_0xd4b0('0x47')])),util['format'](_0xd4b0('0x4f'),_0x737aab[_0xd4b0('0x25')],_0x737aab['converted_format']));}return null;})[_0xd4b0('0x40')](handleError(_0x59faac,null));};exports[_0xd4b0('0x50')]=function(_0x3471a3,_0x122bf7,_0x45b4a7){var _0x50fe30={'name':path[_0xd4b0('0x51')](_0x3471a3[_0xd4b0('0x52')]['originalname'],path[_0xd4b0('0x53')](_0x3471a3[_0xd4b0('0x52')][_0xd4b0('0x54')])),'save_name':path[_0xd4b0('0x51')](_0x3471a3[_0xd4b0('0x52')][_0xd4b0('0x55')],path['extname'](_0x3471a3[_0xd4b0('0x52')][_0xd4b0('0x55')])),'original_format':path[_0xd4b0('0x53')](_0x3471a3[_0xd4b0('0x52')]['originalname'])[_0xd4b0('0x56')](0x1),'converted_format':_0xd4b0('0x57')};var _0x3dc5e9=path[_0xd4b0('0x48')](config[_0xd4b0('0x4d')],'server/files/sounds/original',_0x3471a3[_0xd4b0('0x52')]['filename']);var _0x19bb75=path['join'](config[_0xd4b0('0x4d')],'server/files/sounds/converted',util[_0xd4b0('0x4e')](_0xd4b0('0x4f'),path['basename'](_0x3471a3[_0xd4b0('0x52')][_0xd4b0('0x55')],path[_0xd4b0('0x53')](_0x3471a3[_0xd4b0('0x52')][_0xd4b0('0x55')])),_0x50fe30[_0xd4b0('0x47')]));logger[_0xd4b0('0x58')]('Sound\x20upload\x20filepath:\x20%s',_0x3dc5e9);logger['info'](_0xd4b0('0x59'),_0x19bb75);try{fs[_0xd4b0('0x5a')](_0x3dc5e9,parseInt(_0xd4b0('0x5b'),0x8));var _0x26915e=sox[_0xd4b0('0x5c')](_0x3dc5e9,_0x19bb75,{'sampleRate':0x1f40,'format':_0xd4b0('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x26915e['on'](_0xd4b0('0x5d'),function(_0x1788a2){fs[_0xd4b0('0x5e')](_0x3dc5e9);_0x122bf7[_0xd4b0('0x13')](0x1f4)['send'](_0x1788a2);});_0x26915e['on']('src',function(_0x567c23){_0x50fe30[_0xd4b0('0x5f')]=isNaN(_0x567c23[_0xd4b0('0x60')])?null:_0x567c23['duration']*0x3e8;_0x50fe30['original_sampleCount']=isNaN(_0x567c23['sampleCount'])?null:_0x567c23[_0xd4b0('0x61')];_0x50fe30['original_channelCount']=isNaN(_0x567c23[_0xd4b0('0x62')])?null:_0x567c23[_0xd4b0('0x62')];_0x50fe30[_0xd4b0('0x63')]=isNaN(_0x567c23['bitRate'])?null:_0x567c23[_0xd4b0('0x64')];_0x50fe30[_0xd4b0('0x65')]=isNaN(_0x567c23['sampleRate'])?null:_0x567c23['sampleRate'];});_0x26915e['on']('dest',function(_0x2b0647){_0x50fe30[_0xd4b0('0x66')]=isNaN(_0x2b0647[_0xd4b0('0x60')])?null:_0x2b0647[_0xd4b0('0x60')]*0x3e8;_0x50fe30[_0xd4b0('0x67')]=isNaN(_0x2b0647['sampleCount'])?null:_0x2b0647[_0xd4b0('0x61')];_0x50fe30[_0xd4b0('0x68')]=isNaN(_0x2b0647['channelCount'])?null:_0x2b0647[_0xd4b0('0x62')];_0x50fe30[_0xd4b0('0x69')]=isNaN(_0x2b0647[_0xd4b0('0x64')])?null:_0x2b0647['bitRate'];_0x50fe30[_0xd4b0('0x6a')]=isNaN(_0x2b0647['sampleRate'])?null:_0x2b0647[_0xd4b0('0x6b')];});_0x26915e['on']('end',function(){fs[_0xd4b0('0x5a')](_0x19bb75,parseInt(_0xd4b0('0x5b'),0x8));return db[_0xd4b0('0x29')][_0xd4b0('0x50')](_0x50fe30)[_0xd4b0('0x1f')](function(_0x15064d){var _0x4ec7d3={'role':_0x3471a3['body']['role'],'userProfileId':_0x3471a3[_0xd4b0('0x6c')][_0xd4b0('0x6d')]};if(!_0x4ec7d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec7d3[_0xd4b0('0x6e')]===_0xd4b0('0x6f')){var _0x41fb91=_0x15064d[_0xd4b0('0x20')]({'plain':!![]});return db[_0xd4b0('0x70')][_0xd4b0('0x43')]({'where':{'name':_0xd4b0('0x21'),'userProfileId':_0x4ec7d3[_0xd4b0('0x6d')]},'raw':!![]})[_0xd4b0('0x1f')](function(_0xc936f9){if(_0xc936f9&&_0xc936f9[_0xd4b0('0x71')]===0x0){return db[_0xd4b0('0x22')][_0xd4b0('0x50')]({'name':_0x41fb91[_0xd4b0('0x25')],'resourceId':_0x41fb91['id'],'type':_0xc936f9[_0xd4b0('0x25')],'sectionId':_0xc936f9['id']},{})[_0xd4b0('0x1f')](function(){return _0x15064d;});}else{return _0x15064d;}})['catch'](function(_0x2a8777){logger[_0xd4b0('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a8777);throw _0x2a8777;});}return _0x15064d;})[_0xd4b0('0x1f')](respondWithResult(_0x122bf7,null))[_0xd4b0('0x40')](handleError(_0x122bf7,null));});_0x26915e['start']();}catch(_0x4f6d96){_0x122bf7[_0xd4b0('0x13')](0x1f4)[_0xd4b0('0x26')](_0x4f6d96);}};exports[_0xd4b0('0x1d')]=function(_0x273a7b,_0x52ab5d,_0x305fe4){return db[_0xd4b0('0x29')][_0xd4b0('0x43')]({'where':{'id':_0x273a7b[_0xd4b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x52ab5d,null))[_0xd4b0('0x1f')](saveUpdates(_['pick'](_0x273a7b[_0xd4b0('0x6c')],[_0xd4b0('0x25'),'description']),null))['then'](respondWithResult(_0x52ab5d,null))[_0xd4b0('0x40')](handleError(_0x52ab5d,null));};exports['delete']=function(_0x1f4bda,_0x2fc9f8,_0x51c7f7){return db[_0xd4b0('0x29')][_0xd4b0('0x43')]({'where':{'id':_0x1f4bda[_0xd4b0('0x45')]['id']}})[_0xd4b0('0x1f')](function(_0x1216bd){if(_0x1216bd){return _0x1216bd[_0xd4b0('0x1e')]();}})[_0xd4b0('0x1f')](function(_0x9df8ed){var _0x700a1c=path[_0xd4b0('0x48')](config[_0xd4b0('0x4d')],'server/files/sounds/original',util[_0xd4b0('0x4e')](_0xd4b0('0x4f'),_0x9df8ed['save_name'],_0x9df8ed[_0xd4b0('0x72')]));var _0x36ddf0=path[_0xd4b0('0x48')](config[_0xd4b0('0x4d')],_0xd4b0('0x49'),util[_0xd4b0('0x4e')](_0xd4b0('0x4f'),_0x9df8ed[_0xd4b0('0x46')],_0x9df8ed[_0xd4b0('0x47')]));fs[_0xd4b0('0x5e')](_0x700a1c);fs[_0xd4b0('0x5e')](_0x36ddf0);return _0x9df8ed;})['then'](function(_0x4ff68c){if(_0x4ff68c){return _0x2fc9f8['status'](0xcc)[_0xd4b0('0x14')]();}})['then'](handleEntityNotFound(_0x2fc9f8,null))[_0xd4b0('0x40')](handleError(_0x2fc9f8,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 0a5532f..ae365a1 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 _0x379d=['./sound.attributes','define','Sound','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3a0127,_0x2939cd){var _0xcf5dcb=function(_0x4e64cf){while(--_0x4e64cf){_0x3a0127['push'](_0x3a0127['shift']());}};_0xcf5dcb(++_0x2939cd);}(_0x379d,0x1a7));var _0xd379=function(_0x1b64a2,_0x4d7ff9){_0x1b64a2=_0x1b64a2-0x0;var _0xfb8fa=_0x379d[_0x1b64a2];return _0xfb8fa;};'use strict';var _=require(_0xd379('0x0'));var util=require(_0xd379('0x1'));var logger=require(_0xd379('0x2'))(_0xd379('0x3'));var moment=require('moment');var BPromise=require(_0xd379('0x4'));var rp=require(_0xd379('0x5'));var fs=require('fs');var path=require(_0xd379('0x6'));var rimraf=require(_0xd379('0x7'));var config=require(_0xd379('0x8'));var attributes=require(_0xd379('0x9'));module['exports']=function(_0x1e2278,_0x19bf7b){return _0x1e2278[_0xd379('0xa')](_0xd379('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d19=['exports','define','tools_sounds','util','api','moment','bluebird','request-promise','../../config/environment','./sound.attributes'];(function(_0xcac40e,_0x1da5b1){var _0xb86296=function(_0x26c6b5){while(--_0x26c6b5){_0xcac40e['push'](_0xcac40e['shift']());}};_0xb86296(++_0x1da5b1);}(_0x4d19,0x71));var _0x94d1=function(_0x3f51b9,_0x5776cf){_0x3f51b9=_0x3f51b9-0x0;var _0x319b57=_0x4d19[_0x3f51b9];return _0x319b57;};'use strict';var _=require('lodash');var util=require(_0x94d1('0x0'));var logger=require('../../config/logger')(_0x94d1('0x1'));var moment=require(_0x94d1('0x2'));var BPromise=require(_0x94d1('0x3'));var rp=require(_0x94d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x94d1('0x5'));var attributes=require(_0x94d1('0x6'));module[_0x94d1('0x7')]=function(_0x237f72,_0x305ab7){return _0x237f72[_0x94d1('0x8')]('Sound',attributes,{'tableName':_0x94d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index c7542ca..5d621d9 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 _0x5047=['then','ShowSound','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','Sound','find','options','where','include','model','attributes','map'];(function(_0x4f3d60,_0x109348){var _0x5da51b=function(_0x532832){while(--_0x532832){_0x4f3d60['push'](_0x4f3d60['shift']());}};_0x5da51b(++_0x109348);}(_0x5047,0x1ef));var _0x7504=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0x5047[_0x348652];return _0x18a9ea;};'use strict';var _=require('lodash');var util=require(_0x7504('0x0'));var moment=require(_0x7504('0x1'));var BPromise=require(_0x7504('0x2'));var rs=require(_0x7504('0x3'));var fs=require('fs');var Redis=require(_0x7504('0x4'));var db=require(_0x7504('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7504('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7504('0x7'));var client=jayson['client'][_0x7504('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b051f,_0xed7ce4,_0x4184d1){return new BPromise(function(_0x394056,_0x1b0a62){return client[_0x7504('0x9')](_0x4b051f,_0x4184d1)['then'](function(_0x3fbc8e){logger[_0x7504('0xa')](_0x7504('0xb'),_0xed7ce4,'request\x20sent');logger[_0x7504('0xc')](_0x7504('0xd'),_0xed7ce4,'request\x20sent',JSON[_0x7504('0xe')](_0x3fbc8e));if(_0x3fbc8e[_0x7504('0xf')]){if(_0x3fbc8e['error']['code']===0x1f4){logger[_0x7504('0xf')](_0x7504('0xb'),_0xed7ce4,_0x3fbc8e[_0x7504('0xf')][_0x7504('0x10')]);return _0x1b0a62(_0x3fbc8e[_0x7504('0xf')][_0x7504('0x10')]);}logger[_0x7504('0xf')](_0x7504('0xb'),_0xed7ce4,_0x3fbc8e[_0x7504('0xf')][_0x7504('0x10')]);return _0x394056(_0x3fbc8e[_0x7504('0xf')][_0x7504('0x10')]);}else{logger[_0x7504('0xa')]('Sound,\x20%s,\x20%s',_0xed7ce4,_0x7504('0x11'));_0x394056(_0x3fbc8e[_0x7504('0x12')][_0x7504('0x10')]);}})['catch'](function(_0x3f912a){logger['error'](_0x7504('0xb'),_0xed7ce4,_0x3f912a);_0x1b0a62(_0x3f912a);});});}exports['ShowSound']=function(_0x5ed6a5){var _0x2f120b=this;return new Promise(function(_0x98e148,_0x16b798){return db[_0x7504('0x13')][_0x7504('0x14')]({'raw':_0x5ed6a5['options']?_0x5ed6a5[_0x7504('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5ed6a5[_0x7504('0x15')]?_0x5ed6a5[_0x7504('0x15')][_0x7504('0x16')]||null:null,'attributes':_0x5ed6a5[_0x7504('0x15')]?_0x5ed6a5[_0x7504('0x15')]['attributes']||null:null,'include':_0x5ed6a5['options']?_0x5ed6a5[_0x7504('0x15')][_0x7504('0x17')]?_['map'](_0x5ed6a5[_0x7504('0x15')][_0x7504('0x17')],function(_0x56c415){return{'model':db[_0x56c415[_0x7504('0x18')]],'as':_0x56c415['as'],'attributes':_0x56c415['attributes'],'include':_0x56c415[_0x7504('0x17')]?_['map'](_0x56c415[_0x7504('0x17')],function(_0x432409){return{'model':db[_0x432409[_0x7504('0x18')]],'as':_0x432409['as'],'attributes':_0x432409[_0x7504('0x19')],'include':_0x432409[_0x7504('0x17')]?_[_0x7504('0x1a')](_0x432409['include'],function(_0x526cc9){return{'model':db[_0x526cc9[_0x7504('0x18')]],'as':_0x526cc9['as'],'attributes':_0x526cc9[_0x7504('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7504('0x1b')](function(_0x4c8029){logger[_0x7504('0xa')]('ShowSound',_0x5ed6a5);logger[_0x7504('0xc')](_0x7504('0x1c'),_0x5ed6a5,JSON[_0x7504('0xe')](_0x4c8029));_0x98e148(_0x4c8029);})['catch'](function(_0x11346d){logger[_0x7504('0xf')](_0x7504('0x1c'),_0x11346d[_0x7504('0x10')],_0x5ed6a5);_0x16b798(_0x2f120b[_0x7504('0xf')](0x1f4,_0x11346d[_0x7504('0x10')]));});});}; \ No newline at end of file +var _0xd0f8=['result','catch','ShowSound','find','options','raw','where','include','map','model','attributes','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xd0f8,0x137));var _0x8d0f=function(_0x1a0442,_0x190007){_0x1a0442=_0x1a0442-0x0;var _0x34d034=_0xd0f8[_0x1a0442];return _0x34d034;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8d0f('0x0'));var BPromise=require('bluebird');var rs=require(_0x8d0f('0x1'));var fs=require('fs');var Redis=require(_0x8d0f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d0f('0x3'));var logger=require(_0x8d0f('0x4'))(_0x8d0f('0x5'));var config=require('../../config/environment');var jayson=require(_0x8d0f('0x6'));var client=jayson[_0x8d0f('0x7')][_0x8d0f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36ce6e,_0x4fd69f,_0x714e48){return new BPromise(function(_0x63b8ff,_0x31a288){return client[_0x8d0f('0x9')](_0x36ce6e,_0x714e48)[_0x8d0f('0xa')](function(_0x2354ae){logger[_0x8d0f('0xb')]('Sound,\x20%s,\x20%s',_0x4fd69f,'request\x20sent');logger[_0x8d0f('0xc')]('Sound,\x20%s,\x20%s,\x20%s',_0x4fd69f,_0x8d0f('0xd'),JSON[_0x8d0f('0xe')](_0x2354ae));if(_0x2354ae[_0x8d0f('0xf')]){if(_0x2354ae[_0x8d0f('0xf')][_0x8d0f('0x10')]===0x1f4){logger[_0x8d0f('0xf')](_0x8d0f('0x11'),_0x4fd69f,_0x2354ae[_0x8d0f('0xf')][_0x8d0f('0x12')]);return _0x31a288(_0x2354ae[_0x8d0f('0xf')][_0x8d0f('0x12')]);}logger[_0x8d0f('0xf')](_0x8d0f('0x11'),_0x4fd69f,_0x2354ae[_0x8d0f('0xf')][_0x8d0f('0x12')]);return _0x63b8ff(_0x2354ae[_0x8d0f('0xf')]['message']);}else{logger[_0x8d0f('0xb')](_0x8d0f('0x11'),_0x4fd69f,'request\x20sent');_0x63b8ff(_0x2354ae[_0x8d0f('0x13')][_0x8d0f('0x12')]);}})[_0x8d0f('0x14')](function(_0x10aa16){logger[_0x8d0f('0xf')](_0x8d0f('0x11'),_0x4fd69f,_0x10aa16);_0x31a288(_0x10aa16);});});}exports[_0x8d0f('0x15')]=function(_0x9d489b){var _0x72a37d=this;return new Promise(function(_0x322b49,_0x3090ba){return db['Sound'][_0x8d0f('0x16')]({'raw':_0x9d489b[_0x8d0f('0x17')]?_0x9d489b['options'][_0x8d0f('0x18')]===undefined?!![]:![]:!![],'where':_0x9d489b['options']?_0x9d489b['options'][_0x8d0f('0x19')]||null:null,'attributes':_0x9d489b[_0x8d0f('0x17')]?_0x9d489b[_0x8d0f('0x17')]['attributes']||null:null,'include':_0x9d489b[_0x8d0f('0x17')]?_0x9d489b[_0x8d0f('0x17')][_0x8d0f('0x1a')]?_[_0x8d0f('0x1b')](_0x9d489b['options'][_0x8d0f('0x1a')],function(_0x462f3f){return{'model':db[_0x462f3f[_0x8d0f('0x1c')]],'as':_0x462f3f['as'],'attributes':_0x462f3f['attributes'],'include':_0x462f3f['include']?_['map'](_0x462f3f[_0x8d0f('0x1a')],function(_0x1a6447){return{'model':db[_0x1a6447[_0x8d0f('0x1c')]],'as':_0x1a6447['as'],'attributes':_0x1a6447['attributes'],'include':_0x1a6447[_0x8d0f('0x1a')]?_[_0x8d0f('0x1b')](_0x1a6447['include'],function(_0x4959e5){return{'model':db[_0x4959e5['model']],'as':_0x4959e5['as'],'attributes':_0x4959e5[_0x8d0f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8d0f('0xa')](function(_0x5282c5){logger['info'](_0x8d0f('0x15'),_0x9d489b);logger[_0x8d0f('0xc')]('ShowSound',_0x9d489b,JSON[_0x8d0f('0xe')](_0x5282c5));_0x322b49(_0x5282c5);})['catch'](function(_0x2e7300){logger['error'](_0x8d0f('0x15'),_0x2e7300[_0x8d0f('0x12')],_0x9d489b);_0x3090ba(_0x72a37d[_0x8d0f('0xf')](0x1f4,_0x2e7300[_0x8d0f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 409032a..6427701 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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x2032,0xd9));var _0x2203=function(_0x157708,_0x2f338d){_0x157708=_0x157708-0x0;var _0x1ef05c=_0x2032[_0x157708];return _0x1ef05c;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0xa5e821,_0x4dd2f6){var _0x62d0cd=function(_0x119f86){while(--_0x119f86){_0xa5e821['push'](_0xa5e821['shift']());}};_0x62d0cd(++_0x4dd2f6);}(_0x4fc2,0x111));var _0x24fc=function(_0x4c15e7,_0x4ad7f5){_0x4c15e7=_0x4c15e7-0x0;var _0x1f119a=_0x4fc2[_0x4c15e7];return _0x1f119a;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('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 e5e517e..0597c6d 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 _0x228b=['STRING','TEXT','medium','ENUM','sequelize','exports'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x228b,0x70));var _0xb228=function(_0x4d2586,_0x4b5efa){_0x4d2586=_0x4d2586-0x0;var _0x914228=_0x228b[_0x4d2586];return _0x914228;};'use strict';var Sequelize=require(_0xb228('0x0'));module[_0xb228('0x1')]={'uniqueid':{'type':Sequelize[_0xb228('0x2')]},'body':{'type':Sequelize[_0xb228('0x3')](_0xb228('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xb228('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb228('0x3')]}}; \ No newline at end of file +var _0x43c1=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x1158e1,_0x5f2381){var _0x1d6b82=function(_0x99dc3a){while(--_0x99dc3a){_0x1158e1['push'](_0x1158e1['shift']());}};_0x1d6b82(++_0x5f2381);}(_0x43c1,0x1ac));var _0x143c=function(_0x5c057f,_0x2a656f){_0x5c057f=_0x5c057f-0x0;var _0xaa0f9b=_0x43c1[_0x5c057f];return _0xaa0f9b;};'use strict';var Sequelize=require(_0x143c('0x0'));module[_0x143c('0x1')]={'uniqueid':{'type':Sequelize[_0x143c('0x2')]},'body':{'type':Sequelize[_0x143c('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x143c('0x4')]('in',_0x143c('0x5')),'defaultValue':_0x143c('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x143c('0x2')]},'providerResponse':{'type':Sequelize[_0x143c('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 094f9bb..9fe2d1b 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 _0x21dc=['index','map','SquareMessage','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','name'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x21dc,0x151));var _0xc21d=function(_0x14633e,_0x4be6ec){_0x14633e=_0x14633e-0x0;var _0x5eb60b=_0x21dc[_0x14633e];return _0x5eb60b;};'use strict';var emlformat=require(_0xc21d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc21d('0x1'));var jsonpatch=require(_0xc21d('0x2'));var rp=require(_0xc21d('0x3'));var moment=require(_0xc21d('0x4'));var BPromise=require(_0xc21d('0x5'));var Mustache=require('mustache');var util=require(_0xc21d('0x6'));var path=require('path');var sox=require(_0xc21d('0x7'));var csv=require('to-csv');var ejs=require(_0xc21d('0x8'));var fs=require('fs');var fs_extra=require(_0xc21d('0x9'));var _=require(_0xc21d('0xa'));var squel=require(_0xc21d('0xb'));var crypto=require(_0xc21d('0xc'));var jsforce=require(_0xc21d('0xd'));var deskjs=require(_0xc21d('0xe'));var toCsv=require(_0xc21d('0xf'));var querystring=require(_0xc21d('0x10'));var Papa=require(_0xc21d('0x11'));var Redis=require('ioredis');var authService=require(_0xc21d('0x12'));var qs=require(_0xc21d('0x13'));var as=require(_0xc21d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc21d('0x15'))(_0xc21d('0x16'));var utils=require(_0xc21d('0x17'));var config=require(_0xc21d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc21d('0x19'))['db'];function respondWithStatusCode(_0x5d9b0f,_0x50b94f){_0x50b94f=_0x50b94f||0xcc;return function(_0x2ce1e4){if(_0x2ce1e4){return _0x5d9b0f[_0xc21d('0x1a')](_0x50b94f);}return _0x5d9b0f[_0xc21d('0x1b')](_0x50b94f)['end']();};}function respondWithResult(_0xe35a59,_0x10d4de){_0x10d4de=_0x10d4de||0xc8;return function(_0x2188e9){if(_0x2188e9){return _0xe35a59[_0xc21d('0x1b')](_0x10d4de)[_0xc21d('0x1c')](_0x2188e9);}};}function respondWithFilteredResult(_0x40baa6,_0x5d5e19){return function(_0x3dfd11){if(_0x3dfd11){var _0x32826b=typeof _0x5d5e19[_0xc21d('0x1d')]==='undefined'&&typeof _0x5d5e19[_0xc21d('0x1e')]===_0xc21d('0x1f');var _0x5a8680=_0x3dfd11[_0xc21d('0x20')];var _0x5f509f=_0x32826b?0x0:_0x5d5e19[_0xc21d('0x1d')];var _0x30bc86=_0x32826b?_0x3dfd11[_0xc21d('0x20')]:_0x5d5e19['offset']+_0x5d5e19[_0xc21d('0x1e')];var _0x3d2ca1;if(_0x30bc86>=_0x5a8680){_0x30bc86=_0x5a8680;_0x3d2ca1=0xc8;}else{_0x3d2ca1=0xce;}_0x40baa6[_0xc21d('0x1b')](_0x3d2ca1);return _0x40baa6[_0xc21d('0x21')](_0xc21d('0x22'),_0x5f509f+'-'+_0x30bc86+'/'+_0x5a8680)[_0xc21d('0x1c')](_0x3dfd11);}return null;};}function patchUpdates(_0x4c022a){return function(_0x4789a1){try{jsonpatch[_0xc21d('0x23')](_0x4789a1,_0x4c022a,!![]);}catch(_0x3ec73b){return BPromise[_0xc21d('0x24')](_0x3ec73b);}return _0x4789a1['save']();};}function saveUpdates(_0x2a33e7,_0x2948d5){return function(_0x5b7849){if(_0x5b7849){return _0x5b7849[_0xc21d('0x25')](_0x2a33e7)[_0xc21d('0x26')](function(_0xfe0340){return _0xfe0340;});}return null;};}function removeEntity(_0x3492e5,_0x4b14bf){return function(_0x2cf588){if(_0x2cf588){return _0x2cf588[_0xc21d('0x27')]()[_0xc21d('0x26')](function(){_0x3492e5[_0xc21d('0x1b')](0xcc)[_0xc21d('0x28')]();});}};}function handleEntityNotFound(_0x214169,_0x274811){return function(_0x1e40aa){if(!_0x1e40aa){_0x214169[_0xc21d('0x1a')](0x194);}return _0x1e40aa;};}function handleError(_0x1b6e7a,_0x1c898a){_0x1c898a=_0x1c898a||0x1f4;return function(_0x363a6a){logger[_0xc21d('0x29')](_0x363a6a['stack']);if(_0x363a6a['name']){delete _0x363a6a[_0xc21d('0x2a')];}_0x1b6e7a[_0xc21d('0x1b')](_0x1c898a)['send'](_0x363a6a);};}exports[_0xc21d('0x2b')]=function(_0x11e20b,_0x271647){var _0x2cc7fd={},_0x492456={},_0x503f54={'count':0x0,'rows':[]};var _0x21c235=_[_0xc21d('0x2c')](db[_0xc21d('0x2d')][_0xc21d('0x2e')],function(_0x443b1d){return{'name':_0x443b1d['fieldName'],'type':_0x443b1d[_0xc21d('0x2f')][_0xc21d('0x30')]};});_0x492456[_0xc21d('0x31')]=_[_0xc21d('0x2c')](_0x21c235,_0xc21d('0x2a'));_0x492456['query']=_[_0xc21d('0x32')](_0x11e20b[_0xc21d('0x33')]);_0x492456['filters']=_['intersection'](_0x492456[_0xc21d('0x31')],_0x492456[_0xc21d('0x33')]);_0x2cc7fd[_0xc21d('0x34')]=_[_0xc21d('0x35')](_0x492456[_0xc21d('0x31')],qs[_0xc21d('0x36')](_0x11e20b[_0xc21d('0x33')][_0xc21d('0x36')]));_0x2cc7fd[_0xc21d('0x34')]=_0x2cc7fd['attributes'][_0xc21d('0x37')]?_0x2cc7fd[_0xc21d('0x34')]:_0x492456['model'];if(!_0x11e20b[_0xc21d('0x33')]['hasOwnProperty'](_0xc21d('0x38'))){_0x2cc7fd[_0xc21d('0x1e')]=qs[_0xc21d('0x1e')](_0x11e20b[_0xc21d('0x33')]['limit']);_0x2cc7fd[_0xc21d('0x1d')]=qs[_0xc21d('0x1d')](_0x11e20b['query'][_0xc21d('0x1d')]);}_0x2cc7fd[_0xc21d('0x39')]=qs[_0xc21d('0x3a')](_0x11e20b['query'][_0xc21d('0x3a')]);_0x2cc7fd[_0xc21d('0x3b')]=qs[_0xc21d('0x3c')](_[_0xc21d('0x3d')](_0x11e20b[_0xc21d('0x33')],_0x492456[_0xc21d('0x3c')]),_0x21c235);if(_0x11e20b[_0xc21d('0x33')][_0xc21d('0x3e')]){_0x2cc7fd[_0xc21d('0x3b')]=_[_0xc21d('0x3f')](_0x2cc7fd[_0xc21d('0x3b')],{'$or':_[_0xc21d('0x2c')](_0x21c235,function(_0x249750){if(_0x249750['type']!==_0xc21d('0x40')){var _0x3c0769={};_0x3c0769[_0x249750[_0xc21d('0x2a')]]={'$like':'%'+_0x11e20b[_0xc21d('0x33')][_0xc21d('0x3e')]+'%'};return _0x3c0769;}})});}_0x2cc7fd=_[_0xc21d('0x3f')]({},_0x2cc7fd,_0x11e20b['options']);var _0x4079c5={'where':_0x2cc7fd[_0xc21d('0x3b')]};return db[_0xc21d('0x2d')][_0xc21d('0x20')](_0x4079c5)['then'](function(_0x229d0f){_0x503f54[_0xc21d('0x20')]=_0x229d0f;if(_0x11e20b['query'][_0xc21d('0x41')]){_0x2cc7fd[_0xc21d('0x42')]=[{'all':!![]}];}return db[_0xc21d('0x2d')][_0xc21d('0x43')](_0x2cc7fd);})['then'](function(_0x21eed7){_0x503f54[_0xc21d('0x44')]=_0x21eed7;return _0x503f54;})[_0xc21d('0x26')](respondWithFilteredResult(_0x271647,_0x2cc7fd))[_0xc21d('0x45')](handleError(_0x271647,null));};exports[_0xc21d('0x46')]=function(_0x18dc1f,_0x119d27){var _0xeddbf6={'raw':!![],'where':{'id':_0x18dc1f[_0xc21d('0x47')]['id']}},_0x1ac1f4={};_0x1ac1f4['model']=_[_0xc21d('0x32')](db[_0xc21d('0x2d')][_0xc21d('0x2e')]);_0x1ac1f4[_0xc21d('0x33')]=_['keys'](_0x18dc1f['query']);_0x1ac1f4[_0xc21d('0x3c')]=_['intersection'](_0x1ac1f4[_0xc21d('0x31')],_0x1ac1f4[_0xc21d('0x33')]);_0xeddbf6['attributes']=_[_0xc21d('0x35')](_0x1ac1f4['model'],qs[_0xc21d('0x36')](_0x18dc1f[_0xc21d('0x33')][_0xc21d('0x36')]));_0xeddbf6['attributes']=_0xeddbf6[_0xc21d('0x34')][_0xc21d('0x37')]?_0xeddbf6[_0xc21d('0x34')]:_0x1ac1f4['model'];if(_0x18dc1f[_0xc21d('0x33')]['includeAll']){_0xeddbf6[_0xc21d('0x42')]=[{'all':!![]}];}_0xeddbf6=_['merge']({},_0xeddbf6,_0x18dc1f[_0xc21d('0x48')]);return db['SquareMessage'][_0xc21d('0x49')](_0xeddbf6)[_0xc21d('0x26')](handleEntityNotFound(_0x119d27,null))['then'](respondWithResult(_0x119d27,null))[_0xc21d('0x45')](handleError(_0x119d27,null));};exports[_0xc21d('0x4a')]=function(_0x47627c,_0x4c6978){return db[_0xc21d('0x2d')][_0xc21d('0x4a')](_0x47627c[_0xc21d('0x4b')],{})[_0xc21d('0x26')](respondWithResult(_0x4c6978,0xc9))[_0xc21d('0x45')](handleError(_0x4c6978,null));};exports[_0xc21d('0x25')]=function(_0x401748,_0x275264){if(_0x401748[_0xc21d('0x4b')]['id']){delete _0x401748[_0xc21d('0x4b')]['id'];}return db[_0xc21d('0x2d')][_0xc21d('0x49')]({'where':{'id':_0x401748[_0xc21d('0x47')]['id']}})[_0xc21d('0x26')](handleEntityNotFound(_0x275264,null))[_0xc21d('0x26')](saveUpdates(_0x401748[_0xc21d('0x4b')],null))[_0xc21d('0x26')](respondWithResult(_0x275264,null))[_0xc21d('0x45')](handleError(_0x275264,null));};exports[_0xc21d('0x27')]=function(_0x3fdf18,_0x2a4ce1){return db[_0xc21d('0x2d')][_0xc21d('0x49')]({'where':{'id':_0x3fdf18[_0xc21d('0x47')]['id']}})[_0xc21d('0x26')](handleEntityNotFound(_0x2a4ce1,null))['then'](removeEntity(_0x2a4ce1,null))[_0xc21d('0x45')](handleError(_0x2a4ce1,null));}; \ No newline at end of file +var _0xe195=['keys','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0xe195,0x1c6));var _0x5e19=function(_0x18065f,_0x7b00f3){_0x18065f=_0x18065f-0x0;var _0x3fbe5a=_0xe195[_0x18065f];return _0x3fbe5a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e19('0x0'));var jsonpatch=require(_0x5e19('0x1'));var rp=require(_0x5e19('0x2'));var moment=require(_0x5e19('0x3'));var BPromise=require(_0x5e19('0x4'));var Mustache=require('mustache');var util=require(_0x5e19('0x5'));var path=require(_0x5e19('0x6'));var sox=require(_0x5e19('0x7'));var csv=require(_0x5e19('0x8'));var ejs=require(_0x5e19('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e19('0xa'));var squel=require('squel');var crypto=require(_0x5e19('0xb'));var jsforce=require(_0x5e19('0xc'));var deskjs=require(_0x5e19('0xd'));var toCsv=require(_0x5e19('0x8'));var querystring=require('querystring');var Papa=require(_0x5e19('0xe'));var Redis=require('ioredis');var authService=require(_0x5e19('0xf'));var qs=require(_0x5e19('0x10'));var as=require(_0x5e19('0x11'));var hardwareService=require(_0x5e19('0x12'));var logger=require(_0x5e19('0x13'))(_0x5e19('0x14'));var utils=require(_0x5e19('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5e19('0x16'));var db=require(_0x5e19('0x17'))['db'];function respondWithStatusCode(_0x17effe,_0x1ac98e){_0x1ac98e=_0x1ac98e||0xcc;return function(_0x316098){if(_0x316098){return _0x17effe['sendStatus'](_0x1ac98e);}return _0x17effe[_0x5e19('0x18')](_0x1ac98e)[_0x5e19('0x19')]();};}function respondWithResult(_0x58d5f9,_0x228bd9){_0x228bd9=_0x228bd9||0xc8;return function(_0x2843af){if(_0x2843af){return _0x58d5f9[_0x5e19('0x18')](_0x228bd9)['json'](_0x2843af);}};}function respondWithFilteredResult(_0x561892,_0x7d1472){return function(_0x520e0c){if(_0x520e0c){var _0x1bb9b=typeof _0x7d1472[_0x5e19('0x1a')]===_0x5e19('0x1b')&&typeof _0x7d1472['limit']==='undefined';var _0x51537a=_0x520e0c['count'];var _0x1feaa0=_0x1bb9b?0x0:_0x7d1472[_0x5e19('0x1a')];var _0x5982d0=_0x1bb9b?_0x520e0c[_0x5e19('0x1c')]:_0x7d1472[_0x5e19('0x1a')]+_0x7d1472[_0x5e19('0x1d')];var _0x3b1427;if(_0x5982d0>=_0x51537a){_0x5982d0=_0x51537a;_0x3b1427=0xc8;}else{_0x3b1427=0xce;}_0x561892[_0x5e19('0x18')](_0x3b1427);return _0x561892[_0x5e19('0x1e')](_0x5e19('0x1f'),_0x1feaa0+'-'+_0x5982d0+'/'+_0x51537a)[_0x5e19('0x20')](_0x520e0c);}return null;};}function patchUpdates(_0x5a80dc){return function(_0x982207){try{jsonpatch[_0x5e19('0x21')](_0x982207,_0x5a80dc,!![]);}catch(_0x53ddbb){return BPromise[_0x5e19('0x22')](_0x53ddbb);}return _0x982207[_0x5e19('0x23')]();};}function saveUpdates(_0x304fc5,_0xb65de){return function(_0x3f23ca){if(_0x3f23ca){return _0x3f23ca[_0x5e19('0x24')](_0x304fc5)[_0x5e19('0x25')](function(_0x641cb0){return _0x641cb0;});}return null;};}function removeEntity(_0x562514,_0x1f57bf){return function(_0x21279d){if(_0x21279d){return _0x21279d[_0x5e19('0x26')]()[_0x5e19('0x25')](function(){_0x562514[_0x5e19('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f4ea0,_0x3561a1){return function(_0x969467){if(!_0x969467){_0x6f4ea0[_0x5e19('0x27')](0x194);}return _0x969467;};}function handleError(_0x4210d2,_0x28cd99){_0x28cd99=_0x28cd99||0x1f4;return function(_0x425abb){logger[_0x5e19('0x28')](_0x425abb[_0x5e19('0x29')]);if(_0x425abb[_0x5e19('0x2a')]){delete _0x425abb[_0x5e19('0x2a')];}_0x4210d2[_0x5e19('0x18')](_0x28cd99)[_0x5e19('0x2b')](_0x425abb);};}exports[_0x5e19('0x2c')]=function(_0x5e883b,_0x44709f){var _0x4ca02d={},_0x49b50d={},_0x24d31f={'count':0x0,'rows':[]};var _0x2166e4=_[_0x5e19('0x2d')](db[_0x5e19('0x2e')][_0x5e19('0x2f')],function(_0x2bffd5){return{'name':_0x2bffd5[_0x5e19('0x30')],'type':_0x2bffd5['type'][_0x5e19('0x31')]};});_0x49b50d[_0x5e19('0x32')]=_['map'](_0x2166e4,_0x5e19('0x2a'));_0x49b50d['query']=_['keys'](_0x5e883b['query']);_0x49b50d[_0x5e19('0x33')]=_[_0x5e19('0x34')](_0x49b50d['model'],_0x49b50d['query']);_0x4ca02d[_0x5e19('0x35')]=_[_0x5e19('0x34')](_0x49b50d[_0x5e19('0x32')],qs[_0x5e19('0x36')](_0x5e883b[_0x5e19('0x37')][_0x5e19('0x36')]));_0x4ca02d[_0x5e19('0x35')]=_0x4ca02d[_0x5e19('0x35')][_0x5e19('0x38')]?_0x4ca02d[_0x5e19('0x35')]:_0x49b50d['model'];if(!_0x5e883b['query'][_0x5e19('0x39')]('nolimit')){_0x4ca02d[_0x5e19('0x1d')]=qs[_0x5e19('0x1d')](_0x5e883b[_0x5e19('0x37')][_0x5e19('0x1d')]);_0x4ca02d[_0x5e19('0x1a')]=qs[_0x5e19('0x1a')](_0x5e883b[_0x5e19('0x37')][_0x5e19('0x1a')]);}_0x4ca02d[_0x5e19('0x3a')]=qs['sort'](_0x5e883b[_0x5e19('0x37')][_0x5e19('0x3b')]);_0x4ca02d[_0x5e19('0x3c')]=qs[_0x5e19('0x33')](_[_0x5e19('0x3d')](_0x5e883b[_0x5e19('0x37')],_0x49b50d['filters']),_0x2166e4);if(_0x5e883b['query'][_0x5e19('0x3e')]){_0x4ca02d['where']=_[_0x5e19('0x3f')](_0x4ca02d[_0x5e19('0x3c')],{'$or':_[_0x5e19('0x2d')](_0x2166e4,function(_0x25ab0f){if(_0x25ab0f[_0x5e19('0x40')]!==_0x5e19('0x41')){var _0x65e73a={};_0x65e73a[_0x25ab0f[_0x5e19('0x2a')]]={'$like':'%'+_0x5e883b['query'][_0x5e19('0x3e')]+'%'};return _0x65e73a;}})});}_0x4ca02d=_['merge']({},_0x4ca02d,_0x5e883b['options']);var _0x10a38b={'where':_0x4ca02d[_0x5e19('0x3c')]};return db[_0x5e19('0x2e')][_0x5e19('0x1c')](_0x10a38b)[_0x5e19('0x25')](function(_0xb920ff){_0x24d31f[_0x5e19('0x1c')]=_0xb920ff;if(_0x5e883b[_0x5e19('0x37')][_0x5e19('0x42')]){_0x4ca02d['include']=[{'all':!![]}];}return db[_0x5e19('0x2e')][_0x5e19('0x43')](_0x4ca02d);})[_0x5e19('0x25')](function(_0x3ed6f3){_0x24d31f[_0x5e19('0x44')]=_0x3ed6f3;return _0x24d31f;})[_0x5e19('0x25')](respondWithFilteredResult(_0x44709f,_0x4ca02d))['catch'](handleError(_0x44709f,null));};exports[_0x5e19('0x45')]=function(_0x28db52,_0x1b5a69){var _0x378f2e={'raw':!![],'where':{'id':_0x28db52[_0x5e19('0x46')]['id']}},_0x207171={};_0x207171[_0x5e19('0x32')]=_[_0x5e19('0x47')](db['SquareMessage'][_0x5e19('0x2f')]);_0x207171[_0x5e19('0x37')]=_['keys'](_0x28db52[_0x5e19('0x37')]);_0x207171[_0x5e19('0x33')]=_[_0x5e19('0x34')](_0x207171['model'],_0x207171[_0x5e19('0x37')]);_0x378f2e[_0x5e19('0x35')]=_[_0x5e19('0x34')](_0x207171[_0x5e19('0x32')],qs[_0x5e19('0x36')](_0x28db52[_0x5e19('0x37')][_0x5e19('0x36')]));_0x378f2e[_0x5e19('0x35')]=_0x378f2e[_0x5e19('0x35')][_0x5e19('0x38')]?_0x378f2e[_0x5e19('0x35')]:_0x207171['model'];if(_0x28db52[_0x5e19('0x37')][_0x5e19('0x42')]){_0x378f2e['include']=[{'all':!![]}];}_0x378f2e=_[_0x5e19('0x3f')]({},_0x378f2e,_0x28db52['options']);return db[_0x5e19('0x2e')][_0x5e19('0x48')](_0x378f2e)['then'](handleEntityNotFound(_0x1b5a69,null))[_0x5e19('0x25')](respondWithResult(_0x1b5a69,null))['catch'](handleError(_0x1b5a69,null));};exports[_0x5e19('0x49')]=function(_0x4f00cd,_0x29274f){return db[_0x5e19('0x2e')][_0x5e19('0x49')](_0x4f00cd[_0x5e19('0x4a')],{})[_0x5e19('0x25')](respondWithResult(_0x29274f,0xc9))['catch'](handleError(_0x29274f,null));};exports['update']=function(_0x272f59,_0x269cd6){if(_0x272f59[_0x5e19('0x4a')]['id']){delete _0x272f59[_0x5e19('0x4a')]['id'];}return db[_0x5e19('0x2e')][_0x5e19('0x48')]({'where':{'id':_0x272f59[_0x5e19('0x46')]['id']}})[_0x5e19('0x25')](handleEntityNotFound(_0x269cd6,null))['then'](saveUpdates(_0x272f59[_0x5e19('0x4a')],null))['then'](respondWithResult(_0x269cd6,null))['catch'](handleError(_0x269cd6,null));};exports['destroy']=function(_0x2307a2,_0x2966ce){return db[_0x5e19('0x2e')][_0x5e19('0x48')]({'where':{'id':_0x2307a2[_0x5e19('0x46')]['id']}})[_0x5e19('0x25')](handleEntityNotFound(_0x2966ce,null))[_0x5e19('0x25')](removeEntity(_0x2966ce,null))['catch'](handleError(_0x2966ce,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index db4853c..cbe9d77 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 _0xf891=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf891,0x144));var _0x1f89=function(_0x219377,_0x5f479a){_0x219377=_0x219377-0x0;var _0x247572=_0xf891[_0x219377];return _0x247572;};'use strict';var _=require(_0x1f89('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1f89('0x1'));var moment=require('moment');var BPromise=require(_0x1f89('0x2'));var rp=require(_0x1f89('0x3'));var fs=require('fs');var path=require(_0x1f89('0x4'));var rimraf=require(_0x1f89('0x5'));var config=require(_0x1f89('0x6'));var attributes=require(_0x1f89('0x7'));module[_0x1f89('0x8')]=function(_0x50ed87,_0x5b2ecf){return _0x50ed87[_0x1f89('0x9')](_0x1f89('0xa'),attributes,{'tableName':_0x1f89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f52=['define','square_messages','util','api','moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0x7f52,0x84));var _0x27f5=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x7f52[_0x3ea913];return _0x2b4f28;};'use strict';var _=require('lodash');var util=require(_0x27f5('0x0'));var logger=require('../../config/logger')(_0x27f5('0x1'));var moment=require(_0x27f5('0x2'));var BPromise=require(_0x27f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x27f5('0x4'));var config=require(_0x27f5('0x5'));var attributes=require(_0x27f5('0x6'));module[_0x27f5('0x7')]=function(_0x47bfc8,_0x565891){return _0x47bfc8[_0x27f5('0x8')]('SquareMessage',attributes,{'tableName':_0x27f5('0x9'),'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 3310be7..3a12df9 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 _0x41ea=['client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','stringify','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xecfbbe,_0x4fdf86){var _0x240060=function(_0x2251e0){while(--_0x2251e0){_0xecfbbe['push'](_0xecfbbe['shift']());}};_0x240060(++_0x4fdf86);}(_0x41ea,0xd8));var _0xa41e=function(_0x2f150e,_0x1e31c9){_0x2f150e=_0x2f150e-0x0;var _0x18edc7=_0x41ea[_0x2f150e];return _0x18edc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa41e('0x0'));var BPromise=require(_0xa41e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa41e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa41e('0x3'));var logger=require(_0xa41e('0x4'))(_0xa41e('0x5'));var config=require(_0xa41e('0x6'));var jayson=require(_0xa41e('0x7'));var client=jayson[_0xa41e('0x8')][_0xa41e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489445,_0x211c1f,_0x18028c){return new BPromise(function(_0x13216c,_0x589a57){return client[_0xa41e('0xa')](_0x489445,_0x18028c)['then'](function(_0x2a3868){logger['info'](_0xa41e('0xb'),_0x211c1f,_0xa41e('0xc'));logger[_0xa41e('0xd')](_0xa41e('0xe'),_0x211c1f,_0xa41e('0xc'),JSON['stringify'](_0x2a3868));if(_0x2a3868['error']){if(_0x2a3868[_0xa41e('0xf')]['code']===0x1f4){logger[_0xa41e('0xf')](_0xa41e('0xb'),_0x211c1f,_0x2a3868[_0xa41e('0xf')][_0xa41e('0x10')]);return _0x589a57(_0x2a3868['error'][_0xa41e('0x10')]);}logger[_0xa41e('0xf')](_0xa41e('0xb'),_0x211c1f,_0x2a3868['error']['message']);return _0x13216c(_0x2a3868[_0xa41e('0xf')][_0xa41e('0x10')]);}else{logger[_0xa41e('0x11')](_0xa41e('0xb'),_0x211c1f,_0xa41e('0xc'));_0x13216c(_0x2a3868[_0xa41e('0x12')][_0xa41e('0x10')]);}})[_0xa41e('0x13')](function(_0x5f31c8){logger[_0xa41e('0xf')](_0xa41e('0xb'),_0x211c1f,_0x5f31c8);_0x589a57(_0x5f31c8);});});}exports[_0xa41e('0x14')]=function(_0xfeab00){var _0x3ac922=this;return new Promise(function(_0x2eac76,_0x899163){return db[_0xa41e('0x15')][_0xa41e('0x16')](_0xfeab00[_0xa41e('0x17')],{'raw':_0xfeab00['options']?_0xfeab00[_0xa41e('0x18')][_0xa41e('0x19')]===undefined?!![]:![]:!![]})[_0xa41e('0x1a')](function(_0x1a2fdd){logger[_0xa41e('0x11')](_0xa41e('0x14'),_0xfeab00);logger['debug']('CreateSquareMessage',_0xfeab00,JSON[_0xa41e('0x1b')](_0x1a2fdd));_0x2eac76(_0x1a2fdd);})[_0xa41e('0x13')](function(_0x46b907){logger[_0xa41e('0xf')](_0xa41e('0x14'),_0x46b907['message'],_0xfeab00);_0x899163(_0x3ac922[_0xa41e('0xf')](0x1f4,_0x46b907[_0xa41e('0x10')]));});});}; \ No newline at end of file +var _0x999a=['error','message','CreateSquareMessage','SquareMessage','create','body','options','debug','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x50a1f6,_0x238fd8){var _0x84f8d4=function(_0x2d9586){while(--_0x2d9586){_0x50a1f6['push'](_0x50a1f6['shift']());}};_0x84f8d4(++_0x238fd8);}(_0x999a,0x1bd));var _0xa999=function(_0x4880ef,_0xaea8cb){_0x4880ef=_0x4880ef-0x0;var _0x1fb921=_0x999a[_0x4880ef];return _0x1fb921;};'use strict';var _=require('lodash');var util=require(_0xa999('0x0'));var moment=require(_0xa999('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa999('0x2'))['db'];var utils=require(_0xa999('0x3'));var logger=require(_0xa999('0x4'))('rpc');var config=require(_0xa999('0x5'));var jayson=require(_0xa999('0x6'));var client=jayson[_0xa999('0x7')][_0xa999('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b1925,_0x36b3b1,_0x140c90){return new BPromise(function(_0x4f2a50,_0x391cae){return client[_0xa999('0x9')](_0x1b1925,_0x140c90)[_0xa999('0xa')](function(_0x14e75e){logger['info'](_0xa999('0xb'),_0x36b3b1,_0xa999('0xc'));logger['debug'](_0xa999('0xd'),_0x36b3b1,_0xa999('0xc'),JSON[_0xa999('0xe')](_0x14e75e));if(_0x14e75e[_0xa999('0xf')]){if(_0x14e75e[_0xa999('0xf')]['code']===0x1f4){logger[_0xa999('0xf')](_0xa999('0xb'),_0x36b3b1,_0x14e75e[_0xa999('0xf')]['message']);return _0x391cae(_0x14e75e['error']['message']);}logger[_0xa999('0xf')]('SquareMessage,\x20%s,\x20%s',_0x36b3b1,_0x14e75e[_0xa999('0xf')][_0xa999('0x10')]);return _0x4f2a50(_0x14e75e[_0xa999('0xf')]['message']);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x36b3b1,'request\x20sent');_0x4f2a50(_0x14e75e['result'][_0xa999('0x10')]);}})['catch'](function(_0x5bbbbe){logger[_0xa999('0xf')](_0xa999('0xb'),_0x36b3b1,_0x5bbbbe);_0x391cae(_0x5bbbbe);});});}exports[_0xa999('0x11')]=function(_0x3633c9){var _0x3495f3=this;return new Promise(function(_0x2ae6a3,_0x4629aa){return db[_0xa999('0x12')][_0xa999('0x13')](_0x3633c9[_0xa999('0x14')],{'raw':_0x3633c9[_0xa999('0x15')]?_0x3633c9[_0xa999('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x218b5f){logger['info'](_0xa999('0x11'),_0x3633c9);logger[_0xa999('0x16')](_0xa999('0x11'),_0x3633c9,JSON[_0xa999('0xe')](_0x218b5f));_0x2ae6a3(_0x218b5f);})['catch'](function(_0x53d6a8){logger[_0xa999('0xf')](_0xa999('0x11'),_0x53d6a8[_0xa999('0x10')],_0x3633c9);_0x4629aa(_0x3495f3[_0xa999('0xf')](0x1f4,_0x53d6a8[_0xa999('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 8177e39..c980c7c 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 _0x0e7d=['post','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','/:id','show','get','test'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e7d,0x1a3));var _0xd0e7=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x0e7d[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0xd0e7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd0e7('0x1'));var express=require(_0xd0e7('0x2'));var router=express['Router']();var fs_extra=require(_0xd0e7('0x3'));var auth=require(_0xd0e7('0x4'));var interaction=require(_0xd0e7('0x5'));var config=require(_0xd0e7('0x6'));var controller=require(_0xd0e7('0x7'));router['get']('/',auth[_0xd0e7('0x8')](),controller['index']);router['get'](_0xd0e7('0x9'),auth[_0xd0e7('0x8')](),controller[_0xd0e7('0xa')]);router[_0xd0e7('0xb')]('/:id/test',auth[_0xd0e7('0x8')](),timeout('15s'),controller[_0xd0e7('0xc')]);router[_0xd0e7('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd0e7('0x9'),auth[_0xd0e7('0x8')](),controller['update']);router[_0xd0e7('0xe')](_0xd0e7('0x9'),auth['isAuthenticated'](),controller[_0xd0e7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf265=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/test','test','post','create','put','update','delete'];(function(_0xc3f4fc,_0x195c3c){var _0x230e59=function(_0x22d873){while(--_0x22d873){_0xc3f4fc['push'](_0xc3f4fc['shift']());}};_0x230e59(++_0x195c3c);}(_0xf265,0x12d));var _0x5f26=function(_0xf34bcf,_0x41d6be){_0xf34bcf=_0xf34bcf-0x0;var _0x2b733b=_0xf265[_0xf34bcf];return _0x2b733b;};'use strict';var multer=require(_0x5f26('0x0'));var util=require(_0x5f26('0x1'));var path=require(_0x5f26('0x2'));var timeout=require(_0x5f26('0x3'));var express=require('express');var router=express[_0x5f26('0x4')]();var fs_extra=require(_0x5f26('0x5'));var auth=require(_0x5f26('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f26('0x7'));var controller=require('./squareOdbc.controller');router[_0x5f26('0x8')]('/',auth[_0x5f26('0x9')](),controller[_0x5f26('0xa')]);router['get'](_0x5f26('0xb'),auth[_0x5f26('0x9')](),controller['show']);router['get'](_0x5f26('0xc'),auth[_0x5f26('0x9')](),timeout('15s'),controller[_0x5f26('0xd')]);router[_0x5f26('0xe')]('/',auth['isAuthenticated'](),controller[_0x5f26('0xf')]);router[_0x5f26('0x10')]('/:id',auth[_0x5f26('0x9')](),controller[_0x5f26('0x11')]);router[_0x5f26('0x12')](_0x5f26('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5f26('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 3d46969..03276d8 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 _0x3d17=['STRING','name','sequelize','exports'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x3d17,0x142));var _0x73d1=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x3d17[_0x403c20];return _0x2b271a;};'use strict';var Sequelize=require(_0x73d1('0x0'));module[_0x73d1('0x1')]={'name':{'type':Sequelize[_0x73d1('0x2')],'unique':_0x73d1('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x73d1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbf56=['name','sequelize','STRING'];(function(_0x4135bd,_0x163b65){var _0x37e1d0=function(_0x4dc758){while(--_0x4dc758){_0x4135bd['push'](_0x4135bd['shift']());}};_0x37e1d0(++_0x163b65);}(_0xbf56,0x1db));var _0x6bf5=function(_0x527606,_0x79c882){_0x527606=_0x527606-0x0;var _0x35cdcf=_0xbf56[_0x527606];return _0x35cdcf;};'use strict';var Sequelize=require(_0x6bf5('0x0'));module['exports']={'name':{'type':Sequelize[_0x6bf5('0x1')],'unique':_0x6bf5('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x6bf5('0x1')]},'description':{'type':Sequelize[_0x6bf5('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index a768347..b49b135 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 _0x62e6=['then','destroy','get','ODBC','end','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','params','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x62e6,0x1e6));var _0x662e=function(_0x1dcf37,_0x150062){_0x1dcf37=_0x1dcf37-0x0;var _0x4323ea=_0x62e6[_0x1dcf37];return _0x4323ea;};'use strict';var emlformat=require(_0x662e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x662e('0x1'));var jsonpatch=require(_0x662e('0x2'));var rp=require(_0x662e('0x3'));var moment=require(_0x662e('0x4'));var BPromise=require(_0x662e('0x5'));var Mustache=require(_0x662e('0x6'));var util=require(_0x662e('0x7'));var path=require(_0x662e('0x8'));var sox=require(_0x662e('0x9'));var csv=require('to-csv');var ejs=require(_0x662e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x662e('0xb'));var squel=require(_0x662e('0xc'));var crypto=require(_0x662e('0xd'));var jsforce=require(_0x662e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x662e('0xf'));var querystring=require('querystring');var Papa=require(_0x662e('0x10'));var Redis=require('ioredis');var authService=require(_0x662e('0x11'));var qs=require(_0x662e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x662e('0x13'));var logger=require('../../config/logger')(_0x662e('0x14'));var utils=require(_0x662e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x662e('0x16'));var db=require(_0x662e('0x17'))['db'];function respondWithStatusCode(_0x40f0ad,_0x4635b3){_0x4635b3=_0x4635b3||0xcc;return function(_0x17bb23){if(_0x17bb23){return _0x40f0ad[_0x662e('0x18')](_0x4635b3);}return _0x40f0ad[_0x662e('0x19')](_0x4635b3)['end']();};}function respondWithResult(_0x139363,_0x3b9265){_0x3b9265=_0x3b9265||0xc8;return function(_0x2b3516){if(_0x2b3516){return _0x139363['status'](_0x3b9265)[_0x662e('0x1a')](_0x2b3516);}};}function respondWithFilteredResult(_0xd62f9d,_0x198ee9){return function(_0xd79287){if(_0xd79287){var _0x44f056=typeof _0x198ee9[_0x662e('0x1b')]==='undefined'&&typeof _0x198ee9[_0x662e('0x1c')]===_0x662e('0x1d');var _0x58ec14=_0xd79287[_0x662e('0x1e')];var _0x454958=_0x44f056?0x0:_0x198ee9[_0x662e('0x1b')];var _0x5daab4=_0x44f056?_0xd79287[_0x662e('0x1e')]:_0x198ee9[_0x662e('0x1b')]+_0x198ee9[_0x662e('0x1c')];var _0x2e43d7;if(_0x5daab4>=_0x58ec14){_0x5daab4=_0x58ec14;_0x2e43d7=0xc8;}else{_0x2e43d7=0xce;}_0xd62f9d['status'](_0x2e43d7);return _0xd62f9d[_0x662e('0x1f')](_0x662e('0x20'),_0x454958+'-'+_0x5daab4+'/'+_0x58ec14)[_0x662e('0x1a')](_0xd79287);}return null;};}function patchUpdates(_0x3e7977){return function(_0x2e568a){try{jsonpatch[_0x662e('0x21')](_0x2e568a,_0x3e7977,!![]);}catch(_0x2ec61e){return BPromise[_0x662e('0x22')](_0x2ec61e);}return _0x2e568a['save']();};}function saveUpdates(_0x308abf,_0x48e30c){return function(_0x318e68){if(_0x318e68){return _0x318e68[_0x662e('0x23')](_0x308abf)[_0x662e('0x24')](function(_0x86540f){return _0x86540f;});}return null;};}function removeEntity(_0x21fdf1,_0x4b980d){return function(_0x4f8df3){if(_0x4f8df3){return _0x4f8df3[_0x662e('0x25')]()[_0x662e('0x24')](function(){var _0x228c8f=_0x4f8df3[_0x662e('0x26')]({'plain':!![]});var _0x580e6f=_0x662e('0x27');return db['UserProfileResource'][_0x662e('0x25')]({'where':{'type':_0x580e6f,'resourceId':_0x228c8f['id']}})[_0x662e('0x24')](function(){return _0x4f8df3;});})[_0x662e('0x24')](function(){_0x21fdf1[_0x662e('0x19')](0xcc)[_0x662e('0x28')]();});}};}function handleEntityNotFound(_0x2d75f9,_0x30d92c){return function(_0x317656){if(!_0x317656){_0x2d75f9['sendStatus'](0x194);}return _0x317656;};}function handleError(_0x2320ce,_0x1e332b){_0x1e332b=_0x1e332b||0x1f4;return function(_0x58c959){logger[_0x662e('0x29')](_0x58c959[_0x662e('0x2a')]);if(_0x58c959[_0x662e('0x2b')]){delete _0x58c959['name'];}_0x2320ce[_0x662e('0x19')](_0x1e332b)['send'](_0x58c959);};}exports[_0x662e('0x2c')]=function(_0x2d7186,_0x59170d){var _0x53847e={},_0x5437b1={},_0xb98d3d={'count':0x0,'rows':[]};var _0x276766=_[_0x662e('0x2d')](db[_0x662e('0x2e')][_0x662e('0x2f')],function(_0x59c303){return{'name':_0x59c303[_0x662e('0x30')],'type':_0x59c303[_0x662e('0x31')][_0x662e('0x32')]};});_0x5437b1[_0x662e('0x33')]=_[_0x662e('0x2d')](_0x276766,_0x662e('0x2b'));_0x5437b1[_0x662e('0x34')]=_[_0x662e('0x35')](_0x2d7186[_0x662e('0x34')]);_0x5437b1[_0x662e('0x36')]=_[_0x662e('0x37')](_0x5437b1[_0x662e('0x33')],_0x5437b1['query']);_0x53847e['attributes']=_['intersection'](_0x5437b1['model'],qs['fields'](_0x2d7186[_0x662e('0x34')][_0x662e('0x38')]));_0x53847e[_0x662e('0x39')]=_0x53847e[_0x662e('0x39')][_0x662e('0x3a')]?_0x53847e['attributes']:_0x5437b1['model'];if(!_0x2d7186[_0x662e('0x34')][_0x662e('0x3b')](_0x662e('0x3c'))){_0x53847e['limit']=qs['limit'](_0x2d7186[_0x662e('0x34')][_0x662e('0x1c')]);_0x53847e['offset']=qs[_0x662e('0x1b')](_0x2d7186[_0x662e('0x34')][_0x662e('0x1b')]);}_0x53847e[_0x662e('0x3d')]=qs[_0x662e('0x3e')](_0x2d7186[_0x662e('0x34')][_0x662e('0x3e')]);_0x53847e[_0x662e('0x3f')]=qs[_0x662e('0x36')](_[_0x662e('0x40')](_0x2d7186[_0x662e('0x34')],_0x5437b1[_0x662e('0x36')]),_0x276766);if(_0x2d7186[_0x662e('0x34')][_0x662e('0x41')]){_0x53847e['where']=_[_0x662e('0x42')](_0x53847e['where'],{'$or':_[_0x662e('0x2d')](_0x276766,function(_0x42a4f6){if(_0x42a4f6[_0x662e('0x31')]!==_0x662e('0x43')){var _0x123522={};_0x123522[_0x42a4f6['name']]={'$like':'%'+_0x2d7186[_0x662e('0x34')][_0x662e('0x41')]+'%'};return _0x123522;}})});}_0x53847e=_[_0x662e('0x42')]({},_0x53847e,_0x2d7186['options']);var _0x62d0de={'where':_0x53847e[_0x662e('0x3f')]};return db[_0x662e('0x2e')][_0x662e('0x1e')](_0x62d0de)[_0x662e('0x24')](function(_0x373fe1){_0xb98d3d['count']=_0x373fe1;if(_0x2d7186['query'][_0x662e('0x44')]){_0x53847e[_0x662e('0x45')]=[{'all':!![]}];}return db[_0x662e('0x2e')][_0x662e('0x46')](_0x53847e);})['then'](function(_0x224f6b){_0xb98d3d[_0x662e('0x47')]=_0x224f6b;return _0xb98d3d;})[_0x662e('0x24')](respondWithFilteredResult(_0x59170d,_0x53847e))[_0x662e('0x48')](handleError(_0x59170d,null));};exports[_0x662e('0x49')]=function(_0x5a222a,_0x24aba7){var _0x34e717={'raw':!![],'where':{'id':_0x5a222a['params']['id']}},_0x3d1353={};_0x3d1353[_0x662e('0x33')]=_[_0x662e('0x35')](db['SquareOdbc'][_0x662e('0x2f')]);_0x3d1353[_0x662e('0x34')]=_[_0x662e('0x35')](_0x5a222a['query']);_0x3d1353[_0x662e('0x36')]=_[_0x662e('0x37')](_0x3d1353[_0x662e('0x33')],_0x3d1353[_0x662e('0x34')]);_0x34e717[_0x662e('0x39')]=_[_0x662e('0x37')](_0x3d1353[_0x662e('0x33')],qs[_0x662e('0x38')](_0x5a222a[_0x662e('0x34')][_0x662e('0x38')]));_0x34e717['attributes']=_0x34e717[_0x662e('0x39')]['length']?_0x34e717[_0x662e('0x39')]:_0x3d1353[_0x662e('0x33')];if(_0x5a222a['query']['includeAll']){_0x34e717[_0x662e('0x45')]=[{'all':!![]}];}_0x34e717=_[_0x662e('0x42')]({},_0x34e717,_0x5a222a[_0x662e('0x4a')]);return db['SquareOdbc'][_0x662e('0x4b')](_0x34e717)['then'](handleEntityNotFound(_0x24aba7,null))[_0x662e('0x24')](respondWithResult(_0x24aba7,null))[_0x662e('0x48')](handleError(_0x24aba7,null));};exports[_0x662e('0x4c')]=function(_0x28bf95,_0x446476){return db[_0x662e('0x2e')][_0x662e('0x4c')](_0x28bf95[_0x662e('0x4d')],{})[_0x662e('0x24')](function(_0x40021b){var _0x2aca69=_0x28bf95[_0x662e('0x4e')][_0x662e('0x26')]({'plain':!![]});if(!_0x2aca69)throw new Error(_0x662e('0x4f'));if(_0x2aca69[_0x662e('0x50')]===_0x662e('0x4e')){var _0xd22d70=_0x40021b[_0x662e('0x26')]({'plain':!![]});var _0x2866c7=_0x662e('0x27');return db['UserProfileSection'][_0x662e('0x4b')]({'where':{'name':_0x2866c7,'userProfileId':_0x2aca69['userProfileId']},'raw':!![]})['then'](function(_0x27af00){if(_0x27af00&&_0x27af00[_0x662e('0x51')]===0x0){return db['UserProfileResource'][_0x662e('0x4c')]({'name':_0xd22d70[_0x662e('0x2b')],'resourceId':_0xd22d70['id'],'type':_0x27af00[_0x662e('0x2b')],'sectionId':_0x27af00['id']},{})[_0x662e('0x24')](function(){return _0x40021b;});}else{return _0x40021b;}})[_0x662e('0x48')](function(_0x26e6a9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26e6a9);throw _0x26e6a9;});}return _0x40021b;})[_0x662e('0x24')](respondWithResult(_0x446476,0xc9))['catch'](handleError(_0x446476,null));};exports[_0x662e('0x23')]=function(_0x545cd8,_0x2c1981){if(_0x545cd8[_0x662e('0x4d')]['id']){delete _0x545cd8[_0x662e('0x4d')]['id'];}return db['SquareOdbc'][_0x662e('0x4b')]({'where':{'id':_0x545cd8[_0x662e('0x52')]['id']}})[_0x662e('0x24')](handleEntityNotFound(_0x2c1981,null))['then'](saveUpdates(_0x545cd8[_0x662e('0x4d')],null))[_0x662e('0x24')](respondWithResult(_0x2c1981,null))[_0x662e('0x48')](handleError(_0x2c1981,null));};exports[_0x662e('0x25')]=function(_0x288e8a,_0x5d23d5){return db[_0x662e('0x2e')][_0x662e('0x4b')]({'where':{'id':_0x288e8a['params']['id']}})[_0x662e('0x24')](handleEntityNotFound(_0x5d23d5,null))['then'](removeEntity(_0x5d23d5,null))[_0x662e('0x48')](handleError(_0x5d23d5,null));};exports['test']=function(_0x2915bd,_0x4d8dfa,_0x2b91b9){var _0x32f6b5;return db[_0x662e('0x2e')][_0x662e('0x4b')]({'where':{'id':_0x2915bd[_0x662e('0x52')]['id']},'attributes':['id',_0x662e('0x53')]})[_0x662e('0x24')](handleEntityNotFound(_0x4d8dfa,null))[_0x662e('0x24')](function(_0x2b8a99){if(_0x2b8a99){var _0xc94f8f=require(_0x662e('0x54'))();_0xc94f8f[_0x662e('0x55')](_0x2b8a99[_0x662e('0x53')]);_0xc94f8f[_0x662e('0x56')]();return _0x2b8a99;}})[_0x662e('0x24')](respondWithResult(_0x4d8dfa,null))[_0x662e('0x48')](handleError(_0x4d8dfa,null));}; \ No newline at end of file +var _0x7a6a=['where','filters','pick','filter','merge','VIRTUAL','options','SquareOdbc','rows','catch','params','includeAll','include','find','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','closeSync','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','ODBC','UserProfileResource','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x7a6a,0x116));var _0xa7a6=function(_0x45314d,_0x1998d9){_0x45314d=_0x45314d-0x0;var _0x446ba0=_0x7a6a[_0x45314d];return _0x446ba0;};'use strict';var emlformat=require(_0xa7a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa7a6('0x1'));var moment=require(_0xa7a6('0x2'));var BPromise=require(_0xa7a6('0x3'));var Mustache=require(_0xa7a6('0x4'));var util=require(_0xa7a6('0x5'));var path=require(_0xa7a6('0x6'));var sox=require(_0xa7a6('0x7'));var csv=require(_0xa7a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7a6('0x9'));var squel=require(_0xa7a6('0xa'));var crypto=require(_0xa7a6('0xb'));var jsforce=require(_0xa7a6('0xc'));var deskjs=require(_0xa7a6('0xd'));var toCsv=require(_0xa7a6('0x8'));var querystring=require(_0xa7a6('0xe'));var Papa=require(_0xa7a6('0xf'));var Redis=require(_0xa7a6('0x10'));var authService=require(_0xa7a6('0x11'));var qs=require(_0xa7a6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7a6('0x13'));var logger=require(_0xa7a6('0x14'))(_0xa7a6('0x15'));var utils=require(_0xa7a6('0x16'));var config=require(_0xa7a6('0x17'));var licenseUtil=require(_0xa7a6('0x18'));var db=require(_0xa7a6('0x19'))['db'];function respondWithStatusCode(_0x55802a,_0x48cb9e){_0x48cb9e=_0x48cb9e||0xcc;return function(_0x19414c){if(_0x19414c){return _0x55802a[_0xa7a6('0x1a')](_0x48cb9e);}return _0x55802a[_0xa7a6('0x1b')](_0x48cb9e)[_0xa7a6('0x1c')]();};}function respondWithResult(_0x41484b,_0x5e42e0){_0x5e42e0=_0x5e42e0||0xc8;return function(_0x798629){if(_0x798629){return _0x41484b[_0xa7a6('0x1b')](_0x5e42e0)[_0xa7a6('0x1d')](_0x798629);}};}function respondWithFilteredResult(_0x1e60bc,_0x4ab556){return function(_0x34cf23){if(_0x34cf23){var _0x261184=typeof _0x4ab556[_0xa7a6('0x1e')]===_0xa7a6('0x1f')&&typeof _0x4ab556[_0xa7a6('0x20')]==='undefined';var _0x19d12e=_0x34cf23[_0xa7a6('0x21')];var _0x12e5f9=_0x261184?0x0:_0x4ab556[_0xa7a6('0x1e')];var _0x426f00=_0x261184?_0x34cf23[_0xa7a6('0x21')]:_0x4ab556[_0xa7a6('0x1e')]+_0x4ab556[_0xa7a6('0x20')];var _0x3e1bb1;if(_0x426f00>=_0x19d12e){_0x426f00=_0x19d12e;_0x3e1bb1=0xc8;}else{_0x3e1bb1=0xce;}_0x1e60bc[_0xa7a6('0x1b')](_0x3e1bb1);return _0x1e60bc[_0xa7a6('0x22')]('Content-Range',_0x12e5f9+'-'+_0x426f00+'/'+_0x19d12e)['json'](_0x34cf23);}return null;};}function patchUpdates(_0x4f1535){return function(_0x4ae53f){try{jsonpatch[_0xa7a6('0x23')](_0x4ae53f,_0x4f1535,!![]);}catch(_0x1f6394){return BPromise[_0xa7a6('0x24')](_0x1f6394);}return _0x4ae53f[_0xa7a6('0x25')]();};}function saveUpdates(_0x154588,_0x2b1cff){return function(_0x483601){if(_0x483601){return _0x483601[_0xa7a6('0x26')](_0x154588)['then'](function(_0x26d170){return _0x26d170;});}return null;};}function removeEntity(_0x30cdd4,_0x3cb9e7){return function(_0xe35c96){if(_0xe35c96){return _0xe35c96[_0xa7a6('0x27')]()['then'](function(){var _0x4af3c8=_0xe35c96[_0xa7a6('0x28')]({'plain':!![]});var _0x5f4c6b=_0xa7a6('0x29');return db[_0xa7a6('0x2a')][_0xa7a6('0x27')]({'where':{'type':_0x5f4c6b,'resourceId':_0x4af3c8['id']}})['then'](function(){return _0xe35c96;});})[_0xa7a6('0x2b')](function(){_0x30cdd4[_0xa7a6('0x1b')](0xcc)[_0xa7a6('0x1c')]();});}};}function handleEntityNotFound(_0x454c89,_0x8da7fc){return function(_0x2086ad){if(!_0x2086ad){_0x454c89['sendStatus'](0x194);}return _0x2086ad;};}function handleError(_0x182a38,_0x4760ce){_0x4760ce=_0x4760ce||0x1f4;return function(_0x28a6eb){logger[_0xa7a6('0x2c')](_0x28a6eb[_0xa7a6('0x2d')]);if(_0x28a6eb['name']){delete _0x28a6eb[_0xa7a6('0x2e')];}_0x182a38[_0xa7a6('0x1b')](_0x4760ce)[_0xa7a6('0x2f')](_0x28a6eb);};}exports['index']=function(_0x500e20,_0x5c069d){var _0x3077f9={},_0x3b1f7a={},_0x4ab1d4={'count':0x0,'rows':[]};var _0xf6e3f5=_[_0xa7a6('0x30')](db['SquareOdbc'][_0xa7a6('0x31')],function(_0x515dbb){return{'name':_0x515dbb[_0xa7a6('0x32')],'type':_0x515dbb[_0xa7a6('0x33')][_0xa7a6('0x34')]};});_0x3b1f7a[_0xa7a6('0x35')]=_['map'](_0xf6e3f5,_0xa7a6('0x2e'));_0x3b1f7a[_0xa7a6('0x36')]=_[_0xa7a6('0x37')](_0x500e20[_0xa7a6('0x36')]);_0x3b1f7a['filters']=_[_0xa7a6('0x38')](_0x3b1f7a[_0xa7a6('0x35')],_0x3b1f7a[_0xa7a6('0x36')]);_0x3077f9['attributes']=_['intersection'](_0x3b1f7a[_0xa7a6('0x35')],qs[_0xa7a6('0x39')](_0x500e20[_0xa7a6('0x36')]['fields']));_0x3077f9[_0xa7a6('0x3a')]=_0x3077f9[_0xa7a6('0x3a')]['length']?_0x3077f9[_0xa7a6('0x3a')]:_0x3b1f7a[_0xa7a6('0x35')];if(!_0x500e20[_0xa7a6('0x36')]['hasOwnProperty'](_0xa7a6('0x3b'))){_0x3077f9[_0xa7a6('0x20')]=qs[_0xa7a6('0x20')](_0x500e20['query'][_0xa7a6('0x20')]);_0x3077f9[_0xa7a6('0x1e')]=qs[_0xa7a6('0x1e')](_0x500e20[_0xa7a6('0x36')]['offset']);}_0x3077f9[_0xa7a6('0x3c')]=qs[_0xa7a6('0x3d')](_0x500e20['query']['sort']);_0x3077f9[_0xa7a6('0x3e')]=qs[_0xa7a6('0x3f')](_[_0xa7a6('0x40')](_0x500e20[_0xa7a6('0x36')],_0x3b1f7a[_0xa7a6('0x3f')]),_0xf6e3f5);if(_0x500e20[_0xa7a6('0x36')][_0xa7a6('0x41')]){_0x3077f9[_0xa7a6('0x3e')]=_[_0xa7a6('0x42')](_0x3077f9[_0xa7a6('0x3e')],{'$or':_[_0xa7a6('0x30')](_0xf6e3f5,function(_0x12af13){if(_0x12af13['type']!==_0xa7a6('0x43')){var _0x108e0f={};_0x108e0f[_0x12af13['name']]={'$like':'%'+_0x500e20[_0xa7a6('0x36')][_0xa7a6('0x41')]+'%'};return _0x108e0f;}})});}_0x3077f9=_[_0xa7a6('0x42')]({},_0x3077f9,_0x500e20[_0xa7a6('0x44')]);var _0x46109c={'where':_0x3077f9['where']};return db[_0xa7a6('0x45')][_0xa7a6('0x21')](_0x46109c)[_0xa7a6('0x2b')](function(_0x1b75b4){_0x4ab1d4[_0xa7a6('0x21')]=_0x1b75b4;if(_0x500e20['query']['includeAll']){_0x3077f9['include']=[{'all':!![]}];}return db[_0xa7a6('0x45')]['findAll'](_0x3077f9);})[_0xa7a6('0x2b')](function(_0x560553){_0x4ab1d4[_0xa7a6('0x46')]=_0x560553;return _0x4ab1d4;})[_0xa7a6('0x2b')](respondWithFilteredResult(_0x5c069d,_0x3077f9))[_0xa7a6('0x47')](handleError(_0x5c069d,null));};exports['show']=function(_0x1e2228,_0x4ff34e){var _0x5526a7={'raw':!![],'where':{'id':_0x1e2228[_0xa7a6('0x48')]['id']}},_0x3837c5={};_0x3837c5[_0xa7a6('0x35')]=_[_0xa7a6('0x37')](db['SquareOdbc'][_0xa7a6('0x31')]);_0x3837c5[_0xa7a6('0x36')]=_[_0xa7a6('0x37')](_0x1e2228['query']);_0x3837c5[_0xa7a6('0x3f')]=_['intersection'](_0x3837c5[_0xa7a6('0x35')],_0x3837c5[_0xa7a6('0x36')]);_0x5526a7['attributes']=_[_0xa7a6('0x38')](_0x3837c5[_0xa7a6('0x35')],qs[_0xa7a6('0x39')](_0x1e2228[_0xa7a6('0x36')][_0xa7a6('0x39')]));_0x5526a7[_0xa7a6('0x3a')]=_0x5526a7[_0xa7a6('0x3a')]['length']?_0x5526a7[_0xa7a6('0x3a')]:_0x3837c5[_0xa7a6('0x35')];if(_0x1e2228[_0xa7a6('0x36')][_0xa7a6('0x49')]){_0x5526a7[_0xa7a6('0x4a')]=[{'all':!![]}];}_0x5526a7=_['merge']({},_0x5526a7,_0x1e2228['options']);return db[_0xa7a6('0x45')][_0xa7a6('0x4b')](_0x5526a7)[_0xa7a6('0x2b')](handleEntityNotFound(_0x4ff34e,null))[_0xa7a6('0x2b')](respondWithResult(_0x4ff34e,null))[_0xa7a6('0x47')](handleError(_0x4ff34e,null));};exports['create']=function(_0x255191,_0x5d0d6a){return db[_0xa7a6('0x45')][_0xa7a6('0x4c')](_0x255191['body'],{})[_0xa7a6('0x2b')](function(_0x5353a9){var _0x433dcc=_0x255191[_0xa7a6('0x4d')][_0xa7a6('0x28')]({'plain':!![]});if(!_0x433dcc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x433dcc[_0xa7a6('0x4e')]===_0xa7a6('0x4d')){var _0x4464cc=_0x5353a9['get']({'plain':!![]});var _0x483b82=_0xa7a6('0x29');return db[_0xa7a6('0x4f')]['find']({'where':{'name':_0x483b82,'userProfileId':_0x433dcc['userProfileId']},'raw':!![]})['then'](function(_0x3645d4){if(_0x3645d4&&_0x3645d4['autoAssociation']===0x0){return db[_0xa7a6('0x2a')][_0xa7a6('0x4c')]({'name':_0x4464cc[_0xa7a6('0x2e')],'resourceId':_0x4464cc['id'],'type':_0x3645d4[_0xa7a6('0x2e')],'sectionId':_0x3645d4['id']},{})[_0xa7a6('0x2b')](function(){return _0x5353a9;});}else{return _0x5353a9;}})[_0xa7a6('0x47')](function(_0x426c80){logger[_0xa7a6('0x2c')](_0xa7a6('0x50'),_0x426c80);throw _0x426c80;});}return _0x5353a9;})[_0xa7a6('0x2b')](respondWithResult(_0x5d0d6a,0xc9))[_0xa7a6('0x47')](handleError(_0x5d0d6a,null));};exports['update']=function(_0x1fd734,_0x572a89){if(_0x1fd734['body']['id']){delete _0x1fd734['body']['id'];}return db[_0xa7a6('0x45')][_0xa7a6('0x4b')]({'where':{'id':_0x1fd734[_0xa7a6('0x48')]['id']}})[_0xa7a6('0x2b')](handleEntityNotFound(_0x572a89,null))[_0xa7a6('0x2b')](saveUpdates(_0x1fd734['body'],null))['then'](respondWithResult(_0x572a89,null))[_0xa7a6('0x47')](handleError(_0x572a89,null));};exports[_0xa7a6('0x27')]=function(_0x23b38f,_0x18fe39){return db['SquareOdbc'][_0xa7a6('0x4b')]({'where':{'id':_0x23b38f[_0xa7a6('0x48')]['id']}})[_0xa7a6('0x2b')](handleEntityNotFound(_0x18fe39,null))[_0xa7a6('0x2b')](removeEntity(_0x18fe39,null))['catch'](handleError(_0x18fe39,null));};exports[_0xa7a6('0x51')]=function(_0x3d3a29,_0x15bc86,_0x567f88){var _0x994e3c;return db['SquareOdbc'][_0xa7a6('0x4b')]({'where':{'id':_0x3d3a29['params']['id']},'attributes':['id',_0xa7a6('0x52')]})['then'](handleEntityNotFound(_0x15bc86,null))[_0xa7a6('0x2b')](function(_0x5ecd32){if(_0x5ecd32){var _0x1ea018=require(_0xa7a6('0x53'))();_0x1ea018['openSync'](_0x5ecd32[_0xa7a6('0x52')]);_0x1ea018[_0xa7a6('0x54')]();return _0x5ecd32;}})[_0xa7a6('0x2b')](respondWithResult(_0x15bc86,null))[_0xa7a6('0x47')](handleError(_0x15bc86,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 4c22ba4..db4e632 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 _0xd2cc=['./squareOdbc.attributes','exports','define','square_odbc','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x372025,_0x23f601){var _0x1a9934=function(_0x483e98){while(--_0x483e98){_0x372025['push'](_0x372025['shift']());}};_0x1a9934(++_0x23f601);}(_0xd2cc,0x154));var _0xcd2c=function(_0x1ead92,_0x36c2ea){_0x1ead92=_0x1ead92-0x0;var _0x257f2f=_0xd2cc[_0x1ead92];return _0x257f2f;};'use strict';var _=require(_0xcd2c('0x0'));var util=require(_0xcd2c('0x1'));var logger=require(_0xcd2c('0x2'))(_0xcd2c('0x3'));var moment=require('moment');var BPromise=require(_0xcd2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd2c('0x5'));var rimraf=require(_0xcd2c('0x6'));var config=require(_0xcd2c('0x7'));var attributes=require(_0xcd2c('0x8'));module[_0xcd2c('0x9')]=function(_0x1064b2,_0x1f6bfd){return _0x1064b2[_0xcd2c('0xa')]('SquareOdbc',attributes,{'tableName':_0xcd2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9de4=['./squareOdbc.attributes','exports','define','SquareOdbc','util','api','request-promise','path'];(function(_0xefdc1c,_0x10f40b){var _0x48581c=function(_0x5cad7f){while(--_0x5cad7f){_0xefdc1c['push'](_0xefdc1c['shift']());}};_0x48581c(++_0x10f40b);}(_0x9de4,0xcc));var _0x49de=function(_0x5dba21,_0x30811c){_0x5dba21=_0x5dba21-0x0;var _0xd0a86=_0x9de4[_0x5dba21];return _0xd0a86;};'use strict';var _=require('lodash');var util=require(_0x49de('0x0'));var logger=require('../../config/logger')(_0x49de('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49de('0x2'));var fs=require('fs');var path=require(_0x49de('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49de('0x4'));module[_0x49de('0x5')]=function(_0x49a3b8,_0x48cb83){return _0x49a3b8[_0x49de('0x6')](_0x49de('0x7'),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 812e529..66e1180 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 _0xce4e=['ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','model','map','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x413c89,_0x16f8dd){var _0x2514c0=function(_0x4251cf){while(--_0x4251cf){_0x413c89['push'](_0x413c89['shift']());}};_0x2514c0(++_0x16f8dd);}(_0xce4e,0x19f));var _0xece4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xce4e[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xece4('0x0'));var util=require(_0xece4('0x1'));var moment=require(_0xece4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xece4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xece4('0x4'))(_0xece4('0x5'));var config=require(_0xece4('0x6'));var jayson=require(_0xece4('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1674e0,_0x3842be,_0x1651a8){return new BPromise(function(_0x1ec585,_0x147d30){return client['request'](_0x1674e0,_0x1651a8)[_0xece4('0x8')](function(_0x23e99a){logger[_0xece4('0x9')](_0xece4('0xa'),_0x3842be,_0xece4('0xb'));logger[_0xece4('0xc')](_0xece4('0xd'),_0x3842be,_0xece4('0xb'),JSON[_0xece4('0xe')](_0x23e99a));if(_0x23e99a['error']){if(_0x23e99a[_0xece4('0xf')][_0xece4('0x10')]===0x1f4){logger['error'](_0xece4('0xa'),_0x3842be,_0x23e99a[_0xece4('0xf')][_0xece4('0x11')]);return _0x147d30(_0x23e99a[_0xece4('0xf')][_0xece4('0x11')]);}logger[_0xece4('0xf')](_0xece4('0xa'),_0x3842be,_0x23e99a[_0xece4('0xf')]['message']);return _0x1ec585(_0x23e99a[_0xece4('0xf')][_0xece4('0x11')]);}else{logger[_0xece4('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x3842be,'request\x20sent');_0x1ec585(_0x23e99a[_0xece4('0x12')][_0xece4('0x11')]);}})[_0xece4('0x13')](function(_0x24d0ac){logger[_0xece4('0xf')](_0xece4('0xa'),_0x3842be,_0x24d0ac);_0x147d30(_0x24d0ac);});});}exports[_0xece4('0x14')]=function(_0x53322e){var _0xe9b93f=this;return new Promise(function(_0x427053,_0x1f026e){return db[_0xece4('0x15')][_0xece4('0x16')]({'raw':_0x53322e['options']?_0x53322e[_0xece4('0x17')][_0xece4('0x18')]===undefined?!![]:![]:!![],'where':_0x53322e['options']?_0x53322e['options']['where']||null:null,'attributes':_0x53322e[_0xece4('0x17')]?_0x53322e[_0xece4('0x17')][_0xece4('0x19')]||null:null,'include':_0x53322e[_0xece4('0x17')]?_0x53322e[_0xece4('0x17')][_0xece4('0x1a')]?_['map'](_0x53322e[_0xece4('0x17')][_0xece4('0x1a')],function(_0x5991f5){return{'model':db[_0x5991f5[_0xece4('0x1b')]],'as':_0x5991f5['as'],'attributes':_0x5991f5[_0xece4('0x19')],'include':_0x5991f5[_0xece4('0x1a')]?_[_0xece4('0x1c')](_0x5991f5['include'],function(_0x4404ea){return{'model':db[_0x4404ea[_0xece4('0x1b')]],'as':_0x4404ea['as'],'attributes':_0x4404ea['attributes'],'include':_0x4404ea[_0xece4('0x1a')]?_['map'](_0x4404ea[_0xece4('0x1a')],function(_0x395a6f){return{'model':db[_0x395a6f['model']],'as':_0x395a6f['as'],'attributes':_0x395a6f[_0xece4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xece4('0x8')](function(_0x406eb2){logger[_0xece4('0x9')]('ShowSquareOdbc',_0x53322e);logger[_0xece4('0xc')](_0xece4('0x14'),_0x53322e,JSON[_0xece4('0xe')](_0x406eb2));_0x427053(_0x406eb2);})[_0xece4('0x13')](function(_0x13f31d){logger[_0xece4('0xf')](_0xece4('0x14'),_0x13f31d[_0xece4('0x11')],_0x53322e);_0x1f026e(_0xe9b93f[_0xece4('0xf')](0x1f4,_0x13f31d[_0xece4('0x11')]));});});}; \ No newline at end of file +var _0x911d=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','request\x20sent','stringify','code','error','SquareOdbc,\x20%s,\x20%s','message','info','result','SquareOdbc','find','options','raw','include','map','model','attributes','ShowSquareOdbc','debug','util','bluebird'];(function(_0x146e81,_0x1335a1){var _0xc17137=function(_0x5c0f17){while(--_0x5c0f17){_0x146e81['push'](_0x146e81['shift']());}};_0xc17137(++_0x1335a1);}(_0x911d,0x194));var _0xd911=function(_0x84293f,_0x1b4173){_0x84293f=_0x84293f-0x0;var _0x15a611=_0x911d[_0x84293f];return _0x15a611;};'use strict';var _=require('lodash');var util=require(_0xd911('0x0'));var moment=require('moment');var BPromise=require(_0xd911('0x1'));var rs=require(_0xd911('0x2'));var fs=require('fs');var Redis=require(_0xd911('0x3'));var db=require(_0xd911('0x4'))['db'];var utils=require(_0xd911('0x5'));var logger=require('../../config/logger')(_0xd911('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd911('0x7')][_0xd911('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x126656,_0x1ca297,_0x67405b){return new BPromise(function(_0x376ca2,_0x4420fd){return client[_0xd911('0x9')](_0x126656,_0x67405b)[_0xd911('0xa')](function(_0x1b1f96){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x1ca297,_0xd911('0xb'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1ca297,'request\x20sent',JSON[_0xd911('0xc')](_0x1b1f96));if(_0x1b1f96['error']){if(_0x1b1f96['error'][_0xd911('0xd')]===0x1f4){logger[_0xd911('0xe')](_0xd911('0xf'),_0x1ca297,_0x1b1f96['error'][_0xd911('0x10')]);return _0x4420fd(_0x1b1f96['error']['message']);}logger['error'](_0xd911('0xf'),_0x1ca297,_0x1b1f96[_0xd911('0xe')][_0xd911('0x10')]);return _0x376ca2(_0x1b1f96[_0xd911('0xe')][_0xd911('0x10')]);}else{logger[_0xd911('0x11')](_0xd911('0xf'),_0x1ca297,_0xd911('0xb'));_0x376ca2(_0x1b1f96[_0xd911('0x12')]['message']);}})['catch'](function(_0x253111){logger[_0xd911('0xe')](_0xd911('0xf'),_0x1ca297,_0x253111);_0x4420fd(_0x253111);});});}exports['ShowSquareOdbc']=function(_0xc7bc9f){var _0x4ac773=this;return new Promise(function(_0x1d6121,_0x3b0d22){return db[_0xd911('0x13')][_0xd911('0x14')]({'raw':_0xc7bc9f[_0xd911('0x15')]?_0xc7bc9f[_0xd911('0x15')][_0xd911('0x16')]===undefined?!![]:![]:!![],'where':_0xc7bc9f[_0xd911('0x15')]?_0xc7bc9f[_0xd911('0x15')]['where']||null:null,'attributes':_0xc7bc9f[_0xd911('0x15')]?_0xc7bc9f[_0xd911('0x15')]['attributes']||null:null,'include':_0xc7bc9f[_0xd911('0x15')]?_0xc7bc9f['options'][_0xd911('0x17')]?_[_0xd911('0x18')](_0xc7bc9f[_0xd911('0x15')][_0xd911('0x17')],function(_0x49e2a3){return{'model':db[_0x49e2a3[_0xd911('0x19')]],'as':_0x49e2a3['as'],'attributes':_0x49e2a3[_0xd911('0x1a')],'include':_0x49e2a3['include']?_[_0xd911('0x18')](_0x49e2a3['include'],function(_0x99fca){return{'model':db[_0x99fca[_0xd911('0x19')]],'as':_0x99fca['as'],'attributes':_0x99fca[_0xd911('0x1a')],'include':_0x99fca[_0xd911('0x17')]?_[_0xd911('0x18')](_0x99fca['include'],function(_0x1e823c){return{'model':db[_0x1e823c[_0xd911('0x19')]],'as':_0x1e823c['as'],'attributes':_0x1e823c[_0xd911('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd911('0xa')](function(_0x14cec9){logger[_0xd911('0x11')](_0xd911('0x1b'),_0xc7bc9f);logger[_0xd911('0x1c')]('ShowSquareOdbc',_0xc7bc9f,JSON[_0xd911('0xc')](_0x14cec9));_0x1d6121(_0x14cec9);})['catch'](function(_0xae290d){logger[_0xd911('0xe')](_0xd911('0x1b'),_0xae290d['message'],_0xc7bc9f);_0x3b0d22(_0x4ac773['error'](0x1f4,_0xae290d[_0xd911('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index a4ed03a..0adf0a9 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 _0x9176=['/:id','destroy','delete','removeUsers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareProject.controller','get','isAuthenticated','index','getUsers','post','create','/:id/users','addUsers','put'];(function(_0x2153fe,_0x1c0cdc){var _0x3247d1=function(_0x1b7a07){while(--_0x1b7a07){_0x2153fe['push'](_0x2153fe['shift']());}};_0x3247d1(++_0x1c0cdc);}(_0x9176,0x164));var _0x6917=function(_0x225a45,_0x590063){_0x225a45=_0x225a45-0x0;var _0x537e53=_0x9176[_0x225a45];return _0x537e53;};'use strict';var multer=require(_0x6917('0x0'));var util=require(_0x6917('0x1'));var path=require(_0x6917('0x2'));var timeout=require(_0x6917('0x3'));var express=require(_0x6917('0x4'));var router=express[_0x6917('0x5')]();var fs_extra=require(_0x6917('0x6'));var auth=require(_0x6917('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6917('0x8'));router[_0x6917('0x9')]('/',auth[_0x6917('0xa')](),controller[_0x6917('0xb')]);router[_0x6917('0x9')]('/:id',auth[_0x6917('0xa')](),controller['show']);router[_0x6917('0x9')]('/:id/users',auth[_0x6917('0xa')](),controller[_0x6917('0xc')]);router[_0x6917('0xd')]('/',auth['isAuthenticated'](),controller[_0x6917('0xe')]);router['post'](_0x6917('0xf'),auth[_0x6917('0xa')](),controller[_0x6917('0x10')]);router[_0x6917('0x11')](_0x6917('0x12'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6917('0x13')]);router[_0x6917('0x14')](_0x6917('0xf'),auth['isAuthenticated'](),controller[_0x6917('0x15')]);module['exports']=router; \ No newline at end of file +var _0xaa56=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','/:id','removeUsers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaa56,0xc6));var _0x6aa5=function(_0x1cbf94,_0x1e439c){_0x1cbf94=_0x1cbf94-0x0;var _0x422618=_0xaa56[_0x1cbf94];return _0x422618;};'use strict';var multer=require('multer');var util=require(_0x6aa5('0x0'));var path=require(_0x6aa5('0x1'));var timeout=require(_0x6aa5('0x2'));var express=require('express');var router=express[_0x6aa5('0x3')]();var fs_extra=require(_0x6aa5('0x4'));var auth=require(_0x6aa5('0x5'));var interaction=require(_0x6aa5('0x6'));var config=require(_0x6aa5('0x7'));var controller=require('./squareProject.controller');router[_0x6aa5('0x8')]('/',auth['isAuthenticated'](),controller[_0x6aa5('0x9')]);router[_0x6aa5('0x8')]('/:id',auth[_0x6aa5('0xa')](),controller[_0x6aa5('0xb')]);router[_0x6aa5('0x8')](_0x6aa5('0xc'),auth[_0x6aa5('0xa')](),controller[_0x6aa5('0xd')]);router[_0x6aa5('0xe')]('/',auth[_0x6aa5('0xa')](),controller[_0x6aa5('0xf')]);router[_0x6aa5('0xe')](_0x6aa5('0xc'),auth[_0x6aa5('0xa')](),controller[_0x6aa5('0x10')]);router[_0x6aa5('0x11')]('/:id',auth[_0x6aa5('0xa')](),controller[_0x6aa5('0x12')]);router[_0x6aa5('0x13')](_0x6aa5('0x14'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x6aa5('0xc'),auth[_0x6aa5('0xa')](),controller[_0x6aa5('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index acd1ec3..d5b323e 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 _0xda28=['sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction','utf8','toString','DATE'];(function(_0xc25179,_0x56a13d){var _0x562223=function(_0x365bd9){while(--_0x365bd9){_0xc25179['push'](_0xc25179['shift']());}};_0x562223(++_0x56a13d);}(_0xda28,0xfd));var _0x8da2=function(_0x538068,_0x1cebc1){_0x538068=_0x538068-0x0;var _0x3861ee=_0xda28[_0x538068];return _0x3861ee;};'use strict';var Sequelize=require(_0x8da2('0x0'));module[_0x8da2('0x1')]={'name':{'type':Sequelize[_0x8da2('0x2')],'unique':_0x8da2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8da2('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x8da2('0x4')](_0x8da2('0x5')),'get':function(){if(this[_0x8da2('0x6')](_0x8da2('0x7'))){return this[_0x8da2('0x6')](_0x8da2('0x7'))['toString'](_0x8da2('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x8da2('0x5')),'get':function(){if(this[_0x8da2('0x6')]('production')){return this[_0x8da2('0x6')]('production')[_0x8da2('0x9')](_0x8da2('0x8'));}}},'savedAt':{'type':Sequelize[_0x8da2('0xa')]},'publishedAt':{'type':Sequelize[_0x8da2('0xa')]}}; \ No newline at end of file +var _0xa9f3=['preproduction','toString','production','utf8','DATE','sequelize','exports','name','STRING','long','getDataValue'];(function(_0x5d7be0,_0x19d1fd){var _0x129441=function(_0x1ce0e8){while(--_0x1ce0e8){_0x5d7be0['push'](_0x5d7be0['shift']());}};_0x129441(++_0x19d1fd);}(_0xa9f3,0x1de));var _0x3a9f=function(_0x37ce48,_0x6cb926){_0x37ce48=_0x37ce48-0x0;var _0x3831cd=_0xa9f3[_0x37ce48];return _0x3831cd;};'use strict';var Sequelize=require(_0x3a9f('0x0'));module[_0x3a9f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3a9f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3a9f('0x3')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x3a9f('0x4')),'get':function(){if(this[_0x3a9f('0x5')]('preproduction')){return this[_0x3a9f('0x5')](_0x3a9f('0x6'))[_0x3a9f('0x7')]('utf8');}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x3a9f('0x5')](_0x3a9f('0x8'))){return this[_0x3a9f('0x5')](_0x3a9f('0x8'))['toString'](_0x3a9f('0x9'));}}},'savedAt':{'type':Sequelize[_0x3a9f('0xa')]},'publishedAt':{'type':Sequelize[_0x3a9f('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 547d72e..f56f7ec 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 _0x9d6c=['merge','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','sort','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','socket.io-emitter','./squareProject.socket','sendStatus','status','offset','undefined','limit','count','set','apply','reject','then','destroy','get','SquareProjects','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filter'];(function(_0x1f6a6a,_0x3ab79a){var _0x5bf2e5=function(_0x140496){while(--_0x140496){_0x1f6a6a['push'](_0x1f6a6a['shift']());}};_0x5bf2e5(++_0x3ab79a);}(_0x9d6c,0x19b));var _0xc9d6=function(_0x26111f,_0x14be49){_0x26111f=_0x26111f-0x0;var _0x3ffccd=_0x9d6c[_0x26111f];return _0x3ffccd;};'use strict';var emlformat=require(_0xc9d6('0x0'));var rimraf=require(_0xc9d6('0x1'));var zipdir=require(_0xc9d6('0x2'));var jsonpatch=require(_0xc9d6('0x3'));var rp=require('request-promise');var moment=require(_0xc9d6('0x4'));var BPromise=require(_0xc9d6('0x5'));var Mustache=require(_0xc9d6('0x6'));var util=require(_0xc9d6('0x7'));var path=require(_0xc9d6('0x8'));var sox=require(_0xc9d6('0x9'));var csv=require(_0xc9d6('0xa'));var ejs=require(_0xc9d6('0xb'));var fs=require('fs');var fs_extra=require(_0xc9d6('0xc'));var _=require('lodash');var squel=require(_0xc9d6('0xd'));var crypto=require(_0xc9d6('0xe'));var jsforce=require(_0xc9d6('0xf'));var deskjs=require(_0xc9d6('0x10'));var toCsv=require(_0xc9d6('0xa'));var querystring=require(_0xc9d6('0x11'));var Papa=require(_0xc9d6('0x12'));var Redis=require(_0xc9d6('0x13'));var authService=require(_0xc9d6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc9d6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9d6('0x16'))('api');var utils=require(_0xc9d6('0x17'));var config=require(_0xc9d6('0x18'));var licenseUtil=require(_0xc9d6('0x19'));var db=require(_0xc9d6('0x1a'))['db'];config[_0xc9d6('0x1b')]=_[_0xc9d6('0x1c')](config[_0xc9d6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xc9d6('0x1d'))(new Redis(config[_0xc9d6('0x1b')]));require(_0xc9d6('0x1e'))['register'](socket);function respondWithStatusCode(_0x1c5a51,_0x33384e){_0x33384e=_0x33384e||0xcc;return function(_0x4db70a){if(_0x4db70a){return _0x1c5a51[_0xc9d6('0x1f')](_0x33384e);}return _0x1c5a51[_0xc9d6('0x20')](_0x33384e)['end']();};}function respondWithResult(_0x37445e,_0x42fc71){_0x42fc71=_0x42fc71||0xc8;return function(_0x15f954){if(_0x15f954){return _0x37445e[_0xc9d6('0x20')](_0x42fc71)['json'](_0x15f954);}};}function respondWithFilteredResult(_0x24a8de,_0x2a8ee7){return function(_0x12a04d){if(_0x12a04d){var _0x50147e=typeof _0x2a8ee7[_0xc9d6('0x21')]===_0xc9d6('0x22')&&typeof _0x2a8ee7[_0xc9d6('0x23')]==='undefined';var _0x3deb63=_0x12a04d['count'];var _0x4693ec=_0x50147e?0x0:_0x2a8ee7[_0xc9d6('0x21')];var _0xc714f5=_0x50147e?_0x12a04d[_0xc9d6('0x24')]:_0x2a8ee7[_0xc9d6('0x21')]+_0x2a8ee7[_0xc9d6('0x23')];var _0x35fd74;if(_0xc714f5>=_0x3deb63){_0xc714f5=_0x3deb63;_0x35fd74=0xc8;}else{_0x35fd74=0xce;}_0x24a8de[_0xc9d6('0x20')](_0x35fd74);return _0x24a8de[_0xc9d6('0x25')]('Content-Range',_0x4693ec+'-'+_0xc714f5+'/'+_0x3deb63)['json'](_0x12a04d);}return null;};}function patchUpdates(_0x1702fa){return function(_0x19e679){try{jsonpatch[_0xc9d6('0x26')](_0x19e679,_0x1702fa,!![]);}catch(_0x40296f){return BPromise[_0xc9d6('0x27')](_0x40296f);}return _0x19e679['save']();};}function saveUpdates(_0x533087,_0x234111){return function(_0x8a78e){if(_0x8a78e){return _0x8a78e['update'](_0x533087)[_0xc9d6('0x28')](function(_0x5e5afa){return _0x5e5afa;});}return null;};}function removeEntity(_0x57c7cd,_0x21d46c){return function(_0x367db0){if(_0x367db0){return _0x367db0[_0xc9d6('0x29')]()[_0xc9d6('0x28')](function(){var _0x25d2be=_0x367db0[_0xc9d6('0x2a')]({'plain':!![]});var _0x10b9a7=_0xc9d6('0x2b');return db['UserProfileResource'][_0xc9d6('0x29')]({'where':{'type':_0x10b9a7,'resourceId':_0x25d2be['id']}})['then'](function(){return _0x367db0;});})[_0xc9d6('0x28')](function(){_0x57c7cd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b8716,_0x22b7f5){return function(_0x55fe79){if(!_0x55fe79){_0x3b8716[_0xc9d6('0x1f')](0x194);}return _0x55fe79;};}function handleError(_0x241d18,_0x1138c6){_0x1138c6=_0x1138c6||0x1f4;return function(_0x20e2f9){logger[_0xc9d6('0x2c')](_0x20e2f9['stack']);if(_0x20e2f9[_0xc9d6('0x2d')]){delete _0x20e2f9['name'];}_0x241d18[_0xc9d6('0x20')](_0x1138c6)[_0xc9d6('0x2e')](_0x20e2f9);};}exports[_0xc9d6('0x2f')]=function(_0x1dbb90,_0x1003ad){var _0x5831dc={},_0x4120b9={},_0x1ec009={'count':0x0,'rows':[]};var _0xcadcc=_[_0xc9d6('0x30')](db['SquareProject'][_0xc9d6('0x31')],function(_0x1a2d14){return{'name':_0x1a2d14[_0xc9d6('0x32')],'type':_0x1a2d14[_0xc9d6('0x33')]['key']};});_0x4120b9[_0xc9d6('0x34')]=_[_0xc9d6('0x30')](_0xcadcc,_0xc9d6('0x2d'));_0x4120b9['query']=_[_0xc9d6('0x35')](_0x1dbb90[_0xc9d6('0x36')]);_0x4120b9[_0xc9d6('0x37')]=_[_0xc9d6('0x38')](_0x4120b9[_0xc9d6('0x34')],_0x4120b9[_0xc9d6('0x36')]);_0x5831dc['attributes']=_[_0xc9d6('0x38')](_0x4120b9[_0xc9d6('0x34')],qs['fields'](_0x1dbb90['query'][_0xc9d6('0x39')]));_0x5831dc[_0xc9d6('0x3a')]=_0x5831dc['attributes'][_0xc9d6('0x3b')]?_0x5831dc[_0xc9d6('0x3a')]:_0x4120b9['model'];if(!_0x1dbb90[_0xc9d6('0x36')][_0xc9d6('0x3c')](_0xc9d6('0x3d'))){_0x5831dc[_0xc9d6('0x23')]=qs[_0xc9d6('0x23')](_0x1dbb90[_0xc9d6('0x36')]['limit']);_0x5831dc[_0xc9d6('0x21')]=qs[_0xc9d6('0x21')](_0x1dbb90[_0xc9d6('0x36')][_0xc9d6('0x21')]);}_0x5831dc['order']=qs['sort'](_0x1dbb90['query']['sort']);_0x5831dc[_0xc9d6('0x3e')]=qs['filters'](_['pick'](_0x1dbb90['query'],_0x4120b9[_0xc9d6('0x37')]),_0xcadcc);if(_0x1dbb90['query'][_0xc9d6('0x3f')]){_0x5831dc['where']=_[_0xc9d6('0x40')](_0x5831dc[_0xc9d6('0x3e')],{'$or':_[_0xc9d6('0x30')](_0xcadcc,function(_0x4bda27){if(_0x4bda27['type']!=='VIRTUAL'){var _0x50b176={};_0x50b176[_0x4bda27['name']]={'$like':'%'+_0x1dbb90[_0xc9d6('0x36')][_0xc9d6('0x3f')]+'%'};return _0x50b176;}})});}_0x5831dc=_[_0xc9d6('0x40')]({},_0x5831dc,_0x1dbb90[_0xc9d6('0x41')]);var _0x1031ab={'where':_0x5831dc[_0xc9d6('0x3e')]};return db[_0xc9d6('0x42')][_0xc9d6('0x24')](_0x1031ab)['then'](function(_0x2f91f0){_0x1ec009[_0xc9d6('0x24')]=_0x2f91f0;if(_0x1dbb90['query'][_0xc9d6('0x43')]){_0x5831dc[_0xc9d6('0x44')]=[{'all':!![]}];}return db['SquareProject'][_0xc9d6('0x45')](_0x5831dc);})[_0xc9d6('0x28')](function(_0x20b589){_0x1ec009[_0xc9d6('0x46')]=_0x20b589;return _0x1ec009;})[_0xc9d6('0x28')](respondWithFilteredResult(_0x1003ad,_0x5831dc))[_0xc9d6('0x47')](handleError(_0x1003ad,null));};exports[_0xc9d6('0x48')]=function(_0x11d1d8,_0x239e39){var _0x14cb65={'raw':![],'where':{'id':_0x11d1d8[_0xc9d6('0x49')]['id']}},_0x465f8b={};_0x465f8b[_0xc9d6('0x34')]=_[_0xc9d6('0x35')](db[_0xc9d6('0x42')][_0xc9d6('0x31')]);_0x465f8b[_0xc9d6('0x36')]=_[_0xc9d6('0x35')](_0x11d1d8['query']);_0x465f8b[_0xc9d6('0x37')]=_[_0xc9d6('0x38')](_0x465f8b[_0xc9d6('0x34')],_0x465f8b[_0xc9d6('0x36')]);_0x14cb65[_0xc9d6('0x3a')]=_[_0xc9d6('0x38')](_0x465f8b[_0xc9d6('0x34')],qs['fields'](_0x11d1d8[_0xc9d6('0x36')][_0xc9d6('0x39')]));_0x14cb65[_0xc9d6('0x3a')]=_0x14cb65['attributes']['length']?_0x14cb65[_0xc9d6('0x3a')]:_0x465f8b[_0xc9d6('0x34')];if(_0x11d1d8['query']['includeAll']){_0x14cb65['include']=[{'all':!![]}];}_0x14cb65=_['merge']({},_0x14cb65,_0x11d1d8[_0xc9d6('0x41')]);return db[_0xc9d6('0x42')][_0xc9d6('0x4a')](_0x14cb65)[_0xc9d6('0x28')](handleEntityNotFound(_0x239e39,null))[_0xc9d6('0x28')](respondWithResult(_0x239e39,null))[_0xc9d6('0x47')](handleError(_0x239e39,null));};exports[_0xc9d6('0x4b')]=function(_0x3476d7,_0x1b7874){return db[_0xc9d6('0x42')][_0xc9d6('0x4b')](_0x3476d7[_0xc9d6('0x4c')],{})[_0xc9d6('0x28')](function(_0x1bcaf9){var _0x49df65=_0x3476d7[_0xc9d6('0x4d')]['get']({'plain':!![]});if(!_0x49df65)throw new Error(_0xc9d6('0x4e'));if(_0x49df65['role']===_0xc9d6('0x4d')){var _0x542c42=_0x1bcaf9[_0xc9d6('0x2a')]({'plain':!![]});var _0x24b8ef=_0xc9d6('0x2b');return db[_0xc9d6('0x4f')][_0xc9d6('0x4a')]({'where':{'name':_0x24b8ef,'userProfileId':_0x49df65[_0xc9d6('0x50')]},'raw':!![]})['then'](function(_0x383561){if(_0x383561&&_0x383561['autoAssociation']===0x0){return db[_0xc9d6('0x51')][_0xc9d6('0x4b')]({'name':_0x542c42[_0xc9d6('0x2d')],'resourceId':_0x542c42['id'],'type':_0x383561[_0xc9d6('0x2d')],'sectionId':_0x383561['id']},{})[_0xc9d6('0x28')](function(){return _0x1bcaf9;});}else{return _0x1bcaf9;}})[_0xc9d6('0x47')](function(_0x31a8e2){logger[_0xc9d6('0x2c')](_0xc9d6('0x52'),_0x31a8e2);throw _0x31a8e2;});}return _0x1bcaf9;})[_0xc9d6('0x28')](respondWithResult(_0x1b7874,0xc9))[_0xc9d6('0x47')](handleError(_0x1b7874,null));};exports[_0xc9d6('0x53')]=function(_0x4342b4,_0xb9b6f9){if(_0x4342b4[_0xc9d6('0x4c')]['id']){delete _0x4342b4['body']['id'];}return db[_0xc9d6('0x42')][_0xc9d6('0x4a')]({'where':{'id':_0x4342b4[_0xc9d6('0x49')]['id']}})[_0xc9d6('0x28')](handleEntityNotFound(_0xb9b6f9,null))[_0xc9d6('0x28')](saveUpdates(_0x4342b4['body'],null))[_0xc9d6('0x28')](respondWithResult(_0xb9b6f9,null))[_0xc9d6('0x47')](handleError(_0xb9b6f9,null));};exports['destroy']=function(_0x4d005b,_0x3872f0){return db[_0xc9d6('0x42')][_0xc9d6('0x4a')]({'where':{'id':_0x4d005b[_0xc9d6('0x49')]['id']}})[_0xc9d6('0x28')](handleEntityNotFound(_0x3872f0,null))['then'](removeEntity(_0x3872f0,null))[_0xc9d6('0x47')](handleError(_0x3872f0,null));};exports['addUsers']=function(_0xe5d807,_0x5630c8,_0x59a62e){return db['SquareProject'][_0xc9d6('0x4a')]({'where':{'id':_0xe5d807[_0xc9d6('0x49')]['id']}})[_0xc9d6('0x28')](handleEntityNotFound(_0x5630c8,null))[_0xc9d6('0x28')](function(_0x5c1129){if(_0x5c1129){return _0x5c1129['addUsers'](_0xe5d807[_0xc9d6('0x4c')][_0xc9d6('0x54')],_[_0xc9d6('0x55')](_0xe5d807[_0xc9d6('0x4c')],[_0xc9d6('0x54'),'id'])||{});}})[_0xc9d6('0x28')](respondWithResult(_0x5630c8,null))[_0xc9d6('0x47')](handleError(_0x5630c8,null));};exports[_0xc9d6('0x56')]=function(_0x206b90,_0x51b4fc,_0x4654a9){return db['SquareProject']['find']({'where':{'id':_0x206b90[_0xc9d6('0x49')]['id']}})[_0xc9d6('0x28')](handleEntityNotFound(_0x51b4fc,null))[_0xc9d6('0x28')](function(_0x1d91b0){if(_0x1d91b0){return _0x1d91b0[_0xc9d6('0x56')](_0x206b90[_0xc9d6('0x36')][_0xc9d6('0x54')])['then'](function(){if(_[_0xc9d6('0x57')](_0x206b90[_0xc9d6('0x36')]['ids'])){for(var _0x5422b4=0x0;_0x5422b4<_0x206b90[_0xc9d6('0x36')]['ids']['length'];_0x5422b4+=0x1){socket[_0xc9d6('0x58')]('userSquareProject:remove',{'UserId':Number(_0x206b90[_0xc9d6('0x36')][_0xc9d6('0x54')][_0x5422b4]),'SquareProjectId':Number(_0x206b90['params']['id'])});}}else{socket['emit'](_0xc9d6('0x59'),{'UserId':Number(_0x206b90['query']['ids']),'SquareProjectId':Number(_0x206b90['params']['id'])});}});}})[_0xc9d6('0x28')](respondWithStatusCode(_0x51b4fc,null))[_0xc9d6('0x47')](handleError(_0x51b4fc,null));};exports[_0xc9d6('0x5a')]=function(_0x5e170e,_0x587e68,_0x39edf1){var _0x4bc10c={};var _0x3d6c7e={};var _0x4728a6;var _0x3c8c38;return db['SquareProject'][_0xc9d6('0x5b')]({'where':{'id':_0x5e170e[_0xc9d6('0x49')]['id']}})[_0xc9d6('0x28')](handleEntityNotFound(_0x587e68,null))[_0xc9d6('0x28')](function(_0x483972){if(_0x483972){_0x4728a6=_0x483972;_0x3d6c7e['model']=_[_0xc9d6('0x35')](db[_0xc9d6('0x5c')]['rawAttributes']);_0x3d6c7e['query']=_[_0xc9d6('0x35')](_0x5e170e[_0xc9d6('0x36')]);_0x3d6c7e[_0xc9d6('0x37')]=_[_0xc9d6('0x38')](_0x3d6c7e[_0xc9d6('0x34')],_0x3d6c7e[_0xc9d6('0x36')]);_0x4bc10c[_0xc9d6('0x3a')]=_['intersection'](_0x3d6c7e[_0xc9d6('0x34')],qs[_0xc9d6('0x39')](_0x5e170e['query']['fields']));_0x4bc10c[_0xc9d6('0x3a')]=_0x4bc10c['attributes'][_0xc9d6('0x3b')]?_0x4bc10c[_0xc9d6('0x3a')]:_0x3d6c7e[_0xc9d6('0x34')];_0x4bc10c[_0xc9d6('0x5d')]=qs[_0xc9d6('0x5e')](_0x5e170e[_0xc9d6('0x36')][_0xc9d6('0x5e')]);_0x4bc10c['where']=qs['filters'](_['pick'](_0x5e170e['query'],_0x3d6c7e[_0xc9d6('0x37')]));if(_0x5e170e[_0xc9d6('0x36')][_0xc9d6('0x3f')]){_0x4bc10c[_0xc9d6('0x3e')]=_[_0xc9d6('0x40')](_0x4bc10c['where'],{'$or':_['map'](_0x4bc10c[_0xc9d6('0x3a')],function(_0x464b33){var _0x31aca1={};_0x31aca1[_0x464b33]={'$like':'%'+_0x5e170e[_0xc9d6('0x36')][_0xc9d6('0x3f')]+'%'};return _0x31aca1;})});}_0x4bc10c=_[_0xc9d6('0x40')]({},_0x4bc10c,_0x5e170e[_0xc9d6('0x41')]);return _0x4728a6[_0xc9d6('0x5a')](_0x4bc10c);}})['then'](function(_0x402e75){if(_0x402e75){_0x3c8c38=_0x402e75[_0xc9d6('0x3b')];if(!_0x5e170e[_0xc9d6('0x36')]['hasOwnProperty']('nolimit')){_0x4bc10c[_0xc9d6('0x23')]=qs[_0xc9d6('0x23')](_0x5e170e[_0xc9d6('0x36')]['limit']);_0x4bc10c[_0xc9d6('0x21')]=qs[_0xc9d6('0x21')](_0x5e170e[_0xc9d6('0x36')][_0xc9d6('0x21')]);}return _0x4728a6['getUsers'](_0x4bc10c);}})['then'](function(_0x5ce662){if(_0x5ce662){return _0x5ce662?{'count':_0x3c8c38,'rows':_0x5ce662}:null;}})[_0xc9d6('0x28')](respondWithResult(_0x587e68,null))[_0xc9d6('0x47')](handleError(_0x587e68,null));}; \ No newline at end of file +var _0xab7d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','SquareProjects','UserProfileResource','error','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','isArray','userSquareProject:remove','emit','findOne','getUsers','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xe0e4a9,_0x7d508e){var _0x3e8138=function(_0x4e39aa){while(--_0x4e39aa){_0xe0e4a9['push'](_0xe0e4a9['shift']());}};_0x3e8138(++_0x7d508e);}(_0xab7d,0x186));var _0xdab7=function(_0x668d58,_0x32b81c){_0x668d58=_0x668d58-0x0;var _0x5296f9=_0xab7d[_0x668d58];return _0x5296f9;};'use strict';var emlformat=require(_0xdab7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdab7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdab7('0x2'));var moment=require('moment');var BPromise=require(_0xdab7('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdab7('0x4'));var sox=require(_0xdab7('0x5'));var csv=require(_0xdab7('0x6'));var ejs=require(_0xdab7('0x7'));var fs=require('fs');var fs_extra=require(_0xdab7('0x8'));var _=require(_0xdab7('0x9'));var squel=require(_0xdab7('0xa'));var crypto=require(_0xdab7('0xb'));var jsforce=require(_0xdab7('0xc'));var deskjs=require(_0xdab7('0xd'));var toCsv=require(_0xdab7('0x6'));var querystring=require(_0xdab7('0xe'));var Papa=require(_0xdab7('0xf'));var Redis=require(_0xdab7('0x10'));var authService=require(_0xdab7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdab7('0x12'));var hardwareService=require(_0xdab7('0x13'));var logger=require(_0xdab7('0x14'))(_0xdab7('0x15'));var utils=require(_0xdab7('0x16'));var config=require(_0xdab7('0x17'));var licenseUtil=require(_0xdab7('0x18'));var db=require(_0xdab7('0x19'))['db'];config[_0xdab7('0x1a')]=_[_0xdab7('0x1b')](config[_0xdab7('0x1a')],{'host':_0xdab7('0x1c'),'port':0x18eb});var socket=require(_0xdab7('0x1d'))(new Redis(config[_0xdab7('0x1a')]));require(_0xdab7('0x1e'))[_0xdab7('0x1f')](socket);function respondWithStatusCode(_0x456851,_0x251470){_0x251470=_0x251470||0xcc;return function(_0x43a6c6){if(_0x43a6c6){return _0x456851[_0xdab7('0x20')](_0x251470);}return _0x456851[_0xdab7('0x21')](_0x251470)[_0xdab7('0x22')]();};}function respondWithResult(_0x3847ea,_0x26c837){_0x26c837=_0x26c837||0xc8;return function(_0x5d129d){if(_0x5d129d){return _0x3847ea[_0xdab7('0x21')](_0x26c837)[_0xdab7('0x23')](_0x5d129d);}};}function respondWithFilteredResult(_0x503b89,_0x2a799b){return function(_0x467e9f){if(_0x467e9f){var _0x1c3876=typeof _0x2a799b[_0xdab7('0x24')]===_0xdab7('0x25')&&typeof _0x2a799b['limit']===_0xdab7('0x25');var _0x4e06fc=_0x467e9f[_0xdab7('0x26')];var _0x55bafd=_0x1c3876?0x0:_0x2a799b[_0xdab7('0x24')];var _0x307692=_0x1c3876?_0x467e9f[_0xdab7('0x26')]:_0x2a799b[_0xdab7('0x24')]+_0x2a799b[_0xdab7('0x27')];var _0x19fd9f;if(_0x307692>=_0x4e06fc){_0x307692=_0x4e06fc;_0x19fd9f=0xc8;}else{_0x19fd9f=0xce;}_0x503b89[_0xdab7('0x21')](_0x19fd9f);return _0x503b89[_0xdab7('0x28')](_0xdab7('0x29'),_0x55bafd+'-'+_0x307692+'/'+_0x4e06fc)['json'](_0x467e9f);}return null;};}function patchUpdates(_0x12579b){return function(_0x518c0a){try{jsonpatch[_0xdab7('0x2a')](_0x518c0a,_0x12579b,!![]);}catch(_0x40d808){return BPromise[_0xdab7('0x2b')](_0x40d808);}return _0x518c0a[_0xdab7('0x2c')]();};}function saveUpdates(_0x4a21f0,_0x21e592){return function(_0x442698){if(_0x442698){return _0x442698['update'](_0x4a21f0)['then'](function(_0x2b7269){return _0x2b7269;});}return null;};}function removeEntity(_0x4e521b,_0x37fc65){return function(_0x3c6f22){if(_0x3c6f22){return _0x3c6f22[_0xdab7('0x2d')]()[_0xdab7('0x2e')](function(){var _0x220424=_0x3c6f22[_0xdab7('0x2f')]({'plain':!![]});var _0x448c8f=_0xdab7('0x30');return db[_0xdab7('0x31')]['destroy']({'where':{'type':_0x448c8f,'resourceId':_0x220424['id']}})['then'](function(){return _0x3c6f22;});})[_0xdab7('0x2e')](function(){_0x4e521b[_0xdab7('0x21')](0xcc)[_0xdab7('0x22')]();});}};}function handleEntityNotFound(_0x55ac86,_0x183d8d){return function(_0x46718c){if(!_0x46718c){_0x55ac86[_0xdab7('0x20')](0x194);}return _0x46718c;};}function handleError(_0x4b0cae,_0x46964a){_0x46964a=_0x46964a||0x1f4;return function(_0x97a048){logger[_0xdab7('0x32')](_0x97a048['stack']);if(_0x97a048[_0xdab7('0x33')]){delete _0x97a048['name'];}_0x4b0cae['status'](_0x46964a)[_0xdab7('0x34')](_0x97a048);};}exports[_0xdab7('0x35')]=function(_0x2a676d,_0x51edc9){var _0x4e3961={},_0x395258={},_0x5390aa={'count':0x0,'rows':[]};var _0x56f941=_[_0xdab7('0x36')](db[_0xdab7('0x37')][_0xdab7('0x38')],function(_0x201931){return{'name':_0x201931[_0xdab7('0x39')],'type':_0x201931[_0xdab7('0x3a')][_0xdab7('0x3b')]};});_0x395258[_0xdab7('0x3c')]=_[_0xdab7('0x36')](_0x56f941,_0xdab7('0x33'));_0x395258[_0xdab7('0x3d')]=_[_0xdab7('0x3e')](_0x2a676d[_0xdab7('0x3d')]);_0x395258[_0xdab7('0x3f')]=_[_0xdab7('0x40')](_0x395258[_0xdab7('0x3c')],_0x395258[_0xdab7('0x3d')]);_0x4e3961[_0xdab7('0x41')]=_[_0xdab7('0x40')](_0x395258['model'],qs[_0xdab7('0x42')](_0x2a676d['query'][_0xdab7('0x42')]));_0x4e3961[_0xdab7('0x41')]=_0x4e3961[_0xdab7('0x41')][_0xdab7('0x43')]?_0x4e3961[_0xdab7('0x41')]:_0x395258[_0xdab7('0x3c')];if(!_0x2a676d[_0xdab7('0x3d')][_0xdab7('0x44')](_0xdab7('0x45'))){_0x4e3961[_0xdab7('0x27')]=qs[_0xdab7('0x27')](_0x2a676d[_0xdab7('0x3d')][_0xdab7('0x27')]);_0x4e3961[_0xdab7('0x24')]=qs[_0xdab7('0x24')](_0x2a676d[_0xdab7('0x3d')][_0xdab7('0x24')]);}_0x4e3961[_0xdab7('0x46')]=qs[_0xdab7('0x47')](_0x2a676d['query'][_0xdab7('0x47')]);_0x4e3961[_0xdab7('0x48')]=qs['filters'](_[_0xdab7('0x49')](_0x2a676d['query'],_0x395258['filters']),_0x56f941);if(_0x2a676d['query'][_0xdab7('0x4a')]){_0x4e3961[_0xdab7('0x48')]=_[_0xdab7('0x4b')](_0x4e3961[_0xdab7('0x48')],{'$or':_[_0xdab7('0x36')](_0x56f941,function(_0x65b937){if(_0x65b937[_0xdab7('0x3a')]!=='VIRTUAL'){var _0x4b2d01={};_0x4b2d01[_0x65b937[_0xdab7('0x33')]]={'$like':'%'+_0x2a676d[_0xdab7('0x3d')][_0xdab7('0x4a')]+'%'};return _0x4b2d01;}})});}_0x4e3961=_[_0xdab7('0x4b')]({},_0x4e3961,_0x2a676d[_0xdab7('0x4c')]);var _0x121243={'where':_0x4e3961['where']};return db[_0xdab7('0x37')][_0xdab7('0x26')](_0x121243)['then'](function(_0x342c09){_0x5390aa[_0xdab7('0x26')]=_0x342c09;if(_0x2a676d[_0xdab7('0x3d')][_0xdab7('0x4d')]){_0x4e3961[_0xdab7('0x4e')]=[{'all':!![]}];}return db[_0xdab7('0x37')][_0xdab7('0x4f')](_0x4e3961);})[_0xdab7('0x2e')](function(_0x30644f){_0x5390aa[_0xdab7('0x50')]=_0x30644f;return _0x5390aa;})[_0xdab7('0x2e')](respondWithFilteredResult(_0x51edc9,_0x4e3961))[_0xdab7('0x51')](handleError(_0x51edc9,null));};exports[_0xdab7('0x52')]=function(_0x10c665,_0x4b7b4c){var _0x290588={'raw':![],'where':{'id':_0x10c665[_0xdab7('0x53')]['id']}},_0x448677={};_0x448677['model']=_[_0xdab7('0x3e')](db['SquareProject'][_0xdab7('0x38')]);_0x448677[_0xdab7('0x3d')]=_[_0xdab7('0x3e')](_0x10c665['query']);_0x448677['filters']=_[_0xdab7('0x40')](_0x448677[_0xdab7('0x3c')],_0x448677['query']);_0x290588[_0xdab7('0x41')]=_['intersection'](_0x448677[_0xdab7('0x3c')],qs[_0xdab7('0x42')](_0x10c665[_0xdab7('0x3d')][_0xdab7('0x42')]));_0x290588[_0xdab7('0x41')]=_0x290588[_0xdab7('0x41')]['length']?_0x290588[_0xdab7('0x41')]:_0x448677[_0xdab7('0x3c')];if(_0x10c665['query']['includeAll']){_0x290588[_0xdab7('0x4e')]=[{'all':!![]}];}_0x290588=_[_0xdab7('0x4b')]({},_0x290588,_0x10c665[_0xdab7('0x4c')]);return db[_0xdab7('0x37')]['find'](_0x290588)['then'](handleEntityNotFound(_0x4b7b4c,null))['then'](respondWithResult(_0x4b7b4c,null))[_0xdab7('0x51')](handleError(_0x4b7b4c,null));};exports[_0xdab7('0x54')]=function(_0x152810,_0x2db07e){return db[_0xdab7('0x37')][_0xdab7('0x54')](_0x152810[_0xdab7('0x55')],{})[_0xdab7('0x2e')](function(_0x1d7c5e){var _0x2fc76a=_0x152810['user'][_0xdab7('0x2f')]({'plain':!![]});if(!_0x2fc76a)throw new Error(_0xdab7('0x56'));if(_0x2fc76a['role']===_0xdab7('0x57')){var _0xe81bc2=_0x1d7c5e[_0xdab7('0x2f')]({'plain':!![]});var _0x33385a=_0xdab7('0x30');return db[_0xdab7('0x58')][_0xdab7('0x59')]({'where':{'name':_0x33385a,'userProfileId':_0x2fc76a[_0xdab7('0x5a')]},'raw':!![]})[_0xdab7('0x2e')](function(_0x4b87df){if(_0x4b87df&&_0x4b87df[_0xdab7('0x5b')]===0x0){return db[_0xdab7('0x31')]['create']({'name':_0xe81bc2[_0xdab7('0x33')],'resourceId':_0xe81bc2['id'],'type':_0x4b87df[_0xdab7('0x33')],'sectionId':_0x4b87df['id']},{})[_0xdab7('0x2e')](function(){return _0x1d7c5e;});}else{return _0x1d7c5e;}})[_0xdab7('0x51')](function(_0x3fb9b1){logger[_0xdab7('0x32')](_0xdab7('0x5c'),_0x3fb9b1);throw _0x3fb9b1;});}return _0x1d7c5e;})[_0xdab7('0x2e')](respondWithResult(_0x2db07e,0xc9))[_0xdab7('0x51')](handleError(_0x2db07e,null));};exports[_0xdab7('0x5d')]=function(_0x143fbf,_0x1a2332){if(_0x143fbf[_0xdab7('0x55')]['id']){delete _0x143fbf[_0xdab7('0x55')]['id'];}return db[_0xdab7('0x37')]['find']({'where':{'id':_0x143fbf[_0xdab7('0x53')]['id']}})[_0xdab7('0x2e')](handleEntityNotFound(_0x1a2332,null))[_0xdab7('0x2e')](saveUpdates(_0x143fbf[_0xdab7('0x55')],null))[_0xdab7('0x2e')](respondWithResult(_0x1a2332,null))[_0xdab7('0x51')](handleError(_0x1a2332,null));};exports[_0xdab7('0x2d')]=function(_0x332c86,_0x322e4b){return db[_0xdab7('0x37')][_0xdab7('0x59')]({'where':{'id':_0x332c86['params']['id']}})[_0xdab7('0x2e')](handleEntityNotFound(_0x322e4b,null))[_0xdab7('0x2e')](removeEntity(_0x322e4b,null))[_0xdab7('0x51')](handleError(_0x322e4b,null));};exports[_0xdab7('0x5e')]=function(_0x559176,_0x27213f,_0x3091bd){return db[_0xdab7('0x37')][_0xdab7('0x59')]({'where':{'id':_0x559176[_0xdab7('0x53')]['id']}})['then'](handleEntityNotFound(_0x27213f,null))[_0xdab7('0x2e')](function(_0x4c4ba5){if(_0x4c4ba5){return _0x4c4ba5[_0xdab7('0x5e')](_0x559176[_0xdab7('0x55')][_0xdab7('0x5f')],_[_0xdab7('0x60')](_0x559176[_0xdab7('0x55')],[_0xdab7('0x5f'),'id'])||{});}})[_0xdab7('0x2e')](respondWithResult(_0x27213f,null))[_0xdab7('0x51')](handleError(_0x27213f,null));};exports['removeUsers']=function(_0x23cf3a,_0x322b52,_0x4aea4d){return db[_0xdab7('0x37')][_0xdab7('0x59')]({'where':{'id':_0x23cf3a[_0xdab7('0x53')]['id']}})[_0xdab7('0x2e')](handleEntityNotFound(_0x322b52,null))['then'](function(_0x588d02){if(_0x588d02){return _0x588d02['removeUsers'](_0x23cf3a[_0xdab7('0x3d')]['ids'])[_0xdab7('0x2e')](function(){if(_[_0xdab7('0x61')](_0x23cf3a[_0xdab7('0x3d')][_0xdab7('0x5f')])){for(var _0x3acb9f=0x0;_0x3acb9f<_0x23cf3a[_0xdab7('0x3d')][_0xdab7('0x5f')][_0xdab7('0x43')];_0x3acb9f+=0x1){socket['emit'](_0xdab7('0x62'),{'UserId':Number(_0x23cf3a[_0xdab7('0x3d')][_0xdab7('0x5f')][_0x3acb9f]),'SquareProjectId':Number(_0x23cf3a[_0xdab7('0x53')]['id'])});}}else{socket[_0xdab7('0x63')](_0xdab7('0x62'),{'UserId':Number(_0x23cf3a[_0xdab7('0x3d')][_0xdab7('0x5f')]),'SquareProjectId':Number(_0x23cf3a['params']['id'])});}});}})[_0xdab7('0x2e')](respondWithStatusCode(_0x322b52,null))[_0xdab7('0x51')](handleError(_0x322b52,null));};exports['getUsers']=function(_0x1d238d,_0x35bf22,_0x5a9a64){var _0x5b4516={};var _0x2af507={};var _0x4c3a96;var _0x111660;return db['SquareProject'][_0xdab7('0x64')]({'where':{'id':_0x1d238d['params']['id']}})[_0xdab7('0x2e')](handleEntityNotFound(_0x35bf22,null))[_0xdab7('0x2e')](function(_0x5164a9){if(_0x5164a9){_0x4c3a96=_0x5164a9;_0x2af507[_0xdab7('0x3c')]=_[_0xdab7('0x3e')](db['User'][_0xdab7('0x38')]);_0x2af507[_0xdab7('0x3d')]=_[_0xdab7('0x3e')](_0x1d238d['query']);_0x2af507[_0xdab7('0x3f')]=_['intersection'](_0x2af507[_0xdab7('0x3c')],_0x2af507[_0xdab7('0x3d')]);_0x5b4516['attributes']=_[_0xdab7('0x40')](_0x2af507[_0xdab7('0x3c')],qs[_0xdab7('0x42')](_0x1d238d[_0xdab7('0x3d')]['fields']));_0x5b4516[_0xdab7('0x41')]=_0x5b4516[_0xdab7('0x41')]['length']?_0x5b4516[_0xdab7('0x41')]:_0x2af507[_0xdab7('0x3c')];_0x5b4516[_0xdab7('0x46')]=qs[_0xdab7('0x47')](_0x1d238d['query'][_0xdab7('0x47')]);_0x5b4516['where']=qs[_0xdab7('0x3f')](_[_0xdab7('0x49')](_0x1d238d[_0xdab7('0x3d')],_0x2af507[_0xdab7('0x3f')]));if(_0x1d238d[_0xdab7('0x3d')][_0xdab7('0x4a')]){_0x5b4516[_0xdab7('0x48')]=_[_0xdab7('0x4b')](_0x5b4516[_0xdab7('0x48')],{'$or':_[_0xdab7('0x36')](_0x5b4516[_0xdab7('0x41')],function(_0x11bfc8){var _0x152d4e={};_0x152d4e[_0x11bfc8]={'$like':'%'+_0x1d238d[_0xdab7('0x3d')][_0xdab7('0x4a')]+'%'};return _0x152d4e;})});}_0x5b4516=_[_0xdab7('0x4b')]({},_0x5b4516,_0x1d238d[_0xdab7('0x4c')]);return _0x4c3a96[_0xdab7('0x65')](_0x5b4516);}})[_0xdab7('0x2e')](function(_0x209c77){if(_0x209c77){_0x111660=_0x209c77['length'];if(!_0x1d238d[_0xdab7('0x3d')][_0xdab7('0x44')](_0xdab7('0x45'))){_0x5b4516['limit']=qs[_0xdab7('0x27')](_0x1d238d[_0xdab7('0x3d')][_0xdab7('0x27')]);_0x5b4516[_0xdab7('0x24')]=qs[_0xdab7('0x24')](_0x1d238d[_0xdab7('0x3d')]['offset']);}return _0x4c3a96[_0xdab7('0x65')](_0x5b4516);}})[_0xdab7('0x2e')](function(_0x2cc245){if(_0x2cc245){return _0x2cc245?{'count':_0x111660,'rows':_0x2cc245}:null;}})[_0xdab7('0x2e')](respondWithResult(_0x35bf22,null))[_0xdab7('0x51')](handleError(_0x35bf22,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index c8d768a..0dfcbae 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 _0xc049=['hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc049,0xcb));var _0x9c04=function(_0x2e9e58,_0x537117){_0x2e9e58=_0x2e9e58-0x0;var _0x4e8ad2=_0xc049[_0x2e9e58];return _0x4e8ad2;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x9c04('0x0'))['db'][_0x9c04('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x9c04('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9c04('0x3')};function emitEvent(_0x189fa0){return function(_0xde07c6,_0x16b0be,_0x1bff98){SquareProjectEvents['emit'](_0x189fa0+':'+_0xde07c6['id'],_0xde07c6);SquareProjectEvents[_0x9c04('0x4')](_0x189fa0,_0xde07c6);_0x1bff98(null);};}for(var e in events){if(events[_0x9c04('0x5')](e)){var event=events[e];SquareProject[_0x9c04('0x6')](e,emitEvent(event));}}module[_0x9c04('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xa038=['SquareProject','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x35ed3e,_0x124cb2){var _0x5d09b0=function(_0x525807){while(--_0x525807){_0x35ed3e['push'](_0x35ed3e['shift']());}};_0x5d09b0(++_0x124cb2);}(_0xa038,0x76));var _0x8a03=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa038[_0x2aea9e];return _0x430b92;};'use strict';var EventEmitter=require(_0x8a03('0x0'));var SquareProject=require(_0x8a03('0x1'))['db'][_0x8a03('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8a03('0x3')](0x0);var events={'afterCreate':_0x8a03('0x4'),'afterUpdate':_0x8a03('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22e744){return function(_0x5a804d,_0x3bb2e6,_0x4cef33){SquareProjectEvents[_0x8a03('0x6')](_0x22e744+':'+_0x5a804d['id'],_0x5a804d);SquareProjectEvents[_0x8a03('0x6')](_0x22e744,_0x5a804d);_0x4cef33(null);};}for(var e in events){if(events[_0x8a03('0x7')](e)){var event=events[e];SquareProject[_0x8a03('0x8')](e,emitEvent(event));}}module[_0x8a03('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index b568059..e4fbf3c 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 _0xb567=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','../../config/logger','api'];(function(_0x205081,_0x46c72d){var _0x8b1110=function(_0x454a6b){while(--_0x454a6b){_0x205081['push'](_0x205081['shift']());}};_0x8b1110(++_0x46c72d);}(_0xb567,0x11d));var _0x7b56=function(_0x33dd81,_0x3de8d9){_0x33dd81=_0x33dd81-0x0;var _0x3aceb7=_0xb567[_0x33dd81];return _0x3aceb7;};'use strict';var _=require(_0x7b56('0x0'));var util=require('util');var logger=require(_0x7b56('0x1'))(_0x7b56('0x2'));var moment=require(_0x7b56('0x3'));var BPromise=require(_0x7b56('0x4'));var rp=require(_0x7b56('0x5'));var fs=require('fs');var path=require(_0x7b56('0x6'));var rimraf=require(_0x7b56('0x7'));var config=require(_0x7b56('0x8'));var attributes=require(_0x7b56('0x9'));module[_0x7b56('0xa')]=function(_0x159f12,_0x4ec385){return _0x159f12[_0x7b56('0xb')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c1fcd,_0x33f4f4,_0x481c30){if(_0x1c1fcd[_0x7b56('0xc')]('preproduction')){_0x1c1fcd[_0x7b56('0xd')]=moment()['format'](_0x7b56('0xe'));}if(_0x1c1fcd[_0x7b56('0xc')](_0x7b56('0xf'))){_0x1c1fcd[_0x7b56('0x10')]=moment()[_0x7b56('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x481c30(null,_0x1c1fcd);}}});}; \ No newline at end of file +var _0x0ef2=['rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x267484,_0x3eb131){var _0x14a356=function(_0x54703b){while(--_0x54703b){_0x267484['push'](_0x267484['shift']());}};_0x14a356(++_0x3eb131);}(_0x0ef2,0x71));var _0x20ef=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x0ef2[_0x277fa3];return _0x2e4520;};'use strict';var _=require(_0x20ef('0x0'));var util=require(_0x20ef('0x1'));var logger=require('../../config/logger')(_0x20ef('0x2'));var moment=require(_0x20ef('0x3'));var BPromise=require(_0x20ef('0x4'));var rp=require(_0x20ef('0x5'));var fs=require('fs');var path=require(_0x20ef('0x6'));var rimraf=require(_0x20ef('0x7'));var config=require(_0x20ef('0x8'));var attributes=require(_0x20ef('0x9'));module[_0x20ef('0xa')]=function(_0xd7ada2,_0x18c30f){return _0xd7ada2[_0x20ef('0xb')]('SquareProject',attributes,{'tableName':_0x20ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5238c9,_0x96793b,_0x16338f){if(_0x5238c9[_0x20ef('0xd')](_0x20ef('0xe'))){_0x5238c9[_0x20ef('0xf')]=moment()[_0x20ef('0x10')](_0x20ef('0x11'));}if(_0x5238c9[_0x20ef('0xd')](_0x20ef('0x12'))){_0x5238c9[_0x20ef('0x13')]=moment()[_0x20ef('0x10')](_0x20ef('0x11'));}_0x16338f(null,_0x5238c9);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index df9b404..9658a7a 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 _0x669b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','SquareProject','find','options','where','attributes','include','map','model','ShowSquareProject','lodash','util','moment','bluebird','randomstring'];(function(_0x301a05,_0x426e70){var _0x126e91=function(_0x2e411a){while(--_0x2e411a){_0x301a05['push'](_0x301a05['shift']());}};_0x126e91(++_0x426e70);}(_0x669b,0x1cf));var _0xb669=function(_0x4b6580,_0x14054f){_0x4b6580=_0x4b6580-0x0;var _0x40ccc4=_0x669b[_0x4b6580];return _0x40ccc4;};'use strict';var _=require(_0xb669('0x0'));var util=require(_0xb669('0x1'));var moment=require(_0xb669('0x2'));var BPromise=require(_0xb669('0x3'));var rs=require(_0xb669('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb669('0x5'))['db'];var utils=require(_0xb669('0x6'));var logger=require(_0xb669('0x7'))(_0xb669('0x8'));var config=require('../../config/environment');var jayson=require(_0xb669('0x9'));var client=jayson[_0xb669('0xa')][_0xb669('0xb')]({'port':0x232a});config[_0xb669('0xc')]=_[_0xb669('0xd')](config[_0xb669('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb669('0xe'))(new Redis(config[_0xb669('0xc')]));require(_0xb669('0xf'))[_0xb669('0x10')](socket);function respondWithRpcPromise(_0x13c4d3,_0x1784d0,_0x48ab55){return new BPromise(function(_0x4b1f01,_0x3b9aac){return client[_0xb669('0x11')](_0x13c4d3,_0x48ab55)[_0xb669('0x12')](function(_0x5731f2){logger[_0xb669('0x13')]('SquareProject,\x20%s,\x20%s',_0x1784d0,_0xb669('0x14'));logger[_0xb669('0x15')](_0xb669('0x16'),_0x1784d0,'request\x20sent',JSON[_0xb669('0x17')](_0x5731f2));if(_0x5731f2[_0xb669('0x18')]){if(_0x5731f2[_0xb669('0x18')][_0xb669('0x19')]===0x1f4){logger[_0xb669('0x18')]('SquareProject,\x20%s,\x20%s',_0x1784d0,_0x5731f2[_0xb669('0x18')][_0xb669('0x1a')]);return _0x3b9aac(_0x5731f2['error']['message']);}logger['error'](_0xb669('0x1b'),_0x1784d0,_0x5731f2['error'][_0xb669('0x1a')]);return _0x4b1f01(_0x5731f2[_0xb669('0x18')][_0xb669('0x1a')]);}else{logger[_0xb669('0x13')]('SquareProject,\x20%s,\x20%s',_0x1784d0,'request\x20sent');_0x4b1f01(_0x5731f2[_0xb669('0x1c')]['message']);}})[_0xb669('0x1d')](function(_0x3cc84e){logger[_0xb669('0x18')]('SquareProject,\x20%s,\x20%s',_0x1784d0,_0x3cc84e);_0x3b9aac(_0x3cc84e);});});}exports['ShowSquareProject']=function(_0x3c1404){var _0x222604=this;return new Promise(function(_0x2bd7ff,_0x19498b){return db[_0xb669('0x1e')][_0xb669('0x1f')]({'raw':_0x3c1404['options']?_0x3c1404[_0xb669('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3c1404['options']?_0x3c1404['options'][_0xb669('0x21')]||null:null,'attributes':_0x3c1404[_0xb669('0x20')]?_0x3c1404[_0xb669('0x20')][_0xb669('0x22')]||null:null,'include':_0x3c1404[_0xb669('0x20')]?_0x3c1404['options'][_0xb669('0x23')]?_[_0xb669('0x24')](_0x3c1404['options'][_0xb669('0x23')],function(_0x2f8ff9){return{'model':db[_0x2f8ff9['model']],'as':_0x2f8ff9['as'],'attributes':_0x2f8ff9['attributes'],'include':_0x2f8ff9[_0xb669('0x23')]?_[_0xb669('0x24')](_0x2f8ff9[_0xb669('0x23')],function(_0x192204){return{'model':db[_0x192204[_0xb669('0x25')]],'as':_0x192204['as'],'attributes':_0x192204['attributes'],'include':_0x192204[_0xb669('0x23')]?_[_0xb669('0x24')](_0x192204[_0xb669('0x23')],function(_0x3de913){return{'model':db[_0x3de913[_0xb669('0x25')]],'as':_0x3de913['as'],'attributes':_0x3de913[_0xb669('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb669('0x12')](function(_0x41e920){logger[_0xb669('0x13')](_0xb669('0x26'),_0x3c1404);logger[_0xb669('0x15')](_0xb669('0x26'),_0x3c1404,JSON['stringify'](_0x41e920));_0x2bd7ff(_0x41e920);})[_0xb669('0x1d')](function(_0x13405a){logger[_0xb669('0x18')](_0xb669('0x26'),_0x13405a['message'],_0x3c1404);_0x19498b(_0x222604['error'](0x1f4,_0x13405a[_0xb669('0x1a')]));});});}; \ No newline at end of file +var _0x4e09=['register','request','then','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','ShowSquareProject','SquareProject','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','./squareProject.socket'];(function(_0xb10681,_0x3c296b){var _0x9564d3=function(_0x354841){while(--_0x354841){_0xb10681['push'](_0xb10681['shift']());}};_0x9564d3(++_0x3c296b);}(_0x4e09,0x159));var _0x94e0=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4e09[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x94e0('0x0'));var util=require(_0x94e0('0x1'));var moment=require(_0x94e0('0x2'));var BPromise=require(_0x94e0('0x3'));var rs=require(_0x94e0('0x4'));var fs=require('fs');var Redis=require(_0x94e0('0x5'));var db=require(_0x94e0('0x6'))['db'];var utils=require(_0x94e0('0x7'));var logger=require('../../config/logger')(_0x94e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x94e0('0x9'));var client=jayson[_0x94e0('0xa')][_0x94e0('0xb')]({'port':0x232a});config[_0x94e0('0xc')]=_[_0x94e0('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94e0('0xc')]));require(_0x94e0('0xe'))[_0x94e0('0xf')](socket);function respondWithRpcPromise(_0x9851ef,_0x51dfda,_0x4c2b3b){return new BPromise(function(_0x5559a4,_0x448f59){return client[_0x94e0('0x10')](_0x9851ef,_0x4c2b3b)[_0x94e0('0x11')](function(_0x4dabf6){logger['info'](_0x94e0('0x12'),_0x51dfda,'request\x20sent');logger[_0x94e0('0x13')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x51dfda,_0x94e0('0x14'),JSON[_0x94e0('0x15')](_0x4dabf6));if(_0x4dabf6[_0x94e0('0x16')]){if(_0x4dabf6[_0x94e0('0x16')][_0x94e0('0x17')]===0x1f4){logger[_0x94e0('0x16')](_0x94e0('0x12'),_0x51dfda,_0x4dabf6[_0x94e0('0x16')]['message']);return _0x448f59(_0x4dabf6[_0x94e0('0x16')][_0x94e0('0x18')]);}logger[_0x94e0('0x16')](_0x94e0('0x12'),_0x51dfda,_0x4dabf6[_0x94e0('0x16')][_0x94e0('0x18')]);return _0x5559a4(_0x4dabf6[_0x94e0('0x16')][_0x94e0('0x18')]);}else{logger[_0x94e0('0x19')](_0x94e0('0x12'),_0x51dfda,_0x94e0('0x14'));_0x5559a4(_0x4dabf6['result']['message']);}})[_0x94e0('0x1a')](function(_0x7ca1c){logger['error']('SquareProject,\x20%s,\x20%s',_0x51dfda,_0x7ca1c);_0x448f59(_0x7ca1c);});});}exports[_0x94e0('0x1b')]=function(_0x160097){var _0x2fa57b=this;return new Promise(function(_0x5d7c52,_0x437123){return db[_0x94e0('0x1c')][_0x94e0('0x1d')]({'raw':_0x160097[_0x94e0('0x1e')]?_0x160097[_0x94e0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x160097[_0x94e0('0x1e')]?_0x160097['options'][_0x94e0('0x1f')]||null:null,'attributes':_0x160097[_0x94e0('0x1e')]?_0x160097[_0x94e0('0x1e')][_0x94e0('0x20')]||null:null,'include':_0x160097[_0x94e0('0x1e')]?_0x160097[_0x94e0('0x1e')][_0x94e0('0x21')]?_[_0x94e0('0x22')](_0x160097[_0x94e0('0x1e')][_0x94e0('0x21')],function(_0x343758){return{'model':db[_0x343758[_0x94e0('0x23')]],'as':_0x343758['as'],'attributes':_0x343758['attributes'],'include':_0x343758['include']?_[_0x94e0('0x22')](_0x343758[_0x94e0('0x21')],function(_0xe27a9d){return{'model':db[_0xe27a9d['model']],'as':_0xe27a9d['as'],'attributes':_0xe27a9d[_0x94e0('0x20')],'include':_0xe27a9d[_0x94e0('0x21')]?_[_0x94e0('0x22')](_0xe27a9d[_0x94e0('0x21')],function(_0x2dc59b){return{'model':db[_0x2dc59b[_0x94e0('0x23')]],'as':_0x2dc59b['as'],'attributes':_0x2dc59b[_0x94e0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x94e0('0x11')](function(_0x71cd7f){logger[_0x94e0('0x19')](_0x94e0('0x1b'),_0x160097);logger[_0x94e0('0x13')](_0x94e0('0x1b'),_0x160097,JSON[_0x94e0('0x15')](_0x71cd7f));_0x5d7c52(_0x71cd7f);})['catch'](function(_0x4968df){logger['error'](_0x94e0('0x1b'),_0x4968df[_0x94e0('0x18')],_0x160097);_0x437123(_0x2fa57b['error'](0x1f4,_0x4968df[_0x94e0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index affd7ad..4a4e8a5 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 _0x996e=['removeListener','register','length','squareProject:','./squareProject.events','update'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x996e,0x112));var _0xe996=function(_0x5ed095,_0x8bd025){_0x5ed095=_0x5ed095-0x0;var _0x2a685e=_0x996e[_0x5ed095];return _0x2a685e;};'use strict';var SquareProjectEvents=require(_0xe996('0x0'));var events=['save','remove',_0xe996('0x1')];function createListener(_0xfff0c0,_0x55bd81){return function(_0x5ecc7a){_0x55bd81['emit'](_0xfff0c0,_0x5ecc7a);};}function removeListener(_0x1edc94,_0x5c21eb){return function(){SquareProjectEvents[_0xe996('0x2')](_0x1edc94,_0x5c21eb);};}exports[_0xe996('0x3')]=function(_0x5440ec){for(var _0x4ae2bf=0x0,_0x26ce92=events[_0xe996('0x4')];_0x4ae2bf<_0x26ce92;_0x4ae2bf++){var _0x9c7068=events[_0x4ae2bf];var _0x27e3cb=createListener(_0xe996('0x5')+_0x9c7068,_0x5440ec);SquareProjectEvents['on'](_0x9c7068,_0x27e3cb);}}; \ No newline at end of file +var _0xc6f3=['save','remove','update','removeListener','register','length','squareProject:'];(function(_0x1ee88f,_0x28c7ab){var _0x4b5ce8=function(_0x5f05b6){while(--_0x5f05b6){_0x1ee88f['push'](_0x1ee88f['shift']());}};_0x4b5ce8(++_0x28c7ab);}(_0xc6f3,0x70));var _0x3c6f=function(_0x337d97,_0x19c381){_0x337d97=_0x337d97-0x0;var _0x53aa89=_0xc6f3[_0x337d97];return _0x53aa89;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x3c6f('0x0'),_0x3c6f('0x1'),_0x3c6f('0x2')];function createListener(_0x25bc32,_0x422b02){return function(_0x139767){_0x422b02['emit'](_0x25bc32,_0x139767);};}function removeListener(_0x424995,_0x479f68){return function(){SquareProjectEvents[_0x3c6f('0x3')](_0x424995,_0x479f68);};}exports[_0x3c6f('0x4')]=function(_0x1e381e){for(var _0x4bc1a8=0x0,_0x3fe3a5=events[_0x3c6f('0x5')];_0x4bc1a8<_0x3fe3a5;_0x4bc1a8++){var _0x596592=events[_0x4bc1a8];var _0x1aacfd=createListener(_0x3c6f('0x6')+_0x596592,_0x1e381e);SquareProjectEvents['on'](_0x596592,_0x1aacfd);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 626d094..1cc752c 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 _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7b554d,_0x5add77){var _0x54d818=function(_0x241971){while(--_0x241971){_0x7b554d['push'](_0x7b554d['shift']());}};_0x54d818(++_0x5add77);}(_0xf494,0x1c6));var _0x4f49=function(_0x43463f,_0x3a5f81){_0x43463f=_0x43463f-0x0;var _0x39631=_0xf494[_0x43463f];return _0x39631;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file +var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x550180,_0x41edc4){var _0x51c06f=function(_0x50ee12){while(--_0x50ee12){_0x550180['push'](_0x550180['shift']());}};_0x51c06f(++_0x41edc4);}(_0x1261,0x144));var _0x1126=function(_0x253946,_0x1c8d56){_0x253946=_0x253946-0x0;var _0x198cd6=_0x1261[_0x253946];return _0x198cd6;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index b98cf91..eb44fd0 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 _0x55ca=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0xe7ba9,_0x2ff262){var _0x34e6bd=function(_0x4b52e0){while(--_0x4b52e0){_0xe7ba9['push'](_0xe7ba9['shift']());}};_0x34e6bd(++_0x2ff262);}(_0x55ca,0x126));var _0xa55c=function(_0x251fa4,_0x3d5860){_0x251fa4=_0x251fa4-0x0;var _0x453047=_0x55ca[_0x251fa4];return _0x453047;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa55c('0x2')]},'extension':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'dnid':{'type':Sequelize[_0xa55c('0x2')]},'projectName':{'type':Sequelize[_0xa55c('0x2')]},'saveName':{'type':Sequelize[_0xa55c('0x2')]},'filename':{'type':Sequelize[_0xa55c('0x2')]},'savePath':{'type':Sequelize[_0xa55c('0x2')]},'format':{'type':Sequelize[_0xa55c('0x3')],'get':function(){var _0x4d0624='';var _0x2121fd=this[_0xa55c('0x4')]('savePath');if(_0x2121fd){_0x4d0624=_0x2121fd[_0xa55c('0x5')](_0x2121fd[_0xa55c('0x6')]('.'));}return _0x4d0624;}}}; \ No newline at end of file +var _0x5075=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x1927dc,_0x235225){var _0x4882dc=function(_0x419205){while(--_0x419205){_0x1927dc['push'](_0x1927dc['shift']());}};_0x4882dc(++_0x235225);}(_0x5075,0x73));var _0x5507=function(_0xb60ae4,_0x48b458){_0xb60ae4=_0xb60ae4-0x0;var _0x53d530=_0x5075[_0xb60ae4];return _0x53d530;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'uniqueid':{'type':Sequelize[_0x5507('0x2')]},'callerid':{'type':Sequelize[_0x5507('0x2')]},'calleridname':{'type':Sequelize[_0x5507('0x2')]},'context':{'type':Sequelize[_0x5507('0x2')]},'extension':{'type':Sequelize[_0x5507('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5507('0x2')]},'dnid':{'type':Sequelize[_0x5507('0x2')]},'projectName':{'type':Sequelize[_0x5507('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5507('0x2')]},'format':{'type':Sequelize[_0x5507('0x3')],'get':function(){var _0x4c2d6d='';var _0x42c232=this[_0x5507('0x4')](_0x5507('0x5'));if(_0x42c232){_0x4c2d6d=_0x42c232['substring'](_0x42c232['lastIndexOf']('.'));}return _0x4c2d6d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 1529884..924ce60 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 _0x985a=['end','offset','undefined','limit','count','json','apply','save','update','then','destroy','error','name','send','map','SquareRecording','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x985a,0xa1));var _0xa985=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x985a[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xa985('0x0'));var rimraf=require(_0xa985('0x1'));var zipdir=require(_0xa985('0x2'));var jsonpatch=require(_0xa985('0x3'));var rp=require(_0xa985('0x4'));var moment=require(_0xa985('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa985('0x6'));var path=require(_0xa985('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa985('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa985('0x9'));var squel=require(_0xa985('0xa'));var crypto=require(_0xa985('0xb'));var jsforce=require(_0xa985('0xc'));var deskjs=require(_0xa985('0xd'));var toCsv=require(_0xa985('0xe'));var querystring=require(_0xa985('0xf'));var Papa=require('papaparse');var Redis=require(_0xa985('0x10'));var authService=require(_0xa985('0x11'));var qs=require(_0xa985('0x12'));var as=require(_0xa985('0x13'));var hardwareService=require(_0xa985('0x14'));var logger=require(_0xa985('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa985('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaf6f67,_0x22271a){_0x22271a=_0x22271a||0xcc;return function(_0x3dfad7){if(_0x3dfad7){return _0xaf6f67[_0xa985('0x17')](_0x22271a);}return _0xaf6f67[_0xa985('0x18')](_0x22271a)[_0xa985('0x19')]();};}function respondWithResult(_0x44c41e,_0x32961b){_0x32961b=_0x32961b||0xc8;return function(_0x2a56db){if(_0x2a56db){return _0x44c41e[_0xa985('0x18')](_0x32961b)['json'](_0x2a56db);}};}function respondWithFilteredResult(_0x5c3c62,_0x4063aa){return function(_0x279a62){if(_0x279a62){var _0x21530b=typeof _0x4063aa[_0xa985('0x1a')]===_0xa985('0x1b')&&typeof _0x4063aa[_0xa985('0x1c')]===_0xa985('0x1b');var _0x3d1935=_0x279a62[_0xa985('0x1d')];var _0x2b1752=_0x21530b?0x0:_0x4063aa[_0xa985('0x1a')];var _0xf5d27c=_0x21530b?_0x279a62[_0xa985('0x1d')]:_0x4063aa[_0xa985('0x1a')]+_0x4063aa[_0xa985('0x1c')];var _0x2b4897;if(_0xf5d27c>=_0x3d1935){_0xf5d27c=_0x3d1935;_0x2b4897=0xc8;}else{_0x2b4897=0xce;}_0x5c3c62['status'](_0x2b4897);return _0x5c3c62['set']('Content-Range',_0x2b1752+'-'+_0xf5d27c+'/'+_0x3d1935)[_0xa985('0x1e')](_0x279a62);}return null;};}function patchUpdates(_0x90d8d){return function(_0x29ab5c){try{jsonpatch[_0xa985('0x1f')](_0x29ab5c,_0x90d8d,!![]);}catch(_0x5415e4){return BPromise['reject'](_0x5415e4);}return _0x29ab5c[_0xa985('0x20')]();};}function saveUpdates(_0x6a20f6,_0x458cd7){return function(_0x1e462f){if(_0x1e462f){return _0x1e462f[_0xa985('0x21')](_0x6a20f6)[_0xa985('0x22')](function(_0x477ca4){return _0x477ca4;});}return null;};}function removeEntity(_0x2a7517,_0x42d1f7){return function(_0x2aec0b){if(_0x2aec0b){return _0x2aec0b[_0xa985('0x23')]()['then'](function(){_0x2a7517[_0xa985('0x18')](0xcc)[_0xa985('0x19')]();});}};}function handleEntityNotFound(_0x591fb5,_0xd120e2){return function(_0x18b6f5){if(!_0x18b6f5){_0x591fb5['sendStatus'](0x194);}return _0x18b6f5;};}function handleError(_0x2b4722,_0xf99c33){_0xf99c33=_0xf99c33||0x1f4;return function(_0x4a55c6){logger[_0xa985('0x24')](_0x4a55c6['stack']);if(_0x4a55c6['name']){delete _0x4a55c6[_0xa985('0x25')];}_0x2b4722[_0xa985('0x18')](_0xf99c33)[_0xa985('0x26')](_0x4a55c6);};}exports['index']=function(_0x423aec,_0x2e75d5){var _0x52c0d1={},_0x6b3c1f={},_0xe3a9fa={'count':0x0,'rows':[]};var _0x3bcb2f=_[_0xa985('0x27')](db[_0xa985('0x28')]['rawAttributes'],function(_0x2ee029){return{'name':_0x2ee029[_0xa985('0x29')],'type':_0x2ee029[_0xa985('0x2a')][_0xa985('0x2b')]};});_0x6b3c1f[_0xa985('0x2c')]=_['map'](_0x3bcb2f,_0xa985('0x25'));_0x6b3c1f[_0xa985('0x2d')]=_['keys'](_0x423aec[_0xa985('0x2d')]);_0x6b3c1f['filters']=_[_0xa985('0x2e')](_0x6b3c1f[_0xa985('0x2c')],_0x6b3c1f[_0xa985('0x2d')]);_0x52c0d1[_0xa985('0x2f')]=_[_0xa985('0x2e')](_0x6b3c1f[_0xa985('0x2c')],qs[_0xa985('0x30')](_0x423aec[_0xa985('0x2d')][_0xa985('0x30')]));_0x52c0d1['attributes']=_0x52c0d1[_0xa985('0x2f')][_0xa985('0x31')]?_0x52c0d1[_0xa985('0x2f')]:_0x6b3c1f[_0xa985('0x2c')];if(!_0x423aec[_0xa985('0x2d')][_0xa985('0x32')](_0xa985('0x33'))){_0x52c0d1[_0xa985('0x1c')]=qs[_0xa985('0x1c')](_0x423aec[_0xa985('0x2d')][_0xa985('0x1c')]);_0x52c0d1[_0xa985('0x1a')]=qs[_0xa985('0x1a')](_0x423aec[_0xa985('0x2d')]['offset']);}_0x52c0d1[_0xa985('0x34')]=qs['sort'](_0x423aec['query'][_0xa985('0x35')]);_0x52c0d1[_0xa985('0x36')]=qs[_0xa985('0x37')](_[_0xa985('0x38')](_0x423aec['query'],_0x6b3c1f[_0xa985('0x37')]),_0x3bcb2f);if(_0x423aec[_0xa985('0x2d')]['filter']){_0x52c0d1[_0xa985('0x36')]=_[_0xa985('0x39')](_0x52c0d1[_0xa985('0x36')],{'$or':_[_0xa985('0x27')](_0x3bcb2f,function(_0x482fa7){if(_0x482fa7['type']!==_0xa985('0x3a')){var _0x1d72d9={};_0x1d72d9[_0x482fa7[_0xa985('0x25')]]={'$like':'%'+_0x423aec[_0xa985('0x2d')]['filter']+'%'};return _0x1d72d9;}})});}_0x52c0d1=_[_0xa985('0x39')]({},_0x52c0d1,_0x423aec[_0xa985('0x3b')]);var _0x1507ca={'where':_0x52c0d1[_0xa985('0x36')]};return db[_0xa985('0x28')][_0xa985('0x1d')](_0x1507ca)[_0xa985('0x22')](function(_0x17ca97){_0xe3a9fa['count']=_0x17ca97;if(_0x423aec[_0xa985('0x2d')][_0xa985('0x3c')]){_0x52c0d1[_0xa985('0x3d')]=[{'all':!![]}];}return db[_0xa985('0x28')]['findAll'](_0x52c0d1);})['then'](function(_0x508e10){_0xe3a9fa[_0xa985('0x3e')]=_0x508e10;return _0xe3a9fa;})['then'](respondWithFilteredResult(_0x2e75d5,_0x52c0d1))[_0xa985('0x3f')](handleError(_0x2e75d5,null));};exports[_0xa985('0x40')]=function(_0x435706,_0x5230d7){var _0x3f2c38={'raw':!![],'where':{'id':_0x435706[_0xa985('0x41')]['id']}},_0x4feed7={};_0x4feed7[_0xa985('0x2c')]=_[_0xa985('0x42')](db[_0xa985('0x28')][_0xa985('0x43')]);_0x4feed7[_0xa985('0x2d')]=_['keys'](_0x435706[_0xa985('0x2d')]);_0x4feed7[_0xa985('0x37')]=_['intersection'](_0x4feed7[_0xa985('0x2c')],_0x4feed7[_0xa985('0x2d')]);_0x3f2c38[_0xa985('0x2f')]=_['intersection'](_0x4feed7[_0xa985('0x2c')],qs[_0xa985('0x30')](_0x435706['query']['fields']));_0x3f2c38[_0xa985('0x2f')]=_0x3f2c38[_0xa985('0x2f')][_0xa985('0x31')]?_0x3f2c38['attributes']:_0x4feed7[_0xa985('0x2c')];if(_0x435706[_0xa985('0x2d')][_0xa985('0x3c')]){_0x3f2c38[_0xa985('0x3d')]=[{'all':!![]}];}_0x3f2c38=_[_0xa985('0x39')]({},_0x3f2c38,_0x435706['options']);return db['SquareRecording'][_0xa985('0x44')](_0x3f2c38)[_0xa985('0x22')](handleEntityNotFound(_0x5230d7,null))['then'](respondWithResult(_0x5230d7,null))['catch'](handleError(_0x5230d7,null));};exports[_0xa985('0x45')]=function(_0x43f339,_0x422875){return db[_0xa985('0x28')][_0xa985('0x45')](_0x43f339[_0xa985('0x46')],{})['then'](respondWithResult(_0x422875,0xc9))[_0xa985('0x3f')](handleError(_0x422875,null));};exports['update']=function(_0x28a9db,_0x4403c5){if(_0x28a9db[_0xa985('0x46')]['id']){delete _0x28a9db[_0xa985('0x46')]['id'];}return db[_0xa985('0x28')]['find']({'where':{'id':_0x28a9db['params']['id']}})[_0xa985('0x22')](handleEntityNotFound(_0x4403c5,null))[_0xa985('0x22')](saveUpdates(_0x28a9db[_0xa985('0x46')],null))[_0xa985('0x22')](respondWithResult(_0x4403c5,null))[_0xa985('0x3f')](handleError(_0x4403c5,null));};exports['download']=function(_0xec4d0f,_0xbe2cab,_0x5e0fb4){var _0x5f07b9=require(_0xa985('0x47'));var _0x755382=![];var _0x596788={};if(_0xec4d0f[_0xa985('0x2d')][_0xa985('0x2a')]&&_0xec4d0f[_0xa985('0x2d')][_0xa985('0x2a')]==='uniqueid'){_0x596788[_0xa985('0x48')]=_0xec4d0f[_0xa985('0x41')]['id'];}else{_0x596788['id']=_0xec4d0f[_0xa985('0x41')]['id'];}return db[_0xa985('0x28')]['find']({'where':_0x596788,'attributes':['id',_0xa985('0x49'),'filename'],'raw':!![]})[_0xa985('0x22')](handleEntityNotFound(_0xbe2cab,null))['then'](function(_0x4e271c){if(_0x4e271c){var _0x4f26bc=_0x4e271c['savePath'];var _0x345704=util[_0xa985('0x4a')](_0xa985('0x4b'),_0x4f26bc);if(fs[_0xa985('0x4c')](_0x345704)){_0x755382=!![];return _0x5f07b9['decryptFile'](_0x345704,_0x4f26bc,config[_0xa985('0x4d')][_0xa985('0x4e')])[_0xa985('0x22')](function(){return _0x4e271c;});}return _0x4e271c;}})[_0xa985('0x22')](function(_0x41b446){if(_0x41b446){var _0x2b4ec8=_0x41b446[_0xa985('0x49')];if(!fs['existsSync'](_0x2b4ec8)){throw new db[(_0xa985('0x4f'))][(_0xa985('0x50'))](_0xa985('0x51'));}if(_0x41b446['filename']){return _0xbe2cab[_0xa985('0x52')](_0x2b4ec8,_0x41b446['filename']+path[_0xa985('0x53')](_0x2b4ec8),function(){if(_0x755382){fs[_0xa985('0x54')](_0x2b4ec8);}});}else{return _0xbe2cab[_0xa985('0x52')](_0x2b4ec8,function(_0x2e99b9){if(_0x755382){fs[_0xa985('0x54')](_0x2b4ec8);}});}}})[_0xa985('0x3f')](function(_0xbb16d8){if(_0xbb16d8[_0xa985('0x55')]==='SquareRecording\x20not\x20found'){_0xbe2cab[_0xa985('0x18')](0x194)[_0xa985('0x26')](_0xa985('0x56'));}else{return handleError(_0xbe2cab,null);}});};exports[_0xa985('0x23')]=function(_0x42a8df,_0x1ebe87){return db['SquareRecording'][_0xa985('0x44')]({'where':{'id':_0x42a8df[_0xa985('0x41')]['id']}})[_0xa985('0x22')](function(_0x37f35c){if(_[_0xa985('0x57')](_0x37f35c)){throw new ReferenceError(_0xa985('0x58'));}return _0x37f35c;})['then'](function(_0xb191e0){var _0x4ae7db=_0xb191e0[_0xa985('0x49')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x4ae7db);if(!_[_0xa985('0x57')](_0xb191e0[_0xa985('0x49')])&&fs['existsSync'](_0x4ae7db)){logger['info'](_0xa985('0x59')+_0x4ae7db+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa985('0x5a')](_0x4ae7db);}_0x4ae7db=_0x4ae7db+_0xa985('0x5b');if(!_['isNil'](_0xb191e0[_0xa985('0x49')])&&fs[_0xa985('0x4c')](_0x4ae7db)){logger['info'](_0xa985('0x59')+_0x4ae7db+_0xa985('0x5c'));fs['unlinkSync'](_0x4ae7db);}return _0xb191e0;})['then'](function(_0x1f02cd){if(!_0x1f02cd)throw new InternalError();return _0x1f02cd[_0xa985('0x23')]();})[_0xa985('0x22')](function(){_0x1ebe87[_0xa985('0x18')](0xcc)[_0xa985('0x19')]();})[_0xa985('0x3f')](handleError(_0x1ebe87,null));}; \ No newline at end of file +var _0x1d80=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','key','model','map','query','attributes','intersection','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','keys','filters','fields','length','options','find','create','body','download','../../components/encryptor','uniqueid','filename','format','existsSync','decryptFile','secrets','savePath','Sequelize','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x216017,_0x29d7d8){var _0x41043f=function(_0x5d9f36){while(--_0x5d9f36){_0x216017['push'](_0x216017['shift']());}};_0x41043f(++_0x29d7d8);}(_0x1d80,0x182));var _0x01d8=function(_0x282a09,_0x2642fd){_0x282a09=_0x282a09-0x0;var _0xf075cc=_0x1d80[_0x282a09];return _0xf075cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01d8('0x0'));var zipdir=require(_0x01d8('0x1'));var jsonpatch=require(_0x01d8('0x2'));var rp=require(_0x01d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x01d8('0x4'));var util=require('util');var path=require(_0x01d8('0x5'));var sox=require(_0x01d8('0x6'));var csv=require('to-csv');var ejs=require(_0x01d8('0x7'));var fs=require('fs');var fs_extra=require(_0x01d8('0x8'));var _=require(_0x01d8('0x9'));var squel=require(_0x01d8('0xa'));var crypto=require(_0x01d8('0xb'));var jsforce=require(_0x01d8('0xc'));var deskjs=require(_0x01d8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x01d8('0xe'));var Redis=require(_0x01d8('0xf'));var authService=require(_0x01d8('0x10'));var qs=require(_0x01d8('0x11'));var as=require(_0x01d8('0x12'));var hardwareService=require(_0x01d8('0x13'));var logger=require('../../config/logger')(_0x01d8('0x14'));var utils=require(_0x01d8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x01d8('0x16'));var db=require(_0x01d8('0x17'))['db'];function respondWithStatusCode(_0x2bf2d5,_0x38ec91){_0x38ec91=_0x38ec91||0xcc;return function(_0x4b680e){if(_0x4b680e){return _0x2bf2d5['sendStatus'](_0x38ec91);}return _0x2bf2d5[_0x01d8('0x18')](_0x38ec91)[_0x01d8('0x19')]();};}function respondWithResult(_0x422ae0,_0x1ffbcd){_0x1ffbcd=_0x1ffbcd||0xc8;return function(_0x9363eb){if(_0x9363eb){return _0x422ae0['status'](_0x1ffbcd)[_0x01d8('0x1a')](_0x9363eb);}};}function respondWithFilteredResult(_0x43a7df,_0x49f81f){return function(_0x48dfdd){if(_0x48dfdd){var _0x122a2e=typeof _0x49f81f[_0x01d8('0x1b')]===_0x01d8('0x1c')&&typeof _0x49f81f[_0x01d8('0x1d')]==='undefined';var _0x20113b=_0x48dfdd['count'];var _0x4480c6=_0x122a2e?0x0:_0x49f81f['offset'];var _0x1848cc=_0x122a2e?_0x48dfdd[_0x01d8('0x1e')]:_0x49f81f['offset']+_0x49f81f[_0x01d8('0x1d')];var _0x48250b;if(_0x1848cc>=_0x20113b){_0x1848cc=_0x20113b;_0x48250b=0xc8;}else{_0x48250b=0xce;}_0x43a7df[_0x01d8('0x18')](_0x48250b);return _0x43a7df[_0x01d8('0x1f')](_0x01d8('0x20'),_0x4480c6+'-'+_0x1848cc+'/'+_0x20113b)[_0x01d8('0x1a')](_0x48dfdd);}return null;};}function patchUpdates(_0x37ed2d){return function(_0xaba847){try{jsonpatch[_0x01d8('0x21')](_0xaba847,_0x37ed2d,!![]);}catch(_0x264918){return BPromise[_0x01d8('0x22')](_0x264918);}return _0xaba847[_0x01d8('0x23')]();};}function saveUpdates(_0x105783,_0x3ed2c3){return function(_0x56139c){if(_0x56139c){return _0x56139c[_0x01d8('0x24')](_0x105783)['then'](function(_0x5c57f1){return _0x5c57f1;});}return null;};}function removeEntity(_0x182473,_0x33745c){return function(_0x538191){if(_0x538191){return _0x538191['destroy']()['then'](function(){_0x182473[_0x01d8('0x18')](0xcc)[_0x01d8('0x19')]();});}};}function handleEntityNotFound(_0x517e4c,_0x25cb45){return function(_0x1fb5e2){if(!_0x1fb5e2){_0x517e4c[_0x01d8('0x25')](0x194);}return _0x1fb5e2;};}function handleError(_0x521d08,_0x4714b9){_0x4714b9=_0x4714b9||0x1f4;return function(_0x142a3c){logger[_0x01d8('0x26')](_0x142a3c[_0x01d8('0x27')]);if(_0x142a3c[_0x01d8('0x28')]){delete _0x142a3c[_0x01d8('0x28')];}_0x521d08[_0x01d8('0x18')](_0x4714b9)[_0x01d8('0x29')](_0x142a3c);};}exports[_0x01d8('0x2a')]=function(_0x1dc135,_0x3ebb09){var _0x43cf35={},_0x485470={},_0x45a50f={'count':0x0,'rows':[]};var _0xd2b9ea=_['map'](db[_0x01d8('0x2b')][_0x01d8('0x2c')],function(_0x2441d2){return{'name':_0x2441d2[_0x01d8('0x2d')],'type':_0x2441d2['type'][_0x01d8('0x2e')]};});_0x485470[_0x01d8('0x2f')]=_[_0x01d8('0x30')](_0xd2b9ea,_0x01d8('0x28'));_0x485470[_0x01d8('0x31')]=_['keys'](_0x1dc135['query']);_0x485470['filters']=_['intersection'](_0x485470['model'],_0x485470[_0x01d8('0x31')]);_0x43cf35[_0x01d8('0x32')]=_[_0x01d8('0x33')](_0x485470[_0x01d8('0x2f')],qs['fields'](_0x1dc135['query']['fields']));_0x43cf35[_0x01d8('0x32')]=_0x43cf35[_0x01d8('0x32')]['length']?_0x43cf35['attributes']:_0x485470[_0x01d8('0x2f')];if(!_0x1dc135[_0x01d8('0x31')][_0x01d8('0x34')](_0x01d8('0x35'))){_0x43cf35[_0x01d8('0x1d')]=qs[_0x01d8('0x1d')](_0x1dc135[_0x01d8('0x31')]['limit']);_0x43cf35['offset']=qs[_0x01d8('0x1b')](_0x1dc135[_0x01d8('0x31')][_0x01d8('0x1b')]);}_0x43cf35[_0x01d8('0x36')]=qs[_0x01d8('0x37')](_0x1dc135['query'][_0x01d8('0x37')]);_0x43cf35['where']=qs['filters'](_['pick'](_0x1dc135[_0x01d8('0x31')],_0x485470['filters']),_0xd2b9ea);if(_0x1dc135[_0x01d8('0x31')][_0x01d8('0x38')]){_0x43cf35[_0x01d8('0x39')]=_[_0x01d8('0x3a')](_0x43cf35[_0x01d8('0x39')],{'$or':_['map'](_0xd2b9ea,function(_0xaa26da){if(_0xaa26da[_0x01d8('0x3b')]!==_0x01d8('0x3c')){var _0xda658e={};_0xda658e[_0xaa26da[_0x01d8('0x28')]]={'$like':'%'+_0x1dc135[_0x01d8('0x31')][_0x01d8('0x38')]+'%'};return _0xda658e;}})});}_0x43cf35=_[_0x01d8('0x3a')]({},_0x43cf35,_0x1dc135['options']);var _0x2c1734={'where':_0x43cf35[_0x01d8('0x39')]};return db[_0x01d8('0x2b')]['count'](_0x2c1734)[_0x01d8('0x3d')](function(_0x4ddf65){_0x45a50f[_0x01d8('0x1e')]=_0x4ddf65;if(_0x1dc135[_0x01d8('0x31')][_0x01d8('0x3e')]){_0x43cf35[_0x01d8('0x3f')]=[{'all':!![]}];}return db[_0x01d8('0x2b')][_0x01d8('0x40')](_0x43cf35);})[_0x01d8('0x3d')](function(_0x121593){_0x45a50f[_0x01d8('0x41')]=_0x121593;return _0x45a50f;})['then'](respondWithFilteredResult(_0x3ebb09,_0x43cf35))[_0x01d8('0x42')](handleError(_0x3ebb09,null));};exports['show']=function(_0x5739f4,_0x1bab2d){var _0xe85c5e={'raw':!![],'where':{'id':_0x5739f4[_0x01d8('0x43')]['id']}},_0x18ab68={};_0x18ab68[_0x01d8('0x2f')]=_['keys'](db[_0x01d8('0x2b')]['rawAttributes']);_0x18ab68['query']=_[_0x01d8('0x44')](_0x5739f4[_0x01d8('0x31')]);_0x18ab68[_0x01d8('0x45')]=_[_0x01d8('0x33')](_0x18ab68[_0x01d8('0x2f')],_0x18ab68['query']);_0xe85c5e[_0x01d8('0x32')]=_[_0x01d8('0x33')](_0x18ab68[_0x01d8('0x2f')],qs[_0x01d8('0x46')](_0x5739f4['query'][_0x01d8('0x46')]));_0xe85c5e[_0x01d8('0x32')]=_0xe85c5e[_0x01d8('0x32')][_0x01d8('0x47')]?_0xe85c5e['attributes']:_0x18ab68[_0x01d8('0x2f')];if(_0x5739f4[_0x01d8('0x31')][_0x01d8('0x3e')]){_0xe85c5e['include']=[{'all':!![]}];}_0xe85c5e=_[_0x01d8('0x3a')]({},_0xe85c5e,_0x5739f4[_0x01d8('0x48')]);return db['SquareRecording'][_0x01d8('0x49')](_0xe85c5e)[_0x01d8('0x3d')](handleEntityNotFound(_0x1bab2d,null))[_0x01d8('0x3d')](respondWithResult(_0x1bab2d,null))[_0x01d8('0x42')](handleError(_0x1bab2d,null));};exports[_0x01d8('0x4a')]=function(_0x340644,_0xc82627){return db['SquareRecording'][_0x01d8('0x4a')](_0x340644[_0x01d8('0x4b')],{})[_0x01d8('0x3d')](respondWithResult(_0xc82627,0xc9))[_0x01d8('0x42')](handleError(_0xc82627,null));};exports[_0x01d8('0x24')]=function(_0x1e42f2,_0xa9f8b){if(_0x1e42f2[_0x01d8('0x4b')]['id']){delete _0x1e42f2[_0x01d8('0x4b')]['id'];}return db[_0x01d8('0x2b')][_0x01d8('0x49')]({'where':{'id':_0x1e42f2[_0x01d8('0x43')]['id']}})[_0x01d8('0x3d')](handleEntityNotFound(_0xa9f8b,null))[_0x01d8('0x3d')](saveUpdates(_0x1e42f2[_0x01d8('0x4b')],null))[_0x01d8('0x3d')](respondWithResult(_0xa9f8b,null))[_0x01d8('0x42')](handleError(_0xa9f8b,null));};exports[_0x01d8('0x4c')]=function(_0x6a1080,_0x45cdd7,_0x429659){var _0x4779cb=require(_0x01d8('0x4d'));var _0x551728=![];var _0x3e5fd2={};if(_0x6a1080[_0x01d8('0x31')][_0x01d8('0x3b')]&&_0x6a1080['query'][_0x01d8('0x3b')]===_0x01d8('0x4e')){_0x3e5fd2[_0x01d8('0x4e')]=_0x6a1080[_0x01d8('0x43')]['id'];}else{_0x3e5fd2['id']=_0x6a1080[_0x01d8('0x43')]['id'];}return db[_0x01d8('0x2b')][_0x01d8('0x49')]({'where':_0x3e5fd2,'attributes':['id','savePath',_0x01d8('0x4f')],'raw':!![]})[_0x01d8('0x3d')](handleEntityNotFound(_0x45cdd7,null))['then'](function(_0xa0e149){if(_0xa0e149){var _0x25b4ca=_0xa0e149['savePath'];var _0x14f3b8=util[_0x01d8('0x50')]('%s.cypher',_0x25b4ca);if(fs[_0x01d8('0x51')](_0x14f3b8)){_0x551728=!![];return _0x4779cb[_0x01d8('0x52')](_0x14f3b8,_0x25b4ca,config[_0x01d8('0x53')]['recording'])['then'](function(){return _0xa0e149;});}return _0xa0e149;}})['then'](function(_0x1f8c1f){if(_0x1f8c1f){var _0x930c08=_0x1f8c1f[_0x01d8('0x54')];if(!fs[_0x01d8('0x51')](_0x930c08)){throw new db[(_0x01d8('0x55'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x1f8c1f[_0x01d8('0x4f')]){return _0x45cdd7['download'](_0x930c08,_0x1f8c1f[_0x01d8('0x4f')]+path[_0x01d8('0x56')](_0x930c08),function(){if(_0x551728){fs[_0x01d8('0x57')](_0x930c08);}});}else{return _0x45cdd7[_0x01d8('0x4c')](_0x930c08,function(_0x5c8265){if(_0x551728){fs[_0x01d8('0x57')](_0x930c08);}});}}})[_0x01d8('0x42')](function(_0x36911d){if(_0x36911d['message']===_0x01d8('0x58')){_0x45cdd7[_0x01d8('0x18')](0x194)['send'](_0x01d8('0x59'));}else{return handleError(_0x45cdd7,null);}});};exports[_0x01d8('0x5a')]=function(_0x482b4b,_0x3823b5){return db['SquareRecording'][_0x01d8('0x49')]({'where':{'id':_0x482b4b[_0x01d8('0x43')]['id']}})[_0x01d8('0x3d')](function(_0x27b42d){if(_['isNil'](_0x27b42d)){throw new ReferenceError(_0x01d8('0x5b'));}return _0x27b42d;})['then'](function(_0x15a897){var _0x4295f3=_0x15a897['savePath'];logger['info'](_0x01d8('0x5c'),_0x4295f3);if(!_[_0x01d8('0x5d')](_0x15a897[_0x01d8('0x54')])&&fs['existsSync'](_0x4295f3)){logger[_0x01d8('0x5e')](_0x01d8('0x5f')+_0x4295f3+_0x01d8('0x60'));fs[_0x01d8('0x61')](_0x4295f3);}_0x4295f3=_0x4295f3+_0x01d8('0x62');if(!_[_0x01d8('0x5d')](_0x15a897[_0x01d8('0x54')])&&fs[_0x01d8('0x51')](_0x4295f3)){logger['info'](_0x01d8('0x5f')+_0x4295f3+_0x01d8('0x60'));fs[_0x01d8('0x61')](_0x4295f3);}return _0x15a897;})['then'](function(_0x219fcd){if(!_0x219fcd)throw new InternalError();return _0x219fcd[_0x01d8('0x5a')]();})[_0x01d8('0x3d')](function(){_0x3823b5[_0x01d8('0x18')](0xcc)[_0x01d8('0x19')]();})['catch'](handleError(_0x3823b5,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 286fb4e..9babfb4 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 _0xb7de=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports'];(function(_0x51abd2,_0x342d7a){var _0x3fe554=function(_0x5f4d1d){while(--_0x5f4d1d){_0x51abd2['push'](_0x51abd2['shift']());}};_0x3fe554(++_0x342d7a);}(_0xb7de,0xc7));var _0xeb7d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb7de[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var logger=require(_0xeb7d('0x2'))('api');var moment=require(_0xeb7d('0x3'));var BPromise=require(_0xeb7d('0x4'));var rp=require(_0xeb7d('0x5'));var fs=require('fs');var path=require(_0xeb7d('0x6'));var rimraf=require(_0xeb7d('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb7d('0x8'));module[_0xeb7d('0x9')]=function(_0xadf4,_0x433c32){return _0xadf4[_0xeb7d('0xa')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d11=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x1d11,0xb6));var _0x11d1=function(_0x4a1446,_0x170e92){_0x4a1446=_0x4a1446-0x0;var _0xc1876e=_0x1d11[_0x4a1446];return _0xc1876e;};'use strict';var _=require(_0x11d1('0x0'));var util=require(_0x11d1('0x1'));var logger=require(_0x11d1('0x2'))(_0x11d1('0x3'));var moment=require(_0x11d1('0x4'));var BPromise=require(_0x11d1('0x5'));var rp=require(_0x11d1('0x6'));var fs=require('fs');var path=require(_0x11d1('0x7'));var rimraf=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var attributes=require(_0x11d1('0xa'));module['exports']=function(_0x32d808,_0x4a9622){return _0x32d808[_0x11d1('0xb')](_0x11d1('0xc'),attributes,{'tableName':'square_recordings','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 8148689..3f85642 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 _0x2e3d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareRecording','create','lodash','util'];(function(_0x5210a1,_0x2e08d8){var _0x467166=function(_0x15dc6f){while(--_0x15dc6f){_0x5210a1['push'](_0x5210a1['shift']());}};_0x467166(++_0x2e08d8);}(_0x2e3d,0xe8));var _0xd2e3=function(_0xc37670,_0x37097e){_0xc37670=_0xc37670-0x0;var _0x2ab9de=_0x2e3d[_0xc37670];return _0x2ab9de;};'use strict';var _=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var moment=require(_0xd2e3('0x2'));var BPromise=require(_0xd2e3('0x3'));var rs=require(_0xd2e3('0x4'));var fs=require('fs');var Redis=require(_0xd2e3('0x5'));var db=require(_0xd2e3('0x6'))['db'];var utils=require(_0xd2e3('0x7'));var logger=require(_0xd2e3('0x8'))('rpc');var config=require(_0xd2e3('0x9'));var jayson=require(_0xd2e3('0xa'));var client=jayson['client'][_0xd2e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f3dce,_0xeffb43,_0xc4b08c){return new BPromise(function(_0x843ff1,_0x547ac6){return client[_0xd2e3('0xc')](_0x3f3dce,_0xc4b08c)[_0xd2e3('0xd')](function(_0x31815b){logger[_0xd2e3('0xe')](_0xd2e3('0xf'),_0xeffb43,'request\x20sent');logger[_0xd2e3('0x10')](_0xd2e3('0x11'),_0xeffb43,_0xd2e3('0x12'),JSON[_0xd2e3('0x13')](_0x31815b));if(_0x31815b[_0xd2e3('0x14')]){if(_0x31815b[_0xd2e3('0x14')][_0xd2e3('0x15')]===0x1f4){logger[_0xd2e3('0x14')]('SquareRecording,\x20%s,\x20%s',_0xeffb43,_0x31815b[_0xd2e3('0x14')][_0xd2e3('0x16')]);return _0x547ac6(_0x31815b[_0xd2e3('0x14')]['message']);}logger[_0xd2e3('0x14')](_0xd2e3('0xf'),_0xeffb43,_0x31815b[_0xd2e3('0x14')][_0xd2e3('0x16')]);return _0x843ff1(_0x31815b[_0xd2e3('0x14')][_0xd2e3('0x16')]);}else{logger[_0xd2e3('0xe')]('SquareRecording,\x20%s,\x20%s',_0xeffb43,_0xd2e3('0x12'));_0x843ff1(_0x31815b[_0xd2e3('0x17')][_0xd2e3('0x16')]);}})['catch'](function(_0x910fe2){logger['error'](_0xd2e3('0xf'),_0xeffb43,_0x910fe2);_0x547ac6(_0x910fe2);});});}exports[_0xd2e3('0x18')]=function(_0x3d66e0){var _0xdc20da=this;return new Promise(function(_0x5c4746,_0x156317){return db['SquareRecording'][_0xd2e3('0x19')](_0x3d66e0['body'],{'raw':_0x3d66e0['options']?_0x3d66e0['options']['raw']===undefined?!![]:![]:!![]})[_0xd2e3('0xd')](function(_0x3dfef6){logger[_0xd2e3('0xe')](_0xd2e3('0x18'),_0x3d66e0);logger[_0xd2e3('0x10')](_0xd2e3('0x18'),_0x3d66e0,JSON[_0xd2e3('0x13')](_0x3dfef6));_0x5c4746(_0x3dfef6);})['catch'](function(_0x465d8b){logger[_0xd2e3('0x14')](_0xd2e3('0x18'),_0x465d8b[_0xd2e3('0x16')],_0x3d66e0);_0x156317(_0xdc20da[_0xd2e3('0x14')](0x1f4,_0x465d8b[_0xd2e3('0x16')]));});});}; \ No newline at end of file +var _0x812a=['SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x438522,_0x3cf0e5){var _0x33edc6=function(_0x52a637){while(--_0x52a637){_0x438522['push'](_0x438522['shift']());}};_0x33edc6(++_0x3cf0e5);}(_0x812a,0xc4));var _0xa812=function(_0x456a86,_0x24bf37){_0x456a86=_0x456a86-0x0;var _0x1c818a=_0x812a[_0x456a86];return _0x1c818a;};'use strict';var _=require(_0xa812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa812('0x1'));var rs=require(_0xa812('0x2'));var fs=require('fs');var Redis=require(_0xa812('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa812('0x4'));var logger=require(_0xa812('0x5'))('rpc');var config=require(_0xa812('0x6'));var jayson=require(_0xa812('0x7'));var client=jayson[_0xa812('0x8')][_0xa812('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x64571c,_0x639a23,_0x3e8ae6){return new BPromise(function(_0x317b99,_0x3b77bd){return client[_0xa812('0xa')](_0x64571c,_0x3e8ae6)[_0xa812('0xb')](function(_0x17dc03){logger['info'](_0xa812('0xc'),_0x639a23,'request\x20sent');logger[_0xa812('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x639a23,_0xa812('0xe'),JSON[_0xa812('0xf')](_0x17dc03));if(_0x17dc03['error']){if(_0x17dc03['error']['code']===0x1f4){logger[_0xa812('0x10')](_0xa812('0xc'),_0x639a23,_0x17dc03[_0xa812('0x10')]['message']);return _0x3b77bd(_0x17dc03['error']['message']);}logger[_0xa812('0x10')](_0xa812('0xc'),_0x639a23,_0x17dc03[_0xa812('0x10')]['message']);return _0x317b99(_0x17dc03['error'][_0xa812('0x11')]);}else{logger[_0xa812('0x12')]('SquareRecording,\x20%s,\x20%s',_0x639a23,'request\x20sent');_0x317b99(_0x17dc03[_0xa812('0x13')]['message']);}})[_0xa812('0x14')](function(_0x1914d5){logger[_0xa812('0x10')](_0xa812('0xc'),_0x639a23,_0x1914d5);_0x3b77bd(_0x1914d5);});});}exports[_0xa812('0x15')]=function(_0x4fea71){var _0x274f16=this;return new Promise(function(_0x195924,_0x3a593a){return db[_0xa812('0x16')]['create'](_0x4fea71[_0xa812('0x17')],{'raw':_0x4fea71[_0xa812('0x18')]?_0x4fea71[_0xa812('0x18')][_0xa812('0x19')]===undefined?!![]:![]:!![]})[_0xa812('0xb')](function(_0xd5d678){logger[_0xa812('0x12')](_0xa812('0x15'),_0x4fea71);logger['debug'](_0xa812('0x15'),_0x4fea71,JSON[_0xa812('0xf')](_0xd5d678));_0x195924(_0xd5d678);})[_0xa812('0x14')](function(_0x3bda28){logger[_0xa812('0x10')](_0xa812('0x15'),_0x3bda28[_0xa812('0x11')],_0x4fea71);_0x3a593a(_0x274f16[_0xa812('0x10')](0x1f4,_0x3bda28[_0xa812('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 8671627..ea04a28 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xa804d9,_0x3313ce){var _0x1805a9=function(_0x5e30e5){while(--_0x5e30e5){_0xa804d9['push'](_0xa804d9['shift']());}};_0x1805a9(++_0x3313ce);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 405c014..7c02d7c 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 _0x8ded=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x3fdfb0,_0x21cbd6){var _0x342cff=function(_0x3775b5){while(--_0x3775b5){_0x3fdfb0['push'](_0x3fdfb0['shift']());}};_0x342cff(++_0x21cbd6);}(_0x8ded,0xc0));var _0xd8de=function(_0x604650,_0x31cc5c){_0x604650=_0x604650-0x0;var _0x3467af=_0x8ded[_0x604650];return _0x3467af;};'use strict';var Sequelize=require(_0xd8de('0x0'));module[_0xd8de('0x1')]={'network':{'type':Sequelize[_0xd8de('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xd8de('0x2')]},'channel':{'type':Sequelize[_0xd8de('0x2')]},'language':{'type':Sequelize[_0xd8de('0x2')]},'type':{'type':Sequelize[_0xd8de('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xd8de('0x2')]},'callerid':{'type':Sequelize[_0xd8de('0x2')]},'calleridname':{'type':Sequelize[_0xd8de('0x2')]},'callingpres':{'type':Sequelize[_0xd8de('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xd8de('0x2')]},'dnid':{'type':Sequelize[_0xd8de('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd8de('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd8de('0x2')]},'enhanced':{'type':Sequelize[_0xd8de('0x2')]},'accountcode':{'type':Sequelize[_0xd8de('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xd8de('0x2')]},'joinAt':{'type':Sequelize[_0xd8de('0x3')]},'leaveAt':{'type':Sequelize[_0xd8de('0x3')]},'bot':{'type':Sequelize[_0xd8de('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xcff1=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcff1,0x8c));var _0x1cff=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0xcff1[_0x1c8cc6];return _0x522936;};'use strict';var Sequelize=require(_0x1cff('0x0'));module['exports']={'network':{'type':Sequelize[_0x1cff('0x1')]},'network_script':{'type':Sequelize[_0x1cff('0x1')]},'request':{'type':Sequelize[_0x1cff('0x1')]},'channel':{'type':Sequelize[_0x1cff('0x1')]},'language':{'type':Sequelize[_0x1cff('0x1')]},'type':{'type':Sequelize[_0x1cff('0x1')]},'uniqueid':{'type':Sequelize[_0x1cff('0x1')]},'version':{'type':Sequelize[_0x1cff('0x1')]},'callerid':{'type':Sequelize[_0x1cff('0x1')]},'calleridname':{'type':Sequelize[_0x1cff('0x1')]},'callingpres':{'type':Sequelize[_0x1cff('0x1')]},'callingani2':{'type':Sequelize[_0x1cff('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x1cff('0x1')]},'context':{'type':Sequelize[_0x1cff('0x1')]},'extension':{'type':Sequelize[_0x1cff('0x1')]},'priority':{'type':Sequelize[_0x1cff('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x1cff('0x1')]},'project_name':{'type':Sequelize[_0x1cff('0x1')]},'joinAt':{'type':Sequelize[_0x1cff('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x1cff('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 08493c1..a159cc0 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 _0x89f2=['count','apply','reject','update','then','error','name','index','map','SquareReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','VIRTUAL','merge','include','findAll','catch','params','keys','rawAttributes','includeAll','options','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x33fa28,_0x457f83){var _0x44492e=function(_0x10ba61){while(--_0x10ba61){_0x33fa28['push'](_0x33fa28['shift']());}};_0x44492e(++_0x457f83);}(_0x89f2,0x68));var _0x289f=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x89f2[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0x289f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x289f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x289f('0x2'));var moment=require(_0x289f('0x3'));var BPromise=require(_0x289f('0x4'));var Mustache=require(_0x289f('0x5'));var util=require(_0x289f('0x6'));var path=require('path');var sox=require(_0x289f('0x7'));var csv=require(_0x289f('0x8'));var ejs=require(_0x289f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x289f('0xa'));var squel=require(_0x289f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x289f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x289f('0xd'));var Papa=require('papaparse');var Redis=require(_0x289f('0xe'));var authService=require(_0x289f('0xf'));var qs=require(_0x289f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x289f('0x11'))('api');var utils=require(_0x289f('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbcf8cc,_0x2f0d67){_0x2f0d67=_0x2f0d67||0xcc;return function(_0x2cea31){if(_0x2cea31){return _0xbcf8cc[_0x289f('0x13')](_0x2f0d67);}return _0xbcf8cc[_0x289f('0x14')](_0x2f0d67)[_0x289f('0x15')]();};}function respondWithResult(_0x114822,_0x5ed71c){_0x5ed71c=_0x5ed71c||0xc8;return function(_0x1079f6){if(_0x1079f6){return _0x114822[_0x289f('0x14')](_0x5ed71c)[_0x289f('0x16')](_0x1079f6);}};}function respondWithFilteredResult(_0xe742f7,_0x31bfb7){return function(_0x3ace8f){if(_0x3ace8f){var _0x4cf7f8=typeof _0x31bfb7[_0x289f('0x17')]==='undefined'&&typeof _0x31bfb7[_0x289f('0x18')]===_0x289f('0x19');var _0x3df840=_0x3ace8f['count'];var _0x26a849=_0x4cf7f8?0x0:_0x31bfb7['offset'];var _0x54399d=_0x4cf7f8?_0x3ace8f[_0x289f('0x1a')]:_0x31bfb7[_0x289f('0x17')]+_0x31bfb7[_0x289f('0x18')];var _0x51b4ca;if(_0x54399d>=_0x3df840){_0x54399d=_0x3df840;_0x51b4ca=0xc8;}else{_0x51b4ca=0xce;}_0xe742f7[_0x289f('0x14')](_0x51b4ca);return _0xe742f7['set']('Content-Range',_0x26a849+'-'+_0x54399d+'/'+_0x3df840)[_0x289f('0x16')](_0x3ace8f);}return null;};}function patchUpdates(_0x2cb1af){return function(_0xb0b20){try{jsonpatch[_0x289f('0x1b')](_0xb0b20,_0x2cb1af,!![]);}catch(_0x39f021){return BPromise[_0x289f('0x1c')](_0x39f021);}return _0xb0b20['save']();};}function saveUpdates(_0xfe3d7,_0x57b573){return function(_0x100fc1){if(_0x100fc1){return _0x100fc1[_0x289f('0x1d')](_0xfe3d7)[_0x289f('0x1e')](function(_0x1b454e){return _0x1b454e;});}return null;};}function removeEntity(_0x56a2a0,_0x276252){return function(_0x1d33bc){if(_0x1d33bc){return _0x1d33bc['destroy']()[_0x289f('0x1e')](function(){_0x56a2a0[_0x289f('0x14')](0xcc)[_0x289f('0x15')]();});}};}function handleEntityNotFound(_0x6b8628,_0x5c9488){return function(_0x34a06c){if(!_0x34a06c){_0x6b8628[_0x289f('0x13')](0x194);}return _0x34a06c;};}function handleError(_0x4e5d8f,_0x126c22){_0x126c22=_0x126c22||0x1f4;return function(_0x50f0bf){logger[_0x289f('0x1f')](_0x50f0bf['stack']);if(_0x50f0bf[_0x289f('0x20')]){delete _0x50f0bf[_0x289f('0x20')];}_0x4e5d8f[_0x289f('0x14')](_0x126c22)['send'](_0x50f0bf);};}exports[_0x289f('0x21')]=function(_0x2467de,_0x252881){var _0x150893={},_0x258c31={},_0x2c9001={'count':0x0,'rows':[]};var _0x382dcb=_[_0x289f('0x22')](db[_0x289f('0x23')]['rawAttributes'],function(_0x207773){return{'name':_0x207773[_0x289f('0x24')],'type':_0x207773[_0x289f('0x25')][_0x289f('0x26')]};});_0x258c31[_0x289f('0x27')]=_[_0x289f('0x22')](_0x382dcb,_0x289f('0x20'));_0x258c31['query']=_['keys'](_0x2467de[_0x289f('0x28')]);_0x258c31['filters']=_[_0x289f('0x29')](_0x258c31[_0x289f('0x27')],_0x258c31[_0x289f('0x28')]);_0x150893[_0x289f('0x2a')]=_[_0x289f('0x29')](_0x258c31[_0x289f('0x27')],qs[_0x289f('0x2b')](_0x2467de[_0x289f('0x28')][_0x289f('0x2b')]));_0x150893['attributes']=_0x150893[_0x289f('0x2a')][_0x289f('0x2c')]?_0x150893[_0x289f('0x2a')]:_0x258c31['model'];if(!_0x2467de['query'][_0x289f('0x2d')](_0x289f('0x2e'))){_0x150893[_0x289f('0x18')]=qs['limit'](_0x2467de[_0x289f('0x28')]['limit']);_0x150893['offset']=qs[_0x289f('0x17')](_0x2467de[_0x289f('0x28')][_0x289f('0x17')]);}_0x150893[_0x289f('0x2f')]=qs[_0x289f('0x30')](_0x2467de[_0x289f('0x28')][_0x289f('0x30')]);_0x150893['where']=qs[_0x289f('0x31')](_['pick'](_0x2467de[_0x289f('0x28')],_0x258c31[_0x289f('0x31')]),_0x382dcb);if(_0x2467de[_0x289f('0x28')]['filter']){_0x150893[_0x289f('0x32')]=_['merge'](_0x150893['where'],{'$or':_[_0x289f('0x22')](_0x382dcb,function(_0xe23a7b){if(_0xe23a7b[_0x289f('0x25')]!==_0x289f('0x33')){var _0x5c9870={};_0x5c9870[_0xe23a7b[_0x289f('0x20')]]={'$like':'%'+_0x2467de[_0x289f('0x28')]['filter']+'%'};return _0x5c9870;}})});}_0x150893=_[_0x289f('0x34')]({},_0x150893,_0x2467de['options']);var _0x1d3373={'where':_0x150893['where']};return db['SquareReport'][_0x289f('0x1a')](_0x1d3373)[_0x289f('0x1e')](function(_0x326972){_0x2c9001[_0x289f('0x1a')]=_0x326972;if(_0x2467de[_0x289f('0x28')]['includeAll']){_0x150893[_0x289f('0x35')]=[{'all':!![]}];}return db['SquareReport'][_0x289f('0x36')](_0x150893);})['then'](function(_0x275650){_0x2c9001['rows']=_0x275650;return _0x2c9001;})[_0x289f('0x1e')](respondWithFilteredResult(_0x252881,_0x150893))[_0x289f('0x37')](handleError(_0x252881,null));};exports['show']=function(_0x55578d,_0x21e8c1){var _0x3f5290={'raw':!![],'where':{'id':_0x55578d[_0x289f('0x38')]['id']}},_0xe4b0b1={};_0xe4b0b1['model']=_[_0x289f('0x39')](db[_0x289f('0x23')][_0x289f('0x3a')]);_0xe4b0b1[_0x289f('0x28')]=_['keys'](_0x55578d[_0x289f('0x28')]);_0xe4b0b1[_0x289f('0x31')]=_[_0x289f('0x29')](_0xe4b0b1[_0x289f('0x27')],_0xe4b0b1[_0x289f('0x28')]);_0x3f5290['attributes']=_[_0x289f('0x29')](_0xe4b0b1[_0x289f('0x27')],qs[_0x289f('0x2b')](_0x55578d[_0x289f('0x28')]['fields']));_0x3f5290[_0x289f('0x2a')]=_0x3f5290[_0x289f('0x2a')]['length']?_0x3f5290[_0x289f('0x2a')]:_0xe4b0b1[_0x289f('0x27')];if(_0x55578d['query'][_0x289f('0x3b')]){_0x3f5290[_0x289f('0x35')]=[{'all':!![]}];}_0x3f5290=_[_0x289f('0x34')]({},_0x3f5290,_0x55578d[_0x289f('0x3c')]);return db[_0x289f('0x23')][_0x289f('0x3d')](_0x3f5290)['then'](handleEntityNotFound(_0x21e8c1,null))['then'](respondWithResult(_0x21e8c1,null))[_0x289f('0x37')](handleError(_0x21e8c1,null));};exports['create']=function(_0x2d9413,_0x245614){return db[_0x289f('0x23')][_0x289f('0x3e')](_0x2d9413[_0x289f('0x3f')],{})[_0x289f('0x1e')](respondWithResult(_0x245614,0xc9))[_0x289f('0x37')](handleError(_0x245614,null));};exports[_0x289f('0x1d')]=function(_0x214e4f,_0x1241e8){if(_0x214e4f[_0x289f('0x3f')]['id']){delete _0x214e4f[_0x289f('0x3f')]['id'];}return db[_0x289f('0x23')][_0x289f('0x3d')]({'where':{'id':_0x214e4f['params']['id']}})[_0x289f('0x1e')](handleEntityNotFound(_0x1241e8,null))['then'](saveUpdates(_0x214e4f[_0x289f('0x3f')],null))[_0x289f('0x1e')](respondWithResult(_0x1241e8,null))[_0x289f('0x37')](handleError(_0x1241e8,null));};exports['destroy']=function(_0x12bb14,_0x130f3f){return db[_0x289f('0x23')][_0x289f('0x3d')]({'where':{'id':_0x12bb14['params']['id']}})[_0x289f('0x1e')](handleEntityNotFound(_0x130f3f,null))['then'](removeEntity(_0x130f3f,null))[_0x289f('0x37')](handleError(_0x130f3f,null));};exports['describe']=function(_0x52dd33,_0x1d8444){return db[_0x289f('0x23')][_0x289f('0x40')]()[_0x289f('0x1e')](respondWithResult(_0x1d8444,null))[_0x289f('0x37')](handleError(_0x1d8444,null));}; \ No newline at end of file +var _0x2a2e=['pick','filters','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where'];(function(_0x1f1825,_0x199a02){var _0x43bdf4=function(_0x4e290f){while(--_0x4e290f){_0x1f1825['push'](_0x1f1825['shift']());}};_0x43bdf4(++_0x199a02);}(_0x2a2e,0x136));var _0xe2a2=function(_0x3d1d3a,_0x42a74f){_0x3d1d3a=_0x3d1d3a-0x0;var _0x13151d=_0x2a2e[_0x3d1d3a];return _0x13151d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2a2('0x0'));var zipdir=require(_0xe2a2('0x1'));var jsonpatch=require(_0xe2a2('0x2'));var rp=require(_0xe2a2('0x3'));var moment=require('moment');var BPromise=require(_0xe2a2('0x4'));var Mustache=require(_0xe2a2('0x5'));var util=require(_0xe2a2('0x6'));var path=require(_0xe2a2('0x7'));var sox=require(_0xe2a2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2a2('0x9'));var _=require(_0xe2a2('0xa'));var squel=require(_0xe2a2('0xb'));var crypto=require(_0xe2a2('0xc'));var jsforce=require(_0xe2a2('0xd'));var deskjs=require(_0xe2a2('0xe'));var toCsv=require(_0xe2a2('0xf'));var querystring=require(_0xe2a2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2a2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2a2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xe2a2('0x13'));var config=require(_0xe2a2('0x14'));var licenseUtil=require(_0xe2a2('0x15'));var db=require(_0xe2a2('0x16'))['db'];function respondWithStatusCode(_0x1231e3,_0x2db9){_0x2db9=_0x2db9||0xcc;return function(_0x2d2e11){if(_0x2d2e11){return _0x1231e3[_0xe2a2('0x17')](_0x2db9);}return _0x1231e3[_0xe2a2('0x18')](_0x2db9)[_0xe2a2('0x19')]();};}function respondWithResult(_0x59aa8e,_0x1b4ecd){_0x1b4ecd=_0x1b4ecd||0xc8;return function(_0x18397c){if(_0x18397c){return _0x59aa8e['status'](_0x1b4ecd)[_0xe2a2('0x1a')](_0x18397c);}};}function respondWithFilteredResult(_0x2b15b8,_0x74a57b){return function(_0x2a7758){if(_0x2a7758){var _0xa8b1f0=typeof _0x74a57b[_0xe2a2('0x1b')]==='undefined'&&typeof _0x74a57b[_0xe2a2('0x1c')]===_0xe2a2('0x1d');var _0x1282c1=_0x2a7758[_0xe2a2('0x1e')];var _0x52b5ee=_0xa8b1f0?0x0:_0x74a57b['offset'];var _0x111597=_0xa8b1f0?_0x2a7758[_0xe2a2('0x1e')]:_0x74a57b[_0xe2a2('0x1b')]+_0x74a57b[_0xe2a2('0x1c')];var _0xae4c1e;if(_0x111597>=_0x1282c1){_0x111597=_0x1282c1;_0xae4c1e=0xc8;}else{_0xae4c1e=0xce;}_0x2b15b8[_0xe2a2('0x18')](_0xae4c1e);return _0x2b15b8['set'](_0xe2a2('0x1f'),_0x52b5ee+'-'+_0x111597+'/'+_0x1282c1)[_0xe2a2('0x1a')](_0x2a7758);}return null;};}function patchUpdates(_0x282ea7){return function(_0x4ef2bb){try{jsonpatch['apply'](_0x4ef2bb,_0x282ea7,!![]);}catch(_0x19ef5e){return BPromise[_0xe2a2('0x20')](_0x19ef5e);}return _0x4ef2bb[_0xe2a2('0x21')]();};}function saveUpdates(_0x1b88e8,_0x3e8388){return function(_0x1dd206){if(_0x1dd206){return _0x1dd206[_0xe2a2('0x22')](_0x1b88e8)[_0xe2a2('0x23')](function(_0x474cff){return _0x474cff;});}return null;};}function removeEntity(_0x17cb36,_0x2a3ce7){return function(_0x4a7531){if(_0x4a7531){return _0x4a7531[_0xe2a2('0x24')]()[_0xe2a2('0x23')](function(){_0x17cb36[_0xe2a2('0x18')](0xcc)[_0xe2a2('0x19')]();});}};}function handleEntityNotFound(_0x4ac045,_0x44c071){return function(_0x58932b){if(!_0x58932b){_0x4ac045['sendStatus'](0x194);}return _0x58932b;};}function handleError(_0x55c804,_0x1569c3){_0x1569c3=_0x1569c3||0x1f4;return function(_0x5931a5){logger[_0xe2a2('0x25')](_0x5931a5[_0xe2a2('0x26')]);if(_0x5931a5[_0xe2a2('0x27')]){delete _0x5931a5[_0xe2a2('0x27')];}_0x55c804[_0xe2a2('0x18')](_0x1569c3)[_0xe2a2('0x28')](_0x5931a5);};}exports['index']=function(_0x40439d,_0x17c13a){var _0x14fd29={},_0x1a57f5={},_0x62b0d1={'count':0x0,'rows':[]};var _0x17d286=_['map'](db['SquareReport'][_0xe2a2('0x29')],function(_0x391a55){return{'name':_0x391a55['fieldName'],'type':_0x391a55[_0xe2a2('0x2a')]['key']};});_0x1a57f5[_0xe2a2('0x2b')]=_[_0xe2a2('0x2c')](_0x17d286,'name');_0x1a57f5[_0xe2a2('0x2d')]=_[_0xe2a2('0x2e')](_0x40439d[_0xe2a2('0x2d')]);_0x1a57f5['filters']=_[_0xe2a2('0x2f')](_0x1a57f5[_0xe2a2('0x2b')],_0x1a57f5[_0xe2a2('0x2d')]);_0x14fd29[_0xe2a2('0x30')]=_[_0xe2a2('0x2f')](_0x1a57f5[_0xe2a2('0x2b')],qs[_0xe2a2('0x31')](_0x40439d[_0xe2a2('0x2d')][_0xe2a2('0x31')]));_0x14fd29[_0xe2a2('0x30')]=_0x14fd29[_0xe2a2('0x30')][_0xe2a2('0x32')]?_0x14fd29[_0xe2a2('0x30')]:_0x1a57f5['model'];if(!_0x40439d['query'][_0xe2a2('0x33')](_0xe2a2('0x34'))){_0x14fd29[_0xe2a2('0x1c')]=qs[_0xe2a2('0x1c')](_0x40439d[_0xe2a2('0x2d')][_0xe2a2('0x1c')]);_0x14fd29[_0xe2a2('0x1b')]=qs['offset'](_0x40439d['query'][_0xe2a2('0x1b')]);}_0x14fd29[_0xe2a2('0x35')]=qs['sort'](_0x40439d[_0xe2a2('0x2d')]['sort']);_0x14fd29[_0xe2a2('0x36')]=qs['filters'](_[_0xe2a2('0x37')](_0x40439d[_0xe2a2('0x2d')],_0x1a57f5[_0xe2a2('0x38')]),_0x17d286);if(_0x40439d[_0xe2a2('0x2d')][_0xe2a2('0x39')]){_0x14fd29[_0xe2a2('0x36')]=_[_0xe2a2('0x3a')](_0x14fd29[_0xe2a2('0x36')],{'$or':_[_0xe2a2('0x2c')](_0x17d286,function(_0x2edeb5){if(_0x2edeb5['type']!==_0xe2a2('0x3b')){var _0x4bf573={};_0x4bf573[_0x2edeb5[_0xe2a2('0x27')]]={'$like':'%'+_0x40439d[_0xe2a2('0x2d')][_0xe2a2('0x39')]+'%'};return _0x4bf573;}})});}_0x14fd29=_[_0xe2a2('0x3a')]({},_0x14fd29,_0x40439d[_0xe2a2('0x3c')]);var _0x348a4f={'where':_0x14fd29['where']};return db[_0xe2a2('0x3d')][_0xe2a2('0x1e')](_0x348a4f)['then'](function(_0x28b0ef){_0x62b0d1['count']=_0x28b0ef;if(_0x40439d['query'][_0xe2a2('0x3e')]){_0x14fd29[_0xe2a2('0x3f')]=[{'all':!![]}];}return db[_0xe2a2('0x3d')][_0xe2a2('0x40')](_0x14fd29);})[_0xe2a2('0x23')](function(_0x188707){_0x62b0d1[_0xe2a2('0x41')]=_0x188707;return _0x62b0d1;})[_0xe2a2('0x23')](respondWithFilteredResult(_0x17c13a,_0x14fd29))[_0xe2a2('0x42')](handleError(_0x17c13a,null));};exports[_0xe2a2('0x43')]=function(_0x5b3fc2,_0x21e42b){var _0x43115f={'raw':!![],'where':{'id':_0x5b3fc2[_0xe2a2('0x44')]['id']}},_0x1376c0={};_0x1376c0[_0xe2a2('0x2b')]=_[_0xe2a2('0x2e')](db[_0xe2a2('0x3d')]['rawAttributes']);_0x1376c0['query']=_[_0xe2a2('0x2e')](_0x5b3fc2[_0xe2a2('0x2d')]);_0x1376c0[_0xe2a2('0x38')]=_['intersection'](_0x1376c0[_0xe2a2('0x2b')],_0x1376c0['query']);_0x43115f[_0xe2a2('0x30')]=_[_0xe2a2('0x2f')](_0x1376c0[_0xe2a2('0x2b')],qs[_0xe2a2('0x31')](_0x5b3fc2['query'][_0xe2a2('0x31')]));_0x43115f[_0xe2a2('0x30')]=_0x43115f[_0xe2a2('0x30')][_0xe2a2('0x32')]?_0x43115f[_0xe2a2('0x30')]:_0x1376c0[_0xe2a2('0x2b')];if(_0x5b3fc2['query'][_0xe2a2('0x3e')]){_0x43115f[_0xe2a2('0x3f')]=[{'all':!![]}];}_0x43115f=_[_0xe2a2('0x3a')]({},_0x43115f,_0x5b3fc2[_0xe2a2('0x3c')]);return db[_0xe2a2('0x3d')][_0xe2a2('0x45')](_0x43115f)['then'](handleEntityNotFound(_0x21e42b,null))[_0xe2a2('0x23')](respondWithResult(_0x21e42b,null))[_0xe2a2('0x42')](handleError(_0x21e42b,null));};exports[_0xe2a2('0x46')]=function(_0x5d5e0b,_0x3e7957){return db[_0xe2a2('0x3d')]['create'](_0x5d5e0b[_0xe2a2('0x47')],{})['then'](respondWithResult(_0x3e7957,0xc9))['catch'](handleError(_0x3e7957,null));};exports[_0xe2a2('0x22')]=function(_0x3c3cf8,_0x10f57b){if(_0x3c3cf8[_0xe2a2('0x47')]['id']){delete _0x3c3cf8[_0xe2a2('0x47')]['id'];}return db[_0xe2a2('0x3d')][_0xe2a2('0x45')]({'where':{'id':_0x3c3cf8[_0xe2a2('0x44')]['id']}})[_0xe2a2('0x23')](handleEntityNotFound(_0x10f57b,null))['then'](saveUpdates(_0x3c3cf8[_0xe2a2('0x47')],null))[_0xe2a2('0x23')](respondWithResult(_0x10f57b,null))[_0xe2a2('0x42')](handleError(_0x10f57b,null));};exports['destroy']=function(_0xdb96c7,_0x1c9a38){return db[_0xe2a2('0x3d')][_0xe2a2('0x45')]({'where':{'id':_0xdb96c7['params']['id']}})[_0xe2a2('0x23')](handleEntityNotFound(_0x1c9a38,null))[_0xe2a2('0x23')](removeEntity(_0x1c9a38,null))[_0xe2a2('0x42')](handleError(_0x1c9a38,null));};exports['describe']=function(_0x15401a,_0x124172){return db['SquareReport'][_0xe2a2('0x48')]()[_0xe2a2('0x23')](respondWithResult(_0x124172,null))[_0xe2a2('0x42')](handleError(_0x124172,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9f8e482..13b802d 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 _0x2e50=['bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square','leaveAt','lodash','util','moment'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x2e50,0x1b7));var _0x02e5=function(_0x1e2671,_0x4cf90a){_0x1e2671=_0x1e2671-0x0;var _0x492489=_0x2e50[_0x1e2671];return _0x492489;};'use strict';var _=require(_0x02e5('0x0'));var util=require(_0x02e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x02e5('0x2'));var BPromise=require(_0x02e5('0x3'));var rp=require(_0x02e5('0x4'));var fs=require('fs');var path=require(_0x02e5('0x5'));var rimraf=require(_0x02e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x02e5('0x7'));module[_0x02e5('0x8')]=function(_0x2748b9,_0x17821b){return _0x2748b9[_0x02e5('0x9')](_0x02e5('0xa'),attributes,{'tableName':_0x02e5('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':_0x02e5('0xc'),'fields':[_0x02e5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b24=['../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','leaveAt','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2ca892,_0x11af43){var _0x3d3f77=function(_0xe39e57){while(--_0xe39e57){_0x2ca892['push'](_0x2ca892['shift']());}};_0x3d3f77(++_0x11af43);}(_0x6b24,0x1ca));var _0x46b2=function(_0x4279e1,_0x39cda4){_0x4279e1=_0x4279e1-0x0;var _0x1e33ea=_0x6b24[_0x4279e1];return _0x1e33ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x46b2('0x0'))(_0x46b2('0x1'));var moment=require(_0x46b2('0x2'));var BPromise=require(_0x46b2('0x3'));var rp=require(_0x46b2('0x4'));var fs=require('fs');var path=require(_0x46b2('0x5'));var rimraf=require(_0x46b2('0x6'));var config=require(_0x46b2('0x7'));var attributes=require(_0x46b2('0x8'));module[_0x46b2('0x9')]=function(_0x100b0e,_0xdd434f){return _0x100b0e[_0x46b2('0xa')](_0x46b2('0xb'),attributes,{'tableName':_0x46b2('0xc'),'paranoid':![],'indexes':[{'name':_0x46b2('0xd'),'fields':['uniqueid','project_name']},{'name':_0x46b2('0xe'),'fields':[_0x46b2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ad528d8..4892c66 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateSquareReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateSquareReport','SquareReport'];(function(_0x2d2ce8,_0x2ed3d2){var _0x5e7bd3=function(_0x5e84d3){while(--_0x5e84d3){_0x2d2ce8['push'](_0x2d2ce8['shift']());}};_0x5e7bd3(++_0x2ed3d2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateSquareReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateSquareReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x17e2=['info','result','catch','SquareReport','create','body','options','raw','CreateSquareReport','debug','where','attributes','limit','UpdateSquareReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x351b46,_0x26b265){var _0x1515df=function(_0x22896a){while(--_0x22896a){_0x351b46['push'](_0x351b46['shift']());}};_0x1515df(++_0x26b265);}(_0x17e2,0xb3));var _0x217e=function(_0x9d62de,_0x3e05e6){_0x9d62de=_0x9d62de-0x0;var _0x1b90f6=_0x17e2[_0x9d62de];return _0x1b90f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x217e('0x0'));var BPromise=require(_0x217e('0x1'));var rs=require(_0x217e('0x2'));var fs=require('fs');var Redis=require(_0x217e('0x3'));var db=require(_0x217e('0x4'))['db'];var utils=require(_0x217e('0x5'));var logger=require(_0x217e('0x6'))('rpc');var config=require(_0x217e('0x7'));var jayson=require(_0x217e('0x8'));var client=jayson[_0x217e('0x9')][_0x217e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c7282,_0x5c0fe0,_0x32ad90){return new BPromise(function(_0x3bfc24,_0x4267cc){return client[_0x217e('0xb')](_0x1c7282,_0x32ad90)[_0x217e('0xc')](function(_0x2f22d7){logger['info'](_0x217e('0xd'),_0x5c0fe0,_0x217e('0xe'));logger['debug'](_0x217e('0xf'),_0x5c0fe0,_0x217e('0xe'),JSON[_0x217e('0x10')](_0x2f22d7));if(_0x2f22d7[_0x217e('0x11')]){if(_0x2f22d7['error']['code']===0x1f4){logger[_0x217e('0x11')]('SquareReport,\x20%s,\x20%s',_0x5c0fe0,_0x2f22d7['error']['message']);return _0x4267cc(_0x2f22d7[_0x217e('0x11')][_0x217e('0x12')]);}logger[_0x217e('0x11')](_0x217e('0xd'),_0x5c0fe0,_0x2f22d7['error'][_0x217e('0x12')]);return _0x3bfc24(_0x2f22d7[_0x217e('0x11')][_0x217e('0x12')]);}else{logger[_0x217e('0x13')](_0x217e('0xd'),_0x5c0fe0,_0x217e('0xe'));_0x3bfc24(_0x2f22d7[_0x217e('0x14')]['message']);}})[_0x217e('0x15')](function(_0x2f415d){logger[_0x217e('0x11')]('SquareReport,\x20%s,\x20%s',_0x5c0fe0,_0x2f415d);_0x4267cc(_0x2f415d);});});}exports['CreateSquareReport']=function(_0x438e21){var _0x4569e9=this;return new Promise(function(_0x31b53c,_0xbaf504){return db[_0x217e('0x16')][_0x217e('0x17')](_0x438e21[_0x217e('0x18')],{'raw':_0x438e21['options']?_0x438e21[_0x217e('0x19')][_0x217e('0x1a')]===undefined?!![]:![]:!![]})[_0x217e('0xc')](function(_0x49e92b){logger['info'](_0x217e('0x1b'),_0x438e21);logger[_0x217e('0x1c')](_0x217e('0x1b'),_0x438e21,JSON[_0x217e('0x10')](_0x49e92b));_0x31b53c(_0x49e92b);})['catch'](function(_0x2706c7){logger[_0x217e('0x11')]('CreateSquareReport',_0x2706c7[_0x217e('0x12')],_0x438e21);_0xbaf504(_0x4569e9[_0x217e('0x11')](0x1f4,_0x2706c7['message']));});});};exports['UpdateSquareReport']=function(_0x4802a5){var _0x5e90c2=this;return new Promise(function(_0x5ce2a8,_0x1f4af0){return db[_0x217e('0x16')]['update'](_0x4802a5[_0x217e('0x18')],{'raw':_0x4802a5[_0x217e('0x19')]?_0x4802a5[_0x217e('0x19')][_0x217e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4802a5[_0x217e('0x19')]?_0x4802a5[_0x217e('0x19')][_0x217e('0x1d')]||null:null,'attributes':_0x4802a5[_0x217e('0x19')]?_0x4802a5[_0x217e('0x19')][_0x217e('0x1e')]||null:null,'limit':_0x4802a5[_0x217e('0x19')]?_0x4802a5[_0x217e('0x19')][_0x217e('0x1f')]||null:null})[_0x217e('0xc')](function(_0x343a72){logger[_0x217e('0x13')](_0x217e('0x20'),_0x4802a5);logger['debug'](_0x217e('0x20'),_0x4802a5,JSON['stringify'](_0x343a72));_0x5ce2a8(_0x343a72);})[_0x217e('0x15')](function(_0x454a65){logger['error']('UpdateSquareReport',_0x454a65[_0x217e('0x12')],_0x4802a5);_0x1f4af0(_0x5e90c2[_0x217e('0x11')](0x1f4,_0x454a65[_0x217e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d586e14..8b7dd3d 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 _0x7e35=['express','Router','../../components/auth/service','./squareReportDetail.controller','get','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x537752,_0x2196e2){var _0x437c59=function(_0x415f85){while(--_0x415f85){_0x537752['push'](_0x537752['shift']());}};_0x437c59(++_0x2196e2);}(_0x7e35,0x12d));var _0x57e3=function(_0x2ea37f,_0x422f24){_0x2ea37f=_0x2ea37f-0x0;var _0x3d6b7d=_0x7e35[_0x2ea37f];return _0x3d6b7d;};'use strict';var multer=require(_0x57e3('0x0'));var util=require(_0x57e3('0x1'));var path=require('path');var timeout=require(_0x57e3('0x2'));var express=require(_0x57e3('0x3'));var router=express[_0x57e3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x57e3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x57e3('0x6'));router[_0x57e3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x57e3('0x7')](_0x57e3('0x8'),auth['isAuthenticated'](),controller[_0x57e3('0x9')]);router[_0x57e3('0x7')](_0x57e3('0xa'),auth[_0x57e3('0xb')](),controller['show']);router[_0x57e3('0xc')]('/',auth[_0x57e3('0xb')](),controller[_0x57e3('0xd')]);router[_0x57e3('0xe')](_0x57e3('0xa'),auth[_0x57e3('0xb')](),controller[_0x57e3('0xf')]);router[_0x57e3('0x10')](_0x57e3('0xa'),auth['isAuthenticated'](),controller[_0x57e3('0x11')]);module[_0x57e3('0x12')]=router; \ No newline at end of file +var _0xd6b9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','path'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xd6b9,0xc5));var _0x9d6b=function(_0x1f3f4f,_0x2eb964){_0x1f3f4f=_0x1f3f4f-0x0;var _0x1f85ec=_0xd6b9[_0x1f3f4f];return _0x1f85ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d6b('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9d6b('0x1')]();var fs_extra=require(_0x9d6b('0x2'));var auth=require(_0x9d6b('0x3'));var interaction=require(_0x9d6b('0x4'));var config=require(_0x9d6b('0x5'));var controller=require(_0x9d6b('0x6'));router[_0x9d6b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9d6b('0x7')](_0x9d6b('0x8'),auth[_0x9d6b('0x9')](),controller[_0x9d6b('0xa')]);router[_0x9d6b('0x7')](_0x9d6b('0xb'),auth[_0x9d6b('0x9')](),controller[_0x9d6b('0xc')]);router[_0x9d6b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9d6b('0xe')]('/:id',auth[_0x9d6b('0x9')](),controller[_0x9d6b('0xf')]);router['delete'](_0x9d6b('0xb'),auth[_0x9d6b('0x9')](),controller[_0x9d6b('0x10')]);module[_0x9d6b('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index c1d19fb..2bf816c 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 _0x82ad=['TEXT','STRING','sequelize'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x82ad,0xe3));var _0xd82a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82ad[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd82a('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xd82a('0x1')]},'project_name':{'type':Sequelize[_0xd82a('0x2')]},'callerid':{'type':Sequelize[_0xd82a('0x2')]}}; \ No newline at end of file +var _0x5998=['STRING','exports'];(function(_0x214a03,_0x2e4061){var _0xda476a=function(_0x1c46b2){while(--_0x1c46b2){_0x214a03['push'](_0x214a03['shift']());}};_0xda476a(++_0x2e4061);}(_0x5998,0x1cf));var _0x8599=function(_0x4bb2f8,_0x4646a5){_0x4bb2f8=_0x4bb2f8-0x0;var _0x2daa63=_0x5998[_0x4bb2f8];return _0x2daa63;};'use strict';var Sequelize=require('sequelize');module[_0x8599('0x0')]={'uniqueid':{'type':Sequelize[_0x8599('0x1')]},'node':{'type':Sequelize[_0x8599('0x1')]},'application':{'type':Sequelize[_0x8599('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 2fc00f1..de5a0e2 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 _0x69c3=['intersection','attributes','fields','nolimit','sort','where','pick','filter','type','merge','options','SquareDetailsReport','includeAll','include','rows','show','params','keys','find','catch','create','update','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','model','query','filters'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x69c3,0x134));var _0x369c=function(_0x4d5b3e,_0x49beed){_0x4d5b3e=_0x4d5b3e-0x0;var _0x4b67c6=_0x69c3[_0x4d5b3e];return _0x4b67c6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x369c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x369c('0x1'));var rp=require(_0x369c('0x2'));var moment=require(_0x369c('0x3'));var BPromise=require(_0x369c('0x4'));var Mustache=require('mustache');var util=require(_0x369c('0x5'));var path=require(_0x369c('0x6'));var sox=require('sox');var csv=require(_0x369c('0x7'));var ejs=require(_0x369c('0x8'));var fs=require('fs');var fs_extra=require(_0x369c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x369c('0xa'));var deskjs=require(_0x369c('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x369c('0xc'));var Redis=require(_0x369c('0xd'));var authService=require(_0x369c('0xe'));var qs=require(_0x369c('0xf'));var as=require(_0x369c('0x10'));var hardwareService=require(_0x369c('0x11'));var logger=require(_0x369c('0x12'))(_0x369c('0x13'));var utils=require(_0x369c('0x14'));var config=require(_0x369c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x369c('0x16'))['db'];function respondWithStatusCode(_0x8373c2,_0x115669){_0x115669=_0x115669||0xcc;return function(_0x4c565e){if(_0x4c565e){return _0x8373c2['sendStatus'](_0x115669);}return _0x8373c2[_0x369c('0x17')](_0x115669)[_0x369c('0x18')]();};}function respondWithResult(_0x1f4154,_0x1d0936){_0x1d0936=_0x1d0936||0xc8;return function(_0x183361){if(_0x183361){return _0x1f4154[_0x369c('0x17')](_0x1d0936)[_0x369c('0x19')](_0x183361);}};}function respondWithFilteredResult(_0x308cc8,_0xc4986c){return function(_0x2ed809){if(_0x2ed809){var _0x2f59a8=typeof _0xc4986c[_0x369c('0x1a')]==='undefined'&&typeof _0xc4986c[_0x369c('0x1b')]===_0x369c('0x1c');var _0x229ee0=_0x2ed809[_0x369c('0x1d')];var _0x478610=_0x2f59a8?0x0:_0xc4986c[_0x369c('0x1a')];var _0x2342e0=_0x2f59a8?_0x2ed809['count']:_0xc4986c['offset']+_0xc4986c[_0x369c('0x1b')];var _0x461e67;if(_0x2342e0>=_0x229ee0){_0x2342e0=_0x229ee0;_0x461e67=0xc8;}else{_0x461e67=0xce;}_0x308cc8[_0x369c('0x17')](_0x461e67);return _0x308cc8['set'](_0x369c('0x1e'),_0x478610+'-'+_0x2342e0+'/'+_0x229ee0)[_0x369c('0x19')](_0x2ed809);}return null;};}function patchUpdates(_0x2308bd){return function(_0x33aab3){try{jsonpatch[_0x369c('0x1f')](_0x33aab3,_0x2308bd,!![]);}catch(_0x4d5789){return BPromise[_0x369c('0x20')](_0x4d5789);}return _0x33aab3[_0x369c('0x21')]();};}function saveUpdates(_0x753743,_0x468936){return function(_0x1577f0){if(_0x1577f0){return _0x1577f0['update'](_0x753743)[_0x369c('0x22')](function(_0x2f7df2){return _0x2f7df2;});}return null;};}function removeEntity(_0x3df747,_0x4c2f49){return function(_0x48e8e5){if(_0x48e8e5){return _0x48e8e5[_0x369c('0x23')]()[_0x369c('0x22')](function(){_0x3df747[_0x369c('0x17')](0xcc)[_0x369c('0x18')]();});}};}function handleEntityNotFound(_0x431746,_0x3de969){return function(_0x5a436c){if(!_0x5a436c){_0x431746[_0x369c('0x24')](0x194);}return _0x5a436c;};}function handleError(_0x28a464,_0x3acd06){_0x3acd06=_0x3acd06||0x1f4;return function(_0x156f20){logger[_0x369c('0x25')](_0x156f20[_0x369c('0x26')]);if(_0x156f20[_0x369c('0x27')]){delete _0x156f20[_0x369c('0x27')];}_0x28a464['status'](_0x3acd06)['send'](_0x156f20);};}exports[_0x369c('0x28')]=function(_0x589161,_0x2b0e12){var _0x299d6e={},_0x37de47={},_0x303a32={'count':0x0,'rows':[]};var _0x450800=_[_0x369c('0x29')](db['SquareDetailsReport'][_0x369c('0x2a')],function(_0xeed8bb){return{'name':_0xeed8bb[_0x369c('0x2b')],'type':_0xeed8bb['type']['key']};});_0x37de47[_0x369c('0x2c')]=_['map'](_0x450800,_0x369c('0x27'));_0x37de47[_0x369c('0x2d')]=_['keys'](_0x589161[_0x369c('0x2d')]);_0x37de47[_0x369c('0x2e')]=_[_0x369c('0x2f')](_0x37de47[_0x369c('0x2c')],_0x37de47['query']);_0x299d6e[_0x369c('0x30')]=_[_0x369c('0x2f')](_0x37de47[_0x369c('0x2c')],qs[_0x369c('0x31')](_0x589161[_0x369c('0x2d')]['fields']));_0x299d6e[_0x369c('0x30')]=_0x299d6e[_0x369c('0x30')]['length']?_0x299d6e['attributes']:_0x37de47[_0x369c('0x2c')];if(!_0x589161[_0x369c('0x2d')]['hasOwnProperty'](_0x369c('0x32'))){_0x299d6e['limit']=qs[_0x369c('0x1b')](_0x589161[_0x369c('0x2d')]['limit']);_0x299d6e[_0x369c('0x1a')]=qs[_0x369c('0x1a')](_0x589161[_0x369c('0x2d')][_0x369c('0x1a')]);}_0x299d6e['order']=qs['sort'](_0x589161[_0x369c('0x2d')][_0x369c('0x33')]);_0x299d6e[_0x369c('0x34')]=qs['filters'](_[_0x369c('0x35')](_0x589161[_0x369c('0x2d')],_0x37de47[_0x369c('0x2e')]),_0x450800);if(_0x589161['query'][_0x369c('0x36')]){_0x299d6e[_0x369c('0x34')]=_['merge'](_0x299d6e['where'],{'$or':_[_0x369c('0x29')](_0x450800,function(_0x4c5ad9){if(_0x4c5ad9[_0x369c('0x37')]!=='VIRTUAL'){var _0x1a7ceb={};_0x1a7ceb[_0x4c5ad9[_0x369c('0x27')]]={'$like':'%'+_0x589161[_0x369c('0x2d')]['filter']+'%'};return _0x1a7ceb;}})});}_0x299d6e=_[_0x369c('0x38')]({},_0x299d6e,_0x589161[_0x369c('0x39')]);var _0xe54af0={'where':_0x299d6e[_0x369c('0x34')]};return db[_0x369c('0x3a')]['count'](_0xe54af0)['then'](function(_0x45f599){_0x303a32['count']=_0x45f599;if(_0x589161[_0x369c('0x2d')][_0x369c('0x3b')]){_0x299d6e[_0x369c('0x3c')]=[{'all':!![]}];}return db[_0x369c('0x3a')]['findAll'](_0x299d6e);})[_0x369c('0x22')](function(_0x5b3079){_0x303a32[_0x369c('0x3d')]=_0x5b3079;return _0x303a32;})[_0x369c('0x22')](respondWithFilteredResult(_0x2b0e12,_0x299d6e))['catch'](handleError(_0x2b0e12,null));};exports[_0x369c('0x3e')]=function(_0xc02dba,_0x3b409c){var _0x1f1841={'raw':!![],'where':{'id':_0xc02dba[_0x369c('0x3f')]['id']}},_0x15364f={};_0x15364f[_0x369c('0x2c')]=_['keys'](db['SquareDetailsReport'][_0x369c('0x2a')]);_0x15364f[_0x369c('0x2d')]=_[_0x369c('0x40')](_0xc02dba['query']);_0x15364f[_0x369c('0x2e')]=_['intersection'](_0x15364f[_0x369c('0x2c')],_0x15364f[_0x369c('0x2d')]);_0x1f1841[_0x369c('0x30')]=_['intersection'](_0x15364f['model'],qs[_0x369c('0x31')](_0xc02dba['query'][_0x369c('0x31')]));_0x1f1841['attributes']=_0x1f1841['attributes']['length']?_0x1f1841[_0x369c('0x30')]:_0x15364f['model'];if(_0xc02dba[_0x369c('0x2d')][_0x369c('0x3b')]){_0x1f1841['include']=[{'all':!![]}];}_0x1f1841=_[_0x369c('0x38')]({},_0x1f1841,_0xc02dba['options']);return db[_0x369c('0x3a')][_0x369c('0x41')](_0x1f1841)[_0x369c('0x22')](handleEntityNotFound(_0x3b409c,null))[_0x369c('0x22')](respondWithResult(_0x3b409c,null))[_0x369c('0x42')](handleError(_0x3b409c,null));};exports[_0x369c('0x43')]=function(_0x2c3308,_0xabfae7){return db[_0x369c('0x3a')][_0x369c('0x43')](_0x2c3308['body'],{})[_0x369c('0x22')](respondWithResult(_0xabfae7,0xc9))['catch'](handleError(_0xabfae7,null));};exports[_0x369c('0x44')]=function(_0xcd528c,_0x273913){if(_0xcd528c[_0x369c('0x45')]['id']){delete _0xcd528c[_0x369c('0x45')]['id'];}return db[_0x369c('0x3a')][_0x369c('0x41')]({'where':{'id':_0xcd528c[_0x369c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x273913,null))[_0x369c('0x22')](saveUpdates(_0xcd528c[_0x369c('0x45')],null))['then'](respondWithResult(_0x273913,null))[_0x369c('0x42')](handleError(_0x273913,null));};exports['destroy']=function(_0x42a825,_0x31cb20){return db['SquareDetailsReport'][_0x369c('0x41')]({'where':{'id':_0x42a825[_0x369c('0x3f')]['id']}})[_0x369c('0x22')](handleEntityNotFound(_0x31cb20,null))[_0x369c('0x22')](removeEntity(_0x31cb20,null))[_0x369c('0x42')](handleError(_0x31cb20,null));};exports['describe']=function(_0x143d87,_0x373276){return db[_0x369c('0x3a')][_0x369c('0x46')]()[_0x369c('0x22')](respondWithResult(_0x373276,null))[_0x369c('0x42')](handleError(_0x373276,null));}; \ No newline at end of file +var _0xcfe1=['options','SquareDetailsReport','includeAll','include','findAll','catch','show','params','length','create','body','find','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL'];(function(_0x4a7e28,_0x2cbc87){var _0x9b2079=function(_0x2e2da){while(--_0x2e2da){_0x4a7e28['push'](_0x4a7e28['shift']());}};_0x9b2079(++_0x2cbc87);}(_0xcfe1,0x1bc));var _0x1cfe=function(_0x5d3874,_0x48e255){_0x5d3874=_0x5d3874-0x0;var _0xc1664b=_0xcfe1[_0x5d3874];return _0xc1664b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cfe('0x0'));var jsonpatch=require(_0x1cfe('0x1'));var rp=require(_0x1cfe('0x2'));var moment=require(_0x1cfe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cfe('0x4'));var util=require('util');var path=require(_0x1cfe('0x5'));var sox=require(_0x1cfe('0x6'));var csv=require(_0x1cfe('0x7'));var ejs=require(_0x1cfe('0x8'));var fs=require('fs');var fs_extra=require(_0x1cfe('0x9'));var _=require(_0x1cfe('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1cfe('0xb'));var deskjs=require(_0x1cfe('0xc'));var toCsv=require(_0x1cfe('0x7'));var querystring=require('querystring');var Papa=require(_0x1cfe('0xd'));var Redis=require(_0x1cfe('0xe'));var authService=require(_0x1cfe('0xf'));var qs=require(_0x1cfe('0x10'));var as=require(_0x1cfe('0x11'));var hardwareService=require(_0x1cfe('0x12'));var logger=require(_0x1cfe('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1cfe('0x14'));var licenseUtil=require(_0x1cfe('0x15'));var db=require(_0x1cfe('0x16'))['db'];function respondWithStatusCode(_0x222ade,_0x5bf7e3){_0x5bf7e3=_0x5bf7e3||0xcc;return function(_0x19a3a5){if(_0x19a3a5){return _0x222ade['sendStatus'](_0x5bf7e3);}return _0x222ade[_0x1cfe('0x17')](_0x5bf7e3)[_0x1cfe('0x18')]();};}function respondWithResult(_0x25a0bc,_0x109f36){_0x109f36=_0x109f36||0xc8;return function(_0x43e9c8){if(_0x43e9c8){return _0x25a0bc[_0x1cfe('0x17')](_0x109f36)[_0x1cfe('0x19')](_0x43e9c8);}};}function respondWithFilteredResult(_0x3ae5d4,_0x380ed8){return function(_0x48f13d){if(_0x48f13d){var _0x218481=typeof _0x380ed8[_0x1cfe('0x1a')]===_0x1cfe('0x1b')&&typeof _0x380ed8[_0x1cfe('0x1c')]===_0x1cfe('0x1b');var _0x18aa70=_0x48f13d[_0x1cfe('0x1d')];var _0x29504f=_0x218481?0x0:_0x380ed8['offset'];var _0x321011=_0x218481?_0x48f13d[_0x1cfe('0x1d')]:_0x380ed8[_0x1cfe('0x1a')]+_0x380ed8['limit'];var _0x3ca154;if(_0x321011>=_0x18aa70){_0x321011=_0x18aa70;_0x3ca154=0xc8;}else{_0x3ca154=0xce;}_0x3ae5d4[_0x1cfe('0x17')](_0x3ca154);return _0x3ae5d4[_0x1cfe('0x1e')](_0x1cfe('0x1f'),_0x29504f+'-'+_0x321011+'/'+_0x18aa70)[_0x1cfe('0x19')](_0x48f13d);}return null;};}function patchUpdates(_0x316d33){return function(_0x2603fa){try{jsonpatch['apply'](_0x2603fa,_0x316d33,!![]);}catch(_0x116126){return BPromise['reject'](_0x116126);}return _0x2603fa[_0x1cfe('0x20')]();};}function saveUpdates(_0x104706,_0x13365b){return function(_0x1cc0c0){if(_0x1cc0c0){return _0x1cc0c0[_0x1cfe('0x21')](_0x104706)['then'](function(_0x36b9ed){return _0x36b9ed;});}return null;};}function removeEntity(_0x1c7b5d,_0x35208f){return function(_0x590a72){if(_0x590a72){return _0x590a72[_0x1cfe('0x22')]()[_0x1cfe('0x23')](function(){_0x1c7b5d[_0x1cfe('0x17')](0xcc)[_0x1cfe('0x18')]();});}};}function handleEntityNotFound(_0x1e2de0,_0xba621b){return function(_0x1fb234){if(!_0x1fb234){_0x1e2de0['sendStatus'](0x194);}return _0x1fb234;};}function handleError(_0x4eabec,_0x17789c){_0x17789c=_0x17789c||0x1f4;return function(_0x39d938){logger['error'](_0x39d938[_0x1cfe('0x24')]);if(_0x39d938[_0x1cfe('0x25')]){delete _0x39d938[_0x1cfe('0x25')];}_0x4eabec[_0x1cfe('0x17')](_0x17789c)['send'](_0x39d938);};}exports[_0x1cfe('0x26')]=function(_0x330965,_0x592c27){var _0x39763b={},_0x31b593={},_0x5b0d2e={'count':0x0,'rows':[]};var _0x1707ee=_[_0x1cfe('0x27')](db['SquareDetailsReport'][_0x1cfe('0x28')],function(_0x44f2df){return{'name':_0x44f2df[_0x1cfe('0x29')],'type':_0x44f2df[_0x1cfe('0x2a')][_0x1cfe('0x2b')]};});_0x31b593[_0x1cfe('0x2c')]=_[_0x1cfe('0x27')](_0x1707ee,_0x1cfe('0x25'));_0x31b593[_0x1cfe('0x2d')]=_[_0x1cfe('0x2e')](_0x330965[_0x1cfe('0x2d')]);_0x31b593['filters']=_[_0x1cfe('0x2f')](_0x31b593[_0x1cfe('0x2c')],_0x31b593[_0x1cfe('0x2d')]);_0x39763b['attributes']=_['intersection'](_0x31b593[_0x1cfe('0x2c')],qs[_0x1cfe('0x30')](_0x330965[_0x1cfe('0x2d')]['fields']));_0x39763b[_0x1cfe('0x31')]=_0x39763b[_0x1cfe('0x31')]['length']?_0x39763b[_0x1cfe('0x31')]:_0x31b593[_0x1cfe('0x2c')];if(!_0x330965[_0x1cfe('0x2d')][_0x1cfe('0x32')](_0x1cfe('0x33'))){_0x39763b[_0x1cfe('0x1c')]=qs[_0x1cfe('0x1c')](_0x330965[_0x1cfe('0x2d')][_0x1cfe('0x1c')]);_0x39763b[_0x1cfe('0x1a')]=qs[_0x1cfe('0x1a')](_0x330965[_0x1cfe('0x2d')]['offset']);}_0x39763b[_0x1cfe('0x34')]=qs[_0x1cfe('0x35')](_0x330965[_0x1cfe('0x2d')][_0x1cfe('0x35')]);_0x39763b['where']=qs[_0x1cfe('0x36')](_[_0x1cfe('0x37')](_0x330965['query'],_0x31b593[_0x1cfe('0x36')]),_0x1707ee);if(_0x330965['query'][_0x1cfe('0x38')]){_0x39763b[_0x1cfe('0x39')]=_[_0x1cfe('0x3a')](_0x39763b[_0x1cfe('0x39')],{'$or':_[_0x1cfe('0x27')](_0x1707ee,function(_0x5c4922){if(_0x5c4922['type']!==_0x1cfe('0x3b')){var _0xa50483={};_0xa50483[_0x5c4922[_0x1cfe('0x25')]]={'$like':'%'+_0x330965['query'][_0x1cfe('0x38')]+'%'};return _0xa50483;}})});}_0x39763b=_['merge']({},_0x39763b,_0x330965[_0x1cfe('0x3c')]);var _0x547a22={'where':_0x39763b[_0x1cfe('0x39')]};return db[_0x1cfe('0x3d')]['count'](_0x547a22)['then'](function(_0x30f220){_0x5b0d2e[_0x1cfe('0x1d')]=_0x30f220;if(_0x330965[_0x1cfe('0x2d')][_0x1cfe('0x3e')]){_0x39763b[_0x1cfe('0x3f')]=[{'all':!![]}];}return db[_0x1cfe('0x3d')][_0x1cfe('0x40')](_0x39763b);})[_0x1cfe('0x23')](function(_0x45ea46){_0x5b0d2e['rows']=_0x45ea46;return _0x5b0d2e;})[_0x1cfe('0x23')](respondWithFilteredResult(_0x592c27,_0x39763b))[_0x1cfe('0x41')](handleError(_0x592c27,null));};exports[_0x1cfe('0x42')]=function(_0xd4541,_0x2f2f72){var _0x42af63={'raw':!![],'where':{'id':_0xd4541[_0x1cfe('0x43')]['id']}},_0x5df7e9={};_0x5df7e9['model']=_[_0x1cfe('0x2e')](db[_0x1cfe('0x3d')][_0x1cfe('0x28')]);_0x5df7e9['query']=_['keys'](_0xd4541[_0x1cfe('0x2d')]);_0x5df7e9[_0x1cfe('0x36')]=_[_0x1cfe('0x2f')](_0x5df7e9[_0x1cfe('0x2c')],_0x5df7e9[_0x1cfe('0x2d')]);_0x42af63[_0x1cfe('0x31')]=_[_0x1cfe('0x2f')](_0x5df7e9[_0x1cfe('0x2c')],qs['fields'](_0xd4541[_0x1cfe('0x2d')][_0x1cfe('0x30')]));_0x42af63[_0x1cfe('0x31')]=_0x42af63[_0x1cfe('0x31')][_0x1cfe('0x44')]?_0x42af63[_0x1cfe('0x31')]:_0x5df7e9[_0x1cfe('0x2c')];if(_0xd4541[_0x1cfe('0x2d')][_0x1cfe('0x3e')]){_0x42af63[_0x1cfe('0x3f')]=[{'all':!![]}];}_0x42af63=_['merge']({},_0x42af63,_0xd4541['options']);return db[_0x1cfe('0x3d')]['find'](_0x42af63)['then'](handleEntityNotFound(_0x2f2f72,null))[_0x1cfe('0x23')](respondWithResult(_0x2f2f72,null))[_0x1cfe('0x41')](handleError(_0x2f2f72,null));};exports[_0x1cfe('0x45')]=function(_0x297c20,_0x42ff08){return db['SquareDetailsReport']['create'](_0x297c20[_0x1cfe('0x46')],{})[_0x1cfe('0x23')](respondWithResult(_0x42ff08,0xc9))[_0x1cfe('0x41')](handleError(_0x42ff08,null));};exports[_0x1cfe('0x21')]=function(_0x5ababf,_0x62c42a){if(_0x5ababf['body']['id']){delete _0x5ababf[_0x1cfe('0x46')]['id'];}return db[_0x1cfe('0x3d')][_0x1cfe('0x47')]({'where':{'id':_0x5ababf[_0x1cfe('0x43')]['id']}})[_0x1cfe('0x23')](handleEntityNotFound(_0x62c42a,null))[_0x1cfe('0x23')](saveUpdates(_0x5ababf[_0x1cfe('0x46')],null))['then'](respondWithResult(_0x62c42a,null))[_0x1cfe('0x41')](handleError(_0x62c42a,null));};exports[_0x1cfe('0x22')]=function(_0x1e66dd,_0x5c2978){return db['SquareDetailsReport'][_0x1cfe('0x47')]({'where':{'id':_0x1e66dd[_0x1cfe('0x43')]['id']}})[_0x1cfe('0x23')](handleEntityNotFound(_0x5c2978,null))[_0x1cfe('0x23')](removeEntity(_0x5c2978,null))['catch'](handleError(_0x5c2978,null));};exports['describe']=function(_0x499b4d,_0x59c344){return db[_0x1cfe('0x3d')]['describe']()[_0x1cfe('0x23')](respondWithResult(_0x59c344,null))[_0x1cfe('0x41')](handleError(_0x59c344,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 97cbd9f..0f99830 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 _0x0711=['../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4aa2e8,_0x5e2158){var _0x44949e=function(_0x3ff751){while(--_0x3ff751){_0x4aa2e8['push'](_0x4aa2e8['shift']());}};_0x44949e(++_0x5e2158);}(_0x0711,0xc8));var _0x1071=function(_0x9db5d7,_0x4605f2){_0x9db5d7=_0x9db5d7-0x0;var _0x29ea8a=_0x0711[_0x9db5d7];return _0x29ea8a;};'use strict';var _=require(_0x1071('0x0'));var util=require('util');var logger=require(_0x1071('0x1'))(_0x1071('0x2'));var moment=require(_0x1071('0x3'));var BPromise=require(_0x1071('0x4'));var rp=require(_0x1071('0x5'));var fs=require('fs');var path=require(_0x1071('0x6'));var rimraf=require(_0x1071('0x7'));var config=require(_0x1071('0x8'));var attributes=require(_0x1071('0x9'));module['exports']=function(_0x2e19d5,_0x95bb4f){return _0x2e19d5[_0x1071('0xa')](_0x1071('0xb'),attributes,{'tableName':_0x1071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ad0=['request-promise','rimraf','../../config/environment','SquareDetailsReport','report_square_details','lodash','util','api','moment'];(function(_0x3e518e,_0x4063d4){var _0xb8a17f=function(_0x4b51bc){while(--_0x4b51bc){_0x3e518e['push'](_0x3e518e['shift']());}};_0xb8a17f(++_0x4063d4);}(_0x4ad0,0xdd));var _0x04ad=function(_0x32ed02,_0x2b10ac){_0x32ed02=_0x32ed02-0x0;var _0x489294=_0x4ad0[_0x32ed02];return _0x489294;};'use strict';var _=require(_0x04ad('0x0'));var util=require(_0x04ad('0x1'));var logger=require('../../config/logger')(_0x04ad('0x2'));var moment=require(_0x04ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x04ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04ad('0x5'));var config=require(_0x04ad('0x6'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x5687bf,_0x316868){return _0x5687bf['define'](_0x04ad('0x7'),attributes,{'tableName':_0x04ad('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 6264b9c..b47a4b4 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 _0x4b0f=['debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x1f69a2,_0x5ebeb8){_0x1f69a2=_0x1f69a2-0x0;var _0x899ef4=_0x4b0f[_0x1f69a2];return _0x899ef4;};'use strict';var _=require('lodash');var util=require(_0xf4b0('0x0'));var moment=require(_0xf4b0('0x1'));var BPromise=require(_0xf4b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4b0('0x3'));var db=require(_0xf4b0('0x4'))['db'];var utils=require(_0xf4b0('0x5'));var logger=require(_0xf4b0('0x6'))(_0xf4b0('0x7'));var config=require(_0xf4b0('0x8'));var jayson=require(_0xf4b0('0x9'));var client=jayson[_0xf4b0('0xa')][_0xf4b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x373042,_0x300b64,_0x35160f){return new BPromise(function(_0x3a2236,_0xd132d8){return client[_0xf4b0('0xc')](_0x373042,_0x35160f)[_0xf4b0('0xd')](function(_0x4906e9){logger[_0xf4b0('0xe')](_0xf4b0('0xf'),_0x300b64,_0xf4b0('0x10'));logger[_0xf4b0('0x11')](_0xf4b0('0x12'),_0x300b64,_0xf4b0('0x10'),JSON[_0xf4b0('0x13')](_0x4906e9));if(_0x4906e9[_0xf4b0('0x14')]){if(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x15')]===0x1f4){logger[_0xf4b0('0x14')](_0xf4b0('0xf'),_0x300b64,_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);return _0xd132d8(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);}logger[_0xf4b0('0x14')](_0xf4b0('0xf'),_0x300b64,_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);return _0x3a2236(_0x4906e9[_0xf4b0('0x14')][_0xf4b0('0x16')]);}else{logger['info'](_0xf4b0('0xf'),_0x300b64,_0xf4b0('0x10'));_0x3a2236(_0x4906e9[_0xf4b0('0x17')]['message']);}})[_0xf4b0('0x18')](function(_0x1f2d74){logger[_0xf4b0('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x300b64,_0x1f2d74);_0xd132d8(_0x1f2d74);});});}exports[_0xf4b0('0x19')]=function(_0x390dbd){var _0x3e8ade=this;return new Promise(function(_0x543c88,_0x4cffc2){return db[_0xf4b0('0x1a')][_0xf4b0('0x1b')](_0x390dbd['body'],{'raw':_0x390dbd['options']?_0x390dbd[_0xf4b0('0x1c')][_0xf4b0('0x1d')]===undefined?!![]:![]:!![]})[_0xf4b0('0xd')](function(_0x4e65cd){logger[_0xf4b0('0xe')](_0xf4b0('0x19'),_0x390dbd);logger[_0xf4b0('0x11')](_0xf4b0('0x19'),_0x390dbd,JSON[_0xf4b0('0x13')](_0x4e65cd));_0x543c88(_0x4e65cd);})[_0xf4b0('0x18')](function(_0x221b1d){logger['error'](_0xf4b0('0x19'),_0x221b1d[_0xf4b0('0x16')],_0x390dbd);_0x4cffc2(_0x3e8ade[_0xf4b0('0x14')](0x1f4,_0x221b1d[_0xf4b0('0x16')]));});});}; \ No newline at end of file +var _0x3423=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','catch'];(function(_0xfccbab,_0x5c6f9b){var _0x226b1f=function(_0x511a76){while(--_0x511a76){_0xfccbab['push'](_0xfccbab['shift']());}};_0x226b1f(++_0x5c6f9b);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}exports[_0x3342('0x15')]=function(_0x2075cb){var _0x12947a=this;return new Promise(function(_0x156c24,_0x45a3ca){return db[_0x3342('0x16')][_0x3342('0x17')](_0x2075cb['body'],{'raw':_0x2075cb[_0x3342('0x18')]?_0x2075cb[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cb86f){logger[_0x3342('0x13')]('CreateSquareDetailsReport',_0x2075cb);logger[_0x3342('0x1a')](_0x3342('0x15'),_0x2075cb,JSON['stringify'](_0x3cb86f));_0x156c24(_0x3cb86f);})[_0x3342('0x1b')](function(_0x5a0658){logger[_0x3342('0x10')](_0x3342('0x15'),_0x5a0658[_0x3342('0x12')],_0x2075cb);_0x45a3ca(_0x12947a[_0x3342('0x10')](0x1f4,_0x5a0658[_0x3342('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 1bb5a7e..1bdf6ca 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 _0xbc89=['isAuthenticated','index','/process/:pid/kill','express','Router','../../components/auth/service','./system.controller'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xbc89,0x17d));var _0x9bc8=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0xbc89[_0x3f8759];return _0x2d33ca;};'use strict';var express=require(_0x9bc8('0x0'));var router=express[_0x9bc8('0x1')]();var auth=require(_0x9bc8('0x2'));var controller=require(_0x9bc8('0x3'));router['get']('/',auth[_0x9bc8('0x4')](),controller[_0x9bc8('0x5')]);router['get'](_0x9bc8('0x6'),auth[_0x9bc8('0x4')](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0xb002=['Router','../../components/auth/service','./system.controller','isAuthenticated','index','killProcess'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xb002,0x156));var _0x2b00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb002[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x2b00('0x0')]();var auth=require(_0x2b00('0x1'));var controller=require(_0x2b00('0x2'));router['get']('/',auth[_0x2b00('0x3')](),controller[_0x2b00('0x4')]);router['get']('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x2b00('0x5')]);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 b658fe2..ee7a508 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 _0xd265=['index','getAllData','then','json','killProcess','components/import/cm','format','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0xd265,0x131));var _0x5d26=function(_0x1bd0d5,_0x558070){_0x1bd0d5=_0x1bd0d5-0x0;var _0x101588=_0xd265[_0x1bd0d5];return _0x101588;};'use strict';var info=require(_0x5d26('0x0'));var exec=require(_0x5d26('0x1'))[_0x5d26('0x2')];var logger=require(_0x5d26('0x3'))(_0x5d26('0x4'));var util=require(_0x5d26('0x5'));var BPromise=require(_0x5d26('0x6'));var _=require(_0x5d26('0x7'));function handleError(_0x32eaae,_0x37b057,_0x3c73b5){_0x37b057=_0x37b057||0x1f4;return function(_0xcddd94){logger[_0x5d26('0x8')](_0x5d26('0x9'),_0x3c73b5,_0x37b057,util[_0x5d26('0xa')](_0xcddd94,{'showHidden':![],'depth':null}));delete _0xcddd94[_0x5d26('0xb')];_0x32eaae[_0x5d26('0xc')](_0x37b057)[_0x5d26('0xd')](_0xcddd94);};}exports[_0x5d26('0xe')]=function(_0xac55e6,_0x59a7be){return info[_0x5d26('0xf')]()[_0x5d26('0x10')](function(_0x568e15){return _0x59a7be[_0x5d26('0xc')](0xc8)['json'](_0x568e15);})['catch'](function(_0x4cdcac){return _0x59a7be[_0x5d26('0xc')](0x1f4)[_0x5d26('0x11')](_0x4cdcac);});};exports[_0x5d26('0x12')]=function(_0x29d44b,_0x265b05){var _0x218346=[_0x5d26('0x13')];return new BPromise(function(_0x4da4c5,_0x35e32c){return exec(util[_0x5d26('0x14')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x29d44b[_0x5d26('0x15')][_0x5d26('0x16')]),function(_0x41c898,_0x263962,_0x1e874c){if(_0x41c898){return _0x35e32c(_0x41c898);}return _0x4da4c5(_0x263962);});})[_0x5d26('0x10')](function(_0x134f79){var _0x2dd963=![];var _0x103586=_0x134f79[_0x5d26('0x17')](/\n/);for(var _0x24874d=0x0,_0x183d28=_0x218346[_0x5d26('0x18')];_0x24874d<_0x183d28,_0x2dd963===![];_0x24874d+=0x1){if(_0x134f79['indexOf'](_0x218346[_0x24874d])>=0x0){_0x2dd963=!![];}}if(!_0x2dd963){throw new Error(util['format'](_0x5d26('0x19'),_0x29d44b[_0x5d26('0x15')][_0x5d26('0x16')]));}process[_0x5d26('0x1a')](_0x29d44b[_0x5d26('0x15')]['pid'],'SIGINT');return _0x265b05[_0x5d26('0xc')](0xc8)['json']({'message':util[_0x5d26('0x14')](_0x5d26('0x1b'),_0x29d44b['params']['pid'])});})[_0x5d26('0x1c')](handleError(_0x265b05,null,_0x5d26('0x12')));}; \ No newline at end of file +var _0xba7b=['pid','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch','killProcess','components/import/cm','format','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xba7b,0xda));var _0xbba7=function(_0x466f41,_0x21502c){_0x466f41=_0x466f41-0x0;var _0x2e6efb=_0xba7b[_0x466f41];return _0x2e6efb;};'use strict';var info=require(_0xbba7('0x0'));var exec=require('child_process')[_0xbba7('0x1')];var logger=require('../../config/logger')(_0xbba7('0x2'));var util=require(_0xbba7('0x3'));var BPromise=require('bluebird');var _=require(_0xbba7('0x4'));function handleError(_0x381e68,_0x22659c,_0x590701){_0x22659c=_0x22659c||0x1f4;return function(_0x1ae7cc){logger['error'](_0xbba7('0x5'),_0x590701,_0x22659c,util[_0xbba7('0x6')](_0x1ae7cc,{'showHidden':![],'depth':null}));delete _0x1ae7cc[_0xbba7('0x7')];_0x381e68[_0xbba7('0x8')](_0x22659c)[_0xbba7('0x9')](_0x1ae7cc);};}exports[_0xbba7('0xa')]=function(_0x2f5c36,_0x127fd2){return info['getAllData']()[_0xbba7('0xb')](function(_0x465a9a){return _0x127fd2['status'](0xc8)[_0xbba7('0xc')](_0x465a9a);})[_0xbba7('0xd')](function(_0x138033){return _0x127fd2[_0xbba7('0x8')](0x1f4)[_0xbba7('0xc')](_0x138033);});};exports[_0xbba7('0xe')]=function(_0x29759e,_0x4fdd49){var _0x4a5b56=[_0xbba7('0xf')];return new BPromise(function(_0x134f82,_0x1741ea){return exec(util[_0xbba7('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x29759e[_0xbba7('0x11')]['pid']),function(_0x18bb36,_0x461e31,_0x42d34a){if(_0x18bb36){return _0x1741ea(_0x18bb36);}return _0x134f82(_0x461e31);});})[_0xbba7('0xb')](function(_0x5c5d22){var _0x32ca91=![];var _0x251da7=_0x5c5d22[_0xbba7('0x12')](/\n/);for(var _0x4d5eb0=0x0,_0x41ff74=_0x4a5b56[_0xbba7('0x13')];_0x4d5eb0<_0x41ff74,_0x32ca91===![];_0x4d5eb0+=0x1){if(_0x5c5d22[_0xbba7('0x14')](_0x4a5b56[_0x4d5eb0])>=0x0){_0x32ca91=!![];}}if(!_0x32ca91){throw new Error(util[_0xbba7('0x10')](_0xbba7('0x15'),_0x29759e[_0xbba7('0x11')][_0xbba7('0x16')]));}process['kill'](_0x29759e[_0xbba7('0x11')][_0xbba7('0x16')],'SIGINT');return _0x4fdd49[_0xbba7('0x8')](0xc8)[_0xbba7('0xc')]({'message':util[_0xbba7('0x10')](_0xbba7('0x17'),_0x29759e['params']['pid'])});})[_0xbba7('0xd')](handleError(_0x4fdd49,null,_0xbba7('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 2facb9d..61c5090 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 _0x514d=['Router','fs-extra','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x514d,0x87));var _0xd514=function(_0x601c59,_0xb401b1){_0x601c59=_0x601c59-0x0;var _0x1a1a5f=_0x514d[_0x601c59];return _0x1a1a5f;};'use strict';var multer=require(_0xd514('0x0'));var util=require(_0xd514('0x1'));var path=require(_0xd514('0x2'));var timeout=require(_0xd514('0x3'));var express=require(_0xd514('0x4'));var router=express[_0xd514('0x5')]();var fs_extra=require(_0xd514('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd514('0x7'));var controller=require(_0xd514('0x8'));router[_0xd514('0x9')]('/',auth[_0xd514('0xa')](),controller['index']);router[_0xd514('0x9')](_0xd514('0xb'),auth['isAuthenticated'](),controller[_0xd514('0xc')]);router[_0xd514('0xd')]('/',auth[_0xd514('0xa')](),controller[_0xd514('0xe')]);router[_0xd514('0xf')]('/:id',auth[_0xd514('0xa')](),controller[_0xd514('0x10')]);router[_0xd514('0x11')]('/:id',auth[_0xd514('0xa')](),controller[_0xd514('0x12')]);module[_0xd514('0x13')]=router; \ No newline at end of file +var _0x60aa=['../../components/auth/service','./tag.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x55ba2e,_0x76101b){var _0x5be0eb=function(_0x2e0bf4){while(--_0x2e0bf4){_0x55ba2e['push'](_0x55ba2e['shift']());}};_0x5be0eb(++_0x76101b);}(_0x60aa,0x13e));var _0xa60a=function(_0x18a6b7,_0x3b4e38){_0x18a6b7=_0x18a6b7-0x0;var _0x5e87be=_0x60aa[_0x18a6b7];return _0x5e87be;};'use strict';var multer=require('multer');var util=require(_0xa60a('0x0'));var path=require('path');var timeout=require(_0xa60a('0x1'));var express=require(_0xa60a('0x2'));var router=express[_0xa60a('0x3')]();var fs_extra=require(_0xa60a('0x4'));var auth=require(_0xa60a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa60a('0x6'));router[_0xa60a('0x7')]('/',auth[_0xa60a('0x8')](),controller[_0xa60a('0x9')]);router['get'](_0xa60a('0xa'),auth[_0xa60a('0x8')](),controller['show']);router['post']('/',auth[_0xa60a('0x8')](),controller[_0xa60a('0xb')]);router[_0xa60a('0xc')](_0xa60a('0xa'),auth[_0xa60a('0x8')](),controller[_0xa60a('0xd')]);router[_0xa60a('0xe')](_0xa60a('0xa'),auth[_0xa60a('0x8')](),controller[_0xa60a('0xf')]);module[_0xa60a('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 3a0ff63..1a5defa 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 _0x02ce=['exports','STRING','sequelize'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x02ce,0x1ac));var _0xe02c=function(_0x59fc00,_0x31d804){_0x59fc00=_0x59fc00-0x0;var _0xc5371b=_0x02ce[_0x59fc00];return _0xc5371b;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe02c('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xe02c('0x2')]}}; \ No newline at end of file +var _0xc931=['STRING','#0091EA','sequelize','exports','name'];(function(_0x5113da,_0x5a9f8d){var _0x54b1cc=function(_0x4f0bca){while(--_0x4f0bca){_0x5113da['push'](_0x5113da['shift']());}};_0x54b1cc(++_0x5a9f8d);}(_0xc931,0x19c));var _0x1c93=function(_0x25b428,_0x34cf04){_0x25b428=_0x25b428-0x0;var _0x2444fb=_0xc931[_0x25b428];return _0x2444fb;};'use strict';var Sequelize=require(_0x1c93('0x0'));module[_0x1c93('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1c93('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x1c93('0x3')],'defaultValue':_0x1c93('0x4')},'description':{'type':Sequelize[_0x1c93('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 8755e04..8249f58 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 _0xa9e0=['undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','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'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x24')]({'plain':!![]});var _0x16b1ca='Tags';return db['UserProfileResource'][_0x0a9e('0x23')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x22')](function(){return _0x2fb0e4;});})[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x25')](_0x25fba9[_0x0a9e('0x26')]);if(_0x25fba9[_0x0a9e('0x27')]){delete _0x25fba9[_0x0a9e('0x27')];}_0x1dc186[_0x0a9e('0x17')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x28')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x563b45){return{'name':_0x563b45[_0x0a9e('0x2c')],'type':_0x563b45[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x5c877d['model']=_[_0x0a9e('0x29')](_0x40e7a3,'name');_0x5c877d[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x468813[_0x0a9e('0x2f')]);_0x5c877d[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2f')]);_0x2ec755[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x5c877d[_0x0a9e('0x34')],qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x2ec755[_0x0a9e('0x33')]=_0x2ec755['attributes'][_0x0a9e('0x36')]?_0x2ec755['attributes']:_0x5c877d[_0x0a9e('0x34')];if(!_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x37')](_0x0a9e('0x38'))){_0x2ec755['limit']=qs[_0x0a9e('0x1a')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x1a')]);_0x2ec755[_0x0a9e('0x1b')]=qs['offset'](_0x468813['query'][_0x0a9e('0x1b')]);}_0x2ec755['order']=qs[_0x0a9e('0x39')](_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x39')]);_0x2ec755[_0x0a9e('0x3a')]=qs['filters'](_[_0x0a9e('0x3b')](_0x468813[_0x0a9e('0x2f')],_0x5c877d[_0x0a9e('0x31')]),_0x40e7a3);if(_0x468813['query'][_0x0a9e('0x3c')]){_0x2ec755[_0x0a9e('0x3a')]=_[_0x0a9e('0x3d')](_0x2ec755['where'],{'$or':_['map'](_0x40e7a3,function(_0x11b61d){if(_0x11b61d[_0x0a9e('0x2d')]!=='VIRTUAL'){var _0x2b814e={};_0x2b814e[_0x11b61d[_0x0a9e('0x27')]]={'$like':'%'+_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x3c')]+'%'};return _0x2b814e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813['options']);var _0x15e37d={'where':_0x2ec755[_0x0a9e('0x3a')]};return db['Tag'][_0x0a9e('0x1c')](_0x15e37d)[_0x0a9e('0x22')](function(_0x1459bb){_0x15b200['count']=_0x1459bb;if(_0x468813[_0x0a9e('0x2f')][_0x0a9e('0x3e')]){_0x2ec755[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x2ec755);})[_0x0a9e('0x22')](function(_0x2881b3){_0x15b200[_0x0a9e('0x41')]=_0x2881b3;return _0x15b200;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x148007,_0x1a7bce){var _0x11ca30={'raw':!![],'where':{'id':_0x148007['params']['id']}},_0x37f6cc={};_0x37f6cc['model']=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x37f6cc[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x148007[_0x0a9e('0x2f')]);_0x37f6cc[_0x0a9e('0x31')]=_[_0x0a9e('0x32')](_0x37f6cc[_0x0a9e('0x34')],_0x37f6cc[_0x0a9e('0x2f')]);_0x11ca30[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x37f6cc['model'],qs[_0x0a9e('0x35')](_0x148007[_0x0a9e('0x2f')][_0x0a9e('0x35')]));_0x11ca30[_0x0a9e('0x33')]=_0x11ca30[_0x0a9e('0x33')][_0x0a9e('0x36')]?_0x11ca30[_0x0a9e('0x33')]:_0x37f6cc[_0x0a9e('0x34')];if(_0x148007['query'][_0x0a9e('0x3e')]){_0x11ca30['include']=[{'all':!![]}];}_0x11ca30=_[_0x0a9e('0x3d')]({},_0x11ca30,_0x148007[_0x0a9e('0x44')]);return db[_0x0a9e('0x2a')]['find'](_0x11ca30)[_0x0a9e('0x22')](handleEntityNotFound(_0x1a7bce,null))[_0x0a9e('0x22')](respondWithResult(_0x1a7bce,null))[_0x0a9e('0x42')](handleError(_0x1a7bce,null));};exports[_0x0a9e('0x45')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x2a')]['create'](_0x45c845[_0x0a9e('0x46')],{})[_0x0a9e('0x22')](function(_0x1b5e80){var _0x16f976=_0x45c845[_0x0a9e('0x47')][_0x0a9e('0x24')]({'plain':!![]});if(!_0x16f976)throw new Error(_0x0a9e('0x48'));if(_0x16f976[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x58a5c2=_0x1b5e80[_0x0a9e('0x24')]({'plain':!![]});var _0x3fe430='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x3fe430,'userProfileId':_0x16f976[_0x0a9e('0x4a')]},'raw':!![]})[_0x0a9e('0x22')](function(_0x37edaa){if(_0x37edaa&&_0x37edaa[_0x0a9e('0x4b')]===0x0){return db[_0x0a9e('0x4c')][_0x0a9e('0x45')]({'name':_0x58a5c2[_0x0a9e('0x27')],'resourceId':_0x58a5c2['id'],'type':_0x37edaa[_0x0a9e('0x27')],'sectionId':_0x37edaa['id']},{})['then'](function(){return _0x1b5e80;});}else{return _0x1b5e80;}})['catch'](function(_0x53975a){logger[_0x0a9e('0x25')](_0x0a9e('0x4d'),_0x53975a);throw _0x53975a;});}return _0x1b5e80;})[_0x0a9e('0x22')](respondWithResult(_0x37be73,0xc9))['catch'](handleError(_0x37be73,null));};exports[_0x0a9e('0x21')]=function(_0x161aa7,_0x53d113){if(_0x161aa7['body']['id']){delete _0x161aa7[_0x0a9e('0x46')]['id'];}return db['Tag'][_0x0a9e('0x4e')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x53d113,null))[_0x0a9e('0x22')](saveUpdates(_0x161aa7[_0x0a9e('0x46')],null))['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0x42')](handleError(_0x53d113,null));};exports[_0x0a9e('0x23')]=function(_0x508b47,_0x50f687){return db[_0x0a9e('0x2a')][_0x0a9e('0x4e')]({'where':{'id':_0x508b47['params']['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x50f687,null))['then'](removeEntity(_0x50f687,null))[_0x0a9e('0x42')](handleError(_0x50f687,null));}; \ No newline at end of file +var _0xa25c=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Tag','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf'];(function(_0x3d3001,_0x36ef3f){var _0xf70bde=function(_0x2306f8){while(--_0x2306f8){_0x3d3001['push'](_0x3d3001['shift']());}};_0xf70bde(++_0x36ef3f);}(_0xa25c,0x13f));var _0xca25=function(_0x321206,_0x22269d){_0x321206=_0x321206-0x0;var _0xb3746b=_0xa25c[_0x321206];return _0xb3746b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca25('0x0'));var zipdir=require(_0xca25('0x1'));var jsonpatch=require(_0xca25('0x2'));var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require(_0xca25('0x7'));var path=require('path');var sox=require(_0xca25('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca25('0x9'));var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var licenseUtil=require(_0xca25('0x14'));var db=require(_0xca25('0x15'))['db'];function respondWithStatusCode(_0x5697aa,_0x534bca){_0x534bca=_0x534bca||0xcc;return function(_0x2a7a97){if(_0x2a7a97){return _0x5697aa['sendStatus'](_0x534bca);}return _0x5697aa[_0xca25('0x16')](_0x534bca)[_0xca25('0x17')]();};}function respondWithResult(_0x35093c,_0x1a3207){_0x1a3207=_0x1a3207||0xc8;return function(_0x307e9e){if(_0x307e9e){return _0x35093c[_0xca25('0x16')](_0x1a3207)[_0xca25('0x18')](_0x307e9e);}};}function respondWithFilteredResult(_0x33aa25,_0x2a1af3){return function(_0x42bc1e){if(_0x42bc1e){var _0x2b5cef=typeof _0x2a1af3['offset']===_0xca25('0x19')&&typeof _0x2a1af3[_0xca25('0x1a')]==='undefined';var _0x411230=_0x42bc1e[_0xca25('0x1b')];var _0x3705a0=_0x2b5cef?0x0:_0x2a1af3[_0xca25('0x1c')];var _0x155cf2=_0x2b5cef?_0x42bc1e['count']:_0x2a1af3[_0xca25('0x1c')]+_0x2a1af3[_0xca25('0x1a')];var _0x143243;if(_0x155cf2>=_0x411230){_0x155cf2=_0x411230;_0x143243=0xc8;}else{_0x143243=0xce;}_0x33aa25[_0xca25('0x16')](_0x143243);return _0x33aa25[_0xca25('0x1d')]('Content-Range',_0x3705a0+'-'+_0x155cf2+'/'+_0x411230)[_0xca25('0x18')](_0x42bc1e);}return null;};}function patchUpdates(_0x3598c7){return function(_0x235d92){try{jsonpatch[_0xca25('0x1e')](_0x235d92,_0x3598c7,!![]);}catch(_0x327719){return BPromise[_0xca25('0x1f')](_0x327719);}return _0x235d92[_0xca25('0x20')]();};}function saveUpdates(_0x54c91a,_0x48fdf5){return function(_0x23f69a){if(_0x23f69a){return _0x23f69a[_0xca25('0x21')](_0x54c91a)[_0xca25('0x22')](function(_0x1596dd){return _0x1596dd;});}return null;};}function removeEntity(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(_0x8cec43){return _0x8cec43[_0xca25('0x23')]()[_0xca25('0x22')](function(){var _0x349364=_0x8cec43[_0xca25('0x24')]({'plain':!![]});var _0x20dc6d='Tags';return db[_0xca25('0x25')][_0xca25('0x23')]({'where':{'type':_0x20dc6d,'resourceId':_0x349364['id']}})[_0xca25('0x22')](function(){return _0x8cec43;});})[_0xca25('0x22')](function(){_0x2615d4[_0xca25('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274de1,_0x41eb3a){return function(_0x3d7414){if(!_0x3d7414){_0x274de1[_0xca25('0x26')](0x194);}return _0x3d7414;};}function handleError(_0x2ae0e3,_0x375112){_0x375112=_0x375112||0x1f4;return function(_0xfd888c){logger[_0xca25('0x27')](_0xfd888c[_0xca25('0x28')]);if(_0xfd888c[_0xca25('0x29')]){delete _0xfd888c[_0xca25('0x29')];}_0x2ae0e3[_0xca25('0x16')](_0x375112)[_0xca25('0x2a')](_0xfd888c);};}exports[_0xca25('0x2b')]=function(_0x455df1,_0x2433bb){var _0x14ad0f={},_0x333a43={},_0x478d30={'count':0x0,'rows':[]};var _0x2ecabe=_[_0xca25('0x2c')](db[_0xca25('0x2d')]['rawAttributes'],function(_0xe86982){return{'name':_0xe86982[_0xca25('0x2e')],'type':_0xe86982[_0xca25('0x2f')][_0xca25('0x30')]};});_0x333a43[_0xca25('0x31')]=_[_0xca25('0x2c')](_0x2ecabe,'name');_0x333a43[_0xca25('0x32')]=_['keys'](_0x455df1[_0xca25('0x32')]);_0x333a43[_0xca25('0x33')]=_[_0xca25('0x34')](_0x333a43['model'],_0x333a43[_0xca25('0x32')]);_0x14ad0f[_0xca25('0x35')]=_[_0xca25('0x34')](_0x333a43[_0xca25('0x31')],qs[_0xca25('0x36')](_0x455df1['query'][_0xca25('0x36')]));_0x14ad0f[_0xca25('0x35')]=_0x14ad0f[_0xca25('0x35')][_0xca25('0x37')]?_0x14ad0f[_0xca25('0x35')]:_0x333a43[_0xca25('0x31')];if(!_0x455df1[_0xca25('0x32')]['hasOwnProperty']('nolimit')){_0x14ad0f[_0xca25('0x1a')]=qs[_0xca25('0x1a')](_0x455df1['query']['limit']);_0x14ad0f[_0xca25('0x1c')]=qs[_0xca25('0x1c')](_0x455df1[_0xca25('0x32')]['offset']);}_0x14ad0f[_0xca25('0x38')]=qs[_0xca25('0x39')](_0x455df1[_0xca25('0x32')][_0xca25('0x39')]);_0x14ad0f[_0xca25('0x3a')]=qs[_0xca25('0x33')](_['pick'](_0x455df1[_0xca25('0x32')],_0x333a43['filters']),_0x2ecabe);if(_0x455df1[_0xca25('0x32')][_0xca25('0x3b')]){_0x14ad0f[_0xca25('0x3a')]=_[_0xca25('0x3c')](_0x14ad0f[_0xca25('0x3a')],{'$or':_[_0xca25('0x2c')](_0x2ecabe,function(_0x99ed21){if(_0x99ed21[_0xca25('0x2f')]!==_0xca25('0x3d')){var _0x513995={};_0x513995[_0x99ed21[_0xca25('0x29')]]={'$like':'%'+_0x455df1['query'][_0xca25('0x3b')]+'%'};return _0x513995;}})});}_0x14ad0f=_['merge']({},_0x14ad0f,_0x455df1[_0xca25('0x3e')]);var _0x184ed5={'where':_0x14ad0f[_0xca25('0x3a')]};return db[_0xca25('0x2d')]['count'](_0x184ed5)[_0xca25('0x22')](function(_0x5aafa5){_0x478d30[_0xca25('0x1b')]=_0x5aafa5;if(_0x455df1[_0xca25('0x32')]['includeAll']){_0x14ad0f[_0xca25('0x3f')]=[{'all':!![]}];}return db[_0xca25('0x2d')][_0xca25('0x40')](_0x14ad0f);})[_0xca25('0x22')](function(_0x1068c9){_0x478d30[_0xca25('0x41')]=_0x1068c9;return _0x478d30;})[_0xca25('0x22')](respondWithFilteredResult(_0x2433bb,_0x14ad0f))['catch'](handleError(_0x2433bb,null));};exports[_0xca25('0x42')]=function(_0x300e20,_0x57ed5f){var _0x5b1062={'raw':!![],'where':{'id':_0x300e20['params']['id']}},_0x487710={};_0x487710[_0xca25('0x31')]=_[_0xca25('0x43')](db[_0xca25('0x2d')][_0xca25('0x44')]);_0x487710['query']=_[_0xca25('0x43')](_0x300e20[_0xca25('0x32')]);_0x487710[_0xca25('0x33')]=_[_0xca25('0x34')](_0x487710['model'],_0x487710[_0xca25('0x32')]);_0x5b1062['attributes']=_[_0xca25('0x34')](_0x487710[_0xca25('0x31')],qs[_0xca25('0x36')](_0x300e20[_0xca25('0x32')][_0xca25('0x36')]));_0x5b1062[_0xca25('0x35')]=_0x5b1062['attributes'][_0xca25('0x37')]?_0x5b1062[_0xca25('0x35')]:_0x487710[_0xca25('0x31')];if(_0x300e20[_0xca25('0x32')][_0xca25('0x45')]){_0x5b1062[_0xca25('0x3f')]=[{'all':!![]}];}_0x5b1062=_[_0xca25('0x3c')]({},_0x5b1062,_0x300e20[_0xca25('0x3e')]);return db[_0xca25('0x2d')][_0xca25('0x46')](_0x5b1062)[_0xca25('0x22')](handleEntityNotFound(_0x57ed5f,null))[_0xca25('0x22')](respondWithResult(_0x57ed5f,null))[_0xca25('0x47')](handleError(_0x57ed5f,null));};exports[_0xca25('0x48')]=function(_0x3279e0,_0x1fba32){return db[_0xca25('0x2d')][_0xca25('0x48')](_0x3279e0['body'],{})[_0xca25('0x22')](function(_0x39d342){var _0x9fcba=_0x3279e0[_0xca25('0x49')]['get']({'plain':!![]});if(!_0x9fcba)throw new Error(_0xca25('0x4a'));if(_0x9fcba[_0xca25('0x4b')]==='user'){var _0x2bc528=_0x39d342[_0xca25('0x24')]({'plain':!![]});var _0x747387=_0xca25('0x4c');return db['UserProfileSection'][_0xca25('0x46')]({'where':{'name':_0x747387,'userProfileId':_0x9fcba['userProfileId']},'raw':!![]})[_0xca25('0x22')](function(_0x485252){if(_0x485252&&_0x485252['autoAssociation']===0x0){return db[_0xca25('0x25')][_0xca25('0x48')]({'name':_0x2bc528[_0xca25('0x29')],'resourceId':_0x2bc528['id'],'type':_0x485252[_0xca25('0x29')],'sectionId':_0x485252['id']},{})['then'](function(){return _0x39d342;});}else{return _0x39d342;}})['catch'](function(_0xfaf8f5){logger['error'](_0xca25('0x4d'),_0xfaf8f5);throw _0xfaf8f5;});}return _0x39d342;})[_0xca25('0x22')](respondWithResult(_0x1fba32,0xc9))[_0xca25('0x47')](handleError(_0x1fba32,null));};exports[_0xca25('0x21')]=function(_0x149dcd,_0x4d2f9c){if(_0x149dcd['body']['id']){delete _0x149dcd[_0xca25('0x4e')]['id'];}return db[_0xca25('0x2d')][_0xca25('0x46')]({'where':{'id':_0x149dcd[_0xca25('0x4f')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x4d2f9c,null))[_0xca25('0x22')](saveUpdates(_0x149dcd['body'],null))[_0xca25('0x22')](respondWithResult(_0x4d2f9c,null))[_0xca25('0x47')](handleError(_0x4d2f9c,null));};exports[_0xca25('0x23')]=function(_0xa4fec2,_0x86fc48){return db[_0xca25('0x2d')][_0xca25('0x46')]({'where':{'id':_0xa4fec2[_0xca25('0x4f')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x86fc48,null))['then'](removeEntity(_0x86fc48,null))[_0xca25('0x47')](handleError(_0x86fc48,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 12a9aa4..9ab709e 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 _0x5e4e=['request-promise','rimraf','./tag.attributes','exports','define','Tag','tools_tags','lodash','api','bluebird'];(function(_0x1d4076,_0x223f3f){var _0x3301f7=function(_0x4ec0f6){while(--_0x4ec0f6){_0x1d4076['push'](_0x1d4076['shift']());}};_0x3301f7(++_0x223f3f);}(_0x5e4e,0x89));var _0xe5e4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5e4e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xe5e4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe5e4('0x1'));var moment=require('moment');var BPromise=require(_0xe5e4('0x2'));var rp=require(_0xe5e4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5e4('0x4'));var config=require('../../config/environment');var attributes=require(_0xe5e4('0x5'));module[_0xe5e4('0x6')]=function(_0x2a72ee,_0x1188e5){return _0x2a72ee[_0xe5e4('0x7')](_0xe5e4('0x8'),attributes,{'tableName':_0xe5e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2dd=['bluebird','path','../../config/environment','exports','define','tools_tags','lodash','util','moment'];(function(_0x2158d8,_0x5f4e7c){var _0x14fe4f=function(_0x37d84d){while(--_0x37d84d){_0x2158d8['push'](_0x2158d8['shift']());}};_0x14fe4f(++_0x5f4e7c);}(_0xf2dd,0x84));var _0xdf2d=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0xf2dd[_0x58efa6];return _0x5d643c;};'use strict';var _=require(_0xdf2d('0x0'));var util=require(_0xdf2d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdf2d('0x2'));var BPromise=require(_0xdf2d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf2d('0x4'));var rimraf=require('rimraf');var config=require(_0xdf2d('0x5'));var attributes=require('./tag.attributes');module[_0xdf2d('0x6')]=function(_0x523d8f,_0x1289f1){return _0x523d8f[_0xdf2d('0x7')]('Tag',attributes,{'tableName':_0xdf2d('0x8'),'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 67021b5..84a657f 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 _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x7bae[_0x5416db];return _0x243e35;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('Tag,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('Tag,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});} \ No newline at end of file +var _0x1b73=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1b73,0x1d5));var _0x31b7=function(_0xb3dc0c,_0x4ebd36){_0xb3dc0c=_0xb3dc0c-0x0;var _0x413e4a=_0x1b73[_0xb3dc0c];return _0x413e4a;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('Tag,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('Tag,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b521db5..f1231e9 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 c26e110..156afe4 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 _0x757a=['exports','STRING'];(function(_0x1f604b,_0x221930){var _0x42ed00=function(_0x11ed35){while(--_0x11ed35){_0x1f604b['push'](_0x1f604b['shift']());}};_0x42ed00(++_0x221930);}(_0x757a,0xde));var _0xa757=function(_0x8fa181,_0x56bc76){_0x8fa181=_0x8fa181-0x0;var _0x583c82=_0x757a[_0x8fa181];return _0x583c82;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x45ad95,_0x5a2b77){var _0x2b700d=function(_0x54e300){while(--_0x54e300){_0x45ad95['push'](_0x45ad95['shift']());}};_0x2b700d(++_0x5a2b77);}(_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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 69d31a4..4dac953 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 _0xf1ac=['order','Queues','addQueues','isValidChannel','add','ids','remove','addAgents','isArray','Voice','Mail','Sms','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','all','spread','Chat','removeAgents','Queue:remove','getAgents','hasOwnProperty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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/environment','../../config/license/util','redis','localhost','socket.io-emitter','./team.socket','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','then','sendStatus','error','name','index','Team','rawAttributes','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue'];(function(_0x25c2f3,_0x421b85){var _0x387723=function(_0xc404ae){while(--_0xc404ae){_0x25c2f3['push'](_0x25c2f3['shift']());}};_0x387723(++_0x421b85);}(_0xf1ac,0xb9));var _0xcf1a=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0xf1ac[_0x590b63];return _0x3c9380;};'use strict';var emlformat=require(_0xcf1a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf1a('0x1'));var jsonpatch=require(_0xcf1a('0x2'));var rp=require('request-promise');var moment=require(_0xcf1a('0x3'));var BPromise=require(_0xcf1a('0x4'));var Mustache=require(_0xcf1a('0x5'));var util=require(_0xcf1a('0x6'));var path=require(_0xcf1a('0x7'));var sox=require(_0xcf1a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf1a('0x9'));var _=require(_0xcf1a('0xa'));var squel=require(_0xcf1a('0xb'));var crypto=require('crypto');var jsforce=require(_0xcf1a('0xc'));var deskjs=require(_0xcf1a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcf1a('0xe'));var Papa=require(_0xcf1a('0xf'));var Redis=require(_0xcf1a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcf1a('0x11'));var as=require(_0xcf1a('0x12'));var hardwareService=require(_0xcf1a('0x13'));var logger=require(_0xcf1a('0x14'))(_0xcf1a('0x15'));var utils=require(_0xcf1a('0x16'));var config=require(_0xcf1a('0x17'));var licenseUtil=require(_0xcf1a('0x18'));var db=require('../../mysqldb')['db'];config[_0xcf1a('0x19')]=_['defaults'](config[_0xcf1a('0x19')],{'host':_0xcf1a('0x1a'),'port':0x18eb});var socket=require(_0xcf1a('0x1b'))(new Redis(config[_0xcf1a('0x19')]));require(_0xcf1a('0x1c'))['register'](socket);function respondWithStatusCode(_0x44076a,_0xe6ebba){_0xe6ebba=_0xe6ebba||0xcc;return function(_0x142605){if(_0x142605){return _0x44076a['sendStatus'](_0xe6ebba);}return _0x44076a[_0xcf1a('0x1d')](_0xe6ebba)[_0xcf1a('0x1e')]();};}function respondWithResult(_0x85d503,_0x1495ff){_0x1495ff=_0x1495ff||0xc8;return function(_0x38160b){if(_0x38160b){return _0x85d503[_0xcf1a('0x1d')](_0x1495ff)['json'](_0x38160b);}};}function respondWithFilteredResult(_0x22cac8,_0x266fb9){return function(_0x1e919c){if(_0x1e919c){var _0x4425cf=typeof _0x266fb9['offset']===_0xcf1a('0x1f')&&typeof _0x266fb9[_0xcf1a('0x20')]===_0xcf1a('0x1f');var _0x148d0b=_0x1e919c[_0xcf1a('0x21')];var _0x5f3656=_0x4425cf?0x0:_0x266fb9[_0xcf1a('0x22')];var _0x6e0d6c=_0x4425cf?_0x1e919c[_0xcf1a('0x21')]:_0x266fb9[_0xcf1a('0x22')]+_0x266fb9[_0xcf1a('0x20')];var _0x1a96cc;if(_0x6e0d6c>=_0x148d0b){_0x6e0d6c=_0x148d0b;_0x1a96cc=0xc8;}else{_0x1a96cc=0xce;}_0x22cac8['status'](_0x1a96cc);return _0x22cac8[_0xcf1a('0x23')](_0xcf1a('0x24'),_0x5f3656+'-'+_0x6e0d6c+'/'+_0x148d0b)[_0xcf1a('0x25')](_0x1e919c);}return null;};}function patchUpdates(_0x371b6e){return function(_0x2b355){try{jsonpatch['apply'](_0x2b355,_0x371b6e,!![]);}catch(_0x24ff0b){return BPromise['reject'](_0x24ff0b);}return _0x2b355[_0xcf1a('0x26')]();};}function saveUpdates(_0x4dd618,_0x59a7df){return function(_0x1568f2){if(_0x1568f2){return _0x1568f2[_0xcf1a('0x27')](_0x4dd618)[_0xcf1a('0x28')](function(_0x45726b){return _0x45726b;});}return null;};}function handleEntityNotFound(_0x37e2fc,_0xefce04){return function(_0x177f3b){if(!_0x177f3b){_0x37e2fc[_0xcf1a('0x29')](0x194);}return _0x177f3b;};}function handleError(_0x58cd95,_0xbb84d2){_0xbb84d2=_0xbb84d2||0x1f4;return function(_0xe2e873){logger[_0xcf1a('0x2a')](_0xe2e873['stack']);if(_0xe2e873[_0xcf1a('0x2b')]){delete _0xe2e873['name'];}_0x58cd95[_0xcf1a('0x1d')](_0xbb84d2)['send'](_0xe2e873);};}exports[_0xcf1a('0x2c')]=function(_0x190e40,_0x67e7aa){var _0x5f011f={},_0x21d08f={},_0x303453={'count':0x0,'rows':[]};var _0x160344=_['map'](db[_0xcf1a('0x2d')][_0xcf1a('0x2e')],function(_0x332044){return{'name':_0x332044['fieldName'],'type':_0x332044['type']['key']};});_0x21d08f[_0xcf1a('0x2f')]=_[_0xcf1a('0x30')](_0x160344,_0xcf1a('0x2b'));_0x21d08f[_0xcf1a('0x31')]=_['keys'](_0x190e40[_0xcf1a('0x31')]);_0x21d08f['filters']=_[_0xcf1a('0x32')](_0x21d08f['model'],_0x21d08f['query']);_0x5f011f[_0xcf1a('0x33')]=_[_0xcf1a('0x32')](_0x21d08f[_0xcf1a('0x2f')],qs['fields'](_0x190e40['query'][_0xcf1a('0x34')]));_0x5f011f['attributes']=_0x5f011f['attributes'][_0xcf1a('0x35')]?_0x5f011f[_0xcf1a('0x33')]:_0x21d08f[_0xcf1a('0x2f')];if(!_0x190e40[_0xcf1a('0x31')]['hasOwnProperty'](_0xcf1a('0x36'))){_0x5f011f['limit']=qs[_0xcf1a('0x20')](_0x190e40['query'][_0xcf1a('0x20')]);_0x5f011f['offset']=qs[_0xcf1a('0x22')](_0x190e40['query'][_0xcf1a('0x22')]);}_0x5f011f['order']=qs[_0xcf1a('0x37')](_0x190e40[_0xcf1a('0x31')][_0xcf1a('0x37')]);_0x5f011f[_0xcf1a('0x38')]=qs[_0xcf1a('0x39')](_[_0xcf1a('0x3a')](_0x190e40[_0xcf1a('0x31')],_0x21d08f['filters']),_0x160344);if(_0x190e40[_0xcf1a('0x31')][_0xcf1a('0x3b')]){_0x5f011f[_0xcf1a('0x38')]=_[_0xcf1a('0x3c')](_0x5f011f[_0xcf1a('0x38')],{'$or':_['map'](_0x160344,function(_0x488513){if(_0x488513[_0xcf1a('0x3d')]!=='VIRTUAL'){var _0x3a788d={};_0x3a788d[_0x488513[_0xcf1a('0x2b')]]={'$like':'%'+_0x190e40[_0xcf1a('0x31')][_0xcf1a('0x3b')]+'%'};return _0x3a788d;}})});}_0x5f011f=_[_0xcf1a('0x3c')]({},_0x5f011f,_0x190e40[_0xcf1a('0x3e')]);var _0x31d9a8={'where':_0x5f011f[_0xcf1a('0x38')]};return db[_0xcf1a('0x2d')]['count'](_0x31d9a8)[_0xcf1a('0x28')](function(_0x48f266){_0x303453[_0xcf1a('0x21')]=_0x48f266;if(_0x190e40[_0xcf1a('0x31')][_0xcf1a('0x3f')]){_0x5f011f[_0xcf1a('0x40')]=[{'all':!![]}];}return db[_0xcf1a('0x2d')][_0xcf1a('0x41')](_0x5f011f);})[_0xcf1a('0x28')](function(_0x2f93c0){_0x303453[_0xcf1a('0x42')]=_0x2f93c0;return _0x303453;})[_0xcf1a('0x28')](respondWithFilteredResult(_0x67e7aa,_0x5f011f))[_0xcf1a('0x43')](handleError(_0x67e7aa,null));};exports['show']=function(_0x2b388e,_0x4a34ee){var _0x1484a6={'raw':![],'where':{'id':_0x2b388e['params']['id']}},_0xaf2fc2={};_0xaf2fc2[_0xcf1a('0x2f')]=_['keys'](db[_0xcf1a('0x2d')][_0xcf1a('0x2e')]);_0xaf2fc2[_0xcf1a('0x31')]=_[_0xcf1a('0x44')](_0x2b388e[_0xcf1a('0x31')]);_0xaf2fc2[_0xcf1a('0x39')]=_[_0xcf1a('0x32')](_0xaf2fc2[_0xcf1a('0x2f')],_0xaf2fc2[_0xcf1a('0x31')]);_0x1484a6['attributes']=_[_0xcf1a('0x32')](_0xaf2fc2[_0xcf1a('0x2f')],qs[_0xcf1a('0x34')](_0x2b388e[_0xcf1a('0x31')][_0xcf1a('0x34')]));_0x1484a6[_0xcf1a('0x33')]=_0x1484a6['attributes'][_0xcf1a('0x35')]?_0x1484a6[_0xcf1a('0x33')]:_0xaf2fc2['model'];if(_0x2b388e[_0xcf1a('0x31')][_0xcf1a('0x3f')]){_0x1484a6[_0xcf1a('0x40')]=[{'all':!![]}];}_0x1484a6=_[_0xcf1a('0x3c')]({},_0x1484a6,_0x2b388e['options']);return db[_0xcf1a('0x2d')][_0xcf1a('0x45')](_0x1484a6)[_0xcf1a('0x28')](handleEntityNotFound(_0x4a34ee,null))[_0xcf1a('0x28')](respondWithResult(_0x4a34ee,null))[_0xcf1a('0x43')](handleError(_0x4a34ee,null));};exports[_0xcf1a('0x46')]=function(_0xa4c9cc,_0x4d2fa2){return db[_0xcf1a('0x2d')]['create'](_0xa4c9cc[_0xcf1a('0x47')],{})['then'](function(_0x3afd9e){var _0x19fd2c=_0xa4c9cc[_0xcf1a('0x48')][_0xcf1a('0x49')]({'plain':!![]});if(!_0x19fd2c)throw new Error(_0xcf1a('0x4a'));if(_0x19fd2c['role']===_0xcf1a('0x48')){var _0x1c87fb=_0x3afd9e[_0xcf1a('0x49')]({'plain':!![]});var _0x572e48=_0xcf1a('0x4b');return db[_0xcf1a('0x4c')][_0xcf1a('0x45')]({'where':{'name':_0x572e48,'userProfileId':_0x19fd2c['userProfileId']},'raw':!![]})[_0xcf1a('0x28')](function(_0x13dd02){if(_0x13dd02&&_0x13dd02[_0xcf1a('0x4d')]===0x0){return db[_0xcf1a('0x4e')][_0xcf1a('0x46')]({'name':_0x1c87fb[_0xcf1a('0x2b')],'resourceId':_0x1c87fb['id'],'type':_0x13dd02[_0xcf1a('0x2b')],'sectionId':_0x13dd02['id']},{})[_0xcf1a('0x28')](function(){return _0x3afd9e;});}else{return _0x3afd9e;}})[_0xcf1a('0x43')](function(_0x242a4a){logger['error'](_0xcf1a('0x4f'),_0x242a4a);throw _0x242a4a;});}return _0x3afd9e;})['then'](respondWithResult(_0x4d2fa2,0xc9))[_0xcf1a('0x43')](handleError(_0x4d2fa2,null));};exports[_0xcf1a('0x27')]=function(_0x9687f5,_0x2871be){if(_0x9687f5[_0xcf1a('0x47')]['id']){delete _0x9687f5[_0xcf1a('0x47')]['id'];}return db[_0xcf1a('0x2d')][_0xcf1a('0x45')]({'where':{'id':_0x9687f5[_0xcf1a('0x50')]['id']}})[_0xcf1a('0x28')](handleEntityNotFound(_0x2871be,null))[_0xcf1a('0x28')](saveUpdates(_0x9687f5['body'],null))[_0xcf1a('0x28')](respondWithResult(_0x2871be,null))[_0xcf1a('0x43')](handleError(_0x2871be,null));};exports[_0xcf1a('0x51')]=function(_0x26fcf5,_0x1cd9f5){var _0x5d95b2=_0x26fcf5[_0xcf1a('0x50')]['id'];var _0x287902=[];return db['sequelize'][_0xcf1a('0x52')](function(_0x1c30f2){var _0x1eca0e=_0xcf1a('0x53')+_0x5d95b2;return db[_0xcf1a('0x54')][_0xcf1a('0x31')](_0x1eca0e,{'type':db[_0xcf1a('0x55')][_0xcf1a('0x56')][_0xcf1a('0x57')],'raw':!![],'transaction':_0x1c30f2})['then'](function(_0x1c9d12){_0x287902=_[_0xcf1a('0x30')](_0x1c9d12,function(_0x58b41f){return Number(_0x58b41f[_0xcf1a('0x58')]);});})[_0xcf1a('0x28')](function(){var _0x8825b7='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5d95b2;return db[_0xcf1a('0x54')][_0xcf1a('0x31')](_0x8825b7,{'type':db[_0xcf1a('0x55')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(_0x1c6471){var _0xe19940=_[_0xcf1a('0x30')](_0x1c6471,function(_0x39eed1){return Number(_0x39eed1[_0xcf1a('0x59')]);});return db[_0xcf1a('0x5a')][_0xcf1a('0x51')]({'where':{'UserId':{'$in':_0x287902},'VoiceQueueId':{'$in':_0xe19940}},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){var _0x2cac91=_0xcf1a('0x5b')+_0x5d95b2;return db[_0xcf1a('0x54')]['query'](_0x2cac91,{'type':db[_0xcf1a('0x55')][_0xcf1a('0x56')][_0xcf1a('0x57')],'raw':!![],'transaction':_0x1c30f2});})['then'](function(_0x5d43c9){var _0x47f3d7=_[_0xcf1a('0x30')](_0x5d43c9,function(_0xce5f23){return Number(_0xce5f23[_0xcf1a('0x5c')]);});return db[_0xcf1a('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x287902},'MailQueueId':{'$in':_0x47f3d7}},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){var _0x59d0=_0xcf1a('0x5e')+_0x5d95b2;return db[_0xcf1a('0x54')]['query'](_0x59d0,{'type':db['Sequelize'][_0xcf1a('0x56')][_0xcf1a('0x57')],'raw':!![],'transaction':_0x1c30f2});})['then'](function(_0x5a0fc0){var _0x437c48=_[_0xcf1a('0x30')](_0x5a0fc0,function(_0x1b7063){return Number(_0x1b7063[_0xcf1a('0x5f')]);});return db[_0xcf1a('0x60')]['destroy']({'where':{'UserId':{'$in':_0x287902},'SmsQueueId':{'$in':_0x437c48}},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){var _0x915e82=_0xcf1a('0x61')+_0x5d95b2;return db[_0xcf1a('0x54')][_0xcf1a('0x31')](_0x915e82,{'type':db[_0xcf1a('0x55')][_0xcf1a('0x56')][_0xcf1a('0x57')],'raw':!![],'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(_0x17bc4d){var _0x16f8d6=_['map'](_0x17bc4d,function(_0x6b09dd){return Number(_0x6b09dd[_0xcf1a('0x62')]);});return db['UserChatQueue'][_0xcf1a('0x51')]({'where':{'UserId':{'$in':_0x287902},'ChatQueueId':{'$in':_0x16f8d6}},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){var _0x19f88c=_0xcf1a('0x63')+_0x5d95b2;return db['sequelize']['query'](_0x19f88c,{'type':db[_0xcf1a('0x55')][_0xcf1a('0x56')]['SELECT'],'raw':!![],'transaction':_0x1c30f2});})['then'](function(_0x2ecd8c){var _0x2a3616=_[_0xcf1a('0x30')](_0x2ecd8c,function(_0x40d56f){return Number(_0x40d56f[_0xcf1a('0x64')]);});return db[_0xcf1a('0x65')][_0xcf1a('0x51')]({'where':{'UserId':{'$in':_0x287902},'FaxQueueId':{'$in':_0x2a3616}},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){var _0x46e731=_0xcf1a('0x66')+_0x5d95b2;return db['sequelize'][_0xcf1a('0x31')](_0x46e731,{'type':db[_0xcf1a('0x55')][_0xcf1a('0x56')][_0xcf1a('0x57')],'raw':!![],'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(_0x358124){var _0x27ee3d=_[_0xcf1a('0x30')](_0x358124,function(_0x403d4b){return Number(_0x403d4b[_0xcf1a('0x67')]);});return db[_0xcf1a('0x68')][_0xcf1a('0x51')]({'where':{'UserId':{'$in':_0x287902},'OpenchannelQueueId':{'$in':_0x27ee3d}},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){var _0x275051=_0xcf1a('0x69')+_0x5d95b2;return db[_0xcf1a('0x54')][_0xcf1a('0x31')](_0x275051,{'type':db[_0xcf1a('0x55')][_0xcf1a('0x56')]['SELECT'],'raw':!![],'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(_0x2eafc0){var _0x517ee1=_['map'](_0x2eafc0,function(_0x47f028){return Number(_0x47f028[_0xcf1a('0x6a')]);});return db['UserWhatsappQueue'][_0xcf1a('0x51')]({'where':{'UserId':{'$in':_0x287902},'WhatsappQueueId':{'$in':_0x517ee1}},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){return db[_0xcf1a('0x6b')]['find']({'where':{'TeamId':_0x5d95b2}});})[_0xcf1a('0x28')](function(_0x257554){if(_0x257554===null){return;}return db[_0xcf1a('0x6c')][_0xcf1a('0x51')]({'where':{'UserId':{'$in':_0x287902},'VoicePrefixId':_0x257554[_0xcf1a('0x6d')]},'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(){return db[_0xcf1a('0x2d')][_0xcf1a('0x51')]({'where':{'id':_0x5d95b2},'cascade':!![],'transaction':_0x1c30f2});})[_0xcf1a('0x28')](function(_0x44014d){if(_0x44014d===0x0){_0x1cd9f5[_0xcf1a('0x29')](0x194);}else{return db[_0xcf1a('0x4e')][_0xcf1a('0x51')]({'where':{'type':_0xcf1a('0x4b'),'resourceId':_0x5d95b2},'cascade':!![],'transaction':_0x1c30f2})[_0xcf1a('0x28')](function(){_0x1cd9f5['status'](0xcc)[_0xcf1a('0x1e')]();});}})[_0xcf1a('0x43')](function(_0x335cdd){_0x1cd9f5[_0xcf1a('0x1d')](0x1f4)[_0xcf1a('0x6e')](_0x335cdd);});});};exports[_0xcf1a('0x6f')]=function(_0x26bb7f,_0x4b689e,_0x416d27){return db[_0xcf1a('0x2d')][_0xcf1a('0x70')]({'where':{'id':_0x26bb7f[_0xcf1a('0x50')]['id']}})[_0xcf1a('0x28')](handleEntityNotFound(_0x4b689e,null))[_0xcf1a('0x28')](function(_0x30b774){if(!_0x26bb7f[_0xcf1a('0x31')][_0xcf1a('0x71')]||!utils['isValidChannel'](_0x26bb7f[_0xcf1a('0x31')]['channel'])){throw new db[(_0xcf1a('0x55'))][(_0xcf1a('0x72'))](_0xcf1a('0x73'));}var _0x29b59a={};var _0x4ac107={};_0x4ac107['model']=_[_0xcf1a('0x44')](db[_[_0xcf1a('0x74')](_0x26bb7f[_0xcf1a('0x31')][_0xcf1a('0x71')][_0xcf1a('0x75')]())+_0xcf1a('0x76')]['rawAttributes']);_0x4ac107['query']=_['keys'](_0x26bb7f[_0xcf1a('0x31')]);_0x4ac107[_0xcf1a('0x39')]=_[_0xcf1a('0x32')](_0x4ac107[_0xcf1a('0x2f')],_0x4ac107['query']);_0x29b59a[_0xcf1a('0x33')]=_[_0xcf1a('0x32')](_0x4ac107[_0xcf1a('0x2f')],qs[_0xcf1a('0x34')](_0x26bb7f[_0xcf1a('0x31')][_0xcf1a('0x34')]));_0x29b59a[_0xcf1a('0x33')]=_0x29b59a[_0xcf1a('0x33')][_0xcf1a('0x35')]?_0x29b59a[_0xcf1a('0x33')]:_0x4ac107[_0xcf1a('0x2f')];_0x29b59a[_0xcf1a('0x20')]=qs[_0xcf1a('0x20')](_0x26bb7f[_0xcf1a('0x31')][_0xcf1a('0x20')]);_0x29b59a['offset']=qs['offset'](_0x26bb7f[_0xcf1a('0x31')][_0xcf1a('0x22')]);_0x29b59a[_0xcf1a('0x77')]=qs[_0xcf1a('0x37')](_0x26bb7f[_0xcf1a('0x31')]['sort']);_0x29b59a[_0xcf1a('0x38')]=qs[_0xcf1a('0x39')](_[_0xcf1a('0x3a')](_0x26bb7f[_0xcf1a('0x31')],_0x4ac107[_0xcf1a('0x39')]));_0x29b59a=_[_0xcf1a('0x3c')]({},_0x29b59a,_0x26bb7f[_0xcf1a('0x3e')]);return _0x30b774[_0xcf1a('0x49')+_[_0xcf1a('0x74')](_0x26bb7f[_0xcf1a('0x31')][_0xcf1a('0x71')][_0xcf1a('0x75')]())+_0xcf1a('0x78')](_0x29b59a);})['then'](respondWithResult(_0x4b689e,null))[_0xcf1a('0x43')](handleError(_0x4b689e,null));};exports[_0xcf1a('0x79')]=function(_0x56ae43,_0x22931a,_0x38ecb6){return db['Team'][_0xcf1a('0x70')]({'where':{'id':_0x56ae43[_0xcf1a('0x50')]['id']}})[_0xcf1a('0x28')](function(_0x3e148e){if(_0x3e148e){if(!_0x56ae43[_0xcf1a('0x47')][_0xcf1a('0x71')]||!utils[_0xcf1a('0x7a')](_0x56ae43['body'][_0xcf1a('0x71')])){throw new db[(_0xcf1a('0x55'))][(_0xcf1a('0x72'))](_0xcf1a('0x73'));}return _0x3e148e[_0xcf1a('0x7b')+_[_0xcf1a('0x74')](_0x56ae43[_0xcf1a('0x47')]['channel']['toLowerCase']())+_0xcf1a('0x78')](_0x56ae43[_0xcf1a('0x47')][_0xcf1a('0x7c')]);}return null;})[_0xcf1a('0x28')](handleEntityNotFound(_0x22931a,null))[_0xcf1a('0x28')](respondWithStatusCode(_0x22931a,null))[_0xcf1a('0x43')](handleError(_0x22931a,null));};exports['removeQueues']=function(_0x5d682e,_0x76cac6,_0x461072){return db[_0xcf1a('0x2d')][_0xcf1a('0x70')]({'where':{'id':_0x5d682e[_0xcf1a('0x50')]['id']}})['then'](function(_0x309873){if(_0x309873){if(!_0x5d682e[_0xcf1a('0x31')][_0xcf1a('0x71')]||!utils[_0xcf1a('0x7a')](_0x5d682e[_0xcf1a('0x31')][_0xcf1a('0x71')])){throw new db[(_0xcf1a('0x55'))][(_0xcf1a('0x72'))](_0xcf1a('0x73'));}return _0x309873[_0xcf1a('0x7d')+_[_0xcf1a('0x74')](_0x5d682e[_0xcf1a('0x31')][_0xcf1a('0x71')][_0xcf1a('0x75')]())+_0xcf1a('0x78')](_0x5d682e[_0xcf1a('0x31')][_0xcf1a('0x7c')]);}return null;})[_0xcf1a('0x28')](handleEntityNotFound(_0x76cac6,null))[_0xcf1a('0x28')](respondWithStatusCode(_0x76cac6,null))['catch'](handleError(_0x76cac6,null));};exports[_0xcf1a('0x7e')]=function(_0x47fbbb,_0x11ff57){var _0x4233bd=_[_0xcf1a('0x7f')](_0x47fbbb[_0xcf1a('0x47')][_0xcf1a('0x7c')])?_0x47fbbb[_0xcf1a('0x47')][_0xcf1a('0x7c')]:[_0x47fbbb['body'][_0xcf1a('0x7c')]];var _0x3bd198=_0x47fbbb[_0xcf1a('0x50')]['id'];return db[_0xcf1a('0x2d')][_0xcf1a('0x45')]({'where':{'id':_0x3bd198}})[_0xcf1a('0x28')](handleEntityNotFound(_0x11ff57,null))[_0xcf1a('0x28')](function(_0x18ec61){if(_0x18ec61){var _0x3b93c5=[_0xcf1a('0x80'),'Chat',_0xcf1a('0x81'),_0xcf1a('0x82'),'Fax','Openchannel',_0xcf1a('0x83')];return db[_0xcf1a('0x54')][_0xcf1a('0x52')](function(_0x22b020){var _0x407236=_['map'](_0x3b93c5,function(_0x178e32){var _0x2f249e={'attributes':['id',_0xcf1a('0x2b')]};if(_0x178e32==='Voice'){_0x2f249e[_0xcf1a('0x84')]={'attributes':[_0xcf1a('0x85')]};}return _0x18ec61[_0xcf1a('0x49')+_0x178e32+'Queues'](_0x2f249e)[_0xcf1a('0x28')](function(_0xf8ff9e){var _0x38953f=_['map'](_0xf8ff9e,function(_0x5ce3d4){var _0x485c8e=_['map'](_0x4233bd,function(_0x138f3f){var _0x5d5efb={'where':{'UserId':_0x138f3f,[_0x178e32+_0xcf1a('0x86')]:_0x5ce3d4['id']},'transaction':_0x22b020};if(_0x178e32===_0xcf1a('0x80')){_0x5d5efb['defaults']={'penalty':_0x5ce3d4[_0xcf1a('0x87')]['penalty']};}return db[_0xcf1a('0x88')+_0x178e32+'Queue']['findOrCreate'](_0x5d5efb)[_0xcf1a('0x28')](function(){socket[_0xcf1a('0x89')](_0xcf1a('0x48')+_0x178e32+'Queue:save',{'UserId':_0x138f3f,[_0x178e32+'QueueId']:_0x5ce3d4['id']});if(_0x178e32!==_0xcf1a('0x80')){return;}return db[_0xcf1a('0x88')][_0xcf1a('0x41')]({'where':{'id':_0x4233bd,'online':0x1},'attributes':['id','name',_0xcf1a('0x8a'),_0xcf1a('0x8b'),_0xcf1a('0x8c')],'raw':!![]})[_0xcf1a('0x28')](function(_0xa06190){var _0xdb0858=_[_0xcf1a('0x30')](_0xa06190,function(_0x3a464d){return db[_0xcf1a('0x8d')][_0xcf1a('0x8e')]({'membername':_0x3a464d['name'],'UserId':_0x3a464d['id'],'queue_name':_0x5ce3d4[_0xcf1a('0x2b')],'VoiceQueueId':_0x5ce3d4['id'],'interface':_[_0xcf1a('0x8f')](_0x3a464d[_0xcf1a('0x8c')])?util[_0xcf1a('0x90')]('SIP/%s',_0x3a464d[_0xcf1a('0x2b')]):_0x3a464d['interface'],'paused':_0x3a464d['voicePause']||![],'penalty':_0x5ce3d4['TeamVoiceQueue'][_0xcf1a('0x85')]},{'transaction':_0x22b020});});return Promise[_0xcf1a('0x91')](_0xdb0858);});});});return Promise[_0xcf1a('0x91')](_0x485c8e);});return Promise['all'](_0x38953f);})[_0xcf1a('0x28')](function(){return db[_0xcf1a('0x6b')][_0xcf1a('0x70')]({'where':{'teamId':_0x3bd198}})[_0xcf1a('0x28')](function(_0x2189cf){if(_0x2189cf){var _0x3968a0=_[_0xcf1a('0x30')](_0x4233bd,function(_0x14094d){db[_0xcf1a('0x6c')][_0xcf1a('0x8e')]({'UserId':_0x14094d,'VoicePrefixId':_0x2189cf['VoicePrefixId']});});return Promise[_0xcf1a('0x91')](_0x3968a0);}});});});return Promise[_0xcf1a('0x91')](_0x407236)['then'](function(){return _0x18ec61[_0xcf1a('0x7e')](_0x4233bd,{'transaction':_0x22b020})[_0xcf1a('0x92')](function(_0x2a1141){return _0x2a1141;});});});}})['then'](respondWithResult(_0x11ff57,null))[_0xcf1a('0x43')](handleError(_0x11ff57,null));};exports['removeAgents']=function(_0xcc6783,_0x228344){var _0x535fe2=_[_0xcf1a('0x7f')](_0xcc6783[_0xcf1a('0x31')][_0xcf1a('0x7c')])?_0xcc6783[_0xcf1a('0x31')][_0xcf1a('0x7c')]:[_0xcc6783[_0xcf1a('0x31')]['ids']];var _0x1f92be=_0xcc6783[_0xcf1a('0x50')]['id'];return db['Team'][_0xcf1a('0x45')]({'where':{'id':_0x1f92be}})[_0xcf1a('0x28')](handleEntityNotFound(_0x228344,null))[_0xcf1a('0x28')](function(_0x2a3fbc){if(_0x2a3fbc){var _0x11b1c0=[_0xcf1a('0x80'),_0xcf1a('0x93'),'Mail',_0xcf1a('0x82'),'Fax','Openchannel','Whatsapp'];return db['sequelize'][_0xcf1a('0x52')](function(_0x1ab7c5){var _0xdefa7f=_[_0xcf1a('0x30')](_0x11b1c0,function(_0x15a5ae){var _0x10f47a={'attributes':['id',_0xcf1a('0x2b')]};return _0x2a3fbc[_0xcf1a('0x49')+_0x15a5ae+_0xcf1a('0x78')](_0x10f47a)[_0xcf1a('0x28')](function(_0xdbd7a5){var _0x3c0476=_[_0xcf1a('0x30')](_0xdbd7a5,function(_0x3c3a22){return _0x3c3a22[_0xcf1a('0x94')](_0x535fe2,{'transaction':_0x1ab7c5})[_0xcf1a('0x28')](function(){var _0x2ddccc=_[_0xcf1a('0x30')](_0x535fe2,function(_0x1a9835){socket[_0xcf1a('0x89')](_0xcf1a('0x48')+_0x15a5ae+_0xcf1a('0x95'),{'UserId':Number(_0x1a9835),[_0x15a5ae+'QueueId']:_0x3c3a22['id']});if(_0x15a5ae!==_0xcf1a('0x80')){return;}return db[_0xcf1a('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x3c3a22['id'],'UserId':_0x1a9835},'transaction':_0x1ab7c5});});return Promise['all'](_0x2ddccc);});});return Promise[_0xcf1a('0x91')](_0x3c0476);});});return Promise[_0xcf1a('0x91')](_0xdefa7f)[_0xcf1a('0x28')](function(){return _0x2a3fbc[_0xcf1a('0x94')](_0x535fe2,{'transaction':_0x1ab7c5});})[_0xcf1a('0x28')](function(){return db[_0xcf1a('0x6b')][_0xcf1a('0x70')]({'where':{'teamId':_0x1f92be}})[_0xcf1a('0x28')](function(_0x382509){if(_0x382509){var _0x48e5f2=_[_0xcf1a('0x30')](_0x535fe2,function(_0x3d3550){db[_0xcf1a('0x6c')][_0xcf1a('0x51')]({'where':{'UserId':_0x3d3550,'VoicePrefixId':_0x382509[_0xcf1a('0x6d')]}});});return Promise[_0xcf1a('0x91')](_0x48e5f2);}});});});}})['then'](respondWithStatusCode(_0x228344,null))[_0xcf1a('0x43')](handleError(_0x228344,null));};exports[_0xcf1a('0x96')]=function(_0x2fea9b,_0x5dbd2d,_0x257375){var _0x1a56a6={};var _0x2346f8={};var _0x1e0054;var _0x3587cb;return db[_0xcf1a('0x2d')][_0xcf1a('0x70')]({'where':{'id':_0x2fea9b[_0xcf1a('0x50')]['id']}})['then'](handleEntityNotFound(_0x5dbd2d,null))[_0xcf1a('0x28')](function(_0x9ec6c6){if(_0x9ec6c6){_0x1e0054=_0x9ec6c6;_0x2346f8[_0xcf1a('0x2f')]=_[_0xcf1a('0x44')](db['User'][_0xcf1a('0x2e')]);_0x2346f8[_0xcf1a('0x31')]=_[_0xcf1a('0x44')](_0x2fea9b[_0xcf1a('0x31')]);_0x2346f8['filters']=_[_0xcf1a('0x32')](_0x2346f8['model'],_0x2346f8['query']);_0x1a56a6[_0xcf1a('0x33')]=_[_0xcf1a('0x32')](_0x2346f8[_0xcf1a('0x2f')],qs[_0xcf1a('0x34')](_0x2fea9b[_0xcf1a('0x31')][_0xcf1a('0x34')]));_0x1a56a6['attributes']=_0x1a56a6[_0xcf1a('0x33')][_0xcf1a('0x35')]?_0x1a56a6[_0xcf1a('0x33')]:_0x2346f8['model'];_0x1a56a6[_0xcf1a('0x77')]=qs['sort'](_0x2fea9b[_0xcf1a('0x31')][_0xcf1a('0x37')]);_0x1a56a6[_0xcf1a('0x38')]=qs[_0xcf1a('0x39')](_[_0xcf1a('0x3a')](_0x2fea9b[_0xcf1a('0x31')],_0x2346f8[_0xcf1a('0x39')]));if(_0x2fea9b[_0xcf1a('0x31')][_0xcf1a('0x3b')]){_0x1a56a6['where']=_[_0xcf1a('0x3c')](_0x1a56a6[_0xcf1a('0x38')],{'$or':_[_0xcf1a('0x30')](_0x1a56a6[_0xcf1a('0x33')],function(_0x4c0c07){var _0x227d94={};_0x227d94[_0x4c0c07]={'$like':'%'+_0x2fea9b[_0xcf1a('0x31')][_0xcf1a('0x3b')]+'%'};return _0x227d94;})});}_0x1a56a6=_['merge']({},_0x1a56a6,_0x2fea9b['options']);return _0x1e0054[_0xcf1a('0x96')](_0x1a56a6);}})[_0xcf1a('0x28')](function(_0x400d79){if(_0x400d79){_0x3587cb=_0x400d79[_0xcf1a('0x35')];if(!_0x2fea9b[_0xcf1a('0x31')][_0xcf1a('0x97')](_0xcf1a('0x36'))){_0x1a56a6['limit']=qs[_0xcf1a('0x20')](_0x2fea9b['query']['limit']);_0x1a56a6[_0xcf1a('0x22')]=qs[_0xcf1a('0x22')](_0x2fea9b[_0xcf1a('0x31')][_0xcf1a('0x22')]);}return _0x1e0054[_0xcf1a('0x96')](_0x1a56a6);}})[_0xcf1a('0x28')](function(_0xd0b24f){if(_0xd0b24f){return _0xd0b24f?{'count':_0x3587cb,'rows':_0xd0b24f}:null;}})[_0xcf1a('0x28')](respondWithResult(_0x5dbd2d,null))[_0xcf1a('0x43')](handleError(_0x5dbd2d,null));}; \ No newline at end of file +var _0xaa3c=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','error','stack','name','send','index','map','Team','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','rows','catch','show','params','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','Teams','getQueues','findOne','channel','ValidationError','Unknown\x20channel','toLowerCase','Queues','addQueues','isValidChannel','add','capitalize','ids','removeQueues','addAgents','isArray','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','Voice','TeamVoiceQueue','penalty','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','interface','format','SIP/%s','all','spread','removeAgents','Queue:remove','getAgents','order','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse'];(function(_0x138f89,_0x55bc9e){var _0xdc0311=function(_0x14e7b1){while(--_0x14e7b1){_0x138f89['push'](_0x138f89['shift']());}};_0xdc0311(++_0x55bc9e);}(_0xaa3c,0x12f));var _0xcaa3=function(_0x5266bb,_0x41aaca){_0x5266bb=_0x5266bb-0x0;var _0xb73ecc=_0xaa3c[_0x5266bb];return _0xb73ecc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaa3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaa3('0x1'));var rp=require(_0xcaa3('0x2'));var moment=require(_0xcaa3('0x3'));var BPromise=require(_0xcaa3('0x4'));var Mustache=require(_0xcaa3('0x5'));var util=require(_0xcaa3('0x6'));var path=require(_0xcaa3('0x7'));var sox=require(_0xcaa3('0x8'));var csv=require(_0xcaa3('0x9'));var ejs=require(_0xcaa3('0xa'));var fs=require('fs');var fs_extra=require(_0xcaa3('0xb'));var _=require('lodash');var squel=require(_0xcaa3('0xc'));var crypto=require(_0xcaa3('0xd'));var jsforce=require(_0xcaa3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcaa3('0x9'));var querystring=require(_0xcaa3('0xf'));var Papa=require(_0xcaa3('0x10'));var Redis=require(_0xcaa3('0x11'));var authService=require(_0xcaa3('0x12'));var qs=require(_0xcaa3('0x13'));var as=require(_0xcaa3('0x14'));var hardwareService=require(_0xcaa3('0x15'));var logger=require('../../config/logger')(_0xcaa3('0x16'));var utils=require(_0xcaa3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcaa3('0x18'));var db=require(_0xcaa3('0x19'))['db'];config['redis']=_[_0xcaa3('0x1a')](config[_0xcaa3('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcaa3('0x1c'))(new Redis(config[_0xcaa3('0x1b')]));require(_0xcaa3('0x1d'))['register'](socket);function respondWithStatusCode(_0x4c4f54,_0x5b7f70){_0x5b7f70=_0x5b7f70||0xcc;return function(_0x1d799f){if(_0x1d799f){return _0x4c4f54[_0xcaa3('0x1e')](_0x5b7f70);}return _0x4c4f54[_0xcaa3('0x1f')](_0x5b7f70)[_0xcaa3('0x20')]();};}function respondWithResult(_0x1991d0,_0x52a159){_0x52a159=_0x52a159||0xc8;return function(_0x50db9c){if(_0x50db9c){return _0x1991d0[_0xcaa3('0x1f')](_0x52a159)[_0xcaa3('0x21')](_0x50db9c);}};}function respondWithFilteredResult(_0x5be00d,_0x575674){return function(_0x21e003){if(_0x21e003){var _0x2e9965=typeof _0x575674[_0xcaa3('0x22')]==='undefined'&&typeof _0x575674['limit']===_0xcaa3('0x23');var _0x4666e2=_0x21e003[_0xcaa3('0x24')];var _0x5594bd=_0x2e9965?0x0:_0x575674[_0xcaa3('0x22')];var _0xa0385e=_0x2e9965?_0x21e003[_0xcaa3('0x24')]:_0x575674[_0xcaa3('0x22')]+_0x575674[_0xcaa3('0x25')];var _0x4ecb0a;if(_0xa0385e>=_0x4666e2){_0xa0385e=_0x4666e2;_0x4ecb0a=0xc8;}else{_0x4ecb0a=0xce;}_0x5be00d[_0xcaa3('0x1f')](_0x4ecb0a);return _0x5be00d[_0xcaa3('0x26')](_0xcaa3('0x27'),_0x5594bd+'-'+_0xa0385e+'/'+_0x4666e2)['json'](_0x21e003);}return null;};}function patchUpdates(_0xad694a){return function(_0x28c5d4){try{jsonpatch[_0xcaa3('0x28')](_0x28c5d4,_0xad694a,!![]);}catch(_0xd21bda){return BPromise['reject'](_0xd21bda);}return _0x28c5d4['save']();};}function saveUpdates(_0x4fb45f,_0x52c0b4){return function(_0x21b499){if(_0x21b499){return _0x21b499[_0xcaa3('0x29')](_0x4fb45f)['then'](function(_0x1b2002){return _0x1b2002;});}return null;};}function handleEntityNotFound(_0x57b226,_0x98cb3){return function(_0x3264e9){if(!_0x3264e9){_0x57b226[_0xcaa3('0x1e')](0x194);}return _0x3264e9;};}function handleError(_0x12ed8d,_0xa40fa8){_0xa40fa8=_0xa40fa8||0x1f4;return function(_0x2d4ccc){logger[_0xcaa3('0x2a')](_0x2d4ccc[_0xcaa3('0x2b')]);if(_0x2d4ccc[_0xcaa3('0x2c')]){delete _0x2d4ccc[_0xcaa3('0x2c')];}_0x12ed8d[_0xcaa3('0x1f')](_0xa40fa8)[_0xcaa3('0x2d')](_0x2d4ccc);};}exports[_0xcaa3('0x2e')]=function(_0x153a39,_0x4f8b50){var _0x677e99={},_0x7b3586={},_0x448167={'count':0x0,'rows':[]};var _0x273b7b=_[_0xcaa3('0x2f')](db[_0xcaa3('0x30')][_0xcaa3('0x31')],function(_0x144660){return{'name':_0x144660['fieldName'],'type':_0x144660[_0xcaa3('0x32')]['key']};});_0x7b3586[_0xcaa3('0x33')]=_[_0xcaa3('0x2f')](_0x273b7b,'name');_0x7b3586['query']=_[_0xcaa3('0x34')](_0x153a39[_0xcaa3('0x35')]);_0x7b3586[_0xcaa3('0x36')]=_[_0xcaa3('0x37')](_0x7b3586['model'],_0x7b3586['query']);_0x677e99[_0xcaa3('0x38')]=_['intersection'](_0x7b3586[_0xcaa3('0x33')],qs[_0xcaa3('0x39')](_0x153a39[_0xcaa3('0x35')][_0xcaa3('0x39')]));_0x677e99[_0xcaa3('0x38')]=_0x677e99[_0xcaa3('0x38')][_0xcaa3('0x3a')]?_0x677e99[_0xcaa3('0x38')]:_0x7b3586[_0xcaa3('0x33')];if(!_0x153a39[_0xcaa3('0x35')][_0xcaa3('0x3b')](_0xcaa3('0x3c'))){_0x677e99[_0xcaa3('0x25')]=qs[_0xcaa3('0x25')](_0x153a39['query'][_0xcaa3('0x25')]);_0x677e99[_0xcaa3('0x22')]=qs[_0xcaa3('0x22')](_0x153a39[_0xcaa3('0x35')][_0xcaa3('0x22')]);}_0x677e99['order']=qs['sort'](_0x153a39[_0xcaa3('0x35')][_0xcaa3('0x3d')]);_0x677e99[_0xcaa3('0x3e')]=qs['filters'](_[_0xcaa3('0x3f')](_0x153a39['query'],_0x7b3586[_0xcaa3('0x36')]),_0x273b7b);if(_0x153a39[_0xcaa3('0x35')][_0xcaa3('0x40')]){_0x677e99[_0xcaa3('0x3e')]=_[_0xcaa3('0x41')](_0x677e99['where'],{'$or':_[_0xcaa3('0x2f')](_0x273b7b,function(_0x1e3678){if(_0x1e3678[_0xcaa3('0x32')]!==_0xcaa3('0x42')){var _0x1bb2e={};_0x1bb2e[_0x1e3678[_0xcaa3('0x2c')]]={'$like':'%'+_0x153a39[_0xcaa3('0x35')][_0xcaa3('0x40')]+'%'};return _0x1bb2e;}})});}_0x677e99=_['merge']({},_0x677e99,_0x153a39[_0xcaa3('0x43')]);var _0x7ea9a8={'where':_0x677e99[_0xcaa3('0x3e')]};return db[_0xcaa3('0x30')]['count'](_0x7ea9a8)[_0xcaa3('0x44')](function(_0x5a56c7){_0x448167[_0xcaa3('0x24')]=_0x5a56c7;if(_0x153a39['query']['includeAll']){_0x677e99['include']=[{'all':!![]}];}return db[_0xcaa3('0x30')][_0xcaa3('0x45')](_0x677e99);})['then'](function(_0x12e584){_0x448167[_0xcaa3('0x46')]=_0x12e584;return _0x448167;})[_0xcaa3('0x44')](respondWithFilteredResult(_0x4f8b50,_0x677e99))[_0xcaa3('0x47')](handleError(_0x4f8b50,null));};exports[_0xcaa3('0x48')]=function(_0x2f89d1,_0x1e5950){var _0x2d5bfe={'raw':![],'where':{'id':_0x2f89d1[_0xcaa3('0x49')]['id']}},_0x5bd908={};_0x5bd908[_0xcaa3('0x33')]=_[_0xcaa3('0x34')](db[_0xcaa3('0x30')][_0xcaa3('0x31')]);_0x5bd908[_0xcaa3('0x35')]=_[_0xcaa3('0x34')](_0x2f89d1[_0xcaa3('0x35')]);_0x5bd908[_0xcaa3('0x36')]=_[_0xcaa3('0x37')](_0x5bd908['model'],_0x5bd908[_0xcaa3('0x35')]);_0x2d5bfe['attributes']=_[_0xcaa3('0x37')](_0x5bd908[_0xcaa3('0x33')],qs[_0xcaa3('0x39')](_0x2f89d1[_0xcaa3('0x35')][_0xcaa3('0x39')]));_0x2d5bfe[_0xcaa3('0x38')]=_0x2d5bfe[_0xcaa3('0x38')][_0xcaa3('0x3a')]?_0x2d5bfe[_0xcaa3('0x38')]:_0x5bd908[_0xcaa3('0x33')];if(_0x2f89d1[_0xcaa3('0x35')][_0xcaa3('0x4a')]){_0x2d5bfe[_0xcaa3('0x4b')]=[{'all':!![]}];}_0x2d5bfe=_['merge']({},_0x2d5bfe,_0x2f89d1['options']);return db[_0xcaa3('0x30')]['find'](_0x2d5bfe)['then'](handleEntityNotFound(_0x1e5950,null))[_0xcaa3('0x44')](respondWithResult(_0x1e5950,null))[_0xcaa3('0x47')](handleError(_0x1e5950,null));};exports[_0xcaa3('0x4c')]=function(_0x5c0e9c,_0x47d76e){return db[_0xcaa3('0x30')][_0xcaa3('0x4c')](_0x5c0e9c[_0xcaa3('0x4d')],{})[_0xcaa3('0x44')](function(_0x353e44){var _0x3a8064=_0x5c0e9c[_0xcaa3('0x4e')][_0xcaa3('0x4f')]({'plain':!![]});if(!_0x3a8064)throw new Error(_0xcaa3('0x50'));if(_0x3a8064[_0xcaa3('0x51')]==='user'){var _0x34bd57=_0x353e44[_0xcaa3('0x4f')]({'plain':!![]});var _0x235893='Teams';return db[_0xcaa3('0x52')]['find']({'where':{'name':_0x235893,'userProfileId':_0x3a8064['userProfileId']},'raw':!![]})['then'](function(_0x358e89){if(_0x358e89&&_0x358e89[_0xcaa3('0x53')]===0x0){return db['UserProfileResource'][_0xcaa3('0x4c')]({'name':_0x34bd57[_0xcaa3('0x2c')],'resourceId':_0x34bd57['id'],'type':_0x358e89['name'],'sectionId':_0x358e89['id']},{})['then'](function(){return _0x353e44;});}else{return _0x353e44;}})['catch'](function(_0x4aa218){logger[_0xcaa3('0x2a')](_0xcaa3('0x54'),_0x4aa218);throw _0x4aa218;});}return _0x353e44;})[_0xcaa3('0x44')](respondWithResult(_0x47d76e,0xc9))[_0xcaa3('0x47')](handleError(_0x47d76e,null));};exports[_0xcaa3('0x29')]=function(_0x8de97a,_0x2f9b90){if(_0x8de97a[_0xcaa3('0x4d')]['id']){delete _0x8de97a[_0xcaa3('0x4d')]['id'];}return db[_0xcaa3('0x30')][_0xcaa3('0x55')]({'where':{'id':_0x8de97a[_0xcaa3('0x49')]['id']}})[_0xcaa3('0x44')](handleEntityNotFound(_0x2f9b90,null))[_0xcaa3('0x44')](saveUpdates(_0x8de97a[_0xcaa3('0x4d')],null))[_0xcaa3('0x44')](respondWithResult(_0x2f9b90,null))[_0xcaa3('0x47')](handleError(_0x2f9b90,null));};exports[_0xcaa3('0x56')]=function(_0x5d87e8,_0x2b350b){var _0x563d27=_0x5d87e8[_0xcaa3('0x49')]['id'];var _0x214629=[];return db[_0xcaa3('0x57')][_0xcaa3('0x58')](function(_0x31f5be){var _0x635849='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x563d27;return db[_0xcaa3('0x57')][_0xcaa3('0x35')](_0x635849,{'type':db[_0xcaa3('0x59')][_0xcaa3('0x5a')][_0xcaa3('0x5b')],'raw':!![],'transaction':_0x31f5be})[_0xcaa3('0x44')](function(_0x5e88a6){_0x214629=_[_0xcaa3('0x2f')](_0x5e88a6,function(_0x227667){return Number(_0x227667[_0xcaa3('0x5c')]);});})['then'](function(){var _0x4cee0f='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x563d27;return db[_0xcaa3('0x57')][_0xcaa3('0x35')](_0x4cee0f,{'type':db[_0xcaa3('0x59')][_0xcaa3('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(_0x55b9c5){var _0xc66994=_[_0xcaa3('0x2f')](_0x55b9c5,function(_0x250e77){return Number(_0x250e77[_0xcaa3('0x5d')]);});return db[_0xcaa3('0x5e')][_0xcaa3('0x56')]({'where':{'UserId':{'$in':_0x214629},'VoiceQueueId':{'$in':_0xc66994}},'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(){var _0x4bd9fd=_0xcaa3('0x5f')+_0x563d27;return db[_0xcaa3('0x57')][_0xcaa3('0x35')](_0x4bd9fd,{'type':db[_0xcaa3('0x59')][_0xcaa3('0x5a')][_0xcaa3('0x5b')],'raw':!![],'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(_0x4577ec){var _0x571ecc=_[_0xcaa3('0x2f')](_0x4577ec,function(_0x41a6aa){return Number(_0x41a6aa[_0xcaa3('0x60')]);});return db[_0xcaa3('0x61')]['destroy']({'where':{'UserId':{'$in':_0x214629},'MailQueueId':{'$in':_0x571ecc}},'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(){var _0x213154=_0xcaa3('0x62')+_0x563d27;return db[_0xcaa3('0x57')][_0xcaa3('0x35')](_0x213154,{'type':db[_0xcaa3('0x59')][_0xcaa3('0x5a')][_0xcaa3('0x5b')],'raw':!![],'transaction':_0x31f5be});})['then'](function(_0x22e7a7){var _0x3dc0c6=_[_0xcaa3('0x2f')](_0x22e7a7,function(_0x5e2dc9){return Number(_0x5e2dc9[_0xcaa3('0x63')]);});return db['UserSmsQueue'][_0xcaa3('0x56')]({'where':{'UserId':{'$in':_0x214629},'SmsQueueId':{'$in':_0x3dc0c6}},'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(){var _0x51318c=_0xcaa3('0x64')+_0x563d27;return db[_0xcaa3('0x57')]['query'](_0x51318c,{'type':db['Sequelize'][_0xcaa3('0x5a')][_0xcaa3('0x5b')],'raw':!![],'transaction':_0x31f5be});})['then'](function(_0xd0f842){var _0x3f20a8=_[_0xcaa3('0x2f')](_0xd0f842,function(_0x18c507){return Number(_0x18c507[_0xcaa3('0x65')]);});return db[_0xcaa3('0x66')][_0xcaa3('0x56')]({'where':{'UserId':{'$in':_0x214629},'ChatQueueId':{'$in':_0x3f20a8}},'transaction':_0x31f5be});})['then'](function(){var _0x57f57c=_0xcaa3('0x67')+_0x563d27;return db['sequelize'][_0xcaa3('0x35')](_0x57f57c,{'type':db['Sequelize'][_0xcaa3('0x5a')][_0xcaa3('0x5b')],'raw':!![],'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(_0x26cdd0){var _0x10e1a7=_['map'](_0x26cdd0,function(_0x8c28f2){return Number(_0x8c28f2[_0xcaa3('0x68')]);});return db[_0xcaa3('0x69')]['destroy']({'where':{'UserId':{'$in':_0x214629},'FaxQueueId':{'$in':_0x10e1a7}},'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(){var _0x115ce5=_0xcaa3('0x6a')+_0x563d27;return db[_0xcaa3('0x57')][_0xcaa3('0x35')](_0x115ce5,{'type':db[_0xcaa3('0x59')][_0xcaa3('0x5a')][_0xcaa3('0x5b')],'raw':!![],'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(_0x1a45aa){var _0x204114=_[_0xcaa3('0x2f')](_0x1a45aa,function(_0xe13091){return Number(_0xe13091[_0xcaa3('0x6b')]);});return db['UserOpenchannelQueue'][_0xcaa3('0x56')]({'where':{'UserId':{'$in':_0x214629},'OpenchannelQueueId':{'$in':_0x204114}},'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(){var _0x3b9b6e=_0xcaa3('0x6c')+_0x563d27;return db[_0xcaa3('0x57')][_0xcaa3('0x35')](_0x3b9b6e,{'type':db[_0xcaa3('0x59')][_0xcaa3('0x5a')][_0xcaa3('0x5b')],'raw':!![],'transaction':_0x31f5be});})['then'](function(_0x39b769){var _0x1f0c1a=_[_0xcaa3('0x2f')](_0x39b769,function(_0x13b815){return Number(_0x13b815[_0xcaa3('0x6d')]);});return db[_0xcaa3('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x214629},'WhatsappQueueId':{'$in':_0x1f0c1a}},'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(){return db[_0xcaa3('0x6f')]['find']({'where':{'TeamId':_0x563d27}});})['then'](function(_0x44334a){if(_0x44334a===null){return;}return db[_0xcaa3('0x70')][_0xcaa3('0x56')]({'where':{'UserId':{'$in':_0x214629},'VoicePrefixId':_0x44334a[_0xcaa3('0x71')]},'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(){return db[_0xcaa3('0x30')][_0xcaa3('0x56')]({'where':{'id':_0x563d27},'cascade':!![],'transaction':_0x31f5be});})[_0xcaa3('0x44')](function(_0x4109b1){if(_0x4109b1===0x0){_0x2b350b['sendStatus'](0x194);}else{return db[_0xcaa3('0x72')][_0xcaa3('0x56')]({'where':{'type':_0xcaa3('0x73'),'resourceId':_0x563d27},'cascade':!![],'transaction':_0x31f5be})[_0xcaa3('0x44')](function(){_0x2b350b[_0xcaa3('0x1f')](0xcc)[_0xcaa3('0x20')]();});}})[_0xcaa3('0x47')](function(_0x334464){_0x2b350b[_0xcaa3('0x1f')](0x1f4)['send'](_0x334464);});});};exports[_0xcaa3('0x74')]=function(_0x37443b,_0x576527,_0x3a235e){return db[_0xcaa3('0x30')][_0xcaa3('0x75')]({'where':{'id':_0x37443b['params']['id']}})[_0xcaa3('0x44')](handleEntityNotFound(_0x576527,null))[_0xcaa3('0x44')](function(_0x301ac4){if(!_0x37443b[_0xcaa3('0x35')][_0xcaa3('0x76')]||!utils['isValidChannel'](_0x37443b['query'][_0xcaa3('0x76')])){throw new db['Sequelize'][(_0xcaa3('0x77'))](_0xcaa3('0x78'));}var _0x234277={};var _0x899e4={};_0x899e4['model']=_[_0xcaa3('0x34')](db[_['capitalize'](_0x37443b[_0xcaa3('0x35')]['channel'][_0xcaa3('0x79')]())+'Queue']['rawAttributes']);_0x899e4['query']=_[_0xcaa3('0x34')](_0x37443b[_0xcaa3('0x35')]);_0x899e4[_0xcaa3('0x36')]=_[_0xcaa3('0x37')](_0x899e4['model'],_0x899e4[_0xcaa3('0x35')]);_0x234277['attributes']=_[_0xcaa3('0x37')](_0x899e4[_0xcaa3('0x33')],qs['fields'](_0x37443b['query'][_0xcaa3('0x39')]));_0x234277[_0xcaa3('0x38')]=_0x234277['attributes'][_0xcaa3('0x3a')]?_0x234277[_0xcaa3('0x38')]:_0x899e4[_0xcaa3('0x33')];_0x234277[_0xcaa3('0x25')]=qs[_0xcaa3('0x25')](_0x37443b[_0xcaa3('0x35')][_0xcaa3('0x25')]);_0x234277[_0xcaa3('0x22')]=qs[_0xcaa3('0x22')](_0x37443b[_0xcaa3('0x35')]['offset']);_0x234277['order']=qs[_0xcaa3('0x3d')](_0x37443b[_0xcaa3('0x35')][_0xcaa3('0x3d')]);_0x234277['where']=qs['filters'](_[_0xcaa3('0x3f')](_0x37443b['query'],_0x899e4[_0xcaa3('0x36')]));_0x234277=_[_0xcaa3('0x41')]({},_0x234277,_0x37443b[_0xcaa3('0x43')]);return _0x301ac4[_0xcaa3('0x4f')+_['capitalize'](_0x37443b[_0xcaa3('0x35')][_0xcaa3('0x76')][_0xcaa3('0x79')]())+_0xcaa3('0x7a')](_0x234277);})[_0xcaa3('0x44')](respondWithResult(_0x576527,null))[_0xcaa3('0x47')](handleError(_0x576527,null));};exports[_0xcaa3('0x7b')]=function(_0x1f99ff,_0x41b573,_0x530c29){return db[_0xcaa3('0x30')][_0xcaa3('0x75')]({'where':{'id':_0x1f99ff[_0xcaa3('0x49')]['id']}})[_0xcaa3('0x44')](function(_0x582a1e){if(_0x582a1e){if(!_0x1f99ff[_0xcaa3('0x4d')][_0xcaa3('0x76')]||!utils[_0xcaa3('0x7c')](_0x1f99ff[_0xcaa3('0x4d')][_0xcaa3('0x76')])){throw new db['Sequelize']['ValidationError'](_0xcaa3('0x78'));}return _0x582a1e[_0xcaa3('0x7d')+_[_0xcaa3('0x7e')](_0x1f99ff[_0xcaa3('0x4d')][_0xcaa3('0x76')][_0xcaa3('0x79')]())+_0xcaa3('0x7a')](_0x1f99ff[_0xcaa3('0x4d')][_0xcaa3('0x7f')]);}return null;})[_0xcaa3('0x44')](handleEntityNotFound(_0x41b573,null))[_0xcaa3('0x44')](respondWithStatusCode(_0x41b573,null))['catch'](handleError(_0x41b573,null));};exports[_0xcaa3('0x80')]=function(_0x1c5e90,_0x28991a,_0x5cbdbf){return db[_0xcaa3('0x30')]['findOne']({'where':{'id':_0x1c5e90[_0xcaa3('0x49')]['id']}})[_0xcaa3('0x44')](function(_0x329128){if(_0x329128){if(!_0x1c5e90[_0xcaa3('0x35')][_0xcaa3('0x76')]||!utils['isValidChannel'](_0x1c5e90[_0xcaa3('0x35')][_0xcaa3('0x76')])){throw new db['Sequelize'][(_0xcaa3('0x77'))](_0xcaa3('0x78'));}return _0x329128['remove'+_[_0xcaa3('0x7e')](_0x1c5e90[_0xcaa3('0x35')][_0xcaa3('0x76')][_0xcaa3('0x79')]())+'Queues'](_0x1c5e90[_0xcaa3('0x35')][_0xcaa3('0x7f')]);}return null;})[_0xcaa3('0x44')](handleEntityNotFound(_0x28991a,null))[_0xcaa3('0x44')](respondWithStatusCode(_0x28991a,null))['catch'](handleError(_0x28991a,null));};exports[_0xcaa3('0x81')]=function(_0x4b39d1,_0x12ced5){var _0x8b7ab7=_[_0xcaa3('0x82')](_0x4b39d1['body']['ids'])?_0x4b39d1[_0xcaa3('0x4d')]['ids']:[_0x4b39d1[_0xcaa3('0x4d')][_0xcaa3('0x7f')]];var _0x428f87=_0x4b39d1['params']['id'];return db[_0xcaa3('0x30')][_0xcaa3('0x55')]({'where':{'id':_0x428f87}})[_0xcaa3('0x44')](handleEntityNotFound(_0x12ced5,null))[_0xcaa3('0x44')](function(_0x398a45){if(_0x398a45){var _0x526942=['Voice',_0xcaa3('0x83'),_0xcaa3('0x84'),_0xcaa3('0x85'),_0xcaa3('0x86'),_0xcaa3('0x87'),_0xcaa3('0x88')];return db[_0xcaa3('0x57')][_0xcaa3('0x58')](function(_0x18c1e7){var _0x53a785=_['map'](_0x526942,function(_0x40f29a){var _0x20a8ad={'attributes':['id','name']};if(_0x40f29a==='Voice'){_0x20a8ad[_0xcaa3('0x89')]={'attributes':['penalty']};}return _0x398a45[_0xcaa3('0x4f')+_0x40f29a+_0xcaa3('0x7a')](_0x20a8ad)[_0xcaa3('0x44')](function(_0x1af041){var _0x3049d7=_[_0xcaa3('0x2f')](_0x1af041,function(_0x430b11){var _0x1d599b=_[_0xcaa3('0x2f')](_0x8b7ab7,function(_0x21e4ab){var _0x10af81={'where':{'UserId':_0x21e4ab,[_0x40f29a+_0xcaa3('0x8a')]:_0x430b11['id']},'transaction':_0x18c1e7};if(_0x40f29a===_0xcaa3('0x8b')){_0x10af81[_0xcaa3('0x1a')]={'penalty':_0x430b11[_0xcaa3('0x8c')][_0xcaa3('0x8d')]};}return db[_0xcaa3('0x8e')+_0x40f29a+_0xcaa3('0x8f')][_0xcaa3('0x90')](_0x10af81)[_0xcaa3('0x44')](function(){socket[_0xcaa3('0x91')](_0xcaa3('0x4e')+_0x40f29a+_0xcaa3('0x92'),{'UserId':_0x21e4ab,[_0x40f29a+'QueueId']:_0x430b11['id']});if(_0x40f29a!==_0xcaa3('0x8b')){return;}return db[_0xcaa3('0x8e')][_0xcaa3('0x45')]({'where':{'id':_0x8b7ab7,'online':0x1},'attributes':['id',_0xcaa3('0x2c'),_0xcaa3('0x93'),_0xcaa3('0x94'),'interface'],'raw':!![]})[_0xcaa3('0x44')](function(_0x5d7426){var _0x18c656=_[_0xcaa3('0x2f')](_0x5d7426,function(_0x5d397a){return db[_0xcaa3('0x95')][_0xcaa3('0x96')]({'membername':_0x5d397a[_0xcaa3('0x2c')],'UserId':_0x5d397a['id'],'queue_name':_0x430b11[_0xcaa3('0x2c')],'VoiceQueueId':_0x430b11['id'],'interface':_['isNil'](_0x5d397a[_0xcaa3('0x97')])?util[_0xcaa3('0x98')](_0xcaa3('0x99'),_0x5d397a[_0xcaa3('0x2c')]):_0x5d397a['interface'],'paused':_0x5d397a['voicePause']||![],'penalty':_0x430b11[_0xcaa3('0x8c')][_0xcaa3('0x8d')]},{'transaction':_0x18c1e7});});return Promise[_0xcaa3('0x9a')](_0x18c656);});});});return Promise[_0xcaa3('0x9a')](_0x1d599b);});return Promise[_0xcaa3('0x9a')](_0x3049d7);})['then'](function(){return db[_0xcaa3('0x6f')][_0xcaa3('0x75')]({'where':{'teamId':_0x428f87}})[_0xcaa3('0x44')](function(_0x16ea32){if(_0x16ea32){var _0x5f159e=_[_0xcaa3('0x2f')](_0x8b7ab7,function(_0x31f299){db[_0xcaa3('0x70')]['upsert']({'UserId':_0x31f299,'VoicePrefixId':_0x16ea32['VoicePrefixId']});});return Promise[_0xcaa3('0x9a')](_0x5f159e);}});});});return Promise['all'](_0x53a785)[_0xcaa3('0x44')](function(){return _0x398a45['addAgents'](_0x8b7ab7,{'transaction':_0x18c1e7})[_0xcaa3('0x9b')](function(_0x39b9cf){return _0x39b9cf;});});});}})[_0xcaa3('0x44')](respondWithResult(_0x12ced5,null))['catch'](handleError(_0x12ced5,null));};exports[_0xcaa3('0x9c')]=function(_0x25f573,_0x35c542){var _0x112a5f=_[_0xcaa3('0x82')](_0x25f573[_0xcaa3('0x35')][_0xcaa3('0x7f')])?_0x25f573[_0xcaa3('0x35')][_0xcaa3('0x7f')]:[_0x25f573['query']['ids']];var _0x1c7120=_0x25f573[_0xcaa3('0x49')]['id'];return db[_0xcaa3('0x30')][_0xcaa3('0x55')]({'where':{'id':_0x1c7120}})[_0xcaa3('0x44')](handleEntityNotFound(_0x35c542,null))[_0xcaa3('0x44')](function(_0x5ee2b3){if(_0x5ee2b3){var _0x381cf7=[_0xcaa3('0x8b'),_0xcaa3('0x83'),_0xcaa3('0x84'),_0xcaa3('0x85'),'Fax',_0xcaa3('0x87'),_0xcaa3('0x88')];return db[_0xcaa3('0x57')]['transaction'](function(_0x4d9c4b){var _0x59f63d=_[_0xcaa3('0x2f')](_0x381cf7,function(_0x32bfca){var _0x3f7f65={'attributes':['id',_0xcaa3('0x2c')]};return _0x5ee2b3['get'+_0x32bfca+_0xcaa3('0x7a')](_0x3f7f65)['then'](function(_0x2a87bf){var _0x1e591e=_[_0xcaa3('0x2f')](_0x2a87bf,function(_0x48b137){return _0x48b137[_0xcaa3('0x9c')](_0x112a5f,{'transaction':_0x4d9c4b})[_0xcaa3('0x44')](function(){var _0x260a56=_[_0xcaa3('0x2f')](_0x112a5f,function(_0x1bb89c){socket[_0xcaa3('0x91')](_0xcaa3('0x4e')+_0x32bfca+_0xcaa3('0x9d'),{'UserId':Number(_0x1bb89c),[_0x32bfca+_0xcaa3('0x8a')]:_0x48b137['id']});if(_0x32bfca!==_0xcaa3('0x8b')){return;}return db[_0xcaa3('0x95')][_0xcaa3('0x56')]({'where':{'VoiceQueueId':_0x48b137['id'],'UserId':_0x1bb89c},'transaction':_0x4d9c4b});});return Promise[_0xcaa3('0x9a')](_0x260a56);});});return Promise[_0xcaa3('0x9a')](_0x1e591e);});});return Promise['all'](_0x59f63d)[_0xcaa3('0x44')](function(){return _0x5ee2b3[_0xcaa3('0x9c')](_0x112a5f,{'transaction':_0x4d9c4b});})[_0xcaa3('0x44')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1c7120}})['then'](function(_0x2d53af){if(_0x2d53af){var _0x2bb428=_[_0xcaa3('0x2f')](_0x112a5f,function(_0x52d84b){db[_0xcaa3('0x70')][_0xcaa3('0x56')]({'where':{'UserId':_0x52d84b,'VoicePrefixId':_0x2d53af['VoicePrefixId']}});});return Promise[_0xcaa3('0x9a')](_0x2bb428);}});});});}})[_0xcaa3('0x44')](respondWithStatusCode(_0x35c542,null))[_0xcaa3('0x47')](handleError(_0x35c542,null));};exports[_0xcaa3('0x9e')]=function(_0x559f61,_0x55bb7c,_0x30a72d){var _0xbd6ca5={};var _0xceee75={};var _0x2202c0;var _0x592a52;return db[_0xcaa3('0x30')]['findOne']({'where':{'id':_0x559f61[_0xcaa3('0x49')]['id']}})[_0xcaa3('0x44')](handleEntityNotFound(_0x55bb7c,null))[_0xcaa3('0x44')](function(_0x18de3a){if(_0x18de3a){_0x2202c0=_0x18de3a;_0xceee75[_0xcaa3('0x33')]=_['keys'](db[_0xcaa3('0x8e')][_0xcaa3('0x31')]);_0xceee75['query']=_['keys'](_0x559f61[_0xcaa3('0x35')]);_0xceee75[_0xcaa3('0x36')]=_[_0xcaa3('0x37')](_0xceee75[_0xcaa3('0x33')],_0xceee75[_0xcaa3('0x35')]);_0xbd6ca5[_0xcaa3('0x38')]=_[_0xcaa3('0x37')](_0xceee75[_0xcaa3('0x33')],qs[_0xcaa3('0x39')](_0x559f61[_0xcaa3('0x35')][_0xcaa3('0x39')]));_0xbd6ca5[_0xcaa3('0x38')]=_0xbd6ca5['attributes'][_0xcaa3('0x3a')]?_0xbd6ca5['attributes']:_0xceee75['model'];_0xbd6ca5[_0xcaa3('0x9f')]=qs[_0xcaa3('0x3d')](_0x559f61['query'][_0xcaa3('0x3d')]);_0xbd6ca5[_0xcaa3('0x3e')]=qs[_0xcaa3('0x36')](_[_0xcaa3('0x3f')](_0x559f61[_0xcaa3('0x35')],_0xceee75[_0xcaa3('0x36')]));if(_0x559f61[_0xcaa3('0x35')][_0xcaa3('0x40')]){_0xbd6ca5[_0xcaa3('0x3e')]=_['merge'](_0xbd6ca5['where'],{'$or':_[_0xcaa3('0x2f')](_0xbd6ca5[_0xcaa3('0x38')],function(_0x5ad8d3){var _0x3afb2f={};_0x3afb2f[_0x5ad8d3]={'$like':'%'+_0x559f61[_0xcaa3('0x35')][_0xcaa3('0x40')]+'%'};return _0x3afb2f;})});}_0xbd6ca5=_[_0xcaa3('0x41')]({},_0xbd6ca5,_0x559f61['options']);return _0x2202c0['getAgents'](_0xbd6ca5);}})[_0xcaa3('0x44')](function(_0x211ad7){if(_0x211ad7){_0x592a52=_0x211ad7['length'];if(!_0x559f61[_0xcaa3('0x35')][_0xcaa3('0x3b')](_0xcaa3('0x3c'))){_0xbd6ca5[_0xcaa3('0x25')]=qs[_0xcaa3('0x25')](_0x559f61[_0xcaa3('0x35')][_0xcaa3('0x25')]);_0xbd6ca5[_0xcaa3('0x22')]=qs[_0xcaa3('0x22')](_0x559f61[_0xcaa3('0x35')][_0xcaa3('0x22')]);}return _0x2202c0[_0xcaa3('0x9e')](_0xbd6ca5);}})[_0xcaa3('0x44')](function(_0x37ce75){if(_0x37ce75){return _0x37ce75?{'count':_0x592a52,'rows':_0x37ce75}:null;}})['then'](respondWithResult(_0x55bb7c,null))[_0xcaa3('0x47')](handleError(_0x55bb7c,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 2487c63..5a08e82 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 _0x9cfd=['events','../../mysqldb','Team','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x9cfd,0x1e6));var _0xd9cf=function(_0x29cdbb,_0x138d7a){_0x29cdbb=_0x29cdbb-0x0;var _0x14588a=_0x9cfd[_0x29cdbb];return _0x14588a;};'use strict';var EventEmitter=require(_0xd9cf('0x0'));var Team=require(_0xd9cf('0x1'))['db'][_0xd9cf('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd9cf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd9cf('0x4'),'afterDestroy':_0xd9cf('0x5')};function emitEvent(_0x5e296b){return function(_0x473de6,_0x348e74,_0x13726e){TeamEvents[_0xd9cf('0x6')](_0x5e296b+':'+_0x473de6['id'],_0x473de6);TeamEvents[_0xd9cf('0x6')](_0x5e296b,_0x473de6);_0x13726e(null);};}for(var e in events){if(events[_0xd9cf('0x7')](e)){var event=events[e];Team[_0xd9cf('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xaf1e=['hook','events','save','emit','hasOwnProperty'];(function(_0x26a890,_0x5ab42b){var _0x424aff=function(_0x369910){while(--_0x369910){_0x26a890['push'](_0x26a890['shift']());}};_0x424aff(++_0x5ab42b);}(_0xaf1e,0x6a));var _0xeaf1=function(_0x377c54,_0xaa078c){_0x377c54=_0x377c54-0x0;var _0x411d0e=_0xaf1e[_0x377c54];return _0x411d0e;};'use strict';var EventEmitter=require(_0xeaf1('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeaf1('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a651f){return function(_0x1ed48a,_0x5951de,_0x33ade4){TeamEvents[_0xeaf1('0x2')](_0x5a651f+':'+_0x1ed48a['id'],_0x1ed48a);TeamEvents[_0xeaf1('0x2')](_0x5a651f,_0x1ed48a);_0x33ade4(null);};}for(var e in events){if(events[_0xeaf1('0x3')](e)){var event=events[e];Team[_0xeaf1('0x4')](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 695b581..cc0d042 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 _0x7019=['teams','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Team'];(function(_0x4fd245,_0x597ec1){var _0x4b1fa5=function(_0x3379ed){while(--_0x3379ed){_0x4fd245['push'](_0x4fd245['shift']());}};_0x4b1fa5(++_0x597ec1);}(_0x7019,0x1d5));var _0x9701=function(_0x3c8e4c,_0x40248f){_0x3c8e4c=_0x3c8e4c-0x0;var _0xc36e83=_0x7019[_0x3c8e4c];return _0xc36e83;};'use strict';var _=require(_0x9701('0x0'));var util=require(_0x9701('0x1'));var logger=require('../../config/logger')(_0x9701('0x2'));var moment=require(_0x9701('0x3'));var BPromise=require(_0x9701('0x4'));var rp=require(_0x9701('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9701('0x6'));var config=require(_0x9701('0x7'));var attributes=require('./team.attributes');module[_0x9701('0x8')]=function(_0x59e279,_0x2b8909){return _0x59e279[_0x9701('0x9')](_0x9701('0xa'),attributes,{'tableName':_0x9701('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dca=['../../config/environment','define','Team','teams','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x10d0c4,_0x3d31b0){var _0xc51083=function(_0x175e33){while(--_0x175e33){_0x10d0c4['push'](_0x10d0c4['shift']());}};_0xc51083(++_0x3d31b0);}(_0x1dca,0x12d));var _0xa1dc=function(_0x4e4061,_0x26503b){_0x4e4061=_0x4e4061-0x0;var _0x371dbd=_0x1dca[_0x4e4061];return _0x371dbd;};'use strict';var _=require(_0xa1dc('0x0'));var util=require(_0xa1dc('0x1'));var logger=require('../../config/logger')(_0xa1dc('0x2'));var moment=require(_0xa1dc('0x3'));var BPromise=require('bluebird');var rp=require(_0xa1dc('0x4'));var fs=require('fs');var path=require(_0xa1dc('0x5'));var rimraf=require(_0xa1dc('0x6'));var config=require(_0xa1dc('0x7'));var attributes=require('./team.attributes');module['exports']=function(_0x51d65c,_0x2e28ec){return _0x51d65c[_0xa1dc('0x8')](_0xa1dc('0x9'),attributes,{'tableName':_0xa1dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 6ee6fe8..4124045 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 _0x4113=['request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4113,0xb3));var _0x3411=function(_0x524051,_0x38458c){_0x524051=_0x524051-0x0;var _0xa21de6=_0x4113[_0x524051];return _0xa21de6;};'use strict';var _=require(_0x3411('0x0'));var util=require(_0x3411('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3411('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3411('0x3'));var logger=require(_0x3411('0x4'))(_0x3411('0x5'));var config=require(_0x3411('0x6'));var jayson=require(_0x3411('0x7'));var client=jayson['client'][_0x3411('0x8')]({'port':0x232a});config[_0x3411('0x9')]=_[_0x3411('0xa')](config['redis'],{'host':_0x3411('0xb'),'port':0x18eb});var socket=require(_0x3411('0xc'))(new Redis(config[_0x3411('0x9')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x581432,_0x4abca2,_0x131946){return new BPromise(function(_0x5634a5,_0x158a6a){return client[_0x3411('0xd')](_0x581432,_0x131946)[_0x3411('0xe')](function(_0x23c77a){logger[_0x3411('0xf')]('Team,\x20%s,\x20%s',_0x4abca2,'request\x20sent');logger[_0x3411('0x10')](_0x3411('0x11'),_0x4abca2,'request\x20sent',JSON[_0x3411('0x12')](_0x23c77a));if(_0x23c77a[_0x3411('0x13')]){if(_0x23c77a['error'][_0x3411('0x14')]===0x1f4){logger[_0x3411('0x13')](_0x3411('0x15'),_0x4abca2,_0x23c77a['error']['message']);return _0x158a6a(_0x23c77a[_0x3411('0x13')][_0x3411('0x16')]);}logger[_0x3411('0x13')](_0x3411('0x15'),_0x4abca2,_0x23c77a[_0x3411('0x13')]['message']);return _0x5634a5(_0x23c77a[_0x3411('0x13')]['message']);}else{logger[_0x3411('0xf')](_0x3411('0x15'),_0x4abca2,'request\x20sent');_0x5634a5(_0x23c77a[_0x3411('0x17')][_0x3411('0x16')]);}})['catch'](function(_0x4152d8){logger[_0x3411('0x13')](_0x3411('0x15'),_0x4abca2,_0x4152d8);_0x158a6a(_0x4152d8);});});} \ No newline at end of file +var _0x3fc6=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./team.socket','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x4d6fca,_0x43903f){var _0x1e4d99=function(_0x4eb093){while(--_0x4eb093){_0x4d6fca['push'](_0x4d6fca['shift']());}};_0x1e4d99(++_0x43903f);}(_0x3fc6,0x159));var _0x63fc=function(_0x5119aa,_0x10a6f3){_0x5119aa=_0x5119aa-0x0;var _0x2a8b08=_0x3fc6[_0x5119aa];return _0x2a8b08;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var moment=require(_0x63fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require(_0x63fc('0x5'))['db'];var utils=require(_0x63fc('0x6'));var logger=require(_0x63fc('0x7'))(_0x63fc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x63fc('0x9')][_0x63fc('0xa')]({'port':0x232a});config[_0x63fc('0xb')]=_['defaults'](config[_0x63fc('0xb')],{'host':_0x63fc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63fc('0xb')]));require(_0x63fc('0xd'))[_0x63fc('0xe')](socket);function respondWithRpcPromise(_0x21866b,_0xef7fb2,_0x2b5926){return new BPromise(function(_0x17cf03,_0xdec16){return client[_0x63fc('0xf')](_0x21866b,_0x2b5926)[_0x63fc('0x10')](function(_0x4ba501){logger[_0x63fc('0x11')](_0x63fc('0x12'),_0xef7fb2,_0x63fc('0x13'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0xef7fb2,_0x63fc('0x13'),JSON[_0x63fc('0x14')](_0x4ba501));if(_0x4ba501[_0x63fc('0x15')]){if(_0x4ba501[_0x63fc('0x15')][_0x63fc('0x16')]===0x1f4){logger[_0x63fc('0x15')]('Team,\x20%s,\x20%s',_0xef7fb2,_0x4ba501[_0x63fc('0x15')][_0x63fc('0x17')]);return _0xdec16(_0x4ba501[_0x63fc('0x15')][_0x63fc('0x17')]);}logger['error'](_0x63fc('0x12'),_0xef7fb2,_0x4ba501['error'][_0x63fc('0x17')]);return _0x17cf03(_0x4ba501[_0x63fc('0x15')][_0x63fc('0x17')]);}else{logger[_0x63fc('0x11')](_0x63fc('0x12'),_0xef7fb2,'request\x20sent');_0x17cf03(_0x4ba501[_0x63fc('0x18')][_0x63fc('0x17')]);}})[_0x63fc('0x19')](function(_0x5b5076){logger['error'](_0x63fc('0x12'),_0xef7fb2,_0x5b5076);_0xdec16(_0x5b5076);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index ba989da..f28f315 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 _0x3192=['removeListener','length','team:','remove','update','emit'];(function(_0x29ccaf,_0x2f2df3){var _0x2b0431=function(_0xb1bbd4){while(--_0xb1bbd4){_0x29ccaf['push'](_0x29ccaf['shift']());}};_0x2b0431(++_0x2f2df3);}(_0x3192,0x147));var _0x2319=function(_0x4c4de1,_0x526099){_0x4c4de1=_0x4c4de1-0x0;var _0x226003=_0x3192[_0x4c4de1];return _0x226003;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x2319('0x0'),_0x2319('0x1')];function createListener(_0xdc4f6f,_0x4fe933){return function(_0x5dead8){_0x4fe933[_0x2319('0x2')](_0xdc4f6f,_0x5dead8);};}function removeListener(_0x4f6619,_0xff29af){return function(){TeamEvents[_0x2319('0x3')](_0x4f6619,_0xff29af);};}exports['register']=function(_0x51d4d5){for(var _0x5c2133=0x0,_0x13c4cd=events[_0x2319('0x4')];_0x5c2133<_0x13c4cd;_0x5c2133++){var _0x4f9695=events[_0x5c2133];var _0x10690c=createListener(_0x2319('0x5')+_0x4f9695,_0x51d4d5);TeamEvents['on'](_0x4f9695,_0x10690c);}}; \ No newline at end of file +var _0xfad0=['length','team:','save','update','removeListener','register'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xfad0,0xb0));var _0x0fad=function(_0x552676,_0x3975b5){_0x552676=_0x552676-0x0;var _0x8d2322=_0xfad0[_0x552676];return _0x8d2322;};'use strict';var TeamEvents=require('./team.events');var events=[_0x0fad('0x0'),'remove',_0x0fad('0x1')];function createListener(_0x1bc2d3,_0x5777c9){return function(_0x123ebf){_0x5777c9['emit'](_0x1bc2d3,_0x123ebf);};}function removeListener(_0x302912,_0x83f1ad){return function(){TeamEvents[_0x0fad('0x2')](_0x302912,_0x83f1ad);};}exports[_0x0fad('0x3')]=function(_0x1280d9){for(var _0x4292b7=0x0,_0x305a4f=events[_0x0fad('0x4')];_0x4292b7<_0x305a4f;_0x4292b7++){var _0x28ecd8=events[_0x4292b7];var _0x3be118=createListener(_0x0fad('0x5')+_0x28ecd8,_0x1280d9);TeamEvents['on'](_0x28ecd8,_0x3be118);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 25a53d9..82c9c47 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 _0xe7c2=['exports','INTEGER','sequelize'];(function(_0x5f3372,_0x252cbf){var _0x5a3396=function(_0x277530){while(--_0x277530){_0x5f3372['push'](_0x5f3372['shift']());}};_0x5a3396(++_0x252cbf);}(_0xe7c2,0xc8));var _0x2e7c=function(_0x218fc8,_0x3e00f1){_0x218fc8=_0x218fc8-0x0;var _0x3f6955=_0xe7c2[_0x218fc8];return _0x3f6955;};'use strict';var Sequelize=require(_0x2e7c('0x0'));module[_0x2e7c('0x1')]={'TeamId':{'type':Sequelize[_0x2e7c('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2e7c('0x2')]}}; \ No newline at end of file +var _0xc181=['sequelize','exports','INTEGER'];(function(_0x158771,_0x3b2086){var _0x50aa04=function(_0x385ad1){while(--_0x385ad1){_0x158771['push'](_0x158771['shift']());}};_0x50aa04(++_0x3b2086);}(_0xc181,0x126));var _0x1c18=function(_0xda4fad,_0x37db34){_0xda4fad=_0xda4fad-0x0;var _0x56ae95=_0xc181[_0xda4fad];return _0x56ae95;};'use strict';var Sequelize=require(_0x1c18('0x0'));module[_0x1c18('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x1c18('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 2fd3a63..1f37262 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 _0xf603=['request-promise','path','rimraf','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment','bluebird'];(function(_0x48df7d,_0x4a5324){var _0xc78c=function(_0x2d22c6){while(--_0x2d22c6){_0x48df7d['push'](_0x48df7d['shift']());}};_0xc78c(++_0x4a5324);}(_0xf603,0xeb));var _0x3f60=function(_0x5c32b3,_0x567601){_0x5c32b3=_0x5c32b3-0x0;var _0x52e0f1=_0xf603[_0x5c32b3];return _0x52e0f1;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var logger=require(_0x3f60('0x2'))('api');var moment=require(_0x3f60('0x3'));var BPromise=require(_0x3f60('0x4'));var rp=require(_0x3f60('0x5'));var fs=require('fs');var path=require(_0x3f60('0x6'));var rimraf=require(_0x3f60('0x7'));var config=require('../../config/environment');var attributes=require(_0x3f60('0x8'));module['exports']=function(_0x5914cd,_0x2910c7){return _0x5914cd[_0x3f60('0x9')](_0x3f60('0xa'),attributes,{'tableName':_0x3f60('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x689b=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger'];(function(_0x5d3a01,_0x5de0c8){var _0x18eb3f=function(_0x4bb354){while(--_0x4bb354){_0x5d3a01['push'](_0x5d3a01['shift']());}};_0x18eb3f(++_0x5de0c8);}(_0x689b,0x142));var _0xb689=function(_0x2be206,_0xdc70b3){_0x2be206=_0x2be206-0x0;var _0x5d5523=_0x689b[_0x2be206];return _0x5d5523;};'use strict';var _=require(_0xb689('0x0'));var util=require('util');var logger=require(_0xb689('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb689('0x2'));var rp=require(_0xb689('0x3'));var fs=require('fs');var path=require(_0xb689('0x4'));var rimraf=require(_0xb689('0x5'));var config=require(_0xb689('0x6'));var attributes=require(_0xb689('0x7'));module[_0xb689('0x8')]=function(_0x4bb98f,_0x1b9fed){return _0x4bb98f[_0xb689('0x9')](_0xb689('0xa'),attributes,{'tableName':_0xb689('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 66aa7ca..b1ef4e0 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5a9ab4,_0xce8154){var _0x34eee5=function(_0x37c547){while(--_0x37c547){_0x5a9ab4['push'](_0x5a9ab4['shift']());}};_0x34eee5(++_0xce8154);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0xcb91[_0x4b4d43];return _0x5706ba;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x494ee1,_0x1f18e1){var _0x1e0057=function(_0x4cbc1f){while(--_0x4cbc1f){_0x494ee1['push'](_0x494ee1['shift']());}};_0x1e0057(++_0x1f18e1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 1c5c632..66bee0f 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 _0x3b8b=['exports','INTEGER','sequelize'];(function(_0x11d407,_0x35bec5){var _0x3a2485=function(_0x16f1c0){while(--_0x16f1c0){_0x11d407['push'](_0x11d407['shift']());}};_0x3a2485(++_0x35bec5);}(_0x3b8b,0x146));var _0xb3b8=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x3b8b[_0x3a4f18];return _0x4c20fc;};'use strict';var Sequelize=require(_0xb3b8('0x0'));module[_0xb3b8('0x1')]={'penalty':{'type':Sequelize[_0xb3b8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2e10=['sequelize','exports','INTEGER'];(function(_0x2d7dfe,_0x3a189a){var _0x187e2b=function(_0x2a04ad){while(--_0x2a04ad){_0x2d7dfe['push'](_0x2d7dfe['shift']());}};_0x187e2b(++_0x3a189a);}(_0x2e10,0xe7));var _0x02e1=function(_0x15eaea,_0x593951){_0x15eaea=_0x15eaea-0x0;var _0xb274c6=_0x2e10[_0x15eaea];return _0xb274c6;};'use strict';var Sequelize=require(_0x02e1('0x0'));module[_0x02e1('0x1')]={'penalty':{'type':Sequelize[_0x02e1('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 0de4e35..33e29ae 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 _0x38c3=['api','moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x20d7c0,_0x1652fd){var _0x4f33f2=function(_0x4aca9d){while(--_0x4aca9d){_0x20d7c0['push'](_0x20d7c0['shift']());}};_0x4f33f2(++_0x1652fd);}(_0x38c3,0x13d));var _0x338c=function(_0x40f09a,_0x3743b6){_0x40f09a=_0x40f09a-0x0;var _0x2eb96c=_0x38c3[_0x40f09a];return _0x2eb96c;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var logger=require('../../config/logger')(_0x338c('0x2'));var moment=require(_0x338c('0x3'));var BPromise=require(_0x338c('0x4'));var rp=require(_0x338c('0x5'));var fs=require('fs');var path=require(_0x338c('0x6'));var rimraf=require(_0x338c('0x7'));var config=require('../../config/environment');var attributes=require(_0x338c('0x8'));module['exports']=function(_0x41c16d,_0x28eeb3){return _0x41c16d['define'](_0x338c('0x9'),attributes,{'tableName':_0x338c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdfd=['team_has_voice_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','TeamVoiceQueue'];(function(_0x4985cf,_0x3b9571){var _0x173f5b=function(_0x3823d9){while(--_0x3823d9){_0x4985cf['push'](_0x4985cf['shift']());}};_0x173f5b(++_0x3b9571);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbdf('0x1'));var moment=require(_0xdbdf('0x2'));var BPromise=require(_0xdbdf('0x3'));var rp=require(_0xdbdf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbdf('0x5'));var config=require(_0xdbdf('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0xdbdf('0x7')]=function(_0xa743ff,_0x484034){return _0xa743ff[_0xdbdf('0x8')](_0xdbdf('0x9'),attributes,{'tableName':_0xdbdf('0xa'),'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 fb055ce..e9d78be 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 _0x5329=['TeamVoiceQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5329,0xab));var _0x9532=function(_0x33a2ac,_0x54ac7c){_0x33a2ac=_0x33a2ac-0x0;var _0x1b8af7=_0x5329[_0x33a2ac];return _0x1b8af7;};'use strict';var _=require('lodash');var util=require(_0x9532('0x0'));var moment=require(_0x9532('0x1'));var BPromise=require(_0x9532('0x2'));var rs=require(_0x9532('0x3'));var fs=require('fs');var Redis=require(_0x9532('0x4'));var db=require(_0x9532('0x5'))['db'];var utils=require(_0x9532('0x6'));var logger=require('../../config/logger')(_0x9532('0x7'));var config=require(_0x9532('0x8'));var jayson=require(_0x9532('0x9'));var client=jayson['client'][_0x9532('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e5f51,_0x27f59e,_0x57a34b){return new BPromise(function(_0x5aaf9b,_0x1c528f){return client[_0x9532('0xb')](_0x4e5f51,_0x57a34b)[_0x9532('0xc')](function(_0x5bcf91){logger[_0x9532('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x27f59e,_0x9532('0xe'));logger[_0x9532('0xf')](_0x9532('0x10'),_0x27f59e,_0x9532('0xe'),JSON[_0x9532('0x11')](_0x5bcf91));if(_0x5bcf91[_0x9532('0x12')]){if(_0x5bcf91[_0x9532('0x12')][_0x9532('0x13')]===0x1f4){logger[_0x9532('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x27f59e,_0x5bcf91[_0x9532('0x12')][_0x9532('0x14')]);return _0x1c528f(_0x5bcf91[_0x9532('0x12')][_0x9532('0x14')]);}logger[_0x9532('0x12')](_0x9532('0x15'),_0x27f59e,_0x5bcf91[_0x9532('0x12')][_0x9532('0x14')]);return _0x5aaf9b(_0x5bcf91[_0x9532('0x12')]['message']);}else{logger[_0x9532('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x27f59e,_0x9532('0xe'));_0x5aaf9b(_0x5bcf91[_0x9532('0x16')]['message']);}})[_0x9532('0x17')](function(_0x50142c){logger[_0x9532('0x12')](_0x9532('0x15'),_0x27f59e,_0x50142c);_0x1c528f(_0x50142c);});});} \ No newline at end of file +var _0xe373=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x52d10a,_0x5f33ef){var _0x2a165a=function(_0x4c4052){while(--_0x4c4052){_0x52d10a['push'](_0x52d10a['shift']());}};_0x2a165a(++_0x5f33ef);}(_0xe373,0x11c));var _0x3e37=function(_0x55ba96,_0x45530e){_0x55ba96=_0x55ba96-0x0;var _0x41a1d0=_0xe373[_0x55ba96];return _0x41a1d0;};'use strict';var _=require(_0x3e37('0x0'));var util=require(_0x3e37('0x1'));var moment=require(_0x3e37('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e37('0x4'));var logger=require(_0x3e37('0x5'))(_0x3e37('0x6'));var config=require(_0x3e37('0x7'));var jayson=require(_0x3e37('0x8'));var client=jayson[_0x3e37('0x9')][_0x3e37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42d6e3,_0x2e8fc8,_0x563c98){return new BPromise(function(_0x5e2509,_0x435f3f){return client[_0x3e37('0xb')](_0x42d6e3,_0x563c98)['then'](function(_0x45c876){logger[_0x3e37('0xc')](_0x3e37('0xd'),_0x2e8fc8,'request\x20sent');logger[_0x3e37('0xe')](_0x3e37('0xf'),_0x2e8fc8,'request\x20sent',JSON[_0x3e37('0x10')](_0x45c876));if(_0x45c876['error']){if(_0x45c876[_0x3e37('0x11')][_0x3e37('0x12')]===0x1f4){logger[_0x3e37('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2e8fc8,_0x45c876['error']['message']);return _0x435f3f(_0x45c876[_0x3e37('0x11')][_0x3e37('0x13')]);}logger[_0x3e37('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2e8fc8,_0x45c876['error'][_0x3e37('0x13')]);return _0x5e2509(_0x45c876[_0x3e37('0x11')][_0x3e37('0x13')]);}else{logger['info'](_0x3e37('0xd'),_0x2e8fc8,_0x3e37('0x14'));_0x5e2509(_0x45c876[_0x3e37('0x15')][_0x3e37('0x13')]);}})[_0x3e37('0x16')](function(_0x4d1794){logger['error'](_0x3e37('0xd'),_0x2e8fc8,_0x4d1794);_0x435f3f(_0x4d1794);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 7536dbd..809fd15 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 _0x85de=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','index','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2820e1,_0x1a78f2){var _0x360a15=function(_0x23d278){while(--_0x23d278){_0x2820e1['push'](_0x2820e1['shift']());}};_0x360a15(++_0x1a78f2);}(_0x85de,0x65));var _0xe85d=function(_0x2fc62f,_0x2144f5){_0x2fc62f=_0x2fc62f-0x0;var _0x570ce5=_0x85de[_0x2fc62f];return _0x570ce5;};'use strict';var multer=require(_0xe85d('0x0'));var util=require(_0xe85d('0x1'));var path=require(_0xe85d('0x2'));var timeout=require(_0xe85d('0x3'));var express=require(_0xe85d('0x4'));var router=express[_0xe85d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe85d('0x6'));var interaction=require(_0xe85d('0x7'));var config=require(_0xe85d('0x8'));var controller=require(_0xe85d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe85d('0xa')]);router[_0xe85d('0xb')](_0xe85d('0xc'),auth[_0xe85d('0xd')](),controller['show']);router[_0xe85d('0xe')]('/',auth[_0xe85d('0xd')](),controller[_0xe85d('0xf')]);router[_0xe85d('0x10')](_0xe85d('0xc'),auth[_0xe85d('0xd')](),controller[_0xe85d('0x11')]);router[_0xe85d('0x12')](_0xe85d('0xc'),auth[_0xe85d('0xd')](),controller[_0xe85d('0x13')]);module[_0xe85d('0x14')]=router; \ No newline at end of file +var _0xc599=['/:id','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','post','create','put'];(function(_0x5ac94d,_0x5d3a8c){var _0x563863=function(_0x39285d){while(--_0x39285d){_0x5ac94d['push'](_0x5ac94d['shift']());}};_0x563863(++_0x5d3a8c);}(_0xc599,0x1b2));var _0x9c59=function(_0x223b71,_0x597bfb){_0x223b71=_0x223b71-0x0;var _0x4131e4=_0xc599[_0x223b71];return _0x4131e4;};'use strict';var multer=require('multer');var util=require(_0x9c59('0x0'));var path=require('path');var timeout=require(_0x9c59('0x1'));var express=require(_0x9c59('0x2'));var router=express[_0x9c59('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9c59('0x4'));var interaction=require(_0x9c59('0x5'));var config=require(_0x9c59('0x6'));var controller=require(_0x9c59('0x7'));router[_0x9c59('0x8')]('/',auth[_0x9c59('0x9')](),controller[_0x9c59('0xa')]);router['get']('/:id',auth[_0x9c59('0x9')](),controller['show']);router[_0x9c59('0xb')]('/',auth['isAuthenticated'](),controller[_0x9c59('0xc')]);router[_0x9c59('0xd')](_0x9c59('0xe'),auth[_0x9c59('0x9')](),controller['update']);router['delete'](_0x9c59('0xe'),auth['isAuthenticated'](),controller[_0x9c59('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 6e27572..501e459 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 _0x8879=['STRING','TEXT','sequelize','exports'];(function(_0x1ff30b,_0x1e9b92){var _0x40466e=function(_0x2b75cd){while(--_0x2b75cd){_0x1ff30b['push'](_0x1ff30b['shift']());}};_0x40466e(++_0x1e9b92);}(_0x8879,0x146));var _0x9887=function(_0x1d347d,_0x1e80b3){_0x1d347d=_0x1d347d-0x0;var _0x91432f=_0x8879[_0x1d347d];return _0x91432f;};'use strict';var Sequelize=require(_0x9887('0x0'));module[_0x9887('0x1')]={'name':{'type':Sequelize[_0x9887('0x2')]},'description':{'type':Sequelize[_0x9887('0x2')]},'html':{'type':Sequelize[_0x9887('0x3')]}}; \ No newline at end of file +var _0x4622=['STRING','exports'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x4622,0x8b));var _0x2462=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x4622[_0x160248];return _0x4e589d;};'use strict';var Sequelize=require('sequelize');module[_0x2462('0x0')]={'name':{'type':Sequelize[_0x2462('0x1')]},'description':{'type':Sequelize[_0x2462('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index bce21c3..7a84963 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 _0xd075=['update','then','destroy','UserProfileResource','end','error','stack','name','send','map','Template','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','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','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','apply','reject','save'];(function(_0x54815a,_0x58bb36){var _0x31b277=function(_0x21e286){while(--_0x21e286){_0x54815a['push'](_0x54815a['shift']());}};_0x31b277(++_0x58bb36);}(_0xd075,0x17f));var _0x5d07=function(_0x35340f,_0x2f0327){_0x35340f=_0x35340f-0x0;var _0x38bb42=_0xd075[_0x35340f];return _0x38bb42;};'use strict';var emlformat=require(_0x5d07('0x0'));var rimraf=require(_0x5d07('0x1'));var zipdir=require(_0x5d07('0x2'));var jsonpatch=require(_0x5d07('0x3'));var rp=require(_0x5d07('0x4'));var moment=require(_0x5d07('0x5'));var BPromise=require(_0x5d07('0x6'));var Mustache=require(_0x5d07('0x7'));var util=require(_0x5d07('0x8'));var path=require(_0x5d07('0x9'));var sox=require(_0x5d07('0xa'));var csv=require(_0x5d07('0xb'));var ejs=require(_0x5d07('0xc'));var fs=require('fs');var fs_extra=require(_0x5d07('0xd'));var _=require(_0x5d07('0xe'));var squel=require('squel');var crypto=require(_0x5d07('0xf'));var jsforce=require(_0x5d07('0x10'));var deskjs=require(_0x5d07('0x11'));var toCsv=require(_0x5d07('0xb'));var querystring=require(_0x5d07('0x12'));var Papa=require('papaparse');var Redis=require(_0x5d07('0x13'));var authService=require(_0x5d07('0x14'));var qs=require(_0x5d07('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d07('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x5d07('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5d07('0x18'));var db=require(_0x5d07('0x19'))['db'];function respondWithStatusCode(_0xdc9fd0,_0x45cefa){_0x45cefa=_0x45cefa||0xcc;return function(_0x21bf28){if(_0x21bf28){return _0xdc9fd0[_0x5d07('0x1a')](_0x45cefa);}return _0xdc9fd0[_0x5d07('0x1b')](_0x45cefa)['end']();};}function respondWithResult(_0x345fcd,_0xd7da8f){_0xd7da8f=_0xd7da8f||0xc8;return function(_0xc7a6f9){if(_0xc7a6f9){return _0x345fcd[_0x5d07('0x1b')](_0xd7da8f)['json'](_0xc7a6f9);}};}function respondWithFilteredResult(_0x31fe6b,_0x84d7bb){return function(_0x53a3b3){if(_0x53a3b3){var _0x5b1637=typeof _0x84d7bb['offset']===_0x5d07('0x1c')&&typeof _0x84d7bb[_0x5d07('0x1d')]===_0x5d07('0x1c');var _0x30fd6e=_0x53a3b3['count'];var _0x2c1607=_0x5b1637?0x0:_0x84d7bb[_0x5d07('0x1e')];var _0x22530d=_0x5b1637?_0x53a3b3[_0x5d07('0x1f')]:_0x84d7bb[_0x5d07('0x1e')]+_0x84d7bb[_0x5d07('0x1d')];var _0x295879;if(_0x22530d>=_0x30fd6e){_0x22530d=_0x30fd6e;_0x295879=0xc8;}else{_0x295879=0xce;}_0x31fe6b[_0x5d07('0x1b')](_0x295879);return _0x31fe6b[_0x5d07('0x20')](_0x5d07('0x21'),_0x2c1607+'-'+_0x22530d+'/'+_0x30fd6e)['json'](_0x53a3b3);}return null;};}function patchUpdates(_0x5e9830){return function(_0x319c8a){try{jsonpatch[_0x5d07('0x22')](_0x319c8a,_0x5e9830,!![]);}catch(_0x2cabfd){return BPromise[_0x5d07('0x23')](_0x2cabfd);}return _0x319c8a[_0x5d07('0x24')]();};}function saveUpdates(_0x5b5f1e,_0x452f45){return function(_0xc7c960){if(_0xc7c960){return _0xc7c960[_0x5d07('0x25')](_0x5b5f1e)[_0x5d07('0x26')](function(_0x13ad17){return _0x13ad17;});}return null;};}function removeEntity(_0x4ac545,_0x406ece){return function(_0x22e9ad){if(_0x22e9ad){return _0x22e9ad[_0x5d07('0x27')]()['then'](function(){var _0x3b3bd0=_0x22e9ad['get']({'plain':!![]});var _0x1969c7='Templates';return db[_0x5d07('0x28')][_0x5d07('0x27')]({'where':{'type':_0x1969c7,'resourceId':_0x3b3bd0['id']}})[_0x5d07('0x26')](function(){return _0x22e9ad;});})[_0x5d07('0x26')](function(){_0x4ac545[_0x5d07('0x1b')](0xcc)[_0x5d07('0x29')]();});}};}function handleEntityNotFound(_0x3f8d39,_0x4da675){return function(_0x331910){if(!_0x331910){_0x3f8d39[_0x5d07('0x1a')](0x194);}return _0x331910;};}function handleError(_0x39ddbb,_0x503bb7){_0x503bb7=_0x503bb7||0x1f4;return function(_0x8076ae){logger[_0x5d07('0x2a')](_0x8076ae[_0x5d07('0x2b')]);if(_0x8076ae[_0x5d07('0x2c')]){delete _0x8076ae[_0x5d07('0x2c')];}_0x39ddbb[_0x5d07('0x1b')](_0x503bb7)[_0x5d07('0x2d')](_0x8076ae);};}exports['index']=function(_0x411415,_0x4bb7f6){var _0x5f9449={},_0x5af1d2={},_0x4684ff={'count':0x0,'rows':[]};var _0x31b8bf=_[_0x5d07('0x2e')](db[_0x5d07('0x2f')]['rawAttributes'],function(_0x3e8006){return{'name':_0x3e8006[_0x5d07('0x30')],'type':_0x3e8006['type'][_0x5d07('0x31')]};});_0x5af1d2[_0x5d07('0x32')]=_['map'](_0x31b8bf,_0x5d07('0x2c'));_0x5af1d2[_0x5d07('0x33')]=_[_0x5d07('0x34')](_0x411415[_0x5d07('0x33')]);_0x5af1d2[_0x5d07('0x35')]=_[_0x5d07('0x36')](_0x5af1d2['model'],_0x5af1d2[_0x5d07('0x33')]);_0x5f9449[_0x5d07('0x37')]=_[_0x5d07('0x36')](_0x5af1d2['model'],qs[_0x5d07('0x38')](_0x411415[_0x5d07('0x33')]['fields']));_0x5f9449[_0x5d07('0x37')]=_0x5f9449[_0x5d07('0x37')][_0x5d07('0x39')]?_0x5f9449[_0x5d07('0x37')]:_0x5af1d2[_0x5d07('0x32')];if(!_0x411415[_0x5d07('0x33')][_0x5d07('0x3a')](_0x5d07('0x3b'))){_0x5f9449[_0x5d07('0x1d')]=qs[_0x5d07('0x1d')](_0x411415[_0x5d07('0x33')][_0x5d07('0x1d')]);_0x5f9449[_0x5d07('0x1e')]=qs['offset'](_0x411415['query']['offset']);}_0x5f9449[_0x5d07('0x3c')]=qs['sort'](_0x411415[_0x5d07('0x33')][_0x5d07('0x3d')]);_0x5f9449['where']=qs[_0x5d07('0x35')](_[_0x5d07('0x3e')](_0x411415[_0x5d07('0x33')],_0x5af1d2['filters']),_0x31b8bf);if(_0x411415['query'][_0x5d07('0x3f')]){_0x5f9449['where']=_[_0x5d07('0x40')](_0x5f9449[_0x5d07('0x41')],{'$or':_['map'](_0x31b8bf,function(_0x73491e){if(_0x73491e[_0x5d07('0x42')]!=='VIRTUAL'){var _0x4b02c8={};_0x4b02c8[_0x73491e[_0x5d07('0x2c')]]={'$like':'%'+_0x411415[_0x5d07('0x33')]['filter']+'%'};return _0x4b02c8;}})});}_0x5f9449=_[_0x5d07('0x40')]({},_0x5f9449,_0x411415[_0x5d07('0x43')]);var _0x5771a1={'where':_0x5f9449[_0x5d07('0x41')]};return db['Template']['count'](_0x5771a1)['then'](function(_0x53fac0){_0x4684ff[_0x5d07('0x1f')]=_0x53fac0;if(_0x411415[_0x5d07('0x33')][_0x5d07('0x44')]){_0x5f9449[_0x5d07('0x45')]=[{'all':!![]}];}return db[_0x5d07('0x2f')][_0x5d07('0x46')](_0x5f9449);})[_0x5d07('0x26')](function(_0x3f39ed){_0x4684ff[_0x5d07('0x47')]=_0x3f39ed;return _0x4684ff;})[_0x5d07('0x26')](respondWithFilteredResult(_0x4bb7f6,_0x5f9449))[_0x5d07('0x48')](handleError(_0x4bb7f6,null));};exports[_0x5d07('0x49')]=function(_0xa51fc2,_0x817228){var _0x4ec443={'raw':!![],'where':{'id':_0xa51fc2[_0x5d07('0x4a')]['id']}},_0x32da17={};_0x32da17[_0x5d07('0x32')]=_[_0x5d07('0x34')](db[_0x5d07('0x2f')][_0x5d07('0x4b')]);_0x32da17['query']=_[_0x5d07('0x34')](_0xa51fc2[_0x5d07('0x33')]);_0x32da17[_0x5d07('0x35')]=_['intersection'](_0x32da17[_0x5d07('0x32')],_0x32da17[_0x5d07('0x33')]);_0x4ec443[_0x5d07('0x37')]=_[_0x5d07('0x36')](_0x32da17['model'],qs['fields'](_0xa51fc2[_0x5d07('0x33')][_0x5d07('0x38')]));_0x4ec443[_0x5d07('0x37')]=_0x4ec443[_0x5d07('0x37')][_0x5d07('0x39')]?_0x4ec443[_0x5d07('0x37')]:_0x32da17[_0x5d07('0x32')];if(_0xa51fc2[_0x5d07('0x33')][_0x5d07('0x44')]){_0x4ec443[_0x5d07('0x45')]=[{'all':!![]}];}_0x4ec443=_[_0x5d07('0x40')]({},_0x4ec443,_0xa51fc2[_0x5d07('0x43')]);return db['Template'][_0x5d07('0x4c')](_0x4ec443)[_0x5d07('0x26')](handleEntityNotFound(_0x817228,null))['then'](respondWithResult(_0x817228,null))[_0x5d07('0x48')](handleError(_0x817228,null));};exports[_0x5d07('0x4d')]=function(_0x2d0b83,_0x5c1479){return db['Template'][_0x5d07('0x4d')](_0x2d0b83['body'],{})[_0x5d07('0x26')](function(_0x182c3b){var _0x5e4704=_0x2d0b83['user'][_0x5d07('0x4e')]({'plain':!![]});if(!_0x5e4704)throw new Error(_0x5d07('0x4f'));if(_0x5e4704[_0x5d07('0x50')]==='user'){var _0x3ab3e6=_0x182c3b[_0x5d07('0x4e')]({'plain':!![]});var _0x18f5d8='Templates';return db['UserProfileSection'][_0x5d07('0x4c')]({'where':{'name':_0x18f5d8,'userProfileId':_0x5e4704['userProfileId']},'raw':!![]})[_0x5d07('0x26')](function(_0x3b1e36){if(_0x3b1e36&&_0x3b1e36[_0x5d07('0x51')]===0x0){return db[_0x5d07('0x28')][_0x5d07('0x4d')]({'name':_0x3ab3e6[_0x5d07('0x2c')],'resourceId':_0x3ab3e6['id'],'type':_0x3b1e36[_0x5d07('0x2c')],'sectionId':_0x3b1e36['id']},{})[_0x5d07('0x26')](function(){return _0x182c3b;});}else{return _0x182c3b;}})[_0x5d07('0x48')](function(_0x1a432c){logger[_0x5d07('0x2a')](_0x5d07('0x52'),_0x1a432c);throw _0x1a432c;});}return _0x182c3b;})[_0x5d07('0x26')](respondWithResult(_0x5c1479,0xc9))['catch'](handleError(_0x5c1479,null));};exports[_0x5d07('0x25')]=function(_0x47aa14,_0x2aa629){if(_0x47aa14[_0x5d07('0x53')]['id']){delete _0x47aa14['body']['id'];}return db[_0x5d07('0x2f')][_0x5d07('0x4c')]({'where':{'id':_0x47aa14[_0x5d07('0x4a')]['id']}})[_0x5d07('0x26')](handleEntityNotFound(_0x2aa629,null))[_0x5d07('0x26')](saveUpdates(_0x47aa14['body'],null))['then'](respondWithResult(_0x2aa629,null))[_0x5d07('0x48')](handleError(_0x2aa629,null));};exports[_0x5d07('0x27')]=function(_0x2cf820,_0x267750){return db['Template'][_0x5d07('0x4c')]({'where':{'id':_0x2cf820[_0x5d07('0x4a')]['id']}})[_0x5d07('0x26')](handleEntityNotFound(_0x267750,null))['then'](removeEntity(_0x267750,null))[_0x5d07('0x48')](handleError(_0x267750,null));}; \ No newline at end of file +var _0x1314=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','role','get','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','Templates','stack','name','map','Template','rawAttributes','key','model','query','filters','attributes','intersection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1314,0xc1));var _0x4131=function(_0xc64699,_0x1b3076){_0xc64699=_0xc64699-0x0;var _0x40732e=_0x1314[_0xc64699];return _0x40732e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4131('0x0'));var jsonpatch=require(_0x4131('0x1'));var rp=require(_0x4131('0x2'));var moment=require(_0x4131('0x3'));var BPromise=require(_0x4131('0x4'));var Mustache=require('mustache');var util=require(_0x4131('0x5'));var path=require(_0x4131('0x6'));var sox=require(_0x4131('0x7'));var csv=require('to-csv');var ejs=require(_0x4131('0x8'));var fs=require('fs');var fs_extra=require(_0x4131('0x9'));var _=require(_0x4131('0xa'));var squel=require(_0x4131('0xb'));var crypto=require(_0x4131('0xc'));var jsforce=require(_0x4131('0xd'));var deskjs=require(_0x4131('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4131('0xf'));var Papa=require(_0x4131('0x10'));var Redis=require(_0x4131('0x11'));var authService=require(_0x4131('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4131('0x13'));var hardwareService=require(_0x4131('0x14'));var logger=require(_0x4131('0x15'))(_0x4131('0x16'));var utils=require('../../config/utils');var config=require(_0x4131('0x17'));var licenseUtil=require(_0x4131('0x18'));var db=require(_0x4131('0x19'))['db'];function respondWithStatusCode(_0xfaf002,_0x391be8){_0x391be8=_0x391be8||0xcc;return function(_0x1db1b7){if(_0x1db1b7){return _0xfaf002[_0x4131('0x1a')](_0x391be8);}return _0xfaf002[_0x4131('0x1b')](_0x391be8)[_0x4131('0x1c')]();};}function respondWithResult(_0x31348c,_0xa4fee5){_0xa4fee5=_0xa4fee5||0xc8;return function(_0x1409ee){if(_0x1409ee){return _0x31348c[_0x4131('0x1b')](_0xa4fee5)[_0x4131('0x1d')](_0x1409ee);}};}function respondWithFilteredResult(_0x4d0770,_0x143200){return function(_0x28733c){if(_0x28733c){var _0xdd9ea=typeof _0x143200[_0x4131('0x1e')]===_0x4131('0x1f')&&typeof _0x143200[_0x4131('0x20')]===_0x4131('0x1f');var _0x375306=_0x28733c['count'];var _0x7ba06f=_0xdd9ea?0x0:_0x143200[_0x4131('0x1e')];var _0x51aee3=_0xdd9ea?_0x28733c[_0x4131('0x21')]:_0x143200[_0x4131('0x1e')]+_0x143200[_0x4131('0x20')];var _0x8d8fc1;if(_0x51aee3>=_0x375306){_0x51aee3=_0x375306;_0x8d8fc1=0xc8;}else{_0x8d8fc1=0xce;}_0x4d0770['status'](_0x8d8fc1);return _0x4d0770[_0x4131('0x22')](_0x4131('0x23'),_0x7ba06f+'-'+_0x51aee3+'/'+_0x375306)['json'](_0x28733c);}return null;};}function patchUpdates(_0x2eba10){return function(_0x23d7e8){try{jsonpatch['apply'](_0x23d7e8,_0x2eba10,!![]);}catch(_0xe41fc1){return BPromise[_0x4131('0x24')](_0xe41fc1);}return _0x23d7e8[_0x4131('0x25')]();};}function saveUpdates(_0x5ad2a3,_0x20916a){return function(_0x3104ad){if(_0x3104ad){return _0x3104ad[_0x4131('0x26')](_0x5ad2a3)[_0x4131('0x27')](function(_0x378316){return _0x378316;});}return null;};}function removeEntity(_0x53482b,_0x5a767e){return function(_0x553f96){if(_0x553f96){return _0x553f96[_0x4131('0x28')]()[_0x4131('0x27')](function(){var _0x5c6a8a=_0x553f96['get']({'plain':!![]});var _0x14f50b=_0x4131('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x14f50b,'resourceId':_0x5c6a8a['id']}})[_0x4131('0x27')](function(){return _0x553f96;});})[_0x4131('0x27')](function(){_0x53482b[_0x4131('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f4e9a,_0x20693d){return function(_0x1194b0){if(!_0x1194b0){_0x3f4e9a[_0x4131('0x1a')](0x194);}return _0x1194b0;};}function handleError(_0x458bfd,_0x48b0f5){_0x48b0f5=_0x48b0f5||0x1f4;return function(_0x5027fa){logger['error'](_0x5027fa[_0x4131('0x2a')]);if(_0x5027fa[_0x4131('0x2b')]){delete _0x5027fa['name'];}_0x458bfd[_0x4131('0x1b')](_0x48b0f5)['send'](_0x5027fa);};}exports['index']=function(_0x2c4f51,_0x268ebd){var _0x1e189f={},_0x474d07={},_0x2dc0df={'count':0x0,'rows':[]};var _0x3580e2=_[_0x4131('0x2c')](db[_0x4131('0x2d')][_0x4131('0x2e')],function(_0x14f225){return{'name':_0x14f225['fieldName'],'type':_0x14f225['type'][_0x4131('0x2f')]};});_0x474d07[_0x4131('0x30')]=_[_0x4131('0x2c')](_0x3580e2,_0x4131('0x2b'));_0x474d07[_0x4131('0x31')]=_['keys'](_0x2c4f51[_0x4131('0x31')]);_0x474d07[_0x4131('0x32')]=_['intersection'](_0x474d07[_0x4131('0x30')],_0x474d07[_0x4131('0x31')]);_0x1e189f[_0x4131('0x33')]=_[_0x4131('0x34')](_0x474d07[_0x4131('0x30')],qs[_0x4131('0x35')](_0x2c4f51['query'][_0x4131('0x35')]));_0x1e189f['attributes']=_0x1e189f[_0x4131('0x33')][_0x4131('0x36')]?_0x1e189f[_0x4131('0x33')]:_0x474d07['model'];if(!_0x2c4f51[_0x4131('0x31')][_0x4131('0x37')](_0x4131('0x38'))){_0x1e189f[_0x4131('0x20')]=qs[_0x4131('0x20')](_0x2c4f51[_0x4131('0x31')]['limit']);_0x1e189f['offset']=qs['offset'](_0x2c4f51[_0x4131('0x31')][_0x4131('0x1e')]);}_0x1e189f[_0x4131('0x39')]=qs[_0x4131('0x3a')](_0x2c4f51['query'][_0x4131('0x3a')]);_0x1e189f[_0x4131('0x3b')]=qs['filters'](_[_0x4131('0x3c')](_0x2c4f51[_0x4131('0x31')],_0x474d07[_0x4131('0x32')]),_0x3580e2);if(_0x2c4f51[_0x4131('0x31')][_0x4131('0x3d')]){_0x1e189f['where']=_[_0x4131('0x3e')](_0x1e189f[_0x4131('0x3b')],{'$or':_['map'](_0x3580e2,function(_0x592145){if(_0x592145[_0x4131('0x3f')]!==_0x4131('0x40')){var _0x4c20f0={};_0x4c20f0[_0x592145[_0x4131('0x2b')]]={'$like':'%'+_0x2c4f51[_0x4131('0x31')][_0x4131('0x3d')]+'%'};return _0x4c20f0;}})});}_0x1e189f=_[_0x4131('0x3e')]({},_0x1e189f,_0x2c4f51['options']);var _0x11fb64={'where':_0x1e189f[_0x4131('0x3b')]};return db['Template'][_0x4131('0x21')](_0x11fb64)[_0x4131('0x27')](function(_0x3d058e){_0x2dc0df[_0x4131('0x21')]=_0x3d058e;if(_0x2c4f51[_0x4131('0x31')][_0x4131('0x41')]){_0x1e189f[_0x4131('0x42')]=[{'all':!![]}];}return db[_0x4131('0x2d')][_0x4131('0x43')](_0x1e189f);})[_0x4131('0x27')](function(_0x629609){_0x2dc0df['rows']=_0x629609;return _0x2dc0df;})[_0x4131('0x27')](respondWithFilteredResult(_0x268ebd,_0x1e189f))[_0x4131('0x44')](handleError(_0x268ebd,null));};exports[_0x4131('0x45')]=function(_0x5e4933,_0x380b3b){var _0x5dd5f1={'raw':!![],'where':{'id':_0x5e4933[_0x4131('0x46')]['id']}},_0x1dea4c={};_0x1dea4c[_0x4131('0x30')]=_[_0x4131('0x47')](db[_0x4131('0x2d')]['rawAttributes']);_0x1dea4c['query']=_[_0x4131('0x47')](_0x5e4933[_0x4131('0x31')]);_0x1dea4c['filters']=_[_0x4131('0x34')](_0x1dea4c[_0x4131('0x30')],_0x1dea4c['query']);_0x5dd5f1[_0x4131('0x33')]=_[_0x4131('0x34')](_0x1dea4c['model'],qs[_0x4131('0x35')](_0x5e4933['query']['fields']));_0x5dd5f1[_0x4131('0x33')]=_0x5dd5f1[_0x4131('0x33')][_0x4131('0x36')]?_0x5dd5f1[_0x4131('0x33')]:_0x1dea4c[_0x4131('0x30')];if(_0x5e4933[_0x4131('0x31')][_0x4131('0x41')]){_0x5dd5f1[_0x4131('0x42')]=[{'all':!![]}];}_0x5dd5f1=_['merge']({},_0x5dd5f1,_0x5e4933['options']);return db['Template'][_0x4131('0x48')](_0x5dd5f1)['then'](handleEntityNotFound(_0x380b3b,null))[_0x4131('0x27')](respondWithResult(_0x380b3b,null))[_0x4131('0x44')](handleError(_0x380b3b,null));};exports[_0x4131('0x49')]=function(_0x28b37b,_0x3e84ec){return db[_0x4131('0x2d')][_0x4131('0x49')](_0x28b37b[_0x4131('0x4a')],{})['then'](function(_0x282c24){var _0x1a0800=_0x28b37b[_0x4131('0x4b')]['get']({'plain':!![]});if(!_0x1a0800)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a0800[_0x4131('0x4c')]===_0x4131('0x4b')){var _0x531d7d=_0x282c24[_0x4131('0x4d')]({'plain':!![]});var _0x29f6cb=_0x4131('0x29');return db[_0x4131('0x4e')][_0x4131('0x48')]({'where':{'name':_0x29f6cb,'userProfileId':_0x1a0800[_0x4131('0x4f')]},'raw':!![]})['then'](function(_0xd3f53){if(_0xd3f53&&_0xd3f53['autoAssociation']===0x0){return db['UserProfileResource'][_0x4131('0x49')]({'name':_0x531d7d[_0x4131('0x2b')],'resourceId':_0x531d7d['id'],'type':_0xd3f53[_0x4131('0x2b')],'sectionId':_0xd3f53['id']},{})[_0x4131('0x27')](function(){return _0x282c24;});}else{return _0x282c24;}})[_0x4131('0x44')](function(_0x474b24){logger[_0x4131('0x50')](_0x4131('0x51'),_0x474b24);throw _0x474b24;});}return _0x282c24;})[_0x4131('0x27')](respondWithResult(_0x3e84ec,0xc9))[_0x4131('0x44')](handleError(_0x3e84ec,null));};exports[_0x4131('0x26')]=function(_0x1326c6,_0x3b9259){if(_0x1326c6[_0x4131('0x4a')]['id']){delete _0x1326c6[_0x4131('0x4a')]['id'];}return db['Template'][_0x4131('0x48')]({'where':{'id':_0x1326c6[_0x4131('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b9259,null))[_0x4131('0x27')](saveUpdates(_0x1326c6[_0x4131('0x4a')],null))[_0x4131('0x27')](respondWithResult(_0x3b9259,null))[_0x4131('0x44')](handleError(_0x3b9259,null));};exports[_0x4131('0x28')]=function(_0x2b3194,_0x473352){return db['Template'][_0x4131('0x48')]({'where':{'id':_0x2b3194[_0x4131('0x46')]['id']}})[_0x4131('0x27')](handleEntityNotFound(_0x473352,null))[_0x4131('0x27')](removeEntity(_0x473352,null))[_0x4131('0x44')](handleError(_0x473352,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 66db0a0..3965d30 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 _0x3bb6=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash'];(function(_0x32563a,_0x1c1a8a){var _0x5864bc=function(_0x3faf70){while(--_0x3faf70){_0x32563a['push'](_0x32563a['shift']());}};_0x5864bc(++_0x1c1a8a);}(_0x3bb6,0x1d3));var _0x63bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bb6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x63bb('0x0'));var util=require(_0x63bb('0x1'));var logger=require(_0x63bb('0x2'))(_0x63bb('0x3'));var moment=require(_0x63bb('0x4'));var BPromise=require(_0x63bb('0x5'));var rp=require(_0x63bb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63bb('0x7'));var config=require('../../config/environment');var attributes=require(_0x63bb('0x8'));module[_0x63bb('0x9')]=function(_0x397a81,_0xf7e981){return _0x397a81[_0x63bb('0xa')](_0x63bb('0xb'),attributes,{'tableName':_0x63bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72d0=['./template.attributes','define','Template','tools_templates','lodash','moment','request-promise','path','../../config/environment'];(function(_0x294054,_0xe46c99){var _0x126f51=function(_0x31a903){while(--_0x31a903){_0x294054['push'](_0x294054['shift']());}};_0x126f51(++_0xe46c99);}(_0x72d0,0x112));var _0x072d=function(_0x301997,_0x1c2cce){_0x301997=_0x301997-0x0;var _0x49eeb5=_0x72d0[_0x301997];return _0x49eeb5;};'use strict';var _=require(_0x072d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x072d('0x1'));var BPromise=require('bluebird');var rp=require(_0x072d('0x2'));var fs=require('fs');var path=require(_0x072d('0x3'));var rimraf=require('rimraf');var config=require(_0x072d('0x4'));var attributes=require(_0x072d('0x5'));module['exports']=function(_0x536ae1,_0x6ece43){return _0x536ae1[_0x072d('0x6')](_0x072d('0x7'),attributes,{'tableName':_0x072d('0x8'),'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 2e5002d..695c0f8 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 _0xff2e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Template,\x20%s,\x20%s','message','GetTemplate','Template','findAll','options','raw','where','attributes','map','include','model','catch','lodash'];(function(_0xcb2c55,_0x333e09){var _0x4cfeaf=function(_0xcb61de){while(--_0xcb61de){_0xcb2c55['push'](_0xcb2c55['shift']());}};_0x4cfeaf(++_0x333e09);}(_0xff2e,0xff));var _0xeff2=function(_0x258afc,_0x590509){_0x258afc=_0x258afc-0x0;var _0x3c2b31=_0xff2e[_0x258afc];return _0x3c2b31;};'use strict';var _=require(_0xeff2('0x0'));var util=require(_0xeff2('0x1'));var moment=require('moment');var BPromise=require(_0xeff2('0x2'));var rs=require(_0xeff2('0x3'));var fs=require('fs');var Redis=require(_0xeff2('0x4'));var db=require(_0xeff2('0x5'))['db'];var utils=require(_0xeff2('0x6'));var logger=require(_0xeff2('0x7'))(_0xeff2('0x8'));var config=require(_0xeff2('0x9'));var jayson=require(_0xeff2('0xa'));var client=jayson[_0xeff2('0xb')][_0xeff2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x501dce,_0x3a2a91,_0x2e365c){return new BPromise(function(_0x2d359e,_0x305041){return client['request'](_0x501dce,_0x2e365c)[_0xeff2('0xd')](function(_0x2b60fb){logger[_0xeff2('0xe')]('Template,\x20%s,\x20%s',_0x3a2a91,_0xeff2('0xf'));logger[_0xeff2('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x3a2a91,_0xeff2('0xf'),JSON[_0xeff2('0x11')](_0x2b60fb));if(_0x2b60fb[_0xeff2('0x12')]){if(_0x2b60fb['error']['code']===0x1f4){logger[_0xeff2('0x12')](_0xeff2('0x13'),_0x3a2a91,_0x2b60fb['error'][_0xeff2('0x14')]);return _0x305041(_0x2b60fb['error'][_0xeff2('0x14')]);}logger[_0xeff2('0x12')](_0xeff2('0x13'),_0x3a2a91,_0x2b60fb[_0xeff2('0x12')][_0xeff2('0x14')]);return _0x2d359e(_0x2b60fb[_0xeff2('0x12')]['message']);}else{logger[_0xeff2('0xe')]('Template,\x20%s,\x20%s',_0x3a2a91,_0xeff2('0xf'));_0x2d359e(_0x2b60fb['result'][_0xeff2('0x14')]);}})['catch'](function(_0x4e84a0){logger['error'](_0xeff2('0x13'),_0x3a2a91,_0x4e84a0);_0x305041(_0x4e84a0);});});}exports[_0xeff2('0x15')]=function(_0x32946f){var _0x35cb50=this;return new Promise(function(_0x3e0a5d,_0x188d4e){return db[_0xeff2('0x16')][_0xeff2('0x17')]({'raw':_0x32946f[_0xeff2('0x18')]?_0x32946f[_0xeff2('0x18')][_0xeff2('0x19')]===undefined?!![]:![]:!![],'where':_0x32946f['options']?_0x32946f[_0xeff2('0x18')][_0xeff2('0x1a')]||null:null,'attributes':_0x32946f['options']?_0x32946f[_0xeff2('0x18')][_0xeff2('0x1b')]||null:null,'limit':_0x32946f['options']?_0x32946f['options']['limit']||null:null,'include':_0x32946f['options']?_0x32946f[_0xeff2('0x18')]['include']?_[_0xeff2('0x1c')](_0x32946f[_0xeff2('0x18')][_0xeff2('0x1d')],function(_0x7aa3d9){return{'model':db[_0x7aa3d9['model']],'as':_0x7aa3d9['as'],'attributes':_0x7aa3d9[_0xeff2('0x1b')],'include':_0x7aa3d9['include']?_[_0xeff2('0x1c')](_0x7aa3d9['include'],function(_0x23ec5f){return{'model':db[_0x23ec5f[_0xeff2('0x1e')]],'as':_0x23ec5f['as'],'attributes':_0x23ec5f[_0xeff2('0x1b')],'include':_0x23ec5f[_0xeff2('0x1d')]?_[_0xeff2('0x1c')](_0x23ec5f[_0xeff2('0x1d')],function(_0x1d2fbf){return{'model':db[_0x1d2fbf['model']],'as':_0x1d2fbf['as'],'attributes':_0x1d2fbf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xc3bc19){logger[_0xeff2('0xe')]('GetTemplate',_0x32946f);logger['debug']('GetTemplate',_0x32946f,JSON[_0xeff2('0x11')](_0xc3bc19));_0x3e0a5d(_0xc3bc19);})[_0xeff2('0x1f')](function(_0x3fc93c){logger[_0xeff2('0x12')]('GetTemplate',_0x3fc93c['message'],_0x32946f);_0x188d4e(_0x35cb50['error'](0x1f4,_0x3fc93c[_0xeff2('0x14')]));});});}; \ No newline at end of file +var _0x3b57=['findAll','raw','options','attributes','limit','include','model','map','GetTemplate','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','Template'];(function(_0x5e6c48,_0x3b68d3){var _0x35e0d4=function(_0x569526){while(--_0x569526){_0x5e6c48['push'](_0x5e6c48['shift']());}};_0x35e0d4(++_0x3b68d3);}(_0x3b57,0x1bd));var _0x73b5=function(_0x564523,_0x5db1c8){_0x564523=_0x564523-0x0;var _0x404d2a=_0x3b57[_0x564523];return _0x404d2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73b5('0x0'));var BPromise=require(_0x73b5('0x1'));var rs=require(_0x73b5('0x2'));var fs=require('fs');var Redis=require(_0x73b5('0x3'));var db=require(_0x73b5('0x4'))['db'];var utils=require(_0x73b5('0x5'));var logger=require('../../config/logger')(_0x73b5('0x6'));var config=require(_0x73b5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x73b5('0x8')][_0x73b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b993c,_0x441b8f,_0x2bdca4){return new BPromise(function(_0x1d3a4c,_0xc427a0){return client['request'](_0x5b993c,_0x2bdca4)[_0x73b5('0xa')](function(_0x4fd93e){logger[_0x73b5('0xb')](_0x73b5('0xc'),_0x441b8f,_0x73b5('0xd'));logger[_0x73b5('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x441b8f,_0x73b5('0xd'),JSON[_0x73b5('0xf')](_0x4fd93e));if(_0x4fd93e[_0x73b5('0x10')]){if(_0x4fd93e[_0x73b5('0x10')]['code']===0x1f4){logger[_0x73b5('0x10')](_0x73b5('0xc'),_0x441b8f,_0x4fd93e[_0x73b5('0x10')][_0x73b5('0x11')]);return _0xc427a0(_0x4fd93e[_0x73b5('0x10')][_0x73b5('0x11')]);}logger['error'](_0x73b5('0xc'),_0x441b8f,_0x4fd93e[_0x73b5('0x10')][_0x73b5('0x11')]);return _0x1d3a4c(_0x4fd93e[_0x73b5('0x10')]['message']);}else{logger[_0x73b5('0xb')](_0x73b5('0xc'),_0x441b8f,'request\x20sent');_0x1d3a4c(_0x4fd93e['result'][_0x73b5('0x11')]);}})['catch'](function(_0x586cce){logger[_0x73b5('0x10')](_0x73b5('0xc'),_0x441b8f,_0x586cce);_0xc427a0(_0x586cce);});});}exports['GetTemplate']=function(_0xce6164){var _0x3f6a12=this;return new Promise(function(_0x1c55ee,_0xab54){return db[_0x73b5('0x12')][_0x73b5('0x13')]({'raw':_0xce6164['options']?_0xce6164['options'][_0x73b5('0x14')]===undefined?!![]:![]:!![],'where':_0xce6164[_0x73b5('0x15')]?_0xce6164[_0x73b5('0x15')]['where']||null:null,'attributes':_0xce6164[_0x73b5('0x15')]?_0xce6164[_0x73b5('0x15')][_0x73b5('0x16')]||null:null,'limit':_0xce6164['options']?_0xce6164[_0x73b5('0x15')][_0x73b5('0x17')]||null:null,'include':_0xce6164['options']?_0xce6164[_0x73b5('0x15')][_0x73b5('0x18')]?_['map'](_0xce6164[_0x73b5('0x15')][_0x73b5('0x18')],function(_0x28c68c){return{'model':db[_0x28c68c[_0x73b5('0x19')]],'as':_0x28c68c['as'],'attributes':_0x28c68c[_0x73b5('0x16')],'include':_0x28c68c[_0x73b5('0x18')]?_[_0x73b5('0x1a')](_0x28c68c[_0x73b5('0x18')],function(_0x47cf37){return{'model':db[_0x47cf37['model']],'as':_0x47cf37['as'],'attributes':_0x47cf37[_0x73b5('0x16')],'include':_0x47cf37[_0x73b5('0x18')]?_[_0x73b5('0x1a')](_0x47cf37[_0x73b5('0x18')],function(_0x140579){return{'model':db[_0x140579[_0x73b5('0x19')]],'as':_0x140579['as'],'attributes':_0x140579['attributes']};}):[]};}):[]};}):[]:[]})[_0x73b5('0xa')](function(_0xb682a4){logger[_0x73b5('0xb')](_0x73b5('0x1b'),_0xce6164);logger[_0x73b5('0xe')](_0x73b5('0x1b'),_0xce6164,JSON[_0x73b5('0xf')](_0xb682a4));_0x1c55ee(_0xb682a4);})[_0x73b5('0x1c')](function(_0x56876a){logger['error']('GetTemplate',_0x56876a[_0x73b5('0x11')],_0xce6164);_0xab54(_0x3f6a12[_0x73b5('0x10')](0x1f4,_0x56876a[_0x73b5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index abe5a59..522c1d5 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 _0x781b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','show','isAuthenticated','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','destroy','exports','multer','util'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x781b,0x1c9));var _0xb781=function(_0x267484,_0x3eb131){_0x267484=_0x267484-0x0;var _0x14a356=_0x781b[_0x267484];return _0x14a356;};'use strict';var multer=require(_0xb781('0x0'));var util=require(_0xb781('0x1'));var path=require(_0xb781('0x2'));var timeout=require(_0xb781('0x3'));var express=require(_0xb781('0x4'));var router=express[_0xb781('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb781('0x6'));var interaction=require(_0xb781('0x7'));var config=require(_0xb781('0x8'));var controller=require(_0xb781('0x9'));router[_0xb781('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb781('0xa')](_0xb781('0xb'),auth['isAuthenticated'](),controller[_0xb781('0xc')]);router[_0xb781('0xa')]('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router[_0xb781('0xa')]('/:id/any_conditions',auth[_0xb781('0xd')](),controller['getAnyConditions']);router[_0xb781('0xa')](_0xb781('0xe'),auth['isAuthenticated'](),controller[_0xb781('0xf')]);router[_0xb781('0x10')]('/',auth[_0xb781('0xd')](),controller[_0xb781('0x11')]);router['post'](_0xb781('0x12'),auth[_0xb781('0xd')](),controller[_0xb781('0x13')]);router[_0xb781('0x10')](_0xb781('0x14'),auth[_0xb781('0xd')](),controller[_0xb781('0x15')]);router[_0xb781('0x10')]('/:id/actions',auth[_0xb781('0xd')](),controller[_0xb781('0x16')]);router[_0xb781('0x17')](_0xb781('0xb'),auth[_0xb781('0xd')](),controller[_0xb781('0x18')]);router['delete'](_0xb781('0xb'),auth[_0xb781('0xd')](),controller[_0xb781('0x19')]);module[_0xb781('0x1a')]=router; \ No newline at end of file +var _0xbbec=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction'];(function(_0x42b07b,_0x4f0413){var _0x132dba=function(_0x5b1c8b){while(--_0x5b1c8b){_0x42b07b['push'](_0x42b07b['shift']());}};_0x132dba(++_0x4f0413);}(_0xbbec,0x85));var _0xcbbe=function(_0x4bd011,_0x3f695f){_0x4bd011=_0x4bd011-0x0;var _0x539429=_0xbbec[_0x4bd011];return _0x539429;};'use strict';var multer=require(_0xcbbe('0x0'));var util=require(_0xcbbe('0x1'));var path=require(_0xcbbe('0x2'));var timeout=require(_0xcbbe('0x3'));var express=require(_0xcbbe('0x4'));var router=express[_0xcbbe('0x5')]();var fs_extra=require(_0xcbbe('0x6'));var auth=require(_0xcbbe('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcbbe('0x8'));router[_0xcbbe('0x9')]('/',auth[_0xcbbe('0xa')](),controller['index']);router[_0xcbbe('0x9')](_0xcbbe('0xb'),auth[_0xcbbe('0xa')](),controller['show']);router[_0xcbbe('0x9')](_0xcbbe('0xc'),auth[_0xcbbe('0xa')](),controller[_0xcbbe('0xd')]);router['get'](_0xcbbe('0xe'),auth[_0xcbbe('0xa')](),controller[_0xcbbe('0xf')]);router[_0xcbbe('0x9')](_0xcbbe('0x10'),auth['isAuthenticated'](),controller[_0xcbbe('0x11')]);router[_0xcbbe('0x12')]('/',auth['isAuthenticated'](),controller[_0xcbbe('0x13')]);router['post'](_0xcbbe('0xc'),auth[_0xcbbe('0xa')](),controller[_0xcbbe('0x14')]);router[_0xcbbe('0x12')](_0xcbbe('0xe'),auth[_0xcbbe('0xa')](),controller[_0xcbbe('0x15')]);router['post'](_0xcbbe('0x10'),auth[_0xcbbe('0xa')](),controller[_0xcbbe('0x16')]);router[_0xcbbe('0x17')](_0xcbbe('0xb'),auth[_0xcbbe('0xa')](),controller[_0xcbbe('0x18')]);router['delete'](_0xcbbe('0xb'),auth[_0xcbbe('0xa')](),controller['destroy']);module[_0xcbbe('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 06f4441..d0d6fe0 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 _0x6d44=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2deeca,_0x1a4cf7){var _0x336d1b=function(_0x2a9b6a){while(--_0x2a9b6a){_0x2deeca['push'](_0x2deeca['shift']());}};_0x336d1b(++_0x1a4cf7);}(_0x6d44,0x8d));var _0x46d4=function(_0xcc26d2,_0x20c921){_0xcc26d2=_0xcc26d2-0x0;var _0x3841e2=_0x6d44[_0xcc26d2];return _0x3841e2;};'use strict';var Sequelize=require(_0x46d4('0x0'));module[_0x46d4('0x1')]={'name':{'type':Sequelize[_0x46d4('0x2')]},'channel':{'type':Sequelize[_0x46d4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x46d4('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xcadb=['BOOLEAN','exports','STRING'];(function(_0x121df1,_0x3a06c0){var _0x59b6f8=function(_0x31aabb){while(--_0x31aabb){_0x121df1['push'](_0x121df1['shift']());}};_0x59b6f8(++_0x3a06c0);}(_0xcadb,0x1c9));var _0xbcad=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xcadb[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require('sequelize');module[_0xbcad('0x0')]={'name':{'type':Sequelize[_0xbcad('0x1')]},'channel':{'type':Sequelize[_0xbcad('0x1')]},'description':{'type':Sequelize[_0xbcad('0x1')]},'status':{'type':Sequelize[_0xbcad('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index bbbab3c..115813e 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 _0x9423=['update','destroy','Triggers','UserProfileResource','then','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','query','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','intersection','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','addAnyCondition','Condition','getAllConditions','findOne','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x8f427d,_0x4f3099){var _0x231b2d=function(_0x533cc3){while(--_0x533cc3){_0x8f427d['push'](_0x8f427d['shift']());}};_0x231b2d(++_0x4f3099);}(_0x9423,0x1be));var _0x3942=function(_0x3c5a25,_0x2bfbda){_0x3c5a25=_0x3c5a25-0x0;var _0x24a62d=_0x9423[_0x3c5a25];return _0x24a62d;};'use strict';var emlformat=require(_0x3942('0x0'));var rimraf=require(_0x3942('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3942('0x2'));var rp=require(_0x3942('0x3'));var moment=require(_0x3942('0x4'));var BPromise=require(_0x3942('0x5'));var Mustache=require(_0x3942('0x6'));var util=require(_0x3942('0x7'));var path=require('path');var sox=require(_0x3942('0x8'));var csv=require(_0x3942('0x9'));var ejs=require(_0x3942('0xa'));var fs=require('fs');var fs_extra=require(_0x3942('0xb'));var _=require(_0x3942('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3942('0xd'));var deskjs=require(_0x3942('0xe'));var toCsv=require(_0x3942('0x9'));var querystring=require('querystring');var Papa=require(_0x3942('0xf'));var Redis=require(_0x3942('0x10'));var authService=require(_0x3942('0x11'));var qs=require(_0x3942('0x12'));var as=require(_0x3942('0x13'));var hardwareService=require(_0x3942('0x14'));var logger=require(_0x3942('0x15'))(_0x3942('0x16'));var utils=require(_0x3942('0x17'));var config=require(_0x3942('0x18'));var licenseUtil=require(_0x3942('0x19'));var db=require(_0x3942('0x1a'))['db'];function respondWithStatusCode(_0x2678f9,_0x72f516){_0x72f516=_0x72f516||0xcc;return function(_0x1a611f){if(_0x1a611f){return _0x2678f9[_0x3942('0x1b')](_0x72f516);}return _0x2678f9['status'](_0x72f516)[_0x3942('0x1c')]();};}function respondWithResult(_0x4f6fa5,_0x35283a){_0x35283a=_0x35283a||0xc8;return function(_0x45199e){if(_0x45199e){return _0x4f6fa5[_0x3942('0x1d')](_0x35283a)[_0x3942('0x1e')](_0x45199e);}};}function respondWithFilteredResult(_0x2b8115,_0xc5e290){return function(_0x3bb5ce){if(_0x3bb5ce){var _0x27fec4=typeof _0xc5e290[_0x3942('0x1f')]===_0x3942('0x20')&&typeof _0xc5e290[_0x3942('0x21')]===_0x3942('0x20');var _0x230eea=_0x3bb5ce[_0x3942('0x22')];var _0x1063ea=_0x27fec4?0x0:_0xc5e290[_0x3942('0x1f')];var _0x1daa11=_0x27fec4?_0x3bb5ce[_0x3942('0x22')]:_0xc5e290[_0x3942('0x1f')]+_0xc5e290[_0x3942('0x21')];var _0x39ab29;if(_0x1daa11>=_0x230eea){_0x1daa11=_0x230eea;_0x39ab29=0xc8;}else{_0x39ab29=0xce;}_0x2b8115['status'](_0x39ab29);return _0x2b8115[_0x3942('0x23')]('Content-Range',_0x1063ea+'-'+_0x1daa11+'/'+_0x230eea)[_0x3942('0x1e')](_0x3bb5ce);}return null;};}function patchUpdates(_0x4385aa){return function(_0x395993){try{jsonpatch[_0x3942('0x24')](_0x395993,_0x4385aa,!![]);}catch(_0x40b2f0){return BPromise[_0x3942('0x25')](_0x40b2f0);}return _0x395993[_0x3942('0x26')]();};}function saveUpdates(_0x5afdad,_0x7eafbd){return function(_0x5261e7){if(_0x5261e7){return _0x5261e7[_0x3942('0x27')](_0x5afdad)['then'](function(_0x5774a0){return _0x5774a0;});}return null;};}function removeEntity(_0x3940c1,_0x2d3423){return function(_0x324532){if(_0x324532){return _0x324532[_0x3942('0x28')]()['then'](function(){var _0x5e406a=_0x324532['get']({'plain':!![]});var _0x630d5e=_0x3942('0x29');return db[_0x3942('0x2a')][_0x3942('0x28')]({'where':{'type':_0x630d5e,'resourceId':_0x5e406a['id']}})[_0x3942('0x2b')](function(){return _0x324532;});})[_0x3942('0x2b')](function(){_0x3940c1[_0x3942('0x1d')](0xcc)[_0x3942('0x1c')]();});}};}function handleEntityNotFound(_0x442332,_0x36393c){return function(_0x3d5daa){if(!_0x3d5daa){_0x442332[_0x3942('0x1b')](0x194);}return _0x3d5daa;};}function handleError(_0x397e19,_0x420b0f){_0x420b0f=_0x420b0f||0x1f4;return function(_0x4dc5bc){logger[_0x3942('0x2c')](_0x4dc5bc[_0x3942('0x2d')]);if(_0x4dc5bc[_0x3942('0x2e')]){delete _0x4dc5bc[_0x3942('0x2e')];}_0x397e19[_0x3942('0x1d')](_0x420b0f)[_0x3942('0x2f')](_0x4dc5bc);};}exports[_0x3942('0x30')]=function(_0x4bbd18,_0x262be0){var _0x1d9774={},_0x49b46c={},_0x333fe1={'count':0x0,'rows':[]};var _0x473e81=_[_0x3942('0x31')](db[_0x3942('0x32')][_0x3942('0x33')],function(_0x519f7e){return{'name':_0x519f7e[_0x3942('0x34')],'type':_0x519f7e['type']['key']};});_0x49b46c['model']=_[_0x3942('0x31')](_0x473e81,'name');_0x49b46c[_0x3942('0x35')]=_['keys'](_0x4bbd18['query']);_0x49b46c[_0x3942('0x36')]=_['intersection'](_0x49b46c['model'],_0x49b46c[_0x3942('0x35')]);_0x1d9774[_0x3942('0x37')]=_['intersection'](_0x49b46c['model'],qs[_0x3942('0x38')](_0x4bbd18[_0x3942('0x35')]['fields']));_0x1d9774[_0x3942('0x37')]=_0x1d9774[_0x3942('0x37')][_0x3942('0x39')]?_0x1d9774[_0x3942('0x37')]:_0x49b46c[_0x3942('0x3a')];if(!_0x4bbd18[_0x3942('0x35')][_0x3942('0x3b')](_0x3942('0x3c'))){_0x1d9774[_0x3942('0x21')]=qs[_0x3942('0x21')](_0x4bbd18[_0x3942('0x35')][_0x3942('0x21')]);_0x1d9774[_0x3942('0x1f')]=qs[_0x3942('0x1f')](_0x4bbd18[_0x3942('0x35')][_0x3942('0x1f')]);}_0x1d9774[_0x3942('0x3d')]=qs[_0x3942('0x3e')](_0x4bbd18[_0x3942('0x35')][_0x3942('0x3e')]);_0x1d9774['where']=qs[_0x3942('0x36')](_[_0x3942('0x3f')](_0x4bbd18[_0x3942('0x35')],_0x49b46c[_0x3942('0x36')]),_0x473e81);if(_0x4bbd18[_0x3942('0x35')][_0x3942('0x40')]){_0x1d9774[_0x3942('0x41')]=_[_0x3942('0x42')](_0x1d9774[_0x3942('0x41')],{'$or':_[_0x3942('0x31')](_0x473e81,function(_0x57ada8){if(_0x57ada8[_0x3942('0x43')]!==_0x3942('0x44')){var _0x15d537={};_0x15d537[_0x57ada8[_0x3942('0x2e')]]={'$like':'%'+_0x4bbd18[_0x3942('0x35')][_0x3942('0x40')]+'%'};return _0x15d537;}})});}_0x1d9774=_[_0x3942('0x42')]({},_0x1d9774,_0x4bbd18[_0x3942('0x45')]);var _0xedfb7b={'where':_0x1d9774['where']};return db['Trigger']['count'](_0xedfb7b)[_0x3942('0x2b')](function(_0x464eb6){_0x333fe1[_0x3942('0x22')]=_0x464eb6;if(_0x4bbd18[_0x3942('0x35')][_0x3942('0x46')]){_0x1d9774['include']=[{'all':!![]}];}return db[_0x3942('0x32')][_0x3942('0x47')](_0x1d9774);})[_0x3942('0x2b')](function(_0x4989e5){_0x333fe1[_0x3942('0x48')]=_0x4989e5;return _0x333fe1;})[_0x3942('0x2b')](respondWithFilteredResult(_0x262be0,_0x1d9774))[_0x3942('0x49')](handleError(_0x262be0,null));};exports[_0x3942('0x4a')]=function(_0x372e66,_0xc5efbb){var _0x52e688={'raw':![],'where':{'id':_0x372e66[_0x3942('0x4b')]['id']}},_0x2dfde1={};_0x2dfde1[_0x3942('0x3a')]=_[_0x3942('0x4c')](db[_0x3942('0x32')][_0x3942('0x33')]);_0x2dfde1[_0x3942('0x35')]=_[_0x3942('0x4c')](_0x372e66[_0x3942('0x35')]);_0x2dfde1['filters']=_['intersection'](_0x2dfde1[_0x3942('0x3a')],_0x2dfde1['query']);_0x52e688[_0x3942('0x37')]=_[_0x3942('0x4d')](_0x2dfde1[_0x3942('0x3a')],qs['fields'](_0x372e66['query'][_0x3942('0x38')]));_0x52e688[_0x3942('0x37')]=_0x52e688[_0x3942('0x37')][_0x3942('0x39')]?_0x52e688[_0x3942('0x37')]:_0x2dfde1[_0x3942('0x3a')];if(_0x372e66['query'][_0x3942('0x46')]){_0x52e688[_0x3942('0x4e')]=[{'all':!![]}];}_0x52e688=_[_0x3942('0x42')]({},_0x52e688,_0x372e66[_0x3942('0x45')]);return db[_0x3942('0x32')]['find'](_0x52e688)[_0x3942('0x2b')](handleEntityNotFound(_0xc5efbb,null))[_0x3942('0x2b')](respondWithResult(_0xc5efbb,null))[_0x3942('0x49')](handleError(_0xc5efbb,null));};exports[_0x3942('0x4f')]=function(_0x3da942,_0x485962){return db['Trigger'][_0x3942('0x4f')](_0x3da942[_0x3942('0x50')],{})['then'](function(_0x536bd3){var _0x2e370d=_0x3da942['user'][_0x3942('0x51')]({'plain':!![]});if(!_0x2e370d)throw new Error(_0x3942('0x52'));if(_0x2e370d['role']===_0x3942('0x53')){var _0x8f053a=_0x536bd3[_0x3942('0x51')]({'plain':!![]});var _0x33d85d=_0x3942('0x29');return db[_0x3942('0x54')][_0x3942('0x55')]({'where':{'name':_0x33d85d,'userProfileId':_0x2e370d['userProfileId']},'raw':!![]})['then'](function(_0x1ab773){if(_0x1ab773&&_0x1ab773[_0x3942('0x56')]===0x0){return db[_0x3942('0x2a')][_0x3942('0x4f')]({'name':_0x8f053a[_0x3942('0x2e')],'resourceId':_0x8f053a['id'],'type':_0x1ab773[_0x3942('0x2e')],'sectionId':_0x1ab773['id']},{})[_0x3942('0x2b')](function(){return _0x536bd3;});}else{return _0x536bd3;}})[_0x3942('0x49')](function(_0x5dfbb1){logger[_0x3942('0x2c')](_0x3942('0x57'),_0x5dfbb1);throw _0x5dfbb1;});}return _0x536bd3;})[_0x3942('0x2b')](respondWithResult(_0x485962,0xc9))[_0x3942('0x49')](handleError(_0x485962,null));};exports[_0x3942('0x27')]=function(_0x54fd69,_0x1f80d9){if(_0x54fd69[_0x3942('0x50')]['id']){delete _0x54fd69[_0x3942('0x50')]['id'];}return db[_0x3942('0x32')][_0x3942('0x55')]({'where':{'id':_0x54fd69['params']['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0x1f80d9,null))[_0x3942('0x2b')](saveUpdates(_0x54fd69['body'],null))['then'](respondWithResult(_0x1f80d9,null))[_0x3942('0x49')](handleError(_0x1f80d9,null));};exports['destroy']=function(_0x410a5d,_0x1f9d41){return db[_0x3942('0x32')][_0x3942('0x55')]({'where':{'id':_0x410a5d[_0x3942('0x4b')]['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0x1f9d41,null))['then'](removeEntity(_0x1f9d41,null))[_0x3942('0x49')](handleError(_0x1f9d41,null));};exports[_0x3942('0x58')]=function(_0x218959,_0xb2ba9b,_0x5d8ba3){if(_0x218959[_0x3942('0x50')]['id']){delete _0x218959[_0x3942('0x50')]['id'];}return db['Trigger'][_0x3942('0x55')]({'where':{'id':_0x218959[_0x3942('0x4b')]['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0xb2ba9b,null))[_0x3942('0x2b')](function(_0x432123){if(_0x432123){_0x218959[_0x3942('0x50')]['TriggerAllId']=_0x432123['id'];return db['Condition'][_0x3942('0x4f')](_0x218959[_0x3942('0x50')]);}})[_0x3942('0x2b')](respondWithResult(_0xb2ba9b,null))[_0x3942('0x49')](handleError(_0xb2ba9b,null));};exports[_0x3942('0x59')]=function(_0x188d44,_0x3f3def,_0x51c08f){if(_0x188d44['body']['id']){delete _0x188d44[_0x3942('0x50')]['id'];}return db[_0x3942('0x32')][_0x3942('0x55')]({'where':{'id':_0x188d44['params']['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0x3f3def,null))['then'](function(_0x29b1e4){if(_0x29b1e4){_0x188d44[_0x3942('0x50')]['TriggerAnyId']=_0x29b1e4['id'];return db[_0x3942('0x5a')][_0x3942('0x4f')](_0x188d44[_0x3942('0x50')]);}})[_0x3942('0x2b')](respondWithResult(_0x3f3def,null))[_0x3942('0x49')](handleError(_0x3f3def,null));};exports[_0x3942('0x5b')]=function(_0x18d642,_0x6f3975,_0x2788be){var _0x47d423={};var _0x3600ae={};var _0x451f61;var _0x34d56e;return db[_0x3942('0x32')][_0x3942('0x5c')]({'where':{'id':_0x18d642[_0x3942('0x4b')]['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0x6f3975,null))[_0x3942('0x2b')](function(_0x3b0088){if(_0x3b0088){_0x451f61=_0x3b0088;_0x3600ae[_0x3942('0x3a')]=_[_0x3942('0x4c')](db[_0x3942('0x5a')][_0x3942('0x33')]);_0x3600ae['query']=_[_0x3942('0x4c')](_0x18d642['query']);_0x3600ae[_0x3942('0x36')]=_[_0x3942('0x4d')](_0x3600ae['model'],_0x3600ae[_0x3942('0x35')]);_0x47d423[_0x3942('0x37')]=_['intersection'](_0x3600ae[_0x3942('0x3a')],qs[_0x3942('0x38')](_0x18d642[_0x3942('0x35')][_0x3942('0x38')]));_0x47d423[_0x3942('0x37')]=_0x47d423[_0x3942('0x37')][_0x3942('0x39')]?_0x47d423[_0x3942('0x37')]:_0x3600ae[_0x3942('0x3a')];_0x47d423[_0x3942('0x3d')]=qs[_0x3942('0x3e')](_0x18d642[_0x3942('0x35')][_0x3942('0x3e')]);_0x47d423['where']=qs[_0x3942('0x36')](_[_0x3942('0x3f')](_0x18d642[_0x3942('0x35')],_0x3600ae['filters']));if(_0x18d642[_0x3942('0x35')][_0x3942('0x40')]){_0x47d423[_0x3942('0x41')]=_[_0x3942('0x42')](_0x47d423[_0x3942('0x41')],{'$or':_[_0x3942('0x31')](_0x47d423[_0x3942('0x37')],function(_0x6ee954){var _0x396ad7={};_0x396ad7[_0x6ee954]={'$like':'%'+_0x18d642['query'][_0x3942('0x40')]+'%'};return _0x396ad7;})});}_0x47d423=_[_0x3942('0x42')]({},_0x47d423,_0x18d642[_0x3942('0x45')]);return _0x451f61[_0x3942('0x5b')](_0x47d423);}})[_0x3942('0x2b')](function(_0x910220){if(_0x910220){_0x34d56e=_0x910220[_0x3942('0x39')];if(!_0x18d642['query']['hasOwnProperty'](_0x3942('0x3c'))){_0x47d423[_0x3942('0x21')]=qs[_0x3942('0x21')](_0x18d642[_0x3942('0x35')][_0x3942('0x21')]);_0x47d423['offset']=qs[_0x3942('0x1f')](_0x18d642[_0x3942('0x35')]['offset']);}return _0x451f61['getAllConditions'](_0x47d423);}})['then'](function(_0x5cebd2){if(_0x5cebd2){return _0x5cebd2?{'count':_0x34d56e,'rows':_0x5cebd2}:null;}})['then'](respondWithResult(_0x6f3975,null))[_0x3942('0x49')](handleError(_0x6f3975,null));};exports['getAnyConditions']=function(_0x388466,_0x5f2ae0,_0x122404){var _0x349052={};var _0x539b7a={};var _0x24f5e9;var _0x32cd39;return db[_0x3942('0x32')]['findOne']({'where':{'id':_0x388466['params']['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0x5f2ae0,null))[_0x3942('0x2b')](function(_0x532100){if(_0x532100){_0x24f5e9=_0x532100;_0x539b7a[_0x3942('0x3a')]=_['keys'](db[_0x3942('0x5a')]['rawAttributes']);_0x539b7a['query']=_[_0x3942('0x4c')](_0x388466['query']);_0x539b7a['filters']=_[_0x3942('0x4d')](_0x539b7a[_0x3942('0x3a')],_0x539b7a['query']);_0x349052[_0x3942('0x37')]=_[_0x3942('0x4d')](_0x539b7a[_0x3942('0x3a')],qs[_0x3942('0x38')](_0x388466[_0x3942('0x35')][_0x3942('0x38')]));_0x349052['attributes']=_0x349052[_0x3942('0x37')][_0x3942('0x39')]?_0x349052[_0x3942('0x37')]:_0x539b7a[_0x3942('0x3a')];_0x349052[_0x3942('0x3d')]=qs['sort'](_0x388466[_0x3942('0x35')][_0x3942('0x3e')]);_0x349052[_0x3942('0x41')]=qs[_0x3942('0x36')](_[_0x3942('0x3f')](_0x388466[_0x3942('0x35')],_0x539b7a[_0x3942('0x36')]));if(_0x388466['query'][_0x3942('0x40')]){_0x349052[_0x3942('0x41')]=_[_0x3942('0x42')](_0x349052[_0x3942('0x41')],{'$or':_[_0x3942('0x31')](_0x349052['attributes'],function(_0x4167ba){var _0x240244={};_0x240244[_0x4167ba]={'$like':'%'+_0x388466[_0x3942('0x35')][_0x3942('0x40')]+'%'};return _0x240244;})});}_0x349052=_['merge']({},_0x349052,_0x388466[_0x3942('0x45')]);return _0x24f5e9[_0x3942('0x5d')](_0x349052);}})['then'](function(_0x1a1b5c){if(_0x1a1b5c){_0x32cd39=_0x1a1b5c[_0x3942('0x39')];if(!_0x388466['query'][_0x3942('0x3b')](_0x3942('0x3c'))){_0x349052[_0x3942('0x21')]=qs['limit'](_0x388466[_0x3942('0x35')]['limit']);_0x349052[_0x3942('0x1f')]=qs[_0x3942('0x1f')](_0x388466[_0x3942('0x35')][_0x3942('0x1f')]);}return _0x24f5e9[_0x3942('0x5d')](_0x349052);}})[_0x3942('0x2b')](function(_0x472e60){if(_0x472e60){return _0x472e60?{'count':_0x32cd39,'rows':_0x472e60}:null;}})[_0x3942('0x2b')](respondWithResult(_0x5f2ae0,null))[_0x3942('0x49')](handleError(_0x5f2ae0,null));};exports['addAction']=function(_0x28c1b0,_0x44a0ae,_0x168350){if(_0x28c1b0[_0x3942('0x50')]['id']){delete _0x28c1b0[_0x3942('0x50')]['id'];}return db[_0x3942('0x32')][_0x3942('0x55')]({'where':{'id':_0x28c1b0['params']['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0x44a0ae,null))[_0x3942('0x2b')](function(_0x549620){if(_0x549620){_0x28c1b0[_0x3942('0x50')][_0x3942('0x5e')]=_0x549620['id'];return db[_0x3942('0x5f')][_0x3942('0x4f')](_0x28c1b0[_0x3942('0x50')]);}})[_0x3942('0x2b')](respondWithResult(_0x44a0ae,null))[_0x3942('0x49')](handleError(_0x44a0ae,null));};exports[_0x3942('0x60')]=function(_0x3e9968,_0x4dcf30,_0x47eb55){var _0x59fc34={};var _0x40adab={};var _0x2293cd;var _0x51178c;return db['Trigger'][_0x3942('0x5c')]({'where':{'id':_0x3e9968[_0x3942('0x4b')]['id']}})[_0x3942('0x2b')](handleEntityNotFound(_0x4dcf30,null))[_0x3942('0x2b')](function(_0xac38ac){if(_0xac38ac){_0x2293cd=_0xac38ac;_0x40adab[_0x3942('0x3a')]=_['keys'](db[_0x3942('0x5f')][_0x3942('0x33')]);_0x40adab[_0x3942('0x35')]=_[_0x3942('0x4c')](_0x3e9968[_0x3942('0x35')]);_0x40adab[_0x3942('0x36')]=_['intersection'](_0x40adab[_0x3942('0x3a')],_0x40adab['query']);_0x59fc34['attributes']=_[_0x3942('0x4d')](_0x40adab['model'],qs[_0x3942('0x38')](_0x3e9968['query'][_0x3942('0x38')]));_0x59fc34['attributes']=_0x59fc34['attributes'][_0x3942('0x39')]?_0x59fc34['attributes']:_0x40adab['model'];_0x59fc34[_0x3942('0x3d')]=qs[_0x3942('0x3e')](_0x3e9968[_0x3942('0x35')][_0x3942('0x3e')]);_0x59fc34[_0x3942('0x41')]=qs[_0x3942('0x36')](_['pick'](_0x3e9968[_0x3942('0x35')],_0x40adab['filters']));if(_0x3e9968[_0x3942('0x35')][_0x3942('0x40')]){_0x59fc34[_0x3942('0x41')]=_[_0x3942('0x42')](_0x59fc34[_0x3942('0x41')],{'$or':_[_0x3942('0x31')](_0x59fc34[_0x3942('0x37')],function(_0x4ed4f){var _0x8224d1={};_0x8224d1[_0x4ed4f]={'$like':'%'+_0x3e9968[_0x3942('0x35')][_0x3942('0x40')]+'%'};return _0x8224d1;})});}_0x59fc34=_[_0x3942('0x42')]({},_0x59fc34,_0x3e9968[_0x3942('0x45')]);return _0x2293cd[_0x3942('0x60')](_0x59fc34);}})[_0x3942('0x2b')](function(_0x541f61){if(_0x541f61){_0x51178c=_0x541f61[_0x3942('0x39')];if(!_0x3e9968[_0x3942('0x35')][_0x3942('0x3b')](_0x3942('0x3c'))){_0x59fc34[_0x3942('0x21')]=qs['limit'](_0x3e9968[_0x3942('0x35')][_0x3942('0x21')]);_0x59fc34['offset']=qs[_0x3942('0x1f')](_0x3e9968[_0x3942('0x35')][_0x3942('0x1f')]);}return _0x2293cd['getActions'](_0x59fc34);}})[_0x3942('0x2b')](function(_0x3e1e5c){if(_0x3e1e5c){return _0x3e1e5c?{'count':_0x51178c,'rows':_0x3e1e5c}:null;}})['then'](respondWithResult(_0x4dcf30,null))[_0x3942('0x49')](handleError(_0x4dcf30,null));}; \ No newline at end of file +var _0xa019=['VIRTUAL','name','options','include','findAll','rows','catch','show','params','rawAttributes','keys','includeAll','find','create','body','user','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','sort','nolimit','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','sendStatus','error','send','index','map','Trigger','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','where','merge'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xa019,0x135));var _0x9a01=function(_0x2df84e,_0x190b5a){_0x2df84e=_0x2df84e-0x0;var _0x335612=_0xa019[_0x2df84e];return _0x335612;};'use strict';var emlformat=require(_0x9a01('0x0'));var rimraf=require(_0x9a01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a01('0x2'));var rp=require(_0x9a01('0x3'));var moment=require(_0x9a01('0x4'));var BPromise=require(_0x9a01('0x5'));var Mustache=require(_0x9a01('0x6'));var util=require(_0x9a01('0x7'));var path=require('path');var sox=require(_0x9a01('0x8'));var csv=require(_0x9a01('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a01('0xa'));var _=require(_0x9a01('0xb'));var squel=require(_0x9a01('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a01('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9a01('0x9'));var querystring=require(_0x9a01('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9a01('0xf'));var qs=require(_0x9a01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a01('0x11'));var logger=require(_0x9a01('0x12'))(_0x9a01('0x13'));var utils=require('../../config/utils');var config=require(_0x9a01('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a01('0x15'))['db'];function respondWithStatusCode(_0x5327bf,_0x37e632){_0x37e632=_0x37e632||0xcc;return function(_0x3de95f){if(_0x3de95f){return _0x5327bf['sendStatus'](_0x37e632);}return _0x5327bf['status'](_0x37e632)[_0x9a01('0x16')]();};}function respondWithResult(_0x29e1e0,_0x3a89ea){_0x3a89ea=_0x3a89ea||0xc8;return function(_0x509553){if(_0x509553){return _0x29e1e0['status'](_0x3a89ea)[_0x9a01('0x17')](_0x509553);}};}function respondWithFilteredResult(_0x20c03c,_0x2440b6){return function(_0x10986d){if(_0x10986d){var _0x2b95cf=typeof _0x2440b6[_0x9a01('0x18')]===_0x9a01('0x19')&&typeof _0x2440b6[_0x9a01('0x1a')]===_0x9a01('0x19');var _0x24baaf=_0x10986d[_0x9a01('0x1b')];var _0x4e9a3c=_0x2b95cf?0x0:_0x2440b6[_0x9a01('0x18')];var _0x1a0cd9=_0x2b95cf?_0x10986d[_0x9a01('0x1b')]:_0x2440b6[_0x9a01('0x18')]+_0x2440b6[_0x9a01('0x1a')];var _0x1f3fd8;if(_0x1a0cd9>=_0x24baaf){_0x1a0cd9=_0x24baaf;_0x1f3fd8=0xc8;}else{_0x1f3fd8=0xce;}_0x20c03c[_0x9a01('0x1c')](_0x1f3fd8);return _0x20c03c[_0x9a01('0x1d')]('Content-Range',_0x4e9a3c+'-'+_0x1a0cd9+'/'+_0x24baaf)[_0x9a01('0x17')](_0x10986d);}return null;};}function patchUpdates(_0x4d2611){return function(_0x706217){try{jsonpatch[_0x9a01('0x1e')](_0x706217,_0x4d2611,!![]);}catch(_0x5262e7){return BPromise[_0x9a01('0x1f')](_0x5262e7);}return _0x706217[_0x9a01('0x20')]();};}function saveUpdates(_0x864be5,_0x2a4dde){return function(_0x46526b){if(_0x46526b){return _0x46526b[_0x9a01('0x21')](_0x864be5)[_0x9a01('0x22')](function(_0x1299c5){return _0x1299c5;});}return null;};}function removeEntity(_0x3cf972,_0x4b6911){return function(_0x22f02b){if(_0x22f02b){return _0x22f02b[_0x9a01('0x23')]()['then'](function(){var _0x426487=_0x22f02b['get']({'plain':!![]});var _0x38b451=_0x9a01('0x24');return db[_0x9a01('0x25')][_0x9a01('0x23')]({'where':{'type':_0x38b451,'resourceId':_0x426487['id']}})[_0x9a01('0x22')](function(){return _0x22f02b;});})[_0x9a01('0x22')](function(){_0x3cf972['status'](0xcc)[_0x9a01('0x16')]();});}};}function handleEntityNotFound(_0x24ab2c,_0x34ea82){return function(_0x136533){if(!_0x136533){_0x24ab2c[_0x9a01('0x26')](0x194);}return _0x136533;};}function handleError(_0x41e532,_0x483584){_0x483584=_0x483584||0x1f4;return function(_0x493d9f){logger[_0x9a01('0x27')](_0x493d9f['stack']);if(_0x493d9f['name']){delete _0x493d9f['name'];}_0x41e532[_0x9a01('0x1c')](_0x483584)[_0x9a01('0x28')](_0x493d9f);};}exports[_0x9a01('0x29')]=function(_0x4567fc,_0x2a5ccb){var _0xebc1f1={},_0x26e332={},_0x15bae5={'count':0x0,'rows':[]};var _0x17d920=_[_0x9a01('0x2a')](db[_0x9a01('0x2b')]['rawAttributes'],function(_0x4faafa){return{'name':_0x4faafa[_0x9a01('0x2c')],'type':_0x4faafa['type'][_0x9a01('0x2d')]};});_0x26e332[_0x9a01('0x2e')]=_['map'](_0x17d920,'name');_0x26e332[_0x9a01('0x2f')]=_['keys'](_0x4567fc[_0x9a01('0x2f')]);_0x26e332[_0x9a01('0x30')]=_[_0x9a01('0x31')](_0x26e332[_0x9a01('0x2e')],_0x26e332['query']);_0xebc1f1[_0x9a01('0x32')]=_[_0x9a01('0x31')](_0x26e332[_0x9a01('0x2e')],qs[_0x9a01('0x33')](_0x4567fc[_0x9a01('0x2f')]['fields']));_0xebc1f1[_0x9a01('0x32')]=_0xebc1f1[_0x9a01('0x32')][_0x9a01('0x34')]?_0xebc1f1[_0x9a01('0x32')]:_0x26e332['model'];if(!_0x4567fc['query'][_0x9a01('0x35')]('nolimit')){_0xebc1f1[_0x9a01('0x1a')]=qs[_0x9a01('0x1a')](_0x4567fc['query'][_0x9a01('0x1a')]);_0xebc1f1['offset']=qs[_0x9a01('0x18')](_0x4567fc[_0x9a01('0x2f')][_0x9a01('0x18')]);}_0xebc1f1[_0x9a01('0x36')]=qs['sort'](_0x4567fc[_0x9a01('0x2f')]['sort']);_0xebc1f1['where']=qs[_0x9a01('0x30')](_[_0x9a01('0x37')](_0x4567fc['query'],_0x26e332[_0x9a01('0x30')]),_0x17d920);if(_0x4567fc['query'][_0x9a01('0x38')]){_0xebc1f1[_0x9a01('0x39')]=_[_0x9a01('0x3a')](_0xebc1f1[_0x9a01('0x39')],{'$or':_[_0x9a01('0x2a')](_0x17d920,function(_0x4438ea){if(_0x4438ea['type']!==_0x9a01('0x3b')){var _0x4e4af5={};_0x4e4af5[_0x4438ea[_0x9a01('0x3c')]]={'$like':'%'+_0x4567fc[_0x9a01('0x2f')][_0x9a01('0x38')]+'%'};return _0x4e4af5;}})});}_0xebc1f1=_[_0x9a01('0x3a')]({},_0xebc1f1,_0x4567fc[_0x9a01('0x3d')]);var _0x27512c={'where':_0xebc1f1[_0x9a01('0x39')]};return db[_0x9a01('0x2b')]['count'](_0x27512c)['then'](function(_0x1aba3d){_0x15bae5[_0x9a01('0x1b')]=_0x1aba3d;if(_0x4567fc[_0x9a01('0x2f')]['includeAll']){_0xebc1f1[_0x9a01('0x3e')]=[{'all':!![]}];}return db[_0x9a01('0x2b')][_0x9a01('0x3f')](_0xebc1f1);})[_0x9a01('0x22')](function(_0xe253e5){_0x15bae5[_0x9a01('0x40')]=_0xe253e5;return _0x15bae5;})[_0x9a01('0x22')](respondWithFilteredResult(_0x2a5ccb,_0xebc1f1))[_0x9a01('0x41')](handleError(_0x2a5ccb,null));};exports[_0x9a01('0x42')]=function(_0x170a80,_0x53bb04){var _0x4be1a6={'raw':![],'where':{'id':_0x170a80[_0x9a01('0x43')]['id']}},_0x4c1948={};_0x4c1948[_0x9a01('0x2e')]=_['keys'](db[_0x9a01('0x2b')][_0x9a01('0x44')]);_0x4c1948['query']=_[_0x9a01('0x45')](_0x170a80[_0x9a01('0x2f')]);_0x4c1948['filters']=_[_0x9a01('0x31')](_0x4c1948['model'],_0x4c1948['query']);_0x4be1a6[_0x9a01('0x32')]=_[_0x9a01('0x31')](_0x4c1948[_0x9a01('0x2e')],qs['fields'](_0x170a80[_0x9a01('0x2f')][_0x9a01('0x33')]));_0x4be1a6[_0x9a01('0x32')]=_0x4be1a6[_0x9a01('0x32')][_0x9a01('0x34')]?_0x4be1a6['attributes']:_0x4c1948[_0x9a01('0x2e')];if(_0x170a80[_0x9a01('0x2f')][_0x9a01('0x46')]){_0x4be1a6[_0x9a01('0x3e')]=[{'all':!![]}];}_0x4be1a6=_[_0x9a01('0x3a')]({},_0x4be1a6,_0x170a80[_0x9a01('0x3d')]);return db[_0x9a01('0x2b')][_0x9a01('0x47')](_0x4be1a6)['then'](handleEntityNotFound(_0x53bb04,null))[_0x9a01('0x22')](respondWithResult(_0x53bb04,null))['catch'](handleError(_0x53bb04,null));};exports[_0x9a01('0x48')]=function(_0x43d20a,_0x1d3f8c){return db[_0x9a01('0x2b')][_0x9a01('0x48')](_0x43d20a[_0x9a01('0x49')],{})['then'](function(_0x12a1ff){var _0x224a16=_0x43d20a[_0x9a01('0x4a')][_0x9a01('0x4b')]({'plain':!![]});if(!_0x224a16)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x224a16[_0x9a01('0x4c')]===_0x9a01('0x4a')){var _0x2a9489=_0x12a1ff[_0x9a01('0x4b')]({'plain':!![]});var _0x40ca8e=_0x9a01('0x24');return db['UserProfileSection'][_0x9a01('0x47')]({'where':{'name':_0x40ca8e,'userProfileId':_0x224a16['userProfileId']},'raw':!![]})[_0x9a01('0x22')](function(_0x48d154){if(_0x48d154&&_0x48d154[_0x9a01('0x4d')]===0x0){return db[_0x9a01('0x25')][_0x9a01('0x48')]({'name':_0x2a9489[_0x9a01('0x3c')],'resourceId':_0x2a9489['id'],'type':_0x48d154['name'],'sectionId':_0x48d154['id']},{})['then'](function(){return _0x12a1ff;});}else{return _0x12a1ff;}})[_0x9a01('0x41')](function(_0x4c7c26){logger['error'](_0x9a01('0x4e'),_0x4c7c26);throw _0x4c7c26;});}return _0x12a1ff;})[_0x9a01('0x22')](respondWithResult(_0x1d3f8c,0xc9))['catch'](handleError(_0x1d3f8c,null));};exports['update']=function(_0x51a7a3,_0x564dd9){if(_0x51a7a3['body']['id']){delete _0x51a7a3[_0x9a01('0x49')]['id'];}return db[_0x9a01('0x2b')][_0x9a01('0x47')]({'where':{'id':_0x51a7a3[_0x9a01('0x43')]['id']}})['then'](handleEntityNotFound(_0x564dd9,null))[_0x9a01('0x22')](saveUpdates(_0x51a7a3['body'],null))[_0x9a01('0x22')](respondWithResult(_0x564dd9,null))[_0x9a01('0x41')](handleError(_0x564dd9,null));};exports[_0x9a01('0x23')]=function(_0x49d48c,_0x2daf6){return db[_0x9a01('0x2b')][_0x9a01('0x47')]({'where':{'id':_0x49d48c[_0x9a01('0x43')]['id']}})[_0x9a01('0x22')](handleEntityNotFound(_0x2daf6,null))['then'](removeEntity(_0x2daf6,null))[_0x9a01('0x41')](handleError(_0x2daf6,null));};exports[_0x9a01('0x4f')]=function(_0x155b07,_0x431037,_0x75fff3){if(_0x155b07['body']['id']){delete _0x155b07[_0x9a01('0x49')]['id'];}return db[_0x9a01('0x2b')][_0x9a01('0x47')]({'where':{'id':_0x155b07[_0x9a01('0x43')]['id']}})[_0x9a01('0x22')](handleEntityNotFound(_0x431037,null))[_0x9a01('0x22')](function(_0x4d1367){if(_0x4d1367){_0x155b07[_0x9a01('0x49')][_0x9a01('0x50')]=_0x4d1367['id'];return db[_0x9a01('0x51')][_0x9a01('0x48')](_0x155b07[_0x9a01('0x49')]);}})[_0x9a01('0x22')](respondWithResult(_0x431037,null))[_0x9a01('0x41')](handleError(_0x431037,null));};exports[_0x9a01('0x52')]=function(_0x570063,_0x177f32,_0xf095f5){if(_0x570063['body']['id']){delete _0x570063[_0x9a01('0x49')]['id'];}return db[_0x9a01('0x2b')]['find']({'where':{'id':_0x570063['params']['id']}})[_0x9a01('0x22')](handleEntityNotFound(_0x177f32,null))[_0x9a01('0x22')](function(_0x5a58d4){if(_0x5a58d4){_0x570063[_0x9a01('0x49')]['TriggerAnyId']=_0x5a58d4['id'];return db[_0x9a01('0x51')][_0x9a01('0x48')](_0x570063[_0x9a01('0x49')]);}})[_0x9a01('0x22')](respondWithResult(_0x177f32,null))[_0x9a01('0x41')](handleError(_0x177f32,null));};exports['getAllConditions']=function(_0x2f5ea7,_0xf7f67d,_0x423321){var _0x11420e={};var _0x48d776={};var _0x500127;var _0x46ee88;return db['Trigger']['findOne']({'where':{'id':_0x2f5ea7[_0x9a01('0x43')]['id']}})[_0x9a01('0x22')](handleEntityNotFound(_0xf7f67d,null))[_0x9a01('0x22')](function(_0x474c27){if(_0x474c27){_0x500127=_0x474c27;_0x48d776[_0x9a01('0x2e')]=_[_0x9a01('0x45')](db[_0x9a01('0x51')][_0x9a01('0x44')]);_0x48d776[_0x9a01('0x2f')]=_[_0x9a01('0x45')](_0x2f5ea7[_0x9a01('0x2f')]);_0x48d776['filters']=_[_0x9a01('0x31')](_0x48d776['model'],_0x48d776[_0x9a01('0x2f')]);_0x11420e[_0x9a01('0x32')]=_[_0x9a01('0x31')](_0x48d776[_0x9a01('0x2e')],qs[_0x9a01('0x33')](_0x2f5ea7[_0x9a01('0x2f')][_0x9a01('0x33')]));_0x11420e[_0x9a01('0x32')]=_0x11420e[_0x9a01('0x32')][_0x9a01('0x34')]?_0x11420e['attributes']:_0x48d776[_0x9a01('0x2e')];_0x11420e[_0x9a01('0x36')]=qs['sort'](_0x2f5ea7[_0x9a01('0x2f')][_0x9a01('0x53')]);_0x11420e[_0x9a01('0x39')]=qs[_0x9a01('0x30')](_['pick'](_0x2f5ea7['query'],_0x48d776[_0x9a01('0x30')]));if(_0x2f5ea7[_0x9a01('0x2f')][_0x9a01('0x38')]){_0x11420e[_0x9a01('0x39')]=_[_0x9a01('0x3a')](_0x11420e[_0x9a01('0x39')],{'$or':_[_0x9a01('0x2a')](_0x11420e[_0x9a01('0x32')],function(_0x25806d){var _0x223005={};_0x223005[_0x25806d]={'$like':'%'+_0x2f5ea7['query'][_0x9a01('0x38')]+'%'};return _0x223005;})});}_0x11420e=_[_0x9a01('0x3a')]({},_0x11420e,_0x2f5ea7[_0x9a01('0x3d')]);return _0x500127['getAllConditions'](_0x11420e);}})['then'](function(_0x2c05ba){if(_0x2c05ba){_0x46ee88=_0x2c05ba[_0x9a01('0x34')];if(!_0x2f5ea7[_0x9a01('0x2f')]['hasOwnProperty'](_0x9a01('0x54'))){_0x11420e['limit']=qs[_0x9a01('0x1a')](_0x2f5ea7[_0x9a01('0x2f')][_0x9a01('0x1a')]);_0x11420e[_0x9a01('0x18')]=qs[_0x9a01('0x18')](_0x2f5ea7[_0x9a01('0x2f')][_0x9a01('0x18')]);}return _0x500127[_0x9a01('0x55')](_0x11420e);}})[_0x9a01('0x22')](function(_0x4baf63){if(_0x4baf63){return _0x4baf63?{'count':_0x46ee88,'rows':_0x4baf63}:null;}})[_0x9a01('0x22')](respondWithResult(_0xf7f67d,null))[_0x9a01('0x41')](handleError(_0xf7f67d,null));};exports[_0x9a01('0x56')]=function(_0x1f7ce8,_0x44b5d9,_0x5340a5){var _0x2f0a03={};var _0x505966={};var _0x165293;var _0x53b4fe;return db[_0x9a01('0x2b')][_0x9a01('0x57')]({'where':{'id':_0x1f7ce8[_0x9a01('0x43')]['id']}})[_0x9a01('0x22')](handleEntityNotFound(_0x44b5d9,null))['then'](function(_0x1f5972){if(_0x1f5972){_0x165293=_0x1f5972;_0x505966[_0x9a01('0x2e')]=_[_0x9a01('0x45')](db[_0x9a01('0x51')][_0x9a01('0x44')]);_0x505966[_0x9a01('0x2f')]=_[_0x9a01('0x45')](_0x1f7ce8[_0x9a01('0x2f')]);_0x505966[_0x9a01('0x30')]=_[_0x9a01('0x31')](_0x505966[_0x9a01('0x2e')],_0x505966[_0x9a01('0x2f')]);_0x2f0a03['attributes']=_[_0x9a01('0x31')](_0x505966[_0x9a01('0x2e')],qs['fields'](_0x1f7ce8[_0x9a01('0x2f')][_0x9a01('0x33')]));_0x2f0a03[_0x9a01('0x32')]=_0x2f0a03[_0x9a01('0x32')]['length']?_0x2f0a03[_0x9a01('0x32')]:_0x505966['model'];_0x2f0a03[_0x9a01('0x36')]=qs[_0x9a01('0x53')](_0x1f7ce8[_0x9a01('0x2f')][_0x9a01('0x53')]);_0x2f0a03['where']=qs['filters'](_[_0x9a01('0x37')](_0x1f7ce8[_0x9a01('0x2f')],_0x505966[_0x9a01('0x30')]));if(_0x1f7ce8[_0x9a01('0x2f')]['filter']){_0x2f0a03[_0x9a01('0x39')]=_[_0x9a01('0x3a')](_0x2f0a03['where'],{'$or':_['map'](_0x2f0a03['attributes'],function(_0x569734){var _0x2683ab={};_0x2683ab[_0x569734]={'$like':'%'+_0x1f7ce8[_0x9a01('0x2f')]['filter']+'%'};return _0x2683ab;})});}_0x2f0a03=_['merge']({},_0x2f0a03,_0x1f7ce8['options']);return _0x165293['getAnyConditions'](_0x2f0a03);}})[_0x9a01('0x22')](function(_0x3a9d84){if(_0x3a9d84){_0x53b4fe=_0x3a9d84[_0x9a01('0x34')];if(!_0x1f7ce8['query'][_0x9a01('0x35')](_0x9a01('0x54'))){_0x2f0a03['limit']=qs[_0x9a01('0x1a')](_0x1f7ce8[_0x9a01('0x2f')][_0x9a01('0x1a')]);_0x2f0a03['offset']=qs[_0x9a01('0x18')](_0x1f7ce8[_0x9a01('0x2f')]['offset']);}return _0x165293['getAnyConditions'](_0x2f0a03);}})[_0x9a01('0x22')](function(_0x2e2046){if(_0x2e2046){return _0x2e2046?{'count':_0x53b4fe,'rows':_0x2e2046}:null;}})[_0x9a01('0x22')](respondWithResult(_0x44b5d9,null))[_0x9a01('0x41')](handleError(_0x44b5d9,null));};exports[_0x9a01('0x58')]=function(_0x34dc27,_0x43069b,_0xd44f31){if(_0x34dc27[_0x9a01('0x49')]['id']){delete _0x34dc27[_0x9a01('0x49')]['id'];}return db[_0x9a01('0x2b')][_0x9a01('0x47')]({'where':{'id':_0x34dc27[_0x9a01('0x43')]['id']}})[_0x9a01('0x22')](handleEntityNotFound(_0x43069b,null))[_0x9a01('0x22')](function(_0x5d8de5){if(_0x5d8de5){_0x34dc27['body'][_0x9a01('0x59')]=_0x5d8de5['id'];return db[_0x9a01('0x5a')]['create'](_0x34dc27[_0x9a01('0x49')]);}})['then'](respondWithResult(_0x43069b,null))[_0x9a01('0x41')](handleError(_0x43069b,null));};exports[_0x9a01('0x5b')]=function(_0x2c9f85,_0x2e826e,_0x1b62cd){var _0x18a82c={};var _0x2bf163={};var _0x520e2e;var _0x55e247;return db[_0x9a01('0x2b')]['findOne']({'where':{'id':_0x2c9f85[_0x9a01('0x43')]['id']}})[_0x9a01('0x22')](handleEntityNotFound(_0x2e826e,null))[_0x9a01('0x22')](function(_0x44d14f){if(_0x44d14f){_0x520e2e=_0x44d14f;_0x2bf163['model']=_[_0x9a01('0x45')](db['Action'][_0x9a01('0x44')]);_0x2bf163['query']=_[_0x9a01('0x45')](_0x2c9f85['query']);_0x2bf163[_0x9a01('0x30')]=_[_0x9a01('0x31')](_0x2bf163['model'],_0x2bf163[_0x9a01('0x2f')]);_0x18a82c['attributes']=_[_0x9a01('0x31')](_0x2bf163[_0x9a01('0x2e')],qs[_0x9a01('0x33')](_0x2c9f85[_0x9a01('0x2f')][_0x9a01('0x33')]));_0x18a82c['attributes']=_0x18a82c[_0x9a01('0x32')][_0x9a01('0x34')]?_0x18a82c['attributes']:_0x2bf163[_0x9a01('0x2e')];_0x18a82c[_0x9a01('0x36')]=qs[_0x9a01('0x53')](_0x2c9f85[_0x9a01('0x2f')][_0x9a01('0x53')]);_0x18a82c[_0x9a01('0x39')]=qs[_0x9a01('0x30')](_[_0x9a01('0x37')](_0x2c9f85[_0x9a01('0x2f')],_0x2bf163[_0x9a01('0x30')]));if(_0x2c9f85[_0x9a01('0x2f')][_0x9a01('0x38')]){_0x18a82c[_0x9a01('0x39')]=_['merge'](_0x18a82c[_0x9a01('0x39')],{'$or':_[_0x9a01('0x2a')](_0x18a82c[_0x9a01('0x32')],function(_0x486654){var _0x1a75a0={};_0x1a75a0[_0x486654]={'$like':'%'+_0x2c9f85[_0x9a01('0x2f')][_0x9a01('0x38')]+'%'};return _0x1a75a0;})});}_0x18a82c=_['merge']({},_0x18a82c,_0x2c9f85[_0x9a01('0x3d')]);return _0x520e2e[_0x9a01('0x5b')](_0x18a82c);}})['then'](function(_0xf1b06f){if(_0xf1b06f){_0x55e247=_0xf1b06f[_0x9a01('0x34')];if(!_0x2c9f85['query'][_0x9a01('0x35')](_0x9a01('0x54'))){_0x18a82c[_0x9a01('0x1a')]=qs[_0x9a01('0x1a')](_0x2c9f85['query'][_0x9a01('0x1a')]);_0x18a82c['offset']=qs['offset'](_0x2c9f85[_0x9a01('0x2f')][_0x9a01('0x18')]);}return _0x520e2e[_0x9a01('0x5b')](_0x18a82c);}})[_0x9a01('0x22')](function(_0x15d89a){if(_0x15d89a){return _0x15d89a?{'count':_0x55e247,'rows':_0x15d89a}:null;}})['then'](respondWithResult(_0x2e826e,null))[_0x9a01('0x41')](handleError(_0x2e826e,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 6263ed0..3f2d164 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 _0x8f7d=['define','Trigger','tools_triggers','lodash','util','api','request-promise','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x574d41,_0x298ffc){var _0x55a3b6=function(_0x453e68){while(--_0x453e68){_0x574d41['push'](_0x574d41['shift']());}};_0x55a3b6(++_0x298ffc);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x5178a3,_0x6ff25c){_0x5178a3=_0x5178a3-0x0;var _0x3f423e=_0x8f7d[_0x5178a3];return _0x3f423e;};'use strict';var _=require(_0xd8f7('0x0'));var util=require(_0xd8f7('0x1'));var logger=require('../../config/logger')(_0xd8f7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd8f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8f7('0x4'));var config=require(_0xd8f7('0x5'));var attributes=require(_0xd8f7('0x6'));module[_0xd8f7('0x7')]=function(_0x524a2e,_0x4090c9){return _0x524a2e[_0xd8f7('0x8')](_0xd8f7('0x9'),attributes,{'tableName':_0xd8f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd82a=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x51cde2,_0x3a6772){var _0x59d423=function(_0x3cc833){while(--_0x3cc833){_0x51cde2['push'](_0x51cde2['shift']());}};_0x59d423(++_0x3a6772);}(_0xd82a,0xbd));var _0xad82=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xd82a[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var logger=require(_0xad82('0x2'))(_0xad82('0x3'));var moment=require('moment');var BPromise=require(_0xad82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad82('0x5'));var rimraf=require(_0xad82('0x6'));var config=require(_0xad82('0x7'));var attributes=require(_0xad82('0x8'));module[_0xad82('0x9')]=function(_0x19e277,_0x343d52){return _0x19e277[_0xad82('0xa')](_0xad82('0xb'),attributes,{'tableName':_0xad82('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 f38de4a..af17b99 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 _0x4a60=['http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','attributes','map','model','debug','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x50b634,_0x1a9974){var _0xcbb832=function(_0x13441b){while(--_0x13441b){_0x50b634['push'](_0x50b634['shift']());}};_0xcbb832(++_0x1a9974);}(_0x4a60,0x65));var _0x04a6=function(_0x5442a5,_0x4110f1){_0x5442a5=_0x5442a5-0x0;var _0x130af0=_0x4a60[_0x5442a5];return _0x130af0;};'use strict';var _=require(_0x04a6('0x0'));var util=require(_0x04a6('0x1'));var moment=require(_0x04a6('0x2'));var BPromise=require(_0x04a6('0x3'));var rs=require(_0x04a6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x04a6('0x5'));var logger=require(_0x04a6('0x6'))('rpc');var config=require(_0x04a6('0x7'));var jayson=require(_0x04a6('0x8'));var client=jayson[_0x04a6('0x9')][_0x04a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8e9cdb,_0x45282b,_0x147423){return new BPromise(function(_0x3a9d86,_0x75e4db){return client[_0x04a6('0xb')](_0x8e9cdb,_0x147423)[_0x04a6('0xc')](function(_0x1a0b92){logger[_0x04a6('0xd')](_0x04a6('0xe'),_0x45282b,_0x04a6('0xf'));logger['debug'](_0x04a6('0x10'),_0x45282b,_0x04a6('0xf'),JSON[_0x04a6('0x11')](_0x1a0b92));if(_0x1a0b92[_0x04a6('0x12')]){if(_0x1a0b92['error'][_0x04a6('0x13')]===0x1f4){logger[_0x04a6('0x12')](_0x04a6('0xe'),_0x45282b,_0x1a0b92[_0x04a6('0x12')]['message']);return _0x75e4db(_0x1a0b92[_0x04a6('0x12')]['message']);}logger['error'](_0x04a6('0xe'),_0x45282b,_0x1a0b92['error']['message']);return _0x3a9d86(_0x1a0b92['error']['message']);}else{logger[_0x04a6('0xd')]('Trigger,\x20%s,\x20%s',_0x45282b,_0x04a6('0xf'));_0x3a9d86(_0x1a0b92[_0x04a6('0x14')][_0x04a6('0x15')]);}})[_0x04a6('0x16')](function(_0x5b6514){logger[_0x04a6('0x12')](_0x04a6('0xe'),_0x45282b,_0x5b6514);_0x75e4db(_0x5b6514);});});}exports[_0x04a6('0x17')]=function(_0x396741){var _0xd4e302=this;return new Promise(function(_0x4dd01f,_0x114dce){return db[_0x04a6('0x18')][_0x04a6('0x19')]({'raw':_0x396741[_0x04a6('0x1a')]?_0x396741[_0x04a6('0x1a')][_0x04a6('0x1b')]===undefined?!![]:![]:!![],'where':_0x396741['options']?_0x396741[_0x04a6('0x1a')][_0x04a6('0x1c')]||null:null,'attributes':_0x396741['options']?_0x396741[_0x04a6('0x1a')]['attributes']||null:null,'limit':_0x396741['options']?_0x396741[_0x04a6('0x1a')][_0x04a6('0x1d')]||null:null,'include':_0x396741[_0x04a6('0x1a')]?_0x396741[_0x04a6('0x1a')][_0x04a6('0x1e')]?_['map'](_0x396741[_0x04a6('0x1a')]['include'],function(_0xd04bd5){return{'model':db[_0xd04bd5['model']],'as':_0xd04bd5['as'],'attributes':_0xd04bd5[_0x04a6('0x1f')],'include':_0xd04bd5['include']?_[_0x04a6('0x20')](_0xd04bd5[_0x04a6('0x1e')],function(_0x418695){return{'model':db[_0x418695[_0x04a6('0x21')]],'as':_0x418695['as'],'attributes':_0x418695[_0x04a6('0x1f')],'include':_0x418695[_0x04a6('0x1e')]?_[_0x04a6('0x20')](_0x418695[_0x04a6('0x1e')],function(_0x41f518){return{'model':db[_0x41f518[_0x04a6('0x21')]],'as':_0x41f518['as'],'attributes':_0x41f518[_0x04a6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x04a6('0xc')](function(_0x51fa73){logger[_0x04a6('0xd')](_0x04a6('0x17'),_0x396741);logger[_0x04a6('0x22')](_0x04a6('0x17'),_0x396741,JSON[_0x04a6('0x11')](_0x51fa73));_0x4dd01f(_0x51fa73);})[_0x04a6('0x16')](function(_0x5a3c90){logger[_0x04a6('0x12')]('GetTrigger',_0x5a3c90['message'],_0x396741);_0x114dce(_0xd4e302[_0x04a6('0x12')](0x1f4,_0x5a3c90[_0x04a6('0x15')]));});});};exports[_0x04a6('0x23')]=function(_0x1a7ac4){var _0x59c1cb=this;return new Promise(function(_0x585d38,_0x5d617b){return db[_0x04a6('0x18')][_0x04a6('0x24')]({'raw':_0x1a7ac4[_0x04a6('0x1a')]?_0x1a7ac4[_0x04a6('0x1a')][_0x04a6('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a7ac4['options']?_0x1a7ac4['options'][_0x04a6('0x1c')]||null:null,'attributes':_0x1a7ac4[_0x04a6('0x1a')]?_0x1a7ac4[_0x04a6('0x1a')][_0x04a6('0x1f')]||null:null,'include':_0x1a7ac4[_0x04a6('0x1a')]?_0x1a7ac4[_0x04a6('0x1a')]['include']?_[_0x04a6('0x20')](_0x1a7ac4['options']['include'],function(_0x10499b){return{'model':db[_0x10499b[_0x04a6('0x21')]],'as':_0x10499b['as'],'attributes':_0x10499b[_0x04a6('0x1f')],'include':_0x10499b[_0x04a6('0x1e')]?_['map'](_0x10499b[_0x04a6('0x1e')],function(_0x38b0ae){return{'model':db[_0x38b0ae['model']],'as':_0x38b0ae['as'],'attributes':_0x38b0ae[_0x04a6('0x1f')],'include':_0x38b0ae['include']?_['map'](_0x38b0ae['include'],function(_0x292faf){return{'model':db[_0x292faf[_0x04a6('0x21')]],'as':_0x292faf['as'],'attributes':_0x292faf[_0x04a6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfb779e){logger[_0x04a6('0xd')](_0x04a6('0x23'),_0x1a7ac4);logger[_0x04a6('0x22')](_0x04a6('0x23'),_0x1a7ac4,JSON[_0x04a6('0x11')](_0xfb779e));_0x585d38(_0xfb779e);})['catch'](function(_0x3a6729){logger['error'](_0x04a6('0x23'),_0x3a6729['message'],_0x1a7ac4);_0x5d617b(_0x59c1cb[_0x04a6('0x12')](0x1f4,_0x3a6729[_0x04a6('0x15')]));});});}; \ No newline at end of file +var _0x10f8=['info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','debug','ShowTrigger','find','where','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x229317,_0x42d0db){var _0x5378d7=function(_0x5b78ad){while(--_0x5b78ad){_0x229317['push'](_0x229317['shift']());}};_0x5378d7(++_0x42d0db);}(_0x10f8,0x1bd));var _0x810f=function(_0x414166,_0x5e87f3){_0x414166=_0x414166-0x0;var _0x373505=_0x10f8[_0x414166];return _0x373505;};'use strict';var _=require('lodash');var util=require(_0x810f('0x0'));var moment=require('moment');var BPromise=require(_0x810f('0x1'));var rs=require(_0x810f('0x2'));var fs=require('fs');var Redis=require(_0x810f('0x3'));var db=require(_0x810f('0x4'))['db'];var utils=require(_0x810f('0x5'));var logger=require(_0x810f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x810f('0x7'));var client=jayson[_0x810f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bfcd6,_0x1f038a,_0x40178d){return new BPromise(function(_0x4c47e2,_0x4b2ab5){return client[_0x810f('0x9')](_0x1bfcd6,_0x40178d)['then'](function(_0x336deb){logger[_0x810f('0xa')](_0x810f('0xb'),_0x1f038a,_0x810f('0xc'));logger['debug'](_0x810f('0xd'),_0x1f038a,_0x810f('0xc'),JSON[_0x810f('0xe')](_0x336deb));if(_0x336deb['error']){if(_0x336deb[_0x810f('0xf')][_0x810f('0x10')]===0x1f4){logger[_0x810f('0xf')](_0x810f('0xb'),_0x1f038a,_0x336deb[_0x810f('0xf')][_0x810f('0x11')]);return _0x4b2ab5(_0x336deb[_0x810f('0xf')][_0x810f('0x11')]);}logger[_0x810f('0xf')](_0x810f('0xb'),_0x1f038a,_0x336deb['error'][_0x810f('0x11')]);return _0x4c47e2(_0x336deb[_0x810f('0xf')]['message']);}else{logger[_0x810f('0xa')](_0x810f('0xb'),_0x1f038a,_0x810f('0xc'));_0x4c47e2(_0x336deb[_0x810f('0x12')][_0x810f('0x11')]);}})[_0x810f('0x13')](function(_0x141392){logger[_0x810f('0xf')](_0x810f('0xb'),_0x1f038a,_0x141392);_0x4b2ab5(_0x141392);});});}exports[_0x810f('0x14')]=function(_0x43b9f6){var _0x25171b=this;return new Promise(function(_0x2ba2f5,_0x1d4e1d){return db[_0x810f('0x15')][_0x810f('0x16')]({'raw':_0x43b9f6[_0x810f('0x17')]?_0x43b9f6[_0x810f('0x17')][_0x810f('0x18')]===undefined?!![]:![]:!![],'where':_0x43b9f6[_0x810f('0x17')]?_0x43b9f6['options']['where']||null:null,'attributes':_0x43b9f6[_0x810f('0x17')]?_0x43b9f6[_0x810f('0x17')][_0x810f('0x19')]||null:null,'limit':_0x43b9f6[_0x810f('0x17')]?_0x43b9f6['options'][_0x810f('0x1a')]||null:null,'include':_0x43b9f6[_0x810f('0x17')]?_0x43b9f6[_0x810f('0x17')][_0x810f('0x1b')]?_[_0x810f('0x1c')](_0x43b9f6[_0x810f('0x17')][_0x810f('0x1b')],function(_0x384b45){return{'model':db[_0x384b45[_0x810f('0x1d')]],'as':_0x384b45['as'],'attributes':_0x384b45['attributes'],'include':_0x384b45[_0x810f('0x1b')]?_[_0x810f('0x1c')](_0x384b45[_0x810f('0x1b')],function(_0x448420){return{'model':db[_0x448420['model']],'as':_0x448420['as'],'attributes':_0x448420[_0x810f('0x19')],'include':_0x448420[_0x810f('0x1b')]?_[_0x810f('0x1c')](_0x448420[_0x810f('0x1b')],function(_0x593dd1){return{'model':db[_0x593dd1[_0x810f('0x1d')]],'as':_0x593dd1['as'],'attributes':_0x593dd1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5839d9){logger[_0x810f('0xa')](_0x810f('0x14'),_0x43b9f6);logger[_0x810f('0x1e')](_0x810f('0x14'),_0x43b9f6,JSON[_0x810f('0xe')](_0x5839d9));_0x2ba2f5(_0x5839d9);})[_0x810f('0x13')](function(_0x1a51bd){logger['error'](_0x810f('0x14'),_0x1a51bd['message'],_0x43b9f6);_0x1d4e1d(_0x25171b['error'](0x1f4,_0x1a51bd[_0x810f('0x11')]));});});};exports[_0x810f('0x1f')]=function(_0x5ba16d){var _0x32275c=this;return new Promise(function(_0x206090,_0x430936){return db[_0x810f('0x15')][_0x810f('0x20')]({'raw':_0x5ba16d[_0x810f('0x17')]?_0x5ba16d['options'][_0x810f('0x18')]===undefined?!![]:![]:!![],'where':_0x5ba16d[_0x810f('0x17')]?_0x5ba16d[_0x810f('0x17')][_0x810f('0x21')]||null:null,'attributes':_0x5ba16d[_0x810f('0x17')]?_0x5ba16d['options'][_0x810f('0x19')]||null:null,'include':_0x5ba16d[_0x810f('0x17')]?_0x5ba16d[_0x810f('0x17')][_0x810f('0x1b')]?_[_0x810f('0x1c')](_0x5ba16d[_0x810f('0x17')]['include'],function(_0x52c255){return{'model':db[_0x52c255[_0x810f('0x1d')]],'as':_0x52c255['as'],'attributes':_0x52c255[_0x810f('0x19')],'include':_0x52c255['include']?_[_0x810f('0x1c')](_0x52c255[_0x810f('0x1b')],function(_0x203941){return{'model':db[_0x203941[_0x810f('0x1d')]],'as':_0x203941['as'],'attributes':_0x203941[_0x810f('0x19')],'include':_0x203941[_0x810f('0x1b')]?_[_0x810f('0x1c')](_0x203941[_0x810f('0x1b')],function(_0x5077b3){return{'model':db[_0x5077b3[_0x810f('0x1d')]],'as':_0x5077b3['as'],'attributes':_0x5077b3[_0x810f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x810f('0x22')](function(_0x465d86){logger[_0x810f('0xa')]('ShowTrigger',_0x5ba16d);logger[_0x810f('0x1e')](_0x810f('0x1f'),_0x5ba16d,JSON['stringify'](_0x465d86));_0x206090(_0x465d86);})[_0x810f('0x13')](function(_0x366fb8){logger[_0x810f('0xf')](_0x810f('0x1f'),_0x366fb8[_0x810f('0x11')],_0x5ba16d);_0x430936(_0x32275c[_0x810f('0xf')](0x1f4,_0x366fb8[_0x810f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 6649a13..a39f700 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 _0x036e=['clone','create','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','post','/:id/clone'];(function(_0x2f64ef,_0x21c95a){var _0x56e6e5=function(_0x21e033){while(--_0x21e033){_0x2f64ef['push'](_0x2f64ef['shift']());}};_0x56e6e5(++_0x21c95a);}(_0x036e,0x15a));var _0xe036=function(_0x3cddcb,_0x5e0bbd){_0x3cddcb=_0x3cddcb-0x0;var _0x3878e8=_0x036e[_0x3cddcb];return _0x3878e8;};'use strict';var multer=require(_0xe036('0x0'));var util=require(_0xe036('0x1'));var path=require(_0xe036('0x2'));var timeout=require('connect-timeout');var express=require(_0xe036('0x3'));var router=express[_0xe036('0x4')]();var fs_extra=require(_0xe036('0x5'));var auth=require(_0xe036('0x6'));var interaction=require(_0xe036('0x7'));var config=require(_0xe036('0x8'));var controller=require(_0xe036('0x9'));router['get']('/',auth[_0xe036('0xa')](),controller[_0xe036('0xb')]);router['get']('/:id',auth[_0xe036('0xa')](),controller['show']);router[_0xe036('0xc')](_0xe036('0xd'),auth[_0xe036('0xa')](),controller[_0xe036('0xe')]);router[_0xe036('0xc')]('/',auth[_0xe036('0xa')](),controller[_0xe036('0xf')]);router['put'](_0xe036('0x10'),auth[_0xe036('0xa')](),controller[_0xe036('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe036('0x12')]);module[_0xe036('0x13')]=router; \ No newline at end of file +var _0xe9c3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','clone','post','create','put','update','delete','destroy','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9c3,0xe6));var _0x3e9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x3e9c('0x0'));var path=require('path');var timeout=require(_0x3e9c('0x1'));var express=require(_0x3e9c('0x2'));var router=express[_0x3e9c('0x3')]();var fs_extra=require(_0x3e9c('0x4'));var auth=require(_0x3e9c('0x5'));var interaction=require(_0x3e9c('0x6'));var config=require(_0x3e9c('0x7'));var controller=require('./trunk.controller');router['get']('/',auth[_0x3e9c('0x8')](),controller[_0x3e9c('0x9')]);router[_0x3e9c('0xa')](_0x3e9c('0xb'),auth[_0x3e9c('0x8')](),controller[_0x3e9c('0xc')]);router['post']('/:id/clone',auth[_0x3e9c('0x8')](),controller[_0x3e9c('0xd')]);router[_0x3e9c('0xe')]('/',auth[_0x3e9c('0x8')](),controller[_0x3e9c('0xf')]);router[_0x3e9c('0x10')]('/:id',auth[_0x3e9c('0x8')](),controller[_0x3e9c('0x11')]);router[_0x3e9c('0x12')](_0x3e9c('0xb'),auth[_0x3e9c('0x8')](),controller[_0x3e9c('0x13')]);module[_0x3e9c('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 376975b..91ef847 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 _0x42a7=['from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','nonat','outgoing','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','insecure','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','active','passive','dynamic','update','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x42a7,0x1b1));var _0x742a=function(_0x3e19fb,_0x3258e2){_0x3e19fb=_0x3e19fb-0x0;var _0x5b19bd=_0x42a7[_0x3e19fb];return _0x5b19bd;};'use strict';var Sequelize=require(_0x742a('0x0'));module[_0x742a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x742a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x4'),_0x742a('0x5'),_0x742a('0x6')),'allowNull':![],'defaultValue':_0x742a('0x4')},'context':{'type':Sequelize[_0x742a('0x7')],'allowNull':![],'defaultValue':_0x742a('0x8')},'callingpres':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x9'),_0x742a('0xa'),'ALLOWED_FAILED_SCREEN',_0x742a('0xb'),'PROHIB_NOT_SCREENED',_0x742a('0xc'),_0x742a('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0x742a('0x7')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x742a('0x7')]},'md5secret':{'type':Sequelize[_0x742a('0x7')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x742a('0x7')],'defaultValue':_0x742a('0xe'),'set':function(_0x53738b){this[_0x742a('0xf')](_0x742a('0x10'),_0x53738b?_0x53738b['join'](','):null);},'get':function(){return this[_0x742a('0x11')](_0x742a('0x10'))?this['getDataValue'](_0x742a('0x10'))['split'](','):null;},'comment':_0x742a('0x12')},'dtmfmode':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x13'),_0x742a('0x14'),'shortinfo',_0x742a('0x15'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x742a('0x3')]('yes','no',_0x742a('0x16'),'update',_0x742a('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x742a('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x742a('0x7')]},'directmediadeny':{'type':Sequelize[_0x742a('0x7')]},'nat':{'type':Sequelize[_0x742a('0x7')],'defaultValue':'force_rport,comedia','set':function(_0x57c8e8){this[_0x742a('0xf')](_0x742a('0x18'),_0x57c8e8?_0x57c8e8['join'](','):null);},'get':function(){return this['getDataValue'](_0x742a('0x18'))?this['getDataValue'](_0x742a('0x18'))[_0x742a('0x19')](','):null;},'comment':_0x742a('0x1a')},'callgroup':{'type':Sequelize[_0x742a('0x7')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x742a('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x742a('0x7')]},'language':{'type':Sequelize[_0x742a('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x742a('0x7')],'defaultValue':_0x742a('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x742a('0x1c'),'set':function(_0x125250){this[_0x742a('0xf')](_0x742a('0x1d'),_0x125250?_0x125250['join'](';'):_0x742a('0x1c'));},'get':function(){return this['getDataValue']('allow')?this[_0x742a('0x11')](_0x742a('0x1d'))['split'](';'):null;},'comment':_0x742a('0x1e')},'autoframing':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'insecure':{'type':Sequelize[_0x742a('0x7')],'defaultValue':'port,invite','set':function(_0x33eafa){this[_0x742a('0xf')](_0x742a('0x20'),_0x33eafa?_0x33eafa[_0x742a('0x21')](','):null);},'get':function(){return this[_0x742a('0x11')]('insecure')?this[_0x742a('0x11')](_0x742a('0x20'))['split'](','):null;},'comment':_0x742a('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x742a('0x1f'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no',_0x742a('0x23'))},'promiscredir':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'useclientcode':{'type':Sequelize[_0x742a('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x742a('0x24')](0xb)},'setvar':{'type':Sequelize[_0x742a('0x7')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x742a('0x25')},'amaflags':{'type':Sequelize[_0x742a('0x7')]},'callcounter':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x742a('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'allowsubscribe':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'allowtransfer':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'ignoresdpversion':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'subscribecontext':{'type':Sequelize[_0x742a('0x7')]},'template':{'type':Sequelize[_0x742a('0x7')]},'videosupport':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no',_0x742a('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x27'),_0x742a('0x28'),_0x742a('0x29'))},'session_expires':{'type':Sequelize[_0x742a('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x742a('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x742a('0x3')]('uac',_0x742a('0x2a')),'defaultValue':_0x742a('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x742a('0x7')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x742a('0x7')]},'port':{'type':Sequelize[_0x742a('0x24')](0x5)},'qualify':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no'),'defaultValue':_0x742a('0x1f')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x742a('0x7')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x742a('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x742a('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x742a('0x3')]('yes','no',_0x742a('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x742a('0x7')]},'callbackextension':{'type':Sequelize[_0x742a('0x7')]},'timert1':{'type':Sequelize[_0x742a('0x24')](0xb)},'timerb':{'type':Sequelize[_0x742a('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x742a('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x742a('0x7')]},'contactdeny':{'type':Sequelize[_0x742a('0x7')]},'contactacl':{'type':Sequelize[_0x742a('0x7')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x742a('0x7')]},'maxforwards':{'type':Sequelize[_0x742a('0x24')](0xb)},'encryption':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'force_avp':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'icesupport':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'dtlsenable':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no')},'dtlsverify':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x742a('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x742a('0x7')]},'dtlsprivatekey':{'type':Sequelize[_0x742a('0x7')]},'dtlscipher':{'type':Sequelize[_0x742a('0x7')]},'dtlscafile':{'type':Sequelize[_0x742a('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x2c'),_0x742a('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x742a('0x7')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x742a('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x742a('0x1f'),'no')},'vmexten':{'type':Sequelize[_0x742a('0x7')]},'mohinterpret':{'type':Sequelize[_0x742a('0x7')]},'mohsuggest':{'type':Sequelize[_0x742a('0x7')]},'parkinglot':{'type':Sequelize[_0x742a('0x7')]},'description':{'type':Sequelize[_0x742a('0x7')]},'host':{'type':Sequelize[_0x742a('0x7')],'defaultValue':_0x742a('0x2e')},'canreinvite':{'type':Sequelize[_0x742a('0x3')](_0x742a('0x1f'),'no',_0x742a('0x16'),_0x742a('0x2f'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x742a('0x7')]},'otherFields':{'type':Sequelize[_0x742a('0x7')]},'active':{'type':Sequelize[_0x742a('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xfd0c=['port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','update','update,nonat','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'];(function(_0x4684f5,_0x57cf5e){var _0x3cd4ed=function(_0x204262){while(--_0x204262){_0x4684f5['push'](_0x4684f5['shift']());}};_0x3cd4ed(++_0x57cf5e);}(_0xfd0c,0xe8));var _0xcfd0=function(_0x19b351,_0x547358){_0x19b351=_0x19b351-0x0;var _0x104803=_0xfd0c[_0x19b351];return _0x104803;};'use strict';var Sequelize=require('sequelize');module[_0xcfd0('0x0')]={'name':{'type':Sequelize[_0xcfd0('0x1')],'allowNull':![],'unique':_0xcfd0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x4'),'user',_0xcfd0('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xcfd0('0x1')],'allowNull':![],'defaultValue':_0xcfd0('0x6')},'callingpres':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x7'),'ALLOWED_PASSED_SCREEN',_0xcfd0('0x8'),_0xcfd0('0x9'),_0xcfd0('0xa'),_0xcfd0('0xb'),_0xcfd0('0xc'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xcfd0('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xcfd0('0x1')]},'remotesecret':{'type':Sequelize[_0xcfd0('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xcfd0('0xd'),'set':function(_0x3b8e4b){this['setDataValue'](_0xcfd0('0xe'),_0x3b8e4b?_0x3b8e4b[_0xcfd0('0xf')](','):null);},'get':function(){return this[_0xcfd0('0x10')](_0xcfd0('0xe'))?this['getDataValue'](_0xcfd0('0xe'))[_0xcfd0('0x11')](','):null;},'comment':_0xcfd0('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0xcfd0('0x13'),_0xcfd0('0x14'),_0xcfd0('0x15'),_0xcfd0('0x16'),_0xcfd0('0x17')),'defaultValue':_0xcfd0('0x13')},'directmedia':{'type':Sequelize[_0xcfd0('0x3')]('yes','no',_0xcfd0('0x18'),'update',_0xcfd0('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xcfd0('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xcfd0('0x1')]},'directmediadeny':{'type':Sequelize[_0xcfd0('0x1')]},'nat':{'type':Sequelize[_0xcfd0('0x1')],'defaultValue':_0xcfd0('0x1b'),'set':function(_0x291ab9){this['setDataValue'](_0xcfd0('0x1c'),_0x291ab9?_0x291ab9[_0xcfd0('0xf')](','):null);},'get':function(){return this[_0xcfd0('0x10')]('nat')?this[_0xcfd0('0x10')](_0xcfd0('0x1c'))['split'](','):null;},'comment':_0xcfd0('0x1d')},'callgroup':{'type':Sequelize[_0xcfd0('0x1')]},'namedcallgroup':{'type':Sequelize[_0xcfd0('0x1')]},'pickupgroup':{'type':Sequelize[_0xcfd0('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xcfd0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xcfd0('0x1')],'allowNull':![],'defaultValue':_0xcfd0('0x1e'),'set':function(_0x2d6224){this['setDataValue'](_0xcfd0('0x1f'),_0x2d6224?_0x2d6224[_0xcfd0('0xf')](';'):_0xcfd0('0x1e'));},'get':function(){return this['getDataValue'](_0xcfd0('0x1f'))?this[_0xcfd0('0x10')]('allow')['split'](';'):null;},'comment':_0xcfd0('0x20')},'autoframing':{'type':Sequelize[_0xcfd0('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xcfd0('0x21'),'set':function(_0x518823){this['setDataValue'](_0xcfd0('0x22'),_0x518823?_0x518823['join'](','):null);},'get':function(){return this[_0xcfd0('0x10')](_0xcfd0('0x22'))?this[_0xcfd0('0x10')](_0xcfd0('0x22'))[_0xcfd0('0x11')](','):null;},'comment':_0xcfd0('0x23')},'trustrpid':{'type':Sequelize[_0xcfd0('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xcfd0('0x1a'),'no',_0xcfd0('0x24'))},'promiscredir':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xcfd0('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no'),'defaultValue':_0xcfd0('0x1a')},'busylevel':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xcfd0('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xcfd0('0x1')]},'template':{'type':Sequelize[_0xcfd0('0x1')]},'videosupport':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no',_0xcfd0('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x28'),_0xcfd0('0x29'),_0xcfd0('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xcfd0('0x2b'),_0xcfd0('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xcfd0('0x1')]},'regexten':{'type':Sequelize[_0xcfd0('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xcfd0('0x1')]},'port':{'type':Sequelize[_0xcfd0('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xcfd0('0x1a')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xcfd0('0x1')]},'defaultuser':{'type':Sequelize[_0xcfd0('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no',_0xcfd0('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xcfd0('0x1')]},'callbackextension':{'type':Sequelize[_0xcfd0('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xcfd0('0x1')]},'contactacl':{'type':Sequelize[_0xcfd0('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xcfd0('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'encryption':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xcfd0('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xcfd0('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xcfd0('0x1a'),'no',_0xcfd0('0x2e'),_0xcfd0('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xcfd0('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xcfd0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xcfd0('0x1')]},'dtlscipher':{'type':Sequelize[_0xcfd0('0x1')]},'dtlscafile':{'type':Sequelize[_0xcfd0('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xcfd0('0x3')]('active',_0xcfd0('0x30'),_0xcfd0('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xcfd0('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xcfd0('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xcfd0('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xcfd0('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xcfd0('0x1')]},'parkinglot':{'type':Sequelize[_0xcfd0('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xcfd0('0x1')],'defaultValue':_0xcfd0('0x32')},'canreinvite':{'type':Sequelize[_0xcfd0('0x3')](_0xcfd0('0x1a'),'no',_0xcfd0('0x18'),_0xcfd0('0x33'),_0xcfd0('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xcfd0('0x1')]},'otherFields':{'type':Sequelize[_0xcfd0('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xcfd0('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index a3d1d9b..410f8ca 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 _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4af716,_0x10a3ec){var _0x5a69b9=function(_0x1890ab){while(--_0x1890ab){_0x4af716['push'](_0x4af716['shift']());}};_0x5a69b9(++_0x10a3ec);}(_0x24ca,0x1bc));var _0xa24c=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0x24ca[_0x134d5e];return _0x1e166a;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file +var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','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','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x5e95c,_0x5d0943){var _0x3ff5b8=function(_0x389c15){while(--_0x389c15){_0x5e95c['push'](_0x5e95c['shift']());}};_0x3ff5b8(++_0x5d0943);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1313d,_0x1e0d88){_0x1313d=_0x1313d-0x0;var _0x5c423b=_0x8d0e[_0x1313d];return _0x5c423b;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 683da17..5ad9830 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 _0xb7cc=['./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3fa2f6,_0x3c5de){var _0x1f31e0=function(_0x1b525c){while(--_0x1b525c){_0x3fa2f6['push'](_0x3fa2f6['shift']());}};_0x1f31e0(++_0x3c5de);}(_0xb7cc,0x6e));var _0xcb7c=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xb7cc[_0x2261ce];return _0x524640;};'use strict';var _=require(_0xcb7c('0x0'));var util=require(_0xcb7c('0x1'));var logger=require(_0xcb7c('0x2'))(_0xcb7c('0x3'));var moment=require(_0xcb7c('0x4'));var BPromise=require(_0xcb7c('0x5'));var rp=require(_0xcb7c('0x6'));var fs=require('fs');var path=require(_0xcb7c('0x7'));var rimraf=require(_0xcb7c('0x8'));var config=require(_0xcb7c('0x9'));var attributes=require(_0xcb7c('0xa'));module[_0xcb7c('0xb')]=function(_0x39d287,_0x2a3f68){return _0x39d287[_0xcb7c('0xc')](_0xcb7c('0xd'),attributes,{'tableName':_0xcb7c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e65=['./trunk.attributes','exports','define','tools_trunks','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x560ffe,_0x17b91f){var _0x1f7fc7=function(_0x3f1159){while(--_0x3f1159){_0x560ffe['push'](_0x560ffe['shift']());}};_0x1f7fc7(++_0x17b91f);}(_0x0e65,0x88));var _0x50e6=function(_0x51f080,_0x35b74d){_0x51f080=_0x51f080-0x0;var _0x16c437=_0x0e65[_0x51f080];return _0x16c437;};'use strict';var _=require(_0x50e6('0x0'));var util=require('util');var logger=require(_0x50e6('0x1'))(_0x50e6('0x2'));var moment=require(_0x50e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x50e6('0x4'));var fs=require('fs');var path=require(_0x50e6('0x5'));var rimraf=require(_0x50e6('0x6'));var config=require(_0x50e6('0x7'));var attributes=require(_0x50e6('0x8'));module[_0x50e6('0x9')]=function(_0x36fb5b,_0x23ad15){return _0x36fb5b[_0x50e6('0xa')]('Trunk',attributes,{'tableName':_0x50e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 8dff006..dc9903f 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 _0xae70=['attributes','limit','include','map','model','ShowTrunk','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','request\x20sent','result','catch','GetTrunk','Trunk','options','raw','where'];(function(_0x2ab89d,_0x2c79a8){var _0x438895=function(_0x22e40f){while(--_0x22e40f){_0x2ab89d['push'](_0x2ab89d['shift']());}};_0x438895(++_0x2c79a8);}(_0xae70,0x1e6));var _0x0ae7=function(_0x49d9b2,_0x48eede){_0x49d9b2=_0x49d9b2-0x0;var _0x4cbfc2=_0xae70[_0x49d9b2];return _0x4cbfc2;};'use strict';var _=require('lodash');var util=require(_0x0ae7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0ae7('0x1'));var fs=require('fs');var Redis=require(_0x0ae7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ae7('0x3'));var logger=require('../../config/logger')(_0x0ae7('0x4'));var config=require(_0x0ae7('0x5'));var jayson=require(_0x0ae7('0x6'));var client=jayson[_0x0ae7('0x7')][_0x0ae7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f8037,_0x3c9d24,_0x504775){return new BPromise(function(_0x29305b,_0xf97f3b){return client[_0x0ae7('0x9')](_0x4f8037,_0x504775)[_0x0ae7('0xa')](function(_0x50bd65){logger[_0x0ae7('0xb')]('Trunk,\x20%s,\x20%s',_0x3c9d24,'request\x20sent');logger[_0x0ae7('0xc')](_0x0ae7('0xd'),_0x3c9d24,'request\x20sent',JSON[_0x0ae7('0xe')](_0x50bd65));if(_0x50bd65[_0x0ae7('0xf')]){if(_0x50bd65[_0x0ae7('0xf')]['code']===0x1f4){logger['error'](_0x0ae7('0x10'),_0x3c9d24,_0x50bd65['error'][_0x0ae7('0x11')]);return _0xf97f3b(_0x50bd65[_0x0ae7('0xf')][_0x0ae7('0x11')]);}logger[_0x0ae7('0xf')](_0x0ae7('0x10'),_0x3c9d24,_0x50bd65['error'][_0x0ae7('0x11')]);return _0x29305b(_0x50bd65[_0x0ae7('0xf')][_0x0ae7('0x11')]);}else{logger[_0x0ae7('0xb')]('Trunk,\x20%s,\x20%s',_0x3c9d24,_0x0ae7('0x12'));_0x29305b(_0x50bd65[_0x0ae7('0x13')]['message']);}})[_0x0ae7('0x14')](function(_0x35e403){logger[_0x0ae7('0xf')](_0x0ae7('0x10'),_0x3c9d24,_0x35e403);_0xf97f3b(_0x35e403);});});}exports[_0x0ae7('0x15')]=function(_0x8d8ca0){var _0x9e11ad=this;return new Promise(function(_0x3883ec,_0x4b222){return db[_0x0ae7('0x16')]['findAll']({'raw':_0x8d8ca0[_0x0ae7('0x17')]?_0x8d8ca0[_0x0ae7('0x17')][_0x0ae7('0x18')]===undefined?!![]:![]:!![],'where':_0x8d8ca0[_0x0ae7('0x17')]?_0x8d8ca0[_0x0ae7('0x17')][_0x0ae7('0x19')]||null:null,'attributes':_0x8d8ca0['options']?_0x8d8ca0['options'][_0x0ae7('0x1a')]||null:null,'limit':_0x8d8ca0[_0x0ae7('0x17')]?_0x8d8ca0['options'][_0x0ae7('0x1b')]||null:null,'include':_0x8d8ca0[_0x0ae7('0x17')]?_0x8d8ca0[_0x0ae7('0x17')][_0x0ae7('0x1c')]?_[_0x0ae7('0x1d')](_0x8d8ca0[_0x0ae7('0x17')][_0x0ae7('0x1c')],function(_0x47efbb){return{'model':db[_0x47efbb[_0x0ae7('0x1e')]],'as':_0x47efbb['as'],'attributes':_0x47efbb['attributes'],'include':_0x47efbb[_0x0ae7('0x1c')]?_[_0x0ae7('0x1d')](_0x47efbb['include'],function(_0x6d7557){return{'model':db[_0x6d7557[_0x0ae7('0x1e')]],'as':_0x6d7557['as'],'attributes':_0x6d7557[_0x0ae7('0x1a')],'include':_0x6d7557[_0x0ae7('0x1c')]?_[_0x0ae7('0x1d')](_0x6d7557[_0x0ae7('0x1c')],function(_0x22922b){return{'model':db[_0x22922b['model']],'as':_0x22922b['as'],'attributes':_0x22922b[_0x0ae7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0ae7('0xa')](function(_0x4baf95){logger[_0x0ae7('0xb')](_0x0ae7('0x15'),_0x8d8ca0);logger[_0x0ae7('0xc')](_0x0ae7('0x15'),_0x8d8ca0,JSON[_0x0ae7('0xe')](_0x4baf95));_0x3883ec(_0x4baf95);})['catch'](function(_0x3cb614){logger[_0x0ae7('0xf')](_0x0ae7('0x15'),_0x3cb614[_0x0ae7('0x11')],_0x8d8ca0);_0x4b222(_0x9e11ad['error'](0x1f4,_0x3cb614[_0x0ae7('0x11')]));});});};exports['ShowTrunk']=function(_0x40fd52){var _0x331295=this;return new Promise(function(_0x54212c,_0x1ee879){return db[_0x0ae7('0x16')]['find']({'raw':_0x40fd52[_0x0ae7('0x17')]?_0x40fd52[_0x0ae7('0x17')][_0x0ae7('0x18')]===undefined?!![]:![]:!![],'where':_0x40fd52['options']?_0x40fd52[_0x0ae7('0x17')][_0x0ae7('0x19')]||null:null,'attributes':_0x40fd52[_0x0ae7('0x17')]?_0x40fd52[_0x0ae7('0x17')][_0x0ae7('0x1a')]||null:null,'include':_0x40fd52[_0x0ae7('0x17')]?_0x40fd52[_0x0ae7('0x17')][_0x0ae7('0x1c')]?_[_0x0ae7('0x1d')](_0x40fd52[_0x0ae7('0x17')][_0x0ae7('0x1c')],function(_0x1592e6){return{'model':db[_0x1592e6[_0x0ae7('0x1e')]],'as':_0x1592e6['as'],'attributes':_0x1592e6['attributes'],'include':_0x1592e6[_0x0ae7('0x1c')]?_[_0x0ae7('0x1d')](_0x1592e6[_0x0ae7('0x1c')],function(_0x2d5588){return{'model':db[_0x2d5588[_0x0ae7('0x1e')]],'as':_0x2d5588['as'],'attributes':_0x2d5588[_0x0ae7('0x1a')],'include':_0x2d5588[_0x0ae7('0x1c')]?_[_0x0ae7('0x1d')](_0x2d5588[_0x0ae7('0x1c')],function(_0x452839){return{'model':db[_0x452839['model']],'as':_0x452839['as'],'attributes':_0x452839[_0x0ae7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0ae7('0xa')](function(_0x196508){logger['info']('ShowTrunk',_0x40fd52);logger[_0x0ae7('0xc')]('ShowTrunk',_0x40fd52,JSON[_0x0ae7('0xe')](_0x196508));_0x54212c(_0x196508);})[_0x0ae7('0x14')](function(_0x1050a1){logger[_0x0ae7('0xf')](_0x0ae7('0x1f'),_0x1050a1[_0x0ae7('0x11')],_0x40fd52);_0x1ee879(_0x331295[_0x0ae7('0xf')](0x1f4,_0x1050a1['message']));});});}; \ No newline at end of file +var _0x11c8=['include','map','model','debug','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit'];(function(_0x27b4d7,_0x1342aa){var _0x51b092=function(_0x4c10d7){while(--_0x4c10d7){_0x27b4d7['push'](_0x27b4d7['shift']());}};_0x51b092(++_0x1342aa);}(_0x11c8,0x1ce));var _0x811c=function(_0x4df6ba,_0x477c3e){_0x4df6ba=_0x4df6ba-0x0;var _0x472acf=_0x11c8[_0x4df6ba];return _0x472acf;};'use strict';var _=require(_0x811c('0x0'));var util=require(_0x811c('0x1'));var moment=require(_0x811c('0x2'));var BPromise=require(_0x811c('0x3'));var rs=require(_0x811c('0x4'));var fs=require('fs');var Redis=require(_0x811c('0x5'));var db=require(_0x811c('0x6'))['db'];var utils=require(_0x811c('0x7'));var logger=require(_0x811c('0x8'))(_0x811c('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x811c('0xa')][_0x811c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbc721a,_0x4ccfd3,_0x3a4a0d){return new BPromise(function(_0x5b18a9,_0x2c590d){return client[_0x811c('0xc')](_0xbc721a,_0x3a4a0d)[_0x811c('0xd')](function(_0x4ac153){logger['info'](_0x811c('0xe'),_0x4ccfd3,_0x811c('0xf'));logger['debug'](_0x811c('0x10'),_0x4ccfd3,'request\x20sent',JSON[_0x811c('0x11')](_0x4ac153));if(_0x4ac153[_0x811c('0x12')]){if(_0x4ac153[_0x811c('0x12')][_0x811c('0x13')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x4ccfd3,_0x4ac153['error']['message']);return _0x2c590d(_0x4ac153[_0x811c('0x12')][_0x811c('0x14')]);}logger[_0x811c('0x12')](_0x811c('0xe'),_0x4ccfd3,_0x4ac153['error']['message']);return _0x5b18a9(_0x4ac153[_0x811c('0x12')][_0x811c('0x14')]);}else{logger[_0x811c('0x15')](_0x811c('0xe'),_0x4ccfd3,_0x811c('0xf'));_0x5b18a9(_0x4ac153[_0x811c('0x16')]['message']);}})[_0x811c('0x17')](function(_0x867d54){logger[_0x811c('0x12')](_0x811c('0xe'),_0x4ccfd3,_0x867d54);_0x2c590d(_0x867d54);});});}exports[_0x811c('0x18')]=function(_0x41ae6b){var _0x43c552=this;return new Promise(function(_0x489b3b,_0x14ad49){return db[_0x811c('0x19')][_0x811c('0x1a')]({'raw':_0x41ae6b[_0x811c('0x1b')]?_0x41ae6b[_0x811c('0x1b')][_0x811c('0x1c')]===undefined?!![]:![]:!![],'where':_0x41ae6b[_0x811c('0x1b')]?_0x41ae6b[_0x811c('0x1b')][_0x811c('0x1d')]||null:null,'attributes':_0x41ae6b['options']?_0x41ae6b[_0x811c('0x1b')][_0x811c('0x1e')]||null:null,'limit':_0x41ae6b[_0x811c('0x1b')]?_0x41ae6b[_0x811c('0x1b')][_0x811c('0x1f')]||null:null,'include':_0x41ae6b['options']?_0x41ae6b['options'][_0x811c('0x20')]?_[_0x811c('0x21')](_0x41ae6b['options'][_0x811c('0x20')],function(_0x3b77bb){return{'model':db[_0x3b77bb[_0x811c('0x22')]],'as':_0x3b77bb['as'],'attributes':_0x3b77bb[_0x811c('0x1e')],'include':_0x3b77bb[_0x811c('0x20')]?_['map'](_0x3b77bb['include'],function(_0x55802d){return{'model':db[_0x55802d[_0x811c('0x22')]],'as':_0x55802d['as'],'attributes':_0x55802d['attributes'],'include':_0x55802d[_0x811c('0x20')]?_['map'](_0x55802d[_0x811c('0x20')],function(_0x342331){return{'model':db[_0x342331[_0x811c('0x22')]],'as':_0x342331['as'],'attributes':_0x342331[_0x811c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x811c('0xd')](function(_0x37fd9d){logger[_0x811c('0x15')](_0x811c('0x18'),_0x41ae6b);logger[_0x811c('0x23')](_0x811c('0x18'),_0x41ae6b,JSON[_0x811c('0x11')](_0x37fd9d));_0x489b3b(_0x37fd9d);})[_0x811c('0x17')](function(_0x284fe6){logger[_0x811c('0x12')]('GetTrunk',_0x284fe6[_0x811c('0x14')],_0x41ae6b);_0x14ad49(_0x43c552[_0x811c('0x12')](0x1f4,_0x284fe6[_0x811c('0x14')]));});});};exports['ShowTrunk']=function(_0x23e3e7){var _0x5266ed=this;return new Promise(function(_0x50a252,_0x3c6315){return db[_0x811c('0x19')][_0x811c('0x24')]({'raw':_0x23e3e7[_0x811c('0x1b')]?_0x23e3e7[_0x811c('0x1b')][_0x811c('0x1c')]===undefined?!![]:![]:!![],'where':_0x23e3e7[_0x811c('0x1b')]?_0x23e3e7[_0x811c('0x1b')][_0x811c('0x1d')]||null:null,'attributes':_0x23e3e7[_0x811c('0x1b')]?_0x23e3e7[_0x811c('0x1b')][_0x811c('0x1e')]||null:null,'include':_0x23e3e7[_0x811c('0x1b')]?_0x23e3e7[_0x811c('0x1b')]['include']?_[_0x811c('0x21')](_0x23e3e7[_0x811c('0x1b')][_0x811c('0x20')],function(_0x1fb705){return{'model':db[_0x1fb705['model']],'as':_0x1fb705['as'],'attributes':_0x1fb705[_0x811c('0x1e')],'include':_0x1fb705[_0x811c('0x20')]?_[_0x811c('0x21')](_0x1fb705[_0x811c('0x20')],function(_0xe6b117){return{'model':db[_0xe6b117[_0x811c('0x22')]],'as':_0xe6b117['as'],'attributes':_0xe6b117['attributes'],'include':_0xe6b117[_0x811c('0x20')]?_[_0x811c('0x21')](_0xe6b117[_0x811c('0x20')],function(_0x47c70d){return{'model':db[_0x47c70d[_0x811c('0x22')]],'as':_0x47c70d['as'],'attributes':_0x47c70d[_0x811c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17daf8){logger[_0x811c('0x15')]('ShowTrunk',_0x23e3e7);logger[_0x811c('0x23')](_0x811c('0x25'),_0x23e3e7,JSON[_0x811c('0x11')](_0x17daf8));_0x50a252(_0x17daf8);})['catch'](function(_0x441407){logger[_0x811c('0x12')](_0x811c('0x25'),_0x441407['message'],_0x23e3e7);_0x3c6315(_0x5266ed['error'](0x1f4,_0x441407[_0x811c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index c0e2f69..5528cc5 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 _0x0afd=['Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express'];(function(_0x35b99b,_0x2efd45){var _0xc34057=function(_0x59ffe9){while(--_0x59ffe9){_0x35b99b['push'](_0x35b99b['shift']());}};_0xc34057(++_0x2efd45);}(_0x0afd,0x8f));var _0xd0af=function(_0x31e4be,_0xa21c95){_0x31e4be=_0x31e4be-0x0;var _0x2135da=_0x0afd[_0x31e4be];return _0x2135da;};'use strict';var express=require(_0xd0af('0x0'));var router=express[_0xd0af('0x1')]();var auth=require(_0xd0af('0x2'));var controller=require(_0xd0af('0x3'));router[_0xd0af('0x4')](_0xd0af('0x5'),auth[_0xd0af('0x6')](),controller[_0xd0af('0x7')]);module[_0xd0af('0x8')]=router; \ No newline at end of file +var _0x6186=['/:id','isAuthenticated','update','exports','express','Router','../../components/auth/service','./user-setting.controller','put'];(function(_0x53420b,_0x5a0291){var _0x5ba29c=function(_0x5ab5c0){while(--_0x5ab5c0){_0x53420b['push'](_0x53420b['shift']());}};_0x5ba29c(++_0x5a0291);}(_0x6186,0x79));var _0x6618=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0x6186[_0x1ca93c];return _0x185169;};'use strict';var express=require(_0x6618('0x0'));var router=express[_0x6618('0x1')]();var auth=require(_0x6618('0x2'));var controller=require(_0x6618('0x3'));router[_0x6618('0x4')](_0x6618('0x5'),auth[_0x6618('0x6')](),controller[_0x6618('0x7')]);module[_0x6618('0x8')]=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 4d939b2..b53226e 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 _0xc8ea=['debug','TEXT','DATE','UserId','sequelize','error','info'];(function(_0x3e9cc3,_0x58c4bd){var _0x4b9827=function(_0x2081c0){while(--_0x2081c0){_0x3e9cc3['push'](_0x3e9cc3['shift']());}};_0x4b9827(++_0x58c4bd);}(_0xc8ea,0x66));var _0xac8e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xc8ea[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0xac8e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xac8e('0x1'),'warning',_0xac8e('0x2'),_0xac8e('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xac8e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xac8e('0x4')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xac8e('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xac8e('0x6')}}; \ No newline at end of file +var _0x874a=['exports','ENUM','BOOLEAN','TEXT','sequelize','error','warning'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x874a,0x12a));var _0xa874=function(_0x239aac,_0x455e2d){_0x239aac=_0x239aac-0x0;var _0x87f290=_0x874a[_0x239aac];return _0x87f290;};'use strict';var Sequelize=require(_0xa874('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xa874('0x1'),_0xa874('0x2'),'info','debug'];module[_0xa874('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xa874('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xa874('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xa874('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xa874('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ 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 40416d4..40f9c38 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 _0x1c4f=['../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','json','then','sendStatus','error','stack','name','status','send','update','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','../../config/environment'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x216353,_0x5ae832){_0x216353=_0x216353-0x0;var _0x7bbc94=_0x1c4f[_0x216353];return _0x7bbc94;};'use strict';var _=require(_0xf1c4('0x0'));var Redis=require(_0xf1c4('0x1'));var logger=require(_0xf1c4('0x2'))('api');var config=require(_0xf1c4('0x3'));var db=require(_0xf1c4('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xf1c4('0x5')]));require(_0xf1c4('0x6'))[_0xf1c4('0x7')](socket);config['redis']=_[_0xf1c4('0x8')](config[_0xf1c4('0x5')],{'host':_0xf1c4('0x9'),'port':0x18eb});function respondWithResult(_0x79689d,_0x3dadae){_0x3dadae=_0x3dadae||0xc8;return function(_0x2b45c2){if(_0x2b45c2){return _0x79689d['status'](_0x3dadae)[_0xf1c4('0xa')](_0x2b45c2);}};}function saveUpdates(_0x1d152c){return function(_0x45d9d5){if(_0x45d9d5){return _0x45d9d5['update'](_0x1d152c)[_0xf1c4('0xb')](function(_0x358730){return _0x358730;});}return null;};}function handleEntityNotFound(_0x1f7c5b){return function(_0x1b96ee){if(!_0x1b96ee){_0x1f7c5b[_0xf1c4('0xc')](0x194);}return _0x1b96ee;};}function handleError(_0x8ecb28,_0x5e1093){_0x5e1093=_0x5e1093||0x1f4;return function(_0x517b0e){logger[_0xf1c4('0xd')](_0x517b0e[_0xf1c4('0xe')]);if(_0x517b0e[_0xf1c4('0xf')]){delete _0x517b0e[_0xf1c4('0xf')];}_0x8ecb28[_0xf1c4('0x10')](_0x5e1093)[_0xf1c4('0x11')](_0x517b0e);};}exports[_0xf1c4('0x12')]=function(_0x55732e,_0x82837a){if(_0x55732e['user'][_0xf1c4('0x13')]!==_0xf1c4('0x14'))throw new Error(_0xf1c4('0x15'));if(isNaN(Number(_0x55732e[_0xf1c4('0x16')]['id'])))throw new Error(_0xf1c4('0x17'));return db[_0xf1c4('0x18')][_0xf1c4('0x19')]({'where':{'id':_0x55732e[_0xf1c4('0x16')]['id']}})[_0xf1c4('0xb')](handleEntityNotFound(_0x82837a,null))[_0xf1c4('0xb')](saveUpdates(_0x55732e[_0xf1c4('0x1a')],null))['then'](respondWithResult(_0x82837a,null))[_0xf1c4('0x1b')](handleError(_0x82837a,null));}; \ No newline at end of file +var _0x2121=['UserSetting','find','body','catch','lodash','ioredis','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','localhost','status','update','then','error','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id'];(function(_0x4fe447,_0x39d7c0){var _0x14de7c=function(_0x40b0bd){while(--_0x40b0bd){_0x4fe447['push'](_0x4fe447['shift']());}};_0x14de7c(++_0x39d7c0);}(_0x2121,0x1b4));var _0x1212=function(_0x35b839,_0xe0b570){_0x35b839=_0x35b839-0x0;var _0x6c0418=_0x2121[_0x35b839];return _0x6c0418;};'use strict';var _=require(_0x1212('0x0'));var Redis=require(_0x1212('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x1212('0x2'));var db=require(_0x1212('0x3'))['db'];var socket=require(_0x1212('0x4'))(new Redis(config[_0x1212('0x5')]));require(_0x1212('0x6'))['register'](socket);config[_0x1212('0x5')]=_['defaults'](config[_0x1212('0x5')],{'host':_0x1212('0x7'),'port':0x18eb});function respondWithResult(_0x20fadc,_0x1b1ef5){_0x1b1ef5=_0x1b1ef5||0xc8;return function(_0x233a53){if(_0x233a53){return _0x20fadc[_0x1212('0x8')](_0x1b1ef5)['json'](_0x233a53);}};}function saveUpdates(_0x1df3e1){return function(_0x29b23f){if(_0x29b23f){return _0x29b23f[_0x1212('0x9')](_0x1df3e1)[_0x1212('0xa')](function(_0x15011d){return _0x15011d;});}return null;};}function handleEntityNotFound(_0x254eb9){return function(_0x5498b0){if(!_0x5498b0){_0x254eb9['sendStatus'](0x194);}return _0x5498b0;};}function handleError(_0x5cd5d6,_0x2109ee){_0x2109ee=_0x2109ee||0x1f4;return function(_0x17fb6f){logger[_0x1212('0xb')](_0x17fb6f['stack']);if(_0x17fb6f[_0x1212('0xc')]){delete _0x17fb6f[_0x1212('0xc')];}_0x5cd5d6[_0x1212('0x8')](_0x2109ee)[_0x1212('0xd')](_0x17fb6f);};}exports[_0x1212('0x9')]=function(_0x2e50d2,_0x29caa6){if(_0x2e50d2[_0x1212('0xe')][_0x1212('0xf')]!==_0x1212('0x10'))throw new Error(_0x1212('0x11'));if(isNaN(Number(_0x2e50d2[_0x1212('0x12')]['id'])))throw new Error(_0x1212('0x13'));return db[_0x1212('0x14')][_0x1212('0x15')]({'where':{'id':_0x2e50d2['params']['id']}})['then'](handleEntityNotFound(_0x29caa6,null))['then'](saveUpdates(_0x2e50d2[_0x1212('0x16')],null))[_0x1212('0xa')](respondWithResult(_0x29caa6,null))[_0x1212('0x17')](handleError(_0x29caa6,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 e93511a..fb0d38f 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 _0x1490=['../../mysqldb','UserSetting','setMaxListeners','save','emit','hook','exports','events'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x1490,0x16f));var _0x0149=function(_0x33c9ee,_0x4d2b7f){_0x33c9ee=_0x33c9ee-0x0;var _0x10df41=_0x1490[_0x33c9ee];return _0x10df41;};'use strict';var EventEmitter=require(_0x0149('0x0'));var UserSetting=require(_0x0149('0x1'))['db'][_0x0149('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x0149('0x3')](0x0);var events={'afterCreate':_0x0149('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3029cb){return function(_0x31e60f,_0x432429,_0x420dcd){UserSettingEvents[_0x0149('0x5')](_0x3029cb+':'+_0x31e60f['id'],_0x31e60f);UserSettingEvents[_0x0149('0x5')](_0x3029cb,_0x31e60f);_0x420dcd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x0149('0x6')](e,emitEvent(event));}}module[_0x0149('0x7')]=UserSettingEvents; \ No newline at end of file +var _0x6fcd=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','save'];(function(_0x2eb240,_0x4073c8){var _0x3fc8fc=function(_0x1f2e85){while(--_0x1f2e85){_0x2eb240['push'](_0x2eb240['shift']());}};_0x3fc8fc(++_0x4073c8);}(_0x6fcd,0xac));var _0xd6fc=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x6fcd[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0xd6fc('0x0'));var UserSetting=require(_0xd6fc('0x1'))['db'][_0xd6fc('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd6fc('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f739a){return function(_0x3b5ee5,_0x292bb6,_0x5d7d7a){UserSettingEvents[_0xd6fc('0x4')](_0x1f739a+':'+_0x3b5ee5['id'],_0x3b5ee5);UserSettingEvents[_0xd6fc('0x4')](_0x1f739a,_0x3b5ee5);_0x5d7d7a(null);};}for(var e in events){if(events[_0xd6fc('0x5')](e)){var event=events[e];UserSetting[_0xd6fc('0x6')](e,emitEvent(event));}}module[_0xd6fc('0x7')]=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 c017d4f..a2e392f 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 _0xbaf0=['UserSetting','user_settings','clientSideLoggingEnabledSince','exports','define'];(function(_0x54efa8,_0x3bedbe){var _0x5eafc1=function(_0x5b0c7e){while(--_0x5b0c7e){_0x54efa8['push'](_0x54efa8['shift']());}};_0x5eafc1(++_0x3bedbe);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var attributes=require('./user-setting.attributes');module[_0x0baf('0x0')]=function(_0x2a3620){return _0x2a3620[_0x0baf('0x1')](_0x0baf('0x2'),attributes,{'tableName':_0x0baf('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d2e72){if(!_0x4d2e72['clientSideLoggingEnabled'])_0x4d2e72[_0x0baf('0x4')]=null;else if(_0x4d2e72[_0x0baf('0x4')]===null)_0x4d2e72[_0x0baf('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x0972=['exports','define','user_settings','clientSideLoggingEnabledSince'];(function(_0x3b42c2,_0x6308fc){var _0x36c2fc=function(_0x405305){while(--_0x405305){_0x3b42c2['push'](_0x3b42c2['shift']());}};_0x36c2fc(++_0x6308fc);}(_0x0972,0x64));var _0x2097=function(_0x3df56c,_0x141573){_0x3df56c=_0x3df56c-0x0;var _0x34837d=_0x0972[_0x3df56c];return _0x34837d;};'use strict';var attributes=require('./user-setting.attributes');module[_0x2097('0x0')]=function(_0x517422){return _0x517422[_0x2097('0x1')]('UserSetting',attributes,{'tableName':_0x2097('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12f523){if(!_0x12f523['clientSideLoggingEnabled'])_0x12f523[_0x2097('0x3')]=null;else if(_0x12f523[_0x2097('0x3')]===null)_0x12f523[_0x2097('0x3')]=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 0c30e3b..8cb978b 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 _0x3095=['UserId','length','user-setting:','remove','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x3095,0x1eb));var _0x5309=function(_0xbd7498,_0x417297){_0xbd7498=_0xbd7498-0x0;var _0x22920a=_0x3095[_0xbd7498];return _0x22920a;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0x5309('0x0'),_0x5309('0x1')];function createListener(_0x5d61ca,_0x399f8c){return function(_0x2f8e72){_0x399f8c[_0x5309('0x2')](_0x5d61ca,_0x2f8e72);if(_0x5d61ca===_0x5309('0x3')){_0x399f8c['emit'](_0x5309('0x4')+_0x2f8e72[_0x5309('0x5')],_0x2f8e72);}};}exports['register']=function(_0x83e3b5){for(var _0x5d343d=0x0,_0x3d51fd=events[_0x5309('0x6')];_0x5d343d<_0x3d51fd;_0x5d343d++){var _0x1890b4=events[_0x5d343d];var _0x3a154a=createListener(_0x5309('0x7')+_0x1890b4,_0x83e3b5);UserSettingEvents['on'](_0x1890b4,_0x3a154a);}}; \ No newline at end of file +var _0xba9b=['save','remove','update','user-setting:update','emit','user-setting:update:user-','register','./user-setting.events'];(function(_0x3f2203,_0x1f5d62){var _0xb48e7f=function(_0x1a04ab){while(--_0x1a04ab){_0x3f2203['push'](_0x3f2203['shift']());}};_0xb48e7f(++_0x1f5d62);}(_0xba9b,0x17f));var _0xbba9=function(_0x1851bd,_0x57548a){_0x1851bd=_0x1851bd-0x0;var _0x473bdd=_0xba9b[_0x1851bd];return _0x473bdd;};'use strict';var UserSettingEvents=require(_0xbba9('0x0'));var events=[_0xbba9('0x1'),_0xbba9('0x2'),_0xbba9('0x3')];function createListener(_0x2b7874,_0x4f0ec8){return function(_0x3ed3e5){_0x4f0ec8['emit'](_0x2b7874,_0x3ed3e5);if(_0x2b7874===_0xbba9('0x4')){_0x4f0ec8[_0xbba9('0x5')](_0xbba9('0x6')+_0x3ed3e5['UserId'],_0x3ed3e5);}};}exports[_0xbba9('0x7')]=function(_0x299863){for(var _0x51e3bc=0x0,_0xe14ed5=events['length'];_0x51e3bc<_0xe14ed5;_0x51e3bc++){var _0x15a05f=events[_0x51e3bc];var _0x58bcf3=createListener('user-setting:'+_0x15a05f,_0x299863);UserSettingEvents['on'](_0x15a05f,_0x58bcf3);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 2b216ef..e62e9ee 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 _0x52e4=['../../config/environment','./user.controller','get','index','/describe','describe','/whoami','whoami','/presence','isAuthenticated','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','diskStorage','root','server/files/images/','format','%s-%s','originalname','single','addAvatar','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','put','update','/:id/password','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','path','connect-timeout','express','Router'];(function(_0x5097b8,_0x30fcad){var _0xb41a1b=function(_0xcec7ab){while(--_0xcec7ab){_0x5097b8['push'](_0x5097b8['shift']());}};_0xb41a1b(++_0x30fcad);}(_0x52e4,0x146));var _0x452e=function(_0x55a6db,_0x474745){_0x55a6db=_0x55a6db-0x0;var _0x2e50dc=_0x52e4[_0x55a6db];return _0x2e50dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x452e('0x0'));var timeout=require(_0x452e('0x1'));var express=require(_0x452e('0x2'));var router=express[_0x452e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x452e('0x4'));var controller=require(_0x452e('0x5'));router[_0x452e('0x6')]('/',auth['isAuthenticated'](),controller[_0x452e('0x7')]);router['get'](_0x452e('0x8'),auth['isAuthenticated'](),controller[_0x452e('0x9')]);router['get'](_0x452e('0xa'),auth['isAuthenticated'](),controller[_0x452e('0xb')]);router[_0x452e('0x6')](_0x452e('0xc'),auth[_0x452e('0xd')](),controller['getPresence']);router['get'](_0x452e('0xe'),auth['isAuthenticated'](),controller[_0x452e('0xf')]);router['get'](_0x452e('0x10'),controller[_0x452e('0x11')]);router[_0x452e('0x6')]('/:id/open_tabs',auth[_0x452e('0xd')](),controller[_0x452e('0x12')]);router[_0x452e('0x6')](_0x452e('0x13'),auth['isAuthenticated'](),controller['getContacts']);router['get']('/:id/queues',auth[_0x452e('0xd')](),controller[_0x452e('0x14')]);router[_0x452e('0x6')](_0x452e('0x15'),auth[_0x452e('0xd')](),controller[_0x452e('0x16')]);router[_0x452e('0x6')](_0x452e('0x17'),auth['isAuthenticated'](),controller['getGroups']);router[_0x452e('0x6')]('/:id/recordings',auth[_0x452e('0xd')](),controller['getRecordings']);router[_0x452e('0x6')](_0x452e('0x18'),auth[_0x452e('0xd')](),controller[_0x452e('0x19')]);router[_0x452e('0x6')](_0x452e('0x1a'),auth[_0x452e('0xd')](),controller['getChatInteractions']);router[_0x452e('0x6')]('/:id/openchannel/interactions',auth[_0x452e('0xd')](),controller[_0x452e('0x1b')]);router[_0x452e('0x6')]('/:id/mail/interactions',auth[_0x452e('0xd')](),controller[_0x452e('0x1c')]);router[_0x452e('0x6')](_0x452e('0x1d'),auth[_0x452e('0xd')](),controller['getSmsInteractions']);router[_0x452e('0x6')](_0x452e('0x1e'),auth[_0x452e('0xd')](),controller[_0x452e('0x1f')]);router[_0x452e('0x6')](_0x452e('0x20'),auth['isAuthenticated'](),controller[_0x452e('0x21')]);router['get'](_0x452e('0x22'),auth[_0x452e('0xd')](),controller[_0x452e('0x23')]);router['get'](_0x452e('0x24'),auth[_0x452e('0xd')](),controller[_0x452e('0x25')]);router[_0x452e('0x6')]('/:id/agents',auth[_0x452e('0xd')](),controller[_0x452e('0x26')]);router[_0x452e('0x6')](_0x452e('0x27'),auth[_0x452e('0xd')](),controller['getVoicePrefixes']);router[_0x452e('0x6')]('/:id/fax_accounts',auth[_0x452e('0xd')](),controller[_0x452e('0x28')]);router['get'](_0x452e('0x29'),auth[_0x452e('0xd')](),controller[_0x452e('0x2a')]);router['get'](_0x452e('0x2b'),auth[_0x452e('0xd')](),controller[_0x452e('0x2c')]);router[_0x452e('0x6')](_0x452e('0x2d'),auth[_0x452e('0xd')](),controller['getSmsAccounts']);router[_0x452e('0x6')]('/:id/chat_websites',auth[_0x452e('0xd')](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x452e('0x2e')]);router[_0x452e('0x6')](_0x452e('0x2f'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x452e('0x6')](_0x452e('0x30'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x452e('0x6')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x452e('0x31')]);router[_0x452e('0x32')](_0x452e('0x13'),auth[_0x452e('0xd')](),controller[_0x452e('0x33')]);router[_0x452e('0x32')]('/',auth[_0x452e('0xd')](),controller[_0x452e('0x34')]);router[_0x452e('0x32')](_0x452e('0x35'),auth[_0x452e('0xd')](),controller[_0x452e('0x36')]);router[_0x452e('0x32')](_0x452e('0x37'),auth[_0x452e('0xd')](),controller['addQueues']);var upload=multer({'storage':multer[_0x452e('0x38')]({'destination':function(_0x350fa1,_0x734e84,_0x4e72ed){_0x4e72ed(null,path['join'](config[_0x452e('0x39')],_0x452e('0x3a')));},'filename':function(_0x47f19f,_0x234383,_0x5e3299){_0x5e3299(null,util[_0x452e('0x3b')](_0x452e('0x3c'),Date['now'](),_0x234383[_0x452e('0x3d')]));}})});router['post']('/:id/avatar',upload[_0x452e('0x3e')]('file'),controller[_0x452e('0x3f')]);router[_0x452e('0x32')]('/:id/login',auth[_0x452e('0xd')](),controller['login']);router[_0x452e('0x32')](_0x452e('0x40'),auth['isAuthenticated'](),controller['logout']);router[_0x452e('0x32')](_0x452e('0x41'),auth[_0x452e('0xd')](),controller[_0x452e('0x42')]);router['post'](_0x452e('0x43'),auth[_0x452e('0xd')](),controller[_0x452e('0x44')]);router['post']('/:id/teams',auth[_0x452e('0xd')](),controller[_0x452e('0x45')]);router[_0x452e('0x32')]('/:id/chat_interactions',auth[_0x452e('0xd')](),controller[_0x452e('0x46')]);router[_0x452e('0x32')](_0x452e('0x47'),auth[_0x452e('0xd')](),controller[_0x452e('0x48')]);router[_0x452e('0x32')](_0x452e('0x49'),auth[_0x452e('0xd')](),controller[_0x452e('0x4a')]);router['post'](_0x452e('0x4b'),auth[_0x452e('0xd')](),controller[_0x452e('0x4c')]);router[_0x452e('0x32')]('/:id/openchannel_interactions',auth[_0x452e('0xd')](),controller[_0x452e('0x4d')]);router['post']('/:id/whatsapp_interactions',auth[_0x452e('0xd')](),controller['addWhatsappInteractions']);router[_0x452e('0x32')](_0x452e('0x4e'),auth['isAuthenticated'](),controller[_0x452e('0x4f')]);router[_0x452e('0x32')](_0x452e('0x29'),auth[_0x452e('0xd')](),controller[_0x452e('0x50')]);router[_0x452e('0x32')]('/:id/openchannel_accounts',auth[_0x452e('0xd')](),controller[_0x452e('0x51')]);router[_0x452e('0x32')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x452e('0x52')]);router[_0x452e('0x32')](_0x452e('0x53'),auth[_0x452e('0xd')](),controller['addChatWebsites']);router[_0x452e('0x32')](_0x452e('0x54'),auth[_0x452e('0xd')](),controller[_0x452e('0x55')]);router[_0x452e('0x32')](_0x452e('0x2f'),auth[_0x452e('0xd')](),controller[_0x452e('0x56')]);router['post'](_0x452e('0x57'),auth[_0x452e('0xd')](),controller['createApiKey']);router[_0x452e('0x58')](_0x452e('0xe'),auth[_0x452e('0xd')](),controller[_0x452e('0x59')]);router[_0x452e('0x58')](_0x452e('0x5a'),auth[_0x452e('0xd')](),controller[_0x452e('0x5b')]);router[_0x452e('0x5c')](_0x452e('0x37'),auth[_0x452e('0xd')](),controller['removeQueues']);router[_0x452e('0x5c')](_0x452e('0x22'),auth[_0x452e('0xd')](),controller[_0x452e('0x5d')]);router[_0x452e('0x5c')](_0x452e('0xe'),auth[_0x452e('0xd')](),controller[_0x452e('0x5e')]);router['delete'](_0x452e('0x5f'),auth[_0x452e('0xd')](),controller[_0x452e('0x60')]);router[_0x452e('0x5c')](_0x452e('0x47'),auth['isAuthenticated'](),controller[_0x452e('0x61')]);router[_0x452e('0x5c')](_0x452e('0x49'),auth[_0x452e('0xd')](),controller[_0x452e('0x62')]);router[_0x452e('0x5c')]('/:id/sms_interactions',auth[_0x452e('0xd')](),controller[_0x452e('0x63')]);router[_0x452e('0x5c')](_0x452e('0x64'),auth[_0x452e('0xd')](),controller[_0x452e('0x65')]);router[_0x452e('0x5c')](_0x452e('0x66'),auth[_0x452e('0xd')](),controller['removeWhatsappInteractions']);router['delete']('/:id/fax_accounts',auth[_0x452e('0xd')](),controller[_0x452e('0x67')]);router[_0x452e('0x5c')](_0x452e('0x29'),auth['isAuthenticated'](),controller[_0x452e('0x68')]);router[_0x452e('0x5c')](_0x452e('0x2b'),auth[_0x452e('0xd')](),controller[_0x452e('0x69')]);router[_0x452e('0x5c')](_0x452e('0x2d'),auth['isAuthenticated'](),controller[_0x452e('0x6a')]);router['delete']('/:id/chat_websites',auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x452e('0x5c')](_0x452e('0x54'),auth[_0x452e('0xd')](),controller[_0x452e('0x6b')]);router[_0x452e('0x5c')]('/:id/square_projects',auth[_0x452e('0xd')](),controller[_0x452e('0x6c')]);router['delete'](_0x452e('0x57'),auth[_0x452e('0xd')](),controller[_0x452e('0x6d')]);module['exports']=router; \ No newline at end of file +var _0xb2e4=['getSquareProjects','/:id/scheduled_calls','post','addContacts','create','bulkCreate','/:id/queues','addQueues','diskStorage','server/files/images/','%s-%s','single','file','addAvatar','/:id/login','login','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','addSquareProjects','/:id/api_key','createApiKey','update','put','/:id/password','changePassword','removeQueues','removeTeams','delete','/:id','destroy','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getChatWebsites','getWhatsappAccounts','/:id/square_projects'];(function(_0x8a5168,_0xa3efab){var _0x51a6db=function(_0x472d21){while(--_0x472d21){_0x8a5168['push'](_0x8a5168['shift']());}};_0x51a6db(++_0xa3efab);}(_0xb2e4,0xb0));var _0x4b2e=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xb2e4[_0xf2f332];return _0x56cce3;};'use strict';var multer=require(_0x4b2e('0x0'));var util=require(_0x4b2e('0x1'));var path=require('path');var timeout=require(_0x4b2e('0x2'));var express=require('express');var router=express[_0x4b2e('0x3')]();var fs_extra=require(_0x4b2e('0x4'));var auth=require(_0x4b2e('0x5'));var interaction=require(_0x4b2e('0x6'));var config=require(_0x4b2e('0x7'));var controller=require(_0x4b2e('0x8'));router[_0x4b2e('0x9')]('/',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0xb')]);router[_0x4b2e('0x9')](_0x4b2e('0xc'),auth[_0x4b2e('0xa')](),controller['describe']);router['get']('/whoami',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0xd')]);router[_0x4b2e('0x9')](_0x4b2e('0xe'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0xf')]);router['get']('/:id',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x10')]);router[_0x4b2e('0x9')](_0x4b2e('0x11'),controller[_0x4b2e('0x12')]);router[_0x4b2e('0x9')]('/:id/open_tabs',auth[_0x4b2e('0xa')](),controller['getOpenTabs']);router[_0x4b2e('0x9')](_0x4b2e('0x13'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x14')]);router[_0x4b2e('0x9')]('/:id/queues',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x15')]);router['get']('/:id/queues_rt',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x16')]);router[_0x4b2e('0x9')](_0x4b2e('0x17'),auth['isAuthenticated'](),controller[_0x4b2e('0x18')]);router[_0x4b2e('0x9')](_0x4b2e('0x19'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x1a')]);router[_0x4b2e('0x9')]('/:id/screen_recordings',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x1b')]);router['get'](_0x4b2e('0x1c'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x1d')]);router['get'](_0x4b2e('0x1e'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x1f')]);router[_0x4b2e('0x9')](_0x4b2e('0x20'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x21')]);router['get'](_0x4b2e('0x22'),auth['isAuthenticated'](),controller[_0x4b2e('0x23')]);router['get'](_0x4b2e('0x24'),auth['isAuthenticated'](),controller[_0x4b2e('0x25')]);router[_0x4b2e('0x9')](_0x4b2e('0x26'),auth[_0x4b2e('0xa')](),controller['getWhatsappInteractions']);router[_0x4b2e('0x9')](_0x4b2e('0x27'),auth[_0x4b2e('0xa')](),controller['getTeams']);router[_0x4b2e('0x9')](_0x4b2e('0x28'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x29')]);router['get'](_0x4b2e('0x2a'),auth[_0x4b2e('0xa')](),controller['getAgents']);router[_0x4b2e('0x9')](_0x4b2e('0x2b'),auth[_0x4b2e('0xa')](),controller['getVoicePrefixes']);router[_0x4b2e('0x9')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x4b2e('0x2c')]);router[_0x4b2e('0x9')](_0x4b2e('0x2d'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x2e')]);router[_0x4b2e('0x9')](_0x4b2e('0x2f'),auth[_0x4b2e('0xa')](),controller['getOpenchannelAccounts']);router[_0x4b2e('0x9')](_0x4b2e('0x30'),auth['isAuthenticated'](),controller['getSmsAccounts']);router['get']('/:id/chat_websites',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x31')]);router[_0x4b2e('0x9')]('/:id/whatsapp_accounts',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x32')]);router['get'](_0x4b2e('0x33'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x34')]);router[_0x4b2e('0x9')](_0x4b2e('0x35'),auth[_0x4b2e('0xa')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0x4b2e('0xa')](),controller['getApiKey']);router[_0x4b2e('0x36')](_0x4b2e('0x13'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x37')]);router['post']('/',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x38')]);router['post']('/create_many',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x39')]);router[_0x4b2e('0x36')](_0x4b2e('0x3a'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x3b')]);var upload=multer({'storage':multer[_0x4b2e('0x3c')]({'destination':function(_0x17fb61,_0x51d99a,_0x205114){_0x205114(null,path['join'](config['root'],_0x4b2e('0x3d')));},'filename':function(_0x4d0593,_0x12ac67,_0x11186d){_0x11186d(null,util['format'](_0x4b2e('0x3e'),Date['now'](),_0x12ac67['originalname']));}})});router[_0x4b2e('0x36')](_0x4b2e('0x11'),upload[_0x4b2e('0x3f')](_0x4b2e('0x40')),controller[_0x4b2e('0x41')]);router[_0x4b2e('0x36')](_0x4b2e('0x42'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x43')]);router[_0x4b2e('0x36')]('/:id/logout',auth['isAuthenticated'](),controller['logout']);router['post'](_0x4b2e('0x44'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x45')]);router[_0x4b2e('0x36')](_0x4b2e('0x46'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x47')]);router[_0x4b2e('0x36')]('/:id/teams',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x48')]);router['post'](_0x4b2e('0x49'),auth['isAuthenticated'](),controller[_0x4b2e('0x4a')]);router[_0x4b2e('0x36')](_0x4b2e('0x4b'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x4c')]);router['post'](_0x4b2e('0x4d'),auth[_0x4b2e('0xa')](),controller['addFaxInteractions']);router[_0x4b2e('0x36')](_0x4b2e('0x4e'),auth['isAuthenticated'](),controller[_0x4b2e('0x4f')]);router['post'](_0x4b2e('0x50'),auth['isAuthenticated'](),controller[_0x4b2e('0x51')]);router[_0x4b2e('0x36')](_0x4b2e('0x52'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x53')]);router[_0x4b2e('0x36')](_0x4b2e('0x54'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x55')]);router[_0x4b2e('0x36')](_0x4b2e('0x2d'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x56')]);router['post'](_0x4b2e('0x2f'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x57')]);router[_0x4b2e('0x36')](_0x4b2e('0x30'),auth['isAuthenticated'](),controller[_0x4b2e('0x58')]);router[_0x4b2e('0x36')](_0x4b2e('0x59'),auth[_0x4b2e('0xa')](),controller['addChatWebsites']);router[_0x4b2e('0x36')](_0x4b2e('0x5a'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router['post'](_0x4b2e('0x33'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x5b')]);router[_0x4b2e('0x36')](_0x4b2e('0x5c'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x5d')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4b2e('0x5e')]);router[_0x4b2e('0x5f')](_0x4b2e('0x60'),auth['isAuthenticated'](),controller[_0x4b2e('0x61')]);router['delete'](_0x4b2e('0x3a'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x62')]);router['delete'](_0x4b2e('0x27'),auth['isAuthenticated'](),controller[_0x4b2e('0x63')]);router[_0x4b2e('0x64')](_0x4b2e('0x65'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x66')]);router[_0x4b2e('0x64')]('/:id/chat_interactions',auth[_0x4b2e('0xa')](),controller['removeChatInteractions']);router['delete'](_0x4b2e('0x4b'),auth[_0x4b2e('0xa')](),controller['removeMailInteractions']);router[_0x4b2e('0x64')](_0x4b2e('0x4d'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x67')]);router['delete']('/:id/sms_interactions',auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x68')]);router['delete'](_0x4b2e('0x50'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x69')]);router[_0x4b2e('0x64')](_0x4b2e('0x52'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x6a')]);router[_0x4b2e('0x64')](_0x4b2e('0x54'),auth['isAuthenticated'](),controller[_0x4b2e('0x6b')]);router['delete'](_0x4b2e('0x2d'),auth[_0x4b2e('0xa')](),controller['removeMailAccounts']);router[_0x4b2e('0x64')](_0x4b2e('0x2f'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x6c')]);router[_0x4b2e('0x64')](_0x4b2e('0x30'),auth[_0x4b2e('0xa')](),controller['removeSmsAccounts']);router[_0x4b2e('0x64')](_0x4b2e('0x59'),auth['isAuthenticated'](),controller[_0x4b2e('0x6d')]);router['delete'](_0x4b2e('0x5a'),auth[_0x4b2e('0xa')](),controller[_0x4b2e('0x6e')]);router[_0x4b2e('0x64')](_0x4b2e('0x33'),auth['isAuthenticated'](),controller[_0x4b2e('0x6f')]);router[_0x4b2e('0x64')](_0x4b2e('0x5c'),auth['isAuthenticated'](),controller[_0x4b2e('0x70')]);module[_0x4b2e('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index fb0e14d..4e2d545 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 _0x9350=['refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsprivatekey','rtcp_mux','dtlssetup','dtlscertfile','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','agent','telephone','local','INTEGER','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept'];(function(_0x56fad0,_0x4b44c5){var _0x55d1fd=function(_0x17857d){while(--_0x17857d){_0x56fad0['push'](_0x56fad0['shift']());}};_0x55d1fd(++_0x4b44c5);}(_0x9350,0xdf));var _0x0935=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x9350[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0x0935('0x0'));var moment=require(_0x0935('0x1'));var util=require(_0x0935('0x2'));var _=require('lodash');module[_0x0935('0x3')]={'name':{'type':Sequelize[_0x0935('0x4')],'allowNull':![],'unique':_0x0935('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x16ebc2){this[_0x0935('0x6')](_0x0935('0x5'),_0x16ebc2);this[_0x0935('0x6')](_0x0935('0x7'),_0x16ebc2);},'comment':_0x0935('0x8')},'fullname':{'type':Sequelize[_0x0935('0x4')],'allowNull':![],'set':function(_0x1e525b){this[_0x0935('0x6')](_0x0935('0x9'),_0x1e525b);this[_0x0935('0x6')](_0x0935('0xa'),util[_0x0935('0xb')](_0x0935('0xc'),_0x1e525b,this[_0x0935('0xd')]('internal')));}},'alias':{'type':Sequelize[_0x0935('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x37e9ad){if(_0x37e9ad){this[_0x0935('0x6')](_0x0935('0xe'),_0x37e9ad['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0935('0xf'),_0x0935('0x10'),_0x0935('0x11'),_0x0935('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x0935('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0935('0x4')],'defaultValue':_0x0935('0x13')},'internal':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':![],'unique':_0x0935('0x15'),'set':function(_0x85aaf2){this['setDataValue']('internal',_0x85aaf2);this[_0x0935('0x6')](_0x0935('0x16'),_0x85aaf2);this[_0x0935('0x6')]('callerid',util[_0x0935('0xb')]('\x22%s\x22\x20<%s>',this[_0x0935('0xd')](_0x0935('0x9')),_0x85aaf2));}},'salt':{'type':Sequelize[_0x0935('0x4')]},'phone':{'type':Sequelize[_0x0935('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x0935('0x4')]},'city':{'type':Sequelize[_0x0935('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0935('0x18')]},'voicePause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0935('0x4')],'defaultValue':_0x0935('0x19')},'lastPauseAt':{'type':Sequelize[_0x0935('0x18')]},'chatCapacity':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0935('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0935('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0935('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![],'defaultValue':_0x0935('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0935('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x1c'),'user',_0x0935('0x1d')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![],'defaultValue':_0x0935('0x1e')},'callingpres':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x1f'),_0x0935('0x20'),_0x0935('0x21'),_0x0935('0x22'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x0935('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![],'defaultValue':_0x0935('0x24'),'set':function(_0x4f7543){this[_0x0935('0x6')](_0x0935('0x25'),_0x4f7543?_0x4f7543[_0x0935('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x0935('0x25'))?this[_0x0935('0xd')](_0x0935('0x25'))['split'](','):null;},'comment':_0x0935('0x27')},'dtmfmode':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x28'),_0x0935('0x29'),_0x0935('0x2a'),_0x0935('0x2b'),_0x0935('0x2c')),'allowNull':!![],'defaultValue':_0x0935('0x28')},'directmedia':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no',_0x0935('0x2e'),_0x0935('0x2f'),_0x0935('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![],'defaultValue':_0x0935('0x31'),'set':function(_0x3991fb){this[_0x0935('0x6')](_0x0935('0x32'),_0x3991fb?_0x3991fb[_0x0935('0x26')](','):null);},'get':function(){return this[_0x0935('0xd')](_0x0935('0x32'))?this['getDataValue'](_0x0935('0x32'))[_0x0935('0x33')](','):null;},'comment':_0x0935('0x34')},'callgroup':{'type':Sequelize[_0x0935('0x4')]},'namedcallgroup':{'type':Sequelize[_0x0935('0x4')]},'pickupgroup':{'type':Sequelize[_0x0935('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0935('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0935('0x35'),'set':function(_0x5a534f){this[_0x0935('0x6')]('allow',_0x5a534f?_0x5a534f['join'](';'):_0x0935('0x35'));},'get':function(){return this['getDataValue'](_0x0935('0x36'))?this[_0x0935('0xd')](_0x0935('0x36'))[_0x0935('0x33')](';'):null;},'comment':_0x0935('0x37')},'autoframing':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![],'set':function(_0x115fae){this[_0x0935('0x6')](_0x0935('0x38'),_0x115fae?_0x115fae['join'](','):null);},'get':function(){return this[_0x0935('0xd')](_0x0935('0x38'))?this[_0x0935('0xd')](_0x0935('0x38'))[_0x0935('0x33')](','):null;},'comment':_0x0935('0x39')},'trustrpid':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no',_0x0935('0x3a')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0935('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0935('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![],'defaultValue':_0x0935('0x3b')},'amaflags':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x0935('0x2d')},'busylevel':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0935('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0935('0x1b')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no',_0x0935('0x3c')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x3d'),_0x0935('0x3e'),_0x0935('0x3f')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x40'),'uas'),'allowNull':!![],'defaultValue':_0x0935('0x41')},'t38pt_usertpsource':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x0935('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0935('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no',_0x0935('0x42'),_0x0935('0x43')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x44'),'passive',_0x0935('0x45')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0935('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0935('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0935('0x1b')](_0x0935('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0935('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0935('0x1b')]('yes','no','nonat',_0x0935('0x2f'),_0x0935('0x46')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0935('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x0935('0x18')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0935('0x47')]},'showWebBar':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0,'set':function(_0x44b6f0){this[_0x0935('0x6')](_0x0935('0x48'),_0x44b6f0);var _0x4aae7b=this[_0x0935('0x49')]({'plain':!![]});switch(_0x44b6f0){case 0x0:case 0x1:var _0x3e001f=_0x4aae7b[_0x0935('0x25')]?_[_0x0935('0x4a')](_0x4aae7b[_0x0935('0x25')])?_0x4aae7b[_0x0935('0x25')]['join']():_0x4aae7b[_0x0935('0x25')]:'udp';if(_0x3e001f===_0x0935('0x4b')){_0x3e001f=_0x0935('0x24');}this[_0x0935('0x6')]('transport',_0x3e001f);this[_0x0935('0x6')](_0x0935('0x4c'),'no');this[_0x0935('0x6')](_0x0935('0x4d'),null);this[_0x0935('0x6')](_0x0935('0x4e'),null);this[_0x0935('0x6')]('icesupport',null);this[_0x0935('0x6')](_0x0935('0x4f'),null);this[_0x0935('0x6')]('dtlsverify',null);this[_0x0935('0x6')]('dtlssetup',null);this[_0x0935('0x6')]('dtlscertfile',null);this[_0x0935('0x6')](_0x0935('0x50'),null);this[_0x0935('0x6')](_0x0935('0x51'),'no');break;case 0x2:this[_0x0935('0x6')]('transport',_0x0935('0x4b'));this[_0x0935('0x6')](_0x0935('0x4c'),_0x0935('0x2d'));this['setDataValue']('avpf',_0x0935('0x2d'));this[_0x0935('0x6')](_0x0935('0x4e'),_0x0935('0x2d'));this['setDataValue']('icesupport','yes');this[_0x0935('0x6')](_0x0935('0x4f'),_0x0935('0x2d'));this[_0x0935('0x6')]('dtlsverify','no');this[_0x0935('0x6')](_0x0935('0x52'),_0x0935('0x45'));this['setDataValue'](_0x0935('0x53'),_0x4aae7b[_0x0935('0x53')]||'/etc/pki/tls/certs/motion.crt');this[_0x0935('0x6')](_0x0935('0x50'),_0x4aae7b[_0x0935('0x50')]||_0x0935('0x54'));this['setDataValue'](_0x0935('0x51'),_0x0935('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x0935('0x47')],'set':function(_0x3c29a5){this['setDataValue'](_0x0935('0x55'),_0x3c29a5?_0x3c29a5[_0x0935('0x26')](','):[]);},'get':function(){return this[_0x0935('0xd')](_0x0935('0x55'))?_[_0x0935('0x56')](this[_0x0935('0xd')](_0x0935('0x55'))['split'](','),function(_0x2b9cc8){return parseInt(_0x2b9cc8,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0935('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0935('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0935('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0935('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0935('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0935('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0935('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0935('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0935('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0935('0x57')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x0935('0xd')](_0x0935('0x58')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![],'set':function(_0x134f2a){if(typeof _0x134f2a===_0x0935('0x59')){var _0x18e4f4=_0x134f2a==='1'?!![]:_0x134f2a==='0'?![]:_0x134f2a==='true'?!![]:_0x134f2a===_0x0935('0x5a')?![]:![];this['setDataValue']('screenrecording',_0x18e4f4);}else{this['setDataValue'](_0x0935('0x5b'),_0x134f2a);}}},'blocked':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![],'set':function(_0xa336b7){this['setDataValue'](_0x0935('0x5c'),_0xa336b7);if(_0xa336b7===!![]){this[_0x0935('0x6')](_0x0935('0x5d'),moment());this[_0x0935('0x6')](_0x0935('0x5e'),0x0);}else{this[_0x0935('0x6')](_0x0935('0x5d'),null);}}},'blockedAt':{'type':Sequelize[_0x0935('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0935('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0935('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0935('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0935('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0935('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0xf945=['nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','certificate','passive','actpass','showWebBar','get','isArray','wss','udp','encryption','icesupport','dtlsenable','dtlssetup','avpf','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','map','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','sequelize','moment','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','nonat','update','outgoing','yes'];(function(_0x48bc67,_0x3b2b80){var _0x5f0651=function(_0x2640ed){while(--_0x2640ed){_0x48bc67['push'](_0x48bc67['shift']());}};_0x5f0651(++_0x3b2b80);}(_0xf945,0x128));var _0x5f94=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf945[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x5f94('0x0'));var moment=require(_0x5f94('0x1'));var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x5f94('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x555b01){this[_0x5f94('0x3')](_0x5f94('0x4'),_0x555b01);this[_0x5f94('0x3')](_0x5f94('0x5'),_0x555b01);},'comment':_0x5f94('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5d0821){this[_0x5f94('0x3')](_0x5f94('0x7'),_0x5d0821);this[_0x5f94('0x3')](_0x5f94('0x8'),util[_0x5f94('0x9')]('\x22%s\x22\x20<%s>',_0x5d0821,this[_0x5f94('0xa')](_0x5f94('0xb'))));}},'alias':{'type':Sequelize[_0x5f94('0x2')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5f94('0xc'),'validate':{'isEmail':!![]},'set':function(_0x118f3a){if(_0x118f3a){this[_0x5f94('0x3')](_0x5f94('0xc'),_0x118f3a[_0x5f94('0xd')]());}}},'role':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0xf'),_0x5f94('0x10'),_0x5f94('0x11'),_0x5f94('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x5f94('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x5f94('0x13')},'internal':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':![],'unique':_0x5f94('0xb'),'set':function(_0x5dadf2){this[_0x5f94('0x3')]('internal',_0x5dadf2);this['setDataValue'](_0x5f94('0x15'),_0x5dadf2);this[_0x5f94('0x3')]('callerid',util[_0x5f94('0x9')](_0x5f94('0x16'),this[_0x5f94('0xa')](_0x5f94('0x7')),_0x5dadf2));}},'salt':{'type':Sequelize[_0x5f94('0x2')]},'phone':{'type':Sequelize[_0x5f94('0x2')]},'mobile':{'type':Sequelize[_0x5f94('0x2')]},'address':{'type':Sequelize[_0x5f94('0x2')]},'zipcode':{'type':Sequelize[_0x5f94('0x2')]},'userpic':{'type':Sequelize[_0x5f94('0x2')]},'city':{'type':Sequelize[_0x5f94('0x2')]},'country':{'type':Sequelize[_0x5f94('0x2')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x5f94('0x18')},'lastPauseAt':{'type':Sequelize[_0x5f94('0x19')]},'chatCapacity':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x5f94('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x5f94('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![],'defaultValue':_0x5f94('0x1a')},'ipaddr':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x5f94('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x1b'),_0x5f94('0x10'),_0x5f94('0x1c')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![],'defaultValue':_0x5f94('0x1d')},'callingpres':{'type':Sequelize['ENUM'](_0x5f94('0x1e'),'ALLOWED_PASSED_SCREEN',_0x5f94('0x1f'),_0x5f94('0x20'),_0x5f94('0x21'),'PROHIB_PASSED_SCREEN',_0x5f94('0x22'),_0x5f94('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![],'defaultValue':'udp','set':function(_0x5076c4){this[_0x5f94('0x3')](_0x5f94('0x24'),_0x5076c4?_0x5076c4[_0x5f94('0x25')](','):null);},'get':function(){return this[_0x5f94('0xa')]('transport')?this['getDataValue']('transport')[_0x5f94('0x26')](','):null;},'comment':_0x5f94('0x27')},'dtmfmode':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x28'),_0x5f94('0x29'),_0x5f94('0x2a'),'inband',_0x5f94('0x2b')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x5f94('0xe')]('yes','no',_0x5f94('0x2c'),_0x5f94('0x2d'),_0x5f94('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x2fa6a0){this[_0x5f94('0x3')]('nat',_0x2fa6a0?_0x2fa6a0[_0x5f94('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x5f94('0x30'))?this[_0x5f94('0xa')](_0x5f94('0x30'))[_0x5f94('0x26')](','):null;},'comment':_0x5f94('0x31')},'callgroup':{'type':Sequelize[_0x5f94('0x2')]},'namedcallgroup':{'type':Sequelize[_0x5f94('0x2')]},'pickupgroup':{'type':Sequelize[_0x5f94('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x5f94('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5f94('0x2')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5f94('0x32')},'allow':{'type':Sequelize[_0x5f94('0x2')],'allowNull':![],'defaultValue':_0x5f94('0x33'),'set':function(_0x175240){this[_0x5f94('0x3')](_0x5f94('0x34'),_0x175240?_0x175240['join'](';'):_0x5f94('0x33'));},'get':function(){return this[_0x5f94('0xa')]('allow')?this[_0x5f94('0xa')]('allow')[_0x5f94('0x26')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x5f94('0x2f'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x97767b){this[_0x5f94('0x3')](_0x5f94('0x35'),_0x97767b?_0x97767b[_0x5f94('0x25')](','):null);},'get':function(){return this[_0x5f94('0xa')](_0x5f94('0x35'))?this[_0x5f94('0xa')](_0x5f94('0x35'))[_0x5f94('0x26')](','):null;},'comment':_0x5f94('0x36')},'trustrpid':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no',_0x5f94('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x5f94('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x5f94('0xe')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![],'defaultValue':_0x5f94('0x38')},'amaflags':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x5f94('0x2f')},'busylevel':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x5f94('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no',_0x5f94('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x5f94('0xe')]('accept',_0x5f94('0x3a'),_0x5f94('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x3c'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x5f94('0x2f')},'keepalive':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x5f94('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x5f94('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5f94('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x5f94('0xe')]('yes','no','fingerprint',_0x5f94('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x5f94('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x5f94('0xe')]('active',_0x5f94('0x3e'),_0x5f94('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x5f94('0xe')]('yes','no',_0x5f94('0x2c'),_0x5f94('0x2d'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x5f94('0x19')]},'passwordResetAt':{'type':Sequelize[_0x5f94('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x32f680){this['setDataValue'](_0x5f94('0x40'),_0x32f680);var _0x2b941d=this[_0x5f94('0x41')]({'plain':!![]});switch(_0x32f680){case 0x0:case 0x1:var _0x5caea2=_0x2b941d[_0x5f94('0x24')]?_[_0x5f94('0x42')](_0x2b941d[_0x5f94('0x24')])?_0x2b941d[_0x5f94('0x24')][_0x5f94('0x25')]():_0x2b941d[_0x5f94('0x24')]:'udp';if(_0x5caea2===_0x5f94('0x43')){_0x5caea2=_0x5f94('0x44');}this[_0x5f94('0x3')](_0x5f94('0x24'),_0x5caea2);this[_0x5f94('0x3')](_0x5f94('0x45'),'no');this[_0x5f94('0x3')]('avpf',null);this['setDataValue']('force_avp',null);this[_0x5f94('0x3')](_0x5f94('0x46'),null);this[_0x5f94('0x3')](_0x5f94('0x47'),null);this[_0x5f94('0x3')]('dtlsverify',null);this[_0x5f94('0x3')](_0x5f94('0x48'),null);this['setDataValue']('dtlscertfile',null);this[_0x5f94('0x3')]('dtlsprivatekey',null);this[_0x5f94('0x3')]('rtcp_mux','no');break;case 0x2:this[_0x5f94('0x3')]('transport',_0x5f94('0x43'));this['setDataValue'](_0x5f94('0x45'),'yes');this[_0x5f94('0x3')](_0x5f94('0x49'),'yes');this[_0x5f94('0x3')](_0x5f94('0x4a'),_0x5f94('0x2f'));this[_0x5f94('0x3')](_0x5f94('0x46'),_0x5f94('0x2f'));this[_0x5f94('0x3')](_0x5f94('0x47'),_0x5f94('0x2f'));this[_0x5f94('0x3')]('dtlsverify','no');this[_0x5f94('0x3')](_0x5f94('0x48'),_0x5f94('0x3f'));this[_0x5f94('0x3')]('dtlscertfile',_0x2b941d[_0x5f94('0x4b')]||_0x5f94('0x4c'));this[_0x5f94('0x3')]('dtlsprivatekey',_0x2b941d[_0x5f94('0x4d')]||'/etc/pki/tls/private/motion.key');this[_0x5f94('0x3')]('rtcp_mux',_0x5f94('0x2f'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3b0ead){this[_0x5f94('0x3')]('permissions',_0x3b0ead?_0x3b0ead[_0x5f94('0x25')](','):[]);},'get':function(){return this[_0x5f94('0xa')]('permissions')?_[_0x5f94('0x4e')](this[_0x5f94('0xa')](_0x5f94('0x4f'))[_0x5f94('0x26')](','),function(_0x48b407){return parseInt(_0x48b407,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x5f94('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x5f94('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0x5f94('0x2')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x5f94('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x5f94('0xe')](_0x5f94('0x2f'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x5f94('0xa')](_0x5f94('0x50'))?this[_0x5f94('0xa')](_0x5f94('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x5f94('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x5f94('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![],'set':function(_0x52a66d){if(typeof _0x52a66d===_0x5f94('0x51')){var _0x136f92=_0x52a66d==='1'?!![]:_0x52a66d==='0'?![]:_0x52a66d==='true'?!![]:_0x52a66d===_0x5f94('0x52')?![]:![];this['setDataValue'](_0x5f94('0x53'),_0x136f92);}else{this[_0x5f94('0x3')](_0x5f94('0x53'),_0x52a66d);}}},'blocked':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![],'set':function(_0x13b77d){this[_0x5f94('0x3')](_0x5f94('0x54'),_0x13b77d);if(_0x13b77d===!![]){this[_0x5f94('0x3')](_0x5f94('0x55'),moment());this[_0x5f94('0x3')]('loginAttempts',0x0);}else{this[_0x5f94('0x3')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x5f94('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x5f94('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x5f94('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x5f94('0x17')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index bbfdf21..18245a6 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 _0x2356=['User','fieldName','type','key','password','getOptions','where','query','true','include','UserSetting','userSetting','includes','attributes','push','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','all','show','params','model','differenceBy','keys','filters','intersection','fields','includeAll','find','whatsapp','body','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','102','103','113','110','105','107','108','109','111','114','115','create','Unauthorized','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Agents','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','findAll','isEmpty','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','addQueues','channel','online','interface','isValidChannel','add','toLowerCase','Queues','penalty','capitalize','QueueId','emit','voice','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','isArray','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','rawAttributes','sort','pick','merge','options','getContacts','hasOwnProperty','CmList','List','Tag','Tags','tag','Queue','order','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','loginInPause','LOCAL/%s@from-sip/n','user:%s','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','flatten','transaction','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Mail','Fax','removeAgent','Queue:remove','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','spread','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','removeMailAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','removeSquareProjects','CmHopper','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contained','firstName','lastName','dialActive','getApiKey','retrieveApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','VoiceQueue','inbound','lower','toString','desc','asc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','busy','charAt','toUpperCase','QueryTypes','select','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user.socket','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','update','destroy','get','role','admin','Users','user','agent','telephone','filter','ignore','map','value','name','UserProfileResource','end','stack','send'];(function(_0xddcc,_0x2044d7){var _0x2d334f=function(_0xa99db5){while(--_0xa99db5){_0xddcc['push'](_0xddcc['shift']());}};_0x2d334f(++_0x2044d7);}(_0x2356,0x162));var _0x6235=function(_0x17183b,_0x248dfb){_0x17183b=_0x17183b-0x0;var _0x2f6554=_0x2356[_0x17183b];return _0x2f6554;};'use strict';var moment=require(_0x6235('0x0'));var BPromise=require('bluebird');var util=require(_0x6235('0x1'));var path=require(_0x6235('0x2'));var fs=require('fs');var _=require(_0x6235('0x3'));var squel=require(_0x6235('0x4'));var jayson=require(_0x6235('0x5'));var Redis=require('ioredis');var authService=require(_0x6235('0x6'));var qs=require(_0x6235('0x7'));var logger=require(_0x6235('0x8'))(_0x6235('0x9'));var utils=require(_0x6235('0xa'));var config=require(_0x6235('0xb'));var licenseUtil=require('../../config/license/util');var db=require(_0x6235('0xc'))['db'];var socket=require(_0x6235('0xd'))(new Redis(config[_0x6235('0xe')]));require(_0x6235('0xf'))['register'](socket);config[_0x6235('0xe')]=_['defaults'](config[_0x6235('0xe')],{'host':'localhost','port':0x18eb});var client=jayson[_0x6235('0x10')][_0x6235('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x41962b,_0x83ff3,_0x4de612,_0x149561){return new BPromise(function(_0x3667a9,_0x537f8e){var _0x52a7aa=_0x149561||client;return _0x52a7aa[_0x6235('0x12')](_0x41962b,_0x4de612)[_0x6235('0x13')](function(_0x50916d){logger[_0x6235('0x14')](_0x6235('0x15'),_0x83ff3,_0x6235('0x16'));logger[_0x6235('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x83ff3,_0x6235('0x16'),JSON[_0x6235('0x18')](_0x50916d));if(_0x50916d[_0x6235('0x19')]){if(_0x50916d['error'][_0x6235('0x1a')]===0x1f4){logger['error'](_0x6235('0x15'),_0x83ff3,_0x50916d[_0x6235('0x19')][_0x6235('0x1b')]);return _0x537f8e(_0x50916d['error'][_0x6235('0x1b')]);}logger['error'](_0x6235('0x15'),_0x83ff3,_0x50916d['error'][_0x6235('0x1b')]);return _0x3667a9(_0x50916d[_0x6235('0x19')][_0x6235('0x1b')]);}else{logger[_0x6235('0x14')](_0x6235('0x15'),_0x83ff3,'request\x20sent');_0x3667a9(_0x50916d[_0x6235('0x1c')][_0x6235('0x1b')]);}})[_0x6235('0x1d')](function(_0x379a40){logger['error'](_0x6235('0x15'),_0x83ff3,_0x379a40);_0x537f8e(_0x379a40);});});}function respondWithStatusCode(_0xc0d3d0,_0x5a2a1b){_0x5a2a1b=_0x5a2a1b||0xcc;return function(_0x32fc0e){if(_0x32fc0e){return _0xc0d3d0[_0x6235('0x1e')](_0x5a2a1b);}return _0xc0d3d0[_0x6235('0x1f')](_0x5a2a1b)['end']();};}function respondWithResult(_0x21c3e8,_0x44a997){_0x44a997=_0x44a997||0xc8;return function(_0x5ed624){if(_0x5ed624){return _0x21c3e8[_0x6235('0x1f')](_0x44a997)['json'](_0x5ed624);}};}function respondWithFilteredResult(_0x99a365,_0x1695d1){return function(_0x2ace8c){if(_0x2ace8c){var _0x16f6e3=typeof _0x1695d1[_0x6235('0x20')]==='undefined'&&typeof _0x1695d1[_0x6235('0x21')]===_0x6235('0x22');var _0x225034=_0x2ace8c[_0x6235('0x23')];var _0x1d6561=_0x16f6e3?0x0:_0x1695d1['offset'];var _0x43cad6=_0x16f6e3?_0x2ace8c[_0x6235('0x23')]:_0x1695d1[_0x6235('0x20')]+_0x1695d1[_0x6235('0x21')];var _0x18b30a;if(_0x43cad6>=_0x225034){_0x43cad6=_0x225034;_0x18b30a=0xc8;}else{_0x18b30a=0xce;}_0x99a365[_0x6235('0x1f')](_0x18b30a);return _0x99a365[_0x6235('0x24')](_0x6235('0x25'),_0x1d6561+'-'+_0x43cad6+'/'+_0x225034)[_0x6235('0x26')](_0x2ace8c);}return null;};}function saveUpdates(_0x600a36){return function(_0x59be2f){if(_0x59be2f){return _0x59be2f[_0x6235('0x27')](_0x600a36)[_0x6235('0x13')](function(_0x29a7fb){return _0x29a7fb;});}return null;};}function removeEntity(_0x208cc0){return function(_0x26c5e9){if(_0x26c5e9){return _0x26c5e9[_0x6235('0x28')]()['then'](function(){var _0x545eec=_0x26c5e9[_0x6235('0x29')]({'plain':!![]});if(_0x545eec[_0x6235('0x2a')]===_0x6235('0x2b'))return;var _0x1d14dc=[{'name':_0x6235('0x2c'),'value':_0x6235('0x2d'),'ignore':!![]},{'name':'Agents','value':_0x6235('0x2e'),'ignore':![]},{'name':'Telephones','value':_0x6235('0x2f'),'ignore':![]}];var _0x234ada=_(_0x1d14dc)[_0x6235('0x30')](_0x6235('0x31'))[_0x6235('0x32')](_0x6235('0x33'))[_0x6235('0x33')]();if(_['includes'](_0x234ada,_0x545eec[_0x6235('0x2a')])){return;}var _0x3c3e9e=_['find'](_0x1d14dc,[_0x6235('0x33'),_0x545eec[_0x6235('0x2a')]])[_0x6235('0x34')];return db[_0x6235('0x35')][_0x6235('0x28')]({'where':{'type':_0x3c3e9e,'resourceId':_0x545eec['id']}})[_0x6235('0x13')](function(){return _0x26c5e9;});})[_0x6235('0x13')](function(){_0x208cc0['status'](0xcc)[_0x6235('0x36')]();});}};}function handleEntityNotFound(_0x4ee76e){return function(_0x31d1e3){if(!_0x31d1e3){_0x4ee76e[_0x6235('0x1e')](0x194);}return _0x31d1e3;};}function handleError(_0x292cd1,_0x16f00c){_0x16f00c=_0x16f00c||0x1f4;return function(_0x2dca3d){logger[_0x6235('0x19')](_0x2dca3d[_0x6235('0x37')]);if(_0x2dca3d[_0x6235('0x34')]){delete _0x2dca3d[_0x6235('0x34')];}_0x292cd1['status'](_0x16f00c)[_0x6235('0x38')](_0x2dca3d);};}exports['index']=function(_0x7e3b22,_0xadad04){var _0x1522c0={},_0x5229fb={'count':0x0,'rows':[]};var _0xebaaa4=_(db[_0x6235('0x39')]['rawAttributes'])[_0x6235('0x32')](function(_0x2f0360){return{'name':_0x2f0360[_0x6235('0x3a')],'type':_0x2f0360[_0x6235('0x3b')][_0x6235('0x3c')]};})['filter'](function(_0x45d96d){return!_['includes']([_0x6235('0x3d'),'salt'],_0x45d96d[_0x6235('0x34')]);})[_0x6235('0x33')]();_0x1522c0=qs[_0x6235('0x3e')](_0xebaaa4,_0x7e3b22);var _0x49183f={'where':_0x1522c0[_0x6235('0x3f')]};return db[_0x6235('0x39')][_0x6235('0x23')](_0x49183f)[_0x6235('0x13')](function(_0x507b70){_0x5229fb['count']=_0x507b70;if(_0x7e3b22[_0x6235('0x40')]['includeAll']){_0x1522c0['include']=[{'all':!![]}];}if(_0x7e3b22[_0x6235('0x40')]['userSetting']===_0x6235('0x41')){_0x1522c0[_0x6235('0x42')]=[{'model':db[_0x6235('0x43')],'as':_0x6235('0x44')}];}if(!_[_0x6235('0x45')](_0x1522c0[_0x6235('0x46')],'id')){_0x1522c0[_0x6235('0x46')][_0x6235('0x47')]('id');}return db[_0x6235('0x39')]['findAll'](_0x1522c0);})[_0x6235('0x13')](function(_0x27d133){_0x5229fb[_0x6235('0x48')]=_0x27d133;if(_0x7e3b22[_0x6235('0x40')][_0x6235('0x49')]==='true'){var _0xaa6348=[];for(var _0x2c3c52=0x0;_0x2c3c52<_0x5229fb[_0x6235('0x48')][_0x6235('0x4a')];_0x2c3c52++){_0xaa6348[_0x6235('0x47')](get_open_tabs(_0x6235('0x4b'),_0x5229fb[_0x6235('0x48')][_0x2c3c52][_0x6235('0x4c')]));_0xaa6348[_0x6235('0x47')](get_open_tabs(_0x6235('0x4d'),_0x5229fb[_0x6235('0x48')][_0x2c3c52][_0x6235('0x4c')]));_0xaa6348['push'](get_open_tabs(_0x6235('0x4e'),_0x5229fb[_0x6235('0x48')][_0x2c3c52][_0x6235('0x4c')]));_0xaa6348['push'](get_open_tabs(_0x6235('0x4f'),_0x5229fb['rows'][_0x2c3c52]['dataValues']));_0xaa6348[_0x6235('0x47')](get_open_tabs(_0x6235('0x50'),_0x5229fb[_0x6235('0x48')][_0x2c3c52][_0x6235('0x4c')]));_0xaa6348[_0x6235('0x47')](get_open_tabs('whatsapp',_0x5229fb[_0x6235('0x48')][_0x2c3c52]['dataValues']));}return BPromise[_0x6235('0x51')](_0xaa6348)[_0x6235('0x13')](function(){return _0x5229fb;});}else{return _0x5229fb;}})[_0x6235('0x13')](respondWithFilteredResult(_0xadad04,_0x1522c0))[_0x6235('0x1d')](handleError(_0xadad04,null));};exports[_0x6235('0x52')]=function(_0xa82ab7,_0x18fc41){var _0x18bb45={'raw':![],'where':{'id':_0xa82ab7[_0x6235('0x53')]['id']}},_0x60801d={};_0x60801d[_0x6235('0x54')]=_[_0x6235('0x55')](_[_0x6235('0x56')](db[_0x6235('0x39')]['rawAttributes']),[_0x6235('0x3d'),'salt']);_0x60801d[_0x6235('0x40')]=_[_0x6235('0x56')](_0xa82ab7[_0x6235('0x40')]);_0x60801d[_0x6235('0x57')]=_[_0x6235('0x58')](_0x60801d[_0x6235('0x54')],_0x60801d[_0x6235('0x40')]);_0x18bb45[_0x6235('0x46')]=_[_0x6235('0x58')](_0x60801d[_0x6235('0x54')],qs['fields'](_0xa82ab7[_0x6235('0x40')][_0x6235('0x59')]));_0x18bb45[_0x6235('0x46')]=_0x18bb45['attributes']['length']?_0x18bb45['attributes']:_0x60801d[_0x6235('0x54')];if(_0xa82ab7[_0x6235('0x40')][_0x6235('0x5a')]){_0x18bb45[_0x6235('0x42')]=[{'all':!![]}];}if(_0xa82ab7['query'][_0x6235('0x44')]===_0x6235('0x41')){_0x18bb45['include']=[{'model':db[_0x6235('0x43')],'as':_0x6235('0x44')}];}_0x18bb45=_['merge']({},_0x18bb45,_0xa82ab7['options']);if(!_[_0x6235('0x45')](_0x18bb45['attributes'],'id')){_0x18bb45[_0x6235('0x46')]['push']('id');}return db[_0x6235('0x39')][_0x6235('0x5b')](_0x18bb45)[_0x6235('0x13')](handleEntityNotFound(_0x18fc41,null))[_0x6235('0x13')](function(_0x87e498){var _0x479fed=[];values=_0x87e498;if(_0xa82ab7['query'][_0x6235('0x49')]===_0x6235('0x41')){_0x479fed[_0x6235('0x47')](get_open_tabs(_0x6235('0x4b'),_0x87e498[_0x6235('0x4c')]));_0x479fed['push'](get_open_tabs('sms',_0x87e498[_0x6235('0x4c')]));_0x479fed['push'](get_open_tabs(_0x6235('0x50'),_0x87e498[_0x6235('0x4c')]));_0x479fed[_0x6235('0x47')](get_open_tabs(_0x6235('0x5c'),_0x87e498['dataValues']));_0x479fed[_0x6235('0x47')](get_open_tabs(_0x6235('0x4e'),_0x87e498['dataValues']));_0x479fed['push'](get_open_tabs(_0x6235('0x4f'),_0x87e498[_0x6235('0x4c')]));return BPromise[_0x6235('0x51')](_0x479fed);}else{return values;}})[_0x6235('0x13')](function(){return values;})['then'](respondWithResult(_0x18fc41,null))[_0x6235('0x1d')](handleError(_0x18fc41,null));};exports[_0x6235('0x27')]=function(_0x310361,_0x50cca1){if(_0x310361[_0x6235('0x5d')]['id']){delete _0x310361[_0x6235('0x5d')]['id'];}delete _0x310361[_0x6235('0x5d')][_0x6235('0x2a')];return db[_0x6235('0x39')]['find']({'where':{'id':_0x310361[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x50cca1,null))['then'](saveUpdates(_0x310361[_0x6235('0x5d')],null))[_0x6235('0x13')](respondWithResult(_0x50cca1,null))[_0x6235('0x1d')](handleError(_0x50cca1,null));};exports[_0x6235('0x5e')]=function(_0x19f46c,_0x41c723){return db['User']['describe']()['then'](respondWithResult(_0x41c723,null))[_0x6235('0x1d')](handleError(_0x41c723,null));};exports['addContacts']=function(_0x396efb,_0x59362a){return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x396efb[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x59362a,null))[_0x6235('0x13')](function(_0x361968){if(_0x361968){return _0x361968[_0x6235('0x5f')](_0x396efb[_0x6235('0x5d')]['ids'],_[_0x6235('0x60')](_0x396efb[_0x6235('0x5d')],[_0x6235('0x61'),'id'])||{});}})[_0x6235('0x13')](respondWithResult(_0x59362a,null))['catch'](handleError(_0x59362a,null));};function validateUser(_0xaa8eb0){return new BPromise(function(_0x4bae33,_0x41e73d){if(_0xaa8eb0[_0x6235('0x62')])return _0x4bae33(_0xaa8eb0);return db[_0x6235('0x63')][_0x6235('0x64')](0x1)[_0x6235('0x13')](function(_0x1eff98){if(_0x1eff98[_0x6235('0x65')])authService[_0x6235('0x66')](_0xaa8eb0[_0x6235('0x3d')]);db[_0x6235('0x39')][_0x6235('0x67')](_0x6235('0x62'))[_0x6235('0x13')](function(_0xd3d8ee){if(_[_0x6235('0x68')](_0xd3d8ee)){_0xaa8eb0[_0x6235('0x62')]=_0x1eff98['min_internal']||0x1;return;}if(_[_0x6235('0x68')](_0x1eff98[_0x6235('0x69')])||_0x1eff98['min_internal']===_0xd3d8ee){_0xaa8eb0[_0x6235('0x62')]=_0xd3d8ee+0x1;return;}if(_0x1eff98[_0x6235('0x69')]>_0xd3d8ee){_0xaa8eb0[_0x6235('0x62')]=_0x1eff98[_0x6235('0x69')];return;}return db[_0x6235('0x6a')][_0x6235('0x40')]('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[_0x6235('0x6a')]['QueryTypes'][_0x6235('0x6b')]})[_0x6235('0x13')](function(_0x26e45a){if(_0x26e45a&&_0x26e45a[_0x6235('0x4a')]){for(var _0x47e0d3=0x0,_0x163faf=_0x26e45a[_0x6235('0x4a')];_0x47e0d3<_0x163faf&&_[_0x6235('0x68')](_0xaa8eb0[_0x6235('0x62')]);_0x47e0d3++){if(_0x1eff98['min_internal']<=_0x26e45a[_0x47e0d3][_0x6235('0x6c')]){_0xaa8eb0['internal']=_0x26e45a[_0x47e0d3][_0x6235('0x6c')];}else if(_0x1eff98[_0x6235('0x69')]>_0x26e45a[_0x47e0d3][_0x6235('0x6c')]&&_0x1eff98['min_internal']<=_0x26e45a[_0x47e0d3]['to']){_0xaa8eb0[_0x6235('0x62')]=_0x1eff98[_0x6235('0x69')];}}}if(_['isNil'](_0xaa8eb0['internal'])){_0xaa8eb0[_0x6235('0x62')]=_0xd3d8ee+0x1;}return _0x4bae33(_0xaa8eb0);});});})[_0x6235('0x1d')](function(_0x4dd0fc){_0x41e73d(_0x4dd0fc);});});}function updateUser(_0x33e952){return new BPromise(function(_0x440151,_0x54c6d9){try{if(_0x33e952[_0x6235('0x6d')]){_0x33e952[_0x6235('0x6e')]=_0x33e952[_0x6235('0x62')];_0x33e952['VoiceMail']={'mailbox':_0x33e952['internal'],'password':_0x33e952[_0x6235('0x3d')],'fullname':_0x33e952[_0x6235('0x6f')],'email':_0x33e952[_0x6235('0x70')]};}if(_0x33e952['role']==='agent'){if(!_0x33e952['permissions'])_0x33e952[_0x6235('0x71')]=[_0x6235('0x72'),_0x6235('0x73'),_0x6235('0x74'),_0x6235('0x75'),_0x6235('0x76'),'104',_0x6235('0x77'),'106',_0x6235('0x78'),_0x6235('0x79'),_0x6235('0x7a'),'100',_0x6235('0x7b'),_0x6235('0x7c'),_0x6235('0x7d')];}_0x440151(_0x33e952);}catch(_0x30522c){_0x54c6d9(_0x30522c);}});}exports[_0x6235('0x7e')]=function(_0xf780fa,_0x29b393){if(_0xf780fa[_0x6235('0x2d')]['role']===_0x6235('0x2e'))throw new Error(_0x6235('0x7f'));if(_0xf780fa[_0x6235('0x5d')]['role']===_0x6235('0x2d')&&_0xf780fa[_0x6235('0x2d')][_0x6235('0x2a')]!==_0x6235('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xf780fa[_0x6235('0x5d')][_0x6235('0x2a')]===_0x6235('0x2b')&&_0xf780fa[_0x6235('0x2d')][_0x6235('0x2a')]!==_0x6235('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x6235('0x80')]([_0xf780fa[_0x6235('0x5d')]])[_0x6235('0x13')](function(){return validateUser(_0xf780fa['body']);})[_0x6235('0x13')](function(_0x17ff66){return updateUser(_0x17ff66)[_0x6235('0x13')](function(_0x2a0468){if(_0x2a0468[_0x6235('0x2a')]==='admin'){_0x2a0468[_0x6235('0x81')]=_0xf780fa['user']['settingsEnabled'];delete _0x2a0468[_0x6235('0x82')];}return _0x2a0468;});})[_0x6235('0x13')](function(_0x1b58c1){return db['User'][_0x6235('0x7e')](_0x1b58c1,{'include':[{'model':db['VoiceMail'],'as':_0x6235('0x83')}]});})[_0x6235('0x13')](function(_0x5b421c){if(_0xf780fa['body'][_0x6235('0x2a')]===_0x6235('0x2d'))return _0x5b421c;if(_0xf780fa[_0x6235('0x2d')][_0x6235('0x2a')]!==_0x6235('0x2d'))return _0x5b421c;return db[_0x6235('0x84')][_0x6235('0x5b')]({'where':{'name':_0x5b421c[_0x6235('0x2a')]===_0x6235('0x2e')?_0x6235('0x85'):_0x6235('0x86'),'userProfileId':_0xf780fa[_0x6235('0x2d')][_0x6235('0x82')]},'raw':!![]})[_0x6235('0x13')](function(_0x52e62e){if(!_0x52e62e||_0x52e62e[_0x6235('0x87')]!=0x0)return _0x5b421c;return db['UserProfileResource']['create']({'name':_0x5b421c['name'],'resourceId':_0x5b421c['id'],'type':_0x52e62e['name'],'sectionId':_0x52e62e['id']},{})[_0x6235('0x13')](function(){return _0x5b421c;});})[_0x6235('0x1d')](function(_0x4338af){logger[_0x6235('0x19')](_0x6235('0x88'),_0x4338af);throw _0x4338af;});})[_0x6235('0x13')](respondWithResult(_0x29b393,0xc9))[_0x6235('0x1d')](handleError(_0x29b393,null));};exports[_0x6235('0x89')]=function(_0x4b4641,_0x314a97){var _0x5e7709=_0x4b4641[_0x6235('0x5d')];var _0x30940b=[];if(_0x4b4641[_0x6235('0x2d')][_0x6235('0x2a')]===_0x6235('0x2e'))throw new Error(_0x6235('0x7f'));if(_[_0x6235('0x8a')](_0x5e7709,[_0x6235('0x2a'),_0x6235('0x2d')])&&_0x4b4641[_0x6235('0x2d')][_0x6235('0x2a')]!==_0x6235('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6235('0x8a')](_0x5e7709,['role',_0x6235('0x2b')])&&_0x4b4641[_0x6235('0x2d')][_0x6235('0x2a')]!==_0x6235('0x2b')){throw new Error(_0x6235('0x8b'));}return licenseUtil[_0x6235('0x80')](_0x5e7709)[_0x6235('0x13')](function(){return validateUser(_0x5e7709[0x0]);})[_0x6235('0x13')](function(){for(var _0x359f6e=0x1;_0x359f6e<_0x5e7709[_0x6235('0x4a')];_0x359f6e++){var _0x359a0d=_0x5e7709[_0x359f6e-0x1][_0x6235('0x62')];if(!_0x5e7709[_0x359f6e][_0x6235('0x62')])_0x5e7709[_0x359f6e][_0x6235('0x62')]=_0x359a0d+0x1;_0x30940b['push'](validateUser(_0x5e7709[_0x359f6e]));}return BPromise['all'](_0x30940b);})[_0x6235('0x13')](function(){_0x30940b=[];for(var _0x24ac79=0x0;_0x24ac79<_0x5e7709[_0x6235('0x4a')];_0x24ac79++){_0x30940b['push'](updateUser(_0x5e7709[_0x24ac79]));}return BPromise['all'](_0x30940b);})['then'](function(){return BPromise[_0x6235('0x8c')](_0x5e7709,function(_0x8cb64c){return db[_0x6235('0x39')]['create'](_0x8cb64c,{'include':[{'model':db[_0x6235('0x83')],'as':_0x6235('0x83')}]})[_0x6235('0x13')](function(_0xb87a7e){_0x8cb64c['id']=_0xb87a7e['id'];return _0x8cb64c;});});})['then'](function(_0x4611b8){if(_0x4b4641[_0x6235('0x5d')][_0x6235('0x2a')]===_0x6235('0x2d'))return _0x4611b8;if(_0x4b4641[_0x6235('0x2d')][_0x6235('0x2a')]!==_0x6235('0x2d'))return _0x4611b8;var _0x422a73=_[_0x6235('0x8a')](_0x4611b8,function(_0x5cbf15){return _0x5cbf15[_0x6235('0x2a')]===_0x6235('0x2e')||_0x5cbf15[_0x6235('0x2a')]===_0x6235('0x2f');});if(!_0x422a73)return _0x4611b8;return db[_0x6235('0x84')][_0x6235('0x8d')]({'where':{'name':{'$or':[_0x6235('0x85'),_0x6235('0x86')]},'userProfileId':_0x4b4641[_0x6235('0x2d')][_0x6235('0x82')]},'raw':!![]})[_0x6235('0x13')](function(_0x384506){if(_[_0x6235('0x8e')](_0x384506)||!_['some'](_0x384506,['autoAssociation',0x0]))return _0x4611b8;_0x30940b=[];var _0x432b5f=_(_0x384506)['map'](function(_0x156892){if(_0x156892[_0x6235('0x87')]===0x1)return;return _0x156892[_0x6235('0x34')]===_0x6235('0x85')?_0x6235('0x2e'):'telephone';})['compact']()[_0x6235('0x33')]();for(var _0x1458b0=0x0;_0x1458b0<_0x4611b8[_0x6235('0x4a')];_0x1458b0++){if(!_[_0x6235('0x45')](_0x432b5f,_0x4611b8[_0x1458b0][_0x6235('0x2a')]))return;var _0x522c5b=_0x4611b8[_0x1458b0][_0x6235('0x2a')]===_0x6235('0x2e')?'Agents':_0x6235('0x86');_0x30940b[_0x6235('0x47')](db[_0x6235('0x35')][_0x6235('0x7e')]({'name':_0x4611b8[_0x1458b0][_0x6235('0x34')],'resourceId':_0x4611b8[_0x1458b0]['id'],'type':_0x522c5b,'sectionId':_[_0x6235('0x5b')](_0x384506,[_0x6235('0x34'),_0x522c5b])['id']},{}));}return BPromise[_0x6235('0x51')](_0x30940b);});})['then'](respondWithResult(_0x314a97,0xc9))['catch'](handleError(_0x314a97,null));};exports[_0x6235('0x8f')]=function(_0x2a5c03,_0x2f7f56){if(_0x2a5c03['body']['id']){delete _0x2a5c03['body']['id'];}return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x2a5c03[_0x6235('0x53')]['id']}})[_0x6235('0x13')](function(_0x3ed850){if(!_0x3ed850)return null;if(_0x3ed850['id']===_0x2a5c03[_0x6235('0x2d')]['id']){if(!_0x2a5c03[_0x6235('0x5d')][_0x6235('0x90')]||!_0x2a5c03['body'][_0x6235('0x91')]){throw new db['Sequelize'][(_0x6235('0x92'))](_0x6235('0x93'));}if(!_0x3ed850[_0x6235('0x94')](_0x2a5c03['body'][_0x6235('0x90')])){throw new db[(_0x6235('0x95'))]['ValidationError'](_0x6235('0x96'));}if(_0x2a5c03[_0x6235('0x5d')][_0x6235('0x90')]===_0x2a5c03[_0x6235('0x5d')][_0x6235('0x91')]){throw new db['Sequelize'][(_0x6235('0x92'))](_0x6235('0x97'));}}else if(_0x2a5c03[_0x6235('0x2d')]['role']===_0x6235('0x2b')){if(!_0x2a5c03[_0x6235('0x5d')]['newPassword']){throw new db[(_0x6235('0x95'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x2a5c03[_0x6235('0x2d')]['role']==='user'){if(!_0x2a5c03[_0x6235('0x5d')][_0x6235('0x91')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3ed850[_0x6235('0x2a')]!=='agent'){throw new db[(_0x6235('0x95'))][(_0x6235('0x92'))](_0x6235('0x7f'));}}else{throw new db[(_0x6235('0x95'))]['ValidationError']('Unauthorized');}return _0x3ed850;})[_0x6235('0x13')](handleEntityNotFound(_0x2f7f56,null))[_0x6235('0x13')](function(_0x3eea8b){return db[_0x6235('0x63')][_0x6235('0x98')]({'attributes':['id',_0x6235('0x65'),_0x6235('0x99'),_0x6235('0x9a')]})['then'](function(_0x4168de){if(_0x4168de[_0x6235('0x65')])authService[_0x6235('0x66')](_0x2a5c03[_0x6235('0x5d')][_0x6235('0x91')]);if(!_0x4168de[_0x6235('0x99')]||!_0x3eea8b[_0x6235('0x9b')])return _0x3eea8b;authService['validatePasswordHistory'](_0x2a5c03[_0x6235('0x5d')][_0x6235('0x91')],_0x3eea8b[_0x6235('0x9b')],_0x4168de['passwordHistoryLimit']);return _0x3eea8b;})[_0x6235('0x13')](saveUpdates({'password':_0x2a5c03['body'][_0x6235('0x91')],'passwordResetAt':_0x2a5c03[_0x6235('0x2d')]['id']==_0x2a5c03[_0x6235('0x53')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2a5c03[_0x6235('0x5d')][_0x6235('0x91')],_0x3eea8b['previousPasswords'])},null));})[_0x6235('0x13')](respondWithResult(_0x2f7f56,null))['catch'](handleError(_0x2f7f56,null));};exports[_0x6235('0x9c')]=function(_0x230087,_0x27e7b5){var _0x47875f=_0x230087['body'][_0x6235('0x9d')];return db['User'][_0x6235('0x5b')]({'where':{'id':_0x230087['params']['id']},'attributes':['id',_0x6235('0x34'),_0x6235('0x2a'),_0x6235('0x9e'),'loginInPause','voicePause',_0x6235('0x9f')]})['then'](handleEntityNotFound(_0x27e7b5,null))[_0x6235('0x13')](function(_0x3f0e43){if(_0x3f0e43){if(!utils[_0x6235('0xa0')](_0x47875f)){throw new db[(_0x6235('0x95'))][(_0x6235('0x92'))]('Unknown\x20channel');}return _0x3f0e43[_0x6235('0xa1')+_['capitalize'](_0x47875f[_0x6235('0xa2')]())+_0x6235('0xa3')](_0x230087['body'][_0x6235('0x61')],{'penalty':_0x230087['body'][_0x6235('0xa4')]||0x0})['spread'](function(_0x4a4147){for(var _0x4d70b7=0x0;_0x4d70b7<_0x230087[_0x6235('0x5d')]['ids'][_0x6235('0x4a')];_0x4d70b7+=0x1){var _0x508072={'UserId':Number(_0x230087[_0x6235('0x53')]['id'])};_0x508072[_[_0x6235('0xa5')](_0x47875f[_0x6235('0xa2')]())+_0x6235('0xa6')]=Number(_0x230087['body'][_0x6235('0x61')][_0x4d70b7]);socket[_0x6235('0xa7')](_0x6235('0x2d')+_['capitalize'](_0x47875f[_0x6235('0xa2')]())+'Queue:save',_0x508072);}return _0x4a4147;})[_0x6235('0x13')](function(){if(_0x47875f===_0x6235('0xa8')){return db['VoiceQueue'][_0x6235('0x8d')]({'where':{'id':_0x230087[_0x6235('0x5d')][_0x6235('0x61')]||[]},'raw':!![],'attributes':['id',_0x6235('0x34')]});}})[_0x6235('0x13')](function(_0x2f98ab){var _0x1c5380=_0x3f0e43[_0x6235('0x29')]({'plain':!![]});var _0x1a282e=[];if(_0x47875f===_0x6235('0xa8')&&_0x1c5380[_0x6235('0x2a')]===_0x6235('0x2e')&&_0x1c5380[_0x6235('0x9e')]){for(var _0x1d257e=0x0;_0x1d257e<_0x2f98ab['length'];_0x1d257e+=0x1){_0x1a282e[_0x6235('0x47')]({'membername':_0x1c5380[_0x6235('0x34')],'UserId':_0x1c5380['id'],'queue_name':_0x2f98ab[_0x1d257e][_0x6235('0x34')],'VoiceQueueId':_0x2f98ab[_0x1d257e]['id'],'interface':_[_0x6235('0x68')](_0x1c5380['interface'])?util[_0x6235('0xa9')](_0x6235('0xaa'),_0x1c5380[_0x6235('0x34')]):_0x1c5380[_0x6235('0x9f')],'paused':_0x1c5380[_0x6235('0xab')]||![],'penalty':_0x230087[_0x6235('0x5d')][_0x6235('0xa4')]||0x0});}return BPromise[_0x6235('0x8c')](_0x1a282e,function(_0x486e56){return db[_0x6235('0xac')][_0x6235('0xad')](_0x486e56);});}return _0x3f0e43;});}})[_0x6235('0x13')](respondWithStatusCode(_0x27e7b5,null))['catch'](handleError(_0x27e7b5,null));};exports[_0x6235('0xae')]=function(_0x3518cb,_0x4ee10c){var _0x136b36,_0x5ab313;return db['User'][_0x6235('0x5b')]({'where':{'id':_0x3518cb[_0x6235('0x53')]['id']},'attributes':['id',_0x6235('0x34'),_0x6235('0x2a')]})[_0x6235('0x13')](handleEntityNotFound(_0x4ee10c,null))[_0x6235('0x13')](function(_0x574cfb){if(_0x574cfb){_0x136b36=_0x574cfb;if(!_0x3518cb['query'][_0x6235('0x9d')]||!utils[_0x6235('0xa0')](_0x3518cb[_0x6235('0x40')][_0x6235('0x9d')])){throw new db[(_0x6235('0x95'))][(_0x6235('0x92'))](_0x6235('0xaf'));}return _0x574cfb[_0x6235('0xb0')+_[_0x6235('0xa5')](_0x3518cb[_0x6235('0x40')][_0x6235('0x9d')][_0x6235('0xa2')]())+_0x6235('0xa3')](_0x3518cb[_0x6235('0x40')][_0x6235('0x61')]);}})[_0x6235('0x13')](function(_0x18ec5d){if(_[_0x6235('0xb1')](_0x3518cb[_0x6235('0x40')][_0x6235('0x61')])){for(var _0x5eea6d=0x0;_0x5eea6d<_0x3518cb[_0x6235('0x40')][_0x6235('0x61')][_0x6235('0x4a')];_0x5eea6d+=0x1){_0x5ab313={'UserId':Number(_0x3518cb[_0x6235('0x53')]['id'])};_0x5ab313[_[_0x6235('0xa5')](_0x3518cb[_0x6235('0x40')]['channel'][_0x6235('0xa2')]())+'QueueId']=Number(_0x3518cb[_0x6235('0x40')][_0x6235('0x61')][_0x5eea6d]);socket['emit'](_0x6235('0x2d')+_[_0x6235('0xa5')](_0x3518cb['query']['channel']['toLowerCase']())+'Queue:remove',_0x5ab313);}}else{_0x5ab313={'UserId':Number(_0x3518cb[_0x6235('0x53')]['id'])};_0x5ab313[_['capitalize'](_0x3518cb['query'][_0x6235('0x9d')][_0x6235('0xa2')]())+_0x6235('0xa6')]=Number(_0x3518cb[_0x6235('0x40')][_0x6235('0x61')]);socket['emit'](_0x6235('0x2d')+_['capitalize'](_0x3518cb[_0x6235('0x40')][_0x6235('0x9d')][_0x6235('0xa2')]())+'Queue:remove',_0x5ab313);}return _0x18ec5d;})['then'](function(){if(_0x3518cb[_0x6235('0x40')]['channel']===_0x6235('0xa8')){return db[_0x6235('0xac')][_0x6235('0x28')]({'where':{'UserId':_0x3518cb[_0x6235('0x53')]['id'],'VoiceQueueId':_0x3518cb[_0x6235('0x40')][_0x6235('0x61')]},'individualHooks':!![]})[_0x6235('0x13')](function(){return _0x136b36;});}return _0x136b36;})['then'](respondWithStatusCode(_0x4ee10c,null))[_0x6235('0x1d')](handleError(_0x4ee10c,null));};exports[_0x6235('0xb2')]=function(_0x3d1cd7,_0x165b04){_0x3d1cd7[_0x6235('0x5d')][_0x6235('0xb3')]=_0x3d1cd7[_0x6235('0xb4')][_0x6235('0xb5')];return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x3d1cd7[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x165b04,null))[_0x6235('0x13')](saveUpdates(_0x3d1cd7[_0x6235('0x5d')],null))[_0x6235('0x13')](respondWithResult(_0x165b04,null))[_0x6235('0x1d')](handleError(_0x165b04,null));};exports[_0x6235('0xb6')]=function(_0x227637,_0x48b73c){var _0x419ccb=path[_0x6235('0xb7')](config[_0x6235('0xb8')],_0x6235('0xb9'));return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x227637[_0x6235('0x53')]['id']},'attributes':['id',_0x6235('0xb3')],'raw':!![]})[_0x6235('0x13')](handleEntityNotFound(_0x48b73c,null))[_0x6235('0x13')](function(_0xb3332c){if(_0xb3332c){if(_[_0x6235('0x68')](_0xb3332c[_0x6235('0xb3')])){return _0x48b73c['download'](_0x419ccb);}else{if(!fs[_0x6235('0xba')](path['join'](config['root'],'server/files/images/',_0xb3332c['userpic']))){return _0x48b73c[_0x6235('0xbb')](_0x419ccb);}return _0x48b73c[_0x6235('0xbb')](path[_0x6235('0xb7')](config[_0x6235('0xb8')],_0x6235('0xbc'),_0xb3332c[_0x6235('0xb3')]));}}})[_0x6235('0x1d')](handleError(_0x48b73c,null));};exports[_0x6235('0xbd')]=function(_0x3aa102,_0x1e5490){return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x3aa102[_0x6235('0x53')]['id']},'attributes':['id']})[_0x6235('0x13')](handleEntityNotFound(_0x1e5490,null))[_0x6235('0x13')](function(_0x3fc9e0){var _0x1f7c5d=[];values=_0x3fc9e0['dataValues'];_0x1f7c5d['push'](get_open_tabs('chat',_0x3fc9e0[_0x6235('0x4c')]));_0x1f7c5d[_0x6235('0x47')](get_open_tabs('sms',_0x3fc9e0[_0x6235('0x4c')]));_0x1f7c5d[_0x6235('0x47')](get_open_tabs(_0x6235('0x50'),_0x3fc9e0[_0x6235('0x4c')]));_0x1f7c5d['push'](get_open_tabs(_0x6235('0x5c'),_0x3fc9e0[_0x6235('0x4c')]));_0x1f7c5d[_0x6235('0x47')](get_open_tabs('fax',_0x3fc9e0[_0x6235('0x4c')]));_0x1f7c5d[_0x6235('0x47')](get_open_tabs('mail',_0x3fc9e0[_0x6235('0x4c')]));return BPromise[_0x6235('0x51')](_0x1f7c5d);})[_0x6235('0x13')](function(_0x233fcc){if(_0x233fcc){var _0x57ee05=_[_0x6235('0x32')](values[_0x6235('0xbe')],function(_0x49c1c4){return{'channel':_0x6235('0xbf'),'id':_0x49c1c4['id'],'createdAt':_0x49c1c4[_0x6235('0xc0')]};});var _0x9dbb7c=_[_0x6235('0x32')](values[_0x6235('0xc1')],function(_0x56cd69){return{'channel':_0x6235('0xc2'),'id':_0x56cd69['id'],'createdAt':_0x56cd69['createdAt']};});var _0x40fd59=_['map'](values[_0x6235('0xc3')],function(_0x2d74cb){return{'channel':_0x6235('0xc4'),'id':_0x2d74cb['id'],'createdAt':_0x2d74cb[_0x6235('0xc0')]};});var _0x1b1f01=_['map'](values[_0x6235('0xc5')],function(_0x48c41f){return{'channel':'MAIL','id':_0x48c41f['id'],'createdAt':_0x48c41f['createdAt']};});var _0x3033d2=_[_0x6235('0x32')](values[_0x6235('0xc6')],function(_0x417c5c){return{'channel':_0x6235('0xc7'),'id':_0x417c5c['id'],'createdAt':_0x417c5c[_0x6235('0xc0')]};});var _0x57a63e=_[_0x6235('0x32')](values[_0x6235('0xc8')],function(_0x4587f6){return{'channel':_0x6235('0xc9'),'id':_0x4587f6['id'],'createdAt':_0x4587f6[_0x6235('0xc0')]};});var _0x167259=_[_0x6235('0xca')](_0x57ee05,_0x9dbb7c,_0x40fd59,_0x1b1f01,_0x3033d2,_0x57a63e);var _0x3206b4={'count':_0x167259['length'],'rows':_0x167259};return _0x3206b4;}else return null;})[_0x6235('0x13')](respondWithResult(_0x1e5490,null))['catch'](handleError(_0x1e5490,null));};exports['getContacts']=function(_0x2f93f6,_0x33825c){var _0x116825={};var _0x5da80c={};var _0x3ed563;var _0x8e9a98;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x2f93f6['params']['id']}})['then'](handleEntityNotFound(_0x33825c,null))[_0x6235('0x13')](function(_0x3769fa){if(_0x3769fa){_0x3ed563=_0x3769fa;_0x5da80c[_0x6235('0x54')]=_[_0x6235('0x56')](db['CmContact'][_0x6235('0xcb')]);_0x5da80c[_0x6235('0x40')]=_[_0x6235('0x56')](_0x2f93f6[_0x6235('0x40')]);_0x5da80c[_0x6235('0x57')]=_[_0x6235('0x58')](_0x5da80c[_0x6235('0x54')],_0x5da80c[_0x6235('0x40')]);_0x116825[_0x6235('0x46')]=_[_0x6235('0x58')](_0x5da80c[_0x6235('0x54')],qs[_0x6235('0x59')](_0x2f93f6[_0x6235('0x40')][_0x6235('0x59')]));_0x116825[_0x6235('0x46')]=_0x116825[_0x6235('0x46')]['length']?_0x116825[_0x6235('0x46')]:_0x5da80c[_0x6235('0x54')];_0x116825['order']=qs[_0x6235('0xcc')](_0x2f93f6[_0x6235('0x40')][_0x6235('0xcc')]);_0x116825[_0x6235('0x3f')]=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x2f93f6[_0x6235('0x40')],_0x5da80c[_0x6235('0x57')]));if(_0x2f93f6['query']['filter']){_0x116825[_0x6235('0x3f')]=_[_0x6235('0xce')](_0x116825['where'],{'$or':_[_0x6235('0x32')](_0x116825[_0x6235('0x46')],function(_0x32ccc1){var _0x5f5561={};_0x5f5561[_0x32ccc1]={'$like':'%'+_0x2f93f6['query']['filter']+'%'};return _0x5f5561;})});}_0x116825=_[_0x6235('0xce')]({},_0x116825,_0x2f93f6[_0x6235('0xcf')]);return _0x3ed563[_0x6235('0xd0')](_0x116825);}})[_0x6235('0x13')](function(_0x1f0615){if(_0x1f0615){_0x8e9a98=_0x1f0615[_0x6235('0x4a')];if(_0x2f93f6['query'][_0x6235('0xd1')]('includeAll')){_0x116825[_0x6235('0x42')]=[{'model':db[_0x6235('0xd2')],'as':_0x6235('0xd3'),'required':![]},{'model':db[_0x6235('0xd4')],'as':_0x6235('0xd5'),'attributes':['id',_0x6235('0x34'),'color'],'where':_0x2f93f6[_0x6235('0x40')][_0x6235('0xd6')]?{'id':_0x2f93f6[_0x6235('0x40')][_0x6235('0xd6')]}:undefined,'required':_0x2f93f6[_0x6235('0x40')][_0x6235('0xd6')]?!![]:![]}];}if(!_0x2f93f6['query']['hasOwnProperty']('nolimit')){_0x116825[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x2f93f6[_0x6235('0x40')][_0x6235('0x21')]);_0x116825['offset']=qs[_0x6235('0x20')](_0x2f93f6[_0x6235('0x40')][_0x6235('0x20')]);}return _0x3ed563[_0x6235('0xd0')](_0x116825);}})[_0x6235('0x13')](function(_0x3ce218){if(_0x3ce218){return _0x3ce218?{'count':_0x8e9a98,'rows':_0x3ce218}:null;}})['then'](respondWithResult(_0x33825c,null))[_0x6235('0x1d')](handleError(_0x33825c,null));};exports['getQueues']=function(_0x3d683e,_0x299668){var _0x30ff50;var _0x112fba={};var _0x18621e;return db['User']['findOne']({'where':{'id':_0x3d683e['params']['id']},'attributes':['id',_0x6235('0x34'),_0x6235('0x2a')]})[_0x6235('0x13')](handleEntityNotFound(_0x299668,null))['then'](function(_0x548ab7){if(!utils['isValidChannel'](_0x3d683e[_0x6235('0x40')][_0x6235('0x9d')])){throw new db[(_0x6235('0x95'))][(_0x6235('0x92'))](_0x6235('0xaf'));}_0x30ff50=_0x548ab7;var _0x248927={};_0x248927[_0x6235('0x54')]=_[_0x6235('0x56')](db[_[_0x6235('0xa5')](_0x3d683e['query'][_0x6235('0x9d')])+_0x6235('0xd7')]['rawAttributes']);_0x248927[_0x6235('0x40')]=_[_0x6235('0x56')](_0x3d683e[_0x6235('0x40')]);_0x248927[_0x6235('0x57')]=_['intersection'](_0x248927['model'],_0x248927['query']);_0x112fba['attributes']=_[_0x6235('0x58')](_0x248927['model'],qs[_0x6235('0x59')](_0x3d683e[_0x6235('0x40')][_0x6235('0x59')]));_0x112fba[_0x6235('0x46')]=_0x112fba[_0x6235('0x46')]['length']?_0x112fba[_0x6235('0x46')]:_0x248927['model'];_0x112fba[_0x6235('0xd8')]=qs[_0x6235('0xcc')](_0x3d683e[_0x6235('0x40')][_0x6235('0xcc')]);_0x112fba[_0x6235('0x3f')]=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x3d683e['query'],_0x248927[_0x6235('0x57')]));if(_0x3d683e[_0x6235('0x40')][_0x6235('0x30')]){_0x112fba['where']=_['merge'](_0x112fba[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x112fba[_0x6235('0x46')],function(_0x1e8ccd){var _0x4e9f7f={};_0x4e9f7f[_0x1e8ccd]={'$like':'%'+_0x3d683e[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x4e9f7f;})});}_0x112fba=_['merge']({},_0x112fba,_0x3d683e[_0x6235('0xcf')]);switch(_0x30ff50[_0x6235('0x2a')]){case'admin':return db[_[_0x6235('0xa5')](_0x3d683e[_0x6235('0x40')]['channel'])+_0x6235('0xd7')][_0x6235('0x8d')](_0x112fba);case _0x6235('0x2d'):case _0x6235('0x2e'):return _0x30ff50[_0x6235('0x29')+_[_0x6235('0xa5')](_0x3d683e[_0x6235('0x40')][_0x6235('0x9d')])+_0x6235('0xa3')](_0x112fba);default:throw new db[(_0x6235('0x95'))][(_0x6235('0x92'))](_0x6235('0xd9'));}})[_0x6235('0x13')](function(_0x234b17){_0x18621e=_0x234b17[_0x6235('0x4a')];if(!_0x3d683e[_0x6235('0x40')][_0x6235('0xd1')](_0x6235('0xda'))){_0x112fba[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x3d683e[_0x6235('0x40')][_0x6235('0x21')]);_0x112fba[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x3d683e['query']['offset']);}switch(_0x30ff50['role']){case _0x6235('0x2b'):return db[_[_0x6235('0xa5')](_0x3d683e[_0x6235('0x40')][_0x6235('0x9d')])+_0x6235('0xd7')]['findAll'](_0x112fba);case'user':case'agent':return _0x30ff50[_0x6235('0x29')+_[_0x6235('0xa5')](_0x3d683e[_0x6235('0x40')]['channel'])+_0x6235('0xa3')](_0x112fba);}})[_0x6235('0x13')](function(_0x3edb5a){return{'count':_0x18621e,'rows':_0x3edb5a};})[_0x6235('0x13')](respondWithResult(_0x299668,null))['catch'](handleError(_0x299668,null));};exports[_0x6235('0xdb')]=function(_0x1edeb3,_0x22e333){var _0x113602={};var _0xa9b4f2={};var _0x35adfc;var _0x5ed4da;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x1edeb3['params']['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x22e333,null))['then'](function(_0x321d25){if(_0x321d25){_0x35adfc=_0x321d25;_0xa9b4f2[_0x6235('0x54')]=_[_0x6235('0x56')](db[_0x6235('0xac')][_0x6235('0xcb')]);_0xa9b4f2[_0x6235('0x40')]=_['keys'](_0x1edeb3['query']);_0xa9b4f2[_0x6235('0x57')]=_[_0x6235('0x58')](_0xa9b4f2[_0x6235('0x54')],_0xa9b4f2[_0x6235('0x40')]);_0x113602['attributes']=_[_0x6235('0x58')](_0xa9b4f2[_0x6235('0x54')],qs[_0x6235('0x59')](_0x1edeb3[_0x6235('0x40')][_0x6235('0x59')]));_0x113602['attributes']=_0x113602[_0x6235('0x46')][_0x6235('0x4a')]?_0x113602[_0x6235('0x46')]:_0xa9b4f2[_0x6235('0x54')];_0x113602[_0x6235('0xd8')]=qs[_0x6235('0xcc')](_0x1edeb3[_0x6235('0x40')]['sort']);_0x113602[_0x6235('0x3f')]=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x1edeb3[_0x6235('0x40')],_0xa9b4f2[_0x6235('0x57')]));if(_0x1edeb3[_0x6235('0x40')]['filter']){_0x113602['where']=_[_0x6235('0xce')](_0x113602[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x113602['attributes'],function(_0x423d70){var _0x16ae94={};_0x16ae94[_0x423d70]={'$like':'%'+_0x1edeb3[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x16ae94;})});}_0x113602=_['merge']({},_0x113602,_0x1edeb3[_0x6235('0xcf')]);return _0x35adfc[_0x6235('0xdb')](_0x113602);}})['then'](function(_0x13f3a3){if(_0x13f3a3){_0x5ed4da=_0x13f3a3['length'];if(!_0x1edeb3[_0x6235('0x40')]['hasOwnProperty'](_0x6235('0xda'))){_0x113602[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x1edeb3[_0x6235('0x40')]['limit']);_0x113602[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x1edeb3[_0x6235('0x40')][_0x6235('0x20')]);}return _0x35adfc[_0x6235('0xdb')](_0x113602);}})[_0x6235('0x13')](function(_0x59c6be){if(_0x59c6be){return _0x59c6be?{'count':_0x5ed4da,'rows':_0x59c6be}:null;}})['then'](respondWithResult(_0x22e333,null))[_0x6235('0x1d')](handleError(_0x22e333,null));};exports[_0x6235('0xdc')]=function(_0x4b9135,_0x2f1599){var _0x134220={};var _0x1f915a={};var _0x66021d;var _0x350cea;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x4b9135[_0x6235('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f1599,null))['then'](function(_0x5d4ef3){if(_0x5d4ef3){_0x66021d=_0x5d4ef3;_0x1f915a['model']=_[_0x6235('0x56')](db['ChatGroup'][_0x6235('0xcb')]);_0x1f915a[_0x6235('0x40')]=_[_0x6235('0x56')](_0x4b9135[_0x6235('0x40')]);_0x1f915a[_0x6235('0x57')]=_[_0x6235('0x58')](_0x1f915a[_0x6235('0x54')],_0x1f915a['query']);_0x134220[_0x6235('0x46')]=_[_0x6235('0x58')](_0x1f915a['model'],qs[_0x6235('0x59')](_0x4b9135[_0x6235('0x40')]['fields']));_0x134220['attributes']=_0x134220[_0x6235('0x46')][_0x6235('0x4a')]?_0x134220[_0x6235('0x46')]:_0x1f915a[_0x6235('0x54')];_0x134220['order']=qs[_0x6235('0xcc')](_0x4b9135[_0x6235('0x40')][_0x6235('0xcc')]);_0x134220['where']=qs[_0x6235('0x57')](_['pick'](_0x4b9135[_0x6235('0x40')],_0x1f915a['filters']));if(_0x4b9135[_0x6235('0x40')][_0x6235('0x30')]){_0x134220[_0x6235('0x3f')]=_[_0x6235('0xce')](_0x134220[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x134220[_0x6235('0x46')],function(_0x3b2506){var _0x4de825={};_0x4de825[_0x3b2506]={'$like':'%'+_0x4b9135[_0x6235('0x40')]['filter']+'%'};return _0x4de825;})});}_0x134220=_[_0x6235('0xce')]({},_0x134220,_0x4b9135[_0x6235('0xcf')]);return _0x66021d['getGroups'](_0x134220);}})[_0x6235('0x13')](function(_0xb8274){if(_0xb8274){_0x350cea=_0xb8274[_0x6235('0x4a')];if(!_0x4b9135[_0x6235('0x40')][_0x6235('0xd1')](_0x6235('0xda'))){_0x134220['limit']=qs[_0x6235('0x21')](_0x4b9135[_0x6235('0x40')][_0x6235('0x21')]);_0x134220[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x4b9135[_0x6235('0x40')][_0x6235('0x20')]);}return _0x66021d['getGroups'](_0x134220);}})[_0x6235('0x13')](function(_0x5d9a30){if(_0x5d9a30){return _0x5d9a30?{'count':_0x350cea,'rows':_0x5d9a30}:null;}})[_0x6235('0x13')](respondWithResult(_0x2f1599,null))[_0x6235('0x1d')](handleError(_0x2f1599,null));};exports[_0x6235('0xdd')]=function(_0x572f0c,_0x11ae19){var _0x5505eb={'raw':!![],'where':{}};var _0x41ce93={};var _0xf67e2a={'count':0x0,'rows':[]};return db[_0x6235('0x39')]['findOne']({'where':{'id':_0x572f0c[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x11ae19,null))[_0x6235('0x13')](function(_0x2cf3de){if(_0x2cf3de){_0x41ce93[_0x6235('0x54')]=_[_0x6235('0x56')](db[_0x6235('0xde')][_0x6235('0xcb')]);_0x41ce93['query']=_[_0x6235('0x56')](_0x572f0c['query']);_0x41ce93['filters']=_['intersection'](_0x41ce93[_0x6235('0x54')],_0x41ce93['query']);_0x5505eb['attributes']=_[_0x6235('0x58')](_0x41ce93[_0x6235('0x54')],qs[_0x6235('0x59')](_0x572f0c['query']['fields']));_0x5505eb[_0x6235('0x46')]=_0x5505eb[_0x6235('0x46')]['length']?_0x5505eb[_0x6235('0x46')]:_0x41ce93[_0x6235('0x54')];if(!_0x572f0c[_0x6235('0x40')][_0x6235('0xd1')](_0x6235('0xda'))){_0x5505eb['limit']=qs['limit'](_0x572f0c[_0x6235('0x40')][_0x6235('0x21')]);_0x5505eb[_0x6235('0x20')]=qs['offset'](_0x572f0c[_0x6235('0x40')][_0x6235('0x20')]);}_0x5505eb[_0x6235('0xd8')]=qs['sort'](_0x572f0c[_0x6235('0x40')][_0x6235('0xcc')]);_0x5505eb['where']=qs[_0x6235('0x57')](_['pick'](_0x572f0c[_0x6235('0x40')],_0x41ce93[_0x6235('0x57')]));_0x5505eb['where'][_0x6235('0xdf')]=_0x2cf3de['id'];if(_0x572f0c[_0x6235('0x40')][_0x6235('0x30')]){_0x5505eb[_0x6235('0x3f')]=_['merge'](_0x5505eb[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x5505eb[_0x6235('0x46')],function(_0xe91812){var _0x56520d={};_0x56520d[_0xe91812]={'$like':'%'+_0x572f0c[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x56520d;})});}_0x5505eb=_['merge']({},_0x5505eb,_0x572f0c['options']);return db[_0x6235('0xde')]['count']({'where':_0x5505eb[_0x6235('0x3f')]})['then'](function(_0x1c7a15){_0xf67e2a[_0x6235('0x23')]=_0x1c7a15;if(_0x572f0c['query'][_0x6235('0x5a')]){_0x5505eb['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x6235('0x8d')](_0x5505eb);})[_0x6235('0x13')](function(_0xc9b1c0){_0xf67e2a['rows']=_0xc9b1c0;return _0xf67e2a;});}})['then'](respondWithFilteredResult(_0x11ae19,_0x5505eb))[_0x6235('0x1d')](handleError(_0x11ae19,null));};exports[_0x6235('0xe0')]=function(_0x128152,_0x523e41){var _0x4fcb82={'raw':!![],'where':{}};var _0x399a28={};var _0x15b5c1={'count':0x0,'rows':[]};return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x128152[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x523e41,null))[_0x6235('0x13')](function(_0xd563f9){if(_0xd563f9){_0x399a28['model']=_[_0x6235('0x56')](db[_0x6235('0xe1')][_0x6235('0xcb')]);_0x399a28[_0x6235('0x40')]=_[_0x6235('0x56')](_0x128152[_0x6235('0x40')]);_0x399a28[_0x6235('0x57')]=_[_0x6235('0x58')](_0x399a28[_0x6235('0x54')],_0x399a28[_0x6235('0x40')]);_0x4fcb82[_0x6235('0x46')]=_[_0x6235('0x58')](_0x399a28[_0x6235('0x54')],qs['fields'](_0x128152['query']['fields']));_0x4fcb82[_0x6235('0x46')]=_0x4fcb82[_0x6235('0x46')][_0x6235('0x4a')]?_0x4fcb82[_0x6235('0x46')]:_0x399a28[_0x6235('0x54')];if(!_0x128152['query'][_0x6235('0xd1')]('nolimit')){_0x4fcb82['limit']=qs['limit'](_0x128152[_0x6235('0x40')]['limit']);_0x4fcb82[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x128152['query'][_0x6235('0x20')]);}_0x4fcb82['order']=qs[_0x6235('0xcc')](_0x128152['query'][_0x6235('0xcc')]);_0x4fcb82[_0x6235('0x3f')]=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x128152[_0x6235('0x40')],_0x399a28[_0x6235('0x57')]));_0x4fcb82[_0x6235('0x3f')][_0x6235('0xdf')]=_0xd563f9['id'];if(_0x128152[_0x6235('0x40')][_0x6235('0x30')]){_0x4fcb82[_0x6235('0x3f')]=_[_0x6235('0xce')](_0x4fcb82[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x4fcb82[_0x6235('0x46')],function(_0x166d4d){var _0x2dc6b2={};_0x2dc6b2[_0x166d4d]={'$like':'%'+_0x128152[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x2dc6b2;})});}_0x4fcb82=_[_0x6235('0xce')]({},_0x4fcb82,_0x128152[_0x6235('0xcf')]);return db[_0x6235('0xe1')]['count']({'where':_0x4fcb82[_0x6235('0x3f')]})['then'](function(_0x508431){_0x15b5c1['count']=_0x508431;if(_0x128152[_0x6235('0x40')][_0x6235('0x5a')]){_0x4fcb82['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x6235('0x8d')](_0x4fcb82);})[_0x6235('0x13')](function(_0x547768){_0x15b5c1[_0x6235('0x48')]=_0x547768;return _0x15b5c1;});}})[_0x6235('0x13')](respondWithFilteredResult(_0x523e41,_0x4fcb82))['catch'](handleError(_0x523e41,null));};exports[_0x6235('0xe2')]=function(_0x176bdd,_0x1c65a0){var _0x1f705c={};var _0x1c92d1={};var _0x3c58dd;var _0x4679a6;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x176bdd[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x1c65a0,null))['then'](function(_0x18a994){if(_0x18a994){_0x3c58dd=_0x18a994;_0x1c92d1[_0x6235('0x54')]=_['keys'](db['ChatInteraction'][_0x6235('0xcb')]);_0x1c92d1[_0x6235('0x40')]=_['keys'](_0x176bdd[_0x6235('0x40')]);_0x1c92d1[_0x6235('0x57')]=_[_0x6235('0x58')](_0x1c92d1['model'],_0x1c92d1[_0x6235('0x40')]);_0x1f705c[_0x6235('0x46')]=_[_0x6235('0x58')](_0x1c92d1[_0x6235('0x54')],qs[_0x6235('0x59')](_0x176bdd[_0x6235('0x40')]['fields']));_0x1f705c[_0x6235('0x46')]=_0x1f705c[_0x6235('0x46')][_0x6235('0x4a')]?_0x1f705c['attributes']:_0x1c92d1[_0x6235('0x54')];_0x1f705c[_0x6235('0xd8')]=qs[_0x6235('0xcc')](_0x176bdd['query'][_0x6235('0xcc')]);_0x1f705c['where']=qs['filters'](_[_0x6235('0xcd')](_0x176bdd[_0x6235('0x40')],_0x1c92d1[_0x6235('0x57')]));if(_0x176bdd[_0x6235('0x40')][_0x6235('0x30')]){_0x1f705c['where']=_[_0x6235('0xce')](_0x1f705c[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x1f705c[_0x6235('0x46')],function(_0x35df3c){var _0x4f39b7={};_0x4f39b7[_0x35df3c]={'$like':'%'+_0x176bdd[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x4f39b7;})});}_0x1f705c=_[_0x6235('0xce')]({},_0x1f705c,_0x176bdd['options']);return _0x3c58dd[_0x6235('0xe2')](_0x1f705c);}})[_0x6235('0x13')](function(_0x5ad81d){if(_0x5ad81d){_0x4679a6=_0x5ad81d['length'];if(!_0x176bdd['query'][_0x6235('0xd1')](_0x6235('0xda'))){_0x1f705c[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x176bdd[_0x6235('0x40')][_0x6235('0x21')]);_0x1f705c[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x176bdd[_0x6235('0x40')]['offset']);}return _0x3c58dd[_0x6235('0xe2')](_0x1f705c);}})[_0x6235('0x13')](function(_0xbeb300){if(_0xbeb300){return _0xbeb300?{'count':_0x4679a6,'rows':_0xbeb300}:null;}})[_0x6235('0x13')](respondWithResult(_0x1c65a0,null))[_0x6235('0x1d')](handleError(_0x1c65a0,null));};exports[_0x6235('0xe3')]=function(_0x2657a6,_0x10653b){var _0x10bfe1={};var _0x21c083={};var _0x45629b;var _0x4a2348;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x2657a6[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x10653b,null))[_0x6235('0x13')](function(_0x3f83ac){if(_0x3f83ac){_0x45629b=_0x3f83ac;_0x21c083[_0x6235('0x54')]=_[_0x6235('0x56')](db[_0x6235('0xe4')][_0x6235('0xcb')]);_0x21c083[_0x6235('0x40')]=_[_0x6235('0x56')](_0x2657a6[_0x6235('0x40')]);_0x21c083[_0x6235('0x57')]=_['intersection'](_0x21c083[_0x6235('0x54')],_0x21c083['query']);_0x10bfe1[_0x6235('0x46')]=_[_0x6235('0x58')](_0x21c083[_0x6235('0x54')],qs['fields'](_0x2657a6['query'][_0x6235('0x59')]));_0x10bfe1[_0x6235('0x46')]=_0x10bfe1[_0x6235('0x46')]['length']?_0x10bfe1[_0x6235('0x46')]:_0x21c083[_0x6235('0x54')];_0x10bfe1['order']=qs['sort'](_0x2657a6[_0x6235('0x40')][_0x6235('0xcc')]);_0x10bfe1['where']=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x2657a6[_0x6235('0x40')],_0x21c083[_0x6235('0x57')]));if(_0x2657a6[_0x6235('0x40')]['filter']){_0x10bfe1[_0x6235('0x3f')]=_[_0x6235('0xce')](_0x10bfe1['where'],{'$or':_[_0x6235('0x32')](_0x10bfe1[_0x6235('0x46')],function(_0x4c3cac){var _0x2fb85a={};_0x2fb85a[_0x4c3cac]={'$like':'%'+_0x2657a6[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x2fb85a;})});}_0x10bfe1=_[_0x6235('0xce')]({},_0x10bfe1,_0x2657a6['options']);return _0x45629b['getOpenchannelInteractions'](_0x10bfe1);}})[_0x6235('0x13')](function(_0x1c4206){if(_0x1c4206){_0x4a2348=_0x1c4206[_0x6235('0x4a')];if(!_0x2657a6[_0x6235('0x40')]['hasOwnProperty'](_0x6235('0xda'))){_0x10bfe1[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x2657a6[_0x6235('0x40')]['limit']);_0x10bfe1[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x2657a6[_0x6235('0x40')][_0x6235('0x20')]);}return _0x45629b['getOpenchannelInteractions'](_0x10bfe1);}})[_0x6235('0x13')](function(_0x225f22){if(_0x225f22){return _0x225f22?{'count':_0x4a2348,'rows':_0x225f22}:null;}})[_0x6235('0x13')](respondWithResult(_0x10653b,null))[_0x6235('0x1d')](handleError(_0x10653b,null));};exports[_0x6235('0xe5')]=function(_0x505872,_0x47d1e2){var _0x17bec7={'raw':!![],'where':{}};var _0x5078d8={};var _0x401715={'count':0x0,'rows':[]};return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x505872[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x47d1e2,null))[_0x6235('0x13')](function(_0x2c4f22){if(_0x2c4f22){_0x5078d8[_0x6235('0x54')]=_[_0x6235('0x56')](db['MailInteraction'][_0x6235('0xcb')]);_0x5078d8[_0x6235('0x40')]=_['keys'](_0x505872[_0x6235('0x40')]);_0x5078d8['filters']=_[_0x6235('0x58')](_0x5078d8[_0x6235('0x54')],_0x5078d8[_0x6235('0x40')]);_0x17bec7[_0x6235('0x46')]=_[_0x6235('0x58')](_0x5078d8['model'],qs[_0x6235('0x59')](_0x505872[_0x6235('0x40')][_0x6235('0x59')]));_0x17bec7['attributes']=_0x17bec7[_0x6235('0x46')][_0x6235('0x4a')]?_0x17bec7[_0x6235('0x46')]:_0x5078d8['model'];if(!_0x505872[_0x6235('0x40')][_0x6235('0xd1')]('nolimit')){_0x17bec7[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x505872[_0x6235('0x40')][_0x6235('0x21')]);_0x17bec7[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x505872[_0x6235('0x40')][_0x6235('0x20')]);}_0x17bec7['order']=qs[_0x6235('0xcc')](_0x505872[_0x6235('0x40')][_0x6235('0xcc')]);_0x17bec7['where']=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x505872['query'],_0x5078d8[_0x6235('0x57')]));_0x17bec7[_0x6235('0x3f')][_0x6235('0xdf')]=_0x2c4f22['id'];if(_0x505872[_0x6235('0x40')][_0x6235('0x30')]){_0x17bec7[_0x6235('0x3f')]=_[_0x6235('0xce')](_0x17bec7[_0x6235('0x3f')],{'$or':_['map'](_0x17bec7[_0x6235('0x46')],function(_0x35bb97){var _0x47ef7e={};_0x47ef7e[_0x35bb97]={'$like':'%'+_0x505872[_0x6235('0x40')]['filter']+'%'};return _0x47ef7e;})});}_0x17bec7=_[_0x6235('0xce')]({},_0x17bec7,_0x505872[_0x6235('0xcf')]);return db[_0x6235('0xe6')][_0x6235('0x23')]({'where':_0x17bec7[_0x6235('0x3f')]})[_0x6235('0x13')](function(_0x2ed7e4){_0x401715[_0x6235('0x23')]=_0x2ed7e4;if(_0x505872['query']['includeAll']){_0x17bec7['include']=[{'all':!![]}];}return db['MailInteraction'][_0x6235('0x8d')](_0x17bec7);})[_0x6235('0x13')](function(_0x28a68f){_0x401715['rows']=_0x28a68f;return _0x401715;});}})[_0x6235('0x13')](respondWithFilteredResult(_0x47d1e2,_0x17bec7))[_0x6235('0x1d')](handleError(_0x47d1e2,null));};exports['getSmsInteractions']=function(_0x428792,_0x34913d){var _0x42c595={};var _0x5b04b2={};var _0x3232bb;var _0x298e1b;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x428792['params']['id']}})['then'](handleEntityNotFound(_0x34913d,null))[_0x6235('0x13')](function(_0x462880){if(_0x462880){_0x3232bb=_0x462880;_0x5b04b2[_0x6235('0x54')]=_[_0x6235('0x56')](db['SmsInteraction'][_0x6235('0xcb')]);_0x5b04b2[_0x6235('0x40')]=_[_0x6235('0x56')](_0x428792[_0x6235('0x40')]);_0x5b04b2[_0x6235('0x57')]=_[_0x6235('0x58')](_0x5b04b2[_0x6235('0x54')],_0x5b04b2['query']);_0x42c595['attributes']=_['intersection'](_0x5b04b2['model'],qs[_0x6235('0x59')](_0x428792[_0x6235('0x40')][_0x6235('0x59')]));_0x42c595[_0x6235('0x46')]=_0x42c595[_0x6235('0x46')][_0x6235('0x4a')]?_0x42c595['attributes']:_0x5b04b2[_0x6235('0x54')];_0x42c595[_0x6235('0xd8')]=qs[_0x6235('0xcc')](_0x428792[_0x6235('0x40')]['sort']);_0x42c595[_0x6235('0x3f')]=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x428792[_0x6235('0x40')],_0x5b04b2[_0x6235('0x57')]));if(_0x428792[_0x6235('0x40')][_0x6235('0x30')]){_0x42c595[_0x6235('0x3f')]=_[_0x6235('0xce')](_0x42c595[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x42c595[_0x6235('0x46')],function(_0x515061){var _0x2ba964={};_0x2ba964[_0x515061]={'$like':'%'+_0x428792[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x2ba964;})});}_0x42c595=_[_0x6235('0xce')]({},_0x42c595,_0x428792[_0x6235('0xcf')]);return _0x3232bb['getSmsInteractions'](_0x42c595);}})['then'](function(_0x34d19b){if(_0x34d19b){_0x298e1b=_0x34d19b['length'];if(!_0x428792[_0x6235('0x40')]['hasOwnProperty']('nolimit')){_0x42c595['limit']=qs[_0x6235('0x21')](_0x428792[_0x6235('0x40')][_0x6235('0x21')]);_0x42c595[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x428792[_0x6235('0x40')][_0x6235('0x20')]);}return _0x3232bb[_0x6235('0xe7')](_0x42c595);}})[_0x6235('0x13')](function(_0x3a22dd){if(_0x3a22dd){return _0x3a22dd?{'count':_0x298e1b,'rows':_0x3a22dd}:null;}})[_0x6235('0x13')](respondWithResult(_0x34913d,null))[_0x6235('0x1d')](handleError(_0x34913d,null));};exports['getFaxInteractions']=function(_0x49e4d6,_0x4a9359){var _0x3f6195={};var _0x482deb={};var _0x25441d;var _0x6e08d2;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x49e4d6[_0x6235('0x53')]['id']}})['then'](handleEntityNotFound(_0x4a9359,null))[_0x6235('0x13')](function(_0x59d806){if(_0x59d806){_0x25441d=_0x59d806;_0x482deb[_0x6235('0x54')]=_[_0x6235('0x56')](db['FaxInteraction'][_0x6235('0xcb')]);_0x482deb[_0x6235('0x40')]=_['keys'](_0x49e4d6[_0x6235('0x40')]);_0x482deb['filters']=_[_0x6235('0x58')](_0x482deb[_0x6235('0x54')],_0x482deb[_0x6235('0x40')]);_0x3f6195[_0x6235('0x46')]=_['intersection'](_0x482deb[_0x6235('0x54')],qs['fields'](_0x49e4d6[_0x6235('0x40')][_0x6235('0x59')]));_0x3f6195[_0x6235('0x46')]=_0x3f6195[_0x6235('0x46')][_0x6235('0x4a')]?_0x3f6195[_0x6235('0x46')]:_0x482deb['model'];_0x3f6195[_0x6235('0xd8')]=qs['sort'](_0x49e4d6[_0x6235('0x40')][_0x6235('0xcc')]);_0x3f6195[_0x6235('0x3f')]=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x49e4d6[_0x6235('0x40')],_0x482deb[_0x6235('0x57')]));if(_0x49e4d6[_0x6235('0x40')][_0x6235('0x30')]){_0x3f6195['where']=_['merge'](_0x3f6195['where'],{'$or':_[_0x6235('0x32')](_0x3f6195[_0x6235('0x46')],function(_0x554e16){var _0x713d87={};_0x713d87[_0x554e16]={'$like':'%'+_0x49e4d6[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x713d87;})});}_0x3f6195=_[_0x6235('0xce')]({},_0x3f6195,_0x49e4d6[_0x6235('0xcf')]);return _0x25441d[_0x6235('0xe8')](_0x3f6195);}})[_0x6235('0x13')](function(_0x16fe29){if(_0x16fe29){_0x6e08d2=_0x16fe29[_0x6235('0x4a')];if(!_0x49e4d6[_0x6235('0x40')][_0x6235('0xd1')]('nolimit')){_0x3f6195[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x49e4d6[_0x6235('0x40')][_0x6235('0x21')]);_0x3f6195['offset']=qs['offset'](_0x49e4d6['query'][_0x6235('0x20')]);}return _0x25441d[_0x6235('0xe8')](_0x3f6195);}})[_0x6235('0x13')](function(_0x7823c1){if(_0x7823c1){return _0x7823c1?{'count':_0x6e08d2,'rows':_0x7823c1}:null;}})[_0x6235('0x13')](respondWithResult(_0x4a9359,null))[_0x6235('0x1d')](handleError(_0x4a9359,null));};exports[_0x6235('0xe9')]=function(_0x13ee18,_0x532ffa){var _0x29c72a={};var _0x58aef0={};var _0x3f95bb;var _0x178845;return db[_0x6235('0x39')]['findOne']({'where':{'id':_0x13ee18[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x532ffa,null))['then'](function(_0x50dc8a){if(_0x50dc8a){_0x3f95bb=_0x50dc8a;_0x58aef0[_0x6235('0x54')]=_[_0x6235('0x56')](db[_0x6235('0xea')][_0x6235('0xcb')]);_0x58aef0[_0x6235('0x40')]=_[_0x6235('0x56')](_0x13ee18[_0x6235('0x40')]);_0x58aef0['filters']=_[_0x6235('0x58')](_0x58aef0[_0x6235('0x54')],_0x58aef0[_0x6235('0x40')]);_0x29c72a[_0x6235('0x46')]=_[_0x6235('0x58')](_0x58aef0[_0x6235('0x54')],qs[_0x6235('0x59')](_0x13ee18['query'][_0x6235('0x59')]));_0x29c72a[_0x6235('0x46')]=_0x29c72a[_0x6235('0x46')][_0x6235('0x4a')]?_0x29c72a['attributes']:_0x58aef0[_0x6235('0x54')];_0x29c72a[_0x6235('0xd8')]=qs[_0x6235('0xcc')](_0x13ee18[_0x6235('0x40')][_0x6235('0xcc')]);_0x29c72a[_0x6235('0x3f')]=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x13ee18['query'],_0x58aef0[_0x6235('0x57')]));if(_0x13ee18[_0x6235('0x40')][_0x6235('0x30')]){_0x29c72a['where']=_['merge'](_0x29c72a['where'],{'$or':_[_0x6235('0x32')](_0x29c72a[_0x6235('0x46')],function(_0x5b11c4){var _0x51467b={};_0x51467b[_0x5b11c4]={'$like':'%'+_0x13ee18['query'][_0x6235('0x30')]+'%'};return _0x51467b;})});}_0x29c72a=_[_0x6235('0xce')]({},_0x29c72a,_0x13ee18['options']);return _0x3f95bb[_0x6235('0xe9')](_0x29c72a);}})[_0x6235('0x13')](function(_0x3ba501){if(_0x3ba501){_0x178845=_0x3ba501[_0x6235('0x4a')];if(!_0x13ee18[_0x6235('0x40')][_0x6235('0xd1')](_0x6235('0xda'))){_0x29c72a[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x13ee18[_0x6235('0x40')][_0x6235('0x21')]);_0x29c72a[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x13ee18[_0x6235('0x40')][_0x6235('0x20')]);}return _0x3f95bb[_0x6235('0xe9')](_0x29c72a);}})[_0x6235('0x13')](function(_0x410891){if(_0x410891){return _0x410891?{'count':_0x178845,'rows':_0x410891}:null;}})[_0x6235('0x13')](respondWithResult(_0x532ffa,null))[_0x6235('0x1d')](handleError(_0x532ffa,null));};exports[_0x6235('0xeb')]=function(_0x21cce2,_0x526d6d,_0x1e3183){var _0xd256cf;var _0xd516;var _0x2132e8;var _0x1fcfe4=!_[_0x6235('0x68')](_0x21cce2[_0x6235('0x53')]['id'])?_0x21cce2[_0x6235('0x53')]['id']:!_[_0x6235('0x68')](_0x21cce2[_0x6235('0x2d')]['id'])?_0x21cce2[_0x6235('0x2d')]['id']:null;return db[_0x6235('0x39')]['find']({'where':{'id':_0x1fcfe4,'role':{'$or':[_0x6235('0x2b'),_0x6235('0x2d'),_0x6235('0x2e')]}},'attributes':['id','name',_0x6235('0xec'),'mobile',_0x6235('0x2a'),'internal',_0x6235('0xed')]})[_0x6235('0x13')](function(_0x2fc95c){if(_0x2fc95c){if(_0x2fc95c[_0x6235('0x2a')]==='agent'){_0xd256cf=_0x2fc95c;if(_0x21cce2[_0x6235('0x5d')][_0x6235('0x9f')]){_0x2132e8=util[_0x6235('0xa9')](_0x6235('0xee'),_0xd256cf[_0x21cce2[_0x6235('0x5d')]['interface']]);}else if(_0x21cce2['body']['intrf']){_0x2132e8=util['format'](_0x6235('0xaa'),_0x21cce2[_0x6235('0x5d')]['intrf']);}else{_0x2132e8=util['format'](_0x6235('0xaa'),_0xd256cf['name']);}socket['to'](util['format'](_0x6235('0xef'),_0xd256cf[_0x6235('0x34')]))[_0x6235('0xa7')]('user:forcelogout',{'user':{'id':_0xd256cf['id'],'name':_0xd256cf[_0x6235('0x34')]},'ip':_0x21cce2[_0x6235('0xf0')]['x-forwarded-for']||_0x21cce2[_0x6235('0xf1')][_0x6235('0xf2')]||_0x21cce2[_0x6235('0xf3')][_0x6235('0xf2')]||_0x21cce2[_0x6235('0xf1')][_0x6235('0xf3')][_0x6235('0xf2')]});return db[_0x6235('0xac')][_0x6235('0x28')]({'where':{'membername':_0xd256cf['name']},'individualHooks':!![]});}}else{throw new db[(_0x6235('0x95'))][(_0x6235('0x92'))](_0x6235('0xf4'));}})[_0x6235('0x13')](function(){if(_0xd256cf){return _0xd256cf[_0x6235('0xf5')]({'raw':!![]});}})[_0x6235('0x13')](function(_0x45a299){if(_0xd256cf){var _0x13741b=[];if(_0x45a299){_0xd516=_0x45a299;if(_0xd516[_0x6235('0x4a')]){for(var _0x52510b=0x0;_0x52510b<_0xd516['length'];_0x52510b++){_0x13741b[_0x6235('0x47')]({'membername':_0xd256cf[_0x6235('0x34')],'UserId':_0xd256cf['id'],'queue_name':_0xd516[_0x52510b][_0x6235('0x34')],'VoiceQueueId':_0xd516[_0x52510b]['id'],'interface':_0x2132e8,'paused':_0xd256cf[_0x6235('0xed')]||![],'penalty':_0xd516[_0x52510b]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x6235('0x8c')](_0x13741b,function(_0xa7f784){return db[_0x6235('0xac')][_0x6235('0xad')](_0xa7f784);});}}}})['then'](function(){if(_0xd256cf){return db[_0x6235('0xf6')][_0x6235('0x8d')]({'where':{'membername':_0xd256cf[_0x6235('0x34')],'exitAt':null}});}})[_0x6235('0x13')](function(_0x1f3404){if(_0xd256cf){var _0x3fb3f9=[];_0x1f3404['forEach'](function(_0x51252b){_0x3fb3f9[_0x6235('0x47')](_0x51252b[_0x6235('0x27')]({'exitAt':moment()[_0x6235('0xa9')](_0x6235('0xf7'))}));});return BPromise[_0x6235('0x51')](_0x3fb3f9);}})[_0x6235('0x13')](function(){if(_0xd256cf){var _0x53a643=[];var _0x5afee6=[];var _0x42de6a=utils[_0x6235('0xf8')]();var _0x10230a={'membername':_0xd256cf['name'],'interface':_0x2132e8,'enterAt':moment()[_0x6235('0xa9')](_0x6235('0xf7')),'role':_0xd256cf[_0x6235('0x2a')],'internal':_0xd256cf[_0x6235('0x62')]};_0x42de6a[_0x6235('0xf9')](function(_0x1345bd){_0x53a643[_0x6235('0x47')](_[_0x6235('0xce')]({'channel':_0x1345bd,'type':_0x6235('0xfa'),'data1':_0x21cce2['body'][_0x6235('0xfb')],'data2':_0x2132e8},_0x10230a));if(_0xd256cf[_0x6235('0xed')]){_0x5afee6[_0x6235('0x47')](_[_0x6235('0xce')]({'channel':_0x1345bd,'type':_0x6235('0xfc'),'data1':'LOGININPAUSE'},_0x10230a));}});return db[_0x6235('0xf6')][_0x6235('0x89')](_0x53a643[_0x6235('0xca')](_0x5afee6),{'individualHooks':!![]});}})['then'](function(){if(_0xd256cf){return _0xd256cf['update']({'online':!![],'lastLoginAt':moment()[_0x6235('0xa9')](_0x6235('0xf7')),'voicePause':_0xd256cf[_0x6235('0xed')]||![],'mailPause':_0xd256cf[_0x6235('0xed')]||![],'chatPause':_0xd256cf[_0x6235('0xed')]||![],'faxPause':_0xd256cf['loginInPause']||![],'smsPause':_0xd256cf['loginInPause']||![],'openchannelPause':_0xd256cf[_0x6235('0xed')]||![],'whatsappPause':_0xd256cf[_0x6235('0xed')]||![],'pauseType':_0xd256cf[_0x6235('0xed')]?_0x6235('0xfd'):null,'interface':_0x2132e8,'lastPauseAt':moment()[_0x6235('0xa9')](_0x6235('0xf7'))});}})[_0x6235('0x13')](function(_0x11a810){if(_0x21cce2[_0x6235('0xfe')]){return _0x1e3183();}else{return BPromise[_0x6235('0xff')](_0x11a810)[_0x6235('0x13')](respondWithResult(_0x526d6d,null));}})[_0x6235('0x1d')](handleError(_0x526d6d,null));};exports[_0x6235('0x100')]=function(_0x86cf08,_0x523dfc){var _0x551322;return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x86cf08[_0x6235('0x53')]['id'],'role':_0x6235('0x2e')},'attributes':['id',_0x6235('0x34'),_0x6235('0x2a')]})[_0x6235('0x13')](handleEntityNotFound(_0x523dfc,null))[_0x6235('0x13')](function(_0x4f2728){if(_0x4f2728){_0x551322=_0x4f2728;return db[_0x6235('0xac')][_0x6235('0x28')]({'where':{'membername':_0x551322[_0x6235('0x34')]},'individualHooks':!![]});}})[_0x6235('0x13')](function(){return db[_0x6235('0xf6')]['findAll']({'where':{'membername':_0x551322[_0x6235('0x34')],'exitAt':null}});})[_0x6235('0x13')](function(_0x460e85){var _0x3472f3=[];_0x460e85[_0x6235('0xf9')](function(_0x14e533){_0x3472f3[_0x6235('0x47')](_0x14e533[_0x6235('0x27')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6235('0x51')](_0x3472f3);})[_0x6235('0x13')](function(){return _0x551322['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6235('0x13')](respondWithResult(_0x523dfc,null))[_0x6235('0x1d')](handleError(_0x523dfc,null));};exports[_0x6235('0x101')]=function(_0x217cd7,_0x21149b){var _0x39a98e;return db[_0x6235('0xac')][_0x6235('0x27')]({'paused':0x1},{'where':{'UserId':_0x217cd7['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x217cd7['params']['id'],'role':'agent'},'attributes':['id',_0x6235('0x34'),_0x6235('0x2a'),'internal',_0x6235('0x9f')]});})[_0x6235('0x13')](handleEntityNotFound(_0x21149b,null))['then'](function(_0x4dd1dc){if(_0x4dd1dc){_0x39a98e=_0x4dd1dc;return respondWithRpcPromise(_0x6235('0x102'),'pause',{'id':_0x39a98e['id'],'name':_0x39a98e['name'],'pause':!![]});}})[_0x6235('0x13')](function(){if(_0x39a98e){return db[_0x6235('0xf6')]['findAll']({'where':{'membername':_0x39a98e[_0x6235('0x34')],'type':_0x6235('0xfc'),'exitAt':null}});}})[_0x6235('0x13')](function(_0x2bd904){if(_0x2bd904[_0x6235('0x4a')]){var _0x13d248=moment()[_0x6235('0xa9')](_0x6235('0xf7'));for(var _0x499ade=0x0,_0x49c859=_0x2bd904['length'];_0x499ade<_0x49c859;_0x499ade++){_0x2bd904[_0x499ade][_0x6235('0x103')]({'exitAt':_0x13d248});}}})['then'](function(){var _0x511ce3=[];var _0x473739=utils['getChannels']();_0x473739[_0x6235('0xf9')](function(_0x3924fe){_0x511ce3['push']({'channel':_0x3924fe,'membername':_0x39a98e['name'],'interface':_['isNil'](_0x39a98e['interface'])?util['format'](_0x6235('0xaa'),_0x39a98e[_0x6235('0x34')]):_0x39a98e['interface'],'type':_0x6235('0xfc'),'enterAt':moment()[_0x6235('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x217cd7['body']['type']||_0x6235('0x104'),'role':_0x39a98e['role'],'internal':_0x39a98e['internal']});});return db[_0x6235('0xf6')]['bulkCreate'](_0x511ce3,{'individualHooks':!![]});})[_0x6235('0x13')](function(){return _0x39a98e[_0x6235('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x217cd7['body'][_0x6235('0x3b')]||_0x6235('0x104'),'lastPauseAt':moment()['format'](_0x6235('0xf7'))});})['then'](respondWithResult(_0x21149b,null))[_0x6235('0x1d')](handleError(_0x21149b,null));};exports[_0x6235('0x105')]=function(_0x845a30,_0x5e3900){var _0x44a355;return db[_0x6235('0x39')][_0x6235('0x5b')]({'where':{'id':_0x845a30[_0x6235('0x53')]['id']},'attributes':['id','name','role',_0x6235('0xab'),_0x6235('0x106'),_0x6235('0x107'),_0x6235('0x108'),_0x6235('0x109'),_0x6235('0x10a'),_0x6235('0x10b'),'pauseType','lastPauseAt']})[_0x6235('0x13')](handleEntityNotFound(_0x5e3900,null))[_0x6235('0x13')](function(_0x36c8da){if(_0x36c8da){_0x44a355=_0x36c8da;if(_0x845a30[_0x6235('0x5d')][_0x6235('0x9d')]&&!utils[_0x6235('0xa0')](_0x845a30[_0x6235('0x5d')][_0x6235('0x9d')])){throw new db[(_0x6235('0x95'))][(_0x6235('0x92'))]('Unknown\x20channel');}switch(_0x845a30[_0x6235('0x5d')][_0x6235('0x9d')]){case _0x6235('0xa8'):return respondWithRpcPromise(_0x6235('0x102'),_0x6235('0x105'),{'id':_0x44a355['id'],'name':_0x44a355[_0x6235('0x34')],'pause':![]})[_0x6235('0x13')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x44a355['id']},'individualHooks':!![]});})[_0x6235('0x13')](function(){return db[_0x6235('0xf6')][_0x6235('0x5b')]({'where':{'channel':_0x845a30[_0x6235('0x5d')][_0x6235('0x9d')],'membername':_0x44a355[_0x6235('0x34')],'type':_0x6235('0xfc'),'exitAt':null}});})[_0x6235('0x13')](function(_0x12fadb){if(_0x12fadb){return _0x12fadb['update']({'exitAt':moment()[_0x6235('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6235('0x10c')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x44a355['update']({'voicePause':![]});});case'mail':case _0x6235('0x4b'):case _0x6235('0x4e'):case _0x6235('0x4d'):case _0x6235('0x5c'):case'openchannel':return db[_0x6235('0xf6')][_0x6235('0x5b')]({'where':{'channel':_0x845a30['body'][_0x6235('0x9d')],'membername':_0x44a355[_0x6235('0x34')],'type':_0x6235('0xfc'),'exitAt':null}})['then'](function(_0x5099ed){if(_0x5099ed){return _0x5099ed[_0x6235('0x27')]({'exitAt':moment()[_0x6235('0xa9')](_0x6235('0xf7')),'data2':_0x6235('0x10c')},{'individualHooks':!![]});}return null;})[_0x6235('0x13')](function(){var _0x496b85={};_['set'](_0x496b85,util[_0x6235('0xa9')](_0x6235('0x10d'),_0x845a30[_0x6235('0x5d')][_0x6235('0x9d')],_0x6235('0x10e')),![]);return _0x44a355[_0x6235('0x27')](_0x496b85);});default:return respondWithRpcPromise(_0x6235('0x102'),'unpause',{'id':_0x44a355['id'],'name':_0x44a355['name'],'pause':![]})[_0x6235('0x13')](function(){return db['UserVoiceQueueRt'][_0x6235('0x27')]({'paused':0x0},{'where':{'UserId':_0x44a355['id']}});})[_0x6235('0x13')](function(){return db['MemberReport'][_0x6235('0x8d')]({'where':{'membername':_0x44a355['name'],'type':_0x6235('0xfc'),'exitAt':null}});})[_0x6235('0x13')](function(_0x1eb62d){var _0x2ee8c9=[];_0x1eb62d['forEach'](function(_0x391155){_0x2ee8c9[_0x6235('0x47')](_0x391155[_0x6235('0x27')]({'exitAt':moment()[_0x6235('0xa9')](_0x6235('0xf7')),'data2':_0x6235('0x10c')}));});return BPromise['all'](_0x2ee8c9);})['then'](function(){return _0x44a355[_0x6235('0x27')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x6235('0x13')](respondWithResult(_0x5e3900,null))[_0x6235('0x1d')](handleError(_0x5e3900,null));};exports[_0x6235('0x10f')]=function(_0x5c3237,_0x336973){var _0x399933={};var _0x434eca={};var _0x5bdd4f;var _0x486b73;return db['User'][_0x6235('0x98')]({'where':{'id':_0x5c3237[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x336973,null))[_0x6235('0x13')](function(_0x1b3957){if(_0x1b3957){_0x5bdd4f=_0x1b3957;_0x434eca[_0x6235('0x54')]=_[_0x6235('0x56')](db[_0x6235('0x110')]['rawAttributes']);_0x434eca[_0x6235('0x40')]=_[_0x6235('0x56')](_0x5c3237[_0x6235('0x40')]);_0x434eca[_0x6235('0x57')]=_[_0x6235('0x58')](_0x434eca[_0x6235('0x54')],_0x434eca[_0x6235('0x40')]);_0x399933[_0x6235('0x46')]=_[_0x6235('0x58')](_0x434eca[_0x6235('0x54')],qs[_0x6235('0x59')](_0x5c3237[_0x6235('0x40')][_0x6235('0x59')]));_0x399933['attributes']=_0x399933[_0x6235('0x46')][_0x6235('0x4a')]?_0x399933[_0x6235('0x46')]:_0x434eca[_0x6235('0x54')];_0x399933['order']=qs[_0x6235('0xcc')](_0x5c3237['query']['sort']);_0x399933['where']=qs[_0x6235('0x57')](_['pick'](_0x5c3237['query'],_0x434eca['filters']));if(_0x5c3237[_0x6235('0x40')][_0x6235('0x30')]){_0x399933['where']=_[_0x6235('0xce')](_0x399933[_0x6235('0x3f')],{'$or':_['map'](_0x399933[_0x6235('0x46')],function(_0x2d2eb8){var _0x4a3c97={};_0x4a3c97[_0x2d2eb8]={'$like':'%'+_0x5c3237[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x4a3c97;})});}_0x399933=_[_0x6235('0xce')]({},_0x399933,_0x5c3237[_0x6235('0xcf')]);return _0x5bdd4f[_0x6235('0x10f')](_0x399933);}})[_0x6235('0x13')](function(_0x30e9f3){if(_0x30e9f3){_0x486b73=_0x30e9f3[_0x6235('0x4a')];if(!_0x5c3237[_0x6235('0x40')][_0x6235('0xd1')](_0x6235('0xda'))){_0x399933[_0x6235('0x21')]=qs['limit'](_0x5c3237['query'][_0x6235('0x21')]);_0x399933[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x5c3237[_0x6235('0x40')]['offset']);}return _0x5bdd4f['getTeams'](_0x399933);}})[_0x6235('0x13')](function(_0x4049c1){if(_0x4049c1){return _0x4049c1?{'count':_0x486b73,'rows':_0x4049c1}:null;}})[_0x6235('0x13')](respondWithResult(_0x336973,null))[_0x6235('0x1d')](handleError(_0x336973,null));};exports[_0x6235('0x111')]=function(_0x1dca88,_0xa3e9c0){return db[_0x6235('0x39')]['find']({'where':{'id':_0x1dca88[_0x6235('0x53')]['id']}})['then'](handleEntityNotFound(_0xa3e9c0,null))['then'](function(_0x1ee574){if(_0x1ee574){var _0x4ca204=_0x1ee574[_0x6235('0x29')]({'plain':!![]});return _0x1ee574['addTeams'](_0x1dca88[_0x6235('0x5d')][_0x6235('0x61')],_[_0x6235('0x60')](_0x1dca88[_0x6235('0x5d')],[_0x6235('0x61'),'id'])||{})[_0x6235('0x13')](function(){for(var _0x5935db=0x0;_0x5935db<_0x1dca88[_0x6235('0x5d')]['ids'][_0x6235('0x4a')];_0x5935db++){var _0x3536ad=[];var _0x3e5d24={};db[_0x6235('0x110')][_0x6235('0x98')]({'where':{'id':_0x1dca88['body'][_0x6235('0x61')][_0x5935db]}})[_0x6235('0x13')](function(_0x202c2e){_0x3e5d24=_0x202c2e['dataValues'];_0x3536ad[_0x6235('0x47')](_0x202c2e[_0x6235('0xf5')]()[_0x6235('0x13')](function(_0x4ee8e2){for(var _0x2b8c90=0x0;_0x2b8c90<_0x4ee8e2['length'];_0x2b8c90++){_0x4ee8e2[_0x2b8c90][_0x6235('0x112')](_0x6235('0x9d'),_0x6235('0x113'));}return _0x4ee8e2;}));_0x3536ad[_0x6235('0x47')](_0x202c2e[_0x6235('0x114')]()[_0x6235('0x13')](function(_0x375055){for(var _0x49cb1e=0x0;_0x49cb1e<_0x375055[_0x6235('0x4a')];_0x49cb1e++){_0x375055[_0x49cb1e][_0x6235('0x112')](_0x6235('0x9d'),_0x6235('0x115'));}return _0x375055;}));_0x3536ad[_0x6235('0x47')](_0x202c2e[_0x6235('0x116')]()['then'](function(_0xf45407){for(var _0x5927d0=0x0;_0x5927d0<_0xf45407[_0x6235('0x4a')];_0x5927d0++){_0xf45407[_0x5927d0]['setDataValue'](_0x6235('0x9d'),'Mail');}return _0xf45407;}));_0x3536ad[_0x6235('0x47')](_0x202c2e[_0x6235('0x117')]()[_0x6235('0x13')](function(_0x2124a6){for(var _0xd69566=0x0;_0xd69566<_0x2124a6[_0x6235('0x4a')];_0xd69566++){_0x2124a6[_0xd69566][_0x6235('0x112')](_0x6235('0x9d'),'Sms');}return _0x2124a6;}));_0x3536ad[_0x6235('0x47')](_0x202c2e[_0x6235('0x118')]()['then'](function(_0x449b7e){for(var _0x1fd527=0x0;_0x1fd527<_0x449b7e['length'];_0x1fd527++){_0x449b7e[_0x1fd527][_0x6235('0x112')](_0x6235('0x9d'),_0x6235('0x119'));}return _0x449b7e;}));_0x3536ad[_0x6235('0x47')](_0x202c2e[_0x6235('0x11a')]()['then'](function(_0x12282d){for(var _0x56a0d3=0x0;_0x56a0d3<_0x12282d[_0x6235('0x4a')];_0x56a0d3++){_0x12282d[_0x56a0d3][_0x6235('0x112')]('channel','Fax');}return _0x12282d;}));_0x3536ad['push'](_0x202c2e[_0x6235('0x11b')]()[_0x6235('0x13')](function(_0x1f61bf){for(var _0x5cc2b7=0x0;_0x5cc2b7<_0x1f61bf['length'];_0x5cc2b7++){_0x1f61bf[_0x5cc2b7]['setDataValue'](_0x6235('0x9d'),_0x6235('0x11c'));}return _0x1f61bf;}));return BPromise[_0x6235('0x51')](_0x3536ad);})['then'](function(_0x18b3fc){var _0x138f8a=_[_0x6235('0x11d')](_0x18b3fc);_0x3536ad=[];return db[_0x6235('0x6a')][_0x6235('0x11e')](function(_0x24ea6d){for(var _0x488d0a=0x0;_0x488d0a<_0x138f8a[_0x6235('0x4a')];_0x488d0a++){_0x3536ad[_0x6235('0x47')](_0x138f8a[_0x488d0a]['addAgent'](_0x4ca204['id']),{'transaction':_0x24ea6d});}return BPromise[_0x6235('0x51')](_0x3536ad)['then'](function(){if(_0x4ca204['online']){return BPromise['each'](_['filter'](_0x138f8a,function(_0x32ef1f){return _0x32ef1f[_0x6235('0x11f')]('channel')===_0x6235('0x113');}),function(_0x217f7b){return db[_0x6235('0xac')][_0x6235('0xad')]({'membername':_0x4ca204[_0x6235('0x34')],'UserId':_0x4ca204['id'],'queue_name':_0x217f7b[_0x6235('0x34')],'VoiceQueueId':_0x217f7b['id'],'interface':_[_0x6235('0x68')](_0x4ca204[_0x6235('0x9f')])?util[_0x6235('0xa9')](_0x6235('0xaa'),_0x4ca204['name']):_0x4ca204[_0x6235('0x9f')],'paused':_0x4ca204[_0x6235('0xab')]||![],'penalty':_0x4ca204[_0x6235('0xa4')]},{'transaction':_0x24ea6d});});}else{return;}})['then'](function(){for(var _0x584995=0x0;_0x584995<_0x138f8a[_0x6235('0x4a')];_0x584995++){var _0x120188=_0x138f8a[_0x584995]['getDataValue'](_0x6235('0x9d'));var _0x3f505b=_0x120188+_0x6235('0xa6');socket[_0x6235('0xa7')](_0x6235('0x2d')+_0x120188+'Queue:save',{'UserId':_0x4ca204['id'],['queueField']:_0x138f8a[_0x584995]['id']});}});});})[_0x6235('0x13')](function(){db[_0x6235('0x120')]['findOne']({'where':{'teamId':_0x3e5d24['id']}})[_0x6235('0x13')](function(_0xdb66de){if(_0xdb66de){db[_0x6235('0x121')]['create']({'UserId':_0x1dca88[_0x6235('0x53')]['id'],'VoicePrefixId':_0xdb66de[_0x6235('0x122')]});}});});}});}})[_0x6235('0x13')](respondWithStatusCode(_0xa3e9c0,null))[_0x6235('0x1d')](handleError(_0xa3e9c0,null));};exports['removeTeams']=function(_0x1df79d,_0x2a3305){return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x1df79d[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x2a3305,null))[_0x6235('0x13')](function(_0x5a5171){if(_0x5a5171){var _0x642a54=_0x5a5171[_0x6235('0x29')]({'plain':!![]});var _0x397e74=_0x1df79d['query']['ids'];return _0x5a5171[_0x6235('0x123')](_0x397e74)[_0x6235('0x13')](function(){for(var _0xe2e0b5=0x0;_0xe2e0b5<_0x397e74[_0x6235('0x4a')];_0xe2e0b5++){var _0x2a2f37=[];var _0x3570cf={};db[_0x6235('0x110')][_0x6235('0x98')]({'where':{'id':_0x397e74[_0xe2e0b5]}})['then'](function(_0x190f03){_0x3570cf=_0x190f03[_0x6235('0x4c')];_0x2a2f37[_0x6235('0x47')](_0x190f03[_0x6235('0xf5')]()[_0x6235('0x13')](function(_0x5c8eec){for(var _0x4efd6b=0x0;_0x4efd6b<_0x5c8eec[_0x6235('0x4a')];_0x4efd6b++){_0x5c8eec[_0x4efd6b][_0x6235('0x112')](_0x6235('0x9d'),'Voice');}return _0x5c8eec;}));_0x2a2f37['push'](_0x190f03[_0x6235('0x114')]()[_0x6235('0x13')](function(_0x517451){for(var _0x3ab678=0x0;_0x3ab678<_0x517451[_0x6235('0x4a')];_0x3ab678++){_0x517451[_0x3ab678]['setDataValue'](_0x6235('0x9d'),_0x6235('0x115'));}return _0x517451;}));_0x2a2f37[_0x6235('0x47')](_0x190f03['getMailQueues']()[_0x6235('0x13')](function(_0x5f0c9a){for(var _0x29a3eb=0x0;_0x29a3eb<_0x5f0c9a['length'];_0x29a3eb++){_0x5f0c9a[_0x29a3eb][_0x6235('0x112')](_0x6235('0x9d'),_0x6235('0x124'));}return _0x5f0c9a;}));_0x2a2f37[_0x6235('0x47')](_0x190f03[_0x6235('0x117')]()[_0x6235('0x13')](function(_0x4f14d0){for(var _0x490b06=0x0;_0x490b06<_0x4f14d0[_0x6235('0x4a')];_0x490b06++){_0x4f14d0[_0x490b06][_0x6235('0x112')](_0x6235('0x9d'),'Sms');}return _0x4f14d0;}));_0x2a2f37[_0x6235('0x47')](_0x190f03[_0x6235('0x118')]()[_0x6235('0x13')](function(_0x3b2c48){for(var _0x1421c8=0x0;_0x1421c8<_0x3b2c48[_0x6235('0x4a')];_0x1421c8++){_0x3b2c48[_0x1421c8][_0x6235('0x112')](_0x6235('0x9d'),_0x6235('0x119'));}return _0x3b2c48;}));_0x2a2f37[_0x6235('0x47')](_0x190f03['getFaxQueues']()[_0x6235('0x13')](function(_0x3e10a8){for(var _0x14d7aa=0x0;_0x14d7aa<_0x3e10a8[_0x6235('0x4a')];_0x14d7aa++){_0x3e10a8[_0x14d7aa][_0x6235('0x112')](_0x6235('0x9d'),_0x6235('0x125'));}return _0x3e10a8;}));_0x2a2f37['push'](_0x190f03[_0x6235('0x11b')]()[_0x6235('0x13')](function(_0x32ae37){for(var _0x40ddc3=0x0;_0x40ddc3<_0x32ae37[_0x6235('0x4a')];_0x40ddc3++){_0x32ae37[_0x40ddc3]['setDataValue'](_0x6235('0x9d'),_0x6235('0x11c'));}return _0x32ae37;}));return BPromise[_0x6235('0x51')](_0x2a2f37);})[_0x6235('0x13')](function(_0x5b5167){var _0xc240b2=_['flatten'](_0x5b5167);_0x2a2f37=[];return db[_0x6235('0x6a')][_0x6235('0x11e')](function(_0x3d9153){for(var _0x1aecb7=0x0;_0x1aecb7<_0xc240b2[_0x6235('0x4a')];_0x1aecb7++){_0x2a2f37[_0x6235('0x47')](_0xc240b2[_0x1aecb7][_0x6235('0x126')](_0x642a54['id']),{'transaction':_0x3d9153});}return BPromise[_0x6235('0x51')](_0x2a2f37)[_0x6235('0x13')](function(){if(_0x642a54['online']){return BPromise[_0x6235('0x8c')](_[_0x6235('0x30')](_0xc240b2,function(_0x528144){return _0x528144['getDataValue'](_0x6235('0x9d'))===_0x6235('0x113');}),function(_0x4b3f32){return db[_0x6235('0xac')]['destroy']({'where':{'VoiceQueueId':_0x4b3f32['id'],'UserId':_0x642a54['id']},'transaction':_0x3d9153});});}else{return;}})[_0x6235('0x13')](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x3570cf['id']}})[_0x6235('0x13')](function(_0x3cd141){if(_0x3cd141){return db[_0x6235('0x121')][_0x6235('0x28')]({'where':{'UserId':_0x642a54['id'],'VoicePrefixId':_0x3cd141[_0x6235('0x4c')][_0x6235('0x122')]}});}});})[_0x6235('0x13')](function(){for(var _0x7eadd2=0x0;_0x7eadd2<_0xc240b2['length'];_0x7eadd2++){var _0x38b68c=_0xc240b2[_0x7eadd2][_0x6235('0x11f')](_0x6235('0x9d'));var _0x4a7fa9=_0x38b68c+_0x6235('0xa6');socket[_0x6235('0xa7')](_0x6235('0x2d')+_0x38b68c+_0x6235('0x127'),{'UserId':_0x642a54['id'],['queueField']:_0xc240b2[_0x7eadd2]['id']});}});});});}});}})[_0x6235('0x13')](respondWithStatusCode(_0x2a3305,null))[_0x6235('0x1d')](handleError(_0x2a3305,null));};exports[_0x6235('0x128')]=function(_0x2e5ba2,_0x522724){var _0x282404={};var _0x4a7617={};var _0x158f44;var _0x51ab82;return db[_0x6235('0x39')][_0x6235('0x98')]({'where':{'id':_0x2e5ba2[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x522724,null))['then'](function(_0x54d695){if(_0x54d695){_0x158f44=_0x54d695;_0x4a7617['model']=_[_0x6235('0x56')](db['CmList'][_0x6235('0xcb')]);_0x4a7617['query']=_[_0x6235('0x56')](_0x2e5ba2[_0x6235('0x40')]);_0x4a7617['filters']=_[_0x6235('0x58')](_0x4a7617['model'],_0x4a7617[_0x6235('0x40')]);_0x282404[_0x6235('0x46')]=_[_0x6235('0x58')](_0x4a7617[_0x6235('0x54')],qs[_0x6235('0x59')](_0x2e5ba2[_0x6235('0x40')][_0x6235('0x59')]));_0x282404[_0x6235('0x46')]=_0x282404[_0x6235('0x46')][_0x6235('0x4a')]?_0x282404[_0x6235('0x46')]:_0x4a7617[_0x6235('0x54')];_0x282404[_0x6235('0xd8')]=qs[_0x6235('0xcc')](_0x2e5ba2['query'][_0x6235('0xcc')]);_0x282404['where']=qs[_0x6235('0x57')](_[_0x6235('0xcd')](_0x2e5ba2[_0x6235('0x40')],_0x4a7617['filters']));if(_0x2e5ba2[_0x6235('0x40')][_0x6235('0x30')]){_0x282404[_0x6235('0x3f')]=_[_0x6235('0xce')](_0x282404[_0x6235('0x3f')],{'$or':_['map'](_0x282404['attributes'],function(_0x5ae61b){var _0x350294={};_0x350294[_0x5ae61b]={'$like':'%'+_0x2e5ba2[_0x6235('0x40')]['filter']+'%'};return _0x350294;})});}_0x282404=_[_0x6235('0xce')]({},_0x282404,_0x2e5ba2[_0x6235('0xcf')]);return _0x158f44[_0x6235('0x128')](_0x282404);}})[_0x6235('0x13')](function(_0x4ea916){if(_0x4ea916){_0x51ab82=_0x4ea916['length'];if(!_0x2e5ba2['query'][_0x6235('0xd1')](_0x6235('0xda'))){_0x282404[_0x6235('0x21')]=qs[_0x6235('0x21')](_0x2e5ba2['query'][_0x6235('0x21')]);_0x282404[_0x6235('0x20')]=qs[_0x6235('0x20')](_0x2e5ba2['query']['offset']);}return _0x158f44[_0x6235('0x128')](_0x282404);}})[_0x6235('0x13')](function(_0x542135){if(_0x542135){return _0x542135?{'count':_0x51ab82,'rows':_0x542135}:null;}})[_0x6235('0x13')](respondWithResult(_0x522724,null))['catch'](handleError(_0x522724,null));};exports[_0x6235('0x129')]=function(_0x4f60df,_0x41f913){var _0x5620b1={};var _0x36d643={};var _0x486bd8;return db['User'][_0x6235('0x98')]({'where':{'id':_0x4f60df[_0x6235('0x53')]['id']}})[_0x6235('0x13')](handleEntityNotFound(_0x41f913,null))[_0x6235('0x13')](function(_0x51cba5){if(_0x51cba5){_0x486bd8=_0x51cba5;_0x36d643[_0x6235('0x54')]=_['keys'](db[_0x6235('0x39')][_0x6235('0xcb')]);_0x36d643[_0x6235('0x40')]=_[_0x6235('0x56')](_0x4f60df[_0x6235('0x40')]);_0x36d643[_0x6235('0x57')]=_[_0x6235('0x58')](_0x36d643['model'],_0x36d643[_0x6235('0x40')]);_0x5620b1[_0x6235('0x46')]=_[_0x6235('0x58')](_0x36d643[_0x6235('0x54')],qs[_0x6235('0x59')](_0x4f60df['query'][_0x6235('0x59')]));_0x5620b1[_0x6235('0x46')]=_0x5620b1[_0x6235('0x46')][_0x6235('0x4a')]?_0x5620b1['attributes']:_0x36d643[_0x6235('0x54')];_0x5620b1['order']=qs['sort'](_0x4f60df[_0x6235('0x40')][_0x6235('0xcc')]);_0x5620b1['where']=qs['filters'](_[_0x6235('0xcd')](_0x4f60df['query'],_0x36d643[_0x6235('0x57')]));if(_0x4f60df[_0x6235('0x40')]['filter']){_0x5620b1['where']=_[_0x6235('0xce')](_0x5620b1[_0x6235('0x3f')],{'$or':_[_0x6235('0x32')](_0x5620b1[_0x6235('0x46')],function(_0x1fe3e4){var _0x40f66d={};_0x40f66d[_0x1fe3e4]={'$like':'%'+_0x4f60df[_0x6235('0x40')][_0x6235('0x30')]+'%'};return _0x40f66d;})});}_0x5620b1[_0x6235('0x54')]=db['User'];_0x5620b1['as']='Agents';_0x5620b1=_[_0x6235('0xce')]({},_0x5620b1,_0x4f60df[_0x6235('0xcf')]);return _0x486bd8[_0x6235('0xf5')]({'include':[_0x5620b1]});}})[_0x6235('0x13')](function(_0xaf324e){if(_0xaf324e){var _0x62b3d9={},_0xb75493=[];for(var _0xd4d8fe=0x0;_0xd4d8fe<_0xaf324e[_0x6235('0x4a')];_0xd4d8fe+=0x1){for(var _0x5ae1be=0x0,_0x2872ca;_0x5ae1be<_0xaf324e[_0xd4d8fe][_0x6235('0x85')][_0x6235('0x4a')];_0x5ae1be+=0x1){_0x2872ca=_0xaf324e[_0xd4d8fe][_0x6235('0x85')][_0x5ae1be][_0x6235('0x29')]({'plain':!![]});_0x62b3d9[_0x2872ca['id']]=_0x2872ca;}}_0x62b3d9=_['values'](_0x62b3d9);for(var _0x180f1e=qs[_0x6235('0x20')](_0x4f60df[_0x6235('0x40')][_0x6235('0x20')]);_0x180f1e<_0x62b3d9['length']&&_0xb75493['length']=_0x14c91d){_0x2880cb=_0x14c91d;_0x50c92a=0xc8;}else{_0x50c92a=0xce;}_0x18a6fe[_0x97b3('0x1d')](_0x50c92a);return _0x18a6fe['set'](_0x97b3('0x23'),_0x4412c7+'-'+_0x2880cb+'/'+_0x14c91d)[_0x97b3('0x1e')](_0x16040a);}return null;};}function saveUpdates(_0x27cf64){return function(_0x4b6878){if(_0x4b6878){return _0x4b6878[_0x97b3('0x24')](_0x27cf64)['then'](function(_0x42f0b7){return _0x42f0b7;});}return null;};}function removeEntity(_0x39122b){return function(_0x1b3a85){if(_0x1b3a85){return _0x1b3a85[_0x97b3('0x25')]()['then'](function(){var _0x20b8f2=_0x1b3a85[_0x97b3('0x26')]({'plain':!![]});if(_0x20b8f2[_0x97b3('0x27')]==='admin')return;var _0x2772c1=[{'name':_0x97b3('0x28'),'value':_0x97b3('0x29'),'ignore':!![]},{'name':_0x97b3('0x2a'),'value':_0x97b3('0x2b'),'ignore':![]},{'name':_0x97b3('0x2c'),'value':'telephone','ignore':![]}];var _0x29c8a=_(_0x2772c1)[_0x97b3('0x2d')](_0x97b3('0x2e'))['map'](_0x97b3('0x2f'))[_0x97b3('0x2f')]();if(_['includes'](_0x29c8a,_0x20b8f2[_0x97b3('0x27')])){return;}var _0x25624c=_[_0x97b3('0x30')](_0x2772c1,[_0x97b3('0x2f'),_0x20b8f2['role']])[_0x97b3('0x31')];return db[_0x97b3('0x32')]['destroy']({'where':{'type':_0x25624c,'resourceId':_0x20b8f2['id']}})[_0x97b3('0x33')](function(){return _0x1b3a85;});})[_0x97b3('0x33')](function(){_0x39122b[_0x97b3('0x1d')](0xcc)[_0x97b3('0x1c')]();});}};}function handleEntityNotFound(_0x32ab71){return function(_0x462f4d){if(!_0x462f4d){_0x32ab71[_0x97b3('0x1b')](0x194);}return _0x462f4d;};}function handleError(_0x42327d,_0x5b8d24){_0x5b8d24=_0x5b8d24||0x1f4;return function(_0x1657fc){logger[_0x97b3('0x18')](_0x1657fc[_0x97b3('0x34')]);if(_0x1657fc[_0x97b3('0x31')]){delete _0x1657fc['name'];}_0x42327d[_0x97b3('0x1d')](_0x5b8d24)[_0x97b3('0x35')](_0x1657fc);};}exports[_0x97b3('0x36')]=function(_0x9cf9f3,_0xe96c1a){var _0x15fe26={},_0xe089b3={'count':0x0,'rows':[]};var _0x384986=_(db['User'][_0x97b3('0x37')])[_0x97b3('0x38')](function(_0xd4f9c){return{'name':_0xd4f9c[_0x97b3('0x39')],'type':_0xd4f9c[_0x97b3('0x3a')][_0x97b3('0x3b')]};})[_0x97b3('0x2d')](function(_0x6bcd44){return!_[_0x97b3('0x3c')](['password',_0x97b3('0x3d')],_0x6bcd44[_0x97b3('0x31')]);})[_0x97b3('0x2f')]();_0x15fe26=qs[_0x97b3('0x3e')](_0x384986,_0x9cf9f3);var _0xfc7ba6={'where':_0x15fe26[_0x97b3('0x3f')]};return db[_0x97b3('0x40')][_0x97b3('0x21')](_0xfc7ba6)[_0x97b3('0x33')](function(_0xab6689){_0xe089b3[_0x97b3('0x21')]=_0xab6689;if(_0x9cf9f3[_0x97b3('0x41')][_0x97b3('0x42')]){_0x15fe26[_0x97b3('0x43')]=[{'all':!![]}];}if(_0x9cf9f3[_0x97b3('0x41')][_0x97b3('0x44')]===_0x97b3('0x45')){_0x15fe26[_0x97b3('0x43')]=[{'model':db['UserSetting'],'as':_0x97b3('0x44')}];}if(!_['includes'](_0x15fe26[_0x97b3('0x46')],'id')){_0x15fe26[_0x97b3('0x46')][_0x97b3('0x47')]('id');}return db['User'][_0x97b3('0x48')](_0x15fe26);})[_0x97b3('0x33')](function(_0x27540d){_0xe089b3[_0x97b3('0x49')]=_0x27540d;if(_0x9cf9f3[_0x97b3('0x41')][_0x97b3('0x4a')]==='true'){var _0x4f4b5f=[];for(var _0x5840f9=0x0;_0x5840f9<_0xe089b3[_0x97b3('0x49')][_0x97b3('0x4b')];_0x5840f9++){_0x4f4b5f[_0x97b3('0x47')](get_open_tabs(_0x97b3('0x4c'),_0xe089b3[_0x97b3('0x49')][_0x5840f9][_0x97b3('0x4d')]));_0x4f4b5f['push'](get_open_tabs(_0x97b3('0x4e'),_0xe089b3[_0x97b3('0x49')][_0x5840f9][_0x97b3('0x4d')]));_0x4f4b5f[_0x97b3('0x47')](get_open_tabs('fax',_0xe089b3[_0x97b3('0x49')][_0x5840f9][_0x97b3('0x4d')]));_0x4f4b5f['push'](get_open_tabs(_0x97b3('0x4f'),_0xe089b3[_0x97b3('0x49')][_0x5840f9][_0x97b3('0x4d')]));_0x4f4b5f['push'](get_open_tabs(_0x97b3('0x50'),_0xe089b3[_0x97b3('0x49')][_0x5840f9][_0x97b3('0x4d')]));_0x4f4b5f[_0x97b3('0x47')](get_open_tabs(_0x97b3('0x51'),_0xe089b3[_0x97b3('0x49')][_0x5840f9][_0x97b3('0x4d')]));}return BPromise[_0x97b3('0x52')](_0x4f4b5f)[_0x97b3('0x33')](function(){return _0xe089b3;});}else{return _0xe089b3;}})[_0x97b3('0x33')](respondWithFilteredResult(_0xe96c1a,_0x15fe26))[_0x97b3('0x1a')](handleError(_0xe96c1a,null));};exports[_0x97b3('0x53')]=function(_0x3dd47b,_0x3813fd){var _0x305052={'raw':![],'where':{'id':_0x3dd47b[_0x97b3('0x54')]['id']}},_0x4bee82={};_0x4bee82[_0x97b3('0x55')]=_[_0x97b3('0x56')](_[_0x97b3('0x57')](db[_0x97b3('0x40')][_0x97b3('0x37')]),[_0x97b3('0x58'),_0x97b3('0x3d')]);_0x4bee82[_0x97b3('0x41')]=_['keys'](_0x3dd47b[_0x97b3('0x41')]);_0x4bee82[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x4bee82['model'],_0x4bee82['query']);_0x305052['attributes']=_[_0x97b3('0x5a')](_0x4bee82[_0x97b3('0x55')],qs[_0x97b3('0x5b')](_0x3dd47b['query'][_0x97b3('0x5b')]));_0x305052['attributes']=_0x305052['attributes']['length']?_0x305052[_0x97b3('0x46')]:_0x4bee82[_0x97b3('0x55')];if(_0x3dd47b[_0x97b3('0x41')][_0x97b3('0x42')]){_0x305052[_0x97b3('0x43')]=[{'all':!![]}];}if(_0x3dd47b[_0x97b3('0x41')][_0x97b3('0x44')]===_0x97b3('0x45')){_0x305052[_0x97b3('0x43')]=[{'model':db['UserSetting'],'as':_0x97b3('0x44')}];}_0x305052=_[_0x97b3('0x5c')]({},_0x305052,_0x3dd47b[_0x97b3('0x5d')]);if(!_[_0x97b3('0x3c')](_0x305052[_0x97b3('0x46')],'id')){_0x305052[_0x97b3('0x46')][_0x97b3('0x47')]('id');}return db[_0x97b3('0x40')]['find'](_0x305052)[_0x97b3('0x33')](handleEntityNotFound(_0x3813fd,null))[_0x97b3('0x33')](function(_0x44b3c8){var _0x2f2dff=[];values=_0x44b3c8;if(_0x3dd47b[_0x97b3('0x41')][_0x97b3('0x4a')]===_0x97b3('0x45')){_0x2f2dff[_0x97b3('0x47')](get_open_tabs(_0x97b3('0x4c'),_0x44b3c8['dataValues']));_0x2f2dff['push'](get_open_tabs(_0x97b3('0x4e'),_0x44b3c8[_0x97b3('0x4d')]));_0x2f2dff[_0x97b3('0x47')](get_open_tabs(_0x97b3('0x50'),_0x44b3c8[_0x97b3('0x4d')]));_0x2f2dff['push'](get_open_tabs(_0x97b3('0x51'),_0x44b3c8[_0x97b3('0x4d')]));_0x2f2dff[_0x97b3('0x47')](get_open_tabs(_0x97b3('0x5e'),_0x44b3c8[_0x97b3('0x4d')]));_0x2f2dff['push'](get_open_tabs(_0x97b3('0x4f'),_0x44b3c8['dataValues']));return BPromise[_0x97b3('0x52')](_0x2f2dff);}else{return values;}})[_0x97b3('0x33')](function(){return values;})[_0x97b3('0x33')](respondWithResult(_0x3813fd,null))[_0x97b3('0x1a')](handleError(_0x3813fd,null));};exports['update']=function(_0x4ff0d9,_0x5c4bac){if(_0x4ff0d9[_0x97b3('0x5f')]['id']){delete _0x4ff0d9['body']['id'];}delete _0x4ff0d9['body'][_0x97b3('0x27')];return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x4ff0d9['params']['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x5c4bac,null))['then'](saveUpdates(_0x4ff0d9[_0x97b3('0x5f')],null))[_0x97b3('0x33')](respondWithResult(_0x5c4bac,null))[_0x97b3('0x1a')](handleError(_0x5c4bac,null));};exports[_0x97b3('0x60')]=function(_0x5a5a97,_0x385630){return db[_0x97b3('0x40')][_0x97b3('0x60')]()[_0x97b3('0x33')](respondWithResult(_0x385630,null))[_0x97b3('0x1a')](handleError(_0x385630,null));};exports[_0x97b3('0x61')]=function(_0x14aec9,_0xa69027){return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x14aec9[_0x97b3('0x54')]['id']}})['then'](handleEntityNotFound(_0xa69027,null))[_0x97b3('0x33')](function(_0x4683fc){if(_0x4683fc){return _0x4683fc[_0x97b3('0x61')](_0x14aec9[_0x97b3('0x5f')][_0x97b3('0x62')],_[_0x97b3('0x63')](_0x14aec9[_0x97b3('0x5f')],[_0x97b3('0x62'),'id'])||{});}})['then'](respondWithResult(_0xa69027,null))['catch'](handleError(_0xa69027,null));};function validateUser(_0x3be010){return new BPromise(function(_0x1cd9b5,_0x1b8750){if(_0x3be010['internal'])return _0x1cd9b5(_0x3be010);return db[_0x97b3('0x64')][_0x97b3('0x65')](0x1)[_0x97b3('0x33')](function(_0x5b3f63){if(_0x5b3f63['securePassword'])authService[_0x97b3('0x66')](_0x3be010[_0x97b3('0x58')]);db[_0x97b3('0x40')][_0x97b3('0x67')]('internal')[_0x97b3('0x33')](function(_0x185a8c){if(_['isNil'](_0x185a8c)){_0x3be010['internal']=_0x5b3f63['min_internal']||0x1;return;}if(_[_0x97b3('0x68')](_0x5b3f63[_0x97b3('0x69')])||_0x5b3f63[_0x97b3('0x69')]===_0x185a8c){_0x3be010['internal']=_0x185a8c+0x1;return;}if(_0x5b3f63[_0x97b3('0x69')]>_0x185a8c){_0x3be010['internal']=_0x5b3f63[_0x97b3('0x69')];return;}return db[_0x97b3('0x6a')][_0x97b3('0x41')](_0x97b3('0x6b'),{'type':db['sequelize'][_0x97b3('0x6c')][_0x97b3('0x6d')]})[_0x97b3('0x33')](function(_0x43c785){if(_0x43c785&&_0x43c785[_0x97b3('0x4b')]){for(var _0x3100a5=0x0,_0x26c26c=_0x43c785[_0x97b3('0x4b')];_0x3100a5<_0x26c26c&&_[_0x97b3('0x68')](_0x3be010[_0x97b3('0x6e')]);_0x3100a5++){if(_0x5b3f63[_0x97b3('0x69')]<=_0x43c785[_0x3100a5][_0x97b3('0x6f')]){_0x3be010[_0x97b3('0x6e')]=_0x43c785[_0x3100a5]['from'];}else if(_0x5b3f63[_0x97b3('0x69')]>_0x43c785[_0x3100a5][_0x97b3('0x6f')]&&_0x5b3f63[_0x97b3('0x69')]<=_0x43c785[_0x3100a5]['to']){_0x3be010[_0x97b3('0x6e')]=_0x5b3f63[_0x97b3('0x69')];}}}if(_[_0x97b3('0x68')](_0x3be010[_0x97b3('0x6e')])){_0x3be010['internal']=_0x185a8c+0x1;}return _0x1cd9b5(_0x3be010);});});})[_0x97b3('0x1a')](function(_0x891452){_0x1b8750(_0x891452);});});}function updateUser(_0x5b8c91){return new BPromise(function(_0x256f18,_0x186b83){try{if(_0x5b8c91[_0x97b3('0x70')]){_0x5b8c91[_0x97b3('0x71')]=_0x5b8c91[_0x97b3('0x6e')];_0x5b8c91[_0x97b3('0x72')]={'mailbox':_0x5b8c91[_0x97b3('0x6e')],'password':_0x5b8c91[_0x97b3('0x58')],'fullname':_0x5b8c91[_0x97b3('0x73')],'email':_0x5b8c91[_0x97b3('0x74')]};}if(_0x5b8c91['role']==='agent'){if(!_0x5b8c91[_0x97b3('0x75')])_0x5b8c91['permissions']=[_0x97b3('0x76'),_0x97b3('0x77'),_0x97b3('0x78'),_0x97b3('0x79'),_0x97b3('0x7a'),'104',_0x97b3('0x7b'),_0x97b3('0x7c'),_0x97b3('0x7d'),_0x97b3('0x7e'),_0x97b3('0x7f'),_0x97b3('0x80'),_0x97b3('0x81'),_0x97b3('0x82'),_0x97b3('0x83')];}_0x256f18(_0x5b8c91);}catch(_0x9e75b3){_0x186b83(_0x9e75b3);}});}exports[_0x97b3('0x84')]=function(_0x5f0419,_0x4df26d){if(_0x5f0419[_0x97b3('0x29')][_0x97b3('0x27')]===_0x97b3('0x2b'))throw new Error(_0x97b3('0x85'));if(_0x5f0419[_0x97b3('0x5f')][_0x97b3('0x27')]===_0x97b3('0x29')&&_0x5f0419['user'][_0x97b3('0x27')]!==_0x97b3('0x86')){throw new Error(_0x97b3('0x87'));}if(_0x5f0419[_0x97b3('0x5f')][_0x97b3('0x27')]==='admin'&&_0x5f0419[_0x97b3('0x29')][_0x97b3('0x27')]!==_0x97b3('0x86')){throw new Error(_0x97b3('0x88'));}return licenseUtil[_0x97b3('0x89')]([_0x5f0419[_0x97b3('0x5f')]])[_0x97b3('0x33')](function(){return validateUser(_0x5f0419['body']);})['then'](function(_0x17e94a){return updateUser(_0x17e94a)[_0x97b3('0x33')](function(_0x5bb476){if(_0x5bb476[_0x97b3('0x27')]===_0x97b3('0x86')){_0x5bb476['settingsEnabled']=_0x5f0419[_0x97b3('0x29')]['settingsEnabled'];delete _0x5bb476[_0x97b3('0x8a')];}return _0x5bb476;});})[_0x97b3('0x33')](function(_0x207e94){return db[_0x97b3('0x40')]['create'](_0x207e94,{'include':[{'model':db['VoiceMail'],'as':_0x97b3('0x72')}]});})[_0x97b3('0x33')](function(_0x568837){if(_0x5f0419['body'][_0x97b3('0x27')]==='user')return _0x568837;if(_0x5f0419[_0x97b3('0x29')][_0x97b3('0x27')]!=='user')return _0x568837;return db[_0x97b3('0x8b')][_0x97b3('0x30')]({'where':{'name':_0x568837[_0x97b3('0x27')]===_0x97b3('0x2b')?_0x97b3('0x2a'):_0x97b3('0x2c'),'userProfileId':_0x5f0419[_0x97b3('0x29')][_0x97b3('0x8a')]},'raw':!![]})['then'](function(_0x1f8805){if(!_0x1f8805||_0x1f8805[_0x97b3('0x8c')]!=0x0)return _0x568837;return db[_0x97b3('0x32')][_0x97b3('0x84')]({'name':_0x568837[_0x97b3('0x31')],'resourceId':_0x568837['id'],'type':_0x1f8805['name'],'sectionId':_0x1f8805['id']},{})['then'](function(){return _0x568837;});})['catch'](function(_0x172a96){logger['error'](_0x97b3('0x8d'),_0x172a96);throw _0x172a96;});})[_0x97b3('0x33')](respondWithResult(_0x4df26d,0xc9))['catch'](handleError(_0x4df26d,null));};exports['bulkCreate']=function(_0x316705,_0x1e0a15){var _0x16d950=_0x316705[_0x97b3('0x5f')];var _0x30a8c3=[];if(_0x316705[_0x97b3('0x29')][_0x97b3('0x27')]==='agent')throw new Error(_0x97b3('0x85'));if(_[_0x97b3('0x8e')](_0x16d950,[_0x97b3('0x27'),'user'])&&_0x316705[_0x97b3('0x29')][_0x97b3('0x27')]!==_0x97b3('0x86')){throw new Error(_0x97b3('0x87'));}if(_[_0x97b3('0x8e')](_0x16d950,['role','admin'])&&_0x316705[_0x97b3('0x29')][_0x97b3('0x27')]!==_0x97b3('0x86')){throw new Error(_0x97b3('0x8f'));}return licenseUtil[_0x97b3('0x89')](_0x16d950)[_0x97b3('0x33')](function(){return validateUser(_0x16d950[0x0]);})[_0x97b3('0x33')](function(){for(var _0x328ab9=0x1;_0x328ab9<_0x16d950[_0x97b3('0x4b')];_0x328ab9++){var _0x2da6d2=_0x16d950[_0x328ab9-0x1]['internal'];if(!_0x16d950[_0x328ab9][_0x97b3('0x6e')])_0x16d950[_0x328ab9][_0x97b3('0x6e')]=_0x2da6d2+0x1;_0x30a8c3[_0x97b3('0x47')](validateUser(_0x16d950[_0x328ab9]));}return BPromise[_0x97b3('0x52')](_0x30a8c3);})['then'](function(){_0x30a8c3=[];for(var _0x206a23=0x0;_0x206a23<_0x16d950[_0x97b3('0x4b')];_0x206a23++){_0x30a8c3[_0x97b3('0x47')](updateUser(_0x16d950[_0x206a23]));}return BPromise[_0x97b3('0x52')](_0x30a8c3);})[_0x97b3('0x33')](function(){return BPromise[_0x97b3('0x90')](_0x16d950,function(_0x4bbb8e){return db[_0x97b3('0x40')][_0x97b3('0x84')](_0x4bbb8e,{'include':[{'model':db[_0x97b3('0x72')],'as':_0x97b3('0x72')}]})[_0x97b3('0x33')](function(_0x36daa9){_0x4bbb8e['id']=_0x36daa9['id'];return _0x4bbb8e;});});})['then'](function(_0x5e76c3){if(_0x316705[_0x97b3('0x5f')][_0x97b3('0x27')]===_0x97b3('0x29'))return _0x5e76c3;if(_0x316705[_0x97b3('0x29')]['role']!==_0x97b3('0x29'))return _0x5e76c3;var _0x449059=_[_0x97b3('0x8e')](_0x5e76c3,function(_0x38b156){return _0x38b156[_0x97b3('0x27')]===_0x97b3('0x2b')||_0x38b156['role']===_0x97b3('0x91');});if(!_0x449059)return _0x5e76c3;return db[_0x97b3('0x8b')][_0x97b3('0x48')]({'where':{'name':{'$or':[_0x97b3('0x2a'),_0x97b3('0x2c')]},'userProfileId':_0x316705[_0x97b3('0x29')][_0x97b3('0x8a')]},'raw':!![]})[_0x97b3('0x33')](function(_0x346f38){if(_['isEmpty'](_0x346f38)||!_[_0x97b3('0x8e')](_0x346f38,['autoAssociation',0x0]))return _0x5e76c3;_0x30a8c3=[];var _0x50580d=_(_0x346f38)['map'](function(_0x439604){if(_0x439604[_0x97b3('0x8c')]===0x1)return;return _0x439604[_0x97b3('0x31')]===_0x97b3('0x2a')?'agent':_0x97b3('0x91');})[_0x97b3('0x92')]()['value']();for(var _0x22931b=0x0;_0x22931b<_0x5e76c3['length'];_0x22931b++){if(!_[_0x97b3('0x3c')](_0x50580d,_0x5e76c3[_0x22931b][_0x97b3('0x27')]))return;var _0x543f62=_0x5e76c3[_0x22931b][_0x97b3('0x27')]==='agent'?_0x97b3('0x2a'):_0x97b3('0x2c');_0x30a8c3[_0x97b3('0x47')](db[_0x97b3('0x32')][_0x97b3('0x84')]({'name':_0x5e76c3[_0x22931b]['name'],'resourceId':_0x5e76c3[_0x22931b]['id'],'type':_0x543f62,'sectionId':_['find'](_0x346f38,[_0x97b3('0x31'),_0x543f62])['id']},{}));}return BPromise[_0x97b3('0x52')](_0x30a8c3);});})[_0x97b3('0x33')](respondWithResult(_0x1e0a15,0xc9))[_0x97b3('0x1a')](handleError(_0x1e0a15,null));};exports[_0x97b3('0x93')]=function(_0x6008d5,_0x2d139a){if(_0x6008d5[_0x97b3('0x5f')]['id']){delete _0x6008d5[_0x97b3('0x5f')]['id'];}return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x6008d5[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](function(_0xa76d1c){if(!_0xa76d1c)return null;if(_0xa76d1c['id']===_0x6008d5[_0x97b3('0x29')]['id']){if(!_0x6008d5[_0x97b3('0x5f')][_0x97b3('0x94')]||!_0x6008d5[_0x97b3('0x5f')][_0x97b3('0x95')]){throw new db[(_0x97b3('0x96'))][(_0x97b3('0x97'))](_0x97b3('0x98'));}if(!_0xa76d1c[_0x97b3('0x99')](_0x6008d5['body'][_0x97b3('0x94')])){throw new db[(_0x97b3('0x96'))]['ValidationError'](_0x97b3('0x9a'));}if(_0x6008d5['body'][_0x97b3('0x94')]===_0x6008d5[_0x97b3('0x5f')][_0x97b3('0x95')]){throw new db[(_0x97b3('0x96'))][(_0x97b3('0x97'))](_0x97b3('0x9b'));}}else if(_0x6008d5[_0x97b3('0x29')]['role']===_0x97b3('0x86')){if(!_0x6008d5[_0x97b3('0x5f')]['newPassword']){throw new db[(_0x97b3('0x96'))]['ValidationError'](_0x97b3('0x9c'));}}else if(_0x6008d5['user']['role']==='user'){if(!_0x6008d5[_0x97b3('0x5f')][_0x97b3('0x95')]){throw new db[(_0x97b3('0x96'))][(_0x97b3('0x97'))](_0x97b3('0x9c'));}if(_0xa76d1c[_0x97b3('0x27')]!=='agent'){throw new db[(_0x97b3('0x96'))][(_0x97b3('0x97'))](_0x97b3('0x85'));}}else{throw new db[(_0x97b3('0x96'))][(_0x97b3('0x97'))](_0x97b3('0x85'));}return _0xa76d1c;})[_0x97b3('0x33')](handleEntityNotFound(_0x2d139a,null))[_0x97b3('0x33')](function(_0xe354af){return db[_0x97b3('0x64')][_0x97b3('0x9d')]({'attributes':['id',_0x97b3('0x9e'),'enforcePasswordHistory',_0x97b3('0x9f')]})[_0x97b3('0x33')](function(_0x2a7fc3){if(_0x2a7fc3[_0x97b3('0x9e')])authService[_0x97b3('0x66')](_0x6008d5[_0x97b3('0x5f')][_0x97b3('0x95')]);if(!_0x2a7fc3[_0x97b3('0xa0')]||!_0xe354af[_0x97b3('0xa1')])return _0xe354af;authService[_0x97b3('0xa2')](_0x6008d5['body'][_0x97b3('0x95')],_0xe354af[_0x97b3('0xa1')],_0x2a7fc3[_0x97b3('0x9f')]);return _0xe354af;})['then'](saveUpdates({'password':_0x6008d5[_0x97b3('0x5f')][_0x97b3('0x95')],'passwordResetAt':_0x6008d5[_0x97b3('0x29')]['id']==_0x6008d5[_0x97b3('0x54')]['id']?moment():null,'previousPasswords':authService[_0x97b3('0xa3')](_0x6008d5[_0x97b3('0x5f')][_0x97b3('0x95')],_0xe354af['previousPasswords'])},null));})[_0x97b3('0x33')](respondWithResult(_0x2d139a,null))['catch'](handleError(_0x2d139a,null));};exports['addQueues']=function(_0x2fc941,_0x1a606c){var _0x2b4b59=_0x2fc941['body']['channel'];return db['User']['find']({'where':{'id':_0x2fc941[_0x97b3('0x54')]['id']},'attributes':['id',_0x97b3('0x31'),_0x97b3('0x27'),_0x97b3('0xa4'),'loginInPause',_0x97b3('0xa5'),_0x97b3('0xa6')]})[_0x97b3('0x33')](handleEntityNotFound(_0x1a606c,null))[_0x97b3('0x33')](function(_0x144c7e){if(_0x144c7e){if(!utils[_0x97b3('0xa7')](_0x2b4b59)){throw new db['Sequelize'][(_0x97b3('0x97'))](_0x97b3('0xa8'));}return _0x144c7e['add'+_[_0x97b3('0xa9')](_0x2b4b59['toLowerCase']())+_0x97b3('0xaa')](_0x2fc941['body'][_0x97b3('0x62')],{'penalty':_0x2fc941[_0x97b3('0x5f')][_0x97b3('0xab')]||0x0})[_0x97b3('0xac')](function(_0x1fcc8a){for(var _0x488d44=0x0;_0x488d44<_0x2fc941[_0x97b3('0x5f')][_0x97b3('0x62')][_0x97b3('0x4b')];_0x488d44+=0x1){var _0x726c7c={'UserId':Number(_0x2fc941[_0x97b3('0x54')]['id'])};_0x726c7c[_[_0x97b3('0xa9')](_0x2b4b59[_0x97b3('0xad')]())+_0x97b3('0xae')]=Number(_0x2fc941[_0x97b3('0x5f')]['ids'][_0x488d44]);socket[_0x97b3('0xaf')](_0x97b3('0x29')+_['capitalize'](_0x2b4b59[_0x97b3('0xad')]())+_0x97b3('0xb0'),_0x726c7c);}return _0x1fcc8a;})['then'](function(){if(_0x2b4b59===_0x97b3('0xb1')){return db[_0x97b3('0xb2')][_0x97b3('0x48')]({'where':{'id':_0x2fc941[_0x97b3('0x5f')][_0x97b3('0x62')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x1cb585){var _0x55e6b3=_0x144c7e[_0x97b3('0x26')]({'plain':!![]});var _0x14b1a4=[];if(_0x2b4b59==='voice'&&_0x55e6b3[_0x97b3('0x27')]===_0x97b3('0x2b')&&_0x55e6b3[_0x97b3('0xa4')]){for(var _0x54f8fd=0x0;_0x54f8fd<_0x1cb585[_0x97b3('0x4b')];_0x54f8fd+=0x1){_0x14b1a4['push']({'membername':_0x55e6b3[_0x97b3('0x31')],'UserId':_0x55e6b3['id'],'queue_name':_0x1cb585[_0x54f8fd]['name'],'VoiceQueueId':_0x1cb585[_0x54f8fd]['id'],'interface':_[_0x97b3('0x68')](_0x55e6b3[_0x97b3('0xa6')])?util['format'](_0x97b3('0xb3'),_0x55e6b3['name']):_0x55e6b3[_0x97b3('0xa6')],'paused':_0x55e6b3['voicePause']||![],'penalty':_0x2fc941[_0x97b3('0x5f')]['penalty']||0x0});}return BPromise[_0x97b3('0x90')](_0x14b1a4,function(_0x35094d){return db[_0x97b3('0xb4')]['upsert'](_0x35094d);});}return _0x144c7e;});}})[_0x97b3('0x33')](respondWithStatusCode(_0x1a606c,null))[_0x97b3('0x1a')](handleError(_0x1a606c,null));};exports['removeQueues']=function(_0x29b84e,_0x55ab1f){var _0x2903ec,_0x4f4ede;return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x29b84e[_0x97b3('0x54')]['id']},'attributes':['id','name',_0x97b3('0x27')]})['then'](handleEntityNotFound(_0x55ab1f,null))[_0x97b3('0x33')](function(_0x4a5e1f){if(_0x4a5e1f){_0x2903ec=_0x4a5e1f;if(!_0x29b84e[_0x97b3('0x41')]['channel']||!utils[_0x97b3('0xa7')](_0x29b84e['query'][_0x97b3('0xb5')])){throw new db[(_0x97b3('0x96'))][(_0x97b3('0x97'))](_0x97b3('0xa8'));}return _0x4a5e1f['remove'+_[_0x97b3('0xa9')](_0x29b84e['query'][_0x97b3('0xb5')][_0x97b3('0xad')]())+_0x97b3('0xaa')](_0x29b84e[_0x97b3('0x41')][_0x97b3('0x62')]);}})[_0x97b3('0x33')](function(_0x2807b1){if(_[_0x97b3('0xb6')](_0x29b84e[_0x97b3('0x41')][_0x97b3('0x62')])){for(var _0x3e2c81=0x0;_0x3e2c81<_0x29b84e['query'][_0x97b3('0x62')]['length'];_0x3e2c81+=0x1){_0x4f4ede={'UserId':Number(_0x29b84e['params']['id'])};_0x4f4ede[_[_0x97b3('0xa9')](_0x29b84e[_0x97b3('0x41')][_0x97b3('0xb5')]['toLowerCase']())+_0x97b3('0xae')]=Number(_0x29b84e['query'][_0x97b3('0x62')][_0x3e2c81]);socket[_0x97b3('0xaf')]('user'+_[_0x97b3('0xa9')](_0x29b84e['query'][_0x97b3('0xb5')]['toLowerCase']())+'Queue:remove',_0x4f4ede);}}else{_0x4f4ede={'UserId':Number(_0x29b84e[_0x97b3('0x54')]['id'])};_0x4f4ede[_[_0x97b3('0xa9')](_0x29b84e[_0x97b3('0x41')][_0x97b3('0xb5')]['toLowerCase']())+_0x97b3('0xae')]=Number(_0x29b84e['query'][_0x97b3('0x62')]);socket[_0x97b3('0xaf')](_0x97b3('0x29')+_['capitalize'](_0x29b84e['query'][_0x97b3('0xb5')]['toLowerCase']())+_0x97b3('0xb7'),_0x4f4ede);}return _0x2807b1;})['then'](function(){if(_0x29b84e['query'][_0x97b3('0xb5')]===_0x97b3('0xb1')){return db[_0x97b3('0xb4')]['destroy']({'where':{'UserId':_0x29b84e[_0x97b3('0x54')]['id'],'VoiceQueueId':_0x29b84e['query']['ids']},'individualHooks':!![]})[_0x97b3('0x33')](function(){return _0x2903ec;});}return _0x2903ec;})[_0x97b3('0x33')](respondWithStatusCode(_0x55ab1f,null))[_0x97b3('0x1a')](handleError(_0x55ab1f,null));};exports[_0x97b3('0xb8')]=function(_0x59a000,_0x448de9){_0x59a000[_0x97b3('0x5f')][_0x97b3('0xb9')]=_0x59a000[_0x97b3('0xba')][_0x97b3('0xbb')];return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x59a000[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x448de9,null))['then'](saveUpdates(_0x59a000[_0x97b3('0x5f')],null))[_0x97b3('0x33')](respondWithResult(_0x448de9,null))[_0x97b3('0x1a')](handleError(_0x448de9,null));};exports[_0x97b3('0xbc')]=function(_0x2e1efe,_0x271801){var _0xbb14a0=path[_0x97b3('0xbd')](config['root'],_0x97b3('0xbe'));return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x2e1efe['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x97b3('0x33')](handleEntityNotFound(_0x271801,null))[_0x97b3('0x33')](function(_0x34e32f){if(_0x34e32f){if(_[_0x97b3('0x68')](_0x34e32f[_0x97b3('0xb9')])){return _0x271801[_0x97b3('0xbf')](_0xbb14a0);}else{if(!fs[_0x97b3('0xc0')](path[_0x97b3('0xbd')](config[_0x97b3('0xc1')],_0x97b3('0xc2'),_0x34e32f[_0x97b3('0xb9')]))){return _0x271801[_0x97b3('0xbf')](_0xbb14a0);}return _0x271801[_0x97b3('0xbf')](path[_0x97b3('0xbd')](config[_0x97b3('0xc1')],_0x97b3('0xc2'),_0x34e32f[_0x97b3('0xb9')]));}}})[_0x97b3('0x1a')](handleError(_0x271801,null));};exports[_0x97b3('0xc3')]=function(_0x19b8fb,_0x5a0e90){return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x19b8fb[_0x97b3('0x54')]['id']},'attributes':['id']})[_0x97b3('0x33')](handleEntityNotFound(_0x5a0e90,null))['then'](function(_0x29f1b3){var _0x3ebfe3=[];values=_0x29f1b3[_0x97b3('0x4d')];_0x3ebfe3['push'](get_open_tabs(_0x97b3('0x4c'),_0x29f1b3[_0x97b3('0x4d')]));_0x3ebfe3['push'](get_open_tabs('sms',_0x29f1b3[_0x97b3('0x4d')]));_0x3ebfe3[_0x97b3('0x47')](get_open_tabs('openchannel',_0x29f1b3[_0x97b3('0x4d')]));_0x3ebfe3[_0x97b3('0x47')](get_open_tabs(_0x97b3('0x51'),_0x29f1b3['dataValues']));_0x3ebfe3[_0x97b3('0x47')](get_open_tabs(_0x97b3('0x5e'),_0x29f1b3[_0x97b3('0x4d')]));_0x3ebfe3['push'](get_open_tabs(_0x97b3('0x4f'),_0x29f1b3[_0x97b3('0x4d')]));return BPromise[_0x97b3('0x52')](_0x3ebfe3);})[_0x97b3('0x33')](function(_0x3ada94){if(_0x3ada94){var _0xc570b5=_[_0x97b3('0x38')](values['ChatOpenTabs'],function(_0x275d4c){return{'channel':_0x97b3('0xc4'),'id':_0x275d4c['id'],'createdAt':_0x275d4c[_0x97b3('0xc5')]};});var _0x1c3988=_['map'](values['FaxOpenTabs'],function(_0x26637b){return{'channel':'FAX','id':_0x26637b['id'],'createdAt':_0x26637b[_0x97b3('0xc5')]};});var _0x4a7e94=_['map'](values[_0x97b3('0xc6')],function(_0x3bd523){return{'channel':'OPENCHANNEL','id':_0x3bd523['id'],'createdAt':_0x3bd523['createdAt']};});var _0x2934a5=_[_0x97b3('0x38')](values[_0x97b3('0xc7')],function(_0x2ec86b){return{'channel':'MAIL','id':_0x2ec86b['id'],'createdAt':_0x2ec86b['createdAt']};});var _0xecb8f8=_[_0x97b3('0x38')](values[_0x97b3('0xc8')],function(_0x1c6e51){return{'channel':'SMS','id':_0x1c6e51['id'],'createdAt':_0x1c6e51['createdAt']};});var _0x2b5dcc=_[_0x97b3('0x38')](values[_0x97b3('0xc9')],function(_0x2a41b0){return{'channel':_0x97b3('0xca'),'id':_0x2a41b0['id'],'createdAt':_0x2a41b0[_0x97b3('0xc5')]};});var _0x59e0e3=_[_0x97b3('0xcb')](_0xc570b5,_0x1c3988,_0x4a7e94,_0x2934a5,_0xecb8f8,_0x2b5dcc);var _0xc69fec={'count':_0x59e0e3[_0x97b3('0x4b')],'rows':_0x59e0e3};return _0xc69fec;}else return null;})[_0x97b3('0x33')](respondWithResult(_0x5a0e90,null))[_0x97b3('0x1a')](handleError(_0x5a0e90,null));};exports[_0x97b3('0xcc')]=function(_0x4bc994,_0x1a1c94){var _0x59a192={};var _0x4f0c24={};var _0x18fd4c;var _0x509b5e;return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x4bc994[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x1a1c94,null))[_0x97b3('0x33')](function(_0x2850e3){if(_0x2850e3){_0x18fd4c=_0x2850e3;_0x4f0c24[_0x97b3('0x55')]=_['keys'](db[_0x97b3('0xcd')]['rawAttributes']);_0x4f0c24[_0x97b3('0x41')]=_[_0x97b3('0x57')](_0x4bc994[_0x97b3('0x41')]);_0x4f0c24[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x4f0c24[_0x97b3('0x55')],_0x4f0c24[_0x97b3('0x41')]);_0x59a192[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x4f0c24[_0x97b3('0x55')],qs[_0x97b3('0x5b')](_0x4bc994[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x59a192[_0x97b3('0x46')]=_0x59a192[_0x97b3('0x46')]['length']?_0x59a192['attributes']:_0x4f0c24[_0x97b3('0x55')];_0x59a192[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x4bc994[_0x97b3('0x41')]['sort']);_0x59a192[_0x97b3('0x3f')]=qs['filters'](_[_0x97b3('0xd0')](_0x4bc994['query'],_0x4f0c24[_0x97b3('0x59')]));if(_0x4bc994[_0x97b3('0x41')]['filter']){_0x59a192[_0x97b3('0x3f')]=_[_0x97b3('0x5c')](_0x59a192[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0x59a192[_0x97b3('0x46')],function(_0x4c03f6){var _0xcc195a={};_0xcc195a[_0x4c03f6]={'$like':'%'+_0x4bc994['query'][_0x97b3('0x2d')]+'%'};return _0xcc195a;})});}_0x59a192=_[_0x97b3('0x5c')]({},_0x59a192,_0x4bc994[_0x97b3('0x5d')]);return _0x18fd4c['getContacts'](_0x59a192);}})[_0x97b3('0x33')](function(_0x319f10){if(_0x319f10){_0x509b5e=_0x319f10[_0x97b3('0x4b')];if(_0x4bc994['query']['hasOwnProperty']('includeAll')){_0x59a192[_0x97b3('0x43')]=[{'model':db[_0x97b3('0xd1')],'as':_0x97b3('0xd2'),'required':![]},{'model':db[_0x97b3('0xd3')],'as':_0x97b3('0xd4'),'attributes':['id','name',_0x97b3('0xd5')],'where':_0x4bc994[_0x97b3('0x41')][_0x97b3('0xd6')]?{'id':_0x4bc994[_0x97b3('0x41')]['tag']}:undefined,'required':_0x4bc994[_0x97b3('0x41')][_0x97b3('0xd6')]?!![]:![]}];}if(!_0x4bc994[_0x97b3('0x41')][_0x97b3('0xd7')](_0x97b3('0xd8'))){_0x59a192[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0x4bc994[_0x97b3('0x41')][_0x97b3('0x22')]);_0x59a192[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x4bc994[_0x97b3('0x41')][_0x97b3('0x1f')]);}return _0x18fd4c[_0x97b3('0xcc')](_0x59a192);}})[_0x97b3('0x33')](function(_0x307be2){if(_0x307be2){return _0x307be2?{'count':_0x509b5e,'rows':_0x307be2}:null;}})[_0x97b3('0x33')](respondWithResult(_0x1a1c94,null))[_0x97b3('0x1a')](handleError(_0x1a1c94,null));};exports[_0x97b3('0xd9')]=function(_0x374ac9,_0x13a66b){var _0xe5aa36;var _0x31fa6d={};var _0x537bb8;return db[_0x97b3('0x40')]['findOne']({'where':{'id':_0x374ac9[_0x97b3('0x54')]['id']},'attributes':['id',_0x97b3('0x31'),'role']})[_0x97b3('0x33')](handleEntityNotFound(_0x13a66b,null))[_0x97b3('0x33')](function(_0x249ea4){if(!utils[_0x97b3('0xa7')](_0x374ac9[_0x97b3('0x41')]['channel'])){throw new db[(_0x97b3('0x96'))][(_0x97b3('0x97'))](_0x97b3('0xa8'));}_0xe5aa36=_0x249ea4;var _0x1a6310={};_0x1a6310[_0x97b3('0x55')]=_[_0x97b3('0x57')](db[_[_0x97b3('0xa9')](_0x374ac9[_0x97b3('0x41')]['channel'])+'Queue']['rawAttributes']);_0x1a6310[_0x97b3('0x41')]=_[_0x97b3('0x57')](_0x374ac9[_0x97b3('0x41')]);_0x1a6310[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x1a6310[_0x97b3('0x55')],_0x1a6310[_0x97b3('0x41')]);_0x31fa6d[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x1a6310[_0x97b3('0x55')],qs['fields'](_0x374ac9[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x31fa6d[_0x97b3('0x46')]=_0x31fa6d['attributes'][_0x97b3('0x4b')]?_0x31fa6d['attributes']:_0x1a6310[_0x97b3('0x55')];_0x31fa6d[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x374ac9[_0x97b3('0x41')]['sort']);_0x31fa6d['where']=qs[_0x97b3('0x59')](_[_0x97b3('0xd0')](_0x374ac9[_0x97b3('0x41')],_0x1a6310[_0x97b3('0x59')]));if(_0x374ac9[_0x97b3('0x41')][_0x97b3('0x2d')]){_0x31fa6d['where']=_[_0x97b3('0x5c')](_0x31fa6d[_0x97b3('0x3f')],{'$or':_['map'](_0x31fa6d[_0x97b3('0x46')],function(_0x455c96){var _0x5bd29f={};_0x5bd29f[_0x455c96]={'$like':'%'+_0x374ac9[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x5bd29f;})});}_0x31fa6d=_[_0x97b3('0x5c')]({},_0x31fa6d,_0x374ac9[_0x97b3('0x5d')]);switch(_0xe5aa36['role']){case'admin':return db[_[_0x97b3('0xa9')](_0x374ac9['query'][_0x97b3('0xb5')])+_0x97b3('0xda')][_0x97b3('0x48')](_0x31fa6d);case _0x97b3('0x29'):case _0x97b3('0x2b'):return _0xe5aa36[_0x97b3('0x26')+_['capitalize'](_0x374ac9[_0x97b3('0x41')][_0x97b3('0xb5')])+_0x97b3('0xaa')](_0x31fa6d);default:throw new db['Sequelize'][(_0x97b3('0x97'))](_0x97b3('0xdb'));}})['then'](function(_0x191a38){_0x537bb8=_0x191a38[_0x97b3('0x4b')];if(!_0x374ac9['query']['hasOwnProperty'](_0x97b3('0xd8'))){_0x31fa6d[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0x374ac9[_0x97b3('0x41')][_0x97b3('0x22')]);_0x31fa6d['offset']=qs[_0x97b3('0x1f')](_0x374ac9['query'][_0x97b3('0x1f')]);}switch(_0xe5aa36[_0x97b3('0x27')]){case'admin':return db[_['capitalize'](_0x374ac9[_0x97b3('0x41')][_0x97b3('0xb5')])+'Queue'][_0x97b3('0x48')](_0x31fa6d);case _0x97b3('0x29'):case'agent':return _0xe5aa36[_0x97b3('0x26')+_[_0x97b3('0xa9')](_0x374ac9[_0x97b3('0x41')][_0x97b3('0xb5')])+'Queues'](_0x31fa6d);}})[_0x97b3('0x33')](function(_0x594dfa){return{'count':_0x537bb8,'rows':_0x594dfa};})[_0x97b3('0x33')](respondWithResult(_0x13a66b,null))[_0x97b3('0x1a')](handleError(_0x13a66b,null));};exports['getVoiceQueuesRt']=function(_0x58e0cd,_0x440e93){var _0x33ced2={};var _0x31a34c={};var _0x459fb9;var _0x170e27;return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x58e0cd[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x440e93,null))[_0x97b3('0x33')](function(_0x3d33e5){if(_0x3d33e5){_0x459fb9=_0x3d33e5;_0x31a34c[_0x97b3('0x55')]=_[_0x97b3('0x57')](db[_0x97b3('0xb4')][_0x97b3('0x37')]);_0x31a34c[_0x97b3('0x41')]=_['keys'](_0x58e0cd[_0x97b3('0x41')]);_0x31a34c[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x31a34c['model'],_0x31a34c[_0x97b3('0x41')]);_0x33ced2[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x31a34c[_0x97b3('0x55')],qs[_0x97b3('0x5b')](_0x58e0cd[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x33ced2['attributes']=_0x33ced2[_0x97b3('0x46')][_0x97b3('0x4b')]?_0x33ced2[_0x97b3('0x46')]:_0x31a34c[_0x97b3('0x55')];_0x33ced2[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x58e0cd[_0x97b3('0x41')][_0x97b3('0xcf')]);_0x33ced2[_0x97b3('0x3f')]=qs['filters'](_[_0x97b3('0xd0')](_0x58e0cd[_0x97b3('0x41')],_0x31a34c[_0x97b3('0x59')]));if(_0x58e0cd[_0x97b3('0x41')][_0x97b3('0x2d')]){_0x33ced2[_0x97b3('0x3f')]=_['merge'](_0x33ced2[_0x97b3('0x3f')],{'$or':_['map'](_0x33ced2[_0x97b3('0x46')],function(_0x59c563){var _0x2ea6af={};_0x2ea6af[_0x59c563]={'$like':'%'+_0x58e0cd['query'][_0x97b3('0x2d')]+'%'};return _0x2ea6af;})});}_0x33ced2=_[_0x97b3('0x5c')]({},_0x33ced2,_0x58e0cd['options']);return _0x459fb9[_0x97b3('0xdc')](_0x33ced2);}})[_0x97b3('0x33')](function(_0x18f25d){if(_0x18f25d){_0x170e27=_0x18f25d[_0x97b3('0x4b')];if(!_0x58e0cd[_0x97b3('0x41')][_0x97b3('0xd7')]('nolimit')){_0x33ced2['limit']=qs[_0x97b3('0x22')](_0x58e0cd[_0x97b3('0x41')][_0x97b3('0x22')]);_0x33ced2['offset']=qs[_0x97b3('0x1f')](_0x58e0cd['query'][_0x97b3('0x1f')]);}return _0x459fb9[_0x97b3('0xdc')](_0x33ced2);}})[_0x97b3('0x33')](function(_0x451dbb){if(_0x451dbb){return _0x451dbb?{'count':_0x170e27,'rows':_0x451dbb}:null;}})['then'](respondWithResult(_0x440e93,null))['catch'](handleError(_0x440e93,null));};exports['getGroups']=function(_0xf70a29,_0x455430){var _0xfe628f={};var _0x425f3a={};var _0x606434;var _0x5869b1;return db['User']['findOne']({'where':{'id':_0xf70a29[_0x97b3('0x54')]['id']}})['then'](handleEntityNotFound(_0x455430,null))[_0x97b3('0x33')](function(_0x5d01a5){if(_0x5d01a5){_0x606434=_0x5d01a5;_0x425f3a['model']=_['keys'](db[_0x97b3('0xdd')][_0x97b3('0x37')]);_0x425f3a[_0x97b3('0x41')]=_['keys'](_0xf70a29[_0x97b3('0x41')]);_0x425f3a[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x425f3a[_0x97b3('0x55')],_0x425f3a['query']);_0xfe628f[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x425f3a[_0x97b3('0x55')],qs['fields'](_0xf70a29['query'][_0x97b3('0x5b')]));_0xfe628f['attributes']=_0xfe628f[_0x97b3('0x46')][_0x97b3('0x4b')]?_0xfe628f[_0x97b3('0x46')]:_0x425f3a[_0x97b3('0x55')];_0xfe628f['order']=qs[_0x97b3('0xcf')](_0xf70a29[_0x97b3('0x41')][_0x97b3('0xcf')]);_0xfe628f[_0x97b3('0x3f')]=qs[_0x97b3('0x59')](_[_0x97b3('0xd0')](_0xf70a29[_0x97b3('0x41')],_0x425f3a['filters']));if(_0xf70a29[_0x97b3('0x41')]['filter']){_0xfe628f[_0x97b3('0x3f')]=_[_0x97b3('0x5c')](_0xfe628f[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0xfe628f[_0x97b3('0x46')],function(_0x1f2a80){var _0x36e5b8={};_0x36e5b8[_0x1f2a80]={'$like':'%'+_0xf70a29[_0x97b3('0x41')]['filter']+'%'};return _0x36e5b8;})});}_0xfe628f=_['merge']({},_0xfe628f,_0xf70a29[_0x97b3('0x5d')]);return _0x606434[_0x97b3('0xde')](_0xfe628f);}})['then'](function(_0xab0a0b){if(_0xab0a0b){_0x5869b1=_0xab0a0b[_0x97b3('0x4b')];if(!_0xf70a29[_0x97b3('0x41')][_0x97b3('0xd7')](_0x97b3('0xd8'))){_0xfe628f[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0xf70a29['query']['limit']);_0xfe628f[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0xf70a29[_0x97b3('0x41')][_0x97b3('0x1f')]);}return _0x606434[_0x97b3('0xde')](_0xfe628f);}})['then'](function(_0x249f1f){if(_0x249f1f){return _0x249f1f?{'count':_0x5869b1,'rows':_0x249f1f}:null;}})[_0x97b3('0x33')](respondWithResult(_0x455430,null))['catch'](handleError(_0x455430,null));};exports['getRecordings']=function(_0x1a5506,_0x119773){var _0xcce8aa={'raw':!![],'where':{}};var _0xaa6fa9={};var _0x5b9e9f={'count':0x0,'rows':[]};return db['User'][_0x97b3('0x9d')]({'where':{'id':_0x1a5506[_0x97b3('0x54')]['id']}})['then'](handleEntityNotFound(_0x119773,null))[_0x97b3('0x33')](function(_0x44b47e){if(_0x44b47e){_0xaa6fa9['model']=_[_0x97b3('0x57')](db[_0x97b3('0xdf')]['rawAttributes']);_0xaa6fa9[_0x97b3('0x41')]=_['keys'](_0x1a5506[_0x97b3('0x41')]);_0xaa6fa9[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0xaa6fa9[_0x97b3('0x55')],_0xaa6fa9['query']);_0xcce8aa[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0xaa6fa9[_0x97b3('0x55')],qs[_0x97b3('0x5b')](_0x1a5506[_0x97b3('0x41')][_0x97b3('0x5b')]));_0xcce8aa['attributes']=_0xcce8aa[_0x97b3('0x46')]['length']?_0xcce8aa[_0x97b3('0x46')]:_0xaa6fa9['model'];if(!_0x1a5506['query'][_0x97b3('0xd7')](_0x97b3('0xd8'))){_0xcce8aa['limit']=qs[_0x97b3('0x22')](_0x1a5506[_0x97b3('0x41')][_0x97b3('0x22')]);_0xcce8aa[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x1a5506[_0x97b3('0x41')][_0x97b3('0x1f')]);}_0xcce8aa[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x1a5506[_0x97b3('0x41')]['sort']);_0xcce8aa[_0x97b3('0x3f')]=qs[_0x97b3('0x59')](_[_0x97b3('0xd0')](_0x1a5506[_0x97b3('0x41')],_0xaa6fa9['filters']));_0xcce8aa['where'][_0x97b3('0xe0')]=_0x44b47e['id'];if(_0x1a5506[_0x97b3('0x41')][_0x97b3('0x2d')]){_0xcce8aa[_0x97b3('0x3f')]=_[_0x97b3('0x5c')](_0xcce8aa[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0xcce8aa[_0x97b3('0x46')],function(_0x225f93){var _0x2d0fd0={};_0x2d0fd0[_0x225f93]={'$like':'%'+_0x1a5506[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x2d0fd0;})});}_0xcce8aa=_[_0x97b3('0x5c')]({},_0xcce8aa,_0x1a5506[_0x97b3('0x5d')]);return db[_0x97b3('0xdf')][_0x97b3('0x21')]({'where':_0xcce8aa[_0x97b3('0x3f')]})['then'](function(_0x5d6598){_0x5b9e9f[_0x97b3('0x21')]=_0x5d6598;if(_0x1a5506[_0x97b3('0x41')][_0x97b3('0x42')]){_0xcce8aa[_0x97b3('0x43')]=[{'all':!![]}];}return db[_0x97b3('0xdf')][_0x97b3('0x48')](_0xcce8aa);})['then'](function(_0x4fc90a){_0x5b9e9f[_0x97b3('0x49')]=_0x4fc90a;return _0x5b9e9f;});}})[_0x97b3('0x33')](respondWithFilteredResult(_0x119773,_0xcce8aa))[_0x97b3('0x1a')](handleError(_0x119773,null));};exports['getScreenRecordings']=function(_0x18c991,_0x2a9cdf){var _0xef51c4={'raw':!![],'where':{}};var _0x334318={};var _0x48f37c={'count':0x0,'rows':[]};return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x18c991[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x2a9cdf,null))[_0x97b3('0x33')](function(_0x3556fa){if(_0x3556fa){_0x334318[_0x97b3('0x55')]=_[_0x97b3('0x57')](db['ScreenRecording'][_0x97b3('0x37')]);_0x334318[_0x97b3('0x41')]=_['keys'](_0x18c991[_0x97b3('0x41')]);_0x334318['filters']=_['intersection'](_0x334318[_0x97b3('0x55')],_0x334318[_0x97b3('0x41')]);_0xef51c4[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x334318['model'],qs[_0x97b3('0x5b')](_0x18c991['query'][_0x97b3('0x5b')]));_0xef51c4[_0x97b3('0x46')]=_0xef51c4[_0x97b3('0x46')][_0x97b3('0x4b')]?_0xef51c4[_0x97b3('0x46')]:_0x334318[_0x97b3('0x55')];if(!_0x18c991[_0x97b3('0x41')][_0x97b3('0xd7')](_0x97b3('0xd8'))){_0xef51c4[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0x18c991['query'][_0x97b3('0x22')]);_0xef51c4['offset']=qs[_0x97b3('0x1f')](_0x18c991['query'][_0x97b3('0x1f')]);}_0xef51c4['order']=qs[_0x97b3('0xcf')](_0x18c991[_0x97b3('0x41')][_0x97b3('0xcf')]);_0xef51c4[_0x97b3('0x3f')]=qs[_0x97b3('0x59')](_[_0x97b3('0xd0')](_0x18c991[_0x97b3('0x41')],_0x334318[_0x97b3('0x59')]));_0xef51c4[_0x97b3('0x3f')]['UserId']=_0x3556fa['id'];if(_0x18c991[_0x97b3('0x41')][_0x97b3('0x2d')]){_0xef51c4[_0x97b3('0x3f')]=_[_0x97b3('0x5c')](_0xef51c4[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0xef51c4[_0x97b3('0x46')],function(_0x379852){var _0x44906d={};_0x44906d[_0x379852]={'$like':'%'+_0x18c991[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x44906d;})});}_0xef51c4=_[_0x97b3('0x5c')]({},_0xef51c4,_0x18c991[_0x97b3('0x5d')]);return db[_0x97b3('0xe1')][_0x97b3('0x21')]({'where':_0xef51c4[_0x97b3('0x3f')]})[_0x97b3('0x33')](function(_0x1d4a0a){_0x48f37c['count']=_0x1d4a0a;if(_0x18c991['query'][_0x97b3('0x42')]){_0xef51c4[_0x97b3('0x43')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0xef51c4);})['then'](function(_0x52aea1){_0x48f37c['rows']=_0x52aea1;return _0x48f37c;});}})[_0x97b3('0x33')](respondWithFilteredResult(_0x2a9cdf,_0xef51c4))[_0x97b3('0x1a')](handleError(_0x2a9cdf,null));};exports[_0x97b3('0xe2')]=function(_0x289e6d,_0x5ffca7){var _0x16b572={};var _0x250ed0={};var _0x16aa55;var _0x2ee4ba;return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x289e6d[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x5ffca7,null))[_0x97b3('0x33')](function(_0x391dff){if(_0x391dff){_0x16aa55=_0x391dff;_0x250ed0['model']=_[_0x97b3('0x57')](db[_0x97b3('0xe3')][_0x97b3('0x37')]);_0x250ed0[_0x97b3('0x41')]=_[_0x97b3('0x57')](_0x289e6d[_0x97b3('0x41')]);_0x250ed0[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x250ed0[_0x97b3('0x55')],_0x250ed0['query']);_0x16b572[_0x97b3('0x46')]=_['intersection'](_0x250ed0['model'],qs[_0x97b3('0x5b')](_0x289e6d[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x16b572[_0x97b3('0x46')]=_0x16b572['attributes'][_0x97b3('0x4b')]?_0x16b572[_0x97b3('0x46')]:_0x250ed0[_0x97b3('0x55')];_0x16b572['order']=qs[_0x97b3('0xcf')](_0x289e6d[_0x97b3('0x41')]['sort']);_0x16b572[_0x97b3('0x3f')]=qs[_0x97b3('0x59')](_[_0x97b3('0xd0')](_0x289e6d[_0x97b3('0x41')],_0x250ed0['filters']));if(_0x289e6d[_0x97b3('0x41')][_0x97b3('0x2d')]){_0x16b572['where']=_[_0x97b3('0x5c')](_0x16b572[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0x16b572['attributes'],function(_0x17bee0){var _0x4d43fb={};_0x4d43fb[_0x17bee0]={'$like':'%'+_0x289e6d[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x4d43fb;})});}_0x16b572=_[_0x97b3('0x5c')]({},_0x16b572,_0x289e6d[_0x97b3('0x5d')]);return _0x16aa55[_0x97b3('0xe2')](_0x16b572);}})[_0x97b3('0x33')](function(_0x3afa03){if(_0x3afa03){_0x2ee4ba=_0x3afa03[_0x97b3('0x4b')];if(!_0x289e6d[_0x97b3('0x41')]['hasOwnProperty']('nolimit')){_0x16b572[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0x289e6d['query'][_0x97b3('0x22')]);_0x16b572[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x289e6d['query'][_0x97b3('0x1f')]);}return _0x16aa55[_0x97b3('0xe2')](_0x16b572);}})[_0x97b3('0x33')](function(_0x314fb4){if(_0x314fb4){return _0x314fb4?{'count':_0x2ee4ba,'rows':_0x314fb4}:null;}})[_0x97b3('0x33')](respondWithResult(_0x5ffca7,null))[_0x97b3('0x1a')](handleError(_0x5ffca7,null));};exports[_0x97b3('0xe4')]=function(_0x362fb2,_0x55e5fd){var _0x5e05a3={};var _0x38a4e0={};var _0x597cb7;var _0x5f34a2;return db['User'][_0x97b3('0x9d')]({'where':{'id':_0x362fb2[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x55e5fd,null))[_0x97b3('0x33')](function(_0x314960){if(_0x314960){_0x597cb7=_0x314960;_0x38a4e0[_0x97b3('0x55')]=_[_0x97b3('0x57')](db[_0x97b3('0xe5')][_0x97b3('0x37')]);_0x38a4e0['query']=_['keys'](_0x362fb2['query']);_0x38a4e0[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x38a4e0[_0x97b3('0x55')],_0x38a4e0[_0x97b3('0x41')]);_0x5e05a3[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x38a4e0['model'],qs['fields'](_0x362fb2[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x5e05a3[_0x97b3('0x46')]=_0x5e05a3[_0x97b3('0x46')][_0x97b3('0x4b')]?_0x5e05a3[_0x97b3('0x46')]:_0x38a4e0[_0x97b3('0x55')];_0x5e05a3[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x362fb2[_0x97b3('0x41')][_0x97b3('0xcf')]);_0x5e05a3[_0x97b3('0x3f')]=qs[_0x97b3('0x59')](_['pick'](_0x362fb2[_0x97b3('0x41')],_0x38a4e0[_0x97b3('0x59')]));if(_0x362fb2[_0x97b3('0x41')][_0x97b3('0x2d')]){_0x5e05a3[_0x97b3('0x3f')]=_['merge'](_0x5e05a3[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0x5e05a3[_0x97b3('0x46')],function(_0x206a4e){var _0x8bce92={};_0x8bce92[_0x206a4e]={'$like':'%'+_0x362fb2[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x8bce92;})});}_0x5e05a3=_[_0x97b3('0x5c')]({},_0x5e05a3,_0x362fb2[_0x97b3('0x5d')]);return _0x597cb7[_0x97b3('0xe4')](_0x5e05a3);}})[_0x97b3('0x33')](function(_0xed1337){if(_0xed1337){_0x5f34a2=_0xed1337['length'];if(!_0x362fb2[_0x97b3('0x41')][_0x97b3('0xd7')](_0x97b3('0xd8'))){_0x5e05a3['limit']=qs[_0x97b3('0x22')](_0x362fb2[_0x97b3('0x41')][_0x97b3('0x22')]);_0x5e05a3[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x362fb2[_0x97b3('0x41')][_0x97b3('0x1f')]);}return _0x597cb7[_0x97b3('0xe4')](_0x5e05a3);}})[_0x97b3('0x33')](function(_0x5b0c95){if(_0x5b0c95){return _0x5b0c95?{'count':_0x5f34a2,'rows':_0x5b0c95}:null;}})[_0x97b3('0x33')](respondWithResult(_0x55e5fd,null))[_0x97b3('0x1a')](handleError(_0x55e5fd,null));};exports[_0x97b3('0xe6')]=function(_0x5cdf28,_0x536eb2){var _0x55af76={'raw':!![],'where':{}};var _0x41d838={};var _0x61c289={'count':0x0,'rows':[]};return db['User'][_0x97b3('0x9d')]({'where':{'id':_0x5cdf28[_0x97b3('0x54')]['id']}})['then'](handleEntityNotFound(_0x536eb2,null))['then'](function(_0x52fc93){if(_0x52fc93){_0x41d838['model']=_[_0x97b3('0x57')](db[_0x97b3('0xe7')][_0x97b3('0x37')]);_0x41d838['query']=_[_0x97b3('0x57')](_0x5cdf28['query']);_0x41d838[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x41d838[_0x97b3('0x55')],_0x41d838[_0x97b3('0x41')]);_0x55af76[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x41d838[_0x97b3('0x55')],qs[_0x97b3('0x5b')](_0x5cdf28[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x55af76[_0x97b3('0x46')]=_0x55af76['attributes'][_0x97b3('0x4b')]?_0x55af76[_0x97b3('0x46')]:_0x41d838[_0x97b3('0x55')];if(!_0x5cdf28['query'][_0x97b3('0xd7')]('nolimit')){_0x55af76[_0x97b3('0x22')]=qs['limit'](_0x5cdf28[_0x97b3('0x41')][_0x97b3('0x22')]);_0x55af76[_0x97b3('0x1f')]=qs['offset'](_0x5cdf28[_0x97b3('0x41')][_0x97b3('0x1f')]);}_0x55af76[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x5cdf28['query'][_0x97b3('0xcf')]);_0x55af76[_0x97b3('0x3f')]=qs['filters'](_[_0x97b3('0xd0')](_0x5cdf28[_0x97b3('0x41')],_0x41d838[_0x97b3('0x59')]));_0x55af76[_0x97b3('0x3f')][_0x97b3('0xe0')]=_0x52fc93['id'];if(_0x5cdf28['query'][_0x97b3('0x2d')]){_0x55af76['where']=_[_0x97b3('0x5c')](_0x55af76[_0x97b3('0x3f')],{'$or':_['map'](_0x55af76['attributes'],function(_0x43453c){var _0x3172aa={};_0x3172aa[_0x43453c]={'$like':'%'+_0x5cdf28[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x3172aa;})});}_0x55af76=_[_0x97b3('0x5c')]({},_0x55af76,_0x5cdf28[_0x97b3('0x5d')]);return db[_0x97b3('0xe7')][_0x97b3('0x21')]({'where':_0x55af76[_0x97b3('0x3f')]})[_0x97b3('0x33')](function(_0x3d4cc2){_0x61c289[_0x97b3('0x21')]=_0x3d4cc2;if(_0x5cdf28[_0x97b3('0x41')][_0x97b3('0x42')]){_0x55af76[_0x97b3('0x43')]=[{'all':!![]}];}return db[_0x97b3('0xe7')][_0x97b3('0x48')](_0x55af76);})['then'](function(_0x283586){_0x61c289[_0x97b3('0x49')]=_0x283586;return _0x61c289;});}})['then'](respondWithFilteredResult(_0x536eb2,_0x55af76))[_0x97b3('0x1a')](handleError(_0x536eb2,null));};exports['getSmsInteractions']=function(_0x74e648,_0x3acf23){var _0xa70b3b={};var _0x2f1b0a={};var _0x34b4b9;var _0x3874ea;return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x74e648[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x3acf23,null))[_0x97b3('0x33')](function(_0x55da4d){if(_0x55da4d){_0x34b4b9=_0x55da4d;_0x2f1b0a[_0x97b3('0x55')]=_[_0x97b3('0x57')](db[_0x97b3('0xe8')][_0x97b3('0x37')]);_0x2f1b0a[_0x97b3('0x41')]=_[_0x97b3('0x57')](_0x74e648['query']);_0x2f1b0a[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x2f1b0a[_0x97b3('0x55')],_0x2f1b0a[_0x97b3('0x41')]);_0xa70b3b['attributes']=_[_0x97b3('0x5a')](_0x2f1b0a[_0x97b3('0x55')],qs['fields'](_0x74e648[_0x97b3('0x41')][_0x97b3('0x5b')]));_0xa70b3b[_0x97b3('0x46')]=_0xa70b3b[_0x97b3('0x46')][_0x97b3('0x4b')]?_0xa70b3b['attributes']:_0x2f1b0a[_0x97b3('0x55')];_0xa70b3b['order']=qs['sort'](_0x74e648['query']['sort']);_0xa70b3b['where']=qs[_0x97b3('0x59')](_['pick'](_0x74e648['query'],_0x2f1b0a[_0x97b3('0x59')]));if(_0x74e648['query'][_0x97b3('0x2d')]){_0xa70b3b[_0x97b3('0x3f')]=_[_0x97b3('0x5c')](_0xa70b3b[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0xa70b3b['attributes'],function(_0x392f69){var _0x566909={};_0x566909[_0x392f69]={'$like':'%'+_0x74e648[_0x97b3('0x41')]['filter']+'%'};return _0x566909;})});}_0xa70b3b=_[_0x97b3('0x5c')]({},_0xa70b3b,_0x74e648['options']);return _0x34b4b9[_0x97b3('0xe9')](_0xa70b3b);}})[_0x97b3('0x33')](function(_0x107d45){if(_0x107d45){_0x3874ea=_0x107d45[_0x97b3('0x4b')];if(!_0x74e648['query'][_0x97b3('0xd7')]('nolimit')){_0xa70b3b[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0x74e648[_0x97b3('0x41')][_0x97b3('0x22')]);_0xa70b3b[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x74e648[_0x97b3('0x41')]['offset']);}return _0x34b4b9['getSmsInteractions'](_0xa70b3b);}})[_0x97b3('0x33')](function(_0x73f9f1){if(_0x73f9f1){return _0x73f9f1?{'count':_0x3874ea,'rows':_0x73f9f1}:null;}})[_0x97b3('0x33')](respondWithResult(_0x3acf23,null))[_0x97b3('0x1a')](handleError(_0x3acf23,null));};exports[_0x97b3('0xea')]=function(_0x5649f8,_0x50cd7b){var _0x137a31={};var _0x57ca6e={};var _0x16a9fc;var _0x57453e;return db['User']['findOne']({'where':{'id':_0x5649f8['params']['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x50cd7b,null))[_0x97b3('0x33')](function(_0x43e4d5){if(_0x43e4d5){_0x16a9fc=_0x43e4d5;_0x57ca6e['model']=_[_0x97b3('0x57')](db[_0x97b3('0xeb')][_0x97b3('0x37')]);_0x57ca6e['query']=_[_0x97b3('0x57')](_0x5649f8[_0x97b3('0x41')]);_0x57ca6e['filters']=_[_0x97b3('0x5a')](_0x57ca6e[_0x97b3('0x55')],_0x57ca6e[_0x97b3('0x41')]);_0x137a31[_0x97b3('0x46')]=_['intersection'](_0x57ca6e[_0x97b3('0x55')],qs[_0x97b3('0x5b')](_0x5649f8[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x137a31[_0x97b3('0x46')]=_0x137a31[_0x97b3('0x46')][_0x97b3('0x4b')]?_0x137a31[_0x97b3('0x46')]:_0x57ca6e[_0x97b3('0x55')];_0x137a31[_0x97b3('0xce')]=qs['sort'](_0x5649f8[_0x97b3('0x41')]['sort']);_0x137a31[_0x97b3('0x3f')]=qs['filters'](_[_0x97b3('0xd0')](_0x5649f8[_0x97b3('0x41')],_0x57ca6e[_0x97b3('0x59')]));if(_0x5649f8[_0x97b3('0x41')]['filter']){_0x137a31[_0x97b3('0x3f')]=_['merge'](_0x137a31[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0x137a31['attributes'],function(_0x1407f0){var _0x47c85d={};_0x47c85d[_0x1407f0]={'$like':'%'+_0x5649f8[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x47c85d;})});}_0x137a31=_[_0x97b3('0x5c')]({},_0x137a31,_0x5649f8[_0x97b3('0x5d')]);return _0x16a9fc[_0x97b3('0xea')](_0x137a31);}})['then'](function(_0x2ce39b){if(_0x2ce39b){_0x57453e=_0x2ce39b[_0x97b3('0x4b')];if(!_0x5649f8[_0x97b3('0x41')]['hasOwnProperty']('nolimit')){_0x137a31[_0x97b3('0x22')]=qs['limit'](_0x5649f8[_0x97b3('0x41')][_0x97b3('0x22')]);_0x137a31[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x5649f8['query'][_0x97b3('0x1f')]);}return _0x16a9fc[_0x97b3('0xea')](_0x137a31);}})[_0x97b3('0x33')](function(_0xacd2ed){if(_0xacd2ed){return _0xacd2ed?{'count':_0x57453e,'rows':_0xacd2ed}:null;}})[_0x97b3('0x33')](respondWithResult(_0x50cd7b,null))[_0x97b3('0x1a')](handleError(_0x50cd7b,null));};exports[_0x97b3('0xec')]=function(_0x1c6f7d,_0x1d4fa9){var _0x2d07d1={};var _0x12374f={};var _0x311604;var _0x187bd3;return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x1c6f7d[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x1d4fa9,null))[_0x97b3('0x33')](function(_0x139f73){if(_0x139f73){_0x311604=_0x139f73;_0x12374f[_0x97b3('0x55')]=_[_0x97b3('0x57')](db[_0x97b3('0xed')][_0x97b3('0x37')]);_0x12374f[_0x97b3('0x41')]=_[_0x97b3('0x57')](_0x1c6f7d[_0x97b3('0x41')]);_0x12374f[_0x97b3('0x59')]=_['intersection'](_0x12374f[_0x97b3('0x55')],_0x12374f[_0x97b3('0x41')]);_0x2d07d1[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0x12374f[_0x97b3('0x55')],qs['fields'](_0x1c6f7d[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x2d07d1[_0x97b3('0x46')]=_0x2d07d1[_0x97b3('0x46')][_0x97b3('0x4b')]?_0x2d07d1[_0x97b3('0x46')]:_0x12374f['model'];_0x2d07d1[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x1c6f7d[_0x97b3('0x41')][_0x97b3('0xcf')]);_0x2d07d1[_0x97b3('0x3f')]=qs[_0x97b3('0x59')](_['pick'](_0x1c6f7d[_0x97b3('0x41')],_0x12374f[_0x97b3('0x59')]));if(_0x1c6f7d[_0x97b3('0x41')][_0x97b3('0x2d')]){_0x2d07d1[_0x97b3('0x3f')]=_['merge'](_0x2d07d1[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0x2d07d1[_0x97b3('0x46')],function(_0x186dc3){var _0x599c50={};_0x599c50[_0x186dc3]={'$like':'%'+_0x1c6f7d[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x599c50;})});}_0x2d07d1=_[_0x97b3('0x5c')]({},_0x2d07d1,_0x1c6f7d[_0x97b3('0x5d')]);return _0x311604['getWhatsappInteractions'](_0x2d07d1);}})[_0x97b3('0x33')](function(_0x28cf1e){if(_0x28cf1e){_0x187bd3=_0x28cf1e['length'];if(!_0x1c6f7d[_0x97b3('0x41')][_0x97b3('0xd7')]('nolimit')){_0x2d07d1[_0x97b3('0x22')]=qs['limit'](_0x1c6f7d['query'][_0x97b3('0x22')]);_0x2d07d1[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x1c6f7d[_0x97b3('0x41')]['offset']);}return _0x311604[_0x97b3('0xec')](_0x2d07d1);}})[_0x97b3('0x33')](function(_0x3069f0){if(_0x3069f0){return _0x3069f0?{'count':_0x187bd3,'rows':_0x3069f0}:null;}})[_0x97b3('0x33')](respondWithResult(_0x1d4fa9,null))[_0x97b3('0x1a')](handleError(_0x1d4fa9,null));};exports['login']=function(_0x2b2ca1,_0x26a4aa,_0x244a18){var _0x1147e7;var _0x366d88;var _0x50b63d;var _0x209aa8=!_[_0x97b3('0x68')](_0x2b2ca1[_0x97b3('0x54')]['id'])?_0x2b2ca1[_0x97b3('0x54')]['id']:!_[_0x97b3('0x68')](_0x2b2ca1[_0x97b3('0x29')]['id'])?_0x2b2ca1[_0x97b3('0x29')]['id']:null;return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x209aa8,'role':{'$or':[_0x97b3('0x86'),'user',_0x97b3('0x2b')]}},'attributes':['id',_0x97b3('0x31'),_0x97b3('0xee'),_0x97b3('0xef'),_0x97b3('0x27'),_0x97b3('0x6e'),_0x97b3('0xf0')]})[_0x97b3('0x33')](function(_0x4d8a42){if(_0x4d8a42){if(_0x4d8a42[_0x97b3('0x27')]===_0x97b3('0x2b')){_0x1147e7=_0x4d8a42;if(_0x2b2ca1['body'][_0x97b3('0xa6')]){_0x50b63d=util['format'](_0x97b3('0xf1'),_0x1147e7[_0x2b2ca1[_0x97b3('0x5f')][_0x97b3('0xa6')]]);}else if(_0x2b2ca1[_0x97b3('0x5f')][_0x97b3('0xf2')]){_0x50b63d=util['format']('SIP/%s',_0x2b2ca1[_0x97b3('0x5f')]['intrf']);}else{_0x50b63d=util[_0x97b3('0xf3')](_0x97b3('0xb3'),_0x1147e7[_0x97b3('0x31')]);}socket['to'](util[_0x97b3('0xf3')](_0x97b3('0xf4'),_0x1147e7[_0x97b3('0x31')]))[_0x97b3('0xaf')](_0x97b3('0xf5'),{'user':{'id':_0x1147e7['id'],'name':_0x1147e7['name']},'ip':_0x2b2ca1[_0x97b3('0xf6')][_0x97b3('0xf7')]||_0x2b2ca1[_0x97b3('0xf8')]['remoteAddress']||_0x2b2ca1[_0x97b3('0xf9')][_0x97b3('0xfa')]||_0x2b2ca1[_0x97b3('0xf8')][_0x97b3('0xf9')]['remoteAddress']});return db[_0x97b3('0xb4')][_0x97b3('0x25')]({'where':{'membername':_0x1147e7[_0x97b3('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x97b3('0x96'))]['ValidationError'](_0x97b3('0xfb'));}})[_0x97b3('0x33')](function(){if(_0x1147e7){return _0x1147e7[_0x97b3('0xfc')]({'raw':!![]});}})[_0x97b3('0x33')](function(_0x1e9c9b){if(_0x1147e7){var _0x47337d=[];if(_0x1e9c9b){_0x366d88=_0x1e9c9b;if(_0x366d88[_0x97b3('0x4b')]){for(var _0x57d875=0x0;_0x57d875<_0x366d88[_0x97b3('0x4b')];_0x57d875++){_0x47337d[_0x97b3('0x47')]({'membername':_0x1147e7[_0x97b3('0x31')],'UserId':_0x1147e7['id'],'queue_name':_0x366d88[_0x57d875][_0x97b3('0x31')],'VoiceQueueId':_0x366d88[_0x57d875]['id'],'interface':_0x50b63d,'paused':_0x1147e7[_0x97b3('0xf0')]||![],'penalty':_0x366d88[_0x57d875][_0x97b3('0xfd')]||0x0});}return BPromise[_0x97b3('0x90')](_0x47337d,function(_0x3fbf4a){return db[_0x97b3('0xb4')][_0x97b3('0xfe')](_0x3fbf4a);});}}}})['then'](function(){if(_0x1147e7){return db[_0x97b3('0xff')]['findAll']({'where':{'membername':_0x1147e7['name'],'exitAt':null}});}})[_0x97b3('0x33')](function(_0x28c7d4){if(_0x1147e7){var _0x18fec7=[];_0x28c7d4[_0x97b3('0x100')](function(_0x36ad92){_0x18fec7[_0x97b3('0x47')](_0x36ad92[_0x97b3('0x24')]({'exitAt':moment()[_0x97b3('0xf3')](_0x97b3('0x101'))}));});return BPromise[_0x97b3('0x52')](_0x18fec7);}})[_0x97b3('0x33')](function(){if(_0x1147e7){var _0x49de28=[];var _0x2021e7=[];var _0x4f72fd=utils[_0x97b3('0x102')]();var _0x10a400={'membername':_0x1147e7[_0x97b3('0x31')],'interface':_0x50b63d,'enterAt':moment()[_0x97b3('0xf3')](_0x97b3('0x101')),'role':_0x1147e7[_0x97b3('0x27')],'internal':_0x1147e7[_0x97b3('0x6e')]};_0x4f72fd[_0x97b3('0x100')](function(_0xc6eb45){_0x49de28[_0x97b3('0x47')](_['merge']({'channel':_0xc6eb45,'type':_0x97b3('0x103'),'data1':_0x2b2ca1[_0x97b3('0x5f')]['device'],'data2':_0x50b63d},_0x10a400));if(_0x1147e7[_0x97b3('0xf0')]){_0x2021e7['push'](_['merge']({'channel':_0xc6eb45,'type':_0x97b3('0x104'),'data1':'LOGININPAUSE'},_0x10a400));}});return db[_0x97b3('0xff')][_0x97b3('0x105')](_0x49de28[_0x97b3('0xcb')](_0x2021e7),{'individualHooks':!![]});}})[_0x97b3('0x33')](function(){if(_0x1147e7){return _0x1147e7[_0x97b3('0x24')]({'online':!![],'lastLoginAt':moment()['format'](_0x97b3('0x101')),'voicePause':_0x1147e7[_0x97b3('0xf0')]||![],'mailPause':_0x1147e7[_0x97b3('0xf0')]||![],'chatPause':_0x1147e7['loginInPause']||![],'faxPause':_0x1147e7[_0x97b3('0xf0')]||![],'smsPause':_0x1147e7[_0x97b3('0xf0')]||![],'openchannelPause':_0x1147e7[_0x97b3('0xf0')]||![],'whatsappPause':_0x1147e7[_0x97b3('0xf0')]||![],'pauseType':_0x1147e7[_0x97b3('0xf0')]?_0x97b3('0x106'):null,'interface':_0x50b63d,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x97b3('0x33')](function(_0x2d0d0e){if(_0x2b2ca1[_0x97b3('0x107')]){return _0x244a18();}else{return BPromise[_0x97b3('0x108')](_0x2d0d0e)['then'](respondWithResult(_0x26a4aa,null));}})[_0x97b3('0x1a')](handleError(_0x26a4aa,null));};exports[_0x97b3('0x109')]=function(_0x23cd37,_0x3b49c4){var _0x470ce8;return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x23cd37[_0x97b3('0x54')]['id'],'role':'agent'},'attributes':['id',_0x97b3('0x31'),_0x97b3('0x27')]})[_0x97b3('0x33')](handleEntityNotFound(_0x3b49c4,null))['then'](function(_0x5a15f1){if(_0x5a15f1){_0x470ce8=_0x5a15f1;return db[_0x97b3('0xb4')]['destroy']({'where':{'membername':_0x470ce8[_0x97b3('0x31')]},'individualHooks':!![]});}})['then'](function(){return db[_0x97b3('0xff')][_0x97b3('0x48')]({'where':{'membername':_0x470ce8[_0x97b3('0x31')],'exitAt':null}});})[_0x97b3('0x33')](function(_0x470cb6){var _0x423021=[];_0x470cb6['forEach'](function(_0x4f7920){_0x423021['push'](_0x4f7920['update']({'exitAt':moment()[_0x97b3('0xf3')](_0x97b3('0x101'))}));});return BPromise[_0x97b3('0x52')](_0x423021);})[_0x97b3('0x33')](function(){return _0x470ce8[_0x97b3('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x97b3('0x33')](respondWithResult(_0x3b49c4,null))[_0x97b3('0x1a')](handleError(_0x3b49c4,null));};exports['pause']=function(_0x24cb86,_0xff50e2){var _0x233ca8;return db[_0x97b3('0xb4')]['update']({'paused':0x1},{'where':{'UserId':_0x24cb86[_0x97b3('0x54')]['id']},'individualHooks':!![]})[_0x97b3('0x33')](function(){return db[_0x97b3('0x40')][_0x97b3('0x30')]({'where':{'id':_0x24cb86['params']['id'],'role':_0x97b3('0x2b')},'attributes':['id',_0x97b3('0x31'),_0x97b3('0x27'),_0x97b3('0x6e'),_0x97b3('0xa6')]});})['then'](handleEntityNotFound(_0xff50e2,null))[_0x97b3('0x33')](function(_0x2d172d){if(_0x2d172d){_0x233ca8=_0x2d172d;return respondWithRpcPromise('QueuePause',_0x97b3('0x10a'),{'id':_0x233ca8['id'],'name':_0x233ca8[_0x97b3('0x31')],'pause':!![]});}})[_0x97b3('0x33')](function(){if(_0x233ca8){return db[_0x97b3('0xff')]['findAll']({'where':{'membername':_0x233ca8[_0x97b3('0x31')],'type':_0x97b3('0x104'),'exitAt':null}});}})[_0x97b3('0x33')](function(_0x194a01){if(_0x194a01['length']){var _0xa1748d=moment()[_0x97b3('0xf3')](_0x97b3('0x101'));for(var _0x14195d=0x0,_0x113d63=_0x194a01[_0x97b3('0x4b')];_0x14195d<_0x113d63;_0x14195d++){_0x194a01[_0x14195d][_0x97b3('0x10b')]({'exitAt':_0xa1748d});}}})[_0x97b3('0x33')](function(){var _0x605d67=[];var _0x58fa56=utils[_0x97b3('0x102')]();_0x58fa56[_0x97b3('0x100')](function(_0x327415){_0x605d67[_0x97b3('0x47')]({'channel':_0x327415,'membername':_0x233ca8[_0x97b3('0x31')],'interface':_[_0x97b3('0x68')](_0x233ca8[_0x97b3('0xa6')])?util[_0x97b3('0xf3')]('SIP/%s',_0x233ca8[_0x97b3('0x31')]):_0x233ca8[_0x97b3('0xa6')],'type':_0x97b3('0x104'),'enterAt':moment()[_0x97b3('0xf3')](_0x97b3('0x101')),'data1':_0x24cb86[_0x97b3('0x5f')]['type']||'DEFAULT\x20PAUSE','role':_0x233ca8['role'],'internal':_0x233ca8[_0x97b3('0x6e')]});});return db[_0x97b3('0xff')]['bulkCreate'](_0x605d67,{'individualHooks':!![]});})[_0x97b3('0x33')](function(){return _0x233ca8[_0x97b3('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x24cb86['body'][_0x97b3('0x3a')]||_0x97b3('0x10c'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x97b3('0x33')](respondWithResult(_0xff50e2,null))['catch'](handleError(_0xff50e2,null));};exports[_0x97b3('0x10d')]=function(_0x399b1a,_0x4faf9a){var _0x5d87e6;return db[_0x97b3('0x40')]['find']({'where':{'id':_0x399b1a['params']['id']},'attributes':['id',_0x97b3('0x31'),_0x97b3('0x27'),'voicePause',_0x97b3('0x10e'),'chatPause',_0x97b3('0x10f'),_0x97b3('0x110'),_0x97b3('0x111'),'whatsapppause','pauseType',_0x97b3('0x112')]})[_0x97b3('0x33')](handleEntityNotFound(_0x4faf9a,null))[_0x97b3('0x33')](function(_0x40b90e){if(_0x40b90e){_0x5d87e6=_0x40b90e;if(_0x399b1a[_0x97b3('0x5f')]['channel']&&!utils[_0x97b3('0xa7')](_0x399b1a[_0x97b3('0x5f')][_0x97b3('0xb5')])){throw new db['Sequelize'][(_0x97b3('0x97'))](_0x97b3('0xa8'));}switch(_0x399b1a[_0x97b3('0x5f')][_0x97b3('0xb5')]){case _0x97b3('0xb1'):return respondWithRpcPromise(_0x97b3('0x113'),_0x97b3('0x10d'),{'id':_0x5d87e6['id'],'name':_0x5d87e6[_0x97b3('0x31')],'pause':![]})[_0x97b3('0x33')](function(){return db[_0x97b3('0xb4')][_0x97b3('0x24')]({'paused':0x0},{'where':{'UserId':_0x5d87e6['id']},'individualHooks':!![]});})[_0x97b3('0x33')](function(){return db[_0x97b3('0xff')][_0x97b3('0x30')]({'where':{'channel':_0x399b1a['body'][_0x97b3('0xb5')],'membername':_0x5d87e6[_0x97b3('0x31')],'type':_0x97b3('0x104'),'exitAt':null}});})[_0x97b3('0x33')](function(_0x141705){if(_0x141705){return _0x141705['update']({'exitAt':moment()[_0x97b3('0xf3')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x97b3('0x114')},{'individualHooks':!![]});}return null;})[_0x97b3('0x33')](function(){return _0x5d87e6[_0x97b3('0x24')]({'voicePause':![]});});case _0x97b3('0x4f'):case'chat':case _0x97b3('0x5e'):case'sms':case _0x97b3('0x51'):case _0x97b3('0x50'):return db[_0x97b3('0xff')][_0x97b3('0x30')]({'where':{'channel':_0x399b1a['body'][_0x97b3('0xb5')],'membername':_0x5d87e6[_0x97b3('0x31')],'type':_0x97b3('0x104'),'exitAt':null}})['then'](function(_0x5a605d){if(_0x5a605d){return _0x5a605d[_0x97b3('0x24')]({'exitAt':moment()[_0x97b3('0xf3')](_0x97b3('0x101')),'data2':_0x97b3('0x114')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x58cdf3={};_[_0x97b3('0x115')](_0x58cdf3,util[_0x97b3('0xf3')](_0x97b3('0x116'),_0x399b1a[_0x97b3('0x5f')]['channel'],_0x97b3('0x117')),![]);return _0x5d87e6['update'](_0x58cdf3);});default:return respondWithRpcPromise('QueuePause',_0x97b3('0x10d'),{'id':_0x5d87e6['id'],'name':_0x5d87e6[_0x97b3('0x31')],'pause':![]})[_0x97b3('0x33')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x5d87e6['id']}});})[_0x97b3('0x33')](function(){return db[_0x97b3('0xff')]['findAll']({'where':{'membername':_0x5d87e6['name'],'type':_0x97b3('0x104'),'exitAt':null}});})['then'](function(_0xbb5c60){var _0x55f326=[];_0xbb5c60[_0x97b3('0x100')](function(_0x52ff89){_0x55f326[_0x97b3('0x47')](_0x52ff89[_0x97b3('0x24')]({'exitAt':moment()[_0x97b3('0xf3')](_0x97b3('0x101')),'data2':_0x97b3('0x114')}));});return BPromise[_0x97b3('0x52')](_0x55f326);})[_0x97b3('0x33')](function(){return _0x5d87e6[_0x97b3('0x24')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x97b3('0x33')](respondWithResult(_0x4faf9a,null))[_0x97b3('0x1a')](handleError(_0x4faf9a,null));};exports['getTeams']=function(_0x434ba6,_0x80eebc){var _0x37a428={};var _0x44bfef={};var _0x3eab6a;var _0x2f4961;return db[_0x97b3('0x40')]['findOne']({'where':{'id':_0x434ba6[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x80eebc,null))[_0x97b3('0x33')](function(_0x3a1020){if(_0x3a1020){_0x3eab6a=_0x3a1020;_0x44bfef['model']=_[_0x97b3('0x57')](db[_0x97b3('0x118')][_0x97b3('0x37')]);_0x44bfef[_0x97b3('0x41')]=_[_0x97b3('0x57')](_0x434ba6[_0x97b3('0x41')]);_0x44bfef['filters']=_[_0x97b3('0x5a')](_0x44bfef[_0x97b3('0x55')],_0x44bfef[_0x97b3('0x41')]);_0x37a428['attributes']=_[_0x97b3('0x5a')](_0x44bfef[_0x97b3('0x55')],qs['fields'](_0x434ba6['query']['fields']));_0x37a428[_0x97b3('0x46')]=_0x37a428[_0x97b3('0x46')][_0x97b3('0x4b')]?_0x37a428[_0x97b3('0x46')]:_0x44bfef[_0x97b3('0x55')];_0x37a428[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x434ba6['query'][_0x97b3('0xcf')]);_0x37a428['where']=qs[_0x97b3('0x59')](_['pick'](_0x434ba6[_0x97b3('0x41')],_0x44bfef[_0x97b3('0x59')]));if(_0x434ba6[_0x97b3('0x41')][_0x97b3('0x2d')]){_0x37a428['where']=_[_0x97b3('0x5c')](_0x37a428[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0x37a428[_0x97b3('0x46')],function(_0x1cde44){var _0x1e06c4={};_0x1e06c4[_0x1cde44]={'$like':'%'+_0x434ba6[_0x97b3('0x41')]['filter']+'%'};return _0x1e06c4;})});}_0x37a428=_['merge']({},_0x37a428,_0x434ba6[_0x97b3('0x5d')]);return _0x3eab6a[_0x97b3('0x119')](_0x37a428);}})[_0x97b3('0x33')](function(_0x27811f){if(_0x27811f){_0x2f4961=_0x27811f['length'];if(!_0x434ba6[_0x97b3('0x41')][_0x97b3('0xd7')]('nolimit')){_0x37a428[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0x434ba6['query'][_0x97b3('0x22')]);_0x37a428[_0x97b3('0x1f')]=qs[_0x97b3('0x1f')](_0x434ba6['query'][_0x97b3('0x1f')]);}return _0x3eab6a[_0x97b3('0x119')](_0x37a428);}})[_0x97b3('0x33')](function(_0x342ced){if(_0x342ced){return _0x342ced?{'count':_0x2f4961,'rows':_0x342ced}:null;}})[_0x97b3('0x33')](respondWithResult(_0x80eebc,null))[_0x97b3('0x1a')](handleError(_0x80eebc,null));};exports['addTeams']=function(_0xca408b,_0x21641f){return db['User']['find']({'where':{'id':_0xca408b[_0x97b3('0x54')]['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x21641f,null))[_0x97b3('0x33')](function(_0xed7157){if(_0xed7157){var _0x3cda3a=_0xed7157[_0x97b3('0x26')]({'plain':!![]});return _0xed7157[_0x97b3('0x11a')](_0xca408b[_0x97b3('0x5f')][_0x97b3('0x62')],_[_0x97b3('0x63')](_0xca408b['body'],[_0x97b3('0x62'),'id'])||{})[_0x97b3('0x33')](function(){for(var _0x2d4d4b=0x0;_0x2d4d4b<_0xca408b[_0x97b3('0x5f')]['ids'][_0x97b3('0x4b')];_0x2d4d4b++){var _0x3e77d4=[];var _0x2ef255={};db[_0x97b3('0x118')]['findOne']({'where':{'id':_0xca408b[_0x97b3('0x5f')][_0x97b3('0x62')][_0x2d4d4b]}})[_0x97b3('0x33')](function(_0x2fb62b){_0x2ef255=_0x2fb62b[_0x97b3('0x4d')];_0x3e77d4[_0x97b3('0x47')](_0x2fb62b[_0x97b3('0xfc')]()[_0x97b3('0x33')](function(_0x5a7f14){for(var _0x107e42=0x0;_0x107e42<_0x5a7f14[_0x97b3('0x4b')];_0x107e42++){_0x5a7f14[_0x107e42][_0x97b3('0x11b')]('channel',_0x97b3('0x11c'));}return _0x5a7f14;}));_0x3e77d4[_0x97b3('0x47')](_0x2fb62b['getChatQueues']()[_0x97b3('0x33')](function(_0x19a071){for(var _0x578a39=0x0;_0x578a39<_0x19a071[_0x97b3('0x4b')];_0x578a39++){_0x19a071[_0x578a39][_0x97b3('0x11b')]('channel',_0x97b3('0x11d'));}return _0x19a071;}));_0x3e77d4['push'](_0x2fb62b['getMailQueues']()[_0x97b3('0x33')](function(_0x5c9c09){for(var _0x1e3ecc=0x0;_0x1e3ecc<_0x5c9c09[_0x97b3('0x4b')];_0x1e3ecc++){_0x5c9c09[_0x1e3ecc]['setDataValue']('channel',_0x97b3('0x11e'));}return _0x5c9c09;}));_0x3e77d4[_0x97b3('0x47')](_0x2fb62b[_0x97b3('0x11f')]()[_0x97b3('0x33')](function(_0x2bb67d){for(var _0x1a0522=0x0;_0x1a0522<_0x2bb67d[_0x97b3('0x4b')];_0x1a0522++){_0x2bb67d[_0x1a0522][_0x97b3('0x11b')](_0x97b3('0xb5'),'Sms');}return _0x2bb67d;}));_0x3e77d4['push'](_0x2fb62b[_0x97b3('0x120')]()[_0x97b3('0x33')](function(_0x5bbd6b){for(var _0x5c52df=0x0;_0x5c52df<_0x5bbd6b[_0x97b3('0x4b')];_0x5c52df++){_0x5bbd6b[_0x5c52df][_0x97b3('0x11b')](_0x97b3('0xb5'),'Whatsapp');}return _0x5bbd6b;}));_0x3e77d4[_0x97b3('0x47')](_0x2fb62b[_0x97b3('0x121')]()[_0x97b3('0x33')](function(_0x1d100d){for(var _0x3b8fbd=0x0;_0x3b8fbd<_0x1d100d[_0x97b3('0x4b')];_0x3b8fbd++){_0x1d100d[_0x3b8fbd]['setDataValue']('channel','Fax');}return _0x1d100d;}));_0x3e77d4[_0x97b3('0x47')](_0x2fb62b[_0x97b3('0x122')]()[_0x97b3('0x33')](function(_0x37501b){for(var _0x1848e7=0x0;_0x1848e7<_0x37501b[_0x97b3('0x4b')];_0x1848e7++){_0x37501b[_0x1848e7]['setDataValue']('channel',_0x97b3('0x123'));}return _0x37501b;}));return BPromise[_0x97b3('0x52')](_0x3e77d4);})[_0x97b3('0x33')](function(_0x2325b5){var _0x43f228=_[_0x97b3('0x124')](_0x2325b5);_0x3e77d4=[];return db[_0x97b3('0x6a')][_0x97b3('0x125')](function(_0xf61497){for(var _0xc52dd4=0x0;_0xc52dd4<_0x43f228[_0x97b3('0x4b')];_0xc52dd4++){_0x3e77d4[_0x97b3('0x47')](_0x43f228[_0xc52dd4][_0x97b3('0x126')](_0x3cda3a['id']),{'transaction':_0xf61497});}return BPromise[_0x97b3('0x52')](_0x3e77d4)['then'](function(){if(_0x3cda3a[_0x97b3('0xa4')]){return BPromise[_0x97b3('0x90')](_[_0x97b3('0x2d')](_0x43f228,function(_0x59bac1){return _0x59bac1[_0x97b3('0x127')]('channel')===_0x97b3('0x11c');}),function(_0x57ac0e){return db['UserVoiceQueueRt']['upsert']({'membername':_0x3cda3a[_0x97b3('0x31')],'UserId':_0x3cda3a['id'],'queue_name':_0x57ac0e[_0x97b3('0x31')],'VoiceQueueId':_0x57ac0e['id'],'interface':_[_0x97b3('0x68')](_0x3cda3a['interface'])?util['format']('SIP/%s',_0x3cda3a[_0x97b3('0x31')]):_0x3cda3a[_0x97b3('0xa6')],'paused':_0x3cda3a[_0x97b3('0xa5')]||![],'penalty':_0x3cda3a[_0x97b3('0xab')]},{'transaction':_0xf61497});});}else{return;}})[_0x97b3('0x33')](function(){for(var _0x198ad0=0x0;_0x198ad0<_0x43f228[_0x97b3('0x4b')];_0x198ad0++){var _0x12d57a=_0x43f228[_0x198ad0][_0x97b3('0x127')](_0x97b3('0xb5'));var _0x16a07f=_0x12d57a+_0x97b3('0xae');socket[_0x97b3('0xaf')](_0x97b3('0x29')+_0x12d57a+'Queue:save',{'UserId':_0x3cda3a['id'],['queueField']:_0x43f228[_0x198ad0]['id']});}});});})[_0x97b3('0x33')](function(){db[_0x97b3('0x128')][_0x97b3('0x9d')]({'where':{'teamId':_0x2ef255['id']}})['then'](function(_0x2e96df){if(_0x2e96df){db[_0x97b3('0x129')][_0x97b3('0x84')]({'UserId':_0xca408b[_0x97b3('0x54')]['id'],'VoicePrefixId':_0x2e96df['VoicePrefixId']});}});});}});}})[_0x97b3('0x33')](respondWithStatusCode(_0x21641f,null))[_0x97b3('0x1a')](handleError(_0x21641f,null));};exports[_0x97b3('0x12a')]=function(_0x49c66d,_0x5cb562){return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x49c66d[_0x97b3('0x54')]['id']}})['then'](handleEntityNotFound(_0x5cb562,null))[_0x97b3('0x33')](function(_0x46e9b0){if(_0x46e9b0){var _0x43c36a=_0x46e9b0['get']({'plain':!![]});var _0xf48637=_0x49c66d[_0x97b3('0x41')][_0x97b3('0x62')];return _0x46e9b0['removeTeams'](_0xf48637)[_0x97b3('0x33')](function(){for(var _0x4e9fdd=0x0;_0x4e9fdd<_0xf48637[_0x97b3('0x4b')];_0x4e9fdd++){var _0x26cd84=[];var _0x70b0c={};db[_0x97b3('0x118')][_0x97b3('0x9d')]({'where':{'id':_0xf48637[_0x4e9fdd]}})[_0x97b3('0x33')](function(_0x3fddb4){_0x70b0c=_0x3fddb4[_0x97b3('0x4d')];_0x26cd84[_0x97b3('0x47')](_0x3fddb4[_0x97b3('0xfc')]()[_0x97b3('0x33')](function(_0x4377b6){for(var _0x257336=0x0;_0x257336<_0x4377b6['length'];_0x257336++){_0x4377b6[_0x257336][_0x97b3('0x11b')](_0x97b3('0xb5'),_0x97b3('0x11c'));}return _0x4377b6;}));_0x26cd84[_0x97b3('0x47')](_0x3fddb4['getChatQueues']()[_0x97b3('0x33')](function(_0x123869){for(var _0x33185e=0x0;_0x33185e<_0x123869[_0x97b3('0x4b')];_0x33185e++){_0x123869[_0x33185e][_0x97b3('0x11b')](_0x97b3('0xb5'),_0x97b3('0x11d'));}return _0x123869;}));_0x26cd84[_0x97b3('0x47')](_0x3fddb4[_0x97b3('0x12b')]()[_0x97b3('0x33')](function(_0x3fc322){for(var _0x1c52cd=0x0;_0x1c52cd<_0x3fc322[_0x97b3('0x4b')];_0x1c52cd++){_0x3fc322[_0x1c52cd][_0x97b3('0x11b')](_0x97b3('0xb5'),_0x97b3('0x11e'));}return _0x3fc322;}));_0x26cd84[_0x97b3('0x47')](_0x3fddb4[_0x97b3('0x11f')]()[_0x97b3('0x33')](function(_0x24ba79){for(var _0xe92270=0x0;_0xe92270<_0x24ba79[_0x97b3('0x4b')];_0xe92270++){_0x24ba79[_0xe92270]['setDataValue'](_0x97b3('0xb5'),_0x97b3('0x12c'));}return _0x24ba79;}));_0x26cd84[_0x97b3('0x47')](_0x3fddb4['getWhatsappQueues']()[_0x97b3('0x33')](function(_0x2d7d45){for(var _0x160934=0x0;_0x160934<_0x2d7d45[_0x97b3('0x4b')];_0x160934++){_0x2d7d45[_0x160934][_0x97b3('0x11b')](_0x97b3('0xb5'),_0x97b3('0x12d'));}return _0x2d7d45;}));_0x26cd84[_0x97b3('0x47')](_0x3fddb4[_0x97b3('0x121')]()['then'](function(_0x5652bc){for(var _0x19f186=0x0;_0x19f186<_0x5652bc[_0x97b3('0x4b')];_0x19f186++){_0x5652bc[_0x19f186]['setDataValue'](_0x97b3('0xb5'),_0x97b3('0x12e'));}return _0x5652bc;}));_0x26cd84[_0x97b3('0x47')](_0x3fddb4[_0x97b3('0x122')]()['then'](function(_0x318fa2){for(var _0x94863f=0x0;_0x94863f<_0x318fa2[_0x97b3('0x4b')];_0x94863f++){_0x318fa2[_0x94863f][_0x97b3('0x11b')](_0x97b3('0xb5'),_0x97b3('0x123'));}return _0x318fa2;}));return BPromise['all'](_0x26cd84);})[_0x97b3('0x33')](function(_0x1c8f77){var _0x40169a=_[_0x97b3('0x124')](_0x1c8f77);_0x26cd84=[];return db['sequelize']['transaction'](function(_0x1100ac){for(var _0x1cec3d=0x0;_0x1cec3d<_0x40169a[_0x97b3('0x4b')];_0x1cec3d++){_0x26cd84[_0x97b3('0x47')](_0x40169a[_0x1cec3d]['removeAgent'](_0x43c36a['id']),{'transaction':_0x1100ac});}return BPromise[_0x97b3('0x52')](_0x26cd84)[_0x97b3('0x33')](function(){if(_0x43c36a[_0x97b3('0xa4')]){return BPromise['each'](_[_0x97b3('0x2d')](_0x40169a,function(_0x31a08a){return _0x31a08a[_0x97b3('0x127')]('channel')==='Voice';}),function(_0x282b84){return db[_0x97b3('0xb4')][_0x97b3('0x25')]({'where':{'VoiceQueueId':_0x282b84['id'],'UserId':_0x43c36a['id']},'transaction':_0x1100ac});});}else{return;}})['then'](function(){db[_0x97b3('0x128')][_0x97b3('0x9d')]({'where':{'teamId':_0x70b0c['id']}})['then'](function(_0x3022e7){if(_0x3022e7){return db[_0x97b3('0x129')][_0x97b3('0x25')]({'where':{'UserId':_0x43c36a['id'],'VoicePrefixId':_0x3022e7['dataValues'][_0x97b3('0x12f')]}});}});})[_0x97b3('0x33')](function(){for(var _0x26c0a6=0x0;_0x26c0a6<_0x40169a[_0x97b3('0x4b')];_0x26c0a6++){var _0x46f0cb=_0x40169a[_0x26c0a6][_0x97b3('0x127')](_0x97b3('0xb5'));var _0x5af3fd=_0x46f0cb+'QueueId';socket[_0x97b3('0xaf')](_0x97b3('0x29')+_0x46f0cb+_0x97b3('0xb7'),{'UserId':_0x43c36a['id'],['queueField']:_0x40169a[_0x26c0a6]['id']});}});});});}});}})[_0x97b3('0x33')](respondWithStatusCode(_0x5cb562,null))[_0x97b3('0x1a')](handleError(_0x5cb562,null));};exports[_0x97b3('0x130')]=function(_0x125d0a,_0x125d18){var _0x4ad30c={};var _0xbfd3ea={};var _0x43916d;var _0xc99867;return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x125d0a['params']['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x125d18,null))['then'](function(_0x57bbb0){if(_0x57bbb0){_0x43916d=_0x57bbb0;_0xbfd3ea[_0x97b3('0x55')]=_[_0x97b3('0x57')](db[_0x97b3('0xd1')][_0x97b3('0x37')]);_0xbfd3ea[_0x97b3('0x41')]=_['keys'](_0x125d0a[_0x97b3('0x41')]);_0xbfd3ea[_0x97b3('0x59')]=_['intersection'](_0xbfd3ea[_0x97b3('0x55')],_0xbfd3ea[_0x97b3('0x41')]);_0x4ad30c[_0x97b3('0x46')]=_[_0x97b3('0x5a')](_0xbfd3ea['model'],qs[_0x97b3('0x5b')](_0x125d0a[_0x97b3('0x41')][_0x97b3('0x5b')]));_0x4ad30c['attributes']=_0x4ad30c[_0x97b3('0x46')][_0x97b3('0x4b')]?_0x4ad30c[_0x97b3('0x46')]:_0xbfd3ea[_0x97b3('0x55')];_0x4ad30c[_0x97b3('0xce')]=qs[_0x97b3('0xcf')](_0x125d0a[_0x97b3('0x41')]['sort']);_0x4ad30c['where']=qs['filters'](_[_0x97b3('0xd0')](_0x125d0a[_0x97b3('0x41')],_0xbfd3ea['filters']));if(_0x125d0a[_0x97b3('0x41')]['filter']){_0x4ad30c[_0x97b3('0x3f')]=_[_0x97b3('0x5c')](_0x4ad30c['where'],{'$or':_[_0x97b3('0x38')](_0x4ad30c[_0x97b3('0x46')],function(_0x54abcf){var _0x287b0e={};_0x287b0e[_0x54abcf]={'$like':'%'+_0x125d0a['query'][_0x97b3('0x2d')]+'%'};return _0x287b0e;})});}_0x4ad30c=_[_0x97b3('0x5c')]({},_0x4ad30c,_0x125d0a[_0x97b3('0x5d')]);return _0x43916d['getLists'](_0x4ad30c);}})[_0x97b3('0x33')](function(_0x256ce3){if(_0x256ce3){_0xc99867=_0x256ce3[_0x97b3('0x4b')];if(!_0x125d0a[_0x97b3('0x41')][_0x97b3('0xd7')](_0x97b3('0xd8'))){_0x4ad30c[_0x97b3('0x22')]=qs[_0x97b3('0x22')](_0x125d0a[_0x97b3('0x41')][_0x97b3('0x22')]);_0x4ad30c['offset']=qs[_0x97b3('0x1f')](_0x125d0a[_0x97b3('0x41')][_0x97b3('0x1f')]);}return _0x43916d[_0x97b3('0x130')](_0x4ad30c);}})['then'](function(_0x4182b1){if(_0x4182b1){return _0x4182b1?{'count':_0xc99867,'rows':_0x4182b1}:null;}})[_0x97b3('0x33')](respondWithResult(_0x125d18,null))[_0x97b3('0x1a')](handleError(_0x125d18,null));};exports[_0x97b3('0x131')]=function(_0x58a7ff,_0x3399bb){var _0x3145d9={};var _0x214951={};var _0x5f2a4f;return db[_0x97b3('0x40')][_0x97b3('0x9d')]({'where':{'id':_0x58a7ff['params']['id']}})[_0x97b3('0x33')](handleEntityNotFound(_0x3399bb,null))[_0x97b3('0x33')](function(_0x4dc19f){if(_0x4dc19f){_0x5f2a4f=_0x4dc19f;_0x214951[_0x97b3('0x55')]=_[_0x97b3('0x57')](db[_0x97b3('0x40')]['rawAttributes']);_0x214951[_0x97b3('0x41')]=_[_0x97b3('0x57')](_0x58a7ff[_0x97b3('0x41')]);_0x214951[_0x97b3('0x59')]=_[_0x97b3('0x5a')](_0x214951[_0x97b3('0x55')],_0x214951[_0x97b3('0x41')]);_0x3145d9['attributes']=_[_0x97b3('0x5a')](_0x214951[_0x97b3('0x55')],qs[_0x97b3('0x5b')](_0x58a7ff['query'][_0x97b3('0x5b')]));_0x3145d9['attributes']=_0x3145d9[_0x97b3('0x46')][_0x97b3('0x4b')]?_0x3145d9[_0x97b3('0x46')]:_0x214951[_0x97b3('0x55')];_0x3145d9['order']=qs[_0x97b3('0xcf')](_0x58a7ff['query']['sort']);_0x3145d9['where']=qs[_0x97b3('0x59')](_[_0x97b3('0xd0')](_0x58a7ff[_0x97b3('0x41')],_0x214951[_0x97b3('0x59')]));if(_0x58a7ff[_0x97b3('0x41')][_0x97b3('0x2d')]){_0x3145d9[_0x97b3('0x3f')]=_['merge'](_0x3145d9[_0x97b3('0x3f')],{'$or':_[_0x97b3('0x38')](_0x3145d9[_0x97b3('0x46')],function(_0x3df78f){var _0x1fcafd={};_0x1fcafd[_0x3df78f]={'$like':'%'+_0x58a7ff[_0x97b3('0x41')][_0x97b3('0x2d')]+'%'};return _0x1fcafd;})});}_0x3145d9[_0x97b3('0x55')]=db[_0x97b3('0x40')];_0x3145d9['as']=_0x97b3('0x2a');_0x3145d9=_['merge']({},_0x3145d9,_0x58a7ff[_0x97b3('0x5d')]);return _0x5f2a4f[_0x97b3('0xfc')]({'include':[_0x3145d9]});}})[_0x97b3('0x33')](function(_0x24b2e7){if(_0x24b2e7){var _0x5c1318={},_0x21b19c=[];for(var _0x5a681b=0x0;_0x5a681b<_0x24b2e7['length'];_0x5a681b+=0x1){for(var _0x3d18d5=0x0,_0x561774;_0x3d18d5<_0x24b2e7[_0x5a681b][_0x97b3('0x2a')][_0x97b3('0x4b')];_0x3d18d5+=0x1){_0x561774=_0x24b2e7[_0x5a681b][_0x97b3('0x2a')][_0x3d18d5][_0x97b3('0x26')]({'plain':!![]});_0x5c1318[_0x561774['id']]=_0x561774;}}_0x5c1318=_[_0x97b3('0x132')](_0x5c1318);for(var _0x29f462=qs[_0x97b3('0x1f')](_0x58a7ff[_0x97b3('0x41')][_0x97b3('0x1f')]);_0x29f462<_0x5c1318['length']&&_0x21b19c['length']=_0x5d51c4[_0xa6a9('0x50')]){throw new Error(_0xa6a9('0x51'));}})[_0xa6a9('0xe')](function(){if(_0x17670e){return db[_0xa6a9('0x2c')][_0xa6a9('0x52')]({'where':{'membername':_0x17670e[_0xa6a9('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x17670e){return _0x17670e['getVoiceQueues']({'raw':!![]});}})['then'](function(_0xbf9e13){if(_0x17670e){if(_0xbf9e13){var _0x11b594=[];_0x38a492=_0xbf9e13;if(_0x38a492[_0xa6a9('0x2e')]){for(var _0x2c25ce=0x0;_0x2c25ce<_0x38a492[_0xa6a9('0x2e')];_0x2c25ce++){_0x11b594[_0xa6a9('0x33')](db[_0xa6a9('0x2c')][_0xa6a9('0x53')]({'membername':_0x17670e['name'],'UserId':_0x17670e['id'],'queue_name':_0x38a492[_0x2c25ce][_0xa6a9('0x28')],'VoiceQueueId':_0x38a492[_0x2c25ce]['id'],'interface':_0x1f64be,'paused':_0x17670e['loginInPause']||![],'penalty':_0x38a492[_0x2c25ce]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xa6a9('0x47')](_0x11b594);}}}})[_0xa6a9('0xe')](function(){if(_0x17670e){return db[_0xa6a9('0x3f')]['findAll']({'where':{'membername':_0x17670e[_0xa6a9('0x28')],'exitAt':null}});}})[_0xa6a9('0xe')](function(_0x23b7f6){if(_0x17670e){if(_0x23b7f6&&_0x23b7f6[_0xa6a9('0x2e')]){var _0x4e943b=[];_0x23b7f6[_0xa6a9('0x32')](function(_0x3ad57f){_0x4e943b['push'](_0x3ad57f['update']({'exitAt':moment()[_0xa6a9('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xa6a9('0x47')](_0x4e943b);}}})[_0xa6a9('0xe')](function(_0x438f6b){if(_0x17670e){var _0x2c8a20=[];var _0x5a2608=[];var _0x33d189=utils[_0xa6a9('0x54')]();var _0x25437b={'membername':_0x17670e[_0xa6a9('0x28')],'interface':_0x1f64be,'enterAt':moment()['format'](_0xa6a9('0x30')),'role':_0x17670e[_0xa6a9('0x29')],'internal':_0x17670e[_0xa6a9('0x2a')]};_0x33d189['forEach'](function(_0x32f7e0){_0x2c8a20[_0xa6a9('0x33')](_[_0xa6a9('0x55')]({'channel':_0x32f7e0,'type':'LOGIN','data1':'callysquare','data2':_0x1f64be},_0x25437b));if(_0x17670e['loginInPause']){_0x5a2608[_0xa6a9('0x33')](_[_0xa6a9('0x55')]({'channel':_0x32f7e0,'type':_0xa6a9('0x2d'),'data1':'LOGININPAUSE'},_0x25437b));}});return db[_0xa6a9('0x3f')][_0xa6a9('0x37')](_0x2c8a20['concat'](_0x5a2608),{'individualHooks':!![]});}})['then'](function(){if(_0x17670e){return _0x17670e['update']({'online':!![],'lastLoginAt':moment()[_0xa6a9('0x2f')](_0xa6a9('0x30')),'voicePause':_0x17670e[_0xa6a9('0x4c')]||![],'mailPause':_0x17670e[_0xa6a9('0x4c')]||![],'chatPause':_0x17670e[_0xa6a9('0x4c')]||![],'faxPause':_0x17670e[_0xa6a9('0x4c')]||![],'smsPause':_0x17670e[_0xa6a9('0x4c')]||![],'openchannelPause':_0x17670e[_0xa6a9('0x4c')]||![],'pauseType':_0x17670e['loginInPause']?_0xa6a9('0x56'):null,'lastPauseAt':moment()[_0xa6a9('0x2f')](_0xa6a9('0x30')),'interface':_0x1f64be});}})['then'](function(_0x58f07a){_0x2f51d5(_0x58f07a);})[_0xa6a9('0x18')](function(_0x131554){_0x25b6aa(_0x357d05[_0xa6a9('0x14')](0x1f4,_0x131554[_0xa6a9('0x16')]));});});}; \ No newline at end of file +var _0x49b0=['isValidChannel','Unknown\x20channel','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./user.socket','register','request','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','info','result','catch','GetUser','findAll','options','raw','where','limit','include','map','model','attributes','User','ShowUser','PauseUser','find','name','role','internal','interface','then','UserVoiceQueueRt','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','type','DEFAULT\x20PAUSE','bulkCreate','body','UnpauseUser','findOne','channel'];(function(_0x338367,_0xc2ed00){var _0x5ee2b4=function(_0x34968f){while(--_0x34968f){_0x338367['push'](_0x338367['shift']());}};_0x5ee2b4(++_0xc2ed00);}(_0x49b0,0x7f));var _0x049b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x49b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x049b('0x0'));var util=require(_0x049b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x049b('0x2'));var fs=require('fs');var Redis=require(_0x049b('0x3'));var db=require(_0x049b('0x4'))['db'];var utils=require(_0x049b('0x5'));var logger=require(_0x049b('0x6'))(_0x049b('0x7'));var config=require('../../config/environment');var jayson=require(_0x049b('0x8'));var client=jayson[_0x049b('0x9')][_0x049b('0xa')]({'port':0x232a});config['redis']=_[_0x049b('0xb')](config[_0x049b('0xc')],{'host':_0x049b('0xd'),'port':0x18eb});var socket=require(_0x049b('0xe'))(new Redis(config[_0x049b('0xc')]));require(_0x049b('0xf'))[_0x049b('0x10')](socket);function respondWithRpcPromise(_0xc9b5cf,_0x44642e,_0x222b62){return new BPromise(function(_0x1c09ae,_0x14d017){return client[_0x049b('0x11')](_0xc9b5cf,_0x222b62)['then'](function(_0x2824b0){logger['info']('User,\x20%s,\x20%s',_0x44642e,_0x049b('0x12'));logger['debug'](_0x049b('0x13'),_0x44642e,'request\x20sent',JSON[_0x049b('0x14')](_0x2824b0));if(_0x2824b0[_0x049b('0x15')]){if(_0x2824b0[_0x049b('0x15')][_0x049b('0x16')]===0x1f4){logger[_0x049b('0x15')](_0x049b('0x17'),_0x44642e,_0x2824b0[_0x049b('0x15')][_0x049b('0x18')]);return _0x14d017(_0x2824b0[_0x049b('0x15')][_0x049b('0x18')]);}logger[_0x049b('0x15')](_0x049b('0x17'),_0x44642e,_0x2824b0[_0x049b('0x15')][_0x049b('0x18')]);return _0x1c09ae(_0x2824b0['error'][_0x049b('0x18')]);}else{logger[_0x049b('0x19')](_0x049b('0x17'),_0x44642e,_0x049b('0x12'));_0x1c09ae(_0x2824b0[_0x049b('0x1a')][_0x049b('0x18')]);}})[_0x049b('0x1b')](function(_0x400a2b){logger[_0x049b('0x15')](_0x049b('0x17'),_0x44642e,_0x400a2b);_0x14d017(_0x400a2b);});});}exports[_0x049b('0x1c')]=function(_0x284c74){var _0x4276d4=this;return new Promise(function(_0x74a794,_0xb71bd9){return db['User'][_0x049b('0x1d')]({'raw':_0x284c74[_0x049b('0x1e')]?_0x284c74['options'][_0x049b('0x1f')]===undefined?!![]:![]:!![],'where':_0x284c74[_0x049b('0x1e')]?_0x284c74[_0x049b('0x1e')][_0x049b('0x20')]||null:null,'attributes':_0x284c74[_0x049b('0x1e')]?_0x284c74[_0x049b('0x1e')]['attributes']||null:null,'limit':_0x284c74['options']?_0x284c74[_0x049b('0x1e')][_0x049b('0x21')]||null:null,'include':_0x284c74[_0x049b('0x1e')]?_0x284c74[_0x049b('0x1e')][_0x049b('0x22')]?_[_0x049b('0x23')](_0x284c74[_0x049b('0x1e')][_0x049b('0x22')],function(_0x498994){return{'model':db[_0x498994[_0x049b('0x24')]],'as':_0x498994['as'],'attributes':_0x498994['attributes'],'include':_0x498994['include']?_['map'](_0x498994['include'],function(_0x557fc7){return{'model':db[_0x557fc7[_0x049b('0x24')]],'as':_0x557fc7['as'],'attributes':_0x557fc7['attributes'],'include':_0x557fc7[_0x049b('0x22')]?_[_0x049b('0x23')](_0x557fc7[_0x049b('0x22')],function(_0x4b9876){return{'model':db[_0x4b9876['model']],'as':_0x4b9876['as'],'attributes':_0x4b9876[_0x049b('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdea77d){logger[_0x049b('0x19')](_0x049b('0x1c'),_0x284c74);logger['debug'](_0x049b('0x1c'),_0x284c74,JSON[_0x049b('0x14')](_0xdea77d));_0x74a794(_0xdea77d);})['catch'](function(_0x195bed){logger[_0x049b('0x15')](_0x049b('0x1c'),_0x195bed[_0x049b('0x18')],_0x284c74);_0xb71bd9(_0x4276d4[_0x049b('0x15')](0x1f4,_0x195bed[_0x049b('0x18')]));});});};exports['ShowUser']=function(_0x591035){var _0x2e60a5=this;return new Promise(function(_0x9b6dc5,_0x330a29){return db[_0x049b('0x26')]['find']({'raw':_0x591035[_0x049b('0x1e')]?_0x591035[_0x049b('0x1e')][_0x049b('0x1f')]===undefined?!![]:![]:!![],'where':_0x591035['options']?_0x591035[_0x049b('0x1e')][_0x049b('0x20')]||null:null,'attributes':_0x591035[_0x049b('0x1e')]?_0x591035['options'][_0x049b('0x25')]||null:null,'include':_0x591035[_0x049b('0x1e')]?_0x591035[_0x049b('0x1e')]['include']?_[_0x049b('0x23')](_0x591035[_0x049b('0x1e')][_0x049b('0x22')],function(_0x5a2211){return{'model':db[_0x5a2211[_0x049b('0x24')]],'as':_0x5a2211['as'],'attributes':_0x5a2211['attributes'],'include':_0x5a2211[_0x049b('0x22')]?_[_0x049b('0x23')](_0x5a2211[_0x049b('0x22')],function(_0x5aac16){return{'model':db[_0x5aac16[_0x049b('0x24')]],'as':_0x5aac16['as'],'attributes':_0x5aac16['attributes'],'include':_0x5aac16[_0x049b('0x22')]?_['map'](_0x5aac16[_0x049b('0x22')],function(_0x202135){return{'model':db[_0x202135[_0x049b('0x24')]],'as':_0x202135['as'],'attributes':_0x202135['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb20339){logger['info'](_0x049b('0x27'),_0x591035);logger['debug'](_0x049b('0x27'),_0x591035,JSON[_0x049b('0x14')](_0xb20339));_0x9b6dc5(_0xb20339);})[_0x049b('0x1b')](function(_0xb44188){logger[_0x049b('0x15')](_0x049b('0x27'),_0xb44188[_0x049b('0x18')],_0x591035);_0x330a29(_0x2e60a5['error'](0x1f4,_0xb44188['message']));});});};exports[_0x049b('0x28')]=function(_0x4e01c0){var _0x23856e=this;return new Promise(function(_0x16105d,_0x328c38){var _0x1b497d;return db['User'][_0x049b('0x29')]({'where':_0x4e01c0['options']['where']||{},'attributes':['id',_0x049b('0x2a'),_0x049b('0x2b'),_0x049b('0x2c'),_0x049b('0x2d')]})[_0x049b('0x2e')](function(_0x30426f){if(_0x30426f){_0x1b497d=_0x30426f;return db[_0x049b('0x2f')][_0x049b('0x30')]({'paused':0x1},{'where':{'UserId':_0x1b497d['id']},'individualHooks':!![]});}})[_0x049b('0x2e')](function(){if(_0x1b497d){return db[_0x049b('0x31')][_0x049b('0x1d')]({'where':{'membername':_0x1b497d['name'],'type':_0x049b('0x32'),'exitAt':null}});}})['then'](function(_0x2edbb8){if(_0x1b497d){if(_0x2edbb8&&_0x2edbb8['length']){var _0x6e0f17=moment()[_0x049b('0x33')](_0x049b('0x34'));for(var _0x5ab35a=0x0,_0x3d6220=_0x2edbb8[_0x049b('0x35')];_0x5ab35a<_0x3d6220;_0x5ab35a++){_0x2edbb8[_0x5ab35a][_0x049b('0x36')]({'exitAt':_0x6e0f17});}}}})[_0x049b('0x2e')](function(){if(_0x1b497d){var _0x303a59=[];var _0x5d73ad=utils[_0x049b('0x37')]();_0x5d73ad[_0x049b('0x38')](function(_0xf11420){_0x303a59[_0x049b('0x39')]({'channel':_0xf11420,'membername':_0x1b497d['name'],'interface':_[_0x049b('0x3a')](_0x1b497d[_0x049b('0x2d')])?util[_0x049b('0x33')](_0x049b('0x3b'),_0x1b497d[_0x049b('0x2a')]):_0x1b497d[_0x049b('0x2d')],'type':'PAUSE','enterAt':moment()[_0x049b('0x33')](_0x049b('0x34')),'data1':_0x4e01c0['body'][_0x049b('0x3c')]||_0x049b('0x3d'),'role':_0x1b497d['role'],'internal':_0x1b497d[_0x049b('0x2c')],'uniqueid':_0x4e01c0['body']['uniqueid']||null});});return db[_0x049b('0x31')][_0x049b('0x3e')](_0x303a59,{'individualHooks':!![]});}})[_0x049b('0x2e')](function(){if(_0x1b497d){return _0x1b497d[_0x049b('0x30')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4e01c0[_0x049b('0x3f')][_0x049b('0x3c')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x049b('0x33')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x049b('0x2e')](function(_0x417af0){_0x16105d(_0x417af0);})[_0x049b('0x1b')](function(_0x3ab60e){_0x328c38(_0x23856e[_0x049b('0x15')](0x1f4,_0x3ab60e['message']));});});};exports[_0x049b('0x40')]=function(_0x3b2856){var _0x5dcb99=this;return new Promise(function(_0x1067cd,_0x24e161){var _0x141ace;return db[_0x049b('0x26')][_0x049b('0x41')]({'where':_0x3b2856[_0x049b('0x1e')][_0x049b('0x20')]||{},'attributes':['id',_0x049b('0x2a')]})[_0x049b('0x2e')](function(_0x5c23c9){if(_0x5c23c9){_0x141ace=_0x5c23c9;if(_0x3b2856['body'][_0x049b('0x42')]&&!utils[_0x049b('0x43')](_0x3b2856['body'][_0x049b('0x42')])){throw new Error(_0x049b('0x44'));}switch(_0x3b2856[_0x049b('0x3f')][_0x049b('0x42')]){case'voice':return db[_0x049b('0x2f')]['update']({'paused':0x0},{'where':{'UserId':_0x141ace['id']}})[_0x049b('0x2e')](function(){return db[_0x049b('0x31')][_0x049b('0x29')]({'where':{'channel':_0x3b2856[_0x049b('0x3f')]['channel'],'membername':_0x141ace[_0x049b('0x2a')],'type':'PAUSE','exitAt':null}});})[_0x049b('0x2e')](function(_0x401eb9){if(_0x401eb9){return _0x401eb9[_0x049b('0x30')]({'exitAt':moment()[_0x049b('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x049b('0x45')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x141ace[_0x049b('0x30')]({'voicePause':![]});});case _0x049b('0x46'):case _0x049b('0x47'):case _0x049b('0x48'):case _0x049b('0x49'):case _0x049b('0x4a'):case _0x049b('0x4b'):return db[_0x049b('0x31')][_0x049b('0x29')]({'where':{'channel':_0x3b2856[_0x049b('0x3f')][_0x049b('0x42')],'membername':_0x141ace[_0x049b('0x2a')],'type':_0x049b('0x32'),'exitAt':null}})[_0x049b('0x2e')](function(_0xb711de){return _0xb711de[_0x049b('0x30')]({'exitAt':moment()[_0x049b('0x33')](_0x049b('0x34')),'data2':_0x049b('0x45')},{'individualHooks':!![]});})[_0x049b('0x2e')](function(){var _0x264f50={};_[_0x049b('0x4c')](_0x264f50,util['format'](_0x049b('0x4d'),_0x3b2856[_0x049b('0x3f')][_0x049b('0x42')],_0x049b('0x4e')),![]);return _0x141ace['update'](_0x264f50);});default:return db['UserVoiceQueueRt'][_0x049b('0x30')]({'paused':0x0},{'where':{'UserId':_0x141ace['id']}})[_0x049b('0x2e')](function(){return db['MemberReport'][_0x049b('0x1d')]({'where':{'membername':_0x141ace[_0x049b('0x2a')],'type':_0x049b('0x32'),'exitAt':null}});})[_0x049b('0x2e')](function(_0x7a3160){var _0x545a69=[];_0x7a3160[_0x049b('0x38')](function(_0x14ed06){_0x545a69[_0x049b('0x39')](_0x14ed06[_0x049b('0x30')]({'exitAt':moment()[_0x049b('0x33')](_0x049b('0x34')),'data2':_0x049b('0x45')}));});return BPromise[_0x049b('0x4f')](_0x545a69);})[_0x049b('0x2e')](function(){return _0x141ace[_0x049b('0x30')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x049b('0x2e')](function(_0x1dd4fa){_0x1067cd(_0x1dd4fa);})[_0x049b('0x1b')](function(_0x615790){_0x24e161(_0x5dcb99[_0x049b('0x15')](0x1f4,_0x615790[_0x049b('0x18')]));});});};exports[_0x049b('0x50')]=function(_0x35281c){var _0x3aa2eb=this;return new Promise(function(_0x312ac5,_0x4b610d){var _0xbef7bb;return db['User'][_0x049b('0x41')]({'where':_0x35281c[_0x049b('0x1e')][_0x049b('0x20')]||{},'attributes':['id',_0x049b('0x2a')]})[_0x049b('0x2e')](function(_0x5387f9){if(_0x5387f9){_0xbef7bb=_0x5387f9;return db[_0x049b('0x2f')][_0x049b('0x51')]({'where':{'membername':_0xbef7bb['name']},'individualHooks':!![]});}})[_0x049b('0x2e')](function(){if(_0xbef7bb){return db[_0x049b('0x31')]['findAll']({'where':{'membername':_0xbef7bb[_0x049b('0x2a')],'exitAt':null}});}})[_0x049b('0x2e')](function(_0x2e3204){if(_0xbef7bb){if(_0x2e3204&&_0x2e3204[_0x049b('0x35')]){var _0x1ee7ac=[];_0x2e3204['forEach'](function(_0x5cf150){_0x1ee7ac[_0x049b('0x39')](_0x5cf150[_0x049b('0x30')]({'exitAt':moment()[_0x049b('0x33')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x1ee7ac);}}})['then'](function(){if(_0xbef7bb){return _0xbef7bb[_0x049b('0x30')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x841728){_0x312ac5(_0x841728);})[_0x049b('0x1b')](function(_0x460e4b){_0x4b610d(_0x3aa2eb[_0x049b('0x15')](0x1f4,_0x460e4b[_0x049b('0x18')]));});});};exports[_0x049b('0x52')]=function(_0x4f8da4){var _0x3b549c=this;return new Promise(function(_0x555a9c,_0xf89ccd){var _0x59b6ea;var _0x4db929;var _0x577735;var _0x2ae594;return db[_0x049b('0x26')]['findOne']({'where':_0x4f8da4['options'][_0x049b('0x20')]||{},'attributes':['id',_0x049b('0x2a'),_0x049b('0x2b'),_0x049b('0x53'),_0x049b('0x54'),_0x049b('0x2c'),_0x049b('0x55'),_0x049b('0x2d')]})[_0x049b('0x2e')](function(_0x204db8){if(_0x204db8){_0x59b6ea=_0x204db8;_0x2ae594=_0x4f8da4[_0x049b('0x3f')]['interface']?_0x4f8da4['body'][_0x049b('0x2d')]:util[_0x049b('0x33')](_0x049b('0x3b'),_0x59b6ea[_0x049b('0x2a')]);return db[_0x049b('0x26')]['count']({'where':{'role':_0x049b('0x56'),'online':!![],'id':{'$ne':_0x59b6ea['id']}}});}})[_0x049b('0x2e')](function(_0x2b7ff4){if(_0x2b7ff4){_0x577735=_0x2b7ff4;return require('../../config/license/util')[_0x049b('0x57')]();}})[_0x049b('0x2e')](function(_0x2895b0){if(_0x2895b0&&_0x2895b0[_0x049b('0x58')]&&_0x577735>=_0x2895b0['agents']){throw new Error(_0x049b('0x59'));}})[_0x049b('0x2e')](function(){if(_0x59b6ea){return db['UserVoiceQueueRt'][_0x049b('0x51')]({'where':{'membername':_0x59b6ea[_0x049b('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x59b6ea){return _0x59b6ea[_0x049b('0x5a')]({'raw':!![]});}})[_0x049b('0x2e')](function(_0x277c83){if(_0x59b6ea){if(_0x277c83){var _0x1549dc=[];_0x4db929=_0x277c83;if(_0x4db929[_0x049b('0x35')]){for(var _0x509364=0x0;_0x509364<_0x4db929[_0x049b('0x35')];_0x509364++){_0x1549dc[_0x049b('0x39')](db['UserVoiceQueueRt'][_0x049b('0x5b')]({'membername':_0x59b6ea[_0x049b('0x2a')],'UserId':_0x59b6ea['id'],'queue_name':_0x4db929[_0x509364]['name'],'VoiceQueueId':_0x4db929[_0x509364]['id'],'interface':_0x2ae594,'paused':_0x59b6ea[_0x049b('0x55')]||![],'penalty':_0x4db929[_0x509364][_0x049b('0x5c')]||0x0}));}return BPromise[_0x049b('0x4f')](_0x1549dc);}}}})[_0x049b('0x2e')](function(){if(_0x59b6ea){return db[_0x049b('0x31')]['findAll']({'where':{'membername':_0x59b6ea[_0x049b('0x2a')],'exitAt':null}});}})[_0x049b('0x2e')](function(_0x295f1a){if(_0x59b6ea){if(_0x295f1a&&_0x295f1a[_0x049b('0x35')]){var _0x555038=[];_0x295f1a[_0x049b('0x38')](function(_0x3553c2){_0x555038[_0x049b('0x39')](_0x3553c2['update']({'exitAt':moment()[_0x049b('0x33')](_0x049b('0x34'))}));});return BPromise[_0x049b('0x4f')](_0x555038);}}})['then'](function(_0x25a11e){if(_0x59b6ea){var _0x2e8597=[];var _0x51d85e=[];var _0x3f1331=utils[_0x049b('0x37')]();var _0x7f88aa={'membername':_0x59b6ea[_0x049b('0x2a')],'interface':_0x2ae594,'enterAt':moment()['format'](_0x049b('0x34')),'role':_0x59b6ea[_0x049b('0x2b')],'internal':_0x59b6ea[_0x049b('0x2c')]};_0x3f1331[_0x049b('0x38')](function(_0x47a59a){_0x2e8597['push'](_[_0x049b('0x5d')]({'channel':_0x47a59a,'type':_0x049b('0x5e'),'data1':_0x049b('0x5f'),'data2':_0x2ae594},_0x7f88aa));if(_0x59b6ea['loginInPause']){_0x51d85e[_0x049b('0x39')](_[_0x049b('0x5d')]({'channel':_0x47a59a,'type':_0x049b('0x32'),'data1':'LOGININPAUSE'},_0x7f88aa));}});return db['MemberReport'][_0x049b('0x3e')](_0x2e8597['concat'](_0x51d85e),{'individualHooks':!![]});}})[_0x049b('0x2e')](function(){if(_0x59b6ea){return _0x59b6ea[_0x049b('0x30')]({'online':!![],'lastLoginAt':moment()[_0x049b('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x59b6ea['loginInPause']||![],'mailPause':_0x59b6ea[_0x049b('0x55')]||![],'chatPause':_0x59b6ea[_0x049b('0x55')]||![],'faxPause':_0x59b6ea[_0x049b('0x55')]||![],'smsPause':_0x59b6ea[_0x049b('0x55')]||![],'openchannelPause':_0x59b6ea[_0x049b('0x55')]||![],'pauseType':_0x59b6ea[_0x049b('0x55')]?_0x049b('0x60'):null,'lastPauseAt':moment()['format'](_0x049b('0x34')),'interface':_0x2ae594});}})[_0x049b('0x2e')](function(_0x302ce6){_0x555a9c(_0x302ce6);})['catch'](function(_0x4900b0){_0xf89ccd(_0x3b549c['error'](0x1f4,_0x4900b0[_0x049b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 067621d..71db0ee 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 _0xe3a3=['user:','./user.events','remove','update','removeListener','register','length'];(function(_0x15e008,_0x570319){var _0xab06bd=function(_0x13d589){while(--_0x13d589){_0x15e008['push'](_0x15e008['shift']());}};_0xab06bd(++_0x570319);}(_0xe3a3,0x1c8));var _0x3e3a=function(_0x3ff995,_0x50cf5b){_0x3ff995=_0x3ff995-0x0;var _0x32c9c0=_0xe3a3[_0x3ff995];return _0x32c9c0;};'use strict';var UserEvents=require(_0x3e3a('0x0'));var events=['save',_0x3e3a('0x1'),_0x3e3a('0x2')];function createListener(_0x301729,_0x4fe19b){return function(_0x12399d){_0x4fe19b['emit'](_0x301729,_0x12399d);};}function removeListener(_0x17afde,_0x2b81d3){return function(){UserEvents[_0x3e3a('0x3')](_0x17afde,_0x2b81d3);};}exports[_0x3e3a('0x4')]=function(_0x3fc1ec){for(var _0x196d5d=0x0,_0x20a5bc=events[_0x3e3a('0x5')];_0x196d5d<_0x20a5bc;_0x196d5d++){var _0x4395b2=events[_0x196d5d];var _0x133010=createListener(_0x3e3a('0x6')+_0x4395b2,_0x3fc1ec);UserEvents['on'](_0x4395b2,_0x133010);}}; \ No newline at end of file +var _0x7d45=['removeListener','length','./user.events','save','update'];(function(_0x1c5a86,_0xe43d45){var _0x4b4dbf=function(_0x4bd4c0){while(--_0x4bd4c0){_0x1c5a86['push'](_0x1c5a86['shift']());}};_0x4b4dbf(++_0xe43d45);}(_0x7d45,0x17e));var _0x57d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7d45[_0xa464c9];return _0x3d73c4;};'use strict';var UserEvents=require(_0x57d4('0x0'));var events=[_0x57d4('0x1'),'remove',_0x57d4('0x2')];function createListener(_0x252a0c,_0x4e2c3c){return function(_0x3c44ae){_0x4e2c3c['emit'](_0x252a0c,_0x3c44ae);};}function removeListener(_0x5d12ab,_0xc798b){return function(){UserEvents[_0x57d4('0x3')](_0x5d12ab,_0xc798b);};}exports['register']=function(_0x5c2acb){for(var _0x21019b=0x0,_0x10ebd8=events[_0x57d4('0x4')];_0x21019b<_0x10ebd8;_0x21019b++){var _0x5b37f0=events[_0x21019b];var _0x238f7d=createListener('user:'+_0x5b37f0,_0x5c2acb);UserEvents['on'](_0x5b37f0,_0x238f7d);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 7faed2e..194a6e3 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x29bf1d,_0x621bd2){var _0x38edec=function(_0x436c12){while(--_0x436c12){_0x29bf1d['push'](_0x29bf1d['shift']());}};_0x38edec(++_0x621bd2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x52dace,_0x530aa7){var _0x4e43b6=function(_0x40aa29){while(--_0x40aa29){_0x52dace['push'](_0x52dace['shift']());}};_0x4e43b6(++_0x530aa7);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 910bb34..72ba7e7 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 _0x815b=['sequelize','exports','INTEGER'];(function(_0x150abe,_0x5447c3){var _0x422845=function(_0x12a264){while(--_0x12a264){_0x150abe['push'](_0x150abe['shift']());}};_0x422845(++_0x5447c3);}(_0x815b,0xb4));var _0xb815=function(_0x1fba13,_0x50aad7){_0x1fba13=_0x1fba13-0x0;var _0xf87bbf=_0x815b[_0x1fba13];return _0xf87bbf;};'use strict';var Sequelize=require(_0xb815('0x0'));module[_0xb815('0x1')]={'penalty':{'type':Sequelize[_0xb815('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb180=['INTEGER','exports'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xb180,0xa1));var _0x0b18=function(_0x3e5ab5,_0x6b85a0){_0x3e5ab5=_0x3e5ab5-0x0;var _0x156fd3=_0xb180[_0x3e5ab5];return _0x156fd3;};'use strict';var Sequelize=require('sequelize');module[_0x0b18('0x0')]={'penalty':{'type':Sequelize[_0x0b18('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 2194bb3..1f33659 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 _0xf027=['../../config/logger','api','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util'];(function(_0x548b97,_0x5eefa8){var _0x50f684=function(_0x156cc2){while(--_0x156cc2){_0x548b97['push'](_0x548b97['shift']());}};_0x50f684(++_0x5eefa8);}(_0xf027,0x82));var _0x7f02=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf027[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7f02('0x0'));var util=require(_0x7f02('0x1'));var logger=require(_0x7f02('0x2'))(_0x7f02('0x3'));var moment=require('moment');var BPromise=require(_0x7f02('0x4'));var rp=require(_0x7f02('0x5'));var fs=require('fs');var path=require(_0x7f02('0x6'));var rimraf=require(_0x7f02('0x7'));var config=require('../../config/environment');var attributes=require(_0x7f02('0x8'));module[_0x7f02('0x9')]=function(_0x591d44,_0x5d9ade){return _0x591d44[_0x7f02('0xa')]('UserChatQueue',attributes,{'tableName':_0x7f02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33af=['rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','util','../../config/logger','api','moment','bluebird','path'];(function(_0x546350,_0x5a80a7){var _0xb3ff4e=function(_0x1a2908){while(--_0x1a2908){_0x546350['push'](_0x546350['shift']());}};_0xb3ff4e(++_0x5a80a7);}(_0x33af,0x19e));var _0xf33a=function(_0x21ef85,_0x2d9f4f){_0x21ef85=_0x21ef85-0x0;var _0x5b9a7d=_0x33af[_0x21ef85];return _0x5b9a7d;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var logger=require(_0xf33a('0x1'))(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf33a('0x5'));var rimraf=require(_0xf33a('0x6'));var config=require(_0xf33a('0x7'));var attributes=require(_0xf33a('0x8'));module[_0xf33a('0x9')]=function(_0x22c14d,_0x1b4359){return _0x22c14d[_0xf33a('0xa')](_0xf33a('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 596b931..560e039 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 _0xffb8=['error','code','message','UserChatQueue,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x7d4ef9,_0x306610){var _0xfe9d7c=function(_0x285fe5){while(--_0x285fe5){_0x7d4ef9['push'](_0x7d4ef9['shift']());}};_0xfe9d7c(++_0x306610);}(_0xffb8,0x195));var _0x8ffb=function(_0x112fe3,_0x16b642){_0x112fe3=_0x112fe3-0x0;var _0x1ec903=_0xffb8[_0x112fe3];return _0x1ec903;};'use strict';var _=require(_0x8ffb('0x0'));var util=require(_0x8ffb('0x1'));var moment=require(_0x8ffb('0x2'));var BPromise=require(_0x8ffb('0x3'));var rs=require(_0x8ffb('0x4'));var fs=require('fs');var Redis=require(_0x8ffb('0x5'));var db=require(_0x8ffb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ffb('0x7'));var config=require(_0x8ffb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8ffb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7afd12,_0x2c8a66,_0x2f9149){return new BPromise(function(_0x1cce78,_0x11665b){return client['request'](_0x7afd12,_0x2f9149)['then'](function(_0x5e1ed9){logger[_0x8ffb('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x2c8a66,_0x8ffb('0xb'));logger[_0x8ffb('0xc')](_0x8ffb('0xd'),_0x2c8a66,'request\x20sent',JSON[_0x8ffb('0xe')](_0x5e1ed9));if(_0x5e1ed9[_0x8ffb('0xf')]){if(_0x5e1ed9['error'][_0x8ffb('0x10')]===0x1f4){logger[_0x8ffb('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x2c8a66,_0x5e1ed9['error'][_0x8ffb('0x11')]);return _0x11665b(_0x5e1ed9[_0x8ffb('0xf')][_0x8ffb('0x11')]);}logger[_0x8ffb('0xf')](_0x8ffb('0x12'),_0x2c8a66,_0x5e1ed9[_0x8ffb('0xf')][_0x8ffb('0x11')]);return _0x1cce78(_0x5e1ed9[_0x8ffb('0xf')][_0x8ffb('0x11')]);}else{logger[_0x8ffb('0xa')](_0x8ffb('0x12'),_0x2c8a66,_0x8ffb('0xb'));_0x1cce78(_0x5e1ed9[_0x8ffb('0x13')][_0x8ffb('0x11')]);}})['catch'](function(_0x406708){logger[_0x8ffb('0xf')](_0x8ffb('0x12'),_0x2c8a66,_0x406708);_0x11665b(_0x406708);});});} \ No newline at end of file +var _0x71f9=['stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5bea56,_0x391054){var _0x3c9c7d=function(_0x34fd6c){while(--_0x34fd6c){_0x5bea56['push'](_0x5bea56['shift']());}};_0x3c9c7d(++_0x391054);}(_0x71f9,0x156));var _0x971f=function(_0x1815cf,_0x1621bb){_0x1815cf=_0x1815cf-0x0;var _0x34474f=_0x71f9[_0x1815cf];return _0x34474f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x971f('0x0'));var BPromise=require(_0x971f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x971f('0x2'));var db=require(_0x971f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x971f('0x4'))(_0x971f('0x5'));var config=require(_0x971f('0x6'));var jayson=require(_0x971f('0x7'));var client=jayson['client'][_0x971f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f1773,_0x1350c2,_0x2ef739){return new BPromise(function(_0x4eb21b,_0x21dd84){return client[_0x971f('0x9')](_0x1f1773,_0x2ef739)[_0x971f('0xa')](function(_0x16f2ac){logger[_0x971f('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x1350c2,'request\x20sent');logger[_0x971f('0xc')](_0x971f('0xd'),_0x1350c2,_0x971f('0xe'),JSON[_0x971f('0xf')](_0x16f2ac));if(_0x16f2ac['error']){if(_0x16f2ac[_0x971f('0x10')][_0x971f('0x11')]===0x1f4){logger[_0x971f('0x10')](_0x971f('0x12'),_0x1350c2,_0x16f2ac[_0x971f('0x10')][_0x971f('0x13')]);return _0x21dd84(_0x16f2ac[_0x971f('0x10')][_0x971f('0x13')]);}logger[_0x971f('0x10')](_0x971f('0x12'),_0x1350c2,_0x16f2ac[_0x971f('0x10')][_0x971f('0x13')]);return _0x4eb21b(_0x16f2ac['error'][_0x971f('0x13')]);}else{logger[_0x971f('0xb')](_0x971f('0x12'),_0x1350c2,_0x971f('0xe'));_0x4eb21b(_0x16f2ac[_0x971f('0x14')][_0x971f('0x13')]);}})['catch'](function(_0x1e6ed1){logger['error'](_0x971f('0x12'),_0x1350c2,_0x1e6ed1);_0x21dd84(_0x1e6ed1);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 808f0b4..b3d7e44 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2a60ad,_0x2d673c){var _0x407c59=function(_0x14c729){while(--_0x14c729){_0x2a60ad['push'](_0x2a60ad['shift']());}};_0x407c59(++_0x2d673c);}(_0xedd9,0xfc));var _0x9edd=function(_0x436765,_0x53a6d8){_0x436765=_0x436765-0x0;var _0x39dc50=_0xedd9[_0x436765];return _0x39dc50;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x23571a,_0x28ff8e){var _0x1b9519=function(_0x594d77){while(--_0x594d77){_0x23571a['push'](_0x23571a['shift']());}};_0x1b9519(++_0x28ff8e);}(_0xe706,0xa3));var _0x6e70=function(_0x42276c,_0x141d47){_0x42276c=_0x42276c-0x0;var _0x1b5009=_0xe706[_0x42276c];return _0x1b5009;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index a5d8884..c228a8e 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 _0xe279=['sequelize','exports','INTEGER','STRING'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0xe279,0x8c));var _0x9e27=function(_0x4624c4,_0x2620c9){_0x4624c4=_0x4624c4-0x0;var _0x3c0d60=_0xe279[_0x4624c4];return _0x3c0d60;};'use strict';var Sequelize=require(_0x9e27('0x0'));module[_0x9e27('0x1')]={'penalty':{'type':Sequelize[_0x9e27('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9e27('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9e27('0x3')]}}; \ No newline at end of file +var _0x65fe=['exports','INTEGER','STRING','sequelize'];(function(_0x1e67ef,_0x1c947b){var _0x626ee=function(_0x34e600){while(--_0x34e600){_0x1e67ef['push'](_0x1e67ef['shift']());}};_0x626ee(++_0x1c947b);}(_0x65fe,0x1e3));var _0xe65f=function(_0x315109,_0x447bfb){_0x315109=_0x315109-0x0;var _0x8c20ee=_0x65fe[_0x315109];return _0x8c20ee;};'use strict';var Sequelize=require(_0xe65f('0x0'));module[_0xe65f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe65f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe65f('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 489e7db..1201fbf 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 _0x0ec6=['user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue'];(function(_0x263714,_0x399b37){var _0x1cd43d=function(_0x2f2d3a){while(--_0x2f2d3a){_0x263714['push'](_0x263714['shift']());}};_0x1cd43d(++_0x399b37);}(_0x0ec6,0x109));var _0x60ec=function(_0x321929,_0x13d934){_0x321929=_0x321929-0x0;var _0x39712e=_0x0ec6[_0x321929];return _0x39712e;};'use strict';var _=require(_0x60ec('0x0'));var util=require(_0x60ec('0x1'));var logger=require(_0x60ec('0x2'))(_0x60ec('0x3'));var moment=require(_0x60ec('0x4'));var BPromise=require(_0x60ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x60ec('0x6'));var rimraf=require('rimraf');var config=require(_0x60ec('0x7'));var attributes=require(_0x60ec('0x8'));module['exports']=function(_0x3613e0,_0x12d836){return _0x3613e0[_0x60ec('0x9')](_0x60ec('0xa'),attributes,{'tableName':_0x60ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbec=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x3ca93e,_0x19ba5a){var _0x54e245=function(_0x39e054){while(--_0x39e054){_0x3ca93e['push'](_0x3ca93e['shift']());}};_0x54e245(++_0x19ba5a);}(_0xdbec,0x16b));var _0xcdbe=function(_0x45d38e,_0xa2ac7b){_0x45d38e=_0x45d38e-0x0;var _0x4bc089=_0xdbec[_0x45d38e];return _0x4bc089;};'use strict';var _=require(_0xcdbe('0x0'));var util=require(_0xcdbe('0x1'));var logger=require(_0xcdbe('0x2'))(_0xcdbe('0x3'));var moment=require(_0xcdbe('0x4'));var BPromise=require(_0xcdbe('0x5'));var rp=require(_0xcdbe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdbe('0x7'));var config=require(_0xcdbe('0x8'));var attributes=require(_0xcdbe('0x9'));module[_0xcdbe('0xa')]=function(_0x636dcd,_0x546957){return _0x636dcd[_0xcdbe('0xb')](_0xcdbe('0xc'),attributes,{'tableName':_0xcdbe('0xd'),'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 a33522b..35b8bf4 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 _0xe269=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0xe269,0x133));var _0x9e26=function(_0x562977,_0x2a2198){_0x562977=_0x562977-0x0;var _0x4a453d=_0xe269[_0x562977];return _0x4a453d;};'use strict';var _=require('lodash');var util=require(_0x9e26('0x0'));var moment=require(_0x9e26('0x1'));var BPromise=require(_0x9e26('0x2'));var rs=require(_0x9e26('0x3'));var fs=require('fs');var Redis=require(_0x9e26('0x4'));var db=require(_0x9e26('0x5'))['db'];var utils=require(_0x9e26('0x6'));var logger=require(_0x9e26('0x7'))(_0x9e26('0x8'));var config=require(_0x9e26('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9e26('0xa')][_0x9e26('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a02ba,_0x4a30d8,_0x5d8766){return new BPromise(function(_0xc155a4,_0x5e4f4e){return client[_0x9e26('0xc')](_0x5a02ba,_0x5d8766)[_0x9e26('0xd')](function(_0x39f023){logger[_0x9e26('0xe')](_0x9e26('0xf'),_0x4a30d8,_0x9e26('0x10'));logger[_0x9e26('0x11')](_0x9e26('0x12'),_0x4a30d8,_0x9e26('0x10'),JSON[_0x9e26('0x13')](_0x39f023));if(_0x39f023[_0x9e26('0x14')]){if(_0x39f023[_0x9e26('0x14')][_0x9e26('0x15')]===0x1f4){logger[_0x9e26('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x4a30d8,_0x39f023['error'][_0x9e26('0x16')]);return _0x5e4f4e(_0x39f023[_0x9e26('0x14')]['message']);}logger[_0x9e26('0x14')](_0x9e26('0xf'),_0x4a30d8,_0x39f023[_0x9e26('0x14')]['message']);return _0xc155a4(_0x39f023[_0x9e26('0x14')][_0x9e26('0x16')]);}else{logger[_0x9e26('0xe')](_0x9e26('0xf'),_0x4a30d8,_0x9e26('0x10'));_0xc155a4(_0x39f023[_0x9e26('0x17')][_0x9e26('0x16')]);}})[_0x9e26('0x18')](function(_0x4327d4){logger[_0x9e26('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x4a30d8,_0x4327d4);_0x5e4f4e(_0x4327d4);});});} \ No newline at end of file +var _0xeb5f=['error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0xdaab62,_0x2728ab){var _0x13d767=function(_0x14bf14){while(--_0x14bf14){_0xdaab62['push'](_0xdaab62['shift']());}};_0x13d767(++_0x2728ab);}(_0xeb5f,0x109));var _0xfeb5=function(_0xa9dd8b,_0x3442ee){_0xa9dd8b=_0xa9dd8b-0x0;var _0x32c522=_0xeb5f[_0xa9dd8b];return _0x32c522;};'use strict';var _=require(_0xfeb5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfeb5('0x1'));var rs=require(_0xfeb5('0x2'));var fs=require('fs');var Redis=require(_0xfeb5('0x3'));var db=require(_0xfeb5('0x4'))['db'];var utils=require(_0xfeb5('0x5'));var logger=require(_0xfeb5('0x6'))(_0xfeb5('0x7'));var config=require(_0xfeb5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfeb5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf76a6b,_0x279337,_0x26af38){return new BPromise(function(_0x23a76b,_0xa254a3){return client[_0xfeb5('0xa')](_0xf76a6b,_0x26af38)[_0xfeb5('0xb')](function(_0x34a685){logger['info'](_0xfeb5('0xc'),_0x279337,_0xfeb5('0xd'));logger['debug'](_0xfeb5('0xe'),_0x279337,_0xfeb5('0xd'),JSON['stringify'](_0x34a685));if(_0x34a685[_0xfeb5('0xf')]){if(_0x34a685[_0xfeb5('0xf')][_0xfeb5('0x10')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x279337,_0x34a685[_0xfeb5('0xf')][_0xfeb5('0x11')]);return _0xa254a3(_0x34a685[_0xfeb5('0xf')][_0xfeb5('0x11')]);}logger[_0xfeb5('0xf')](_0xfeb5('0xc'),_0x279337,_0x34a685['error']['message']);return _0x23a76b(_0x34a685['error'][_0xfeb5('0x11')]);}else{logger[_0xfeb5('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x279337,_0xfeb5('0xd'));_0x23a76b(_0x34a685['result']['message']);}})[_0xfeb5('0x13')](function(_0x1236b5){logger['error'](_0xfeb5('0xc'),_0x279337,_0x1236b5);_0xa254a3(_0x1236b5);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 78ba54f..9635fe3 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x39cf67,_0x4990cd){var _0x3f60ee=function(_0x2ebe14){while(--_0x2ebe14){_0x39cf67['push'](_0x39cf67['shift']());}};_0x3f60ee(++_0x4990cd);}(_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(_0x369280,_0x34ac93){var _0x1061a0=function(_0x538305){while(--_0x538305){_0x369280['push'](_0x369280['shift']());}};_0x1061a0(++_0x34ac93);}(_0x70e0,0x17b));var _0x070e=function(_0x3a7e7c,_0x262474){_0x3a7e7c=_0x3a7e7c-0x0;var _0x2b28ea=_0x70e0[_0x3a7e7c];return _0x2b28ea;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 8cfe593..afeec32 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 _0x786b=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x786b,0x74));var _0xb786=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0x786b[_0x47242d];return _0x30273a;};'use strict';var Sequelize=require(_0xb786('0x0'));module[_0xb786('0x1')]={'penalty':{'type':Sequelize[_0xb786('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdb6e=['exports','INTEGER','sequelize'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0xdb6e,0x179));var _0xedb6=function(_0x3fc81c,_0x34014b){_0x3fc81c=_0x3fc81c-0x0;var _0x57d3b7=_0xdb6e[_0x3fc81c];return _0x57d3b7;};'use strict';var Sequelize=require(_0xedb6('0x0'));module[_0xedb6('0x1')]={'penalty':{'type':Sequelize[_0xedb6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 933087a..7517211 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 _0x0cee=['request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','../../config/logger','api','bluebird'];(function(_0x3147c3,_0x4708c3){var _0xe9c4ee=function(_0x111114){while(--_0x111114){_0x3147c3['push'](_0x3147c3['shift']());}};_0xe9c4ee(++_0x4708c3);}(_0x0cee,0x1dd));var _0xe0ce=function(_0x454f03,_0x43529d){_0x454f03=_0x454f03-0x0;var _0x8eb8f2=_0x0cee[_0x454f03];return _0x8eb8f2;};'use strict';var _=require('lodash');var util=require(_0xe0ce('0x0'));var logger=require(_0xe0ce('0x1'))(_0xe0ce('0x2'));var moment=require('moment');var BPromise=require(_0xe0ce('0x3'));var rp=require(_0xe0ce('0x4'));var fs=require('fs');var path=require(_0xe0ce('0x5'));var rimraf=require(_0xe0ce('0x6'));var config=require(_0xe0ce('0x7'));var attributes=require(_0xe0ce('0x8'));module[_0xe0ce('0x9')]=function(_0x2fca86,_0x5a670a){return _0x2fca86[_0xe0ce('0xa')](_0xe0ce('0xb'),attributes,{'tableName':_0xe0ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe860=['UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define'];(function(_0x52d140,_0xc38e5a){var _0x5ca3c3=function(_0xea6f98){while(--_0xea6f98){_0x52d140['push'](_0x52d140['shift']());}};_0x5ca3c3(++_0xc38e5a);}(_0xe860,0xab));var _0x0e86=function(_0x1ab170,_0x5197ff){_0x1ab170=_0x1ab170-0x0;var _0x431698=_0xe860[_0x1ab170];return _0x431698;};'use strict';var _=require(_0x0e86('0x0'));var util=require(_0x0e86('0x1'));var logger=require('../../config/logger')(_0x0e86('0x2'));var moment=require(_0x0e86('0x3'));var BPromise=require(_0x0e86('0x4'));var rp=require(_0x0e86('0x5'));var fs=require('fs');var path=require(_0x0e86('0x6'));var rimraf=require(_0x0e86('0x7'));var config=require(_0x0e86('0x8'));var attributes=require(_0x0e86('0x9'));module['exports']=function(_0x4d8caf,_0x5230e3){return _0x4d8caf[_0x0e86('0xa')](_0x0e86('0xb'),attributes,{'tableName':_0x0e86('0xc'),'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 90e6bc1..ae39cf6 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0xf4eb21,_0x6f4c03){var _0x47af1a=function(_0x6ec167){while(--_0x6ec167){_0xf4eb21['push'](_0xf4eb21['shift']());}};_0x47af1a(++_0x6f4c03);}(_0x55ca,0x126));var _0xa55c=function(_0x494223,_0x2c1f71){_0x494223=_0x494223-0x0;var _0xdaf98=_0x55ca[_0x494223];return _0xdaf98;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ 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','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x34426b,_0x1cdf9f){var _0x19dad0=function(_0x505602){while(--_0x505602){_0x34426b['push'](_0x34426b['shift']());}};_0x19dad0(++_0x1cdf9f);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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']('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index a34bd6f..6f6b717 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 _0x3e44=['../../components/auth/service','../../components/interaction/service','post','isAuthenticated','exports','util','express','Router'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x3e44,0x135));var _0x43e4=function(_0x3e07f1,_0x670eb1){_0x3e07f1=_0x3e07f1-0x0;var _0x57a799=_0x3e44[_0x3e07f1];return _0x57a799;};'use strict';var multer=require('multer');var util=require(_0x43e4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x43e4('0x1'));var router=express[_0x43e4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x43e4('0x3'));var interaction=require(_0x43e4('0x4'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x43e4('0x5')]('/',auth[_0x43e4('0x6')](),controller['sendUserNotification']);module[_0x43e4('0x7')]=router; \ No newline at end of file +var _0x8cb4=['../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x353a52,_0x273eb3){var _0x7742d3=function(_0x2c97b1){while(--_0x2c97b1){_0x353a52['push'](_0x353a52['shift']());}};_0x7742d3(++_0x273eb3);}(_0x8cb4,0x1b3));var _0x48cb=function(_0x4a79be,_0x3a44fa){_0x4a79be=_0x4a79be-0x0;var _0xddab34=_0x8cb4[_0x4a79be];return _0xddab34;};'use strict';var multer=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var path=require(_0x48cb('0x2'));var timeout=require(_0x48cb('0x3'));var express=require('express');var router=express[_0x48cb('0x4')]();var fs_extra=require(_0x48cb('0x5'));var auth=require(_0x48cb('0x6'));var interaction=require(_0x48cb('0x7'));var config=require(_0x48cb('0x8'));var controller=require(_0x48cb('0x9'));router['post']('/',auth[_0x48cb('0xa')](),controller[_0x48cb('0xb')]);module[_0x48cb('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 0ff42a5..06074c8 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 _0x9645=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x4aac02,_0x99ece1){var _0x5e69d3=function(_0x33dcb3){while(--_0x33dcb3){_0x4aac02['push'](_0x4aac02['shift']());}};_0x5e69d3(++_0x99ece1);}(_0x9645,0x166));var _0x5964=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x9645[_0x4c7b20];return _0x4872bd;};'use strict';var Sequelize=require(_0x5964('0x0'));module[_0x5964('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x5964('0x2')]},'recipientsId':{'type':Sequelize[_0x5964('0x3')]},'recipientsDescription':{'type':Sequelize[_0x5964('0x2')]},'beep':{'type':Sequelize[_0x5964('0x4')]}}; \ No newline at end of file +var _0x7a15=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2d2a33,_0x2d1d1f){var _0x32d8ba=function(_0x566914){while(--_0x566914){_0x2d2a33['push'](_0x2d2a33['shift']());}};_0x32d8ba(++_0x2d1d1f);}(_0x7a15,0x185));var _0x57a1=function(_0x2ed57a,_0x7aed73){_0x2ed57a=_0x2ed57a-0x0;var _0x2ef25a=_0x7a15[_0x2ed57a];return _0x2ef25a;};'use strict';var Sequelize=require(_0x57a1('0x0'));module[_0x57a1('0x1')]={'body':{'type':Sequelize[_0x57a1('0x2')]},'senderName':{'type':Sequelize[_0x57a1('0x3')]},'recipientsId':{'type':Sequelize[_0x57a1('0x2')]},'recipientsDescription':{'type':Sequelize[_0x57a1('0x3')]},'beep':{'type':Sequelize[_0x57a1('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 6673983..f0de58f 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 _0xc769=['toLowerCase','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','sequelize','UserNotification','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','includes','queue','replace','push','all','flatten','catch','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','stack','name','send','sendUserNotification','text','body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','error','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model'];(function(_0x3a69b0,_0x5f87e0){var _0x3fb58c=function(_0x314ae3){while(--_0x314ae3){_0x3a69b0['push'](_0x3a69b0['shift']());}};_0x3fb58c(++_0x5f87e0);}(_0xc769,0x13c));var _0x9c76=function(_0x34ff5f,_0x12faf2){_0x34ff5f=_0x34ff5f-0x0;var _0x3326a4=_0xc769[_0x34ff5f];return _0x3326a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c76('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9c76('0x1'));var moment=require(_0x9c76('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9c76('0x3'));var util=require(_0x9c76('0x4'));var path=require(_0x9c76('0x5'));var sox=require('sox');var csv=require(_0x9c76('0x6'));var ejs=require(_0x9c76('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c76('0x8'));var crypto=require(_0x9c76('0x9'));var jsforce=require(_0x9c76('0xa'));var deskjs=require(_0x9c76('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9c76('0xc'));var Papa=require('papaparse');var Redis=require(_0x9c76('0xd'));var authService=require(_0x9c76('0xe'));var qs=require(_0x9c76('0xf'));var as=require(_0x9c76('0x10'));var hardwareService=require(_0x9c76('0x11'));var logger=require(_0x9c76('0x12'))(_0x9c76('0x13'));var utils=require(_0x9c76('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9c76('0x15'));var db=require(_0x9c76('0x16'))['db'];config[_0x9c76('0x17')]=_[_0x9c76('0x18')](config['redis'],{'host':_0x9c76('0x19'),'port':0x18eb});var socket=require(_0x9c76('0x1a'))(new Redis(config[_0x9c76('0x17')]));require(_0x9c76('0x1b'))[_0x9c76('0x1c')](socket);function respondWithStatusCode(_0x5f4306,_0x46ba6){_0x46ba6=_0x46ba6||0xcc;return function(_0x3c2ea4){if(_0x3c2ea4){return _0x5f4306[_0x9c76('0x1d')](_0x46ba6);}return _0x5f4306[_0x9c76('0x1e')](_0x46ba6)[_0x9c76('0x1f')]();};}function respondWithResult(_0x29f7f9,_0x4e79d0){_0x4e79d0=_0x4e79d0||0xc8;return function(_0x4b1f87){if(_0x4b1f87){return _0x29f7f9['status'](_0x4e79d0)[_0x9c76('0x20')](_0x4b1f87);}};}function respondWithFilteredResult(_0x5eebba,_0x4479c8){return function(_0x41fcbe){if(_0x41fcbe){var _0x8c768f=typeof _0x4479c8[_0x9c76('0x21')]==='undefined'&&typeof _0x4479c8[_0x9c76('0x22')]===_0x9c76('0x23');var _0x32695a=_0x41fcbe[_0x9c76('0x24')];var _0x32cb52=_0x8c768f?0x0:_0x4479c8['offset'];var _0x26def7=_0x8c768f?_0x41fcbe['count']:_0x4479c8['offset']+_0x4479c8[_0x9c76('0x22')];var _0x3e2a79;if(_0x26def7>=_0x32695a){_0x26def7=_0x32695a;_0x3e2a79=0xc8;}else{_0x3e2a79=0xce;}_0x5eebba[_0x9c76('0x1e')](_0x3e2a79);return _0x5eebba['set'](_0x9c76('0x25'),_0x32cb52+'-'+_0x26def7+'/'+_0x32695a)[_0x9c76('0x20')](_0x41fcbe);}return null;};}function patchUpdates(_0x57fb72){return function(_0x62f163){try{jsonpatch[_0x9c76('0x26')](_0x62f163,_0x57fb72,!![]);}catch(_0x326bee){return BPromise['reject'](_0x326bee);}return _0x62f163['save']();};}function saveUpdates(_0x5224e5,_0x3e426a){return function(_0x674ea1){if(_0x674ea1){return _0x674ea1['update'](_0x5224e5)[_0x9c76('0x27')](function(_0x17ca57){return _0x17ca57;});}return null;};}function removeEntity(_0x2f60c3,_0x5b2d2b){return function(_0xeff013){if(_0xeff013){return _0xeff013[_0x9c76('0x28')]()[_0x9c76('0x27')](function(){_0x2f60c3[_0x9c76('0x1e')](0xcc)[_0x9c76('0x1f')]();});}};}function handleEntityNotFound(_0x3dbd9c,_0x3a1e1d){return function(_0xef155f){if(!_0xef155f){_0x3dbd9c[_0x9c76('0x1d')](0x194);}return _0xef155f;};}function handleError(_0x519c0c,_0x19af69){_0x19af69=_0x19af69||0x1f4;return function(_0x3c81c1){logger['error'](_0x3c81c1[_0x9c76('0x29')]);if(_0x3c81c1['name']){delete _0x3c81c1[_0x9c76('0x2a')];}_0x519c0c[_0x9c76('0x1e')](_0x19af69)[_0x9c76('0x2b')](_0x3c81c1);};}exports[_0x9c76('0x2c')]=function(_0x353c47,_0x4ce09d,_0x11cecf){if(!_0x353c47['body']['hasOwnProperty'](_0x9c76('0x2d'))&&!_0x353c47[_0x9c76('0x2e')][_0x9c76('0x2f')]('TemplateId')){throw new db[(_0x9c76('0x30'))][(_0x9c76('0x31'))](_0x9c76('0x32'));}else{if(_0x353c47[_0x9c76('0x2e')][_0x9c76('0x2f')](_0x9c76('0x33'))&&!_0x353c47[_0x9c76('0x2e')][_0x9c76('0x2f')](_0x9c76('0x34'))){throw new db[(_0x9c76('0x30'))][(_0x9c76('0x31'))](_0x9c76('0x35'));}if(!_0x353c47[_0x9c76('0x2e')][_0x9c76('0x2f')]('recipients')){throw new db[(_0x9c76('0x30'))][(_0x9c76('0x31'))](_0x9c76('0x36'));}else{try{var _0x30f726=JSON[_0x9c76('0x37')](_0x353c47[_0x9c76('0x2e')]['recipients']);}catch(_0x491a6b){logger[_0x9c76('0x38')](_0x491a6b);throw new db[(_0x9c76('0x30'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x2c4fd3=[_0x9c76('0x39'),_0x9c76('0x3a'),_0x9c76('0x3b'),_0x9c76('0x3c'),_0x9c76('0x3d'),_0x9c76('0x3e'),_0x9c76('0x3f'),_0x9c76('0x40'),_0x9c76('0x41')];if(_[_0x9c76('0x42')](_0x30f726,function(_0x41a4fa){return!_['includes'](_0x2c4fd3,_0x41a4fa[_0x9c76('0x43')][_0x9c76('0x44')]());})){throw new db[(_0x9c76('0x30'))][(_0x9c76('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x358912={};_0x358912['senderName']=_0x353c47[_0x9c76('0x2e')][_0x9c76('0x2f')](_0x9c76('0x45'))?_0x353c47[_0x9c76('0x2e')][_0x9c76('0x45')]:_0x353c47[_0x9c76('0x41')][_0x9c76('0x46')];_0x358912['recipientsDescription']=_['isEmpty'](_0x353c47['body'][_0x9c76('0x47')])?null:_0x353c47[_0x9c76('0x2e')][_0x9c76('0x47')];_0x358912['beep']=_0x353c47[_0x9c76('0x2e')][_0x9c76('0x48')]||![];_0x358912[_0x9c76('0x49')]=_0x353c47[_0x9c76('0x41')]['id'];return getContent(_0x353c47[_0x9c76('0x2e')])[_0x9c76('0x27')](function(_0x30d65f){_0x358912[_0x9c76('0x2e')]=_0x30d65f;return getRecipients(_0x30f726);})[_0x9c76('0x27')](function(_0x26f5ac){_0x358912['recipientsId']=_[_0x9c76('0x4a')](_0x26f5ac)['join'](',');return db[_0x9c76('0x4b')]['transaction'](function(_0x357c5a){return db[_0x9c76('0x4c')]['create'](_0x358912,{'raw':!![],'transaction':_0x357c5a})[_0x9c76('0x27')](function(_0x2a3c71){var _0x186760={'sender':_0x358912[_0x9c76('0x45')],'description':_0x358912[_0x9c76('0x47')],'content':_0x358912[_0x9c76('0x2e')],'beep':_0x358912[_0x9c76('0x48')]};_0x26f5ac[_0x9c76('0x4d')](function(_0x56dc8a){_0x186760[_0x9c76('0x4e')]=_0x56dc8a;socket[_0x9c76('0x4f')](_0x9c76('0x50'),_0x186760);});return _0x2a3c71;});});})[_0x9c76('0x27')](respondWithResult(_0x4ce09d,0xc9))['catch'](handleError(_0x4ce09d,null));};function getContent(_0x5a9877){return new BPromise(function(_0x460422,_0x69f2ba){if(_0x5a9877[_0x9c76('0x2d')]){_0x460422(_0x5a9877[_0x9c76('0x2d')]);return;}return db[_0x9c76('0x51')][_0x9c76('0x52')]({'attributes':[_0x9c76('0x53')],'where':{'id':_0x5a9877[_0x9c76('0x33')]},'raw':!![]})['then'](function(_0x3ab409){if(!_0x3ab409)throw new db[(_0x9c76('0x30'))][(_0x9c76('0x31'))](_0x9c76('0x54'));var _0x370b99=Mustache[_0x9c76('0x55')](_0x3ab409[_0x9c76('0x53')],_0x5a9877[_0x9c76('0x34')]);_0x460422(_0x370b99);})['catch'](function(_0x48f35d){_0x69f2ba(_0x48f35d);});});}function getRecipients(_0x24faf8){return new BPromise(function(_0x23a7c5,_0x5d89ea){var _0x4f0fc5=[];var _0x4f4fb4=[];_0x24faf8[_0x9c76('0x4d')](function(_0x49fc7c){var _0x4c4add=_['startCase'](_0x49fc7c[_0x9c76('0x43')][_0x9c76('0x44')]());if(_0x4c4add===_0x9c76('0x56')){_0x4f0fc5=_[_0x9c76('0x57')](_0x4f0fc5,_0x49fc7c[_0x9c76('0x58')]);}else{if(_[_0x9c76('0x59')](_0x4c4add,_0x9c76('0x5a')))_0x4c4add=_0x4c4add[_0x9c76('0x5b')](_0x9c76('0x5a'),'Queue');_0x49fc7c[_0x9c76('0x58')][_0x9c76('0x4d')](function(_0x7fd9d5){_0x4f4fb4[_0x9c76('0x5c')](getAgents(_0x4c4add,_0x7fd9d5));});}});return BPromise[_0x9c76('0x5d')](_0x4f4fb4)[_0x9c76('0x27')](function(_0x3702e6){_0x4f0fc5=_[_0x9c76('0x57')](_0x4f0fc5,_[_0x9c76('0x5e')](_0x3702e6));_0x23a7c5(_0x4f0fc5);})['catch'](function(_0x3de43c){_0x5d89ea(_0x3de43c);});});}function getAgents(_0xd9e7ff,_0x48c91c){return new BPromise(function(_0x53ec87,_0x12c043){return db[_0xd9e7ff][_0x9c76('0x52')]({'where':{'id':_0x48c91c}})['then'](function(_0x4ec38d){return _0x4ec38d['getAgents']({'attributes':['id'],'raw':!![]})[_0x9c76('0x27')](function(_0x4a697c){var _0x526c4a=_['map'](_0x4a697c,'id');_0x53ec87(_0x526c4a);});})[_0x9c76('0x5f')](function(_0x1e9ced){_0x12c043(_0x1e9ced);});});} \ No newline at end of file +var _0x7c52=['set','apply','reject','save','update','then','destroy','name','send','sendUserNotification','body','hasOwnProperty','text','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','user','sortBy','join','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','ids','includes','queue','Queue','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','count'];(function(_0xf98ec1,_0x4c73b8){var _0x514b6a=function(_0x3dbc32){while(--_0x3dbc32){_0xf98ec1['push'](_0xf98ec1['shift']());}};_0x514b6a(++_0x4c73b8);}(_0x7c52,0x102));var _0x27c5=function(_0x1263e6,_0x5c1f6c){_0x1263e6=_0x1263e6-0x0;var _0x51c9fd=_0x7c52[_0x1263e6];return _0x51c9fd;};'use strict';var emlformat=require(_0x27c5('0x0'));var rimraf=require(_0x27c5('0x1'));var zipdir=require(_0x27c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27c5('0x3'));var moment=require(_0x27c5('0x4'));var BPromise=require(_0x27c5('0x5'));var Mustache=require('mustache');var util=require(_0x27c5('0x6'));var path=require(_0x27c5('0x7'));var sox=require(_0x27c5('0x8'));var csv=require(_0x27c5('0x9'));var ejs=require(_0x27c5('0xa'));var fs=require('fs');var fs_extra=require(_0x27c5('0xb'));var _=require('lodash');var squel=require(_0x27c5('0xc'));var crypto=require(_0x27c5('0xd'));var jsforce=require(_0x27c5('0xe'));var deskjs=require(_0x27c5('0xf'));var toCsv=require(_0x27c5('0x9'));var querystring=require(_0x27c5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x27c5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x27c5('0x12'));var hardwareService=require(_0x27c5('0x13'));var logger=require(_0x27c5('0x14'))(_0x27c5('0x15'));var utils=require(_0x27c5('0x16'));var config=require(_0x27c5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x27c5('0x18'))['db'];config['redis']=_[_0x27c5('0x19')](config['redis'],{'host':_0x27c5('0x1a'),'port':0x18eb});var socket=require(_0x27c5('0x1b'))(new Redis(config[_0x27c5('0x1c')]));require('./userNotification.socket')[_0x27c5('0x1d')](socket);function respondWithStatusCode(_0x5b4103,_0x2efdac){_0x2efdac=_0x2efdac||0xcc;return function(_0x302242){if(_0x302242){return _0x5b4103[_0x27c5('0x1e')](_0x2efdac);}return _0x5b4103[_0x27c5('0x1f')](_0x2efdac)[_0x27c5('0x20')]();};}function respondWithResult(_0x383084,_0x4cc347){_0x4cc347=_0x4cc347||0xc8;return function(_0x1d2147){if(_0x1d2147){return _0x383084[_0x27c5('0x1f')](_0x4cc347)[_0x27c5('0x21')](_0x1d2147);}};}function respondWithFilteredResult(_0x4d7844,_0x5585b4){return function(_0x4c505f){if(_0x4c505f){var _0x7550a9=typeof _0x5585b4['offset']===_0x27c5('0x22')&&typeof _0x5585b4['limit']===_0x27c5('0x22');var _0x1e5b28=_0x4c505f[_0x27c5('0x23')];var _0x5e70b8=_0x7550a9?0x0:_0x5585b4['offset'];var _0x32c4e1=_0x7550a9?_0x4c505f['count']:_0x5585b4['offset']+_0x5585b4['limit'];var _0x3c89eb;if(_0x32c4e1>=_0x1e5b28){_0x32c4e1=_0x1e5b28;_0x3c89eb=0xc8;}else{_0x3c89eb=0xce;}_0x4d7844[_0x27c5('0x1f')](_0x3c89eb);return _0x4d7844[_0x27c5('0x24')]('Content-Range',_0x5e70b8+'-'+_0x32c4e1+'/'+_0x1e5b28)[_0x27c5('0x21')](_0x4c505f);}return null;};}function patchUpdates(_0x282ad2){return function(_0x3bd56d){try{jsonpatch[_0x27c5('0x25')](_0x3bd56d,_0x282ad2,!![]);}catch(_0x57eaee){return BPromise[_0x27c5('0x26')](_0x57eaee);}return _0x3bd56d[_0x27c5('0x27')]();};}function saveUpdates(_0x528264,_0x34b7bc){return function(_0x1d1c23){if(_0x1d1c23){return _0x1d1c23[_0x27c5('0x28')](_0x528264)[_0x27c5('0x29')](function(_0x53b834){return _0x53b834;});}return null;};}function removeEntity(_0x1cad2f,_0xeaeb5a){return function(_0x2024c4){if(_0x2024c4){return _0x2024c4[_0x27c5('0x2a')]()[_0x27c5('0x29')](function(){_0x1cad2f[_0x27c5('0x1f')](0xcc)[_0x27c5('0x20')]();});}};}function handleEntityNotFound(_0x5cb757,_0x1d792f){return function(_0x11a570){if(!_0x11a570){_0x5cb757[_0x27c5('0x1e')](0x194);}return _0x11a570;};}function handleError(_0x553ebb,_0x162fef){_0x162fef=_0x162fef||0x1f4;return function(_0x319e82){logger['error'](_0x319e82['stack']);if(_0x319e82['name']){delete _0x319e82[_0x27c5('0x2b')];}_0x553ebb[_0x27c5('0x1f')](_0x162fef)[_0x27c5('0x2c')](_0x319e82);};}exports[_0x27c5('0x2d')]=function(_0x1793bb,_0x1e93db,_0x33bdd5){if(!_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x2f')](_0x27c5('0x30'))&&!_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x2f')]('TemplateId')){throw new db['Sequelize'][(_0x27c5('0x31'))](_0x27c5('0x32'));}else{if(_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x2f')](_0x27c5('0x33'))&&!_0x1793bb['body'][_0x27c5('0x2f')](_0x27c5('0x34'))){throw new db[(_0x27c5('0x35'))][(_0x27c5('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x2f')](_0x27c5('0x36'))){throw new db['Sequelize']['ValidationError'](_0x27c5('0x37'));}else{try{var _0x196d95=JSON[_0x27c5('0x38')](_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x36')]);}catch(_0x56b79f){logger['error'](_0x56b79f);throw new db['Sequelize']['ValidationError'](_0x27c5('0x39'));}var _0x217a76=[_0x27c5('0x3a'),'faxqueue',_0x27c5('0x3b'),_0x27c5('0x3c'),_0x27c5('0x3d'),'voicequeue',_0x27c5('0x3e'),_0x27c5('0x3f'),'user'];if(_[_0x27c5('0x40')](_0x196d95,function(_0x3eb0fb){return!_['includes'](_0x217a76,_0x3eb0fb[_0x27c5('0x41')][_0x27c5('0x42')]());})){throw new db[(_0x27c5('0x35'))][(_0x27c5('0x31'))](_0x27c5('0x43'));}}}var _0xda36da={};_0xda36da[_0x27c5('0x44')]=_0x1793bb['body'][_0x27c5('0x2f')](_0x27c5('0x44'))?_0x1793bb['body']['senderName']:_0x1793bb['user'][_0x27c5('0x45')];_0xda36da[_0x27c5('0x46')]=_[_0x27c5('0x47')](_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x46')])?null:_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x46')];_0xda36da['beep']=_0x1793bb[_0x27c5('0x2e')][_0x27c5('0x48')]||![];_0xda36da[_0x27c5('0x49')]=_0x1793bb[_0x27c5('0x4a')]['id'];return getContent(_0x1793bb['body'])[_0x27c5('0x29')](function(_0x40a343){_0xda36da[_0x27c5('0x2e')]=_0x40a343;return getRecipients(_0x196d95);})['then'](function(_0x39b510){_0xda36da['recipientsId']=_[_0x27c5('0x4b')](_0x39b510)[_0x27c5('0x4c')](',');return db['sequelize'][_0x27c5('0x4d')](function(_0x5503b1){return db[_0x27c5('0x4e')][_0x27c5('0x4f')](_0xda36da,{'raw':!![],'transaction':_0x5503b1})['then'](function(_0x49a378){var _0xd97e5c={'sender':_0xda36da[_0x27c5('0x44')],'description':_0xda36da[_0x27c5('0x46')],'content':_0xda36da[_0x27c5('0x2e')],'beep':_0xda36da[_0x27c5('0x48')]};_0x39b510[_0x27c5('0x50')](function(_0x33fb99){_0xd97e5c[_0x27c5('0x51')]=_0x33fb99;socket['emit'](_0x27c5('0x52'),_0xd97e5c);});return _0x49a378;});});})['then'](respondWithResult(_0x1e93db,0xc9))[_0x27c5('0x53')](handleError(_0x1e93db,null));};function getContent(_0x2ac766){return new BPromise(function(_0x52e51a,_0x2d3077){if(_0x2ac766['text']){_0x52e51a(_0x2ac766['text']);return;}return db[_0x27c5('0x54')][_0x27c5('0x55')]({'attributes':[_0x27c5('0x56')],'where':{'id':_0x2ac766[_0x27c5('0x33')]},'raw':!![]})[_0x27c5('0x29')](function(_0x45356b){if(!_0x45356b)throw new db[(_0x27c5('0x35'))]['ValidationError'](_0x27c5('0x57'));var _0x209f76=Mustache[_0x27c5('0x58')](_0x45356b[_0x27c5('0x56')],_0x2ac766[_0x27c5('0x34')]);_0x52e51a(_0x209f76);})[_0x27c5('0x53')](function(_0x380dbd){_0x2d3077(_0x380dbd);});});}function getRecipients(_0x7cf7b2){return new BPromise(function(_0x2df5c2,_0x2cb954){var _0x530e67=[];var _0x20a323=[];_0x7cf7b2[_0x27c5('0x50')](function(_0x48624b){var _0x29adfb=_['startCase'](_0x48624b[_0x27c5('0x41')]['toLowerCase']());if(_0x29adfb===_0x27c5('0x59')){_0x530e67=_['union'](_0x530e67,_0x48624b[_0x27c5('0x5a')]);}else{if(_[_0x27c5('0x5b')](_0x29adfb,_0x27c5('0x5c')))_0x29adfb=_0x29adfb['replace'](_0x27c5('0x5c'),_0x27c5('0x5d'));_0x48624b['ids'][_0x27c5('0x50')](function(_0x206ec0){_0x20a323['push'](getAgents(_0x29adfb,_0x206ec0));});}});return BPromise[_0x27c5('0x5e')](_0x20a323)[_0x27c5('0x29')](function(_0x4f4873){_0x530e67=_['union'](_0x530e67,_[_0x27c5('0x5f')](_0x4f4873));_0x2df5c2(_0x530e67);})[_0x27c5('0x53')](function(_0x5b5313){_0x2cb954(_0x5b5313);});});}function getAgents(_0x44840c,_0x3e0d13){return new BPromise(function(_0x434b03,_0x384e75){return db[_0x44840c]['findOne']({'where':{'id':_0x3e0d13}})[_0x27c5('0x29')](function(_0x386c36){return _0x386c36[_0x27c5('0x60')]({'attributes':['id'],'raw':!![]})[_0x27c5('0x29')](function(_0x3170be){var _0x44e62e=_[_0x27c5('0x61')](_0x3170be,'id');_0x434b03(_0x44e62e);});})[_0x27c5('0x53')](function(_0x33fd07){_0x384e75(_0x33fd07);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 4503067..e7d50cb 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 _0x8b5e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x8b5e,0x1f3));var _0xe8b5=function(_0x576c08,_0x324ff){_0x576c08=_0x576c08-0x0;var _0x25a575=_0x8b5e[_0x576c08];return _0x25a575;};'use strict';var EventEmitter=require(_0xe8b5('0x0'));var UserNotification=require(_0xe8b5('0x1'))['db'][_0xe8b5('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe8b5('0x3')](0x0);var events={'afterCreate':_0xe8b5('0x4'),'afterUpdate':_0xe8b5('0x5'),'afterDestroy':_0xe8b5('0x6')};function emitEvent(_0x220873){return function(_0x6f1f35,_0x3faa6a,_0x4c8e3b){UserNotificationEvents[_0xe8b5('0x7')](_0x220873+':'+_0x6f1f35['id'],_0x6f1f35);UserNotificationEvents['emit'](_0x220873,_0x6f1f35);_0x4c8e3b(null);};}for(var e in events){if(events[_0xe8b5('0x8')](e)){var event=events[e];UserNotification[_0xe8b5('0x9')](e,emitEvent(event));}}module[_0xe8b5('0xa')]=UserNotificationEvents; \ No newline at end of file +var _0x1ec8=['hook','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0xb7268a,_0x2139e9){var _0x57d800=function(_0x44ad15){while(--_0x44ad15){_0xb7268a['push'](_0xb7268a['shift']());}};_0x57d800(++_0x2139e9);}(_0x1ec8,0xdf));var _0x81ec=function(_0x4f86fd,_0x2e0fcc){_0x4f86fd=_0x4f86fd-0x0;var _0x2f799a=_0x1ec8[_0x4f86fd];return _0x2f799a;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x81ec('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x81ec('0x1')](0x0);var events={'afterCreate':_0x81ec('0x2'),'afterUpdate':_0x81ec('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5bad73){return function(_0x18ee7b,_0x5639fb,_0x19876b){UserNotificationEvents[_0x81ec('0x4')](_0x5bad73+':'+_0x18ee7b['id'],_0x18ee7b);UserNotificationEvents[_0x81ec('0x4')](_0x5bad73,_0x18ee7b);_0x19876b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x81ec('0x5')](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 88decb2..6f7e0fc 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 _0x7657=['request-promise','path','rimraf','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x241b65,_0x3ab96e){var _0x26db1d=function(_0x46e148){while(--_0x46e148){_0x241b65['push'](_0x241b65['shift']());}};_0x26db1d(++_0x3ab96e);}(_0x7657,0x18f));var _0x7765=function(_0x11ac8b,_0x131d25){_0x11ac8b=_0x11ac8b-0x0;var _0x18a279=_0x7657[_0x11ac8b];return _0x18a279;};'use strict';var _=require(_0x7765('0x0'));var util=require(_0x7765('0x1'));var logger=require(_0x7765('0x2'))(_0x7765('0x3'));var moment=require(_0x7765('0x4'));var BPromise=require(_0x7765('0x5'));var rp=require(_0x7765('0x6'));var fs=require('fs');var path=require(_0x7765('0x7'));var rimraf=require(_0x7765('0x8'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x7765('0x9')]=function(_0x1e248f,_0x520d3c){return _0x1e248f[_0x7765('0xa')](_0x7765('0xb'),attributes,{'tableName':_0x7765('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7765('0xd'),'collate':_0x7765('0xe')});}; \ No newline at end of file +var _0x5fdd=['request-promise','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','api','bluebird'];(function(_0x1ccd3e,_0x32e997){var _0x4a7b8b=function(_0x465991){while(--_0x465991){_0x1ccd3e['push'](_0x1ccd3e['shift']());}};_0x4a7b8b(++_0x32e997);}(_0x5fdd,0x11c));var _0xd5fd=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x5fdd[_0x43b06b];return _0x2c555b;};'use strict';var _=require(_0xd5fd('0x0'));var util=require(_0xd5fd('0x1'));var logger=require('../../config/logger')(_0xd5fd('0x2'));var moment=require('moment');var BPromise=require(_0xd5fd('0x3'));var rp=require(_0xd5fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd5fd('0x5'));var attributes=require(_0xd5fd('0x6'));module[_0xd5fd('0x7')]=function(_0x570a8b,_0x2454a8){return _0x570a8b[_0xd5fd('0x8')](_0xd5fd('0x9'),attributes,{'tableName':_0xd5fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd5fd('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 0fe7411..dbc9dbe 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 _0xdb53=['rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userNotification.socket','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5cb61e,_0x318bc2){var _0x2d2626=function(_0x5043f4){while(--_0x5043f4){_0x5cb61e['push'](_0x5cb61e['shift']());}};_0x2d2626(++_0x318bc2);}(_0xdb53,0x1cc));var _0x3db5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb53[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3db5('0x0'));var util=require(_0x3db5('0x1'));var moment=require(_0x3db5('0x2'));var BPromise=require(_0x3db5('0x3'));var rs=require(_0x3db5('0x4'));var fs=require('fs');var Redis=require(_0x3db5('0x5'));var db=require(_0x3db5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db5('0x7'))(_0x3db5('0x8'));var config=require(_0x3db5('0x9'));var jayson=require(_0x3db5('0xa'));var client=jayson[_0x3db5('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3db5('0xc')],{'host':_0x3db5('0xd'),'port':0x18eb});var socket=require(_0x3db5('0xe'))(new Redis(config['redis']));require(_0x3db5('0xf'))['register'](socket);function respondWithRpcPromise(_0x5586d5,_0x1db115,_0x35b72c){return new BPromise(function(_0x249e95,_0x2faafc){return client['request'](_0x5586d5,_0x35b72c)[_0x3db5('0x10')](function(_0x1a1623){logger[_0x3db5('0x11')](_0x3db5('0x12'),_0x1db115,_0x3db5('0x13'));logger[_0x3db5('0x14')](_0x3db5('0x15'),_0x1db115,_0x3db5('0x13'),JSON[_0x3db5('0x16')](_0x1a1623));if(_0x1a1623[_0x3db5('0x17')]){if(_0x1a1623[_0x3db5('0x17')]['code']===0x1f4){logger[_0x3db5('0x17')](_0x3db5('0x12'),_0x1db115,_0x1a1623[_0x3db5('0x17')][_0x3db5('0x18')]);return _0x2faafc(_0x1a1623[_0x3db5('0x17')][_0x3db5('0x18')]);}logger[_0x3db5('0x17')](_0x3db5('0x12'),_0x1db115,_0x1a1623[_0x3db5('0x17')][_0x3db5('0x18')]);return _0x249e95(_0x1a1623[_0x3db5('0x17')][_0x3db5('0x18')]);}else{logger[_0x3db5('0x11')](_0x3db5('0x12'),_0x1db115,_0x3db5('0x13'));_0x249e95(_0x1a1623['result'][_0x3db5('0x18')]);}})[_0x3db5('0x19')](function(_0x199bd3){logger['error']('UserNotification,\x20%s,\x20%s',_0x1db115,_0x199bd3);_0x2faafc(_0x199bd3);});});} \ No newline at end of file +var _0xa027=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa027,0x1c5));var _0x7a02=function(_0x25b611,_0x198f88){_0x25b611=_0x25b611-0x0;var _0x32d09b=_0xa027[_0x25b611];return _0x32d09b;};'use strict';var _=require(_0x7a02('0x0'));var util=require(_0x7a02('0x1'));var moment=require(_0x7a02('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a02('0x3'));var fs=require('fs');var Redis=require(_0x7a02('0x4'));var db=require(_0x7a02('0x5'))['db'];var utils=require(_0x7a02('0x6'));var logger=require(_0x7a02('0x7'))(_0x7a02('0x8'));var config=require(_0x7a02('0x9'));var jayson=require(_0x7a02('0xa'));var client=jayson[_0x7a02('0xb')]['http']({'port':0x232a});config[_0x7a02('0xc')]=_[_0x7a02('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7a02('0xe'))(new Redis(config[_0x7a02('0xc')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x570016,_0x294dd8,_0x6da9b3){return new BPromise(function(_0x765708,_0x1f73ba){return client['request'](_0x570016,_0x6da9b3)['then'](function(_0x1e08e8){logger[_0x7a02('0xf')](_0x7a02('0x10'),_0x294dd8,_0x7a02('0x11'));logger[_0x7a02('0x12')](_0x7a02('0x13'),_0x294dd8,_0x7a02('0x11'),JSON['stringify'](_0x1e08e8));if(_0x1e08e8[_0x7a02('0x14')]){if(_0x1e08e8[_0x7a02('0x14')]['code']===0x1f4){logger['error'](_0x7a02('0x10'),_0x294dd8,_0x1e08e8[_0x7a02('0x14')][_0x7a02('0x15')]);return _0x1f73ba(_0x1e08e8['error'][_0x7a02('0x15')]);}logger[_0x7a02('0x14')](_0x7a02('0x10'),_0x294dd8,_0x1e08e8[_0x7a02('0x14')][_0x7a02('0x15')]);return _0x765708(_0x1e08e8[_0x7a02('0x14')][_0x7a02('0x15')]);}else{logger['info'](_0x7a02('0x10'),_0x294dd8,_0x7a02('0x11'));_0x765708(_0x1e08e8[_0x7a02('0x16')]['message']);}})[_0x7a02('0x17')](function(_0x206af3){logger[_0x7a02('0x14')](_0x7a02('0x10'),_0x294dd8,_0x206af3);_0x1f73ba(_0x206af3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 7a0fd0a..0be4867 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 _0x2fd0=['register','length','userNotification:','./userNotification.events','emit'];(function(_0x362d10,_0x5a1b75){var _0x2a1cd1=function(_0x26dd90){while(--_0x26dd90){_0x362d10['push'](_0x362d10['shift']());}};_0x2a1cd1(++_0x5a1b75);}(_0x2fd0,0x8a));var _0x02fd=function(_0x80a6ad,_0x132c02){_0x80a6ad=_0x80a6ad-0x0;var _0x315c42=_0x2fd0[_0x80a6ad];return _0x315c42;};'use strict';var UserNotificationEvents=require(_0x02fd('0x0'));var events=['save','remove','update'];function createListener(_0x4d1ad8,_0x354214){return function(_0x441db5){_0x354214[_0x02fd('0x1')](_0x4d1ad8,_0x441db5);};}function removeListener(_0x480809,_0x553473){return function(){UserNotificationEvents['removeListener'](_0x480809,_0x553473);};}exports[_0x02fd('0x2')]=function(_0x52631d){for(var _0x580567=0x0,_0x2123b3=events[_0x02fd('0x3')];_0x580567<_0x2123b3;_0x580567++){var _0x1688f1=events[_0x580567];var _0x134bc1=createListener(_0x02fd('0x4')+_0x1688f1,_0x52631d);UserNotificationEvents['on'](_0x1688f1,_0x134bc1);}}; \ No newline at end of file +var _0x145b=['userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register','length'];(function(_0x261e6b,_0x24a526){var _0x2c211b=function(_0x5f3b6b){while(--_0x5f3b6b){_0x261e6b['push'](_0x261e6b['shift']());}};_0x2c211b(++_0x24a526);}(_0x145b,0x1f0));var _0xb145=function(_0x4ad598,_0xd3bf2b){_0x4ad598=_0x4ad598-0x0;var _0x33cb9d=_0x145b[_0x4ad598];return _0x33cb9d;};'use strict';var UserNotificationEvents=require(_0xb145('0x0'));var events=[_0xb145('0x1'),_0xb145('0x2'),_0xb145('0x3')];function createListener(_0x36a062,_0x10572e){return function(_0x8cbcb9){_0x10572e[_0xb145('0x4')](_0x36a062,_0x8cbcb9);};}function removeListener(_0x52adab,_0x469e83){return function(){UserNotificationEvents[_0xb145('0x5')](_0x52adab,_0x469e83);};}exports[_0xb145('0x6')]=function(_0x7cf321){for(var _0x5635c1=0x0,_0x3ac462=events[_0xb145('0x7')];_0x5635c1<_0x3ac462;_0x5635c1++){var _0x18b50a=events[_0x5635c1];var _0xac4d1d=createListener(_0xb145('0x8')+_0x18b50a,_0x7cf321);UserNotificationEvents['on'](_0x18b50a,_0xac4d1d);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 5bce581..498d287 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x439745,_0x38cca2){var _0x3fdf21=function(_0x80f4c5){while(--_0x80f4c5){_0x439745['push'](_0x439745['shift']());}};_0x3fdf21(++_0x38cca2);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2e7087,_0x112eec){var _0xb5b3a6=function(_0x296310){while(--_0x296310){_0x2e7087['push'](_0x2e7087['shift']());}};_0xb5b3a6(++_0x112eec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f4e73dc..1c779c8 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 _0x5c71=['exports','INTEGER','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5c71,0x1e5));var _0x15c7=function(_0x5e7bd1,_0x3634dd){_0x5e7bd1=_0x5e7bd1-0x0;var _0x33d089=_0x5c71[_0x5e7bd1];return _0x33d089;};'use strict';var Sequelize=require(_0x15c7('0x0'));module[_0x15c7('0x1')]={'penalty':{'type':Sequelize[_0x15c7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe64b=['exports','INTEGER','sequelize'];(function(_0x480cf2,_0x5a9c1c){var _0x15f166=function(_0x3bbef8){while(--_0x3bbef8){_0x480cf2['push'](_0x480cf2['shift']());}};_0x15f166(++_0x5a9c1c);}(_0xe64b,0x188));var _0xbe64=function(_0x5a4f4e,_0xc7a252){_0x5a4f4e=_0x5a4f4e-0x0;var _0x4a9998=_0xe64b[_0x5a4f4e];return _0x4a9998;};'use strict';var Sequelize=require(_0xbe64('0x0'));module[_0xbe64('0x1')]={'penalty':{'type':Sequelize[_0xbe64('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 55ba13e..44d087e 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 _0x1d38=['user_has_openchannel_queues','../../config/logger','api','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x57d8f3,_0x1ee0aa){var _0x48c9e6=function(_0x131181){while(--_0x131181){_0x57d8f3['push'](_0x57d8f3['shift']());}};_0x48c9e6(++_0x1ee0aa);}(_0x1d38,0x9a));var _0x81d3=function(_0x1ba4b4,_0x460fe5){_0x1ba4b4=_0x1ba4b4-0x0;var _0x4413a3=_0x1d38[_0x1ba4b4];return _0x4413a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x81d3('0x0'))(_0x81d3('0x1'));var moment=require('moment');var BPromise=require(_0x81d3('0x2'));var rp=require(_0x81d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81d3('0x4'));var config=require('../../config/environment');var attributes=require(_0x81d3('0x5'));module[_0x81d3('0x6')]=function(_0x4ee23a,_0x3a6602){return _0x4ee23a['define'](_0x81d3('0x7'),attributes,{'tableName':_0x81d3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf545=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x518adc,_0x19e0a8){var _0x379a3a=function(_0x24bcb2){while(--_0x24bcb2){_0x518adc['push'](_0x518adc['shift']());}};_0x379a3a(++_0x19e0a8);}(_0xf545,0x1aa));var _0x5f54=function(_0x957193,_0x3fec8b){_0x957193=_0x957193-0x0;var _0x9473f8=_0xf545[_0x957193];return _0x9473f8;};'use strict';var _=require(_0x5f54('0x0'));var util=require(_0x5f54('0x1'));var logger=require(_0x5f54('0x2'))('api');var moment=require(_0x5f54('0x3'));var BPromise=require(_0x5f54('0x4'));var rp=require(_0x5f54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f54('0x6'));var config=require(_0x5f54('0x7'));var attributes=require(_0x5f54('0x8'));module[_0x5f54('0x9')]=function(_0x902c26,_0xcec298){return _0x902c26[_0x5f54('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x5f54('0xb'),'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 717e490..2a3fab9 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 _0xeb29=['client','request','then','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x2f1a04,_0x511ea5){var _0x41db27=function(_0x505f64){while(--_0x505f64){_0x2f1a04['push'](_0x2f1a04['shift']());}};_0x41db27(++_0x511ea5);}(_0xeb29,0x1cc));var _0x9eb2=function(_0x1a008b,_0x3538ee){_0x1a008b=_0x1a008b-0x0;var _0xf0dfd1=_0xeb29[_0x1a008b];return _0xf0dfd1;};'use strict';var _=require('lodash');var util=require(_0x9eb2('0x0'));var moment=require(_0x9eb2('0x1'));var BPromise=require(_0x9eb2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9eb2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9eb2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9eb2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39fb87,_0x55b468,_0x148e91){return new BPromise(function(_0x32a7ef,_0x1557a9){return client[_0x9eb2('0x6')](_0x39fb87,_0x148e91)[_0x9eb2('0x7')](function(_0x46101d){logger[_0x9eb2('0x8')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x55b468,'request\x20sent');logger[_0x9eb2('0x9')](_0x9eb2('0xa'),_0x55b468,'request\x20sent',JSON['stringify'](_0x46101d));if(_0x46101d[_0x9eb2('0xb')]){if(_0x46101d['error'][_0x9eb2('0xc')]===0x1f4){logger[_0x9eb2('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x55b468,_0x46101d[_0x9eb2('0xb')][_0x9eb2('0xd')]);return _0x1557a9(_0x46101d[_0x9eb2('0xb')][_0x9eb2('0xd')]);}logger[_0x9eb2('0xb')](_0x9eb2('0xe'),_0x55b468,_0x46101d[_0x9eb2('0xb')][_0x9eb2('0xd')]);return _0x32a7ef(_0x46101d[_0x9eb2('0xb')][_0x9eb2('0xd')]);}else{logger[_0x9eb2('0x8')](_0x9eb2('0xe'),_0x55b468,'request\x20sent');_0x32a7ef(_0x46101d['result']['message']);}})['catch'](function(_0x54609c){logger[_0x9eb2('0xb')](_0x9eb2('0xe'),_0x55b468,_0x54609c);_0x1557a9(_0x54609c);});});} \ No newline at end of file +var _0x06d7=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5bb88d,_0x54514a){var _0x495ecb=function(_0x5bcf12){while(--_0x5bcf12){_0x5bb88d['push'](_0x5bb88d['shift']());}};_0x495ecb(++_0x54514a);}(_0x06d7,0xd2));var _0x706d=function(_0x2b11e1,_0x5363eb){_0x2b11e1=_0x2b11e1-0x0;var _0x573679=_0x06d7[_0x2b11e1];return _0x573679;};'use strict';var _=require(_0x706d('0x0'));var util=require('util');var moment=require(_0x706d('0x1'));var BPromise=require(_0x706d('0x2'));var rs=require(_0x706d('0x3'));var fs=require('fs');var Redis=require(_0x706d('0x4'));var db=require(_0x706d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x706d('0x6'))(_0x706d('0x7'));var config=require(_0x706d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x706d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6975c7,_0x45148e,_0x57fb38){return new BPromise(function(_0x3568e5,_0x3375a5){return client[_0x706d('0xa')](_0x6975c7,_0x57fb38)[_0x706d('0xb')](function(_0x545890){logger[_0x706d('0xc')](_0x706d('0xd'),_0x45148e,_0x706d('0xe'));logger['debug'](_0x706d('0xf'),_0x45148e,'request\x20sent',JSON[_0x706d('0x10')](_0x545890));if(_0x545890[_0x706d('0x11')]){if(_0x545890[_0x706d('0x11')][_0x706d('0x12')]===0x1f4){logger[_0x706d('0x11')](_0x706d('0xd'),_0x45148e,_0x545890[_0x706d('0x11')]['message']);return _0x3375a5(_0x545890[_0x706d('0x11')][_0x706d('0x13')]);}logger[_0x706d('0x11')](_0x706d('0xd'),_0x45148e,_0x545890[_0x706d('0x11')][_0x706d('0x13')]);return _0x3568e5(_0x545890['error'][_0x706d('0x13')]);}else{logger['info'](_0x706d('0xd'),_0x45148e,_0x706d('0xe'));_0x3568e5(_0x545890[_0x706d('0x14')][_0x706d('0x13')]);}})['catch'](function(_0x105ccc){logger[_0x706d('0x11')](_0x706d('0xd'),_0x45148e,_0x105ccc);_0x3375a5(_0x105ccc);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 07b9bd4..0f59f85 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 _0xeb63=['/:id/clone','clone','/:id/sections','addResources','put','/:id','delete','destroy','removeResources','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','getSections','/:id/resources','getResources','post'];(function(_0x117a57,_0x39215e){var _0x3828e4=function(_0xae0b75){while(--_0xae0b75){_0x117a57['push'](_0x117a57['shift']());}};_0x3828e4(++_0x39215e);}(_0xeb63,0x1b2));var _0x3eb6=function(_0x2a2799,_0x5e25a8){_0x2a2799=_0x2a2799-0x0;var _0x17f761=_0xeb63[_0x2a2799];return _0x17f761;};'use strict';var multer=require(_0x3eb6('0x0'));var util=require(_0x3eb6('0x1'));var path=require(_0x3eb6('0x2'));var timeout=require(_0x3eb6('0x3'));var express=require('express');var router=express[_0x3eb6('0x4')]();var fs_extra=require(_0x3eb6('0x5'));var auth=require(_0x3eb6('0x6'));var interaction=require(_0x3eb6('0x7'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x3eb6('0x8')]('/',auth['isAuthenticated'](),controller[_0x3eb6('0x9')]);router[_0x3eb6('0x8')](_0x3eb6('0xa'),auth[_0x3eb6('0xb')](),controller['describe']);router['get']('/:id',auth[_0x3eb6('0xb')](),controller['show']);router[_0x3eb6('0x8')]('/:id/sections',auth[_0x3eb6('0xb')](),controller[_0x3eb6('0xc')]);router[_0x3eb6('0x8')](_0x3eb6('0xd'),auth[_0x3eb6('0xb')](),controller[_0x3eb6('0xe')]);router[_0x3eb6('0xf')]('/',auth[_0x3eb6('0xb')](),controller['create']);router[_0x3eb6('0xf')](_0x3eb6('0x10'),auth[_0x3eb6('0xb')](),controller[_0x3eb6('0x11')]);router[_0x3eb6('0xf')](_0x3eb6('0x12'),auth[_0x3eb6('0xb')](),controller['addSections']);router[_0x3eb6('0xf')](_0x3eb6('0xd'),auth['isAuthenticated'](),controller[_0x3eb6('0x13')]);router[_0x3eb6('0x14')](_0x3eb6('0x15'),auth[_0x3eb6('0xb')](),controller['update']);router[_0x3eb6('0x16')](_0x3eb6('0x15'),auth['isAuthenticated'](),controller[_0x3eb6('0x17')]);router[_0x3eb6('0x16')](_0x3eb6('0x12'),auth[_0x3eb6('0xb')](),controller['removeSections']);router['delete'](_0x3eb6('0xd'),auth['isAuthenticated'](),controller[_0x3eb6('0x18')]);module['exports']=router; \ No newline at end of file +var _0xba27=['getResources','post','create','/:id/clone','addSections','addResources','put','update','delete','removeSections','removeResources','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/sections','getSections','/:id/resources'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xba27,0x15c));var _0x7ba2=function(_0x466bfd,_0x56f4bb){_0x466bfd=_0x466bfd-0x0;var _0x29293d=_0xba27[_0x466bfd];return _0x29293d;};'use strict';var multer=require('multer');var util=require(_0x7ba2('0x0'));var path=require(_0x7ba2('0x1'));var timeout=require(_0x7ba2('0x2'));var express=require(_0x7ba2('0x3'));var router=express[_0x7ba2('0x4')]();var fs_extra=require(_0x7ba2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7ba2('0x6'));var config=require(_0x7ba2('0x7'));var controller=require('./userProfile.controller');router[_0x7ba2('0x8')]('/',auth[_0x7ba2('0x9')](),controller['index']);router[_0x7ba2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7ba2('0xa')]);router[_0x7ba2('0x8')](_0x7ba2('0xb'),auth['isAuthenticated'](),controller[_0x7ba2('0xc')]);router[_0x7ba2('0x8')](_0x7ba2('0xd'),auth[_0x7ba2('0x9')](),controller[_0x7ba2('0xe')]);router[_0x7ba2('0x8')](_0x7ba2('0xf'),auth['isAuthenticated'](),controller[_0x7ba2('0x10')]);router[_0x7ba2('0x11')]('/',auth[_0x7ba2('0x9')](),controller[_0x7ba2('0x12')]);router[_0x7ba2('0x11')](_0x7ba2('0x13'),auth[_0x7ba2('0x9')](),controller['clone']);router['post'](_0x7ba2('0xd'),auth[_0x7ba2('0x9')](),controller[_0x7ba2('0x14')]);router[_0x7ba2('0x11')]('/:id/resources',auth[_0x7ba2('0x9')](),controller[_0x7ba2('0x15')]);router[_0x7ba2('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7ba2('0x17')]);router[_0x7ba2('0x18')]('/:id',auth[_0x7ba2('0x9')](),controller['destroy']);router[_0x7ba2('0x18')](_0x7ba2('0xd'),auth[_0x7ba2('0x9')](),controller[_0x7ba2('0x19')]);router[_0x7ba2('0x18')](_0x7ba2('0xf'),auth[_0x7ba2('0x9')](),controller[_0x7ba2('0x1a')]);module[_0x7ba2('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3e263eb..e22a7fe 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 _0xb337=['STRING','join','getDataValue','crudPermissions','split','BOOLEAN','exports','name'];(function(_0x16ab77,_0x2a4072){var _0x5df7fe=function(_0x262eaf){while(--_0x262eaf){_0x16ab77['push'](_0x16ab77['shift']());}};_0x5df7fe(++_0x2a4072);}(_0xb337,0x156));var _0x7b33=function(_0xa0c9fa,_0x33c00f){_0xa0c9fa=_0xa0c9fa-0x0;var _0x1e7759=_0xb337[_0xa0c9fa];return _0x1e7759;};'use strict';var Sequelize=require('sequelize');module[_0x7b33('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7b33('0x1')},'crudPermissions':{'type':Sequelize[_0x7b33('0x2')],'set':function(_0x640fff){this['setDataValue']('crudPermissions',_0x640fff?_0x640fff[_0x7b33('0x3')](''):[]);},'get':function(){return this[_0x7b33('0x4')](_0x7b33('0x5'))?this[_0x7b33('0x4')]('crudPermissions')[_0x7b33('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7b33('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7b33('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7b33('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7b33('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7b33('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7b33('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7b33('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x432a=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue','crudPermissions'];(function(_0x384ff7,_0x19f8f8){var _0x5adeb8=function(_0x4b8c3d){while(--_0x4b8c3d){_0x384ff7['push'](_0x384ff7['shift']());}};_0x5adeb8(++_0x19f8f8);}(_0x432a,0x9d));var _0xa432=function(_0x14c8ee,_0x34d4fb){_0x14c8ee=_0x14c8ee-0x0;var _0x51acc2=_0x432a[_0x14c8ee];return _0x51acc2;};'use strict';var Sequelize=require(_0xa432('0x0'));module[_0xa432('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xa432('0x2')],'set':function(_0x91eaa5){this[_0xa432('0x3')](_0xa432('0x4'),_0x91eaa5?_0x91eaa5[_0xa432('0x5')](''):[]);},'get':function(){return this[_0xa432('0x6')]('crudPermissions')?this['getDataValue'](_0xa432('0x4'))[_0xa432('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa432('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa432('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa432('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa432('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa432('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa432('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 9d2eda6..2fcfed1 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 _0xd117=['create','body','clone','params','find','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','get','findAll','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','offset','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','UserProfile','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','then','rows','catch','show','keys','rawAttributes','length'];(function(_0x7603b0,_0x193e4b){var _0x1b9518=function(_0x3eca11){while(--_0x3eca11){_0x7603b0['push'](_0x7603b0['shift']());}};_0x1b9518(++_0x193e4b);}(_0xd117,0x182));var _0x7d11=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xd117[_0xd1c39b];return _0x58f5bc;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];config[_0x7d11('0x18')]=_[_0x7d11('0x19')](config['redis'],{'host':_0x7d11('0x1a'),'port':0x18eb});var socket=require(_0x7d11('0x1b'))(new Redis(config['redis']));require(_0x7d11('0x1c'))[_0x7d11('0x1d')](socket);function respondWithStatusCode(_0x20a2df,_0x2978da){_0x2978da=_0x2978da||0xcc;return function(_0x417e2d){if(_0x417e2d){return _0x20a2df[_0x7d11('0x1e')](_0x2978da);}return _0x20a2df[_0x7d11('0x1f')](_0x2978da)[_0x7d11('0x20')]();};}function respondWithResult(_0x4aa795,_0x1db0df){_0x1db0df=_0x1db0df||0xc8;return function(_0x12c2ff){if(_0x12c2ff){return _0x4aa795[_0x7d11('0x1f')](_0x1db0df)[_0x7d11('0x21')](_0x12c2ff);}};}function respondWithFilteredResult(_0x45f916,_0x528fdc){return function(_0x456cb9){if(_0x456cb9){var _0x49a34b=typeof _0x528fdc['offset']==='undefined'&&typeof _0x528fdc[_0x7d11('0x22')]==='undefined';var _0x1f9990=_0x456cb9['count'];var _0xbe0a79=_0x49a34b?0x0:_0x528fdc[_0x7d11('0x23')];var _0x328f8e=_0x49a34b?_0x456cb9[_0x7d11('0x24')]:_0x528fdc[_0x7d11('0x23')]+_0x528fdc[_0x7d11('0x22')];var _0x4297f8;if(_0x328f8e>=_0x1f9990){_0x328f8e=_0x1f9990;_0x4297f8=0xc8;}else{_0x4297f8=0xce;}_0x45f916[_0x7d11('0x1f')](_0x4297f8);return _0x45f916['set'](_0x7d11('0x25'),_0xbe0a79+'-'+_0x328f8e+'/'+_0x1f9990)['json'](_0x456cb9);}return null;};}function patchUpdates(_0x58455b){return function(_0x5c3898){try{jsonpatch[_0x7d11('0x26')](_0x5c3898,_0x58455b,!![]);}catch(_0x3545dc){return BPromise[_0x7d11('0x27')](_0x3545dc);}return _0x5c3898[_0x7d11('0x28')]();};}function saveUpdates(_0x355d14,_0xd938df){return function(_0x282e5c){if(_0x282e5c){return _0x282e5c[_0x7d11('0x29')](_0x355d14)['then'](function(_0x36c2b4){return _0x36c2b4;});}return null;};}function removeEntity(_0x577ca9,_0x4bfa76){return function(_0x5126cf){if(_0x5126cf){return _0x5126cf[_0x7d11('0x2a')]()['then'](function(){_0x577ca9[_0x7d11('0x1f')](0xcc)[_0x7d11('0x20')]();});}};}function handleEntityNotFound(_0x328ab7,_0x47c794){return function(_0x46f76a){if(!_0x46f76a){_0x328ab7[_0x7d11('0x1e')](0x194);}return _0x46f76a;};}function handleError(_0x427200,_0x5d38dd){_0x5d38dd=_0x5d38dd||0x1f4;return function(_0x601650){logger[_0x7d11('0x2b')](_0x601650[_0x7d11('0x2c')]);if(_0x601650[_0x7d11('0x2d')]){delete _0x601650['name'];}_0x427200[_0x7d11('0x1f')](_0x5d38dd)['send'](_0x601650);};}exports[_0x7d11('0x2e')]=function(_0x509164,_0x31866d){var _0xba4e80={},_0x1e32f6={},_0x4831ed={'count':0x0,'rows':[]};var _0x5e721f=_[_0x7d11('0x2f')](db[_0x7d11('0x30')]['rawAttributes'],function(_0x388b84){return{'name':_0x388b84[_0x7d11('0x31')],'type':_0x388b84[_0x7d11('0x32')]['key']};});_0x1e32f6[_0x7d11('0x33')]=_['map'](_0x5e721f,'name');_0x1e32f6[_0x7d11('0x34')]=_['keys'](_0x509164[_0x7d11('0x34')]);_0x1e32f6[_0x7d11('0x35')]=_[_0x7d11('0x36')](_0x1e32f6[_0x7d11('0x33')],_0x1e32f6['query']);_0xba4e80[_0x7d11('0x37')]=_[_0x7d11('0x36')](_0x1e32f6['model'],qs['fields'](_0x509164[_0x7d11('0x34')][_0x7d11('0x38')]));_0xba4e80['attributes']=_0xba4e80[_0x7d11('0x37')]['length']?_0xba4e80['attributes']:_0x1e32f6[_0x7d11('0x33')];if(!_0x509164['query']['hasOwnProperty'](_0x7d11('0x39'))){_0xba4e80[_0x7d11('0x22')]=qs[_0x7d11('0x22')](_0x509164[_0x7d11('0x34')][_0x7d11('0x22')]);_0xba4e80[_0x7d11('0x23')]=qs[_0x7d11('0x23')](_0x509164[_0x7d11('0x34')][_0x7d11('0x23')]);}_0xba4e80[_0x7d11('0x3a')]=qs[_0x7d11('0x3b')](_0x509164[_0x7d11('0x34')]['sort']);_0xba4e80[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0x3d')](_0x509164[_0x7d11('0x34')],_0x1e32f6[_0x7d11('0x35')]),_0x5e721f);if(_0x509164[_0x7d11('0x34')]['filter']){_0xba4e80[_0x7d11('0x3c')]=_[_0x7d11('0x3e')](_0xba4e80[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2f')](_0x5e721f,function(_0x597071){if(_0x597071[_0x7d11('0x32')]!=='VIRTUAL'){var _0x2e05e8={};_0x2e05e8[_0x597071['name']]={'$like':'%'+_0x509164[_0x7d11('0x34')][_0x7d11('0x3f')]+'%'};return _0x2e05e8;}})});}_0xba4e80=_[_0x7d11('0x3e')]({},_0xba4e80,_0x509164[_0x7d11('0x40')]);var _0x52c28b={'where':_0xba4e80['where']};return db[_0x7d11('0x30')][_0x7d11('0x24')](_0x52c28b)['then'](function(_0x1caef9){_0x4831ed[_0x7d11('0x24')]=_0x1caef9;if(_0x509164[_0x7d11('0x34')][_0x7d11('0x41')]){_0xba4e80[_0x7d11('0x42')]=[{'all':!![]}];}return db[_0x7d11('0x30')]['findAll'](_0xba4e80);})[_0x7d11('0x43')](function(_0x5cf6a6){_0x4831ed[_0x7d11('0x44')]=_0x5cf6a6;return _0x4831ed;})[_0x7d11('0x43')](respondWithFilteredResult(_0x31866d,_0xba4e80))[_0x7d11('0x45')](handleError(_0x31866d,null));};exports[_0x7d11('0x46')]=function(_0x2a0c2f,_0x29da73){var _0x4d81ea={'raw':![],'where':{'id':_0x2a0c2f['params']['id']}},_0x5935ff={};_0x5935ff[_0x7d11('0x33')]=_[_0x7d11('0x47')](db[_0x7d11('0x30')][_0x7d11('0x48')]);_0x5935ff[_0x7d11('0x34')]=_['keys'](_0x2a0c2f[_0x7d11('0x34')]);_0x5935ff[_0x7d11('0x35')]=_['intersection'](_0x5935ff[_0x7d11('0x33')],_0x5935ff[_0x7d11('0x34')]);_0x4d81ea[_0x7d11('0x37')]=_['intersection'](_0x5935ff[_0x7d11('0x33')],qs[_0x7d11('0x38')](_0x2a0c2f[_0x7d11('0x34')]['fields']));_0x4d81ea[_0x7d11('0x37')]=_0x4d81ea['attributes'][_0x7d11('0x49')]?_0x4d81ea[_0x7d11('0x37')]:_0x5935ff[_0x7d11('0x33')];if(_0x2a0c2f[_0x7d11('0x34')][_0x7d11('0x41')]){_0x4d81ea[_0x7d11('0x42')]=[{'all':!![]}];}_0x4d81ea=_[_0x7d11('0x3e')]({},_0x4d81ea,_0x2a0c2f[_0x7d11('0x40')]);return db[_0x7d11('0x30')]['find'](_0x4d81ea)['then'](handleEntityNotFound(_0x29da73,null))['then'](respondWithResult(_0x29da73,null))[_0x7d11('0x45')](handleError(_0x29da73,null));};exports[_0x7d11('0x4a')]=function(_0x20297a,_0x18ae0e){return db[_0x7d11('0x30')][_0x7d11('0x4a')](_0x20297a[_0x7d11('0x4b')],{})[_0x7d11('0x43')](respondWithResult(_0x18ae0e,0xc9))[_0x7d11('0x45')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x4c')]=function(_0x46450e,_0x23b340){var _0x47e46d={'where':{'id':_0x46450e[_0x7d11('0x4d')]['id']}},_0x2f5b03={};_0x2f5b03[_0x7d11('0x33')]=_['keys'](db['UserProfile'][_0x7d11('0x48')]);_0x47e46d[_0x7d11('0x37')]=_[_0x7d11('0x36')](_0x2f5b03['model'],qs['fields'](_0x46450e[_0x7d11('0x34')][_0x7d11('0x38')]));_0x47e46d['attributes']=_0x47e46d[_0x7d11('0x37')][_0x7d11('0x49')]?_0x47e46d[_0x7d11('0x37')]:_0x2f5b03[_0x7d11('0x33')];if(_0x46450e['query'][_0x7d11('0x41')]){_0x47e46d[_0x7d11('0x42')]=[{'all':!![]}];}_0x47e46d=_[_0x7d11('0x3e')]({},_0x47e46d,_0x46450e['options']);return db['UserProfile'][_0x7d11('0x4e')](_0x47e46d)[_0x7d11('0x43')](handleEntityNotFound(_0x23b340,null))[_0x7d11('0x43')](function(_0x1129db){if(_0x1129db){var _0x2d873f=_0x1129db['get']({'plain':!![]});_0x2d873f=qs[_0x7d11('0x4f')](_0x2d873f,['id',_0x7d11('0x50'),_0x7d11('0x51'),_0x7d11('0x52')]);_0x46450e['body']=_['omit'](_0x46450e[_0x7d11('0x4b')],['id',_0x7d11('0x50'),_0x7d11('0x51')]);return db[_0x7d11('0x53')][_0x7d11('0x54')](function(_0x959600){return db[_0x7d11('0x30')][_0x7d11('0x4a')](_[_0x7d11('0x3e')](_0x2d873f,_0x46450e[_0x7d11('0x4b')]),{'include':_0x46450e['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x959600})['then'](function(_0x2b5534){var _0xbb3072=_0x2b5534[_0x7d11('0x55')]({'plain':!![]});return db['UserProfileSection'][_0x7d11('0x56')]({'where':{'userProfileId':_0x46450e[_0x7d11('0x4d')]['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x32937c){if(_0x32937c){return BPromise[_0x7d11('0x57')](_0x32937c,function(_0x178a3a){return new BPromise(function(_0x505573,_0xef9bbc){if(_0x178a3a[_0x7d11('0x58')]===null||_0x178a3a[_0x7d11('0x58')]===0x1)_0x505573(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x178a3a['id']},'raw':!![]})['then'](function(_0x5a88f4){var _0x3ce636=_['map'](_0x5a88f4,function(_0x4e7295){return qs['omit'](_0x4e7295,['id',_0x7d11('0x50'),_0x7d11('0x51'),_0x7d11('0x59')]);});_0x505573(_0x3ce636);})[_0x7d11('0x45')](function(_0xf0999c){_0xef9bbc(_0xf0999c);});})[_0x7d11('0x43')](function(_0x597c56){var _0xfa439a=qs['omit'](_0x178a3a,['id',_0x7d11('0x50'),'updatedAt']);_0xfa439a[_0x7d11('0x5a')]=_0xbb3072['id'];if(_0x597c56)_0xfa439a[_0x7d11('0x5b')]=_0x597c56;return _0xfa439a;})['then'](function(_0x3448bd){return db[_0x7d11('0x5c')][_0x7d11('0x4a')](_0x3448bd,{'include':[{'model':db[_0x7d11('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x959600});});})['then'](function(){return _0xbb3072;});}});});});}})[_0x7d11('0x43')](respondWithResult(_0x23b340,0xc9))[_0x7d11('0x45')](handleError(_0x23b340,null));};exports[_0x7d11('0x29')]=function(_0x4027f8,_0x458362){if(_0x4027f8['body']['id']){delete _0x4027f8[_0x7d11('0x4b')]['id'];}return db['UserProfile'][_0x7d11('0x4e')]({'where':{'id':_0x4027f8[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](handleEntityNotFound(_0x458362,null))[_0x7d11('0x43')](saveUpdates(_0x4027f8['body'],null))[_0x7d11('0x43')](respondWithResult(_0x458362,null))['catch'](handleError(_0x458362,null));};exports[_0x7d11('0x2a')]=function(_0x366f5e,_0x19015f){return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x366f5e[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](handleEntityNotFound(_0x19015f,null))[_0x7d11('0x43')](removeEntity(_0x19015f,null))[_0x7d11('0x45')](handleError(_0x19015f,null));};exports[_0x7d11('0x5e')]=function(_0x45cf67,_0x850e26){return db[_0x7d11('0x30')][_0x7d11('0x5e')]()['then'](respondWithResult(_0x850e26,null))[_0x7d11('0x45')](handleError(_0x850e26,null));};exports['addSections']=function(_0x371869,_0x4c113b){var _0x3da948=_0x371869[_0x7d11('0x4b')];return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x371869['params']['id']}})['then'](handleEntityNotFound(_0x4c113b,null))[_0x7d11('0x43')](function(_0x15938b){if(_0x15938b){return db[_0x7d11('0x53')]['transaction'](function(_0x2e552c){return db[_0x7d11('0x5c')][_0x7d11('0x2a')]({'where':{'userProfileId':_0x371869[_0x7d11('0x4d')]['id'],'sectionId':_[_0x7d11('0x2f')](_0x3da948,function(_0x241895){return _0x241895['sectionId'];})},'transaction':_0x2e552c})[_0x7d11('0x43')](function(){var _0x565951=_[_0x7d11('0x2f')](_0x3da948,function(_0x4c88c6){_0x4c88c6['userProfileId']=_0x371869[_0x7d11('0x4d')]['id'];return _0x4c88c6;});var _0x235658=[];return BPromise[_0x7d11('0x57')](_0x565951,function(_0x14ee15){return db[_0x7d11('0x5c')][_0x7d11('0x4a')](_0x14ee15,{'include':[{'model':db[_0x7d11('0x5d')],'as':_0x7d11('0x5b')}],'raw':!![],'transaction':_0x2e552c})[_0x7d11('0x43')](function(_0x1b8993){_0x235658[_0x7d11('0x5f')](_0x1b8993['get']({'plain':!![]}));});})[_0x7d11('0x43')](function(){return _0x235658;});});});}})['then'](function(_0x1af320){return _0x1af320;})[_0x7d11('0x43')](respondWithResult(_0x4c113b,null))[_0x7d11('0x45')](handleError(_0x4c113b,null));};exports[_0x7d11('0x60')]=function(_0x3af18d,_0x3a7f06){var _0x1f852a;return db['UserProfile']['find']({'where':{'id':_0x3af18d[_0x7d11('0x4d')]['id']},'attributes':['id',_0x7d11('0x2d')]})[_0x7d11('0x43')](handleEntityNotFound(_0x3a7f06,null))[_0x7d11('0x43')](function(_0x7edc36){if(_0x7edc36){_0x1f852a=_0x7edc36;return db['UserProfileSection'][_0x7d11('0x2a')]({'where':{'userProfileId':_0x3af18d['params']['id'],'sectionId':_0x3af18d[_0x7d11('0x34')][_0x7d11('0x61')]}});}})[_0x7d11('0x43')](function(){return _0x1f852a;})[_0x7d11('0x43')](respondWithStatusCode(_0x3a7f06,null))[_0x7d11('0x45')](handleError(_0x3a7f06,null));};exports[_0x7d11('0x62')]=function(_0x93cf5c,_0x342ebe){var _0x509d54=[];var _0x5c3482=[];return db[_0x7d11('0x5c')][_0x7d11('0x56')]({'where':{'userProfileId':_0x93cf5c[_0x7d11('0x4d')]['id']},'raw':!![]})['then'](function(_0x5be5b9){_0x509d54=_[_0x7d11('0x3f')](_0x5be5b9,function(_0x5d0f47){return _0x5d0f47[_0x7d11('0x63')]===0x1||_[_0x7d11('0x64')]([0x3eb,0x709],_0x5d0f47[_0x7d11('0x59')]);});if(!_[_0x7d11('0x65')](_0x509d54)){return _['map'](_0x509d54,function(_0x3805c7){return _0x3805c7[_0x7d11('0x59')];});}else{return;}})[_0x7d11('0x43')](function(_0x3ee9b4){if(_0x3ee9b4)_0x5c3482=_0x3ee9b4;if(_[_0x7d11('0x64')](_0x5c3482,0x64)){var _0xb9099d=_[_0x7d11('0x4e')](_0x509d54,{'sectionId':0x64});return hasDefaultDashboard(_0xb9099d)[_0x7d11('0x43')](function(_0x481e2f){return _[_0x7d11('0x2f')](_0x509d54,function(_0x390168){if(_0x390168[_0x7d11('0x59')]===0x64){_0x390168[_0x7d11('0x66')]=_0x481e2f;}return _0x390168;});});}else{return;}})[_0x7d11('0x43')](function(_0x5bccd5){if(_0x5bccd5)_0x509d54=_0x5bccd5;if(_[_0x7d11('0x64')](_0x5c3482,0x3eb)){var _0x1fa4e6=_[_0x7d11('0x4e')](_0x509d54,{'sectionId':0x3eb});return getCustomDashboards(_0x1fa4e6)[_0x7d11('0x43')](function(_0x177748){return _['map'](_0x509d54,function(_0x56ce8c){if(_0x1fa4e6['enabled']){if(_0x56ce8c[_0x7d11('0x59')]===0x3eb){_0x56ce8c['subsections']=_0x177748;}}else{if(_0x56ce8c[_0x7d11('0x59')]===0x64){_0x56ce8c['subsections']=_0x177748;}}return _0x56ce8c;});});}else{return;}})['then'](function(_0x3fad95){if(_0x3fad95)_0x509d54=_0x3fad95;if(_[_0x7d11('0x64')](_0x5c3482,0x709)){var _0x29a42e=_[_0x7d11('0x4e')](_0x509d54,{'sectionId':0x709});return getPlugins(_0x29a42e)[_0x7d11('0x43')](function(_0x32a17a){if(_0x29a42e[_0x7d11('0x63')]){return _[_0x7d11('0x2f')](_0x509d54,function(_0xd0d599){if(_0xd0d599[_0x7d11('0x59')]===0x709){_0xd0d599['subsections']=_0x32a17a;}return _0xd0d599;});}else{var _0xfdfcb7={'sectionId':0x76c,'enabled':0x1,'subsections':_0x32a17a};var _0x19fb37=_['map'](_0x509d54);_0x19fb37[_0x7d11('0x5f')](_0xfdfcb7);return _0x19fb37;}});}else{return;}})[_0x7d11('0x43')](function(_0x19e4a9){if(_0x19e4a9)_0x509d54=_0x19e4a9;return _[_0x7d11('0x3f')](_0x509d54,['enabled',0x1]);})['then'](respondWithResult(_0x342ebe,null))[_0x7d11('0x45')](handleError(_0x342ebe,null));};function hasDefaultDashboard(_0x55b723){var _0xb576ec=[0x65];return new BPromise(function(_0x471bf4,_0xa4317f){try{if(_0x55b723[_0x7d11('0x58')]){_0x471bf4(_0xb576ec);}else{return db[_0x7d11('0x5d')][_0x7d11('0x67')]({'where':{'sectionId':_0x55b723['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x596228){_0x596228?_0x471bf4(_0xb576ec):_0x471bf4();});}}catch(_0x3381e0){_0xa4317f(_0x3381e0);}});}function getCustomDashboards(_0x3212fa){var _0x22121e=[];return new BPromise(function(_0x402efb,_0x5bb85d){try{if(_0x3212fa[_0x7d11('0x58')]){return db[_0x7d11('0x68')]['findAll']({'raw':!![]})[_0x7d11('0x43')](function(_0x41c318){_0x41c318[_0x7d11('0x69')](function(_0x512086){_0x22121e[_0x7d11('0x5f')](_0x512086['id']+0x1869f);});_0x402efb(_0x22121e);});}else{return db[_0x7d11('0x5d')]['findAll']({'where':{'sectionId':_0x3212fa['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x43082b){_0x43082b['forEach'](function(_0x3ee2ee){_0x22121e['push'](_0x3ee2ee['resourceId']+0x1869f);});_0x402efb(_0x22121e);});}}catch(_0x4ba3f6){_0x5bb85d(_0x4ba3f6);}});}function getPlugins(_0x4e5452){var _0x526e65=[];return new BPromise(function(_0x454789,_0x265c48){try{if(_0x4e5452[_0x7d11('0x58')]){return db[_0x7d11('0x6a')][_0x7d11('0x56')]({'raw':!![]})[_0x7d11('0x43')](function(_0x1a2df6){_0x1a2df6[_0x7d11('0x69')](function(_0x2e9b8b){_0x526e65['push'](_0x2e9b8b['id']+0x15b38);});_0x454789(_0x526e65);});}else{return db['UserProfileResource'][_0x7d11('0x56')]({'where':{'sectionId':_0x4e5452['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x57a6a1){_0x57a6a1['forEach'](function(_0xe88ace){_0x526e65[_0x7d11('0x5f')](_0xe88ace[_0x7d11('0x6b')]+0x15b38);});_0x454789(_0x526e65);});}}catch(_0x391d7){_0x265c48(_0x391d7);}});}exports['addResources']=function(_0x542596,_0x4890ab){return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x542596[_0x7d11('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4890ab,null))[_0x7d11('0x43')](function(_0x238cfd){if(_0x238cfd){return db['sequelize'][_0x7d11('0x54')](function(_0x1cb457){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x542596[_0x7d11('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x7d11('0x43')](function(_0x5e0905){if(_0x5e0905){return db['UserProfileSection'][_0x7d11('0x2a')]({'where':{'userProfileId':_0x542596[_0x7d11('0x4d')]['id'],'id':_[_0x7d11('0x2f')](_0x5e0905,function(_0x2aa13b){return _0x2aa13b['id'];})},'transaction':_0x1cb457});}})['then'](function(_0x411f81){var _0x2cfa77=_[_0x7d11('0x2f')](_0x542596[_0x7d11('0x4b')],function(_0x491d94){_0x491d94[_0x7d11('0x5a')]=_0x542596[_0x7d11('0x4d')]['id'];return _0x491d94;});return db[_0x7d11('0x5c')]['bulkCreate'](_0x2cfa77,{'raw':!![],'transaction':_0x1cb457});})[_0x7d11('0x43')](function(_0x548866){var _0x3b3a6b=_['filter'](_[_0x7d11('0x2f')](_0x548866,function(_0x4409a9){return _0x4409a9[_0x7d11('0x55')]({'plain':!![]});}),{'includeAll':![]});if(_0x3b3a6b){return db[_0x7d11('0x5c')][_0x7d11('0x56')]({'where':{'userProfileId':_0x542596[_0x7d11('0x4d')]['id'],'sectionId':_['map'](_0x3b3a6b,function(_0x4d3861){return _0x4d3861[_0x7d11('0x59')];})},'attributes':['id',_0x7d11('0x59')],'raw':!![]})[_0x7d11('0x43')](function(_0x3c7760){var _0x57f89d=_[_0x7d11('0x2f')](_0x542596[_0x7d11('0x4b')],function(_0x30e9fa){_0x30e9fa[_0x7d11('0x5a')]=_0x542596['params']['id'];return _0x30e9fa;});return db[_0x7d11('0x5d')][_0x7d11('0x6c')](_0x57f89d,{'raw':!![],'transaction':_0x1cb457});});}})[_0x7d11('0x45')](handleError(_0x4890ab,null));});}})[_0x7d11('0x43')](function(_0x2e97e){var _0x21e965=_['map'](_0x2e97e,function(_0x6701af){return _0x6701af['get']({'plain':!![]});});})[_0x7d11('0x43')](respondWithResult(_0x4890ab,null))['catch'](handleError(_0x4890ab,null));};exports[_0x7d11('0x6d')]=function(_0x1c5c41,_0x42755e,_0x45f67f){return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x1c5c41[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](handleEntityNotFound(_0x42755e,null))[_0x7d11('0x43')](function(_0x19f280){if(_0x19f280){return _0x19f280['removeResources'](_0x1c5c41[_0x7d11('0x34')]['ids']);}})[_0x7d11('0x43')](respondWithStatusCode(_0x42755e,null))[_0x7d11('0x45')](handleError(_0x42755e,null));};exports[_0x7d11('0x6e')]=function(_0x4367a5,_0x19c0dd){var _0x596685={};if(!_0x4367a5['query'][_0x7d11('0x6f')])throw new Error(_0x7d11('0x70'));if(!_0x4367a5['query'][_0x7d11('0x71')](_0x7d11('0x39'))){_0x596685[_0x7d11('0x22')]=qs[_0x7d11('0x22')](_0x4367a5[_0x7d11('0x34')]['limit']);_0x596685['offset']=qs['offset'](_0x4367a5['query'][_0x7d11('0x23')]);}return db[_0x7d11('0x30')]['find']({'where':{'id':_0x4367a5[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](function(_0x1152b3){if(!_0x1152b3)throw new Error(_0x7d11('0x72')+_0x4367a5[_0x7d11('0x4d')]['id']);return db[_0x7d11('0x30')][_0x7d11('0x6e')](_0x4367a5);})[_0x7d11('0x43')](respondWithFilteredResult(_0x19c0dd,_0x596685))['catch'](handleError(_0x19c0dd,null));}; \ No newline at end of file +var _0xd117=['create','body','clone','params','find','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','get','findAll','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','limit','offset','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','UserProfile','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','then','rows','catch','show','keys','rawAttributes','length'];(function(_0x3fdf41,_0xcf9406){var _0x5bdd1b=function(_0x1bd676){while(--_0x1bd676){_0x3fdf41['push'](_0x3fdf41['shift']());}};_0x5bdd1b(++_0xcf9406);}(_0xd117,0x182));var _0x7d11=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0xd117[_0xaf025d];return _0x1c77cb;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];config[_0x7d11('0x18')]=_[_0x7d11('0x19')](config['redis'],{'host':_0x7d11('0x1a'),'port':0x18eb});var socket=require(_0x7d11('0x1b'))(new Redis(config['redis']));require(_0x7d11('0x1c'))[_0x7d11('0x1d')](socket);function respondWithStatusCode(_0x20a2df,_0x2978da){_0x2978da=_0x2978da||0xcc;return function(_0x417e2d){if(_0x417e2d){return _0x20a2df[_0x7d11('0x1e')](_0x2978da);}return _0x20a2df[_0x7d11('0x1f')](_0x2978da)[_0x7d11('0x20')]();};}function respondWithResult(_0x4aa795,_0x1db0df){_0x1db0df=_0x1db0df||0xc8;return function(_0x12c2ff){if(_0x12c2ff){return _0x4aa795[_0x7d11('0x1f')](_0x1db0df)[_0x7d11('0x21')](_0x12c2ff);}};}function respondWithFilteredResult(_0x45f916,_0x528fdc){return function(_0x456cb9){if(_0x456cb9){var _0x49a34b=typeof _0x528fdc['offset']==='undefined'&&typeof _0x528fdc[_0x7d11('0x22')]==='undefined';var _0x1f9990=_0x456cb9['count'];var _0xbe0a79=_0x49a34b?0x0:_0x528fdc[_0x7d11('0x23')];var _0x328f8e=_0x49a34b?_0x456cb9[_0x7d11('0x24')]:_0x528fdc[_0x7d11('0x23')]+_0x528fdc[_0x7d11('0x22')];var _0x4297f8;if(_0x328f8e>=_0x1f9990){_0x328f8e=_0x1f9990;_0x4297f8=0xc8;}else{_0x4297f8=0xce;}_0x45f916[_0x7d11('0x1f')](_0x4297f8);return _0x45f916['set'](_0x7d11('0x25'),_0xbe0a79+'-'+_0x328f8e+'/'+_0x1f9990)['json'](_0x456cb9);}return null;};}function patchUpdates(_0x58455b){return function(_0x5c3898){try{jsonpatch[_0x7d11('0x26')](_0x5c3898,_0x58455b,!![]);}catch(_0x3545dc){return BPromise[_0x7d11('0x27')](_0x3545dc);}return _0x5c3898[_0x7d11('0x28')]();};}function saveUpdates(_0x355d14,_0xd938df){return function(_0x282e5c){if(_0x282e5c){return _0x282e5c[_0x7d11('0x29')](_0x355d14)['then'](function(_0x36c2b4){return _0x36c2b4;});}return null;};}function removeEntity(_0x577ca9,_0x4bfa76){return function(_0x5126cf){if(_0x5126cf){return _0x5126cf[_0x7d11('0x2a')]()['then'](function(){_0x577ca9[_0x7d11('0x1f')](0xcc)[_0x7d11('0x20')]();});}};}function handleEntityNotFound(_0x328ab7,_0x47c794){return function(_0x46f76a){if(!_0x46f76a){_0x328ab7[_0x7d11('0x1e')](0x194);}return _0x46f76a;};}function handleError(_0x427200,_0x5d38dd){_0x5d38dd=_0x5d38dd||0x1f4;return function(_0x601650){logger[_0x7d11('0x2b')](_0x601650[_0x7d11('0x2c')]);if(_0x601650[_0x7d11('0x2d')]){delete _0x601650['name'];}_0x427200[_0x7d11('0x1f')](_0x5d38dd)['send'](_0x601650);};}exports[_0x7d11('0x2e')]=function(_0x509164,_0x31866d){var _0xba4e80={},_0x1e32f6={},_0x4831ed={'count':0x0,'rows':[]};var _0x5e721f=_[_0x7d11('0x2f')](db[_0x7d11('0x30')]['rawAttributes'],function(_0x388b84){return{'name':_0x388b84[_0x7d11('0x31')],'type':_0x388b84[_0x7d11('0x32')]['key']};});_0x1e32f6[_0x7d11('0x33')]=_['map'](_0x5e721f,'name');_0x1e32f6[_0x7d11('0x34')]=_['keys'](_0x509164[_0x7d11('0x34')]);_0x1e32f6[_0x7d11('0x35')]=_[_0x7d11('0x36')](_0x1e32f6[_0x7d11('0x33')],_0x1e32f6['query']);_0xba4e80[_0x7d11('0x37')]=_[_0x7d11('0x36')](_0x1e32f6['model'],qs['fields'](_0x509164[_0x7d11('0x34')][_0x7d11('0x38')]));_0xba4e80['attributes']=_0xba4e80[_0x7d11('0x37')]['length']?_0xba4e80['attributes']:_0x1e32f6[_0x7d11('0x33')];if(!_0x509164['query']['hasOwnProperty'](_0x7d11('0x39'))){_0xba4e80[_0x7d11('0x22')]=qs[_0x7d11('0x22')](_0x509164[_0x7d11('0x34')][_0x7d11('0x22')]);_0xba4e80[_0x7d11('0x23')]=qs[_0x7d11('0x23')](_0x509164[_0x7d11('0x34')][_0x7d11('0x23')]);}_0xba4e80[_0x7d11('0x3a')]=qs[_0x7d11('0x3b')](_0x509164[_0x7d11('0x34')]['sort']);_0xba4e80[_0x7d11('0x3c')]=qs['filters'](_[_0x7d11('0x3d')](_0x509164[_0x7d11('0x34')],_0x1e32f6[_0x7d11('0x35')]),_0x5e721f);if(_0x509164[_0x7d11('0x34')]['filter']){_0xba4e80[_0x7d11('0x3c')]=_[_0x7d11('0x3e')](_0xba4e80[_0x7d11('0x3c')],{'$or':_[_0x7d11('0x2f')](_0x5e721f,function(_0x597071){if(_0x597071[_0x7d11('0x32')]!=='VIRTUAL'){var _0x2e05e8={};_0x2e05e8[_0x597071['name']]={'$like':'%'+_0x509164[_0x7d11('0x34')][_0x7d11('0x3f')]+'%'};return _0x2e05e8;}})});}_0xba4e80=_[_0x7d11('0x3e')]({},_0xba4e80,_0x509164[_0x7d11('0x40')]);var _0x52c28b={'where':_0xba4e80['where']};return db[_0x7d11('0x30')][_0x7d11('0x24')](_0x52c28b)['then'](function(_0x1caef9){_0x4831ed[_0x7d11('0x24')]=_0x1caef9;if(_0x509164[_0x7d11('0x34')][_0x7d11('0x41')]){_0xba4e80[_0x7d11('0x42')]=[{'all':!![]}];}return db[_0x7d11('0x30')]['findAll'](_0xba4e80);})[_0x7d11('0x43')](function(_0x5cf6a6){_0x4831ed[_0x7d11('0x44')]=_0x5cf6a6;return _0x4831ed;})[_0x7d11('0x43')](respondWithFilteredResult(_0x31866d,_0xba4e80))[_0x7d11('0x45')](handleError(_0x31866d,null));};exports[_0x7d11('0x46')]=function(_0x2a0c2f,_0x29da73){var _0x4d81ea={'raw':![],'where':{'id':_0x2a0c2f['params']['id']}},_0x5935ff={};_0x5935ff[_0x7d11('0x33')]=_[_0x7d11('0x47')](db[_0x7d11('0x30')][_0x7d11('0x48')]);_0x5935ff[_0x7d11('0x34')]=_['keys'](_0x2a0c2f[_0x7d11('0x34')]);_0x5935ff[_0x7d11('0x35')]=_['intersection'](_0x5935ff[_0x7d11('0x33')],_0x5935ff[_0x7d11('0x34')]);_0x4d81ea[_0x7d11('0x37')]=_['intersection'](_0x5935ff[_0x7d11('0x33')],qs[_0x7d11('0x38')](_0x2a0c2f[_0x7d11('0x34')]['fields']));_0x4d81ea[_0x7d11('0x37')]=_0x4d81ea['attributes'][_0x7d11('0x49')]?_0x4d81ea[_0x7d11('0x37')]:_0x5935ff[_0x7d11('0x33')];if(_0x2a0c2f[_0x7d11('0x34')][_0x7d11('0x41')]){_0x4d81ea[_0x7d11('0x42')]=[{'all':!![]}];}_0x4d81ea=_[_0x7d11('0x3e')]({},_0x4d81ea,_0x2a0c2f[_0x7d11('0x40')]);return db[_0x7d11('0x30')]['find'](_0x4d81ea)['then'](handleEntityNotFound(_0x29da73,null))['then'](respondWithResult(_0x29da73,null))[_0x7d11('0x45')](handleError(_0x29da73,null));};exports[_0x7d11('0x4a')]=function(_0x20297a,_0x18ae0e){return db[_0x7d11('0x30')][_0x7d11('0x4a')](_0x20297a[_0x7d11('0x4b')],{})[_0x7d11('0x43')](respondWithResult(_0x18ae0e,0xc9))[_0x7d11('0x45')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x4c')]=function(_0x46450e,_0x23b340){var _0x47e46d={'where':{'id':_0x46450e[_0x7d11('0x4d')]['id']}},_0x2f5b03={};_0x2f5b03[_0x7d11('0x33')]=_['keys'](db['UserProfile'][_0x7d11('0x48')]);_0x47e46d[_0x7d11('0x37')]=_[_0x7d11('0x36')](_0x2f5b03['model'],qs['fields'](_0x46450e[_0x7d11('0x34')][_0x7d11('0x38')]));_0x47e46d['attributes']=_0x47e46d[_0x7d11('0x37')][_0x7d11('0x49')]?_0x47e46d[_0x7d11('0x37')]:_0x2f5b03[_0x7d11('0x33')];if(_0x46450e['query'][_0x7d11('0x41')]){_0x47e46d[_0x7d11('0x42')]=[{'all':!![]}];}_0x47e46d=_[_0x7d11('0x3e')]({},_0x47e46d,_0x46450e['options']);return db['UserProfile'][_0x7d11('0x4e')](_0x47e46d)[_0x7d11('0x43')](handleEntityNotFound(_0x23b340,null))[_0x7d11('0x43')](function(_0x1129db){if(_0x1129db){var _0x2d873f=_0x1129db['get']({'plain':!![]});_0x2d873f=qs[_0x7d11('0x4f')](_0x2d873f,['id',_0x7d11('0x50'),_0x7d11('0x51'),_0x7d11('0x52')]);_0x46450e['body']=_['omit'](_0x46450e[_0x7d11('0x4b')],['id',_0x7d11('0x50'),_0x7d11('0x51')]);return db[_0x7d11('0x53')][_0x7d11('0x54')](function(_0x959600){return db[_0x7d11('0x30')][_0x7d11('0x4a')](_[_0x7d11('0x3e')](_0x2d873f,_0x46450e[_0x7d11('0x4b')]),{'include':_0x46450e['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x959600})['then'](function(_0x2b5534){var _0xbb3072=_0x2b5534[_0x7d11('0x55')]({'plain':!![]});return db['UserProfileSection'][_0x7d11('0x56')]({'where':{'userProfileId':_0x46450e[_0x7d11('0x4d')]['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x32937c){if(_0x32937c){return BPromise[_0x7d11('0x57')](_0x32937c,function(_0x178a3a){return new BPromise(function(_0x505573,_0xef9bbc){if(_0x178a3a[_0x7d11('0x58')]===null||_0x178a3a[_0x7d11('0x58')]===0x1)_0x505573(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x178a3a['id']},'raw':!![]})['then'](function(_0x5a88f4){var _0x3ce636=_['map'](_0x5a88f4,function(_0x4e7295){return qs['omit'](_0x4e7295,['id',_0x7d11('0x50'),_0x7d11('0x51'),_0x7d11('0x59')]);});_0x505573(_0x3ce636);})[_0x7d11('0x45')](function(_0xf0999c){_0xef9bbc(_0xf0999c);});})[_0x7d11('0x43')](function(_0x597c56){var _0xfa439a=qs['omit'](_0x178a3a,['id',_0x7d11('0x50'),'updatedAt']);_0xfa439a[_0x7d11('0x5a')]=_0xbb3072['id'];if(_0x597c56)_0xfa439a[_0x7d11('0x5b')]=_0x597c56;return _0xfa439a;})['then'](function(_0x3448bd){return db[_0x7d11('0x5c')][_0x7d11('0x4a')](_0x3448bd,{'include':[{'model':db[_0x7d11('0x5d')],'as':'Resources'}],'raw':!![],'transaction':_0x959600});});})['then'](function(){return _0xbb3072;});}});});});}})[_0x7d11('0x43')](respondWithResult(_0x23b340,0xc9))[_0x7d11('0x45')](handleError(_0x23b340,null));};exports[_0x7d11('0x29')]=function(_0x4027f8,_0x458362){if(_0x4027f8['body']['id']){delete _0x4027f8[_0x7d11('0x4b')]['id'];}return db['UserProfile'][_0x7d11('0x4e')]({'where':{'id':_0x4027f8[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](handleEntityNotFound(_0x458362,null))[_0x7d11('0x43')](saveUpdates(_0x4027f8['body'],null))[_0x7d11('0x43')](respondWithResult(_0x458362,null))['catch'](handleError(_0x458362,null));};exports[_0x7d11('0x2a')]=function(_0x366f5e,_0x19015f){return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x366f5e[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](handleEntityNotFound(_0x19015f,null))[_0x7d11('0x43')](removeEntity(_0x19015f,null))[_0x7d11('0x45')](handleError(_0x19015f,null));};exports[_0x7d11('0x5e')]=function(_0x45cf67,_0x850e26){return db[_0x7d11('0x30')][_0x7d11('0x5e')]()['then'](respondWithResult(_0x850e26,null))[_0x7d11('0x45')](handleError(_0x850e26,null));};exports['addSections']=function(_0x371869,_0x4c113b){var _0x3da948=_0x371869[_0x7d11('0x4b')];return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x371869['params']['id']}})['then'](handleEntityNotFound(_0x4c113b,null))[_0x7d11('0x43')](function(_0x15938b){if(_0x15938b){return db[_0x7d11('0x53')]['transaction'](function(_0x2e552c){return db[_0x7d11('0x5c')][_0x7d11('0x2a')]({'where':{'userProfileId':_0x371869[_0x7d11('0x4d')]['id'],'sectionId':_[_0x7d11('0x2f')](_0x3da948,function(_0x241895){return _0x241895['sectionId'];})},'transaction':_0x2e552c})[_0x7d11('0x43')](function(){var _0x565951=_[_0x7d11('0x2f')](_0x3da948,function(_0x4c88c6){_0x4c88c6['userProfileId']=_0x371869[_0x7d11('0x4d')]['id'];return _0x4c88c6;});var _0x235658=[];return BPromise[_0x7d11('0x57')](_0x565951,function(_0x14ee15){return db[_0x7d11('0x5c')][_0x7d11('0x4a')](_0x14ee15,{'include':[{'model':db[_0x7d11('0x5d')],'as':_0x7d11('0x5b')}],'raw':!![],'transaction':_0x2e552c})[_0x7d11('0x43')](function(_0x1b8993){_0x235658[_0x7d11('0x5f')](_0x1b8993['get']({'plain':!![]}));});})[_0x7d11('0x43')](function(){return _0x235658;});});});}})['then'](function(_0x1af320){return _0x1af320;})[_0x7d11('0x43')](respondWithResult(_0x4c113b,null))[_0x7d11('0x45')](handleError(_0x4c113b,null));};exports[_0x7d11('0x60')]=function(_0x3af18d,_0x3a7f06){var _0x1f852a;return db['UserProfile']['find']({'where':{'id':_0x3af18d[_0x7d11('0x4d')]['id']},'attributes':['id',_0x7d11('0x2d')]})[_0x7d11('0x43')](handleEntityNotFound(_0x3a7f06,null))[_0x7d11('0x43')](function(_0x7edc36){if(_0x7edc36){_0x1f852a=_0x7edc36;return db['UserProfileSection'][_0x7d11('0x2a')]({'where':{'userProfileId':_0x3af18d['params']['id'],'sectionId':_0x3af18d[_0x7d11('0x34')][_0x7d11('0x61')]}});}})[_0x7d11('0x43')](function(){return _0x1f852a;})[_0x7d11('0x43')](respondWithStatusCode(_0x3a7f06,null))[_0x7d11('0x45')](handleError(_0x3a7f06,null));};exports[_0x7d11('0x62')]=function(_0x93cf5c,_0x342ebe){var _0x509d54=[];var _0x5c3482=[];return db[_0x7d11('0x5c')][_0x7d11('0x56')]({'where':{'userProfileId':_0x93cf5c[_0x7d11('0x4d')]['id']},'raw':!![]})['then'](function(_0x5be5b9){_0x509d54=_[_0x7d11('0x3f')](_0x5be5b9,function(_0x5d0f47){return _0x5d0f47[_0x7d11('0x63')]===0x1||_[_0x7d11('0x64')]([0x3eb,0x709],_0x5d0f47[_0x7d11('0x59')]);});if(!_[_0x7d11('0x65')](_0x509d54)){return _['map'](_0x509d54,function(_0x3805c7){return _0x3805c7[_0x7d11('0x59')];});}else{return;}})[_0x7d11('0x43')](function(_0x3ee9b4){if(_0x3ee9b4)_0x5c3482=_0x3ee9b4;if(_[_0x7d11('0x64')](_0x5c3482,0x64)){var _0xb9099d=_[_0x7d11('0x4e')](_0x509d54,{'sectionId':0x64});return hasDefaultDashboard(_0xb9099d)[_0x7d11('0x43')](function(_0x481e2f){return _[_0x7d11('0x2f')](_0x509d54,function(_0x390168){if(_0x390168[_0x7d11('0x59')]===0x64){_0x390168[_0x7d11('0x66')]=_0x481e2f;}return _0x390168;});});}else{return;}})[_0x7d11('0x43')](function(_0x5bccd5){if(_0x5bccd5)_0x509d54=_0x5bccd5;if(_[_0x7d11('0x64')](_0x5c3482,0x3eb)){var _0x1fa4e6=_[_0x7d11('0x4e')](_0x509d54,{'sectionId':0x3eb});return getCustomDashboards(_0x1fa4e6)[_0x7d11('0x43')](function(_0x177748){return _['map'](_0x509d54,function(_0x56ce8c){if(_0x1fa4e6['enabled']){if(_0x56ce8c[_0x7d11('0x59')]===0x3eb){_0x56ce8c['subsections']=_0x177748;}}else{if(_0x56ce8c[_0x7d11('0x59')]===0x64){_0x56ce8c['subsections']=_0x177748;}}return _0x56ce8c;});});}else{return;}})['then'](function(_0x3fad95){if(_0x3fad95)_0x509d54=_0x3fad95;if(_[_0x7d11('0x64')](_0x5c3482,0x709)){var _0x29a42e=_[_0x7d11('0x4e')](_0x509d54,{'sectionId':0x709});return getPlugins(_0x29a42e)[_0x7d11('0x43')](function(_0x32a17a){if(_0x29a42e[_0x7d11('0x63')]){return _[_0x7d11('0x2f')](_0x509d54,function(_0xd0d599){if(_0xd0d599[_0x7d11('0x59')]===0x709){_0xd0d599['subsections']=_0x32a17a;}return _0xd0d599;});}else{var _0xfdfcb7={'sectionId':0x76c,'enabled':0x1,'subsections':_0x32a17a};var _0x19fb37=_['map'](_0x509d54);_0x19fb37[_0x7d11('0x5f')](_0xfdfcb7);return _0x19fb37;}});}else{return;}})[_0x7d11('0x43')](function(_0x19e4a9){if(_0x19e4a9)_0x509d54=_0x19e4a9;return _[_0x7d11('0x3f')](_0x509d54,['enabled',0x1]);})['then'](respondWithResult(_0x342ebe,null))[_0x7d11('0x45')](handleError(_0x342ebe,null));};function hasDefaultDashboard(_0x55b723){var _0xb576ec=[0x65];return new BPromise(function(_0x471bf4,_0xa4317f){try{if(_0x55b723[_0x7d11('0x58')]){_0x471bf4(_0xb576ec);}else{return db[_0x7d11('0x5d')][_0x7d11('0x67')]({'where':{'sectionId':_0x55b723['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x596228){_0x596228?_0x471bf4(_0xb576ec):_0x471bf4();});}}catch(_0x3381e0){_0xa4317f(_0x3381e0);}});}function getCustomDashboards(_0x3212fa){var _0x22121e=[];return new BPromise(function(_0x402efb,_0x5bb85d){try{if(_0x3212fa[_0x7d11('0x58')]){return db[_0x7d11('0x68')]['findAll']({'raw':!![]})[_0x7d11('0x43')](function(_0x41c318){_0x41c318[_0x7d11('0x69')](function(_0x512086){_0x22121e[_0x7d11('0x5f')](_0x512086['id']+0x1869f);});_0x402efb(_0x22121e);});}else{return db[_0x7d11('0x5d')]['findAll']({'where':{'sectionId':_0x3212fa['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x43082b){_0x43082b['forEach'](function(_0x3ee2ee){_0x22121e['push'](_0x3ee2ee['resourceId']+0x1869f);});_0x402efb(_0x22121e);});}}catch(_0x4ba3f6){_0x5bb85d(_0x4ba3f6);}});}function getPlugins(_0x4e5452){var _0x526e65=[];return new BPromise(function(_0x454789,_0x265c48){try{if(_0x4e5452[_0x7d11('0x58')]){return db[_0x7d11('0x6a')][_0x7d11('0x56')]({'raw':!![]})[_0x7d11('0x43')](function(_0x1a2df6){_0x1a2df6[_0x7d11('0x69')](function(_0x2e9b8b){_0x526e65['push'](_0x2e9b8b['id']+0x15b38);});_0x454789(_0x526e65);});}else{return db['UserProfileResource'][_0x7d11('0x56')]({'where':{'sectionId':_0x4e5452['id']},'raw':!![]})[_0x7d11('0x43')](function(_0x57a6a1){_0x57a6a1['forEach'](function(_0xe88ace){_0x526e65[_0x7d11('0x5f')](_0xe88ace[_0x7d11('0x6b')]+0x15b38);});_0x454789(_0x526e65);});}}catch(_0x391d7){_0x265c48(_0x391d7);}});}exports['addResources']=function(_0x542596,_0x4890ab){return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x542596[_0x7d11('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4890ab,null))[_0x7d11('0x43')](function(_0x238cfd){if(_0x238cfd){return db['sequelize'][_0x7d11('0x54')](function(_0x1cb457){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x542596[_0x7d11('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x7d11('0x43')](function(_0x5e0905){if(_0x5e0905){return db['UserProfileSection'][_0x7d11('0x2a')]({'where':{'userProfileId':_0x542596[_0x7d11('0x4d')]['id'],'id':_[_0x7d11('0x2f')](_0x5e0905,function(_0x2aa13b){return _0x2aa13b['id'];})},'transaction':_0x1cb457});}})['then'](function(_0x411f81){var _0x2cfa77=_[_0x7d11('0x2f')](_0x542596[_0x7d11('0x4b')],function(_0x491d94){_0x491d94[_0x7d11('0x5a')]=_0x542596[_0x7d11('0x4d')]['id'];return _0x491d94;});return db[_0x7d11('0x5c')]['bulkCreate'](_0x2cfa77,{'raw':!![],'transaction':_0x1cb457});})[_0x7d11('0x43')](function(_0x548866){var _0x3b3a6b=_['filter'](_[_0x7d11('0x2f')](_0x548866,function(_0x4409a9){return _0x4409a9[_0x7d11('0x55')]({'plain':!![]});}),{'includeAll':![]});if(_0x3b3a6b){return db[_0x7d11('0x5c')][_0x7d11('0x56')]({'where':{'userProfileId':_0x542596[_0x7d11('0x4d')]['id'],'sectionId':_['map'](_0x3b3a6b,function(_0x4d3861){return _0x4d3861[_0x7d11('0x59')];})},'attributes':['id',_0x7d11('0x59')],'raw':!![]})[_0x7d11('0x43')](function(_0x3c7760){var _0x57f89d=_[_0x7d11('0x2f')](_0x542596[_0x7d11('0x4b')],function(_0x30e9fa){_0x30e9fa[_0x7d11('0x5a')]=_0x542596['params']['id'];return _0x30e9fa;});return db[_0x7d11('0x5d')][_0x7d11('0x6c')](_0x57f89d,{'raw':!![],'transaction':_0x1cb457});});}})[_0x7d11('0x45')](handleError(_0x4890ab,null));});}})[_0x7d11('0x43')](function(_0x2e97e){var _0x21e965=_['map'](_0x2e97e,function(_0x6701af){return _0x6701af['get']({'plain':!![]});});})[_0x7d11('0x43')](respondWithResult(_0x4890ab,null))['catch'](handleError(_0x4890ab,null));};exports[_0x7d11('0x6d')]=function(_0x1c5c41,_0x42755e,_0x45f67f){return db[_0x7d11('0x30')][_0x7d11('0x4e')]({'where':{'id':_0x1c5c41[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](handleEntityNotFound(_0x42755e,null))[_0x7d11('0x43')](function(_0x19f280){if(_0x19f280){return _0x19f280['removeResources'](_0x1c5c41[_0x7d11('0x34')]['ids']);}})[_0x7d11('0x43')](respondWithStatusCode(_0x42755e,null))[_0x7d11('0x45')](handleError(_0x42755e,null));};exports[_0x7d11('0x6e')]=function(_0x4367a5,_0x19c0dd){var _0x596685={};if(!_0x4367a5['query'][_0x7d11('0x6f')])throw new Error(_0x7d11('0x70'));if(!_0x4367a5['query'][_0x7d11('0x71')](_0x7d11('0x39'))){_0x596685[_0x7d11('0x22')]=qs[_0x7d11('0x22')](_0x4367a5[_0x7d11('0x34')]['limit']);_0x596685['offset']=qs['offset'](_0x4367a5['query'][_0x7d11('0x23')]);}return db[_0x7d11('0x30')]['find']({'where':{'id':_0x4367a5[_0x7d11('0x4d')]['id']}})[_0x7d11('0x43')](function(_0x1152b3){if(!_0x1152b3)throw new Error(_0x7d11('0x72')+_0x4367a5[_0x7d11('0x4d')]['id']);return db[_0x7d11('0x30')][_0x7d11('0x6e')](_0x4367a5);})[_0x7d11('0x43')](respondWithFilteredResult(_0x19c0dd,_0x596685))['catch'](handleError(_0x19c0dd,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 0b84079..cc28135 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 _0x553a=['emit','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x11cbb5,_0x390441){var _0x54b8d3=function(_0x162ca2){while(--_0x162ca2){_0x11cbb5['push'](_0x11cbb5['shift']());}};_0x54b8d3(++_0x390441);}(_0x553a,0x192));var _0xa553=function(_0x52469e,_0x3579c2){_0x52469e=_0x52469e-0x0;var _0x2e6692=_0x553a[_0x52469e];return _0x2e6692;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa553('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa553('0x1')](0x0);var events={'afterCreate':_0xa553('0x2'),'afterUpdate':_0xa553('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d5106){return function(_0x367421,_0x50ecee,_0x4b0e9b){UserProfileEvents[_0xa553('0x4')](_0x4d5106+':'+_0x367421['id'],_0x367421);UserProfileEvents['emit'](_0x4d5106,_0x367421);_0x4b0e9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xa553('0x5')](e,emitEvent(event));}}module[_0xa553('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x6ec2=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5c3103,_0x2ba208){var _0x12ddc2=function(_0x2b26b4){while(--_0x2b26b4){_0x5c3103['push'](_0x5c3103['shift']());}};_0x12ddc2(++_0x2ba208);}(_0x6ec2,0x78));var _0x26ec=function(_0x1aa803,_0x5acc21){_0x1aa803=_0x1aa803-0x0;var _0x3305a0=_0x6ec2[_0x1aa803];return _0x3305a0;};'use strict';var EventEmitter=require(_0x26ec('0x0'));var UserProfile=require(_0x26ec('0x1'))['db'][_0x26ec('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x26ec('0x3')](0x0);var events={'afterCreate':_0x26ec('0x4'),'afterUpdate':_0x26ec('0x5'),'afterDestroy':'remove'};function emitEvent(_0x336098){return function(_0x18650a,_0x2b4225,_0x13f29c){UserProfileEvents[_0x26ec('0x6')](_0x336098+':'+_0x18650a['id'],_0x18650a);UserProfileEvents['emit'](_0x336098,_0x18650a);_0x13f29c(null);};}for(var e in events){if(events[_0x26ec('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 209a45b..313fe68 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 _0xd97e=['mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','Telephones','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','Reports','metrics','charAt','toUpperCase','slice','QueryTypes','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','UserProfileSection','find','ignore','union','autoAssociation','model','all','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','VIRTUAL','foreignKey','forEach','merge','options','CustomReports','count','rows','includeAll','include','Tags','color','tag','ThroughTags','chat','dataValues','sms','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','findAll','associatedResources','map','catch','value','then','name','resolve','AnalyticExtractedReport','resourceId','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','agent','telephone','type','inbound','QueueCampaigns','queue','VoiceQueue','outbound','VoiceChanSpy','Campaign','MailQueue','mailaccounts','MailAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd97e,0x74));var _0xed97=function(_0x5836e2,_0x46916e){_0x5836e2=_0x5836e2-0x0;var _0x18547c=_0xd97e[_0x5836e2];return _0x18547c;};'use strict';var _=require(_0xed97('0x0'));var attributes=require(_0xed97('0x1'));var qs=require(_0xed97('0x2'));var squel=require('squel');module[_0xed97('0x3')]=function(_0x5101df){var _0x16d379=_0x5101df['models'];function _0xafbebe(_0x3137bd,_0x5f106d){return new Promise(function(_0x50fd46,_0x660b55){if(!_0x5f106d)return _0x50fd46(null);var _0x7af472=_0x5f106d[_0xed97('0x4')]?{[_0x5f106d['filter'][_0xed97('0x5')]]:_0x5f106d[_0xed97('0x4')]['value']}:undefined;return _0x16d379[_0x3137bd][_0xed97('0x6')]({'where':_0x7af472,'raw':!![]})['then'](function(_0xa1c9b3){_0x5f106d[_0xed97('0x7')]=_[_0xed97('0x8')](_0xa1c9b3,'id');_0x50fd46(_0x5f106d);})[_0xed97('0x9')](function(_0x379b64){_0x660b55(_0x379b64);});});}function _0x2b6b31(_0x258083,_0x1802b6){return new Promise(function(_0x33a8df,_0x402134){var _0x236af2=_0x258083['filter']?{[_0x258083['filter'][_0xed97('0x5')]]:_0x258083[_0xed97('0x4')][_0xed97('0xa')]}:undefined;return _0x16d379[_0x258083['model']]['findAll']({'where':_0x236af2,'raw':!![]})[_0xed97('0xb')](function(_0x5b10a7){_0x1802b6[_0xed97('0x7')]=_[_0xed97('0x8')](_0x5b10a7,function(_0x24d89f){return _0x24d89f[_0xed97('0xc')];});_0x33a8df(_0x1802b6);})[_0xed97('0x9')](function(_0x49fa16){_0x402134(_0x49fa16);});});}function _0x2414e3(_0x4c4027,_0x51386b,_0xeebcf3){if(!_0x51386b)return Promise[_0xed97('0xd')](null);return new Promise(function(_0x5cfea2,_0x48d158){return _0x16d379['UserProfileResource'][_0xed97('0x6')]({'where':{'sectionId':_0x51386b['id']},'raw':!![]})[_0xed97('0xb')](function(_0x291e79){if(_0x4c4027[_0xed97('0x5')]&&_0x4c4027[_0xed97('0x5')]!=='id'){_0x51386b[_0xed97('0x7')]=_[_0xed97('0x8')](_0x291e79,function(_0x227f2f){return _0x227f2f[_0x4c4027['field']];});}else{if(_0xeebcf3===_0xed97('0xe')){_0x51386b[_0xed97('0x7')]=_[_0xed97('0x8')](_0x291e79,function(_0x4fc3c7){return{'id':_0x4fc3c7[_0xed97('0xf')],'type':_0x4fc3c7['type']};});}else{_0x51386b[_0xed97('0x7')]=_[_0xed97('0x8')](_0x291e79,function(_0x5413c2){return _0x5413c2[_0xed97('0xf')];});}}_0x5cfea2(_0x51386b);})['catch'](function(_0x545ad0){_0x48d158(_0x545ad0);});});}function _0x513ada(_0x447f66,_0x2dd7d1){var _0x375535={'parentSections':[]};switch(_0x447f66['toLowerCase']()){case _0xed97('0x10'):_0x375535[_0xed97('0x11')]='SquareProject';break;case _0xed97('0x12'):_0x375535[_0xed97('0x11')]=_0xed97('0x13');break;case _0xed97('0x14'):_0x375535[_0xed97('0x11')]=_0xed97('0x15');_0x375535[_0xed97('0x16')]=[{'name':_0xed97('0x17'),'field':_0xed97('0xc'),'foreignKey':_0xed97('0x18')}];break;case _0xed97('0x19'):_0x375535[_0xed97('0x11')]=_0xed97('0x1a');break;case _0xed97('0x1b'):_0x375535[_0xed97('0x11')]=_0xed97('0x1c');_0x375535[_0xed97('0x16')]=[{'name':_0xed97('0x1d'),'field':'id','foreignKey':_0xed97('0x1e')}];break;case _0xed97('0x1f'):_0x375535[_0xed97('0x11')]=_0xed97('0x20');break;case _0xed97('0x21'):_0x375535[_0xed97('0x11')]='CmCompany';break;case _0xed97('0x22'):_0x375535['childModel']=_0xed97('0x23');break;case'chatqueues':_0x375535[_0xed97('0x11')]=_0xed97('0x24');break;case _0xed97('0x25'):_0x375535[_0xed97('0x11')]='ChatWebsite';break;case _0xed97('0x26'):_0x375535[_0xed97('0x11')]=_0xed97('0x27');break;case _0xed97('0x28'):_0x375535[_0xed97('0x11')]=_0xed97('0x29');break;case _0xed97('0x2a'):case'internalroutes':case'outboundroutes':_0x375535[_0xed97('0x11')]=_0xed97('0x2b');break;case _0xed97('0x2c'):_0x375535[_0xed97('0x11')]=_0xed97('0x2d');break;case _0xed97('0x2e'):_0x375535[_0xed97('0x11')]=_0xed97('0x2f');break;case _0xed97('0x30'):_0x375535[_0xed97('0x11')]='VoiceRecording';_0x375535[_0xed97('0x16')]=[{'name':_0xed97('0x31'),'field':_0xed97('0xc'),'foreignKey':_0xed97('0x32'),'model':_0xed97('0x33'),'filter':{'field':_0xed97('0x34'),'value':[_0xed97('0x35')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':_0xed97('0x33'),'filter':{'field':_0xed97('0x34'),'value':[_0xed97('0x36')]}},{'name':'VoiceQueues','field':_0xed97('0xc'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xed97('0x37'),'value':[_0xed97('0x38')]}},{'name':_0xed97('0x39'),'field':_0xed97('0xc'),'foreignKey':_0xed97('0x3a'),'model':_0xed97('0x3b'),'filter':{'field':'type','value':[_0xed97('0x3c')]}}];break;case'musiconholds':_0x375535[_0xed97('0x11')]='VoiceMusicOnHold';break;case'chanspies':_0x375535[_0xed97('0x11')]=_0xed97('0x3d');break;case'voiceprefixes':_0x375535['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x375535[_0xed97('0x11')]=_0xed97('0x3e');break;case'mailqueues':_0x375535[_0xed97('0x11')]=_0xed97('0x3f');break;case _0xed97('0x40'):_0x375535[_0xed97('0x11')]=_0xed97('0x41');break;case _0xed97('0x42'):_0x375535[_0xed97('0x11')]=_0xed97('0x43');break;case _0xed97('0x44'):_0x375535[_0xed97('0x11')]='OpenchannelQueue';break;case _0xed97('0x45'):_0x375535[_0xed97('0x11')]=_0xed97('0x46');break;case _0xed97('0x47'):_0x375535[_0xed97('0x11')]=_0xed97('0x48');break;case'smsaccounts':_0x375535[_0xed97('0x11')]=_0xed97('0x49');break;case _0xed97('0x4a'):_0x375535['childModel']=_0xed97('0x4b');break;case'whatsappaccounts':_0x375535['childModel']=_0xed97('0x4c');break;case _0xed97('0x4d'):_0x375535['childModel']=_0xed97('0x4e');break;case _0xed97('0x4f'):case'queuecampaigns':_0x375535[_0xed97('0x11')]=_0xed97('0x3b');if(_0x2dd7d1){_0x375535[_0xed97('0x16')]=[{'name':'VoiceQueues'},{'name':_0xed97('0x39')}];}break;case _0xed97('0x50'):case _0xed97('0x51'):case _0xed97('0x52'):_0x375535['childModel']=_0xed97('0x33');if(_0x2dd7d1){_0x375535[_0xed97('0x16')]=[{'name':_0xed97('0x53'),'filter':{'field':_0xed97('0x34'),'value':['admin','user']},'ignore':!![]},{'name':_0xed97('0x31')},{'name':_0xed97('0x54')}];}break;case'zendeskaccounts':_0x375535['childModel']=_0xed97('0x55');break;case _0xed97('0x56'):_0x375535[_0xed97('0x11')]=_0xed97('0x57');break;case _0xed97('0x58'):_0x375535[_0xed97('0x11')]=_0xed97('0x59');break;case _0xed97('0x5a'):_0x375535[_0xed97('0x11')]=_0xed97('0x5b');break;case _0xed97('0x5c'):_0x375535[_0xed97('0x11')]=_0xed97('0x5d');break;case'zohoaccounts':_0x375535[_0xed97('0x11')]=_0xed97('0x5e');break;case _0xed97('0x5f'):_0x375535[_0xed97('0x11')]='User';break;case _0xed97('0x60'):_0x375535[_0xed97('0x11')]='CannedAnswer';break;case _0xed97('0x61'):_0x375535['childModel']=_0xed97('0x62');break;case _0xed97('0x63'):_0x375535[_0xed97('0x11')]=_0xed97('0x64');break;case _0xed97('0x65'):_0x375535[_0xed97('0x11')]=_0xed97('0x66');break;case _0xed97('0x67'):_0x375535[_0xed97('0x11')]='Pause';break;case _0xed97('0x68'):_0x375535[_0xed97('0x11')]=_0xed97('0x69');break;case _0xed97('0x6a'):_0x375535[_0xed97('0x11')]=_0xed97('0x6b');break;case _0xed97('0x6c'):_0x375535[_0xed97('0x11')]=_0xed97('0x6d');break;case _0xed97('0x6e'):_0x375535[_0xed97('0x11')]=_0xed97('0x6f');break;case _0xed97('0x70'):_0x375535['childModel']=_0xed97('0x71');break;case _0xed97('0x72'):_0x375535[_0xed97('0x11')]='Trunk';break;case _0xed97('0x73'):_0x375535[_0xed97('0x11')]=_0xed97('0x74');break;case _0xed97('0x75'):_0x375535['childModel']='Plugin';break;case _0xed97('0x76'):_0x375535['childModel']=_0xed97('0xe');_0x375535[_0xed97('0x16')]=[{'name':_0xed97('0x77'),'field':'id','foreignKey':'reportId'}];break;case _0xed97('0x78'):_0x375535['childModel']='AnalyticMetric';break;}return _0x375535;}function _0x35c4e3(_0x296afe,_0x3809c9){var _0x2a4829=_0x296afe[_0xed97('0x79')](0x0)[_0xed97('0x7a')]()+_0x296afe[_0xed97('0x7b')](0x1);var _0x47c43c={'type':_0x16d379['Sequelize'][_0xed97('0x7c')]['SELECT'],'raw':!![]};return new Promise(function(_0x3adf6d,_0x2dd184){var _0x476708=squel[_0xed97('0x7d')]()[_0xed97('0x5')](_0xed97('0x7e')+_0x2a4829+_0xed97('0x7f'),'id')[_0xed97('0x5')]('ui.createdAt')[_0xed97('0x80')](_0xed97('0x81')+_0x296afe+_0xed97('0x82'),'ui')['where'](_0xed97('0x83'),_0x3809c9['id']);return _0x16d379['sequelize'][_0xed97('0x84')](_0x476708[_0xed97('0x85')](),_0x47c43c)['then'](function(_0x4b43bf){_0x3809c9[_0x2a4829+_0xed97('0x86')]=_0x4b43bf;_0x3adf6d(_0x4b43bf);})[_0xed97('0x9')](function(_0x3dd2ea){_0x2dd184(_0x3dd2ea);});});}return _0x5101df[_0xed97('0x87')](_0xed97('0x88'),attributes,{'tableName':_0xed97('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x488b4d){var _0x4dcc17={'raw':_0x488b4d[_0xed97('0x84')]['raw'],'where':{}};var _0x199593={};var _0x3dee7d={'count':0x0,'rows':[]};var _0x5aa533=_0x488b4d[_0xed97('0x84')][_0xed97('0x8a')];var _0x3f41b9=_0x488b4d[_0xed97('0x84')][_0xed97('0x8b')]||![];var _0x96be4=_0x513ada(_0x5aa533,_0x3f41b9);if(!_0x96be4[_0xed97('0x11')])throw new Error('Invalid\x20section\x20\x27'+_0x5aa533+'\x27');var _0x360b15=[{'name':_0x5aa533}];if(!_[_0xed97('0x8c')](_0x96be4['parentSections']))_0x360b15=_0x96be4[_0xed97('0x16')];var _0x220022=[];for(var _0x5a71fa=0x0;_0x5a71fa<_0x360b15[_0xed97('0x8d')];_0x5a71fa++){_0x220022[_0xed97('0x8e')](_0x16d379[_0xed97('0x8f')][_0xed97('0x90')]({'where':{'userProfileId':_0x488b4d['params']['id'],'name':_0x360b15[_0x5a71fa][_0xed97('0xc')]},'raw':!![]}));}return Promise['all'](_0x220022)[_0xed97('0xb')](function(_0x512cd5){var _0x42838d=_['filter'](_0x512cd5,function(_0x467cbb){return _0x467cbb?_0x467cbb:undefined;});var _0x22107a=_[_0xed97('0x4')](_0x360b15,[_0xed97('0x91'),!![]]);var _0x1f92ef=_['isEmpty'](_0x42838d)&&_['isEmpty'](_0x22107a)?null:_[_0xed97('0x92')](_0x22107a,_0x42838d);if(!_0x1f92ef)return null;var _0x51595e=[];for(var _0xbf6dc8=0x0;_0xbf6dc8<_0x1f92ef[_0xed97('0x8d')];_0xbf6dc8++){var _0x4682d4=_[_0xed97('0x90')](_0x360b15,function(_0x3f74ec){return _0x1f92ef[_0xbf6dc8]?_0x3f74ec[_0xed97('0xc')]===_0x1f92ef[_0xbf6dc8][_0xed97('0xc')]:null;});if(_0x4682d4){if(_0x1f92ef[_0xbf6dc8][_0xed97('0x91')]){_0x51595e[_0xed97('0x8e')](_0xafbebe(_0x96be4[_0xed97('0x11')],_0x1f92ef[_0xbf6dc8]));}else{if(!_0x1f92ef[_0xbf6dc8][_0xed97('0x93')]){_0x51595e['push'](_0x2414e3(_0x4682d4,_0x1f92ef[_0xbf6dc8],_0x96be4[_0xed97('0x11')]));}else{if(_0x4682d4[_0xed97('0x94')]){_0x51595e[_0xed97('0x8e')](_0x2b6b31(_0x4682d4,_0x1f92ef[_0xbf6dc8]));}}}}}return Promise[_0xed97('0x95')](_0x51595e);})[_0xed97('0xb')](function(_0x4b95b9){var _0x40fc74=_0x4b95b9;var _0x2a8277=null;if(_0x40fc74){_0x2a8277=_0x40fc74[_0xed97('0x8d')]===0x1?_0x40fc74[0x0]:null;}if(!_0x2a8277&&!_0x40fc74)return _0x3dee7d;var _0x138d2c=_0x16d379[_0x96be4[_0xed97('0x11')]][_0xed97('0x96')];_0x199593['model']=_[_0xed97('0x97')](_0x138d2c);_0x199593[_0xed97('0x84')]=_['keys'](_0x488b4d['query']);_0x199593['filters']=_[_0xed97('0x98')](_0x199593[_0xed97('0x94')],_0x199593['query']);_0x4dcc17[_0xed97('0x99')]=_['intersection'](_0x199593[_0xed97('0x94')],qs[_0xed97('0x9a')](_0x488b4d['query'][_0xed97('0x9a')]));_0x4dcc17[_0xed97('0x99')]=_0x4dcc17[_0xed97('0x99')][_0xed97('0x8d')]?_0x4dcc17[_0xed97('0x99')]:_0x199593[_0xed97('0x94')];if(!_0x488b4d[_0xed97('0x84')][_0xed97('0x9b')](_0xed97('0x9c'))){_0x4dcc17[_0xed97('0x9d')]=qs[_0xed97('0x9d')](_0x488b4d[_0xed97('0x84')][_0xed97('0x9d')]);_0x4dcc17[_0xed97('0x9e')]=qs[_0xed97('0x9e')](_0x488b4d[_0xed97('0x84')][_0xed97('0x9e')]);}_0x4dcc17[_0xed97('0x9f')]=qs['sort'](_0x488b4d[_0xed97('0x84')][_0xed97('0xa0')]);_0x4dcc17[_0xed97('0xa1')]=qs[_0xed97('0xa2')](_['pick'](_0x488b4d[_0xed97('0x84')],_0x199593['filters']));if(_0x488b4d[_0xed97('0x84')][_0xed97('0x4')]){_0x4dcc17[_0xed97('0xa1')]=_['merge'](_0x4dcc17[_0xed97('0xa1')],{'$or':_[_0xed97('0x8')](_0x138d2c,function(_0x42cba7){if(_0x42cba7[_0xed97('0x37')]['key']!==_0xed97('0xa3')){var _0x459027={};_0x459027[_0x42cba7[_0xed97('0x5')]]={'$like':'%'+_0x488b4d[_0xed97('0x84')][_0xed97('0x4')]+'%'};return _0x459027;}})});}var _0x576a96=[];var _0x5c1a09=null;var _0x22f42d={};if(_0x2a8277){_0x5c1a09=_[_0xed97('0x90')](_0x360b15,[_0xed97('0xc'),_0x2a8277[_0xed97('0xc')]]);if(_0x5c1a09[_0xed97('0x5')]){_0x22f42d={};if(_0x96be4['childModel']===_0xed97('0xe')){_0x22f42d[_0x5c1a09['foreignKey']]=_['map'](_0x2a8277[_0xed97('0x7')],'id');}else{_0x22f42d[_0x5c1a09['foreignKey']]=_0x2a8277[_0xed97('0x7')];}_0x576a96['push'](_0x22f42d);}else{_0x4dcc17[_0xed97('0xa1')]['id']=_0x2a8277[_0xed97('0x7')];}}else{for(var _0x29212d=0x0;_0x29212d<_0x40fc74[_0xed97('0x8d')];_0x29212d++){_0x5c1a09=_[_0xed97('0x90')](_0x360b15,[_0xed97('0xc'),_0x40fc74[_0x29212d]['name']]);if(_0x5c1a09[_0xed97('0x5')]){_0x22f42d={};_0x22f42d[_0x5c1a09[_0xed97('0xa4')]]=_0x40fc74[_0x29212d]['associatedResources'];_0x576a96[_0xed97('0x8e')](_0x22f42d);}else{if(!_0x4dcc17[_0xed97('0xa1')]['id'])_0x4dcc17[_0xed97('0xa1')]['id']=[];_0x40fc74[_0x29212d][_0xed97('0x7')][_0xed97('0xa5')](function(_0xa3f7af){_0x4dcc17[_0xed97('0xa1')]['id'][_0xed97('0x8e')](_0xa3f7af);});}}}if(!_[_0xed97('0x8c')](_0x576a96)){_0x4dcc17['where']=_[_0xed97('0xa6')](_0x4dcc17[_0xed97('0xa1')],{'$and':{'$or':_0x576a96}});}_0x4dcc17=_['merge']({},_0x4dcc17,_0x488b4d[_0xed97('0xa7')]);if(_0x2a8277&&!_0x2a8277[_0xed97('0x93')]&&_0x96be4[_0xed97('0x11')]===_0xed97('0xe')){if(_0x488b4d['query']['includeAll']){_0x4dcc17['include']=[{'all':!![]}];}return _0x16d379[_0x96be4[_0xed97('0x11')]][_0xed97('0x6')](_0x4dcc17)[_0xed97('0xb')](function(_0x134e2a){var _0x1b3a8c=[];_0x134e2a[_0xed97('0xa5')](function(_0x34dfa9){var _0x5882ca;switch(_0x34dfa9['reportType']){case'default':_0x5882ca=_[_0xed97('0x90')](_0x2a8277[_0xed97('0x7')],function(_0x33ab5b){return _0x33ab5b['id']===_0x34dfa9['reportId']&&_0x33ab5b[_0xed97('0x37')]==='DefaultReports';});break;case'custom':_0x5882ca=_[_0xed97('0x90')](_0x2a8277[_0xed97('0x7')],function(_0x2586c1){return _0x2586c1['id']===_0x34dfa9['reportId']&&_0x2586c1['type']===_0xed97('0xa8');});break;}if(_0x5882ca)_0x1b3a8c[_0xed97('0x8e')](_0x34dfa9);});_0x3dee7d[_0xed97('0xa9')]=_0x1b3a8c[_0xed97('0x8d')];_0x3dee7d[_0xed97('0xaa')]=_0x1b3a8c;return _0x3dee7d;});}else{return _0x16d379[_0x96be4[_0xed97('0x11')]][_0xed97('0xa9')]({'where':_0x4dcc17[_0xed97('0xa1')]})['then'](function(_0x476462){_0x3dee7d[_0xed97('0xa9')]=_0x476462;if(_0x488b4d['query'][_0xed97('0xab')]){if(_0x96be4['childModel']===_0xed97('0x1c')){_0x4dcc17[_0xed97('0xac')]=[{'model':_0x16d379[_0xed97('0x6d')],'as':_0xed97('0xad'),'attributes':['id','name',_0xed97('0xae')],'required':_0x488b4d[_0xed97('0x84')][_0xed97('0xaf')]?!![]:![]},{'model':_0x16d379[_0xed97('0x6d')],'as':_0xed97('0xb0'),'attributes':['id',_0xed97('0xc'),'color'],'through':_0x488b4d['query'][_0xed97('0xaf')]?{'attributes':[],'where':{'TagId':_0x488b4d[_0xed97('0x84')]['tag']||undefined}}:{},'required':_0x488b4d[_0xed97('0x84')][_0xed97('0xaf')]?!![]:![]}];}else{_0x4dcc17[_0xed97('0xac')]=[{'all':!![]}];}}return _0x16d379[_0x96be4['childModel']][_0xed97('0x6')](_0x4dcc17);})[_0xed97('0xb')](function(_0x85131b){_0x3dee7d[_0xed97('0xaa')]=_0x85131b;if(_0x5aa533===_0xed97('0x31')&&_0x488b4d['query']['openTabs']==='true'){var _0x1b3590=[];for(var _0x4ab2ea=0x0;_0x4ab2ea<_0x3dee7d[_0xed97('0xaa')][_0xed97('0x8d')];_0x4ab2ea++){_0x1b3590[_0xed97('0x8e')](_0x35c4e3(_0xed97('0xb1'),_0x3dee7d[_0xed97('0xaa')][_0x4ab2ea][_0xed97('0xb2')]));_0x1b3590[_0xed97('0x8e')](_0x35c4e3(_0xed97('0xb3'),_0x3dee7d[_0xed97('0xaa')][_0x4ab2ea][_0xed97('0xb2')]));_0x1b3590[_0xed97('0x8e')](_0x35c4e3('fax',_0x3dee7d['rows'][_0x4ab2ea][_0xed97('0xb2')]));_0x1b3590['push'](_0x35c4e3(_0xed97('0xb4'),_0x3dee7d[_0xed97('0xaa')][_0x4ab2ea]['dataValues']));_0x1b3590[_0xed97('0x8e')](_0x35c4e3(_0xed97('0xb5'),_0x3dee7d[_0xed97('0xaa')][_0x4ab2ea][_0xed97('0xb2')]));_0x1b3590[_0xed97('0x8e')](_0x35c4e3('whatsapp',_0x3dee7d[_0xed97('0xaa')][_0x4ab2ea][_0xed97('0xb2')]));}return Promise[_0xed97('0x95')](_0x1b3590)[_0xed97('0xb')](function(){return _0x3dee7d;});}return _0x3dee7d;});}});}}});}; \ No newline at end of file +var _0xc881=['voicerecordings','VoiceRecording','Agents','User','role','Telephones','membername','telephone','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','whatsappaccounts','teams','Team','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','Interval','Pause','scheduler','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','ui.createdAt','user_has_','_interactions','where','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','ignore','union','push','autoAssociation','rawAttributes','keys','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','key','VIRTUAL','foreignKey','forEach','merge','options','AnalyticExtractedReport','includeAll','reportType','default','DefaultReports','custom','rows','count','Tags','ThroughTags','color','tag','include','true','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','resourceId','type','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','inboundroutes','VoiceExtension','voicemails','VoiceMail'];(function(_0x1ddbda,_0x1de7e5){var _0x25162a=function(_0x5367f4){while(--_0x5367f4){_0x1ddbda['push'](_0x1ddbda['shift']());}};_0x25162a(++_0x1de7e5);}(_0xc881,0x8b));var _0x1c88=function(_0x3f3ac8,_0x4fa33c){_0x3f3ac8=_0x3f3ac8-0x0;var _0x1ecf8c=_0xc881[_0x3f3ac8];return _0x1ecf8c;};'use strict';var _=require(_0x1c88('0x0'));var attributes=require(_0x1c88('0x1'));var qs=require(_0x1c88('0x2'));var squel=require('squel');module[_0x1c88('0x3')]=function(_0x4b13a9){var _0x36b9b7=_0x4b13a9[_0x1c88('0x4')];function _0x5b2276(_0x5a9ba4,_0x4be604){return new Promise(function(_0x37de80,_0xff6eb6){if(!_0x4be604)return _0x37de80(null);var _0x50f2c0=_0x4be604[_0x1c88('0x5')]?{[_0x4be604[_0x1c88('0x5')][_0x1c88('0x6')]]:_0x4be604['filter'][_0x1c88('0x7')]}:undefined;return _0x36b9b7[_0x5a9ba4][_0x1c88('0x8')]({'where':_0x50f2c0,'raw':!![]})[_0x1c88('0x9')](function(_0x4d8196){_0x4be604[_0x1c88('0xa')]=_[_0x1c88('0xb')](_0x4d8196,'id');_0x37de80(_0x4be604);})[_0x1c88('0xc')](function(_0x3ae5d4){_0xff6eb6(_0x3ae5d4);});});}function _0x130405(_0x2d363b,_0x17fcf1){return new Promise(function(_0x542793,_0x219c0d){var _0x7069f6=_0x2d363b['filter']?{[_0x2d363b['filter'][_0x1c88('0x6')]]:_0x2d363b[_0x1c88('0x5')][_0x1c88('0x7')]}:undefined;return _0x36b9b7[_0x2d363b[_0x1c88('0xd')]]['findAll']({'where':_0x7069f6,'raw':!![]})[_0x1c88('0x9')](function(_0x3b9d26){_0x17fcf1['associatedResources']=_[_0x1c88('0xb')](_0x3b9d26,function(_0x4e4360){return _0x4e4360[_0x1c88('0xe')];});_0x542793(_0x17fcf1);})[_0x1c88('0xc')](function(_0x42ac24){_0x219c0d(_0x42ac24);});});}function _0x42cb10(_0x1b81ab,_0x44b193,_0x3a9ad8){if(!_0x44b193)return Promise[_0x1c88('0xf')](null);return new Promise(function(_0x3dcfb5,_0x581d55){return _0x36b9b7[_0x1c88('0x10')][_0x1c88('0x8')]({'where':{'sectionId':_0x44b193['id']},'raw':!![]})[_0x1c88('0x9')](function(_0x29280f){if(_0x1b81ab['field']&&_0x1b81ab[_0x1c88('0x6')]!=='id'){_0x44b193[_0x1c88('0xa')]=_[_0x1c88('0xb')](_0x29280f,function(_0x2e27e4){return _0x2e27e4[_0x1b81ab[_0x1c88('0x6')]];});}else{if(_0x3a9ad8==='AnalyticExtractedReport'){_0x44b193[_0x1c88('0xa')]=_[_0x1c88('0xb')](_0x29280f,function(_0x229bbd){return{'id':_0x229bbd[_0x1c88('0x11')],'type':_0x229bbd[_0x1c88('0x12')]};});}else{_0x44b193['associatedResources']=_[_0x1c88('0xb')](_0x29280f,function(_0x129ab7){return _0x129ab7['resourceId'];});}}_0x3dcfb5(_0x44b193);})[_0x1c88('0xc')](function(_0x41b8e4){_0x581d55(_0x41b8e4);});});}function _0x5d6fc5(_0x147700,_0x283699){var _0x224924={'parentSections':[]};switch(_0x147700[_0x1c88('0x13')]()){case _0x1c88('0x14'):_0x224924[_0x1c88('0x15')]='SquareProject';break;case _0x1c88('0x16'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x17');break;case _0x1c88('0x18'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x19');_0x224924[_0x1c88('0x1a')]=[{'name':_0x1c88('0x1b'),'field':_0x1c88('0xe'),'foreignKey':_0x1c88('0x1c')}];break;case _0x1c88('0x1d'):_0x224924['childModel']=_0x1c88('0x1e');break;case _0x1c88('0x1f'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x20');_0x224924['parentSections']=[{'name':_0x1c88('0x21'),'field':'id','foreignKey':_0x1c88('0x22')}];break;case _0x1c88('0x23'):_0x224924[_0x1c88('0x15')]='CmList';break;case _0x1c88('0x24'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x25');break;case'globalcustomfields':_0x224924[_0x1c88('0x15')]=_0x1c88('0x26');break;case _0x1c88('0x27'):_0x224924['childModel']=_0x1c88('0x28');break;case _0x1c88('0x29'):_0x224924['childModel']=_0x1c88('0x2a');break;case _0x1c88('0x2b'):_0x224924['childModel']='FaxQueue';break;case'faxaccounts':_0x224924[_0x1c88('0x15')]='FaxAccount';break;case _0x1c88('0x2c'):case'internalroutes':case'outboundroutes':_0x224924[_0x1c88('0x15')]=_0x1c88('0x2d');break;case'contexts':_0x224924[_0x1c88('0x15')]='VoiceContext';break;case _0x1c88('0x2e'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x2f');break;case _0x1c88('0x30'):_0x224924['childModel']=_0x1c88('0x31');_0x224924[_0x1c88('0x1a')]=[{'name':_0x1c88('0x32'),'field':_0x1c88('0xe'),'foreignKey':'membername','model':_0x1c88('0x33'),'filter':{'field':_0x1c88('0x34'),'value':['agent']}},{'name':_0x1c88('0x35'),'field':_0x1c88('0xe'),'foreignKey':_0x1c88('0x36'),'model':'User','filter':{'field':'role','value':[_0x1c88('0x37')]}},{'name':'VoiceQueues','field':_0x1c88('0xe'),'foreignKey':_0x1c88('0x38'),'model':_0x1c88('0x39'),'filter':{'field':_0x1c88('0x12'),'value':['inbound']}},{'name':_0x1c88('0x3a'),'field':'name','foreignKey':_0x1c88('0x38'),'model':_0x1c88('0x39'),'filter':{'field':_0x1c88('0x12'),'value':[_0x1c88('0x3b')]}}];break;case _0x1c88('0x3c'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x3d');break;case _0x1c88('0x3e'):_0x224924[_0x1c88('0x15')]='VoiceChanSpy';break;case _0x1c88('0x3f'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x40');break;case _0x1c88('0x41'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x42');break;case _0x1c88('0x43'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x44');break;case'mailaccounts':_0x224924[_0x1c88('0x15')]=_0x1c88('0x45');break;case'mailsubstatuses':_0x224924['childModel']='MailSubstatus';break;case _0x1c88('0x46'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x47');break;case _0x1c88('0x48'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x49');break;case _0x1c88('0x4a'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x4b');break;case _0x1c88('0x4c'):_0x224924['childModel']='SmsAccount';break;case _0x1c88('0x4d'):_0x224924[_0x1c88('0x15')]='WhatsappQueue';break;case _0x1c88('0x4e'):_0x224924[_0x1c88('0x15')]='WhatsappAccount';break;case _0x1c88('0x4f'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x50');break;case'voicequeues':case'queuecampaigns':_0x224924[_0x1c88('0x15')]=_0x1c88('0x39');if(_0x283699){_0x224924[_0x1c88('0x1a')]=[{'name':'VoiceQueues'},{'name':_0x1c88('0x3a')}];}break;case _0x1c88('0x51'):case _0x1c88('0x52'):case _0x1c88('0x53'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x33');if(_0x283699){_0x224924[_0x1c88('0x1a')]=[{'name':_0x1c88('0x54'),'filter':{'field':_0x1c88('0x34'),'value':[_0x1c88('0x55'),_0x1c88('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0x1c88('0x35')}];}break;case _0x1c88('0x57'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x58');break;case _0x1c88('0x59'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x5a');break;case _0x1c88('0x5b'):_0x224924['childModel']=_0x1c88('0x5c');break;case _0x1c88('0x5d'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x5e');break;case'deskaccounts':_0x224924[_0x1c88('0x15')]=_0x1c88('0x5f');break;case _0x1c88('0x60'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x61');break;case _0x1c88('0x62'):_0x224924[_0x1c88('0x15')]='User';break;case _0x1c88('0x63'):_0x224924['childModel']='CannedAnswer';break;case _0x1c88('0x64'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x65');break;case _0x1c88('0x66'):_0x224924['childModel']=_0x1c88('0x67');break;case'intervals':_0x224924[_0x1c88('0x15')]=_0x1c88('0x68');break;case'pauses':_0x224924[_0x1c88('0x15')]=_0x1c88('0x69');break;case _0x1c88('0x6a'):_0x224924[_0x1c88('0x15')]='Schedule';break;case'sounds':_0x224924[_0x1c88('0x15')]=_0x1c88('0x6b');break;case _0x1c88('0x6c'):_0x224924['childModel']=_0x1c88('0x6d');break;case _0x1c88('0x6e'):_0x224924[_0x1c88('0x15')]='Template';break;case _0x1c88('0x6f'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x70');break;case _0x1c88('0x71'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x72');break;case'variables':_0x224924[_0x1c88('0x15')]=_0x1c88('0x73');break;case _0x1c88('0x74'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x75');break;case _0x1c88('0x76'):_0x224924['childModel']='AnalyticExtractedReport';_0x224924[_0x1c88('0x1a')]=[{'name':_0x1c88('0x77'),'field':'id','foreignKey':_0x1c88('0x78')}];break;case _0x1c88('0x79'):_0x224924[_0x1c88('0x15')]=_0x1c88('0x7a');break;}return _0x224924;}function _0x19f1c7(_0x3abd60,_0x2429d7){var _0xeddada=_0x3abd60[_0x1c88('0x7b')](0x0)[_0x1c88('0x7c')]()+_0x3abd60[_0x1c88('0x7d')](0x1);var _0x56126b={'type':_0x36b9b7[_0x1c88('0x7e')]['QueryTypes'][_0x1c88('0x7f')],'raw':!![]};return new Promise(function(_0x580149,_0x3e9bc0){var _0x32ffee=squel[_0x1c88('0x80')]()[_0x1c88('0x6')](_0x1c88('0x81')+_0xeddada+'InteractionId','id')['field'](_0x1c88('0x82'))['from'](_0x1c88('0x83')+_0x3abd60+_0x1c88('0x84'),'ui')[_0x1c88('0x85')]('ui.UserId\x20=\x20?',_0x2429d7['id']);return _0x36b9b7[_0x1c88('0x86')][_0x1c88('0x87')](_0x32ffee['toString'](),_0x56126b)[_0x1c88('0x9')](function(_0x1ed22c){_0x2429d7[_0xeddada+_0x1c88('0x88')]=_0x1ed22c;_0x580149(_0x1ed22c);})['catch'](function(_0x57c089){_0x3e9bc0(_0x57c089);});});}return _0x4b13a9[_0x1c88('0x89')](_0x1c88('0x8a'),attributes,{'tableName':_0x1c88('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x382606){var _0x1d78c6={'raw':_0x382606[_0x1c88('0x87')]['raw'],'where':{}};var _0x35d21e={};var _0x185d82={'count':0x0,'rows':[]};var _0x40061d=_0x382606['query'][_0x1c88('0x8c')];var _0x2b2b91=_0x382606['query']['mergeResources']||![];var _0x16a180=_0x5d6fc5(_0x40061d,_0x2b2b91);if(!_0x16a180[_0x1c88('0x15')])throw new Error(_0x1c88('0x8d')+_0x40061d+'\x27');var _0x1431e3=[{'name':_0x40061d}];if(!_[_0x1c88('0x8e')](_0x16a180[_0x1c88('0x1a')]))_0x1431e3=_0x16a180[_0x1c88('0x1a')];var _0x45299c=[];for(var _0x2b5d68=0x0;_0x2b5d68<_0x1431e3[_0x1c88('0x8f')];_0x2b5d68++){_0x45299c['push'](_0x36b9b7['UserProfileSection'][_0x1c88('0x90')]({'where':{'userProfileId':_0x382606[_0x1c88('0x91')]['id'],'name':_0x1431e3[_0x2b5d68][_0x1c88('0xe')]},'raw':!![]}));}return Promise[_0x1c88('0x92')](_0x45299c)[_0x1c88('0x9')](function(_0x3e01bf){var _0xc1106e=_['filter'](_0x3e01bf,function(_0x3c24bb){return _0x3c24bb?_0x3c24bb:undefined;});var _0x29adbd=_['filter'](_0x1431e3,[_0x1c88('0x93'),!![]]);var _0x299366=_[_0x1c88('0x8e')](_0xc1106e)&&_[_0x1c88('0x8e')](_0x29adbd)?null:_[_0x1c88('0x94')](_0x29adbd,_0xc1106e);if(!_0x299366)return null;var _0x5cfc08=[];for(var _0x4d054a=0x0;_0x4d054a<_0x299366[_0x1c88('0x8f')];_0x4d054a++){var _0x578855=_['find'](_0x1431e3,function(_0x37107e){return _0x299366[_0x4d054a]?_0x37107e[_0x1c88('0xe')]===_0x299366[_0x4d054a][_0x1c88('0xe')]:null;});if(_0x578855){if(_0x299366[_0x4d054a]['ignore']){_0x5cfc08[_0x1c88('0x95')](_0x5b2276(_0x16a180[_0x1c88('0x15')],_0x299366[_0x4d054a]));}else{if(!_0x299366[_0x4d054a][_0x1c88('0x96')]){_0x5cfc08[_0x1c88('0x95')](_0x42cb10(_0x578855,_0x299366[_0x4d054a],_0x16a180[_0x1c88('0x15')]));}else{if(_0x578855[_0x1c88('0xd')]){_0x5cfc08[_0x1c88('0x95')](_0x130405(_0x578855,_0x299366[_0x4d054a]));}}}}}return Promise[_0x1c88('0x92')](_0x5cfc08);})[_0x1c88('0x9')](function(_0x3ade97){var _0x218c1f=_0x3ade97;var _0x263a62=null;if(_0x218c1f){_0x263a62=_0x218c1f[_0x1c88('0x8f')]===0x1?_0x218c1f[0x0]:null;}if(!_0x263a62&&!_0x218c1f)return _0x185d82;var _0x2510d6=_0x36b9b7[_0x16a180[_0x1c88('0x15')]][_0x1c88('0x97')];_0x35d21e[_0x1c88('0xd')]=_[_0x1c88('0x98')](_0x2510d6);_0x35d21e[_0x1c88('0x87')]=_[_0x1c88('0x98')](_0x382606[_0x1c88('0x87')]);_0x35d21e['filters']=_['intersection'](_0x35d21e['model'],_0x35d21e[_0x1c88('0x87')]);_0x1d78c6['attributes']=_['intersection'](_0x35d21e[_0x1c88('0xd')],qs[_0x1c88('0x99')](_0x382606[_0x1c88('0x87')]['fields']));_0x1d78c6[_0x1c88('0x9a')]=_0x1d78c6[_0x1c88('0x9a')]['length']?_0x1d78c6[_0x1c88('0x9a')]:_0x35d21e[_0x1c88('0xd')];if(!_0x382606['query'][_0x1c88('0x9b')](_0x1c88('0x9c'))){_0x1d78c6[_0x1c88('0x9d')]=qs[_0x1c88('0x9d')](_0x382606['query'][_0x1c88('0x9d')]);_0x1d78c6[_0x1c88('0x9e')]=qs[_0x1c88('0x9e')](_0x382606[_0x1c88('0x87')][_0x1c88('0x9e')]);}_0x1d78c6[_0x1c88('0x9f')]=qs[_0x1c88('0xa0')](_0x382606['query'][_0x1c88('0xa0')]);_0x1d78c6[_0x1c88('0x85')]=qs[_0x1c88('0xa1')](_['pick'](_0x382606[_0x1c88('0x87')],_0x35d21e[_0x1c88('0xa1')]));if(_0x382606[_0x1c88('0x87')][_0x1c88('0x5')]){_0x1d78c6['where']=_['merge'](_0x1d78c6[_0x1c88('0x85')],{'$or':_[_0x1c88('0xb')](_0x2510d6,function(_0x36fc75){if(_0x36fc75[_0x1c88('0x12')][_0x1c88('0xa2')]!==_0x1c88('0xa3')){var _0x5f10bd={};_0x5f10bd[_0x36fc75[_0x1c88('0x6')]]={'$like':'%'+_0x382606[_0x1c88('0x87')]['filter']+'%'};return _0x5f10bd;}})});}var _0x232805=[];var _0x14a2ca=null;var _0x2a455e={};if(_0x263a62){_0x14a2ca=_[_0x1c88('0x90')](_0x1431e3,[_0x1c88('0xe'),_0x263a62[_0x1c88('0xe')]]);if(_0x14a2ca[_0x1c88('0x6')]){_0x2a455e={};if(_0x16a180[_0x1c88('0x15')]==='AnalyticExtractedReport'){_0x2a455e[_0x14a2ca['foreignKey']]=_[_0x1c88('0xb')](_0x263a62[_0x1c88('0xa')],'id');}else{_0x2a455e[_0x14a2ca[_0x1c88('0xa4')]]=_0x263a62[_0x1c88('0xa')];}_0x232805[_0x1c88('0x95')](_0x2a455e);}else{_0x1d78c6[_0x1c88('0x85')]['id']=_0x263a62['associatedResources'];}}else{for(var _0x439009=0x0;_0x439009<_0x218c1f['length'];_0x439009++){_0x14a2ca=_[_0x1c88('0x90')](_0x1431e3,['name',_0x218c1f[_0x439009][_0x1c88('0xe')]]);if(_0x14a2ca[_0x1c88('0x6')]){_0x2a455e={};_0x2a455e[_0x14a2ca['foreignKey']]=_0x218c1f[_0x439009][_0x1c88('0xa')];_0x232805['push'](_0x2a455e);}else{if(!_0x1d78c6['where']['id'])_0x1d78c6[_0x1c88('0x85')]['id']=[];_0x218c1f[_0x439009][_0x1c88('0xa')][_0x1c88('0xa5')](function(_0x388d3f){_0x1d78c6[_0x1c88('0x85')]['id'][_0x1c88('0x95')](_0x388d3f);});}}}if(!_[_0x1c88('0x8e')](_0x232805)){_0x1d78c6[_0x1c88('0x85')]=_[_0x1c88('0xa6')](_0x1d78c6[_0x1c88('0x85')],{'$and':{'$or':_0x232805}});}_0x1d78c6=_[_0x1c88('0xa6')]({},_0x1d78c6,_0x382606[_0x1c88('0xa7')]);if(_0x263a62&&!_0x263a62[_0x1c88('0x96')]&&_0x16a180['childModel']===_0x1c88('0xa8')){if(_0x382606[_0x1c88('0x87')][_0x1c88('0xa9')]){_0x1d78c6['include']=[{'all':!![]}];}return _0x36b9b7[_0x16a180[_0x1c88('0x15')]][_0x1c88('0x8')](_0x1d78c6)[_0x1c88('0x9')](function(_0x2fe1ba){var _0x17df20=[];_0x2fe1ba[_0x1c88('0xa5')](function(_0x5ade0c){var _0x31d1f9;switch(_0x5ade0c[_0x1c88('0xaa')]){case _0x1c88('0xab'):_0x31d1f9=_[_0x1c88('0x90')](_0x263a62['associatedResources'],function(_0x3eb223){return _0x3eb223['id']===_0x5ade0c[_0x1c88('0x78')]&&_0x3eb223['type']===_0x1c88('0xac');});break;case _0x1c88('0xad'):_0x31d1f9=_[_0x1c88('0x90')](_0x263a62['associatedResources'],function(_0x25f066){return _0x25f066['id']===_0x5ade0c[_0x1c88('0x78')]&&_0x25f066[_0x1c88('0x12')]==='CustomReports';});break;}if(_0x31d1f9)_0x17df20[_0x1c88('0x95')](_0x5ade0c);});_0x185d82['count']=_0x17df20[_0x1c88('0x8f')];_0x185d82[_0x1c88('0xae')]=_0x17df20;return _0x185d82;});}else{return _0x36b9b7[_0x16a180[_0x1c88('0x15')]][_0x1c88('0xaf')]({'where':_0x1d78c6[_0x1c88('0x85')]})[_0x1c88('0x9')](function(_0x38bb4b){_0x185d82['count']=_0x38bb4b;if(_0x382606[_0x1c88('0x87')][_0x1c88('0xa9')]){if(_0x16a180['childModel']==='CmContact'){_0x1d78c6['include']=[{'model':_0x36b9b7[_0x1c88('0x6d')],'as':_0x1c88('0xb0'),'attributes':['id',_0x1c88('0xe'),'color'],'required':_0x382606[_0x1c88('0x87')]['tag']?!![]:![]},{'model':_0x36b9b7[_0x1c88('0x6d')],'as':_0x1c88('0xb1'),'attributes':['id','name',_0x1c88('0xb2')],'through':_0x382606[_0x1c88('0x87')][_0x1c88('0xb3')]?{'attributes':[],'where':{'TagId':_0x382606['query'][_0x1c88('0xb3')]||undefined}}:{},'required':_0x382606[_0x1c88('0x87')][_0x1c88('0xb3')]?!![]:![]}];}else{_0x1d78c6[_0x1c88('0xb4')]=[{'all':!![]}];}}return _0x36b9b7[_0x16a180[_0x1c88('0x15')]][_0x1c88('0x8')](_0x1d78c6);})[_0x1c88('0x9')](function(_0x21ecd9){_0x185d82[_0x1c88('0xae')]=_0x21ecd9;if(_0x40061d===_0x1c88('0x32')&&_0x382606[_0x1c88('0x87')]['openTabs']===_0x1c88('0xb5')){var _0x1037df=[];for(var _0x3e76ed=0x0;_0x3e76ed<_0x185d82[_0x1c88('0xae')][_0x1c88('0x8f')];_0x3e76ed++){_0x1037df['push'](_0x19f1c7('chat',_0x185d82['rows'][_0x3e76ed][_0x1c88('0xb6')]));_0x1037df['push'](_0x19f1c7(_0x1c88('0xb7'),_0x185d82['rows'][_0x3e76ed][_0x1c88('0xb6')]));_0x1037df[_0x1c88('0x95')](_0x19f1c7(_0x1c88('0xb8'),_0x185d82[_0x1c88('0xae')][_0x3e76ed][_0x1c88('0xb6')]));_0x1037df[_0x1c88('0x95')](_0x19f1c7(_0x1c88('0xb9'),_0x185d82[_0x1c88('0xae')][_0x3e76ed][_0x1c88('0xb6')]));_0x1037df[_0x1c88('0x95')](_0x19f1c7(_0x1c88('0xba'),_0x185d82[_0x1c88('0xae')][_0x3e76ed]['dataValues']));_0x1037df[_0x1c88('0x95')](_0x19f1c7('whatsapp',_0x185d82['rows'][_0x3e76ed][_0x1c88('0xb6')]));}return Promise['all'](_0x1037df)['then'](function(){return _0x185d82;});}return _0x185d82;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index af7c25a..f1f12a3 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 _0x761c=['rpc','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','then','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x761c,0x18a));var _0xc761=function(_0xfa0c0b,_0x558d95){_0xfa0c0b=_0xfa0c0b-0x0;var _0x2ee977=_0x761c[_0xfa0c0b];return _0x2ee977;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var moment=require(_0xc761('0x1'));var BPromise=require(_0xc761('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc761('0x3'));var db=require(_0xc761('0x4'))['db'];var utils=require(_0xc761('0x5'));var logger=require('../../config/logger')(_0xc761('0x6'));var config=require('../../config/environment');var jayson=require(_0xc761('0x7'));var client=jayson[_0xc761('0x8')][_0xc761('0x9')]({'port':0x232a});config[_0xc761('0xa')]=_[_0xc761('0xb')](config[_0xc761('0xa')],{'host':_0xc761('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc761('0xa')]));require(_0xc761('0xd'))[_0xc761('0xe')](socket);function respondWithRpcPromise(_0x2440e3,_0x1dd2a0,_0x2bde36){return new BPromise(function(_0x205c96,_0x49add8){return client['request'](_0x2440e3,_0x2bde36)[_0xc761('0xf')](function(_0x4405a2){logger['info']('UserProfile,\x20%s,\x20%s',_0x1dd2a0,_0xc761('0x10'));logger['debug'](_0xc761('0x11'),_0x1dd2a0,'request\x20sent',JSON[_0xc761('0x12')](_0x4405a2));if(_0x4405a2['error']){if(_0x4405a2[_0xc761('0x13')][_0xc761('0x14')]===0x1f4){logger[_0xc761('0x13')](_0xc761('0x15'),_0x1dd2a0,_0x4405a2[_0xc761('0x13')][_0xc761('0x16')]);return _0x49add8(_0x4405a2[_0xc761('0x13')]['message']);}logger['error'](_0xc761('0x15'),_0x1dd2a0,_0x4405a2[_0xc761('0x13')][_0xc761('0x16')]);return _0x205c96(_0x4405a2['error'][_0xc761('0x16')]);}else{logger[_0xc761('0x17')](_0xc761('0x15'),_0x1dd2a0,_0xc761('0x10'));_0x205c96(_0x4405a2[_0xc761('0x18')]['message']);}})['catch'](function(_0x505b5c){logger[_0xc761('0x13')]('UserProfile,\x20%s,\x20%s',_0x1dd2a0,_0x505b5c);_0x49add8(_0x505b5c);});});} \ No newline at end of file +var _0x3714=['rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x3714,0x95));var _0x4371=function(_0x370187,_0x25796f){_0x370187=_0x370187-0x0;var _0x47890c=_0x3714[_0x370187];return _0x47890c;};'use strict';var _=require(_0x4371('0x0'));var util=require(_0x4371('0x1'));var moment=require('moment');var BPromise=require(_0x4371('0x2'));var rs=require(_0x4371('0x3'));var fs=require('fs');var Redis=require(_0x4371('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4371('0x5'));var logger=require(_0x4371('0x6'))(_0x4371('0x7'));var config=require('../../config/environment');var jayson=require(_0x4371('0x8'));var client=jayson['client'][_0x4371('0x9')]({'port':0x232a});config[_0x4371('0xa')]=_['defaults'](config[_0x4371('0xa')],{'host':_0x4371('0xb'),'port':0x18eb});var socket=require(_0x4371('0xc'))(new Redis(config[_0x4371('0xa')]));require('./userProfile.socket')[_0x4371('0xd')](socket);function respondWithRpcPromise(_0x54c547,_0x38842e,_0x80ea6e){return new BPromise(function(_0x1bf105,_0x3dedb6){return client['request'](_0x54c547,_0x80ea6e)[_0x4371('0xe')](function(_0x263143){logger['info'](_0x4371('0xf'),_0x38842e,_0x4371('0x10'));logger[_0x4371('0x11')](_0x4371('0x12'),_0x38842e,_0x4371('0x10'),JSON[_0x4371('0x13')](_0x263143));if(_0x263143[_0x4371('0x14')]){if(_0x263143[_0x4371('0x14')][_0x4371('0x15')]===0x1f4){logger[_0x4371('0x14')](_0x4371('0xf'),_0x38842e,_0x263143['error'][_0x4371('0x16')]);return _0x3dedb6(_0x263143[_0x4371('0x14')][_0x4371('0x16')]);}logger['error'](_0x4371('0xf'),_0x38842e,_0x263143[_0x4371('0x14')][_0x4371('0x16')]);return _0x1bf105(_0x263143[_0x4371('0x14')][_0x4371('0x16')]);}else{logger[_0x4371('0x17')](_0x4371('0xf'),_0x38842e,_0x4371('0x10'));_0x1bf105(_0x263143[_0x4371('0x18')][_0x4371('0x16')]);}})[_0x4371('0x19')](function(_0x31b07e){logger[_0x4371('0x14')]('UserProfile,\x20%s,\x20%s',_0x38842e,_0x31b07e);_0x3dedb6(_0x31b07e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index ded7d52..dbfaf6f 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 _0xc860=['userProfile:','./userProfile.events','remove','update','emit','removeListener','register'];(function(_0x3c479d,_0x3fdaee){var _0x4bc914=function(_0xb93546){while(--_0xb93546){_0x3c479d['push'](_0x3c479d['shift']());}};_0x4bc914(++_0x3fdaee);}(_0xc860,0x78));var _0x0c86=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0xc860[_0x3b96cf];return _0x2e315a;};'use strict';var UserProfileEvents=require(_0x0c86('0x0'));var events=['save',_0x0c86('0x1'),_0x0c86('0x2')];function createListener(_0x1bf50c,_0x133f0a){return function(_0x4d31a5){_0x133f0a[_0x0c86('0x3')](_0x1bf50c,_0x4d31a5);};}function removeListener(_0x57deef,_0x20fdda){return function(){UserProfileEvents[_0x0c86('0x4')](_0x57deef,_0x20fdda);};}exports[_0x0c86('0x5')]=function(_0x536b96){for(var _0x4c58d1=0x0,_0x520c18=events['length'];_0x4c58d1<_0x520c18;_0x4c58d1++){var _0x24bdf8=events[_0x4c58d1];var _0x2c43a1=createListener(_0x0c86('0x6')+_0x24bdf8,_0x536b96);UserProfileEvents['on'](_0x24bdf8,_0x2c43a1);}}; \ No newline at end of file +var _0x194c=['userProfile:','remove','emit','removeListener','length'];(function(_0x2bcb7c,_0x401e10){var _0x5d96b3=function(_0x3888f4){while(--_0x3888f4){_0x2bcb7c['push'](_0x2bcb7c['shift']());}};_0x5d96b3(++_0x401e10);}(_0x194c,0x114));var _0xc194=function(_0x111493,_0xe2d011){_0x111493=_0x111493-0x0;var _0x5ae288=_0x194c[_0x111493];return _0x5ae288;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0xc194('0x0'),'update'];function createListener(_0xfb99ef,_0x5e9079){return function(_0x2d97ac){_0x5e9079[_0xc194('0x1')](_0xfb99ef,_0x2d97ac);};}function removeListener(_0x353da7,_0xebf0b9){return function(){UserProfileEvents[_0xc194('0x2')](_0x353da7,_0xebf0b9);};}exports['register']=function(_0x190180){for(var _0x1d1f33=0x0,_0x98e941=events[_0xc194('0x3')];_0x1d1f33<_0x98e941;_0x1d1f33++){var _0x38bb30=events[_0x1d1f33];var _0x3255d9=createListener(_0xc194('0x4')+_0x38bb30,_0x190180);UserProfileEvents['on'](_0x38bb30,_0x3255d9);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 477c597..59085f7 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 _0xd2a5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4b75e8,_0x5ffa1a){var _0x459c6f=function(_0x457182){while(--_0x457182){_0x4b75e8['push'](_0x4b75e8['shift']());}};_0x459c6f(++_0x5ffa1a);}(_0xd2a5,0x8a));var _0x5d2a=function(_0x436641,_0x4afca2){_0x436641=_0x436641-0x0;var _0x29e38f=_0xd2a5[_0x436641];return _0x29e38f;};'use strict';var multer=require(_0x5d2a('0x0'));var util=require(_0x5d2a('0x1'));var path=require(_0x5d2a('0x2'));var timeout=require(_0x5d2a('0x3'));var express=require(_0x5d2a('0x4'));var router=express[_0x5d2a('0x5')]();var fs_extra=require(_0x5d2a('0x6'));var auth=require(_0x5d2a('0x7'));var interaction=require(_0x5d2a('0x8'));var config=require(_0x5d2a('0x9'));var controller=require(_0x5d2a('0xa'));router[_0x5d2a('0xb')]('/',auth[_0x5d2a('0xc')](),controller['index']);router['get'](_0x5d2a('0xd'),auth[_0x5d2a('0xc')](),controller[_0x5d2a('0xe')]);router[_0x5d2a('0xb')](_0x5d2a('0xf'),auth['isAuthenticated'](),controller[_0x5d2a('0x10')]);router[_0x5d2a('0x11')]('/',auth['isAuthenticated'](),controller[_0x5d2a('0x12')]);router[_0x5d2a('0x13')](_0x5d2a('0xf'),auth[_0x5d2a('0xc')](),controller[_0x5d2a('0x14')]);router[_0x5d2a('0x15')](_0x5d2a('0xf'),auth[_0x5d2a('0xc')](),controller[_0x5d2a('0x16')]);module[_0x5d2a('0x17')]=router; \ No newline at end of file +var _0x2a00=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x233602,_0x24afe3){var _0x214483=function(_0x588886){while(--_0x588886){_0x233602['push'](_0x233602['shift']());}};_0x214483(++_0x24afe3);}(_0x2a00,0x1c8));var _0x02a0=function(_0x39d001,_0x1f6e72){_0x39d001=_0x39d001-0x0;var _0x1f2910=_0x2a00[_0x39d001];return _0x1f2910;};'use strict';var multer=require(_0x02a0('0x0'));var util=require(_0x02a0('0x1'));var path=require(_0x02a0('0x2'));var timeout=require('connect-timeout');var express=require(_0x02a0('0x3'));var router=express[_0x02a0('0x4')]();var fs_extra=require(_0x02a0('0x5'));var auth=require(_0x02a0('0x6'));var interaction=require(_0x02a0('0x7'));var config=require(_0x02a0('0x8'));var controller=require('./userProfileResource.controller');router[_0x02a0('0x9')]('/',auth[_0x02a0('0xa')](),controller['index']);router['get'](_0x02a0('0xb'),auth[_0x02a0('0xa')](),controller[_0x02a0('0xc')]);router[_0x02a0('0x9')](_0x02a0('0xd'),auth['isAuthenticated'](),controller[_0x02a0('0xe')]);router[_0x02a0('0xf')]('/',auth['isAuthenticated'](),controller[_0x02a0('0x10')]);router[_0x02a0('0x11')]('/:id',auth[_0x02a0('0xa')](),controller[_0x02a0('0x12')]);router[_0x02a0('0x13')](_0x02a0('0xd'),auth[_0x02a0('0xa')](),controller[_0x02a0('0x14')]);module[_0x02a0('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 97c4ae6..54ff364 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 _0xc08b=['INTEGER'];(function(_0x474c4d,_0x1b0749){var _0x540f26=function(_0x1f1d5c){while(--_0x1f1d5c){_0x474c4d['push'](_0x474c4d['shift']());}};_0x540f26(++_0x1b0749);}(_0xc08b,0x15b));var _0xbc08=function(_0x302b4b,_0x1e8c5b){_0x302b4b=_0x302b4b-0x0;var _0x35a709=_0xc08b[_0x302b4b];return _0x35a709;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xbc08('0x0')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa9b9=['STRING','sequelize','exports','INTEGER'];(function(_0x49ed2a,_0xa4c9dc){var _0x7cd69b=function(_0x395969){while(--_0x395969){_0x49ed2a['push'](_0x49ed2a['shift']());}};_0x7cd69b(++_0xa4c9dc);}(_0xa9b9,0x191));var _0x9a9b=function(_0x310043,_0x435e95){_0x310043=_0x310043-0x0;var _0x43283d=_0xa9b9[_0x310043];return _0x43283d;};'use strict';var Sequelize=require(_0x9a9b('0x0'));module[_0x9a9b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a9b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9a9b('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 5ffe06b..8db84f1 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 _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x31a312,_0x2d5e6b){var _0x463a17=function(_0x5e1e4f){while(--_0x5e1e4f){_0x31a312['push'](_0x31a312['shift']());}};_0x463a17(++_0x2d5e6b);}(_0x4975,0x86));var _0x5497=function(_0x9ab62,_0x114e2a){_0x9ab62=_0x9ab62-0x0;var _0x41b3e4=_0x4975[_0x9ab62];return _0x41b3e4;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file +var _0xc2c7=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x57bd27,_0x2d45d6){var _0x55d683=function(_0x31ac1d){while(--_0x31ac1d){_0x57bd27['push'](_0x57bd27['shift']());}};_0x55d683(++_0x2d45d6);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4f2d5e,_0x5c6632){_0x4f2d5e=_0x4f2d5e-0x0;var _0x3b16f4=_0xc2c7[_0x4f2d5e];return _0x3b16f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['UserProfileResource'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['UserProfileResource'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};exports['describe']=function(_0x13e0bf,_0x11d337){return db['UserProfileResource'][_0x7c2c('0x49')]()[_0x7c2c('0x26')](respondWithResult(_0x11d337,null))['catch'](handleError(_0x11d337,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f0b7042..1819040 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 _0x5d06=['define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x30173c,_0x599eb2){var _0x210c49=function(_0x3f0159){while(--_0x3f0159){_0x30173c['push'](_0x30173c['shift']());}};_0x210c49(++_0x599eb2);}(_0x5d06,0x1c8));var _0x65d0=function(_0x1bb799,_0x156b59){_0x1bb799=_0x1bb799-0x0;var _0x170d7b=_0x5d06[_0x1bb799];return _0x170d7b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x65d0('0x0'))(_0x65d0('0x1'));var moment=require(_0x65d0('0x2'));var BPromise=require(_0x65d0('0x3'));var rp=require(_0x65d0('0x4'));var fs=require('fs');var path=require(_0x65d0('0x5'));var rimraf=require(_0x65d0('0x6'));var config=require(_0x65d0('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x65d0('0x8')]=function(_0x319710,_0x367ad2){return _0x319710[_0x65d0('0x9')](_0x65d0('0xa'),attributes,{'tableName':_0x65d0('0xb'),'paranoid':![],'indexes':[{'name':_0x65d0('0xc'),'fields':[_0x65d0('0xd'),_0x65d0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8fd=['path','./userProfileResource.attributes','exports','compositeIndex','resourceId','../../config/logger','api','moment'];(function(_0xf8006c,_0x3eab8a){var _0x483b15=function(_0x50dfb5){while(--_0x50dfb5){_0xf8006c['push'](_0xf8006c['shift']());}};_0x483b15(++_0x3eab8a);}(_0xa8fd,0x12d));var _0xda8f=function(_0x56e469,_0x134f1f){_0x56e469=_0x56e469-0x0;var _0x459c64=_0xa8fd[_0x56e469];return _0x459c64;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xda8f('0x0'))(_0xda8f('0x1'));var moment=require(_0xda8f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xda8f('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xda8f('0x4'));module[_0xda8f('0x5')]=function(_0xe54d06,_0x2549a3){return _0xe54d06['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xda8f('0x6'),'fields':[_0xda8f('0x7'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 3d62005..398dc0f 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 _0xde31=['request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','error','code','UserProfileResource,\x20%s,\x20%s','message'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xde31,0x10d));var _0x1de3=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0xde31[_0x485f35];return _0x2ad118;};'use strict';var _=require(_0x1de3('0x0'));var util=require('util');var moment=require(_0x1de3('0x1'));var BPromise=require(_0x1de3('0x2'));var rs=require(_0x1de3('0x3'));var fs=require('fs');var Redis=require(_0x1de3('0x4'));var db=require(_0x1de3('0x5'))['db'];var utils=require(_0x1de3('0x6'));var logger=require(_0x1de3('0x7'))(_0x1de3('0x8'));var config=require(_0x1de3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1de3('0xa')][_0x1de3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e94e0,_0x12ed87,_0x46abfb){return new BPromise(function(_0x1271c2,_0xf786fd){return client['request'](_0x4e94e0,_0x46abfb)['then'](function(_0x504092){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x12ed87,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x12ed87,'request\x20sent',JSON['stringify'](_0x504092));if(_0x504092['error']){if(_0x504092[_0x1de3('0xc')][_0x1de3('0xd')]===0x1f4){logger[_0x1de3('0xc')](_0x1de3('0xe'),_0x12ed87,_0x504092[_0x1de3('0xc')][_0x1de3('0xf')]);return _0xf786fd(_0x504092[_0x1de3('0xc')]['message']);}logger[_0x1de3('0xc')](_0x1de3('0xe'),_0x12ed87,_0x504092['error'][_0x1de3('0xf')]);return _0x1271c2(_0x504092[_0x1de3('0xc')][_0x1de3('0xf')]);}else{logger['info'](_0x1de3('0xe'),_0x12ed87,_0x1de3('0x10'));_0x1271c2(_0x504092[_0x1de3('0x11')][_0x1de3('0xf')]);}})[_0x1de3('0x12')](function(_0x41a8b4){logger[_0x1de3('0xc')](_0x1de3('0xe'),_0x12ed87,_0x41a8b4);_0xf786fd(_0x41a8b4);});});} \ No newline at end of file +var _0xedb7=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','util','moment','randomstring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xedb7,0x10d));var _0x7edb=function(_0x47a458,_0x1bb067){_0x47a458=_0x47a458-0x0;var _0x33e2ab=_0xedb7[_0x47a458];return _0x33e2ab;};'use strict';var _=require('lodash');var util=require(_0x7edb('0x0'));var moment=require(_0x7edb('0x1'));var BPromise=require('bluebird');var rs=require(_0x7edb('0x2'));var fs=require('fs');var Redis=require(_0x7edb('0x3'));var db=require(_0x7edb('0x4'))['db'];var utils=require(_0x7edb('0x5'));var logger=require('../../config/logger')(_0x7edb('0x6'));var config=require(_0x7edb('0x7'));var jayson=require(_0x7edb('0x8'));var client=jayson[_0x7edb('0x9')][_0x7edb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b83e3,_0x16fe1f,_0x48837c){return new BPromise(function(_0x1af0e0,_0x1db3b5){return client[_0x7edb('0xb')](_0x5b83e3,_0x48837c)[_0x7edb('0xc')](function(_0x49372a){logger['info'](_0x7edb('0xd'),_0x16fe1f,'request\x20sent');logger['debug'](_0x7edb('0xe'),_0x16fe1f,_0x7edb('0xf'),JSON[_0x7edb('0x10')](_0x49372a));if(_0x49372a[_0x7edb('0x11')]){if(_0x49372a[_0x7edb('0x11')][_0x7edb('0x12')]===0x1f4){logger[_0x7edb('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x16fe1f,_0x49372a['error'][_0x7edb('0x13')]);return _0x1db3b5(_0x49372a['error'][_0x7edb('0x13')]);}logger[_0x7edb('0x11')](_0x7edb('0xd'),_0x16fe1f,_0x49372a[_0x7edb('0x11')][_0x7edb('0x13')]);return _0x1af0e0(_0x49372a['error'][_0x7edb('0x13')]);}else{logger[_0x7edb('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x16fe1f,'request\x20sent');_0x1af0e0(_0x49372a['result']['message']);}})['catch'](function(_0x21674e){logger[_0x7edb('0x11')](_0x7edb('0xd'),_0x16fe1f,_0x21674e);_0x1db3b5(_0x21674e);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1ca4751..5302d6f 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 _0x1066=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x33bbca,_0x231476){var _0x25773d=function(_0x4f8b08){while(--_0x4f8b08){_0x33bbca['push'](_0x33bbca['shift']());}};_0x25773d(++_0x231476);}(_0x1066,0x1d2));var _0x6106=function(_0x4debc2,_0x359d4d){_0x4debc2=_0x4debc2-0x0;var _0x24a4db=_0x1066[_0x4debc2];return _0x24a4db;};'use strict';var multer=require(_0x6106('0x0'));var util=require(_0x6106('0x1'));var path=require('path');var timeout=require(_0x6106('0x2'));var express=require(_0x6106('0x3'));var router=express[_0x6106('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6106('0x5'));var interaction=require(_0x6106('0x6'));var config=require('../../config/environment');var controller=require(_0x6106('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6106('0x8')]);router[_0x6106('0x9')](_0x6106('0xa'),auth[_0x6106('0xb')](),controller[_0x6106('0xc')]);router[_0x6106('0x9')](_0x6106('0xd'),auth[_0x6106('0xb')](),controller[_0x6106('0xe')]);router[_0x6106('0xf')]('/',auth[_0x6106('0xb')](),controller[_0x6106('0x10')]);router['put'](_0x6106('0xd'),auth['isAuthenticated'](),controller[_0x6106('0x11')]);router[_0x6106('0x12')](_0x6106('0xd'),auth[_0x6106('0xb')](),controller[_0x6106('0x13')]);module[_0x6106('0x14')]=router; \ No newline at end of file +var _0x596a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','describe','get','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x4fcc2f,_0x1c9a30){var _0x184859=function(_0x1b8416){while(--_0x1b8416){_0x4fcc2f['push'](_0x4fcc2f['shift']());}};_0x184859(++_0x1c9a30);}(_0x596a,0x1a0));var _0xa596=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x596a[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xa596('0x0'));var util=require(_0xa596('0x1'));var path=require('path');var timeout=require(_0xa596('0x2'));var express=require(_0xa596('0x3'));var router=express[_0xa596('0x4')]();var fs_extra=require(_0xa596('0x5'));var auth=require(_0xa596('0x6'));var interaction=require(_0xa596('0x7'));var config=require(_0xa596('0x8'));var controller=require(_0xa596('0x9'));router['get']('/',auth[_0xa596('0xa')](),controller[_0xa596('0xb')]);router['get'](_0xa596('0xc'),auth[_0xa596('0xa')](),controller[_0xa596('0xd')]);router[_0xa596('0xe')](_0xa596('0xf'),auth[_0xa596('0xa')](),controller['show']);router[_0xa596('0x10')]('/',auth[_0xa596('0xa')](),controller[_0xa596('0x11')]);router[_0xa596('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa596('0x13')]);router['delete'](_0xa596('0xf'),auth['isAuthenticated'](),controller[_0xa596('0x14')]);module[_0xa596('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 0346a72..52369f0 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 _0x1eba=['join','getDataValue','split','sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x33c246,_0x3b9846){var _0x4734fb=function(_0x352044){while(--_0x352044){_0x33c246['push'](_0x33c246['shift']());}};_0x4734fb(++_0x3b9846);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x1eba[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xa1eb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa1eb('0x2')],'set':function(_0x34be5a){this[_0xa1eb('0x4')](_0xa1eb('0x5'),_0x34be5a?_0x34be5a[_0xa1eb('0x6')](''):[]);},'get':function(){return this[_0xa1eb('0x7')](_0xa1eb('0x5'))?this[_0xa1eb('0x7')](_0xa1eb('0x5'))[_0xa1eb('0x8')](''):[];}}}; \ No newline at end of file +var _0xac4a=['setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x39223f,_0x43c3c4){var _0x3f934a=function(_0x1bddd6){while(--_0x1bddd6){_0x39223f['push'](_0x39223f['shift']());}};_0x3f934a(++_0x43c3c4);}(_0xac4a,0x13f));var _0xaac4=function(_0x1694a2,_0x821983){_0x1694a2=_0x1694a2-0x0;var _0x1e17bf=_0xac4a[_0x1694a2];return _0x1e17bf;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'name':{'type':Sequelize[_0xaac4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xaac4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaac4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2af0f6){this[_0xaac4('0x5')](_0xaac4('0x6'),_0x2af0f6?_0x2af0f6['join'](''):[]);},'get':function(){return this[_0xaac4('0x7')]('crudPermissions')?this[_0xaac4('0x7')]('crudPermissions')[_0xaac4('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 85359ab..e7a3d7b 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 _0x052f=['fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','update','then','destroy','name','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x1185bb,_0x4f78ed){var _0x24f63f=function(_0x1322ad){while(--_0x1322ad){_0x1185bb['push'](_0x1185bb['shift']());}};_0x24f63f(++_0x4f78ed);}(_0x052f,0xf3));var _0xf052=function(_0x28bceb,_0x2d265c){_0x28bceb=_0x28bceb-0x0;var _0x30de7f=_0x052f[_0x28bceb];return _0x30de7f;};'use strict';var emlformat=require(_0xf052('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf052('0x1'));var jsonpatch=require(_0xf052('0x2'));var rp=require(_0xf052('0x3'));var moment=require(_0xf052('0x4'));var BPromise=require(_0xf052('0x5'));var Mustache=require(_0xf052('0x6'));var util=require(_0xf052('0x7'));var path=require(_0xf052('0x8'));var sox=require(_0xf052('0x9'));var csv=require('to-csv');var ejs=require(_0xf052('0xa'));var fs=require('fs');var fs_extra=require(_0xf052('0xb'));var _=require(_0xf052('0xc'));var squel=require('squel');var crypto=require(_0xf052('0xd'));var jsforce=require(_0xf052('0xe'));var deskjs=require(_0xf052('0xf'));var toCsv=require(_0xf052('0x10'));var querystring=require(_0xf052('0x11'));var Papa=require(_0xf052('0x12'));var Redis=require(_0xf052('0x13'));var authService=require(_0xf052('0x14'));var qs=require(_0xf052('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf052('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf052('0x17'));var licenseUtil=require(_0xf052('0x18'));var db=require(_0xf052('0x19'))['db'];function respondWithStatusCode(_0x5e8d81,_0x426a2c){_0x426a2c=_0x426a2c||0xcc;return function(_0x1e9d4f){if(_0x1e9d4f){return _0x5e8d81[_0xf052('0x1a')](_0x426a2c);}return _0x5e8d81[_0xf052('0x1b')](_0x426a2c)[_0xf052('0x1c')]();};}function respondWithResult(_0x55301c,_0xcd27a3){_0xcd27a3=_0xcd27a3||0xc8;return function(_0x584de2){if(_0x584de2){return _0x55301c['status'](_0xcd27a3)[_0xf052('0x1d')](_0x584de2);}};}function respondWithFilteredResult(_0x31ee16,_0x563e26){return function(_0x4ec33d){if(_0x4ec33d){var _0x12e23f=typeof _0x563e26[_0xf052('0x1e')]===_0xf052('0x1f')&&typeof _0x563e26['limit']===_0xf052('0x1f');var _0x2335d1=_0x4ec33d[_0xf052('0x20')];var _0x2f66b0=_0x12e23f?0x0:_0x563e26[_0xf052('0x1e')];var _0x532916=_0x12e23f?_0x4ec33d[_0xf052('0x20')]:_0x563e26[_0xf052('0x1e')]+_0x563e26[_0xf052('0x21')];var _0x5df963;if(_0x532916>=_0x2335d1){_0x532916=_0x2335d1;_0x5df963=0xc8;}else{_0x5df963=0xce;}_0x31ee16[_0xf052('0x1b')](_0x5df963);return _0x31ee16['set']('Content-Range',_0x2f66b0+'-'+_0x532916+'/'+_0x2335d1)[_0xf052('0x1d')](_0x4ec33d);}return null;};}function patchUpdates(_0x4476a8){return function(_0x46d077){try{jsonpatch['apply'](_0x46d077,_0x4476a8,!![]);}catch(_0x49d166){return BPromise[_0xf052('0x22')](_0x49d166);}return _0x46d077[_0xf052('0x23')]();};}function saveUpdates(_0x2954a6,_0x1e35ca){return function(_0x3ddd42){if(_0x3ddd42){return _0x3ddd42[_0xf052('0x24')](_0x2954a6)[_0xf052('0x25')](function(_0x129942){return _0x129942;});}return null;};}function removeEntity(_0x2241a0,_0x425d10){return function(_0x47699c){if(_0x47699c){return _0x47699c[_0xf052('0x26')]()['then'](function(){_0x2241a0[_0xf052('0x1b')](0xcc)[_0xf052('0x1c')]();});}};}function handleEntityNotFound(_0x46beac,_0x46864f){return function(_0x264731){if(!_0x264731){_0x46beac[_0xf052('0x1a')](0x194);}return _0x264731;};}function handleError(_0x11545,_0x12e227){_0x12e227=_0x12e227||0x1f4;return function(_0x1d3bf7){logger['error'](_0x1d3bf7['stack']);if(_0x1d3bf7['name']){delete _0x1d3bf7[_0xf052('0x27')];}_0x11545[_0xf052('0x1b')](_0x12e227)[_0xf052('0x28')](_0x1d3bf7);};}exports[_0xf052('0x29')]=function(_0x35292f,_0x2dc280){var _0x505754={},_0x59013f={},_0x2d4580={'count':0x0,'rows':[]};var _0x33f27b=_[_0xf052('0x2a')](db[_0xf052('0x2b')][_0xf052('0x2c')],function(_0x4c7ff3){return{'name':_0x4c7ff3['fieldName'],'type':_0x4c7ff3[_0xf052('0x2d')][_0xf052('0x2e')]};});_0x59013f[_0xf052('0x2f')]=_[_0xf052('0x2a')](_0x33f27b,_0xf052('0x27'));_0x59013f[_0xf052('0x30')]=_[_0xf052('0x31')](_0x35292f[_0xf052('0x30')]);_0x59013f[_0xf052('0x32')]=_[_0xf052('0x33')](_0x59013f[_0xf052('0x2f')],_0x59013f[_0xf052('0x30')]);_0x505754[_0xf052('0x34')]=_['intersection'](_0x59013f[_0xf052('0x2f')],qs['fields'](_0x35292f[_0xf052('0x30')][_0xf052('0x35')]));_0x505754[_0xf052('0x34')]=_0x505754[_0xf052('0x34')][_0xf052('0x36')]?_0x505754['attributes']:_0x59013f[_0xf052('0x2f')];if(!_0x35292f['query']['hasOwnProperty'](_0xf052('0x37'))){_0x505754[_0xf052('0x21')]=qs['limit'](_0x35292f[_0xf052('0x30')][_0xf052('0x21')]);_0x505754['offset']=qs[_0xf052('0x1e')](_0x35292f[_0xf052('0x30')][_0xf052('0x1e')]);}_0x505754[_0xf052('0x38')]=qs[_0xf052('0x39')](_0x35292f[_0xf052('0x30')]['sort']);_0x505754[_0xf052('0x3a')]=qs[_0xf052('0x32')](_[_0xf052('0x3b')](_0x35292f[_0xf052('0x30')],_0x59013f['filters']),_0x33f27b);if(_0x35292f[_0xf052('0x30')][_0xf052('0x3c')]){_0x505754[_0xf052('0x3a')]=_[_0xf052('0x3d')](_0x505754[_0xf052('0x3a')],{'$or':_[_0xf052('0x2a')](_0x33f27b,function(_0x6ebe82){if(_0x6ebe82[_0xf052('0x2d')]!=='VIRTUAL'){var _0x292071={};_0x292071[_0x6ebe82[_0xf052('0x27')]]={'$like':'%'+_0x35292f[_0xf052('0x30')][_0xf052('0x3c')]+'%'};return _0x292071;}})});}_0x505754=_[_0xf052('0x3d')]({},_0x505754,_0x35292f['options']);var _0x4ddf01={'where':_0x505754[_0xf052('0x3a')]};return db[_0xf052('0x2b')][_0xf052('0x20')](_0x4ddf01)['then'](function(_0x23a34e){_0x2d4580['count']=_0x23a34e;if(_0x35292f[_0xf052('0x30')][_0xf052('0x3e')]){_0x505754[_0xf052('0x3f')]=[{'all':!![]}];}return db[_0xf052('0x2b')][_0xf052('0x40')](_0x505754);})[_0xf052('0x25')](function(_0x2e9575){_0x2d4580[_0xf052('0x41')]=_0x2e9575;return _0x2d4580;})[_0xf052('0x25')](respondWithFilteredResult(_0x2dc280,_0x505754))['catch'](handleError(_0x2dc280,null));};exports[_0xf052('0x42')]=function(_0x23ea66,_0x50fa24){var _0x55d5f2={'raw':![],'where':{'id':_0x23ea66['params']['id']}},_0x361872={};_0x361872[_0xf052('0x2f')]=_['keys'](db['UserProfileSection'][_0xf052('0x2c')]);_0x361872['query']=_[_0xf052('0x31')](_0x23ea66[_0xf052('0x30')]);_0x361872['filters']=_[_0xf052('0x33')](_0x361872['model'],_0x361872[_0xf052('0x30')]);_0x55d5f2[_0xf052('0x34')]=_[_0xf052('0x33')](_0x361872[_0xf052('0x2f')],qs[_0xf052('0x35')](_0x23ea66[_0xf052('0x30')][_0xf052('0x35')]));_0x55d5f2[_0xf052('0x34')]=_0x55d5f2[_0xf052('0x34')][_0xf052('0x36')]?_0x55d5f2[_0xf052('0x34')]:_0x361872['model'];if(_0x23ea66[_0xf052('0x30')][_0xf052('0x3e')]){_0x55d5f2[_0xf052('0x3f')]=[{'all':!![]}];}_0x55d5f2=_[_0xf052('0x3d')]({},_0x55d5f2,_0x23ea66[_0xf052('0x43')]);return db[_0xf052('0x2b')][_0xf052('0x44')](_0x55d5f2)['then'](handleEntityNotFound(_0x50fa24,null))[_0xf052('0x25')](respondWithResult(_0x50fa24,null))[_0xf052('0x45')](handleError(_0x50fa24,null));};exports[_0xf052('0x46')]=function(_0x5bea26,_0x5d89cb){return db['UserProfileSection'][_0xf052('0x46')](_0x5bea26['body'],{})[_0xf052('0x25')](respondWithResult(_0x5d89cb,0xc9))[_0xf052('0x45')](handleError(_0x5d89cb,null));};exports['update']=function(_0x17fe1f,_0x2adb1d){if(_0x17fe1f[_0xf052('0x47')]['id']){delete _0x17fe1f[_0xf052('0x47')]['id'];}return db['UserProfileSection'][_0xf052('0x44')]({'where':{'id':_0x17fe1f[_0xf052('0x48')]['id']}})[_0xf052('0x25')](handleEntityNotFound(_0x2adb1d,null))[_0xf052('0x25')](saveUpdates(_0x17fe1f[_0xf052('0x47')],null))[_0xf052('0x25')](respondWithResult(_0x2adb1d,null))['catch'](handleError(_0x2adb1d,null));};exports[_0xf052('0x26')]=function(_0x510b91,_0x483b4f){return db[_0xf052('0x2b')][_0xf052('0x44')]({'where':{'id':_0x510b91['params']['id']}})['then'](handleEntityNotFound(_0x483b4f,null))['then'](removeEntity(_0x483b4f,null))['catch'](handleError(_0x483b4f,null));};exports[_0xf052('0x49')]=function(_0x37fbc7,_0x5bd7d7){return db[_0xf052('0x2b')]['describe']()[_0xf052('0x25')](respondWithResult(_0x5bd7d7,null))[_0xf052('0x45')](handleError(_0x5bd7d7,null));}; \ No newline at end of file +var _0xf56d=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','limit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x235ad6,_0x5e4437){var _0x2885d9=function(_0x3e55ba){while(--_0x3e55ba){_0x235ad6['push'](_0x235ad6['shift']());}};_0x2885d9(++_0x5e4437);}(_0xf56d,0x81));var _0xdf56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf56d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdf56('0x0'));var rimraf=require(_0xdf56('0x1'));var zipdir=require(_0xdf56('0x2'));var jsonpatch=require(_0xdf56('0x3'));var rp=require(_0xdf56('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdf56('0x5'));var csv=require(_0xdf56('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf56('0x7'));var _=require('lodash');var squel=require(_0xdf56('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdf56('0x9'));var Papa=require(_0xdf56('0xa'));var Redis=require('ioredis');var authService=require(_0xdf56('0xb'));var qs=require(_0xdf56('0xc'));var as=require(_0xdf56('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf56('0xe'))(_0xdf56('0xf'));var utils=require(_0xdf56('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xdf56('0x11'));var db=require(_0xdf56('0x12'))['db'];function respondWithStatusCode(_0x561cd9,_0x921c99){_0x921c99=_0x921c99||0xcc;return function(_0x311d4e){if(_0x311d4e){return _0x561cd9[_0xdf56('0x13')](_0x921c99);}return _0x561cd9['status'](_0x921c99)[_0xdf56('0x14')]();};}function respondWithResult(_0x30e6b2,_0x4ca731){_0x4ca731=_0x4ca731||0xc8;return function(_0x231add){if(_0x231add){return _0x30e6b2['status'](_0x4ca731)[_0xdf56('0x15')](_0x231add);}};}function respondWithFilteredResult(_0x358106,_0x3a9ba4){return function(_0x102fc4){if(_0x102fc4){var _0x10d8ff=typeof _0x3a9ba4[_0xdf56('0x16')]===_0xdf56('0x17')&&typeof _0x3a9ba4['limit']===_0xdf56('0x17');var _0x4d6b14=_0x102fc4[_0xdf56('0x18')];var _0x9cca16=_0x10d8ff?0x0:_0x3a9ba4[_0xdf56('0x16')];var _0x32cbe9=_0x10d8ff?_0x102fc4[_0xdf56('0x18')]:_0x3a9ba4[_0xdf56('0x16')]+_0x3a9ba4['limit'];var _0xa1d299;if(_0x32cbe9>=_0x4d6b14){_0x32cbe9=_0x4d6b14;_0xa1d299=0xc8;}else{_0xa1d299=0xce;}_0x358106['status'](_0xa1d299);return _0x358106[_0xdf56('0x19')](_0xdf56('0x1a'),_0x9cca16+'-'+_0x32cbe9+'/'+_0x4d6b14)['json'](_0x102fc4);}return null;};}function patchUpdates(_0x5406b9){return function(_0x2876eb){try{jsonpatch[_0xdf56('0x1b')](_0x2876eb,_0x5406b9,!![]);}catch(_0x45d91a){return BPromise[_0xdf56('0x1c')](_0x45d91a);}return _0x2876eb[_0xdf56('0x1d')]();};}function saveUpdates(_0x10c423,_0xbf6453){return function(_0x3d9343){if(_0x3d9343){return _0x3d9343[_0xdf56('0x1e')](_0x10c423)[_0xdf56('0x1f')](function(_0x23a14a){return _0x23a14a;});}return null;};}function removeEntity(_0x24f5c0,_0x38caca){return function(_0x52f3f7){if(_0x52f3f7){return _0x52f3f7[_0xdf56('0x20')]()['then'](function(){_0x24f5c0[_0xdf56('0x21')](0xcc)[_0xdf56('0x14')]();});}};}function handleEntityNotFound(_0x1a0261,_0x2c7725){return function(_0x2d244e){if(!_0x2d244e){_0x1a0261[_0xdf56('0x13')](0x194);}return _0x2d244e;};}function handleError(_0x4406d2,_0x1e2129){_0x1e2129=_0x1e2129||0x1f4;return function(_0x167404){logger[_0xdf56('0x22')](_0x167404[_0xdf56('0x23')]);if(_0x167404[_0xdf56('0x24')]){delete _0x167404['name'];}_0x4406d2[_0xdf56('0x21')](_0x1e2129)[_0xdf56('0x25')](_0x167404);};}exports[_0xdf56('0x26')]=function(_0x2cc619,_0x4dcea5){var _0xa0414a={},_0x2c0740={},_0x1b2238={'count':0x0,'rows':[]};var _0x4a60cf=_[_0xdf56('0x27')](db[_0xdf56('0x28')][_0xdf56('0x29')],function(_0x163066){return{'name':_0x163066[_0xdf56('0x2a')],'type':_0x163066[_0xdf56('0x2b')][_0xdf56('0x2c')]};});_0x2c0740['model']=_[_0xdf56('0x27')](_0x4a60cf,'name');_0x2c0740[_0xdf56('0x2d')]=_[_0xdf56('0x2e')](_0x2cc619['query']);_0x2c0740[_0xdf56('0x2f')]=_[_0xdf56('0x30')](_0x2c0740['model'],_0x2c0740[_0xdf56('0x2d')]);_0xa0414a[_0xdf56('0x31')]=_[_0xdf56('0x30')](_0x2c0740[_0xdf56('0x32')],qs['fields'](_0x2cc619[_0xdf56('0x2d')][_0xdf56('0x33')]));_0xa0414a[_0xdf56('0x31')]=_0xa0414a[_0xdf56('0x31')][_0xdf56('0x34')]?_0xa0414a['attributes']:_0x2c0740['model'];if(!_0x2cc619[_0xdf56('0x2d')]['hasOwnProperty']('nolimit')){_0xa0414a[_0xdf56('0x35')]=qs['limit'](_0x2cc619[_0xdf56('0x2d')]['limit']);_0xa0414a[_0xdf56('0x16')]=qs[_0xdf56('0x16')](_0x2cc619['query'][_0xdf56('0x16')]);}_0xa0414a[_0xdf56('0x36')]=qs[_0xdf56('0x37')](_0x2cc619[_0xdf56('0x2d')]['sort']);_0xa0414a[_0xdf56('0x38')]=qs['filters'](_[_0xdf56('0x39')](_0x2cc619[_0xdf56('0x2d')],_0x2c0740[_0xdf56('0x2f')]),_0x4a60cf);if(_0x2cc619[_0xdf56('0x2d')]['filter']){_0xa0414a['where']=_['merge'](_0xa0414a['where'],{'$or':_[_0xdf56('0x27')](_0x4a60cf,function(_0x445399){if(_0x445399['type']!=='VIRTUAL'){var _0x37fc0a={};_0x37fc0a[_0x445399[_0xdf56('0x24')]]={'$like':'%'+_0x2cc619[_0xdf56('0x2d')][_0xdf56('0x3a')]+'%'};return _0x37fc0a;}})});}_0xa0414a=_[_0xdf56('0x3b')]({},_0xa0414a,_0x2cc619['options']);var _0x1dca7a={'where':_0xa0414a[_0xdf56('0x38')]};return db['UserProfileSection'][_0xdf56('0x18')](_0x1dca7a)['then'](function(_0x41d950){_0x1b2238[_0xdf56('0x18')]=_0x41d950;if(_0x2cc619['query'][_0xdf56('0x3c')]){_0xa0414a[_0xdf56('0x3d')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0xa0414a);})['then'](function(_0x420fc6){_0x1b2238[_0xdf56('0x3e')]=_0x420fc6;return _0x1b2238;})[_0xdf56('0x1f')](respondWithFilteredResult(_0x4dcea5,_0xa0414a))[_0xdf56('0x3f')](handleError(_0x4dcea5,null));};exports[_0xdf56('0x40')]=function(_0x50653b,_0x108fe8){var _0x15eafd={'raw':![],'where':{'id':_0x50653b['params']['id']}},_0x238646={};_0x238646[_0xdf56('0x32')]=_[_0xdf56('0x2e')](db[_0xdf56('0x28')]['rawAttributes']);_0x238646[_0xdf56('0x2d')]=_['keys'](_0x50653b['query']);_0x238646[_0xdf56('0x2f')]=_[_0xdf56('0x30')](_0x238646[_0xdf56('0x32')],_0x238646[_0xdf56('0x2d')]);_0x15eafd['attributes']=_[_0xdf56('0x30')](_0x238646['model'],qs[_0xdf56('0x33')](_0x50653b[_0xdf56('0x2d')]['fields']));_0x15eafd[_0xdf56('0x31')]=_0x15eafd[_0xdf56('0x31')][_0xdf56('0x34')]?_0x15eafd[_0xdf56('0x31')]:_0x238646['model'];if(_0x50653b['query'][_0xdf56('0x3c')]){_0x15eafd[_0xdf56('0x3d')]=[{'all':!![]}];}_0x15eafd=_[_0xdf56('0x3b')]({},_0x15eafd,_0x50653b[_0xdf56('0x41')]);return db[_0xdf56('0x28')]['find'](_0x15eafd)[_0xdf56('0x1f')](handleEntityNotFound(_0x108fe8,null))[_0xdf56('0x1f')](respondWithResult(_0x108fe8,null))['catch'](handleError(_0x108fe8,null));};exports[_0xdf56('0x42')]=function(_0x547c3d,_0x580eef){return db[_0xdf56('0x28')][_0xdf56('0x42')](_0x547c3d[_0xdf56('0x43')],{})[_0xdf56('0x1f')](respondWithResult(_0x580eef,0xc9))[_0xdf56('0x3f')](handleError(_0x580eef,null));};exports['update']=function(_0x18796c,_0x10f61f){if(_0x18796c['body']['id']){delete _0x18796c[_0xdf56('0x43')]['id'];}return db[_0xdf56('0x28')][_0xdf56('0x44')]({'where':{'id':_0x18796c[_0xdf56('0x45')]['id']}})['then'](handleEntityNotFound(_0x10f61f,null))['then'](saveUpdates(_0x18796c[_0xdf56('0x43')],null))[_0xdf56('0x1f')](respondWithResult(_0x10f61f,null))[_0xdf56('0x3f')](handleError(_0x10f61f,null));};exports[_0xdf56('0x20')]=function(_0xf8019f,_0x321b92){return db[_0xdf56('0x28')][_0xdf56('0x44')]({'where':{'id':_0xf8019f[_0xdf56('0x45')]['id']}})['then'](handleEntityNotFound(_0x321b92,null))[_0xdf56('0x1f')](removeEntity(_0x321b92,null))['catch'](handleError(_0x321b92,null));};exports['describe']=function(_0x49ae42,_0x68f55b){return db[_0xdf56('0x28')][_0xdf56('0x46')]()[_0xdf56('0x1f')](respondWithResult(_0x68f55b,null))[_0xdf56('0x3f')](handleError(_0x68f55b,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 78571c3..9c4bc07 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 _0xaadc=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','util','moment','bluebird','path'];(function(_0x74e99,_0x39a241){var _0x219c3c=function(_0x595f4f){while(--_0x595f4f){_0x74e99['push'](_0x74e99['shift']());}};_0x219c3c(++_0x39a241);}(_0xaadc,0x134));var _0xcaad=function(_0x5ce9ee,_0x5401ec){_0x5ce9ee=_0x5ce9ee-0x0;var _0x42297e=_0xaadc[_0x5ce9ee];return _0x42297e;};'use strict';var _=require('lodash');var util=require(_0xcaad('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcaad('0x1'));var BPromise=require(_0xcaad('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaad('0x3'));var rimraf=require(_0xcaad('0x4'));var config=require(_0xcaad('0x5'));var attributes=require(_0xcaad('0x6'));module[_0xcaad('0x7')]=function(_0x354de7,_0x1ed82d){return _0x354de7[_0xcaad('0x8')](_0xcaad('0x9'),attributes,{'tableName':_0xcaad('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xcaad('0xb'),_0xcaad('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d6=['exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','../../config/logger','api','moment','request-promise','../../config/environment','./userProfileSection.attributes'];(function(_0x160be1,_0x5deaa9){var _0x46df83=function(_0x122192){while(--_0x122192){_0x160be1['push'](_0x160be1['shift']());}};_0x46df83(++_0x5deaa9);}(_0xa2d6,0xea));var _0x6a2d=function(_0x5813eb,_0x157c17){_0x5813eb=_0x5813eb-0x0;var _0x314c58=_0xa2d6[_0x5813eb];return _0x314c58;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a2d('0x0'))(_0x6a2d('0x1'));var moment=require(_0x6a2d('0x2'));var BPromise=require('bluebird');var rp=require(_0x6a2d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6a2d('0x4'));var attributes=require(_0x6a2d('0x5'));module[_0x6a2d('0x6')]=function(_0x1c2401,_0x2ec871){return _0x1c2401['define'](_0x6a2d('0x7'),attributes,{'tableName':_0x6a2d('0x8'),'paranoid':![],'indexes':[{'name':_0x6a2d('0x9'),'fields':[_0x6a2d('0xa'),_0x6a2d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d08fbcb..6be0bcd 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 _0xed25=['../../config/environment','request','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xbf5e17,_0x233895){var _0x137c27=function(_0x3115eb){while(--_0x3115eb){_0xbf5e17['push'](_0xbf5e17['shift']());}};_0x137c27(++_0x233895);}(_0xed25,0x84));var _0x5ed2=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xed25[_0x1911ed];return _0x11edaa;};'use strict';var _=require('lodash');var util=require(_0x5ed2('0x0'));var moment=require(_0x5ed2('0x1'));var BPromise=require(_0x5ed2('0x2'));var rs=require(_0x5ed2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ed2('0x4'))['db'];var utils=require(_0x5ed2('0x5'));var logger=require(_0x5ed2('0x6'))(_0x5ed2('0x7'));var config=require(_0x5ed2('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f6c6c,_0x5df487,_0x4b0c09){return new BPromise(function(_0x45e8fd,_0x16603b){return client[_0x5ed2('0x9')](_0x3f6c6c,_0x4b0c09)['then'](function(_0x4739da){logger[_0x5ed2('0xa')](_0x5ed2('0xb'),_0x5df487,'request\x20sent');logger[_0x5ed2('0xc')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5df487,_0x5ed2('0xd'),JSON[_0x5ed2('0xe')](_0x4739da));if(_0x4739da[_0x5ed2('0xf')]){if(_0x4739da['error'][_0x5ed2('0x10')]===0x1f4){logger[_0x5ed2('0xf')](_0x5ed2('0xb'),_0x5df487,_0x4739da['error']['message']);return _0x16603b(_0x4739da['error']['message']);}logger[_0x5ed2('0xf')](_0x5ed2('0xb'),_0x5df487,_0x4739da[_0x5ed2('0xf')][_0x5ed2('0x11')]);return _0x45e8fd(_0x4739da['error']['message']);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x5df487,_0x5ed2('0xd'));_0x45e8fd(_0x4739da[_0x5ed2('0x12')][_0x5ed2('0x11')]);}})[_0x5ed2('0x13')](function(_0x20d7ff){logger['error'](_0x5ed2('0xb'),_0x5df487,_0x20d7ff);_0x16603b(_0x20d7ff);});});} \ No newline at end of file +var _0xa21e=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent'];(function(_0x48a672,_0x2bf4bf){var _0x12f715=function(_0x19eb78){while(--_0x19eb78){_0x48a672['push'](_0x48a672['shift']());}};_0x12f715(++_0x2bf4bf);}(_0xa21e,0x166));var _0xea21=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xa21e[_0xae1a83];return _0xdb9da8;};'use strict';var _=require(_0xea21('0x0'));var util=require(_0xea21('0x1'));var moment=require(_0xea21('0x2'));var BPromise=require('bluebird');var rs=require(_0xea21('0x3'));var fs=require('fs');var Redis=require(_0xea21('0x4'));var db=require(_0xea21('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea21('0x6'));var config=require(_0xea21('0x7'));var jayson=require(_0xea21('0x8'));var client=jayson[_0xea21('0x9')][_0xea21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e8021,_0xb43804,_0x240c96){return new BPromise(function(_0x17eb41,_0x1b06bc){return client[_0xea21('0xb')](_0x1e8021,_0x240c96)[_0xea21('0xc')](function(_0xd9af1d){logger['info'](_0xea21('0xd'),_0xb43804,'request\x20sent');logger['debug'](_0xea21('0xe'),_0xb43804,'request\x20sent',JSON['stringify'](_0xd9af1d));if(_0xd9af1d[_0xea21('0xf')]){if(_0xd9af1d[_0xea21('0xf')][_0xea21('0x10')]===0x1f4){logger[_0xea21('0xf')](_0xea21('0xd'),_0xb43804,_0xd9af1d['error'][_0xea21('0x11')]);return _0x1b06bc(_0xd9af1d[_0xea21('0xf')]['message']);}logger[_0xea21('0xf')](_0xea21('0xd'),_0xb43804,_0xd9af1d[_0xea21('0xf')][_0xea21('0x11')]);return _0x17eb41(_0xd9af1d[_0xea21('0xf')][_0xea21('0x11')]);}else{logger[_0xea21('0x12')]('UserProfileSection,\x20%s,\x20%s',_0xb43804,_0xea21('0x13'));_0x17eb41(_0xd9af1d['result']['message']);}})[_0xea21('0x14')](function(_0x3c4daf){logger[_0xea21('0xf')]('UserProfileSection,\x20%s,\x20%s',_0xb43804,_0x3c4daf);_0x1b06bc(_0x3c4daf);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 482a15a..3500363 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(_0x53a97a,_0x3135e8){var _0x3ff3ff=function(_0xc59fc1){while(--_0xc59fc1){_0x53a97a['push'](_0x53a97a['shift']());}};_0x3ff3ff(++_0x3135e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3da241,_0xeba26a){var _0x43e156=function(_0x41ced1){while(--_0x41ced1){_0x3da241['push'](_0x3da241['shift']());}};_0x43e156(++_0xeba26a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 3c16ee3..e321240 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 _0xa348=['sequelize','INTEGER'];(function(_0x1bc85c,_0x72b8fd){var _0x162ab6=function(_0x58f845){while(--_0x58f845){_0x1bc85c['push'](_0x1bc85c['shift']());}};_0x162ab6(++_0x72b8fd);}(_0xa348,0xb2));var _0x8a34=function(_0x4e728f,_0x3cd7bc){_0x4e728f=_0x4e728f-0x0;var _0x2137e0=_0xa348[_0x4e728f];return _0x2137e0;};'use strict';var Sequelize=require(_0x8a34('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8a34('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb510=['exports','INTEGER','sequelize'];(function(_0x5a7244,_0x605a4){var _0x77ff1b=function(_0x3ba0c8){while(--_0x3ba0c8){_0x5a7244['push'](_0x5a7244['shift']());}};_0x77ff1b(++_0x605a4);}(_0xb510,0x173));var _0x0b51=function(_0x31fb45,_0x3e956e){_0x31fb45=_0x31fb45-0x0;var _0xfc6961=_0xb510[_0x31fb45];return _0xfc6961;};'use strict';var Sequelize=require(_0x0b51('0x0'));module[_0x0b51('0x1')]={'penalty':{'type':Sequelize[_0x0b51('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 193151d..bd8df35 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 _0x326f=['user_has_sms_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue'];(function(_0x5a2fae,_0x2c9445){var _0x428aa1=function(_0x40dd37){while(--_0x40dd37){_0x5a2fae['push'](_0x5a2fae['shift']());}};_0x428aa1(++_0x2c9445);}(_0x326f,0xd1));var _0xf326=function(_0x561e3d,_0x1266f5){_0x561e3d=_0x561e3d-0x0;var _0x3a0dd2=_0x326f[_0x561e3d];return _0x3a0dd2;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68b3=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x68b3,0x1d8));var _0x368b=function(_0x20d4fc,_0x1817f9){_0x20d4fc=_0x20d4fc-0x0;var _0x141d78=_0x68b3[_0x20d4fc];return _0x141d78;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var logger=require(_0x368b('0x2'))(_0x368b('0x3'));var moment=require(_0x368b('0x4'));var BPromise=require('bluebird');var rp=require(_0x368b('0x5'));var fs=require('fs');var path=require(_0x368b('0x6'));var rimraf=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x368b('0x9')]=function(_0x41b15b,_0x104dad){return _0x41b15b[_0x368b('0xa')](_0x368b('0xb'),attributes,{'tableName':_0x368b('0xc'),'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 855765a..4a36922 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 _0xbf1d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x567d04,_0x3d13a1){var _0x58ee79=function(_0x4c5548){while(--_0x4c5548){_0x567d04['push'](_0x567d04['shift']());}};_0x58ee79(++_0x3d13a1);}(_0xbf1d,0x16f));var _0xdbf1=function(_0x50d319,_0x562dee){_0x50d319=_0x50d319-0x0;var _0x1c05d2=_0xbf1d[_0x50d319];return _0x1c05d2;};'use strict';var _=require(_0xdbf1('0x0'));var util=require(_0xdbf1('0x1'));var moment=require(_0xdbf1('0x2'));var BPromise=require(_0xdbf1('0x3'));var rs=require(_0xdbf1('0x4'));var fs=require('fs');var Redis=require(_0xdbf1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbf1('0x6'));var logger=require(_0xdbf1('0x7'))(_0xdbf1('0x8'));var config=require('../../config/environment');var jayson=require(_0xdbf1('0x9'));var client=jayson[_0xdbf1('0xa')][_0xdbf1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c0f2d,_0x36bb97,_0x3ea85c){return new BPromise(function(_0x213aea,_0x4142d7){return client[_0xdbf1('0xc')](_0x2c0f2d,_0x3ea85c)[_0xdbf1('0xd')](function(_0x33f49c){logger[_0xdbf1('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x36bb97,_0xdbf1('0xf'));logger[_0xdbf1('0x10')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x36bb97,'request\x20sent',JSON['stringify'](_0x33f49c));if(_0x33f49c[_0xdbf1('0x11')]){if(_0x33f49c['error'][_0xdbf1('0x12')]===0x1f4){logger[_0xdbf1('0x11')](_0xdbf1('0x13'),_0x36bb97,_0x33f49c[_0xdbf1('0x11')][_0xdbf1('0x14')]);return _0x4142d7(_0x33f49c[_0xdbf1('0x11')][_0xdbf1('0x14')]);}logger[_0xdbf1('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x36bb97,_0x33f49c['error'][_0xdbf1('0x14')]);return _0x213aea(_0x33f49c[_0xdbf1('0x11')][_0xdbf1('0x14')]);}else{logger[_0xdbf1('0xe')](_0xdbf1('0x13'),_0x36bb97,'request\x20sent');_0x213aea(_0x33f49c[_0xdbf1('0x15')][_0xdbf1('0x14')]);}})[_0xdbf1('0x16')](function(_0x5e38ad){logger[_0xdbf1('0x11')](_0xdbf1('0x13'),_0x36bb97,_0x5e38ad);_0x4142d7(_0x5e38ad);});});} \ No newline at end of file +var _0x7486=['request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s'];(function(_0x1f531c,_0x2b72ac){var _0x492387=function(_0x1e12a8){while(--_0x1e12a8){_0x1f531c['push'](_0x1f531c['shift']());}};_0x492387(++_0x2b72ac);}(_0x7486,0x178));var _0x6748=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7486[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6748('0x0'));var util=require(_0x6748('0x1'));var moment=require(_0x6748('0x2'));var BPromise=require(_0x6748('0x3'));var rs=require(_0x6748('0x4'));var fs=require('fs');var Redis=require(_0x6748('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6748('0x6'));var logger=require(_0x6748('0x7'))('rpc');var config=require(_0x6748('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6748('0x9')][_0x6748('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x358261,_0x377dab,_0x3267d5){return new BPromise(function(_0x1e2693,_0x1be1d1){return client[_0x6748('0xb')](_0x358261,_0x3267d5)[_0x6748('0xc')](function(_0x360535){logger[_0x6748('0xd')](_0x6748('0xe'),_0x377dab,_0x6748('0xf'));logger['debug'](_0x6748('0x10'),_0x377dab,_0x6748('0xf'),JSON[_0x6748('0x11')](_0x360535));if(_0x360535[_0x6748('0x12')]){if(_0x360535[_0x6748('0x12')][_0x6748('0x13')]===0x1f4){logger[_0x6748('0x12')](_0x6748('0xe'),_0x377dab,_0x360535[_0x6748('0x12')][_0x6748('0x14')]);return _0x1be1d1(_0x360535['error'][_0x6748('0x14')]);}logger[_0x6748('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x377dab,_0x360535['error'][_0x6748('0x14')]);return _0x1e2693(_0x360535[_0x6748('0x12')]['message']);}else{logger[_0x6748('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x377dab,_0x6748('0xf'));_0x1e2693(_0x360535[_0x6748('0x15')]['message']);}})[_0x6748('0x16')](function(_0x578458){logger[_0x6748('0x12')](_0x6748('0xe'),_0x377dab,_0x578458);_0x1be1d1(_0x578458);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index a69c8bd..05dedef 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 _0x2bf4=['sequelize','exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2bf4,0x1b3));var _0x42bf=function(_0x400096,_0x101dc3){_0x400096=_0x400096-0x0;var _0x31755a=_0x2bf4[_0x400096];return _0x31755a;};'use strict';var Sequelize=require(_0x42bf('0x0'));module[_0x42bf('0x1')]={'UserId':{'type':Sequelize[_0x42bf('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x42bf('0x2')]}}; \ No newline at end of file +var _0xf58b=['INTEGER','sequelize','exports'];(function(_0x3edc8b,_0x1996cb){var _0xbf74e5=function(_0x2fcc27){while(--_0x2fcc27){_0x3edc8b['push'](_0x3edc8b['shift']());}};_0xbf74e5(++_0x1996cb);}(_0xf58b,0x1b4));var _0xbf58=function(_0x1436d8,_0x5135aa){_0x1436d8=_0x1436d8-0x0;var _0x252c31=_0xf58b[_0x1436d8];return _0x252c31;};'use strict';var Sequelize=require(_0xbf58('0x0'));module[_0xbf58('0x1')]={'UserId':{'type':Sequelize[_0xbf58('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xbf58('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 4414df8..afcf1f6 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(_0x41aca0,_0x1e81d6){var _0x39c6ec=function(_0x4c01e8){while(--_0x4c01e8){_0x41aca0['push'](_0x41aca0['shift']());}};_0x39c6ec(++_0x1e81d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x10a799,_0x4e7999){var _0x3df088=function(_0x20e9b){while(--_0x20e9b){_0x10a799['push'](_0x10a799['shift']());}};_0x3df088(++_0x4e7999);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 71e037b..5ce59fe 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(_0x4c3b42,_0x140871){var _0x4033a8=function(_0x17813c){while(--_0x17813c){_0x4c3b42['push'](_0x4c3b42['shift']());}};_0x4033a8(++_0x140871);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5a0349,_0xaa3aac){var _0x2b3020=function(_0x3fd692){while(--_0x3fd692){_0x5a0349['push'](_0x5a0349['shift']());}};_0x2b3020(++_0xaa3aac);}(_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'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 1860934..5e4b6bf 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 _0x9750=['exports','INTEGER','sequelize'];(function(_0x626191,_0x499536){var _0x5406f3=function(_0x260e14){while(--_0x260e14){_0x626191['push'](_0x626191['shift']());}};_0x5406f3(++_0x499536);}(_0x9750,0x12b));var _0x0975=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9750[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0x0975('0x0'));module[_0x0975('0x1')]={'penalty':{'type':Sequelize[_0x0975('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9e65=['sequelize','exports','INTEGER'];(function(_0x497f48,_0x4e11f2){var _0x510210=function(_0x441d34){while(--_0x441d34){_0x497f48['push'](_0x497f48['shift']());}};_0x510210(++_0x4e11f2);}(_0x9e65,0x1e3));var _0x59e6=function(_0x4b91fb,_0xe92b69){_0x4b91fb=_0x4b91fb-0x0;var _0x5eca8e=_0x9e65[_0x4b91fb];return _0x5eca8e;};'use strict';var Sequelize=require(_0x59e6('0x0'));module[_0x59e6('0x1')]={'penalty':{'type':Sequelize[_0x59e6('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 188138e..8a34535 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 _0xe8bf=['bluebird','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe8bf,0x6a));var _0xfe8b=function(_0x576796,_0x1b769a){_0x576796=_0x576796-0x0;var _0xc6c82a=_0xe8bf[_0x576796];return _0xc6c82a;};'use strict';var _=require('lodash');var util=require(_0xfe8b('0x0'));var logger=require(_0xfe8b('0x1'))(_0xfe8b('0x2'));var moment=require(_0xfe8b('0x3'));var BPromise=require(_0xfe8b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe8b('0x5'));var config=require('../../config/environment');var attributes=require(_0xfe8b('0x6'));module[_0xfe8b('0x7')]=function(_0x24ac7c,_0x32e257){return _0x24ac7c[_0xfe8b('0x8')](_0xfe8b('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60c9=['exports','define','user_has_voice_queues','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x60c9,0x7c));var _0x960c=function(_0x4900a6,_0x4a756f){_0x4900a6=_0x4900a6-0x0;var _0x529d52=_0x60c9[_0x4900a6];return _0x529d52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x960c('0x0'))(_0x960c('0x1'));var moment=require(_0x960c('0x2'));var BPromise=require(_0x960c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x960c('0x4'));var rimraf=require(_0x960c('0x5'));var config=require(_0x960c('0x6'));var attributes=require(_0x960c('0x7'));module[_0x960c('0x8')]=function(_0x533c74,_0x2ae929){return _0x533c74[_0x960c('0x9')]('UserVoiceQueue',attributes,{'tableName':_0x960c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 72a8fb7..847c1d6 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 _0xd2a3=['rpc','../../config/environment','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2a3,0x1af));var _0x3d2a=function(_0x3f1d9f,_0x15fd5a){_0x3f1d9f=_0x3f1d9f-0x0;var _0x107272=_0xd2a3[_0x3f1d9f];return _0x107272;};'use strict';var _=require('lodash');var util=require(_0x3d2a('0x0'));var moment=require(_0x3d2a('0x1'));var BPromise=require(_0x3d2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d2a('0x3'));var db=require(_0x3d2a('0x4'))['db'];var utils=require(_0x3d2a('0x5'));var logger=require('../../config/logger')(_0x3d2a('0x6'));var config=require(_0x3d2a('0x7'));var jayson=require(_0x3d2a('0x8'));var client=jayson['client'][_0x3d2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x299600,_0x2db6d7,_0x1eda4d){return new BPromise(function(_0x328b86,_0x5390b9){return client[_0x3d2a('0xa')](_0x299600,_0x1eda4d)[_0x3d2a('0xb')](function(_0x2f59e2){logger[_0x3d2a('0xc')](_0x3d2a('0xd'),_0x2db6d7,_0x3d2a('0xe'));logger[_0x3d2a('0xf')](_0x3d2a('0x10'),_0x2db6d7,_0x3d2a('0xe'),JSON[_0x3d2a('0x11')](_0x2f59e2));if(_0x2f59e2[_0x3d2a('0x12')]){if(_0x2f59e2[_0x3d2a('0x12')][_0x3d2a('0x13')]===0x1f4){logger[_0x3d2a('0x12')](_0x3d2a('0xd'),_0x2db6d7,_0x2f59e2['error'][_0x3d2a('0x14')]);return _0x5390b9(_0x2f59e2[_0x3d2a('0x12')]['message']);}logger[_0x3d2a('0x12')](_0x3d2a('0xd'),_0x2db6d7,_0x2f59e2[_0x3d2a('0x12')][_0x3d2a('0x14')]);return _0x328b86(_0x2f59e2[_0x3d2a('0x12')][_0x3d2a('0x14')]);}else{logger[_0x3d2a('0xc')](_0x3d2a('0xd'),_0x2db6d7,_0x3d2a('0xe'));_0x328b86(_0x2f59e2[_0x3d2a('0x15')][_0x3d2a('0x14')]);}})[_0x3d2a('0x16')](function(_0x30a890){logger[_0x3d2a('0x12')](_0x3d2a('0xd'),_0x2db6d7,_0x30a890);_0x5390b9(_0x30a890);});});} \ No newline at end of file +var _0xf2cd=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x21b4f6,_0x58ec99){var _0x298a18=function(_0x16caf4){while(--_0x16caf4){_0x21b4f6['push'](_0x21b4f6['shift']());}};_0x298a18(++_0x58ec99);}(_0xf2cd,0x17a));var _0xdf2c=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0xf2cd[_0x2786ea];return _0x5c38e5;};'use strict';var _=require(_0xdf2c('0x0'));var util=require(_0xdf2c('0x1'));var moment=require(_0xdf2c('0x2'));var BPromise=require(_0xdf2c('0x3'));var rs=require(_0xdf2c('0x4'));var fs=require('fs');var Redis=require(_0xdf2c('0x5'));var db=require(_0xdf2c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf2c('0x7'))(_0xdf2c('0x8'));var config=require(_0xdf2c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdf2c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x120f77,_0x27d89e,_0x2f5c08){return new BPromise(function(_0x2cf2c7,_0xc94eb9){return client[_0xdf2c('0xb')](_0x120f77,_0x2f5c08)['then'](function(_0x46fe87){logger[_0xdf2c('0xc')](_0xdf2c('0xd'),_0x27d89e,'request\x20sent');logger['debug'](_0xdf2c('0xe'),_0x27d89e,'request\x20sent',JSON[_0xdf2c('0xf')](_0x46fe87));if(_0x46fe87[_0xdf2c('0x10')]){if(_0x46fe87[_0xdf2c('0x10')][_0xdf2c('0x11')]===0x1f4){logger[_0xdf2c('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x27d89e,_0x46fe87['error'][_0xdf2c('0x12')]);return _0xc94eb9(_0x46fe87[_0xdf2c('0x10')][_0xdf2c('0x12')]);}logger[_0xdf2c('0x10')](_0xdf2c('0xd'),_0x27d89e,_0x46fe87[_0xdf2c('0x10')][_0xdf2c('0x12')]);return _0x2cf2c7(_0x46fe87[_0xdf2c('0x10')][_0xdf2c('0x12')]);}else{logger[_0xdf2c('0xc')](_0xdf2c('0xd'),_0x27d89e,'request\x20sent');_0x2cf2c7(_0x46fe87[_0xdf2c('0x13')][_0xdf2c('0x12')]);}})['catch'](function(_0x545ff4){logger[_0xdf2c('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x27d89e,_0x545ff4);_0xc94eb9(_0x545ff4);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9ce378a..84c8cef 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x38d5b2,_0xe77bf4){var _0x5b4ba8=function(_0x28ee00){while(--_0x28ee00){_0x38d5b2['push'](_0x38d5b2['shift']());}};_0x5b4ba8(++_0xe77bf4);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5021ab,_0x2b9740){var _0x49df1a=function(_0x19f772){while(--_0x19f772){_0x5021ab['push'](_0x5021ab['shift']());}};_0x49df1a(++_0x2b9740);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 8a4a01f..df236fd 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 _0x96d7=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1a8220,_0x5289ac){var _0x3212b7=function(_0x74adf2){while(--_0x74adf2){_0x1a8220['push'](_0x1a8220['shift']());}};_0x3212b7(++_0x5289ac);}(_0x96d7,0x12c));var _0x796d=function(_0x340339,_0xcd1cd){_0x340339=_0x340339-0x0;var _0x4797b4=_0x96d7[_0x340339];return _0x4797b4;};'use strict';var Sequelize=require(_0x796d('0x0'));module[_0x796d('0x1')]={'uniqueid':{'type':Sequelize[_0x796d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x796d('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x796d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x796d('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x796d('0x3')},'VoiceQueueId':{'type':Sequelize[_0x796d('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x796d('0x5'),'comment':_0x796d('0x3')},'penalty':{'type':Sequelize[_0x796d('0x2')](0xb),'defaultValue':0x0,'comment':_0x796d('0x3')},'paused':{'type':Sequelize[_0x796d('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x2945=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x3962ed,_0x365396){var _0x3e6ce0=function(_0x1f6f14){while(--_0x1f6f14){_0x3962ed['push'](_0x3962ed['shift']());}};_0x3e6ce0(++_0x365396);}(_0x2945,0x1b6));var _0x5294=function(_0x5defe5,_0x454030){_0x5defe5=_0x5defe5-0x0;var _0x1a53f2=_0x2945[_0x5defe5];return _0x1a53f2;};'use strict';var Sequelize=require(_0x5294('0x0'));module[_0x5294('0x1')]={'uniqueid':{'type':Sequelize[_0x5294('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5294('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x5294('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x5294('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x5294('0x3')},'VoiceQueueId':{'type':Sequelize[_0x5294('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5294('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x5294('0x2')](0xb),'defaultValue':0x0,'comment':_0x5294('0x3')},'paused':{'type':Sequelize[_0x5294('0x2')](0xb),'defaultValue':0x0,'comment':_0x5294('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 3eec8b1..7e5b3ff 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 _0x71bb=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x2a6599,_0x4bcfae){var _0x4f2024=function(_0x34c69e){while(--_0x34c69e){_0x2a6599['push'](_0x2a6599['shift']());}};_0x4f2024(++_0x4bcfae);}(_0x71bb,0x141));var _0xb71b=function(_0xf54c8e,_0x4253f8){_0xf54c8e=_0xf54c8e-0x0;var _0x1ef89d=_0x71bb[_0xf54c8e];return _0x1ef89d;};'use strict';var EventEmitter=require(_0xb71b('0x0'));var UserVoiceQueueRt=require(_0xb71b('0x1'))['db'][_0xb71b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb71b('0x3')](0x0);var events={'afterCreate':_0xb71b('0x4'),'afterUpdate':'update','afterDestroy':_0xb71b('0x5')};function emitEvent(_0x2cd571){return function(_0xcef382,_0xfb3f0,_0x5114b1){UserVoiceQueueRtEvents['emit'](_0x2cd571+':'+_0xcef382['id'],_0xcef382);UserVoiceQueueRtEvents[_0xb71b('0x6')](_0x2cd571,_0xcef382);_0x5114b1(null);};}for(var e in events){if(events[_0xb71b('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xb71b('0x8')](e,emitEvent(event));}}module[_0xb71b('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x312b=['remove','emit','hasOwnProperty','hook','events','UserVoiceQueueRt','setMaxListeners','save','update'];(function(_0x289187,_0x5b6795){var _0x5c4db4=function(_0x1e4618){while(--_0x1e4618){_0x289187['push'](_0x289187['shift']());}};_0x5c4db4(++_0x5b6795);}(_0x312b,0x1ab));var _0xb312=function(_0x283d09,_0x5be1bd){_0x283d09=_0x283d09-0x0;var _0x2cb198=_0x312b[_0x283d09];return _0x2cb198;};'use strict';var EventEmitter=require(_0xb312('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xb312('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb312('0x2')](0x0);var events={'afterCreate':_0xb312('0x3'),'afterUpdate':_0xb312('0x4'),'afterDestroy':_0xb312('0x5')};function emitEvent(_0x2f1160){return function(_0x1ac717,_0x3d0ec6,_0x1621ea){UserVoiceQueueRtEvents[_0xb312('0x6')](_0x2f1160+':'+_0x1ac717['id'],_0x1ac717);UserVoiceQueueRtEvents['emit'](_0x2f1160,_0x1ac717);_0x1621ea(null);};}for(var e in events){if(events[_0xb312('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xb312('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index cd751c2..9d00674 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 _0x7d9f=['bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment'];(function(_0x192397,_0x2a560f){var _0x1ef3a5=function(_0x4acddf){while(--_0x4acddf){_0x192397['push'](_0x192397['shift']());}};_0x1ef3a5(++_0x2a560f);}(_0x7d9f,0x113));var _0xf7d9=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0x7d9f[_0x1655bb];return _0x5e2020;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require(_0xf7d9('0x5'));var rp=require(_0xf7d9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module[_0xf7d9('0xa')]=function(_0x16da4b,_0x171fc8){return _0x16da4b[_0xf7d9('0xb')](_0xf7d9('0xc'),attributes,{'tableName':_0xf7d9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02d5=['user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0xfe1c7d,_0x4fef32){var _0x53d311=function(_0xfd81b5){while(--_0xfd81b5){_0xfe1c7d['push'](_0xfe1c7d['shift']());}};_0x53d311(++_0x4fef32);}(_0x02d5,0x69));var _0x502d=function(_0x6af1b1,_0x4ccf9e){_0x6af1b1=_0x6af1b1-0x0;var _0x139dae=_0x02d5[_0x6af1b1];return _0x139dae;};'use strict';var _=require(_0x502d('0x0'));var util=require('util');var logger=require(_0x502d('0x1'))(_0x502d('0x2'));var moment=require(_0x502d('0x3'));var BPromise=require(_0x502d('0x4'));var rp=require(_0x502d('0x5'));var fs=require('fs');var path=require(_0x502d('0x6'));var rimraf=require(_0x502d('0x7'));var config=require(_0x502d('0x8'));var attributes=require(_0x502d('0x9'));module[_0x502d('0xa')]=function(_0x567c20,_0x72a9fa){return _0x567c20[_0x502d('0xb')]('UserVoiceQueueRt',attributes,{'tableName':_0x502d('0xc'),'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 522cccb..f524fda 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 _0x054b=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueueRtPauses','findAll','options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x2faf38,_0x43b0ec){var _0x35ced6=function(_0x5c2e1a){while(--_0x5c2e1a){_0x2faf38['push'](_0x2faf38['shift']());}};_0x35ced6(++_0x43b0ec);}(_0x054b,0x1d6));var _0xb054=function(_0x1a7cf2,_0x3908ff){_0x1a7cf2=_0x1a7cf2-0x0;var _0x40d59a=_0x054b[_0x1a7cf2];return _0x40d59a;};'use strict';var _=require(_0xb054('0x0'));var util=require(_0xb054('0x1'));var moment=require(_0xb054('0x2'));var BPromise=require(_0xb054('0x3'));var rs=require(_0xb054('0x4'));var fs=require('fs');var Redis=require(_0xb054('0x5'));var db=require(_0xb054('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb054('0x7'))(_0xb054('0x8'));var config=require(_0xb054('0x9'));var jayson=require(_0xb054('0xa'));var client=jayson[_0xb054('0xb')]['http']({'port':0x232a});config['redis']=_[_0xb054('0xc')](config[_0xb054('0xd')],{'host':_0xb054('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb054('0xd')]));require('./userVoiceQueueRt.socket')[_0xb054('0xf')](socket);function respondWithRpcPromise(_0x5de64f,_0x57fcf4,_0x416779){return new BPromise(function(_0x4a1eb7,_0x323a14){return client['request'](_0x5de64f,_0x416779)[_0xb054('0x10')](function(_0x5ee52f){logger[_0xb054('0x11')](_0xb054('0x12'),_0x57fcf4,_0xb054('0x13'));logger[_0xb054('0x14')](_0xb054('0x15'),_0x57fcf4,_0xb054('0x13'),JSON[_0xb054('0x16')](_0x5ee52f));if(_0x5ee52f[_0xb054('0x17')]){if(_0x5ee52f['error']['code']===0x1f4){logger['error'](_0xb054('0x12'),_0x57fcf4,_0x5ee52f[_0xb054('0x17')]['message']);return _0x323a14(_0x5ee52f[_0xb054('0x17')][_0xb054('0x18')]);}logger[_0xb054('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x57fcf4,_0x5ee52f[_0xb054('0x17')][_0xb054('0x18')]);return _0x4a1eb7(_0x5ee52f[_0xb054('0x17')][_0xb054('0x18')]);}else{logger[_0xb054('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x57fcf4,'request\x20sent');_0x4a1eb7(_0x5ee52f[_0xb054('0x19')][_0xb054('0x18')]);}})['catch'](function(_0x243d45){logger[_0xb054('0x17')](_0xb054('0x12'),_0x57fcf4,_0x243d45);_0x323a14(_0x243d45);});});}exports[_0xb054('0x1a')]=function(_0x51af37){var _0x5c0746=this;return new Promise(function(_0x55137f,_0x42aab8){return db['UserVoiceQueueRt'][_0xb054('0x1b')]({'raw':_0x51af37[_0xb054('0x1c')]?_0x51af37[_0xb054('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x51af37[_0xb054('0x1c')]?_0x51af37[_0xb054('0x1c')]['where']||null:null,'attributes':[[db[_0xb054('0x1d')]['fn'](_0xb054('0x1e'),db[_0xb054('0x1d')]['fn']('IF',db[_0xb054('0x1d')][_0xb054('0x1f')](_0xb054('0x20')))),_0xb054('0x21')]]})[_0xb054('0x10')](function(_0x477660){logger[_0xb054('0x11')](_0xb054('0x1a'),_0x51af37);logger[_0xb054('0x14')](_0xb054('0x1a'),_0x51af37,JSON['stringify'](_0x477660));_0x55137f(_0x477660);})[_0xb054('0x22')](function(_0x1da1c2){logger[_0xb054('0x17')]('GetVoiceQueueRtPauses',_0x1da1c2['message'],_0x51af37);_0x42aab8(_0x5c0746[_0xb054('0x17')](0x1f4,_0x1da1c2[_0xb054('0x18')]));});});}; \ No newline at end of file +var _0xdd2c=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','outboundQueuePauses','stringify','lodash','util','moment','randomstring','ioredis'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0xdd2c,0xfb));var _0xcdd2=function(_0x4ec36f,_0x2400a3){_0x4ec36f=_0x4ec36f-0x0;var _0x5435b0=_0xdd2c[_0x4ec36f];return _0x5435b0;};'use strict';var _=require(_0xcdd2('0x0'));var util=require(_0xcdd2('0x1'));var moment=require(_0xcdd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xcdd2('0x3'));var fs=require('fs');var Redis=require(_0xcdd2('0x4'));var db=require(_0xcdd2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdd2('0x6'))('rpc');var config=require(_0xcdd2('0x7'));var jayson=require(_0xcdd2('0x8'));var client=jayson['client'][_0xcdd2('0x9')]({'port':0x232a});config[_0xcdd2('0xa')]=_['defaults'](config[_0xcdd2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcdd2('0xa')]));require('./userVoiceQueueRt.socket')[_0xcdd2('0xb')](socket);function respondWithRpcPromise(_0x2498db,_0x5274c7,_0x8dee15){return new BPromise(function(_0x4dbf64,_0x512e17){return client[_0xcdd2('0xc')](_0x2498db,_0x8dee15)[_0xcdd2('0xd')](function(_0x53e215){logger[_0xcdd2('0xe')](_0xcdd2('0xf'),_0x5274c7,_0xcdd2('0x10'));logger[_0xcdd2('0x11')](_0xcdd2('0x12'),_0x5274c7,_0xcdd2('0x10'),JSON['stringify'](_0x53e215));if(_0x53e215[_0xcdd2('0x13')]){if(_0x53e215[_0xcdd2('0x13')][_0xcdd2('0x14')]===0x1f4){logger[_0xcdd2('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5274c7,_0x53e215[_0xcdd2('0x13')]['message']);return _0x512e17(_0x53e215[_0xcdd2('0x13')][_0xcdd2('0x15')]);}logger[_0xcdd2('0x13')](_0xcdd2('0xf'),_0x5274c7,_0x53e215[_0xcdd2('0x13')][_0xcdd2('0x15')]);return _0x4dbf64(_0x53e215[_0xcdd2('0x13')][_0xcdd2('0x15')]);}else{logger['info'](_0xcdd2('0xf'),_0x5274c7,_0xcdd2('0x10'));_0x4dbf64(_0x53e215[_0xcdd2('0x16')][_0xcdd2('0x15')]);}})[_0xcdd2('0x17')](function(_0x11a6b2){logger[_0xcdd2('0x13')](_0xcdd2('0xf'),_0x5274c7,_0x11a6b2);_0x512e17(_0x11a6b2);});});}exports[_0xcdd2('0x18')]=function(_0x2677d6){var _0x344eb8=this;return new Promise(function(_0x532f9d,_0x2fd129){return db[_0xcdd2('0x19')][_0xcdd2('0x1a')]({'raw':_0x2677d6['options']?_0x2677d6[_0xcdd2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2677d6[_0xcdd2('0x1b')]?_0x2677d6[_0xcdd2('0x1b')][_0xcdd2('0x1c')]||null:null,'attributes':[[db[_0xcdd2('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcdd2('0x1d')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0xcdd2('0x1e')]]})['then'](function(_0x37d149){logger['info'](_0xcdd2('0x18'),_0x2677d6);logger['debug'](_0xcdd2('0x18'),_0x2677d6,JSON[_0xcdd2('0x1f')](_0x37d149));_0x532f9d(_0x37d149);})[_0xcdd2('0x17')](function(_0x452f20){logger[_0xcdd2('0x13')]('GetVoiceQueueRtPauses',_0x452f20['message'],_0x2677d6);_0x2fd129(_0x344eb8['error'](0x1f4,_0x452f20['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6655515..8937d01 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 _0xc2d6=['emit','removeListener','userVoiceQueueRt:','save','remove','update'];(function(_0x2df144,_0x49d5e0){var _0x1e36f8=function(_0x43f08c){while(--_0x43f08c){_0x2df144['push'](_0x2df144['shift']());}};_0x1e36f8(++_0x49d5e0);}(_0xc2d6,0x171));var _0x6c2d=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xc2d6[_0x3635ce];return _0x97ecd0;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x6c2d('0x0'),_0x6c2d('0x1'),_0x6c2d('0x2')];function createListener(_0x36f034,_0x1d92f7){return function(_0x3b94d4){_0x1d92f7[_0x6c2d('0x3')](_0x36f034,_0x3b94d4);};}function removeListener(_0x304229,_0x47057e){return function(){UserVoiceQueueRtEvents[_0x6c2d('0x4')](_0x304229,_0x47057e);};}exports['register']=function(_0x1141f7){for(var _0x3cf33f=0x0,_0x33c7a9=events['length'];_0x3cf33f<_0x33c7a9;_0x3cf33f++){var _0x2595b5=events[_0x3cf33f];var _0x5f5134=createListener(_0x6c2d('0x5')+_0x2595b5,_0x1141f7);UserVoiceQueueRtEvents['on'](_0x2595b5,_0x5f5134);}}; \ No newline at end of file +var _0xff22=['./userVoiceQueueRt.events','save','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x378fe5,_0x273757){var _0x1331d6=function(_0x153e87){while(--_0x153e87){_0x378fe5['push'](_0x378fe5['shift']());}};_0x1331d6(++_0x273757);}(_0xff22,0x1a0));var _0x2ff2=function(_0x3da42e,_0x3b6266){_0x3da42e=_0x3da42e-0x0;var _0x53b4e7=_0xff22[_0x3da42e];return _0x53b4e7;};'use strict';var UserVoiceQueueRtEvents=require(_0x2ff2('0x0'));var events=[_0x2ff2('0x1'),'remove',_0x2ff2('0x2')];function createListener(_0x41445f,_0x2e0010){return function(_0x2425fd){_0x2e0010[_0x2ff2('0x3')](_0x41445f,_0x2425fd);};}function removeListener(_0x2caf71,_0x173f7c){return function(){UserVoiceQueueRtEvents[_0x2ff2('0x4')](_0x2caf71,_0x173f7c);};}exports[_0x2ff2('0x5')]=function(_0x47906b){for(var _0x21f303=0x0,_0x1b155f=events[_0x2ff2('0x6')];_0x21f303<_0x1b155f;_0x21f303++){var _0x21249c=events[_0x21f303];var _0x147214=createListener(_0x2ff2('0x7')+_0x21249c,_0x47906b);UserVoiceQueueRtEvents['on'](_0x21249c,_0x147214);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 79693a9..6530f9e 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x9c0817,_0x50058d){var _0x396086=function(_0x45e7a6){while(--_0x45e7a6){_0x9c0817['push'](_0x9c0817['shift']());}};_0x396086(++_0x50058d);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index c1d0e7c..a5390b7 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 _0x5d60=['sequelize','exports','INTEGER'];(function(_0x557c4a,_0x5c1c83){var _0x16f1a3=function(_0x325710){while(--_0x325710){_0x557c4a['push'](_0x557c4a['shift']());}};_0x16f1a3(++_0x5c1c83);}(_0x5d60,0x126));var _0x05d6=function(_0x1ea9f5,_0x434149){_0x1ea9f5=_0x1ea9f5-0x0;var _0x9495bb=_0x5d60[_0x1ea9f5];return _0x9495bb;};'use strict';var Sequelize=require(_0x05d6('0x0'));module[_0x05d6('0x1')]={'penalty':{'type':Sequelize[_0x05d6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5825=['INTEGER','sequelize','exports'];(function(_0x54b71d,_0x49586c){var _0x2a18ad=function(_0x5bd229){while(--_0x5bd229){_0x54b71d['push'](_0x54b71d['shift']());}};_0x2a18ad(++_0x49586c);}(_0x5825,0xb5));var _0x5582=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5825[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x5582('0x0'));module[_0x5582('0x1')]={'penalty':{'type':Sequelize[_0x5582('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 16e5a26..ee889b9 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 _0x9c6c=['../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x9c6c,0x198));var _0xc9c6=function(_0x34cb23,_0x502e54){_0x34cb23=_0x34cb23-0x0;var _0x32c6fe=_0x9c6c[_0x34cb23];return _0x32c6fe;};'use strict';var _=require(_0xc9c6('0x0'));var util=require(_0xc9c6('0x1'));var logger=require(_0xc9c6('0x2'))(_0xc9c6('0x3'));var moment=require(_0xc9c6('0x4'));var BPromise=require(_0xc9c6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9c6('0x6'));var rimraf=require(_0xc9c6('0x7'));var config=require(_0xc9c6('0x8'));var attributes=require('./userWhatsappQueue.attributes');module[_0xc9c6('0x9')]=function(_0x117afc,_0x23f26b){return _0x117afc[_0xc9c6('0xa')](_0xc9c6('0xb'),attributes,{'tableName':_0xc9c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83cb=['path','rimraf','util','api','moment','request-promise'];(function(_0x113de0,_0x1c3edf){var _0x16042a=function(_0x5ed806){while(--_0x5ed806){_0x113de0['push'](_0x113de0['shift']());}};_0x16042a(++_0x1c3edf);}(_0x83cb,0x1b8));var _0xb83c=function(_0x572b5d,_0x517b9e){_0x572b5d=_0x572b5d-0x0;var _0x31a9f8=_0x83cb[_0x572b5d];return _0x31a9f8;};'use strict';var _=require('lodash');var util=require(_0xb83c('0x0'));var logger=require('../../config/logger')(_0xb83c('0x1'));var moment=require(_0xb83c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb83c('0x3'));var fs=require('fs');var path=require(_0xb83c('0x4'));var rimraf=require(_0xb83c('0x5'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x59018a,_0xab5d8c){return _0x59018a['define']('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 9427b87..0096363 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 _0x4af0=['jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1d7d4d,_0x2e41b2){var _0x6b4368=function(_0x5d8e41){while(--_0x5d8e41){_0x1d7d4d['push'](_0x1d7d4d['shift']());}};_0x6b4368(++_0x2e41b2);}(_0x4af0,0x1b2));var _0x04af=function(_0x5be327,_0x447811){_0x5be327=_0x5be327-0x0;var _0x53d1d4=_0x4af0[_0x5be327];return _0x53d1d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x04af('0x0'));var rs=require(_0x04af('0x1'));var fs=require('fs');var Redis=require(_0x04af('0x2'));var db=require(_0x04af('0x3'))['db'];var utils=require(_0x04af('0x4'));var logger=require('../../config/logger')(_0x04af('0x5'));var config=require('../../config/environment');var jayson=require(_0x04af('0x6'));var client=jayson[_0x04af('0x7')][_0x04af('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x163865,_0x376734,_0x40e5e0){return new BPromise(function(_0x4cd707,_0x52c79b){return client[_0x04af('0x9')](_0x163865,_0x40e5e0)['then'](function(_0x41ba13){logger[_0x04af('0xa')](_0x04af('0xb'),_0x376734,'request\x20sent');logger[_0x04af('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x376734,_0x04af('0xd'),JSON[_0x04af('0xe')](_0x41ba13));if(_0x41ba13['error']){if(_0x41ba13[_0x04af('0xf')][_0x04af('0x10')]===0x1f4){logger[_0x04af('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x376734,_0x41ba13[_0x04af('0xf')][_0x04af('0x11')]);return _0x52c79b(_0x41ba13[_0x04af('0xf')]['message']);}logger[_0x04af('0xf')](_0x04af('0xb'),_0x376734,_0x41ba13[_0x04af('0xf')][_0x04af('0x11')]);return _0x4cd707(_0x41ba13['error']['message']);}else{logger['info'](_0x04af('0xb'),_0x376734,_0x04af('0xd'));_0x4cd707(_0x41ba13[_0x04af('0x12')][_0x04af('0x11')]);}})[_0x04af('0x13')](function(_0x2f3719){logger['error'](_0x04af('0xb'),_0x376734,_0x2f3719);_0x52c79b(_0x2f3719);});});} \ No newline at end of file +var _0x60d8=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd8c3fa,_0x3bde68){var _0x20c7c1=function(_0x34e046){while(--_0x34e046){_0xd8c3fa['push'](_0xd8c3fa['shift']());}};_0x20c7c1(++_0x3bde68);}(_0x60d8,0x10f));var _0x860d=function(_0x509113,_0x2614bd){_0x509113=_0x509113-0x0;var _0x3f80cb=_0x60d8[_0x509113];return _0x3f80cb;};'use strict';var _=require(_0x860d('0x0'));var util=require(_0x860d('0x1'));var moment=require(_0x860d('0x2'));var BPromise=require(_0x860d('0x3'));var rs=require(_0x860d('0x4'));var fs=require('fs');var Redis=require(_0x860d('0x5'));var db=require(_0x860d('0x6'))['db'];var utils=require(_0x860d('0x7'));var logger=require(_0x860d('0x8'))(_0x860d('0x9'));var config=require('../../config/environment');var jayson=require(_0x860d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19245e,_0x2a8dbe,_0x5897b4){return new BPromise(function(_0x34fab3,_0x388c33){return client[_0x860d('0xb')](_0x19245e,_0x5897b4)['then'](function(_0x11ee20){logger['info'](_0x860d('0xc'),_0x2a8dbe,_0x860d('0xd'));logger[_0x860d('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2a8dbe,_0x860d('0xd'),JSON[_0x860d('0xf')](_0x11ee20));if(_0x11ee20[_0x860d('0x10')]){if(_0x11ee20[_0x860d('0x10')][_0x860d('0x11')]===0x1f4){logger['error'](_0x860d('0xc'),_0x2a8dbe,_0x11ee20[_0x860d('0x10')]['message']);return _0x388c33(_0x11ee20[_0x860d('0x10')][_0x860d('0x12')]);}logger['error'](_0x860d('0xc'),_0x2a8dbe,_0x11ee20[_0x860d('0x10')][_0x860d('0x12')]);return _0x34fab3(_0x11ee20['error'][_0x860d('0x12')]);}else{logger[_0x860d('0x13')](_0x860d('0xc'),_0x2a8dbe,'request\x20sent');_0x34fab3(_0x11ee20[_0x860d('0x14')][_0x860d('0x12')]);}})[_0x860d('0x15')](function(_0x35660c){logger[_0x860d('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2a8dbe,_0x35660c);_0x388c33(_0x35660c);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 327ee20..ec96089 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 _0x0cd6=['/:id','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./variable.controller','get','isAuthenticated','show','post','create','put'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0cd6,0x113));var _0x60cd=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0x0cd6[_0x242a98];return _0x580999;};'use strict';var multer=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var path=require('path');var timeout=require(_0x60cd('0x2'));var express=require(_0x60cd('0x3'));var router=express['Router']();var fs_extra=require(_0x60cd('0x4'));var auth=require(_0x60cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60cd('0x6'));router[_0x60cd('0x7')]('/',auth[_0x60cd('0x8')](),controller['index']);router[_0x60cd('0x7')]('/:id',auth[_0x60cd('0x8')](),controller[_0x60cd('0x9')]);router[_0x60cd('0xa')]('/',auth[_0x60cd('0x8')](),controller[_0x60cd('0xb')]);router[_0x60cd('0xc')](_0x60cd('0xd'),auth[_0x60cd('0x8')](),controller[_0x60cd('0xe')]);router['delete'](_0x60cd('0xd'),auth[_0x60cd('0x8')](),controller['destroy']);module[_0x60cd('0xf')]=router; \ No newline at end of file +var _0x79d3=['../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x41c4a6,_0xae9564){var _0x14d706=function(_0x229c97){while(--_0x229c97){_0x41c4a6['push'](_0x41c4a6['shift']());}};_0x14d706(++_0xae9564);}(_0x79d3,0x15f));var _0x379d=function(_0x14e8d3,_0x67e3a){_0x14e8d3=_0x14e8d3-0x0;var _0x1f565b=_0x79d3[_0x14e8d3];return _0x1f565b;};'use strict';var multer=require(_0x379d('0x0'));var util=require('util');var path=require(_0x379d('0x1'));var timeout=require('connect-timeout');var express=require(_0x379d('0x2'));var router=express[_0x379d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x379d('0x4'));var interaction=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var controller=require(_0x379d('0x7'));router[_0x379d('0x8')]('/',auth[_0x379d('0x9')](),controller[_0x379d('0xa')]);router['get'](_0x379d('0xb'),auth['isAuthenticated'](),controller[_0x379d('0xc')]);router[_0x379d('0xd')]('/',auth[_0x379d('0x9')](),controller['create']);router[_0x379d('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x379d('0xf')](_0x379d('0xb'),auth[_0x379d('0x9')](),controller['destroy']);module[_0x379d('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 4d9a014..47b33a7 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 _0x7fc4=['sequelize','exports','STRING','name'];(function(_0x2c3a3a,_0xa6fb56){var _0x564842=function(_0x2536c1){while(--_0x2536c1){_0x2c3a3a['push'](_0x2c3a3a['shift']());}};_0x564842(++_0xa6fb56);}(_0x7fc4,0x14c));var _0x47fc=function(_0x4db0b5,_0xcf620a){_0x4db0b5=_0x4db0b5-0x0;var _0x431c80=_0x7fc4[_0x4db0b5];return _0x431c80;};'use strict';var Sequelize=require(_0x47fc('0x0'));module[_0x47fc('0x1')]={'name':{'type':Sequelize[_0x47fc('0x2')],'unique':_0x47fc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x47fc('0x2')]}}; \ No newline at end of file +var _0x3b3c=['sequelize','STRING','name'];(function(_0x1ccbeb,_0x30a12c){var _0x129827=function(_0x4bab97){while(--_0x4bab97){_0x1ccbeb['push'](_0x1ccbeb['shift']());}};_0x129827(++_0x30a12c);}(_0x3b3c,0x13e));var _0xc3b3=function(_0x2be240,_0x1e119d){_0x2be240=_0x2be240-0x0;var _0x123543=_0x3b3c[_0x2be240];return _0x123543;};'use strict';var Sequelize=require(_0xc3b3('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3b3('0x1')],'unique':_0xc3b3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 510bdbb..dc5b1eb 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 _0xb43c=['destroy','then','get','Variables','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','Variable','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','update'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0xb43c,0xcd));var _0xcb43=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb43c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xcb43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb43('0x1'));var jsonpatch=require(_0xcb43('0x2'));var rp=require(_0xcb43('0x3'));var moment=require(_0xcb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb43('0x5'));var util=require(_0xcb43('0x6'));var path=require(_0xcb43('0x7'));var sox=require(_0xcb43('0x8'));var csv=require('to-csv');var ejs=require(_0xcb43('0x9'));var fs=require('fs');var fs_extra=require(_0xcb43('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcb43('0xb'));var deskjs=require(_0xcb43('0xc'));var toCsv=require(_0xcb43('0xd'));var querystring=require(_0xcb43('0xe'));var Papa=require(_0xcb43('0xf'));var Redis=require('ioredis');var authService=require(_0xcb43('0x10'));var qs=require(_0xcb43('0x11'));var as=require(_0xcb43('0x12'));var hardwareService=require(_0xcb43('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xcb43('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcb43('0x15'));var db=require(_0xcb43('0x16'))['db'];function respondWithStatusCode(_0x47bb96,_0x1ba205){_0x1ba205=_0x1ba205||0xcc;return function(_0x4de7d3){if(_0x4de7d3){return _0x47bb96[_0xcb43('0x17')](_0x1ba205);}return _0x47bb96[_0xcb43('0x18')](_0x1ba205)['end']();};}function respondWithResult(_0x5cf881,_0x259165){_0x259165=_0x259165||0xc8;return function(_0x2848ee){if(_0x2848ee){return _0x5cf881[_0xcb43('0x18')](_0x259165)['json'](_0x2848ee);}};}function respondWithFilteredResult(_0x2214f4,_0x28f0fe){return function(_0xf92f5c){if(_0xf92f5c){var _0x3469ef=typeof _0x28f0fe[_0xcb43('0x19')]==='undefined'&&typeof _0x28f0fe['limit']===_0xcb43('0x1a');var _0x24b7b4=_0xf92f5c[_0xcb43('0x1b')];var _0x1c9fc4=_0x3469ef?0x0:_0x28f0fe[_0xcb43('0x19')];var _0x3df41d=_0x3469ef?_0xf92f5c[_0xcb43('0x1b')]:_0x28f0fe[_0xcb43('0x19')]+_0x28f0fe[_0xcb43('0x1c')];var _0x39244a;if(_0x3df41d>=_0x24b7b4){_0x3df41d=_0x24b7b4;_0x39244a=0xc8;}else{_0x39244a=0xce;}_0x2214f4['status'](_0x39244a);return _0x2214f4[_0xcb43('0x1d')](_0xcb43('0x1e'),_0x1c9fc4+'-'+_0x3df41d+'/'+_0x24b7b4)['json'](_0xf92f5c);}return null;};}function patchUpdates(_0x4cd82a){return function(_0x480a25){try{jsonpatch['apply'](_0x480a25,_0x4cd82a,!![]);}catch(_0x4aeb4a){return BPromise['reject'](_0x4aeb4a);}return _0x480a25['save']();};}function saveUpdates(_0x11c2c4,_0x255b9f){return function(_0x33c08c){if(_0x33c08c){return _0x33c08c[_0xcb43('0x1f')](_0x11c2c4)['then'](function(_0x1a29b0){return _0x1a29b0;});}return null;};}function removeEntity(_0x564e17,_0x29f0eb){return function(_0x3962d6){if(_0x3962d6){return _0x3962d6[_0xcb43('0x20')]()[_0xcb43('0x21')](function(){var _0x362a60=_0x3962d6[_0xcb43('0x22')]({'plain':!![]});var _0x4a22c2=_0xcb43('0x23');return db[_0xcb43('0x24')]['destroy']({'where':{'type':_0x4a22c2,'resourceId':_0x362a60['id']}})[_0xcb43('0x21')](function(){return _0x3962d6;});})[_0xcb43('0x21')](function(){_0x564e17[_0xcb43('0x18')](0xcc)[_0xcb43('0x25')]();});}};}function handleEntityNotFound(_0x2a9fb6,_0x1748e7){return function(_0x37d6a9){if(!_0x37d6a9){_0x2a9fb6[_0xcb43('0x17')](0x194);}return _0x37d6a9;};}function handleError(_0x328b37,_0x1181a0){_0x1181a0=_0x1181a0||0x1f4;return function(_0xc07f21){logger[_0xcb43('0x26')](_0xc07f21['stack']);if(_0xc07f21[_0xcb43('0x27')]){delete _0xc07f21[_0xcb43('0x27')];}_0x328b37['status'](_0x1181a0)[_0xcb43('0x28')](_0xc07f21);};}exports[_0xcb43('0x29')]=function(_0x4e2e9f,_0x3060e9){var _0x24d419={},_0x3a4967={},_0x83b1f2={'count':0x0,'rows':[]};var _0x2ac745=_[_0xcb43('0x2a')](db['Variable'][_0xcb43('0x2b')],function(_0x5bc4ba){return{'name':_0x5bc4ba[_0xcb43('0x2c')],'type':_0x5bc4ba[_0xcb43('0x2d')][_0xcb43('0x2e')]};});_0x3a4967[_0xcb43('0x2f')]=_[_0xcb43('0x2a')](_0x2ac745,_0xcb43('0x27'));_0x3a4967[_0xcb43('0x30')]=_[_0xcb43('0x31')](_0x4e2e9f[_0xcb43('0x30')]);_0x3a4967['filters']=_[_0xcb43('0x32')](_0x3a4967[_0xcb43('0x2f')],_0x3a4967[_0xcb43('0x30')]);_0x24d419[_0xcb43('0x33')]=_[_0xcb43('0x32')](_0x3a4967[_0xcb43('0x2f')],qs[_0xcb43('0x34')](_0x4e2e9f[_0xcb43('0x30')][_0xcb43('0x34')]));_0x24d419[_0xcb43('0x33')]=_0x24d419[_0xcb43('0x33')][_0xcb43('0x35')]?_0x24d419[_0xcb43('0x33')]:_0x3a4967[_0xcb43('0x2f')];if(!_0x4e2e9f[_0xcb43('0x30')][_0xcb43('0x36')](_0xcb43('0x37'))){_0x24d419[_0xcb43('0x1c')]=qs[_0xcb43('0x1c')](_0x4e2e9f['query'][_0xcb43('0x1c')]);_0x24d419['offset']=qs[_0xcb43('0x19')](_0x4e2e9f[_0xcb43('0x30')][_0xcb43('0x19')]);}_0x24d419['order']=qs[_0xcb43('0x38')](_0x4e2e9f[_0xcb43('0x30')]['sort']);_0x24d419[_0xcb43('0x39')]=qs[_0xcb43('0x3a')](_['pick'](_0x4e2e9f['query'],_0x3a4967[_0xcb43('0x3a')]),_0x2ac745);if(_0x4e2e9f[_0xcb43('0x30')][_0xcb43('0x3b')]){_0x24d419[_0xcb43('0x39')]=_[_0xcb43('0x3c')](_0x24d419[_0xcb43('0x39')],{'$or':_[_0xcb43('0x2a')](_0x2ac745,function(_0xc534a5){if(_0xc534a5['type']!==_0xcb43('0x3d')){var _0x31d31d={};_0x31d31d[_0xc534a5[_0xcb43('0x27')]]={'$like':'%'+_0x4e2e9f[_0xcb43('0x30')][_0xcb43('0x3b')]+'%'};return _0x31d31d;}})});}_0x24d419=_[_0xcb43('0x3c')]({},_0x24d419,_0x4e2e9f[_0xcb43('0x3e')]);var _0x31d99e={'where':_0x24d419[_0xcb43('0x39')]};return db[_0xcb43('0x3f')]['count'](_0x31d99e)['then'](function(_0x5baf91){_0x83b1f2[_0xcb43('0x1b')]=_0x5baf91;if(_0x4e2e9f[_0xcb43('0x30')][_0xcb43('0x40')]){_0x24d419[_0xcb43('0x41')]=[{'all':!![]}];}return db[_0xcb43('0x3f')][_0xcb43('0x42')](_0x24d419);})['then'](function(_0x2090ff){_0x83b1f2[_0xcb43('0x43')]=_0x2090ff;return _0x83b1f2;})['then'](respondWithFilteredResult(_0x3060e9,_0x24d419))['catch'](handleError(_0x3060e9,null));};exports[_0xcb43('0x44')]=function(_0x5c6bff,_0x557939){var _0x9acfc={'raw':!![],'where':{'id':_0x5c6bff[_0xcb43('0x45')]['id']}},_0x1a70c3={};_0x1a70c3[_0xcb43('0x2f')]=_[_0xcb43('0x31')](db[_0xcb43('0x3f')][_0xcb43('0x2b')]);_0x1a70c3[_0xcb43('0x30')]=_[_0xcb43('0x31')](_0x5c6bff[_0xcb43('0x30')]);_0x1a70c3[_0xcb43('0x3a')]=_['intersection'](_0x1a70c3[_0xcb43('0x2f')],_0x1a70c3[_0xcb43('0x30')]);_0x9acfc[_0xcb43('0x33')]=_[_0xcb43('0x32')](_0x1a70c3[_0xcb43('0x2f')],qs[_0xcb43('0x34')](_0x5c6bff['query'][_0xcb43('0x34')]));_0x9acfc[_0xcb43('0x33')]=_0x9acfc[_0xcb43('0x33')][_0xcb43('0x35')]?_0x9acfc['attributes']:_0x1a70c3[_0xcb43('0x2f')];if(_0x5c6bff[_0xcb43('0x30')][_0xcb43('0x40')]){_0x9acfc[_0xcb43('0x41')]=[{'all':!![]}];}_0x9acfc=_['merge']({},_0x9acfc,_0x5c6bff[_0xcb43('0x3e')]);return db['Variable'][_0xcb43('0x46')](_0x9acfc)['then'](handleEntityNotFound(_0x557939,null))[_0xcb43('0x21')](respondWithResult(_0x557939,null))['catch'](handleError(_0x557939,null));};exports[_0xcb43('0x47')]=function(_0x49763f,_0x37fd93){return db[_0xcb43('0x3f')][_0xcb43('0x47')](_0x49763f[_0xcb43('0x48')],{})['then'](function(_0x50ebfe){var _0x2b8d8c=_0x49763f['user'][_0xcb43('0x22')]({'plain':!![]});if(!_0x2b8d8c)throw new Error(_0xcb43('0x49'));if(_0x2b8d8c[_0xcb43('0x4a')]==='user'){var _0x1f665e=_0x50ebfe[_0xcb43('0x22')]({'plain':!![]});var _0x511938=_0xcb43('0x23');return db[_0xcb43('0x4b')]['find']({'where':{'name':_0x511938,'userProfileId':_0x2b8d8c[_0xcb43('0x4c')]},'raw':!![]})[_0xcb43('0x21')](function(_0x5ce66e){if(_0x5ce66e&&_0x5ce66e['autoAssociation']===0x0){return db[_0xcb43('0x24')]['create']({'name':_0x1f665e[_0xcb43('0x27')],'resourceId':_0x1f665e['id'],'type':_0x5ce66e['name'],'sectionId':_0x5ce66e['id']},{})[_0xcb43('0x21')](function(){return _0x50ebfe;});}else{return _0x50ebfe;}})[_0xcb43('0x4d')](function(_0x233753){logger[_0xcb43('0x26')](_0xcb43('0x4e'),_0x233753);throw _0x233753;});}return _0x50ebfe;})[_0xcb43('0x21')](respondWithResult(_0x37fd93,0xc9))[_0xcb43('0x4d')](handleError(_0x37fd93,null));};exports[_0xcb43('0x1f')]=function(_0x3f6ce7,_0x288672){if(_0x3f6ce7['body']['id']){delete _0x3f6ce7[_0xcb43('0x48')]['id'];}return db['Variable']['find']({'where':{'id':_0x3f6ce7['params']['id']}})[_0xcb43('0x21')](handleEntityNotFound(_0x288672,null))['then'](saveUpdates(_0x3f6ce7[_0xcb43('0x48')],null))[_0xcb43('0x21')](respondWithResult(_0x288672,null))[_0xcb43('0x4d')](handleError(_0x288672,null));};exports[_0xcb43('0x20')]=function(_0x499cd9,_0x4bbf81){return db['Variable'][_0xcb43('0x46')]({'where':{'id':_0x499cd9[_0xcb43('0x45')]['id']}})[_0xcb43('0x21')](handleEntityNotFound(_0x4bbf81,null))['then'](removeEntity(_0x4bbf81,null))[_0xcb43('0x4d')](handleError(_0x4bbf81,null));}; \ No newline at end of file +var _0xe5dc=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','Variable','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','fields','create','user','role','userProfileId','autoAssociation'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe5dc,0x1f0));var _0xce5d=function(_0x374d0b,_0x5b76fc){_0x374d0b=_0x374d0b-0x0;var _0x250ec7=_0xe5dc[_0x374d0b];return _0x250ec7;};'use strict';var emlformat=require(_0xce5d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce5d('0x1'));var jsonpatch=require(_0xce5d('0x2'));var rp=require(_0xce5d('0x3'));var moment=require(_0xce5d('0x4'));var BPromise=require(_0xce5d('0x5'));var Mustache=require('mustache');var util=require(_0xce5d('0x6'));var path=require(_0xce5d('0x7'));var sox=require('sox');var csv=require(_0xce5d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce5d('0x9'));var _=require(_0xce5d('0xa'));var squel=require(_0xce5d('0xb'));var crypto=require(_0xce5d('0xc'));var jsforce=require(_0xce5d('0xd'));var deskjs=require(_0xce5d('0xe'));var toCsv=require(_0xce5d('0x8'));var querystring=require(_0xce5d('0xf'));var Papa=require(_0xce5d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce5d('0x11'));var as=require(_0xce5d('0x12'));var hardwareService=require(_0xce5d('0x13'));var logger=require(_0xce5d('0x14'))(_0xce5d('0x15'));var utils=require(_0xce5d('0x16'));var config=require(_0xce5d('0x17'));var licenseUtil=require(_0xce5d('0x18'));var db=require(_0xce5d('0x19'))['db'];function respondWithStatusCode(_0xdb0d0f,_0x5e783c){_0x5e783c=_0x5e783c||0xcc;return function(_0xeccb17){if(_0xeccb17){return _0xdb0d0f[_0xce5d('0x1a')](_0x5e783c);}return _0xdb0d0f['status'](_0x5e783c)[_0xce5d('0x1b')]();};}function respondWithResult(_0xc2f627,_0x4fc465){_0x4fc465=_0x4fc465||0xc8;return function(_0x5f0019){if(_0x5f0019){return _0xc2f627[_0xce5d('0x1c')](_0x4fc465)[_0xce5d('0x1d')](_0x5f0019);}};}function respondWithFilteredResult(_0x4d33a5,_0x2fb3cd){return function(_0x37e5e6){if(_0x37e5e6){var _0xd98328=typeof _0x2fb3cd['offset']==='undefined'&&typeof _0x2fb3cd[_0xce5d('0x1e')]==='undefined';var _0x10b40b=_0x37e5e6[_0xce5d('0x1f')];var _0x560df9=_0xd98328?0x0:_0x2fb3cd[_0xce5d('0x20')];var _0x26840e=_0xd98328?_0x37e5e6[_0xce5d('0x1f')]:_0x2fb3cd[_0xce5d('0x20')]+_0x2fb3cd[_0xce5d('0x1e')];var _0xf78415;if(_0x26840e>=_0x10b40b){_0x26840e=_0x10b40b;_0xf78415=0xc8;}else{_0xf78415=0xce;}_0x4d33a5[_0xce5d('0x1c')](_0xf78415);return _0x4d33a5[_0xce5d('0x21')](_0xce5d('0x22'),_0x560df9+'-'+_0x26840e+'/'+_0x10b40b)['json'](_0x37e5e6);}return null;};}function patchUpdates(_0x1fc2dc){return function(_0x2c8078){try{jsonpatch['apply'](_0x2c8078,_0x1fc2dc,!![]);}catch(_0x34d48c){return BPromise['reject'](_0x34d48c);}return _0x2c8078[_0xce5d('0x23')]();};}function saveUpdates(_0x5a2667,_0x248751){return function(_0x2321c4){if(_0x2321c4){return _0x2321c4[_0xce5d('0x24')](_0x5a2667)[_0xce5d('0x25')](function(_0x40b6f9){return _0x40b6f9;});}return null;};}function removeEntity(_0x1adaf2,_0xd0a41d){return function(_0x4531b2){if(_0x4531b2){return _0x4531b2[_0xce5d('0x26')]()[_0xce5d('0x25')](function(){var _0x3533ee=_0x4531b2[_0xce5d('0x27')]({'plain':!![]});var _0x6fed01=_0xce5d('0x28');return db[_0xce5d('0x29')][_0xce5d('0x26')]({'where':{'type':_0x6fed01,'resourceId':_0x3533ee['id']}})[_0xce5d('0x25')](function(){return _0x4531b2;});})['then'](function(){_0x1adaf2[_0xce5d('0x1c')](0xcc)[_0xce5d('0x1b')]();});}};}function handleEntityNotFound(_0x5bc587,_0x19bb43){return function(_0x4ff404){if(!_0x4ff404){_0x5bc587[_0xce5d('0x1a')](0x194);}return _0x4ff404;};}function handleError(_0x399c3a,_0x1bfdb5){_0x1bfdb5=_0x1bfdb5||0x1f4;return function(_0xa2602b){logger[_0xce5d('0x2a')](_0xa2602b[_0xce5d('0x2b')]);if(_0xa2602b[_0xce5d('0x2c')]){delete _0xa2602b[_0xce5d('0x2c')];}_0x399c3a[_0xce5d('0x1c')](_0x1bfdb5)[_0xce5d('0x2d')](_0xa2602b);};}exports['index']=function(_0x164ca5,_0x13ccee){var _0x3e0e71={},_0x2fc9f8={},_0x2207a4={'count':0x0,'rows':[]};var _0x36a410=_['map'](db[_0xce5d('0x2e')][_0xce5d('0x2f')],function(_0x4c5fd9){return{'name':_0x4c5fd9[_0xce5d('0x30')],'type':_0x4c5fd9['type'][_0xce5d('0x31')]};});_0x2fc9f8[_0xce5d('0x32')]=_[_0xce5d('0x33')](_0x36a410,_0xce5d('0x2c'));_0x2fc9f8[_0xce5d('0x34')]=_[_0xce5d('0x35')](_0x164ca5[_0xce5d('0x34')]);_0x2fc9f8[_0xce5d('0x36')]=_['intersection'](_0x2fc9f8[_0xce5d('0x32')],_0x2fc9f8[_0xce5d('0x34')]);_0x3e0e71[_0xce5d('0x37')]=_[_0xce5d('0x38')](_0x2fc9f8[_0xce5d('0x32')],qs['fields'](_0x164ca5[_0xce5d('0x34')]['fields']));_0x3e0e71[_0xce5d('0x37')]=_0x3e0e71[_0xce5d('0x37')][_0xce5d('0x39')]?_0x3e0e71[_0xce5d('0x37')]:_0x2fc9f8[_0xce5d('0x32')];if(!_0x164ca5[_0xce5d('0x34')][_0xce5d('0x3a')]('nolimit')){_0x3e0e71[_0xce5d('0x1e')]=qs[_0xce5d('0x1e')](_0x164ca5[_0xce5d('0x34')][_0xce5d('0x1e')]);_0x3e0e71['offset']=qs[_0xce5d('0x20')](_0x164ca5['query'][_0xce5d('0x20')]);}_0x3e0e71['order']=qs['sort'](_0x164ca5[_0xce5d('0x34')][_0xce5d('0x3b')]);_0x3e0e71[_0xce5d('0x3c')]=qs[_0xce5d('0x36')](_[_0xce5d('0x3d')](_0x164ca5[_0xce5d('0x34')],_0x2fc9f8[_0xce5d('0x36')]),_0x36a410);if(_0x164ca5['query'][_0xce5d('0x3e')]){_0x3e0e71['where']=_['merge'](_0x3e0e71[_0xce5d('0x3c')],{'$or':_[_0xce5d('0x33')](_0x36a410,function(_0x52f6b3){if(_0x52f6b3[_0xce5d('0x3f')]!==_0xce5d('0x40')){var _0xb08f8d={};_0xb08f8d[_0x52f6b3[_0xce5d('0x2c')]]={'$like':'%'+_0x164ca5[_0xce5d('0x34')][_0xce5d('0x3e')]+'%'};return _0xb08f8d;}})});}_0x3e0e71=_[_0xce5d('0x41')]({},_0x3e0e71,_0x164ca5[_0xce5d('0x42')]);var _0x49a0d4={'where':_0x3e0e71['where']};return db[_0xce5d('0x2e')][_0xce5d('0x1f')](_0x49a0d4)[_0xce5d('0x25')](function(_0x510dc7){_0x2207a4[_0xce5d('0x1f')]=_0x510dc7;if(_0x164ca5[_0xce5d('0x34')][_0xce5d('0x43')]){_0x3e0e71['include']=[{'all':!![]}];}return db[_0xce5d('0x2e')][_0xce5d('0x44')](_0x3e0e71);})[_0xce5d('0x25')](function(_0x3c5664){_0x2207a4[_0xce5d('0x45')]=_0x3c5664;return _0x2207a4;})[_0xce5d('0x25')](respondWithFilteredResult(_0x13ccee,_0x3e0e71))[_0xce5d('0x46')](handleError(_0x13ccee,null));};exports[_0xce5d('0x47')]=function(_0x1d1d5e,_0x46460e){var _0x5a3713={'raw':!![],'where':{'id':_0x1d1d5e['params']['id']}},_0x36bca4={};_0x36bca4[_0xce5d('0x32')]=_[_0xce5d('0x35')](db[_0xce5d('0x2e')][_0xce5d('0x2f')]);_0x36bca4[_0xce5d('0x34')]=_[_0xce5d('0x35')](_0x1d1d5e[_0xce5d('0x34')]);_0x36bca4['filters']=_['intersection'](_0x36bca4[_0xce5d('0x32')],_0x36bca4[_0xce5d('0x34')]);_0x5a3713[_0xce5d('0x37')]=_[_0xce5d('0x38')](_0x36bca4['model'],qs[_0xce5d('0x48')](_0x1d1d5e[_0xce5d('0x34')][_0xce5d('0x48')]));_0x5a3713[_0xce5d('0x37')]=_0x5a3713[_0xce5d('0x37')][_0xce5d('0x39')]?_0x5a3713[_0xce5d('0x37')]:_0x36bca4[_0xce5d('0x32')];if(_0x1d1d5e[_0xce5d('0x34')][_0xce5d('0x43')]){_0x5a3713['include']=[{'all':!![]}];}_0x5a3713=_[_0xce5d('0x41')]({},_0x5a3713,_0x1d1d5e[_0xce5d('0x42')]);return db[_0xce5d('0x2e')]['find'](_0x5a3713)[_0xce5d('0x25')](handleEntityNotFound(_0x46460e,null))[_0xce5d('0x25')](respondWithResult(_0x46460e,null))[_0xce5d('0x46')](handleError(_0x46460e,null));};exports[_0xce5d('0x49')]=function(_0x1b0ada,_0x5a9e29){return db['Variable'][_0xce5d('0x49')](_0x1b0ada['body'],{})[_0xce5d('0x25')](function(_0x5aed31){var _0x1de21b=_0x1b0ada[_0xce5d('0x4a')][_0xce5d('0x27')]({'plain':!![]});if(!_0x1de21b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1de21b[_0xce5d('0x4b')]==='user'){var _0xb99bfc=_0x5aed31[_0xce5d('0x27')]({'plain':!![]});var _0x354149=_0xce5d('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x354149,'userProfileId':_0x1de21b[_0xce5d('0x4c')]},'raw':!![]})['then'](function(_0x4d951a){if(_0x4d951a&&_0x4d951a[_0xce5d('0x4d')]===0x0){return db['UserProfileResource'][_0xce5d('0x49')]({'name':_0xb99bfc['name'],'resourceId':_0xb99bfc['id'],'type':_0x4d951a[_0xce5d('0x2c')],'sectionId':_0x4d951a['id']},{})[_0xce5d('0x25')](function(){return _0x5aed31;});}else{return _0x5aed31;}})['catch'](function(_0x570b2b){logger[_0xce5d('0x2a')](_0xce5d('0x4e'),_0x570b2b);throw _0x570b2b;});}return _0x5aed31;})[_0xce5d('0x25')](respondWithResult(_0x5a9e29,0xc9))[_0xce5d('0x46')](handleError(_0x5a9e29,null));};exports['update']=function(_0x1aa9ae,_0x17a359){if(_0x1aa9ae[_0xce5d('0x4f')]['id']){delete _0x1aa9ae[_0xce5d('0x4f')]['id'];}return db['Variable'][_0xce5d('0x50')]({'where':{'id':_0x1aa9ae[_0xce5d('0x51')]['id']}})[_0xce5d('0x25')](handleEntityNotFound(_0x17a359,null))[_0xce5d('0x25')](saveUpdates(_0x1aa9ae['body'],null))[_0xce5d('0x25')](respondWithResult(_0x17a359,null))[_0xce5d('0x46')](handleError(_0x17a359,null));};exports['destroy']=function(_0x45185c,_0x4d73fd){return db[_0xce5d('0x2e')][_0xce5d('0x50')]({'where':{'id':_0x45185c[_0xce5d('0x51')]['id']}})['then'](handleEntityNotFound(_0x4d73fd,null))['then'](removeEntity(_0x4d73fd,null))[_0xce5d('0x46')](handleError(_0x4d73fd,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 8996027..674ccc3 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 _0x9174=['tools_variables','lodash','util','bluebird','request-promise','path','../../config/environment','exports','define','Variable'];(function(_0x3c54cf,_0x74e5c6){var _0x2e1a5e=function(_0x1f7f1b){while(--_0x1f7f1b){_0x3c54cf['push'](_0x3c54cf['shift']());}};_0x2e1a5e(++_0x74e5c6);}(_0x9174,0x8d));var _0x4917=function(_0x45eb96,_0x401baf){_0x45eb96=_0x45eb96-0x0;var _0x50f6ae=_0x9174[_0x45eb96];return _0x50f6ae;};'use strict';var _=require(_0x4917('0x0'));var util=require(_0x4917('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4917('0x2'));var rp=require(_0x4917('0x3'));var fs=require('fs');var path=require(_0x4917('0x4'));var rimraf=require('rimraf');var config=require(_0x4917('0x5'));var attributes=require('./variable.attributes');module[_0x4917('0x6')]=function(_0x23dcf5,_0x28256f){return _0x23dcf5[_0x4917('0x7')](_0x4917('0x8'),attributes,{'tableName':_0x4917('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdee6=['./variable.attributes','exports','tools_variables','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1c76fb,_0x36e3b7){var _0x18c8a7=function(_0x182836){while(--_0x182836){_0x1c76fb['push'](_0x1c76fb['shift']());}};_0x18c8a7(++_0x36e3b7);}(_0xdee6,0x161));var _0x6dee=function(_0x8278b5,_0x5870ca){_0x8278b5=_0x8278b5-0x0;var _0x429faf=_0xdee6[_0x8278b5];return _0x429faf;};'use strict';var _=require('lodash');var util=require(_0x6dee('0x0'));var logger=require(_0x6dee('0x1'))('api');var moment=require(_0x6dee('0x2'));var BPromise=require('bluebird');var rp=require(_0x6dee('0x3'));var fs=require('fs');var path=require(_0x6dee('0x4'));var rimraf=require(_0x6dee('0x5'));var config=require(_0x6dee('0x6'));var attributes=require(_0x6dee('0x7'));module[_0x6dee('0x8')]=function(_0x16f9db,_0x4fde20){return _0x16f9db['define']('Variable',attributes,{'tableName':_0x6dee('0x9'),'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 1694846..3335f3a 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 _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d9c08,_0x68d66e){var _0x3d07ae=function(_0x1f6d8d){while(--_0x1f6d8d){_0x5d9c08['push'](_0x5d9c08['shift']());}};_0x3d07ae(++_0x68d66e);}(_0x8ef6,0xf2));var _0x68ef=function(_0x557243,_0xd544c9){_0x557243=_0x557243-0x0;var _0x18a88d=_0x8ef6[_0x557243];return _0x18a88d;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file +var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x8ef6,0xf2));var _0x68ef=function(_0x59fb23,_0x303463){_0x59fb23=_0x59fb23-0x0;var _0x795360=_0x8ef6[_0x59fb23];return _0x795360;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 0f19a53..be8d8d4 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 _0x2238=['fetch','pull','/restart','restart','/migrations','migrations','express','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate'];(function(_0x24f107,_0x3c6c88){var _0x5116ab=function(_0x2b4985){while(--_0x2b4985){_0x24f107['push'](_0x24f107['shift']());}};_0x5116ab(++_0x3c6c88);}(_0x2238,0xca));var _0x8223=function(_0x2ae46b,_0x1f1dc2){_0x2ae46b=_0x2ae46b-0x0;var _0x2c5448=_0x2238[_0x2ae46b];return _0x2c5448;};'use strict';var express=require(_0x8223('0x0'));var router=express[_0x8223('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x8223('0x2'));router[_0x8223('0x3')]('/',controller[_0x8223('0x4')]);router[_0x8223('0x3')](_0x8223('0x5'),auth[_0x8223('0x6')](),auth[_0x8223('0x7')](),controller[_0x8223('0x8')]);router[_0x8223('0x3')]('/reset',auth[_0x8223('0x6')](),auth[_0x8223('0x7')](),controller['reset']);router['get']('/pull',auth[_0x8223('0x6')](),auth[_0x8223('0x7')](),controller[_0x8223('0x9')]);router['get'](_0x8223('0xa'),auth['isAuthenticated'](),controller[_0x8223('0xb')]);router[_0x8223('0x3')](_0x8223('0xc'),controller[_0x8223('0xd')]);module['exports']=router; \ No newline at end of file +var _0xc79b=['/restart','restart','/migrations','migrations','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','fetch','/pull','canUpdate','pull'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc79b,0xac));var _0xbc79=function(_0x33efaf,_0x361a2f){_0x33efaf=_0x33efaf-0x0;var _0x2622b2=_0xc79b[_0x33efaf];return _0x2622b2;};'use strict';var express=require('express');var router=express[_0xbc79('0x0')]();var auth=require(_0xbc79('0x1'));var controller=require(_0xbc79('0x2'));router[_0xbc79('0x3')]('/',controller['index']);router[_0xbc79('0x3')](_0xbc79('0x4'),auth[_0xbc79('0x5')](),auth['canUpdate'](),controller[_0xbc79('0x6')]);router['get']('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller['reset']);router[_0xbc79('0x3')](_0xbc79('0x7'),auth[_0xbc79('0x5')](),auth[_0xbc79('0x8')](),controller[_0xbc79('0x9')]);router[_0xbc79('0x3')](_0xbc79('0xa'),auth[_0xbc79('0x5')](),controller[_0xbc79('0xb')]);router[_0xbc79('0x3')](_0xbc79('0xc'),controller[_0xbc79('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4d364b7..780a76a 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 _0xfa5d=['latest','fetch','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','Migration','getQueryInterface','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','exports','query'];(function(_0x3acdd4,_0x3848a1){var _0x2a3eab=function(_0x3545d9){while(--_0x3545d9){_0x3acdd4['push'](_0x3acdd4['shift']());}};_0x2a3eab(++_0x3848a1);}(_0xfa5d,0x10e));var _0xdfa5=function(_0x43a2c3,_0xf160f5){_0x43a2c3=_0x43a2c3-0x0;var _0x50bf79=_0xfa5d[_0x43a2c3];return _0x50bf79;};'use strict';var Umzug=require(_0xdfa5('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xdfa5('0x1'))(module,_0xdfa5('0x2'));var compareVersions=require(_0xdfa5('0x3'));var exec=require('child_process')['exec'];var db=require(_0xdfa5('0x4'))['db'];var config=require(_0xdfa5('0x5'));var pm2=require(_0xdfa5('0x6'));var logger=require(_0xdfa5('0x7'))(_0xdfa5('0x8'));var git=require('simple-git')(config[_0xdfa5('0x9')]);exports['index']=function(_0x143507,_0x508b83){var _0x496140={'current':module[_0xdfa5('0xa')]['version'],'phonebar':0x2};if(_0x143507[_0xdfa5('0xb')]&&_0x143507['query'][_0xdfa5('0xc')]){return git[_0xdfa5('0xd')]()['tags'](function(_0xc7c55c,_0x47c268){_0x496140['latest']=(_0xc7c55c?module[_0xdfa5('0xa')][_0xdfa5('0x2')]:_0x47c268[_0xdfa5('0xc')])||_0xdfa5('0xe');return _0x508b83[_0xdfa5('0xf')](0xc8)[_0xdfa5('0x10')](_0x496140);});}else{return _0x508b83[_0xdfa5('0xf')](0xc8)['json'](_0x496140);}};exports[_0xdfa5('0xd')]=function(_0x1277ab,_0x3bf65b){return git[_0xdfa5('0xd')](['origin',_0xdfa5('0x11')],function(_0x34fbb6){if(_0x34fbb6){logger[_0xdfa5('0x12')](_0x34fbb6);return _0x3bf65b[_0xdfa5('0xf')](0x1f4)[_0xdfa5('0x10')](_0x34fbb6);}logger[_0xdfa5('0x13')](_0xdfa5('0x14'));return _0x3bf65b[_0xdfa5('0xf')](0xc8)['json']({'output':_0xdfa5('0x15')});});};exports['reset']=function(_0x56aee9,_0x4c8d16){return git[_0xdfa5('0x16')]([_0xdfa5('0x17'),'FETCH_HEAD'],function(_0x2a8b71){if(_0x2a8b71){logger[_0xdfa5('0x12')](_0x2a8b71);return _0x4c8d16[_0xdfa5('0xf')](0x1f4)[_0xdfa5('0x10')](_0x2a8b71);}logger[_0xdfa5('0x13')](_0xdfa5('0x18'));return _0x4c8d16[_0xdfa5('0xf')](0xc8)['json']({'output':_0xdfa5('0x19')});});};exports['pull']=function(_0x6b2570,_0x2263a4){exec(_0xdfa5('0x1a'),function(_0x30705a,_0x416e83,_0x20c245){logger[_0xdfa5('0x13')](_0x416e83);logger[_0xdfa5('0x13')](_0x20c245);if(_0x30705a){logger['error'](_0x30705a);return _0x2263a4[_0xdfa5('0xf')](0x1f4)[_0xdfa5('0x10')](_0x30705a);}return _0x2263a4['status'](0xc8)['json']({'output':_0x416e83});});};exports[_0xdfa5('0x1b')]=function(_0x1920b7,_0x33e4a1){return pm2[_0xdfa5('0x1b')](_0xdfa5('0x1c'))[_0xdfa5('0x1d')](function(_0x36ab74){logger[_0xdfa5('0x13')](_0xdfa5('0x1e'),_0x36ab74);return _0x33e4a1[_0xdfa5('0xf')](0xc8)[_0xdfa5('0x10')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x2073c0){logger[_0xdfa5('0x12')](_0x2073c0);return _0x33e4a1[_0xdfa5('0xf')](0x1f4)['json'](_0x2073c0);});};exports[_0xdfa5('0x1f')]=function(_0x5ca800,_0x707613){var _0x1b5f2f=fs[_0xdfa5('0x20')](path[_0xdfa5('0x21')](config['root'],_0xdfa5('0x22'),_0xdfa5('0x1f')));var _0x3229db=[];for(var _0x19094f=0x0;_0x19094f<_0x1b5f2f[_0xdfa5('0x23')];_0x19094f++){var _0x180eb6=_0x1b5f2f[_0x19094f][_0xdfa5('0x24')](_0xdfa5('0x25'),'');if(compareVersions(module[_0xdfa5('0xa')][_0xdfa5('0x2')],_0x180eb6)===-0x1){_0x3229db[_0xdfa5('0x26')](_0x180eb6);}}if(_0x3229db['length']){var _0x571558=_0x3229db['sort'](compareVersions);var _0xf4de79=new Umzug({'storage':_0xdfa5('0x27'),'storageOptions':{'model':db[_0xdfa5('0x28')],'modelName':_0xdfa5('0x28'),'columnName':_0xdfa5('0x2')},'migrations':{'params':[db['sequelize'][_0xdfa5('0x29')](),db[_0xdfa5('0x27')]['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[_0xdfa5('0x21')](config[_0xdfa5('0x9')],'server',_0xdfa5('0x1f')),'pattern':/\.js$/}});_0xf4de79['up']({'migrations':_['map'](_0x571558,function(_0x114c4c){return _0x114c4c+'.js';})})[_0xdfa5('0x1d')](function(){return _0x707613[_0xdfa5('0xf')](0xc8)[_0xdfa5('0x10')]({'output':_0xdfa5('0x2a')+module[_0xdfa5('0xa')]['version']+_0xdfa5('0x2b')+_['last'](_0x571558),'migrations':_[_0xdfa5('0x21')](_0x571558)});})[_0xdfa5('0x2c')](function(_0x17f9ab){if(_0x17f9ab instanceof db[_0xdfa5('0x27')][_0xdfa5('0x2d')]){return _0x707613['status'](0xc8)[_0xdfa5('0x10')]({'output':_0xdfa5('0x2e')});}else{return _0x707613[_0xdfa5('0xf')](0x1f4)[_0xdfa5('0x10')](_0x17f9ab);}});}else{return _0x707613['status'](0xc8)[_0xdfa5('0x10')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x317c=['reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','replace','.js','push','sort','Migration','sequelize','getQueryInterface','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch'];(function(_0x4693ea,_0x145b6d){var _0x5e5052=function(_0x5c54ac){while(--_0x5c54ac){_0x4693ea['push'](_0x4693ea['shift']());}};_0x5e5052(++_0x145b6d);}(_0x317c,0x117));var _0xc317=function(_0x3ad23a,_0x5c0863){_0x3ad23a=_0x3ad23a-0x0;var _0x35a05e=_0x317c[_0x3ad23a];return _0x35a05e;};'use strict';var Umzug=require(_0xc317('0x0'));var path=require(_0xc317('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xc317('0x2'))(module,_0xc317('0x3'));var compareVersions=require(_0xc317('0x4'));var exec=require(_0xc317('0x5'))[_0xc317('0x6')];var db=require(_0xc317('0x7'))['db'];var config=require(_0xc317('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xc317('0x9'))(_0xc317('0xa'));var git=require(_0xc317('0xb'))(config[_0xc317('0xc')]);exports[_0xc317('0xd')]=function(_0x1a4092,_0x58f8b2){var _0x105baa={'current':module[_0xc317('0xe')][_0xc317('0x3')],'phonebar':0x2};if(_0x1a4092['query']&&_0x1a4092[_0xc317('0xf')][_0xc317('0x10')]){return git['fetch']()[_0xc317('0x11')](function(_0x471bec,_0x4fa871){_0x105baa[_0xc317('0x10')]=(_0x471bec?module[_0xc317('0xe')]['version']:_0x4fa871['latest'])||_0xc317('0x12');return _0x58f8b2[_0xc317('0x13')](0xc8)['json'](_0x105baa);});}else{return _0x58f8b2[_0xc317('0x13')](0xc8)[_0xc317('0x14')](_0x105baa);}};exports[_0xc317('0x15')]=function(_0x504cc6,_0x21d90b){return git[_0xc317('0x15')]([_0xc317('0x16'),_0xc317('0x17')],function(_0x660fe){if(_0x660fe){logger[_0xc317('0x18')](_0x660fe);return _0x21d90b[_0xc317('0x13')](0x1f4)[_0xc317('0x14')](_0x660fe);}logger[_0xc317('0x19')](_0xc317('0x1a'));return _0x21d90b['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc317('0x1b')]=function(_0x16367e,_0x345cfd){return git[_0xc317('0x1b')]([_0xc317('0x1c'),_0xc317('0x1d')],function(_0x818ca7){if(_0x818ca7){logger[_0xc317('0x18')](_0x818ca7);return _0x345cfd['status'](0x1f4)['json'](_0x818ca7);}logger[_0xc317('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x345cfd[_0xc317('0x13')](0xc8)[_0xc317('0x14')]({'output':_0xc317('0x1e')});});};exports[_0xc317('0x1f')]=function(_0x32e452,_0x533e53){exec('npm\x20install\x20--production',function(_0x419c3c,_0x50e7fd,_0xf7ce51){logger[_0xc317('0x19')](_0x50e7fd);logger['info'](_0xf7ce51);if(_0x419c3c){logger['error'](_0x419c3c);return _0x533e53[_0xc317('0x13')](0x1f4)[_0xc317('0x14')](_0x419c3c);}return _0x533e53[_0xc317('0x13')](0xc8)['json']({'output':_0x50e7fd});});};exports['restart']=function(_0x1d985a,_0x3b4248){return pm2[_0xc317('0x20')](_0xc317('0x21'))['then'](function(_0x4f4351){logger['info'](_0xc317('0x22'),_0x4f4351);return _0x3b4248[_0xc317('0x13')](0xc8)[_0xc317('0x14')]({'output':_0xc317('0x23')});})['catch'](function(_0x46237e){logger[_0xc317('0x18')](_0x46237e);return _0x3b4248[_0xc317('0x13')](0x1f4)[_0xc317('0x14')](_0x46237e);});};exports[_0xc317('0x24')]=function(_0x5450bf,_0x27618d){var _0x2f26d7=fs['readdirSync'](path[_0xc317('0x25')](config[_0xc317('0xc')],_0xc317('0x26'),'migrations'));var _0xe50cf8=[];for(var _0x4c4abf=0x0;_0x4c4abf<_0x2f26d7['length'];_0x4c4abf++){var _0x1a741d=_0x2f26d7[_0x4c4abf][_0xc317('0x27')](_0xc317('0x28'),'');if(compareVersions(module[_0xc317('0xe')][_0xc317('0x3')],_0x1a741d)===-0x1){_0xe50cf8[_0xc317('0x29')](_0x1a741d);}}if(_0xe50cf8['length']){var _0x10568b=_0xe50cf8[_0xc317('0x2a')](compareVersions);var _0x412c05=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xc317('0x2b')],'modelName':_0xc317('0x2b'),'columnName':_0xc317('0x3')},'migrations':{'params':[db[_0xc317('0x2c')][_0xc317('0x2d')](),db[_0xc317('0x2c')]['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[_0xc317('0x25')](config['root'],_0xc317('0x26'),'migrations'),'pattern':/\.js$/}});_0x412c05['up']({'migrations':_[_0xc317('0x2e')](_0x10568b,function(_0x3836b0){return _0x3836b0+'.js';})})[_0xc317('0x2f')](function(){return _0x27618d['status'](0xc8)[_0xc317('0x14')]({'output':_0xc317('0x30')+module[_0xc317('0xe')][_0xc317('0x3')]+'\x20to\x20'+_[_0xc317('0x31')](_0x10568b),'migrations':_['join'](_0x10568b)});})['catch'](function(_0xcb7106){if(_0xcb7106 instanceof db['sequelize'][_0xc317('0x32')]){return _0x27618d[_0xc317('0x13')](0xc8)[_0xc317('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x27618d[_0xc317('0x13')](0x1f4)[_0xc317('0x14')](_0xcb7106);}});}else{return _0x27618d[_0xc317('0x13')](0xc8)[_0xc317('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4ad2f55..024ca55 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 _0xf7d1=['create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x36f401,_0x5ce33a){var _0x27595d=function(_0x48fab4){while(--_0x48fab4){_0x36f401['push'](_0x36f401['shift']());}};_0x27595d(++_0x5ce33a);}(_0xf7d1,0x1a9));var _0x1f7d=function(_0x101d46,_0x26bf97){_0x101d46=_0x101d46-0x0;var _0xc38e4e=_0xf7d1[_0x101d46];return _0xc38e4e;};'use strict';var multer=require('multer');var util=require(_0x1f7d('0x0'));var path=require(_0x1f7d('0x1'));var timeout=require(_0x1f7d('0x2'));var express=require(_0x1f7d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1f7d('0x4'));var interaction=require(_0x1f7d('0x5'));var config=require(_0x1f7d('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x1f7d('0x7')]('/',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0x9')]);router[_0x1f7d('0x7')]('/describe',auth[_0x1f7d('0x8')](),controller['describe']);router[_0x1f7d('0x7')]('/:id',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0xa')]);router[_0x1f7d('0xb')]('/',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0xc')]);router[_0x1f7d('0xd')](_0x1f7d('0xe'),auth[_0x1f7d('0x8')](),controller[_0x1f7d('0xf')]);router[_0x1f7d('0x10')]('/:id',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0x11')]);module[_0x1f7d('0x12')]=router; \ No newline at end of file +var _0xccd0=['../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','update','path','connect-timeout','express','Router'];(function(_0x419e17,_0x7fe78c){var _0x1f2044=function(_0x3723e6){while(--_0x3723e6){_0x419e17['push'](_0x419e17['shift']());}};_0x1f2044(++_0x7fe78c);}(_0xccd0,0x164));var _0x0ccd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xccd0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ccd('0x0'));var timeout=require(_0x0ccd('0x1'));var express=require(_0x0ccd('0x2'));var router=express[_0x0ccd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0ccd('0x4'));var interaction=require(_0x0ccd('0x5'));var config=require('../../config/environment');var controller=require(_0x0ccd('0x6'));router[_0x0ccd('0x7')]('/',auth[_0x0ccd('0x8')](),controller[_0x0ccd('0x9')]);router[_0x0ccd('0x7')](_0x0ccd('0xa'),auth[_0x0ccd('0x8')](),controller['describe']);router[_0x0ccd('0x7')](_0x0ccd('0xb'),auth[_0x0ccd('0x8')](),controller[_0x0ccd('0xc')]);router[_0x0ccd('0xd')]('/',auth[_0x0ccd('0x8')](),controller['create']);router['put']('/:id',auth[_0x0ccd('0x8')](),controller[_0x0ccd('0xe')]);router['delete'](_0x0ccd('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 9f2db32..fd00a0f 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 _0x3c8b=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x2613ea,_0x65b626){var _0xa1d11b=function(_0x4fffb1){while(--_0x4fffb1){_0x2613ea['push'](_0x2613ea['shift']());}};_0xa1d11b(++_0x65b626);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x25c59f,_0x4c1bf2){_0x25c59f=_0x25c59f-0x0;var _0x576ea9=_0x3c8b[_0x25c59f];return _0x576ea9;};'use strict';var Sequelize=require('sequelize');module[_0xb3c8('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb3c8('0x1')]},'calleridnum':{'type':Sequelize[_0xb3c8('0x1')]},'calleridname':{'type':Sequelize[_0xb3c8('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb3c8('0x1')]},'membername':{'type':Sequelize[_0xb3c8('0x1')]},'agentcalledAt':{'type':Sequelize[_0xb3c8('0x2')]},'agentconnectAt':{'type':Sequelize[_0xb3c8('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xb3c8('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xb3c8('0x2')]},'agentdumpAt':{'type':Sequelize[_0xb3c8('0x2')]},'holdtime':{'type':Sequelize[_0xb3c8('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb3c8('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb3c8('0x3')]},'agentacw':{'type':Sequelize[_0xb3c8('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb3c8('0x1')]},'channelstate':{'type':Sequelize[_0xb3c8('0x3')]},'channelstatedesc':{'type':Sequelize[_0xb3c8('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb3c8('0x1')]},'language':{'type':Sequelize[_0xb3c8('0x1')]},'accountcode':{'type':Sequelize[_0xb3c8('0x1')]},'context':{'type':Sequelize[_0xb3c8('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb3c8('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xb3c8('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb3c8('0x1')]},'destcalleridname':{'type':Sequelize[_0xb3c8('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xb3c8('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb3c8('0x1')]},'destcontext':{'type':Sequelize[_0xb3c8('0x1')]},'destexten':{'type':Sequelize[_0xb3c8('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb3c8('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb3c8('0x1')]},'transfer':{'type':Sequelize[_0xb3c8('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xb3c8('0x5')},'transferexten':{'type':Sequelize[_0xb3c8('0x1')]},'transferuniqueid':{'type':Sequelize[_0xb3c8('0x1')]},'agententerreason':{'type':Sequelize[_0xb3c8('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x17a7=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING'];(function(_0x3a6957,_0xc3abb6){var _0x35058d=function(_0x51f1ba){while(--_0x51f1ba){_0x3a6957['push'](_0x3a6957['shift']());}};_0x35058d(++_0xc3abb6);}(_0x17a7,0xc2));var _0x717a=function(_0x2a72e7,_0x548204){_0x2a72e7=_0x2a72e7-0x0;var _0x46e66d=_0x17a7[_0x2a72e7];return _0x46e66d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x717a('0x0')]},'calleridnum':{'type':Sequelize[_0x717a('0x0')]},'calleridname':{'type':Sequelize[_0x717a('0x0')]},'queue':{'type':Sequelize[_0x717a('0x0')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x717a('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x717a('0x1')]},'agentcompleteAt':{'type':Sequelize[_0x717a('0x1')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x717a('0x1')]},'holdtime':{'type':Sequelize[_0x717a('0x2')]},'agentcomplete':{'type':Sequelize[_0x717a('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x717a('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x717a('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x717a('0x2')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x717a('0x0')]},'channel':{'type':Sequelize[_0x717a('0x0')]},'channelstate':{'type':Sequelize[_0x717a('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x717a('0x0')]},'language':{'type':Sequelize[_0x717a('0x0')]},'accountcode':{'type':Sequelize[_0x717a('0x0')]},'context':{'type':Sequelize[_0x717a('0x0')]},'exten':{'type':Sequelize[_0x717a('0x0')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x717a('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x717a('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x717a('0x0')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x717a('0x0')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x717a('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x717a('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x717a('0x0')]},'transfer':{'type':Sequelize[_0x717a('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x717a('0x4')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x717a('0x0')]},'agententerreason':{'type':Sequelize[_0x717a('0x2')],'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 54c24b8..8b4d0ef 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(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 a77b8c4..2e59153 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 _0x1159=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x47bc94,_0x1b1e48){var _0x4065c1=function(_0x16cfcc){while(--_0x16cfcc){_0x47bc94['push'](_0x47bc94['shift']());}};_0x4065c1(++_0x1b1e48);}(_0x1159,0xf3));var _0x9115=function(_0x10003c,_0x169fc8){_0x10003c=_0x10003c-0x0;var _0x3420a9=_0x1159[_0x10003c];return _0x3420a9;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9115('0xc'),_0x9115('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb57=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','api','bluebird','path','rimraf','./voiceAgentReport.attributes','exports'];(function(_0x2a3689,_0x5269be){var _0x3915d3=function(_0x1803ac){while(--_0x1803ac){_0x2a3689['push'](_0x2a3689['shift']());}};_0x3915d3(++_0x5269be);}(_0xcb57,0xa1));var _0x7cb5=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xcb57[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x7cb5('0x0'));var util=require(_0x7cb5('0x1'));var logger=require('../../config/logger')(_0x7cb5('0x2'));var moment=require('moment');var BPromise=require(_0x7cb5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cb5('0x4'));var rimraf=require(_0x7cb5('0x5'));var config=require('../../config/environment');var attributes=require(_0x7cb5('0x6'));module[_0x7cb5('0x7')]=function(_0x1aafb5,_0x4e036d){return _0x1aafb5[_0x7cb5('0x8')](_0x7cb5('0x9'),attributes,{'tableName':_0x7cb5('0xa'),'paranoid':![],'indexes':[{'fields':[_0x7cb5('0xb'),_0x7cb5('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 d386a3d..0185987 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 _0xabb3=['VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x280c4b,_0xfe785d){var _0x2a5e90=function(_0x37db79){while(--_0x37db79){_0x280c4b['push'](_0x280c4b['shift']());}};_0x2a5e90(++_0xfe785d);}(_0xabb3,0x75));var _0x3abb=function(_0x54688c,_0x1bc838){_0x54688c=_0x54688c-0x0;var _0x1100d9=_0xabb3[_0x54688c];return _0x1100d9;};'use strict';var _=require(_0x3abb('0x0'));var util=require('util');var moment=require(_0x3abb('0x1'));var BPromise=require(_0x3abb('0x2'));var rs=require(_0x3abb('0x3'));var fs=require('fs');var Redis=require(_0x3abb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3abb('0x5'));var logger=require('../../config/logger')(_0x3abb('0x6'));var config=require('../../config/environment');var jayson=require(_0x3abb('0x7'));var client=jayson[_0x3abb('0x8')][_0x3abb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x568ed2,_0x42a803,_0x3d322c){return new BPromise(function(_0x1a4d92,_0xb573e6){return client[_0x3abb('0xa')](_0x568ed2,_0x3d322c)[_0x3abb('0xb')](function(_0x43bcf9){logger[_0x3abb('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x42a803,_0x3abb('0xd'));logger[_0x3abb('0xe')](_0x3abb('0xf'),_0x42a803,_0x3abb('0xd'),JSON[_0x3abb('0x10')](_0x43bcf9));if(_0x43bcf9['error']){if(_0x43bcf9[_0x3abb('0x11')]['code']===0x1f4){logger['error'](_0x3abb('0x12'),_0x42a803,_0x43bcf9[_0x3abb('0x11')][_0x3abb('0x13')]);return _0xb573e6(_0x43bcf9[_0x3abb('0x11')][_0x3abb('0x13')]);}logger[_0x3abb('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x42a803,_0x43bcf9[_0x3abb('0x11')][_0x3abb('0x13')]);return _0x1a4d92(_0x43bcf9[_0x3abb('0x11')]['message']);}else{logger[_0x3abb('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x42a803,_0x3abb('0xd'));_0x1a4d92(_0x43bcf9[_0x3abb('0x14')][_0x3abb('0x13')]);}})[_0x3abb('0x15')](function(_0x4c9c5d){logger[_0x3abb('0x11')](_0x3abb('0x12'),_0x42a803,_0x4c9c5d);_0xb573e6(_0x4c9c5d);});});}exports[_0x3abb('0x16')]=function(_0x586b4d){var _0x4340df=this;return new Promise(function(_0x2b40f3,_0x464d2f){return db[_0x3abb('0x17')][_0x3abb('0x18')](_0x586b4d[_0x3abb('0x19')],{'raw':_0x586b4d[_0x3abb('0x1a')]?_0x586b4d[_0x3abb('0x1a')][_0x3abb('0x1b')]===undefined?!![]:![]:!![]})[_0x3abb('0xb')](function(_0x153215){logger[_0x3abb('0xc')](_0x3abb('0x16'),_0x586b4d);logger[_0x3abb('0xe')](_0x3abb('0x16'),_0x586b4d,JSON[_0x3abb('0x10')](_0x153215));_0x2b40f3(_0x153215);})[_0x3abb('0x15')](function(_0x57c769){logger[_0x3abb('0x11')](_0x3abb('0x16'),_0x57c769[_0x3abb('0x13')],_0x586b4d);_0x464d2f(_0x4340df[_0x3abb('0x11')](0x1f4,_0x57c769['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x372519){var _0x2f5a52=this;return new Promise(function(_0x16ee0e,_0x5478b4){return db['VoiceAgentReport'][_0x3abb('0x1c')](_0x372519[_0x3abb('0x19')],{'raw':_0x372519[_0x3abb('0x1a')]?_0x372519[_0x3abb('0x1a')][_0x3abb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x372519[_0x3abb('0x1a')]?_0x372519['options'][_0x3abb('0x1d')]||null:null,'attributes':_0x372519['options']?_0x372519[_0x3abb('0x1a')][_0x3abb('0x1e')]||null:null,'limit':_0x372519[_0x3abb('0x1a')]?_0x372519[_0x3abb('0x1a')][_0x3abb('0x1f')]||null:null})[_0x3abb('0xb')](function(_0xb5882e){logger['info']('UpdateVoiceAgentReport',_0x372519);logger[_0x3abb('0xe')](_0x3abb('0x20'),_0x372519,JSON[_0x3abb('0x10')](_0xb5882e));_0x16ee0e(_0xb5882e);})[_0x3abb('0x15')](function(_0x736241){logger[_0x3abb('0x11')]('UpdateVoiceAgentReport',_0x736241[_0x3abb('0x13')],_0x372519);_0x5478b4(_0x2f5a52[_0x3abb('0x11')](0x1f4,_0x736241['message']));});});}; \ No newline at end of file +var _0x176c=['options','raw','info','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body'];(function(_0x1be34d,_0x20b28b){var _0x12f253=function(_0x41cb1d){while(--_0x41cb1d){_0x1be34d['push'](_0x1be34d['shift']());}};_0x12f253(++_0x20b28b);}(_0x176c,0x80));var _0xc176=function(_0x3cc17d,_0x1b8d62){_0x3cc17d=_0x3cc17d-0x0;var _0xda067c=_0x176c[_0x3cc17d];return _0xda067c;};'use strict';var _=require(_0xc176('0x0'));var util=require('util');var moment=require(_0xc176('0x1'));var BPromise=require(_0xc176('0x2'));var rs=require(_0xc176('0x3'));var fs=require('fs');var Redis=require(_0xc176('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc176('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc176('0x6'));var jayson=require(_0xc176('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c17cc,_0x3b398c,_0x234b7b){return new BPromise(function(_0x29079b,_0x637a58){return client[_0xc176('0x8')](_0x5c17cc,_0x234b7b)[_0xc176('0x9')](function(_0x1ae2af){logger['info'](_0xc176('0xa'),_0x3b398c,_0xc176('0xb'));logger[_0xc176('0xc')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x3b398c,_0xc176('0xb'),JSON[_0xc176('0xd')](_0x1ae2af));if(_0x1ae2af['error']){if(_0x1ae2af['error'][_0xc176('0xe')]===0x1f4){logger['error'](_0xc176('0xa'),_0x3b398c,_0x1ae2af['error']['message']);return _0x637a58(_0x1ae2af['error'][_0xc176('0xf')]);}logger[_0xc176('0x10')](_0xc176('0xa'),_0x3b398c,_0x1ae2af[_0xc176('0x10')][_0xc176('0xf')]);return _0x29079b(_0x1ae2af[_0xc176('0x10')][_0xc176('0xf')]);}else{logger['info'](_0xc176('0xa'),_0x3b398c,_0xc176('0xb'));_0x29079b(_0x1ae2af[_0xc176('0x11')][_0xc176('0xf')]);}})[_0xc176('0x12')](function(_0x567bb0){logger[_0xc176('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x3b398c,_0x567bb0);_0x637a58(_0x567bb0);});});}exports[_0xc176('0x13')]=function(_0x3ce95a){var _0x5cbb31=this;return new Promise(function(_0x521327,_0xa6edfe){return db[_0xc176('0x14')]['create'](_0x3ce95a[_0xc176('0x15')],{'raw':_0x3ce95a[_0xc176('0x16')]?_0x3ce95a[_0xc176('0x16')][_0xc176('0x17')]===undefined?!![]:![]:!![]})[_0xc176('0x9')](function(_0x4c2f05){logger[_0xc176('0x18')]('CreateVoiceAgentReport',_0x3ce95a);logger['debug'](_0xc176('0x13'),_0x3ce95a,JSON[_0xc176('0xd')](_0x4c2f05));_0x521327(_0x4c2f05);})[_0xc176('0x12')](function(_0x116a10){logger[_0xc176('0x10')](_0xc176('0x13'),_0x116a10[_0xc176('0xf')],_0x3ce95a);_0xa6edfe(_0x5cbb31[_0xc176('0x10')](0x1f4,_0x116a10[_0xc176('0xf')]));});});};exports[_0xc176('0x19')]=function(_0x363295){var _0x1a0cd1=this;return new Promise(function(_0x1e0f5b,_0x3b0ed4){return db[_0xc176('0x14')][_0xc176('0x1a')](_0x363295[_0xc176('0x15')],{'raw':_0x363295[_0xc176('0x16')]?_0x363295['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x363295[_0xc176('0x16')]?_0x363295[_0xc176('0x16')][_0xc176('0x1b')]||null:null,'attributes':_0x363295[_0xc176('0x16')]?_0x363295[_0xc176('0x16')][_0xc176('0x1c')]||null:null,'limit':_0x363295[_0xc176('0x16')]?_0x363295[_0xc176('0x16')][_0xc176('0x1d')]||null:null})['then'](function(_0x2b78eb){logger['info'](_0xc176('0x19'),_0x363295);logger[_0xc176('0xc')](_0xc176('0x19'),_0x363295,JSON[_0xc176('0xd')](_0x2b78eb));_0x1e0f5b(_0x2b78eb);})[_0xc176('0x12')](function(_0x455aef){logger[_0xc176('0x10')](_0xc176('0x19'),_0x455aef['message'],_0x363295);_0x3b0ed4(_0x1a0cd1[_0xc176('0x10')](0x1f4,_0x455aef[_0xc176('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 4764f16..b03f20d 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 _0x1b20=['show','post','create','put','/:id','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe'];(function(_0xfb076e,_0x45a1c7){var _0x25af26=function(_0x2043d0){while(--_0x2043d0){_0xfb076e['push'](_0xfb076e['shift']());}};_0x25af26(++_0x45a1c7);}(_0x1b20,0x66));var _0x01b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b20[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var fs_extra=require(_0x01b2('0x3'));var auth=require(_0x01b2('0x4'));var interaction=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var controller=require(_0x01b2('0x7'));router[_0x01b2('0x8')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xa')]);router[_0x01b2('0x8')](_0x01b2('0xb'),auth[_0x01b2('0x9')](),controller['describe']);router[_0x01b2('0x8')]('/:id',auth[_0x01b2('0x9')](),controller[_0x01b2('0xc')]);router[_0x01b2('0xd')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xe')]);router[_0x01b2('0xf')](_0x01b2('0x10'),auth[_0x01b2('0x9')](),controller['update']);router[_0x01b2('0x11')]('/:id',auth[_0x01b2('0x9')](),controller['destroy']);module[_0x01b2('0x12')]=router; \ No newline at end of file +var _0x6f47=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0x6f47,0xc7));var _0x76f4=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6f47[_0x2be8c2];return _0x97f531;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f4('0x8')]);router[_0x76f4('0x7')](_0x76f4('0x9'),auth['isAuthenticated'](),controller[_0x76f4('0xa')]);router[_0x76f4('0x7')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76f4('0xe')]);router[_0x76f4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x76f4('0x10')]);router[_0x76f4('0x11')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0x12')]);module[_0x76f4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 3f726b4..970a613 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 _0xd06f=['STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer'];(function(_0x118485,_0x2d33eb){var _0x36f0cf=function(_0x582225){while(--_0x582225){_0x118485['push'](_0x118485['shift']());}};_0x36f0cf(++_0x2d33eb);}(_0xd06f,0x13c));var _0xfd06=function(_0x363618,_0x5ebf3a){_0x363618=_0x363618-0x0;var _0x496dee=_0xd06f[_0x363618];return _0x496dee;};'use strict';var Sequelize=require(_0xfd06('0x0'));module[_0xfd06('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfd06('0x2')](_0xfd06('0x3'),_0xfd06('0x4'),_0xfd06('0x5'),_0xfd06('0x6'),_0xfd06('0x7'),_0xfd06('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfd06('0x9')]},'source':{'type':Sequelize[_0xfd06('0x9')]},'destination':{'type':Sequelize[_0xfd06('0x9')]},'destinationcontext':{'type':Sequelize[_0xfd06('0x9')]},'callerid':{'type':Sequelize[_0xfd06('0x9')]},'channel':{'type':Sequelize[_0xfd06('0x9')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xfd06('0xa')]},'starttime':{'type':Sequelize[_0xfd06('0xb')]},'systemanswertime':{'type':Sequelize[_0xfd06('0xb')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfd06('0xb')]},'duration':{'type':Sequelize[_0xfd06('0xc')]},'billableseconds':{'type':Sequelize[_0xfd06('0xc')]},'mohtime':{'type':Sequelize[_0xfd06('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfd06('0x9')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xfd06('0x9')]},'userDisposition':{'type':Sequelize[_0xfd06('0x9')]},'userSecondDisposition':{'type':Sequelize[_0xfd06('0x9')]},'userThirdDisposition':{'type':Sequelize[_0xfd06('0x9')]},'note':{'type':Sequelize[_0xfd06('0x9')]},'prefix':{'type':Sequelize[_0xfd06('0x9')]},'routeid':{'type':Sequelize[_0xfd06('0xc')]},'sipcallid':{'type':Sequelize[_0xfd06('0x9')]}}; \ No newline at end of file +var _0x64eb=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax'];(function(_0x1dca71,_0x1846db){var _0x43550b=function(_0x464d76){while(--_0x464d76){_0x1dca71['push'](_0x1dca71['shift']());}};_0x43550b(++_0x1846db);}(_0x64eb,0x109));var _0xb64e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64eb[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb64e('0x0'));module[_0xb64e('0x1')]={'uniqueid':{'type':Sequelize[_0xb64e('0x2')]},'type':{'type':Sequelize[_0xb64e('0x3')](_0xb64e('0x4'),_0xb64e('0x5'),_0xb64e('0x6'),_0xb64e('0x7'),_0xb64e('0x8'),_0xb64e('0x9'))},'tag':{'type':Sequelize[_0xb64e('0x2')]},'accountcode':{'type':Sequelize[_0xb64e('0x2')]},'source':{'type':Sequelize[_0xb64e('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xb64e('0x2')]},'callerid':{'type':Sequelize[_0xb64e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xb64e('0x2')]},'lastapplication':{'type':Sequelize[_0xb64e('0x2')]},'lastdata':{'type':Sequelize[_0xb64e('0xa')]},'starttime':{'type':Sequelize[_0xb64e('0xb')]},'systemanswertime':{'type':Sequelize[_0xb64e('0xb')]},'answertime':{'type':Sequelize[_0xb64e('0xb')]},'endtime':{'type':Sequelize[_0xb64e('0xb')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xb64e('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb64e('0x2')]},'userfield':{'type':Sequelize[_0xb64e('0x2')]},'userDisposition':{'type':Sequelize[_0xb64e('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xb64e('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xb64e('0x2')]},'note':{'type':Sequelize[_0xb64e('0x2')]},'prefix':{'type':Sequelize[_0xb64e('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xb64e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index f264de6..e54c802 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x5f2f[_0x1f5887];return _0x21774b;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x3cc486,_0x3ef728){_0x3cc486=_0x3cc486-0x0;var _0x2cd5e1=_0x2032[_0x3cc486];return _0x2cd5e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index e98ddf9..a15d529 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 _0x26c2=['exports','define','VoiceCallReport','uniqueid','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x46a634,_0x439b70){var _0x42007a=function(_0x2a9e29){while(--_0x2a9e29){_0x46a634['push'](_0x46a634['shift']());}};_0x42007a(++_0x439b70);}(_0x26c2,0x130));var _0x226c=function(_0x1a424b,_0x3c4e7e){_0x1a424b=_0x1a424b-0x0;var _0xd5c2ab=_0x26c2[_0x1a424b];return _0xd5c2ab;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x226c('0x0'));var moment=require(_0x226c('0x1'));var BPromise=require(_0x226c('0x2'));var rp=require(_0x226c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var attributes=require('./voiceCallReport.attributes');module[_0x226c('0x6')]=function(_0xb40fbd,_0x21ed3a){return _0xb40fbd[_0x226c('0x7')](_0x226c('0x8'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x226c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2794=['uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceCallReport'];(function(_0x5c0871,_0x2b59f8){var _0x4f8761=function(_0x55b114){while(--_0x55b114){_0x5c0871['push'](_0x5c0871['shift']());}};_0x4f8761(++_0x2b59f8);}(_0x2794,0x1b9));var _0x4279=function(_0x543162,_0x21e93d){_0x543162=_0x543162-0x0;var _0x5651b9=_0x2794[_0x543162];return _0x5651b9;};'use strict';var _=require(_0x4279('0x0'));var util=require('util');var logger=require(_0x4279('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4279('0x2'));var rp=require(_0x4279('0x3'));var fs=require('fs');var path=require(_0x4279('0x4'));var rimraf=require(_0x4279('0x5'));var config=require(_0x4279('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x4279('0x7')]=function(_0x247d0d,_0x55054f){return _0x247d0d[_0x4279('0x8')](_0x4279('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x4279('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 887ea6a..03f4277 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 _0x3fff=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','create','CreateVoiceCallReport','update','body','UpdateVoiceCallReport','util','moment','randomstring','ioredis'];(function(_0x3c313a,_0xbc99d0){var _0x27458d=function(_0x2808ab){while(--_0x2808ab){_0x3c313a['push'](_0x3c313a['shift']());}};_0x27458d(++_0xbc99d0);}(_0x3fff,0x134));var _0xf3ff=function(_0x239edb,_0x46d217){_0x239edb=_0x239edb-0x0;var _0x4c758a=_0x3fff[_0x239edb];return _0x4c758a;};'use strict';var _=require('lodash');var util=require(_0xf3ff('0x0'));var moment=require(_0xf3ff('0x1'));var BPromise=require('bluebird');var rs=require(_0xf3ff('0x2'));var fs=require('fs');var Redis=require(_0xf3ff('0x3'));var db=require(_0xf3ff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf3ff('0x5'))(_0xf3ff('0x6'));var config=require(_0xf3ff('0x7'));var jayson=require(_0xf3ff('0x8'));var client=jayson[_0xf3ff('0x9')][_0xf3ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c7f9,_0x14fba2,_0x2dd108){return new BPromise(function(_0x462716,_0x244b8e){return client[_0xf3ff('0xb')](_0x51c7f9,_0x2dd108)[_0xf3ff('0xc')](function(_0x5df15d){logger['info'](_0xf3ff('0xd'),_0x14fba2,_0xf3ff('0xe'));logger[_0xf3ff('0xf')](_0xf3ff('0x10'),_0x14fba2,_0xf3ff('0xe'),JSON[_0xf3ff('0x11')](_0x5df15d));if(_0x5df15d[_0xf3ff('0x12')]){if(_0x5df15d[_0xf3ff('0x12')][_0xf3ff('0x13')]===0x1f4){logger[_0xf3ff('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x14fba2,_0x5df15d[_0xf3ff('0x12')][_0xf3ff('0x14')]);return _0x244b8e(_0x5df15d['error'][_0xf3ff('0x14')]);}logger[_0xf3ff('0x12')](_0xf3ff('0xd'),_0x14fba2,_0x5df15d[_0xf3ff('0x12')][_0xf3ff('0x14')]);return _0x462716(_0x5df15d['error'][_0xf3ff('0x14')]);}else{logger[_0xf3ff('0x15')](_0xf3ff('0xd'),_0x14fba2,_0xf3ff('0xe'));_0x462716(_0x5df15d[_0xf3ff('0x16')][_0xf3ff('0x14')]);}})[_0xf3ff('0x17')](function(_0x1d8ed3){logger[_0xf3ff('0x12')](_0xf3ff('0xd'),_0x14fba2,_0x1d8ed3);_0x244b8e(_0x1d8ed3);});});}exports[_0xf3ff('0x18')]=function(_0x59f344){var _0x43d0e1=this;return new Promise(function(_0x10abef,_0x33783c){return db[_0xf3ff('0x19')][_0xf3ff('0x1a')]({'raw':_0x59f344['options']?_0x59f344[_0xf3ff('0x1b')][_0xf3ff('0x1c')]===undefined?!![]:![]:!![],'where':_0x59f344[_0xf3ff('0x1b')]?_0x59f344[_0xf3ff('0x1b')][_0xf3ff('0x1d')]||null:null,'attributes':_0x59f344['options']?_0x59f344[_0xf3ff('0x1b')][_0xf3ff('0x1e')]||null:null,'limit':_0x59f344[_0xf3ff('0x1b')]?_0x59f344[_0xf3ff('0x1b')][_0xf3ff('0x1f')]||null:null,'include':_0x59f344['options']?_0x59f344[_0xf3ff('0x1b')][_0xf3ff('0x20')]?_['map'](_0x59f344[_0xf3ff('0x1b')]['include'],function(_0x5a2844){return{'model':db[_0x5a2844[_0xf3ff('0x21')]],'as':_0x5a2844['as'],'attributes':_0x5a2844[_0xf3ff('0x1e')],'include':_0x5a2844[_0xf3ff('0x20')]?_['map'](_0x5a2844[_0xf3ff('0x20')],function(_0x2389c9){return{'model':db[_0x2389c9[_0xf3ff('0x21')]],'as':_0x2389c9['as'],'attributes':_0x2389c9[_0xf3ff('0x1e')],'include':_0x2389c9[_0xf3ff('0x20')]?_['map'](_0x2389c9['include'],function(_0x12a2d4){return{'model':db[_0x12a2d4['model']],'as':_0x12a2d4['as'],'attributes':_0x12a2d4[_0xf3ff('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf3ff('0xc')](function(_0x243821){logger[_0xf3ff('0x15')]('GetVoiceCallReport',_0x59f344);logger[_0xf3ff('0xf')]('GetVoiceCallReport',_0x59f344,JSON[_0xf3ff('0x11')](_0x243821));_0x10abef(_0x243821);})[_0xf3ff('0x17')](function(_0x26ce22){logger[_0xf3ff('0x12')](_0xf3ff('0x18'),_0x26ce22[_0xf3ff('0x14')],_0x59f344);_0x33783c(_0x43d0e1[_0xf3ff('0x12')](0x1f4,_0x26ce22[_0xf3ff('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x2db892){var _0x27ad5a=this;return new Promise(function(_0x48f050,_0x514080){return db[_0xf3ff('0x19')][_0xf3ff('0x22')](_0x2db892['body'],{'raw':_0x2db892[_0xf3ff('0x1b')]?_0x2db892['options'][_0xf3ff('0x1c')]===undefined?!![]:![]:!![]})[_0xf3ff('0xc')](function(_0x5679f7){logger['info'](_0xf3ff('0x23'),_0x2db892);logger[_0xf3ff('0xf')](_0xf3ff('0x23'),_0x2db892,JSON['stringify'](_0x5679f7));_0x48f050(_0x5679f7);})[_0xf3ff('0x17')](function(_0x1e9eaf){logger['error'](_0xf3ff('0x23'),_0x1e9eaf[_0xf3ff('0x14')],_0x2db892);_0x514080(_0x27ad5a['error'](0x1f4,_0x1e9eaf[_0xf3ff('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x3db681){var _0x18abda=this;return new Promise(function(_0x2d8605,_0x302fd2){return db[_0xf3ff('0x19')][_0xf3ff('0x24')](_0x3db681[_0xf3ff('0x25')],{'raw':_0x3db681[_0xf3ff('0x1b')]?_0x3db681[_0xf3ff('0x1b')][_0xf3ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3db681[_0xf3ff('0x1b')]?_0x3db681[_0xf3ff('0x1b')][_0xf3ff('0x1d')]||null:null,'attributes':_0x3db681[_0xf3ff('0x1b')]?_0x3db681['options'][_0xf3ff('0x1e')]||null:null,'limit':_0x3db681[_0xf3ff('0x1b')]?_0x3db681['options'][_0xf3ff('0x1f')]||null:null})[_0xf3ff('0xc')](function(_0x2ea676){logger[_0xf3ff('0x15')](_0xf3ff('0x26'),_0x3db681);logger[_0xf3ff('0xf')](_0xf3ff('0x26'),_0x3db681,JSON[_0xf3ff('0x11')](_0x2ea676));_0x2d8605(_0x2ea676);})[_0xf3ff('0x17')](function(_0x5971e6){logger[_0xf3ff('0x12')](_0xf3ff('0x26'),_0x5971e6[_0xf3ff('0x14')],_0x3db681);_0x302fd2(_0x18abda[_0xf3ff('0x12')](0x1f4,_0x5971e6[_0xf3ff('0x14')]));});});}; \ No newline at end of file +var _0x09c6=['debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message','request\x20sent','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','GetVoiceCallReport','stringify','CreateVoiceCallReport','body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x20dd63,_0x309e32){var _0x5de03e=function(_0x483f36){while(--_0x483f36){_0x20dd63['push'](_0x20dd63['shift']());}};_0x5de03e(++_0x309e32);}(_0x09c6,0x66));var _0x609c=function(_0x43ca94,_0x121556){_0x43ca94=_0x43ca94-0x0;var _0x29fd53=_0x09c6[_0x43ca94];return _0x29fd53;};'use strict';var _=require(_0x609c('0x0'));var util=require(_0x609c('0x1'));var moment=require(_0x609c('0x2'));var BPromise=require(_0x609c('0x3'));var rs=require(_0x609c('0x4'));var fs=require('fs');var Redis=require(_0x609c('0x5'));var db=require(_0x609c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x609c('0x7'))(_0x609c('0x8'));var config=require(_0x609c('0x9'));var jayson=require(_0x609c('0xa'));var client=jayson[_0x609c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d9cd9,_0x27bb03,_0x1ef7ec){return new BPromise(function(_0x182d6d,_0x3dc99d){return client[_0x609c('0xc')](_0x3d9cd9,_0x1ef7ec)[_0x609c('0xd')](function(_0x33e9b9){logger[_0x609c('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x27bb03,'request\x20sent');logger[_0x609c('0xf')](_0x609c('0x10'),_0x27bb03,'request\x20sent',JSON['stringify'](_0x33e9b9));if(_0x33e9b9[_0x609c('0x11')]){if(_0x33e9b9[_0x609c('0x11')][_0x609c('0x12')]===0x1f4){logger[_0x609c('0x11')](_0x609c('0x13'),_0x27bb03,_0x33e9b9[_0x609c('0x11')][_0x609c('0x14')]);return _0x3dc99d(_0x33e9b9[_0x609c('0x11')][_0x609c('0x14')]);}logger['error'](_0x609c('0x13'),_0x27bb03,_0x33e9b9['error'][_0x609c('0x14')]);return _0x182d6d(_0x33e9b9[_0x609c('0x11')][_0x609c('0x14')]);}else{logger[_0x609c('0xe')](_0x609c('0x13'),_0x27bb03,_0x609c('0x15'));_0x182d6d(_0x33e9b9[_0x609c('0x16')]['message']);}})[_0x609c('0x17')](function(_0x224649){logger[_0x609c('0x11')](_0x609c('0x13'),_0x27bb03,_0x224649);_0x3dc99d(_0x224649);});});}exports['GetVoiceCallReport']=function(_0x5128f6){var _0x224b67=this;return new Promise(function(_0x5a3202,_0x497a29){return db[_0x609c('0x18')][_0x609c('0x19')]({'raw':_0x5128f6[_0x609c('0x1a')]?_0x5128f6[_0x609c('0x1a')][_0x609c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5128f6['options']?_0x5128f6[_0x609c('0x1a')][_0x609c('0x1c')]||null:null,'attributes':_0x5128f6[_0x609c('0x1a')]?_0x5128f6[_0x609c('0x1a')][_0x609c('0x1d')]||null:null,'limit':_0x5128f6[_0x609c('0x1a')]?_0x5128f6[_0x609c('0x1a')][_0x609c('0x1e')]||null:null,'include':_0x5128f6[_0x609c('0x1a')]?_0x5128f6[_0x609c('0x1a')][_0x609c('0x1f')]?_['map'](_0x5128f6[_0x609c('0x1a')][_0x609c('0x1f')],function(_0x4cb4c5){return{'model':db[_0x4cb4c5[_0x609c('0x20')]],'as':_0x4cb4c5['as'],'attributes':_0x4cb4c5['attributes'],'include':_0x4cb4c5[_0x609c('0x1f')]?_['map'](_0x4cb4c5[_0x609c('0x1f')],function(_0x4e235b){return{'model':db[_0x4e235b[_0x609c('0x20')]],'as':_0x4e235b['as'],'attributes':_0x4e235b[_0x609c('0x1d')],'include':_0x4e235b['include']?_['map'](_0x4e235b['include'],function(_0x29145c){return{'model':db[_0x29145c['model']],'as':_0x29145c['as'],'attributes':_0x29145c[_0x609c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x609c('0xd')](function(_0x1d95a9){logger['info'](_0x609c('0x21'),_0x5128f6);logger[_0x609c('0xf')]('GetVoiceCallReport',_0x5128f6,JSON[_0x609c('0x22')](_0x1d95a9));_0x5a3202(_0x1d95a9);})[_0x609c('0x17')](function(_0x2e8e3b){logger[_0x609c('0x11')](_0x609c('0x21'),_0x2e8e3b['message'],_0x5128f6);_0x497a29(_0x224b67[_0x609c('0x11')](0x1f4,_0x2e8e3b[_0x609c('0x14')]));});});};exports[_0x609c('0x23')]=function(_0x38387e){var _0x125ed2=this;return new Promise(function(_0xc9ec3b,_0x221708){return db[_0x609c('0x18')]['create'](_0x38387e[_0x609c('0x24')],{'raw':_0x38387e[_0x609c('0x1a')]?_0x38387e[_0x609c('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x572b5d){logger[_0x609c('0xe')](_0x609c('0x23'),_0x38387e);logger['debug']('CreateVoiceCallReport',_0x38387e,JSON[_0x609c('0x22')](_0x572b5d));_0xc9ec3b(_0x572b5d);})[_0x609c('0x17')](function(_0x4dec38){logger[_0x609c('0x11')](_0x609c('0x23'),_0x4dec38[_0x609c('0x14')],_0x38387e);_0x221708(_0x125ed2['error'](0x1f4,_0x4dec38[_0x609c('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x445e7d){var _0x242d1a=this;return new Promise(function(_0x43447b,_0x1d8673){return db['VoiceCallReport'][_0x609c('0x25')](_0x445e7d[_0x609c('0x24')],{'raw':_0x445e7d[_0x609c('0x1a')]?_0x445e7d[_0x609c('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x445e7d['options']?_0x445e7d[_0x609c('0x1a')][_0x609c('0x1c')]||null:null,'attributes':_0x445e7d[_0x609c('0x1a')]?_0x445e7d[_0x609c('0x1a')][_0x609c('0x1d')]||null:null,'limit':_0x445e7d[_0x609c('0x1a')]?_0x445e7d[_0x609c('0x1a')][_0x609c('0x1e')]||null:null})[_0x609c('0xd')](function(_0x28d38e){logger['info'](_0x609c('0x26'),_0x445e7d);logger[_0x609c('0xf')]('UpdateVoiceCallReport',_0x445e7d,JSON[_0x609c('0x22')](_0x28d38e));_0x43447b(_0x28d38e);})[_0x609c('0x17')](function(_0x461c36){logger[_0x609c('0x11')]('UpdateVoiceCallReport',_0x461c36[_0x609c('0x14')],_0x445e7d);_0x1d8673(_0x242d1a[_0x609c('0x11')](0x1f4,_0x461c36[_0x609c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1ecae87..f02616f 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 _0x08e1=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x1ce031,_0x2c29f){var _0x2a269e=function(_0x19514f){while(--_0x19514f){_0x1ce031['push'](_0x1ce031['shift']());}};_0x2a269e(++_0x2c29f);}(_0x08e1,0xdd));var _0x108e=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x08e1[_0x3a9661];return _0x5bb119;};'use strict';var multer=require(_0x108e('0x0'));var util=require('util');var path=require(_0x108e('0x1'));var timeout=require('connect-timeout');var express=require(_0x108e('0x2'));var router=express[_0x108e('0x3')]();var fs_extra=require(_0x108e('0x4'));var auth=require(_0x108e('0x5'));var interaction=require(_0x108e('0x6'));var config=require(_0x108e('0x7'));var controller=require(_0x108e('0x8'));router[_0x108e('0x9')]('/',auth[_0x108e('0xa')](),controller[_0x108e('0xb')]);router[_0x108e('0x9')](_0x108e('0xc'),auth[_0x108e('0xa')](),controller[_0x108e('0xd')]);router[_0x108e('0xe')]('/',auth[_0x108e('0xa')](),controller[_0x108e('0xf')]);router[_0x108e('0x10')](_0x108e('0xc'),auth['isAuthenticated'](),controller[_0x108e('0x11')]);router[_0x108e('0x12')](_0x108e('0xc'),auth[_0x108e('0xa')](),controller['destroy']);module[_0x108e('0x13')]=router; \ No newline at end of file +var _0x8d8a=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','post','isAuthenticated','put'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8d8a,0x18f));var _0xa8d8=function(_0x3f2ccb,_0x1a85f5){_0x3f2ccb=_0x3f2ccb-0x0;var _0x4d40b9=_0x8d8a[_0x3f2ccb];return _0x4d40b9;};'use strict';var multer=require(_0xa8d8('0x0'));var util=require(_0xa8d8('0x1'));var path=require(_0xa8d8('0x2'));var timeout=require(_0xa8d8('0x3'));var express=require('express');var router=express[_0xa8d8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8d8('0x5'));var interaction=require(_0xa8d8('0x6'));var config=require(_0xa8d8('0x7'));var controller=require(_0xa8d8('0x8'));router[_0xa8d8('0x9')]('/',auth['isAuthenticated'](),controller[_0xa8d8('0xa')]);router[_0xa8d8('0x9')](_0xa8d8('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa8d8('0xc')]('/',auth[_0xa8d8('0xd')](),controller['create']);router[_0xa8d8('0xe')](_0xa8d8('0xb'),auth[_0xa8d8('0xd')](),controller[_0xa8d8('0xf')]);router['delete'](_0xa8d8('0xb'),auth[_0xa8d8('0xd')](),controller[_0xa8d8('0x10')]);module[_0xa8d8('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index e9798d9..9ee5cc9 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 _0x8b8e=['exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN'];(function(_0x58eb39,_0x41c81d){var _0xdbd6f9=function(_0x42e1cf){while(--_0x42e1cf){_0x58eb39['push'](_0x58eb39['shift']());}};_0xdbd6f9(++_0x41c81d);}(_0x8b8e,0xb4));var _0xe8b8=function(_0x1ac0aa,_0x396873){_0x1ac0aa=_0x1ac0aa-0x0;var _0x3a9b06=_0x8b8e[_0x1ac0aa];return _0x3a9b06;};'use strict';var Sequelize=require('sequelize');module[_0xe8b8('0x0')]={'name':{'type':Sequelize[_0xe8b8('0x1')]},'prefix':{'type':Sequelize[_0xe8b8('0x1')],'unique':_0xe8b8('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xe8b8('0x1')],'set':function(_0xe3a6eb){this[_0xe8b8('0x3')](_0xe8b8('0x4'),_0xe3a6eb?_0xe3a6eb[_0xe8b8('0x5')](''):[]);},'get':function(){return this[_0xe8b8('0x6')](_0xe8b8('0x4'))?this['getDataValue'](_0xe8b8('0x4'))[_0xe8b8('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xe8b8('0x1')]},'record':{'type':Sequelize[_0xe8b8('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe8b8('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x07c2=['getDataValue','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join'];(function(_0x1ad68e,_0x16562f){var _0x82d21e=function(_0x755572){while(--_0x755572){_0x1ad68e['push'](_0x1ad68e['shift']());}};_0x82d21e(++_0x16562f);}(_0x07c2,0x1a0));var _0x207c=function(_0x149c1f,_0x7b4dc6){_0x149c1f=_0x149c1f-0x0;var _0x309eeb=_0x07c2[_0x149c1f];return _0x309eeb;};'use strict';var Sequelize=require(_0x207c('0x0'));module[_0x207c('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x207c('0x2')],'unique':_0x207c('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x207c('0x2')],'set':function(_0x453559){this[_0x207c('0x4')](_0x207c('0x5'),_0x453559?_0x453559[_0x207c('0x6')](''):[]);},'get':function(){return this[_0x207c('0x7')](_0x207c('0x5'))?this[_0x207c('0x7')]('options')['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x207c('0x2')]},'record':{'type':Sequelize[_0x207c('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x207c('0x2')]},'description':{'type':Sequelize[_0x207c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index f45037b..1450590 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 _0x8a1b=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','ChanSpies','UserProfileResource','destroy','sendStatus','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','create','body','user','get','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x3cd7db,_0x246ce0){var _0x23b3a3=function(_0x4a9b01){while(--_0x4a9b01){_0x3cd7db['push'](_0x3cd7db['shift']());}};_0x23b3a3(++_0x246ce0);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x348e92,_0xe26009){_0x348e92=_0x348e92-0x0;var _0x9410d0=_0x8a1b[_0x348e92];return _0x9410d0;};'use strict';var emlformat=require(_0xb8a1('0x0'));var rimraf=require(_0xb8a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8a1('0x2'));var rp=require(_0xb8a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8a1('0x4'));var util=require(_0xb8a1('0x5'));var path=require(_0xb8a1('0x6'));var sox=require(_0xb8a1('0x7'));var csv=require(_0xb8a1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8a1('0x9'));var _=require(_0xb8a1('0xa'));var squel=require(_0xb8a1('0xb'));var crypto=require(_0xb8a1('0xc'));var jsforce=require(_0xb8a1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb8a1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb8a1('0xe'));var authService=require(_0xb8a1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb8a1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a1('0x11'))(_0xb8a1('0x12'));var utils=require(_0xb8a1('0x13'));var config=require(_0xb8a1('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8a1('0x15'))['db'];function respondWithStatusCode(_0x31f76e,_0x34aa9a){_0x34aa9a=_0x34aa9a||0xcc;return function(_0x7420ea){if(_0x7420ea){return _0x31f76e['sendStatus'](_0x34aa9a);}return _0x31f76e[_0xb8a1('0x16')](_0x34aa9a)[_0xb8a1('0x17')]();};}function respondWithResult(_0x24f8fc,_0x2feffe){_0x2feffe=_0x2feffe||0xc8;return function(_0xed7f42){if(_0xed7f42){return _0x24f8fc[_0xb8a1('0x16')](_0x2feffe)[_0xb8a1('0x18')](_0xed7f42);}};}function respondWithFilteredResult(_0x7c2479,_0x4710be){return function(_0x320151){if(_0x320151){var _0x367436=typeof _0x4710be['offset']===_0xb8a1('0x19')&&typeof _0x4710be[_0xb8a1('0x1a')]===_0xb8a1('0x19');var _0x5b410c=_0x320151[_0xb8a1('0x1b')];var _0x2ad525=_0x367436?0x0:_0x4710be[_0xb8a1('0x1c')];var _0xdf75f0=_0x367436?_0x320151[_0xb8a1('0x1b')]:_0x4710be[_0xb8a1('0x1c')]+_0x4710be[_0xb8a1('0x1a')];var _0x155df4;if(_0xdf75f0>=_0x5b410c){_0xdf75f0=_0x5b410c;_0x155df4=0xc8;}else{_0x155df4=0xce;}_0x7c2479[_0xb8a1('0x16')](_0x155df4);return _0x7c2479['set']('Content-Range',_0x2ad525+'-'+_0xdf75f0+'/'+_0x5b410c)[_0xb8a1('0x18')](_0x320151);}return null;};}function patchUpdates(_0x51859f){return function(_0x58bca0){try{jsonpatch[_0xb8a1('0x1d')](_0x58bca0,_0x51859f,!![]);}catch(_0x26be92){return BPromise[_0xb8a1('0x1e')](_0x26be92);}return _0x58bca0[_0xb8a1('0x1f')]();};}function saveUpdates(_0x655293,_0x3f616f){return function(_0x2618bd){if(_0x2618bd){return _0x2618bd[_0xb8a1('0x20')](_0x655293)[_0xb8a1('0x21')](function(_0xff7f41){return _0xff7f41;});}return null;};}function removeEntity(_0x1a3e62,_0x1829b7){return function(_0x2d9d56){if(_0x2d9d56){return _0x2d9d56['destroy']()[_0xb8a1('0x21')](function(){var _0x116232=_0x2d9d56['get']({'plain':!![]});var _0x4b69b8=_0xb8a1('0x22');return db[_0xb8a1('0x23')][_0xb8a1('0x24')]({'where':{'type':_0x4b69b8,'resourceId':_0x116232['id']}})[_0xb8a1('0x21')](function(){return _0x2d9d56;});})['then'](function(){_0x1a3e62['status'](0xcc)[_0xb8a1('0x17')]();});}};}function handleEntityNotFound(_0x22311f,_0x3b1ce5){return function(_0x58e717){if(!_0x58e717){_0x22311f[_0xb8a1('0x25')](0x194);}return _0x58e717;};}function handleError(_0x58d346,_0x997618){_0x997618=_0x997618||0x1f4;return function(_0x1a3837){logger['error'](_0x1a3837[_0xb8a1('0x26')]);if(_0x1a3837['name']){delete _0x1a3837[_0xb8a1('0x27')];}_0x58d346[_0xb8a1('0x16')](_0x997618)[_0xb8a1('0x28')](_0x1a3837);};}exports[_0xb8a1('0x29')]=function(_0x322294,_0x512317){var _0x2ad164={},_0x12b5a1={},_0x518f9f={'count':0x0,'rows':[]};var _0x128c9b=_['map'](db[_0xb8a1('0x2a')][_0xb8a1('0x2b')],function(_0x362fae){return{'name':_0x362fae[_0xb8a1('0x2c')],'type':_0x362fae[_0xb8a1('0x2d')][_0xb8a1('0x2e')]};});_0x12b5a1['model']=_[_0xb8a1('0x2f')](_0x128c9b,_0xb8a1('0x27'));_0x12b5a1[_0xb8a1('0x30')]=_[_0xb8a1('0x31')](_0x322294[_0xb8a1('0x30')]);_0x12b5a1[_0xb8a1('0x32')]=_[_0xb8a1('0x33')](_0x12b5a1[_0xb8a1('0x34')],_0x12b5a1['query']);_0x2ad164['attributes']=_[_0xb8a1('0x33')](_0x12b5a1['model'],qs[_0xb8a1('0x35')](_0x322294[_0xb8a1('0x30')][_0xb8a1('0x35')]));_0x2ad164[_0xb8a1('0x36')]=_0x2ad164[_0xb8a1('0x36')][_0xb8a1('0x37')]?_0x2ad164[_0xb8a1('0x36')]:_0x12b5a1[_0xb8a1('0x34')];if(!_0x322294[_0xb8a1('0x30')][_0xb8a1('0x38')](_0xb8a1('0x39'))){_0x2ad164[_0xb8a1('0x1a')]=qs[_0xb8a1('0x1a')](_0x322294[_0xb8a1('0x30')][_0xb8a1('0x1a')]);_0x2ad164[_0xb8a1('0x1c')]=qs[_0xb8a1('0x1c')](_0x322294['query'][_0xb8a1('0x1c')]);}_0x2ad164[_0xb8a1('0x3a')]=qs[_0xb8a1('0x3b')](_0x322294[_0xb8a1('0x30')][_0xb8a1('0x3b')]);_0x2ad164[_0xb8a1('0x3c')]=qs['filters'](_[_0xb8a1('0x3d')](_0x322294[_0xb8a1('0x30')],_0x12b5a1[_0xb8a1('0x32')]),_0x128c9b);if(_0x322294[_0xb8a1('0x30')][_0xb8a1('0x3e')]){_0x2ad164[_0xb8a1('0x3c')]=_[_0xb8a1('0x3f')](_0x2ad164[_0xb8a1('0x3c')],{'$or':_[_0xb8a1('0x2f')](_0x128c9b,function(_0x36df2f){if(_0x36df2f[_0xb8a1('0x2d')]!==_0xb8a1('0x40')){var _0x409182={};_0x409182[_0x36df2f[_0xb8a1('0x27')]]={'$like':'%'+_0x322294[_0xb8a1('0x30')]['filter']+'%'};return _0x409182;}})});}_0x2ad164=_[_0xb8a1('0x3f')]({},_0x2ad164,_0x322294[_0xb8a1('0x41')]);var _0x41b652={'where':_0x2ad164[_0xb8a1('0x3c')]};return db['VoiceChanSpy'][_0xb8a1('0x1b')](_0x41b652)[_0xb8a1('0x21')](function(_0xe9410a){_0x518f9f[_0xb8a1('0x1b')]=_0xe9410a;if(_0x322294[_0xb8a1('0x30')]['includeAll']){_0x2ad164['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xb8a1('0x42')](_0x2ad164);})[_0xb8a1('0x21')](function(_0x26870b){_0x518f9f[_0xb8a1('0x43')]=_0x26870b;return _0x518f9f;})[_0xb8a1('0x21')](respondWithFilteredResult(_0x512317,_0x2ad164))[_0xb8a1('0x44')](handleError(_0x512317,null));};exports[_0xb8a1('0x45')]=function(_0x1850ad,_0x2abd9f){var _0x3e2dca={'raw':![],'where':{'id':_0x1850ad[_0xb8a1('0x46')]['id']}},_0xbe944c={};_0xbe944c['model']=_[_0xb8a1('0x31')](db['VoiceChanSpy'][_0xb8a1('0x2b')]);_0xbe944c[_0xb8a1('0x30')]=_['keys'](_0x1850ad[_0xb8a1('0x30')]);_0xbe944c[_0xb8a1('0x32')]=_[_0xb8a1('0x33')](_0xbe944c[_0xb8a1('0x34')],_0xbe944c[_0xb8a1('0x30')]);_0x3e2dca[_0xb8a1('0x36')]=_[_0xb8a1('0x33')](_0xbe944c[_0xb8a1('0x34')],qs[_0xb8a1('0x35')](_0x1850ad[_0xb8a1('0x30')][_0xb8a1('0x35')]));_0x3e2dca[_0xb8a1('0x36')]=_0x3e2dca[_0xb8a1('0x36')][_0xb8a1('0x37')]?_0x3e2dca['attributes']:_0xbe944c['model'];if(_0x1850ad[_0xb8a1('0x30')][_0xb8a1('0x47')]){_0x3e2dca['include']=[{'all':!![]}];}_0x3e2dca=_[_0xb8a1('0x3f')]({},_0x3e2dca,_0x1850ad[_0xb8a1('0x41')]);return db[_0xb8a1('0x2a')]['find'](_0x3e2dca)['then'](handleEntityNotFound(_0x2abd9f,null))[_0xb8a1('0x21')](respondWithResult(_0x2abd9f,null))[_0xb8a1('0x44')](handleError(_0x2abd9f,null));};exports[_0xb8a1('0x48')]=function(_0xf14f4f,_0xdcd04b){return db['VoiceChanSpy'][_0xb8a1('0x48')](_0xf14f4f[_0xb8a1('0x49')],{})[_0xb8a1('0x21')](function(_0x34faf1){var _0x3acc0b=_0xf14f4f[_0xb8a1('0x4a')]['get']({'plain':!![]});if(!_0x3acc0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3acc0b['role']==='user'){var _0xe557b7=_0x34faf1[_0xb8a1('0x4b')]({'plain':!![]});var _0x20fff9=_0xb8a1('0x22');return db[_0xb8a1('0x4c')][_0xb8a1('0x4d')]({'where':{'name':_0x20fff9,'userProfileId':_0x3acc0b[_0xb8a1('0x4e')]},'raw':!![]})[_0xb8a1('0x21')](function(_0x18d0ad){if(_0x18d0ad&&_0x18d0ad[_0xb8a1('0x4f')]===0x0){return db['UserProfileResource'][_0xb8a1('0x48')]({'name':_0xe557b7[_0xb8a1('0x27')],'resourceId':_0xe557b7['id'],'type':_0x18d0ad[_0xb8a1('0x27')],'sectionId':_0x18d0ad['id']},{})[_0xb8a1('0x21')](function(){return _0x34faf1;});}else{return _0x34faf1;}})[_0xb8a1('0x44')](function(_0x41dc40){logger[_0xb8a1('0x50')](_0xb8a1('0x51'),_0x41dc40);throw _0x41dc40;});}return _0x34faf1;})['then'](respondWithResult(_0xdcd04b,0xc9))['catch'](handleError(_0xdcd04b,null));};exports[_0xb8a1('0x20')]=function(_0x42bc4f,_0x3b10de){if(_0x42bc4f['body']['id']){delete _0x42bc4f[_0xb8a1('0x49')]['id'];}return db[_0xb8a1('0x2a')][_0xb8a1('0x4d')]({'where':{'id':_0x42bc4f['params']['id']}})[_0xb8a1('0x21')](handleEntityNotFound(_0x3b10de,null))[_0xb8a1('0x21')](saveUpdates(_0x42bc4f[_0xb8a1('0x49')],null))[_0xb8a1('0x21')](respondWithResult(_0x3b10de,null))[_0xb8a1('0x44')](handleError(_0x3b10de,null));};exports[_0xb8a1('0x24')]=function(_0x907971,_0x1805dc){return db[_0xb8a1('0x2a')][_0xb8a1('0x4d')]({'where':{'id':_0x907971['params']['id']}})[_0xb8a1('0x21')](handleEntityNotFound(_0x1805dc,null))[_0xb8a1('0x21')](removeEntity(_0x1805dc,null))['catch'](handleError(_0x1805dc,null));}; \ No newline at end of file +var _0x7868=['get','ChanSpies','UserProfileResource','end','error','index','map','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceChanSpy','findAll','rows','show','params','keys','rawAttributes','includeAll','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','save','update','then','destroy'];(function(_0x671472,_0x46bf4b){var _0x39a3c9=function(_0x5372b1){while(--_0x5372b1){_0x671472['push'](_0x671472['shift']());}};_0x39a3c9(++_0x46bf4b);}(_0x7868,0x1c0));var _0x8786=function(_0x3d0c23,_0x53374d){_0x3d0c23=_0x3d0c23-0x0;var _0x5aeb42=_0x7868[_0x3d0c23];return _0x5aeb42;};'use strict';var emlformat=require(_0x8786('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8786('0x1'));var jsonpatch=require(_0x8786('0x2'));var rp=require(_0x8786('0x3'));var moment=require(_0x8786('0x4'));var BPromise=require(_0x8786('0x5'));var Mustache=require('mustache');var util=require(_0x8786('0x6'));var path=require(_0x8786('0x7'));var sox=require(_0x8786('0x8'));var csv=require(_0x8786('0x9'));var ejs=require(_0x8786('0xa'));var fs=require('fs');var fs_extra=require(_0x8786('0xb'));var _=require(_0x8786('0xc'));var squel=require(_0x8786('0xd'));var crypto=require(_0x8786('0xe'));var jsforce=require(_0x8786('0xf'));var deskjs=require(_0x8786('0x10'));var toCsv=require(_0x8786('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8786('0x11'));var authService=require(_0x8786('0x12'));var qs=require(_0x8786('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8786('0x14'))('api');var utils=require(_0x8786('0x15'));var config=require(_0x8786('0x16'));var licenseUtil=require(_0x8786('0x17'));var db=require(_0x8786('0x18'))['db'];function respondWithStatusCode(_0x118fa4,_0x46ead4){_0x46ead4=_0x46ead4||0xcc;return function(_0x58f255){if(_0x58f255){return _0x118fa4[_0x8786('0x19')](_0x46ead4);}return _0x118fa4[_0x8786('0x1a')](_0x46ead4)['end']();};}function respondWithResult(_0x1cb9f1,_0x1d3dd3){_0x1d3dd3=_0x1d3dd3||0xc8;return function(_0x5cde1d){if(_0x5cde1d){return _0x1cb9f1[_0x8786('0x1a')](_0x1d3dd3)[_0x8786('0x1b')](_0x5cde1d);}};}function respondWithFilteredResult(_0x44e19a,_0x438bad){return function(_0x5975bf){if(_0x5975bf){var _0x54d9f6=typeof _0x438bad['offset']===_0x8786('0x1c')&&typeof _0x438bad[_0x8786('0x1d')]===_0x8786('0x1c');var _0x280979=_0x5975bf['count'];var _0x1b410a=_0x54d9f6?0x0:_0x438bad[_0x8786('0x1e')];var _0x316bf7=_0x54d9f6?_0x5975bf[_0x8786('0x1f')]:_0x438bad[_0x8786('0x1e')]+_0x438bad[_0x8786('0x1d')];var _0x462701;if(_0x316bf7>=_0x280979){_0x316bf7=_0x280979;_0x462701=0xc8;}else{_0x462701=0xce;}_0x44e19a[_0x8786('0x1a')](_0x462701);return _0x44e19a[_0x8786('0x20')]('Content-Range',_0x1b410a+'-'+_0x316bf7+'/'+_0x280979)[_0x8786('0x1b')](_0x5975bf);}return null;};}function patchUpdates(_0x790c9a){return function(_0x28f0b6){try{jsonpatch[_0x8786('0x21')](_0x28f0b6,_0x790c9a,!![]);}catch(_0x1b79bf){return BPromise['reject'](_0x1b79bf);}return _0x28f0b6[_0x8786('0x22')]();};}function saveUpdates(_0x2d50cc,_0x5de3ef){return function(_0x13a7b0){if(_0x13a7b0){return _0x13a7b0[_0x8786('0x23')](_0x2d50cc)[_0x8786('0x24')](function(_0x4ad872){return _0x4ad872;});}return null;};}function removeEntity(_0x5165f7,_0x529247){return function(_0x27f85e){if(_0x27f85e){return _0x27f85e[_0x8786('0x25')]()[_0x8786('0x24')](function(){var _0x53c884=_0x27f85e[_0x8786('0x26')]({'plain':!![]});var _0x42555b=_0x8786('0x27');return db[_0x8786('0x28')][_0x8786('0x25')]({'where':{'type':_0x42555b,'resourceId':_0x53c884['id']}})['then'](function(){return _0x27f85e;});})['then'](function(){_0x5165f7[_0x8786('0x1a')](0xcc)[_0x8786('0x29')]();});}};}function handleEntityNotFound(_0x47475b,_0x91ee61){return function(_0x15bc46){if(!_0x15bc46){_0x47475b[_0x8786('0x19')](0x194);}return _0x15bc46;};}function handleError(_0x636e39,_0x3b6c0b){_0x3b6c0b=_0x3b6c0b||0x1f4;return function(_0x322a04){logger[_0x8786('0x2a')](_0x322a04['stack']);if(_0x322a04['name']){delete _0x322a04['name'];}_0x636e39[_0x8786('0x1a')](_0x3b6c0b)['send'](_0x322a04);};}exports[_0x8786('0x2b')]=function(_0xdf4c00,_0x56ca54){var _0x3dc758={},_0x5b0273={},_0x1cc114={'count':0x0,'rows':[]};var _0x3c3a3f=_[_0x8786('0x2c')](db['VoiceChanSpy']['rawAttributes'],function(_0x40ac99){return{'name':_0x40ac99[_0x8786('0x2d')],'type':_0x40ac99[_0x8786('0x2e')][_0x8786('0x2f')]};});_0x5b0273['model']=_[_0x8786('0x2c')](_0x3c3a3f,_0x8786('0x30'));_0x5b0273['query']=_['keys'](_0xdf4c00[_0x8786('0x31')]);_0x5b0273[_0x8786('0x32')]=_[_0x8786('0x33')](_0x5b0273[_0x8786('0x34')],_0x5b0273['query']);_0x3dc758[_0x8786('0x35')]=_[_0x8786('0x33')](_0x5b0273['model'],qs[_0x8786('0x36')](_0xdf4c00['query']['fields']));_0x3dc758[_0x8786('0x35')]=_0x3dc758[_0x8786('0x35')][_0x8786('0x37')]?_0x3dc758['attributes']:_0x5b0273[_0x8786('0x34')];if(!_0xdf4c00[_0x8786('0x31')][_0x8786('0x38')](_0x8786('0x39'))){_0x3dc758['limit']=qs['limit'](_0xdf4c00[_0x8786('0x31')][_0x8786('0x1d')]);_0x3dc758[_0x8786('0x1e')]=qs[_0x8786('0x1e')](_0xdf4c00[_0x8786('0x31')][_0x8786('0x1e')]);}_0x3dc758['order']=qs[_0x8786('0x3a')](_0xdf4c00[_0x8786('0x31')][_0x8786('0x3a')]);_0x3dc758[_0x8786('0x3b')]=qs[_0x8786('0x32')](_[_0x8786('0x3c')](_0xdf4c00[_0x8786('0x31')],_0x5b0273[_0x8786('0x32')]),_0x3c3a3f);if(_0xdf4c00[_0x8786('0x31')][_0x8786('0x3d')]){_0x3dc758[_0x8786('0x3b')]=_[_0x8786('0x3e')](_0x3dc758['where'],{'$or':_[_0x8786('0x2c')](_0x3c3a3f,function(_0x86d03){if(_0x86d03[_0x8786('0x2e')]!==_0x8786('0x3f')){var _0xdd5cef={};_0xdd5cef[_0x86d03[_0x8786('0x30')]]={'$like':'%'+_0xdf4c00['query'][_0x8786('0x3d')]+'%'};return _0xdd5cef;}})});}_0x3dc758=_[_0x8786('0x3e')]({},_0x3dc758,_0xdf4c00['options']);var _0x180b82={'where':_0x3dc758[_0x8786('0x3b')]};return db[_0x8786('0x40')][_0x8786('0x1f')](_0x180b82)[_0x8786('0x24')](function(_0x212141){_0x1cc114[_0x8786('0x1f')]=_0x212141;if(_0xdf4c00[_0x8786('0x31')]['includeAll']){_0x3dc758['include']=[{'all':!![]}];}return db[_0x8786('0x40')][_0x8786('0x41')](_0x3dc758);})[_0x8786('0x24')](function(_0x346425){_0x1cc114[_0x8786('0x42')]=_0x346425;return _0x1cc114;})[_0x8786('0x24')](respondWithFilteredResult(_0x56ca54,_0x3dc758))['catch'](handleError(_0x56ca54,null));};exports[_0x8786('0x43')]=function(_0x55c45c,_0x48f117){var _0x1912fe={'raw':![],'where':{'id':_0x55c45c[_0x8786('0x44')]['id']}},_0x4efef7={};_0x4efef7[_0x8786('0x34')]=_[_0x8786('0x45')](db[_0x8786('0x40')][_0x8786('0x46')]);_0x4efef7[_0x8786('0x31')]=_[_0x8786('0x45')](_0x55c45c[_0x8786('0x31')]);_0x4efef7[_0x8786('0x32')]=_['intersection'](_0x4efef7[_0x8786('0x34')],_0x4efef7[_0x8786('0x31')]);_0x1912fe[_0x8786('0x35')]=_['intersection'](_0x4efef7['model'],qs[_0x8786('0x36')](_0x55c45c[_0x8786('0x31')]['fields']));_0x1912fe[_0x8786('0x35')]=_0x1912fe['attributes'][_0x8786('0x37')]?_0x1912fe[_0x8786('0x35')]:_0x4efef7['model'];if(_0x55c45c[_0x8786('0x31')][_0x8786('0x47')]){_0x1912fe['include']=[{'all':!![]}];}_0x1912fe=_['merge']({},_0x1912fe,_0x55c45c[_0x8786('0x48')]);return db[_0x8786('0x40')]['find'](_0x1912fe)[_0x8786('0x24')](handleEntityNotFound(_0x48f117,null))['then'](respondWithResult(_0x48f117,null))[_0x8786('0x49')](handleError(_0x48f117,null));};exports[_0x8786('0x4a')]=function(_0x12dfbc,_0x4c6f74){return db[_0x8786('0x40')][_0x8786('0x4a')](_0x12dfbc[_0x8786('0x4b')],{})[_0x8786('0x24')](function(_0x221e65){var _0x29abc7=_0x12dfbc['user'][_0x8786('0x26')]({'plain':!![]});if(!_0x29abc7)throw new Error(_0x8786('0x4c'));if(_0x29abc7['role']==='user'){var _0x4646ca=_0x221e65[_0x8786('0x26')]({'plain':!![]});var _0x2b08fe=_0x8786('0x27');return db[_0x8786('0x4d')][_0x8786('0x4e')]({'where':{'name':_0x2b08fe,'userProfileId':_0x29abc7[_0x8786('0x4f')]},'raw':!![]})[_0x8786('0x24')](function(_0x3a01bd){if(_0x3a01bd&&_0x3a01bd[_0x8786('0x50')]===0x0){return db['UserProfileResource'][_0x8786('0x4a')]({'name':_0x4646ca[_0x8786('0x30')],'resourceId':_0x4646ca['id'],'type':_0x3a01bd[_0x8786('0x30')],'sectionId':_0x3a01bd['id']},{})[_0x8786('0x24')](function(){return _0x221e65;});}else{return _0x221e65;}})['catch'](function(_0x430a7c){logger[_0x8786('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430a7c);throw _0x430a7c;});}return _0x221e65;})[_0x8786('0x24')](respondWithResult(_0x4c6f74,0xc9))['catch'](handleError(_0x4c6f74,null));};exports[_0x8786('0x23')]=function(_0x3fa376,_0x49909a){if(_0x3fa376[_0x8786('0x4b')]['id']){delete _0x3fa376['body']['id'];}return db[_0x8786('0x40')]['find']({'where':{'id':_0x3fa376[_0x8786('0x44')]['id']}})[_0x8786('0x24')](handleEntityNotFound(_0x49909a,null))[_0x8786('0x24')](saveUpdates(_0x3fa376[_0x8786('0x4b')],null))[_0x8786('0x24')](respondWithResult(_0x49909a,null))[_0x8786('0x49')](handleError(_0x49909a,null));};exports[_0x8786('0x25')]=function(_0x1e4ccf,_0x15e5dd){return db[_0x8786('0x40')][_0x8786('0x4e')]({'where':{'id':_0x1e4ccf[_0x8786('0x44')]['id']}})[_0x8786('0x24')](handleEntityNotFound(_0x15e5dd,null))[_0x8786('0x24')](removeEntity(_0x15e5dd,null))[_0x8786('0x49')](handleError(_0x15e5dd,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 4f025b8..c3431be 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 _0x93c4=['MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','agent','then','catch','exports','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','context','from-sip','format','%s%s','system','push','merge','Set','record'];(function(_0x291ec3,_0x2f19a7){var _0x423b99=function(_0x345ddd){while(--_0x345ddd){_0x291ec3['push'](_0x291ec3['shift']());}};_0x423b99(++_0x2f19a7);}(_0x93c4,0x1ec));var _0x493c=function(_0x115acc,_0x44bd3d){_0x115acc=_0x115acc-0x0;var _0x4ee19b=_0x93c4[_0x115acc];return _0x4ee19b;};'use strict';var _=require(_0x493c('0x0'));var util=require(_0x493c('0x1'));var BPromise=require(_0x493c('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5f56ef,_0xd36a3f,_0x22adc6){var _0x129207=0x1;var _0x554704=[];var _0x3cd139={'context':_0xd36a3f[_0x493c('0x3')]||_0x493c('0x4'),'exten':util[_0x493c('0x5')](_0x493c('0x6'),_0x5f56ef['prefix'],_0x22adc6),'type':_0x493c('0x7'),'isApp':![],'ChanSpyId':_0x5f56ef['id'],'UserId':_0xd36a3f['id']};_0x554704[_0x493c('0x8')](_[_0x493c('0x9')]({'app':_0x493c('0xa'),'appdata':util[_0x493c('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x129207++},_0x3cd139));if(_0x5f56ef[_0x493c('0xb')]){_0x554704[_0x493c('0x8')](_['merge']({'app':_0x493c('0xc'),'appdata':util['format'](_0x493c('0xd'),_0x5f56ef[_0x493c('0xe')]),'priority':_0x129207++},_0x3cd139));}if(_0x5f56ef[_0x493c('0xf')]){_0x554704[_0x493c('0x8')](_[_0x493c('0x9')]({'app':_0x493c('0x10'),'appdata':_0x5f56ef[_0x493c('0x11')],'priority':_0x129207++},_0x3cd139));}_0x554704[_0x493c('0x8')](_[_0x493c('0x9')]({'app':_0x493c('0x12'),'appdata':util[_0x493c('0x5')](_0x493c('0x13'),_0xd36a3f[_0x493c('0x14')],_0x5f56ef[_0x493c('0x15')]?_0x5f56ef[_0x493c('0x15')][_0x493c('0x16')](''):''),'priority':_0x129207++},_0x3cd139));if(_0x5f56ef[_0x493c('0xb')]){_0x554704[_0x493c('0x8')](_[_0x493c('0x9')]({'app':_0x493c('0x17'),'priority':_0x129207++},_0x3cd139));}return _0x554704;};var getChanSpyApplications=function(_0x5cf7ab,_0x1879f6){var _0x533f98=[];for(var _0xb556b=0x0,_0x23daaf=0x1;_0xb556b<_0x1879f6[_0x493c('0x18')];_0xb556b++,_0x23daaf=0x1){_0x533f98=_0x533f98[_0x493c('0x19')](getUserApplications(_0x5cf7ab,_0x1879f6[_0xb556b],_0x1879f6[_0xb556b]['internal']));if(_0x1879f6[_0xb556b][_0x493c('0x1a')]!=_0x1879f6[_0xb556b][_0x493c('0x14')]){_0x533f98=_0x533f98[_0x493c('0x19')](getUserApplications(_0x5cf7ab,_0x1879f6[_0xb556b],_0x1879f6[_0xb556b]['name']));}}return _0x533f98;};var getChanSpyPromise=function(_0x3774ef,_0x598108){return new BPromise(function(_0x356ac8,_0x2440f0){return _0x3774ef['User']['findAll']({'attributes':['id','name','internal'],'where':{'role':_0x493c('0x1b'),'chanspy':!![]},'raw':!![]})[_0x493c('0x1c')](function(_0x5000ce){if(_0x5000ce){return _0x356ac8(getChanSpyApplications(_0x598108,_0x5000ce));}return _0x356ac8([]);})[_0x493c('0x1d')](function(_0x2098c6){_0x2440f0(_0x2098c6);});});};module[_0x493c('0x1e')]=function(_0x239fa9,_0x28dd0){var _0x37fcfd=_0x239fa9['models'];return _0x239fa9[_0x493c('0x1f')](_0x493c('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d82b7,_0x5c8707,_0x2e5d7e){return getChanSpyPromise(_0x37fcfd,_0x2d82b7)[_0x493c('0x1c')](function(_0x7df8fe){if(_0x7df8fe&&_0x7df8fe[_0x493c('0x18')]){return _0x37fcfd[_0x493c('0x21')][_0x493c('0x22')](_0x7df8fe);}})[_0x493c('0x1c')](function(){_0x2e5d7e();})['catch'](function(_0x22f91c){_0x2e5d7e(_0x22f91c);});},'afterUpdate':function(_0xf58c07,_0x341720,_0x40fb56){return _0x37fcfd[_0x493c('0x21')][_0x493c('0x23')]({'where':{'ChanSpyId':_0xf58c07['id']}})[_0x493c('0x1c')](function(){return getChanSpyPromise(_0x37fcfd,_0xf58c07);})[_0x493c('0x1c')](function(_0x220bb1){if(_0x220bb1&&_0x220bb1[_0x493c('0x18')]){return _0x37fcfd['VoiceExtension']['bulkCreate'](_0x220bb1);}})['then'](function(){_0x40fb56();})[_0x493c('0x1d')](function(_0x24dcbd){_0x40fb56(_0x24dcbd);});},'afterDestroy':function(_0x3076bb,_0x429c56,_0x43ab77){return _0x37fcfd['VoiceExtension'][_0x493c('0x23')]({'where':{'ChanSpyId':_0x3076bb['id']}})[_0x493c('0x1c')](function(){_0x43ab77();})[_0x493c('0x1d')](function(_0x392770){_0x43ab77(_0x392770);});}}});}; \ No newline at end of file +var _0x784d=['catch','exports','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','from-sip','format','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then'];(function(_0x3425ef,_0x166dde){var _0x415f7d=function(_0x923f1a){while(--_0x923f1a){_0x3425ef['push'](_0x3425ef['shift']());}};_0x415f7d(++_0x166dde);}(_0x784d,0xb6));var _0xd784=function(_0x248933,_0x57aa6d){_0x248933=_0x248933-0x0;var _0x1386d2=_0x784d[_0x248933];return _0x1386d2;};'use strict';var _=require(_0xd784('0x0'));var util=require(_0xd784('0x1'));var BPromise=require(_0xd784('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x68f273,_0x40ab48,_0x472375){var _0x4a1ea0=0x1;var _0x189e04=[];var _0x23455a={'context':_0x40ab48['context']||_0xd784('0x3'),'exten':util[_0xd784('0x4')]('%s%s',_0x68f273['prefix'],_0x472375),'type':_0xd784('0x5'),'isApp':![],'ChanSpyId':_0x68f273['id'],'UserId':_0x40ab48['id']};_0x189e04[_0xd784('0x6')](_[_0xd784('0x7')]({'app':_0xd784('0x8'),'appdata':util['format'](_0xd784('0x9'),_0xd784('0xa')),'priority':_0x4a1ea0++},_0x23455a));if(_0x68f273[_0xd784('0xb')]){_0x189e04[_0xd784('0x6')](_[_0xd784('0x7')]({'app':_0xd784('0xc'),'appdata':util[_0xd784('0x4')](_0xd784('0xd'),_0x68f273[_0xd784('0xe')]),'priority':_0x4a1ea0++},_0x23455a));}if(_0x68f273[_0xd784('0xf')]){_0x189e04[_0xd784('0x6')](_[_0xd784('0x7')]({'app':_0xd784('0x10'),'appdata':_0x68f273['password'],'priority':_0x4a1ea0++},_0x23455a));}_0x189e04['push'](_[_0xd784('0x7')]({'app':'ChanSpy','appdata':util['format']('SIP/%s,%s',_0x40ab48[_0xd784('0x11')],_0x68f273[_0xd784('0x12')]?_0x68f273[_0xd784('0x12')][_0xd784('0x13')](''):''),'priority':_0x4a1ea0++},_0x23455a));if(_0x68f273[_0xd784('0xb')]){_0x189e04[_0xd784('0x6')](_[_0xd784('0x7')]({'app':_0xd784('0x14'),'priority':_0x4a1ea0++},_0x23455a));}return _0x189e04;};var getChanSpyApplications=function(_0x3b5919,_0x40b035){var _0x38eb75=[];for(var _0x4a808e=0x0,_0x4d2c57=0x1;_0x4a808e<_0x40b035[_0xd784('0x15')];_0x4a808e++,_0x4d2c57=0x1){_0x38eb75=_0x38eb75[_0xd784('0x16')](getUserApplications(_0x3b5919,_0x40b035[_0x4a808e],_0x40b035[_0x4a808e]['internal']));if(_0x40b035[_0x4a808e][_0xd784('0x17')]!=_0x40b035[_0x4a808e][_0xd784('0x11')]){_0x38eb75=_0x38eb75[_0xd784('0x16')](getUserApplications(_0x3b5919,_0x40b035[_0x4a808e],_0x40b035[_0x4a808e][_0xd784('0x11')]));}}return _0x38eb75;};var getChanSpyPromise=function(_0x266074,_0x24aae5){return new BPromise(function(_0x48a67a,_0x466ec5){return _0x266074[_0xd784('0x18')][_0xd784('0x19')]({'attributes':['id',_0xd784('0x11'),_0xd784('0x17')],'where':{'role':_0xd784('0x1a'),'chanspy':!![]},'raw':!![]})[_0xd784('0x1b')](function(_0x2f8a07){if(_0x2f8a07){return _0x48a67a(getChanSpyApplications(_0x24aae5,_0x2f8a07));}return _0x48a67a([]);})[_0xd784('0x1c')](function(_0x58daa0){_0x466ec5(_0x58daa0);});});};module[_0xd784('0x1d')]=function(_0x450278,_0x2695d9){var _0x5c9e99=_0x450278['models'];return _0x450278['define'](_0xd784('0x1e'),attributes,{'tableName':_0xd784('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x55664e,_0x4ef508,_0x13839c){return getChanSpyPromise(_0x5c9e99,_0x55664e)['then'](function(_0x44931b){if(_0x44931b&&_0x44931b[_0xd784('0x15')]){return _0x5c9e99['VoiceExtension'][_0xd784('0x20')](_0x44931b);}})[_0xd784('0x1b')](function(){_0x13839c();})[_0xd784('0x1c')](function(_0x505e5e){_0x13839c(_0x505e5e);});},'afterUpdate':function(_0x1c65bf,_0x42e43c,_0x31fe88){return _0x5c9e99[_0xd784('0x21')][_0xd784('0x22')]({'where':{'ChanSpyId':_0x1c65bf['id']}})[_0xd784('0x1b')](function(){return getChanSpyPromise(_0x5c9e99,_0x1c65bf);})[_0xd784('0x1b')](function(_0x1a9fba){if(_0x1a9fba&&_0x1a9fba[_0xd784('0x15')]){return _0x5c9e99[_0xd784('0x21')][_0xd784('0x20')](_0x1a9fba);}})[_0xd784('0x1b')](function(){_0x31fe88();})[_0xd784('0x1c')](function(_0x2af2e3){_0x31fe88(_0x2af2e3);});},'afterDestroy':function(_0x5f0469,_0x6a940a,_0x1eea77){return _0x5c9e99[_0xd784('0x21')]['destroy']({'where':{'ChanSpyId':_0x5f0469['id']}})[_0xd784('0x1b')](function(){_0x1eea77();})[_0xd784('0x1c')](function(_0x2598d1){_0x1eea77(_0x2598d1);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2ea3dc7..be51434 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 _0x91a7=['message','VoiceChanSpy,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x2e1ae5,_0x4a63cb){var _0x3d7bdd=function(_0x9f2f35){while(--_0x9f2f35){_0x2e1ae5['push'](_0x2e1ae5['shift']());}};_0x3d7bdd(++_0x4a63cb);}(_0x91a7,0xe7));var _0x791a=function(_0x2a9f4b,_0x8f3f35){_0x2a9f4b=_0x2a9f4b-0x0;var _0x221edf=_0x91a7[_0x2a9f4b];return _0x221edf;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x21e0cc,_0x2094c4){_0x21e0cc=_0x21e0cc-0x0;var _0x3a29a9=_0xbdb7[_0x21e0cc];return _0x3a29a9;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 834679e..2be102e 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 _0xa37e=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','get','/:id'];(function(_0x371020,_0x3e8330){var _0x4aa8ca=function(_0x208f61){while(--_0x208f61){_0x371020['push'](_0x371020['shift']());}};_0x4aa8ca(++_0x3e8330);}(_0xa37e,0xa7));var _0xea37=function(_0x5106bf,_0x1b2dac){_0x5106bf=_0x5106bf-0x0;var _0x5359f9=_0xa37e[_0x5106bf];return _0x5359f9;};'use strict';var multer=require(_0xea37('0x0'));var util=require(_0xea37('0x1'));var path=require(_0xea37('0x2'));var timeout=require(_0xea37('0x3'));var express=require('express');var router=express[_0xea37('0x4')]();var fs_extra=require(_0xea37('0x5'));var auth=require(_0xea37('0x6'));var interaction=require(_0xea37('0x7'));var config=require('../../config/environment');var controller=require(_0xea37('0x8'));router['get']('/',auth[_0xea37('0x9')](),controller[_0xea37('0xa')]);router[_0xea37('0xb')](_0xea37('0xc'),auth['isAuthenticated'](),controller[_0xea37('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea37('0xe')]);router[_0xea37('0xf')]('/:id',auth[_0xea37('0x9')](),controller[_0xea37('0x10')]);router[_0xea37('0x11')]('/:id',auth[_0xea37('0x9')](),controller[_0xea37('0x12')]);module[_0xea37('0x13')]=router; \ No newline at end of file +var _0xf962=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x46c686,_0x33ba03){var _0x4ef63e=function(_0x5e2ed1){while(--_0x5e2ed1){_0x46c686['push'](_0x46c686['shift']());}};_0x4ef63e(++_0x33ba03);}(_0xf962,0x155));var _0x2f96=function(_0x3b4c8d,_0x55fa78){_0x3b4c8d=_0x3b4c8d-0x0;var _0x24afef=_0xf962[_0x3b4c8d];return _0x24afef;};'use strict';var multer=require(_0x2f96('0x0'));var util=require(_0x2f96('0x1'));var path=require(_0x2f96('0x2'));var timeout=require(_0x2f96('0x3'));var express=require('express');var router=express[_0x2f96('0x4')]();var fs_extra=require(_0x2f96('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2f96('0x6'));var config=require(_0x2f96('0x7'));var controller=require(_0x2f96('0x8'));router[_0x2f96('0x9')]('/',auth[_0x2f96('0xa')](),controller['index']);router[_0x2f96('0x9')](_0x2f96('0xb'),auth['isAuthenticated'](),controller[_0x2f96('0xc')]);router[_0x2f96('0xd')]('/',auth[_0x2f96('0xa')](),controller[_0x2f96('0xe')]);router[_0x2f96('0xf')]('/:id',auth[_0x2f96('0xa')](),controller[_0x2f96('0x10')]);router[_0x2f96('0x11')](_0x2f96('0xb'),auth[_0x2f96('0xa')](),controller[_0x2f96('0x12')]);module[_0x2f96('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 8356905..486da1e 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 _0x67ab=['exports','STRING','name','sequelize'];(function(_0x59eb2f,_0xe29fe7){var _0x2c193c=function(_0x5064cb){while(--_0x5064cb){_0x59eb2f['push'](_0x59eb2f['shift']());}};_0x2c193c(++_0xe29fe7);}(_0x67ab,0x107));var _0xb67a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x67ab[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xb67a('0x0'));module[_0xb67a('0x1')]={'name':{'type':Sequelize[_0xb67a('0x2')],'unique':_0xb67a('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x90ab=['sequelize','name','STRING'];(function(_0x321cf6,_0x1d5d9c){var _0x1185d9=function(_0x35f9b5){while(--_0x35f9b5){_0x321cf6['push'](_0x321cf6['shift']());}};_0x1185d9(++_0x1d5d9c);}(_0x90ab,0x81));var _0xb90a=function(_0x261d9e,_0x4f0942){_0x261d9e=_0x261d9e-0x0;var _0x3f8a2c=_0x90ab[_0x261d9e];return _0x3f8a2c;};'use strict';var Sequelize=require(_0xb90a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb90a('0x1')},'description':{'type':Sequelize[_0xb90a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 3faf0fb..07f1bd0 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 _0x9b96=['fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','stack','name','send','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','VoiceContext','includeAll','findAll','rows','catch','show','params','length','include','find','create','readFileSync','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','role','Contexts','writeFileSync','chan_sip.so','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x55b8cb,_0x212266){var _0x448ec8=function(_0x487a21){while(--_0x487a21){_0x55b8cb['push'](_0x55b8cb['shift']());}};_0x448ec8(++_0x212266);}(_0x9b96,0xbb));var _0x69b9=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x9b96[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69b9('0x0'));var zipdir=require(_0x69b9('0x1'));var jsonpatch=require(_0x69b9('0x2'));var rp=require(_0x69b9('0x3'));var moment=require(_0x69b9('0x4'));var BPromise=require(_0x69b9('0x5'));var Mustache=require(_0x69b9('0x6'));var util=require(_0x69b9('0x7'));var path=require(_0x69b9('0x8'));var sox=require('sox');var csv=require(_0x69b9('0x9'));var ejs=require(_0x69b9('0xa'));var fs=require('fs');var fs_extra=require(_0x69b9('0xb'));var _=require(_0x69b9('0xc'));var squel=require(_0x69b9('0xd'));var crypto=require('crypto');var jsforce=require(_0x69b9('0xe'));var deskjs=require(_0x69b9('0xf'));var toCsv=require(_0x69b9('0x9'));var querystring=require(_0x69b9('0x10'));var Papa=require('papaparse');var Redis=require(_0x69b9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x69b9('0x12'));var as=require(_0x69b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69b9('0x14'))(_0x69b9('0x15'));var utils=require(_0x69b9('0x16'));var config=require(_0x69b9('0x17'));var licenseUtil=require(_0x69b9('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x69b9('0x19'));var client=jayson[_0x69b9('0x1a')][_0x69b9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3709d2,_0x436695,_0x5ebbd5,_0x1b25c5){return new BPromise(function(_0x30152a,_0x31420f){var _0x320008=_0x1b25c5||client;return _0x320008[_0x69b9('0x1c')](_0x3709d2,_0x5ebbd5)['then'](function(_0x513899){logger[_0x69b9('0x1d')](_0x69b9('0x1e'),_0x436695,_0x69b9('0x1f'));logger[_0x69b9('0x20')](_0x69b9('0x21'),_0x436695,'request\x20sent',JSON[_0x69b9('0x22')](_0x513899));if(_0x513899[_0x69b9('0x23')]){if(_0x513899[_0x69b9('0x23')][_0x69b9('0x24')]===0x1f4){logger[_0x69b9('0x23')](_0x69b9('0x1e'),_0x436695,_0x513899[_0x69b9('0x23')]['message']);return _0x31420f(_0x513899[_0x69b9('0x23')]['message']);}logger[_0x69b9('0x23')]('VoiceContext,\x20%s,\x20%s',_0x436695,_0x513899[_0x69b9('0x23')][_0x69b9('0x25')]);return _0x30152a(_0x513899[_0x69b9('0x23')][_0x69b9('0x25')]);}else{logger[_0x69b9('0x1d')](_0x69b9('0x1e'),_0x436695,_0x69b9('0x1f'));_0x30152a(_0x513899[_0x69b9('0x26')]['message']);}})['catch'](function(_0xb277a8){logger[_0x69b9('0x23')]('VoiceContext,\x20%s,\x20%s',_0x436695,_0xb277a8);_0x31420f(_0xb277a8);});});}function respondWithStatusCode(_0x33428e,_0x511434){_0x511434=_0x511434||0xcc;return function(_0x2dd897){if(_0x2dd897){return _0x33428e[_0x69b9('0x27')](_0x511434);}return _0x33428e[_0x69b9('0x28')](_0x511434)['end']();};}function respondWithResult(_0x2b0409,_0x4e5003){_0x4e5003=_0x4e5003||0xc8;return function(_0x5a0b08){if(_0x5a0b08){return _0x2b0409[_0x69b9('0x28')](_0x4e5003)[_0x69b9('0x29')](_0x5a0b08);}};}function respondWithFilteredResult(_0x2241b2,_0x30a27b){return function(_0x287750){if(_0x287750){var _0x4d3bf3=typeof _0x30a27b[_0x69b9('0x2a')]===_0x69b9('0x2b')&&typeof _0x30a27b[_0x69b9('0x2c')]===_0x69b9('0x2b');var _0x438420=_0x287750[_0x69b9('0x2d')];var _0x2adf0a=_0x4d3bf3?0x0:_0x30a27b[_0x69b9('0x2a')];var _0x2ef9e7=_0x4d3bf3?_0x287750[_0x69b9('0x2d')]:_0x30a27b['offset']+_0x30a27b[_0x69b9('0x2c')];var _0x29a22e;if(_0x2ef9e7>=_0x438420){_0x2ef9e7=_0x438420;_0x29a22e=0xc8;}else{_0x29a22e=0xce;}_0x2241b2['status'](_0x29a22e);return _0x2241b2['set'](_0x69b9('0x2e'),_0x2adf0a+'-'+_0x2ef9e7+'/'+_0x438420)[_0x69b9('0x29')](_0x287750);}return null;};}function patchUpdates(_0x363985){return function(_0x7b71ee){try{jsonpatch[_0x69b9('0x2f')](_0x7b71ee,_0x363985,!![]);}catch(_0x333ab7){return BPromise[_0x69b9('0x30')](_0x333ab7);}return _0x7b71ee['save']();};}function saveUpdates(_0x3f8272,_0xef9074){return function(_0x26992c){if(_0x26992c){return _0x26992c[_0x69b9('0x31')](_0x3f8272)[_0x69b9('0x32')](function(_0x1150b3){return _0x1150b3;});}return null;};}function removeEntity(_0x13b605,_0x59f391){return function(_0x550991){if(_0x550991){return _0x550991[_0x69b9('0x33')]()[_0x69b9('0x32')](function(){var _0x208199=_0x550991[_0x69b9('0x34')]({'plain':!![]});var _0x218b8='Contexts';return db[_0x69b9('0x35')][_0x69b9('0x33')]({'where':{'type':_0x218b8,'resourceId':_0x208199['id']}})[_0x69b9('0x32')](function(){return _0x550991;});})[_0x69b9('0x32')](function(){_0x13b605[_0x69b9('0x28')](0xcc)[_0x69b9('0x36')]();});}};}function handleEntityNotFound(_0x3afc8b,_0x2a9b54){return function(_0x44ad13){if(!_0x44ad13){_0x3afc8b[_0x69b9('0x27')](0x194);}return _0x44ad13;};}function handleError(_0x78081a,_0x4038bc){_0x4038bc=_0x4038bc||0x1f4;return function(_0xf34b4e){logger['error'](_0xf34b4e[_0x69b9('0x37')]);if(_0xf34b4e[_0x69b9('0x38')]){delete _0xf34b4e[_0x69b9('0x38')];}_0x78081a[_0x69b9('0x28')](_0x4038bc)[_0x69b9('0x39')](_0xf34b4e);};}exports['index']=function(_0x2aad88,_0x2581f9){var _0x11e650={},_0x5e0058={},_0x19a7d8={'count':0x0,'rows':[]};var _0x50971d=_['map'](db['VoiceContext'][_0x69b9('0x3a')],function(_0x24eae2){return{'name':_0x24eae2['fieldName'],'type':_0x24eae2['type'][_0x69b9('0x3b')]};});_0x5e0058[_0x69b9('0x3c')]=_[_0x69b9('0x3d')](_0x50971d,_0x69b9('0x38'));_0x5e0058[_0x69b9('0x3e')]=_[_0x69b9('0x3f')](_0x2aad88[_0x69b9('0x3e')]);_0x5e0058['filters']=_[_0x69b9('0x40')](_0x5e0058[_0x69b9('0x3c')],_0x5e0058['query']);_0x11e650[_0x69b9('0x41')]=_[_0x69b9('0x40')](_0x5e0058[_0x69b9('0x3c')],qs['fields'](_0x2aad88['query'][_0x69b9('0x42')]));_0x11e650[_0x69b9('0x41')]=_0x11e650[_0x69b9('0x41')]['length']?_0x11e650[_0x69b9('0x41')]:_0x5e0058[_0x69b9('0x3c')];if(!_0x2aad88[_0x69b9('0x3e')]['hasOwnProperty']('nolimit')){_0x11e650['limit']=qs[_0x69b9('0x2c')](_0x2aad88[_0x69b9('0x3e')][_0x69b9('0x2c')]);_0x11e650[_0x69b9('0x2a')]=qs[_0x69b9('0x2a')](_0x2aad88[_0x69b9('0x3e')][_0x69b9('0x2a')]);}_0x11e650[_0x69b9('0x43')]=qs[_0x69b9('0x44')](_0x2aad88[_0x69b9('0x3e')][_0x69b9('0x44')]);_0x11e650[_0x69b9('0x45')]=qs['filters'](_[_0x69b9('0x46')](_0x2aad88[_0x69b9('0x3e')],_0x5e0058[_0x69b9('0x47')]),_0x50971d);if(_0x2aad88[_0x69b9('0x3e')]['filter']){_0x11e650[_0x69b9('0x45')]=_[_0x69b9('0x48')](_0x11e650[_0x69b9('0x45')],{'$or':_[_0x69b9('0x3d')](_0x50971d,function(_0x4d0825){if(_0x4d0825['type']!==_0x69b9('0x49')){var _0x13f350={};_0x13f350[_0x4d0825['name']]={'$like':'%'+_0x2aad88['query'][_0x69b9('0x4a')]+'%'};return _0x13f350;}})});}_0x11e650=_[_0x69b9('0x48')]({},_0x11e650,_0x2aad88[_0x69b9('0x4b')]);var _0x31809b={'where':_0x11e650[_0x69b9('0x45')]};return db[_0x69b9('0x4c')]['count'](_0x31809b)['then'](function(_0x2d9aaf){_0x19a7d8[_0x69b9('0x2d')]=_0x2d9aaf;if(_0x2aad88['query'][_0x69b9('0x4d')]){_0x11e650['include']=[{'all':!![]}];}return db[_0x69b9('0x4c')][_0x69b9('0x4e')](_0x11e650);})[_0x69b9('0x32')](function(_0x54d13b){_0x19a7d8[_0x69b9('0x4f')]=_0x54d13b;return _0x19a7d8;})[_0x69b9('0x32')](respondWithFilteredResult(_0x2581f9,_0x11e650))[_0x69b9('0x50')](handleError(_0x2581f9,null));};exports[_0x69b9('0x51')]=function(_0x52f85f,_0x24e6ae){var _0x4ad047={'raw':![],'where':{'id':_0x52f85f[_0x69b9('0x52')]['id']}},_0x3b065f={};_0x3b065f[_0x69b9('0x3c')]=_[_0x69b9('0x3f')](db[_0x69b9('0x4c')][_0x69b9('0x3a')]);_0x3b065f[_0x69b9('0x3e')]=_[_0x69b9('0x3f')](_0x52f85f[_0x69b9('0x3e')]);_0x3b065f[_0x69b9('0x47')]=_[_0x69b9('0x40')](_0x3b065f[_0x69b9('0x3c')],_0x3b065f[_0x69b9('0x3e')]);_0x4ad047['attributes']=_[_0x69b9('0x40')](_0x3b065f[_0x69b9('0x3c')],qs[_0x69b9('0x42')](_0x52f85f[_0x69b9('0x3e')][_0x69b9('0x42')]));_0x4ad047['attributes']=_0x4ad047[_0x69b9('0x41')][_0x69b9('0x53')]?_0x4ad047[_0x69b9('0x41')]:_0x3b065f['model'];if(_0x52f85f['query'][_0x69b9('0x4d')]){_0x4ad047[_0x69b9('0x54')]=[{'all':!![]}];}_0x4ad047=_[_0x69b9('0x48')]({},_0x4ad047,_0x52f85f[_0x69b9('0x4b')]);return db[_0x69b9('0x4c')][_0x69b9('0x55')](_0x4ad047)[_0x69b9('0x32')](handleEntityNotFound(_0x24e6ae,null))[_0x69b9('0x32')](respondWithResult(_0x24e6ae,null))[_0x69b9('0x50')](handleError(_0x24e6ae,null));};exports[_0x69b9('0x56')]=function(_0x4eece9,_0x47be95,_0x2a4309){var _0x241f96;return db[_0x69b9('0x4c')][_0x69b9('0x56')](_0x4eece9['body'],{'raw':!![]})[_0x69b9('0x32')](function(_0x37bc1a){_0x241f96=_0x37bc1a;return db[_0x69b9('0x4c')][_0x69b9('0x4e')]({'raw':!![]});})['then'](function(_0x38d139){var _0x260a0d=fs[_0x69b9('0x57')](path['join'](config[_0x69b9('0x58')],'server/files/templates/context.ejs'),_0x69b9('0x59'));var _0x2132ba=ejs[_0x69b9('0x5a')](_0x260a0d,{'contexts':_0x38d139||[]});fs['writeFileSync'](_0x69b9('0x5b'),_0x2132ba);})['then'](function(){return respondWithRpcPromise(_0x69b9('0x5c'),_0x69b9('0x56'),{'module':'chan_sip.so'});})[_0x69b9('0x32')](function(){var _0x3dc4c3=_0x4eece9[_0x69b9('0x5d')]['get']({'plain':!![]});if(!_0x3dc4c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3dc4c3[_0x69b9('0x5e')]===_0x69b9('0x5d')){var _0x4c3860=_0x241f96[_0x69b9('0x34')]({'plain':!![]});return db['UserProfileSection'][_0x69b9('0x55')]({'where':{'name':_0x69b9('0x5f'),'userProfileId':_0x3dc4c3['userProfileId']},'raw':!![]})['then'](function(_0x573599){if(_0x573599&&_0x573599['autoAssociation']===0x0){return db[_0x69b9('0x35')][_0x69b9('0x56')]({'name':_0x4c3860['name'],'resourceId':_0x4c3860['id'],'type':_0x573599[_0x69b9('0x38')],'sectionId':_0x573599['id']},{})[_0x69b9('0x32')](function(){return _0x241f96;});}else{return _0x241f96;}})['catch'](function(_0x24b500){logger[_0x69b9('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24b500);throw _0x24b500;});}return _0x241f96;})[_0x69b9('0x32')](respondWithResult(_0x47be95,0xc9))['catch'](handleError(_0x47be95,null));};exports['update']=function(_0x289426,_0x256a51,_0x16816a){var _0x3ab455;return db[_0x69b9('0x4c')][_0x69b9('0x55')]({'where':{'id':_0x289426[_0x69b9('0x52')]['id']}})[_0x69b9('0x32')](handleEntityNotFound(_0x256a51,null))[_0x69b9('0x32')](saveUpdates(_0x289426['body'],null))[_0x69b9('0x32')](function(_0x33ae5c){if(_0x33ae5c){_0x3ab455=_0x33ae5c;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x69b9('0x32')](function(_0x4ae0f8){var _0x191409=fs[_0x69b9('0x57')](path['join'](config[_0x69b9('0x58')],'server/files/templates/context.ejs'),_0x69b9('0x59'));var _0x2cbe57=ejs['render'](_0x191409,{'contexts':_0x4ae0f8||[]});fs[_0x69b9('0x60')](_0x69b9('0x5b'),_0x2cbe57);})[_0x69b9('0x32')](function(){return respondWithRpcPromise(_0x69b9('0x5c'),_0x69b9('0x31'),{'module':_0x69b9('0x61')});})[_0x69b9('0x32')](function(){return _0x3ab455;})[_0x69b9('0x32')](respondWithResult(_0x256a51,null))[_0x69b9('0x50')](handleError(_0x256a51,null));};exports[_0x69b9('0x33')]=function(_0x148f24,_0x401ff9,_0x23b548){var _0x5da443;return db[_0x69b9('0x4c')]['find']({'where':{'id':_0x148f24[_0x69b9('0x52')]['id']}})[_0x69b9('0x32')](handleEntityNotFound(_0x401ff9,null))['then'](removeEntity(_0x401ff9,null))[_0x69b9('0x32')](function(){return db[_0x69b9('0x4c')][_0x69b9('0x4e')]({'raw':!![]});})['then'](function(_0x22ad0d){var _0x260e35=fs[_0x69b9('0x57')](path[_0x69b9('0x62')](config[_0x69b9('0x58')],'server/files/templates/context.ejs'),_0x69b9('0x59'));var _0xbe3a86=ejs[_0x69b9('0x5a')](_0x260e35,{'contexts':_0x22ad0d});fs[_0x69b9('0x60')](_0x69b9('0x5b'),_0xbe3a86);return respondWithRpcPromise(_0x69b9('0x5c'),'destroy',{'module':_0x69b9('0x61')});})[_0x69b9('0x50')](handleError(_0x401ff9,null));}; \ No newline at end of file +var _0x9c97=['UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','utf8','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','Contexts','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','join','root','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c97,0xe2));var _0x79c9=function(_0x44dabd,_0x20336e){_0x44dabd=_0x44dabd-0x0;var _0xd775a9=_0x9c97[_0x44dabd];return _0xd775a9;};'use strict';var emlformat=require(_0x79c9('0x0'));var rimraf=require(_0x79c9('0x1'));var zipdir=require(_0x79c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79c9('0x3'));var moment=require('moment');var BPromise=require(_0x79c9('0x4'));var Mustache=require(_0x79c9('0x5'));var util=require('util');var path=require(_0x79c9('0x6'));var sox=require(_0x79c9('0x7'));var csv=require(_0x79c9('0x8'));var ejs=require(_0x79c9('0x9'));var fs=require('fs');var fs_extra=require(_0x79c9('0xa'));var _=require(_0x79c9('0xb'));var squel=require(_0x79c9('0xc'));var crypto=require(_0x79c9('0xd'));var jsforce=require(_0x79c9('0xe'));var deskjs=require(_0x79c9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x79c9('0x10'));var Papa=require(_0x79c9('0x11'));var Redis=require(_0x79c9('0x12'));var authService=require(_0x79c9('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x79c9('0x14'))(_0x79c9('0x15'));var utils=require(_0x79c9('0x16'));var config=require(_0x79c9('0x17'));var licenseUtil=require(_0x79c9('0x18'));var db=require(_0x79c9('0x19'))['db'];var jayson=require(_0x79c9('0x1a'));var client=jayson[_0x79c9('0x1b')][_0x79c9('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4b2052,_0x5b9c23,_0x551653,_0x53d91f){return new BPromise(function(_0x1e9da9,_0x440ab0){var _0x54986e=_0x53d91f||client;return _0x54986e['request'](_0x4b2052,_0x551653)[_0x79c9('0x1d')](function(_0x3820e4){logger[_0x79c9('0x1e')](_0x79c9('0x1f'),_0x5b9c23,_0x79c9('0x20'));logger[_0x79c9('0x21')](_0x79c9('0x22'),_0x5b9c23,'request\x20sent',JSON[_0x79c9('0x23')](_0x3820e4));if(_0x3820e4['error']){if(_0x3820e4['error'][_0x79c9('0x24')]===0x1f4){logger[_0x79c9('0x25')](_0x79c9('0x1f'),_0x5b9c23,_0x3820e4[_0x79c9('0x25')][_0x79c9('0x26')]);return _0x440ab0(_0x3820e4[_0x79c9('0x25')][_0x79c9('0x26')]);}logger[_0x79c9('0x25')](_0x79c9('0x1f'),_0x5b9c23,_0x3820e4[_0x79c9('0x25')][_0x79c9('0x26')]);return _0x1e9da9(_0x3820e4['error'][_0x79c9('0x26')]);}else{logger[_0x79c9('0x1e')](_0x79c9('0x1f'),_0x5b9c23,_0x79c9('0x20'));_0x1e9da9(_0x3820e4[_0x79c9('0x27')][_0x79c9('0x26')]);}})['catch'](function(_0x11083d){logger[_0x79c9('0x25')]('VoiceContext,\x20%s,\x20%s',_0x5b9c23,_0x11083d);_0x440ab0(_0x11083d);});});}function respondWithStatusCode(_0x10b1b4,_0x5c6dce){_0x5c6dce=_0x5c6dce||0xcc;return function(_0x673356){if(_0x673356){return _0x10b1b4[_0x79c9('0x28')](_0x5c6dce);}return _0x10b1b4['status'](_0x5c6dce)[_0x79c9('0x29')]();};}function respondWithResult(_0x3c9d2b,_0x5deeaf){_0x5deeaf=_0x5deeaf||0xc8;return function(_0x31e189){if(_0x31e189){return _0x3c9d2b[_0x79c9('0x2a')](_0x5deeaf)[_0x79c9('0x2b')](_0x31e189);}};}function respondWithFilteredResult(_0x54d251,_0x527d6b){return function(_0x5569c6){if(_0x5569c6){var _0x5cd62c=typeof _0x527d6b[_0x79c9('0x2c')]===_0x79c9('0x2d')&&typeof _0x527d6b['limit']===_0x79c9('0x2d');var _0x1d6b42=_0x5569c6[_0x79c9('0x2e')];var _0xeeef78=_0x5cd62c?0x0:_0x527d6b['offset'];var _0x5da709=_0x5cd62c?_0x5569c6[_0x79c9('0x2e')]:_0x527d6b[_0x79c9('0x2c')]+_0x527d6b[_0x79c9('0x2f')];var _0x3687bf;if(_0x5da709>=_0x1d6b42){_0x5da709=_0x1d6b42;_0x3687bf=0xc8;}else{_0x3687bf=0xce;}_0x54d251[_0x79c9('0x2a')](_0x3687bf);return _0x54d251[_0x79c9('0x30')](_0x79c9('0x31'),_0xeeef78+'-'+_0x5da709+'/'+_0x1d6b42)[_0x79c9('0x2b')](_0x5569c6);}return null;};}function patchUpdates(_0x11d684){return function(_0xda6e20){try{jsonpatch[_0x79c9('0x32')](_0xda6e20,_0x11d684,!![]);}catch(_0x1ea618){return BPromise[_0x79c9('0x33')](_0x1ea618);}return _0xda6e20[_0x79c9('0x34')]();};}function saveUpdates(_0x269426,_0x21009e){return function(_0x1b9a29){if(_0x1b9a29){return _0x1b9a29['update'](_0x269426)['then'](function(_0x28ba45){return _0x28ba45;});}return null;};}function removeEntity(_0x1b76fe,_0xe76ace){return function(_0x4c2e12){if(_0x4c2e12){return _0x4c2e12[_0x79c9('0x35')]()[_0x79c9('0x1d')](function(){var _0xae2042=_0x4c2e12[_0x79c9('0x36')]({'plain':!![]});var _0x58afea=_0x79c9('0x37');return db['UserProfileResource'][_0x79c9('0x35')]({'where':{'type':_0x58afea,'resourceId':_0xae2042['id']}})[_0x79c9('0x1d')](function(){return _0x4c2e12;});})[_0x79c9('0x1d')](function(){_0x1b76fe[_0x79c9('0x2a')](0xcc)[_0x79c9('0x29')]();});}};}function handleEntityNotFound(_0x3588ea,_0x39e969){return function(_0x1380ad){if(!_0x1380ad){_0x3588ea['sendStatus'](0x194);}return _0x1380ad;};}function handleError(_0x2b6df1,_0x2d5e44){_0x2d5e44=_0x2d5e44||0x1f4;return function(_0xd73246){logger[_0x79c9('0x25')](_0xd73246[_0x79c9('0x38')]);if(_0xd73246[_0x79c9('0x39')]){delete _0xd73246[_0x79c9('0x39')];}_0x2b6df1[_0x79c9('0x2a')](_0x2d5e44)[_0x79c9('0x3a')](_0xd73246);};}exports[_0x79c9('0x3b')]=function(_0x2e5bd0,_0x48ff94){var _0x4cf128={},_0x286ab9={},_0x1cf0cb={'count':0x0,'rows':[]};var _0x1f88b7=_[_0x79c9('0x3c')](db['VoiceContext']['rawAttributes'],function(_0x1fb293){return{'name':_0x1fb293[_0x79c9('0x3d')],'type':_0x1fb293[_0x79c9('0x3e')][_0x79c9('0x3f')]};});_0x286ab9[_0x79c9('0x40')]=_['map'](_0x1f88b7,_0x79c9('0x39'));_0x286ab9['query']=_[_0x79c9('0x41')](_0x2e5bd0[_0x79c9('0x42')]);_0x286ab9[_0x79c9('0x43')]=_[_0x79c9('0x44')](_0x286ab9[_0x79c9('0x40')],_0x286ab9[_0x79c9('0x42')]);_0x4cf128[_0x79c9('0x45')]=_[_0x79c9('0x44')](_0x286ab9[_0x79c9('0x40')],qs[_0x79c9('0x46')](_0x2e5bd0[_0x79c9('0x42')][_0x79c9('0x46')]));_0x4cf128[_0x79c9('0x45')]=_0x4cf128['attributes'][_0x79c9('0x47')]?_0x4cf128[_0x79c9('0x45')]:_0x286ab9[_0x79c9('0x40')];if(!_0x2e5bd0[_0x79c9('0x42')][_0x79c9('0x48')](_0x79c9('0x49'))){_0x4cf128[_0x79c9('0x2f')]=qs['limit'](_0x2e5bd0[_0x79c9('0x42')][_0x79c9('0x2f')]);_0x4cf128[_0x79c9('0x2c')]=qs[_0x79c9('0x2c')](_0x2e5bd0[_0x79c9('0x42')][_0x79c9('0x2c')]);}_0x4cf128['order']=qs[_0x79c9('0x4a')](_0x2e5bd0['query'][_0x79c9('0x4a')]);_0x4cf128[_0x79c9('0x4b')]=qs[_0x79c9('0x43')](_[_0x79c9('0x4c')](_0x2e5bd0[_0x79c9('0x42')],_0x286ab9[_0x79c9('0x43')]),_0x1f88b7);if(_0x2e5bd0[_0x79c9('0x42')][_0x79c9('0x4d')]){_0x4cf128[_0x79c9('0x4b')]=_[_0x79c9('0x4e')](_0x4cf128['where'],{'$or':_['map'](_0x1f88b7,function(_0x60f4b8){if(_0x60f4b8['type']!==_0x79c9('0x4f')){var _0x517eaf={};_0x517eaf[_0x60f4b8[_0x79c9('0x39')]]={'$like':'%'+_0x2e5bd0['query'][_0x79c9('0x4d')]+'%'};return _0x517eaf;}})});}_0x4cf128=_[_0x79c9('0x4e')]({},_0x4cf128,_0x2e5bd0[_0x79c9('0x50')]);var _0x18f7d4={'where':_0x4cf128[_0x79c9('0x4b')]};return db[_0x79c9('0x51')][_0x79c9('0x2e')](_0x18f7d4)['then'](function(_0x484874){_0x1cf0cb['count']=_0x484874;if(_0x2e5bd0[_0x79c9('0x42')][_0x79c9('0x52')]){_0x4cf128[_0x79c9('0x53')]=[{'all':!![]}];}return db[_0x79c9('0x51')][_0x79c9('0x54')](_0x4cf128);})['then'](function(_0x40f001){_0x1cf0cb['rows']=_0x40f001;return _0x1cf0cb;})[_0x79c9('0x1d')](respondWithFilteredResult(_0x48ff94,_0x4cf128))[_0x79c9('0x55')](handleError(_0x48ff94,null));};exports[_0x79c9('0x56')]=function(_0x22d0f9,_0x4e3868){var _0x394a55={'raw':![],'where':{'id':_0x22d0f9[_0x79c9('0x57')]['id']}},_0x1f7ca5={};_0x1f7ca5[_0x79c9('0x40')]=_['keys'](db['VoiceContext'][_0x79c9('0x58')]);_0x1f7ca5['query']=_[_0x79c9('0x41')](_0x22d0f9[_0x79c9('0x42')]);_0x1f7ca5[_0x79c9('0x43')]=_[_0x79c9('0x44')](_0x1f7ca5[_0x79c9('0x40')],_0x1f7ca5[_0x79c9('0x42')]);_0x394a55['attributes']=_[_0x79c9('0x44')](_0x1f7ca5['model'],qs[_0x79c9('0x46')](_0x22d0f9['query'][_0x79c9('0x46')]));_0x394a55[_0x79c9('0x45')]=_0x394a55['attributes'][_0x79c9('0x47')]?_0x394a55['attributes']:_0x1f7ca5[_0x79c9('0x40')];if(_0x22d0f9[_0x79c9('0x42')][_0x79c9('0x52')]){_0x394a55[_0x79c9('0x53')]=[{'all':!![]}];}_0x394a55=_['merge']({},_0x394a55,_0x22d0f9[_0x79c9('0x50')]);return db['VoiceContext'][_0x79c9('0x59')](_0x394a55)[_0x79c9('0x1d')](handleEntityNotFound(_0x4e3868,null))[_0x79c9('0x1d')](respondWithResult(_0x4e3868,null))[_0x79c9('0x55')](handleError(_0x4e3868,null));};exports[_0x79c9('0x5a')]=function(_0x5bb4ce,_0x2e9523,_0x493579){var _0x27157c;return db[_0x79c9('0x51')][_0x79c9('0x5a')](_0x5bb4ce[_0x79c9('0x5b')],{'raw':!![]})[_0x79c9('0x1d')](function(_0x2a48e0){_0x27157c=_0x2a48e0;return db['VoiceContext'][_0x79c9('0x54')]({'raw':!![]});})['then'](function(_0x486c3b){var _0x21514a=fs['readFileSync'](path[_0x79c9('0x5c')](config[_0x79c9('0x5d')],'server/files/templates/context.ejs'),'utf8');var _0x32bf54=ejs[_0x79c9('0x5e')](_0x21514a,{'contexts':_0x486c3b||[]});fs[_0x79c9('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x32bf54);})[_0x79c9('0x1d')](function(){return respondWithRpcPromise(_0x79c9('0x60'),_0x79c9('0x5a'),{'module':_0x79c9('0x61')});})['then'](function(){var _0x56437f=_0x5bb4ce[_0x79c9('0x62')]['get']({'plain':!![]});if(!_0x56437f)throw new Error(_0x79c9('0x63'));if(_0x56437f[_0x79c9('0x64')]==='user'){var _0x3a9ed6=_0x27157c['get']({'plain':!![]});return db[_0x79c9('0x65')][_0x79c9('0x59')]({'where':{'name':'Contexts','userProfileId':_0x56437f[_0x79c9('0x66')]},'raw':!![]})[_0x79c9('0x1d')](function(_0x51a67d){if(_0x51a67d&&_0x51a67d[_0x79c9('0x67')]===0x0){return db[_0x79c9('0x68')][_0x79c9('0x5a')]({'name':_0x3a9ed6[_0x79c9('0x39')],'resourceId':_0x3a9ed6['id'],'type':_0x51a67d['name'],'sectionId':_0x51a67d['id']},{})[_0x79c9('0x1d')](function(){return _0x27157c;});}else{return _0x27157c;}})[_0x79c9('0x55')](function(_0x4fc847){logger['error'](_0x79c9('0x69'),_0x4fc847);throw _0x4fc847;});}return _0x27157c;})[_0x79c9('0x1d')](respondWithResult(_0x2e9523,0xc9))[_0x79c9('0x55')](handleError(_0x2e9523,null));};exports[_0x79c9('0x6a')]=function(_0x36f6e7,_0x1e5f87,_0x59ae35){var _0x13b755;return db['VoiceContext'][_0x79c9('0x59')]({'where':{'id':_0x36f6e7[_0x79c9('0x57')]['id']}})[_0x79c9('0x1d')](handleEntityNotFound(_0x1e5f87,null))[_0x79c9('0x1d')](saveUpdates(_0x36f6e7[_0x79c9('0x5b')],null))[_0x79c9('0x1d')](function(_0x4f1510){if(_0x4f1510){_0x13b755=_0x4f1510;return db['VoiceContext'][_0x79c9('0x54')]({'raw':!![]});}})[_0x79c9('0x1d')](function(_0x401e7f){var _0x732f44=fs['readFileSync'](path[_0x79c9('0x5c')](config[_0x79c9('0x5d')],'server/files/templates/context.ejs'),_0x79c9('0x6b'));var _0x3ec9cb=ejs[_0x79c9('0x5e')](_0x732f44,{'contexts':_0x401e7f||[]});fs[_0x79c9('0x5f')](_0x79c9('0x6c'),_0x3ec9cb);})[_0x79c9('0x1d')](function(){return respondWithRpcPromise(_0x79c9('0x60'),_0x79c9('0x6a'),{'module':_0x79c9('0x61')});})[_0x79c9('0x1d')](function(){return _0x13b755;})[_0x79c9('0x1d')](respondWithResult(_0x1e5f87,null))['catch'](handleError(_0x1e5f87,null));};exports[_0x79c9('0x35')]=function(_0x1b14bc,_0x281b10,_0x2f635b){var _0x1c5c30;return db[_0x79c9('0x51')]['find']({'where':{'id':_0x1b14bc[_0x79c9('0x57')]['id']}})[_0x79c9('0x1d')](handleEntityNotFound(_0x281b10,null))[_0x79c9('0x1d')](removeEntity(_0x281b10,null))[_0x79c9('0x1d')](function(){return db[_0x79c9('0x51')]['findAll']({'raw':!![]});})['then'](function(_0xa1ceed){var _0x1cb3f1=fs['readFileSync'](path[_0x79c9('0x5c')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0xa3fdb4=ejs[_0x79c9('0x5e')](_0x1cb3f1,{'contexts':_0xa1ceed});fs[_0x79c9('0x5f')](_0x79c9('0x6c'),_0xa3fdb4);return respondWithRpcPromise('Reload','destroy',{'module':_0x79c9('0x61')});})[_0x79c9('0x55')](handleError(_0x281b10,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index a063d81..6aae00b 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 _0xc0e3=['exports','define','voice_contexts','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes'];(function(_0x5c0946,_0x275bcf){var _0x470654=function(_0x1d80da){while(--_0x1d80da){_0x5c0946['push'](_0x5c0946['shift']());}};_0x470654(++_0x275bcf);}(_0xc0e3,0x1a5));var _0x3c0e=function(_0x2484c6,_0x17dbbd){_0x2484c6=_0x2484c6-0x0;var _0x3d09a6=_0xc0e3[_0x2484c6];return _0x3d09a6;};'use strict';var _=require(_0x3c0e('0x0'));var util=require('util');var logger=require(_0x3c0e('0x1'))(_0x3c0e('0x2'));var moment=require('moment');var BPromise=require(_0x3c0e('0x3'));var rp=require(_0x3c0e('0x4'));var fs=require('fs');var path=require(_0x3c0e('0x5'));var rimraf=require('rimraf');var config=require(_0x3c0e('0x6'));var attributes=require(_0x3c0e('0x7'));module[_0x3c0e('0x8')]=function(_0x390af4,_0xdaf45a){return _0x390af4[_0x3c0e('0x9')]('VoiceContext',attributes,{'tableName':_0x3c0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97e7=['voice_contexts','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./voiceContext.attributes','define','VoiceContext'];(function(_0x596c43,_0x28647a){var _0x4e1315=function(_0x58e910){while(--_0x58e910){_0x596c43['push'](_0x596c43['shift']());}};_0x4e1315(++_0x28647a);}(_0x97e7,0x7a));var _0x797e=function(_0x417ce5,_0x5f1a50){_0x417ce5=_0x417ce5-0x0;var _0x316364=_0x97e7[_0x417ce5];return _0x316364;};'use strict';var _=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var logger=require('../../config/logger')(_0x797e('0x2'));var moment=require(_0x797e('0x3'));var BPromise=require(_0x797e('0x4'));var rp=require(_0x797e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x797e('0x6'));var attributes=require(_0x797e('0x7'));module['exports']=function(_0x2c2a04,_0x5f072a){return _0x2c2a04[_0x797e('0x8')](_0x797e('0x9'),attributes,{'tableName':_0x797e('0xa'),'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 0692680..8367795 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 _0xd004=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','request','then','VoiceContext,\x20%s,\x20%s','debug'];(function(_0x16ba74,_0x2ebcfa){var _0x4333a6=function(_0x13b137){while(--_0x13b137){_0x16ba74['push'](_0x16ba74['shift']());}};_0x4333a6(++_0x2ebcfa);}(_0xd004,0x181));var _0x4d00=function(_0x483f52,_0x8466d7){_0x483f52=_0x483f52-0x0;var _0x1b9605=_0xd004[_0x483f52];return _0x1b9605;};'use strict';var _=require(_0x4d00('0x0'));var util=require(_0x4d00('0x1'));var moment=require(_0x4d00('0x2'));var BPromise=require(_0x4d00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d00('0x4'))['db'];var utils=require(_0x4d00('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4d00('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6e8800,_0x53a41a,_0x4ec37a){return new BPromise(function(_0x173f0e,_0x56219c){return client[_0x4d00('0x7')](_0x6e8800,_0x4ec37a)[_0x4d00('0x8')](function(_0x1ab779){logger['info'](_0x4d00('0x9'),_0x53a41a,'request\x20sent');logger[_0x4d00('0xa')](_0x4d00('0xb'),_0x53a41a,'request\x20sent',JSON[_0x4d00('0xc')](_0x1ab779));if(_0x1ab779[_0x4d00('0xd')]){if(_0x1ab779[_0x4d00('0xd')]['code']===0x1f4){logger['error'](_0x4d00('0x9'),_0x53a41a,_0x1ab779[_0x4d00('0xd')][_0x4d00('0xe')]);return _0x56219c(_0x1ab779[_0x4d00('0xd')]['message']);}logger[_0x4d00('0xd')](_0x4d00('0x9'),_0x53a41a,_0x1ab779['error']['message']);return _0x173f0e(_0x1ab779['error'][_0x4d00('0xe')]);}else{logger[_0x4d00('0xf')](_0x4d00('0x9'),_0x53a41a,'request\x20sent');_0x173f0e(_0x1ab779[_0x4d00('0x10')][_0x4d00('0xe')]);}})[_0x4d00('0x11')](function(_0x3454e0){logger[_0x4d00('0xd')](_0x4d00('0x9'),_0x53a41a,_0x3454e0);_0x56219c(_0x3454e0);});});} \ No newline at end of file +var _0x2ea1=['message','VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error'];(function(_0x150305,_0x3d5fdd){var _0x46e596=function(_0x4d39fc){while(--_0x4d39fc){_0x150305['push'](_0x150305['shift']());}};_0x46e596(++_0x3d5fdd);}(_0x2ea1,0xca));var _0x12ea=function(_0x398076,_0x3f8f3b){_0x398076=_0x398076-0x0;var _0x246eb5=_0x2ea1[_0x398076];return _0x246eb5;};'use strict';var _=require(_0x12ea('0x0'));var util=require(_0x12ea('0x1'));var moment=require(_0x12ea('0x2'));var BPromise=require(_0x12ea('0x3'));var rs=require(_0x12ea('0x4'));var fs=require('fs');var Redis=require(_0x12ea('0x5'));var db=require(_0x12ea('0x6'))['db'];var utils=require(_0x12ea('0x7'));var logger=require('../../config/logger')(_0x12ea('0x8'));var config=require(_0x12ea('0x9'));var jayson=require(_0x12ea('0xa'));var client=jayson['client'][_0x12ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x242d90,_0x46885c,_0x18108b){return new BPromise(function(_0x3d83e1,_0xacc885){return client[_0x12ea('0xc')](_0x242d90,_0x18108b)['then'](function(_0x5984f7){logger[_0x12ea('0xd')]('VoiceContext,\x20%s,\x20%s',_0x46885c,_0x12ea('0xe'));logger[_0x12ea('0xf')](_0x12ea('0x10'),_0x46885c,_0x12ea('0xe'),JSON['stringify'](_0x5984f7));if(_0x5984f7[_0x12ea('0x11')]){if(_0x5984f7[_0x12ea('0x11')]['code']===0x1f4){logger[_0x12ea('0x11')]('VoiceContext,\x20%s,\x20%s',_0x46885c,_0x5984f7['error'][_0x12ea('0x12')]);return _0xacc885(_0x5984f7[_0x12ea('0x11')][_0x12ea('0x12')]);}logger[_0x12ea('0x11')](_0x12ea('0x13'),_0x46885c,_0x5984f7[_0x12ea('0x11')][_0x12ea('0x12')]);return _0x3d83e1(_0x5984f7[_0x12ea('0x11')]['message']);}else{logger[_0x12ea('0xd')](_0x12ea('0x13'),_0x46885c,_0x12ea('0xe'));_0x3d83e1(_0x5984f7[_0x12ea('0x14')]['message']);}})[_0x12ea('0x15')](function(_0x4d8c57){logger[_0x12ea('0x11')](_0x12ea('0x13'),_0x46885c,_0x4d8c57);_0xacc885(_0x4d8c57);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 55410f1..33aa618 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 _0x2739=['get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller'];(function(_0x5e33f6,_0x2e18e6){var _0x20cb0f=function(_0x358e5c){while(--_0x358e5c){_0x5e33f6['push'](_0x5e33f6['shift']());}};_0x20cb0f(++_0x2e18e6);}(_0x2739,0x14e));var _0x9273=function(_0x310520,_0x5d4639){_0x310520=_0x310520-0x0;var _0x2cccbb=_0x2739[_0x310520];return _0x2cccbb;};'use strict';var multer=require('multer');var util=require(_0x9273('0x0'));var path=require(_0x9273('0x1'));var timeout=require(_0x9273('0x2'));var express=require(_0x9273('0x3'));var router=express[_0x9273('0x4')]();var fs_extra=require(_0x9273('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9273('0x6'));var config=require('../../config/environment');var controller=require(_0x9273('0x7'));router[_0x9273('0x8')]('/',auth[_0x9273('0x9')](),controller[_0x9273('0xa')]);router['get'](_0x9273('0xb'),auth[_0x9273('0x9')](),controller['describe']);router['get'](_0x9273('0xc'),auth[_0x9273('0x9')](),controller[_0x9273('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9273('0xe')]);router[_0x9273('0xf')](_0x9273('0xc'),auth['isAuthenticated'](),controller[_0x9273('0x10')]);router[_0x9273('0x11')](_0x9273('0xc'),auth[_0x9273('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2f76=['create','put','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1f52bf,_0x1025bd){var _0x4d2f86=function(_0xdb421c){while(--_0xdb421c){_0x1f52bf['push'](_0x1f52bf['shift']());}};_0x4d2f86(++_0x1025bd);}(_0x2f76,0x1a5));var _0x62f7=function(_0x11e1da,_0x18c9e1){_0x11e1da=_0x11e1da-0x0;var _0xadd92d=_0x2f76[_0x11e1da];return _0xadd92d;};'use strict';var multer=require(_0x62f7('0x0'));var util=require(_0x62f7('0x1'));var path=require(_0x62f7('0x2'));var timeout=require(_0x62f7('0x3'));var express=require(_0x62f7('0x4'));var router=express[_0x62f7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x62f7('0x6'));var interaction=require(_0x62f7('0x7'));var config=require('../../config/environment');var controller=require(_0x62f7('0x8'));router[_0x62f7('0x9')]('/',auth[_0x62f7('0xa')](),controller[_0x62f7('0xb')]);router['get'](_0x62f7('0xc'),auth['isAuthenticated'](),controller[_0x62f7('0xd')]);router[_0x62f7('0x9')](_0x62f7('0xe'),auth[_0x62f7('0xa')](),controller[_0x62f7('0xf')]);router['post']('/',auth[_0x62f7('0xa')](),controller[_0x62f7('0x10')]);router[_0x62f7('0x11')](_0x62f7('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x62f7('0xe'),auth[_0x62f7('0xa')](),controller[_0x62f7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index aca111e..76ea464 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 _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x33b9d7,_0x3c6be2){var _0x96ed5c=function(_0x2f3f2d){while(--_0x2f3f2d){_0x33b9d7['push'](_0x33b9d7['shift']());}};_0x96ed5c(++_0x3c6be2);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file +var _0x6f0d=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x3438b5,_0x5383ae){var _0x4b034e=function(_0x3e5772){while(--_0x3e5772){_0x3438b5['push'](_0x3438b5['shift']());}};_0x4b034e(++_0x5383ae);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x9673fc,_0x5e44b6){_0x9673fc=_0x9673fc-0x0;var _0x2379a4=_0x6f0d[_0x9673fc];return _0x2379a4;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'privilege':{'type':Sequelize[_0xd6f0('0x1')]},'channel':{'type':Sequelize[_0xd6f0('0x1')]},'channelstate':{'type':Sequelize[_0xd6f0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'calleridname':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'language':{'type':Sequelize[_0xd6f0('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd6f0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd6f0('0x2')]},'uniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'linkedid':{'type':Sequelize[_0xd6f0('0x1')]},'destchannel':{'type':Sequelize[_0xd6f0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'destcalleridname':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'destlanguage':{'type':Sequelize[_0xd6f0('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd6f0('0x1')]},'destexten':{'type':Sequelize[_0xd6f0('0x1')]},'destpriority':{'type':Sequelize[_0xd6f0('0x2')]},'destuniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xd6f0('0x1')]},'dialstatus':{'type':Sequelize[_0xd6f0('0x1')]},'starttime':{'type':Sequelize[_0xd6f0('0x3')]},'answertime':{'type':Sequelize[_0xd6f0('0x3')]},'endtime':{'type':Sequelize[_0xd6f0('0x3')]},'lastevent':{'type':Sequelize[_0xd6f0('0x1')],'comment':_0xd6f0('0x4')},'routeId':{'type':Sequelize[_0xd6f0('0x2')]},'duration':{'type':Sequelize[_0xd6f0('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd6f0('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ad1d602..b9074a9 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 _0x4613=['path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','json','limit','undefined','count','offset','status','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceDialReport','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','includeAll','include','findAll','params','rawAttributes','fields','options','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1b2e49,_0x199102){var _0x24c61b=function(_0x4b10f9){while(--_0x4b10f9){_0x1b2e49['push'](_0x1b2e49['shift']());}};_0x24c61b(++_0x199102);}(_0x4613,0x1eb));var _0x3461=function(_0xe9d467,_0x10df12){_0xe9d467=_0xe9d467-0x0;var _0x1163fd=_0x4613[_0xe9d467];return _0x1163fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3461('0x0'));var zipdir=require(_0x3461('0x1'));var jsonpatch=require(_0x3461('0x2'));var rp=require(_0x3461('0x3'));var moment=require(_0x3461('0x4'));var BPromise=require(_0x3461('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3461('0x6'));var sox=require(_0x3461('0x7'));var csv=require(_0x3461('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3461('0x9'));var _=require(_0x3461('0xa'));var squel=require(_0x3461('0xb'));var crypto=require('crypto');var jsforce=require(_0x3461('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3461('0x8'));var querystring=require(_0x3461('0xd'));var Papa=require(_0x3461('0xe'));var Redis=require(_0x3461('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3461('0x10'));var as=require(_0x3461('0x11'));var hardwareService=require(_0x3461('0x12'));var logger=require('../../config/logger')(_0x3461('0x13'));var utils=require('../../config/utils');var config=require(_0x3461('0x14'));var licenseUtil=require(_0x3461('0x15'));var db=require(_0x3461('0x16'))['db'];function respondWithStatusCode(_0x523533,_0x20a35f){_0x20a35f=_0x20a35f||0xcc;return function(_0x250f53){if(_0x250f53){return _0x523533['sendStatus'](_0x20a35f);}return _0x523533['status'](_0x20a35f)['end']();};}function respondWithResult(_0x5f7345,_0x360b27){_0x360b27=_0x360b27||0xc8;return function(_0x226a9c){if(_0x226a9c){return _0x5f7345['status'](_0x360b27)[_0x3461('0x17')](_0x226a9c);}};}function respondWithFilteredResult(_0x2abef9,_0x250a2a){return function(_0x2eac81){if(_0x2eac81){var _0x4eedfc=typeof _0x250a2a['offset']==='undefined'&&typeof _0x250a2a[_0x3461('0x18')]===_0x3461('0x19');var _0x4ee279=_0x2eac81[_0x3461('0x1a')];var _0x2da3eb=_0x4eedfc?0x0:_0x250a2a[_0x3461('0x1b')];var _0x380c80=_0x4eedfc?_0x2eac81[_0x3461('0x1a')]:_0x250a2a['offset']+_0x250a2a[_0x3461('0x18')];var _0x6e2085;if(_0x380c80>=_0x4ee279){_0x380c80=_0x4ee279;_0x6e2085=0xc8;}else{_0x6e2085=0xce;}_0x2abef9[_0x3461('0x1c')](_0x6e2085);return _0x2abef9['set']('Content-Range',_0x2da3eb+'-'+_0x380c80+'/'+_0x4ee279)[_0x3461('0x17')](_0x2eac81);}return null;};}function patchUpdates(_0x436277){return function(_0x50506b){try{jsonpatch[_0x3461('0x1d')](_0x50506b,_0x436277,!![]);}catch(_0x26610e){return BPromise['reject'](_0x26610e);}return _0x50506b[_0x3461('0x1e')]();};}function saveUpdates(_0x5685e8,_0x4f7897){return function(_0x531a29){if(_0x531a29){return _0x531a29[_0x3461('0x1f')](_0x5685e8)[_0x3461('0x20')](function(_0x18013b){return _0x18013b;});}return null;};}function removeEntity(_0x174852,_0x9d97ca){return function(_0x1d2a03){if(_0x1d2a03){return _0x1d2a03[_0x3461('0x21')]()[_0x3461('0x20')](function(){_0x174852[_0x3461('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3761d3,_0x41a5f5){return function(_0x1088ac){if(!_0x1088ac){_0x3761d3[_0x3461('0x22')](0x194);}return _0x1088ac;};}function handleError(_0x1de970,_0x4d2fb9){_0x4d2fb9=_0x4d2fb9||0x1f4;return function(_0x21601b){logger[_0x3461('0x23')](_0x21601b[_0x3461('0x24')]);if(_0x21601b[_0x3461('0x25')]){delete _0x21601b[_0x3461('0x25')];}_0x1de970['status'](_0x4d2fb9)['send'](_0x21601b);};}exports[_0x3461('0x26')]=function(_0x31b9a7,_0x429fa3){var _0x110e14={},_0x4aa8b8={},_0x2d22e7={'count':0x0,'rows':[]};var _0x5ede8c=_[_0x3461('0x27')](db[_0x3461('0x28')]['rawAttributes'],function(_0x89a2f2){return{'name':_0x89a2f2['fieldName'],'type':_0x89a2f2['type'][_0x3461('0x29')]};});_0x4aa8b8[_0x3461('0x2a')]=_[_0x3461('0x27')](_0x5ede8c,'name');_0x4aa8b8[_0x3461('0x2b')]=_[_0x3461('0x2c')](_0x31b9a7['query']);_0x4aa8b8[_0x3461('0x2d')]=_[_0x3461('0x2e')](_0x4aa8b8['model'],_0x4aa8b8[_0x3461('0x2b')]);_0x110e14[_0x3461('0x2f')]=_[_0x3461('0x2e')](_0x4aa8b8[_0x3461('0x2a')],qs['fields'](_0x31b9a7[_0x3461('0x2b')]['fields']));_0x110e14['attributes']=_0x110e14['attributes'][_0x3461('0x30')]?_0x110e14[_0x3461('0x2f')]:_0x4aa8b8['model'];if(!_0x31b9a7[_0x3461('0x2b')][_0x3461('0x31')](_0x3461('0x32'))){_0x110e14[_0x3461('0x18')]=qs[_0x3461('0x18')](_0x31b9a7['query']['limit']);_0x110e14[_0x3461('0x1b')]=qs['offset'](_0x31b9a7[_0x3461('0x2b')][_0x3461('0x1b')]);}_0x110e14[_0x3461('0x33')]=qs['sort'](_0x31b9a7[_0x3461('0x2b')][_0x3461('0x34')]);_0x110e14['where']=qs[_0x3461('0x2d')](_[_0x3461('0x35')](_0x31b9a7[_0x3461('0x2b')],_0x4aa8b8['filters']),_0x5ede8c);if(_0x31b9a7[_0x3461('0x2b')]['filter']){_0x110e14['where']=_[_0x3461('0x36')](_0x110e14[_0x3461('0x37')],{'$or':_[_0x3461('0x27')](_0x5ede8c,function(_0x385a3d){if(_0x385a3d[_0x3461('0x38')]!==_0x3461('0x39')){var _0x90217f={};_0x90217f[_0x385a3d['name']]={'$like':'%'+_0x31b9a7['query'][_0x3461('0x3a')]+'%'};return _0x90217f;}})});}_0x110e14=_[_0x3461('0x36')]({},_0x110e14,_0x31b9a7['options']);var _0x32f798={'where':_0x110e14[_0x3461('0x37')]};return db['VoiceDialReport'][_0x3461('0x1a')](_0x32f798)['then'](function(_0x20597e){_0x2d22e7[_0x3461('0x1a')]=_0x20597e;if(_0x31b9a7['query'][_0x3461('0x3b')]){_0x110e14[_0x3461('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x3461('0x3d')](_0x110e14);})[_0x3461('0x20')](function(_0x3480a1){_0x2d22e7['rows']=_0x3480a1;return _0x2d22e7;})['then'](respondWithFilteredResult(_0x429fa3,_0x110e14))['catch'](handleError(_0x429fa3,null));};exports['show']=function(_0xbca89c,_0x35c4fb){var _0xdb0acf={'raw':!![],'where':{'id':_0xbca89c[_0x3461('0x3e')]['id']}},_0x14f941={};_0x14f941[_0x3461('0x2a')]=_[_0x3461('0x2c')](db['VoiceDialReport'][_0x3461('0x3f')]);_0x14f941[_0x3461('0x2b')]=_[_0x3461('0x2c')](_0xbca89c[_0x3461('0x2b')]);_0x14f941[_0x3461('0x2d')]=_[_0x3461('0x2e')](_0x14f941[_0x3461('0x2a')],_0x14f941[_0x3461('0x2b')]);_0xdb0acf[_0x3461('0x2f')]=_[_0x3461('0x2e')](_0x14f941['model'],qs[_0x3461('0x40')](_0xbca89c['query'][_0x3461('0x40')]));_0xdb0acf[_0x3461('0x2f')]=_0xdb0acf[_0x3461('0x2f')][_0x3461('0x30')]?_0xdb0acf[_0x3461('0x2f')]:_0x14f941[_0x3461('0x2a')];if(_0xbca89c[_0x3461('0x2b')][_0x3461('0x3b')]){_0xdb0acf[_0x3461('0x3c')]=[{'all':!![]}];}_0xdb0acf=_[_0x3461('0x36')]({},_0xdb0acf,_0xbca89c[_0x3461('0x41')]);return db[_0x3461('0x28')][_0x3461('0x42')](_0xdb0acf)[_0x3461('0x20')](handleEntityNotFound(_0x35c4fb,null))[_0x3461('0x20')](respondWithResult(_0x35c4fb,null))['catch'](handleError(_0x35c4fb,null));};exports[_0x3461('0x43')]=function(_0x368d23,_0x9467c4){return db[_0x3461('0x28')][_0x3461('0x43')](_0x368d23[_0x3461('0x44')],{})[_0x3461('0x20')](respondWithResult(_0x9467c4,0xc9))[_0x3461('0x45')](handleError(_0x9467c4,null));};exports[_0x3461('0x1f')]=function(_0x362237,_0x14cd09){if(_0x362237[_0x3461('0x44')]['id']){delete _0x362237['body']['id'];}return db[_0x3461('0x28')][_0x3461('0x42')]({'where':{'id':_0x362237[_0x3461('0x3e')]['id']}})[_0x3461('0x20')](handleEntityNotFound(_0x14cd09,null))[_0x3461('0x20')](saveUpdates(_0x362237[_0x3461('0x44')],null))[_0x3461('0x20')](respondWithResult(_0x14cd09,null))['catch'](handleError(_0x14cd09,null));};exports['destroy']=function(_0x412ef9,_0x20ed1d){return db[_0x3461('0x28')][_0x3461('0x42')]({'where':{'id':_0x412ef9[_0x3461('0x3e')]['id']}})[_0x3461('0x20')](handleEntityNotFound(_0x20ed1d,null))['then'](removeEntity(_0x20ed1d,null))['catch'](handleError(_0x20ed1d,null));};exports['describe']=function(_0x4fb2e5,_0x2658fa){return db[_0x3461('0x28')][_0x3461('0x46')]()[_0x3461('0x20')](respondWithResult(_0x2658fa,null))['catch'](handleError(_0x2658fa,null));}; \ No newline at end of file +var _0xd800=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','eml-format'];(function(_0x5f33b7,_0x2de773){var _0x45ad80=function(_0x463bd0){while(--_0x463bd0){_0x5f33b7['push'](_0x5f33b7['shift']());}};_0x45ad80(++_0x2de773);}(_0xd800,0x12b));var _0x0d80=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xd800[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x0d80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d80('0x1'));var jsonpatch=require(_0x0d80('0x2'));var rp=require(_0x0d80('0x3'));var moment=require(_0x0d80('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0d80('0x5'));var util=require(_0x0d80('0x6'));var path=require(_0x0d80('0x7'));var sox=require('sox');var csv=require(_0x0d80('0x8'));var ejs=require(_0x0d80('0x9'));var fs=require('fs');var fs_extra=require(_0x0d80('0xa'));var _=require(_0x0d80('0xb'));var squel=require(_0x0d80('0xc'));var crypto=require(_0x0d80('0xd'));var jsforce=require(_0x0d80('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0d80('0x8'));var querystring=require(_0x0d80('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0d80('0x10'));var qs=require(_0x0d80('0x11'));var as=require(_0x0d80('0x12'));var hardwareService=require(_0x0d80('0x13'));var logger=require(_0x0d80('0x14'))('api');var utils=require(_0x0d80('0x15'));var config=require(_0x0d80('0x16'));var licenseUtil=require(_0x0d80('0x17'));var db=require(_0x0d80('0x18'))['db'];function respondWithStatusCode(_0x324010,_0x57ec7c){_0x57ec7c=_0x57ec7c||0xcc;return function(_0x3e7340){if(_0x3e7340){return _0x324010[_0x0d80('0x19')](_0x57ec7c);}return _0x324010[_0x0d80('0x1a')](_0x57ec7c)[_0x0d80('0x1b')]();};}function respondWithResult(_0xd2b391,_0x42313b){_0x42313b=_0x42313b||0xc8;return function(_0x4aaff3){if(_0x4aaff3){return _0xd2b391[_0x0d80('0x1a')](_0x42313b)[_0x0d80('0x1c')](_0x4aaff3);}};}function respondWithFilteredResult(_0x15cd2e,_0x214c7d){return function(_0x102132){if(_0x102132){var _0x293006=typeof _0x214c7d[_0x0d80('0x1d')]===_0x0d80('0x1e')&&typeof _0x214c7d['limit']===_0x0d80('0x1e');var _0x1b6750=_0x102132[_0x0d80('0x1f')];var _0x356aa0=_0x293006?0x0:_0x214c7d[_0x0d80('0x1d')];var _0x5279cb=_0x293006?_0x102132[_0x0d80('0x1f')]:_0x214c7d[_0x0d80('0x1d')]+_0x214c7d[_0x0d80('0x20')];var _0x52642e;if(_0x5279cb>=_0x1b6750){_0x5279cb=_0x1b6750;_0x52642e=0xc8;}else{_0x52642e=0xce;}_0x15cd2e[_0x0d80('0x1a')](_0x52642e);return _0x15cd2e[_0x0d80('0x21')](_0x0d80('0x22'),_0x356aa0+'-'+_0x5279cb+'/'+_0x1b6750)['json'](_0x102132);}return null;};}function patchUpdates(_0xeaca0d){return function(_0x59bb58){try{jsonpatch[_0x0d80('0x23')](_0x59bb58,_0xeaca0d,!![]);}catch(_0x442ae2){return BPromise[_0x0d80('0x24')](_0x442ae2);}return _0x59bb58[_0x0d80('0x25')]();};}function saveUpdates(_0x3d2188,_0x161bd8){return function(_0x882b8b){if(_0x882b8b){return _0x882b8b[_0x0d80('0x26')](_0x3d2188)[_0x0d80('0x27')](function(_0x4821e8){return _0x4821e8;});}return null;};}function removeEntity(_0x59d7f1,_0x449a3e){return function(_0x2126f7){if(_0x2126f7){return _0x2126f7['destroy']()[_0x0d80('0x27')](function(){_0x59d7f1['status'](0xcc)[_0x0d80('0x1b')]();});}};}function handleEntityNotFound(_0xdfb27,_0x27ac6b){return function(_0x549c9b){if(!_0x549c9b){_0xdfb27[_0x0d80('0x19')](0x194);}return _0x549c9b;};}function handleError(_0x17b1cc,_0x43fb98){_0x43fb98=_0x43fb98||0x1f4;return function(_0xe750a7){logger[_0x0d80('0x28')](_0xe750a7[_0x0d80('0x29')]);if(_0xe750a7['name']){delete _0xe750a7['name'];}_0x17b1cc[_0x0d80('0x1a')](_0x43fb98)[_0x0d80('0x2a')](_0xe750a7);};}exports[_0x0d80('0x2b')]=function(_0x4062e0,_0x36339f){var _0x558884={},_0x5bb6ca={},_0x4e9938={'count':0x0,'rows':[]};var _0x44dc5d=_[_0x0d80('0x2c')](db[_0x0d80('0x2d')][_0x0d80('0x2e')],function(_0x2c4b57){return{'name':_0x2c4b57[_0x0d80('0x2f')],'type':_0x2c4b57[_0x0d80('0x30')]['key']};});_0x5bb6ca[_0x0d80('0x31')]=_['map'](_0x44dc5d,'name');_0x5bb6ca[_0x0d80('0x32')]=_['keys'](_0x4062e0[_0x0d80('0x32')]);_0x5bb6ca[_0x0d80('0x33')]=_[_0x0d80('0x34')](_0x5bb6ca[_0x0d80('0x31')],_0x5bb6ca[_0x0d80('0x32')]);_0x558884[_0x0d80('0x35')]=_[_0x0d80('0x34')](_0x5bb6ca['model'],qs['fields'](_0x4062e0[_0x0d80('0x32')][_0x0d80('0x36')]));_0x558884[_0x0d80('0x35')]=_0x558884[_0x0d80('0x35')][_0x0d80('0x37')]?_0x558884[_0x0d80('0x35')]:_0x5bb6ca[_0x0d80('0x31')];if(!_0x4062e0['query'][_0x0d80('0x38')](_0x0d80('0x39'))){_0x558884[_0x0d80('0x20')]=qs[_0x0d80('0x20')](_0x4062e0[_0x0d80('0x32')][_0x0d80('0x20')]);_0x558884[_0x0d80('0x1d')]=qs[_0x0d80('0x1d')](_0x4062e0[_0x0d80('0x32')][_0x0d80('0x1d')]);}_0x558884[_0x0d80('0x3a')]=qs[_0x0d80('0x3b')](_0x4062e0[_0x0d80('0x32')][_0x0d80('0x3b')]);_0x558884[_0x0d80('0x3c')]=qs[_0x0d80('0x33')](_[_0x0d80('0x3d')](_0x4062e0[_0x0d80('0x32')],_0x5bb6ca[_0x0d80('0x33')]),_0x44dc5d);if(_0x4062e0[_0x0d80('0x32')][_0x0d80('0x3e')]){_0x558884[_0x0d80('0x3c')]=_[_0x0d80('0x3f')](_0x558884[_0x0d80('0x3c')],{'$or':_['map'](_0x44dc5d,function(_0x2d4c6f){if(_0x2d4c6f['type']!=='VIRTUAL'){var _0x6551d1={};_0x6551d1[_0x2d4c6f['name']]={'$like':'%'+_0x4062e0[_0x0d80('0x32')][_0x0d80('0x3e')]+'%'};return _0x6551d1;}})});}_0x558884=_[_0x0d80('0x3f')]({},_0x558884,_0x4062e0['options']);var _0x3c6e85={'where':_0x558884[_0x0d80('0x3c')]};return db['VoiceDialReport'][_0x0d80('0x1f')](_0x3c6e85)[_0x0d80('0x27')](function(_0x101f27){_0x4e9938[_0x0d80('0x1f')]=_0x101f27;if(_0x4062e0[_0x0d80('0x32')]['includeAll']){_0x558884[_0x0d80('0x40')]=[{'all':!![]}];}return db[_0x0d80('0x2d')][_0x0d80('0x41')](_0x558884);})[_0x0d80('0x27')](function(_0x7e8816){_0x4e9938['rows']=_0x7e8816;return _0x4e9938;})[_0x0d80('0x27')](respondWithFilteredResult(_0x36339f,_0x558884))[_0x0d80('0x42')](handleError(_0x36339f,null));};exports[_0x0d80('0x43')]=function(_0x231932,_0x20ec48){var _0xb4cb41={'raw':!![],'where':{'id':_0x231932[_0x0d80('0x44')]['id']}},_0x449cde={};_0x449cde[_0x0d80('0x31')]=_[_0x0d80('0x45')](db[_0x0d80('0x2d')][_0x0d80('0x2e')]);_0x449cde['query']=_[_0x0d80('0x45')](_0x231932[_0x0d80('0x32')]);_0x449cde['filters']=_['intersection'](_0x449cde[_0x0d80('0x31')],_0x449cde[_0x0d80('0x32')]);_0xb4cb41[_0x0d80('0x35')]=_[_0x0d80('0x34')](_0x449cde[_0x0d80('0x31')],qs[_0x0d80('0x36')](_0x231932[_0x0d80('0x32')]['fields']));_0xb4cb41[_0x0d80('0x35')]=_0xb4cb41[_0x0d80('0x35')][_0x0d80('0x37')]?_0xb4cb41[_0x0d80('0x35')]:_0x449cde[_0x0d80('0x31')];if(_0x231932[_0x0d80('0x32')][_0x0d80('0x46')]){_0xb4cb41[_0x0d80('0x40')]=[{'all':!![]}];}_0xb4cb41=_[_0x0d80('0x3f')]({},_0xb4cb41,_0x231932[_0x0d80('0x47')]);return db[_0x0d80('0x2d')][_0x0d80('0x48')](_0xb4cb41)[_0x0d80('0x27')](handleEntityNotFound(_0x20ec48,null))[_0x0d80('0x27')](respondWithResult(_0x20ec48,null))[_0x0d80('0x42')](handleError(_0x20ec48,null));};exports[_0x0d80('0x49')]=function(_0x40672e,_0x480646){return db[_0x0d80('0x2d')]['create'](_0x40672e[_0x0d80('0x4a')],{})['then'](respondWithResult(_0x480646,0xc9))[_0x0d80('0x42')](handleError(_0x480646,null));};exports[_0x0d80('0x26')]=function(_0x940fb5,_0x2e1ac2){if(_0x940fb5[_0x0d80('0x4a')]['id']){delete _0x940fb5['body']['id'];}return db[_0x0d80('0x2d')]['find']({'where':{'id':_0x940fb5['params']['id']}})['then'](handleEntityNotFound(_0x2e1ac2,null))['then'](saveUpdates(_0x940fb5[_0x0d80('0x4a')],null))[_0x0d80('0x27')](respondWithResult(_0x2e1ac2,null))['catch'](handleError(_0x2e1ac2,null));};exports['destroy']=function(_0x556c3a,_0x227ef6){return db[_0x0d80('0x2d')][_0x0d80('0x48')]({'where':{'id':_0x556c3a[_0x0d80('0x44')]['id']}})[_0x0d80('0x27')](handleEntityNotFound(_0x227ef6,null))[_0x0d80('0x27')](removeEntity(_0x227ef6,null))[_0x0d80('0x42')](handleError(_0x227ef6,null));};exports['describe']=function(_0x1da312,_0x4c6803){return db[_0x0d80('0x2d')]['describe']()[_0x0d80('0x27')](respondWithResult(_0x4c6803,null))[_0x0d80('0x42')](handleError(_0x4c6803,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index fd8c97e..01b4933 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 _0xac29=['../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0xac29,0x19d));var _0x9ac2=function(_0x461546,_0x152a89){_0x461546=_0x461546-0x0;var _0xf9e527=_0xac29[_0x461546];return _0xf9e527;};'use strict';var _=require('lodash');var util=require(_0x9ac2('0x0'));var logger=require(_0x9ac2('0x1'))(_0x9ac2('0x2'));var moment=require(_0x9ac2('0x3'));var BPromise=require(_0x9ac2('0x4'));var rp=require(_0x9ac2('0x5'));var fs=require('fs');var path=require(_0x9ac2('0x6'));var rimraf=require('rimraf');var config=require(_0x9ac2('0x7'));var attributes=require(_0x9ac2('0x8'));module[_0x9ac2('0x9')]=function(_0x41db0b,_0x1ec763){return _0x41db0b[_0x9ac2('0xa')](_0x9ac2('0xb'),attributes,{'tableName':_0x9ac2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x9ac2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3c3=['../../config/logger','api','moment','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe3c3,0xb4));var _0x3e3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe3c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3e3c('0x0'));var util=require(_0x3e3c('0x1'));var logger=require(_0x3e3c('0x2'))(_0x3e3c('0x3'));var moment=require(_0x3e3c('0x4'));var BPromise=require(_0x3e3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e3c('0x6'));var rimraf=require(_0x3e3c('0x7'));var config=require('../../config/environment');var attributes=require(_0x3e3c('0x8'));module[_0x3e3c('0x9')]=function(_0x2ec3c9,_0x55e5b0){return _0x2ec3c9[_0x3e3c('0xa')](_0x3e3c('0xb'),attributes,{'tableName':_0x3e3c('0xc'),'paranoid':![],'indexes':[{'fields':[_0x3e3c('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 7e21336..74d1308 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 _0xd03b=['catch','VoiceDialReport','raw','where','attributes','limit','UpdateVoiceDialReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateVoiceDialReport','create','body','options','stringify'];(function(_0x2c0ad8,_0x5c0691){var _0x3812f3=function(_0x70e192){while(--_0x70e192){_0x2c0ad8['push'](_0x2c0ad8['shift']());}};_0x3812f3(++_0x5c0691);}(_0xd03b,0x193));var _0xbd03=function(_0xdd74e3,_0x546b6b){_0xdd74e3=_0xdd74e3-0x0;var _0x7ef5b1=_0xd03b[_0xdd74e3];return _0x7ef5b1;};'use strict';var _=require('lodash');var util=require(_0xbd03('0x0'));var moment=require(_0xbd03('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd03('0x2'));var fs=require('fs');var Redis=require(_0xbd03('0x3'));var db=require(_0xbd03('0x4'))['db'];var utils=require(_0xbd03('0x5'));var logger=require(_0xbd03('0x6'))(_0xbd03('0x7'));var config=require(_0xbd03('0x8'));var jayson=require(_0xbd03('0x9'));var client=jayson[_0xbd03('0xa')][_0xbd03('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfc03ef,_0x2e09d4,_0x372299){return new BPromise(function(_0x9d4d7d,_0x60ef0b){return client['request'](_0xfc03ef,_0x372299)[_0xbd03('0xc')](function(_0x1d900e){logger[_0xbd03('0xd')](_0xbd03('0xe'),_0x2e09d4,_0xbd03('0xf'));logger[_0xbd03('0x10')](_0xbd03('0x11'),_0x2e09d4,_0xbd03('0xf'),JSON['stringify'](_0x1d900e));if(_0x1d900e[_0xbd03('0x12')]){if(_0x1d900e[_0xbd03('0x12')]['code']===0x1f4){logger[_0xbd03('0x12')](_0xbd03('0xe'),_0x2e09d4,_0x1d900e['error']['message']);return _0x60ef0b(_0x1d900e[_0xbd03('0x12')][_0xbd03('0x13')]);}logger[_0xbd03('0x12')](_0xbd03('0xe'),_0x2e09d4,_0x1d900e[_0xbd03('0x12')][_0xbd03('0x13')]);return _0x9d4d7d(_0x1d900e[_0xbd03('0x12')][_0xbd03('0x13')]);}else{logger['info'](_0xbd03('0xe'),_0x2e09d4,_0xbd03('0xf'));_0x9d4d7d(_0x1d900e[_0xbd03('0x14')][_0xbd03('0x13')]);}})['catch'](function(_0x5ea91b){logger['error'](_0xbd03('0xe'),_0x2e09d4,_0x5ea91b);_0x60ef0b(_0x5ea91b);});});}exports[_0xbd03('0x15')]=function(_0x2ac457){var _0xa18bfd=this;return new Promise(function(_0x281050,_0x2664c9){return db['VoiceDialReport'][_0xbd03('0x16')](_0x2ac457[_0xbd03('0x17')],{'raw':_0x2ac457[_0xbd03('0x18')]?_0x2ac457[_0xbd03('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbd03('0xc')](function(_0x5dd3ed){logger[_0xbd03('0xd')](_0xbd03('0x15'),_0x2ac457);logger['debug'](_0xbd03('0x15'),_0x2ac457,JSON[_0xbd03('0x19')](_0x5dd3ed));_0x281050(_0x5dd3ed);})[_0xbd03('0x1a')](function(_0x3c259e){logger['error'](_0xbd03('0x15'),_0x3c259e[_0xbd03('0x13')],_0x2ac457);_0x2664c9(_0xa18bfd[_0xbd03('0x12')](0x1f4,_0x3c259e['message']));});});};exports['UpdateVoiceDialReport']=function(_0x28a184){var _0x5d2e64=this;return new Promise(function(_0x34ae03,_0x2b4ead){return db[_0xbd03('0x1b')]['update'](_0x28a184[_0xbd03('0x17')],{'raw':_0x28a184[_0xbd03('0x18')]?_0x28a184[_0xbd03('0x18')][_0xbd03('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a184[_0xbd03('0x18')]?_0x28a184[_0xbd03('0x18')][_0xbd03('0x1d')]||null:null,'attributes':_0x28a184[_0xbd03('0x18')]?_0x28a184[_0xbd03('0x18')][_0xbd03('0x1e')]||null:null,'limit':_0x28a184[_0xbd03('0x18')]?_0x28a184['options'][_0xbd03('0x1f')]||null:null})[_0xbd03('0xc')](function(_0xd661c6){logger[_0xbd03('0xd')](_0xbd03('0x20'),_0x28a184);logger[_0xbd03('0x10')](_0xbd03('0x20'),_0x28a184,JSON[_0xbd03('0x19')](_0xd661c6));_0x34ae03(_0xd661c6);})[_0xbd03('0x1a')](function(_0x5cfaa0){logger[_0xbd03('0x12')](_0xbd03('0x20'),_0x5cfaa0[_0xbd03('0x13')],_0x28a184);_0x2b4ead(_0x5d2e64['error'](0x1f4,_0x5cfaa0[_0xbd03('0x13')]));});});}; \ No newline at end of file +var _0xaf5c=['CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xaf5c,0x106));var _0xcaf5=function(_0x226589,_0x5e83f5){_0x226589=_0x226589-0x0;var _0x4a401d=_0xaf5c[_0x226589];return _0x4a401d;};'use strict';var _=require('lodash');var util=require(_0xcaf5('0x0'));var moment=require(_0xcaf5('0x1'));var BPromise=require(_0xcaf5('0x2'));var rs=require(_0xcaf5('0x3'));var fs=require('fs');var Redis=require(_0xcaf5('0x4'));var db=require(_0xcaf5('0x5'))['db'];var utils=require(_0xcaf5('0x6'));var logger=require('../../config/logger')(_0xcaf5('0x7'));var config=require(_0xcaf5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcaf5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x161555,_0x4756a0,_0x147893){return new BPromise(function(_0x4f5d1a,_0x5f1f8d){return client[_0xcaf5('0xa')](_0x161555,_0x147893)[_0xcaf5('0xb')](function(_0x33eb55){logger[_0xcaf5('0xc')](_0xcaf5('0xd'),_0x4756a0,_0xcaf5('0xe'));logger[_0xcaf5('0xf')](_0xcaf5('0x10'),_0x4756a0,'request\x20sent',JSON[_0xcaf5('0x11')](_0x33eb55));if(_0x33eb55[_0xcaf5('0x12')]){if(_0x33eb55[_0xcaf5('0x12')]['code']===0x1f4){logger[_0xcaf5('0x12')](_0xcaf5('0xd'),_0x4756a0,_0x33eb55[_0xcaf5('0x12')][_0xcaf5('0x13')]);return _0x5f1f8d(_0x33eb55[_0xcaf5('0x12')]['message']);}logger[_0xcaf5('0x12')](_0xcaf5('0xd'),_0x4756a0,_0x33eb55[_0xcaf5('0x12')][_0xcaf5('0x13')]);return _0x4f5d1a(_0x33eb55['error']['message']);}else{logger[_0xcaf5('0xc')](_0xcaf5('0xd'),_0x4756a0,_0xcaf5('0xe'));_0x4f5d1a(_0x33eb55[_0xcaf5('0x14')][_0xcaf5('0x13')]);}})[_0xcaf5('0x15')](function(_0x1feec7){logger[_0xcaf5('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x4756a0,_0x1feec7);_0x5f1f8d(_0x1feec7);});});}exports['CreateVoiceDialReport']=function(_0x37f3d9){var _0x313bcb=this;return new Promise(function(_0x118b8c,_0x3096d4){return db['VoiceDialReport'][_0xcaf5('0x16')](_0x37f3d9[_0xcaf5('0x17')],{'raw':_0x37f3d9[_0xcaf5('0x18')]?_0x37f3d9[_0xcaf5('0x18')][_0xcaf5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x37f52d){logger['info']('CreateVoiceDialReport',_0x37f3d9);logger[_0xcaf5('0xf')]('CreateVoiceDialReport',_0x37f3d9,JSON[_0xcaf5('0x11')](_0x37f52d));_0x118b8c(_0x37f52d);})[_0xcaf5('0x15')](function(_0x1c3e98){logger['error'](_0xcaf5('0x1a'),_0x1c3e98['message'],_0x37f3d9);_0x3096d4(_0x313bcb[_0xcaf5('0x12')](0x1f4,_0x1c3e98[_0xcaf5('0x13')]));});});};exports[_0xcaf5('0x1b')]=function(_0x4a956e){var _0x5ae9f5=this;return new Promise(function(_0x2e5fb0,_0x28adcc){return db['VoiceDialReport'][_0xcaf5('0x1c')](_0x4a956e[_0xcaf5('0x17')],{'raw':_0x4a956e[_0xcaf5('0x18')]?_0x4a956e[_0xcaf5('0x18')][_0xcaf5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a956e['options']?_0x4a956e[_0xcaf5('0x18')][_0xcaf5('0x1d')]||null:null,'attributes':_0x4a956e[_0xcaf5('0x18')]?_0x4a956e[_0xcaf5('0x18')][_0xcaf5('0x1e')]||null:null,'limit':_0x4a956e[_0xcaf5('0x18')]?_0x4a956e['options'][_0xcaf5('0x1f')]||null:null})['then'](function(_0x5d7554){logger['info'](_0xcaf5('0x1b'),_0x4a956e);logger[_0xcaf5('0xf')](_0xcaf5('0x1b'),_0x4a956e,JSON[_0xcaf5('0x11')](_0x5d7554));_0x2e5fb0(_0x5d7554);})[_0xcaf5('0x15')](function(_0x2fdc3b){logger[_0xcaf5('0x12')](_0xcaf5('0x1b'),_0x2fdc3b[_0xcaf5('0x13')],_0x4a956e);_0x28adcc(_0x5ae9f5[_0xcaf5('0x12')](0x1f4,_0x2fdc3b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 4fe2465..c11f2b3 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 _0x9083=['post','create','/:id/applications','isAuthenticated','addApplications','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','index','get','/:id','show'];(function(_0x392ca0,_0x41916f){var _0x289124=function(_0x1c8d26){while(--_0x1c8d26){_0x392ca0['push'](_0x392ca0['shift']());}};_0x289124(++_0x41916f);}(_0x9083,0x9c));var _0x3908=function(_0x4ce3b6,_0x1512d6){_0x4ce3b6=_0x4ce3b6-0x0;var _0x3f3bbb=_0x9083[_0x4ce3b6];return _0x3f3bbb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3908('0x0'));var timeout=require(_0x3908('0x1'));var express=require(_0x3908('0x2'));var router=express[_0x3908('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3908('0x4'));var interaction=require(_0x3908('0x5'));var config=require(_0x3908('0x6'));var controller=require(_0x3908('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3908('0x8')]);router[_0x3908('0x9')](_0x3908('0xa'),auth['isAuthenticated'](),controller[_0x3908('0xb')]);router[_0x3908('0xc')]('/',auth['isAuthenticated'](),controller[_0x3908('0xd')]);router[_0x3908('0xc')](_0x3908('0xe'),auth[_0x3908('0xf')](),controller[_0x3908('0x10')]);router['put'](_0x3908('0xa'),auth[_0x3908('0xf')](),controller[_0x3908('0x11')]);router[_0x3908('0x12')](_0x3908('0xa'),auth[_0x3908('0xf')](),controller[_0x3908('0x13')]);module[_0x3908('0x14')]=router; \ No newline at end of file +var _0xc899=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','delete','exports'];(function(_0x5e2ddd,_0x3eaaaf){var _0x190902=function(_0x15bcd0){while(--_0x15bcd0){_0x5e2ddd['push'](_0x5e2ddd['shift']());}};_0x190902(++_0x3eaaaf);}(_0xc899,0xb8));var _0x9c89=function(_0x2a4938,_0x3fa26d){_0x2a4938=_0x2a4938-0x0;var _0x309435=_0xc899[_0x2a4938];return _0x309435;};'use strict';var multer=require(_0x9c89('0x0'));var util=require(_0x9c89('0x1'));var path=require(_0x9c89('0x2'));var timeout=require(_0x9c89('0x3'));var express=require(_0x9c89('0x4'));var router=express[_0x9c89('0x5')]();var fs_extra=require(_0x9c89('0x6'));var auth=require(_0x9c89('0x7'));var interaction=require(_0x9c89('0x8'));var config=require(_0x9c89('0x9'));var controller=require(_0x9c89('0xa'));router[_0x9c89('0xb')]('/',auth[_0x9c89('0xc')](),controller[_0x9c89('0xd')]);router[_0x9c89('0xb')](_0x9c89('0xe'),auth[_0x9c89('0xc')](),controller[_0x9c89('0xf')]);router[_0x9c89('0x10')]('/',auth[_0x9c89('0xc')](),controller['create']);router[_0x9c89('0x10')](_0x9c89('0x11'),auth[_0x9c89('0xc')](),controller[_0x9c89('0x12')]);router[_0x9c89('0x13')](_0x9c89('0xe'),auth[_0x9c89('0xc')](),controller[_0x9c89('0x14')]);router[_0x9c89('0x15')](_0x9c89('0xe'),auth[_0x9c89('0xc')](),controller['destroy']);module[_0x9c89('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index a832ea2..7dcde21 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 _0x713c=['INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','internal','inbound-fax','system','any','*,*,*,*'];(function(_0x2b4cdb,_0x42240b){var _0x503e98=function(_0x4b60f6){while(--_0x4b60f6){_0x2b4cdb['push'](_0x2b4cdb['shift']());}};_0x503e98(++_0x42240b);}(_0x713c,0x1d5));var _0xc713=function(_0x53ced5,_0x80e3c8){_0x53ced5=_0x53ced5-0x0;var _0x829260=_0x713c[_0x53ced5];return _0x829260;};'use strict';var Sequelize=require(_0xc713('0x0'));module[_0xc713('0x1')]={'context':{'type':Sequelize[_0xc713('0x2')],'allowNull':![],'unique':_0xc713('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xc713('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc713('0x2')],'allowNull':![],'defaultValue':_0xc713('0x4')},'appdata':{'type':Sequelize[_0xc713('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc713('0x5')]('inbound','outbound',_0xc713('0x6'),_0xc713('0x7'),'outbound-fax',_0xc713('0x8'),_0xc713('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc713('0xa')},'IntervalId':{'type':Sequelize[_0xc713('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc713('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc713('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc713('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc713('0xb')]},'recordingFormat':{'type':Sequelize[_0xc713('0x2')],'defaultValue':_0xc713('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xc713('0xe')],'get':function(_0x2f61d7){return this['getDataValue'](_0xc713('0xf'));}},'alias':{'type':Sequelize[_0xc713('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x569e=['STRING','compositeIndex','NoOp','ENUM','internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports'];(function(_0x67e53b,_0x2b4893){var _0x210120=function(_0x1b6b08){while(--_0x1b6b08){_0x67e53b['push'](_0x67e53b['shift']());}};_0x210120(++_0x2b4893);}(_0x569e,0xfe));var _0xe569=function(_0x3b1caf,_0x8a35c5){_0x3b1caf=_0x3b1caf-0x0;var _0x416b17=_0x569e[_0x3b1caf];return _0x416b17;};'use strict';var Sequelize=require(_0xe569('0x0'));module[_0xe569('0x1')]={'context':{'type':Sequelize[_0xe569('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe569('0x2')],'allowNull':![],'unique':_0xe569('0x3')},'priority':{'type':Sequelize[_0xe569('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xe569('0x3')},'tag':{'type':Sequelize[_0xe569('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe569('0x4')},'appdata':{'type':Sequelize[_0xe569('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe569('0x5')]('inbound','outbound',_0xe569('0x6'),'inbound-fax',_0xe569('0x7'),_0xe569('0x8'),_0xe569('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe569('0x2')],'allowNull':![],'defaultValue':_0xe569('0xa')},'IntervalId':{'type':Sequelize[_0xe569('0xb')]},'isApp':{'type':Sequelize[_0xe569('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe569('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xe569('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xe569('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe569('0xb')]},'recordingFormat':{'type':Sequelize[_0xe569('0x2')],'defaultValue':_0xe569('0xd')},'answer':{'type':Sequelize[_0xe569('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe569('0xe')],'get':function(_0x41c5a4){return this['getDataValue'](_0xe569('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index a760eac..23bf538 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 _0xcb3c=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','show','params','catch','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OutboundRoutes','internal','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','send','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','json','offset','limit','undefined','count','status','destroy','then','get','inbound','outbound','InternalRoutes','filter','map','value','type','find','UserProfileResource','stack','name','index','rawAttributes','fieldName','key','keys','query','filters','intersection','model'];(function(_0x244b49,_0x4c7786){var _0x47dcc5=function(_0x3ab447){while(--_0x3ab447){_0x244b49['push'](_0x244b49['shift']());}};_0x47dcc5(++_0x4c7786);}(_0xcb3c,0x8e));var _0xccb3=function(_0x4c3afd,_0x3e7a45){_0x4c3afd=_0x4c3afd-0x0;var _0x4e2ef3=_0xcb3c[_0x4c3afd];return _0x4e2ef3;};'use strict';var _=require(_0xccb3('0x0'));var Redis=require('ioredis');var qs=require(_0xccb3('0x1'));var logger=require(_0xccb3('0x2'))(_0xccb3('0x3'));var config=require(_0xccb3('0x4'));var db=require(_0xccb3('0x5'))['db'];config[_0xccb3('0x6')]=_[_0xccb3('0x7')](config[_0xccb3('0x6')],{'host':_0xccb3('0x8'),'port':0x18eb});var socket=require(_0xccb3('0x9'))(new Redis(config['redis']));require(_0xccb3('0xa'))['register'](socket);function respondWithStatusCode(_0x2baf72,_0x40a52d){_0x40a52d=_0x40a52d||0xcc;return function(_0x3f64a3){if(_0x3f64a3){return _0x2baf72[_0xccb3('0xb')](_0x40a52d);}return _0x2baf72['status'](_0x40a52d)[_0xccb3('0xc')]();};}function respondWithResult(_0x50aefb,_0x10f82a){_0x10f82a=_0x10f82a||0xc8;return function(_0x2c29b0){if(_0x2c29b0){return _0x50aefb['status'](_0x10f82a)[_0xccb3('0xd')](_0x2c29b0);}};}function respondWithFilteredResult(_0x4090da,_0x3867f7){return function(_0xf8a7e5){if(_0xf8a7e5){var _0x416692=typeof _0x3867f7[_0xccb3('0xe')]==='undefined'&&typeof _0x3867f7[_0xccb3('0xf')]===_0xccb3('0x10');var _0x5b04ea=_0xf8a7e5[_0xccb3('0x11')];var _0xb65d59=_0x416692?0x0:_0x3867f7[_0xccb3('0xe')];var _0x99ef89=_0x416692?_0xf8a7e5[_0xccb3('0x11')]:_0x3867f7[_0xccb3('0xe')]+_0x3867f7[_0xccb3('0xf')];var _0x1c99f3;if(_0x99ef89>=_0x5b04ea){_0x99ef89=_0x5b04ea;_0x1c99f3=0xc8;}else{_0x1c99f3=0xce;}_0x4090da[_0xccb3('0x12')](_0x1c99f3);return _0x4090da['set']('Content-Range',_0xb65d59+'-'+_0x99ef89+'/'+_0x5b04ea)['json'](_0xf8a7e5);}return null;};}function removeEntity(_0x150ebf){return function(_0x4a3258){if(_0x4a3258){return _0x4a3258[_0xccb3('0x13')]()[_0xccb3('0x14')](function(){var _0x3ef098=_0x4a3258[_0xccb3('0x15')]({'plain':!![]});var _0x4de2a9=[{'name':'InboundRoutes','value':_0xccb3('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0xccb3('0x17'),'ignore':![]},{'name':_0xccb3('0x18'),'value':'internal','ignore':![]}];var _0x3975c2=_(_0x4de2a9)[_0xccb3('0x19')]('ignore')[_0xccb3('0x1a')](_0xccb3('0x1b'))[_0xccb3('0x1b')]();if(_['includes'](_0x3975c2,_0x3ef098[_0xccb3('0x1c')])){return;}var _0x445430=_[_0xccb3('0x1d')](_0x4de2a9,['value',_0x3ef098['type']])['name'];return db[_0xccb3('0x1e')][_0xccb3('0x13')]({'where':{'type':_0x445430,'resourceId':_0x3ef098['id']}})[_0xccb3('0x14')](function(){return _0x4a3258;});})[_0xccb3('0x14')](function(){_0x150ebf['status'](0xcc)[_0xccb3('0xc')]();});}};}function handleEntityNotFound(_0x2090fd){return function(_0x182f52){if(!_0x182f52){_0x2090fd[_0xccb3('0xb')](0x194);}return _0x182f52;};}function handleError(_0x41d265,_0x29f2ef){_0x29f2ef=_0x29f2ef||0x1f4;return function(_0x44d933){logger['error'](_0x44d933[_0xccb3('0x1f')]);if(_0x44d933[_0xccb3('0x20')]){delete _0x44d933[_0xccb3('0x20')];}_0x41d265[_0xccb3('0x12')](_0x29f2ef)['send'](_0x44d933);};}exports[_0xccb3('0x21')]=function(_0x4002e6,_0x4c3034){var _0x1ddb32={},_0x1ba143={},_0x2ea78b={'count':0x0,'rows':[]};var _0x2cc025=_[_0xccb3('0x1a')](db['VoiceExtension'][_0xccb3('0x22')],function(_0x37ef0b){return{'name':_0x37ef0b[_0xccb3('0x23')],'type':_0x37ef0b[_0xccb3('0x1c')][_0xccb3('0x24')]};});_0x1ba143['model']=_[_0xccb3('0x1a')](_0x2cc025,_0xccb3('0x20'));_0x1ba143['query']=_[_0xccb3('0x25')](_0x4002e6[_0xccb3('0x26')]);_0x1ba143[_0xccb3('0x27')]=_[_0xccb3('0x28')](_0x1ba143[_0xccb3('0x29')],_0x1ba143[_0xccb3('0x26')]);_0x1ddb32['attributes']=_[_0xccb3('0x28')](_0x1ba143[_0xccb3('0x29')],qs[_0xccb3('0x2a')](_0x4002e6[_0xccb3('0x26')][_0xccb3('0x2a')]));_0x1ddb32[_0xccb3('0x2b')]=_0x1ddb32[_0xccb3('0x2b')]['length']?_0x1ddb32[_0xccb3('0x2b')]:_0x1ba143['model'];if(!_0x4002e6['query'][_0xccb3('0x2c')](_0xccb3('0x2d'))){_0x1ddb32[_0xccb3('0xf')]=qs['limit'](_0x4002e6[_0xccb3('0x26')]['limit']);_0x1ddb32[_0xccb3('0xe')]=qs[_0xccb3('0xe')](_0x4002e6['query'][_0xccb3('0xe')]);}_0x1ddb32[_0xccb3('0x2e')]=qs['sort'](_0x4002e6['query'][_0xccb3('0x2f')]);_0x1ddb32[_0xccb3('0x30')]=qs[_0xccb3('0x27')](_[_0xccb3('0x31')](_0x4002e6[_0xccb3('0x26')],_0x1ba143['filters']),_0x2cc025);if(_0x4002e6[_0xccb3('0x26')][_0xccb3('0x19')]){_0x1ddb32['where']=_[_0xccb3('0x32')](_0x1ddb32[_0xccb3('0x30')],{'$or':_[_0xccb3('0x1a')](_0x2cc025,function(_0x30c343){if(_0x30c343[_0xccb3('0x1c')]!==_0xccb3('0x33')){var _0x5e8930={};_0x5e8930[_0x30c343['name']]={'$like':'%'+_0x4002e6[_0xccb3('0x26')][_0xccb3('0x19')]+'%'};return _0x5e8930;}})});}_0x1ddb32=_[_0xccb3('0x32')]({},_0x1ddb32,_0x4002e6[_0xccb3('0x34')]);var _0x505648={'where':_0x1ddb32[_0xccb3('0x30')]};return db[_0xccb3('0x35')][_0xccb3('0x11')](_0x505648)[_0xccb3('0x14')](function(_0x591b14){_0x2ea78b[_0xccb3('0x11')]=_0x591b14;if(_0x4002e6['query'][_0xccb3('0x36')]){_0x1ddb32[_0xccb3('0x37')]=[{'all':!![]}];}return db['VoiceExtension'][_0xccb3('0x38')](_0x1ddb32);})[_0xccb3('0x14')](function(_0x3319a5){_0x2ea78b['rows']=_0x3319a5;return _0x2ea78b;})[_0xccb3('0x14')](respondWithFilteredResult(_0x4c3034,_0x1ddb32))['catch'](handleError(_0x4c3034,null));};exports[_0xccb3('0x39')]=function(_0x184d5c,_0x2e2b0f){var _0x4025b8={'raw':![],'where':{'id':_0x184d5c[_0xccb3('0x3a')]['id']}},_0x151c53={};_0x151c53[_0xccb3('0x29')]=_[_0xccb3('0x25')](db[_0xccb3('0x35')][_0xccb3('0x22')]);_0x151c53[_0xccb3('0x26')]=_[_0xccb3('0x25')](_0x184d5c[_0xccb3('0x26')]);_0x151c53[_0xccb3('0x27')]=_[_0xccb3('0x28')](_0x151c53[_0xccb3('0x29')],_0x151c53[_0xccb3('0x26')]);_0x4025b8[_0xccb3('0x2b')]=_[_0xccb3('0x28')](_0x151c53[_0xccb3('0x29')],qs['fields'](_0x184d5c['query'][_0xccb3('0x2a')]));_0x4025b8['attributes']=_0x4025b8['attributes']['length']?_0x4025b8['attributes']:_0x151c53[_0xccb3('0x29')];if(_0x184d5c[_0xccb3('0x26')][_0xccb3('0x36')]){_0x4025b8['include']=[{'all':!![]}];}_0x4025b8=_[_0xccb3('0x32')]({},_0x4025b8,_0x184d5c[_0xccb3('0x34')]);return db[_0xccb3('0x35')][_0xccb3('0x1d')](_0x4025b8)[_0xccb3('0x14')](handleEntityNotFound(_0x2e2b0f,null))[_0xccb3('0x14')](respondWithResult(_0x2e2b0f,null))[_0xccb3('0x3b')](handleError(_0x2e2b0f,null));};exports[_0xccb3('0x13')]=function(_0x6539d8,_0x4f1ddd){return db[_0xccb3('0x35')][_0xccb3('0x1d')]({'where':{'id':_0x6539d8[_0xccb3('0x3a')]['id']}})[_0xccb3('0x14')](handleEntityNotFound(_0x4f1ddd,null))[_0xccb3('0x14')](removeEntity(_0x4f1ddd,null))[_0xccb3('0x3b')](handleError(_0x4f1ddd,null));};exports[_0xccb3('0x3c')]=function(_0x39b702,_0x497269){if(_0x39b702[_0xccb3('0x3d')][_0xccb3('0x1c')]==='outbound'&&!_[_0xccb3('0x3e')](_0x39b702[_0xccb3('0x3d')][_0xccb3('0x3f')],'_')){_0x39b702[_0xccb3('0x3d')][_0xccb3('0x3f')]='_'['concat'](_0x39b702[_0xccb3('0x3d')]['exten']);}return db[_0xccb3('0x35')][_0xccb3('0x3c')](_0x39b702['body'],{'raw':![]})[_0xccb3('0x14')](function(_0x1b7eb1){var _0x351e7a=_0x39b702[_0xccb3('0x40')][_0xccb3('0x15')]({'plain':!![]});if(!_0x351e7a)throw new Error(_0xccb3('0x41'));if(_0x351e7a['role']==='user'){var _0x1d451e=_0x1b7eb1['get']({'plain':!![]});var _0x443aff=[{'name':'InboundRoutes','value':_0xccb3('0x16')},{'name':_0xccb3('0x42'),'value':'outbound'},{'name':'InternalRoutes','value':_0xccb3('0x43')}];var _0x2cb892=_['find'](_0x443aff,[_0xccb3('0x1b'),_0x1d451e['type']])[_0xccb3('0x20')];return db[_0xccb3('0x44')][_0xccb3('0x1d')]({'where':{'name':_0x2cb892,'userProfileId':_0x351e7a[_0xccb3('0x45')]},'raw':!![]})[_0xccb3('0x14')](function(_0xd45290){if(_0xd45290&&_0xd45290[_0xccb3('0x46')]===0x0){return db[_0xccb3('0x1e')][_0xccb3('0x3c')]({'name':_0x1d451e[_0xccb3('0x20')],'resourceId':_0x1d451e['id'],'type':_0xd45290[_0xccb3('0x20')],'sectionId':_0xd45290['id']},{})['then'](function(){return _0x1b7eb1;});}else{return _0x1b7eb1;}})[_0xccb3('0x3b')](function(_0x3007fc){logger[_0xccb3('0x47')](_0xccb3('0x48'),_0x3007fc);throw _0x3007fc;});}return _0x1b7eb1;})[_0xccb3('0x14')](respondWithResult(_0x497269,0xc9))[_0xccb3('0x3b')](handleError(_0x497269,null));};exports[_0xccb3('0x49')]=function(_0x451908,_0x48bc14){if(_0x451908[_0xccb3('0x3d')]['id']){delete _0x451908[_0xccb3('0x3d')]['id'];}return db[_0xccb3('0x35')][_0xccb3('0x1d')]({'where':{'id':_0x451908[_0xccb3('0x3a')]['id']}})[_0xccb3('0x14')](handleEntityNotFound(_0x48bc14,null))[_0xccb3('0x14')](function(_0x432500){if(_0x432500){return db[_0xccb3('0x35')][_0xccb3('0x49')](_[_0xccb3('0x31')](_0x451908[_0xccb3('0x3d')],[_0xccb3('0x3f'),'context',_0xccb3('0x4a'),_0xccb3('0x4b'),_0xccb3('0x4c'),_0xccb3('0x4d'),_0xccb3('0x4e')]),{'where':{'context':_0x432500[_0xccb3('0x4f')],'exten':_0x432500[_0xccb3('0x3f')]},'individualHooks':!![]})[_0xccb3('0x14')](function(_0xa5aad){return _0xa5aad;});}return null;})['then'](respondWithStatusCode(_0x48bc14,null))[_0xccb3('0x3b')](handleError(_0x48bc14,null));};exports[_0xccb3('0x50')]=function(_0xe518a9,_0x554046){var _0x1f174d=_0xe518a9[_0xccb3('0x3a')]['id'];var _0x3bc4dc=_0xe518a9[_0xccb3('0x3d')];var _0x2b9cb4=0xc8;var _0xabd165=null;return db[_0xccb3('0x51')][_0xccb3('0x52')]({'isolationLevel':db['sequelize'][_0xccb3('0x53')][_0xccb3('0x54')][_0xccb3('0x55')]},function(_0x4622f7){return db[_0xccb3('0x35')][_0xccb3('0x56')]({'where':{'id':_0x1f174d},'transaction':_0x4622f7})[_0xccb3('0x14')](function(_0x52be3a){if(_0x52be3a){return db[_0xccb3('0x35')][_0xccb3('0x13')]({'where':{'VoiceExtensionId':_0x1f174d},'transaction':_0x4622f7})[_0xccb3('0x14')](function(){var _0x8cd956=_[_0xccb3('0x1a')](_0x3bc4dc,function(_0x571778){_0x571778[_0xccb3('0x57')]=_0x1f174d;_0x571778[_0xccb3('0x58')]=!![];return _0x571778;});return _0x52be3a[_0xccb3('0x59')](_0x8cd956);})[_0xccb3('0x14')](function(_0x4aa469){return db['VoiceExtension'][_0xccb3('0x5a')](_0x4aa469,{'transaction':_0x4622f7});});}else{_0x2b9cb4=0x194;_0xabd165=[];}});})[_0xccb3('0x14')](function(){if(_0x2b9cb4!==0x194){return db[_0xccb3('0x35')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x1f174d},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x4de552){_0xabd165=_0x4de552;});}})[_0xccb3('0x3b')](function(_0x4d625b){_0x2b9cb4=0x1f4;logger[_0xccb3('0x47')](_0x4d625b['stack']);if(_0x4d625b['name']){delete _0x4d625b['name'];}_0xabd165=_0x4d625b;})['finally'](function(){if(_0xabd165===null){_0x554046['sendStatus'](_0x2b9cb4);}else{if(_0x2b9cb4===0x1f4){_0x554046[_0xccb3('0x12')](_0x2b9cb4)[_0xccb3('0x5b')](_0xabd165);}else{_0x554046[_0xccb3('0x12')](_0x2b9cb4)[_0xccb3('0xd')](_0xabd165);}}});}; \ No newline at end of file +var _0x4374=['exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','create','update','description','recordingFormat','cutdigits','alias','context','addApplications','sequelize','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','redis','localhost','socket.io-emitter','sendStatus','end','json','undefined','limit','offset','count','Content-Range','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','find','type','name','UserProfileResource','destroy','then','status','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','catch','show','params','fields','length','include','body'];(function(_0x392c08,_0xe29426){var _0x4ef47d=function(_0x27e45b){while(--_0x27e45b){_0x392c08['push'](_0x392c08['shift']());}};_0x4ef47d(++_0xe29426);}(_0x4374,0x1cc));var _0x4437=function(_0x47be19,_0x3eed1f){_0x47be19=_0x47be19-0x0;var _0x99a5ed=_0x4374[_0x47be19];return _0x99a5ed;};'use strict';var _=require(_0x4437('0x0'));var Redis=require(_0x4437('0x1'));var qs=require(_0x4437('0x2'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4437('0x3')]=_['defaults'](config[_0x4437('0x3')],{'host':_0x4437('0x4'),'port':0x18eb});var socket=require(_0x4437('0x5'))(new Redis(config[_0x4437('0x3')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x38553b,_0x246369){_0x246369=_0x246369||0xcc;return function(_0x2a88b7){if(_0x2a88b7){return _0x38553b[_0x4437('0x6')](_0x246369);}return _0x38553b['status'](_0x246369)[_0x4437('0x7')]();};}function respondWithResult(_0xcf9c97,_0x15acba){_0x15acba=_0x15acba||0xc8;return function(_0x521bd6){if(_0x521bd6){return _0xcf9c97['status'](_0x15acba)[_0x4437('0x8')](_0x521bd6);}};}function respondWithFilteredResult(_0x17a322,_0x4ddb0c){return function(_0x1a8bb7){if(_0x1a8bb7){var _0x557053=typeof _0x4ddb0c['offset']===_0x4437('0x9')&&typeof _0x4ddb0c[_0x4437('0xa')]===_0x4437('0x9');var _0x5e3371=_0x1a8bb7['count'];var _0x19b5e8=_0x557053?0x0:_0x4ddb0c[_0x4437('0xb')];var _0x418f22=_0x557053?_0x1a8bb7[_0x4437('0xc')]:_0x4ddb0c[_0x4437('0xb')]+_0x4ddb0c[_0x4437('0xa')];var _0x528faf;if(_0x418f22>=_0x5e3371){_0x418f22=_0x5e3371;_0x528faf=0xc8;}else{_0x528faf=0xce;}_0x17a322['status'](_0x528faf);return _0x17a322['set'](_0x4437('0xd'),_0x19b5e8+'-'+_0x418f22+'/'+_0x5e3371)[_0x4437('0x8')](_0x1a8bb7);}return null;};}function removeEntity(_0x443861){return function(_0x5cc962){if(_0x5cc962){return _0x5cc962['destroy']()['then'](function(){var _0x530b6a=_0x5cc962[_0x4437('0xe')]({'plain':!![]});var _0x5b30ba=[{'name':_0x4437('0xf'),'value':_0x4437('0x10'),'ignore':![]},{'name':_0x4437('0x11'),'value':_0x4437('0x12'),'ignore':![]},{'name':'InternalRoutes','value':_0x4437('0x13'),'ignore':![]}];var _0x4e4085=_(_0x5b30ba)[_0x4437('0x14')](_0x4437('0x15'))[_0x4437('0x16')](_0x4437('0x17'))[_0x4437('0x17')]();if(_[_0x4437('0x18')](_0x4e4085,_0x530b6a['type'])){return;}var _0x4166a8=_[_0x4437('0x19')](_0x5b30ba,['value',_0x530b6a[_0x4437('0x1a')]])[_0x4437('0x1b')];return db[_0x4437('0x1c')][_0x4437('0x1d')]({'where':{'type':_0x4166a8,'resourceId':_0x530b6a['id']}})[_0x4437('0x1e')](function(){return _0x5cc962;});})[_0x4437('0x1e')](function(){_0x443861[_0x4437('0x1f')](0xcc)[_0x4437('0x7')]();});}};}function handleEntityNotFound(_0x3df294){return function(_0x48c745){if(!_0x48c745){_0x3df294['sendStatus'](0x194);}return _0x48c745;};}function handleError(_0x567eb6,_0x402219){_0x402219=_0x402219||0x1f4;return function(_0x56d8b0){logger[_0x4437('0x20')](_0x56d8b0[_0x4437('0x21')]);if(_0x56d8b0['name']){delete _0x56d8b0[_0x4437('0x1b')];}_0x567eb6[_0x4437('0x1f')](_0x402219)[_0x4437('0x22')](_0x56d8b0);};}exports[_0x4437('0x23')]=function(_0x2ec2e1,_0x5d37fa){var _0x1f92d7={},_0x2b2f6c={},_0x21c05a={'count':0x0,'rows':[]};var _0x3de8d3=_[_0x4437('0x16')](db[_0x4437('0x24')][_0x4437('0x25')],function(_0x502a19){return{'name':_0x502a19[_0x4437('0x26')],'type':_0x502a19[_0x4437('0x1a')][_0x4437('0x27')]};});_0x2b2f6c['model']=_[_0x4437('0x16')](_0x3de8d3,_0x4437('0x1b'));_0x2b2f6c[_0x4437('0x28')]=_[_0x4437('0x29')](_0x2ec2e1[_0x4437('0x28')]);_0x2b2f6c[_0x4437('0x2a')]=_[_0x4437('0x2b')](_0x2b2f6c[_0x4437('0x2c')],_0x2b2f6c['query']);_0x1f92d7[_0x4437('0x2d')]=_[_0x4437('0x2b')](_0x2b2f6c[_0x4437('0x2c')],qs['fields'](_0x2ec2e1[_0x4437('0x28')]['fields']));_0x1f92d7['attributes']=_0x1f92d7[_0x4437('0x2d')]['length']?_0x1f92d7['attributes']:_0x2b2f6c[_0x4437('0x2c')];if(!_0x2ec2e1[_0x4437('0x28')][_0x4437('0x2e')](_0x4437('0x2f'))){_0x1f92d7[_0x4437('0xa')]=qs[_0x4437('0xa')](_0x2ec2e1['query'][_0x4437('0xa')]);_0x1f92d7[_0x4437('0xb')]=qs[_0x4437('0xb')](_0x2ec2e1['query'][_0x4437('0xb')]);}_0x1f92d7['order']=qs[_0x4437('0x30')](_0x2ec2e1[_0x4437('0x28')][_0x4437('0x30')]);_0x1f92d7[_0x4437('0x31')]=qs[_0x4437('0x2a')](_[_0x4437('0x32')](_0x2ec2e1[_0x4437('0x28')],_0x2b2f6c['filters']),_0x3de8d3);if(_0x2ec2e1[_0x4437('0x28')][_0x4437('0x14')]){_0x1f92d7[_0x4437('0x31')]=_['merge'](_0x1f92d7[_0x4437('0x31')],{'$or':_[_0x4437('0x16')](_0x3de8d3,function(_0x49f778){if(_0x49f778[_0x4437('0x1a')]!==_0x4437('0x33')){var _0x30b019={};_0x30b019[_0x49f778[_0x4437('0x1b')]]={'$like':'%'+_0x2ec2e1['query'][_0x4437('0x14')]+'%'};return _0x30b019;}})});}_0x1f92d7=_[_0x4437('0x34')]({},_0x1f92d7,_0x2ec2e1[_0x4437('0x35')]);var _0x4f0e29={'where':_0x1f92d7[_0x4437('0x31')]};return db[_0x4437('0x24')][_0x4437('0xc')](_0x4f0e29)[_0x4437('0x1e')](function(_0xc686d3){_0x21c05a['count']=_0xc686d3;if(_0x2ec2e1[_0x4437('0x28')][_0x4437('0x36')]){_0x1f92d7['include']=[{'all':!![]}];}return db[_0x4437('0x24')]['findAll'](_0x1f92d7);})[_0x4437('0x1e')](function(_0x2ece7a){_0x21c05a['rows']=_0x2ece7a;return _0x21c05a;})[_0x4437('0x1e')](respondWithFilteredResult(_0x5d37fa,_0x1f92d7))[_0x4437('0x37')](handleError(_0x5d37fa,null));};exports[_0x4437('0x38')]=function(_0x401836,_0x40d664){var _0x153da5={'raw':![],'where':{'id':_0x401836[_0x4437('0x39')]['id']}},_0x5ab489={};_0x5ab489[_0x4437('0x2c')]=_[_0x4437('0x29')](db[_0x4437('0x24')][_0x4437('0x25')]);_0x5ab489[_0x4437('0x28')]=_['keys'](_0x401836[_0x4437('0x28')]);_0x5ab489[_0x4437('0x2a')]=_[_0x4437('0x2b')](_0x5ab489['model'],_0x5ab489[_0x4437('0x28')]);_0x153da5[_0x4437('0x2d')]=_['intersection'](_0x5ab489[_0x4437('0x2c')],qs['fields'](_0x401836[_0x4437('0x28')][_0x4437('0x3a')]));_0x153da5[_0x4437('0x2d')]=_0x153da5['attributes'][_0x4437('0x3b')]?_0x153da5[_0x4437('0x2d')]:_0x5ab489[_0x4437('0x2c')];if(_0x401836['query'][_0x4437('0x36')]){_0x153da5[_0x4437('0x3c')]=[{'all':!![]}];}_0x153da5=_[_0x4437('0x34')]({},_0x153da5,_0x401836[_0x4437('0x35')]);return db[_0x4437('0x24')][_0x4437('0x19')](_0x153da5)[_0x4437('0x1e')](handleEntityNotFound(_0x40d664,null))[_0x4437('0x1e')](respondWithResult(_0x40d664,null))[_0x4437('0x37')](handleError(_0x40d664,null));};exports['destroy']=function(_0x3c8d42,_0xa4d42c){return db[_0x4437('0x24')][_0x4437('0x19')]({'where':{'id':_0x3c8d42[_0x4437('0x39')]['id']}})[_0x4437('0x1e')](handleEntityNotFound(_0xa4d42c,null))[_0x4437('0x1e')](removeEntity(_0xa4d42c,null))[_0x4437('0x37')](handleError(_0xa4d42c,null));};exports['create']=function(_0xcb1dbd,_0x222ef3){if(_0xcb1dbd['body'][_0x4437('0x1a')]===_0x4437('0x12')&&!_['startsWith'](_0xcb1dbd[_0x4437('0x3d')][_0x4437('0x3e')],'_')){_0xcb1dbd['body']['exten']='_'[_0x4437('0x3f')](_0xcb1dbd[_0x4437('0x3d')]['exten']);}return db[_0x4437('0x24')]['create'](_0xcb1dbd[_0x4437('0x3d')],{'raw':![]})[_0x4437('0x1e')](function(_0x56feb8){var _0x834169=_0xcb1dbd[_0x4437('0x40')]['get']({'plain':!![]});if(!_0x834169)throw new Error(_0x4437('0x41'));if(_0x834169[_0x4437('0x42')]===_0x4437('0x40')){var _0x14f6e5=_0x56feb8[_0x4437('0xe')]({'plain':!![]});var _0x369720=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x4437('0x11'),'value':_0x4437('0x12')},{'name':'InternalRoutes','value':_0x4437('0x13')}];var _0x5ba32c=_['find'](_0x369720,['value',_0x14f6e5[_0x4437('0x1a')]])[_0x4437('0x1b')];return db['UserProfileSection'][_0x4437('0x19')]({'where':{'name':_0x5ba32c,'userProfileId':_0x834169[_0x4437('0x43')]},'raw':!![]})[_0x4437('0x1e')](function(_0x532045){if(_0x532045&&_0x532045['autoAssociation']===0x0){return db[_0x4437('0x1c')][_0x4437('0x44')]({'name':_0x14f6e5['name'],'resourceId':_0x14f6e5['id'],'type':_0x532045[_0x4437('0x1b')],'sectionId':_0x532045['id']},{})[_0x4437('0x1e')](function(){return _0x56feb8;});}else{return _0x56feb8;}})[_0x4437('0x37')](function(_0x20327a){logger[_0x4437('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20327a);throw _0x20327a;});}return _0x56feb8;})['then'](respondWithResult(_0x222ef3,0xc9))[_0x4437('0x37')](handleError(_0x222ef3,null));};exports[_0x4437('0x45')]=function(_0x39156b,_0x4b7205){if(_0x39156b[_0x4437('0x3d')]['id']){delete _0x39156b['body']['id'];}return db[_0x4437('0x24')]['find']({'where':{'id':_0x39156b['params']['id']}})['then'](handleEntityNotFound(_0x4b7205,null))['then'](function(_0x3ddf0d){if(_0x3ddf0d){return db[_0x4437('0x24')][_0x4437('0x45')](_[_0x4437('0x32')](_0x39156b[_0x4437('0x3d')],[_0x4437('0x3e'),'context',_0x4437('0x46'),_0x4437('0x47'),_0x4437('0x48'),'mandatoryDisposition',_0x4437('0x49')]),{'where':{'context':_0x3ddf0d[_0x4437('0x4a')],'exten':_0x3ddf0d[_0x4437('0x3e')]},'individualHooks':!![]})['then'](function(_0x418144){return _0x418144;});}return null;})[_0x4437('0x1e')](respondWithStatusCode(_0x4b7205,null))[_0x4437('0x37')](handleError(_0x4b7205,null));};exports[_0x4437('0x4b')]=function(_0x396cf6,_0x484ae5){var _0x52a4d4=_0x396cf6['params']['id'];var _0x420a68=_0x396cf6[_0x4437('0x3d')];var _0x3e5f7c=0xc8;var _0x182651=null;return db[_0x4437('0x4c')]['transaction']({'isolationLevel':db['sequelize'][_0x4437('0x4d')]['ISOLATION_LEVELS'][_0x4437('0x4e')]},function(_0x220a35){return db[_0x4437('0x24')][_0x4437('0x4f')]({'where':{'id':_0x52a4d4},'transaction':_0x220a35})[_0x4437('0x1e')](function(_0x4c46be){if(_0x4c46be){return db[_0x4437('0x24')][_0x4437('0x1d')]({'where':{'VoiceExtensionId':_0x52a4d4},'transaction':_0x220a35})[_0x4437('0x1e')](function(){var _0xf4fc00=_[_0x4437('0x16')](_0x420a68,function(_0x20a812){_0x20a812[_0x4437('0x50')]=_0x52a4d4;_0x20a812[_0x4437('0x51')]=!![];return _0x20a812;});return _0x4c46be[_0x4437('0x52')](_0xf4fc00);})['then'](function(_0x856489){return db[_0x4437('0x24')][_0x4437('0x53')](_0x856489,{'transaction':_0x220a35});});}else{_0x3e5f7c=0x194;_0x182651=[];}});})[_0x4437('0x1e')](function(){if(_0x3e5f7c!==0x194){return db['VoiceExtension'][_0x4437('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x52a4d4},'order':_0x4437('0x55')})['then'](function(_0x4e9260){_0x182651=_0x4e9260;});}})[_0x4437('0x37')](function(_0x473e46){_0x3e5f7c=0x1f4;logger[_0x4437('0x20')](_0x473e46[_0x4437('0x21')]);if(_0x473e46[_0x4437('0x1b')]){delete _0x473e46[_0x4437('0x1b')];}_0x182651=_0x473e46;})[_0x4437('0x56')](function(){if(_0x182651===null){_0x484ae5[_0x4437('0x6')](_0x3e5f7c);}else{if(_0x3e5f7c===0x1f4){_0x484ae5[_0x4437('0x1f')](_0x3e5f7c)[_0x4437('0x22')](_0x182651);}else{_0x484ae5[_0x4437('0x1f')](_0x3e5f7c)[_0x4437('0x8')](_0x182651);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index f8dea58..c34272e 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 _0x91ce=['exports','../../mysqldb','VoiceExtension','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x91ce,0xe1));var _0xe91c=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0x91ce[_0x3653c7];return _0x58a021;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xe91c('0x0'))['db'][_0xe91c('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe91c('0x2')](0x0);var events={'afterCreate':_0xe91c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a004e){return function(_0x16b18a,_0x5a79ec,_0x2ef945){VoiceExtensionEvents[_0xe91c('0x4')](_0x5a004e+':'+_0x16b18a['id'],_0x16b18a);VoiceExtensionEvents[_0xe91c('0x4')](_0x5a004e,_0x16b18a);_0x2ef945(null);};}for(var e in events){if(events[_0xe91c('0x5')](e)){var event=events[e];VoiceExtension[_0xe91c('0x6')](e,emitEvent(event));}}module[_0xe91c('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xf7b4=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x2e5a8e,_0x478a6e){var _0x4fb29b=function(_0x55de34){while(--_0x55de34){_0x2e5a8e['push'](_0x2e5a8e['shift']());}};_0x4fb29b(++_0x478a6e);}(_0xf7b4,0xc7));var _0x4f7b=function(_0x3f4e0c,_0x46ec80){_0x3f4e0c=_0x3f4e0c-0x0;var _0x44be87=_0xf7b4[_0x3f4e0c];return _0x44be87;};'use strict';var EventEmitter=require(_0x4f7b('0x0'));var VoiceExtension=require(_0x4f7b('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4f7b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4f7b('0x3'),'afterDestroy':_0x4f7b('0x4')};function emitEvent(_0x1f1885){return function(_0x39f734,_0x1690bc,_0x59d355){VoiceExtensionEvents[_0x4f7b('0x5')](_0x1f1885+':'+_0x39f734['id'],_0x39f734);VoiceExtensionEvents[_0x4f7b('0x5')](_0x1f1885,_0x39f734);_0x59d355(null);};}for(var e in events){if(events[_0x4f7b('0x6')](e)){var event=events[e];VoiceExtension[_0x4f7b('0x7')](e,emitEvent(event));}}module[_0x4f7b('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 5bf78c3..5df8b03 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 _0x544f=['context','exten','type','alias','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','name','split','phone','param','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','filter','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','concat','catch','define','VoiceExtension','voice_extensions','get','last','Hangup','lodash','models','Set','CDR(type)='];(function(_0xf9ce3e,_0x5a4380){var _0x403ffd=function(_0x53078b){while(--_0x53078b){_0xf9ce3e['push'](_0xf9ce3e['shift']());}};_0x403ffd(++_0x5a4380);}(_0x544f,0x14c));var _0xf544=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x544f[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0xf544('0x0'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x2b9542){var _0xdc322d=_0x2b9542[_0xf544('0x1')];function _0x126d59(_0x5ef358){var _0x3aedf9=0x2;var _0x42f20a=[{'type':_0x5ef358['type'],'app':_0xf544('0x2'),'appdata':_0xf544('0x3')+_0x5ef358['type'],'context':_0x5ef358[_0xf544('0x4')],'exten':_0x5ef358[_0xf544('0x5')],'priority':_0x3aedf9++,'VoiceExtensionId':_0x5ef358['id']},{'type':_0x5ef358[_0xf544('0x6')],'app':_0x5ef358['alias']?_0xf544('0x2'):'NoOp','appdata':_0x5ef358[_0xf544('0x7')]?'CDR(routeAlias)='+_0x5ef358[_0xf544('0x7')]:'No\x20alias\x20set','context':_0x5ef358[_0xf544('0x4')],'exten':_0x5ef358['exten'],'priority':_0x3aedf9++,'VoiceExtensionId':_0x5ef358['id']}];if(_0x5ef358[_0xf544('0x6')]===_0xf544('0x8')){_0x42f20a[_0xf544('0x9')]({'type':_0xf544('0x8'),'app':_0xf544('0x2'),'appdata':_0xf544('0xa')+_0x5ef358['id'],'context':_0x5ef358[_0xf544('0x4')],'exten':_0x5ef358[_0xf544('0x5')],'priority':_0x3aedf9++,'VoiceExtensionId':_0x5ef358['id']});}_0x42f20a['push']({'type':_0x5ef358[_0xf544('0x6')],'app':_0xf544('0x2'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x5ef358['context'],'exten':_0x5ef358['exten'],'priority':_0x3aedf9++,'VoiceExtensionId':_0x5ef358['id']},{'type':_0x5ef358[_0xf544('0x6')],'app':'Set','appdata':_0xf544('0xb'),'context':_0x5ef358['context'],'exten':_0x5ef358[_0xf544('0x5')],'priority':_0x3aedf9++,'VoiceExtensionId':_0x5ef358['id']},{'type':_0x5ef358['type'],'app':_0xf544('0x2'),'appdata':_0xf544('0xc'),'context':_0x5ef358[_0xf544('0x4')],'exten':_0x5ef358['exten'],'priority':_0x3aedf9++,'VoiceExtensionId':_0x5ef358['id']});return _0x42f20a;}function _0x44a3ee(_0x3fe118){var _0x114153=0x2;var _0x357efe=[{'type':_0xf544('0xd'),'app':_0xf544('0x2'),'appdata':_0xf544('0xe'),'context':_0x3fe118[_0xf544('0x4')],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0x3fe118[_0xf544('0x7')]?'Set':_0xf544('0xf'),'appdata':_0x3fe118[_0xf544('0x7')]?_0xf544('0x10')+_0x3fe118[_0xf544('0x7')]:'No\x20alias\x20set','context':_0x3fe118['context'],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0xf544('0x2'),'appdata':_0xf544('0x11')+(_0x3fe118[_0xf544('0x12')]?'${EXTEN:'+_0x3fe118['cutdigits']+'}':_0xf544('0x13')),'context':_0x3fe118[_0xf544('0x4')],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':'outbound','app':_0xf544('0x2'),'appdata':_0xf544('0xa')+_0x3fe118['id'],'context':_0x3fe118[_0xf544('0x4')],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0xf544('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x114153+0x2)+_0xf544('0x15')+(_0x114153+0x1)+')','context':_0x3fe118['context'],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0xf544('0x2'),'appdata':_0x3fe118[_0xf544('0x12')]?_0xf544('0x16')+_0x3fe118[_0xf544('0x12')]+'}':_0xf544('0x17'),'context':_0x3fe118[_0xf544('0x4')],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0xf544('0x2'),'appdata':_0xf544('0x18'),'context':_0x3fe118['context'],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0xf544('0x2'),'appdata':_0xf544('0xb'),'context':_0x3fe118[_0xf544('0x4')],'exten':_0x3fe118['exten'],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0xf544('0x2'),'appdata':_0xf544('0xc'),'context':_0x3fe118[_0xf544('0x4')],'exten':_0x3fe118['exten'],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':'Set','appdata':_0xf544('0x19')+_0x3fe118['id'],'context':_0x3fe118['context'],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']}];if(_0x3fe118[_0xf544('0x1a')](_0xf544('0x1b'))&&_0x3fe118['recordingFormat']!=='none'){_0x357efe[_0xf544('0x9')]({'type':'outbound','app':_0xf544('0x2'),'appdata':_0xf544('0x1c'),'context':_0x3fe118['context'],'exten':_0x3fe118['exten'],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']},{'type':_0xf544('0xd'),'app':_0xf544('0x2'),'appdata':_0xf544('0x1d')+_0x3fe118[_0xf544('0x1b')]||_0xf544('0x1e'),'context':_0x3fe118[_0xf544('0x4')],'exten':_0x3fe118[_0xf544('0x5')],'priority':_0x114153++,'VoiceExtensionId':_0x3fe118['id']});}return _0x357efe;}function _0x8e90fa(_0x25f7e8,_0xa984ba){var _0x3b0124=[{'name':_0xf544('0x1f'),'param':0x0},{'name':_0xf544('0x20'),'param':0x1},{'name':_0xf544('0x21'),'param':0x2},{'name':_0xf544('0x22'),'param':0x3}];var _0x564f25={};var _0x4c9ed9=_0xa984ba['split'](',');var _0xd57a60=[];for(var _0x314057=0x0;_0x314057<_0x3b0124[_0xf544('0x23')];_0x314057++){switch(_0x3b0124[_0x314057][_0xf544('0x24')]){case _0xf544('0x1f'):_0x564f25[_0xf544('0x1f')]=_0x4c9ed9[_0x3b0124[_0x314057]['param']][_0xf544('0x25')]('/')[0x1];_0x564f25[_0xf544('0x26')]=_0x4c9ed9[_0x3b0124[_0x314057][_0xf544('0x27')]][_0xf544('0x25')]('/')[0x2];_0x564f25['prefix']=_0x564f25['phone']?_0x564f25['phone'][_0xf544('0x25')]('$')[0x0]:undefined;_0x564f25[_0xf544('0x26')]=_0x25f7e8['cutdigits']?(_0x564f25[_0xf544('0x28')]||'')+_0xf544('0x29')+_0x25f7e8[_0xf544('0x12')]+'}':(_0x564f25[_0xf544('0x28')]||'')+_0xf544('0x13');_0xd57a60[_0x3b0124[_0x314057][_0xf544('0x27')]]=[_0xf544('0x2a'),_0x564f25['trunk'],_0x564f25[_0xf544('0x26')]][_0xf544('0x2b')]('/');break;case _0xf544('0x21'):_0x564f25[_0xf544('0x21')]=_0x4c9ed9[_0x3b0124[_0x314057][_0xf544('0x27')]];if(_0x25f7e8[_0xf544('0x1b')]!=='none'){if(_0x564f25[_0xf544('0x21')][_0xf544('0x2c')](_0xf544('0x2d'))<0x0){_0x564f25['options']+=_0xf544('0x2d');}}else{_0x564f25[_0xf544('0x21')]=_0x564f25[_0xf544('0x21')][_0xf544('0x2e')](_0xf544('0x2d'),'');}_0xd57a60[_0x3b0124[_0x314057]['param']]=_0x564f25['options'];break;default:_0xd57a60[_0x3b0124[_0x314057][_0xf544('0x27')]]=_0x4c9ed9[_0x3b0124[_0x314057]['param']];}}return _0xd57a60[_0xf544('0x2b')](',');}function _0x27789e(_0x701bef,_0x46aeb9,_0x368066){return new Promise(function(_0xd42e4e,_0x20f3b8){var _0x8ccef0=[];if(_['isEmpty'](_0x46aeb9))return _0xd42e4e(_0x8ccef0);_0xdc322d[_0xf544('0x2f')][_0xf544('0x30')]({'attributes':['id','interval',_0xf544('0x31')],'raw':!![]})[_0xf544('0x32')](function(_0x256ad8){for(var _0x384554=0x0,_0x24d55e=0x0;_0x384554<_0x46aeb9[_0xf544('0x23')];_0x384554++,_0x24d55e=0x0){var _0x35800d=_0x46aeb9[_0x384554];var _0x4975ab=[];var _0x4eb4d1=[];delete _0x35800d['id'];if(_0x35800d[_0xf544('0x33')]!==_0xf544('0x34')){_0x35800d[_0xf544('0x35')]=[_0x35800d[_0xf544('0x33')]];}else{_0x35800d['intervals']=_0x35800d[_0xf544('0x31')]?_['map'](_[_0xf544('0x36')](_0x256ad8,{'IntervalId':_0x35800d[_0xf544('0x31')]}),_0xf544('0x33')):[];}_0x35800d[_0xf544('0x4')]=_0x701bef[_0xf544('0x4')];_0x35800d[_0xf544('0x5')]=_0x701bef[_0xf544('0x5')];if(_0x35800d[_0xf544('0x6')])_0x35800d[_0xf544('0x6')]=_0x35800d[_0xf544('0x6')][_0xf544('0x37')]();if(_0x701bef[_0xf544('0x6')]===_0xf544('0xd')){if(_0x35800d[_0xf544('0x1a')]('tag')&&_0x35800d['tag']&&_0x35800d['tag']!=='--'){_0x4975ab[_0xf544('0x9')]({'type':_0x35800d[_0xf544('0x6')]['toLowerCase'](),'app':_0xf544('0x2'),'appdata':_0xf544('0x38')+_0x35800d['tag'],'context':_0x701bef[_0xf544('0x4')],'exten':_0x701bef[_0xf544('0x5')],'priority':_0x35800d[_0xf544('0x35')][_0xf544('0x23')]+_0x368066+_0x24d55e++,'VoiceExtensionId':_0x701bef['id']});}_0x4975ab[_0xf544('0x9')]({'type':_0x35800d['type']['toLowerCase'](),'app':'ExecIf','appdata':_0xf544('0x39')+(_0x35800d[_0xf544('0x3a')]?_0xf544('0x3b')+_0x35800d['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x701bef['context'],'exten':_0x701bef[_0xf544('0x5')],'priority':_0x35800d['intervals'][_0xf544('0x23')]+_0x368066+_0x24d55e++,'VoiceExtensionId':_0x701bef['id']});}else{if(_0x35800d['hasOwnProperty'](_0xf544('0x3c'))){if([_0xf544('0x3d'),_0xf544('0x3e')][_0xf544('0x3f')](_0x35800d[_0xf544('0x40')]['toLowerCase']())&&_0x35800d[_0xf544('0x41')]!==_0xf544('0x42')){if(_0x35800d[_0xf544('0x3c')]){_0x4975ab[_0xf544('0x9')]({'type':_0x35800d[_0xf544('0x6')][_0xf544('0x37')](),'app':_0xf544('0x14'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x701bef[_0xf544('0x4')],'exten':_0x701bef[_0xf544('0x5')],'priority':_0x35800d[_0xf544('0x35')]['length']+_0x368066+_0x24d55e++,'VoiceExtensionId':_0x701bef['id']});_0x4975ab[_0xf544('0x9')]({'type':_0x35800d['type'][_0xf544('0x37')](),'app':_0xf544('0x2'),'appdata':_0xf544('0x43'),'context':_0x701bef[_0xf544('0x4')],'exten':_0x701bef['exten'],'priority':_0x35800d[_0xf544('0x35')]['length']+_0x368066+_0x24d55e++,'VoiceExtensionId':_0x701bef['id']});}else{_0x4975ab[_0xf544('0x9')]({'type':_0x35800d[_0xf544('0x6')][_0xf544('0x37')](),'app':_0xf544('0x14'),'appdata':_0xf544('0x44'),'context':_0x701bef[_0xf544('0x4')],'exten':_0x701bef[_0xf544('0x5')],'priority':_0x35800d[_0xf544('0x35')][_0xf544('0x23')]+_0x368066+_0x24d55e++,'VoiceExtensionId':_0x701bef['id']});_0x4975ab['push']({'type':_0x35800d[_0xf544('0x6')]['toLowerCase'](),'app':_0xf544('0x2'),'appdata':_0xf544('0x45'),'context':_0x701bef[_0xf544('0x4')],'exten':_0x701bef[_0xf544('0x5')],'priority':_0x35800d[_0xf544('0x35')]['length']+_0x368066+_0x24d55e++,'VoiceExtensionId':_0x701bef['id']});}}}}for(var _0x488994=0x0;_0x488994<_0x35800d[_0xf544('0x35')][_0xf544('0x23')];_0x488994++){var _0x28e438=_0x368066+_0x35800d['intervals'][_0xf544('0x23')];var _0x4507f8=_0x488994===_0x35800d[_0xf544('0x35')][_0xf544('0x23')]-0x1?_0x368066+_0x4975ab[_0xf544('0x23')]+_0x4eb4d1[_0xf544('0x23')]+0x2:_0x368066+_0x488994+0x1;_0x4975ab[_0xf544('0x46')](_0x488994,0x0,{'type':_0x701bef[_0xf544('0x6')],'app':_0xf544('0x47'),'appdata':_0x35800d[_0xf544('0x35')][_0x488994]+'?'+_0x701bef['context']+',${EXTEN},'+_0x28e438+':'+_0x701bef[_0xf544('0x4')]+_0xf544('0x48')+_0x4507f8,'exten':_0x701bef[_0xf544('0x5')],'context':_0x701bef[_0xf544('0x4')],'priority':_0x368066+_0x488994,'VoiceExtensionId':_0x701bef['id']});}if(_0x35800d['appType']===_0xf544('0x49'))_0x35800d[_0xf544('0x4a')]=_0x8e90fa(_0x701bef,_0x35800d['appdata']);_0x35800d[_0xf544('0x4b')]=_0x4975ab['length']?_['last'](_0x4975ab)[_0xf544('0x4b')]+0x1:_0x368066;_0x8ccef0=_[_0xf544('0x4c')](_0x8ccef0,_0x4975ab,[_0x35800d],_0x4eb4d1);_0x368066=_['last'](_0x8ccef0)[_0xf544('0x4b')]+0x1;}return _0xd42e4e(_0x8ccef0);})[_0xf544('0x4d')](function(_0x3c04e3){_0x20f3b8(_0x3c04e3);});});}return _0x2b9542[_0xf544('0x4e')](_0xf544('0x4f'),attributes,{'tableName':_0xf544('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x14f8a0){var _0x1bb50b=this[_0xf544('0x51')]({'plain':!![]});var _0x4a3f11=_0x1bb50b[_0xf544('0x6')]==='outbound'?_0x44a3ee(_0x1bb50b):_0x126d59(_0x1bb50b);return _0x27789e(_0x1bb50b,_0x14f8a0,_[_0xf544('0x52')](_0x4a3f11)[_0xf544('0x4b')]+0x1)[_0xf544('0x32')](function(_0x140435){var _0x28b99=_[_0xf544('0x4c')](_0x4a3f11,_0x140435);_0x28b99[_0xf544('0x9')]({'type':_0x1bb50b[_0xf544('0x6')],'app':_0xf544('0x53'),'exten':_0x1bb50b[_0xf544('0x5')],'context':_0x1bb50b['context'],'priority':_[_0xf544('0x52')](_0x28b99)['priority']+0x1,'VoiceExtensionId':_0x1bb50b['id']});return _0x28b99;});}}});}; \ No newline at end of file +var _0x444a=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','hasOwnProperty','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','get','concat','lodash','exports','models','Set','type','context','exten','NoOp','CDR(routeAlias)=','alias','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','No\x20alias\x20set','${EXTEN:','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat'];(function(_0xe8e03c,_0x201204){var _0x4dfbde=function(_0x43b651){while(--_0x43b651){_0xe8e03c['push'](_0xe8e03c['shift']());}};_0x4dfbde(++_0x201204);}(_0x444a,0x170));var _0xa444=function(_0x802997,_0x5534a2){_0x802997=_0x802997-0x0;var _0x35c641=_0x444a[_0x802997];return _0x35c641;};'use strict';var _=require(_0xa444('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xa444('0x1')]=function(_0x30df14){var _0xb8db2e=_0x30df14[_0xa444('0x2')];function _0xc3acef(_0x1950cd){var _0x5a3426=0x2;var _0x30b1e8=[{'type':_0x1950cd['type'],'app':_0xa444('0x3'),'appdata':'CDR(type)='+_0x1950cd[_0xa444('0x4')],'context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']},{'type':_0x1950cd[_0xa444('0x4')],'app':_0x1950cd['alias']?_0xa444('0x3'):_0xa444('0x7'),'appdata':_0x1950cd['alias']?_0xa444('0x8')+_0x1950cd[_0xa444('0x9')]:'No\x20alias\x20set','context':_0x1950cd['context'],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']}];if(_0x1950cd['type']===_0xa444('0xa')){_0x30b1e8[_0xa444('0xb')]({'type':_0xa444('0xa'),'app':_0xa444('0x3'),'appdata':_0xa444('0xc')+_0x1950cd['id'],'context':_0x1950cd['context'],'exten':_0x1950cd['exten'],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']});}_0x30b1e8[_0xa444('0xb')]({'type':_0x1950cd['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd['exten'],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']},{'type':_0x1950cd[_0xa444('0x4')],'app':_0xa444('0x3'),'appdata':_0xa444('0xd'),'context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']},{'type':_0x1950cd[_0xa444('0x4')],'app':_0xa444('0x3'),'appdata':_0xa444('0xe'),'context':_0x1950cd[_0xa444('0x5')],'exten':_0x1950cd[_0xa444('0x6')],'priority':_0x5a3426++,'VoiceExtensionId':_0x1950cd['id']});return _0x30b1e8;}function _0x21ee23(_0x439ebe){var _0x3eef32=0x2;var _0x453be3=[{'type':'outbound','app':_0xa444('0x3'),'appdata':_0xa444('0xf'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0x439ebe['alias']?_0xa444('0x3'):_0xa444('0x7'),'appdata':_0x439ebe[_0xa444('0x9')]?'CDR(routeAlias)='+_0x439ebe[_0xa444('0x9')]:_0xa444('0x11'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':'CDR(destination)='+(_0x439ebe['cutdigits']?_0xa444('0x12')+_0x439ebe[_0xa444('0x13')]+'}':_0xa444('0x14')),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0xc')+_0x439ebe['id'],'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe['exten'],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3eef32+0x2)+_0xa444('0x16')+(_0x3eef32+0x1)+')','context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe['exten'],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':_0x439ebe['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x439ebe[_0xa444('0x13')]+'}':_0xa444('0x17'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':_0xa444('0x18'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe['exten'],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0xd'),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':'outbound','app':_0xa444('0x3'),'appdata':_0xa444('0xe'),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0x19')+_0x439ebe['id'],'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']}];if(_0x439ebe['hasOwnProperty'](_0xa444('0x1a'))&&_0x439ebe[_0xa444('0x1a')]!=='none'){_0x453be3[_0xa444('0xb')]({'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0x1b'),'context':_0x439ebe['context'],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']},{'type':_0xa444('0x10'),'app':_0xa444('0x3'),'appdata':_0xa444('0x1c')+_0x439ebe[_0xa444('0x1a')]||_0xa444('0x1d'),'context':_0x439ebe[_0xa444('0x5')],'exten':_0x439ebe[_0xa444('0x6')],'priority':_0x3eef32++,'VoiceExtensionId':_0x439ebe['id']});}return _0x453be3;}function _0x243302(_0x4e450d,_0x5984ba){var _0xed78de=[{'name':_0xa444('0x1e'),'param':0x0},{'name':_0xa444('0x1f'),'param':0x1},{'name':_0xa444('0x20'),'param':0x2},{'name':_0xa444('0x21'),'param':0x3}];var _0x8c35da={};var _0x6ca740=_0x5984ba[_0xa444('0x22')](',');var _0x2ad35f=[];for(var _0x349577=0x0;_0x349577<_0xed78de[_0xa444('0x23')];_0x349577++){switch(_0xed78de[_0x349577][_0xa444('0x24')]){case _0xa444('0x1e'):_0x8c35da['trunk']=_0x6ca740[_0xed78de[_0x349577][_0xa444('0x25')]][_0xa444('0x22')]('/')[0x1];_0x8c35da[_0xa444('0x26')]=_0x6ca740[_0xed78de[_0x349577][_0xa444('0x25')]]['split']('/')[0x2];_0x8c35da[_0xa444('0x27')]=_0x8c35da[_0xa444('0x26')]?_0x8c35da[_0xa444('0x26')][_0xa444('0x22')]('$')[0x0]:undefined;_0x8c35da[_0xa444('0x26')]=_0x4e450d[_0xa444('0x13')]?(_0x8c35da['prefix']||'')+_0xa444('0x12')+_0x4e450d[_0xa444('0x13')]+'}':(_0x8c35da[_0xa444('0x27')]||'')+_0xa444('0x14');_0x2ad35f[_0xed78de[_0x349577]['param']]=[_0xa444('0x28'),_0x8c35da[_0xa444('0x1e')],_0x8c35da['phone']][_0xa444('0x29')]('/');break;case _0xa444('0x20'):_0x8c35da[_0xa444('0x20')]=_0x6ca740[_0xed78de[_0x349577][_0xa444('0x25')]];if(_0x4e450d[_0xa444('0x1a')]!=='none'){if(_0x8c35da[_0xa444('0x20')][_0xa444('0x2a')]('U(xcally-mixmonitor-context)')<0x0){_0x8c35da[_0xa444('0x20')]+=_0xa444('0x2b');}}else{_0x8c35da[_0xa444('0x20')]=_0x8c35da[_0xa444('0x20')][_0xa444('0x2c')](_0xa444('0x2b'),'');}_0x2ad35f[_0xed78de[_0x349577][_0xa444('0x25')]]=_0x8c35da[_0xa444('0x20')];break;default:_0x2ad35f[_0xed78de[_0x349577]['param']]=_0x6ca740[_0xed78de[_0x349577]['param']];}}return _0x2ad35f[_0xa444('0x29')](',');}function _0x250108(_0x2dc082,_0x589188,_0x5a16c2){return new Promise(function(_0x1a9856,_0x4102ec){var _0x3a2168=[];if(_[_0xa444('0x2d')](_0x589188))return _0x1a9856(_0x3a2168);_0xb8db2e[_0xa444('0x2e')][_0xa444('0x2f')]({'attributes':['id',_0xa444('0x30'),_0xa444('0x31')],'raw':!![]})[_0xa444('0x32')](function(_0x586dd4){for(var _0x1e2eee=0x0,_0x3e61ce=0x0;_0x1e2eee<_0x589188[_0xa444('0x23')];_0x1e2eee++,_0x3e61ce=0x0){var _0x5c49fa=_0x589188[_0x1e2eee];var _0xbda0ea=[];var _0x56df7a=[];delete _0x5c49fa['id'];if(_0x5c49fa[_0xa444('0x30')]!==_0xa444('0x33')){_0x5c49fa[_0xa444('0x34')]=[_0x5c49fa[_0xa444('0x30')]];}else{_0x5c49fa['intervals']=_0x5c49fa[_0xa444('0x31')]?_['map'](_['filter'](_0x586dd4,{'IntervalId':_0x5c49fa['IntervalId']}),_0xa444('0x30')):[];}_0x5c49fa[_0xa444('0x5')]=_0x2dc082[_0xa444('0x5')];_0x5c49fa[_0xa444('0x6')]=_0x2dc082[_0xa444('0x6')];if(_0x5c49fa['type'])_0x5c49fa['type']=_0x5c49fa[_0xa444('0x4')]['toLowerCase']();if(_0x2dc082[_0xa444('0x4')]===_0xa444('0x10')){if(_0x5c49fa[_0xa444('0x35')](_0xa444('0x36'))&&_0x5c49fa['tag']&&_0x5c49fa[_0xa444('0x36')]!=='--'){_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')]['toLowerCase'](),'app':_0xa444('0x3'),'appdata':_0xa444('0x37')+_0x5c49fa[_0xa444('0x36')],'context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':'ExecIf','appdata':_0xa444('0x39')+(_0x5c49fa[_0xa444('0x3a')]?'Set(CALLERID(all)='+_0x5c49fa['callerID']+')':_0xa444('0x3b')),'context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa['intervals'][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}else{if(_0x5c49fa[_0xa444('0x35')](_0xa444('0x3c'))){if(['queue',_0xa444('0x3d')][_0xa444('0x3e')](_0x5c49fa['app']['toLowerCase']())&&_0x5c49fa[_0xa444('0x3f')]!==_0xa444('0x40')){if(_0x5c49fa[_0xa444('0x3c')]){_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':_0xa444('0x15'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa['type'][_0xa444('0x38')](),'app':_0xa444('0x3'),'appdata':_0xa444('0x41'),'context':_0x2dc082['context'],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}else{_0xbda0ea[_0xa444('0xb')]({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':_0xa444('0x15'),'appdata':_0xa444('0x42'),'context':_0x2dc082['context'],'exten':_0x2dc082['exten'],'priority':_0x5c49fa['intervals'][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});_0xbda0ea['push']({'type':_0x5c49fa[_0xa444('0x4')][_0xa444('0x38')](),'app':_0xa444('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2dc082[_0xa444('0x5')],'exten':_0x2dc082[_0xa444('0x6')],'priority':_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]+_0x5a16c2+_0x3e61ce++,'VoiceExtensionId':_0x2dc082['id']});}}}}for(var _0x2c906a=0x0;_0x2c906a<_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')];_0x2c906a++){var _0x4b93e2=_0x5a16c2+_0x5c49fa['intervals'][_0xa444('0x23')];var _0x2baa8c=_0x2c906a===_0x5c49fa[_0xa444('0x34')][_0xa444('0x23')]-0x1?_0x5a16c2+_0xbda0ea[_0xa444('0x23')]+_0x56df7a[_0xa444('0x23')]+0x2:_0x5a16c2+_0x2c906a+0x1;_0xbda0ea[_0xa444('0x43')](_0x2c906a,0x0,{'type':_0x2dc082[_0xa444('0x4')],'app':_0xa444('0x44'),'appdata':_0x5c49fa['intervals'][_0x2c906a]+'?'+_0x2dc082[_0xa444('0x5')]+_0xa444('0x45')+_0x4b93e2+':'+_0x2dc082[_0xa444('0x5')]+_0xa444('0x45')+_0x2baa8c,'exten':_0x2dc082[_0xa444('0x6')],'context':_0x2dc082['context'],'priority':_0x5a16c2+_0x2c906a,'VoiceExtensionId':_0x2dc082['id']});}if(_0x5c49fa[_0xa444('0x3f')]===_0xa444('0x46'))_0x5c49fa[_0xa444('0x47')]=_0x243302(_0x2dc082,_0x5c49fa[_0xa444('0x47')]);_0x5c49fa[_0xa444('0x48')]=_0xbda0ea[_0xa444('0x23')]?_[_0xa444('0x49')](_0xbda0ea)[_0xa444('0x48')]+0x1:_0x5a16c2;_0x3a2168=_['concat'](_0x3a2168,_0xbda0ea,[_0x5c49fa],_0x56df7a);_0x5a16c2=_[_0xa444('0x49')](_0x3a2168)[_0xa444('0x48')]+0x1;}return _0x1a9856(_0x3a2168);})[_0xa444('0x4a')](function(_0xb65f0c){_0x4102ec(_0xb65f0c);});});}return _0x30df14[_0xa444('0x4b')](_0xa444('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x45e270){var _0x10f933=this[_0xa444('0x4d')]({'plain':!![]});var _0x1d162b=_0x10f933[_0xa444('0x4')]==='outbound'?_0x21ee23(_0x10f933):_0xc3acef(_0x10f933);return _0x250108(_0x10f933,_0x45e270,_['last'](_0x1d162b)['priority']+0x1)['then'](function(_0x5c5e5d){var _0x4dc582=_[_0xa444('0x4e')](_0x1d162b,_0x5c5e5d);_0x4dc582[_0xa444('0xb')]({'type':_0x10f933[_0xa444('0x4')],'app':'Hangup','exten':_0x10f933['exten'],'context':_0x10f933[_0xa444('0x5')],'priority':_['last'](_0x4dc582)[_0xa444('0x48')]+0x1,'VoiceExtensionId':_0x10f933['id']});return _0x4dc582;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 634a799..fe6384e 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 _0x0d91=['stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x4af069,_0x1e6d2e){var _0x1f8344=function(_0x4905fe){while(--_0x4905fe){_0x4af069['push'](_0x4af069['shift']());}};_0x1f8344(++_0x1e6d2e);}(_0x0d91,0x76));var _0x10d9=function(_0x15d59a,_0x4b13c2){_0x15d59a=_0x15d59a-0x0;var _0x575cd5=_0x0d91[_0x15d59a];return _0x575cd5;};'use strict';var _=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var moment=require(_0x10d9('0x2'));var BPromise=require(_0x10d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10d9('0x4'));var db=require(_0x10d9('0x5'))['db'];var utils=require(_0x10d9('0x6'));var logger=require('../../config/logger')(_0x10d9('0x7'));var config=require(_0x10d9('0x8'));var jayson=require(_0x10d9('0x9'));var client=jayson['client'][_0x10d9('0xa')]({'port':0x232a});config[_0x10d9('0xb')]=_[_0x10d9('0xc')](config[_0x10d9('0xb')],{'host':_0x10d9('0xd'),'port':0x18eb});var socket=require(_0x10d9('0xe'))(new Redis(config[_0x10d9('0xb')]));require(_0x10d9('0xf'))[_0x10d9('0x10')](socket);function respondWithRpcPromise(_0x1aeeea,_0x698aa4,_0x258ecc){return new BPromise(function(_0x3fe0de,_0x2332c7){return client[_0x10d9('0x11')](_0x1aeeea,_0x258ecc)[_0x10d9('0x12')](function(_0x273a4c){logger['info'](_0x10d9('0x13'),_0x698aa4,_0x10d9('0x14'));logger[_0x10d9('0x15')](_0x10d9('0x16'),_0x698aa4,_0x10d9('0x14'),JSON['stringify'](_0x273a4c));if(_0x273a4c[_0x10d9('0x17')]){if(_0x273a4c['error'][_0x10d9('0x18')]===0x1f4){logger[_0x10d9('0x17')](_0x10d9('0x13'),_0x698aa4,_0x273a4c[_0x10d9('0x17')][_0x10d9('0x19')]);return _0x2332c7(_0x273a4c[_0x10d9('0x17')][_0x10d9('0x19')]);}logger[_0x10d9('0x17')](_0x10d9('0x13'),_0x698aa4,_0x273a4c[_0x10d9('0x17')]['message']);return _0x3fe0de(_0x273a4c['error'][_0x10d9('0x19')]);}else{logger[_0x10d9('0x1a')](_0x10d9('0x13'),_0x698aa4,_0x10d9('0x14'));_0x3fe0de(_0x273a4c['result'][_0x10d9('0x19')]);}})[_0x10d9('0x1b')](function(_0x1cff55){logger[_0x10d9('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x698aa4,_0x1cff55);_0x2332c7(_0x1cff55);});});}exports[_0x10d9('0x1c')]=function(_0xff164e){var _0x554d42=this;return new Promise(function(_0x538d5d,_0x25f950){return db['VoiceExtension'][_0x10d9('0x1d')]({'raw':_0xff164e[_0x10d9('0x1e')]?_0xff164e['options'][_0x10d9('0x1f')]===undefined?!![]:![]:!![],'where':_0xff164e[_0x10d9('0x1e')]?_0xff164e[_0x10d9('0x1e')][_0x10d9('0x20')]||null:null,'attributes':_0xff164e[_0x10d9('0x1e')]?_0xff164e[_0x10d9('0x1e')][_0x10d9('0x21')]||null:null,'limit':_0xff164e[_0x10d9('0x1e')]?_0xff164e[_0x10d9('0x1e')][_0x10d9('0x22')]||null:null,'include':_0xff164e[_0x10d9('0x1e')]?_0xff164e[_0x10d9('0x1e')][_0x10d9('0x23')]?_[_0x10d9('0x24')](_0xff164e[_0x10d9('0x1e')]['include'],function(_0x14c4ec){return{'model':db[_0x14c4ec[_0x10d9('0x25')]],'as':_0x14c4ec['as'],'attributes':_0x14c4ec[_0x10d9('0x21')],'include':_0x14c4ec[_0x10d9('0x23')]?_['map'](_0x14c4ec[_0x10d9('0x23')],function(_0x50971e){return{'model':db[_0x50971e[_0x10d9('0x25')]],'as':_0x50971e['as'],'attributes':_0x50971e[_0x10d9('0x21')],'include':_0x50971e[_0x10d9('0x23')]?_[_0x10d9('0x24')](_0x50971e['include'],function(_0x3bc593){return{'model':db[_0x3bc593['model']],'as':_0x3bc593['as'],'attributes':_0x3bc593[_0x10d9('0x21')]};}):[]};}):[]};}):[]:[]})[_0x10d9('0x12')](function(_0x1e2c7e){logger[_0x10d9('0x1a')](_0x10d9('0x1c'),_0xff164e);logger['debug']('GetVoiceExtension',_0xff164e,JSON[_0x10d9('0x26')](_0x1e2c7e));_0x538d5d(_0x1e2c7e);})[_0x10d9('0x1b')](function(_0x4f4359){logger['error'](_0x10d9('0x1c'),_0x4f4359[_0x10d9('0x19')],_0xff164e);_0x25f950(_0x554d42[_0x10d9('0x17')](0x1f4,_0x4f4359['message']));});});}; \ No newline at end of file +var _0xaaee=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','model','map','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xe7c1c,_0x1d957f){var _0x279b26=function(_0x5a0889){while(--_0x5a0889){_0xe7c1c['push'](_0xe7c1c['shift']());}};_0x279b26(++_0x1d957f);}(_0xaaee,0x132));var _0xeaae=function(_0x1ba2f4,_0x2bb422){_0x1ba2f4=_0x1ba2f4-0x0;var _0x5cba8d=_0xaaee[_0x1ba2f4];return _0x5cba8d;};'use strict';var _=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var moment=require(_0xeaae('0x2'));var BPromise=require(_0xeaae('0x3'));var rs=require(_0xeaae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaae('0x5'))['db'];var utils=require(_0xeaae('0x6'));var logger=require(_0xeaae('0x7'))(_0xeaae('0x8'));var config=require(_0xeaae('0x9'));var jayson=require(_0xeaae('0xa'));var client=jayson[_0xeaae('0xb')][_0xeaae('0xc')]({'port':0x232a});config[_0xeaae('0xd')]=_[_0xeaae('0xe')](config[_0xeaae('0xd')],{'host':_0xeaae('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeaae('0xd')]));require(_0xeaae('0x10'))['register'](socket);function respondWithRpcPromise(_0x149943,_0x295a9a,_0xc3570c){return new BPromise(function(_0x435340,_0x484be3){return client['request'](_0x149943,_0xc3570c)[_0xeaae('0x11')](function(_0x465002){logger['info'](_0xeaae('0x12'),_0x295a9a,_0xeaae('0x13'));logger[_0xeaae('0x14')](_0xeaae('0x15'),_0x295a9a,'request\x20sent',JSON[_0xeaae('0x16')](_0x465002));if(_0x465002['error']){if(_0x465002[_0xeaae('0x17')][_0xeaae('0x18')]===0x1f4){logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);return _0x484be3(_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);}logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x465002[_0xeaae('0x17')][_0xeaae('0x19')]);return _0x435340(_0x465002[_0xeaae('0x17')]['message']);}else{logger[_0xeaae('0x1a')]('VoiceExtension,\x20%s,\x20%s',_0x295a9a,_0xeaae('0x13'));_0x435340(_0x465002[_0xeaae('0x1b')][_0xeaae('0x19')]);}})[_0xeaae('0x1c')](function(_0x5ec06e){logger[_0xeaae('0x17')](_0xeaae('0x12'),_0x295a9a,_0x5ec06e);_0x484be3(_0x5ec06e);});});}exports['GetVoiceExtension']=function(_0x39ca53){var _0x367955=this;return new Promise(function(_0x344171,_0x5ced54){return db[_0xeaae('0x1d')][_0xeaae('0x1e')]({'raw':_0x39ca53['options']?_0x39ca53[_0xeaae('0x1f')][_0xeaae('0x20')]===undefined?!![]:![]:!![],'where':_0x39ca53['options']?_0x39ca53[_0xeaae('0x1f')]['where']||null:null,'attributes':_0x39ca53[_0xeaae('0x1f')]?_0x39ca53[_0xeaae('0x1f')][_0xeaae('0x21')]||null:null,'limit':_0x39ca53[_0xeaae('0x1f')]?_0x39ca53['options'][_0xeaae('0x22')]||null:null,'include':_0x39ca53[_0xeaae('0x1f')]?_0x39ca53[_0xeaae('0x1f')]['include']?_['map'](_0x39ca53[_0xeaae('0x1f')][_0xeaae('0x23')],function(_0x2d0ff4){return{'model':db[_0x2d0ff4[_0xeaae('0x24')]],'as':_0x2d0ff4['as'],'attributes':_0x2d0ff4[_0xeaae('0x21')],'include':_0x2d0ff4['include']?_[_0xeaae('0x25')](_0x2d0ff4[_0xeaae('0x23')],function(_0x54997c){return{'model':db[_0x54997c[_0xeaae('0x24')]],'as':_0x54997c['as'],'attributes':_0x54997c[_0xeaae('0x21')],'include':_0x54997c[_0xeaae('0x23')]?_[_0xeaae('0x25')](_0x54997c['include'],function(_0x3ec714){return{'model':db[_0x3ec714[_0xeaae('0x24')]],'as':_0x3ec714['as'],'attributes':_0x3ec714[_0xeaae('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14fce9){logger[_0xeaae('0x1a')](_0xeaae('0x26'),_0x39ca53);logger[_0xeaae('0x14')](_0xeaae('0x26'),_0x39ca53,JSON['stringify'](_0x14fce9));_0x344171(_0x14fce9);})[_0xeaae('0x1c')](function(_0x3b73fa){logger['error'](_0xeaae('0x26'),_0x3b73fa['message'],_0x39ca53);_0x5ced54(_0x367955[_0xeaae('0x17')](0x1f4,_0x3b73fa['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b568411..67f71f1 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 _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x4babe8,_0x165dc2){var _0xdd628a=function(_0x5c8c85){while(--_0x5c8c85){_0x4babe8['push'](_0x4babe8['shift']());}};_0xdd628a(++_0x165dc2);}(_0x1261,0x144));var _0x1126=function(_0x5e6cea,_0x24b02a){_0x5e6cea=_0x5e6cea-0x0;var _0x55a315=_0x1261[_0x5e6cea];return _0x55a315;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x7c18c0,_0x34a7ed){var _0x213e74=function(_0x34f056){while(--_0x34f056){_0x7c18c0['push'](_0x7c18c0['shift']());}};_0x213e74(++_0x34a7ed);}(_0x4975,0x86));var _0x5497=function(_0x436e2e,_0x51873f){_0x436e2e=_0x436e2e-0x0;var _0x85e897=_0x4975[_0x436e2e];return _0x85e897;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 7197f31..a483b2a 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 _0x6d38=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','/:id/messages','create','update','destroy','exports','util'];(function(_0xbbd273,_0x35ed4b){var _0x28aba2=function(_0x446fb3){while(--_0x446fb3){_0xbbd273['push'](_0xbbd273['shift']());}};_0x28aba2(++_0x35ed4b);}(_0x6d38,0x1ef));var _0x86d3=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x6d38[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x86d3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var controller=require(_0x86d3('0x6'));router['get']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0x8')]);router[_0x86d3('0x9')](_0x86d3('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x86d3('0x9')](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller['getMessages']);router['post']('/',auth[_0x86d3('0x7')](),controller[_0x86d3('0xc')]);router['put']('/:id',auth[_0x86d3('0x7')](),controller[_0x86d3('0xd')]);router['delete'](_0x86d3('0xa'),auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file +var _0x5d58=['getMessages','post','update','delete','/:id','destroy','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/messages'];(function(_0x1846e2,_0xe66a3a){var _0x626282=function(_0x3c3e01){while(--_0x3c3e01){_0x1846e2['push'](_0x1846e2['shift']());}};_0x626282(++_0xe66a3a);}(_0x5d58,0x187));var _0x85d5=function(_0x4a8feb,_0x3df985){_0x4a8feb=_0x4a8feb-0x0;var _0x3e8894=_0x5d58[_0x4a8feb];return _0x3e8894;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./voiceMail.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')]('/',auth[_0x85d5('0x5')](),controller['create']);router['put']('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0xb')]);router[_0x85d5('0xc')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);module[_0x85d5('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index afe113f..1a582b2 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 _0xdf60=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf60,0x6a));var _0x0df6=function(_0x483e40,_0x3794d4){_0x483e40=_0x483e40-0x0;var _0x86fce7=_0xdf60[_0x483e40];return _0x86fce7;};'use strict';var Sequelize=require('sequelize');module[_0x0df6('0x0')]={'customer_id':{'type':Sequelize[_0x0df6('0x1')]},'context':{'type':Sequelize[_0x0df6('0x1')],'defaultValue':_0x0df6('0x2'),'unique':_0x0df6('0x3')},'mailbox':{'type':Sequelize[_0x0df6('0x1')],'defaultValue':'','allowNull':![],'unique':_0x0df6('0x3')},'password':{'type':Sequelize[_0x0df6('0x1')]},'fullname':{'type':Sequelize[_0x0df6('0x1')]},'email':{'type':Sequelize[_0x0df6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x498f53){this[_0x0df6('0x4')](_0x0df6('0x5'),typeof _0x498f53===_0x0df6('0x6')&&_0x498f53[_0x0df6('0x7')]()?_0x498f53[_0x0df6('0x7')]():null);}},'pager':{'type':Sequelize[_0x0df6('0x1')]},'tz':{'type':Sequelize[_0x0df6('0x1')],'defaultValue':_0x0df6('0x8')},'attach':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':_0x0df6('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0df6('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0df6('0x1')]},'callback':{'type':Sequelize[_0x0df6('0x1')]},'review':{'type':Sequelize[_0x0df6('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x0df6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0df6('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':_0x0df6('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0df6('0x9')](_0x0df6('0xa'),'no'),'defaultValue':_0x0df6('0xa'),'allowNull':![]},'stamp':{'type':_0x0df6('0xc')},'emailsubject':{'type':Sequelize[_0x0df6('0x1')]},'emailbody':{'type':Sequelize[_0x0df6('0x1')]},'maxsecs':{'type':Sequelize[_0x0df6('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0df6('0xe')](_0x0df6('0xf'))+_0x0df6('0x10')+this[_0x0df6('0xe')](_0x0df6('0x11'));}}}; \ No newline at end of file +var _0x2e92=['setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox'];(function(_0x4757a7,_0x4892fc){var _0x33ae22=function(_0x3c8622){while(--_0x3c8622){_0x4757a7['push'](_0x4757a7['shift']());}};_0x33ae22(++_0x4892fc);}(_0x2e92,0x93));var _0x22e9=function(_0x5ed879,_0x5d65cd){_0x5ed879=_0x5ed879-0x0;var _0x5412d7=_0x2e92[_0x5ed879];return _0x5412d7;};'use strict';var Sequelize=require(_0x22e9('0x0'));module[_0x22e9('0x1')]={'customer_id':{'type':Sequelize[_0x22e9('0x2')]},'context':{'type':Sequelize[_0x22e9('0x2')],'defaultValue':_0x22e9('0x3'),'unique':_0x22e9('0x4')},'mailbox':{'type':Sequelize[_0x22e9('0x2')],'defaultValue':'','allowNull':![],'unique':_0x22e9('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x22e9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x13483b){this[_0x22e9('0x5')](_0x22e9('0x6'),typeof _0x13483b===_0x22e9('0x7')&&_0x13483b[_0x22e9('0x8')]()?_0x13483b[_0x22e9('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x22e9('0x2')],'defaultValue':_0x22e9('0x9')},'attach':{'type':Sequelize['ENUM'](_0x22e9('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x22e9('0xb')](_0x22e9('0xa'),'no'),'defaultValue':_0x22e9('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x22e9('0x2')]},'callback':{'type':Sequelize[_0x22e9('0x2')]},'review':{'type':Sequelize['ENUM'](_0x22e9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x22e9('0xb')](_0x22e9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x22e9('0xb')](_0x22e9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x22e9('0xb')](_0x22e9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x22e9('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x22e9('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x22e9('0xb')](_0x22e9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x22e9('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x22e9('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x22e9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x22e9('0xb')](_0x22e9('0xa'),'no'),'defaultValue':_0x22e9('0xa'),'allowNull':![]},'stamp':{'type':_0x22e9('0xd')},'emailsubject':{'type':Sequelize[_0x22e9('0x2')]},'emailbody':{'type':Sequelize[_0x22e9('0x2')]},'maxsecs':{'type':Sequelize[_0x22e9('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x22e9('0xf')],'get':function(){return this[_0x22e9('0x10')](_0x22e9('0x11'))+_0x22e9('0x12')+this[_0x22e9('0x10')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 1dd7735..7b5b169 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 _0x0713=['userProfileId','autoAssociation','getMessages','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','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','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VoiceMail','rows','catch','show','params','keys','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_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(){var _0x2793ef=_0xb05b1d[_0x3071('0x29')]({'plain':!![]});var _0x7a4cb4=_0x3071('0x2a');return db[_0x3071('0x2b')]['destroy']({'where':{'type':_0x7a4cb4,'resourceId':_0x2793ef['id']}})[_0x3071('0x27')](function(){return _0xb05b1d;});})[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb1ca,_0x28792d){return function(_0x163604){if(!_0x163604){_0x4fb1ca[_0x3071('0x2c')](0x194);}return _0x163604;};}function handleError(_0x3fa3b8,_0x25b96b){_0x25b96b=_0x25b96b||0x1f4;return function(_0x177b5f){logger[_0x3071('0x2d')](_0x177b5f[_0x3071('0x2e')]);if(_0x177b5f[_0x3071('0x2f')]){delete _0x177b5f[_0x3071('0x2f')];}_0x3fa3b8['status'](_0x25b96b)['send'](_0x177b5f);};}exports[_0x3071('0x30')]=function(_0x149e0d,_0x6ddf96){var _0x40be95={},_0x3f6d90={},_0x29538c={'count':0x0,'rows':[]};var _0x32b6b1=_[_0x3071('0x31')](db['VoiceMail']['rawAttributes'],function(_0x4ab983){return{'name':_0x4ab983[_0x3071('0x32')],'type':_0x4ab983[_0x3071('0x33')]['key']};});_0x3f6d90[_0x3071('0x34')]=_[_0x3071('0x31')](_0x32b6b1,_0x3071('0x2f'));_0x3f6d90[_0x3071('0x35')]=_['keys'](_0x149e0d[_0x3071('0x35')]);_0x3f6d90[_0x3071('0x36')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],_0x3f6d90[_0x3071('0x35')]);_0x40be95[_0x3071('0x38')]=_[_0x3071('0x37')](_0x3f6d90[_0x3071('0x34')],qs['fields'](_0x149e0d[_0x3071('0x35')]['fields']));_0x40be95['attributes']=_0x40be95[_0x3071('0x38')][_0x3071('0x39')]?_0x40be95['attributes']:_0x3f6d90[_0x3071('0x34')];if(!_0x149e0d[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x40be95[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x149e0d['query'][_0x3071('0x20')]);_0x40be95[_0x3071('0x1e')]=qs['offset'](_0x149e0d[_0x3071('0x35')]['offset']);}_0x40be95[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x149e0d['query']['sort']);_0x40be95[_0x3071('0x3e')]=qs[_0x3071('0x36')](_[_0x3071('0x3f')](_0x149e0d['query'],_0x3f6d90[_0x3071('0x36')]),_0x32b6b1);if(_0x149e0d['query'][_0x3071('0x40')]){_0x40be95['where']=_[_0x3071('0x41')](_0x40be95[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x32b6b1,function(_0x3113ef){if(_0x3113ef[_0x3071('0x33')]!=='VIRTUAL'){var _0x53ed25={};_0x53ed25[_0x3113ef[_0x3071('0x2f')]]={'$like':'%'+_0x149e0d[_0x3071('0x35')][_0x3071('0x40')]+'%'};return _0x53ed25;}})});}_0x40be95=_[_0x3071('0x41')]({},_0x40be95,_0x149e0d['options']);var _0x3cfc05={'where':_0x40be95[_0x3071('0x3e')]};return db[_0x3071('0x42')][_0x3071('0x21')](_0x3cfc05)[_0x3071('0x27')](function(_0xb9a4b8){_0x29538c['count']=_0xb9a4b8;if(_0x149e0d[_0x3071('0x35')]['includeAll']){_0x40be95['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x40be95);})[_0x3071('0x27')](function(_0x1be8b6){_0x29538c[_0x3071('0x43')]=_0x1be8b6;return _0x29538c;})[_0x3071('0x27')](respondWithFilteredResult(_0x6ddf96,_0x40be95))[_0x3071('0x44')](handleError(_0x6ddf96,null));};exports[_0x3071('0x45')]=function(_0xa711b5,_0x2e6c70){var _0x56589e={'raw':!![],'where':{'id':_0xa711b5[_0x3071('0x46')]['id']}},_0x1e8222={};_0x1e8222[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x42')]['rawAttributes']);_0x1e8222['query']=_[_0x3071('0x47')](_0xa711b5[_0x3071('0x35')]);_0x1e8222[_0x3071('0x36')]=_[_0x3071('0x37')](_0x1e8222[_0x3071('0x34')],_0x1e8222['query']);_0x56589e[_0x3071('0x38')]=_['intersection'](_0x1e8222[_0x3071('0x34')],qs['fields'](_0xa711b5['query'][_0x3071('0x48')]));_0x56589e['attributes']=_0x56589e[_0x3071('0x38')]['length']?_0x56589e[_0x3071('0x38')]:_0x1e8222[_0x3071('0x34')];if(_0xa711b5[_0x3071('0x35')][_0x3071('0x49')]){_0x56589e['include']=[{'all':!![]}];}_0x56589e=_[_0x3071('0x41')]({},_0x56589e,_0xa711b5['options']);return db[_0x3071('0x42')]['find'](_0x56589e)[_0x3071('0x27')](handleEntityNotFound(_0x2e6c70,null))[_0x3071('0x27')](respondWithResult(_0x2e6c70,null))['catch'](handleError(_0x2e6c70,null));};exports[_0x3071('0x4a')]=function(_0x117e73,_0x224a70){return db[_0x3071('0x42')][_0x3071('0x4a')](_0x117e73[_0x3071('0x4b')],{})[_0x3071('0x27')](function(_0x577060){var _0x2c6e4c=_0x117e73[_0x3071('0x4c')][_0x3071('0x29')]({'plain':!![]});if(!_0x2c6e4c)throw new Error(_0x3071('0x4d'));if(_0x2c6e4c['role']===_0x3071('0x4c')){var _0x2aea37=_0x577060[_0x3071('0x29')]({'plain':!![]});var _0x2307dd=_0x3071('0x2a');return db[_0x3071('0x4e')][_0x3071('0x4f')]({'where':{'name':_0x2307dd,'userProfileId':_0x2c6e4c[_0x3071('0x50')]},'raw':!![]})[_0x3071('0x27')](function(_0x886f7){if(_0x886f7&&_0x886f7[_0x3071('0x51')]===0x0){return db[_0x3071('0x2b')][_0x3071('0x4a')]({'name':_0x2aea37[_0x3071('0x2f')],'resourceId':_0x2aea37['id'],'type':_0x886f7[_0x3071('0x2f')],'sectionId':_0x886f7['id']},{})[_0x3071('0x27')](function(){return _0x577060;});}else{return _0x577060;}})['catch'](function(_0x47a438){logger[_0x3071('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47a438);throw _0x47a438;});}return _0x577060;})[_0x3071('0x27')](respondWithResult(_0x224a70,0xc9))[_0x3071('0x44')](handleError(_0x224a70,null));};exports[_0x3071('0x26')]=function(_0x514821,_0x1ec428){if(_0x514821[_0x3071('0x4b')]['id']){delete _0x514821['body']['id'];}return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x514821[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1ec428,null))[_0x3071('0x27')](saveUpdates(_0x514821['body'],null))[_0x3071('0x27')](respondWithResult(_0x1ec428,null))[_0x3071('0x44')](handleError(_0x1ec428,null));};exports[_0x3071('0x28')]=function(_0x41f02a,_0x123323){return db['VoiceMail'][_0x3071('0x4f')]({'where':{'id':_0x41f02a[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x123323,null))[_0x3071('0x27')](removeEntity(_0x123323,null))[_0x3071('0x44')](handleError(_0x123323,null));};exports[_0x3071('0x52')]=function(_0x71d921,_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x42')]['findOne']({'where':{'id':_0x71d921[_0x3071('0x46')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x4bea5d,null))['then'](function(_0x19dc95){var _0x1bf911;var _0x4d3886={},_0x108b14={};_0x108b14[_0x3071('0x34')]=_[_0x3071('0x47')](db[_0x3071('0x53')][_0x3071('0x54')]);_0x108b14['query']=_[_0x3071('0x47')](_0x71d921[_0x3071('0x35')]);_0x108b14[_0x3071('0x36')]=_['intersection'](_0x108b14[_0x3071('0x34')],_0x108b14[_0x3071('0x35')]);_0x4d3886[_0x3071('0x38')]=_[_0x3071('0x37')](_0x108b14[_0x3071('0x34')],qs[_0x3071('0x48')](_0x71d921[_0x3071('0x35')][_0x3071('0x48')]));_0x4d3886[_0x3071('0x38')]=_0x4d3886['attributes'][_0x3071('0x39')]?_0x4d3886[_0x3071('0x38')]:_0x108b14[_0x3071('0x34')];if(!_0x71d921[_0x3071('0x35')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x4d3886[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x71d921[_0x3071('0x35')][_0x3071('0x20')]);_0x4d3886[_0x3071('0x1e')]=qs['offset'](_0x71d921[_0x3071('0x35')][_0x3071('0x1e')]);}_0x4d3886[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x71d921[_0x3071('0x35')][_0x3071('0x3d')]);_0x4d3886[_0x3071('0x3e')]=qs[_0x3071('0x36')](_['pick'](_0x71d921[_0x3071('0x35')],_0x108b14[_0x3071('0x36')]));if(_0x71d921['query']['filter']){_0x4d3886[_0x3071('0x3e')]=_[_0x3071('0x41')](_0x4d3886[_0x3071('0x3e')],{'$or':_[_0x3071('0x31')](_0x4d3886['attributes'],function(_0x52955a){var _0x33c39a={};_0x33c39a[_0x52955a]={'$like':'%'+_0x71d921['query']['filter']+'%'};return _0x33c39a;})});}_0x4d3886['where']=_['merge'](_0x4d3886[_0x3071('0x3e')],{'mailboxuser':_0x19dc95[_0x3071('0x55')]});_0x4d3886=_[_0x3071('0x41')]({},_0x4d3886,_0x71d921['options']);return db[_0x3071('0x53')][_0x3071('0x56')](_0x4d3886)[_0x3071('0x27')](respondWithFilteredResult(_0x4bea5d,_0x4d3886));})[_0x3071('0x44')](handleError(_0x4bea5d,null));}; \ No newline at end of file +var _0x4024=['limit','count','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x342773,_0x386fd7){var _0x4f023e=function(_0x4d50f5){while(--_0x4d50f5){_0x342773['push'](_0x342773['shift']());}};_0x4f023e(++_0x386fd7);}(_0x4024,0x89));var _0x4402=function(_0x4794d7,_0x264311){_0x4794d7=_0x4794d7-0x0;var _0x21ccc7=_0x4024[_0x4794d7];return _0x21ccc7;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['VoiceMail'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['VoiceMail'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':!![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['VoiceMail'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['update']=function(_0xe8a8e9,_0x642ab4){if(_0xe8a8e9[_0x4402('0x44')]['id']){delete _0xe8a8e9[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x642ab4,null))['then'](saveUpdates(_0xe8a8e9[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x642ab4,null))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['destroy']=function(_0x5a076a,_0x258926){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x5a076a[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x258926,null))[_0x4402('0x1f')](removeEntity(_0x258926,null))[_0x4402('0x3c')](handleError(_0x258926,null));};exports[_0x4402('0x4a')]=function(_0x394ac9,_0x3f2599,_0x353679){return db[_0x4402('0x28')][_0x4402('0x4b')]({'where':{'id':_0x394ac9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x3f2599,null))['then'](function(_0xe4530a){var _0x55922e;var _0x3fb9f0={},_0x1e5891={};_0x1e5891[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x4c')][_0x4402('0x29')]);_0x1e5891['query']=_[_0x4402('0x2d')](_0x394ac9[_0x4402('0x2c')]);_0x1e5891[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],_0x1e5891['query']);_0x3fb9f0[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x394ac9[_0x4402('0x2c')][_0x4402('0x30')]));_0x3fb9f0[_0x4402('0x2f')]=_0x3fb9f0[_0x4402('0x2f')]['length']?_0x3fb9f0[_0x4402('0x2f')]:_0x1e5891[_0x4402('0x2b')];if(!_0x394ac9['query'][_0x4402('0x32')](_0x4402('0x33'))){_0x3fb9f0['limit']=qs['limit'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x19')]);_0x3fb9f0[_0x4402('0x17')]=qs['offset'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3fb9f0[_0x4402('0x4d')]=qs['sort'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x34')]);_0x3fb9f0[_0x4402('0x35')]=qs['filters'](_[_0x4402('0x4e')](_0x394ac9[_0x4402('0x2c')],_0x1e5891['filters']));if(_0x394ac9['query'][_0x4402('0x36')]){_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'$or':_['map'](_0x3fb9f0['attributes'],function(_0x432c2e){var _0x42cdd6={};_0x42cdd6[_0x432c2e]={'$like':'%'+_0x394ac9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x42cdd6;})});}_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'mailboxuser':_0xe4530a[_0x4402('0x4f')]});_0x3fb9f0=_[_0x4402('0x38')]({},_0x3fb9f0,_0x394ac9[_0x4402('0x41')]);return db[_0x4402('0x4c')][_0x4402('0x50')](_0x3fb9f0)['then'](respondWithFilteredResult(_0x3f2599,_0x3fb9f0));})[_0x4402('0x3c')](handleError(_0x3f2599,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 6ac673a..567d804 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 _0x11a3=['request-promise','path','rimraf','./voiceMail.attributes','exports','define','voice_voicemail','mailbox','lodash','util','../../config/logger','api','bluebird'];(function(_0x3ec220,_0x3956f0){var _0x3d229f=function(_0x2d5fd1){while(--_0x2d5fd1){_0x3ec220['push'](_0x3ec220['shift']());}};_0x3d229f(++_0x3956f0);}(_0x11a3,0x70));var _0x311a=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x11a3[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x311a('0x0'));var util=require(_0x311a('0x1'));var logger=require(_0x311a('0x2'))(_0x311a('0x3'));var moment=require('moment');var BPromise=require(_0x311a('0x4'));var rp=require(_0x311a('0x5'));var fs=require('fs');var path=require(_0x311a('0x6'));var rimraf=require(_0x311a('0x7'));var config=require('../../config/environment');var attributes=require(_0x311a('0x8'));module[_0x311a('0x9')]=function(_0x4baa7c,_0x25459b){return _0x4baa7c[_0x311a('0xa')]('VoiceMail',attributes,{'tableName':_0x311a('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x311a('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f30=['mailbox_context','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceMail','voice_voicemail'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f30,0xf2));var _0x00f3=function(_0x4aba66,_0x1d803d){_0x4aba66=_0x4aba66-0x0;var _0x3d7ebe=_0x0f30[_0x4aba66];return _0x3d7ebe;};'use strict';var _=require(_0x00f3('0x0'));var util=require(_0x00f3('0x1'));var logger=require(_0x00f3('0x2'))(_0x00f3('0x3'));var moment=require(_0x00f3('0x4'));var BPromise=require(_0x00f3('0x5'));var rp=require(_0x00f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00f3('0x7'));var config=require(_0x00f3('0x8'));var attributes=require('./voiceMail.attributes');module[_0x00f3('0x9')]=function(_0x11479c,_0x24b3e2){return _0x11479c[_0x00f3('0xa')](_0x00f3('0xb'),attributes,{'tableName':_0x00f3('0xc'),'paranoid':![],'indexes':[{'name':_0x00f3('0xd'),'fields':['mailbox',_0x00f3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index cde6750..b794c85 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 _0x662c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch'];(function(_0x53e334,_0x4f163e){var _0x58215b=function(_0x13af99){while(--_0x13af99){_0x53e334['push'](_0x53e334['shift']());}};_0x58215b(++_0x4f163e);}(_0x662c,0x1e4));var _0xc662=function(_0x5a7f60,_0xda4ef){_0x5a7f60=_0x5a7f60-0x0;var _0xdcd561=_0x662c[_0x5a7f60];return _0xdcd561;};'use strict';var _=require('lodash');var util=require(_0xc662('0x0'));var moment=require(_0xc662('0x1'));var BPromise=require(_0xc662('0x2'));var rs=require(_0xc662('0x3'));var fs=require('fs');var Redis=require(_0xc662('0x4'));var db=require(_0xc662('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc662('0x6'));var config=require(_0xc662('0x7'));var jayson=require(_0xc662('0x8'));var client=jayson[_0xc662('0x9')][_0xc662('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fab36,_0x344596,_0xe1a753){return new BPromise(function(_0x201b17,_0x391a51){return client['request'](_0x1fab36,_0xe1a753)[_0xc662('0xb')](function(_0xda8f26){logger[_0xc662('0xc')]('VoiceMail,\x20%s,\x20%s',_0x344596,_0xc662('0xd'));logger[_0xc662('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x344596,'request\x20sent',JSON[_0xc662('0xf')](_0xda8f26));if(_0xda8f26[_0xc662('0x10')]){if(_0xda8f26['error'][_0xc662('0x11')]===0x1f4){logger['error'](_0xc662('0x12'),_0x344596,_0xda8f26['error'][_0xc662('0x13')]);return _0x391a51(_0xda8f26['error']['message']);}logger[_0xc662('0x10')]('VoiceMail,\x20%s,\x20%s',_0x344596,_0xda8f26[_0xc662('0x10')][_0xc662('0x13')]);return _0x201b17(_0xda8f26[_0xc662('0x10')][_0xc662('0x13')]);}else{logger[_0xc662('0xc')](_0xc662('0x12'),_0x344596,_0xc662('0xd'));_0x201b17(_0xda8f26[_0xc662('0x14')][_0xc662('0x13')]);}})[_0xc662('0x15')](function(_0x5d6b73){logger[_0xc662('0x10')](_0xc662('0x12'),_0x344596,_0x5d6b73);_0x391a51(_0x5d6b73);});});} \ No newline at end of file +var _0xc486=['rpc','jayson/promise','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x186065,_0x3df78f){var _0xc16136=function(_0x511f8e){while(--_0x511f8e){_0x186065['push'](_0x186065['shift']());}};_0xc16136(++_0x3df78f);}(_0xc486,0x66));var _0x6c48=function(_0x5a06f8,_0x1ca6ae){_0x5a06f8=_0x5a06f8-0x0;var _0x5695ae=_0xc486[_0x5a06f8];return _0x5695ae;};'use strict';var _=require(_0x6c48('0x0'));var util=require('util');var moment=require(_0x6c48('0x1'));var BPromise=require(_0x6c48('0x2'));var rs=require(_0x6c48('0x3'));var fs=require('fs');var Redis=require(_0x6c48('0x4'));var db=require(_0x6c48('0x5'))['db'];var utils=require(_0x6c48('0x6'));var logger=require(_0x6c48('0x7'))(_0x6c48('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c48('0x9'));var client=jayson['client'][_0x6c48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ccc97,_0x3d90d5,_0x22b7b3){return new BPromise(function(_0x59e8d9,_0x6ce7b6){return client['request'](_0x2ccc97,_0x22b7b3)['then'](function(_0x21d716){logger[_0x6c48('0xb')](_0x6c48('0xc'),_0x3d90d5,_0x6c48('0xd'));logger[_0x6c48('0xe')](_0x6c48('0xf'),_0x3d90d5,'request\x20sent',JSON[_0x6c48('0x10')](_0x21d716));if(_0x21d716['error']){if(_0x21d716[_0x6c48('0x11')][_0x6c48('0x12')]===0x1f4){logger['error'](_0x6c48('0xc'),_0x3d90d5,_0x21d716[_0x6c48('0x11')]['message']);return _0x6ce7b6(_0x21d716[_0x6c48('0x11')][_0x6c48('0x13')]);}logger['error'](_0x6c48('0xc'),_0x3d90d5,_0x21d716['error'][_0x6c48('0x13')]);return _0x59e8d9(_0x21d716[_0x6c48('0x11')]['message']);}else{logger[_0x6c48('0xb')](_0x6c48('0xc'),_0x3d90d5,_0x6c48('0xd'));_0x59e8d9(_0x21d716[_0x6c48('0x14')][_0x6c48('0x13')]);}})[_0x6c48('0x15')](function(_0x2eb144){logger[_0x6c48('0x11')](_0x6c48('0xc'),_0x3d90d5,_0x2eb144);_0x6ce7b6(_0x2eb144);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index c667696..384a451 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 _0x6807=['../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id/download','download','create','put','/:id','update','delete','destroy','multer','path','express','Router'];(function(_0x5b0635,_0x509bf1){var _0x502113=function(_0x439bd7){while(--_0x439bd7){_0x5b0635['push'](_0x5b0635['shift']());}};_0x502113(++_0x509bf1);}(_0x6807,0x11d));var _0x7680=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x6807[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x7680('0x0'));var util=require('util');var path=require(_0x7680('0x1'));var timeout=require('connect-timeout');var express=require(_0x7680('0x2'));var router=express[_0x7680('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7680('0x4'));var config=require('../../config/environment');var controller=require(_0x7680('0x5'));router[_0x7680('0x6')]('/',auth[_0x7680('0x7')](),controller[_0x7680('0x8')]);router[_0x7680('0x6')]('/:id',auth[_0x7680('0x7')](),controller['show']);router['get'](_0x7680('0x9'),auth[_0x7680('0x7')](),controller[_0x7680('0xa')]);router['post']('/',auth[_0x7680('0x7')](),controller[_0x7680('0xb')]);router[_0x7680('0xc')](_0x7680('0xd'),auth[_0x7680('0x7')](),controller[_0x7680('0xe')]);router[_0x7680('0xf')](_0x7680('0xd'),auth[_0x7680('0x7')](),controller[_0x7680('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3e4c=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','update','delete','destroy','exports','multer'];(function(_0x24c02d,_0x540717){var _0x45ab90=function(_0x247dd1){while(--_0x247dd1){_0x24c02d['push'](_0x24c02d['shift']());}};_0x45ab90(++_0x540717);}(_0x3e4c,0x179));var _0xc3e4=function(_0xef312a,_0x1d124d){_0xef312a=_0xef312a-0x0;var _0x516d22=_0x3e4c[_0xef312a];return _0x516d22;};'use strict';var multer=require(_0xc3e4('0x0'));var util=require(_0xc3e4('0x1'));var path=require(_0xc3e4('0x2'));var timeout=require(_0xc3e4('0x3'));var express=require(_0xc3e4('0x4'));var router=express[_0xc3e4('0x5')]();var fs_extra=require(_0xc3e4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc3e4('0x7'));var config=require('../../config/environment');var controller=require(_0xc3e4('0x8'));router[_0xc3e4('0x9')]('/',auth[_0xc3e4('0xa')](),controller[_0xc3e4('0xb')]);router[_0xc3e4('0x9')](_0xc3e4('0xc'),auth[_0xc3e4('0xa')](),controller['show']);router[_0xc3e4('0x9')](_0xc3e4('0xd'),auth[_0xc3e4('0xa')](),controller[_0xc3e4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc3e4('0xf')]);router[_0xc3e4('0x10')](_0xc3e4('0xc'),auth[_0xc3e4('0xa')](),controller[_0xc3e4('0x11')]);router[_0xc3e4('0x12')](_0xc3e4('0xc'),auth[_0xc3e4('0xa')](),controller[_0xc3e4('0x13')]);module[_0xc3e4('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index c8cfcc4..d3f95b7 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 _0x366b=['INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x366b,0xd8));var _0xb366=function(_0x2331e2,_0x793c39){_0x2331e2=_0x2331e2-0x0;var _0x2bdf6d=_0x366b[_0x2331e2];return _0x2bdf6d;};'use strict';var Sequelize=require(_0xb366('0x0'));module[_0xb366('0x1')]={'name':{'type':Sequelize[_0xb366('0x2')],'get':function(_0x561a80){return this[_0xb366('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xb366('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb366('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb366('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xb366('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb366('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xb366('0x6')](_0xb366('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb366('0x5')],'defaultValue':''},'stamp':{'type':_0xb366('0x8'),'defaultValue':Sequelize[_0xb366('0x9')](_0xb366('0xa'))}}; \ No newline at end of file +var _0xa678=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','literal'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa678,0xfd));var _0x8a67=function(_0x22c9a3,_0x2911ed){_0x22c9a3=_0x22c9a3-0x0;var _0x11651b=_0xa678[_0x22c9a3];return _0x11651b;};'use strict';var Sequelize=require('sequelize');module[_0x8a67('0x0')]={'name':{'type':Sequelize[_0x8a67('0x1')],'get':function(_0x3588fe){return this[_0x8a67('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8a67('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8a67('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8a67('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8a67('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8a67('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x8a67('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8a67('0x4')],'defaultValue':''},'stamp':{'type':_0x8a67('0x6'),'defaultValue':Sequelize[_0x8a67('0x7')](_0x8a67('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b804dc5..41d65eb 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 _0x79ee=['util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','differenceBy','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x384e15,_0x1e5d30){var _0x2df7cb=function(_0x208553){while(--_0x208553){_0x384e15['push'](_0x384e15['shift']());}};_0x2df7cb(++_0x1e5d30);}(_0x79ee,0x19e));var _0xe79e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x79ee[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0xe79e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe79e('0x1'));var jsonpatch=require(_0xe79e('0x2'));var rp=require(_0xe79e('0x3'));var moment=require('moment');var BPromise=require(_0xe79e('0x4'));var Mustache=require(_0xe79e('0x5'));var util=require(_0xe79e('0x6'));var path=require(_0xe79e('0x7'));var sox=require(_0xe79e('0x8'));var csv=require('to-csv');var ejs=require(_0xe79e('0x9'));var fs=require('fs');var fs_extra=require(_0xe79e('0xa'));var _=require(_0xe79e('0xb'));var squel=require('squel');var crypto=require(_0xe79e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe79e('0xd'));var querystring=require(_0xe79e('0xe'));var Papa=require(_0xe79e('0xf'));var Redis=require('ioredis');var authService=require(_0xe79e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe79e('0x11'));var hardwareService=require(_0xe79e('0x12'));var logger=require(_0xe79e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe79e('0x14'));var licenseUtil=require(_0xe79e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x260221,_0x2b14e8){_0x2b14e8=_0x2b14e8||0xcc;return function(_0x28258a){if(_0x28258a){return _0x260221['sendStatus'](_0x2b14e8);}return _0x260221[_0xe79e('0x16')](_0x2b14e8)[_0xe79e('0x17')]();};}function respondWithResult(_0x255672,_0x429db4){_0x429db4=_0x429db4||0xc8;return function(_0x3f3d9f){if(_0x3f3d9f){return _0x255672['status'](_0x429db4)[_0xe79e('0x18')](_0x3f3d9f);}};}function respondWithFilteredResult(_0xd9a618,_0x6c71b1){return function(_0x1a4d69){if(_0x1a4d69){var _0x4caad1=typeof _0x6c71b1[_0xe79e('0x19')]===_0xe79e('0x1a')&&typeof _0x6c71b1['limit']===_0xe79e('0x1a');var _0x4da618=_0x1a4d69['count'];var _0x1023e5=_0x4caad1?0x0:_0x6c71b1[_0xe79e('0x19')];var _0x25ac76=_0x4caad1?_0x1a4d69[_0xe79e('0x1b')]:_0x6c71b1[_0xe79e('0x19')]+_0x6c71b1[_0xe79e('0x1c')];var _0x3e38c2;if(_0x25ac76>=_0x4da618){_0x25ac76=_0x4da618;_0x3e38c2=0xc8;}else{_0x3e38c2=0xce;}_0xd9a618[_0xe79e('0x16')](_0x3e38c2);return _0xd9a618[_0xe79e('0x1d')](_0xe79e('0x1e'),_0x1023e5+'-'+_0x25ac76+'/'+_0x4da618)[_0xe79e('0x18')](_0x1a4d69);}return null;};}function patchUpdates(_0x1b170c){return function(_0x2ba8ea){try{jsonpatch[_0xe79e('0x1f')](_0x2ba8ea,_0x1b170c,!![]);}catch(_0x392cf1){return BPromise[_0xe79e('0x20')](_0x392cf1);}return _0x2ba8ea[_0xe79e('0x21')]();};}function saveUpdates(_0x30962c,_0x4466f5){return function(_0x4c4dc7){if(_0x4c4dc7){return _0x4c4dc7[_0xe79e('0x22')](_0x30962c)[_0xe79e('0x23')](function(_0x4a88a3){return _0x4a88a3;});}return null;};}function removeEntity(_0x279b2f,_0x3df3c1){return function(_0x11f826){if(_0x11f826){return _0x11f826['destroy']()[_0xe79e('0x23')](function(){_0x279b2f['status'](0xcc)[_0xe79e('0x17')]();});}};}function handleEntityNotFound(_0x4f748e,_0x570ebd){return function(_0x3ba803){if(!_0x3ba803){_0x4f748e[_0xe79e('0x24')](0x194);}return _0x3ba803;};}function handleError(_0x1fcf64,_0x2bf76a){_0x2bf76a=_0x2bf76a||0x1f4;return function(_0x1a6d6f){logger[_0xe79e('0x25')](_0x1a6d6f[_0xe79e('0x26')]);if(_0x1a6d6f['name']){delete _0x1a6d6f[_0xe79e('0x27')];}_0x1fcf64[_0xe79e('0x16')](_0x2bf76a)[_0xe79e('0x28')](_0x1a6d6f);};}exports[_0xe79e('0x29')]=function(_0x568a75,_0x4b34b9){var _0x4e88c0={},_0x39be39={},_0x18a181={'count':0x0,'rows':[]};var _0x1f2cbe=_['map'](db[_0xe79e('0x2a')][_0xe79e('0x2b')],function(_0x2c7e78){return{'name':_0x2c7e78[_0xe79e('0x2c')],'type':_0x2c7e78['type']['key']};});_0x39be39['model']=_[_0xe79e('0x2d')](_[_0xe79e('0x2e')](_0x1f2cbe,_0xe79e('0x27')),['name']);_0x39be39[_0xe79e('0x2f')]=_[_0xe79e('0x30')](_0x568a75[_0xe79e('0x2f')]);_0x39be39[_0xe79e('0x31')]=_[_0xe79e('0x32')](_0x39be39['model'],_0x39be39['query']);_0x4e88c0[_0xe79e('0x33')]=_[_0xe79e('0x32')](_0x39be39[_0xe79e('0x34')],qs['fields'](_0x568a75[_0xe79e('0x2f')][_0xe79e('0x35')]));_0x4e88c0[_0xe79e('0x33')]=_0x4e88c0[_0xe79e('0x33')][_0xe79e('0x36')]?_0x4e88c0[_0xe79e('0x33')]:_0x39be39[_0xe79e('0x34')];if(!_0x568a75['query']['hasOwnProperty'](_0xe79e('0x37'))){_0x4e88c0[_0xe79e('0x1c')]=qs['limit'](_0x568a75[_0xe79e('0x2f')][_0xe79e('0x1c')]);_0x4e88c0[_0xe79e('0x19')]=qs[_0xe79e('0x19')](_0x568a75['query'][_0xe79e('0x19')]);}_0x4e88c0[_0xe79e('0x38')]=qs['sort'](_0x568a75['query']['sort']);_0x4e88c0[_0xe79e('0x39')]=qs[_0xe79e('0x31')](_[_0xe79e('0x3a')](_0x568a75[_0xe79e('0x2f')],_0x39be39['filters']),_0x1f2cbe);if(_0x568a75[_0xe79e('0x2f')]['filter']){_0x4e88c0[_0xe79e('0x39')]=_[_0xe79e('0x3b')](_0x4e88c0['where'],{'$or':_['map'](_0x1f2cbe,function(_0x4b2e4e){if(_0x4b2e4e[_0xe79e('0x3c')]!==_0xe79e('0x3d')){var _0x3fce30={};_0x3fce30[_0x4b2e4e[_0xe79e('0x27')]]={'$like':'%'+_0x568a75[_0xe79e('0x2f')][_0xe79e('0x3e')]+'%'};return _0x3fce30;}})});}_0x4e88c0=_[_0xe79e('0x3b')]({},_0x4e88c0,_0x568a75[_0xe79e('0x3f')]);var _0x2ccb12={'where':_0x4e88c0[_0xe79e('0x39')]};return db[_0xe79e('0x2a')][_0xe79e('0x1b')](_0x2ccb12)[_0xe79e('0x23')](function(_0x5eb44a){_0x18a181[_0xe79e('0x1b')]=_0x5eb44a;if(_0x568a75[_0xe79e('0x2f')][_0xe79e('0x40')]){_0x4e88c0[_0xe79e('0x41')]=[{'all':!![]}];}return db[_0xe79e('0x2a')]['findAll'](_0x4e88c0);})[_0xe79e('0x23')](function(_0x1a4a1c){_0x18a181[_0xe79e('0x42')]=_0x1a4a1c;return _0x18a181;})[_0xe79e('0x23')](respondWithFilteredResult(_0x4b34b9,_0x4e88c0))[_0xe79e('0x43')](handleError(_0x4b34b9,null));};exports[_0xe79e('0x44')]=function(_0xabe3f4,_0x32302f){var _0x3df4b7={'raw':!![],'where':{'id':_0xabe3f4[_0xe79e('0x45')]['id']}},_0x9a5030={};_0x9a5030[_0xe79e('0x34')]=_['keys'](db[_0xe79e('0x2a')][_0xe79e('0x2b')]);_0x9a5030[_0xe79e('0x2f')]=_['keys'](_0xabe3f4['query']);_0x9a5030['filters']=_[_0xe79e('0x32')](_0x9a5030[_0xe79e('0x34')],_0x9a5030[_0xe79e('0x2f')]);_0x3df4b7[_0xe79e('0x33')]=_[_0xe79e('0x32')](_0x9a5030[_0xe79e('0x34')],qs[_0xe79e('0x35')](_0xabe3f4[_0xe79e('0x2f')][_0xe79e('0x35')]));_0x3df4b7[_0xe79e('0x33')]=_0x3df4b7[_0xe79e('0x33')]['length']?_0x3df4b7[_0xe79e('0x33')]:_0x9a5030[_0xe79e('0x34')];if(_0xabe3f4[_0xe79e('0x2f')]['includeAll']){_0x3df4b7[_0xe79e('0x41')]=[{'all':!![]}];}_0x3df4b7=_[_0xe79e('0x3b')]({},_0x3df4b7,_0xabe3f4[_0xe79e('0x3f')]);return db[_0xe79e('0x2a')][_0xe79e('0x46')](_0x3df4b7)[_0xe79e('0x23')](handleEntityNotFound(_0x32302f,null))['then'](respondWithResult(_0x32302f,null))['catch'](handleError(_0x32302f,null));};exports['create']=function(_0x269508,_0xbfe0db){return db[_0xe79e('0x2a')][_0xe79e('0x47')](_0x269508[_0xe79e('0x48')],{})['then'](respondWithResult(_0xbfe0db,0xc9))[_0xe79e('0x43')](handleError(_0xbfe0db,null));};exports[_0xe79e('0x22')]=function(_0x52a9db,_0x78a9c3){if(_0x52a9db[_0xe79e('0x48')]['id']){delete _0x52a9db['body']['id'];}return db[_0xe79e('0x2a')]['find']({'where':{'id':_0x52a9db[_0xe79e('0x45')]['id']}})[_0xe79e('0x23')](handleEntityNotFound(_0x78a9c3,null))[_0xe79e('0x23')](saveUpdates(_0x52a9db[_0xe79e('0x48')],null))['then'](respondWithResult(_0x78a9c3,null))[_0xe79e('0x43')](handleError(_0x78a9c3,null));};exports['destroy']=function(_0x27fcd2,_0x4b35a4){return db[_0xe79e('0x2a')][_0xe79e('0x46')]({'where':{'id':_0x27fcd2[_0xe79e('0x45')]['id']}})[_0xe79e('0x23')](handleEntityNotFound(_0x4b35a4,null))['then'](removeEntity(_0x4b35a4,null))['catch'](handleError(_0x4b35a4,null));};exports[_0xe79e('0x49')]=function(_0x512701,_0x3aa01f,_0xf3faf){return db['VoiceMailMessage'][_0xe79e('0x46')]({'where':{'id':_0x512701['params']['id']},'attributes':['id',_0xe79e('0x4a'),_0xe79e('0x4b')]})[_0xe79e('0x23')](handleEntityNotFound(_0x3aa01f,null))[_0xe79e('0x23')](function(_0x597b5d){if(_0x597b5d){if(!_0x597b5d[_0xe79e('0x4a')]){throw new db[(_0xe79e('0x4c'))][(_0xe79e('0x4d'))](_0xe79e('0x4e'));}var _0x2e333c={'Content-Type':_0xe79e('0x4f'),'Content-Disposition':_0xe79e('0x50')};if(_0x597b5d[_0xe79e('0x4b')]){_0x2e333c[_0xe79e('0x51')]=_0xe79e('0x52')+_0x597b5d[_0xe79e('0x4b')]+_0xe79e('0x53');}_0x3aa01f[_0xe79e('0x1d')](_0x2e333c);return _0x3aa01f[_0xe79e('0x28')](new Buffer(_0x597b5d['recording']));}})[_0xe79e('0x43')](handleError(_0x3aa01f,null));}; \ No newline at end of file +var _0xd080=['audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','intersection','include','find','create','body','update','params','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found'];(function(_0x5990cf,_0x283c5d){var _0x4bcee2=function(_0x560fdf){while(--_0x560fdf){_0x5990cf['push'](_0x5990cf['shift']());}};_0x4bcee2(++_0x283c5d);}(_0xd080,0x101));var _0x0d08=function(_0x2a5adc,_0x4da42a){_0x2a5adc=_0x2a5adc-0x0;var _0x29e8a6=_0xd080[_0x2a5adc];return _0x29e8a6;};'use strict';var emlformat=require(_0x0d08('0x0'));var rimraf=require(_0x0d08('0x1'));var zipdir=require(_0x0d08('0x2'));var jsonpatch=require(_0x0d08('0x3'));var rp=require('request-promise');var moment=require(_0x0d08('0x4'));var BPromise=require(_0x0d08('0x5'));var Mustache=require('mustache');var util=require(_0x0d08('0x6'));var path=require(_0x0d08('0x7'));var sox=require(_0x0d08('0x8'));var csv=require(_0x0d08('0x9'));var ejs=require(_0x0d08('0xa'));var fs=require('fs');var fs_extra=require(_0x0d08('0xb'));var _=require(_0x0d08('0xc'));var squel=require(_0x0d08('0xd'));var crypto=require(_0x0d08('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0d08('0xf'));var toCsv=require(_0x0d08('0x9'));var querystring=require('querystring');var Papa=require(_0x0d08('0x10'));var Redis=require(_0x0d08('0x11'));var authService=require(_0x0d08('0x12'));var qs=require(_0x0d08('0x13'));var as=require(_0x0d08('0x14'));var hardwareService=require(_0x0d08('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0d08('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0d08('0x17'));var db=require(_0x0d08('0x18'))['db'];function respondWithStatusCode(_0x59b8d2,_0xb3c81d){_0xb3c81d=_0xb3c81d||0xcc;return function(_0xd9a7cd){if(_0xd9a7cd){return _0x59b8d2[_0x0d08('0x19')](_0xb3c81d);}return _0x59b8d2[_0x0d08('0x1a')](_0xb3c81d)[_0x0d08('0x1b')]();};}function respondWithResult(_0x5c1706,_0x11292f){_0x11292f=_0x11292f||0xc8;return function(_0x1d8b9d){if(_0x1d8b9d){return _0x5c1706[_0x0d08('0x1a')](_0x11292f)[_0x0d08('0x1c')](_0x1d8b9d);}};}function respondWithFilteredResult(_0x400160,_0x2a6551){return function(_0x1c02c8){if(_0x1c02c8){var _0x9c0f49=typeof _0x2a6551[_0x0d08('0x1d')]===_0x0d08('0x1e')&&typeof _0x2a6551[_0x0d08('0x1f')]===_0x0d08('0x1e');var _0x200fce=_0x1c02c8[_0x0d08('0x20')];var _0x4296ff=_0x9c0f49?0x0:_0x2a6551[_0x0d08('0x1d')];var _0x4b6c10=_0x9c0f49?_0x1c02c8[_0x0d08('0x20')]:_0x2a6551[_0x0d08('0x1d')]+_0x2a6551['limit'];var _0x1a7d00;if(_0x4b6c10>=_0x200fce){_0x4b6c10=_0x200fce;_0x1a7d00=0xc8;}else{_0x1a7d00=0xce;}_0x400160[_0x0d08('0x1a')](_0x1a7d00);return _0x400160['set'](_0x0d08('0x21'),_0x4296ff+'-'+_0x4b6c10+'/'+_0x200fce)[_0x0d08('0x1c')](_0x1c02c8);}return null;};}function patchUpdates(_0x2f22b0){return function(_0x2dd035){try{jsonpatch[_0x0d08('0x22')](_0x2dd035,_0x2f22b0,!![]);}catch(_0x323d5b){return BPromise[_0x0d08('0x23')](_0x323d5b);}return _0x2dd035[_0x0d08('0x24')]();};}function saveUpdates(_0xd3e541,_0x1cc156){return function(_0x61d23f){if(_0x61d23f){return _0x61d23f['update'](_0xd3e541)[_0x0d08('0x25')](function(_0x523e71){return _0x523e71;});}return null;};}function removeEntity(_0x5546dc,_0x5dfb97){return function(_0x610492){if(_0x610492){return _0x610492[_0x0d08('0x26')]()[_0x0d08('0x25')](function(){_0x5546dc['status'](0xcc)[_0x0d08('0x1b')]();});}};}function handleEntityNotFound(_0x23367c,_0x31a6cc){return function(_0x39ea1a){if(!_0x39ea1a){_0x23367c[_0x0d08('0x19')](0x194);}return _0x39ea1a;};}function handleError(_0x54db83,_0x266c12){_0x266c12=_0x266c12||0x1f4;return function(_0x28ecca){logger['error'](_0x28ecca['stack']);if(_0x28ecca[_0x0d08('0x27')]){delete _0x28ecca['name'];}_0x54db83[_0x0d08('0x1a')](_0x266c12)[_0x0d08('0x28')](_0x28ecca);};}exports['index']=function(_0x2fe30a,_0x10071d){var _0x4b6c1c={},_0x18f18b={},_0xf81703={'count':0x0,'rows':[]};var _0x4ee5ad=_[_0x0d08('0x29')](db[_0x0d08('0x2a')][_0x0d08('0x2b')],function(_0x4b1846){return{'name':_0x4b1846[_0x0d08('0x2c')],'type':_0x4b1846[_0x0d08('0x2d')]['key']};});_0x18f18b[_0x0d08('0x2e')]=_[_0x0d08('0x2f')](_[_0x0d08('0x29')](_0x4ee5ad,_0x0d08('0x27')),['name']);_0x18f18b[_0x0d08('0x30')]=_[_0x0d08('0x31')](_0x2fe30a[_0x0d08('0x30')]);_0x18f18b[_0x0d08('0x32')]=_['intersection'](_0x18f18b[_0x0d08('0x2e')],_0x18f18b['query']);_0x4b6c1c[_0x0d08('0x33')]=_['intersection'](_0x18f18b[_0x0d08('0x2e')],qs[_0x0d08('0x34')](_0x2fe30a[_0x0d08('0x30')][_0x0d08('0x34')]));_0x4b6c1c[_0x0d08('0x33')]=_0x4b6c1c['attributes'][_0x0d08('0x35')]?_0x4b6c1c[_0x0d08('0x33')]:_0x18f18b['model'];if(!_0x2fe30a[_0x0d08('0x30')][_0x0d08('0x36')](_0x0d08('0x37'))){_0x4b6c1c[_0x0d08('0x1f')]=qs[_0x0d08('0x1f')](_0x2fe30a['query'][_0x0d08('0x1f')]);_0x4b6c1c[_0x0d08('0x1d')]=qs[_0x0d08('0x1d')](_0x2fe30a[_0x0d08('0x30')][_0x0d08('0x1d')]);}_0x4b6c1c['order']=qs['sort'](_0x2fe30a[_0x0d08('0x30')][_0x0d08('0x38')]);_0x4b6c1c[_0x0d08('0x39')]=qs[_0x0d08('0x32')](_[_0x0d08('0x3a')](_0x2fe30a[_0x0d08('0x30')],_0x18f18b[_0x0d08('0x32')]),_0x4ee5ad);if(_0x2fe30a[_0x0d08('0x30')][_0x0d08('0x3b')]){_0x4b6c1c[_0x0d08('0x39')]=_['merge'](_0x4b6c1c[_0x0d08('0x39')],{'$or':_[_0x0d08('0x29')](_0x4ee5ad,function(_0x50abeb){if(_0x50abeb[_0x0d08('0x2d')]!==_0x0d08('0x3c')){var _0x24459f={};_0x24459f[_0x50abeb[_0x0d08('0x27')]]={'$like':'%'+_0x2fe30a['query']['filter']+'%'};return _0x24459f;}})});}_0x4b6c1c=_[_0x0d08('0x3d')]({},_0x4b6c1c,_0x2fe30a[_0x0d08('0x3e')]);var _0x59e902={'where':_0x4b6c1c[_0x0d08('0x39')]};return db['VoiceMailMessage'][_0x0d08('0x20')](_0x59e902)[_0x0d08('0x25')](function(_0x1de47d){_0xf81703[_0x0d08('0x20')]=_0x1de47d;if(_0x2fe30a[_0x0d08('0x30')][_0x0d08('0x3f')]){_0x4b6c1c['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x0d08('0x40')](_0x4b6c1c);})[_0x0d08('0x25')](function(_0x2a93e4){_0xf81703['rows']=_0x2a93e4;return _0xf81703;})[_0x0d08('0x25')](respondWithFilteredResult(_0x10071d,_0x4b6c1c))[_0x0d08('0x41')](handleError(_0x10071d,null));};exports['show']=function(_0x23e1ef,_0x29c743){var _0x5d1e5c={'raw':!![],'where':{'id':_0x23e1ef['params']['id']}},_0x145e22={};_0x145e22['model']=_['keys'](db['VoiceMailMessage'][_0x0d08('0x2b')]);_0x145e22[_0x0d08('0x30')]=_[_0x0d08('0x31')](_0x23e1ef[_0x0d08('0x30')]);_0x145e22[_0x0d08('0x32')]=_[_0x0d08('0x42')](_0x145e22[_0x0d08('0x2e')],_0x145e22[_0x0d08('0x30')]);_0x5d1e5c[_0x0d08('0x33')]=_[_0x0d08('0x42')](_0x145e22[_0x0d08('0x2e')],qs[_0x0d08('0x34')](_0x23e1ef[_0x0d08('0x30')][_0x0d08('0x34')]));_0x5d1e5c[_0x0d08('0x33')]=_0x5d1e5c[_0x0d08('0x33')][_0x0d08('0x35')]?_0x5d1e5c[_0x0d08('0x33')]:_0x145e22[_0x0d08('0x2e')];if(_0x23e1ef[_0x0d08('0x30')][_0x0d08('0x3f')]){_0x5d1e5c[_0x0d08('0x43')]=[{'all':!![]}];}_0x5d1e5c=_[_0x0d08('0x3d')]({},_0x5d1e5c,_0x23e1ef[_0x0d08('0x3e')]);return db[_0x0d08('0x2a')][_0x0d08('0x44')](_0x5d1e5c)[_0x0d08('0x25')](handleEntityNotFound(_0x29c743,null))['then'](respondWithResult(_0x29c743,null))[_0x0d08('0x41')](handleError(_0x29c743,null));};exports[_0x0d08('0x45')]=function(_0x125e10,_0x2d0c5d){return db[_0x0d08('0x2a')][_0x0d08('0x45')](_0x125e10[_0x0d08('0x46')],{})[_0x0d08('0x25')](respondWithResult(_0x2d0c5d,0xc9))[_0x0d08('0x41')](handleError(_0x2d0c5d,null));};exports[_0x0d08('0x47')]=function(_0x5ae43c,_0x45b89d){if(_0x5ae43c[_0x0d08('0x46')]['id']){delete _0x5ae43c[_0x0d08('0x46')]['id'];}return db[_0x0d08('0x2a')][_0x0d08('0x44')]({'where':{'id':_0x5ae43c[_0x0d08('0x48')]['id']}})[_0x0d08('0x25')](handleEntityNotFound(_0x45b89d,null))[_0x0d08('0x25')](saveUpdates(_0x5ae43c[_0x0d08('0x46')],null))[_0x0d08('0x25')](respondWithResult(_0x45b89d,null))[_0x0d08('0x41')](handleError(_0x45b89d,null));};exports[_0x0d08('0x26')]=function(_0x3e8074,_0x36897d){return db[_0x0d08('0x2a')][_0x0d08('0x44')]({'where':{'id':_0x3e8074[_0x0d08('0x48')]['id']}})['then'](handleEntityNotFound(_0x36897d,null))[_0x0d08('0x25')](removeEntity(_0x36897d,null))['catch'](handleError(_0x36897d,null));};exports[_0x0d08('0x49')]=function(_0x3dc3f6,_0x167a54,_0x4c5855){return db[_0x0d08('0x2a')]['find']({'where':{'id':_0x3dc3f6['params']['id']},'attributes':['id','recording',_0x0d08('0x4a')]})['then'](handleEntityNotFound(_0x167a54,null))[_0x0d08('0x25')](function(_0x4490b8){if(_0x4490b8){if(!_0x4490b8[_0x0d08('0x4b')]){throw new db[(_0x0d08('0x4c'))][(_0x0d08('0x4d'))](_0x0d08('0x4e'));}var _0x1f60c0={'Content-Type':_0x0d08('0x4f'),'Content-Disposition':_0x0d08('0x50')};if(_0x4490b8['msg_id']){_0x1f60c0[_0x0d08('0x51')]=_0x0d08('0x52')+_0x4490b8['msg_id']+'.wav\x22';}_0x167a54[_0x0d08('0x53')](_0x1f60c0);return _0x167a54['send'](new Buffer(_0x4490b8[_0x0d08('0x4b')]));}})['catch'](handleError(_0x167a54,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f88d4fd..f59027e 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 _0xd0b6=['util','../../config/logger','api','moment','bluebird','request-promise','path','exports','VoiceMailMessage','dir','lodash'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xd0b6,0x1a1));var _0x6d0b=function(_0xe6164f,_0x47e826){_0xe6164f=_0xe6164f-0x0;var _0x557c61=_0xd0b6[_0xe6164f];return _0x557c61;};'use strict';var _=require(_0x6d0b('0x0'));var util=require(_0x6d0b('0x1'));var logger=require(_0x6d0b('0x2'))(_0x6d0b('0x3'));var moment=require(_0x6d0b('0x4'));var BPromise=require(_0x6d0b('0x5'));var rp=require(_0x6d0b('0x6'));var fs=require('fs');var path=require(_0x6d0b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x6d0b('0x8')]=function(_0x362884,_0xab3132){return _0x362884['define'](_0x6d0b('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x6d0b('0xa'),'fields':[_0x6d0b('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6108=['rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','util','api','moment','bluebird','request-promise','path'];(function(_0x492855,_0x47eefc){var _0x57133f=function(_0x161f35){while(--_0x161f35){_0x492855['push'](_0x492855['shift']());}};_0x57133f(++_0x47eefc);}(_0x6108,0x1a7));var _0x8610=function(_0x2ac173,_0x5c8634){_0x2ac173=_0x2ac173-0x0;var _0x358dc7=_0x6108[_0x2ac173];return _0x358dc7;};'use strict';var _=require('lodash');var util=require(_0x8610('0x0'));var logger=require('../../config/logger')(_0x8610('0x1'));var moment=require(_0x8610('0x2'));var BPromise=require(_0x8610('0x3'));var rp=require(_0x8610('0x4'));var fs=require('fs');var path=require(_0x8610('0x5'));var rimraf=require(_0x8610('0x6'));var config=require(_0x8610('0x7'));var attributes=require(_0x8610('0x8'));module[_0x8610('0x9')]=function(_0xfe4329,_0x5cca7a){return _0xfe4329['define'](_0x8610('0xa'),attributes,{'tableName':_0x8610('0xb'),'paranoid':![],'indexes':[{'name':_0x8610('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 028151c..521f9af 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 _0x2b1f=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../config/logger','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x596679,_0x17275b){var _0x370b5e=function(_0x589b4b){while(--_0x589b4b){_0x596679['push'](_0x596679['shift']());}};_0x370b5e(++_0x17275b);}(_0x2b1f,0x6e));var _0xf2b1=function(_0x4a9df3,_0x3a2a7b){_0x4a9df3=_0x4a9df3-0x0;var _0x8b555d=_0x2b1f[_0x4a9df3];return _0x8b555d;};'use strict';var _=require(_0xf2b1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf2b1('0x1'));var rs=require(_0xf2b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf2b1('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf2b1('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x17f3d9,_0x544443,_0x5c1a91){return new BPromise(function(_0x49bb74,_0x4223b3){return client[_0xf2b1('0x5')](_0x17f3d9,_0x5c1a91)[_0xf2b1('0x6')](function(_0x45c499){logger['info'](_0xf2b1('0x7'),_0x544443,_0xf2b1('0x8'));logger['debug'](_0xf2b1('0x9'),_0x544443,_0xf2b1('0x8'),JSON[_0xf2b1('0xa')](_0x45c499));if(_0x45c499[_0xf2b1('0xb')]){if(_0x45c499[_0xf2b1('0xb')][_0xf2b1('0xc')]===0x1f4){logger['error'](_0xf2b1('0x7'),_0x544443,_0x45c499[_0xf2b1('0xb')][_0xf2b1('0xd')]);return _0x4223b3(_0x45c499[_0xf2b1('0xb')][_0xf2b1('0xd')]);}logger['error'](_0xf2b1('0x7'),_0x544443,_0x45c499[_0xf2b1('0xb')]['message']);return _0x49bb74(_0x45c499[_0xf2b1('0xb')][_0xf2b1('0xd')]);}else{logger[_0xf2b1('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x544443,'request\x20sent');_0x49bb74(_0x45c499[_0xf2b1('0xf')][_0xf2b1('0xd')]);}})[_0xf2b1('0x10')](function(_0x501260){logger[_0xf2b1('0xb')](_0xf2b1('0x7'),_0x544443,_0x501260);_0x4223b3(_0x501260);});});} \ No newline at end of file +var _0x38b3=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','ioredis'];(function(_0x3e8d26,_0x39417e){var _0x46fc46=function(_0x37c744){while(--_0x37c744){_0x3e8d26['push'](_0x3e8d26['shift']());}};_0x46fc46(++_0x39417e);}(_0x38b3,0x1b5));var _0x338b=function(_0x1c1920,_0x3c932b){_0x1c1920=_0x1c1920-0x0;var _0x1c4422=_0x38b3[_0x1c1920];return _0x1c4422;};'use strict';var _=require('lodash');var util=require(_0x338b('0x0'));var moment=require('moment');var BPromise=require(_0x338b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x338b('0x2'));var db=require(_0x338b('0x3'))['db'];var utils=require(_0x338b('0x4'));var logger=require('../../config/logger')(_0x338b('0x5'));var config=require(_0x338b('0x6'));var jayson=require(_0x338b('0x7'));var client=jayson[_0x338b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f218a,_0x28d35c,_0x401314){return new BPromise(function(_0x45b08d,_0x593a5e){return client[_0x338b('0x9')](_0x2f218a,_0x401314)[_0x338b('0xa')](function(_0x342500){logger[_0x338b('0xb')](_0x338b('0xc'),_0x28d35c,'request\x20sent');logger['debug'](_0x338b('0xd'),_0x28d35c,_0x338b('0xe'),JSON['stringify'](_0x342500));if(_0x342500[_0x338b('0xf')]){if(_0x342500[_0x338b('0xf')][_0x338b('0x10')]===0x1f4){logger[_0x338b('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x28d35c,_0x342500[_0x338b('0xf')][_0x338b('0x11')]);return _0x593a5e(_0x342500[_0x338b('0xf')][_0x338b('0x11')]);}logger[_0x338b('0xf')](_0x338b('0xc'),_0x28d35c,_0x342500['error'][_0x338b('0x11')]);return _0x45b08d(_0x342500['error'][_0x338b('0x11')]);}else{logger[_0x338b('0xb')](_0x338b('0xc'),_0x28d35c,'request\x20sent');_0x45b08d(_0x342500[_0x338b('0x12')][_0x338b('0x11')]);}})[_0x338b('0x13')](function(_0x3939ab){logger[_0x338b('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x28d35c,_0x3939ab);_0x593a5e(_0x3939ab);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 66a3fd6..d28c5db 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 _0xcf16=['exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getSounds','post','/:id/sounds','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound'];(function(_0x4a0c78,_0x829cfb){var _0x36a386=function(_0x5c2bd5){while(--_0x5c2bd5){_0x4a0c78['push'](_0x4a0c78['shift']());}};_0x36a386(++_0x829cfb);}(_0xcf16,0x166));var _0x6cf1=function(_0x41456a,_0x2146dc){_0x41456a=_0x41456a-0x0;var _0x994ffb=_0xcf16[_0x41456a];return _0x994ffb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6cf1('0x0'));var express=require('express');var router=express[_0x6cf1('0x1')]();var fs_extra=require(_0x6cf1('0x2'));var auth=require(_0x6cf1('0x3'));var interaction=require(_0x6cf1('0x4'));var config=require(_0x6cf1('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x6cf1('0x6')]('/',auth['isAuthenticated'](),controller[_0x6cf1('0x7')]);router['get'](_0x6cf1('0x8'),auth[_0x6cf1('0x9')](),controller[_0x6cf1('0xa')]);router[_0x6cf1('0x6')]('/:id/sounds',auth[_0x6cf1('0x9')](),controller[_0x6cf1('0xb')]);router[_0x6cf1('0xc')]('/',auth[_0x6cf1('0x9')](),controller['create']);router['post'](_0x6cf1('0xd'),auth['isAuthenticated'](),controller[_0x6cf1('0xe')]);router['put'](_0x6cf1('0x8'),auth[_0x6cf1('0x9')](),controller[_0x6cf1('0xf')]);router[_0x6cf1('0x10')](_0x6cf1('0x8'),auth['isAuthenticated'](),controller[_0x6cf1('0x11')]);router[_0x6cf1('0x10')](_0x6cf1('0x12'),auth[_0x6cf1('0x9')](),controller[_0x6cf1('0x13')]);module[_0x6cf1('0x14')]=router; \ No newline at end of file +var _0x9ddb=['fs-extra','../../components/auth/service','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','/:id','update','destroy','delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout'];(function(_0xe53ffb,_0x2ab282){var _0x469419=function(_0x18a42d){while(--_0x18a42d){_0xe53ffb['push'](_0xe53ffb['shift']());}};_0x469419(++_0x2ab282);}(_0x9ddb,0x18c));var _0xb9dd=function(_0x583cf0,_0x5a6871){_0x583cf0=_0x583cf0-0x0;var _0x23727e=_0x9ddb[_0x583cf0];return _0x23727e;};'use strict';var multer=require(_0xb9dd('0x0'));var util=require(_0xb9dd('0x1'));var path=require(_0xb9dd('0x2'));var timeout=require(_0xb9dd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb9dd('0x4'));var auth=require(_0xb9dd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xb9dd('0x6')]('/',auth[_0xb9dd('0x7')](),controller[_0xb9dd('0x8')]);router[_0xb9dd('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xb9dd('0x9')]);router[_0xb9dd('0x6')](_0xb9dd('0xa'),auth[_0xb9dd('0x7')](),controller[_0xb9dd('0xb')]);router[_0xb9dd('0xc')]('/',auth[_0xb9dd('0x7')](),controller[_0xb9dd('0xd')]);router[_0xb9dd('0xc')](_0xb9dd('0xa'),auth[_0xb9dd('0x7')](),controller['addSound']);router['put'](_0xb9dd('0xe'),auth[_0xb9dd('0x7')](),controller[_0xb9dd('0xf')]);router['delete']('/:id',auth[_0xb9dd('0x7')](),controller[_0xb9dd('0x10')]);router[_0xb9dd('0x11')](_0xb9dd('0x12'),auth[_0xb9dd('0x7')](),controller[_0xb9dd('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 29ea25b..26ffcd8 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 _0x1ae0=['quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','custom','files','mp3nb','quietmp3nb'];(function(_0xa3c7a3,_0x384b88){var _0xe48395=function(_0xb424b4){while(--_0xb424b4){_0xa3c7a3['push'](_0xa3c7a3['shift']());}};_0xe48395(++_0x384b88);}(_0x1ae0,0x161));var _0x01ae=function(_0x187e04,_0xbfe0d5){_0x187e04=_0x187e04-0x0;var _0x4114a0=_0x1ae0[_0x187e04];return _0x4114a0;};'use strict';var Sequelize=require(_0x01ae('0x0'));module['exports']={'name':{'type':Sequelize[_0x01ae('0x1')],'allowNull':![],'unique':_0x01ae('0x2')},'mode':{'type':Sequelize['ENUM'](_0x01ae('0x3'),_0x01ae('0x4'),_0x01ae('0x5'),_0x01ae('0x6'),_0x01ae('0x7'),_0x01ae('0x8')),'allowNull':!![],'defaultValue':_0x01ae('0x4')},'directory':{'type':Sequelize[_0x01ae('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x01ae('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x01ae('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x01ae('0x1')],'allowNull':!![],'defaultValue':_0x01ae('0x9')},'format':{'type':Sequelize[_0x01ae('0x1')],'allowNull':!![]},'stamp':{'type':_0x01ae('0xa')},'defaultEntry':{'type':Sequelize[_0x01ae('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1e48=['custom','mp3nb','quietmp3nb','quietmp3','mp3','files','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x1e48,0x170));var _0x81e4=function(_0x52b91f,_0x499757){_0x52b91f=_0x52b91f-0x0;var _0x15f8f5=_0x1e48[_0x52b91f];return _0x15f8f5;};'use strict';var Sequelize=require(_0x81e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x81e4('0x1')],'allowNull':![],'unique':_0x81e4('0x2')},'mode':{'type':Sequelize[_0x81e4('0x3')](_0x81e4('0x4'),'files',_0x81e4('0x5'),_0x81e4('0x6'),_0x81e4('0x7'),_0x81e4('0x8')),'allowNull':!![],'defaultValue':_0x81e4('0x9')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x81e4('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x81e4('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x81e4('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x81e4('0xa')},'defaultEntry':{'type':Sequelize[_0x81e4('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 ebeac7c..83a96ad 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 _0x572d=['forEach','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','format','%s.%s','basename','extname','save_name','converted_format','server/files/moh','symlinkSync','message','removeSound','id2','createdAt','unlinkSync','getSounds','order','pick','eml-format','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','body','catch','create','sequelize','files','directory','join','root','mode','0777','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x572d,0xfd));var _0xd572=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x572d[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0xd572('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd572('0x1'));var moment=require('moment');var BPromise=require(_0xd572('0x2'));var Mustache=require(_0xd572('0x3'));var util=require('util');var path=require(_0xd572('0x4'));var sox=require(_0xd572('0x5'));var csv=require('to-csv');var ejs=require(_0xd572('0x6'));var fs=require('fs');var fs_extra=require(_0xd572('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd572('0x8'));var jsforce=require(_0xd572('0x9'));var deskjs=require(_0xd572('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd572('0xb'));var Papa=require(_0xd572('0xc'));var Redis=require(_0xd572('0xd'));var authService=require(_0xd572('0xe'));var qs=require(_0xd572('0xf'));var as=require(_0xd572('0x10'));var hardwareService=require(_0xd572('0x11'));var logger=require(_0xd572('0x12'))(_0xd572('0x13'));var utils=require(_0xd572('0x14'));var config=require(_0xd572('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd572('0x16'))['db'];function respondWithStatusCode(_0x52a590,_0xc10ebf){_0xc10ebf=_0xc10ebf||0xcc;return function(_0x482aad){if(_0x482aad){return _0x52a590[_0xd572('0x17')](_0xc10ebf);}return _0x52a590[_0xd572('0x18')](_0xc10ebf)[_0xd572('0x19')]();};}function respondWithResult(_0xcd7106,_0x9c4be5){_0x9c4be5=_0x9c4be5||0xc8;return function(_0x5d0288){if(_0x5d0288){return _0xcd7106['status'](_0x9c4be5)[_0xd572('0x1a')](_0x5d0288);}};}function respondWithFilteredResult(_0x281646,_0x163365){return function(_0x5a6895){if(_0x5a6895){var _0x4fe9de=typeof _0x163365['offset']===_0xd572('0x1b')&&typeof _0x163365[_0xd572('0x1c')]==='undefined';var _0x507ccd=_0x5a6895['count'];var _0x182747=_0x4fe9de?0x0:_0x163365[_0xd572('0x1d')];var _0x42e3d2=_0x4fe9de?_0x5a6895[_0xd572('0x1e')]:_0x163365[_0xd572('0x1d')]+_0x163365[_0xd572('0x1c')];var _0x574e02;if(_0x42e3d2>=_0x507ccd){_0x42e3d2=_0x507ccd;_0x574e02=0xc8;}else{_0x574e02=0xce;}_0x281646[_0xd572('0x18')](_0x574e02);return _0x281646[_0xd572('0x1f')](_0xd572('0x20'),_0x182747+'-'+_0x42e3d2+'/'+_0x507ccd)['json'](_0x5a6895);}return null;};}function patchUpdates(_0x25bd58){return function(_0x4941c4){try{jsonpatch['apply'](_0x4941c4,_0x25bd58,!![]);}catch(_0x1e85f2){return BPromise[_0xd572('0x21')](_0x1e85f2);}return _0x4941c4[_0xd572('0x22')]();};}function saveUpdates(_0x214bfa,_0x30abb9){return function(_0x520a65){if(_0x520a65){return _0x520a65[_0xd572('0x23')](_0x214bfa)[_0xd572('0x24')](function(_0x1084a8){return _0x1084a8;});}return null;};}function removeEntity(_0x2d6e21,_0x2abd59){return function(_0x1fa4f5){if(_0x1fa4f5){return _0x1fa4f5[_0xd572('0x25')]()[_0xd572('0x24')](function(){var _0x263e19=_0x1fa4f5[_0xd572('0x26')]({'plain':!![]});var _0x51e137=_0xd572('0x27');return db['UserProfileResource'][_0xd572('0x25')]({'where':{'type':_0x51e137,'resourceId':_0x263e19['id']}})['then'](function(){return _0x1fa4f5;});})['then'](function(){_0x2d6e21['status'](0xcc)[_0xd572('0x19')]();});}};}function handleEntityNotFound(_0x27e767,_0x4ade63){return function(_0x271b17){if(!_0x271b17){_0x27e767['sendStatus'](0x194);}return _0x271b17;};}function handleError(_0x598c9c,_0xdd5c05){_0xdd5c05=_0xdd5c05||0x1f4;return function(_0x284982){logger[_0xd572('0x28')](_0x284982[_0xd572('0x29')]);if(_0x284982[_0xd572('0x2a')]){delete _0x284982[_0xd572('0x2a')];}_0x598c9c[_0xd572('0x18')](_0xdd5c05)[_0xd572('0x2b')](_0x284982);};}exports[_0xd572('0x2c')]=function(_0x156418,_0x282906){var _0x275262={},_0x40f987={},_0x728690={'count':0x0,'rows':[]};var _0x3671bb=_[_0xd572('0x2d')](db[_0xd572('0x2e')][_0xd572('0x2f')],function(_0x372d00){return{'name':_0x372d00[_0xd572('0x30')],'type':_0x372d00[_0xd572('0x31')][_0xd572('0x32')]};});_0x40f987[_0xd572('0x33')]=_['map'](_0x3671bb,_0xd572('0x2a'));_0x40f987[_0xd572('0x34')]=_['keys'](_0x156418[_0xd572('0x34')]);_0x40f987['filters']=_[_0xd572('0x35')](_0x40f987[_0xd572('0x33')],_0x40f987[_0xd572('0x34')]);_0x275262[_0xd572('0x36')]=_[_0xd572('0x35')](_0x40f987[_0xd572('0x33')],qs[_0xd572('0x37')](_0x156418[_0xd572('0x34')][_0xd572('0x37')]));_0x275262[_0xd572('0x36')]=_0x275262[_0xd572('0x36')][_0xd572('0x38')]?_0x275262[_0xd572('0x36')]:_0x40f987[_0xd572('0x33')];if(!_0x156418['query'][_0xd572('0x39')]('nolimit')){_0x275262[_0xd572('0x1c')]=qs[_0xd572('0x1c')](_0x156418['query'][_0xd572('0x1c')]);_0x275262['offset']=qs[_0xd572('0x1d')](_0x156418[_0xd572('0x34')][_0xd572('0x1d')]);}_0x275262['order']=qs[_0xd572('0x3a')](_0x156418[_0xd572('0x34')]['sort']);delete _0x156418[_0xd572('0x34')][_0xd572('0x3a')];_0x275262[_0xd572('0x3b')]=qs['filters'](_['pick'](_0x156418[_0xd572('0x34')],_0x40f987[_0xd572('0x3c')]),_0x3671bb);if(_0x156418[_0xd572('0x34')][_0xd572('0x3d')]){_0x275262[_0xd572('0x3b')]=_[_0xd572('0x3e')](_0x275262[_0xd572('0x3b')],{'$or':_['map'](_0x3671bb,function(_0x4f8d40){if(_0x4f8d40['type']!==_0xd572('0x3f')){var _0x43fdc2={};_0x43fdc2[_0x4f8d40[_0xd572('0x2a')]]={'$like':'%'+_0x156418[_0xd572('0x34')][_0xd572('0x3d')]+'%'};return _0x43fdc2;}})});}_0x275262=_[_0xd572('0x3e')]({},_0x275262,_0x156418['options']);var _0x2dc538={'where':_0x275262['where']};return db[_0xd572('0x2e')][_0xd572('0x1e')](_0x2dc538)[_0xd572('0x24')](function(_0x5d14c4){_0x728690[_0xd572('0x1e')]=_0x5d14c4;if(_0x156418[_0xd572('0x34')][_0xd572('0x40')]){_0x275262[_0xd572('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xd572('0x42')](_0x275262);})[_0xd572('0x24')](function(_0x5a8d29){_0x728690[_0xd572('0x43')]=_0x5a8d29;return _0x728690;})['then'](respondWithFilteredResult(_0x282906,_0x275262))['catch'](handleError(_0x282906,null));};exports[_0xd572('0x44')]=function(_0x5231d0,_0x283efe){var _0x5e423e={'raw':![],'where':{'id':_0x5231d0[_0xd572('0x45')]['id']}},_0x54def6={};_0x54def6[_0xd572('0x33')]=_[_0xd572('0x46')](db[_0xd572('0x2e')][_0xd572('0x2f')]);_0x54def6[_0xd572('0x34')]=_[_0xd572('0x46')](_0x5231d0[_0xd572('0x34')]);_0x54def6[_0xd572('0x3c')]=_[_0xd572('0x35')](_0x54def6['model'],_0x54def6[_0xd572('0x34')]);_0x5e423e['attributes']=_[_0xd572('0x35')](_0x54def6['model'],qs[_0xd572('0x37')](_0x5231d0[_0xd572('0x34')][_0xd572('0x37')]));_0x5e423e[_0xd572('0x36')]=_0x5e423e[_0xd572('0x36')]['length']?_0x5e423e[_0xd572('0x36')]:_0x54def6[_0xd572('0x33')];if(_0x5231d0[_0xd572('0x34')][_0xd572('0x40')]){_0x5e423e['include']=[{'all':!![]}];}_0x5e423e=_[_0xd572('0x3e')]({},_0x5e423e,_0x5231d0[_0xd572('0x47')]);return db[_0xd572('0x2e')][_0xd572('0x48')](_0x5e423e)['then'](handleEntityNotFound(_0x283efe,null))[_0xd572('0x24')](respondWithResult(_0x283efe,null))['catch'](handleError(_0x283efe,null));};exports[_0xd572('0x23')]=function(_0x464b51,_0x2607c2){if(_0x464b51[_0xd572('0x49')]['id']){delete _0x464b51[_0xd572('0x49')]['id'];}return db[_0xd572('0x2e')]['find']({'where':{'id':_0x464b51[_0xd572('0x45')]['id']}})['then'](handleEntityNotFound(_0x2607c2,null))['then'](saveUpdates(_0x464b51[_0xd572('0x49')],null))[_0xd572('0x24')](respondWithResult(_0x2607c2,null))[_0xd572('0x4a')](handleError(_0x2607c2,null));};exports[_0xd572('0x4b')]=function(_0x4d742e,_0x202038,_0x39689a){return db[_0xd572('0x4c')]['transaction'](function(_0x24907b){if(_0x4d742e[_0xd572('0x49')]['mode']===_0xd572('0x4d')){_0x4d742e[_0xd572('0x49')][_0xd572('0x4e')]=path[_0xd572('0x4f')](config[_0xd572('0x50')],'server/files/moh',_0x4d742e['body'][_0xd572('0x2a')]);}return db[_0xd572('0x2e')][_0xd572('0x4b')](_0x4d742e[_0xd572('0x49')],{'transaction':_0x24907b})[_0xd572('0x24')](function(_0x4a8eb2){if(_0x4d742e[_0xd572('0x49')][_0xd572('0x51')]===_0xd572('0x4d')){fs['mkdirSync'](_0x4a8eb2[_0xd572('0x4e')],parseInt(_0xd572('0x52'),0x8));}var _0x992323=_0x4d742e[_0xd572('0x53')][_0xd572('0x26')]({'plain':!![]});if(!_0x992323)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x992323[_0xd572('0x54')]===_0xd572('0x53')){var _0x54f0da=_0x4a8eb2['get']({'plain':!![]});return db[_0xd572('0x55')][_0xd572('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x992323[_0xd572('0x56')]},'raw':!![]})[_0xd572('0x24')](function(_0xe7c18e){if(_0xe7c18e&&_0xe7c18e[_0xd572('0x57')]===0x0){return db[_0xd572('0x58')][_0xd572('0x4b')]({'name':_0x54f0da[_0xd572('0x2a')],'resourceId':_0x54f0da['id'],'type':_0xe7c18e['name'],'sectionId':_0xe7c18e['id']},{})['then'](function(){return _0x4a8eb2;});}else{return _0x4a8eb2;}})[_0xd572('0x4a')](function(_0x23a132){logger[_0xd572('0x28')](_0xd572('0x59'),_0x23a132);});}return _0x4a8eb2;});})['then'](respondWithResult(_0x202038,0xc9))['catch'](handleError(_0x202038,null));};exports[_0xd572('0x25')]=function(_0x211534,_0x4d173d,_0x57f3f1){var _0x4ee16f;return db[_0xd572('0x2e')][_0xd572('0x48')]({'where':{'id':_0x211534[_0xd572('0x45')]['id']}})[_0xd572('0x24')](function(_0x6af55d){if(_0x6af55d){return db[_0xd572('0x4c')][_0xd572('0x5a')](function(_0x40dd27){return _0x6af55d[_0xd572('0x25')]({'transaction':_0x40dd27,'raw':!![]})['then'](function(_0x1ce95a){if(_0x1ce95a['directory']){fs[_0xd572('0x5b')](_0x1ce95a['directory'])[_0xd572('0x5c')](function(_0x25fb5c){fs['unlinkSync'](path[_0xd572('0x4f')](_0x1ce95a['directory'],_0x25fb5c));});fs[_0xd572('0x5d')](_0x1ce95a[_0xd572('0x4e')]);}return _0x1ce95a;});})[_0xd572('0x4a')](function(_0x24e632){throw new db[(_0xd572('0x5e'))][(_0xd572('0x5f'))](_0x24e632['message']);});}})[_0xd572('0x24')](handleEntityNotFound(_0x4d173d,null))['then'](removeEntity(_0x4d173d,null))[_0xd572('0x4a')](handleError(_0x4d173d,null));};exports['addSound']=function(_0x1ab483,_0x1ab378,_0x448b8b){return db[_0xd572('0x4c')][_0xd572('0x5a')](function(_0x818deb){var _0x144a68;return db['VoiceMusicOnHold'][_0xd572('0x48')]({'where':{'id':_0x1ab483['params']['id']}})[_0xd572('0x24')](function(_0xbc1ee0){if(_0xbc1ee0){_0x144a68=_0xbc1ee0;return _0xbc1ee0[_0xd572('0x60')](_0x1ab483[_0xd572('0x49')]['id'],{'transaction':_0x818deb});}})[_0xd572('0x24')](function(_0x516e34){if(_0x516e34){return db[_0xd572('0x61')][_0xd572('0x62')]({'where':{'id':_0x1ab483[_0xd572('0x49')]['id']},'attributes':['id','name','save_name','converted_format','createdAt'],'raw':!![]});}})[_0xd572('0x24')](function(_0x47e44f){if(_0x47e44f){var _0x2dd1fd=path[_0xd572('0x4f')](config[_0xd572('0x50')],'server/files/sounds/converted',util[_0xd572('0x63')](_0xd572('0x64'),path[_0xd572('0x65')](_0x47e44f['save_name'],path[_0xd572('0x66')](_0x47e44f[_0xd572('0x67')])),_0x47e44f[_0xd572('0x68')]));var _0x11c006=path['join'](config['root'],_0xd572('0x69'),_0x144a68[_0xd572('0x2a')],util['format'](_0xd572('0x64'),_0x47e44f[_0xd572('0x2a')],_0x47e44f[_0xd572('0x68')]));fs[_0xd572('0x6a')](_0x2dd1fd,_0x11c006);return _0x47e44f;}})['catch'](function(_0x46f040){throw new db[(_0xd572('0x5e'))][(_0xd572('0x5f'))](_0x46f040[_0xd572('0x6b')]);});})[_0xd572('0x24')](handleEntityNotFound(_0x1ab378,null))['then'](respondWithResult(_0x1ab378,0xc9))[_0xd572('0x4a')](handleError(_0x1ab378,null));};exports[_0xd572('0x6c')]=function(_0x4c8eb0,_0x41ed85,_0x159782){return db[_0xd572('0x4c')]['transaction'](function(_0x3f26ec){var _0x3be054;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x4c8eb0['params']['id']}})[_0xd572('0x24')](handleEntityNotFound(_0x41ed85,null))['then'](function(_0x81e52d){if(_0x81e52d){_0x3be054=_0x81e52d;return _0x81e52d[_0xd572('0x6c')](_0x4c8eb0[_0xd572('0x45')][_0xd572('0x6d')]);}})[_0xd572('0x24')](function(_0x1259eb){if(_0x1259eb){return db['Sound'][_0xd572('0x62')]({'where':{'id':_0x4c8eb0[_0xd572('0x45')][_0xd572('0x6d')]},'attributes':['id',_0xd572('0x2a'),_0xd572('0x67'),'converted_format',_0xd572('0x6e')],'raw':!![]});}})[_0xd572('0x24')](function(_0x2972a6){if(_0x2972a6){fs[_0xd572('0x6f')](path['join'](_0x3be054[_0xd572('0x4e')],util[_0xd572('0x63')](_0xd572('0x64'),_0x2972a6[_0xd572('0x2a')],_0x2972a6[_0xd572('0x68')])));return _0x2972a6;}})[_0xd572('0x4a')](function(_0x1dd40a){throw new db['Sequelize'][(_0xd572('0x5f'))](_0x1dd40a['message']);});})[_0xd572('0x24')](handleEntityNotFound(_0x41ed85,null))[_0xd572('0x24')](respondWithStatusCode(_0x41ed85,0xcc))[_0xd572('0x4a')](handleError(_0x41ed85,null));};exports[_0xd572('0x70')]=function(_0x1d0fd3,_0xb162e2,_0x41cfef){var _0x544ee0={};var _0x15f0e2={};var _0xd22042;var _0x51c6fd;return db['VoiceMusicOnHold'][_0xd572('0x62')]({'where':{'id':_0x1d0fd3[_0xd572('0x45')]['id']}})[_0xd572('0x24')](handleEntityNotFound(_0xb162e2,null))[_0xd572('0x24')](function(_0x1b2ad1){if(_0x1b2ad1){_0xd22042=_0x1b2ad1;_0x15f0e2[_0xd572('0x33')]=_['keys'](db[_0xd572('0x61')][_0xd572('0x2f')]);_0x15f0e2['query']=_[_0xd572('0x46')](_0x1d0fd3[_0xd572('0x34')]);_0x15f0e2[_0xd572('0x3c')]=_[_0xd572('0x35')](_0x15f0e2['model'],_0x15f0e2['query']);_0x544ee0['attributes']=_[_0xd572('0x35')](_0x15f0e2[_0xd572('0x33')],qs[_0xd572('0x37')](_0x1d0fd3['query'][_0xd572('0x37')]));_0x544ee0[_0xd572('0x36')]=_0x544ee0[_0xd572('0x36')][_0xd572('0x38')]?_0x544ee0[_0xd572('0x36')]:_0x15f0e2['model'];_0x544ee0[_0xd572('0x71')]=qs[_0xd572('0x3a')](_0x1d0fd3['query']['sort']);_0x544ee0['where']=qs['filters'](_[_0xd572('0x72')](_0x1d0fd3[_0xd572('0x34')],_0x15f0e2[_0xd572('0x3c')]));if(_0x1d0fd3['query']['filter']){_0x544ee0[_0xd572('0x3b')]=_['merge'](_0x544ee0['where'],{'$or':_['map'](_0x544ee0['attributes'],function(_0x24ef68){var _0x1130fa={};_0x1130fa[_0x24ef68]={'$like':'%'+_0x1d0fd3[_0xd572('0x34')]['filter']+'%'};return _0x1130fa;})});}_0x544ee0=_[_0xd572('0x3e')]({},_0x544ee0,_0x1d0fd3[_0xd572('0x47')]);return _0xd22042[_0xd572('0x70')](_0x544ee0);}})[_0xd572('0x24')](function(_0x159c4a){if(_0x159c4a){_0x51c6fd=_0x159c4a['length'];if(!_0x1d0fd3['query'][_0xd572('0x39')]('nolimit')){_0x544ee0[_0xd572('0x1c')]=qs[_0xd572('0x1c')](_0x1d0fd3[_0xd572('0x34')][_0xd572('0x1c')]);_0x544ee0['offset']=qs[_0xd572('0x1d')](_0x1d0fd3[_0xd572('0x34')][_0xd572('0x1d')]);}return _0xd22042['getSounds'](_0x544ee0);}})[_0xd572('0x24')](function(_0x985d8e){if(_0x985d8e){return _0x985d8e?{'count':_0x51c6fd,'rows':_0x985d8e}:null;}})[_0xd572('0x24')](respondWithResult(_0xb162e2,null))['catch'](handleError(_0xb162e2,null));}; \ No newline at end of file +var _0x9ade=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','include','findAll','catch','params','find','body','create','sequelize','server/files/moh','mode','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','join','root','server/files/sounds/converted','%s.%s','format','converted_format','symlinkSync','removeSound','id2','createdAt','unlinkSync','getSounds','rawAttributes','options','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x5f4673,_0x59a55e){var _0x5be97=function(_0x489298){while(--_0x489298){_0x5f4673['push'](_0x5f4673['shift']());}};_0x5be97(++_0x59a55e);}(_0x9ade,0xd2));var _0xe9ad=function(_0x5d289a,_0x352880){_0x5d289a=_0x5d289a-0x0;var _0x14bd5f=_0x9ade[_0x5d289a];return _0x14bd5f;};'use strict';var emlformat=require(_0xe9ad('0x0'));var rimraf=require(_0xe9ad('0x1'));var zipdir=require(_0xe9ad('0x2'));var jsonpatch=require(_0xe9ad('0x3'));var rp=require(_0xe9ad('0x4'));var moment=require(_0xe9ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe9ad('0x6'));var util=require(_0xe9ad('0x7'));var path=require(_0xe9ad('0x8'));var sox=require(_0xe9ad('0x9'));var csv=require(_0xe9ad('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9ad('0xb'));var _=require(_0xe9ad('0xc'));var squel=require('squel');var crypto=require(_0xe9ad('0xd'));var jsforce=require(_0xe9ad('0xe'));var deskjs=require(_0xe9ad('0xf'));var toCsv=require(_0xe9ad('0xa'));var querystring=require(_0xe9ad('0x10'));var Papa=require(_0xe9ad('0x11'));var Redis=require(_0xe9ad('0x12'));var authService=require(_0xe9ad('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe9ad('0x14'));var hardwareService=require(_0xe9ad('0x15'));var logger=require('../../config/logger')(_0xe9ad('0x16'));var utils=require('../../config/utils');var config=require(_0xe9ad('0x17'));var licenseUtil=require(_0xe9ad('0x18'));var db=require(_0xe9ad('0x19'))['db'];function respondWithStatusCode(_0x2c3baf,_0x26189c){_0x26189c=_0x26189c||0xcc;return function(_0x3e9158){if(_0x3e9158){return _0x2c3baf[_0xe9ad('0x1a')](_0x26189c);}return _0x2c3baf[_0xe9ad('0x1b')](_0x26189c)[_0xe9ad('0x1c')]();};}function respondWithResult(_0x352415,_0x39ada2){_0x39ada2=_0x39ada2||0xc8;return function(_0x3eaacc){if(_0x3eaacc){return _0x352415[_0xe9ad('0x1b')](_0x39ada2)[_0xe9ad('0x1d')](_0x3eaacc);}};}function respondWithFilteredResult(_0x2d89eb,_0x10d42c){return function(_0x87ee66){if(_0x87ee66){var _0x46e50e=typeof _0x10d42c[_0xe9ad('0x1e')]===_0xe9ad('0x1f')&&typeof _0x10d42c[_0xe9ad('0x20')]===_0xe9ad('0x1f');var _0x5591dd=_0x87ee66[_0xe9ad('0x21')];var _0x55d311=_0x46e50e?0x0:_0x10d42c['offset'];var _0xd0718b=_0x46e50e?_0x87ee66[_0xe9ad('0x21')]:_0x10d42c[_0xe9ad('0x1e')]+_0x10d42c['limit'];var _0x126ebb;if(_0xd0718b>=_0x5591dd){_0xd0718b=_0x5591dd;_0x126ebb=0xc8;}else{_0x126ebb=0xce;}_0x2d89eb['status'](_0x126ebb);return _0x2d89eb[_0xe9ad('0x22')]('Content-Range',_0x55d311+'-'+_0xd0718b+'/'+_0x5591dd)['json'](_0x87ee66);}return null;};}function patchUpdates(_0x223cd8){return function(_0x41b251){try{jsonpatch[_0xe9ad('0x23')](_0x41b251,_0x223cd8,!![]);}catch(_0x9eb7cc){return BPromise[_0xe9ad('0x24')](_0x9eb7cc);}return _0x41b251[_0xe9ad('0x25')]();};}function saveUpdates(_0x255618,_0x4d13bd){return function(_0x4aed3f){if(_0x4aed3f){return _0x4aed3f[_0xe9ad('0x26')](_0x255618)[_0xe9ad('0x27')](function(_0x46ec96){return _0x46ec96;});}return null;};}function removeEntity(_0x21ba5a,_0x150a5b){return function(_0x1f9dff){if(_0x1f9dff){return _0x1f9dff[_0xe9ad('0x28')]()[_0xe9ad('0x27')](function(){var _0x1e3fbe=_0x1f9dff[_0xe9ad('0x29')]({'plain':!![]});var _0x582db2='MusicOnHolds';return db[_0xe9ad('0x2a')][_0xe9ad('0x28')]({'where':{'type':_0x582db2,'resourceId':_0x1e3fbe['id']}})[_0xe9ad('0x27')](function(){return _0x1f9dff;});})[_0xe9ad('0x27')](function(){_0x21ba5a['status'](0xcc)[_0xe9ad('0x1c')]();});}};}function handleEntityNotFound(_0x2e4fe8,_0x28d324){return function(_0x4aa802){if(!_0x4aa802){_0x2e4fe8[_0xe9ad('0x1a')](0x194);}return _0x4aa802;};}function handleError(_0x4451d0,_0x136f08){_0x136f08=_0x136f08||0x1f4;return function(_0x8ee5e8){logger[_0xe9ad('0x2b')](_0x8ee5e8[_0xe9ad('0x2c')]);if(_0x8ee5e8[_0xe9ad('0x2d')]){delete _0x8ee5e8[_0xe9ad('0x2d')];}_0x4451d0[_0xe9ad('0x1b')](_0x136f08)['send'](_0x8ee5e8);};}exports[_0xe9ad('0x2e')]=function(_0x1a3546,_0x1fb66c){var _0x1f619f={},_0x3f9006={},_0x38e641={'count':0x0,'rows':[]};var _0x1f64d7=_[_0xe9ad('0x2f')](db[_0xe9ad('0x30')]['rawAttributes'],function(_0x2a8905){return{'name':_0x2a8905[_0xe9ad('0x31')],'type':_0x2a8905[_0xe9ad('0x32')][_0xe9ad('0x33')]};});_0x3f9006[_0xe9ad('0x34')]=_[_0xe9ad('0x2f')](_0x1f64d7,_0xe9ad('0x2d'));_0x3f9006[_0xe9ad('0x35')]=_[_0xe9ad('0x36')](_0x1a3546[_0xe9ad('0x35')]);_0x3f9006[_0xe9ad('0x37')]=_['intersection'](_0x3f9006[_0xe9ad('0x34')],_0x3f9006[_0xe9ad('0x35')]);_0x1f619f[_0xe9ad('0x38')]=_[_0xe9ad('0x39')](_0x3f9006[_0xe9ad('0x34')],qs['fields'](_0x1a3546['query'][_0xe9ad('0x3a')]));_0x1f619f[_0xe9ad('0x38')]=_0x1f619f[_0xe9ad('0x38')][_0xe9ad('0x3b')]?_0x1f619f[_0xe9ad('0x38')]:_0x3f9006[_0xe9ad('0x34')];if(!_0x1a3546[_0xe9ad('0x35')]['hasOwnProperty'](_0xe9ad('0x3c'))){_0x1f619f[_0xe9ad('0x20')]=qs['limit'](_0x1a3546[_0xe9ad('0x35')]['limit']);_0x1f619f[_0xe9ad('0x1e')]=qs['offset'](_0x1a3546[_0xe9ad('0x35')]['offset']);}_0x1f619f[_0xe9ad('0x3d')]=qs[_0xe9ad('0x3e')](_0x1a3546[_0xe9ad('0x35')][_0xe9ad('0x3e')]);delete _0x1a3546['query']['sort'];_0x1f619f['where']=qs[_0xe9ad('0x37')](_[_0xe9ad('0x3f')](_0x1a3546[_0xe9ad('0x35')],_0x3f9006[_0xe9ad('0x37')]),_0x1f64d7);if(_0x1a3546[_0xe9ad('0x35')]['filter']){_0x1f619f[_0xe9ad('0x40')]=_[_0xe9ad('0x41')](_0x1f619f['where'],{'$or':_[_0xe9ad('0x2f')](_0x1f64d7,function(_0x13f14a){if(_0x13f14a[_0xe9ad('0x32')]!==_0xe9ad('0x42')){var _0x49257d={};_0x49257d[_0x13f14a[_0xe9ad('0x2d')]]={'$like':'%'+_0x1a3546[_0xe9ad('0x35')][_0xe9ad('0x43')]+'%'};return _0x49257d;}})});}_0x1f619f=_[_0xe9ad('0x41')]({},_0x1f619f,_0x1a3546['options']);var _0x5aefcd={'where':_0x1f619f[_0xe9ad('0x40')]};return db[_0xe9ad('0x30')]['count'](_0x5aefcd)[_0xe9ad('0x27')](function(_0x5f40ee){_0x38e641[_0xe9ad('0x21')]=_0x5f40ee;if(_0x1a3546[_0xe9ad('0x35')]['includeAll']){_0x1f619f[_0xe9ad('0x44')]=[{'all':!![]}];}return db[_0xe9ad('0x30')][_0xe9ad('0x45')](_0x1f619f);})[_0xe9ad('0x27')](function(_0x553fea){_0x38e641['rows']=_0x553fea;return _0x38e641;})[_0xe9ad('0x27')](respondWithFilteredResult(_0x1fb66c,_0x1f619f))[_0xe9ad('0x46')](handleError(_0x1fb66c,null));};exports['show']=function(_0x4a21a6,_0x287968){var _0x4de9b8={'raw':![],'where':{'id':_0x4a21a6[_0xe9ad('0x47')]['id']}},_0x4a1c58={};_0x4a1c58[_0xe9ad('0x34')]=_['keys'](db[_0xe9ad('0x30')]['rawAttributes']);_0x4a1c58[_0xe9ad('0x35')]=_[_0xe9ad('0x36')](_0x4a21a6[_0xe9ad('0x35')]);_0x4a1c58[_0xe9ad('0x37')]=_[_0xe9ad('0x39')](_0x4a1c58[_0xe9ad('0x34')],_0x4a1c58[_0xe9ad('0x35')]);_0x4de9b8[_0xe9ad('0x38')]=_[_0xe9ad('0x39')](_0x4a1c58[_0xe9ad('0x34')],qs[_0xe9ad('0x3a')](_0x4a21a6[_0xe9ad('0x35')][_0xe9ad('0x3a')]));_0x4de9b8[_0xe9ad('0x38')]=_0x4de9b8[_0xe9ad('0x38')][_0xe9ad('0x3b')]?_0x4de9b8['attributes']:_0x4a1c58[_0xe9ad('0x34')];if(_0x4a21a6['query']['includeAll']){_0x4de9b8[_0xe9ad('0x44')]=[{'all':!![]}];}_0x4de9b8=_['merge']({},_0x4de9b8,_0x4a21a6['options']);return db['VoiceMusicOnHold'][_0xe9ad('0x48')](_0x4de9b8)[_0xe9ad('0x27')](handleEntityNotFound(_0x287968,null))[_0xe9ad('0x27')](respondWithResult(_0x287968,null))[_0xe9ad('0x46')](handleError(_0x287968,null));};exports[_0xe9ad('0x26')]=function(_0x4cab5e,_0x1dd0d3){if(_0x4cab5e[_0xe9ad('0x49')]['id']){delete _0x4cab5e[_0xe9ad('0x49')]['id'];}return db[_0xe9ad('0x30')][_0xe9ad('0x48')]({'where':{'id':_0x4cab5e[_0xe9ad('0x47')]['id']}})[_0xe9ad('0x27')](handleEntityNotFound(_0x1dd0d3,null))[_0xe9ad('0x27')](saveUpdates(_0x4cab5e[_0xe9ad('0x49')],null))['then'](respondWithResult(_0x1dd0d3,null))[_0xe9ad('0x46')](handleError(_0x1dd0d3,null));};exports[_0xe9ad('0x4a')]=function(_0x1089b5,_0x2a8975,_0x5ba7d4){return db[_0xe9ad('0x4b')]['transaction'](function(_0x220465){if(_0x1089b5['body']['mode']==='files'){_0x1089b5['body']['directory']=path['join'](config['root'],_0xe9ad('0x4c'),_0x1089b5['body'][_0xe9ad('0x2d')]);}return db[_0xe9ad('0x30')][_0xe9ad('0x4a')](_0x1089b5[_0xe9ad('0x49')],{'transaction':_0x220465})[_0xe9ad('0x27')](function(_0x29511e){if(_0x1089b5['body'][_0xe9ad('0x4d')]==='files'){fs['mkdirSync'](_0x29511e[_0xe9ad('0x4e')],parseInt(_0xe9ad('0x4f'),0x8));}var _0x12aecd=_0x1089b5[_0xe9ad('0x50')][_0xe9ad('0x29')]({'plain':!![]});if(!_0x12aecd)throw new Error(_0xe9ad('0x51'));if(_0x12aecd[_0xe9ad('0x52')]===_0xe9ad('0x50')){var _0x58e8cc=_0x29511e[_0xe9ad('0x29')]({'plain':!![]});return db[_0xe9ad('0x53')][_0xe9ad('0x48')]({'where':{'name':_0xe9ad('0x54'),'userProfileId':_0x12aecd[_0xe9ad('0x55')]},'raw':!![]})[_0xe9ad('0x27')](function(_0x356b0f){if(_0x356b0f&&_0x356b0f[_0xe9ad('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x58e8cc[_0xe9ad('0x2d')],'resourceId':_0x58e8cc['id'],'type':_0x356b0f[_0xe9ad('0x2d')],'sectionId':_0x356b0f['id']},{})['then'](function(){return _0x29511e;});}else{return _0x29511e;}})[_0xe9ad('0x46')](function(_0x585264){logger[_0xe9ad('0x2b')](_0xe9ad('0x57'),_0x585264);});}return _0x29511e;});})[_0xe9ad('0x27')](respondWithResult(_0x2a8975,0xc9))[_0xe9ad('0x46')](handleError(_0x2a8975,null));};exports['destroy']=function(_0x559ac5,_0x487d27,_0x3947de){var _0x5630c5;return db[_0xe9ad('0x30')][_0xe9ad('0x48')]({'where':{'id':_0x559ac5[_0xe9ad('0x47')]['id']}})[_0xe9ad('0x27')](function(_0x182276){if(_0x182276){return db[_0xe9ad('0x4b')][_0xe9ad('0x58')](function(_0x5805e5){return _0x182276['destroy']({'transaction':_0x5805e5,'raw':!![]})[_0xe9ad('0x27')](function(_0x565e0c){if(_0x565e0c['directory']){fs['readdirSync'](_0x565e0c[_0xe9ad('0x4e')])[_0xe9ad('0x59')](function(_0xe5cfca){fs['unlinkSync'](path['join'](_0x565e0c[_0xe9ad('0x4e')],_0xe5cfca));});fs[_0xe9ad('0x5a')](_0x565e0c[_0xe9ad('0x4e')]);}return _0x565e0c;});})[_0xe9ad('0x46')](function(_0x71eff7){throw new db[(_0xe9ad('0x5b'))][(_0xe9ad('0x5c'))](_0x71eff7[_0xe9ad('0x5d')]);});}})[_0xe9ad('0x27')](handleEntityNotFound(_0x487d27,null))[_0xe9ad('0x27')](removeEntity(_0x487d27,null))['catch'](handleError(_0x487d27,null));};exports[_0xe9ad('0x5e')]=function(_0xc1f3c3,_0x2f0792,_0x5a610e){return db[_0xe9ad('0x4b')]['transaction'](function(_0x185535){var _0x230a89;return db[_0xe9ad('0x30')][_0xe9ad('0x48')]({'where':{'id':_0xc1f3c3[_0xe9ad('0x47')]['id']}})['then'](function(_0x47eff4){if(_0x47eff4){_0x230a89=_0x47eff4;return _0x47eff4[_0xe9ad('0x5e')](_0xc1f3c3[_0xe9ad('0x49')]['id'],{'transaction':_0x185535});}})[_0xe9ad('0x27')](function(_0x2d31aa){if(_0x2d31aa){return db[_0xe9ad('0x5f')][_0xe9ad('0x60')]({'where':{'id':_0xc1f3c3[_0xe9ad('0x49')]['id']},'attributes':['id','name',_0xe9ad('0x61'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x2c2a17){if(_0x2c2a17){var _0x233414=path[_0xe9ad('0x62')](config[_0xe9ad('0x63')],_0xe9ad('0x64'),util['format'](_0xe9ad('0x65'),path['basename'](_0x2c2a17['save_name'],path['extname'](_0x2c2a17[_0xe9ad('0x61')])),_0x2c2a17['converted_format']));var _0x26746f=path[_0xe9ad('0x62')](config[_0xe9ad('0x63')],_0xe9ad('0x4c'),_0x230a89[_0xe9ad('0x2d')],util[_0xe9ad('0x66')]('%s.%s',_0x2c2a17[_0xe9ad('0x2d')],_0x2c2a17[_0xe9ad('0x67')]));fs[_0xe9ad('0x68')](_0x233414,_0x26746f);return _0x2c2a17;}})[_0xe9ad('0x46')](function(_0x1bd99b){throw new db[(_0xe9ad('0x5b'))][(_0xe9ad('0x5c'))](_0x1bd99b[_0xe9ad('0x5d')]);});})[_0xe9ad('0x27')](handleEntityNotFound(_0x2f0792,null))[_0xe9ad('0x27')](respondWithResult(_0x2f0792,0xc9))[_0xe9ad('0x46')](handleError(_0x2f0792,null));};exports[_0xe9ad('0x69')]=function(_0x82fc35,_0x463e30,_0x56e3c1){return db['sequelize'][_0xe9ad('0x58')](function(_0x5507fc){var _0x346653;return db['VoiceMusicOnHold'][_0xe9ad('0x60')]({'where':{'id':_0x82fc35['params']['id']}})['then'](handleEntityNotFound(_0x463e30,null))['then'](function(_0x3a3d61){if(_0x3a3d61){_0x346653=_0x3a3d61;return _0x3a3d61['removeSound'](_0x82fc35['params'][_0xe9ad('0x6a')]);}})[_0xe9ad('0x27')](function(_0x1d84e4){if(_0x1d84e4){return db[_0xe9ad('0x5f')][_0xe9ad('0x60')]({'where':{'id':_0x82fc35[_0xe9ad('0x47')][_0xe9ad('0x6a')]},'attributes':['id',_0xe9ad('0x2d'),'save_name','converted_format',_0xe9ad('0x6b')],'raw':!![]});}})[_0xe9ad('0x27')](function(_0x320d5a){if(_0x320d5a){fs[_0xe9ad('0x6c')](path[_0xe9ad('0x62')](_0x346653[_0xe9ad('0x4e')],util[_0xe9ad('0x66')]('%s.%s',_0x320d5a[_0xe9ad('0x2d')],_0x320d5a[_0xe9ad('0x67')])));return _0x320d5a;}})[_0xe9ad('0x46')](function(_0xabd62d){throw new db[(_0xe9ad('0x5b'))][(_0xe9ad('0x5c'))](_0xabd62d[_0xe9ad('0x5d')]);});})[_0xe9ad('0x27')](handleEntityNotFound(_0x463e30,null))[_0xe9ad('0x27')](respondWithStatusCode(_0x463e30,0xcc))[_0xe9ad('0x46')](handleError(_0x463e30,null));};exports[_0xe9ad('0x6d')]=function(_0x4a470d,_0x13f038,_0x4637ef){var _0x59e6bc={};var _0x30d299={};var _0x3935fb;var _0x4a85f4;return db['VoiceMusicOnHold'][_0xe9ad('0x60')]({'where':{'id':_0x4a470d[_0xe9ad('0x47')]['id']}})[_0xe9ad('0x27')](handleEntityNotFound(_0x13f038,null))['then'](function(_0x5664fe){if(_0x5664fe){_0x3935fb=_0x5664fe;_0x30d299[_0xe9ad('0x34')]=_['keys'](db[_0xe9ad('0x5f')][_0xe9ad('0x6e')]);_0x30d299[_0xe9ad('0x35')]=_[_0xe9ad('0x36')](_0x4a470d[_0xe9ad('0x35')]);_0x30d299[_0xe9ad('0x37')]=_[_0xe9ad('0x39')](_0x30d299['model'],_0x30d299[_0xe9ad('0x35')]);_0x59e6bc[_0xe9ad('0x38')]=_['intersection'](_0x30d299[_0xe9ad('0x34')],qs[_0xe9ad('0x3a')](_0x4a470d[_0xe9ad('0x35')]['fields']));_0x59e6bc[_0xe9ad('0x38')]=_0x59e6bc[_0xe9ad('0x38')][_0xe9ad('0x3b')]?_0x59e6bc[_0xe9ad('0x38')]:_0x30d299[_0xe9ad('0x34')];_0x59e6bc['order']=qs[_0xe9ad('0x3e')](_0x4a470d[_0xe9ad('0x35')][_0xe9ad('0x3e')]);_0x59e6bc[_0xe9ad('0x40')]=qs['filters'](_['pick'](_0x4a470d[_0xe9ad('0x35')],_0x30d299[_0xe9ad('0x37')]));if(_0x4a470d['query'][_0xe9ad('0x43')]){_0x59e6bc['where']=_[_0xe9ad('0x41')](_0x59e6bc['where'],{'$or':_[_0xe9ad('0x2f')](_0x59e6bc['attributes'],function(_0x5cba29){var _0xd6828={};_0xd6828[_0x5cba29]={'$like':'%'+_0x4a470d['query']['filter']+'%'};return _0xd6828;})});}_0x59e6bc=_[_0xe9ad('0x41')]({},_0x59e6bc,_0x4a470d[_0xe9ad('0x6f')]);return _0x3935fb['getSounds'](_0x59e6bc);}})[_0xe9ad('0x27')](function(_0x56469e){if(_0x56469e){_0x4a85f4=_0x56469e[_0xe9ad('0x3b')];if(!_0x4a470d[_0xe9ad('0x35')][_0xe9ad('0x70')](_0xe9ad('0x3c'))){_0x59e6bc[_0xe9ad('0x20')]=qs[_0xe9ad('0x20')](_0x4a470d[_0xe9ad('0x35')][_0xe9ad('0x20')]);_0x59e6bc[_0xe9ad('0x1e')]=qs[_0xe9ad('0x1e')](_0x4a470d['query'][_0xe9ad('0x1e')]);}return _0x3935fb[_0xe9ad('0x6d')](_0x59e6bc);}})[_0xe9ad('0x27')](function(_0x550634){if(_0x550634){return _0x550634?{'count':_0x4a85f4,'rows':_0x550634}:null;}})[_0xe9ad('0x27')](respondWithResult(_0x13f038,null))[_0xe9ad('0x46')](handleError(_0x13f038,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 3625ef5..1495c2d 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 _0x00dc=['moment','bluebird','request-promise','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger'];(function(_0x4d3354,_0x3b15b9){var _0x18bf9e=function(_0x56dd9c){while(--_0x56dd9c){_0x4d3354['push'](_0x4d3354['shift']());}};_0x18bf9e(++_0x3b15b9);}(_0x00dc,0x116));var _0xc00d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x00dc[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc00d('0x0'));var util=require('util');var logger=require(_0xc00d('0x1'))('api');var moment=require(_0xc00d('0x2'));var BPromise=require(_0xc00d('0x3'));var rp=require(_0xc00d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc00d('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xc00d('0x6')]=function(_0x4ef18d,_0x1ef0cd){return _0x4ef18d[_0xc00d('0x7')](_0xc00d('0x8'),attributes,{'tableName':_0xc00d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x672d=['api','moment','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','../../config/logger'];(function(_0x4d2281,_0x2fe1e4){var _0x4e5ad0=function(_0x1b5eb3){while(--_0x1b5eb3){_0x4d2281['push'](_0x4d2281['shift']());}};_0x4e5ad0(++_0x2fe1e4);}(_0x672d,0x166));var _0xd672=function(_0x32361f,_0x4173df){_0x32361f=_0x32361f-0x0;var _0x22b487=_0x672d[_0x32361f];return _0x22b487;};'use strict';var _=require(_0xd672('0x0'));var util=require('util');var logger=require(_0xd672('0x1'))(_0xd672('0x2'));var moment=require(_0xd672('0x3'));var BPromise=require('bluebird');var rp=require(_0xd672('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd672('0x5'));var config=require(_0xd672('0x6'));var attributes=require(_0xd672('0x7'));module['exports']=function(_0x1a7527,_0x4d06a3){return _0x1a7527[_0xd672('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0xd672('0x9'),'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 7ffb97a..fb0032a 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 _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(_0x221ff4,_0x44f24e){var _0x5424a4=function(_0xb5ec4d){while(--_0xb5ec4d){_0x221ff4['push'](_0x221ff4['shift']());}};_0x5424a4(++_0x44f24e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x393b1e,_0x4c9b6d){var _0x31a301=function(_0x55f933){while(--_0x55f933){_0x393b1e['push'](_0x393b1e['shift']());}};_0x31a301(++_0x4c9b6d);}(_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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 655f6d5..55acd53 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 _0xaa96=['put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams'];(function(_0x381e27,_0x5627ba){var _0x49e063=function(_0x17ecef){while(--_0x17ecef){_0x381e27['push'](_0x381e27['shift']());}};_0x49e063(++_0x5627ba);}(_0xaa96,0x145));var _0x6aa9=function(_0x49c63c,_0x5e84ba){_0x49c63c=_0x49c63c-0x0;var _0x1f4459=_0xaa96[_0x49c63c];return _0x1f4459;};'use strict';var multer=require('multer');var util=require(_0x6aa9('0x0'));var path=require(_0x6aa9('0x1'));var timeout=require(_0x6aa9('0x2'));var express=require(_0x6aa9('0x3'));var router=express[_0x6aa9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6aa9('0x5'));var interaction=require(_0x6aa9('0x6'));var config=require(_0x6aa9('0x7'));var controller=require(_0x6aa9('0x8'));router[_0x6aa9('0x9')]('/',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0xb')]);router[_0x6aa9('0x9')](_0x6aa9('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6aa9('0x9')](_0x6aa9('0xd'),auth['isAuthenticated'](),controller[_0x6aa9('0xe')]);router[_0x6aa9('0x9')](_0x6aa9('0xf'),auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x10')]);router[_0x6aa9('0x9')](_0x6aa9('0x11'),auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x12')]);router[_0x6aa9('0x13')]('/',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x14')]);router[_0x6aa9('0x13')](_0x6aa9('0xf'),auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x15')]);router[_0x6aa9('0x13')]('/:id/teams',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x16')]);router[_0x6aa9('0x17')]('/:id',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x18')]);router[_0x6aa9('0x19')]('/:id',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x1a')]);router[_0x6aa9('0x19')]('/:id/users',auth[_0x6aa9('0xa')](),controller[_0x6aa9('0x1b')]);router[_0x6aa9('0x19')](_0x6aa9('0x11'),auth[_0x6aa9('0xa')](),controller['removeTeams']);module[_0x6aa9('0x1c')]=router; \ No newline at end of file +var _0x6b4e=['/describe','isAuthenticated','describe','/:id','show','getAgents','getTeams','post','create','/:id/users','addAgents','/:id/teams','addTeams','put','update','delete','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index'];(function(_0x51ece3,_0x5a446f){var _0x1ad73f=function(_0x5ea671){while(--_0x5ea671){_0x51ece3['push'](_0x51ece3['shift']());}};_0x1ad73f(++_0x5a446f);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x428e46,_0x44f67b){_0x428e46=_0x428e46-0x0;var _0xc8eff0=_0x6b4e[_0x428e46];return _0xc8eff0;};'use strict';var multer=require('multer');var util=require(_0xe6b4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe6b4('0x1'));var auth=require(_0xe6b4('0x2'));var interaction=require(_0xe6b4('0x3'));var config=require(_0xe6b4('0x4'));var controller=require(_0xe6b4('0x5'));router[_0xe6b4('0x6')]('/',auth['isAuthenticated'](),controller[_0xe6b4('0x7')]);router[_0xe6b4('0x6')](_0xe6b4('0x8'),auth[_0xe6b4('0x9')](),controller[_0xe6b4('0xa')]);router[_0xe6b4('0x6')](_0xe6b4('0xb'),auth[_0xe6b4('0x9')](),controller[_0xe6b4('0xc')]);router[_0xe6b4('0x6')]('/:id/users',auth[_0xe6b4('0x9')](),controller[_0xe6b4('0xd')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xe6b4('0xe')]);router[_0xe6b4('0xf')]('/',auth['isAuthenticated'](),controller[_0xe6b4('0x10')]);router[_0xe6b4('0xf')](_0xe6b4('0x11'),auth[_0xe6b4('0x9')](),controller[_0xe6b4('0x12')]);router['post'](_0xe6b4('0x13'),auth[_0xe6b4('0x9')](),controller[_0xe6b4('0x14')]);router[_0xe6b4('0x15')]('/:id',auth[_0xe6b4('0x9')](),controller[_0xe6b4('0x16')]);router[_0xe6b4('0x17')](_0xe6b4('0xb'),auth[_0xe6b4('0x9')](),controller['destroy']);router[_0xe6b4('0x17')](_0xe6b4('0x11'),auth[_0xe6b4('0x9')](),controller['removeAgents']);router['delete']('/:id/teams',auth[_0xe6b4('0x9')](),controller['removeTeams']);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 0b4fe59..58b8385 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 _0x0ea6=['name','VIRTUAL','system-','getDataValue','sequelize','STRING'];(function(_0x29dbcc,_0x201f3b){var _0x5260c8=function(_0x4d42bd){while(--_0x4d42bd){_0x29dbcc['push'](_0x29dbcc['shift']());}};_0x5260c8(++_0x201f3b);}(_0x0ea6,0x190));var _0x60ea=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x0ea6[_0xd39959];return _0x1ff69c;};'use strict';var Sequelize=require(_0x60ea('0x0'));module['exports']={'name':{'type':Sequelize[_0x60ea('0x1')],'allowNull':![],'unique':_0x60ea('0x2')},'prefix':{'type':Sequelize[_0x60ea('0x3')],'get':function(_0x2a2b8d){return _0x60ea('0x4')+this[_0x60ea('0x5')](_0x60ea('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x60ea('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe242=['getDataValue','name','INTEGER','sequelize','STRING','VIRTUAL','system-'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xe242,0x1ca));var _0x2e24=function(_0x1bbed6,_0x12628b){_0x1bbed6=_0x1bbed6-0x0;var _0x262f28=_0xe242[_0x1bbed6];return _0x262f28;};'use strict';var Sequelize=require(_0x2e24('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e24('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x2e24('0x2')],'get':function(_0x1218b6){return _0x2e24('0x3')+this[_0x2e24('0x4')](_0x2e24('0x5'))+'-';}},'description':{'type':Sequelize[_0x2e24('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x2e24('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2fa7297..1f5beb1 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 _0x087b=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','catch','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Set','CDR(prefix)=','callerIdAll','push','No\x20callerid\x20available','context','charAt','body','system-','findById','addAgents','params','omit','ids','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','getTeams','Team','addTeams','findAll','interface','flatMap','Agents','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','union','compact','value','removeTeams','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus'];(function(_0x238cec,_0x2ad1ad){var _0x654aa9=function(_0x2a00c0){while(--_0x2a00c0){_0x238cec['push'](_0x238cec['shift']());}};_0x654aa9(++_0x2ad1ad);}(_0x087b,0x11a));var _0xb087=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x087b[_0x42bdad];return _0x122626;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];config[_0xb087('0x1b')]=_[_0xb087('0x1c')](config['redis'],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1b')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);function respondWithStatusCode(_0x12d0db,_0x5e9757){_0x5e9757=_0x5e9757||0xcc;return function(_0x5147e3){if(_0x5147e3){return _0x12d0db[_0xb087('0x21')](_0x5e9757);}return _0x12d0db[_0xb087('0x22')](_0x5e9757)['end']();};}function respondWithResult(_0x43e576,_0x412b48){_0x412b48=_0x412b48||0xc8;return function(_0x597478){if(_0x597478){return _0x43e576[_0xb087('0x22')](_0x412b48)[_0xb087('0x23')](_0x597478);}};}function respondWithFilteredResult(_0x2e9e74,_0x5bb80b){return function(_0x330005){if(_0x330005){var _0x3c680f=typeof _0x5bb80b[_0xb087('0x24')]===_0xb087('0x25')&&typeof _0x5bb80b['limit']===_0xb087('0x25');var _0x28428e=_0x330005[_0xb087('0x26')];var _0x23c1b6=_0x3c680f?0x0:_0x5bb80b['offset'];var _0x5aeab1=_0x3c680f?_0x330005['count']:_0x5bb80b['offset']+_0x5bb80b[_0xb087('0x27')];var _0x17be8e;if(_0x5aeab1>=_0x28428e){_0x5aeab1=_0x28428e;_0x17be8e=0xc8;}else{_0x17be8e=0xce;}_0x2e9e74[_0xb087('0x22')](_0x17be8e);return _0x2e9e74[_0xb087('0x28')](_0xb087('0x29'),_0x23c1b6+'-'+_0x5aeab1+'/'+_0x28428e)[_0xb087('0x23')](_0x330005);}return null;};}function patchUpdates(_0x31ae01){return function(_0x5587f7){try{jsonpatch[_0xb087('0x2a')](_0x5587f7,_0x31ae01,!![]);}catch(_0x466397){return BPromise[_0xb087('0x2b')](_0x466397);}return _0x5587f7[_0xb087('0x2c')]();};}function saveUpdates(_0x3ad74e,_0x4d9028){return function(_0x183eab){if(_0x183eab){return _0x183eab[_0xb087('0x2d')](_0x3ad74e)['then'](function(_0x5a2dc6){return _0x5a2dc6;});}return null;};}function removeEntity(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(_0x5a4ee0){return _0x5a4ee0[_0xb087('0x2e')]()[_0xb087('0x2f')](function(){var _0x1d124f=_0x5a4ee0[_0xb087('0x30')]({'plain':!![]});var _0xd9ec66=_0xb087('0x31');return db[_0xb087('0x32')][_0xb087('0x2e')]({'where':{'type':_0xd9ec66,'resourceId':_0x1d124f['id']}})[_0xb087('0x2f')](function(){return _0x5a4ee0;});})[_0xb087('0x2f')](function(){_0x50745a[_0xb087('0x22')](0xcc)[_0xb087('0x33')]();});}};}function handleEntityNotFound(_0xb0baf6,_0x263259){return function(_0x593b78){if(!_0x593b78){_0xb0baf6[_0xb087('0x21')](0x194);}return _0x593b78;};}function handleError(_0x1335d9,_0x20183f){_0x20183f=_0x20183f||0x1f4;return function(_0x15c9ac){logger[_0xb087('0x34')](_0x15c9ac[_0xb087('0x35')]);if(_0x15c9ac[_0xb087('0x36')]){delete _0x15c9ac[_0xb087('0x36')];}_0x1335d9['status'](_0x20183f)['send'](_0x15c9ac);};}exports[_0xb087('0x37')]=function(_0xedd164,_0x4cb5a8){var _0x60bfe2={},_0x7d3776={},_0x2a48d3={'count':0x0,'rows':[]};var _0x32b20d=_[_0xb087('0x38')](db[_0xb087('0x39')][_0xb087('0x3a')],function(_0x3b7ace){return{'name':_0x3b7ace[_0xb087('0x3b')],'type':_0x3b7ace[_0xb087('0x3c')][_0xb087('0x3d')]};});_0x7d3776[_0xb087('0x3e')]=_['map'](_0x32b20d,_0xb087('0x36'));_0x7d3776['query']=_[_0xb087('0x3f')](_0xedd164[_0xb087('0x40')]);_0x7d3776[_0xb087('0x41')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],_0x7d3776[_0xb087('0x40')]);_0x60bfe2[_0xb087('0x43')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],qs['fields'](_0xedd164['query'][_0xb087('0x44')]));_0x60bfe2[_0xb087('0x43')]=_0x60bfe2[_0xb087('0x43')][_0xb087('0x45')]?_0x60bfe2[_0xb087('0x43')]:_0x7d3776['model'];if(!_0xedd164[_0xb087('0x40')][_0xb087('0x46')]('nolimit')){_0x60bfe2['limit']=qs[_0xb087('0x27')](_0xedd164[_0xb087('0x40')][_0xb087('0x27')]);_0x60bfe2['offset']=qs[_0xb087('0x24')](_0xedd164[_0xb087('0x40')][_0xb087('0x24')]);}_0x60bfe2[_0xb087('0x47')]=qs[_0xb087('0x48')](_0xedd164['query'][_0xb087('0x48')]);_0x60bfe2['where']=qs[_0xb087('0x41')](_['pick'](_0xedd164[_0xb087('0x40')],_0x7d3776[_0xb087('0x41')]),_0x32b20d);if(_0xedd164['query'][_0xb087('0x49')]){_0x60bfe2['where']=_[_0xb087('0x4a')](_0x60bfe2['where'],{'$or':_[_0xb087('0x38')](_0x32b20d,function(_0x326934){if(_0x326934[_0xb087('0x3c')]!==_0xb087('0x4b')){var _0x1785e0={};_0x1785e0[_0x326934[_0xb087('0x36')]]={'$like':'%'+_0xedd164[_0xb087('0x40')]['filter']+'%'};return _0x1785e0;}})});}_0x60bfe2=_[_0xb087('0x4a')]({},_0x60bfe2,_0xedd164['options']);var _0x2a2b9c={'where':_0x60bfe2[_0xb087('0x4c')]};return db['VoicePrefix'][_0xb087('0x26')](_0x2a2b9c)[_0xb087('0x2f')](function(_0x7650c5){_0x2a48d3['count']=_0x7650c5;if(_0xedd164[_0xb087('0x40')]['includeAll']){_0x60bfe2[_0xb087('0x4d')]=[{'all':!![]}];}return db[_0xb087('0x39')]['findAll'](_0x60bfe2);})[_0xb087('0x2f')](function(_0x302ce7){_0x2a48d3['rows']=_0x302ce7;return _0x2a48d3;})[_0xb087('0x2f')](respondWithFilteredResult(_0x4cb5a8,_0x60bfe2))[_0xb087('0x4e')](handleError(_0x4cb5a8,null));};exports['show']=function(_0x93ada7,_0x46c713){var _0x1d7f80={'raw':![],'where':{'id':_0x93ada7['params']['id']}},_0x174c10={};_0x174c10['model']=_[_0xb087('0x3f')](db[_0xb087('0x39')][_0xb087('0x3a')]);_0x174c10[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x93ada7[_0xb087('0x40')]);_0x174c10['filters']=_['intersection'](_0x174c10[_0xb087('0x3e')],_0x174c10['query']);_0x1d7f80[_0xb087('0x43')]=_[_0xb087('0x42')](_0x174c10[_0xb087('0x3e')],qs[_0xb087('0x44')](_0x93ada7['query'][_0xb087('0x44')]));_0x1d7f80['attributes']=_0x1d7f80[_0xb087('0x43')][_0xb087('0x45')]?_0x1d7f80[_0xb087('0x43')]:_0x174c10[_0xb087('0x3e')];if(_0x93ada7[_0xb087('0x40')]['includeAll']){_0x1d7f80[_0xb087('0x4d')]=[{'all':!![]}];}_0x1d7f80=_[_0xb087('0x4a')]({},_0x1d7f80,_0x93ada7[_0xb087('0x4f')]);return db['VoicePrefix'][_0xb087('0x50')](_0x1d7f80)['then'](handleEntityNotFound(_0x46c713,null))['then'](respondWithResult(_0x46c713,null))[_0xb087('0x4e')](handleError(_0x46c713,null));};exports[_0xb087('0x2e')]=function(_0x5eacf3,_0x4362d4){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x5eacf3['params']['id']}})['then'](handleEntityNotFound(_0x4362d4,null))[_0xb087('0x2f')](removeEntity(_0x4362d4,null))['catch'](handleError(_0x4362d4,null));};exports['describe']=function(_0x1e52e4,_0x3bafca){return db[_0xb087('0x39')][_0xb087('0x51')]()[_0xb087('0x2f')](respondWithResult(_0x3bafca,null))[_0xb087('0x4e')](handleError(_0x3bafca,null));};exports[_0xb087('0x52')]=function(_0xfb8827,_0x1fe178){var _0x18d93b;return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x55e653){return db[_0xb087('0x39')][_0xb087('0x52')](_0xfb8827['body'],{'transaction':_0x55e653})[_0xb087('0x2f')](function(_0x458301){_0x18d93b=_0x458301[_0xb087('0x30')]({'plain':!![]});return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x18d93b[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x298169){return createVoicePrefixExtensions(_0x18d93b,_0x298169,_0x55e653);});});})[_0xb087('0x2f')](function(){var _0x357616=_0xfb8827[_0xb087('0x57')]['get']({'plain':!![]});if(!_0x357616)throw new Error(_0xb087('0x58'));if(_0x357616['role']===_0xb087('0x57')){var _0x575cc4=_0x18d93b;return db[_0xb087('0x59')][_0xb087('0x50')]({'where':{'name':_0xb087('0x31'),'userProfileId':_0x357616[_0xb087('0x5a')]},'raw':!![]})[_0xb087('0x2f')](function(_0x465ef6){if(_0x465ef6&&_0x465ef6[_0xb087('0x5b')]===0x0){return db[_0xb087('0x32')][_0xb087('0x52')]({'name':_0x575cc4[_0xb087('0x36')],'resourceId':_0x575cc4['id'],'type':_0x465ef6[_0xb087('0x36')],'sectionId':_0x465ef6['id']},{})[_0xb087('0x2f')](function(){return _0x18d93b;});}else{return _0x18d93b;}})[_0xb087('0x4e')](function(_0x22be05){logger[_0xb087('0x34')](_0xb087('0x5c'),_0x22be05);throw _0x22be05;});}return _0x18d93b;})[_0xb087('0x2f')](respondWithResult(_0x1fe178,null))[_0xb087('0x4e')](handleError(_0x1fe178,null));};function Extension(_0x40ff74,_0xe3cb2,_0x4053c8,_0x459c5b){this['context']=_0xb087('0x5d');this[_0xb087('0x5e')]=_0x40ff74;this[_0xb087('0x5f')]=_0x4053c8;this['type']=_0xb087('0x60');this[_0xb087('0x61')]='Voice\x20Prefix\x20Extension';this[_0xb087('0x62')]=_0xe3cb2;this[_0xb087('0x63')]=_0x459c5b;}function createVoicePrefixExtensions(_0x2e3a14,_0x596264,_0x133c58){return new BPromise(function(_0x257894,_0x3d7f74){var _0x43ef22=new Extension(formatPrefixName(_0x2e3a14[_0xb087('0x64')]),0x1,_0xb087('0x65'),_0xb087('0x66'));_0x43ef22[_0xb087('0x67')]=_0x2e3a14['id'];return db['VoiceExtension'][_0xb087('0x52')](_0x43ef22,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x44548f){var _0x47b2c7=_0x44548f[_0xb087('0x30')]({'plain':!![]});var _0x4a26d0=_['map'](addVoicePrefixExtensions(_0x2e3a14,_0x596264),function(_0x3516d4){_0x3516d4[_0xb087('0x56')]=_0x47b2c7['id'];_0x3516d4['VoicePrefixId']=_0x2e3a14['id'];return _0x3516d4;});return db[_0xb087('0x55')]['bulkCreate'](_0x4a26d0,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x1a8237){if(!_0x1a8237){return _0x3d7f74('Extensions\x20creation\x20failed');}else{return _0x257894(_0x1a8237);}})['catch'](function(_0x22219d){return _0x3d7f74(_0x22219d);});});;});};function addVoicePrefixExtensions(_0x5c43c8,_0x5ede2e){var _0x3c97ab=[];var _0x52d72a=formatPrefixName(_0x5c43c8[_0xb087('0x64')]);_0x3c97ab['push'](new Extension(_0x52d72a,0x2,_0xb087('0x68'),_0xb087('0x69')+_0x5c43c8[_0xb087('0x36')]));if(_0x5c43c8[_0xb087('0x6a')]){_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x3,_0xb087('0x68'),'PREFIX-CALLERIDALL='+_0x5c43c8[_0xb087('0x6a')]));}else{_0x3c97ab['push'](new Extension(_0x52d72a,0x3,_0xb087('0x65'),_0xb087('0x6c')));}_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x4,'goto',_0x5ede2e[_0xb087('0x6d')]+','+'${EXTEN:'+(0x8+_0x5c43c8[_0xb087('0x36')][_0xb087('0x45')])+'}'+','+0x1));return _0x3c97ab;}function formatPrefixName(_0x66f15b){var _0x2ee63f='_';for(var _0x16cb87=0x0;_0x16cb87<_0x66f15b[_0xb087('0x45')];_0x16cb87++){if(_0x66f15b['charAt'](_0x16cb87)=='-'){_0x2ee63f+=_0x66f15b[_0xb087('0x6e')](_0x16cb87);}else{_0x2ee63f+='['+_0x66f15b[_0xb087('0x6e')](_0x16cb87)+']';}}_0x2ee63f+='.';return _0x2ee63f;}exports['update']=function(_0x25a45f,_0x58de88,_0x19238d){var _0x38f5d2=_0x25a45f[_0xb087('0x6f')];_0x38f5d2[_0xb087('0x64')]=_0xb087('0x70')+_0x38f5d2[_0xb087('0x36')]+'-';return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x509ee7){return db['VoicePrefix']['update'](_0x38f5d2,{'where':{'id':_0x38f5d2['id']},'transaction':_0x509ee7})[_0xb087('0x2f')](function(){return db['VoiceExtension'][_0xb087('0x2e')]({'where':{'VoicePrefixId':_0x38f5d2['id']},'transaction':_0x509ee7})['then'](function(){return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x38f5d2[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x49d0d3){return createVoicePrefixExtensions(_0x38f5d2,_0x49d0d3,_0x509ee7);});});});})[_0xb087('0x2f')](function(){return db['VoicePrefix'][_0xb087('0x71')](_0x38f5d2['id']);})[_0xb087('0x2f')](respondWithResult(_0x58de88,null))[_0xb087('0x4e')](handleError(_0x58de88,null));};exports[_0xb087('0x72')]=function(_0x5b5ad3,_0x49d26a,_0x38f296){return db['VoicePrefix'][_0xb087('0x50')]({'where':{'id':_0x5b5ad3[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x49d26a,null))[_0xb087('0x2f')](function(_0x4a9193){if(_0x4a9193){return _0x4a9193['addAgents'](_0x5b5ad3[_0xb087('0x6f')]['ids'],_[_0xb087('0x74')](_0x5b5ad3[_0xb087('0x6f')],[_0xb087('0x75'),'id'])||{})[_0xb087('0x76')](function(_0x142b0f){for(var _0x581ad4=0x0;_0x581ad4<_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')]['length'];_0x581ad4+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')][_0x581ad4]),'VoicePrefixId':Number(_0x5b5ad3[_0xb087('0x73')]['id'])});}return _0x142b0f;});}})[_0xb087('0x2f')](respondWithResult(_0x49d26a,null))[_0xb087('0x4e')](handleError(_0x49d26a,null));};exports[_0xb087('0x77')]=function(_0x47ea48,_0xd1f58a,_0x25e097){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x47ea48[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0xd1f58a,null))[_0xb087('0x2f')](function(_0x50454b){if(_0x50454b){return _0x50454b[_0xb087('0x77')](_0x47ea48[_0xb087('0x40')][_0xb087('0x75')])['then'](function(){if(_[_0xb087('0x78')](_0x47ea48['query'][_0xb087('0x75')])){for(var _0x5fb869=0x0;_0x5fb869<_0x47ea48[_0xb087('0x40')][_0xb087('0x75')][_0xb087('0x45')];_0x5fb869+=0x1){socket[_0xb087('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x47ea48['query'][_0xb087('0x75')][_0x5fb869]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}}else{socket['emit'](_0xb087('0x7a'),{'UserId':Number(_0x47ea48[_0xb087('0x40')][_0xb087('0x75')]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}});}})[_0xb087('0x2f')](respondWithStatusCode(_0xd1f58a,null))[_0xb087('0x4e')](handleError(_0xd1f58a,null));};exports['getAgents']=function(_0x15ff29,_0x141859,_0x2c92f6){var _0x3114ce={};var _0x416e05={};var _0x3d6d1a;var _0xf286de;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x15ff29['params']['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x141859,null))['then'](function(_0x2a32d0){if(_0x2a32d0){_0x3d6d1a=_0x2a32d0;_0x416e05[_0xb087('0x3e')]=_['keys'](db[_0xb087('0x7c')][_0xb087('0x3a')]);_0x416e05[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x15ff29[_0xb087('0x40')]);_0x416e05[_0xb087('0x41')]=_['intersection'](_0x416e05[_0xb087('0x3e')],_0x416e05[_0xb087('0x40')]);_0x3114ce[_0xb087('0x43')]=_[_0xb087('0x42')](_0x416e05[_0xb087('0x3e')],qs['fields'](_0x15ff29[_0xb087('0x40')][_0xb087('0x44')]));_0x3114ce[_0xb087('0x43')]=_0x3114ce[_0xb087('0x43')][_0xb087('0x45')]?_0x3114ce[_0xb087('0x43')]:_0x416e05[_0xb087('0x3e')];_0x3114ce[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x15ff29[_0xb087('0x40')][_0xb087('0x48')]);_0x3114ce['where']=qs['filters'](_[_0xb087('0x7d')](_0x15ff29[_0xb087('0x40')],_0x416e05[_0xb087('0x41')]));if(_0x15ff29[_0xb087('0x40')][_0xb087('0x49')]){_0x3114ce['where']=_[_0xb087('0x4a')](_0x3114ce[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x3114ce[_0xb087('0x43')],function(_0x3e58be){var _0xbe2a4c={};_0xbe2a4c[_0x3e58be]={'$like':'%'+_0x15ff29['query'][_0xb087('0x49')]+'%'};return _0xbe2a4c;})});}_0x3114ce=_['merge']({},_0x3114ce,_0x15ff29['options']);return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})[_0xb087('0x2f')](function(_0x3a446d){if(_0x3a446d){_0xf286de=_0x3a446d[_0xb087('0x45')];if(!_0x15ff29['query'][_0xb087('0x46')](_0xb087('0x7f'))){_0x3114ce['limit']=qs[_0xb087('0x27')](_0x15ff29['query']['limit']);_0x3114ce[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x15ff29[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})['then'](function(_0x3cf818){if(_0x3cf818){return _0x3cf818?{'count':_0xf286de,'rows':_0x3cf818}:null;}})[_0xb087('0x2f')](respondWithResult(_0x141859,null))[_0xb087('0x4e')](handleError(_0x141859,null));};exports[_0xb087('0x80')]=function(_0x48e2c6,_0x489b1f,_0x544a68){var _0x5ebb4f={};var _0x17f0af={};var _0x3296c9;var _0x10e4b6;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x48e2c6[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x489b1f,null))['then'](function(_0x5d45e7){if(_0x5d45e7){_0x3296c9=_0x5d45e7;_0x17f0af[_0xb087('0x3e')]=_[_0xb087('0x3f')](db[_0xb087('0x81')][_0xb087('0x3a')]);_0x17f0af['query']=_[_0xb087('0x3f')](_0x48e2c6['query']);_0x17f0af[_0xb087('0x41')]=_['intersection'](_0x17f0af[_0xb087('0x3e')],_0x17f0af[_0xb087('0x40')]);_0x5ebb4f[_0xb087('0x43')]=_[_0xb087('0x42')](_0x17f0af['model'],qs[_0xb087('0x44')](_0x48e2c6['query']['fields']));_0x5ebb4f['attributes']=_0x5ebb4f[_0xb087('0x43')]['length']?_0x5ebb4f[_0xb087('0x43')]:_0x17f0af[_0xb087('0x3e')];_0x5ebb4f[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x48')]);_0x5ebb4f[_0xb087('0x4c')]=qs[_0xb087('0x41')](_[_0xb087('0x7d')](_0x48e2c6[_0xb087('0x40')],_0x17f0af[_0xb087('0x41')]));if(_0x48e2c6[_0xb087('0x40')][_0xb087('0x49')]){_0x5ebb4f[_0xb087('0x4c')]=_[_0xb087('0x4a')](_0x5ebb4f[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x5ebb4f[_0xb087('0x43')],function(_0x4e42eb){var _0x15e2f9={};_0x15e2f9[_0x4e42eb]={'$like':'%'+_0x48e2c6['query'][_0xb087('0x49')]+'%'};return _0x15e2f9;})});}_0x5ebb4f=_[_0xb087('0x4a')]({},_0x5ebb4f,_0x48e2c6[_0xb087('0x4f')]);return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})[_0xb087('0x2f')](function(_0x2e4d22){if(_0x2e4d22){_0x10e4b6=_0x2e4d22[_0xb087('0x45')];if(!_0x48e2c6['query']['hasOwnProperty']('nolimit')){_0x5ebb4f[_0xb087('0x27')]=qs[_0xb087('0x27')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x27')]);_0x5ebb4f[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})['then'](function(_0x2de517){if(_0x2de517){return _0x2de517?{'count':_0x10e4b6,'rows':_0x2de517}:null;}})['then'](respondWithResult(_0x489b1f,null))[_0xb087('0x4e')](handleError(_0x489b1f,null));};exports[_0xb087('0x82')]=function(_0x597d80,_0x4c3aef,_0x2f2597){var _0x2ae274=_0x597d80[_0xb087('0x6f')][_0xb087('0x75')];var _0x5069f2;return db[_0xb087('0x81')][_0xb087('0x83')]({'where':{'id':_0x2ae274},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb087('0x36'),'online','voicePause',_0xb087('0x84')],'raw':!![]}]})['then'](function(_0x4059ac){if(_0x4059ac){_0x5069f2=_0x4059ac;var _0x12976c=_[_0xb087('0x85')](_0x4059ac,function(_0x1e48cc){var _0x2de831=_0x1e48cc[_0xb087('0x30')]({'plain':!![]});return _0x2de831[_0xb087('0x86')];});return db[_0xb087('0x39')]['find']({'where':{'id':_0x597d80[_0xb087('0x73')]['id']}})['then'](function(_0x5acf13){return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x1fdb0f){return _0x5acf13['addTeams'](_0x2ae274,{'transaction':_0x1fdb0f})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x5069f2,function(_0x313d4b){return db[_0xb087('0x88')]['upsert']({'TeamId':_0x313d4b['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},{'transaction':_0x1fdb0f});});})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x12976c,function(_0x46f5e6){return db[_0xb087('0x89')][_0xb087('0x8a')]({'where':{'UserId':_0x46f5e6['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},'transaction':_0x1fdb0f});});})['then'](function(){_0x12976c[_0xb087('0x8b')](function(_0xfc3490){socket[_0xb087('0x79')](_0xb087('0x8c'),{'UserId':_0xfc3490['id'],'VoicePrefixId':_0x5acf13['id']});});});});});}})[_0xb087('0x2f')](respondWithStatusCode(_0x4c3aef,null))[_0xb087('0x4e')](handleError(_0x4c3aef,null));};exports['removeTeams']=function(_0x44c8cb,_0x15bbda,_0x149020){return db['Team']['findAll']({'where':{'id':_0x44c8cb[_0xb087('0x40')][_0xb087('0x75')]},'attributes':['id'],'include':[{'model':db[_0xb087('0x7c')],'as':_0xb087('0x86'),'attributes':['id'],'raw':!![]}]})[_0xb087('0x2f')](handleEntityNotFound(_0x15bbda,null))[_0xb087('0x2f')](function(_0x42528a){var _0x2795e9=_[_0xb087('0x38')](_0x42528a,'id');var _0xa58050=[];var _0x5ef263=[];var _0x1a7486=squel[_0xb087('0x8d')]();_0x1a7486[_0xb087('0x8e')](_0xb087('0x8f'))[_0xb087('0x90')]('team_has_voice_prefixes','tq')[_0xb087('0x91')](_0xb087('0x92'),'ut',_0xb087('0x93'))[_0xb087('0x4c')]('VoicePrefixId\x20=\x20?',_0x44c8cb[_0xb087('0x73')]['id']);for(var _0x547968=0x0;_0x547968<_0x42528a[_0xb087('0x45')];_0x547968+=0x1){let _0x532682=_0x42528a[_0x547968];for(var _0x5f4312=0x0;_0x5f4312<_0x532682[_0xb087('0x86')][_0xb087('0x45')];_0x5f4312+=0x1){let _0x1cb959=_0x532682['Agents'][_0x5f4312];var _0x595faa=_0x1a7486[_0xb087('0x94')]();_0x595faa[_0xb087('0x4c')](_0xb087('0x95'),_0x1cb959['id']);_0x5ef263[_0xb087('0x6b')](db[_0xb087('0x53')]['query'](_0x595faa[_0xb087('0x96')](),{'type':db[_0xb087('0x53')][_0xb087('0x97')][_0xb087('0x98')]})[_0xb087('0x2f')](function(_0x14737){if(_0x14737['length']===0x1){return _0x1cb959['id'];}else{var _0x5777d0=_[_0xb087('0x99')](_[_0xb087('0x38')](_0x14737,'TeamId'),function(_0x1f28dd){return _['includes'](_0x2795e9,_0x1f28dd);});if(_0x5777d0){return _0x1cb959['id'];}}}));}}return BPromise['all'](_0x5ef263)[_0xb087('0x2f')](function(_0x3193c8){_0xa58050=_(_0xa58050)[_0xb087('0x9a')](_0x3193c8)[_0xb087('0x9b')]()[_0xb087('0x9c')]();return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x44c8cb[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](function(_0xff9c0c){return db['sequelize']['transaction'](function(_0x5e704a){return _0xff9c0c[_0xb087('0x9d')](_0x44c8cb['query'][_0xb087('0x75')],{'transaction':_0x5e704a})['then'](function(){if(!_['isEmpty'](_0xa58050)){return _0xff9c0c[_0xb087('0x77')](_0xa58050,{'transaction':_0x5e704a});}})[_0xb087('0x2f')](function(){_0xa58050[_0xb087('0x8b')](function(_0x170d9e){socket[_0xb087('0x79')](_0xb087('0x7a'),{'UserId':_0x170d9e,'VoicePrefixId':_0xff9c0c['id']});});});});});});})[_0xb087('0x2f')](respondWithStatusCode(_0x15bbda,null))[_0xb087('0x4e')](handleError(_0x15bbda,null));}; \ No newline at end of file +var _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../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','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8603,0x190));var _0x3860=function(_0x4e0d05,_0x1252ef){_0x4e0d05=_0x4e0d05-0x0;var _0x568b50=_0x8603[_0x4e0d05];return _0x568b50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 068cfe9..2699adc 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 _0x0ad7=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x51e93a,_0x22d8ee){var _0x2ae7a7=function(_0x3b7f66){while(--_0x3b7f66){_0x51e93a['push'](_0x51e93a['shift']());}};_0x2ae7a7(++_0x22d8ee);}(_0x0ad7,0x179));var _0x70ad=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0ad7[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x70ad('0x0'));var VoicePrefix=require(_0x70ad('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x70ad('0x2'),'afterUpdate':_0x70ad('0x3'),'afterDestroy':_0x70ad('0x4')};function emitEvent(_0x271073){return function(_0x40415b,_0x3309ba,_0x23316a){VoicePrefixEvents[_0x70ad('0x5')](_0x271073+':'+_0x40415b['id'],_0x40415b);VoicePrefixEvents[_0x70ad('0x5')](_0x271073,_0x40415b);_0x23316a(null);};}for(var e in events){if(events[_0x70ad('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x70ad('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x1552=['hook','exports','events','VoicePrefix','setMaxListeners','update','emit'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0x1552,0x144));var _0x2155=function(_0x557e8a,_0xd2d09b){_0x557e8a=_0x557e8a-0x0;var _0x5c7f96=_0x1552[_0x557e8a];return _0x5c7f96;};'use strict';var EventEmitter=require(_0x2155('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x2155('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2155('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2155('0x3'),'afterDestroy':'remove'};function emitEvent(_0x53f48c){return function(_0x5d6d65,_0x215bd8,_0x3ce0e0){VoicePrefixEvents[_0x2155('0x4')](_0x53f48c+':'+_0x5d6d65['id'],_0x5d6d65);VoicePrefixEvents[_0x2155('0x4')](_0x53f48c,_0x5d6d65);_0x3ce0e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x2155('0x5')](e,emitEvent(event));}}module[_0x2155('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index d4003cf..c9bf795 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 _0x74d9=['define','VoicePrefix','lodash','util','../../config/logger','api','bluebird','request-promise','path','./voicePrefix.attributes'];(function(_0xd1a637,_0x528f9f){var _0x5f4d2f=function(_0x32ae29){while(--_0x32ae29){_0xd1a637['push'](_0xd1a637['shift']());}};_0x5f4d2f(++_0x528f9f);}(_0x74d9,0x66));var _0x974d=function(_0x3274a8,_0x13a3ff){_0x3274a8=_0x3274a8-0x0;var _0x57027d=_0x74d9[_0x3274a8];return _0x57027d;};'use strict';var _=require(_0x974d('0x0'));var util=require(_0x974d('0x1'));var logger=require(_0x974d('0x2'))(_0x974d('0x3'));var moment=require('moment');var BPromise=require(_0x974d('0x4'));var rp=require(_0x974d('0x5'));var fs=require('fs');var path=require(_0x974d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x974d('0x7'));module['exports']=function(_0x57fec8,_0x29af9a){return _0x57fec8[_0x974d('0x8')](_0x974d('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7d0=['../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xb7d0,0xf3));var _0x0b7d=function(_0x49aab7,_0x1d6397){_0x49aab7=_0x49aab7-0x0;var _0x587b6f=_0xb7d0[_0x49aab7];return _0x587b6f;};'use strict';var _=require(_0x0b7d('0x0'));var util=require(_0x0b7d('0x1'));var logger=require(_0x0b7d('0x2'))(_0x0b7d('0x3'));var moment=require(_0x0b7d('0x4'));var BPromise=require(_0x0b7d('0x5'));var rp=require(_0x0b7d('0x6'));var fs=require('fs');var path=require(_0x0b7d('0x7'));var rimraf=require(_0x0b7d('0x8'));var config=require(_0x0b7d('0x9'));var attributes=require(_0x0b7d('0xa'));module[_0x0b7d('0xb')]=function(_0xb10f20,_0x2f3294){return _0xb10f20[_0x0b7d('0xc')]('VoicePrefix',attributes,{'tableName':_0x0b7d('0xd'),'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 96684f4..e43a4a9 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 _0x89fb=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x2ada6a,_0x49cece){var _0x42b8fa=function(_0x503f4f){while(--_0x503f4f){_0x2ada6a['push'](_0x2ada6a['shift']());}};_0x42b8fa(++_0x49cece);}(_0x89fb,0x14b));var _0xb89f=function(_0x55c3ba,_0x4c4bad){_0x55c3ba=_0x55c3ba-0x0;var _0x173aca=_0x89fb[_0x55c3ba];return _0x173aca;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var moment=require(_0xb89f('0x1'));var BPromise=require(_0xb89f('0x2'));var rs=require(_0xb89f('0x3'));var fs=require('fs');var Redis=require(_0xb89f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb89f('0x5'));var logger=require(_0xb89f('0x6'))(_0xb89f('0x7'));var config=require(_0xb89f('0x8'));var jayson=require(_0xb89f('0x9'));var client=jayson['client'][_0xb89f('0xa')]({'port':0x232a});config['redis']=_[_0xb89f('0xb')](config['redis'],{'host':_0xb89f('0xc'),'port':0x18eb});var socket=require(_0xb89f('0xd'))(new Redis(config[_0xb89f('0xe')]));require('./voicePrefix.socket')[_0xb89f('0xf')](socket);function respondWithRpcPromise(_0x2f1a11,_0x2f0c38,_0x7361c0){return new BPromise(function(_0x36bbe0,_0x50bad7){return client['request'](_0x2f1a11,_0x7361c0)[_0xb89f('0x10')](function(_0x36b3f8){logger[_0xb89f('0x11')](_0xb89f('0x12'),_0x2f0c38,_0xb89f('0x13'));logger['debug'](_0xb89f('0x14'),_0x2f0c38,_0xb89f('0x13'),JSON[_0xb89f('0x15')](_0x36b3f8));if(_0x36b3f8[_0xb89f('0x16')]){if(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x17')]===0x1f4){logger['error'](_0xb89f('0x12'),_0x2f0c38,_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);return _0x50bad7(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);}logger[_0xb89f('0x16')](_0xb89f('0x12'),_0x2f0c38,_0x36b3f8['error'][_0xb89f('0x18')]);return _0x36bbe0(_0x36b3f8[_0xb89f('0x16')][_0xb89f('0x18')]);}else{logger[_0xb89f('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x2f0c38,'request\x20sent');_0x36bbe0(_0x36b3f8[_0xb89f('0x19')][_0xb89f('0x18')]);}})[_0xb89f('0x1a')](function(_0x4baa9f){logger['error'](_0xb89f('0x12'),_0x2f0c38,_0x4baa9f);_0x50bad7(_0x4baa9f);});});} \ No newline at end of file +var _0xd98a=['debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoicePrefix,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','request\x20sent'];(function(_0x139ce7,_0xd4512f){var _0x303b73=function(_0x22942e){while(--_0x22942e){_0x139ce7['push'](_0x139ce7['shift']());}};_0x303b73(++_0xd4512f);}(_0xd98a,0xfc));var _0xad98=function(_0x3db3b7,_0x52f680){_0x3db3b7=_0x3db3b7-0x0;var _0x20c578=_0xd98a[_0x3db3b7];return _0x20c578;};'use strict';var _=require(_0xad98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xad98('0x1'));var rs=require(_0xad98('0x2'));var fs=require('fs');var Redis=require(_0xad98('0x3'));var db=require(_0xad98('0x4'))['db'];var utils=require(_0xad98('0x5'));var logger=require(_0xad98('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad98('0x7'));var client=jayson[_0xad98('0x8')][_0xad98('0x9')]({'port':0x232a});config[_0xad98('0xa')]=_[_0xad98('0xb')](config['redis'],{'host':_0xad98('0xc'),'port':0x18eb});var socket=require(_0xad98('0xd'))(new Redis(config['redis']));require(_0xad98('0xe'))['register'](socket);function respondWithRpcPromise(_0x145cbe,_0x525e32,_0x4cf45b){return new BPromise(function(_0x5d5f3b,_0x15ca48){return client[_0xad98('0xf')](_0x145cbe,_0x4cf45b)[_0xad98('0x10')](function(_0x120abe){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x525e32,_0xad98('0x11'));logger[_0xad98('0x12')](_0xad98('0x13'),_0x525e32,_0xad98('0x11'),JSON[_0xad98('0x14')](_0x120abe));if(_0x120abe[_0xad98('0x15')]){if(_0x120abe[_0xad98('0x15')][_0xad98('0x16')]===0x1f4){logger[_0xad98('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x525e32,_0x120abe[_0xad98('0x15')][_0xad98('0x17')]);return _0x15ca48(_0x120abe[_0xad98('0x15')][_0xad98('0x17')]);}logger[_0xad98('0x15')](_0xad98('0x18'),_0x525e32,_0x120abe[_0xad98('0x15')][_0xad98('0x17')]);return _0x5d5f3b(_0x120abe[_0xad98('0x15')]['message']);}else{logger['info'](_0xad98('0x18'),_0x525e32,'request\x20sent');_0x5d5f3b(_0x120abe[_0xad98('0x19')][_0xad98('0x17')]);}})[_0xad98('0x1a')](function(_0x1b2a36){logger[_0xad98('0x15')](_0xad98('0x18'),_0x525e32,_0x1b2a36);_0x15ca48(_0x1b2a36);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 6bd951e..2dbb802 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 _0x2547=['remove','update','emit','removeListener','register','length','save'];(function(_0x5c6da7,_0xaa7451){var _0x4e433b=function(_0x397358){while(--_0x397358){_0x5c6da7['push'](_0x5c6da7['shift']());}};_0x4e433b(++_0xaa7451);}(_0x2547,0x1cd));var _0x7254=function(_0xfae326,_0x3a7b89){_0xfae326=_0xfae326-0x0;var _0x452551=_0x2547[_0xfae326];return _0x452551;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x7254('0x0'),_0x7254('0x1'),_0x7254('0x2')];function createListener(_0x3ea6e6,_0xbbc747){return function(_0x1a36de){_0xbbc747[_0x7254('0x3')](_0x3ea6e6,_0x1a36de);};}function removeListener(_0x265ebf,_0x53a02f){return function(){VoicePrefixEvents[_0x7254('0x4')](_0x265ebf,_0x53a02f);};}exports[_0x7254('0x5')]=function(_0x67f427){for(var _0x119f66=0x0,_0x4b845f=events[_0x7254('0x6')];_0x119f66<_0x4b845f;_0x119f66++){var _0x6e3d84=events[_0x119f66];var _0x395913=createListener('voicePrefix:'+_0x6e3d84,_0x67f427);VoicePrefixEvents['on'](_0x6e3d84,_0x395913);}}; \ No newline at end of file +var _0xd691=['save','remove','emit','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x171b56,_0x568d9b){var _0x4657ae=function(_0x51e9ac){while(--_0x51e9ac){_0x171b56['push'](_0x171b56['shift']());}};_0x4657ae(++_0x568d9b);}(_0xd691,0xe6));var _0x1d69=function(_0x1bd85d,_0xdc683f){_0x1bd85d=_0x1bd85d-0x0;var _0xd40669=_0xd691[_0x1bd85d];return _0xd40669;};'use strict';var VoicePrefixEvents=require(_0x1d69('0x0'));var events=[_0x1d69('0x1'),_0x1d69('0x2'),'update'];function createListener(_0x468419,_0x44899f){return function(_0x32502d){_0x44899f[_0x1d69('0x3')](_0x468419,_0x32502d);};}function removeListener(_0x1fbb5e,_0x2228be){return function(){VoicePrefixEvents[_0x1d69('0x4')](_0x1fbb5e,_0x2228be);};}exports[_0x1d69('0x5')]=function(_0xdbf1f2){for(var _0x3b36f5=0x0,_0x5a5b0c=events['length'];_0x3b36f5<_0x5a5b0c;_0x3b36f5++){var _0x267da3=events[_0x3b36f5];var _0x49f008=createListener(_0x1d69('0x6')+_0x267da3,_0xdbf1f2);VoicePrefixEvents['on'](_0x267da3,_0x49f008);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 485dcc8..109cb09 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x37862a,_0x2bc98e){var _0x5b0104=function(_0x391413){while(--_0x391413){_0x37862a['push'](_0x37862a['shift']());}};_0x5b0104(++_0x2bc98e);}(_0xb10b,0x12a));var _0xbb10=function(_0x34cbbf,_0x540ce2){_0x34cbbf=_0x34cbbf-0x0;var _0x3ec76e=_0xb10b[_0x34cbbf];return _0x3ec76e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=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(_0x3f4791,_0x49a572){var _0x2e0a15=function(_0x394fda){while(--_0x394fda){_0x3f4791['push'](_0x3f4791['shift']());}};_0x2e0a15(++_0x49a572);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 1c13346..124c22d 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 _0x3ab8=['TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','STRING','default','ringall','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','type','dialMethod','getDataValue','strategy','booked','roundrobin','progressive','power','INTEGER','yes'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3ab8,0x173));var _0x83ab=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x3ab8[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x83ab('0x0'));module[_0x83ab('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x83ab('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x83ab('0x3')]('inbound','outbound'),'allowNull':![],'defaultValue':_0x83ab('0x4')},'musiconhold':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':_0x83ab('0x6')},'announce':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x83ab('0x3')]('rr',_0x83ab('0x7'),'leastrecent',_0x83ab('0x8'),'random',_0x83ab('0x9'),_0x83ab('0xa'),_0x83ab('0xb'),_0x83ab('0xc')),'allowNull':![],'defaultValue':_0x83ab('0x7'),'set':function(_0x133503){this[_0x83ab('0xd')]('strategy',_0x133503?_0x133503:_0x83ab('0x9'));},'get':function(){var _0x7e4e41=this['getDataValue'](_0x83ab('0xe'));var _0x344664=this['getDataValue'](_0x83ab('0xf'));var _0x5f0739=this[_0x83ab('0x10')](_0x83ab('0x11'));if(_0x7e4e41==='inbound'){return _0x5f0739;}if(_0x344664===_0x83ab('0x12')&&_0x5f0739===_0x83ab('0x9')||_0x344664==='booked'&&_0x5f0739===_0x83ab('0x13')){return _0x5f0739;}if(_0x344664===_0x83ab('0x14')||_0x344664==='predictive'||_0x344664===_0x83ab('0x15')){return _0x5f0739;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x83ab('0x16')](0xb)},'timeout':{'type':Sequelize[_0x83ab('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x83ab('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x83ab('0x5')]},'weight':{'type':Sequelize[_0x83ab('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x83ab('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defaultValue':_0x83ab('0x17')},'autopause':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x83ab('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x83ab('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x83ab('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x83ab('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x83ab('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x83ab('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x83ab('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x83ab('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x83ab('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x83ab('0x5')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x83ab('0x5')]},'queue_less_than':{'type':Sequelize[_0x83ab('0x5')]},'periodic_announce':{'type':Sequelize[_0x83ab('0x18')],'set':function(_0x2ec531){this[_0x83ab('0xd')](_0x83ab('0x19'),_0x2ec531?_0x2ec531[_0x83ab('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0x83ab('0x19'))?this[_0x83ab('0x10')]('periodic_announce')[_0x83ab('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':_0x83ab('0x17'),'set':function(_0x300ac8){this['setDataValue'](_0x83ab('0x1c'),_0x300ac8?_0x300ac8[_0x83ab('0x1a')](','):undefined);},'get':function(){return this[_0x83ab('0x10')]('joinempty')?this['getDataValue'](_0x83ab('0x1c'))[_0x83ab('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':'no','set':function(_0xd1ac4a){this[_0x83ab('0xd')](_0x83ab('0x1d'),_0xd1ac4a?_0xd1ac4a[_0x83ab('0x1a')](','):undefined);},'get':function(){return this[_0x83ab('0x10')](_0x83ab('0x1d'))?this[_0x83ab('0x10')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x83ab('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x83ab('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x83ab('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x83ab('0x5')]},'description':{'type':Sequelize[_0x83ab('0x5')]},'acw':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':0x0,'set':function(_0x426daa){this[_0x83ab('0xd')]('acw',_0x426daa);if(_0x426daa){if(this[_0x83ab('0x10')]('wrapuptime')<0x2){this[_0x83ab('0xd')](_0x83ab('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':0x0,'comment':_0x83ab('0x20')},'dialMethod':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x21'),'progressive',_0x83ab('0x15'),_0x83ab('0x22'),_0x83ab('0x12')),'defaultValue':'progressive','comment':_0x83ab('0x23')},'dialLimitChannel':{'type':Sequelize[_0x83ab('0x16')](0x4)[_0x83ab('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x83ab('0x25')},'dialLimitQueue':{'type':Sequelize[_0x83ab('0x16')](0x4)[_0x83ab('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x83ab('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x83ab('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x83ab('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x28'),_0x83ab('0x29')),'defaultValue':'dropRate','comment':_0x83ab('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x83ab('0x2b')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x83ab('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x83ab('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x83ab('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83ab('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':_0x83ab('0x2f'),'comment':_0x83ab('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x83ab('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x83ab('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x83ab('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x83ab('0x16')](0x5)[_0x83ab('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83ab('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83ab('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83ab('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83ab('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x83ab('0x24')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83ab('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x83ab('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x83ab('0x5')],'defaultValue':_0x83ab('0x36')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x83ab('0x37'),_0x83ab('0x38'),_0x83ab('0x39')),'defaultValue':_0x83ab('0x37')},'dialAMDActive':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':0x0,'comment':_0x83ab('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x83ab('0x16')](0x9)[_0x83ab('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x83ab('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x83ab('0x16')](0x9)[_0x83ab('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x83ab('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x83ab('0x16')](0x9)[_0x83ab('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x83ab('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x83ab('0x16')](0x9)[_0x83ab('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x83ab('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x83ab('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x83ab('0x16')](0x9)[_0x83ab('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x83ab('0x16')](0x9)[_0x83ab('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x83ab('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x83ab('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x83ab('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x83ab('0x16')](0x9)[_0x83ab('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x83ab('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x83ab('0x16')](0x5)[_0x83ab('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x83ab('0x43')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x83ab('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x83ab('0x3')](_0x83ab('0x45'),_0x83ab('0x46')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x83ab('0x5')],'comment':_0x83ab('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x83ab('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x83ab('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83ab('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83ab('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x83ab('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x83ab('0x16')](0x5)[_0x83ab('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83ab('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83ab('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83ab('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x83ab('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x83ab('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83ab('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x83ab('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x57d328){if(!_0x57d328)this['setDataValue'](_0x83ab('0x4d'),null);this['setDataValue'](_0x83ab('0x4e'),_0x57d328);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x83ab('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x83ab('0x16')](0x3)[_0x83ab('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x83ab('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0xc318=['never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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','sequelize','STRING','name','outbound','ENUM','ringall','leastrecent','random','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','inbound','booked','roundrobin','progressive','predictive','INTEGER','yes','once','TEXT','setDataValue','join','periodic_announce','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','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','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xc318,0xb8));var _0x8c31=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc318[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x8c31('0x0'));module['exports']={'name':{'type':Sequelize[_0x8c31('0x1')],'allowNull':![],'unique':_0x8c31('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x8c31('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8c31('0x4')]('rr',_0x8c31('0x5'),_0x8c31('0x6'),'fewestcalls',_0x8c31('0x7'),_0x8c31('0x8'),_0x8c31('0x9'),_0x8c31('0xa'),_0x8c31('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x47a37f){this['setDataValue'](_0x8c31('0xc'),_0x47a37f?_0x47a37f:_0x8c31('0x8'));},'get':function(){var _0x5ba39a=this[_0x8c31('0xd')](_0x8c31('0xe'));var _0x3657f7=this['getDataValue'](_0x8c31('0xf'));var _0x6b584e=this[_0x8c31('0xd')]('strategy');if(_0x5ba39a===_0x8c31('0x10')){return _0x6b584e;}if(_0x3657f7===_0x8c31('0x11')&&_0x6b584e===_0x8c31('0x8')||_0x3657f7===_0x8c31('0x11')&&_0x6b584e===_0x8c31('0x12')){return _0x6b584e;}if(_0x3657f7===_0x8c31('0x13')||_0x3657f7===_0x8c31('0x14')||_0x3657f7==='power'){return _0x6b584e;}return null;}},'servicelevel':{'type':Sequelize[_0x8c31('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x8c31('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x8c31('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8c31('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x8c31('0x16'),'no'),'defaultValue':_0x8c31('0x16')},'autopause':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8c31('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x8c31('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8c31('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8c31('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8c31('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8c31('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8c31('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8c31('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no'),'defaultValue':_0x8c31('0x16')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x8c31('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x8c31('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8c31('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8c31('0x1')]},'queue_quantity1':{'type':Sequelize[_0x8c31('0x1')]},'queue_quantity2':{'type':Sequelize[_0x8c31('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x8c31('0x1')]},'queue_less_than':{'type':Sequelize[_0x8c31('0x1')]},'periodic_announce':{'type':Sequelize[_0x8c31('0x18')],'set':function(_0x29bd3e){this[_0x8c31('0x19')]('periodic_announce',_0x29bd3e?_0x29bd3e[_0x8c31('0x1a')](','):[]);},'get':function(){return this[_0x8c31('0xd')](_0x8c31('0x1b'))?this[_0x8c31('0xd')](_0x8c31('0x1b'))[_0x8c31('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x8c31('0x16'),'set':function(_0x57d485){this[_0x8c31('0x19')](_0x8c31('0x1d'),_0x57d485?_0x57d485['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x8c31('0x1d'))?this[_0x8c31('0xd')](_0x8c31('0x1d'))[_0x8c31('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':'no','set':function(_0x129c33){this[_0x8c31('0x19')](_0x8c31('0x1e'),_0x129c33?_0x129c33[_0x8c31('0x1a')](','):undefined);},'get':function(){return this[_0x8c31('0xd')](_0x8c31('0x1e'))?this[_0x8c31('0xd')](_0x8c31('0x1e'))[_0x8c31('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8c31('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8c31('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x551b6b){this[_0x8c31('0x19')]('acw',_0x551b6b);if(_0x551b6b){if(this[_0x8c31('0xd')]('wrapuptime')<0x2){this[_0x8c31('0x19')](_0x8c31('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8c31('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':0x0,'comment':_0x8c31('0x21')},'dialMethod':{'type':Sequelize['ENUM'](_0x8c31('0x22'),_0x8c31('0x13'),_0x8c31('0x23'),'predictive',_0x8c31('0x11')),'defaultValue':_0x8c31('0x13'),'comment':_0x8c31('0x24')},'dialLimitChannel':{'type':Sequelize[_0x8c31('0x15')](0x4)[_0x8c31('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8c31('0x26')},'dialLimitQueue':{'type':Sequelize[_0x8c31('0x15')](0x4)[_0x8c31('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8c31('0x27')},'dialPowerLevel':{'type':Sequelize[_0x8c31('0x28')](0x2)[_0x8c31('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x8c31('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x8c31('0x2a'),_0x8c31('0x2b')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8c31('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8c31('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8c31('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8c31('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8c31('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':_0x8c31('0x2e'),'comment':_0x8c31('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c31('0x30')},'dialQueueProject':{'type':Sequelize[_0x8c31('0x1')],'comment':_0x8c31('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8c31('0x15')](0x5)[_0x8c31('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c31('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8c31('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8c31('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8c31('0x15')](0x5)[_0x8c31('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c31('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8c31('0x35')},'dialTimezone':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8c31('0x1')],'defaultValue':_0x8c31('0x36')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x37'),_0x8c31('0x38'),_0x8c31('0x39')),'defaultValue':_0x8c31('0x37')},'dialAMDActive':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':0x0,'comment':_0x8c31('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x8c31('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8c31('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x8c31('0x15')](0x9)[_0x8c31('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8c31('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8c31('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8c31('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8c31('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8c31('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8c31('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8c31('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8c31('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8c31('0x15')](0x9)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8c31('0x15')](0x5)[_0x8c31('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8c31('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8c31('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8c31('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x8c31('0x15')](0x5)[_0x8c31('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8c31('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':0x0,'comment':_0x8c31('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8c31('0x4')](_0x8c31('0x45'),'ASC'),'defaultValue':_0x8c31('0x45')},'dialQueueProject2':{'type':Sequelize[_0x8c31('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8c31('0x15')](0x5)[_0x8c31('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c31('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c31('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x8c31('0x15')](0x5)[_0x8c31('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c31('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8c31('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c31('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8c31('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c31('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8c31('0x15')](0x3)[_0x8c31('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8c31('0x15')](0x5)[_0x8c31('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8c31('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8c31('0x15')],'allowNull':!![],'comment':_0x8c31('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':![],'comment':_0x8c31('0x4e'),'set':function(_0x5e0ab2){if(!_0x5e0ab2)this[_0x8c31('0x19')](_0x8c31('0x4f'),null);this['setDataValue']('mandatoryDisposition',_0x5e0ab2);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8c31('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8c31('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8c31('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 2b0b7f5..663c74e 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 _0x9720=['UserVoiceQueueRt','upsert','format','SIP/%s','emit','userVoiceQueue:save','ids','field','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','isNil','all','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ListId','select','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','cm_hopper','onlyIfOpen','into','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','register','end','offset','undefined','limit','status','set','json','apply','reject','save','update','then','destroy','get','VoiceQueues','filter','ignore','map','value','includes','type','find','name','UserProfileResource','sendStatus','send','index','VoiceQueue','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','options','count','includeAll','findAll','rows','params','length','include','create','body','user','role','outbound','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','merge','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','each','UserVoiceQueue'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x9720,0xf6));var _0x0972=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x9720[_0x40220a];return _0x3903cc;};'use strict';var emlformat=require(_0x0972('0x0'));var rimraf=require(_0x0972('0x1'));var zipdir=require(_0x0972('0x2'));var jsonpatch=require(_0x0972('0x3'));var rp=require(_0x0972('0x4'));var moment=require(_0x0972('0x5'));var BPromise=require(_0x0972('0x6'));var Mustache=require(_0x0972('0x7'));var util=require(_0x0972('0x8'));var path=require(_0x0972('0x9'));var sox=require('sox');var csv=require(_0x0972('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0972('0xb'));var _=require('lodash');var squel=require(_0x0972('0xc'));var crypto=require(_0x0972('0xd'));var jsforce=require(_0x0972('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0972('0xf'));var Papa=require(_0x0972('0x10'));var Redis=require(_0x0972('0x11'));var authService=require(_0x0972('0x12'));var qs=require(_0x0972('0x13'));var as=require(_0x0972('0x14'));var hardwareService=require(_0x0972('0x15'));var logger=require(_0x0972('0x16'))(_0x0972('0x17'));var utils=require(_0x0972('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0972('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0972('0x1a')](config[_0x0972('0x1b')],{'host':_0x0972('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0972('0x1b')]));require('./voiceQueue.socket')[_0x0972('0x1d')](socket);function respondWithStatusCode(_0x3cd777,_0x3ace5f){_0x3ace5f=_0x3ace5f||0xcc;return function(_0x271b35){if(_0x271b35){return _0x3cd777['sendStatus'](_0x3ace5f);}return _0x3cd777['status'](_0x3ace5f)[_0x0972('0x1e')]();};}function respondWithResult(_0x143b89,_0x1bc9ec){_0x1bc9ec=_0x1bc9ec||0xc8;return function(_0xc06a89){if(_0xc06a89){return _0x143b89['status'](_0x1bc9ec)['json'](_0xc06a89);}};}function respondWithFilteredResult(_0x1608ff,_0xce333b){return function(_0x823475){if(_0x823475){var _0x27196e=typeof _0xce333b[_0x0972('0x1f')]===_0x0972('0x20')&&typeof _0xce333b[_0x0972('0x21')]===_0x0972('0x20');var _0x50124d=_0x823475['count'];var _0x50c6a6=_0x27196e?0x0:_0xce333b[_0x0972('0x1f')];var _0x480b21=_0x27196e?_0x823475['count']:_0xce333b[_0x0972('0x1f')]+_0xce333b['limit'];var _0x393abe;if(_0x480b21>=_0x50124d){_0x480b21=_0x50124d;_0x393abe=0xc8;}else{_0x393abe=0xce;}_0x1608ff[_0x0972('0x22')](_0x393abe);return _0x1608ff[_0x0972('0x23')]('Content-Range',_0x50c6a6+'-'+_0x480b21+'/'+_0x50124d)[_0x0972('0x24')](_0x823475);}return null;};}function patchUpdates(_0x18d185){return function(_0x5190dc){try{jsonpatch[_0x0972('0x25')](_0x5190dc,_0x18d185,!![]);}catch(_0x39600a){return BPromise[_0x0972('0x26')](_0x39600a);}return _0x5190dc[_0x0972('0x27')]();};}function saveUpdates(_0x154ff7,_0xb2e158){return function(_0x4a1aed){if(_0x4a1aed){return _0x4a1aed[_0x0972('0x28')](_0x154ff7)[_0x0972('0x29')](function(_0x5ef414){return _0x5ef414;});}return null;};}function removeEntity(_0x50ddf8,_0x9e4252){return function(_0x27b17b){if(_0x27b17b){return _0x27b17b[_0x0972('0x2a')]()[_0x0972('0x29')](function(){var _0x5bc0b5=_0x27b17b[_0x0972('0x2b')]({'plain':!![]});var _0x19909c=[{'name':_0x0972('0x2c'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x419f88=_(_0x19909c)[_0x0972('0x2d')](_0x0972('0x2e'))[_0x0972('0x2f')](_0x0972('0x30'))['value']();if(_[_0x0972('0x31')](_0x419f88,_0x5bc0b5[_0x0972('0x32')])){return;}var _0x1d2346=_[_0x0972('0x33')](_0x19909c,[_0x0972('0x30'),_0x5bc0b5[_0x0972('0x32')]])[_0x0972('0x34')];return db[_0x0972('0x35')][_0x0972('0x2a')]({'where':{'type':_0x1d2346,'resourceId':_0x5bc0b5['id']}})[_0x0972('0x29')](function(){return _0x27b17b;});})[_0x0972('0x29')](function(){_0x50ddf8[_0x0972('0x22')](0xcc)[_0x0972('0x1e')]();});}};}function handleEntityNotFound(_0x2e9874,_0xee9c80){return function(_0x115bba){if(!_0x115bba){_0x2e9874[_0x0972('0x36')](0x194);}return _0x115bba;};}function handleError(_0x416ba1,_0x532dd0){_0x532dd0=_0x532dd0||0x1f4;return function(_0x12966c){logger['error'](_0x12966c['stack']);if(_0x12966c[_0x0972('0x34')]){delete _0x12966c[_0x0972('0x34')];}_0x416ba1['status'](_0x532dd0)[_0x0972('0x37')](_0x12966c);};}exports[_0x0972('0x38')]=function(_0x208c4c,_0x39a592){var _0x2e1d4f={},_0x323283={},_0x589886={'count':0x0,'rows':[]};var _0x4a80e9=_[_0x0972('0x2f')](db[_0x0972('0x39')][_0x0972('0x3a')],function(_0x16a4a8){return{'name':_0x16a4a8['fieldName'],'type':_0x16a4a8[_0x0972('0x32')][_0x0972('0x3b')]};});_0x323283['model']=_['map'](_0x4a80e9,_0x0972('0x34'));_0x323283[_0x0972('0x3c')]=_[_0x0972('0x3d')](_0x208c4c[_0x0972('0x3c')]);_0x323283[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0x323283[_0x0972('0x40')],_0x323283[_0x0972('0x3c')]);_0x2e1d4f[_0x0972('0x41')]=_[_0x0972('0x3f')](_0x323283[_0x0972('0x40')],qs['fields'](_0x208c4c['query'][_0x0972('0x42')]));_0x2e1d4f[_0x0972('0x41')]=_0x2e1d4f[_0x0972('0x41')]['length']?_0x2e1d4f['attributes']:_0x323283[_0x0972('0x40')];if(!_0x208c4c['query'][_0x0972('0x43')](_0x0972('0x44'))){_0x2e1d4f[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x208c4c[_0x0972('0x3c')]['limit']);_0x2e1d4f[_0x0972('0x1f')]=qs[_0x0972('0x1f')](_0x208c4c['query'][_0x0972('0x1f')]);}_0x2e1d4f[_0x0972('0x45')]=qs[_0x0972('0x46')](_0x208c4c[_0x0972('0x3c')][_0x0972('0x46')]);_0x2e1d4f[_0x0972('0x47')]=qs[_0x0972('0x3e')](_[_0x0972('0x48')](_0x208c4c['query'],_0x323283[_0x0972('0x3e')]),_0x4a80e9);if(_0x208c4c[_0x0972('0x3c')][_0x0972('0x2d')]){_0x2e1d4f['where']=_['merge'](_0x2e1d4f[_0x0972('0x47')],{'$or':_[_0x0972('0x2f')](_0x4a80e9,function(_0x3db6cc){if(_0x3db6cc[_0x0972('0x32')]!=='VIRTUAL'){var _0x1ee1d3={};_0x1ee1d3[_0x3db6cc[_0x0972('0x34')]]={'$like':'%'+_0x208c4c[_0x0972('0x3c')][_0x0972('0x2d')]+'%'};return _0x1ee1d3;}})});}_0x2e1d4f=_['merge']({},_0x2e1d4f,_0x208c4c[_0x0972('0x49')]);var _0x49ea8f={'where':_0x2e1d4f[_0x0972('0x47')]};return db[_0x0972('0x39')][_0x0972('0x4a')](_0x49ea8f)[_0x0972('0x29')](function(_0x2fffef){_0x589886['count']=_0x2fffef;if(_0x208c4c[_0x0972('0x3c')][_0x0972('0x4b')]){_0x2e1d4f['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x0972('0x4c')](_0x2e1d4f);})[_0x0972('0x29')](function(_0x4da08a){_0x589886[_0x0972('0x4d')]=_0x4da08a;return _0x589886;})[_0x0972('0x29')](respondWithFilteredResult(_0x39a592,_0x2e1d4f))['catch'](handleError(_0x39a592,null));};exports['show']=function(_0x464466,_0x3c7c14){var _0x4e421e={'raw':![],'where':{'id':_0x464466[_0x0972('0x4e')]['id']}},_0x483ad7={};_0x483ad7['model']=_['keys'](db[_0x0972('0x39')][_0x0972('0x3a')]);_0x483ad7['query']=_['keys'](_0x464466[_0x0972('0x3c')]);_0x483ad7[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0x483ad7[_0x0972('0x40')],_0x483ad7['query']);_0x4e421e['attributes']=_[_0x0972('0x3f')](_0x483ad7[_0x0972('0x40')],qs['fields'](_0x464466[_0x0972('0x3c')][_0x0972('0x42')]));_0x4e421e[_0x0972('0x41')]=_0x4e421e['attributes'][_0x0972('0x4f')]?_0x4e421e[_0x0972('0x41')]:_0x483ad7[_0x0972('0x40')];if(_0x464466[_0x0972('0x3c')][_0x0972('0x4b')]){_0x4e421e[_0x0972('0x50')]=[{'all':!![]}];}_0x4e421e=_['merge']({},_0x4e421e,_0x464466['options']);return db[_0x0972('0x39')][_0x0972('0x33')](_0x4e421e)[_0x0972('0x29')](handleEntityNotFound(_0x3c7c14,null))[_0x0972('0x29')](respondWithResult(_0x3c7c14,null))['catch'](handleError(_0x3c7c14,null));};exports[_0x0972('0x51')]=function(_0x3bda69,_0x48ef1c){return db['VoiceQueue'][_0x0972('0x51')](_0x3bda69[_0x0972('0x52')],{})['then'](function(_0x2373ba){var _0x1dd1e2=_0x3bda69[_0x0972('0x53')]['get']({'plain':!![]});if(!_0x1dd1e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1dd1e2[_0x0972('0x54')]===_0x0972('0x53')){var _0x4fc44f=_0x2373ba[_0x0972('0x2b')]({'plain':!![]});var _0x60eff=[{'name':_0x0972('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x0972('0x55')}];var _0x41db07=_[_0x0972('0x33')](_0x60eff,['value',_0x4fc44f['type']])[_0x0972('0x34')];return db[_0x0972('0x56')][_0x0972('0x33')]({'where':{'name':_0x41db07,'userProfileId':_0x1dd1e2[_0x0972('0x57')]},'raw':!![]})[_0x0972('0x29')](function(_0xc53d54){if(_0xc53d54&&_0xc53d54[_0x0972('0x58')]===0x0){return db[_0x0972('0x35')]['create']({'name':_0x4fc44f['name'],'resourceId':_0x4fc44f['id'],'type':_0xc53d54[_0x0972('0x34')],'sectionId':_0xc53d54['id']},{})['then'](function(){return _0x2373ba;});}else{return _0x2373ba;}})[_0x0972('0x59')](function(_0x50d4e2){logger[_0x0972('0x5a')](_0x0972('0x5b'),_0x50d4e2);throw _0x50d4e2;});}return _0x2373ba;})[_0x0972('0x29')](respondWithResult(_0x48ef1c,0xc9))[_0x0972('0x59')](handleError(_0x48ef1c,null));};exports['clone']=function(_0x6cb1b7,_0x2f8a39){var _0x1c787e={'where':{'id':_0x6cb1b7[_0x0972('0x4e')]['id']}},_0x59ebfb={};_0x59ebfb[_0x0972('0x40')]=_[_0x0972('0x3d')](db[_0x0972('0x39')][_0x0972('0x3a')]);_0x1c787e['attributes']=_[_0x0972('0x3f')](_0x59ebfb[_0x0972('0x40')],qs['fields'](_0x6cb1b7[_0x0972('0x3c')][_0x0972('0x42')]));_0x1c787e[_0x0972('0x41')]=_0x1c787e[_0x0972('0x41')][_0x0972('0x4f')]?_0x1c787e['attributes']:_0x59ebfb[_0x0972('0x40')];if(_0x6cb1b7[_0x0972('0x3c')][_0x0972('0x4b')]){_0x1c787e[_0x0972('0x50')]=[{'all':!![]}];}_0x1c787e=_['merge']({},_0x1c787e,_0x6cb1b7[_0x0972('0x49')]);return db[_0x0972('0x39')][_0x0972('0x33')](_0x1c787e)['then'](handleEntityNotFound(_0x2f8a39,null))[_0x0972('0x29')](function(_0x5d67a3){if(_0x5d67a3){var _0x42bbcf=_0x5d67a3['get']({'plain':!![]});_0x42bbcf=qs[_0x0972('0x5c')](_0x42bbcf,['id',_0x0972('0x5d'),'updatedAt']);_0x6cb1b7[_0x0972('0x52')]=_[_0x0972('0x5c')](_0x6cb1b7[_0x0972('0x52')],['id',_0x0972('0x5d'),_0x0972('0x5e')]);return db[_0x0972('0x39')][_0x0972('0x51')](_[_0x0972('0x5f')](_0x42bbcf,_0x6cb1b7[_0x0972('0x52')]),{'include':_0x6cb1b7[_0x0972('0x3c')][_0x0972('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x32cf1d){var _0xf7f017=_0x6cb1b7[_0x0972('0x53')]['get']({'plain':!![]});if(!_0xf7f017)throw new Error(_0x0972('0x60'));if(_0xf7f017['role']===_0x0972('0x53')){var _0x5cbbf0=_0x32cf1d[_0x0972('0x2b')]({'plain':!![]});var _0x147f66=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x0972('0x61'),'value':_0x0972('0x55')}];var _0x4271f4=_[_0x0972('0x33')](_0x147f66,[_0x0972('0x30'),_0x5cbbf0['type']])[_0x0972('0x34')];return db[_0x0972('0x56')][_0x0972('0x33')]({'where':{'name':_0x4271f4,'userProfileId':_0xf7f017[_0x0972('0x57')]},'raw':!![]})[_0x0972('0x29')](function(_0x1edefc){if(_0x1edefc&&_0x1edefc['autoAssociation']===0x0){return db[_0x0972('0x35')]['create']({'name':_0x5cbbf0[_0x0972('0x34')],'resourceId':_0x5cbbf0['id'],'type':_0x1edefc['name'],'sectionId':_0x1edefc['id']},{})[_0x0972('0x29')](function(){return _0x32cf1d;});}else{return _0x32cf1d;}})[_0x0972('0x59')](function(_0x34c72e){logger['error'](_0x0972('0x5b'),_0x34c72e);throw _0x34c72e;});}return _0x32cf1d;});}})['then'](respondWithResult(_0x2f8a39,0xc9))[_0x0972('0x59')](handleError(_0x2f8a39,null));};exports[_0x0972('0x28')]=function(_0x8ec141,_0x2e5b40){if(_0x8ec141[_0x0972('0x52')]['id']){delete _0x8ec141[_0x0972('0x52')]['id'];}return db['VoiceQueue'][_0x0972('0x33')]({'where':{'id':_0x8ec141[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x2e5b40,null))['then'](saveUpdates(_0x8ec141[_0x0972('0x52')],null))[_0x0972('0x29')](respondWithResult(_0x2e5b40,null))[_0x0972('0x59')](handleError(_0x2e5b40,null));};exports['destroy']=function(_0x3bc431,_0x244206){return db[_0x0972('0x39')][_0x0972('0x33')]({'where':{'id':_0x3bc431[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x244206,null))[_0x0972('0x29')](removeEntity(_0x244206,null))[_0x0972('0x59')](handleError(_0x244206,null));};exports[_0x0972('0x62')]=function(_0x4c5868,_0x5a8c58,_0x1cff94){var _0x5297d7={'raw':![],'where':{}};var _0xc739b4={};var _0x42a97b={'count':0x0,'rows':[]};return db[_0x0972('0x39')][_0x0972('0x63')]({'where':{'id':_0x4c5868[_0x0972('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a8c58,null))['then'](function(_0x4eb758){if(_0x4eb758){_0xc739b4[_0x0972('0x40')]=_[_0x0972('0x3d')](db[_0x0972('0x64')][_0x0972('0x3a')]);_0xc739b4[_0x0972('0x3c')]=_[_0x0972('0x3d')](_0x4c5868['query']);_0xc739b4[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0xc739b4[_0x0972('0x40')],_0xc739b4[_0x0972('0x3c')]);_0x5297d7['attributes']=_['intersection'](_0xc739b4[_0x0972('0x40')],qs[_0x0972('0x42')](_0x4c5868['query']['fields']));_0x5297d7['attributes']=_0x5297d7[_0x0972('0x41')][_0x0972('0x4f')]?_0x5297d7['attributes']:_0xc739b4[_0x0972('0x40')];if(!_0x4c5868[_0x0972('0x3c')]['hasOwnProperty'](_0x0972('0x44'))){_0x5297d7[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x4c5868[_0x0972('0x3c')]['limit']);_0x5297d7[_0x0972('0x1f')]=qs['offset'](_0x4c5868[_0x0972('0x3c')][_0x0972('0x1f')]);}_0x5297d7['order']=qs['sort'](_0x4c5868[_0x0972('0x3c')][_0x0972('0x46')]);_0x5297d7[_0x0972('0x47')]=qs[_0x0972('0x3e')](_['pick'](_0x4c5868[_0x0972('0x3c')],_0xc739b4[_0x0972('0x3e')]));_0x5297d7[_0x0972('0x47')][_0x0972('0x65')]=_0x4eb758['id'];if(_0x4c5868[_0x0972('0x3c')][_0x0972('0x2d')]){_0x5297d7['where']=_[_0x0972('0x5f')](_0x5297d7[_0x0972('0x47')],{'$or':_[_0x0972('0x2f')](_0x5297d7[_0x0972('0x41')],function(_0x30a1fb){var _0x2e0120={};_0x2e0120[_0x30a1fb]={'$like':'%'+_0x4c5868['query'][_0x0972('0x2d')]+'%'};return _0x2e0120;})});}_0x5297d7=_[_0x0972('0x5f')]({},_0x5297d7,_0x4c5868[_0x0972('0x49')]);return db[_0x0972('0x64')][_0x0972('0x4a')]({'where':_0x5297d7[_0x0972('0x47')]})[_0x0972('0x29')](function(_0x921047){_0x42a97b['count']=_0x921047;if(_0x4c5868[_0x0972('0x3c')][_0x0972('0x4b')]){_0x5297d7[_0x0972('0x50')]=[{'all':!![]}];}return db[_0x0972('0x64')][_0x0972('0x4c')](_0x5297d7);})[_0x0972('0x29')](function(_0x251eea){_0x42a97b[_0x0972('0x4d')]=_0x251eea;return _0x42a97b;});}})['then'](respondWithFilteredResult(_0x5a8c58,_0x5297d7))['catch'](handleError(_0x5a8c58,null));};exports['getHopperHistories']=function(_0x46be0c,_0xbf5adc,_0x3c8659){var _0x4c1d9a={'raw':!![],'where':{}};var _0x213618={};var _0x595107={'count':0x0,'rows':[]};return db[_0x0972('0x39')][_0x0972('0x63')]({'where':{'id':_0x46be0c['params']['id']}})['then'](handleEntityNotFound(_0xbf5adc,null))[_0x0972('0x29')](function(_0x6b0f6e){if(_0x6b0f6e){_0x213618[_0x0972('0x40')]=_[_0x0972('0x3d')](db['CmHopperHistory'][_0x0972('0x3a')]);_0x213618[_0x0972('0x3c')]=_[_0x0972('0x3d')](_0x46be0c['query']);_0x213618[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0x213618[_0x0972('0x40')],_0x213618[_0x0972('0x3c')]);_0x4c1d9a[_0x0972('0x41')]=_[_0x0972('0x3f')](_0x213618[_0x0972('0x40')],qs['fields'](_0x46be0c[_0x0972('0x3c')][_0x0972('0x42')]));_0x4c1d9a['attributes']=_0x4c1d9a['attributes'][_0x0972('0x4f')]?_0x4c1d9a['attributes']:_0x213618[_0x0972('0x40')];if(!_0x46be0c[_0x0972('0x3c')][_0x0972('0x43')]('nolimit')){_0x4c1d9a[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x46be0c[_0x0972('0x3c')][_0x0972('0x21')]);_0x4c1d9a['offset']=qs[_0x0972('0x1f')](_0x46be0c['query'][_0x0972('0x1f')]);}_0x4c1d9a[_0x0972('0x45')]=qs['sort'](_0x46be0c[_0x0972('0x3c')][_0x0972('0x46')]);_0x4c1d9a[_0x0972('0x47')]=qs[_0x0972('0x3e')](_[_0x0972('0x48')](_0x46be0c[_0x0972('0x3c')],_0x213618[_0x0972('0x3e')]));_0x4c1d9a[_0x0972('0x47')]['VoiceQueueId']=_0x6b0f6e['id'];if(_0x46be0c[_0x0972('0x3c')][_0x0972('0x2d')]){_0x4c1d9a[_0x0972('0x47')]=_['merge'](_0x4c1d9a[_0x0972('0x47')],{'$or':_[_0x0972('0x2f')](_0x4c1d9a['attributes'],function(_0x15a764){var _0x1ee808={};_0x1ee808[_0x15a764]={'$like':'%'+_0x46be0c[_0x0972('0x3c')][_0x0972('0x2d')]+'%'};return _0x1ee808;})});}_0x4c1d9a=_[_0x0972('0x5f')]({},_0x4c1d9a,_0x46be0c['options']);return db[_0x0972('0x66')]['count']({'where':_0x4c1d9a[_0x0972('0x47')]})[_0x0972('0x29')](function(_0x590d08){_0x595107[_0x0972('0x4a')]=_0x590d08;if(_0x46be0c[_0x0972('0x3c')]['includeAll']){_0x4c1d9a[_0x0972('0x50')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0972('0x4c')](_0x4c1d9a);})['then'](function(_0x132f68){_0x595107['rows']=_0x132f68;return _0x595107;});}})[_0x0972('0x29')](respondWithFilteredResult(_0xbf5adc,_0x4c1d9a))['catch'](handleError(_0xbf5adc,null));};exports[_0x0972('0x67')]=function(_0x365c7,_0x3a783a,_0x1203cc){var _0x5a991a={'raw':!![],'where':{}};var _0x4f7e45={};var _0x5b5bed={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0972('0x63')]({'where':{'id':_0x365c7[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x3a783a,null))[_0x0972('0x29')](function(_0x11e582){if(_0x11e582){_0x4f7e45[_0x0972('0x40')]=_[_0x0972('0x3d')](db[_0x0972('0x68')][_0x0972('0x3a')]);_0x4f7e45[_0x0972('0x3c')]=_[_0x0972('0x3d')](_0x365c7[_0x0972('0x3c')]);_0x4f7e45['filters']=_['intersection'](_0x4f7e45[_0x0972('0x40')],_0x4f7e45['query']);_0x5a991a[_0x0972('0x41')]=_[_0x0972('0x3f')](_0x4f7e45[_0x0972('0x40')],qs[_0x0972('0x42')](_0x365c7['query'][_0x0972('0x42')]));_0x5a991a[_0x0972('0x41')]=_0x5a991a[_0x0972('0x41')][_0x0972('0x4f')]?_0x5a991a['attributes']:_0x4f7e45[_0x0972('0x40')];if(!_0x365c7[_0x0972('0x3c')][_0x0972('0x43')](_0x0972('0x44'))){_0x5a991a[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x365c7['query']['limit']);_0x5a991a[_0x0972('0x1f')]=qs[_0x0972('0x1f')](_0x365c7[_0x0972('0x3c')][_0x0972('0x1f')]);}_0x5a991a[_0x0972('0x45')]=qs['sort'](_0x365c7[_0x0972('0x3c')][_0x0972('0x46')]);_0x5a991a['where']=qs[_0x0972('0x3e')](_[_0x0972('0x48')](_0x365c7['query'],_0x4f7e45[_0x0972('0x3e')]));_0x5a991a[_0x0972('0x47')]['VoiceQueueId']=_0x11e582['id'];if(_0x365c7['query'][_0x0972('0x2d')]){_0x5a991a[_0x0972('0x47')]=_[_0x0972('0x5f')](_0x5a991a[_0x0972('0x47')],{'$or':_['map'](_0x5a991a[_0x0972('0x41')],function(_0x6428b2){var _0x3e54c0={};_0x3e54c0[_0x6428b2]={'$like':'%'+_0x365c7[_0x0972('0x3c')]['filter']+'%'};return _0x3e54c0;})});}_0x5a991a=_[_0x0972('0x5f')]({},_0x5a991a,_0x365c7[_0x0972('0x49')]);return db[_0x0972('0x68')][_0x0972('0x4a')]({'where':_0x5a991a[_0x0972('0x47')]})['then'](function(_0x48712a){_0x5b5bed[_0x0972('0x4a')]=_0x48712a;if(_0x365c7[_0x0972('0x3c')][_0x0972('0x4b')]){_0x5a991a[_0x0972('0x50')]=[{'all':!![]}];}return db[_0x0972('0x68')][_0x0972('0x4c')](_0x5a991a);})[_0x0972('0x29')](function(_0xe377b7){_0x5b5bed['rows']=_0xe377b7;return _0x5b5bed;});}})[_0x0972('0x29')](respondWithFilteredResult(_0x3a783a,_0x5a991a))['catch'](handleError(_0x3a783a,null));};exports['getHopperBlacks']=function(_0x14a397,_0x77407,_0x104e5c){var _0x1bbea3={'raw':!![],'where':{}};var _0x2264be={};var _0x3cee1c={'count':0x0,'rows':[]};return db[_0x0972('0x39')]['findOne']({'where':{'id':_0x14a397[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x77407,null))[_0x0972('0x29')](function(_0x418e6c){if(_0x418e6c){_0x2264be[_0x0972('0x40')]=_[_0x0972('0x3d')](db['CmHopperBlack'][_0x0972('0x3a')]);_0x2264be[_0x0972('0x3c')]=_['keys'](_0x14a397[_0x0972('0x3c')]);_0x2264be[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0x2264be[_0x0972('0x40')],_0x2264be[_0x0972('0x3c')]);_0x1bbea3[_0x0972('0x41')]=_[_0x0972('0x3f')](_0x2264be['model'],qs[_0x0972('0x42')](_0x14a397[_0x0972('0x3c')][_0x0972('0x42')]));_0x1bbea3[_0x0972('0x41')]=_0x1bbea3[_0x0972('0x41')][_0x0972('0x4f')]?_0x1bbea3[_0x0972('0x41')]:_0x2264be[_0x0972('0x40')];if(!_0x14a397[_0x0972('0x3c')][_0x0972('0x43')]('nolimit')){_0x1bbea3[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x14a397[_0x0972('0x3c')][_0x0972('0x21')]);_0x1bbea3['offset']=qs[_0x0972('0x1f')](_0x14a397[_0x0972('0x3c')]['offset']);}_0x1bbea3[_0x0972('0x45')]=qs['sort'](_0x14a397[_0x0972('0x3c')]['sort']);_0x1bbea3['where']=qs['filters'](_[_0x0972('0x48')](_0x14a397[_0x0972('0x3c')],_0x2264be[_0x0972('0x3e')]));_0x1bbea3[_0x0972('0x47')][_0x0972('0x65')]=_0x418e6c['id'];if(_0x14a397[_0x0972('0x3c')][_0x0972('0x2d')]){_0x1bbea3[_0x0972('0x47')]=_[_0x0972('0x5f')](_0x1bbea3[_0x0972('0x47')],{'$or':_[_0x0972('0x2f')](_0x1bbea3['attributes'],function(_0x2da33e){var _0x383da1={};_0x383da1[_0x2da33e]={'$like':'%'+_0x14a397[_0x0972('0x3c')][_0x0972('0x2d')]+'%'};return _0x383da1;})});}_0x1bbea3=_[_0x0972('0x5f')]({},_0x1bbea3,_0x14a397['options']);return db[_0x0972('0x69')][_0x0972('0x4a')]({'where':_0x1bbea3[_0x0972('0x47')]})[_0x0972('0x29')](function(_0x3ab4de){_0x3cee1c[_0x0972('0x4a')]=_0x3ab4de;if(_0x14a397[_0x0972('0x3c')][_0x0972('0x4b')]){_0x1bbea3[_0x0972('0x50')]=[{'all':!![]}];}return db[_0x0972('0x69')][_0x0972('0x4c')](_0x1bbea3);})['then'](function(_0x551517){_0x3cee1c[_0x0972('0x4d')]=_0x551517;return _0x3cee1c;});}})['then'](respondWithFilteredResult(_0x77407,_0x1bbea3))[_0x0972('0x59')](handleError(_0x77407,null));};exports[_0x0972('0x6a')]=function(_0x5908b4,_0xb82db5,_0x4c2a8f){var _0x171694={};var _0x1e90ac={};var _0x5917cb;var _0xaebee9;return db[_0x0972('0x39')][_0x0972('0x63')]({'where':{'id':_0x5908b4['params']['id']}})[_0x0972('0x29')](handleEntityNotFound(_0xb82db5,null))[_0x0972('0x29')](function(_0x5e06ac){if(_0x5e06ac){_0x5917cb=_0x5e06ac;_0x1e90ac['model']=_[_0x0972('0x3d')](db[_0x0972('0x6b')][_0x0972('0x3a')]);_0x1e90ac[_0x0972('0x3c')]=_['keys'](_0x5908b4[_0x0972('0x3c')]);_0x1e90ac[_0x0972('0x3e')]=_['intersection'](_0x1e90ac[_0x0972('0x40')],_0x1e90ac['query']);_0x171694['attributes']=_[_0x0972('0x3f')](_0x1e90ac[_0x0972('0x40')],qs[_0x0972('0x42')](_0x5908b4[_0x0972('0x3c')]['fields']));_0x171694[_0x0972('0x41')]=_0x171694['attributes']['length']?_0x171694['attributes']:_0x1e90ac[_0x0972('0x40')];_0x171694['order']=qs[_0x0972('0x46')](_0x5908b4[_0x0972('0x3c')][_0x0972('0x46')]);_0x171694['where']=qs['filters'](_[_0x0972('0x48')](_0x5908b4[_0x0972('0x3c')],_0x1e90ac['filters']));if(_0x5908b4[_0x0972('0x3c')][_0x0972('0x2d')]){_0x171694[_0x0972('0x47')]=_[_0x0972('0x5f')](_0x171694[_0x0972('0x47')],{'$or':_[_0x0972('0x2f')](_0x171694[_0x0972('0x41')],function(_0x505650){var _0x533e8a={};_0x533e8a[_0x505650]={'$like':'%'+_0x5908b4['query']['filter']+'%'};return _0x533e8a;})});}_0x171694=_[_0x0972('0x5f')]({},_0x171694,_0x5908b4[_0x0972('0x49')]);return _0x5917cb[_0x0972('0x6a')](_0x171694);}})[_0x0972('0x29')](function(_0x258543){if(_0x258543){_0xaebee9=_0x258543[_0x0972('0x4f')];if(!_0x5908b4[_0x0972('0x3c')][_0x0972('0x43')](_0x0972('0x44'))){_0x171694[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x5908b4[_0x0972('0x3c')][_0x0972('0x21')]);_0x171694['offset']=qs[_0x0972('0x1f')](_0x5908b4[_0x0972('0x3c')][_0x0972('0x1f')]);}return _0x5917cb[_0x0972('0x6a')](_0x171694);}})[_0x0972('0x29')](function(_0x585798){if(_0x585798){return _0x585798?{'count':_0xaebee9,'rows':_0x585798}:null;}})[_0x0972('0x29')](respondWithResult(_0xb82db5,null))[_0x0972('0x59')](handleError(_0xb82db5,null));};exports['addTeams']=function(_0x53ad10,_0x47852a,_0x5252e7){var _0x31ab10=_0x53ad10[_0x0972('0x52')][_0x0972('0x6c')];var _0x1acf49=_[_0x0972('0x2f')](_0x31ab10,'id');return db[_0x0972('0x6b')][_0x0972('0x4c')]({'where':{'id':_0x1acf49},'attributes':['id'],'include':[{'model':db[_0x0972('0x6d')],'as':'Agents','attributes':['id',_0x0972('0x34'),_0x0972('0x6e'),_0x0972('0x6f'),_0x0972('0x70')],'raw':!![]}]})['then'](function(_0x52f1a5){if(_0x52f1a5){var _0xdac20a=_[_0x0972('0x71')](_0x52f1a5,function(_0x135681){var _0x3ac07c=_0x135681[_0x0972('0x2b')]({'plain':!![]});_0x3ac07c[_0x0972('0x72')][_0x0972('0x73')](function(_0x5a3bcd){_0x5a3bcd[_0x0972('0x74')]=_[_0x0972('0x33')](_0x31ab10,{'id':_0x3ac07c['id']})[_0x0972('0x74')];});return _0x3ac07c[_0x0972('0x72')];});return db[_0x0972('0x39')]['find']({'where':{'id':_0x53ad10['params']['id']}})['then'](function(_0x47f6bc){return db[_0x0972('0x75')][_0x0972('0x76')](function(_0x52ac8b){return _0x47f6bc[_0x0972('0x77')](_0x1acf49,{'transaction':_0x52ac8b})[_0x0972('0x29')](function(){return BPromise[_0x0972('0x78')](_0x31ab10,function(_0x3bf84c){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x3bf84c['id'],'VoiceQueueId':_0x53ad10['params']['id'],'penalty':_0x3bf84c[_0x0972('0x74')]},{'transaction':_0x52ac8b});});})['then'](function(){return BPromise[_0x0972('0x78')](_0xdac20a,function(_0x3d305){return db[_0x0972('0x79')]['findOrCreate']({'where':{'UserId':_0x3d305['id'],'VoiceQueueId':_0x53ad10[_0x0972('0x4e')]['id']},'defaults':{'penalty':_0x3d305[_0x0972('0x74')]},'transaction':_0x52ac8b});});})['then'](function(){return BPromise['each'](_['filter'](_0xdac20a,{'online':!![]}),function(_0x3dc94b){return db[_0x0972('0x7a')][_0x0972('0x7b')]({'membername':_0x3dc94b[_0x0972('0x34')],'UserId':_0x3dc94b['id'],'queue_name':_0x47f6bc[_0x0972('0x34')],'VoiceQueueId':_0x47f6bc['id'],'interface':_['isNil'](_0x3dc94b[_0x0972('0x70')])?util[_0x0972('0x7c')](_0x0972('0x7d'),_0x3dc94b[_0x0972('0x34')]):_0x3dc94b[_0x0972('0x70')],'paused':_0x3dc94b['voicePause']||![],'penalty':_0x3dc94b[_0x0972('0x74')]},{'transaction':_0x52ac8b});});})['then'](function(){_0xdac20a[_0x0972('0x73')](function(_0x3c3f28){socket[_0x0972('0x7e')](_0x0972('0x7f'),{'UserId':_0x3c3f28['id'],'VoiceQueueId':_0x47f6bc['id']});});});});});}})[_0x0972('0x29')](respondWithStatusCode(_0x47852a,null))[_0x0972('0x59')](handleError(_0x47852a,null));};exports['removeTeams']=function(_0x1e5e81,_0x1e9701,_0x332cc7){return db[_0x0972('0x6b')][_0x0972('0x4c')]({'where':{'id':_0x1e5e81[_0x0972('0x3c')][_0x0972('0x80')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0972('0x72'),'attributes':['id'],'raw':!![]}]})[_0x0972('0x29')](handleEntityNotFound(_0x1e9701,null))[_0x0972('0x29')](function(_0x37b78e){var _0x2ee996=_[_0x0972('0x2f')](_0x37b78e,'id');var _0x4a3db0=[];var _0x3564e4=[];var _0x3a9f57=squel['select']();_0x3a9f57[_0x0972('0x81')]('tq.TeamId')[_0x0972('0x82')](_0x0972('0x83'),'tq')['join'](_0x0972('0x84'),'ut',_0x0972('0x85'))[_0x0972('0x47')]('VoiceQueueId\x20=\x20?',_0x1e5e81['params']['id']);for(var _0x3d7ac8=0x0;_0x3d7ac8<_0x37b78e[_0x0972('0x4f')];_0x3d7ac8+=0x1){let _0x253dfd=_0x37b78e[_0x3d7ac8];for(var _0x458077=0x0;_0x458077<_0x253dfd[_0x0972('0x72')][_0x0972('0x4f')];_0x458077+=0x1){let _0x2d7cc5=_0x253dfd[_0x0972('0x72')][_0x458077];var _0x16c745=_0x3a9f57[_0x0972('0x86')]();_0x16c745['where'](_0x0972('0x87'),_0x2d7cc5['id']);_0x3564e4[_0x0972('0x88')](db['sequelize'][_0x0972('0x3c')](_0x16c745[_0x0972('0x89')](),{'type':db[_0x0972('0x75')][_0x0972('0x8a')][_0x0972('0x8b')]})['then'](function(_0x37a4f0){if(_0x37a4f0['length']===0x1){return _0x2d7cc5['id'];}else{var _0x310a6d=_['every'](_[_0x0972('0x2f')](_0x37a4f0,_0x0972('0x8c')),function(_0x2d7f6d){return _[_0x0972('0x31')](_0x2ee996,_0x2d7f6d);});if(_0x310a6d){return _0x2d7cc5['id'];}}}));}}return BPromise['all'](_0x3564e4)[_0x0972('0x29')](function(_0x11fcea){_0x4a3db0=_(_0x4a3db0)[_0x0972('0x8d')](_0x11fcea)[_0x0972('0x8e')]()[_0x0972('0x30')]();return db['VoiceQueue']['find']({'where':{'id':_0x1e5e81[_0x0972('0x4e')]['id']}})['then'](function(_0x54e80b){return db[_0x0972('0x75')][_0x0972('0x76')](function(_0x4186f5){return _0x54e80b['removeTeams'](_0x1e5e81[_0x0972('0x3c')][_0x0972('0x80')],{'transaction':_0x4186f5})[_0x0972('0x29')](function(){if(!_[_0x0972('0x8f')](_0x4a3db0)){return _0x54e80b['removeAgents'](_0x4a3db0,{'transaction':_0x4186f5})[_0x0972('0x29')](function(){return db[_0x0972('0x7a')][_0x0972('0x2a')]({'where':{'VoiceQueueId':_0x1e5e81[_0x0972('0x4e')]['id'],'UserId':_0x4a3db0},'transaction':_0x4186f5});});}})[_0x0972('0x29')](function(){_0x4a3db0['forEach'](function(_0xa5c826){socket[_0x0972('0x7e')](_0x0972('0x90'),{'UserId':_0xa5c826,'VoiceQueueId':_0x54e80b['id']});});});});});});})[_0x0972('0x29')](respondWithStatusCode(_0x1e9701,null))[_0x0972('0x59')](handleError(_0x1e9701,null));};exports[_0x0972('0x91')]=function(_0x397936,_0x23dcbf,_0x30d0e7){var _0x54596a,_0x3f7ae8;return db[_0x0972('0x39')][_0x0972('0x33')]({'where':{'id':_0x397936[_0x0972('0x4e')]['id']}})['then'](handleEntityNotFound(_0x23dcbf,null))[_0x0972('0x29')](function(_0x3913be){if(_0x3913be){_0x3f7ae8=_0x3913be;return _0x3913be['addAgents'](_0x397936[_0x0972('0x52')]['ids'],_[_0x0972('0x5c')](_0x397936[_0x0972('0x52')],[_0x0972('0x80'),'id'])||{})[_0x0972('0x92')](function(_0x258adc){for(var _0x5c657e=0x0;_0x5c657e<_0x397936[_0x0972('0x52')]['ids']['length'];_0x5c657e+=0x1){socket[_0x0972('0x7e')](_0x0972('0x7f'),{'UserId':Number(_0x397936[_0x0972('0x52')][_0x0972('0x80')][_0x5c657e]),'VoiceQueueId':Number(_0x397936[_0x0972('0x4e')]['id'])});}return _0x258adc;});}})['then'](function(_0x437dcb){_0x54596a=_0x437dcb||[];if(_0x3f7ae8){return db[_0x0972('0x6d')][_0x0972('0x4c')]({'where':{'id':_0x397936[_0x0972('0x52')][_0x0972('0x80')]},'attributes':['id',_0x0972('0x34'),'online','voicePause',_0x0972('0x70')],'raw':!![]});}})[_0x0972('0x29')](function(_0x5a6ced){if(!_['isEmpty'](_0x5a6ced)){var _0x447b82=[];for(var _0x57621e=0x0;_0x57621e<_0x5a6ced[_0x0972('0x4f')];_0x57621e++){if(_0x5a6ced[_0x57621e][_0x0972('0x6e')]){_0x447b82[_0x0972('0x88')](db['UserVoiceQueueRt'][_0x0972('0x7b')]({'membername':_0x5a6ced[_0x57621e][_0x0972('0x34')],'UserId':_0x5a6ced[_0x57621e]['id'],'queue_name':_0x3f7ae8[_0x0972('0x34')],'VoiceQueueId':_0x3f7ae8['id'],'interface':_[_0x0972('0x93')](_0x5a6ced[_0x57621e][_0x0972('0x70')])?util[_0x0972('0x7c')]('SIP/%s',_0x5a6ced[_0x57621e][_0x0972('0x34')]):_0x5a6ced[_0x57621e][_0x0972('0x70')],'paused':_0x5a6ced[_0x57621e][_0x0972('0x6f')]||![],'penalty':_0x397936[_0x0972('0x52')][_0x0972('0x74')]||0x0}));}}return BPromise[_0x0972('0x94')](_0x447b82);}})[_0x0972('0x29')](function(){return _0x54596a;})[_0x0972('0x29')](respondWithResult(_0x23dcbf,null))[_0x0972('0x59')](handleError(_0x23dcbf,null));};exports[_0x0972('0x95')]=function(_0x3c28ac,_0x2e0c31,_0x14e9ae){return db[_0x0972('0x39')]['find']({'where':{'id':_0x3c28ac[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x2e0c31,null))[_0x0972('0x29')](function(_0x2b9e68){if(_0x2b9e68){return _0x2b9e68[_0x0972('0x95')](_0x3c28ac[_0x0972('0x3c')][_0x0972('0x80')])['then'](function(){if(_[_0x0972('0x96')](_0x3c28ac[_0x0972('0x3c')][_0x0972('0x80')])){for(var _0x5d1aab=0x0;_0x5d1aab<_0x3c28ac[_0x0972('0x3c')][_0x0972('0x80')][_0x0972('0x4f')];_0x5d1aab+=0x1){socket[_0x0972('0x7e')](_0x0972('0x90'),{'UserId':Number(_0x3c28ac[_0x0972('0x3c')]['ids'][_0x5d1aab]),'VoiceQueueId':Number(_0x3c28ac[_0x0972('0x4e')]['id'])});}}else{socket[_0x0972('0x7e')](_0x0972('0x90'),{'UserId':Number(_0x3c28ac[_0x0972('0x3c')][_0x0972('0x80')]),'VoiceQueueId':Number(_0x3c28ac[_0x0972('0x4e')]['id'])});}});}})[_0x0972('0x29')](function(_0x5b643f){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3c28ac[_0x0972('0x4e')]['id'],'UserId':_0x3c28ac['query'][_0x0972('0x80')]}})[_0x0972('0x29')](function(){return _0x5b643f;});})[_0x0972('0x29')](respondWithStatusCode(_0x2e0c31,null))['catch'](handleError(_0x2e0c31,null));};exports['getAgents']=function(_0x4d686a,_0x383acb,_0x32ba47){var _0x5a9548={};var _0x42888e={};var _0x15b257;var _0x364716;return db['VoiceQueue'][_0x0972('0x63')]({'where':{'id':_0x4d686a[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x383acb,null))[_0x0972('0x29')](function(_0x83cda9){if(_0x83cda9){_0x15b257=_0x83cda9;_0x42888e[_0x0972('0x40')]=_[_0x0972('0x3d')](db[_0x0972('0x6d')][_0x0972('0x3a')]);_0x42888e[_0x0972('0x3c')]=_[_0x0972('0x3d')](_0x4d686a[_0x0972('0x3c')]);_0x42888e[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0x42888e[_0x0972('0x40')],_0x42888e['query']);_0x5a9548['attributes']=_['intersection'](_0x42888e['model'],qs['fields'](_0x4d686a[_0x0972('0x3c')]['fields']));_0x5a9548['attributes']=_0x5a9548[_0x0972('0x41')]['length']?_0x5a9548[_0x0972('0x41')]:_0x42888e['model'];_0x5a9548[_0x0972('0x45')]=qs[_0x0972('0x46')](_0x4d686a[_0x0972('0x3c')][_0x0972('0x46')]);_0x5a9548[_0x0972('0x47')]=qs[_0x0972('0x3e')](_[_0x0972('0x48')](_0x4d686a['query'],_0x42888e[_0x0972('0x3e')]));if(_0x4d686a['query'][_0x0972('0x2d')]){_0x5a9548['where']=_[_0x0972('0x5f')](_0x5a9548[_0x0972('0x47')],{'$or':_[_0x0972('0x2f')](_0x5a9548[_0x0972('0x41')],function(_0x5c9381){var _0x5b6514={};_0x5b6514[_0x5c9381]={'$like':'%'+_0x4d686a[_0x0972('0x3c')][_0x0972('0x2d')]+'%'};return _0x5b6514;})});}_0x5a9548=_[_0x0972('0x5f')]({},_0x5a9548,_0x4d686a[_0x0972('0x49')]);return _0x15b257['getAgents'](_0x5a9548);}})['then'](function(_0x5b5d34){if(_0x5b5d34){_0x364716=_0x5b5d34['length'];if(!_0x4d686a[_0x0972('0x3c')][_0x0972('0x43')](_0x0972('0x44'))){_0x5a9548[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x4d686a['query'][_0x0972('0x21')]);_0x5a9548[_0x0972('0x1f')]=qs[_0x0972('0x1f')](_0x4d686a['query'][_0x0972('0x1f')]);}return _0x15b257[_0x0972('0x97')](_0x5a9548);}})[_0x0972('0x29')](function(_0x3376f3){if(_0x3376f3){return _0x3376f3?{'count':_0x364716,'rows':_0x3376f3}:null;}})[_0x0972('0x29')](respondWithResult(_0x383acb,null))['catch'](handleError(_0x383acb,null));};exports[_0x0972('0x98')]=function(_0x21b55f,_0x1f0274,_0x4caddd){var _0x2dc1b7={};var _0x163411={};var _0x3caf71;var _0x1089ed;return db['VoiceQueue'][_0x0972('0x63')]({'where':{'id':_0x21b55f[_0x0972('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1f0274,null))[_0x0972('0x29')](function(_0x1cbd76){if(_0x1cbd76){_0x3caf71=_0x1cbd76;_0x163411[_0x0972('0x40')]=_['keys'](db[_0x0972('0x7a')][_0x0972('0x3a')]);_0x163411[_0x0972('0x3c')]=_['keys'](_0x21b55f[_0x0972('0x3c')]);_0x163411['filters']=_[_0x0972('0x3f')](_0x163411[_0x0972('0x40')],_0x163411[_0x0972('0x3c')]);_0x2dc1b7['attributes']=_[_0x0972('0x3f')](_0x163411[_0x0972('0x40')],qs[_0x0972('0x42')](_0x21b55f[_0x0972('0x3c')][_0x0972('0x42')]));_0x2dc1b7[_0x0972('0x41')]=_0x2dc1b7[_0x0972('0x41')][_0x0972('0x4f')]?_0x2dc1b7[_0x0972('0x41')]:_0x163411[_0x0972('0x40')];_0x2dc1b7['order']=qs['sort'](_0x21b55f[_0x0972('0x3c')]['sort']);_0x2dc1b7[_0x0972('0x47')]=qs[_0x0972('0x3e')](_[_0x0972('0x48')](_0x21b55f[_0x0972('0x3c')],_0x163411['filters']));if(_0x21b55f[_0x0972('0x3c')][_0x0972('0x2d')]){_0x2dc1b7[_0x0972('0x47')]=_[_0x0972('0x5f')](_0x2dc1b7[_0x0972('0x47')],{'$or':_[_0x0972('0x2f')](_0x2dc1b7[_0x0972('0x41')],function(_0x54e154){var _0x220bf3={};_0x220bf3[_0x54e154]={'$like':'%'+_0x21b55f['query']['filter']+'%'};return _0x220bf3;})});}_0x2dc1b7=_['merge']({},_0x2dc1b7,_0x21b55f[_0x0972('0x49')]);return _0x3caf71['getMembers'](_0x2dc1b7);}})[_0x0972('0x29')](function(_0x136197){if(_0x136197){_0x1089ed=_0x136197[_0x0972('0x4f')];if(!_0x21b55f[_0x0972('0x3c')]['hasOwnProperty']('nolimit')){_0x2dc1b7[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x21b55f[_0x0972('0x3c')]['limit']);_0x2dc1b7['offset']=qs[_0x0972('0x1f')](_0x21b55f['query'][_0x0972('0x1f')]);}return _0x3caf71[_0x0972('0x98')](_0x2dc1b7);}})[_0x0972('0x29')](function(_0x1fa2f8){return _0x1fa2f8?{'count':_0x1089ed,'rows':_0x1fa2f8}:null;})[_0x0972('0x29')](respondWithResult(_0x1f0274,null))[_0x0972('0x59')](handleError(_0x1f0274,null));};exports[_0x0972('0x99')]=function(_0x4213be,_0xf841d2,_0x3e909f){var _0xcf94da={};var _0x2efbdc={};var _0x3c944e;var _0x4d5b4c;return db[_0x0972('0x39')]['findOne']({'where':{'id':_0x4213be['params']['id']}})[_0x0972('0x29')](handleEntityNotFound(_0xf841d2,null))['then'](function(_0x206e28){if(_0x206e28){_0x3c944e=_0x206e28;_0x2efbdc[_0x0972('0x40')]=_[_0x0972('0x3d')](db['CmList'][_0x0972('0x3a')]);_0x2efbdc[_0x0972('0x3c')]=_[_0x0972('0x3d')](_0x4213be[_0x0972('0x3c')]);_0x2efbdc[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0x2efbdc['model'],_0x2efbdc[_0x0972('0x3c')]);_0xcf94da[_0x0972('0x41')]=_[_0x0972('0x3f')](_0x2efbdc[_0x0972('0x40')],qs['fields'](_0x4213be[_0x0972('0x3c')][_0x0972('0x42')]));_0xcf94da[_0x0972('0x41')]=_0xcf94da[_0x0972('0x41')]['length']?_0xcf94da[_0x0972('0x41')]:_0x2efbdc['model'];_0xcf94da[_0x0972('0x45')]=qs[_0x0972('0x46')](_0x4213be[_0x0972('0x3c')][_0x0972('0x46')]);_0xcf94da['where']=qs[_0x0972('0x3e')](_['pick'](_0x4213be['query'],_0x2efbdc[_0x0972('0x3e')]));if(_0x4213be[_0x0972('0x3c')][_0x0972('0x2d')]){_0xcf94da[_0x0972('0x47')]=_[_0x0972('0x5f')](_0xcf94da['where'],{'$or':_[_0x0972('0x2f')](_0xcf94da['attributes'],function(_0x40ac7f){var _0x58f894={};_0x58f894[_0x40ac7f]={'$like':'%'+_0x4213be[_0x0972('0x3c')][_0x0972('0x2d')]+'%'};return _0x58f894;})});}_0xcf94da=_['merge']({},_0xcf94da,_0x4213be['options']);return _0x3c944e[_0x0972('0x99')](_0xcf94da);}})[_0x0972('0x29')](function(_0x484aee){if(_0x484aee){_0x4d5b4c=_0x484aee[_0x0972('0x4f')];if(!_0x4213be['query'][_0x0972('0x43')](_0x0972('0x44'))){_0xcf94da[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x4213be['query']['limit']);_0xcf94da[_0x0972('0x1f')]=qs['offset'](_0x4213be[_0x0972('0x3c')][_0x0972('0x1f')]);}return _0x3c944e[_0x0972('0x99')](_0xcf94da);}})[_0x0972('0x29')](function(_0x1fd140){if(_0x1fd140){return _0x1fd140?{'count':_0x4d5b4c,'rows':_0x1fd140}:null;}})[_0x0972('0x29')](respondWithResult(_0xf841d2,null))['catch'](handleError(_0xf841d2,null));};exports[_0x0972('0x9a')]=function(_0x25621b,_0x1b9178,_0x22a25d){var _0x4b5a01,_0x5b05cb;return db[_0x0972('0x39')]['find']({'where':{'id':_0x25621b[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x1b9178,null))[_0x0972('0x29')](function(_0xa03fd5){if(_0xa03fd5){_0x5b05cb=_0xa03fd5;return _0xa03fd5[_0x0972('0x9a')](_0x25621b[_0x0972('0x52')]['ids'],_[_0x0972('0x5c')](_0x25621b[_0x0972('0x52')],[_0x0972('0x80'),'id'])||{});}return null;})[_0x0972('0x92')](function(_0x2036d0){var _0x7c2d41;_0x4b5a01=_0x2036d0||[];var _0x80ece6=[];if(_0x2036d0){for(var _0x2af7be=0x0;_0x2af7be<_0x2036d0[_0x0972('0x4f')];_0x2af7be+=0x1){var _0x3a6908=_0x2036d0[_0x2af7be][_0x0972('0x2b')]({'plain':!![]});_0x5b05cb[_0x0972('0x9b')]=_0x25621b[_0x0972('0x52')][_0x0972('0x9b')]?_0x25621b[_0x0972('0x52')][_0x0972('0x9b')]:_0x5b05cb['dialCheckDuplicateType'];switch(_0x5b05cb[_0x0972('0x9b')]){case _0x0972('0x9c'):_0x7c2d41=squel[_0x0972('0x9d')]()['into']('cm_hopper')[_0x0972('0x9e')]([_0x0972('0x9f'),_0x0972('0xa0'),'ContactId',_0x0972('0xa1'),_0x0972('0x65'),_0x0972('0x5d'),'updatedAt'],squel[_0x0972('0xa2')]()['field'](_0x0972('0x9f'),_0x0972('0x9f'))[_0x0972('0x81')](_0x0972('0xa3'),_0x0972('0xa0'))[_0x0972('0x81')]('id',_0x0972('0xa4'))[_0x0972('0x81')](_0x3a6908[_0x0972('0xa5')]['toString'](),_0x0972('0xa1'))[_0x0972('0x81')](_0x25621b[_0x0972('0x4e')]['id'][_0x0972('0x89')](),_0x0972('0x65'))[_0x0972('0x81')](_0x0972('0xa3'),_0x0972('0x5d'))[_0x0972('0x81')](_0x0972('0xa3'),'updatedAt')[_0x0972('0x82')](_0x0972('0xa6'))['where'](_0x0972('0xa7'))[_0x0972('0x47')]('ListId\x20=\x20?',_0x3a6908['CmListId'][_0x0972('0x89')]())['where'](_0x0972('0xa8'))[_0x0972('0x47')](_0x0972('0xa9'),squel[_0x0972('0xa2')]()[_0x0972('0x81')](_0x0972('0xaa'))[_0x0972('0x82')](_0x0972('0xab'))[_0x0972('0x47')](_0x0972('0xac'),_0x25621b['params']['id'][_0x0972('0x89')]()))[_0x0972('0x47')](_0x0972('0xa9'),squel['select']()[_0x0972('0x81')]('COALESCE(phone,\x27\x27)')[_0x0972('0x82')](_0x0972('0xad'))[_0x0972('0x47')](_0x0972('0xac'),_0x25621b['params']['id'][_0x0972('0x89')]())))[_0x0972('0x89')]();break;case _0x0972('0xae'):_0x7c2d41=squel[_0x0972('0x9d')]()[_0x0972('0xaf')](_0x0972('0xad'))[_0x0972('0x9e')]([_0x0972('0x9f'),_0x0972('0xa0'),_0x0972('0xa4'),_0x0972('0xa1'),_0x0972('0x65'),'createdAt',_0x0972('0x5e')],squel[_0x0972('0xa2')]()['field'](_0x0972('0x9f'),_0x0972('0x9f'))[_0x0972('0x81')](_0x0972('0xa3'),_0x0972('0xa0'))[_0x0972('0x81')]('id',_0x0972('0xa4'))[_0x0972('0x81')](_0x3a6908[_0x0972('0xa5')][_0x0972('0x89')](),'ListId')['field'](_0x25621b[_0x0972('0x4e')]['id']['toString'](),_0x0972('0x65'))['field'](_0x0972('0xa3'),_0x0972('0x5d'))['field'](_0x0972('0xa3'),_0x0972('0x5e'))[_0x0972('0x82')](_0x0972('0xa6'))['where'](_0x0972('0xa7'))['where'](_0x0972('0xb0'),_0x3a6908[_0x0972('0xa5')]['toString']())['where'](_0x0972('0xa8'))[_0x0972('0x47')](_0x0972('0xa9'),squel[_0x0972('0xa2')]()[_0x0972('0x81')](_0x0972('0xb1'))[_0x0972('0x82')]('cm_hopper')[_0x0972('0x47')](_0x0972('0xac'),_0x25621b[_0x0972('0x4e')]['id'][_0x0972('0x89')]())))[_0x0972('0x89')]();break;default:_0x7c2d41=squel[_0x0972('0x9d')]()[_0x0972('0xaf')]('cm_hopper')[_0x0972('0x9e')](['phone','scheduledAt','ContactId',_0x0972('0xa1'),_0x0972('0x65'),_0x0972('0x5d'),_0x0972('0x5e')],squel['select']()[_0x0972('0x81')]('phone',_0x0972('0x9f'))[_0x0972('0x81')](_0x0972('0xa3'),_0x0972('0xa0'))[_0x0972('0x81')]('id','ContactId')[_0x0972('0x81')](_0x3a6908['CmListId'][_0x0972('0x89')](),'ListId')['field'](_0x25621b['params']['id']['toString'](),'VoiceQueueId')[_0x0972('0x81')](_0x0972('0xa3'),_0x0972('0x5d'))[_0x0972('0x81')](_0x0972('0xa3'),_0x0972('0x5e'))[_0x0972('0x82')]('cm_contacts')[_0x0972('0x47')](_0x0972('0xa7'))[_0x0972('0x47')](_0x0972('0xb0'),_0x3a6908[_0x0972('0xa5')][_0x0972('0x89')]())[_0x0972('0x47')](_0x0972('0xa8')))[_0x0972('0x89')]();}_0x80ece6[_0x0972('0x88')](db[_0x0972('0x75')][_0x0972('0x3c')](_0x7c2d41));}return BPromise['all'](_0x80ece6);}})[_0x0972('0x29')](function(){return _0x4b5a01;})['then'](respondWithResult(_0x1b9178,null))[_0x0972('0x59')](handleError(_0x1b9178,null));};exports[_0x0972('0xb2')]=function(_0x515359,_0x469c0a,_0x154f36){return db[_0x0972('0x39')][_0x0972('0x33')]({'where':{'id':_0x515359['params']['id']}})['then'](handleEntityNotFound(_0x469c0a,null))[_0x0972('0x29')](function(_0x219149){if(_0x219149){return _0x219149[_0x0972('0xb2')](_0x515359[_0x0972('0x3c')]['ids']);}})[_0x0972('0x29')](function(_0x4573ea){if(_0x4573ea){return db[_0x0972('0x64')][_0x0972('0x2a')]({'where':{'ListId':_0x515359[_0x0972('0x3c')][_0x0972('0x80')],'VoiceQueueId':_0x515359[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](function(){return _0x4573ea;});}})[_0x0972('0x29')](respondWithStatusCode(_0x469c0a,null))[_0x0972('0x59')](handleError(_0x469c0a,null));};exports[_0x0972('0xb3')]=function(_0x3befff,_0x536f21,_0x48362d){var _0x2a3785={};var _0x13bfcc={};var _0x177b35;var _0x557963;return db[_0x0972('0x39')][_0x0972('0x63')]({'where':{'id':_0x3befff[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x536f21,null))['then'](function(_0x3b206d){if(_0x3b206d){_0x177b35=_0x3b206d;_0x13bfcc['model']=_[_0x0972('0x3d')](db[_0x0972('0xb4')]['rawAttributes']);_0x13bfcc['query']=_[_0x0972('0x3d')](_0x3befff[_0x0972('0x3c')]);_0x13bfcc[_0x0972('0x3e')]=_[_0x0972('0x3f')](_0x13bfcc['model'],_0x13bfcc[_0x0972('0x3c')]);_0x2a3785[_0x0972('0x41')]=_['intersection'](_0x13bfcc[_0x0972('0x40')],qs[_0x0972('0x42')](_0x3befff[_0x0972('0x3c')][_0x0972('0x42')]));_0x2a3785['attributes']=_0x2a3785[_0x0972('0x41')]['length']?_0x2a3785[_0x0972('0x41')]:_0x13bfcc[_0x0972('0x40')];_0x2a3785[_0x0972('0x45')]=qs[_0x0972('0x46')](_0x3befff[_0x0972('0x3c')][_0x0972('0x46')]);_0x2a3785[_0x0972('0x47')]=qs['filters'](_[_0x0972('0x48')](_0x3befff[_0x0972('0x3c')],_0x13bfcc['filters']));if(_0x3befff[_0x0972('0x3c')][_0x0972('0x2d')]){_0x2a3785[_0x0972('0x47')]=_['merge'](_0x2a3785[_0x0972('0x47')],{'$or':_['map'](_0x2a3785[_0x0972('0x41')],function(_0x37864a){var _0x21c608={};_0x21c608[_0x37864a]={'$like':'%'+_0x3befff[_0x0972('0x3c')][_0x0972('0x2d')]+'%'};return _0x21c608;})});}_0x2a3785=_[_0x0972('0x5f')]({},_0x2a3785,_0x3befff[_0x0972('0x49')]);return _0x177b35[_0x0972('0xb3')](_0x2a3785);}})['then'](function(_0x41a394){if(_0x41a394){_0x557963=_0x41a394[_0x0972('0x4f')];if(!_0x3befff[_0x0972('0x3c')][_0x0972('0x43')](_0x0972('0x44'))){_0x2a3785[_0x0972('0x21')]=qs[_0x0972('0x21')](_0x3befff[_0x0972('0x3c')][_0x0972('0x21')]);_0x2a3785['offset']=qs[_0x0972('0x1f')](_0x3befff[_0x0972('0x3c')][_0x0972('0x1f')]);}return _0x177b35[_0x0972('0xb3')](_0x2a3785);}})[_0x0972('0x29')](function(_0x4b0dd0){if(_0x4b0dd0){return _0x4b0dd0?{'count':_0x557963,'rows':_0x4b0dd0}:null;}})['then'](respondWithResult(_0x536f21,null))[_0x0972('0x59')](handleError(_0x536f21,null));};exports[_0x0972('0xb5')]=function(_0x2f8f5a,_0x57ff12,_0x183dc1){var _0x18e1a2,_0x51e653;return db['VoiceQueue'][_0x0972('0x33')]({'where':{'id':_0x2f8f5a['params']['id']}})[_0x0972('0x29')](handleEntityNotFound(_0x57ff12,null))[_0x0972('0x29')](function(_0x32e8fc){if(_0x32e8fc){_0x51e653=_0x32e8fc;return _0x32e8fc[_0x0972('0xb5')](_0x2f8f5a['body'][_0x0972('0x80')],_[_0x0972('0x5c')](_0x2f8f5a[_0x0972('0x52')],[_0x0972('0x80'),'id'])||{});}return null;})[_0x0972('0x92')](function(_0x21e13f){var _0x4f6e3b;_0x18e1a2=_0x21e13f||[];var _0x1d63c6=[];if(_0x21e13f){for(var _0x2d5a85=0x0;_0x2d5a85<_0x21e13f[_0x0972('0x4f')];_0x2d5a85+=0x1){var _0x1a62ac=_0x21e13f[_0x2d5a85]['get']({'plain':!![]});_0x4f6e3b=squel[_0x0972('0x9d')]()[_0x0972('0xaf')](_0x0972('0xb6'))['fromQuery']([_0x0972('0x9f'),_0x0972('0xa4'),_0x0972('0xa1'),_0x0972('0x65'),_0x0972('0x5d'),_0x0972('0x5e')],squel['select']()['field'](_0x0972('0x9f'),_0x0972('0x9f'))[_0x0972('0x81')]('id',_0x0972('0xa4'))[_0x0972('0x81')](_0x1a62ac[_0x0972('0xa5')][_0x0972('0x89')](),'ListId')[_0x0972('0x81')](_0x2f8f5a[_0x0972('0x4e')]['id']['toString'](),_0x0972('0x65'))['field'](_0x0972('0xa3'),_0x0972('0x5d'))[_0x0972('0x81')](_0x0972('0xa3'),_0x0972('0x5e'))[_0x0972('0x82')](_0x0972('0xa6'))[_0x0972('0x47')](_0x0972('0xa7'))['where'](_0x0972('0xb0'),_0x1a62ac['CmListId'][_0x0972('0x89')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0972('0x89')]();_0x1d63c6['push'](db[_0x0972('0x75')][_0x0972('0x3c')](_0x4f6e3b));}return BPromise[_0x0972('0x94')](_0x1d63c6);}})['then'](function(){return _0x18e1a2;})[_0x0972('0x29')](respondWithResult(_0x57ff12,null))['catch'](handleError(_0x57ff12,null));};exports[_0x0972('0xb7')]=function(_0xcfa1b8,_0xaac8df,_0xf43201){return db[_0x0972('0x39')][_0x0972('0x33')]({'where':{'id':_0xcfa1b8[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](handleEntityNotFound(_0xaac8df,null))[_0x0972('0x29')](function(_0x2fea0c){if(_0x2fea0c){return _0x2fea0c[_0x0972('0xb7')](_0xcfa1b8[_0x0972('0x3c')][_0x0972('0x80')]);}})[_0x0972('0x29')](function(_0x56352a){if(_0x56352a){return db[_0x0972('0x69')][_0x0972('0x2a')]({'where':{'ListId':_0xcfa1b8[_0x0972('0x3c')]['ids'],'VoiceQueueId':_0xcfa1b8[_0x0972('0x4e')]['id']}})[_0x0972('0x29')](function(){return _0x56352a;});}})[_0x0972('0x29')](respondWithStatusCode(_0xaac8df,null))[_0x0972('0x59')](handleError(_0xaac8df,null));}; \ No newline at end of file +var _0x4d92=['COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','fromQuery','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','ignore','map','value','includes','find','name','error','send','index','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','VoiceQueue','includeAll','include','findAll','rows','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','params','getHoppers','findOne','CmHopper','hasOwnProperty','getHopperHistories','CmHopperHistory','rawAttributes','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','transaction','isEmpty','UserVoiceQueueRt','addAgents','spread','push','upsert','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ListId','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)'];(function(_0x1b37de,_0x2f0eb9){var _0x579408=function(_0x10f37e){while(--_0x10f37e){_0x1b37de['push'](_0x1b37de['shift']());}};_0x579408(++_0x2f0eb9);}(_0x4d92,0x180));var _0x24d9=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0x4d92[_0xa990b7];return _0x52c99c;};'use strict';var emlformat=require(_0x24d9('0x0'));var rimraf=require(_0x24d9('0x1'));var zipdir=require(_0x24d9('0x2'));var jsonpatch=require(_0x24d9('0x3'));var rp=require(_0x24d9('0x4'));var moment=require(_0x24d9('0x5'));var BPromise=require(_0x24d9('0x6'));var Mustache=require(_0x24d9('0x7'));var util=require(_0x24d9('0x8'));var path=require(_0x24d9('0x9'));var sox=require('sox');var csv=require(_0x24d9('0xa'));var ejs=require(_0x24d9('0xb'));var fs=require('fs');var fs_extra=require(_0x24d9('0xc'));var _=require(_0x24d9('0xd'));var squel=require(_0x24d9('0xe'));var crypto=require(_0x24d9('0xf'));var jsforce=require(_0x24d9('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x24d9('0xa'));var querystring=require(_0x24d9('0x11'));var Papa=require(_0x24d9('0x12'));var Redis=require(_0x24d9('0x13'));var authService=require(_0x24d9('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x24d9('0x15'));var hardwareService=require(_0x24d9('0x16'));var logger=require('../../config/logger')(_0x24d9('0x17'));var utils=require(_0x24d9('0x18'));var config=require(_0x24d9('0x19'));var licenseUtil=require(_0x24d9('0x1a'));var db=require(_0x24d9('0x1b'))['db'];config['redis']=_['defaults'](config[_0x24d9('0x1c')],{'host':_0x24d9('0x1d'),'port':0x18eb});var socket=require(_0x24d9('0x1e'))(new Redis(config[_0x24d9('0x1c')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x20ac35,_0x4b190a){_0x4b190a=_0x4b190a||0xcc;return function(_0x44bb65){if(_0x44bb65){return _0x20ac35[_0x24d9('0x1f')](_0x4b190a);}return _0x20ac35[_0x24d9('0x20')](_0x4b190a)[_0x24d9('0x21')]();};}function respondWithResult(_0x311336,_0x14fbcb){_0x14fbcb=_0x14fbcb||0xc8;return function(_0x4a95df){if(_0x4a95df){return _0x311336[_0x24d9('0x20')](_0x14fbcb)[_0x24d9('0x22')](_0x4a95df);}};}function respondWithFilteredResult(_0x69e813,_0x497d31){return function(_0x6d0334){if(_0x6d0334){var _0x5108e8=typeof _0x497d31[_0x24d9('0x23')]===_0x24d9('0x24')&&typeof _0x497d31[_0x24d9('0x25')]===_0x24d9('0x24');var _0x1c3016=_0x6d0334[_0x24d9('0x26')];var _0x2b00ed=_0x5108e8?0x0:_0x497d31[_0x24d9('0x23')];var _0x19ec73=_0x5108e8?_0x6d0334[_0x24d9('0x26')]:_0x497d31[_0x24d9('0x23')]+_0x497d31['limit'];var _0x29b14a;if(_0x19ec73>=_0x1c3016){_0x19ec73=_0x1c3016;_0x29b14a=0xc8;}else{_0x29b14a=0xce;}_0x69e813[_0x24d9('0x20')](_0x29b14a);return _0x69e813['set']('Content-Range',_0x2b00ed+'-'+_0x19ec73+'/'+_0x1c3016)[_0x24d9('0x22')](_0x6d0334);}return null;};}function patchUpdates(_0x48f70c){return function(_0x26e248){try{jsonpatch['apply'](_0x26e248,_0x48f70c,!![]);}catch(_0x39f568){return BPromise[_0x24d9('0x27')](_0x39f568);}return _0x26e248[_0x24d9('0x28')]();};}function saveUpdates(_0x108384,_0x19ce50){return function(_0x4ea1e7){if(_0x4ea1e7){return _0x4ea1e7[_0x24d9('0x29')](_0x108384)[_0x24d9('0x2a')](function(_0x5f1363){return _0x5f1363;});}return null;};}function removeEntity(_0xd3f87b,_0x42b223){return function(_0x4744f6){if(_0x4744f6){return _0x4744f6[_0x24d9('0x2b')]()[_0x24d9('0x2a')](function(){var _0x8a1b8=_0x4744f6[_0x24d9('0x2c')]({'plain':!![]});var _0x2ddb13=[{'name':_0x24d9('0x2d'),'value':'inbound','ignore':![]},{'name':_0x24d9('0x2e'),'value':_0x24d9('0x2f'),'ignore':![]}];var _0x5492e4=_(_0x2ddb13)['filter'](_0x24d9('0x30'))[_0x24d9('0x31')](_0x24d9('0x32'))[_0x24d9('0x32')]();if(_[_0x24d9('0x33')](_0x5492e4,_0x8a1b8['type'])){return;}var _0x21a054=_[_0x24d9('0x34')](_0x2ddb13,[_0x24d9('0x32'),_0x8a1b8['type']])[_0x24d9('0x35')];return db['UserProfileResource'][_0x24d9('0x2b')]({'where':{'type':_0x21a054,'resourceId':_0x8a1b8['id']}})[_0x24d9('0x2a')](function(){return _0x4744f6;});})[_0x24d9('0x2a')](function(){_0xd3f87b[_0x24d9('0x20')](0xcc)[_0x24d9('0x21')]();});}};}function handleEntityNotFound(_0x2a1a6c,_0x57e32a){return function(_0x4d523e){if(!_0x4d523e){_0x2a1a6c[_0x24d9('0x1f')](0x194);}return _0x4d523e;};}function handleError(_0x2abe8a,_0x37eb78){_0x37eb78=_0x37eb78||0x1f4;return function(_0x30e601){logger[_0x24d9('0x36')](_0x30e601['stack']);if(_0x30e601['name']){delete _0x30e601['name'];}_0x2abe8a['status'](_0x37eb78)[_0x24d9('0x37')](_0x30e601);};}exports[_0x24d9('0x38')]=function(_0x2b44a4,_0x1f91f7){var _0x45cdd5={},_0xe8e22b={},_0x14b793={'count':0x0,'rows':[]};var _0x2b927c=_[_0x24d9('0x31')](db['VoiceQueue']['rawAttributes'],function(_0x50a1d6){return{'name':_0x50a1d6[_0x24d9('0x39')],'type':_0x50a1d6[_0x24d9('0x3a')][_0x24d9('0x3b')]};});_0xe8e22b[_0x24d9('0x3c')]=_[_0x24d9('0x31')](_0x2b927c,_0x24d9('0x35'));_0xe8e22b['query']=_[_0x24d9('0x3d')](_0x2b44a4[_0x24d9('0x3e')]);_0xe8e22b[_0x24d9('0x3f')]=_[_0x24d9('0x40')](_0xe8e22b[_0x24d9('0x3c')],_0xe8e22b['query']);_0x45cdd5[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0xe8e22b[_0x24d9('0x3c')],qs[_0x24d9('0x42')](_0x2b44a4[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x45cdd5['attributes']=_0x45cdd5[_0x24d9('0x41')][_0x24d9('0x43')]?_0x45cdd5[_0x24d9('0x41')]:_0xe8e22b[_0x24d9('0x3c')];if(!_0x2b44a4[_0x24d9('0x3e')]['hasOwnProperty'](_0x24d9('0x44'))){_0x45cdd5[_0x24d9('0x25')]=qs[_0x24d9('0x25')](_0x2b44a4[_0x24d9('0x3e')]['limit']);_0x45cdd5[_0x24d9('0x23')]=qs[_0x24d9('0x23')](_0x2b44a4[_0x24d9('0x3e')][_0x24d9('0x23')]);}_0x45cdd5[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x2b44a4['query']['sort']);_0x45cdd5['where']=qs[_0x24d9('0x3f')](_[_0x24d9('0x47')](_0x2b44a4[_0x24d9('0x3e')],_0xe8e22b[_0x24d9('0x3f')]),_0x2b927c);if(_0x2b44a4[_0x24d9('0x3e')][_0x24d9('0x48')]){_0x45cdd5['where']=_[_0x24d9('0x49')](_0x45cdd5[_0x24d9('0x4a')],{'$or':_[_0x24d9('0x31')](_0x2b927c,function(_0x45db5b){if(_0x45db5b[_0x24d9('0x3a')]!=='VIRTUAL'){var _0x247b0d={};_0x247b0d[_0x45db5b[_0x24d9('0x35')]]={'$like':'%'+_0x2b44a4[_0x24d9('0x3e')][_0x24d9('0x48')]+'%'};return _0x247b0d;}})});}_0x45cdd5=_['merge']({},_0x45cdd5,_0x2b44a4[_0x24d9('0x4b')]);var _0x4d90ec={'where':_0x45cdd5[_0x24d9('0x4a')]};return db[_0x24d9('0x4c')][_0x24d9('0x26')](_0x4d90ec)[_0x24d9('0x2a')](function(_0x368bf3){_0x14b793[_0x24d9('0x26')]=_0x368bf3;if(_0x2b44a4[_0x24d9('0x3e')][_0x24d9('0x4d')]){_0x45cdd5[_0x24d9('0x4e')]=[{'all':!![]}];}return db[_0x24d9('0x4c')][_0x24d9('0x4f')](_0x45cdd5);})[_0x24d9('0x2a')](function(_0x625fec){_0x14b793[_0x24d9('0x50')]=_0x625fec;return _0x14b793;})[_0x24d9('0x2a')](respondWithFilteredResult(_0x1f91f7,_0x45cdd5))[_0x24d9('0x51')](handleError(_0x1f91f7,null));};exports['show']=function(_0x4f72c6,_0x5c2d8c){var _0x5421a5={'raw':![],'where':{'id':_0x4f72c6['params']['id']}},_0x23809c={};_0x23809c[_0x24d9('0x3c')]=_[_0x24d9('0x3d')](db[_0x24d9('0x4c')]['rawAttributes']);_0x23809c[_0x24d9('0x3e')]=_['keys'](_0x4f72c6[_0x24d9('0x3e')]);_0x23809c['filters']=_['intersection'](_0x23809c['model'],_0x23809c[_0x24d9('0x3e')]);_0x5421a5['attributes']=_[_0x24d9('0x40')](_0x23809c['model'],qs[_0x24d9('0x42')](_0x4f72c6[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x5421a5[_0x24d9('0x41')]=_0x5421a5['attributes']['length']?_0x5421a5['attributes']:_0x23809c[_0x24d9('0x3c')];if(_0x4f72c6[_0x24d9('0x3e')][_0x24d9('0x4d')]){_0x5421a5[_0x24d9('0x4e')]=[{'all':!![]}];}_0x5421a5=_[_0x24d9('0x49')]({},_0x5421a5,_0x4f72c6['options']);return db[_0x24d9('0x4c')][_0x24d9('0x34')](_0x5421a5)[_0x24d9('0x2a')](handleEntityNotFound(_0x5c2d8c,null))[_0x24d9('0x2a')](respondWithResult(_0x5c2d8c,null))[_0x24d9('0x51')](handleError(_0x5c2d8c,null));};exports[_0x24d9('0x52')]=function(_0xbc889b,_0x48f627){return db[_0x24d9('0x4c')][_0x24d9('0x52')](_0xbc889b['body'],{})[_0x24d9('0x2a')](function(_0x1f9cfd){var _0xd055c2=_0xbc889b[_0x24d9('0x53')]['get']({'plain':!![]});if(!_0xd055c2)throw new Error(_0x24d9('0x54'));if(_0xd055c2[_0x24d9('0x55')]==='user'){var _0x313c56=_0x1f9cfd['get']({'plain':!![]});var _0x21d3c3=[{'name':_0x24d9('0x2d'),'value':_0x24d9('0x56')},{'name':'QueueCampaigns','value':_0x24d9('0x2f')}];var _0xaf1b97=_[_0x24d9('0x34')](_0x21d3c3,[_0x24d9('0x32'),_0x313c56[_0x24d9('0x3a')]])[_0x24d9('0x35')];return db['UserProfileSection'][_0x24d9('0x34')]({'where':{'name':_0xaf1b97,'userProfileId':_0xd055c2[_0x24d9('0x57')]},'raw':!![]})['then'](function(_0x54e7d4){if(_0x54e7d4&&_0x54e7d4[_0x24d9('0x58')]===0x0){return db[_0x24d9('0x59')][_0x24d9('0x52')]({'name':_0x313c56[_0x24d9('0x35')],'resourceId':_0x313c56['id'],'type':_0x54e7d4[_0x24d9('0x35')],'sectionId':_0x54e7d4['id']},{})[_0x24d9('0x2a')](function(){return _0x1f9cfd;});}else{return _0x1f9cfd;}})[_0x24d9('0x51')](function(_0x248b6f){logger[_0x24d9('0x36')](_0x24d9('0x5a'),_0x248b6f);throw _0x248b6f;});}return _0x1f9cfd;})['then'](respondWithResult(_0x48f627,0xc9))[_0x24d9('0x51')](handleError(_0x48f627,null));};exports[_0x24d9('0x5b')]=function(_0xc88109,_0x2defdf){var _0x3d04c1={'where':{'id':_0xc88109['params']['id']}},_0x402ee5={};_0x402ee5[_0x24d9('0x3c')]=_[_0x24d9('0x3d')](db['VoiceQueue']['rawAttributes']);_0x3d04c1[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0x402ee5['model'],qs[_0x24d9('0x42')](_0xc88109[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x3d04c1['attributes']=_0x3d04c1[_0x24d9('0x41')][_0x24d9('0x43')]?_0x3d04c1['attributes']:_0x402ee5[_0x24d9('0x3c')];if(_0xc88109[_0x24d9('0x3e')]['includeAll']){_0x3d04c1['include']=[{'all':!![]}];}_0x3d04c1=_[_0x24d9('0x49')]({},_0x3d04c1,_0xc88109[_0x24d9('0x4b')]);return db[_0x24d9('0x4c')]['find'](_0x3d04c1)[_0x24d9('0x2a')](handleEntityNotFound(_0x2defdf,null))[_0x24d9('0x2a')](function(_0x1474bd){if(_0x1474bd){var _0xfae115=_0x1474bd[_0x24d9('0x2c')]({'plain':!![]});_0xfae115=qs['omit'](_0xfae115,['id',_0x24d9('0x5c'),_0x24d9('0x5d')]);_0xc88109[_0x24d9('0x5e')]=_[_0x24d9('0x5f')](_0xc88109[_0x24d9('0x5e')],['id','createdAt','updatedAt']);return db[_0x24d9('0x4c')][_0x24d9('0x52')](_[_0x24d9('0x49')](_0xfae115,_0xc88109['body']),{'include':_0xc88109[_0x24d9('0x3e')][_0x24d9('0x4d')]?[{'all':!![]}]:undefined})[_0x24d9('0x2a')](function(_0x316d8c){var _0xf65c7e=_0xc88109[_0x24d9('0x53')]['get']({'plain':!![]});if(!_0xf65c7e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf65c7e[_0x24d9('0x55')]==='user'){var _0x101ff9=_0x316d8c['get']({'plain':!![]});var _0x34e68c=[{'name':_0x24d9('0x2d'),'value':'inbound'},{'name':_0x24d9('0x2e'),'value':_0x24d9('0x2f')}];var _0x333506=_[_0x24d9('0x34')](_0x34e68c,[_0x24d9('0x32'),_0x101ff9['type']])[_0x24d9('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x333506,'userProfileId':_0xf65c7e[_0x24d9('0x57')]},'raw':!![]})[_0x24d9('0x2a')](function(_0x41d83a){if(_0x41d83a&&_0x41d83a[_0x24d9('0x58')]===0x0){return db[_0x24d9('0x59')][_0x24d9('0x52')]({'name':_0x101ff9['name'],'resourceId':_0x101ff9['id'],'type':_0x41d83a[_0x24d9('0x35')],'sectionId':_0x41d83a['id']},{})[_0x24d9('0x2a')](function(){return _0x316d8c;});}else{return _0x316d8c;}})[_0x24d9('0x51')](function(_0xd59033){logger[_0x24d9('0x36')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd59033);throw _0xd59033;});}return _0x316d8c;});}})[_0x24d9('0x2a')](respondWithResult(_0x2defdf,0xc9))['catch'](handleError(_0x2defdf,null));};exports['update']=function(_0x36a98a,_0xc505a2){if(_0x36a98a[_0x24d9('0x5e')]['id']){delete _0x36a98a['body']['id'];}return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x36a98a[_0x24d9('0x60')]['id']}})['then'](handleEntityNotFound(_0xc505a2,null))['then'](saveUpdates(_0x36a98a[_0x24d9('0x5e')],null))[_0x24d9('0x2a')](respondWithResult(_0xc505a2,null))[_0x24d9('0x51')](handleError(_0xc505a2,null));};exports[_0x24d9('0x2b')]=function(_0x338fa0,_0x5bb940){return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x338fa0[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x5bb940,null))[_0x24d9('0x2a')](removeEntity(_0x5bb940,null))[_0x24d9('0x51')](handleError(_0x5bb940,null));};exports[_0x24d9('0x61')]=function(_0x1fad80,_0x136e1e,_0x576023){var _0x497f8f={'raw':![],'where':{}};var _0x2cb11b={};var _0x5203b2={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x24d9('0x62')]({'where':{'id':_0x1fad80[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x136e1e,null))['then'](function(_0x3cf476){if(_0x3cf476){_0x2cb11b[_0x24d9('0x3c')]=_['keys'](db[_0x24d9('0x63')]['rawAttributes']);_0x2cb11b['query']=_[_0x24d9('0x3d')](_0x1fad80['query']);_0x2cb11b['filters']=_['intersection'](_0x2cb11b['model'],_0x2cb11b[_0x24d9('0x3e')]);_0x497f8f[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0x2cb11b[_0x24d9('0x3c')],qs[_0x24d9('0x42')](_0x1fad80['query'][_0x24d9('0x42')]));_0x497f8f[_0x24d9('0x41')]=_0x497f8f[_0x24d9('0x41')][_0x24d9('0x43')]?_0x497f8f['attributes']:_0x2cb11b['model'];if(!_0x1fad80[_0x24d9('0x3e')][_0x24d9('0x64')](_0x24d9('0x44'))){_0x497f8f[_0x24d9('0x25')]=qs[_0x24d9('0x25')](_0x1fad80[_0x24d9('0x3e')]['limit']);_0x497f8f[_0x24d9('0x23')]=qs[_0x24d9('0x23')](_0x1fad80[_0x24d9('0x3e')]['offset']);}_0x497f8f[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x1fad80[_0x24d9('0x3e')][_0x24d9('0x46')]);_0x497f8f[_0x24d9('0x4a')]=qs[_0x24d9('0x3f')](_[_0x24d9('0x47')](_0x1fad80['query'],_0x2cb11b[_0x24d9('0x3f')]));_0x497f8f[_0x24d9('0x4a')]['VoiceQueueId']=_0x3cf476['id'];if(_0x1fad80['query']['filter']){_0x497f8f['where']=_[_0x24d9('0x49')](_0x497f8f[_0x24d9('0x4a')],{'$or':_[_0x24d9('0x31')](_0x497f8f[_0x24d9('0x41')],function(_0x54613f){var _0x4992d2={};_0x4992d2[_0x54613f]={'$like':'%'+_0x1fad80['query'][_0x24d9('0x48')]+'%'};return _0x4992d2;})});}_0x497f8f=_['merge']({},_0x497f8f,_0x1fad80[_0x24d9('0x4b')]);return db['CmHopper'][_0x24d9('0x26')]({'where':_0x497f8f[_0x24d9('0x4a')]})[_0x24d9('0x2a')](function(_0x2c59){_0x5203b2[_0x24d9('0x26')]=_0x2c59;if(_0x1fad80['query'][_0x24d9('0x4d')]){_0x497f8f[_0x24d9('0x4e')]=[{'all':!![]}];}return db[_0x24d9('0x63')]['findAll'](_0x497f8f);})[_0x24d9('0x2a')](function(_0x2e4b8a){_0x5203b2[_0x24d9('0x50')]=_0x2e4b8a;return _0x5203b2;});}})[_0x24d9('0x2a')](respondWithFilteredResult(_0x136e1e,_0x497f8f))[_0x24d9('0x51')](handleError(_0x136e1e,null));};exports[_0x24d9('0x65')]=function(_0x13c186,_0x5b7973,_0x5934f6){var _0x73e1ca={'raw':!![],'where':{}};var _0xc47427={};var _0x1f8a26={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x24d9('0x62')]({'where':{'id':_0x13c186[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x5b7973,null))[_0x24d9('0x2a')](function(_0x2637e3){if(_0x2637e3){_0xc47427[_0x24d9('0x3c')]=_[_0x24d9('0x3d')](db[_0x24d9('0x66')][_0x24d9('0x67')]);_0xc47427['query']=_['keys'](_0x13c186[_0x24d9('0x3e')]);_0xc47427[_0x24d9('0x3f')]=_[_0x24d9('0x40')](_0xc47427[_0x24d9('0x3c')],_0xc47427[_0x24d9('0x3e')]);_0x73e1ca[_0x24d9('0x41')]=_['intersection'](_0xc47427[_0x24d9('0x3c')],qs[_0x24d9('0x42')](_0x13c186[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x73e1ca[_0x24d9('0x41')]=_0x73e1ca['attributes'][_0x24d9('0x43')]?_0x73e1ca[_0x24d9('0x41')]:_0xc47427[_0x24d9('0x3c')];if(!_0x13c186[_0x24d9('0x3e')][_0x24d9('0x64')](_0x24d9('0x44'))){_0x73e1ca['limit']=qs[_0x24d9('0x25')](_0x13c186[_0x24d9('0x3e')]['limit']);_0x73e1ca['offset']=qs[_0x24d9('0x23')](_0x13c186[_0x24d9('0x3e')][_0x24d9('0x23')]);}_0x73e1ca[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x13c186[_0x24d9('0x3e')][_0x24d9('0x46')]);_0x73e1ca[_0x24d9('0x4a')]=qs['filters'](_[_0x24d9('0x47')](_0x13c186[_0x24d9('0x3e')],_0xc47427['filters']));_0x73e1ca[_0x24d9('0x4a')][_0x24d9('0x68')]=_0x2637e3['id'];if(_0x13c186['query'][_0x24d9('0x48')]){_0x73e1ca[_0x24d9('0x4a')]=_[_0x24d9('0x49')](_0x73e1ca[_0x24d9('0x4a')],{'$or':_['map'](_0x73e1ca['attributes'],function(_0x2cb2d5){var _0x52d846={};_0x52d846[_0x2cb2d5]={'$like':'%'+_0x13c186[_0x24d9('0x3e')][_0x24d9('0x48')]+'%'};return _0x52d846;})});}_0x73e1ca=_['merge']({},_0x73e1ca,_0x13c186[_0x24d9('0x4b')]);return db[_0x24d9('0x66')]['count']({'where':_0x73e1ca[_0x24d9('0x4a')]})['then'](function(_0x45e9a6){_0x1f8a26['count']=_0x45e9a6;if(_0x13c186['query'][_0x24d9('0x4d')]){_0x73e1ca['include']=[{'all':!![]}];}return db[_0x24d9('0x66')][_0x24d9('0x4f')](_0x73e1ca);})[_0x24d9('0x2a')](function(_0x1ff9a1){_0x1f8a26[_0x24d9('0x50')]=_0x1ff9a1;return _0x1f8a26;});}})[_0x24d9('0x2a')](respondWithFilteredResult(_0x5b7973,_0x73e1ca))[_0x24d9('0x51')](handleError(_0x5b7973,null));};exports[_0x24d9('0x69')]=function(_0x192452,_0x9d84d2,_0x465273){var _0x46550e={'raw':!![],'where':{}};var _0x1eab9c={};var _0x140ecc={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x24d9('0x62')]({'where':{'id':_0x192452[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x9d84d2,null))[_0x24d9('0x2a')](function(_0x242888){if(_0x242888){_0x1eab9c['model']=_[_0x24d9('0x3d')](db[_0x24d9('0x6a')][_0x24d9('0x67')]);_0x1eab9c[_0x24d9('0x3e')]=_[_0x24d9('0x3d')](_0x192452[_0x24d9('0x3e')]);_0x1eab9c[_0x24d9('0x3f')]=_[_0x24d9('0x40')](_0x1eab9c[_0x24d9('0x3c')],_0x1eab9c[_0x24d9('0x3e')]);_0x46550e[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0x1eab9c['model'],qs['fields'](_0x192452[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x46550e[_0x24d9('0x41')]=_0x46550e[_0x24d9('0x41')][_0x24d9('0x43')]?_0x46550e['attributes']:_0x1eab9c[_0x24d9('0x3c')];if(!_0x192452[_0x24d9('0x3e')]['hasOwnProperty'](_0x24d9('0x44'))){_0x46550e[_0x24d9('0x25')]=qs[_0x24d9('0x25')](_0x192452['query']['limit']);_0x46550e[_0x24d9('0x23')]=qs[_0x24d9('0x23')](_0x192452[_0x24d9('0x3e')][_0x24d9('0x23')]);}_0x46550e[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x192452[_0x24d9('0x3e')][_0x24d9('0x46')]);_0x46550e[_0x24d9('0x4a')]=qs[_0x24d9('0x3f')](_[_0x24d9('0x47')](_0x192452[_0x24d9('0x3e')],_0x1eab9c[_0x24d9('0x3f')]));_0x46550e[_0x24d9('0x4a')]['VoiceQueueId']=_0x242888['id'];if(_0x192452[_0x24d9('0x3e')][_0x24d9('0x48')]){_0x46550e[_0x24d9('0x4a')]=_[_0x24d9('0x49')](_0x46550e['where'],{'$or':_[_0x24d9('0x31')](_0x46550e[_0x24d9('0x41')],function(_0x2f411f){var _0x514995={};_0x514995[_0x2f411f]={'$like':'%'+_0x192452[_0x24d9('0x3e')][_0x24d9('0x48')]+'%'};return _0x514995;})});}_0x46550e=_[_0x24d9('0x49')]({},_0x46550e,_0x192452[_0x24d9('0x4b')]);return db[_0x24d9('0x6a')][_0x24d9('0x26')]({'where':_0x46550e['where']})['then'](function(_0x55df3d){_0x140ecc[_0x24d9('0x26')]=_0x55df3d;if(_0x192452['query'][_0x24d9('0x4d')]){_0x46550e[_0x24d9('0x4e')]=[{'all':!![]}];}return db[_0x24d9('0x6a')][_0x24d9('0x4f')](_0x46550e);})[_0x24d9('0x2a')](function(_0x4d95f9){_0x140ecc[_0x24d9('0x50')]=_0x4d95f9;return _0x140ecc;});}})[_0x24d9('0x2a')](respondWithFilteredResult(_0x9d84d2,_0x46550e))[_0x24d9('0x51')](handleError(_0x9d84d2,null));};exports[_0x24d9('0x6b')]=function(_0x22b05e,_0x3e33a3,_0x7a7527){var _0x9ae9cc={'raw':!![],'where':{}};var _0x26091b={};var _0x4c6105={'count':0x0,'rows':[]};return db[_0x24d9('0x4c')][_0x24d9('0x62')]({'where':{'id':_0x22b05e[_0x24d9('0x60')]['id']}})['then'](handleEntityNotFound(_0x3e33a3,null))[_0x24d9('0x2a')](function(_0xf23259){if(_0xf23259){_0x26091b['model']=_[_0x24d9('0x3d')](db[_0x24d9('0x6c')][_0x24d9('0x67')]);_0x26091b[_0x24d9('0x3e')]=_[_0x24d9('0x3d')](_0x22b05e[_0x24d9('0x3e')]);_0x26091b[_0x24d9('0x3f')]=_[_0x24d9('0x40')](_0x26091b[_0x24d9('0x3c')],_0x26091b['query']);_0x9ae9cc[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0x26091b[_0x24d9('0x3c')],qs[_0x24d9('0x42')](_0x22b05e[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x9ae9cc[_0x24d9('0x41')]=_0x9ae9cc[_0x24d9('0x41')][_0x24d9('0x43')]?_0x9ae9cc['attributes']:_0x26091b[_0x24d9('0x3c')];if(!_0x22b05e[_0x24d9('0x3e')][_0x24d9('0x64')](_0x24d9('0x44'))){_0x9ae9cc[_0x24d9('0x25')]=qs[_0x24d9('0x25')](_0x22b05e[_0x24d9('0x3e')]['limit']);_0x9ae9cc[_0x24d9('0x23')]=qs[_0x24d9('0x23')](_0x22b05e[_0x24d9('0x3e')][_0x24d9('0x23')]);}_0x9ae9cc[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x22b05e['query'][_0x24d9('0x46')]);_0x9ae9cc['where']=qs[_0x24d9('0x3f')](_[_0x24d9('0x47')](_0x22b05e[_0x24d9('0x3e')],_0x26091b[_0x24d9('0x3f')]));_0x9ae9cc[_0x24d9('0x4a')]['VoiceQueueId']=_0xf23259['id'];if(_0x22b05e[_0x24d9('0x3e')]['filter']){_0x9ae9cc[_0x24d9('0x4a')]=_[_0x24d9('0x49')](_0x9ae9cc['where'],{'$or':_[_0x24d9('0x31')](_0x9ae9cc[_0x24d9('0x41')],function(_0x252853){var _0x28789d={};_0x28789d[_0x252853]={'$like':'%'+_0x22b05e[_0x24d9('0x3e')][_0x24d9('0x48')]+'%'};return _0x28789d;})});}_0x9ae9cc=_[_0x24d9('0x49')]({},_0x9ae9cc,_0x22b05e[_0x24d9('0x4b')]);return db[_0x24d9('0x6c')]['count']({'where':_0x9ae9cc[_0x24d9('0x4a')]})[_0x24d9('0x2a')](function(_0x21b9dc){_0x4c6105['count']=_0x21b9dc;if(_0x22b05e[_0x24d9('0x3e')][_0x24d9('0x4d')]){_0x9ae9cc['include']=[{'all':!![]}];}return db[_0x24d9('0x6c')][_0x24d9('0x4f')](_0x9ae9cc);})[_0x24d9('0x2a')](function(_0x1d955c){_0x4c6105['rows']=_0x1d955c;return _0x4c6105;});}})[_0x24d9('0x2a')](respondWithFilteredResult(_0x3e33a3,_0x9ae9cc))['catch'](handleError(_0x3e33a3,null));};exports[_0x24d9('0x6d')]=function(_0x443c98,_0x2ab2fd,_0x281554){var _0x4a18f8={};var _0x1b32c1={};var _0x73be1e;var _0x392bc2;return db['VoiceQueue']['findOne']({'where':{'id':_0x443c98[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x2ab2fd,null))['then'](function(_0x53d236){if(_0x53d236){_0x73be1e=_0x53d236;_0x1b32c1[_0x24d9('0x3c')]=_[_0x24d9('0x3d')](db[_0x24d9('0x6e')][_0x24d9('0x67')]);_0x1b32c1[_0x24d9('0x3e')]=_[_0x24d9('0x3d')](_0x443c98[_0x24d9('0x3e')]);_0x1b32c1[_0x24d9('0x3f')]=_[_0x24d9('0x40')](_0x1b32c1[_0x24d9('0x3c')],_0x1b32c1[_0x24d9('0x3e')]);_0x4a18f8[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0x1b32c1[_0x24d9('0x3c')],qs[_0x24d9('0x42')](_0x443c98[_0x24d9('0x3e')]['fields']));_0x4a18f8[_0x24d9('0x41')]=_0x4a18f8[_0x24d9('0x41')]['length']?_0x4a18f8[_0x24d9('0x41')]:_0x1b32c1[_0x24d9('0x3c')];_0x4a18f8[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x443c98[_0x24d9('0x3e')][_0x24d9('0x46')]);_0x4a18f8[_0x24d9('0x4a')]=qs['filters'](_['pick'](_0x443c98[_0x24d9('0x3e')],_0x1b32c1[_0x24d9('0x3f')]));if(_0x443c98[_0x24d9('0x3e')][_0x24d9('0x48')]){_0x4a18f8['where']=_[_0x24d9('0x49')](_0x4a18f8[_0x24d9('0x4a')],{'$or':_[_0x24d9('0x31')](_0x4a18f8[_0x24d9('0x41')],function(_0x381f60){var _0x39579a={};_0x39579a[_0x381f60]={'$like':'%'+_0x443c98[_0x24d9('0x3e')]['filter']+'%'};return _0x39579a;})});}_0x4a18f8=_[_0x24d9('0x49')]({},_0x4a18f8,_0x443c98[_0x24d9('0x4b')]);return _0x73be1e[_0x24d9('0x6d')](_0x4a18f8);}})[_0x24d9('0x2a')](function(_0x266fb6){if(_0x266fb6){_0x392bc2=_0x266fb6[_0x24d9('0x43')];if(!_0x443c98['query'][_0x24d9('0x64')](_0x24d9('0x44'))){_0x4a18f8[_0x24d9('0x25')]=qs['limit'](_0x443c98['query'][_0x24d9('0x25')]);_0x4a18f8[_0x24d9('0x23')]=qs['offset'](_0x443c98[_0x24d9('0x3e')][_0x24d9('0x23')]);}return _0x73be1e['getTeams'](_0x4a18f8);}})[_0x24d9('0x2a')](function(_0x3cae34){if(_0x3cae34){return _0x3cae34?{'count':_0x392bc2,'rows':_0x3cae34}:null;}})[_0x24d9('0x2a')](respondWithResult(_0x2ab2fd,null))[_0x24d9('0x51')](handleError(_0x2ab2fd,null));};exports[_0x24d9('0x6f')]=function(_0x2b204e,_0x404b65,_0x293b25){var _0x3c7cfe=_0x2b204e[_0x24d9('0x5e')][_0x24d9('0x70')];var _0x3867cc=_[_0x24d9('0x31')](_0x3c7cfe,'id');return db[_0x24d9('0x6e')]['findAll']({'where':{'id':_0x3867cc},'attributes':['id'],'include':[{'model':db[_0x24d9('0x71')],'as':_0x24d9('0x72'),'attributes':['id',_0x24d9('0x35'),_0x24d9('0x73'),'voicePause',_0x24d9('0x74')],'raw':!![]}]})[_0x24d9('0x2a')](function(_0x2ef0ea){if(_0x2ef0ea){var _0x53fbbc=_[_0x24d9('0x75')](_0x2ef0ea,function(_0x2b2293){var _0x264e1c=_0x2b2293[_0x24d9('0x2c')]({'plain':!![]});_0x264e1c[_0x24d9('0x72')][_0x24d9('0x76')](function(_0x14e54a){_0x14e54a[_0x24d9('0x77')]=_[_0x24d9('0x34')](_0x3c7cfe,{'id':_0x264e1c['id']})[_0x24d9('0x77')];});return _0x264e1c[_0x24d9('0x72')];});return db['VoiceQueue'][_0x24d9('0x34')]({'where':{'id':_0x2b204e['params']['id']}})[_0x24d9('0x2a')](function(_0x4ab58d){return db['sequelize']['transaction'](function(_0x254671){return _0x4ab58d[_0x24d9('0x6f')](_0x3867cc,{'transaction':_0x254671})['then'](function(){return BPromise[_0x24d9('0x78')](_0x3c7cfe,function(_0x2d2dd6){return db[_0x24d9('0x79')]['upsert']({'TeamId':_0x2d2dd6['id'],'VoiceQueueId':_0x2b204e['params']['id'],'penalty':_0x2d2dd6[_0x24d9('0x77')]},{'transaction':_0x254671});});})[_0x24d9('0x2a')](function(){return BPromise['each'](_0x53fbbc,function(_0x46ac6e){return db[_0x24d9('0x7a')][_0x24d9('0x7b')]({'where':{'UserId':_0x46ac6e['id'],'VoiceQueueId':_0x2b204e[_0x24d9('0x60')]['id']},'defaults':{'penalty':_0x46ac6e[_0x24d9('0x77')]},'transaction':_0x254671});});})[_0x24d9('0x2a')](function(){return BPromise[_0x24d9('0x78')](_[_0x24d9('0x48')](_0x53fbbc,{'online':!![]}),function(_0x5139dc){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5139dc[_0x24d9('0x35')],'UserId':_0x5139dc['id'],'queue_name':_0x4ab58d[_0x24d9('0x35')],'VoiceQueueId':_0x4ab58d['id'],'interface':_[_0x24d9('0x7c')](_0x5139dc[_0x24d9('0x74')])?util[_0x24d9('0x7d')](_0x24d9('0x7e'),_0x5139dc['name']):_0x5139dc[_0x24d9('0x74')],'paused':_0x5139dc[_0x24d9('0x7f')]||![],'penalty':_0x5139dc[_0x24d9('0x77')]},{'transaction':_0x254671});});})['then'](function(){_0x53fbbc[_0x24d9('0x76')](function(_0x4a4bfe){socket[_0x24d9('0x80')](_0x24d9('0x81'),{'UserId':_0x4a4bfe['id'],'VoiceQueueId':_0x4ab58d['id']});});});});});}})[_0x24d9('0x2a')](respondWithStatusCode(_0x404b65,null))[_0x24d9('0x51')](handleError(_0x404b65,null));};exports[_0x24d9('0x82')]=function(_0x1a3c80,_0x3a149d,_0x256b30){return db['Team'][_0x24d9('0x4f')]({'where':{'id':_0x1a3c80['query'][_0x24d9('0x83')]},'attributes':['id'],'include':[{'model':db[_0x24d9('0x71')],'as':_0x24d9('0x72'),'attributes':['id'],'raw':!![]}]})[_0x24d9('0x2a')](handleEntityNotFound(_0x3a149d,null))[_0x24d9('0x2a')](function(_0x4d70d3){var _0x234385=_[_0x24d9('0x31')](_0x4d70d3,'id');var _0x2c91c2=[];var _0x3e247a=[];var _0x4b66ba=squel[_0x24d9('0x84')]();_0x4b66ba[_0x24d9('0x85')]('tq.TeamId')[_0x24d9('0x86')]('team_has_voice_queues','tq')[_0x24d9('0x87')](_0x24d9('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x24d9('0x4a')](_0x24d9('0x89'),_0x1a3c80['params']['id']);for(var _0x59c7ac=0x0;_0x59c7ac<_0x4d70d3[_0x24d9('0x43')];_0x59c7ac+=0x1){let _0xbf0ac6=_0x4d70d3[_0x59c7ac];for(var _0x4c98b7=0x0;_0x4c98b7<_0xbf0ac6[_0x24d9('0x72')][_0x24d9('0x43')];_0x4c98b7+=0x1){let _0x4c0727=_0xbf0ac6['Agents'][_0x4c98b7];var _0x473847=_0x4b66ba[_0x24d9('0x5b')]();_0x473847['where'](_0x24d9('0x8a'),_0x4c0727['id']);_0x3e247a['push'](db[_0x24d9('0x8b')][_0x24d9('0x3e')](_0x473847[_0x24d9('0x8c')](),{'type':db['sequelize'][_0x24d9('0x8d')]['SELECT']})[_0x24d9('0x2a')](function(_0x5ec8cc){if(_0x5ec8cc[_0x24d9('0x43')]===0x1){return _0x4c0727['id'];}else{var _0x20d131=_[_0x24d9('0x8e')](_['map'](_0x5ec8cc,_0x24d9('0x8f')),function(_0x54a102){return _[_0x24d9('0x33')](_0x234385,_0x54a102);});if(_0x20d131){return _0x4c0727['id'];}}}));}}return BPromise[_0x24d9('0x90')](_0x3e247a)[_0x24d9('0x2a')](function(_0x498cd2){_0x2c91c2=_(_0x2c91c2)[_0x24d9('0x91')](_0x498cd2)[_0x24d9('0x92')]()[_0x24d9('0x32')]();return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x1a3c80[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](function(_0x4a4234){return db[_0x24d9('0x8b')][_0x24d9('0x93')](function(_0x30c2a1){return _0x4a4234[_0x24d9('0x82')](_0x1a3c80[_0x24d9('0x3e')][_0x24d9('0x83')],{'transaction':_0x30c2a1})['then'](function(){if(!_[_0x24d9('0x94')](_0x2c91c2)){return _0x4a4234['removeAgents'](_0x2c91c2,{'transaction':_0x30c2a1})[_0x24d9('0x2a')](function(){return db[_0x24d9('0x95')][_0x24d9('0x2b')]({'where':{'VoiceQueueId':_0x1a3c80[_0x24d9('0x60')]['id'],'UserId':_0x2c91c2},'transaction':_0x30c2a1});});}})['then'](function(){_0x2c91c2[_0x24d9('0x76')](function(_0x59e73e){socket[_0x24d9('0x80')]('userVoiceQueue:remove',{'UserId':_0x59e73e,'VoiceQueueId':_0x4a4234['id']});});});});});});})[_0x24d9('0x2a')](respondWithStatusCode(_0x3a149d,null))[_0x24d9('0x51')](handleError(_0x3a149d,null));};exports[_0x24d9('0x96')]=function(_0x5c2337,_0x3a4f04,_0x425fab){var _0x4defa5,_0x556981;return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x5c2337[_0x24d9('0x60')]['id']}})['then'](handleEntityNotFound(_0x3a4f04,null))['then'](function(_0xfcf224){if(_0xfcf224){_0x556981=_0xfcf224;return _0xfcf224['addAgents'](_0x5c2337['body'][_0x24d9('0x83')],_[_0x24d9('0x5f')](_0x5c2337['body'],[_0x24d9('0x83'),'id'])||{})[_0x24d9('0x97')](function(_0x3006f6){for(var _0x32f265=0x0;_0x32f265<_0x5c2337[_0x24d9('0x5e')][_0x24d9('0x83')][_0x24d9('0x43')];_0x32f265+=0x1){socket[_0x24d9('0x80')]('userVoiceQueue:save',{'UserId':Number(_0x5c2337['body'][_0x24d9('0x83')][_0x32f265]),'VoiceQueueId':Number(_0x5c2337[_0x24d9('0x60')]['id'])});}return _0x3006f6;});}})[_0x24d9('0x2a')](function(_0x124300){_0x4defa5=_0x124300||[];if(_0x556981){return db[_0x24d9('0x71')][_0x24d9('0x4f')]({'where':{'id':_0x5c2337['body'][_0x24d9('0x83')]},'attributes':['id',_0x24d9('0x35'),_0x24d9('0x73'),_0x24d9('0x7f'),_0x24d9('0x74')],'raw':!![]});}})[_0x24d9('0x2a')](function(_0x33ddb8){if(!_[_0x24d9('0x94')](_0x33ddb8)){var _0x1530f0=[];for(var _0x62a973=0x0;_0x62a973<_0x33ddb8[_0x24d9('0x43')];_0x62a973++){if(_0x33ddb8[_0x62a973]['online']){_0x1530f0[_0x24d9('0x98')](db[_0x24d9('0x95')][_0x24d9('0x99')]({'membername':_0x33ddb8[_0x62a973][_0x24d9('0x35')],'UserId':_0x33ddb8[_0x62a973]['id'],'queue_name':_0x556981[_0x24d9('0x35')],'VoiceQueueId':_0x556981['id'],'interface':_[_0x24d9('0x7c')](_0x33ddb8[_0x62a973]['interface'])?util[_0x24d9('0x7d')](_0x24d9('0x7e'),_0x33ddb8[_0x62a973][_0x24d9('0x35')]):_0x33ddb8[_0x62a973][_0x24d9('0x74')],'paused':_0x33ddb8[_0x62a973]['voicePause']||![],'penalty':_0x5c2337[_0x24d9('0x5e')]['penalty']||0x0}));}}return BPromise[_0x24d9('0x90')](_0x1530f0);}})[_0x24d9('0x2a')](function(){return _0x4defa5;})['then'](respondWithResult(_0x3a4f04,null))[_0x24d9('0x51')](handleError(_0x3a4f04,null));};exports[_0x24d9('0x9a')]=function(_0x275d57,_0x290301,_0x5d6344){return db[_0x24d9('0x4c')]['find']({'where':{'id':_0x275d57[_0x24d9('0x60')]['id']}})['then'](handleEntityNotFound(_0x290301,null))['then'](function(_0x32ad50){if(_0x32ad50){return _0x32ad50[_0x24d9('0x9a')](_0x275d57[_0x24d9('0x3e')][_0x24d9('0x83')])[_0x24d9('0x2a')](function(){if(_[_0x24d9('0x9b')](_0x275d57[_0x24d9('0x3e')][_0x24d9('0x83')])){for(var _0x181c96=0x0;_0x181c96<_0x275d57['query'][_0x24d9('0x83')][_0x24d9('0x43')];_0x181c96+=0x1){socket[_0x24d9('0x80')](_0x24d9('0x9c'),{'UserId':Number(_0x275d57['query'][_0x24d9('0x83')][_0x181c96]),'VoiceQueueId':Number(_0x275d57['params']['id'])});}}else{socket['emit'](_0x24d9('0x9c'),{'UserId':Number(_0x275d57[_0x24d9('0x3e')]['ids']),'VoiceQueueId':Number(_0x275d57[_0x24d9('0x60')]['id'])});}});}})[_0x24d9('0x2a')](function(_0x23d760){return db['UserVoiceQueueRt'][_0x24d9('0x2b')]({'where':{'VoiceQueueId':_0x275d57[_0x24d9('0x60')]['id'],'UserId':_0x275d57['query'][_0x24d9('0x83')]}})[_0x24d9('0x2a')](function(){return _0x23d760;});})[_0x24d9('0x2a')](respondWithStatusCode(_0x290301,null))[_0x24d9('0x51')](handleError(_0x290301,null));};exports[_0x24d9('0x9d')]=function(_0x447b4a,_0x47f409,_0x628b60){var _0x3aa5f2={};var _0x528ad5={};var _0x1bf4be;var _0x176fc9;return db[_0x24d9('0x4c')]['findOne']({'where':{'id':_0x447b4a['params']['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x47f409,null))['then'](function(_0x18bace){if(_0x18bace){_0x1bf4be=_0x18bace;_0x528ad5[_0x24d9('0x3c')]=_['keys'](db[_0x24d9('0x71')][_0x24d9('0x67')]);_0x528ad5['query']=_['keys'](_0x447b4a[_0x24d9('0x3e')]);_0x528ad5['filters']=_[_0x24d9('0x40')](_0x528ad5[_0x24d9('0x3c')],_0x528ad5[_0x24d9('0x3e')]);_0x3aa5f2[_0x24d9('0x41')]=_['intersection'](_0x528ad5[_0x24d9('0x3c')],qs['fields'](_0x447b4a['query'][_0x24d9('0x42')]));_0x3aa5f2[_0x24d9('0x41')]=_0x3aa5f2[_0x24d9('0x41')]['length']?_0x3aa5f2[_0x24d9('0x41')]:_0x528ad5[_0x24d9('0x3c')];_0x3aa5f2[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x447b4a[_0x24d9('0x3e')][_0x24d9('0x46')]);_0x3aa5f2[_0x24d9('0x4a')]=qs[_0x24d9('0x3f')](_[_0x24d9('0x47')](_0x447b4a['query'],_0x528ad5[_0x24d9('0x3f')]));if(_0x447b4a[_0x24d9('0x3e')][_0x24d9('0x48')]){_0x3aa5f2[_0x24d9('0x4a')]=_['merge'](_0x3aa5f2[_0x24d9('0x4a')],{'$or':_[_0x24d9('0x31')](_0x3aa5f2['attributes'],function(_0x138fce){var _0x26fc8c={};_0x26fc8c[_0x138fce]={'$like':'%'+_0x447b4a[_0x24d9('0x3e')]['filter']+'%'};return _0x26fc8c;})});}_0x3aa5f2=_[_0x24d9('0x49')]({},_0x3aa5f2,_0x447b4a[_0x24d9('0x4b')]);return _0x1bf4be[_0x24d9('0x9d')](_0x3aa5f2);}})['then'](function(_0x4d3374){if(_0x4d3374){_0x176fc9=_0x4d3374[_0x24d9('0x43')];if(!_0x447b4a['query'][_0x24d9('0x64')](_0x24d9('0x44'))){_0x3aa5f2['limit']=qs[_0x24d9('0x25')](_0x447b4a[_0x24d9('0x3e')][_0x24d9('0x25')]);_0x3aa5f2['offset']=qs['offset'](_0x447b4a['query'][_0x24d9('0x23')]);}return _0x1bf4be[_0x24d9('0x9d')](_0x3aa5f2);}})[_0x24d9('0x2a')](function(_0x5291a9){if(_0x5291a9){return _0x5291a9?{'count':_0x176fc9,'rows':_0x5291a9}:null;}})[_0x24d9('0x2a')](respondWithResult(_0x47f409,null))[_0x24d9('0x51')](handleError(_0x47f409,null));};exports[_0x24d9('0x9e')]=function(_0x9ec231,_0x27f36f,_0x3f40c4){var _0x2d5352={};var _0x15a3b6={};var _0x2e8848;var _0x56a769;return db[_0x24d9('0x4c')]['findOne']({'where':{'id':_0x9ec231[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x27f36f,null))[_0x24d9('0x2a')](function(_0x51f1cd){if(_0x51f1cd){_0x2e8848=_0x51f1cd;_0x15a3b6[_0x24d9('0x3c')]=_['keys'](db[_0x24d9('0x95')][_0x24d9('0x67')]);_0x15a3b6[_0x24d9('0x3e')]=_['keys'](_0x9ec231[_0x24d9('0x3e')]);_0x15a3b6[_0x24d9('0x3f')]=_['intersection'](_0x15a3b6['model'],_0x15a3b6['query']);_0x2d5352[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0x15a3b6['model'],qs[_0x24d9('0x42')](_0x9ec231[_0x24d9('0x3e')]['fields']));_0x2d5352[_0x24d9('0x41')]=_0x2d5352['attributes']['length']?_0x2d5352[_0x24d9('0x41')]:_0x15a3b6['model'];_0x2d5352[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x9ec231[_0x24d9('0x3e')][_0x24d9('0x46')]);_0x2d5352[_0x24d9('0x4a')]=qs[_0x24d9('0x3f')](_[_0x24d9('0x47')](_0x9ec231[_0x24d9('0x3e')],_0x15a3b6['filters']));if(_0x9ec231['query'][_0x24d9('0x48')]){_0x2d5352['where']=_[_0x24d9('0x49')](_0x2d5352[_0x24d9('0x4a')],{'$or':_[_0x24d9('0x31')](_0x2d5352[_0x24d9('0x41')],function(_0x22e4a3){var _0x487872={};_0x487872[_0x22e4a3]={'$like':'%'+_0x9ec231[_0x24d9('0x3e')][_0x24d9('0x48')]+'%'};return _0x487872;})});}_0x2d5352=_[_0x24d9('0x49')]({},_0x2d5352,_0x9ec231['options']);return _0x2e8848[_0x24d9('0x9e')](_0x2d5352);}})[_0x24d9('0x2a')](function(_0x97f0eb){if(_0x97f0eb){_0x56a769=_0x97f0eb[_0x24d9('0x43')];if(!_0x9ec231[_0x24d9('0x3e')][_0x24d9('0x64')](_0x24d9('0x44'))){_0x2d5352[_0x24d9('0x25')]=qs[_0x24d9('0x25')](_0x9ec231[_0x24d9('0x3e')]['limit']);_0x2d5352[_0x24d9('0x23')]=qs[_0x24d9('0x23')](_0x9ec231[_0x24d9('0x3e')][_0x24d9('0x23')]);}return _0x2e8848[_0x24d9('0x9e')](_0x2d5352);}})['then'](function(_0x495113){return _0x495113?{'count':_0x56a769,'rows':_0x495113}:null;})[_0x24d9('0x2a')](respondWithResult(_0x27f36f,null))['catch'](handleError(_0x27f36f,null));};exports[_0x24d9('0x9f')]=function(_0x24c49a,_0x216bac,_0x359a41){var _0x223735={};var _0x3da980={};var _0x2589ad;var _0x3d7889;return db[_0x24d9('0x4c')][_0x24d9('0x62')]({'where':{'id':_0x24c49a[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x216bac,null))[_0x24d9('0x2a')](function(_0x472345){if(_0x472345){_0x2589ad=_0x472345;_0x3da980['model']=_[_0x24d9('0x3d')](db[_0x24d9('0xa0')][_0x24d9('0x67')]);_0x3da980[_0x24d9('0x3e')]=_[_0x24d9('0x3d')](_0x24c49a[_0x24d9('0x3e')]);_0x3da980['filters']=_[_0x24d9('0x40')](_0x3da980[_0x24d9('0x3c')],_0x3da980[_0x24d9('0x3e')]);_0x223735[_0x24d9('0x41')]=_[_0x24d9('0x40')](_0x3da980[_0x24d9('0x3c')],qs['fields'](_0x24c49a[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x223735[_0x24d9('0x41')]=_0x223735[_0x24d9('0x41')][_0x24d9('0x43')]?_0x223735[_0x24d9('0x41')]:_0x3da980[_0x24d9('0x3c')];_0x223735[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x24c49a[_0x24d9('0x3e')]['sort']);_0x223735[_0x24d9('0x4a')]=qs['filters'](_[_0x24d9('0x47')](_0x24c49a[_0x24d9('0x3e')],_0x3da980[_0x24d9('0x3f')]));if(_0x24c49a['query'][_0x24d9('0x48')]){_0x223735['where']=_[_0x24d9('0x49')](_0x223735[_0x24d9('0x4a')],{'$or':_[_0x24d9('0x31')](_0x223735[_0x24d9('0x41')],function(_0x1a59d2){var _0x4aaf64={};_0x4aaf64[_0x1a59d2]={'$like':'%'+_0x24c49a[_0x24d9('0x3e')]['filter']+'%'};return _0x4aaf64;})});}_0x223735=_[_0x24d9('0x49')]({},_0x223735,_0x24c49a[_0x24d9('0x4b')]);return _0x2589ad['getLists'](_0x223735);}})['then'](function(_0x483e4e){if(_0x483e4e){_0x3d7889=_0x483e4e[_0x24d9('0x43')];if(!_0x24c49a['query'][_0x24d9('0x64')](_0x24d9('0x44'))){_0x223735[_0x24d9('0x25')]=qs[_0x24d9('0x25')](_0x24c49a[_0x24d9('0x3e')]['limit']);_0x223735[_0x24d9('0x23')]=qs[_0x24d9('0x23')](_0x24c49a[_0x24d9('0x3e')]['offset']);}return _0x2589ad['getLists'](_0x223735);}})[_0x24d9('0x2a')](function(_0x2c71fe){if(_0x2c71fe){return _0x2c71fe?{'count':_0x3d7889,'rows':_0x2c71fe}:null;}})[_0x24d9('0x2a')](respondWithResult(_0x216bac,null))[_0x24d9('0x51')](handleError(_0x216bac,null));};exports[_0x24d9('0xa1')]=function(_0x30360b,_0x415c13,_0x21cc66){var _0x1dcf65,_0x204749;return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x30360b['params']['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x415c13,null))[_0x24d9('0x2a')](function(_0x57aa51){if(_0x57aa51){_0x204749=_0x57aa51;return _0x57aa51[_0x24d9('0xa1')](_0x30360b[_0x24d9('0x5e')][_0x24d9('0x83')],_['omit'](_0x30360b[_0x24d9('0x5e')],[_0x24d9('0x83'),'id'])||{});}return null;})[_0x24d9('0x97')](function(_0x3608f4){var _0x4b5b52;_0x1dcf65=_0x3608f4||[];var _0x17dabf=[];if(_0x3608f4){for(var _0x46eb03=0x0;_0x46eb03<_0x3608f4[_0x24d9('0x43')];_0x46eb03+=0x1){var _0x4a2c8a=_0x3608f4[_0x46eb03][_0x24d9('0x2c')]({'plain':!![]});_0x204749[_0x24d9('0xa2')]=_0x30360b[_0x24d9('0x5e')][_0x24d9('0xa2')]?_0x30360b[_0x24d9('0x5e')][_0x24d9('0xa2')]:_0x204749[_0x24d9('0xa2')];switch(_0x204749['dialCheckDuplicateType']){case _0x24d9('0xa3'):_0x4b5b52=squel[_0x24d9('0xa4')]()[_0x24d9('0xa5')]('cm_hopper')['fromQuery']([_0x24d9('0xa6'),_0x24d9('0xa7'),'ContactId',_0x24d9('0xa8'),_0x24d9('0x68'),'createdAt',_0x24d9('0x5d')],squel[_0x24d9('0x84')]()[_0x24d9('0x85')](_0x24d9('0xa6'),_0x24d9('0xa6'))[_0x24d9('0x85')](_0x24d9('0xa9'),'scheduledAt')[_0x24d9('0x85')]('id',_0x24d9('0xaa'))[_0x24d9('0x85')](_0x4a2c8a[_0x24d9('0xab')][_0x24d9('0x8c')](),_0x24d9('0xa8'))[_0x24d9('0x85')](_0x30360b[_0x24d9('0x60')]['id']['toString'](),_0x24d9('0x68'))[_0x24d9('0x85')](_0x24d9('0xa9'),_0x24d9('0x5c'))[_0x24d9('0x85')](_0x24d9('0xa9'),_0x24d9('0x5d'))[_0x24d9('0x86')](_0x24d9('0xac'))[_0x24d9('0x4a')](_0x24d9('0xad'))[_0x24d9('0x4a')]('ListId\x20=\x20?',_0x4a2c8a[_0x24d9('0xab')][_0x24d9('0x8c')]())['where'](_0x24d9('0xae'))[_0x24d9('0x4a')](_0x24d9('0xaf'),squel[_0x24d9('0x84')]()['field'](_0x24d9('0xb0'))[_0x24d9('0x86')]('cm_hopper_final')[_0x24d9('0x4a')]('VoiceQueueId\x20=\x20?',_0x30360b[_0x24d9('0x60')]['id'][_0x24d9('0x8c')]()))[_0x24d9('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x24d9('0x84')]()[_0x24d9('0x85')](_0x24d9('0xb1'))[_0x24d9('0x86')](_0x24d9('0xb2'))[_0x24d9('0x4a')](_0x24d9('0x89'),_0x30360b['params']['id'][_0x24d9('0x8c')]())))[_0x24d9('0x8c')]();break;case _0x24d9('0xb3'):_0x4b5b52=squel[_0x24d9('0xa4')]()[_0x24d9('0xa5')](_0x24d9('0xb2'))['fromQuery'](['phone',_0x24d9('0xa7'),_0x24d9('0xaa'),'ListId','VoiceQueueId','createdAt',_0x24d9('0x5d')],squel['select']()[_0x24d9('0x85')](_0x24d9('0xa6'),_0x24d9('0xa6'))['field']('NOW()',_0x24d9('0xa7'))[_0x24d9('0x85')]('id',_0x24d9('0xaa'))[_0x24d9('0x85')](_0x4a2c8a['CmListId']['toString'](),_0x24d9('0xa8'))[_0x24d9('0x85')](_0x30360b['params']['id']['toString'](),_0x24d9('0x68'))['field'](_0x24d9('0xa9'),_0x24d9('0x5c'))['field'](_0x24d9('0xa9'),_0x24d9('0x5d'))[_0x24d9('0x86')]('cm_contacts')[_0x24d9('0x4a')](_0x24d9('0xad'))['where'](_0x24d9('0xb4'),_0x4a2c8a[_0x24d9('0xab')][_0x24d9('0x8c')]())[_0x24d9('0x4a')](_0x24d9('0xae'))[_0x24d9('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x24d9('0x85')]('COALESCE(phone,\x27\x27)')[_0x24d9('0x86')](_0x24d9('0xb2'))['where'](_0x24d9('0x89'),_0x30360b[_0x24d9('0x60')]['id'][_0x24d9('0x8c')]())))['toString']();break;default:_0x4b5b52=squel[_0x24d9('0xa4')]()[_0x24d9('0xa5')](_0x24d9('0xb2'))['fromQuery']([_0x24d9('0xa6'),_0x24d9('0xa7'),_0x24d9('0xaa'),_0x24d9('0xa8'),_0x24d9('0x68'),_0x24d9('0x5c'),'updatedAt'],squel[_0x24d9('0x84')]()['field'](_0x24d9('0xa6'),_0x24d9('0xa6'))[_0x24d9('0x85')](_0x24d9('0xa9'),_0x24d9('0xa7'))[_0x24d9('0x85')]('id',_0x24d9('0xaa'))[_0x24d9('0x85')](_0x4a2c8a['CmListId'][_0x24d9('0x8c')](),_0x24d9('0xa8'))[_0x24d9('0x85')](_0x30360b[_0x24d9('0x60')]['id'][_0x24d9('0x8c')](),_0x24d9('0x68'))[_0x24d9('0x85')](_0x24d9('0xa9'),_0x24d9('0x5c'))[_0x24d9('0x85')](_0x24d9('0xa9'),'updatedAt')[_0x24d9('0x86')](_0x24d9('0xac'))[_0x24d9('0x4a')]('deletedAt\x20IS\x20NULL')['where'](_0x24d9('0xb4'),_0x4a2c8a[_0x24d9('0xab')]['toString']())[_0x24d9('0x4a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x17dabf['push'](db[_0x24d9('0x8b')][_0x24d9('0x3e')](_0x4b5b52));}return BPromise[_0x24d9('0x90')](_0x17dabf);}})['then'](function(){return _0x1dcf65;})[_0x24d9('0x2a')](respondWithResult(_0x415c13,null))[_0x24d9('0x51')](handleError(_0x415c13,null));};exports[_0x24d9('0xb5')]=function(_0x289147,_0x1d728d,_0x5618e3){return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x289147[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x1d728d,null))[_0x24d9('0x2a')](function(_0x5a6e80){if(_0x5a6e80){return _0x5a6e80[_0x24d9('0xb5')](_0x289147[_0x24d9('0x3e')][_0x24d9('0x83')]);}})['then'](function(_0x21fabf){if(_0x21fabf){return db['CmHopper'][_0x24d9('0x2b')]({'where':{'ListId':_0x289147[_0x24d9('0x3e')]['ids'],'VoiceQueueId':_0x289147[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](function(){return _0x21fabf;});}})[_0x24d9('0x2a')](respondWithStatusCode(_0x1d728d,null))['catch'](handleError(_0x1d728d,null));};exports['getBlackLists']=function(_0x3fea95,_0x422b6c,_0xc5210e){var _0x23ead3={};var _0x2434bd={};var _0x37687f;var _0x3f74eb;return db[_0x24d9('0x4c')][_0x24d9('0x62')]({'where':{'id':_0x3fea95[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x422b6c,null))[_0x24d9('0x2a')](function(_0x5de0db){if(_0x5de0db){_0x37687f=_0x5de0db;_0x2434bd[_0x24d9('0x3c')]=_[_0x24d9('0x3d')](db['CmList'][_0x24d9('0x67')]);_0x2434bd['query']=_['keys'](_0x3fea95['query']);_0x2434bd[_0x24d9('0x3f')]=_[_0x24d9('0x40')](_0x2434bd[_0x24d9('0x3c')],_0x2434bd[_0x24d9('0x3e')]);_0x23ead3['attributes']=_[_0x24d9('0x40')](_0x2434bd[_0x24d9('0x3c')],qs[_0x24d9('0x42')](_0x3fea95[_0x24d9('0x3e')][_0x24d9('0x42')]));_0x23ead3[_0x24d9('0x41')]=_0x23ead3[_0x24d9('0x41')][_0x24d9('0x43')]?_0x23ead3[_0x24d9('0x41')]:_0x2434bd[_0x24d9('0x3c')];_0x23ead3[_0x24d9('0x45')]=qs[_0x24d9('0x46')](_0x3fea95[_0x24d9('0x3e')]['sort']);_0x23ead3[_0x24d9('0x4a')]=qs[_0x24d9('0x3f')](_['pick'](_0x3fea95[_0x24d9('0x3e')],_0x2434bd[_0x24d9('0x3f')]));if(_0x3fea95[_0x24d9('0x3e')]['filter']){_0x23ead3['where']=_['merge'](_0x23ead3[_0x24d9('0x4a')],{'$or':_[_0x24d9('0x31')](_0x23ead3[_0x24d9('0x41')],function(_0xe1a5d5){var _0x2a4ebc={};_0x2a4ebc[_0xe1a5d5]={'$like':'%'+_0x3fea95['query'][_0x24d9('0x48')]+'%'};return _0x2a4ebc;})});}_0x23ead3=_[_0x24d9('0x49')]({},_0x23ead3,_0x3fea95[_0x24d9('0x4b')]);return _0x37687f['getBlackLists'](_0x23ead3);}})[_0x24d9('0x2a')](function(_0x21f990){if(_0x21f990){_0x3f74eb=_0x21f990['length'];if(!_0x3fea95['query']['hasOwnProperty'](_0x24d9('0x44'))){_0x23ead3[_0x24d9('0x25')]=qs[_0x24d9('0x25')](_0x3fea95[_0x24d9('0x3e')]['limit']);_0x23ead3[_0x24d9('0x23')]=qs['offset'](_0x3fea95['query'][_0x24d9('0x23')]);}return _0x37687f[_0x24d9('0xb6')](_0x23ead3);}})['then'](function(_0x4e00c9){if(_0x4e00c9){return _0x4e00c9?{'count':_0x3f74eb,'rows':_0x4e00c9}:null;}})[_0x24d9('0x2a')](respondWithResult(_0x422b6c,null))['catch'](handleError(_0x422b6c,null));};exports[_0x24d9('0xb7')]=function(_0x796bc5,_0x51f712,_0xa38d23){var _0x39bbef,_0x19d409;return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x796bc5[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x51f712,null))['then'](function(_0x1423e6){if(_0x1423e6){_0x19d409=_0x1423e6;return _0x1423e6['addBlackLists'](_0x796bc5['body'][_0x24d9('0x83')],_[_0x24d9('0x5f')](_0x796bc5[_0x24d9('0x5e')],[_0x24d9('0x83'),'id'])||{});}return null;})['spread'](function(_0x4257a3){var _0x4d85b3;_0x39bbef=_0x4257a3||[];var _0x296a2f=[];if(_0x4257a3){for(var _0x34a775=0x0;_0x34a775<_0x4257a3[_0x24d9('0x43')];_0x34a775+=0x1){var _0x376895=_0x4257a3[_0x34a775]['get']({'plain':!![]});_0x4d85b3=squel[_0x24d9('0xa4')]()[_0x24d9('0xa5')](_0x24d9('0xb8'))[_0x24d9('0xb9')](['phone','ContactId','ListId',_0x24d9('0x68'),'createdAt',_0x24d9('0x5d')],squel['select']()[_0x24d9('0x85')](_0x24d9('0xa6'),_0x24d9('0xa6'))[_0x24d9('0x85')]('id','ContactId')[_0x24d9('0x85')](_0x376895['CmListId'][_0x24d9('0x8c')](),_0x24d9('0xa8'))[_0x24d9('0x85')](_0x796bc5[_0x24d9('0x60')]['id'][_0x24d9('0x8c')](),_0x24d9('0x68'))[_0x24d9('0x85')](_0x24d9('0xa9'),_0x24d9('0x5c'))['field'](_0x24d9('0xa9'),_0x24d9('0x5d'))[_0x24d9('0x86')](_0x24d9('0xac'))['where'](_0x24d9('0xad'))[_0x24d9('0x4a')]('ListId\x20=\x20?',_0x376895[_0x24d9('0xab')][_0x24d9('0x8c')]())['where'](_0x24d9('0xae')))['toString']();_0x296a2f[_0x24d9('0x98')](db[_0x24d9('0x8b')]['query'](_0x4d85b3));}return BPromise[_0x24d9('0x90')](_0x296a2f);}})[_0x24d9('0x2a')](function(){return _0x39bbef;})[_0x24d9('0x2a')](respondWithResult(_0x51f712,null))['catch'](handleError(_0x51f712,null));};exports[_0x24d9('0xba')]=function(_0x380e49,_0x2adb20,_0x95a895){return db[_0x24d9('0x4c')][_0x24d9('0x34')]({'where':{'id':_0x380e49[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](handleEntityNotFound(_0x2adb20,null))[_0x24d9('0x2a')](function(_0x469eb7){if(_0x469eb7){return _0x469eb7[_0x24d9('0xba')](_0x380e49['query'][_0x24d9('0x83')]);}})[_0x24d9('0x2a')](function(_0x39143f){if(_0x39143f){return db[_0x24d9('0x6c')][_0x24d9('0x2b')]({'where':{'ListId':_0x380e49[_0x24d9('0x3e')][_0x24d9('0x83')],'VoiceQueueId':_0x380e49[_0x24d9('0x60')]['id']}})[_0x24d9('0x2a')](function(){return _0x39143f;});}})[_0x24d9('0x2a')](respondWithStatusCode(_0x2adb20,null))[_0x24d9('0x51')](handleError(_0x2adb20,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 2094df6..fa67bf3 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 _0xeeb6=['exports','events','VoiceQueue','setMaxListeners','save','update','emit','hook'];(function(_0x2155c4,_0x42dd14){var _0x428cdb=function(_0x2fc307){while(--_0x2fc307){_0x2155c4['push'](_0x2155c4['shift']());}};_0x428cdb(++_0x42dd14);}(_0xeeb6,0xd9));var _0x6eeb=function(_0x28bad6,_0x432a6e){_0x28bad6=_0x28bad6-0x0;var _0x3c8a52=_0xeeb6[_0x28bad6];return _0x3c8a52;};'use strict';var EventEmitter=require(_0x6eeb('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x6eeb('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6eeb('0x2')](0x0);var events={'afterCreate':_0x6eeb('0x3'),'afterUpdate':_0x6eeb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e0dbe){return function(_0x116693,_0x170441,_0x415496){VoiceQueueEvents[_0x6eeb('0x5')](_0x2e0dbe+':'+_0x116693['id'],_0x116693);VoiceQueueEvents[_0x6eeb('0x5')](_0x2e0dbe,_0x116693);_0x415496(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x6eeb('0x6')](e,emitEvent(event));}}module[_0x6eeb('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x4475=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2c763e,_0x4654de){var _0x53b5b8=function(_0x449c4b){while(--_0x449c4b){_0x2c763e['push'](_0x2c763e['shift']());}};_0x53b5b8(++_0x4654de);}(_0x4475,0xef));var _0x5447=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4475[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x5447('0x0'));var VoiceQueue=require(_0x5447('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x5447('0x2')](0x0);var events={'afterCreate':_0x5447('0x3'),'afterUpdate':_0x5447('0x4'),'afterDestroy':_0x5447('0x5')};function emitEvent(_0x487a39){return function(_0x4f8695,_0x14e788,_0x3a6250){VoiceQueueEvents['emit'](_0x487a39+':'+_0x4f8695['id'],_0x4f8695);VoiceQueueEvents[_0x5447('0x6')](_0x487a39,_0x4f8695);_0x3a6250(null);};}for(var e in events){if(events[_0x5447('0x7')](e)){var event=events[e];VoiceQueue[_0x5447('0x8')](e,emitEvent(event));}}module[_0x5447('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 a154b4d..b81b613 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x332684,_0x4c5b5b){var _0x42c520=function(_0x443b9b){while(--_0x443b9b){_0x332684['push'](_0x332684['shift']());}};_0x42c520(++_0x4c5b5b);}(_0x70e0,0x17b));var _0x070e=function(_0x41a505,_0x8f0bee){_0x41a505=_0x41a505-0x0;var _0x14abb0=_0x70e0[_0x41a505];return _0x14abb0;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x42f36d,_0x37e5d9){var _0x4263e8=function(_0x5469ad){while(--_0x5469ad){_0x42f36d['push'](_0x42f36d['shift']());}};_0x4263e8(++_0x37e5d9);}(_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 logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 9b79ed7..42d5e93 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 _0xc75c=['GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x29de96,_0x42cc38){var _0x1b9352=function(_0x4a288a){while(--_0x4a288a){_0x29de96['push'](_0x29de96['shift']());}};_0x1b9352(++_0x42cc38);}(_0xc75c,0x163));var _0xcc75=function(_0x41642e,_0x97f901){_0x41642e=_0x41642e-0x0;var _0x39ec15=_0xc75c[_0x41642e];return _0x39ec15;};'use strict';var _=require(_0xcc75('0x0'));var util=require(_0xcc75('0x1'));var moment=require(_0xcc75('0x2'));var BPromise=require(_0xcc75('0x3'));var rs=require(_0xcc75('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc75('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc75('0x6'))(_0xcc75('0x7'));var config=require(_0xcc75('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcc75('0x9')]['http']({'port':0x232a});config[_0xcc75('0xa')]=_[_0xcc75('0xb')](config[_0xcc75('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0xcc75('0xc')](socket);function respondWithRpcPromise(_0x1ebfb3,_0x41b5be,_0x30fdd1){return new BPromise(function(_0x3ef291,_0x5b3a57){return client[_0xcc75('0xd')](_0x1ebfb3,_0x30fdd1)[_0xcc75('0xe')](function(_0x17edfd){logger[_0xcc75('0xf')](_0xcc75('0x10'),_0x41b5be,_0xcc75('0x11'));logger[_0xcc75('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x41b5be,_0xcc75('0x11'),JSON[_0xcc75('0x13')](_0x17edfd));if(_0x17edfd[_0xcc75('0x14')]){if(_0x17edfd[_0xcc75('0x14')][_0xcc75('0x15')]===0x1f4){logger['error'](_0xcc75('0x10'),_0x41b5be,_0x17edfd[_0xcc75('0x14')][_0xcc75('0x16')]);return _0x5b3a57(_0x17edfd['error'][_0xcc75('0x16')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x41b5be,_0x17edfd[_0xcc75('0x14')]['message']);return _0x3ef291(_0x17edfd['error']['message']);}else{logger[_0xcc75('0xf')](_0xcc75('0x10'),_0x41b5be,_0xcc75('0x11'));_0x3ef291(_0x17edfd[_0xcc75('0x17')][_0xcc75('0x16')]);}})[_0xcc75('0x18')](function(_0x59e89e){logger[_0xcc75('0x14')](_0xcc75('0x10'),_0x41b5be,_0x59e89e);_0x5b3a57(_0x59e89e);});});}exports[_0xcc75('0x19')]=function(_0x3ad67b){var _0x2d3eea=this;return new Promise(function(_0x4332a2,_0x4f84b8){return db[_0xcc75('0x1a')][_0xcc75('0x1b')]({'raw':_0x3ad67b[_0xcc75('0x1c')]?_0x3ad67b['options'][_0xcc75('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ad67b['options']?_0x3ad67b[_0xcc75('0x1c')][_0xcc75('0x1e')]||null:null,'attributes':_0x3ad67b[_0xcc75('0x1c')]?_0x3ad67b['options'][_0xcc75('0x1f')]||null:null,'limit':_0x3ad67b[_0xcc75('0x1c')]?_0x3ad67b[_0xcc75('0x1c')][_0xcc75('0x20')]||null:null,'include':_0x3ad67b[_0xcc75('0x1c')]?_0x3ad67b[_0xcc75('0x1c')]['include']?_[_0xcc75('0x21')](_0x3ad67b['options'][_0xcc75('0x22')],function(_0x35ac23){return{'model':db[_0x35ac23[_0xcc75('0x23')]],'as':_0x35ac23['as'],'attributes':_0x35ac23[_0xcc75('0x1f')],'include':_0x35ac23[_0xcc75('0x22')]?_[_0xcc75('0x21')](_0x35ac23['include'],function(_0x2b2d15){return{'model':db[_0x2b2d15[_0xcc75('0x23')]],'as':_0x2b2d15['as'],'attributes':_0x2b2d15['attributes'],'include':_0x2b2d15[_0xcc75('0x22')]?_[_0xcc75('0x21')](_0x2b2d15[_0xcc75('0x22')],function(_0x367506){return{'model':db[_0x367506[_0xcc75('0x23')]],'as':_0x367506['as'],'attributes':_0x367506['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x393850){logger[_0xcc75('0xf')](_0xcc75('0x19'),_0x3ad67b);logger[_0xcc75('0x12')](_0xcc75('0x19'),_0x3ad67b,JSON[_0xcc75('0x13')](_0x393850));_0x4332a2(_0x393850);})[_0xcc75('0x18')](function(_0x2e986b){logger[_0xcc75('0x14')]('GetVoiceQueue',_0x2e986b['message'],_0x3ad67b);_0x4f84b8(_0x2d3eea[_0xcc75('0x14')](0x1f4,_0x2e986b[_0xcc75('0x16')]));});});};exports[_0xcc75('0x24')]=function(_0x28cda7){var _0x1081ee=this;return new Promise(function(_0x1112d4,_0x4900e0){return db['VoiceQueue'][_0xcc75('0x25')]({'raw':_0x28cda7[_0xcc75('0x1c')]?_0x28cda7['options'][_0xcc75('0x1d')]===undefined?!![]:![]:!![],'where':_0x28cda7[_0xcc75('0x1c')]?_0x28cda7[_0xcc75('0x1c')][_0xcc75('0x1e')]||null:null,'attributes':_0x28cda7['options']?_0x28cda7['options'][_0xcc75('0x1f')]||null:null,'include':_0x28cda7[_0xcc75('0x1c')]?_0x28cda7[_0xcc75('0x1c')][_0xcc75('0x22')]?_[_0xcc75('0x21')](_0x28cda7[_0xcc75('0x1c')][_0xcc75('0x22')],function(_0x3fad0d){return{'model':db[_0x3fad0d[_0xcc75('0x23')]],'as':_0x3fad0d['as'],'attributes':_0x3fad0d[_0xcc75('0x1f')],'include':_0x3fad0d[_0xcc75('0x22')]?_[_0xcc75('0x21')](_0x3fad0d['include'],function(_0x54795b){return{'model':db[_0x54795b[_0xcc75('0x23')]],'as':_0x54795b['as'],'attributes':_0x54795b[_0xcc75('0x1f')],'include':_0x54795b[_0xcc75('0x22')]?_[_0xcc75('0x21')](_0x54795b[_0xcc75('0x22')],function(_0x568bf7){return{'model':db[_0x568bf7['model']],'as':_0x568bf7['as'],'attributes':_0x568bf7['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc75('0xe')](function(_0x4ef36e){logger[_0xcc75('0xf')](_0xcc75('0x24'),_0x28cda7);logger[_0xcc75('0x12')]('ShowVoiceQueue',_0x28cda7,JSON[_0xcc75('0x13')](_0x4ef36e));_0x1112d4(_0x4ef36e);})[_0xcc75('0x18')](function(_0x56c85d){logger['error'](_0xcc75('0x24'),_0x56c85d[_0xcc75('0x16')],_0x28cda7);_0x4900e0(_0x1081ee[_0xcc75('0x14')](0x1f4,_0x56c85d[_0xcc75('0x16')]));});});}; \ No newline at end of file +var _0xb2b0=['rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','VoiceQueue','findAll','options','raw','attributes','include','model','map','debug','GetVoiceQueue','stringify','catch','ShowVoiceQueue','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x310047,_0xcbc804){var _0x2daad2=function(_0x43ded0){while(--_0x43ded0){_0x310047['push'](_0x310047['shift']());}};_0x2daad2(++_0xcbc804);}(_0xb2b0,0xfa));var _0x0b2b=function(_0x171852,_0x2ba178){_0x171852=_0x171852-0x0;var _0xa22bc1=_0xb2b0[_0x171852];return _0xa22bc1;};'use strict';var _=require(_0x0b2b('0x0'));var util=require(_0x0b2b('0x1'));var moment=require(_0x0b2b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b2b('0x3'));var fs=require('fs');var Redis=require(_0x0b2b('0x4'));var db=require(_0x0b2b('0x5'))['db'];var utils=require(_0x0b2b('0x6'));var logger=require(_0x0b2b('0x7'))(_0x0b2b('0x8'));var config=require(_0x0b2b('0x9'));var jayson=require(_0x0b2b('0xa'));var client=jayson[_0x0b2b('0xb')][_0x0b2b('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x0b2b('0xd'),'port':0x18eb});var socket=require(_0x0b2b('0xe'))(new Redis(config[_0x0b2b('0xf')]));require(_0x0b2b('0x10'))[_0x0b2b('0x11')](socket);function respondWithRpcPromise(_0x4ae606,_0x1c7b6f,_0x27ae6a){return new BPromise(function(_0x5033f6,_0x24c727){return client[_0x0b2b('0x12')](_0x4ae606,_0x27ae6a)[_0x0b2b('0x13')](function(_0x720282){logger['info'](_0x0b2b('0x14'),_0x1c7b6f,_0x0b2b('0x15'));logger['debug'](_0x0b2b('0x16'),_0x1c7b6f,_0x0b2b('0x15'),JSON['stringify'](_0x720282));if(_0x720282[_0x0b2b('0x17')]){if(_0x720282[_0x0b2b('0x17')][_0x0b2b('0x18')]===0x1f4){logger[_0x0b2b('0x17')](_0x0b2b('0x14'),_0x1c7b6f,_0x720282['error'][_0x0b2b('0x19')]);return _0x24c727(_0x720282[_0x0b2b('0x17')]['message']);}logger[_0x0b2b('0x17')](_0x0b2b('0x14'),_0x1c7b6f,_0x720282[_0x0b2b('0x17')][_0x0b2b('0x19')]);return _0x5033f6(_0x720282[_0x0b2b('0x17')][_0x0b2b('0x19')]);}else{logger[_0x0b2b('0x1a')](_0x0b2b('0x14'),_0x1c7b6f,_0x0b2b('0x15'));_0x5033f6(_0x720282[_0x0b2b('0x1b')][_0x0b2b('0x19')]);}})['catch'](function(_0x6d69d3){logger[_0x0b2b('0x17')](_0x0b2b('0x14'),_0x1c7b6f,_0x6d69d3);_0x24c727(_0x6d69d3);});});}exports['GetVoiceQueue']=function(_0x4ed7f){var _0x183d7a=this;return new Promise(function(_0x5084ae,_0x2d37e5){return db[_0x0b2b('0x1c')][_0x0b2b('0x1d')]({'raw':_0x4ed7f[_0x0b2b('0x1e')]?_0x4ed7f['options'][_0x0b2b('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ed7f['options']?_0x4ed7f[_0x0b2b('0x1e')]['where']||null:null,'attributes':_0x4ed7f[_0x0b2b('0x1e')]?_0x4ed7f[_0x0b2b('0x1e')][_0x0b2b('0x20')]||null:null,'limit':_0x4ed7f[_0x0b2b('0x1e')]?_0x4ed7f['options']['limit']||null:null,'include':_0x4ed7f['options']?_0x4ed7f[_0x0b2b('0x1e')][_0x0b2b('0x21')]?_['map'](_0x4ed7f[_0x0b2b('0x1e')][_0x0b2b('0x21')],function(_0xf03b1e){return{'model':db[_0xf03b1e[_0x0b2b('0x22')]],'as':_0xf03b1e['as'],'attributes':_0xf03b1e['attributes'],'include':_0xf03b1e[_0x0b2b('0x21')]?_[_0x0b2b('0x23')](_0xf03b1e[_0x0b2b('0x21')],function(_0x464e99){return{'model':db[_0x464e99[_0x0b2b('0x22')]],'as':_0x464e99['as'],'attributes':_0x464e99[_0x0b2b('0x20')],'include':_0x464e99[_0x0b2b('0x21')]?_[_0x0b2b('0x23')](_0x464e99[_0x0b2b('0x21')],function(_0x41b573){return{'model':db[_0x41b573['model']],'as':_0x41b573['as'],'attributes':_0x41b573['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xf8888b){logger['info']('GetVoiceQueue',_0x4ed7f);logger[_0x0b2b('0x24')](_0x0b2b('0x25'),_0x4ed7f,JSON[_0x0b2b('0x26')](_0xf8888b));_0x5084ae(_0xf8888b);})[_0x0b2b('0x27')](function(_0x41d6e4){logger[_0x0b2b('0x17')](_0x0b2b('0x25'),_0x41d6e4['message'],_0x4ed7f);_0x2d37e5(_0x183d7a[_0x0b2b('0x17')](0x1f4,_0x41d6e4[_0x0b2b('0x19')]));});});};exports[_0x0b2b('0x28')]=function(_0x110c06){var _0x3af6df=this;return new Promise(function(_0x534133,_0x32e012){return db[_0x0b2b('0x1c')][_0x0b2b('0x29')]({'raw':_0x110c06[_0x0b2b('0x1e')]?_0x110c06[_0x0b2b('0x1e')][_0x0b2b('0x1f')]===undefined?!![]:![]:!![],'where':_0x110c06[_0x0b2b('0x1e')]?_0x110c06[_0x0b2b('0x1e')][_0x0b2b('0x2a')]||null:null,'attributes':_0x110c06[_0x0b2b('0x1e')]?_0x110c06['options'][_0x0b2b('0x20')]||null:null,'include':_0x110c06[_0x0b2b('0x1e')]?_0x110c06[_0x0b2b('0x1e')][_0x0b2b('0x21')]?_[_0x0b2b('0x23')](_0x110c06[_0x0b2b('0x1e')]['include'],function(_0x38dea4){return{'model':db[_0x38dea4[_0x0b2b('0x22')]],'as':_0x38dea4['as'],'attributes':_0x38dea4[_0x0b2b('0x20')],'include':_0x38dea4['include']?_['map'](_0x38dea4['include'],function(_0x2be7fe){return{'model':db[_0x2be7fe[_0x0b2b('0x22')]],'as':_0x2be7fe['as'],'attributes':_0x2be7fe['attributes'],'include':_0x2be7fe[_0x0b2b('0x21')]?_[_0x0b2b('0x23')](_0x2be7fe[_0x0b2b('0x21')],function(_0x32fa5e){return{'model':db[_0x32fa5e[_0x0b2b('0x22')]],'as':_0x32fa5e['as'],'attributes':_0x32fa5e[_0x0b2b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0b2b('0x13')](function(_0x35ca23){logger[_0x0b2b('0x1a')](_0x0b2b('0x28'),_0x110c06);logger[_0x0b2b('0x24')](_0x0b2b('0x28'),_0x110c06,JSON[_0x0b2b('0x26')](_0x35ca23));_0x534133(_0x35ca23);})[_0x0b2b('0x27')](function(_0x4c6366){logger[_0x0b2b('0x17')]('ShowVoiceQueue',_0x4c6366['message'],_0x110c06);_0x32e012(_0x3af6df[_0x0b2b('0x17')](0x1f4,_0x4c6366['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index ea06f91..82f8b22 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 _0x24e7=['save','remove','update','emit','register','length','voiceQueue:'];(function(_0x3ba0b2,_0x181f1a){var _0x34d972=function(_0x5427d0){while(--_0x5427d0){_0x3ba0b2['push'](_0x3ba0b2['shift']());}};_0x34d972(++_0x181f1a);}(_0x24e7,0x17a));var _0x724e=function(_0x2e55b5,_0xa345e8){_0x2e55b5=_0x2e55b5-0x0;var _0x1bec95=_0x24e7[_0x2e55b5];return _0x1bec95;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x724e('0x0'),_0x724e('0x1'),_0x724e('0x2')];function createListener(_0x3adcdf,_0x44152f){return function(_0x369ce4){_0x44152f[_0x724e('0x3')](_0x3adcdf,_0x369ce4);};}function removeListener(_0x24195e,_0x45cc7e){return function(){VoiceQueueEvents['removeListener'](_0x24195e,_0x45cc7e);};}exports[_0x724e('0x4')]=function(_0x48d815){for(var _0x5c94a5=0x0,_0x2e7aa7=events[_0x724e('0x5')];_0x5c94a5<_0x2e7aa7;_0x5c94a5++){var _0x4ab226=events[_0x5c94a5];var _0x47dc3b=createListener(_0x724e('0x6')+_0x4ab226,_0x48d815);VoiceQueueEvents['on'](_0x4ab226,_0x47dc3b);}}; \ No newline at end of file +var _0x0094=['remove','update','emit','removeListener','register','save'];(function(_0x35c98b,_0x1660eb){var _0x2e07aa=function(_0x4c9b5d){while(--_0x4c9b5d){_0x35c98b['push'](_0x35c98b['shift']());}};_0x2e07aa(++_0x1660eb);}(_0x0094,0x143));var _0x4009=function(_0x501bbe,_0x3ad949){_0x501bbe=_0x501bbe-0x0;var _0x5b4b72=_0x0094[_0x501bbe];return _0x5b4b72;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x4009('0x0'),_0x4009('0x1'),_0x4009('0x2')];function createListener(_0x1ebcde,_0x3018fc){return function(_0x4f2ef8){_0x3018fc[_0x4009('0x3')](_0x1ebcde,_0x4f2ef8);};}function removeListener(_0x1a7342,_0x2ca6d7){return function(){VoiceQueueEvents[_0x4009('0x4')](_0x1a7342,_0x2ca6d7);};}exports[_0x4009('0x5')]=function(_0x7e1eb2){for(var _0x257e70=0x0,_0x336612=events['length'];_0x257e70<_0x336612;_0x257e70++){var _0x2beda3=events[_0x257e70];var _0x6270ce=createListener('voiceQueue:'+_0x2beda3,_0x7e1eb2);VoiceQueueEvents['on'](_0x2beda3,_0x6270ce);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 5d0d7c5..9709f33 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 _0xad5a=['/:id','show','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xad5a,0x118));var _0xaad5=function(_0x12331c,_0x19e0ab){_0x12331c=_0x12331c-0x0;var _0x22847c=_0xad5a[_0x12331c];return _0x22847c;};'use strict';var multer=require('multer');var util=require(_0xaad5('0x0'));var path=require(_0xaad5('0x1'));var timeout=require(_0xaad5('0x2'));var express=require(_0xaad5('0x3'));var router=express[_0xaad5('0x4')]();var fs_extra=require(_0xaad5('0x5'));var auth=require(_0xaad5('0x6'));var interaction=require(_0xaad5('0x7'));var config=require(_0xaad5('0x8'));var controller=require(_0xaad5('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaad5('0xa')](_0xaad5('0xb'),auth[_0xaad5('0xc')](),controller[_0xaad5('0xd')]);router[_0xaad5('0xa')]('/index',auth[_0xaad5('0xc')](),controller['getVoiceQueuesReport']);router[_0xaad5('0xa')](_0xaad5('0xe'),auth['isAuthenticated'](),controller[_0xaad5('0xf')]);router[_0xaad5('0x10')]('/',auth[_0xaad5('0xc')](),controller[_0xaad5('0x11')]);router[_0xaad5('0x12')](_0xaad5('0xe'),auth[_0xaad5('0xc')](),controller[_0xaad5('0x13')]);router['delete'](_0xaad5('0xe'),auth[_0xaad5('0xc')](),controller['destroy']);module[_0xaad5('0x14')]=router; \ No newline at end of file +var _0xeb54=['isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueueReport.controller'];(function(_0x1c8915,_0x32825a){var _0x1718ea=function(_0x5ecafa){while(--_0x5ecafa){_0x1c8915['push'](_0x1c8915['shift']());}};_0x1718ea(++_0x32825a);}(_0xeb54,0xb7));var _0x4eb5=function(_0x4d8c9e,_0x43b03e){_0x4d8c9e=_0x4d8c9e-0x0;var _0x1c12e2=_0xeb54[_0x4d8c9e];return _0x1c12e2;};'use strict';var multer=require(_0x4eb5('0x0'));var util=require(_0x4eb5('0x1'));var path=require(_0x4eb5('0x2'));var timeout=require(_0x4eb5('0x3'));var express=require(_0x4eb5('0x4'));var router=express[_0x4eb5('0x5')]();var fs_extra=require(_0x4eb5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4eb5('0x7'));var controller=require(_0x4eb5('0x8'));router['get']('/',auth[_0x4eb5('0x9')](),controller[_0x4eb5('0xa')]);router[_0x4eb5('0xb')](_0x4eb5('0xc'),auth[_0x4eb5('0x9')](),controller[_0x4eb5('0xd')]);router[_0x4eb5('0xb')](_0x4eb5('0xe'),auth[_0x4eb5('0x9')](),controller[_0x4eb5('0xf')]);router[_0x4eb5('0xb')](_0x4eb5('0x10'),auth[_0x4eb5('0x9')](),controller[_0x4eb5('0x11')]);router[_0x4eb5('0x12')]('/',auth[_0x4eb5('0x9')](),controller['create']);router[_0x4eb5('0x13')](_0x4eb5('0x10'),auth[_0x4eb5('0x9')](),controller[_0x4eb5('0x14')]);router[_0x4eb5('0x15')](_0x4eb5('0x10'),auth[_0x4eb5('0x9')](),controller[_0x4eb5('0x16')]);module[_0x4eb5('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 19dab30..7d111e6 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 _0x56ca=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','getDataValue','queuecallerjoinAt','seconds','setDataValue','queuecallerleaveAt'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0x56ca,0x123));var _0xa56c=function(_0x50d79a,_0x5b45ce){_0x50d79a=_0x50d79a-0x0;var _0x33f0a7=_0x56ca[_0x50d79a];return _0x33f0a7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa56c('0x0'));module['exports']={'type':{'type':Sequelize[_0xa56c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa56c('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xa56c('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2e953c){var _0x37bf09=moment(_0x2e953c);var _0xd575bd=moment(this[_0xa56c('0x3')](_0xa56c('0x4')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3ad9aa=_0x37bf09['diff'](_0xd575bd,_0xa56c('0x5'));this[_0xa56c('0x6')](_0xa56c('0x7'),_0x2e953c);this[_0xa56c('0x6')](_0xa56c('0x8'),_0x3ad9aa||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xa56c('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xa56c('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa56c('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xa56c('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xa56c('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa56c('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xa56c('0x1')],'comment':_0xa56c('0xb')},'originalposition':{'type':Sequelize[_0xa56c('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa56c('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa56c('0x1')]},'context':{'type':Sequelize[_0xa56c('0x1')]},'exten':{'type':Sequelize[_0xa56c('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa56c('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa56c('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa56c('0x1')],'comment':_0xa56c('0xc')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xa56c('0x1')]},'disposition':{'type':Sequelize[_0xa56c('0x1')]},'secondDisposition':{'type':Sequelize[_0xa56c('0x1')]},'thirdDisposition':{'type':Sequelize[_0xa56c('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xa56c('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6bac=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x197191,_0x412830){var _0x15d150=function(_0x429c8d){while(--_0x429c8d){_0x197191['push'](_0x197191['shift']());}};_0x15d150(++_0x412830);}(_0x6bac,0xa5));var _0xc6ba=function(_0x519412,_0x1651e8){_0x519412=_0x519412-0x0;var _0xcbc3bf=_0x6bac[_0x519412];return _0xcbc3bf;};'use strict';var Sequelize=require(_0xc6ba('0x0'));var moment=require('moment');module[_0xc6ba('0x1')]={'type':{'type':Sequelize[_0xc6ba('0x2')]},'uniqueid':{'type':Sequelize[_0xc6ba('0x2')]},'calleridnum':{'type':Sequelize[_0xc6ba('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xc6ba('0x3')],'set':function(_0x471b27){var _0x4ff6c9=moment(_0x471b27);var _0x222f20=moment(this[_0xc6ba('0x4')](_0xc6ba('0x5')))[_0xc6ba('0x6')](_0xc6ba('0x7'));var _0x1fa2a8=_0x4ff6c9['diff'](_0x222f20,'seconds');this[_0xc6ba('0x8')]('queuecallerleaveAt',_0x471b27);this['setDataValue']('holdtime',_0x1fa2a8||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xc6ba('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc6ba('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xc6ba('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc6ba('0x3')]},'queuecallerexit':{'type':Sequelize[_0xc6ba('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xc6ba('0xa')},'originalposition':{'type':Sequelize[_0xc6ba('0xb')]},'channel':{'type':Sequelize[_0xc6ba('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc6ba('0x2')]},'connectedlinename':{'type':Sequelize[_0xc6ba('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc6ba('0x2')]},'holdtime':{'type':Sequelize[_0xc6ba('0xb')]},'mohtime':{'type':Sequelize[_0xc6ba('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc6ba('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc6ba('0x2')]},'transfer':{'type':Sequelize[_0xc6ba('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc6ba('0x2')],'comment':_0xc6ba('0xc')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 5946b17..d8aaaff 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 _0x96cc=['pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','getVoiceQueuesReport','length','order','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','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','redis','defaults','./voiceQueueReport.socket','register','status','json','undefined','offset','count','limit','Content-Range','reject','save','update','then','destroy','sendStatus','name','send','map','VoiceQueueReport','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x35acf4,_0x5e7b26){var _0x1c8dc5=function(_0x5e3f3b){while(--_0x5e3f3b){_0x35acf4['push'](_0x35acf4['shift']());}};_0x1c8dc5(++_0x5e7b26);}(_0x96cc,0x154));var _0xc96c=function(_0x20cb5f,_0xb04883){_0x20cb5f=_0x20cb5f-0x0;var _0x446a5a=_0x96cc[_0x20cb5f];return _0x446a5a;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require(_0xc96c('0x2'));var rp=require(_0xc96c('0x3'));var moment=require(_0xc96c('0x4'));var BPromise=require(_0xc96c('0x5'));var Mustache=require(_0xc96c('0x6'));var util=require(_0xc96c('0x7'));var path=require('path');var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc96c('0xa'));var _=require('lodash');var squel=require(_0xc96c('0xb'));var crypto=require('crypto');var jsforce=require(_0xc96c('0xc'));var deskjs=require(_0xc96c('0xd'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0xe'));var Papa=require(_0xc96c('0xf'));var Redis=require(_0xc96c('0x10'));var authService=require(_0xc96c('0x11'));var qs=require(_0xc96c('0x12'));var as=require(_0xc96c('0x13'));var hardwareService=require(_0xc96c('0x14'));var logger=require(_0xc96c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];config[_0xc96c('0x19')]=_[_0xc96c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc96c('0x19')]));require(_0xc96c('0x1b'))[_0xc96c('0x1c')](socket);function respondWithStatusCode(_0xd51bd3,_0x47bed6){_0x47bed6=_0x47bed6||0xcc;return function(_0x256be4){if(_0x256be4){return _0xd51bd3['sendStatus'](_0x47bed6);}return _0xd51bd3['status'](_0x47bed6)['end']();};}function respondWithResult(_0x5aa9cd,_0x469bab){_0x469bab=_0x469bab||0xc8;return function(_0x2e2da6){if(_0x2e2da6){return _0x5aa9cd[_0xc96c('0x1d')](_0x469bab)[_0xc96c('0x1e')](_0x2e2da6);}};}function respondWithFilteredResult(_0x648480,_0x1b48f4){return function(_0x269ffd){if(_0x269ffd){var _0x2f2f41=typeof _0x1b48f4['offset']===_0xc96c('0x1f')&&typeof _0x1b48f4['limit']===_0xc96c('0x1f');var _0x4161f8=_0x269ffd['count'];var _0x470a03=_0x2f2f41?0x0:_0x1b48f4[_0xc96c('0x20')];var _0x561e6f=_0x2f2f41?_0x269ffd[_0xc96c('0x21')]:_0x1b48f4[_0xc96c('0x20')]+_0x1b48f4[_0xc96c('0x22')];var _0x2fd735;if(_0x561e6f>=_0x4161f8){_0x561e6f=_0x4161f8;_0x2fd735=0xc8;}else{_0x2fd735=0xce;}_0x648480[_0xc96c('0x1d')](_0x2fd735);return _0x648480['set'](_0xc96c('0x23'),_0x470a03+'-'+_0x561e6f+'/'+_0x4161f8)[_0xc96c('0x1e')](_0x269ffd);}return null;};}function patchUpdates(_0x4aba5e){return function(_0x491a80){try{jsonpatch['apply'](_0x491a80,_0x4aba5e,!![]);}catch(_0x335fd1){return BPromise[_0xc96c('0x24')](_0x335fd1);}return _0x491a80[_0xc96c('0x25')]();};}function saveUpdates(_0x1f6771,_0x49555d){return function(_0x1a1cf8){if(_0x1a1cf8){return _0x1a1cf8[_0xc96c('0x26')](_0x1f6771)[_0xc96c('0x27')](function(_0x3ea980){return _0x3ea980;});}return null;};}function removeEntity(_0x5a55e7,_0x3bebb2){return function(_0x48cd3e){if(_0x48cd3e){return _0x48cd3e[_0xc96c('0x28')]()[_0xc96c('0x27')](function(){_0x5a55e7[_0xc96c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2834ca,_0x144de1){return function(_0x2b92eb){if(!_0x2b92eb){_0x2834ca[_0xc96c('0x29')](0x194);}return _0x2b92eb;};}function handleError(_0x24c1ec,_0x6e4e6){_0x6e4e6=_0x6e4e6||0x1f4;return function(_0x289f38){logger['error'](_0x289f38['stack']);if(_0x289f38[_0xc96c('0x2a')]){delete _0x289f38[_0xc96c('0x2a')];}_0x24c1ec[_0xc96c('0x1d')](_0x6e4e6)[_0xc96c('0x2b')](_0x289f38);};}exports['index']=function(_0x219b08,_0x6b27fc){var _0xa5cf42={},_0x383a5a={},_0x4962f8={'count':0x0,'rows':[]};var _0x1cb08a=_[_0xc96c('0x2c')](db[_0xc96c('0x2d')]['rawAttributes'],function(_0x4d1c44){return{'name':_0x4d1c44[_0xc96c('0x2e')],'type':_0x4d1c44[_0xc96c('0x2f')][_0xc96c('0x30')]};});_0x383a5a['model']=_[_0xc96c('0x2c')](_0x1cb08a,_0xc96c('0x2a'));_0x383a5a[_0xc96c('0x31')]=_[_0xc96c('0x32')](_0x219b08[_0xc96c('0x31')]);_0x383a5a[_0xc96c('0x33')]=_['intersection'](_0x383a5a[_0xc96c('0x34')],_0x383a5a[_0xc96c('0x31')]);_0xa5cf42[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x383a5a[_0xc96c('0x34')],qs[_0xc96c('0x37')](_0x219b08[_0xc96c('0x31')]['fields']));_0xa5cf42[_0xc96c('0x35')]=_0xa5cf42[_0xc96c('0x35')]['length']?_0xa5cf42['attributes']:_0x383a5a[_0xc96c('0x34')];if(!_0x219b08[_0xc96c('0x31')][_0xc96c('0x38')](_0xc96c('0x39'))){_0xa5cf42[_0xc96c('0x22')]=qs[_0xc96c('0x22')](_0x219b08[_0xc96c('0x31')]['limit']);_0xa5cf42[_0xc96c('0x20')]=qs[_0xc96c('0x20')](_0x219b08[_0xc96c('0x31')][_0xc96c('0x20')]);}_0xa5cf42['order']=qs[_0xc96c('0x3a')](_0x219b08[_0xc96c('0x31')][_0xc96c('0x3a')]);_0xa5cf42[_0xc96c('0x3b')]=qs['filters'](_[_0xc96c('0x3c')](_0x219b08[_0xc96c('0x31')],_0x383a5a[_0xc96c('0x33')]),_0x1cb08a);if(_0x219b08['query'][_0xc96c('0x3d')]){_0xa5cf42[_0xc96c('0x3b')]=_[_0xc96c('0x3e')](_0xa5cf42[_0xc96c('0x3b')],{'$or':_[_0xc96c('0x2c')](_0x1cb08a,function(_0x205e31){if(_0x205e31[_0xc96c('0x2f')]!==_0xc96c('0x3f')){var _0xf72cd8={};_0xf72cd8[_0x205e31[_0xc96c('0x2a')]]={'$like':'%'+_0x219b08[_0xc96c('0x31')][_0xc96c('0x3d')]+'%'};return _0xf72cd8;}})});}_0xa5cf42=_[_0xc96c('0x3e')]({},_0xa5cf42,_0x219b08[_0xc96c('0x40')]);var _0xd38208={'where':_0xa5cf42[_0xc96c('0x3b')]};return db[_0xc96c('0x2d')][_0xc96c('0x21')](_0xd38208)[_0xc96c('0x27')](function(_0x1df9b4){_0x4962f8['count']=_0x1df9b4;if(_0x219b08[_0xc96c('0x31')][_0xc96c('0x41')]){_0xa5cf42[_0xc96c('0x42')]=[{'all':!![]}];}return db[_0xc96c('0x2d')]['findAll'](_0xa5cf42);})[_0xc96c('0x27')](function(_0x40c213){_0x4962f8[_0xc96c('0x43')]=_0x40c213;return _0x4962f8;})[_0xc96c('0x27')](respondWithFilteredResult(_0x6b27fc,_0xa5cf42))[_0xc96c('0x44')](handleError(_0x6b27fc,null));};exports[_0xc96c('0x45')]=function(_0x84f93e,_0x3b56cf){var _0x50459c={'raw':![],'where':{'id':_0x84f93e[_0xc96c('0x46')]['id']}},_0x3d7679={};_0x3d7679[_0xc96c('0x34')]=_[_0xc96c('0x32')](db[_0xc96c('0x2d')][_0xc96c('0x47')]);_0x3d7679['query']=_[_0xc96c('0x32')](_0x84f93e['query']);_0x3d7679[_0xc96c('0x33')]=_['intersection'](_0x3d7679[_0xc96c('0x34')],_0x3d7679['query']);_0x50459c[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x3d7679[_0xc96c('0x34')],qs[_0xc96c('0x37')](_0x84f93e[_0xc96c('0x31')]['fields']));_0x50459c[_0xc96c('0x35')]=_0x50459c[_0xc96c('0x35')]['length']?_0x50459c[_0xc96c('0x35')]:_0x3d7679[_0xc96c('0x34')];if(_0x84f93e[_0xc96c('0x31')][_0xc96c('0x41')]){_0x50459c[_0xc96c('0x42')]=[{'all':!![]}];}_0x50459c=_[_0xc96c('0x3e')]({},_0x50459c,_0x84f93e[_0xc96c('0x40')]);return db['VoiceQueueReport'][_0xc96c('0x48')](_0x50459c)[_0xc96c('0x27')](handleEntityNotFound(_0x3b56cf,null))[_0xc96c('0x27')](respondWithResult(_0x3b56cf,null))[_0xc96c('0x44')](handleError(_0x3b56cf,null));};exports['create']=function(_0x60f6a4,_0x18378b){return db['VoiceQueueReport'][_0xc96c('0x49')](_0x60f6a4['body'],{})[_0xc96c('0x27')](respondWithResult(_0x18378b,0xc9))['catch'](handleError(_0x18378b,null));};exports[_0xc96c('0x26')]=function(_0x4ae994,_0x296f8f){if(_0x4ae994[_0xc96c('0x4a')]['id']){delete _0x4ae994[_0xc96c('0x4a')]['id'];}return db[_0xc96c('0x2d')][_0xc96c('0x48')]({'where':{'id':_0x4ae994[_0xc96c('0x46')]['id']}})[_0xc96c('0x27')](handleEntityNotFound(_0x296f8f,null))['then'](saveUpdates(_0x4ae994[_0xc96c('0x4a')],null))[_0xc96c('0x27')](respondWithResult(_0x296f8f,null))[_0xc96c('0x44')](handleError(_0x296f8f,null));};exports[_0xc96c('0x28')]=function(_0x23f74e,_0x520793){return db[_0xc96c('0x2d')][_0xc96c('0x48')]({'where':{'id':_0x23f74e[_0xc96c('0x46')]['id']}})[_0xc96c('0x27')](handleEntityNotFound(_0x520793,null))[_0xc96c('0x27')](removeEntity(_0x520793,null))[_0xc96c('0x44')](handleError(_0x520793,null));};exports[_0xc96c('0x4b')]=function(_0x275002,_0x3e89b2){return db[_0xc96c('0x2d')][_0xc96c('0x4b')]()[_0xc96c('0x27')](respondWithResult(_0x3e89b2,null))[_0xc96c('0x44')](handleError(_0x3e89b2,null));};exports[_0xc96c('0x4c')]=function(_0x114869,_0x49b5d7){var _0x2a8b1c={},_0x601c2c={},_0x2d6a28={'count':0x0,'rows':[]};_0x601c2c['model']=_['keys'](db[_0xc96c('0x2d')][_0xc96c('0x47')]);_0x601c2c[_0xc96c('0x31')]=_[_0xc96c('0x32')](_0x114869[_0xc96c('0x31')]);_0x601c2c['filters']=_[_0xc96c('0x36')](_0x601c2c[_0xc96c('0x34')],_0x601c2c['query']);_0x2a8b1c[_0xc96c('0x35')]=_['intersection'](_0x601c2c[_0xc96c('0x34')],qs[_0xc96c('0x37')](_0x114869[_0xc96c('0x31')][_0xc96c('0x37')]));_0x2a8b1c[_0xc96c('0x35')]=_0x2a8b1c['attributes'][_0xc96c('0x4d')]?_0x2a8b1c[_0xc96c('0x35')]:_0x601c2c[_0xc96c('0x34')];if(!_0x114869[_0xc96c('0x31')][_0xc96c('0x38')](_0xc96c('0x39'))){_0x2a8b1c[_0xc96c('0x22')]=qs[_0xc96c('0x22')](_0x114869[_0xc96c('0x31')]['limit']);_0x2a8b1c[_0xc96c('0x20')]=qs[_0xc96c('0x20')](_0x114869['query'][_0xc96c('0x20')]);}_0x2a8b1c[_0xc96c('0x4e')]=qs[_0xc96c('0x3a')](_0x114869[_0xc96c('0x31')]['sort']);_0x2a8b1c['where']=qs[_0xc96c('0x33')](_[_0xc96c('0x3c')](_0x114869['query'],_0x601c2c['filters']));if(_0x114869[_0xc96c('0x31')][_0xc96c('0x3d')]){_0x2a8b1c[_0xc96c('0x3b')]=_[_0xc96c('0x3e')](_0x2a8b1c[_0xc96c('0x3b')],{'$or':_[_0xc96c('0x2c')](_0x2a8b1c['attributes'],function(_0x174eda){var _0xf5aadd={};_0xf5aadd[_0x174eda]={'$like':'%'+_0x114869['query'][_0xc96c('0x3d')]+'%'};return _0xf5aadd;})});}_0x2a8b1c=_['merge']({},_0x2a8b1c,_0x114869['options']);var _0x3b5e63={'where':_0x2a8b1c[_0xc96c('0x3b')]};return db[_0xc96c('0x2d')][_0xc96c('0x21')](_0x3b5e63)[_0xc96c('0x27')](function(_0x30b1d4){_0x2d6a28[_0xc96c('0x21')]=_0x30b1d4;if(_0x114869[_0xc96c('0x31')][_0xc96c('0x41')]){_0x2a8b1c[_0xc96c('0x42')]=[{'all':!![]}];}return db[_0xc96c('0x2d')][_0xc96c('0x4f')](_0x2a8b1c);})[_0xc96c('0x27')](function(_0x1ff17c){_0x2d6a28[_0xc96c('0x43')]=_0x1ff17c;return _0x2d6a28;})[_0xc96c('0x27')](respondWithFilteredResult(_0x49b5d7,_0x2a8b1c,_0xc96c('0x4c')))['catch'](handleError(_0x49b5d7,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x90f7=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','options','where','VoiceQueueReport','includeAll','include','rows','catch','show','params','find','create','body','getVoiceQueuesReport','rawAttributes','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x18e03,_0x6a4ad2){var _0x147fc8=function(_0x4777d2){while(--_0x4777d2){_0x18e03['push'](_0x18e03['shift']());}};_0x147fc8(++_0x6a4ad2);}(_0x90f7,0x131));var _0x790f=function(_0x3c59b5,_0x40975c){_0x3c59b5=_0x3c59b5-0x0;var _0x40a8a1=_0x90f7[_0x3c59b5];return _0x40a8a1;};'use strict';var emlformat=require(_0x790f('0x0'));var rimraf=require(_0x790f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x790f('0x2'));var rp=require(_0x790f('0x3'));var moment=require(_0x790f('0x4'));var BPromise=require(_0x790f('0x5'));var Mustache=require(_0x790f('0x6'));var util=require(_0x790f('0x7'));var path=require(_0x790f('0x8'));var sox=require('sox');var csv=require(_0x790f('0x9'));var ejs=require(_0x790f('0xa'));var fs=require('fs');var fs_extra=require(_0x790f('0xb'));var _=require(_0x790f('0xc'));var squel=require('squel');var crypto=require(_0x790f('0xd'));var jsforce=require(_0x790f('0xe'));var deskjs=require(_0x790f('0xf'));var toCsv=require(_0x790f('0x9'));var querystring=require(_0x790f('0x10'));var Papa=require(_0x790f('0x11'));var Redis=require(_0x790f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x790f('0x13'));var as=require(_0x790f('0x14'));var hardwareService=require(_0x790f('0x15'));var logger=require(_0x790f('0x16'))(_0x790f('0x17'));var utils=require(_0x790f('0x18'));var config=require(_0x790f('0x19'));var licenseUtil=require(_0x790f('0x1a'));var db=require('../../mysqldb')['db'];config[_0x790f('0x1b')]=_[_0x790f('0x1c')](config[_0x790f('0x1b')],{'host':_0x790f('0x1d'),'port':0x18eb});var socket=require(_0x790f('0x1e'))(new Redis(config[_0x790f('0x1b')]));require('./voiceQueueReport.socket')[_0x790f('0x1f')](socket);function respondWithStatusCode(_0x537c0f,_0x4cdc00){_0x4cdc00=_0x4cdc00||0xcc;return function(_0x474b39){if(_0x474b39){return _0x537c0f['sendStatus'](_0x4cdc00);}return _0x537c0f[_0x790f('0x20')](_0x4cdc00)[_0x790f('0x21')]();};}function respondWithResult(_0x1453d7,_0x46e1c2){_0x46e1c2=_0x46e1c2||0xc8;return function(_0x81968){if(_0x81968){return _0x1453d7[_0x790f('0x20')](_0x46e1c2)[_0x790f('0x22')](_0x81968);}};}function respondWithFilteredResult(_0x2599db,_0x322c38){return function(_0x495aea){if(_0x495aea){var _0x52711f=typeof _0x322c38[_0x790f('0x23')]==='undefined'&&typeof _0x322c38[_0x790f('0x24')]==='undefined';var _0x282047=_0x495aea['count'];var _0x11ef53=_0x52711f?0x0:_0x322c38['offset'];var _0x562139=_0x52711f?_0x495aea[_0x790f('0x25')]:_0x322c38[_0x790f('0x23')]+_0x322c38[_0x790f('0x24')];var _0x10b4b5;if(_0x562139>=_0x282047){_0x562139=_0x282047;_0x10b4b5=0xc8;}else{_0x10b4b5=0xce;}_0x2599db['status'](_0x10b4b5);return _0x2599db[_0x790f('0x26')](_0x790f('0x27'),_0x11ef53+'-'+_0x562139+'/'+_0x282047)[_0x790f('0x22')](_0x495aea);}return null;};}function patchUpdates(_0x3f384c){return function(_0x450d1c){try{jsonpatch[_0x790f('0x28')](_0x450d1c,_0x3f384c,!![]);}catch(_0x174a9f){return BPromise[_0x790f('0x29')](_0x174a9f);}return _0x450d1c['save']();};}function saveUpdates(_0x49a4f5,_0x245946){return function(_0xc87134){if(_0xc87134){return _0xc87134[_0x790f('0x2a')](_0x49a4f5)['then'](function(_0x47054b){return _0x47054b;});}return null;};}function removeEntity(_0x12b67d,_0x3319f5){return function(_0x413261){if(_0x413261){return _0x413261[_0x790f('0x2b')]()[_0x790f('0x2c')](function(){_0x12b67d[_0x790f('0x20')](0xcc)[_0x790f('0x21')]();});}};}function handleEntityNotFound(_0x5ad2be,_0x35aefb){return function(_0x20a708){if(!_0x20a708){_0x5ad2be['sendStatus'](0x194);}return _0x20a708;};}function handleError(_0x41d742,_0x2017d1){_0x2017d1=_0x2017d1||0x1f4;return function(_0x47650a){logger['error'](_0x47650a[_0x790f('0x2d')]);if(_0x47650a[_0x790f('0x2e')]){delete _0x47650a[_0x790f('0x2e')];}_0x41d742[_0x790f('0x20')](_0x2017d1)['send'](_0x47650a);};}exports[_0x790f('0x2f')]=function(_0x198b53,_0xbc2ede){var _0x2593a3={},_0x23ad11={},_0x47e552={'count':0x0,'rows':[]};var _0x4e3c9b=_[_0x790f('0x30')](db['VoiceQueueReport']['rawAttributes'],function(_0x502a11){return{'name':_0x502a11[_0x790f('0x31')],'type':_0x502a11[_0x790f('0x32')][_0x790f('0x33')]};});_0x23ad11['model']=_[_0x790f('0x30')](_0x4e3c9b,_0x790f('0x2e'));_0x23ad11['query']=_[_0x790f('0x34')](_0x198b53[_0x790f('0x35')]);_0x23ad11['filters']=_[_0x790f('0x36')](_0x23ad11[_0x790f('0x37')],_0x23ad11[_0x790f('0x35')]);_0x2593a3['attributes']=_[_0x790f('0x36')](_0x23ad11['model'],qs[_0x790f('0x38')](_0x198b53[_0x790f('0x35')][_0x790f('0x38')]));_0x2593a3[_0x790f('0x39')]=_0x2593a3[_0x790f('0x39')][_0x790f('0x3a')]?_0x2593a3[_0x790f('0x39')]:_0x23ad11[_0x790f('0x37')];if(!_0x198b53[_0x790f('0x35')][_0x790f('0x3b')](_0x790f('0x3c'))){_0x2593a3[_0x790f('0x24')]=qs[_0x790f('0x24')](_0x198b53[_0x790f('0x35')]['limit']);_0x2593a3[_0x790f('0x23')]=qs[_0x790f('0x23')](_0x198b53[_0x790f('0x35')][_0x790f('0x23')]);}_0x2593a3[_0x790f('0x3d')]=qs[_0x790f('0x3e')](_0x198b53[_0x790f('0x35')][_0x790f('0x3e')]);_0x2593a3['where']=qs['filters'](_['pick'](_0x198b53[_0x790f('0x35')],_0x23ad11[_0x790f('0x3f')]),_0x4e3c9b);if(_0x198b53[_0x790f('0x35')][_0x790f('0x40')]){_0x2593a3['where']=_[_0x790f('0x41')](_0x2593a3['where'],{'$or':_[_0x790f('0x30')](_0x4e3c9b,function(_0x3fa732){if(_0x3fa732[_0x790f('0x32')]!=='VIRTUAL'){var _0x54c304={};_0x54c304[_0x3fa732[_0x790f('0x2e')]]={'$like':'%'+_0x198b53[_0x790f('0x35')][_0x790f('0x40')]+'%'};return _0x54c304;}})});}_0x2593a3=_[_0x790f('0x41')]({},_0x2593a3,_0x198b53[_0x790f('0x42')]);var _0x4ec707={'where':_0x2593a3[_0x790f('0x43')]};return db[_0x790f('0x44')][_0x790f('0x25')](_0x4ec707)[_0x790f('0x2c')](function(_0x24fac9){_0x47e552[_0x790f('0x25')]=_0x24fac9;if(_0x198b53[_0x790f('0x35')][_0x790f('0x45')]){_0x2593a3[_0x790f('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x2593a3);})[_0x790f('0x2c')](function(_0x3ed61a){_0x47e552[_0x790f('0x47')]=_0x3ed61a;return _0x47e552;})['then'](respondWithFilteredResult(_0xbc2ede,_0x2593a3))[_0x790f('0x48')](handleError(_0xbc2ede,null));};exports[_0x790f('0x49')]=function(_0x4a259f,_0x109b23){var _0xff6f0={'raw':![],'where':{'id':_0x4a259f[_0x790f('0x4a')]['id']}},_0xcd3748={};_0xcd3748[_0x790f('0x37')]=_[_0x790f('0x34')](db[_0x790f('0x44')]['rawAttributes']);_0xcd3748['query']=_['keys'](_0x4a259f[_0x790f('0x35')]);_0xcd3748[_0x790f('0x3f')]=_[_0x790f('0x36')](_0xcd3748[_0x790f('0x37')],_0xcd3748[_0x790f('0x35')]);_0xff6f0[_0x790f('0x39')]=_[_0x790f('0x36')](_0xcd3748[_0x790f('0x37')],qs['fields'](_0x4a259f[_0x790f('0x35')]['fields']));_0xff6f0[_0x790f('0x39')]=_0xff6f0[_0x790f('0x39')][_0x790f('0x3a')]?_0xff6f0['attributes']:_0xcd3748[_0x790f('0x37')];if(_0x4a259f[_0x790f('0x35')][_0x790f('0x45')]){_0xff6f0[_0x790f('0x46')]=[{'all':!![]}];}_0xff6f0=_[_0x790f('0x41')]({},_0xff6f0,_0x4a259f[_0x790f('0x42')]);return db['VoiceQueueReport'][_0x790f('0x4b')](_0xff6f0)[_0x790f('0x2c')](handleEntityNotFound(_0x109b23,null))['then'](respondWithResult(_0x109b23,null))['catch'](handleError(_0x109b23,null));};exports[_0x790f('0x4c')]=function(_0xf3cae7,_0x3f97cc){return db[_0x790f('0x44')][_0x790f('0x4c')](_0xf3cae7['body'],{})[_0x790f('0x2c')](respondWithResult(_0x3f97cc,0xc9))[_0x790f('0x48')](handleError(_0x3f97cc,null));};exports[_0x790f('0x2a')]=function(_0x468ab0,_0x588d68){if(_0x468ab0[_0x790f('0x4d')]['id']){delete _0x468ab0['body']['id'];}return db['VoiceQueueReport'][_0x790f('0x4b')]({'where':{'id':_0x468ab0[_0x790f('0x4a')]['id']}})[_0x790f('0x2c')](handleEntityNotFound(_0x588d68,null))[_0x790f('0x2c')](saveUpdates(_0x468ab0[_0x790f('0x4d')],null))[_0x790f('0x2c')](respondWithResult(_0x588d68,null))['catch'](handleError(_0x588d68,null));};exports[_0x790f('0x2b')]=function(_0x45b87e,_0x44981c){return db['VoiceQueueReport'][_0x790f('0x4b')]({'where':{'id':_0x45b87e[_0x790f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x44981c,null))[_0x790f('0x2c')](removeEntity(_0x44981c,null))[_0x790f('0x48')](handleError(_0x44981c,null));};exports['describe']=function(_0x5955ba,_0x368455){return db['VoiceQueueReport']['describe']()[_0x790f('0x2c')](respondWithResult(_0x368455,null))[_0x790f('0x48')](handleError(_0x368455,null));};exports[_0x790f('0x4e')]=function(_0x4e85f2,_0x1b2c4a){var _0x253911={},_0x2d54e4={},_0x4b8b01={'count':0x0,'rows':[]};_0x2d54e4[_0x790f('0x37')]=_[_0x790f('0x34')](db[_0x790f('0x44')][_0x790f('0x4f')]);_0x2d54e4[_0x790f('0x35')]=_[_0x790f('0x34')](_0x4e85f2[_0x790f('0x35')]);_0x2d54e4[_0x790f('0x3f')]=_[_0x790f('0x36')](_0x2d54e4[_0x790f('0x37')],_0x2d54e4['query']);_0x253911['attributes']=_[_0x790f('0x36')](_0x2d54e4[_0x790f('0x37')],qs[_0x790f('0x38')](_0x4e85f2[_0x790f('0x35')][_0x790f('0x38')]));_0x253911[_0x790f('0x39')]=_0x253911[_0x790f('0x39')][_0x790f('0x3a')]?_0x253911['attributes']:_0x2d54e4[_0x790f('0x37')];if(!_0x4e85f2[_0x790f('0x35')][_0x790f('0x3b')](_0x790f('0x3c'))){_0x253911[_0x790f('0x24')]=qs[_0x790f('0x24')](_0x4e85f2[_0x790f('0x35')]['limit']);_0x253911['offset']=qs[_0x790f('0x23')](_0x4e85f2['query']['offset']);}_0x253911[_0x790f('0x3d')]=qs[_0x790f('0x3e')](_0x4e85f2['query'][_0x790f('0x3e')]);_0x253911[_0x790f('0x43')]=qs[_0x790f('0x3f')](_['pick'](_0x4e85f2[_0x790f('0x35')],_0x2d54e4[_0x790f('0x3f')]));if(_0x4e85f2[_0x790f('0x35')][_0x790f('0x40')]){_0x253911[_0x790f('0x43')]=_['merge'](_0x253911[_0x790f('0x43')],{'$or':_[_0x790f('0x30')](_0x253911[_0x790f('0x39')],function(_0x20127d){var _0x164a09={};_0x164a09[_0x20127d]={'$like':'%'+_0x4e85f2[_0x790f('0x35')]['filter']+'%'};return _0x164a09;})});}_0x253911=_[_0x790f('0x41')]({},_0x253911,_0x4e85f2[_0x790f('0x42')]);var _0x9e847={'where':_0x253911[_0x790f('0x43')]};return db['VoiceQueueReport'][_0x790f('0x25')](_0x9e847)[_0x790f('0x2c')](function(_0x179a2b){_0x4b8b01[_0x790f('0x25')]=_0x179a2b;if(_0x4e85f2[_0x790f('0x35')][_0x790f('0x45')]){_0x253911['include']=[{'all':!![]}];}return db[_0x790f('0x44')]['findAll'](_0x253911);})[_0x790f('0x2c')](function(_0x46225f){_0x4b8b01['rows']=_0x46225f;return _0x4b8b01;})[_0x790f('0x2c')](respondWithFilteredResult(_0x1b2c4a,_0x253911,_0x790f('0x4e')))['catch'](handleError(_0x1b2c4a,null,_0x790f('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 7c990e4..d76f011 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 _0x08a5=['emit','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x08a5,0x1e0));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x508a('0x0'));var VoiceQueueReport=require(_0x508a('0x1'))['db'][_0x508a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x508a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x508a('0x4'),'afterDestroy':_0x508a('0x5')};function emitEvent(_0x6fec04){return function(_0x5d7531,_0x25b009,_0x344240){VoiceQueueReportEvents[_0x508a('0x6')](_0x6fec04+':'+_0x5d7531['id'],_0x5d7531);VoiceQueueReportEvents[_0x508a('0x6')](_0x6fec04,_0x5d7531);_0x344240(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x508a('0x7')](e,emitEvent(event));}}module[_0x508a('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6f7f=['hasOwnProperty','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f7f,0x13c));var _0xf6f7=function(_0x4a3542,_0x192c95){_0x4a3542=_0x4a3542-0x0;var _0x517f7f=_0x6f7f[_0x4a3542];return _0x517f7f;};'use strict';var EventEmitter=require(_0xf6f7('0x0'));var VoiceQueueReport=require(_0xf6f7('0x1'))['db'][_0xf6f7('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6f7('0x4'),'afterDestroy':_0xf6f7('0x5')};function emitEvent(_0x467cab){return function(_0x3da328,_0x1e6ffe,_0x3081f2){VoiceQueueReportEvents['emit'](_0x467cab+':'+_0x3da328['id'],_0x3da328);VoiceQueueReportEvents['emit'](_0x467cab,_0x3da328);_0x3081f2(null);};}for(var e in events){if(events[_0xf6f7('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 154b7b8..0f49523 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 _0xb83b=['report_queue','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','define'];(function(_0x4bf5f6,_0x44e324){var _0x21c97e=function(_0x4485a9){while(--_0x4485a9){_0x4bf5f6['push'](_0x4bf5f6['shift']());}};_0x21c97e(++_0x44e324);}(_0xb83b,0x8e));var _0xbb83=function(_0x19f13c,_0x3c11b0){_0x19f13c=_0x19f13c-0x0;var _0xce8902=_0xb83b[_0x19f13c];return _0xce8902;};'use strict';var _=require(_0xbb83('0x0'));var util=require(_0xbb83('0x1'));var logger=require(_0xbb83('0x2'))(_0xbb83('0x3'));var moment=require(_0xbb83('0x4'));var BPromise=require(_0xbb83('0x5'));var rp=require(_0xbb83('0x6'));var fs=require('fs');var path=require(_0xbb83('0x7'));var rimraf=require(_0xbb83('0x8'));var config=require(_0xbb83('0x9'));var attributes=require(_0xbb83('0xa'));module['exports']=function(_0x5dbef5,_0x19734a){return _0x5dbef5[_0xbb83('0xb')]('VoiceQueueReport',attributes,{'tableName':_0xbb83('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xbb83('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4998=['exports','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x3cf192,_0x34c79b){var _0x3689dd=function(_0x3f211e){while(--_0x3f211e){_0x3cf192['push'](_0x3cf192['shift']());}};_0x3689dd(++_0x34c79b);}(_0x4998,0x156));var _0x8499=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x4998[_0x3ba924];return _0x4cc1df;};'use strict';var _=require(_0x8499('0x0'));var util=require(_0x8499('0x1'));var logger=require(_0x8499('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8499('0x3'));var rp=require(_0x8499('0x4'));var fs=require('fs');var path=require(_0x8499('0x5'));var rimraf=require(_0x8499('0x6'));var config=require(_0x8499('0x7'));var attributes=require(_0x8499('0x8'));module[_0x8499('0x9')]=function(_0x308ed9,_0x24c3bc){return _0x308ed9['define'](_0x8499('0xa'),attributes,{'tableName':_0x8499('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x8499('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 b346751..126c93e 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 _0x9bbd=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','register','request','info','debug','request\x20sent','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','then','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update'];(function(_0x297ec5,_0x860cf4){var _0x367d44=function(_0x1d96b3){while(--_0x1d96b3){_0x297ec5['push'](_0x297ec5['shift']());}};_0x367d44(++_0x860cf4);}(_0x9bbd,0xc8));var _0xd9bb=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9bbd[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xd9bb('0x0'));var util=require('util');var moment=require(_0xd9bb('0x1'));var BPromise=require(_0xd9bb('0x2'));var rs=require(_0xd9bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9bb('0x4'))['db'];var utils=require(_0xd9bb('0x5'));var logger=require(_0xd9bb('0x6'))(_0xd9bb('0x7'));var config=require(_0xd9bb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9bb('0x9')]({'port':0x232a});config['redis']=_[_0xd9bb('0xa')](config[_0xd9bb('0xb')],{'host':_0xd9bb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xd9bb('0xd')](socket);function respondWithRpcPromise(_0x5f742c,_0x4a5a96,_0x553545){return new BPromise(function(_0x48e167,_0x1b8059){return client[_0xd9bb('0xe')](_0x5f742c,_0x553545)['then'](function(_0x51e596){logger[_0xd9bb('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x4a5a96,'request\x20sent');logger[_0xd9bb('0x10')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x4a5a96,_0xd9bb('0x11'),JSON[_0xd9bb('0x12')](_0x51e596));if(_0x51e596['error']){if(_0x51e596[_0xd9bb('0x13')]['code']===0x1f4){logger[_0xd9bb('0x13')](_0xd9bb('0x14'),_0x4a5a96,_0x51e596[_0xd9bb('0x13')][_0xd9bb('0x15')]);return _0x1b8059(_0x51e596['error'][_0xd9bb('0x15')]);}logger['error'](_0xd9bb('0x14'),_0x4a5a96,_0x51e596['error'][_0xd9bb('0x15')]);return _0x48e167(_0x51e596[_0xd9bb('0x13')][_0xd9bb('0x15')]);}else{logger[_0xd9bb('0xf')](_0xd9bb('0x14'),_0x4a5a96,_0xd9bb('0x11'));_0x48e167(_0x51e596['result'][_0xd9bb('0x15')]);}})[_0xd9bb('0x16')](function(_0x4ba0aa){logger[_0xd9bb('0x13')](_0xd9bb('0x14'),_0x4a5a96,_0x4ba0aa);_0x1b8059(_0x4ba0aa);});});}exports[_0xd9bb('0x17')]=function(_0x3fa538){var _0x36b4a7=this;return new Promise(function(_0x1f6e8a,_0x5acba7){return db[_0xd9bb('0x18')][_0xd9bb('0x19')]({'raw':_0x3fa538[_0xd9bb('0x1a')]?_0x3fa538[_0xd9bb('0x1a')][_0xd9bb('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fa538[_0xd9bb('0x1a')]?_0x3fa538[_0xd9bb('0x1a')][_0xd9bb('0x1c')]||null:null,'attributes':_0x3fa538[_0xd9bb('0x1a')]?_0x3fa538[_0xd9bb('0x1a')]['attributes']||null:null,'limit':_0x3fa538[_0xd9bb('0x1a')]?_0x3fa538[_0xd9bb('0x1a')][_0xd9bb('0x1d')]||null:null,'include':_0x3fa538[_0xd9bb('0x1a')]?_0x3fa538['options'][_0xd9bb('0x1e')]?_[_0xd9bb('0x1f')](_0x3fa538[_0xd9bb('0x1a')][_0xd9bb('0x1e')],function(_0x44fdab){return{'model':db[_0x44fdab[_0xd9bb('0x20')]],'as':_0x44fdab['as'],'attributes':_0x44fdab[_0xd9bb('0x21')],'include':_0x44fdab[_0xd9bb('0x1e')]?_['map'](_0x44fdab[_0xd9bb('0x1e')],function(_0x966be1){return{'model':db[_0x966be1[_0xd9bb('0x20')]],'as':_0x966be1['as'],'attributes':_0x966be1[_0xd9bb('0x21')],'include':_0x966be1[_0xd9bb('0x1e')]?_[_0xd9bb('0x1f')](_0x966be1[_0xd9bb('0x1e')],function(_0x28f852){return{'model':db[_0x28f852['model']],'as':_0x28f852['as'],'attributes':_0x28f852[_0xd9bb('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd9bb('0x22')](function(_0x18f2cc){logger['info'](_0xd9bb('0x17'),_0x3fa538);logger[_0xd9bb('0x10')](_0xd9bb('0x17'),_0x3fa538,JSON[_0xd9bb('0x12')](_0x18f2cc));_0x1f6e8a(_0x18f2cc);})['catch'](function(_0x2c14bd){logger[_0xd9bb('0x13')](_0xd9bb('0x17'),_0x2c14bd['message'],_0x3fa538);_0x5acba7(_0x36b4a7[_0xd9bb('0x13')](0x1f4,_0x2c14bd[_0xd9bb('0x15')]));});});};exports[_0xd9bb('0x23')]=function(_0x5ec365){var _0x15caa9=this;return new Promise(function(_0x1be398,_0x45fe66){return db[_0xd9bb('0x18')][_0xd9bb('0x24')](_0x5ec365[_0xd9bb('0x25')],{'raw':_0x5ec365[_0xd9bb('0x1a')]?_0x5ec365[_0xd9bb('0x1a')][_0xd9bb('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x273f7e){logger[_0xd9bb('0xf')](_0xd9bb('0x23'),_0x5ec365);logger[_0xd9bb('0x10')]('CreateVoiceQueueReport',_0x5ec365,JSON[_0xd9bb('0x12')](_0x273f7e));_0x1be398(_0x273f7e);})[_0xd9bb('0x16')](function(_0x1af3ad){logger[_0xd9bb('0x13')](_0xd9bb('0x23'),_0x1af3ad[_0xd9bb('0x15')],_0x5ec365);_0x45fe66(_0x15caa9[_0xd9bb('0x13')](0x1f4,_0x1af3ad[_0xd9bb('0x15')]));});});};exports[_0xd9bb('0x26')]=function(_0x4a0ec){var _0x36772d=this;return new Promise(function(_0x4d529c,_0x399f8c){return db[_0xd9bb('0x18')][_0xd9bb('0x27')](_0x4a0ec[_0xd9bb('0x25')],{'raw':_0x4a0ec[_0xd9bb('0x1a')]?_0x4a0ec[_0xd9bb('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0ec[_0xd9bb('0x1a')]?_0x4a0ec[_0xd9bb('0x1a')][_0xd9bb('0x1c')]||null:null,'attributes':_0x4a0ec[_0xd9bb('0x1a')]?_0x4a0ec[_0xd9bb('0x1a')]['attributes']||null:null,'limit':_0x4a0ec[_0xd9bb('0x1a')]?_0x4a0ec[_0xd9bb('0x1a')][_0xd9bb('0x1d')]||null:null})['then'](function(_0x2e765a){logger[_0xd9bb('0xf')]('UpdateVoiceQueueReport',_0x4a0ec);logger['debug'](_0xd9bb('0x26'),_0x4a0ec,JSON[_0xd9bb('0x12')](_0x2e765a));_0x4d529c(_0x2e765a);})[_0xd9bb('0x16')](function(_0x21b5fc){logger[_0xd9bb('0x13')]('UpdateVoiceQueueReport',_0x21b5fc[_0xd9bb('0x15')],_0x4a0ec);_0x399f8c(_0x36772d[_0xd9bb('0x13')](0x1f4,_0x21b5fc['message']));});});}; \ No newline at end of file +var _0x7889=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','util'];(function(_0x3328bd,_0x34b6cc){var _0xf2012a=function(_0x35a4e5){while(--_0x35a4e5){_0x3328bd['push'](_0x3328bd['shift']());}};_0xf2012a(++_0x34b6cc);}(_0x7889,0x14f));var _0x9788=function(_0x2c1e08,_0x8960ce){_0x2c1e08=_0x2c1e08-0x0;var _0x37f8e0=_0x7889[_0x2c1e08];return _0x37f8e0;};'use strict';var _=require('lodash');var util=require(_0x9788('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9788('0x1'));var fs=require('fs');var Redis=require(_0x9788('0x2'));var db=require(_0x9788('0x3'))['db'];var utils=require(_0x9788('0x4'));var logger=require(_0x9788('0x5'))(_0x9788('0x6'));var config=require(_0x9788('0x7'));var jayson=require(_0x9788('0x8'));var client=jayson[_0x9788('0x9')][_0x9788('0xa')]({'port':0x232a});config[_0x9788('0xb')]=_['defaults'](config[_0x9788('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9788('0xc'))(new Redis(config[_0x9788('0xb')]));require(_0x9788('0xd'))[_0x9788('0xe')](socket);function respondWithRpcPromise(_0x536cbc,_0x280c51,_0x23bfb7){return new BPromise(function(_0x1a2337,_0x36a43a){return client[_0x9788('0xf')](_0x536cbc,_0x23bfb7)[_0x9788('0x10')](function(_0x431f1a){logger[_0x9788('0x11')](_0x9788('0x12'),_0x280c51,_0x9788('0x13'));logger[_0x9788('0x14')](_0x9788('0x15'),_0x280c51,_0x9788('0x13'),JSON[_0x9788('0x16')](_0x431f1a));if(_0x431f1a[_0x9788('0x17')]){if(_0x431f1a['error'][_0x9788('0x18')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x280c51,_0x431f1a[_0x9788('0x17')]['message']);return _0x36a43a(_0x431f1a[_0x9788('0x17')][_0x9788('0x19')]);}logger['error'](_0x9788('0x12'),_0x280c51,_0x431f1a[_0x9788('0x17')][_0x9788('0x19')]);return _0x1a2337(_0x431f1a[_0x9788('0x17')]['message']);}else{logger[_0x9788('0x11')](_0x9788('0x12'),_0x280c51,'request\x20sent');_0x1a2337(_0x431f1a[_0x9788('0x1a')][_0x9788('0x19')]);}})[_0x9788('0x1b')](function(_0x174b51){logger[_0x9788('0x17')](_0x9788('0x12'),_0x280c51,_0x174b51);_0x36a43a(_0x174b51);});});}exports[_0x9788('0x1c')]=function(_0x4156fa){var _0x154db7=this;return new Promise(function(_0x59f7d1,_0x53f55a){return db[_0x9788('0x1d')][_0x9788('0x1e')]({'raw':_0x4156fa[_0x9788('0x1f')]?_0x4156fa[_0x9788('0x1f')][_0x9788('0x20')]===undefined?!![]:![]:!![],'where':_0x4156fa['options']?_0x4156fa[_0x9788('0x1f')][_0x9788('0x21')]||null:null,'attributes':_0x4156fa['options']?_0x4156fa[_0x9788('0x1f')][_0x9788('0x22')]||null:null,'limit':_0x4156fa[_0x9788('0x1f')]?_0x4156fa[_0x9788('0x1f')][_0x9788('0x23')]||null:null,'include':_0x4156fa[_0x9788('0x1f')]?_0x4156fa[_0x9788('0x1f')][_0x9788('0x24')]?_[_0x9788('0x25')](_0x4156fa[_0x9788('0x1f')]['include'],function(_0x452933){return{'model':db[_0x452933['model']],'as':_0x452933['as'],'attributes':_0x452933[_0x9788('0x22')],'include':_0x452933[_0x9788('0x24')]?_[_0x9788('0x25')](_0x452933[_0x9788('0x24')],function(_0xf86f3d){return{'model':db[_0xf86f3d[_0x9788('0x26')]],'as':_0xf86f3d['as'],'attributes':_0xf86f3d['attributes'],'include':_0xf86f3d['include']?_[_0x9788('0x25')](_0xf86f3d['include'],function(_0x31a7f6){return{'model':db[_0x31a7f6['model']],'as':_0x31a7f6['as'],'attributes':_0x31a7f6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x480699){logger['info'](_0x9788('0x1c'),_0x4156fa);logger[_0x9788('0x14')]('GetVoiceQueueReport',_0x4156fa,JSON[_0x9788('0x16')](_0x480699));_0x59f7d1(_0x480699);})['catch'](function(_0x1f08d7){logger[_0x9788('0x17')](_0x9788('0x1c'),_0x1f08d7[_0x9788('0x19')],_0x4156fa);_0x53f55a(_0x154db7[_0x9788('0x17')](0x1f4,_0x1f08d7['message']));});});};exports[_0x9788('0x27')]=function(_0x1ebdcf){var _0x147b9f=this;return new Promise(function(_0x13365a,_0x4c3e5b){return db[_0x9788('0x1d')][_0x9788('0x28')](_0x1ebdcf['body'],{'raw':_0x1ebdcf['options']?_0x1ebdcf['options'][_0x9788('0x20')]===undefined?!![]:![]:!![]})[_0x9788('0x10')](function(_0x340ccf){logger[_0x9788('0x11')](_0x9788('0x27'),_0x1ebdcf);logger[_0x9788('0x14')](_0x9788('0x27'),_0x1ebdcf,JSON[_0x9788('0x16')](_0x340ccf));_0x13365a(_0x340ccf);})[_0x9788('0x1b')](function(_0x1d0014){logger[_0x9788('0x17')](_0x9788('0x27'),_0x1d0014[_0x9788('0x19')],_0x1ebdcf);_0x4c3e5b(_0x147b9f[_0x9788('0x17')](0x1f4,_0x1d0014[_0x9788('0x19')]));});});};exports[_0x9788('0x29')]=function(_0x21f9a1){var _0x52dd99=this;return new Promise(function(_0x498d6b,_0x4e388f){return db[_0x9788('0x1d')]['update'](_0x21f9a1['body'],{'raw':_0x21f9a1[_0x9788('0x1f')]?_0x21f9a1[_0x9788('0x1f')][_0x9788('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21f9a1[_0x9788('0x1f')]?_0x21f9a1['options'][_0x9788('0x21')]||null:null,'attributes':_0x21f9a1[_0x9788('0x1f')]?_0x21f9a1['options'][_0x9788('0x22')]||null:null,'limit':_0x21f9a1[_0x9788('0x1f')]?_0x21f9a1[_0x9788('0x1f')][_0x9788('0x23')]||null:null})['then'](function(_0x4f77b4){logger[_0x9788('0x11')](_0x9788('0x29'),_0x21f9a1);logger[_0x9788('0x14')](_0x9788('0x29'),_0x21f9a1,JSON[_0x9788('0x16')](_0x4f77b4));_0x498d6b(_0x4f77b4);})[_0x9788('0x1b')](function(_0x603d39){logger[_0x9788('0x17')](_0x9788('0x29'),_0x603d39['message'],_0x21f9a1);_0x4e388f(_0x52dd99[_0x9788('0x17')](0x1f4,_0x603d39[_0x9788('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 8b900f2..7c2322a 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 _0x3c6d=['emit','removeListener','length','./voiceQueueReport.events','save','remove','update'];(function(_0x3df3c3,_0x50b2fa){var _0x11bdbc=function(_0x28b8bc){while(--_0x28b8bc){_0x3df3c3['push'](_0x3df3c3['shift']());}};_0x11bdbc(++_0x50b2fa);}(_0x3c6d,0x199));var _0xd3c6=function(_0x155397,_0x9556ec){_0x155397=_0x155397-0x0;var _0x11a875=_0x3c6d[_0x155397];return _0x11a875;};'use strict';var VoiceQueueReportEvents=require(_0xd3c6('0x0'));var events=[_0xd3c6('0x1'),_0xd3c6('0x2'),_0xd3c6('0x3')];function createListener(_0x51b1ab,_0x464c32){return function(_0x1dd364){_0x464c32[_0xd3c6('0x4')](_0x51b1ab,_0x1dd364);};}function removeListener(_0x28b706,_0x26c5b9){return function(){VoiceQueueReportEvents[_0xd3c6('0x5')](_0x28b706,_0x26c5b9);};}exports['register']=function(_0x11fb61){for(var _0xe7c405=0x0,_0x438b25=events[_0xd3c6('0x6')];_0xe7c405<_0x438b25;_0xe7c405++){var _0x341f8a=events[_0xe7c405];var _0x15a1c9=createListener('voiceQueueReport:'+_0x341f8a,_0x11fb61);VoiceQueueReportEvents['on'](_0x341f8a,_0x15a1c9);}}; \ No newline at end of file +var _0xcb26=['voiceQueueReport:','./voiceQueueReport.events','save','remove','emit','removeListener','register'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xcb26,0xf6));var _0x6cb2=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xcb26[_0x25e7cb];return _0x375d92;};'use strict';var VoiceQueueReportEvents=require(_0x6cb2('0x0'));var events=[_0x6cb2('0x1'),_0x6cb2('0x2'),'update'];function createListener(_0x4c8f3f,_0x22d166){return function(_0x4ab881){_0x22d166[_0x6cb2('0x3')](_0x4c8f3f,_0x4ab881);};}function removeListener(_0x1d4b25,_0x530bda){return function(){VoiceQueueReportEvents[_0x6cb2('0x4')](_0x1d4b25,_0x530bda);};}exports[_0x6cb2('0x5')]=function(_0x5a8a7d){for(var _0x4d486b=0x0,_0x446656=events['length'];_0x4d486b<_0x446656;_0x4d486b++){var _0x42c7d6=events[_0x4d486b];var _0x456916=createListener(_0x6cb2('0x6')+_0x42c7d6,_0x5a8a7d);VoiceQueueReportEvents['on'](_0x42c7d6,_0x456916);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 1d46e46..238f89f 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 _0x5f1e=['./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','put','update','delete','/:id','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x5f1e,0x71));var _0xe5f1=function(_0x46a95a,_0x11a34d){_0x46a95a=_0x46a95a-0x0;var _0x46ad35=_0x5f1e[_0x46a95a];return _0x46ad35;};'use strict';var multer=require('multer');var util=require(_0xe5f1('0x0'));var path=require(_0xe5f1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe5f1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe5f1('0x3'));var interaction=require(_0xe5f1('0x4'));var config=require(_0xe5f1('0x5'));var controller=require(_0xe5f1('0x6'));router[_0xe5f1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xe5f1('0x8')](),controller[_0xe5f1('0x9')]);router[_0xe5f1('0xa')]('/',auth['isAuthenticated'](),controller[_0xe5f1('0xb')]);router[_0xe5f1('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xe5f1('0xd')]);router[_0xe5f1('0xe')](_0xe5f1('0xf'),auth[_0xe5f1('0x8')](),controller['destroy']);module[_0xe5f1('0x10')]=router; \ No newline at end of file +var _0xb8b2=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceQueuesLog.controller','index','isAuthenticated','show','post','create','/:id','update'];(function(_0xc7eeae,_0x8e483d){var _0x3a05ed=function(_0x5e4b21){while(--_0x5e4b21){_0xc7eeae['push'](_0xc7eeae['shift']());}};_0x3a05ed(++_0x8e483d);}(_0xb8b2,0xb7));var _0x2b8b=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xb8b2[_0x521929];return _0x632436;};'use strict';var multer=require(_0x2b8b('0x0'));var util=require(_0x2b8b('0x1'));var path=require(_0x2b8b('0x2'));var timeout=require(_0x2b8b('0x3'));var express=require(_0x2b8b('0x4'));var router=express[_0x2b8b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2b8b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2b8b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2b8b('0x8')]);router['get']('/:id',auth[_0x2b8b('0x9')](),controller[_0x2b8b('0xa')]);router[_0x2b8b('0xb')]('/',auth['isAuthenticated'](),controller[_0x2b8b('0xc')]);router['put'](_0x2b8b('0xd'),auth[_0x2b8b('0x9')](),controller[_0x2b8b('0xe')]);router[_0x2b8b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2b8b('0x10')]);module[_0x2b8b('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index f0338c4..ca7e630 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 _0x57fd=['STRING','DATE','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57fd,0xe6));var _0xd57f=function(_0x15c3b9,_0x50102c){_0x15c3b9=_0x15c3b9-0x0;var _0x2de741=_0x57fd[_0x15c3b9];return _0x2de741;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd57f('0x0'));module[_0xd57f('0x1')]={'time':{'type':Sequelize[_0xd57f('0x2')]},'callid':{'type':Sequelize[_0xd57f('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd57f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd57f('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd57f('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd57f('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd57f('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd57f('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x1ffe=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x19e917,_0x23a6d7){var _0x3b5ee8=function(_0x35ab8b){while(--_0x35ab8b){_0x19e917['push'](_0x19e917['shift']());}};_0x3b5ee8(++_0x23a6d7);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x83e7b3,_0x4689a1){_0x83e7b3=_0x83e7b3-0x0;var _0x297049=_0x1ffe[_0x83e7b3];return _0x297049;};'use strict';var Sequelize=require(_0xe1ff('0x0'));var moment=require(_0xe1ff('0x1'));module[_0xe1ff('0x2')]={'time':{'type':Sequelize[_0xe1ff('0x3')]},'callid':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe1ff('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe1ff('0x4')],'allowNull':![],'defaultValue':moment()[_0xe1ff('0x5')](_0xe1ff('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index bcdd4c8..505bc32 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 _0xcaf6=['undefined','limit','count','set','reject','save','update','then','error','stack','name','send','index','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','include','findAll','catch','params','rawAttributes','length','options','create','body','find','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0xcaf6,0x72));var _0x6caf=function(_0x33e93d,_0x1a8423){_0x33e93d=_0x33e93d-0x0;var _0x19e99d=_0xcaf6[_0x33e93d];return _0x19e99d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6caf('0x0'));var jsonpatch=require(_0x6caf('0x1'));var rp=require('request-promise');var moment=require(_0x6caf('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6caf('0x3'));var util=require(_0x6caf('0x4'));var path=require(_0x6caf('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6caf('0x6'));var fs=require('fs');var fs_extra=require(_0x6caf('0x7'));var _=require(_0x6caf('0x8'));var squel=require(_0x6caf('0x9'));var crypto=require(_0x6caf('0xa'));var jsforce=require(_0x6caf('0xb'));var deskjs=require(_0x6caf('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6caf('0xd'));var Papa=require(_0x6caf('0xe'));var Redis=require(_0x6caf('0xf'));var authService=require(_0x6caf('0x10'));var qs=require(_0x6caf('0x11'));var as=require(_0x6caf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6caf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6caf('0x14'));var licenseUtil=require(_0x6caf('0x15'));var db=require(_0x6caf('0x16'))['db'];function respondWithStatusCode(_0x186628,_0x4309fb){_0x4309fb=_0x4309fb||0xcc;return function(_0x4808ac){if(_0x4808ac){return _0x186628[_0x6caf('0x17')](_0x4309fb);}return _0x186628[_0x6caf('0x18')](_0x4309fb)[_0x6caf('0x19')]();};}function respondWithResult(_0xa3a10e,_0x2f6aff){_0x2f6aff=_0x2f6aff||0xc8;return function(_0x275018){if(_0x275018){return _0xa3a10e[_0x6caf('0x18')](_0x2f6aff)[_0x6caf('0x1a')](_0x275018);}};}function respondWithFilteredResult(_0x53fbc1,_0x3f6893){return function(_0x2de8d1){if(_0x2de8d1){var _0x45cfdb=typeof _0x3f6893[_0x6caf('0x1b')]===_0x6caf('0x1c')&&typeof _0x3f6893[_0x6caf('0x1d')]===_0x6caf('0x1c');var _0x5d722c=_0x2de8d1[_0x6caf('0x1e')];var _0x4d2b21=_0x45cfdb?0x0:_0x3f6893['offset'];var _0x461b3b=_0x45cfdb?_0x2de8d1[_0x6caf('0x1e')]:_0x3f6893[_0x6caf('0x1b')]+_0x3f6893['limit'];var _0x4e5998;if(_0x461b3b>=_0x5d722c){_0x461b3b=_0x5d722c;_0x4e5998=0xc8;}else{_0x4e5998=0xce;}_0x53fbc1['status'](_0x4e5998);return _0x53fbc1[_0x6caf('0x1f')]('Content-Range',_0x4d2b21+'-'+_0x461b3b+'/'+_0x5d722c)[_0x6caf('0x1a')](_0x2de8d1);}return null;};}function patchUpdates(_0x10167f){return function(_0x462e83){try{jsonpatch['apply'](_0x462e83,_0x10167f,!![]);}catch(_0x28b9d5){return BPromise[_0x6caf('0x20')](_0x28b9d5);}return _0x462e83[_0x6caf('0x21')]();};}function saveUpdates(_0x18abd8,_0x8dc2cd){return function(_0x1fcb1d){if(_0x1fcb1d){return _0x1fcb1d[_0x6caf('0x22')](_0x18abd8)['then'](function(_0x1bb5a5){return _0x1bb5a5;});}return null;};}function removeEntity(_0x4c2a61,_0x5d8713){return function(_0x263137){if(_0x263137){return _0x263137['destroy']()[_0x6caf('0x23')](function(){_0x4c2a61[_0x6caf('0x18')](0xcc)[_0x6caf('0x19')]();});}};}function handleEntityNotFound(_0x222a9f,_0x381ed8){return function(_0x2b98f6){if(!_0x2b98f6){_0x222a9f[_0x6caf('0x17')](0x194);}return _0x2b98f6;};}function handleError(_0x57fd84,_0x57a66c){_0x57a66c=_0x57a66c||0x1f4;return function(_0x35a4ea){logger[_0x6caf('0x24')](_0x35a4ea[_0x6caf('0x25')]);if(_0x35a4ea[_0x6caf('0x26')]){delete _0x35a4ea[_0x6caf('0x26')];}_0x57fd84[_0x6caf('0x18')](_0x57a66c)[_0x6caf('0x27')](_0x35a4ea);};}exports[_0x6caf('0x28')]=function(_0x24e5fb,_0x4848b4){var _0x1f73ba={},_0x3ded29={},_0x141be8={'count':0x0,'rows':[]};var _0x4814be=_['map'](db[_0x6caf('0x29')]['rawAttributes'],function(_0xb30a3a){return{'name':_0xb30a3a[_0x6caf('0x2a')],'type':_0xb30a3a[_0x6caf('0x2b')][_0x6caf('0x2c')]};});_0x3ded29[_0x6caf('0x2d')]=_['map'](_0x4814be,_0x6caf('0x26'));_0x3ded29[_0x6caf('0x2e')]=_[_0x6caf('0x2f')](_0x24e5fb[_0x6caf('0x2e')]);_0x3ded29[_0x6caf('0x30')]=_[_0x6caf('0x31')](_0x3ded29[_0x6caf('0x2d')],_0x3ded29['query']);_0x1f73ba[_0x6caf('0x32')]=_['intersection'](_0x3ded29[_0x6caf('0x2d')],qs[_0x6caf('0x33')](_0x24e5fb['query'][_0x6caf('0x33')]));_0x1f73ba[_0x6caf('0x32')]=_0x1f73ba[_0x6caf('0x32')]['length']?_0x1f73ba[_0x6caf('0x32')]:_0x3ded29[_0x6caf('0x2d')];if(!_0x24e5fb[_0x6caf('0x2e')]['hasOwnProperty'](_0x6caf('0x34'))){_0x1f73ba[_0x6caf('0x1d')]=qs[_0x6caf('0x1d')](_0x24e5fb[_0x6caf('0x2e')][_0x6caf('0x1d')]);_0x1f73ba[_0x6caf('0x1b')]=qs[_0x6caf('0x1b')](_0x24e5fb[_0x6caf('0x2e')]['offset']);}_0x1f73ba[_0x6caf('0x35')]=qs[_0x6caf('0x36')](_0x24e5fb[_0x6caf('0x2e')][_0x6caf('0x36')]);_0x1f73ba[_0x6caf('0x37')]=qs[_0x6caf('0x30')](_[_0x6caf('0x38')](_0x24e5fb['query'],_0x3ded29[_0x6caf('0x30')]),_0x4814be);if(_0x24e5fb[_0x6caf('0x2e')]['filter']){_0x1f73ba[_0x6caf('0x37')]=_['merge'](_0x1f73ba[_0x6caf('0x37')],{'$or':_[_0x6caf('0x39')](_0x4814be,function(_0x269db7){if(_0x269db7[_0x6caf('0x2b')]!==_0x6caf('0x3a')){var _0x516ae6={};_0x516ae6[_0x269db7['name']]={'$like':'%'+_0x24e5fb[_0x6caf('0x2e')][_0x6caf('0x3b')]+'%'};return _0x516ae6;}})});}_0x1f73ba=_[_0x6caf('0x3c')]({},_0x1f73ba,_0x24e5fb['options']);var _0x34e4cb={'where':_0x1f73ba[_0x6caf('0x37')]};return db[_0x6caf('0x29')][_0x6caf('0x1e')](_0x34e4cb)[_0x6caf('0x23')](function(_0x4e5c86){_0x141be8[_0x6caf('0x1e')]=_0x4e5c86;if(_0x24e5fb['query']['includeAll']){_0x1f73ba[_0x6caf('0x3d')]=[{'all':!![]}];}return db[_0x6caf('0x29')][_0x6caf('0x3e')](_0x1f73ba);})[_0x6caf('0x23')](function(_0x44c3a2){_0x141be8['rows']=_0x44c3a2;return _0x141be8;})[_0x6caf('0x23')](respondWithFilteredResult(_0x4848b4,_0x1f73ba))[_0x6caf('0x3f')](handleError(_0x4848b4,null));};exports['show']=function(_0x2b4952,_0x16a5de){var _0x2e2137={'raw':!![],'where':{'id':_0x2b4952[_0x6caf('0x40')]['id']}},_0x4c5953={};_0x4c5953[_0x6caf('0x2d')]=_[_0x6caf('0x2f')](db[_0x6caf('0x29')][_0x6caf('0x41')]);_0x4c5953[_0x6caf('0x2e')]=_[_0x6caf('0x2f')](_0x2b4952[_0x6caf('0x2e')]);_0x4c5953[_0x6caf('0x30')]=_[_0x6caf('0x31')](_0x4c5953['model'],_0x4c5953[_0x6caf('0x2e')]);_0x2e2137['attributes']=_[_0x6caf('0x31')](_0x4c5953[_0x6caf('0x2d')],qs[_0x6caf('0x33')](_0x2b4952[_0x6caf('0x2e')][_0x6caf('0x33')]));_0x2e2137['attributes']=_0x2e2137[_0x6caf('0x32')][_0x6caf('0x42')]?_0x2e2137[_0x6caf('0x32')]:_0x4c5953[_0x6caf('0x2d')];if(_0x2b4952[_0x6caf('0x2e')]['includeAll']){_0x2e2137['include']=[{'all':!![]}];}_0x2e2137=_[_0x6caf('0x3c')]({},_0x2e2137,_0x2b4952[_0x6caf('0x43')]);return db[_0x6caf('0x29')]['find'](_0x2e2137)[_0x6caf('0x23')](handleEntityNotFound(_0x16a5de,null))[_0x6caf('0x23')](respondWithResult(_0x16a5de,null))['catch'](handleError(_0x16a5de,null));};exports[_0x6caf('0x44')]=function(_0x14b030,_0x1fe395){return db[_0x6caf('0x29')][_0x6caf('0x44')](_0x14b030[_0x6caf('0x45')],{})[_0x6caf('0x23')](respondWithResult(_0x1fe395,0xc9))[_0x6caf('0x3f')](handleError(_0x1fe395,null));};exports[_0x6caf('0x22')]=function(_0x3beaf1,_0x526b83){if(_0x3beaf1[_0x6caf('0x45')]['id']){delete _0x3beaf1[_0x6caf('0x45')]['id'];}return db[_0x6caf('0x29')][_0x6caf('0x46')]({'where':{'id':_0x3beaf1[_0x6caf('0x40')]['id']}})[_0x6caf('0x23')](handleEntityNotFound(_0x526b83,null))[_0x6caf('0x23')](saveUpdates(_0x3beaf1[_0x6caf('0x45')],null))['then'](respondWithResult(_0x526b83,null))[_0x6caf('0x3f')](handleError(_0x526b83,null));};exports['destroy']=function(_0xd190bb,_0x11ba03){return db[_0x6caf('0x29')][_0x6caf('0x46')]({'where':{'id':_0xd190bb[_0x6caf('0x40')]['id']}})[_0x6caf('0x23')](handleEntityNotFound(_0x11ba03,null))[_0x6caf('0x23')](removeEntity(_0x11ba03,null))[_0x6caf('0x3f')](handleError(_0x11ba03,null));}; \ No newline at end of file +var _0x4079=['includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','length','sort','filter','where','merge','options','include','findAll','rows','catch','show','params'];(function(_0x5eb90e,_0x5e3f9b){var _0x21322e=function(_0x23a140){while(--_0x23a140){_0x5eb90e['push'](_0x5eb90e['shift']());}};_0x21322e(++_0x5e3f9b);}(_0x4079,0x124));var _0x9407=function(_0x339f01,_0x462e1b){_0x339f01=_0x339f01-0x0;var _0x898dac=_0x4079[_0x339f01];return _0x898dac;};'use strict';var emlformat=require(_0x9407('0x0'));var rimraf=require(_0x9407('0x1'));var zipdir=require(_0x9407('0x2'));var jsonpatch=require(_0x9407('0x3'));var rp=require(_0x9407('0x4'));var moment=require('moment');var BPromise=require(_0x9407('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9407('0x6'));var sox=require(_0x9407('0x7'));var csv=require(_0x9407('0x8'));var ejs=require(_0x9407('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9407('0xa'));var squel=require(_0x9407('0xb'));var crypto=require(_0x9407('0xc'));var jsforce=require(_0x9407('0xd'));var deskjs=require(_0x9407('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9407('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9407('0x10'));var qs=require(_0x9407('0x11'));var as=require(_0x9407('0x12'));var hardwareService=require(_0x9407('0x13'));var logger=require(_0x9407('0x14'))(_0x9407('0x15'));var utils=require(_0x9407('0x16'));var config=require(_0x9407('0x17'));var licenseUtil=require(_0x9407('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26fad4,_0x29d3b7){_0x29d3b7=_0x29d3b7||0xcc;return function(_0x5ab6a2){if(_0x5ab6a2){return _0x26fad4['sendStatus'](_0x29d3b7);}return _0x26fad4[_0x9407('0x19')](_0x29d3b7)[_0x9407('0x1a')]();};}function respondWithResult(_0x3f066e,_0x497eb9){_0x497eb9=_0x497eb9||0xc8;return function(_0x1b0029){if(_0x1b0029){return _0x3f066e[_0x9407('0x19')](_0x497eb9)['json'](_0x1b0029);}};}function respondWithFilteredResult(_0x49a207,_0x5afcaa){return function(_0x692d83){if(_0x692d83){var _0x470619=typeof _0x5afcaa[_0x9407('0x1b')]==='undefined'&&typeof _0x5afcaa[_0x9407('0x1c')]===_0x9407('0x1d');var _0x4c2168=_0x692d83['count'];var _0x49e100=_0x470619?0x0:_0x5afcaa[_0x9407('0x1b')];var _0xcacc9=_0x470619?_0x692d83[_0x9407('0x1e')]:_0x5afcaa[_0x9407('0x1b')]+_0x5afcaa[_0x9407('0x1c')];var _0x437bd3;if(_0xcacc9>=_0x4c2168){_0xcacc9=_0x4c2168;_0x437bd3=0xc8;}else{_0x437bd3=0xce;}_0x49a207[_0x9407('0x19')](_0x437bd3);return _0x49a207[_0x9407('0x1f')](_0x9407('0x20'),_0x49e100+'-'+_0xcacc9+'/'+_0x4c2168)[_0x9407('0x21')](_0x692d83);}return null;};}function patchUpdates(_0x1754c9){return function(_0x2a6fc0){try{jsonpatch[_0x9407('0x22')](_0x2a6fc0,_0x1754c9,!![]);}catch(_0x518ee7){return BPromise['reject'](_0x518ee7);}return _0x2a6fc0[_0x9407('0x23')]();};}function saveUpdates(_0x13c0ba,_0x33916c){return function(_0x177972){if(_0x177972){return _0x177972[_0x9407('0x24')](_0x13c0ba)[_0x9407('0x25')](function(_0x138e07){return _0x138e07;});}return null;};}function removeEntity(_0xe873ea,_0x4926cf){return function(_0x2b1406){if(_0x2b1406){return _0x2b1406[_0x9407('0x26')]()[_0x9407('0x25')](function(){_0xe873ea['status'](0xcc)[_0x9407('0x1a')]();});}};}function handleEntityNotFound(_0x1f513a,_0x2bec03){return function(_0x4de623){if(!_0x4de623){_0x1f513a[_0x9407('0x27')](0x194);}return _0x4de623;};}function handleError(_0x4c88de,_0x48ce75){_0x48ce75=_0x48ce75||0x1f4;return function(_0x190ade){logger[_0x9407('0x28')](_0x190ade[_0x9407('0x29')]);if(_0x190ade[_0x9407('0x2a')]){delete _0x190ade[_0x9407('0x2a')];}_0x4c88de[_0x9407('0x19')](_0x48ce75)[_0x9407('0x2b')](_0x190ade);};}exports['index']=function(_0x3d19cd,_0x3faf7e){var _0x4af6c7={},_0x590883={},_0x3f1e46={'count':0x0,'rows':[]};var _0x1363b1=_[_0x9407('0x2c')](db[_0x9407('0x2d')][_0x9407('0x2e')],function(_0x56e811){return{'name':_0x56e811['fieldName'],'type':_0x56e811[_0x9407('0x2f')][_0x9407('0x30')]};});_0x590883[_0x9407('0x31')]=_[_0x9407('0x2c')](_0x1363b1,_0x9407('0x2a'));_0x590883['query']=_[_0x9407('0x32')](_0x3d19cd['query']);_0x590883[_0x9407('0x33')]=_[_0x9407('0x34')](_0x590883[_0x9407('0x31')],_0x590883['query']);_0x4af6c7[_0x9407('0x35')]=_[_0x9407('0x34')](_0x590883[_0x9407('0x31')],qs[_0x9407('0x36')](_0x3d19cd[_0x9407('0x37')][_0x9407('0x36')]));_0x4af6c7['attributes']=_0x4af6c7['attributes'][_0x9407('0x38')]?_0x4af6c7[_0x9407('0x35')]:_0x590883[_0x9407('0x31')];if(!_0x3d19cd[_0x9407('0x37')]['hasOwnProperty']('nolimit')){_0x4af6c7[_0x9407('0x1c')]=qs[_0x9407('0x1c')](_0x3d19cd[_0x9407('0x37')][_0x9407('0x1c')]);_0x4af6c7['offset']=qs[_0x9407('0x1b')](_0x3d19cd['query']['offset']);}_0x4af6c7['order']=qs[_0x9407('0x39')](_0x3d19cd['query'][_0x9407('0x39')]);_0x4af6c7['where']=qs[_0x9407('0x33')](_['pick'](_0x3d19cd['query'],_0x590883['filters']),_0x1363b1);if(_0x3d19cd[_0x9407('0x37')][_0x9407('0x3a')]){_0x4af6c7[_0x9407('0x3b')]=_['merge'](_0x4af6c7[_0x9407('0x3b')],{'$or':_[_0x9407('0x2c')](_0x1363b1,function(_0x39846a){if(_0x39846a[_0x9407('0x2f')]!=='VIRTUAL'){var _0x1382c6={};_0x1382c6[_0x39846a[_0x9407('0x2a')]]={'$like':'%'+_0x3d19cd[_0x9407('0x37')][_0x9407('0x3a')]+'%'};return _0x1382c6;}})});}_0x4af6c7=_[_0x9407('0x3c')]({},_0x4af6c7,_0x3d19cd[_0x9407('0x3d')]);var _0x186d6e={'where':_0x4af6c7[_0x9407('0x3b')]};return db[_0x9407('0x2d')][_0x9407('0x1e')](_0x186d6e)[_0x9407('0x25')](function(_0x18d1e4){_0x3f1e46[_0x9407('0x1e')]=_0x18d1e4;if(_0x3d19cd[_0x9407('0x37')]['includeAll']){_0x4af6c7[_0x9407('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x9407('0x3f')](_0x4af6c7);})[_0x9407('0x25')](function(_0x5cb356){_0x3f1e46[_0x9407('0x40')]=_0x5cb356;return _0x3f1e46;})[_0x9407('0x25')](respondWithFilteredResult(_0x3faf7e,_0x4af6c7))[_0x9407('0x41')](handleError(_0x3faf7e,null));};exports[_0x9407('0x42')]=function(_0x209889,_0x408d15){var _0xeb46b={'raw':!![],'where':{'id':_0x209889[_0x9407('0x43')]['id']}},_0x218db0={};_0x218db0[_0x9407('0x31')]=_[_0x9407('0x32')](db[_0x9407('0x2d')][_0x9407('0x2e')]);_0x218db0['query']=_[_0x9407('0x32')](_0x209889[_0x9407('0x37')]);_0x218db0[_0x9407('0x33')]=_[_0x9407('0x34')](_0x218db0[_0x9407('0x31')],_0x218db0['query']);_0xeb46b[_0x9407('0x35')]=_[_0x9407('0x34')](_0x218db0[_0x9407('0x31')],qs['fields'](_0x209889[_0x9407('0x37')][_0x9407('0x36')]));_0xeb46b[_0x9407('0x35')]=_0xeb46b[_0x9407('0x35')][_0x9407('0x38')]?_0xeb46b['attributes']:_0x218db0[_0x9407('0x31')];if(_0x209889[_0x9407('0x37')][_0x9407('0x44')]){_0xeb46b['include']=[{'all':!![]}];}_0xeb46b=_[_0x9407('0x3c')]({},_0xeb46b,_0x209889[_0x9407('0x3d')]);return db[_0x9407('0x2d')]['find'](_0xeb46b)['then'](handleEntityNotFound(_0x408d15,null))[_0x9407('0x25')](respondWithResult(_0x408d15,null))[_0x9407('0x41')](handleError(_0x408d15,null));};exports[_0x9407('0x45')]=function(_0x35f4a7,_0x44c62a){return db['VoiceQueuesLog']['create'](_0x35f4a7[_0x9407('0x46')],{})[_0x9407('0x25')](respondWithResult(_0x44c62a,0xc9))['catch'](handleError(_0x44c62a,null));};exports[_0x9407('0x24')]=function(_0x476cb4,_0x16d020){if(_0x476cb4[_0x9407('0x46')]['id']){delete _0x476cb4[_0x9407('0x46')]['id'];}return db[_0x9407('0x2d')][_0x9407('0x47')]({'where':{'id':_0x476cb4['params']['id']}})[_0x9407('0x25')](handleEntityNotFound(_0x16d020,null))[_0x9407('0x25')](saveUpdates(_0x476cb4['body'],null))[_0x9407('0x25')](respondWithResult(_0x16d020,null))[_0x9407('0x41')](handleError(_0x16d020,null));};exports['destroy']=function(_0x47c120,_0x225d02){return db[_0x9407('0x2d')][_0x9407('0x47')]({'where':{'id':_0x47c120[_0x9407('0x43')]['id']}})[_0x9407('0x25')](handleEntityNotFound(_0x225d02,null))[_0x9407('0x25')](removeEntity(_0x225d02,null))[_0x9407('0x41')](handleError(_0x225d02,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e24f21a..6fb60e8 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 _0xb91d=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','../../config/logger','api'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0xb91d,0x129));var _0xdb91=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xb91d[_0x32e649];return _0x14d386;};'use strict';var _=require(_0xdb91('0x0'));var util=require('util');var logger=require(_0xdb91('0x1'))(_0xdb91('0x2'));var moment=require(_0xdb91('0x3'));var BPromise=require(_0xdb91('0x4'));var rp=require(_0xdb91('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb91('0x6'));var config=require(_0xdb91('0x7'));var attributes=require(_0xdb91('0x8'));module[_0xdb91('0x9')]=function(_0x35605d,_0x5c890d){return _0x35605d[_0xdb91('0xa')](_0xdb91('0xb'),attributes,{'tableName':_0xdb91('0xc'),'paranoid':![],'indexes':[{'name':_0xdb91('0xd'),'fields':[_0xdb91('0xe'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xa227=['exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./voiceQueuesLog.attributes'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa227,0x18b));var _0x7a22=function(_0x4922c2,_0x5b2702){_0x4922c2=_0x4922c2-0x0;var _0x3a265b=_0xa227[_0x4922c2];return _0x3a265b;};'use strict';var _=require(_0x7a22('0x0'));var util=require(_0x7a22('0x1'));var logger=require(_0x7a22('0x2'))(_0x7a22('0x3'));var moment=require(_0x7a22('0x4'));var BPromise=require('bluebird');var rp=require(_0x7a22('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a22('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a22('0x7'));module[_0x7a22('0x8')]=function(_0x5e940c,_0x33b4a1){return _0x5e940c[_0x7a22('0x9')](_0x7a22('0xa'),attributes,{'tableName':_0x7a22('0xb'),'paranoid':![],'indexes':[{'name':_0x7a22('0xc'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c97fe6c..70d0e67 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 _0x73b3=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x73b3,0x183));var _0x373b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x73b3[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x373b('0x0'));var util=require(_0x373b('0x1'));var moment=require(_0x373b('0x2'));var BPromise=require(_0x373b('0x3'));var rs=require(_0x373b('0x4'));var fs=require('fs');var Redis=require(_0x373b('0x5'));var db=require(_0x373b('0x6'))['db'];var utils=require(_0x373b('0x7'));var logger=require(_0x373b('0x8'))(_0x373b('0x9'));var config=require(_0x373b('0xa'));var jayson=require(_0x373b('0xb'));var client=jayson['client'][_0x373b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x375e12,_0x321a18,_0x29dad2){return new BPromise(function(_0x19ddb1,_0x2af216){return client[_0x373b('0xd')](_0x375e12,_0x29dad2)[_0x373b('0xe')](function(_0x2d277b){logger[_0x373b('0xf')](_0x373b('0x10'),_0x321a18,_0x373b('0x11'));logger[_0x373b('0x12')](_0x373b('0x13'),_0x321a18,_0x373b('0x11'),JSON[_0x373b('0x14')](_0x2d277b));if(_0x2d277b[_0x373b('0x15')]){if(_0x2d277b[_0x373b('0x15')][_0x373b('0x16')]===0x1f4){logger[_0x373b('0x15')](_0x373b('0x10'),_0x321a18,_0x2d277b[_0x373b('0x15')][_0x373b('0x17')]);return _0x2af216(_0x2d277b['error']['message']);}logger[_0x373b('0x15')](_0x373b('0x10'),_0x321a18,_0x2d277b[_0x373b('0x15')][_0x373b('0x17')]);return _0x19ddb1(_0x2d277b[_0x373b('0x15')]['message']);}else{logger[_0x373b('0xf')](_0x373b('0x10'),_0x321a18,_0x373b('0x11'));_0x19ddb1(_0x2d277b[_0x373b('0x18')][_0x373b('0x17')]);}})['catch'](function(_0x2bec6b){logger[_0x373b('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0x321a18,_0x2bec6b);_0x2af216(_0x2bec6b);});});} \ No newline at end of file +var _0x1eaa=['debug','error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x202b32,_0x392624){var _0x29dc27=function(_0x32cb01){while(--_0x32cb01){_0x202b32['push'](_0x202b32['shift']());}};_0x29dc27(++_0x392624);}(_0x1eaa,0x1c7));var _0xa1ea=function(_0x416748,_0x1a5df4){_0x416748=_0x416748-0x0;var _0x1429dc=_0x1eaa[_0x416748];return _0x1429dc;};'use strict';var _=require(_0xa1ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa1ea('0x1'));var rs=require(_0xa1ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1ea('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa1ea('0x4'));var config=require(_0xa1ea('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa1ea('0x6')][_0xa1ea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xceca77,_0x543c44,_0x38bfd5){return new BPromise(function(_0x58e238,_0x4b04bd){return client[_0xa1ea('0x8')](_0xceca77,_0x38bfd5)[_0xa1ea('0x9')](function(_0x47005d){logger[_0xa1ea('0xa')](_0xa1ea('0xb'),_0x543c44,_0xa1ea('0xc'));logger[_0xa1ea('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x543c44,_0xa1ea('0xc'),JSON['stringify'](_0x47005d));if(_0x47005d['error']){if(_0x47005d[_0xa1ea('0xe')]['code']===0x1f4){logger[_0xa1ea('0xe')](_0xa1ea('0xb'),_0x543c44,_0x47005d[_0xa1ea('0xe')][_0xa1ea('0xf')]);return _0x4b04bd(_0x47005d[_0xa1ea('0xe')][_0xa1ea('0xf')]);}logger[_0xa1ea('0xe')](_0xa1ea('0xb'),_0x543c44,_0x47005d['error'][_0xa1ea('0xf')]);return _0x58e238(_0x47005d[_0xa1ea('0xe')]['message']);}else{logger[_0xa1ea('0xa')](_0xa1ea('0xb'),_0x543c44,_0xa1ea('0xc'));_0x58e238(_0x47005d[_0xa1ea('0x10')][_0xa1ea('0xf')]);}})[_0xa1ea('0x11')](function(_0x4e9c12){logger['error'](_0xa1ea('0xb'),_0x543c44,_0x4e9c12);_0x4b04bd(_0x4e9c12);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 23119d2..da24be0 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 _0x1d82=['get','isAuthenticated','index','/describe','describe','/:id','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1d82,0x1e5));var _0x21d8=function(_0x11ddff,_0x5200f1){_0x11ddff=_0x11ddff-0x0;var _0x13977e=_0x1d82[_0x11ddff];return _0x13977e;};'use strict';var multer=require(_0x21d8('0x0'));var util=require(_0x21d8('0x1'));var path=require(_0x21d8('0x2'));var timeout=require('connect-timeout');var express=require(_0x21d8('0x3'));var router=express[_0x21d8('0x4')]();var fs_extra=require(_0x21d8('0x5'));var auth=require(_0x21d8('0x6'));var interaction=require(_0x21d8('0x7'));var config=require('../../config/environment');var controller=require(_0x21d8('0x8'));router[_0x21d8('0x9')]('/',auth[_0x21d8('0xa')](),controller[_0x21d8('0xb')]);router[_0x21d8('0x9')](_0x21d8('0xc'),auth[_0x21d8('0xa')](),controller[_0x21d8('0xd')]);router[_0x21d8('0x9')](_0x21d8('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x21d8('0x9')](_0x21d8('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x21d8('0x9')](_0x21d8('0x10'),controller[_0x21d8('0x11')]);router['get'](_0x21d8('0x12'),auth[_0x21d8('0xa')](),controller['downloadTranscribe']);router[_0x21d8('0x13')]('/',auth[_0x21d8('0xa')](),controller[_0x21d8('0x14')]);router[_0x21d8('0x13')](_0x21d8('0x12'),auth[_0x21d8('0xa')](),controller[_0x21d8('0x15')]);router[_0x21d8('0x16')]('/:id',auth[_0x21d8('0xa')](),controller[_0x21d8('0x17')]);router[_0x21d8('0x18')]('/:id',auth[_0x21d8('0xa')](),controller[_0x21d8('0x19')]);module['exports']=router; \ No newline at end of file +var _0x8ba0=['./voiceRecording.controller','get','isAuthenticated','/:id','show','download','/:id/downloads','downloads','downloadTranscribe','post','/:id/transcribe','put','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service'];(function(_0x46f526,_0xc2616c){var _0x5c0eb3=function(_0x8ef5b7){while(--_0x8ef5b7){_0x46f526['push'](_0x46f526['shift']());}};_0x5c0eb3(++_0xc2616c);}(_0x8ba0,0xf3));var _0x08ba=function(_0x20fd1b,_0x1d4d79){_0x20fd1b=_0x20fd1b-0x0;var _0xa6a593=_0x8ba0[_0x20fd1b];return _0xa6a593;};'use strict';var multer=require(_0x08ba('0x0'));var util=require('util');var path=require(_0x08ba('0x1'));var timeout=require(_0x08ba('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x08ba('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x08ba('0x4'));router[_0x08ba('0x5')]('/',auth[_0x08ba('0x6')](),controller['index']);router[_0x08ba('0x5')]('/describe',auth[_0x08ba('0x6')](),controller['describe']);router[_0x08ba('0x5')](_0x08ba('0x7'),auth[_0x08ba('0x6')](),controller[_0x08ba('0x8')]);router['get']('/:id/download',auth[_0x08ba('0x6')](),controller[_0x08ba('0x9')]);router[_0x08ba('0x5')](_0x08ba('0xa'),controller[_0x08ba('0xb')]);router[_0x08ba('0x5')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x08ba('0xc')]);router['post']('/',auth[_0x08ba('0x6')](),controller['create']);router[_0x08ba('0xd')](_0x08ba('0xe'),auth[_0x08ba('0x6')](),controller['runTranscribe']);router[_0x08ba('0xf')](_0x08ba('0x7'),auth[_0x08ba('0x6')](),controller['update']);router[_0x08ba('0x10')](_0x08ba('0x7'),auth[_0x08ba('0x6')](),controller[_0x08ba('0x11')]);module[_0x08ba('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 4bf3d03..5b808ef 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(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 c8686e4..6bb94eb 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 _0xb84a=['updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','set','Content-Range','json','apply','reject','update','destroy','then','error','name','index','VoiceRecording','rawAttributes','type','key','model','differenceBy','map','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','../../components/encryptor','uniqueid','value','secrets','recording','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','download','unlink','message','send','Not\x20found','downloads','sequelize','token','$and','push','decryptFile','Sequelize','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[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','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','transcribe','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','transcribeRegion','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment'];(function(_0xc482c6,_0x58067b){var _0x33f144=function(_0x4fa681){while(--_0x4fa681){_0xc482c6['push'](_0xc482c6['shift']());}};_0x33f144(++_0x58067b);}(_0xb84a,0x9e));var _0xab84=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb84a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab84('0x0'));var zipdir=require(_0xab84('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab84('0x2'));var moment=require(_0xab84('0x3'));var BPromise=require(_0xab84('0x4'));var Mustache=require(_0xab84('0x5'));var util=require(_0xab84('0x6'));var path=require(_0xab84('0x7'));var sox=require(_0xab84('0x8'));var csv=require('to-csv');var ejs=require(_0xab84('0x9'));var fs=require('fs');var fs_extra=require(_0xab84('0xa'));var _=require(_0xab84('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab84('0xc'));var deskjs=require(_0xab84('0xd'));var toCsv=require('to-csv');var querystring=require(_0xab84('0xe'));var Papa=require('papaparse');var AWS=require(_0xab84('0xf'));var uuidv4=require(_0xab84('0x10'));var Redis=require('ioredis');var authService=require(_0xab84('0x11'));var qs=require(_0xab84('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab84('0x13'));var logger=require(_0xab84('0x14'))('api');var utils=require(_0xab84('0x15'));var config=require(_0xab84('0x16'));var licenseUtil=require(_0xab84('0x17'));var db=require(_0xab84('0x18'))['db'];function respondWithStatusCode(_0x1655c8,_0x379ba){_0x379ba=_0x379ba||0xcc;return function(_0x17fe6c){if(_0x17fe6c){return _0x1655c8[_0xab84('0x19')](_0x379ba);}return _0x1655c8['status'](_0x379ba)[_0xab84('0x1a')]();};}function respondWithResult(_0x3aae60,_0x210146){_0x210146=_0x210146||0xc8;return function(_0x241342){if(_0x241342){return _0x3aae60['status'](_0x210146)['json'](_0x241342);}};}function respondWithFilteredResult(_0x477d9e,_0x416eea){return function(_0x156c54){if(_0x156c54){var _0x37dfbb=typeof _0x416eea[_0xab84('0x1b')]==='undefined'&&typeof _0x416eea[_0xab84('0x1c')]==='undefined';var _0x51a519=_0x156c54[_0xab84('0x1d')];var _0x3a6076=_0x37dfbb?0x0:_0x416eea[_0xab84('0x1b')];var _0x41f2e3=_0x37dfbb?_0x156c54['count']:_0x416eea[_0xab84('0x1b')]+_0x416eea[_0xab84('0x1c')];var _0x6ef28f;if(_0x41f2e3>=_0x51a519){_0x41f2e3=_0x51a519;_0x6ef28f=0xc8;}else{_0x6ef28f=0xce;}_0x477d9e[_0xab84('0x1e')](_0x6ef28f);return _0x477d9e[_0xab84('0x1f')](_0xab84('0x20'),_0x3a6076+'-'+_0x41f2e3+'/'+_0x51a519)[_0xab84('0x21')](_0x156c54);}return null;};}function patchUpdates(_0x5aa103){return function(_0x1bd428){try{jsonpatch[_0xab84('0x22')](_0x1bd428,_0x5aa103,!![]);}catch(_0x2ea3ef){return BPromise[_0xab84('0x23')](_0x2ea3ef);}return _0x1bd428['save']();};}function saveUpdates(_0x410808,_0x3792ae){return function(_0x52a288){if(_0x52a288){return _0x52a288[_0xab84('0x24')](_0x410808)['then'](function(_0x39f225){return _0x39f225;});}return null;};}function removeEntity(_0x2e520a,_0x1b6067){return function(_0x5f053b){if(_0x5f053b){return _0x5f053b[_0xab84('0x25')]()[_0xab84('0x26')](function(){_0x2e520a[_0xab84('0x1e')](0xcc)[_0xab84('0x1a')]();});}};}function handleEntityNotFound(_0x355ad7,_0x20cac6){return function(_0x208623){if(!_0x208623){_0x355ad7[_0xab84('0x19')](0x194);}return _0x208623;};}function handleError(_0x30421,_0x105339){_0x105339=_0x105339||0x1f4;return function(_0x57d72c){logger[_0xab84('0x27')](_0x57d72c['stack']);if(_0x57d72c[_0xab84('0x28')]){delete _0x57d72c[_0xab84('0x28')];}_0x30421[_0xab84('0x1e')](_0x105339)['send'](_0x57d72c);};}exports[_0xab84('0x29')]=function(_0x2338a5,_0x335a7f){var _0x32c99a={},_0x414d1b={},_0x140bab={'count':0x0,'rows':[]};var _0x3374fc=_['map'](db[_0xab84('0x2a')][_0xab84('0x2b')],function(_0xe3bb38){return{'name':_0xe3bb38['fieldName'],'type':_0xe3bb38[_0xab84('0x2c')][_0xab84('0x2d')]};});_0x414d1b[_0xab84('0x2e')]=_[_0xab84('0x2f')](_[_0xab84('0x30')](_0x3374fc,_0xab84('0x28')),[_0xab84('0x31')]);_0x414d1b[_0xab84('0x32')]=_[_0xab84('0x33')](_0x2338a5['query']);_0x414d1b[_0xab84('0x34')]=_[_0xab84('0x35')](_0x414d1b[_0xab84('0x2e')],_0x414d1b[_0xab84('0x32')]);_0x32c99a[_0xab84('0x36')]=_[_0xab84('0x35')](_0x414d1b['model'],qs[_0xab84('0x37')](_0x2338a5[_0xab84('0x32')]['fields']));_0x32c99a[_0xab84('0x36')]=_0x32c99a[_0xab84('0x36')][_0xab84('0x38')]?_0x32c99a[_0xab84('0x36')]:_0x414d1b[_0xab84('0x2e')];if(!_0x2338a5[_0xab84('0x32')][_0xab84('0x39')](_0xab84('0x3a'))){_0x32c99a[_0xab84('0x1c')]=qs[_0xab84('0x1c')](_0x2338a5[_0xab84('0x32')][_0xab84('0x1c')]);_0x32c99a[_0xab84('0x1b')]=qs[_0xab84('0x1b')](_0x2338a5[_0xab84('0x32')][_0xab84('0x1b')]);}_0x32c99a[_0xab84('0x3b')]=qs[_0xab84('0x3c')](_0x2338a5[_0xab84('0x32')][_0xab84('0x3c')]);_0x32c99a['where']=qs['filters'](_[_0xab84('0x3d')](_0x2338a5['query'],_0x414d1b[_0xab84('0x34')]),_0x3374fc);if(_0x2338a5[_0xab84('0x32')][_0xab84('0x3e')]){_0x32c99a[_0xab84('0x3f')]=_['merge'](_0x32c99a[_0xab84('0x3f')],{'$or':_[_0xab84('0x30')](_0x3374fc,function(_0x1bbb81){if(_0x1bbb81[_0xab84('0x2c')]!==_0xab84('0x40')){var _0x56a9b7={};_0x56a9b7[_0x1bbb81[_0xab84('0x28')]]={'$like':'%'+_0x2338a5[_0xab84('0x32')]['filter']+'%'};return _0x56a9b7;}})});}_0x32c99a=_[_0xab84('0x41')]({},_0x32c99a,_0x2338a5[_0xab84('0x42')]);var _0x59878a={'where':_0x32c99a[_0xab84('0x3f')]};return db[_0xab84('0x2a')]['count'](_0x59878a)[_0xab84('0x26')](function(_0x43adfd){_0x140bab[_0xab84('0x1d')]=_0x43adfd;if(_0x2338a5[_0xab84('0x32')][_0xab84('0x43')]){_0x32c99a[_0xab84('0x44')]=[{'all':!![]}];}return db[_0xab84('0x2a')][_0xab84('0x45')](_0x32c99a);})[_0xab84('0x26')](function(_0x42568d){_0x140bab[_0xab84('0x46')]=_0x42568d;return _0x140bab;})[_0xab84('0x26')](respondWithFilteredResult(_0x335a7f,_0x32c99a))[_0xab84('0x47')](handleError(_0x335a7f,null));};exports['show']=function(_0x2de9cd,_0x5edf6a){var _0x180b54={'raw':![],'where':{'id':_0x2de9cd['params']['id']}},_0x4ee097={};_0x4ee097[_0xab84('0x2e')]=_[_0xab84('0x33')](db[_0xab84('0x2a')][_0xab84('0x2b')]);_0x4ee097[_0xab84('0x32')]=_[_0xab84('0x33')](_0x2de9cd[_0xab84('0x32')]);_0x4ee097[_0xab84('0x34')]=_[_0xab84('0x35')](_0x4ee097[_0xab84('0x2e')],_0x4ee097[_0xab84('0x32')]);_0x180b54['attributes']=_['intersection'](_0x4ee097['model'],qs[_0xab84('0x37')](_0x2de9cd[_0xab84('0x32')]['fields']));_0x180b54[_0xab84('0x36')]=_0x180b54['attributes'][_0xab84('0x38')]?_0x180b54[_0xab84('0x36')]:_0x4ee097['model'];if(_0x2de9cd['query'][_0xab84('0x43')]){_0x180b54['include']=[{'all':!![]}];}_0x180b54=_[_0xab84('0x41')]({},_0x180b54,_0x2de9cd[_0xab84('0x42')]);return db[_0xab84('0x2a')][_0xab84('0x48')](_0x180b54)[_0xab84('0x26')](handleEntityNotFound(_0x5edf6a,null))[_0xab84('0x26')](respondWithResult(_0x5edf6a,null))[_0xab84('0x47')](handleError(_0x5edf6a,null));};exports['create']=function(_0x5b7bba,_0x4d9afc){return db[_0xab84('0x2a')][_0xab84('0x49')](_0x5b7bba['body'],{})[_0xab84('0x26')](respondWithResult(_0x4d9afc,0xc9))[_0xab84('0x47')](handleError(_0x4d9afc,null));};exports[_0xab84('0x24')]=function(_0x148838,_0x4673e6){if(_0x148838[_0xab84('0x4a')]['id']){delete _0x148838[_0xab84('0x4a')]['id'];}return db[_0xab84('0x2a')][_0xab84('0x48')]({'where':{'id':_0x148838[_0xab84('0x4b')]['id']}})[_0xab84('0x26')](handleEntityNotFound(_0x4673e6,null))[_0xab84('0x26')](saveUpdates(_0x148838[_0xab84('0x4a')],null))[_0xab84('0x26')](respondWithResult(_0x4673e6,null))[_0xab84('0x47')](handleError(_0x4673e6,null));};exports[_0xab84('0x4c')]=function(_0x553d84,_0x5e3253){return db[_0xab84('0x2a')][_0xab84('0x4c')]()['then'](respondWithResult(_0x5e3253,null))['catch'](handleError(_0x5e3253,null));};exports['download']=function(_0x59148a,_0x5102b7,_0x4823f3){var _0x12eeb4=require(_0xab84('0x4d'));var _0x59e1b3=![];var _0x52cd41={};if(_0x59148a[_0xab84('0x32')][_0xab84('0x2c')]&&_0x59148a[_0xab84('0x32')][_0xab84('0x2c')]===_0xab84('0x4e')){_0x52cd41[_0xab84('0x4e')]=_0x59148a[_0xab84('0x4b')]['id'];}else{_0x52cd41['id']=_0x59148a[_0xab84('0x4b')]['id'];}return db[_0xab84('0x2a')][_0xab84('0x48')]({'where':_0x52cd41,'attributes':['id',_0xab84('0x4f')],'raw':!![]})[_0xab84('0x26')](handleEntityNotFound(_0x5102b7,null))['then'](function(_0x3fe831){if(_0x3fe831){var _0x2c333f=_0x3fe831['value'];var _0x5ada1d=util[_0xab84('0x31')]('%s.cypher',_0x2c333f);if(fs['existsSync'](_0x5ada1d)){_0x59e1b3=!![];return _0x12eeb4['decryptFile'](_0x5ada1d,_0x2c333f,config[_0xab84('0x50')][_0xab84('0x51')])['then'](function(){return _0x3fe831;});}return _0x3fe831;}})[_0xab84('0x26')](function(_0x54494d){if(_0x54494d){var _0x4508cb=_0x54494d[_0xab84('0x4f')];if(!fs[_0xab84('0x52')](_0x4508cb)){throw new db['Sequelize'][(_0xab84('0x53'))](_0xab84('0x54'));}if(_0x54494d[_0xab84('0x55')]){return _0x5102b7[_0xab84('0x56')](_0x4508cb,_0x54494d['filename']+path['extname'](_0x4508cb),function(){if(_0x59e1b3){fs[_0xab84('0x57')](_0x4508cb);}});}else{return _0x5102b7[_0xab84('0x56')](_0x4508cb,function(_0x25e0c4){if(_0x59e1b3){fs[_0xab84('0x57')](_0x4508cb);}});}}})[_0xab84('0x47')](function(_0x336b1d){if(_0x336b1d[_0xab84('0x58')]===_0xab84('0x54')){_0x5102b7[_0xab84('0x1e')](0x194)[_0xab84('0x59')](_0xab84('0x5a'));}else{return handleError(_0x5102b7,null);}});};exports[_0xab84('0x5b')]=function(_0x3f93a5,_0x20ac47,_0x565d84){var _0x247b3a=require(_0xab84('0x4d'));var _0x171e4f=![];var _0x356b29={'$and':[db[_0xab84('0x5c')][_0xab84('0x3f')](db['sequelize']['fn']('MD5',db[_0xab84('0x5c')]['col'](_0xab84('0x4e'))),_0x3f93a5['query'][_0xab84('0x5d')])]};if(_0x3f93a5[_0xab84('0x32')][_0xab84('0x2c')]&&_0x3f93a5[_0xab84('0x32')]['type']===_0xab84('0x4e')){_0x356b29[_0xab84('0x5e')][_0xab84('0x5f')]({'uniqueid':_0x3f93a5['params']['id']});}else{_0x356b29[_0xab84('0x5e')][_0xab84('0x5f')]({'id':_0x3f93a5['params']['id']});}return db[_0xab84('0x2a')][_0xab84('0x48')]({'where':_0x356b29,'attributes':['id',_0xab84('0x4f')],'raw':!![]})[_0xab84('0x26')](handleEntityNotFound(_0x20ac47,null))['then'](function(_0x489f7c){if(_0x489f7c){var _0x465d16=util['format']('%s.cypher',_0x489f7c[_0xab84('0x4f')]);if(fs[_0xab84('0x52')](_0x465d16)){_0x171e4f=!![];return _0x247b3a[_0xab84('0x60')](_0x465d16,_0x489f7c[_0xab84('0x4f')],config[_0xab84('0x50')][_0xab84('0x51')])['then'](function(){return _0x489f7c;});}return _0x489f7c;}})[_0xab84('0x26')](function(_0x107113){if(_0x107113){if(!fs[_0xab84('0x52')](_0x107113[_0xab84('0x4f')])){throw new db[(_0xab84('0x61'))][(_0xab84('0x53'))](_0xab84('0x54'));}if(_0x107113[_0xab84('0x55')]){return _0x20ac47[_0xab84('0x56')](_0x107113[_0xab84('0x4f')],_0x107113['filename']+path[_0xab84('0x62')](_0x107113[_0xab84('0x4f')]),function(){if(_0x171e4f){fs['unlink'](_0x107113[_0xab84('0x4f')]);}});}else{return _0x20ac47[_0xab84('0x56')](_0x107113['value'],function(_0x320a91){if(_0x171e4f){fs[_0xab84('0x57')](_0x107113[_0xab84('0x4f')]);}});}}})[_0xab84('0x47')](handleError(_0x20ac47,null));};exports[_0xab84('0x25')]=function(_0x58197a,_0xf8bf36){return db[_0xab84('0x2a')][_0xab84('0x48')]({'where':{'id':_0x58197a['params']['id']}})['then'](function(_0x1d8f9b){if(_[_0xab84('0x63')](_0x1d8f9b)){throw new ReferenceError(_0xab84('0x64'));}return _0x1d8f9b;})[_0xab84('0x26')](function(_0x379cd0){var _0x4a3b21=_0x379cd0[_0xab84('0x4f')];logger[_0xab84('0x65')](_0xab84('0x66'),_0x4a3b21);if(!_[_0xab84('0x63')](_0x379cd0[_0xab84('0x4f')])&&fs[_0xab84('0x52')](_0x4a3b21)){logger[_0xab84('0x65')](_0xab84('0x67')+_0x4a3b21+_0xab84('0x68'));fs[_0xab84('0x69')](_0x4a3b21);}_0x4a3b21=_0x4a3b21+_0xab84('0x6a');if(!_[_0xab84('0x63')](_0x379cd0[_0xab84('0x4f')])&&fs[_0xab84('0x52')](_0x4a3b21)){logger[_0xab84('0x65')]('File:\x20\x22'+_0x4a3b21+_0xab84('0x68'));fs[_0xab84('0x69')](_0x4a3b21);}return _0x379cd0;})[_0xab84('0x26')](function(_0x34c94b){if(!_0x34c94b)throw new InternalError();return _0x34c94b[_0xab84('0x25')]();})[_0xab84('0x26')](function(){_0xf8bf36[_0xab84('0x1e')](0xcc)[_0xab84('0x1a')]();})[_0xab84('0x47')](handleError(_0xf8bf36,null));};function getBucketslist(_0x5556de,_0x4315cc,_0x1c96db){return new Promise(function(_0x5e3d64,_0xdbe040){var _0x368bdd=new AWS['S3']({'accessKeyId':_0x4315cc,'secretAccessKey':_0x5556de,'region':_0x1c96db});_0x368bdd[_0xab84('0x6b')]({},function(_0xaf83de,_0x240330){if(_0xaf83de){return _0xdbe040(_0xaf83de);}else{return _0x5e3d64(_0x240330);}});});}function createBucket(_0x3d368d,_0x5d0579,_0xfcda9c,_0x55f035){return new Promise(function(_0x2a68dc,_0x313fd7){var _0x587af5=new AWS['S3']({'accessKeyId':_0x5d0579,'secretAccessKey':_0x3d368d,'region':_0xfcda9c});_0x587af5[_0xab84('0x6c')]({'Bucket':_0x55f035},function(_0x522a02,_0x5423b2){if(_0x522a02){return _0x313fd7(_0x522a02);}else{return _0x2a68dc(_0x5423b2);}});});}function uploadFile(_0x38f98d,_0x15dd14,_0x2b95c5,_0x5375c6,_0x159afc,_0x1df1d2){return new Promise(function(_0x4120c2,_0x2ba14d){var _0xb5e098=new AWS['S3']({'accessKeyId':_0x15dd14,'secretAccessKey':_0x38f98d,'region':_0x2b95c5});_0xb5e098[_0xab84('0x6d')]({'Bucket':_0x5375c6,'Key':_0x159afc,'Body':_0x1df1d2},function(_0x1321bb,_0x3f2e64){if(_0x1321bb){return _0x2ba14d(_0x1321bb);}else{return _0x4120c2(_0x3f2e64);}});});}function startTranscribe(_0x52882b,_0x134fc8,_0x2b1156,_0x3ce6da,_0x38fafe,_0x18e8f2){return new Promise(function(_0x3acfb5,_0x2277ef){var _0x23be7e=new AWS[(_0xab84('0x6e'))]({'accessKeyId':_0x134fc8,'secretAccessKey':_0x52882b,'region':_0x2b1156});_0x23be7e[_0xab84('0x6f')]({'TranscriptionJobName':_0x3ce6da,'LanguageCode':_0x38fafe,'Media':{'MediaFileUri':_0x18e8f2}},function(_0xfa5d40,_0x5c23da){if(_0xfa5d40){return _0x2277ef(_0xfa5d40);}else{return _0x3acfb5(_0x5c23da);}});});}function transcribe(_0x4ed2ef,_0x12a7e3,_0x5cc5aa,_0x28a58d,_0x176018,_0x27aa94,_0x5dcda7){return new Promise(function(_0x1b51c5,_0x3bbc05){var _0x40e833={};logger['info'](util['format'](_0xab84('0x70'),_0x4ed2ef,_0x176018));return uploadFile(_0x12a7e3,_0x5cc5aa,_0x28a58d,_0x176018,path[_0xab84('0x71')](_0x27aa94),fs[_0xab84('0x72')](_0x27aa94))[_0xab84('0x26')](function(_0x556684){logger[_0xab84('0x65')](util[_0xab84('0x31')](_0xab84('0x73'),_0x4ed2ef,_0x176018,_0x556684[_0xab84('0x74')]));_0x40e833['bucket']=_0x556684[_0xab84('0x75')];_0x40e833['location']=_0x556684[_0xab84('0x74')];logger[_0xab84('0x65')](util[_0xab84('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x4ed2ef));return startTranscribe(_0x12a7e3,_0x5cc5aa,_0x28a58d,uuidv4(),_0x5dcda7,_0x556684[_0xab84('0x74')]);})[_0xab84('0x26')](function(_0x3e7628){logger[_0xab84('0x65')](util[_0xab84('0x31')](_0xab84('0x76'),_0x4ed2ef,_0x3e7628[_0xab84('0x77')][_0xab84('0x78')]));_0x40e833[_0xab84('0x79')]=_0x3e7628['TranscriptionJob']['TranscriptionJobName'];_0x40e833[_0xab84('0x7a')]=_0x3e7628[_0xab84('0x77')][_0xab84('0x7b')];return _0x1b51c5(_0x40e833);})['catch'](function(_0x43118d){return _0x3bbc05(_0x43118d);});});}exports['runTranscribe']=function(_0x30fa3b,_0x44609e,_0x48e373){var _0xd75667;var _0x552571;var _0x36b0b6;var _0x223106=require(_0xab84('0x4d'));return db['VoiceRecording']['findOne']({'where':{'id':_0x30fa3b[_0xab84('0x4b')]['id']}})[_0xab84('0x26')](function(_0x29a824){if(_0x29a824){var _0x35c437=util[_0xab84('0x31')]('%s.cypher',_0x29a824[_0xab84('0x4f')]);if(fs[_0xab84('0x52')](_0x35c437)){cypher=!![];return _0x223106[_0xab84('0x60')](_0x35c437,_0x29a824[_0xab84('0x4f')],config[_0xab84('0x50')][_0xab84('0x51')])[_0xab84('0x26')](function(){return _0x29a824;});}return _0x29a824;}})[_0xab84('0x26')](function(_0x5ec4d4){if(!_0x5ec4d4){throw new db[(_0xab84('0x61'))][(_0xab84('0x53'))]('Voice\x20Recording\x20not\x20found');}_0x552571=_0x5ec4d4;return db['Setting'][_0xab84('0x7c')]({'where':{'id':0x1}});})[_0xab84('0x26')](handleEntityNotFound(_0x44609e,null))[_0xab84('0x26')](function(_0x38d971){if(_0x38d971){_0xd75667=_0x38d971;if(!_0xd75667[_0xab84('0x7d')]||!_0xd75667['transcribeAccountId']||!_0xd75667['transcribeRegion']||!_0xd75667[_0xab84('0x7e')]||!_0xd75667[_0xab84('0x7f')]){throw new db[(_0xab84('0x61'))][(_0xab84('0x53'))](_0xab84('0x80'));}if(_0x30fa3b[_0xab84('0x4a')][_0xab84('0x81')]&&(!_0xd75667[_0xab84('0x82')]||!_0xd75667[_0xab84('0x83')]||!_0xd75667[_0xab84('0x84')]||!_0xd75667[_0xab84('0x7e')]||!_0xd75667['bucket'])){throw new db[(_0xab84('0x61'))]['ValidationError'](_0xab84('0x85'));}return db[_0xab84('0x86')][_0xab84('0x7c')]({'where':{'id':_0xd75667[_0xab84('0x87')]}});}})[_0xab84('0x26')](function(_0x3a6ecb){if(!_0x3a6ecb){throw new db[(_0xab84('0x61'))]['ValidationError'](_0xab84('0x88'));}if(!_0x3a6ecb[_0xab84('0x89')]||!_0x3a6ecb[_0xab84('0x8a')]){throw new db[(_0xab84('0x61'))]['ValidationError'](_0xab84('0x8b'));}_0x36b0b6=_0x3a6ecb;return getBucketslist(_0x36b0b6[_0xab84('0x89')],_0x36b0b6[_0xab84('0x8a')],_0xd75667['transcribeRegion']);})[_0xab84('0x26')](function(_0x4bee7a){if(_0x4bee7a&&_0x4bee7a[_0xab84('0x8c')]){var _0x34af4f=_[_0xab84('0x48')](_0x4bee7a[_0xab84('0x8c')],function(_0x1b1388){return _0x1b1388['Name']===_0xd75667[_0xab84('0x7f')];});if(!_0x34af4f){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x30fa3b['params']['id'],_0xd75667[_0xab84('0x7f')]));return createBucket(_0x36b0b6['data1'],_0x36b0b6['data2'],_0xd75667[_0xab84('0x8d')],_0xd75667[_0xab84('0x7f')]);}logger[_0xab84('0x65')](util[_0xab84('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x30fa3b[_0xab84('0x4b')]['id'],_0xd75667[_0xab84('0x7f')]));return;}})[_0xab84('0x26')](function(_0x2926e2){if(_0x552571['transcribeStatus']===_0xab84('0x8e')){return transcribe(_0x30fa3b[_0xab84('0x4b')]['id'],_0x36b0b6[_0xab84('0x89')],_0x36b0b6['data2'],_0xd75667[_0xab84('0x8d')],_0xd75667[_0xab84('0x7f')],_0x552571[_0xab84('0x4f')],_0xd75667[_0xab84('0x7e')]);}else{logger[_0xab84('0x65')](util[_0xab84('0x31')](_0xab84('0x8f'),_0x30fa3b[_0xab84('0x4b')]['id']));return{'transcribeStatus':_0xab84('0x90')};}})[_0xab84('0x26')](function(_0xf02378){if(_0xf02378){_0xf02378[_0xab84('0x91')]=_0x30fa3b['body'][_0xab84('0x81')];return _0x552571[_0xab84('0x92')](_0xf02378);}})[_0xab84('0x26')](respondWithResult(_0x44609e,null))[_0xab84('0x47')](handleError(_0x44609e,null));};function writeFile(_0x3bc78d,_0x479c56){return new Promise(function(_0x461257,_0x4c25a6){fs[_0xab84('0x93')](_0x479c56,_0x3bc78d,function(_0x42747e,_0x723963){if(_0x42747e){return _0x4c25a6(_0x42747e);}else{return _0x461257(_0x723963);}});});}exports['downloadTranscribe']=function(_0x3dc4bb,_0x19b6bf,_0x2ded87){return db[_0xab84('0x2a')]['findOne']({'where':{'id':_0x3dc4bb[_0xab84('0x4b')]['id']}})[_0xab84('0x26')](handleEntityNotFound(_0x19b6bf))['then'](function(_0x5084cb){if(_0x5084cb&&_0x5084cb['fileText']){var _0x487411=_0x5084cb[_0xab84('0x94')];var _0x25fdb5=config[_0xab84('0x95')]+'/server/files/transcribes/transcribe_'+_0x5084cb['id']+_0xab84('0x96');if(fs[_0xab84('0x52')](_0x25fdb5)){return _0x25fdb5;}return writeFile(_0x487411,_0x25fdb5)['then'](function(){return _0x25fdb5;});}else{throw new db[(_0xab84('0x61'))][(_0xab84('0x53'))](_0xab84('0x97'));}})['then'](function(_0x445723){return _0x19b6bf[_0xab84('0x56')](_0x445723);})[_0xab84('0x47')](handleError(_0x19b6bf));}; \ No newline at end of file +var _0x37b6=['runSentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','type','key','differenceBy','format','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','VoiceRecording','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','download','uniqueid','value','%s.cypher','decryptFile','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','sequelize','MD5','col','push','$and','secrets','recording','ValidationError','extname','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured'];(function(_0x3b885f,_0x265272){var _0x33d23e=function(_0x58c637){while(--_0x58c637){_0x3b885f['push'](_0x3b885f['shift']());}};_0x33d23e(++_0x265272);}(_0x37b6,0xab));var _0x637b=function(_0x34210b,_0x2792c7){_0x34210b=_0x34210b-0x0;var _0x50b411=_0x37b6[_0x34210b];return _0x50b411;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x637b('0x0'));var zipdir=require(_0x637b('0x1'));var jsonpatch=require(_0x637b('0x2'));var rp=require(_0x637b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x637b('0x4'));var util=require('util');var path=require(_0x637b('0x5'));var sox=require(_0x637b('0x6'));var csv=require('to-csv');var ejs=require(_0x637b('0x7'));var fs=require('fs');var fs_extra=require(_0x637b('0x8'));var _=require(_0x637b('0x9'));var squel=require(_0x637b('0xa'));var crypto=require(_0x637b('0xb'));var jsforce=require(_0x637b('0xc'));var deskjs=require(_0x637b('0xd'));var toCsv=require(_0x637b('0xe'));var querystring=require('querystring');var Papa=require(_0x637b('0xf'));var AWS=require('aws-sdk');var uuidv4=require(_0x637b('0x10'));var Redis=require(_0x637b('0x11'));var authService=require(_0x637b('0x12'));var qs=require(_0x637b('0x13'));var as=require(_0x637b('0x14'));var hardwareService=require(_0x637b('0x15'));var logger=require(_0x637b('0x16'))(_0x637b('0x17'));var utils=require(_0x637b('0x18'));var config=require(_0x637b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x637b('0x1a'))['db'];function respondWithStatusCode(_0x37bc8a,_0x476141){_0x476141=_0x476141||0xcc;return function(_0x5eae91){if(_0x5eae91){return _0x37bc8a[_0x637b('0x1b')](_0x476141);}return _0x37bc8a[_0x637b('0x1c')](_0x476141)[_0x637b('0x1d')]();};}function respondWithResult(_0x4eacb5,_0x32715c){_0x32715c=_0x32715c||0xc8;return function(_0x40cd5b){if(_0x40cd5b){return _0x4eacb5[_0x637b('0x1c')](_0x32715c)['json'](_0x40cd5b);}};}function respondWithFilteredResult(_0x94e2f0,_0x22ce06){return function(_0x1ae668){if(_0x1ae668){var _0x407f68=typeof _0x22ce06[_0x637b('0x1e')]==='undefined'&&typeof _0x22ce06[_0x637b('0x1f')]===_0x637b('0x20');var _0x2d37b4=_0x1ae668[_0x637b('0x21')];var _0x23a739=_0x407f68?0x0:_0x22ce06[_0x637b('0x1e')];var _0x58d68f=_0x407f68?_0x1ae668[_0x637b('0x21')]:_0x22ce06['offset']+_0x22ce06[_0x637b('0x1f')];var _0x461d6b;if(_0x58d68f>=_0x2d37b4){_0x58d68f=_0x2d37b4;_0x461d6b=0xc8;}else{_0x461d6b=0xce;}_0x94e2f0['status'](_0x461d6b);return _0x94e2f0[_0x637b('0x22')]('Content-Range',_0x23a739+'-'+_0x58d68f+'/'+_0x2d37b4)[_0x637b('0x23')](_0x1ae668);}return null;};}function patchUpdates(_0x40cead){return function(_0x35a61b){try{jsonpatch[_0x637b('0x24')](_0x35a61b,_0x40cead,!![]);}catch(_0xd981fe){return BPromise[_0x637b('0x25')](_0xd981fe);}return _0x35a61b[_0x637b('0x26')]();};}function saveUpdates(_0x381dfa,_0xc373e2){return function(_0x43a018){if(_0x43a018){return _0x43a018[_0x637b('0x27')](_0x381dfa)['then'](function(_0x39ef53){return _0x39ef53;});}return null;};}function removeEntity(_0x56083d,_0x3ad8ee){return function(_0x4e6c5f){if(_0x4e6c5f){return _0x4e6c5f[_0x637b('0x28')]()[_0x637b('0x29')](function(){_0x56083d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b99f,_0x5cf1f6){return function(_0x4c14a6){if(!_0x4c14a6){_0x55b99f[_0x637b('0x1b')](0x194);}return _0x4c14a6;};}function handleError(_0x14963d,_0x2c70a0){_0x2c70a0=_0x2c70a0||0x1f4;return function(_0xa927c1){logger['error'](_0xa927c1[_0x637b('0x2a')]);if(_0xa927c1[_0x637b('0x2b')]){delete _0xa927c1[_0x637b('0x2b')];}_0x14963d[_0x637b('0x1c')](_0x2c70a0)[_0x637b('0x2c')](_0xa927c1);};}exports[_0x637b('0x2d')]=function(_0x4d7d77,_0x1c8069){var _0xb92597={},_0x1fcb2c={},_0x5a1e99={'count':0x0,'rows':[]};var _0x410f20=_[_0x637b('0x2e')](db['VoiceRecording'][_0x637b('0x2f')],function(_0x440f81){return{'name':_0x440f81['fieldName'],'type':_0x440f81[_0x637b('0x30')][_0x637b('0x31')]};});_0x1fcb2c['model']=_[_0x637b('0x32')](_[_0x637b('0x2e')](_0x410f20,'name'),[_0x637b('0x33')]);_0x1fcb2c[_0x637b('0x34')]=_[_0x637b('0x35')](_0x4d7d77[_0x637b('0x34')]);_0x1fcb2c['filters']=_['intersection'](_0x1fcb2c[_0x637b('0x36')],_0x1fcb2c[_0x637b('0x34')]);_0xb92597[_0x637b('0x37')]=_[_0x637b('0x38')](_0x1fcb2c[_0x637b('0x36')],qs['fields'](_0x4d7d77['query'][_0x637b('0x39')]));_0xb92597[_0x637b('0x37')]=_0xb92597[_0x637b('0x37')][_0x637b('0x3a')]?_0xb92597['attributes']:_0x1fcb2c[_0x637b('0x36')];if(!_0x4d7d77[_0x637b('0x34')][_0x637b('0x3b')](_0x637b('0x3c'))){_0xb92597[_0x637b('0x1f')]=qs[_0x637b('0x1f')](_0x4d7d77[_0x637b('0x34')][_0x637b('0x1f')]);_0xb92597[_0x637b('0x1e')]=qs[_0x637b('0x1e')](_0x4d7d77[_0x637b('0x34')][_0x637b('0x1e')]);}_0xb92597['order']=qs[_0x637b('0x3d')](_0x4d7d77[_0x637b('0x34')][_0x637b('0x3d')]);_0xb92597[_0x637b('0x3e')]=qs[_0x637b('0x3f')](_[_0x637b('0x40')](_0x4d7d77[_0x637b('0x34')],_0x1fcb2c['filters']),_0x410f20);if(_0x4d7d77['query'][_0x637b('0x41')]){_0xb92597[_0x637b('0x3e')]=_[_0x637b('0x42')](_0xb92597[_0x637b('0x3e')],{'$or':_[_0x637b('0x2e')](_0x410f20,function(_0x5d28bf){if(_0x5d28bf[_0x637b('0x30')]!==_0x637b('0x43')){var _0xf2c843={};_0xf2c843[_0x5d28bf[_0x637b('0x2b')]]={'$like':'%'+_0x4d7d77[_0x637b('0x34')]['filter']+'%'};return _0xf2c843;}})});}_0xb92597=_[_0x637b('0x42')]({},_0xb92597,_0x4d7d77['options']);var _0x54b999={'where':_0xb92597[_0x637b('0x3e')]};return db[_0x637b('0x44')][_0x637b('0x21')](_0x54b999)['then'](function(_0x2e359c){_0x5a1e99[_0x637b('0x21')]=_0x2e359c;if(_0x4d7d77['query'][_0x637b('0x45')]){_0xb92597[_0x637b('0x46')]=[{'all':!![]}];}return db[_0x637b('0x44')][_0x637b('0x47')](_0xb92597);})[_0x637b('0x29')](function(_0x390f7b){_0x5a1e99[_0x637b('0x48')]=_0x390f7b;return _0x5a1e99;})[_0x637b('0x29')](respondWithFilteredResult(_0x1c8069,_0xb92597))[_0x637b('0x49')](handleError(_0x1c8069,null));};exports[_0x637b('0x4a')]=function(_0x4fccdd,_0x2ef40a){var _0x5e39c9={'raw':![],'where':{'id':_0x4fccdd[_0x637b('0x4b')]['id']}},_0x508b65={};_0x508b65[_0x637b('0x36')]=_[_0x637b('0x35')](db[_0x637b('0x44')][_0x637b('0x2f')]);_0x508b65[_0x637b('0x34')]=_[_0x637b('0x35')](_0x4fccdd[_0x637b('0x34')]);_0x508b65[_0x637b('0x3f')]=_['intersection'](_0x508b65[_0x637b('0x36')],_0x508b65[_0x637b('0x34')]);_0x5e39c9[_0x637b('0x37')]=_['intersection'](_0x508b65[_0x637b('0x36')],qs[_0x637b('0x39')](_0x4fccdd['query'][_0x637b('0x39')]));_0x5e39c9[_0x637b('0x37')]=_0x5e39c9[_0x637b('0x37')]['length']?_0x5e39c9['attributes']:_0x508b65[_0x637b('0x36')];if(_0x4fccdd['query'][_0x637b('0x45')]){_0x5e39c9[_0x637b('0x46')]=[{'all':!![]}];}_0x5e39c9=_['merge']({},_0x5e39c9,_0x4fccdd[_0x637b('0x4c')]);return db[_0x637b('0x44')][_0x637b('0x4d')](_0x5e39c9)[_0x637b('0x29')](handleEntityNotFound(_0x2ef40a,null))[_0x637b('0x29')](respondWithResult(_0x2ef40a,null))[_0x637b('0x49')](handleError(_0x2ef40a,null));};exports[_0x637b('0x4e')]=function(_0x4aae7c,_0x3ee60a){return db[_0x637b('0x44')][_0x637b('0x4e')](_0x4aae7c[_0x637b('0x4f')],{})[_0x637b('0x29')](respondWithResult(_0x3ee60a,0xc9))['catch'](handleError(_0x3ee60a,null));};exports['update']=function(_0x1c5f43,_0x53af38){if(_0x1c5f43[_0x637b('0x4f')]['id']){delete _0x1c5f43[_0x637b('0x4f')]['id'];}return db[_0x637b('0x44')][_0x637b('0x4d')]({'where':{'id':_0x1c5f43[_0x637b('0x4b')]['id']}})[_0x637b('0x29')](handleEntityNotFound(_0x53af38,null))['then'](saveUpdates(_0x1c5f43[_0x637b('0x4f')],null))[_0x637b('0x29')](respondWithResult(_0x53af38,null))[_0x637b('0x49')](handleError(_0x53af38,null));};exports[_0x637b('0x50')]=function(_0x323431,_0x40fc66){return db[_0x637b('0x44')]['describe']()[_0x637b('0x29')](respondWithResult(_0x40fc66,null))[_0x637b('0x49')](handleError(_0x40fc66,null));};exports[_0x637b('0x51')]=function(_0x5d11c8,_0x524a86,_0x756fa5){var _0x3a34dc=require('../../components/encryptor');var _0x306ce9=![];var _0x44d491={};if(_0x5d11c8[_0x637b('0x34')][_0x637b('0x30')]&&_0x5d11c8[_0x637b('0x34')][_0x637b('0x30')]===_0x637b('0x52')){_0x44d491['uniqueid']=_0x5d11c8['params']['id'];}else{_0x44d491['id']=_0x5d11c8[_0x637b('0x4b')]['id'];}return db[_0x637b('0x44')][_0x637b('0x4d')]({'where':_0x44d491,'attributes':['id',_0x637b('0x53')],'raw':!![]})[_0x637b('0x29')](handleEntityNotFound(_0x524a86,null))['then'](function(_0x461ebb){if(_0x461ebb){var _0x40549d=_0x461ebb[_0x637b('0x53')];var _0x57b90b=util[_0x637b('0x33')](_0x637b('0x54'),_0x40549d);if(fs['existsSync'](_0x57b90b)){_0x306ce9=!![];return _0x3a34dc[_0x637b('0x55')](_0x57b90b,_0x40549d,config['secrets']['recording'])[_0x637b('0x29')](function(){return _0x461ebb;});}return _0x461ebb;}})[_0x637b('0x29')](function(_0x27c96b){if(_0x27c96b){var _0x578aed=_0x27c96b[_0x637b('0x53')];if(!fs[_0x637b('0x56')](_0x578aed)){throw new db[(_0x637b('0x57'))]['ValidationError'](_0x637b('0x58'));}if(_0x27c96b[_0x637b('0x59')]){return _0x524a86[_0x637b('0x51')](_0x578aed,_0x27c96b[_0x637b('0x59')]+path['extname'](_0x578aed),function(){if(_0x306ce9){fs[_0x637b('0x5a')](_0x578aed);}});}else{return _0x524a86[_0x637b('0x51')](_0x578aed,function(_0x15494a){if(_0x306ce9){fs['unlink'](_0x578aed);}});}}})['catch'](function(_0x348428){if(_0x348428[_0x637b('0x5b')]===_0x637b('0x58')){_0x524a86[_0x637b('0x1c')](0x194)[_0x637b('0x2c')](_0x637b('0x5c'));}else{return handleError(_0x524a86,null);}});};exports['downloads']=function(_0x450390,_0x118929,_0x4fa304){var _0x463437=require('../../components/encryptor');var _0x15a345=![];var _0x422f25={'$and':[db[_0x637b('0x5d')][_0x637b('0x3e')](db[_0x637b('0x5d')]['fn'](_0x637b('0x5e'),db[_0x637b('0x5d')][_0x637b('0x5f')](_0x637b('0x52'))),_0x450390[_0x637b('0x34')]['token'])]};if(_0x450390[_0x637b('0x34')][_0x637b('0x30')]&&_0x450390[_0x637b('0x34')][_0x637b('0x30')]===_0x637b('0x52')){_0x422f25['$and'][_0x637b('0x60')]({'uniqueid':_0x450390[_0x637b('0x4b')]['id']});}else{_0x422f25[_0x637b('0x61')][_0x637b('0x60')]({'id':_0x450390[_0x637b('0x4b')]['id']});}return db['VoiceRecording'][_0x637b('0x4d')]({'where':_0x422f25,'attributes':['id',_0x637b('0x53')],'raw':!![]})[_0x637b('0x29')](handleEntityNotFound(_0x118929,null))['then'](function(_0x2269e0){if(_0x2269e0){var _0x5ed465=util[_0x637b('0x33')](_0x637b('0x54'),_0x2269e0[_0x637b('0x53')]);if(fs['existsSync'](_0x5ed465)){_0x15a345=!![];return _0x463437[_0x637b('0x55')](_0x5ed465,_0x2269e0[_0x637b('0x53')],config[_0x637b('0x62')][_0x637b('0x63')])[_0x637b('0x29')](function(){return _0x2269e0;});}return _0x2269e0;}})['then'](function(_0xd5ecd1){if(_0xd5ecd1){if(!fs[_0x637b('0x56')](_0xd5ecd1[_0x637b('0x53')])){throw new db['Sequelize'][(_0x637b('0x64'))](_0x637b('0x58'));}if(_0xd5ecd1[_0x637b('0x59')]){return _0x118929[_0x637b('0x51')](_0xd5ecd1[_0x637b('0x53')],_0xd5ecd1[_0x637b('0x59')]+path[_0x637b('0x65')](_0xd5ecd1['value']),function(){if(_0x15a345){fs['unlink'](_0xd5ecd1[_0x637b('0x53')]);}});}else{return _0x118929[_0x637b('0x51')](_0xd5ecd1[_0x637b('0x53')],function(_0x3cb030){if(_0x15a345){fs[_0x637b('0x5a')](_0xd5ecd1[_0x637b('0x53')]);}});}}})['catch'](handleError(_0x118929,null));};exports[_0x637b('0x28')]=function(_0x100466,_0x4cb5dc){return db[_0x637b('0x44')][_0x637b('0x4d')]({'where':{'id':_0x100466[_0x637b('0x4b')]['id']}})['then'](function(_0x41e161){if(_['isNil'](_0x41e161)){throw new ReferenceError('Entity\x20not\x20found');}return _0x41e161;})[_0x637b('0x29')](function(_0x21f719){var _0x4c4dfb=_0x21f719[_0x637b('0x53')];logger[_0x637b('0x66')](_0x637b('0x67'),_0x4c4dfb);if(!_[_0x637b('0x68')](_0x21f719[_0x637b('0x53')])&&fs[_0x637b('0x56')](_0x4c4dfb)){logger[_0x637b('0x66')](_0x637b('0x69')+_0x4c4dfb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x637b('0x6a')](_0x4c4dfb);}_0x4c4dfb=_0x4c4dfb+'.cypher';if(!_['isNil'](_0x21f719['value'])&&fs[_0x637b('0x56')](_0x4c4dfb)){logger[_0x637b('0x66')](_0x637b('0x69')+_0x4c4dfb+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4c4dfb);}return _0x21f719;})[_0x637b('0x29')](function(_0x1054a8){if(!_0x1054a8)throw new InternalError();return _0x1054a8[_0x637b('0x28')]();})['then'](function(){_0x4cb5dc['status'](0xcc)['end']();})[_0x637b('0x49')](handleError(_0x4cb5dc,null));};function getBucketslist(_0x76257b,_0x585bfe,_0x2f69dd){return new Promise(function(_0x4989b3,_0x2b6815){var _0x49e689=new AWS['S3']({'accessKeyId':_0x585bfe,'secretAccessKey':_0x76257b,'region':_0x2f69dd});_0x49e689['listBuckets']({},function(_0xbb578d,_0x47dbf2){if(_0xbb578d){return _0x2b6815(_0xbb578d);}else{return _0x4989b3(_0x47dbf2);}});});}function createBucket(_0x10e8f7,_0x5c3f2b,_0x29bf07,_0x32113d){return new Promise(function(_0x8b5fc3,_0x130b54){var _0x5aa993=new AWS['S3']({'accessKeyId':_0x5c3f2b,'secretAccessKey':_0x10e8f7,'region':_0x29bf07});_0x5aa993[_0x637b('0x6b')]({'Bucket':_0x32113d},function(_0xb3326,_0xe94b94){if(_0xb3326){return _0x130b54(_0xb3326);}else{return _0x8b5fc3(_0xe94b94);}});});}function uploadFile(_0x73ccd3,_0x2af95c,_0x332662,_0x123903,_0x5d5aea,_0x1ec491){return new Promise(function(_0x1a0db6,_0x2ea3c9){var _0x394317=new AWS['S3']({'accessKeyId':_0x2af95c,'secretAccessKey':_0x73ccd3,'region':_0x332662});_0x394317['upload']({'Bucket':_0x123903,'Key':_0x5d5aea,'Body':_0x1ec491},function(_0x4a58b3,_0x4379cc){if(_0x4a58b3){return _0x2ea3c9(_0x4a58b3);}else{return _0x1a0db6(_0x4379cc);}});});}function startTranscribe(_0x40745e,_0x12a069,_0x1e632c,_0x44a12a,_0x4df607,_0x5344a3){return new Promise(function(_0x165921,_0x104c38){var _0x42dd14=new AWS[(_0x637b('0x6c'))]({'accessKeyId':_0x12a069,'secretAccessKey':_0x40745e,'region':_0x1e632c});_0x42dd14[_0x637b('0x6d')]({'TranscriptionJobName':_0x44a12a,'LanguageCode':_0x4df607,'Media':{'MediaFileUri':_0x5344a3}},function(_0x3ee944,_0x1f69d8){if(_0x3ee944){return _0x104c38(_0x3ee944);}else{return _0x165921(_0x1f69d8);}});});}function transcribe(_0x441426,_0xf1b884,_0x1f9190,_0x5718fe,_0x262cae,_0x1ebc66,_0xff1d5d){return new Promise(function(_0x9dec27,_0x1a6090){var _0x227581={};logger[_0x637b('0x66')](util['format'](_0x637b('0x6e'),_0x441426,_0x262cae));return uploadFile(_0xf1b884,_0x1f9190,_0x5718fe,_0x262cae,path['basename'](_0x1ebc66),fs['readFileSync'](_0x1ebc66))[_0x637b('0x29')](function(_0x6c7233){logger[_0x637b('0x66')](util[_0x637b('0x33')](_0x637b('0x6f'),_0x441426,_0x262cae,_0x6c7233[_0x637b('0x70')]));_0x227581[_0x637b('0x71')]=_0x6c7233[_0x637b('0x72')];_0x227581['location']=_0x6c7233[_0x637b('0x70')];logger[_0x637b('0x66')](util[_0x637b('0x33')](_0x637b('0x73'),_0x441426));return startTranscribe(_0xf1b884,_0x1f9190,_0x5718fe,uuidv4(),_0xff1d5d,_0x6c7233[_0x637b('0x70')]);})[_0x637b('0x29')](function(_0x1114f8){logger[_0x637b('0x66')](util[_0x637b('0x33')](_0x637b('0x74'),_0x441426,_0x1114f8['TranscriptionJob'][_0x637b('0x75')]));_0x227581[_0x637b('0x76')]=_0x1114f8[_0x637b('0x77')][_0x637b('0x75')];_0x227581[_0x637b('0x78')]=_0x1114f8[_0x637b('0x77')][_0x637b('0x79')];return _0x9dec27(_0x227581);})[_0x637b('0x49')](function(_0x4e5d0e){return _0x1a6090(_0x4e5d0e);});});}exports[_0x637b('0x7a')]=function(_0x3072cd,_0x925dd1,_0x4c84b9){var _0x2a86f5;var _0x2ebd27;var _0x2bd9bc;var _0x1f7b37=require(_0x637b('0x7b'));return db[_0x637b('0x44')][_0x637b('0x7c')]({'where':{'id':_0x3072cd['params']['id']}})['then'](function(_0x54cf84){if(_0x54cf84){var _0x1e4e40=util[_0x637b('0x33')](_0x637b('0x54'),_0x54cf84['value']);if(fs[_0x637b('0x56')](_0x1e4e40)){cypher=!![];return _0x1f7b37['decryptFile'](_0x1e4e40,_0x54cf84[_0x637b('0x53')],config[_0x637b('0x62')]['recording'])[_0x637b('0x29')](function(){return _0x54cf84;});}return _0x54cf84;}})[_0x637b('0x29')](function(_0x5661ae){if(!_0x5661ae){throw new db['Sequelize'][(_0x637b('0x64'))]('Voice\x20Recording\x20not\x20found');}_0x2ebd27=_0x5661ae;return db[_0x637b('0x7d')][_0x637b('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x925dd1,null))[_0x637b('0x29')](function(_0x430a11){if(_0x430a11){_0x2a86f5=_0x430a11;if(!_0x2a86f5[_0x637b('0x7e')]||!_0x2a86f5[_0x637b('0x7f')]||!_0x2a86f5[_0x637b('0x80')]||!_0x2a86f5[_0x637b('0x81')]||!_0x2a86f5['bucket']){throw new db['Sequelize'][(_0x637b('0x64'))](_0x637b('0x82'));}if(_0x3072cd[_0x637b('0x4f')][_0x637b('0x83')]&&(!_0x2a86f5['sentiment']||!_0x2a86f5['sentimentAccountId']||!_0x2a86f5[_0x637b('0x84')]||!_0x2a86f5[_0x637b('0x81')]||!_0x2a86f5[_0x637b('0x71')])){throw new db[(_0x637b('0x57'))][(_0x637b('0x64'))](_0x637b('0x85'));}return db[_0x637b('0x86')]['findOne']({'where':{'id':_0x2a86f5[_0x637b('0x7f')]}});}})['then'](function(_0x412fad){if(!_0x412fad){throw new db[(_0x637b('0x57'))][(_0x637b('0x64'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x412fad[_0x637b('0x87')]||!_0x412fad[_0x637b('0x88')]){throw new db[(_0x637b('0x57'))][(_0x637b('0x64'))](_0x637b('0x89'));}_0x2bd9bc=_0x412fad;return getBucketslist(_0x2bd9bc[_0x637b('0x87')],_0x2bd9bc[_0x637b('0x88')],_0x2a86f5[_0x637b('0x80')]);})['then'](function(_0x15f383){if(_0x15f383&&_0x15f383['Buckets']){var _0x3ffd22=_[_0x637b('0x4d')](_0x15f383[_0x637b('0x8a')],function(_0x4b3bda){return _0x4b3bda[_0x637b('0x8b')]===_0x2a86f5[_0x637b('0x71')];});if(!_0x3ffd22){logger['info'](util[_0x637b('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x3072cd[_0x637b('0x4b')]['id'],_0x2a86f5[_0x637b('0x71')]));return createBucket(_0x2bd9bc['data1'],_0x2bd9bc[_0x637b('0x88')],_0x2a86f5[_0x637b('0x80')],_0x2a86f5[_0x637b('0x71')]);}logger['info'](util[_0x637b('0x33')](_0x637b('0x8c'),_0x3072cd[_0x637b('0x4b')]['id'],_0x2a86f5[_0x637b('0x71')]));return;}})[_0x637b('0x29')](function(_0xf73ff1){if(_0x2ebd27[_0x637b('0x78')]===_0x637b('0x8d')){return transcribe(_0x3072cd['params']['id'],_0x2bd9bc[_0x637b('0x87')],_0x2bd9bc[_0x637b('0x88')],_0x2a86f5[_0x637b('0x80')],_0x2a86f5['bucket'],_0x2ebd27[_0x637b('0x53')],_0x2a86f5[_0x637b('0x81')]);}else{logger['info'](util[_0x637b('0x33')](_0x637b('0x8e'),_0x3072cd[_0x637b('0x4b')]['id']));return{'transcribeStatus':_0x637b('0x8f')};}})[_0x637b('0x29')](function(_0x308f1e){if(_0x308f1e){_0x308f1e[_0x637b('0x90')]=_0x3072cd[_0x637b('0x4f')]['runSentiment'];return _0x2ebd27[_0x637b('0x91')](_0x308f1e);}})[_0x637b('0x29')](respondWithResult(_0x925dd1,null))[_0x637b('0x49')](handleError(_0x925dd1,null));};function writeFile(_0x4d1fe4,_0x18d2fd){return new Promise(function(_0x304066,_0x4e2d5){fs['writeFile'](_0x18d2fd,_0x4d1fe4,function(_0x3ab43b,_0x13e36f){if(_0x3ab43b){return _0x4e2d5(_0x3ab43b);}else{return _0x304066(_0x13e36f);}});});}exports['downloadTranscribe']=function(_0x126c37,_0x11de66,_0x24cc77){return db['VoiceRecording'][_0x637b('0x7c')]({'where':{'id':_0x126c37[_0x637b('0x4b')]['id']}})[_0x637b('0x29')](handleEntityNotFound(_0x11de66))['then'](function(_0x3f06a9){if(_0x3f06a9&&_0x3f06a9['fileText']){var _0x3a9fac=_0x3f06a9[_0x637b('0x92')];var _0x36cbdf=config[_0x637b('0x93')]+_0x637b('0x94')+_0x3f06a9['id']+_0x637b('0x95');if(fs[_0x637b('0x56')](_0x36cbdf)){return _0x36cbdf;}return writeFile(_0x3a9fac,_0x36cbdf)[_0x637b('0x29')](function(){return _0x36cbdf;});}else{throw new db[(_0x637b('0x57'))][(_0x637b('0x64'))](_0x637b('0x96'));}})[_0x637b('0x29')](function(_0x1f7bde){return _0x11de66['download'](_0x1f7bde);})[_0x637b('0x49')](handleError(_0x11de66));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2f2f8fd..aff6a2e 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 _0x725e=['bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','voice_recordings','uniqueid','lodash','api'];(function(_0x3c6e,_0x4987e2){var _0x41508b=function(_0x5d8a9a){while(--_0x5d8a9a){_0x3c6e['push'](_0x3c6e['shift']());}};_0x41508b(++_0x4987e2);}(_0x725e,0x12a));var _0xe725=function(_0x5d2098,_0x30d6cb){_0x5d2098=_0x5d2098-0x0;var _0x292f2a=_0x725e[_0x5d2098];return _0x292f2a;};'use strict';var _=require(_0xe725('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe725('0x1'));var moment=require('moment');var BPromise=require(_0xe725('0x2'));var rp=require(_0xe725('0x3'));var fs=require('fs');var path=require(_0xe725('0x4'));var rimraf=require(_0xe725('0x5'));var config=require('../../config/environment');var attributes=require(_0xe725('0x6'));module[_0xe725('0x7')]=function(_0x12c193,_0x487c06){return _0x12c193['define']('VoiceRecording',attributes,{'tableName':_0xe725('0x8'),'paranoid':![],'indexes':[{'name':_0xe725('0x9'),'fields':[_0xe725('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x24ee=['define','VoiceRecording','voice_recordings','uniqueid','lodash','api','path','rimraf','../../config/environment'];(function(_0x50783a,_0x1e739a){var _0x391d9a=function(_0x56a14a){while(--_0x56a14a){_0x50783a['push'](_0x50783a['shift']());}};_0x391d9a(++_0x1e739a);}(_0x24ee,0x109));var _0xe24e=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x24ee[_0x29771f];return _0x279baf;};'use strict';var _=require(_0xe24e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe24e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe24e('0x2'));var rimraf=require(_0xe24e('0x3'));var config=require(_0xe24e('0x4'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x18cadd,_0x48315f){return _0x18cadd[_0xe24e('0x5')](_0xe24e('0x6'),attributes,{'tableName':_0xe24e('0x7'),'paranoid':![],'indexes':[{'name':_0xe24e('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 01e2948..ca91ec2 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(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa46e,0x8a));var _0xea46=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xa46e[_0x2f6f50];return _0x2cf365;};'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 _0xdf55=['create','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','info','result','catch','UpdateVoiceRecording','update','options','raw','attributes','limit','debug','stringify','CreateVoiceRecording','findOne','callRecordingEncryption'];(function(_0x5e963b,_0x1472ac){var _0x5f40d9=function(_0x4fd844){while(--_0x4fd844){_0x5e963b['push'](_0x5e963b['shift']());}};_0x5f40d9(++_0x1472ac);}(_0xdf55,0x83));var _0x5df5=function(_0x59f5fe,_0x4524ed){_0x59f5fe=_0x59f5fe-0x0;var _0x398bd2=_0xdf55[_0x59f5fe];return _0x398bd2;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});}exports[_0x5df5('0x16')]=function(_0xb7e1c2){var _0x44f700=this;return new Promise(function(_0x215d59,_0x4b499d){return db['VoiceRecording'][_0x5df5('0x17')](_0xb7e1c2['body'],{'raw':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')]['where']||null:null,'attributes':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1a')]||null:null,'limit':_0xb7e1c2[_0x5df5('0x18')]?_0xb7e1c2[_0x5df5('0x18')][_0x5df5('0x1b')]||null:null})['then'](function(_0x2e99a1){logger[_0x5df5('0x13')](_0x5df5('0x16'),_0xb7e1c2);logger[_0x5df5('0x1c')]('UpdateVoiceRecording',_0xb7e1c2,JSON[_0x5df5('0x1d')](_0x2e99a1));_0x215d59(_0x2e99a1);})[_0x5df5('0x15')](function(_0x395f3e){logger['error']('UpdateVoiceRecording',_0x395f3e['message'],_0xb7e1c2);_0x4b499d(_0x44f700[_0x5df5('0xf')](0x1f4,_0x395f3e[_0x5df5('0x12')]));});});};exports[_0x5df5('0x1e')]=function(_0xa7f4b3){var _0x1baf52=this;return new Promise(function(_0x1fd83c,_0x210d20){var _0x28723e=require('../../components/encryptor');var _0x18bb61;return db['Setting'][_0x5df5('0x1f')]({'attributes':['id',_0x5df5('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3854d0){_0x18bb61=_0x3854d0;return db['VoiceRecording'][_0x5df5('0x21')](_0xa7f4b3['body']);})[_0x5df5('0xc')](function(_0x4afe36){if(_0x18bb61[_0x5df5('0x20')]&&fs['existsSync'](_0x4afe36[_0x5df5('0x22')])){var _0x47bebb=util[_0x5df5('0x23')]('%s.cypher',_0x4afe36[_0x5df5('0x22')]);return _0x28723e[_0x5df5('0x24')](_0x4afe36[_0x5df5('0x22')],_0x47bebb,config[_0x5df5('0x25')][_0x5df5('0x26')])[_0x5df5('0xc')](function(){fs[_0x5df5('0x27')](_0x4afe36['value']);logger['info'](_0x5df5('0x28'));return _0x4afe36;});}return _0x4afe36;})[_0x5df5('0xc')](function(_0x3bbd2b){logger[_0x5df5('0x13')](_0x5df5('0x1e'),_0xa7f4b3);logger[_0x5df5('0x1c')]('CreateVoiceRecording',_0xa7f4b3,JSON[_0x5df5('0x1d')](_0x3bbd2b));_0x1fd83c(_0x3bbd2b);})[_0x5df5('0x15')](function(_0x2f1001){logger[_0x5df5('0xf')]('CreateVoiceRecording',_0x2f1001[_0x5df5('0x12')],_0xa7f4b3);_0x210d20(_0x1baf52['error'](0x1f4,_0x2f1001[_0x5df5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 753ca52..1a1d031 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 _0x5cfe=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x23aef8,_0x1696bb){var _0x12ab00=function(_0x7edb0a){while(--_0x7edb0a){_0x23aef8['push'](_0x23aef8['shift']());}};_0x12ab00(++_0x1696bb);}(_0x5cfe,0x126));var _0xe5cf=function(_0x3bcbde,_0x6ef08f){_0x3bcbde=_0x3bcbde-0x0;var _0x4f324e=_0x5cfe[_0x3bcbde];return _0x4f324e;};'use strict';var multer=require(_0xe5cf('0x0'));var util=require('util');var path=require(_0xe5cf('0x1'));var timeout=require(_0xe5cf('0x2'));var express=require(_0xe5cf('0x3'));var router=express[_0xe5cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe5cf('0x5'));var interaction=require(_0xe5cf('0x6'));var config=require(_0xe5cf('0x7'));var controller=require(_0xe5cf('0x8'));router[_0xe5cf('0x9')]('/',auth[_0xe5cf('0xa')](),controller[_0xe5cf('0xb')]);router[_0xe5cf('0x9')](_0xe5cf('0xc'),auth[_0xe5cf('0xa')](),controller[_0xe5cf('0xd')]);router['get'](_0xe5cf('0xe'),auth[_0xe5cf('0xa')](),controller[_0xe5cf('0xf')]);router[_0xe5cf('0x10')]('/',auth[_0xe5cf('0xa')](),controller[_0xe5cf('0x11')]);router[_0xe5cf('0x12')]('/:id',auth[_0xe5cf('0xa')](),controller[_0xe5cf('0x13')]);router[_0xe5cf('0x14')]('/:id',auth[_0xe5cf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x17f7=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show'];(function(_0xc95b03,_0x497da5){var _0x1669e0=function(_0xf24bab){while(--_0xf24bab){_0xc95b03['push'](_0xc95b03['shift']());}};_0x1669e0(++_0x497da5);}(_0x17f7,0xba));var _0x717f=function(_0x6c8585,_0x1dc388){_0x6c8585=_0x6c8585-0x0;var _0x229e06=_0x17f7[_0x6c8585];return _0x229e06;};'use strict';var multer=require('multer');var util=require(_0x717f('0x0'));var path=require(_0x717f('0x1'));var timeout=require(_0x717f('0x2'));var express=require(_0x717f('0x3'));var router=express[_0x717f('0x4')]();var fs_extra=require(_0x717f('0x5'));var auth=require(_0x717f('0x6'));var interaction=require(_0x717f('0x7'));var config=require(_0x717f('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x717f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x717f('0x9')]('/describe',auth[_0x717f('0xa')](),controller[_0x717f('0xb')]);router[_0x717f('0x9')](_0x717f('0xc'),auth['isAuthenticated'](),controller[_0x717f('0xd')]);router['post']('/',auth[_0x717f('0xa')](),controller[_0x717f('0xe')]);router[_0x717f('0xf')](_0x717f('0xc'),auth[_0x717f('0xa')](),controller[_0x717f('0x10')]);router[_0x717f('0x11')](_0x717f('0xc'),auth[_0x717f('0xa')](),controller[_0x717f('0x12')]);module[_0x717f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index f315b8d..b163b2c 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 _0xca6c=['Yes','sequelize','moment','exports','ENUM','blind','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xca6c,0x16d));var _0xcca6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca6c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcca6('0x0'));var moment=require(_0xcca6('0x1'));module[_0xcca6('0x2')]={'type':{'type':Sequelize[_0xcca6('0x3')](_0xcca6('0x4'),'attended')},'result':{'type':Sequelize[_0xcca6('0x5')]},'transfererchannel':{'type':Sequelize[_0xcca6('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xcca6('0x5')]},'transferercalleridname':{'type':Sequelize[_0xcca6('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xcca6('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xcca6('0x5')]},'transferercontext':{'type':Sequelize[_0xcca6('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xcca6('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xcca6('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xcca6('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xcca6('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xcca6('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xcca6('0x5')]},'transfereeexten':{'type':Sequelize[_0xcca6('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xcca6('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xcca6('0x6'),'No')},'context':{'type':Sequelize[_0xcca6('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xddb1=['exports','blind','attended','STRING','ENUM','Yes'];(function(_0x4bdc05,_0x623370){var _0x43f1b3=function(_0x24165b){while(--_0x24165b){_0x4bdc05['push'](_0x4bdc05['shift']());}};_0x43f1b3(++_0x623370);}(_0xddb1,0x144));var _0x1ddb=function(_0x3d7cc0,_0x2cff37){_0x3d7cc0=_0x3d7cc0-0x0;var _0x205f3d=_0xddb1[_0x3d7cc0];return _0x205f3d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1ddb('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1ddb('0x1'),_0x1ddb('0x2'))},'result':{'type':Sequelize[_0x1ddb('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x1ddb('0x3')]},'transferercalleridname':{'type':Sequelize[_0x1ddb('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1ddb('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x1ddb('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x1ddb('0x3')]},'transferercontext':{'type':Sequelize[_0x1ddb('0x3')]},'transfererexten':{'type':Sequelize[_0x1ddb('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x1ddb('0x3')]},'transfereechannel':{'type':Sequelize[_0x1ddb('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x1ddb('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x1ddb('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1ddb('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1ddb('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x1ddb('0x3')]},'transfereecontext':{'type':Sequelize[_0x1ddb('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x1ddb('0x4')](_0x1ddb('0x5'),'No')},'context':{'type':Sequelize[_0x1ddb('0x3')]},'extension':{'type':Sequelize[_0x1ddb('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6e4a863..1f689c8 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 _0xecbc=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','update','destroy','end','stack','name','send','index','VoiceTransferReport','rawAttributes','key','map','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','then','rows','catch','params','keys','includeAll','find','create','body','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','../../components/auth/service'];(function(_0x9efe0,_0x1e7272){var _0x232a0f=function(_0x377439){while(--_0x377439){_0x9efe0['push'](_0x9efe0['shift']());}};_0x232a0f(++_0x1e7272);}(_0xecbc,0xca));var _0xcecb=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xecbc[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0xcecb('0x0'));var rimraf=require(_0xcecb('0x1'));var zipdir=require(_0xcecb('0x2'));var jsonpatch=require(_0xcecb('0x3'));var rp=require(_0xcecb('0x4'));var moment=require(_0xcecb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcecb('0x6'));var path=require(_0xcecb('0x7'));var sox=require(_0xcecb('0x8'));var csv=require('to-csv');var ejs=require(_0xcecb('0x9'));var fs=require('fs');var fs_extra=require(_0xcecb('0xa'));var _=require(_0xcecb('0xb'));var squel=require(_0xcecb('0xc'));var crypto=require(_0xcecb('0xd'));var jsforce=require(_0xcecb('0xe'));var deskjs=require(_0xcecb('0xf'));var toCsv=require(_0xcecb('0x10'));var querystring=require(_0xcecb('0x11'));var Papa=require(_0xcecb('0x12'));var Redis=require('ioredis');var authService=require(_0xcecb('0x13'));var qs=require(_0xcecb('0x14'));var as=require(_0xcecb('0x15'));var hardwareService=require(_0xcecb('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xcecb('0x17'));var config=require(_0xcecb('0x18'));var licenseUtil=require(_0xcecb('0x19'));var db=require(_0xcecb('0x1a'))['db'];function respondWithStatusCode(_0x58a8fc,_0x2cebc0){_0x2cebc0=_0x2cebc0||0xcc;return function(_0x4a0995){if(_0x4a0995){return _0x58a8fc[_0xcecb('0x1b')](_0x2cebc0);}return _0x58a8fc[_0xcecb('0x1c')](_0x2cebc0)['end']();};}function respondWithResult(_0x4c50a4,_0x28ad25){_0x28ad25=_0x28ad25||0xc8;return function(_0x8f1025){if(_0x8f1025){return _0x4c50a4[_0xcecb('0x1c')](_0x28ad25)[_0xcecb('0x1d')](_0x8f1025);}};}function respondWithFilteredResult(_0x5b1ceb,_0x44f565){return function(_0x58e268){if(_0x58e268){var _0x3e53fa=typeof _0x44f565[_0xcecb('0x1e')]===_0xcecb('0x1f')&&typeof _0x44f565[_0xcecb('0x20')]==='undefined';var _0x5133ec=_0x58e268[_0xcecb('0x21')];var _0x571e0d=_0x3e53fa?0x0:_0x44f565[_0xcecb('0x1e')];var _0x19b325=_0x3e53fa?_0x58e268[_0xcecb('0x21')]:_0x44f565[_0xcecb('0x1e')]+_0x44f565[_0xcecb('0x20')];var _0x1c6bfd;if(_0x19b325>=_0x5133ec){_0x19b325=_0x5133ec;_0x1c6bfd=0xc8;}else{_0x1c6bfd=0xce;}_0x5b1ceb[_0xcecb('0x1c')](_0x1c6bfd);return _0x5b1ceb[_0xcecb('0x22')]('Content-Range',_0x571e0d+'-'+_0x19b325+'/'+_0x5133ec)[_0xcecb('0x1d')](_0x58e268);}return null;};}function patchUpdates(_0x27dc07){return function(_0x2199ae){try{jsonpatch['apply'](_0x2199ae,_0x27dc07,!![]);}catch(_0x5452a7){return BPromise['reject'](_0x5452a7);}return _0x2199ae[_0xcecb('0x23')]();};}function saveUpdates(_0x3a9a1d,_0x577ace){return function(_0x5241b5){if(_0x5241b5){return _0x5241b5[_0xcecb('0x24')](_0x3a9a1d)['then'](function(_0x444116){return _0x444116;});}return null;};}function removeEntity(_0x44d942,_0x343046){return function(_0x4e6ae8){if(_0x4e6ae8){return _0x4e6ae8[_0xcecb('0x25')]()['then'](function(){_0x44d942['status'](0xcc)[_0xcecb('0x26')]();});}};}function handleEntityNotFound(_0xc006b1,_0x1db4e0){return function(_0x4206c0){if(!_0x4206c0){_0xc006b1[_0xcecb('0x1b')](0x194);}return _0x4206c0;};}function handleError(_0x41b7e1,_0x1f5cdc){_0x1f5cdc=_0x1f5cdc||0x1f4;return function(_0x17b068){logger['error'](_0x17b068[_0xcecb('0x27')]);if(_0x17b068[_0xcecb('0x28')]){delete _0x17b068[_0xcecb('0x28')];}_0x41b7e1[_0xcecb('0x1c')](_0x1f5cdc)[_0xcecb('0x29')](_0x17b068);};}exports[_0xcecb('0x2a')]=function(_0x1bc0d3,_0x20b742){var _0x1b0a19={},_0x41cc1d={},_0x31cf0e={'count':0x0,'rows':[]};var _0x42ed7d=_['map'](db[_0xcecb('0x2b')][_0xcecb('0x2c')],function(_0x4d8e55){return{'name':_0x4d8e55['fieldName'],'type':_0x4d8e55['type'][_0xcecb('0x2d')]};});_0x41cc1d['model']=_[_0xcecb('0x2e')](_0x42ed7d,'name');_0x41cc1d[_0xcecb('0x2f')]=_['keys'](_0x1bc0d3['query']);_0x41cc1d[_0xcecb('0x30')]=_[_0xcecb('0x31')](_0x41cc1d[_0xcecb('0x32')],_0x41cc1d[_0xcecb('0x2f')]);_0x1b0a19[_0xcecb('0x33')]=_['intersection'](_0x41cc1d[_0xcecb('0x32')],qs[_0xcecb('0x34')](_0x1bc0d3[_0xcecb('0x2f')][_0xcecb('0x34')]));_0x1b0a19['attributes']=_0x1b0a19[_0xcecb('0x33')][_0xcecb('0x35')]?_0x1b0a19['attributes']:_0x41cc1d[_0xcecb('0x32')];if(!_0x1bc0d3[_0xcecb('0x2f')]['hasOwnProperty']('nolimit')){_0x1b0a19[_0xcecb('0x20')]=qs[_0xcecb('0x20')](_0x1bc0d3[_0xcecb('0x2f')]['limit']);_0x1b0a19[_0xcecb('0x1e')]=qs[_0xcecb('0x1e')](_0x1bc0d3[_0xcecb('0x2f')][_0xcecb('0x1e')]);}_0x1b0a19[_0xcecb('0x36')]=qs[_0xcecb('0x37')](_0x1bc0d3[_0xcecb('0x2f')]['sort']);_0x1b0a19[_0xcecb('0x38')]=qs['filters'](_[_0xcecb('0x39')](_0x1bc0d3[_0xcecb('0x2f')],_0x41cc1d[_0xcecb('0x30')]),_0x42ed7d);if(_0x1bc0d3[_0xcecb('0x2f')][_0xcecb('0x3a')]){_0x1b0a19[_0xcecb('0x38')]=_['merge'](_0x1b0a19[_0xcecb('0x38')],{'$or':_[_0xcecb('0x2e')](_0x42ed7d,function(_0x56feaf){if(_0x56feaf[_0xcecb('0x3b')]!==_0xcecb('0x3c')){var _0x266c8a={};_0x266c8a[_0x56feaf['name']]={'$like':'%'+_0x1bc0d3[_0xcecb('0x2f')][_0xcecb('0x3a')]+'%'};return _0x266c8a;}})});}_0x1b0a19=_[_0xcecb('0x3d')]({},_0x1b0a19,_0x1bc0d3[_0xcecb('0x3e')]);var _0x2da7b3={'where':_0x1b0a19[_0xcecb('0x38')]};return db[_0xcecb('0x2b')][_0xcecb('0x21')](_0x2da7b3)['then'](function(_0x245860){_0x31cf0e[_0xcecb('0x21')]=_0x245860;if(_0x1bc0d3[_0xcecb('0x2f')]['includeAll']){_0x1b0a19[_0xcecb('0x3f')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x1b0a19);})[_0xcecb('0x40')](function(_0x4daca2){_0x31cf0e[_0xcecb('0x41')]=_0x4daca2;return _0x31cf0e;})[_0xcecb('0x40')](respondWithFilteredResult(_0x20b742,_0x1b0a19))[_0xcecb('0x42')](handleError(_0x20b742,null));};exports['show']=function(_0x1398e0,_0x219ba9){var _0x4e44ca={'raw':!![],'where':{'id':_0x1398e0[_0xcecb('0x43')]['id']}},_0x2ffeda={};_0x2ffeda['model']=_['keys'](db[_0xcecb('0x2b')][_0xcecb('0x2c')]);_0x2ffeda[_0xcecb('0x2f')]=_[_0xcecb('0x44')](_0x1398e0['query']);_0x2ffeda[_0xcecb('0x30')]=_['intersection'](_0x2ffeda[_0xcecb('0x32')],_0x2ffeda[_0xcecb('0x2f')]);_0x4e44ca['attributes']=_[_0xcecb('0x31')](_0x2ffeda[_0xcecb('0x32')],qs[_0xcecb('0x34')](_0x1398e0[_0xcecb('0x2f')]['fields']));_0x4e44ca[_0xcecb('0x33')]=_0x4e44ca[_0xcecb('0x33')]['length']?_0x4e44ca['attributes']:_0x2ffeda[_0xcecb('0x32')];if(_0x1398e0['query'][_0xcecb('0x45')]){_0x4e44ca[_0xcecb('0x3f')]=[{'all':!![]}];}_0x4e44ca=_[_0xcecb('0x3d')]({},_0x4e44ca,_0x1398e0[_0xcecb('0x3e')]);return db[_0xcecb('0x2b')][_0xcecb('0x46')](_0x4e44ca)[_0xcecb('0x40')](handleEntityNotFound(_0x219ba9,null))['then'](respondWithResult(_0x219ba9,null))[_0xcecb('0x42')](handleError(_0x219ba9,null));};exports[_0xcecb('0x47')]=function(_0x593564,_0x4468bc){return db['VoiceTransferReport'][_0xcecb('0x47')](_0x593564[_0xcecb('0x48')],{})[_0xcecb('0x40')](respondWithResult(_0x4468bc,0xc9))[_0xcecb('0x42')](handleError(_0x4468bc,null));};exports[_0xcecb('0x24')]=function(_0x622b64,_0x289e51){if(_0x622b64[_0xcecb('0x48')]['id']){delete _0x622b64['body']['id'];}return db[_0xcecb('0x2b')][_0xcecb('0x46')]({'where':{'id':_0x622b64['params']['id']}})[_0xcecb('0x40')](handleEntityNotFound(_0x289e51,null))[_0xcecb('0x40')](saveUpdates(_0x622b64['body'],null))[_0xcecb('0x40')](respondWithResult(_0x289e51,null))[_0xcecb('0x42')](handleError(_0x289e51,null));};exports[_0xcecb('0x25')]=function(_0x6f14f5,_0x5990e9){return db[_0xcecb('0x2b')]['find']({'where':{'id':_0x6f14f5[_0xcecb('0x43')]['id']}})[_0xcecb('0x40')](handleEntityNotFound(_0x5990e9,null))['then'](removeEntity(_0x5990e9,null))[_0xcecb('0x42')](handleError(_0x5990e9,null));};exports[_0xcecb('0x49')]=function(_0xee91f,_0x3651af){return db['VoiceTransferReport'][_0xcecb('0x49')]()[_0xcecb('0x40')](respondWithResult(_0x3651af,null))[_0xcecb('0x42')](handleError(_0x3651af,null));}; \ No newline at end of file +var _0x1e52=['save','update','then','destroy','sendStatus','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','params','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0x1e52,0x109));var _0x21e5=function(_0x1780b4,_0x16801c){_0x1780b4=_0x1780b4-0x0;var _0x199010=_0x1e52[_0x1780b4];return _0x199010;};'use strict';var emlformat=require(_0x21e5('0x0'));var rimraf=require(_0x21e5('0x1'));var zipdir=require(_0x21e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21e5('0x3'));var moment=require(_0x21e5('0x4'));var BPromise=require(_0x21e5('0x5'));var Mustache=require(_0x21e5('0x6'));var util=require('util');var path=require(_0x21e5('0x7'));var sox=require(_0x21e5('0x8'));var csv=require(_0x21e5('0x9'));var ejs=require(_0x21e5('0xa'));var fs=require('fs');var fs_extra=require(_0x21e5('0xb'));var _=require('lodash');var squel=require(_0x21e5('0xc'));var crypto=require('crypto');var jsforce=require(_0x21e5('0xd'));var deskjs=require(_0x21e5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x21e5('0xf'));var Redis=require(_0x21e5('0x10'));var authService=require(_0x21e5('0x11'));var qs=require(_0x21e5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21e5('0x13'));var logger=require(_0x21e5('0x14'))(_0x21e5('0x15'));var utils=require(_0x21e5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x21e5('0x17'));var db=require(_0x21e5('0x18'))['db'];function respondWithStatusCode(_0x4ada51,_0x2b50d3){_0x2b50d3=_0x2b50d3||0xcc;return function(_0x8e587c){if(_0x8e587c){return _0x4ada51['sendStatus'](_0x2b50d3);}return _0x4ada51[_0x21e5('0x19')](_0x2b50d3)[_0x21e5('0x1a')]();};}function respondWithResult(_0x35de62,_0x4c6bb7){_0x4c6bb7=_0x4c6bb7||0xc8;return function(_0x462cce){if(_0x462cce){return _0x35de62[_0x21e5('0x19')](_0x4c6bb7)[_0x21e5('0x1b')](_0x462cce);}};}function respondWithFilteredResult(_0x2e11ac,_0x1508bf){return function(_0x39b234){if(_0x39b234){var _0x486c09=typeof _0x1508bf[_0x21e5('0x1c')]===_0x21e5('0x1d')&&typeof _0x1508bf['limit']===_0x21e5('0x1d');var _0x12df93=_0x39b234[_0x21e5('0x1e')];var _0x252e6f=_0x486c09?0x0:_0x1508bf[_0x21e5('0x1c')];var _0x561712=_0x486c09?_0x39b234[_0x21e5('0x1e')]:_0x1508bf['offset']+_0x1508bf['limit'];var _0xf1450a;if(_0x561712>=_0x12df93){_0x561712=_0x12df93;_0xf1450a=0xc8;}else{_0xf1450a=0xce;}_0x2e11ac[_0x21e5('0x19')](_0xf1450a);return _0x2e11ac[_0x21e5('0x1f')](_0x21e5('0x20'),_0x252e6f+'-'+_0x561712+'/'+_0x12df93)[_0x21e5('0x1b')](_0x39b234);}return null;};}function patchUpdates(_0x5826d1){return function(_0x237add){try{jsonpatch[_0x21e5('0x21')](_0x237add,_0x5826d1,!![]);}catch(_0xe1b113){return BPromise[_0x21e5('0x22')](_0xe1b113);}return _0x237add[_0x21e5('0x23')]();};}function saveUpdates(_0x4ebc84,_0x33cd39){return function(_0x175a4c){if(_0x175a4c){return _0x175a4c[_0x21e5('0x24')](_0x4ebc84)[_0x21e5('0x25')](function(_0xcfae4f){return _0xcfae4f;});}return null;};}function removeEntity(_0x58152d,_0x175747){return function(_0x50d792){if(_0x50d792){return _0x50d792[_0x21e5('0x26')]()[_0x21e5('0x25')](function(){_0x58152d[_0x21e5('0x19')](0xcc)[_0x21e5('0x1a')]();});}};}function handleEntityNotFound(_0x3adc92,_0x427187){return function(_0x363cbe){if(!_0x363cbe){_0x3adc92[_0x21e5('0x27')](0x194);}return _0x363cbe;};}function handleError(_0x1dd356,_0xc4d58c){_0xc4d58c=_0xc4d58c||0x1f4;return function(_0x26f6bb){logger['error'](_0x26f6bb[_0x21e5('0x28')]);if(_0x26f6bb[_0x21e5('0x29')]){delete _0x26f6bb[_0x21e5('0x29')];}_0x1dd356['status'](_0xc4d58c)[_0x21e5('0x2a')](_0x26f6bb);};}exports[_0x21e5('0x2b')]=function(_0x4d2f2f,_0x2347aa){var _0x197250={},_0x195f18={},_0x5cc8cf={'count':0x0,'rows':[]};var _0x178619=_[_0x21e5('0x2c')](db[_0x21e5('0x2d')][_0x21e5('0x2e')],function(_0x5eabea){return{'name':_0x5eabea[_0x21e5('0x2f')],'type':_0x5eabea[_0x21e5('0x30')][_0x21e5('0x31')]};});_0x195f18['model']=_[_0x21e5('0x2c')](_0x178619,_0x21e5('0x29'));_0x195f18[_0x21e5('0x32')]=_[_0x21e5('0x33')](_0x4d2f2f[_0x21e5('0x32')]);_0x195f18['filters']=_[_0x21e5('0x34')](_0x195f18[_0x21e5('0x35')],_0x195f18[_0x21e5('0x32')]);_0x197250['attributes']=_['intersection'](_0x195f18[_0x21e5('0x35')],qs[_0x21e5('0x36')](_0x4d2f2f[_0x21e5('0x32')]['fields']));_0x197250[_0x21e5('0x37')]=_0x197250['attributes'][_0x21e5('0x38')]?_0x197250[_0x21e5('0x37')]:_0x195f18[_0x21e5('0x35')];if(!_0x4d2f2f[_0x21e5('0x32')][_0x21e5('0x39')](_0x21e5('0x3a'))){_0x197250[_0x21e5('0x3b')]=qs[_0x21e5('0x3b')](_0x4d2f2f[_0x21e5('0x32')]['limit']);_0x197250[_0x21e5('0x1c')]=qs['offset'](_0x4d2f2f[_0x21e5('0x32')][_0x21e5('0x1c')]);}_0x197250[_0x21e5('0x3c')]=qs['sort'](_0x4d2f2f[_0x21e5('0x32')][_0x21e5('0x3d')]);_0x197250['where']=qs[_0x21e5('0x3e')](_[_0x21e5('0x3f')](_0x4d2f2f[_0x21e5('0x32')],_0x195f18['filters']),_0x178619);if(_0x4d2f2f['query'][_0x21e5('0x40')]){_0x197250[_0x21e5('0x41')]=_[_0x21e5('0x42')](_0x197250[_0x21e5('0x41')],{'$or':_[_0x21e5('0x2c')](_0x178619,function(_0x19e265){if(_0x19e265['type']!=='VIRTUAL'){var _0x2d6873={};_0x2d6873[_0x19e265[_0x21e5('0x29')]]={'$like':'%'+_0x4d2f2f[_0x21e5('0x32')][_0x21e5('0x40')]+'%'};return _0x2d6873;}})});}_0x197250=_[_0x21e5('0x42')]({},_0x197250,_0x4d2f2f[_0x21e5('0x43')]);var _0x53af7a={'where':_0x197250[_0x21e5('0x41')]};return db[_0x21e5('0x2d')][_0x21e5('0x1e')](_0x53af7a)['then'](function(_0x39a930){_0x5cc8cf['count']=_0x39a930;if(_0x4d2f2f[_0x21e5('0x32')][_0x21e5('0x44')]){_0x197250[_0x21e5('0x45')]=[{'all':!![]}];}return db[_0x21e5('0x2d')]['findAll'](_0x197250);})['then'](function(_0x55fc5d){_0x5cc8cf[_0x21e5('0x46')]=_0x55fc5d;return _0x5cc8cf;})['then'](respondWithFilteredResult(_0x2347aa,_0x197250))['catch'](handleError(_0x2347aa,null));};exports['show']=function(_0x29505b,_0x33a3b2){var _0xdeea3c={'raw':!![],'where':{'id':_0x29505b[_0x21e5('0x47')]['id']}},_0x39ccc={};_0x39ccc[_0x21e5('0x35')]=_['keys'](db[_0x21e5('0x2d')]['rawAttributes']);_0x39ccc[_0x21e5('0x32')]=_['keys'](_0x29505b[_0x21e5('0x32')]);_0x39ccc['filters']=_[_0x21e5('0x34')](_0x39ccc['model'],_0x39ccc['query']);_0xdeea3c[_0x21e5('0x37')]=_['intersection'](_0x39ccc[_0x21e5('0x35')],qs[_0x21e5('0x36')](_0x29505b[_0x21e5('0x32')][_0x21e5('0x36')]));_0xdeea3c[_0x21e5('0x37')]=_0xdeea3c[_0x21e5('0x37')][_0x21e5('0x38')]?_0xdeea3c[_0x21e5('0x37')]:_0x39ccc['model'];if(_0x29505b[_0x21e5('0x32')]['includeAll']){_0xdeea3c[_0x21e5('0x45')]=[{'all':!![]}];}_0xdeea3c=_[_0x21e5('0x42')]({},_0xdeea3c,_0x29505b[_0x21e5('0x43')]);return db[_0x21e5('0x2d')][_0x21e5('0x48')](_0xdeea3c)['then'](handleEntityNotFound(_0x33a3b2,null))[_0x21e5('0x25')](respondWithResult(_0x33a3b2,null))[_0x21e5('0x49')](handleError(_0x33a3b2,null));};exports['create']=function(_0x40752d,_0x57141e){return db[_0x21e5('0x2d')]['create'](_0x40752d[_0x21e5('0x4a')],{})[_0x21e5('0x25')](respondWithResult(_0x57141e,0xc9))['catch'](handleError(_0x57141e,null));};exports[_0x21e5('0x24')]=function(_0x220ffe,_0x4d0ff8){if(_0x220ffe['body']['id']){delete _0x220ffe[_0x21e5('0x4a')]['id'];}return db['VoiceTransferReport'][_0x21e5('0x48')]({'where':{'id':_0x220ffe[_0x21e5('0x47')]['id']}})[_0x21e5('0x25')](handleEntityNotFound(_0x4d0ff8,null))[_0x21e5('0x25')](saveUpdates(_0x220ffe['body'],null))[_0x21e5('0x25')](respondWithResult(_0x4d0ff8,null))[_0x21e5('0x49')](handleError(_0x4d0ff8,null));};exports['destroy']=function(_0xf44db4,_0xffe931){return db[_0x21e5('0x2d')][_0x21e5('0x48')]({'where':{'id':_0xf44db4['params']['id']}})[_0x21e5('0x25')](handleEntityNotFound(_0xffe931,null))[_0x21e5('0x25')](removeEntity(_0xffe931,null))[_0x21e5('0x49')](handleError(_0xffe931,null));};exports['describe']=function(_0x593070,_0x49559f){return db[_0x21e5('0x2d')]['describe']()[_0x21e5('0x25')](respondWithResult(_0x49559f,null))[_0x21e5('0x49')](handleError(_0x49559f,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index bdd511b..099373c 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 _0xb3dd=['VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xb3dd,0xf0));var _0xdb3d=function(_0x15f1bf,_0x22fc31){_0x15f1bf=_0x15f1bf-0x0;var _0x5d76f7=_0xb3dd[_0x15f1bf];return _0x5d76f7;};'use strict';var _=require(_0xdb3d('0x0'));var util=require(_0xdb3d('0x1'));var logger=require(_0xdb3d('0x2'))('api');var moment=require(_0xdb3d('0x3'));var BPromise=require(_0xdb3d('0x4'));var rp=require(_0xdb3d('0x5'));var fs=require('fs');var path=require(_0xdb3d('0x6'));var rimraf=require(_0xdb3d('0x7'));var config=require(_0xdb3d('0x8'));var attributes=require(_0xdb3d('0x9'));module[_0xdb3d('0xa')]=function(_0x109355,_0x4ba17e){return _0x109355[_0xdb3d('0xb')](_0xdb3d('0xc'),attributes,{'tableName':_0xdb3d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x277b=['path','../../config/environment','./voiceTransferReport.attributes','exports','define','lodash','api','moment','request-promise'];(function(_0x1a0f7a,_0x2ed5e5){var _0x238316=function(_0x4771d9){while(--_0x4771d9){_0x1a0f7a['push'](_0x1a0f7a['shift']());}};_0x238316(++_0x2ed5e5);}(_0x277b,0xcb));var _0xb277=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x277b[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xb277('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb277('0x1'));var moment=require(_0xb277('0x2'));var BPromise=require('bluebird');var rp=require(_0xb277('0x3'));var fs=require('fs');var path=require(_0xb277('0x4'));var rimraf=require('rimraf');var config=require(_0xb277('0x5'));var attributes=require(_0xb277('0x6'));module[_0xb277('0x7')]=function(_0x3d53a9,_0x4eb992){return _0x3d53a9[_0xb277('0x8')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','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 f5ea125..b0cc458 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 _0x378e=['jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','debug','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4b630,_0x151f86){var _0x24f855=function(_0x2ead2a){while(--_0x2ead2a){_0x4b630['push'](_0x4b630['shift']());}};_0x24f855(++_0x151f86);}(_0x378e,0x68));var _0xe378=function(_0x5bef86,_0x37f016){_0x5bef86=_0x5bef86-0x0;var _0x1bf9e4=_0x378e[_0x5bef86];return _0x1bf9e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe378('0x0'));var BPromise=require(_0xe378('0x1'));var rs=require(_0xe378('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe378('0x3'))['db'];var utils=require(_0xe378('0x4'));var logger=require(_0xe378('0x5'))(_0xe378('0x6'));var config=require(_0xe378('0x7'));var jayson=require(_0xe378('0x8'));var client=jayson[_0xe378('0x9')][_0xe378('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1152be,_0x5900a8,_0xb82643){return new BPromise(function(_0x77617b,_0x3c43cf){return client[_0xe378('0xb')](_0x1152be,_0xb82643)[_0xe378('0xc')](function(_0x2e22cf){logger[_0xe378('0xd')](_0xe378('0xe'),_0x5900a8,_0xe378('0xf'));logger['debug'](_0xe378('0x10'),_0x5900a8,_0xe378('0xf'),JSON[_0xe378('0x11')](_0x2e22cf));if(_0x2e22cf[_0xe378('0x12')]){if(_0x2e22cf[_0xe378('0x12')][_0xe378('0x13')]===0x1f4){logger[_0xe378('0x12')](_0xe378('0xe'),_0x5900a8,_0x2e22cf[_0xe378('0x12')]['message']);return _0x3c43cf(_0x2e22cf[_0xe378('0x12')]['message']);}logger[_0xe378('0x12')](_0xe378('0xe'),_0x5900a8,_0x2e22cf[_0xe378('0x12')][_0xe378('0x14')]);return _0x77617b(_0x2e22cf[_0xe378('0x12')][_0xe378('0x14')]);}else{logger[_0xe378('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x5900a8,_0xe378('0xf'));_0x77617b(_0x2e22cf[_0xe378('0x15')][_0xe378('0x14')]);}})[_0xe378('0x16')](function(_0x258e2f){logger['error'](_0xe378('0xe'),_0x5900a8,_0x258e2f);_0x3c43cf(_0x258e2f);});});}exports[_0xe378('0x17')]=function(_0x3dbe8d){var _0x3fe7bd=this;return new Promise(function(_0x25b1bb,_0x15a303){return db[_0xe378('0x18')]['create'](_0x3dbe8d[_0xe378('0x19')],{'raw':_0x3dbe8d['options']?_0x3dbe8d[_0xe378('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x182531){logger[_0xe378('0xd')]('CreateVoiceTransferReport',_0x3dbe8d);logger[_0xe378('0x1b')](_0xe378('0x17'),_0x3dbe8d,JSON[_0xe378('0x11')](_0x182531));_0x25b1bb(_0x182531);})[_0xe378('0x16')](function(_0x33c758){logger[_0xe378('0x12')]('CreateVoiceTransferReport',_0x33c758[_0xe378('0x14')],_0x3dbe8d);_0x15a303(_0x3fe7bd[_0xe378('0x12')](0x1f4,_0x33c758[_0xe378('0x14')]));});});}; \ No newline at end of file +var _0xe1ca=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','lodash','util','bluebird'];(function(_0x1f3bcc,_0xbf6c7a){var _0x438260=function(_0x4295aa){while(--_0x4295aa){_0x1f3bcc['push'](_0x1f3bcc['shift']());}};_0x438260(++_0xbf6c7a);}(_0xe1ca,0xa5));var _0xae1c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1ca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xae1c('0x0'));var util=require(_0xae1c('0x1'));var moment=require('moment');var BPromise=require(_0xae1c('0x2'));var rs=require(_0xae1c('0x3'));var fs=require('fs');var Redis=require(_0xae1c('0x4'));var db=require(_0xae1c('0x5'))['db'];var utils=require(_0xae1c('0x6'));var logger=require(_0xae1c('0x7'))(_0xae1c('0x8'));var config=require(_0xae1c('0x9'));var jayson=require(_0xae1c('0xa'));var client=jayson[_0xae1c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d937a,_0x328a26,_0x4ee6b0){return new BPromise(function(_0x393ce0,_0x1459ea){return client[_0xae1c('0xc')](_0x1d937a,_0x4ee6b0)[_0xae1c('0xd')](function(_0x45f1ea){logger[_0xae1c('0xe')](_0xae1c('0xf'),_0x328a26,'request\x20sent');logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x328a26,_0xae1c('0x10'),JSON['stringify'](_0x45f1ea));if(_0x45f1ea[_0xae1c('0x11')]){if(_0x45f1ea[_0xae1c('0x11')][_0xae1c('0x12')]===0x1f4){logger[_0xae1c('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x328a26,_0x45f1ea['error'][_0xae1c('0x13')]);return _0x1459ea(_0x45f1ea['error'][_0xae1c('0x13')]);}logger[_0xae1c('0x11')](_0xae1c('0xf'),_0x328a26,_0x45f1ea[_0xae1c('0x11')]['message']);return _0x393ce0(_0x45f1ea[_0xae1c('0x11')][_0xae1c('0x13')]);}else{logger['info'](_0xae1c('0xf'),_0x328a26,_0xae1c('0x10'));_0x393ce0(_0x45f1ea['result'][_0xae1c('0x13')]);}})[_0xae1c('0x14')](function(_0x39c35b){logger[_0xae1c('0x11')](_0xae1c('0xf'),_0x328a26,_0x39c35b);_0x1459ea(_0x39c35b);});});}exports[_0xae1c('0x15')]=function(_0x329174){var _0x2ee975=this;return new Promise(function(_0x23cd56,_0x2d9935){return db[_0xae1c('0x16')][_0xae1c('0x17')](_0x329174[_0xae1c('0x18')],{'raw':_0x329174[_0xae1c('0x19')]?_0x329174[_0xae1c('0x19')][_0xae1c('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x110131){logger[_0xae1c('0xe')]('CreateVoiceTransferReport',_0x329174);logger['debug']('CreateVoiceTransferReport',_0x329174,JSON[_0xae1c('0x1b')](_0x110131));_0x23cd56(_0x110131);})[_0xae1c('0x14')](function(_0x340985){logger[_0xae1c('0x11')](_0xae1c('0x15'),_0x340985['message'],_0x329174);_0x2d9935(_0x2ee975[_0xae1c('0x11')](0x1f4,_0x340985['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index d20f068..5e66ee5 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 _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x58df61,_0x263bda){var _0x2af205=function(_0x14c8aa){while(--_0x14c8aa){_0x58df61['push'](_0x58df61['shift']());}};_0x2af205(++_0x263bda);}(_0xe14d,0x1ee));var _0xde14=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xe14d[_0x13b02f];return _0x12e9a6;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file +var _0x0bb5=['unhold','/calls','calls','/transfer','exports','express','Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','/unhold'];(function(_0x5ae82b,_0x450855){var _0x1744a3=function(_0x1080cd){while(--_0x1080cd){_0x5ae82b['push'](_0x5ae82b['shift']());}};_0x1744a3(++_0x450855);}(_0x0bb5,0x148));var _0x50bb=function(_0x927319,_0x3ae9bc){_0x927319=_0x927319-0x0;var _0x243b9a=_0x0bb5[_0x927319];return _0x243b9a;};'use strict';var express=require(_0x50bb('0x0'));var router=express[_0x50bb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x50bb('0x2')](_0x50bb('0x3'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0x6')]);router[_0x50bb('0x2')](_0x50bb('0x7'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller['hangup']);router[_0x50bb('0x2')](_0x50bb('0x8'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['answer']);router['post'](_0x50bb('0x9'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xa')]);router['post'](_0x50bb('0xb'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xc')]);router[_0x50bb('0x2')](_0x50bb('0xd'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['transfer']);module[_0x50bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index c692b86..c70dc41 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 _0x6953=['calls','calls\x20fired:','VoiceChannels','conference','conference\x20fired:','webbar:conference','transfer','transferNumber','transfer\x20executed!','path','lodash','bluebird','client','http','../../config/logger','ioredis','defaults','redis','localhost','socket.io-emitter','number','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','request','message','catch','findOne','then','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','validate','json','body','userId','entityFound:','user:%s','webbar:originate','hangup','hangup\x20fired:','format','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','webbar:unhold','unhold\x20executed!'];(function(_0x533a46,_0x436a55){var _0x5e391b=function(_0x1c0164){while(--_0x1c0164){_0x533a46['push'](_0x533a46['shift']());}};_0x5e391b(++_0x436a55);}(_0x6953,0x91));var _0x3695=function(_0x33be53,_0x34a89c){_0x33be53=_0x33be53-0x0;var _0x2724b3=_0x6953[_0x33be53];return _0x2724b3;};'use strict';var path=require(_0x3695('0x0'));var fs=require('fs');var _=require(_0x3695('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x3695('0x2'));var jayson=require('jayson/promise');var amiClient=jayson[_0x3695('0x3')][_0x3695('0x4')]({'port':0x232a});var logger=require(_0x3695('0x5'))('webbarapi');var Redis=require(_0x3695('0x6'));config['redis']=_[_0x3695('0x7')](config[_0x3695('0x8')],{'host':_0x3695('0x9'),'port':0x18eb});var io=require(_0x3695('0xa'))(new Redis(config[_0x3695('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x3695('0xb'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x3695('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x3695('0xc')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3695('0xd')]},'sessionId':{'type':_0x3695('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x3695('0xb'),'required':[!![],_0x3695('0xd')]},'sessionId':{'type':_0x3695('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x3695('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3695('0xc'),'required':[!![],_0x3695('0xe')]},'transferNumber':{'type':_0x3695('0xc'),'required':[!![],_0x3695('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x3695('0xb'),'required':[!![],_0x3695('0xd')]},'sessionId':{'type':_0x3695('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x3695('0xb'),'required':[!![],_0x3695('0xd')]},'sessionId':{'type':_0x3695('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x3695('0xb'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x3695('0xb'),'required':[!![],_0x3695('0xd')]}});function emit(_0x2cdd3,_0x3cb320,_0x367191){logger[_0x3695('0x10')](_0x2cdd3,_0x3cb320,JSON[_0x3695('0x11')](_0x367191));io['to'](_0x2cdd3)['emit'](_0x3cb320,_0x367191);}function handleError(_0x717ee4){return function(_0x5edf8d){console[_0x3695('0x12')](_0x3695('0x13'),_0x5edf8d,_0x5edf8d instanceof RangeError);logger[_0x3695('0x14')](_0x5edf8d[_0x3695('0x15')]);if(_0x5edf8d instanceof RangeError){if(_0x5edf8d[_0x3695('0x16')]){delete _0x5edf8d['name'];}_0x717ee4[_0x3695('0x17')](0x194)[_0x3695('0x18')](_0x5edf8d);}else{if(_0x5edf8d[_0x3695('0x16')]){delete _0x5edf8d[_0x3695('0x16')];}_0x717ee4[_0x3695('0x17')](0x1f4)[_0x3695('0x18')](_0x5edf8d);}};}function checkError(){return function(_0x34b0fc){if(!_0x34b0fc){throw new RangeError(_0x3695('0x19'));}return _0x34b0fc;};}function respondWithRpcPromise(_0x1f267a,_0xbbffe2){return new BPromise(function(_0x1b97d2,_0xf2c747){var _0x459f33=amiClient;return _0x459f33[_0x3695('0x1a')](_0x1f267a,_0xbbffe2)['then'](function(_0x42648c){if(_0x42648c[_0x3695('0x14')]){if(_0x42648c['error']['code']===0x1f4){return _0xf2c747(_0x42648c[_0x3695('0x14')][_0x3695('0x1b')]);}return _0x1b97d2(_0x42648c[_0x3695('0x14')][_0x3695('0x1b')]);}else{_0x1b97d2(_0x42648c['result']);}})[_0x3695('0x1c')](function(_0x48c2fd){_0xf2c747(_0x48c2fd);});});}function getAgent(_0xeddb06){return db['User'][_0x3695('0x1d')]({'where':{'id':_0xeddb06,'role':'agent'}})[_0x3695('0x1e')](checkError());}function getAgentCheckSession(_0x19f834,_0x462ff0){return new BPromise(function(_0x18a474,_0x3d4442){var _0x31fdf3=respondWithRpcPromise('VoiceChannels');var _0x2be6ee=getAgent(_0x19f834);Promise[_0x3695('0x1f')]([_0x31fdf3,_0x2be6ee])['then'](function(_0x392107){var _0x4d0742=_0x392107[0x0];var _0x39c39f=_0x392107[0x1];var _0x399bc6=_[_0x3695('0x20')](_0x4d0742[_0x3695('0x21')],function(_0x30a5ba){return _0x30a5ba[_0x3695('0x22')]==_0x39c39f['id']&&_0x30a5ba[_0x3695('0x23')]==_0x462ff0;});if(_0x399bc6[_0x3695('0x24')]==0x1){_0x18a474(_0x39c39f);}else{_0x3d4442(new RangeError('sessionId\x20'+_0x462ff0+_0x3695('0x25')));}});});}exports[_0x3695('0x26')]=function(_0xe6455e,_0x4c604f){logger['info'](_0x3695('0x27'),_0xe6455e['body']);var _0x12dbce=originateValidation[_0x3695('0x28')](_0xe6455e['body']);if(_0x12dbce[_0x3695('0x24')]>0x0){return _0x4c604f['status'](0x190)[_0x3695('0x29')](_0x12dbce);}var _0x197396=_0xe6455e[_0x3695('0x2a')][_0x3695('0x2b')];var _0x30eab2=_0xe6455e[_0x3695('0x2a')]['callNumber'];var _0x3ab2a0=_0xe6455e[_0x3695('0x2a')]['callerId'];var _0x2e657e=_0xe6455e[_0x3695('0x2a')]['callbackUrl'];return getAgent(_0x197396)['then'](function(_0x4c359d){logger['info'](_0x3695('0x2c'),_0x4c359d[_0x3695('0x16')]);emit(util['format'](_0x3695('0x2d'),_0x4c359d[_0x3695('0x16')]),_0x3695('0x2e'),{'callNumber':_0x30eab2,'callerId':_0x3ab2a0,'callbackUrl':_0x2e657e});return _0x4c604f[_0x3695('0x17')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x3695('0x1c')](handleError(_0x4c604f));};exports[_0x3695('0x2f')]=function(_0x59c271,_0x12ebe9){logger[_0x3695('0x10')](_0x3695('0x30'),_0x59c271[_0x3695('0x2a')]);var _0xaee5e8=hangupValidation[_0x3695('0x28')](_0x59c271[_0x3695('0x2a')]);if(_0xaee5e8[_0x3695('0x24')]>0x0){return _0x12ebe9[_0x3695('0x17')](0x190)[_0x3695('0x29')](_0xaee5e8);}var _0x460b49=_0x59c271[_0x3695('0x2a')][_0x3695('0x2b')];var _0x1d0fa0=_0x59c271[_0x3695('0x2a')][_0x3695('0x23')];return getAgent(_0x460b49)['then'](function(_0x775d39){logger[_0x3695('0x10')](_0x3695('0x2c'),_0x775d39[_0x3695('0x16')]);emit(util[_0x3695('0x31')](_0x3695('0x2d'),_0x775d39[_0x3695('0x16')]),'webbar:hangup',{'sessionId':_0x1d0fa0});return _0x12ebe9[_0x3695('0x17')](0xc8)[_0x3695('0x29')]({'error':![],'message':_0x3695('0x32')});})['catch'](handleError(_0x12ebe9));};exports[_0x3695('0x33')]=function(_0x454e86,_0x3ffc79){logger[_0x3695('0x10')](_0x3695('0x34'),_0x454e86[_0x3695('0x2a')]);var _0x4261d1=answerValidation['validate'](_0x454e86[_0x3695('0x2a')]);if(_0x4261d1['length']>0x0){return _0x3ffc79['status'](0x190)[_0x3695('0x29')](_0x4261d1);}var _0x51f403=_0x454e86[_0x3695('0x2a')][_0x3695('0x2b')];var _0x65f4b3=_0x454e86[_0x3695('0x2a')]['sessionId'];return getAgent(_0x51f403)[_0x3695('0x1e')](function(_0x34cbd8){logger[_0x3695('0x10')]('entityFound:',_0x34cbd8[_0x3695('0x16')]);emit(util[_0x3695('0x31')](_0x3695('0x2d'),_0x34cbd8[_0x3695('0x16')]),_0x3695('0x35'),{'sessionId':_0x65f4b3});return _0x3ffc79[_0x3695('0x17')](0xc8)[_0x3695('0x29')]({'error':![],'message':_0x3695('0x36')});})[_0x3695('0x1c')](handleError(_0x3ffc79));};exports['hold']=function(_0x57bf10,_0x1a021e){logger[_0x3695('0x10')](_0x3695('0x37'),_0x57bf10['body']);var _0x1c8fc3=holdValidation[_0x3695('0x28')](_0x57bf10[_0x3695('0x2a')]);if(_0x1c8fc3['length']>0x0){return _0x1a021e[_0x3695('0x17')](0x190)[_0x3695('0x29')](_0x1c8fc3);}var _0x3d6a61=_0x57bf10[_0x3695('0x2a')][_0x3695('0x2b')];var _0x567d5e=_0x57bf10[_0x3695('0x2a')][_0x3695('0x23')];return getAgent(_0x3d6a61)[_0x3695('0x1e')](function(_0x361a9f){logger['info'](_0x3695('0x2c'),_0x361a9f['name']);emit(util['format'](_0x3695('0x2d'),_0x361a9f[_0x3695('0x16')]),_0x3695('0x38'),{'sessionId':_0x567d5e});return _0x1a021e[_0x3695('0x17')](0xc8)[_0x3695('0x29')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x1a021e));};exports['unhold']=function(_0x5173b8,_0x5eeaca){logger['info']('unhold\x20fired:',_0x5173b8['body']);var _0x3b1c1c=unholdValidation[_0x3695('0x28')](_0x5173b8['body']);if(_0x3b1c1c[_0x3695('0x24')]>0x0){return _0x5eeaca[_0x3695('0x17')](0x190)['json'](_0x3b1c1c);}var _0x4a0a78=_0x5173b8[_0x3695('0x2a')][_0x3695('0x2b')];var _0x1a61d6=_0x5173b8['body'][_0x3695('0x23')];return getAgent(_0x4a0a78)[_0x3695('0x1e')](function(_0x1422f0){logger[_0x3695('0x10')](_0x3695('0x2c'),_0x1422f0[_0x3695('0x16')]);emit(util[_0x3695('0x31')](_0x3695('0x2d'),_0x1422f0[_0x3695('0x16')]),_0x3695('0x39'),{'sessionId':_0x1a61d6});return _0x5eeaca[_0x3695('0x17')](0xc8)[_0x3695('0x29')]({'error':![],'message':_0x3695('0x3a')});})[_0x3695('0x1c')](handleError(_0x5eeaca));};exports[_0x3695('0x3b')]=function(_0x63771a,_0x441997){logger[_0x3695('0x10')](_0x3695('0x3c'),_0x441997[_0x3695('0x2a')]);var _0x42a960=callsValidation[_0x3695('0x28')](_0x63771a[_0x3695('0x2a')]);if(_0x42a960['length']>0x0){return _0x441997['status'](0x190)[_0x3695('0x29')](_0x42a960);}var _0xea6f22=_0x63771a['body'][_0x3695('0x2b')];var _0x43f6f5=respondWithRpcPromise(_0x3695('0x3d'));var _0x357564=getAgent(_0xea6f22);return Promise[_0x3695('0x1f')]([_0x43f6f5,_0x357564])[_0x3695('0x1e')](function(_0x38d20c){var _0x9a8d31=_0x38d20c[0x0];var _0x520fd3=_0x38d20c[0x1];var _0x29c8a3=_['filter'](_0x9a8d31[_0x3695('0x21')],function(_0x3098f7){return _0x3098f7[_0x3695('0x22')]==_0x520fd3['id'];});return _0x441997[_0x3695('0x17')](0xc8)[_0x3695('0x29')]({'count':_0x29c8a3['length'],'rows':_0x29c8a3});})[_0x3695('0x1c')](handleError(_0x441997));};exports[_0x3695('0x3e')]=function(_0xf18f60,_0x55f673){logger[_0x3695('0x10')](_0x3695('0x3f'),_0xf18f60['body']);var _0x47cd30=conferenceValidation[_0x3695('0x28')](_0xf18f60['body']);if(_0x47cd30['length']>0x0){return _0x55f673[_0x3695('0x17')](0x190)[_0x3695('0x29')](_0x47cd30);}var _0xade517=_0xf18f60[_0x3695('0x2a')][_0x3695('0x2b')];return getAgent(_0xade517)['then'](function(_0x3250f1){logger[_0x3695('0x10')](_0x3695('0x2c'),_0x3250f1['name']);emit(util[_0x3695('0x31')](_0x3695('0x2d'),_0x3250f1[_0x3695('0x16')]),_0x3695('0x40'));return _0x55f673[_0x3695('0x17')](0xc8)[_0x3695('0x29')]({'error':![],'message':'conference\x20executed!'});})[_0x3695('0x1c')](handleError(_0x55f673));};exports[_0x3695('0x41')]=function(_0x41e8de,_0x2551fd){logger[_0x3695('0x10')]('transfer\x20fired:',_0x41e8de[_0x3695('0x2a')]);var _0x19b3e3=transferValidation[_0x3695('0x28')](_0x41e8de[_0x3695('0x2a')]);if(_0x19b3e3[_0x3695('0x24')]>0x0){return _0x2551fd[_0x3695('0x17')](0x190)['json'](_0x19b3e3);}var _0x1effea=_0x41e8de[_0x3695('0x2a')]['userId'];var _0x4e7d7a=_0x41e8de[_0x3695('0x2a')][_0x3695('0x23')];var _0x1b500b=_0x41e8de['body'][_0x3695('0x42')];return getAgent(_0x1effea)[_0x3695('0x1e')](function(_0x1bd95d){logger[_0x3695('0x10')](_0x3695('0x2c'),_0x1bd95d['name']);emit(util[_0x3695('0x31')]('user:%s',_0x1bd95d['name']),'webbar:transfer',{'sessionId':_0x4e7d7a,'transferNumber':_0x1b500b});return _0x2551fd[_0x3695('0x17')](0xc8)[_0x3695('0x29')]({'error':![],'message':_0x3695('0x43')});})[_0x3695('0x1c')](handleError(_0x2551fd));}; \ No newline at end of file +var _0xaf80=['../../mysqldb','../../config/environment','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','error','status','send','name','NotFound','request','then','code','message','result','catch','agent','all','filter','rows','UserId','length','\x20not\x20found!','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','info','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','path','lodash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xaf80,0x1ef));var _0x0af8=function(_0x772400,_0xf0a48f){_0x772400=_0x772400-0x0;var _0x48deec=_0xaf80[_0x772400];return _0x48deec;};'use strict';var path=require(_0x0af8('0x0'));var fs=require('fs');var _=require(_0x0af8('0x1'));var db=require(_0x0af8('0x2'))['db'];var config=require(_0x0af8('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x0af8('0x4')][_0x0af8('0x5')]({'port':0x232a});var logger=require(_0x0af8('0x6'))(_0x0af8('0x7'));var Redis=require(_0x0af8('0x8'));config[_0x0af8('0x9')]=_['defaults'](config['redis'],{'host':_0x0af8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0af8('0x9')]));var Schema=require(_0x0af8('0xb'));var originateValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0xe')]},'callerId':{'type':_0x0af8('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x10')]},'transferNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});function emit(_0x4755cb,_0x325b4c,_0x50d5ba){logger['info'](_0x4755cb,_0x325b4c,JSON['stringify'](_0x50d5ba));io['to'](_0x4755cb)[_0x0af8('0x12')](_0x325b4c,_0x50d5ba);}function handleError(_0x465161){return function(_0x54e946){console[_0x0af8('0x13')](_0x0af8('0x14'),_0x54e946,_0x54e946 instanceof RangeError);logger[_0x0af8('0x15')](_0x54e946['stack']);if(_0x54e946 instanceof RangeError){if(_0x54e946['name']){delete _0x54e946['name'];}_0x465161[_0x0af8('0x16')](0x194)[_0x0af8('0x17')](_0x54e946);}else{if(_0x54e946['name']){delete _0x54e946[_0x0af8('0x18')];}_0x465161['status'](0x1f4)['send'](_0x54e946);}};}function checkError(){return function(_0x40384f){if(!_0x40384f){throw new RangeError(_0x0af8('0x19'));}return _0x40384f;};}function respondWithRpcPromise(_0x29cd4a,_0x5c0dd1){return new BPromise(function(_0x162e95,_0x52778f){var _0x592523=amiClient;return _0x592523[_0x0af8('0x1a')](_0x29cd4a,_0x5c0dd1)[_0x0af8('0x1b')](function(_0x4b0492){if(_0x4b0492[_0x0af8('0x15')]){if(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1c')]===0x1f4){return _0x52778f(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1d')]);}return _0x162e95(_0x4b0492['error']['message']);}else{_0x162e95(_0x4b0492[_0x0af8('0x1e')]);}})[_0x0af8('0x1f')](function(_0x359583){_0x52778f(_0x359583);});});}function getAgent(_0xb43164){return db['User']['findOne']({'where':{'id':_0xb43164,'role':_0x0af8('0x20')}})[_0x0af8('0x1b')](checkError());}function getAgentCheckSession(_0x23a102,_0x140104){return new BPromise(function(_0x2e8853,_0x410216){var _0x318476=respondWithRpcPromise('VoiceChannels');var _0x34aa8b=getAgent(_0x23a102);Promise[_0x0af8('0x21')]([_0x318476,_0x34aa8b])[_0x0af8('0x1b')](function(_0x20eab4){var _0x1b94cf=_0x20eab4[0x0];var _0x231230=_0x20eab4[0x1];var _0x4575b0=_[_0x0af8('0x22')](_0x1b94cf[_0x0af8('0x23')],function(_0x270b49){return _0x270b49[_0x0af8('0x24')]==_0x231230['id']&&_0x270b49['sessionId']==_0x140104;});if(_0x4575b0[_0x0af8('0x25')]==0x1){_0x2e8853(_0x231230);}else{_0x410216(new RangeError('sessionId\x20'+_0x140104+_0x0af8('0x26')));}});});}exports['originate']=function(_0x318ca7,_0x1d2d4f){logger['info'](_0x0af8('0x27'),_0x318ca7[_0x0af8('0x28')]);var _0x34b3e5=originateValidation['validate'](_0x318ca7[_0x0af8('0x28')]);if(_0x34b3e5[_0x0af8('0x25')]>0x0){return _0x1d2d4f[_0x0af8('0x16')](0x190)['json'](_0x34b3e5);}var _0x3c4657=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x29')];var _0x1aded0=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2a')];var _0x4dcdbc=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2b')];var _0x73d193=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2c')];return getAgent(_0x3c4657)[_0x0af8('0x1b')](function(_0x13991a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x13991a[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x13991a['name']),_0x0af8('0x31'),{'callNumber':_0x1aded0,'callerId':_0x4dcdbc,'callbackUrl':_0x73d193});return _0x1d2d4f[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x33')});})[_0x0af8('0x1f')](handleError(_0x1d2d4f));};exports[_0x0af8('0x34')]=function(_0x114ef3,_0x5e971f){logger[_0x0af8('0x2d')](_0x0af8('0x35'),_0x114ef3[_0x0af8('0x28')]);var _0x4d7e1f=hangupValidation[_0x0af8('0xb')](_0x114ef3[_0x0af8('0x28')]);if(_0x4d7e1f[_0x0af8('0x25')]>0x0){return _0x5e971f['status'](0x190)[_0x0af8('0x32')](_0x4d7e1f);}var _0x122382=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x44c198=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x122382)['then'](function(_0x586924){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x586924['name']);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x586924['name']),_0x0af8('0x37'),{'sessionId':_0x44c198});return _0x5e971f['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x38')});})['catch'](handleError(_0x5e971f));};exports[_0x0af8('0x39')]=function(_0x3fefbc,_0x497695){logger[_0x0af8('0x2d')]('answer\x20fired:',_0x3fefbc[_0x0af8('0x28')]);var _0x423eee=answerValidation[_0x0af8('0xb')](_0x3fefbc['body']);if(_0x423eee['length']>0x0){return _0x497695[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x423eee);}var _0x37e54e=_0x3fefbc[_0x0af8('0x28')]['userId'];var _0x1293d8=_0x3fefbc[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x37e54e)['then'](function(_0x15aa0c){logger[_0x0af8('0x2d')]('entityFound:',_0x15aa0c[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x15aa0c['name']),'webbar:answer',{'sessionId':_0x1293d8});return _0x497695['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0x0af8('0x1f')](handleError(_0x497695));};exports['hold']=function(_0x226292,_0x38515e){logger[_0x0af8('0x2d')](_0x0af8('0x3a'),_0x226292[_0x0af8('0x28')]);var _0x562f09=holdValidation['validate'](_0x226292[_0x0af8('0x28')]);if(_0x562f09[_0x0af8('0x25')]>0x0){return _0x38515e[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x562f09);}var _0x3d86e2=_0x226292[_0x0af8('0x28')][_0x0af8('0x29')];var _0x578e52=_0x226292['body'][_0x0af8('0x36')];return getAgent(_0x3d86e2)[_0x0af8('0x1b')](function(_0x394525){logger[_0x0af8('0x2d')]('entityFound:',_0x394525[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x394525[_0x0af8('0x18')]),_0x0af8('0x3b'),{'sessionId':_0x578e52});return _0x38515e[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':_0x0af8('0x3c')});})['catch'](handleError(_0x38515e));};exports[_0x0af8('0x3d')]=function(_0x4a43e3,_0xeddce9){logger[_0x0af8('0x2d')](_0x0af8('0x3e'),_0x4a43e3['body']);var _0x1400eb=unholdValidation[_0x0af8('0xb')](_0x4a43e3['body']);if(_0x1400eb[_0x0af8('0x25')]>0x0){return _0xeddce9[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x1400eb);}var _0x2a3db=_0x4a43e3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x26bdc7=_0x4a43e3['body'][_0x0af8('0x36')];return getAgent(_0x2a3db)[_0x0af8('0x1b')](function(_0x49bd57){logger['info'](_0x0af8('0x2e'),_0x49bd57[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x49bd57[_0x0af8('0x18')]),'webbar:unhold',{'sessionId':_0x26bdc7});return _0xeddce9[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x0af8('0x1f')](handleError(_0xeddce9));};exports[_0x0af8('0x3f')]=function(_0x553625,_0x1cbc96){logger[_0x0af8('0x2d')]('calls\x20fired:',_0x1cbc96[_0x0af8('0x28')]);var _0x47d16c=callsValidation[_0x0af8('0xb')](_0x553625[_0x0af8('0x28')]);if(_0x47d16c['length']>0x0){return _0x1cbc96['status'](0x190)[_0x0af8('0x32')](_0x47d16c);}var _0x18da9c=_0x553625[_0x0af8('0x28')][_0x0af8('0x29')];var _0x524f79=respondWithRpcPromise(_0x0af8('0x40'));var _0x3910fb=getAgent(_0x18da9c);return Promise[_0x0af8('0x21')]([_0x524f79,_0x3910fb])['then'](function(_0x292f6c){var _0xff0eed=_0x292f6c[0x0];var _0x48879c=_0x292f6c[0x1];var _0x521e35=_[_0x0af8('0x22')](_0xff0eed[_0x0af8('0x23')],function(_0x2c2b10){return _0x2c2b10['UserId']==_0x48879c['id'];});return _0x1cbc96[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'count':_0x521e35[_0x0af8('0x25')],'rows':_0x521e35});})[_0x0af8('0x1f')](handleError(_0x1cbc96));};exports[_0x0af8('0x41')]=function(_0x5c3ab9,_0x143cf){logger['info'](_0x0af8('0x42'),_0x5c3ab9['body']);var _0x2d434a=conferenceValidation[_0x0af8('0xb')](_0x5c3ab9[_0x0af8('0x28')]);if(_0x2d434a[_0x0af8('0x25')]>0x0){return _0x143cf[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x2d434a);}var _0x7c1b83=_0x5c3ab9[_0x0af8('0x28')][_0x0af8('0x29')];return getAgent(_0x7c1b83)['then'](function(_0x3ff94a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x3ff94a['name']);emit(util['format'](_0x0af8('0x30'),_0x3ff94a[_0x0af8('0x18')]),_0x0af8('0x43'));return _0x143cf[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x44')});})['catch'](handleError(_0x143cf));};exports[_0x0af8('0x45')]=function(_0x5b1c3a,_0x1d496d){logger[_0x0af8('0x2d')]('transfer\x20fired:',_0x5b1c3a['body']);var _0x563d0d=transferValidation[_0x0af8('0xb')](_0x5b1c3a[_0x0af8('0x28')]);if(_0x563d0d[_0x0af8('0x25')]>0x0){return _0x1d496d[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x563d0d);}var _0x2ee73e=_0x5b1c3a['body'][_0x0af8('0x29')];var _0x4ba986=_0x5b1c3a[_0x0af8('0x28')]['sessionId'];var _0x27cd1c=_0x5b1c3a[_0x0af8('0x28')]['transferNumber'];return getAgent(_0x2ee73e)[_0x0af8('0x1b')](function(_0x1b06fa){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x1b06fa[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x1b06fa[_0x0af8('0x18')]),_0x0af8('0x46'),{'sessionId':_0x4ba986,'transferNumber':_0x27cd1c});return _0x1d496d[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x1d496d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 15c5ce9..e7e8a06 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 _0x2ef3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','/:id/notify','/:id/send','send','put','update','delete','removeAnswers'];(function(_0x4e2bb4,_0x12e5c6){var _0x307dfd=function(_0x4398d7){while(--_0x4398d7){_0x4e2bb4['push'](_0x4e2bb4['shift']());}};_0x307dfd(++_0x12e5c6);}(_0x2ef3,0xba));var _0x32ef=function(_0x347cd0,_0xb2fbb2){_0x347cd0=_0x347cd0-0x0;var _0x41133c=_0x2ef3[_0x347cd0];return _0x41133c;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['get'](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['get'](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['getApplications']);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x15')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x16')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x32ef('0x17')]);router[_0x32ef('0x15')](_0x32ef('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x32ef('0x15')](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['addApplications']);router[_0x32ef('0x15')](_0x32ef('0x18'),controller['notify']);router[_0x32ef('0x15')](_0x32ef('0x19'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1a')]);router[_0x32ef('0x1b')](_0x32ef('0xd'),auth['isAuthenticated'](),controller[_0x32ef('0x1c')]);router['delete'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller['destroy']);router[_0x32ef('0x1d')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller['removeDispositions']);router['delete'](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1e')]);router['delete']('/:id/users',auth[_0x32ef('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6343=['/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeAnswers','removeAgents','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers'];(function(_0x597275,_0x112b28){var _0x4874e6=function(_0x53caff){while(--_0x53caff){_0x597275['push'](_0x597275['shift']());}};_0x4874e6(++_0x112b28);}(_0x6343,0x168));var _0x3634=function(_0x37f173,_0x2508f9){_0x37f173=_0x37f173-0x0;var _0x248cfb=_0x6343[_0x37f173];return _0x248cfb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var controller=require('./whatsappAccount.controller');router[_0x3634('0x4')]('/',auth[_0x3634('0x5')](),controller['index']);router[_0x3634('0x4')](_0x3634('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x3634('0x4')](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x8')]);router[_0x3634('0x4')](_0x3634('0x9'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x3634('0x4')](_0x3634('0xa'),auth['isAuthenticated'](),controller[_0x3634('0xb')]);router[_0x3634('0x4')](_0x3634('0xc'),auth[_0x3634('0x5')](),controller[_0x3634('0xd')]);router[_0x3634('0x4')](_0x3634('0xe'),auth[_0x3634('0x5')](),controller[_0x3634('0xf')]);router[_0x3634('0x10')]('/',auth[_0x3634('0x5')](),controller[_0x3634('0x11')]);router[_0x3634('0x10')](_0x3634('0x9'),auth['isAuthenticated'](),controller[_0x3634('0x12')]);router['post'](_0x3634('0xa'),auth[_0x3634('0x5')](),controller[_0x3634('0x13')]);router[_0x3634('0x10')](_0x3634('0xc'),auth['isAuthenticated'](),controller[_0x3634('0x14')]);router['post']('/:id/applications',auth[_0x3634('0x5')](),controller['addApplications']);router[_0x3634('0x10')](_0x3634('0x15'),controller[_0x3634('0x16')]);router['post'](_0x3634('0x17'),auth[_0x3634('0x5')](),controller['send']);router[_0x3634('0x18')]('/:id',auth[_0x3634('0x5')](),controller[_0x3634('0x19')]);router['delete'](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x1a')]);router['delete'](_0x3634('0x9'),auth[_0x3634('0x5')](),controller['removeDispositions']);router[_0x3634('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3634('0x1c')]);router[_0x3634('0x1b')]('/:id/users',auth[_0x3634('0x5')](),controller[_0x3634('0x1d')]);module[_0x3634('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b3db9cb..1615870 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 _0x0ec6=['generate','ENUM','twilio','sinch','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','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','STRING','name'];(function(_0x4105a8,_0x198324){var _0x553f0c=function(_0x3720f5){while(--_0x3720f5){_0x4105a8['push'](_0x4105a8['shift']());}};_0x553f0c(++_0x198324);}(_0x0ec6,0x128));var _0x60ec=function(_0x27b149,_0x1a1b11){_0x27b149=_0x27b149-0x0;var _0x446f5c=_0x0ec6[_0x27b149];return _0x446f5c;};'use strict';var Sequelize=require(_0x60ec('0x0'));var rs=require(_0x60ec('0x1'));module['exports']={'name':{'type':Sequelize[_0x60ec('0x2')],'unique':_0x60ec('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x60ec('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x60ec('0x2')],'defaultValue':function(){return rs[_0x60ec('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x60ec('0x5')](_0x60ec('0x6'),_0x60ec('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x60ec('0x2')]},'notificationTemplate':{'type':Sequelize[_0x60ec('0x8')],'defaultValue':function(){return _0x60ec('0x9');}},'notificationSound':{'type':Sequelize[_0x60ec('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x60ec('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x60ec('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x60ec('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x60ec('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x60ec('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60ec('0xb')],'comment':_0x60ec('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x60ec('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x350d02){if(!_0x350d02){this['setDataValue'](_0x60ec('0xd'),null);}this[_0x60ec('0xe')]('mandatoryDisposition',_0x350d02);}},'description':{'type':Sequelize[_0x60ec('0x2')]}}; \ No newline at end of file +var _0x0983=['generate','ENUM','sinch','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x5acae7,_0x2b246f){var _0x53f922=function(_0x4c8a0f){while(--_0x4c8a0f){_0x5acae7['push'](_0x5acae7['shift']());}};_0x53f922(++_0x2b246f);}(_0x0983,0x167));var _0x3098=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0983[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x3098('0x0'));var rs=require(_0x3098('0x1'));module[_0x3098('0x2')]={'name':{'type':Sequelize[_0x3098('0x3')],'unique':_0x3098('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x3098('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x3098('0x3')],'defaultValue':function(){return rs[_0x3098('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3098('0x6')]('twilio',_0x3098('0x7'))},'accountSid':{'type':Sequelize[_0x3098('0x3')]},'baseUrl':{'type':Sequelize[_0x3098('0x3')]},'authToken':{'type':Sequelize[_0x3098('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3098('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3098('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3098('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3098('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3098('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3098('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3098('0x8')],'defaultValue':![],'comment':_0x3098('0xa'),'set':function(_0x2f04dc){if(!_0x2f04dc){this[_0x3098('0xb')](_0x3098('0xc'),null);}this[_0x3098('0xb')](_0x3098('0xd'),_0x2f04dc);}},'description':{'type':Sequelize[_0x3098('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 005a1bc..c0baceb 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 _0x660d=['UserId','unshift','*,*,*,*','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','List','Contacts','out','dataValues','Messages','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','jayson/promise','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','name','send','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','show','params','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','Pause','describe','addDisposition','WhatsappAccountId','Disposition','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','orderBy','Applications','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','whatsapp:','Body','notifications','messageId','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','contact','WhatsappInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','ContactId','AttachmentId'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x660d,0xd3));var _0xd660=function(_0x1c1128,_0x1dcb18){_0x1c1128=_0x1c1128-0x0;var _0x123e8f=_0x660d[_0x1c1128];return _0x123e8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd660('0x0'));var zipdir=require(_0xd660('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd660('0x2'));var moment=require('moment');var BPromise=require(_0xd660('0x3'));var Mustache=require(_0xd660('0x4'));var util=require(_0xd660('0x5'));var path=require(_0xd660('0x6'));var sox=require(_0xd660('0x7'));var csv=require(_0xd660('0x8'));var ejs=require(_0xd660('0x9'));var fs=require('fs');var fs_extra=require(_0xd660('0xa'));var _=require(_0xd660('0xb'));var squel=require(_0xd660('0xc'));var crypto=require('crypto');var jsforce=require(_0xd660('0xd'));var deskjs=require(_0xd660('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd660('0xf'));var Papa=require(_0xd660('0x10'));var Redis=require(_0xd660('0x11'));var authService=require(_0xd660('0x12'));var qs=require(_0xd660('0x13'));var as=require(_0xd660('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd660('0x15'));var utils=require(_0xd660('0x16'));var config=require(_0xd660('0x17'));var licenseUtil=require(_0xd660('0x18'));var db=require(_0xd660('0x19'))['db'];config['redis']=_[_0xd660('0x1a')](config['redis'],{'host':_0xd660('0x1b'),'port':0x18eb});var socket=require(_0xd660('0x1c'))(new Redis(config[_0xd660('0x1d')]));require(_0xd660('0x1e'))[_0xd660('0x1f')](socket);var jayson=require(_0xd660('0x20'));var client=jayson['client'][_0xd660('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x42a6ea,_0x4febdf,_0x57ef83,_0x934749){return new BPromise(function(_0x323466,_0xc7e7df){var _0x47f763=_0x934749||client;return _0x47f763[_0xd660('0x22')](_0x42a6ea,_0x57ef83)[_0xd660('0x23')](function(_0x21e26a){logger['info'](_0xd660('0x24'),_0x4febdf,_0xd660('0x25'));logger[_0xd660('0x26')](_0xd660('0x27'),_0x4febdf,_0xd660('0x25'),JSON[_0xd660('0x28')](_0x21e26a));if(_0x21e26a[_0xd660('0x29')]){if(_0x21e26a[_0xd660('0x29')][_0xd660('0x2a')]===0x1f4){logger[_0xd660('0x29')](_0xd660('0x24'),_0x4febdf,_0x21e26a[_0xd660('0x29')][_0xd660('0x2b')]);return _0xc7e7df(_0x21e26a[_0xd660('0x29')][_0xd660('0x2b')]);}logger['error'](_0xd660('0x24'),_0x4febdf,_0x21e26a[_0xd660('0x29')][_0xd660('0x2b')]);return _0x323466(_0x21e26a[_0xd660('0x29')][_0xd660('0x2b')]);}else{logger[_0xd660('0x2c')](_0xd660('0x24'),_0x4febdf,'request\x20sent');_0x323466(_0x21e26a[_0xd660('0x2d')][_0xd660('0x2b')]);}})[_0xd660('0x2e')](function(_0x2d8a98){logger['error'](_0xd660('0x24'),_0x4febdf,_0x2d8a98);_0xc7e7df(_0x2d8a98);});});}function respondWithStatusCode(_0x52087d,_0x624a7f){_0x624a7f=_0x624a7f||0xcc;return function(_0x1898bb){if(_0x1898bb){return _0x52087d['sendStatus'](_0x624a7f);}return _0x52087d[_0xd660('0x2f')](_0x624a7f)[_0xd660('0x30')]();};}function respondWithResult(_0x1b344a,_0x38ae96){_0x38ae96=_0x38ae96||0xc8;return function(_0x29c95c){if(_0x29c95c){return _0x1b344a['status'](_0x38ae96)[_0xd660('0x31')](_0x29c95c);}};}function respondWithFilteredResult(_0x4e6956,_0x38b014){return function(_0x25fd87){if(_0x25fd87){var _0x1f6596=typeof _0x38b014[_0xd660('0x32')]===_0xd660('0x33')&&typeof _0x38b014[_0xd660('0x34')]===_0xd660('0x33');var _0x46bca5=_0x25fd87[_0xd660('0x35')];var _0x23a340=_0x1f6596?0x0:_0x38b014[_0xd660('0x32')];var _0x10db41=_0x1f6596?_0x25fd87[_0xd660('0x35')]:_0x38b014[_0xd660('0x32')]+_0x38b014[_0xd660('0x34')];var _0x14992a;if(_0x10db41>=_0x46bca5){_0x10db41=_0x46bca5;_0x14992a=0xc8;}else{_0x14992a=0xce;}_0x4e6956[_0xd660('0x2f')](_0x14992a);return _0x4e6956[_0xd660('0x36')](_0xd660('0x37'),_0x23a340+'-'+_0x10db41+'/'+_0x46bca5)['json'](_0x25fd87);}return null;};}function patchUpdates(_0x35d6b3){return function(_0x268ec1){try{jsonpatch['apply'](_0x268ec1,_0x35d6b3,!![]);}catch(_0x4e332a){return BPromise[_0xd660('0x38')](_0x4e332a);}return _0x268ec1['save']();};}function saveUpdates(_0x24ffb7,_0x34a629){return function(_0x2abd18){if(_0x2abd18){return _0x2abd18[_0xd660('0x39')](_0x24ffb7)[_0xd660('0x23')](function(_0x3f9618){return _0x3f9618;});}return null;};}function removeEntity(_0x2dec32,_0x5efbec){return function(_0x3fb5bc){if(_0x3fb5bc){return _0x3fb5bc[_0xd660('0x3a')]()[_0xd660('0x23')](function(){var _0x504a39=_0x3fb5bc[_0xd660('0x3b')]({'plain':!![]});var _0x251eed=_0xd660('0x3c');return db[_0xd660('0x3d')][_0xd660('0x3a')]({'where':{'type':_0x251eed,'resourceId':_0x504a39['id']}})[_0xd660('0x23')](function(){return _0x3fb5bc;});})['then'](function(){_0x2dec32['status'](0xcc)[_0xd660('0x30')]();});}};}function handleEntityNotFound(_0x2beb16,_0xcbd26a){return function(_0x2944fc){if(!_0x2944fc){_0x2beb16[_0xd660('0x3e')](0x194);}return _0x2944fc;};}function handleError(_0x49895a,_0x45a686){_0x45a686=_0x45a686||0x1f4;return function(_0x56fb3f){logger[_0xd660('0x29')](_0x56fb3f['stack']);if(_0x56fb3f['name']){delete _0x56fb3f[_0xd660('0x3f')];}_0x49895a[_0xd660('0x2f')](_0x45a686)[_0xd660('0x40')](_0x56fb3f);};}exports['index']=function(_0x5a991b,_0x3f3d90){var _0x44bdf2={'include':[{'model':db['Pause'],'as':_0xd660('0x41')}]},_0x20ccdc={},_0x320825={'count':0x0,'rows':[]};var _0x547dce=_[_0xd660('0x42')](db[_0xd660('0x43')][_0xd660('0x44')],function(_0x426e85){return{'name':_0x426e85['fieldName'],'type':_0x426e85['type'][_0xd660('0x45')]};});_0x20ccdc[_0xd660('0x46')]=_[_0xd660('0x42')](_0x547dce,'name');_0x20ccdc[_0xd660('0x47')]=_[_0xd660('0x48')](_0x5a991b[_0xd660('0x47')]);_0x20ccdc[_0xd660('0x49')]=_[_0xd660('0x4a')](_0x20ccdc[_0xd660('0x46')],_0x20ccdc[_0xd660('0x47')]);_0x44bdf2[_0xd660('0x4b')]=_[_0xd660('0x4a')](_0x20ccdc['model'],qs[_0xd660('0x4c')](_0x5a991b[_0xd660('0x47')]['fields']));_0x44bdf2[_0xd660('0x4b')]=_0x44bdf2[_0xd660('0x4b')][_0xd660('0x4d')]?_0x44bdf2[_0xd660('0x4b')]:_0x20ccdc['model'];if(!_0x5a991b[_0xd660('0x47')][_0xd660('0x4e')]('nolimit')){_0x44bdf2[_0xd660('0x34')]=qs[_0xd660('0x34')](_0x5a991b[_0xd660('0x47')][_0xd660('0x34')]);_0x44bdf2['offset']=qs[_0xd660('0x32')](_0x5a991b[_0xd660('0x47')][_0xd660('0x32')]);}_0x44bdf2[_0xd660('0x4f')]=qs[_0xd660('0x50')](_0x5a991b[_0xd660('0x47')][_0xd660('0x50')]);_0x44bdf2[_0xd660('0x51')]=qs[_0xd660('0x49')](_[_0xd660('0x52')](_0x5a991b[_0xd660('0x47')],_0x20ccdc[_0xd660('0x49')]),_0x547dce);if(_0x5a991b['query'][_0xd660('0x53')]){_0x44bdf2[_0xd660('0x51')]=_[_0xd660('0x54')](_0x44bdf2[_0xd660('0x51')],{'$or':_[_0xd660('0x42')](_0x547dce,function(_0x3f29a4){if(_0x3f29a4[_0xd660('0x55')]!==_0xd660('0x56')){var _0x2298c4={};_0x2298c4[_0x3f29a4['name']]={'$like':'%'+_0x5a991b[_0xd660('0x47')]['filter']+'%'};return _0x2298c4;}})});}_0x44bdf2=_['merge']({},_0x44bdf2,_0x5a991b['options']);var _0x53defb={'where':_0x44bdf2[_0xd660('0x51')]};return db['WhatsappAccount'][_0xd660('0x35')](_0x53defb)[_0xd660('0x23')](function(_0x4c7b5a){_0x320825['count']=_0x4c7b5a;if(_0x5a991b[_0xd660('0x47')]['includeAll']){_0x44bdf2[_0xd660('0x57')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xd660('0x58')](_0x44bdf2);})['then'](function(_0x53a3fb){_0x320825[_0xd660('0x59')]=_0x53a3fb;return _0x320825;})['then'](respondWithFilteredResult(_0x3f3d90,_0x44bdf2))[_0xd660('0x2e')](handleError(_0x3f3d90,null));};exports[_0xd660('0x5a')]=function(_0x80d8a2,_0x4eda83){var _0x1884c5={'raw':![],'where':{'id':_0x80d8a2[_0xd660('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0xd660('0x41')}]},_0x27e8f2={};_0x27e8f2[_0xd660('0x46')]=_[_0xd660('0x48')](db[_0xd660('0x43')][_0xd660('0x44')]);_0x27e8f2[_0xd660('0x47')]=_[_0xd660('0x48')](_0x80d8a2[_0xd660('0x47')]);_0x27e8f2[_0xd660('0x49')]=_[_0xd660('0x4a')](_0x27e8f2[_0xd660('0x46')],_0x27e8f2[_0xd660('0x47')]);_0x1884c5['attributes']=_[_0xd660('0x4a')](_0x27e8f2[_0xd660('0x46')],qs[_0xd660('0x4c')](_0x80d8a2['query']['fields']));_0x1884c5[_0xd660('0x4b')]=_0x1884c5[_0xd660('0x4b')]['length']?_0x1884c5[_0xd660('0x4b')]:_0x27e8f2[_0xd660('0x46')];if(_0x80d8a2[_0xd660('0x47')][_0xd660('0x5c')]){_0x1884c5[_0xd660('0x57')]=[{'all':!![]}];}_0x1884c5=_[_0xd660('0x54')]({},_0x1884c5,_0x80d8a2[_0xd660('0x5d')]);return db[_0xd660('0x43')]['find'](_0x1884c5)[_0xd660('0x23')](handleEntityNotFound(_0x4eda83,null))['then'](respondWithResult(_0x4eda83,null))[_0xd660('0x2e')](handleError(_0x4eda83,null));};exports[_0xd660('0x5e')]=function(_0x1d9c5c,_0x7e20eb){return db[_0xd660('0x43')][_0xd660('0x5e')](_0x1d9c5c['body'],{})[_0xd660('0x23')](function(_0x48e0e7){var _0x59f8a9=_0x1d9c5c[_0xd660('0x5f')]['get']({'plain':!![]});if(!_0x59f8a9)throw new Error(_0xd660('0x60'));if(_0x59f8a9[_0xd660('0x61')]===_0xd660('0x5f')){var _0x390c38=_0x48e0e7['get']({'plain':!![]});var _0x53ebcf='WhatsappAccounts';return db[_0xd660('0x62')]['find']({'where':{'name':_0x53ebcf,'userProfileId':_0x59f8a9[_0xd660('0x63')]},'raw':!![]})[_0xd660('0x23')](function(_0x15f93b){if(_0x15f93b&&_0x15f93b[_0xd660('0x64')]===0x0){return db[_0xd660('0x3d')][_0xd660('0x5e')]({'name':_0x390c38['name'],'resourceId':_0x390c38['id'],'type':_0x15f93b[_0xd660('0x3f')],'sectionId':_0x15f93b['id']},{})[_0xd660('0x23')](function(){return _0x48e0e7;});}else{return _0x48e0e7;}})['catch'](function(_0x130aa4){logger[_0xd660('0x29')](_0xd660('0x65'),_0x130aa4);throw _0x130aa4;});}return _0x48e0e7;})[_0xd660('0x23')](respondWithResult(_0x7e20eb,0xc9))[_0xd660('0x2e')](handleError(_0x7e20eb,null));};exports[_0xd660('0x39')]=function(_0x24bd66,_0x49fc37){if(_0x24bd66[_0xd660('0x66')]['id']){delete _0x24bd66[_0xd660('0x66')]['id'];}return db[_0xd660('0x43')][_0xd660('0x67')]({'where':{'id':_0x24bd66[_0xd660('0x5b')]['id']},'include':[{'model':db[_0xd660('0x68')],'as':'mandatoryDispositionPause'}]})[_0xd660('0x23')](handleEntityNotFound(_0x49fc37,null))['then'](saveUpdates(_0x24bd66[_0xd660('0x66')],null))[_0xd660('0x23')](respondWithResult(_0x49fc37,null))[_0xd660('0x2e')](handleError(_0x49fc37,null));};exports[_0xd660('0x3a')]=function(_0x1898bc,_0x466d96){return db[_0xd660('0x43')][_0xd660('0x67')]({'where':{'id':_0x1898bc[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x466d96,null))['then'](removeEntity(_0x466d96,null))[_0xd660('0x2e')](handleError(_0x466d96,null));};exports[_0xd660('0x69')]=function(_0x454018,_0x47a345){return db['WhatsappAccount'][_0xd660('0x69')]()[_0xd660('0x23')](respondWithResult(_0x47a345,null))['catch'](handleError(_0x47a345,null));};exports[_0xd660('0x6a')]=function(_0x512dd4,_0x5b8003,_0x2eaf4e){if(_0x512dd4[_0xd660('0x66')]['id']){delete _0x512dd4[_0xd660('0x66')]['id'];}return db[_0xd660('0x43')][_0xd660('0x67')]({'where':{'id':_0x512dd4[_0xd660('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5b8003,null))['then'](function(_0x46e759){if(_0x46e759){_0x512dd4[_0xd660('0x66')][_0xd660('0x6b')]=_0x46e759['id'];return db[_0xd660('0x6c')][_0xd660('0x5e')](_0x512dd4[_0xd660('0x66')]);}})[_0xd660('0x23')](respondWithResult(_0x5b8003,null))[_0xd660('0x2e')](handleError(_0x5b8003,null));};exports['getDispositions']=function(_0xf994a5,_0x4bf81f,_0x450ff8){var _0x1600d3={'raw':![],'where':{}};var _0x2c35b2={};var _0xd72d0={'count':0x0,'rows':[]};return db[_0xd660('0x43')][_0xd660('0x6d')]({'where':{'id':_0xf994a5[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x4bf81f,null))['then'](function(_0x483668){if(_0x483668){_0x2c35b2[_0xd660('0x46')]=_['keys'](db[_0xd660('0x6c')][_0xd660('0x44')]);_0x2c35b2[_0xd660('0x47')]=_[_0xd660('0x48')](_0xf994a5[_0xd660('0x47')]);_0x2c35b2[_0xd660('0x49')]=_[_0xd660('0x4a')](_0x2c35b2[_0xd660('0x46')],_0x2c35b2[_0xd660('0x47')]);_0x1600d3['attributes']=_[_0xd660('0x4a')](_0x2c35b2[_0xd660('0x46')],qs[_0xd660('0x4c')](_0xf994a5[_0xd660('0x47')][_0xd660('0x4c')]));_0x1600d3[_0xd660('0x4b')]=_0x1600d3['attributes'][_0xd660('0x4d')]?_0x1600d3[_0xd660('0x4b')]:_0x2c35b2[_0xd660('0x46')];if(!_0xf994a5[_0xd660('0x47')][_0xd660('0x4e')](_0xd660('0x6e'))){_0x1600d3[_0xd660('0x34')]=qs['limit'](_0xf994a5['query']['limit']);_0x1600d3['offset']=qs['offset'](_0xf994a5['query'][_0xd660('0x32')]);}_0x1600d3[_0xd660('0x4f')]=qs[_0xd660('0x50')](_0xf994a5[_0xd660('0x47')][_0xd660('0x50')]);_0x1600d3[_0xd660('0x51')]=qs['filters'](_[_0xd660('0x52')](_0xf994a5[_0xd660('0x47')],_0x2c35b2[_0xd660('0x49')]));_0x1600d3[_0xd660('0x51')][_0xd660('0x6b')]=_0x483668['id'];if(_0xf994a5[_0xd660('0x47')]['filter']){_0x1600d3[_0xd660('0x51')]=_[_0xd660('0x54')](_0x1600d3[_0xd660('0x51')],{'$or':_[_0xd660('0x42')](_0x1600d3[_0xd660('0x4b')],function(_0x3f7dbc){var _0x1cf25e={};_0x1cf25e[_0x3f7dbc]={'$like':'%'+_0xf994a5[_0xd660('0x47')]['filter']+'%'};return _0x1cf25e;})});}_0x1600d3=_[_0xd660('0x54')]({},_0x1600d3,_0xf994a5[_0xd660('0x5d')]);return db['Disposition'][_0xd660('0x35')]({'where':_0x1600d3[_0xd660('0x51')]})['then'](function(_0x5a49c3){_0xd72d0[_0xd660('0x35')]=_0x5a49c3;if(_0xf994a5[_0xd660('0x47')][_0xd660('0x5c')]){_0x1600d3[_0xd660('0x57')]=[{'all':!![]}];}return db['Disposition'][_0xd660('0x58')](_0x1600d3);})[_0xd660('0x23')](function(_0x2d3cab){_0xd72d0['rows']=_0x2d3cab;return _0xd72d0;});}})[_0xd660('0x23')](respondWithFilteredResult(_0x4bf81f,_0x1600d3))[_0xd660('0x2e')](handleError(_0x4bf81f,null));};exports[_0xd660('0x6f')]=function(_0xcd4bbb,_0x511860,_0x16c1ed){return db['WhatsappAccount'][_0xd660('0x67')]({'where':{'id':_0xcd4bbb[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x511860,null))[_0xd660('0x23')](function(_0x5b03fc){if(_0x5b03fc){return _0x5b03fc[_0xd660('0x6f')](_0xcd4bbb[_0xd660('0x47')][_0xd660('0x70')]);}})['then'](respondWithStatusCode(_0x511860,null))[_0xd660('0x2e')](handleError(_0x511860,null));};exports[_0xd660('0x71')]=function(_0x1d3625,_0x5c1d13,_0x5a29e4){if(_0x1d3625[_0xd660('0x66')]['id']){delete _0x1d3625[_0xd660('0x66')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x1d3625[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x5c1d13,null))['then'](function(_0x4729c3){if(_0x4729c3){_0x1d3625[_0xd660('0x66')]['WhatsappAccountId']=_0x4729c3['id'];return db[_0xd660('0x72')][_0xd660('0x5e')](_0x1d3625[_0xd660('0x66')]);}})[_0xd660('0x23')](respondWithResult(_0x5c1d13,null))[_0xd660('0x2e')](handleError(_0x5c1d13,null));};exports[_0xd660('0x73')]=function(_0x381916,_0x4eb0f,_0x46975e){var _0xee42e3={'raw':![],'where':{}};var _0x543538={};var _0x2b7bb6={'count':0x0,'rows':[]};return db[_0xd660('0x43')][_0xd660('0x6d')]({'where':{'id':_0x381916[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x4eb0f,null))['then'](function(_0x5cad1c){if(_0x5cad1c){_0x543538['model']=_[_0xd660('0x48')](db[_0xd660('0x72')][_0xd660('0x44')]);_0x543538[_0xd660('0x47')]=_[_0xd660('0x48')](_0x381916[_0xd660('0x47')]);_0x543538[_0xd660('0x49')]=_[_0xd660('0x4a')](_0x543538[_0xd660('0x46')],_0x543538[_0xd660('0x47')]);_0xee42e3[_0xd660('0x4b')]=_[_0xd660('0x4a')](_0x543538[_0xd660('0x46')],qs[_0xd660('0x4c')](_0x381916[_0xd660('0x47')][_0xd660('0x4c')]));_0xee42e3[_0xd660('0x4b')]=_0xee42e3[_0xd660('0x4b')]['length']?_0xee42e3['attributes']:_0x543538[_0xd660('0x46')];if(!_0x381916[_0xd660('0x47')][_0xd660('0x4e')]('nolimit')){_0xee42e3['limit']=qs[_0xd660('0x34')](_0x381916[_0xd660('0x47')]['limit']);_0xee42e3[_0xd660('0x32')]=qs[_0xd660('0x32')](_0x381916['query'][_0xd660('0x32')]);}_0xee42e3[_0xd660('0x4f')]=qs[_0xd660('0x50')](_0x381916[_0xd660('0x47')][_0xd660('0x50')]);_0xee42e3[_0xd660('0x51')]=qs[_0xd660('0x49')](_[_0xd660('0x52')](_0x381916[_0xd660('0x47')],_0x543538[_0xd660('0x49')]));_0xee42e3[_0xd660('0x51')][_0xd660('0x6b')]=_0x5cad1c['id'];if(_0x381916[_0xd660('0x47')]['filter']){_0xee42e3[_0xd660('0x51')]=_['merge'](_0xee42e3['where'],{'$or':_[_0xd660('0x42')](_0xee42e3['attributes'],function(_0x793501){var _0x1d498e={};_0x1d498e[_0x793501]={'$like':'%'+_0x381916[_0xd660('0x47')][_0xd660('0x53')]+'%'};return _0x1d498e;})});}_0xee42e3=_[_0xd660('0x54')]({},_0xee42e3,_0x381916[_0xd660('0x5d')]);return db[_0xd660('0x72')]['count']({'where':_0xee42e3[_0xd660('0x51')]})[_0xd660('0x23')](function(_0x58f77f){_0x2b7bb6[_0xd660('0x35')]=_0x58f77f;if(_0x381916[_0xd660('0x47')][_0xd660('0x5c')]){_0xee42e3[_0xd660('0x57')]=[{'all':!![]}];}return db[_0xd660('0x72')]['findAll'](_0xee42e3);})[_0xd660('0x23')](function(_0x5e575c){_0x2b7bb6[_0xd660('0x59')]=_0x5e575c;return _0x2b7bb6;});}})['then'](respondWithFilteredResult(_0x4eb0f,_0xee42e3))[_0xd660('0x2e')](handleError(_0x4eb0f,null));};exports[_0xd660('0x74')]=function(_0x1e76ea,_0x51d019,_0x1342ac){return db[_0xd660('0x43')][_0xd660('0x67')]({'where':{'id':_0x1e76ea['params']['id']}})['then'](handleEntityNotFound(_0x51d019,null))[_0xd660('0x23')](function(_0x5da23c){if(_0x5da23c){return _0x5da23c['removeAnswers'](_0x1e76ea['query'][_0xd660('0x70')]);}})[_0xd660('0x23')](respondWithStatusCode(_0x51d019,null))[_0xd660('0x2e')](handleError(_0x51d019,null));};exports['addAgents']=function(_0x222b5c,_0x4c5c24,_0x5b308c){return db['WhatsappAccount'][_0xd660('0x67')]({'where':{'id':_0x222b5c[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x4c5c24,null))[_0xd660('0x23')](function(_0x517aaa){if(_0x517aaa){return _0x517aaa['addAgents'](_0x222b5c[_0xd660('0x66')][_0xd660('0x70')],_[_0xd660('0x75')](_0x222b5c['body'],[_0xd660('0x70'),'id'])||{})['spread'](function(_0x23c639){for(var _0x27be0a=0x0;_0x27be0a<_0x222b5c[_0xd660('0x66')][_0xd660('0x70')]['length'];_0x27be0a+=0x1){socket[_0xd660('0x76')](_0xd660('0x77'),{'UserId':Number(_0x222b5c[_0xd660('0x66')]['ids'][_0x27be0a]),'WhatsappAccountId':Number(_0x222b5c[_0xd660('0x5b')]['id'])});}return _0x23c639;});}})['then'](respondWithResult(_0x4c5c24,null))[_0xd660('0x2e')](handleError(_0x4c5c24,null));};exports[_0xd660('0x78')]=function(_0x43d9e1,_0x5bbe82,_0x366fac){return db['WhatsappAccount'][_0xd660('0x67')]({'where':{'id':_0x43d9e1[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x5bbe82,null))[_0xd660('0x23')](function(_0x4897b9){if(_0x4897b9){return _0x4897b9[_0xd660('0x78')](_0x43d9e1[_0xd660('0x47')]['ids'])['then'](function(){if(_['isArray'](_0x43d9e1[_0xd660('0x47')][_0xd660('0x70')])){for(var _0x4d1f28=0x0;_0x4d1f28<_0x43d9e1[_0xd660('0x47')][_0xd660('0x70')]['length'];_0x4d1f28+=0x1){socket[_0xd660('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x43d9e1[_0xd660('0x47')][_0xd660('0x70')][_0x4d1f28]),'WhatsappAccountId':Number(_0x43d9e1['params']['id'])});}}else{socket[_0xd660('0x76')](_0xd660('0x79'),{'UserId':Number(_0x43d9e1[_0xd660('0x47')][_0xd660('0x70')]),'WhatsappAccountId':Number(_0x43d9e1[_0xd660('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x5bbe82,null))[_0xd660('0x2e')](handleError(_0x5bbe82,null));};exports[_0xd660('0x7a')]=function(_0x1b3b5c,_0x49db1b,_0x797cde){var _0x160206={};var _0x4ce2de={};var _0x9a5cea;var _0x3fec66;return db[_0xd660('0x43')][_0xd660('0x6d')]({'where':{'id':_0x1b3b5c[_0xd660('0x5b')]['id']}})[_0xd660('0x23')](handleEntityNotFound(_0x49db1b,null))[_0xd660('0x23')](function(_0x4d7551){if(_0x4d7551){_0x9a5cea=_0x4d7551;_0x4ce2de[_0xd660('0x46')]=_[_0xd660('0x48')](db[_0xd660('0x7b')][_0xd660('0x44')]);_0x4ce2de['query']=_[_0xd660('0x48')](_0x1b3b5c['query']);_0x4ce2de[_0xd660('0x49')]=_[_0xd660('0x4a')](_0x4ce2de[_0xd660('0x46')],_0x4ce2de['query']);_0x160206[_0xd660('0x4b')]=_[_0xd660('0x4a')](_0x4ce2de[_0xd660('0x46')],qs['fields'](_0x1b3b5c[_0xd660('0x47')][_0xd660('0x4c')]));_0x160206[_0xd660('0x4b')]=_0x160206[_0xd660('0x4b')]['length']?_0x160206['attributes']:_0x4ce2de[_0xd660('0x46')];_0x160206[_0xd660('0x4f')]=qs[_0xd660('0x50')](_0x1b3b5c[_0xd660('0x47')][_0xd660('0x50')]);_0x160206[_0xd660('0x51')]=qs[_0xd660('0x49')](_[_0xd660('0x52')](_0x1b3b5c['query'],_0x4ce2de[_0xd660('0x49')]));if(_0x1b3b5c[_0xd660('0x47')][_0xd660('0x53')]){_0x160206[_0xd660('0x51')]=_[_0xd660('0x54')](_0x160206[_0xd660('0x51')],{'$or':_['map'](_0x160206['attributes'],function(_0x5a9dcf){var _0x1ae45d={};_0x1ae45d[_0x5a9dcf]={'$like':'%'+_0x1b3b5c[_0xd660('0x47')][_0xd660('0x53')]+'%'};return _0x1ae45d;})});}_0x160206=_[_0xd660('0x54')]({},_0x160206,_0x1b3b5c[_0xd660('0x5d')]);return _0x9a5cea['getAgents'](_0x160206);}})[_0xd660('0x23')](function(_0x2075ad){if(_0x2075ad){_0x3fec66=_0x2075ad[_0xd660('0x4d')];if(!_0x1b3b5c['query'][_0xd660('0x4e')](_0xd660('0x6e'))){_0x160206['limit']=qs[_0xd660('0x34')](_0x1b3b5c[_0xd660('0x47')][_0xd660('0x34')]);_0x160206[_0xd660('0x32')]=qs[_0xd660('0x32')](_0x1b3b5c[_0xd660('0x47')][_0xd660('0x32')]);}return _0x9a5cea[_0xd660('0x7a')](_0x160206);}})[_0xd660('0x23')](function(_0x3adec9){if(_0x3adec9){return _0x3adec9?{'count':_0x3fec66,'rows':_0x3adec9}:null;}})['then'](respondWithResult(_0x49db1b,null))[_0xd660('0x2e')](handleError(_0x49db1b,null));};exports[_0xd660('0x7c')]=function(_0x47ab55,_0x3d6495){var _0x323095=_0x47ab55[_0xd660('0x5b')]['id'];var _0x2e9fd5=_0x47ab55[_0xd660('0x66')];var _0x4ab975=0xc8;var _0x2dcea1=null;return db[_0xd660('0x7d')][_0xd660('0x7e')]({'isolationLevel':db[_0xd660('0x7d')]['Transaction'][_0xd660('0x7f')]['READ_COMMITTED']},function(_0x1539a2){return db['WhatsappAccount'][_0xd660('0x6d')]({'where':{'id':_0x323095},'transaction':_0x1539a2})['then'](function(_0x37fee2){if(_0x37fee2){return db[_0xd660('0x80')][_0xd660('0x3a')]({'where':{'WhatsappAccountId':_0x323095},'transaction':_0x1539a2})[_0xd660('0x23')](function(){var _0x26440e=_[_0xd660('0x42')](_0x2e9fd5,function(_0x13f63c){_0x13f63c[_0xd660('0x6b')]=_0x323095;return _0x13f63c;});return db['WhatsappApplication'][_0xd660('0x81')](_0x26440e,{'transaction':_0x1539a2});});}else{_0x4ab975=0x194;_0x2dcea1=[];}});})['then'](function(){if(_0x4ab975!==0x194){return db[_0xd660('0x80')][_0xd660('0x82')]({'where':{'WhatsappAccountId':_0x323095},'order':_0xd660('0x83')})[_0xd660('0x23')](function(_0x123c72){_0x2dcea1=_0x123c72;});}})['catch'](function(_0x30f8f9){_0x4ab975=0x1f4;logger[_0xd660('0x29')](_0x30f8f9['stack']);if(_0x30f8f9[_0xd660('0x3f')]){delete _0x30f8f9[_0xd660('0x3f')];}_0x2dcea1=_0x30f8f9;})[_0xd660('0x84')](function(){if(_0x2dcea1===null){_0x3d6495['sendStatus'](_0x4ab975);}else{if(_0x4ab975===0x1f4){_0x3d6495[_0xd660('0x2f')](_0x4ab975)[_0xd660('0x40')](_0x2dcea1);}else{_0x3d6495[_0xd660('0x2f')](_0x4ab975)['json'](_0x2dcea1);}}});};exports[_0xd660('0x85')]=function(_0x4a6444,_0x3341e4,_0x2b4f75){var _0x1f0856={};var _0x27fdba={};var _0x39d62b;var _0x478172;return db[_0xd660('0x43')][_0xd660('0x6d')]({'where':{'id':_0x4a6444[_0xd660('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3341e4,null))[_0xd660('0x23')](function(_0x1ae447){if(_0x1ae447){_0x39d62b=_0x1ae447;_0x27fdba['model']=_[_0xd660('0x48')](db['WhatsappApplication'][_0xd660('0x44')]);_0x27fdba[_0xd660('0x47')]=_['keys'](_0x4a6444[_0xd660('0x47')]);_0x27fdba[_0xd660('0x49')]=_['intersection'](_0x27fdba[_0xd660('0x46')],_0x27fdba['query']);_0x1f0856['attributes']=_['intersection'](_0x27fdba[_0xd660('0x46')],qs[_0xd660('0x4c')](_0x4a6444[_0xd660('0x47')]['fields']));_0x1f0856[_0xd660('0x4b')]=_0x1f0856['attributes']['length']?_0x1f0856['attributes']:_0x27fdba[_0xd660('0x46')];_0x1f0856[_0xd660('0x4f')]=qs[_0xd660('0x50')](_0x4a6444['query']['sort']);_0x1f0856['where']=qs[_0xd660('0x49')](_[_0xd660('0x52')](_0x4a6444[_0xd660('0x47')],_0x27fdba[_0xd660('0x49')]));if(_0x4a6444['query'][_0xd660('0x53')]){_0x1f0856[_0xd660('0x51')]=_[_0xd660('0x54')](_0x1f0856[_0xd660('0x51')],{'$or':_['map'](_0x1f0856['attributes'],function(_0x542ab1){var _0x245a10={};_0x245a10[_0x542ab1]={'$like':'%'+_0x4a6444[_0xd660('0x47')][_0xd660('0x53')]+'%'};return _0x245a10;})});}_0x1f0856=_['merge']({},_0x1f0856,_0x4a6444[_0xd660('0x5d')]);return _0x39d62b[_0xd660('0x85')](_0x1f0856);}})[_0xd660('0x23')](function(_0x58d084){if(_0x58d084){_0x478172=_0x58d084[_0xd660('0x4d')];if(!_0x4a6444[_0xd660('0x47')][_0xd660('0x4e')](_0xd660('0x6e'))){_0x1f0856[_0xd660('0x34')]=qs[_0xd660('0x34')](_0x4a6444[_0xd660('0x47')][_0xd660('0x34')]);_0x1f0856[_0xd660('0x32')]=qs[_0xd660('0x32')](_0x4a6444[_0xd660('0x47')][_0xd660('0x32')]);}return _0x39d62b[_0xd660('0x85')](_0x1f0856);}})[_0xd660('0x23')](function(_0x4707aa){if(_0x4707aa){return _0x4707aa?{'count':_0x478172,'rows':_0x4707aa}:null;}})[_0xd660('0x23')](respondWithResult(_0x3341e4,null))[_0xd660('0x2e')](handleError(_0x3341e4,null));};exports[_0xd660('0x86')]=function(_0x5b3b4c,_0x27a030,_0x94ddb6){var _0x7063e4={'channel':_0xd660('0x87')};var _0x4f93bc=[];var _0x448097=[];var _0x1daba8={};return db[_0xd660('0x43')][_0xd660('0x67')]({'where':{'id':_0x5b3b4c[_0xd660('0x5b')]['id']},'include':[{'model':db[_0xd660('0x80')],'as':'Applications'}]})[_0xd660('0x23')](handleEntityNotFound(_0x27a030,null))[_0xd660('0x23')](function(_0x878c24){_0x7063e4[_0xd660('0x88')]=_0x878c24;if(_0x7063e4[_0xd660('0x88')]&&_0x7063e4['account'][_0xd660('0x55')]===_0xd660('0x89')&&_0x5b3b4c[_0xd660('0x66')][_0xd660('0x8a')]){if(_0x5b3b4c[_0xd660('0x66')]['statuses'][_0xd660('0x4d')]===0x0)return;if(_0x5b3b4c[_0xd660('0x66')][_0xd660('0x8a')][0x0]['state']!==_0xd660('0x8b'))return;return db[_0xd660('0x8c')][_0xd660('0x39')]({'read':!![],'readAt':_0x5b3b4c[_0xd660('0x66')]['statuses'][0x0][_0xd660('0x8d')]},{'where':{'messageId':_0x5b3b4c['body'][_0xd660('0x8a')][0x0][_0xd660('0x8e')]},'individualHooks':!![]})[_0xd660('0x23')](function(_0x1ab87c){return _0x27a030['status'](0xc8)['json'](_0x1ab87c);});}_0x7063e4['applications']=_[_0xd660('0x8f')](_0x878c24[_0xd660('0x90')],[_0xd660('0x83')],['asc']);if(_0x7063e4[_0xd660('0x88')]['Applications']){delete _0x7063e4['account']['Applications'];}return db[_0xd660('0x91')]['describe']()['then'](function(_0x1d06b4){if(!_0x1d06b4){throw new db['Sequelize']['ValidationError'](_0xd660('0x92'));}_0x4f93bc=_[_0xd660('0x93')](_[_0xd660('0x48')](_0x1d06b4),[_0xd660('0x94'),_0xd660('0x95')]);_0x448097=_[_0xd660('0x93')](_[_0xd660('0x48')](_0x1d06b4),[_0xd660('0x94'),'updatedAt',_0xd660('0x96'),_0xd660('0x97')]);_0x7063e4[_0xd660('0x66')]={'mapKey':_0xd660('0x98')};if(_0x7063e4[_0xd660('0x88')]&&_0x7063e4[_0xd660('0x88')][_0xd660('0x55')]==='twilio'){_0x7063e4[_0xd660('0x66')][_0xd660('0x99')]=_0x5b3b4c[_0xd660('0x66')]['From']['replace'](_0xd660('0x9a'),'');_0x7063e4[_0xd660('0x66')][_0xd660('0x66')]=_0x5b3b4c[_0xd660('0x66')][_0xd660('0x9b')];_0x7063e4[_0xd660('0x66')]['messageId']=_0x5b3b4c[_0xd660('0x66')]['MessageSid'];}if(_0x7063e4[_0xd660('0x88')]&&_0x7063e4[_0xd660('0x88')][_0xd660('0x55')]==='sinch'){_0x7063e4[_0xd660('0x66')][_0xd660('0x99')]=_0x5b3b4c[_0xd660('0x66')][_0xd660('0x9c')][0x0][_0xd660('0x99')];_0x7063e4[_0xd660('0x66')]['body']=_0x5b3b4c['body'][_0xd660('0x9c')][0x0][_0xd660('0x2b')][_0xd660('0x66')];_0x7063e4[_0xd660('0x66')][_0xd660('0x9d')]=_0x5b3b4c[_0xd660('0x66')][_0xd660('0x9c')][0x0][_0xd660('0x8e')];}if(_0x7063e4[_0xd660('0x66')]['id']){delete _0x7063e4[_0xd660('0x66')]['id'];}if(_[_0xd660('0x9e')](_0x7063e4[_0xd660('0x66')]['from'])){throw new db[(_0xd660('0x9f'))][(_0xd660('0xa0'))](_0xd660('0xa1'));}if(_[_0xd660('0x9e')](_0x7063e4['body'][_0xd660('0x66')])||_0x7063e4[_0xd660('0x66')][_0xd660('0x66')]===''){throw new db['Sequelize']['ValidationError'](_0xd660('0xa2'));}if(_[_0xd660('0x9e')](_0x7063e4[_0xd660('0x66')][_0xd660('0xa3')])){throw new db[(_0xd660('0x9f'))][(_0xd660('0xa0'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x448097);}if(!_[_0xd660('0xa4')](_0x448097,_0x7063e4[_0xd660('0x66')][_0xd660('0xa3')])){throw new db['Sequelize'][(_0xd660('0xa0'))](_0xd660('0xa5')+_0x448097);}_0x1daba8[_0x7063e4[_0xd660('0x66')][_0xd660('0xa3')]]=_0x7063e4['body'][_0xd660('0x99')];return db[_0xd660('0xa6')]['find']({'where':{'id':_0x7063e4[_0xd660('0x88')]['ListId']},'include':[{'model':db[_0xd660('0x91')],'as':'Contacts','where':_0x1daba8,'limit':0x1,'order':[[_0xd660('0x95'),_0xd660('0xa7')]]}]});})['then'](handleEntityNotFound(_0x27a030,null))['then'](function(_0x36fe6d){if(_0x36fe6d){_0x7063e4[_0xd660('0xa8')]=_['omit'](_0x36fe6d,['Contacts']);if(_0x36fe6d['Contacts']['length']){return _0x36fe6d['Contacts'][0x0];}var _0x6f6bb0=_['defaults'](_0x7063e4['body'],{'firstName':_0x7063e4[_0xd660('0x66')][_0xd660('0x99')],'ListId':_0x36fe6d['id']});_0x6f6bb0[_0x7063e4['body'][_0xd660('0xa3')]]=_0x7063e4[_0xd660('0x66')][_0xd660('0x99')];return db[_0xd660('0x91')][_0xd660('0x5e')](_0x6f6bb0,{'fields':_0x4f93bc,'raw':!![]});}})[_0xd660('0x23')](handleEntityNotFound(_0x27a030,null))[_0xd660('0x23')](function(_0x53bd9a){if(_0x53bd9a){_0x7063e4[_0xd660('0xa9')]=_0x53bd9a;var _0xb4abaf={'ContactId':_0x53bd9a['id'],'phone':_0x7063e4['body'][_0xd660('0x99')],'WhatsappAccountId':_0x5b3b4c['params']['id']};var _0x551cc0={'ContactId':_0x53bd9a['id'],'WhatsappAccountId':_0x5b3b4c['params']['id'],'closed':![]};return db[_0xd660('0xaa')]['find']({'where':_0x551cc0})['then'](function(_0x253056){if(_0x253056){return[_0x253056,![]];}return db[_0xd660('0xaa')][_0xd660('0x5e')](_0xb4abaf)[_0xd660('0x23')](function(_0x430735){return[_0x430735,!![]];});});}})[_0xd660('0xab')](function(_0x2f224c,_0xc7f70c){_0x7063e4[_0xd660('0xac')]=_0x2f224c[_0xd660('0x3b')]({'plain':!![]});_0x7063e4[_0xd660('0xac')][_0xd660('0xad')]=![];if(_0xc7f70c){if(_0x7063e4[_0xd660('0x88')][_0xd660('0xae')]){_0x7063e4[_0xd660('0xaf')][_0xd660('0xb0')]({'id':0x0,'priority':_0x7063e4['applications'][_0xd660('0x4d')]+0x1,'app':_0xd660('0xb1'),'appdata':_0xd660('0xb2'),'interval':'*,*,*,*'});}_0x7063e4[_0xd660('0xac')][_0xd660('0xad')]=!![];}return db[_0xd660('0x8c')][_0xd660('0x5e')]({'phone':_0x7063e4['body'][_0xd660('0x99')],'messageId':_0x7063e4['body']['messageId'],'body':_0x7063e4[_0xd660('0x66')][_0xd660('0x66')],'WhatsappAccountId':_0x5b3b4c[_0xd660('0x5b')]['id'],'WhatsappInteractionId':_0x2f224c['id'],'direction':'in','ContactId':_0x2f224c[_0xd660('0xb3')],'AttachmentId':_0x7063e4[_0xd660('0x66')][_0xd660('0xb4')]});})[_0xd660('0x23')](function(_0x1eac8f){_0x7063e4[_0xd660('0x2b')]=_0x1eac8f;if(_0x7063e4[_0xd660('0xac')][_0xd660('0xb5')]){return db[_0xd660('0x7b')][_0xd660('0x67')]({'attributes':['id',_0xd660('0x3f')],'where':{'id':_0x7063e4[_0xd660('0xac')][_0xd660('0xb5')]}})[_0xd660('0x23')](function(_0x2ce749){if(_0x2ce749){_0x7063e4[_0xd660('0xaf')][_0xd660('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2ce749[_0xd660('0x3f')]+','+(_0x7063e4['account']['waitForTheAssignedAgent']||0xa),'interval':_0xd660('0xb7')});}return respondWithRpcPromise('Start',_0xd660('0xb8'),_0x7063e4);});}return respondWithRpcPromise('Start',_0xd660('0xb8'),_0x7063e4);})[_0xd660('0x23')](function(_0x3d6f24){if(_0x3d6f24){var _0xced8c1=0xc8;var _0xe68437='receiveMessage';logger[_0xd660('0x2c')](_0xd660('0x27'),_0xe68437,_0xced8c1,_0xd660('0xb9'));logger[_0xd660('0x26')](_0xd660('0xba'),_0xe68437,_0xced8c1,_0xd660('0xb9'),JSON[_0xd660('0x28')](_0x3d6f24));if(_0x7063e4[_0xd660('0x88')][_0xd660('0x55')]===_0xd660('0xbb')){return _0x27a030[_0xd660('0x2f')](_0xced8c1)[_0xd660('0x36')](_0xd660('0xbc'),_0xd660('0xbd'))[_0xd660('0x40')](_0xd660('0xbe'));}else{return _0x27a030[_0xd660('0x2f')](_0xced8c1)['json'](_0x3d6f24);}}});})['catch'](handleError(_0x27a030,null));};exports[_0xd660('0x40')]=function(_0x4807d3,_0x29b38a,_0x3945eb){var _0x37e088,_0x21eb9a,_0x161b70;if(_[_0xd660('0x9e')](_0x4807d3[_0xd660('0x66')]['body'])||_0x4807d3[_0xd660('0x66')]['body']===''){throw new db[(_0xd660('0x9f'))][(_0xd660('0xa0'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4807d3[_0xd660('0x66')]['to'])){throw new db[(_0xd660('0x9f'))]['ValidationError']('to\x20is\x20mandatory');}_0x37e088=_0x4807d3[_0xd660('0x66')]['to'];return db[_0xd660('0x43')][_0xd660('0x67')]({'where':{'id':_0x4807d3[_0xd660('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0xd660('0xbf'),'include':[{'model':db[_0xd660('0x91')],'as':_0xd660('0xc0'),'where':{'mobile':_0x37e088},'limit':0x1,'order':[['updatedAt',_0xd660('0xa7')]]}]}]})[_0xd660('0x23')](handleEntityNotFound(_0x29b38a,null))[_0xd660('0x23')](function(_0x35933e){if(_0x35933e&&_0x35933e[_0xd660('0xbf')]){_0x21eb9a=_0x35933e[_0xd660('0x3b')]({'plain':!![]});if(_0x21eb9a[_0xd660('0xbf')]&&_0x21eb9a[_0xd660('0xbf')][_0xd660('0xc0')][_0xd660('0x4d')]){return _0x21eb9a['List']['Contacts'][0x0];}return db['CmContact'][_0xd660('0x5e')](_[_0xd660('0x1a')](_0x4807d3[_0xd660('0x66')],{'firstName':_0x37e088,'mobile':_0x37e088,'phone':_0x37e088,'ListId':_0x21eb9a[_0xd660('0x97')]}));}})[_0xd660('0x23')](handleEntityNotFound(_0x29b38a,null))[_0xd660('0x23')](function(_0x1873d1){if(_0x1873d1){_0x161b70=_0x1873d1;return db[_0xd660('0xaa')][_0xd660('0x67')]({'where':{'ContactId':_0x161b70['id'],'closed':![],'WhatsappAccountId':_0x21eb9a['id']}})[_0xd660('0x23')](function(_0x135f80){if(_0x135f80){return[_0x135f80,![]];}return db[_0xd660('0xaa')][_0xd660('0x5e')]({'UserId':_0x4807d3[_0xd660('0x5f')]['id'],'ContactId':_0x161b70['id'],'WhatsappAccountId':_0x21eb9a['id'],'phone':_0x37e088,'firstMsgDirection':_0xd660('0xc1'),'Messages':[_[_0xd660('0x54')](_0x4807d3['body'],{'read':![],'body':_0x4807d3['body']['body'],'phone':_0x37e088,'WhatsappAccountId':_0x21eb9a['id'],'UserId':_0x4807d3['user']['id'],'ContactId':_0x161b70['id']})]},{'include':[{'model':db[_0xd660('0x8c')],'as':'Messages'}]})[_0xd660('0x23')](function(_0x5f5abc){return[_0x5f5abc,!![]];});});}})['spread'](function(_0x2f29c7,_0x355c74){if(_0x355c74){return _0x2f29c7;}return db['WhatsappMessage'][_0xd660('0x5e')](_['merge'](_0x4807d3['body'],{'read':![],'body':_0x4807d3[_0xd660('0x66')][_0xd660('0x66')],'phone':_0x37e088,'WhatsappAccountId':_0x21eb9a['id'],'WhatsappInteractionId':_0x2f29c7['id'],'UserId':_0x4807d3[_0xd660('0x5f')]['id'],'ContactId':_0x161b70['id']}))[_0xd660('0x23')](function(_0x5dd063){_0x2f29c7[_0xd660('0xc2')][_0xd660('0xc3')]=[];_0x2f29c7[_0xd660('0xc2')][_0xd660('0xc3')]['push'](_0x5dd063[_0xd660('0xc2')]);return _0x2f29c7;});})[_0xd660('0x23')](respondWithResult(_0x29b38a,null))['catch'](handleError(_0x29b38a,null));}; \ No newline at end of file +var _0x3eef=['options','include','findAll','rows','show','length','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','WhatsappAccountId','findOne','Disposition','removeDispositions','addAnswer','getAnswers','CannedAnswer','includeAll','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','sinch','statuses','WhatsappMessage','message_id','applications','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','MessageSid','messageId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','Contacts','list','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','unshift','agent','startRouting','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge'];(function(_0x7f66cd,_0x476f92){var _0x438c7b=function(_0x55c3ee){while(--_0x55c3ee){_0x7f66cd['push'](_0x7f66cd['shift']());}};_0x438c7b(++_0x476f92);}(_0x3eef,0x69));var _0xf3ee=function(_0x4fa3cd,_0x557dcd){_0x4fa3cd=_0x4fa3cd-0x0;var _0x5261ff=_0x3eef[_0x4fa3cd];return _0x5261ff;};'use strict';var emlformat=require(_0xf3ee('0x0'));var rimraf=require(_0xf3ee('0x1'));var zipdir=require(_0xf3ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3ee('0x3'));var moment=require('moment');var BPromise=require(_0xf3ee('0x4'));var Mustache=require(_0xf3ee('0x5'));var util=require(_0xf3ee('0x6'));var path=require(_0xf3ee('0x7'));var sox=require('sox');var csv=require(_0xf3ee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3ee('0x9'));var _=require(_0xf3ee('0xa'));var squel=require(_0xf3ee('0xb'));var crypto=require(_0xf3ee('0xc'));var jsforce=require(_0xf3ee('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf3ee('0xe'));var Papa=require(_0xf3ee('0xf'));var Redis=require(_0xf3ee('0x10'));var authService=require(_0xf3ee('0x11'));var qs=require(_0xf3ee('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3ee('0x13'));var logger=require(_0xf3ee('0x14'))(_0xf3ee('0x15'));var utils=require(_0xf3ee('0x16'));var config=require(_0xf3ee('0x17'));var licenseUtil=require(_0xf3ee('0x18'));var db=require(_0xf3ee('0x19'))['db'];config[_0xf3ee('0x1a')]=_[_0xf3ee('0x1b')](config[_0xf3ee('0x1a')],{'host':_0xf3ee('0x1c'),'port':0x18eb});var socket=require(_0xf3ee('0x1d'))(new Redis(config['redis']));require(_0xf3ee('0x1e'))[_0xf3ee('0x1f')](socket);var jayson=require(_0xf3ee('0x20'));var client=jayson[_0xf3ee('0x21')][_0xf3ee('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x4f87ed,_0x2c8029,_0x32e94e,_0x46597a){return new BPromise(function(_0x2f7e27,_0x197981){var _0x227572=_0x46597a||client;return _0x227572[_0xf3ee('0x23')](_0x4f87ed,_0x32e94e)[_0xf3ee('0x24')](function(_0x16e2c0){logger[_0xf3ee('0x25')](_0xf3ee('0x26'),_0x2c8029,_0xf3ee('0x27'));logger[_0xf3ee('0x28')](_0xf3ee('0x29'),_0x2c8029,'request\x20sent',JSON[_0xf3ee('0x2a')](_0x16e2c0));if(_0x16e2c0[_0xf3ee('0x2b')]){if(_0x16e2c0[_0xf3ee('0x2b')]['code']===0x1f4){logger[_0xf3ee('0x2b')](_0xf3ee('0x26'),_0x2c8029,_0x16e2c0[_0xf3ee('0x2b')][_0xf3ee('0x2c')]);return _0x197981(_0x16e2c0['error'][_0xf3ee('0x2c')]);}logger[_0xf3ee('0x2b')](_0xf3ee('0x26'),_0x2c8029,_0x16e2c0['error'][_0xf3ee('0x2c')]);return _0x2f7e27(_0x16e2c0[_0xf3ee('0x2b')][_0xf3ee('0x2c')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x2c8029,_0xf3ee('0x27'));_0x2f7e27(_0x16e2c0[_0xf3ee('0x2d')][_0xf3ee('0x2c')]);}})[_0xf3ee('0x2e')](function(_0x40efff){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x2c8029,_0x40efff);_0x197981(_0x40efff);});});}function respondWithStatusCode(_0x34e574,_0xce6d7a){_0xce6d7a=_0xce6d7a||0xcc;return function(_0x40447d){if(_0x40447d){return _0x34e574[_0xf3ee('0x2f')](_0xce6d7a);}return _0x34e574[_0xf3ee('0x30')](_0xce6d7a)[_0xf3ee('0x31')]();};}function respondWithResult(_0x53eaf8,_0x7cdca2){_0x7cdca2=_0x7cdca2||0xc8;return function(_0x29240d){if(_0x29240d){return _0x53eaf8[_0xf3ee('0x30')](_0x7cdca2)[_0xf3ee('0x32')](_0x29240d);}};}function respondWithFilteredResult(_0x77590,_0x2d94f7){return function(_0x17806e){if(_0x17806e){var _0x3ff064=typeof _0x2d94f7[_0xf3ee('0x33')]==='undefined'&&typeof _0x2d94f7['limit']===_0xf3ee('0x34');var _0x24618c=_0x17806e[_0xf3ee('0x35')];var _0x14c71d=_0x3ff064?0x0:_0x2d94f7['offset'];var _0xfffac3=_0x3ff064?_0x17806e[_0xf3ee('0x35')]:_0x2d94f7[_0xf3ee('0x33')]+_0x2d94f7[_0xf3ee('0x36')];var _0x58c4a6;if(_0xfffac3>=_0x24618c){_0xfffac3=_0x24618c;_0x58c4a6=0xc8;}else{_0x58c4a6=0xce;}_0x77590[_0xf3ee('0x30')](_0x58c4a6);return _0x77590['set'](_0xf3ee('0x37'),_0x14c71d+'-'+_0xfffac3+'/'+_0x24618c)[_0xf3ee('0x32')](_0x17806e);}return null;};}function patchUpdates(_0xf40dcf){return function(_0x10bc6c){try{jsonpatch['apply'](_0x10bc6c,_0xf40dcf,!![]);}catch(_0x123877){return BPromise[_0xf3ee('0x38')](_0x123877);}return _0x10bc6c[_0xf3ee('0x39')]();};}function saveUpdates(_0x5afe87,_0x590707){return function(_0x39ff4f){if(_0x39ff4f){return _0x39ff4f[_0xf3ee('0x3a')](_0x5afe87)[_0xf3ee('0x24')](function(_0xb81165){return _0xb81165;});}return null;};}function removeEntity(_0x558d02,_0x3ce846){return function(_0x3eddbf){if(_0x3eddbf){return _0x3eddbf[_0xf3ee('0x3b')]()[_0xf3ee('0x24')](function(){var _0x31d446=_0x3eddbf[_0xf3ee('0x3c')]({'plain':!![]});var _0x30e0ea=_0xf3ee('0x3d');return db[_0xf3ee('0x3e')][_0xf3ee('0x3b')]({'where':{'type':_0x30e0ea,'resourceId':_0x31d446['id']}})[_0xf3ee('0x24')](function(){return _0x3eddbf;});})[_0xf3ee('0x24')](function(){_0x558d02[_0xf3ee('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc20d6b,_0x1647d8){return function(_0xc9a19){if(!_0xc9a19){_0xc20d6b['sendStatus'](0x194);}return _0xc9a19;};}function handleError(_0xabf08d,_0x1bc83b){_0x1bc83b=_0x1bc83b||0x1f4;return function(_0x1596af){logger['error'](_0x1596af[_0xf3ee('0x3f')]);if(_0x1596af[_0xf3ee('0x40')]){delete _0x1596af['name'];}_0xabf08d[_0xf3ee('0x30')](_0x1bc83b)[_0xf3ee('0x41')](_0x1596af);};}exports[_0xf3ee('0x42')]=function(_0x200b14,_0x4da444){var _0x44891f={'include':[{'model':db[_0xf3ee('0x43')],'as':_0xf3ee('0x44')}]},_0x390ab0={},_0x21bf10={'count':0x0,'rows':[]};var _0x426b14=_[_0xf3ee('0x45')](db[_0xf3ee('0x46')][_0xf3ee('0x47')],function(_0x4d6e89){return{'name':_0x4d6e89[_0xf3ee('0x48')],'type':_0x4d6e89[_0xf3ee('0x49')][_0xf3ee('0x4a')]};});_0x390ab0[_0xf3ee('0x4b')]=_[_0xf3ee('0x45')](_0x426b14,_0xf3ee('0x40'));_0x390ab0[_0xf3ee('0x4c')]=_[_0xf3ee('0x4d')](_0x200b14[_0xf3ee('0x4c')]);_0x390ab0['filters']=_[_0xf3ee('0x4e')](_0x390ab0[_0xf3ee('0x4b')],_0x390ab0[_0xf3ee('0x4c')]);_0x44891f[_0xf3ee('0x4f')]=_[_0xf3ee('0x4e')](_0x390ab0[_0xf3ee('0x4b')],qs[_0xf3ee('0x50')](_0x200b14[_0xf3ee('0x4c')]['fields']));_0x44891f['attributes']=_0x44891f['attributes']['length']?_0x44891f[_0xf3ee('0x4f')]:_0x390ab0[_0xf3ee('0x4b')];if(!_0x200b14[_0xf3ee('0x4c')][_0xf3ee('0x51')](_0xf3ee('0x52'))){_0x44891f[_0xf3ee('0x36')]=qs[_0xf3ee('0x36')](_0x200b14[_0xf3ee('0x4c')][_0xf3ee('0x36')]);_0x44891f['offset']=qs[_0xf3ee('0x33')](_0x200b14[_0xf3ee('0x4c')]['offset']);}_0x44891f[_0xf3ee('0x53')]=qs[_0xf3ee('0x54')](_0x200b14[_0xf3ee('0x4c')]['sort']);_0x44891f['where']=qs['filters'](_[_0xf3ee('0x55')](_0x200b14[_0xf3ee('0x4c')],_0x390ab0[_0xf3ee('0x56')]),_0x426b14);if(_0x200b14['query'][_0xf3ee('0x57')]){_0x44891f[_0xf3ee('0x58')]=_[_0xf3ee('0x59')](_0x44891f['where'],{'$or':_[_0xf3ee('0x45')](_0x426b14,function(_0x5cae5f){if(_0x5cae5f[_0xf3ee('0x49')]!=='VIRTUAL'){var _0x2c8ed0={};_0x2c8ed0[_0x5cae5f[_0xf3ee('0x40')]]={'$like':'%'+_0x200b14['query'][_0xf3ee('0x57')]+'%'};return _0x2c8ed0;}})});}_0x44891f=_[_0xf3ee('0x59')]({},_0x44891f,_0x200b14[_0xf3ee('0x5a')]);var _0x426500={'where':_0x44891f[_0xf3ee('0x58')]};return db['WhatsappAccount'][_0xf3ee('0x35')](_0x426500)['then'](function(_0x4c87e7){_0x21bf10[_0xf3ee('0x35')]=_0x4c87e7;if(_0x200b14[_0xf3ee('0x4c')]['includeAll']){_0x44891f[_0xf3ee('0x5b')]=[{'all':!![]}];}return db[_0xf3ee('0x46')][_0xf3ee('0x5c')](_0x44891f);})[_0xf3ee('0x24')](function(_0x5f3c70){_0x21bf10[_0xf3ee('0x5d')]=_0x5f3c70;return _0x21bf10;})[_0xf3ee('0x24')](respondWithFilteredResult(_0x4da444,_0x44891f))[_0xf3ee('0x2e')](handleError(_0x4da444,null));};exports[_0xf3ee('0x5e')]=function(_0x68e69b,_0x1983b3){var _0x5c618d={'raw':![],'where':{'id':_0x68e69b['params']['id']},'include':[{'model':db['Pause'],'as':_0xf3ee('0x44')}]},_0xcc760c={};_0xcc760c[_0xf3ee('0x4b')]=_[_0xf3ee('0x4d')](db['WhatsappAccount'][_0xf3ee('0x47')]);_0xcc760c[_0xf3ee('0x4c')]=_[_0xf3ee('0x4d')](_0x68e69b[_0xf3ee('0x4c')]);_0xcc760c[_0xf3ee('0x56')]=_[_0xf3ee('0x4e')](_0xcc760c[_0xf3ee('0x4b')],_0xcc760c[_0xf3ee('0x4c')]);_0x5c618d[_0xf3ee('0x4f')]=_['intersection'](_0xcc760c['model'],qs['fields'](_0x68e69b[_0xf3ee('0x4c')][_0xf3ee('0x50')]));_0x5c618d[_0xf3ee('0x4f')]=_0x5c618d[_0xf3ee('0x4f')][_0xf3ee('0x5f')]?_0x5c618d[_0xf3ee('0x4f')]:_0xcc760c['model'];if(_0x68e69b[_0xf3ee('0x4c')]['includeAll']){_0x5c618d[_0xf3ee('0x5b')]=[{'all':!![]}];}_0x5c618d=_[_0xf3ee('0x59')]({},_0x5c618d,_0x68e69b['options']);return db[_0xf3ee('0x46')]['find'](_0x5c618d)[_0xf3ee('0x24')](handleEntityNotFound(_0x1983b3,null))[_0xf3ee('0x24')](respondWithResult(_0x1983b3,null))[_0xf3ee('0x2e')](handleError(_0x1983b3,null));};exports[_0xf3ee('0x60')]=function(_0x30ba86,_0x7d6a42){return db[_0xf3ee('0x46')][_0xf3ee('0x60')](_0x30ba86[_0xf3ee('0x61')],{})['then'](function(_0x1079c9){var _0x544c3c=_0x30ba86[_0xf3ee('0x62')][_0xf3ee('0x3c')]({'plain':!![]});if(!_0x544c3c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x544c3c[_0xf3ee('0x63')]==='user'){var _0x1288c9=_0x1079c9[_0xf3ee('0x3c')]({'plain':!![]});var _0x177ea2=_0xf3ee('0x3d');return db['UserProfileSection'][_0xf3ee('0x64')]({'where':{'name':_0x177ea2,'userProfileId':_0x544c3c[_0xf3ee('0x65')]},'raw':!![]})[_0xf3ee('0x24')](function(_0xa3e4f0){if(_0xa3e4f0&&_0xa3e4f0[_0xf3ee('0x66')]===0x0){return db[_0xf3ee('0x3e')][_0xf3ee('0x60')]({'name':_0x1288c9[_0xf3ee('0x40')],'resourceId':_0x1288c9['id'],'type':_0xa3e4f0[_0xf3ee('0x40')],'sectionId':_0xa3e4f0['id']},{})[_0xf3ee('0x24')](function(){return _0x1079c9;});}else{return _0x1079c9;}})[_0xf3ee('0x2e')](function(_0x52971c){logger[_0xf3ee('0x2b')](_0xf3ee('0x67'),_0x52971c);throw _0x52971c;});}return _0x1079c9;})[_0xf3ee('0x24')](respondWithResult(_0x7d6a42,0xc9))[_0xf3ee('0x2e')](handleError(_0x7d6a42,null));};exports[_0xf3ee('0x3a')]=function(_0x24971b,_0x4adb39){if(_0x24971b['body']['id']){delete _0x24971b[_0xf3ee('0x61')]['id'];}return db[_0xf3ee('0x46')][_0xf3ee('0x64')]({'where':{'id':_0x24971b['params']['id']},'include':[{'model':db['Pause'],'as':_0xf3ee('0x44')}]})[_0xf3ee('0x24')](handleEntityNotFound(_0x4adb39,null))[_0xf3ee('0x24')](saveUpdates(_0x24971b[_0xf3ee('0x61')],null))['then'](respondWithResult(_0x4adb39,null))[_0xf3ee('0x2e')](handleError(_0x4adb39,null));};exports[_0xf3ee('0x3b')]=function(_0x3f5954,_0x21ebcd){return db[_0xf3ee('0x46')][_0xf3ee('0x64')]({'where':{'id':_0x3f5954['params']['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x21ebcd,null))[_0xf3ee('0x24')](removeEntity(_0x21ebcd,null))[_0xf3ee('0x2e')](handleError(_0x21ebcd,null));};exports[_0xf3ee('0x68')]=function(_0x263c78,_0xe5ca4){return db[_0xf3ee('0x46')][_0xf3ee('0x68')]()[_0xf3ee('0x24')](respondWithResult(_0xe5ca4,null))[_0xf3ee('0x2e')](handleError(_0xe5ca4,null));};exports[_0xf3ee('0x69')]=function(_0x1c6c37,_0x3d8f71,_0x14a19c){if(_0x1c6c37['body']['id']){delete _0x1c6c37['body']['id'];}return db['WhatsappAccount'][_0xf3ee('0x64')]({'where':{'id':_0x1c6c37[_0xf3ee('0x6a')]['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x3d8f71,null))[_0xf3ee('0x24')](function(_0x2b8d2c){if(_0x2b8d2c){_0x1c6c37['body'][_0xf3ee('0x6b')]=_0x2b8d2c['id'];return db['Disposition'][_0xf3ee('0x60')](_0x1c6c37[_0xf3ee('0x61')]);}})[_0xf3ee('0x24')](respondWithResult(_0x3d8f71,null))[_0xf3ee('0x2e')](handleError(_0x3d8f71,null));};exports['getDispositions']=function(_0x4ac151,_0x25a7e1,_0x25e7fb){var _0x60efd4={'raw':![],'where':{}};var _0x1485b0={};var _0x35c110={'count':0x0,'rows':[]};return db[_0xf3ee('0x46')][_0xf3ee('0x6c')]({'where':{'id':_0x4ac151[_0xf3ee('0x6a')]['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x25a7e1,null))['then'](function(_0x4d6ada){if(_0x4d6ada){_0x1485b0[_0xf3ee('0x4b')]=_[_0xf3ee('0x4d')](db[_0xf3ee('0x6d')][_0xf3ee('0x47')]);_0x1485b0[_0xf3ee('0x4c')]=_[_0xf3ee('0x4d')](_0x4ac151[_0xf3ee('0x4c')]);_0x1485b0[_0xf3ee('0x56')]=_[_0xf3ee('0x4e')](_0x1485b0['model'],_0x1485b0[_0xf3ee('0x4c')]);_0x60efd4[_0xf3ee('0x4f')]=_[_0xf3ee('0x4e')](_0x1485b0[_0xf3ee('0x4b')],qs[_0xf3ee('0x50')](_0x4ac151['query'][_0xf3ee('0x50')]));_0x60efd4[_0xf3ee('0x4f')]=_0x60efd4[_0xf3ee('0x4f')][_0xf3ee('0x5f')]?_0x60efd4['attributes']:_0x1485b0[_0xf3ee('0x4b')];if(!_0x4ac151[_0xf3ee('0x4c')][_0xf3ee('0x51')](_0xf3ee('0x52'))){_0x60efd4[_0xf3ee('0x36')]=qs[_0xf3ee('0x36')](_0x4ac151[_0xf3ee('0x4c')][_0xf3ee('0x36')]);_0x60efd4['offset']=qs[_0xf3ee('0x33')](_0x4ac151[_0xf3ee('0x4c')][_0xf3ee('0x33')]);}_0x60efd4[_0xf3ee('0x53')]=qs[_0xf3ee('0x54')](_0x4ac151[_0xf3ee('0x4c')][_0xf3ee('0x54')]);_0x60efd4[_0xf3ee('0x58')]=qs[_0xf3ee('0x56')](_[_0xf3ee('0x55')](_0x4ac151[_0xf3ee('0x4c')],_0x1485b0[_0xf3ee('0x56')]));_0x60efd4[_0xf3ee('0x58')]['WhatsappAccountId']=_0x4d6ada['id'];if(_0x4ac151[_0xf3ee('0x4c')][_0xf3ee('0x57')]){_0x60efd4[_0xf3ee('0x58')]=_['merge'](_0x60efd4[_0xf3ee('0x58')],{'$or':_['map'](_0x60efd4['attributes'],function(_0x3c7d76){var _0x46a6f7={};_0x46a6f7[_0x3c7d76]={'$like':'%'+_0x4ac151[_0xf3ee('0x4c')][_0xf3ee('0x57')]+'%'};return _0x46a6f7;})});}_0x60efd4=_[_0xf3ee('0x59')]({},_0x60efd4,_0x4ac151[_0xf3ee('0x5a')]);return db['Disposition']['count']({'where':_0x60efd4[_0xf3ee('0x58')]})[_0xf3ee('0x24')](function(_0x16f799){_0x35c110['count']=_0x16f799;if(_0x4ac151[_0xf3ee('0x4c')]['includeAll']){_0x60efd4[_0xf3ee('0x5b')]=[{'all':!![]}];}return db[_0xf3ee('0x6d')][_0xf3ee('0x5c')](_0x60efd4);})[_0xf3ee('0x24')](function(_0x364d60){_0x35c110[_0xf3ee('0x5d')]=_0x364d60;return _0x35c110;});}})[_0xf3ee('0x24')](respondWithFilteredResult(_0x25a7e1,_0x60efd4))[_0xf3ee('0x2e')](handleError(_0x25a7e1,null));};exports[_0xf3ee('0x6e')]=function(_0x4d4c0e,_0x21fa49,_0x21f6a7){return db['WhatsappAccount'][_0xf3ee('0x64')]({'where':{'id':_0x4d4c0e[_0xf3ee('0x6a')]['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x21fa49,null))[_0xf3ee('0x24')](function(_0x1ee4dc){if(_0x1ee4dc){return _0x1ee4dc[_0xf3ee('0x6e')](_0x4d4c0e['query']['ids']);}})[_0xf3ee('0x24')](respondWithStatusCode(_0x21fa49,null))['catch'](handleError(_0x21fa49,null));};exports[_0xf3ee('0x6f')]=function(_0x2adae3,_0x27411e,_0x2d10e9){if(_0x2adae3['body']['id']){delete _0x2adae3[_0xf3ee('0x61')]['id'];}return db[_0xf3ee('0x46')][_0xf3ee('0x64')]({'where':{'id':_0x2adae3['params']['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x27411e,null))[_0xf3ee('0x24')](function(_0x1247ef){if(_0x1247ef){_0x2adae3[_0xf3ee('0x61')][_0xf3ee('0x6b')]=_0x1247ef['id'];return db['CannedAnswer'][_0xf3ee('0x60')](_0x2adae3[_0xf3ee('0x61')]);}})['then'](respondWithResult(_0x27411e,null))[_0xf3ee('0x2e')](handleError(_0x27411e,null));};exports[_0xf3ee('0x70')]=function(_0x58f3d8,_0x3bc625,_0x313e71){var _0x54d75c={'raw':![],'where':{}};var _0x409032={};var _0x12a606={'count':0x0,'rows':[]};return db[_0xf3ee('0x46')][_0xf3ee('0x6c')]({'where':{'id':_0x58f3d8[_0xf3ee('0x6a')]['id']}})['then'](handleEntityNotFound(_0x3bc625,null))[_0xf3ee('0x24')](function(_0x4d2c96){if(_0x4d2c96){_0x409032[_0xf3ee('0x4b')]=_[_0xf3ee('0x4d')](db[_0xf3ee('0x71')][_0xf3ee('0x47')]);_0x409032['query']=_[_0xf3ee('0x4d')](_0x58f3d8[_0xf3ee('0x4c')]);_0x409032[_0xf3ee('0x56')]=_[_0xf3ee('0x4e')](_0x409032[_0xf3ee('0x4b')],_0x409032[_0xf3ee('0x4c')]);_0x54d75c[_0xf3ee('0x4f')]=_[_0xf3ee('0x4e')](_0x409032['model'],qs['fields'](_0x58f3d8[_0xf3ee('0x4c')]['fields']));_0x54d75c[_0xf3ee('0x4f')]=_0x54d75c[_0xf3ee('0x4f')]['length']?_0x54d75c['attributes']:_0x409032[_0xf3ee('0x4b')];if(!_0x58f3d8[_0xf3ee('0x4c')][_0xf3ee('0x51')](_0xf3ee('0x52'))){_0x54d75c[_0xf3ee('0x36')]=qs[_0xf3ee('0x36')](_0x58f3d8['query'][_0xf3ee('0x36')]);_0x54d75c['offset']=qs[_0xf3ee('0x33')](_0x58f3d8[_0xf3ee('0x4c')]['offset']);}_0x54d75c[_0xf3ee('0x53')]=qs['sort'](_0x58f3d8[_0xf3ee('0x4c')]['sort']);_0x54d75c[_0xf3ee('0x58')]=qs[_0xf3ee('0x56')](_[_0xf3ee('0x55')](_0x58f3d8['query'],_0x409032[_0xf3ee('0x56')]));_0x54d75c[_0xf3ee('0x58')][_0xf3ee('0x6b')]=_0x4d2c96['id'];if(_0x58f3d8[_0xf3ee('0x4c')][_0xf3ee('0x57')]){_0x54d75c[_0xf3ee('0x58')]=_[_0xf3ee('0x59')](_0x54d75c[_0xf3ee('0x58')],{'$or':_[_0xf3ee('0x45')](_0x54d75c['attributes'],function(_0x42678c){var _0x5e59e4={};_0x5e59e4[_0x42678c]={'$like':'%'+_0x58f3d8['query']['filter']+'%'};return _0x5e59e4;})});}_0x54d75c=_[_0xf3ee('0x59')]({},_0x54d75c,_0x58f3d8['options']);return db[_0xf3ee('0x71')][_0xf3ee('0x35')]({'where':_0x54d75c[_0xf3ee('0x58')]})['then'](function(_0xb050ed){_0x12a606[_0xf3ee('0x35')]=_0xb050ed;if(_0x58f3d8[_0xf3ee('0x4c')][_0xf3ee('0x72')]){_0x54d75c[_0xf3ee('0x5b')]=[{'all':!![]}];}return db[_0xf3ee('0x71')][_0xf3ee('0x5c')](_0x54d75c);})[_0xf3ee('0x24')](function(_0x29adcb){_0x12a606[_0xf3ee('0x5d')]=_0x29adcb;return _0x12a606;});}})[_0xf3ee('0x24')](respondWithFilteredResult(_0x3bc625,_0x54d75c))[_0xf3ee('0x2e')](handleError(_0x3bc625,null));};exports[_0xf3ee('0x73')]=function(_0x236df4,_0x234aff,_0x217bd6){return db['WhatsappAccount'][_0xf3ee('0x64')]({'where':{'id':_0x236df4[_0xf3ee('0x6a')]['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x234aff,null))[_0xf3ee('0x24')](function(_0x4788ba){if(_0x4788ba){return _0x4788ba[_0xf3ee('0x73')](_0x236df4[_0xf3ee('0x4c')][_0xf3ee('0x74')]);}})[_0xf3ee('0x24')](respondWithStatusCode(_0x234aff,null))[_0xf3ee('0x2e')](handleError(_0x234aff,null));};exports[_0xf3ee('0x75')]=function(_0x4c0d9c,_0x11f26e,_0x2705db){return db[_0xf3ee('0x46')][_0xf3ee('0x64')]({'where':{'id':_0x4c0d9c[_0xf3ee('0x6a')]['id']}})['then'](handleEntityNotFound(_0x11f26e,null))[_0xf3ee('0x24')](function(_0xd977f8){if(_0xd977f8){return _0xd977f8['addAgents'](_0x4c0d9c['body']['ids'],_[_0xf3ee('0x76')](_0x4c0d9c['body'],[_0xf3ee('0x74'),'id'])||{})[_0xf3ee('0x77')](function(_0x440495){for(var _0x129b67=0x0;_0x129b67<_0x4c0d9c['body'][_0xf3ee('0x74')][_0xf3ee('0x5f')];_0x129b67+=0x1){socket[_0xf3ee('0x78')](_0xf3ee('0x79'),{'UserId':Number(_0x4c0d9c[_0xf3ee('0x61')][_0xf3ee('0x74')][_0x129b67]),'WhatsappAccountId':Number(_0x4c0d9c[_0xf3ee('0x6a')]['id'])});}return _0x440495;});}})[_0xf3ee('0x24')](respondWithResult(_0x11f26e,null))[_0xf3ee('0x2e')](handleError(_0x11f26e,null));};exports['removeAgents']=function(_0x53bb33,_0x1bb8f0,_0x3f3ef8){return db[_0xf3ee('0x46')][_0xf3ee('0x64')]({'where':{'id':_0x53bb33[_0xf3ee('0x6a')]['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x1bb8f0,null))[_0xf3ee('0x24')](function(_0x171bdb){if(_0x171bdb){return _0x171bdb[_0xf3ee('0x7a')](_0x53bb33['query']['ids'])[_0xf3ee('0x24')](function(){if(_[_0xf3ee('0x7b')](_0x53bb33[_0xf3ee('0x4c')]['ids'])){for(var _0x2bf29e=0x0;_0x2bf29e<_0x53bb33[_0xf3ee('0x4c')][_0xf3ee('0x74')]['length'];_0x2bf29e+=0x1){socket['emit'](_0xf3ee('0x7c'),{'UserId':Number(_0x53bb33[_0xf3ee('0x4c')]['ids'][_0x2bf29e]),'WhatsappAccountId':Number(_0x53bb33['params']['id'])});}}else{socket[_0xf3ee('0x78')](_0xf3ee('0x7c'),{'UserId':Number(_0x53bb33[_0xf3ee('0x4c')][_0xf3ee('0x74')]),'WhatsappAccountId':Number(_0x53bb33[_0xf3ee('0x6a')]['id'])});}});}})[_0xf3ee('0x24')](respondWithStatusCode(_0x1bb8f0,null))[_0xf3ee('0x2e')](handleError(_0x1bb8f0,null));};exports[_0xf3ee('0x7d')]=function(_0x81cf3b,_0x3b219a,_0x34bd10){var _0x1f3cb1={};var _0x10d393={};var _0x4fddfb;var _0x60f719;return db[_0xf3ee('0x46')][_0xf3ee('0x6c')]({'where':{'id':_0x81cf3b[_0xf3ee('0x6a')]['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0x3b219a,null))['then'](function(_0x2576db){if(_0x2576db){_0x4fddfb=_0x2576db;_0x10d393['model']=_[_0xf3ee('0x4d')](db[_0xf3ee('0x7e')][_0xf3ee('0x47')]);_0x10d393[_0xf3ee('0x4c')]=_[_0xf3ee('0x4d')](_0x81cf3b[_0xf3ee('0x4c')]);_0x10d393['filters']=_[_0xf3ee('0x4e')](_0x10d393[_0xf3ee('0x4b')],_0x10d393[_0xf3ee('0x4c')]);_0x1f3cb1[_0xf3ee('0x4f')]=_['intersection'](_0x10d393[_0xf3ee('0x4b')],qs[_0xf3ee('0x50')](_0x81cf3b[_0xf3ee('0x4c')][_0xf3ee('0x50')]));_0x1f3cb1[_0xf3ee('0x4f')]=_0x1f3cb1[_0xf3ee('0x4f')][_0xf3ee('0x5f')]?_0x1f3cb1[_0xf3ee('0x4f')]:_0x10d393[_0xf3ee('0x4b')];_0x1f3cb1[_0xf3ee('0x53')]=qs[_0xf3ee('0x54')](_0x81cf3b[_0xf3ee('0x4c')][_0xf3ee('0x54')]);_0x1f3cb1['where']=qs['filters'](_[_0xf3ee('0x55')](_0x81cf3b[_0xf3ee('0x4c')],_0x10d393['filters']));if(_0x81cf3b[_0xf3ee('0x4c')][_0xf3ee('0x57')]){_0x1f3cb1['where']=_[_0xf3ee('0x59')](_0x1f3cb1[_0xf3ee('0x58')],{'$or':_[_0xf3ee('0x45')](_0x1f3cb1['attributes'],function(_0x2df2f0){var _0x3abeca={};_0x3abeca[_0x2df2f0]={'$like':'%'+_0x81cf3b[_0xf3ee('0x4c')][_0xf3ee('0x57')]+'%'};return _0x3abeca;})});}_0x1f3cb1=_['merge']({},_0x1f3cb1,_0x81cf3b[_0xf3ee('0x5a')]);return _0x4fddfb[_0xf3ee('0x7d')](_0x1f3cb1);}})[_0xf3ee('0x24')](function(_0x527122){if(_0x527122){_0x60f719=_0x527122[_0xf3ee('0x5f')];if(!_0x81cf3b[_0xf3ee('0x4c')][_0xf3ee('0x51')](_0xf3ee('0x52'))){_0x1f3cb1[_0xf3ee('0x36')]=qs['limit'](_0x81cf3b[_0xf3ee('0x4c')][_0xf3ee('0x36')]);_0x1f3cb1[_0xf3ee('0x33')]=qs[_0xf3ee('0x33')](_0x81cf3b['query'][_0xf3ee('0x33')]);}return _0x4fddfb[_0xf3ee('0x7d')](_0x1f3cb1);}})[_0xf3ee('0x24')](function(_0x5eaf82){if(_0x5eaf82){return _0x5eaf82?{'count':_0x60f719,'rows':_0x5eaf82}:null;}})['then'](respondWithResult(_0x3b219a,null))[_0xf3ee('0x2e')](handleError(_0x3b219a,null));};exports['addApplications']=function(_0xa931e,_0x892b75){var _0x28dc0b=_0xa931e[_0xf3ee('0x6a')]['id'];var _0x2cfcbe=_0xa931e[_0xf3ee('0x61')];var _0x3e6d92=0xc8;var _0x4a24ec=null;return db[_0xf3ee('0x7f')][_0xf3ee('0x80')]({'isolationLevel':db[_0xf3ee('0x7f')][_0xf3ee('0x81')][_0xf3ee('0x82')][_0xf3ee('0x83')]},function(_0x19b486){return db['WhatsappAccount'][_0xf3ee('0x6c')]({'where':{'id':_0x28dc0b},'transaction':_0x19b486})[_0xf3ee('0x24')](function(_0x2a354d){if(_0x2a354d){return db[_0xf3ee('0x84')][_0xf3ee('0x3b')]({'where':{'WhatsappAccountId':_0x28dc0b},'transaction':_0x19b486})[_0xf3ee('0x24')](function(){var _0x2e1171=_['map'](_0x2cfcbe,function(_0x1cbde5){_0x1cbde5[_0xf3ee('0x6b')]=_0x28dc0b;return _0x1cbde5;});return db[_0xf3ee('0x84')][_0xf3ee('0x85')](_0x2e1171,{'transaction':_0x19b486});});}else{_0x3e6d92=0x194;_0x4a24ec=[];}});})[_0xf3ee('0x24')](function(){if(_0x3e6d92!==0x194){return db[_0xf3ee('0x84')][_0xf3ee('0x86')]({'where':{'WhatsappAccountId':_0x28dc0b},'order':_0xf3ee('0x87')})[_0xf3ee('0x24')](function(_0x1b4770){_0x4a24ec=_0x1b4770;});}})[_0xf3ee('0x2e')](function(_0x2a07a7){_0x3e6d92=0x1f4;logger[_0xf3ee('0x2b')](_0x2a07a7['stack']);if(_0x2a07a7[_0xf3ee('0x40')]){delete _0x2a07a7['name'];}_0x4a24ec=_0x2a07a7;})['finally'](function(){if(_0x4a24ec===null){_0x892b75['sendStatus'](_0x3e6d92);}else{if(_0x3e6d92===0x1f4){_0x892b75['status'](_0x3e6d92)[_0xf3ee('0x41')](_0x4a24ec);}else{_0x892b75[_0xf3ee('0x30')](_0x3e6d92)[_0xf3ee('0x32')](_0x4a24ec);}}});};exports[_0xf3ee('0x88')]=function(_0x17547f,_0xbd2a66,_0x44c8fe){var _0x257138={};var _0x569364={};var _0x46fbde;var _0x2a10c8;return db[_0xf3ee('0x46')][_0xf3ee('0x6c')]({'where':{'id':_0x17547f[_0xf3ee('0x6a')]['id']}})[_0xf3ee('0x24')](handleEntityNotFound(_0xbd2a66,null))[_0xf3ee('0x24')](function(_0x3cb541){if(_0x3cb541){_0x46fbde=_0x3cb541;_0x569364[_0xf3ee('0x4b')]=_['keys'](db[_0xf3ee('0x84')][_0xf3ee('0x47')]);_0x569364[_0xf3ee('0x4c')]=_[_0xf3ee('0x4d')](_0x17547f['query']);_0x569364[_0xf3ee('0x56')]=_[_0xf3ee('0x4e')](_0x569364[_0xf3ee('0x4b')],_0x569364['query']);_0x257138[_0xf3ee('0x4f')]=_[_0xf3ee('0x4e')](_0x569364[_0xf3ee('0x4b')],qs['fields'](_0x17547f[_0xf3ee('0x4c')][_0xf3ee('0x50')]));_0x257138[_0xf3ee('0x4f')]=_0x257138[_0xf3ee('0x4f')][_0xf3ee('0x5f')]?_0x257138['attributes']:_0x569364[_0xf3ee('0x4b')];_0x257138[_0xf3ee('0x53')]=qs[_0xf3ee('0x54')](_0x17547f[_0xf3ee('0x4c')]['sort']);_0x257138[_0xf3ee('0x58')]=qs[_0xf3ee('0x56')](_[_0xf3ee('0x55')](_0x17547f[_0xf3ee('0x4c')],_0x569364['filters']));if(_0x17547f['query'][_0xf3ee('0x57')]){_0x257138[_0xf3ee('0x58')]=_[_0xf3ee('0x59')](_0x257138[_0xf3ee('0x58')],{'$or':_[_0xf3ee('0x45')](_0x257138[_0xf3ee('0x4f')],function(_0x3cccd5){var _0x3dee9f={};_0x3dee9f[_0x3cccd5]={'$like':'%'+_0x17547f[_0xf3ee('0x4c')][_0xf3ee('0x57')]+'%'};return _0x3dee9f;})});}_0x257138=_['merge']({},_0x257138,_0x17547f[_0xf3ee('0x5a')]);return _0x46fbde[_0xf3ee('0x88')](_0x257138);}})[_0xf3ee('0x24')](function(_0x235d9a){if(_0x235d9a){_0x2a10c8=_0x235d9a[_0xf3ee('0x5f')];if(!_0x17547f['query'][_0xf3ee('0x51')](_0xf3ee('0x52'))){_0x257138[_0xf3ee('0x36')]=qs[_0xf3ee('0x36')](_0x17547f[_0xf3ee('0x4c')]['limit']);_0x257138[_0xf3ee('0x33')]=qs[_0xf3ee('0x33')](_0x17547f[_0xf3ee('0x4c')][_0xf3ee('0x33')]);}return _0x46fbde[_0xf3ee('0x88')](_0x257138);}})[_0xf3ee('0x24')](function(_0x2f75d8){if(_0x2f75d8){return _0x2f75d8?{'count':_0x2a10c8,'rows':_0x2f75d8}:null;}})[_0xf3ee('0x24')](respondWithResult(_0xbd2a66,null))['catch'](handleError(_0xbd2a66,null));};exports[_0xf3ee('0x89')]=function(_0x21d85b,_0x40b8d7,_0x4d94d1){var _0x81d422={'channel':_0xf3ee('0x8a')};var _0x45b7fa=[];var _0x30d7f9=[];var _0x24614c={};return db[_0xf3ee('0x46')][_0xf3ee('0x64')]({'where':{'id':_0x21d85b['params']['id']},'include':[{'model':db[_0xf3ee('0x84')],'as':_0xf3ee('0x8b')}]})['then'](handleEntityNotFound(_0x40b8d7,null))['then'](function(_0x139f68){_0x81d422[_0xf3ee('0x8c')]=_0x139f68;if(_0x81d422['account']&&_0x81d422[_0xf3ee('0x8c')][_0xf3ee('0x49')]===_0xf3ee('0x8d')&&_0x21d85b[_0xf3ee('0x61')][_0xf3ee('0x8e')]){if(_0x21d85b['body'][_0xf3ee('0x8e')]['length']===0x0)return;if(_0x21d85b['body']['statuses'][0x0]['state']!=='read')return;return db[_0xf3ee('0x8f')][_0xf3ee('0x3a')]({'read':!![],'readAt':_0x21d85b['body'][_0xf3ee('0x8e')][0x0]['timestamp']},{'where':{'messageId':_0x21d85b[_0xf3ee('0x61')][_0xf3ee('0x8e')][0x0][_0xf3ee('0x90')]},'individualHooks':!![]})[_0xf3ee('0x24')](function(_0x589829){return _0x40b8d7[_0xf3ee('0x30')](0xc8)['json'](_0x589829);});}_0x81d422[_0xf3ee('0x91')]=_['orderBy'](_0x139f68[_0xf3ee('0x8b')],[_0xf3ee('0x87')],['asc']);if(_0x81d422[_0xf3ee('0x8c')][_0xf3ee('0x8b')]){delete _0x81d422['account']['Applications'];}return db[_0xf3ee('0x92')][_0xf3ee('0x68')]()[_0xf3ee('0x24')](function(_0x33eddb){if(!_0x33eddb){throw new db['Sequelize'][(_0xf3ee('0x93'))](_0xf3ee('0x94'));}_0x45b7fa=_[_0xf3ee('0x95')](_[_0xf3ee('0x4d')](_0x33eddb),['createdAt',_0xf3ee('0x96')]);_0x30d7f9=_['difference'](_[_0xf3ee('0x4d')](_0x33eddb),[_0xf3ee('0x97'),_0xf3ee('0x96'),_0xf3ee('0x98'),'ListId']);_0x81d422[_0xf3ee('0x61')]={'mapKey':_0xf3ee('0x99')};if(_0x81d422['account']&&_0x81d422['account'][_0xf3ee('0x49')]===_0xf3ee('0x9a')){_0x81d422[_0xf3ee('0x61')][_0xf3ee('0x9b')]=_0x21d85b[_0xf3ee('0x61')][_0xf3ee('0x9c')][_0xf3ee('0x9d')](_0xf3ee('0x9e'),'');_0x81d422[_0xf3ee('0x61')]['body']=_0x21d85b[_0xf3ee('0x61')][_0xf3ee('0x9f')];_0x81d422[_0xf3ee('0x61')]['messageId']=_0x21d85b['body'][_0xf3ee('0xa0')];}if(_0x81d422[_0xf3ee('0x8c')]&&_0x81d422[_0xf3ee('0x8c')][_0xf3ee('0x49')]===_0xf3ee('0x8d')){_0x81d422[_0xf3ee('0x61')][_0xf3ee('0x9b')]=_0x21d85b['body']['notifications'][0x0][_0xf3ee('0x9b')];_0x81d422[_0xf3ee('0x61')]['body']=_0x21d85b[_0xf3ee('0x61')]['notifications'][0x0]['message']['body'];_0x81d422[_0xf3ee('0x61')][_0xf3ee('0xa1')]=_0x21d85b[_0xf3ee('0x61')]['notifications'][0x0][_0xf3ee('0x90')];}if(_0x81d422[_0xf3ee('0x61')]['id']){delete _0x81d422[_0xf3ee('0x61')]['id'];}if(_[_0xf3ee('0xa2')](_0x81d422[_0xf3ee('0x61')]['from'])){throw new db[(_0xf3ee('0xa3'))][(_0xf3ee('0x93'))]('from\x20is\x20mandatory');}if(_[_0xf3ee('0xa2')](_0x81d422[_0xf3ee('0x61')][_0xf3ee('0x61')])||_0x81d422[_0xf3ee('0x61')][_0xf3ee('0x61')]===''){throw new db[(_0xf3ee('0xa3'))][(_0xf3ee('0x93'))](_0xf3ee('0xa4'));}if(_[_0xf3ee('0xa2')](_0x81d422[_0xf3ee('0x61')][_0xf3ee('0xa5')])){throw new db[(_0xf3ee('0xa3'))]['ValidationError'](_0xf3ee('0xa6')+_0x30d7f9);}if(!_[_0xf3ee('0xa7')](_0x30d7f9,_0x81d422['body']['mapKey'])){throw new db[(_0xf3ee('0xa3'))][(_0xf3ee('0x93'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x30d7f9);}_0x24614c[_0x81d422['body'][_0xf3ee('0xa5')]]=_0x81d422[_0xf3ee('0x61')]['from'];return db[_0xf3ee('0xa8')][_0xf3ee('0x64')]({'where':{'id':_0x81d422[_0xf3ee('0x8c')][_0xf3ee('0xa9')]},'include':[{'model':db['CmContact'],'as':_0xf3ee('0xaa'),'where':_0x24614c,'limit':0x1,'order':[[_0xf3ee('0x96'),'DESC']]}]});})[_0xf3ee('0x24')](handleEntityNotFound(_0x40b8d7,null))[_0xf3ee('0x24')](function(_0x26c255){if(_0x26c255){_0x81d422[_0xf3ee('0xab')]=_[_0xf3ee('0x76')](_0x26c255,['Contacts']);if(_0x26c255['Contacts']['length']){return _0x26c255['Contacts'][0x0];}var _0x1e6b50=_['defaults'](_0x81d422['body'],{'firstName':_0x81d422[_0xf3ee('0x61')][_0xf3ee('0x9b')],'ListId':_0x26c255['id']});_0x1e6b50[_0x81d422[_0xf3ee('0x61')][_0xf3ee('0xa5')]]=_0x81d422[_0xf3ee('0x61')]['from'];return db[_0xf3ee('0x92')][_0xf3ee('0x60')](_0x1e6b50,{'fields':_0x45b7fa,'raw':!![]});}})[_0xf3ee('0x24')](handleEntityNotFound(_0x40b8d7,null))[_0xf3ee('0x24')](function(_0x10a3c1){if(_0x10a3c1){_0x81d422['contact']=_0x10a3c1;var _0xdfdd7b={'ContactId':_0x10a3c1['id'],'phone':_0x81d422[_0xf3ee('0x61')]['from'],'WhatsappAccountId':_0x21d85b[_0xf3ee('0x6a')]['id']};var _0x35b052={'ContactId':_0x10a3c1['id'],'WhatsappAccountId':_0x21d85b[_0xf3ee('0x6a')]['id'],'closed':![]};return db[_0xf3ee('0xac')][_0xf3ee('0x64')]({'where':_0x35b052})[_0xf3ee('0x24')](function(_0x413d75){if(_0x413d75){return[_0x413d75,![]];}return db[_0xf3ee('0xac')][_0xf3ee('0x60')](_0xdfdd7b)['then'](function(_0x1f7dc8){return[_0x1f7dc8,!![]];});});}})[_0xf3ee('0x77')](function(_0x2940f4,_0x43a0e4){_0x81d422[_0xf3ee('0xad')]=_0x2940f4[_0xf3ee('0x3c')]({'plain':!![]});_0x81d422[_0xf3ee('0xad')][_0xf3ee('0xae')]=![];if(_0x43a0e4){if(_0x81d422['account'][_0xf3ee('0xaf')]){_0x81d422[_0xf3ee('0x91')][_0xf3ee('0xb0')]({'id':0x0,'priority':_0x81d422[_0xf3ee('0x91')]['length']+0x1,'app':_0xf3ee('0xb1'),'appdata':_0xf3ee('0xb2'),'interval':_0xf3ee('0xb3')});}_0x81d422['interaction'][_0xf3ee('0xae')]=!![];}return db[_0xf3ee('0x8f')][_0xf3ee('0x60')]({'phone':_0x81d422[_0xf3ee('0x61')][_0xf3ee('0x9b')],'messageId':_0x81d422[_0xf3ee('0x61')][_0xf3ee('0xa1')],'body':_0x81d422['body']['body'],'WhatsappAccountId':_0x21d85b[_0xf3ee('0x6a')]['id'],'WhatsappInteractionId':_0x2940f4['id'],'direction':'in','ContactId':_0x2940f4[_0xf3ee('0xb4')],'AttachmentId':_0x81d422[_0xf3ee('0x61')][_0xf3ee('0xb5')]});})[_0xf3ee('0x24')](function(_0x11aa79){_0x81d422[_0xf3ee('0x2c')]=_0x11aa79;if(_0x81d422['interaction']['UserId']){return db['User']['find']({'attributes':['id',_0xf3ee('0x40')],'where':{'id':_0x81d422['interaction']['UserId']}})['then'](function(_0x4fccfd){if(_0x4fccfd){_0x81d422[_0xf3ee('0x91')][_0xf3ee('0xb6')]({'id':0x0,'priority':0x0,'app':_0xf3ee('0xb7'),'appdata':_0x4fccfd[_0xf3ee('0x40')]+','+(_0x81d422[_0xf3ee('0x8c')]['waitForTheAssignedAgent']||0xa),'interval':_0xf3ee('0xb3')});}return respondWithRpcPromise('Start',_0xf3ee('0xb8'),_0x81d422);});}return respondWithRpcPromise(_0xf3ee('0xb9'),_0xf3ee('0xb8'),_0x81d422);})[_0xf3ee('0x24')](function(_0x2b4d28){if(_0x2b4d28){var _0x52ba37=0xc8;var _0x1e0cc5='receiveMessage';logger[_0xf3ee('0x25')](_0xf3ee('0x29'),_0x1e0cc5,_0x52ba37,_0xf3ee('0xba'));logger[_0xf3ee('0x28')](_0xf3ee('0xbb'),_0x1e0cc5,_0x52ba37,'entity\x20found',JSON['stringify'](_0x2b4d28));if(_0x81d422[_0xf3ee('0x8c')][_0xf3ee('0x49')]===_0xf3ee('0x9a')){return _0x40b8d7[_0xf3ee('0x30')](_0x52ba37)['set'](_0xf3ee('0xbc'),'text/xml')['send']('\x0a');}else{return _0x40b8d7['status'](_0x52ba37)[_0xf3ee('0x32')](_0x2b4d28);}}});})[_0xf3ee('0x2e')](handleError(_0x40b8d7,null));};exports[_0xf3ee('0x41')]=function(_0x156b3b,_0x57ef00,_0x56e092){var _0x4e1637,_0x4864f6,_0x2f6e68;if(_[_0xf3ee('0xa2')](_0x156b3b['body'][_0xf3ee('0x61')])||_0x156b3b[_0xf3ee('0x61')][_0xf3ee('0x61')]===''){throw new db[(_0xf3ee('0xa3'))][(_0xf3ee('0x93'))](_0xf3ee('0xa4'));}if(_['isNil'](_0x156b3b[_0xf3ee('0x61')]['to'])){throw new db[(_0xf3ee('0xa3'))]['ValidationError'](_0xf3ee('0xbd'));}_0x4e1637=_0x156b3b[_0xf3ee('0x61')]['to'];return db[_0xf3ee('0x46')]['find']({'where':{'id':_0x156b3b[_0xf3ee('0x6a')]['id']},'include':[{'model':db[_0xf3ee('0xa8')],'as':_0xf3ee('0xbe'),'include':[{'model':db[_0xf3ee('0x92')],'as':_0xf3ee('0xaa'),'where':{'mobile':_0x4e1637},'limit':0x1,'order':[[_0xf3ee('0x96'),_0xf3ee('0xbf')]]}]}]})[_0xf3ee('0x24')](handleEntityNotFound(_0x57ef00,null))[_0xf3ee('0x24')](function(_0x54cb6c){if(_0x54cb6c&&_0x54cb6c['List']){_0x4864f6=_0x54cb6c[_0xf3ee('0x3c')]({'plain':!![]});if(_0x4864f6[_0xf3ee('0xbe')]&&_0x4864f6['List']['Contacts'][_0xf3ee('0x5f')]){return _0x4864f6['List'][_0xf3ee('0xaa')][0x0];}return db['CmContact'][_0xf3ee('0x60')](_[_0xf3ee('0x1b')](_0x156b3b[_0xf3ee('0x61')],{'firstName':_0x4e1637,'mobile':_0x4e1637,'phone':_0x4e1637,'ListId':_0x4864f6[_0xf3ee('0xa9')]}));}})[_0xf3ee('0x24')](handleEntityNotFound(_0x57ef00,null))[_0xf3ee('0x24')](function(_0x3cb1fb){if(_0x3cb1fb){_0x2f6e68=_0x3cb1fb;return db[_0xf3ee('0xac')][_0xf3ee('0x64')]({'where':{'ContactId':_0x2f6e68['id'],'closed':![],'WhatsappAccountId':_0x4864f6['id']}})['then'](function(_0x5a9630){if(_0x5a9630){return[_0x5a9630,![]];}return db['WhatsappInteraction'][_0xf3ee('0x60')]({'UserId':_0x156b3b[_0xf3ee('0x62')]['id'],'ContactId':_0x2f6e68['id'],'WhatsappAccountId':_0x4864f6['id'],'phone':_0x4e1637,'firstMsgDirection':_0xf3ee('0xc0'),'Messages':[_[_0xf3ee('0x59')](_0x156b3b[_0xf3ee('0x61')],{'read':![],'body':_0x156b3b[_0xf3ee('0x61')][_0xf3ee('0x61')],'phone':_0x4e1637,'WhatsappAccountId':_0x4864f6['id'],'UserId':_0x156b3b[_0xf3ee('0x62')]['id'],'ContactId':_0x2f6e68['id']})]},{'include':[{'model':db[_0xf3ee('0x8f')],'as':_0xf3ee('0xc1')}]})['then'](function(_0x5d5970){return[_0x5d5970,!![]];});});}})[_0xf3ee('0x77')](function(_0x2e2927,_0x20c4e1){if(_0x20c4e1){return _0x2e2927;}return db[_0xf3ee('0x8f')][_0xf3ee('0x60')](_[_0xf3ee('0x59')](_0x156b3b[_0xf3ee('0x61')],{'read':![],'body':_0x156b3b[_0xf3ee('0x61')][_0xf3ee('0x61')],'phone':_0x4e1637,'WhatsappAccountId':_0x4864f6['id'],'WhatsappInteractionId':_0x2e2927['id'],'UserId':_0x156b3b['user']['id'],'ContactId':_0x2f6e68['id']}))[_0xf3ee('0x24')](function(_0x1a7cf6){_0x2e2927[_0xf3ee('0xc2')]['Messages']=[];_0x2e2927[_0xf3ee('0xc2')][_0xf3ee('0xc1')][_0xf3ee('0xb0')](_0x1a7cf6[_0xf3ee('0xc2')]);return _0x2e2927;});})[_0xf3ee('0x24')](respondWithResult(_0x57ef00,null))[_0xf3ee('0x2e')](handleError(_0x57ef00,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 01f9b23..229115e 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 _0x10e8=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit'];(function(_0x2a318a,_0x3f8006){var _0x346cf3=function(_0x314595){while(--_0x314595){_0x2a318a['push'](_0x2a318a['shift']());}};_0x346cf3(++_0x3f8006);}(_0x10e8,0xb7));var _0x810e=function(_0x5cc5b8,_0x4be1a8){_0x5cc5b8=_0x5cc5b8-0x0;var _0x3e3371=_0x10e8[_0x5cc5b8];return _0x3e3371;};'use strict';var EventEmitter=require(_0x810e('0x0'));var WhatsappAccount=require(_0x810e('0x1'))['db'][_0x810e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x810e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x810e('0x4'),'afterDestroy':_0x810e('0x5')};function emitEvent(_0xa675c0){return function(_0x14fb2d,_0x3d59a9,_0xac11d2){WhatsappAccountEvents[_0x810e('0x6')](_0xa675c0+':'+_0x14fb2d['id'],_0x14fb2d);WhatsappAccountEvents[_0x810e('0x6')](_0xa675c0,_0x14fb2d);_0xac11d2(null);};}for(var e in events){if(events[_0x810e('0x7')](e)){var event=events[e];WhatsappAccount[_0x810e('0x8')](e,emitEvent(event));}}module[_0x810e('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x3d50=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x29597e,_0x5435e9){var _0x2a40e1=function(_0xd0e69){while(--_0xd0e69){_0x29597e['push'](_0x29597e['shift']());}};_0x2a40e1(++_0x5435e9);}(_0x3d50,0x16c));var _0x03d5=function(_0x983080,_0x422b75){_0x983080=_0x983080-0x0;var _0x557d78=_0x3d50[_0x983080];return _0x557d78;};'use strict';var EventEmitter=require(_0x03d5('0x0'));var WhatsappAccount=require(_0x03d5('0x1'))['db'][_0x03d5('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x03d5('0x3')](0x0);var events={'afterCreate':_0x03d5('0x4'),'afterUpdate':_0x03d5('0x5'),'afterDestroy':_0x03d5('0x6')};function emitEvent(_0x2a7aca){return function(_0x4a63e5,_0x18f7a5,_0x2e349d){WhatsappAccountEvents[_0x03d5('0x7')](_0x2a7aca+':'+_0x4a63e5['id'],_0x4a63e5);WhatsappAccountEvents[_0x03d5('0x7')](_0x2a7aca,_0x4a63e5);_0x2e349d(null);};}for(var e in events){if(events[_0x03d5('0x8')](e)){var event=events[e];WhatsappAccount[_0x03d5('0x9')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 851decd..687ac06 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 _0xa3ec=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','lodash'];(function(_0x35dcb1,_0x14cb4){var _0x45caba=function(_0x4e8213){while(--_0x4e8213){_0x35dcb1['push'](_0x35dcb1['shift']());}};_0x45caba(++_0x14cb4);}(_0xa3ec,0x133));var _0xca3e=function(_0x3254bc,_0x69e337){_0x3254bc=_0x3254bc-0x0;var _0x204ffb=_0xa3ec[_0x3254bc];return _0x204ffb;};'use strict';var _=require(_0xca3e('0x0'));var util=require(_0xca3e('0x1'));var logger=require(_0xca3e('0x2'))('api');var moment=require(_0xca3e('0x3'));var BPromise=require(_0xca3e('0x4'));var rp=require(_0xca3e('0x5'));var fs=require('fs');var path=require(_0xca3e('0x6'));var rimraf=require(_0xca3e('0x7'));var config=require('../../config/environment');var attributes=require(_0xca3e('0x8'));module['exports']=function(_0x1e8aa0,_0x281b40){return _0x1e8aa0[_0xca3e('0x9')](_0xca3e('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d1e=['define','WhatsappAccount','whatsapp_accounts','util','api','moment','bluebird','request-promise','path','exports'];(function(_0x3c06c3,_0x912934){var _0x405357=function(_0x5d4dd6){while(--_0x5d4dd6){_0x3c06c3['push'](_0x3c06c3['shift']());}};_0x405357(++_0x912934);}(_0x2d1e,0x1b1));var _0xe2d1=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2d1e[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0xe2d1('0x0'));var logger=require('../../config/logger')(_0xe2d1('0x1'));var moment=require(_0xe2d1('0x2'));var BPromise=require(_0xe2d1('0x3'));var rp=require(_0xe2d1('0x4'));var fs=require('fs');var path=require(_0xe2d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0xe2d1('0x6')]=function(_0x279d81,_0x5a3d92){return _0x279d81[_0xe2d1('0x7')](_0xe2d1('0x8'),attributes,{'tableName':_0xe2d1('0x9'),'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 4dded09..4ebe1ea 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 _0x9f7c=['find','options','raw','where','attributes','map','model','ShowWhatsappAccount','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','WhatsappAccount'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9f7c,0x1eb));var _0xc9f7=function(_0x388ea0,_0xfa6251){_0x388ea0=_0x388ea0-0x0;var _0xd3ad8c=_0x9f7c[_0x388ea0];return _0xd3ad8c;};'use strict';var _=require(_0xc9f7('0x0'));var util=require(_0xc9f7('0x1'));var moment=require('moment');var BPromise=require(_0xc9f7('0x2'));var rs=require(_0xc9f7('0x3'));var fs=require('fs');var Redis=require(_0xc9f7('0x4'));var db=require(_0xc9f7('0x5'))['db'];var utils=require(_0xc9f7('0x6'));var logger=require('../../config/logger')(_0xc9f7('0x7'));var config=require(_0xc9f7('0x8'));var jayson=require(_0xc9f7('0x9'));var client=jayson[_0xc9f7('0xa')]['http']({'port':0x232a});config[_0xc9f7('0xb')]=_['defaults'](config[_0xc9f7('0xb')],{'host':_0xc9f7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc9f7('0xd'))[_0xc9f7('0xe')](socket);function respondWithRpcPromise(_0x3b499d,_0x49ba4e,_0x527d02){return new BPromise(function(_0x236b8b,_0x29c427){return client[_0xc9f7('0xf')](_0x3b499d,_0x527d02)[_0xc9f7('0x10')](function(_0x51a23c){logger[_0xc9f7('0x11')](_0xc9f7('0x12'),_0x49ba4e,_0xc9f7('0x13'));logger['debug'](_0xc9f7('0x14'),_0x49ba4e,'request\x20sent',JSON['stringify'](_0x51a23c));if(_0x51a23c['error']){if(_0x51a23c['error'][_0xc9f7('0x15')]===0x1f4){logger['error'](_0xc9f7('0x12'),_0x49ba4e,_0x51a23c[_0xc9f7('0x16')][_0xc9f7('0x17')]);return _0x29c427(_0x51a23c['error'][_0xc9f7('0x17')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x49ba4e,_0x51a23c[_0xc9f7('0x16')]['message']);return _0x236b8b(_0x51a23c[_0xc9f7('0x16')][_0xc9f7('0x17')]);}else{logger[_0xc9f7('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x49ba4e,_0xc9f7('0x13'));_0x236b8b(_0x51a23c[_0xc9f7('0x18')][_0xc9f7('0x17')]);}})[_0xc9f7('0x19')](function(_0x3b8365){logger['error'](_0xc9f7('0x12'),_0x49ba4e,_0x3b8365);_0x29c427(_0x3b8365);});});}exports['ShowWhatsappAccount']=function(_0x3df499){var _0x1ae7ea=this;return new Promise(function(_0x2be5ba,_0x4bd62d){return db[_0xc9f7('0x1a')][_0xc9f7('0x1b')]({'raw':_0x3df499[_0xc9f7('0x1c')]?_0x3df499[_0xc9f7('0x1c')][_0xc9f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x3df499[_0xc9f7('0x1c')]?_0x3df499[_0xc9f7('0x1c')][_0xc9f7('0x1e')]||null:null,'attributes':_0x3df499[_0xc9f7('0x1c')]?_0x3df499[_0xc9f7('0x1c')][_0xc9f7('0x1f')]||null:null,'include':_0x3df499['options']?_0x3df499[_0xc9f7('0x1c')]['include']?_['map'](_0x3df499[_0xc9f7('0x1c')]['include'],function(_0x2348f1){return{'model':db[_0x2348f1['model']],'as':_0x2348f1['as'],'attributes':_0x2348f1['attributes'],'include':_0x2348f1['include']?_[_0xc9f7('0x20')](_0x2348f1['include'],function(_0x267f8c){return{'model':db[_0x267f8c[_0xc9f7('0x21')]],'as':_0x267f8c['as'],'attributes':_0x267f8c['attributes'],'include':_0x267f8c['include']?_['map'](_0x267f8c['include'],function(_0x53d678){return{'model':db[_0x53d678[_0xc9f7('0x21')]],'as':_0x53d678['as'],'attributes':_0x53d678[_0xc9f7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20b9f7){logger[_0xc9f7('0x11')](_0xc9f7('0x22'),_0x3df499);logger[_0xc9f7('0x23')](_0xc9f7('0x22'),_0x3df499,JSON[_0xc9f7('0x24')](_0x20b9f7));_0x2be5ba(_0x20b9f7);})[_0xc9f7('0x19')](function(_0x3e2ea8){logger[_0xc9f7('0x16')](_0xc9f7('0x22'),_0x3e2ea8[_0xc9f7('0x17')],_0x3df499);_0x4bd62d(_0x1ae7ea[_0xc9f7('0x16')](0x1f4,_0x3e2ea8[_0xc9f7('0x17')]));});});}; \ No newline at end of file +var _0xc0ac=['randomstring','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappAccount','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','bluebird'];(function(_0x5aaf93,_0x5c0001){var _0x17d307=function(_0x21d77a){while(--_0x21d77a){_0x5aaf93['push'](_0x5aaf93['shift']());}};_0x17d307(++_0x5c0001);}(_0xc0ac,0x65));var _0xcc0a=function(_0x28d874,_0x47fefd){_0x28d874=_0x28d874-0x0;var _0x99af4d=_0xc0ac[_0x28d874];return _0x99af4d;};'use strict';var _=require(_0xcc0a('0x0'));var util=require(_0xcc0a('0x1'));var moment=require(_0xcc0a('0x2'));var BPromise=require(_0xcc0a('0x3'));var rs=require(_0xcc0a('0x4'));var fs=require('fs');var Redis=require(_0xcc0a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc0a('0x6'))('rpc');var config=require(_0xcc0a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc0a('0x8')][_0xcc0a('0x9')]({'port':0x232a});config[_0xcc0a('0xa')]=_[_0xcc0a('0xb')](config['redis'],{'host':_0xcc0a('0xc'),'port':0x18eb});var socket=require(_0xcc0a('0xd'))(new Redis(config[_0xcc0a('0xa')]));require('./whatsappAccount.socket')[_0xcc0a('0xe')](socket);function respondWithRpcPromise(_0x49dbf2,_0x1dd9af,_0x3b6267){return new BPromise(function(_0x48028f,_0x1cfa81){return client[_0xcc0a('0xf')](_0x49dbf2,_0x3b6267)[_0xcc0a('0x10')](function(_0x432135){logger['info'](_0xcc0a('0x11'),_0x1dd9af,_0xcc0a('0x12'));logger[_0xcc0a('0x13')](_0xcc0a('0x14'),_0x1dd9af,_0xcc0a('0x12'),JSON[_0xcc0a('0x15')](_0x432135));if(_0x432135[_0xcc0a('0x16')]){if(_0x432135[_0xcc0a('0x16')]['code']===0x1f4){logger[_0xcc0a('0x16')](_0xcc0a('0x11'),_0x1dd9af,_0x432135[_0xcc0a('0x16')][_0xcc0a('0x17')]);return _0x1cfa81(_0x432135['error'][_0xcc0a('0x17')]);}logger['error'](_0xcc0a('0x11'),_0x1dd9af,_0x432135['error'][_0xcc0a('0x17')]);return _0x48028f(_0x432135[_0xcc0a('0x16')]['message']);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x1dd9af,_0xcc0a('0x12'));_0x48028f(_0x432135[_0xcc0a('0x18')][_0xcc0a('0x17')]);}})[_0xcc0a('0x19')](function(_0x33befe){logger[_0xcc0a('0x16')](_0xcc0a('0x11'),_0x1dd9af,_0x33befe);_0x1cfa81(_0x33befe);});});}exports['ShowWhatsappAccount']=function(_0x39b122){var _0x150952=this;return new Promise(function(_0x247fb3,_0x16cad4){return db[_0xcc0a('0x1a')]['find']({'raw':_0x39b122[_0xcc0a('0x1b')]?_0x39b122['options'][_0xcc0a('0x1c')]===undefined?!![]:![]:!![],'where':_0x39b122['options']?_0x39b122[_0xcc0a('0x1b')][_0xcc0a('0x1d')]||null:null,'attributes':_0x39b122[_0xcc0a('0x1b')]?_0x39b122[_0xcc0a('0x1b')][_0xcc0a('0x1e')]||null:null,'include':_0x39b122[_0xcc0a('0x1b')]?_0x39b122[_0xcc0a('0x1b')][_0xcc0a('0x1f')]?_[_0xcc0a('0x20')](_0x39b122[_0xcc0a('0x1b')][_0xcc0a('0x1f')],function(_0x36c493){return{'model':db[_0x36c493[_0xcc0a('0x21')]],'as':_0x36c493['as'],'attributes':_0x36c493[_0xcc0a('0x1e')],'include':_0x36c493[_0xcc0a('0x1f')]?_[_0xcc0a('0x20')](_0x36c493[_0xcc0a('0x1f')],function(_0x3153b0){return{'model':db[_0x3153b0[_0xcc0a('0x21')]],'as':_0x3153b0['as'],'attributes':_0x3153b0['attributes'],'include':_0x3153b0[_0xcc0a('0x1f')]?_['map'](_0x3153b0['include'],function(_0x2e51b1){return{'model':db[_0x2e51b1['model']],'as':_0x2e51b1['as'],'attributes':_0x2e51b1[_0xcc0a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcc0a('0x10')](function(_0x52d3dd){logger['info']('ShowWhatsappAccount',_0x39b122);logger[_0xcc0a('0x13')](_0xcc0a('0x22'),_0x39b122,JSON[_0xcc0a('0x15')](_0x52d3dd));_0x247fb3(_0x52d3dd);})[_0xcc0a('0x19')](function(_0x190d21){logger[_0xcc0a('0x16')](_0xcc0a('0x22'),_0x190d21[_0xcc0a('0x17')],_0x39b122);_0x16cad4(_0x150952[_0xcc0a('0x16')](0x1f4,_0x190d21['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index af5361d..6ebd065 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 _0x00e5=['register','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit'];(function(_0x3b4967,_0x267d42){var _0x47fc11=function(_0x5b6c4b){while(--_0x5b6c4b){_0x3b4967['push'](_0x3b4967['shift']());}};_0x47fc11(++_0x267d42);}(_0x00e5,0x19f));var _0x500e=function(_0x2c835c,_0x4e4595){_0x2c835c=_0x2c835c-0x0;var _0x26c418=_0x00e5[_0x2c835c];return _0x26c418;};'use strict';var WhatsappAccountEvents=require(_0x500e('0x0'));var events=[_0x500e('0x1'),_0x500e('0x2'),_0x500e('0x3')];function createListener(_0x244084,_0x581de7){return function(_0x5e0eb9){_0x581de7[_0x500e('0x4')](_0x244084,_0x5e0eb9);};}function removeListener(_0xcb2db2,_0x334625){return function(){WhatsappAccountEvents['removeListener'](_0xcb2db2,_0x334625);};}exports[_0x500e('0x5')]=function(_0x34573e){for(var _0x2154e6=0x0,_0x3d1156=events['length'];_0x2154e6<_0x3d1156;_0x2154e6++){var _0x5840e5=events[_0x2154e6];var _0x4fd636=createListener(_0x500e('0x6')+_0x5840e5,_0x34573e);WhatsappAccountEvents['on'](_0x5840e5,_0x4fd636);}}; \ No newline at end of file +var _0x0c0d=['save','remove','update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x4237bc,_0x37b2dc){var _0x3859ce=function(_0x348a5a){while(--_0x348a5a){_0x4237bc['push'](_0x4237bc['shift']());}};_0x3859ce(++_0x37b2dc);}(_0x0c0d,0xcf));var _0xd0c0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0c0d[_0x2dafbe];return _0x58a45a;};'use strict';var WhatsappAccountEvents=require(_0xd0c0('0x0'));var events=[_0xd0c0('0x1'),_0xd0c0('0x2'),_0xd0c0('0x3')];function createListener(_0x221621,_0x1ba2cc){return function(_0x2a8f6d){_0x1ba2cc['emit'](_0x221621,_0x2a8f6d);};}function removeListener(_0x2c0a57,_0x27f8c1){return function(){WhatsappAccountEvents[_0xd0c0('0x4')](_0x2c0a57,_0x27f8c1);};}exports[_0xd0c0('0x5')]=function(_0x356190){for(var _0x14f36a=0x0,_0x2b296e=events[_0xd0c0('0x6')];_0x14f36a<_0x2b296e;_0x14f36a++){var _0x242320=events[_0x14f36a];var _0x7bbec3=createListener(_0xd0c0('0x7')+_0x242320,_0x356190);WhatsappAccountEvents['on'](_0x242320,_0x7bbec3);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 4db094e..9620422 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 _0xcfb2=['put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x18dc34,_0x205f71){var _0x4ab15b=function(_0x50572f){while(--_0x50572f){_0x18dc34['push'](_0x18dc34['shift']());}};_0x4ab15b(++_0x205f71);}(_0xcfb2,0x64));var _0x2cfb=function(_0x2ae834,_0x18e3c4){_0x2ae834=_0x2ae834-0x0;var _0x206246=_0xcfb2[_0x2ae834];return _0x206246;};'use strict';var multer=require(_0x2cfb('0x0'));var util=require('util');var path=require(_0x2cfb('0x1'));var timeout=require(_0x2cfb('0x2'));var express=require('express');var router=express[_0x2cfb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2cfb('0x4'));var interaction=require(_0x2cfb('0x5'));var config=require(_0x2cfb('0x6'));var controller=require('./whatsappApplication.controller');router[_0x2cfb('0x7')]('/',auth[_0x2cfb('0x8')](),controller[_0x2cfb('0x9')]);router[_0x2cfb('0x7')](_0x2cfb('0xa'),auth['isAuthenticated'](),controller[_0x2cfb('0xb')]);router[_0x2cfb('0xc')]('/',auth[_0x2cfb('0x8')](),controller[_0x2cfb('0xd')]);router[_0x2cfb('0xe')](_0x2cfb('0xa'),auth['isAuthenticated'](),controller[_0x2cfb('0xf')]);router[_0x2cfb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2cfb('0x11')]);module[_0x2cfb('0x12')]=router; \ No newline at end of file +var _0x224f=['/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index'];(function(_0x3a3025,_0x4606bb){var _0x55f2aa=function(_0x5a8022){while(--_0x5a8022){_0x3a3025['push'](_0x3a3025['shift']());}};_0x55f2aa(++_0x4606bb);}(_0x224f,0x67));var _0xf224=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x224f[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xf224('0x0'));var util=require('util');var path=require(_0xf224('0x1'));var timeout=require(_0xf224('0x2'));var express=require(_0xf224('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf224('0x4'));var interaction=require(_0xf224('0x5'));var config=require('../../config/environment');var controller=require(_0xf224('0x6'));router['get']('/',auth[_0xf224('0x7')](),controller[_0xf224('0x8')]);router['get'](_0xf224('0x9'),auth[_0xf224('0x7')](),controller[_0xf224('0xa')]);router[_0xf224('0xb')]('/',auth[_0xf224('0x7')](),controller['create']);router[_0xf224('0xc')](_0xf224('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xf224('0xd')](_0xf224('0x9'),auth['isAuthenticated'](),controller[_0xf224('0xe')]);module[_0xf224('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index b9881df..d064f59 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 _0x7ff4=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x187907,_0x524178){var _0x215f4b=function(_0x304323){while(--_0x304323){_0x187907['push'](_0x187907['shift']());}};_0x215f4b(++_0x524178);}(_0x7ff4,0xf3));var _0x47ff=function(_0xbf375a,_0x117543){_0xbf375a=_0xbf375a-0x0;var _0xa1265d=_0x7ff4[_0xbf375a];return _0xa1265d;};'use strict';var Sequelize=require(_0x47ff('0x0'));module[_0x47ff('0x1')]={'priority':{'type':Sequelize[_0x47ff('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x47ff('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x47ff('0x4')]()},'description':{'type':Sequelize[_0x47ff('0x3')]},'interval':{'type':Sequelize[_0x47ff('0x3')],'defaultValue':_0x47ff('0x5')}}; \ No newline at end of file +var _0x73e7=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x73e7,0x18b));var _0x773e=function(_0x2de8bb,_0x1cc93a){_0x2de8bb=_0x2de8bb-0x0;var _0x50859d=_0x73e7[_0x2de8bb];return _0x50859d;};'use strict';var Sequelize=require(_0x773e('0x0'));module[_0x773e('0x1')]={'priority':{'type':Sequelize[_0x773e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x773e('0x3')],'allowNull':![],'defaultValue':_0x773e('0x4')},'appdata':{'type':Sequelize[_0x773e('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x773e('0x3')],'defaultValue':_0x773e('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 27b60d0..1a52aea 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 _0x1189=['merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','WhatsappApplication','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter'];(function(_0x45aa83,_0x15b34d){var _0x3a21f3=function(_0x193387){while(--_0x193387){_0x45aa83['push'](_0x45aa83['shift']());}};_0x3a21f3(++_0x15b34d);}(_0x1189,0x17f));var _0x9118=function(_0x596d89,_0x3f9156){_0x596d89=_0x596d89-0x0;var _0x571fd5=_0x1189[_0x596d89];return _0x571fd5;};'use strict';var emlformat=require(_0x9118('0x0'));var rimraf=require(_0x9118('0x1'));var zipdir=require(_0x9118('0x2'));var jsonpatch=require(_0x9118('0x3'));var rp=require('request-promise');var moment=require(_0x9118('0x4'));var BPromise=require(_0x9118('0x5'));var Mustache=require(_0x9118('0x6'));var util=require(_0x9118('0x7'));var path=require(_0x9118('0x8'));var sox=require(_0x9118('0x9'));var csv=require(_0x9118('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9118('0xb'));var _=require(_0x9118('0xc'));var squel=require(_0x9118('0xd'));var crypto=require(_0x9118('0xe'));var jsforce=require(_0x9118('0xf'));var deskjs=require(_0x9118('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9118('0x11'));var Papa=require(_0x9118('0x12'));var Redis=require(_0x9118('0x13'));var authService=require(_0x9118('0x14'));var qs=require(_0x9118('0x15'));var as=require(_0x9118('0x16'));var hardwareService=require(_0x9118('0x17'));var logger=require('../../config/logger')(_0x9118('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9118('0x19'));var db=require(_0x9118('0x1a'))['db'];function respondWithStatusCode(_0x57a2ee,_0x3b2bd0){_0x3b2bd0=_0x3b2bd0||0xcc;return function(_0x6fad0b){if(_0x6fad0b){return _0x57a2ee[_0x9118('0x1b')](_0x3b2bd0);}return _0x57a2ee[_0x9118('0x1c')](_0x3b2bd0)[_0x9118('0x1d')]();};}function respondWithResult(_0x3817ab,_0x42c301){_0x42c301=_0x42c301||0xc8;return function(_0x11b1b9){if(_0x11b1b9){return _0x3817ab[_0x9118('0x1c')](_0x42c301)[_0x9118('0x1e')](_0x11b1b9);}};}function respondWithFilteredResult(_0x2c1ab4,_0x48e13a){return function(_0x5c403d){if(_0x5c403d){var _0x30241a=typeof _0x48e13a['offset']===_0x9118('0x1f')&&typeof _0x48e13a[_0x9118('0x20')]===_0x9118('0x1f');var _0x1f0b31=_0x5c403d['count'];var _0x3b37ac=_0x30241a?0x0:_0x48e13a['offset'];var _0x1240da=_0x30241a?_0x5c403d['count']:_0x48e13a[_0x9118('0x21')]+_0x48e13a[_0x9118('0x20')];var _0x4d4826;if(_0x1240da>=_0x1f0b31){_0x1240da=_0x1f0b31;_0x4d4826=0xc8;}else{_0x4d4826=0xce;}_0x2c1ab4[_0x9118('0x1c')](_0x4d4826);return _0x2c1ab4[_0x9118('0x22')](_0x9118('0x23'),_0x3b37ac+'-'+_0x1240da+'/'+_0x1f0b31)[_0x9118('0x1e')](_0x5c403d);}return null;};}function patchUpdates(_0x30756f){return function(_0x5e683e){try{jsonpatch[_0x9118('0x24')](_0x5e683e,_0x30756f,!![]);}catch(_0x178b01){return BPromise[_0x9118('0x25')](_0x178b01);}return _0x5e683e[_0x9118('0x26')]();};}function saveUpdates(_0x3bae42,_0x87dfa9){return function(_0x2ad073){if(_0x2ad073){return _0x2ad073[_0x9118('0x27')](_0x3bae42)[_0x9118('0x28')](function(_0x47177b){return _0x47177b;});}return null;};}function removeEntity(_0x5613dc,_0x2f338e){return function(_0x5b0c3b){if(_0x5b0c3b){return _0x5b0c3b[_0x9118('0x29')]()[_0x9118('0x28')](function(){_0x5613dc[_0x9118('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b9861,_0x279923){return function(_0x1183d9){if(!_0x1183d9){_0x5b9861['sendStatus'](0x194);}return _0x1183d9;};}function handleError(_0x3d2377,_0x15ed8d){_0x15ed8d=_0x15ed8d||0x1f4;return function(_0x244dfc){logger[_0x9118('0x2a')](_0x244dfc[_0x9118('0x2b')]);if(_0x244dfc[_0x9118('0x2c')]){delete _0x244dfc[_0x9118('0x2c')];}_0x3d2377[_0x9118('0x1c')](_0x15ed8d)['send'](_0x244dfc);};}exports[_0x9118('0x2d')]=function(_0x28429c,_0x25f3ec){var _0x71cd37={},_0x2f72bb={},_0x25acbd={'count':0x0,'rows':[]};var _0x12d7da=_[_0x9118('0x2e')](db['WhatsappApplication'][_0x9118('0x2f')],function(_0x450c78){return{'name':_0x450c78['fieldName'],'type':_0x450c78[_0x9118('0x30')]['key']};});_0x2f72bb['model']=_['map'](_0x12d7da,_0x9118('0x2c'));_0x2f72bb[_0x9118('0x31')]=_[_0x9118('0x32')](_0x28429c[_0x9118('0x31')]);_0x2f72bb[_0x9118('0x33')]=_[_0x9118('0x34')](_0x2f72bb[_0x9118('0x35')],_0x2f72bb[_0x9118('0x31')]);_0x71cd37['attributes']=_[_0x9118('0x34')](_0x2f72bb[_0x9118('0x35')],qs[_0x9118('0x36')](_0x28429c['query'][_0x9118('0x36')]));_0x71cd37[_0x9118('0x37')]=_0x71cd37[_0x9118('0x37')]['length']?_0x71cd37[_0x9118('0x37')]:_0x2f72bb['model'];if(!_0x28429c['query'][_0x9118('0x38')]('nolimit')){_0x71cd37[_0x9118('0x20')]=qs[_0x9118('0x20')](_0x28429c[_0x9118('0x31')][_0x9118('0x20')]);_0x71cd37[_0x9118('0x21')]=qs[_0x9118('0x21')](_0x28429c[_0x9118('0x31')]['offset']);}_0x71cd37['order']=qs[_0x9118('0x39')](_0x28429c[_0x9118('0x31')]['sort']);_0x71cd37[_0x9118('0x3a')]=qs[_0x9118('0x33')](_[_0x9118('0x3b')](_0x28429c['query'],_0x2f72bb[_0x9118('0x33')]),_0x12d7da);if(_0x28429c[_0x9118('0x31')][_0x9118('0x3c')]){_0x71cd37[_0x9118('0x3a')]=_[_0x9118('0x3d')](_0x71cd37[_0x9118('0x3a')],{'$or':_[_0x9118('0x2e')](_0x12d7da,function(_0x453bb6){if(_0x453bb6['type']!==_0x9118('0x3e')){var _0x49ac97={};_0x49ac97[_0x453bb6['name']]={'$like':'%'+_0x28429c[_0x9118('0x31')][_0x9118('0x3c')]+'%'};return _0x49ac97;}})});}_0x71cd37=_[_0x9118('0x3d')]({},_0x71cd37,_0x28429c[_0x9118('0x3f')]);var _0x227c92={'where':_0x71cd37['where']};return db['WhatsappApplication']['count'](_0x227c92)['then'](function(_0x2d82de){_0x25acbd['count']=_0x2d82de;if(_0x28429c[_0x9118('0x31')][_0x9118('0x40')]){_0x71cd37[_0x9118('0x41')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x9118('0x42')](_0x71cd37);})[_0x9118('0x28')](function(_0x5442bc){_0x25acbd['rows']=_0x5442bc;return _0x25acbd;})[_0x9118('0x28')](respondWithFilteredResult(_0x25f3ec,_0x71cd37))[_0x9118('0x43')](handleError(_0x25f3ec,null));};exports['show']=function(_0x9dbe7,_0x20ece5){var _0x4dcf69={'raw':!![],'where':{'id':_0x9dbe7[_0x9118('0x44')]['id']}},_0x2cfc54={};_0x2cfc54[_0x9118('0x35')]=_[_0x9118('0x32')](db['WhatsappApplication'][_0x9118('0x2f')]);_0x2cfc54[_0x9118('0x31')]=_[_0x9118('0x32')](_0x9dbe7['query']);_0x2cfc54[_0x9118('0x33')]=_[_0x9118('0x34')](_0x2cfc54[_0x9118('0x35')],_0x2cfc54['query']);_0x4dcf69[_0x9118('0x37')]=_[_0x9118('0x34')](_0x2cfc54[_0x9118('0x35')],qs[_0x9118('0x36')](_0x9dbe7[_0x9118('0x31')][_0x9118('0x36')]));_0x4dcf69['attributes']=_0x4dcf69[_0x9118('0x37')][_0x9118('0x45')]?_0x4dcf69[_0x9118('0x37')]:_0x2cfc54[_0x9118('0x35')];if(_0x9dbe7['query'][_0x9118('0x40')]){_0x4dcf69[_0x9118('0x41')]=[{'all':!![]}];}_0x4dcf69=_[_0x9118('0x3d')]({},_0x4dcf69,_0x9dbe7[_0x9118('0x3f')]);return db[_0x9118('0x46')][_0x9118('0x47')](_0x4dcf69)[_0x9118('0x28')](handleEntityNotFound(_0x20ece5,null))[_0x9118('0x28')](respondWithResult(_0x20ece5,null))['catch'](handleError(_0x20ece5,null));};exports[_0x9118('0x48')]=function(_0x31a1d9,_0x336f05){return db['WhatsappApplication'][_0x9118('0x48')](_0x31a1d9[_0x9118('0x49')],{})['then'](respondWithResult(_0x336f05,0xc9))[_0x9118('0x43')](handleError(_0x336f05,null));};exports['update']=function(_0x4d1aca,_0x5e78a3){if(_0x4d1aca[_0x9118('0x49')]['id']){delete _0x4d1aca[_0x9118('0x49')]['id'];}return db[_0x9118('0x46')][_0x9118('0x47')]({'where':{'id':_0x4d1aca[_0x9118('0x44')]['id']}})[_0x9118('0x28')](handleEntityNotFound(_0x5e78a3,null))[_0x9118('0x28')](saveUpdates(_0x4d1aca['body'],null))['then'](respondWithResult(_0x5e78a3,null))[_0x9118('0x43')](handleError(_0x5e78a3,null));};exports[_0x9118('0x29')]=function(_0x4d1950,_0x59e005){return db[_0x9118('0x46')]['find']({'where':{'id':_0x4d1950['params']['id']}})[_0x9118('0x28')](handleEntityNotFound(_0x59e005,null))[_0x9118('0x28')](removeEntity(_0x59e005,null))[_0x9118('0x43')](handleError(_0x59e005,null));}; \ No newline at end of file +var _0xdf5d=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x11b40d,_0x59998d){var _0x396888=function(_0x1da96d){while(--_0x1da96d){_0x11b40d['push'](_0x11b40d['shift']());}};_0x396888(++_0x59998d);}(_0xdf5d,0x126));var _0xddf5=function(_0x3ee689,_0x17e02b){_0x3ee689=_0x3ee689-0x0;var _0x588ee3=_0xdf5d[_0x3ee689];return _0x588ee3;};'use strict';var emlformat=require(_0xddf5('0x0'));var rimraf=require(_0xddf5('0x1'));var zipdir=require(_0xddf5('0x2'));var jsonpatch=require(_0xddf5('0x3'));var rp=require(_0xddf5('0x4'));var moment=require(_0xddf5('0x5'));var BPromise=require(_0xddf5('0x6'));var Mustache=require(_0xddf5('0x7'));var util=require('util');var path=require(_0xddf5('0x8'));var sox=require(_0xddf5('0x9'));var csv=require(_0xddf5('0xa'));var ejs=require(_0xddf5('0xb'));var fs=require('fs');var fs_extra=require(_0xddf5('0xc'));var _=require(_0xddf5('0xd'));var squel=require(_0xddf5('0xe'));var crypto=require(_0xddf5('0xf'));var jsforce=require(_0xddf5('0x10'));var deskjs=require(_0xddf5('0x11'));var toCsv=require(_0xddf5('0xa'));var querystring=require(_0xddf5('0x12'));var Papa=require(_0xddf5('0x13'));var Redis=require(_0xddf5('0x14'));var authService=require(_0xddf5('0x15'));var qs=require(_0xddf5('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddf5('0x17'));var logger=require(_0xddf5('0x18'))(_0xddf5('0x19'));var utils=require(_0xddf5('0x1a'));var config=require(_0xddf5('0x1b'));var licenseUtil=require(_0xddf5('0x1c'));var db=require(_0xddf5('0x1d'))['db'];function respondWithStatusCode(_0x3779e4,_0x5607a2){_0x5607a2=_0x5607a2||0xcc;return function(_0x530521){if(_0x530521){return _0x3779e4[_0xddf5('0x1e')](_0x5607a2);}return _0x3779e4[_0xddf5('0x1f')](_0x5607a2)[_0xddf5('0x20')]();};}function respondWithResult(_0x3df24c,_0x6e876a){_0x6e876a=_0x6e876a||0xc8;return function(_0x149fef){if(_0x149fef){return _0x3df24c[_0xddf5('0x1f')](_0x6e876a)[_0xddf5('0x21')](_0x149fef);}};}function respondWithFilteredResult(_0x49cdfc,_0xe3e3e8){return function(_0x2b2dad){if(_0x2b2dad){var _0x3dd408=typeof _0xe3e3e8[_0xddf5('0x22')]===_0xddf5('0x23')&&typeof _0xe3e3e8['limit']===_0xddf5('0x23');var _0x53afba=_0x2b2dad[_0xddf5('0x24')];var _0x50c1ed=_0x3dd408?0x0:_0xe3e3e8[_0xddf5('0x22')];var _0x3d61df=_0x3dd408?_0x2b2dad[_0xddf5('0x24')]:_0xe3e3e8[_0xddf5('0x22')]+_0xe3e3e8['limit'];var _0x5429c8;if(_0x3d61df>=_0x53afba){_0x3d61df=_0x53afba;_0x5429c8=0xc8;}else{_0x5429c8=0xce;}_0x49cdfc[_0xddf5('0x1f')](_0x5429c8);return _0x49cdfc[_0xddf5('0x25')](_0xddf5('0x26'),_0x50c1ed+'-'+_0x3d61df+'/'+_0x53afba)[_0xddf5('0x21')](_0x2b2dad);}return null;};}function patchUpdates(_0x5e5537){return function(_0x52ecdb){try{jsonpatch[_0xddf5('0x27')](_0x52ecdb,_0x5e5537,!![]);}catch(_0x146e67){return BPromise[_0xddf5('0x28')](_0x146e67);}return _0x52ecdb['save']();};}function saveUpdates(_0x23aa35,_0x39212c){return function(_0x21c68b){if(_0x21c68b){return _0x21c68b[_0xddf5('0x29')](_0x23aa35)['then'](function(_0x2539f9){return _0x2539f9;});}return null;};}function removeEntity(_0x338a80,_0x496e16){return function(_0x300923){if(_0x300923){return _0x300923[_0xddf5('0x2a')]()[_0xddf5('0x2b')](function(){_0x338a80[_0xddf5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x497382,_0xc75eb8){return function(_0x256ff0){if(!_0x256ff0){_0x497382[_0xddf5('0x1e')](0x194);}return _0x256ff0;};}function handleError(_0x99fd62,_0x4caa12){_0x4caa12=_0x4caa12||0x1f4;return function(_0x2caa8f){logger[_0xddf5('0x2c')](_0x2caa8f['stack']);if(_0x2caa8f['name']){delete _0x2caa8f[_0xddf5('0x2d')];}_0x99fd62[_0xddf5('0x1f')](_0x4caa12)[_0xddf5('0x2e')](_0x2caa8f);};}exports[_0xddf5('0x2f')]=function(_0x3be6f4,_0x1a476d){var _0x5a3548={},_0x26f43c={},_0x228073={'count':0x0,'rows':[]};var _0x5292c7=_[_0xddf5('0x30')](db[_0xddf5('0x31')][_0xddf5('0x32')],function(_0x5eb7dd){return{'name':_0x5eb7dd['fieldName'],'type':_0x5eb7dd['type'][_0xddf5('0x33')]};});_0x26f43c[_0xddf5('0x34')]=_[_0xddf5('0x30')](_0x5292c7,'name');_0x26f43c[_0xddf5('0x35')]=_['keys'](_0x3be6f4['query']);_0x26f43c['filters']=_[_0xddf5('0x36')](_0x26f43c[_0xddf5('0x34')],_0x26f43c[_0xddf5('0x35')]);_0x5a3548[_0xddf5('0x37')]=_[_0xddf5('0x36')](_0x26f43c['model'],qs[_0xddf5('0x38')](_0x3be6f4['query'][_0xddf5('0x38')]));_0x5a3548[_0xddf5('0x37')]=_0x5a3548['attributes'][_0xddf5('0x39')]?_0x5a3548[_0xddf5('0x37')]:_0x26f43c[_0xddf5('0x34')];if(!_0x3be6f4[_0xddf5('0x35')][_0xddf5('0x3a')]('nolimit')){_0x5a3548[_0xddf5('0x3b')]=qs['limit'](_0x3be6f4[_0xddf5('0x35')][_0xddf5('0x3b')]);_0x5a3548['offset']=qs[_0xddf5('0x22')](_0x3be6f4['query'][_0xddf5('0x22')]);}_0x5a3548['order']=qs['sort'](_0x3be6f4[_0xddf5('0x35')]['sort']);_0x5a3548[_0xddf5('0x3c')]=qs[_0xddf5('0x3d')](_[_0xddf5('0x3e')](_0x3be6f4[_0xddf5('0x35')],_0x26f43c[_0xddf5('0x3d')]),_0x5292c7);if(_0x3be6f4[_0xddf5('0x35')][_0xddf5('0x3f')]){_0x5a3548[_0xddf5('0x3c')]=_[_0xddf5('0x40')](_0x5a3548[_0xddf5('0x3c')],{'$or':_[_0xddf5('0x30')](_0x5292c7,function(_0x3cb25a){if(_0x3cb25a[_0xddf5('0x41')]!==_0xddf5('0x42')){var _0x485b67={};_0x485b67[_0x3cb25a[_0xddf5('0x2d')]]={'$like':'%'+_0x3be6f4[_0xddf5('0x35')][_0xddf5('0x3f')]+'%'};return _0x485b67;}})});}_0x5a3548=_['merge']({},_0x5a3548,_0x3be6f4[_0xddf5('0x43')]);var _0x25e6b9={'where':_0x5a3548[_0xddf5('0x3c')]};return db[_0xddf5('0x31')][_0xddf5('0x24')](_0x25e6b9)['then'](function(_0x529ee1){_0x228073['count']=_0x529ee1;if(_0x3be6f4[_0xddf5('0x35')]['includeAll']){_0x5a3548['include']=[{'all':!![]}];}return db[_0xddf5('0x31')][_0xddf5('0x44')](_0x5a3548);})[_0xddf5('0x2b')](function(_0x309211){_0x228073[_0xddf5('0x45')]=_0x309211;return _0x228073;})[_0xddf5('0x2b')](respondWithFilteredResult(_0x1a476d,_0x5a3548))[_0xddf5('0x46')](handleError(_0x1a476d,null));};exports[_0xddf5('0x47')]=function(_0x490a14,_0xd5c63d){var _0x5b4817={'raw':!![],'where':{'id':_0x490a14[_0xddf5('0x48')]['id']}},_0x5654c2={};_0x5654c2[_0xddf5('0x34')]=_['keys'](db['WhatsappApplication'][_0xddf5('0x32')]);_0x5654c2[_0xddf5('0x35')]=_[_0xddf5('0x49')](_0x490a14[_0xddf5('0x35')]);_0x5654c2['filters']=_['intersection'](_0x5654c2[_0xddf5('0x34')],_0x5654c2[_0xddf5('0x35')]);_0x5b4817['attributes']=_[_0xddf5('0x36')](_0x5654c2[_0xddf5('0x34')],qs['fields'](_0x490a14[_0xddf5('0x35')]['fields']));_0x5b4817[_0xddf5('0x37')]=_0x5b4817[_0xddf5('0x37')][_0xddf5('0x39')]?_0x5b4817['attributes']:_0x5654c2[_0xddf5('0x34')];if(_0x490a14[_0xddf5('0x35')][_0xddf5('0x4a')]){_0x5b4817[_0xddf5('0x4b')]=[{'all':!![]}];}_0x5b4817=_[_0xddf5('0x40')]({},_0x5b4817,_0x490a14[_0xddf5('0x43')]);return db['WhatsappApplication'][_0xddf5('0x4c')](_0x5b4817)[_0xddf5('0x2b')](handleEntityNotFound(_0xd5c63d,null))[_0xddf5('0x2b')](respondWithResult(_0xd5c63d,null))[_0xddf5('0x46')](handleError(_0xd5c63d,null));};exports['create']=function(_0x22f8ff,_0x2b6c51){return db[_0xddf5('0x31')][_0xddf5('0x4d')](_0x22f8ff['body'],{})[_0xddf5('0x2b')](respondWithResult(_0x2b6c51,0xc9))[_0xddf5('0x46')](handleError(_0x2b6c51,null));};exports['update']=function(_0x2ea645,_0x597f15){if(_0x2ea645[_0xddf5('0x4e')]['id']){delete _0x2ea645[_0xddf5('0x4e')]['id'];}return db[_0xddf5('0x31')][_0xddf5('0x4c')]({'where':{'id':_0x2ea645['params']['id']}})[_0xddf5('0x2b')](handleEntityNotFound(_0x597f15,null))[_0xddf5('0x2b')](saveUpdates(_0x2ea645['body'],null))[_0xddf5('0x2b')](respondWithResult(_0x597f15,null))['catch'](handleError(_0x597f15,null));};exports['destroy']=function(_0x9fbad6,_0x37e0c3){return db[_0xddf5('0x31')][_0xddf5('0x4c')]({'where':{'id':_0x9fbad6[_0xddf5('0x48')]['id']}})[_0xddf5('0x2b')](handleEntityNotFound(_0x37e0c3,null))['then'](removeEntity(_0x37e0c3,null))[_0xddf5('0x46')](handleError(_0x37e0c3,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 35066f1..137565e 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 _0x5301=['./whatsappApplication.attributes','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x5301,0x157));var _0x1530=function(_0x550bca,_0x1e35d4){_0x550bca=_0x550bca-0x0;var _0x1845c6=_0x5301[_0x550bca];return _0x1845c6;};'use strict';var _=require('lodash');var util=require(_0x1530('0x0'));var logger=require(_0x1530('0x1'))(_0x1530('0x2'));var moment=require(_0x1530('0x3'));var BPromise=require(_0x1530('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1530('0x5'));var rimraf=require(_0x1530('0x6'));var config=require(_0x1530('0x7'));var attributes=require(_0x1530('0x8'));module['exports']=function(_0x22e563,_0x52761a){return _0x22e563[_0x1530('0x9')]('WhatsappApplication',attributes,{'tableName':_0x1530('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1530('0xb'),'collate':_0x1530('0xc')});}; \ No newline at end of file +var _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappApplication.attributes','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x4be18a,_0x326e6d){var _0x5042d4=function(_0x3f6157){while(--_0x3f6157){_0x4be18a['push'](_0x4be18a['shift']());}};_0x5042d4(++_0x326e6d);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x2d4738,_0x223803){_0x2d4738=_0x2d4738-0x0;var _0x22a7fa=_0x4fdb[_0x2d4738];return _0x22a7fa;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4fd('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index a64b306..d89369d 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 _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','WhatsappApplication,\x20%s,\x20%s','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x44e07a,_0x43af0d){var _0x477ae5=function(_0x110dd9){while(--_0x110dd9){_0x44e07a['push'](_0x44e07a['shift']());}};_0x477ae5(++_0x43af0d);}(_0x9f62,0x154));var _0x29f6=function(_0x27a8aa,_0xbe3c97){_0x27a8aa=_0x27a8aa-0x0;var _0x11deef=_0x9f62[_0x27a8aa];return _0x11deef;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});} \ No newline at end of file +var _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1b882b,_0x2bf715){var _0x33ce68=function(_0x5a5aaf){while(--_0x5a5aaf){_0x1b882b['push'](_0x1b882b['shift']());}};_0x33ce68(++_0x2bf715);}(_0x032e,0x124));var _0xe032=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x032e[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index d679bee..176fad4 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 _0xf072=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','/:id/tags','removeTags'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xf072,0x1cf));var _0x2f07=function(_0x27b9b0,_0x5044be){_0x27b9b0=_0x27b9b0-0x0;var _0x17ecdf=_0xf072[_0x27b9b0];return _0x17ecdf;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0x8')](_0x2f07('0xf'),auth[_0x2f07('0x9')](),controller['getMessages']);router[_0x2f07('0x8')](_0x2f07('0x10'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f07('0x12')]);router[_0x2f07('0x13')]('/:id/messages',auth[_0x2f07('0x9')](),controller[_0x2f07('0x14')]);router[_0x2f07('0x13')]('/:id/tags',auth[_0x2f07('0x9')](),interaction[_0x2f07('0x15')](_0x2f07('0x16'),_0x2f07('0x17')),controller[_0x2f07('0x18')]);router[_0x2f07('0x19')]('/:id',auth[_0x2f07('0x9')](),interaction['tracked'](_0x2f07('0x16'),_0x2f07('0x1a')),controller[_0x2f07('0x1b')]);router[_0x2f07('0x1c')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),interaction[_0x2f07('0x15')](_0x2f07('0x16'),'whatsappinteraction:destroy'),controller[_0x2f07('0x1d')]);router['delete'](_0x2f07('0x1e'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x1f')]);module[_0x2f07('0x20')]=router; \ No newline at end of file +var _0x6050=['tracked','whatsapp','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','describe','get','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x4abae4,_0x59e423){var _0x192706=function(_0x21520f){while(--_0x21520f){_0x4abae4['push'](_0x4abae4['shift']());}};_0x192706(++_0x59e423);}(_0x6050,0x196));var _0x0605=function(_0x2e5a56,_0xf49dc6){_0x2e5a56=_0x2e5a56-0x0;var _0xc8412e=_0x6050[_0x2e5a56];return _0xc8412e;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['get'](_0x0605('0xf'),auth[_0x0605('0xd')](),controller[_0x0605('0x10')]);router[_0x0605('0xb')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0x13')]('/',auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);router[_0x0605('0x13')](_0x0605('0xf'),auth[_0x0605('0xd')](),controller[_0x0605('0x15')]);router[_0x0605('0x13')](_0x0605('0x16'),auth[_0x0605('0xd')](),interaction[_0x0605('0x17')](_0x0605('0x18'),'whatsappinteraction:addtags'),controller[_0x0605('0x19')]);router[_0x0605('0x1a')](_0x0605('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x0605('0x18'),_0x0605('0x1b')),controller[_0x0605('0x1c')]);router[_0x0605('0x1d')](_0x0605('0xc'),auth[_0x0605('0xd')](),interaction[_0x0605('0x17')](_0x0605('0x18'),_0x0605('0x1e')),controller[_0x0605('0x1f')]);router[_0x0605('0x1d')](_0x0605('0x16'),auth[_0x0605('0xd')](),controller[_0x0605('0x20')]);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 a3944de..d703335 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 _0x3248=['sequelize','moment','exports','BOOLEAN','DATE','STRING','out','ENUM'];(function(_0x2b4180,_0x15e93b){var _0x22042d=function(_0x4a2bbc){while(--_0x4a2bbc){_0x2b4180['push'](_0x2b4180['shift']());}};_0x22042d(++_0x15e93b);}(_0x3248,0x1b0));var _0x8324=function(_0x50e3e8,_0x299017){_0x50e3e8=_0x50e3e8-0x0;var _0x4b3f79=_0x3248[_0x50e3e8];return _0x4b3f79;};'use strict';var Sequelize=require(_0x8324('0x0'));var moment=require(_0x8324('0x1'));module[_0x8324('0x2')]={'closed':{'type':Sequelize[_0x8324('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8324('0x4')]},'disposition':{'type':Sequelize[_0x8324('0x5')]},'secondDisposition':{'type':Sequelize[_0x8324('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8324('0x5')]},'read1stAt':{'type':Sequelize[_0x8324('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8324('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8324('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x8324('0x7')]('in',_0x8324('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8324('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1247=['sequelize','moment','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x531b0a,_0x192874){var _0x193d91=function(_0x33e6dc){while(--_0x33e6dc){_0x531b0a['push'](_0x531b0a['shift']());}};_0x193d91(++_0x192874);}(_0x1247,0xb6));var _0x7124=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0x1247[_0x685346];return _0x52e15b;};'use strict';var Sequelize=require(_0x7124('0x0'));var moment=require(_0x7124('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7124('0x2')]},'disposition':{'type':Sequelize[_0x7124('0x3')]},'secondDisposition':{'type':Sequelize[_0x7124('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7124('0x3')]},'phone':{'type':Sequelize[_0x7124('0x3')]},'read1stAt':{'type':Sequelize[_0x7124('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x7124('0x4')]('in',_0x7124('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7124('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7124('0x4')]('in',_0x7124('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7124('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index cc34e02..6115ad3 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 _0xf34f=['CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','rows','catch','show','params','intersection','includeAll','include','options','create','describe','WhatsappMessage','omit','ids','findOne','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','color','whatsappInteractionTags:save','download','unix','server','files','tmp','join','attachments','transcript-%d-%s.zip','fullname','CmContact','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','existsSync','createReadStream','pipe','basename','out','firstName','renderFile','root','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','Users','map','TagIds','Tags','split','forEach','push','waiting','talking','unmanaged','closed','UserId','total','index','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','field','tools_tags','select','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','from','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','text','body','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x50903f,_0x15dc23){var _0x574a82=function(_0x5a52e1){while(--_0x5a52e1){_0x50903f['push'](_0x50903f['shift']());}};_0x574a82(++_0x15dc23);}(_0xf34f,0x64));var _0xff34=function(_0x19b147,_0x55f1f5){_0x19b147=_0x19b147-0x0;var _0x2b47dd=_0xf34f[_0x19b147];return _0x2b47dd;};'use strict';var emlformat=require(_0xff34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff34('0x2'));var moment=require('moment');var BPromise=require(_0xff34('0x3'));var Mustache=require(_0xff34('0x4'));var util=require(_0xff34('0x5'));var path=require('path');var sox=require(_0xff34('0x6'));var csv=require('to-csv');var ejs=require(_0xff34('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff34('0x8'));var squel=require('squel');var crypto=require(_0xff34('0x9'));var jsforce=require(_0xff34('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xff34('0xb'));var Papa=require(_0xff34('0xc'));var Redis=require(_0xff34('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xff34('0xe'));var as=require(_0xff34('0xf'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xff34('0x10'));var logger=require(_0xff34('0x11'))(_0xff34('0x12'));var utils=require('../../config/utils');var config=require(_0xff34('0x13'));var licenseUtil=require(_0xff34('0x14'));var db=require(_0xff34('0x15'))['db'];config[_0xff34('0x16')]=_[_0xff34('0x17')](config[_0xff34('0x16')],{'host':_0xff34('0x18'),'port':0x18eb});var socket=require(_0xff34('0x19'))(new Redis(config[_0xff34('0x16')]));require(_0xff34('0x1a'))[_0xff34('0x1b')](socket);function respondWithStatusCode(_0x1a88af,_0xcba1c3){_0xcba1c3=_0xcba1c3||0xcc;return function(_0x3a184e){if(_0x3a184e){return _0x1a88af[_0xff34('0x1c')](_0xcba1c3);}return _0x1a88af[_0xff34('0x1d')](_0xcba1c3)[_0xff34('0x1e')]();};}function respondWithResult(_0x3b7af5,_0x31fdfd){_0x31fdfd=_0x31fdfd||0xc8;return function(_0xf5e0ec){if(_0xf5e0ec){return _0x3b7af5['status'](_0x31fdfd)[_0xff34('0x1f')](_0xf5e0ec);}};}function respondWithFilteredResult(_0x53bcbe,_0x2fe34c){return function(_0x50bfa5){if(_0x50bfa5){var _0x44260f=typeof _0x2fe34c[_0xff34('0x20')]==='undefined'&&typeof _0x2fe34c['limit']===_0xff34('0x21');var _0x41f047=_0x50bfa5[_0xff34('0x22')];var _0x1111b7=_0x44260f?0x0:_0x2fe34c[_0xff34('0x20')];var _0x26998e=_0x44260f?_0x50bfa5[_0xff34('0x22')]:_0x2fe34c[_0xff34('0x20')]+_0x2fe34c[_0xff34('0x23')];var _0x2754e6;if(_0x26998e>=_0x41f047){_0x26998e=_0x41f047;_0x2754e6=0xc8;}else{_0x2754e6=0xce;}_0x53bcbe[_0xff34('0x1d')](_0x2754e6);return _0x53bcbe[_0xff34('0x24')](_0xff34('0x25'),_0x1111b7+'-'+_0x26998e+'/'+_0x41f047)[_0xff34('0x1f')](_0x50bfa5);}return null;};}function patchUpdates(_0x43ea3b){return function(_0x2b06d0){try{jsonpatch[_0xff34('0x26')](_0x2b06d0,_0x43ea3b,!![]);}catch(_0xebe57c){return BPromise[_0xff34('0x27')](_0xebe57c);}return _0x2b06d0[_0xff34('0x28')]();};}function saveUpdates(_0x2fde63,_0x48cd5d){return function(_0x17391d){if(_0x17391d){return _0x17391d[_0xff34('0x29')](_0x2fde63)[_0xff34('0x2a')](function(_0x266abb){return _0x266abb;});}return null;};}function removeEntity(_0x147b68,_0x5dd28d){return function(_0x4ee376){if(_0x4ee376){return _0x4ee376[_0xff34('0x2b')]()[_0xff34('0x2a')](function(){_0x147b68['status'](0xcc)[_0xff34('0x1e')]();});}};}function handleEntityNotFound(_0x119c88,_0x206dc3){return function(_0x4c2c42){if(!_0x4c2c42){_0x119c88[_0xff34('0x1c')](0x194);}return _0x4c2c42;};}function handleError(_0x52629f,_0x3939fa){_0x3939fa=_0x3939fa||0x1f4;return function(_0x2b28f8){logger[_0xff34('0x2c')](_0x2b28f8['stack']);if(_0x2b28f8[_0xff34('0x2d')]){delete _0x2b28f8[_0xff34('0x2d')];}_0x52629f[_0xff34('0x1d')](_0x3939fa)['send'](_0x2b28f8);};}function getInteractionUsers(_0x2acdfc,_0x140a50){return new BPromise(function(_0x2294f1,_0x22613a){try{if(_0x140a50[_0x2acdfc['id']]){_0x2acdfc[_0xff34('0x2e')]=_[_0xff34('0x2f')](_0x140a50[_0x2acdfc['id']],function(_0x5213ec){return{'id':_0x5213ec['id'],'fullname':_0x5213ec['fullname']};});}}catch(_0x215b70){_0x22613a(_0x215b70);}_0x2294f1(_0x2acdfc);});}function getInteractionTags(_0x58b12e,_0x137d47){return new BPromise(function(_0x37d379,_0x48f547){try{if(_0x58b12e[_0xff34('0x30')]){_0x58b12e[_0xff34('0x31')]=[];_0x58b12e[_0xff34('0x30')][_0xff34('0x32')](',')[_0xff34('0x33')](function(_0x32b445){_0x58b12e[_0xff34('0x31')][_0xff34('0x34')](_0x137d47[_0x32b445]);});}delete _0x58b12e[_0xff34('0x30')];}catch(_0x51c4a8){_0x48f547(_0x51c4a8);}_0x37d379(_0x58b12e);});}function updateWhatsappInteraction(_0x21fa9a,_0x552dfb,_0x446ca5){return new BPromise(function(_0x34f9ae,_0x4ff1c1){return getInteractionUsers(_0x21fa9a,_0x446ca5)['then'](function(_0x3c97f4){return getInteractionTags(_0x3c97f4,_0x552dfb);})[_0xff34('0x2a')](function(_0x13abaa){return getStateInteraction(_0x13abaa);})[_0xff34('0x2a')](function(_0x190519){_0x34f9ae(_0x190519);})['catch'](function(_0xe12a5f){_0x4ff1c1(_0xe12a5f);});});}function getStateInteraction(_0x2f9d9a){return new BPromise(function(_0x4b5d13){_0x2f9d9a[_0xff34('0x35')]=0x0;_0x2f9d9a[_0xff34('0x36')]=0x0;_0x2f9d9a['answered']=0x0;_0x2f9d9a[_0xff34('0x37')]=0x0;_0x2f9d9a['total']=0x0;if(!_0x2f9d9a[_0xff34('0x38')]&&!_0x2f9d9a[_0xff34('0x39')]){_0x2f9d9a['waiting']+=0x1;}if(!_0x2f9d9a[_0xff34('0x38')]&&_0x2f9d9a[_0xff34('0x39')]){_0x2f9d9a[_0xff34('0x36')]+=0x1;if(_0x2f9d9a[_0xff34('0x35')]){_0x2f9d9a[_0xff34('0x35')]-=0x1;}}if(_0x2f9d9a[_0xff34('0x38')]&&_0x2f9d9a[_0xff34('0x39')]){_0x2f9d9a['answered']+=0x1;if(_0x2f9d9a['talking']){_0x2f9d9a[_0xff34('0x36')]-=0x1;}}if(_0x2f9d9a[_0xff34('0x38')]&&!_0x2f9d9a['UserId']){_0x2f9d9a[_0xff34('0x37')]+=0x1;if(_0x2f9d9a[_0xff34('0x35')]){_0x2f9d9a[_0xff34('0x35')]-=0x1;}}_0x2f9d9a[_0xff34('0x3a')]+=0x1;_0x4b5d13(_0x2f9d9a);});}exports[_0xff34('0x3b')]=function(_0x12a4ff,_0xaab0de){var _0xa47e4a={},_0xe7a08={},_0x408182={'count':0x0,'rows':[]};var _0x10c1ee=_[_0xff34('0x2f')](db[_0xff34('0x3c')][_0xff34('0x3d')],function(_0xcb277){return{'name':_0xcb277[_0xff34('0x3e')],'type':_0xcb277['type'][_0xff34('0x3f')]};});_0xe7a08[_0xff34('0x40')]=_['map'](_0x10c1ee,_0xff34('0x2d'));_0xe7a08[_0xff34('0x41')]=_[_0xff34('0x42')](_0x12a4ff[_0xff34('0x41')]);_0xe7a08[_0xff34('0x43')]=_['intersection'](_0xe7a08['model'],_0xe7a08[_0xff34('0x41')]);_0xa47e4a[_0xff34('0x44')]=_['intersection'](_0xe7a08[_0xff34('0x40')],qs[_0xff34('0x45')](_0x12a4ff[_0xff34('0x41')][_0xff34('0x45')]));_0xa47e4a[_0xff34('0x44')]=_0xa47e4a['attributes']['length']?_0xa47e4a[_0xff34('0x44')]:_0xe7a08['model'];if(!_0x12a4ff[_0xff34('0x41')]['hasOwnProperty'](_0xff34('0x46'))){_0xa47e4a['limit']=qs[_0xff34('0x23')](_0x12a4ff['query'][_0xff34('0x23')]);_0xa47e4a[_0xff34('0x20')]=qs['offset'](_0x12a4ff[_0xff34('0x41')][_0xff34('0x20')]);}_0xa47e4a[_0xff34('0x47')]=qs[_0xff34('0x48')](_0x12a4ff[_0xff34('0x41')][_0xff34('0x48')]);_0xa47e4a[_0xff34('0x49')]=qs['filters'](_[_0xff34('0x4a')](_0x12a4ff['query'],_0xe7a08['filters']),_0x10c1ee);var _0x50966f=[];var _0x46ab53=squel['select']()[_0xff34('0x4b')]('id')[_0xff34('0x4b')](_0xff34('0x2d'))[_0xff34('0x4b')]('color')['from'](_0xff34('0x4c'));var _0x492a60=squel[_0xff34('0x4d')]()['field']('u.id')['field'](_0xff34('0x4e'))[_0xff34('0x4b')](_0xff34('0x4f'))['from'](_0xff34('0x50'),'ui')['left_join'](_0xff34('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x2adbb9=squel[_0xff34('0x4d')]()[_0xff34('0x52')]('whatsapp_interactions','i')[_0xff34('0x53')]('cm_contacts','c',_0xff34('0x54'))[_0xff34('0x53')]('users','o',_0xff34('0x55'))[_0xff34('0x53')](_0xff34('0x56'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xff34('0x53')](_0xff34('0x57'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xff34('0x53')](_0xff34('0x58'),'it',_0xff34('0x59'))['left_join'](_0xff34('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x12a658=squel[_0xff34('0x5a')]();var _0x16e7a7=[];var _0x23f474=squel['expr']();var _0x22b32d;if(_0x12a4ff[_0xff34('0x41')][_0xff34('0x5b')]){_0x22b32d=as[_0xff34('0x5c')](_0x12a4ff['query'][_0xff34('0x5b')]);var _0x1e3e1e=_0x22b32d[_0xff34('0x5d')];for(var _0x5af7dc=0x0;_0x5af7dc<_0x22b32d['conditions']['length'];_0x5af7dc++){var _0x3265cb=_0x22b32d['conditions'][_0x5af7dc];var _0x4eaec8='i';var _0x27edf1=_[_0xff34('0x5e')](_0x10c1ee,[_0xff34('0x2d'),_0x3265cb[_0xff34('0x4b')]]);if(!_0x27edf1){switch(_0x3265cb['field']){case _0xff34('0x5f'):if(_0x3265cb[_0xff34('0x60')]==0x1){_0x2adbb9['having']('`'+_0x3265cb[_0xff34('0x4b')]+_0xff34('0x61'));}else{_0x2adbb9[_0xff34('0x62')]('`'+_0x3265cb[_0xff34('0x4b')]+_0xff34('0x63'));}break;case _0xff34('0x64'):if(_0x3265cb[_0xff34('0x65')]===_0xff34('0x66')){if(_0x3265cb[_0xff34('0x60')][_0xff34('0x32')]('\x20')[_0xff34('0x67')]>0x1){_0x12a658[_0x1e3e1e](_0xff34('0x68'),qs[_0xff34('0x69')](_0x3265cb[_0xff34('0x60')]),null);}else{var _0x3a4214='%'+_0x3265cb[_0xff34('0x60')]+'%';_0x12a658[_0x1e3e1e](_0xff34('0x6a'),_0x3a4214,_0x3a4214,_0x3a4214);}}else{_0x27edf1=_['find'](_0x10c1ee,[_0xff34('0x2d'),'ContactId']);_0x3265cb['field']=_0xff34('0x6b');_0x1f5bf4=as[_0xff34('0x6c')](_0x4eaec8,_0x27edf1['type'],_0x3265cb);_0x12a658[_0x1e3e1e](_0x1f5bf4['text'],_0x1f5bf4['value'][_0xff34('0x6d')],_0x1f5bf4[_0xff34('0x60')][_0xff34('0x1e')]);}break;case _0xff34('0x6e'):var _0x5471f4=_0x3265cb[_0xff34('0x60')]['split'](',')['map'](function(_0x55a903){return Number(_0x55a903);});_0x5471f4[_0xff34('0x33')](function(_0x51b9c1){_0x23f474['or'](_0xff34('0x6f'),'%,'+_0x51b9c1+',%');});_0x16e7a7=_[_0xff34('0x70')](_0x16e7a7,_0x5471f4);break;case _0xff34('0x71'):if(_0x3265cb[_0xff34('0x65')]===_0xff34('0x66')){_0x12a658[_0x1e3e1e](_0xff34('0x72'),'%'+_0x3265cb['value']+'%',null);}else{_0x27edf1=_[_0xff34('0x5e')](_0x10c1ee,[_0xff34('0x2d'),_0xff34('0x39')]);_0x3265cb[_0xff34('0x4b')]=_0xff34('0x39');_0x1f5bf4=as['buildExpression'](_0x4eaec8,_0x27edf1[_0xff34('0x73')],_0x3265cb);_0x12a658[_0x1e3e1e](_0x1f5bf4[_0xff34('0x74')],_0x1f5bf4[_0xff34('0x60')]['start'],_0x1f5bf4[_0xff34('0x60')][_0xff34('0x1e')]);}break;case _0xff34('0x75'):_0x1f5bf4=as['buildExpression']('me',null,_0x3265cb);_0x12a658[_0x1e3e1e](_0x1f5bf4[_0xff34('0x74')],_0x1f5bf4[_0xff34('0x60')][_0xff34('0x6d')],_0x1f5bf4[_0xff34('0x60')]['end']);break;}}else{var _0x1f5bf4=as[_0xff34('0x6c')](_0x4eaec8,_0x27edf1[_0xff34('0x73')],_0x3265cb);_0x12a658[_0x1e3e1e](_0x1f5bf4['text'],_0x1f5bf4[_0xff34('0x60')][_0xff34('0x6d')],_0x1f5bf4[_0xff34('0x60')][_0xff34('0x1e')]);}}}else{var _0x4b9846=_(_0x12a4ff[_0xff34('0x41')])[_0xff34('0x42')]()[_0xff34('0x2f')](function(_0x4b4961){return _[_0xff34('0x76')](_0x10c1ee,['name',_0x4b4961])?_0x4b4961:undefined;})[_0xff34('0x77')]()[_0xff34('0x60')]();if(!_['isEmpty'](_0x4b9846)){_0x4b9846[_0xff34('0x33')](function(_0x3f863e){if(_0x3f863e===_0xff34('0x78')){_0x2adbb9['where'](_0xff34('0x79'),[][_0xff34('0x7a')](_0x12a4ff[_0xff34('0x41')][_0x3f863e]));}else if(_0x3f863e===_0xff34('0x7b')){var _0x25e1a0=JSON[_0xff34('0x7c')](_0x12a4ff[_0xff34('0x41')][_0x3f863e])['$gte'];var _0x50b96a=JSON[_0xff34('0x7c')](_0x12a4ff[_0xff34('0x41')][_0x3f863e])[_0xff34('0x7d')];_0x2adbb9[_0xff34('0x49')](_0xff34('0x7e'),_0x25e1a0,_0x50b96a);}else{if(_0x12a4ff[_0xff34('0x41')][_0x3f863e]===_0xff34('0x7f')){_0x2adbb9[_0xff34('0x49')]('i.'+_0x3f863e+_0xff34('0x80'));}else{_0x2adbb9['where']('i.'+_0x3f863e+_0xff34('0x81'),_0x12a4ff[_0xff34('0x41')][_0x3f863e]);}}});}if(_0x12a4ff[_0xff34('0x41')][_0xff34('0x82')]){if(_0x12a4ff[_0xff34('0x41')][_0xff34('0x82')]==0x1){_0x2adbb9[_0xff34('0x62')](_0xff34('0x83'));}else{_0x2adbb9[_0xff34('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x12a4ff[_0xff34('0x41')][_0xff34('0x84')]){_0x16e7a7=_['isArray'](_0x12a4ff[_0xff34('0x41')][_0xff34('0x84')])?_0x12a4ff[_0xff34('0x41')][_0xff34('0x84')]:new Array(_0x12a4ff['query'][_0xff34('0x84')]);_0x16e7a7[_0xff34('0x33')](function(_0x4f1fc8){_0x23f474['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f1fc8+',%');});}if(_0x12a4ff[_0xff34('0x41')][_0xff34('0x85')]){var _0x4c994b=_0x12a4ff['query'][_0xff34('0x85')]['replace']('\x5c','\x5c\x5c')[_0xff34('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4c994b)){_0x12a658['or'](_0xff34('0x87'),_0x4c994b+'%')['or']('i.phone\x20LIKE\x20?',_0x4c994b+'%');}else{_0x12a658['or'](_0xff34('0x88'),qs[_0xff34('0x69')](_0x4c994b))['or'](_0xff34('0x89'),_0x4c994b+'%');}}}_0x2adbb9['where'](_0x12a658);_0x2adbb9[_0xff34('0x8a')](_0xff34('0x8b'));var _0x34e25d={'type':db[_0xff34('0x8c')][_0xff34('0x8d')]['SELECT'],'raw':!![]};var _0x3202a6=_0x2adbb9[_0xff34('0x8e')]();_0x3202a6['field'](_0xff34('0x8b'));_0x3202a6[_0xff34('0x4b')](_0xff34('0x8f'),_0xff34('0x5f'));if(_0xa47e4a['order']){_0xa47e4a['order'][_0xff34('0x33')](function(_0x275f83){var _0x108ac6=_0x275f83[0x0]===_0xff34('0x90')?_0x275f83[0x0]:'i.'+_0x275f83[0x0];_0x2adbb9[_0xff34('0x47')](_0x108ac6,_0x275f83[0x1]===_0xff34('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x16e7a7)){_0x2adbb9[_0xff34('0x62')](_0x23f474);_0x3202a6[_0xff34('0x49')](_0xff34('0x92'),_0x16e7a7);}BPromise[_0xff34('0x93')]()[_0xff34('0x2a')](function(){if(!_0x22b32d){if(_0x12a4ff['query'][_0xff34('0x78')])return;_0x3202a6[_0xff34('0x49')](_0xff34('0x94'));_0x2adbb9['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x12a4ff[_0xff34('0x95')][_0xff34('0x96')]!==_0xff34('0x97'))return;return _0x12a4ff['user'][_0xff34('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x365cd7){if(_['isEmpty'](_0x365cd7)){_0x3202a6['where'](_0xff34('0x99'));_0x2adbb9[_0xff34('0x49')](_0xff34('0x99'));}else{_0x3202a6[_0xff34('0x49')](_0xff34('0x79'),_[_0xff34('0x2f')](_0x365cd7,'id'));_0x2adbb9[_0xff34('0x49')](_0xff34('0x79'),_['map'](_0x365cd7,'id'));}});})[_0xff34('0x2a')](function(){if(_0x12a4ff['user'][_0xff34('0x96')]===_0xff34('0x97')&&!_0x22b32d&&!_0x12a4ff[_0xff34('0x41')][_0xff34('0x78')])return[];return db[_0xff34('0x9a')]['query'](_0x3202a6[_0xff34('0x9b')](),_0x34e25d);})[_0xff34('0x2a')](function(_0x20ea1f){_0x408182[_0xff34('0x22')]=_0x20ea1f[_0xff34('0x67')];if(_0x408182[_0xff34('0x22')]===0x0)return[];return db['sequelize'][_0xff34('0x41')](_0x46ab53[_0xff34('0x9b')](),_0x34e25d)[_0xff34('0x2a')](function(_0x2991f0){_0x50966f=_[_0xff34('0x9c')](_0x2991f0,'id');_0x34e25d=_[_0xff34('0x9d')](_0x34e25d,{'model':db[_0xff34('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x12a4ff[_0xff34('0x41')][_0xff34('0x45')]){_0xa47e4a[_0xff34('0x44')][_0xff34('0x33')](function(_0xa639b7){_0x2adbb9[_0xff34('0x4b')]('i.'+_0xa639b7);});}else{_0x2adbb9[_0xff34('0x4b')](_0xff34('0x8f'),_0xff34('0x5f'));_0x2adbb9[_0xff34('0x4b')](_0xff34('0x9e'),'Account.key');_0x2adbb9[_0xff34('0x4b')]('a.mandatoryDisposition',_0xff34('0x9f'));_0x2adbb9[_0xff34('0x4b')](_0xff34('0xa0'),_0xff34('0x90'));_0x2adbb9[_0xff34('0x4b')]('i.*');_0x2adbb9[_0xff34('0x4b')](_0xff34('0xa1'),_0xff34('0xa2'));_0x2adbb9[_0xff34('0x4b')](_0xff34('0xa3'),_0xff34('0xa4'));_0x2adbb9[_0xff34('0x4b')](_0xff34('0xa5'),'Contact.email');_0x2adbb9[_0xff34('0x4b')](_0xff34('0xa6'),_0xff34('0xa7'));_0x2adbb9[_0xff34('0x4b')](_0xff34('0xa8'),'Contact.mobile');_0x2adbb9[_0xff34('0x4b')]('c.fax','Contact.fax');_0x2adbb9[_0xff34('0x4b')](_0xff34('0xa9'),_0xff34('0xaa'));_0x2adbb9[_0xff34('0x4b')](_0xff34('0xab'),_0xff34('0xac'));_0x2adbb9[_0xff34('0x4b')](_0xff34('0xad'),_0xff34('0x30'));}if(_0xa47e4a[_0xff34('0x23')])_0x2adbb9[_0xff34('0x23')](_0xa47e4a[_0xff34('0x23')]);if(_0xa47e4a[_0xff34('0x20')])_0x2adbb9['offset'](_0xa47e4a['offset']);return db['sequelize'][_0xff34('0x41')](_0x2adbb9[_0xff34('0x9b')](),_0x34e25d);})[_0xff34('0x2a')](function(_0x15b7bd){if(_0x15b7bd[_0xff34('0x67')]>0x0)_0x492a60[_0xff34('0x49')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xff34('0x2f')](_0x15b7bd,'id'));return db['sequelize'][_0xff34('0x41')](_0x492a60[_0xff34('0x9b')](),_0x34e25d)[_0xff34('0x2a')](function(_0x22d441){var _0x1cb8e8=_[_0xff34('0xae')](_0x22d441,'WhatsappInteractionId');var _0x525995=[];_0x15b7bd[_0xff34('0x33')](function(_0x121442){_0x525995[_0xff34('0x34')](updateWhatsappInteraction(_0x121442,_0x50966f,_0x1cb8e8));});return BPromise['all'](_0x525995);});});})[_0xff34('0x2a')](function(_0x23b84a){_0x408182[_0xff34('0xaf')]=_0x23b84a;return _0x408182;})[_0xff34('0x2a')](respondWithFilteredResult(_0xaab0de,_0xa47e4a))[_0xff34('0xb0')](handleError(_0xaab0de,null));};exports[_0xff34('0xb1')]=function(_0x461bf6,_0x3fc825){var _0x28be31={'raw':![],'where':{'id':_0x461bf6[_0xff34('0xb2')]['id']}},_0x327520={};_0x327520[_0xff34('0x40')]=_[_0xff34('0x42')](db[_0xff34('0x3c')][_0xff34('0x3d')]);_0x327520[_0xff34('0x41')]=_['keys'](_0x461bf6[_0xff34('0x41')]);_0x327520[_0xff34('0x43')]=_[_0xff34('0xb3')](_0x327520[_0xff34('0x40')],_0x327520['query']);_0x28be31[_0xff34('0x44')]=_[_0xff34('0xb3')](_0x327520[_0xff34('0x40')],qs['fields'](_0x461bf6[_0xff34('0x41')]['fields']));_0x28be31['attributes']=_0x28be31[_0xff34('0x44')][_0xff34('0x67')]?_0x28be31[_0xff34('0x44')]:_0x327520[_0xff34('0x40')];if(_0x461bf6[_0xff34('0x41')][_0xff34('0xb4')]){_0x28be31[_0xff34('0xb5')]=[{'all':!![]}];}_0x28be31=_['merge']({},_0x28be31,_0x461bf6[_0xff34('0xb6')]);return db[_0xff34('0x3c')][_0xff34('0x5e')](_0x28be31)[_0xff34('0x2a')](handleEntityNotFound(_0x3fc825,null))['then'](respondWithResult(_0x3fc825,null))[_0xff34('0xb0')](handleError(_0x3fc825,null));};exports[_0xff34('0xb7')]=function(_0x7836b9,_0x1defd6){return db[_0xff34('0x3c')][_0xff34('0xb7')](_0x7836b9[_0xff34('0x75')],{})[_0xff34('0x2a')](respondWithResult(_0x1defd6,0xc9))[_0xff34('0xb0')](handleError(_0x1defd6,null));};exports[_0xff34('0x29')]=function(_0x443e91,_0xbb8550){if(_0x443e91['body']['id']){delete _0x443e91[_0xff34('0x75')]['id'];}return db['WhatsappInteraction'][_0xff34('0x5e')]({'where':{'id':_0x443e91[_0xff34('0xb2')]['id']}})[_0xff34('0x2a')](handleEntityNotFound(_0xbb8550,null))[_0xff34('0x2a')](saveUpdates(_0x443e91['body'],null))['then'](respondWithResult(_0xbb8550,null))[_0xff34('0xb0')](handleError(_0xbb8550,null));};exports[_0xff34('0x2b')]=function(_0x5b4f69,_0x5cca56){return db['WhatsappInteraction'][_0xff34('0x5e')]({'where':{'id':_0x5b4f69[_0xff34('0xb2')]['id']}})['then'](handleEntityNotFound(_0x5cca56,null))[_0xff34('0x2a')](removeEntity(_0x5cca56,null))['catch'](handleError(_0x5cca56,null));};exports['describe']=function(_0xa3fcda,_0x401e73){return db[_0xff34('0x3c')][_0xff34('0xb8')]()[_0xff34('0x2a')](respondWithResult(_0x401e73,null))[_0xff34('0xb0')](handleError(_0x401e73,null));};exports['addMessage']=function(_0x1fa609,_0x1f418e,_0x8014ca){return db[_0xff34('0xb9')][_0xff34('0x5e')]({'where':{'id':_0x1fa609[_0xff34('0xb2')]['id']}})[_0xff34('0x2a')](handleEntityNotFound(_0x1f418e,null))[_0xff34('0x2a')](function(_0x3b414d){if(_0x3b414d){return _0x3b414d['addMessage'](_0x1fa609[_0xff34('0x75')]['ids'],_[_0xff34('0xba')](_0x1fa609[_0xff34('0x75')],[_0xff34('0xbb'),'id'])||{});}})[_0xff34('0x2a')](respondWithResult(_0x1f418e,null))['catch'](handleError(_0x1f418e,null));};exports['getMessages']=function(_0x148301,_0x28febc,_0x28903e){var _0x51fc0b={'raw':![],'where':{}};var _0x46f99d={};var _0xdafcaf={'count':0x0,'rows':[]};return db[_0xff34('0x3c')][_0xff34('0xbc')]({'where':{'id':_0x148301[_0xff34('0xb2')]['id']}})[_0xff34('0x2a')](handleEntityNotFound(_0x28febc,null))[_0xff34('0x2a')](function(_0x45013d){if(_0x45013d){_0x46f99d[_0xff34('0x40')]=_[_0xff34('0x42')](db[_0xff34('0xb9')][_0xff34('0x3d')]);_0x46f99d[_0xff34('0x41')]=_['keys'](_0x148301[_0xff34('0x41')]);_0x46f99d[_0xff34('0x43')]=_['intersection'](_0x46f99d[_0xff34('0x40')],_0x46f99d[_0xff34('0x41')]);_0x51fc0b[_0xff34('0x44')]=_[_0xff34('0xb3')](_0x46f99d[_0xff34('0x40')],qs[_0xff34('0x45')](_0x148301[_0xff34('0x41')][_0xff34('0x45')]));_0x51fc0b['attributes']=_0x51fc0b[_0xff34('0x44')][_0xff34('0x67')]?_0x51fc0b[_0xff34('0x44')]:_0x46f99d[_0xff34('0x40')];if(!_0x148301[_0xff34('0x41')]['hasOwnProperty'](_0xff34('0x46'))){_0x51fc0b[_0xff34('0x23')]=qs['limit'](_0x148301[_0xff34('0x41')]['limit']);_0x51fc0b[_0xff34('0x20')]=qs[_0xff34('0x20')](_0x148301[_0xff34('0x41')]['offset']);}_0x51fc0b[_0xff34('0x47')]=qs[_0xff34('0x48')](_0x148301['query']['sort']);_0x51fc0b[_0xff34('0x49')]=qs[_0xff34('0x43')](_[_0xff34('0x4a')](_0x148301[_0xff34('0x41')],_0x46f99d[_0xff34('0x43')]));_0x51fc0b[_0xff34('0x49')][_0xff34('0xbd')]=_0x45013d['id'];if(_0x148301['query'][_0xff34('0x85')]){_0x51fc0b[_0xff34('0x49')]=_[_0xff34('0x9d')](_0x51fc0b[_0xff34('0x49')],{'$or':_[_0xff34('0x2f')](_0x51fc0b[_0xff34('0x44')],function(_0x51f8bd){var _0x3d8495={};_0x3d8495[_0x51f8bd]={'$like':'%'+_0x148301[_0xff34('0x41')]['filter']+'%'};return _0x3d8495;})});}if(_0x148301[_0xff34('0x41')][_0xff34('0xbe')]){var _0x19b761=_0x148301[_0xff34('0x41')][_0xff34('0xbe')][_0xff34('0x32')](',');var _0x14475d={};_0x14475d[_0x19b761[0x0]]={'$gte':moment(_0x19b761[0x1])[_0xff34('0xbf')](_0xff34('0xc0'))};_0x51fc0b[_0xff34('0x49')]=_[_0xff34('0x9d')](_0x51fc0b[_0xff34('0x49')],_0x14475d);}_0x51fc0b=_['merge']({},_0x51fc0b,_0x148301['options']);return db[_0xff34('0xb9')][_0xff34('0x22')]({'where':_0x51fc0b['where']})[_0xff34('0x2a')](function(_0x343a3f){_0xdafcaf[_0xff34('0x22')]=_0x343a3f;if(_0x148301[_0xff34('0x41')][_0xff34('0xb4')]){_0x51fc0b[_0xff34('0xb5')]=[{'all':!![]}];}return db[_0xff34('0xb9')]['findAll'](_0x51fc0b);})[_0xff34('0x2a')](function(_0x6b79fd){_0xdafcaf[_0xff34('0xaf')]=_0x6b79fd;return _0xdafcaf;});}})[_0xff34('0x2a')](respondWithFilteredResult(_0x28febc,_0x51fc0b))[_0xff34('0xb0')](handleError(_0x28febc,null));};exports[_0xff34('0xc1')]=function(_0x22d363,_0x5b6299,_0x306f03){return db[_0xff34('0x3c')][_0xff34('0x5e')]({'where':{'id':_0x22d363[_0xff34('0xb2')]['id']}})['then'](handleEntityNotFound(_0x5b6299,null))[_0xff34('0x2a')](function(_0x1c1a58){if(_0x1c1a58){return _0x1c1a58[_0xff34('0xc2')](_0x22d363[_0xff34('0x75')][_0xff34('0xbb')],_['omit'](_0x22d363['body'],[_0xff34('0xbb'),'id'])||{})[_0xff34('0xc3')](function(){return db[_0xff34('0x6e')]['findAll']({'attributes':['id',_0xff34('0x2d'),_0xff34('0xc4')],'where':{'id':_0x22d363[_0xff34('0x75')]['ids']}});})[_0xff34('0x2a')](function(_0x402d77){socket['emit'](_0xff34('0xc5'),{'id':Number(_0x22d363['params']['id']),'tags':_0x402d77||[]});return{'id':Number(_0x22d363[_0xff34('0xb2')]['id']),'tags':_0x402d77||[]};});}})[_0xff34('0x2a')](respondWithResult(_0x5b6299,null))[_0xff34('0xb0')](handleError(_0x5b6299,null));};exports['removeTags']=function(_0x4a58ce,_0x296a0c,_0x56d57a){return db[_0xff34('0x3c')][_0xff34('0x5e')]({'where':{'id':_0x4a58ce[_0xff34('0xb2')]['id']}})[_0xff34('0x2a')](handleEntityNotFound(_0x296a0c,null))[_0xff34('0x2a')](function(_0x40fc76){if(_0x40fc76){return _0x40fc76['removeTags'](_0x4a58ce[_0xff34('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x296a0c,null))[_0xff34('0xb0')](handleError(_0x296a0c,null));};exports[_0xff34('0xc6')]=function(_0x5a4a7b,_0x57d7dd){var _0x365b2b=moment()[_0xff34('0xc7')]()['toString']();var _0x219e77=path['join'](config['root'],_0xff34('0xc8'),_0xff34('0xc9'),_0xff34('0xca'));var _0x569b14=path[_0xff34('0xcb')](config['root'],_0xff34('0xc8'),_0xff34('0xc9'),_0xff34('0xcc'));var _0x16022c=path['join'](_0x219e77,_0x365b2b);var _0x1e2068=util[_0xff34('0xbf')](_0xff34('0xcd'),_0x5a4a7b[_0xff34('0xb2')]['id'],_0x365b2b);var _0x83ab99=path[_0xff34('0xcb')](_0x219e77,_0x1e2068);var _0x25bb02=[];_0x25bb02['push']({'model':db[_0xff34('0x71')],'as':_0xff34('0x71'),'attributes':['id',_0xff34('0xce')],'raw':!![]});_0x25bb02[_0xff34('0x34')]({'model':db[_0xff34('0xcf')],'as':'Contact','attributes':['id','firstName',_0xff34('0xd0')],'raw':!![]});if(_0x5a4a7b[_0xff34('0x41')][_0xff34('0xcc')]){_0x25bb02[_0xff34('0x34')]({'model':db[_0xff34('0xd1')],'as':_0xff34('0xd1'),'raw':!![]});}var _0x491f09=[{'model':db[_0xff34('0xb9')],'as':_0xff34('0xd2'),'attributes':['id',_0xff34('0x75'),'createdAt',_0xff34('0xd3'),_0xff34('0xd4'),'read'],'include':_0x25bb02}];_0x491f09['push']({'model':db[_0xff34('0xd5')],'as':_0xff34('0xd6'),'attributes':['id',_0xff34('0x2d')]});_0x491f09[_0xff34('0x34')]({'model':db[_0xff34('0x71')],'as':_0xff34('0xd7'),'attributes':['id',_0xff34('0xce')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x5a4a7b['params']['id']},'include':_0x491f09})[_0xff34('0x2a')](handleEntityNotFound(_0x57d7dd,null))[_0xff34('0x2a')](function(_0x5c8ee9){if(_0x5c8ee9){var _0x1ca4d5=_0x5c8ee9[_0xff34('0xd8')]({'plain':!![]});fs[_0xff34('0xd9')](_0x16022c);var _0x3dc9a1={'channel':_0xff34('0xda'),'account':_0x1ca4d5[_0xff34('0xd6')]['name'],'agent':_0x1ca4d5[_0xff34('0xd7')]?_0x1ca4d5[_0xff34('0xd7')][_0xff34('0xce')]:_0xff34('0xdb'),'createdAt':moment(_0x1ca4d5[_0xff34('0x7b')])[_0xff34('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0xff34('0x9b')](),'closedAt':_0x1ca4d5[_0xff34('0x38')]?moment(_0x1ca4d5[_0xff34('0xdc')])['format'](_0xff34('0xc0'))[_0xff34('0x9b')]():'','disposition':_0x1ca4d5[_0xff34('0xdd')],'messages':_(_0x1ca4d5[_0xff34('0xd2')])['filter']({'secret':![]})[_0xff34('0x2f')](function(_0xf4079a){if(_0xf4079a[_0xff34('0xd1')]){var _0x5d6ef5=path[_0xff34('0xcb')](_0x569b14,_0xf4079a['Attachment']['basename']);if(fs[_0xff34('0xde')](_0x5d6ef5)){fs[_0xff34('0xdf')](_0x5d6ef5)[_0xff34('0xe0')](fs['createWriteStream'](path[_0xff34('0xcb')](_0x16022c,_0xf4079a[_0xff34('0xd1')][_0xff34('0xe1')])));}}return{'date':moment(_0xf4079a[_0xff34('0x7b')])[_0xff34('0xbf')](_0xff34('0xc0'))['toString'](),'sender':_0xf4079a[_0xff34('0xd3')]===_0xff34('0xe2')?_0xf4079a['User']?_0xf4079a[_0xff34('0x71')][_0xff34('0xce')]:'System':_0xf4079a[_0xff34('0x64')][_0xff34('0xe3')]+(_0xf4079a[_0xff34('0x64')][_0xff34('0xd0')]?'\x20'+_0xf4079a[_0xff34('0x64')][_0xff34('0xd0')]:''),'body':_0xf4079a[_0xff34('0xd1')]?_0xf4079a[_0xff34('0xd1')][_0xff34('0xe1')]:_0xf4079a[_0xff34('0x75')],'direction':_0xf4079a['direction']===_0xff34('0xe2')?'A':'C','secret':_0xf4079a['secret'],'read':_0xf4079a[_0xff34('0x82')],'attachment':_0xf4079a[_0xff34('0xd1')]};})[_0xff34('0x60')]()};return ejs[_0xff34('0xe4')](path[_0xff34('0xcb')](config[_0xff34('0xe5')],'server',_0xff34('0xe6'),_0xff34('0xe7')),{'interaction':_0x3dc9a1})['then'](function(_0x1fdea2){var _0x183722=path[_0xff34('0xcb')](_0x16022c,'transcript-'+_0x1ca4d5['id']+'-'+_0x365b2b+_0xff34('0xe8'));var _0x2bc5ff={'path':_0x183722,'channel':_0xff34('0xda'),'interactionId':_0x1ca4d5['id']};return pdf[_0xff34('0xe9')](_0x1fdea2,_0x2bc5ff);})[_0xff34('0x2a')](function(){return new BPromise(function(_0xa003f4,_0x3b5815){zipdir(_0x16022c,{'saveTo':_0x83ab99},function(_0x1b9c91,_0x3344f6){if(_0x1b9c91)return _0x3b5815(_0x1b9c91);return _0xa003f4(_0x3344f6);});})['then'](function(){return new BPromise(function(_0x339cec,_0x269e5d){rimraf(_0x16022c,function(_0x32ad51){if(_0x32ad51)_0x269e5d(_0x32ad51);return _0x339cec();});});})['then'](function(){return _0x57d7dd[_0xff34('0xc6')](_0x83ab99,_0x1e2068,function(_0x3f891b){if(_0x3f891b){console[_0xff34('0xea')](_0xff34('0xeb'),_0x3f891b);}else{fs[_0xff34('0xec')](_0x83ab99);}});});});}else{return _0x57d7dd[_0xff34('0x1c')](0xc8);}})['catch'](handleError(_0x57d7dd,null));}; \ No newline at end of file +var _0xc19f=['isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','show','params','include','merge','options','create','describe','addMessage','ids','omit','findOne','WhatsappMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','setTags','spread','whatsappInteractionTags:save','removeTags','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','System','out','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','unlinkSync','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','fullname','TagIds','split','Tags','push','catch','answered','unmanaged','total','closed','waiting','UserId','talking','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','select','field','color','u.id','u.fullname','ui.WhatsappInteractionId','left_join','u.id\x20=\x20ui.UserId','from','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact'];(function(_0x554426,_0x308fbd){var _0x159e3b=function(_0x4ce812){while(--_0x4ce812){_0x554426['push'](_0x554426['shift']());}};_0x159e3b(++_0x308fbd);}(_0xc19f,0x164));var _0xfc19=function(_0x31b2f7,_0x41beab){_0x31b2f7=_0x31b2f7-0x0;var _0x537d82=_0xc19f[_0x31b2f7];return _0x537d82;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfc19('0x0'));var jsonpatch=require(_0xfc19('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfc19('0x2'));var Mustache=require(_0xfc19('0x3'));var util=require(_0xfc19('0x4'));var path=require(_0xfc19('0x5'));var sox=require(_0xfc19('0x6'));var csv=require(_0xfc19('0x7'));var ejs=require(_0xfc19('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfc19('0x9'));var jsforce=require(_0xfc19('0xa'));var deskjs=require(_0xfc19('0xb'));var toCsv=require(_0xfc19('0x7'));var querystring=require(_0xfc19('0xc'));var Papa=require(_0xfc19('0xd'));var Redis=require(_0xfc19('0xe'));var authService=require(_0xfc19('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xfc19('0x10'));var hardwareService=require(_0xfc19('0x11'));var logger=require('../../config/logger')(_0xfc19('0x12'));var utils=require('../../config/utils');var config=require(_0xfc19('0x13'));var licenseUtil=require(_0xfc19('0x14'));var db=require('../../mysqldb')['db'];config[_0xfc19('0x15')]=_[_0xfc19('0x16')](config['redis'],{'host':_0xfc19('0x17'),'port':0x18eb});var socket=require(_0xfc19('0x18'))(new Redis(config[_0xfc19('0x15')]));require(_0xfc19('0x19'))[_0xfc19('0x1a')](socket);function respondWithStatusCode(_0x4f4b84,_0x36b527){_0x36b527=_0x36b527||0xcc;return function(_0x38cf1f){if(_0x38cf1f){return _0x4f4b84[_0xfc19('0x1b')](_0x36b527);}return _0x4f4b84[_0xfc19('0x1c')](_0x36b527)[_0xfc19('0x1d')]();};}function respondWithResult(_0x3201b2,_0x30a3af){_0x30a3af=_0x30a3af||0xc8;return function(_0x375f00){if(_0x375f00){return _0x3201b2[_0xfc19('0x1c')](_0x30a3af)[_0xfc19('0x1e')](_0x375f00);}};}function respondWithFilteredResult(_0x28e5f2,_0x2f3143){return function(_0x17ebed){if(_0x17ebed){var _0x859e64=typeof _0x2f3143[_0xfc19('0x1f')]===_0xfc19('0x20')&&typeof _0x2f3143[_0xfc19('0x21')]===_0xfc19('0x20');var _0x41c0db=_0x17ebed[_0xfc19('0x22')];var _0xb943ee=_0x859e64?0x0:_0x2f3143[_0xfc19('0x1f')];var _0x2a4d18=_0x859e64?_0x17ebed['count']:_0x2f3143[_0xfc19('0x1f')]+_0x2f3143[_0xfc19('0x21')];var _0x3bedfc;if(_0x2a4d18>=_0x41c0db){_0x2a4d18=_0x41c0db;_0x3bedfc=0xc8;}else{_0x3bedfc=0xce;}_0x28e5f2['status'](_0x3bedfc);return _0x28e5f2[_0xfc19('0x23')](_0xfc19('0x24'),_0xb943ee+'-'+_0x2a4d18+'/'+_0x41c0db)['json'](_0x17ebed);}return null;};}function patchUpdates(_0x4236eb){return function(_0x295d30){try{jsonpatch['apply'](_0x295d30,_0x4236eb,!![]);}catch(_0x580329){return BPromise[_0xfc19('0x25')](_0x580329);}return _0x295d30['save']();};}function saveUpdates(_0x2f9b20,_0x479756){return function(_0x1cb08f){if(_0x1cb08f){return _0x1cb08f[_0xfc19('0x26')](_0x2f9b20)[_0xfc19('0x27')](function(_0x4883f1){return _0x4883f1;});}return null;};}function removeEntity(_0xe77f34,_0xc302a8){return function(_0xfdb8ea){if(_0xfdb8ea){return _0xfdb8ea[_0xfc19('0x28')]()[_0xfc19('0x27')](function(){_0xe77f34[_0xfc19('0x1c')](0xcc)[_0xfc19('0x1d')]();});}};}function handleEntityNotFound(_0x17078a,_0x15b7ca){return function(_0x4d939e){if(!_0x4d939e){_0x17078a[_0xfc19('0x1b')](0x194);}return _0x4d939e;};}function handleError(_0x126a5b,_0x55803d){_0x55803d=_0x55803d||0x1f4;return function(_0x10f5d5){logger[_0xfc19('0x29')](_0x10f5d5[_0xfc19('0x2a')]);if(_0x10f5d5[_0xfc19('0x2b')]){delete _0x10f5d5['name'];}_0x126a5b[_0xfc19('0x1c')](_0x55803d)[_0xfc19('0x2c')](_0x10f5d5);};}function getInteractionUsers(_0x2932bd,_0x548486){return new BPromise(function(_0x42e868,_0x1b38ae){try{if(_0x548486[_0x2932bd['id']]){_0x2932bd['Users']=_[_0xfc19('0x2d')](_0x548486[_0x2932bd['id']],function(_0x593e42){return{'id':_0x593e42['id'],'fullname':_0x593e42[_0xfc19('0x2e')]};});}}catch(_0x513e50){_0x1b38ae(_0x513e50);}_0x42e868(_0x2932bd);});}function getInteractionTags(_0x2db913,_0x3c0f37){return new BPromise(function(_0x178522,_0x243564){try{if(_0x2db913[_0xfc19('0x2f')]){_0x2db913['Tags']=[];_0x2db913['TagIds'][_0xfc19('0x30')](',')['forEach'](function(_0x2d8e2e){_0x2db913[_0xfc19('0x31')][_0xfc19('0x32')](_0x3c0f37[_0x2d8e2e]);});}delete _0x2db913[_0xfc19('0x2f')];}catch(_0x426d6b){_0x243564(_0x426d6b);}_0x178522(_0x2db913);});}function updateWhatsappInteraction(_0x269014,_0xfdf3db,_0x219269){return new BPromise(function(_0x46deae,_0x3a23a2){return getInteractionUsers(_0x269014,_0x219269)[_0xfc19('0x27')](function(_0xfb3c0){return getInteractionTags(_0xfb3c0,_0xfdf3db);})[_0xfc19('0x27')](function(_0x3b24bc){return getStateInteraction(_0x3b24bc);})[_0xfc19('0x27')](function(_0x2dfea5){_0x46deae(_0x2dfea5);})[_0xfc19('0x33')](function(_0x28933b){_0x3a23a2(_0x28933b);});});}function getStateInteraction(_0x4419de){return new BPromise(function(_0x22400c){_0x4419de['waiting']=0x0;_0x4419de['talking']=0x0;_0x4419de[_0xfc19('0x34')]=0x0;_0x4419de[_0xfc19('0x35')]=0x0;_0x4419de[_0xfc19('0x36')]=0x0;if(!_0x4419de[_0xfc19('0x37')]&&!_0x4419de['UserId']){_0x4419de[_0xfc19('0x38')]+=0x1;}if(!_0x4419de[_0xfc19('0x37')]&&_0x4419de[_0xfc19('0x39')]){_0x4419de[_0xfc19('0x3a')]+=0x1;if(_0x4419de['waiting']){_0x4419de[_0xfc19('0x38')]-=0x1;}}if(_0x4419de[_0xfc19('0x37')]&&_0x4419de[_0xfc19('0x39')]){_0x4419de[_0xfc19('0x34')]+=0x1;if(_0x4419de['talking']){_0x4419de['talking']-=0x1;}}if(_0x4419de['closed']&&!_0x4419de['UserId']){_0x4419de[_0xfc19('0x35')]+=0x1;if(_0x4419de[_0xfc19('0x38')]){_0x4419de[_0xfc19('0x38')]-=0x1;}}_0x4419de[_0xfc19('0x36')]+=0x1;_0x22400c(_0x4419de);});}exports[_0xfc19('0x3b')]=function(_0xffc422,_0x37f61f){var _0x2e43d2={},_0x21d27c={},_0x91a9b2={'count':0x0,'rows':[]};var _0x198491=_[_0xfc19('0x2d')](db[_0xfc19('0x3c')][_0xfc19('0x3d')],function(_0x51d40c){return{'name':_0x51d40c[_0xfc19('0x3e')],'type':_0x51d40c[_0xfc19('0x3f')][_0xfc19('0x40')]};});_0x21d27c[_0xfc19('0x41')]=_[_0xfc19('0x2d')](_0x198491,_0xfc19('0x2b'));_0x21d27c[_0xfc19('0x42')]=_[_0xfc19('0x43')](_0xffc422[_0xfc19('0x42')]);_0x21d27c[_0xfc19('0x44')]=_[_0xfc19('0x45')](_0x21d27c[_0xfc19('0x41')],_0x21d27c[_0xfc19('0x42')]);_0x2e43d2['attributes']=_[_0xfc19('0x45')](_0x21d27c['model'],qs[_0xfc19('0x46')](_0xffc422[_0xfc19('0x42')][_0xfc19('0x46')]));_0x2e43d2[_0xfc19('0x47')]=_0x2e43d2[_0xfc19('0x47')][_0xfc19('0x48')]?_0x2e43d2[_0xfc19('0x47')]:_0x21d27c[_0xfc19('0x41')];if(!_0xffc422[_0xfc19('0x42')]['hasOwnProperty'](_0xfc19('0x49'))){_0x2e43d2[_0xfc19('0x21')]=qs['limit'](_0xffc422[_0xfc19('0x42')]['limit']);_0x2e43d2[_0xfc19('0x1f')]=qs[_0xfc19('0x1f')](_0xffc422[_0xfc19('0x42')][_0xfc19('0x1f')]);}_0x2e43d2[_0xfc19('0x4a')]=qs[_0xfc19('0x4b')](_0xffc422[_0xfc19('0x42')][_0xfc19('0x4b')]);_0x2e43d2['where']=qs['filters'](_[_0xfc19('0x4c')](_0xffc422[_0xfc19('0x42')],_0x21d27c[_0xfc19('0x44')]),_0x198491);var _0x2ee4d4=[];var _0x411213=squel[_0xfc19('0x4d')]()[_0xfc19('0x4e')]('id')['field'](_0xfc19('0x2b'))[_0xfc19('0x4e')](_0xfc19('0x4f'))['from']('tools_tags');var _0x1ad4ca=squel[_0xfc19('0x4d')]()[_0xfc19('0x4e')](_0xfc19('0x50'))[_0xfc19('0x4e')](_0xfc19('0x51'))[_0xfc19('0x4e')](_0xfc19('0x52'))['from']('user_has_whatsapp_interactions','ui')[_0xfc19('0x53')]('users','u',_0xfc19('0x54'));var _0x14112f=squel['select']()[_0xfc19('0x55')](_0xfc19('0x56'),'i')[_0xfc19('0x53')]('cm_contacts','c',_0xfc19('0x57'))[_0xfc19('0x53')]('users','o','o.id\x20=\x20i.UserId')[_0xfc19('0x53')](_0xfc19('0x58'),'a',_0xfc19('0x59'))[_0xfc19('0x53')](_0xfc19('0x5a'),'me',_0xfc19('0x5b'))[_0xfc19('0x53')](_0xfc19('0x5c'),'it',_0xfc19('0x5d'))[_0xfc19('0x53')]('tools_tags','t',_0xfc19('0x5e'));var _0x572c38=squel[_0xfc19('0x5f')]();var _0x274e2c=[];var _0x2f394d=squel[_0xfc19('0x5f')]();var _0x24ecd5;if(_0xffc422[_0xfc19('0x42')][_0xfc19('0x60')]){_0x24ecd5=as[_0xfc19('0x61')](_0xffc422[_0xfc19('0x42')][_0xfc19('0x60')]);var _0x1cef39=_0x24ecd5['sqlOperator'];for(var _0x528548=0x0;_0x528548<_0x24ecd5['conditions'][_0xfc19('0x48')];_0x528548++){var _0x49dd78=_0x24ecd5[_0xfc19('0x62')][_0x528548];var _0x1a50e3='i';var _0x48c831=_[_0xfc19('0x63')](_0x198491,[_0xfc19('0x2b'),_0x49dd78['field']]);if(!_0x48c831){switch(_0x49dd78['field']){case _0xfc19('0x64'):if(_0x49dd78[_0xfc19('0x65')]==0x1){_0x14112f[_0xfc19('0x66')]('`'+_0x49dd78[_0xfc19('0x4e')]+_0xfc19('0x67'));}else{_0x14112f['having']('`'+_0x49dd78[_0xfc19('0x4e')]+_0xfc19('0x68'));}break;case'Contact':if(_0x49dd78['operator']===_0xfc19('0x69')){if(_0x49dd78[_0xfc19('0x65')]['split']('\x20')['length']>0x1){_0x572c38[_0x1cef39](_0xfc19('0x6a'),qs['getFullTextValue'](_0x49dd78[_0xfc19('0x65')]),null);}else{var _0x42fe5d='%'+_0x49dd78['value']+'%';_0x572c38[_0x1cef39](_0xfc19('0x6b'),_0x42fe5d,_0x42fe5d,_0x42fe5d);}}else{_0x48c831=_['find'](_0x198491,[_0xfc19('0x2b'),_0xfc19('0x6c')]);_0x49dd78[_0xfc19('0x4e')]='ContactId';_0x5d0f0e=as[_0xfc19('0x6d')](_0x1a50e3,_0x48c831[_0xfc19('0x3f')],_0x49dd78);_0x572c38[_0x1cef39](_0x5d0f0e['text'],_0x5d0f0e['value'][_0xfc19('0x6e')],_0x5d0f0e[_0xfc19('0x65')][_0xfc19('0x1d')]);}break;case _0xfc19('0x6f'):var _0x1c5d0c=_0x49dd78[_0xfc19('0x65')][_0xfc19('0x30')](',')[_0xfc19('0x2d')](function(_0x341d8b){return Number(_0x341d8b);});_0x1c5d0c[_0xfc19('0x70')](function(_0x3860fb){_0x2f394d['or'](_0xfc19('0x71'),'%,'+_0x3860fb+',%');});_0x274e2c=_[_0xfc19('0x72')](_0x274e2c,_0x1c5d0c);break;case _0xfc19('0x73'):if(_0x49dd78[_0xfc19('0x74')]===_0xfc19('0x69')){_0x572c38[_0x1cef39](_0xfc19('0x75'),'%'+_0x49dd78['value']+'%',null);}else{_0x48c831=_['find'](_0x198491,[_0xfc19('0x2b'),_0xfc19('0x39')]);_0x49dd78[_0xfc19('0x4e')]=_0xfc19('0x39');_0x5d0f0e=as[_0xfc19('0x6d')](_0x1a50e3,_0x48c831[_0xfc19('0x3f')],_0x49dd78);_0x572c38[_0x1cef39](_0x5d0f0e[_0xfc19('0x76')],_0x5d0f0e[_0xfc19('0x65')][_0xfc19('0x6e')],_0x5d0f0e[_0xfc19('0x65')][_0xfc19('0x1d')]);}break;case _0xfc19('0x77'):_0x5d0f0e=as[_0xfc19('0x6d')]('me',null,_0x49dd78);_0x572c38[_0x1cef39](_0x5d0f0e['text'],_0x5d0f0e[_0xfc19('0x65')]['start'],_0x5d0f0e[_0xfc19('0x65')][_0xfc19('0x1d')]);break;}}else{var _0x5d0f0e=as['buildExpression'](_0x1a50e3,_0x48c831[_0xfc19('0x3f')],_0x49dd78);_0x572c38[_0x1cef39](_0x5d0f0e[_0xfc19('0x76')],_0x5d0f0e[_0xfc19('0x65')][_0xfc19('0x6e')],_0x5d0f0e[_0xfc19('0x65')][_0xfc19('0x1d')]);}}}else{var _0x51de0b=_(_0xffc422['query'])['keys']()[_0xfc19('0x2d')](function(_0x44c673){return _[_0xfc19('0x78')](_0x198491,[_0xfc19('0x2b'),_0x44c673])?_0x44c673:undefined;})[_0xfc19('0x79')]()['value']();if(!_[_0xfc19('0x7a')](_0x51de0b)){_0x51de0b['forEach'](function(_0x1f2e46){if(_0x1f2e46===_0xfc19('0x7b')){_0x14112f[_0xfc19('0x7c')](_0xfc19('0x7d'),[]['concat'](_0xffc422['query'][_0x1f2e46]));}else if(_0x1f2e46===_0xfc19('0x7e')){var _0x454541=JSON[_0xfc19('0x7f')](_0xffc422[_0xfc19('0x42')][_0x1f2e46])[_0xfc19('0x80')];var _0x38551d=JSON['parse'](_0xffc422[_0xfc19('0x42')][_0x1f2e46])[_0xfc19('0x81')];_0x14112f[_0xfc19('0x7c')](_0xfc19('0x82'),_0x454541,_0x38551d);}else{if(_0xffc422[_0xfc19('0x42')][_0x1f2e46]==='null'){_0x14112f['where']('i.'+_0x1f2e46+_0xfc19('0x83'));}else{_0x14112f['where']('i.'+_0x1f2e46+_0xfc19('0x84'),_0xffc422[_0xfc19('0x42')][_0x1f2e46]);}}});}if(_0xffc422[_0xfc19('0x42')][_0xfc19('0x85')]){if(_0xffc422[_0xfc19('0x42')]['read']==0x1){_0x14112f['having'](_0xfc19('0x86'));}else{_0x14112f[_0xfc19('0x66')](_0xfc19('0x87'));}}if(_0xffc422[_0xfc19('0x42')][_0xfc19('0x88')]){_0x274e2c=_[_0xfc19('0x89')](_0xffc422[_0xfc19('0x42')][_0xfc19('0x88')])?_0xffc422[_0xfc19('0x42')]['tag']:new Array(_0xffc422[_0xfc19('0x42')][_0xfc19('0x88')]);_0x274e2c[_0xfc19('0x70')](function(_0x251a25){_0x2f394d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x251a25+',%');});}if(_0xffc422[_0xfc19('0x42')][_0xfc19('0x8a')]){var _0x37fd6d=_0xffc422[_0xfc19('0x42')][_0xfc19('0x8a')]['replace']('\x5c','\x5c\x5c')[_0xfc19('0x8b')](/'/g,'\x27\x27');if(qs[_0xfc19('0x8c')](_0x37fd6d)){_0x572c38['or']('i.id\x20LIKE\x20?',_0x37fd6d+'%')['or'](_0xfc19('0x8d'),_0x37fd6d+'%');}else{_0x572c38['or'](_0xfc19('0x8e'),qs['getFullTextValue'](_0x37fd6d))['or'](_0xfc19('0x8f'),_0x37fd6d+'%');}}}_0x14112f['where'](_0x572c38);_0x14112f[_0xfc19('0x90')](_0xfc19('0x91'));var _0x224fcc={'type':db['Sequelize'][_0xfc19('0x92')][_0xfc19('0x93')],'raw':!![]};var _0x32ff99=_0x14112f['clone']();_0x32ff99[_0xfc19('0x4e')](_0xfc19('0x91'));_0x32ff99[_0xfc19('0x4e')](_0xfc19('0x94'),_0xfc19('0x64'));if(_0x2e43d2[_0xfc19('0x4a')]){_0x2e43d2[_0xfc19('0x4a')]['forEach'](function(_0x501fa4){var _0x4ef2c2=_0x501fa4[0x0]===_0xfc19('0x95')?_0x501fa4[0x0]:'i.'+_0x501fa4[0x0];_0x14112f[_0xfc19('0x4a')](_0x4ef2c2,_0x501fa4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfc19('0x7a')](_0x274e2c)){_0x14112f['having'](_0x2f394d);_0x32ff99[_0xfc19('0x7c')](_0xfc19('0x96'),_0x274e2c);}BPromise[_0xfc19('0x97')]()[_0xfc19('0x27')](function(){if(!_0x24ecd5){if(_0xffc422['query']['WhatsappAccountId'])return;_0x32ff99[_0xfc19('0x7c')](_0xfc19('0x98'));_0x14112f[_0xfc19('0x7c')](_0xfc19('0x98'));return;}if(_0xffc422[_0xfc19('0x99')][_0xfc19('0x9a')]!=='agent')return;return _0xffc422['user'][_0xfc19('0x9b')]({'attributes':['id'],'raw':!![]})[_0xfc19('0x27')](function(_0x25d313){if(_[_0xfc19('0x7a')](_0x25d313)){_0x32ff99[_0xfc19('0x7c')](_0xfc19('0x9c'));_0x14112f[_0xfc19('0x7c')](_0xfc19('0x9c'));}else{_0x32ff99[_0xfc19('0x7c')](_0xfc19('0x7d'),_['map'](_0x25d313,'id'));_0x14112f[_0xfc19('0x7c')](_0xfc19('0x7d'),_[_0xfc19('0x2d')](_0x25d313,'id'));}});})[_0xfc19('0x27')](function(){if(_0xffc422[_0xfc19('0x99')][_0xfc19('0x9a')]==='agent'&&!_0x24ecd5&&!_0xffc422[_0xfc19('0x42')][_0xfc19('0x7b')])return[];return db[_0xfc19('0x9d')][_0xfc19('0x42')](_0x32ff99[_0xfc19('0x9e')](),_0x224fcc);})[_0xfc19('0x27')](function(_0xe7b0c6){_0x91a9b2['count']=_0xe7b0c6[_0xfc19('0x48')];if(_0x91a9b2[_0xfc19('0x22')]===0x0)return[];return db['sequelize'][_0xfc19('0x42')](_0x411213[_0xfc19('0x9e')](),_0x224fcc)['then'](function(_0x1eaff1){_0x2ee4d4=_[_0xfc19('0x9f')](_0x1eaff1,'id');_0x224fcc=_['merge'](_0x224fcc,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xffc422['query'][_0xfc19('0x46')]){_0x2e43d2[_0xfc19('0x47')][_0xfc19('0x70')](function(_0x5bfe9d){_0x14112f[_0xfc19('0x4e')]('i.'+_0x5bfe9d);});}else{_0x14112f[_0xfc19('0x4e')](_0xfc19('0x94'),_0xfc19('0x64'));_0x14112f[_0xfc19('0x4e')](_0xfc19('0xa0'),'Account.key');_0x14112f[_0xfc19('0x4e')](_0xfc19('0xa1'),_0xfc19('0xa2'));_0x14112f[_0xfc19('0x4e')](_0xfc19('0xa3'),_0xfc19('0x95'));_0x14112f[_0xfc19('0x4e')](_0xfc19('0xa4'));_0x14112f['field'](_0xfc19('0xa5'),_0xfc19('0xa6'));_0x14112f[_0xfc19('0x4e')](_0xfc19('0xa7'),'Contact.lastName');_0x14112f[_0xfc19('0x4e')](_0xfc19('0xa8'),'Contact.email');_0x14112f['field'](_0xfc19('0xa9'),_0xfc19('0xaa'));_0x14112f[_0xfc19('0x4e')]('c.mobile','Contact.mobile');_0x14112f[_0xfc19('0x4e')]('c.fax',_0xfc19('0xab'));_0x14112f[_0xfc19('0x4e')](_0xfc19('0xac'),_0xfc19('0xad'));_0x14112f[_0xfc19('0x4e')](_0xfc19('0xae'),'Owner.internal');_0x14112f[_0xfc19('0x4e')](_0xfc19('0xaf'),'TagIds');}if(_0x2e43d2['limit'])_0x14112f[_0xfc19('0x21')](_0x2e43d2[_0xfc19('0x21')]);if(_0x2e43d2[_0xfc19('0x1f')])_0x14112f[_0xfc19('0x1f')](_0x2e43d2['offset']);return db[_0xfc19('0x9d')]['query'](_0x14112f[_0xfc19('0x9e')](),_0x224fcc);})[_0xfc19('0x27')](function(_0x5402f9){if(_0x5402f9[_0xfc19('0x48')]>0x0)_0x1ad4ca[_0xfc19('0x7c')](_0xfc19('0xb0'),_[_0xfc19('0x2d')](_0x5402f9,'id'));return db[_0xfc19('0x9d')][_0xfc19('0x42')](_0x1ad4ca[_0xfc19('0x9e')](),_0x224fcc)[_0xfc19('0x27')](function(_0x254591){var _0x1c57f8=_[_0xfc19('0xb1')](_0x254591,_0xfc19('0xb2'));var _0x1d5c09=[];_0x5402f9[_0xfc19('0x70')](function(_0x3aeb69){_0x1d5c09[_0xfc19('0x32')](updateWhatsappInteraction(_0x3aeb69,_0x2ee4d4,_0x1c57f8));});return BPromise[_0xfc19('0xb3')](_0x1d5c09);});});})[_0xfc19('0x27')](function(_0x5d0be1){_0x91a9b2['rows']=_0x5d0be1;return _0x91a9b2;})[_0xfc19('0x27')](respondWithFilteredResult(_0x37f61f,_0x2e43d2))['catch'](handleError(_0x37f61f,null));};exports[_0xfc19('0xb4')]=function(_0x190ac4,_0x16140e){var _0x5dcc06={'raw':![],'where':{'id':_0x190ac4[_0xfc19('0xb5')]['id']}},_0x8d98e6={};_0x8d98e6['model']=_[_0xfc19('0x43')](db['WhatsappInteraction']['rawAttributes']);_0x8d98e6[_0xfc19('0x42')]=_[_0xfc19('0x43')](_0x190ac4[_0xfc19('0x42')]);_0x8d98e6[_0xfc19('0x44')]=_['intersection'](_0x8d98e6[_0xfc19('0x41')],_0x8d98e6[_0xfc19('0x42')]);_0x5dcc06[_0xfc19('0x47')]=_['intersection'](_0x8d98e6[_0xfc19('0x41')],qs[_0xfc19('0x46')](_0x190ac4[_0xfc19('0x42')][_0xfc19('0x46')]));_0x5dcc06[_0xfc19('0x47')]=_0x5dcc06[_0xfc19('0x47')][_0xfc19('0x48')]?_0x5dcc06[_0xfc19('0x47')]:_0x8d98e6[_0xfc19('0x41')];if(_0x190ac4[_0xfc19('0x42')]['includeAll']){_0x5dcc06[_0xfc19('0xb6')]=[{'all':!![]}];}_0x5dcc06=_[_0xfc19('0xb7')]({},_0x5dcc06,_0x190ac4[_0xfc19('0xb8')]);return db[_0xfc19('0x3c')][_0xfc19('0x63')](_0x5dcc06)['then'](handleEntityNotFound(_0x16140e,null))[_0xfc19('0x27')](respondWithResult(_0x16140e,null))[_0xfc19('0x33')](handleError(_0x16140e,null));};exports['create']=function(_0x25ff8a,_0x27f127){return db[_0xfc19('0x3c')][_0xfc19('0xb9')](_0x25ff8a[_0xfc19('0x77')],{})[_0xfc19('0x27')](respondWithResult(_0x27f127,0xc9))[_0xfc19('0x33')](handleError(_0x27f127,null));};exports['update']=function(_0x3bc4fc,_0x13b836){if(_0x3bc4fc[_0xfc19('0x77')]['id']){delete _0x3bc4fc['body']['id'];}return db['WhatsappInteraction'][_0xfc19('0x63')]({'where':{'id':_0x3bc4fc['params']['id']}})[_0xfc19('0x27')](handleEntityNotFound(_0x13b836,null))[_0xfc19('0x27')](saveUpdates(_0x3bc4fc[_0xfc19('0x77')],null))[_0xfc19('0x27')](respondWithResult(_0x13b836,null))[_0xfc19('0x33')](handleError(_0x13b836,null));};exports[_0xfc19('0x28')]=function(_0x58858a,_0x54bce1){return db[_0xfc19('0x3c')][_0xfc19('0x63')]({'where':{'id':_0x58858a[_0xfc19('0xb5')]['id']}})[_0xfc19('0x27')](handleEntityNotFound(_0x54bce1,null))[_0xfc19('0x27')](removeEntity(_0x54bce1,null))[_0xfc19('0x33')](handleError(_0x54bce1,null));};exports[_0xfc19('0xba')]=function(_0x3ce9eb,_0x5cafff){return db['WhatsappInteraction'][_0xfc19('0xba')]()[_0xfc19('0x27')](respondWithResult(_0x5cafff,null))['catch'](handleError(_0x5cafff,null));};exports['addMessage']=function(_0x2970db,_0x2a4097,_0x42c689){return db['WhatsappMessage'][_0xfc19('0x63')]({'where':{'id':_0x2970db[_0xfc19('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2a4097,null))['then'](function(_0x1ad784){if(_0x1ad784){return _0x1ad784[_0xfc19('0xbb')](_0x2970db['body'][_0xfc19('0xbc')],_[_0xfc19('0xbd')](_0x2970db[_0xfc19('0x77')],['ids','id'])||{});}})[_0xfc19('0x27')](respondWithResult(_0x2a4097,null))[_0xfc19('0x33')](handleError(_0x2a4097,null));};exports['getMessages']=function(_0x1ed443,_0xfe90b1,_0x4d2403){var _0xec678={'raw':![],'where':{}};var _0x1441d1={};var _0x30da3d={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xfc19('0xbe')]({'where':{'id':_0x1ed443[_0xfc19('0xb5')]['id']}})[_0xfc19('0x27')](handleEntityNotFound(_0xfe90b1,null))[_0xfc19('0x27')](function(_0x1dc8e8){if(_0x1dc8e8){_0x1441d1[_0xfc19('0x41')]=_['keys'](db[_0xfc19('0xbf')][_0xfc19('0x3d')]);_0x1441d1[_0xfc19('0x42')]=_[_0xfc19('0x43')](_0x1ed443[_0xfc19('0x42')]);_0x1441d1['filters']=_[_0xfc19('0x45')](_0x1441d1[_0xfc19('0x41')],_0x1441d1[_0xfc19('0x42')]);_0xec678['attributes']=_[_0xfc19('0x45')](_0x1441d1[_0xfc19('0x41')],qs['fields'](_0x1ed443[_0xfc19('0x42')][_0xfc19('0x46')]));_0xec678[_0xfc19('0x47')]=_0xec678[_0xfc19('0x47')][_0xfc19('0x48')]?_0xec678['attributes']:_0x1441d1[_0xfc19('0x41')];if(!_0x1ed443[_0xfc19('0x42')][_0xfc19('0xc0')](_0xfc19('0x49'))){_0xec678[_0xfc19('0x21')]=qs[_0xfc19('0x21')](_0x1ed443[_0xfc19('0x42')][_0xfc19('0x21')]);_0xec678['offset']=qs[_0xfc19('0x1f')](_0x1ed443[_0xfc19('0x42')][_0xfc19('0x1f')]);}_0xec678[_0xfc19('0x4a')]=qs['sort'](_0x1ed443[_0xfc19('0x42')]['sort']);_0xec678[_0xfc19('0x7c')]=qs['filters'](_['pick'](_0x1ed443[_0xfc19('0x42')],_0x1441d1['filters']));_0xec678[_0xfc19('0x7c')][_0xfc19('0xb2')]=_0x1dc8e8['id'];if(_0x1ed443[_0xfc19('0x42')][_0xfc19('0x8a')]){_0xec678['where']=_[_0xfc19('0xb7')](_0xec678[_0xfc19('0x7c')],{'$or':_[_0xfc19('0x2d')](_0xec678[_0xfc19('0x47')],function(_0x22f656){var _0x5af514={};_0x5af514[_0x22f656]={'$like':'%'+_0x1ed443[_0xfc19('0x42')]['filter']+'%'};return _0x5af514;})});}if(_0x1ed443['query'][_0xfc19('0x80')]){var _0x182f2c=_0x1ed443[_0xfc19('0x42')][_0xfc19('0x80')][_0xfc19('0x30')](',');var _0x47bf24={};_0x47bf24[_0x182f2c[0x0]]={'$gte':moment(_0x182f2c[0x1])[_0xfc19('0xc1')](_0xfc19('0xc2'))};_0xec678['where']=_[_0xfc19('0xb7')](_0xec678[_0xfc19('0x7c')],_0x47bf24);}_0xec678=_[_0xfc19('0xb7')]({},_0xec678,_0x1ed443['options']);return db[_0xfc19('0xbf')][_0xfc19('0x22')]({'where':_0xec678[_0xfc19('0x7c')]})['then'](function(_0x2aea24){_0x30da3d[_0xfc19('0x22')]=_0x2aea24;if(_0x1ed443[_0xfc19('0x42')][_0xfc19('0xc3')]){_0xec678[_0xfc19('0xb6')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xfc19('0xc4')](_0xec678);})['then'](function(_0x78c052){_0x30da3d[_0xfc19('0xc5')]=_0x78c052;return _0x30da3d;});}})[_0xfc19('0x27')](respondWithFilteredResult(_0xfe90b1,_0xec678))['catch'](handleError(_0xfe90b1,null));};exports['addTags']=function(_0x5b17e3,_0x2408ad,_0xb81c9e){return db[_0xfc19('0x3c')][_0xfc19('0x63')]({'where':{'id':_0x5b17e3[_0xfc19('0xb5')]['id']}})[_0xfc19('0x27')](handleEntityNotFound(_0x2408ad,null))['then'](function(_0x28fa3b){if(_0x28fa3b){return _0x28fa3b[_0xfc19('0xc6')](_0x5b17e3[_0xfc19('0x77')]['ids'],_[_0xfc19('0xbd')](_0x5b17e3[_0xfc19('0x77')],[_0xfc19('0xbc'),'id'])||{})[_0xfc19('0xc7')](function(){return db[_0xfc19('0x6f')][_0xfc19('0xc4')]({'attributes':['id',_0xfc19('0x2b'),_0xfc19('0x4f')],'where':{'id':_0x5b17e3[_0xfc19('0x77')]['ids']}});})['then'](function(_0x196c33){socket['emit'](_0xfc19('0xc8'),{'id':Number(_0x5b17e3['params']['id']),'tags':_0x196c33||[]});return{'id':Number(_0x5b17e3[_0xfc19('0xb5')]['id']),'tags':_0x196c33||[]};});}})[_0xfc19('0x27')](respondWithResult(_0x2408ad,null))[_0xfc19('0x33')](handleError(_0x2408ad,null));};exports[_0xfc19('0xc9')]=function(_0x1683b3,_0x1147ee,_0x18e78f){return db[_0xfc19('0x3c')]['find']({'where':{'id':_0x1683b3[_0xfc19('0xb5')]['id']}})[_0xfc19('0x27')](handleEntityNotFound(_0x1147ee,null))[_0xfc19('0x27')](function(_0x33668c){if(_0x33668c){return _0x33668c[_0xfc19('0xc9')](_0x1683b3[_0xfc19('0x42')][_0xfc19('0xbc')]);}})[_0xfc19('0x27')](respondWithStatusCode(_0x1147ee,null))[_0xfc19('0x33')](handleError(_0x1147ee,null));};exports['download']=function(_0x5b8e59,_0x168366){var _0x1affd3=moment()[_0xfc19('0xca')]()[_0xfc19('0x9e')]();var _0x46be26=path[_0xfc19('0xcb')](config['root'],_0xfc19('0xcc'),'files',_0xfc19('0xcd'));var _0x363c53=path[_0xfc19('0xcb')](config[_0xfc19('0xce')],_0xfc19('0xcc'),_0xfc19('0xcf'),_0xfc19('0xd0'));var _0x4ca60d=path[_0xfc19('0xcb')](_0x46be26,_0x1affd3);var _0x2fdc46=util[_0xfc19('0xc1')](_0xfc19('0xd1'),_0x5b8e59[_0xfc19('0xb5')]['id'],_0x1affd3);var _0x1ca64e=path[_0xfc19('0xcb')](_0x46be26,_0x2fdc46);var _0x993e11=[];_0x993e11[_0xfc19('0x32')]({'model':db[_0xfc19('0x73')],'as':_0xfc19('0x73'),'attributes':['id',_0xfc19('0x2e')],'raw':!![]});_0x993e11[_0xfc19('0x32')]({'model':db['CmContact'],'as':_0xfc19('0xd2'),'attributes':['id',_0xfc19('0xd3'),_0xfc19('0xd4')],'raw':!![]});if(_0x5b8e59['query'][_0xfc19('0xd0')]){_0x993e11[_0xfc19('0x32')]({'model':db[_0xfc19('0xd5')],'as':_0xfc19('0xd5'),'raw':!![]});}var _0x4a1d94=[{'model':db[_0xfc19('0xbf')],'as':_0xfc19('0xd6'),'attributes':['id',_0xfc19('0x77'),_0xfc19('0x7e'),_0xfc19('0xd7'),_0xfc19('0xd8'),_0xfc19('0x85')],'include':_0x993e11}];_0x4a1d94[_0xfc19('0x32')]({'model':db[_0xfc19('0xd9')],'as':'Account','attributes':['id',_0xfc19('0x2b')]});_0x4a1d94[_0xfc19('0x32')]({'model':db[_0xfc19('0x73')],'as':_0xfc19('0xda'),'attributes':['id',_0xfc19('0x2e')]});return db[_0xfc19('0x3c')][_0xfc19('0x63')]({'where':{'id':_0x5b8e59[_0xfc19('0xb5')]['id']},'include':_0x4a1d94})[_0xfc19('0x27')](handleEntityNotFound(_0x168366,null))[_0xfc19('0x27')](function(_0x1fda8d){if(_0x1fda8d){var _0x19211d=_0x1fda8d[_0xfc19('0xdb')]({'plain':!![]});fs[_0xfc19('0xdc')](_0x4ca60d);var _0x2a3f3f={'channel':_0xfc19('0xdd'),'account':_0x19211d[_0xfc19('0xde')][_0xfc19('0x2b')],'agent':_0x19211d[_0xfc19('0xda')]?_0x19211d[_0xfc19('0xda')]['fullname']:_0xfc19('0xdf'),'createdAt':moment(_0x19211d[_0xfc19('0x7e')])[_0xfc19('0xc1')](_0xfc19('0xc2'))[_0xfc19('0x9e')](),'closedAt':_0x19211d[_0xfc19('0x37')]?moment(_0x19211d[_0xfc19('0xe0')])[_0xfc19('0xc1')](_0xfc19('0xc2'))[_0xfc19('0x9e')]():'','disposition':_0x19211d[_0xfc19('0xe1')],'messages':_(_0x19211d[_0xfc19('0xd6')])[_0xfc19('0x8a')]({'secret':![]})['map'](function(_0x432fe4){if(_0x432fe4['Attachment']){var _0x3392f4=path[_0xfc19('0xcb')](_0x363c53,_0x432fe4[_0xfc19('0xd5')][_0xfc19('0xe2')]);if(fs['existsSync'](_0x3392f4)){fs[_0xfc19('0xe3')](_0x3392f4)[_0xfc19('0xe4')](fs[_0xfc19('0xe5')](path['join'](_0x4ca60d,_0x432fe4[_0xfc19('0xd5')]['basename'])));}}return{'date':moment(_0x432fe4[_0xfc19('0x7e')])[_0xfc19('0xc1')](_0xfc19('0xc2'))[_0xfc19('0x9e')](),'sender':_0x432fe4[_0xfc19('0xd7')]==='out'?_0x432fe4['User']?_0x432fe4['User'][_0xfc19('0x2e')]:_0xfc19('0xe6'):_0x432fe4[_0xfc19('0xd2')][_0xfc19('0xd3')]+(_0x432fe4['Contact'][_0xfc19('0xd4')]?'\x20'+_0x432fe4[_0xfc19('0xd2')][_0xfc19('0xd4')]:''),'body':_0x432fe4[_0xfc19('0xd5')]?_0x432fe4['Attachment'][_0xfc19('0xe2')]:_0x432fe4[_0xfc19('0x77')],'direction':_0x432fe4[_0xfc19('0xd7')]===_0xfc19('0xe7')?'A':'C','secret':_0x432fe4[_0xfc19('0xd8')],'read':_0x432fe4[_0xfc19('0x85')],'attachment':_0x432fe4[_0xfc19('0xd5')]};})[_0xfc19('0x65')]()};return ejs['renderFile'](path['join'](config['root'],_0xfc19('0xcc'),_0xfc19('0xe8'),_0xfc19('0xe9')),{'interaction':_0x2a3f3f})['then'](function(_0x4bd80f){var _0x356eb1=path[_0xfc19('0xcb')](_0x4ca60d,_0xfc19('0xea')+_0x19211d['id']+'-'+_0x1affd3+'.pdf');var _0x2e1b6e={'path':_0x356eb1,'channel':_0xfc19('0xdd'),'interactionId':_0x19211d['id']};return pdf[_0xfc19('0xeb')](_0x4bd80f,_0x2e1b6e);})['then'](function(){return new BPromise(function(_0x5744c3,_0x155bf1){zipdir(_0x4ca60d,{'saveTo':_0x1ca64e},function(_0x1f808e,_0x2c5b00){if(_0x1f808e)return _0x155bf1(_0x1f808e);return _0x5744c3(_0x2c5b00);});})[_0xfc19('0x27')](function(){return new BPromise(function(_0x57dbe6,_0x4d408b){rimraf(_0x4ca60d,function(_0x336a34){if(_0x336a34)_0x4d408b(_0x336a34);return _0x57dbe6();});});})[_0xfc19('0x27')](function(){return _0x168366[_0xfc19('0xec')](_0x1ca64e,_0x2fdc46,function(_0xa96b70){if(_0xa96b70){console[_0xfc19('0xed')]('err',_0xa96b70);}else{fs[_0xfc19('0xee')](_0x1ca64e);}});});});}else{return _0x168366[_0xfc19('0x1b')](0xc8);}})[_0xfc19('0x33')](handleError(_0x168366,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index ff98a0f..f3f2265 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 _0xb98f=['WhatsappInteraction','WhatsappMessage','remove','getUsers','then','setDataValue','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2e561f,_0x1e73f6){var _0xe9912a=function(_0x3b44e0){while(--_0x3b44e0){_0x2e561f['push'](_0x2e561f['shift']());}};_0xe9912a(++_0x1e73f6);}(_0xb98f,0xce));var _0xfb98=function(_0x127962,_0x5e1a78){_0x127962=_0x127962-0x0;var _0x376bec=_0xb98f[_0x127962];return _0x376bec;};'use strict';var EventEmitter=require(_0xfb98('0x0'));var WhatsappInteraction=require(_0xfb98('0x1'))['db'][_0xfb98('0x2')];var WhatsappMessage=require(_0xfb98('0x1'))['db'][_0xfb98('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfb98('0x4')};function emitEvent(_0x201ab9){return function(_0x2c9b5a,_0x2a4249,_0x544b6d){_0x2c9b5a[_0xfb98('0x5')]({'attributes':['id'],'raw':!![]})[_0xfb98('0x6')](function(_0x5683e3){_0x2c9b5a[_0xfb98('0x7')]('Users',_0x5683e3['map'](function(_0x54ee3b){return{'id':_0x54ee3b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x2c9b5a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x45a0a3){_0x2c9b5a[_0xfb98('0x7')]('unreadMessages',_0x45a0a3['length']);WhatsappInteractionEvents[_0xfb98('0x8')](_0x201ab9+':'+_0x2c9b5a['id'],_0x2c9b5a);WhatsappInteractionEvents['emit'](_0x201ab9,_0x2c9b5a);_0x544b6d(null);})[_0xfb98('0x9')](_0x544b6d(null));};}for(var e in events){if(events[_0xfb98('0xa')](e)){var event=events[e];WhatsappInteraction[_0xfb98('0xb')](e,emitEvent(event));}}module[_0xfb98('0xc')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x7834=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x2b1b15,_0x3b5ec8){var _0x395892=function(_0x4295de){while(--_0x4295de){_0x2b1b15['push'](_0x2b1b15['shift']());}};_0x395892(++_0x3b5ec8);}(_0x7834,0x13f));var _0x4783=function(_0x405a1f,_0x446aa3){_0x405a1f=_0x405a1f-0x0;var _0x4fd010=_0x7834[_0x405a1f];return _0x4fd010;};'use strict';var EventEmitter=require(_0x4783('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x4783('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4783('0x2')](0x0);var events={'afterCreate':_0x4783('0x3'),'afterUpdate':_0x4783('0x4'),'afterDestroy':_0x4783('0x5')};function emitEvent(_0x29566c){return function(_0x3ebf06,_0x4150f2,_0x49114c){_0x3ebf06[_0x4783('0x6')]({'attributes':['id'],'raw':!![]})[_0x4783('0x7')](function(_0x518da8){_0x3ebf06[_0x4783('0x8')](_0x4783('0x9'),_0x518da8[_0x4783('0xa')](function(_0x112a19){return{'id':_0x112a19['id']};}));return WhatsappMessage[_0x4783('0xb')]({'where':{'WhatsappInteractionId':_0x3ebf06['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4783('0x7')](function(_0x5caa81){_0x3ebf06[_0x4783('0x8')](_0x4783('0xc'),_0x5caa81[_0x4783('0xd')]);WhatsappInteractionEvents[_0x4783('0xe')](_0x29566c+':'+_0x3ebf06['id'],_0x3ebf06);WhatsappInteractionEvents[_0x4783('0xe')](_0x29566c,_0x3ebf06);_0x49114c(null);})[_0x4783('0xf')](_0x49114c(null));};}for(var e in events){if(events[_0x4783('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index a1132af..befbe76 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 _0x56bb=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x4db1a6,_0x255276){var _0x2796a8=function(_0x39d010){while(--_0x39d010){_0x4db1a6['push'](_0x4db1a6['shift']());}};_0x2796a8(++_0x255276);}(_0x56bb,0x173));var _0xb56b=function(_0x49bbb8,_0x428f4a){_0x49bbb8=_0x49bbb8-0x0;var _0x9d5e0d=_0x56bb[_0x49bbb8];return _0x9d5e0d;};'use strict';var _=require(_0xb56b('0x0'));var util=require(_0xb56b('0x1'));var logger=require(_0xb56b('0x2'))(_0xb56b('0x3'));var moment=require('moment');var BPromise=require(_0xb56b('0x4'));var rp=require(_0xb56b('0x5'));var fs=require('fs');var path=require(_0xb56b('0x6'));var rimraf=require(_0xb56b('0x7'));var config=require(_0xb56b('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0xb56b('0x9')]=function(_0x1a2e05,_0x17f26a){return _0x1a2e05[_0xb56b('0xa')](_0xb56b('0xb'),attributes,{'tableName':_0xb56b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xed1334,_0x42bba1,_0x3f6aab){if(_0xed1334['changed'](_0xb56b('0xd'))){_0xed1334[_0xb56b('0xe')]=moment()[_0xb56b('0xf')](_0xb56b('0x10'));}_0x3f6aab(null,_0xed1334);}}});}; \ No newline at end of file +var _0x2062=['../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x532068,_0x40b1b3){var _0x5bc7ef=function(_0x562672){while(--_0x562672){_0x532068['push'](_0x532068['shift']());}};_0x5bc7ef(++_0x40b1b3);}(_0x2062,0xd9));var _0x2206=function(_0x28c939,_0x110e29){_0x28c939=_0x28c939-0x0;var _0x527fe9=_0x2062[_0x28c939];return _0x527fe9;};'use strict';var _=require(_0x2206('0x0'));var util=require('util');var logger=require(_0x2206('0x1'))('api');var moment=require(_0x2206('0x2'));var BPromise=require(_0x2206('0x3'));var rp=require(_0x2206('0x4'));var fs=require('fs');var path=require(_0x2206('0x5'));var rimraf=require(_0x2206('0x6'));var config=require(_0x2206('0x7'));var attributes=require(_0x2206('0x8'));module[_0x2206('0x9')]=function(_0xd5b2de,_0xc1b862){return _0xd5b2de['define'](_0x2206('0xa'),attributes,{'tableName':_0x2206('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44ec46,_0x54cf9b,_0x4e01e1){if(_0x44ec46[_0x2206('0xc')](_0x2206('0xd'))){_0x44ec46[_0x2206('0xe')]=moment()[_0x2206('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4e01e1(null,_0x44ec46);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index f9a3c5a..4f38fc1 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 _0x7306=['defaults','redis','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2a0ff4,_0x6fc542){var _0x45b1f8=function(_0x2cb0e3){while(--_0x2cb0e3){_0x2a0ff4['push'](_0x2a0ff4['shift']());}};_0x45b1f8(++_0x6fc542);}(_0x7306,0x76));var _0x6730=function(_0x3a9bbd,_0x13cdd3){_0x3a9bbd=_0x3a9bbd-0x0;var _0x170af6=_0x7306[_0x3a9bbd];return _0x170af6;};'use strict';var _=require(_0x6730('0x0'));var util=require(_0x6730('0x1'));var moment=require(_0x6730('0x2'));var BPromise=require(_0x6730('0x3'));var rs=require(_0x6730('0x4'));var fs=require('fs');var Redis=require(_0x6730('0x5'));var db=require(_0x6730('0x6'))['db'];var utils=require(_0x6730('0x7'));var logger=require(_0x6730('0x8'))(_0x6730('0x9'));var config=require(_0x6730('0xa'));var jayson=require(_0x6730('0xb'));var client=jayson[_0x6730('0xc')][_0x6730('0xd')]({'port':0x232a});config['redis']=_[_0x6730('0xe')](config[_0x6730('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6730('0xf')]));require(_0x6730('0x10'))[_0x6730('0x11')](socket);function respondWithRpcPromise(_0x250f65,_0x206706,_0x2fb93c){return new BPromise(function(_0x5e57ab,_0x37e78d){return client[_0x6730('0x12')](_0x250f65,_0x2fb93c)[_0x6730('0x13')](function(_0xd84947){logger['info'](_0x6730('0x14'),_0x206706,_0x6730('0x15'));logger[_0x6730('0x16')](_0x6730('0x17'),_0x206706,'request\x20sent',JSON['stringify'](_0xd84947));if(_0xd84947['error']){if(_0xd84947[_0x6730('0x18')]['code']===0x1f4){logger[_0x6730('0x18')](_0x6730('0x14'),_0x206706,_0xd84947[_0x6730('0x18')][_0x6730('0x19')]);return _0x37e78d(_0xd84947[_0x6730('0x18')]['message']);}logger[_0x6730('0x18')](_0x6730('0x14'),_0x206706,_0xd84947[_0x6730('0x18')][_0x6730('0x19')]);return _0x5e57ab(_0xd84947['error'][_0x6730('0x19')]);}else{logger[_0x6730('0x1a')]('WhatsappInteraction,\x20%s,\x20%s',_0x206706,'request\x20sent');_0x5e57ab(_0xd84947[_0x6730('0x1b')][_0x6730('0x19')]);}})[_0x6730('0x1c')](function(_0x1d1638){logger[_0x6730('0x18')](_0x6730('0x14'),_0x206706,_0x1d1638);_0x37e78d(_0x1d1638);});});}exports[_0x6730('0x1d')]=function(_0x1fafd8){var _0x5318f3=this;return new Promise(function(_0x4b9d2e,_0x5c83b4){return db[_0x6730('0x1e')][_0x6730('0x1f')](_0x1fafd8[_0x6730('0x20')],{'raw':_0x1fafd8[_0x6730('0x21')]?_0x1fafd8[_0x6730('0x21')][_0x6730('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fafd8[_0x6730('0x21')]?_0x1fafd8[_0x6730('0x21')][_0x6730('0x23')]||null:null,'attributes':_0x1fafd8['options']?_0x1fafd8['options']['attributes']||null:null,'limit':_0x1fafd8['options']?_0x1fafd8['options'][_0x6730('0x24')]||null:null})[_0x6730('0x13')](function(_0x532bff){logger[_0x6730('0x1a')](_0x6730('0x1d'),_0x1fafd8);logger[_0x6730('0x16')](_0x6730('0x1d'),_0x1fafd8,JSON[_0x6730('0x25')](_0x532bff));_0x4b9d2e(_0x532bff);})['catch'](function(_0x4502a4){logger[_0x6730('0x18')](_0x6730('0x1d'),_0x4502a4['message'],_0x1fafd8);_0x5c83b4(_0x5318f3[_0x6730('0x18')](0x1f4,_0x4502a4[_0x6730('0x19')]));});});};exports[_0x6730('0x26')]=function(_0x12b7cb){return new Promise(function(_0x4639b9,_0x19acd6){return db['WhatsappInteraction'][_0x6730('0x27')]({'where':_0x12b7cb[_0x6730('0x21')]?_0x12b7cb[_0x6730('0x21')][_0x6730('0x23')]||null:null})[_0x6730('0x13')](function(_0x45af82){if(_0x45af82){return _0x45af82[_0x6730('0x28')](_0x12b7cb[_0x6730('0x20')][_0x6730('0x29')],_['omit'](_0x12b7cb['body'],[_0x6730('0x29'),'id'])||{});}})[_0x6730('0x2a')](function(_0x16eec6){logger[_0x6730('0x1a')](_0x6730('0x2b'),_0x12b7cb);logger[_0x6730('0x16')](_0x6730('0x2b'),_0x12b7cb,JSON['stringify'](_0x16eec6));_0x4639b9(_0x16eec6);})[_0x6730('0x1c')](function(_0x2c33a6){logger[_0x6730('0x18')]('AddTags',_0x2c33a6[_0x6730('0x19')],_0x12b7cb);_0x19acd6(_this['error'](0x1f4,_0x2c33a6[_0x6730('0x19')]));});});}; \ No newline at end of file +var _0xad5a=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','update','body','options','where','attributes','AddTagsToWhatsappInteraction'];(function(_0x575e52,_0x404616){var _0x54b9cc=function(_0x453ee8){while(--_0x453ee8){_0x575e52['push'](_0x575e52['shift']());}};_0x54b9cc(++_0x404616);}(_0xad5a,0x18a));var _0xaad5=function(_0xd60f85,_0x5c1b59){_0xd60f85=_0xd60f85-0x0;var _0x5c431f=_0xad5a[_0xd60f85];return _0x5c431f;};'use strict';var _=require(_0xaad5('0x0'));var util=require(_0xaad5('0x1'));var moment=require(_0xaad5('0x2'));var BPromise=require(_0xaad5('0x3'));var rs=require(_0xaad5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaad5('0x5'))['db'];var utils=require(_0xaad5('0x6'));var logger=require('../../config/logger')(_0xaad5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaad5('0x8')][_0xaad5('0x9')]({'port':0x232a});config[_0xaad5('0xa')]=_[_0xaad5('0xb')](config['redis'],{'host':_0xaad5('0xc'),'port':0x18eb});var socket=require(_0xaad5('0xd'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xaad5('0xe')](socket);function respondWithRpcPromise(_0x4ebd5e,_0x12b9c4,_0x4618a1){return new BPromise(function(_0x3cd3dc,_0x424609){return client[_0xaad5('0xf')](_0x4ebd5e,_0x4618a1)[_0xaad5('0x10')](function(_0x2d5cda){logger[_0xaad5('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x12b9c4,_0xaad5('0x12'));logger[_0xaad5('0x13')](_0xaad5('0x14'),_0x12b9c4,'request\x20sent',JSON[_0xaad5('0x15')](_0x2d5cda));if(_0x2d5cda[_0xaad5('0x16')]){if(_0x2d5cda[_0xaad5('0x16')][_0xaad5('0x17')]===0x1f4){logger[_0xaad5('0x16')](_0xaad5('0x18'),_0x12b9c4,_0x2d5cda[_0xaad5('0x16')][_0xaad5('0x19')]);return _0x424609(_0x2d5cda[_0xaad5('0x16')][_0xaad5('0x19')]);}logger[_0xaad5('0x16')](_0xaad5('0x18'),_0x12b9c4,_0x2d5cda[_0xaad5('0x16')][_0xaad5('0x19')]);return _0x3cd3dc(_0x2d5cda[_0xaad5('0x16')]['message']);}else{logger[_0xaad5('0x11')](_0xaad5('0x18'),_0x12b9c4,_0xaad5('0x12'));_0x3cd3dc(_0x2d5cda[_0xaad5('0x1a')][_0xaad5('0x19')]);}})[_0xaad5('0x1b')](function(_0x25f0df){logger[_0xaad5('0x16')](_0xaad5('0x18'),_0x12b9c4,_0x25f0df);_0x424609(_0x25f0df);});});}exports[_0xaad5('0x1c')]=function(_0x42dc8d){var _0x2a7121=this;return new Promise(function(_0x490808,_0x515480){return db['WhatsappInteraction'][_0xaad5('0x1d')](_0x42dc8d[_0xaad5('0x1e')],{'raw':_0x42dc8d[_0xaad5('0x1f')]?_0x42dc8d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42dc8d['options']?_0x42dc8d[_0xaad5('0x1f')][_0xaad5('0x20')]||null:null,'attributes':_0x42dc8d[_0xaad5('0x1f')]?_0x42dc8d['options'][_0xaad5('0x21')]||null:null,'limit':_0x42dc8d[_0xaad5('0x1f')]?_0x42dc8d[_0xaad5('0x1f')]['limit']||null:null})[_0xaad5('0x10')](function(_0x132457){logger[_0xaad5('0x11')](_0xaad5('0x1c'),_0x42dc8d);logger[_0xaad5('0x13')](_0xaad5('0x1c'),_0x42dc8d,JSON[_0xaad5('0x15')](_0x132457));_0x490808(_0x132457);})[_0xaad5('0x1b')](function(_0x289e44){logger[_0xaad5('0x16')](_0xaad5('0x1c'),_0x289e44[_0xaad5('0x19')],_0x42dc8d);_0x515480(_0x2a7121[_0xaad5('0x16')](0x1f4,_0x289e44[_0xaad5('0x19')]));});});};exports[_0xaad5('0x22')]=function(_0x24e377){return new Promise(function(_0xb62ecf,_0x57c06d){return db['WhatsappInteraction']['find']({'where':_0x24e377[_0xaad5('0x1f')]?_0x24e377[_0xaad5('0x1f')][_0xaad5('0x20')]||null:null})['then'](function(_0xa83986){if(_0xa83986){return _0xa83986['addTags'](_0x24e377[_0xaad5('0x1e')][_0xaad5('0x23')],_[_0xaad5('0x24')](_0x24e377[_0xaad5('0x1e')],[_0xaad5('0x23'),'id'])||{});}})[_0xaad5('0x25')](function(_0x637bb3){logger['info'](_0xaad5('0x26'),_0x24e377);logger[_0xaad5('0x13')]('AddTags',_0x24e377,JSON[_0xaad5('0x15')](_0x637bb3));_0xb62ecf(_0x637bb3);})[_0xaad5('0x1b')](function(_0x430867){logger[_0xaad5('0x16')](_0xaad5('0x26'),_0x430867[_0xaad5('0x19')],_0x24e377);_0x57c06d(_this[_0xaad5('0x16')](0x1f4,_0x430867[_0xaad5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 3c99f6c..16db5fd 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 _0xc351=['remove','emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x199a64,_0x51d98e){var _0x29994a=function(_0x4e6b67){while(--_0x4e6b67){_0x199a64['push'](_0x199a64['shift']());}};_0x29994a(++_0x51d98e);}(_0xc351,0xf3));var _0x1c35=function(_0xf845cc,_0x7bce78){_0xf845cc=_0xf845cc-0x0;var _0x24da94=_0xc351[_0xf845cc];return _0x24da94;};'use strict';var WhatsappInteractionEvents=require(_0x1c35('0x0'));var events=[_0x1c35('0x1'),_0x1c35('0x2'),'update'];function createListener(_0x4c7474,_0x3e8902){return function(_0x4aba2d){_0x3e8902[_0x1c35('0x3')](_0x4c7474,_0x4aba2d);};}function removeListener(_0x3039ad,_0x3405f4){return function(){WhatsappInteractionEvents['removeListener'](_0x3039ad,_0x3405f4);};}exports[_0x1c35('0x4')]=function(_0x68dbaa){for(var _0x23b3ba=0x0,_0x30fce7=events[_0x1c35('0x5')];_0x23b3ba<_0x30fce7;_0x23b3ba++){var _0x5658a7=events[_0x23b3ba];var _0x37b15e=createListener(_0x1c35('0x6')+_0x5658a7,_0x68dbaa);WhatsappInteractionEvents['on'](_0x5658a7,_0x37b15e);}}; \ No newline at end of file +var _0x2aa0=['update','removeListener','whatsappInteraction:','./whatsappInteraction.events','remove'];(function(_0x533285,_0x20666e){var _0x38703f=function(_0x5fdd48){while(--_0x5fdd48){_0x533285['push'](_0x533285['shift']());}};_0x38703f(++_0x20666e);}(_0x2aa0,0x184));var _0x02aa=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2aa0[_0x19950b];return _0x3c6b41;};'use strict';var WhatsappInteractionEvents=require(_0x02aa('0x0'));var events=['save',_0x02aa('0x1'),_0x02aa('0x2')];function createListener(_0x575f9a,_0x60c4b1){return function(_0x9489b2){_0x60c4b1['emit'](_0x575f9a,_0x9489b2);};}function removeListener(_0x2c168f,_0x411d3a){return function(){WhatsappInteractionEvents[_0x02aa('0x3')](_0x2c168f,_0x411d3a);};}exports['register']=function(_0xe1b931){for(var _0x2640f0=0x0,_0x404b43=events['length'];_0x2640f0<_0x404b43;_0x2640f0++){var _0x3b194e=events[_0x2640f0];var _0x7c9c5d=createListener(_0x02aa('0x4')+_0x3b194e,_0xe1b931);WhatsappInteractionEvents['on'](_0x3b194e,_0x7c9c5d);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 557b552..3fc276b 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 _0x201c=['/:id/accept','accept','put','reject','delete','destroy','exports','multer','path','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','create','/:id/status','update'];(function(_0xd99c53,_0x49e96f){var _0x4ca1b1=function(_0x12b64d){while(--_0x12b64d){_0xd99c53['push'](_0xd99c53['shift']());}};_0x4ca1b1(++_0x49e96f);}(_0x201c,0x157));var _0xc201=function(_0x3f548c,_0x193d18){_0x3f548c=_0x3f548c-0x0;var _0x4a956a=_0x201c[_0x3f548c];return _0x4a956a;};'use strict';var multer=require(_0xc201('0x0'));var util=require('util');var path=require(_0xc201('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc201('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc201('0x3'));var controller=require('./whatsappMessage.controller');router[_0xc201('0x4')]('/',auth['isAuthenticated'](),controller[_0xc201('0x5')]);router['get'](_0xc201('0x6'),auth[_0xc201('0x7')](),controller[_0xc201('0x8')]);router[_0xc201('0x4')](_0xc201('0x9'),auth[_0xc201('0x7')](),controller[_0xc201('0xa')]);router[_0xc201('0xb')]('/',auth['isAuthenticated'](),interaction[_0xc201('0xc')](_0xc201('0xd'),'whatsappmessage:create'),controller[_0xc201('0xe')]);router['post'](_0xc201('0xf'),controller['status']);router['put'](_0xc201('0x9'),auth[_0xc201('0x7')](),controller[_0xc201('0x10')]);router['put'](_0xc201('0x11'),auth[_0xc201('0x7')](),controller[_0xc201('0x12')]);router[_0xc201('0x13')]('/:id/reject',auth[_0xc201('0x7')](),controller[_0xc201('0x14')]);router[_0xc201('0x15')](_0xc201('0x9'),auth[_0xc201('0x7')](),controller[_0xc201('0x16')]);module[_0xc201('0x17')]=router; \ No newline at end of file +var _0xf201=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','isAuthenticated','describe','/:id','tracked','whatsapp','create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','util'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xf201,0xf2));var _0x1f20=function(_0x1f5b01,_0x5236af){_0x1f5b01=_0x1f5b01-0x0;var _0x196abf=_0xf201[_0x1f5b01];return _0x196abf;};'use strict';var multer=require('multer');var util=require(_0x1f20('0x0'));var path=require(_0x1f20('0x1'));var timeout=require(_0x1f20('0x2'));var express=require(_0x1f20('0x3'));var router=express[_0x1f20('0x4')]();var fs_extra=require(_0x1f20('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1f20('0x6'));var config=require(_0x1f20('0x7'));var controller=require(_0x1f20('0x8'));router[_0x1f20('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1f20('0x9')](_0x1f20('0xa'),auth[_0x1f20('0xb')](),controller[_0x1f20('0xc')]);router['get'](_0x1f20('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x1f20('0xe')](_0x1f20('0xf'),'whatsappmessage:create'),controller[_0x1f20('0x10')]);router['post'](_0x1f20('0x11'),controller[_0x1f20('0x12')]);router['put'](_0x1f20('0xd'),auth['isAuthenticated'](),controller[_0x1f20('0x13')]);router[_0x1f20('0x14')](_0x1f20('0x15'),auth['isAuthenticated'](),controller[_0x1f20('0x16')]);router['put'](_0x1f20('0x17'),auth['isAuthenticated'](),controller[_0x1f20('0x18')]);router[_0x1f20('0x19')](_0x1f20('0xd'),auth[_0x1f20('0xb')](),controller['destroy']);module[_0x1f20('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 9fb146a..510af6a 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 _0xe107=['BOOLEAN','out','STRING','DATE','sequelize','TEXT','medium'];(function(_0x1a54a8,_0x33f026){var _0x4d9985=function(_0x47bf74){while(--_0x47bf74){_0x1a54a8['push'](_0x1a54a8['shift']());}};_0x4d9985(++_0x33f026);}(_0xe107,0xb3));var _0x7e10=function(_0x1fd304,_0x1149a6){_0x1fd304=_0x1fd304-0x0;var _0x4fb783=_0xe107[_0x1fd304];return _0x4fb783;};'use strict';var Sequelize=require(_0x7e10('0x0'));module['exports']={'body':{'type':Sequelize[_0x7e10('0x1')](_0x7e10('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7e10('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7e10('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x7e10('0x5')]},'readAt':{'type':Sequelize[_0x7e10('0x6')]},'secret':{'type':Sequelize[_0x7e10('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xde02=['ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT'];(function(_0x267a30,_0x1f688a){var _0x4f525f=function(_0x3b0c97){while(--_0x3b0c97){_0x267a30['push'](_0x267a30['shift']());}};_0x4f525f(++_0x1f688a);}(_0xde02,0xd5));var _0x2de0=function(_0x200e78,_0x2f6383){_0x200e78=_0x200e78-0x0;var _0x49662e=_0xde02[_0x200e78];return _0x49662e;};'use strict';var Sequelize=require(_0x2de0('0x0'));module[_0x2de0('0x1')]={'body':{'type':Sequelize[_0x2de0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2de0('0x3')]('in',_0x2de0('0x4')),'defaultValue':_0x2de0('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x2de0('0x5')]},'readAt':{'type':Sequelize[_0x2de0('0x6')]},'secret':{'type':Sequelize[_0x2de0('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2de0('0x5')]},'providerResponse':{'type':Sequelize[_0x2de0('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 191559d..9828fae 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 _0xca79=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','then','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','WhatsappMessage','count','includeAll','findAll','rows','catch','params','length','find','create','body','describe','whatsapp-interactions','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','agent','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xca79,0x19a));var _0x9ca7=function(_0x15357e,_0x37ff07){_0x15357e=_0x15357e-0x0;var _0x585d14=_0xca79[_0x15357e];return _0x585d14;};'use strict';var emlformat=require(_0x9ca7('0x0'));var rimraf=require(_0x9ca7('0x1'));var zipdir=require(_0x9ca7('0x2'));var jsonpatch=require(_0x9ca7('0x3'));var rp=require(_0x9ca7('0x4'));var moment=require(_0x9ca7('0x5'));var BPromise=require(_0x9ca7('0x6'));var Mustache=require(_0x9ca7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x9ca7('0x8'));var csv=require(_0x9ca7('0x9'));var ejs=require(_0x9ca7('0xa'));var fs=require('fs');var fs_extra=require(_0x9ca7('0xb'));var _=require(_0x9ca7('0xc'));var squel=require(_0x9ca7('0xd'));var crypto=require('crypto');var jsforce=require(_0x9ca7('0xe'));var deskjs=require(_0x9ca7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9ca7('0x10'));var Papa=require(_0x9ca7('0x11'));var Redis=require('ioredis');var authService=require(_0x9ca7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9ca7('0x13'));var hardwareService=require(_0x9ca7('0x14'));var logger=require(_0x9ca7('0x15'))(_0x9ca7('0x16'));var utils=require(_0x9ca7('0x17'));var config=require(_0x9ca7('0x18'));var licenseUtil=require(_0x9ca7('0x19'));var db=require(_0x9ca7('0x1a'))['db'];config[_0x9ca7('0x1b')]=_[_0x9ca7('0x1c')](config[_0x9ca7('0x1b')],{'host':_0x9ca7('0x1d'),'port':0x18eb});var socket=require(_0x9ca7('0x1e'))(new Redis(config['redis']));require(_0x9ca7('0x1f'))[_0x9ca7('0x20')](socket);var jayson=require(_0x9ca7('0x21'));var client=jayson[_0x9ca7('0x22')][_0x9ca7('0x23')]({'port':0x232c});var client9002=jayson[_0x9ca7('0x22')][_0x9ca7('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1aa4c5,_0x2b34a4,_0xeb31dd,_0x5c3c97){return new BPromise(function(_0xd230de,_0x394928){var _0x4ae620=_0x5c3c97||client;return _0x4ae620[_0x9ca7('0x24')](_0x1aa4c5,_0xeb31dd)['then'](function(_0x494b33){logger[_0x9ca7('0x25')](_0x9ca7('0x26'),_0x2b34a4,_0x9ca7('0x27'));logger[_0x9ca7('0x28')](_0x9ca7('0x29'),_0x2b34a4,_0x9ca7('0x27'),JSON['stringify'](_0x494b33));if(_0x494b33['error']){if(_0x494b33[_0x9ca7('0x2a')]['code']===0x1f4){logger[_0x9ca7('0x2a')](_0x9ca7('0x26'),_0x2b34a4,_0x494b33[_0x9ca7('0x2a')][_0x9ca7('0x2b')]);return _0x394928(_0x494b33[_0x9ca7('0x2a')][_0x9ca7('0x2b')]);}logger[_0x9ca7('0x2a')](_0x9ca7('0x26'),_0x2b34a4,_0x494b33[_0x9ca7('0x2a')]['message']);return _0xd230de(_0x494b33[_0x9ca7('0x2a')][_0x9ca7('0x2b')]);}else{logger[_0x9ca7('0x25')](_0x9ca7('0x26'),_0x2b34a4,'request\x20sent');_0xd230de(_0x494b33[_0x9ca7('0x2c')]['message']);}})['catch'](function(_0x5e3b90){logger[_0x9ca7('0x2a')](_0x9ca7('0x26'),_0x2b34a4,_0x5e3b90);_0x394928(_0x5e3b90);});});}function respondWithStatusCode(_0x6f8887,_0x512738){_0x512738=_0x512738||0xcc;return function(_0xe619e6){if(_0xe619e6){return _0x6f8887[_0x9ca7('0x2d')](_0x512738);}return _0x6f8887[_0x9ca7('0x2e')](_0x512738)[_0x9ca7('0x2f')]();};}function respondWithResult(_0x1a9e4a,_0x457686){_0x457686=_0x457686||0xc8;return function(_0xe2c35a){if(_0xe2c35a){return _0x1a9e4a[_0x9ca7('0x2e')](_0x457686)[_0x9ca7('0x30')](_0xe2c35a);}};}function respondWithFilteredResult(_0x412ad5,_0xda1f7d){return function(_0x5876f4){if(_0x5876f4){var _0x1e08ec=typeof _0xda1f7d[_0x9ca7('0x31')]==='undefined'&&typeof _0xda1f7d[_0x9ca7('0x32')]==='undefined';var _0x57db5d=_0x5876f4['count'];var _0x3fd119=_0x1e08ec?0x0:_0xda1f7d['offset'];var _0x295091=_0x1e08ec?_0x5876f4['count']:_0xda1f7d[_0x9ca7('0x31')]+_0xda1f7d[_0x9ca7('0x32')];var _0x3a27e3;if(_0x295091>=_0x57db5d){_0x295091=_0x57db5d;_0x3a27e3=0xc8;}else{_0x3a27e3=0xce;}_0x412ad5['status'](_0x3a27e3);return _0x412ad5['set'](_0x9ca7('0x33'),_0x3fd119+'-'+_0x295091+'/'+_0x57db5d)[_0x9ca7('0x30')](_0x5876f4);}return null;};}function patchUpdates(_0x4904fe){return function(_0x5ec992){try{jsonpatch[_0x9ca7('0x34')](_0x5ec992,_0x4904fe,!![]);}catch(_0x247307){return BPromise['reject'](_0x247307);}return _0x5ec992[_0x9ca7('0x35')]();};}function saveUpdates(_0x87a415,_0x658ab7){return function(_0x43f579){if(_0x43f579){return _0x43f579[_0x9ca7('0x36')](_0x87a415)['then'](function(_0x31824e){return _0x31824e;});}return null;};}function removeEntity(_0x5104a0,_0x5dd86f){return function(_0x5631bc){if(_0x5631bc){return _0x5631bc[_0x9ca7('0x37')]()[_0x9ca7('0x38')](function(){_0x5104a0[_0x9ca7('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x228f42,_0x3b0ea9){return function(_0x3841a0){if(!_0x3841a0){_0x228f42[_0x9ca7('0x2d')](0x194);}return _0x3841a0;};}function handleError(_0x387bb8,_0x96101e){_0x96101e=_0x96101e||0x1f4;return function(_0x4dff50){logger['error'](_0x4dff50['stack']);if(_0x4dff50['name']){delete _0x4dff50[_0x9ca7('0x39')];}_0x387bb8[_0x9ca7('0x2e')](_0x96101e)[_0x9ca7('0x3a')](_0x4dff50);};}exports[_0x9ca7('0x3b')]=function(_0x2368e3,_0x50a318){var _0x24bd49={},_0x2011f0={},_0x5a2e7d={'count':0x0,'rows':[]};var _0x4da823=_[_0x9ca7('0x3c')](db['WhatsappMessage'][_0x9ca7('0x3d')],function(_0x46d296){return{'name':_0x46d296[_0x9ca7('0x3e')],'type':_0x46d296[_0x9ca7('0x3f')][_0x9ca7('0x40')]};});_0x2011f0['model']=_[_0x9ca7('0x3c')](_0x4da823,_0x9ca7('0x39'));_0x2011f0[_0x9ca7('0x41')]=_[_0x9ca7('0x42')](_0x2368e3[_0x9ca7('0x41')]);_0x2011f0[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x2011f0[_0x9ca7('0x45')],_0x2011f0['query']);_0x24bd49['attributes']=_['intersection'](_0x2011f0[_0x9ca7('0x45')],qs[_0x9ca7('0x46')](_0x2368e3[_0x9ca7('0x41')][_0x9ca7('0x46')]));_0x24bd49[_0x9ca7('0x47')]=_0x24bd49[_0x9ca7('0x47')]['length']?_0x24bd49[_0x9ca7('0x47')]:_0x2011f0[_0x9ca7('0x45')];if(!_0x2368e3[_0x9ca7('0x41')][_0x9ca7('0x48')](_0x9ca7('0x49'))){_0x24bd49['limit']=qs[_0x9ca7('0x32')](_0x2368e3[_0x9ca7('0x41')]['limit']);_0x24bd49[_0x9ca7('0x31')]=qs[_0x9ca7('0x31')](_0x2368e3[_0x9ca7('0x41')][_0x9ca7('0x31')]);}_0x24bd49[_0x9ca7('0x4a')]=qs['sort'](_0x2368e3['query'][_0x9ca7('0x4b')]);_0x24bd49['where']=qs[_0x9ca7('0x43')](_[_0x9ca7('0x4c')](_0x2368e3[_0x9ca7('0x41')],_0x2011f0[_0x9ca7('0x43')]),_0x4da823);if(_0x2368e3['query'][_0x9ca7('0x4d')]){_0x24bd49[_0x9ca7('0x4e')]=_['merge'](_0x24bd49[_0x9ca7('0x4e')],{'$or':_[_0x9ca7('0x3c')](_0x4da823,function(_0x110dfe){if(_0x110dfe['type']!==_0x9ca7('0x4f')){var _0x2e38ed={};_0x2e38ed[_0x110dfe[_0x9ca7('0x39')]]={'$like':'%'+_0x2368e3[_0x9ca7('0x41')]['filter']+'%'};return _0x2e38ed;}})});}_0x24bd49=_['merge']({},_0x24bd49,_0x2368e3[_0x9ca7('0x50')]);var _0x470ee4={'where':_0x24bd49['where']};return db[_0x9ca7('0x51')][_0x9ca7('0x52')](_0x470ee4)['then'](function(_0x5ae8a1){_0x5a2e7d[_0x9ca7('0x52')]=_0x5ae8a1;if(_0x2368e3[_0x9ca7('0x41')][_0x9ca7('0x53')]){_0x24bd49['include']=[{'all':!![]}];}return db[_0x9ca7('0x51')][_0x9ca7('0x54')](_0x24bd49);})[_0x9ca7('0x38')](function(_0x5b4400){_0x5a2e7d[_0x9ca7('0x55')]=_0x5b4400;return _0x5a2e7d;})['then'](respondWithFilteredResult(_0x50a318,_0x24bd49))[_0x9ca7('0x56')](handleError(_0x50a318,null));};exports['show']=function(_0x5b7b76,_0x2f3c6c){var _0x39a56f={'raw':!![],'where':{'id':_0x5b7b76[_0x9ca7('0x57')]['id']}},_0x418887={};_0x418887['model']=_['keys'](db[_0x9ca7('0x51')][_0x9ca7('0x3d')]);_0x418887[_0x9ca7('0x41')]=_[_0x9ca7('0x42')](_0x5b7b76[_0x9ca7('0x41')]);_0x418887[_0x9ca7('0x43')]=_[_0x9ca7('0x44')](_0x418887['model'],_0x418887[_0x9ca7('0x41')]);_0x39a56f['attributes']=_[_0x9ca7('0x44')](_0x418887[_0x9ca7('0x45')],qs['fields'](_0x5b7b76[_0x9ca7('0x41')][_0x9ca7('0x46')]));_0x39a56f['attributes']=_0x39a56f[_0x9ca7('0x47')][_0x9ca7('0x58')]?_0x39a56f[_0x9ca7('0x47')]:_0x418887[_0x9ca7('0x45')];if(_0x5b7b76['query'][_0x9ca7('0x53')]){_0x39a56f['include']=[{'all':!![]}];}_0x39a56f=_['merge']({},_0x39a56f,_0x5b7b76[_0x9ca7('0x50')]);return db[_0x9ca7('0x51')][_0x9ca7('0x59')](_0x39a56f)['then'](handleEntityNotFound(_0x2f3c6c,null))['then'](respondWithResult(_0x2f3c6c,null))[_0x9ca7('0x56')](handleError(_0x2f3c6c,null));};exports[_0x9ca7('0x5a')]=function(_0x2712ac,_0x1794db){return db['WhatsappMessage']['create'](_0x2712ac[_0x9ca7('0x5b')],{})[_0x9ca7('0x38')](respondWithResult(_0x1794db,0xc9))[_0x9ca7('0x56')](handleError(_0x1794db,null));};exports[_0x9ca7('0x36')]=function(_0x4bbd42,_0x2036eb){if(_0x4bbd42[_0x9ca7('0x5b')]['id']){delete _0x4bbd42[_0x9ca7('0x5b')]['id'];}return db[_0x9ca7('0x51')]['find']({'where':{'id':_0x4bbd42[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x38')](handleEntityNotFound(_0x2036eb,null))['then'](saveUpdates(_0x4bbd42[_0x9ca7('0x5b')],null))[_0x9ca7('0x38')](respondWithResult(_0x2036eb,null))[_0x9ca7('0x56')](handleError(_0x2036eb,null));};exports[_0x9ca7('0x37')]=function(_0x135163,_0x2788a6){return db[_0x9ca7('0x51')][_0x9ca7('0x59')]({'where':{'id':_0x135163[_0x9ca7('0x57')]['id']}})['then'](handleEntityNotFound(_0x2788a6,null))[_0x9ca7('0x38')](removeEntity(_0x2788a6,null))[_0x9ca7('0x56')](handleError(_0x2788a6,null));};exports[_0x9ca7('0x5c')]=function(_0x43e278,_0x3f4255){return db[_0x9ca7('0x51')][_0x9ca7('0x5c')]()[_0x9ca7('0x38')](respondWithResult(_0x3f4255,null))[_0x9ca7('0x56')](handleError(_0x3f4255,null));};var interaction_log=require(_0x9ca7('0x15'))(_0x9ca7('0x5d'));exports[_0x9ca7('0x5e')]=function(_0x154870,_0x3714e2,_0x4de52f){var _0x11e13d={'agent':{},'channel':_0x9ca7('0x5f')};if(_0x154870[_0x9ca7('0x5b')]['id']){delete _0x154870[_0x9ca7('0x5b')]['id'];}_0x154870[_0x9ca7('0x5b')]['read']=!![];_0x154870[_0x9ca7('0x5b')]['readAt']=moment()[_0x9ca7('0x60')](_0x9ca7('0x61'));_0x154870[_0x9ca7('0x5b')][_0x9ca7('0x62')]=_0x154870[_0x9ca7('0x5b')][_0x9ca7('0x62')]||_0x154870[_0x9ca7('0x63')]['id'];_0x11e13d['agent']['id']=_0x154870[_0x9ca7('0x5b')][_0x9ca7('0x62')];return db[_0x9ca7('0x51')][_0x9ca7('0x59')]({'where':{'id':_0x154870['params']['id'],'UserId':null}})[_0x9ca7('0x38')](handleEntityNotFound(_0x3714e2,null))['then'](saveUpdates(_0x154870['body'],null))[_0x9ca7('0x38')](function(_0x42698a){if(_0x42698a){_0x11e13d['message']=_0x42698a[_0x9ca7('0x64')]({'plain':!![]});return db[_0x9ca7('0x65')][_0x9ca7('0x59')]({'where':{'id':_0x42698a['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3714e2,null))['then'](function(_0x115b95){if(_0x115b95){return _0x115b95[_0x9ca7('0x36')]({'UserId':_0x154870['body'][_0x9ca7('0x62')],'read1stAt':_[_0x9ca7('0x66')](_0x115b95[_0x9ca7('0x67')])?moment()[_0x9ca7('0x60')](_0x9ca7('0x61')):undefined});}return null;})['then'](function(_0x521d32){if(_0x521d32){_0x11e13d[_0x9ca7('0x68')]=_0x521d32[_0x9ca7('0x64')]({'plain':!![]});interaction_log['info'](_0x9ca7('0x69'),_0x154870[_0x9ca7('0x63')]['id'],_0x154870[_0x9ca7('0x63')][_0x9ca7('0x39')],_0x154870[_0x9ca7('0x63')][_0x9ca7('0x6a')],_0x11e13d[_0x9ca7('0x68')]['id'],_0x154870['body']?JSON[_0x9ca7('0x6b')](_0x154870[_0x9ca7('0x5b')]):'null');return respondWithRpcPromise(_0x9ca7('0x6c'),_0x9ca7('0x6d'),_0x11e13d);}return null;})[_0x9ca7('0x38')](function(_0x469555){var _0x5518f8=_0x9ca7('0x6e')+_0x469555[_0x9ca7('0x2b')][_0x9ca7('0x6f')];return db[_0x9ca7('0x70')][_0x9ca7('0x41')](_0x5518f8,{'type':db[_0x9ca7('0x71')]['QueryTypes'][_0x9ca7('0x72')],'raw':!![]})[_0x9ca7('0x38')](function(_0x5b8b22){return _0x5b8b22;});})[_0x9ca7('0x38')](function(_0x414f31){if(_0x414f31){_0x11e13d[_0x9ca7('0x2b')][_0x9ca7('0x73')]=_0x414f31[0x0];if(!_0x154870[_0x9ca7('0x5b')][_0x9ca7('0x62')])return;return db[_0x9ca7('0x74')]['find']({'where':{'id':_0x154870[_0x9ca7('0x5b')][_0x9ca7('0x62')],'role':'agent'},'attributes':['id',_0x9ca7('0x39'),_0x9ca7('0x75'),_0x9ca7('0x76'),'internal'],'raw':!![]});}return null;})[_0x9ca7('0x38')](function(_0x3f47ec){if(!_0x3f47ec)return null;_0x11e13d['message'][_0x9ca7('0x77')]=_0x3f47ec;return _0x11e13d;})[_0x9ca7('0x38')](function(_0x24a752){if(_0x24a752){if(_0x154870[_0x9ca7('0x5b')]['manual']){_0x11e13d['message'][_0x9ca7('0x78')]=util[_0x9ca7('0x60')]('SIP/%s',_0x154870['user'][_0x9ca7('0x39')]);_0x11e13d[_0x9ca7('0x2b')]['channel']=_0x11e13d[_0x9ca7('0x79')];_0x11e13d['message'][_0x9ca7('0x7a')]=_0x11e13d['channel'];_0x11e13d['message'][_0x9ca7('0x7b')]='accept';return respondWithRpcPromise(_0x9ca7('0x7c'),_0x9ca7('0x7c'),{'event':_0x9ca7('0x7d'),'message':_0x11e13d[_0x9ca7('0x2b')]},client9002)[_0x9ca7('0x38')](function(){return _0x11e13d;});}return _0x11e13d;}return null;})['then'](respondWithResult(_0x3714e2,null))['catch'](handleError(_0x3714e2,null));};var interaction_log=require(_0x9ca7('0x15'))(_0x9ca7('0x5d'));exports[_0x9ca7('0x7e')]=function(_0x5cc851,_0x266416,_0x16f85f){var _0x2a1f1b={'agent':{},'channel':_0x9ca7('0x5f')};if(_0x5cc851[_0x9ca7('0x5b')]['id']){delete _0x5cc851[_0x9ca7('0x5b')]['id'];}_0x5cc851[_0x9ca7('0x5b')][_0x9ca7('0x62')]=_0x5cc851[_0x9ca7('0x5b')][_0x9ca7('0x62')]||_0x5cc851[_0x9ca7('0x63')]['id'];_0x2a1f1b[_0x9ca7('0x77')]['id']=_0x5cc851[_0x9ca7('0x5b')][_0x9ca7('0x62')];return db[_0x9ca7('0x51')][_0x9ca7('0x59')]({'where':{'id':_0x5cc851[_0x9ca7('0x57')]['id'],'UserId':null}})[_0x9ca7('0x38')](handleEntityNotFound(_0x266416,null))[_0x9ca7('0x38')](function(_0xf8592a){if(_0xf8592a){_0x2a1f1b[_0x9ca7('0x2b')]=_0xf8592a['get']({'plain':!![]});return db[_0x9ca7('0x65')][_0x9ca7('0x59')]({'where':{'id':_0xf8592a[_0x9ca7('0x7f')]}});}return null;})[_0x9ca7('0x38')](handleEntityNotFound(_0x266416,null))[_0x9ca7('0x38')](function(_0x11b36a){if(_0x11b36a){_0x2a1f1b['interaction']=_0x11b36a[_0x9ca7('0x64')]({'plain':!![]});interaction_log[_0x9ca7('0x25')](_0x9ca7('0x80'),_0x5cc851[_0x9ca7('0x63')]['id'],_0x5cc851[_0x9ca7('0x63')]['name'],_0x5cc851['user'][_0x9ca7('0x6a')],_0x2a1f1b[_0x9ca7('0x68')]['id'],_0x5cc851[_0x9ca7('0x5b')]?JSON[_0x9ca7('0x6b')](_0x5cc851[_0x9ca7('0x5b')]):'null');return respondWithRpcPromise(_0x9ca7('0x81'),_0x9ca7('0x82'),_0x2a1f1b);}return null;})['then'](function(_0x46ad68){var _0x3c4d07='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46ad68['message']['ContactId'];return db[_0x9ca7('0x70')][_0x9ca7('0x41')](_0x3c4d07,{'type':db[_0x9ca7('0x71')]['QueryTypes'][_0x9ca7('0x72')],'raw':!![]})[_0x9ca7('0x38')](function(_0x2e26f1){return _0x2e26f1;});})['then'](function(_0x3822ef){if(_0x3822ef){_0x2a1f1b[_0x9ca7('0x2b')][_0x9ca7('0x73')]=_0x3822ef[0x0];if(!_0x5cc851['body'][_0x9ca7('0x62')])return;return db['User'][_0x9ca7('0x59')]({'where':{'id':_0x5cc851[_0x9ca7('0x5b')][_0x9ca7('0x62')],'role':_0x9ca7('0x77')},'attributes':['id','name',_0x9ca7('0x75'),_0x9ca7('0x76'),_0x9ca7('0x83')],'raw':!![]});}return null;})[_0x9ca7('0x38')](function(_0xd1659d){if(!_0xd1659d)return null;_0x2a1f1b['message'][_0x9ca7('0x77')]=_0xd1659d;return _0x2a1f1b;})[_0x9ca7('0x38')](function(_0x31a80e){if(_0x31a80e){_0x31a80e[_0x9ca7('0x2b')][_0x9ca7('0x78')]=util[_0x9ca7('0x60')](_0x9ca7('0x84'),_0x5cc851['user']['name']);_0x31a80e[_0x9ca7('0x2b')][_0x9ca7('0x79')]=_0x2a1f1b[_0x9ca7('0x79')];_0x31a80e[_0x9ca7('0x2b')][_0x9ca7('0x7a')]=_0x2a1f1b[_0x9ca7('0x79')];_0x31a80e[_0x9ca7('0x2b')][_0x9ca7('0x7b')]='reject';respondWithRpcPromise(_0x9ca7('0x7c'),_0x9ca7('0x7c'),{'event':_0x9ca7('0x85'),'message':_0x31a80e[_0x9ca7('0x2b')]},client9002);return _0x2a1f1b;}return null;})[_0x9ca7('0x38')](respondWithResult(_0x266416,null))[_0x9ca7('0x56')](handleError(_0x266416,null));};exports[_0x9ca7('0x2e')]=function(_0x1aad90,_0x5e3063,_0x15703e){if(_0x1aad90[_0x9ca7('0x5b')]['id']){delete _0x1aad90[_0x9ca7('0x5b')]['id'];}var _0x448fa0;return db[_0x9ca7('0x51')][_0x9ca7('0x59')]({'where':{'id':_0x1aad90[_0x9ca7('0x57')]['id']}})[_0x9ca7('0x38')](handleEntityNotFound(_0x5e3063,null))[_0x9ca7('0x38')](function(_0xfd8d43){if(_0xfd8d43){_0x448fa0=_0xfd8d43;return db[_0x9ca7('0x86')][_0x9ca7('0x59')]({'where':{'id':_0xfd8d43[_0x9ca7('0x87')]}});}})[_0x9ca7('0x38')](handleEntityNotFound(_0x5e3063,null))[_0x9ca7('0x38')](function(_0x3b5a3f){if(_0x3b5a3f){logger[_0x9ca7('0x28')](_0x9ca7('0x88'),_0x9ca7('0x2e'),_0x9ca7('0x89'),_0x3b5a3f[_0x9ca7('0x3f')],util[_0x9ca7('0x8a')](_0x1aad90[_0x9ca7('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3b5a3f['type']){case _0x9ca7('0x8b'):if(_0x1aad90['body'][_0x9ca7('0x8c')]&&_0x1aad90[_0x9ca7('0x5b')][_0x9ca7('0x8c')]===_0x448fa0[_0x9ca7('0x8d')]&&_0x1aad90[_0x9ca7('0x5b')][_0x9ca7('0x8e')]&&_0x1aad90[_0x9ca7('0x5b')]['MessageStatus']===_0x9ca7('0x8f')){return _0x448fa0[_0x9ca7('0x36')]({'read':!![]});}else{logger[_0x9ca7('0x2a')](_0x9ca7('0x90'),_0x9ca7('0x2e'),_0x9ca7('0x8b'),util[_0x9ca7('0x8a')](_0x1aad90[_0x9ca7('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x448fa0;}})[_0x9ca7('0x38')](respondWithResult(_0x5e3063,null))[_0x9ca7('0x56')](handleError(_0x5e3063,null));}; \ No newline at end of file +var _0x3c07=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','count','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','update','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','WhatsappInteractionId','interaction','RejectMessage','rejectMessage','Sequelize','interface','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','offset','undefined','limit','set','reject','save','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query'];(function(_0x48c65b,_0x2d6d40){var _0x31538=function(_0x2cd7cd){while(--_0x2cd7cd){_0x48c65b['push'](_0x48c65b['shift']());}};_0x31538(++_0x2d6d40);}(_0x3c07,0xd4));var _0x73c0=function(_0x349a6a,_0x291b2a){_0x349a6a=_0x349a6a-0x0;var _0x3f6577=_0x3c07[_0x349a6a];return _0x3f6577;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x73c0('0x0'));var zipdir=require(_0x73c0('0x1'));var jsonpatch=require(_0x73c0('0x2'));var rp=require(_0x73c0('0x3'));var moment=require(_0x73c0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x73c0('0x5'));var util=require(_0x73c0('0x6'));var path=require(_0x73c0('0x7'));var sox=require(_0x73c0('0x8'));var csv=require(_0x73c0('0x9'));var ejs=require(_0x73c0('0xa'));var fs=require('fs');var fs_extra=require(_0x73c0('0xb'));var _=require(_0x73c0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x73c0('0xd'));var deskjs=require(_0x73c0('0xe'));var toCsv=require(_0x73c0('0x9'));var querystring=require('querystring');var Papa=require(_0x73c0('0xf'));var Redis=require(_0x73c0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x73c0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73c0('0x12'));var logger=require(_0x73c0('0x13'))(_0x73c0('0x14'));var utils=require(_0x73c0('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x73c0('0x16'))['db'];config[_0x73c0('0x17')]=_[_0x73c0('0x18')](config[_0x73c0('0x17')],{'host':_0x73c0('0x19'),'port':0x18eb});var socket=require(_0x73c0('0x1a'))(new Redis(config[_0x73c0('0x17')]));require(_0x73c0('0x1b'))[_0x73c0('0x1c')](socket);var jayson=require(_0x73c0('0x1d'));var client=jayson[_0x73c0('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x73c0('0x1e')][_0x73c0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x28da1c,_0x382bde,_0x2d97ef,_0x1efc9a){return new BPromise(function(_0x4bab5e,_0x1f794f){var _0x217071=_0x1efc9a||client;return _0x217071[_0x73c0('0x20')](_0x28da1c,_0x2d97ef)[_0x73c0('0x21')](function(_0x4b0255){logger['info'](_0x73c0('0x22'),_0x382bde,_0x73c0('0x23'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x382bde,_0x73c0('0x23'),JSON[_0x73c0('0x24')](_0x4b0255));if(_0x4b0255['error']){if(_0x4b0255[_0x73c0('0x25')][_0x73c0('0x26')]===0x1f4){logger['error'](_0x73c0('0x22'),_0x382bde,_0x4b0255[_0x73c0('0x25')][_0x73c0('0x27')]);return _0x1f794f(_0x4b0255[_0x73c0('0x25')][_0x73c0('0x27')]);}logger[_0x73c0('0x25')](_0x73c0('0x22'),_0x382bde,_0x4b0255[_0x73c0('0x25')][_0x73c0('0x27')]);return _0x4bab5e(_0x4b0255[_0x73c0('0x25')][_0x73c0('0x27')]);}else{logger[_0x73c0('0x28')](_0x73c0('0x22'),_0x382bde,_0x73c0('0x23'));_0x4bab5e(_0x4b0255[_0x73c0('0x29')][_0x73c0('0x27')]);}})[_0x73c0('0x2a')](function(_0x57916c){logger[_0x73c0('0x25')](_0x73c0('0x22'),_0x382bde,_0x57916c);_0x1f794f(_0x57916c);});});}function respondWithStatusCode(_0x36c940,_0x3c30f0){_0x3c30f0=_0x3c30f0||0xcc;return function(_0x2c7104){if(_0x2c7104){return _0x36c940['sendStatus'](_0x3c30f0);}return _0x36c940[_0x73c0('0x2b')](_0x3c30f0)[_0x73c0('0x2c')]();};}function respondWithResult(_0x591d48,_0x247c6e){_0x247c6e=_0x247c6e||0xc8;return function(_0xfba07){if(_0xfba07){return _0x591d48[_0x73c0('0x2b')](_0x247c6e)['json'](_0xfba07);}};}function respondWithFilteredResult(_0x4381f0,_0x42bdd3){return function(_0x2c0ddc){if(_0x2c0ddc){var _0x4fd651=typeof _0x42bdd3[_0x73c0('0x2d')]===_0x73c0('0x2e')&&typeof _0x42bdd3[_0x73c0('0x2f')]===_0x73c0('0x2e');var _0x5321fd=_0x2c0ddc['count'];var _0x2c055d=_0x4fd651?0x0:_0x42bdd3[_0x73c0('0x2d')];var _0x2bbfbe=_0x4fd651?_0x2c0ddc['count']:_0x42bdd3[_0x73c0('0x2d')]+_0x42bdd3[_0x73c0('0x2f')];var _0x1b8e4a;if(_0x2bbfbe>=_0x5321fd){_0x2bbfbe=_0x5321fd;_0x1b8e4a=0xc8;}else{_0x1b8e4a=0xce;}_0x4381f0[_0x73c0('0x2b')](_0x1b8e4a);return _0x4381f0[_0x73c0('0x30')]('Content-Range',_0x2c055d+'-'+_0x2bbfbe+'/'+_0x5321fd)['json'](_0x2c0ddc);}return null;};}function patchUpdates(_0x1d70ab){return function(_0x571658){try{jsonpatch['apply'](_0x571658,_0x1d70ab,!![]);}catch(_0x577668){return BPromise[_0x73c0('0x31')](_0x577668);}return _0x571658[_0x73c0('0x32')]();};}function saveUpdates(_0x20f7b0,_0x31a3bd){return function(_0x34efab){if(_0x34efab){return _0x34efab['update'](_0x20f7b0)[_0x73c0('0x21')](function(_0x197e52){return _0x197e52;});}return null;};}function removeEntity(_0x15697b,_0x4da370){return function(_0x386870){if(_0x386870){return _0x386870[_0x73c0('0x33')]()[_0x73c0('0x21')](function(){_0x15697b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fcd4a,_0x1305c7){return function(_0x1ead3a){if(!_0x1ead3a){_0x2fcd4a[_0x73c0('0x34')](0x194);}return _0x1ead3a;};}function handleError(_0x2d65a7,_0xe8bba3){_0xe8bba3=_0xe8bba3||0x1f4;return function(_0xd28e41){logger[_0x73c0('0x25')](_0xd28e41[_0x73c0('0x35')]);if(_0xd28e41[_0x73c0('0x36')]){delete _0xd28e41['name'];}_0x2d65a7['status'](_0xe8bba3)[_0x73c0('0x37')](_0xd28e41);};}exports[_0x73c0('0x38')]=function(_0xdc57af,_0x2dc82e){var _0x334f40={},_0x51ecd0={},_0x5e0466={'count':0x0,'rows':[]};var _0xe474d1=_[_0x73c0('0x39')](db[_0x73c0('0x3a')][_0x73c0('0x3b')],function(_0x58ea02){return{'name':_0x58ea02[_0x73c0('0x3c')],'type':_0x58ea02[_0x73c0('0x3d')]['key']};});_0x51ecd0[_0x73c0('0x3e')]=_[_0x73c0('0x39')](_0xe474d1,_0x73c0('0x36'));_0x51ecd0[_0x73c0('0x3f')]=_['keys'](_0xdc57af[_0x73c0('0x3f')]);_0x51ecd0[_0x73c0('0x40')]=_[_0x73c0('0x41')](_0x51ecd0[_0x73c0('0x3e')],_0x51ecd0[_0x73c0('0x3f')]);_0x334f40[_0x73c0('0x42')]=_[_0x73c0('0x41')](_0x51ecd0[_0x73c0('0x3e')],qs[_0x73c0('0x43')](_0xdc57af[_0x73c0('0x3f')][_0x73c0('0x43')]));_0x334f40[_0x73c0('0x42')]=_0x334f40[_0x73c0('0x42')][_0x73c0('0x44')]?_0x334f40[_0x73c0('0x42')]:_0x51ecd0[_0x73c0('0x3e')];if(!_0xdc57af['query']['hasOwnProperty'](_0x73c0('0x45'))){_0x334f40['limit']=qs[_0x73c0('0x2f')](_0xdc57af['query'][_0x73c0('0x2f')]);_0x334f40[_0x73c0('0x2d')]=qs[_0x73c0('0x2d')](_0xdc57af[_0x73c0('0x3f')][_0x73c0('0x2d')]);}_0x334f40[_0x73c0('0x46')]=qs[_0x73c0('0x47')](_0xdc57af['query'][_0x73c0('0x47')]);_0x334f40[_0x73c0('0x48')]=qs[_0x73c0('0x40')](_[_0x73c0('0x49')](_0xdc57af['query'],_0x51ecd0[_0x73c0('0x40')]),_0xe474d1);if(_0xdc57af[_0x73c0('0x3f')]['filter']){_0x334f40['where']=_[_0x73c0('0x4a')](_0x334f40[_0x73c0('0x48')],{'$or':_['map'](_0xe474d1,function(_0x226c36){if(_0x226c36[_0x73c0('0x3d')]!=='VIRTUAL'){var _0x2a93bb={};_0x2a93bb[_0x226c36[_0x73c0('0x36')]]={'$like':'%'+_0xdc57af[_0x73c0('0x3f')][_0x73c0('0x4b')]+'%'};return _0x2a93bb;}})});}_0x334f40=_[_0x73c0('0x4a')]({},_0x334f40,_0xdc57af['options']);var _0x4fac74={'where':_0x334f40[_0x73c0('0x48')]};return db[_0x73c0('0x3a')]['count'](_0x4fac74)[_0x73c0('0x21')](function(_0xac1904){_0x5e0466[_0x73c0('0x4c')]=_0xac1904;if(_0xdc57af[_0x73c0('0x3f')][_0x73c0('0x4d')]){_0x334f40[_0x73c0('0x4e')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x73c0('0x4f')](_0x334f40);})['then'](function(_0x496879){_0x5e0466[_0x73c0('0x50')]=_0x496879;return _0x5e0466;})[_0x73c0('0x21')](respondWithFilteredResult(_0x2dc82e,_0x334f40))[_0x73c0('0x2a')](handleError(_0x2dc82e,null));};exports[_0x73c0('0x51')]=function(_0x1a2c08,_0x52fc91){var _0xdaeece={'raw':!![],'where':{'id':_0x1a2c08[_0x73c0('0x52')]['id']}},_0x38e11d={};_0x38e11d[_0x73c0('0x3e')]=_[_0x73c0('0x53')](db[_0x73c0('0x3a')][_0x73c0('0x3b')]);_0x38e11d[_0x73c0('0x3f')]=_[_0x73c0('0x53')](_0x1a2c08[_0x73c0('0x3f')]);_0x38e11d[_0x73c0('0x40')]=_[_0x73c0('0x41')](_0x38e11d[_0x73c0('0x3e')],_0x38e11d[_0x73c0('0x3f')]);_0xdaeece['attributes']=_[_0x73c0('0x41')](_0x38e11d[_0x73c0('0x3e')],qs[_0x73c0('0x43')](_0x1a2c08[_0x73c0('0x3f')]['fields']));_0xdaeece['attributes']=_0xdaeece[_0x73c0('0x42')]['length']?_0xdaeece[_0x73c0('0x42')]:_0x38e11d[_0x73c0('0x3e')];if(_0x1a2c08[_0x73c0('0x3f')]['includeAll']){_0xdaeece['include']=[{'all':!![]}];}_0xdaeece=_[_0x73c0('0x4a')]({},_0xdaeece,_0x1a2c08[_0x73c0('0x54')]);return db[_0x73c0('0x3a')][_0x73c0('0x55')](_0xdaeece)['then'](handleEntityNotFound(_0x52fc91,null))['then'](respondWithResult(_0x52fc91,null))[_0x73c0('0x2a')](handleError(_0x52fc91,null));};exports[_0x73c0('0x56')]=function(_0x1402b0,_0x17c037){return db[_0x73c0('0x3a')][_0x73c0('0x56')](_0x1402b0[_0x73c0('0x57')],{})[_0x73c0('0x21')](respondWithResult(_0x17c037,0xc9))['catch'](handleError(_0x17c037,null));};exports[_0x73c0('0x58')]=function(_0x165547,_0x1df9a7){if(_0x165547['body']['id']){delete _0x165547[_0x73c0('0x57')]['id'];}return db[_0x73c0('0x3a')][_0x73c0('0x55')]({'where':{'id':_0x165547[_0x73c0('0x52')]['id']}})[_0x73c0('0x21')](handleEntityNotFound(_0x1df9a7,null))[_0x73c0('0x21')](saveUpdates(_0x165547[_0x73c0('0x57')],null))[_0x73c0('0x21')](respondWithResult(_0x1df9a7,null))['catch'](handleError(_0x1df9a7,null));};exports['destroy']=function(_0x3331b6,_0x448b3f){return db[_0x73c0('0x3a')][_0x73c0('0x55')]({'where':{'id':_0x3331b6[_0x73c0('0x52')]['id']}})[_0x73c0('0x21')](handleEntityNotFound(_0x448b3f,null))['then'](removeEntity(_0x448b3f,null))[_0x73c0('0x2a')](handleError(_0x448b3f,null));};exports[_0x73c0('0x59')]=function(_0x5a7171,_0x3a1307){return db[_0x73c0('0x3a')][_0x73c0('0x59')]()['then'](respondWithResult(_0x3a1307,null))[_0x73c0('0x2a')](handleError(_0x3a1307,null));};var interaction_log=require(_0x73c0('0x13'))(_0x73c0('0x5a'));exports['accept']=function(_0x5e1cdf,_0x14bb0e,_0x401caa){var _0x5c1b9e={'agent':{},'channel':_0x73c0('0x5b')};if(_0x5e1cdf[_0x73c0('0x57')]['id']){delete _0x5e1cdf[_0x73c0('0x57')]['id'];}_0x5e1cdf[_0x73c0('0x57')][_0x73c0('0x5c')]=!![];_0x5e1cdf[_0x73c0('0x57')][_0x73c0('0x5d')]=moment()[_0x73c0('0x5e')](_0x73c0('0x5f'));_0x5e1cdf[_0x73c0('0x57')][_0x73c0('0x60')]=_0x5e1cdf['body'][_0x73c0('0x60')]||_0x5e1cdf[_0x73c0('0x61')]['id'];_0x5c1b9e['agent']['id']=_0x5e1cdf[_0x73c0('0x57')][_0x73c0('0x60')];return db[_0x73c0('0x3a')]['find']({'where':{'id':_0x5e1cdf[_0x73c0('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14bb0e,null))[_0x73c0('0x21')](saveUpdates(_0x5e1cdf[_0x73c0('0x57')],null))[_0x73c0('0x21')](function(_0x17b63c){if(_0x17b63c){_0x5c1b9e[_0x73c0('0x27')]=_0x17b63c[_0x73c0('0x62')]({'plain':!![]});return db[_0x73c0('0x63')][_0x73c0('0x55')]({'where':{'id':_0x17b63c['WhatsappInteractionId']}});}return null;})[_0x73c0('0x21')](handleEntityNotFound(_0x14bb0e,null))[_0x73c0('0x21')](function(_0x1760bc){if(_0x1760bc){return _0x1760bc[_0x73c0('0x58')]({'UserId':_0x5e1cdf[_0x73c0('0x57')][_0x73c0('0x60')],'read1stAt':_[_0x73c0('0x64')](_0x1760bc[_0x73c0('0x65')])?moment()[_0x73c0('0x5e')](_0x73c0('0x5f')):undefined});}return null;})['then'](function(_0x2afb69){if(_0x2afb69){_0x5c1b9e['interaction']=_0x2afb69['get']({'plain':!![]});interaction_log['info'](_0x73c0('0x66'),_0x5e1cdf[_0x73c0('0x61')]['id'],_0x5e1cdf[_0x73c0('0x61')][_0x73c0('0x36')],_0x5e1cdf[_0x73c0('0x61')][_0x73c0('0x67')],_0x5c1b9e['interaction']['id'],_0x5e1cdf['body']?JSON[_0x73c0('0x24')](_0x5e1cdf['body']):_0x73c0('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5c1b9e);}return null;})['then'](function(_0xef19f7){var _0x277bb5=_0x73c0('0x69')+_0xef19f7[_0x73c0('0x27')][_0x73c0('0x6a')];return db[_0x73c0('0x6b')][_0x73c0('0x3f')](_0x277bb5,{'type':db['Sequelize'][_0x73c0('0x6c')][_0x73c0('0x6d')],'raw':!![]})['then'](function(_0x389dfe){return _0x389dfe;});})[_0x73c0('0x21')](function(_0x58313c){if(_0x58313c){_0x5c1b9e[_0x73c0('0x27')][_0x73c0('0x6e')]=_0x58313c[0x0];if(!_0x5e1cdf[_0x73c0('0x57')]['UserId'])return;return db['User'][_0x73c0('0x55')]({'where':{'id':_0x5e1cdf[_0x73c0('0x57')][_0x73c0('0x60')],'role':_0x73c0('0x6f')},'attributes':['id',_0x73c0('0x36'),'fullname',_0x73c0('0x70'),_0x73c0('0x71')],'raw':!![]});}return null;})[_0x73c0('0x21')](function(_0x58bb13){if(!_0x58bb13)return null;_0x5c1b9e['message'][_0x73c0('0x6f')]=_0x58bb13;return _0x5c1b9e;})['then'](function(_0x15ad2c){if(_0x15ad2c){if(_0x5e1cdf[_0x73c0('0x57')][_0x73c0('0x72')]){_0x5c1b9e['message']['interface']=util[_0x73c0('0x5e')](_0x73c0('0x73'),_0x5e1cdf[_0x73c0('0x61')][_0x73c0('0x36')]);_0x5c1b9e[_0x73c0('0x27')][_0x73c0('0x74')]=_0x5c1b9e[_0x73c0('0x74')];_0x5c1b9e['message'][_0x73c0('0x75')]=_0x5c1b9e[_0x73c0('0x74')];_0x5c1b9e[_0x73c0('0x27')][_0x73c0('0x76')]=_0x73c0('0x77');return respondWithRpcPromise(_0x73c0('0x78'),_0x73c0('0x78'),{'event':_0x73c0('0x79'),'message':_0x5c1b9e[_0x73c0('0x27')]},client9002)[_0x73c0('0x21')](function(){return _0x5c1b9e;});}return _0x5c1b9e;}return null;})[_0x73c0('0x21')](respondWithResult(_0x14bb0e,null))[_0x73c0('0x2a')](handleError(_0x14bb0e,null));};var interaction_log=require('../../config/logger')(_0x73c0('0x5a'));exports[_0x73c0('0x31')]=function(_0x4c4319,_0x45f5a0,_0x4530b2){var _0x3f650c={'agent':{},'channel':'whatsapp'};if(_0x4c4319[_0x73c0('0x57')]['id']){delete _0x4c4319[_0x73c0('0x57')]['id'];}_0x4c4319[_0x73c0('0x57')]['UserId']=_0x4c4319['body'][_0x73c0('0x60')]||_0x4c4319['user']['id'];_0x3f650c[_0x73c0('0x6f')]['id']=_0x4c4319[_0x73c0('0x57')][_0x73c0('0x60')];return db[_0x73c0('0x3a')][_0x73c0('0x55')]({'where':{'id':_0x4c4319[_0x73c0('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45f5a0,null))['then'](function(_0x2dd05a){if(_0x2dd05a){_0x3f650c[_0x73c0('0x27')]=_0x2dd05a[_0x73c0('0x62')]({'plain':!![]});return db[_0x73c0('0x63')][_0x73c0('0x55')]({'where':{'id':_0x2dd05a[_0x73c0('0x7a')]}});}return null;})[_0x73c0('0x21')](handleEntityNotFound(_0x45f5a0,null))['then'](function(_0x54665c){if(_0x54665c){_0x3f650c[_0x73c0('0x7b')]=_0x54665c[_0x73c0('0x62')]({'plain':!![]});interaction_log[_0x73c0('0x28')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4c4319[_0x73c0('0x61')]['id'],_0x4c4319[_0x73c0('0x61')]['name'],_0x4c4319['user'][_0x73c0('0x67')],_0x3f650c['interaction']['id'],_0x4c4319['body']?JSON[_0x73c0('0x24')](_0x4c4319[_0x73c0('0x57')]):_0x73c0('0x68'));return respondWithRpcPromise(_0x73c0('0x7c'),_0x73c0('0x7d'),_0x3f650c);}return null;})[_0x73c0('0x21')](function(_0x4c5df9){var _0x350c98=_0x73c0('0x69')+_0x4c5df9['message']['ContactId'];return db[_0x73c0('0x6b')][_0x73c0('0x3f')](_0x350c98,{'type':db[_0x73c0('0x7e')][_0x73c0('0x6c')][_0x73c0('0x6d')],'raw':!![]})[_0x73c0('0x21')](function(_0x1f552b){return _0x1f552b;});})[_0x73c0('0x21')](function(_0x41f359){if(_0x41f359){_0x3f650c[_0x73c0('0x27')][_0x73c0('0x6e')]=_0x41f359[0x0];if(!_0x4c4319[_0x73c0('0x57')]['UserId'])return;return db['User'][_0x73c0('0x55')]({'where':{'id':_0x4c4319['body'][_0x73c0('0x60')],'role':_0x73c0('0x6f')},'attributes':['id',_0x73c0('0x36'),'fullname',_0x73c0('0x70'),_0x73c0('0x71')],'raw':!![]});}return null;})['then'](function(_0x199247){if(!_0x199247)return null;_0x3f650c[_0x73c0('0x27')][_0x73c0('0x6f')]=_0x199247;return _0x3f650c;})[_0x73c0('0x21')](function(_0x3e6ab2){if(_0x3e6ab2){_0x3e6ab2[_0x73c0('0x27')][_0x73c0('0x7f')]=util[_0x73c0('0x5e')](_0x73c0('0x73'),_0x4c4319[_0x73c0('0x61')][_0x73c0('0x36')]);_0x3e6ab2[_0x73c0('0x27')][_0x73c0('0x74')]=_0x3f650c[_0x73c0('0x74')];_0x3e6ab2[_0x73c0('0x27')][_0x73c0('0x75')]=_0x3f650c[_0x73c0('0x74')];_0x3e6ab2[_0x73c0('0x27')]['event']='reject';respondWithRpcPromise(_0x73c0('0x78'),_0x73c0('0x78'),{'event':_0x73c0('0x80'),'message':_0x3e6ab2[_0x73c0('0x27')]},client9002);return _0x3f650c;}return null;})[_0x73c0('0x21')](respondWithResult(_0x45f5a0,null))['catch'](handleError(_0x45f5a0,null));};exports[_0x73c0('0x2b')]=function(_0xfe7f62,_0x5cfea4,_0x5565d9){if(_0xfe7f62[_0x73c0('0x57')]['id']){delete _0xfe7f62[_0x73c0('0x57')]['id'];}var _0x491795;return db[_0x73c0('0x3a')][_0x73c0('0x55')]({'where':{'id':_0xfe7f62[_0x73c0('0x52')]['id']}})[_0x73c0('0x21')](handleEntityNotFound(_0x5cfea4,null))[_0x73c0('0x21')](function(_0x249000){if(_0x249000){_0x491795=_0x249000;return db['WhatsappAccount'][_0x73c0('0x55')]({'where':{'id':_0x249000[_0x73c0('0x81')]}});}})[_0x73c0('0x21')](handleEntityNotFound(_0x5cfea4,null))[_0x73c0('0x21')](function(_0x3731f0){if(_0x3731f0){logger[_0x73c0('0x82')](_0x73c0('0x83'),_0x73c0('0x2b'),_0x73c0('0x84'),_0x3731f0[_0x73c0('0x3d')],util['inspect'](_0xfe7f62[_0x73c0('0x57')],{'showHidden':![],'depth':null}));switch(_0x3731f0[_0x73c0('0x3d')]){case _0x73c0('0x85'):if(_0xfe7f62[_0x73c0('0x57')][_0x73c0('0x86')]&&_0xfe7f62[_0x73c0('0x57')]['MessageSid']===_0x491795[_0x73c0('0x87')]&&_0xfe7f62[_0x73c0('0x57')][_0x73c0('0x88')]&&_0xfe7f62['body']['MessageStatus']===_0x73c0('0x5c')){return _0x491795[_0x73c0('0x58')]({'read':!![]});}else{logger[_0x73c0('0x25')](_0x73c0('0x89'),_0x73c0('0x2b'),_0x73c0('0x85'),util['inspect'](_0xfe7f62[_0x73c0('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x491795;}})[_0x73c0('0x21')](respondWithResult(_0x5cfea4,null))[_0x73c0('0x2a')](handleError(_0x5cfea4,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 07f7a7c..7782809 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 _0x9ffd=['events','../../mysqldb','WhatsappMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4f699e,_0x5355d9){var _0x55dab9=function(_0x2d2255){while(--_0x2d2255){_0x4f699e['push'](_0x4f699e['shift']());}};_0x55dab9(++_0x5355d9);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3af4a4,_0x57ddf0){_0x3af4a4=_0x3af4a4-0x0;var _0x508d26=_0x9ffd[_0x3af4a4];return _0x508d26;};'use strict';var EventEmitter=require(_0xd9ff('0x0'));var WhatsappMessage=require(_0xd9ff('0x1'))['db'][_0xd9ff('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9ff('0x3'),'afterUpdate':_0xd9ff('0x4'),'afterDestroy':_0xd9ff('0x5')};function emitEvent(_0x5493ae){return function(_0x53e962,_0x1c9460,_0x111697){WhatsappMessageEvents['emit'](_0x5493ae+':'+_0x53e962['id'],_0x53e962);WhatsappMessageEvents[_0xd9ff('0x6')](_0x5493ae,_0x53e962);_0x111697(null);};}for(var e in events){if(events[_0xd9ff('0x7')](e)){var event=events[e];WhatsappMessage[_0xd9ff('0x8')](e,emitEvent(event));}}module[_0xd9ff('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x51c5=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4501ee,_0x1214d7){var _0x1aeb9e=function(_0x3c72d3){while(--_0x3c72d3){_0x4501ee['push'](_0x4501ee['shift']());}};_0x1aeb9e(++_0x1214d7);}(_0x51c5,0x8f));var _0x551c=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x51c5[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require(_0x551c('0x0'));var WhatsappMessage=require(_0x551c('0x1'))['db'][_0x551c('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x551c('0x3')](0x0);var events={'afterCreate':_0x551c('0x4'),'afterUpdate':_0x551c('0x5'),'afterDestroy':_0x551c('0x6')};function emitEvent(_0x5add80){return function(_0x230657,_0x1639d0,_0x28e608){WhatsappMessageEvents[_0x551c('0x7')](_0x5add80+':'+_0x230657['id'],_0x230657);WhatsappMessageEvents[_0x551c('0x7')](_0x5add80,_0x230657);_0x28e608(null);};}for(var e in events){if(events[_0x551c('0x8')](e)){var event=events[e];WhatsappMessage[_0x551c('0x9')](e,emitEvent(event));}}module[_0x551c('0xa')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 7b0d3b5..d886646 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 _0x594d=['then','update','createdAt','toLowerCase','WhatsappAccount','WhatsappAccountId','type','phone','accountSid','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','message_id','err','finally','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','direction','out','secret','isNil','WhatsappInteraction','WhatsappInteractionId'];(function(_0x4a362a,_0x38c3ea){var _0x5b8130=function(_0x5927ac){while(--_0x5927ac){_0x4a362a['push'](_0x4a362a['shift']());}};_0x5b8130(++_0x38c3ea);}(_0x594d,0x172));var _0xd594=function(_0x1f95a1,_0x16ef1a){_0x1f95a1=_0x1f95a1-0x0;var _0x2be2be=_0x594d[_0x1f95a1];return _0x2be2be;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd594('0x0'))(_0xd594('0x1'));var moment=require(_0xd594('0x2'));var BPromise=require(_0xd594('0x3'));var rp=require(_0xd594('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xd594('0x5'));var rimraf=require(_0xd594('0x6'));var config=require(_0xd594('0x7'));var attributes=require(_0xd594('0x8'));module['exports']=function(_0x5ac3b7,_0x52f59f){return _0x5ac3b7[_0xd594('0x9')](_0xd594('0xa'),attributes,{'tableName':_0xd594('0xb'),'paranoid':![],'indexes':[{'name':_0xd594('0xc'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xd594('0xd')],'type':_0xd594('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46397c,_0x204faf,_0x512c4e){var _0x50abb3=_0x5ac3b7[_0xd594('0xf')];var _0x3522d3=_0x46397c['get']({'plain':!![]});if(_0x3522d3['direction']['toLowerCase']()==='in'||_0x3522d3[_0xd594('0x10')]['toLowerCase']()===_0xd594('0x11')&&!_0x3522d3[_0xd594('0x12')]&&!_[_0xd594('0x13')](_0x3522d3['UserId'])){_0x50abb3[_0xd594('0x14')]['findOne']({'where':{'id':_0x3522d3[_0xd594('0x15')]}})[_0xd594('0x16')](function(_0x50c79a){if(_0x50c79a){_0x50c79a[_0xd594('0x17')]({'lastMsgAt':_0x3522d3[_0xd594('0x18')],'lastMsgDirection':_0x3522d3[_0xd594('0x10')][_0xd594('0x19')]()});}})['catch'](function(_0x311d8d){console['error'](_0x311d8d);});}if(_0x3522d3[_0xd594('0x10')]===_0xd594('0x11')&&!_0x3522d3[_0xd594('0x12')]){var _0x510df7;_0x50abb3[_0xd594('0x1a')]['find']({'where':{'id':_0x3522d3[_0xd594('0x1b')]},'raw':!![]})['then'](function(_0x50ba67){_0x510df7=_0x50ba67;if(_0x510df7&&_0x510df7[_0xd594('0x1c')]){switch(_0x510df7[_0xd594('0x1c')]){case'twilio':var _0x4f8038=require('twilio');if(_0x510df7['accountSid']&&_0x510df7['authToken']&&_0x510df7[_0xd594('0x1d')]){var _0x595025=new _0x4f8038(_0x510df7[_0xd594('0x1e')],_0x510df7[_0xd594('0x1f')]);_0x595025[_0xd594('0x20')][_0xd594('0x21')]({'body':_0x3522d3[_0xd594('0xd')],'to':_0xd594('0x22')+_0x3522d3[_0xd594('0x1d')],'from':_0xd594('0x22')+_0x510df7['phone'],'statusCallback':_0x510df7[_0xd594('0x23')]+_0xd594('0x24')+_0x3522d3['id']+'/status?token='+_0x510df7[_0xd594('0x25')]})[_0xd594('0x16')](function(_0x1d090f){if(_0x1d090f[_0xd594('0x26')]){return _0x46397c[_0xd594('0x17')]({'messageId':_0x1d090f['sid']});}})['catch'](function(_0x128f8d){logger[_0xd594('0x27')](_0xd594('0x28'),_0xd594('0x29'),'twilio',util['inspect'](_0x128f8d,{'showHidden':![],'depth':null}));});}else{logger[_0xd594('0x27')](_0xd594('0x28'),_0xd594('0x29'),_0xd594('0x2a'),_0xd594('0x2b'));}break;case _0xd594('0x2c'):var _0x14fd94=_0x510df7[_0xd594('0x1e')];var _0x5774b7=_0x510df7[_0xd594('0x1f')];var _0x844e3e=_0x510df7[_0xd594('0x2d')]+_0xd594('0x2e')+_0x14fd94+_0xd594('0x2f');var _0x3d6da0={'to':[_0x3522d3[_0xd594('0x1d')]],'message':{'type':_0xd594('0x30'),'text':_0x3522d3[_0xd594('0xd')]}};var _0xb52c22={'method':_0xd594('0x31'),'uri':_0x844e3e,'headers':{'Authorization':'Bearer\x20'+_0x5774b7,'Content-Type':_0xd594('0x32')},'body':_0x3d6da0,'json':!![]};rp(_0xb52c22)[_0xd594('0x16')](function(_0x3f1ca3){if(_0x3f1ca3[_0xd594('0x33')][0x0][_0xd594('0x34')]){return _0x46397c[_0xd594('0x17')]({'messageId':_0x3f1ca3[_0xd594('0x33')][0x0][_0xd594('0x34')]});}})['catch'](function(_0x5663f5){logger[_0xd594('0x35')]('WhatsappMessage,\x20%s',_0x5663f5);});break;}}})[_0xd594('0x36')](function(){_0x512c4e();});}else{_0x512c4e();}}},'charset':_0xd594('0x37'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xee9f=['exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','WhatsappInteractionId','then','createdAt','out','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','update','catch','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','node-fetch','path','rimraf'];(function(_0x11170a,_0x11293a){var _0x39a2f9=function(_0xa14607){while(--_0xa14607){_0x11170a['push'](_0x11170a['shift']());}};_0x39a2f9(++_0x11293a);}(_0xee9f,0x77));var _0xfee9=function(_0x19b53f,_0x1fd18e){_0x19b53f=_0x19b53f-0x0;var _0x35ca17=_0xee9f[_0x19b53f];return _0x35ca17;};'use strict';var _=require(_0xfee9('0x0'));var util=require(_0xfee9('0x1'));var logger=require(_0xfee9('0x2'))(_0xfee9('0x3'));var moment=require(_0xfee9('0x4'));var BPromise=require('bluebird');var rp=require(_0xfee9('0x5'));var fetch=require(_0xfee9('0x6'));var fs=require('fs');var path=require(_0xfee9('0x7'));var rimraf=require(_0xfee9('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xfee9('0x9')]=function(_0x551053,_0x1687a3){return _0x551053[_0xfee9('0xa')](_0xfee9('0xb'),attributes,{'tableName':_0xfee9('0xc'),'paranoid':![],'indexes':[{'name':_0xfee9('0xd'),'fields':[_0xfee9('0xd')]},{'name':_0xfee9('0xe'),'fields':[_0xfee9('0xf')],'type':_0xfee9('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4bd15d,_0x335a81,_0x43444f){var _0x3259cd=_0x551053[_0xfee9('0x11')];var _0x4ed39a=_0x4bd15d[_0xfee9('0x12')]({'plain':!![]});if(_0x4ed39a[_0xfee9('0x13')]['toLowerCase']()==='in'||_0x4ed39a[_0xfee9('0x13')][_0xfee9('0x14')]()==='out'&&!_0x4ed39a[_0xfee9('0x15')]&&!_[_0xfee9('0x16')](_0x4ed39a[_0xfee9('0x17')])){_0x3259cd['WhatsappInteraction'][_0xfee9('0x18')]({'where':{'id':_0x4ed39a[_0xfee9('0x19')]}})[_0xfee9('0x1a')](function(_0x1be425){if(_0x1be425){_0x1be425['update']({'lastMsgAt':_0x4ed39a[_0xfee9('0x1b')],'lastMsgDirection':_0x4ed39a['direction'][_0xfee9('0x14')]()});}})['catch'](function(_0x30ad72){console['error'](_0x30ad72);});}if(_0x4ed39a[_0xfee9('0x13')]===_0xfee9('0x1c')&&!_0x4ed39a[_0xfee9('0x15')]){var _0x1a57af;_0x3259cd['WhatsappAccount'][_0xfee9('0x1d')]({'where':{'id':_0x4ed39a[_0xfee9('0x1e')]},'raw':!![]})[_0xfee9('0x1a')](function(_0x40f1c7){_0x1a57af=_0x40f1c7;if(_0x1a57af&&_0x1a57af[_0xfee9('0x1f')]){switch(_0x1a57af[_0xfee9('0x1f')]){case _0xfee9('0x20'):var _0x3af63b=require('twilio');if(_0x1a57af[_0xfee9('0x21')]&&_0x1a57af['authToken']&&_0x1a57af[_0xfee9('0x22')]){var _0x21d712=new _0x3af63b(_0x1a57af['accountSid'],_0x1a57af[_0xfee9('0x23')]);_0x21d712[_0xfee9('0x24')][_0xfee9('0x25')]({'body':_0x4ed39a[_0xfee9('0xf')],'to':_0xfee9('0x26')+_0x4ed39a[_0xfee9('0x22')],'from':_0xfee9('0x26')+_0x1a57af['phone'],'statusCallback':_0x1a57af[_0xfee9('0x27')]+_0xfee9('0x28')+_0x4ed39a['id']+'/status?token='+_0x1a57af[_0xfee9('0x29')]})['then'](function(_0x1db3f8){if(_0x1db3f8[_0xfee9('0x2a')]){return _0x4bd15d[_0xfee9('0x2b')]({'messageId':_0x1db3f8[_0xfee9('0x2a')]});}})[_0xfee9('0x2c')](function(_0x491153){logger[_0xfee9('0x2d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xfee9('0x2e'),_0xfee9('0x20'),util[_0xfee9('0x2f')](_0x491153,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfee9('0x30'),_0xfee9('0x2e'),_0xfee9('0x20'),_0xfee9('0x31'));}break;case _0xfee9('0x32'):var _0x3696ea=_0x1a57af['accountSid'];var _0x21ea54=_0x1a57af[_0xfee9('0x23')];var _0x58b987=_0x1a57af[_0xfee9('0x33')]+_0xfee9('0x34')+_0x3696ea+_0xfee9('0x35');var _0x81a1c={'to':[_0x4ed39a[_0xfee9('0x22')]],'message':{'type':_0xfee9('0x36'),'text':_0x4ed39a[_0xfee9('0xf')]}};var _0x373495={'method':_0xfee9('0x37'),'uri':_0x58b987,'headers':{'Authorization':_0xfee9('0x38')+_0x21ea54,'Content-Type':_0xfee9('0x39')},'body':_0x81a1c,'json':!![]};rp(_0x373495)[_0xfee9('0x1a')](function(_0x1e6027){if(_0x1e6027[_0xfee9('0x3a')][0x0]['message_id']){return _0x4bd15d[_0xfee9('0x2b')]({'messageId':_0x1e6027[_0xfee9('0x3a')][0x0]['message_id']});}})['catch'](function(_0x4216cb){logger[_0xfee9('0x3b')](_0xfee9('0x3c'),_0x4216cb);});break;}}})[_0xfee9('0x3d')](function(){_0x43444f();});}else{_0x43444f();}}},'charset':_0xfee9('0x3e'),'collate':_0xfee9('0x3f')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index c807e90..1fc7c68 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 _0xbe82=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','stringify'];(function(_0xfdcf4a,_0x591abd){var _0x36a005=function(_0x3287ec){while(--_0x3287ec){_0xfdcf4a['push'](_0xfdcf4a['shift']());}};_0x36a005(++_0x591abd);}(_0xbe82,0x1ad));var _0x2be8=function(_0x8106e2,_0x51296d){_0x8106e2=_0x8106e2-0x0;var _0x4ffa2d=_0xbe82[_0x8106e2];return _0x4ffa2d;};'use strict';var _=require(_0x2be8('0x0'));var util=require(_0x2be8('0x1'));var moment=require(_0x2be8('0x2'));var BPromise=require('bluebird');var rs=require(_0x2be8('0x3'));var fs=require('fs');var Redis=require(_0x2be8('0x4'));var db=require(_0x2be8('0x5'))['db'];var utils=require(_0x2be8('0x6'));var logger=require('../../config/logger')(_0x2be8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2be8('0x8')][_0x2be8('0x9')]({'port':0x232a});config[_0x2be8('0xa')]=_[_0x2be8('0xb')](config[_0x2be8('0xa')],{'host':_0x2be8('0xc'),'port':0x18eb});var socket=require(_0x2be8('0xd'))(new Redis(config[_0x2be8('0xa')]));require(_0x2be8('0xe'))[_0x2be8('0xf')](socket);function respondWithRpcPromise(_0x41fcb0,_0x1f4635,_0xa6bcc3){return new BPromise(function(_0x47e3f7,_0x5be530){return client['request'](_0x41fcb0,_0xa6bcc3)[_0x2be8('0x10')](function(_0x3b5522){logger[_0x2be8('0x11')](_0x2be8('0x12'),_0x1f4635,_0x2be8('0x13'));logger[_0x2be8('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1f4635,'request\x20sent',JSON['stringify'](_0x3b5522));if(_0x3b5522['error']){if(_0x3b5522[_0x2be8('0x15')][_0x2be8('0x16')]===0x1f4){logger['error'](_0x2be8('0x12'),_0x1f4635,_0x3b5522[_0x2be8('0x15')]['message']);return _0x5be530(_0x3b5522['error'][_0x2be8('0x17')]);}logger[_0x2be8('0x15')](_0x2be8('0x12'),_0x1f4635,_0x3b5522[_0x2be8('0x15')][_0x2be8('0x17')]);return _0x47e3f7(_0x3b5522[_0x2be8('0x15')]['message']);}else{logger[_0x2be8('0x11')](_0x2be8('0x12'),_0x1f4635,_0x2be8('0x13'));_0x47e3f7(_0x3b5522[_0x2be8('0x18')][_0x2be8('0x17')]);}})[_0x2be8('0x19')](function(_0xbea04f){logger[_0x2be8('0x15')](_0x2be8('0x12'),_0x1f4635,_0xbea04f);_0x5be530(_0xbea04f);});});}exports[_0x2be8('0x1a')]=function(_0x56204e){var _0x2d0a25=this;return new Promise(function(_0x16936f,_0x102772){return db[_0x2be8('0x1b')][_0x2be8('0x1c')](_0x56204e[_0x2be8('0x1d')],{'raw':_0x56204e[_0x2be8('0x1e')]?_0x56204e[_0x2be8('0x1e')][_0x2be8('0x1f')]===undefined?!![]:![]:!![]})[_0x2be8('0x10')](function(_0xdb6cae){logger[_0x2be8('0x11')](_0x2be8('0x1a'),_0x56204e);logger[_0x2be8('0x14')](_0x2be8('0x1a'),_0x56204e,JSON[_0x2be8('0x20')](_0xdb6cae));_0x16936f(_0xdb6cae);})['catch'](function(_0x520b25){logger[_0x2be8('0x15')](_0x2be8('0x1a'),_0x520b25['message'],_0x56204e);_0x102772(_0x2d0a25['error'](0x1f4,_0x520b25[_0x2be8('0x17')]));});});}; \ No newline at end of file +var _0x60d0=['error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b5f58,_0x3feac7){var _0x3f2ad0=function(_0x1e2a50){while(--_0x1e2a50){_0x5b5f58['push'](_0x5b5f58['shift']());}};_0x3f2ad0(++_0x3feac7);}(_0x60d0,0xf1));var _0x060d=function(_0x99d912,_0x88cc2){_0x99d912=_0x99d912-0x0;var _0x1cb0d2=_0x60d0[_0x99d912];return _0x1cb0d2;};'use strict';var _=require(_0x060d('0x0'));var util=require(_0x060d('0x1'));var moment=require(_0x060d('0x2'));var BPromise=require(_0x060d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x060d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x060d('0x5'))('rpc');var config=require(_0x060d('0x6'));var jayson=require(_0x060d('0x7'));var client=jayson[_0x060d('0x8')][_0x060d('0x9')]({'port':0x232a});config[_0x060d('0xa')]=_[_0x060d('0xb')](config[_0x060d('0xa')],{'host':_0x060d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x060d('0xa')]));require(_0x060d('0xd'))[_0x060d('0xe')](socket);function respondWithRpcPromise(_0x39ff20,_0x1da259,_0x527b95){return new BPromise(function(_0x39d427,_0x32cbe8){return client[_0x060d('0xf')](_0x39ff20,_0x527b95)[_0x060d('0x10')](function(_0x4de1a6){logger[_0x060d('0x11')](_0x060d('0x12'),_0x1da259,_0x060d('0x13'));logger[_0x060d('0x14')](_0x060d('0x15'),_0x1da259,_0x060d('0x13'),JSON[_0x060d('0x16')](_0x4de1a6));if(_0x4de1a6['error']){if(_0x4de1a6[_0x060d('0x17')][_0x060d('0x18')]===0x1f4){logger[_0x060d('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x1da259,_0x4de1a6[_0x060d('0x17')][_0x060d('0x19')]);return _0x32cbe8(_0x4de1a6[_0x060d('0x17')]['message']);}logger[_0x060d('0x17')](_0x060d('0x12'),_0x1da259,_0x4de1a6[_0x060d('0x17')][_0x060d('0x19')]);return _0x39d427(_0x4de1a6[_0x060d('0x17')][_0x060d('0x19')]);}else{logger[_0x060d('0x11')](_0x060d('0x12'),_0x1da259,'request\x20sent');_0x39d427(_0x4de1a6[_0x060d('0x1a')][_0x060d('0x19')]);}})[_0x060d('0x1b')](function(_0x585476){logger[_0x060d('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x1da259,_0x585476);_0x32cbe8(_0x585476);});});}exports[_0x060d('0x1c')]=function(_0x61236){var _0x423fe1=this;return new Promise(function(_0x371141,_0x12da2d){return db[_0x060d('0x1d')][_0x060d('0x1e')](_0x61236[_0x060d('0x1f')],{'raw':_0x61236['options']?_0x61236[_0x060d('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x19f599){logger['info']('CreateWhatsappMessage',_0x61236);logger[_0x060d('0x14')](_0x060d('0x1c'),_0x61236,JSON[_0x060d('0x16')](_0x19f599));_0x371141(_0x19f599);})['catch'](function(_0x45d50d){logger[_0x060d('0x17')](_0x060d('0x1c'),_0x45d50d[_0x060d('0x19')],_0x61236);_0x12da2d(_0x423fe1[_0x060d('0x17')](0x1f4,_0x45d50d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index a6e7043..4529511 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 _0x25a6=['save','remove','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x25a6,0x1cf));var _0x625a=function(_0x711159,_0x339ed6){_0x711159=_0x711159-0x0;var _0x2fb757=_0x25a6[_0x711159];return _0x2fb757;};'use strict';var WhatsappMessageEvents=require(_0x625a('0x0'));var events=[_0x625a('0x1'),_0x625a('0x2'),'update'];function createListener(_0x58fade,_0x48e5a9){return function(_0x24df83){_0x48e5a9[_0x625a('0x3')](_0x58fade,_0x24df83);};}function removeListener(_0x3aeb2c,_0xc1909d){return function(){WhatsappMessageEvents[_0x625a('0x4')](_0x3aeb2c,_0xc1909d);};}exports[_0x625a('0x5')]=function(_0x49a790){for(var _0x19b749=0x0,_0x4b1ffc=events[_0x625a('0x6')];_0x19b749<_0x4b1ffc;_0x19b749++){var _0x91be69=events[_0x19b749];var _0x5a6216=createListener(_0x625a('0x7')+_0x91be69,_0x49a790);WhatsappMessageEvents['on'](_0x91be69,_0x5a6216);}}; \ No newline at end of file +var _0xba4f=['remove','emit','removeListener','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x1dc422,_0x379f18){var _0x299f0a=function(_0x45c38b){while(--_0x45c38b){_0x1dc422['push'](_0x1dc422['shift']());}};_0x299f0a(++_0x379f18);}(_0xba4f,0x67));var _0xfba4=function(_0x99682f,_0x471920){_0x99682f=_0x99682f-0x0;var _0x58bebd=_0xba4f[_0x99682f];return _0x58bebd;};'use strict';var WhatsappMessageEvents=require(_0xfba4('0x0'));var events=[_0xfba4('0x1'),_0xfba4('0x2'),'update'];function createListener(_0x3508df,_0x393dfc){return function(_0x4f28ec){_0x393dfc[_0xfba4('0x3')](_0x3508df,_0x4f28ec);};}function removeListener(_0x563cc1,_0x3e7105){return function(){WhatsappMessageEvents[_0xfba4('0x4')](_0x563cc1,_0x3e7105);};}exports['register']=function(_0x1f63dd){for(var _0x3cf6ae=0x0,_0x26c59d=events[_0xfba4('0x5')];_0x3cf6ae<_0x26c59d;_0x3cf6ae++){var _0x489c35=events[_0x3cf6ae];var _0x407bf6=createListener(_0xfba4('0x6')+_0x489c35,_0x1f63dd);WhatsappMessageEvents['on'](_0x489c35,_0x407bf6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index bba843b..1c079a0 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 _0x07d8=['getAgents','addTeams','post','put','update','delete','destroy','removeAgents','util','connect-timeout','express','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users'];(function(_0x574fdb,_0x22e8d3){var _0x430d80=function(_0x3b4ddc){while(--_0x3b4ddc){_0x574fdb['push'](_0x574fdb['shift']());}};_0x430d80(++_0x22e8d3);}(_0x07d8,0x140));var _0x807d=function(_0x1c851f,_0x58a11b){_0x1c851f=_0x1c851f-0x0;var _0x2f7efb=_0x07d8[_0x1c851f];return _0x2f7efb;};'use strict';var multer=require('multer');var util=require(_0x807d('0x0'));var path=require('path');var timeout=require(_0x807d('0x1'));var express=require(_0x807d('0x2'));var router=express['Router']();var fs_extra=require(_0x807d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x807d('0x4'));var controller=require(_0x807d('0x5'));router[_0x807d('0x6')]('/',auth[_0x807d('0x7')](),controller[_0x807d('0x8')]);router[_0x807d('0x6')](_0x807d('0x9'),auth['isAuthenticated'](),controller[_0x807d('0xa')]);router[_0x807d('0x6')](_0x807d('0xb'),auth['isAuthenticated'](),controller[_0x807d('0xc')]);router['get'](_0x807d('0xd'),auth[_0x807d('0x7')](),controller['getMembers']);router[_0x807d('0x6')](_0x807d('0xe'),auth['isAuthenticated'](),controller['getTeams']);router[_0x807d('0x6')](_0x807d('0xf'),auth[_0x807d('0x7')](),controller[_0x807d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth[_0x807d('0x7')](),controller[_0x807d('0x11')]);router[_0x807d('0x12')](_0x807d('0xf'),auth[_0x807d('0x7')](),controller['addAgents']);router[_0x807d('0x13')](_0x807d('0xb'),auth[_0x807d('0x7')](),controller[_0x807d('0x14')]);router[_0x807d('0x15')](_0x807d('0xb'),auth[_0x807d('0x7')](),controller[_0x807d('0x16')]);router['delete'](_0x807d('0xe'),auth[_0x807d('0x7')](),controller['removeTeams']);router[_0x807d('0x15')](_0x807d('0xf'),auth[_0x807d('0x7')](),controller[_0x807d('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6302=['show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/:id'];(function(_0x2c66ef,_0x10b68d){var _0x2af3e4=function(_0x42cd8f){while(--_0x42cd8f){_0x2c66ef['push'](_0x2c66ef['shift']());}};_0x2af3e4(++_0x10b68d);}(_0x6302,0x7b));var _0x2630=function(_0x11a936,_0x5855d4){_0x11a936=_0x11a936-0x0;var _0x27c082=_0x6302[_0x11a936];return _0x27c082;};'use strict';var multer=require(_0x2630('0x0'));var util=require(_0x2630('0x1'));var path=require('path');var timeout=require(_0x2630('0x2'));var express=require(_0x2630('0x3'));var router=express[_0x2630('0x4')]();var fs_extra=require(_0x2630('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2630('0x6'));var config=require(_0x2630('0x7'));var controller=require(_0x2630('0x8'));router['get']('/',auth[_0x2630('0x9')](),controller['index']);router['get']('/describe',auth[_0x2630('0x9')](),controller['describe']);router[_0x2630('0xa')](_0x2630('0xb'),auth['isAuthenticated'](),controller[_0x2630('0xc')]);router['get'](_0x2630('0xd'),auth['isAuthenticated'](),controller[_0x2630('0xe')]);router[_0x2630('0xa')]('/:id/teams',auth['isAuthenticated'](),controller[_0x2630('0xf')]);router[_0x2630('0xa')](_0x2630('0x10'),auth[_0x2630('0x9')](),controller[_0x2630('0x11')]);router[_0x2630('0x12')]('/',auth[_0x2630('0x9')](),controller['create']);router[_0x2630('0x12')](_0x2630('0x13'),auth['isAuthenticated'](),controller[_0x2630('0x14')]);router[_0x2630('0x12')](_0x2630('0x10'),auth[_0x2630('0x9')](),controller['addAgents']);router[_0x2630('0x15')]('/:id',auth[_0x2630('0x9')](),controller['update']);router['delete'](_0x2630('0xb'),auth[_0x2630('0x9')](),controller[_0x2630('0x16')]);router[_0x2630('0x17')](_0x2630('0x13'),auth[_0x2630('0x9')](),controller[_0x2630('0x18')]);router[_0x2630('0x17')](_0x2630('0x10'),auth[_0x2630('0x9')](),controller[_0x2630('0x19')]);module[_0x2630('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index e88e828..cf2c623 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 _0x422f=['exports','name','INTEGER','rrmemory','beepall','roundrobin','STRING'];(function(_0x3a8503,_0x3e458f){var _0xc2e84d=function(_0x3b8c40){while(--_0x3b8c40){_0x3a8503['push'](_0x3a8503['shift']());}};_0xc2e84d(++_0x3e458f);}(_0x422f,0x1c7));var _0xf422=function(_0x46d07d,_0x280501){_0x46d07d=_0x46d07d-0x0;var _0x34aa7b=_0x422f[_0x46d07d];return _0x34aa7b;};'use strict';var Sequelize=require('sequelize');module[_0xf422('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf422('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf422('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf422('0x3'),_0xf422('0x4'),_0xf422('0x5'))},'description':{'type':Sequelize[_0xf422('0x6')]}}; \ No newline at end of file +var _0xc820=['beepall','exports','STRING','name','INTEGER','ENUM'];(function(_0x3e3f7d,_0x56490d){var _0x26991a=function(_0x33bea5){while(--_0x33bea5){_0x3e3f7d['push'](_0x3e3f7d['shift']());}};_0x26991a(++_0x56490d);}(_0xc820,0x13f));var _0x0c82=function(_0x44d031,_0x28ab67){_0x44d031=_0x44d031-0x0;var _0x3dda9c=_0xc820[_0x44d031];return _0x3dda9c;};'use strict';var Sequelize=require('sequelize');module[_0x0c82('0x0')]={'name':{'type':Sequelize[_0x0c82('0x1')],'unique':_0x0c82('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0c82('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0c82('0x4')]('rrmemory',_0x0c82('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x0c82('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4c5c72e..c6960c9 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 _0x16af=['whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','from','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','removeAgents','isArray','getAgents','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','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','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','fieldName','model','query','keys','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','WhatsappQueue','include','catch','show','rawAttributes','intersection','length','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserWhatsappQueue','nolimit','WhatsappQueueId','findAll','User','findAndCountAll','UserId'];(function(_0x21e76e,_0x33e64c){var _0x29a2be=function(_0x3c39dc){while(--_0x3c39dc){_0x21e76e['push'](_0x21e76e['shift']());}};_0x29a2be(++_0x33e64c);}(_0x16af,0xc1));var _0xf16a=function(_0x54c53a,_0x60d903){_0x54c53a=_0x54c53a-0x0;var _0x527284=_0x16af[_0x54c53a];return _0x527284;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf16a('0x0'));var zipdir=require(_0xf16a('0x1'));var jsonpatch=require(_0xf16a('0x2'));var rp=require(_0xf16a('0x3'));var moment=require(_0xf16a('0x4'));var BPromise=require(_0xf16a('0x5'));var Mustache=require('mustache');var util=require(_0xf16a('0x6'));var path=require(_0xf16a('0x7'));var sox=require(_0xf16a('0x8'));var csv=require(_0xf16a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf16a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf16a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf16a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf16a('0xd'));var Papa=require(_0xf16a('0xe'));var Redis=require(_0xf16a('0xf'));var authService=require(_0xf16a('0x10'));var qs=require(_0xf16a('0x11'));var as=require(_0xf16a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf16a('0x13'));var utils=require(_0xf16a('0x14'));var config=require(_0xf16a('0x15'));var licenseUtil=require(_0xf16a('0x16'));var db=require(_0xf16a('0x17'))['db'];config[_0xf16a('0x18')]=_[_0xf16a('0x19')](config['redis'],{'host':_0xf16a('0x1a'),'port':0x18eb});var socket=require(_0xf16a('0x1b'))(new Redis(config[_0xf16a('0x18')]));require(_0xf16a('0x1c'))[_0xf16a('0x1d')](socket);function respondWithStatusCode(_0x4633a7,_0x23ff0b){_0x23ff0b=_0x23ff0b||0xcc;return function(_0x303217){if(_0x303217){return _0x4633a7[_0xf16a('0x1e')](_0x23ff0b);}return _0x4633a7['status'](_0x23ff0b)[_0xf16a('0x1f')]();};}function respondWithResult(_0x1fee64,_0x49f0c2){_0x49f0c2=_0x49f0c2||0xc8;return function(_0x5119d0){if(_0x5119d0){return _0x1fee64[_0xf16a('0x20')](_0x49f0c2)[_0xf16a('0x21')](_0x5119d0);}};}function respondWithFilteredResult(_0x554337,_0x1ad7a9){return function(_0x2c223b){if(_0x2c223b){var _0x33440c=typeof _0x1ad7a9[_0xf16a('0x22')]===_0xf16a('0x23')&&typeof _0x1ad7a9[_0xf16a('0x24')]===_0xf16a('0x23');var _0x241df7=_0x2c223b[_0xf16a('0x25')];var _0x37c230=_0x33440c?0x0:_0x1ad7a9[_0xf16a('0x22')];var _0x1adec8=_0x33440c?_0x2c223b[_0xf16a('0x25')]:_0x1ad7a9[_0xf16a('0x22')]+_0x1ad7a9['limit'];var _0x4fca34;if(_0x1adec8>=_0x241df7){_0x1adec8=_0x241df7;_0x4fca34=0xc8;}else{_0x4fca34=0xce;}_0x554337[_0xf16a('0x20')](_0x4fca34);return _0x554337[_0xf16a('0x26')](_0xf16a('0x27'),_0x37c230+'-'+_0x1adec8+'/'+_0x241df7)['json'](_0x2c223b);}return null;};}function patchUpdates(_0x3a534e){return function(_0x12e22b){try{jsonpatch[_0xf16a('0x28')](_0x12e22b,_0x3a534e,!![]);}catch(_0x15653b){return BPromise[_0xf16a('0x29')](_0x15653b);}return _0x12e22b[_0xf16a('0x2a')]();};}function saveUpdates(_0x5d3f1b,_0x41d667){return function(_0x21af93){if(_0x21af93){return _0x21af93[_0xf16a('0x2b')](_0x5d3f1b)[_0xf16a('0x2c')](function(_0x3674ca){return _0x3674ca;});}return null;};}function removeEntity(_0x3f5eec,_0x2aa344){return function(_0x85f28f){if(_0x85f28f){return _0x85f28f[_0xf16a('0x2d')]()[_0xf16a('0x2c')](function(){var _0x56e540=_0x85f28f[_0xf16a('0x2e')]({'plain':!![]});var _0x22b951='WhatsappQueues';return db[_0xf16a('0x2f')][_0xf16a('0x2d')]({'where':{'type':_0x22b951,'resourceId':_0x56e540['id']}})[_0xf16a('0x2c')](function(){return _0x85f28f;});})[_0xf16a('0x2c')](function(){_0x3f5eec['status'](0xcc)[_0xf16a('0x1f')]();});}};}function handleEntityNotFound(_0x2ca0da,_0x2758ee){return function(_0x1e1610){if(!_0x1e1610){_0x2ca0da['sendStatus'](0x194);}return _0x1e1610;};}function handleError(_0x14783f,_0x52332c){_0x52332c=_0x52332c||0x1f4;return function(_0x4db15f){logger[_0xf16a('0x30')](_0x4db15f[_0xf16a('0x31')]);if(_0x4db15f[_0xf16a('0x32')]){delete _0x4db15f[_0xf16a('0x32')];}_0x14783f[_0xf16a('0x20')](_0x52332c)[_0xf16a('0x33')](_0x4db15f);};}exports[_0xf16a('0x34')]=function(_0x1cca52,_0xa8f6cb){var _0x470592={},_0x40de13={},_0x4eb49b={'count':0x0,'rows':[]};var _0x344342=_[_0xf16a('0x35')](db['WhatsappQueue']['rawAttributes'],function(_0x43d485){return{'name':_0x43d485[_0xf16a('0x36')],'type':_0x43d485['type']['key']};});_0x40de13[_0xf16a('0x37')]=_[_0xf16a('0x35')](_0x344342,_0xf16a('0x32'));_0x40de13[_0xf16a('0x38')]=_[_0xf16a('0x39')](_0x1cca52[_0xf16a('0x38')]);_0x40de13['filters']=_['intersection'](_0x40de13[_0xf16a('0x37')],_0x40de13['query']);_0x470592[_0xf16a('0x3a')]=_['intersection'](_0x40de13['model'],qs[_0xf16a('0x3b')](_0x1cca52[_0xf16a('0x38')][_0xf16a('0x3b')]));_0x470592['attributes']=_0x470592['attributes']['length']?_0x470592[_0xf16a('0x3a')]:_0x40de13['model'];if(!_0x1cca52[_0xf16a('0x38')][_0xf16a('0x3c')]('nolimit')){_0x470592['limit']=qs[_0xf16a('0x24')](_0x1cca52[_0xf16a('0x38')][_0xf16a('0x24')]);_0x470592[_0xf16a('0x22')]=qs[_0xf16a('0x22')](_0x1cca52['query'][_0xf16a('0x22')]);}_0x470592[_0xf16a('0x3d')]=qs[_0xf16a('0x3e')](_0x1cca52['query'][_0xf16a('0x3e')]);_0x470592[_0xf16a('0x3f')]=qs[_0xf16a('0x40')](_[_0xf16a('0x41')](_0x1cca52[_0xf16a('0x38')],_0x40de13[_0xf16a('0x40')]),_0x344342);if(_0x1cca52[_0xf16a('0x38')]['filter']){_0x470592[_0xf16a('0x3f')]=_['merge'](_0x470592[_0xf16a('0x3f')],{'$or':_[_0xf16a('0x35')](_0x344342,function(_0x4a28db){if(_0x4a28db[_0xf16a('0x42')]!==_0xf16a('0x43')){var _0x2ae58f={};_0x2ae58f[_0x4a28db[_0xf16a('0x32')]]={'$like':'%'+_0x1cca52[_0xf16a('0x38')][_0xf16a('0x44')]+'%'};return _0x2ae58f;}})});}_0x470592=_[_0xf16a('0x45')]({},_0x470592,_0x1cca52[_0xf16a('0x46')]);var _0x39190f={'where':_0x470592[_0xf16a('0x3f')]};return db[_0xf16a('0x47')][_0xf16a('0x25')](_0x39190f)['then'](function(_0x357b33){_0x4eb49b[_0xf16a('0x25')]=_0x357b33;if(_0x1cca52[_0xf16a('0x38')]['includeAll']){_0x470592[_0xf16a('0x48')]=[{'all':!![]}];}return db[_0xf16a('0x47')]['findAll'](_0x470592);})[_0xf16a('0x2c')](function(_0x975c2d){_0x4eb49b['rows']=_0x975c2d;return _0x4eb49b;})[_0xf16a('0x2c')](respondWithFilteredResult(_0xa8f6cb,_0x470592))[_0xf16a('0x49')](handleError(_0xa8f6cb,null));};exports[_0xf16a('0x4a')]=function(_0x1d1476,_0x115885){var _0x1a1c4d={'raw':!![],'where':{'id':_0x1d1476['params']['id']}},_0x197356={};_0x197356[_0xf16a('0x37')]=_[_0xf16a('0x39')](db[_0xf16a('0x47')][_0xf16a('0x4b')]);_0x197356['query']=_[_0xf16a('0x39')](_0x1d1476[_0xf16a('0x38')]);_0x197356[_0xf16a('0x40')]=_[_0xf16a('0x4c')](_0x197356[_0xf16a('0x37')],_0x197356[_0xf16a('0x38')]);_0x1a1c4d[_0xf16a('0x3a')]=_[_0xf16a('0x4c')](_0x197356[_0xf16a('0x37')],qs[_0xf16a('0x3b')](_0x1d1476[_0xf16a('0x38')][_0xf16a('0x3b')]));_0x1a1c4d[_0xf16a('0x3a')]=_0x1a1c4d[_0xf16a('0x3a')][_0xf16a('0x4d')]?_0x1a1c4d[_0xf16a('0x3a')]:_0x197356[_0xf16a('0x37')];if(_0x1d1476[_0xf16a('0x38')][_0xf16a('0x4e')]){_0x1a1c4d[_0xf16a('0x48')]=[{'all':!![]}];}_0x1a1c4d=_[_0xf16a('0x45')]({},_0x1a1c4d,_0x1d1476[_0xf16a('0x46')]);return db['WhatsappQueue'][_0xf16a('0x4f')](_0x1a1c4d)[_0xf16a('0x2c')](handleEntityNotFound(_0x115885,null))['then'](respondWithResult(_0x115885,null))[_0xf16a('0x49')](handleError(_0x115885,null));};exports['create']=function(_0x5d7826,_0x14da36){return db[_0xf16a('0x47')]['create'](_0x5d7826[_0xf16a('0x50')],{})['then'](function(_0x32722a){var _0x246be4=_0x5d7826[_0xf16a('0x51')][_0xf16a('0x2e')]({'plain':!![]});if(!_0x246be4)throw new Error(_0xf16a('0x52'));if(_0x246be4['role']==='user'){var _0x4be2dc=_0x32722a[_0xf16a('0x2e')]({'plain':!![]});var _0x14f077=_0xf16a('0x53');return db[_0xf16a('0x54')]['find']({'where':{'name':_0x14f077,'userProfileId':_0x246be4[_0xf16a('0x55')]},'raw':!![]})[_0xf16a('0x2c')](function(_0x4083b3){if(_0x4083b3&&_0x4083b3[_0xf16a('0x56')]===0x0){return db[_0xf16a('0x2f')][_0xf16a('0x57')]({'name':_0x4be2dc[_0xf16a('0x32')],'resourceId':_0x4be2dc['id'],'type':_0x4083b3[_0xf16a('0x32')],'sectionId':_0x4083b3['id']},{})[_0xf16a('0x2c')](function(){return _0x32722a;});}else{return _0x32722a;}})[_0xf16a('0x49')](function(_0x393844){logger[_0xf16a('0x30')](_0xf16a('0x58'),_0x393844);throw _0x393844;});}return _0x32722a;})['then'](respondWithResult(_0x14da36,0xc9))[_0xf16a('0x49')](handleError(_0x14da36,null));};exports[_0xf16a('0x2b')]=function(_0x14e2e9,_0x459fc4){if(_0x14e2e9[_0xf16a('0x50')]['id']){delete _0x14e2e9[_0xf16a('0x50')]['id'];}return db[_0xf16a('0x47')]['find']({'where':{'id':_0x14e2e9[_0xf16a('0x59')]['id']}})[_0xf16a('0x2c')](handleEntityNotFound(_0x459fc4,null))[_0xf16a('0x2c')](saveUpdates(_0x14e2e9['body'],null))[_0xf16a('0x2c')](respondWithResult(_0x459fc4,null))[_0xf16a('0x49')](handleError(_0x459fc4,null));};exports[_0xf16a('0x2d')]=function(_0x312b48,_0x2d16cd){return db[_0xf16a('0x47')][_0xf16a('0x4f')]({'where':{'id':_0x312b48['params']['id']}})[_0xf16a('0x2c')](handleEntityNotFound(_0x2d16cd,null))['then'](removeEntity(_0x2d16cd,null))[_0xf16a('0x49')](handleError(_0x2d16cd,null));};exports[_0xf16a('0x5a')]=function(_0x5e8977,_0x5e7a36){return db[_0xf16a('0x47')]['describe']()[_0xf16a('0x2c')](respondWithResult(_0x5e7a36,null))[_0xf16a('0x49')](handleError(_0x5e7a36,null));};exports[_0xf16a('0x5b')]=function(_0x376d60,_0x446077,_0x4e77f6){var _0x7d45b8={'raw':!![],'where':{}},_0x1c2774={},_0x5ae20c;return db[_0xf16a('0x47')]['findOne']({'where':{'id':_0x376d60[_0xf16a('0x59')]['id']}})[_0xf16a('0x2c')](handleEntityNotFound(_0x446077,null))[_0xf16a('0x2c')](function(_0x495d78){if(_0x495d78){_0x5ae20c=_0x495d78['get']({'plain':!![]});_0x1c2774[_0xf16a('0x37')]=_[_0xf16a('0x39')](db[_0xf16a('0x5c')][_0xf16a('0x4b')]);_0x1c2774['query']=_['keys'](_0x376d60[_0xf16a('0x38')]);_0x1c2774[_0xf16a('0x40')]=_[_0xf16a('0x4c')](_0x1c2774['model'],_0x1c2774[_0xf16a('0x38')]);_0x7d45b8[_0xf16a('0x3a')]=_['intersection'](_0x1c2774['model'],qs[_0xf16a('0x3b')](_0x376d60[_0xf16a('0x38')][_0xf16a('0x3b')]));_0x7d45b8[_0xf16a('0x3a')]=_0x7d45b8[_0xf16a('0x3a')][_0xf16a('0x4d')]?_0x7d45b8[_0xf16a('0x3a')]:_0x1c2774['model'];if(!_0x376d60['query']['hasOwnProperty'](_0xf16a('0x5d'))){_0x7d45b8[_0xf16a('0x24')]=qs[_0xf16a('0x24')](_0x376d60[_0xf16a('0x38')][_0xf16a('0x24')]);_0x7d45b8[_0xf16a('0x22')]=qs[_0xf16a('0x22')](_0x376d60[_0xf16a('0x38')][_0xf16a('0x22')]);}_0x7d45b8[_0xf16a('0x3d')]=qs[_0xf16a('0x3e')](_0x376d60['query']['sort']);_0x7d45b8['where']=qs[_0xf16a('0x40')](_['pick'](_0x376d60['query'],_0x1c2774['filters']));_0x7d45b8['where'][_0xf16a('0x5e')]=_0x495d78['id'];if(_0x376d60[_0xf16a('0x38')][_0xf16a('0x44')]){_0x7d45b8[_0xf16a('0x3f')]=_[_0xf16a('0x45')](_0x7d45b8['where'],{'$or':_[_0xf16a('0x35')](_0x7d45b8[_0xf16a('0x3a')],function(_0x5e0cd0){var _0x5ab405={};_0x5ab405[_0x5e0cd0]={'$like':'%'+_0x376d60[_0xf16a('0x38')][_0xf16a('0x44')]+'%'};return _0x5ab405;})});}_0x7d45b8=_[_0xf16a('0x45')]({},_0x7d45b8,_0x376d60[_0xf16a('0x46')]);return db['UserWhatsappQueue'][_0xf16a('0x5f')](_0x7d45b8);}})[_0xf16a('0x2c')](function(_0x202f8f){if(_0x202f8f){return db[_0xf16a('0x60')][_0xf16a('0x61')]({'where':{'id':_[_0xf16a('0x35')](_0x202f8f,_0xf16a('0x62')),'role':'agent'},'attributes':['id',_0xf16a('0x32'),_0xf16a('0x63'),_0xf16a('0x64'),_0xf16a('0x65')]});}})[_0xf16a('0x2c')](function(_0x595aaf){if(_0x595aaf){return{'count':_0x595aaf['count'],'rows':_['map'](_0x595aaf[_0xf16a('0x66')],function(_0x108f2c){return{'membername':_0x108f2c[_0xf16a('0x32')],'UserId':_0x108f2c['id'],'queue_name':_0x5ae20c[_0xf16a('0x32')],'WhatsappQueueId':_0x5ae20c['id'],'interface':util[_0xf16a('0x67')](_0xf16a('0x68'),_0xf16a('0x69'),_0x108f2c[_0xf16a('0x32')]),'penalty':0x0,'paused':_0x108f2c['whatsappPause'],'createdAt':_0x108f2c[_0xf16a('0x65')],'updatedAt':_0x108f2c[_0xf16a('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf16a('0x2c')](respondWithFilteredResult(_0x446077,_0x7d45b8))[_0xf16a('0x49')](handleError(_0x446077,null));};exports[_0xf16a('0x6a')]=function(_0x56c9de,_0x46c87b,_0x3693c1){var _0x357002={};var _0x415812={};var _0x30ca27;var _0x110dca;return db[_0xf16a('0x47')]['findOne']({'where':{'id':_0x56c9de[_0xf16a('0x59')]['id']}})[_0xf16a('0x2c')](handleEntityNotFound(_0x46c87b,null))[_0xf16a('0x2c')](function(_0x2e417a){if(_0x2e417a){_0x30ca27=_0x2e417a;_0x415812[_0xf16a('0x37')]=_[_0xf16a('0x39')](db['Team']['rawAttributes']);_0x415812['query']=_[_0xf16a('0x39')](_0x56c9de[_0xf16a('0x38')]);_0x415812[_0xf16a('0x40')]=_[_0xf16a('0x4c')](_0x415812[_0xf16a('0x37')],_0x415812['query']);_0x357002[_0xf16a('0x3a')]=_['intersection'](_0x415812[_0xf16a('0x37')],qs[_0xf16a('0x3b')](_0x56c9de[_0xf16a('0x38')][_0xf16a('0x3b')]));_0x357002[_0xf16a('0x3a')]=_0x357002['attributes']['length']?_0x357002[_0xf16a('0x3a')]:_0x415812['model'];_0x357002['order']=qs[_0xf16a('0x3e')](_0x56c9de[_0xf16a('0x38')][_0xf16a('0x3e')]);_0x357002[_0xf16a('0x3f')]=qs['filters'](_[_0xf16a('0x41')](_0x56c9de[_0xf16a('0x38')],_0x415812[_0xf16a('0x40')]));if(_0x56c9de[_0xf16a('0x38')][_0xf16a('0x44')]){_0x357002[_0xf16a('0x3f')]=_[_0xf16a('0x45')](_0x357002[_0xf16a('0x3f')],{'$or':_[_0xf16a('0x35')](_0x357002['attributes'],function(_0x466f24){var _0x219dba={};_0x219dba[_0x466f24]={'$like':'%'+_0x56c9de[_0xf16a('0x38')]['filter']+'%'};return _0x219dba;})});}_0x357002=_[_0xf16a('0x45')]({},_0x357002,_0x56c9de['options']);return _0x30ca27[_0xf16a('0x6a')](_0x357002);}})[_0xf16a('0x2c')](function(_0x3796de){if(_0x3796de){_0x110dca=_0x3796de['length'];if(!_0x56c9de[_0xf16a('0x38')][_0xf16a('0x3c')](_0xf16a('0x5d'))){_0x357002[_0xf16a('0x24')]=qs[_0xf16a('0x24')](_0x56c9de['query'][_0xf16a('0x24')]);_0x357002['offset']=qs['offset'](_0x56c9de['query'][_0xf16a('0x22')]);}return _0x30ca27[_0xf16a('0x6a')](_0x357002);}})['then'](function(_0x206f10){if(_0x206f10){return _0x206f10?{'count':_0x110dca,'rows':_0x206f10}:null;}})[_0xf16a('0x2c')](respondWithResult(_0x46c87b,null))[_0xf16a('0x49')](handleError(_0x46c87b,null));};exports[_0xf16a('0x6b')]=function(_0x7d58de,_0x2c4643,_0x3d10ed){var _0x54e490=_0x7d58de['body'][_0xf16a('0x6c')];return db[_0xf16a('0x6d')][_0xf16a('0x5f')]({'where':{'id':_0x54e490},'attributes':['id'],'include':[{'model':db[_0xf16a('0x60')],'as':_0xf16a('0x6e'),'attributes':['id','name','online',_0xf16a('0x6f'),_0xf16a('0x70')],'raw':!![]}]})[_0xf16a('0x2c')](function(_0x4ba950){if(_0x4ba950){var _0xa99da0=_[_0xf16a('0x71')](_0x4ba950,function(_0x3a40b2){var _0x29b09d=_0x3a40b2['get']({'plain':!![]});return _0x29b09d['Agents'];});return db[_0xf16a('0x47')][_0xf16a('0x4f')]({'where':{'id':_0x7d58de[_0xf16a('0x59')]['id']}})[_0xf16a('0x2c')](function(_0x52174a){return db[_0xf16a('0x72')][_0xf16a('0x73')](function(_0x26f45e){return _0x52174a[_0xf16a('0x6b')](_0x54e490,{'transaction':_0x26f45e})[_0xf16a('0x2c')](function(){return BPromise[_0xf16a('0x74')](_0xa99da0,function(_0x4b6691){return db[_0xf16a('0x5c')][_0xf16a('0x75')]({'where':{'UserId':_0x4b6691['id'],'WhatsappQueueId':_0x7d58de[_0xf16a('0x59')]['id']},'transaction':_0x26f45e});});})[_0xf16a('0x2c')](function(){_0xa99da0[_0xf16a('0x76')](function(_0x4d19c9){socket[_0xf16a('0x77')]('userWhatsappQueue:save',{'UserId':_0x4d19c9['id'],'WhatsappQueueId':_0x52174a['id']});});});});});}})[_0xf16a('0x2c')](respondWithStatusCode(_0x2c4643,null))[_0xf16a('0x49')](handleError(_0x2c4643,null));};exports[_0xf16a('0x78')]=function(_0x52593f,_0x57e017,_0x12f95f){return db[_0xf16a('0x6d')][_0xf16a('0x5f')]({'where':{'id':_0x52593f[_0xf16a('0x38')][_0xf16a('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xf16a('0x60')],'as':_0xf16a('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xf16a('0x2c')](handleEntityNotFound(_0x57e017,null))[_0xf16a('0x2c')](function(_0x2b89cf){var _0x49e2c2=_[_0xf16a('0x35')](_0x2b89cf,'id');var _0x4955bd=[];var _0x2262ed=[];var _0x346277=squel[_0xf16a('0x79')]();_0x346277[_0xf16a('0x7a')]('tq.TeamId')[_0xf16a('0x7b')]('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut',_0xf16a('0x7c'))[_0xf16a('0x3f')](_0xf16a('0x7d'),_0x52593f['params']['id']);for(var _0x4a7788=0x0;_0x4a7788<_0x2b89cf[_0xf16a('0x4d')];_0x4a7788+=0x1){let _0x559fa9=_0x2b89cf[_0x4a7788];for(var _0x2ecb50=0x0;_0x2ecb50<_0x559fa9[_0xf16a('0x6e')][_0xf16a('0x4d')];_0x2ecb50+=0x1){let _0x5a1c88=_0x559fa9[_0xf16a('0x6e')][_0x2ecb50];var _0x269701=_0x346277[_0xf16a('0x7e')]();_0x269701['where'](_0xf16a('0x7f'),_0x5a1c88['id']);_0x2262ed[_0xf16a('0x80')](db['sequelize']['query'](_0x269701[_0xf16a('0x81')](),{'type':db[_0xf16a('0x72')]['QueryTypes'][_0xf16a('0x82')]})['then'](function(_0x446bb6){if(_0x446bb6[_0xf16a('0x4d')]===0x1){return _0x5a1c88['id'];}else{var _0x38a77e=_[_0xf16a('0x83')](_[_0xf16a('0x35')](_0x446bb6,_0xf16a('0x84')),function(_0x3aefa3){return _[_0xf16a('0x85')](_0x49e2c2,_0x3aefa3);});if(_0x38a77e){return _0x5a1c88['id'];}}}));}}return BPromise['all'](_0x2262ed)['then'](function(_0x46f2de){_0x4955bd=_(_0x4955bd)[_0xf16a('0x86')](_0x46f2de)[_0xf16a('0x87')]()[_0xf16a('0x88')]();return db['WhatsappQueue'][_0xf16a('0x4f')]({'where':{'id':_0x52593f['params']['id']}})['then'](function(_0x45304d){return db['sequelize'][_0xf16a('0x73')](function(_0x3450c8){return _0x45304d[_0xf16a('0x78')](_0x52593f['query']['ids'],{'transaction':_0x3450c8})[_0xf16a('0x2c')](function(){if(!_[_0xf16a('0x89')](_0x4955bd)){return _0x45304d['removeAgents'](_0x4955bd,{'transaction':_0x3450c8});}})[_0xf16a('0x2c')](function(){_0x4955bd['forEach'](function(_0x2123d7){socket[_0xf16a('0x77')](_0xf16a('0x8a'),{'UserId':_0x2123d7,'WhatsappQueueId':_0x45304d['id']});});});});});});})[_0xf16a('0x2c')](respondWithStatusCode(_0x57e017,null))[_0xf16a('0x49')](handleError(_0x57e017,null));};exports[_0xf16a('0x8b')]=function(_0x2d5cd5,_0x47b24d,_0x201048){return db[_0xf16a('0x47')][_0xf16a('0x4f')]({'where':{'id':_0x2d5cd5[_0xf16a('0x59')]['id']}})[_0xf16a('0x2c')](handleEntityNotFound(_0x47b24d,null))[_0xf16a('0x2c')](function(_0x37df2a){if(_0x37df2a){return _0x37df2a[_0xf16a('0x8b')](_0x2d5cd5[_0xf16a('0x50')]['ids'],_[_0xf16a('0x8c')](_0x2d5cd5['body'],[_0xf16a('0x6c'),'id'])||{})['spread'](function(_0x943d4e){for(var _0x1744ed=0x0;_0x1744ed<_0x2d5cd5['body'][_0xf16a('0x6c')]['length'];_0x1744ed+=0x1){socket[_0xf16a('0x77')](_0xf16a('0x8d'),{'UserId':Number(_0x2d5cd5[_0xf16a('0x50')][_0xf16a('0x6c')][_0x1744ed]),'WhatsappQueueId':Number(_0x2d5cd5[_0xf16a('0x59')]['id'])});}return _0x943d4e;});}})[_0xf16a('0x2c')](respondWithResult(_0x47b24d,null))['catch'](handleError(_0x47b24d,null));};exports[_0xf16a('0x8e')]=function(_0x53dbbc,_0x3e8537,_0x9986a8){return db['WhatsappQueue'][_0xf16a('0x4f')]({'where':{'id':_0x53dbbc['params']['id']}})[_0xf16a('0x2c')](handleEntityNotFound(_0x3e8537,null))[_0xf16a('0x2c')](function(_0xc08176){if(_0xc08176){return _0xc08176[_0xf16a('0x8e')](_0x53dbbc[_0xf16a('0x38')][_0xf16a('0x6c')])[_0xf16a('0x2c')](function(){if(_[_0xf16a('0x8f')](_0x53dbbc[_0xf16a('0x38')][_0xf16a('0x6c')])){for(var _0x4aa8c1=0x0;_0x4aa8c1<_0x53dbbc[_0xf16a('0x38')][_0xf16a('0x6c')][_0xf16a('0x4d')];_0x4aa8c1+=0x1){socket[_0xf16a('0x77')](_0xf16a('0x8a'),{'UserId':Number(_0x53dbbc['query'][_0xf16a('0x6c')][_0x4aa8c1]),'WhatsappQueueId':Number(_0x53dbbc[_0xf16a('0x59')]['id'])});}}else{socket['emit'](_0xf16a('0x8a'),{'UserId':Number(_0x53dbbc['query'][_0xf16a('0x6c')]),'WhatsappQueueId':Number(_0x53dbbc[_0xf16a('0x59')]['id'])});}});}})[_0xf16a('0x2c')](respondWithStatusCode(_0x3e8537,null))[_0xf16a('0x49')](handleError(_0x3e8537,null));};exports[_0xf16a('0x90')]=function(_0x5a4151,_0x1a65eb,_0x2320dd){var _0xb1eacc={};var _0x51427c={};var _0x46a370;var _0x52cc6f;return db[_0xf16a('0x47')][_0xf16a('0x91')]({'where':{'id':_0x5a4151['params']['id']}})[_0xf16a('0x2c')](handleEntityNotFound(_0x1a65eb,null))[_0xf16a('0x2c')](function(_0x204094){if(_0x204094){_0x46a370=_0x204094;_0x51427c[_0xf16a('0x37')]=_[_0xf16a('0x39')](db['User'][_0xf16a('0x4b')]);_0x51427c[_0xf16a('0x38')]=_[_0xf16a('0x39')](_0x5a4151[_0xf16a('0x38')]);_0x51427c[_0xf16a('0x40')]=_[_0xf16a('0x4c')](_0x51427c[_0xf16a('0x37')],_0x51427c[_0xf16a('0x38')]);_0xb1eacc['attributes']=_[_0xf16a('0x4c')](_0x51427c[_0xf16a('0x37')],qs['fields'](_0x5a4151[_0xf16a('0x38')][_0xf16a('0x3b')]));_0xb1eacc[_0xf16a('0x3a')]=_0xb1eacc[_0xf16a('0x3a')][_0xf16a('0x4d')]?_0xb1eacc[_0xf16a('0x3a')]:_0x51427c['model'];_0xb1eacc[_0xf16a('0x3d')]=qs['sort'](_0x5a4151[_0xf16a('0x38')]['sort']);_0xb1eacc[_0xf16a('0x3f')]=qs[_0xf16a('0x40')](_[_0xf16a('0x41')](_0x5a4151[_0xf16a('0x38')],_0x51427c[_0xf16a('0x40')]));if(_0x5a4151[_0xf16a('0x38')][_0xf16a('0x44')]){_0xb1eacc[_0xf16a('0x3f')]=_[_0xf16a('0x45')](_0xb1eacc[_0xf16a('0x3f')],{'$or':_[_0xf16a('0x35')](_0xb1eacc[_0xf16a('0x3a')],function(_0x5654df){var _0x496f54={};_0x496f54[_0x5654df]={'$like':'%'+_0x5a4151['query'][_0xf16a('0x44')]+'%'};return _0x496f54;})});}_0xb1eacc=_[_0xf16a('0x45')]({},_0xb1eacc,_0x5a4151[_0xf16a('0x46')]);return _0x46a370[_0xf16a('0x90')](_0xb1eacc);}})['then'](function(_0x5ad11c){if(_0x5ad11c){_0x52cc6f=_0x5ad11c[_0xf16a('0x4d')];if(!_0x5a4151['query'][_0xf16a('0x3c')](_0xf16a('0x5d'))){_0xb1eacc[_0xf16a('0x24')]=qs[_0xf16a('0x24')](_0x5a4151[_0xf16a('0x38')][_0xf16a('0x24')]);_0xb1eacc[_0xf16a('0x22')]=qs['offset'](_0x5a4151[_0xf16a('0x38')][_0xf16a('0x22')]);}return _0x46a370[_0xf16a('0x90')](_0xb1eacc);}})['then'](function(_0x18e7fa){if(_0x18e7fa){return _0x18e7fa?{'count':_0x52cc6f,'rows':_0x18e7fa}:null;}})['then'](respondWithResult(_0x1a65eb,null))[_0xf16a('0x49')](handleError(_0x1a65eb,null));}; \ No newline at end of file +var _0xda05=['where','filters','pick','filter','type','VIRTUAL','WhatsappQueue','includeAll','include','findAll','catch','show','params','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappQueues','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','merge','map','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','options','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','sendStatus','error','stack','send','index','rawAttributes','key','name','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x56e290,_0xbe292f){var _0x3a5681=function(_0x2a52b4){while(--_0x2a52b4){_0x56e290['push'](_0x56e290['shift']());}};_0x3a5681(++_0xbe292f);}(_0xda05,0x16b));var _0x5da0=function(_0x2ef688,_0x30bd60){_0x2ef688=_0x2ef688-0x0;var _0x291e0c=_0xda05[_0x2ef688];return _0x291e0c;};'use strict';var emlformat=require(_0x5da0('0x0'));var rimraf=require(_0x5da0('0x1'));var zipdir=require(_0x5da0('0x2'));var jsonpatch=require(_0x5da0('0x3'));var rp=require('request-promise');var moment=require(_0x5da0('0x4'));var BPromise=require(_0x5da0('0x5'));var Mustache=require('mustache');var util=require(_0x5da0('0x6'));var path=require(_0x5da0('0x7'));var sox=require(_0x5da0('0x8'));var csv=require(_0x5da0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5da0('0xa'));var _=require(_0x5da0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5da0('0xc'));var deskjs=require(_0x5da0('0xd'));var toCsv=require(_0x5da0('0x9'));var querystring=require(_0x5da0('0xe'));var Papa=require(_0x5da0('0xf'));var Redis=require(_0x5da0('0x10'));var authService=require(_0x5da0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5da0('0x12'));var hardwareService=require(_0x5da0('0x13'));var logger=require(_0x5da0('0x14'))('api');var utils=require(_0x5da0('0x15'));var config=require(_0x5da0('0x16'));var licenseUtil=require(_0x5da0('0x17'));var db=require(_0x5da0('0x18'))['db'];config[_0x5da0('0x19')]=_[_0x5da0('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5da0('0x1b'))(new Redis(config[_0x5da0('0x19')]));require(_0x5da0('0x1c'))['register'](socket);function respondWithStatusCode(_0x3e8e13,_0x334d4c){_0x334d4c=_0x334d4c||0xcc;return function(_0x8cb00b){if(_0x8cb00b){return _0x3e8e13['sendStatus'](_0x334d4c);}return _0x3e8e13[_0x5da0('0x1d')](_0x334d4c)[_0x5da0('0x1e')]();};}function respondWithResult(_0x435134,_0x2be27f){_0x2be27f=_0x2be27f||0xc8;return function(_0xff9d6f){if(_0xff9d6f){return _0x435134[_0x5da0('0x1d')](_0x2be27f)[_0x5da0('0x1f')](_0xff9d6f);}};}function respondWithFilteredResult(_0x4bd874,_0xc93f9f){return function(_0x3cd421){if(_0x3cd421){var _0xd0b8d7=typeof _0xc93f9f[_0x5da0('0x20')]===_0x5da0('0x21')&&typeof _0xc93f9f[_0x5da0('0x22')]===_0x5da0('0x21');var _0x219726=_0x3cd421[_0x5da0('0x23')];var _0x5e5191=_0xd0b8d7?0x0:_0xc93f9f['offset'];var _0x520d57=_0xd0b8d7?_0x3cd421[_0x5da0('0x23')]:_0xc93f9f[_0x5da0('0x20')]+_0xc93f9f[_0x5da0('0x22')];var _0x37333d;if(_0x520d57>=_0x219726){_0x520d57=_0x219726;_0x37333d=0xc8;}else{_0x37333d=0xce;}_0x4bd874[_0x5da0('0x1d')](_0x37333d);return _0x4bd874[_0x5da0('0x24')]('Content-Range',_0x5e5191+'-'+_0x520d57+'/'+_0x219726)[_0x5da0('0x1f')](_0x3cd421);}return null;};}function patchUpdates(_0x1db344){return function(_0x4f6886){try{jsonpatch[_0x5da0('0x25')](_0x4f6886,_0x1db344,!![]);}catch(_0x2ec693){return BPromise['reject'](_0x2ec693);}return _0x4f6886[_0x5da0('0x26')]();};}function saveUpdates(_0x381a68,_0x1d1e18){return function(_0x3df498){if(_0x3df498){return _0x3df498['update'](_0x381a68)[_0x5da0('0x27')](function(_0x2df735){return _0x2df735;});}return null;};}function removeEntity(_0x74e692,_0x22fc07){return function(_0x20b663){if(_0x20b663){return _0x20b663[_0x5da0('0x28')]()[_0x5da0('0x27')](function(){var _0x1e969b=_0x20b663[_0x5da0('0x29')]({'plain':!![]});var _0x455d81='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x455d81,'resourceId':_0x1e969b['id']}})['then'](function(){return _0x20b663;});})[_0x5da0('0x27')](function(){_0x74e692[_0x5da0('0x1d')](0xcc)[_0x5da0('0x1e')]();});}};}function handleEntityNotFound(_0x3eae97,_0x40914b){return function(_0x5f3f79){if(!_0x5f3f79){_0x3eae97[_0x5da0('0x2a')](0x194);}return _0x5f3f79;};}function handleError(_0x2892ce,_0x9a254f){_0x9a254f=_0x9a254f||0x1f4;return function(_0x46055b){logger[_0x5da0('0x2b')](_0x46055b[_0x5da0('0x2c')]);if(_0x46055b['name']){delete _0x46055b['name'];}_0x2892ce['status'](_0x9a254f)[_0x5da0('0x2d')](_0x46055b);};}exports[_0x5da0('0x2e')]=function(_0xf59daf,_0x50060c){var _0x45c656={},_0x4680b8={},_0xea2228={'count':0x0,'rows':[]};var _0x116195=_['map'](db['WhatsappQueue'][_0x5da0('0x2f')],function(_0x595c36){return{'name':_0x595c36['fieldName'],'type':_0x595c36['type'][_0x5da0('0x30')]};});_0x4680b8['model']=_['map'](_0x116195,_0x5da0('0x31'));_0x4680b8[_0x5da0('0x32')]=_[_0x5da0('0x33')](_0xf59daf[_0x5da0('0x32')]);_0x4680b8['filters']=_[_0x5da0('0x34')](_0x4680b8[_0x5da0('0x35')],_0x4680b8[_0x5da0('0x32')]);_0x45c656['attributes']=_[_0x5da0('0x34')](_0x4680b8['model'],qs[_0x5da0('0x36')](_0xf59daf[_0x5da0('0x32')]['fields']));_0x45c656[_0x5da0('0x37')]=_0x45c656[_0x5da0('0x37')]['length']?_0x45c656[_0x5da0('0x37')]:_0x4680b8['model'];if(!_0xf59daf[_0x5da0('0x32')][_0x5da0('0x38')](_0x5da0('0x39'))){_0x45c656['limit']=qs['limit'](_0xf59daf[_0x5da0('0x32')][_0x5da0('0x22')]);_0x45c656[_0x5da0('0x20')]=qs[_0x5da0('0x20')](_0xf59daf[_0x5da0('0x32')][_0x5da0('0x20')]);}_0x45c656[_0x5da0('0x3a')]=qs[_0x5da0('0x3b')](_0xf59daf['query'][_0x5da0('0x3b')]);_0x45c656[_0x5da0('0x3c')]=qs[_0x5da0('0x3d')](_[_0x5da0('0x3e')](_0xf59daf[_0x5da0('0x32')],_0x4680b8['filters']),_0x116195);if(_0xf59daf[_0x5da0('0x32')][_0x5da0('0x3f')]){_0x45c656['where']=_['merge'](_0x45c656[_0x5da0('0x3c')],{'$or':_['map'](_0x116195,function(_0x569937){if(_0x569937[_0x5da0('0x40')]!==_0x5da0('0x41')){var _0x7eb923={};_0x7eb923[_0x569937[_0x5da0('0x31')]]={'$like':'%'+_0xf59daf[_0x5da0('0x32')][_0x5da0('0x3f')]+'%'};return _0x7eb923;}})});}_0x45c656=_['merge']({},_0x45c656,_0xf59daf['options']);var _0x17493d={'where':_0x45c656['where']};return db[_0x5da0('0x42')][_0x5da0('0x23')](_0x17493d)[_0x5da0('0x27')](function(_0x1615de){_0xea2228[_0x5da0('0x23')]=_0x1615de;if(_0xf59daf[_0x5da0('0x32')][_0x5da0('0x43')]){_0x45c656[_0x5da0('0x44')]=[{'all':!![]}];}return db[_0x5da0('0x42')][_0x5da0('0x45')](_0x45c656);})['then'](function(_0x1499d0){_0xea2228['rows']=_0x1499d0;return _0xea2228;})['then'](respondWithFilteredResult(_0x50060c,_0x45c656))[_0x5da0('0x46')](handleError(_0x50060c,null));};exports[_0x5da0('0x47')]=function(_0x10a7c3,_0x14a63a){var _0x3e31e1={'raw':!![],'where':{'id':_0x10a7c3[_0x5da0('0x48')]['id']}},_0x5af88c={};_0x5af88c[_0x5da0('0x35')]=_[_0x5da0('0x33')](db[_0x5da0('0x42')][_0x5da0('0x2f')]);_0x5af88c[_0x5da0('0x32')]=_[_0x5da0('0x33')](_0x10a7c3[_0x5da0('0x32')]);_0x5af88c['filters']=_['intersection'](_0x5af88c[_0x5da0('0x35')],_0x5af88c[_0x5da0('0x32')]);_0x3e31e1[_0x5da0('0x37')]=_[_0x5da0('0x34')](_0x5af88c[_0x5da0('0x35')],qs[_0x5da0('0x36')](_0x10a7c3[_0x5da0('0x32')]['fields']));_0x3e31e1[_0x5da0('0x37')]=_0x3e31e1[_0x5da0('0x37')][_0x5da0('0x49')]?_0x3e31e1[_0x5da0('0x37')]:_0x5af88c['model'];if(_0x10a7c3['query'][_0x5da0('0x43')]){_0x3e31e1[_0x5da0('0x44')]=[{'all':!![]}];}_0x3e31e1=_['merge']({},_0x3e31e1,_0x10a7c3['options']);return db['WhatsappQueue']['find'](_0x3e31e1)[_0x5da0('0x27')](handleEntityNotFound(_0x14a63a,null))[_0x5da0('0x27')](respondWithResult(_0x14a63a,null))[_0x5da0('0x46')](handleError(_0x14a63a,null));};exports['create']=function(_0x21c848,_0x34f374){return db['WhatsappQueue']['create'](_0x21c848[_0x5da0('0x4a')],{})['then'](function(_0x90e514){var _0x139813=_0x21c848['user'][_0x5da0('0x29')]({'plain':!![]});if(!_0x139813)throw new Error(_0x5da0('0x4b'));if(_0x139813[_0x5da0('0x4c')]===_0x5da0('0x4d')){var _0x583047=_0x90e514['get']({'plain':!![]});var _0x328aaf=_0x5da0('0x4e');return db['UserProfileSection'][_0x5da0('0x4f')]({'where':{'name':_0x328aaf,'userProfileId':_0x139813[_0x5da0('0x50')]},'raw':!![]})[_0x5da0('0x27')](function(_0x4182e7){if(_0x4182e7&&_0x4182e7['autoAssociation']===0x0){return db['UserProfileResource'][_0x5da0('0x51')]({'name':_0x583047[_0x5da0('0x31')],'resourceId':_0x583047['id'],'type':_0x4182e7[_0x5da0('0x31')],'sectionId':_0x4182e7['id']},{})[_0x5da0('0x27')](function(){return _0x90e514;});}else{return _0x90e514;}})[_0x5da0('0x46')](function(_0x1c6cf9){logger[_0x5da0('0x2b')](_0x5da0('0x52'),_0x1c6cf9);throw _0x1c6cf9;});}return _0x90e514;})[_0x5da0('0x27')](respondWithResult(_0x34f374,0xc9))['catch'](handleError(_0x34f374,null));};exports['update']=function(_0x2b54d4,_0x24a447){if(_0x2b54d4[_0x5da0('0x4a')]['id']){delete _0x2b54d4['body']['id'];}return db[_0x5da0('0x42')]['find']({'where':{'id':_0x2b54d4[_0x5da0('0x48')]['id']}})['then'](handleEntityNotFound(_0x24a447,null))[_0x5da0('0x27')](saveUpdates(_0x2b54d4[_0x5da0('0x4a')],null))[_0x5da0('0x27')](respondWithResult(_0x24a447,null))[_0x5da0('0x46')](handleError(_0x24a447,null));};exports[_0x5da0('0x28')]=function(_0x1b3063,_0x3c5df0){return db[_0x5da0('0x42')]['find']({'where':{'id':_0x1b3063[_0x5da0('0x48')]['id']}})[_0x5da0('0x27')](handleEntityNotFound(_0x3c5df0,null))[_0x5da0('0x27')](removeEntity(_0x3c5df0,null))['catch'](handleError(_0x3c5df0,null));};exports[_0x5da0('0x53')]=function(_0x48a5d4,_0x23541b){return db[_0x5da0('0x42')][_0x5da0('0x53')]()[_0x5da0('0x27')](respondWithResult(_0x23541b,null))['catch'](handleError(_0x23541b,null));};exports[_0x5da0('0x54')]=function(_0x21e2f3,_0x3b8a99,_0x5efedf){var _0x162bec={'raw':!![],'where':{}},_0x139386={},_0x3fe667;return db[_0x5da0('0x42')][_0x5da0('0x55')]({'where':{'id':_0x21e2f3[_0x5da0('0x48')]['id']}})[_0x5da0('0x27')](handleEntityNotFound(_0x3b8a99,null))['then'](function(_0x53d4c4){if(_0x53d4c4){_0x3fe667=_0x53d4c4[_0x5da0('0x29')]({'plain':!![]});_0x139386['model']=_[_0x5da0('0x33')](db[_0x5da0('0x56')][_0x5da0('0x2f')]);_0x139386[_0x5da0('0x32')]=_[_0x5da0('0x33')](_0x21e2f3[_0x5da0('0x32')]);_0x139386[_0x5da0('0x3d')]=_[_0x5da0('0x34')](_0x139386[_0x5da0('0x35')],_0x139386[_0x5da0('0x32')]);_0x162bec[_0x5da0('0x37')]=_['intersection'](_0x139386[_0x5da0('0x35')],qs['fields'](_0x21e2f3[_0x5da0('0x32')][_0x5da0('0x36')]));_0x162bec[_0x5da0('0x37')]=_0x162bec[_0x5da0('0x37')]['length']?_0x162bec['attributes']:_0x139386[_0x5da0('0x35')];if(!_0x21e2f3[_0x5da0('0x32')][_0x5da0('0x38')](_0x5da0('0x39'))){_0x162bec['limit']=qs[_0x5da0('0x22')](_0x21e2f3[_0x5da0('0x32')][_0x5da0('0x22')]);_0x162bec[_0x5da0('0x20')]=qs[_0x5da0('0x20')](_0x21e2f3[_0x5da0('0x32')]['offset']);}_0x162bec[_0x5da0('0x3a')]=qs[_0x5da0('0x3b')](_0x21e2f3['query'][_0x5da0('0x3b')]);_0x162bec[_0x5da0('0x3c')]=qs[_0x5da0('0x3d')](_[_0x5da0('0x3e')](_0x21e2f3['query'],_0x139386[_0x5da0('0x3d')]));_0x162bec[_0x5da0('0x3c')][_0x5da0('0x57')]=_0x53d4c4['id'];if(_0x21e2f3[_0x5da0('0x32')][_0x5da0('0x3f')]){_0x162bec[_0x5da0('0x3c')]=_[_0x5da0('0x58')](_0x162bec[_0x5da0('0x3c')],{'$or':_[_0x5da0('0x59')](_0x162bec[_0x5da0('0x37')],function(_0x294f52){var _0xa0c28={};_0xa0c28[_0x294f52]={'$like':'%'+_0x21e2f3[_0x5da0('0x32')][_0x5da0('0x3f')]+'%'};return _0xa0c28;})});}_0x162bec=_['merge']({},_0x162bec,_0x21e2f3['options']);return db[_0x5da0('0x56')][_0x5da0('0x45')](_0x162bec);}})[_0x5da0('0x27')](function(_0x3db278){if(_0x3db278){return db[_0x5da0('0x5a')][_0x5da0('0x5b')]({'where':{'id':_[_0x5da0('0x59')](_0x3db278,_0x5da0('0x5c')),'role':_0x5da0('0x5d')},'attributes':['id',_0x5da0('0x31'),_0x5da0('0x5e'),_0x5da0('0x5f'),_0x5da0('0x60')]});}})['then'](function(_0x400f9c){if(_0x400f9c){return{'count':_0x400f9c[_0x5da0('0x23')],'rows':_[_0x5da0('0x59')](_0x400f9c['rows'],function(_0x1de4ee){return{'membername':_0x1de4ee[_0x5da0('0x31')],'UserId':_0x1de4ee['id'],'queue_name':_0x3fe667[_0x5da0('0x31')],'WhatsappQueueId':_0x3fe667['id'],'interface':util[_0x5da0('0x61')](_0x5da0('0x62'),_0x5da0('0x63'),_0x1de4ee[_0x5da0('0x31')]),'penalty':0x0,'paused':_0x1de4ee[_0x5da0('0x5e')],'createdAt':_0x1de4ee[_0x5da0('0x60')],'updatedAt':_0x1de4ee[_0x5da0('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3b8a99,_0x162bec))[_0x5da0('0x46')](handleError(_0x3b8a99,null));};exports[_0x5da0('0x64')]=function(_0x4b497c,_0x12ed33,_0x4a41ab){var _0x5752d2={};var _0x7e4157={};var _0x3ceadb;var _0xe754dc;return db[_0x5da0('0x42')]['findOne']({'where':{'id':_0x4b497c[_0x5da0('0x48')]['id']}})['then'](handleEntityNotFound(_0x12ed33,null))[_0x5da0('0x27')](function(_0x45a492){if(_0x45a492){_0x3ceadb=_0x45a492;_0x7e4157[_0x5da0('0x35')]=_[_0x5da0('0x33')](db[_0x5da0('0x65')]['rawAttributes']);_0x7e4157[_0x5da0('0x32')]=_['keys'](_0x4b497c['query']);_0x7e4157[_0x5da0('0x3d')]=_['intersection'](_0x7e4157[_0x5da0('0x35')],_0x7e4157[_0x5da0('0x32')]);_0x5752d2[_0x5da0('0x37')]=_[_0x5da0('0x34')](_0x7e4157['model'],qs['fields'](_0x4b497c[_0x5da0('0x32')][_0x5da0('0x36')]));_0x5752d2[_0x5da0('0x37')]=_0x5752d2[_0x5da0('0x37')][_0x5da0('0x49')]?_0x5752d2[_0x5da0('0x37')]:_0x7e4157[_0x5da0('0x35')];_0x5752d2[_0x5da0('0x3a')]=qs['sort'](_0x4b497c['query'][_0x5da0('0x3b')]);_0x5752d2[_0x5da0('0x3c')]=qs['filters'](_['pick'](_0x4b497c['query'],_0x7e4157[_0x5da0('0x3d')]));if(_0x4b497c[_0x5da0('0x32')][_0x5da0('0x3f')]){_0x5752d2['where']=_['merge'](_0x5752d2[_0x5da0('0x3c')],{'$or':_['map'](_0x5752d2['attributes'],function(_0x5a80e4){var _0x2236ff={};_0x2236ff[_0x5a80e4]={'$like':'%'+_0x4b497c[_0x5da0('0x32')][_0x5da0('0x3f')]+'%'};return _0x2236ff;})});}_0x5752d2=_[_0x5da0('0x58')]({},_0x5752d2,_0x4b497c[_0x5da0('0x66')]);return _0x3ceadb[_0x5da0('0x64')](_0x5752d2);}})[_0x5da0('0x27')](function(_0xe6a110){if(_0xe6a110){_0xe754dc=_0xe6a110[_0x5da0('0x49')];if(!_0x4b497c[_0x5da0('0x32')][_0x5da0('0x38')]('nolimit')){_0x5752d2[_0x5da0('0x22')]=qs['limit'](_0x4b497c[_0x5da0('0x32')]['limit']);_0x5752d2[_0x5da0('0x20')]=qs[_0x5da0('0x20')](_0x4b497c[_0x5da0('0x32')]['offset']);}return _0x3ceadb['getTeams'](_0x5752d2);}})['then'](function(_0x37494e){if(_0x37494e){return _0x37494e?{'count':_0xe754dc,'rows':_0x37494e}:null;}})[_0x5da0('0x27')](respondWithResult(_0x12ed33,null))[_0x5da0('0x46')](handleError(_0x12ed33,null));};exports[_0x5da0('0x67')]=function(_0x1f48dc,_0x26d37c,_0x558583){var _0x3a975a=_0x1f48dc['body'][_0x5da0('0x68')];return db[_0x5da0('0x65')][_0x5da0('0x45')]({'where':{'id':_0x3a975a},'attributes':['id'],'include':[{'model':db[_0x5da0('0x5a')],'as':'Agents','attributes':['id',_0x5da0('0x31'),_0x5da0('0x69'),_0x5da0('0x6a'),_0x5da0('0x6b')],'raw':!![]}]})[_0x5da0('0x27')](function(_0x1d9114){if(_0x1d9114){var _0x2a279a=_[_0x5da0('0x6c')](_0x1d9114,function(_0x3293a4){var _0x4371a0=_0x3293a4[_0x5da0('0x29')]({'plain':!![]});return _0x4371a0[_0x5da0('0x6d')];});return db[_0x5da0('0x42')]['find']({'where':{'id':_0x1f48dc[_0x5da0('0x48')]['id']}})['then'](function(_0x8cf0ba){return db[_0x5da0('0x6e')][_0x5da0('0x6f')](function(_0x9f5594){return _0x8cf0ba[_0x5da0('0x67')](_0x3a975a,{'transaction':_0x9f5594})[_0x5da0('0x27')](function(){return BPromise[_0x5da0('0x70')](_0x2a279a,function(_0x5b240d){return db[_0x5da0('0x56')]['findOrCreate']({'where':{'UserId':_0x5b240d['id'],'WhatsappQueueId':_0x1f48dc[_0x5da0('0x48')]['id']},'transaction':_0x9f5594});});})['then'](function(){_0x2a279a[_0x5da0('0x71')](function(_0x506bf1){socket[_0x5da0('0x72')](_0x5da0('0x73'),{'UserId':_0x506bf1['id'],'WhatsappQueueId':_0x8cf0ba['id']});});});});});}})[_0x5da0('0x27')](respondWithStatusCode(_0x26d37c,null))[_0x5da0('0x46')](handleError(_0x26d37c,null));};exports['removeTeams']=function(_0x40b4f5,_0xa8f30b,_0x42f228){return db[_0x5da0('0x65')][_0x5da0('0x45')]({'where':{'id':_0x40b4f5['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5da0('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x5da0('0x27')](handleEntityNotFound(_0xa8f30b,null))['then'](function(_0x36073f){var _0x3d8410=_['map'](_0x36073f,'id');var _0x8ff4b9=[];var _0x3d273a=[];var _0x199ed1=squel[_0x5da0('0x74')]();_0x199ed1['field'](_0x5da0('0x75'))[_0x5da0('0x76')](_0x5da0('0x77'),'tq')[_0x5da0('0x78')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x5da0('0x79'),_0x40b4f5[_0x5da0('0x48')]['id']);for(var _0x102472=0x0;_0x102472<_0x36073f['length'];_0x102472+=0x1){let _0x4c48e6=_0x36073f[_0x102472];for(var _0xe3679b=0x0;_0xe3679b<_0x4c48e6['Agents'][_0x5da0('0x49')];_0xe3679b+=0x1){let _0x22789b=_0x4c48e6[_0x5da0('0x6d')][_0xe3679b];var _0x2c873a=_0x199ed1[_0x5da0('0x7a')]();_0x2c873a[_0x5da0('0x3c')](_0x5da0('0x7b'),_0x22789b['id']);_0x3d273a['push'](db[_0x5da0('0x6e')][_0x5da0('0x32')](_0x2c873a[_0x5da0('0x7c')](),{'type':db[_0x5da0('0x6e')][_0x5da0('0x7d')][_0x5da0('0x7e')]})[_0x5da0('0x27')](function(_0x27333d){if(_0x27333d[_0x5da0('0x49')]===0x1){return _0x22789b['id'];}else{var _0x306ff6=_[_0x5da0('0x7f')](_[_0x5da0('0x59')](_0x27333d,_0x5da0('0x80')),function(_0x1ba896){return _[_0x5da0('0x81')](_0x3d8410,_0x1ba896);});if(_0x306ff6){return _0x22789b['id'];}}}));}}return BPromise[_0x5da0('0x82')](_0x3d273a)[_0x5da0('0x27')](function(_0x3c6a8d){_0x8ff4b9=_(_0x8ff4b9)['union'](_0x3c6a8d)[_0x5da0('0x83')]()[_0x5da0('0x84')]();return db['WhatsappQueue']['find']({'where':{'id':_0x40b4f5[_0x5da0('0x48')]['id']}})[_0x5da0('0x27')](function(_0x5ecef7){return db[_0x5da0('0x6e')]['transaction'](function(_0x5ccedd){return _0x5ecef7['removeTeams'](_0x40b4f5[_0x5da0('0x32')][_0x5da0('0x68')],{'transaction':_0x5ccedd})['then'](function(){if(!_[_0x5da0('0x85')](_0x8ff4b9)){return _0x5ecef7[_0x5da0('0x86')](_0x8ff4b9,{'transaction':_0x5ccedd});}})[_0x5da0('0x27')](function(){_0x8ff4b9[_0x5da0('0x71')](function(_0x53c08a){socket[_0x5da0('0x72')](_0x5da0('0x87'),{'UserId':_0x53c08a,'WhatsappQueueId':_0x5ecef7['id']});});});});});});})['then'](respondWithStatusCode(_0xa8f30b,null))[_0x5da0('0x46')](handleError(_0xa8f30b,null));};exports['addAgents']=function(_0x2f7bde,_0x1b615f,_0x4e6988){return db[_0x5da0('0x42')][_0x5da0('0x4f')]({'where':{'id':_0x2f7bde[_0x5da0('0x48')]['id']}})[_0x5da0('0x27')](handleEntityNotFound(_0x1b615f,null))[_0x5da0('0x27')](function(_0x1d6aa3){if(_0x1d6aa3){return _0x1d6aa3[_0x5da0('0x88')](_0x2f7bde['body'][_0x5da0('0x68')],_[_0x5da0('0x89')](_0x2f7bde[_0x5da0('0x4a')],[_0x5da0('0x68'),'id'])||{})[_0x5da0('0x8a')](function(_0x45cb06){for(var _0x57bc31=0x0;_0x57bc31<_0x2f7bde['body'][_0x5da0('0x68')][_0x5da0('0x49')];_0x57bc31+=0x1){socket['emit'](_0x5da0('0x73'),{'UserId':Number(_0x2f7bde[_0x5da0('0x4a')]['ids'][_0x57bc31]),'WhatsappQueueId':Number(_0x2f7bde['params']['id'])});}return _0x45cb06;});}})[_0x5da0('0x27')](respondWithResult(_0x1b615f,null))[_0x5da0('0x46')](handleError(_0x1b615f,null));};exports[_0x5da0('0x86')]=function(_0x5dddee,_0x319362,_0x1c47a7){return db['WhatsappQueue'][_0x5da0('0x4f')]({'where':{'id':_0x5dddee[_0x5da0('0x48')]['id']}})[_0x5da0('0x27')](handleEntityNotFound(_0x319362,null))[_0x5da0('0x27')](function(_0x537f70){if(_0x537f70){return _0x537f70[_0x5da0('0x86')](_0x5dddee[_0x5da0('0x32')][_0x5da0('0x68')])[_0x5da0('0x27')](function(){if(_[_0x5da0('0x8b')](_0x5dddee['query'][_0x5da0('0x68')])){for(var _0x24d042=0x0;_0x24d042<_0x5dddee[_0x5da0('0x32')]['ids'][_0x5da0('0x49')];_0x24d042+=0x1){socket[_0x5da0('0x72')](_0x5da0('0x87'),{'UserId':Number(_0x5dddee[_0x5da0('0x32')][_0x5da0('0x68')][_0x24d042]),'WhatsappQueueId':Number(_0x5dddee[_0x5da0('0x48')]['id'])});}}else{socket[_0x5da0('0x72')](_0x5da0('0x87'),{'UserId':Number(_0x5dddee[_0x5da0('0x32')][_0x5da0('0x68')]),'WhatsappQueueId':Number(_0x5dddee[_0x5da0('0x48')]['id'])});}});}})[_0x5da0('0x27')](respondWithStatusCode(_0x319362,null))[_0x5da0('0x46')](handleError(_0x319362,null));};exports[_0x5da0('0x8c')]=function(_0x127814,_0x298844,_0x9fba24){var _0x311ce6={};var _0x3af337={};var _0x560061;var _0x4d450b;return db['WhatsappQueue']['findOne']({'where':{'id':_0x127814['params']['id']}})['then'](handleEntityNotFound(_0x298844,null))[_0x5da0('0x27')](function(_0x5c0865){if(_0x5c0865){_0x560061=_0x5c0865;_0x3af337[_0x5da0('0x35')]=_[_0x5da0('0x33')](db[_0x5da0('0x5a')][_0x5da0('0x2f')]);_0x3af337[_0x5da0('0x32')]=_[_0x5da0('0x33')](_0x127814['query']);_0x3af337[_0x5da0('0x3d')]=_['intersection'](_0x3af337[_0x5da0('0x35')],_0x3af337[_0x5da0('0x32')]);_0x311ce6[_0x5da0('0x37')]=_[_0x5da0('0x34')](_0x3af337[_0x5da0('0x35')],qs['fields'](_0x127814[_0x5da0('0x32')]['fields']));_0x311ce6[_0x5da0('0x37')]=_0x311ce6[_0x5da0('0x37')][_0x5da0('0x49')]?_0x311ce6['attributes']:_0x3af337[_0x5da0('0x35')];_0x311ce6[_0x5da0('0x3a')]=qs['sort'](_0x127814[_0x5da0('0x32')][_0x5da0('0x3b')]);_0x311ce6[_0x5da0('0x3c')]=qs[_0x5da0('0x3d')](_[_0x5da0('0x3e')](_0x127814[_0x5da0('0x32')],_0x3af337[_0x5da0('0x3d')]));if(_0x127814['query'][_0x5da0('0x3f')]){_0x311ce6['where']=_[_0x5da0('0x58')](_0x311ce6[_0x5da0('0x3c')],{'$or':_[_0x5da0('0x59')](_0x311ce6[_0x5da0('0x37')],function(_0x2e9d84){var _0x1b9ea2={};_0x1b9ea2[_0x2e9d84]={'$like':'%'+_0x127814[_0x5da0('0x32')]['filter']+'%'};return _0x1b9ea2;})});}_0x311ce6=_[_0x5da0('0x58')]({},_0x311ce6,_0x127814['options']);return _0x560061['getAgents'](_0x311ce6);}})[_0x5da0('0x27')](function(_0x54b119){if(_0x54b119){_0x4d450b=_0x54b119[_0x5da0('0x49')];if(!_0x127814['query'][_0x5da0('0x38')](_0x5da0('0x39'))){_0x311ce6[_0x5da0('0x22')]=qs[_0x5da0('0x22')](_0x127814[_0x5da0('0x32')][_0x5da0('0x22')]);_0x311ce6[_0x5da0('0x20')]=qs[_0x5da0('0x20')](_0x127814['query'][_0x5da0('0x20')]);}return _0x560061[_0x5da0('0x8c')](_0x311ce6);}})[_0x5da0('0x27')](function(_0x5f4676){if(_0x5f4676){return _0x5f4676?{'count':_0x4d450b,'rows':_0x5f4676}:null;}})[_0x5da0('0x27')](respondWithResult(_0x298844,null))[_0x5da0('0x46')](handleError(_0x298844,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index c906c33..8cffa3d 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 _0x868e=['hook','exports','events','../../mysqldb','WhatsappQueue','emit'];(function(_0x167307,_0x5a60ae){var _0x550140=function(_0x5b5009){while(--_0x5b5009){_0x167307['push'](_0x167307['shift']());}};_0x550140(++_0x5a60ae);}(_0x868e,0x1c4));var _0xe868=function(_0x151557,_0x2d8a82){_0x151557=_0x151557-0x0;var _0x9123c5=_0x868e[_0x151557];return _0x9123c5;};'use strict';var EventEmitter=require(_0xe868('0x0'));var WhatsappQueue=require(_0xe868('0x1'))['db'][_0xe868('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb6d04){return function(_0x28faa1,_0x237f2e,_0x11aefe){WhatsappQueueEvents[_0xe868('0x3')](_0xb6d04+':'+_0x28faa1['id'],_0x28faa1);WhatsappQueueEvents['emit'](_0xb6d04,_0x28faa1);_0x11aefe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xe868('0x4')](e,emitEvent(event));}}module[_0xe868('0x5')]=WhatsappQueueEvents; \ No newline at end of file +var _0x14da=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x22b731,_0x30c168){var _0x1855af=function(_0x863865){while(--_0x863865){_0x22b731['push'](_0x22b731['shift']());}};_0x1855af(++_0x30c168);}(_0x14da,0x196));var _0xa14d=function(_0x14f89e,_0x139fce){_0x14f89e=_0x14f89e-0x0;var _0x26092d=_0x14da[_0x14f89e];return _0x26092d;};'use strict';var EventEmitter=require(_0xa14d('0x0'));var WhatsappQueue=require(_0xa14d('0x1'))['db'][_0xa14d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa14d('0x3')](0x0);var events={'afterCreate':_0xa14d('0x4'),'afterUpdate':_0xa14d('0x5'),'afterDestroy':_0xa14d('0x6')};function emitEvent(_0x301d6a){return function(_0x3c4ece,_0x5708fc,_0xd05972){WhatsappQueueEvents[_0xa14d('0x7')](_0x301d6a+':'+_0x3c4ece['id'],_0x3c4ece);WhatsappQueueEvents[_0xa14d('0x7')](_0x301d6a,_0x3c4ece);_0xd05972(null);};}for(var e in events){if(events[_0xa14d('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xa14d('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 392b6b4..0400c54 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 _0xcfc0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0xcfc0,0x173));var _0x0cfc=function(_0x34eb98,_0x1258ea){_0x34eb98=_0x34eb98-0x0;var _0x1f98b9=_0xcfc0[_0x34eb98];return _0x1f98b9;};'use strict';var _=require(_0x0cfc('0x0'));var util=require('util');var logger=require(_0x0cfc('0x1'))(_0x0cfc('0x2'));var moment=require(_0x0cfc('0x3'));var BPromise=require(_0x0cfc('0x4'));var rp=require(_0x0cfc('0x5'));var fs=require('fs');var path=require(_0x0cfc('0x6'));var rimraf=require(_0x0cfc('0x7'));var config=require(_0x0cfc('0x8'));var attributes=require(_0x0cfc('0x9'));module['exports']=function(_0x1aa2df,_0x492829){return _0x1aa2df['define'](_0x0cfc('0xa'),attributes,{'tableName':_0x0cfc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7476=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x548090,_0x1101ef){var _0x1e649b=function(_0xe711af){while(--_0xe711af){_0x548090['push'](_0x548090['shift']());}};_0x1e649b(++_0x1101ef);}(_0x7476,0xcf));var _0x6747=function(_0x4bfff5,_0xbd2a67){_0x4bfff5=_0x4bfff5-0x0;var _0x2383bc=_0x7476[_0x4bfff5];return _0x2383bc;};'use strict';var _=require(_0x6747('0x0'));var util=require('util');var logger=require(_0x6747('0x1'))(_0x6747('0x2'));var moment=require(_0x6747('0x3'));var BPromise=require(_0x6747('0x4'));var rp=require(_0x6747('0x5'));var fs=require('fs');var path=require(_0x6747('0x6'));var rimraf=require(_0x6747('0x7'));var config=require(_0x6747('0x8'));var attributes=require(_0x6747('0x9'));module[_0x6747('0xa')]=function(_0x1193e3,_0x277954){return _0x1193e3['define'](_0x6747('0xb'),attributes,{'tableName':_0x6747('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 ec31477..7468048 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 _0x5bf1=['attributes','include','map','model','then','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappQueue,\x20%s,\x20%s','message','catch','WhatsappQueue','findAll','options','raw','where'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5bf1,0x161));var _0x15bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x15bf('0x0'));var util=require(_0x15bf('0x1'));var moment=require(_0x15bf('0x2'));var BPromise=require(_0x15bf('0x3'));var rs=require(_0x15bf('0x4'));var fs=require('fs');var Redis=require(_0x15bf('0x5'));var db=require(_0x15bf('0x6'))['db'];var utils=require(_0x15bf('0x7'));var logger=require(_0x15bf('0x8'))(_0x15bf('0x9'));var config=require(_0x15bf('0xa'));var jayson=require(_0x15bf('0xb'));var client=jayson[_0x15bf('0xc')][_0x15bf('0xd')]({'port':0x232a});config[_0x15bf('0xe')]=_['defaults'](config[_0x15bf('0xe')],{'host':_0x15bf('0xf'),'port':0x18eb});var socket=require(_0x15bf('0x10'))(new Redis(config['redis']));require(_0x15bf('0x11'))[_0x15bf('0x12')](socket);function respondWithRpcPromise(_0x20cb63,_0x4e484d,_0x2b0749){return new BPromise(function(_0x480821,_0x25a7bb){return client[_0x15bf('0x13')](_0x20cb63,_0x2b0749)['then'](function(_0xc195b){logger[_0x15bf('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x4e484d,'request\x20sent');logger[_0x15bf('0x15')](_0x15bf('0x16'),_0x4e484d,_0x15bf('0x17'),JSON['stringify'](_0xc195b));if(_0xc195b['error']){if(_0xc195b[_0x15bf('0x18')][_0x15bf('0x19')]===0x1f4){logger[_0x15bf('0x18')](_0x15bf('0x1a'),_0x4e484d,_0xc195b[_0x15bf('0x18')][_0x15bf('0x1b')]);return _0x25a7bb(_0xc195b[_0x15bf('0x18')][_0x15bf('0x1b')]);}logger['error'](_0x15bf('0x1a'),_0x4e484d,_0xc195b[_0x15bf('0x18')]['message']);return _0x480821(_0xc195b[_0x15bf('0x18')][_0x15bf('0x1b')]);}else{logger['info'](_0x15bf('0x1a'),_0x4e484d,_0x15bf('0x17'));_0x480821(_0xc195b['result']['message']);}})[_0x15bf('0x1c')](function(_0x2037f8){logger[_0x15bf('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x4e484d,_0x2037f8);_0x25a7bb(_0x2037f8);});});}exports['GetWhatsappQueue']=function(_0x15c819){var _0x32c7c6=this;return new Promise(function(_0x260122,_0x4a6ba9){return db[_0x15bf('0x1d')][_0x15bf('0x1e')]({'raw':_0x15c819[_0x15bf('0x1f')]?_0x15c819[_0x15bf('0x1f')][_0x15bf('0x20')]===undefined?!![]:![]:!![],'where':_0x15c819[_0x15bf('0x1f')]?_0x15c819['options'][_0x15bf('0x21')]||null:null,'attributes':_0x15c819[_0x15bf('0x1f')]?_0x15c819[_0x15bf('0x1f')][_0x15bf('0x22')]||null:null,'limit':_0x15c819[_0x15bf('0x1f')]?_0x15c819[_0x15bf('0x1f')]['limit']||null:null,'include':_0x15c819['options']?_0x15c819[_0x15bf('0x1f')][_0x15bf('0x23')]?_[_0x15bf('0x24')](_0x15c819['options']['include'],function(_0x4194da){return{'model':db[_0x4194da[_0x15bf('0x25')]],'as':_0x4194da['as'],'attributes':_0x4194da[_0x15bf('0x22')],'include':_0x4194da[_0x15bf('0x23')]?_['map'](_0x4194da['include'],function(_0x33684e){return{'model':db[_0x33684e[_0x15bf('0x25')]],'as':_0x33684e['as'],'attributes':_0x33684e['attributes'],'include':_0x33684e[_0x15bf('0x23')]?_['map'](_0x33684e[_0x15bf('0x23')],function(_0xc4d1e1){return{'model':db[_0xc4d1e1[_0x15bf('0x25')]],'as':_0xc4d1e1['as'],'attributes':_0xc4d1e1[_0x15bf('0x22')]};}):[]};}):[]};}):[]:[]})[_0x15bf('0x26')](function(_0x81ebb1){logger['info'](_0x15bf('0x27'),_0x15c819);logger[_0x15bf('0x15')]('GetWhatsappQueue',_0x15c819,JSON[_0x15bf('0x28')](_0x81ebb1));_0x260122(_0x81ebb1);})[_0x15bf('0x1c')](function(_0x2714a3){logger[_0x15bf('0x18')](_0x15bf('0x27'),_0x2714a3[_0x15bf('0x1b')],_0x15c819);_0x4a6ba9(_0x32c7c6[_0x15bf('0x18')](0x1f4,_0x2714a3[_0x15bf('0x1b')]));});});};exports[_0x15bf('0x29')]=function(_0x5d18ec){var _0x94253d=this;return new Promise(function(_0x23c606,_0x416846){return db['WhatsappQueue'][_0x15bf('0x2a')]({'raw':_0x5d18ec[_0x15bf('0x1f')]?_0x5d18ec[_0x15bf('0x1f')][_0x15bf('0x20')]===undefined?!![]:![]:!![],'where':_0x5d18ec[_0x15bf('0x1f')]?_0x5d18ec[_0x15bf('0x1f')][_0x15bf('0x21')]||null:null,'attributes':_0x5d18ec[_0x15bf('0x1f')]?_0x5d18ec[_0x15bf('0x1f')][_0x15bf('0x22')]||null:null,'include':_0x5d18ec[_0x15bf('0x1f')]?_0x5d18ec[_0x15bf('0x1f')][_0x15bf('0x23')]?_[_0x15bf('0x24')](_0x5d18ec[_0x15bf('0x1f')]['include'],function(_0x58c631){return{'model':db[_0x58c631[_0x15bf('0x25')]],'as':_0x58c631['as'],'attributes':_0x58c631[_0x15bf('0x22')],'include':_0x58c631[_0x15bf('0x23')]?_[_0x15bf('0x24')](_0x58c631['include'],function(_0xc0e21){return{'model':db[_0xc0e21[_0x15bf('0x25')]],'as':_0xc0e21['as'],'attributes':_0xc0e21['attributes'],'include':_0xc0e21[_0x15bf('0x23')]?_['map'](_0xc0e21['include'],function(_0xc7bf){return{'model':db[_0xc7bf[_0x15bf('0x25')]],'as':_0xc7bf['as'],'attributes':_0xc7bf['attributes']};}):[]};}):[]};}):[]:[]})[_0x15bf('0x26')](function(_0x334a5e){logger[_0x15bf('0x14')](_0x15bf('0x29'),_0x5d18ec);logger[_0x15bf('0x15')](_0x15bf('0x29'),_0x5d18ec,JSON[_0x15bf('0x28')](_0x334a5e));_0x23c606(_0x334a5e);})[_0x15bf('0x1c')](function(_0x3ffafa){logger['error'](_0x15bf('0x29'),_0x3ffafa[_0x15bf('0x1b')],_0x5d18ec);_0x416846(_0x94253d[_0x15bf('0x18')](0x1f4,_0x3ffafa['message']));});});}; \ No newline at end of file +var _0x4a27=['attributes','then','stringify','find','where','ShowWhatsappQueue','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','debug','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','limit','include','map','model'];(function(_0x66ef11,_0x42f78b){var _0x318579=function(_0x2532a7){while(--_0x2532a7){_0x66ef11['push'](_0x66ef11['shift']());}};_0x318579(++_0x42f78b);}(_0x4a27,0x1c2));var _0x74a2=function(_0x3d8af7,_0x34bab2){_0x3d8af7=_0x3d8af7-0x0;var _0x224c2b=_0x4a27[_0x3d8af7];return _0x224c2b;};'use strict';var _=require(_0x74a2('0x0'));var util=require('util');var moment=require(_0x74a2('0x1'));var BPromise=require('bluebird');var rs=require(_0x74a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74a2('0x3'))['db'];var utils=require(_0x74a2('0x4'));var logger=require(_0x74a2('0x5'))(_0x74a2('0x6'));var config=require(_0x74a2('0x7'));var jayson=require(_0x74a2('0x8'));var client=jayson[_0x74a2('0x9')]['http']({'port':0x232a});config[_0x74a2('0xa')]=_[_0x74a2('0xb')](config[_0x74a2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74a2('0xa')]));require(_0x74a2('0xc'))['register'](socket);function respondWithRpcPromise(_0x2df626,_0x15922b,_0x3b6a2a){return new BPromise(function(_0x1134d8,_0xa1d3e0){return client[_0x74a2('0xd')](_0x2df626,_0x3b6a2a)['then'](function(_0x5b3dab){logger[_0x74a2('0xe')](_0x74a2('0xf'),_0x15922b,'request\x20sent');logger[_0x74a2('0x10')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x15922b,'request\x20sent',JSON['stringify'](_0x5b3dab));if(_0x5b3dab[_0x74a2('0x11')]){if(_0x5b3dab['error'][_0x74a2('0x12')]===0x1f4){logger[_0x74a2('0x11')](_0x74a2('0xf'),_0x15922b,_0x5b3dab[_0x74a2('0x11')]['message']);return _0xa1d3e0(_0x5b3dab['error'][_0x74a2('0x13')]);}logger[_0x74a2('0x11')](_0x74a2('0xf'),_0x15922b,_0x5b3dab['error']['message']);return _0x1134d8(_0x5b3dab[_0x74a2('0x11')]['message']);}else{logger[_0x74a2('0xe')](_0x74a2('0xf'),_0x15922b,'request\x20sent');_0x1134d8(_0x5b3dab[_0x74a2('0x14')]['message']);}})[_0x74a2('0x15')](function(_0x44d78b){logger[_0x74a2('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x15922b,_0x44d78b);_0xa1d3e0(_0x44d78b);});});}exports[_0x74a2('0x16')]=function(_0x36e670){var _0x531f27=this;return new Promise(function(_0x330cfa,_0x563e7a){return db[_0x74a2('0x17')][_0x74a2('0x18')]({'raw':_0x36e670[_0x74a2('0x19')]?_0x36e670[_0x74a2('0x19')][_0x74a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x36e670[_0x74a2('0x19')]?_0x36e670[_0x74a2('0x19')]['where']||null:null,'attributes':_0x36e670[_0x74a2('0x19')]?_0x36e670['options']['attributes']||null:null,'limit':_0x36e670[_0x74a2('0x19')]?_0x36e670['options'][_0x74a2('0x1b')]||null:null,'include':_0x36e670[_0x74a2('0x19')]?_0x36e670['options'][_0x74a2('0x1c')]?_[_0x74a2('0x1d')](_0x36e670[_0x74a2('0x19')][_0x74a2('0x1c')],function(_0x42721b){return{'model':db[_0x42721b[_0x74a2('0x1e')]],'as':_0x42721b['as'],'attributes':_0x42721b[_0x74a2('0x1f')],'include':_0x42721b[_0x74a2('0x1c')]?_['map'](_0x42721b['include'],function(_0x4ee714){return{'model':db[_0x4ee714[_0x74a2('0x1e')]],'as':_0x4ee714['as'],'attributes':_0x4ee714['attributes'],'include':_0x4ee714[_0x74a2('0x1c')]?_[_0x74a2('0x1d')](_0x4ee714[_0x74a2('0x1c')],function(_0x93d3c4){return{'model':db[_0x93d3c4[_0x74a2('0x1e')]],'as':_0x93d3c4['as'],'attributes':_0x93d3c4['attributes']};}):[]};}):[]};}):[]:[]})[_0x74a2('0x20')](function(_0x46f40e){logger[_0x74a2('0xe')](_0x74a2('0x16'),_0x36e670);logger[_0x74a2('0x10')](_0x74a2('0x16'),_0x36e670,JSON[_0x74a2('0x21')](_0x46f40e));_0x330cfa(_0x46f40e);})[_0x74a2('0x15')](function(_0x593682){logger[_0x74a2('0x11')](_0x74a2('0x16'),_0x593682['message'],_0x36e670);_0x563e7a(_0x531f27[_0x74a2('0x11')](0x1f4,_0x593682[_0x74a2('0x13')]));});});};exports['ShowWhatsappQueue']=function(_0x17e6f0){var _0x3ac27f=this;return new Promise(function(_0x229fd0,_0x2d48e9){return db[_0x74a2('0x17')][_0x74a2('0x22')]({'raw':_0x17e6f0[_0x74a2('0x19')]?_0x17e6f0[_0x74a2('0x19')][_0x74a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x17e6f0[_0x74a2('0x19')]?_0x17e6f0[_0x74a2('0x19')][_0x74a2('0x23')]||null:null,'attributes':_0x17e6f0['options']?_0x17e6f0[_0x74a2('0x19')][_0x74a2('0x1f')]||null:null,'include':_0x17e6f0[_0x74a2('0x19')]?_0x17e6f0[_0x74a2('0x19')][_0x74a2('0x1c')]?_[_0x74a2('0x1d')](_0x17e6f0[_0x74a2('0x19')][_0x74a2('0x1c')],function(_0x474867){return{'model':db[_0x474867[_0x74a2('0x1e')]],'as':_0x474867['as'],'attributes':_0x474867[_0x74a2('0x1f')],'include':_0x474867[_0x74a2('0x1c')]?_[_0x74a2('0x1d')](_0x474867[_0x74a2('0x1c')],function(_0x301cca){return{'model':db[_0x301cca['model']],'as':_0x301cca['as'],'attributes':_0x301cca[_0x74a2('0x1f')],'include':_0x301cca[_0x74a2('0x1c')]?_[_0x74a2('0x1d')](_0x301cca[_0x74a2('0x1c')],function(_0x4c2c36){return{'model':db[_0x4c2c36[_0x74a2('0x1e')]],'as':_0x4c2c36['as'],'attributes':_0x4c2c36[_0x74a2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x74a2('0x20')](function(_0x4bfe88){logger['info']('ShowWhatsappQueue',_0x17e6f0);logger[_0x74a2('0x10')](_0x74a2('0x24'),_0x17e6f0,JSON[_0x74a2('0x21')](_0x4bfe88));_0x229fd0(_0x4bfe88);})[_0x74a2('0x15')](function(_0xda1493){logger[_0x74a2('0x11')](_0x74a2('0x24'),_0xda1493[_0x74a2('0x13')],_0x17e6f0);_0x2d48e9(_0x3ac27f[_0x74a2('0x11')](0x1f4,_0xda1493['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 4a751ab..74783b5 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 _0xf7e4=['whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','register'];(function(_0x12daa3,_0x349957){var _0x3cae0f=function(_0x47e254){while(--_0x47e254){_0x12daa3['push'](_0x12daa3['shift']());}};_0x3cae0f(++_0x349957);}(_0xf7e4,0x182));var _0x4f7e=function(_0x58a27d,_0x5b3a93){_0x58a27d=_0x58a27d-0x0;var _0x2f604d=_0xf7e4[_0x58a27d];return _0x2f604d;};'use strict';var WhatsappQueueEvents=require(_0x4f7e('0x0'));var events=[_0x4f7e('0x1'),_0x4f7e('0x2'),_0x4f7e('0x3')];function createListener(_0x26e554,_0x29a863){return function(_0x5d095b){_0x29a863[_0x4f7e('0x4')](_0x26e554,_0x5d095b);};}function removeListener(_0x2ad77f,_0x3f18b9){return function(){WhatsappQueueEvents['removeListener'](_0x2ad77f,_0x3f18b9);};}exports[_0x4f7e('0x5')]=function(_0x161f39){for(var _0x449bc9=0x0,_0xd26903=events['length'];_0x449bc9<_0xd26903;_0x449bc9++){var _0x4a5aaa=events[_0x449bc9];var _0x15d456=createListener(_0x4f7e('0x6')+_0x4a5aaa,_0x161f39);WhatsappQueueEvents['on'](_0x4a5aaa,_0x15d456);}}; \ No newline at end of file +var _0x3be0=['register','length','whatsappQueue:','update','emit'];(function(_0x15c273,_0x2c4adb){var _0x55ef05=function(_0x2c7c26){while(--_0x2c7c26){_0x15c273['push'](_0x15c273['shift']());}};_0x55ef05(++_0x2c4adb);}(_0x3be0,0xd5));var _0x03be=function(_0x332109,_0x474add){_0x332109=_0x332109-0x0;var _0x7a6ab2=_0x3be0[_0x332109];return _0x7a6ab2;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save','remove',_0x03be('0x0')];function createListener(_0x3d34e4,_0x3c0314){return function(_0xa01dfa){_0x3c0314[_0x03be('0x1')](_0x3d34e4,_0xa01dfa);};}function removeListener(_0x3660d6,_0x748a67){return function(){WhatsappQueueEvents['removeListener'](_0x3660d6,_0x748a67);};}exports[_0x03be('0x2')]=function(_0x33c59b){for(var _0x57f89c=0x0,_0x3e76f9=events[_0x03be('0x3')];_0x57f89c<_0x3e76f9;_0x57f89c++){var _0x549604=events[_0x57f89c];var _0x1ec56b=createListener(_0x03be('0x4')+_0x549604,_0x33c59b);WhatsappQueueEvents['on'](_0x549604,_0x1ec56b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 7b72163..d2433f6 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 _0x8896=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8896,0x165));var _0x6889=function(_0x408d71,_0x2977cb){_0x408d71=_0x408d71-0x0;var _0x108cb7=_0x8896[_0x408d71];return _0x108cb7;};'use strict';var multer=require(_0x6889('0x0'));var util=require('util');var path=require(_0x6889('0x1'));var timeout=require(_0x6889('0x2'));var express=require(_0x6889('0x3'));var router=express[_0x6889('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6889('0x5'));var interaction=require(_0x6889('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0x6889('0x7')]('/',auth[_0x6889('0x8')](),controller['index']);router[_0x6889('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6889('0x9')]);router[_0x6889('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6889('0xa')]);router[_0x6889('0xb')]('/',auth[_0x6889('0x8')](),controller[_0x6889('0xc')]);router[_0x6889('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6889('0xe')]);router[_0x6889('0xf')](_0x6889('0x10'),auth[_0x6889('0x8')](),controller[_0x6889('0x11')]);module[_0x6889('0x12')]=router; \ No newline at end of file +var _0xb6d5=['/describe','describe','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','index'];(function(_0x26c75d,_0x283627){var _0xc219cc=function(_0x1f1cdb){while(--_0x1f1cdb){_0x26c75d['push'](_0x26c75d['shift']());}};_0xc219cc(++_0x283627);}(_0xb6d5,0x13b));var _0x5b6d=function(_0x962edb,_0x5dd356){_0x962edb=_0x962edb-0x0;var _0x359dcf=_0xb6d5[_0x962edb];return _0x359dcf;};'use strict';var multer=require(_0x5b6d('0x0'));var util=require(_0x5b6d('0x1'));var path=require(_0x5b6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x5b6d('0x3'));var router=express['Router']();var fs_extra=require(_0x5b6d('0x4'));var auth=require(_0x5b6d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b6d('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0x5b6d('0x7')]('/',auth['isAuthenticated'](),controller[_0x5b6d('0x8')]);router[_0x5b6d('0x7')](_0x5b6d('0x9'),auth['isAuthenticated'](),controller[_0x5b6d('0xa')]);router[_0x5b6d('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5b6d('0xb')](_0x5b6d('0xc'),auth[_0x5b6d('0xd')](),controller[_0x5b6d('0xe')]);router[_0x5b6d('0xf')](_0x5b6d('0xc'),auth['isAuthenticated'](),controller[_0x5b6d('0x10')]);module[_0x5b6d('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 543e4b2..f48d018 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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x53de8d,_0xb54567){var _0x3dd6f5=function(_0x1c608c){while(--_0x1c608c){_0x53de8d['push'](_0x53de8d['shift']());}};_0x3dd6f5(++_0xb54567);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x471ee2,_0x3d54a2){var _0x38730e=function(_0x2b1597){while(--_0x2b1597){_0x471ee2['push'](_0x471ee2['shift']());}};_0x38730e(++_0x3d54a2);}(_0x7a54,0x106));var _0x47a5=function(_0x19518e,_0x79a0a7){_0x19518e=_0x19518e-0x0;var _0x21bf43=_0x7a54[_0x19518e];return _0x21bf43;};'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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3ab33b1..11ec0a5 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 _0x9348=['save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','WhatsappQueueReport','count','include','findAll','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject'];(function(_0x1b5b05,_0x4ad679){var _0x4825bc=function(_0x3cf5b0){while(--_0x3cf5b0){_0x1b5b05['push'](_0x1b5b05['shift']());}};_0x4825bc(++_0x4ad679);}(_0x9348,0x10d));var _0x8934=function(_0x4cc346,_0x36261a){_0x4cc346=_0x4cc346-0x0;var _0x1ebaff=_0x9348[_0x4cc346];return _0x1ebaff;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];function respondWithStatusCode(_0x4a999c,_0x68427d){_0x68427d=_0x68427d||0xcc;return function(_0x108eab){if(_0x108eab){return _0x4a999c[_0x8934('0x19')](_0x68427d);}return _0x4a999c[_0x8934('0x1a')](_0x68427d)[_0x8934('0x1b')]();};}function respondWithResult(_0xdf59f4,_0x5b560f){_0x5b560f=_0x5b560f||0xc8;return function(_0x254720){if(_0x254720){return _0xdf59f4[_0x8934('0x1a')](_0x5b560f)[_0x8934('0x1c')](_0x254720);}};}function respondWithFilteredResult(_0x94b948,_0x34d4dc){return function(_0x41e6a9){if(_0x41e6a9){var _0x2a5b04=typeof _0x34d4dc[_0x8934('0x1d')]==='undefined'&&typeof _0x34d4dc[_0x8934('0x1e')]===_0x8934('0x1f');var _0x261c78=_0x41e6a9['count'];var _0x47f25e=_0x2a5b04?0x0:_0x34d4dc['offset'];var _0x2ff9ce=_0x2a5b04?_0x41e6a9['count']:_0x34d4dc[_0x8934('0x1d')]+_0x34d4dc[_0x8934('0x1e')];var _0x14b4e4;if(_0x2ff9ce>=_0x261c78){_0x2ff9ce=_0x261c78;_0x14b4e4=0xc8;}else{_0x14b4e4=0xce;}_0x94b948[_0x8934('0x1a')](_0x14b4e4);return _0x94b948[_0x8934('0x20')]('Content-Range',_0x47f25e+'-'+_0x2ff9ce+'/'+_0x261c78)[_0x8934('0x1c')](_0x41e6a9);}return null;};}function patchUpdates(_0x5ae49f){return function(_0x476c6c){try{jsonpatch[_0x8934('0x21')](_0x476c6c,_0x5ae49f,!![]);}catch(_0x1ccbe5){return BPromise[_0x8934('0x22')](_0x1ccbe5);}return _0x476c6c[_0x8934('0x23')]();};}function saveUpdates(_0x331e18,_0x36fe20){return function(_0x4f4a9b){if(_0x4f4a9b){return _0x4f4a9b[_0x8934('0x24')](_0x331e18)[_0x8934('0x25')](function(_0x32020a){return _0x32020a;});}return null;};}function removeEntity(_0x343e09,_0x43b89a){return function(_0x5e593b){if(_0x5e593b){return _0x5e593b[_0x8934('0x26')]()[_0x8934('0x25')](function(){_0x343e09[_0x8934('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cfc2,_0x561df2){return function(_0x14c5f0){if(!_0x14c5f0){_0x16cfc2[_0x8934('0x19')](0x194);}return _0x14c5f0;};}function handleError(_0x110f7f,_0x5ef0ed){_0x5ef0ed=_0x5ef0ed||0x1f4;return function(_0x1fd5eb){logger[_0x8934('0x27')](_0x1fd5eb[_0x8934('0x28')]);if(_0x1fd5eb[_0x8934('0x29')]){delete _0x1fd5eb['name'];}_0x110f7f[_0x8934('0x1a')](_0x5ef0ed)[_0x8934('0x2a')](_0x1fd5eb);};}exports[_0x8934('0x2b')]=function(_0x3d93c7,_0x44972b){var _0x20d448={},_0x3f328a={},_0x457634={'count':0x0,'rows':[]};var _0x9c6a71=_[_0x8934('0x2c')](db['WhatsappQueueReport'][_0x8934('0x2d')],function(_0x3e973e){return{'name':_0x3e973e['fieldName'],'type':_0x3e973e[_0x8934('0x2e')][_0x8934('0x2f')]};});_0x3f328a[_0x8934('0x30')]=_[_0x8934('0x2c')](_0x9c6a71,'name');_0x3f328a[_0x8934('0x31')]=_[_0x8934('0x32')](_0x3d93c7[_0x8934('0x31')]);_0x3f328a[_0x8934('0x33')]=_[_0x8934('0x34')](_0x3f328a['model'],_0x3f328a[_0x8934('0x31')]);_0x20d448['attributes']=_['intersection'](_0x3f328a[_0x8934('0x30')],qs[_0x8934('0x35')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x35')]));_0x20d448['attributes']=_0x20d448[_0x8934('0x36')][_0x8934('0x37')]?_0x20d448[_0x8934('0x36')]:_0x3f328a[_0x8934('0x30')];if(!_0x3d93c7[_0x8934('0x31')]['hasOwnProperty'](_0x8934('0x38'))){_0x20d448[_0x8934('0x1e')]=qs['limit'](_0x3d93c7['query'][_0x8934('0x1e')]);_0x20d448[_0x8934('0x1d')]=qs['offset'](_0x3d93c7['query'][_0x8934('0x1d')]);}_0x20d448[_0x8934('0x39')]=qs[_0x8934('0x3a')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x3a')]);_0x20d448[_0x8934('0x3b')]=qs[_0x8934('0x33')](_[_0x8934('0x3c')](_0x3d93c7[_0x8934('0x31')],_0x3f328a[_0x8934('0x33')]),_0x9c6a71);if(_0x3d93c7[_0x8934('0x31')]['filter']){_0x20d448[_0x8934('0x3b')]=_[_0x8934('0x3d')](_0x20d448['where'],{'$or':_[_0x8934('0x2c')](_0x9c6a71,function(_0x122ad1){if(_0x122ad1[_0x8934('0x2e')]!==_0x8934('0x3e')){var _0xb189f1={};_0xb189f1[_0x122ad1['name']]={'$like':'%'+_0x3d93c7['query']['filter']+'%'};return _0xb189f1;}})});}_0x20d448=_[_0x8934('0x3d')]({},_0x20d448,_0x3d93c7[_0x8934('0x3f')]);var _0x8814f6={'where':_0x20d448['where']};return db[_0x8934('0x40')]['count'](_0x8814f6)['then'](function(_0x332098){_0x457634[_0x8934('0x41')]=_0x332098;if(_0x3d93c7['query']['includeAll']){_0x20d448[_0x8934('0x42')]=[{'all':!![]}];}return db[_0x8934('0x40')][_0x8934('0x43')](_0x20d448);})['then'](function(_0x46bfe7){_0x457634['rows']=_0x46bfe7;return _0x457634;})[_0x8934('0x25')](respondWithFilteredResult(_0x44972b,_0x20d448))['catch'](handleError(_0x44972b,null));};exports[_0x8934('0x44')]=function(_0x476ed9,_0x83be9e){var _0x566d67={'raw':!![],'where':{'id':_0x476ed9[_0x8934('0x45')]['id']}},_0xefdfab={};_0xefdfab[_0x8934('0x30')]=_[_0x8934('0x32')](db['WhatsappQueueReport'][_0x8934('0x2d')]);_0xefdfab[_0x8934('0x31')]=_[_0x8934('0x32')](_0x476ed9[_0x8934('0x31')]);_0xefdfab[_0x8934('0x33')]=_[_0x8934('0x34')](_0xefdfab[_0x8934('0x30')],_0xefdfab[_0x8934('0x31')]);_0x566d67['attributes']=_['intersection'](_0xefdfab['model'],qs[_0x8934('0x35')](_0x476ed9[_0x8934('0x31')]['fields']));_0x566d67[_0x8934('0x36')]=_0x566d67['attributes'][_0x8934('0x37')]?_0x566d67[_0x8934('0x36')]:_0xefdfab['model'];if(_0x476ed9[_0x8934('0x31')][_0x8934('0x46')]){_0x566d67[_0x8934('0x42')]=[{'all':!![]}];}_0x566d67=_[_0x8934('0x3d')]({},_0x566d67,_0x476ed9['options']);return db[_0x8934('0x40')][_0x8934('0x47')](_0x566d67)['then'](handleEntityNotFound(_0x83be9e,null))[_0x8934('0x25')](respondWithResult(_0x83be9e,null))[_0x8934('0x48')](handleError(_0x83be9e,null));};exports[_0x8934('0x49')]=function(_0x2d5c6a,_0x406d0a){return db[_0x8934('0x40')][_0x8934('0x49')](_0x2d5c6a[_0x8934('0x4a')],{})[_0x8934('0x25')](respondWithResult(_0x406d0a,0xc9))[_0x8934('0x48')](handleError(_0x406d0a,null));};exports[_0x8934('0x24')]=function(_0xe212bc,_0x2c322d){if(_0xe212bc[_0x8934('0x4a')]['id']){delete _0xe212bc[_0x8934('0x4a')]['id'];}return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0xe212bc[_0x8934('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x25')](saveUpdates(_0xe212bc[_0x8934('0x4a')],null))['then'](respondWithResult(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));};exports['destroy']=function(_0x4bc431,_0x3610a0){return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0x4bc431['params']['id']}})['then'](handleEntityNotFound(_0x3610a0,null))[_0x8934('0x25')](removeEntity(_0x3610a0,null))['catch'](handleError(_0x3610a0,null));};exports['describe']=function(_0xce93cd,_0x2778f9){return db[_0x8934('0x40')][_0x8934('0x4b')]()[_0x8934('0x25')](respondWithResult(_0x2778f9,null))[_0x8934('0x48')](handleError(_0x2778f9,null));}; \ No newline at end of file +var _0xbfcc=['destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','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','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then'];(function(_0x3f444c,_0x4ef988){var _0x12828a=function(_0x23797d){while(--_0x23797d){_0x3f444c['push'](_0x3f444c['shift']());}};_0x12828a(++_0x4ef988);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0xbfcc[_0x2b4448];return _0xb4b465;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x51284a,_0x280b78){return function(_0x75bca0){if(!_0x75bca0){_0x51284a['sendStatus'](0x194);}return _0x75bca0;};}function handleError(_0x28bdcf,_0x3b73a3){_0x3b73a3=_0x3b73a3||0x1f4;return function(_0x4ab48e){logger[_0xcbfc('0x23')](_0x4ab48e[_0xcbfc('0x24')]);if(_0x4ab48e[_0xcbfc('0x25')]){delete _0x4ab48e[_0xcbfc('0x25')];}_0x28bdcf['status'](_0x3b73a3)[_0xcbfc('0x26')](_0x4ab48e);};}exports[_0xcbfc('0x27')]=function(_0x4f632a,_0x1f6a14){var _0x26463f={},_0x7cbdfa={},_0x388d41={'count':0x0,'rows':[]};var _0x2b4286=_[_0xcbfc('0x28')](db[_0xcbfc('0x29')]['rawAttributes'],function(_0x41b68b){return{'name':_0x41b68b[_0xcbfc('0x2a')],'type':_0x41b68b[_0xcbfc('0x2b')][_0xcbfc('0x2c')]};});_0x7cbdfa['model']=_[_0xcbfc('0x28')](_0x2b4286,_0xcbfc('0x25'));_0x7cbdfa[_0xcbfc('0x2d')]=_[_0xcbfc('0x2e')](_0x4f632a[_0xcbfc('0x2d')]);_0x7cbdfa[_0xcbfc('0x2f')]=_[_0xcbfc('0x30')](_0x7cbdfa['model'],_0x7cbdfa[_0xcbfc('0x2d')]);_0x26463f[_0xcbfc('0x31')]=_['intersection'](_0x7cbdfa[_0xcbfc('0x32')],qs[_0xcbfc('0x33')](_0x4f632a[_0xcbfc('0x2d')]['fields']));_0x26463f['attributes']=_0x26463f['attributes'][_0xcbfc('0x34')]?_0x26463f[_0xcbfc('0x31')]:_0x7cbdfa[_0xcbfc('0x32')];if(!_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x35')](_0xcbfc('0x36'))){_0x26463f[_0xcbfc('0x19')]=qs[_0xcbfc('0x19')](_0x4f632a['query'][_0xcbfc('0x19')]);_0x26463f[_0xcbfc('0x1b')]=qs['offset'](_0x4f632a[_0xcbfc('0x2d')]['offset']);}_0x26463f[_0xcbfc('0x37')]=qs[_0xcbfc('0x38')](_0x4f632a[_0xcbfc('0x2d')]['sort']);_0x26463f[_0xcbfc('0x39')]=qs['filters'](_['pick'](_0x4f632a[_0xcbfc('0x2d')],_0x7cbdfa[_0xcbfc('0x2f')]),_0x2b4286);if(_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3a')]){_0x26463f[_0xcbfc('0x39')]=_[_0xcbfc('0x3b')](_0x26463f[_0xcbfc('0x39')],{'$or':_[_0xcbfc('0x28')](_0x2b4286,function(_0x5cf4fa){if(_0x5cf4fa[_0xcbfc('0x2b')]!=='VIRTUAL'){var _0x15a5c4={};_0x15a5c4[_0x5cf4fa[_0xcbfc('0x25')]]={'$like':'%'+_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3a')]+'%'};return _0x15a5c4;}})});}_0x26463f=_['merge']({},_0x26463f,_0x4f632a['options']);var _0x236b66={'where':_0x26463f[_0xcbfc('0x39')]};return db[_0xcbfc('0x29')][_0xcbfc('0x1c')](_0x236b66)[_0xcbfc('0x21')](function(_0x4aa189){_0x388d41[_0xcbfc('0x1c')]=_0x4aa189;if(_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3c')]){_0x26463f['include']=[{'all':!![]}];}return db[_0xcbfc('0x29')][_0xcbfc('0x3d')](_0x26463f);})[_0xcbfc('0x21')](function(_0x4ca55c){_0x388d41[_0xcbfc('0x3e')]=_0x4ca55c;return _0x388d41;})[_0xcbfc('0x21')](respondWithFilteredResult(_0x1f6a14,_0x26463f))[_0xcbfc('0x3f')](handleError(_0x1f6a14,null));};exports[_0xcbfc('0x40')]=function(_0x102f4f,_0x28447a){var _0x1e14bb={'raw':!![],'where':{'id':_0x102f4f[_0xcbfc('0x41')]['id']}},_0x561544={};_0x561544[_0xcbfc('0x32')]=_['keys'](db[_0xcbfc('0x29')][_0xcbfc('0x42')]);_0x561544[_0xcbfc('0x2d')]=_[_0xcbfc('0x2e')](_0x102f4f[_0xcbfc('0x2d')]);_0x561544[_0xcbfc('0x2f')]=_[_0xcbfc('0x30')](_0x561544[_0xcbfc('0x32')],_0x561544['query']);_0x1e14bb[_0xcbfc('0x31')]=_[_0xcbfc('0x30')](_0x561544[_0xcbfc('0x32')],qs[_0xcbfc('0x33')](_0x102f4f[_0xcbfc('0x2d')][_0xcbfc('0x33')]));_0x1e14bb[_0xcbfc('0x31')]=_0x1e14bb['attributes'][_0xcbfc('0x34')]?_0x1e14bb[_0xcbfc('0x31')]:_0x561544['model'];if(_0x102f4f[_0xcbfc('0x2d')][_0xcbfc('0x3c')]){_0x1e14bb[_0xcbfc('0x43')]=[{'all':!![]}];}_0x1e14bb=_['merge']({},_0x1e14bb,_0x102f4f[_0xcbfc('0x44')]);return db[_0xcbfc('0x29')][_0xcbfc('0x45')](_0x1e14bb)[_0xcbfc('0x21')](handleEntityNotFound(_0x28447a,null))[_0xcbfc('0x21')](respondWithResult(_0x28447a,null))[_0xcbfc('0x3f')](handleError(_0x28447a,null));};exports[_0xcbfc('0x46')]=function(_0x55fc0b,_0x5a87b6){return db[_0xcbfc('0x29')][_0xcbfc('0x46')](_0x55fc0b[_0xcbfc('0x47')],{})[_0xcbfc('0x21')](respondWithResult(_0x5a87b6,0xc9))['catch'](handleError(_0x5a87b6,null));};exports['update']=function(_0x2e89bf,_0xe5c5ef){if(_0x2e89bf[_0xcbfc('0x47')]['id']){delete _0x2e89bf['body']['id'];}return db[_0xcbfc('0x29')][_0xcbfc('0x45')]({'where':{'id':_0x2e89bf[_0xcbfc('0x41')]['id']}})['then'](handleEntityNotFound(_0xe5c5ef,null))[_0xcbfc('0x21')](saveUpdates(_0x2e89bf[_0xcbfc('0x47')],null))[_0xcbfc('0x21')](respondWithResult(_0xe5c5ef,null))[_0xcbfc('0x3f')](handleError(_0xe5c5ef,null));};exports[_0xcbfc('0x22')]=function(_0xd9976d,_0x222b58){return db[_0xcbfc('0x29')][_0xcbfc('0x45')]({'where':{'id':_0xd9976d[_0xcbfc('0x41')]['id']}})['then'](handleEntityNotFound(_0x222b58,null))[_0xcbfc('0x21')](removeEntity(_0x222b58,null))[_0xcbfc('0x3f')](handleError(_0x222b58,null));};exports[_0xcbfc('0x48')]=function(_0x5c2ad9,_0x28ae7f){return db[_0xcbfc('0x29')]['describe']()[_0xcbfc('0x21')](respondWithResult(_0x28ae7f,null))[_0xcbfc('0x3f')](handleError(_0x28ae7f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d58ccf3..c08e284 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 _0x46ca=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x20c462,_0x2c5ae8){var _0x5e172f=function(_0x45ad5b){while(--_0x45ad5b){_0x20c462['push'](_0x20c462['shift']());}};_0x5e172f(++_0x2c5ae8);}(_0x46ca,0x97));var _0xa46c=function(_0x2d892a,_0x59e61a){_0x2d892a=_0x2d892a-0x0;var _0x367765=_0x46ca[_0x2d892a];return _0x367765;};'use strict';var _=require(_0xa46c('0x0'));var util=require(_0xa46c('0x1'));var logger=require(_0xa46c('0x2'))(_0xa46c('0x3'));var moment=require(_0xa46c('0x4'));var BPromise=require(_0xa46c('0x5'));var rp=require(_0xa46c('0x6'));var fs=require('fs');var path=require(_0xa46c('0x7'));var rimraf=require(_0xa46c('0x8'));var config=require(_0xa46c('0x9'));var attributes=require('./whatsappQueueReport.attributes');module[_0xa46c('0xa')]=function(_0x62a333,_0xbfc75e){return _0x62a333[_0xa46c('0xb')](_0xa46c('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa46c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x92b6=['bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api'];(function(_0xe4d6ff,_0x511957){var _0x304414=function(_0x3960e3){while(--_0x3960e3){_0xe4d6ff['push'](_0xe4d6ff['shift']());}};_0x304414(++_0x511957);}(_0x92b6,0x1aa));var _0x692b=function(_0x474f3c,_0x584805){_0x474f3c=_0x474f3c-0x0;var _0x36a36d=_0x92b6[_0x474f3c];return _0x36a36d;};'use strict';var _=require(_0x692b('0x0'));var util=require('util');var logger=require(_0x692b('0x1'))(_0x692b('0x2'));var moment=require('moment');var BPromise=require(_0x692b('0x3'));var rp=require(_0x692b('0x4'));var fs=require('fs');var path=require(_0x692b('0x5'));var rimraf=require('rimraf');var config=require(_0x692b('0x6'));var attributes=require(_0x692b('0x7'));module[_0x692b('0x8')]=function(_0x329497,_0x515d2a){return _0x329497[_0x692b('0x9')](_0x692b('0xa'),attributes,{'tableName':_0x692b('0xb'),'paranoid':![],'indexes':[{'name':_0x692b('0xc'),'fields':[_0x692b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 8f93692..083e888 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 _0x1bac=['debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','where','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x19b4bf,_0x38871d){var _0x36332d=function(_0x1b32d1){while(--_0x1b32d1){_0x19b4bf['push'](_0x19b4bf['shift']());}};_0x36332d(++_0x38871d);}(_0x1bac,0xfa));var _0xc1ba=function(_0x540d4c,_0x23f3dc){_0x540d4c=_0x540d4c-0x0;var _0x2f49f8=_0x1bac[_0x540d4c];return _0x2f49f8;};'use strict';var _=require(_0xc1ba('0x0'));var util=require(_0xc1ba('0x1'));var moment=require(_0xc1ba('0x2'));var BPromise=require(_0xc1ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1ba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1ba('0x5'))(_0xc1ba('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1ba('0x7'));var client=jayson[_0xc1ba('0x8')][_0xc1ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a2b8d,_0x5aaa96,_0x1cd076){return new BPromise(function(_0x16f361,_0x330ceb){return client[_0xc1ba('0xa')](_0x1a2b8d,_0x1cd076)[_0xc1ba('0xb')](function(_0x59217a){logger[_0xc1ba('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5aaa96,_0xc1ba('0xd'));logger[_0xc1ba('0xe')](_0xc1ba('0xf'),_0x5aaa96,'request\x20sent',JSON[_0xc1ba('0x10')](_0x59217a));if(_0x59217a['error']){if(_0x59217a['error'][_0xc1ba('0x11')]===0x1f4){logger[_0xc1ba('0x12')](_0xc1ba('0x13'),_0x5aaa96,_0x59217a[_0xc1ba('0x12')]['message']);return _0x330ceb(_0x59217a['error'][_0xc1ba('0x14')]);}logger['error'](_0xc1ba('0x13'),_0x5aaa96,_0x59217a[_0xc1ba('0x12')]['message']);return _0x16f361(_0x59217a['error'][_0xc1ba('0x14')]);}else{logger[_0xc1ba('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5aaa96,_0xc1ba('0xd'));_0x16f361(_0x59217a[_0xc1ba('0x15')][_0xc1ba('0x14')]);}})[_0xc1ba('0x16')](function(_0x539dd2){logger['error'](_0xc1ba('0x13'),_0x5aaa96,_0x539dd2);_0x330ceb(_0x539dd2);});});}exports['CreateWhatsappQueueReport']=function(_0x572fab){var _0x3427fb=this;return new Promise(function(_0x555f71,_0x58f70d){return db[_0xc1ba('0x17')][_0xc1ba('0x18')](_0x572fab[_0xc1ba('0x19')],{'raw':_0x572fab[_0xc1ba('0x1a')]?_0x572fab[_0xc1ba('0x1a')][_0xc1ba('0x1b')]===undefined?!![]:![]:!![]})[_0xc1ba('0xb')](function(_0x5e36a7){logger[_0xc1ba('0xc')](_0xc1ba('0x1c'),_0x572fab);logger[_0xc1ba('0xe')](_0xc1ba('0x1c'),_0x572fab,JSON['stringify'](_0x5e36a7));_0x555f71(_0x5e36a7);})[_0xc1ba('0x16')](function(_0x1f20e6){logger[_0xc1ba('0x12')](_0xc1ba('0x1c'),_0x1f20e6['message'],_0x572fab);_0x58f70d(_0x3427fb['error'](0x1f4,_0x1f20e6[_0xc1ba('0x14')]));});});};exports[_0xc1ba('0x1d')]=function(_0x13fdf8){var _0x1bf5b1=this;return new Promise(function(_0x44cd1c,_0x5a4b0f){return db[_0xc1ba('0x17')][_0xc1ba('0x1e')](_0x13fdf8[_0xc1ba('0x19')],{'raw':_0x13fdf8[_0xc1ba('0x1a')]?_0x13fdf8[_0xc1ba('0x1a')][_0xc1ba('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13fdf8[_0xc1ba('0x1a')]?_0x13fdf8[_0xc1ba('0x1a')][_0xc1ba('0x1f')]||null:null,'attributes':_0x13fdf8[_0xc1ba('0x1a')]?_0x13fdf8['options']['attributes']||null:null,'limit':_0x13fdf8[_0xc1ba('0x1a')]?_0x13fdf8[_0xc1ba('0x1a')][_0xc1ba('0x20')]||null:null})[_0xc1ba('0xb')](function(_0xc3b1e0){logger[_0xc1ba('0xc')](_0xc1ba('0x1d'),_0x13fdf8);logger[_0xc1ba('0xe')](_0xc1ba('0x1d'),_0x13fdf8,JSON['stringify'](_0xc3b1e0));_0x44cd1c(_0xc3b1e0);})[_0xc1ba('0x16')](function(_0xf9e497){logger[_0xc1ba('0x12')](_0xc1ba('0x1d'),_0xf9e497['message'],_0x13fdf8);_0x5a4b0f(_0x1bf5b1[_0xc1ba('0x12')](0x1f4,_0xf9e497['message']));});});}; \ No newline at end of file +var _0x2e82=['then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','CreateWhatsappQueueReport','body','options','stringify','catch','WhatsappQueueReport','update','raw','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x18a6d8,_0x3125ef){var _0x46fd96=function(_0x273539){while(--_0x273539){_0x18a6d8['push'](_0x18a6d8['shift']());}};_0x46fd96(++_0x3125ef);}(_0x2e82,0x77));var _0x22e8=function(_0x11e056,_0x4042c4){_0x11e056=_0x11e056-0x0;var _0x454b37=_0x2e82[_0x11e056];return _0x454b37;};'use strict';var _=require(_0x22e8('0x0'));var util=require(_0x22e8('0x1'));var moment=require(_0x22e8('0x2'));var BPromise=require(_0x22e8('0x3'));var rs=require(_0x22e8('0x4'));var fs=require('fs');var Redis=require(_0x22e8('0x5'));var db=require(_0x22e8('0x6'))['db'];var utils=require(_0x22e8('0x7'));var logger=require(_0x22e8('0x8'))(_0x22e8('0x9'));var config=require(_0x22e8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x22e8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3087df,_0x7591fd,_0x23d700){return new BPromise(function(_0x4055c3,_0x2a5cc9){return client[_0x22e8('0xc')](_0x3087df,_0x23d700)[_0x22e8('0xd')](function(_0xa6eb5b){logger[_0x22e8('0xe')](_0x22e8('0xf'),_0x7591fd,_0x22e8('0x10'));logger[_0x22e8('0x11')](_0x22e8('0x12'),_0x7591fd,_0x22e8('0x10'),JSON['stringify'](_0xa6eb5b));if(_0xa6eb5b[_0x22e8('0x13')]){if(_0xa6eb5b['error']['code']===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x7591fd,_0xa6eb5b[_0x22e8('0x13')][_0x22e8('0x14')]);return _0x2a5cc9(_0xa6eb5b[_0x22e8('0x13')]['message']);}logger[_0x22e8('0x13')](_0x22e8('0xf'),_0x7591fd,_0xa6eb5b['error'][_0x22e8('0x14')]);return _0x4055c3(_0xa6eb5b[_0x22e8('0x13')][_0x22e8('0x14')]);}else{logger[_0x22e8('0xe')](_0x22e8('0xf'),_0x7591fd,_0x22e8('0x10'));_0x4055c3(_0xa6eb5b['result'][_0x22e8('0x14')]);}})['catch'](function(_0x2f2847){logger[_0x22e8('0x13')](_0x22e8('0xf'),_0x7591fd,_0x2f2847);_0x2a5cc9(_0x2f2847);});});}exports[_0x22e8('0x15')]=function(_0x348e8d){var _0x320b01=this;return new Promise(function(_0x1ea82c,_0x39b474){return db['WhatsappQueueReport']['create'](_0x348e8d[_0x22e8('0x16')],{'raw':_0x348e8d[_0x22e8('0x17')]?_0x348e8d['options']['raw']===undefined?!![]:![]:!![]})[_0x22e8('0xd')](function(_0x3c4662){logger[_0x22e8('0xe')](_0x22e8('0x15'),_0x348e8d);logger[_0x22e8('0x11')]('CreateWhatsappQueueReport',_0x348e8d,JSON[_0x22e8('0x18')](_0x3c4662));_0x1ea82c(_0x3c4662);})[_0x22e8('0x19')](function(_0x525fd8){logger['error']('CreateWhatsappQueueReport',_0x525fd8[_0x22e8('0x14')],_0x348e8d);_0x39b474(_0x320b01[_0x22e8('0x13')](0x1f4,_0x525fd8[_0x22e8('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xadd6d4){var _0x3265cb=this;return new Promise(function(_0x533eab,_0x145ef1){return db[_0x22e8('0x1a')][_0x22e8('0x1b')](_0xadd6d4[_0x22e8('0x16')],{'raw':_0xadd6d4[_0x22e8('0x17')]?_0xadd6d4['options'][_0x22e8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xadd6d4['options']?_0xadd6d4[_0x22e8('0x17')][_0x22e8('0x1d')]||null:null,'attributes':_0xadd6d4[_0x22e8('0x17')]?_0xadd6d4[_0x22e8('0x17')][_0x22e8('0x1e')]||null:null,'limit':_0xadd6d4['options']?_0xadd6d4['options'][_0x22e8('0x1f')]||null:null})['then'](function(_0x2433b6){logger[_0x22e8('0xe')](_0x22e8('0x20'),_0xadd6d4);logger[_0x22e8('0x11')](_0x22e8('0x20'),_0xadd6d4,JSON[_0x22e8('0x18')](_0x2433b6));_0x533eab(_0x2433b6);})[_0x22e8('0x19')](function(_0x27fa08){logger[_0x22e8('0x13')](_0x22e8('0x20'),_0x27fa08[_0x22e8('0x14')],_0xadd6d4);_0x145ef1(_0x3265cb['error'](0x1f4,_0x27fa08[_0x22e8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index ffdaf9c..af6ca8b 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 _0x3314=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','show','post','create','put','/:id','destroy','exports','multer','util'];(function(_0x475cc1,_0x47d951){var _0x15367f=function(_0x3da15e){while(--_0x3da15e){_0x475cc1['push'](_0x475cc1['shift']());}};_0x15367f(++_0x47d951);}(_0x3314,0xf0));var _0x4331=function(_0x21e669,_0x4b32be){_0x21e669=_0x21e669-0x0;var _0x658cce=_0x3314[_0x21e669];return _0x658cce;};'use strict';var multer=require(_0x4331('0x0'));var util=require(_0x4331('0x1'));var path=require(_0x4331('0x2'));var timeout=require(_0x4331('0x3'));var express=require(_0x4331('0x4'));var router=express[_0x4331('0x5')]();var fs_extra=require(_0x4331('0x6'));var auth=require(_0x4331('0x7'));var interaction=require(_0x4331('0x8'));var config=require(_0x4331('0x9'));var controller=require(_0x4331('0xa'));router[_0x4331('0xb')]('/',auth['isAuthenticated'](),controller[_0x4331('0xc')]);router[_0x4331('0xb')](_0x4331('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x4331('0xb')]('/:id',auth[_0x4331('0xe')](),controller[_0x4331('0xf')]);router[_0x4331('0x10')]('/',auth[_0x4331('0xe')](),controller[_0x4331('0x11')]);router[_0x4331('0x12')](_0x4331('0x13'),auth[_0x4331('0xe')](),controller['update']);router['delete']('/:id',auth[_0x4331('0xe')](),controller[_0x4331('0x14')]);module[_0x4331('0x15')]=router; \ No newline at end of file +var _0x0b5b=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x2a0f90,_0x5a3362){var _0x3a520a=function(_0x4f987e){while(--_0x4f987e){_0x2a0f90['push'](_0x2a0f90['shift']());}};_0x3a520a(++_0x5a3362);}(_0x0b5b,0x152));var _0xb0b5=function(_0x5d99eb,_0x298b17){_0x5d99eb=_0x5d99eb-0x0;var _0x5e1e7e=_0x0b5b[_0x5d99eb];return _0x5e1e7e;};'use strict';var multer=require(_0xb0b5('0x0'));var util=require(_0xb0b5('0x1'));var path=require('path');var timeout=require(_0xb0b5('0x2'));var express=require(_0xb0b5('0x3'));var router=express['Router']();var fs_extra=require(_0xb0b5('0x4'));var auth=require(_0xb0b5('0x5'));var interaction=require(_0xb0b5('0x6'));var config=require(_0xb0b5('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xb0b5('0x8')]('/',auth[_0xb0b5('0x9')](),controller[_0xb0b5('0xa')]);router[_0xb0b5('0x8')](_0xb0b5('0xb'),auth[_0xb0b5('0x9')](),controller['describe']);router[_0xb0b5('0x8')](_0xb0b5('0xc'),auth['isAuthenticated'](),controller[_0xb0b5('0xd')]);router[_0xb0b5('0xe')]('/',auth[_0xb0b5('0x9')](),controller[_0xb0b5('0xf')]);router[_0xb0b5('0x10')]('/:id',auth[_0xb0b5('0x9')](),controller[_0xb0b5('0x11')]);router[_0xb0b5('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb0b5('0x13')]);module[_0xb0b5('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index a809166..db63d34 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 _0x263f=['DATE','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x142c86,_0x3179d9){var _0x5a6e05=function(_0x4dfba8){while(--_0x4dfba8){_0x142c86['push'](_0x142c86['shift']());}};_0x5a6e05(++_0x3179d9);}(_0x263f,0x182));var _0xf263=function(_0x3d5693,_0x366839){_0x3d5693=_0x3d5693-0x0;var _0x3610e7=_0x263f[_0x3d5693];return _0x3610e7;};'use strict';var Sequelize=require(_0xf263('0x0'));module[_0xf263('0x1')]={'uniqueid':{'type':Sequelize[_0xf263('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf263('0x3')](_0xf263('0x4'),_0xf263('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf263('0x6')]}}; \ No newline at end of file +var _0x2964=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x494223,_0x2c1f71){var _0xdaf98=function(_0x1f790e){while(--_0x1f790e){_0x494223['push'](_0x494223['shift']());}};_0xdaf98(++_0x2c1f71);}(_0x2964,0x108));var _0x4296=function(_0x5736e2,_0x5004fb){_0x5736e2=_0x5736e2-0x0;var _0x39f7f7=_0x2964[_0x5736e2];return _0x39f7f7;};'use strict';var Sequelize=require(_0x4296('0x0'));module[_0x4296('0x1')]={'uniqueid':{'type':Sequelize[_0x4296('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4296('0x3')](_0x4296('0x4'),_0x4296('0x5'),_0x4296('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4296('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c50dc7f..b50cee0 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 _0x726f=['catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','WhatsappTransferReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','include'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x726f,0x1ca));var _0xf726=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x726f[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xf726('0x0'));var rimraf=require(_0xf726('0x1'));var zipdir=require(_0xf726('0x2'));var jsonpatch=require(_0xf726('0x3'));var rp=require(_0xf726('0x4'));var moment=require(_0xf726('0x5'));var BPromise=require(_0xf726('0x6'));var Mustache=require(_0xf726('0x7'));var util=require(_0xf726('0x8'));var path=require(_0xf726('0x9'));var sox=require(_0xf726('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf726('0xb'));var _=require('lodash');var squel=require(_0xf726('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf726('0xd'));var toCsv=require(_0xf726('0xe'));var querystring=require(_0xf726('0xf'));var Papa=require('papaparse');var Redis=require(_0xf726('0x10'));var authService=require(_0xf726('0x11'));var qs=require(_0xf726('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf726('0x13'));var logger=require(_0xf726('0x14'))('api');var utils=require(_0xf726('0x15'));var config=require(_0xf726('0x16'));var licenseUtil=require(_0xf726('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x80f0bd,_0x3d1c24){_0x3d1c24=_0x3d1c24||0xcc;return function(_0xa6ef02){if(_0xa6ef02){return _0x80f0bd['sendStatus'](_0x3d1c24);}return _0x80f0bd[_0xf726('0x18')](_0x3d1c24)[_0xf726('0x19')]();};}function respondWithResult(_0x441e11,_0x517f52){_0x517f52=_0x517f52||0xc8;return function(_0x648402){if(_0x648402){return _0x441e11[_0xf726('0x18')](_0x517f52)[_0xf726('0x1a')](_0x648402);}};}function respondWithFilteredResult(_0x2376ab,_0x31fc11){return function(_0x56f4fb){if(_0x56f4fb){var _0x15b294=typeof _0x31fc11[_0xf726('0x1b')]===_0xf726('0x1c')&&typeof _0x31fc11[_0xf726('0x1d')]===_0xf726('0x1c');var _0x4d1bf5=_0x56f4fb[_0xf726('0x1e')];var _0x1d1f38=_0x15b294?0x0:_0x31fc11[_0xf726('0x1b')];var _0x18f98a=_0x15b294?_0x56f4fb['count']:_0x31fc11[_0xf726('0x1b')]+_0x31fc11['limit'];var _0x38b4fb;if(_0x18f98a>=_0x4d1bf5){_0x18f98a=_0x4d1bf5;_0x38b4fb=0xc8;}else{_0x38b4fb=0xce;}_0x2376ab[_0xf726('0x18')](_0x38b4fb);return _0x2376ab[_0xf726('0x1f')](_0xf726('0x20'),_0x1d1f38+'-'+_0x18f98a+'/'+_0x4d1bf5)['json'](_0x56f4fb);}return null;};}function patchUpdates(_0x5f1736){return function(_0x20bbce){try{jsonpatch[_0xf726('0x21')](_0x20bbce,_0x5f1736,!![]);}catch(_0x5b73db){return BPromise[_0xf726('0x22')](_0x5b73db);}return _0x20bbce[_0xf726('0x23')]();};}function saveUpdates(_0xbaac64,_0x377dd1){return function(_0x3bf3b5){if(_0x3bf3b5){return _0x3bf3b5[_0xf726('0x24')](_0xbaac64)[_0xf726('0x25')](function(_0x13ebce){return _0x13ebce;});}return null;};}function removeEntity(_0x53f071,_0x37a921){return function(_0x35ac1a){if(_0x35ac1a){return _0x35ac1a[_0xf726('0x26')]()[_0xf726('0x25')](function(){_0x53f071[_0xf726('0x18')](0xcc)[_0xf726('0x19')]();});}};}function handleEntityNotFound(_0x375f6e,_0x14c454){return function(_0x5566d8){if(!_0x5566d8){_0x375f6e[_0xf726('0x27')](0x194);}return _0x5566d8;};}function handleError(_0x3a594f,_0x2a8052){_0x2a8052=_0x2a8052||0x1f4;return function(_0x35ced5){logger[_0xf726('0x28')](_0x35ced5[_0xf726('0x29')]);if(_0x35ced5[_0xf726('0x2a')]){delete _0x35ced5['name'];}_0x3a594f[_0xf726('0x18')](_0x2a8052)['send'](_0x35ced5);};}exports[_0xf726('0x2b')]=function(_0x3a07be,_0x50f0f8){var _0x1a2325={},_0x55cbe0={},_0x2dead5={'count':0x0,'rows':[]};var _0x3eee87=_['map'](db[_0xf726('0x2c')][_0xf726('0x2d')],function(_0x51a370){return{'name':_0x51a370['fieldName'],'type':_0x51a370[_0xf726('0x2e')][_0xf726('0x2f')]};});_0x55cbe0[_0xf726('0x30')]=_['map'](_0x3eee87,_0xf726('0x2a'));_0x55cbe0[_0xf726('0x31')]=_[_0xf726('0x32')](_0x3a07be[_0xf726('0x31')]);_0x55cbe0['filters']=_['intersection'](_0x55cbe0['model'],_0x55cbe0['query']);_0x1a2325[_0xf726('0x33')]=_[_0xf726('0x34')](_0x55cbe0[_0xf726('0x30')],qs['fields'](_0x3a07be[_0xf726('0x31')][_0xf726('0x35')]));_0x1a2325[_0xf726('0x33')]=_0x1a2325['attributes'][_0xf726('0x36')]?_0x1a2325[_0xf726('0x33')]:_0x55cbe0[_0xf726('0x30')];if(!_0x3a07be[_0xf726('0x31')]['hasOwnProperty'](_0xf726('0x37'))){_0x1a2325['limit']=qs[_0xf726('0x1d')](_0x3a07be[_0xf726('0x31')][_0xf726('0x1d')]);_0x1a2325[_0xf726('0x1b')]=qs[_0xf726('0x1b')](_0x3a07be[_0xf726('0x31')][_0xf726('0x1b')]);}_0x1a2325[_0xf726('0x38')]=qs[_0xf726('0x39')](_0x3a07be['query'][_0xf726('0x39')]);_0x1a2325[_0xf726('0x3a')]=qs['filters'](_[_0xf726('0x3b')](_0x3a07be['query'],_0x55cbe0[_0xf726('0x3c')]),_0x3eee87);if(_0x3a07be[_0xf726('0x31')][_0xf726('0x3d')]){_0x1a2325[_0xf726('0x3a')]=_[_0xf726('0x3e')](_0x1a2325[_0xf726('0x3a')],{'$or':_[_0xf726('0x3f')](_0x3eee87,function(_0x1448df){if(_0x1448df[_0xf726('0x2e')]!==_0xf726('0x40')){var _0x44d748={};_0x44d748[_0x1448df[_0xf726('0x2a')]]={'$like':'%'+_0x3a07be[_0xf726('0x31')]['filter']+'%'};return _0x44d748;}})});}_0x1a2325=_['merge']({},_0x1a2325,_0x3a07be[_0xf726('0x41')]);var _0xd9427a={'where':_0x1a2325[_0xf726('0x3a')]};return db[_0xf726('0x2c')][_0xf726('0x1e')](_0xd9427a)[_0xf726('0x25')](function(_0x4ffb52){_0x2dead5['count']=_0x4ffb52;if(_0x3a07be[_0xf726('0x31')]['includeAll']){_0x1a2325[_0xf726('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x1a2325);})[_0xf726('0x25')](function(_0x2c8502){_0x2dead5['rows']=_0x2c8502;return _0x2dead5;})[_0xf726('0x25')](respondWithFilteredResult(_0x50f0f8,_0x1a2325))[_0xf726('0x43')](handleError(_0x50f0f8,null));};exports[_0xf726('0x44')]=function(_0x5b02c0,_0x5128cf){var _0x319025={'raw':!![],'where':{'id':_0x5b02c0[_0xf726('0x45')]['id']}},_0x42229c={};_0x42229c['model']=_[_0xf726('0x32')](db[_0xf726('0x2c')][_0xf726('0x2d')]);_0x42229c[_0xf726('0x31')]=_[_0xf726('0x32')](_0x5b02c0[_0xf726('0x31')]);_0x42229c['filters']=_[_0xf726('0x34')](_0x42229c[_0xf726('0x30')],_0x42229c[_0xf726('0x31')]);_0x319025[_0xf726('0x33')]=_[_0xf726('0x34')](_0x42229c[_0xf726('0x30')],qs[_0xf726('0x35')](_0x5b02c0['query'][_0xf726('0x35')]));_0x319025['attributes']=_0x319025[_0xf726('0x33')][_0xf726('0x36')]?_0x319025[_0xf726('0x33')]:_0x42229c[_0xf726('0x30')];if(_0x5b02c0[_0xf726('0x31')][_0xf726('0x46')]){_0x319025[_0xf726('0x42')]=[{'all':!![]}];}_0x319025=_['merge']({},_0x319025,_0x5b02c0[_0xf726('0x41')]);return db['WhatsappTransferReport'][_0xf726('0x47')](_0x319025)[_0xf726('0x25')](handleEntityNotFound(_0x5128cf,null))[_0xf726('0x25')](respondWithResult(_0x5128cf,null))[_0xf726('0x43')](handleError(_0x5128cf,null));};exports['create']=function(_0x214df3,_0x54cb73){return db[_0xf726('0x2c')][_0xf726('0x48')](_0x214df3[_0xf726('0x49')],{})['then'](respondWithResult(_0x54cb73,0xc9))[_0xf726('0x43')](handleError(_0x54cb73,null));};exports['update']=function(_0x47488f,_0xcf1444){if(_0x47488f[_0xf726('0x49')]['id']){delete _0x47488f[_0xf726('0x49')]['id'];}return db[_0xf726('0x2c')][_0xf726('0x47')]({'where':{'id':_0x47488f[_0xf726('0x45')]['id']}})[_0xf726('0x25')](handleEntityNotFound(_0xcf1444,null))['then'](saveUpdates(_0x47488f[_0xf726('0x49')],null))[_0xf726('0x25')](respondWithResult(_0xcf1444,null))[_0xf726('0x43')](handleError(_0xcf1444,null));};exports[_0xf726('0x26')]=function(_0x26d16d,_0x13b576){return db[_0xf726('0x2c')][_0xf726('0x47')]({'where':{'id':_0x26d16d[_0xf726('0x45')]['id']}})['then'](handleEntityNotFound(_0x13b576,null))[_0xf726('0x25')](removeEntity(_0x13b576,null))[_0xf726('0x43')](handleError(_0x13b576,null));};exports[_0xf726('0x4a')]=function(_0x277a0d,_0x1b9a13){return db[_0xf726('0x2c')][_0xf726('0x4a')]()[_0xf726('0x25')](respondWithResult(_0x1b9a13,null))['catch'](handleError(_0x1b9a13,null));}; \ No newline at end of file +var _0x8bd6=['map','fieldName','type','key','query','keys','filters','intersection','model','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','WhatsappTransferReport','includeAll','include','findAll','catch','show','params','attributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index'];(function(_0x3fea84,_0x3e832f){var _0x20778a=function(_0x134027){while(--_0x134027){_0x3fea84['push'](_0x3fea84['shift']());}};_0x20778a(++_0x3e832f);}(_0x8bd6,0x1e0));var _0x68bd=function(_0x9128cb,_0x566160){_0x9128cb=_0x9128cb-0x0;var _0x31ead7=_0x8bd6[_0x9128cb];return _0x31ead7;};'use strict';var emlformat=require(_0x68bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68bd('0x1'));var jsonpatch=require(_0x68bd('0x2'));var rp=require(_0x68bd('0x3'));var moment=require(_0x68bd('0x4'));var BPromise=require(_0x68bd('0x5'));var Mustache=require(_0x68bd('0x6'));var util=require(_0x68bd('0x7'));var path=require(_0x68bd('0x8'));var sox=require(_0x68bd('0x9'));var csv=require(_0x68bd('0xa'));var ejs=require(_0x68bd('0xb'));var fs=require('fs');var fs_extra=require(_0x68bd('0xc'));var _=require(_0x68bd('0xd'));var squel=require(_0x68bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x68bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x68bd('0xa'));var querystring=require(_0x68bd('0x10'));var Papa=require(_0x68bd('0x11'));var Redis=require(_0x68bd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x68bd('0x13'));var as=require(_0x68bd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68bd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x68bd('0x16'));var db=require(_0x68bd('0x17'))['db'];function respondWithStatusCode(_0x36d2aa,_0x5e79fe){_0x5e79fe=_0x5e79fe||0xcc;return function(_0x1fc515){if(_0x1fc515){return _0x36d2aa['sendStatus'](_0x5e79fe);}return _0x36d2aa['status'](_0x5e79fe)[_0x68bd('0x18')]();};}function respondWithResult(_0x3becf7,_0x25b939){_0x25b939=_0x25b939||0xc8;return function(_0x123fd5){if(_0x123fd5){return _0x3becf7[_0x68bd('0x19')](_0x25b939)[_0x68bd('0x1a')](_0x123fd5);}};}function respondWithFilteredResult(_0x56f26a,_0x15e865){return function(_0x4d5008){if(_0x4d5008){var _0x3a3832=typeof _0x15e865[_0x68bd('0x1b')]===_0x68bd('0x1c')&&typeof _0x15e865[_0x68bd('0x1d')]===_0x68bd('0x1c');var _0x10bed0=_0x4d5008[_0x68bd('0x1e')];var _0x114e0e=_0x3a3832?0x0:_0x15e865[_0x68bd('0x1b')];var _0x3b8456=_0x3a3832?_0x4d5008[_0x68bd('0x1e')]:_0x15e865[_0x68bd('0x1b')]+_0x15e865['limit'];var _0x3291a8;if(_0x3b8456>=_0x10bed0){_0x3b8456=_0x10bed0;_0x3291a8=0xc8;}else{_0x3291a8=0xce;}_0x56f26a[_0x68bd('0x19')](_0x3291a8);return _0x56f26a[_0x68bd('0x1f')](_0x68bd('0x20'),_0x114e0e+'-'+_0x3b8456+'/'+_0x10bed0)[_0x68bd('0x1a')](_0x4d5008);}return null;};}function patchUpdates(_0x2ef39c){return function(_0x4fbd10){try{jsonpatch[_0x68bd('0x21')](_0x4fbd10,_0x2ef39c,!![]);}catch(_0x31b47f){return BPromise[_0x68bd('0x22')](_0x31b47f);}return _0x4fbd10[_0x68bd('0x23')]();};}function saveUpdates(_0x34e012,_0x46d8d4){return function(_0x12a04e){if(_0x12a04e){return _0x12a04e[_0x68bd('0x24')](_0x34e012)['then'](function(_0x434c97){return _0x434c97;});}return null;};}function removeEntity(_0xe8be41,_0x5dca86){return function(_0xbd7240){if(_0xbd7240){return _0xbd7240[_0x68bd('0x25')]()[_0x68bd('0x26')](function(){_0xe8be41[_0x68bd('0x19')](0xcc)[_0x68bd('0x18')]();});}};}function handleEntityNotFound(_0x2d77c7,_0x119bf7){return function(_0x29438b){if(!_0x29438b){_0x2d77c7[_0x68bd('0x27')](0x194);}return _0x29438b;};}function handleError(_0x45a612,_0x49b096){_0x49b096=_0x49b096||0x1f4;return function(_0x193d15){logger[_0x68bd('0x28')](_0x193d15[_0x68bd('0x29')]);if(_0x193d15['name']){delete _0x193d15[_0x68bd('0x2a')];}_0x45a612['status'](_0x49b096)[_0x68bd('0x2b')](_0x193d15);};}exports[_0x68bd('0x2c')]=function(_0x2835b5,_0x2b2b08){var _0x199718={},_0x253140={},_0x379714={'count':0x0,'rows':[]};var _0x2eeb43=_[_0x68bd('0x2d')](db['WhatsappTransferReport']['rawAttributes'],function(_0x476fa6){return{'name':_0x476fa6[_0x68bd('0x2e')],'type':_0x476fa6[_0x68bd('0x2f')][_0x68bd('0x30')]};});_0x253140['model']=_[_0x68bd('0x2d')](_0x2eeb43,_0x68bd('0x2a'));_0x253140[_0x68bd('0x31')]=_[_0x68bd('0x32')](_0x2835b5[_0x68bd('0x31')]);_0x253140[_0x68bd('0x33')]=_[_0x68bd('0x34')](_0x253140[_0x68bd('0x35')],_0x253140[_0x68bd('0x31')]);_0x199718['attributes']=_[_0x68bd('0x34')](_0x253140['model'],qs[_0x68bd('0x36')](_0x2835b5[_0x68bd('0x31')][_0x68bd('0x36')]));_0x199718['attributes']=_0x199718['attributes'][_0x68bd('0x37')]?_0x199718['attributes']:_0x253140['model'];if(!_0x2835b5[_0x68bd('0x31')]['hasOwnProperty'](_0x68bd('0x38'))){_0x199718[_0x68bd('0x1d')]=qs['limit'](_0x2835b5['query'][_0x68bd('0x1d')]);_0x199718[_0x68bd('0x1b')]=qs['offset'](_0x2835b5[_0x68bd('0x31')][_0x68bd('0x1b')]);}_0x199718[_0x68bd('0x39')]=qs[_0x68bd('0x3a')](_0x2835b5[_0x68bd('0x31')][_0x68bd('0x3a')]);_0x199718['where']=qs[_0x68bd('0x33')](_['pick'](_0x2835b5[_0x68bd('0x31')],_0x253140[_0x68bd('0x33')]),_0x2eeb43);if(_0x2835b5[_0x68bd('0x31')][_0x68bd('0x3b')]){_0x199718[_0x68bd('0x3c')]=_[_0x68bd('0x3d')](_0x199718['where'],{'$or':_[_0x68bd('0x2d')](_0x2eeb43,function(_0x286bf0){if(_0x286bf0[_0x68bd('0x2f')]!==_0x68bd('0x3e')){var _0x21cb55={};_0x21cb55[_0x286bf0[_0x68bd('0x2a')]]={'$like':'%'+_0x2835b5[_0x68bd('0x31')][_0x68bd('0x3b')]+'%'};return _0x21cb55;}})});}_0x199718=_[_0x68bd('0x3d')]({},_0x199718,_0x2835b5['options']);var _0x10eeff={'where':_0x199718['where']};return db[_0x68bd('0x3f')]['count'](_0x10eeff)[_0x68bd('0x26')](function(_0x2eabb7){_0x379714[_0x68bd('0x1e')]=_0x2eabb7;if(_0x2835b5[_0x68bd('0x31')][_0x68bd('0x40')]){_0x199718[_0x68bd('0x41')]=[{'all':!![]}];}return db[_0x68bd('0x3f')][_0x68bd('0x42')](_0x199718);})['then'](function(_0x49bff2){_0x379714['rows']=_0x49bff2;return _0x379714;})[_0x68bd('0x26')](respondWithFilteredResult(_0x2b2b08,_0x199718))[_0x68bd('0x43')](handleError(_0x2b2b08,null));};exports[_0x68bd('0x44')]=function(_0x1209da,_0x207d69){var _0x4f9767={'raw':!![],'where':{'id':_0x1209da[_0x68bd('0x45')]['id']}},_0x13be5e={};_0x13be5e[_0x68bd('0x35')]=_[_0x68bd('0x32')](db[_0x68bd('0x3f')]['rawAttributes']);_0x13be5e[_0x68bd('0x31')]=_['keys'](_0x1209da[_0x68bd('0x31')]);_0x13be5e[_0x68bd('0x33')]=_[_0x68bd('0x34')](_0x13be5e[_0x68bd('0x35')],_0x13be5e[_0x68bd('0x31')]);_0x4f9767[_0x68bd('0x46')]=_[_0x68bd('0x34')](_0x13be5e['model'],qs[_0x68bd('0x36')](_0x1209da[_0x68bd('0x31')]['fields']));_0x4f9767[_0x68bd('0x46')]=_0x4f9767[_0x68bd('0x46')][_0x68bd('0x37')]?_0x4f9767['attributes']:_0x13be5e['model'];if(_0x1209da[_0x68bd('0x31')][_0x68bd('0x40')]){_0x4f9767['include']=[{'all':!![]}];}_0x4f9767=_['merge']({},_0x4f9767,_0x1209da['options']);return db['WhatsappTransferReport'][_0x68bd('0x47')](_0x4f9767)[_0x68bd('0x26')](handleEntityNotFound(_0x207d69,null))[_0x68bd('0x26')](respondWithResult(_0x207d69,null))[_0x68bd('0x43')](handleError(_0x207d69,null));};exports[_0x68bd('0x48')]=function(_0x5df33b,_0x1ddcf8){return db[_0x68bd('0x3f')][_0x68bd('0x48')](_0x5df33b[_0x68bd('0x49')],{})[_0x68bd('0x26')](respondWithResult(_0x1ddcf8,0xc9))[_0x68bd('0x43')](handleError(_0x1ddcf8,null));};exports[_0x68bd('0x24')]=function(_0x383d73,_0x3f8a62){if(_0x383d73[_0x68bd('0x49')]['id']){delete _0x383d73[_0x68bd('0x49')]['id'];}return db['WhatsappTransferReport'][_0x68bd('0x47')]({'where':{'id':_0x383d73[_0x68bd('0x45')]['id']}})[_0x68bd('0x26')](handleEntityNotFound(_0x3f8a62,null))[_0x68bd('0x26')](saveUpdates(_0x383d73[_0x68bd('0x49')],null))[_0x68bd('0x26')](respondWithResult(_0x3f8a62,null))['catch'](handleError(_0x3f8a62,null));};exports[_0x68bd('0x25')]=function(_0x1a6d80,_0x439990){return db['WhatsappTransferReport']['find']({'where':{'id':_0x1a6d80[_0x68bd('0x45')]['id']}})[_0x68bd('0x26')](handleEntityNotFound(_0x439990,null))['then'](removeEntity(_0x439990,null))[_0x68bd('0x43')](handleError(_0x439990,null));};exports[_0x68bd('0x4a')]=function(_0x275350,_0x34c904){return db[_0x68bd('0x3f')][_0x68bd('0x4a')]()['then'](respondWithResult(_0x34c904,null))[_0x68bd('0x43')](handleError(_0x34c904,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index fdd056c..78ababf 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 _0x3d00=['../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x20b1ae,_0x4adff7){var _0x1d0283=function(_0x5ed028){while(--_0x5ed028){_0x20b1ae['push'](_0x20b1ae['shift']());}};_0x1d0283(++_0x4adff7);}(_0x3d00,0x199));var _0x03d0=function(_0xb6f28c,_0x57529c){_0xb6f28c=_0xb6f28c-0x0;var _0x2f03ab=_0x3d00[_0xb6f28c];return _0x2f03ab;};'use strict';var _=require(_0x03d0('0x0'));var util=require(_0x03d0('0x1'));var logger=require(_0x03d0('0x2'))(_0x03d0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x03d0('0x4'));var fs=require('fs');var path=require(_0x03d0('0x5'));var rimraf=require(_0x03d0('0x6'));var config=require(_0x03d0('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0x03d0('0x8')]=function(_0x31c8d3,_0x291cc7){return _0x31c8d3[_0x03d0('0x9')](_0x03d0('0xa'),attributes,{'tableName':_0x03d0('0xb'),'paranoid':![],'indexes':[{'name':_0x03d0('0xc'),'fields':[_0x03d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14ca=['../../config/logger','api','moment','../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','uniqueid','util'];(function(_0x158199,_0x1f0966){var _0x2cfa3c=function(_0x4e9129){while(--_0x4e9129){_0x158199['push'](_0x158199['shift']());}};_0x2cfa3c(++_0x1f0966);}(_0x14ca,0x1a6));var _0xa14c=function(_0xd79494,_0x1fcda7){_0xd79494=_0xd79494-0x0;var _0x1c1698=_0x14ca[_0xd79494];return _0x1c1698;};'use strict';var _=require('lodash');var util=require(_0xa14c('0x0'));var logger=require(_0xa14c('0x1'))(_0xa14c('0x2'));var moment=require(_0xa14c('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(_0xa14c('0x4'));var attributes=require(_0xa14c('0x5'));module[_0xa14c('0x6')]=function(_0x266d6,_0x562cf6){return _0x266d6['define']('WhatsappTransferReport',attributes,{'tableName':_0xa14c('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa14c('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 7176e12..3f628fd 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 _0x431a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis'];(function(_0x3c0854,_0x3b1a58){var _0x29b86e=function(_0x2d81a4){while(--_0x2d81a4){_0x3c0854['push'](_0x3c0854['shift']());}};_0x29b86e(++_0x3b1a58);}(_0x431a,0x1ad));var _0xa431=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x431a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa431('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa431('0x1'));var fs=require('fs');var Redis=require(_0xa431('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa431('0x3'));var logger=require(_0xa431('0x4'))(_0xa431('0x5'));var config=require(_0xa431('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa431('0x7')][_0xa431('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x383373,_0x414e9c,_0x3d828e){return new BPromise(function(_0x293e8f,_0x1d0dca){return client['request'](_0x383373,_0x3d828e)['then'](function(_0x106bfb){logger[_0xa431('0x9')](_0xa431('0xa'),_0x414e9c,_0xa431('0xb'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x414e9c,_0xa431('0xb'),JSON[_0xa431('0xc')](_0x106bfb));if(_0x106bfb[_0xa431('0xd')]){if(_0x106bfb[_0xa431('0xd')][_0xa431('0xe')]===0x1f4){logger[_0xa431('0xd')](_0xa431('0xa'),_0x414e9c,_0x106bfb[_0xa431('0xd')][_0xa431('0xf')]);return _0x1d0dca(_0x106bfb[_0xa431('0xd')]['message']);}logger[_0xa431('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x414e9c,_0x106bfb[_0xa431('0xd')][_0xa431('0xf')]);return _0x293e8f(_0x106bfb['error']['message']);}else{logger[_0xa431('0x9')]('WhatsappTransferReport,\x20%s,\x20%s',_0x414e9c,_0xa431('0xb'));_0x293e8f(_0x106bfb[_0xa431('0x10')][_0xa431('0xf')]);}})[_0xa431('0x11')](function(_0x434380){logger['error'](_0xa431('0xa'),_0x414e9c,_0x434380);_0x1d0dca(_0x434380);});});} \ No newline at end of file +var _0xb15a=['../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x10e2c9,_0x489aab){var _0x426947=function(_0x123624){while(--_0x123624){_0x10e2c9['push'](_0x10e2c9['shift']());}};_0x426947(++_0x489aab);}(_0xb15a,0x197));var _0xab15=function(_0x16bb0e,_0x343132){_0x16bb0e=_0x16bb0e-0x0;var _0x102b8b=_0xb15a[_0x16bb0e];return _0x102b8b;};'use strict';var _=require(_0xab15('0x0'));var util=require(_0xab15('0x1'));var moment=require(_0xab15('0x2'));var BPromise=require('bluebird');var rs=require(_0xab15('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab15('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab15('0x5'))(_0xab15('0x6'));var config=require(_0xab15('0x7'));var jayson=require(_0xab15('0x8'));var client=jayson['client'][_0xab15('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x213e40,_0x3ccc9b,_0x592274){return new BPromise(function(_0x420aa6,_0xf24be4){return client[_0xab15('0xa')](_0x213e40,_0x592274)[_0xab15('0xb')](function(_0x4ca2cb){logger[_0xab15('0xc')](_0xab15('0xd'),_0x3ccc9b,_0xab15('0xe'));logger[_0xab15('0xf')](_0xab15('0x10'),_0x3ccc9b,_0xab15('0xe'),JSON[_0xab15('0x11')](_0x4ca2cb));if(_0x4ca2cb[_0xab15('0x12')]){if(_0x4ca2cb[_0xab15('0x12')][_0xab15('0x13')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3ccc9b,_0x4ca2cb[_0xab15('0x12')][_0xab15('0x14')]);return _0xf24be4(_0x4ca2cb[_0xab15('0x12')][_0xab15('0x14')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3ccc9b,_0x4ca2cb[_0xab15('0x12')][_0xab15('0x14')]);return _0x420aa6(_0x4ca2cb[_0xab15('0x12')][_0xab15('0x14')]);}else{logger[_0xab15('0xc')](_0xab15('0xd'),_0x3ccc9b,_0xab15('0xe'));_0x420aa6(_0x4ca2cb[_0xab15('0x15')][_0xab15('0x14')]);}})[_0xab15('0x16')](function(_0x22bd7a){logger[_0xab15('0x12')](_0xab15('0xd'),_0x3ccc9b,_0x22bd7a);_0xf24be4(_0x22bd7a);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 22fd292..bfb6e98 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b59=['Online\x20apps:','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','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','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','./config/socketio','ioredis','defaults','redis','localhost','sequelize','then','seedDB','default','User','findAll','name','forEach','getAgentKey','del','_expire','listen','start','info','filter','exitCode','length','map','pm2_env'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3b59,0x9c));var _0x93b5=function(_0x2e9658,_0x42e905){_0x2e9658=_0x2e9658-0x0;var _0x2c96a0=_0x3b59[_0x2e9658];return _0x2c96a0;};'use strict';var _=require(_0x93b5('0x0'));var db=require(_0x93b5('0x1'))['db'];var seedDb=require(_0x93b5('0x2'));var checkLicense=require(_0x93b5('0x3'));var rpc=require(_0x93b5('0x4'));var config=require(_0x93b5('0x5'));var logger=require('./config/logger')(_0x93b5('0x6'));var pm2=require('./config/pm2');var pm2Config=require(_0x93b5('0x7'));var schedule=require(_0x93b5('0x8'));var chat=require(_0x93b5('0x9'));var whatsapp=require(_0x93b5('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x93b5('0xb'));var socketio=require(_0x93b5('0xc'));var Redis=require(_0x93b5('0xd'));config['redis']=_[_0x93b5('0xe')](config[_0x93b5('0xf')],{'host':_0x93b5('0x10'),'port':0x18eb});var redis=new Redis(config[_0x93b5('0xf')]);function main(){return db[_0x93b5('0x11')]['sync']()[_0x93b5('0x12')](function(){if(config[_0x93b5('0x13')]){return seedDb[_0x93b5('0x14')]();}})[_0x93b5('0x12')](function(){return checkLicense[_0x93b5('0x14')]();})['then'](function(){return db[_0x93b5('0x15')][_0x93b5('0x16')]({'where':{'role':'agent'},'attributes':['id',_0x93b5('0x17')],'raw':!![]});})[_0x93b5('0x12')](function(_0x3022c2){_0x3022c2[_0x93b5('0x18')](function(_0x2e1bf7){var _0x5b3906=socketio[_0x93b5('0x19')](_0x2e1bf7);redis[_0x93b5('0x1a')](_0x5b3906);redis['del'](_0x5b3906+_0x93b5('0x1b'));});return;})[_0x93b5('0x12')](function(){return rpc[_0x93b5('0x1c')]();})['then'](function(_0x39d8f5){logger['info'](_0x39d8f5);return chat['start']();})[_0x93b5('0x12')](function(){return whatsapp['start']();})[_0x93b5('0x12')](function(){return schedule[_0x93b5('0x1d')]();})[_0x93b5('0x12')](function(){return transcribe['start']();})['then'](function(){return provider['start']();})[_0x93b5('0x12')](function(_0x28f5cc){logger[_0x93b5('0x1e')](_0x28f5cc);return pm2[_0x93b5('0x1d')](pm2Config);})[_0x93b5('0x12')](function(_0x1f0196){var _0x2dd622=_0x1f0196[_0x93b5('0x1f')](function(_0x352cbe){return typeof _0x352cbe[_0x93b5('0x20')]==='number'&&_0x352cbe['exitCode']>=0x0;});if(_0x2dd622[_0x93b5('0x21')]>0x0){throw new Error(_0x2dd622[_0x93b5('0x21')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x93b5('0x22')](_0x2dd622,function(_0x1d8270){return'\x22'+_0x1d8270[_0x93b5('0x23')][_0x93b5('0x17')]+'\x22';}));}logger[_0x93b5('0x1e')](_0x93b5('0x24'),_[_0x93b5('0x22')](_[_0x93b5('0x1f')](_0x1f0196,{'status':_0x93b5('0x25')}),_0x93b5('0x17'))[_0x93b5('0x26')]());logger[_0x93b5('0x1e')](_0x93b5('0x27'),_[_0x93b5('0x22')](_[_0x93b5('0x1f')](_0x1f0196,function(_0x7eed38){return _0x7eed38[_0x93b5('0x28')]!==_0x93b5('0x25');}),'name')[_0x93b5('0x26')]()||_0x93b5('0x29'));console[_0x93b5('0x2a')](_0x93b5('0x2b'));})[_0x93b5('0x2c')](function(_0x3d3ace){console[_0x93b5('0x2a')](_0x93b5('0x2d'),_0x3d3ace);logger['error'](_0x93b5('0x2e'),_0x3d3ace);process[_0x93b5('0x2f')](0x1);});}main(); \ No newline at end of file +var _0xffdc=['./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','./config/socketio','ioredis','redis','localhost','sequelize','sync','then','default','agent','name','forEach','getAgentKey','del','_expire','listen','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','None','log','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config'];(function(_0x58c65a,_0x11ac97){var _0x19265c=function(_0x218d3b){while(--_0x218d3b){_0x58c65a['push'](_0x58c65a['shift']());}};_0x19265c(++_0x11ac97);}(_0xffdc,0x7f));var _0xcffd=function(_0x48c998,_0x37d255){_0x48c998=_0x48c998-0x0;var _0x59c2a2=_0xffdc[_0x48c998];return _0x59c2a2;};'use strict';var _=require(_0xcffd('0x0'));var db=require(_0xcffd('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xcffd('0x2'));var rpc=require(_0xcffd('0x3'));var config=require('./config/environment');var logger=require(_0xcffd('0x4'))(_0xcffd('0x5'));var pm2=require(_0xcffd('0x6'));var pm2Config=require(_0xcffd('0x7'));var schedule=require(_0xcffd('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xcffd('0x9'));var transcribe=require(_0xcffd('0xa'));var provider=require(_0xcffd('0xb'));var socketio=require(_0xcffd('0xc'));var Redis=require(_0xcffd('0xd'));config[_0xcffd('0xe')]=_['defaults'](config[_0xcffd('0xe')],{'host':_0xcffd('0xf'),'port':0x18eb});var redis=new Redis(config['redis']);function main(){return db[_0xcffd('0x10')][_0xcffd('0x11')]()[_0xcffd('0x12')](function(){if(config['seedDB']){return seedDb[_0xcffd('0x13')]();}})[_0xcffd('0x12')](function(){return checkLicense[_0xcffd('0x13')]();})[_0xcffd('0x12')](function(){return db['User']['findAll']({'where':{'role':_0xcffd('0x14')},'attributes':['id',_0xcffd('0x15')],'raw':!![]});})[_0xcffd('0x12')](function(_0x4ec693){_0x4ec693[_0xcffd('0x16')](function(_0x4dcb59){var _0x5b9df3=socketio[_0xcffd('0x17')](_0x4dcb59);redis[_0xcffd('0x18')](_0x5b9df3);redis['del'](_0x5b9df3+_0xcffd('0x19'));});return;})[_0xcffd('0x12')](function(){return rpc[_0xcffd('0x1a')]();})[_0xcffd('0x12')](function(_0x4ec386){logger['info'](_0x4ec386);return chat[_0xcffd('0x1b')]();})[_0xcffd('0x12')](function(){return whatsapp[_0xcffd('0x1b')]();})[_0xcffd('0x12')](function(){return schedule[_0xcffd('0x1b')]();})['then'](function(){return transcribe[_0xcffd('0x1b')]();})['then'](function(){return provider[_0xcffd('0x1b')]();})[_0xcffd('0x12')](function(_0x462e0e){logger[_0xcffd('0x1c')](_0x462e0e);return pm2[_0xcffd('0x1b')](pm2Config);})[_0xcffd('0x12')](function(_0xc6def9){var _0x2e5178=_0xc6def9['filter'](function(_0x73d51a){return typeof _0x73d51a[_0xcffd('0x1d')]===_0xcffd('0x1e')&&_0x73d51a[_0xcffd('0x1d')]>=0x0;});if(_0x2e5178[_0xcffd('0x1f')]>0x0){throw new Error(_0x2e5178[_0xcffd('0x1f')]+_0xcffd('0x20')+_['map'](_0x2e5178,function(_0x52fc51){return'\x22'+_0x52fc51[_0xcffd('0x21')][_0xcffd('0x15')]+'\x22';}));}logger[_0xcffd('0x1c')](_0xcffd('0x22'),_[_0xcffd('0x23')](_[_0xcffd('0x24')](_0xc6def9,{'status':_0xcffd('0x25')}),_0xcffd('0x15'))[_0xcffd('0x26')]());logger[_0xcffd('0x1c')](_0xcffd('0x27'),_[_0xcffd('0x23')](_['filter'](_0xc6def9,function(_0x102f93){return _0x102f93[_0xcffd('0x28')]!==_0xcffd('0x25');}),'name')[_0xcffd('0x26')]()||_0xcffd('0x29'));console[_0xcffd('0x2a')]('App\x20Ready!');})['catch'](function(_0x214271){console[_0xcffd('0x2a')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x214271);logger[_0xcffd('0x2b')](_0xcffd('0x2c'),_0x214271);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 962189b..0ad24c2 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 _0x9de6=['../../config/environment','../../config/license/hardware','../encryptor','lodash','express-jwt','composable-middleware','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','pauseType','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','selectRecallMeCampaign','use','ChatInteraction','findOne','params','closed','disposition','status','unmanaged','json','Forbidden.','catch','isAuthenticated','authorization','startsWith','User','find','then','pass','Wrong\x20credentials.','user','headers','Bearer','Unknown\x20authorization\x20format','getUuid','apikey','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','join','promisify','sign','secret','session','payload','options','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x9de6,0x7a));var _0x69de=function(_0x627c5a,_0x460ad8){_0x627c5a=_0x627c5a-0x0;var _0x322a97=_0x9de6[_0x627c5a];return _0x322a97;};'use strict';var db=require(_0x69de('0x0'))['db'];var config=require(_0x69de('0x1'));var hardwareConf=require(_0x69de('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x69de('0x3'));var _=require(_0x69de('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x69de('0x5'));var compose=require(_0x69de('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x69de('0x7'));var BPromise=require(_0x69de('0x8'));var util=require(_0x69de('0x9'));var moment=require(_0x69de('0xa'));var validateJwt=expressJwt({'secret':config[_0x69de('0xb')]['session']});var userAttributes=['id',_0x69de('0xc'),_0x69de('0xd'),_0x69de('0xe'),_0x69de('0xf'),_0x69de('0x10'),_0x69de('0x11'),_0x69de('0x12'),_0x69de('0x13'),_0x69de('0x14'),_0x69de('0x15'),'mailPause',_0x69de('0x16'),'smsPause','openchannelPause',_0x69de('0x17'),'showWebBar',_0x69de('0x18'),'lastPauseAt',_0x69de('0x19'),_0x69de('0x1a'),_0x69de('0x1b'),_0x69de('0x1c'),_0x69de('0x1d'),_0x69de('0x1e'),_0x69de('0x1f'),_0x69de('0x20'),'phoneBarEnableDtmfTone',_0x69de('0x21'),'phoneBarExpires',_0x69de('0x22'),_0x69de('0x23'),_0x69de('0x24'),'hotdesk',_0x69de('0x25'),_0x69de('0x26'),'privacyEnabled',_0x69de('0x27'),_0x69de('0x28'),_0x69de('0x29'),_0x69de('0x2a'),'downloadAttachments','ignorePauseForPreviewCalls',_0x69de('0x2b')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x69de('0x2c')](function(_0x59adef,_0xd46413,_0x825482){if(_0x59adef['user']){_0x825482();}else{return db[_0x69de('0x2d')][_0x69de('0x2e')]({'where':{'id':_0x59adef[_0x69de('0x2f')]['id']},'attributes':['id',_0x69de('0x30'),_0x69de('0x31')],'raw':!![]})['then'](function(_0x1f09f9){if(_0x1f09f9&&_0x1f09f9[_0x69de('0x30')]){return _0xd46413[_0x69de('0x32')](_0x1f09f9['disposition']===_0x69de('0x33')?0x195:0x193)[_0x69de('0x34')]({'message':_0x1f09f9[_0x69de('0x31')]===_0x69de('0x33')?'Unmanaged.':_0x69de('0x35')});}else{_0x825482();}})[_0x69de('0x36')](function(_0x4320fe){_0x825482(_0x4320fe);});}});};exports[_0x69de('0x37')]=function isAuthenticated(_0x3f1bd2){return compose()[_0x69de('0x2c')](function(_0x38bcb7,_0x305a66,_0x9ae331){var _0x22502a;if(_0x38bcb7['headers'][_0x69de('0x38')]){if(_[_0x69de('0x39')](_0x38bcb7['headers'][_0x69de('0x38')],'Basic')){var _0x2e4513=basicAuth(_0x38bcb7);db[_0x69de('0x3a')][_0x69de('0x3b')]({'where':{'name':_0x2e4513[_0x69de('0xe')]}})[_0x69de('0x3c')](function(_0x4a3693){if(!_0x4a3693||!_0x4a3693['authenticate'](_0x2e4513[_0x69de('0x3d')])){return _0x305a66[_0x69de('0x32')](0x191)[_0x69de('0x34')]({'message':_0x69de('0x3e')});}_0x38bcb7[_0x69de('0x3f')]={'id':_0x4a3693['id']};_0x9ae331();})[_0x69de('0x36')](function(_0x55a6f1){_0x9ae331(_0x55a6f1);});}else if(_['startsWith'](_0x38bcb7[_0x69de('0x40')][_0x69de('0x38')],_0x69de('0x41'))){validateJwt(_0x38bcb7,_0x305a66,_0x9ae331);}else{if(_0x3f1bd2){_0x9ae331();}else{return _0x305a66[_0x69de('0x32')](0x193)['json']({'message':_0x69de('0x42')});}}}else if(_0x38bcb7['query']['apikey']){try{var _0x37af17={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x69de('0x43')]()};verifyJwt(_0x38bcb7['query'][_0x69de('0x44')],_0x37af17)['then'](function(_0x46ea24){return db[_0x69de('0x3a')][_0x69de('0x3b')]({'where':{'id':_0x46ea24[_0x69de('0x45')]}})[_0x69de('0x3c')](function(_0x2bf36f){_0x22502a=_0x2bf36f;return db[_0x69de('0x46')][_0x69de('0x2e')]({'where':{'id':0x1},'attributes':[_0x69de('0x47'),_0x69de('0x48')],'raw':!![]});})['then'](function(_0x15bd70){if(!_0x22502a||!_['isEqual'](_0x22502a[_0x69de('0x49')],_0x46ea24[_0x69de('0x4a')])){return _0x305a66[_0x69de('0x32')](0x191)[_0x69de('0x34')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x22502a['disabled']){return _0x305a66[_0x69de('0x32')](0x191)[_0x69de('0x34')]({'message':_0x69de('0x4b')});}if(_0x22502a['blocked']){if(_0x15bd70['blockDuration']>0x0){if(moment(_0x22502a[_0x69de('0x4c')])[_0x69de('0x4d')](_0x15bd70['blockDuration'],'minutes')>moment()){return _0x305a66[_0x69de('0x32')](0x191)['json']({'message':_0x69de('0x4b')});}}else{return _0x305a66[_0x69de('0x32')](0x191)[_0x69de('0x34')]({'message':_0x69de('0x4b')});}}_0x38bcb7[_0x69de('0x3f')]={'id':_0x22502a['id']};_0x9ae331();});})[_0x69de('0x36')](function(){return _0x305a66[_0x69de('0x32')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x127eda){_0x9ae331(_0x127eda);}}else if(_0x3f1bd2){_0x9ae331();}else{return _0x305a66[_0x69de('0x32')](0x193)[_0x69de('0x34')]({'message':_0x69de('0x42')});}})['use'](function(_0x2bb51a,_0x3b4a1b,_0x167fe3){if(_0x2bb51a[_0x69de('0x3f')]){db[_0x69de('0x3a')]['find']({'where':{'id':_0x2bb51a[_0x69de('0x3f')]['id']},'attributes':userAttributes})['then'](function(_0x19a042){if(!_0x19a042){return _0x3b4a1b[_0x69de('0x32')](0x194)[_0x69de('0x34')]({'message':_0x69de('0x4e')});}_0x2bb51a[_0x69de('0x3f')]=_0x19a042;_0x167fe3();})['catch'](function(_0x5bb760){_0x167fe3(_0x5bb760);});}else if(_0x3f1bd2){_0x167fe3();}else{return _0x3b4a1b[_0x69de('0x32')](0x194)[_0x69de('0x34')]({'message':_0x69de('0x4f')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0xaa4609,_0x5db11c,_0x29c6ca){return licenseUtil['getLicense']()[_0x69de('0x3c')](function(_0xd1f512){if(_0xd1f512['update']){_0x29c6ca();}else{return _0x5db11c[_0x69de('0x32')](0x193)[_0x69de('0x34')]({'message':'Forbidden'});}})[_0x69de('0x36')](function(_0x2ef118){_0x29c6ca(_0x2ef118);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0xf69850,_0x1476c4,_0x4aa9c6){return licenseUtil[_0x69de('0x50')]()['then'](function(_0x5694cd){if(_0x5694cd['webrtc']){_0x4aa9c6();}else{return _0x1476c4['status'](0x193)[_0x69de('0x34')]({'message':_0x69de('0x51')});}})[_0x69de('0x36')](function(_0x5d7652){_0x4aa9c6(_0x5d7652);});});};exports[_0x69de('0x52')]=function(_0x109a86,_0x43ca6f,_0x3dd32d){_0x109a86[_0x69de('0x52')]=!![];return _0x3dd32d();};exports[_0x69de('0x53')]=function signToken(_0x29c13b){return signJwt(_0x29c13b);};exports[_0x69de('0x54')]=function(_0x3c52ac,_0x4f683c){if(!_0x3c52ac['user']){return _0x4f683c[_0x69de('0x32')](0x194)[_0x69de('0x34')]({'message':_0x69de('0x55')});}var _0x588c9c={'payload':{'id':_0x3c52ac[_0x69de('0x3f')]['id'],'role':_0x3c52ac['user'][_0x69de('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x588c9c)['then'](function(_0x2150d7){_0x4f683c[_0x69de('0x56')](_0x69de('0x57'),_0x2150d7);_0x4f683c['redirect']('/dashboards/general');})[_0x69de('0x36')](function(_0x16089a){return _0x4f683c[_0x69de('0x32')](0x1f4)[_0x69de('0x58')](_0x16089a);});};exports[_0x69de('0x59')]=function(_0x53b0a9){if(_[_0x69de('0x5a')](_0x53b0a9[_0x69de('0x49')])||_[_0x69de('0x5a')](_0x53b0a9[_0x69de('0x5b')])){return null;}else{return createJwt(_0x53b0a9);}};exports[_0x69de('0x5c')]=function(_0x578021){_0x578021[_0x69de('0x49')]=generateNonce();_0x578021[_0x69de('0x5b')]=generateIssuedAt();return createJwt(_0x578021);};exports[_0x69de('0x5d')]=function(_0x57580f,_0x1cbc00){var _0x15df3=_0x57580f['query']['apikey'];if(_0x15df3){var _0x55d62c={'nonce':_0x1cbc00[_0x69de('0x49')],'iat':_0x1cbc00[_0x69de('0x5b')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x15df3,_0x55d62c)['then'](function(){return generateApiKey(_0x1cbc00);});}else{throw{'message':_0x69de('0x5e')};}};exports[_0x69de('0x5f')]=function(_0x4f7117){var _0x3c8cb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3c8cb2[_0x69de('0x60')](_0x4f7117))throw new db[(_0x69de('0x61'))]['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~!@#$%^&-_=+[{]}.');return;};exports[_0x69de('0x62')]=function(_0x30791e,_0x4c5cb6,_0x4a4cbc){var _0x12f172=encryptor[_0x69de('0x63')](_0x4c5cb6)[_0x69de('0x64')](',');for(var _0x22c741=0x0;_0x22c741<_0x4a4cbc;_0x22c741++){if(!_0x12f172[_0x22c741])break;if(_0x30791e['toLowerCase']()===_0x12f172[_0x22c741][_0x69de('0x65')]()){var _0x5e2f9b=util[_0x69de('0x66')](_0x69de('0x67'),_0x4a4cbc);if(_0x4a4cbc===0x1){_0x5e2f9b=_0x69de('0x68');}throw new db[(_0x69de('0x61'))][(_0x69de('0x69'))](_0x5e2f9b);}}return;};exports[_0x69de('0x6a')]=function(_0x4cc085,_0x1e0d6b){var _0x2bbe56=_0x1e0d6b?encryptor[_0x69de('0x63')](_0x1e0d6b)[_0x69de('0x64')](','):[];if(_0x2bbe56[_0x69de('0x6b')]===0x5){_0x2bbe56[_0x69de('0x6c')](-0x1,0x1);}_0x2bbe56['unshift'](_0x4cc085);return encryptor[_0x69de('0x6d')](_0x2bbe56[_0x69de('0x6e')](','));};function signJwt(_0x45a61c){var _0x240ba0=BPromise[_0x69de('0x6f')](jwt[_0x69de('0x70')],{'context':jwt});var _0x1a6002=_0x45a61c[_0x69de('0x71')]||config[_0x69de('0xb')][_0x69de('0x72')];return new BPromise(function(_0x376535,_0xd1bc26){_0x240ba0(_0x45a61c[_0x69de('0x73')],_0x1a6002,_0x45a61c[_0x69de('0x74')])['then'](function(_0x39ab3a){_0x376535(_0x39ab3a);})[_0x69de('0x36')](function(_0x2d6860){_0xd1bc26(_0x2d6860);});});}function verifyJwt(_0x1f1fd3,_0x3135da,_0x2afa62){var _0x1a75d5=BPromise['promisify'](jwt[_0x69de('0x75')],{'context':jwt});var _0x454b51=_0x2afa62||config[_0x69de('0xb')]['session'];return new BPromise(function(_0x51b59e,_0x3b09f7){_0x1a75d5(_0x1f1fd3,_0x454b51,_0x3135da)[_0x69de('0x3c')](function(_0x56f183){_0x51b59e(_0x56f183);})[_0x69de('0x36')](function(_0x52241a){_0x3b09f7(_0x52241a);});});}function generateNonce(){return crypto[_0x69de('0x76')](0x10)[_0x69de('0x77')](_0x69de('0x78'));}function generateIssuedAt(){return Math[_0x69de('0x79')](Date['now']()/0x3e8)[_0x69de('0x77')]();}function createJwt(_0x824497){var _0x13f087={'payload':{'iat':_0x824497[_0x69de('0x5b')],'nonce':_0x824497[_0x69de('0x49')]},'options':{'algorithm':_0x69de('0x7a'),'subject':_0x824497['id'][_0x69de('0x77')](),'issuer':hardwareConf[_0x69de('0x43')](),'audience':hardwareConf[_0x69de('0x43')]()}};return signJwt(_0x13f087)['then'](function(_0x2c1912){return{'iat':_0x824497['apiKeyIat'],'nonce':_0x824497[_0x69de('0x49')],'token':_0x2c1912};});} \ No newline at end of file +var _0xb2ef=['Invalid\x20API\x20access\x20key','blocked','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','promisify','secret','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','internal','email','userpic','voicePause','chatPause','faxPause','smsPause','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','isChatInteractionAuthorized','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','use','authorization','startsWith','headers','Basic','User','find','name','authenticate','pass','Wrong\x20credentials.','user','Bearer','query','apikey','getUuid','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce'];(function(_0x471ef0,_0x2c0ab4){var _0x446749=function(_0x57541d){while(--_0x57541d){_0x471ef0['push'](_0x471ef0['shift']());}};_0x446749(++_0x2c0ab4);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x173fd1,_0x2847b3){_0x173fd1=_0x173fd1-0x0;var _0x26d003=_0xb2ef[_0x173fd1];return _0x26d003;};'use strict';var db=require(_0xfb2e('0x0'))['db'];var config=require(_0xfb2e('0x1'));var hardwareConf=require(_0xfb2e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xfb2e('0x3'));var _=require(_0xfb2e('0x4'));var jwt=require(_0xfb2e('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xfb2e('0x6'));var basicAuth=require(_0xfb2e('0x7'));var crypto=require(_0xfb2e('0x8'));var BPromise=require(_0xfb2e('0x9'));var util=require(_0xfb2e('0xa'));var moment=require(_0xfb2e('0xb'));var validateJwt=expressJwt({'secret':config[_0xfb2e('0xc')][_0xfb2e('0xd')]});var userAttributes=['id',_0xfb2e('0xe'),_0xfb2e('0xf'),'name',_0xfb2e('0x10'),_0xfb2e('0x11'),_0xfb2e('0x12'),'permissions','md5secret',_0xfb2e('0x13'),_0xfb2e('0x14'),'mailPause',_0xfb2e('0x15'),_0xfb2e('0x16'),'openchannelPause','pauseType','showWebBar',_0xfb2e('0x17'),'lastPauseAt',_0xfb2e('0x18'),_0xfb2e('0x19'),_0xfb2e('0x1a'),_0xfb2e('0x1b'),_0xfb2e('0x1c'),_0xfb2e('0x1d'),'phoneBarDnd',_0xfb2e('0x1e'),_0xfb2e('0x1f'),_0xfb2e('0x20'),_0xfb2e('0x21'),_0xfb2e('0x22'),'phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface',_0xfb2e('0x23'),_0xfb2e('0x24'),'settingsEnabled',_0xfb2e('0x25'),_0xfb2e('0x26'),'downloadOmnichannelInteractions',_0xfb2e('0x27'),_0xfb2e('0x28'),'selectRecallMeCampaign'];exports[_0xfb2e('0x29')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x355f1d,_0x2ed006,_0x3b0ebc){if(_0x355f1d['user']){_0x3b0ebc();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x355f1d[_0xfb2e('0x2a')]['id']},'attributes':['id',_0xfb2e('0x2b'),_0xfb2e('0x2c')],'raw':!![]})[_0xfb2e('0x2d')](function(_0x35c1a8){if(_0x35c1a8&&_0x35c1a8[_0xfb2e('0x2b')]){return _0x2ed006[_0xfb2e('0x2e')](_0x35c1a8[_0xfb2e('0x2c')]===_0xfb2e('0x2f')?0x195:0x193)[_0xfb2e('0x30')]({'message':_0x35c1a8[_0xfb2e('0x2c')]===_0xfb2e('0x2f')?_0xfb2e('0x31'):_0xfb2e('0x32')});}else{_0x3b0ebc();}})[_0xfb2e('0x33')](function(_0x48c043){_0x3b0ebc(_0x48c043);});}});};exports[_0xfb2e('0x34')]=function isAuthenticated(_0x49c216){return compose()[_0xfb2e('0x35')](function(_0x45d8d3,_0x5a7680,_0x4ef0f5){var _0x5f1950;if(_0x45d8d3['headers'][_0xfb2e('0x36')]){if(_[_0xfb2e('0x37')](_0x45d8d3[_0xfb2e('0x38')][_0xfb2e('0x36')],_0xfb2e('0x39'))){var _0x42a80f=basicAuth(_0x45d8d3);db[_0xfb2e('0x3a')][_0xfb2e('0x3b')]({'where':{'name':_0x42a80f[_0xfb2e('0x3c')]}})[_0xfb2e('0x2d')](function(_0x3ce8fa){if(!_0x3ce8fa||!_0x3ce8fa[_0xfb2e('0x3d')](_0x42a80f[_0xfb2e('0x3e')])){return _0x5a7680['status'](0x191)[_0xfb2e('0x30')]({'message':_0xfb2e('0x3f')});}_0x45d8d3[_0xfb2e('0x40')]={'id':_0x3ce8fa['id']};_0x4ef0f5();})[_0xfb2e('0x33')](function(_0xa05e59){_0x4ef0f5(_0xa05e59);});}else if(_[_0xfb2e('0x37')](_0x45d8d3['headers'][_0xfb2e('0x36')],_0xfb2e('0x41'))){validateJwt(_0x45d8d3,_0x5a7680,_0x4ef0f5);}else{if(_0x49c216){_0x4ef0f5();}else{return _0x5a7680[_0xfb2e('0x2e')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x45d8d3[_0xfb2e('0x42')][_0xfb2e('0x43')]){try{var _0x35237f={'audience':hardwareConf[_0xfb2e('0x44')](),'issuer':hardwareConf[_0xfb2e('0x44')]()};verifyJwt(_0x45d8d3['query'][_0xfb2e('0x43')],_0x35237f)[_0xfb2e('0x2d')](function(_0x69235f){return db['User']['find']({'where':{'id':_0x69235f[_0xfb2e('0x45')]}})[_0xfb2e('0x2d')](function(_0x54a5b5){_0x5f1950=_0x54a5b5;return db[_0xfb2e('0x46')][_0xfb2e('0x47')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xfb2e('0x48')],'raw':!![]});})[_0xfb2e('0x2d')](function(_0x15419f){if(!_0x5f1950||!_[_0xfb2e('0x49')](_0x5f1950[_0xfb2e('0x4a')],_0x69235f['nonce'])){return _0x5a7680[_0xfb2e('0x2e')](0x191)[_0xfb2e('0x30')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x5f1950['disabled']){return _0x5a7680['status'](0x191)[_0xfb2e('0x30')]({'message':_0xfb2e('0x4b')});}if(_0x5f1950[_0xfb2e('0x4c')]){if(_0x15419f[_0xfb2e('0x48')]>0x0){if(moment(_0x5f1950['blockedAt'])[_0xfb2e('0x4d')](_0x15419f[_0xfb2e('0x48')],_0xfb2e('0x4e'))>moment()){return _0x5a7680[_0xfb2e('0x2e')](0x191)[_0xfb2e('0x30')]({'message':_0xfb2e('0x4b')});}}else{return _0x5a7680[_0xfb2e('0x2e')](0x191)[_0xfb2e('0x30')]({'message':_0xfb2e('0x4b')});}}_0x45d8d3[_0xfb2e('0x40')]={'id':_0x5f1950['id']};_0x4ef0f5();});})['catch'](function(){return _0x5a7680[_0xfb2e('0x2e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x4dd001){_0x4ef0f5(_0x4dd001);}}else if(_0x49c216){_0x4ef0f5();}else{return _0x5a7680[_0xfb2e('0x2e')](0x193)[_0xfb2e('0x30')]({'message':_0xfb2e('0x4f')});}})['use'](function(_0x2042a9,_0x5f4a6c,_0x5c3425){if(_0x2042a9[_0xfb2e('0x40')]){db[_0xfb2e('0x3a')][_0xfb2e('0x3b')]({'where':{'id':_0x2042a9[_0xfb2e('0x40')]['id']},'attributes':userAttributes})[_0xfb2e('0x2d')](function(_0x5659ec){if(!_0x5659ec){return _0x5f4a6c['status'](0x194)[_0xfb2e('0x30')]({'message':_0xfb2e('0x50')});}_0x2042a9['user']=_0x5659ec;_0x5c3425();})['catch'](function(_0x351572){_0x5c3425(_0x351572);});}else if(_0x49c216){_0x5c3425();}else{return _0x5f4a6c['status'](0x194)[_0xfb2e('0x30')]({'message':_0xfb2e('0x51')});}});};exports[_0xfb2e('0x52')]=function canUpdate(){return compose()[_0xfb2e('0x35')](function(_0x3c5c91,_0x36b616,_0x45d252){return licenseUtil[_0xfb2e('0x53')]()['then'](function(_0x3e4b23){if(_0x3e4b23[_0xfb2e('0x54')]){_0x45d252();}else{return _0x36b616[_0xfb2e('0x2e')](0x193)['json']({'message':_0xfb2e('0x55')});}})[_0xfb2e('0x33')](function(_0x18065c){_0x45d252(_0x18065c);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0xfb2e('0x35')](function(_0x485869,_0x12fb83,_0xa9bcac){return licenseUtil[_0xfb2e('0x53')]()['then'](function(_0x54ccb9){if(_0x54ccb9[_0xfb2e('0x56')]){_0xa9bcac();}else{return _0x12fb83[_0xfb2e('0x2e')](0x193)[_0xfb2e('0x30')]({'message':_0xfb2e('0x55')});}})[_0xfb2e('0x33')](function(_0x45b833){_0xa9bcac(_0x45b833);});});};exports[_0xfb2e('0x57')]=function(_0x23ab97,_0x2b1886,_0x57b325){_0x23ab97[_0xfb2e('0x57')]=!![];return _0x57b325();};exports[_0xfb2e('0x58')]=function signToken(_0x333712){return signJwt(_0x333712);};exports['setTokenCookie']=function(_0x22c660,_0x7beac8){if(!_0x22c660[_0xfb2e('0x40')]){return _0x7beac8[_0xfb2e('0x2e')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5069ed={'payload':{'id':_0x22c660[_0xfb2e('0x40')]['id'],'role':_0x22c660[_0xfb2e('0x40')][_0xfb2e('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5069ed)[_0xfb2e('0x2d')](function(_0x2bcc92){_0x7beac8[_0xfb2e('0x59')](_0xfb2e('0x5a'),_0x2bcc92);_0x7beac8[_0xfb2e('0x5b')](_0xfb2e('0x5c'));})['catch'](function(_0x1403ea){return _0x7beac8[_0xfb2e('0x2e')](0x1f4)['send'](_0x1403ea);});};exports[_0xfb2e('0x5d')]=function(_0x58d7cd){if(_[_0xfb2e('0x5e')](_0x58d7cd[_0xfb2e('0x4a')])||_[_0xfb2e('0x5e')](_0x58d7cd[_0xfb2e('0x5f')])){return null;}else{return createJwt(_0x58d7cd);}};exports[_0xfb2e('0x60')]=function(_0xe880da){_0xe880da[_0xfb2e('0x4a')]=generateNonce();_0xe880da[_0xfb2e('0x5f')]=generateIssuedAt();return createJwt(_0xe880da);};exports[_0xfb2e('0x61')]=function(_0x4211b6,_0x58d60e){var _0x162988=_0x4211b6[_0xfb2e('0x42')][_0xfb2e('0x43')];if(_0x162988){var _0x53fb04={'nonce':_0x58d60e[_0xfb2e('0x4a')],'iat':_0x58d60e[_0xfb2e('0x5f')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfb2e('0x44')]()};return verifyJwt(_0x162988,_0x53fb04)[_0xfb2e('0x2d')](function(){return generateApiKey(_0x58d60e);});}else{throw{'message':_0xfb2e('0x62')};}};exports['validatePasswordPattern']=function(_0x555ced){var _0x363960=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x363960[_0xfb2e('0x63')](_0x555ced))throw new db['Sequelize'][(_0xfb2e('0x64'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xfb2e('0x65')]=function(_0x22be0f,_0x376d2e,_0x3a120c){var _0x4cfc7e=encryptor['decryptString'](_0x376d2e)[_0xfb2e('0x66')](',');for(var _0x276a29=0x0;_0x276a29<_0x3a120c;_0x276a29++){if(!_0x4cfc7e[_0x276a29])break;if(_0x22be0f[_0xfb2e('0x67')]()===_0x4cfc7e[_0x276a29][_0xfb2e('0x67')]()){var _0x2350a6=util[_0xfb2e('0x68')](_0xfb2e('0x69'),_0x3a120c);if(_0x3a120c===0x1){_0x2350a6=_0xfb2e('0x6a');}throw new db['Sequelize'][(_0xfb2e('0x64'))](_0x2350a6);}}return;};exports[_0xfb2e('0x6b')]=function(_0x117e39,_0x2b8c66){var _0x3e761b=_0x2b8c66?encryptor['decryptString'](_0x2b8c66)[_0xfb2e('0x66')](','):[];if(_0x3e761b[_0xfb2e('0x6c')]===0x5){_0x3e761b['splice'](-0x1,0x1);}_0x3e761b[_0xfb2e('0x6d')](_0x117e39);return encryptor[_0xfb2e('0x6e')](_0x3e761b['join'](','));};function signJwt(_0x4c5017){var _0x3b5cf2=BPromise[_0xfb2e('0x6f')](jwt['sign'],{'context':jwt});var _0xe8fc90=_0x4c5017[_0xfb2e('0x70')]||config['secrets'][_0xfb2e('0xd')];return new BPromise(function(_0x34e5cc,_0x28b415){_0x3b5cf2(_0x4c5017['payload'],_0xe8fc90,_0x4c5017[_0xfb2e('0x71')])[_0xfb2e('0x2d')](function(_0x576478){_0x34e5cc(_0x576478);})[_0xfb2e('0x33')](function(_0x3d93e8){_0x28b415(_0x3d93e8);});});}function verifyJwt(_0x48a1b2,_0x796f01,_0x374665){var _0x19fec0=BPromise[_0xfb2e('0x6f')](jwt[_0xfb2e('0x72')],{'context':jwt});var _0xdcde5d=_0x374665||config[_0xfb2e('0xc')][_0xfb2e('0xd')];return new BPromise(function(_0x514c95,_0x4830da){_0x19fec0(_0x48a1b2,_0xdcde5d,_0x796f01)[_0xfb2e('0x2d')](function(_0x6b5e3a){_0x514c95(_0x6b5e3a);})['catch'](function(_0x5a5b46){_0x4830da(_0x5a5b46);});});}function generateNonce(){return crypto[_0xfb2e('0x73')](0x10)[_0xfb2e('0x74')](_0xfb2e('0x75'));}function generateIssuedAt(){return Math[_0xfb2e('0x76')](Date[_0xfb2e('0x77')]()/0x3e8)[_0xfb2e('0x74')]();}function createJwt(_0x1e4705){var _0x4f40c1={'payload':{'iat':_0x1e4705['apiKeyIat'],'nonce':_0x1e4705['apiKeyNonce']},'options':{'algorithm':_0xfb2e('0x78'),'subject':_0x1e4705['id'][_0xfb2e('0x74')](),'issuer':hardwareConf[_0xfb2e('0x44')](),'audience':hardwareConf[_0xfb2e('0x44')]()}};return signJwt(_0x4f40c1)[_0xfb2e('0x2d')](function(_0x3e052a){return{'iat':_0x1e4705['apiKeyIat'],'nonce':_0x1e4705['apiKeyNonce'],'token':_0x3e052a};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index d2ae44a..1019bf0 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 _0xcbe5=['bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createCipher','write','binary','end','close','unlink','createWriteStream','createDecipher','data','update','final','encryptString','secret','base64','decryptString','utf8','crypto'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcbe5,0x1b9));var _0x5cbe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcbe5[_0x122ef9];return _0x42fba0;};'use strict';var crypto=require(_0x5cbe('0x0'));var fs=require('fs');var BPromise=require(_0x5cbe('0x1'));var _=require(_0x5cbe('0x2'));var config=require(_0x5cbe('0x3'));var logger=require(_0x5cbe('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5cbe('0x5')][_0x5cbe('0x6')],'algorithm':_0x5cbe('0x7')};const fileOptions={'algorithm':_0x5cbe('0x8')};if(config[_0x5cbe('0x9')]&&config[_0x5cbe('0x9')][_0x5cbe('0xa')]){var isSupported=isAlgorithmSupported(config[_0x5cbe('0x9')]['algorithm']);if(isSupported){fileOptions[_0x5cbe('0xa')]=config['encrypt'][_0x5cbe('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5cbe('0xb')](',\x20');logger['error'](config[_0x5cbe('0x9')][_0x5cbe('0xa')],_0x5cbe('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x454444){return AES_SUPPORTED_RX['test'](_0x454444);}function getSupportedCiphers(){return crypto[_0x5cbe('0xd')]()[_0x5cbe('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2ce4fc){return getSupportedCiphers()['indexOf'](_0x2ce4fc)>-0x1;}function combineOptions(_0x1c5af5){var _0x122801={};for(var _0xfbea5d in fileOptions){if(fileOptions[_0x5cbe('0xf')](_0xfbea5d)){_0x122801[_0xfbea5d]=fileOptions[_0xfbea5d];}}if(_0x1c5af5){for(var _0x333a84 in _0x1c5af5){if(_0x1c5af5[_0x5cbe('0xf')](_0x333a84)){_0x122801[_0x333a84]=_0x1c5af5[_0x333a84];}}}return _0x122801;}exports[_0x5cbe('0x10')]=function(_0x4b12d7,_0x374aa1,_0xe870cf,_0x494e08){return new BPromise(function(_0x6421aa,_0x596595){_0x494e08=combineOptions(_0x494e08);var _0x4377f7=new Buffer(_0xe870cf);var _0x2ca58e=fs[_0x5cbe('0x11')](_0x4b12d7);var _0x7457b9=fs['createWriteStream'](_0x374aa1);var _0x564983=crypto[_0x5cbe('0x12')](_0x494e08[_0x5cbe('0xa')],_0x4377f7);_0x2ca58e['on']('data',function(_0x6637e1){var _0x261405=new Buffer(_0x564983['update'](_0x6637e1),'binary');_0x7457b9[_0x5cbe('0x13')](_0x261405);});_0x2ca58e['on']('end',function(){try{var _0x338918=new Buffer(_0x564983['final'](_0x5cbe('0x14')),_0x5cbe('0x14'));_0x7457b9['write'](_0x338918);_0x7457b9[_0x5cbe('0x15')]();_0x7457b9['on'](_0x5cbe('0x16'),function(){return _0x6421aa(_0x374aa1);});}catch(_0x247af9){fs[_0x5cbe('0x17')](_0x374aa1);return _0x596595(_0x247af9);}});});};exports['decryptFile']=function(_0x31880e,_0x155375,_0x9a467c,_0x1cd6cc){return new BPromise(function(_0x11e6f5,_0x57fc7a){_0x1cd6cc=combineOptions(_0x1cd6cc);var _0x4fdb00=new Buffer(_0x9a467c);var _0x34a227=fs[_0x5cbe('0x11')](_0x31880e);var _0x4f5bb6=fs[_0x5cbe('0x18')](_0x155375);var _0x3a9081=crypto[_0x5cbe('0x19')](_0x1cd6cc['algorithm'],_0x4fdb00);_0x34a227['on'](_0x5cbe('0x1a'),function(_0x42aa3b){var _0x2f3cb4=new Buffer(_0x3a9081[_0x5cbe('0x1b')](_0x42aa3b),_0x5cbe('0x14'));_0x4f5bb6[_0x5cbe('0x13')](_0x2f3cb4);});_0x34a227['on']('end',function(){try{var _0x20e7a1=new Buffer(_0x3a9081[_0x5cbe('0x1c')](_0x5cbe('0x14')),_0x5cbe('0x14'));_0x4f5bb6[_0x5cbe('0x13')](_0x20e7a1);_0x4f5bb6['end']();_0x4f5bb6['on']('close',function(){return _0x11e6f5(_0x155375);});}catch(_0x1b7b3b){fs['unlink'](_0x155375);return _0x57fc7a(_0x1b7b3b);}});});};exports[_0x5cbe('0x1d')]=function(_0x594f5f,_0x3e33be,_0x549777){var _0x14e01a=_0x549777||stringOptions[_0x5cbe('0xa')];var _0x34a37a=_0x3e33be||stringOptions[_0x5cbe('0x1e')];var _0x5f06b0=crypto['createCipher'](_0x14e01a,_0x34a37a);var _0x41a451=_0x5f06b0[_0x5cbe('0x1b')](_0x594f5f,'utf8','base64');_0x41a451+=_0x5f06b0[_0x5cbe('0x1c')](_0x5cbe('0x1f'));return _0x41a451;};exports[_0x5cbe('0x20')]=function(_0x3bd260,_0x331ea2,_0x2fc9a4){var _0x183c8c=_0x2fc9a4||stringOptions[_0x5cbe('0xa')];var _0x5ed4ca=_0x331ea2||stringOptions[_0x5cbe('0x1e')];var _0x79c661=crypto[_0x5cbe('0x19')](_0x183c8c,_0x5ed4ca);var _0xb01375=_0x79c661[_0x5cbe('0x1b')](_0x3bd260,'base64',_0x5cbe('0x21'));_0xb01375+=_0x79c661[_0x5cbe('0x1c')](_0x5cbe('0x21'));return _0xb01375;}; \ No newline at end of file +var _0xebd5=['crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','final','binary','end','unlink','decryptFile','close','encryptString','secret','utf8','base64','decryptString','createDecipher'];(function(_0xbff251,_0x13b8ad){var _0x5d47fa=function(_0xeea496){while(--_0xeea496){_0xbff251['push'](_0xbff251['shift']());}};_0x5d47fa(++_0x13b8ad);}(_0xebd5,0x6c));var _0x5ebd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xebd5[_0x42cae2];return _0x5f256f;};'use strict';var crypto=require(_0x5ebd('0x0'));var fs=require('fs');var BPromise=require(_0x5ebd('0x1'));var _=require(_0x5ebd('0x2'));var config=require(_0x5ebd('0x3'));var logger=require(_0x5ebd('0x4'))(_0x5ebd('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x5ebd('0x6')],'algorithm':_0x5ebd('0x7')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x5ebd('0x8')][_0x5ebd('0x9')]){var isSupported=isAlgorithmSupported(config[_0x5ebd('0x8')][_0x5ebd('0x9')]);if(isSupported){fileOptions[_0x5ebd('0x9')]=config['encrypt'][_0x5ebd('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x5ebd('0xa')](config['encrypt'][_0x5ebd('0x9')],_0x5ebd('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x10d368){return AES_SUPPORTED_RX[_0x5ebd('0xc')](_0x10d368);}function getSupportedCiphers(){return crypto[_0x5ebd('0xd')]()[_0x5ebd('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x6df626){return getSupportedCiphers()[_0x5ebd('0xf')](_0x6df626)>-0x1;}function combineOptions(_0x5788ce){var _0x162164={};for(var _0x426325 in fileOptions){if(fileOptions[_0x5ebd('0x10')](_0x426325)){_0x162164[_0x426325]=fileOptions[_0x426325];}}if(_0x5788ce){for(var _0x3a5ce1 in _0x5788ce){if(_0x5788ce[_0x5ebd('0x10')](_0x3a5ce1)){_0x162164[_0x3a5ce1]=_0x5788ce[_0x3a5ce1];}}}return _0x162164;}exports[_0x5ebd('0x11')]=function(_0x11117f,_0x4c4b64,_0x196f95,_0xdc96df){return new BPromise(function(_0x5b3d45,_0x3d0439){_0xdc96df=combineOptions(_0xdc96df);var _0x4a6c9e=new Buffer(_0x196f95);var _0x5a6715=fs[_0x5ebd('0x12')](_0x11117f);var _0x343264=fs[_0x5ebd('0x13')](_0x4c4b64);var _0x57a1a6=crypto[_0x5ebd('0x14')](_0xdc96df[_0x5ebd('0x9')],_0x4a6c9e);_0x5a6715['on'](_0x5ebd('0x15'),function(_0x283087){var _0x421960=new Buffer(_0x57a1a6[_0x5ebd('0x16')](_0x283087),'binary');_0x343264[_0x5ebd('0x17')](_0x421960);});_0x5a6715['on']('end',function(){try{var _0x16f116=new Buffer(_0x57a1a6[_0x5ebd('0x18')](_0x5ebd('0x19')),_0x5ebd('0x19'));_0x343264[_0x5ebd('0x17')](_0x16f116);_0x343264[_0x5ebd('0x1a')]();_0x343264['on']('close',function(){return _0x5b3d45(_0x4c4b64);});}catch(_0x423e83){fs[_0x5ebd('0x1b')](_0x4c4b64);return _0x3d0439(_0x423e83);}});});};exports[_0x5ebd('0x1c')]=function(_0x47daa2,_0x1a726e,_0x37e192,_0x18a8f9){return new BPromise(function(_0x25a6df,_0x3f70ea){_0x18a8f9=combineOptions(_0x18a8f9);var _0x3ef7ca=new Buffer(_0x37e192);var _0x3766c9=fs[_0x5ebd('0x12')](_0x47daa2);var _0x5fd873=fs['createWriteStream'](_0x1a726e);var _0x55552c=crypto['createDecipher'](_0x18a8f9[_0x5ebd('0x9')],_0x3ef7ca);_0x3766c9['on'](_0x5ebd('0x15'),function(_0x1aa11a){var _0xca53d0=new Buffer(_0x55552c[_0x5ebd('0x16')](_0x1aa11a),_0x5ebd('0x19'));_0x5fd873[_0x5ebd('0x17')](_0xca53d0);});_0x3766c9['on'](_0x5ebd('0x1a'),function(){try{var _0x3a85ba=new Buffer(_0x55552c[_0x5ebd('0x18')](_0x5ebd('0x19')),_0x5ebd('0x19'));_0x5fd873[_0x5ebd('0x17')](_0x3a85ba);_0x5fd873[_0x5ebd('0x1a')]();_0x5fd873['on'](_0x5ebd('0x1d'),function(){return _0x25a6df(_0x1a726e);});}catch(_0x1d5bc2){fs[_0x5ebd('0x1b')](_0x1a726e);return _0x3f70ea(_0x1d5bc2);}});});};exports[_0x5ebd('0x1e')]=function(_0xdc2b10,_0x2120ab,_0x5410f2){var _0x3730d3=_0x5410f2||stringOptions[_0x5ebd('0x9')];var _0x475f01=_0x2120ab||stringOptions[_0x5ebd('0x1f')];var _0x3aa6c2=crypto[_0x5ebd('0x14')](_0x3730d3,_0x475f01);var _0x5ac9c5=_0x3aa6c2[_0x5ebd('0x16')](_0xdc2b10,_0x5ebd('0x20'),_0x5ebd('0x21'));_0x5ac9c5+=_0x3aa6c2[_0x5ebd('0x18')](_0x5ebd('0x21'));return _0x5ac9c5;};exports[_0x5ebd('0x22')]=function(_0x48214f,_0x197239,_0x330220){var _0x1fcce3=_0x330220||stringOptions[_0x5ebd('0x9')];var _0x1b22ca=_0x197239||stringOptions[_0x5ebd('0x1f')];var _0x3afec7=crypto[_0x5ebd('0x23')](_0x1fcce3,_0x1b22ca);var _0x3d1684=_0x3afec7[_0x5ebd('0x16')](_0x48214f,_0x5ebd('0x21'),_0x5ebd('0x20'));_0x3d1684+=_0x3afec7[_0x5ebd('0x18')](_0x5ebd('0x20'));return _0x3d1684;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 3aff02e..cca2883 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 _0x0bae=['dirname','basename','.csv','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','inspect','Failed','finally','exit','util','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','then','num','Empty','length','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT'];(function(_0x52b23b,_0x378054){var _0x1c2126=function(_0xf21258){while(--_0xf21258){_0x52b23b['push'](_0x52b23b['shift']());}};_0x1c2126(++_0x378054);}(_0x0bae,0x171));var _0xe0ba=function(_0x1f1728,_0x180b94){_0x1f1728=_0x1f1728-0x0;var _0x201dcf=_0x0bae[_0x1f1728];return _0x201dcf;};'use strict';var util=require(_0xe0ba('0x0'));var path=require(_0xe0ba('0x1'));var _=require('lodash');var csv=require(_0xe0ba('0x2'));var fs=require('fs');var BPromise=require(_0xe0ba('0x3'));var zipdir=require(_0xe0ba('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xe0ba('0x5'))[_0xe0ba('0x6')];var logger=require(_0xe0ba('0x7'))(_0xe0ba('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xe0ba('0x9')][0x2]);var QUERY=process[_0xe0ba('0x9')][0x3];var PATH=process[_0xe0ba('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4058f1,_0x14a4b5){var _0x400bbf={'status':_0x4058f1};var _0x51cb0a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x14a4b5){_0x400bbf['savename']=_0x14a4b5;}return db[_0xe0ba('0xa')][_0xe0ba('0xb')](_0x400bbf,_0x51cb0a);}function main(){var _0x3fca8d=0x1388;var _0x4d75b7;logger[_0xe0ba('0xc')](util[_0xe0ba('0xd')](_0xe0ba('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xe0ba('0xf')][_0xe0ba('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe0ba('0x11'),'splitSizeCsv']})['then'](function(_0x141ce9){if(_0x141ce9){_0x4d75b7=_0x141ce9;_0x3fca8d=_0x4d75b7[_0xe0ba('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0xe0ba('0x13')](util[_0xe0ba('0xd')](_0xe0ba('0x14'),QUERY),{'type':dbH[_0xe0ba('0x15')]['QueryTypes']['SELECT']});})[_0xe0ba('0x16')](function(_0x3c390a){if(!_0x3c390a[0x0][_0xe0ba('0x17')]){return analyticExtractedReport(_0xe0ba('0x18'));}var _0x3baaf2=[];var _0x2dd15a=0x0;if(_0x4d75b7[_0xe0ba('0x11')]){if(_0x3c390a&&_0x3c390a[_0xe0ba('0x19')]){var _0x220a61=_[_0xe0ba('0x1a')](_0x3c390a[0x0][_0xe0ba('0x17')]/_0x3fca8d);var _0x339c36=Number['isInteger'](_0x3c390a[0x0]['num']/_0x3fca8d)?_0x3c390a[0x0]['num']%_0x3fca8d:0x0;_0x220a61['forEach'](function(_0x485297){if(_0x485297>0x0){_0x2dd15a+=_0x3fca8d;}_0x3baaf2[_0xe0ba('0x1b')](dbH[_0xe0ba('0x15')][_0xe0ba('0x13')](util[_0xe0ba('0xd')](_0xe0ba('0x1c'),QUERY,_0x3fca8d,_0x2dd15a),{'type':dbH[_0xe0ba('0x15')][_0xe0ba('0x1d')][_0xe0ba('0x1e')]}));});if(_0x339c36>0x0){_0x2dd15a+=_0x3fca8d;_0x3baaf2[_0xe0ba('0x1b')](dbH[_0xe0ba('0x15')][_0xe0ba('0x13')](util[_0xe0ba('0xd')](_0xe0ba('0x1c'),QUERY,_0x339c36,_0x2dd15a),{'type':dbH[_0xe0ba('0x15')]['QueryTypes'][_0xe0ba('0x1e')]}));}}}else{_0x3baaf2[_0xe0ba('0x1b')](dbH['sequelize'][_0xe0ba('0x13')](QUERY,{'type':dbH[_0xe0ba('0x15')][_0xe0ba('0x1d')][_0xe0ba('0x1e')]}));}var _0x59990e=path[_0xe0ba('0x1f')](PATH);var _0x1c0d7d=path[_0xe0ba('0x20')](PATH,_0xe0ba('0x21'));var _0x5afd1e=_0x4d75b7[_0xe0ba('0x11')]&&_0x3baaf2[_0xe0ba('0x19')]>0x1;var _0x4e30ba=[];if(!fs['existsSync'](path[_0xe0ba('0x22')](_0x59990e,_0x1c0d7d))&&_0x5afd1e){fs[_0xe0ba('0x23')](path[_0xe0ba('0x22')](_0x59990e,_0x1c0d7d));}return BPromise['each'](_0x3baaf2,function(_0x2cb34a){_0x4e30ba[_0xe0ba('0x1b')](_0x2cb34a);})[_0xe0ba('0x16')](function(){for(var _0x10d12c=0x0;_0x10d12c<_0x4e30ba['length'];_0x10d12c+=0x1){var _0x2f1263;var _0x1b79d9=_0x4e30ba[_0x10d12c];if(_0x5afd1e){_0x2f1263=path[_0xe0ba('0x22')](_0x59990e,_0x1c0d7d,util[_0xe0ba('0xd')](_0xe0ba('0x24'),_0x1c0d7d,_0x10d12c,'csv'));}else{_0x2f1263=path['join'](_0x59990e,util[_0xe0ba('0xd')](_0xe0ba('0x25'),_0x1c0d7d,_0xe0ba('0x26')));}fs[_0xe0ba('0x27')](_0x2f1263,csv(_0x1b79d9));}})['then'](function(){if(_0x5afd1e){return new Promise(function(_0x5b208d){zipdir(path[_0xe0ba('0x22')](_0x59990e,_0x1c0d7d),{'saveTo':path[_0xe0ba('0x22')](_0x59990e,util[_0xe0ba('0xd')](_0xe0ba('0x25'),_0x1c0d7d,_0xe0ba('0x28')))},function(_0x33ca97,_0x1c3cbb){rimraf(path['join'](_0x59990e,_0x1c0d7d),function(){});_0x5b208d(_0xe0ba('0x29'));});});}})['then'](function(){logger[_0xe0ba('0xc')](util[_0xe0ba('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xe0ba('0x2a'),_0x5afd1e?util[_0xe0ba('0xd')](_0xe0ba('0x25'),_0x1c0d7d,_0x5afd1e?_0xe0ba('0x28'):_0xe0ba('0x26')):null);});})[_0xe0ba('0x2b')](function(_0x2fc8b8){logger[_0xe0ba('0xc')](util['format'](_0xe0ba('0x2c'),EXTRACTED_REPORT_ID,_0xe0ba('0x2d')),util[_0xe0ba('0x2e')](_0x2fc8b8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe0ba('0x2f'));})[_0xe0ba('0x30')](function(){process[_0xe0ba('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd027=['Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','then','splitSizeCsv','sequelize','query','format','QueryTypes','SELECT','Empty','range','isInteger','num','forEach','push','dirname','basename','.csv','existsSync','join','mkdirSync','length','%s%d.%s','csv','%s.%s','zip','zip\x20finished'];(function(_0x425caa,_0x3572c1){var _0x624fdc=function(_0x22e504){while(--_0x22e504){_0x425caa['push'](_0x425caa['shift']());}};_0x624fdc(++_0x3572c1);}(_0xd027,0xd3));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x7d02('0x0'));var path=require(_0x7d02('0x1'));var _=require(_0x7d02('0x2'));var csv=require(_0x7d02('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x7d02('0x4'));var rimraf=require(_0x7d02('0x5'));var db=require(_0x7d02('0x6'))['db'];var dbH=require(_0x7d02('0x6'))[_0x7d02('0x7')];var logger=require(_0x7d02('0x8'))(_0x7d02('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x7d02('0xa')][0x2]);var QUERY=process[_0x7d02('0xa')][0x3];var PATH=process[_0x7d02('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf0193a,_0x2b219d){var _0xf8a4f8={'status':_0xf0193a};var _0x5a2ce5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b219d){_0xf8a4f8[_0x7d02('0xb')]=_0x2b219d;}return db[_0x7d02('0xc')][_0x7d02('0xd')](_0xf8a4f8,_0x5a2ce5);}function main(){var _0x3277a2=0x1388;var _0x209222;logger[_0x7d02('0xe')](util['format'](_0x7d02('0xf'),EXTRACTED_REPORT_ID,_0x7d02('0x10')));return db[_0x7d02('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7d02('0x12'),'splitSizeCsv']})[_0x7d02('0x13')](function(_0x4b19fc){if(_0x4b19fc){_0x209222=_0x4b19fc;_0x3277a2=_0x209222[_0x7d02('0x14')]||0x1388;}})['then'](function(){return dbH[_0x7d02('0x15')][_0x7d02('0x16')](util[_0x7d02('0x17')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x7d02('0x15')][_0x7d02('0x18')][_0x7d02('0x19')]});})[_0x7d02('0x13')](function(_0x350e89){if(!_0x350e89[0x0]['num']){return analyticExtractedReport(_0x7d02('0x1a'));}var _0x24faae=[];var _0x31090e=0x0;if(_0x209222[_0x7d02('0x12')]){if(_0x350e89&&_0x350e89['length']){var _0x415ebd=_[_0x7d02('0x1b')](_0x350e89[0x0]['num']/_0x3277a2);var _0x4f030f=Number[_0x7d02('0x1c')](_0x350e89[0x0]['num']/_0x3277a2)?_0x350e89[0x0][_0x7d02('0x1d')]%_0x3277a2:0x0;_0x415ebd[_0x7d02('0x1e')](function(_0xbb2adf){if(_0xbb2adf>0x0){_0x31090e+=_0x3277a2;}_0x24faae[_0x7d02('0x1f')](dbH[_0x7d02('0x15')][_0x7d02('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3277a2,_0x31090e),{'type':dbH[_0x7d02('0x15')][_0x7d02('0x18')][_0x7d02('0x19')]}));});if(_0x4f030f>0x0){_0x31090e+=_0x3277a2;_0x24faae[_0x7d02('0x1f')](dbH[_0x7d02('0x15')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f030f,_0x31090e),{'type':dbH[_0x7d02('0x15')][_0x7d02('0x18')][_0x7d02('0x19')]}));}}}else{_0x24faae[_0x7d02('0x1f')](dbH[_0x7d02('0x15')]['query'](QUERY,{'type':dbH[_0x7d02('0x15')][_0x7d02('0x18')][_0x7d02('0x19')]}));}var _0x32e992=path[_0x7d02('0x20')](PATH);var _0x277f26=path[_0x7d02('0x21')](PATH,_0x7d02('0x22'));var _0xa5bd5b=_0x209222[_0x7d02('0x12')]&&_0x24faae['length']>0x1;var _0x2675da=[];if(!fs[_0x7d02('0x23')](path[_0x7d02('0x24')](_0x32e992,_0x277f26))&&_0xa5bd5b){fs[_0x7d02('0x25')](path[_0x7d02('0x24')](_0x32e992,_0x277f26));}return BPromise['each'](_0x24faae,function(_0xef1913){_0x2675da[_0x7d02('0x1f')](_0xef1913);})['then'](function(){for(var _0x36cb46=0x0;_0x36cb46<_0x2675da[_0x7d02('0x26')];_0x36cb46+=0x1){var _0x2feeb1;var _0xb1ecff=_0x2675da[_0x36cb46];if(_0xa5bd5b){_0x2feeb1=path[_0x7d02('0x24')](_0x32e992,_0x277f26,util[_0x7d02('0x17')](_0x7d02('0x27'),_0x277f26,_0x36cb46,_0x7d02('0x28')));}else{_0x2feeb1=path[_0x7d02('0x24')](_0x32e992,util['format'](_0x7d02('0x29'),_0x277f26,_0x7d02('0x28')));}fs['writeFileSync'](_0x2feeb1,csv(_0xb1ecff));}})[_0x7d02('0x13')](function(){if(_0xa5bd5b){return new Promise(function(_0x26cd4b){zipdir(path[_0x7d02('0x24')](_0x32e992,_0x277f26),{'saveTo':path[_0x7d02('0x24')](_0x32e992,util[_0x7d02('0x17')](_0x7d02('0x29'),_0x277f26,_0x7d02('0x2a')))},function(_0x226ad0,_0xc7ed7){rimraf(path[_0x7d02('0x24')](_0x32e992,_0x277f26),function(){});_0x26cd4b(_0x7d02('0x2b'));});});}})[_0x7d02('0x13')](function(){logger['info'](util[_0x7d02('0x17')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x7d02('0x10')));return analyticExtractedReport(_0x7d02('0x2c'),_0xa5bd5b?util['format'](_0x7d02('0x29'),_0x277f26,_0xa5bd5b?'zip':_0x7d02('0x28')):null);});})[_0x7d02('0x2d')](function(_0x48b6b9){logger[_0x7d02('0xe')](util['format'](_0x7d02('0x2e'),EXTRACTED_REPORT_ID,_0x7d02('0x10')),util[_0x7d02('0x2f')](_0x48b6b9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7d02('0x30'));})[_0x7d02('0x31')](function(){process[_0x7d02('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index d962e57..f8fc59a 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 _0xf2c9=['PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','auto','body','push','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','landscape','\x20/\x20','footer','Arial','num','Setting','find','split','splitSizePdf','then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','zip\x20finished','info','Completed','zip'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xf2c9,0xc1));var _0x9f2c=function(_0x5511b0,_0xd17819){_0x5511b0=_0x5511b0-0x0;var _0x4b766a=_0xf2c9[_0x5511b0];return _0x4b766a;};'use strict';var _=require(_0x9f2c('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x9f2c('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x9f2c('0x2'));var PdfPrinter=require(_0x9f2c('0x3'));var zipdir=require(_0x9f2c('0x4'));var rimraf=require(_0x9f2c('0x5'));var JSDOM=require(_0x9f2c('0x6'))['JSDOM'];var window=new JSDOM('')[_0x9f2c('0x7')];var BPromise=require(_0x9f2c('0x8'));var db=require(_0x9f2c('0x9'))['db'];var dbH=require(_0x9f2c('0x9'))[_0x9f2c('0xa')];var logger=require(_0x9f2c('0xb'))(_0x9f2c('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x9f2c('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x9f2c('0xd')][0x4];var NAME=process[_0x9f2c('0xd')][0x5];var FORMAT=_0x9f2c('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ad7b2,_0x13a0f9){var _0x20c813={'status':_0x3ad7b2};var _0x5191b0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x13a0f9){_0x20c813[_0x9f2c('0xf')]=_0x13a0f9;}return db[_0x9f2c('0x10')][_0x9f2c('0x11')](_0x20c813,_0x5191b0);}function getHeaders(_0x3b5f01){return _[_0x9f2c('0x12')](_0x3b5f01,function(_0x787948){return{'text':_0x787948,'style':_0x9f2c('0x13')};});}function getRows(_0x2bb555,_0x3514e8){return _[_0x9f2c('0x12')](_0x3514e8,function(_0x28f58c){return _(_0x28f58c)[_0x9f2c('0x14')](_0x2bb555)['map'](function(_0x1be02d){return _0x1be02d?_[_0x9f2c('0x15')](_0x1be02d):'';})[_0x9f2c('0x16')]();});}function createTable(_0x2ee1cc,_0x517250){var _0x2e9c30={'widths':_['fill'](Array(_0x2ee1cc[_0x9f2c('0x17')]),0x91),'heights':function(_0x3aef74){return _0x3aef74===0x0?_0x9f2c('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xde41f0=getHeaders(_0x2ee1cc);_0x2e9c30[_0x9f2c('0x19')][_0x9f2c('0x1a')](_0xde41f0);var _0x380466=getRows(_0x2ee1cc,_0x517250);_0x2e9c30[_0x9f2c('0x19')]=_0x2e9c30[_0x9f2c('0x19')]['concat'](_0x380466);return _0x2e9c30;}function createTables(_0x3994f7){var _0x2d2c1a=[];var _0x399c9e=_['chunk'](Object['keys'](_0x3994f7[0x0]),0x5);_0x399c9e[_0x9f2c('0x1b')](function(_0x3b6304){_0x2d2c1a[_0x9f2c('0x1a')](createTable(_0x3b6304,_0x3994f7));});return _0x2d2c1a;}function getPDFDocDefinition(_0x54bc86){var _0x417efd=util[_0x9f2c('0x1c')](_0x9f2c('0x1d'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x9f2c('0x1e')])[_0x9f2c('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x9f2c('0x1f')])[_0x9f2c('0x1c')](FORMAT));var _0x24473e=[];for(var _0x21ad23=0x0;_0x21ad23<_0x54bc86[_0x9f2c('0x17')];_0x21ad23++){var _0xf53bc4=[];if(_0x21ad23===0x0){_0xf53bc4[_0x9f2c('0x1a')]({'text':_0x417efd,'style':_0x9f2c('0x20')});}var _0x114d2b={'table':_0x54bc86[_0x21ad23]};if(_0x21ad23>0x0){_0x114d2b[_0x9f2c('0x21')]=_0x9f2c('0x22');_0x114d2b['margin']=[0x0,0x46,0x0,0x0];}_0xf53bc4[_0x9f2c('0x1a')](_0x114d2b);_0x24473e[_0x9f2c('0x1a')](_0xf53bc4);}return{'pageSize':'A4','pageOrientation':_0x9f2c('0x23'),'content':_0x24473e,'footer':function(_0x8c047e,_0x2747dc){return{'text':_0x8c047e[_0x9f2c('0x15')]()+_0x9f2c('0x24')+_0x2747dc,'style':_0x9f2c('0x25')};},'defaultStyle':{'font':_0x9f2c('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x437fa5){var _0x198296=0x1388;var _0x6b5dda;if(!_0x437fa5[0x0][_0x9f2c('0x27')]){return analyticExtractedReport('Empty');}return db[_0x9f2c('0x28')][_0x9f2c('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9f2c('0x2a'),_0x9f2c('0x2b')]})['then'](function(_0x440396){if(_0x440396){_0x6b5dda=_0x440396;_0x198296=_0x6b5dda['splitSizePdf']||0x3e8;}})[_0x9f2c('0x2c')](function(){var _0x4ea7b8=[];var _0x7dbb9f=0x0;if(_0x6b5dda[_0x9f2c('0x2a')]){if(_0x437fa5&&_0x437fa5[_0x9f2c('0x17')]){var _0x361067=_['range'](_0x437fa5[0x0][_0x9f2c('0x27')]/_0x198296);var _0x116541=Number[_0x9f2c('0x2d')](_0x437fa5[0x0][_0x9f2c('0x27')]/_0x198296)?_0x437fa5[0x0]['num']%_0x198296:0x0;_0x361067[_0x9f2c('0x1b')](function(_0x1d84be){if(_0x1d84be>0x0){_0x7dbb9f+=_0x198296;}_0x4ea7b8[_0x9f2c('0x1a')](dbH[_0x9f2c('0x2e')][_0x9f2c('0x2f')](util[_0x9f2c('0x1c')](_0x9f2c('0x30'),QUERY,_0x198296,_0x7dbb9f),{'type':dbH[_0x9f2c('0x2e')][_0x9f2c('0x31')][_0x9f2c('0x32')]}));});if(_0x116541>0x0){_0x7dbb9f+=_0x198296;_0x4ea7b8[_0x9f2c('0x1a')](dbH[_0x9f2c('0x2e')][_0x9f2c('0x2f')](util[_0x9f2c('0x1c')](_0x9f2c('0x30'),QUERY,_0x116541,_0x7dbb9f),{'type':dbH[_0x9f2c('0x2e')][_0x9f2c('0x31')][_0x9f2c('0x32')]}));}}}else{_0x4ea7b8['push'](dbH[_0x9f2c('0x2e')]['query'](QUERY,{'type':dbH[_0x9f2c('0x2e')][_0x9f2c('0x31')]['SELECT']}));}var _0x327a45=path['dirname'](PATH);var _0x4c30bf=path[_0x9f2c('0x33')](PATH,_0x9f2c('0x34'));var _0x3dae2a=_0x6b5dda['split']&&_0x4ea7b8[_0x9f2c('0x17')]>0x1;var _0x2386ca=[];if(!fs[_0x9f2c('0x35')](path[_0x9f2c('0x36')](_0x327a45,_0x4c30bf))&&_0x3dae2a){fs[_0x9f2c('0x37')](path[_0x9f2c('0x36')](_0x327a45,_0x4c30bf));}return BPromise[_0x9f2c('0x38')](_0x4ea7b8,function(_0x531cd6){_0x2386ca[_0x9f2c('0x1a')](_0x531cd6);})[_0x9f2c('0x2c')](function(){var _0x559625=[];for(var _0x3c4c62=0x0;_0x3c4c62<_0x2386ca['length'];_0x3c4c62+=0x1){var _0x4edc46=_0x2386ca[_0x3c4c62];var _0x3cdef9=createTables(_[_0x9f2c('0x39')](_0x4edc46));var _0x2b4a07;var _0x53dbfb=getPDFDocDefinition(_0x3cdef9);var _0x58cf83=getPDFPrinter();var _0x3685c3=_0x58cf83[_0x9f2c('0x3a')](_0x53dbfb);if(_0x3dae2a){_0x2b4a07=path[_0x9f2c('0x36')](_0x327a45,_0x4c30bf,util[_0x9f2c('0x1c')]('%s%d.%s',_0x4c30bf,_0x3c4c62,_0x9f2c('0x3b')));}else{_0x2b4a07=path[_0x9f2c('0x36')](_0x327a45,util[_0x9f2c('0x1c')](_0x9f2c('0x3c'),_0x4c30bf,_0x9f2c('0x3b')));}_0x559625[_0x9f2c('0x1a')](writePDFDocument(_0x3685c3,_0x2b4a07));}return Promise['all'](_0x559625);})[_0x9f2c('0x2c')](function(){if(_0x3dae2a){return new Promise(function(_0x3352d8){zipdir(path[_0x9f2c('0x36')](_0x327a45,_0x4c30bf),{'saveTo':path[_0x9f2c('0x36')](_0x327a45,util[_0x9f2c('0x1c')](_0x9f2c('0x3c'),_0x4c30bf,'zip'))},function(){rimraf(path[_0x9f2c('0x36')](_0x327a45,_0x4c30bf),function(){});_0x3352d8(_0x9f2c('0x3d'));});});}})[_0x9f2c('0x2c')](function(){if(!_0x3dae2a)return;rimraf(path[_0x9f2c('0x36')](_0x327a45,_0x4c30bf),function(){});})[_0x9f2c('0x2c')](function(){logger[_0x9f2c('0x3e')](util[_0x9f2c('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x9f2c('0x3f'),_0x3dae2a?util['format'](_0x9f2c('0x3c'),_0x4c30bf,_0x3dae2a?_0x9f2c('0x40'):_0x9f2c('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x9f2c('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9f2c('0x41')));return db[_0x9f2c('0x10')][_0x9f2c('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9f2c('0x2c')](function(_0x18e88e){EXTRACTED_REPORT=_0x18e88e;return dbH['sequelize']['query'](util[_0x9f2c('0x1c')](_0x9f2c('0x43'),QUERY),{'type':dbH[_0x9f2c('0x2e')][_0x9f2c('0x31')][_0x9f2c('0x32')]});})[_0x9f2c('0x2c')](extractReport)[_0x9f2c('0x44')](function(_0x2bd13e){logger['info'](util['format'](_0x9f2c('0x45'),EXTRACTED_REPORT_ID,_0x9f2c('0x41')),util[_0x9f2c('0x46')](_0x2bd13e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9f2c('0x47'));})['finally'](function(){process[_0x9f2c('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x50f557=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x9f2c('0x49'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9f2c('0x4a')}});return _0x50f557;}function getPDFDocDefinitionFromHTML(_0x4578b5,_0xac12ae){var _0x3599d3=util['format'](_0x9f2c('0x4b'),_0xac12ae[_0x9f2c('0x4c')],_0xac12ae[_0x9f2c('0x4d')]);var _0x576166=moment()[_0x9f2c('0x1c')](_0x9f2c('0x4e'))['toString']();var _0x46a3c5=htmlToPdfmake(_0x4578b5,{'window':window,'tableAutoSize':!![]});return{'content':[_0x46a3c5],'defaultStyle':{'font':_0x9f2c('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9f2c('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9f2c('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9f2c('0x4f')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x5c6682,_0x5e332a){return[{'text':util['format'](_0x9f2c('0x50'),_0x3599d3,_0x5c6682,_0x5e332a,_0x576166),'style':_0x9f2c('0x25')}];}};}function writePDFDocument(_0x5655fe,_0x168d1c){return new Promise(function(_0x54e9a1,_0x24089d){var _0x350d1a=_0x5655fe[_0x9f2c('0x51')](fs[_0x9f2c('0x52')](_0x168d1c));_0x350d1a['on'](_0x9f2c('0x53'),function(){_0x54e9a1(_0x9f2c('0x53'));});_0x350d1a['on'](_0x9f2c('0x54'),function(_0x3d9728){_0x24089d(_0x3d9728);});_0x5655fe[_0x9f2c('0x55')]();});}exports['createPdfFromHTML']=function(_0x502160,_0x3c6931){var _0x175ad5=getPDFPrinter();var _0x46861a=getPDFDocDefinitionFromHTML(_0x502160,_0x3c6931);var _0x1d4334=_0x175ad5[_0x9f2c('0x3a')](_0x46861a);return writePDFDocument(_0x1d4334,_0x3c6931['path'])[_0x9f2c('0x44')](function(_0x5283f2){throw _0x5283f2;});}; \ No newline at end of file +var _0x281e=['map','toString','value','length','auto','body','concat','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','before','margin','\x20/\x20','footer','black','right','num','Empty','Setting','find','split','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','existsSync','join','each','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','createPdfKitDocument','path','moment','html-to-pdfmake','zip-dir','jsdom','JSDOM','window','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader'];(function(_0xa63cc4,_0x204c1d){var _0x20fcc0=function(_0x4bc07f){while(--_0x4bc07f){_0xa63cc4['push'](_0xa63cc4['shift']());}};_0x20fcc0(++_0x204c1d);}(_0x281e,0x1d8));var _0xe281=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x281e[_0x20589d];return _0x422de9;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xe281('0x0'));var moment=require(_0xe281('0x1'));var htmlToPdfmake=require(_0xe281('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xe281('0x3'));var rimraf=require('rimraf');var JSDOM=require(_0xe281('0x4'))[_0xe281('0x5')];var window=new JSDOM('')[_0xe281('0x6')];var BPromise=require('bluebird');var db=require(_0xe281('0x7'))['db'];var dbH=require(_0xe281('0x7'))['dbH'];var logger=require(_0xe281('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xe281('0x9')][0x3];var PATH=process[_0xe281('0x9')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xe281('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1be297,_0x46a641){var _0x54f48a={'status':_0x1be297};var _0x43b875={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x46a641){_0x54f48a['savename']=_0x46a641;}return db[_0xe281('0xb')][_0xe281('0xc')](_0x54f48a,_0x43b875);}function getHeaders(_0x4e1daa){return _['map'](_0x4e1daa,function(_0x505668){return{'text':_0x505668,'style':_0xe281('0xd')};});}function getRows(_0x2f9c68,_0x11ffb4){return _['map'](_0x11ffb4,function(_0x30929a){return _(_0x30929a)['pick'](_0x2f9c68)[_0xe281('0xe')](function(_0x4e06fc){return _0x4e06fc?_[_0xe281('0xf')](_0x4e06fc):'';})[_0xe281('0x10')]();});}function createTable(_0x5ba315,_0x2b504c){var _0x1a3b37={'widths':_['fill'](Array(_0x5ba315[_0xe281('0x11')]),0x91),'heights':function(_0xaf6252){return _0xaf6252===0x0?_0xe281('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x54c1ec=getHeaders(_0x5ba315);_0x1a3b37[_0xe281('0x13')]['push'](_0x54c1ec);var _0x458297=getRows(_0x5ba315,_0x2b504c);_0x1a3b37[_0xe281('0x13')]=_0x1a3b37[_0xe281('0x13')][_0xe281('0x14')](_0x458297);return _0x1a3b37;}function createTables(_0x538619){var _0x505d1e=[];var _0x29dfc8=_['chunk'](Object['keys'](_0x538619[0x0]),0x5);_0x29dfc8[_0xe281('0x15')](function(_0x2013f0){_0x505d1e[_0xe281('0x16')](createTable(_0x2013f0,_0x538619));});return _0x505d1e;}function getPDFDocDefinition(_0x39440e){var _0x2a8c21=util[_0xe281('0x17')](_0xe281('0x18'),NAME,EXTRACTED_REPORT[_0xe281('0x19')],moment(EXTRACTED_REPORT[_0xe281('0x1a')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x282a63=[];for(var _0x52398c=0x0;_0x52398c<_0x39440e[_0xe281('0x11')];_0x52398c++){var _0x2137f1=[];if(_0x52398c===0x0){_0x2137f1['push']({'text':_0x2a8c21,'style':_0xe281('0x1b')});}var _0x582ed5={'table':_0x39440e[_0x52398c]};if(_0x52398c>0x0){_0x582ed5['pageBreak']=_0xe281('0x1c');_0x582ed5[_0xe281('0x1d')]=[0x0,0x46,0x0,0x0];}_0x2137f1[_0xe281('0x16')](_0x582ed5);_0x282a63['push'](_0x2137f1);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x282a63,'footer':function(_0x23b173,_0x256b04){return{'text':_0x23b173[_0xe281('0xf')]()+_0xe281('0x1e')+_0x256b04,'style':_0xe281('0x1f')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe281('0x20')},'footer':{'alignment':_0xe281('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5d880d){var _0x578ec7=0x1388;var _0x52edb9;if(!_0x5d880d[0x0][_0xe281('0x22')]){return analyticExtractedReport(_0xe281('0x23'));}return db[_0xe281('0x24')][_0xe281('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe281('0x26'),'splitSizePdf']})[_0xe281('0x27')](function(_0x3e0a57){if(_0x3e0a57){_0x52edb9=_0x3e0a57;_0x578ec7=_0x52edb9['splitSizePdf']||0x3e8;}})['then'](function(){var _0x50c586=[];var _0x36ca88=0x0;if(_0x52edb9[_0xe281('0x26')]){if(_0x5d880d&&_0x5d880d['length']){var _0x49d141=_[_0xe281('0x28')](_0x5d880d[0x0][_0xe281('0x22')]/_0x578ec7);var _0xf4d991=Number[_0xe281('0x29')](_0x5d880d[0x0][_0xe281('0x22')]/_0x578ec7)?_0x5d880d[0x0]['num']%_0x578ec7:0x0;_0x49d141[_0xe281('0x15')](function(_0x20eade){if(_0x20eade>0x0){_0x36ca88+=_0x578ec7;}_0x50c586[_0xe281('0x16')](dbH[_0xe281('0x2a')][_0xe281('0x2b')](util[_0xe281('0x17')](_0xe281('0x2c'),QUERY,_0x578ec7,_0x36ca88),{'type':dbH[_0xe281('0x2a')][_0xe281('0x2d')]['SELECT']}));});if(_0xf4d991>0x0){_0x36ca88+=_0x578ec7;_0x50c586[_0xe281('0x16')](dbH[_0xe281('0x2a')][_0xe281('0x2b')](util[_0xe281('0x17')](_0xe281('0x2c'),QUERY,_0xf4d991,_0x36ca88),{'type':dbH['sequelize'][_0xe281('0x2d')][_0xe281('0x2e')]}));}}}else{_0x50c586[_0xe281('0x16')](dbH[_0xe281('0x2a')][_0xe281('0x2b')](QUERY,{'type':dbH[_0xe281('0x2a')]['QueryTypes'][_0xe281('0x2e')]}));}var _0x119cf6=path['dirname'](PATH);var _0x5b6058=path[_0xe281('0x2f')](PATH,'.pdf');var _0x26f0d9=_0x52edb9[_0xe281('0x26')]&&_0x50c586[_0xe281('0x11')]>0x1;var _0x4c3526=[];if(!fs[_0xe281('0x30')](path[_0xe281('0x31')](_0x119cf6,_0x5b6058))&&_0x26f0d9){fs['mkdirSync'](path[_0xe281('0x31')](_0x119cf6,_0x5b6058));}return BPromise[_0xe281('0x32')](_0x50c586,function(_0x3dc062){_0x4c3526[_0xe281('0x16')](_0x3dc062);})[_0xe281('0x27')](function(){var _0x4b554f=[];for(var _0x2c67d5=0x0;_0x2c67d5<_0x4c3526[_0xe281('0x11')];_0x2c67d5+=0x1){var _0x5b111f=_0x4c3526[_0x2c67d5];var _0x1d6d7f=createTables(_['flatten'](_0x5b111f));var _0x57ee24;var _0x1fa609=getPDFDocDefinition(_0x1d6d7f);var _0x2d3474=getPDFPrinter();var _0x3f61b5=_0x2d3474['createPdfKitDocument'](_0x1fa609);if(_0x26f0d9){_0x57ee24=path[_0xe281('0x31')](_0x119cf6,_0x5b6058,util[_0xe281('0x17')](_0xe281('0x33'),_0x5b6058,_0x2c67d5,'pdf'));}else{_0x57ee24=path[_0xe281('0x31')](_0x119cf6,util[_0xe281('0x17')]('%s.%s',_0x5b6058,_0xe281('0x34')));}_0x4b554f[_0xe281('0x16')](writePDFDocument(_0x3f61b5,_0x57ee24));}return Promise[_0xe281('0x35')](_0x4b554f);})[_0xe281('0x27')](function(){if(_0x26f0d9){return new Promise(function(_0x14cfbc){zipdir(path[_0xe281('0x31')](_0x119cf6,_0x5b6058),{'saveTo':path['join'](_0x119cf6,util[_0xe281('0x17')](_0xe281('0x36'),_0x5b6058,_0xe281('0x37')))},function(){rimraf(path[_0xe281('0x31')](_0x119cf6,_0x5b6058),function(){});_0x14cfbc(_0xe281('0x38'));});});}})[_0xe281('0x27')](function(){if(!_0x26f0d9)return;rimraf(path['join'](_0x119cf6,_0x5b6058),function(){});})[_0xe281('0x27')](function(){logger[_0xe281('0x39')](util[_0xe281('0x17')](_0xe281('0x3a'),EXTRACTED_REPORT_ID,_0xe281('0x3b')));return analyticExtractedReport('Completed',_0x26f0d9?util[_0xe281('0x17')](_0xe281('0x36'),_0x5b6058,_0x26f0d9?_0xe281('0x37'):_0xe281('0x34')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe281('0x39')](util[_0xe281('0x17')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xe281('0xb')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe281('0x27')](function(_0x331294){EXTRACTED_REPORT=_0x331294;return dbH[_0xe281('0x2a')][_0xe281('0x2b')](util[_0xe281('0x17')](_0xe281('0x3c'),QUERY),{'type':dbH[_0xe281('0x2a')][_0xe281('0x2d')][_0xe281('0x2e')]});})[_0xe281('0x27')](extractReport)[_0xe281('0x3d')](function(_0x5263bb){logger[_0xe281('0x39')](util['format'](_0xe281('0x3e'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x5263bb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe281('0x3f'));})[_0xe281('0x40')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x528370=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xe281('0x41'),'italics':__dirname+_0xe281('0x42'),'bolditalics':__dirname+_0xe281('0x43')}});return _0x528370;}function getPDFDocDefinitionFromHTML(_0xe8e88c,_0x529d63){var _0x4141f6=util[_0xe281('0x17')](_0xe281('0x44'),_0x529d63[_0xe281('0x45')],_0x529d63[_0xe281('0x46')]);var _0x4ed04b=moment()[_0xe281('0x17')](_0xe281('0x47'))[_0xe281('0xf')]();var _0x1f4f41=htmlToPdfmake(_0xe8e88c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1f4f41],'defaultStyle':{'font':_0xe281('0x48')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xe281('0x49'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe281('0x49'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xe281('0x1b')}];},'footer':function(_0x5744cc,_0x12ec90){return[{'text':util[_0xe281('0x17')](_0xe281('0x4a'),_0x4141f6,_0x5744cc,_0x12ec90,_0x4ed04b),'style':_0xe281('0x1f')}];}};}function writePDFDocument(_0x4a9009,_0x443b7f){return new Promise(function(_0x26bdfc,_0xa0816f){var _0x169e24=_0x4a9009[_0xe281('0x4b')](fs[_0xe281('0x4c')](_0x443b7f));_0x169e24['on'](_0xe281('0x4d'),function(){_0x26bdfc('finish');});_0x169e24['on']('error',function(_0x40583a){_0xa0816f(_0x40583a);});_0x4a9009[_0xe281('0x4e')]();});}exports[_0xe281('0x4f')]=function(_0x142af9,_0x2e4d1c){var _0x3dab37=getPDFPrinter();var _0x1f28e8=getPDFDocDefinitionFromHTML(_0x142af9,_0x2e4d1c);var _0x2ce070=_0x3dab37[_0xe281('0x50')](_0x1f28e8);return writePDFDocument(_0x2ce070,_0x2e4d1c[_0xe281('0x0')])['catch'](function(_0x410d2f){throw _0x410d2f;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4964b1a..aa6cc72 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 _0x9f4d=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','length','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','isInteger','forEach'];(function(_0xe42387,_0x254fed){var _0x2852af=function(_0xa0de5a){while(--_0xa0de5a){_0xe42387['push'](_0xe42387['shift']());}};_0x2852af(++_0x254fed);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x9f4d[_0x1e3671];return _0x48d5f5;};'use strict';var util=require(_0xd9f4('0x0'));var path=require(_0xd9f4('0x1'));var _=require(_0xd9f4('0x2'));var fs=require('fs');var json2xls=require(_0xd9f4('0x3'));var BPromise=require(_0xd9f4('0x4'));var zipdir=require(_0xd9f4('0x5'));var rimraf=require(_0xd9f4('0x6'));var db=require(_0xd9f4('0x7'))['db'];var dbH=require(_0xd9f4('0x7'))['dbH'];var logger=require(_0xd9f4('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd9f4('0x9')][0x2]);var QUERY=process[_0xd9f4('0x9')][0x3];var PATH=process[_0xd9f4('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x366b9d,_0x5cf448){var _0x6b13b5={'status':_0x366b9d};var _0x18305f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5cf448){_0x6b13b5['savename']=_0x5cf448;}return db[_0xd9f4('0xa')]['update'](_0x6b13b5,_0x18305f);}function main(){var _0x16cacf=0x1388;var _0x41709a;logger[_0xd9f4('0xb')](util[_0xd9f4('0xc')](_0xd9f4('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xd9f4('0xe')][_0xd9f4('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd9f4('0x10'),_0xd9f4('0x11')]})[_0xd9f4('0x12')](function(_0x104834){if(_0x104834){_0x41709a=_0x104834;_0x16cacf=_0x41709a[_0xd9f4('0x11')]||0x1388;}})[_0xd9f4('0x12')](function(){return dbH['sequelize'][_0xd9f4('0x13')](util[_0xd9f4('0xc')](_0xd9f4('0x14'),QUERY),{'type':dbH[_0xd9f4('0x15')][_0xd9f4('0x16')][_0xd9f4('0x17')]});})[_0xd9f4('0x12')](function(_0x12dcfb){if(!_0x12dcfb[0x0][_0xd9f4('0x18')]){return analyticExtractedReport(_0xd9f4('0x19'));}var _0xfd15a4=[];var _0x14c78e=0x0;if(_0x41709a[_0xd9f4('0x10')]){if(_0x12dcfb&&_0x12dcfb['length']){var _0x4dc76f=_['range'](_0x12dcfb[0x0]['num']/_0x16cacf);var _0x25a7fe=Number[_0xd9f4('0x1a')](_0x12dcfb[0x0][_0xd9f4('0x18')]/_0x16cacf)?_0x12dcfb[0x0]['num']%_0x16cacf:0x0;_0x4dc76f[_0xd9f4('0x1b')](function(_0x329d57){if(_0x329d57>0x0){_0x14c78e+=_0x16cacf;}_0xfd15a4[_0xd9f4('0x1c')](dbH['sequelize'][_0xd9f4('0x13')](util['format'](_0xd9f4('0x1d'),QUERY,_0x16cacf,_0x14c78e),{'type':dbH[_0xd9f4('0x15')][_0xd9f4('0x16')]['SELECT']}));});if(_0x25a7fe>0x0){_0x14c78e+=_0x16cacf;_0xfd15a4[_0xd9f4('0x1c')](dbH[_0xd9f4('0x15')]['query'](util['format'](_0xd9f4('0x1d'),QUERY,_0x25a7fe,_0x14c78e),{'type':dbH['sequelize'][_0xd9f4('0x16')][_0xd9f4('0x17')]}));}}}else{_0xfd15a4[_0xd9f4('0x1c')](dbH[_0xd9f4('0x15')][_0xd9f4('0x13')](QUERY,{'type':dbH[_0xd9f4('0x15')][_0xd9f4('0x16')][_0xd9f4('0x17')]}));}var _0x275989=path['dirname'](PATH);var _0x770a2c=path[_0xd9f4('0x1e')](PATH,_0xd9f4('0x1f'));var _0x3ee51c=_0x41709a[_0xd9f4('0x10')]&&_0xfd15a4[_0xd9f4('0x20')]>0x1;var _0x12958b=[];if(!fs['existsSync'](path[_0xd9f4('0x21')](_0x275989,_0x770a2c))&&_0x3ee51c){fs[_0xd9f4('0x22')](path[_0xd9f4('0x21')](_0x275989,_0x770a2c));}return BPromise[_0xd9f4('0x23')](_0xfd15a4,function(_0x47cc2a){_0x12958b['push'](_0x47cc2a);})['then'](function(){for(var _0x261903=0x0;_0x261903<_0x12958b['length'];_0x261903+=0x1){var _0x2ca69a;var _0x453a08=_0x12958b[_0x261903];if(_0x3ee51c){_0x2ca69a=path['join'](_0x275989,_0x770a2c,util['format'](_0xd9f4('0x24'),_0x770a2c,_0x261903,_0xd9f4('0x25')));}else{_0x2ca69a=path[_0xd9f4('0x21')](_0x275989,util[_0xd9f4('0xc')](_0xd9f4('0x26'),_0x770a2c,_0xd9f4('0x25')));}fs[_0xd9f4('0x27')](_0x2ca69a,json2xls(_0x453a08),_0xd9f4('0x28'));}})[_0xd9f4('0x12')](function(){if(_0x3ee51c){return new Promise(function(_0x21a8c5){zipdir(path[_0xd9f4('0x21')](_0x275989,_0x770a2c),{'saveTo':path[_0xd9f4('0x21')](_0x275989,util['format'](_0xd9f4('0x26'),_0x770a2c,'zip'))},function(_0x1eeae3,_0x255cd2){rimraf(path[_0xd9f4('0x21')](_0x275989,_0x770a2c),function(){});_0x21a8c5(_0xd9f4('0x29'));});});}})[_0xd9f4('0x12')](function(){logger[_0xd9f4('0xb')](util[_0xd9f4('0xc')](_0xd9f4('0x2a'),EXTRACTED_REPORT_ID,_0xd9f4('0x2b')));return analyticExtractedReport(_0xd9f4('0x2c'),_0x3ee51c?util[_0xd9f4('0xc')](_0xd9f4('0x26'),_0x770a2c,_0x3ee51c?_0xd9f4('0x2d'):'xlsx'):null);});})['catch'](function(_0x5eaca6){logger[_0xd9f4('0xb')](util[_0xd9f4('0xc')](_0xd9f4('0x2e'),EXTRACTED_REPORT_ID,_0xd9f4('0x2b')),util[_0xd9f4('0x2f')](_0x5eaca6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd9f4('0x30'));})[_0xd9f4('0x31')](function(){process[_0xd9f4('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3c26=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','QueryTypes','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize'];(function(_0x597d56,_0x56e638){var _0x2002c6=function(_0x292c20){while(--_0x292c20){_0x597d56['push'](_0x597d56['shift']());}};_0x2002c6(++_0x56e638);}(_0x3c26,0x122));var _0x63c2=function(_0x1a6edd,_0x4e2a1d){_0x1a6edd=_0x1a6edd-0x0;var _0x506e29=_0x3c26[_0x1a6edd];return _0x506e29;};'use strict';var util=require('util');var path=require(_0x63c2('0x0'));var _=require(_0x63c2('0x1'));var fs=require('fs');var json2xls=require(_0x63c2('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x63c2('0x3'));var rimraf=require(_0x63c2('0x4'));var db=require(_0x63c2('0x5'))['db'];var dbH=require(_0x63c2('0x5'))[_0x63c2('0x6')];var logger=require(_0x63c2('0x7'))(_0x63c2('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x63c2('0x9')][0x2]);var QUERY=process[_0x63c2('0x9')][0x3];var PATH=process[_0x63c2('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x22b6ff,_0x320422){var _0x39389c={'status':_0x22b6ff};var _0x47a855={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x320422){_0x39389c['savename']=_0x320422;}return db[_0x63c2('0xa')][_0x63c2('0xb')](_0x39389c,_0x47a855);}function main(){var _0x5411f4=0x1388;var _0xe86f43;logger[_0x63c2('0xc')](util[_0x63c2('0xd')](_0x63c2('0xe'),EXTRACTED_REPORT_ID,_0x63c2('0xf')));return db[_0x63c2('0x10')][_0x63c2('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x63c2('0x12'),_0x63c2('0x13')]})[_0x63c2('0x14')](function(_0x442b60){if(_0x442b60){_0xe86f43=_0x442b60;_0x5411f4=_0xe86f43[_0x63c2('0x13')]||0x1388;}})[_0x63c2('0x14')](function(){return dbH[_0x63c2('0x15')]['query'](util[_0x63c2('0xd')](_0x63c2('0x16'),QUERY),{'type':dbH[_0x63c2('0x15')]['QueryTypes'][_0x63c2('0x17')]});})[_0x63c2('0x14')](function(_0x109588){if(!_0x109588[0x0][_0x63c2('0x18')]){return analyticExtractedReport('Empty');}var _0x26eeac=[];var _0x242293=0x0;if(_0xe86f43[_0x63c2('0x12')]){if(_0x109588&&_0x109588[_0x63c2('0x19')]){var _0x4d02fb=_[_0x63c2('0x1a')](_0x109588[0x0]['num']/_0x5411f4);var _0x5a3279=Number[_0x63c2('0x1b')](_0x109588[0x0][_0x63c2('0x18')]/_0x5411f4)?_0x109588[0x0][_0x63c2('0x18')]%_0x5411f4:0x0;_0x4d02fb[_0x63c2('0x1c')](function(_0x282335){if(_0x282335>0x0){_0x242293+=_0x5411f4;}_0x26eeac['push'](dbH[_0x63c2('0x15')][_0x63c2('0x1d')](util[_0x63c2('0xd')](_0x63c2('0x1e'),QUERY,_0x5411f4,_0x242293),{'type':dbH['sequelize']['QueryTypes'][_0x63c2('0x17')]}));});if(_0x5a3279>0x0){_0x242293+=_0x5411f4;_0x26eeac[_0x63c2('0x1f')](dbH[_0x63c2('0x15')][_0x63c2('0x1d')](util[_0x63c2('0xd')](_0x63c2('0x1e'),QUERY,_0x5a3279,_0x242293),{'type':dbH[_0x63c2('0x15')][_0x63c2('0x20')]['SELECT']}));}}}else{_0x26eeac[_0x63c2('0x1f')](dbH['sequelize'][_0x63c2('0x1d')](QUERY,{'type':dbH[_0x63c2('0x15')][_0x63c2('0x20')][_0x63c2('0x17')]}));}var _0x190bce=path[_0x63c2('0x21')](PATH);var _0x26041d=path[_0x63c2('0x22')](PATH,_0x63c2('0x23'));var _0x36c874=_0xe86f43[_0x63c2('0x12')]&&_0x26eeac[_0x63c2('0x19')]>0x1;var _0x3d5d33=[];if(!fs['existsSync'](path[_0x63c2('0x24')](_0x190bce,_0x26041d))&&_0x36c874){fs[_0x63c2('0x25')](path[_0x63c2('0x24')](_0x190bce,_0x26041d));}return BPromise[_0x63c2('0x26')](_0x26eeac,function(_0x2225cb){_0x3d5d33[_0x63c2('0x1f')](_0x2225cb);})[_0x63c2('0x14')](function(){for(var _0x769256=0x0;_0x769256<_0x3d5d33[_0x63c2('0x19')];_0x769256+=0x1){var _0x580182;var _0x28847f=_0x3d5d33[_0x769256];if(_0x36c874){_0x580182=path['join'](_0x190bce,_0x26041d,util[_0x63c2('0xd')](_0x63c2('0x27'),_0x26041d,_0x769256,'xlsx'));}else{_0x580182=path[_0x63c2('0x24')](_0x190bce,util[_0x63c2('0xd')](_0x63c2('0x28'),_0x26041d,_0x63c2('0x29')));}fs[_0x63c2('0x2a')](_0x580182,json2xls(_0x28847f),_0x63c2('0x2b'));}})[_0x63c2('0x14')](function(){if(_0x36c874){return new Promise(function(_0x18a485){zipdir(path[_0x63c2('0x24')](_0x190bce,_0x26041d),{'saveTo':path[_0x63c2('0x24')](_0x190bce,util[_0x63c2('0xd')]('%s.%s',_0x26041d,_0x63c2('0x2c')))},function(_0xaba22b,_0x138b7a){rimraf(path[_0x63c2('0x24')](_0x190bce,_0x26041d),function(){});_0x18a485(_0x63c2('0x2d'));});});}})[_0x63c2('0x14')](function(){logger[_0x63c2('0xc')](util[_0x63c2('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x63c2('0xf')));return analyticExtractedReport(_0x63c2('0x2e'),_0x36c874?util[_0x63c2('0xd')](_0x63c2('0x28'),_0x26041d,_0x36c874?_0x63c2('0x2c'):_0x63c2('0x29')):null);});})[_0x63c2('0x2f')](function(_0x38391e){logger[_0x63c2('0xc')](util[_0x63c2('0xd')](_0x63c2('0x30'),EXTRACTED_REPORT_ID,_0x63c2('0xf')),util[_0x63c2('0x31')](_0x38391e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x63c2('0x32')](function(){process[_0x63c2('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index f4f0aff..af9469a 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 _0x5c03=['destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','groupBy','playback','hasOwnProperty','extensions','extension','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','priority','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','recordingFormat','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','intervals','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5c03,0x8b));var _0x35c0=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x5c03[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x35c0('0x0'));var util=require(_0x35c0('0x1'));function rewrite(_0x58e0a1,_0xe86755){var _0x3e6817=this;return _0x58e0a1[_0x35c0('0x2')]['Interval']['findAll']({'raw':!![]})['then'](function(_0x434a6b){_0x3e6817['intervals']=_0x434a6b;return _0x58e0a1[_0x35c0('0x2')][_0x35c0('0x3')][_0x35c0('0x4')]({'where':{'IntervalId':_0xe86755[_0x35c0('0x5')]},'raw':!![]});})['then'](function(_0x4467e0){return _0x58e0a1[_0x35c0('0x2')][_0x35c0('0x3')][_0x35c0('0x4')]({'where':{'exten':{'$in':_[_0x35c0('0x6')](_[_0x35c0('0x7')](_0x4467e0,_0x35c0('0x8')))}},'order':[{'raw':_0x35c0('0x9')}],'raw':!![]});})[_0x35c0('0xa')](function(_0x4dc3c4){var _0x28e247=_['filter'](_0x4dc3c4,{'priority':'1'});var _0x2c9172=_['filter'](_0x4dc3c4,{'isApp':0x1});var _0x4d6794=_[_0x35c0('0xb')](_0x2c9172,'exten');var _0x3dd480=['queue',_0x35c0('0xc')];var _0x4c82a4=[];var _0x8af64f=[];for(var _0x4c4b55 in _0x4d6794){if(_0x4d6794[_0x35c0('0xd')](_0x4c4b55)){_0x3e6817['priority']=0x2;_0x3e6817[_0x35c0('0xe')]=[];_0x3e6817[_0x35c0('0xf')]=_['find'](_0x28e247,{'exten':_0x4d6794[_0x4c4b55][0x0]['exten']});_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0]['type'],'app':_0x35c0('0x11'),'appdata':util[_0x35c0('0x12')](_0x35c0('0x13'),_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')]),'context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817['priority']++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});if(_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')]===_0x35c0('0x17')){_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0]['type'],'app':_0x35c0('0x11'),'appdata':_0x35c0('0x18')+_0x4d6794[_0x4c4b55][0x0]['VoiceExtensionId'],'context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817[_0x35c0('0x19')]++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});}else if(_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')]==='outbound'){if(_0x3e6817['extension']){_0x3e6817[_0x35c0('0xe')]['push']({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':_0x35c0('0x11'),'appdata':'CDR(destination)='+(_0x3e6817['extension']['cutdigits']?'${EXTEN:'+_0x3e6817[_0x35c0('0xf')][_0x35c0('0x1a')]+'}':_0x35c0('0x1b')),'context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817[_0x35c0('0x19')]++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});}_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0]['type'],'app':_0x35c0('0x11'),'appdata':_0x35c0('0x18')+_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')],'context':_0x4d6794[_0x4c4b55][0x0]['context'],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817[_0x35c0('0x19')]++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});var _0x44f262=_0x3e6817[_0x35c0('0x19')]++;_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0]['type'],'app':_0x35c0('0x1c'),'appdata':_0x35c0('0x1d')+(_0x44f262+0x2)+_0x35c0('0x1e')+(_0x44f262+0x1)+')','context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x44f262,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});if(_0x3e6817[_0x35c0('0xf')]){_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':'Set','appdata':_0x3e6817['extension'][_0x35c0('0x1a')]?_0x35c0('0x1f')+_0x3e6817['extension'][_0x35c0('0x1a')]+'}':_0x35c0('0x20'),'context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0]['exten'],'priority':_0x3e6817[_0x35c0('0x19')]++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});}_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':_0x35c0('0x11'),'appdata':_0x35c0('0x21')+_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')],'context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817['priority']++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});if(_0x3e6817[_0x35c0('0xf')]&&_0x3e6817[_0x35c0('0xf')][_0x35c0('0xd')]('recordingFormat')&&_0x3e6817[_0x35c0('0xf')]['recordingFormat']!==_0x35c0('0x22')){_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817['priority']++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});_0x3e6817['extensions'][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':_0x35c0('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3e6817[_0x35c0('0xf')][_0x35c0('0x23')]||'wav','context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817[_0x35c0('0x19')]++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});}}_0x3e6817[_0x35c0('0xe')]['push']({'type':_0x4d6794[_0x4c4b55][0x0]['type'],'app':_0x35c0('0x11'),'appdata':_0x35c0('0x24'),'context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817[_0x35c0('0x19')]++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});_0x3e6817[_0x35c0('0xe')]['push']({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':_0x35c0('0x11'),'appdata':_0x35c0('0x25'),'context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817['priority']++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0]['VoiceExtensionId']});_0x3e6817['extensions']['push']({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':_0x35c0('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x15')],'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'priority':_0x3e6817['priority']++,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});for(var _0x1505d7=0x0,_0x4dce61=0x0;_0x1505d7<_0x4d6794[_0x4c4b55][_0x35c0('0x26')];_0x1505d7+=0x1,_0x4dce61=0x0){var _0x5ec335=_0x4d6794[_0x4c4b55][_0x1505d7];if(_0x5ec335[_0x35c0('0x14')]){_0x5ec335['type']=_0x5ec335[_0x35c0('0x14')][_0x35c0('0x27')]();}var _0x3e808c=[];var _0x132314=[];delete _0x5ec335['id'];delete _0x5ec335[_0x35c0('0x28')];delete _0x5ec335[_0x35c0('0x29')];var _0x47a14a=_0x5ec335[_0x35c0('0x2a')]!=='*,*,*,*'?[_0x5ec335['interval']]:_0x5ec335[_0x35c0('0x5')]?_[_0x35c0('0x7')](_['filter'](_0x3e6817[_0x35c0('0x2b')],{'IntervalId':_0x5ec335[_0x35c0('0x5')]}),_0x35c0('0x2a')):[];if(_0x5ec335['hasOwnProperty']('tag')){if(_0x5ec335[_0x35c0('0x2c')]&&_0x5ec335[_0x35c0('0x2c')]!=='--'){_0x3e808c[_0x35c0('0x10')]({'type':_0x5ec335[_0x35c0('0x14')],'app':_0x35c0('0x11'),'appdata':'CDR(tag)='+_0x5ec335[_0x35c0('0x2c')],'context':_0x5ec335['context'],'exten':_0x5ec335[_0x35c0('0x8')],'priority':_0x47a14a[_0x35c0('0x26')]+_0x3e6817[_0x35c0('0x19')]+_0x4dce61++,'VoiceExtensionId':_0x5ec335['VoiceExtensionId']});}}if(_0x5ec335[_0x35c0('0x14')]===_0x35c0('0x2d')&&_0x5ec335['hasOwnProperty'](_0x35c0('0x2e'))){if(_0x5ec335['callerID']){_0x3e808c[_0x35c0('0x10')]({'type':_0x5ec335[_0x35c0('0x14')],'app':_0x35c0('0x1c'),'appdata':_0x35c0('0x2f')+_0x5ec335[_0x35c0('0x2e')]+')','context':_0x5ec335[_0x35c0('0x15')],'exten':_0x5ec335[_0x35c0('0x8')],'priority':_0x47a14a['length']+_0x3e6817[_0x35c0('0x19')]+_0x4dce61++,'VoiceExtensionId':_0x5ec335['VoiceExtensionId']});}else{_0x3e808c[_0x35c0('0x10')]({'type':_0x5ec335[_0x35c0('0x14')],'app':_0x35c0('0x1c'),'appdata':_0x35c0('0x30'),'context':_0x5ec335[_0x35c0('0x15')],'exten':_0x5ec335[_0x35c0('0x8')],'priority':_0x47a14a[_0x35c0('0x26')]+_0x3e6817[_0x35c0('0x19')]+_0x4dce61++,'VoiceExtensionId':_0x5ec335['VoiceExtensionId']});}}if(_0x5ec335[_0x35c0('0xd')]('answer')){if(_0x3dd480[_0x35c0('0x31')](_0x5ec335[_0x35c0('0x32')][_0x35c0('0x27')]())>=0x0&&_0x5ec335['appType']!==_0x35c0('0x33')){if(_0x5ec335[_0x35c0('0x34')]){_0x3e808c['push']({'type':_0x5ec335[_0x35c0('0x14')],'app':'ExecIf','appdata':_0x35c0('0x35'),'context':_0x5ec335['context'],'exten':_0x5ec335['exten'],'priority':_0x47a14a[_0x35c0('0x26')]+_0x3e6817[_0x35c0('0x19')]+_0x4dce61++,'VoiceExtensionId':_0x5ec335[_0x35c0('0x16')]});_0x3e808c[_0x35c0('0x10')]({'type':_0x5ec335[_0x35c0('0x14')],'app':'Set','appdata':_0x35c0('0x36'),'context':_0x5ec335[_0x35c0('0x15')],'exten':_0x5ec335[_0x35c0('0x8')],'priority':_0x47a14a[_0x35c0('0x26')]+_0x3e6817['priority']+_0x4dce61++,'VoiceExtensionId':_0x5ec335['VoiceExtensionId']});}else{_0x3e808c[_0x35c0('0x10')]({'type':_0x5ec335[_0x35c0('0x14')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5ec335['context'],'exten':_0x5ec335[_0x35c0('0x8')],'priority':_0x47a14a['length']+_0x3e6817[_0x35c0('0x19')]+_0x4dce61++,'VoiceExtensionId':_0x5ec335[_0x35c0('0x16')]});_0x3e808c['push']({'type':_0x5ec335[_0x35c0('0x14')],'app':_0x35c0('0x11'),'appdata':_0x35c0('0x37'),'context':_0x5ec335['context'],'exten':_0x5ec335['exten'],'priority':_0x47a14a[_0x35c0('0x26')]+_0x3e6817[_0x35c0('0x19')]+_0x4dce61++,'VoiceExtensionId':_0x5ec335[_0x35c0('0x16')]});}}}for(var _0x2073d1=0x0;_0x2073d1<_0x47a14a[_0x35c0('0x26')];_0x2073d1+=0x1){var _0x21c251=_0x3e6817['priority']+_0x47a14a[_0x35c0('0x26')];var _0x5dd3f6=_0x2073d1===_0x47a14a[_0x35c0('0x26')]-0x1?_0x3e6817[_0x35c0('0x19')]+_0x3e808c[_0x35c0('0x26')]+_0x132314[_0x35c0('0x26')]+0x2:_0x3e6817[_0x35c0('0x19')]+_0x2073d1+0x1;_0x3e808c['splice'](_0x2073d1,0x0,{'type':_0x5ec335[_0x35c0('0x14')],'app':_0x35c0('0x38'),'appdata':_0x47a14a[_0x2073d1]+'?'+_0x5ec335[_0x35c0('0x15')]+_0x35c0('0x39')+_0x21c251+':'+_0x5ec335[_0x35c0('0x15')]+',${EXTEN},'+_0x5dd3f6,'exten':_0x5ec335['exten'],'context':_0x5ec335[_0x35c0('0x15')],'priority':_0x3e6817[_0x35c0('0x19')]+_0x2073d1,'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});}_0x5ec335[_0x35c0('0x19')]=_0x3e808c[_0x35c0('0x26')]?_[_0x35c0('0x3a')](_0x3e808c)[_0x35c0('0x19')]+0x1:_0x3e6817[_0x35c0('0x19')];_0x3e6817[_0x35c0('0x19')]=(_0x132314[_0x35c0('0x26')]?_[_0x35c0('0x3a')](_0x132314)['priority']:_0x5ec335[_0x35c0('0x19')])+0x1;_0x3e6817[_0x35c0('0xe')]=_[_0x35c0('0x3b')](_0x3e6817['extensions'],_0x3e808c,[_0x5ec335],_0x132314);}_0x3e6817[_0x35c0('0xe')][_0x35c0('0x10')]({'type':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x14')],'app':_0x35c0('0x3c'),'exten':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x8')],'context':_0x4d6794[_0x4c4b55][0x0]['context'],'priority':_0x3e6817[_0x35c0('0x19')],'VoiceExtensionId':_0x4d6794[_0x4c4b55][0x0][_0x35c0('0x16')]});_0x4c82a4['push'](_0x4d6794[_0x4c4b55][0x0]['VoiceExtensionId']);_0x8af64f=_[_0x35c0('0x3b')](_0x8af64f,_0x3e6817[_0x35c0('0xe')]);}}return _0x58e0a1[_0x35c0('0x3d')](function(_0x367f30){return _0x58e0a1[_0x35c0('0x2')][_0x35c0('0x3')][_0x35c0('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x4c82a4}},'transaction':_0x367f30})['then'](function(_0x2cc58a){return _0x58e0a1['models'][_0x35c0('0x3')][_0x35c0('0x3f')](_[_0x35c0('0x40')](_0x8af64f,_0x35c0('0x19')),{'transaction':_0x367f30});});});})['catch'](function(_0x47d8ed){console[_0x35c0('0x41')](_0x47d8ed);});}exports[_0x35c0('0x42')]=rewrite; \ No newline at end of file +var _0x6c35=['VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','util','findAll','then','models','VoiceExtension','IntervalId','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','extensions','extension','find','push','type','format','CDR(type)=%s','inbound','Set','CDR(routeid)=','context','priority'];(function(_0x4ff619,_0x2f3035){var _0x402529=function(_0xd2dfb3){while(--_0xd2dfb3){_0x4ff619['push'](_0x4ff619['shift']());}};_0x402529(++_0x2f3035);}(_0x6c35,0x101));var _0x56c3=function(_0x337eee,_0x21a4a7){_0x337eee=_0x337eee-0x0;var _0x4fbf88=_0x6c35[_0x337eee];return _0x4fbf88;};'use strict';var _=require(_0x56c3('0x0'));var util=require(_0x56c3('0x1'));function rewrite(_0x25bb81,_0x3afc51){var _0x3b63f3=this;return _0x25bb81['models']['Interval'][_0x56c3('0x2')]({'raw':!![]})[_0x56c3('0x3')](function(_0x573e1e){_0x3b63f3['intervals']=_0x573e1e;return _0x25bb81[_0x56c3('0x4')][_0x56c3('0x5')]['findAll']({'where':{'IntervalId':_0x3afc51[_0x56c3('0x6')]},'raw':!![]});})[_0x56c3('0x3')](function(_0x1c83fb){return _0x25bb81['models']['VoiceExtension'][_0x56c3('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0x56c3('0x7')](_0x1c83fb,'exten'))}},'order':[{'raw':_0x56c3('0x8')}],'raw':!![]});})[_0x56c3('0x3')](function(_0x2e9e35){var _0x25e8c9=_[_0x56c3('0x9')](_0x2e9e35,{'priority':'1'});var _0x10742b=_[_0x56c3('0x9')](_0x2e9e35,{'isApp':0x1});var _0x393bec=_[_0x56c3('0xa')](_0x10742b,_0x56c3('0xb'));var _0x20fed6=[_0x56c3('0xc'),_0x56c3('0xd')];var _0x464878=[];var _0x248519=[];for(var _0x563472 in _0x393bec){if(_0x393bec[_0x56c3('0xe')](_0x563472)){_0x3b63f3['priority']=0x2;_0x3b63f3[_0x56c3('0xf')]=[];_0x3b63f3[_0x56c3('0x10')]=_[_0x56c3('0x11')](_0x25e8c9,{'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')]});_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':'Set','appdata':util[_0x56c3('0x14')](_0x56c3('0x15'),_0x393bec[_0x563472][0x0]['type']),'context':_0x393bec[_0x563472][0x0]['context'],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3['priority']++,'VoiceExtensionId':_0x393bec[_0x563472][0x0]['VoiceExtensionId']});if(_0x393bec[_0x563472][0x0][_0x56c3('0x13')]===_0x56c3('0x16')){_0x3b63f3['extensions'][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':_0x56c3('0x18')+_0x393bec[_0x563472][0x0]['VoiceExtensionId'],'context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3[_0x56c3('0x1a')]++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});}else if(_0x393bec[_0x563472][0x0][_0x56c3('0x13')]==='outbound'){if(_0x3b63f3[_0x56c3('0x10')]){_0x3b63f3[_0x56c3('0xf')]['push']({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':_0x56c3('0x1c')+(_0x3b63f3[_0x56c3('0x10')][_0x56c3('0x1d')]?_0x56c3('0x1e')+_0x3b63f3['extension'][_0x56c3('0x1d')]+'}':_0x56c3('0x1f')),'context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0]['exten'],'priority':_0x3b63f3['priority']++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});}_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':'Set','appdata':_0x56c3('0x18')+_0x393bec[_0x563472][0x0][_0x56c3('0x1b')],'context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0]['exten'],'priority':_0x3b63f3[_0x56c3('0x1a')]++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});var _0x13d1f5=_0x3b63f3[_0x56c3('0x1a')]++;_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0]['type'],'app':_0x56c3('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x13d1f5+0x2)+_0x56c3('0x21')+(_0x13d1f5+0x1)+')','context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x13d1f5,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});if(_0x3b63f3['extension']){_0x3b63f3[_0x56c3('0xf')]['push']({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':_0x3b63f3[_0x56c3('0x10')]['cutdigits']?_0x56c3('0x22')+_0x3b63f3[_0x56c3('0x10')]['cutdigits']+'}':_0x56c3('0x23'),'context':_0x393bec[_0x563472][0x0]['context'],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3['priority']++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});}_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':_0x56c3('0x24')+_0x393bec[_0x563472][0x0][_0x56c3('0x1b')],'context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3[_0x56c3('0x1a')]++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});if(_0x3b63f3[_0x56c3('0x10')]&&_0x3b63f3['extension']['hasOwnProperty']('recordingFormat')&&_0x3b63f3['extension']['recordingFormat']!==_0x56c3('0x25')){_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':_0x56c3('0x26'),'context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3['priority']++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3b63f3[_0x56c3('0x10')]['recordingFormat']||'wav','context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3[_0x56c3('0x1a')]++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});}}_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':_0x56c3('0x27'),'context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3[_0x56c3('0x1a')]++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});_0x3b63f3[_0x56c3('0xf')][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x17'),'appdata':_0x56c3('0x28'),'context':_0x393bec[_0x563472][0x0]['context'],'exten':_0x393bec[_0x563472][0x0]['exten'],'priority':_0x3b63f3[_0x56c3('0x1a')]++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});_0x3b63f3['extensions'][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':'Set','appdata':_0x56c3('0x29'),'context':_0x393bec[_0x563472][0x0][_0x56c3('0x19')],'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'priority':_0x3b63f3[_0x56c3('0x1a')]++,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});for(var _0xa1d952=0x0,_0x1ceb98=0x0;_0xa1d952<_0x393bec[_0x563472][_0x56c3('0x2a')];_0xa1d952+=0x1,_0x1ceb98=0x0){var _0x1b031e=_0x393bec[_0x563472][_0xa1d952];if(_0x1b031e[_0x56c3('0x13')]){_0x1b031e[_0x56c3('0x13')]=_0x1b031e[_0x56c3('0x13')][_0x56c3('0x2b')]();}var _0x1ca000=[];var _0x1d3918=[];delete _0x1b031e['id'];delete _0x1b031e['createdAt'];delete _0x1b031e[_0x56c3('0x2c')];var _0x4b21ce=_0x1b031e[_0x56c3('0x2d')]!==_0x56c3('0x2e')?[_0x1b031e[_0x56c3('0x2d')]]:_0x1b031e[_0x56c3('0x6')]?_[_0x56c3('0x7')](_['filter'](_0x3b63f3['intervals'],{'IntervalId':_0x1b031e['IntervalId']}),'interval'):[];if(_0x1b031e[_0x56c3('0xe')](_0x56c3('0x2f'))){if(_0x1b031e[_0x56c3('0x2f')]&&_0x1b031e['tag']!=='--'){_0x1ca000[_0x56c3('0x12')]({'type':_0x1b031e['type'],'app':_0x56c3('0x17'),'appdata':'CDR(tag)='+_0x1b031e[_0x56c3('0x2f')],'context':_0x1b031e['context'],'exten':_0x1b031e[_0x56c3('0xb')],'priority':_0x4b21ce[_0x56c3('0x2a')]+_0x3b63f3[_0x56c3('0x1a')]+_0x1ceb98++,'VoiceExtensionId':_0x1b031e['VoiceExtensionId']});}}if(_0x1b031e[_0x56c3('0x13')]===_0x56c3('0x30')&&_0x1b031e[_0x56c3('0xe')](_0x56c3('0x31'))){if(_0x1b031e[_0x56c3('0x31')]){_0x1ca000[_0x56c3('0x12')]({'type':_0x1b031e['type'],'app':_0x56c3('0x20'),'appdata':_0x56c3('0x32')+_0x1b031e[_0x56c3('0x31')]+')','context':_0x1b031e['context'],'exten':_0x1b031e['exten'],'priority':_0x4b21ce[_0x56c3('0x2a')]+_0x3b63f3[_0x56c3('0x1a')]+_0x1ceb98++,'VoiceExtensionId':_0x1b031e[_0x56c3('0x1b')]});}else{_0x1ca000[_0x56c3('0x12')]({'type':_0x1b031e[_0x56c3('0x13')],'app':_0x56c3('0x20'),'appdata':_0x56c3('0x33'),'context':_0x1b031e[_0x56c3('0x19')],'exten':_0x1b031e[_0x56c3('0xb')],'priority':_0x4b21ce['length']+_0x3b63f3[_0x56c3('0x1a')]+_0x1ceb98++,'VoiceExtensionId':_0x1b031e[_0x56c3('0x1b')]});}}if(_0x1b031e[_0x56c3('0xe')](_0x56c3('0x34'))){if(_0x20fed6[_0x56c3('0x35')](_0x1b031e['app'][_0x56c3('0x2b')]())>=0x0&&_0x1b031e[_0x56c3('0x36')]!==_0x56c3('0x37')){if(_0x1b031e['answer']){_0x1ca000['push']({'type':_0x1b031e[_0x56c3('0x13')],'app':_0x56c3('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1b031e[_0x56c3('0x19')],'exten':_0x1b031e[_0x56c3('0xb')],'priority':_0x4b21ce[_0x56c3('0x2a')]+_0x3b63f3[_0x56c3('0x1a')]+_0x1ceb98++,'VoiceExtensionId':_0x1b031e['VoiceExtensionId']});_0x1ca000[_0x56c3('0x12')]({'type':_0x1b031e['type'],'app':'Set','appdata':_0x56c3('0x38'),'context':_0x1b031e[_0x56c3('0x19')],'exten':_0x1b031e[_0x56c3('0xb')],'priority':_0x4b21ce[_0x56c3('0x2a')]+_0x3b63f3[_0x56c3('0x1a')]+_0x1ceb98++,'VoiceExtensionId':_0x1b031e['VoiceExtensionId']});}else{_0x1ca000[_0x56c3('0x12')]({'type':_0x1b031e[_0x56c3('0x13')],'app':_0x56c3('0x20'),'appdata':_0x56c3('0x39'),'context':_0x1b031e[_0x56c3('0x19')],'exten':_0x1b031e['exten'],'priority':_0x4b21ce[_0x56c3('0x2a')]+_0x3b63f3[_0x56c3('0x1a')]+_0x1ceb98++,'VoiceExtensionId':_0x1b031e[_0x56c3('0x1b')]});_0x1ca000['push']({'type':_0x1b031e['type'],'app':_0x56c3('0x17'),'appdata':_0x56c3('0x3a'),'context':_0x1b031e['context'],'exten':_0x1b031e['exten'],'priority':_0x4b21ce[_0x56c3('0x2a')]+_0x3b63f3['priority']+_0x1ceb98++,'VoiceExtensionId':_0x1b031e[_0x56c3('0x1b')]});}}}for(var _0x49a6b1=0x0;_0x49a6b1<_0x4b21ce[_0x56c3('0x2a')];_0x49a6b1+=0x1){var _0x2bd123=_0x3b63f3[_0x56c3('0x1a')]+_0x4b21ce[_0x56c3('0x2a')];var _0x2e7209=_0x49a6b1===_0x4b21ce[_0x56c3('0x2a')]-0x1?_0x3b63f3[_0x56c3('0x1a')]+_0x1ca000['length']+_0x1d3918[_0x56c3('0x2a')]+0x2:_0x3b63f3['priority']+_0x49a6b1+0x1;_0x1ca000[_0x56c3('0x3b')](_0x49a6b1,0x0,{'type':_0x1b031e[_0x56c3('0x13')],'app':_0x56c3('0x3c'),'appdata':_0x4b21ce[_0x49a6b1]+'?'+_0x1b031e[_0x56c3('0x19')]+_0x56c3('0x3d')+_0x2bd123+':'+_0x1b031e[_0x56c3('0x19')]+_0x56c3('0x3d')+_0x2e7209,'exten':_0x1b031e[_0x56c3('0xb')],'context':_0x1b031e['context'],'priority':_0x3b63f3[_0x56c3('0x1a')]+_0x49a6b1,'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});}_0x1b031e['priority']=_0x1ca000[_0x56c3('0x2a')]?_[_0x56c3('0x3e')](_0x1ca000)['priority']+0x1:_0x3b63f3[_0x56c3('0x1a')];_0x3b63f3[_0x56c3('0x1a')]=(_0x1d3918['length']?_[_0x56c3('0x3e')](_0x1d3918)[_0x56c3('0x1a')]:_0x1b031e['priority'])+0x1;_0x3b63f3[_0x56c3('0xf')]=_[_0x56c3('0x3f')](_0x3b63f3[_0x56c3('0xf')],_0x1ca000,[_0x1b031e],_0x1d3918);}_0x3b63f3['extensions'][_0x56c3('0x12')]({'type':_0x393bec[_0x563472][0x0][_0x56c3('0x13')],'app':_0x56c3('0x40'),'exten':_0x393bec[_0x563472][0x0][_0x56c3('0xb')],'context':_0x393bec[_0x563472][0x0]['context'],'priority':_0x3b63f3[_0x56c3('0x1a')],'VoiceExtensionId':_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]});_0x464878['push'](_0x393bec[_0x563472][0x0][_0x56c3('0x1b')]);_0x248519=_[_0x56c3('0x3f')](_0x248519,_0x3b63f3['extensions']);}}return _0x25bb81[_0x56c3('0x41')](function(_0x76b33d){return _0x25bb81[_0x56c3('0x4')][_0x56c3('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x464878}},'transaction':_0x76b33d})[_0x56c3('0x3')](function(_0x18d628){return _0x25bb81[_0x56c3('0x4')]['VoiceExtension'][_0x56c3('0x42')](_[_0x56c3('0x43')](_0x248519,'priority'),{'transaction':_0x76b33d});});});})[_0x56c3('0x44')](function(_0x8ca3ac){console[_0x56c3('0x45')](_0x8ca3ac);});}exports[_0x56c3('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 5b89837..37a2f50 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 _0xdf19=['NOW()','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','select','str','calleridnum','id\x20IN\x20?','VoiceQueue','outbound','CmList','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','then','catch','onlyIfOpen','all','findAll','Lists','CampaignId','Campaign','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','null','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','field','toString'];(function(_0x4dec1d,_0x50d54a){var _0x3385ca=function(_0x260a51){while(--_0x260a51){_0x4dec1d['push'](_0x4dec1d['shift']());}};_0x3385ca(++_0x50d54a);}(_0xdf19,0x17d));var _0x9df1=function(_0x11bd81,_0x11fa4c){_0x11bd81=_0x11bd81-0x0;var _0x158de0=_0xdf19[_0x11bd81];return _0x158de0;};'use strict';var BPromise=require(_0x9df1('0x0'));var util=require('util');var _=require(_0x9df1('0x1'));var fs=require('fs');var squel=require(_0x9df1('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x9df1('0x3'))['db'];var config=require(_0x9df1('0x4'));var logger=require(_0x9df1('0x5'))('api');config[_0x9df1('0x6')]=_[_0x9df1('0x7')](config['redis'],{'host':_0x9df1('0x8'),'port':0x18eb});var socket=require(_0x9df1('0x9'))(new Redis(config[_0x9df1('0x6')]));require(_0x9df1('0xa'))[_0x9df1('0xb')](socket);try{if(!process[_0x9df1('0xc')][0x2]||process['argv'][0x2]===_0x9df1('0xd')||process['argv'][0x2]==='null'){throw new Error(_0x9df1('0xe'));}var FILEPATH=process['argv'][0x2];if(!process[_0x9df1('0xc')][0x3]||process['argv'][0x3]===_0x9df1('0xd')||process[_0x9df1('0xc')][0x3]==='null'||!process[_0x9df1('0xc')][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]==='null'){throw new Error(_0x9df1('0xf'));}var FIELDS=_['zipObject'](process[_0x9df1('0xc')][0x3][_0x9df1('0x10')](','),process['argv'][0x4]['split'](','));if(!process[_0x9df1('0xc')][0x5]||process[_0x9df1('0xc')][0x5]===_0x9df1('0xd')||process[_0x9df1('0xc')][0x5]===_0x9df1('0x11')){throw new Error(_0x9df1('0x12'));}var LISTID=process[_0x9df1('0xc')][0x5];var COMPANYID=process[_0x9df1('0xc')][0x6]&&process['argv'][0x6]!==_0x9df1('0xd')&&process['argv'][0x6]!==_0x9df1('0x11')?process['argv'][0x6]:null;var DUPLICATES=process[_0x9df1('0xc')][0x7]&&process[_0x9df1('0xc')][0x7]!==_0x9df1('0xd')&&process[_0x9df1('0xc')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x9df1('0xc')][0x8]===_0x9df1('0xd')||process[_0x9df1('0xc')][0x8]==='null'){throw new Error(_0x9df1('0x13'));}var SOCKET_TIMESTAMP=process[_0x9df1('0xc')][0x8];}catch(_0x5431dc){logger[_0x9df1('0x14')](_0x5431dc);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(_0x12c67a,_0x32108c,_0x567df2,_0x1431d9){var _0x28f2de={'message':_0x32108c};_0x28f2de[_0x12c67a]=!![];if(_0x567df2){_0x28f2de[_0x9df1('0x15')]=_0x567df2;}if(_0x1431d9){_0x28f2de[_0x9df1('0x16')]=_0x1431d9;}return _0x28f2de;}function isEmail(_0x397b3c){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))*$/[_0x9df1('0x17')](_0x397b3c);}function checkRow(_0x544875,_0x1b9d60,_0x102dfa){return new BPromise(function(_0x65c132,_0x222023){if(_[_0x9df1('0x18')](_0x544875)){return _0x222023(handleCheckRowError(_0x9df1('0x14'),_0x9df1('0x19'),null,_0x102dfa));}if(_0x544875['errors']&&_0x544875[_0x9df1('0x1a')][_0x9df1('0x1b')]){var _0x29b3b1=_['map'](_0x544875[_0x9df1('0x1a')],'message')[_0x9df1('0x1c')](';');return _0x222023(handleCheckRowError(_0x9df1('0x14'),_0x29b3b1,null,_0x102dfa));}var _0x45e65d={};for(var _0x3aeead in FIELDS){if(FIELDS[_0x9df1('0x1d')](_0x3aeead)&&FIELDS[_0x3aeead]){_0x45e65d[_0x3aeead]=_0x544875[_0x9df1('0x1e')][0x0][FIELDS[_0x3aeead]]||_0x544875[_0x9df1('0x1e')][0x0]['\ufeff'+FIELDS[_0x3aeead]];}}if(!_0x45e65d['firstName']){return _0x222023(handleCheckRowError(_0x9df1('0x14'),_0x9df1('0x1f'),null,_0x102dfa));}if(!_0x45e65d[_0x9df1('0x20')]){return _0x222023(handleCheckRowError(_0x9df1('0x14'),_0x9df1('0x21'),null,_0x102dfa));}if(_0x45e65d[_0x9df1('0x22')]){var _0x4a0a2f=moment(_0x45e65d[_0x9df1('0x22')],_0x9df1('0x23'));if(!_0x4a0a2f['isValid']()){return _0x222023(handleCheckRowError(_0x9df1('0x14'),_0x9df1('0x24'),null,_0x102dfa));}}if(_0x45e65d['email']){if(!isEmail(_0x45e65d[_0x9df1('0x25')])){return _0x222023(handleCheckRowError('error',_0x9df1('0x26'),null,_0x102dfa));}}_0x45e65d[_0x9df1('0x27')]=LISTID;_0x45e65d['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9df1('0x1b')]&&_0x1b9d60){var _0x319c13={};for(var _0x5f4ff9=0x0,_0x3e7964=DUPLICATES['length'];_0x5f4ff9<_0x3e7964;_0x5f4ff9+=0x1){_0x319c13[DUPLICATES[_0x5f4ff9]]=_0x45e65d[DUPLICATES[_0x5f4ff9]];}var _0x5ec557=_[_0x9df1('0x28')](_0x1b9d60,_0x319c13);if(_0x5ec557){return _0x222023(handleCheckRowError(_0x9df1('0x29'),_0x9df1('0x2a'),_0x5ec557,_0x102dfa));}}return db[_0x9df1('0x2b')][_0x9df1('0x2c')](_0x45e65d,{'raw':!![],'hooks':![],'fields':_[_0x9df1('0x2d')](_0x45e65d)})['then'](function(_0x4ead47){if(DUPLICATES&&DUPLICATES['length']&&_0x1b9d60){_0x1b9d60[_0x9df1('0x2e')](_[_0x9df1('0x2f')](_0x45e65d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4ead47['id'];return _0x65c132();})['catch'](function(_0x16cfbb){return _0x222023(handleCheckRowError(_0x9df1('0x14'),_0x9df1('0x30')+(_0x16cfbb[_0x9df1('0x31')]||JSON[_0x9df1('0x32')](_0x16cfbb)),null,_0x102dfa));});});}function checkHopper(){function _0x50d744(){return function(_0x147837){logger[_0x9df1('0x14')](_0x9df1('0x33'),_0x9df1('0x34'),util[_0x9df1('0x35')](_0x147837,{'showHidden':![],'depth':null}));};}var _0x890bf=function(_0x44587a,_0x448824){var _0x26fde8=squel[_0x9df1('0x36')]()[_0x9df1('0x37')](_0x9df1('0x38'))[_0x9df1('0x39')]([_0x9df1('0x20'),_0x9df1('0x3a'),_0x9df1('0x3b'),'ListId',_0x448824,_0x9df1('0x3c'),'updatedAt'],squel['select']()[_0x9df1('0x3d')](_0x9df1('0x20'),_0x9df1('0x20'))[_0x9df1('0x3d')]('NOW()','scheduledAt')[_0x9df1('0x3d')]('id',_0x9df1('0x3b'))[_0x9df1('0x3d')](LISTID[_0x9df1('0x3e')](),_0x9df1('0x27'))[_0x9df1('0x3d')](_0x44587a['id']['toString'](),_0x448824)['field'](_0x9df1('0x3f'),_0x9df1('0x3c'))[_0x9df1('0x3d')](_0x9df1('0x3f'),_0x9df1('0x40'))[_0x9df1('0x41')](_0x9df1('0x42'))['where'](_0x9df1('0x43'))['where'](_0x9df1('0x44'),LISTID['toString']())[_0x9df1('0x45')](_0x9df1('0x46'))[_0x9df1('0x45')](_0x9df1('0x47'),squel['select']()[_0x9df1('0x3d')](_0x9df1('0x20'))[_0x9df1('0x41')](_0x9df1('0x38'))['where'](_0x448824+_0x9df1('0x48'),_0x44587a['id'][_0x9df1('0x3e')]())))[_0x9df1('0x3e')]();return _0x26fde8;};var _0x5bd6fa=function(_0x343095,_0x1a7f8c){var _0x2fe838=squel['insert']()[_0x9df1('0x37')](_0x9df1('0x38'))[_0x9df1('0x39')]([_0x9df1('0x20'),_0x9df1('0x3a'),_0x9df1('0x3b'),_0x9df1('0x27'),_0x1a7f8c,'createdAt',_0x9df1('0x40')],squel[_0x9df1('0x49')]()[_0x9df1('0x3d')](_0x9df1('0x20'),_0x9df1('0x20'))['field']('NOW()',_0x9df1('0x3a'))[_0x9df1('0x3d')]('id',_0x9df1('0x3b'))[_0x9df1('0x3d')](LISTID[_0x9df1('0x3e')](),'ListId')[_0x9df1('0x3d')](_0x343095['id'][_0x9df1('0x3e')](),_0x1a7f8c)[_0x9df1('0x3d')]('NOW()','createdAt')[_0x9df1('0x3d')](_0x9df1('0x3f'),_0x9df1('0x40'))[_0x9df1('0x41')](_0x9df1('0x42'))[_0x9df1('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x9df1('0x44'),LISTID['toString']())[_0x9df1('0x45')]('id\x20IN\x20?',squel[_0x9df1('0x4a')](hopperContacts))[_0x9df1('0x45')](_0x9df1('0x46'))[_0x9df1('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9df1('0x49')]()[_0x9df1('0x3d')](_0x9df1('0x4b'))[_0x9df1('0x41')]('cm_hopper_final')[_0x9df1('0x45')](_0x1a7f8c+_0x9df1('0x48'),_0x343095['id']['toString']()))['where'](_0x9df1('0x47'),squel[_0x9df1('0x49')]()[_0x9df1('0x3d')](_0x9df1('0x20'))['from'](_0x9df1('0x38'))[_0x9df1('0x45')](_0x1a7f8c+_0x9df1('0x48'),_0x343095['id'][_0x9df1('0x3e')]())))[_0x9df1('0x3e')]();return _0x2fe838;};function _0x4b0b3a(_0x439f2d,_0x3e5b4f){var _0x34bf7b=squel[_0x9df1('0x36')]()['into'](_0x9df1('0x38'))['fromQuery']([_0x9df1('0x20'),_0x9df1('0x3a'),_0x9df1('0x3b'),'ListId',_0x3e5b4f,_0x9df1('0x3c'),_0x9df1('0x40')],squel[_0x9df1('0x49')]()['field'](_0x9df1('0x20'),_0x9df1('0x20'))[_0x9df1('0x3d')](_0x9df1('0x3f'),_0x9df1('0x3a'))[_0x9df1('0x3d')]('id',_0x9df1('0x3b'))[_0x9df1('0x3d')](LISTID[_0x9df1('0x3e')](),_0x9df1('0x27'))[_0x9df1('0x3d')](_0x439f2d['id'][_0x9df1('0x3e')](),_0x3e5b4f)[_0x9df1('0x3d')](_0x9df1('0x3f'),_0x9df1('0x3c'))[_0x9df1('0x3d')](_0x9df1('0x3f'),'updatedAt')[_0x9df1('0x41')](_0x9df1('0x42'))['where']('deletedAt\x20IS\x20NULL')[_0x9df1('0x45')](_0x9df1('0x44'),LISTID['toString']())[_0x9df1('0x45')]('id\x20IN\x20?',squel[_0x9df1('0x4a')](hopperContacts))[_0x9df1('0x45')](_0x9df1('0x46')))[_0x9df1('0x3e')]();return _0x34bf7b;}function _0x5645dd(_0x81b960,_0x1a7b5c){var _0x18e64c=squel[_0x9df1('0x36')]()['into']('cm_hopper_black')[_0x9df1('0x39')]([_0x9df1('0x20'),'ContactId','ListId',_0x1a7b5c,_0x9df1('0x3c'),_0x9df1('0x40')],squel[_0x9df1('0x49')]()[_0x9df1('0x3d')]('phone',_0x9df1('0x20'))[_0x9df1('0x3d')]('id',_0x9df1('0x3b'))[_0x9df1('0x3d')](LISTID['toString'](),_0x9df1('0x27'))[_0x9df1('0x3d')](_0x81b960['id'][_0x9df1('0x3e')](),_0x1a7b5c)['field']('NOW()',_0x9df1('0x3c'))[_0x9df1('0x3d')](_0x9df1('0x3f'),_0x9df1('0x40'))[_0x9df1('0x41')](_0x9df1('0x42'))[_0x9df1('0x45')](_0x9df1('0x43'))[_0x9df1('0x45')]('ListId\x20=\x20?',LISTID['toString']())[_0x9df1('0x45')](_0x9df1('0x4c'),squel[_0x9df1('0x4a')](hopperContacts))[_0x9df1('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x9df1('0x3e')]();return _0x18e64c;}return db[_0x9df1('0x4d')]['findAll']({'where':{'type':_0x9df1('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x9df1('0x4f')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x448468){var _0x385b2b=[];if(_0x448468){var _0x32e21b;for(var _0x1fa9c1=0x0,_0x1d03f3;_0x1fa9c1<_0x448468[_0x9df1('0x1b')];_0x1fa9c1+=0x1){_0x1d03f3=_0x448468[_0x1fa9c1][_0x9df1('0x50')]({'plain':!![]});switch(_0x1d03f3[_0x9df1('0x51')]){case _0x9df1('0x52'):_0x385b2b[_0x9df1('0x2e')](db[_0x9df1('0x53')][_0x9df1('0x54')](_0x5bd6fa(_0x1d03f3,_0x9df1('0x55')))[_0x9df1('0x56')](function(){})[_0x9df1('0x57')](_0x50d744()));break;case _0x9df1('0x58'):_0x385b2b[_0x9df1('0x2e')](db[_0x9df1('0x53')]['query'](_0x890bf(_0x1d03f3,_0x9df1('0x55')))['then'](function(){})[_0x9df1('0x57')](_0x50d744()));break;default:_0x385b2b[_0x9df1('0x2e')](db[_0x9df1('0x53')][_0x9df1('0x54')](_0x4b0b3a(_0x1d03f3,_0x9df1('0x55')))[_0x9df1('0x56')](function(){})[_0x9df1('0x57')](_0x50d744()));}}}return _0x385b2b;})[_0x9df1('0x59')]()[_0x9df1('0x56')](function(){return db[_0x9df1('0x4d')]['findAll']({'where':{'type':_0x9df1('0x4e')},'attributes':['id'],'include':[{'model':db[_0x9df1('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x9df1('0x56')](function(_0x17c396){var _0x35c485=[];if(_0x17c396){var _0x86db5c;for(var _0x23d148=0x0,_0x3c74ab;_0x23d148<_0x17c396['length'];_0x23d148+=0x1){_0x3c74ab=_0x17c396[_0x23d148][_0x9df1('0x50')]({'plain':!![]});_0x35c485['push'](db['sequelize'][_0x9df1('0x54')](_0x5645dd(_0x3c74ab,'VoiceQueueId'))['then'](function(){})[_0x9df1('0x57')](_0x50d744()));}}return _0x35c485;})[_0x9df1('0x59')]();})['then'](function(){return db['Campaign'][_0x9df1('0x5a')]({'attributes':['id',_0x9df1('0x51')],'include':[{'model':db['CmList'],'as':_0x9df1('0x5b'),'where':{'id':LISTID}}]})[_0x9df1('0x56')](function(_0x4ebc31){var _0xccd673=[];if(_0x4ebc31){for(var _0x894c7e=0x0,_0x13ee04;_0x894c7e<_0x4ebc31[_0x9df1('0x1b')];_0x894c7e+=0x1){_0x13ee04=_0x4ebc31[_0x894c7e]['get']({'plain':!![]});switch(_0x13ee04[_0x9df1('0x51')]){case _0x9df1('0x52'):_0xccd673[_0x9df1('0x2e')](db['sequelize']['query'](_0x5bd6fa(_0x13ee04,_0x9df1('0x5c')))[_0x9df1('0x56')](function(){})['catch'](_0x50d744()));break;case'onlyIfOpen':_0xccd673[_0x9df1('0x2e')](db[_0x9df1('0x53')][_0x9df1('0x54')](_0x890bf(_0x13ee04,_0x9df1('0x5c')))['then'](function(){})['catch'](_0x50d744()));break;default:_0xccd673['push'](db[_0x9df1('0x53')][_0x9df1('0x54')](_0x4b0b3a(_0x13ee04,_0x9df1('0x5c')))[_0x9df1('0x56')](function(){})['catch'](_0x50d744()));}}}return _0xccd673;})[_0x9df1('0x59')]();})[_0x9df1('0x56')](function(){return db[_0x9df1('0x5d')][_0x9df1('0x5a')]({'attributes':['id'],'include':[{'model':db[_0x9df1('0x4f')],'as':_0x9df1('0x5e'),'where':{'id':LISTID}}]})[_0x9df1('0x56')](function(_0x242bef){var _0x57c804=[];if(_0x242bef){for(var _0x24d4e7=0x0,_0x3708bd;_0x24d4e7<_0x242bef[_0x9df1('0x1b')];_0x24d4e7+=0x1){_0x3708bd=_0x242bef[_0x24d4e7][_0x9df1('0x50')]({'plain':!![]});_0x57c804[_0x9df1('0x2e')](db['sequelize']['query'](_0x5645dd(_0x3708bd,'CampaignId'))['then'](function(){})[_0x9df1('0x57')](_0x50d744()));}}return _0x57c804;})[_0x9df1('0x59')]();})[_0x9df1('0x57')](function(_0x2141fe){logger['error']('cmContact,\x20%s,\x20%s',_0x9df1('0x5f'),_0x2141fe[_0x9df1('0x31')]);});}var processPromises=function(_0x363168){return BPromise[_0x9df1('0x59')](promises)['then'](function(_0x152e2b){})[_0x9df1('0x57')](function(_0x2c27aa){logger['error'](_0x9df1('0x60'),JSON[_0x9df1('0x32')](_0x2c27aa));})['finally'](function(){socket[_0x9df1('0x61')](_0x9df1('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x363168){return _0x363168[_0x9df1('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x9df1('0x56')](function(){if(hopperContacts){return checkHopper();}})[_0x9df1('0x56')](function(){socket[_0x9df1('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9df1('0x64')](FILEPATH);}catch(_0x3261c7){logger[_0x9df1('0x14')](_0x9df1('0x65'),JSON[_0x9df1('0x32')](_0x3261c7));}finally{process[_0x9df1('0x66')](0x0);}});};process['on'](_0x9df1('0x67'),function(){logger[_0x9df1('0x68')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x9df1('0x69')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9df1('0x10')](',');return db[_0x9df1('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x30d84b){var _0xd2a46a=fs[_0x9df1('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0xd2a46a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x451d92,_0x5819cb){total+=0x1;var _0x24f384=total;promises[_0x9df1('0x2e')](checkRow(_0x451d92,_0x30d84b,_0x24f384)['then'](function(){success+=0x1;})[_0x9df1('0x57')](function(_0xbdea24){if(_0xbdea24[_0x9df1('0x14')]){errors+=0x1;delete _0xbdea24[_0x9df1('0x14')];}else if(_0xbdea24[_0x9df1('0x29')]){duplicates+=0x1;delete _0xbdea24[_0x9df1('0x29')];}rows[_0x9df1('0x2e')](_0xbdea24);}));if(total%0xc8===0x0){_0x5819cb[_0x9df1('0x6b')]();return processPromises(_0x5819cb);}},'complete':function(){return processPromises()[_0x9df1('0x56')](function(){logger[_0x9df1('0x68')](_0x9df1('0x6c'));endCsv();});},'error':function(_0x335dfc,_0x2c913b){logger['info'](_0x9df1('0x6d'),JSON['stringify'](_0x335dfc));endCsv();}});})[_0x9df1('0x57')](function(_0x4fd37c){logger[_0x9df1('0x14')](_0x9df1('0x6e'),JSON[_0x9df1('0x32')](_0x4fd37c));});}main(); \ No newline at end of file +var _0x2f02=['cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','query','VoiceQueueId','onlyIfOpen','sequelize','catch','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','map','errors','message','hasOwnProperty','data','firstName','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','duplicate','create','then','push','pick','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','phone','NOW()','ContactId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','into','id\x20IN\x20?','str','calleridnum','cm_hopper_final'];(function(_0x434f2e,_0x68493e){var _0x76c0b9=function(_0x7db698){while(--_0x7db698){_0x434f2e['push'](_0x434f2e['shift']());}};_0x76c0b9(++_0x68493e);}(_0x2f02,0x89));var _0x22f0=function(_0x2d37b7,_0x3bf618){_0x2d37b7=_0x2d37b7-0x0;var _0x4dfbdb=_0x2f02[_0x2d37b7];return _0x4dfbdb;};'use strict';var BPromise=require('bluebird');var util=require(_0x22f0('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0x22f0('0x1'));var Papa=require(_0x22f0('0x2'));var Redis=require('ioredis');var db=require(_0x22f0('0x3'))['db'];var config=require(_0x22f0('0x4'));var logger=require(_0x22f0('0x5'))(_0x22f0('0x6'));config[_0x22f0('0x7')]=_[_0x22f0('0x8')](config[_0x22f0('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x22f0('0x9'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process['argv'][0x2]||process[_0x22f0('0xa')][0x2]===_0x22f0('0xb')||process[_0x22f0('0xa')][0x2]==='null'){throw new Error(_0x22f0('0xc'));}var FILEPATH=process[_0x22f0('0xa')][0x2];if(!process[_0x22f0('0xa')][0x3]||process[_0x22f0('0xa')][0x3]===_0x22f0('0xb')||process[_0x22f0('0xa')][0x3]===_0x22f0('0xd')||!process['argv'][0x4]||process[_0x22f0('0xa')][0x4]===_0x22f0('0xb')||process['argv'][0x4]===_0x22f0('0xd')){throw new Error(_0x22f0('0xe'));}var FIELDS=_[_0x22f0('0xf')](process[_0x22f0('0xa')][0x3][_0x22f0('0x10')](','),process[_0x22f0('0xa')][0x4][_0x22f0('0x10')](','));if(!process[_0x22f0('0xa')][0x5]||process['argv'][0x5]===_0x22f0('0xb')||process[_0x22f0('0xa')][0x5]===_0x22f0('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x22f0('0xa')][0x5];var COMPANYID=process[_0x22f0('0xa')][0x6]&&process[_0x22f0('0xa')][0x6]!==_0x22f0('0xb')&&process[_0x22f0('0xa')][0x6]!==_0x22f0('0xd')?process[_0x22f0('0xa')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x22f0('0xa')][0x7]!==_0x22f0('0xb')&&process['argv'][0x7]!==_0x22f0('0xd')?process['argv'][0x7]:null;if(!process[_0x22f0('0xa')][0x8]||process[_0x22f0('0xa')][0x8]===_0x22f0('0xb')||process[_0x22f0('0xa')][0x8]===_0x22f0('0xd')){throw new Error(_0x22f0('0x11'));}var SOCKET_TIMESTAMP=process[_0x22f0('0xa')][0x8];}catch(_0x30ce3d){logger[_0x22f0('0x12')](_0x30ce3d);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(_0xe02e67,_0x350359,_0x5bfc4d,_0x396e85){var _0x598549={'message':_0x350359};_0x598549[_0xe02e67]=!![];if(_0x5bfc4d){_0x598549['contact']=_0x5bfc4d;}if(_0x396e85){_0x598549[_0x22f0('0x13')]=_0x396e85;}return _0x598549;}function isEmail(_0x1c5b7a){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))*$/[_0x22f0('0x14')](_0x1c5b7a);}function checkRow(_0x2c031f,_0x3d3cf1,_0x3767e8){return new BPromise(function(_0x49e7db,_0x618bcf){if(_['isNil'](_0x2c031f)){return _0x618bcf(handleCheckRowError(_0x22f0('0x12'),_0x22f0('0x15'),null,_0x3767e8));}if(_0x2c031f['errors']&&_0x2c031f['errors']['length']){var _0x93c33a=_[_0x22f0('0x16')](_0x2c031f[_0x22f0('0x17')],_0x22f0('0x18'))['join'](';');return _0x618bcf(handleCheckRowError(_0x22f0('0x12'),_0x93c33a,null,_0x3767e8));}var _0x585b96={};for(var _0x4f2084 in FIELDS){if(FIELDS[_0x22f0('0x19')](_0x4f2084)&&FIELDS[_0x4f2084]){_0x585b96[_0x4f2084]=_0x2c031f[_0x22f0('0x1a')][0x0][FIELDS[_0x4f2084]]||_0x2c031f['data'][0x0]['\ufeff'+FIELDS[_0x4f2084]];}}if(!_0x585b96[_0x22f0('0x1b')]){return _0x618bcf(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x3767e8));}if(!_0x585b96['phone']){return _0x618bcf(handleCheckRowError(_0x22f0('0x12'),_0x22f0('0x1c'),null,_0x3767e8));}if(_0x585b96[_0x22f0('0x1d')]){var _0x34c632=moment(_0x585b96[_0x22f0('0x1d')],'YYYY-MM-DD');if(!_0x34c632[_0x22f0('0x1e')]()){return _0x618bcf(handleCheckRowError(_0x22f0('0x12'),_0x22f0('0x1f'),null,_0x3767e8));}}if(_0x585b96['email']){if(!isEmail(_0x585b96[_0x22f0('0x20')])){return _0x618bcf(handleCheckRowError('error',_0x22f0('0x21'),null,_0x3767e8));}}_0x585b96['ListId']=LISTID;_0x585b96[_0x22f0('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x22f0('0x23')]&&_0x3d3cf1){var _0x500e5a={};for(var _0x236914=0x0,_0x5a32c2=DUPLICATES[_0x22f0('0x23')];_0x236914<_0x5a32c2;_0x236914+=0x1){_0x500e5a[DUPLICATES[_0x236914]]=_0x585b96[DUPLICATES[_0x236914]];}var _0x476caa=_['find'](_0x3d3cf1,_0x500e5a);if(_0x476caa){return _0x618bcf(handleCheckRowError(_0x22f0('0x24'),'Duplicate\x20Contact',_0x476caa,_0x3767e8));}}return db['CmContact'][_0x22f0('0x25')](_0x585b96,{'raw':!![],'hooks':![],'fields':_['keys'](_0x585b96)})[_0x22f0('0x26')](function(_0x39af1c){if(DUPLICATES&&DUPLICATES[_0x22f0('0x23')]&&_0x3d3cf1){_0x3d3cf1[_0x22f0('0x27')](_[_0x22f0('0x28')](_0x585b96,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x39af1c['id'];return _0x49e7db();})['catch'](function(_0x4208a3){return _0x618bcf(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x4208a3[_0x22f0('0x18')]||JSON[_0x22f0('0x29')](_0x4208a3)),null,_0x3767e8));});});}function checkHopper(){function _0x4c4b6a(){return function(_0x5ed0fd){logger[_0x22f0('0x12')](_0x22f0('0x2a'),_0x22f0('0x2b'),util[_0x22f0('0x2c')](_0x5ed0fd,{'showHidden':![],'depth':null}));};}var _0x4e85ba=function(_0xe513cd,_0x407c86){var _0x328098=squel[_0x22f0('0x2d')]()['into'](_0x22f0('0x2e'))[_0x22f0('0x2f')](['phone',_0x22f0('0x30'),'ContactId','ListId',_0x407c86,_0x22f0('0x31'),_0x22f0('0x32')],squel[_0x22f0('0x33')]()[_0x22f0('0x34')]('phone',_0x22f0('0x35'))['field'](_0x22f0('0x36'),_0x22f0('0x30'))['field']('id',_0x22f0('0x37'))[_0x22f0('0x34')](LISTID[_0x22f0('0x38')](),_0x22f0('0x39'))['field'](_0xe513cd['id']['toString'](),_0x407c86)[_0x22f0('0x34')](_0x22f0('0x36'),_0x22f0('0x31'))[_0x22f0('0x34')](_0x22f0('0x36'),_0x22f0('0x32'))['from'](_0x22f0('0x3a'))['where'](_0x22f0('0x3b'))[_0x22f0('0x3c')](_0x22f0('0x3d'),LISTID[_0x22f0('0x38')]())[_0x22f0('0x3c')](_0x22f0('0x3e'))[_0x22f0('0x3c')](_0x22f0('0x3f'),squel[_0x22f0('0x33')]()[_0x22f0('0x34')](_0x22f0('0x35'))[_0x22f0('0x40')](_0x22f0('0x2e'))['where'](_0x407c86+_0x22f0('0x41'),_0xe513cd['id'][_0x22f0('0x38')]())))[_0x22f0('0x38')]();return _0x328098;};var _0x3735e6=function(_0x36ef75,_0x127a5d){var _0x216f3f=squel[_0x22f0('0x2d')]()[_0x22f0('0x42')](_0x22f0('0x2e'))['fromQuery']([_0x22f0('0x35'),'scheduledAt',_0x22f0('0x37'),'ListId',_0x127a5d,_0x22f0('0x31'),_0x22f0('0x32')],squel[_0x22f0('0x33')]()[_0x22f0('0x34')](_0x22f0('0x35'),_0x22f0('0x35'))[_0x22f0('0x34')](_0x22f0('0x36'),'scheduledAt')[_0x22f0('0x34')]('id','ContactId')[_0x22f0('0x34')](LISTID[_0x22f0('0x38')](),_0x22f0('0x39'))[_0x22f0('0x34')](_0x36ef75['id'][_0x22f0('0x38')](),_0x127a5d)['field'](_0x22f0('0x36'),_0x22f0('0x31'))[_0x22f0('0x34')](_0x22f0('0x36'),_0x22f0('0x32'))[_0x22f0('0x40')]('cm_contacts')[_0x22f0('0x3c')](_0x22f0('0x3b'))['where']('ListId\x20=\x20?',LISTID[_0x22f0('0x38')]())[_0x22f0('0x3c')](_0x22f0('0x43'),squel[_0x22f0('0x44')](hopperContacts))[_0x22f0('0x3c')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x22f0('0x3f'),squel['select']()[_0x22f0('0x34')](_0x22f0('0x45'))[_0x22f0('0x40')](_0x22f0('0x46'))[_0x22f0('0x3c')](_0x127a5d+_0x22f0('0x41'),_0x36ef75['id'][_0x22f0('0x38')]()))[_0x22f0('0x3c')](_0x22f0('0x3f'),squel[_0x22f0('0x33')]()[_0x22f0('0x34')](_0x22f0('0x35'))[_0x22f0('0x40')](_0x22f0('0x2e'))[_0x22f0('0x3c')](_0x127a5d+'\x20=\x20?',_0x36ef75['id'][_0x22f0('0x38')]())))[_0x22f0('0x38')]();return _0x216f3f;};function _0xbb8152(_0x234090,_0x198034){var _0x508588=squel['insert']()['into'](_0x22f0('0x2e'))[_0x22f0('0x2f')]([_0x22f0('0x35'),_0x22f0('0x30'),'ContactId','ListId',_0x198034,_0x22f0('0x31'),_0x22f0('0x32')],squel[_0x22f0('0x33')]()[_0x22f0('0x34')](_0x22f0('0x35'),_0x22f0('0x35'))[_0x22f0('0x34')](_0x22f0('0x36'),'scheduledAt')[_0x22f0('0x34')]('id',_0x22f0('0x37'))[_0x22f0('0x34')](LISTID['toString'](),_0x22f0('0x39'))[_0x22f0('0x34')](_0x234090['id']['toString'](),_0x198034)[_0x22f0('0x34')](_0x22f0('0x36'),_0x22f0('0x31'))[_0x22f0('0x34')](_0x22f0('0x36'),_0x22f0('0x32'))['from'](_0x22f0('0x3a'))[_0x22f0('0x3c')](_0x22f0('0x3b'))[_0x22f0('0x3c')]('ListId\x20=\x20?',LISTID[_0x22f0('0x38')]())[_0x22f0('0x3c')](_0x22f0('0x43'),squel[_0x22f0('0x44')](hopperContacts))[_0x22f0('0x3c')](_0x22f0('0x3e')))[_0x22f0('0x38')]();return _0x508588;}function _0x42a41e(_0x42743f,_0x5d92d0){var _0x16a087=squel[_0x22f0('0x2d')]()[_0x22f0('0x42')](_0x22f0('0x47'))[_0x22f0('0x2f')]([_0x22f0('0x35'),_0x22f0('0x37'),_0x22f0('0x39'),_0x5d92d0,'createdAt',_0x22f0('0x32')],squel['select']()[_0x22f0('0x34')]('phone','phone')[_0x22f0('0x34')]('id',_0x22f0('0x37'))[_0x22f0('0x34')](LISTID[_0x22f0('0x38')](),'ListId')[_0x22f0('0x34')](_0x42743f['id']['toString'](),_0x5d92d0)['field']('NOW()',_0x22f0('0x31'))[_0x22f0('0x34')](_0x22f0('0x36'),_0x22f0('0x32'))[_0x22f0('0x40')]('cm_contacts')[_0x22f0('0x3c')](_0x22f0('0x3b'))[_0x22f0('0x3c')]('ListId\x20=\x20?',LISTID[_0x22f0('0x38')]())[_0x22f0('0x3c')](_0x22f0('0x43'),squel[_0x22f0('0x44')](hopperContacts))[_0x22f0('0x3c')](_0x22f0('0x3e')))[_0x22f0('0x38')]();return _0x16a087;}return db[_0x22f0('0x48')][_0x22f0('0x49')]({'where':{'type':_0x22f0('0x4a')},'attributes':['id',_0x22f0('0x4b')],'include':[{'model':db['CmList'],'as':_0x22f0('0x4c'),'where':{'id':LISTID}}]})[_0x22f0('0x26')](function(_0x124eb8){var _0x20a978=[];if(_0x124eb8){var _0x255f60;for(var _0x1027e9=0x0,_0x505798;_0x1027e9<_0x124eb8[_0x22f0('0x23')];_0x1027e9+=0x1){_0x505798=_0x124eb8[_0x1027e9][_0x22f0('0x4d')]({'plain':!![]});switch(_0x505798[_0x22f0('0x4b')]){case'always':_0x20a978[_0x22f0('0x27')](db['sequelize'][_0x22f0('0x4e')](_0x3735e6(_0x505798,_0x22f0('0x4f')))[_0x22f0('0x26')](function(){})['catch'](_0x4c4b6a()));break;case _0x22f0('0x50'):_0x20a978[_0x22f0('0x27')](db[_0x22f0('0x51')][_0x22f0('0x4e')](_0x4e85ba(_0x505798,_0x22f0('0x4f')))['then'](function(){})[_0x22f0('0x52')](_0x4c4b6a()));break;default:_0x20a978[_0x22f0('0x27')](db[_0x22f0('0x51')]['query'](_0xbb8152(_0x505798,'VoiceQueueId'))[_0x22f0('0x26')](function(){})[_0x22f0('0x52')](_0x4c4b6a()));}}}return _0x20a978;})[_0x22f0('0x53')]()['then'](function(){return db[_0x22f0('0x48')]['findAll']({'where':{'type':_0x22f0('0x4a')},'attributes':['id'],'include':[{'model':db[_0x22f0('0x54')],'as':_0x22f0('0x55'),'where':{'id':LISTID}}]})[_0x22f0('0x26')](function(_0x1af7e2){var _0x5944f3=[];if(_0x1af7e2){var _0x35a649;for(var _0x141133=0x0,_0x5abee3;_0x141133<_0x1af7e2[_0x22f0('0x23')];_0x141133+=0x1){_0x5abee3=_0x1af7e2[_0x141133][_0x22f0('0x4d')]({'plain':!![]});_0x5944f3[_0x22f0('0x27')](db[_0x22f0('0x51')][_0x22f0('0x4e')](_0x42a41e(_0x5abee3,_0x22f0('0x4f')))[_0x22f0('0x26')](function(){})[_0x22f0('0x52')](_0x4c4b6a()));}}return _0x5944f3;})[_0x22f0('0x53')]();})[_0x22f0('0x26')](function(){return db[_0x22f0('0x56')]['findAll']({'attributes':['id',_0x22f0('0x4b')],'include':[{'model':db[_0x22f0('0x54')],'as':_0x22f0('0x4c'),'where':{'id':LISTID}}]})[_0x22f0('0x26')](function(_0x27bece){var _0x39db98=[];if(_0x27bece){for(var _0x5771f6=0x0,_0x5d1192;_0x5771f6<_0x27bece[_0x22f0('0x23')];_0x5771f6+=0x1){_0x5d1192=_0x27bece[_0x5771f6][_0x22f0('0x4d')]({'plain':!![]});switch(_0x5d1192[_0x22f0('0x4b')]){case'always':_0x39db98['push'](db['sequelize'][_0x22f0('0x4e')](_0x3735e6(_0x5d1192,'CampaignId'))[_0x22f0('0x26')](function(){})[_0x22f0('0x52')](_0x4c4b6a()));break;case _0x22f0('0x50'):_0x39db98[_0x22f0('0x27')](db[_0x22f0('0x51')][_0x22f0('0x4e')](_0x4e85ba(_0x5d1192,_0x22f0('0x57')))[_0x22f0('0x26')](function(){})[_0x22f0('0x52')](_0x4c4b6a()));break;default:_0x39db98['push'](db['sequelize'][_0x22f0('0x4e')](_0xbb8152(_0x5d1192,_0x22f0('0x57')))[_0x22f0('0x26')](function(){})[_0x22f0('0x52')](_0x4c4b6a()));}}}return _0x39db98;})[_0x22f0('0x53')]();})[_0x22f0('0x26')](function(){return db[_0x22f0('0x56')][_0x22f0('0x49')]({'attributes':['id'],'include':[{'model':db[_0x22f0('0x54')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x22f0('0x26')](function(_0x3b9bdc){var _0x305fac=[];if(_0x3b9bdc){for(var _0x33749a=0x0,_0x1e831d;_0x33749a<_0x3b9bdc[_0x22f0('0x23')];_0x33749a+=0x1){_0x1e831d=_0x3b9bdc[_0x33749a][_0x22f0('0x4d')]({'plain':!![]});_0x305fac[_0x22f0('0x27')](db[_0x22f0('0x51')][_0x22f0('0x4e')](_0x42a41e(_0x1e831d,_0x22f0('0x57')))[_0x22f0('0x26')](function(){})['catch'](_0x4c4b6a()));}}return _0x305fac;})[_0x22f0('0x53')]();})[_0x22f0('0x52')](function(_0xfd997f){logger[_0x22f0('0x12')](_0x22f0('0x58'),_0x22f0('0x59'),_0xfd997f[_0x22f0('0x18')]);});}var processPromises=function(_0x463d70){return BPromise['all'](promises)[_0x22f0('0x26')](function(_0xc558dd){})['catch'](function(_0x257965){logger['error'](_0x22f0('0x5a'),JSON[_0x22f0('0x29')](_0x257965));})[_0x22f0('0x5b')](function(){socket[_0x22f0('0x5c')](_0x22f0('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x463d70){return _0x463d70['resume']();}});};var endCsv=function(){return BPromise[_0x22f0('0x5e')]()[_0x22f0('0x26')](function(){if(hopperContacts){return checkHopper();}})[_0x22f0('0x26')](function(){socket[_0x22f0('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1ca9cf){logger[_0x22f0('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x22f0('0x29')](_0x1ca9cf));}finally{process['exit'](0x0);}});};process['on'](_0x22f0('0x5f'),function(){logger['info'](_0x22f0('0x60'));endCsv();});function main(){return BPromise[_0x22f0('0x5e')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0x22f0('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x22f0('0x26')](function(_0x53ea78){var _0x260115=fs[_0x22f0('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x22f0('0x62')](_0x260115,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4e99c9,_0x47e5c0){total+=0x1;var _0x12725a=total;promises[_0x22f0('0x27')](checkRow(_0x4e99c9,_0x53ea78,_0x12725a)[_0x22f0('0x26')](function(){success+=0x1;})['catch'](function(_0x8c646b){if(_0x8c646b[_0x22f0('0x12')]){errors+=0x1;delete _0x8c646b[_0x22f0('0x12')];}else if(_0x8c646b['duplicate']){duplicates+=0x1;delete _0x8c646b[_0x22f0('0x24')];}rows[_0x22f0('0x27')](_0x8c646b);}));if(total%0xc8===0x0){_0x47e5c0[_0x22f0('0x63')]();return processPromises(_0x47e5c0);}},'complete':function(){return processPromises()['then'](function(){logger[_0x22f0('0x64')](_0x22f0('0x65'));endCsv();});},'error':function(_0xf36abd,_0x82c8e2){logger[_0x22f0('0x64')](_0x22f0('0x66'),JSON['stringify'](_0xf36abd));endCsv();}});})[_0x22f0('0x52')](function(_0x2f173f){logger['error'](_0x22f0('0x67'),JSON[_0x22f0('0x29')](_0x2f173f));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index eae4c95..133699d 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 _0x3b72=['select','fields','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','insert','into','cm_hopper_black','from','cm_contacts','.CmListId','.CmListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','recallme','toString','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','Received\x20SIGINT','error','message','errors','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','length','push','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','dialTimezone','utcOffset','set','offset','main','send','binding','socket_timestamp','server/files/tmp','.csv','header',',utcOffset','parse','createReadStream','data','rows','hasOwnProperty','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','timezones','isNil','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','exit','argv','root','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId'];(function(_0x16ec0a,_0x5cd0f1){var _0x3819ef=function(_0x2908ec){while(--_0x2908ec){_0x16ec0a['push'](_0x16ec0a['shift']());}};_0x3819ef(++_0x5cd0f1);}(_0x3b72,0x1a2));var _0x23b7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3b72[_0x501510];return _0x1e6ee5;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x23b7('0x0'));var Papa=require(_0x23b7('0x1'));var util=require(_0x23b7('0x2'));var BPromise=require('bluebird');var moment=require(_0x23b7('0x3'));var squel=require(_0x23b7('0x4'));var Redis=require('ioredis');var db=require(_0x23b7('0x5'))['db'];var config=require(_0x23b7('0x6'));var shared=require(_0x23b7('0x7'));var logger=require(_0x23b7('0x8'))(_0x23b7('0x9'));config[_0x23b7('0xa')]=_[_0x23b7('0xb')](config['redis'],{'host':_0x23b7('0xc'),'port':0x18eb});var socket=require(_0x23b7('0xd'))(new Redis(config[_0x23b7('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x23b7('0xe')](_0x23b7('0xf'));function isEmail(_0x5560df){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))*$/[_0x23b7('0x10')](_0x5560df);}function selectNotIn(_0x57b8aa,_0x357c6d,_0x45314d,_0xa52668,_0x480b8b){return squel['select']()[_0x23b7('0x11')](_0x23b7('0x12'))['from'](_0xa52668)[_0x23b7('0x13')](_0x357c6d,null,_0x357c6d+_0x23b7('0x14')+_0xa52668+'.'+_0x45314d)[_0x23b7('0x15')](_0xa52668+'.'+_0x45314d+_0x23b7('0x16')+_0x57b8aa+'.'+_0x45314d)[_0x23b7('0x15')](_0x357c6d+_0x23b7('0x17')+_0x480b8b[_0x23b7('0x13')]()+')');}function insertCmHopper(_0x30a228,_0x2dd815,_0x149adf,_0x3ea405,_0x135666){var _0x2e63f0=[_0x23b7('0x18'),_0x23b7('0x19'),_0x23b7('0x1a'),'cm_contacts.ListId',_0x2dd815+'.'+_0x3ea405,_0x23b7('0x1b'),_0x23b7('0x1c'),_0x23b7('0x1d'),'cm_contacts.UserId','\x22'+_0x135666+'\x22'];return squel['insert']()['into']('cm_hopper')[_0x23b7('0x1e')](['phone',_0x23b7('0x1f'),_0x23b7('0x20'),_0x23b7('0x21'),_0x3ea405,_0x23b7('0x22'),_0x23b7('0x23'),_0x23b7('0x24'),_0x23b7('0x25'),'recallme'],squel[_0x23b7('0x26')]()[_0x23b7('0x27')](_0x2e63f0)['from'](_0x2dd815)[_0x23b7('0x13')]('cm_contacts',null,_0x23b7('0x28')+_0x2dd815+'.CmListId')['join'](_0x149adf,null,_0x149adf+'.id\x20=\x20'+_0x2dd815+'.'+_0x3ea405)[_0x23b7('0x15')](_0x2dd815+'.CmListId\x20=\x20?',_0x30a228)[_0x23b7('0x15')](_0x23b7('0x29'),NOW)[_0x23b7('0x15')](_0x23b7('0x2a'),selectNotIn(_0x2dd815,_0x149adf,_0x3ea405,_0x23b7('0x2b'),[_0x23b7('0x2c'),_0x23b7('0x2d')]))['where'](_0x23b7('0x2a'),selectNotIn(_0x2dd815,_0x149adf,_0x3ea405,_0x23b7('0x2b'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x212045,_0xdc163a,_0x4e99e2,_0x5d9445){var _0x3099af=['cm_contacts.phone',_0x23b7('0x1a'),_0x23b7('0x2e'),_0xdc163a+'.'+_0x5d9445,_0x23b7('0x1b'),'cm_contacts.updatedAt'];return squel[_0x23b7('0x2f')]()[_0x23b7('0x30')](_0x23b7('0x31'))[_0x23b7('0x1e')]([_0x23b7('0x12'),'ContactId','ListId',_0x5d9445,_0x23b7('0x22'),_0x23b7('0x23')],squel[_0x23b7('0x26')]()[_0x23b7('0x27')](_0x3099af)[_0x23b7('0x32')](_0xdc163a)[_0x23b7('0x13')](_0x23b7('0x33'),null,_0x23b7('0x28')+_0xdc163a+_0x23b7('0x34'))[_0x23b7('0x13')](_0x4e99e2,null,_0x4e99e2+_0x23b7('0x14')+_0xdc163a+'.'+_0x5d9445)[_0x23b7('0x15')](_0xdc163a+_0x23b7('0x35'),_0x212045)['where'](_0x23b7('0x29'),NOW)[_0x23b7('0x15')](_0x23b7('0x2a'),squel[_0x23b7('0x26')]()['field']('phone')['from']('cm_hopper_black')[_0x23b7('0x15')]('ListId\x20=\x20?',_0x212045)[_0x23b7('0x15')](_0x5d9445+_0x23b7('0x36'),_0xdc163a+'.'+_0x5d9445)))['toString']();}function insertTzCmHopper(_0x1ccd8b,_0xc24dd5,_0x5b8f8b,_0x1c45a4,_0x3fb04d,_0x3d832c){var _0x2f2b5d=[_0x23b7('0x18'),_0x23b7('0x37')+_0x3d832c+_0x23b7('0x38'),_0x23b7('0x1a'),_0x23b7('0x2e'),_0xc24dd5+'.'+_0x1c45a4,_0x23b7('0x1b'),'cm_contacts.updatedAt',_0x23b7('0x1d'),_0x23b7('0x39'),'\x22'+_0x3fb04d+'\x22'];var _0x1c17d4=squel[_0x23b7('0x2f')]()[_0x23b7('0x30')](_0x23b7('0x2b'))[_0x23b7('0x1e')]([_0x23b7('0x12'),_0x23b7('0x1f'),_0x23b7('0x20'),_0x23b7('0x21'),_0x1c45a4,_0x23b7('0x22'),_0x23b7('0x23'),_0x23b7('0x24'),'UserId',_0x23b7('0x3a')],squel[_0x23b7('0x26')]()[_0x23b7('0x27')](_0x2f2b5d)['from'](_0xc24dd5)[_0x23b7('0x13')](_0x23b7('0x33'),null,'cm_contacts.ListId\x20=\x20'+_0xc24dd5+_0x23b7('0x34'))[_0x23b7('0x13')](_0x5b8f8b,null,_0x5b8f8b+_0x23b7('0x14')+_0xc24dd5+'.'+_0x1c45a4)[_0x23b7('0x13')](_0x3d832c,null,_0x3d832c+_0x23b7('0x14')+_0xc24dd5+'.'+_0x1c45a4)[_0x23b7('0x15')](_0xc24dd5+_0x23b7('0x35'),_0x1ccd8b)[_0x23b7('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x23b7('0x2a'),selectNotIn(_0xc24dd5,_0x5b8f8b,_0x1c45a4,_0x23b7('0x2b'),[_0x23b7('0x2c'),_0x23b7('0x2d')]))[_0x23b7('0x15')](_0x23b7('0x2a'),selectNotIn(_0xc24dd5,_0x5b8f8b,_0x1c45a4,_0x23b7('0x2b'),[_0x23b7('0x2c')])))[_0x23b7('0x3b')]();return _0x1c17d4;}function insertTzCmHopperBlack(_0x3c7415,_0x452db5,_0x4af394,_0x1fd8a5){var _0x38afbb=[_0x23b7('0x18'),_0x23b7('0x1a'),_0x23b7('0x2e'),_0x452db5+'.'+_0x1fd8a5,_0x23b7('0x1b'),_0x23b7('0x1c')];return squel['insert']()[_0x23b7('0x30')](_0x23b7('0x31'))['fromQuery']([_0x23b7('0x12'),_0x23b7('0x20'),_0x23b7('0x21'),_0x1fd8a5,_0x23b7('0x22'),_0x23b7('0x23')],squel[_0x23b7('0x26')]()[_0x23b7('0x27')](_0x38afbb)[_0x23b7('0x32')](_0x452db5)[_0x23b7('0x13')](_0x23b7('0x33'),null,_0x23b7('0x28')+_0x452db5+'.CmListId')['join'](_0x4af394,null,_0x4af394+_0x23b7('0x14')+_0x452db5+'.'+_0x1fd8a5)[_0x23b7('0x15')](_0x452db5+_0x23b7('0x35'),_0x3c7415)[_0x23b7('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x23b7('0x15')](_0x23b7('0x2a'),squel[_0x23b7('0x26')]()[_0x23b7('0x11')]('phone')[_0x23b7('0x32')]('cm_hopper_black')[_0x23b7('0x15')]('ListId\x20=\x20?',_0x3c7415)[_0x23b7('0x15')](_0x1fd8a5+'\x20=\x20?',_0x452db5+'.'+_0x1fd8a5)))['toString']();}function insertCmContact(_0x58c1a2,_0x508a4a,_0x13a2d6,_0xd7d9cf){var _0x3a1647=_[_0x23b7('0x3c')](_[_0x23b7('0x3d')](_0xd7d9cf),['ListId','CompanyId',_0x23b7('0x22'),_0x23b7('0x23')]);return squel[_0x23b7('0x2f')]()['into'](_0x23b7('0x33'))[_0x23b7('0x1e')](_0x3a1647,squel[_0x23b7('0x26')]()[_0x23b7('0x27')](_0x3a1647)['from'](_0x508a4a)['where']('('+_0x13a2d6['join'](',')+_0x23b7('0x3e'),squel[_0x23b7('0x26')]()[_0x23b7('0x27')](_0x13a2d6)[_0x23b7('0x32')](_0x23b7('0x33'))[_0x23b7('0x15')]('ListId\x20=\x20?',_0x58c1a2)['where'](_0x23b7('0x3f')))[_0x23b7('0x15')]('id\x20IN\x20?',squel[_0x23b7('0x26')]()[_0x23b7('0x11')]('MIN(id)',_0x23b7('0x40'))[_0x23b7('0x32')](_0x508a4a)[_0x23b7('0x41')](_0x13a2d6[_0x23b7('0x13')](','))))[_0x23b7('0x3b')]();}function handleStop(){logger[_0x23b7('0x42')](_0x23b7('0x43'));stopped=!![];}function handleUncaughtException(_0x6f5352){logger[_0x23b7('0x44')](_0x6f5352[_0x23b7('0x45')]);process['exit'](0x1);}function handleError(_0x28b69e,_0x2f280d){stats[_0x23b7('0x46')]['push']({'name':_0x2f280d[_0x23b7('0x47')],'message':_0x2f280d[_0x23b7('0x45')],'row':_0x28b69e});}function handleQuery(_0xfda99f){logger[_0x23b7('0x42')](_0xfda99f);return db[_0x23b7('0x48')][_0x23b7('0x49')](_0xfda99f)[_0x23b7('0x4a')](function(_0x322f9f){results['push'](_0x322f9f);})[_0x23b7('0x4b')](function(_0x38e98c){logger[_0x23b7('0x44')](_0x38e98c[_0x23b7('0x45')]);});}function updateTzCampaigns(_0x37d07c){return new Promise(function(_0x15337c,_0x3ecbd3){var _0x4fd4c4=squel[_0x23b7('0x26')]()[_0x23b7('0x27')]([_0x23b7('0x4c'),_0x23b7('0x4d')])[_0x23b7('0x32')]('campaigns')[_0x23b7('0x13')]('campaigns_has_cm_lists',null,_0x23b7('0x4e'))[_0x23b7('0x15')]('campaigns_has_cm_lists.CmListId='+_0x37d07c);db[_0x23b7('0x48')][_0x23b7('0x49')](_0x4fd4c4[_0x23b7('0x3b')]())[_0x23b7('0x4a')](function(_0x4535ce){var _0x1311e3=[];for(var _0x27925d=0x0;_0x27925d<_0x4535ce[_0x23b7('0x4f')];_0x27925d++){_0x1311e3[_0x23b7('0x50')](getTimezoneData(_0x4535ce[_0x27925d],tmp_campaigns));}BPromise[_0x23b7('0x51')](_0x1311e3)[_0x23b7('0x52')](function(){_0x15337c({'val':0x1});});})['catch'](function(_0x2e5210){logger[_0x23b7('0x44')](_0x2e5210[_0x23b7('0x45')]);_0x15337c({'val':0x0});});});}function updateTzVoiceQueues(_0x514f75){return new Promise(function(_0x447fc8,_0x173744){var _0x20ad2e=squel[_0x23b7('0x26')]()[_0x23b7('0x27')]([_0x23b7('0x53'),_0x23b7('0x54')])['from'](_0x23b7('0x55'))['join']('voice_queues_has_cm_lists',null,_0x23b7('0x56'))['where']('voice_queues_has_cm_lists.CmListId='+_0x514f75);db[_0x23b7('0x48')]['query'](_0x20ad2e[_0x23b7('0x3b')]())[_0x23b7('0x4a')](function(_0x3eeb28){var _0x1502b9=[];for(var _0x218695=0x0;_0x218695<_0x3eeb28[_0x23b7('0x4f')];_0x218695++){_0x1502b9[_0x23b7('0x50')](getTimezoneData(_0x3eeb28[_0x218695],tmp_voice_queues));}BPromise['all'](_0x1502b9)[_0x23b7('0x52')](function(){_0x447fc8({'val':0x1});});})[_0x23b7('0x4b')](function(_0x5bbe4d){logger[_0x23b7('0x44')](_0x5bbe4d[_0x23b7('0x45')]);_0x447fc8({'val':0x0});});});}function getTimezoneData(_0x3a92a0,_0x425840){return new Promise(function(_0x52ac83,_0x5aca2c){var _0x49f458=shared['timezones'];var _0x32125e=_0x49f458[_0x3a92a0[_0x23b7('0x57')]];if(_['isNil'](_0x32125e)){_0x52ac83({'ret':0x1});}else{var _0x519475=_0x32125e[_0x23b7('0x58')];var _0x312586=squel[_0x23b7('0x2f')]()['into'](_0x425840)[_0x23b7('0x59')]('id',_0x3a92a0['id'])['set'](_0x23b7('0x5a'),_0x519475)[_0x23b7('0x59')]('dialTimezone',_0x3a92a0[_0x23b7('0x57')])[_0x23b7('0x3b')]();return db[_0x23b7('0x48')]['query'](_0x312586)[_0x23b7('0x4a')](function(_0x4084da){_0x52ac83({'ret':0x1});})[_0x23b7('0x4b')](function(_0x3d8865){logger[_0x23b7('0x44')](_0x3d8865[_0x23b7('0x45')]);_0x5aca2c({'ret':0x1});});}});}function handleTZQuery(_0x99d48a){logger[_0x23b7('0x42')](_0x99d48a);return db[_0x23b7('0x48')]['query'](_0x99d48a)['spread'](function(_0x4e2c8c){})[_0x23b7('0x4b')](function(_0x1e21da){logger[_0x23b7('0x44')](_0x1e21da[_0x23b7('0x45')]);});}function main(_0xf1e018,_0x6b7f51,_0x972576,_0x1bf01a){logger[_0x23b7('0x42')](_0x23b7('0x5b'),_0xf1e018,JSON['stringify'](_0x6b7f51));process[_0x23b7('0x5c')]('start');var _0x3e51c0=_0x6b7f51[_0x23b7('0x5d')];var _0x3a09ad=_0x6b7f51[_0x23b7('0x5e')];var _0x4ab837=path['join'](config['root'],_0x23b7('0x5f'),_0x3a09ad+_0x23b7('0x60'));hasTZ=_[_0x23b7('0x3d')](_0x3e51c0)['includes'](_0x23b7('0x57'));var _0x2f6541=_['keys'](_0x3e51c0)['join']();logger[_0x23b7('0x42')](_0x23b7('0x61'),_0x2f6541);if(hasTZ)_0x2f6541+=_0x23b7('0x62');fs['writeFileSync'](_0x4ab837,_0x2f6541+'\x0a');Papa[_0x23b7('0x63')](fs[_0x23b7('0x64')](_0xf1e018),{'header':!![],'skipEmptyLines':!![],'step':function(_0x968fc6,_0x1fd0cd){try{for(var _0x467afc=0x0,_0x18dd08=[];_0x467afc<_0x968fc6[_0x23b7('0x65')]['length'];_0x467afc++){stats[_0x23b7('0x66')]+=0x1;if(_0x968fc6[_0x23b7('0x46')][_0x467afc]){handleError(_0x968fc6[_0x23b7('0x65')][_0x467afc],_0x968fc6[_0x23b7('0x46')][_0x467afc]);}else{var _0x5b2fe0=[];for(var _0x571c19 in _0x3e51c0){if(_0x3e51c0[_0x23b7('0x67')](_0x571c19)){if(_0x968fc6['data'][_0x467afc][_0x3e51c0[_0x571c19]]){var _0x558ba6=_['trim'](_0x968fc6[_0x23b7('0x65')][_0x467afc][_0x3e51c0[_0x571c19]][_0x23b7('0x68')](/"/g,'\x27'));switch(_0x571c19){case'scheduledat':var _0x508557=moment(_0x558ba6,_0x23b7('0xf'),!![]);if(_0x508557[_0x23b7('0x69')]()){_0x18dd08[_0x23b7('0x50')]('\x22'+_0x558ba6+'\x22');}else{_0x5b2fe0[_0x23b7('0x50')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x23b7('0x24'):var _0xaff772=parseInt(_0x558ba6);_0x558ba6=_[_0x23b7('0x6a')](_0xaff772)||_0xaff772<0x0||_0xaff772>0x4?_0x1bf01a?0x3:0x2:_0xaff772;_0x18dd08[_0x23b7('0x50')]('\x22'+_0x558ba6+'\x22');break;case'UserId':var _0x219288=parseInt(_0x558ba6);if(_[_0x23b7('0x6b')](_0x219288)&&_['includes'](_0x972576,_0x219288)){_0x18dd08['push']('\x22'+_0x219288+'\x22');}else{_0x5b2fe0[_0x23b7('0x50')](_0x23b7('0x6c'));}break;case _0x23b7('0x6d'):if(isEmail(_0x558ba6)){_0x18dd08[_0x23b7('0x50')]('\x22'+_0x558ba6+'\x22');}else{_0x5b2fe0['push'](_0x23b7('0x6e'));}break;case'dateOfBirth':var _0x464231=moment(_0x558ba6,_0x23b7('0x6f'),!![]);if(_0x464231[_0x23b7('0x69')]()){_0x18dd08[_0x23b7('0x50')]('\x22'+_0x558ba6+'\x22');}else{_0x5b2fe0[_0x23b7('0x50')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x23b7('0x57'):var _0x950047=shared[_0x23b7('0x70')];var _0x516f1c=_0x950047[_0x558ba6];if(!_[_0x23b7('0x71')](_0x516f1c)){var _0x50e86f=_0x516f1c[_0x23b7('0x58')];_0x18dd08[_0x23b7('0x50')]('\x22'+_0x558ba6+'\x22');_0x18dd08[_0x23b7('0x50')]('\x22'+_0x50e86f+'\x22');}break;default:_0x18dd08['push']('\x22'+_0x558ba6+'\x22');}}else{switch(_0x571c19){case'firstName':case _0x23b7('0x12'):_0x5b2fe0[_0x23b7('0x50')](_0x571c19+_0x23b7('0x72'));break;default:_0x18dd08[_0x23b7('0x50')]('\x22\x22');}}}}if(_0x5b2fe0[_0x23b7('0x4f')]){handleError(_0x968fc6[_0x23b7('0x65')][_0x467afc],{'code':_0x23b7('0x73'),'message':_0x5b2fe0[_0x23b7('0x13')]()});}else{fs[_0x23b7('0x74')](_0x4ab837,_0x18dd08[_0x23b7('0x13')]()+'\x0a');}_0x18dd08=[];}if(!(stats[_0x23b7('0x66')]%0xc8)){socket[_0x23b7('0x75')](_0x23b7('0x76')+_0x3a09ad,stats);stats['errors']=[];}}if(stopped){logger[_0x23b7('0x42')](_0x23b7('0x77'));_0x1fd0cd[_0x23b7('0x78')]();}}catch(_0x7e3e2e){handleError(_0x968fc6[_0x23b7('0x65')][_0x467afc],{'code':_0x23b7('0x79'),'message':_0x7e3e2e['message']});logger[_0x23b7('0x44')](_0x23b7('0x7a'),_0x7e3e2e[_0x23b7('0x45')]);}},'complete':function(){try{var _0x4eafb1=[];var _0x42fb3a=[];var _0x390a92=_0x23b7('0x33');if(_0x6b7f51[_0x23b7('0x7b')]&&_0x6b7f51[_0x23b7('0x7b')][_0x23b7('0x4f')]){_0x390a92=_0x23b7('0x7c')+_0x3a09ad;_0x4eafb1[_0x23b7('0x50')]('CREATE\x20TABLE\x20'+_0x390a92+_0x23b7('0x7d'));}tmp_campaigns=_0x23b7('0x7e')+_0x3a09ad;tmp_voice_queues=_0x23b7('0x7f')+_0x3a09ad;_0x42fb3a[_0x23b7('0x50')](_0x23b7('0x80')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x42fb3a[_0x23b7('0x50')](_0x23b7('0x80')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x23b7('0x81')](_0x42fb3a,handleTZQuery)['then'](function(_0x441675){updateTzCampaigns(_0x6b7f51[_0x23b7('0x21')])[_0x23b7('0x52')](function(_0x35ad4b){updateTzVoiceQueues(_0x6b7f51[_0x23b7('0x21')])[_0x23b7('0x52')](function(_0x4cb022){var _0x4a2f46=util[_0x23b7('0xe')](_0x23b7('0x82'),_0x4ab837,_0x390a92,_0x2f6541,_0x6b7f51[_0x23b7('0x21')],_0x6b7f51['CompanyId']||null,NOW,NOW);if(_[_0x23b7('0x71')](_0x3e51c0[_0x23b7('0x1f')])){_0x4a2f46+=_0x23b7('0x83');}_0x4eafb1[_0x23b7('0x50')](_0x4a2f46);if(_0x6b7f51[_0x23b7('0x7b')]&&_0x6b7f51['duplicates'][_0x23b7('0x4f')]){_0x4eafb1[_0x23b7('0x50')](insertCmContact(_0x6b7f51[_0x23b7('0x21')],_0x390a92,_0x6b7f51[_0x23b7('0x7b')],_0x3e51c0));_0x4eafb1['push']('DROP\x20TABLE\x20'+_0x390a92+';');}if(hasTZ){_0x4eafb1[_0x23b7('0x50')](insertTzCmHopper(_0x6b7f51['ListId'],_0x23b7('0x84'),'voice_queues',_0x23b7('0x85'),_0x1bf01a,tmp_voice_queues));_0x4eafb1[_0x23b7('0x50')](insertTzCmHopperBlack(_0x6b7f51[_0x23b7('0x21')],_0x23b7('0x86'),_0x23b7('0x55'),_0x23b7('0x85')));_0x4eafb1[_0x23b7('0x50')](insertTzCmHopper(_0x6b7f51[_0x23b7('0x21')],_0x23b7('0x87'),_0x23b7('0x88'),_0x23b7('0x89'),_0x1bf01a,tmp_campaigns));_0x4eafb1[_0x23b7('0x50')](insertTzCmHopperBlack(_0x6b7f51[_0x23b7('0x21')],_0x23b7('0x8a'),_0x23b7('0x88'),'CampaignId'));}else{_0x4eafb1[_0x23b7('0x50')](insertCmHopper(_0x6b7f51[_0x23b7('0x21')],'voice_queues_has_cm_lists',_0x23b7('0x55'),_0x23b7('0x85'),_0x1bf01a));_0x4eafb1[_0x23b7('0x50')](insertCmHopperBlack(_0x6b7f51[_0x23b7('0x21')],_0x23b7('0x86'),'voice_queues','VoiceQueueId'));_0x4eafb1[_0x23b7('0x50')](insertCmHopper(_0x6b7f51[_0x23b7('0x21')],'campaigns_has_cm_lists',_0x23b7('0x88'),'CampaignId',_0x1bf01a));_0x4eafb1['push'](insertCmHopperBlack(_0x6b7f51[_0x23b7('0x21')],_0x23b7('0x8a'),_0x23b7('0x88'),_0x23b7('0x89')));}_0x4eafb1[_0x23b7('0x50')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x4eafb1['push'](_0x23b7('0x8b')+tmp_voice_queues+';');BPromise[_0x23b7('0x81')](_0x4eafb1,handleQuery)[_0x23b7('0x52')](function(_0x24d8e3){stats[_0x23b7('0x8c')]=!![];stats[_0x23b7('0x8d')]=_0x6b7f51['duplicates']&&_0x6b7f51['duplicates'][_0x23b7('0x4f')]?results[0x2][_0x23b7('0x8d')]:results[0x0][_0x23b7('0x8d')];socket[_0x23b7('0x75')](_0x23b7('0x76')+_0x3a09ad,stats);fs[_0x23b7('0x8e')](_0xf1e018);fs[_0x23b7('0x8e')](_0x4ab837);process[_0x23b7('0x8f')](0x0);})['catch'](function(_0x31f56f){logger['error'](_0x31f56f[_0x23b7('0x45')]);process['exit'](0x1);});});});});}catch(_0x5c12df){logger[_0x23b7('0x44')]('complete',_0x5c12df['message']);process['exit'](0x1);}},'error':function(_0x51aba4,_0x597351,_0x471518,_0x281537){throw new Error(_0x281537);}});}function validate(){if(process['argv']&&process[_0x23b7('0x90')][_0x23b7('0x4f')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x124492=path[_0x23b7('0x13')](config[_0x23b7('0x91')],_0x23b7('0x5f'),process[_0x23b7('0x90')][0x2]);if(!fs['existsSync'](_0x124492)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x129b24={};try{_0x129b24=JSON[_0x23b7('0x63')](process[_0x23b7('0x90')][0x3]);if(!_0x129b24[_0x23b7('0x5d')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x129b24[_0x23b7('0x5d')][_0x23b7('0x12')]){throw new Error(_0x23b7('0x92'));}if(!_0x129b24[_0x23b7('0x5d')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x46e328=0x0;if(_0x129b24[_0x23b7('0x5d')]['UserId']){_0x46e328=0x1;}if(!_0x129b24['ListId']){throw new Error(_0x23b7('0x93'));}}catch(_0x22e900){throw new Error(_0x23b7('0x94'));}var _0x384cee=[];try{_0x384cee=_[_0x23b7('0x95')](JSON[_0x23b7('0x63')](process['argv'][0x4]),'id');}catch(_0x503271){logger[_0x23b7('0x42')](_0x23b7('0x96'));}main(_0x124492,_0x129b24,_0x384cee,_0x46e328);}validate();process['on'](_0x23b7('0x97'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x998f=['fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_hopper_black','cm_contacts','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.updatedAt','cm_contacts.UserId','ContactId','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','message','errors','push','code','sequelize','query','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','all','timezones','utcOffset','set','offset','dialTimezone','send','binding','socket_timestamp','root','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','data','hasOwnProperty','trim','replace','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','isNil','firstName','\x20not\x20specified','SystemRow','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','VoiceQueueId','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','into','cm_hopper'];(function(_0x13a5c1,_0x37e7c4){var _0x2a6bd2=function(_0x408108){while(--_0x408108){_0x13a5c1['push'](_0x13a5c1['shift']());}};_0x2a6bd2(++_0x37e7c4);}(_0x998f,0x1b6));var _0xf998=function(_0x485f46,_0x40d53f){_0x485f46=_0x485f46-0x0;var _0x9f5664=_0x998f[_0x485f46];return _0x9f5664;};'use strict';var fs=require('fs');var path=require(_0xf998('0x0'));var _=require(_0xf998('0x1'));var Papa=require(_0xf998('0x2'));var util=require(_0xf998('0x3'));var BPromise=require(_0xf998('0x4'));var moment=require(_0xf998('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xf998('0x6'));var shared=require(_0xf998('0x7'));var logger=require(_0xf998('0x8'))(_0xf998('0x9'));config[_0xf998('0xa')]=_[_0xf998('0xb')](config[_0xf998('0xa')],{'host':_0xf998('0xc'),'port':0x18eb});var socket=require(_0xf998('0xd'))(new Redis(config[_0xf998('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf998('0xe')](_0xf998('0xf'));function isEmail(_0x105663){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))*$/[_0xf998('0x10')](_0x105663);}function selectNotIn(_0x2d2f23,_0x9afd6f,_0x481050,_0x2797cd,_0x35190f){return squel['select']()[_0xf998('0x11')](_0xf998('0x12'))[_0xf998('0x13')](_0x2797cd)[_0xf998('0x14')](_0x9afd6f,null,_0x9afd6f+_0xf998('0x15')+_0x2797cd+'.'+_0x481050)[_0xf998('0x16')](_0x2797cd+'.'+_0x481050+_0xf998('0x17')+_0x2d2f23+'.'+_0x481050)[_0xf998('0x16')](_0x9afd6f+_0xf998('0x18')+_0x35190f[_0xf998('0x14')]()+')');}function insertCmHopper(_0x5e7385,_0x384cf8,_0x94bc7f,_0x3addea,_0x4571c7){var _0x194384=[_0xf998('0x19'),'cm_contacts.scheduledat',_0xf998('0x1a'),_0xf998('0x1b'),_0x384cf8+'.'+_0x3addea,_0xf998('0x1c'),'cm_contacts.updatedAt',_0xf998('0x1d'),'cm_contacts.UserId','\x22'+_0x4571c7+'\x22'];return squel[_0xf998('0x1e')]()[_0xf998('0x1f')](_0xf998('0x20'))[_0xf998('0x21')](['phone',_0xf998('0x22'),'ContactId',_0xf998('0x23'),_0x3addea,_0xf998('0x24'),_0xf998('0x25'),_0xf998('0x26'),_0xf998('0x27'),_0xf998('0x28')],squel[_0xf998('0x29')]()[_0xf998('0x2a')](_0x194384)[_0xf998('0x13')](_0x384cf8)['join']('cm_contacts',null,_0xf998('0x2b')+_0x384cf8+_0xf998('0x2c'))['join'](_0x94bc7f,null,_0x94bc7f+'.id\x20=\x20'+_0x384cf8+'.'+_0x3addea)[_0xf998('0x16')](_0x384cf8+_0xf998('0x2d'),_0x5e7385)[_0xf998('0x16')](_0xf998('0x2e'),NOW)[_0xf998('0x16')](_0xf998('0x2f'),selectNotIn(_0x384cf8,_0x94bc7f,_0x3addea,'cm_hopper',['\x22always\x22',_0xf998('0x30')]))[_0xf998('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x384cf8,_0x94bc7f,_0x3addea,_0xf998('0x20'),[_0xf998('0x31')])))[_0xf998('0x32')]();}function insertCmHopperBlack(_0x242107,_0x20442f,_0x3b98c2,_0x512d65){var _0x13570c=[_0xf998('0x19'),_0xf998('0x1a'),_0xf998('0x1b'),_0x20442f+'.'+_0x512d65,_0xf998('0x1c'),'cm_contacts.updatedAt'];return squel[_0xf998('0x1e')]()[_0xf998('0x1f')](_0xf998('0x33'))[_0xf998('0x21')]([_0xf998('0x12'),'ContactId',_0xf998('0x23'),_0x512d65,'createdAt',_0xf998('0x25')],squel[_0xf998('0x29')]()[_0xf998('0x2a')](_0x13570c)[_0xf998('0x13')](_0x20442f)['join'](_0xf998('0x34'),null,_0xf998('0x2b')+_0x20442f+_0xf998('0x2c'))[_0xf998('0x14')](_0x3b98c2,null,_0x3b98c2+_0xf998('0x15')+_0x20442f+'.'+_0x512d65)[_0xf998('0x16')](_0x20442f+'.CmListId\x20=\x20?',_0x242107)['where'](_0xf998('0x2e'),NOW)[_0xf998('0x16')](_0xf998('0x2f'),squel[_0xf998('0x29')]()[_0xf998('0x11')]('phone')[_0xf998('0x13')]('cm_hopper_black')[_0xf998('0x16')]('ListId\x20=\x20?',_0x242107)[_0xf998('0x16')](_0x512d65+_0xf998('0x35'),_0x20442f+'.'+_0x512d65)))[_0xf998('0x32')]();}function insertTzCmHopper(_0x17c825,_0x3bcb4b,_0x1a0496,_0x140c96,_0x302e32,_0x1d5a48){var _0x18a868=['cm_contacts.phone',_0xf998('0x36')+_0x1d5a48+'.offset-cm_contacts.utcOffset\x20minute)',_0xf998('0x1a'),_0xf998('0x1b'),_0x3bcb4b+'.'+_0x140c96,_0xf998('0x1c'),_0xf998('0x37'),_0xf998('0x1d'),_0xf998('0x38'),'\x22'+_0x302e32+'\x22'];var _0x59c73a=squel[_0xf998('0x1e')]()['into'](_0xf998('0x20'))['fromQuery']([_0xf998('0x12'),'scheduledat',_0xf998('0x39'),_0xf998('0x23'),_0x140c96,_0xf998('0x24'),_0xf998('0x25'),'priority',_0xf998('0x27'),_0xf998('0x28')],squel[_0xf998('0x29')]()[_0xf998('0x2a')](_0x18a868)['from'](_0x3bcb4b)['join'](_0xf998('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x3bcb4b+_0xf998('0x2c'))['join'](_0x1a0496,null,_0x1a0496+_0xf998('0x15')+_0x3bcb4b+'.'+_0x140c96)[_0xf998('0x14')](_0x1d5a48,null,_0x1d5a48+'.id\x20=\x20'+_0x3bcb4b+'.'+_0x140c96)['where'](_0x3bcb4b+'.CmListId\x20=\x20?',_0x17c825)['where'](_0xf998('0x2e'),NOW)[_0xf998('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3bcb4b,_0x1a0496,_0x140c96,_0xf998('0x20'),[_0xf998('0x31'),_0xf998('0x30')]))[_0xf998('0x16')](_0xf998('0x2f'),selectNotIn(_0x3bcb4b,_0x1a0496,_0x140c96,_0xf998('0x20'),[_0xf998('0x31')])))[_0xf998('0x32')]();return _0x59c73a;}function insertTzCmHopperBlack(_0xb6819d,_0x508b8e,_0x4d80c0,_0x324c79){var _0x301582=[_0xf998('0x19'),'cm_contacts.id',_0xf998('0x1b'),_0x508b8e+'.'+_0x324c79,_0xf998('0x1c'),'cm_contacts.updatedAt'];return squel['insert']()[_0xf998('0x1f')](_0xf998('0x33'))[_0xf998('0x21')]([_0xf998('0x12'),_0xf998('0x39'),'ListId',_0x324c79,_0xf998('0x24'),_0xf998('0x25')],squel[_0xf998('0x29')]()['fields'](_0x301582)[_0xf998('0x13')](_0x508b8e)[_0xf998('0x14')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x508b8e+_0xf998('0x2c'))[_0xf998('0x14')](_0x4d80c0,null,_0x4d80c0+_0xf998('0x15')+_0x508b8e+'.'+_0x324c79)[_0xf998('0x16')](_0x508b8e+_0xf998('0x2d'),_0xb6819d)[_0xf998('0x16')](_0xf998('0x2e'),NOW)[_0xf998('0x16')](_0xf998('0x2f'),squel[_0xf998('0x29')]()[_0xf998('0x11')](_0xf998('0x12'))[_0xf998('0x13')]('cm_hopper_black')[_0xf998('0x16')](_0xf998('0x3a'),_0xb6819d)[_0xf998('0x16')](_0x324c79+'\x20=\x20?',_0x508b8e+'.'+_0x324c79)))[_0xf998('0x32')]();}function insertCmContact(_0x107081,_0x442436,_0x3b726c,_0x30214d){var _0x1ea638=_[_0xf998('0x3b')](_[_0xf998('0x3c')](_0x30214d),['ListId',_0xf998('0x3d'),_0xf998('0x24'),'updatedAt']);return squel[_0xf998('0x1e')]()[_0xf998('0x1f')](_0xf998('0x34'))['fromQuery'](_0x1ea638,squel['select']()[_0xf998('0x2a')](_0x1ea638)[_0xf998('0x13')](_0x442436)[_0xf998('0x16')]('('+_0x3b726c[_0xf998('0x14')](',')+_0xf998('0x3e'),squel[_0xf998('0x29')]()['fields'](_0x3b726c)[_0xf998('0x13')](_0xf998('0x34'))[_0xf998('0x16')](_0xf998('0x3a'),_0x107081)[_0xf998('0x16')](_0xf998('0x3f')))[_0xf998('0x16')](_0xf998('0x40'),squel[_0xf998('0x29')]()[_0xf998('0x11')](_0xf998('0x41'),'min_id')[_0xf998('0x13')](_0x442436)['group'](_0x3b726c['join'](','))))[_0xf998('0x32')]();}function handleStop(){logger[_0xf998('0x42')](_0xf998('0x43'));stopped=!![];}function handleUncaughtException(_0x2c96fd){logger['error'](_0x2c96fd[_0xf998('0x44')]);process['exit'](0x1);}function handleError(_0x24ece4,_0x301a58){stats[_0xf998('0x45')][_0xf998('0x46')]({'name':_0x301a58[_0xf998('0x47')],'message':_0x301a58[_0xf998('0x44')],'row':_0x24ece4});}function handleQuery(_0x10679d){logger[_0xf998('0x42')](_0x10679d);return db[_0xf998('0x48')][_0xf998('0x49')](_0x10679d)[_0xf998('0x4a')](function(_0x313e20){results[_0xf998('0x46')](_0x313e20);})[_0xf998('0x4b')](function(_0x4a062b){logger[_0xf998('0x4c')](_0x4a062b[_0xf998('0x44')]);});}function updateTzCampaigns(_0x1ddd2d){return new Promise(function(_0x5ced87,_0x158153){var _0x71963e=squel[_0xf998('0x29')]()['fields']([_0xf998('0x4d'),_0xf998('0x4e')])['from'](_0xf998('0x4f'))[_0xf998('0x14')](_0xf998('0x50'),null,_0xf998('0x51'))[_0xf998('0x16')](_0xf998('0x52')+_0x1ddd2d);db[_0xf998('0x48')]['query'](_0x71963e[_0xf998('0x32')]())[_0xf998('0x4a')](function(_0x51498f){var _0x30c23c=[];for(var _0x21b142=0x0;_0x21b142<_0x51498f[_0xf998('0x53')];_0x21b142++){_0x30c23c[_0xf998('0x46')](getTimezoneData(_0x51498f[_0x21b142],tmp_campaigns));}BPromise['all'](_0x30c23c)[_0xf998('0x54')](function(){_0x5ced87({'val':0x1});});})['catch'](function(_0x8077eb){logger['error'](_0x8077eb[_0xf998('0x44')]);_0x5ced87({'val':0x0});});});}function updateTzVoiceQueues(_0x23081a){return new Promise(function(_0x5d3172,_0x398c20){var _0x102e70=squel['select']()[_0xf998('0x2a')]([_0xf998('0x55'),_0xf998('0x56')])['from'](_0xf998('0x57'))[_0xf998('0x14')](_0xf998('0x58'),null,_0xf998('0x59'))['where'](_0xf998('0x5a')+_0x23081a);db[_0xf998('0x48')]['query'](_0x102e70[_0xf998('0x32')]())[_0xf998('0x4a')](function(_0x5a5519){var _0x5beb06=[];for(var _0x529c5e=0x0;_0x529c5e<_0x5a5519[_0xf998('0x53')];_0x529c5e++){_0x5beb06[_0xf998('0x46')](getTimezoneData(_0x5a5519[_0x529c5e],tmp_voice_queues));}BPromise[_0xf998('0x5b')](_0x5beb06)[_0xf998('0x54')](function(){_0x5d3172({'val':0x1});});})['catch'](function(_0x3e2717){logger[_0xf998('0x4c')](_0x3e2717['message']);_0x5d3172({'val':0x0});});});}function getTimezoneData(_0x315a69,_0x172d15){return new Promise(function(_0x4d848a,_0x23ddc5){var _0x430f37=shared[_0xf998('0x5c')];var _0x235c65=_0x430f37[_0x315a69['dialTimezone']];if(_['isNil'](_0x235c65)){_0x4d848a({'ret':0x1});}else{var _0x27325f=_0x235c65[_0xf998('0x5d')];var _0x1d0506=squel[_0xf998('0x1e')]()['into'](_0x172d15)['set']('id',_0x315a69['id'])[_0xf998('0x5e')](_0xf998('0x5f'),_0x27325f)[_0xf998('0x5e')](_0xf998('0x60'),_0x315a69[_0xf998('0x60')])[_0xf998('0x32')]();return db[_0xf998('0x48')][_0xf998('0x49')](_0x1d0506)['spread'](function(_0x2d1bbe){_0x4d848a({'ret':0x1});})[_0xf998('0x4b')](function(_0x5aea15){logger[_0xf998('0x4c')](_0x5aea15[_0xf998('0x44')]);_0x23ddc5({'ret':0x1});});}});}function handleTZQuery(_0x52cf07){logger[_0xf998('0x42')](_0x52cf07);return db['sequelize'][_0xf998('0x49')](_0x52cf07)[_0xf998('0x4a')](function(_0x484c34){})[_0xf998('0x4b')](function(_0x12c9ac){logger[_0xf998('0x4c')](_0x12c9ac[_0xf998('0x44')]);});}function main(_0x3b8d4b,_0x503165,_0x28a98d,_0x5a7e80){logger['info']('main',_0x3b8d4b,JSON['stringify'](_0x503165));process[_0xf998('0x61')]('start');var _0x17a167=_0x503165[_0xf998('0x62')];var _0x130f47=_0x503165[_0xf998('0x63')];var _0x377d97=path[_0xf998('0x14')](config[_0xf998('0x64')],_0xf998('0x65'),_0x130f47+_0xf998('0x66'));hasTZ=_[_0xf998('0x3c')](_0x17a167)[_0xf998('0x67')](_0xf998('0x60'));var _0x9dfc4=_[_0xf998('0x3c')](_0x17a167)[_0xf998('0x14')]();logger['info'](_0xf998('0x68'),_0x9dfc4);if(hasTZ)_0x9dfc4+=_0xf998('0x69');fs[_0xf998('0x6a')](_0x377d97,_0x9dfc4+'\x0a');Papa[_0xf998('0x6b')](fs['createReadStream'](_0x3b8d4b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x26a485,_0x1f131b){try{for(var _0xa9cc5=0x0,_0x17818a=[];_0xa9cc5<_0x26a485[_0xf998('0x6c')][_0xf998('0x53')];_0xa9cc5++){stats['rows']+=0x1;if(_0x26a485[_0xf998('0x45')][_0xa9cc5]){handleError(_0x26a485[_0xf998('0x6c')][_0xa9cc5],_0x26a485[_0xf998('0x45')][_0xa9cc5]);}else{var _0x1f8ae6=[];for(var _0x48d940 in _0x17a167){if(_0x17a167[_0xf998('0x6d')](_0x48d940)){if(_0x26a485[_0xf998('0x6c')][_0xa9cc5][_0x17a167[_0x48d940]]){var _0x578e3d=_[_0xf998('0x6e')](_0x26a485['data'][_0xa9cc5][_0x17a167[_0x48d940]][_0xf998('0x6f')](/"/g,'\x27'));switch(_0x48d940){case _0xf998('0x22'):var _0x429075=moment(_0x578e3d,_0xf998('0xf'),!![]);if(_0x429075['isValid']()){_0x17818a['push']('\x22'+_0x578e3d+'\x22');}else{_0x1f8ae6[_0xf998('0x46')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xf998('0x26'):var _0x53ae0f=parseInt(_0x578e3d);_0x578e3d=_[_0xf998('0x70')](_0x53ae0f)||_0x53ae0f<0x0||_0x53ae0f>0x4?_0x5a7e80?0x3:0x2:_0x53ae0f;_0x17818a['push']('\x22'+_0x578e3d+'\x22');break;case _0xf998('0x27'):var _0x44bbd4=parseInt(_0x578e3d);if(_[_0xf998('0x71')](_0x44bbd4)&&_[_0xf998('0x67')](_0x28a98d,_0x44bbd4)){_0x17818a[_0xf998('0x46')]('\x22'+_0x44bbd4+'\x22');}else{_0x1f8ae6[_0xf998('0x46')](_0xf998('0x72'));}break;case _0xf998('0x73'):if(isEmail(_0x578e3d)){_0x17818a[_0xf998('0x46')]('\x22'+_0x578e3d+'\x22');}else{_0x1f8ae6[_0xf998('0x46')]('email\x20wrong\x20format');}break;case _0xf998('0x74'):var _0x44ab2c=moment(_0x578e3d,'YYYY-MM-DD',!![]);if(_0x44ab2c[_0xf998('0x75')]()){_0x17818a[_0xf998('0x46')]('\x22'+_0x578e3d+'\x22');}else{_0x1f8ae6['push'](_0xf998('0x76'));}break;case _0xf998('0x60'):var _0x41d5e0=shared['timezones'];var _0x4dc02e=_0x41d5e0[_0x578e3d];if(!_[_0xf998('0x77')](_0x4dc02e)){var _0x4d81c6=_0x4dc02e[_0xf998('0x5d')];_0x17818a[_0xf998('0x46')]('\x22'+_0x578e3d+'\x22');_0x17818a[_0xf998('0x46')]('\x22'+_0x4d81c6+'\x22');}break;default:_0x17818a['push']('\x22'+_0x578e3d+'\x22');}}else{switch(_0x48d940){case _0xf998('0x78'):case _0xf998('0x12'):_0x1f8ae6['push'](_0x48d940+_0xf998('0x79'));break;default:_0x17818a[_0xf998('0x46')]('\x22\x22');}}}}if(_0x1f8ae6[_0xf998('0x53')]){handleError(_0x26a485['data'][_0xa9cc5],{'code':_0xf998('0x7a'),'message':_0x1f8ae6[_0xf998('0x14')]()});}else{fs['appendFileSync'](_0x377d97,_0x17818a['join']()+'\x0a');}_0x17818a=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xf998('0x7b')+_0x130f47,stats);stats[_0xf998('0x45')]=[];}}if(stopped){logger[_0xf998('0x42')]('Abort\x20parser');_0x1f131b['abort']();}}catch(_0x5a238d){handleError(_0x26a485['data'][_0xa9cc5],{'code':_0xf998('0x7c'),'message':_0x5a238d['message']});logger['error'](_0xf998('0x7d'),_0x5a238d[_0xf998('0x44')]);}},'complete':function(){try{var _0x296c9f=[];var _0x29035b=[];var _0x387865=_0xf998('0x34');if(_0x503165[_0xf998('0x7e')]&&_0x503165[_0xf998('0x7e')][_0xf998('0x53')]){_0x387865=_0xf998('0x7f')+_0x130f47;_0x296c9f[_0xf998('0x46')](_0xf998('0x80')+_0x387865+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xf998('0x81')+_0x130f47;tmp_voice_queues=_0xf998('0x82')+_0x130f47;_0x29035b[_0xf998('0x46')](_0xf998('0x80')+tmp_campaigns+_0xf998('0x83'));_0x29035b[_0xf998('0x46')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xf998('0x83'));BPromise[_0xf998('0x84')](_0x29035b,handleTZQuery)[_0xf998('0x54')](function(_0x26139b){updateTzCampaigns(_0x503165[_0xf998('0x23')])[_0xf998('0x54')](function(_0xf5e04d){updateTzVoiceQueues(_0x503165[_0xf998('0x23')])[_0xf998('0x54')](function(_0x249aa8){var _0x193f00=util['format'](_0xf998('0x85'),_0x377d97,_0x387865,_0x9dfc4,_0x503165[_0xf998('0x23')],_0x503165[_0xf998('0x3d')]||null,NOW,NOW);if(_['isNil'](_0x17a167['scheduledat'])){_0x193f00+=_0xf998('0x86');}_0x296c9f[_0xf998('0x46')](_0x193f00);if(_0x503165[_0xf998('0x7e')]&&_0x503165['duplicates']['length']){_0x296c9f[_0xf998('0x46')](insertCmContact(_0x503165[_0xf998('0x23')],_0x387865,_0x503165[_0xf998('0x7e')],_0x17a167));_0x296c9f[_0xf998('0x46')]('DROP\x20TABLE\x20'+_0x387865+';');}if(hasTZ){_0x296c9f[_0xf998('0x46')](insertTzCmHopper(_0x503165[_0xf998('0x23')],_0xf998('0x58'),_0xf998('0x57'),'VoiceQueueId',_0x5a7e80,tmp_voice_queues));_0x296c9f[_0xf998('0x46')](insertTzCmHopperBlack(_0x503165[_0xf998('0x23')],_0xf998('0x87'),_0xf998('0x57'),'VoiceQueueId'));_0x296c9f[_0xf998('0x46')](insertTzCmHopper(_0x503165[_0xf998('0x23')],_0xf998('0x50'),_0xf998('0x4f'),_0xf998('0x88'),_0x5a7e80,tmp_campaigns));_0x296c9f['push'](insertTzCmHopperBlack(_0x503165['ListId'],_0xf998('0x89'),_0xf998('0x4f'),_0xf998('0x88')));}else{_0x296c9f['push'](insertCmHopper(_0x503165[_0xf998('0x23')],_0xf998('0x58'),_0xf998('0x57'),_0xf998('0x8a'),_0x5a7e80));_0x296c9f[_0xf998('0x46')](insertCmHopperBlack(_0x503165[_0xf998('0x23')],_0xf998('0x87'),_0xf998('0x57'),_0xf998('0x8a')));_0x296c9f[_0xf998('0x46')](insertCmHopper(_0x503165[_0xf998('0x23')],_0xf998('0x50'),_0xf998('0x4f'),_0xf998('0x88'),_0x5a7e80));_0x296c9f[_0xf998('0x46')](insertCmHopperBlack(_0x503165[_0xf998('0x23')],'campaigns_has_cm_blacklists',_0xf998('0x4f'),_0xf998('0x88')));}_0x296c9f[_0xf998('0x46')](_0xf998('0x8b')+tmp_campaigns+';');_0x296c9f[_0xf998('0x46')](_0xf998('0x8b')+tmp_voice_queues+';');BPromise['each'](_0x296c9f,handleQuery)['then'](function(_0x265729){stats[_0xf998('0x8c')]=!![];stats[_0xf998('0x8d')]=_0x503165['duplicates']&&_0x503165[_0xf998('0x7e')][_0xf998('0x53')]?results[0x2][_0xf998('0x8d')]:results[0x0][_0xf998('0x8d')];socket[_0xf998('0x8e')](_0xf998('0x7b')+_0x130f47,stats);fs[_0xf998('0x8f')](_0x3b8d4b);fs[_0xf998('0x8f')](_0x377d97);process[_0xf998('0x90')](0x0);})[_0xf998('0x4b')](function(_0x50c806){logger[_0xf998('0x4c')](_0x50c806[_0xf998('0x44')]);process[_0xf998('0x90')](0x1);});});});});}catch(_0x42e3a7){logger[_0xf998('0x4c')](_0xf998('0x91'),_0x42e3a7[_0xf998('0x44')]);process[_0xf998('0x90')](0x1);}},'error':function(_0x2efd75,_0x9bf78b,_0x29c585,_0x4bec7a){throw new Error(_0x4bec7a);}});}function validate(){if(process[_0xf998('0x92')]&&process[_0xf998('0x92')][_0xf998('0x53')]<0x4){throw new Error(_0xf998('0x93'));}var _0x3bb790=path['join'](config[_0xf998('0x64')],_0xf998('0x65'),process['argv'][0x2]);if(!fs[_0xf998('0x94')](_0x3bb790)){throw new Error(_0xf998('0x95'));}var _0x329600={};try{_0x329600=JSON[_0xf998('0x6b')](process[_0xf998('0x92')][0x3]);if(!_0x329600[_0xf998('0x62')]){throw new Error(_0xf998('0x96'));}if(!_0x329600['binding'][_0xf998('0x12')]){throw new Error(_0xf998('0x97'));}if(!_0x329600['binding'][_0xf998('0x78')]){throw new Error(_0xf998('0x98'));}var _0x27ed3e=0x0;if(_0x329600[_0xf998('0x62')]['UserId']){_0x27ed3e=0x1;}if(!_0x329600['ListId']){throw new Error(_0xf998('0x99'));}}catch(_0x323c0e){throw new Error('body\x20id\x20mandatory');}var _0x2ab91f=[];try{_0x2ab91f=_[_0xf998('0x9a')](JSON['parse'](process[_0xf998('0x92')][0x4]),'id');}catch(_0x271f93){logger[_0xf998('0x42')](_0xf998('0x9b'));}main(_0x3bb790,_0x329600,_0x2ab91f,_0x27ed3e);}validate();process['on'](_0xf998('0x9c'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 9f94326..3f3db7e 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa706=['toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','destexten','Queue','queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Member\x20Name','membername','Date','Answer\x20Time','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','inbound','push','variable','calleridnum','outbound','Outbound\x20Call'];(function(_0x401e2e,_0x424d57){var _0x53be07=function(_0x50b998){while(--_0x50b998){_0x401e2e['push'](_0x401e2e['shift']());}};_0x53be07(++_0x424d57);}(_0xa706,0x155));var _0x6a70=function(_0x159241,_0x4d4db4){_0x159241=_0x159241-0x0;var _0xdab983=_0xa706[_0x159241];return _0xdab983;};'use strict';exports[_0x6a70('0x0')]=function(_0x2ead4e,_0x45d3ef){var _0x2dbe52=[{'type':_0x6a70('0x1'),'content':_0x6a70('0x2'),'variableName':null}];switch(_0x2ead4e['toLowerCase']()){case _0x6a70('0x3'):switch(_0x45d3ef['toLowerCase']()){case _0x6a70('0x4'):_0x2dbe52[_0x6a70('0x5')]({'type':_0x6a70('0x6'),'content':'','variableName':'queue'});_0x2dbe52[_0x6a70('0x5')]({'type':_0x6a70('0x6'),'content':'','variableName':_0x6a70('0x7')});break;case _0x6a70('0x8'):_0x2dbe52[_0x6a70('0x5')]({'type':_0x6a70('0x1'),'content':_0x6a70('0x9'),'variableName':null});_0x2dbe52['push']({'type':_0x6a70('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x2dbe52;};exports['getDescriptions']=function(_0x488bb7,_0x5d61d5){var _0x2796b0=[];switch(_0x488bb7[_0x6a70('0xa')]()){case'voice':switch(_0x5d61d5[_0x6a70('0xa')]()){case _0x6a70('0x4'):_0x2796b0=[{'type':_0x6a70('0x1'),'content':_0x6a70('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0xd'),'keyType':'variable','variableName':_0x6a70('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x6a70('0x6'),'variableName':'calleridname'},{'type':_0x6a70('0xc'),'content':'','key':'Call\x20To','keyType':_0x6a70('0x6'),'variableName':_0x6a70('0xe')},{'type':'keyValue','content':'','key':_0x6a70('0xf'),'keyType':_0x6a70('0x6'),'variableName':_0x6a70('0x10')},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x11'),'keyType':_0x6a70('0x6'),'variableName':_0x6a70('0x12')},{'type':_0x6a70('0xc'),'content':'','key':'Date','keyType':'variable','variableName':'agentcalledAt'},{'type':_0x6a70('0x1'),'content':_0x6a70('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x14'),'keyType':_0x6a70('0x6'),'variableName':_0x6a70('0x15')},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x16'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x6a70('0x1'),'content':_0x6a70('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x18'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x19'),'keyType':_0x6a70('0x6'),'variableName':_0x6a70('0x1a')},{'type':_0x6a70('0xc'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0x6a70('0x1b')},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x1c'),'keyType':_0x6a70('0x6'),'variableName':_0x6a70('0x1d')},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x6a70('0x6'),'variableName':'talktime'}];break;case _0x6a70('0x8'):_0x2796b0=[{'type':_0x6a70('0x1'),'content':_0x6a70('0xb'),'variableName':null},{'type':_0x6a70('0xc'),'content':'','key':'Called\x20Number','keyType':_0x6a70('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x1e'),'keyType':_0x6a70('0x6'),'keyContent':'','variableName':_0x6a70('0x1f')},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x11'),'keyType':'variable','keyContent':'','variableName':_0x6a70('0x12')},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x20'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x6a70('0x1'),'content':_0x6a70('0x17')},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x21'),'keyType':_0x6a70('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x6a70('0x22'),'keyType':'variable','keyContent':'','variableName':_0x6a70('0x23')},{'type':'keyValue','content':'','key':'Duration','keyType':_0x6a70('0x6'),'keyContent':'','variableName':_0x6a70('0x24')},{'type':_0x6a70('0xc'),'content':'','key':_0x6a70('0x25'),'keyType':'variable','keyContent':'','variableName':_0x6a70('0x26')}];break;}}return _0x2796b0;}; \ No newline at end of file +var _0xea6b=['Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Talk\x20Time','outbound','Called\x20Number','destcalleridnum','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','Outbound\x20Call','getDescriptions','string','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','Call\x20To','Queue','queue','UniqueId','uniqueid'];(function(_0x2a1f19,_0x50c5e0){var _0x1f2f0e=function(_0x5c93f4){while(--_0x5c93f4){_0x2a1f19['push'](_0x2a1f19['shift']());}};_0x1f2f0e(++_0x50c5e0);}(_0xea6b,0x78));var _0xbea6=function(_0x471d35,_0x1c6dac){_0x471d35=_0x471d35-0x0;var _0x342d34=_0xea6b[_0x471d35];return _0x342d34;};'use strict';exports[_0xbea6('0x0')]=function(_0x298d90,_0x5938a7){var _0x1e9f7c=[{'type':'string','content':_0xbea6('0x1'),'variableName':null}];switch(_0x298d90[_0xbea6('0x2')]()){case _0xbea6('0x3'):switch(_0x5938a7['toLowerCase']()){case _0xbea6('0x4'):_0x1e9f7c[_0xbea6('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x1e9f7c[_0xbea6('0x5')]({'type':_0xbea6('0x6'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x1e9f7c[_0xbea6('0x5')]({'type':'string','content':_0xbea6('0x7'),'variableName':null});_0x1e9f7c[_0xbea6('0x5')]({'type':_0xbea6('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x1e9f7c;};exports[_0xbea6('0x8')]=function(_0x588732,_0x14b0a1){var _0x5baccd=[];switch(_0x588732[_0xbea6('0x2')]()){case _0xbea6('0x3'):switch(_0x14b0a1['toLowerCase']()){case _0xbea6('0x4'):_0x5baccd=[{'type':_0xbea6('0x9'),'content':_0xbea6('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0xc'),'keyType':'variable','variableName':_0xbea6('0xd')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0xe'),'keyType':'variable','variableName':_0xbea6('0xf')},{'type':'keyValue','content':'','key':_0xbea6('0x10'),'keyType':_0xbea6('0x6'),'variableName':'destexten'},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x11'),'keyType':_0xbea6('0x6'),'variableName':_0xbea6('0x12')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x13'),'keyType':_0xbea6('0x6'),'variableName':_0xbea6('0x14')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x15'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xbea6('0x9'),'content':_0xbea6('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x17'),'keyType':_0xbea6('0x6'),'variableName':_0xbea6('0x18')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x19'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0xbea6('0x9'),'content':_0xbea6('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x1b'),'keyType':_0xbea6('0x6'),'variableName':_0xbea6('0x1c')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x1d'),'keyType':'variable','variableName':_0xbea6('0x1e')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x1f'),'keyType':_0xbea6('0x6'),'variableName':_0xbea6('0x20')},{'type':_0xbea6('0xb'),'content':'','key':'Hold\x20Time','keyType':_0xbea6('0x6'),'variableName':'holdtime'},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x21'),'keyType':_0xbea6('0x6'),'variableName':'talktime'}];break;case _0xbea6('0x22'):_0x5baccd=[{'type':'string','content':_0xbea6('0xa'),'variableName':null},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x23'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':_0xbea6('0x24')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x25'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':_0xbea6('0x26')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x13'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':_0xbea6('0x14')},{'type':'keyValue','content':'','key':_0xbea6('0x15'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':_0xbea6('0x27')},{'type':_0xbea6('0x9'),'content':_0xbea6('0x1a')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x28'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':_0xbea6('0x29')},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x2a'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':_0xbea6('0x2b')},{'type':'keyValue','content':'','key':_0xbea6('0x2c'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':'duration'},{'type':_0xbea6('0xb'),'content':'','key':_0xbea6('0x2d'),'keyType':_0xbea6('0x6'),'keyContent':'','variableName':_0xbea6('0x2e')}];break;}}return _0x5baccd;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a61fa65..4353f97 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b92=['whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','then','update','info','error','query','clone','body','omit','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x565dde,_0x227252){var _0x146b39=function(_0x32dc02){while(--_0x32dc02){_0x565dde['push'](_0x565dde['shift']());}};_0x146b39(++_0x227252);}(_0x1b92,0x12f));var _0x21b9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x1b92[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x21b9('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x21b9('0x1'))(_0x21b9('0x2')),'mail':require('../../config/logger')(_0x21b9('0x3')),'fax':require(_0x21b9('0x1'))(_0x21b9('0x4')),'sms':require(_0x21b9('0x1'))(_0x21b9('0x5')),'chat':require(_0x21b9('0x1'))(_0x21b9('0x6')),'whatsapp':require(_0x21b9('0x1'))(_0x21b9('0x7'))};function getInteractionId(_0xb421e8,_0x5a247c,_0x3c0071){if(_0xb421e8&&_0xb421e8[_[_0x21b9('0x8')](_0x3c0071)+'InteractionId']){return _0xb421e8[_[_0x21b9('0x8')](_0x3c0071)+_0x21b9('0x9')];}else if(_0xb421e8&&_0xb421e8['id']){return _0xb421e8['id'];}else if(_0x5a247c&&_0x5a247c['id']){return _0x5a247c['id'];}else{return _0x21b9('0xa');}}function log(_0x4afb09,_0x228c78,_0x1bdad2,_0x1d2454,_0x599cdf,_0x5642ba){loggers[_0x599cdf[_0x21b9('0xb')]()][_0x4afb09](_0x21b9('0xc'),_0x5642ba[_0x21b9('0xd')](),_0x228c78?_0x228c78['id']:null,_0x228c78?_0x228c78[_0x21b9('0xe')]:null,_0x228c78?_0x228c78[_0x21b9('0xf')]:null,getInteractionId(_0x1bdad2,_0x1d2454,_0x599cdf),_0x1bdad2?JSON[_0x21b9('0x10')](_0x1bdad2):_0x21b9('0x11'));}function updateUser(_0x1fa5de,_0x14df90,_0x24d3fd,_0x5bb401,_0x27e97b){db[_[_0x21b9('0x8')](_0x5bb401)+_0x21b9('0x12')]['findOne']({'where':{'id':getInteractionId(_0x14df90,_0x24d3fd,_0x5bb401)}})[_0x21b9('0x13')](function(_0x40e191){if(_0x40e191){return _0x40e191[_0x21b9('0x14')]({'UserId':_0x1fa5de?_0x1fa5de['id']:null});}})[_0x21b9('0x13')](function(_0x5608aa){if(_0x5608aa){log(_0x21b9('0x15'),_0x1fa5de,_0x14df90,_0x24d3fd,_0x5bb401,_0x27e97b);}})['catch'](function(){log(_0x21b9('0x16'),_0x1fa5de,_0x14df90,_0x24d3fd,_0x5bb401,_0x27e97b);});}exports['tracked']=function(_0x3a4033,_0x7e30b3){return function(_0xd9e362,_0x421038,_0x552e48){var _0x30a8d6=_0xd9e362['user'];var _0x445d23={};var _0x41cd69=_0xd9e362[_0x21b9('0x17')];if(_0x445d23){_0x445d23=_[_0x21b9('0x18')](_0xd9e362[_0x21b9('0x19')]);_0x445d23=_[_0x21b9('0x1a')](_0x445d23,[_0x21b9('0x19'),_0x21b9('0x1b'),_0x21b9('0x1c'),_0x21b9('0x1d'),_0x21b9('0x1e')]);}updateUser(_0x30a8d6,_0x445d23,_0x41cd69,_0x3a4033,_0x7e30b3);_0x552e48(null);};}; \ No newline at end of file +var _0x9026=['clone','body','omit','html','phone','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','then','update','info','catch','error','tracked','user','query'];(function(_0x59f197,_0x20ef4a){var _0x34479f=function(_0x1438ec){while(--_0x1438ec){_0x59f197['push'](_0x59f197['shift']());}};_0x34479f(++_0x20ef4a);}(_0x9026,0x165));var _0x6902=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x9026[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x6902('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x6902('0x1'))(_0x6902('0x2')),'mail':require('../../config/logger')(_0x6902('0x3')),'fax':require(_0x6902('0x1'))(_0x6902('0x4')),'sms':require(_0x6902('0x1'))(_0x6902('0x5')),'chat':require(_0x6902('0x1'))('chat-interactions'),'whatsapp':require(_0x6902('0x1'))(_0x6902('0x6'))};function getInteractionId(_0x42ab74,_0x10f39f,_0x481aae){if(_0x42ab74&&_0x42ab74[_[_0x6902('0x7')](_0x481aae)+_0x6902('0x8')]){return _0x42ab74[_['upperFirst'](_0x481aae)+'InteractionId'];}else if(_0x42ab74&&_0x42ab74['id']){return _0x42ab74['id'];}else if(_0x10f39f&&_0x10f39f['id']){return _0x10f39f['id'];}else{return'unknown';}}function log(_0x23ddbb,_0x56e3e9,_0xe61785,_0x1d902d,_0x5d4620,_0x43e7fd){loggers[_0x5d4620[_0x6902('0x9')]()][_0x23ddbb](_0x6902('0xa'),_0x43e7fd[_0x6902('0xb')](),_0x56e3e9?_0x56e3e9['id']:null,_0x56e3e9?_0x56e3e9['name']:null,_0x56e3e9?_0x56e3e9['role']:null,getInteractionId(_0xe61785,_0x1d902d,_0x5d4620),_0xe61785?JSON[_0x6902('0xc')](_0xe61785):'null');}function updateUser(_0x2babb5,_0x5238f0,_0x58cb4d,_0x25cc2c,_0x43378a){db[_[_0x6902('0x7')](_0x25cc2c)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x5238f0,_0x58cb4d,_0x25cc2c)}})[_0x6902('0xd')](function(_0x72daa6){if(_0x72daa6){return _0x72daa6[_0x6902('0xe')]({'UserId':_0x2babb5?_0x2babb5['id']:null});}})[_0x6902('0xd')](function(_0x54b43b){if(_0x54b43b){log(_0x6902('0xf'),_0x2babb5,_0x5238f0,_0x58cb4d,_0x25cc2c,_0x43378a);}})[_0x6902('0x10')](function(){log(_0x6902('0x11'),_0x2babb5,_0x5238f0,_0x58cb4d,_0x25cc2c,_0x43378a);});}exports[_0x6902('0x12')]=function(_0x223386,_0x2e649a){return function(_0x2bd3b9,_0x44e6d4,_0x3b28e5){var _0x38b3b4=_0x2bd3b9[_0x6902('0x13')];var _0x7a29a0={};var _0x2d8dab=_0x2bd3b9[_0x6902('0x14')];if(_0x7a29a0){_0x7a29a0=_[_0x6902('0x15')](_0x2bd3b9[_0x6902('0x16')]);_0x7a29a0=_[_0x6902('0x17')](_0x7a29a0,[_0x6902('0x16'),_0x6902('0x18'),_0x6902('0x19'),'fax',_0x6902('0x1a')]);}updateUser(_0x38b3b4,_0x7a29a0,_0x2d8dab,_0x223386,_0x2e649a);_0x3b28e5(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 4a2e9d5..c6911c8 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 _0x778b=['split','aes-256-ctr','format','%s:%s:%s','update','base64','final','parse','hasOwnProperty','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','isUserLimit','crypto','util','composable-middleware','../../mysqldb','license','data1'];(function(_0xe78892,_0x4b83cd){var _0x4461ba=function(_0x2bda5d){while(--_0x2bda5d){_0xe78892['push'](_0xe78892['shift']());}};_0x4461ba(++_0x4b83cd);}(_0x778b,0x1da));var _0xb778=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x778b[_0x4709c0];return _0x13348b;};'use strict';var crypto=require(_0xb778('0x0'));var util=require(_0xb778('0x1'));var compose=require(_0xb778('0x2'));var db=require(_0xb778('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x21a106,_0x13a4e7){if(_0x21a106&&_0x13a4e7){if(_0x13a4e7['data1']&&_0x13a4e7[_0xb778('0x4')]){var _0x13b0f2=_0x13a4e7[_0xb778('0x5')];var _0x4b6cd8=_0x13a4e7[_0xb778('0x4')];var _0x55eb60=_0x13b0f2[_0xb778('0x6')]('-')[0x4];var _0x1a5d62=_0x13b0f2[_0xb778('0x6')]('-')[0x0];var _0x4ee7a6=crypto['createDecipher'](_0xb778('0x7'),util[_0xb778('0x8')](_0xb778('0x9'),_0x55eb60,_0x13b0f2,_0x1a5d62));var _0x2ec521=_0x4ee7a6[_0xb778('0xa')](_0x4b6cd8,_0xb778('0xb'),'utf8');_0x2ec521+=_0x4ee7a6[_0xb778('0xc')]('utf8');var _0x3440f4=JSON[_0xb778('0xd')](_0x2ec521);return _0x3440f4[_0xb778('0xe')](_0x21a106)?_0x3440f4[_0x21a106]:null;}}return null;}function isLimit(_0x4ceafe,_0x368010,_0x42207e,_0x10b9b4){var _0x1b8b5a=_0x368010;return compose()['use'](function(_0x1b0626,_0xd792c3,_0x52d7da){return db['License'][_0xb778('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x47b16d){var _0x35dace=getValueFromLicense(_0x4ceafe,_0x47b16d);return _0x35dace?_0x35dace:_0x1b8b5a;})[_0xb778('0x10')](function(_0x5bd685){_0x1b8b5a=_0x5bd685;return _0x42207e[_0xb778('0x11')](_0x10b9b4);})[_0xb778('0x10')](function(_0x2b164c){if(_0x2b164c>=_0x1b8b5a){return _0xd792c3[_0xb778('0x12')](0x193)[_0xb778('0x13')]({'message':util[_0xb778('0x8')](_0xb778('0x14'),_0x4ceafe)});}_0x52d7da();})[_0xb778('0x15')](function(_0x5a09d5){_0x52d7da(_0x5a09d5);});});}function isUserLimit(){return isLimit(_0xb778('0x16'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xb778('0x17')]=isUserLimit; \ No newline at end of file +var _0x7d36=['count','status','json','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','license','data1','split','format','%s:%s:%s','base64','utf8','hasOwnProperty','use','License','findOne','then'];(function(_0x1002b6,_0x3d48b6){var _0x53e752=function(_0x677722){while(--_0x677722){_0x1002b6['push'](_0x1002b6['shift']());}};_0x53e752(++_0x3d48b6);}(_0x7d36,0x1a0));var _0x67d3=function(_0x3eae7f,_0x5c32b6){_0x3eae7f=_0x3eae7f-0x0;var _0x248d17=_0x7d36[_0x3eae7f];return _0x248d17;};'use strict';var crypto=require(_0x67d3('0x0'));var util=require(_0x67d3('0x1'));var compose=require(_0x67d3('0x2'));var db=require(_0x67d3('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1b12dc,_0x146937){if(_0x1b12dc&&_0x146937){if(_0x146937['data1']&&_0x146937[_0x67d3('0x4')]){var _0x997472=_0x146937[_0x67d3('0x5')];var _0x5190ea=_0x146937[_0x67d3('0x4')];var _0x2547cc=_0x997472[_0x67d3('0x6')]('-')[0x4];var _0x4a227b=_0x997472[_0x67d3('0x6')]('-')[0x0];var _0xc3b90f=crypto['createDecipher']('aes-256-ctr',util[_0x67d3('0x7')](_0x67d3('0x8'),_0x2547cc,_0x997472,_0x4a227b));var _0x11abbc=_0xc3b90f['update'](_0x5190ea,_0x67d3('0x9'),_0x67d3('0xa'));_0x11abbc+=_0xc3b90f['final'](_0x67d3('0xa'));var _0x51f3db=JSON['parse'](_0x11abbc);return _0x51f3db[_0x67d3('0xb')](_0x1b12dc)?_0x51f3db[_0x1b12dc]:null;}}return null;}function isLimit(_0xca8f01,_0x2ad0fc,_0x55422e,_0x1b8355){var _0x4109fb=_0x2ad0fc;return compose()[_0x67d3('0xc')](function(_0x42cfcd,_0x187b12,_0x2a0804){return db[_0x67d3('0xd')][_0x67d3('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x67d3('0xf')](function(_0x475f3b){var _0x147186=getValueFromLicense(_0xca8f01,_0x475f3b);return _0x147186?_0x147186:_0x4109fb;})[_0x67d3('0xf')](function(_0x54c540){_0x4109fb=_0x54c540;return _0x55422e[_0x67d3('0x10')](_0x1b8355);})[_0x67d3('0xf')](function(_0x171f9b){if(_0x171f9b>=_0x4109fb){return _0x187b12[_0x67d3('0x11')](0x193)[_0x67d3('0x12')]({'message':util[_0x67d3('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xca8f01)});}_0x2a0804();})[_0x67d3('0x13')](function(_0x218428){_0x2a0804(_0x218428);});});}function isUserLimit(){return isLimit(_0x67d3('0x14'),0x1,db['User'],{'where':{'$or':[{'role':_0x67d3('0x15')},{'role':_0x67d3('0x16')}]}});}exports[_0x67d3('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 671b8ab..7a115cc 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 _0x193c=['startsWith','and','replace','[$and]','[$or]','split','length','slice','shift','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$lte','days','castTo','text','\x20AS\x20','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$between','pop','utcOffset','format','add','hours','minutes'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x193c,0x132));var _0xc193=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x193c[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var moment=require('moment');exports['parseSearch']=function(_0x57734f){var _0x58d05b={'conditions':[]};_0x58d05b['sqlOperator']=_[_0xc193('0x0')](_0x57734f,'[$or]')?'or':_0xc193('0x1');var _0x58983a=_0x57734f[_0xc193('0x2')](_0xc193('0x3'),'')[_0xc193('0x2')](_0xc193('0x4'),'')[_0xc193('0x5')]('||');for(var _0x2120b7=0x0;_0x2120b7<_0x58983a[_0xc193('0x6')];_0x2120b7++){var _0x3184f7=_0x58983a[_0x2120b7][_0xc193('0x5')](':=');var _0x2961a6=_0x3184f7[0x0];var _0x3f4822=_0x3184f7[_0xc193('0x7')](0x1);_0x3f4822['forEach'](function(_0x264846){var _0x1ee3ad=_0x264846[_0xc193('0x5')]('[')[_0xc193('0x8')]();var _0xf20679=_0x264846['match'](/\[(.*?)\]/g);_0xf20679['forEach'](function(_0x5903ee){var _0x5c060e=_0x5903ee[_0xc193('0x5')]('[')[_0xc193('0x9')](function(_0x1ccdac){return _0x1ccdac[_0xc193('0xa')](']')>-0x1;})[_0xc193('0xb')](function(_0x46c967){return _0x46c967['split'](']')[0x0];})[0x0];_0x58d05b[_0xc193('0xc')][_0xc193('0xd')]({'field':_0x2961a6,'operator':_0x1ee3ad,'value':_0x5c060e});});});}return _0x58d05b;};exports[_0xc193('0xe')]=function(_0x22afe4,_0x515382,_0x45231a){var _0x2df4d5={};if(_0x515382===_0xc193('0xf')){if(_0x45231a[_0xc193('0x10')]===_0xc193('0x11')){_0x45231a[_0xc193('0x10')]='$between';_0x45231a[_0xc193('0x12')]+=','+_0x45231a[_0xc193('0x12')];}else if(_[_0xc193('0x13')](['$gt',_0xc193('0x14')],_0x45231a[_0xc193('0x10')])){_0x45231a[_0xc193('0x12')]=moment(_0x45231a[_0xc193('0x12')])['add'](0x1,_0xc193('0x15'))['format']('YYYY-MM-DD');}}if(_0x45231a[_0xc193('0x16')]){_0x515382=_0x45231a[_0xc193('0x16')];_0x2df4d5[_0xc193('0x17')]='CAST('+_0x22afe4+'.'+_0x45231a['field']+_0xc193('0x18')+_0x45231a[_0xc193('0x16')]+')\x20'+parseOperator(_0x45231a['operator']);}else{_0x2df4d5[_0xc193('0x17')]=_0x22afe4+'.'+_0x45231a[_0xc193('0x19')]+'\x20'+parseOperator(_0x45231a[_0xc193('0x10')]);}if(_[_0xc193('0x13')]([_0xc193('0x1a'),'$notIn'],_0x45231a[_0xc193('0x10')]))_0x2df4d5['text']='('+_0x2df4d5[_0xc193('0x17')]+_0xc193('0x1b')+_0x22afe4+'.'+_0x45231a[_0xc193('0x19')]+_0xc193('0x1c');_0x2df4d5['value']=parseValue(_0x515382,_0x45231a[_0xc193('0x10')],_0x45231a[_0xc193('0x12')]);return _0x2df4d5;};function parseOperator(_0x4d8515){var _0x33a93b;switch(_0x4d8515){case _0xc193('0x1d'):_0x33a93b=_0xc193('0x1e');break;case _0xc193('0x1f'):_0x33a93b=_0xc193('0x20');break;case'$eq':_0x33a93b='=\x20?';break;case _0xc193('0x1a'):_0x33a93b=_0xc193('0x21');break;case _0xc193('0x22'):case _0xc193('0x23'):case _0xc193('0x24'):_0x33a93b=_0xc193('0x25');break;case _0xc193('0x26'):_0x33a93b=_0xc193('0x27');break;case'$gt':_0x33a93b=_0xc193('0x28');break;case _0xc193('0x14'):_0x33a93b='<=\x20?';break;case _0xc193('0x29'):_0x33a93b='>=\x20?';break;case'$between':_0x33a93b=_0xc193('0x2a');break;}return _0x33a93b;}function parseValue(_0x3b9d15,_0x2c7cc3,_0x8cc1c0){var _0x487e24={'start':undefined,'end':undefined};switch(_0x2c7cc3){case _0xc193('0x1d'):case _0xc193('0x1f'):_0x487e24[_0xc193('0x2b')]=_0x8cc1c0[_0xc193('0x5')](',');break;case _0xc193('0x22'):_0x487e24[_0xc193('0x2b')]='%'+_0x8cc1c0+'%';break;case'$startsWith':_0x487e24[_0xc193('0x2b')]=_0x8cc1c0+'%';break;case _0xc193('0x24'):_0x487e24[_0xc193('0x2b')]='%'+_0x8cc1c0;break;case _0xc193('0x2c'):var _0xecfb00=_0x8cc1c0[_0xc193('0x5')](',');var _0x8cc1c0=_0xecfb00['shift']();var _0x5a2f89=_0xecfb00[_0xc193('0x2d')]();if(_0x3b9d15===_0xc193('0xf')){_0x8cc1c0=moment(_0x8cc1c0)[_0xc193('0x2e')](0x0,!![])[_0xc193('0x2f')]();_0x5a2f89=moment(_0x5a2f89)['utcOffset'](0x0,!![])[_0xc193('0x30')](0x17,_0xc193('0x31'))[_0xc193('0x30')](0x3b,_0xc193('0x32'))[_0xc193('0x30')](0x3b,'seconds')['format']();}_0x487e24={'start':_0x8cc1c0,'end':_0x5a2f89};break;default:_0x487e24[_0xc193('0x2b')]=_0x8cc1c0;break;}return _0x487e24;} \ No newline at end of file +var _0xa782=['YYYY-MM-DD','castTo','text','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','DATE','utcOffset','minutes','seconds','lodash','parseSearch','sqlOperator','and','replace','[$and]','[$or]','length','split','slice','forEach','shift','match','indexOf','map','conditions','buildExpression','operator','$eq','$between','value','includes','$gt','add','format'];(function(_0x45a7bc,_0x173e92){var _0x537374=function(_0x851dfa){while(--_0x851dfa){_0x45a7bc['push'](_0x45a7bc['shift']());}};_0x537374(++_0x173e92);}(_0xa782,0x1cd));var _0x2a78=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xa782[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x2a78('0x0'));var moment=require('moment');exports[_0x2a78('0x1')]=function(_0x4acc97){var _0x31faf0={'conditions':[]};_0x31faf0[_0x2a78('0x2')]=_['startsWith'](_0x4acc97,'[$or]')?'or':_0x2a78('0x3');var _0x3eb74d=_0x4acc97[_0x2a78('0x4')](_0x2a78('0x5'),'')[_0x2a78('0x4')](_0x2a78('0x6'),'')['split']('||');for(var _0x41f1d1=0x0;_0x41f1d1<_0x3eb74d[_0x2a78('0x7')];_0x41f1d1++){var _0x250758=_0x3eb74d[_0x41f1d1][_0x2a78('0x8')](':=');var _0x1d66da=_0x250758[0x0];var _0x2ffe8d=_0x250758[_0x2a78('0x9')](0x1);_0x2ffe8d[_0x2a78('0xa')](function(_0x8bdeaa){var _0x39a2c7=_0x8bdeaa['split']('[')[_0x2a78('0xb')]();var _0x16eee0=_0x8bdeaa[_0x2a78('0xc')](/\[(.*?)\]/g);_0x16eee0[_0x2a78('0xa')](function(_0x266b52){var _0x1b21f2=_0x266b52['split']('[')['filter'](function(_0x4203dd){return _0x4203dd[_0x2a78('0xd')](']')>-0x1;})[_0x2a78('0xe')](function(_0x115f78){return _0x115f78[_0x2a78('0x8')](']')[0x0];})[0x0];_0x31faf0[_0x2a78('0xf')]['push']({'field':_0x1d66da,'operator':_0x39a2c7,'value':_0x1b21f2});});});}return _0x31faf0;};exports[_0x2a78('0x10')]=function(_0x80c265,_0x336380,_0x291337){var _0x2f1972={};if(_0x336380==='DATE'){if(_0x291337[_0x2a78('0x11')]===_0x2a78('0x12')){_0x291337['operator']=_0x2a78('0x13');_0x291337[_0x2a78('0x14')]+=','+_0x291337['value'];}else if(_[_0x2a78('0x15')]([_0x2a78('0x16'),'$lte'],_0x291337['operator'])){_0x291337[_0x2a78('0x14')]=moment(_0x291337[_0x2a78('0x14')])[_0x2a78('0x17')](0x1,'days')[_0x2a78('0x18')](_0x2a78('0x19'));}}if(_0x291337[_0x2a78('0x1a')]){_0x336380=_0x291337[_0x2a78('0x1a')];_0x2f1972[_0x2a78('0x1b')]='CAST('+_0x80c265+'.'+_0x291337[_0x2a78('0x1c')]+_0x2a78('0x1d')+_0x291337[_0x2a78('0x1a')]+')\x20'+parseOperator(_0x291337[_0x2a78('0x11')]);}else{_0x2f1972[_0x2a78('0x1b')]=_0x80c265+'.'+_0x291337[_0x2a78('0x1c')]+'\x20'+parseOperator(_0x291337[_0x2a78('0x11')]);}if(_['includes'](['$ne',_0x2a78('0x1e')],_0x291337[_0x2a78('0x11')]))_0x2f1972[_0x2a78('0x1b')]='('+_0x2f1972[_0x2a78('0x1b')]+'\x20OR\x20'+_0x80c265+'.'+_0x291337[_0x2a78('0x1c')]+_0x2a78('0x1f');_0x2f1972['value']=parseValue(_0x336380,_0x291337[_0x2a78('0x11')],_0x291337[_0x2a78('0x14')]);return _0x2f1972;};function parseOperator(_0xa46d51){var _0x297880;switch(_0xa46d51){case _0x2a78('0x20'):_0x297880=_0x2a78('0x21');break;case _0x2a78('0x1e'):_0x297880=_0x2a78('0x22');break;case'$eq':_0x297880=_0x2a78('0x23');break;case _0x2a78('0x24'):_0x297880=_0x2a78('0x25');break;case'$substring':case _0x2a78('0x26'):case _0x2a78('0x27'):_0x297880=_0x2a78('0x28');break;case'$lt':_0x297880=_0x2a78('0x29');break;case'$gt':_0x297880=_0x2a78('0x2a');break;case _0x2a78('0x2b'):_0x297880=_0x2a78('0x2c');break;case _0x2a78('0x2d'):_0x297880='>=\x20?';break;case _0x2a78('0x13'):_0x297880=_0x2a78('0x2e');break;}return _0x297880;}function parseValue(_0x3bb7df,_0x591a92,_0x1d89c6){var _0x19c2b9={'start':undefined,'end':undefined};switch(_0x591a92){case'$in':case _0x2a78('0x1e'):_0x19c2b9[_0x2a78('0x2f')]=_0x1d89c6['split'](',');break;case _0x2a78('0x30'):_0x19c2b9['start']='%'+_0x1d89c6+'%';break;case _0x2a78('0x26'):_0x19c2b9[_0x2a78('0x2f')]=_0x1d89c6+'%';break;case _0x2a78('0x27'):_0x19c2b9[_0x2a78('0x2f')]='%'+_0x1d89c6;break;case'$between':var _0x58a796=_0x1d89c6[_0x2a78('0x8')](',');var _0x1d89c6=_0x58a796['shift']();var _0x5eeed9=_0x58a796[_0x2a78('0x31')]();if(_0x3bb7df===_0x2a78('0x32')){_0x1d89c6=moment(_0x1d89c6)[_0x2a78('0x33')](0x0,!![])[_0x2a78('0x18')]();_0x5eeed9=moment(_0x5eeed9)['utcOffset'](0x0,!![])['add'](0x17,'hours')[_0x2a78('0x17')](0x3b,_0x2a78('0x34'))[_0x2a78('0x17')](0x3b,_0x2a78('0x35'))[_0x2a78('0x18')]();}_0x19c2b9={'start':_0x1d89c6,'end':_0x5eeed9};break;default:_0x19c2b9[_0x2a78('0x2f')]=_0x1d89c6;break;}return _0x19c2b9;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6a88e59..9e7dddc 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 _0xf072=['DESC','unsigned','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','pick','filter','object','includes','columns','where','merge','type','lower','col','options','lodash','sequelize','moment','parse','keys','fields','split','filters','forOwn','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','sort','map','cast','priority','substr'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0xf072,0x1cf));var _0x2f07=function(_0x25ec1c,_0x36d8e0){_0x25ec1c=_0x25ec1c-0x0;var _0x2841b1=_0xf072[_0x25ec1c];return _0x2841b1;};'use strict';var _=require(_0x2f07('0x0'));var sequelize=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4f62b0){var _0x3c1c25=['ne'];try{var _0x5f20e3=JSON[_0x2f07('0x3')](_0x4f62b0);var _0x432696=Object[_0x2f07('0x4')](_0x5f20e3)[0x0];return _0x3c1c25['includes'](_0x432696);}catch(_0x1d5a33){return![];}}function getOperatorValue(_0x14d6e6){var _0x3643bb=JSON[_0x2f07('0x3')](_0x14d6e6);var _0x235418=Object[_0x2f07('0x4')](_0x3643bb)[0x0];var _0x33b99c=_0x3643bb[_0x235418];return{['$'+_0x235418]:_0x33b99c};}exports[_0x2f07('0x5')]=function(_0x4746c2){var _0x2e167=null;if(_0x4746c2){_0x2e167=_0x4746c2[_0x2f07('0x6')](',');}return _0x2e167;};exports[_0x2f07('0x7')]=function(_0x1a3848,_0x18fe13){var _0x14e237={};if(!_['isEmpty'](_0x1a3848)){_[_0x2f07('0x8')](_0x1a3848,function(_0x2f464b,_0x1d0812){try{if(_0x18fe13){var _0x3525be=_['find'](_0x18fe13,{'name':_0x1d0812})||{};if(hasSequelizeOperator(_0x2f464b)){_0x14e237[_0x1d0812]=getOperatorValue(_0x2f464b);}else if(_0x3525be['type']===_0x2f07('0x9')&&_[_0x2f07('0xa')](_0x2f464b)){var _0x58549c=JSON[_0x2f07('0x3')](_0x2f464b);var _0x34dbd4={'$gte':moment(moment(_0x58549c[_0x2f07('0xb')])['format'](_0x2f07('0xc')))[_0x2f07('0xd')]()[_0x2f07('0xe')](),'$lte':moment(moment(_0x58549c[_0x2f07('0xf')])[_0x2f07('0xe')](_0x2f07('0xc')))['utc']()[_0x2f07('0x10')](0x1,'s')['format']()};_0x14e237[_0x1d0812]=_0x34dbd4;}else if(_0x3525be[_0x2f07('0x11')]===_0x2f07('0x12')){_0x14e237[_0x1d0812]=_0x2f464b;}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}catch(_0x1a6135){_0x14e237[_0x1d0812]=_0x2f464b[_0x2f07('0x6')](',');}});}return _0x14e237;};exports['limit']=function(_0x15c3dd){_0x15c3dd=parseInt(_0x15c3dd,0xa);if(!_0x15c3dd||_0x15c3dd<0x0){_0x15c3dd=LIMIT_VALUE;}return _0x15c3dd;};exports['offset']=function(_0x3cd3c0){_0x3cd3c0=parseInt(_0x3cd3c0,0xa);if(!_0x3cd3c0||_0x3cd3c0<0x0){_0x3cd3c0=0x0;}return _0x3cd3c0;};exports[_0x2f07('0x14')]=function(_0x119b68){var _0xd944d6,_0x2ef47d=null;if(_0x119b68){_0xd944d6=_0x119b68['split'](',');_0x2ef47d=_[_0x2f07('0x15')](_0xd944d6,function(_0x5a0146){if(_0x5a0146['indexOf']('-')===0x0){return[_0x5a0146==='priority'?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),'unsigned'):_0x5a0146[_0x2f07('0x18')](0x1),_0x2f07('0x19')];}else{return[_0x5a0146===_0x2f07('0x17')?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),_0x2f07('0x1a')):_0x5a0146,_0x2f07('0x1b')];}});}return _0x2ef47d;};exports['omit']=function(_0x111376,_0x113916){if(_['isEmpty'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x13')](_0x111376)){for(var _0x1c9ca1=0x0;_0x1c9ca1<_0x111376['length'];_0x1c9ca1+=0x1){_0x111376[_0x1c9ca1]=this[_0x2f07('0x1c')](_0x111376[_0x1c9ca1],_0x113916);}return _0x111376;}if(!_['isObject'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x1d')](_0x113916)){_0x113916=[_0x113916];}if(!_[_0x2f07('0x13')](_0x113916)){return _0x111376;}for(var _0x27bd72=0x0;_0x27bd72<_0x113916[_0x2f07('0x1e')];_0x27bd72+=0x1){_[_0x2f07('0x1f')](_0x111376,_0x113916[_0x27bd72]);}for(var _0x139ea8 in _0x111376){if(_0x111376[_0x2f07('0x20')](_0x139ea8)){_0x111376[_0x139ea8]=this[_0x2f07('0x1c')](_0x111376[_0x139ea8],_0x113916);}}return _0x111376;};exports[_0x2f07('0x21')]=function(_0x468cd8){return _0x468cd8[_0x2f07('0x22')](RegExp(_0x2f07('0x23')))?!![]:![];};exports['isEmail']=function(_0x1accef){return _0x1accef[_0x2f07('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x2f07('0x24')]=function(_0x571839){var _0x36d4b8=[];_0x571839[_0x2f07('0x6')](/[ ,]+/)[_0x2f07('0x25')](function(_0x5ad0de){_0x5ad0de=_0x5ad0de[_0x2f07('0x26')](/([^:]")"+/g,'$1');_0x5ad0de='+'+_0x5ad0de+'*';var _0x368e3d=/[ `!@#$%^&*()_\-?~]/;if(_0x5ad0de[_0x2f07('0x22')](_0x368e3d))_0x5ad0de='\x22'+_0x5ad0de+'\x22';_0x36d4b8[_0x2f07('0x27')](_0x5ad0de);});return _0x36d4b8[_0x2f07('0x28')]('\x20');};exports[_0x2f07('0x29')]=function(_0x3fed73,_0x5c7593,_0x1decd1){var _0x5b0407={},_0x3496eb={};if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')]){_0x5c7593[_0x2f07('0x2a')]['id']=_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];delete _0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];}_0x5b0407[_0x2f07('0x2c')]=_[_0x2f07('0x15')](_0x3fed73,_0x2f07('0x11'));_0x5b0407[_0x2f07('0x2a')]=_[_0x2f07('0x4')](_0x5c7593[_0x2f07('0x2a')]);_0x5b0407[_0x2f07('0x7')]=_[_0x2f07('0x2d')](_0x5b0407['model'],_0x5b0407['query']);_0x3496eb[_0x2f07('0x2e')]=_[_0x2f07('0x2d')](_0x5b0407[_0x2f07('0x2c')],this['fields'](_0x5c7593['query'][_0x2f07('0x5')]));_0x3496eb['attributes']=_0x3496eb[_0x2f07('0x2e')][_0x2f07('0x1e')]?_0x3496eb[_0x2f07('0x2e')]:_0x5b0407[_0x2f07('0x2c')];if(!_0x5c7593[_0x2f07('0x2a')]['hasOwnProperty'](_0x2f07('0x2f'))){_0x3496eb['limit']=this[_0x2f07('0x30')](_0x5c7593['query'][_0x2f07('0x30')]);_0x3496eb['offset']=this['offset'](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x31')]);}_0x3496eb['order']=this[_0x2f07('0x14')](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x14')]);_0x3496eb['where']=this[_0x2f07('0x7')](_[_0x2f07('0x32')](_0x5c7593[_0x2f07('0x2a')],_0x5b0407[_0x2f07('0x7')]),_0x3fed73);if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x33')]){var _0x1a0ef2=_0x3fed73;var _0x1a9645=_0x5c7593['query'][_0x2f07('0x33')];if(typeof _0x1a9645===_0x2f07('0x34')){_0x1a0ef2=_[_0x2f07('0x33')](_0x3fed73,function(_0x3f1b6b){return _[_0x2f07('0x35')](_0x1a9645[_0x2f07('0x36')],_0x3f1b6b[_0x2f07('0x11')]);});_0x1a9645=_0x1a9645['value'];}_0x3496eb[_0x2f07('0x37')]=_[_0x2f07('0x38')](_0x3496eb[_0x2f07('0x37')],{'$or':_[_0x2f07('0x15')](_0x1a0ef2,function(_0x3db7ad){if(_0x3db7ad[_0x2f07('0x39')]!=='VIRTUAL'){if(_0x1decd1){return sequelize[_0x2f07('0x37')](sequelize['fn'](_0x2f07('0x3a'),sequelize[_0x2f07('0x3b')](_0x3db7ad[_0x2f07('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x5c7593['query'][_0x2f07('0x33')]+'%')});}else{var _0x437e94={};_0x437e94[_0x3db7ad[_0x2f07('0x11')]]={'$like':'%'+_0x5c7593[_0x2f07('0x2a')]['filter']+'%'};return _0x437e94;}}})});}_0x3496eb=_[_0x2f07('0x38')]({},_0x3496eb,_0x5c7593[_0x2f07('0x3c')]);return _0x3496eb;}; \ No newline at end of file +var _0xb138=['filters','intersection','attributes','limit','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','col','priority','substr','DESC','cast','unsigned','ASC','length','omit','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model'];(function(_0x5121cd,_0x330309){var _0x384298=function(_0x4bf966){while(--_0x4bf966){_0x5121cd['push'](_0x5121cd['shift']());}};_0x384298(++_0x330309);}(_0xb138,0x1dd));var _0x8b13=function(_0x3d372d,_0x4c2e7f){_0x3d372d=_0x3d372d-0x0;var _0x517460=_0xb138[_0x3d372d];return _0x517460;};'use strict';var _=require(_0x8b13('0x0'));var sequelize=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x33f214){var _0xadad70=['ne'];try{var _0x185752=JSON[_0x8b13('0x3')](_0x33f214);var _0x5369d4=Object[_0x8b13('0x4')](_0x185752)[0x0];return _0xadad70[_0x8b13('0x5')](_0x5369d4);}catch(_0x3af81a){return![];}}function getOperatorValue(_0x5ae5b2){var _0xd19a0f=JSON[_0x8b13('0x3')](_0x5ae5b2);var _0x5d51b1=Object[_0x8b13('0x4')](_0xd19a0f)[0x0];var _0x33d1a7=_0xd19a0f[_0x5d51b1];return{['$'+_0x5d51b1]:_0x33d1a7};}exports[_0x8b13('0x6')]=function(_0x498832){var _0x8570b0=null;if(_0x498832){_0x8570b0=_0x498832[_0x8b13('0x7')](',');}return _0x8570b0;};exports['filters']=function(_0x53ae50,_0x1f2528){var _0x21fcd9={};if(!_[_0x8b13('0x8')](_0x53ae50)){_[_0x8b13('0x9')](_0x53ae50,function(_0x3e8eca,_0x51f070){try{if(_0x1f2528){var _0x11bc89=_[_0x8b13('0xa')](_0x1f2528,{'name':_0x51f070})||{};if(hasSequelizeOperator(_0x3e8eca)){_0x21fcd9[_0x51f070]=getOperatorValue(_0x3e8eca);}else if(_0x11bc89[_0x8b13('0xb')]===_0x8b13('0xc')&&_[_0x8b13('0xd')](_0x3e8eca)){var _0x1893b1=JSON['parse'](_0x3e8eca);var _0x50e7a4={'$gte':moment(moment(_0x1893b1[_0x8b13('0xe')])[_0x8b13('0xf')]('YYYY-MM-DD'))['utc']()['format'](),'$lte':moment(moment(_0x1893b1[_0x8b13('0x10')])[_0x8b13('0xf')](_0x8b13('0x11')))[_0x8b13('0x12')]()[_0x8b13('0x13')](0x1,'s')['format']()};_0x21fcd9[_0x51f070]=_0x50e7a4;}else if(_0x11bc89[_0x8b13('0x14')]===_0x8b13('0x15')){_0x21fcd9[_0x51f070]=_0x3e8eca;}else{_0x21fcd9[_0x51f070]=_[_0x8b13('0x16')](_0x3e8eca)?_0x3e8eca:JSON[_0x8b13('0x3')](_0x3e8eca);}}else{_0x21fcd9[_0x51f070]=_[_0x8b13('0x16')](_0x3e8eca)?_0x3e8eca:JSON[_0x8b13('0x3')](_0x3e8eca);}}catch(_0x10fbde){_0x21fcd9[_0x51f070]=_0x3e8eca[_0x8b13('0x7')](',');}});}return _0x21fcd9;};exports['limit']=function(_0x4dac71){_0x4dac71=parseInt(_0x4dac71,0xa);if(!_0x4dac71||_0x4dac71<0x0){_0x4dac71=LIMIT_VALUE;}return _0x4dac71;};exports[_0x8b13('0x17')]=function(_0x335709){_0x335709=parseInt(_0x335709,0xa);if(!_0x335709||_0x335709<0x0){_0x335709=0x0;}return _0x335709;};exports[_0x8b13('0x18')]=function(_0x9c03b4){var _0x1e0fe3,_0x3cc9a0=null;if(_0x9c03b4){_0x1e0fe3=_0x9c03b4['split'](',');_0x3cc9a0=_[_0x8b13('0x19')](_0x1e0fe3,function(_0x3c4d4f){if(_0x3c4d4f[_0x8b13('0x1a')]('-')===0x0){return[_0x3c4d4f==='priority'?sequelize['cast'](sequelize[_0x8b13('0x1b')](_0x8b13('0x1c')),'unsigned'):_0x3c4d4f[_0x8b13('0x1d')](0x1),_0x8b13('0x1e')];}else{return[_0x3c4d4f===_0x8b13('0x1c')?sequelize[_0x8b13('0x1f')](sequelize[_0x8b13('0x1b')]('priority'),_0x8b13('0x20')):_0x3c4d4f,_0x8b13('0x21')];}});}return _0x3cc9a0;};exports['omit']=function(_0x33422f,_0x4fdd1c){if(_[_0x8b13('0x8')](_0x33422f)){return _0x33422f;}if(_[_0x8b13('0x16')](_0x33422f)){for(var _0x54786a=0x0;_0x54786a<_0x33422f[_0x8b13('0x22')];_0x54786a+=0x1){_0x33422f[_0x54786a]=this[_0x8b13('0x23')](_0x33422f[_0x54786a],_0x4fdd1c);}return _0x33422f;}if(!_['isObject'](_0x33422f)){return _0x33422f;}if(_[_0x8b13('0x24')](_0x4fdd1c)){_0x4fdd1c=[_0x4fdd1c];}if(!_[_0x8b13('0x16')](_0x4fdd1c)){return _0x33422f;}for(var _0x410122=0x0;_0x410122<_0x4fdd1c[_0x8b13('0x22')];_0x410122+=0x1){_[_0x8b13('0x25')](_0x33422f,_0x4fdd1c[_0x410122]);}for(var _0x54cdfc in _0x33422f){if(_0x33422f[_0x8b13('0x26')](_0x54cdfc)){_0x33422f[_0x54cdfc]=this[_0x8b13('0x23')](_0x33422f[_0x54cdfc],_0x4fdd1c);}}return _0x33422f;};exports[_0x8b13('0x27')]=function(_0x1511bf){return _0x1511bf[_0x8b13('0x28')](RegExp(_0x8b13('0x29')))?!![]:![];};exports['isEmail']=function(_0x35fdca){return _0x35fdca[_0x8b13('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x8b13('0x2a')]=function(_0x9d2377){var _0x23fde7=[];_0x9d2377[_0x8b13('0x7')](/[ ,]+/)[_0x8b13('0x2b')](function(_0x44bce2){_0x44bce2=_0x44bce2[_0x8b13('0x2c')](/([^:]")"+/g,'$1');_0x44bce2='+'+_0x44bce2+'*';var _0x5751db=/[ `!@#$%^&*()_\-?~]/;if(_0x44bce2[_0x8b13('0x28')](_0x5751db))_0x44bce2='\x22'+_0x44bce2+'\x22';_0x23fde7[_0x8b13('0x2d')](_0x44bce2);});return _0x23fde7[_0x8b13('0x2e')]('\x20');};exports[_0x8b13('0x2f')]=function(_0x51a334,_0x4f7d91,_0xb7771d){var _0x5cedea={},_0x5663fa={};if(_0x4f7d91[_0x8b13('0x30')]['$id']){_0x4f7d91[_0x8b13('0x30')]['id']=_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x31')];delete _0x4f7d91[_0x8b13('0x30')][_0x8b13('0x31')];}_0x5cedea[_0x8b13('0x32')]=_[_0x8b13('0x19')](_0x51a334,_0x8b13('0x14'));_0x5cedea[_0x8b13('0x30')]=_[_0x8b13('0x4')](_0x4f7d91['query']);_0x5cedea[_0x8b13('0x33')]=_[_0x8b13('0x34')](_0x5cedea[_0x8b13('0x32')],_0x5cedea[_0x8b13('0x30')]);_0x5663fa[_0x8b13('0x35')]=_[_0x8b13('0x34')](_0x5cedea[_0x8b13('0x32')],this[_0x8b13('0x6')](_0x4f7d91['query'][_0x8b13('0x6')]));_0x5663fa['attributes']=_0x5663fa[_0x8b13('0x35')][_0x8b13('0x22')]?_0x5663fa[_0x8b13('0x35')]:_0x5cedea[_0x8b13('0x32')];if(!_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x26')]('nolimit')){_0x5663fa['limit']=this[_0x8b13('0x36')](_0x4f7d91['query'][_0x8b13('0x36')]);_0x5663fa['offset']=this[_0x8b13('0x17')](_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x17')]);}_0x5663fa[_0x8b13('0x37')]=this[_0x8b13('0x18')](_0x4f7d91['query']['sort']);_0x5663fa[_0x8b13('0x38')]=this['filters'](_[_0x8b13('0x39')](_0x4f7d91[_0x8b13('0x30')],_0x5cedea['filters']),_0x51a334);if(_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x3a')]){var _0x35c1d6=_0x51a334;var _0x81b931=_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x3a')];if(typeof _0x81b931===_0x8b13('0x3b')){_0x35c1d6=_['filter'](_0x51a334,function(_0x5a3f5c){return _['includes'](_0x81b931[_0x8b13('0x3c')],_0x5a3f5c[_0x8b13('0x14')]);});_0x81b931=_0x81b931[_0x8b13('0x3d')];}_0x5663fa[_0x8b13('0x38')]=_[_0x8b13('0x3e')](_0x5663fa[_0x8b13('0x38')],{'$or':_['map'](_0x35c1d6,function(_0x4342db){if(_0x4342db['type']!==_0x8b13('0x3f')){if(_0xb7771d){return sequelize['where'](sequelize['fn'](_0x8b13('0x40'),sequelize[_0x8b13('0x1b')](_0x4342db[_0x8b13('0x14')])),{'$like':sequelize['fn'](_0x8b13('0x40'),'%'+_0x4f7d91[_0x8b13('0x30')][_0x8b13('0x3a')]+'%')});}else{var _0x2009a1={};_0x2009a1[_0x4342db['name']]={'$like':'%'+_0x4f7d91['query']['filter']+'%'};return _0x2009a1;}}})});}_0x5663fa=_[_0x8b13('0x3e')]({},_0x5663fa,_0x4f7d91[_0x8b13('0x41')]);return _0x5663fa;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index bbd89bf..d72fe8b 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x33358a,_0x410ec6){var _0x4e9192=function(_0x10c78d){while(--_0x10c78d){_0x33358a['push'](_0x33358a['shift']());}};_0x4e9192(++_0x410ec6);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 +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(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index de52f5b..c279723 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 _0x7caf=['IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','createHash','md5','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','substring','lodash','crypto','bimedia-machine-uuid','../environment','orderBy','keys','length','filter','family'];(function(_0x3f8a42,_0x47c65f){var _0x55a9a9=function(_0xebed01){while(--_0xebed01){_0x3f8a42['push'](_0x3f8a42['shift']());}};_0x55a9a9(++_0x47c65f);}(_0x7caf,0x120));var _0xf7ca=function(_0x5a81f4,_0x3e6613){_0x5a81f4=_0x5a81f4-0x0;var _0x2248ea=_0x7caf[_0x5a81f4];return _0x2248ea;};'use strict';var _=require(_0xf7ca('0x0'));var os=require('os');var crypto=require(_0xf7ca('0x1'));var machine=require(_0xf7ca('0x2'));var exec=require('child_process')['execSync'];var config=require(_0xf7ca('0x3'));function getInterfaces(){var _0x2a8e85=[];var _0x127ebe=os['networkInterfaces']();var _0x3c9cea=_[_0xf7ca('0x4')](_[_0xf7ca('0x5')](_0x127ebe));for(var _0x2143bd=0x0;_0x2143bd<_0x3c9cea[_0xf7ca('0x6')];_0x2143bd++){var _0x131f8b=_0x127ebe[_0x3c9cea[_0x2143bd]][_0xf7ca('0x7')](function(_0x56a8e2){return _0x56a8e2[_0xf7ca('0x8')]===_0xf7ca('0x9')&&_0x56a8e2[_0xf7ca('0xa')]===![];});_0x2a8e85=_0x2a8e85['concat'](_0x131f8b);}return _0x2a8e85;}function getFirstInterface(){var _0x3842be=_[_0xf7ca('0xb')](getInterfaces());return{'macAddress':_0x3842be&&_0x3842be['mac']?_0x3842be[_0xf7ca('0xc')]:_0xf7ca('0xd'),'ipAddress':_0x3842be&&_0x3842be[_0xf7ca('0xe')]?_0x3842be[_0xf7ca('0xe')]:_0xf7ca('0xf')};}exports[_0xf7ca('0x10')]=getFirstInterface;function getCPUhash(){var _0x3a30a3=_[_0xf7ca('0x4')](os['cpus']()[_0xf7ca('0x11')](function(_0x265b0a){return _0x265b0a['model'];}))[_0xf7ca('0x12')](':');return crypto[_0xf7ca('0x13')](_0xf7ca('0x14'))[_0xf7ca('0x15')](_0x3a30a3)[_0xf7ca('0x16')](_0xf7ca('0x17'));}exports[_0xf7ca('0x18')]=function(){var _0x2ea0fc=os['platform']();var _0x2a55ab=/[0-9a-f-]{36}/;if(config[_0xf7ca('0x19')]&&_0x2a55ab[_0xf7ca('0x1a')](config[_0xf7ca('0x19')])){return config['licenseToken'];}else if(_0x2ea0fc===_0xf7ca('0x1b')){return exec(_0xf7ca('0x1c'),{'encoding':'utf8'})[_0xf7ca('0x1d')]('\x0d\x0a','');}else{var _0x568a59=getFirstInterface();var _0x369ebc=getCPUhash();var _0x223a2e=_0x369ebc+'|'+os[_0xf7ca('0x1e')]()+'|'+_0x568a59[_0xf7ca('0x1f')]+'|'+_0x568a59['ipAddress'];var _0x137d1c=crypto['createHash'](_0xf7ca('0x14'))[_0xf7ca('0x15')](_0x223a2e)[_0xf7ca('0x16')](_0xf7ca('0x17'));return _0x137d1c['substring'](0x0,0x8)+'-'+_0x137d1c[_0xf7ca('0x20')](0x8,0xc)+'-'+_0x137d1c[_0xf7ca('0x20')](0xc,0x10)+'-'+_0x137d1c[_0xf7ca('0x20')](0x10,0x14)+'-'+_0x137d1c[_0xf7ca('0x20')](0x14);}}; \ No newline at end of file +var _0x4702=['execSync','../environment','networkInterfaces','keys','family','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','md5','digest','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x4c1d87,_0x81262a){var _0x129ad0=function(_0x495785){while(--_0x495785){_0x4c1d87['push'](_0x4c1d87['shift']());}};_0x129ad0(++_0x81262a);}(_0x4702,0xfd));var _0x2470=function(_0x371ee1,_0x5b2693){_0x371ee1=_0x371ee1-0x0;var _0x36df8a=_0x4702[_0x371ee1];return _0x36df8a;};'use strict';var _=require(_0x2470('0x0'));var os=require('os');var crypto=require(_0x2470('0x1'));var machine=require(_0x2470('0x2'));var exec=require('child_process')[_0x2470('0x3')];var config=require(_0x2470('0x4'));function getInterfaces(){var _0x1a2123=[];var _0x5e7dab=os[_0x2470('0x5')]();var _0x5c79da=_['orderBy'](_[_0x2470('0x6')](_0x5e7dab));for(var _0x44bd74=0x0;_0x44bd74<_0x5c79da['length'];_0x44bd74++){var _0x2c55fb=_0x5e7dab[_0x5c79da[_0x44bd74]]['filter'](function(_0x5cd962){return _0x5cd962[_0x2470('0x7')]==='IPv4'&&_0x5cd962[_0x2470('0x8')]===![];});_0x1a2123=_0x1a2123['concat'](_0x2c55fb);}return _0x1a2123;}function getFirstInterface(){var _0x4f5099=_['head'](getInterfaces());return{'macAddress':_0x4f5099&&_0x4f5099[_0x2470('0x9')]?_0x4f5099[_0x2470('0x9')]:_0x2470('0xa'),'ipAddress':_0x4f5099&&_0x4f5099['address']?_0x4f5099[_0x2470('0xb')]:_0x2470('0xc')};}exports[_0x2470('0xd')]=getFirstInterface;function getCPUhash(){var _0xf26b4e=_['orderBy'](os[_0x2470('0xe')]()[_0x2470('0xf')](function(_0xfd33b0){return _0xfd33b0[_0x2470('0x10')];}))[_0x2470('0x11')](':');return crypto[_0x2470('0x12')]('md5')[_0x2470('0x13')](_0xf26b4e)['digest']('hex');}exports[_0x2470('0x14')]=function(){var _0xfcb61f=os[_0x2470('0x15')]();var _0x2b27a7=/[0-9a-f-]{36}/;if(config[_0x2470('0x16')]&&_0x2b27a7[_0x2470('0x17')](config[_0x2470('0x16')])){return config[_0x2470('0x16')];}else if(_0xfcb61f===_0x2470('0x18')){return exec(_0x2470('0x19'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x435fcd=getFirstInterface();var _0x2f2354=getCPUhash();var _0x2e84d1=_0x2f2354+'|'+os[_0x2470('0x1a')]()+'|'+_0x435fcd[_0x2470('0x1b')]+'|'+_0x435fcd[_0x2470('0x1c')];var _0x6c8670=crypto[_0x2470('0x12')](_0x2470('0x1d'))['update'](_0x2e84d1)[_0x2470('0x1e')]('hex');return _0x6c8670[_0x2470('0x1f')](0x0,0x8)+'-'+_0x6c8670[_0x2470('0x1f')](0x8,0xc)+'-'+_0x6c8670[_0x2470('0x1f')](0xc,0x10)+'-'+_0x6c8670[_0x2470('0x1f')](0x10,0x14)+'-'+_0x6c8670[_0x2470('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index cdade3a..b51496a 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 _0xde68=['version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data2','data1','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo'];(function(_0x1ede3e,_0x441c15){var _0x311f28=function(_0x443e85){while(--_0x443e85){_0x1ede3e['push'](_0x1ede3e['shift']());}};_0x311f28(++_0x441c15);}(_0xde68,0x1b3));var _0x8de6=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xde68[_0x2064e5];return _0x21a233;};'use strict';var util=require(_0x8de6('0x0'));var moment=require(_0x8de6('0x1'));var rp=require(_0x8de6('0x2'));var BPromise=require(_0x8de6('0x3'));var pkginfo=require(_0x8de6('0x4'))(module,_0x8de6('0x5'));var db=require(_0x8de6('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x8de6('0x7'));var logger=require(_0x8de6('0x8'))(_0x8de6('0x9'));var HOST=_0x8de6('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3e28a5){return new BPromise(function(_0xf8edc,_0x5a4630){var _0x385305=util['format'](_0x8de6('0xb'),HOST,_0x3e28a5,module[_0x8de6('0xc')][_0x8de6('0x5')]);if(oldToken){_0x385305=util[_0x8de6('0xd')](_0x8de6('0xe'),HOST,_0x3e28a5,module[_0x8de6('0xc')][_0x8de6('0x5')],oldToken);}var _0xdda682={'uri':_0x385305,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xdda682)[_0x8de6('0xf')](function(_0x5cf3a0){_0xf8edc(_0x5cf3a0);})[_0x8de6('0x10')](function(_0x7ef3b0){_0x5a4630(_0x7ef3b0);});});}function manageLicense(_0x333dc3,_0x17c43){var _0x1c4d51=_0x17c43[_0x8de6('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x1c4d51['data1']!==_0x333dc3&&!_0x1c4d51[_0x8de6('0x12')]){oldToken=_0x1c4d51[_0x8de6('0x13')];}httpRequest(_0x333dc3)[_0x8de6('0xf')](function(_0x21f68b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x21f68b['active']){isOldTokenSent=![];if(!_0x1c4d51[_0x8de6('0x9')]&&_0x1c4d51[_0x8de6('0x9')]!=_0x21f68b[_0x8de6('0x9')]||_0x1c4d51[_0x8de6('0x9')]&&_0x1c4d51['data2']){logger[_0x8de6('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x1c4d51[_0x8de6('0x9')]&&!_0x1c4d51[_0x8de6('0x12')]&&_0x1c4d51[_0x8de6('0x9')]!=_0x21f68b[_0x8de6('0x9')]){logger[_0x8de6('0x14')](_0x8de6('0x15'));}if(_0x1c4d51[_0x8de6('0x9')]&&!_0x1c4d51['data2']&&_0x1c4d51['license']==_0x21f68b[_0x8de6('0x9')]){return _0x17c43;}return _0x17c43[_0x8de6('0x16')]({'data1':_0x333dc3,'data2':null,'license':_0x21f68b[_0x8de6('0x9')]});}else{if(_0x21f68b['license']||_0x1c4d51[_0x8de6('0x9')]){if(!_0x1c4d51[_0x8de6('0x12')]){if(_0x1c4d51['data1']==_0x333dc3){GRAY_PERIOD_REASON=_0x8de6('0x17');logger[_0x8de6('0x14')](_0x8de6('0x18'));}else{GRAY_PERIOD_REASON=_0x8de6('0x19');logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1c4d51['data1'],_0x333dc3);}logger['info'](_0x8de6('0x1a'),GRAY_PERIOD_REASON[_0x8de6('0x1b')](),moment()[_0x8de6('0xd')]('YYYY-MM-DD\x20HH:mm'));return _0x17c43['update']({'data2':encryptor[_0x8de6('0x1c')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x8de6('0x1d')](encryptor[_0x8de6('0x1e')](_0x1c4d51[_0x8de6('0x12')]),_0x8de6('0x1f'))>DAYS){logger[_0x8de6('0x14')](_0x8de6('0x20'),moment()['format'](_0x8de6('0x21')));isOldTokenSent=![];return _0x17c43[_0x8de6('0x16')]({'data1':_0x333dc3,'data2':null,'license':null});}}}else{if(_0x1c4d51[_0x8de6('0x13')]!=_0x333dc3){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1c4d51[_0x8de6('0x13')],_0x333dc3);return _0x17c43[_0x8de6('0x16')]({'data1':_0x333dc3,'data2':null,'license':null});}}}return _0x17c43;})[_0x8de6('0xf')](function(_0xa62453){_0x17c43=_0xa62453;})[_0x8de6('0x10')](function(_0x5035cf){logger[_0x8de6('0x22')](_0x5035cf[_0x8de6('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x8de6('0x24')](),_0x17c43);},TIME);});}function defaultLicense(){var _0x502a84=hardware[_0x8de6('0x24')]();if(_0x502a84){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x502a84}})[_0x8de6('0x25')](function(_0x5a4533,_0x168f55){logger['info'](_0x8de6('0x26'),_0x502a84);manageLicense(_0x502a84,_0x5a4533);})['catch'](function(_0x42a1b2){logger[_0x8de6('0x22')](_0x42a1b2[_0x8de6('0x23')]);});}}exports[_0x8de6('0x27')]=defaultLicense; \ No newline at end of file +var _0x3eab=['message','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','catch','error'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x3eab,0xce));var _0xb3ea=function(_0x53be3b,_0x11126c){_0x53be3b=_0x53be3b-0x0;var _0x4950b5=_0x3eab[_0x53be3b];return _0x4950b5;};'use strict';var util=require(_0xb3ea('0x0'));var moment=require('moment');var rp=require(_0xb3ea('0x1'));var BPromise=require(_0xb3ea('0x2'));var pkginfo=require(_0xb3ea('0x3'))(module,'version');var db=require(_0xb3ea('0x4'))['db'];var encryptor=require(_0xb3ea('0x5'));var hardware=require(_0xb3ea('0x6'));var logger=require(_0xb3ea('0x7'))(_0xb3ea('0x8'));var HOST=_0xb3ea('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x36e840){return new BPromise(function(_0x575e16,_0xd9fc1){var _0x5012ad=util[_0xb3ea('0xa')](_0xb3ea('0xb'),HOST,_0x36e840,module[_0xb3ea('0xc')][_0xb3ea('0xd')]);if(oldToken){_0x5012ad=util[_0xb3ea('0xa')](_0xb3ea('0xe'),HOST,_0x36e840,module[_0xb3ea('0xc')][_0xb3ea('0xd')],oldToken);}var _0x51e261={'uri':_0x5012ad,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x51e261)[_0xb3ea('0xf')](function(_0x394e9d){_0x575e16(_0x394e9d);})['catch'](function(_0x2b0a95){_0xd9fc1(_0x2b0a95);});});}function manageLicense(_0x618307,_0x100046){var _0x360925=_0x100046[_0xb3ea('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x360925['data1']!==_0x618307&&!_0x360925[_0xb3ea('0x11')]){oldToken=_0x360925['data1'];}httpRequest(_0x618307)['then'](function(_0x284101){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x284101['active']){isOldTokenSent=![];if(!_0x360925[_0xb3ea('0x8')]&&_0x360925['license']!=_0x284101[_0xb3ea('0x8')]||_0x360925[_0xb3ea('0x8')]&&_0x360925['data2']){logger[_0xb3ea('0x12')](_0xb3ea('0x13'));}if(_0x360925[_0xb3ea('0x8')]&&!_0x360925[_0xb3ea('0x11')]&&_0x360925[_0xb3ea('0x8')]!=_0x284101['license']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x360925[_0xb3ea('0x8')]&&!_0x360925['data2']&&_0x360925[_0xb3ea('0x8')]==_0x284101['license']){return _0x100046;}return _0x100046[_0xb3ea('0x14')]({'data1':_0x618307,'data2':null,'license':_0x284101[_0xb3ea('0x8')]});}else{if(_0x284101[_0xb3ea('0x8')]||_0x360925[_0xb3ea('0x8')]){if(!_0x360925[_0xb3ea('0x11')]){if(_0x360925['data1']==_0x618307){GRAY_PERIOD_REASON=_0xb3ea('0x15');logger[_0xb3ea('0x12')](_0xb3ea('0x16'));}else{GRAY_PERIOD_REASON=_0xb3ea('0x17');logger[_0xb3ea('0x12')](_0xb3ea('0x18'),_0x360925[_0xb3ea('0x19')],_0x618307);}logger[_0xb3ea('0x12')](_0xb3ea('0x1a'),GRAY_PERIOD_REASON[_0xb3ea('0x1b')](),moment()['format'](_0xb3ea('0x1c')));return _0x100046[_0xb3ea('0x14')]({'data2':encryptor['encryptString'](moment()[_0xb3ea('0xa')](_0xb3ea('0x1c')))});}else{if(moment()[_0xb3ea('0x1d')](encryptor[_0xb3ea('0x1e')](_0x360925[_0xb3ea('0x11')]),_0xb3ea('0x1f'))>DAYS){logger[_0xb3ea('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0xb3ea('0xa')](_0xb3ea('0x1c')));isOldTokenSent=![];return _0x100046['update']({'data1':_0x618307,'data2':null,'license':null});}}}else{if(_0x360925[_0xb3ea('0x19')]!=_0x618307){logger[_0xb3ea('0x12')](_0xb3ea('0x18'),_0x360925[_0xb3ea('0x19')],_0x618307);return _0x100046[_0xb3ea('0x14')]({'data1':_0x618307,'data2':null,'license':null});}}}return _0x100046;})[_0xb3ea('0xf')](function(_0x457365){_0x100046=_0x457365;})[_0xb3ea('0x20')](function(_0x5131cd){logger[_0xb3ea('0x21')](_0x5131cd[_0xb3ea('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x100046);},TIME);});}function defaultLicense(){var _0x1fe58a=hardware[_0xb3ea('0x23')]();if(_0x1fe58a){return db[_0xb3ea('0x24')][_0xb3ea('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x1fe58a}})['spread'](function(_0x3e79ed,_0x522b36){logger['info'](_0xb3ea('0x26'),_0x1fe58a);manageLicense(_0x1fe58a,_0x3e79ed);})[_0xb3ea('0x20')](function(_0x313959){logger[_0xb3ea('0x21')](_0x313959['message']);});}}exports[_0xb3ea('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index efd18b2..f219b0c 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 _0x32fa=['exports','util','lodash','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','data1','license','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','uuid','machineUuid','decryptString','gray','deadline','days','grayReason','disabled','message','findAll','sequelize','COUNT','col','count','role','admin','forEach','user','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0x36a4ab,_0xf246eb){var _0x1adbd0=function(_0x3d778a){while(--_0x3d778a){_0x36a4ab['push'](_0x36a4ab['shift']());}};_0x1adbd0(++_0xf246eb);}(_0x32fa,0x13c));var _0xa32f=function(_0x1083ee,_0x47bb2d){_0x1083ee=_0x1083ee-0x0;var _0x38e73b=_0x32fa[_0x1083ee];return _0x38e73b;};'use strict';var util=require(_0xa32f('0x0'));var _=require(_0xa32f('0x1'));var moment=require('moment');var BPromise=require(_0xa32f('0x2'));var hardware=require(_0xa32f('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0xa32f('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa32f('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xa32f('0x6'),'machineUuid':hardware[_0xa32f('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa32f('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xa32f('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x60a266){return new BPromise(function(_0x38cb49,_0x19678c){return db[_0xa32f('0x9')]['find'](_[_0xa32f('0xa')](_0x60a266,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2146fa){return checkLicense(_0x2146fa,null);})[_0xa32f('0xb')](function(_0x4d056c){_0x38cb49(_0x4d056c);return;})[_0xa32f('0xc')](function(_0x27fb2b){_0x19678c(_0x27fb2b);});});}function checkLicense(_0x470f1f,_0x3d811f){if(!_0x470f1f){demoLicense['uuid']=_0x470f1f[_0xa32f('0xd')];return demoLicense;}try{var _0x4a05f4=_0x3d811f||_0x470f1f[_0xa32f('0xe')];if(_['isEmpty'](_0x4a05f4)){throw new Error(_0xa32f('0xf'));}var _0x3e2421=_0x470f1f[_0xa32f('0xd')];var _0x18ab8c=_0x470f1f[_0xa32f('0x10')];var _0x1df2ee=_0x3e2421[_0xa32f('0x11')]('-')[0x4];var _0x5f2777=_0x3e2421[_0xa32f('0x11')]('-')[0x0];var _0x56df99=encryptor['decryptString'](_0x4a05f4,util[_0xa32f('0x12')](_0xa32f('0x13'),_0x1df2ee,_0x3e2421,_0x5f2777));var _0x381f18=JSON[_0xa32f('0x14')](_0x56df99);_0x381f18['demo']=![];_0x381f18[_0xa32f('0x15')]=_0x3e2421;_0x381f18[_0xa32f('0x16')]=hardware[_0xa32f('0x7')]();if(_0x18ab8c){var _0x2e4287=encryptor[_0xa32f('0x17')](_0x18ab8c);_0x381f18[_0xa32f('0x18')]=_0x2e4287;_0x381f18[_0xa32f('0x19')]=moment(_0x2e4287)['add'](0x7,_0xa32f('0x1a'))[_0xa32f('0x12')]();_0x381f18[_0xa32f('0x1b')]=_0x381f18['uuid']!=_0x381f18[_0xa32f('0x16')]?'changed':_0xa32f('0x1c');}return _0x381f18;}catch(_0x39ae3f){breakingLicense['uuid']=_0x470f1f['data1'];breakingLicense['message']=_0x39ae3f[_0xa32f('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1f40b3,_0x469374){getLicense()['then'](function(_0x4ac104){return db['User'][_0xa32f('0x1e')]({'attributes':['role',[db[_0xa32f('0x1f')]['fn'](_0xa32f('0x20'),db['sequelize'][_0xa32f('0x21')]('role')),_0xa32f('0x22')]],'group':_0xa32f('0x23'),'where':{'role':{'$or':[_0xa32f('0x24'),'user','telephone']}},'raw':!![]})[_0xa32f('0xb')](function(_0x7a4917){var _0x4e4219={'user':_0x4ac104['users']||0x0,'telephone':_0x4ac104['telephones']||0x0};_0x7a4917[_0xa32f('0x25')](function(_0x3123d1){var _0xa88502=_0x3123d1[_0xa32f('0x23')]===_0xa32f('0x24')?_0xa32f('0x26'):_0x3123d1['role'];_0x4e4219[_0xa88502]-=_0x3123d1[_0xa32f('0x22')];if(_0x4e4219[_0xa88502]<0x0)_0x4e4219[_0xa88502]=0x0;});_0x1f40b3(_0x4e4219);return;});})[_0xa32f('0xc')](function(_0x6e73a1){_0x469374(_0x6e73a1);});});}function checkUserLimits(_0x12f20e){return new BPromise(function(_0x346b29,_0x33bcfc){getLimits()['then'](function(_0x1a874d){var _0x569c4b=_[_0xa32f('0x27')](_[_0xa32f('0x28')](_0x12f20e,_0xa32f('0x23')),[_0xa32f('0x24'),_0xa32f('0x26'),'telephone']);var _0x1e4578=(_0x569c4b[_0xa32f('0x24')]||0x0)+(_0x569c4b[_0xa32f('0x26')]||0x0);var _0x427f5d=_0x569c4b[_0xa32f('0x29')]||0x0;if(_0x1e4578>_0x1a874d[_0xa32f('0x26')])return _0x33bcfc(_0xa32f('0x2a'));if(_0x427f5d>_0x1a874d[_0xa32f('0x29')])return _0x33bcfc(_0xa32f('0x2b'));return _0x346b29();})[_0xa32f('0xc')](function(_0x2e516a){_0x33bcfc(_0x2e516a);});});}module[_0xa32f('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x06d4=['then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','deadline','add','grayReason','changed','disabled','message','User','role','sequelize','COUNT','user','users','telephones','forEach','pick','admin','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x06d4,0x189));var _0x406d=function(_0x1325fc,_0x1cdee4){_0x1325fc=_0x1325fc-0x0;var _0x105580=_0x06d4[_0x1325fc];return _0x105580;};'use strict';var util=require(_0x406d('0x0'));var _=require(_0x406d('0x1'));var moment=require(_0x406d('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x406d('0x3'));var db=require(_0x406d('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x406d('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x406d('0x6'),'machineUuid':hardware[_0x406d('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x406d('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x406d('0x8'),'machineUuid':hardware[_0x406d('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x222924){return new BPromise(function(_0x567e0a,_0x2915f6){return db[_0x406d('0x9')][_0x406d('0xa')](_[_0x406d('0xb')](_0x222924,{'raw':!![],'where':{'id':0x1}}))[_0x406d('0xc')](function(_0x3500cc){return checkLicense(_0x3500cc,null);})['then'](function(_0x37d9c4){_0x567e0a(_0x37d9c4);return;})[_0x406d('0xd')](function(_0x301379){_0x2915f6(_0x301379);});});}function checkLicense(_0x17b14e,_0x3ccd49){if(!_0x17b14e){demoLicense[_0x406d('0xe')]=_0x17b14e[_0x406d('0xf')];return demoLicense;}try{var _0x397e6f=_0x3ccd49||_0x17b14e[_0x406d('0x10')];if(_[_0x406d('0x11')](_0x397e6f)){throw new Error(_0x406d('0x12'));}var _0x3ae721=_0x17b14e[_0x406d('0xf')];var _0x2a012a=_0x17b14e[_0x406d('0x13')];var _0x4a9ba7=_0x3ae721[_0x406d('0x14')]('-')[0x4];var _0x135070=_0x3ae721[_0x406d('0x14')]('-')[0x0];var _0x3f005f=encryptor[_0x406d('0x15')](_0x397e6f,util[_0x406d('0x16')](_0x406d('0x17'),_0x4a9ba7,_0x3ae721,_0x135070));var _0x1d2158=JSON[_0x406d('0x18')](_0x3f005f);_0x1d2158['demo']=![];_0x1d2158[_0x406d('0xe')]=_0x3ae721;_0x1d2158['machineUuid']=hardware[_0x406d('0x7')]();if(_0x2a012a){var _0x4ab031=encryptor[_0x406d('0x15')](_0x2a012a);_0x1d2158['gray']=_0x4ab031;_0x1d2158[_0x406d('0x19')]=moment(_0x4ab031)[_0x406d('0x1a')](0x7,'days')[_0x406d('0x16')]();_0x1d2158[_0x406d('0x1b')]=_0x1d2158['uuid']!=_0x1d2158['machineUuid']?_0x406d('0x1c'):_0x406d('0x1d');}return _0x1d2158;}catch(_0x299a66){breakingLicense[_0x406d('0xe')]=_0x17b14e[_0x406d('0xf')];breakingLicense[_0x406d('0x1e')]=_0x299a66[_0x406d('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x54bd81,_0x5ca87f){getLicense()[_0x406d('0xc')](function(_0x4ede42){return db[_0x406d('0x1f')]['findAll']({'attributes':[_0x406d('0x20'),[db[_0x406d('0x21')]['fn'](_0x406d('0x22'),db[_0x406d('0x21')]['col'](_0x406d('0x20'))),'count']],'group':'role','where':{'role':{'$or':['admin',_0x406d('0x23'),'telephone']}},'raw':!![]})[_0x406d('0xc')](function(_0x181fba){var _0x58aade={'user':_0x4ede42[_0x406d('0x24')]||0x0,'telephone':_0x4ede42[_0x406d('0x25')]||0x0};_0x181fba[_0x406d('0x26')](function(_0x1a5687){var _0x5e5f9a=_0x1a5687[_0x406d('0x20')]==='admin'?'user':_0x1a5687[_0x406d('0x20')];_0x58aade[_0x5e5f9a]-=_0x1a5687['count'];if(_0x58aade[_0x5e5f9a]<0x0)_0x58aade[_0x5e5f9a]=0x0;});_0x54bd81(_0x58aade);return;});})[_0x406d('0xd')](function(_0x3c6f9b){_0x5ca87f(_0x3c6f9b);});});}function checkUserLimits(_0x38f81b){return new BPromise(function(_0x385273,_0x3e72d3){getLimits()[_0x406d('0xc')](function(_0x59bfb9){var _0x2f423a=_[_0x406d('0x27')](_['countBy'](_0x38f81b,_0x406d('0x20')),[_0x406d('0x28'),_0x406d('0x23'),'telephone']);var _0x5a7f50=(_0x2f423a[_0x406d('0x28')]||0x0)+(_0x2f423a[_0x406d('0x23')]||0x0);var _0x3d9720=_0x2f423a[_0x406d('0x29')]||0x0;if(_0x5a7f50>_0x59bfb9[_0x406d('0x23')])return _0x3e72d3(_0x406d('0x2a'));if(_0x3d9720>_0x59bfb9['telephone'])return _0x3e72d3(_0x406d('0x2b'));return _0x385273();})[_0x406d('0xd')](function(_0x5d2aa8){_0x3e72d3(_0x5d2aa8);});});}module[_0x406d('0x2c')]={'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 393e332..9656374 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 _0x0abf=['app-id','exports','myappanuglar-secret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';module[_0xf0ab('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xf0ab('0x1'),'GOOGLE_ID':_0xf0ab('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x8e3f=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x8fe957,_0x261fbc){var _0x17290f=function(_0x332c54){while(--_0x332c54){_0x8fe957['push'](_0x8fe957['shift']());}};_0x17290f(++_0x261fbc);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';module[_0xf8e3('0x0')]={'DOMAIN':_0xf8e3('0x1'),'SESSION_SECRET':_0xf8e3('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xf8e3('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 06fd3ea..1065de0 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39b0=['fileLogger'];(function(_0x36afbb,_0x4cd4d2){var _0x301baa=function(_0x1856be){while(--_0x1856be){_0x36afbb['push'](_0x36afbb['shift']());}};_0x301baa(++_0x4cd4d2);}(_0x39b0,0x129));var _0x039b=function(_0x53a166,_0x39b8ca){_0x53a166=_0x53a166-0x0;var _0x49030d=_0x39b0[_0x53a166];return _0x49030d;};'use strict';var fileLogger=require('../utils/loggers')[_0x039b('0x0')];module['exports']=fileLogger; \ No newline at end of file +var _0x7e66=['../utils/loggers','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7e66,0x166));var _0x67e6=function(_0x8bacb3,_0xab62ae){_0x8bacb3=_0x8bacb3-0x0;var _0x32521e=_0x7e66[_0x8bacb3];return _0x32521e;};'use strict';var fileLogger=require(_0x67e6('0x0'))['fileLogger'];module[_0x67e6('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 3d5fc16..85d5234 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 _0x9a82=['../../services/agi/index.js','email','routing','../../services/routing/index.js','../../services/xdr/index.js','path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x59c0a9,_0x4a6f0d){var _0x3d1db6=function(_0x38621f){while(--_0x38621f){_0x59c0a9['push'](_0x59c0a9['shift']());}};_0x3d1db6(++_0x4a6f0d);}(_0x9a82,0x89));var _0x29a8=function(_0x25e48a,_0x4abecd){_0x25e48a=_0x25e48a-0x0;var _0x24454a=_0x9a82[_0x25e48a];return _0x24454a;};'use strict';var path=require(_0x29a8('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x29a8('0x1')](__dirname,_0x29a8('0x2'))},{'name':_0x29a8('0x3'),'script':path[_0x29a8('0x1')](__dirname,_0x29a8('0x4'))},{'name':_0x29a8('0x5'),'script':path[_0x29a8('0x1')](__dirname,_0x29a8('0x6'))},{'name':_0x29a8('0x7'),'script':path[_0x29a8('0x1')](__dirname,'../../services/email/index.js')},{'name':_0x29a8('0x8'),'script':path[_0x29a8('0x1')](__dirname,_0x29a8('0x9'))},{'name':'xdr','script':path[_0x29a8('0x1')](__dirname,_0x29a8('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0x2f51=['exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/xdr/index.js'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2f51,0x76));var _0x12f5=function(_0x4ddc7e,_0xcb9b8){_0x4ddc7e=_0x4ddc7e-0x0;var _0xfbf0ec=_0x2f51[_0x4ddc7e];return _0xfbf0ec;};'use strict';var path=require(_0x12f5('0x0'));var os=require('os');var config={'apps':[{'name':_0x12f5('0x1'),'script':path[_0x12f5('0x2')](__dirname,_0x12f5('0x3'))},{'name':_0x12f5('0x4'),'script':path['join'](__dirname,_0x12f5('0x5'))},{'name':_0x12f5('0x6'),'script':path[_0x12f5('0x2')](__dirname,_0x12f5('0x7'))},{'name':_0x12f5('0x8'),'script':path[_0x12f5('0x2')](__dirname,_0x12f5('0x9'))},{'name':_0x12f5('0xa'),'script':path[_0x12f5('0x2')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,_0x12f5('0xb'))}]};module[_0x12f5('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 983cf28..7012b21 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 _0xdf9a=['disconnect','stop','restart','list','delete','dump','pm2','bluebird','./config','connect','then','start'];(function(_0xfbbfec,_0xe79de1){var _0x34bf3c=function(_0x6826aa){while(--_0x6826aa){_0xfbbfec['push'](_0xfbbfec['shift']());}};_0x34bf3c(++_0xe79de1);}(_0xdf9a,0xae));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0xadf9('0x0'));var BPromise=require(_0xadf9('0x1'));var config=require(_0xadf9('0x2'));function connect(){return new BPromise(function(_0x3451e3,_0x16592c){return pm2[_0xadf9('0x3')](function(_0x583ee8){if(_0x583ee8){return _0x16592c(_0x583ee8);}return _0x3451e3('connected');});});};exports['start']=function(_0x164b81){return connect()[_0xadf9('0x4')](function(){return new BPromise(function(_0x3bafc4,_0x3533ab){return pm2[_0xadf9('0x5')](_0x164b81,function(_0x34b35f,_0x22bda3){if(_0x34b35f){return _0x3533ab(_0x34b35f);}pm2[_0xadf9('0x6')]();return _0x3bafc4(_0x22bda3);});});});};exports[_0xadf9('0x7')]=function(_0xe10070){return connect()[_0xadf9('0x4')](function(){return new BPromise(function(_0x2c0f7a,_0x1f9832){return pm2[_0xadf9('0x7')](_0xe10070,function(_0x26e999,_0x5ab45b){if(_0x26e999){return _0x1f9832(_0x26e999);}pm2['disconnect']();return _0x2c0f7a(_0x5ab45b);});});});};exports[_0xadf9('0x8')]=function(_0x59e2b3){return connect()['then'](function(){return new BPromise(function(_0x5eba4f,_0x1f0f07){return pm2[_0xadf9('0x8')](_0x59e2b3,function(_0x3fabd7,_0x5f21f4){if(_0x3fabd7){return _0x1f0f07(_0x3fabd7);}pm2[_0xadf9('0x6')]();return _0x5eba4f(_0x5f21f4);});});});};exports[_0xadf9('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x554aaf,_0x4d3612){return pm2[_0xadf9('0x9')](function(_0x54ae58,_0x42984b){if(_0x54ae58){return _0x4d3612(_0x54ae58);}pm2['disconnect']();return _0x554aaf(_0x42984b);});});});};exports['describe']=function(_0x3d107c){return connect()['then'](function(){return new BPromise(function(_0x402028,_0x16f339){return pm2['describe'](_0x3d107c,function(_0x2cf383,_0xb8f8a9){if(_0x2cf383){return _0x16f339(_0x2cf383);}pm2[_0xadf9('0x6')]();return _0x402028(_0xb8f8a9);});});});};exports[_0xadf9('0xa')]=function(_0x3e54cd){return connect()['then'](function(){return new BPromise(function(_0x340915,_0x497ef5){return pm2['delete'](_0x3e54cd,function(_0x57bad5,_0xf5309e){if(_0x57bad5){return _0x497ef5(_0x57bad5);}pm2['disconnect']();return _0x340915(_0xf5309e);});});});};exports[_0xadf9('0xb')]=function(){return connect()[_0xadf9('0x4')](function(){return new BPromise(function(_0x2b4dd8,_0x2e1f27){return pm2['dump'](function(_0x5083e6){if(_0x5083e6){return _0x2e1f27(_0x5083e6);}return _0x2b4dd8('saved');});});});}; \ No newline at end of file +var _0x4d3d=['bluebird','./config','connect','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2'];(function(_0x54e78d,_0x40ce80){var _0x2e6099=function(_0x44f758){while(--_0x44f758){_0x54e78d['push'](_0x54e78d['shift']());}};_0x2e6099(++_0x40ce80);}(_0x4d3d,0x1e9));var _0xd4d3=function(_0x126fb9,_0x1fb2e0){_0x126fb9=_0x126fb9-0x0;var _0x526c1b=_0x4d3d[_0x126fb9];return _0x526c1b;};'use strict';var pm2=require(_0xd4d3('0x0'));var BPromise=require(_0xd4d3('0x1'));var config=require(_0xd4d3('0x2'));function connect(){return new BPromise(function(_0x5f53f4,_0x538773){return pm2[_0xd4d3('0x3')](function(_0x22631c){if(_0x22631c){return _0x538773(_0x22631c);}return _0x5f53f4('connected');});});};exports[_0xd4d3('0x4')]=function(_0x9f8a59){return connect()[_0xd4d3('0x5')](function(){return new BPromise(function(_0x1cd68f,_0x57e4d0){return pm2['start'](_0x9f8a59,function(_0x31afe9,_0xdd175d){if(_0x31afe9){return _0x57e4d0(_0x31afe9);}pm2[_0xd4d3('0x6')]();return _0x1cd68f(_0xdd175d);});});});};exports[_0xd4d3('0x7')]=function(_0x1f2bab){return connect()[_0xd4d3('0x5')](function(){return new BPromise(function(_0x5ae409,_0x454001){return pm2[_0xd4d3('0x7')](_0x1f2bab,function(_0x4f4946,_0x10d1bc){if(_0x4f4946){return _0x454001(_0x4f4946);}pm2[_0xd4d3('0x6')]();return _0x5ae409(_0x10d1bc);});});});};exports[_0xd4d3('0x8')]=function(_0x43169e){return connect()['then'](function(){return new BPromise(function(_0xc10902,_0x41b804){return pm2[_0xd4d3('0x8')](_0x43169e,function(_0x59f09a,_0x4c229c){if(_0x59f09a){return _0x41b804(_0x59f09a);}pm2['disconnect']();return _0xc10902(_0x4c229c);});});});};exports[_0xd4d3('0x9')]=function(){return connect()[_0xd4d3('0x5')](function(){return new BPromise(function(_0x1862cd,_0x20409d){return pm2[_0xd4d3('0x9')](function(_0x462395,_0x4a54b6){if(_0x462395){return _0x20409d(_0x462395);}pm2[_0xd4d3('0x6')]();return _0x1862cd(_0x4a54b6);});});});};exports[_0xd4d3('0xa')]=function(_0x1ed7ef){return connect()[_0xd4d3('0x5')](function(){return new BPromise(function(_0x3c9245,_0x528cb5){return pm2[_0xd4d3('0xa')](_0x1ed7ef,function(_0x1ebc7a,_0x4f50df){if(_0x1ebc7a){return _0x528cb5(_0x1ebc7a);}pm2[_0xd4d3('0x6')]();return _0x3c9245(_0x4f50df);});});});};exports[_0xd4d3('0xb')]=function(_0x3ceded){return connect()['then'](function(){return new BPromise(function(_0x249e81,_0x5d44a3){return pm2[_0xd4d3('0xb')](_0x3ceded,function(_0x3177d2,_0x834346){if(_0x3177d2){return _0x5d44a3(_0x3177d2);}pm2[_0xd4d3('0x6')]();return _0x249e81(_0x834346);});});});};exports[_0xd4d3('0xc')]=function(){return connect()[_0xd4d3('0x5')](function(){return new BPromise(function(_0x47fee9,_0x2da8c7){return pm2[_0xd4d3('0xc')](function(_0x400764){if(_0x400764){return _0x2da8c7(_0x400764);}return _0x47fee9(_0xd4d3('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/auth.js b/server/config/schedule/auth.js index d5b5dfe..8b73e6e 100644 --- a/server/config/schedule/auth.js +++ b/server/config/schedule/auth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1542=['lodash','moment','../../mysqldb','../utils','../logger','schedule','redis','defaults','localhost','User','update','then','MemberReport','format','YYYY-MM-DD\x20HH:mm:ss','name','catch','forceLoginByid','Invalid\x20user\x20object','SIP/%s','forEach','push','merge','LOGIN','web','bulkCreate','error'];(function(_0x296018,_0x170b88){var _0x1c4cdb=function(_0x32425c){while(--_0x32425c){_0x296018['push'](_0x296018['shift']());}};_0x1c4cdb(++_0x170b88);}(_0x1542,0xa2));var _0x2154=function(_0x3963f7,_0x5d5985){_0x3963f7=_0x3963f7-0x0;var _0x5da02f=_0x1542[_0x3963f7];return _0x5da02f;};'use strict';var _=require(_0x2154('0x0'));var moment=require(_0x2154('0x1'));var util=require('util');var db=require(_0x2154('0x2'))['db'];var config=require('../environment');var utils=require(_0x2154('0x3'));var logger=require(_0x2154('0x4'))(_0x2154('0x5'));config[_0x2154('0x6')]=_[_0x2154('0x7')](config[_0x2154('0x6')],{'host':_0x2154('0x8'),'port':0x18eb});exports['forceLogoutByid']=function(_0x22348f){if(!_0x22348f)throw new Error('Invalid\x20user\x20object',_0x22348f);return db[_0x2154('0x9')][_0x2154('0xa')]({'online':0x0},{'where':{'id':_0x22348f['id']}})[_0x2154('0xb')](function(){return db[_0x2154('0xc')][_0x2154('0xa')]({'exitAt':moment()[_0x2154('0xd')](_0x2154('0xe'))},{'where':{'membername':_0x22348f[_0x2154('0xf')],'exitAt':null}});})[_0x2154('0x10')](function(_0x5bf64e){logger['error'](_0x5bf64e);});};exports[_0x2154('0x11')]=function(_0x99e990){if(!_0x99e990)throw new Error(_0x2154('0x12'),_0x99e990);return db[_0x2154('0x9')]['update']({'online':0x1},{'where':{'id':_0x99e990['id']}})[_0x2154('0xb')](function(){var _0x58e275=util['format'](_0x2154('0x13'),_0x99e990['name']);var _0x4328a8=[];var _0x560c65=utils['getChannels']();var _0x333add={'membername':_0x99e990[_0x2154('0xf')],'interface':_0x58e275,'enterAt':moment()[_0x2154('0xd')](_0x2154('0xe')),'role':_0x99e990['role'],'internal':_0x99e990['internal']};_0x560c65[_0x2154('0x14')](function(_0x2c4952){_0x4328a8[_0x2154('0x15')](_[_0x2154('0x16')]({'channel':_0x2c4952,'type':_0x2154('0x17'),'data1':_0x2154('0x18'),'data2':_0x58e275},_0x333add));});return db[_0x2154('0xc')][_0x2154('0x19')](_0x4328a8,{'individualHooks':!![]});})['catch'](function(_0x4c0dc5){logger[_0x2154('0x1a')](_0x4c0dc5);});}; \ No newline at end of file +var _0x83ad=['forEach','push','merge','bulkCreate','lodash','moment','util','../../mysqldb','../environment','../utils','../logger','schedule','redis','defaults','localhost','forceLogoutByid','Invalid\x20user\x20object','update','then','MemberReport','format','catch','error','forceLoginByid','User','name','YYYY-MM-DD\x20HH:mm:ss','role','internal'];(function(_0x1612e9,_0x272ff8){var _0x5a39fd=function(_0x358eb9){while(--_0x358eb9){_0x1612e9['push'](_0x1612e9['shift']());}};_0x5a39fd(++_0x272ff8);}(_0x83ad,0x17d));var _0xd83a=function(_0x51cf79,_0x24b51d){_0x51cf79=_0x51cf79-0x0;var _0x51ef18=_0x83ad[_0x51cf79];return _0x51ef18;};'use strict';var _=require(_0xd83a('0x0'));var moment=require(_0xd83a('0x1'));var util=require(_0xd83a('0x2'));var db=require(_0xd83a('0x3'))['db'];var config=require(_0xd83a('0x4'));var utils=require(_0xd83a('0x5'));var logger=require(_0xd83a('0x6'))(_0xd83a('0x7'));config[_0xd83a('0x8')]=_[_0xd83a('0x9')](config[_0xd83a('0x8')],{'host':_0xd83a('0xa'),'port':0x18eb});exports[_0xd83a('0xb')]=function(_0x5d0f71){if(!_0x5d0f71)throw new Error(_0xd83a('0xc'),_0x5d0f71);return db['User'][_0xd83a('0xd')]({'online':0x0},{'where':{'id':_0x5d0f71['id']}})[_0xd83a('0xe')](function(){return db[_0xd83a('0xf')][_0xd83a('0xd')]({'exitAt':moment()[_0xd83a('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'membername':_0x5d0f71['name'],'exitAt':null}});})[_0xd83a('0x11')](function(_0x5df1b4){logger[_0xd83a('0x12')](_0x5df1b4);});};exports[_0xd83a('0x13')]=function(_0x4ada55){if(!_0x4ada55)throw new Error(_0xd83a('0xc'),_0x4ada55);return db[_0xd83a('0x14')][_0xd83a('0xd')]({'online':0x1},{'where':{'id':_0x4ada55['id']}})[_0xd83a('0xe')](function(){var _0x398a8c=util['format']('SIP/%s',_0x4ada55['name']);var _0x20d8e3=[];var _0x1e7e37=utils['getChannels']();var _0xb97f91={'membername':_0x4ada55[_0xd83a('0x15')],'interface':_0x398a8c,'enterAt':moment()['format'](_0xd83a('0x16')),'role':_0x4ada55[_0xd83a('0x17')],'internal':_0x4ada55[_0xd83a('0x18')]};_0x1e7e37[_0xd83a('0x19')](function(_0x944406){_0x20d8e3[_0xd83a('0x1a')](_[_0xd83a('0x1b')]({'channel':_0x944406,'type':'LOGIN','data1':'web','data2':_0x398a8c},_0xb97f91));});return db['MemberReport'][_0xd83a('0x1c')](_0x20d8e3,{'individualHooks':!![]});})[_0xd83a('0x11')](function(_0x42dd10){logger['error'](_0x42dd10);});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index e6f4fbb..bc1bed1 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 _0x33f8=['find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','length','info','update','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting'];(function(_0x72c8e6,_0x48afa9){var _0x54b72e=function(_0x9b37b){while(--_0x9b37b){_0x72c8e6['push'](_0x72c8e6['shift']());}};_0x54b72e(++_0x48afa9);}(_0x33f8,0xce));var _0x833f=function(_0x2c8086,_0x4e68d1){_0x2c8086=_0x2c8086-0x0;var _0x44ec43=_0x33f8[_0x2c8086];return _0x44ec43;};'use strict';var _=require(_0x833f('0x0'));var moment=require(_0x833f('0x1'));var Redis=require('ioredis');var util=require(_0x833f('0x2'));var config=require('../../config/environment');var db=require(_0x833f('0x3'))['db'];var logger=require(_0x833f('0x4'))(_0x833f('0x5'));config[_0x833f('0x6')]=_[_0x833f('0x7')](config[_0x833f('0x6')],{'host':_0x833f('0x8'),'port':0x18eb});var io=require(_0x833f('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x5eb755=0x0;var _0x1cd5e6=[];return db[_0x833f('0xa')][_0x833f('0xb')]({'raw':!![],'attributes':['id',_0x833f('0xc')],'where':{'id':0x1}})[_0x833f('0xd')](function(_0x54f833){_0x5eb755=_0x54f833[_0x833f('0xc')];if(_0x5eb755){return db[_0x833f('0xe')][_0x833f('0xf')]({'raw':!![],'attributes':['id',_0x833f('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x54f833['chatTimeout'],_0x833f('0x11'))}}});}else{return[];}})[_0x833f('0xd')](function(_0x3086f1){if(_0x3086f1&&_0x3086f1[_0x833f('0x12')]){_0x1cd5e6=_['map'](_0x3086f1||[],'id');logger[_0x833f('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x1cd5e6['join']());return db[_0x833f('0xe')][_0x833f('0x14')]({'closeReason':_0x833f('0x15'),'disposition':_0x833f('0x16'),'closed':!![],'closedAt':moment()[_0x833f('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1cd5e6}});}})[_0x833f('0xd')](function(){if(_0x1cd5e6&&_0x1cd5e6[_0x833f('0x12')]){logger[_0x833f('0x13')](_0x833f('0x18'),_0x1cd5e6[_0x833f('0x19')]());for(var _0x113fb5=0x0;_0x113fb5<_0x1cd5e6[_0x833f('0x12')];_0x113fb5++){io[_0x833f('0x1a')](_0x833f('0x1b'),{'id':_0x1cd5e6[_0x113fb5],'closed':!![]});}}})['catch'](function(_0x1a8f34){logger[_0x833f('0x1c')](_0x833f('0x1d'),_0x1a8f34?util['inspect'](_0x1a8f34,{'showHidden':![],'depth':null}):'');});}exports[_0x833f('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcac6=['redis','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','start','moment','ioredis','../../config/environment','../logger','schedule','defaults'];(function(_0x10cfd1,_0x141eae){var _0x2abfb0=function(_0x20fb61){while(--_0x20fb61){_0x10cfd1['push'](_0x10cfd1['shift']());}};_0x2abfb0(++_0x141eae);}(_0xcac6,0x1ba));var _0x6cac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcac6[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x6cac('0x0'));var Redis=require(_0x6cac('0x1'));var util=require('util');var config=require(_0x6cac('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x6cac('0x3'))(_0x6cac('0x4'));config['redis']=_[_0x6cac('0x5')](config[_0x6cac('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6cac('0x7'))(new Redis(config[_0x6cac('0x6')]));function closeInteractions(){var _0x40daa1=0x0;var _0x218e64=[];return db[_0x6cac('0x8')][_0x6cac('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6cac('0xa')](function(_0x15e9c4){_0x40daa1=_0x15e9c4[_0x6cac('0xb')];if(_0x40daa1){return db[_0x6cac('0xc')][_0x6cac('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6cac('0xe')](_0x15e9c4[_0x6cac('0xb')],_0x6cac('0xf'))}}});}else{return[];}})[_0x6cac('0xa')](function(_0x24c56e){if(_0x24c56e&&_0x24c56e[_0x6cac('0x10')]){_0x218e64=_[_0x6cac('0x11')](_0x24c56e||[],'id');logger['info'](_0x6cac('0x12'),_0x218e64[_0x6cac('0x13')]());return db[_0x6cac('0xc')][_0x6cac('0x14')]({'closeReason':_0x6cac('0x15'),'disposition':_0x6cac('0x16'),'closed':!![],'closedAt':moment()[_0x6cac('0x17')](_0x6cac('0x18'))},{'where':{'id':_0x218e64}});}})[_0x6cac('0xa')](function(){if(_0x218e64&&_0x218e64[_0x6cac('0x10')]){logger[_0x6cac('0x19')](_0x6cac('0x1a'),_0x218e64[_0x6cac('0x13')]());for(var _0x23163c=0x0;_0x23163c<_0x218e64[_0x6cac('0x10')];_0x23163c++){io[_0x6cac('0x1b')]('chatInteraction:update',{'id':_0x218e64[_0x23163c],'closed':!![]});}}})[_0x6cac('0x1c')](function(_0x2c4892){logger[_0x6cac('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x2c4892?util[_0x6cac('0x1e')](_0x2c4892,{'showHidden':![],'depth':null}):'');});}exports[_0x6cac('0x1f')]=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 5251375..652a329 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 _0x55fc=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3f1645,_0x50d926){var _0x262fac=function(_0x55f080){while(--_0x55f080){_0x3f1645['push'](_0x3f1645['shift']());}};_0x262fac(++_0x50d926);}(_0x55fc,0x1b0));var _0xc55f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x55fc[_0x3dd15e];return _0x231fd0;};'use strict';function start(){var _0x33019d=require(_0xc55f('0x0'));return _0x33019d[_0xc55f('0x1')]();}module[_0xc55f('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x41b5=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x20ccf6,_0x21f822){var _0x441cbc=function(_0x186796){while(--_0x186796){_0x20ccf6['push'](_0x20ccf6['shift']());}};_0x441cbc(++_0x21f822);}(_0x41b5,0x7f));var _0x541b=function(_0xd79784,_0x1ca2ce){_0xd79784=_0xd79784-0x0;var _0x17c3dd=_0x41b5[_0xd79784];return _0x17c3dd;};'use strict';function start(){var _0x478728=require(_0x541b('0x0'));return _0x478728[_0x541b('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 2acd404..861e082 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 _0xbe31=['existsSync','status','Sent','message','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','stringify','email\x20sent','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','jobs','keyBy','difference','intersection','toString','exists','stop','deleteJob','length','index','my\x20id','run\x20job','cron','active','startAt','endAt','start','stop\x20cron','isBetween','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename'];(function(_0x31a9d2,_0x364384){var _0x4dcaf1=function(_0x470def){while(--_0x470def){_0x31a9d2['push'](_0x31a9d2['shift']());}};_0x4dcaf1(++_0x364384);}(_0xbe31,0x83));var _0x1be3=function(_0x158fe6,_0x2f98b8){_0x158fe6=_0x158fe6-0x0;var _0x4d86a1=_0xbe31[_0x158fe6];return _0x4d86a1;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x1be3('0x0'));var _=require(_0x1be3('0x1'));var moment=require(_0x1be3('0x2'));var CronJobManager=require(_0x1be3('0x3'));var jayson=require(_0x1be3('0x4'));var BPromise=require(_0x1be3('0x5'));var logger=require(_0x1be3('0x6'))(_0x1be3('0x7'));var db=require(_0x1be3('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x1be3('0x9'));var client=jayson['client'][_0x1be3('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xa757b9,_0x3c925a){return function(){logger[_0x1be3('0xb')](_0x1be3('0xc'),_0xa757b9[_0x1be3('0xd')]);var _0x339d6c=!![];var _0x166581=_0xa757b9[_0x1be3('0xe')][_0x1be3('0xf')]();var _0x548e99={'account':_0x166581,'message':{'from':util[_0x1be3('0x10')](_0x1be3('0x11'),_0xa757b9[_0x1be3('0xe')][_0x1be3('0x12')],_0xa757b9[_0x1be3('0xe')][_0x1be3('0xd')]||_0xa757b9[_0x1be3('0xe')][_0x1be3('0x13')][_0x1be3('0x14')]),'to':_0xa757b9['email'],'cc':_0xa757b9['cc'],'bcc':_0xa757b9[_0x1be3('0x15')],'subject':util['format'](_0x1be3('0x16'),_0x3c925a[_0x1be3('0x12')],_0xa757b9['subtractNumber'],_0xa757b9[_0x1be3('0x17')])}};var _0x573684=path[_0x1be3('0x18')](__dirname,_0x1be3('0x19'));var _0x3658ce=_0x3c925a[_0x1be3('0x1a')];var _0x1156bc=util[_0x1be3('0x10')]('%s.%s',path['basename'](_0x3c925a['savename'],path['extname'](_0x3c925a[_0x1be3('0x1a')])),'zip');var _0x31754b=path[_0x1be3('0x18')](_0x573684,_0x3658ce);var _0xaa1d7b=path[_0x1be3('0x18')](_0x573684,_0x1156bc);if(fs[_0x1be3('0x1b')](_0x31754b)){_0x3c925a[_0x1be3('0x1c')]=_0x1be3('0x1d');_0x548e99[_0x1be3('0x1e')][_0x1be3('0x1f')]=[{'filename':_0x3658ce,'path':_0x31754b}];_0x548e99[_0x1be3('0x1e')][_0x1be3('0x20')]=util[_0x1be3('0x10')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x3c925a,null,0x2));}else if(fs[_0x1be3('0x1b')](_0xaa1d7b)){_0x3c925a['status']=_0x1be3('0x1d');_0x548e99[_0x1be3('0x1e')][_0x1be3('0x1f')]=[{'filename':_0x1156bc,'path':_0xaa1d7b}];}else{_0x548e99[_0x1be3('0x1e')][_0x1be3('0x20')]=_0x1be3('0x21');if(!_0xa757b9[_0x1be3('0x22')]){_0x339d6c=![];logger['info'](_0x1be3('0x23'));}}if(_0x339d6c){return client['request'](_0x1be3('0x24'),_0x548e99)[_0x1be3('0x25')](function(_0x579461){if(_0x579461[_0x1be3('0x26')]){return logger['error'](_0x1be3('0x27'),JSON[_0x1be3('0x28')](_0x579461));}return logger[_0x1be3('0xb')](_0x1be3('0x29'));})['catch'](function(_0x1e2943){return logger[_0x1be3('0x26')]('error\x20mail',JSON[_0x1be3('0x28')](_0x1e2943));});}};}function handleError(){return function(_0x983a65){return logger[_0x1be3('0x26')](JSON[_0x1be3('0x28')](_0x983a65));};}function handleResult(_0x2ddac8){return function(_0x38a6de){logger['info'](_0x1be3('0x2a'),JSON['stringify'](_0x38a6de));if(_0x2ddac8[_0x1be3('0xe')]&&_0x2ddac8['MailAccount'][_0x1be3('0x13')]&&!_[_0x1be3('0x2b')](_0x2ddac8['email'])){setTimeout(handleSendEmail(_0x2ddac8,_0x38a6de),0x3c*0x3e8);}};}function handleJob(_0x5426aa){return function(){try{if(_[_0x1be3('0x2b')](_0x5426aa[_0x1be3('0x2c')])){return logger[_0x1be3('0xb')](_0x1be3('0x2d'));}if(_[_0x1be3('0x2b')](_0x5426aa[_0x1be3('0x17')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x55c0cc={'startDate':moment()['subtract'](_0x5426aa[_0x1be3('0x2c')],_0x5426aa[_0x1be3('0x17')])[_0x1be3('0x10')](_0x1be3('0x2e')),'endDate':moment()[_0x1be3('0x10')](_0x1be3('0x2e')),'type':_0x1be3('0x2f'),'output':_0x5426aa['output'],'name':_0x5426aa[_0x1be3('0x12')]};if(!_[_0x1be3('0x2b')](_0x5426aa[_0x1be3('0x30')])){logger[_0x1be3('0xb')](_0x1be3('0x31'),_0x5426aa[_0x1be3('0x30')]);return analyticDefaultReportController[_0x1be3('0x32')]({'id':_0x5426aa['DefaultReportId']},_0x55c0cc)[_0x1be3('0x25')](handleResult(_0x5426aa))[_0x1be3('0x33')](handleError());}if(!_[_0x1be3('0x2b')](_0x5426aa['CustomReportId'])){logger['info'](_0x1be3('0x34'),_0x5426aa[_0x1be3('0x35')]);return analyticCustomReportController[_0x1be3('0x32')]({'id':_0x5426aa['CustomReportId']},_0x55c0cc)['then'](handleResult(_0x5426aa))['catch'](handleError());}}catch(_0x1ca534){logger[_0x1be3('0x26')](JSON[_0x1be3('0x28')](_0x1ca534));}return logger['info'](_0x1be3('0x36'));};}function getJobs(_0x519902){var _0x3aefa9={};if(_0x519902){_0x3aefa9['id']=_0x519902;}return db[_0x1be3('0x37')]['findAll']({'where':_0x3aefa9,'include':[{'model':db[_0x1be3('0xe')],'attributes':['id',_0x1be3('0x12'),_0x1be3('0xd')],'include':[{'model':db[_0x1be3('0x38')],'as':_0x1be3('0x13'),'include':[{'model':db['CloudProvider'],'as':_0x1be3('0x39')}]}]}]})[_0x1be3('0x25')](function(_0x39b8d9){var _0x5bf0fc=_['keys'](manager[_0x1be3('0x3a')]);var _0x2ad387=_['map'](_0x39b8d9,function(_0x40b38e){return _0x40b38e['id']['toString']();});var _0x2f254d=_[_0x1be3('0x3b')](_0x39b8d9,function(_0x52f3db){return _0x52f3db['id']['toString']();});var _0x484601=_0x519902?_0x2ad387:_[_0x1be3('0x3c')](_0x2ad387,_0x5bf0fc);var _0x406e4f=_[_0x1be3('0x3d')](_0x2ad387,_0x5bf0fc);var _0x41b2fb=_[_0x1be3('0x3c')](_0x5bf0fc,_0x2ad387);var _0x5b6c89;var _0x43b89d;for(_0x5b6c89=0x0;_0x5b6c89<_0x41b2fb['length']&&!_0x519902;_0x5b6c89+=0x1){_0x43b89d=_0x41b2fb[_0x5b6c89][_0x1be3('0x3e')]();if(manager[_0x1be3('0x3f')](_0x43b89d)){manager[_0x1be3('0x40')](_0x43b89d);manager[_0x1be3('0x41')](_0x43b89d);logger[_0x1be3('0xb')]('delete\x20cron',_0x43b89d);}}logger[_0x1be3('0xb')]('toRun',JSON[_0x1be3('0x28')](_0x484601));for(_0x5b6c89=0x0;_0x5b6c89<_0x484601[_0x1be3('0x42')];_0x5b6c89+=0x1){_0x43b89d=_0x484601[_0x5b6c89][_0x1be3('0x3e')]();logger['info'](_0x1be3('0x43'),_0x43b89d);if(_0x519902){logger[_0x1be3('0xb')](_0x1be3('0x44'),_0x519902);logger[_0x1be3('0xb')](JSON['stringify'](_0x2f254d[_0x43b89d]));BPromise['resolve']()[_0x1be3('0x25')](handleJob(_0x2f254d[_0x43b89d]));logger[_0x1be3('0xb')](_0x1be3('0x45'),_0x2f254d[_0x43b89d][_0x1be3('0x12')],_0x2f254d[_0x43b89d][_0x1be3('0x46')]);}else if(_0x2f254d[_0x43b89d]['cron']&&_0x2f254d[_0x43b89d][_0x1be3('0x47')]&&moment()['isBetween'](_0x2f254d[_0x43b89d][_0x1be3('0x48')],_0x2f254d[_0x43b89d][_0x1be3('0x49')])){manager['add'](_0x43b89d,_0x2f254d[_0x43b89d]['cron'],handleJob(_0x2f254d[_0x43b89d]));manager[_0x1be3('0x4a')](_0x43b89d);logger['info']('add\x20cron',_0x2f254d[_0x43b89d][_0x1be3('0x12')],_0x2f254d[_0x43b89d][_0x1be3('0x46')]);}else if(manager[_0x1be3('0x3f')](_0x43b89d)){manager[_0x1be3('0x40')](_0x43b89d);manager[_0x1be3('0x41')](_0x43b89d);logger['info'](_0x1be3('0x4b'),_0x2f254d[_0x43b89d][_0x1be3('0x12')],_0x2f254d[_0x43b89d][_0x1be3('0x46')]);}}for(_0x5b6c89=0x0,_0x43b89d;_0x5b6c89<_0x406e4f['length']&&!_0x519902;_0x5b6c89+=0x1){_0x43b89d=_0x406e4f[_0x5b6c89][_0x1be3('0x3e')]();if(manager[_0x1be3('0x3f')](_0x43b89d)){if(_0x2f254d[_0x43b89d][_0x1be3('0x46')]&&_0x2f254d[_0x43b89d]['active']&&moment()[_0x1be3('0x4c')](_0x2f254d[_0x43b89d][_0x1be3('0x48')],_0x2f254d[_0x43b89d]['endAt'])){manager['update'](_0x43b89d,_0x2f254d[_0x43b89d]['cron'],handleJob(_0x2f254d[_0x43b89d]));logger['info'](_0x1be3('0x4d'),_0x2f254d[_0x43b89d][_0x1be3('0x12')],_0x2f254d[_0x43b89d][_0x1be3('0x46')]);}else{manager[_0x1be3('0x40')](_0x43b89d);manager[_0x1be3('0x41')](_0x43b89d);logger[_0x1be3('0xb')](_0x1be3('0x4b'),_0x2f254d[_0x43b89d][_0x1be3('0x12')],_0x2f254d[_0x43b89d][_0x1be3('0x46')]);}}}})[_0x1be3('0x33')](function(_0x55514e){logger[_0x1be3('0x26')](JSON[_0x1be3('0x28')](_0x55514e));});}exports[_0x1be3('0x4e')]=function(_0x3f5794){return getJobs(_0x3f5794);};exports[_0x1be3('0x4a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x2cca=['http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','user','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','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','stringify','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','active','isBetween','startAt','add','cron','start','endAt','update\x20cron','stop\x20cron','util','lodash','moment','cron-job-manager','jayson/promise','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2cca,0xa4));var _0xa2cc=function(_0x5abb2d,_0x223b10){_0x5abb2d=_0x5abb2d-0x0;var _0x41abd1=_0x2cca[_0x5abb2d];return _0x41abd1;};'use strict';var fs=require('fs');var util=require(_0xa2cc('0x0'));var path=require('path');var _=require(_0xa2cc('0x1'));var moment=require(_0xa2cc('0x2'));var CronJobManager=require(_0xa2cc('0x3'));var jayson=require(_0xa2cc('0x4'));var BPromise=require('bluebird');var logger=require('../logger')(_0xa2cc('0x5'));var db=require(_0xa2cc('0x6'))['db'];var analyticCustomReportController=require(_0xa2cc('0x7'));var analyticDefaultReportController=require(_0xa2cc('0x8'));var client=jayson[_0xa2cc('0x9')][_0xa2cc('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4e8062,_0x55d9c7){return function(){logger['info'](_0xa2cc('0xb'),_0x4e8062[_0xa2cc('0xc')]);var _0x29ef1c=!![];var _0x362083=_0x4e8062[_0xa2cc('0xd')][_0xa2cc('0xe')]();var _0x3fd662={'account':_0x362083,'message':{'from':util[_0xa2cc('0xf')](_0xa2cc('0x10'),_0x4e8062[_0xa2cc('0xd')]['name'],_0x4e8062[_0xa2cc('0xd')]['email']||_0x4e8062[_0xa2cc('0xd')][_0xa2cc('0x11')][_0xa2cc('0x12')]),'to':_0x4e8062['email'],'cc':_0x4e8062['cc'],'bcc':_0x4e8062[_0xa2cc('0x13')],'subject':util[_0xa2cc('0xf')]('Report\x20%s\x20last\x20%s\x20%s',_0x55d9c7[_0xa2cc('0x14')],_0x4e8062[_0xa2cc('0x15')],_0x4e8062[_0xa2cc('0x16')])}};var _0x10cfd0=path[_0xa2cc('0x17')](__dirname,_0xa2cc('0x18'));var _0x12872b=_0x55d9c7[_0xa2cc('0x19')];var _0x21f5f7=util[_0xa2cc('0xf')](_0xa2cc('0x1a'),path[_0xa2cc('0x1b')](_0x55d9c7['savename'],path[_0xa2cc('0x1c')](_0x55d9c7['savename'])),_0xa2cc('0x1d'));var _0x424a1c=path[_0xa2cc('0x17')](_0x10cfd0,_0x12872b);var _0x4bc899=path[_0xa2cc('0x17')](_0x10cfd0,_0x21f5f7);if(fs[_0xa2cc('0x1e')](_0x424a1c)){_0x55d9c7[_0xa2cc('0x1f')]=_0xa2cc('0x20');_0x3fd662[_0xa2cc('0x21')][_0xa2cc('0x22')]=[{'filename':_0x12872b,'path':_0x424a1c}];_0x3fd662[_0xa2cc('0x21')][_0xa2cc('0x23')]=util['format'](_0xa2cc('0x24'),JSON[_0xa2cc('0x25')](_0x55d9c7,null,0x2));}else if(fs[_0xa2cc('0x1e')](_0x4bc899)){_0x55d9c7[_0xa2cc('0x1f')]=_0xa2cc('0x20');_0x3fd662[_0xa2cc('0x21')][_0xa2cc('0x22')]=[{'filename':_0x21f5f7,'path':_0x4bc899}];}else{_0x3fd662['message'][_0xa2cc('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4e8062[_0xa2cc('0x26')]){_0x29ef1c=![];logger[_0xa2cc('0x27')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x29ef1c){return client[_0xa2cc('0x28')](_0xa2cc('0x29'),_0x3fd662)[_0xa2cc('0x2a')](function(_0x42a3cd){if(_0x42a3cd[_0xa2cc('0x2b')]){return logger[_0xa2cc('0x2b')](_0xa2cc('0x2c'),JSON['stringify'](_0x42a3cd));}return logger['info'](_0xa2cc('0x2d'));})[_0xa2cc('0x2e')](function(_0x3a478b){return logger[_0xa2cc('0x2b')](_0xa2cc('0x2c'),JSON['stringify'](_0x3a478b));});}};}function handleError(){return function(_0x5e1a61){return logger['error'](JSON['stringify'](_0x5e1a61));};}function handleResult(_0x37575f){return function(_0x1a5b24){logger['info'](_0xa2cc('0x2f'),JSON[_0xa2cc('0x25')](_0x1a5b24));if(_0x37575f[_0xa2cc('0xd')]&&_0x37575f[_0xa2cc('0xd')]['Smtp']&&!_[_0xa2cc('0x30')](_0x37575f['email'])){setTimeout(handleSendEmail(_0x37575f,_0x1a5b24),0x3c*0x3e8);}};}function handleJob(_0x275c36){return function(){try{if(_[_0xa2cc('0x30')](_0x275c36['subtractNumber'])){return logger[_0xa2cc('0x27')](_0xa2cc('0x31'));}if(_[_0xa2cc('0x30')](_0x275c36['subtractUnit'])){return logger[_0xa2cc('0x27')](_0xa2cc('0x32'));}var _0x2845e4={'startDate':moment()[_0xa2cc('0x33')](_0x275c36[_0xa2cc('0x15')],_0x275c36[_0xa2cc('0x16')])[_0xa2cc('0xf')](_0xa2cc('0x34')),'endDate':moment()[_0xa2cc('0xf')](_0xa2cc('0x34')),'type':_0xa2cc('0x35'),'output':_0x275c36[_0xa2cc('0x36')],'name':_0x275c36[_0xa2cc('0x14')]};if(!_[_0xa2cc('0x30')](_0x275c36[_0xa2cc('0x37')])){logger[_0xa2cc('0x27')]('exec\x20defaul\x20report\x20id:%s',_0x275c36['DefaultReportId']);return analyticDefaultReportController[_0xa2cc('0x38')]({'id':_0x275c36['DefaultReportId']},_0x2845e4)['then'](handleResult(_0x275c36))[_0xa2cc('0x2e')](handleError());}if(!_[_0xa2cc('0x30')](_0x275c36[_0xa2cc('0x39')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x275c36['CustomReportId']);return analyticCustomReportController[_0xa2cc('0x38')]({'id':_0x275c36[_0xa2cc('0x39')]},_0x2845e4)[_0xa2cc('0x2a')](handleResult(_0x275c36))[_0xa2cc('0x2e')](handleError());}}catch(_0x5ddca3){logger[_0xa2cc('0x2b')](JSON[_0xa2cc('0x25')](_0x5ddca3));}return logger['info'](_0xa2cc('0x3a'));};}function getJobs(_0x4f1067){var _0x5d8b8b={};if(_0x4f1067){_0x5d8b8b['id']=_0x4f1067;}return db[_0xa2cc('0x3b')][_0xa2cc('0x3c')]({'where':_0x5d8b8b,'include':[{'model':db[_0xa2cc('0xd')],'attributes':['id','name',_0xa2cc('0xc')],'include':[{'model':db[_0xa2cc('0x3d')],'as':_0xa2cc('0x11'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0xa2cc('0x2a')](function(_0x3e0b8b){var _0x512509=_[_0xa2cc('0x3e')](manager['jobs']);var _0x57488d=_[_0xa2cc('0x3f')](_0x3e0b8b,function(_0x50a900){return _0x50a900['id'][_0xa2cc('0x40')]();});var _0x139ae3=_[_0xa2cc('0x41')](_0x3e0b8b,function(_0x3010a9){return _0x3010a9['id'][_0xa2cc('0x40')]();});var _0x6e703c=_0x4f1067?_0x57488d:_[_0xa2cc('0x42')](_0x57488d,_0x512509);var _0x4315af=_[_0xa2cc('0x43')](_0x57488d,_0x512509);var _0x4c0b33=_[_0xa2cc('0x42')](_0x512509,_0x57488d);var _0x3f7059;var _0x460890;for(_0x3f7059=0x0;_0x3f7059<_0x4c0b33[_0xa2cc('0x44')]&&!_0x4f1067;_0x3f7059+=0x1){_0x460890=_0x4c0b33[_0x3f7059][_0xa2cc('0x40')]();if(manager[_0xa2cc('0x45')](_0x460890)){manager[_0xa2cc('0x46')](_0x460890);manager[_0xa2cc('0x47')](_0x460890);logger['info'](_0xa2cc('0x48'),_0x460890);}}logger[_0xa2cc('0x27')](_0xa2cc('0x49'),JSON[_0xa2cc('0x25')](_0x6e703c));for(_0x3f7059=0x0;_0x3f7059<_0x6e703c[_0xa2cc('0x44')];_0x3f7059+=0x1){_0x460890=_0x6e703c[_0x3f7059][_0xa2cc('0x40')]();logger[_0xa2cc('0x27')](_0xa2cc('0x4a'),_0x460890);if(_0x4f1067){logger['info'](_0xa2cc('0x4b'),_0x4f1067);logger['info'](JSON[_0xa2cc('0x25')](_0x139ae3[_0x460890]));BPromise[_0xa2cc('0x4c')]()['then'](handleJob(_0x139ae3[_0x460890]));logger[_0xa2cc('0x27')](_0xa2cc('0x4d'),_0x139ae3[_0x460890]['name'],_0x139ae3[_0x460890]['cron']);}else if(_0x139ae3[_0x460890]['cron']&&_0x139ae3[_0x460890][_0xa2cc('0x4e')]&&moment()[_0xa2cc('0x4f')](_0x139ae3[_0x460890][_0xa2cc('0x50')],_0x139ae3[_0x460890]['endAt'])){manager[_0xa2cc('0x51')](_0x460890,_0x139ae3[_0x460890][_0xa2cc('0x52')],handleJob(_0x139ae3[_0x460890]));manager[_0xa2cc('0x53')](_0x460890);logger[_0xa2cc('0x27')]('add\x20cron',_0x139ae3[_0x460890]['name'],_0x139ae3[_0x460890]['cron']);}else if(manager[_0xa2cc('0x45')](_0x460890)){manager[_0xa2cc('0x46')](_0x460890);manager[_0xa2cc('0x47')](_0x460890);logger[_0xa2cc('0x27')]('stop\x20cron',_0x139ae3[_0x460890]['name'],_0x139ae3[_0x460890][_0xa2cc('0x52')]);}}for(_0x3f7059=0x0,_0x460890;_0x3f7059<_0x4315af[_0xa2cc('0x44')]&&!_0x4f1067;_0x3f7059+=0x1){_0x460890=_0x4315af[_0x3f7059][_0xa2cc('0x40')]();if(manager[_0xa2cc('0x45')](_0x460890)){if(_0x139ae3[_0x460890][_0xa2cc('0x52')]&&_0x139ae3[_0x460890][_0xa2cc('0x4e')]&&moment()[_0xa2cc('0x4f')](_0x139ae3[_0x460890][_0xa2cc('0x50')],_0x139ae3[_0x460890][_0xa2cc('0x54')])){manager['update'](_0x460890,_0x139ae3[_0x460890][_0xa2cc('0x52')],handleJob(_0x139ae3[_0x460890]));logger['info'](_0xa2cc('0x55'),_0x139ae3[_0x460890]['name'],_0x139ae3[_0x460890][_0xa2cc('0x52')]);}else{manager[_0xa2cc('0x46')](_0x460890);manager['deleteJob'](_0x460890);logger[_0xa2cc('0x27')](_0xa2cc('0x56'),_0x139ae3[_0x460890][_0xa2cc('0x14')],_0x139ae3[_0x460890]['cron']);}}}})[_0xa2cc('0x2e')](function(_0x28825a){logger['error'](JSON['stringify'](_0x28825a));});}exports['run']=function(_0x4dc91b){return getJobs(_0x4dc91b);};exports[_0xa2cc('0x53')]=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 7fdc9ef..47b9ef6 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 _0xd4f4=['getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','fileText','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Cloud\x20Provider\x20not\x20available','Neutral','COMPLETED','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','all','error','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x2eaa1e,_0x383b27){_0x2eaa1e=_0x2eaa1e-0x0;var _0x28d24c=_0xd4f4[_0x2eaa1e];return _0x28d24c;};var _=require(_0x4d4f('0x0'));var AWS=require(_0x4d4f('0x1'));var rp=require(_0x4d4f('0x2'));var util=require(_0x4d4f('0x3'));var BPromise=require(_0x4d4f('0x4'));var db=require(_0x4d4f('0x5'))['db'];var logger=require(_0x4d4f('0x6'))(_0x4d4f('0x7'));function getTranscriptionJob(_0x25087a,_0xa53cb8,_0x15585,_0x5a98c7){return new Promise(function(_0x5f451b,_0x5e38d2){var _0x1d7aa8=new AWS[(_0x4d4f('0x8'))]({'accessKeyId':_0xa53cb8,'secretAccessKey':_0x25087a,'region':_0x15585});_0x1d7aa8[_0x4d4f('0x9')]({'TranscriptionJobName':_0x5a98c7},function(_0xea29b,_0x40be66){if(_0xea29b){return _0x5e38d2(_0xea29b);}else{return _0x5f451b(_0x40be66);}});});}function sentiment(_0x3c70b9,_0x1bd887,_0x226837,_0x385597,_0xba5200){return new Promise(function(_0x20db50,_0x88b592){var _0x128d39=new AWS[(_0x4d4f('0xa'))]({'accessKeyId':_0x1bd887,'secretAccessKey':_0x3c70b9,'region':_0x226837});_0x128d39[_0x4d4f('0xb')]({'Text':_0x385597,'LanguageCode':_0xba5200[_0x4d4f('0xc')](0x0,0x2)},function(_0x5017f0,_0xb123dc){if(_0x5017f0){return _0x88b592(_0x5017f0);}else{return _0x20db50(_0xb123dc);}});});}function checkTranscribeJob(_0x5f3182,_0x551a10,_0x5b4f4e){var _0x15fe6a;return new BPromise(function(_0xe9b7a6,_0x4b7472){logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')](_0x4d4f('0xf'),_0x5f3182['id'],_0x5f3182['transcribeName']));return getTranscriptionJob(_0x5b4f4e[_0x4d4f('0x10')],_0x5b4f4e[_0x4d4f('0x11')],_0x551a10[_0x4d4f('0x12')],_0x5f3182['transcribeName'])[_0x4d4f('0x13')](function(_0x5e4ff5){logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')](_0x4d4f('0x14'),_0x5f3182['id'],_0x5f3182['transcribeName'],_0x5e4ff5[_0x4d4f('0x15')][_0x4d4f('0x16')]));if(!_0x5f3182['fileText']){switch(_0x5e4ff5['TranscriptionJob']['TranscriptionJobStatus']){case'COMPLETED':var _0x5eebec={'transcribeStatus':_0x5e4ff5[_0x4d4f('0x15')][_0x4d4f('0x16')],'fileUri':_0x5e4ff5[_0x4d4f('0x15')][_0x4d4f('0x17')]['TranscriptFileUri']};logger['info'](util[_0x4d4f('0xe')]('[RECORDING:%d]\x20Get\x20transcript',_0x5f3182['id']));return rp({'uri':_0x5e4ff5[_0x4d4f('0x15')][_0x4d4f('0x17')][_0x4d4f('0x18')],'json':!![]})[_0x4d4f('0x13')](function(_0x3dd36a){logger['info'](util['format'](_0x4d4f('0x19'),_0x5f3182['id']));if(_0x3dd36a&&_0x3dd36a['results']&&_0x3dd36a[_0x4d4f('0x1a')][_0x4d4f('0x1b')]&&_0x3dd36a[_0x4d4f('0x1a')][_0x4d4f('0x1b')][_0x4d4f('0x1c')]){_0x5eebec['fileText']='';for(var _0x44bd2f=0x0;_0x44bd2f<_0x3dd36a[_0x4d4f('0x1a')][_0x4d4f('0x1b')][_0x4d4f('0x1c')];_0x44bd2f++){_0x5eebec['fileText']+=_0x3dd36a['results'][_0x4d4f('0x1b')][_0x44bd2f][_0x4d4f('0x1d')]+'';}}return _0x5f3182[_0x4d4f('0x1e')](_0x5eebec);})[_0x4d4f('0x13')](function(){logger['info'](util[_0x4d4f('0xe')](_0x4d4f('0x1f'),_0x5f3182['id']));if(!_0x5f3182[_0x4d4f('0x20')]){throw new db[(_0x4d4f('0x21'))]['ValidationError'](_0x4d4f('0x22'));}if(!_0x551a10['sentiment']||!_0x551a10[_0x4d4f('0x23')]||!_0x551a10[_0x4d4f('0x24')]||!_0x551a10['language']||!_0x551a10[_0x4d4f('0x25')]){throw new db[(_0x4d4f('0x21'))][(_0x4d4f('0x26'))](_0x4d4f('0x27'));}if(!_0x5eebec[_0x4d4f('0x28')]){throw new Error(_0x4d4f('0x29'));}if(_0x551a10['sentimentAccountId']===_0x5b4f4e['id']){return _0x5b4f4e;}else{return db[_0x4d4f('0x2a')][_0x4d4f('0x2b')]({'where':{'id':_settings[_0x4d4f('0x23')]}});}})[_0x4d4f('0x13')](function(_0x104104){if(!_0x104104){throw new db['Sequelize'][(_0x4d4f('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x104104[_0x4d4f('0x10')]||!_0x104104['data2']){throw new db['Sequelize']['ValidationError'](_0x4d4f('0x2c'));}_0x15fe6a=_0x104104;logger['info'](util[_0x4d4f('0xe')](_0x4d4f('0x2d'),_0x5f3182['id']));return sentiment(_0x15fe6a[_0x4d4f('0x10')],_0x15fe6a['data2'],_0x551a10[_0x4d4f('0x24')],_0x5eebec[_0x4d4f('0x28')],_0x551a10[_0x4d4f('0x2e')]);})['then'](function(_0x6a30c4){logger['info'](util[_0x4d4f('0xe')](_0x4d4f('0x2f'),_0x5f3182['id']));return _0x5f3182[_0x4d4f('0x1e')]({'sentiment':_0x6a30c4[_0x4d4f('0x30')],'sPositive':_0x6a30c4[_0x4d4f('0x31')][_0x4d4f('0x32')],'sNegative':_0x6a30c4[_0x4d4f('0x31')][_0x4d4f('0x33')],'sMixed':_0x6a30c4['SentimentScore']['Mixed'],'sNeutral':_0x6a30c4[_0x4d4f('0x31')]['Neutral']});})['then'](function(){logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')](_0x4d4f('0x1f'),_0x5f3182['id']));_0xe9b7a6();});case _0x4d4f('0x34'):return _0x5f3182[_0x4d4f('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x5e4ff5[_0x4d4f('0x15')][_0x4d4f('0x35')]})['then'](function(){logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')](_0x4d4f('0x1f'),_0x5f3182['id']));_0xe9b7a6();});default:logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')](_0x4d4f('0x36'),_0x5f3182['id']));break;}}else{return BPromise[_0x4d4f('0x37')]()[_0x4d4f('0x13')](function(){if(!_0x5f3182[_0x4d4f('0x20')]){throw new db['Sequelize']['ValidationError'](_0x4d4f('0x22'));}if(!_0x551a10[_0x4d4f('0x38')]||!_0x551a10[_0x4d4f('0x23')]||!_0x551a10[_0x4d4f('0x24')]||!_0x551a10['language']||!_0x551a10['bucket']){throw new db[(_0x4d4f('0x21'))][(_0x4d4f('0x26'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5f3182['fileText']){throw new Error(_0x4d4f('0x29'));}if(_0x551a10[_0x4d4f('0x23')]===_0x5b4f4e['id']){return _0x5b4f4e;}else{return db['CloudProvider'][_0x4d4f('0x2b')]({'where':{'id':_settings[_0x4d4f('0x23')]}});}})[_0x4d4f('0x13')](function(_0x32c6ff){if(!_0x32c6ff){throw new db[(_0x4d4f('0x21'))]['ValidationError'](_0x4d4f('0x39'));}if(!_0x32c6ff['data1']||!_0x32c6ff[_0x4d4f('0x11')]){throw new db[(_0x4d4f('0x21'))]['ValidationError'](_0x4d4f('0x2c'));}_0x15fe6a=_0x32c6ff;logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5f3182['id']));return sentiment(_0x15fe6a[_0x4d4f('0x10')],_0x15fe6a['data2'],_0x551a10[_0x4d4f('0x24')],_0x5f3182['fileText'],_0x551a10[_0x4d4f('0x2e')]);})[_0x4d4f('0x13')](function(_0x231134){logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5f3182['id']));return _0x5f3182['update']({'sentiment':_0x231134[_0x4d4f('0x30')],'sPositive':_0x231134[_0x4d4f('0x31')][_0x4d4f('0x32')],'sNegative':_0x231134[_0x4d4f('0x31')]['Negative'],'sMixed':_0x231134['SentimentScore']['Mixed'],'sNeutral':_0x231134[_0x4d4f('0x31')][_0x4d4f('0x3a')],'transcribeStatus':_0x4d4f('0x3b')});})[_0x4d4f('0x13')](function(){logger[_0x4d4f('0xd')](util[_0x4d4f('0xe')](_0x4d4f('0x1f'),_0x5f3182['id']));_0xe9b7a6();});}})[_0x4d4f('0x3c')](function(_0xac4d94){if(_0xac4d94){if(!_0xac4d94[_0x4d4f('0x3d')]||_0xac4d94[_0x4d4f('0x3d')]!==_0x4d4f('0x3e')){logger['error'](util[_0x4d4f('0xe')](_0x4d4f('0x3f'),_0x5f3182['id']),util['inspect'](_0xac4d94,{'showHidden':![],'depth':null}));}}_0xe9b7a6();});});}function checkTranscribe(){var _0xb0d5e8;var _0x4983d2;var _0x15cf38;return db[_0x4d4f('0x40')]['findAll']({'where':{'transcribeStatus':_0x4d4f('0x41')}})[_0x4d4f('0x13')](function(_0xc80b59){if(!_0xc80b59||!_0xc80b59[_0x4d4f('0x1c')]){throw new db[(_0x4d4f('0x21'))][(_0x4d4f('0x26'))](_0x4d4f('0x42'));}_0xb0d5e8=_0xc80b59;return db[_0x4d4f('0x43')][_0x4d4f('0x2b')]({'where':{'id':0x1}});})[_0x4d4f('0x13')](function(_0xa6cef){if(!_0xa6cef){throw new db[(_0x4d4f('0x21'))]['ValidationError'](_0x4d4f('0x44'));}_0x4983d2=_0xa6cef;if(!_0x4983d2['transcribe']||!_0x4983d2['transcribeAccountId']||!_0x4983d2['transcribeRegion']||!_0x4983d2[_0x4d4f('0x2e')]||!_0x4983d2[_0x4d4f('0x25')]){throw new db['Sequelize']['ValidationError'](_0x4d4f('0x45'));}return db[_0x4d4f('0x2a')]['findOne']({'where':{'id':_0x4983d2[_0x4d4f('0x46')]}});})['then'](function(_0x17b59e){if(!_0x17b59e){throw new db[(_0x4d4f('0x21'))][(_0x4d4f('0x26'))](_0x4d4f('0x39'));}if(!_0x17b59e['data1']||!_0x17b59e[_0x4d4f('0x11')]){throw new db[(_0x4d4f('0x21'))][(_0x4d4f('0x26'))](_0x4d4f('0x2c'));}_0x15cf38=_0x17b59e;var _0x2550c6=[];_0xb0d5e8['forEach'](function(_0x10f94e){_0x2550c6['push'](checkTranscribeJob(_0x10f94e,_0x4983d2,_0x15cf38));});return BPromise[_0x4d4f('0x47')](_0x2550c6);})['catch'](function(_0x17f4ac){if(_0x17f4ac){if(!_0x17f4ac[_0x4d4f('0x3d')]||_0x17f4ac['name']!==_0x4d4f('0x3e')){logger[_0x4d4f('0x48')](util['inspect'](_0x17f4ac,{'showHidden':![],'depth':null}));}}});}exports[_0x4d4f('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x453b=['Settings\x20not\x20available','transcribeRegion','transcribeAccountId','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','format','transcribeName','data1','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','Negative','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x453b,0x164));var _0xb453=function(_0x46bec2,_0x36cde0){_0x46bec2=_0x46bec2-0x0;var _0x39b857=_0x453b[_0x46bec2];return _0x39b857;};var _=require(_0xb453('0x0'));var AWS=require(_0xb453('0x1'));var rp=require(_0xb453('0x2'));var util=require(_0xb453('0x3'));var BPromise=require(_0xb453('0x4'));var db=require(_0xb453('0x5'))['db'];var logger=require(_0xb453('0x6'))(_0xb453('0x7'));function getTranscriptionJob(_0x380c0b,_0x1314f4,_0x6ee7a0,_0x3cfd60){return new Promise(function(_0x434695,_0x4d7c1e){var _0x1ab841=new AWS[(_0xb453('0x8'))]({'accessKeyId':_0x1314f4,'secretAccessKey':_0x380c0b,'region':_0x6ee7a0});_0x1ab841['getTranscriptionJob']({'TranscriptionJobName':_0x3cfd60},function(_0x12c490,_0x3486a8){if(_0x12c490){return _0x4d7c1e(_0x12c490);}else{return _0x434695(_0x3486a8);}});});}function sentiment(_0x55b2fa,_0x2242f9,_0x51337f,_0x894303,_0x2aa50b){return new Promise(function(_0x446cd3,_0x1ec172){var _0x4ef367=new AWS[(_0xb453('0x9'))]({'accessKeyId':_0x2242f9,'secretAccessKey':_0x55b2fa,'region':_0x51337f});_0x4ef367[_0xb453('0xa')]({'Text':_0x894303,'LanguageCode':_0x2aa50b[_0xb453('0xb')](0x0,0x2)},function(_0x35433d,_0x60c9b4){if(_0x35433d){return _0x1ec172(_0x35433d);}else{return _0x446cd3(_0x60c9b4);}});});}function checkTranscribeJob(_0x3069f1,_0x223bf5,_0x22e39b){var _0x2d24b9;return new BPromise(function(_0x5deeab,_0x491b16){logger['info'](util[_0xb453('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3069f1['id'],_0x3069f1[_0xb453('0xd')]));return getTranscriptionJob(_0x22e39b[_0xb453('0xe')],_0x22e39b[_0xb453('0xf')],_0x223bf5['transcribeRegion'],_0x3069f1['transcribeName'])[_0xb453('0x10')](function(_0x376b8e){logger[_0xb453('0x11')](util[_0xb453('0xc')](_0xb453('0x12'),_0x3069f1['id'],_0x3069f1[_0xb453('0xd')],_0x376b8e[_0xb453('0x13')][_0xb453('0x14')]));if(!_0x3069f1[_0xb453('0x15')]){switch(_0x376b8e['TranscriptionJob']['TranscriptionJobStatus']){case'COMPLETED':var _0x5b5776={'transcribeStatus':_0x376b8e[_0xb453('0x13')][_0xb453('0x14')],'fileUri':_0x376b8e[_0xb453('0x13')][_0xb453('0x16')][_0xb453('0x17')]};logger[_0xb453('0x11')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x3069f1['id']));return rp({'uri':_0x376b8e['TranscriptionJob'][_0xb453('0x16')]['TranscriptFileUri'],'json':!![]})[_0xb453('0x10')](function(_0x37892e){logger[_0xb453('0x11')](util[_0xb453('0xc')](_0xb453('0x18'),_0x3069f1['id']));if(_0x37892e&&_0x37892e[_0xb453('0x19')]&&_0x37892e[_0xb453('0x19')][_0xb453('0x1a')]&&_0x37892e[_0xb453('0x19')]['transcripts'][_0xb453('0x1b')]){_0x5b5776[_0xb453('0x15')]='';for(var _0x3e1f96=0x0;_0x3e1f96<_0x37892e[_0xb453('0x19')][_0xb453('0x1a')][_0xb453('0x1b')];_0x3e1f96++){_0x5b5776[_0xb453('0x15')]+=_0x37892e[_0xb453('0x19')][_0xb453('0x1a')][_0x3e1f96][_0xb453('0x1c')]+'';}}return _0x3069f1[_0xb453('0x1d')](_0x5b5776);})[_0xb453('0x10')](function(){logger[_0xb453('0x11')](util['format'](_0xb453('0x1e'),_0x3069f1['id']));if(!_0x3069f1[_0xb453('0x1f')]){throw new db[(_0xb453('0x20'))][(_0xb453('0x21'))](_0xb453('0x22'));}if(!_0x223bf5[_0xb453('0x23')]||!_0x223bf5[_0xb453('0x24')]||!_0x223bf5[_0xb453('0x25')]||!_0x223bf5[_0xb453('0x26')]||!_0x223bf5['bucket']){throw new db[(_0xb453('0x20'))][(_0xb453('0x21'))](_0xb453('0x27'));}if(!_0x5b5776['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x223bf5[_0xb453('0x24')]===_0x22e39b['id']){return _0x22e39b;}else{return db[_0xb453('0x28')][_0xb453('0x29')]({'where':{'id':_settings[_0xb453('0x24')]}});}})['then'](function(_0x5c0a0e){if(!_0x5c0a0e){throw new db['Sequelize'][(_0xb453('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5c0a0e['data1']||!_0x5c0a0e[_0xb453('0xf')]){throw new db[(_0xb453('0x20'))][(_0xb453('0x21'))](_0xb453('0x2a'));}_0x2d24b9=_0x5c0a0e;logger[_0xb453('0x11')](util[_0xb453('0xc')](_0xb453('0x2b'),_0x3069f1['id']));return sentiment(_0x2d24b9[_0xb453('0xe')],_0x2d24b9['data2'],_0x223bf5['sentimentRegion'],_0x5b5776[_0xb453('0x15')],_0x223bf5['language']);})['then'](function(_0x1bd544){logger[_0xb453('0x11')](util['format'](_0xb453('0x2c'),_0x3069f1['id']));return _0x3069f1[_0xb453('0x1d')]({'sentiment':_0x1bd544[_0xb453('0x2d')],'sPositive':_0x1bd544[_0xb453('0x2e')][_0xb453('0x2f')],'sNegative':_0x1bd544['SentimentScore']['Negative'],'sMixed':_0x1bd544['SentimentScore'][_0xb453('0x30')],'sNeutral':_0x1bd544[_0xb453('0x2e')][_0xb453('0x31')]});})['then'](function(){logger[_0xb453('0x11')](util['format'](_0xb453('0x1e'),_0x3069f1['id']));_0x5deeab();});case'FAILED':return _0x3069f1[_0xb453('0x1d')]({'transcribeStatus':_0xb453('0x32'),'failureReason':_0x376b8e[_0xb453('0x13')][_0xb453('0x33')]})[_0xb453('0x10')](function(){logger[_0xb453('0x11')](util[_0xb453('0xc')](_0xb453('0x1e'),_0x3069f1['id']));_0x5deeab();});default:logger[_0xb453('0x11')](util[_0xb453('0xc')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x3069f1['id']));break;}}else{return BPromise['resolve']()[_0xb453('0x10')](function(){if(!_0x3069f1[_0xb453('0x1f')]){throw new db[(_0xb453('0x20'))][(_0xb453('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x223bf5['sentiment']||!_0x223bf5['sentimentAccountId']||!_0x223bf5[_0xb453('0x25')]||!_0x223bf5[_0xb453('0x26')]||!_0x223bf5['bucket']){throw new db['Sequelize'][(_0xb453('0x21'))](_0xb453('0x27'));}if(!_0x3069f1['fileText']){throw new Error(_0xb453('0x34'));}if(_0x223bf5[_0xb453('0x24')]===_0x22e39b['id']){return _0x22e39b;}else{return db[_0xb453('0x28')][_0xb453('0x29')]({'where':{'id':_settings[_0xb453('0x24')]}});}})[_0xb453('0x10')](function(_0x4f062c){if(!_0x4f062c){throw new db['Sequelize'][(_0xb453('0x21'))](_0xb453('0x35'));}if(!_0x4f062c[_0xb453('0xe')]||!_0x4f062c[_0xb453('0xf')]){throw new db[(_0xb453('0x20'))][(_0xb453('0x21'))](_0xb453('0x2a'));}_0x2d24b9=_0x4f062c;logger[_0xb453('0x11')](util[_0xb453('0xc')](_0xb453('0x2b'),_0x3069f1['id']));return sentiment(_0x2d24b9[_0xb453('0xe')],_0x2d24b9[_0xb453('0xf')],_0x223bf5[_0xb453('0x25')],_0x3069f1['fileText'],_0x223bf5[_0xb453('0x26')]);})['then'](function(_0x2432be){logger[_0xb453('0x11')](util[_0xb453('0xc')](_0xb453('0x2c'),_0x3069f1['id']));return _0x3069f1[_0xb453('0x1d')]({'sentiment':_0x2432be[_0xb453('0x2d')],'sPositive':_0x2432be[_0xb453('0x2e')][_0xb453('0x2f')],'sNegative':_0x2432be['SentimentScore'][_0xb453('0x36')],'sMixed':_0x2432be[_0xb453('0x2e')][_0xb453('0x30')],'sNeutral':_0x2432be[_0xb453('0x2e')][_0xb453('0x31')],'transcribeStatus':_0xb453('0x37')});})[_0xb453('0x10')](function(){logger[_0xb453('0x11')](util[_0xb453('0xc')](_0xb453('0x1e'),_0x3069f1['id']));_0x5deeab();});}})['catch'](function(_0x12cd2e){if(_0x12cd2e){if(!_0x12cd2e[_0xb453('0x38')]||_0x12cd2e['name']!==_0xb453('0x39')){logger[_0xb453('0x3a')](util[_0xb453('0xc')](_0xb453('0x3b'),_0x3069f1['id']),util[_0xb453('0x3c')](_0x12cd2e,{'showHidden':![],'depth':null}));}}_0x5deeab();});});}function checkTranscribe(){var _0x53cb5b;var _0xf9ed81;var _0x4090ef;return db['VoiceRecording'][_0xb453('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xb453('0x10')](function(_0x3ad942){if(!_0x3ad942||!_0x3ad942['length']){throw new db[(_0xb453('0x20'))][(_0xb453('0x21'))](_0xb453('0x3e'));}_0x53cb5b=_0x3ad942;return db[_0xb453('0x3f')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x18df8e){if(!_0x18df8e){throw new db['Sequelize']['ValidationError'](_0xb453('0x40'));}_0xf9ed81=_0x18df8e;if(!_0xf9ed81[_0xb453('0x7')]||!_0xf9ed81['transcribeAccountId']||!_0xf9ed81[_0xb453('0x41')]||!_0xf9ed81[_0xb453('0x26')]||!_0xf9ed81['bucket']){throw new db[(_0xb453('0x20'))]['ValidationError']('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0xb453('0x29')]({'where':{'id':_0xf9ed81[_0xb453('0x42')]}});})[_0xb453('0x10')](function(_0x5a534c){if(!_0x5a534c){throw new db[(_0xb453('0x20'))]['ValidationError'](_0xb453('0x35'));}if(!_0x5a534c[_0xb453('0xe')]||!_0x5a534c['data2']){throw new db[(_0xb453('0x20'))]['ValidationError'](_0xb453('0x2a'));}_0x4090ef=_0x5a534c;var _0x5c710e=[];_0x53cb5b['forEach'](function(_0x107a8a){_0x5c710e[_0xb453('0x43')](checkTranscribeJob(_0x107a8a,_0xf9ed81,_0x4090ef));});return BPromise[_0xb453('0x44')](_0x5c710e);})['catch'](function(_0x1e8dce){if(_0x1e8dce){if(!_0x1e8dce['name']||_0x1e8dce['name']!==_0xb453('0x39')){logger[_0xb453('0x3a')](util['inspect'](_0x1e8dce,{'showHidden':![],'depth':null}));}}});}exports[_0xb453('0x45')]=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 c633820..69fcfff 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 _0x9caf=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','length','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','then','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3db47b,_0x73b86b){var _0x11fd11=function(_0xab593){while(--_0xab593){_0x3db47b['push'](_0x3db47b['shift']());}};_0x11fd11(++_0x73b86b);}(_0x9caf,0x1ac));var _0xf9ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9caf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf9ca('0x0'));var moment=require(_0xf9ca('0x1'));var Redis=require(_0xf9ca('0x2'));var util=require(_0xf9ca('0x3'));var config=require('../../config/environment');var db=require(_0xf9ca('0x4'))['db'];var logger=require(_0xf9ca('0x5'))(_0xf9ca('0x6'));config['redis']=_[_0xf9ca('0x7')](config[_0xf9ca('0x8')],{'host':_0xf9ca('0x9'),'port':0x18eb});var io=require(_0xf9ca('0xa'))(new Redis(config[_0xf9ca('0x8')]));function closeInteractions(){var _0x1b0015=[];return db['WhatsappInteraction'][_0xf9ca('0xb')]({'raw':!![],'attributes':['id',_0xf9ca('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf9ca('0xd')](0x18,'hours')}}})[_0xf9ca('0xe')](function(_0xc9c2c7){if(_0xc9c2c7&&_0xc9c2c7['length']){_0x1b0015=_['map'](_0xc9c2c7||[],'id');logger[_0xf9ca('0xf')](_0xf9ca('0x10'),_0x1b0015['join']());return db[_0xf9ca('0x11')][_0xf9ca('0x12')]({'closeReason':_0xf9ca('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xf9ca('0x14')](_0xf9ca('0x15'))},{'where':{'id':_0x1b0015}});}})[_0xf9ca('0xe')](function(){if(_0x1b0015&&_0x1b0015['length']){logger[_0xf9ca('0xf')](_0xf9ca('0x16'),_0x1b0015[_0xf9ca('0x17')]());for(var _0x57d668=0x0;_0x57d668<_0x1b0015[_0xf9ca('0x18')];_0x57d668++){io[_0xf9ca('0x19')](_0xf9ca('0x1a'),{'id':_0x1b0015[_0x57d668],'closed':!![]});}}})[_0xf9ca('0x1b')](function(_0x277cff){logger['error'](_0xf9ca('0x1c'),_0x277cff?util['inspect'](_0x277cff,{'showHidden':![],'depth':null}):'');});}exports[_0xf9ca('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3cfa=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','info'];(function(_0x57c11b,_0x43221f){var _0x435ffc=function(_0x32fe12){while(--_0x32fe12){_0x57c11b['push'](_0x57c11b['shift']());}};_0x435ffc(++_0x43221f);}(_0x3cfa,0x14e));var _0xa3cf=function(_0x83574e,_0x569dc9){_0x83574e=_0x83574e-0x0;var _0x5b80b6=_0x3cfa[_0x83574e];return _0x5b80b6;};'use strict';var _=require(_0xa3cf('0x0'));var moment=require(_0xa3cf('0x1'));var Redis=require(_0xa3cf('0x2'));var util=require(_0xa3cf('0x3'));var config=require('../../config/environment');var db=require(_0xa3cf('0x4'))['db'];var logger=require(_0xa3cf('0x5'))(_0xa3cf('0x6'));config[_0xa3cf('0x7')]=_['defaults'](config[_0xa3cf('0x7')],{'host':_0xa3cf('0x8'),'port':0x18eb});var io=require(_0xa3cf('0x9'))(new Redis(config[_0xa3cf('0x7')]));function closeInteractions(){var _0x4214c4=[];return db[_0xa3cf('0xa')][_0xa3cf('0xb')]({'raw':!![],'attributes':['id',_0xa3cf('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa3cf('0xd')](0x18,_0xa3cf('0xe'))}}})[_0xa3cf('0xf')](function(_0x10db6c){if(_0x10db6c&&_0x10db6c[_0xa3cf('0x10')]){_0x4214c4=_['map'](_0x10db6c||[],'id');logger[_0xa3cf('0x11')](_0xa3cf('0x12'),_0x4214c4[_0xa3cf('0x13')]());return db[_0xa3cf('0xa')]['update']({'closeReason':_0xa3cf('0x14'),'disposition':_0xa3cf('0x15'),'closed':!![],'closedAt':moment()[_0xa3cf('0x16')](_0xa3cf('0x17'))},{'where':{'id':_0x4214c4}});}})[_0xa3cf('0xf')](function(){if(_0x4214c4&&_0x4214c4[_0xa3cf('0x10')]){logger[_0xa3cf('0x11')](_0xa3cf('0x18'),_0x4214c4[_0xa3cf('0x13')]());for(var _0x53e06b=0x0;_0x53e06b<_0x4214c4[_0xa3cf('0x10')];_0x53e06b++){io[_0xa3cf('0x19')](_0xa3cf('0x1a'),{'id':_0x4214c4[_0x53e06b],'closed':!![]});}}})[_0xa3cf('0x1b')](function(_0x3d2679){logger[_0xa3cf('0x1c')](_0xa3cf('0x1d'),_0x3d2679?util[_0xa3cf('0x1e')](_0x3d2679,{'showHidden':![],'depth':null}):'');});}exports[_0xa3cf('0x1f')]=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 ffe7acb..58113da 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0a2=['bulkCreate','then','log','finished\x20populating','CmHopper','contacts2','hopper2','util','../mysqldb','innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','destroy'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xd0a2,0x97));var _0x2d0a=function(_0x1419f6,_0x4180de){_0x1419f6=_0x1419f6-0x0;var _0x5b07c7=_0xd0a2[_0x1419f6];return _0x5b07c7;};'use strict';var util=require(_0x2d0a('0x0'));var db=require(_0x2d0a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x2d0a('0x2')+i+_0x2d0a('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2d0a('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x2d0a('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2d0a('0x5')](),'updatedAt':Date[_0x2d0a('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2d0a('0x4')]({'id':i,'firstName':_0x2d0a('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x2d0a('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2d0a('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x2d0a('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2d0a('0x5')](),'updatedAt':Date[_0x2d0a('0x5')]()});}db[_0x2d0a('0x7')][_0x2d0a('0x8')]({'where':{}})['then'](function(){return db[_0x2d0a('0x7')][_0x2d0a('0x9')](contacts);})[_0x2d0a('0xa')](function(){console[_0x2d0a('0xb')](_0x2d0a('0xc'),'contacts1');return db[_0x2d0a('0xd')]['destroy']({'where':{}});})[_0x2d0a('0xa')](function(){return db[_0x2d0a('0xd')][_0x2d0a('0x9')](hopper);})['then'](function(){console['log'](_0x2d0a('0xc'),'hopper1');return db[_0x2d0a('0x7')][_0x2d0a('0x9')](contacts2);})[_0x2d0a('0xa')](function(){console[_0x2d0a('0xb')](_0x2d0a('0xc'),_0x2d0a('0xe'));return db[_0x2d0a('0xd')]['bulkCreate'](hopper2);})[_0x2d0a('0xa')](function(){console[_0x2d0a('0xb')](_0x2d0a('0xc'),_0x2d0a('0xf'));})['catch'](function(_0x283717){console[_0x2d0a('0xb')](_0x283717);}); \ No newline at end of file +var _0x6b19=['finished\x20populating','contacts1','CmHopper','destroy','log','hopper1','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then'];(function(_0x42fbfc,_0x206329){var _0x3ee693=function(_0x5c6fb1){while(--_0x5c6fb1){_0x42fbfc['push'](_0x42fbfc['shift']());}};_0x3ee693(++_0x206329);}(_0x6b19,0x125));var _0x96b1=function(_0x5a807c,_0x17be4f){_0x5a807c=_0x5a807c-0x0;var _0x4c5ccb=_0x6b19[_0x5a807c];return _0x4c5ccb;};'use strict';var util=require(_0x96b1('0x0'));var db=require(_0x96b1('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x96b1('0x2')]({'id':i,'firstName':_0x96b1('0x3')+i,'lastName':_0x96b1('0x4')+i,'phone':0xf879fb460+i,'email':_0x96b1('0x5')+i+_0x96b1('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x96b1('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x96b1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x96b1('0x7')](),'updatedAt':Date[_0x96b1('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x96b1('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x96b1('0x4')+i,'phone':0xf879fb460+i,'email':_0x96b1('0x5')+i+_0x96b1('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x96b1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x96b1('0x7')](),'updatedAt':Date[_0x96b1('0x7')]()});}db[_0x96b1('0x8')]['destroy']({'where':{}})['then'](function(){return db[_0x96b1('0x8')][_0x96b1('0x9')](contacts);})[_0x96b1('0xa')](function(){console['log'](_0x96b1('0xb'),_0x96b1('0xc'));return db[_0x96b1('0xd')][_0x96b1('0xe')]({'where':{}});})[_0x96b1('0xa')](function(){return db['CmHopper'][_0x96b1('0x9')](hopper);})[_0x96b1('0xa')](function(){console[_0x96b1('0xf')]('finished\x20populating',_0x96b1('0x10'));return db['CmContact'][_0x96b1('0x9')](contacts2);})[_0x96b1('0xa')](function(){console['log'](_0x96b1('0xb'),'contacts2');return db['CmHopper']['bulkCreate'](hopper2);})[_0x96b1('0xa')](function(){console[_0x96b1('0xf')](_0x96b1('0xb'),_0x96b1('0x11'));})[_0x96b1('0x12')](function(_0x20062b){console[_0x96b1('0xf')](_0x20062b);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 2ea1632..b4b1859 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb25c=['bulkCreate','log','add\x20user','catch','util','../mysqldb','%s%s','agent','format','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0xb25c,0x147));var _0xcb25=function(_0x9aa099,_0x550266){_0x9aa099=_0x9aa099-0x0;var _0x196049=_0xb25c[_0x9aa099];return _0x196049;};'use strict';var util=require(_0xcb25('0x0'));var db=require(_0xcb25('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xcb25('0x2'),_0xcb25('0x3'),i),'fullname':util[_0xcb25('0x4')](_0xcb25('0x2'),_0xcb25('0x3'),i),'email':util[_0xcb25('0x4')]('%s%s@xcally.com',_0xcb25('0x3'),i),'role':'agent','password':_0xcb25('0x5'),'internal':0xfa0+i,'type':_0xcb25('0x6'),'transport':[_0xcb25('0x7'),'ws',_0xcb25('0x8')],'disallow':[_0xcb25('0x9')],'allow':[_0xcb25('0xa')],'defaultuser':util[_0xcb25('0x4')](_0xcb25('0x2'),'agent',i),'encryption':'yes','avpf':_0xcb25('0xb'),'force_avp':_0xcb25('0xb'),'icesupport':_0xcb25('0xb'),'dtlsenable':_0xcb25('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xcb25('0xc'),'dtlssetup':_0xcb25('0xd'),'callerid':util[_0xcb25('0x4')](_0xcb25('0xe'),util['format'](_0xcb25('0x2'),_0xcb25('0x3'),i),0xfa0+i)});}db['User'][_0xcb25('0xf')](users)['then'](function(){console[_0xcb25('0x10')](_0xcb25('0x11'));})[_0xcb25('0x12')](function(_0x4d4cf7){console['log'](_0x4d4cf7);}); \ No newline at end of file +var _0x5d5f=['log','add\x20user','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then'];(function(_0x4876b6,_0x7321aa){var _0x583251=function(_0x30f43a){while(--_0x30f43a){_0x4876b6['push'](_0x4876b6['shift']());}};_0x583251(++_0x7321aa);}(_0x5d5f,0x106));var _0xf5d5=function(_0x14bc4f,_0x5cdfb3){_0x14bc4f=_0x14bc4f-0x0;var _0x485d53=_0x5d5f[_0x14bc4f];return _0x485d53;};'use strict';var util=require(_0xf5d5('0x0'));var db=require(_0xf5d5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf5d5('0x2')]({'name':util[_0xf5d5('0x3')]('%s%s',_0xf5d5('0x4'),i),'fullname':util[_0xf5d5('0x3')](_0xf5d5('0x5'),'agent',i),'email':util[_0xf5d5('0x3')](_0xf5d5('0x6'),'agent',i),'role':_0xf5d5('0x4'),'password':'password','internal':0xfa0+i,'type':_0xf5d5('0x7'),'transport':[_0xf5d5('0x8'),'ws','wss'],'disallow':[_0xf5d5('0x9')],'allow':[_0xf5d5('0xa')],'defaultuser':util[_0xf5d5('0x3')](_0xf5d5('0x5'),_0xf5d5('0x4'),i),'encryption':_0xf5d5('0xb'),'avpf':_0xf5d5('0xb'),'force_avp':'yes','icesupport':_0xf5d5('0xb'),'dtlsenable':_0xf5d5('0xb'),'dtlsverify':'no','dtlscertfile':_0xf5d5('0xc'),'dtlsprivatekey':_0xf5d5('0xd'),'dtlssetup':_0xf5d5('0xe'),'callerid':util[_0xf5d5('0x3')]('\x22%s\x22\x20<%s>',util[_0xf5d5('0x3')](_0xf5d5('0x5'),_0xf5d5('0x4'),i),0xfa0+i)});}db[_0xf5d5('0xf')][_0xf5d5('0x10')](users)[_0xf5d5('0x11')](function(){console[_0xf5d5('0x12')](_0xf5d5('0x13'));})['catch'](function(_0x1fbb17){console['log'](_0x1fbb17);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index f8c23a0..fe9e9f1 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7461=['trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','user_has_whatsapp_interactions:remove','forceLogout','forceLoginByid','log','getAgentKey','findOne','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','set-disconnect-options','merge','CONNECTED','lodash','util','./logger','app','find','disconnectionTimeout','then','name','Agents','User','role','agent','type','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','UserProfileResource','resourceId','map','where','telephone','ivr','format','%s:queue:%s','length','user:%s','catch','get','_expire','incr','decr','handshake','query','userProfileId','online','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','Trunk','voice:outbound','FaxQueues','WhatsappQueue','Telephones','Trunks','IvrCampaigns','Campaign','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s'];(function(_0xcd74c6,_0x14724d){var _0x1a2d55=function(_0x57f8fe){while(--_0x57f8fe){_0xcd74c6['push'](_0xcd74c6['shift']());}};_0x1a2d55(++_0x14724d);}(_0x7461,0x177));var _0x1746=function(_0xa8a57e,_0x27295c){_0xa8a57e=_0xa8a57e-0x0;var _0x53244c=_0x7461[_0xa8a57e];return _0x53244c;};'use strict';var _=require(_0x1746('0x0'));var util=require(_0x1746('0x1'));var db=require('../mysqldb')['db'];var auth=require('./schedule/auth');var logger=require(_0x1746('0x2'))(_0x1746('0x3'));var pub;var usersDisconnectionOptions={};function getDisconnectionTimeout(){return db['Setting'][_0x1746('0x4')]({'attributes':['id',_0x1746('0x5')],'where':{'id':0x1}})[_0x1746('0x6')](function(_0x3e7fc5){return _0x3e7fc5[_0x1746('0x5')];});}var queryQueues={'attributes':['id',_0x1746('0x7')],'include':[{'as':_0x1746('0x8'),'model':db[_0x1746('0x9')],'attributes':['id',_0x1746('0x7'),_0x1746('0xa')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1746('0x7')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x1746('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x1746('0x7')],'where':{'role':_0x1746('0xb')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1746('0x7'),_0x1746('0xc')],'where':{'type':'ivr'}};function getAssociatedResources(_0x456d43,_0x51fbe5,_0x4d92ec){return db[_0x1746('0xd')]['findOne']({'where':{'name':_0x456d43,'userProfileId':_0x51fbe5},'raw':!![]})[_0x1746('0x6')](function(_0x4b2bf1){if(_0x4b2bf1){if(_0x4b2bf1[_0x1746('0xe')]){switch(_0x456d43){case _0x1746('0xf'):case _0x1746('0x10'):case'FaxQueues':case _0x1746('0x11'):case _0x1746('0x12'):case _0x1746('0x13'):case _0x1746('0x14'):return db[_0x4d92ec]['findAll'](queryQueues);case'Telephones':return db[_0x4d92ec][_0x1746('0x15')](queryTelephones);case'Trunks':return db[_0x4d92ec][_0x1746('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x4d92ec][_0x1746('0x15')](queryCampaigns);}}else{return db[_0x1746('0x16')][_0x1746('0x15')]({'attributes':[_0x1746('0x17')],'where':{'sectionId':_0x4b2bf1['id']},'raw':!![]})['then'](function(_0x2ccb45){if(_0x2ccb45){var _0x50cdd3={'where':{'id':_[_0x1746('0x18')](_0x2ccb45,_0x1746('0x17'))},'raw':!![]};switch(_0x4d92ec){case'User':_0x50cdd3[_0x1746('0x19')]['role']=_0x1746('0x1a');break;case'Campaign':_0x50cdd3['where'][_0x1746('0xc')]=_0x1746('0x1b');break;}return db[_0x4d92ec][_0x1746('0x15')](_0x50cdd3);}else{return[];}});}}else{return[];}})[_0x1746('0x6')](function(_0x53f630){return _0x53f630;});}function joinOrLeaveQueues(_0x73f611,_0x4015de,_0x4d92be,_0x22d494){_0x73f611[_0x4015de](util[_0x1746('0x1c')](_0x1746('0x1d'),_0x4d92be,_0x22d494[_0x1746('0x7')]));if(_0x22d494[_0x1746('0x8')]){for(var _0x500b34=0x0;_0x500b34<_0x22d494['Agents'][_0x1746('0x1e')];_0x500b34+=0x1){_0x73f611[_0x4015de](util[_0x1746('0x1c')](_0x1746('0x1f'),_0x22d494[_0x1746('0x8')][_0x500b34][_0x1746('0x7')]));}}}function removeExpireKey(_0x4dad31){return pub['del'](_0x4dad31)[_0x1746('0x6')](function(_0x43a68d){return _0x43a68d>0x0?!![]:![];})[_0x1746('0x20')](function(){return![];});}function incrementConnectionCounter(_0x440447){return new Promise(function(_0x5bc0f3,_0x2fce78){var _0x4a427a=getAgentKey(_0x440447);pub[_0x1746('0x21')](_0x4a427a,function(_0x1df948,_0x2a04c7){if(_0x1df948)return _0x2fce78(_0x1df948);return removeExpireKey(_0x4a427a+_0x1746('0x22'))[_0x1746('0x6')](function(_0x3710ec){if(_0x3710ec)return _0x2a04c7;return pub[_0x1746('0x23')](_0x4a427a);})[_0x1746('0x6')](function(_0x558f6a){_0x5bc0f3(_0x558f6a);})['catch'](function(_0x5b3381){return _0x2fce78(_0x5b3381);});});});}function decrementConnectionCounter(_0x27c3d4){return new Promise(function(_0x330c2a,_0x47940c){var _0x15aca3=getAgentKey(_0x27c3d4);pub[_0x1746('0x21')](_0x15aca3,function(_0x45a1ce,_0x432881){if(_0x45a1ce)return _0x47940c(_0x45a1ce);if(_['isNil'](_0x432881))return 0x0;if(parseInt(_0x432881)===0x0)return 0x0;return pub[_0x1746('0x24')](_0x15aca3)[_0x1746('0x6')](function(_0x182caf){_0x330c2a(_0x182caf);})[_0x1746('0x20')](function(_0x37395e){return _0x47940c(_0x37395e);});});});}function joinOrLeave(_0x43a940,_0x3c7e51,_0x997129){var _0x2a0199;if(_0x43a940[_0x1746('0x25')][_0x1746('0x26')]['id']){db[_0x1746('0x9')]['find']({'attributes':['id',_0x1746('0x7'),_0x1746('0xa'),_0x1746('0x27'),_0x1746('0x28'),'internal'],'where':{'id':_0x43a940[_0x1746('0x25')][_0x1746('0x26')]['id']},'include':[{'model':db[_0x1746('0x29')],'as':_0x1746('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x1746('0x2b')],'as':_0x1746('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x1746('0x2d')],'as':_0x1746('0x2e'),'attributes':['id'],'raw':!![]},{'model':db[_0x1746('0x2f')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1746('0x30')],'as':_0x1746('0x31'),'attributes':['id'],'raw':!![]},{'model':db[_0x1746('0x32')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x1746('0x6')](function(_0x103018){if(_0x103018){_0x2a0199=_0x103018;_0x43a940[_0x3c7e51](util[_0x1746('0x1c')](_0x1746('0x1f'),_0x103018[_0x1746('0x7')]));var _0x2fc262=[];switch(_0x103018[_0x1746('0xa')]){case'admin':_0x43a940[_0x3c7e51](_0x1746('0x33'));_0x43a940[_0x3c7e51]('voice:outbound');if(queryQueues[_0x1746('0x34')](_0x1746('0x35'))){delete queryQueues[_0x1746('0x35')];}_0x2fc262[_0x1746('0x36')](db[_0x1746('0x37')][_0x1746('0x15')](queryQueues));_0x2fc262[_0x1746('0x36')](db[_0x1746('0x38')][_0x1746('0x15')](queryQueues));_0x2fc262[_0x1746('0x36')](db[_0x1746('0x39')][_0x1746('0x15')](queryQueues));_0x2fc262['push'](db[_0x1746('0x3a')]['findAll'](queryQueues));_0x2fc262[_0x1746('0x36')](db[_0x1746('0x3b')]['findAll'](queryQueues));_0x2fc262[_0x1746('0x36')](db['OpenchannelQueue'][_0x1746('0x15')](queryQueues));_0x2fc262[_0x1746('0x36')](db['WhatsappQueue'][_0x1746('0x15')](queryQueues));_0x2fc262['push'](db[_0x1746('0x9')][_0x1746('0x15')](queryTelephones));_0x2fc262['push'](db[_0x1746('0x3c')][_0x1746('0x15')](queryTrunks));_0x2fc262[_0x1746('0x36')](db['Campaign']['findAll'](queryCampaigns));_0x2fc262[_0x1746('0x36')](db[_0x1746('0x9')][_0x1746('0x15')](queryAgents));break;case'user':_0x43a940[_0x3c7e51]('voice:inbound');_0x43a940[_0x3c7e51](_0x1746('0x3d'));_0x2fc262[_0x1746('0x36')](getAssociatedResources(_0x1746('0xf'),_0x103018[_0x1746('0x27')],_0x1746('0x37')));_0x2fc262['push'](getAssociatedResources(_0x1746('0x10'),_0x103018[_0x1746('0x27')],_0x1746('0x38')));_0x2fc262[_0x1746('0x36')](getAssociatedResources(_0x1746('0x3e'),_0x103018['userProfileId'],_0x1746('0x39')));_0x2fc262['push'](getAssociatedResources(_0x1746('0x11'),_0x103018[_0x1746('0x27')],_0x1746('0x3a')));_0x2fc262['push'](getAssociatedResources('MailQueues',_0x103018['userProfileId'],_0x1746('0x3b')));_0x2fc262[_0x1746('0x36')](getAssociatedResources('OpenchannelQueues',_0x103018[_0x1746('0x27')],'OpenchannelQueue'));_0x2fc262['push'](getAssociatedResources(_0x1746('0x14'),_0x103018[_0x1746('0x27')],_0x1746('0x3f')));_0x2fc262['push'](getAssociatedResources(_0x1746('0x40'),_0x103018[_0x1746('0x27')],_0x1746('0x9')));_0x2fc262[_0x1746('0x36')](getAssociatedResources(_0x1746('0x41'),_0x103018[_0x1746('0x27')],_0x1746('0x3c')));_0x2fc262[_0x1746('0x36')](getAssociatedResources(_0x1746('0x42'),_0x103018[_0x1746('0x27')],_0x1746('0x43')));_0x2fc262[_0x1746('0x36')](db[_0x1746('0x9')][_0x1746('0x15')](queryAgents));break;case _0x1746('0xb'):_0x43a940[_0x3c7e51](_0x1746('0x33'));_0x43a940[_0x3c7e51](_0x1746('0x3d'));_0x2fc262[_0x1746('0x36')](_0x103018[_0x1746('0x44')]({'attributes':['id',_0x1746('0x7')]}));_0x2fc262[_0x1746('0x36')](_0x103018[_0x1746('0x45')]({'attributes':['id',_0x1746('0x7')]}));_0x2fc262['push'](_0x103018[_0x1746('0x46')]({'attributes':['id',_0x1746('0x7')]}));_0x2fc262[_0x1746('0x36')](_0x103018[_0x1746('0x47')]({'attributes':['id',_0x1746('0x7')]}));_0x2fc262['push'](_0x103018['getMailQueues']({'attributes':['id',_0x1746('0x7')]}));_0x2fc262[_0x1746('0x36')](_0x103018['getOpenchannelQueues']({'attributes':['id','name']}));_0x2fc262['push'](_0x103018[_0x1746('0x48')]({'attributes':['id',_0x1746('0x7')]}));break;}return Promise[_0x1746('0x49')](_0x2fc262);}})[_0x1746('0x6')](function(_0x34f764){if(_0x34f764&&_0x34f764[_0x1746('0x1e')]){for(var _0xfd094d=0x0;_0xfd094d<_0x34f764[_0x1746('0x1e')];_0xfd094d+=0x1){for(var _0x233188=0x0;_0x233188<_0x34f764[_0xfd094d][_0x1746('0x1e')];_0x233188+=0x1){switch(_0xfd094d){case 0x0:joinOrLeaveQueues(_0x43a940,_0x3c7e51,_0x1746('0x4a'),_0x34f764[_0xfd094d][_0x233188]);break;case 0x1:joinOrLeaveQueues(_0x43a940,_0x3c7e51,_0x1746('0x4b'),_0x34f764[_0xfd094d][_0x233188]);break;case 0x2:joinOrLeaveQueues(_0x43a940,_0x3c7e51,_0x1746('0x4c'),_0x34f764[_0xfd094d][_0x233188]);break;case 0x3:joinOrLeaveQueues(_0x43a940,_0x3c7e51,_0x1746('0x4d'),_0x34f764[_0xfd094d][_0x233188]);break;case 0x4:joinOrLeaveQueues(_0x43a940,_0x3c7e51,_0x1746('0x4e'),_0x34f764[_0xfd094d][_0x233188]);break;case 0x5:joinOrLeaveQueues(_0x43a940,_0x3c7e51,_0x1746('0x4f'),_0x34f764[_0xfd094d][_0x233188]);break;case 0x6:joinOrLeaveQueues(_0x43a940,_0x3c7e51,'whatsapp',_0x34f764[_0xfd094d][_0x233188]);break;case 0x7:if(_0x2a0199['role']!==_0x1746('0xb'))_0x43a940[_0x3c7e51](util[_0x1746('0x1c')](_0x1746('0x50'),_0x34f764[_0xfd094d][_0x233188]['name']));break;case 0x8:if(_0x2a0199[_0x1746('0xa')]!=='agent')_0x43a940[_0x3c7e51](util[_0x1746('0x1c')](_0x1746('0x51'),_0x34f764[_0xfd094d][_0x233188][_0x1746('0x7')]));break;case 0x9:if(_0x2a0199[_0x1746('0xa')]!==_0x1746('0xb'))_0x43a940[_0x3c7e51](util[_0x1746('0x1c')](_0x1746('0x52'),_0x34f764[_0xfd094d][_0x233188][_0x1746('0xc')],_0x34f764[_0xfd094d][_0x233188][_0x1746('0x7')]));break;case 0xa:_0x43a940[_0x3c7e51](util['format'](_0x1746('0x1f'),_0x34f764[_0xfd094d][_0x233188][_0x1746('0x7')]));break;}}}}})['then'](function(){if(_0x3c7e51===_0x1746('0x53')){var _0x3a5854=_['map'](_0x2a0199[_0x1746('0x2a')],'id');return _0x2a0199[_0x1746('0x54')](_0x3a5854)['then'](function(){for(var _0x78fefd=0x0;_0x78fefd<_0x3a5854['length'];_0x78fefd+=0x1){_0x997129[_0x1746('0x55')](_0x1746('0x56'),{'ChatInteractionId':Number(_0x3a5854[_0x78fefd]),'UserId':Number(_0x2a0199['id'])});}});}})[_0x1746('0x6')](function(){if(_0x3c7e51==='leave'){var _0x941fec=_[_0x1746('0x18')](_0x2a0199['MailInteractions'],'id');return _0x2a0199['removeMailInteractions'](_0x941fec)[_0x1746('0x6')](function(){for(var _0x358a00=0x0;_0x358a00<_0x941fec[_0x1746('0x1e')];_0x358a00+=0x1){_0x997129[_0x1746('0x55')](_0x1746('0x57'),{'MailInteractionId':Number(_0x941fec[_0x358a00]),'UserId':Number(_0x2a0199['id'])});}});}})[_0x1746('0x6')](function(){if(_0x3c7e51===_0x1746('0x53')){var _0xe81b3c=_[_0x1746('0x18')](_0x2a0199[_0x1746('0x2e')],'id');return _0x2a0199[_0x1746('0x58')](_0xe81b3c)[_0x1746('0x6')](function(){for(var _0x1c8303=0x0;_0x1c8303<_0xe81b3c[_0x1746('0x1e')];_0x1c8303+=0x1){_0x997129[_0x1746('0x55')](_0x1746('0x59'),{'FaxInteractionId':Number(_0xe81b3c[_0x1c8303]),'UserId':Number(_0x2a0199['id'])});}});}})[_0x1746('0x6')](function(){if(_0x3c7e51===_0x1746('0x53')){var _0x5c863d=_[_0x1746('0x18')](_0x2a0199[_0x1746('0x5a')],'id');return _0x2a0199[_0x1746('0x5b')](_0x5c863d)['then'](function(){for(var _0x40dd7c=0x0;_0x40dd7c<_0x5c863d['length'];_0x40dd7c+=0x1){_0x997129[_0x1746('0x55')](_0x1746('0x5c'),{'SmsInteractionId':Number(_0x5c863d[_0x40dd7c]),'UserId':Number(_0x2a0199['id'])});}});}})[_0x1746('0x6')](function(){if(_0x3c7e51===_0x1746('0x53')){var _0x4bf68a=_[_0x1746('0x18')](_0x2a0199[_0x1746('0x31')],'id');return _0x2a0199[_0x1746('0x5d')](_0x4bf68a)[_0x1746('0x6')](function(){for(var _0xf9e2d0=0x0;_0xf9e2d0<_0x4bf68a[_0x1746('0x1e')];_0xf9e2d0+=0x1){_0x997129[_0x1746('0x55')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x4bf68a[_0xf9e2d0]),'UserId':Number(_0x2a0199['id'])});}});}})[_0x1746('0x6')](function(){if(_0x3c7e51===_0x1746('0x53')){var _0x142116=_[_0x1746('0x18')](_0x2a0199[_0x1746('0x5e')],'id');return _0x2a0199['removeWhatsappInteractions'](_0x142116)['then'](function(){for(var _0x169d87=0x0;_0x169d87<_0x142116[_0x1746('0x1e')];_0x169d87+=0x1){_0x997129['emit'](_0x1746('0x5f'),{'WhatsappInteractionId':Number(_0x142116[_0x169d87]),'UserId':Number(_0x2a0199['id'])});}});}})[_0x1746('0x6')](function(){if(_0x2a0199[_0x1746('0xa')]!==_0x1746('0xb'))return;return _0x3c7e51==='join'?incrementConnectionCounter(_0x2a0199):decrementConnectionCounter(_0x2a0199);})[_0x1746('0x6')](function(_0x4e1eb3){if(_0x2a0199[_0x1746('0xa')]!==_0x1746('0xb'))return;if(_0x3c7e51==='leave'){if(_0x4e1eb3===0x0){if(usersDisconnectionOptions[_0x2a0199['id']]&&usersDisconnectionOptions[_0x2a0199['id']][_0x1746('0x60')]){delete usersDisconnectionOptions[_0x2a0199['id']];return;}return getDisconnectionTimeout()[_0x1746('0x6')](function(_0x1f97e0){var _0x23de09=_0x1f97e0*0x3c;var _0x367f80=getAgentKey(_0x2a0199);pub['set'](_0x367f80+_0x1746('0x22'),_0x23de09,'EX',_0x23de09);});}}else{if(_0x2a0199['online'])return;return auth[_0x1746('0x61')](_0x2a0199);}})[_0x1746('0x20')](function(_0x20dceb){_0x43a940[_0x1746('0x62')](_0x20dceb);});}}function onDisconnect(_0x5dda8f,_0x11469e){joinOrLeave(_0x5dda8f,_0x1746('0x53'),_0x11469e);}function onConnect(_0x2d8584,_0x314351){joinOrLeave(_0x2d8584,'join',_0x314351);}function getAgentKey(_0x1bc380){return _0x1bc380['id']+':'+_0x1bc380[_0x1746('0x7')];}exports[_0x1746('0x63')]=getAgentKey;exports['checkUserIsOnline']=function(_0x54abac){return db['User'][_0x1746('0x64')]({'attributes':['id',_0x1746('0x7'),_0x1746('0x28')],'where':{'id':_0x54abac['id']},'raw':!![]})[_0x1746('0x6')](function(_0x39e52c){if(!_0x39e52c||!_0x39e52c[_0x1746('0x28')])return;var _0x486fc2=getAgentKey(_0x39e52c);pub['del'](_0x486fc2);return auth['forceLogoutByid'](_0x39e52c);})[_0x1746('0x20')](function(_0x57ec41){logger['error'](_0x57ec41);});};exports[_0x1746('0x65')]=function(_0x191812,_0x2cbfdc){pub=_0x2cbfdc;_0x191812['on'](_0x1746('0x66'),function(_0x2b7a54){_0x2b7a54[_0x1746('0x67')](0x0);_0x2b7a54[_0x1746('0x68')]=_0x2b7a54[_0x1746('0x69')]['connection'][_0x1746('0x6a')]+':'+_0x2b7a54['request'][_0x1746('0x66')][_0x1746('0x6b')];_0x2b7a54[_0x1746('0x6c')]=new Date();_0x2b7a54['log']=function(_0x3fabb1){console[_0x1746('0x62')](_0x1746('0x6d')+_0x2b7a54['nsp'][_0x1746('0x7')]+'['+_0x2b7a54[_0x1746('0x68')]+']',_0x3fabb1);};_0x2b7a54['on'](_0x1746('0x6e'),function(){onDisconnect(_0x2b7a54,_0x191812);_0x2b7a54[_0x1746('0x62')]('DISCONNECTED');});_0x2b7a54['on'](_0x1746('0x6f'),function(_0xc5c3ab,_0x48c0ab){if(!_0xc5c3ab['userId'])return _0x48c0ab();var _0x43a091={[_0xc5c3ab['userId']]:{'forceLogout':_0xc5c3ab[_0x1746('0x60')]}};usersDisconnectionOptions=_[_0x1746('0x70')](usersDisconnectionOptions,_0x43a091);return _0x48c0ab();});onConnect(_0x2b7a54,_0x191812);_0x2b7a54['log'](_0x1746('0x71'));});}; \ No newline at end of file +var _0xdb3e=['ivr','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','Campaign','where','format','%s:queue:%s','length','del','catch','_expire','incr','get','isNil','decr','query','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','FaxQueue','MailQueue','WhatsappQueue','Trunk','user','ChatQueue','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','join','forceLogout','set','online','forceLoginByid','log','getAgentKey','checkUserIsOnline','findOne','error','default','connection','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','set-disconnect-options','userId','merge','CONNECTED','lodash','util','../mysqldb','./logger','app','Setting','find','then','name','Agents','User','role','agent','type'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xdb3e,0x151));var _0xedb3=function(_0x11354e,_0x25827d){_0x11354e=_0x11354e-0x0;var _0x5dc92c=_0xdb3e[_0x11354e];return _0x5dc92c;};'use strict';var _=require(_0xedb3('0x0'));var util=require(_0xedb3('0x1'));var db=require(_0xedb3('0x2'))['db'];var auth=require('./schedule/auth');var logger=require(_0xedb3('0x3'))(_0xedb3('0x4'));var pub;var usersDisconnectionOptions={};function getDisconnectionTimeout(){return db[_0xedb3('0x5')][_0xedb3('0x6')]({'attributes':['id','disconnectionTimeout'],'where':{'id':0x1}})[_0xedb3('0x7')](function(_0x19d5ae){return _0x19d5ae['disconnectionTimeout'];});}var queryQueues={'attributes':['id',_0xedb3('0x8')],'include':[{'as':_0xedb3('0x9'),'model':db[_0xedb3('0xa')],'attributes':['id','name',_0xedb3('0xb')],'raw':!![],'where':{'role':_0xedb3('0xc')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xedb3('0x8')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xedb3('0x8')]};var queryAgents={'raw':!![],'attributes':['id',_0xedb3('0x8')],'where':{'role':_0xedb3('0xc')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xedb3('0x8'),_0xedb3('0xd')],'where':{'type':_0xedb3('0xe')}};function getAssociatedResources(_0x1e5ceb,_0x554d89,_0x315799){return db['UserProfileSection']['findOne']({'where':{'name':_0x1e5ceb,'userProfileId':_0x554d89},'raw':!![]})[_0xedb3('0x7')](function(_0x44ebde){if(_0x44ebde){if(_0x44ebde[_0xedb3('0xf')]){switch(_0x1e5ceb){case _0xedb3('0x10'):case _0xedb3('0x11'):case _0xedb3('0x12'):case _0xedb3('0x13'):case _0xedb3('0x14'):case _0xedb3('0x15'):case _0xedb3('0x16'):return db[_0x315799][_0xedb3('0x17')](queryQueues);case _0xedb3('0x18'):return db[_0x315799][_0xedb3('0x17')](queryTelephones);case _0xedb3('0x19'):return db[_0x315799][_0xedb3('0x17')](queryTrunks);case'IvrCampaigns':return db[_0x315799][_0xedb3('0x17')](queryCampaigns);}}else{return db[_0xedb3('0x1a')][_0xedb3('0x17')]({'attributes':[_0xedb3('0x1b')],'where':{'sectionId':_0x44ebde['id']},'raw':!![]})[_0xedb3('0x7')](function(_0x1ef8a4){if(_0x1ef8a4){var _0x89fc2b={'where':{'id':_[_0xedb3('0x1c')](_0x1ef8a4,_0xedb3('0x1b'))},'raw':!![]};switch(_0x315799){case _0xedb3('0xa'):_0x89fc2b['where'][_0xedb3('0xb')]='telephone';break;case _0xedb3('0x1d'):_0x89fc2b[_0xedb3('0x1e')][_0xedb3('0xd')]=_0xedb3('0xe');break;}return db[_0x315799][_0xedb3('0x17')](_0x89fc2b);}else{return[];}});}}else{return[];}})[_0xedb3('0x7')](function(_0xfad0ac){return _0xfad0ac;});}function joinOrLeaveQueues(_0x3b0e86,_0x10cc84,_0x4b0343,_0x5b9b16){_0x3b0e86[_0x10cc84](util[_0xedb3('0x1f')](_0xedb3('0x20'),_0x4b0343,_0x5b9b16[_0xedb3('0x8')]));if(_0x5b9b16[_0xedb3('0x9')]){for(var _0x1828d8=0x0;_0x1828d8<_0x5b9b16[_0xedb3('0x9')][_0xedb3('0x21')];_0x1828d8+=0x1){_0x3b0e86[_0x10cc84](util['format']('user:%s',_0x5b9b16[_0xedb3('0x9')][_0x1828d8][_0xedb3('0x8')]));}}}function removeExpireKey(_0x262492){return pub[_0xedb3('0x22')](_0x262492)[_0xedb3('0x7')](function(_0x7ddc9c){return _0x7ddc9c>0x0?!![]:![];})[_0xedb3('0x23')](function(){return![];});}function incrementConnectionCounter(_0x1511a9){return new Promise(function(_0x1cfade,_0x4dfb9){var _0xcbabd=getAgentKey(_0x1511a9);pub['get'](_0xcbabd,function(_0x2abf3f,_0x238b3f){if(_0x2abf3f)return _0x4dfb9(_0x2abf3f);return removeExpireKey(_0xcbabd+_0xedb3('0x24'))[_0xedb3('0x7')](function(_0x5153ec){if(_0x5153ec)return _0x238b3f;return pub[_0xedb3('0x25')](_0xcbabd);})[_0xedb3('0x7')](function(_0x133f0f){_0x1cfade(_0x133f0f);})[_0xedb3('0x23')](function(_0x40d234){return _0x4dfb9(_0x40d234);});});});}function decrementConnectionCounter(_0x4a8983){return new Promise(function(_0x3cc763,_0x389627){var _0x1711d9=getAgentKey(_0x4a8983);pub[_0xedb3('0x26')](_0x1711d9,function(_0x3dd70d,_0x1e4714){if(_0x3dd70d)return _0x389627(_0x3dd70d);if(_[_0xedb3('0x27')](_0x1e4714))return 0x0;if(parseInt(_0x1e4714)===0x0)return 0x0;return pub[_0xedb3('0x28')](_0x1711d9)[_0xedb3('0x7')](function(_0x46237a){_0x3cc763(_0x46237a);})['catch'](function(_0x357592){return _0x389627(_0x357592);});});});}function joinOrLeave(_0xe1d130,_0x227943,_0x14cb70){var _0x24ff2f;if(_0xe1d130['handshake'][_0xedb3('0x29')]['id']){db[_0xedb3('0xa')][_0xedb3('0x6')]({'attributes':['id',_0xedb3('0x8'),_0xedb3('0xb'),_0xedb3('0x2a'),'online','internal'],'where':{'id':_0xe1d130[_0xedb3('0x2b')][_0xedb3('0x29')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xedb3('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0xedb3('0x2d')],'as':_0xedb3('0x2e'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xedb3('0x2f'),'attributes':['id'],'raw':!![]},{'model':db[_0xedb3('0x30')],'as':_0xedb3('0x31'),'attributes':['id'],'raw':!![]},{'model':db[_0xedb3('0x32')],'as':_0xedb3('0x33'),'attributes':['id'],'raw':!![]},{'model':db[_0xedb3('0x34')],'as':_0xedb3('0x35'),'attributes':['id'],'raw':!![]}]})[_0xedb3('0x7')](function(_0x2ac41f){if(_0x2ac41f){_0x24ff2f=_0x2ac41f;_0xe1d130[_0x227943](util[_0xedb3('0x1f')](_0xedb3('0x36'),_0x2ac41f[_0xedb3('0x8')]));var _0x194128=[];switch(_0x2ac41f[_0xedb3('0xb')]){case _0xedb3('0x37'):_0xe1d130[_0x227943](_0xedb3('0x38'));_0xe1d130[_0x227943](_0xedb3('0x39'));if(queryQueues[_0xedb3('0x3a')]('include')){delete queryQueues['include'];}_0x194128[_0xedb3('0x3b')](db[_0xedb3('0x3c')][_0xedb3('0x17')](queryQueues));_0x194128[_0xedb3('0x3b')](db['ChatQueue'][_0xedb3('0x17')](queryQueues));_0x194128[_0xedb3('0x3b')](db[_0xedb3('0x3d')]['findAll'](queryQueues));_0x194128['push'](db['SmsQueue'][_0xedb3('0x17')](queryQueues));_0x194128['push'](db[_0xedb3('0x3e')][_0xedb3('0x17')](queryQueues));_0x194128[_0xedb3('0x3b')](db['OpenchannelQueue']['findAll'](queryQueues));_0x194128[_0xedb3('0x3b')](db[_0xedb3('0x3f')]['findAll'](queryQueues));_0x194128[_0xedb3('0x3b')](db[_0xedb3('0xa')][_0xedb3('0x17')](queryTelephones));_0x194128['push'](db[_0xedb3('0x40')][_0xedb3('0x17')](queryTrunks));_0x194128[_0xedb3('0x3b')](db[_0xedb3('0x1d')][_0xedb3('0x17')](queryCampaigns));_0x194128[_0xedb3('0x3b')](db[_0xedb3('0xa')][_0xedb3('0x17')](queryAgents));break;case _0xedb3('0x41'):_0xe1d130[_0x227943](_0xedb3('0x38'));_0xe1d130[_0x227943](_0xedb3('0x39'));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x10'),_0x2ac41f[_0xedb3('0x2a')],'VoiceQueue'));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x11'),_0x2ac41f['userProfileId'],_0xedb3('0x42')));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x12'),_0x2ac41f[_0xedb3('0x2a')],_0xedb3('0x3d')));_0x194128[_0xedb3('0x3b')](getAssociatedResources('SmsQueues',_0x2ac41f[_0xedb3('0x2a')],'SmsQueue'));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x14'),_0x2ac41f['userProfileId'],'MailQueue'));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x15'),_0x2ac41f[_0xedb3('0x2a')],_0xedb3('0x43')));_0x194128[_0xedb3('0x3b')](getAssociatedResources('WhatsappQueues',_0x2ac41f[_0xedb3('0x2a')],_0xedb3('0x3f')));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x18'),_0x2ac41f['userProfileId'],'User'));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x19'),_0x2ac41f[_0xedb3('0x2a')],_0xedb3('0x40')));_0x194128[_0xedb3('0x3b')](getAssociatedResources(_0xedb3('0x44'),_0x2ac41f[_0xedb3('0x2a')],_0xedb3('0x1d')));_0x194128['push'](db[_0xedb3('0xa')][_0xedb3('0x17')](queryAgents));break;case _0xedb3('0xc'):_0xe1d130[_0x227943]('voice:inbound');_0xe1d130[_0x227943](_0xedb3('0x39'));_0x194128[_0xedb3('0x3b')](_0x2ac41f[_0xedb3('0x45')]({'attributes':['id',_0xedb3('0x8')]}));_0x194128[_0xedb3('0x3b')](_0x2ac41f[_0xedb3('0x46')]({'attributes':['id',_0xedb3('0x8')]}));_0x194128[_0xedb3('0x3b')](_0x2ac41f['getFaxQueues']({'attributes':['id',_0xedb3('0x8')]}));_0x194128['push'](_0x2ac41f[_0xedb3('0x47')]({'attributes':['id','name']}));_0x194128[_0xedb3('0x3b')](_0x2ac41f['getMailQueues']({'attributes':['id',_0xedb3('0x8')]}));_0x194128[_0xedb3('0x3b')](_0x2ac41f[_0xedb3('0x48')]({'attributes':['id',_0xedb3('0x8')]}));_0x194128[_0xedb3('0x3b')](_0x2ac41f[_0xedb3('0x49')]({'attributes':['id',_0xedb3('0x8')]}));break;}return Promise[_0xedb3('0x4a')](_0x194128);}})[_0xedb3('0x7')](function(_0x5a6378){if(_0x5a6378&&_0x5a6378[_0xedb3('0x21')]){for(var _0x27a780=0x0;_0x27a780<_0x5a6378[_0xedb3('0x21')];_0x27a780+=0x1){for(var _0x494649=0x0;_0x494649<_0x5a6378[_0x27a780][_0xedb3('0x21')];_0x494649+=0x1){switch(_0x27a780){case 0x0:joinOrLeaveQueues(_0xe1d130,_0x227943,'voice',_0x5a6378[_0x27a780][_0x494649]);break;case 0x1:joinOrLeaveQueues(_0xe1d130,_0x227943,_0xedb3('0x4b'),_0x5a6378[_0x27a780][_0x494649]);break;case 0x2:joinOrLeaveQueues(_0xe1d130,_0x227943,_0xedb3('0x4c'),_0x5a6378[_0x27a780][_0x494649]);break;case 0x3:joinOrLeaveQueues(_0xe1d130,_0x227943,_0xedb3('0x4d'),_0x5a6378[_0x27a780][_0x494649]);break;case 0x4:joinOrLeaveQueues(_0xe1d130,_0x227943,_0xedb3('0x4e'),_0x5a6378[_0x27a780][_0x494649]);break;case 0x5:joinOrLeaveQueues(_0xe1d130,_0x227943,_0xedb3('0x4f'),_0x5a6378[_0x27a780][_0x494649]);break;case 0x6:joinOrLeaveQueues(_0xe1d130,_0x227943,_0xedb3('0x50'),_0x5a6378[_0x27a780][_0x494649]);break;case 0x7:if(_0x24ff2f[_0xedb3('0xb')]!=='agent')_0xe1d130[_0x227943](util[_0xedb3('0x1f')]('telephone:%s',_0x5a6378[_0x27a780][_0x494649][_0xedb3('0x8')]));break;case 0x8:if(_0x24ff2f[_0xedb3('0xb')]!==_0xedb3('0xc'))_0xe1d130[_0x227943](util[_0xedb3('0x1f')]('trunk:%s',_0x5a6378[_0x27a780][_0x494649][_0xedb3('0x8')]));break;case 0x9:if(_0x24ff2f[_0xedb3('0xb')]!=='agent')_0xe1d130[_0x227943](util[_0xedb3('0x1f')]('campaign:%s:%s',_0x5a6378[_0x27a780][_0x494649][_0xedb3('0xd')],_0x5a6378[_0x27a780][_0x494649][_0xedb3('0x8')]));break;case 0xa:_0xe1d130[_0x227943](util[_0xedb3('0x1f')](_0xedb3('0x36'),_0x5a6378[_0x27a780][_0x494649][_0xedb3('0x8')]));break;}}}}})['then'](function(){if(_0x227943===_0xedb3('0x51')){var _0x26af3b=_[_0xedb3('0x1c')](_0x24ff2f[_0xedb3('0x2c')],'id');return _0x24ff2f[_0xedb3('0x52')](_0x26af3b)['then'](function(){for(var _0x254baf=0x0;_0x254baf<_0x26af3b[_0xedb3('0x21')];_0x254baf+=0x1){_0x14cb70[_0xedb3('0x53')](_0xedb3('0x54'),{'ChatInteractionId':Number(_0x26af3b[_0x254baf]),'UserId':Number(_0x24ff2f['id'])});}});}})['then'](function(){if(_0x227943===_0xedb3('0x51')){var _0x4aa7d8=_[_0xedb3('0x1c')](_0x24ff2f[_0xedb3('0x2e')],'id');return _0x24ff2f[_0xedb3('0x55')](_0x4aa7d8)['then'](function(){for(var _0x4d6aa4=0x0;_0x4d6aa4<_0x4aa7d8[_0xedb3('0x21')];_0x4d6aa4+=0x1){_0x14cb70[_0xedb3('0x53')](_0xedb3('0x56'),{'MailInteractionId':Number(_0x4aa7d8[_0x4d6aa4]),'UserId':Number(_0x24ff2f['id'])});}});}})[_0xedb3('0x7')](function(){if(_0x227943===_0xedb3('0x51')){var _0x19cf3e=_[_0xedb3('0x1c')](_0x24ff2f['FaxInteractions'],'id');return _0x24ff2f[_0xedb3('0x57')](_0x19cf3e)['then'](function(){for(var _0x52d596=0x0;_0x52d596<_0x19cf3e[_0xedb3('0x21')];_0x52d596+=0x1){_0x14cb70[_0xedb3('0x53')](_0xedb3('0x58'),{'FaxInteractionId':Number(_0x19cf3e[_0x52d596]),'UserId':Number(_0x24ff2f['id'])});}});}})['then'](function(){if(_0x227943===_0xedb3('0x51')){var _0x1a5167=_['map'](_0x24ff2f[_0xedb3('0x31')],'id');return _0x24ff2f['removeSmsInteractions'](_0x1a5167)['then'](function(){for(var _0x4dc5c6=0x0;_0x4dc5c6<_0x1a5167[_0xedb3('0x21')];_0x4dc5c6+=0x1){_0x14cb70[_0xedb3('0x53')](_0xedb3('0x59'),{'SmsInteractionId':Number(_0x1a5167[_0x4dc5c6]),'UserId':Number(_0x24ff2f['id'])});}});}})[_0xedb3('0x7')](function(){if(_0x227943===_0xedb3('0x51')){var _0x3623a3=_[_0xedb3('0x1c')](_0x24ff2f[_0xedb3('0x33')],'id');return _0x24ff2f['removeOpenchannelInteractions'](_0x3623a3)[_0xedb3('0x7')](function(){for(var _0x323e20=0x0;_0x323e20<_0x3623a3['length'];_0x323e20+=0x1){_0x14cb70['emit'](_0xedb3('0x5a'),{'OpenchannelInteractionId':Number(_0x3623a3[_0x323e20]),'UserId':Number(_0x24ff2f['id'])});}});}})[_0xedb3('0x7')](function(){if(_0x227943===_0xedb3('0x51')){var _0x15097f=_[_0xedb3('0x1c')](_0x24ff2f[_0xedb3('0x35')],'id');return _0x24ff2f[_0xedb3('0x5b')](_0x15097f)['then'](function(){for(var _0x5cc650=0x0;_0x5cc650<_0x15097f['length'];_0x5cc650+=0x1){_0x14cb70['emit'](_0xedb3('0x5c'),{'WhatsappInteractionId':Number(_0x15097f[_0x5cc650]),'UserId':Number(_0x24ff2f['id'])});}});}})['then'](function(){if(_0x24ff2f['role']!=='agent')return;return _0x227943===_0xedb3('0x5d')?incrementConnectionCounter(_0x24ff2f):decrementConnectionCounter(_0x24ff2f);})[_0xedb3('0x7')](function(_0x484272){if(_0x24ff2f[_0xedb3('0xb')]!=='agent')return;if(_0x227943==='leave'){if(_0x484272===0x0){if(usersDisconnectionOptions[_0x24ff2f['id']]&&usersDisconnectionOptions[_0x24ff2f['id']][_0xedb3('0x5e')]){delete usersDisconnectionOptions[_0x24ff2f['id']];return;}return getDisconnectionTimeout()['then'](function(_0x5681e2){var _0x7b6932=_0x5681e2*0x3c;var _0x58b409=getAgentKey(_0x24ff2f);pub[_0xedb3('0x5f')](_0x58b409+_0xedb3('0x24'),_0x7b6932,'EX',_0x7b6932);});}}else{if(_0x24ff2f[_0xedb3('0x60')])return;return auth[_0xedb3('0x61')](_0x24ff2f);}})[_0xedb3('0x23')](function(_0xb2b755){_0xe1d130[_0xedb3('0x62')](_0xb2b755);});}}function onDisconnect(_0x4fb2b0,_0x5e3c64){joinOrLeave(_0x4fb2b0,_0xedb3('0x51'),_0x5e3c64);}function onConnect(_0x175f7e,_0x3623b0){joinOrLeave(_0x175f7e,_0xedb3('0x5d'),_0x3623b0);}function getAgentKey(_0x47176a){return _0x47176a['id']+':'+_0x47176a[_0xedb3('0x8')];}exports[_0xedb3('0x63')]=getAgentKey;exports[_0xedb3('0x64')]=function(_0x150c8f){return db[_0xedb3('0xa')][_0xedb3('0x65')]({'attributes':['id',_0xedb3('0x8'),_0xedb3('0x60')],'where':{'id':_0x150c8f['id']},'raw':!![]})[_0xedb3('0x7')](function(_0x32c880){if(!_0x32c880||!_0x32c880[_0xedb3('0x60')])return;var _0x9f4b92=getAgentKey(_0x32c880);pub[_0xedb3('0x22')](_0x9f4b92);return auth['forceLogoutByid'](_0x32c880);})[_0xedb3('0x23')](function(_0x49432a){logger[_0xedb3('0x66')](_0x49432a);});};exports[_0xedb3('0x67')]=function(_0x279123,_0x496e1e){pub=_0x496e1e;_0x279123['on'](_0xedb3('0x68'),function(_0x4b975e){_0x4b975e['setMaxListeners'](0x0);_0x4b975e[_0xedb3('0x69')]=_0x4b975e[_0xedb3('0x6a')][_0xedb3('0x68')]['remoteAddress']+':'+_0x4b975e[_0xedb3('0x6a')][_0xedb3('0x68')][_0xedb3('0x6b')];_0x4b975e[_0xedb3('0x6c')]=new Date();_0x4b975e[_0xedb3('0x62')]=function(_0x530ec7){console['log'](_0xedb3('0x6d')+_0x4b975e[_0xedb3('0x6e')][_0xedb3('0x8')]+'['+_0x4b975e[_0xedb3('0x69')]+']',_0x530ec7);};_0x4b975e['on'](_0xedb3('0x6f'),function(){onDisconnect(_0x4b975e,_0x279123);_0x4b975e[_0xedb3('0x62')](_0xedb3('0x70'));});_0x4b975e['on'](_0xedb3('0x71'),function(_0x10492a,_0x462154){if(!_0x10492a[_0xedb3('0x72')])return _0x462154();var _0x2f6ca8={[_0x10492a[_0xedb3('0x72')]]:{'forceLogout':_0x10492a[_0xedb3('0x5e')]}};usersDisconnectionOptions=_[_0xedb3('0x73')](usersDisconnectionOptions,_0x2f6ca8);return _0x462154();});onConnect(_0x4b975e,_0x279123);_0x4b975e[_0xedb3('0x62')](_0xedb3('0x74'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 13b99e2..c1c57b6 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 _0xba3a=['undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','outgoingmessage','AfterCreateMessage','opened','resolve','query','QueryTypes','AfterCreate','closed','substatus','Sequelize','AfterUpdate','User','find','fullname','email','internal','length','hasOwnProperty','model','toLowerCase','condition','util','../../mysqldb','jayson/promise','triggers','client','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Chat','ChatOfflineMessage','SmsInteraction','Sms','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','Trigger,\x20%s','error','catch','get','channel','motionChannel','event','direction','then','ContactId'];(function(_0x8dcdec,_0x3a6986){var _0x1aa2cf=function(_0x2bf432){while(--_0x2bf432){_0x8dcdec['push'](_0x8dcdec['shift']());}};_0x1aa2cf(++_0x3a6986);}(_0xba3a,0x140));var _0xaba3=function(_0xf0c02d,_0x409c69){_0xf0c02d=_0xf0c02d-0x0;var _0x124e61=_0xba3a[_0xf0c02d];return _0x124e61;};'use strict';var util=require(_0xaba3('0x0'));var db=require(_0xaba3('0x1'))['db'];var jayson=require(_0xaba3('0x2'));var logger=require('../logger')(_0xaba3('0x3'));var client=jayson[_0xaba3('0x4')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0xaba3('0x5'),'condition':_0xaba3('0x6'),'callback':afterCreate},{'channel':'Chat','model':_0xaba3('0x7'),'event':_0xaba3('0x8'),'condition':_0xaba3('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0xaba3('0xa'),'event':'afterCreate','condition':_0xaba3('0xb'),'callback':afterCreateMessage},{'channel':_0xaba3('0xc'),'model':_0xaba3('0xd'),'event':_0xaba3('0x5'),'condition':_0xaba3('0xb'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0xaba3('0xe'),'event':_0xaba3('0x5'),'condition':_0xaba3('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0xaba3('0xe'),'event':'afterUpdate','condition':_0xaba3('0x9'),'callback':afterUpdate},{'channel':_0xaba3('0xf'),'model':'SmsMessage','event':_0xaba3('0x5'),'condition':_0xaba3('0xb'),'callback':afterCreateMessage},{'channel':_0xaba3('0x10'),'model':_0xaba3('0x11'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0xaba3('0x11'),'event':_0xaba3('0x8'),'condition':_0xaba3('0x9'),'callback':afterUpdate},{'channel':_0xaba3('0x10'),'model':_0xaba3('0x12'),'event':_0xaba3('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xaba3('0x13'),'model':_0xaba3('0x14'),'event':_0xaba3('0x5'),'condition':_0xaba3('0x6'),'callback':afterCreate},{'channel':_0xaba3('0x13'),'model':_0xaba3('0x14'),'event':_0xaba3('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xaba3('0x13'),'model':_0xaba3('0x15'),'event':_0xaba3('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xaba3('0x16'),'model':'MailInteraction','event':_0xaba3('0x5'),'condition':_0xaba3('0x6'),'callback':afterCreate},{'channel':'Mail','model':_0xaba3('0x17'),'event':_0xaba3('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xaba3('0x16'),'model':_0xaba3('0x18'),'event':_0xaba3('0x5'),'condition':_0xaba3('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xaba3('0x19'),'event':'afterCreate','condition':_0xaba3('0x6'),'callback':afterCreate},{'channel':_0xaba3('0x1a'),'model':_0xaba3('0x19'),'event':'afterUpdate','condition':_0xaba3('0x9'),'callback':afterUpdate},{'channel':_0xaba3('0x1a'),'model':_0xaba3('0x1b'),'event':_0xaba3('0x5'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x5e6054){return client[_0xaba3('0x1c')](_0xaba3('0x1d'),_0x5e6054)['then'](function(_0x5b3038){logger['info'](_0xaba3('0x1e'),_0xaba3('0x1d'),_0x5b3038);if(_0x5b3038[_0xaba3('0x1f')]){if(_0x5b3038[_0xaba3('0x1f')]['code']===0x1f4){logger[_0xaba3('0x1f')](_0xaba3('0x1e'),_0xaba3('0x1d'),_0x5b3038[_0xaba3('0x1f')]);}}})[_0xaba3('0x20')](function(_0x1eae15){logger[_0xaba3('0x1f')](_0xaba3('0x1e'),'EventManager',_0x1eae15);});}function afterCreateMessage(_0x3063f2){return function(_0x2c775a){_0x2c775a=_0x2c775a[_0xaba3('0x21')]({'plain':!![]});_0x2c775a[_0xaba3('0x22')]=_0x3063f2;_0x2c775a[_0xaba3('0x23')]=_0x3063f2;_0x2c775a[_0xaba3('0x24')]=_0x2c775a[_0xaba3('0x25')];Promise['resolve']()[_0xaba3('0x26')](function(){if(typeof _0x2c775a[_0xaba3('0x27')]===_0xaba3('0x28'))return null;var _0x2afe2f=_0xaba3('0x29')+_0x2c775a[_0xaba3('0x27')];return db[_0xaba3('0x2a')]['query'](_0x2afe2f,{'type':db['Sequelize']['QueryTypes'][_0xaba3('0x2b')],'raw':!![]});})[_0xaba3('0x26')](function(_0x3eedd4){if(_0x3eedd4){_0x2c775a[_0xaba3('0x2c')]=_0x3eedd4[0x0];}if(typeof _0x2c775a['UserId']===_0xaba3('0x28'))return;return getAgent(_0x2c775a[_0xaba3('0x2d')]);})[_0xaba3('0x26')](function(_0x6c6217){if(_0x6c6217){_0x2c775a[_0xaba3('0x2e')]=util[_0xaba3('0x2f')](_0xaba3('0x30'),_0x6c6217[_0xaba3('0x31')]);_0x2c775a[_0xaba3('0x32')]=_0x6c6217;_0x2c775a[_0xaba3('0x22')]=_0x3063f2;return request({'event':'incomingmessage','message':_0x2c775a});}else{return request({'event':_0xaba3('0x33'),'message':_0x2c775a});}})['catch'](function(_0x2ee5e2){logger[_0xaba3('0x1f')](_0xaba3('0x1e'),_0xaba3('0x34'),_0x2ee5e2);});};}function afterCreateOfflineMessage(_0x1f74d4){return function(_0x375928){_0x375928=_0x375928[_0xaba3('0x21')]({'plain':!![]});_0x375928[_0xaba3('0x22')]=_0x1f74d4;_0x375928[_0xaba3('0x23')]=_0x1f74d4;_0x375928[_0xaba3('0x24')]='offlineMessage';return request({'event':_0x375928[_0xaba3('0x24')],'message':_0x375928});};}function afterCreate(_0x39dcd1,_0x1e7248){return function(_0x51242f){_0x51242f=_0x51242f['get']({'plain':!![]});_0x51242f[_0xaba3('0x22')]=_0x39dcd1;_0x51242f[_0xaba3('0x23')]=_0x39dcd1;_0x51242f['event']=_0xaba3('0x35');Promise[_0xaba3('0x36')]()[_0xaba3('0x26')](function(){var _0xd3341a=_0xaba3('0x29')+_0x51242f[_0xaba3('0x27')];return db[_0xaba3('0x2a')][_0xaba3('0x37')](_0xd3341a,{'type':db['Sequelize'][_0xaba3('0x38')]['SELECT'],'raw':!![]});})[_0xaba3('0x26')](function(_0x2d1886){if(_0x2d1886){_0x51242f[_0xaba3('0x2c')]=_0x2d1886[0x0];}if(typeof _0x51242f['UserId']===_0xaba3('0x28'))return;return getAgent(_0x51242f['UserId']);})[_0xaba3('0x26')](function(_0x3272e9){if(_0x3272e9){_0x51242f['interface']=util['format']('SIP/%s',_0x3272e9['name']);_0x51242f['agent']=_0x3272e9;}return request({'event':_0x1e7248,'message':_0x51242f});})[_0xaba3('0x20')](function(_0x1dfcdc){logger[_0xaba3('0x1f')](_0xaba3('0x1e'),_0xaba3('0x39'),_0x1dfcdc);});};}function afterUpdate(_0x31053b){return function(_0x408b25){var _0x4f6586=_0x408b25['changed'](_0xaba3('0x3a'))&&_0x408b25[_0xaba3('0x3a')];var _0xdf7f90=_0x408b25['changed'](_0xaba3('0x3b'));if(_0x4f6586||_0xdf7f90){var _0x36e088=_0x4f6586?_0xaba3('0x9'):_0xaba3('0x3b');var _0x3aee07=_0x408b25[_0xaba3('0x21')]({'plain':!![]});_0x3aee07[_0xaba3('0x22')]=_0x31053b;_0x3aee07[_0xaba3('0x23')]=_0x31053b;_0x3aee07[_0xaba3('0x24')]=_0x4f6586?_0xaba3('0x3a'):_0xaba3('0x3b');var _0x4eba35=_0xaba3('0x29')+_0x3aee07['ContactId'];return db[_0xaba3('0x2a')][_0xaba3('0x37')](_0x4eba35,{'type':db[_0xaba3('0x3c')]['QueryTypes']['SELECT'],'raw':!![]})[_0xaba3('0x26')](function(_0xf8ae38){if(_0xf8ae38){_0x3aee07[_0xaba3('0x2c')]=_0xf8ae38[0x0];}if(typeof _0x3aee07[_0xaba3('0x2d')]===_0xaba3('0x28'))return;return getAgent(_0x3aee07[_0xaba3('0x2d')]);})[_0xaba3('0x26')](function(_0x5584c1){if(_0x5584c1){_0x3aee07['interface']=util[_0xaba3('0x2f')](_0xaba3('0x30'),_0x5584c1['name']);_0x3aee07[_0xaba3('0x32')]=_0x5584c1;}return request({'event':_0x36e088,'message':_0x3aee07});})[_0xaba3('0x20')](function(_0x136a2f){logger['error'](_0xaba3('0x1e'),_0xaba3('0x3d'),_0x136a2f);});}};}function getAgent(_0x5b6b40){return db[_0xaba3('0x3e')][_0xaba3('0x3f')]({'where':{'id':_0x5b6b40},'attributes':['id',_0xaba3('0x31'),_0xaba3('0x40'),_0xaba3('0x41'),_0xaba3('0x42')],'raw':!![]})[_0xaba3('0x26')](function(_0xc5091b){return _0xc5091b;});}exports['default']=function(){for(var _0x35d6e8=0x0;_0x35d6e8=_0x168cd6[_0x7ac6('0x14')]){throw Error(_0x7ac6('0x15'));}_0x3053b1(_0x20b196);})[_0x7ac6('0x16')](function(_0x1a8d43){_0x2d2d3e(_0x1a8d43);});});}; \ No newline at end of file +var _0x50be=['mail','fax','sms','whatsapp','openchannel','isValidChannel','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','role','agent','User','count','then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x50be,0x85));var _0xe50b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50be[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe50b('0x0'));var BPromise=require(_0xe50b('0x1'));var db=require(_0xe50b('0x2'))['db'];var util=require(_0xe50b('0x3'));var channels=[_0xe50b('0x4'),_0xe50b('0x5'),'chat',_0xe50b('0x6'),_0xe50b('0x7'),_0xe50b('0x8'),_0xe50b('0x9')];exports['getChannels']=function(){return channels;};exports[_0xe50b('0xa')]=function(_0x481dd3){_0x481dd3=_0x481dd3[_0xe50b('0xb')]();return _[_0xe50b('0xc')](channels,_0x481dd3);};exports['clearBlockUser']=function(_0x2d84b9,_0x31e0f1,_0x23eb2f,_0x3607ea){var _0x55c987={'loginAttempts':_0x31e0f1,'blocked':_0x23eb2f};if(!_[_0xe50b('0xd')](_0x3607ea)){_0x55c987[_0xe50b('0xe')]=_0x3607ea;}return _0x2d84b9[_0xe50b('0xf')](_0x55c987);};exports['getLicense']=function(_0x19adc1){return new BPromise(function(_0x569cfe,_0x288c1e){var _0x4c68f6=0x0;if(_0x19adc1[_0xe50b('0x10')]!==_0xe50b('0x11')){_0x569cfe(_0x19adc1);}db[_0xe50b('0x12')][_0xe50b('0x13')]({'where':{'role':_0xe50b('0x11'),'online':!![],'id':{'$ne':_0x19adc1['id']}}})[_0xe50b('0x14')](function(_0x568c52){_0x4c68f6=_0x568c52;return util['getLicense']();})['then'](function(_0x1f5b3b){if(_0x1f5b3b&&_0x1f5b3b[_0xe50b('0x15')]&&_0x4c68f6>=_0x1f5b3b[_0xe50b('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x569cfe(_0x19adc1);})[_0xe50b('0x16')](function(_0xf5a54c){_0x288c1e(_0xf5a54c);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 8686aa1..cd9eed3 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5dd=['404','status','render','json','send','exports'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xa5dd,0x101));var _0xda5d=function(_0x4cf707,_0x3f2f53){_0x4cf707=_0x4cf707-0x0;var _0x22e0f5=_0xa5dd[_0x4cf707];return _0x22e0f5;};'use strict';module[_0xda5d('0x0')][0x194]=function pageNotFound(_0x4fc8ac,_0x57e25e){var _0x1d0604=_0xda5d('0x1');var _0x1dd7f4=0x194;var _0xd65a85={'status':_0x1dd7f4};_0x57e25e[_0xda5d('0x2')](_0xd65a85['status']);_0x57e25e[_0xda5d('0x3')](_0x1d0604,{},function(_0x1e949b,_0x13bedb){if(_0x1e949b){return _0x57e25e['status'](_0xd65a85['status'])[_0xda5d('0x4')](_0xd65a85);}_0x57e25e[_0xda5d('0x5')](_0x13bedb);});}; \ No newline at end of file +var _0xd5b7=['send','exports','404','status','render','json'];(function(_0x4eb51d,_0xc4ddea){var _0xbf88b9=function(_0xf5b603){while(--_0xf5b603){_0x4eb51d['push'](_0x4eb51d['shift']());}};_0xbf88b9(++_0xc4ddea);}(_0xd5b7,0xaf));var _0x7d5b=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xd5b7[_0x216d45];return _0xbaac0b;};'use strict';module[_0x7d5b('0x0')][0x194]=function pageNotFound(_0x3f614a,_0x506ee0){var _0x53f739=_0x7d5b('0x1');var _0x2e8cc2=0x194;var _0x3131f3={'status':_0x2e8cc2};_0x506ee0[_0x7d5b('0x2')](_0x3131f3[_0x7d5b('0x2')]);_0x506ee0[_0x7d5b('0x3')](_0x53f739,{},function(_0x4cf031,_0x323d96){if(_0x4cf031){return _0x506ee0[_0x7d5b('0x2')](_0x3131f3[_0x7d5b('0x2')])[_0x7d5b('0x4')](_0x3131f3);}_0x506ee0[_0x7d5b('0x5')](_0x323d96);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 47011cd..39969d5 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x502a=['database','options','sequelizeHistory','username','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../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','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','Schedule','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','userProfileId','belongsToMany','ChatGroup','chat_group_has_users','CmContact','Contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','cm_user_has_lists','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','TrunkBackupId','belongsTo','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','uniqueid','AgentReports','ContactId','MailAccountId','CloudProviderId','Smtp','Dispositions','Messages','ListId','TemplateId','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessageId','restrict','TagId','MailQueueReport','List','Items','Disposition','FaxAccountId','Interactions','FaxApplication','Exntensions','FaxInteractionId','fax_interaction_has_tags','Answers','SmsAccountId','SmsMessage','SmsQueue','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','AttachmentId','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','Hoppers','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','Actions','AutomationId','ParentId','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','Field','VariableId','Subjects','SugarcrmConfiguration','ZohoAccount','ZohoField','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','ServicenowField','FromId','ToId','SessionId','ProjectId','user_has_square_projects','ChatQueues','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkBackup','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','Queues','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','UserWhatsappQueue','WhatsappQueueId','user','Imap','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','127.0.0.1'];(function(_0x1408b4,_0x22e866){var _0x39276b=function(_0x5d7918){while(--_0x5d7918){_0x1408b4['push'](_0x1408b4['shift']());}};_0x39276b(++_0x22e866);}(_0x502a,0x1df));var _0xa502=function(_0x3667b5,_0x134dea){_0x3667b5=_0x3667b5-0x0;var _0x176372=_0x502a[_0x3667b5];return _0x176372;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xa502('0x0'));var _=require(_0xa502('0x1'));var jstz=require(_0xa502('0x2'));var timezone=jstz[_0xa502('0x3')]();config[_0xa502('0x0')]=_[_0xa502('0x4')](config[_0xa502('0x0')],{'database':_0xa502('0x5'),'username':_0xa502('0x6'),'password':_0xa502('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa502('0x8'),'dialectOptions':{'charset':_0xa502('0x9')},'logging':![],'timezone':timezone[_0xa502('0xa')](),'define':{'charset':_0xa502('0xb'),'collate':_0xa502('0xc')}}});config['sequelizeHistory']=_[_0xa502('0x4')](config['sequelizeHistory'],{'database':_0xa502('0x5'),'username':_0xa502('0x6'),'password':'xC@LL1234','options':{'host':_0xa502('0xd'),'port':0xcea,'dialect':_0xa502('0x8'),'dialectOptions':{'charset':_0xa502('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xa502('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa502('0x0')][_0xa502('0xe')],config[_0xa502('0x0')]['username'],config['sequelize']['password'],config[_0xa502('0x0')][_0xa502('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa502('0x10')][_0xa502('0xe')],config[_0xa502('0x10')][_0xa502('0x11')],config['sequelizeHistory']['password'],config[_0xa502('0x10')][_0xa502('0xf')])};db['User']=db[_0xa502('0x0')]['import'](_0xa502('0x12'));db[_0xa502('0x13')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x15'));db[_0xa502('0x16')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x17'));db[_0xa502('0x18')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x19'));db[_0xa502('0x1a')]=db['sequelize']['import'](_0xa502('0x1b'));db[_0xa502('0x1c')]=db['sequelize'][_0xa502('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0xa502('0x1d')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x1e'));db[_0xa502('0x1f')]=db['sequelize'][_0xa502('0x14')]('../api/screenRecording/screenRecording.model');db[_0xa502('0x20')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x21'));db[_0xa502('0x22')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x23'));db[_0xa502('0x24')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x25'));db['VoiceDialReport']=db[_0xa502('0x0')][_0xa502('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0xa502('0x26')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x27'));db[_0xa502('0x28')]=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db['sequelize']['import']('../api/memberReport/memberReport.model');db[_0xa502('0x29')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x2a'));db['VoiceTransferReport']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x2b'));db[_0xa502('0x2c')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xa502('0x2d')]=db[_0xa502('0x0')]['import'](_0xa502('0x2e'));db[_0xa502('0x2f')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x30'));db[_0xa502('0x31')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x32'));db[_0xa502('0x33')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x34'));db[_0xa502('0x35')]=db['sequelize'][_0xa502('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0xa502('0x36')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x37'));db['UserWhatsappQueue']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x38'));db[_0xa502('0x39')]=db['sequelize']['import'](_0xa502('0x3a'));db[_0xa502('0x3b')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x3c'));db[_0xa502('0x3d')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x3e'));db[_0xa502('0x3f')]=db['sequelize'][_0xa502('0x14')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x40'));db['MailInteraction']=db[_0xa502('0x0')]['import'](_0xa502('0x41'));db[_0xa502('0x42')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x43'));db[_0xa502('0x44')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x45'));db['MailQueueReport']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x46'));db[_0xa502('0x47')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x48'));db[_0xa502('0x49')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x4a'));db['FaxAccount']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x4b'));db['FaxApplication']=db[_0xa502('0x0')]['import']('../api/faxApplication/faxApplication.model');db[_0xa502('0x4c')]=db[_0xa502('0x0')]['import'](_0xa502('0x4d'));db[_0xa502('0x4e')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x4f'));db[_0xa502('0x50')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x51'));db[_0xa502('0x52')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x53'));db[_0xa502('0x54')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x55'));db[_0xa502('0x56')]=db[_0xa502('0x0')]['import']('../api/smsApplication/smsApplication.model');db[_0xa502('0x57')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x58'));db['SmsMessage']=db[_0xa502('0x0')]['import'](_0xa502('0x59'));db['SmsQueue']=db['sequelize'][_0xa502('0x14')]('../api/smsQueue/smsQueue.model');db[_0xa502('0x5a')]=db['sequelize']['import'](_0xa502('0x5b'));db['OpenchannelApplication']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x5c'));db['OpenchannelInteraction']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x5d'));db[_0xa502('0x5e')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x5f'));db['OpenchannelQueue']=db[_0xa502('0x0')]['import'](_0xa502('0x60'));db[_0xa502('0x61')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x62'));db[_0xa502('0x63')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x64'));db[_0xa502('0x65')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x66'));db[_0xa502('0x67')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x68'));db[_0xa502('0x69')]=db['sequelize']['import']('../api/chatMessage/chatMessage.model');db[_0xa502('0x6a')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x6b'));db[_0xa502('0x6c')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x6d'));db['ChatGroup']=db['sequelize'][_0xa502('0x14')]('../api/chatGroup/chatGroup.model');db[_0xa502('0x6e')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x6f'));db[_0xa502('0x70')]=db['sequelize']['import'](_0xa502('0x71'));db['CmContact']=db[_0xa502('0x0')]['import'](_0xa502('0x72'));db[_0xa502('0x73')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x74'));db[_0xa502('0x75')]=db[_0xa502('0x0')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x76'));db[_0xa502('0x77')]=db['sequelize'][_0xa502('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xa502('0x78')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x79'));db[_0xa502('0x7a')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x7b'));db['Action']=db['sequelize']['import'](_0xa502('0x7c'));db[_0xa502('0x7d')]=db[_0xa502('0x0')]['import']('../api/automation/automation.model');db[_0xa502('0x7e')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x7f'));db['Disposition']=db['sequelize']['import'](_0xa502('0x80'));db[_0xa502('0x81')]=db[_0xa502('0x0')]['import'](_0xa502('0x82'));db[_0xa502('0x83')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x84'));db[_0xa502('0x85')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x86'));db[_0xa502('0x87')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x88'));db['VoiceQueuesLog']=db[_0xa502('0x0')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xa502('0x89')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/schedule/schedule.model');db[_0xa502('0x8a')]=db['sequelize'][_0xa502('0x14')]('../api/sound/sound.model');db[_0xa502('0x8b')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x8c'));db[_0xa502('0x8d')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x8e'));db[_0xa502('0x8f')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x90'));db[_0xa502('0x91')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x92'));db['Integration']=db[_0xa502('0x0')][_0xa502('0x14')]('../api/integration/integration.model');db[_0xa502('0x93')]=db['sequelize'][_0xa502('0x14')]('../api/integrationReport/integrationReport.model');db[_0xa502('0x94')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xa502('0x95')]=db['sequelize']['import'](_0xa502('0x96'));db[_0xa502('0x97')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x98'));db[_0xa502('0x99')]=db[_0xa502('0x0')]['import']('../api/analyticMetric/analyticMetric.model');db[_0xa502('0x9a')]=db[_0xa502('0x0')]['import'](_0xa502('0x9b'));db['AnalyticTreeReport']=db[_0xa502('0x0')][_0xa502('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xa502('0x9c')]=db[_0xa502('0x0')]['import'](_0xa502('0x9d'));db[_0xa502('0x9e')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x9f'));db[_0xa502('0xa0')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xa1'));db[_0xa502('0xa2')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xa3'));db[_0xa502('0xa4')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xa5'));db[_0xa502('0xa6')]=db[_0xa502('0x0')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xa502('0xa7')]=db[_0xa502('0x0')]['import'](_0xa502('0xa8'));db[_0xa502('0xa9')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xaa'));db['ZohoAccount']=db['sequelize'][_0xa502('0x14')](_0xa502('0xab'));db[_0xa502('0xac')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xad'));db['ZohoField']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xae'));db[_0xa502('0xaf')]=db[_0xa502('0x0')]['import'](_0xa502('0xb0'));db['ZendeskConfiguration']=db[_0xa502('0x0')][_0xa502('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db['sequelize']['import'](_0xa502('0xb1'));db[_0xa502('0xb2')]=db[_0xa502('0x0')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xa502('0xb3')]=db[_0xa502('0x0')]['import'](_0xa502('0xb4'));db[_0xa502('0xb5')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xb6'));db[_0xa502('0xb7')]=db[_0xa502('0x0')]['import'](_0xa502('0xb8'));db[_0xa502('0xb9')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xba'));db[_0xa502('0xbb')]=db[_0xa502('0x0')]['import'](_0xa502('0xbc'));db[_0xa502('0xbd')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xbe'));db[_0xa502('0xbf')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0xa502('0x0')]['import'](_0xa502('0xc0'));db[_0xa502('0xc1')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xc2'));db[_0xa502('0xc3')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xc4'));db[_0xa502('0xc5')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xa502('0xc6')]=db['sequelize'][_0xa502('0x14')](_0xa502('0xc7'));db[_0xa502('0xc8')]=db[_0xa502('0x0')]['import'](_0xa502('0xc9'));db[_0xa502('0xca')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xa502('0xcb')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xcc'));db[_0xa502('0xcd')]=db['sequelize']['import'](_0xa502('0xce'));db[_0xa502('0xcf')]=db['sequelize'][_0xa502('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0xa502('0xd0')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xd1'));db[_0xa502('0xd2')]=db['sequelize'][_0xa502('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xa502('0xd3')]=db['sequelize']['import'](_0xa502('0xd4'));db[_0xa502('0xd5')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xd6'));db[_0xa502('0xd7')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0xa502('0xd8')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xd9'));db[_0xa502('0xda')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xdb'));db[_0xa502('0xdc')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xdd'));db['Setting']=db[_0xa502('0x0')]['import'](_0xa502('0xde'));db['SquareOdbc']=db['sequelize'][_0xa502('0x14')](_0xa502('0xdf'));db[_0xa502('0xe0')]=db['sequelize'][_0xa502('0x14')](_0xa502('0xe1'));db[_0xa502('0xe2')]=db[_0xa502('0x0')]['import'](_0xa502('0xe3'));db['SquareMessage']=db[_0xa502('0x0')]['import']('../api/squareMessage/squareMessage.model');db[_0xa502('0xe4')]=db[_0xa502('0x0')]['import'](_0xa502('0xe5'));db[_0xa502('0xe6')]=db[_0xa502('0x0')]['import'](_0xa502('0xe7'));db[_0xa502('0xe8')]=db['sequelize'][_0xa502('0x14')]('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0xa502('0x14')]('../api/migration/migration.model');db[_0xa502('0xe9')]=db[_0xa502('0x0')]['import'](_0xa502('0xea'));db['Plugin']=db['sequelize'][_0xa502('0x14')](_0xa502('0xeb'));db[_0xa502('0xec')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xed'));db[_0xa502('0xee')]=db[_0xa502('0x0')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0xa502('0xef')]=db[_0xa502('0x0')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xa502('0xf0')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xf1'));db[_0xa502('0xf2')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xf3'));db[_0xa502('0xf4')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xf5'));db[_0xa502('0xf6')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xa502('0xf7')]=db['sequelize']['import'](_0xa502('0xf8'));db[_0xa502('0xf9')]=db['sequelize']['import'](_0xa502('0xfa'));db['UserProfileResource']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xfb'));db[_0xa502('0xfc')]=db['sequelize'][_0xa502('0x14')]('../api/userNotification/userNotification.model');db[_0xa502('0xfd')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0xfe'));db[_0xa502('0xff')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x100'));db[_0xa502('0x101')]=db[_0xa502('0x0')][_0xa502('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0xa502('0x102')]=db['sequelize']['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xa502('0x103')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x104'));db[_0xa502('0x105')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x106'));db[_0xa502('0x107')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x108'));db[_0xa502('0x109')]=db[_0xa502('0x0')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xa502('0x10a')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x10b'));db[_0xa502('0x10c')]=db['sequelize'][_0xa502('0x14')](_0xa502('0x10d'));db[_0xa502('0x10e')]=db[_0xa502('0x0')][_0xa502('0x14')](_0xa502('0x10f'));db[_0xa502('0x110')][_0xa502('0x111')](db['VoiceMail'],{'as':_0xa502('0x20'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x113')});db['User'][_0xa502('0x111')](db[_0xa502('0x10e')],{'as':'userSetting','onDelete':'cascade','foreignKey':'UserId'});db['User']['hasMany'](db[_0xa502('0x1d')],{'as':'Recordings','foreignKey':_0xa502('0x113')});db[_0xa502('0x110')][_0xa502('0x114')](db['UserVoiceQueueRt'],{'as':_0xa502('0x115'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x110')][_0xa502('0x114')](db['VoiceExtension'],{'as':_0xa502('0x116'),'onDelete':'cascade','hooks':!![]});db['User']['hasMany'](db[_0xa502('0x117')],{'as':'HopperFinals','foreignKey':'UserId'});db['User'][_0xa502('0x114')](db['CmHopperHistory'],{'as':_0xa502('0x118'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x110')][_0xa502('0x114')](db[_0xa502('0x78')],{'as':_0xa502('0x78'),'foreignKey':'UserId'});db[_0xa502('0x110')][_0xa502('0x114')](db[_0xa502('0x119')],{'as':_0xa502('0x11a'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x110')][_0xa502('0x114')](db[_0xa502('0x67')],{'as':_0xa502('0x11b'),'foreignKey':'UserId'});db[_0xa502('0x110')]['hasMany'](db[_0xa502('0x57')],{'as':'SmsInteractions','foreignKey':_0xa502('0x113')});db[_0xa502('0x110')][_0xa502('0x114')](db[_0xa502('0x4c')],{'as':_0xa502('0x11c'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x110')][_0xa502('0x114')](db[_0xa502('0x11d')],{'as':_0xa502('0x11e'),'foreignKey':_0xa502('0x113')});db['User']['hasMany'](db[_0xa502('0x11f')],{'as':_0xa502('0x120'),'foreignKey':_0xa502('0x113')});db['User']['hasMany'](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0xa502('0x121')});db[_0xa502('0x110')]['belongsTo'](db['UserProfile'],{'as':_0xa502('0xf7'),'foreignKey':_0xa502('0x122')});db['User'][_0xa502('0x123')](db[_0xa502('0x124')],{'as':'Groups','through':_0xa502('0x125')});db['User'][_0xa502('0x123')](db[_0xa502('0x126')],{'as':_0xa502('0x127'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db[_0xa502('0xf4')],{'as':_0xa502('0x128'),'through':'cm_user_has_lists'});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':_0xa502('0x129')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x11d')],{'as':_0xa502('0x11e'),'through':_0xa502('0x12a')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x67')],{'as':_0xa502('0x11b'),'through':_0xa502('0x12b')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x4c')],{'as':_0xa502('0x11c'),'through':_0xa502('0x12c')});db[_0xa502('0x110')][_0xa502('0x123')](db['SmsInteraction'],{'as':_0xa502('0x12d'),'through':_0xa502('0x12e')});db[_0xa502('0x110')][_0xa502('0x123')](db['OpenchannelInteraction'],{'as':_0xa502('0x11a'),'through':_0xa502('0x12f')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x11f')],{'as':_0xa502('0x120'),'through':_0xa502('0x130')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x1c')],{'as':_0xa502('0x131'),'through':_0xa502('0x2d'),'required':![]});db[_0xa502('0x110')]['belongsToMany'](db['VoicePrefix'],{'as':_0xa502('0x132'),'through':'UserVoicePrefix','required':![]});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x3f')],{'as':_0xa502('0x133'),'through':_0xa502('0x31'),'required':![]});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x6c')],{'as':'ChatQueues','through':_0xa502('0x2f'),'required':![],'hooks':!![]});db['User'][_0xa502('0x123')](db[_0xa502('0x50')],{'as':'FaxQueues','through':_0xa502('0x33'),'required':![]});db[_0xa502('0x110')]['belongsToMany'](db['SmsQueue'],{'as':_0xa502('0x134'),'through':_0xa502('0x35'),'required':![]});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x135')],{'as':'OpenchannelQueues','through':_0xa502('0x36'),'required':![]});db['User'][_0xa502('0x123')](db[_0xa502('0x105')],{'as':_0xa502('0x136'),'through':'UserWhatsappQueue','required':![]});db['User'][_0xa502('0x123')](db['CmList'],{'through':_0xa502('0x137')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x61')],{'as':'ChatWebsites','through':_0xa502('0x138')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x139')],{'as':_0xa502('0x13a'),'through':_0xa502('0x13b')});db[_0xa502('0x110')][_0xa502('0x123')](db['MailAccount'],{'as':_0xa502('0x13c'),'through':_0xa502('0x13d')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x5a')],{'as':_0xa502('0x13e'),'through':_0xa502('0x13f')});db[_0xa502('0x110')][_0xa502('0x123')](db[_0xa502('0x54')],{'as':_0xa502('0x140'),'through':_0xa502('0x141')});db['User'][_0xa502('0x123')](db['WhatsappAccount'],{'as':_0xa502('0x142'),'through':_0xa502('0x143')});db[_0xa502('0x110')]['belongsToMany'](db[_0xa502('0xe0')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0xa502('0x13')][_0xa502('0x114')](db[_0xa502('0x18')],{'as':_0xa502('0x144'),'onDelete':'cascade','foreignKey':_0xa502('0x145')});db[_0xa502('0x16')]['hasMany'](db[_0xa502('0x18')],{'onDelete':_0xa502('0x112')});db[_0xa502('0x18')][_0xa502('0x114')](db['VoiceExtension'],{'as':_0xa502('0x146'),'onDelete':_0xa502('0x112')});db['VoiceMusicOnHold'][_0xa502('0x123')](db[_0xa502('0x8a')],{'as':_0xa502('0x147'),'through':_0xa502('0x148')});db[_0xa502('0x1c')]['hasMany'](db[_0xa502('0x2c')],{'as':_0xa502('0x149'),'foreignKey':_0xa502('0x14a')});db[_0xa502('0x1c')]['hasMany'](db[_0xa502('0x73')],{'as':'Hoppers','foreignKey':_0xa502('0x14a')});db[_0xa502('0x1c')][_0xa502('0x114')](db[_0xa502('0x117')],{'as':_0xa502('0x14b'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xa502('0x114')](db[_0xa502('0x77')],{'as':_0xa502('0x14c'),'foreignKey':_0xa502('0x14a')});db[_0xa502('0x1c')][_0xa502('0x114')](db[_0xa502('0x78')],{'as':'ReportAgentPreview','foreignKey':_0xa502('0x14a')});db[_0xa502('0x1c')][_0xa502('0x114')](db[_0xa502('0x75')],{'as':_0xa502('0x14d'),'foreignKey':_0xa502('0x14a')});db[_0xa502('0x1c')][_0xa502('0x114')](db[_0xa502('0xd5')],{'as':'JscriptySessions','foreignKey':_0xa502('0x14a')});db[_0xa502('0x1c')]['belongsTo'](db[_0xa502('0x29')],{'as':_0xa502('0x29'),'foreignKey':'TrunkId'});db[_0xa502('0x1c')]['belongsTo'](db[_0xa502('0x29')],{'as':'TrunkBackup','foreignKey':_0xa502('0x14e')});db['VoiceQueue'][_0xa502('0x14f')](db[_0xa502('0x83')],{'as':_0xa502('0x83'),'foreignKey':_0xa502('0x150')});db[_0xa502('0x1c')]['belongsTo'](db[_0xa502('0x85')],{'as':_0xa502('0x151'),'foreignKey':_0xa502('0x152')});db['VoiceQueue'][_0xa502('0x123')](db['CmList'],{'as':'Lists','through':_0xa502('0x153')});db[_0xa502('0x1c')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':_0xa502('0x2d')});db[_0xa502('0x1c')][_0xa502('0x123')](db[_0xa502('0xe4')],{'as':_0xa502('0x155'),'through':_0xa502('0x109')});db['VoiceQueue'][_0xa502('0x123')](db['CmList'],{'as':_0xa502('0x156'),'through':_0xa502('0x157')});db[_0xa502('0x1d')][_0xa502('0x14f')](db['User'],{'as':_0xa502('0x110'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x1f')]['belongsTo'](db['User'],{'as':_0xa502('0x110'),'foreignKey':_0xa502('0x113')});db['VoiceMail'][_0xa502('0x114')](db[_0xa502('0x22')],{'as':'Messages','onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x158'),'sourceKey':_0xa502('0x159')});db[_0xa502('0x22')][_0xa502('0x14f')](db[_0xa502('0x20')],{'foreignKey':_0xa502('0x158'),'targetKey':_0xa502('0x159')});db['VoiceCallReport'][_0xa502('0x114')](db[_0xa502('0x28')],{'as':'QueueCalls','foreignKey':_0xa502('0x15a'),'constraints':![]});db[_0xa502('0x24')][_0xa502('0x114')](db[_0xa502('0x26')],{'as':_0xa502('0x15b'),'foreignKey':_0xa502('0x15a'),'constraints':![]});db[_0xa502('0x24')][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':'User','foreignKey':_0xa502('0x113')});db[_0xa502('0x24')][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':'Contact','foreignKey':_0xa502('0x15c')});db[_0xa502('0x39')][_0xa502('0x14f')](db[_0xa502('0x3d')],{'as':_0xa502('0x3d'),'foreignKey':_0xa502('0x15d')});db[_0xa502('0x39')][_0xa502('0x14f')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xa502('0x15e'),'onDelete':'restrict'});db[_0xa502('0x3b')][_0xa502('0x14f')](db[_0xa502('0x3d')],{'as':_0xa502('0x3d'),'foreignKey':_0xa502('0x15d')});db[_0xa502('0x3b')][_0xa502('0x14f')](db[_0xa502('0x107')],{'as':_0xa502('0x107'),'foreignKey':_0xa502('0x15e'),'onDelete':'restrict'});db[_0xa502('0x3d')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':'cascade'});db[_0xa502('0x3d')][_0xa502('0x111')](db['MailServerOut'],{'as':_0xa502('0x15f'),'onDelete':_0xa502('0x112')});db[_0xa502('0x3d')][_0xa502('0x114')](db['Disposition'],{'as':_0xa502('0x160'),'foreignKey':_0xa502('0x15d'),'onDelete':_0xa502('0x112')});db['MailAccount'][_0xa502('0x114')](db[_0xa502('0x7e')],{'as':'Answers','foreignKey':_0xa502('0x15d')});db[_0xa502('0x3d')][_0xa502('0x114')](db[_0xa502('0x42')],{'as':_0xa502('0x161'),'foreignKey':_0xa502('0x15d')});db[_0xa502('0x3d')]['hasMany'](db[_0xa502('0x11d')],{'as':'Interactions'});db[_0xa502('0x3d')][_0xa502('0x114')](db[_0xa502('0x44')],{'as':_0xa502('0x146')});db[_0xa502('0x3d')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xa502('0x162')});db[_0xa502('0x3d')][_0xa502('0x14f')](db[_0xa502('0x8d')],{'as':'Template','foreignKey':_0xa502('0x163')});db['MailAccount'][_0xa502('0x14f')](db['Pause'],{'as':_0xa502('0x151'),'foreignKey':_0xa502('0x152')});db[_0xa502('0x3d')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':_0xa502('0x13d')});db[_0xa502('0x3f')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':'Agents','through':_0xa502('0x31')});db['MailQueue'][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':'team_has_mail_queues','as':_0xa502('0x155')});db['MailInteraction'][_0xa502('0x114')](db[_0xa502('0x42')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xa502('0x164')});db[_0xa502('0x11d')][_0xa502('0x14f')](db['MailAccount'],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x15d')});db[_0xa502('0x11d')][_0xa502('0x14f')](db['CmContact'],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0x11d')]['belongsTo'](db[_0xa502('0x110')],{'as':_0xa502('0x167'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x11d')][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':_0xa502('0x168'),'as':_0xa502('0x169')});db[_0xa502('0x11d')]['belongsToMany'](db[_0xa502('0x8b')],{'through':'mail_interaction_has_tags','as':_0xa502('0x16a')});db[_0xa502('0x11d')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x16b'),'through':_0xa502('0x12a'),'foreignKey':'MailInteractionId'});db[_0xa502('0x42')][_0xa502('0x114')](db['Attachment'],{'as':_0xa502('0x16c'),'onDelete':'cascade'});db[_0xa502('0x42')]['belongsTo'](db[_0xa502('0x110')],{'as':_0xa502('0x110')});db[_0xa502('0x42')]['belongsTo'](db[_0xa502('0x126')],{'onDelete':'cascade','as':'Contact'});db[_0xa502('0x42')][_0xa502('0x14f')](db[_0xa502('0x11d')],{'as':_0xa502('0x16d'),'foreignKey':'MailInteractionId'});db[_0xa502('0x42')][_0xa502('0x14f')](db[_0xa502('0x3d')],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x15d')});db['MailMessage'][_0xa502('0x14f')](db[_0xa502('0x61')],{'as':_0xa502('0x61'),'foreignKey':'ChatWebsiteId'});db[_0xa502('0x42')][_0xa502('0x14f')](db[_0xa502('0x6a')],{'as':_0xa502('0x6a'),'foreignKey':_0xa502('0x16e')});db[_0xa502('0x44')][_0xa502('0x14f')](db['User'],{'onDelete':_0xa502('0x16f')});db[_0xa502('0x44')]['belongsTo'](db['MailQueue'],{'onDelete':_0xa502('0x16f')});db['MailApplication'][_0xa502('0x14f')](db[_0xa502('0x3d')],{'onDelete':_0xa502('0x16f')});db[_0xa502('0x44')][_0xa502('0x14f')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xa502('0x150')});db[_0xa502('0x44')][_0xa502('0x14f')](db[_0xa502('0x8b')],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x170')});db[_0xa502('0x171')][_0xa502('0x14f')](db['MailAccount'],{});db[_0xa502('0x171')][_0xa502('0x14f')](db[_0xa502('0xf4')],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db[_0xa502('0x171')][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0x171')][_0xa502('0x14f')](db[_0xa502('0x11d')],{});db['MailQueueReport'][_0xa502('0x14f')](db['MailMessage'],{});db['MailQueueReport'][_0xa502('0x14f')](db[_0xa502('0x110')],{});db[_0xa502('0x171')][_0xa502('0x14f')](db[_0xa502('0x3f')],{});db[_0xa502('0x47')][_0xa502('0x114')](db['DashboardItem'],{'as':_0xa502('0x173'),'onDelete':'cascade'});db[_0xa502('0x139')][_0xa502('0x114')](db[_0xa502('0x174')],{'as':_0xa502('0x160'),'foreignKey':_0xa502('0x175'),'onDelete':_0xa502('0x112')});db[_0xa502('0x139')][_0xa502('0x114')](db[_0xa502('0x7e')],{'as':'Answers','foreignKey':_0xa502('0x175')});db[_0xa502('0x139')][_0xa502('0x114')](db['FaxInteraction'],{'as':_0xa502('0x176')});db[_0xa502('0x139')][_0xa502('0x114')](db[_0xa502('0x177')],{'as':'Applications'});db[_0xa502('0x139')][_0xa502('0x114')](db['VoiceExtension'],{'as':_0xa502('0x178'),'onDelete':_0xa502('0x112')});db[_0xa502('0x139')][_0xa502('0x114')](db[_0xa502('0x4e')],{'as':_0xa502('0x161')});db['FaxAccount'][_0xa502('0x14f')](db[_0xa502('0x29')],{'as':_0xa502('0x29')});db['FaxAccount'][_0xa502('0x14f')](db['CmList'],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db[_0xa502('0x139')][_0xa502('0x14f')](db[_0xa502('0x85')],{'as':_0xa502('0x151'),'foreignKey':_0xa502('0x152')});db[_0xa502('0x139')][_0xa502('0x123')](db['User'],{'as':'Agents','through':_0xa502('0x13b')});db[_0xa502('0x177')][_0xa502('0x14f')](db[_0xa502('0x110')],{'onDelete':_0xa502('0x16f')});db[_0xa502('0x177')][_0xa502('0x14f')](db[_0xa502('0x50')],{'onDelete':_0xa502('0x16f')});db[_0xa502('0x177')][_0xa502('0x14f')](db['FaxAccount'],{'onDelete':'restrict'});db[_0xa502('0x177')][_0xa502('0x14f')](db[_0xa502('0x8b')],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x170')});db[_0xa502('0x4c')][_0xa502('0x114')](db[_0xa502('0x4e')],{'as':_0xa502('0x161'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x179')});db[_0xa502('0x4c')][_0xa502('0x14f')](db['FaxAccount'],{'as':_0xa502('0x165'),'foreignKey':'FaxAccountId'});db[_0xa502('0x4c')][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':'ContactId'});db[_0xa502('0x4c')][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':_0xa502('0x167'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x4c')][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':_0xa502('0x17a'),'as':'Tags'});db['FaxInteraction'][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':_0xa502('0x17a'),'as':_0xa502('0x16a')});db['FaxInteraction']['belongsToMany'](db[_0xa502('0x110')],{'as':_0xa502('0x16b'),'through':_0xa502('0x12c'),'foreignKey':_0xa502('0x179')});db['FaxMessage'][_0xa502('0x14f')](db['User'],{'onDelete':'cascade','as':_0xa502('0x110')});db[_0xa502('0x4e')]['belongsTo'](db[_0xa502('0x4c')],{'as':_0xa502('0x16d'),'foreignKey':'FaxInteractionId'});db[_0xa502('0x4e')][_0xa502('0x14f')](db['CmContact'],{'onDelete':_0xa502('0x112'),'as':_0xa502('0x166')});db[_0xa502('0x4e')][_0xa502('0x14f')](db[_0xa502('0xe9')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xa502('0x4e')][_0xa502('0x14f')](db[_0xa502('0x139')],{'as':'Account','foreignKey':_0xa502('0x175')});db['FaxQueue'][_0xa502('0x123')](db[_0xa502('0x110')],{'as':'Agents','through':_0xa502('0x33')});db[_0xa502('0x50')][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':'team_has_fax_queues','as':_0xa502('0x155')});db[_0xa502('0x52')][_0xa502('0x14f')](db[_0xa502('0x139')],{});db[_0xa502('0x52')][_0xa502('0x14f')](db[_0xa502('0xf4')],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db[_0xa502('0x52')][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0x52')]['belongsTo'](db[_0xa502('0x4c')],{});db[_0xa502('0x52')][_0xa502('0x14f')](db['FaxMessage'],{});db[_0xa502('0x52')][_0xa502('0x14f')](db['User'],{});db[_0xa502('0x52')][_0xa502('0x14f')](db[_0xa502('0x50')],{});db[_0xa502('0x54')][_0xa502('0x114')](db[_0xa502('0x174')],{'as':_0xa502('0x160'),'foreignKey':'SmsAccountId','onDelete':_0xa502('0x112')});db[_0xa502('0x54')][_0xa502('0x114')](db['CannedAnswer'],{'as':_0xa502('0x17b'),'foreignKey':_0xa502('0x17c')});db[_0xa502('0x54')]['hasMany'](db[_0xa502('0x17d')],{'as':_0xa502('0x161'),'foreignKey':_0xa502('0x17c')});db[_0xa502('0x54')]['hasMany'](db[_0xa502('0x57')],{'as':_0xa502('0x176')});db['SmsAccount'][_0xa502('0x114')](db[_0xa502('0x56')],{'as':'Applications'});db[_0xa502('0x54')][_0xa502('0x14f')](db[_0xa502('0xf4')],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db['SmsAccount']['belongsTo'](db[_0xa502('0x85')],{'as':_0xa502('0x151'),'foreignKey':_0xa502('0x152')});db[_0xa502('0x54')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':_0xa502('0x141')});db['SmsApplication'][_0xa502('0x14f')](db['User'],{'onDelete':_0xa502('0x16f')});db[_0xa502('0x56')][_0xa502('0x14f')](db[_0xa502('0x17e')],{'onDelete':_0xa502('0x16f')});db['SmsApplication'][_0xa502('0x14f')](db[_0xa502('0x54')],{'onDelete':_0xa502('0x16f')});db['SmsApplication'][_0xa502('0x14f')](db[_0xa502('0x83')],{'onDelete':'restrict','foreignKey':_0xa502('0x150')});db['SmsApplication'][_0xa502('0x14f')](db[_0xa502('0x8b')],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x170')});db[_0xa502('0x57')][_0xa502('0x114')](db[_0xa502('0x17d')],{'as':_0xa502('0x161'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x17f')});db[_0xa502('0x57')][_0xa502('0x14f')](db[_0xa502('0x54')],{'as':_0xa502('0x165'),'foreignKey':'SmsAccountId'});db[_0xa502('0x57')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xa502('0x15c')});db['SmsInteraction'][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':_0xa502('0x167'),'foreignKey':_0xa502('0x113')});db[_0xa502('0x57')]['belongsToMany'](db[_0xa502('0x8b')],{'through':_0xa502('0x180'),'as':'Tags'});db[_0xa502('0x57')][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':_0xa502('0x180'),'as':_0xa502('0x16a')});db[_0xa502('0x57')][_0xa502('0x123')](db['User'],{'as':_0xa502('0x16b'),'through':_0xa502('0x12e'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':_0xa502('0x110')});db[_0xa502('0x17d')][_0xa502('0x14f')](db[_0xa502('0x126')],{'onDelete':_0xa502('0x112'),'as':_0xa502('0x166')});db[_0xa502('0x17d')][_0xa502('0x14f')](db['SmsInteraction'],{'onDelete':_0xa502('0x112'),'as':_0xa502('0x16d'),'foreignKey':_0xa502('0x17f')});db[_0xa502('0x17d')][_0xa502('0x14f')](db[_0xa502('0x54')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xa502('0x17e')]['belongsToMany'](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':_0xa502('0x35'),'foreignKey':_0xa502('0x181')});db[_0xa502('0x17e')][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':_0xa502('0x182'),'as':'Teams'});db[_0xa502('0x5a')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa502('0x183'),'onDelete':'cascade'});db[_0xa502('0x5a')][_0xa502('0x114')](db[_0xa502('0x7e')],{'as':_0xa502('0x17b'),'foreignKey':_0xa502('0x183')});db[_0xa502('0x5a')][_0xa502('0x114')](db['OpenchannelInteraction'],{'as':_0xa502('0x176'),'foreignKey':'OpenchannelAccountId'});db[_0xa502('0x5a')]['hasMany'](db[_0xa502('0x5e')],{'as':_0xa502('0x161'),'foreignKey':_0xa502('0x183')});db[_0xa502('0x5a')]['hasMany'](db[_0xa502('0x184')],{'as':_0xa502('0x146'),'foreignKey':_0xa502('0x183')});db[_0xa502('0x5a')][_0xa502('0x14f')](db[_0xa502('0xf4')],{'as':_0xa502('0x172'),'foreignKey':'ListId'});db[_0xa502('0x5a')]['belongsTo'](db['Pause'],{'as':_0xa502('0x151'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa502('0x5a')][_0xa502('0x123')](db['User'],{'as':_0xa502('0x154'),'through':_0xa502('0x13f')});db[_0xa502('0x184')][_0xa502('0x14f')](db['User'],{'onDelete':_0xa502('0x16f')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x185')});db[_0xa502('0x184')][_0xa502('0x14f')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0xa502('0x183')});db[_0xa502('0x184')][_0xa502('0x14f')](db[_0xa502('0x83')],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x150')});db['OpenchannelApplication']['belongsTo'](db['Tag'],{'onDelete':_0xa502('0x16f'),'foreignKey':'TagId'});db[_0xa502('0x119')]['hasMany'](db[_0xa502('0x5e')],{'as':_0xa502('0x161'),'onDelete':_0xa502('0x112'),'foreignKey':'OpenchannelInteractionId'});db[_0xa502('0x119')][_0xa502('0x14f')](db[_0xa502('0x5a')],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x183')});db['OpenchannelInteraction'][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0x119')]['belongsTo'](db[_0xa502('0x110')],{'as':_0xa502('0x167'),'foreignKey':_0xa502('0x113')});db['OpenchannelInteraction'][_0xa502('0x123')](db['Tag'],{'through':_0xa502('0x186'),'as':_0xa502('0x169')});db[_0xa502('0x119')][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':_0xa502('0x186'),'as':_0xa502('0x16a')});db['OpenchannelInteraction'][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x16b'),'through':_0xa502('0x12f'),'foreignKey':_0xa502('0x187')});db[_0xa502('0x5e')]['belongsTo'](db[_0xa502('0x110')],{'onDelete':'cascade','as':'User'});db[_0xa502('0x5e')]['belongsTo'](db[_0xa502('0x126')],{'onDelete':_0xa502('0x112'),'as':_0xa502('0x166')});db[_0xa502('0x5e')][_0xa502('0x14f')](db['OpenchannelInteraction'],{'onDelete':_0xa502('0x112'),'as':_0xa502('0x16d'),'foreignKey':'OpenchannelInteractionId'});db[_0xa502('0x5e')][_0xa502('0x14f')](db[_0xa502('0xe9')],{'as':'Attachment','foreignKey':_0xa502('0x188')});db[_0xa502('0x5e')]['belongsTo'](db[_0xa502('0x5a')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':'UserOpenchannelQueue','foreignKey':_0xa502('0x185')});db[_0xa502('0x135')][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':'team_has_openchannel_queues','as':_0xa502('0x155')});db[_0xa502('0x61')][_0xa502('0x114')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa502('0x189'),'onDelete':_0xa502('0x112')});db[_0xa502('0x61')][_0xa502('0x114')](db[_0xa502('0x7e')],{'as':_0xa502('0x17b'),'foreignKey':_0xa502('0x189')});db[_0xa502('0x61')]['hasMany'](db[_0xa502('0x6e')],{'as':_0xa502('0x18a')});db['ChatWebsite'][_0xa502('0x114')](db['ChatInteraction'],{'as':'Interactions'});db[_0xa502('0x61')]['hasMany'](db['ChatApplication'],{'as':_0xa502('0x146')});db[_0xa502('0x61')][_0xa502('0x114')](db[_0xa502('0x69')],{'as':_0xa502('0x161')});db[_0xa502('0x61')]['belongsTo'](db['CmList'],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db[_0xa502('0x61')][_0xa502('0x14f')](db[_0xa502('0x83')],{'as':_0xa502('0x83'),'foreignKey':_0xa502('0x150')});db[_0xa502('0x61')][_0xa502('0x14f')](db['MailAccount'],{'as':_0xa502('0x3d'),'foreignKey':_0xa502('0x15d')});db[_0xa502('0x61')][_0xa502('0x14f')](db[_0xa502('0x85')],{'as':_0xa502('0x151'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa502('0x61')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':'user_has_chat_websites'});db[_0xa502('0x63')][_0xa502('0x14f')](db[_0xa502('0x5a')],{});db['OpenchannelQueueReport']['belongsTo'](db['CmList'],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db[_0xa502('0x63')][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':'ContactId'});db[_0xa502('0x63')][_0xa502('0x14f')](db[_0xa502('0x119')],{});db[_0xa502('0x63')][_0xa502('0x14f')](db[_0xa502('0x5e')],{});db[_0xa502('0x63')][_0xa502('0x14f')](db[_0xa502('0x110')],{});db[_0xa502('0x63')]['belongsTo'](db[_0xa502('0x135')],{});db[_0xa502('0x65')]['belongsTo'](db[_0xa502('0x110')],{'as':_0xa502('0x18b'),'foreignKey':_0xa502('0x113'),'onDelete':_0xa502('0x16f')});db[_0xa502('0x65')]['belongsTo'](db['ChatQueue'],{'as':_0xa502('0x18c'),'foreignKey':'ChatQueueId','onDelete':_0xa502('0x16f')});db[_0xa502('0x65')][_0xa502('0x14f')](db[_0xa502('0x61')],{'as':'Website','foreignKey':_0xa502('0x189'),'onDelete':_0xa502('0x16f')});db[_0xa502('0x65')][_0xa502('0x14f')](db[_0xa502('0x8b')],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x170')});db['ChatInteraction'][_0xa502('0x114')](db[_0xa502('0x69')],{'as':_0xa502('0x161'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x18d')});db[_0xa502('0x67')][_0xa502('0x14f')](db[_0xa502('0x61')],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x189')});db[_0xa502('0x67')][_0xa502('0x14f')](db['CmContact'],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0x67')][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':_0xa502('0x167'),'foreignKey':_0xa502('0x113')});db['ChatInteraction'][_0xa502('0x123')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xa502('0x169')});db[_0xa502('0x67')]['belongsToMany'](db[_0xa502('0x8b')],{'through':_0xa502('0x18e'),'as':_0xa502('0x16a')});db[_0xa502('0x67')]['belongsToMany'](db[_0xa502('0x110')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xa502('0x18d')});db[_0xa502('0x69')][_0xa502('0x14f')](db[_0xa502('0x110')],{'onDelete':_0xa502('0x112'),'as':'User'});db[_0xa502('0x69')]['belongsTo'](db[_0xa502('0x126')],{'onDelete':'cascade','as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0x69')][_0xa502('0x14f')](db[_0xa502('0x67')],{'onDelete':'cascade','as':_0xa502('0x16d'),'foreignKey':_0xa502('0x18d')});db['ChatMessage'][_0xa502('0x14f')](db[_0xa502('0xe9')],{'as':_0xa502('0xe9'),'foreignKey':_0xa502('0x188')});db[_0xa502('0x69')][_0xa502('0x14f')](db[_0xa502('0x61')],{'as':'Account','foreignKey':_0xa502('0x189')});db['ChatOfflineMessage'][_0xa502('0x114')](db[_0xa502('0xe9')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0xa502('0x112'),'hooks':!![]});db[_0xa502('0x6a')][_0xa502('0x14f')](db['CmContact'],{'onDelete':_0xa502('0x112'),'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0x6a')][_0xa502('0x14f')](db[_0xa502('0x61')],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':_0xa502('0x2f'),'hooks':!![]});db[_0xa502('0x6c')][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':_0xa502('0x18f'),'as':_0xa502('0x155')});db[_0xa502('0x124')][_0xa502('0x114')](db[_0xa502('0xd0')],{'as':'Messages','foreignKey':_0xa502('0x190'),'onDelete':_0xa502('0x112')});db[_0xa502('0x124')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x149'),'through':_0xa502('0x125')});db[_0xa502('0x6e')][_0xa502('0x14f')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xa502('0x189')});db[_0xa502('0x70')][_0xa502('0x114')](db[_0xa502('0x126')],{'as':_0xa502('0x127'),'foreignKey':_0xa502('0x191')});db[_0xa502('0x126')][_0xa502('0x114')](db['CmHopper'],{'as':_0xa502('0x192'),'foreignKey':_0xa502('0x15c')});db['CmContact']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xa502('0x15c')});db[_0xa502('0x126')][_0xa502('0x114')](db[_0xa502('0x77')],{'as':_0xa502('0x14c'),'foreignKey':'ContactId'});db[_0xa502('0x126')][_0xa502('0x114')](db[_0xa502('0x78')],{'as':_0xa502('0x78'),'foreignKey':'ContactId'});db[_0xa502('0x126')][_0xa502('0x114')](db[_0xa502('0xd5')],{'as':'JscriptySessions','foreignKey':_0xa502('0x15c')});db[_0xa502('0x126')][_0xa502('0x114')](db[_0xa502('0x119')],{'as':_0xa502('0x11a'),'foreignKey':_0xa502('0x15c'),'onDelete':_0xa502('0x16f')});db['CmContact'][_0xa502('0x114')](db['ChatInteraction'],{'as':_0xa502('0x11b'),'foreignKey':_0xa502('0x15c'),'onDelete':'restrict'});db[_0xa502('0x126')][_0xa502('0x114')](db[_0xa502('0x57')],{'as':_0xa502('0x12d'),'foreignKey':_0xa502('0x15c'),'onDelete':'restrict'});db[_0xa502('0x126')][_0xa502('0x114')](db[_0xa502('0x4c')],{'as':_0xa502('0x11c'),'foreignKey':_0xa502('0x15c'),'onDelete':'restrict'});db['CmContact'][_0xa502('0x114')](db['MailInteraction'],{'as':_0xa502('0x11e'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa502('0x126')]['belongsTo'](db[_0xa502('0x70')],{'as':_0xa502('0x193'),'foreignKey':'CompanyId'});db['CmContact'][_0xa502('0x14f')](db['CmList'],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162'),'onDelete':'cascade'});db[_0xa502('0x126')][_0xa502('0x123')](db['User'],{'as':_0xa502('0x16b'),'through':_0xa502('0x194')});db[_0xa502('0x126')]['belongsToMany'](db[_0xa502('0x8b')],{'as':_0xa502('0x169'),'through':_0xa502('0x195')});db['CmContact']['belongsToMany'](db[_0xa502('0x8b')],{'through':'cm_contact_has_tags','as':_0xa502('0x16a')});db[_0xa502('0x73')]['belongsTo'](db['CmContact'],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c'),'onDelete':_0xa502('0x112')});db[_0xa502('0x73')][_0xa502('0x14f')](db['CmList'],{'as':_0xa502('0x172'),'foreignKey':'ListId','onDelete':_0xa502('0x112')});db[_0xa502('0x73')][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':'Agent','foreignKey':_0xa502('0x113')});db[_0xa502('0x73')][_0xa502('0x14f')](db['VoiceQueue'],{'as':_0xa502('0x18c'),'foreignKey':_0xa502('0x14a'),'onDelete':_0xa502('0x112')});db[_0xa502('0x73')][_0xa502('0x14f')](db['Campaign'],{'as':_0xa502('0xe8'),'foreignKey':_0xa502('0x196'),'onDelete':_0xa502('0x112')});db[_0xa502('0x73')][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':_0xa502('0x167'),'foreignKey':_0xa502('0x197')});db[_0xa502('0x75')]['belongsTo'](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c'),'onDelete':'cascade'});db[_0xa502('0x75')]['belongsTo'](db[_0xa502('0xf4')],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162'),'onDelete':_0xa502('0x112')});db[_0xa502('0x75')][_0xa502('0x14f')](db[_0xa502('0x1c')],{'as':_0xa502('0x18c'),'foreignKey':'VoiceQueueId','onDelete':_0xa502('0x112')});db[_0xa502('0x75')][_0xa502('0x14f')](db[_0xa502('0xe8')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xa502('0x112')});db[_0xa502('0x7d')]['hasMany'](db[_0xa502('0x81')],{'as':{'plural':_0xa502('0x198'),'singular':_0xa502('0x199')},'foreignKey':_0xa502('0x19a'),'onDelete':'cascade','hooks':!![]});db[_0xa502('0x7d')]['hasMany'](db[_0xa502('0x81')],{'as':{'plural':'Any','singular':_0xa502('0x19b')},'foreignKey':_0xa502('0x19c'),'onDelete':_0xa502('0x112'),'hooks':!![]});db[_0xa502('0x7d')][_0xa502('0x114')](db[_0xa502('0x19d')],{'as':_0xa502('0x19e'),'foreignKey':_0xa502('0x19f'),'onDelete':_0xa502('0x112'),'hooks':!![]});db[_0xa502('0x174')][_0xa502('0x114')](db[_0xa502('0x174')],{'as':_0xa502('0x160'),'foreignKey':_0xa502('0x1a0'),'onDelete':_0xa502('0x112')});db[_0xa502('0x83')][_0xa502('0x114')](db[_0xa502('0x83')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xa502('0x112'),'hooks':!![],'required':![]});db[_0xa502('0x83')]['hasMany'](db[_0xa502('0x18')],{'as':_0xa502('0x116'),'foreignKey':'IntervalId','onDelete':_0xa502('0x16f')});db['Interval'][_0xa502('0x114')](db[_0xa502('0x44')],{'as':_0xa502('0x1a1'),'foreignKey':'IntervalId'});db['Interval']['hasMany'](db[_0xa502('0x65')],{'as':_0xa502('0x1a2'),'foreignKey':_0xa502('0x150')});db[_0xa502('0x83')][_0xa502('0x114')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0xa502('0x150')});db[_0xa502('0x83')]['hasMany'](db[_0xa502('0x56')],{'as':_0xa502('0x1a3'),'foreignKey':'IntervalId'});db[_0xa502('0x89')][_0xa502('0x14f')](db[_0xa502('0x3d')],{});db[_0xa502('0x89')]['belongsTo'](db[_0xa502('0x95')],{'foreignKey':_0xa502('0x1a4')});db['Schedule'][_0xa502('0x14f')](db[_0xa502('0x94')],{'foreignKey':_0xa502('0x1a5')});db[_0xa502('0x8a')][_0xa502('0x123')](db[_0xa502('0x1a')],{'as':_0xa502('0x1a6'),'through':_0xa502('0x148'),'onDelete':_0xa502('0x16f')});db[_0xa502('0x8b')][_0xa502('0x123')](db[_0xa502('0x126')],{'through':_0xa502('0x195')});db[_0xa502('0x8b')]['belongsToMany'](db[_0xa502('0x67')],{'through':_0xa502('0x18e')});db['Tag'][_0xa502('0x123')](db[_0xa502('0x11d')],{'through':_0xa502('0x168')});db[_0xa502('0x8b')][_0xa502('0x123')](db[_0xa502('0x57')],{'through':'sms_interaction_has_tags'});db[_0xa502('0x8b')][_0xa502('0x123')](db[_0xa502('0x4c')],{'through':_0xa502('0x17a')});db[_0xa502('0x8b')][_0xa502('0x123')](db[_0xa502('0x119')],{'through':_0xa502('0x186')});db[_0xa502('0x8b')]['belongsToMany'](db[_0xa502('0x11f')],{'through':'whatsapp_interaction_has_tags'});db[_0xa502('0x8f')][_0xa502('0x114')](db[_0xa502('0x81')],{'as':{'plural':_0xa502('0x1a7'),'singular':'AllCondition'},'foreignKey':_0xa502('0x1a8'),'onDelete':_0xa502('0x112'),'hooks':!![]});db[_0xa502('0x8f')]['hasMany'](db['Condition'],{'as':{'plural':_0xa502('0x1a9'),'singular':_0xa502('0x1aa')},'foreignKey':_0xa502('0x1ab'),'onDelete':_0xa502('0x112'),'hooks':!![]});db[_0xa502('0x8f')][_0xa502('0x114')](db[_0xa502('0x19d')],{'as':_0xa502('0x19e'),'foreignKey':'TriggerId','onDelete':_0xa502('0x112'),'hooks':!![]});db[_0xa502('0x94')][_0xa502('0x114')](db[_0xa502('0x9a')],{'as':_0xa502('0x1ac'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1a5'),'hooks':!![]});db[_0xa502('0x95')][_0xa502('0x114')](db[_0xa502('0x9a')],{'as':_0xa502('0x1ac'),'onDelete':'cascade','foreignKey':_0xa502('0x1a4')});db[_0xa502('0x99')][_0xa502('0x114')](db[_0xa502('0x9a')],{'as':_0xa502('0x1ac'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1ad')});db[_0xa502('0x9a')][_0xa502('0x14f')](db[_0xa502('0x99')],{'foreignKey':_0xa502('0x1ad')});db[_0xa502('0x9c')]['hasMany'](db[_0xa502('0x9e')],{'as':_0xa502('0x1ae'),'onDelete':'cascade','foreignKey':_0xa502('0x1af')});db[_0xa502('0x9e')][_0xa502('0x114')](db[_0xa502('0xa0')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xa502('0x1b0')});db[_0xa502('0x9e')][_0xa502('0x114')](db[_0xa502('0xa0')],{'as':_0xa502('0x1b1'),'onDelete':_0xa502('0x112'),'foreignKey':'DescriptionId'});db[_0xa502('0x9e')][_0xa502('0x114')](db[_0xa502('0xa0')],{'as':_0xa502('0x1ac'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0x9e')]['belongsTo'](db[_0xa502('0x9c')],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x1af')});db['SalesforceField']['hasMany'](db[_0xa502('0xa0')],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0xa0')]['hasMany'](db['SalesforceField'],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xa0')]['hasMany'](db['SalesforceField'],{'as':_0xa502('0x1b6'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0xa0')][_0xa502('0x14f')](db[_0xa502('0x91')],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db[_0xa502('0xa2')][_0xa502('0x114')](db['SugarcrmConfiguration'],{'as':_0xa502('0x1ae'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1af')});db['SugarcrmConfiguration'][_0xa502('0x114')](db[_0xa502('0xa4')],{'as':_0xa502('0x1b8'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0x1b9')][_0xa502('0x114')](db['SugarcrmField'],{'as':_0xa502('0x1b1'),'onDelete':_0xa502('0x112'),'foreignKey':'DescriptionId'});db[_0xa502('0x1b9')][_0xa502('0x114')](db[_0xa502('0xa4')],{'as':'Fields','onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0x1b9')][_0xa502('0x14f')](db['SugarcrmAccount'],{'as':_0xa502('0x165'),'foreignKey':'AccountId'});db[_0xa502('0xa4')][_0xa502('0x114')](db[_0xa502('0xa4')],{'as':_0xa502('0x1b3'),'foreignKey':'SubjectId'});db[_0xa502('0xa4')][_0xa502('0x114')](db[_0xa502('0xa4')],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db['SugarcrmField']['hasMany'](db[_0xa502('0xa4')],{'as':'Field','foreignKey':_0xa502('0x1b2')});db[_0xa502('0xa4')][_0xa502('0x14f')](db[_0xa502('0x91')],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db[_0xa502('0xa6')][_0xa502('0x114')](db[_0xa502('0xa7')],{'as':'Configurations','onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0xa7')][_0xa502('0x114')](db['DeskField'],{'as':_0xa502('0x1b8'),'onDelete':'cascade','foreignKey':_0xa502('0x1b0')});db['DeskConfiguration'][_0xa502('0x114')](db['DeskField'],{'as':_0xa502('0x1b1'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b5')});db['DeskConfiguration']['hasMany'](db[_0xa502('0xa9')],{'as':_0xa502('0x1ac'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b2')});db['DeskConfiguration']['belongsTo'](db[_0xa502('0xa6')],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0xa7')][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0xa502('0x114')](db[_0xa502('0xa9')],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0xa9')][_0xa502('0x114')](db[_0xa502('0xa9')],{'as':'Description','foreignKey':_0xa502('0x1b5')});db[_0xa502('0xa9')][_0xa502('0x114')](db[_0xa502('0xa9')],{'as':'Field','foreignKey':_0xa502('0x1b2')});db['DeskField']['belongsTo'](db[_0xa502('0x91')],{'as':'Variable','foreignKey':_0xa502('0x1b7')});db[_0xa502('0x1ba')][_0xa502('0x114')](db[_0xa502('0xac')],{'as':'Configurations','onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0xac')][_0xa502('0x114')](db[_0xa502('0x1bb')],{'as':_0xa502('0x1b8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xa502('0xac')][_0xa502('0x114')](db['ZohoField'],{'as':_0xa502('0x1b1'),'onDelete':_0xa502('0x112'),'foreignKey':'DescriptionId'});db[_0xa502('0xac')][_0xa502('0x114')](db[_0xa502('0x1bb')],{'as':_0xa502('0x1ac'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0xac')][_0xa502('0x14f')](db['ZohoAccount'],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0x1bb')][_0xa502('0x114')](db['ZohoField'],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db['ZohoField'][_0xa502('0x114')](db[_0xa502('0x1bb')],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db['ZohoField']['hasMany'](db[_0xa502('0x1bb')],{'as':_0xa502('0x1b6'),'foreignKey':'FieldId'});db[_0xa502('0x1bb')][_0xa502('0x14f')](db[_0xa502('0x91')],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db[_0xa502('0xaf')][_0xa502('0x114')](db[_0xa502('0x1bc')],{'as':_0xa502('0x1ae'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1af')});db['ZendeskConfiguration'][_0xa502('0x114')](db[_0xa502('0x1bd')],{'as':_0xa502('0x1b8'),'foreignKey':'SubjectId'});db[_0xa502('0x1bc')][_0xa502('0x114')](db[_0xa502('0x1bd')],{'as':_0xa502('0x1b1'),'foreignKey':'DescriptionId'});db[_0xa502('0x1bc')][_0xa502('0x114')](db['ZendeskField'],{'as':_0xa502('0x1ac'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0x1bc')]['belongsTo'](db[_0xa502('0xaf')],{'as':'Account','foreignKey':_0xa502('0x1af')});db[_0xa502('0x1bc')][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':_0xa502('0x1be')});db[_0xa502('0x1bd')]['hasMany'](db[_0xa502('0x1bd')],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0x1bd')][_0xa502('0x114')](db[_0xa502('0x1bd')],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0x1bd')][_0xa502('0x114')](db[_0xa502('0x1bd')],{'as':_0xa502('0x1b6'),'foreignKey':'FieldId'});db[_0xa502('0x1bd')][_0xa502('0x14f')](db[_0xa502('0x91')],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db[_0xa502('0xb2')][_0xa502('0x114')](db[_0xa502('0xb3')],{'as':_0xa502('0x1ae'),'onDelete':'cascade','foreignKey':_0xa502('0x1af')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0xa502('0x1b8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xa502('0xb3')][_0xa502('0x114')](db[_0xa502('0xb5')],{'as':_0xa502('0x1b1'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xb3')]['hasMany'](db[_0xa502('0xb5')],{'as':_0xa502('0x1ac'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0xb3')]['belongsTo'](db[_0xa502('0xb2')],{'as':'Account','foreignKey':_0xa502('0x1af')});db[_0xa502('0xb3')]['belongsToMany'](db[_0xa502('0x8b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xa502('0xb5')][_0xa502('0x114')](db[_0xa502('0xb5')],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0xb5')][_0xa502('0x114')](db[_0xa502('0xb5')],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xb5')][_0xa502('0x114')](db['FreshdeskField'],{'as':_0xa502('0x1b6'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0xb5')]['belongsTo'](db[_0xa502('0x91')],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db['VtigerAccount']['hasMany'](db[_0xa502('0xb9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa502('0x1af')});db[_0xa502('0xb9')]['hasMany'](db[_0xa502('0xbb')],{'as':_0xa502('0x1b8'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0xb9')][_0xa502('0x114')](db[_0xa502('0xbb')],{'as':'Descriptions','foreignKey':_0xa502('0x1b5')});db['VtigerConfiguration'][_0xa502('0x114')](db[_0xa502('0xbb')],{'as':_0xa502('0x1ac'),'foreignKey':'FieldId'});db['VtigerConfiguration']['belongsTo'](db[_0xa502('0xb7')],{'as':'Account','foreignKey':_0xa502('0x1af')});db['VtigerField'][_0xa502('0x114')](db[_0xa502('0xbb')],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0xbb')]['hasMany'](db['VtigerField'],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xbb')][_0xa502('0x114')](db['VtigerField'],{'as':'Field','foreignKey':_0xa502('0x1b2')});db[_0xa502('0xbb')][_0xa502('0x14f')](db[_0xa502('0x91')],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db[_0xa502('0xbd')]['hasMany'](db[_0xa502('0xbf')],{'as':_0xa502('0x1ae'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0xbf')][_0xa502('0x114')](db[_0xa502('0x1bf')],{'as':'Subjects','foreignKey':_0xa502('0x1b0')});db[_0xa502('0xbf')][_0xa502('0x114')](db['ServicenowField'],{'as':_0xa502('0x1b1'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xbf')]['hasMany'](db[_0xa502('0x1bf')],{'as':_0xa502('0x1ac'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0xbf')][_0xa502('0x14f')](db[_0xa502('0xbd')],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0x1bf')][_0xa502('0x114')](db[_0xa502('0x1bf')],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db['ServicenowField'][_0xa502('0x114')](db[_0xa502('0x1bf')],{'as':_0xa502('0x1b4'),'foreignKey':'DescriptionId'});db[_0xa502('0x1bf')][_0xa502('0x114')](db[_0xa502('0x1bf')],{'as':_0xa502('0x1b6'),'foreignKey':'FieldId'});db[_0xa502('0x1bf')]['belongsTo'](db[_0xa502('0x91')],{'as':'Variable','foreignKey':_0xa502('0x1b7')});db[_0xa502('0xc1')]['hasMany'](db[_0xa502('0xc3')],{'as':_0xa502('0x1ae'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0xc1')][_0xa502('0x14f')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xa502('0x15e')});db['Dynamics365Configuration'][_0xa502('0x114')](db[_0xa502('0xc5')],{'as':_0xa502('0x1b8'),'onDelete':'cascade','foreignKey':_0xa502('0x1b0')});db[_0xa502('0xc3')]['hasMany'](db[_0xa502('0xc5')],{'as':'Descriptions','onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xc3')]['hasMany'](db[_0xa502('0xc5')],{'as':'Fields','onDelete':_0xa502('0x112'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xa502('0x14f')](db[_0xa502('0xc1')],{'as':_0xa502('0x165'),'foreignKey':'AccountId'});db[_0xa502('0xc5')]['hasMany'](db[_0xa502('0xc5')],{'as':_0xa502('0x1b3'),'foreignKey':_0xa502('0x1b0')});db[_0xa502('0xc5')][_0xa502('0x114')](db['Dynamics365Field'],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xc5')][_0xa502('0x114')](db[_0xa502('0xc5')],{'as':_0xa502('0x1b6'),'foreignKey':_0xa502('0x1b2')});db['Dynamics365Field']['belongsTo'](db[_0xa502('0x91')],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db[_0xa502('0xc6')][_0xa502('0x114')](db[_0xa502('0xc8')],{'as':'Configurations','onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1af')});db[_0xa502('0xc8')][_0xa502('0x114')](db[_0xa502('0xca')],{'as':'Subjects','foreignKey':_0xa502('0x1b0')});db[_0xa502('0xc8')][_0xa502('0x114')](db[_0xa502('0xca')],{'as':'Descriptions','foreignKey':_0xa502('0x1b5')});db[_0xa502('0xc8')]['hasMany'](db[_0xa502('0xca')],{'as':_0xa502('0x1ac'),'foreignKey':_0xa502('0x1b2')});db[_0xa502('0xc8')][_0xa502('0x14f')](db[_0xa502('0xc6')],{'as':'Account','foreignKey':'AccountId'});db[_0xa502('0xca')][_0xa502('0x114')](db[_0xa502('0xca')],{'as':_0xa502('0x1b3'),'foreignKey':'SubjectId'});db[_0xa502('0xca')]['hasMany'](db[_0xa502('0xca')],{'as':_0xa502('0x1b4'),'foreignKey':_0xa502('0x1b5')});db[_0xa502('0xca')][_0xa502('0x114')](db[_0xa502('0xca')],{'as':_0xa502('0x1b6'),'foreignKey':_0xa502('0x1b2')});db['FreshsalesField'][_0xa502('0x14f')](db['Variable'],{'as':_0xa502('0x91'),'foreignKey':_0xa502('0x1b7')});db[_0xa502('0xcf')][_0xa502('0x14f')](db[_0xa502('0x61')],{});db[_0xa502('0xcf')][_0xa502('0x14f')](db[_0xa502('0xf4')],{'as':'List','foreignKey':_0xa502('0x162')});db[_0xa502('0xcf')][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db[_0xa502('0xcf')][_0xa502('0x14f')](db[_0xa502('0x67')],{});db[_0xa502('0xcf')][_0xa502('0x14f')](db[_0xa502('0x69')],{});db[_0xa502('0xcf')][_0xa502('0x14f')](db[_0xa502('0x110')],{});db[_0xa502('0xcf')][_0xa502('0x14f')](db['ChatQueue'],{});db['ChatInternalMessage'][_0xa502('0x14f')](db['User'],{'onDelete':'cascade','foreignKey':_0xa502('0x1c0')});db[_0xa502('0xd0')]['belongsTo'](db[_0xa502('0x110')],{'onDelete':'cascade','foreignKey':_0xa502('0x1c1')});db['JscriptySessionReport'][_0xa502('0x114')](db[_0xa502('0xd3')],{'foreignKey':_0xa502('0x1c2'),'onDelete':_0xa502('0x112')});db['JscriptySessionReport'][_0xa502('0x114')](db[_0xa502('0xd2')],{'foreignKey':_0xa502('0x1c2'),'onDelete':_0xa502('0x112')});db[_0xa502('0xd7')]['belongsTo'](db['SmsAccount'],{});db['SmsQueueReport']['belongsTo'](db[_0xa502('0xf4')],{'as':'List','foreignKey':'ListId'});db['SmsQueueReport'][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':'Contact','foreignKey':_0xa502('0x15c')});db[_0xa502('0xd7')][_0xa502('0x14f')](db[_0xa502('0x57')],{});db['SmsQueueReport'][_0xa502('0x14f')](db[_0xa502('0x17d')],{});db[_0xa502('0xd7')][_0xa502('0x14f')](db[_0xa502('0x110')],{});db[_0xa502('0xd7')][_0xa502('0x14f')](db[_0xa502('0x17e')],{});db[_0xa502('0xdc')]['hasMany'](db[_0xa502('0xd5')],{'foreignKey':'ProjectId'});db[_0xa502('0xdc')][_0xa502('0x114')](db['JscriptyQuestionReport'],{'foreignKey':_0xa502('0x1c3')});db[_0xa502('0xdc')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xa502('0x1c3')});db[_0xa502('0xe0')]['belongsToMany'](db[_0xa502('0x110')],{'as':_0xa502('0x16b'),'through':_0xa502('0x1c4')});db[_0xa502('0xe4')][_0xa502('0x123')](db[_0xa502('0x110')],{'as':'Agents','through':_0xa502('0x129')});db[_0xa502('0xe4')]['belongsToMany'](db[_0xa502('0x1c')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0xa502('0xe4')][_0xa502('0x123')](db[_0xa502('0x3f')],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team'][_0xa502('0x123')](db[_0xa502('0x6c')],{'through':_0xa502('0x18f'),'as':_0xa502('0x1c5')});db[_0xa502('0xe4')][_0xa502('0x123')](db[_0xa502('0x50')],{'through':'team_has_fax_queues','as':_0xa502('0x1c6')});db[_0xa502('0xe4')][_0xa502('0x123')](db[_0xa502('0x17e')],{'through':_0xa502('0x182'),'as':_0xa502('0x134')});db['Team'][_0xa502('0x123')](db['OpenchannelQueue'],{'through':_0xa502('0x1c7'),'as':'OpenchannelQueues'});db[_0xa502('0xe4')]['belongsToMany'](db['WhatsappQueue'],{'through':_0xa502('0x1c8'),'as':_0xa502('0x136')});db[_0xa502('0xe4')][_0xa502('0x123')](db[_0xa502('0xf6')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0xa502('0xe8')][_0xa502('0x114')](db['CmHopper'],{'as':_0xa502('0x192'),'foreignKey':_0xa502('0x196')});db[_0xa502('0xe8')][_0xa502('0x114')](db[_0xa502('0x117')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0xa502('0xe8')][_0xa502('0x114')](db['CmHopperHistory'],{'as':_0xa502('0x14c'),'foreignKey':_0xa502('0x196')});db['Campaign'][_0xa502('0x114')](db[_0xa502('0x75')],{'as':_0xa502('0x14d'),'foreignKey':_0xa502('0x196')});db[_0xa502('0xe8')][_0xa502('0x14f')](db[_0xa502('0x29')],{'as':'Trunk','foreignKey':'TrunkId'});db['Campaign']['belongsTo'](db[_0xa502('0x29')],{'as':_0xa502('0x1c9'),'foreignKey':_0xa502('0x14e')});db['Campaign'][_0xa502('0x14f')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0xa502('0xe8')][_0xa502('0x14f')](db[_0xa502('0xe0')],{'as':_0xa502('0xe0'),'foreignKey':_0xa502('0x1ca')});db['Campaign'][_0xa502('0x123')](db[_0xa502('0xf4')],{'as':_0xa502('0x128'),'through':_0xa502('0x1cb')});db['Campaign'][_0xa502('0x123')](db['CmList'],{'as':_0xa502('0x156'),'through':'campaigns_has_cm_blacklists'});db[_0xa502('0xe9')][_0xa502('0x14f')](db['ChatOfflineMessage'],{'as':_0xa502('0x6a'),'foreignKey':_0xa502('0x16e')});db[_0xa502('0xec')][_0xa502('0x14f')](db[_0xa502('0x42')],{});db[_0xa502('0xec')][_0xa502('0x14f')](db[_0xa502('0x11d')],{});db[_0xa502('0xec')]['belongsTo'](db[_0xa502('0x3d')],{'foreignKey':_0xa502('0x1cc'),'as':_0xa502('0x1cd')});db[_0xa502('0xec')]['belongsTo'](db[_0xa502('0x110')],{'foreignKey':_0xa502('0x1ce'),'as':_0xa502('0x1cf')});db['MailTransferReport'][_0xa502('0x14f')](db['User'],{'foreignKey':'ToUserId','as':_0xa502('0x1d0')});db[_0xa502('0xec')][_0xa502('0x14f')](db['MailQueue'],{'foreignKey':_0xa502('0x1d1'),'as':_0xa502('0x1d2')});db[_0xa502('0xec')][_0xa502('0x14f')](db[_0xa502('0x3d')],{'foreignKey':'ToMailAccountId','as':_0xa502('0x1d3')});db[_0xa502('0xee')][_0xa502('0x14f')](db[_0xa502('0x69')],{});db[_0xa502('0xee')][_0xa502('0x14f')](db['ChatInteraction'],{});db[_0xa502('0xee')][_0xa502('0x14f')](db['ChatWebsite'],{'foreignKey':_0xa502('0x1d4'),'as':_0xa502('0x1cd')});db[_0xa502('0xee')][_0xa502('0x14f')](db['User'],{'foreignKey':_0xa502('0x1ce'),'as':'FromAgent'});db[_0xa502('0xee')]['belongsTo'](db[_0xa502('0x110')],{'foreignKey':'ToUserId','as':_0xa502('0x1d0')});db[_0xa502('0xee')][_0xa502('0x14f')](db[_0xa502('0x6c')],{'foreignKey':_0xa502('0x1d5'),'as':_0xa502('0x1d2')});db[_0xa502('0xee')][_0xa502('0x14f')](db[_0xa502('0x61')],{'foreignKey':_0xa502('0x1d6'),'as':_0xa502('0x1d3')});db[_0xa502('0xef')][_0xa502('0x14f')](db[_0xa502('0x4e')],{});db[_0xa502('0xef')][_0xa502('0x14f')](db[_0xa502('0x4c')],{});db[_0xa502('0xef')]['belongsTo'](db[_0xa502('0x139')],{'foreignKey':_0xa502('0x1d7'),'as':_0xa502('0x1cd')});db[_0xa502('0xef')]['belongsTo'](db[_0xa502('0x110')],{'foreignKey':_0xa502('0x1ce'),'as':_0xa502('0x1cf')});db[_0xa502('0xef')][_0xa502('0x14f')](db[_0xa502('0x110')],{'foreignKey':_0xa502('0x1d8'),'as':'ToAgent'});db[_0xa502('0xef')]['belongsTo'](db[_0xa502('0x50')],{'foreignKey':_0xa502('0x1d9'),'as':'ToQueue'});db['FaxTransferReport'][_0xa502('0x14f')](db[_0xa502('0x139')],{'foreignKey':_0xa502('0x1da'),'as':_0xa502('0x1d3')});db[_0xa502('0xf0')][_0xa502('0x14f')](db[_0xa502('0x5e')],{});db[_0xa502('0xf0')][_0xa502('0x14f')](db[_0xa502('0x119')],{});db[_0xa502('0xf0')]['belongsTo'](db[_0xa502('0x5a')],{'foreignKey':_0xa502('0x1db'),'as':'FromAccount'});db[_0xa502('0xf0')]['belongsTo'](db[_0xa502('0x110')],{'foreignKey':_0xa502('0x1ce'),'as':_0xa502('0x1cf')});db[_0xa502('0xf0')][_0xa502('0x14f')](db[_0xa502('0x110')],{'foreignKey':'ToUserId','as':_0xa502('0x1d0')});db['OpenchannelTransferReport']['belongsTo'](db[_0xa502('0x135')],{'foreignKey':_0xa502('0x1dc'),'as':_0xa502('0x1d2')});db[_0xa502('0xf0')][_0xa502('0x14f')](db[_0xa502('0x5a')],{'foreignKey':_0xa502('0x1dd'),'as':_0xa502('0x1d3')});db[_0xa502('0xf2')][_0xa502('0x14f')](db['SmsMessage'],{});db[_0xa502('0xf2')][_0xa502('0x14f')](db['SmsInteraction'],{});db[_0xa502('0xf2')][_0xa502('0x14f')](db[_0xa502('0x54')],{'foreignKey':'FromSmsAccountId','as':_0xa502('0x1cd')});db[_0xa502('0xf2')][_0xa502('0x14f')](db['User'],{'foreignKey':_0xa502('0x1ce'),'as':'FromAgent'});db[_0xa502('0xf2')][_0xa502('0x14f')](db[_0xa502('0x110')],{'foreignKey':_0xa502('0x1d8'),'as':_0xa502('0x1d0')});db[_0xa502('0xf2')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0xa502('0x1de'),'as':_0xa502('0x1d2')});db[_0xa502('0xf2')][_0xa502('0x14f')](db[_0xa502('0x54')],{'foreignKey':_0xa502('0x1df'),'as':_0xa502('0x1d3')});db['CmList'][_0xa502('0x114')](db[_0xa502('0x174')],{'as':_0xa502('0x160'),'foreignKey':_0xa502('0x162'),'onDelete':'cascade'});db[_0xa502('0xf4')][_0xa502('0x114')](db['CmCustomField'],{'as':'CustomFields','foreignKey':'ListId'});db[_0xa502('0xf4')][_0xa502('0x114')](db[_0xa502('0x126')],{'as':'Contacts','onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x162')});db[_0xa502('0xf4')]['hasMany'](db[_0xa502('0x117')],{'as':'HopperFinals','foreignKey':_0xa502('0x162')});db[_0xa502('0xf4')]['hasMany'](db[_0xa502('0x77')],{'as':_0xa502('0x118'),'foreignKey':_0xa502('0x162')});db[_0xa502('0xf4')][_0xa502('0x114')](db['ReportAgentPreview'],{'as':_0xa502('0x78'),'foreignKey':'ListId'});db[_0xa502('0xf4')][_0xa502('0x123')](db[_0xa502('0x1c')],{'as':_0xa502('0x1e0'),'through':_0xa502('0x153')});db[_0xa502('0xf4')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xa502('0x137')});db['VoicePrefix'][_0xa502('0x114')](db[_0xa502('0x18')],{'as':'Extensions','onDelete':_0xa502('0x112')});db[_0xa502('0xf6')]['belongsToMany'](db[_0xa502('0x110')],{'as':'Agents','through':_0xa502('0x10c')});db[_0xa502('0xf6')][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':_0xa502('0x10a'),'as':'Teams'});db[_0xa502('0xf7')][_0xa502('0x114')](db[_0xa502('0x110')],{'as':_0xa502('0x16b'),'foreignKey':_0xa502('0x122')});db['UserProfile'][_0xa502('0x114')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xa502('0x122'),'onDelete':_0xa502('0x112')});db[_0xa502('0xf9')]['hasMany'](db['UserProfileResource'],{'as':_0xa502('0x1e1'),'foreignKey':_0xa502('0x1e2'),'onDelete':_0xa502('0x112')});db[_0xa502('0xfd')][_0xa502('0x114')](db[_0xa502('0x174')],{'as':_0xa502('0x160'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xa502('0xfd')][_0xa502('0x114')](db[_0xa502('0x7e')],{'as':'Answers','foreignKey':_0xa502('0x1e3')});db['WhatsappAccount'][_0xa502('0x114')](db[_0xa502('0x101')],{'as':_0xa502('0x161'),'foreignKey':_0xa502('0x1e3')});db[_0xa502('0xfd')]['hasMany'](db[_0xa502('0x11f')],{'as':'Interactions'});db[_0xa502('0xfd')][_0xa502('0x114')](db[_0xa502('0xff')],{'as':_0xa502('0x146')});db[_0xa502('0xfd')][_0xa502('0x14f')](db['CmList'],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db[_0xa502('0xfd')][_0xa502('0x14f')](db[_0xa502('0x85')],{'as':_0xa502('0x151'),'foreignKey':_0xa502('0x152')});db['WhatsappAccount'][_0xa502('0x123')](db[_0xa502('0x110')],{'as':_0xa502('0x154'),'through':'user_has_whatsapp_accounts'});db[_0xa502('0xff')][_0xa502('0x14f')](db[_0xa502('0x110')],{'onDelete':_0xa502('0x16f')});db['WhatsappApplication'][_0xa502('0x14f')](db['WhatsappQueue'],{'onDelete':_0xa502('0x16f')});db['WhatsappApplication'][_0xa502('0x14f')](db[_0xa502('0xfd')],{'onDelete':_0xa502('0x16f')});db[_0xa502('0xff')][_0xa502('0x14f')](db[_0xa502('0x83')],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x150')});db[_0xa502('0xff')][_0xa502('0x14f')](db[_0xa502('0x8b')],{'onDelete':_0xa502('0x16f'),'foreignKey':_0xa502('0x170')});db[_0xa502('0x11f')][_0xa502('0x114')](db[_0xa502('0x101')],{'as':_0xa502('0x161'),'onDelete':_0xa502('0x112'),'foreignKey':_0xa502('0x1e4')});db[_0xa502('0x11f')][_0xa502('0x14f')](db[_0xa502('0xfd')],{'as':_0xa502('0x165'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':'Contact','foreignKey':_0xa502('0x15c')});db[_0xa502('0x11f')][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':_0xa502('0x167'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0xa502('0x123')](db[_0xa502('0x8b')],{'through':_0xa502('0x1e5'),'as':_0xa502('0x169')});db['WhatsappInteraction'][_0xa502('0x123')](db['Tag'],{'through':_0xa502('0x1e5'),'as':_0xa502('0x16a')});db[_0xa502('0x11f')]['belongsToMany'](db[_0xa502('0x110')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0xa502('0x1e4')});db[_0xa502('0x101')][_0xa502('0x14f')](db['User'],{'as':_0xa502('0x110')});db[_0xa502('0x101')]['belongsTo'](db[_0xa502('0x126')],{'onDelete':_0xa502('0x112'),'as':_0xa502('0x166')});db[_0xa502('0x101')][_0xa502('0x14f')](db[_0xa502('0x11f')],{'onDelete':_0xa502('0x112'),'as':'Interaction','foreignKey':_0xa502('0x1e4')});db[_0xa502('0x101')][_0xa502('0x14f')](db[_0xa502('0xfd')],{'as':_0xa502('0x165'),'foreignKey':_0xa502('0x1e3')});db[_0xa502('0x102')][_0xa502('0x14f')](db[_0xa502('0xfd')],{});db[_0xa502('0x102')][_0xa502('0x14f')](db['CmList'],{'as':_0xa502('0x172'),'foreignKey':_0xa502('0x162')});db['WhatsappQueueReport'][_0xa502('0x14f')](db[_0xa502('0x126')],{'as':_0xa502('0x166'),'foreignKey':_0xa502('0x15c')});db['WhatsappQueueReport']['belongsTo'](db[_0xa502('0x11f')],{});db['WhatsappQueueReport'][_0xa502('0x14f')](db[_0xa502('0x105')],{});db[_0xa502('0x102')]['belongsTo'](db['WhatsappMessage'],{});db[_0xa502('0x102')][_0xa502('0x14f')](db['User'],{});db[_0xa502('0x103')][_0xa502('0x14f')](db[_0xa502('0x101')],{});db[_0xa502('0x103')][_0xa502('0x14f')](db[_0xa502('0x11f')],{});db[_0xa502('0x103')][_0xa502('0x14f')](db[_0xa502('0xfd')],{'foreignKey':_0xa502('0x1e6'),'as':_0xa502('0x1cd')});db['WhatsappTransferReport']['belongsTo'](db[_0xa502('0xfd')],{'foreignKey':_0xa502('0x1e7'),'as':_0xa502('0x1d3')});db[_0xa502('0x103')]['belongsTo'](db[_0xa502('0x105')],{'foreignKey':'ToQueueId','as':_0xa502('0x1d2')});db[_0xa502('0x103')][_0xa502('0x14f')](db[_0xa502('0x110')],{'foreignKey':_0xa502('0x1ce'),'as':_0xa502('0x1cf')});db[_0xa502('0x103')]['belongsTo'](db[_0xa502('0x110')],{'foreignKey':_0xa502('0x1d8'),'as':_0xa502('0x1d0')});db['WhatsappQueue'][_0xa502('0x123')](db[_0xa502('0x110')],{'as':'Agents','through':_0xa502('0x1e8'),'foreignKey':_0xa502('0x1e9')});db[_0xa502('0x105')][_0xa502('0x123')](db[_0xa502('0xe4')],{'through':_0xa502('0x1c8'),'as':_0xa502('0x155')});db[_0xa502('0x10e')][_0xa502('0x14f')](db[_0xa502('0x110')],{'as':_0xa502('0x1ea'),'foreignKey':'UserId','onDelete':_0xa502('0x112'),'hooks':!![]});db[_0xa502('0x107')]['hasOne'](db['Dynamics365Account'],{'as':_0xa502('0xc1'),'onDelete':_0xa502('0x16f')});db['CloudProvider']['hasOne'](db[_0xa502('0x39')],{'as':_0xa502('0x1eb'),'onDelete':_0xa502('0x16f')});db[_0xa502('0x107')][_0xa502('0x111')](db[_0xa502('0x3b')],{'as':'Smtp','onDelete':'restrict'});module[_0xa502('0x1ec')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xaca4=['../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','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','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotifications','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','TrunkId','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','VoiceRecording','Messages','mailbox','VoiceQueueReport','QueueCalls','uniqueid','VoiceCallReport','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','List','TemplateId','Agents','team_has_mail_queues','Account','Tag','mail_interaction_has_tags','Users','MailInteractionId','Attachments','Interaction','IntervalId','ListId','Dashboard','Items','FaxAccountId','FaxMessage','FaxInteractionId','Owner','Tags','fax_interaction_has_tags','ThroughTags','team_has_fax_queues','SmsAccountId','TagId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','AttachmentId','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CompanyId','JscriptySessions','Company','cm_contact_has_tags','CampaignId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','Actions','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','VariableId','Description','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Field','ServicenowConfiguration','ServicenowField','ServicenowAccount','Dynamics365Account','Dynamics365Configuration','FromId','ToId','SessionId','JscriptyProject','ProjectId','MailQueues','ChatQueues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkBackup','SquareProjectId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','Queues','userProfileId','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','user_has_whatsapp_interactions','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','UserSetting','user','exports','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','sequelize','username','password','options','database','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceRecording/voiceRecording.model','ScreenRecording'];(function(_0x7ca710,_0xf4bed8){var _0x2604c8=function(_0x166b6a){while(--_0x166b6a){_0x7ca710['push'](_0x7ca710['shift']());}};_0x2604c8(++_0xf4bed8);}(_0xaca4,0x1df));var _0x4aca=function(_0x2d148b,_0x5c2bd9){_0x2d148b=_0x2d148b-0x0;var _0x59caeb=_0xaca4[_0x2d148b];return _0x59caeb;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_[_0x4aca('0x0')](config['sequelize'],{'database':_0x4aca('0x1'),'username':_0x4aca('0x2'),'password':_0x4aca('0x3'),'options':{'host':_0x4aca('0x4'),'port':0xcea,'dialect':_0x4aca('0x5'),'dialectOptions':{'charset':_0x4aca('0x6')},'logging':![],'timezone':timezone[_0x4aca('0x7')](),'define':{'charset':_0x4aca('0x8'),'collate':_0x4aca('0x9')}}});config[_0x4aca('0xa')]=_[_0x4aca('0x0')](config[_0x4aca('0xa')],{'database':_0x4aca('0x1'),'username':_0x4aca('0x2'),'password':_0x4aca('0x3'),'options':{'host':_0x4aca('0x4'),'port':0xcea,'dialect':_0x4aca('0x5'),'dialectOptions':{'charset':_0x4aca('0x6')},'logging':![],'timezone':timezone[_0x4aca('0x7')](),'define':{'charset':_0x4aca('0x8'),'collate':_0x4aca('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4aca('0xb')]['database'],config[_0x4aca('0xb')][_0x4aca('0xc')],config[_0x4aca('0xb')][_0x4aca('0xd')],config[_0x4aca('0xb')][_0x4aca('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4aca('0xa')][_0x4aca('0xf')],config[_0x4aca('0xa')][_0x4aca('0xc')],config[_0x4aca('0xa')][_0x4aca('0xd')],config[_0x4aca('0xa')][_0x4aca('0xe')])};db[_0x4aca('0x10')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x12'));db['VoiceChanSpy']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x13'));db[_0x4aca('0x14')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x15'));db[_0x4aca('0x16')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x17'));db[_0x4aca('0x18')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x19'));db['VoiceQueue']=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db['sequelize']['import'](_0x4aca('0x1a'));db[_0x4aca('0x1b')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x1c'));db[_0x4aca('0x1d')]=db['sequelize']['import'](_0x4aca('0x1e'));db[_0x4aca('0x1f')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x20'));db['VoiceCallReport']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x21'));db[_0x4aca('0x22')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x23'));db[_0x4aca('0x24')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x25'));db['VoiceQueueReport']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x26'));db[_0x4aca('0x27')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x28'));db[_0x4aca('0x29')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x2a'));db[_0x4aca('0x2b')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x2c'));db[_0x4aca('0x2d')]=db['sequelize'][_0x4aca('0x11')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x4aca('0x2e')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x2f'));db[_0x4aca('0x30')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x31'));db[_0x4aca('0x32')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x33'));db[_0x4aca('0x34')]=db[_0x4aca('0xb')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x4aca('0x35')]=db['sequelize']['import'](_0x4aca('0x36'));db['UserOpenchannelQueue']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x37'));db[_0x4aca('0x38')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x39'));db[_0x4aca('0x3a')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x3b'));db[_0x4aca('0x3c')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/mailServerOut/mailServerOut.model');db[_0x4aca('0x3d')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x3e'));db[_0x4aca('0x3f')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x40'));db[_0x4aca('0x41')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x42'));db['MailInteraction']=db['sequelize']['import']('../api/mailInteraction/mailInteraction.model');db[_0x4aca('0x43')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x44'));db[_0x4aca('0x45')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x46'));db[_0x4aca('0x47')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x48'));db['Dashboard']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x49'));db[_0x4aca('0x4a')]=db[_0x4aca('0xb')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x4aca('0x4b')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x4c'));db[_0x4aca('0x4d')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x4e'));db[_0x4aca('0x4f')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x50'));db['FaxMessage']=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/faxMessage/faxMessage.model');db[_0x4aca('0x51')]=db['sequelize']['import'](_0x4aca('0x52'));db[_0x4aca('0x53')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x54'));db[_0x4aca('0x55')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x56'));db[_0x4aca('0x57')]=db[_0x4aca('0xb')]['import']('../api/smsApplication/smsApplication.model');db[_0x4aca('0x58')]=db['sequelize'][_0x4aca('0x11')]('../api/smsInteraction/smsInteraction.model');db[_0x4aca('0x59')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x5a'));db[_0x4aca('0x5b')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x5c'));db[_0x4aca('0x5d')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x5e'));db['OpenchannelApplication']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x5f'));db[_0x4aca('0x60')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x61'));db[_0x4aca('0x62')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/openchannelMessage/openchannelMessage.model');db[_0x4aca('0x63')]=db[_0x4aca('0xb')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0x4aca('0x64')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x65'));db[_0x4aca('0x66')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x67'));db[_0x4aca('0x68')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x69'));db['ChatInteraction']=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/chatInteraction/chatInteraction.model');db[_0x4aca('0x6a')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x6b'));db[_0x4aca('0x6c')]=db['sequelize']['import'](_0x4aca('0x6d'));db[_0x4aca('0x6e')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/chatQueue/chatQueue.model');db[_0x4aca('0x6f')]=db[_0x4aca('0xb')]['import']('../api/chatGroup/chatGroup.model');db[_0x4aca('0x70')]=db['sequelize']['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x4aca('0x71')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x72'));db[_0x4aca('0x73')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/cmContact/cmContact.model');db[_0x4aca('0x74')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x75'));db[_0x4aca('0x76')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x4aca('0x77')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x4aca('0x78')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x79'));db[_0x4aca('0x7a')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x7b'));db[_0x4aca('0x7c')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x7d'));db['Action']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x7e'));db[_0x4aca('0x7f')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x80'));db[_0x4aca('0x81')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x82'));db[_0x4aca('0x83')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/disposition/disposition.model');db[_0x4aca('0x84')]=db[_0x4aca('0xb')]['import']('../api/condition/condition.model');db[_0x4aca('0x85')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x86'));db[_0x4aca('0x87')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x88'));db[_0x4aca('0x89')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x8a'));db['VoiceQueuesLog']=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x4aca('0x8b')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x8c'));db['Sound']=db[_0x4aca('0xb')]['import'](_0x4aca('0x8d'));db['Tag']=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/tag/tag.model');db[_0x4aca('0x8e')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x8f'));db[_0x4aca('0x90')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x91'));db[_0x4aca('0x92')]=db['sequelize']['import']('../api/variable/variable.model');db[_0x4aca('0x93')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/integration/integration.model');db[_0x4aca('0x94')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x95'));db[_0x4aca('0x96')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x97'));db[_0x4aca('0x98')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x99'));db[_0x4aca('0x9a')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x9b'));db[_0x4aca('0x9c')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x4aca('0x9d')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x4aca('0x9e')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x9f'));db[_0x4aca('0xa0')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xa1'));db[_0x4aca('0xa2')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xa3'));db[_0x4aca('0xa4')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x4aca('0xa5')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xa6'));db[_0x4aca('0xa7')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xa8'));db[_0x4aca('0xa9')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/intDeskAccount/intDeskAccount.model');db[_0x4aca('0xaa')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xab'));db[_0x4aca('0xac')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xad'));db['ZohoConfiguration']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xae'));db[_0x4aca('0xaf')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xb0'));db['ZendeskAccount']=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xb1'));db[_0x4aca('0xb2')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xb3'));db[_0x4aca('0xb4')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xb5'));db[_0x4aca('0xb6')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xb7'));db[_0x4aca('0xb8')]=db[_0x4aca('0xb')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4aca('0xb9')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xba'));db[_0x4aca('0xbb')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xbc'));db[_0x4aca('0xbd')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x4aca('0xbe')]=db['sequelize']['import'](_0x4aca('0xbf'));db['ServicenowAccount']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xc0'));db['ServicenowConfiguration']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xc1'));db['ServicenowField']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xc2'));db['Dynamics365Account']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xc3'));db['Dynamics365Configuration']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xc4'));db[_0x4aca('0xc5')]=db[_0x4aca('0xb')]['import'](_0x4aca('0xc6'));db[_0x4aca('0xc7')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x4aca('0xc8')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xc9'));db[_0x4aca('0xca')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xcb'));db['Integration']=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xcc'));db[_0x4aca('0xcd')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xce'));db[_0x4aca('0xcf')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xd0'));db[_0x4aca('0xd1')]=db['sequelize']['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x4aca('0xd2')]=db[_0x4aca('0xb')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x4aca('0xd3')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xd4'));db['JscriptySessionReport']=db[_0x4aca('0xb')]['import'](_0x4aca('0xd5'));db[_0x4aca('0xd6')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/smsQueueReport/smsQueueReport.model');db[_0x4aca('0xd7')]=db[_0x4aca('0xb')]['import'](_0x4aca('0xd8'));db[_0x4aca('0xd9')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xda'));db[_0x4aca('0xdb')]=db['sequelize']['import'](_0x4aca('0xdc'));db[_0x4aca('0xdd')]=db[_0x4aca('0xb')]['import'](_0x4aca('0xde'));db[_0x4aca('0xdf')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/squareProject/squareProject.model');db[_0x4aca('0xe0')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xe1'));db[_0x4aca('0xe2')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xe3'));db[_0x4aca('0xe4')]=db[_0x4aca('0xb')]['import'](_0x4aca('0xe5'));db['License']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xe6'));db[_0x4aca('0xe7')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xe8'));db[_0x4aca('0xe9')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xea'));db[_0x4aca('0xeb')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xec'));db[_0x4aca('0xed')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xee'));db[_0x4aca('0xef')]=db['sequelize']['import'](_0x4aca('0xf0'));db[_0x4aca('0xf1')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xf2'));db[_0x4aca('0xf3')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0xf4'));db[_0x4aca('0xf5')]=db[_0x4aca('0xb')]['import'](_0x4aca('0xf6'));db[_0x4aca('0xf7')]=db[_0x4aca('0xb')]['import'](_0x4aca('0xf8'));db[_0x4aca('0xf9')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xfa'));db[_0x4aca('0xfb')]=db[_0x4aca('0xb')]['import'](_0x4aca('0xfc'));db[_0x4aca('0xfd')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0xfe'));db[_0x4aca('0xff')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x100'));db['UserProfileResource']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x101'));db[_0x4aca('0x102')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x103'));db['WhatsappAccount']=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/whatsappAccount/whatsappAccount.model');db[_0x4aca('0x104')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x105'));db[_0x4aca('0x106')]=db['sequelize'][_0x4aca('0x11')](_0x4aca('0x107'));db[_0x4aca('0x108')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x109'));db[_0x4aca('0x10a')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x4aca('0x10b')]=db[_0x4aca('0xb')]['import'](_0x4aca('0x10c'));db['WhatsappQueue']=db[_0x4aca('0xb')]['import'](_0x4aca('0x10d'));db[_0x4aca('0x10e')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x10f'));db[_0x4aca('0x110')]=db[_0x4aca('0xb')][_0x4aca('0x11')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x111'));db[_0x4aca('0x112')]=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x113'));db['UserSetting']=db[_0x4aca('0xb')][_0x4aca('0x11')](_0x4aca('0x114'));db['User'][_0x4aca('0x115')](db[_0x4aca('0x1d')],{'as':_0x4aca('0x1d'),'onDelete':_0x4aca('0x116'),'foreignKey':'UserId'});db['User'][_0x4aca('0x115')](db['UserSetting'],{'as':'userSetting','onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x10')]['hasMany'](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x4aca('0x117')});db[_0x4aca('0x10')][_0x4aca('0x118')](db[_0x4aca('0x2d')],{'as':_0x4aca('0x119'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x10')]['hasMany'](db['VoiceExtension'],{'as':_0x4aca('0x11a'),'onDelete':_0x4aca('0x116'),'hooks':!![]});db[_0x4aca('0x10')]['hasMany'](db[_0x4aca('0x77')],{'as':_0x4aca('0x11b'),'foreignKey':_0x4aca('0x117')});db['User'][_0x4aca('0x118')](db['CmHopperHistory'],{'as':_0x4aca('0x11c'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x10')][_0x4aca('0x118')](db[_0x4aca('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0x4aca('0x117')});db[_0x4aca('0x10')][_0x4aca('0x118')](db[_0x4aca('0x60')],{'as':_0x4aca('0x11d'),'foreignKey':_0x4aca('0x117')});db['User'][_0x4aca('0x118')](db[_0x4aca('0x11e')],{'as':_0x4aca('0x11f'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x10')][_0x4aca('0x118')](db[_0x4aca('0x58')],{'as':'SmsInteractions','foreignKey':_0x4aca('0x117')});db['User'][_0x4aca('0x118')](db[_0x4aca('0x4f')],{'as':_0x4aca('0x120'),'foreignKey':_0x4aca('0x117')});db['User'][_0x4aca('0x118')](db[_0x4aca('0x121')],{'as':'MailInteractions','foreignKey':'UserId'});db['User'][_0x4aca('0x118')](db['WhatsappInteraction'],{'as':_0x4aca('0x122'),'foreignKey':'UserId'});db['User'][_0x4aca('0x118')](db[_0x4aca('0x102')],{'as':_0x4aca('0x123'),'foreignKey':'SenderId'});db[_0x4aca('0x10')][_0x4aca('0x124')](db['UserProfile'],{'as':_0x4aca('0xfd'),'foreignKey':'userProfileId'});db[_0x4aca('0x10')][_0x4aca('0x125')](db['ChatGroup'],{'as':_0x4aca('0x126'),'through':_0x4aca('0x127')});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x73')],{'as':_0x4aca('0x128'),'through':_0x4aca('0x129')});db[_0x4aca('0x10')][_0x4aca('0x125')](db['CmList'],{'as':_0x4aca('0x12a'),'through':_0x4aca('0x12b')});db[_0x4aca('0x10')]['belongsToMany'](db[_0x4aca('0xe4')],{'through':_0x4aca('0x12c')});db[_0x4aca('0x10')]['belongsToMany'](db[_0x4aca('0x121')],{'as':_0x4aca('0x12d'),'through':'user_has_mail_interactions'});db['User'][_0x4aca('0x125')](db[_0x4aca('0x11e')],{'as':_0x4aca('0x11f'),'through':_0x4aca('0x12e')});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x4f')],{'as':_0x4aca('0x120'),'through':_0x4aca('0x12f')});db['User'][_0x4aca('0x125')](db[_0x4aca('0x58')],{'as':_0x4aca('0x130'),'through':_0x4aca('0x131')});db[_0x4aca('0x10')][_0x4aca('0x125')](db['OpenchannelInteraction'],{'as':_0x4aca('0x11d'),'through':_0x4aca('0x132')});db[_0x4aca('0x10')]['belongsToMany'](db[_0x4aca('0x106')],{'as':_0x4aca('0x122'),'through':'user_has_whatsapp_interactions'});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x133')],{'as':_0x4aca('0x134'),'through':_0x4aca('0x2e'),'required':![]});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0xfb')],{'as':_0x4aca('0x135'),'through':_0x4aca('0x112'),'required':![]});db['User'][_0x4aca('0x125')](db[_0x4aca('0x3f')],{'as':'MailQueues','through':_0x4aca('0x32'),'required':![]});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x6e')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x51')],{'as':_0x4aca('0x136'),'through':_0x4aca('0x34'),'required':![]});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x5b')],{'as':_0x4aca('0x137'),'through':_0x4aca('0x35'),'required':![]});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x63')],{'as':_0x4aca('0x138'),'through':_0x4aca('0x139'),'required':![]});db['User'][_0x4aca('0x125')](db[_0x4aca('0x13a')],{'as':_0x4aca('0x13b'),'through':_0x4aca('0x38'),'required':![]});db['User'][_0x4aca('0x125')](db[_0x4aca('0xf9')],{'through':'cm_user_has_lists'});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x64')],{'as':_0x4aca('0x13c'),'through':_0x4aca('0x13d')});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x4b')],{'as':'FaxAccounts','through':_0x4aca('0x13e')});db['User'][_0x4aca('0x125')](db[_0x4aca('0x3d')],{'as':'MailAccounts','through':_0x4aca('0x13f')});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x5d')],{'as':_0x4aca('0x140'),'through':_0x4aca('0x141')});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x55')],{'as':_0x4aca('0x142'),'through':_0x4aca('0x143')});db[_0x4aca('0x10')][_0x4aca('0x125')](db[_0x4aca('0x144')],{'as':_0x4aca('0x145'),'through':'user_has_whatsapp_accounts'});db[_0x4aca('0x10')]['belongsToMany'](db[_0x4aca('0xdf')],{'as':_0x4aca('0x146'),'through':_0x4aca('0x147')});db[_0x4aca('0x148')][_0x4aca('0x118')](db[_0x4aca('0x16')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x4aca('0x149')});db[_0x4aca('0x14')][_0x4aca('0x118')](db['VoiceExtension'],{'onDelete':'cascade'});db['VoiceExtension'][_0x4aca('0x118')](db[_0x4aca('0x16')],{'as':_0x4aca('0x14a'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x18')]['belongsToMany'](db[_0x4aca('0x14b')],{'as':_0x4aca('0x14c'),'through':_0x4aca('0x14d')});db['VoiceQueue'][_0x4aca('0x118')](db[_0x4aca('0x2d')],{'as':_0x4aca('0x14e'),'foreignKey':_0x4aca('0x14f')});db[_0x4aca('0x133')][_0x4aca('0x118')](db[_0x4aca('0x74')],{'as':_0x4aca('0x150'),'foreignKey':_0x4aca('0x14f')});db[_0x4aca('0x133')][_0x4aca('0x118')](db[_0x4aca('0x77')],{'as':'HopperFinals','foreignKey':_0x4aca('0x14f')});db[_0x4aca('0x133')]['hasMany'](db[_0x4aca('0x78')],{'as':_0x4aca('0x151'),'foreignKey':_0x4aca('0x14f')});db['VoiceQueue'][_0x4aca('0x118')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x4aca('0x133')]['hasMany'](db[_0x4aca('0x76')],{'as':_0x4aca('0x152'),'foreignKey':_0x4aca('0x14f')});db['VoiceQueue']['hasMany'](db[_0x4aca('0x153')],{'as':'JscriptySessions','foreignKey':_0x4aca('0x14f')});db['VoiceQueue']['belongsTo'](db[_0x4aca('0x29')],{'as':_0x4aca('0x29'),'foreignKey':_0x4aca('0x154')});db[_0x4aca('0x133')][_0x4aca('0x124')](db[_0x4aca('0x29')],{'as':'TrunkBackup','foreignKey':_0x4aca('0x155')});db['VoiceQueue'][_0x4aca('0x124')](db['Interval'],{'as':_0x4aca('0x85'),'foreignKey':'IntervalId'});db[_0x4aca('0x133')][_0x4aca('0x124')](db[_0x4aca('0x87')],{'as':_0x4aca('0x156'),'foreignKey':_0x4aca('0x157')});db['VoiceQueue'][_0x4aca('0x125')](db[_0x4aca('0xf9')],{'as':'Lists','through':_0x4aca('0x158')});db[_0x4aca('0x133')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0x4aca('0xe4')],{'as':_0x4aca('0x159'),'through':_0x4aca('0x110')});db[_0x4aca('0x133')][_0x4aca('0x125')](db[_0x4aca('0xf9')],{'as':_0x4aca('0x15a'),'through':'voice_queues_has_cm_blacklists'});db[_0x4aca('0x15b')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'as':_0x4aca('0x10'),'foreignKey':_0x4aca('0x117')});db['ScreenRecording']['belongsTo'](db[_0x4aca('0x10')],{'as':_0x4aca('0x10'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x1d')][_0x4aca('0x118')](db[_0x4aca('0x1f')],{'as':_0x4aca('0x15c'),'onDelete':_0x4aca('0x116'),'foreignKey':'mailboxuser','sourceKey':_0x4aca('0x15d')});db[_0x4aca('0x1f')]['belongsTo'](db[_0x4aca('0x1d')],{'foreignKey':'mailboxuser','targetKey':_0x4aca('0x15d')});db['VoiceCallReport'][_0x4aca('0x118')](db[_0x4aca('0x15e')],{'as':_0x4aca('0x15f'),'foreignKey':_0x4aca('0x160'),'constraints':![]});db[_0x4aca('0x161')][_0x4aca('0x118')](db[_0x4aca('0x24')],{'as':'AgentReports','foreignKey':_0x4aca('0x160'),'constraints':![]});db[_0x4aca('0x161')]['belongsTo'](db[_0x4aca('0x10')],{'as':_0x4aca('0x10'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x161')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':_0x4aca('0x162'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x3a')]['belongsTo'](db[_0x4aca('0x3d')],{'as':_0x4aca('0x3d'),'foreignKey':_0x4aca('0x164')});db[_0x4aca('0x3a')]['belongsTo'](db[_0x4aca('0x10e')],{'as':'CloudProvider','foreignKey':_0x4aca('0x165'),'onDelete':_0x4aca('0x166')});db['MailServerOut']['belongsTo'](db[_0x4aca('0x3d')],{'as':_0x4aca('0x3d'),'foreignKey':_0x4aca('0x164')});db['MailServerOut'][_0x4aca('0x124')](db[_0x4aca('0x10e')],{'as':_0x4aca('0x10e'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db['MailAccount'][_0x4aca('0x115')](db[_0x4aca('0x3a')],{'as':_0x4aca('0x167'),'onDelete':'cascade'});db[_0x4aca('0x3d')]['hasOne'](db[_0x4aca('0x3c')],{'as':_0x4aca('0x168'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x3d')][_0x4aca('0x118')](db[_0x4aca('0x83')],{'as':_0x4aca('0x169'),'foreignKey':_0x4aca('0x164'),'onDelete':_0x4aca('0x116')});db['MailAccount'][_0x4aca('0x118')](db[_0x4aca('0x81')],{'as':_0x4aca('0x16a'),'foreignKey':'MailAccountId'});db[_0x4aca('0x3d')]['hasMany'](db['MailMessage'],{'as':_0x4aca('0x15c'),'foreignKey':_0x4aca('0x164')});db[_0x4aca('0x3d')][_0x4aca('0x118')](db[_0x4aca('0x121')],{'as':_0x4aca('0x16b')});db['MailAccount']['hasMany'](db[_0x4aca('0x45')],{'as':_0x4aca('0x14a')});db[_0x4aca('0x3d')][_0x4aca('0x124')](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':'ListId'});db[_0x4aca('0x3d')][_0x4aca('0x124')](db[_0x4aca('0x8e')],{'as':_0x4aca('0x8e'),'foreignKey':_0x4aca('0x16d')});db['MailAccount'][_0x4aca('0x124')](db[_0x4aca('0x87')],{'as':_0x4aca('0x156'),'foreignKey':_0x4aca('0x157')});db[_0x4aca('0x3d')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x13f')});db[_0x4aca('0x3f')]['belongsToMany'](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x32')});db[_0x4aca('0x3f')][_0x4aca('0x125')](db[_0x4aca('0xe4')],{'through':_0x4aca('0x16f'),'as':_0x4aca('0x159')});db[_0x4aca('0x121')][_0x4aca('0x118')](db[_0x4aca('0x43')],{'as':_0x4aca('0x15c'),'onDelete':_0x4aca('0x116'),'foreignKey':'MailInteractionId'});db[_0x4aca('0x121')]['belongsTo'](db[_0x4aca('0x3d')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x164')});db[_0x4aca('0x121')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4aca('0x121')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'as':'Owner','foreignKey':_0x4aca('0x117')});db[_0x4aca('0x121')][_0x4aca('0x125')](db[_0x4aca('0x171')],{'through':_0x4aca('0x172'),'as':'Tags'});db[_0x4aca('0x121')][_0x4aca('0x125')](db['Tag'],{'through':_0x4aca('0x172'),'as':'ThroughTags'});db['MailInteraction'][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x173'),'through':'user_has_mail_interactions','foreignKey':_0x4aca('0x174')});db[_0x4aca('0x43')][_0x4aca('0x118')](db[_0x4aca('0xeb')],{'as':_0x4aca('0x175'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x43')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'as':_0x4aca('0x10')});db[_0x4aca('0x43')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'onDelete':'cascade','as':'Contact'});db[_0x4aca('0x43')][_0x4aca('0x124')](db[_0x4aca('0x121')],{'as':_0x4aca('0x176'),'foreignKey':_0x4aca('0x174')});db[_0x4aca('0x43')][_0x4aca('0x124')](db[_0x4aca('0x3d')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x164')});db[_0x4aca('0x43')][_0x4aca('0x124')](db[_0x4aca('0x64')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0x4aca('0x43')][_0x4aca('0x124')](db[_0x4aca('0x6c')],{'as':_0x4aca('0x6c'),'foreignKey':'ChatOfflineMessageId'});db[_0x4aca('0x45')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'onDelete':_0x4aca('0x166')});db['MailApplication'][_0x4aca('0x124')](db[_0x4aca('0x3f')],{'onDelete':_0x4aca('0x166')});db[_0x4aca('0x45')][_0x4aca('0x124')](db[_0x4aca('0x3d')],{'onDelete':_0x4aca('0x166')});db[_0x4aca('0x45')][_0x4aca('0x124')](db[_0x4aca('0x85')],{'onDelete':'restrict','foreignKey':_0x4aca('0x177')});db[_0x4aca('0x45')][_0x4aca('0x124')](db[_0x4aca('0x171')],{'onDelete':_0x4aca('0x166'),'foreignKey':'TagId'});db[_0x4aca('0x47')]['belongsTo'](db[_0x4aca('0x3d')],{});db['MailQueueReport'][_0x4aca('0x124')](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db['MailQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':'Contact','foreignKey':_0x4aca('0x163')});db[_0x4aca('0x47')][_0x4aca('0x124')](db['MailInteraction'],{});db[_0x4aca('0x47')][_0x4aca('0x124')](db[_0x4aca('0x43')],{});db['MailQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x10')],{});db[_0x4aca('0x47')][_0x4aca('0x124')](db[_0x4aca('0x3f')],{});db[_0x4aca('0x179')]['hasMany'](db['DashboardItem'],{'as':_0x4aca('0x17a'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x4b')][_0x4aca('0x118')](db[_0x4aca('0x83')],{'as':_0x4aca('0x169'),'foreignKey':_0x4aca('0x17b'),'onDelete':_0x4aca('0x116')});db['FaxAccount']['hasMany'](db[_0x4aca('0x81')],{'as':_0x4aca('0x16a'),'foreignKey':'FaxAccountId'});db[_0x4aca('0x4b')]['hasMany'](db[_0x4aca('0x4f')],{'as':_0x4aca('0x16b')});db[_0x4aca('0x4b')][_0x4aca('0x118')](db[_0x4aca('0x4d')],{'as':'Applications'});db[_0x4aca('0x4b')][_0x4aca('0x118')](db[_0x4aca('0x16')],{'as':'Exntensions','onDelete':_0x4aca('0x116')});db[_0x4aca('0x4b')]['hasMany'](db[_0x4aca('0x17c')],{'as':'Messages'});db[_0x4aca('0x4b')][_0x4aca('0x124')](db[_0x4aca('0x29')],{'as':_0x4aca('0x29')});db[_0x4aca('0x4b')][_0x4aca('0x124')](db['CmList'],{'as':'List','foreignKey':_0x4aca('0x178')});db[_0x4aca('0x4b')][_0x4aca('0x124')](db[_0x4aca('0x87')],{'as':_0x4aca('0x156'),'foreignKey':_0x4aca('0x157')});db[_0x4aca('0x4b')]['belongsToMany'](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':'user_has_fax_accounts'});db[_0x4aca('0x4d')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'onDelete':_0x4aca('0x166')});db[_0x4aca('0x4d')]['belongsTo'](db[_0x4aca('0x51')],{'onDelete':'restrict'});db[_0x4aca('0x4d')][_0x4aca('0x124')](db[_0x4aca('0x4b')],{'onDelete':_0x4aca('0x166')});db[_0x4aca('0x4d')][_0x4aca('0x124')](db[_0x4aca('0x171')],{'onDelete':_0x4aca('0x166'),'foreignKey':'TagId'});db[_0x4aca('0x4f')]['hasMany'](db[_0x4aca('0x17c')],{'as':'Messages','onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x17d')});db['FaxInteraction'][_0x4aca('0x124')](db[_0x4aca('0x4b')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x4aca('0x4f')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':'Contact','foreignKey':_0x4aca('0x163')});db['FaxInteraction'][_0x4aca('0x124')](db[_0x4aca('0x10')],{'as':_0x4aca('0x17e'),'foreignKey':'UserId'});db['FaxInteraction'][_0x4aca('0x125')](db[_0x4aca('0x171')],{'through':'fax_interaction_has_tags','as':_0x4aca('0x17f')});db[_0x4aca('0x4f')]['belongsToMany'](db[_0x4aca('0x171')],{'through':_0x4aca('0x180'),'as':_0x4aca('0x181')});db[_0x4aca('0x4f')]['belongsToMany'](db[_0x4aca('0x10')],{'as':_0x4aca('0x173'),'through':'user_has_fax_interactions','foreignKey':_0x4aca('0x17d')});db[_0x4aca('0x17c')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x10')});db[_0x4aca('0x17c')][_0x4aca('0x124')](db['FaxInteraction'],{'as':_0x4aca('0x176'),'foreignKey':_0x4aca('0x17d')});db[_0x4aca('0x17c')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x162')});db[_0x4aca('0x17c')][_0x4aca('0x124')](db[_0x4aca('0xeb')],{'as':_0x4aca('0xeb'),'foreignKey':'AttachmentId'});db[_0x4aca('0x17c')][_0x4aca('0x124')](db[_0x4aca('0x4b')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x17b')});db['FaxQueue'][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x34')});db[_0x4aca('0x51')][_0x4aca('0x125')](db[_0x4aca('0xe4')],{'through':_0x4aca('0x182'),'as':_0x4aca('0x159')});db['FaxQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x4b')],{});db[_0x4aca('0x53')][_0x4aca('0x124')](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db['FaxQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':'Contact','foreignKey':_0x4aca('0x163')});db[_0x4aca('0x53')]['belongsTo'](db['FaxInteraction'],{});db[_0x4aca('0x53')]['belongsTo'](db[_0x4aca('0x17c')],{});db[_0x4aca('0x53')]['belongsTo'](db[_0x4aca('0x10')],{});db[_0x4aca('0x53')][_0x4aca('0x124')](db[_0x4aca('0x51')],{});db['SmsAccount']['hasMany'](db['Disposition'],{'as':_0x4aca('0x169'),'foreignKey':'SmsAccountId','onDelete':_0x4aca('0x116')});db[_0x4aca('0x55')][_0x4aca('0x118')](db[_0x4aca('0x81')],{'as':_0x4aca('0x16a'),'foreignKey':_0x4aca('0x183')});db['SmsAccount'][_0x4aca('0x118')](db[_0x4aca('0x59')],{'as':_0x4aca('0x15c'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x4aca('0x118')](db[_0x4aca('0x58')],{'as':_0x4aca('0x16b')});db[_0x4aca('0x55')][_0x4aca('0x118')](db[_0x4aca('0x57')],{'as':'Applications'});db[_0x4aca('0x55')][_0x4aca('0x124')](db['CmList'],{'as':_0x4aca('0x16c'),'foreignKey':'ListId'});db[_0x4aca('0x55')]['belongsTo'](db['Pause'],{'as':_0x4aca('0x156'),'foreignKey':_0x4aca('0x157')});db['SmsAccount']['belongsToMany'](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x143')});db[_0x4aca('0x57')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'onDelete':_0x4aca('0x166')});db[_0x4aca('0x57')]['belongsTo'](db['SmsQueue'],{'onDelete':'restrict'});db['SmsApplication'][_0x4aca('0x124')](db[_0x4aca('0x55')],{'onDelete':'restrict'});db[_0x4aca('0x57')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0x4aca('0x177')});db[_0x4aca('0x57')][_0x4aca('0x124')](db['Tag'],{'onDelete':_0x4aca('0x166'),'foreignKey':_0x4aca('0x184')});db[_0x4aca('0x58')]['hasMany'](db[_0x4aca('0x59')],{'as':_0x4aca('0x15c'),'onDelete':_0x4aca('0x116'),'foreignKey':'SmsInteractionId'});db[_0x4aca('0x58')][_0x4aca('0x124')](db[_0x4aca('0x55')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x183')});db[_0x4aca('0x58')]['belongsTo'](db['CmContact'],{'as':_0x4aca('0x162'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x58')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'as':'Owner','foreignKey':_0x4aca('0x117')});db['SmsInteraction'][_0x4aca('0x125')](db[_0x4aca('0x171')],{'through':_0x4aca('0x185'),'as':_0x4aca('0x17f')});db[_0x4aca('0x58')][_0x4aca('0x125')](db[_0x4aca('0x171')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x4aca('0x58')][_0x4aca('0x125')](db['User'],{'as':_0x4aca('0x173'),'through':_0x4aca('0x131'),'foreignKey':_0x4aca('0x186')});db[_0x4aca('0x59')]['belongsTo'](db[_0x4aca('0x10')],{'as':_0x4aca('0x10')});db[_0x4aca('0x59')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x162')});db[_0x4aca('0x59')][_0x4aca('0x124')](db['SmsInteraction'],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x176'),'foreignKey':_0x4aca('0x186')});db['SmsMessage'][_0x4aca('0x124')](db[_0x4aca('0x55')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x183')});db['SmsQueue'][_0x4aca('0x125')](db['User'],{'as':_0x4aca('0x16e'),'through':'UserSmsQueue','foreignKey':_0x4aca('0x187')});db['SmsQueue'][_0x4aca('0x125')](db['Team'],{'through':_0x4aca('0x188'),'as':_0x4aca('0x159')});db[_0x4aca('0x5d')][_0x4aca('0x118')](db[_0x4aca('0x83')],{'as':_0x4aca('0x169'),'foreignKey':_0x4aca('0x189'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x5d')][_0x4aca('0x118')](db['CannedAnswer'],{'as':_0x4aca('0x16a'),'foreignKey':_0x4aca('0x189')});db[_0x4aca('0x5d')][_0x4aca('0x118')](db[_0x4aca('0x60')],{'as':_0x4aca('0x16b'),'foreignKey':_0x4aca('0x189')});db['OpenchannelAccount']['hasMany'](db[_0x4aca('0x62')],{'as':_0x4aca('0x15c'),'foreignKey':_0x4aca('0x189')});db[_0x4aca('0x5d')][_0x4aca('0x118')](db[_0x4aca('0x18a')],{'as':_0x4aca('0x14a'),'foreignKey':'OpenchannelAccountId'});db[_0x4aca('0x5d')][_0x4aca('0x124')](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db[_0x4aca('0x5d')][_0x4aca('0x124')](db[_0x4aca('0x87')],{'as':_0x4aca('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4aca('0x5d')][_0x4aca('0x125')](db['User'],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x141')});db[_0x4aca('0x18a')][_0x4aca('0x124')](db['User'],{'onDelete':_0x4aca('0x166')});db[_0x4aca('0x18a')]['belongsTo'](db[_0x4aca('0x63')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x4aca('0x124')](db['OpenchannelAccount'],{'onDelete':_0x4aca('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0x4aca('0x18a')][_0x4aca('0x124')](db[_0x4aca('0x85')],{'onDelete':_0x4aca('0x166'),'foreignKey':_0x4aca('0x177')});db[_0x4aca('0x18a')]['belongsTo'](db[_0x4aca('0x171')],{'onDelete':'restrict','foreignKey':_0x4aca('0x184')});db[_0x4aca('0x60')]['hasMany'](db[_0x4aca('0x62')],{'as':_0x4aca('0x15c'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x4aca('0x60')][_0x4aca('0x124')](db['OpenchannelAccount'],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x189')});db['OpenchannelInteraction'][_0x4aca('0x124')](db['CmContact'],{'as':_0x4aca('0x162'),'foreignKey':'ContactId'});db[_0x4aca('0x60')]['belongsTo'](db[_0x4aca('0x10')],{'as':_0x4aca('0x17e'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x60')]['belongsToMany'](db['Tag'],{'through':_0x4aca('0x18b'),'as':_0x4aca('0x17f')});db[_0x4aca('0x60')][_0x4aca('0x125')](db[_0x4aca('0x171')],{'through':_0x4aca('0x18b'),'as':_0x4aca('0x181')});db[_0x4aca('0x60')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x173'),'through':_0x4aca('0x132'),'foreignKey':'OpenchannelInteractionId'});db[_0x4aca('0x62')][_0x4aca('0x124')](db['User'],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x10')});db[_0x4aca('0x62')][_0x4aca('0x124')](db['CmContact'],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x162')});db[_0x4aca('0x62')]['belongsTo'](db[_0x4aca('0x60')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x176'),'foreignKey':_0x4aca('0x18c')});db[_0x4aca('0x62')][_0x4aca('0x124')](db[_0x4aca('0xeb')],{'as':_0x4aca('0xeb'),'foreignKey':'AttachmentId'});db[_0x4aca('0x62')][_0x4aca('0x124')](db[_0x4aca('0x5d')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x189')});db['OpenchannelQueue']['belongsToMany'](db[_0x4aca('0x10')],{'as':'Agents','through':_0x4aca('0x139'),'foreignKey':_0x4aca('0x18d')});db[_0x4aca('0x63')][_0x4aca('0x125')](db[_0x4aca('0xe4')],{'through':_0x4aca('0x18e'),'as':'Teams'});db[_0x4aca('0x64')][_0x4aca('0x118')](db['Disposition'],{'as':_0x4aca('0x169'),'foreignKey':_0x4aca('0x18f'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x64')]['hasMany'](db[_0x4aca('0x81')],{'as':'Answers','foreignKey':_0x4aca('0x18f')});db[_0x4aca('0x64')][_0x4aca('0x118')](db[_0x4aca('0x70')],{'as':_0x4aca('0x190')});db['ChatWebsite'][_0x4aca('0x118')](db[_0x4aca('0x11e')],{'as':_0x4aca('0x16b')});db[_0x4aca('0x64')]['hasMany'](db[_0x4aca('0x68')],{'as':'Applications'});db[_0x4aca('0x64')][_0x4aca('0x118')](db[_0x4aca('0x6a')],{'as':_0x4aca('0x15c')});db[_0x4aca('0x64')]['belongsTo'](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db[_0x4aca('0x64')][_0x4aca('0x124')](db[_0x4aca('0x85')],{'as':_0x4aca('0x85'),'foreignKey':_0x4aca('0x177')});db['ChatWebsite'][_0x4aca('0x124')](db[_0x4aca('0x3d')],{'as':_0x4aca('0x3d'),'foreignKey':_0x4aca('0x164')});db[_0x4aca('0x64')][_0x4aca('0x124')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x4aca('0x157')});db[_0x4aca('0x64')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x13d')});db[_0x4aca('0x66')][_0x4aca('0x124')](db[_0x4aca('0x5d')],{});db[_0x4aca('0x66')][_0x4aca('0x124')](db[_0x4aca('0xf9')],{'as':'List','foreignKey':_0x4aca('0x178')});db[_0x4aca('0x66')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4aca('0x66')][_0x4aca('0x124')](db[_0x4aca('0x60')],{});db[_0x4aca('0x66')][_0x4aca('0x124')](db[_0x4aca('0x62')],{});db[_0x4aca('0x66')][_0x4aca('0x124')](db['User'],{});db[_0x4aca('0x66')][_0x4aca('0x124')](db[_0x4aca('0x63')],{});db['ChatApplication']['belongsTo'](db[_0x4aca('0x10')],{'as':_0x4aca('0x191'),'foreignKey':_0x4aca('0x117'),'onDelete':_0x4aca('0x166')});db[_0x4aca('0x68')]['belongsTo'](db[_0x4aca('0x6e')],{'as':_0x4aca('0x192'),'foreignKey':_0x4aca('0x193'),'onDelete':'restrict'});db[_0x4aca('0x68')][_0x4aca('0x124')](db[_0x4aca('0x64')],{'as':_0x4aca('0x194'),'foreignKey':_0x4aca('0x18f'),'onDelete':'restrict'});db['ChatApplication'][_0x4aca('0x124')](db[_0x4aca('0x171')],{'onDelete':_0x4aca('0x166'),'foreignKey':'TagId'});db[_0x4aca('0x11e')][_0x4aca('0x118')](db[_0x4aca('0x6a')],{'as':_0x4aca('0x15c'),'onDelete':_0x4aca('0x116'),'foreignKey':'ChatInteractionId'});db[_0x4aca('0x11e')]['belongsTo'](db[_0x4aca('0x64')],{'as':'Account','foreignKey':_0x4aca('0x18f')});db['ChatInteraction']['belongsTo'](db[_0x4aca('0x73')],{'as':_0x4aca('0x162'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x11e')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0x4aca('0x11e')]['belongsToMany'](db[_0x4aca('0x171')],{'through':'chat_interaction_has_tags','as':_0x4aca('0x17f')});db['ChatInteraction'][_0x4aca('0x125')](db['Tag'],{'through':_0x4aca('0x195'),'as':_0x4aca('0x181')});db[_0x4aca('0x11e')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':'Users','through':_0x4aca('0x12e'),'foreignKey':'ChatInteractionId'});db[_0x4aca('0x6a')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x10')});db['ChatMessage'][_0x4aca('0x124')](db[_0x4aca('0x73')],{'onDelete':'cascade','as':_0x4aca('0x162'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x6a')]['belongsTo'](db[_0x4aca('0x11e')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x176'),'foreignKey':_0x4aca('0x196')});db[_0x4aca('0x6a')][_0x4aca('0x124')](db[_0x4aca('0xeb')],{'as':_0x4aca('0xeb'),'foreignKey':_0x4aca('0x197')});db['ChatMessage'][_0x4aca('0x124')](db[_0x4aca('0x64')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x18f')});db[_0x4aca('0x6c')][_0x4aca('0x118')](db[_0x4aca('0xeb')],{'as':_0x4aca('0x175'),'foreignKey':_0x4aca('0x198'),'onDelete':_0x4aca('0x116'),'hooks':!![]});db[_0x4aca('0x6c')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x162'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x6c')][_0x4aca('0x124')](db[_0x4aca('0x64')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x18f')});db[_0x4aca('0x6e')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':'Agents','through':_0x4aca('0x30'),'hooks':!![]});db[_0x4aca('0x6e')][_0x4aca('0x125')](db[_0x4aca('0xe4')],{'through':_0x4aca('0x199'),'as':'Teams'});db[_0x4aca('0x6f')]['hasMany'](db[_0x4aca('0xd1')],{'as':_0x4aca('0x15c'),'foreignKey':_0x4aca('0x19a'),'onDelete':'cascade'});db[_0x4aca('0x6f')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':'Members','through':_0x4aca('0x127')});db[_0x4aca('0x70')][_0x4aca('0x124')](db[_0x4aca('0x64')],{'as':_0x4aca('0x194'),'foreignKey':_0x4aca('0x18f')});db['CmCompany'][_0x4aca('0x118')](db[_0x4aca('0x73')],{'as':_0x4aca('0x128'),'foreignKey':_0x4aca('0x19b')});db[_0x4aca('0x73')][_0x4aca('0x118')](db[_0x4aca('0x74')],{'as':_0x4aca('0x150'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x73')]['hasMany'](db[_0x4aca('0x77')],{'as':_0x4aca('0x11b'),'foreignKey':_0x4aca('0x163')});db['CmContact'][_0x4aca('0x118')](db[_0x4aca('0x78')],{'as':_0x4aca('0x151'),'foreignKey':'ContactId'});db[_0x4aca('0x73')][_0x4aca('0x118')](db[_0x4aca('0x7a')],{'as':_0x4aca('0x7a'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x73')][_0x4aca('0x118')](db[_0x4aca('0x153')],{'as':_0x4aca('0x19c'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x73')][_0x4aca('0x118')](db[_0x4aca('0x60')],{'as':_0x4aca('0x11d'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x4aca('0x73')][_0x4aca('0x118')](db[_0x4aca('0x11e')],{'as':_0x4aca('0x11f'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x4aca('0x58')],{'as':_0x4aca('0x130'),'foreignKey':_0x4aca('0x163'),'onDelete':_0x4aca('0x166')});db['CmContact']['hasMany'](db[_0x4aca('0x4f')],{'as':_0x4aca('0x120'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x4aca('0x118')](db[_0x4aca('0x121')],{'as':_0x4aca('0x12d'),'foreignKey':_0x4aca('0x163'),'onDelete':_0x4aca('0x166')});db[_0x4aca('0x73')]['belongsTo'](db[_0x4aca('0x71')],{'as':_0x4aca('0x19d'),'foreignKey':'CompanyId'});db['CmContact']['belongsTo'](db[_0x4aca('0xf9')],{'as':'List','foreignKey':_0x4aca('0x178'),'onDelete':'cascade'});db['CmContact'][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x173'),'through':_0x4aca('0x129')});db['CmContact']['belongsToMany'](db[_0x4aca('0x171')],{'as':'Tags','through':_0x4aca('0x19e')});db[_0x4aca('0x73')][_0x4aca('0x125')](db[_0x4aca('0x171')],{'through':_0x4aca('0x19e'),'as':_0x4aca('0x181')});db[_0x4aca('0x74')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':_0x4aca('0x162'),'foreignKey':'ContactId','onDelete':_0x4aca('0x116')});db['CmHopper']['belongsTo'](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178'),'onDelete':'cascade'});db['CmHopper'][_0x4aca('0x124')](db['User'],{'as':_0x4aca('0x191'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x74')]['belongsTo'](db[_0x4aca('0x133')],{'as':'Queue','foreignKey':_0x4aca('0x14f'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x74')][_0x4aca('0x124')](db[_0x4aca('0xe7')],{'as':'Campaign','foreignKey':_0x4aca('0x19f'),'onDelete':_0x4aca('0x116')});db['CmHopper']['belongsTo'](db[_0x4aca('0x10')],{'as':_0x4aca('0x17e'),'foreignKey':'OwnerId'});db[_0x4aca('0x76')][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':'Contact','foreignKey':_0x4aca('0x163'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x76')][_0x4aca('0x124')](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x76')]['belongsTo'](db[_0x4aca('0x133')],{'as':_0x4aca('0x192'),'foreignKey':'VoiceQueueId','onDelete':_0x4aca('0x116')});db[_0x4aca('0x76')][_0x4aca('0x124')](db[_0x4aca('0xe7')],{'as':_0x4aca('0xe7'),'foreignKey':_0x4aca('0x19f'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x7f')][_0x4aca('0x118')](db[_0x4aca('0x84')],{'as':{'plural':'All','singular':_0x4aca('0x1a0')},'foreignKey':_0x4aca('0x1a1'),'onDelete':_0x4aca('0x116'),'hooks':!![]});db[_0x4aca('0x7f')]['hasMany'](db['Condition'],{'as':{'plural':_0x4aca('0x1a2'),'singular':_0x4aca('0x1a3')},'foreignKey':_0x4aca('0x1a4'),'onDelete':'cascade','hooks':!![]});db[_0x4aca('0x7f')]['hasMany'](db[_0x4aca('0x1a5')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x4aca('0x116'),'hooks':!![]});db['Disposition']['hasMany'](db[_0x4aca('0x83')],{'as':_0x4aca('0x169'),'foreignKey':_0x4aca('0x1a6'),'onDelete':'cascade'});db[_0x4aca('0x85')][_0x4aca('0x118')](db['Interval'],{'as':_0x4aca('0x1a7'),'foreignKey':'IntervalId','onDelete':_0x4aca('0x116'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db['VoiceExtension'],{'as':_0x4aca('0x11a'),'foreignKey':_0x4aca('0x177'),'onDelete':_0x4aca('0x166')});db[_0x4aca('0x85')][_0x4aca('0x118')](db[_0x4aca('0x45')],{'as':_0x4aca('0x1a8'),'foreignKey':'IntervalId'});db[_0x4aca('0x85')][_0x4aca('0x118')](db[_0x4aca('0x68')],{'as':_0x4aca('0x1a9'),'foreignKey':'IntervalId'});db[_0x4aca('0x85')][_0x4aca('0x118')](db[_0x4aca('0x4d')],{'as':_0x4aca('0x1aa'),'foreignKey':'IntervalId'});db[_0x4aca('0x85')][_0x4aca('0x118')](db[_0x4aca('0x57')],{'as':_0x4aca('0x1ab'),'foreignKey':'IntervalId'});db[_0x4aca('0x8b')][_0x4aca('0x124')](db[_0x4aca('0x3d')],{});db[_0x4aca('0x8b')][_0x4aca('0x124')](db[_0x4aca('0x98')],{'foreignKey':_0x4aca('0x1ac')});db['Schedule']['belongsTo'](db[_0x4aca('0x96')],{'foreignKey':_0x4aca('0x1ad')});db[_0x4aca('0x14b')]['belongsToMany'](db[_0x4aca('0x18')],{'as':_0x4aca('0x1ae'),'through':_0x4aca('0x14d'),'onDelete':_0x4aca('0x166')});db[_0x4aca('0x171')]['belongsToMany'](db[_0x4aca('0x73')],{'through':'cm_contact_has_tags'});db['Tag'][_0x4aca('0x125')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x4aca('0x121')],{'through':'mail_interaction_has_tags'});db['Tag'][_0x4aca('0x125')](db['SmsInteraction'],{'through':_0x4aca('0x185')});db[_0x4aca('0x171')]['belongsToMany'](db['FaxInteraction'],{'through':_0x4aca('0x180')});db['Tag'][_0x4aca('0x125')](db[_0x4aca('0x60')],{'through':_0x4aca('0x18b')});db[_0x4aca('0x171')][_0x4aca('0x125')](db[_0x4aca('0x106')],{'through':_0x4aca('0x1af')});db[_0x4aca('0x90')]['hasMany'](db[_0x4aca('0x84')],{'as':{'plural':_0x4aca('0x1b0'),'singular':_0x4aca('0x1b1')},'foreignKey':_0x4aca('0x1b2'),'onDelete':_0x4aca('0x116'),'hooks':!![]});db[_0x4aca('0x90')][_0x4aca('0x118')](db[_0x4aca('0x84')],{'as':{'plural':_0x4aca('0x1b3'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x4aca('0x90')][_0x4aca('0x118')](db[_0x4aca('0x1a5')],{'as':_0x4aca('0x1b4'),'foreignKey':'TriggerId','onDelete':_0x4aca('0x116'),'hooks':!![]});db[_0x4aca('0x96')][_0x4aca('0x118')](db[_0x4aca('0x9c')],{'as':_0x4aca('0x1b5'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x4aca('0x118')](db['AnalyticFieldReport'],{'as':_0x4aca('0x1b5'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1ac')});db['AnalyticMetric'][_0x4aca('0x118')](db[_0x4aca('0x9c')],{'as':_0x4aca('0x1b5'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1b6')});db[_0x4aca('0x9c')][_0x4aca('0x124')](db[_0x4aca('0x9a')],{'foreignKey':'MetricId'});db[_0x4aca('0x9e')][_0x4aca('0x118')](db['SalesforceConfiguration'],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x4aca('0x1b8'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xa0')][_0x4aca('0x118')](db[_0x4aca('0xa2')],{'as':_0x4aca('0x1ba'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xa0')][_0x4aca('0x118')](db[_0x4aca('0xa2')],{'as':'Fields','onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xa0')]['belongsTo'](db[_0x4aca('0x9e')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xa2')][_0x4aca('0x118')](db['SalesforceField'],{'as':_0x4aca('0x1be'),'foreignKey':_0x4aca('0x1b9')});db['SalesforceField'][_0x4aca('0x118')](db[_0x4aca('0xa2')],{'as':'Description','foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xa2')][_0x4aca('0x118')](db['SalesforceField'],{'as':'Field','foreignKey':_0x4aca('0x1bc')});db['SalesforceField']['belongsTo'](db[_0x4aca('0x92')],{'as':_0x4aca('0x92'),'foreignKey':_0x4aca('0x1bf')});db[_0x4aca('0xa4')][_0x4aca('0x118')](db[_0x4aca('0xa5')],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xa5')][_0x4aca('0x118')](db[_0x4aca('0xa7')],{'as':_0x4aca('0x1b8'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xa5')][_0x4aca('0x118')](db[_0x4aca('0xa7')],{'as':'Descriptions','onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bb')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x4aca('0x1b5'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bc')});db['SugarcrmConfiguration'][_0x4aca('0x124')](db[_0x4aca('0xa4')],{'as':_0x4aca('0x170'),'foreignKey':'AccountId'});db['SugarcrmField'][_0x4aca('0x118')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xa7')][_0x4aca('0x118')](db[_0x4aca('0xa7')],{'as':_0x4aca('0x1c0'),'foreignKey':'DescriptionId'});db[_0x4aca('0xa7')]['hasMany'](db[_0x4aca('0xa7')],{'as':'Field','foreignKey':_0x4aca('0x1bc')});db['SugarcrmField']['belongsTo'](db['Variable'],{'as':_0x4aca('0x92'),'foreignKey':_0x4aca('0x1bf')});db[_0x4aca('0xa9')][_0x4aca('0x118')](db[_0x4aca('0xaa')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xaa')][_0x4aca('0x118')](db[_0x4aca('0xac')],{'as':_0x4aca('0x1b8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x4aca('0xaa')][_0x4aca('0x118')](db[_0x4aca('0xac')],{'as':_0x4aca('0x1ba'),'onDelete':'cascade','foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xaa')][_0x4aca('0x118')](db[_0x4aca('0xac')],{'as':_0x4aca('0x1b5'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xaa')][_0x4aca('0x124')](db[_0x4aca('0xa9')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xaa')][_0x4aca('0x125')](db['Tag'],{'through':_0x4aca('0x1c1')});db[_0x4aca('0xac')][_0x4aca('0x118')](db[_0x4aca('0xac')],{'as':_0x4aca('0x1be'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xac')][_0x4aca('0x118')](db[_0x4aca('0xac')],{'as':_0x4aca('0x1c0'),'foreignKey':_0x4aca('0x1bb')});db['DeskField'][_0x4aca('0x118')](db[_0x4aca('0xac')],{'as':'Field','foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xac')][_0x4aca('0x124')](db[_0x4aca('0x92')],{'as':_0x4aca('0x92'),'foreignKey':_0x4aca('0x1bf')});db[_0x4aca('0x1c2')][_0x4aca('0x118')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0x1c3')][_0x4aca('0x118')](db['ZohoField'],{'as':_0x4aca('0x1b8'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0x1c3')][_0x4aca('0x118')](db[_0x4aca('0xaf')],{'as':_0x4aca('0x1ba'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bb')});db['ZohoConfiguration']['hasMany'](db[_0x4aca('0xaf')],{'as':_0x4aca('0x1b5'),'onDelete':_0x4aca('0x116'),'foreignKey':'FieldId'});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xaf')]['hasMany'](db[_0x4aca('0xaf')],{'as':_0x4aca('0x1be'),'foreignKey':'SubjectId'});db[_0x4aca('0xaf')][_0x4aca('0x118')](db[_0x4aca('0xaf')],{'as':'Description','foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xaf')][_0x4aca('0x118')](db[_0x4aca('0xaf')],{'as':'Field','foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xaf')][_0x4aca('0x124')](db[_0x4aca('0x92')],{'as':_0x4aca('0x92'),'foreignKey':_0x4aca('0x1bf')});db[_0x4aca('0x1c4')][_0x4aca('0x118')](db[_0x4aca('0xb2')],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xb2')][_0x4aca('0x118')](db[_0x4aca('0xb4')],{'as':_0x4aca('0x1b8'),'foreignKey':'SubjectId'});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xb2')]['hasMany'](db[_0x4aca('0xb4')],{'as':_0x4aca('0x1b5'),'foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xb2')]['belongsTo'](db[_0x4aca('0x1c4')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xb2')][_0x4aca('0x125')](db[_0x4aca('0x171')],{'through':_0x4aca('0x1c5')});db[_0x4aca('0xb4')]['hasMany'](db['ZendeskField'],{'as':_0x4aca('0x1be'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xb4')][_0x4aca('0x118')](db[_0x4aca('0xb4')],{'as':_0x4aca('0x1c0'),'foreignKey':_0x4aca('0x1bb')});db['ZendeskField'][_0x4aca('0x118')](db[_0x4aca('0xb4')],{'as':'Field','foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xb4')]['belongsTo'](db[_0x4aca('0x92')],{'as':_0x4aca('0x92'),'foreignKey':_0x4aca('0x1bf')});db['FreshdeskAccount'][_0x4aca('0x118')](db[_0x4aca('0xb8')],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bd')});db['FreshdeskConfiguration'][_0x4aca('0x118')](db[_0x4aca('0xb9')],{'as':_0x4aca('0x1b8'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xb8')]['hasMany'](db[_0x4aca('0xb9')],{'as':_0x4aca('0x1ba'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bb')});db['FreshdeskConfiguration']['hasMany'](db[_0x4aca('0xb9')],{'as':_0x4aca('0x1b5'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xb8')][_0x4aca('0x124')](db[_0x4aca('0xb6')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1bd')});db['FreshdeskConfiguration']['belongsToMany'](db[_0x4aca('0x171')],{'through':_0x4aca('0x1c6')});db[_0x4aca('0xb9')]['hasMany'](db[_0x4aca('0xb9')],{'as':_0x4aca('0x1be'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xb9')][_0x4aca('0x118')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xb9')]['hasMany'](db[_0x4aca('0xb9')],{'as':'Field','foreignKey':'FieldId'});db[_0x4aca('0xb9')][_0x4aca('0x124')](db[_0x4aca('0x92')],{'as':_0x4aca('0x92'),'foreignKey':'VariableId'});db[_0x4aca('0xbb')]['hasMany'](db['VtigerConfiguration'],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0x4aca('0x118')](db[_0x4aca('0xbe')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x4aca('0xbd')][_0x4aca('0x118')](db[_0x4aca('0xbe')],{'as':_0x4aca('0x1ba'),'foreignKey':'DescriptionId'});db[_0x4aca('0xbd')]['hasMany'](db[_0x4aca('0xbe')],{'as':'Fields','foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xbd')]['belongsTo'](db[_0x4aca('0xbb')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1bd')});db['VtigerField'][_0x4aca('0x118')](db['VtigerField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4aca('0xbe')]['hasMany'](db[_0x4aca('0xbe')],{'as':_0x4aca('0x1c0'),'foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xbe')]['hasMany'](db[_0x4aca('0xbe')],{'as':_0x4aca('0x1c7'),'foreignKey':'FieldId'});db[_0x4aca('0xbe')][_0x4aca('0x124')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0x4aca('0x118')](db[_0x4aca('0x1c8')],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':'AccountId'});db[_0x4aca('0x1c8')]['hasMany'](db[_0x4aca('0x1c9')],{'as':'Subjects','foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0x1c8')][_0x4aca('0x118')](db['ServicenowField'],{'as':_0x4aca('0x1ba'),'foreignKey':'DescriptionId'});db[_0x4aca('0x1c8')]['hasMany'](db['ServicenowField'],{'as':'Fields','foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0x1c8')][_0x4aca('0x124')](db[_0x4aca('0x1ca')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0x1c9')]['hasMany'](db[_0x4aca('0x1c9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4aca('0x1c9')][_0x4aca('0x118')](db[_0x4aca('0x1c9')],{'as':_0x4aca('0x1c0'),'foreignKey':_0x4aca('0x1bb')});db['ServicenowField'][_0x4aca('0x118')](db[_0x4aca('0x1c9')],{'as':_0x4aca('0x1c7'),'foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0x1c9')][_0x4aca('0x124')](db[_0x4aca('0x92')],{'as':'Variable','foreignKey':_0x4aca('0x1bf')});db[_0x4aca('0x1cb')][_0x4aca('0x118')](db[_0x4aca('0x1cc')],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0x1cb')][_0x4aca('0x124')](db[_0x4aca('0x10e')],{'as':'CloudProvider','foreignKey':_0x4aca('0x165')});db[_0x4aca('0x1cc')]['hasMany'](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1b9')});db['Dynamics365Configuration'][_0x4aca('0x118')](db[_0x4aca('0xc5')],{'as':_0x4aca('0x1ba'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0x1cc')]['hasMany'](db[_0x4aca('0xc5')],{'as':_0x4aca('0x1b5'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0x1cc')][_0x4aca('0x124')](db[_0x4aca('0x1cb')],{'as':_0x4aca('0x170'),'foreignKey':'AccountId'});db[_0x4aca('0xc5')][_0x4aca('0x118')](db['Dynamics365Field'],{'as':_0x4aca('0x1be'),'foreignKey':_0x4aca('0x1b9')});db['Dynamics365Field'][_0x4aca('0x118')](db[_0x4aca('0xc5')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4aca('0xc5')]['hasMany'](db[_0x4aca('0xc5')],{'as':_0x4aca('0x1c7'),'foreignKey':_0x4aca('0x1bc')});db['Dynamics365Field']['belongsTo'](db[_0x4aca('0x92')],{'as':_0x4aca('0x92'),'foreignKey':_0x4aca('0x1bf')});db[_0x4aca('0xc7')][_0x4aca('0x118')](db[_0x4aca('0xc8')],{'as':_0x4aca('0x1b7'),'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1bd')});db[_0x4aca('0xc8')]['hasMany'](db['FreshsalesField'],{'as':_0x4aca('0x1b8'),'foreignKey':_0x4aca('0x1b9')});db[_0x4aca('0xc8')][_0x4aca('0x118')](db['FreshsalesField'],{'as':_0x4aca('0x1ba'),'foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xc8')]['hasMany'](db[_0x4aca('0xca')],{'as':_0x4aca('0x1b5'),'foreignKey':_0x4aca('0x1bc')});db[_0x4aca('0xc8')]['belongsTo'](db[_0x4aca('0xc7')],{'as':'Account','foreignKey':'AccountId'});db[_0x4aca('0xca')][_0x4aca('0x118')](db[_0x4aca('0xca')],{'as':'Subject','foreignKey':_0x4aca('0x1b9')});db['FreshsalesField']['hasMany'](db[_0x4aca('0xca')],{'as':'Description','foreignKey':_0x4aca('0x1bb')});db[_0x4aca('0xca')][_0x4aca('0x118')](db[_0x4aca('0xca')],{'as':_0x4aca('0x1c7'),'foreignKey':_0x4aca('0x1bc')});db['FreshsalesField'][_0x4aca('0x124')](db[_0x4aca('0x92')],{'as':_0x4aca('0x92'),'foreignKey':_0x4aca('0x1bf')});db['ChatQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x64')],{});db[_0x4aca('0xcf')]['belongsTo'](db['CmList'],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db['ChatQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':_0x4aca('0x162'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0xcf')][_0x4aca('0x124')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x6a')],{});db[_0x4aca('0xcf')]['belongsTo'](db['User'],{});db[_0x4aca('0xcf')]['belongsTo'](db[_0x4aca('0x6e')],{});db[_0x4aca('0xd1')][_0x4aca('0x124')](db['User'],{'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1cd')});db[_0x4aca('0xd1')][_0x4aca('0x124')](db['User'],{'onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x1ce')});db[_0x4aca('0x153')][_0x4aca('0x118')](db[_0x4aca('0xd3')],{'foreignKey':_0x4aca('0x1cf'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x153')][_0x4aca('0x118')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x4aca('0x116')});db[_0x4aca('0xd6')]['belongsTo'](db[_0x4aca('0x55')],{});db[_0x4aca('0xd6')][_0x4aca('0x124')](db['CmList'],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db['SmsQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':'Contact','foreignKey':_0x4aca('0x163')});db['SmsQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x58')],{});db['SmsQueueReport']['belongsTo'](db[_0x4aca('0x59')],{});db[_0x4aca('0xd6')][_0x4aca('0x124')](db['User'],{});db[_0x4aca('0xd6')][_0x4aca('0x124')](db[_0x4aca('0x5b')],{});db[_0x4aca('0x1d0')][_0x4aca('0x118')](db[_0x4aca('0x153')],{'foreignKey':_0x4aca('0x1d1')});db[_0x4aca('0x1d0')][_0x4aca('0x118')](db[_0x4aca('0xd3')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x4aca('0x118')](db['JscriptyAnswerReport'],{'foreignKey':_0x4aca('0x1d1')});db['SquareProject'][_0x4aca('0x125')](db['User'],{'as':_0x4aca('0x173'),'through':_0x4aca('0x147')});db[_0x4aca('0xe4')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x12c')});db['Team'][_0x4aca('0x125')](db['VoiceQueue'],{'through':_0x4aca('0x110'),'as':_0x4aca('0x134')});db[_0x4aca('0xe4')][_0x4aca('0x125')](db[_0x4aca('0x3f')],{'through':'team_has_mail_queues','as':_0x4aca('0x1d2')});db[_0x4aca('0xe4')][_0x4aca('0x125')](db['ChatQueue'],{'through':_0x4aca('0x199'),'as':_0x4aca('0x1d3')});db[_0x4aca('0xe4')]['belongsToMany'](db['FaxQueue'],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x4aca('0xe4')][_0x4aca('0x125')](db['SmsQueue'],{'through':_0x4aca('0x188'),'as':_0x4aca('0x137')});db[_0x4aca('0xe4')][_0x4aca('0x125')](db[_0x4aca('0x63')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Team']['belongsToMany'](db['WhatsappQueue'],{'through':_0x4aca('0x1d4'),'as':_0x4aca('0x13b')});db[_0x4aca('0xe4')]['belongsToMany'](db['VoicePrefix'],{'through':_0x4aca('0x1d5'),'as':_0x4aca('0x135')});db[_0x4aca('0xe7')][_0x4aca('0x118')](db[_0x4aca('0x74')],{'as':'Hoppers','foreignKey':_0x4aca('0x19f')});db[_0x4aca('0xe7')]['hasMany'](db[_0x4aca('0x77')],{'as':_0x4aca('0x11b'),'foreignKey':_0x4aca('0x19f')});db[_0x4aca('0xe7')]['hasMany'](db[_0x4aca('0x78')],{'as':_0x4aca('0x151'),'foreignKey':'CampaignId'});db[_0x4aca('0xe7')][_0x4aca('0x118')](db[_0x4aca('0x76')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x4aca('0xe7')][_0x4aca('0x124')](db[_0x4aca('0x29')],{'as':_0x4aca('0x29'),'foreignKey':_0x4aca('0x154')});db[_0x4aca('0xe7')][_0x4aca('0x124')](db['Trunk'],{'as':_0x4aca('0x1d6'),'foreignKey':'TrunkBackupId'});db[_0x4aca('0xe7')]['belongsTo'](db[_0x4aca('0x85')],{'as':_0x4aca('0x85'),'foreignKey':_0x4aca('0x177')});db[_0x4aca('0xe7')][_0x4aca('0x124')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x4aca('0x1d7')});db[_0x4aca('0xe7')][_0x4aca('0x125')](db[_0x4aca('0xf9')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x4aca('0xe7')][_0x4aca('0x125')](db['CmList'],{'as':_0x4aca('0x15a'),'through':'campaigns_has_cm_blacklists'});db[_0x4aca('0xeb')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x4aca('0x6c'),'foreignKey':_0x4aca('0x198')});db[_0x4aca('0xef')][_0x4aca('0x124')](db[_0x4aca('0x43')],{});db[_0x4aca('0xef')]['belongsTo'](db[_0x4aca('0x121')],{});db[_0x4aca('0xef')]['belongsTo'](db[_0x4aca('0x3d')],{'foreignKey':'FromMailAccountId','as':_0x4aca('0x1d8')});db[_0x4aca('0xef')][_0x4aca('0x124')](db['User'],{'foreignKey':_0x4aca('0x1d9'),'as':_0x4aca('0x1da')});db[_0x4aca('0xef')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'foreignKey':_0x4aca('0x1db'),'as':_0x4aca('0x1dc')});db[_0x4aca('0xef')][_0x4aca('0x124')](db['MailQueue'],{'foreignKey':_0x4aca('0x1dd'),'as':'ToQueue'});db[_0x4aca('0xef')]['belongsTo'](db[_0x4aca('0x3d')],{'foreignKey':_0x4aca('0x1de'),'as':'ToAccount'});db[_0x4aca('0xf1')][_0x4aca('0x124')](db['ChatMessage'],{});db[_0x4aca('0xf1')][_0x4aca('0x124')](db[_0x4aca('0x11e')],{});db[_0x4aca('0xf1')][_0x4aca('0x124')](db[_0x4aca('0x64')],{'foreignKey':_0x4aca('0x1df'),'as':_0x4aca('0x1d8')});db[_0x4aca('0xf1')]['belongsTo'](db[_0x4aca('0x10')],{'foreignKey':'FromUserId','as':_0x4aca('0x1da')});db['ChatTransferReport'][_0x4aca('0x124')](db[_0x4aca('0x10')],{'foreignKey':_0x4aca('0x1db'),'as':_0x4aca('0x1dc')});db['ChatTransferReport'][_0x4aca('0x124')](db[_0x4aca('0x6e')],{'foreignKey':_0x4aca('0x1e0'),'as':_0x4aca('0x1e1')});db['ChatTransferReport'][_0x4aca('0x124')](db[_0x4aca('0x64')],{'foreignKey':_0x4aca('0x1e2'),'as':_0x4aca('0x1e3')});db['FaxTransferReport']['belongsTo'](db['FaxMessage'],{});db['FaxTransferReport'][_0x4aca('0x124')](db['FaxInteraction'],{});db[_0x4aca('0xf3')][_0x4aca('0x124')](db[_0x4aca('0x4b')],{'foreignKey':_0x4aca('0x1e4'),'as':_0x4aca('0x1d8')});db[_0x4aca('0xf3')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'foreignKey':_0x4aca('0x1d9'),'as':'FromAgent'});db[_0x4aca('0xf3')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'foreignKey':_0x4aca('0x1db'),'as':_0x4aca('0x1dc')});db[_0x4aca('0xf3')][_0x4aca('0x124')](db[_0x4aca('0x51')],{'foreignKey':_0x4aca('0x1e5'),'as':'ToQueue'});db[_0x4aca('0xf3')]['belongsTo'](db[_0x4aca('0x4b')],{'foreignKey':_0x4aca('0x1e6'),'as':_0x4aca('0x1e3')});db[_0x4aca('0xf5')][_0x4aca('0x124')](db[_0x4aca('0x62')],{});db[_0x4aca('0xf5')][_0x4aca('0x124')](db[_0x4aca('0x60')],{});db[_0x4aca('0xf5')]['belongsTo'](db[_0x4aca('0x5d')],{'foreignKey':_0x4aca('0x1e7'),'as':_0x4aca('0x1d8')});db[_0x4aca('0xf5')][_0x4aca('0x124')](db['User'],{'foreignKey':'FromUserId','as':_0x4aca('0x1da')});db['OpenchannelTransferReport'][_0x4aca('0x124')](db['User'],{'foreignKey':'ToUserId','as':_0x4aca('0x1dc')});db[_0x4aca('0xf5')][_0x4aca('0x124')](db[_0x4aca('0x63')],{'foreignKey':_0x4aca('0x1e8'),'as':_0x4aca('0x1e1')});db[_0x4aca('0xf5')][_0x4aca('0x124')](db[_0x4aca('0x5d')],{'foreignKey':_0x4aca('0x1e9'),'as':_0x4aca('0x1e3')});db[_0x4aca('0xf7')]['belongsTo'](db[_0x4aca('0x59')],{});db[_0x4aca('0xf7')][_0x4aca('0x124')](db['SmsInteraction'],{});db['SmsTransferReport'][_0x4aca('0x124')](db[_0x4aca('0x55')],{'foreignKey':'FromSmsAccountId','as':_0x4aca('0x1d8')});db['SmsTransferReport'][_0x4aca('0x124')](db[_0x4aca('0x10')],{'foreignKey':_0x4aca('0x1d9'),'as':_0x4aca('0x1da')});db[_0x4aca('0xf7')]['belongsTo'](db['User'],{'foreignKey':_0x4aca('0x1db'),'as':_0x4aca('0x1dc')});db[_0x4aca('0xf7')][_0x4aca('0x124')](db['SmsQueue'],{'foreignKey':_0x4aca('0x1ea'),'as':_0x4aca('0x1e1')});db[_0x4aca('0xf7')]['belongsTo'](db[_0x4aca('0x55')],{'foreignKey':'ToSmsAccountId','as':_0x4aca('0x1e3')});db[_0x4aca('0xf9')][_0x4aca('0x118')](db[_0x4aca('0x83')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0x4aca('0x116')});db[_0x4aca('0xf9')][_0x4aca('0x118')](db[_0x4aca('0x7c')],{'as':'CustomFields','foreignKey':_0x4aca('0x178')});db[_0x4aca('0xf9')]['hasMany'](db['CmContact'],{'as':'Contacts','onDelete':_0x4aca('0x116'),'foreignKey':_0x4aca('0x178')});db[_0x4aca('0xf9')][_0x4aca('0x118')](db['CmHopperFinal'],{'as':_0x4aca('0x11b'),'foreignKey':_0x4aca('0x178')});db[_0x4aca('0xf9')]['hasMany'](db[_0x4aca('0x78')],{'as':_0x4aca('0x11c'),'foreignKey':'ListId'});db['CmList'][_0x4aca('0x118')](db[_0x4aca('0x7a')],{'as':_0x4aca('0x7a'),'foreignKey':_0x4aca('0x178')});db[_0x4aca('0xf9')][_0x4aca('0x125')](db['VoiceQueue'],{'as':_0x4aca('0x1eb'),'through':_0x4aca('0x158')});db['CmList'][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0x4aca('0x118')](db[_0x4aca('0x16')],{'as':_0x4aca('0x11a'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0xfb')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x112')});db['VoicePrefix'][_0x4aca('0x125')](db['Team'],{'through':_0x4aca('0x1d5'),'as':_0x4aca('0x159')});db[_0x4aca('0xfd')]['hasMany'](db['User'],{'as':_0x4aca('0x173'),'foreignKey':_0x4aca('0x1ec')});db[_0x4aca('0xfd')]['hasMany'](db[_0x4aca('0xff')],{'as':_0x4aca('0x1ed'),'foreignKey':_0x4aca('0x1ec'),'onDelete':'cascade'});db['UserProfileSection'][_0x4aca('0x118')](db[_0x4aca('0x1ee')],{'as':_0x4aca('0x1ef'),'foreignKey':_0x4aca('0x1f0'),'onDelete':_0x4aca('0x116')});db[_0x4aca('0x144')]['hasMany'](db[_0x4aca('0x83')],{'as':_0x4aca('0x169'),'foreignKey':_0x4aca('0x1f1'),'onDelete':_0x4aca('0x116')});db['WhatsappAccount'][_0x4aca('0x118')](db[_0x4aca('0x81')],{'as':_0x4aca('0x16a'),'foreignKey':_0x4aca('0x1f1')});db['WhatsappAccount'][_0x4aca('0x118')](db[_0x4aca('0x108')],{'as':'Messages','foreignKey':_0x4aca('0x1f1')});db[_0x4aca('0x144')][_0x4aca('0x118')](db['WhatsappInteraction'],{'as':_0x4aca('0x16b')});db[_0x4aca('0x144')][_0x4aca('0x118')](db[_0x4aca('0x104')],{'as':'Applications'});db[_0x4aca('0x144')]['belongsTo'](db['CmList'],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db[_0x4aca('0x144')][_0x4aca('0x124')](db[_0x4aca('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x4aca('0x157')});db[_0x4aca('0x144')]['belongsToMany'](db[_0x4aca('0x10')],{'as':'Agents','through':_0x4aca('0x1f2')});db[_0x4aca('0x104')][_0x4aca('0x124')](db['User'],{'onDelete':'restrict'});db[_0x4aca('0x104')][_0x4aca('0x124')](db[_0x4aca('0x13a')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x4aca('0x166')});db[_0x4aca('0x104')]['belongsTo'](db[_0x4aca('0x85')],{'onDelete':_0x4aca('0x166'),'foreignKey':_0x4aca('0x177')});db[_0x4aca('0x104')]['belongsTo'](db[_0x4aca('0x171')],{'onDelete':_0x4aca('0x166'),'foreignKey':_0x4aca('0x184')});db[_0x4aca('0x106')]['hasMany'](db[_0x4aca('0x108')],{'as':_0x4aca('0x15c'),'onDelete':_0x4aca('0x116'),'foreignKey':'WhatsappInteractionId'});db[_0x4aca('0x106')][_0x4aca('0x124')](db[_0x4aca('0x144')],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1f1')});db['WhatsappInteraction'][_0x4aca('0x124')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x4aca('0x106')]['belongsTo'](db[_0x4aca('0x10')],{'as':_0x4aca('0x17e'),'foreignKey':_0x4aca('0x117')});db[_0x4aca('0x106')][_0x4aca('0x125')](db['Tag'],{'through':_0x4aca('0x1af'),'as':'Tags'});db[_0x4aca('0x106')][_0x4aca('0x125')](db['Tag'],{'through':_0x4aca('0x1af'),'as':_0x4aca('0x181')});db[_0x4aca('0x106')][_0x4aca('0x125')](db[_0x4aca('0x10')],{'as':'Users','through':_0x4aca('0x1f3'),'foreignKey':_0x4aca('0x1f4')});db[_0x4aca('0x108')][_0x4aca('0x124')](db['User'],{'as':_0x4aca('0x10')});db[_0x4aca('0x108')]['belongsTo'](db['CmContact'],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x162')});db['WhatsappMessage'][_0x4aca('0x124')](db[_0x4aca('0x106')],{'onDelete':_0x4aca('0x116'),'as':_0x4aca('0x176'),'foreignKey':_0x4aca('0x1f4')});db[_0x4aca('0x108')][_0x4aca('0x124')](db['WhatsappAccount'],{'as':_0x4aca('0x170'),'foreignKey':_0x4aca('0x1f1')});db[_0x4aca('0x10a')][_0x4aca('0x124')](db['WhatsappAccount'],{});db[_0x4aca('0x10a')][_0x4aca('0x124')](db[_0x4aca('0xf9')],{'as':_0x4aca('0x16c'),'foreignKey':_0x4aca('0x178')});db['WhatsappQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x73')],{'as':_0x4aca('0x162'),'foreignKey':_0x4aca('0x163')});db[_0x4aca('0x10a')][_0x4aca('0x124')](db[_0x4aca('0x106')],{});db['WhatsappQueueReport'][_0x4aca('0x124')](db['WhatsappQueue'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x4aca('0x108')],{});db['WhatsappQueueReport'][_0x4aca('0x124')](db[_0x4aca('0x10')],{});db[_0x4aca('0x10b')]['belongsTo'](db[_0x4aca('0x108')],{});db[_0x4aca('0x10b')][_0x4aca('0x124')](db[_0x4aca('0x106')],{});db[_0x4aca('0x10b')]['belongsTo'](db[_0x4aca('0x144')],{'foreignKey':_0x4aca('0x1f5'),'as':_0x4aca('0x1d8')});db[_0x4aca('0x10b')][_0x4aca('0x124')](db[_0x4aca('0x144')],{'foreignKey':'ToWhatsappAccountId','as':_0x4aca('0x1e3')});db[_0x4aca('0x10b')]['belongsTo'](db[_0x4aca('0x13a')],{'foreignKey':_0x4aca('0x1f6'),'as':_0x4aca('0x1e1')});db['WhatsappTransferReport'][_0x4aca('0x124')](db['User'],{'foreignKey':_0x4aca('0x1d9'),'as':_0x4aca('0x1da')});db[_0x4aca('0x10b')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'foreignKey':_0x4aca('0x1db'),'as':_0x4aca('0x1dc')});db[_0x4aca('0x13a')]['belongsToMany'](db['User'],{'as':_0x4aca('0x16e'),'through':_0x4aca('0x38'),'foreignKey':_0x4aca('0x1f7')});db[_0x4aca('0x13a')][_0x4aca('0x125')](db[_0x4aca('0xe4')],{'through':'team_has_whatsapp_queues','as':'Teams'});db[_0x4aca('0x1f8')][_0x4aca('0x124')](db[_0x4aca('0x10')],{'as':_0x4aca('0x1f9'),'foreignKey':_0x4aca('0x117'),'onDelete':_0x4aca('0x116'),'hooks':!![]});db[_0x4aca('0x10e')][_0x4aca('0x115')](db[_0x4aca('0x1cb')],{'as':'Dynamics365Account','onDelete':'restrict'});db['CloudProvider'][_0x4aca('0x115')](db['MailServerIn'],{'as':_0x4aca('0x167'),'onDelete':_0x4aca('0x166')});db['CloudProvider'][_0x4aca('0x115')](db[_0x4aca('0x3c')],{'as':_0x4aca('0x168'),'onDelete':_0x4aca('0x166')});module[_0x4aca('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8358aa0..d02fb11 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb458=['./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','./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/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/chatQueueReport','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','join','root','/apidoc','static','/www','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','setupLoggers','./api/client-side-logs','default','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports'];(function(_0x583000,_0x24c4d7){var _0x2f1f4a=function(_0x4d8e42){while(--_0x4d8e42){_0x583000['push'](_0x583000['shift']());}};_0x2f1f4a(++_0x24c4d7);}(_0xb458,0x103));var _0x8b45=function(_0x3fa71f,_0xd5ee31){_0x3fa71f=_0x3fa71f-0x0;var _0x59582f=_0xb458[_0x3fa71f];return _0x59582f;};'use strict';var path=require(_0x8b45('0x0'));var express=require(_0x8b45('0x1'));var errors=require(_0x8b45('0x2'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x8b45('0x3')];var clientSideLogs=require(_0x8b45('0x4'));exports[_0x8b45('0x5')]=function(_0x13a8c6){return setupLoggers(_0x13a8c6)['then'](function(){_0x13a8c6[_0x8b45('0x6')]('/api/users',require('./api/user'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x7'),require(_0x8b45('0x8')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x9'),require('./api/voiceContext'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xa'),require(_0x8b45('0xb')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xc'),require('./api/voiceMusicOnHold'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xd'),require('./api/voiceQueue'));_0x13a8c6['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xe'),require(_0x8b45('0xf')));_0x13a8c6['use'](_0x8b45('0x10'),require(_0x8b45('0x11')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x12'),require(_0x8b45('0x13')));_0x13a8c6[_0x8b45('0x6')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x14'),require(_0x8b45('0x15')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x16'),require(_0x8b45('0x17')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x18'),require(_0x8b45('0x19')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x1a'),require(_0x8b45('0x1b')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x1c'),require(_0x8b45('0x1d')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x1e'),require(_0x8b45('0x1f')));_0x13a8c6['use'](_0x8b45('0x20'),require(_0x8b45('0x21')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x22'),require(_0x8b45('0x23')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x24'),require(_0x8b45('0x25')));_0x13a8c6['use']('/api/mail/substatuses',require(_0x8b45('0x26')));_0x13a8c6['use'](_0x8b45('0x27'),require(_0x8b45('0x28')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x29'),require(_0x8b45('0x2a')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x2b'),require('./api/mailApplication'));_0x13a8c6['use'](_0x8b45('0x2c'),require(_0x8b45('0x2d')));_0x13a8c6['use']('/api/dashboards',require(_0x8b45('0x2e')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x2f'),require(_0x8b45('0x30')));_0x13a8c6['use'](_0x8b45('0x31'),require(_0x8b45('0x32')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x33'),require(_0x8b45('0x34')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x35'),require(_0x8b45('0x36')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x37'),require(_0x8b45('0x38')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x39'),require('./api/faxQueue'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x3a'),require(_0x8b45('0x3b')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x3c'),require(_0x8b45('0x3d')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x3e'),require('./api/smsApplication'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x3f'),require(_0x8b45('0x40')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x41'),require('./api/smsMessage'));_0x13a8c6[_0x8b45('0x6')]('/api/sms/queues',require('./api/smsQueue'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x42'),require(_0x8b45('0x43')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x44'),require(_0x8b45('0x45')));_0x13a8c6['use'](_0x8b45('0x46'),require(_0x8b45('0x47')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x48'),require('./api/openchannelMessage'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x49'),require(_0x8b45('0x4a')));_0x13a8c6['use'](_0x8b45('0x4b'),require(_0x8b45('0x4c')));_0x13a8c6[_0x8b45('0x6')]('/api/openchannel/reports/queue',require(_0x8b45('0x4d')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x4e'),require(_0x8b45('0x4f')));_0x13a8c6['use'](_0x8b45('0x50'),require(_0x8b45('0x51')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x52'),require(_0x8b45('0x53')));_0x13a8c6[_0x8b45('0x6')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x54'),require(_0x8b45('0x55')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x56'),require('./api/chatGroup'));_0x13a8c6[_0x8b45('0x6')]('/api/chat/proactive_actions',require(_0x8b45('0x57')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x58'),require(_0x8b45('0x59')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x5a'),require(_0x8b45('0x5b')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x5c'),require(_0x8b45('0x5d')));_0x13a8c6[_0x8b45('0x6')]('/api/cm/hopper_black',require(_0x8b45('0x5e')));_0x13a8c6['use'](_0x8b45('0x5f'),require('./api/cmHopperFinal'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x60'),require(_0x8b45('0x61')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x62'),require(_0x8b45('0x63')));_0x13a8c6['use'](_0x8b45('0x64'),require('./api/action'));_0x13a8c6['use'](_0x8b45('0x65'),require(_0x8b45('0x66')));_0x13a8c6[_0x8b45('0x6')]('/api/canned_answers',require(_0x8b45('0x67')));_0x13a8c6['use'](_0x8b45('0x68'),require(_0x8b45('0x69')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x6a'),require(_0x8b45('0x6b')));_0x13a8c6[_0x8b45('0x6')]('/api/intervals',require(_0x8b45('0x6c')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x6d'),require(_0x8b45('0x6e')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x6f'),require(_0x8b45('0x70')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x71'),require(_0x8b45('0x72')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x73'),require(_0x8b45('0x74')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x75'),require(_0x8b45('0x76')));_0x13a8c6['use']('/api/tags',require('./api/tag'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x77'),require(_0x8b45('0x78')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x79'),require(_0x8b45('0x7a')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x7b'),require('./api/variable'));_0x13a8c6[_0x8b45('0x6')]('/api/integrations',require(_0x8b45('0x7c')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x7d'),require(_0x8b45('0x7e')));_0x13a8c6['use'](_0x8b45('0x7f'),require(_0x8b45('0x80')));_0x13a8c6['use'](_0x8b45('0x81'),require(_0x8b45('0x82')));_0x13a8c6['use'](_0x8b45('0x83'),require(_0x8b45('0x84')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x85'),require(_0x8b45('0x86')));_0x13a8c6[_0x8b45('0x6')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x87'),require(_0x8b45('0x88')));_0x13a8c6['use'](_0x8b45('0x89'),require(_0x8b45('0x8a')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x8b'),require(_0x8b45('0x8c')));_0x13a8c6['use'](_0x8b45('0x8d'),require(_0x8b45('0x8e')));_0x13a8c6['use'](_0x8b45('0x8f'),require('./api/intSugarcrmAccount'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x90'),require(_0x8b45('0x91')));_0x13a8c6[_0x8b45('0x6')]('/api/integrations/sugarcrm/fields',require(_0x8b45('0x92')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x93'),require(_0x8b45('0x94')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x95'),require(_0x8b45('0x96')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x97'),require(_0x8b45('0x98')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x99'),require(_0x8b45('0x9a')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x9b'),require('./api/intZohoConfiguration'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x9c'),require(_0x8b45('0x9d')));_0x13a8c6['use'](_0x8b45('0x9e'),require(_0x8b45('0x9f')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xa0'),require('./api/intZendeskConfiguration'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xa1'),require(_0x8b45('0xa2')));_0x13a8c6[_0x8b45('0x6')]('/api/integrations/freshdesk/accounts',require(_0x8b45('0xa3')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xa4'),require(_0x8b45('0xa5')));_0x13a8c6[_0x8b45('0x6')]('/api/integrations/freshdesk/fields',require(_0x8b45('0xa6')));_0x13a8c6['use'](_0x8b45('0xa7'),require(_0x8b45('0xa8')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xa9'),require(_0x8b45('0xaa')));_0x13a8c6[_0x8b45('0x6')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xab'),require('./api/intServicenowAccount'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xac'),require(_0x8b45('0xad')));_0x13a8c6['use']('/api/integrations/servicenow/fields',require(_0x8b45('0xae')));_0x13a8c6[_0x8b45('0x6')]('/api/integrations/dynamics365/accounts',require(_0x8b45('0xaf')));_0x13a8c6['use'](_0x8b45('0xb0'),require('./api/intDynamics365Configuration'));_0x13a8c6['use'](_0x8b45('0xb1'),require(_0x8b45('0xb2')));_0x13a8c6['use'](_0x8b45('0xb3'),require(_0x8b45('0xb4')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xb5'),require(_0x8b45('0xb6')));_0x13a8c6['use'](_0x8b45('0xb7'),require(_0x8b45('0xb8')));_0x13a8c6[_0x8b45('0x6')]('/api/networks',require('./api/network'));_0x13a8c6[_0x8b45('0x6')]('/api/chat/reports/queue',require(_0x8b45('0xb9')));_0x13a8c6['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x13a8c6[_0x8b45('0x6')]('/api/jscripty/answers/reports',require(_0x8b45('0xba')));_0x13a8c6[_0x8b45('0x6')]('/api/jscripty/questions/reports',require(_0x8b45('0xbb')));_0x13a8c6[_0x8b45('0x6')]('/api/jscripty/sessions/reports',require(_0x8b45('0xbc')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xbd'),require(_0x8b45('0xbe')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xbf'),require(_0x8b45('0xc0')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xc1'),require(_0x8b45('0xc2')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xc3'),require('./api/jscriptyProject'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xc4'),require(_0x8b45('0xc5')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xc6'),require(_0x8b45('0xc7')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xc8'),require(_0x8b45('0xc9')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xca'),require(_0x8b45('0xcb')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xcc'),require(_0x8b45('0xcd')));_0x13a8c6['use'](_0x8b45('0xce'),require(_0x8b45('0xcf')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xd0'),require(_0x8b45('0xd1')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xd2'),require(_0x8b45('0xd3')));_0x13a8c6['use'](_0x8b45('0xd4'),require(_0x8b45('0xd5')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xd6'),require(_0x8b45('0xd7')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xd8'),require(_0x8b45('0xd9')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xda'),require(_0x8b45('0xdb')));_0x13a8c6['use']('/api/chat/reports/transfer',require(_0x8b45('0xdc')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xdd'),require(_0x8b45('0xde')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xdf'),require(_0x8b45('0xe0')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xe1'),require('./api/smsTransferReport'));_0x13a8c6['use'](_0x8b45('0xe2'),require(_0x8b45('0xe3')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xe4'),require('./api/voicePrefix'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xe5'),require(_0x8b45('0xe6')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xe7'),require(_0x8b45('0xe8')));_0x13a8c6['use']('/api/userProfile/resources',require(_0x8b45('0xe9')));_0x13a8c6['use']('/api/userNotifications',require('./api/userNotification'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xea'),require(_0x8b45('0xeb')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xec'),require(_0x8b45('0xed')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xee'),require(_0x8b45('0xef')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xf0'),require(_0x8b45('0xf1')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xf2'),require(_0x8b45('0xf3')));_0x13a8c6['use'](_0x8b45('0xf4'),require(_0x8b45('0xf5')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xf6'),require(_0x8b45('0xf7')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xf8'),require(_0x8b45('0xf9')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xfa'),require('./api/realtime'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xfb'),require(_0x8b45('0xfc')));_0x13a8c6[_0x8b45('0x6')]('/api/auth/local',require(_0x8b45('0xfd')));_0x13a8c6['use'](_0x8b45('0xfe'),require('./api/authGoogle'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0xff'),require(_0x8b45('0x100')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x101'),require(_0x8b45('0x102')));_0x13a8c6['use'](_0x8b45('0x103'),require(_0x8b45('0x104')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x105'),require('./api/version'));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x106'),require('./api/system'));_0x13a8c6['use'](_0x8b45('0x107'),require(_0x8b45('0x108')));_0x13a8c6[_0x8b45('0x6')]('/api/webbar',require(_0x8b45('0x109')));_0x13a8c6['use'](_0x8b45('0x10a'),clientSideLogs);_0x13a8c6[_0x8b45('0x6')]('/apidoc',express['static'](path[_0x8b45('0x10b')](config[_0x8b45('0x10c')],_0x8b45('0x10d'))));_0x13a8c6[_0x8b45('0x6')]('/www',express[_0x8b45('0x10e')](path[_0x8b45('0x10b')](config[_0x8b45('0x10c')],_0x8b45('0x10f'))));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x110'),express['static'](path[_0x8b45('0x10b')](config[_0x8b45('0x10c')],'/demo')));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x111'),express['static'](path['join'](config['root'],_0x8b45('0x112'),_0x8b45('0x113'))));_0x13a8c6[_0x8b45('0x6')](_0x8b45('0x114'),express[_0x8b45('0x10e')](path[_0x8b45('0x10b')](config[_0x8b45('0x10c')],'/server/files/plugins')));_0x13a8c6[_0x8b45('0x115')](_0x8b45('0x116'))[_0x8b45('0x117')](errors[0x194]);_0x13a8c6[_0x8b45('0x115')]('/*')[_0x8b45('0x117')](function(_0x10136e,_0x599d5c){_0x599d5c[_0x8b45('0x118')](path[_0x8b45('0x119')](_0x13a8c6[_0x8b45('0x117')](_0x8b45('0x11a'))+_0x8b45('0x11b')));});return _0x13a8c6;});}; \ No newline at end of file +var _0x7dfd=['./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/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/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','./api/migration','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','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/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./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/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xd7df('0x0'));var express=require(_0xd7df('0x1'));var errors=require(_0xd7df('0x2'));var config=require(_0xd7df('0x3'));var setupLoggers=require(_0xd7df('0x4'))[_0xd7df('0x5')];var clientSideLogs=require(_0xd7df('0x6'));exports[_0xd7df('0x7')]=function(_0x3ef231){return setupLoggers(_0x3ef231)[_0xd7df('0x8')](function(){_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa'),require(_0xd7df('0xb')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc'),require(_0xd7df('0xd')));_0x3ef231[_0xd7df('0x9')]('/api/voice/contexts',require(_0xd7df('0xe')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf'),require(_0xd7df('0x10')));_0x3ef231['use'](_0xd7df('0x11'),require('./api/voiceMusicOnHold'));_0x3ef231[_0xd7df('0x9')]('/api/voice/queues',require(_0xd7df('0x12')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x13'),require(_0xd7df('0x14')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x15'),require(_0xd7df('0x16')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x17'),require(_0xd7df('0x18')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x19'),require(_0xd7df('0x1a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x1b'),require(_0xd7df('0x1c')));_0x3ef231[_0xd7df('0x9')]('/api/voice/dials/reports',require(_0xd7df('0x1d')));_0x3ef231[_0xd7df('0x9')]('/api/voice/agents/reports',require(_0xd7df('0x1e')));_0x3ef231[_0xd7df('0x9')]('/api/voice/queues/reports',require(_0xd7df('0x1f')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x20'),require('./api/memberReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x21'),require(_0xd7df('0x22')));_0x3ef231['use'](_0xd7df('0x23'),require(_0xd7df('0x24')));_0x3ef231[_0xd7df('0x9')]('/api/mail/out_servers',require(_0xd7df('0x25')));_0x3ef231['use'](_0xd7df('0x26'),require('./api/mailAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x27'),require(_0xd7df('0x28')));_0x3ef231['use'](_0xd7df('0x29'),require('./api/mailSubstatus'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x2a'),require(_0xd7df('0x2b')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x2c'),require(_0xd7df('0x2d')));_0x3ef231[_0xd7df('0x9')]('/api/mail/applications',require('./api/mailApplication'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x2e'),require(_0xd7df('0x2f')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x30'),require(_0xd7df('0x31')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x32'),require(_0xd7df('0x33')));_0x3ef231['use'](_0xd7df('0x34'),require(_0xd7df('0x35')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x36'),require(_0xd7df('0x37')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x38'),require(_0xd7df('0x39')));_0x3ef231['use']('/api/fax/messages',require('./api/faxMessage'));_0x3ef231['use']('/api/fax/queues',require(_0xd7df('0x3a')));_0x3ef231['use'](_0xd7df('0x3b'),require(_0xd7df('0x3c')));_0x3ef231['use'](_0xd7df('0x3d'),require(_0xd7df('0x3e')));_0x3ef231['use'](_0xd7df('0x3f'),require(_0xd7df('0x40')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x41'),require(_0xd7df('0x42')));_0x3ef231[_0xd7df('0x9')]('/api/sms/messages',require(_0xd7df('0x43')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x44'),require(_0xd7df('0x45')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x46'),require(_0xd7df('0x47')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x48'),require(_0xd7df('0x49')));_0x3ef231[_0xd7df('0x9')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x3ef231[_0xd7df('0x9')]('/api/openchannel/messages',require(_0xd7df('0x4a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x4b'),require(_0xd7df('0x4c')));_0x3ef231['use']('/api/chat/websites',require('./api/chatWebsite'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x4d'),require('./api/openchannelQueueReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x4e'),require(_0xd7df('0x4f')));_0x3ef231[_0xd7df('0x9')]('/api/chat/interactions',require(_0xd7df('0x50')));_0x3ef231[_0xd7df('0x9')]('/api/chat/messages',require(_0xd7df('0x51')));_0x3ef231['use'](_0xd7df('0x52'),require(_0xd7df('0x53')));_0x3ef231[_0xd7df('0x9')]('/api/chat/queues',require(_0xd7df('0x54')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x55'),require(_0xd7df('0x56')));_0x3ef231['use'](_0xd7df('0x57'),require(_0xd7df('0x58')));_0x3ef231[_0xd7df('0x9')]('/api/cm/companies',require(_0xd7df('0x59')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x5a'),require('./api/cmContact'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x5b'),require('./api/cmHopper'));_0x3ef231['use'](_0xd7df('0x5c'),require(_0xd7df('0x5d')));_0x3ef231[_0xd7df('0x9')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x3ef231[_0xd7df('0x9')]('/api/cm/hopper_history',require(_0xd7df('0x5e')));_0x3ef231['use']('/api/cm/custom_fields',require(_0xd7df('0x5f')));_0x3ef231['use'](_0xd7df('0x60'),require(_0xd7df('0x61')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x62'),require(_0xd7df('0x63')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x64'),require(_0xd7df('0x65')));_0x3ef231[_0xd7df('0x9')]('/api/dispositions',require(_0xd7df('0x66')));_0x3ef231['use'](_0xd7df('0x67'),require(_0xd7df('0x68')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x69'),require(_0xd7df('0x6a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x6b'),require(_0xd7df('0x6c')));_0x3ef231[_0xd7df('0x9')]('/api/cdr',require(_0xd7df('0x6d')));_0x3ef231[_0xd7df('0x9')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x6e'),require(_0xd7df('0x6f')));_0x3ef231['use']('/api/sounds',require(_0xd7df('0x70')));_0x3ef231['use'](_0xd7df('0x71'),require(_0xd7df('0x72')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x73'),require(_0xd7df('0x74')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x75'),require(_0xd7df('0x76')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x77'),require(_0xd7df('0x78')));_0x3ef231[_0xd7df('0x9')]('/api/integrations',require(_0xd7df('0x79')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x7a'),require(_0xd7df('0x7b')));_0x3ef231[_0xd7df('0x9')]('/api/analytics/custom_reports',require(_0xd7df('0x7c')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x7d'),require('./api/analyticDefaultReport'));_0x3ef231[_0xd7df('0x9')]('/api/analytics/extracted_reports',require(_0xd7df('0x7e')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x7f'),require(_0xd7df('0x80')));_0x3ef231[_0xd7df('0x9')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x3ef231['use'](_0xd7df('0x81'),require('./api/analyticTreeReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x82'),require(_0xd7df('0x83')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x84'),require(_0xd7df('0x85')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x86'),require(_0xd7df('0x87')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x88'),require(_0xd7df('0x89')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x8a'),require(_0xd7df('0x8b')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/sugarcrm/fields',require(_0xd7df('0x8c')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x3ef231[_0xd7df('0x9')]('/api/integrations/desk/configurations',require(_0xd7df('0x8d')));_0x3ef231['use'](_0xd7df('0x8e'),require(_0xd7df('0x8f')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x3ef231['use'](_0xd7df('0x90'),require(_0xd7df('0x91')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x92'),require(_0xd7df('0x93')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/zendesk/accounts',require(_0xd7df('0x94')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x95'),require(_0xd7df('0x96')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x97'),require(_0xd7df('0x98')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x99'),require(_0xd7df('0x9a')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x9b'),require(_0xd7df('0x9c')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x9d'),require(_0xd7df('0x9e')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x9f'),require(_0xd7df('0xa0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa1'),require(_0xd7df('0xa2')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa3'),require(_0xd7df('0xa4')));_0x3ef231[_0xd7df('0x9')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa5'),require(_0xd7df('0xa6')));_0x3ef231['use'](_0xd7df('0xa7'),require(_0xd7df('0xa8')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xa9'),require('./api/intDynamics365Account'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xaa'),require(_0xd7df('0xab')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xac'),require(_0xd7df('0xad')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xae'),require('./api/intFreshsalesAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xaf'),require('./api/intFreshsalesConfiguration'));_0x3ef231['use']('/api/integrations/freshsales/fields',require(_0xd7df('0xb0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb1'),require(_0xd7df('0xb2')));_0x3ef231['use'](_0xd7df('0xb3'),require(_0xd7df('0xb4')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb5'),require(_0xd7df('0xb6')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb7'),require('./api/jscriptyAnswerReport'));_0x3ef231['use'](_0xd7df('0xb8'),require('./api/jscriptyQuestionReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xb9'),require(_0xd7df('0xba')));_0x3ef231['use']('/api/sms/reports/queue',require(_0xd7df('0xbb')));_0x3ef231[_0xd7df('0x9')]('/api/square/reports',require(_0xd7df('0xbc')));_0x3ef231[_0xd7df('0x9')]('/api/square/details/reports',require(_0xd7df('0xbd')));_0x3ef231[_0xd7df('0x9')]('/api/jscripty/projects',require(_0xd7df('0xbe')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xbf'),require(_0xd7df('0xc0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc1'),require(_0xd7df('0xc2')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc3'),require('./api/squareProject'));_0x3ef231['use'](_0xd7df('0xc4'),require(_0xd7df('0xc5')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc6'),require(_0xd7df('0xc7')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xc8'),require(_0xd7df('0xc9')));_0x3ef231[_0xd7df('0x9')]('/api/license',require(_0xd7df('0xca')));_0x3ef231[_0xd7df('0x9')]('/api/campaigns',require(_0xd7df('0xcb')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xcc'),require(_0xd7df('0xcd')));_0x3ef231['use']('/api/attachments',require('./api/attachment'));_0x3ef231[_0xd7df('0x9')]('/api/plugins',require(_0xd7df('0xce')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xcf'),require(_0xd7df('0xd0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xd1'),require('./api/chatTransferReport'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xd2'),require(_0xd7df('0xd3')));_0x3ef231['use'](_0xd7df('0xd4'),require(_0xd7df('0xd5')));_0x3ef231['use'](_0xd7df('0xd6'),require(_0xd7df('0xd7')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xd8'),require(_0xd7df('0xd9')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xda'),require('./api/voicePrefix'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xdb'),require(_0xd7df('0xdc')));_0x3ef231[_0xd7df('0x9')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xdd'),require(_0xd7df('0xde')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xdf'),require('./api/userNotification'));_0x3ef231[_0xd7df('0x9')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe0'),require(_0xd7df('0xe1')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe2'),require(_0xd7df('0xe3')));_0x3ef231['use']('/api/whatsapp/messages',require(_0xd7df('0xe4')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe5'),require(_0xd7df('0xe6')));_0x3ef231['use'](_0xd7df('0xe7'),require('./api/whatsappTransferReport'));_0x3ef231[_0xd7df('0x9')]('/api/whatsapp/queues',require(_0xd7df('0xe8')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xe9'),require(_0xd7df('0xea')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xeb'),require('./api/realtime'));_0x3ef231[_0xd7df('0x9')]('/api/user-settings',require(_0xd7df('0xec')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xed'),require(_0xd7df('0xee')));_0x3ef231['use'](_0xd7df('0xef'),require(_0xd7df('0xf0')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf1'),require(_0xd7df('0xf2')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf3'),require(_0xd7df('0xf4')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf5'),require(_0xd7df('0xf6')));_0x3ef231[_0xd7df('0x9')]('/api/version',require(_0xd7df('0xf7')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xf8'),require('./api/system'));_0x3ef231['use'](_0xd7df('0xf9'),require(_0xd7df('0xfa')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xfb'),require(_0xd7df('0xfc')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0xfd'),clientSideLogs);_0x3ef231[_0xd7df('0x9')](_0xd7df('0xfe'),express[_0xd7df('0xff')](path['join'](config[_0xd7df('0x100')],_0xd7df('0xfe'))));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x101'),express[_0xd7df('0xff')](path[_0xd7df('0x102')](config['root'],'/www')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x103'),express[_0xd7df('0xff')](path[_0xd7df('0x102')](config[_0xd7df('0x100')],'/demo')));_0x3ef231[_0xd7df('0x9')](_0xd7df('0x104'),express[_0xd7df('0xff')](path[_0xd7df('0x102')](config[_0xd7df('0x100')],_0xd7df('0x105'),_0xd7df('0x106'))));_0x3ef231['use'](_0xd7df('0x107'),express['static'](path['join'](config[_0xd7df('0x100')],_0xd7df('0x108'))));_0x3ef231[_0xd7df('0x109')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xd7df('0x10a')](errors[0x194]);_0x3ef231['route']('/*')['get'](function(_0x327f5a,_0x3d439d){_0x3d439d[_0xd7df('0x10b')](path[_0xd7df('0x10c')](_0x3ef231[_0xd7df('0x10a')]('appPath')+'/index.html'));});return _0x3ef231;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 8b0811d..032c8de 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b95=['../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','rpc','localhost','error','default','jayson/promise','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc'];(function(_0xfb9226,_0x6cdd8a){var _0xdb2cac=function(_0x2e43f0){while(--_0x2e43f0){_0xfb9226['push'](_0xfb9226['shift']());}};_0xdb2cac(++_0x6cdd8a);}(_0x5b95,0x102));var _0x55b9=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x5b95[_0x47a349];return _0x18ab75;};'use strict';var jayson=require(_0x55b9('0x0'));var _=require(_0x55b9('0x1'));var config=require(_0x55b9('0x2'));exports['listen']=function(){return new Promise(function(_0x44e7d1,_0x17a8f5){var _0x18ecbb={};_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/user/user.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x4')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x5')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/voiceRecording/voiceRecording.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x6')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x7')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x8')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x9')));_0x18ecbb=_['merge'](_0x18ecbb,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0xa')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0xb')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0xc')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0xd')));_0x18ecbb=_['merge'](_0x18ecbb,require('../api/mailInteraction/mailInteraction.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0xe')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0xf')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x10')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x11')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x12')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x13')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x14')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/faxQueue/faxQueue.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x15')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x16')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/smsMessage/smsMessage.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x17')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x18')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x19')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x1a')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x1b')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x1c')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x1d')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x1e')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/cmContact/cmContact.rpc'));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x1f')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x20')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x21')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x22')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x23')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x24')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x25')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x26')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x27')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x28')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x29')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x2a')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x2b')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x2c')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x2d')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x2e')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x2f')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x30')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x31')));_0x18ecbb=_['merge'](_0x18ecbb,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x32')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/squareReport/squareReport.rpc'));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x33')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x34')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x35')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x36')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x37')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x38')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x39')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x3a')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x3b')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x3c')));_0x18ecbb=_['merge'](_0x18ecbb,require(_0x55b9('0x3d')));_0x18ecbb=_[_0x55b9('0x3')](_0x18ecbb,require(_0x55b9('0x3e')));var _0x188837=jayson['server'](_0x18ecbb)[_0x55b9('0x3f')]();var _0x5778a7=config['rpc'][_0x55b9('0x40')]||config['port']+0x1;var _0x5bf283=config[_0x55b9('0x41')]['ip']||_0x55b9('0x42');_0x188837['on'](_0x55b9('0x43'),function(_0x4efb71){return _0x17a8f5(_0x4efb71);});_0x188837['listen'](_0x5778a7,_0x5bf283,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5bf283,_0x5778a7);require('../config/triggers')[_0x55b9('0x44')]();return _0x44e7d1('RPC\x20listening\x20on\x20'+_0x5bf283+':'+_0x5778a7);});});}; \ No newline at end of file +var _0xa661=['../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc'];(function(_0x1c1259,_0x2db8ee){var _0x1dab5c=function(_0x5d2670){while(--_0x5d2670){_0x1c1259['push'](_0x1c1259['shift']());}};_0x1dab5c(++_0x2db8ee);}(_0xa661,0x75));var _0x1a66=function(_0x4bf5fd,_0x21a61f){_0x4bf5fd=_0x4bf5fd-0x0;var _0xaa79ab=_0xa661[_0x4bf5fd];return _0xaa79ab;};'use strict';var jayson=require(_0x1a66('0x0'));var _=require('lodash');var config=require(_0x1a66('0x1'));exports[_0x1a66('0x2')]=function(){return new Promise(function(_0x4e9f33,_0x39a4eb){var _0x1d799c={};_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x4')));_0x1d799c=_['merge'](_0x1d799c,require('../api/voiceExtension/voiceExtension.rpc'));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x5')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x6')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x7')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x8')));_0x1d799c=_['merge'](_0x1d799c,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/memberReport/memberReport.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x9')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0xa')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0xb')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0xc')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0xd')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0xe')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0xf')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/mailMessage/mailMessage.rpc'));_0x1d799c=_['merge'](_0x1d799c,require('../api/mailApplication/mailApplication.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x10')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/faxAccount/faxAccount.rpc'));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x11')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x12')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x13')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/faxQueue/faxQueue.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x14')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/smsAccount/smsAccount.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x15')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x16')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/smsQueue/smsQueue.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x17')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x18')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x19')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x1a')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x1b')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x1c')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x1d')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x1e')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x1f')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x20')));_0x1d799c=_['merge'](_0x1d799c,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x21')));_0x1d799c=_['merge'](_0x1d799c,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/interval/interval.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/pause/pause.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x22')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x23')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x24')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x25')));_0x1d799c=_['merge'](_0x1d799c,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x26')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x27')));_0x1d799c=_['merge'](_0x1d799c,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x28')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x29')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x2a')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x2b')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x2c')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x2d')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x2e')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/squareProject/squareProject.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x2f')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x30')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require('../api/campaign/campaign.rpc'));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x31')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x32')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x33')));_0x1d799c=_['merge'](_0x1d799c,require(_0x1a66('0x34')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x35')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x36')));_0x1d799c=_[_0x1a66('0x3')](_0x1d799c,require(_0x1a66('0x37')));var _0x466a45=jayson[_0x1a66('0x38')](_0x1d799c)[_0x1a66('0x39')]();var _0x663402=config[_0x1a66('0x3a')][_0x1a66('0x3b')]||config[_0x1a66('0x3b')]+0x1;var _0x5d045e=config['rpc']['ip']||_0x1a66('0x3c');_0x466a45['on'](_0x1a66('0x3d'),function(_0x368d39){return _0x39a4eb(_0x368d39);});_0x466a45[_0x1a66('0x2')](_0x663402,_0x5d045e,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5d045e,_0x663402);require(_0x1a66('0x3e'))[_0x1a66('0x3f')]();return _0x4e9f33(_0x1a66('0x40')+_0x5d045e+':'+_0x663402);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 72d8e12..3f20887 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 _0x3a26=['E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setPriority','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','label','exports','util','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','code','close','timeout'];(function(_0x360b70,_0x4e2fc9){var _0x1894e7=function(_0x2e880e){while(--_0x2e880e){_0x360b70['push'](_0x360b70['shift']());}};_0x1894e7(++_0x4e2fc9);}(_0x3a26,0x129));var _0x63a2=function(_0x2e2b2f,_0x2e0258){_0x2e2b2f=_0x2e2b2f-0x0;var _0x35ddc5=_0x3a26[_0x2e2b2f];return _0x35ddc5;};'use strict';var util=require(_0x63a2('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x63a2('0x1')];var AGIReply=require(_0x63a2('0x2'));var AGIError=require(_0x63a2('0x3'));function AGIChannel(_0x31c143){var _0x399cf0=this,_0x52d368=new AGIReply(),_0x1d2898=![],_0x178f68={};EventEmitter[_0x63a2('0x4')](_0x399cf0);_0x31c143['setEncoding'](_0x63a2('0x5'));_0x31c143[_0x63a2('0x6')](0x8*0x3c*0x3c*0x3e8);_0x52d368[_0x63a2('0x7')]('utf8');_0x52d368['on'](_0x63a2('0x8'),function(_0x291950){for(var _0x2dc9c8 in _0x291950){_0x399cf0[_0x2dc9c8]=_0x291950[_0x2dc9c8];}_0x399cf0[_0x63a2('0x9')](_0x63a2('0xa'));});_0x52d368['on'](_0x63a2('0xb'),function(_0x211499){if(_0x211499[_0x63a2('0xc')]()==_0x63a2('0xd')){_0x399cf0['emit']('hangup');return;}if(_0x211499['substring'](0x0,0xb)==_0x63a2('0xe')){_0x1d2898=!![];}if(_0x1d2898){_0x178f68['rx']+=_0x211499+'\x0a';if(_0x211499[_0x63a2('0xf')](_0x63a2('0x10'))!=-0x1){_0x1d2898=![];}}else{_0x178f68['rx']=_0x211499;}if(_0x1d2898){return;}if(typeof _0x178f68['cb']==_0x63a2('0x11')){var _0x5f4ada=_0x178f68['rx'][_0x63a2('0x12')](0x0,0x3),_0x3f9f25=null,_0x263497=null;_0x5f4ada=parseInt(_0x5f4ada);if(isNaN(_0x5f4ada)){_0x178f68['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x63a2('0x13')});return;}if(_0x5f4ada!=0xc8){_0x178f68['cb'](null,{'code':_0x5f4ada,'result':-0x1,'extra':'KO'});return;}_0x3f9f25=_0x178f68['rx'][_0x63a2('0x12')](0x4)[_0x63a2('0x14')]('result=','');if(_0x3f9f25[_0x63a2('0x15')]('\x20')!=-0x1){_0x3f9f25=_0x3f9f25[_0x63a2('0x16')](0x0,_0x3f9f25['indexOf']('\x20'));}if(_[_0x63a2('0x17')](_0x3f9f25,'-1')){_0x3f9f25=parseInt(_0x3f9f25);}_0x263497=_0x178f68['rx'][_0x63a2('0x18')]('\x20');if(_0x263497['length']==0x3){_0x263497=_0x263497[0x2][_0x63a2('0x12')](0x1,_0x263497[0x2][_0x63a2('0x19')]-0x1);}else if(_0x263497[_0x63a2('0x19')]>0x3){var _0x31e169=/\((.+)\)/;var _0x26b5b3=_0x178f68['rx'][_0x63a2('0x1a')](_0x31e169);if(_0x26b5b3){_0x263497=_0x26b5b3[0x1];}else{_0x263497=null;}}else{_0x263497=null;}_0x178f68['cb'](null,{'code':_0x5f4ada,'result':_0x3f9f25,'extra':_0x263497});}});_0x31c143['on'](_0x63a2('0x1b'),function(_0x2799e0){_0x399cf0[_0x63a2('0x9')](_0x63a2('0x1b'),new AGIError('E_AGI_SOCKET_ERROR',_0x2799e0[_0x63a2('0x1c')]));});_0x31c143['on'](_0x63a2('0x1d'),function(){_0x399cf0[_0x63a2('0x9')](_0x63a2('0x1d'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x31c143['on'](_0x63a2('0x1e'),function(){_0x399cf0[_0x63a2('0x9')]('timeout',new AGIError(_0x63a2('0x1f')));_0x31c143['destroy']();});_0x31c143['pipe'](_0x52d368);this[_0x63a2('0x20')]=function(_0x1e258d,_0x4883a2){var _0x1e258d=_0x1e258d||'',_0x4883a2=typeof _0x4883a2=='function'?_0x4883a2:new Function();_0x178f68={'tx':_0x1e258d,'rx':'','cb':_0x4883a2};_0x31c143[_0x63a2('0x21')](_0x1e258d+'\x0a');},this[_0x63a2('0x1d')]=function(){_0x31c143[_0x63a2('0x22')]();};}util[_0x63a2('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x63a2('0x24')][_0x63a2('0x25')]=function(_0x35332d){return this[_0x63a2('0x20')][_0x63a2('0x26')](this,_0x35332d);};AGIChannel[_0x63a2('0x24')][_0x63a2('0x27')]=function(){return this[_0x63a2('0x25')](_0x63a2('0x28'));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x29')]=function(_0x4199e9,_0x23c20a,_0x44054e){_0x4199e9=_0x4199e9===undefined?_0x63a2('0x2a'):_0x4199e9;_0x23c20a=_0x23c20a===undefined?'5':_0x23c20a;_0x44054e=_0x44054e===undefined?'1':_0x44054e;return this[_0x63a2('0x25')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4199e9,_0x23c20a*0x3e8,_0x44054e));};AGIChannel[_0x63a2('0x24')]['noop']=function(_0x3db325){_0x3db325=_0x3db325||'NO\x20MESSAGE';return this[_0x63a2('0x25')](util[_0x63a2('0x2b')](_0x63a2('0x2c'),_0x3db325));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x2d')]=function(_0x118465,_0x5e25da){if(_[_0x63a2('0x2e')](_0x5e25da)){return this[_0x63a2('0x25')](util['format']('EXEC\x20%s\x20%s',_0x118465,_0x5e25da[_0x63a2('0x2f')](',')));}return this[_0x63a2('0x25')](util['format'](_0x63a2('0x30'),_0x118465,_0x5e25da));};AGIChannel[_0x63a2('0x24')]['setContext']=function(_0x3b91c2){return this['sendRequest'](util[_0x63a2('0x2b')](_0x63a2('0x31'),_0x3b91c2));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x32')]=function(_0x380de3){return this[_0x63a2('0x25')](util['format'](_0x63a2('0x33'),_0x380de3));};AGIChannel[_0x63a2('0x24')]['setPriority']=function(_0x2bbc5d){return this[_0x63a2('0x25')](util[_0x63a2('0x2b')](_0x63a2('0x34'),_0x2bbc5d));};AGIChannel[_0x63a2('0x24')]['hangup']=function(){return this['sendRequest'](_0x63a2('0x35'));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x36')]=function(_0x56b2fe,_0x6aed90){var _0x774843=_[_0x63a2('0x37')](_0x6aed90)||_[_0x63a2('0x38')](_0x6aed90)?_0x6aed90[_0x63a2('0x39')]():_0x6aed90;return this[_0x63a2('0x25')](util[_0x63a2('0x2b')](_0x63a2('0x3a'),_0x56b2fe,_0x774843?_0x774843[_0x63a2('0x39')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x63a2('0x3b')]=function(_0x423a20,_0x588829){return this['sendRequest'](util[_0x63a2('0x2b')](_0x63a2('0x3c'),_0x423a20,_0x588829));};AGIChannel['prototype'][_0x63a2('0x3d')]=function(_0x1b5d8d,_0x3cc4b4){return this['sendRequest'](util['format'](_0x63a2('0x3e'),_0x1b5d8d,_0x3cc4b4));};AGIChannel[_0x63a2('0x24')]['sayPhonetic']=function(_0x146996,_0x9e30df){return this[_0x63a2('0x25')](util[_0x63a2('0x2b')](_0x63a2('0x3f'),_0x146996,_0x9e30df));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x40')]=function(_0xff9088,_0xbf818,_0xb9b3a5){_0xbf818=_0xbf818||this[_0x63a2('0x41')];_0xb9b3a5=_0xb9b3a5||0x1;this[_0x63a2('0x42')](_0xff9088);this[_0x63a2('0x32')](_0xbf818);this[_0x63a2('0x43')](_0xb9b3a5);return this[_0x63a2('0x44')](util['format'](_0x63a2('0x45'),_0xff9088,_0xbf818,_0xb9b3a5));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x46')]=function(_0x1219a0){return this['sendRequest'](util[_0x63a2('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x1219a0));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x47')]=function(_0x8ee394,_0x27257d,_0x495233,_0xb1426f,_0x121e4b,_0x492f4f){_0x27257d=_0x27257d||_0x63a2('0x48');_0x495233=_0x495233||'';_0xb1426f=_0xb1426f===undefined?-0x1:_0xb1426f==='-1'?-0x1:_0xb1426f*0x3e8;_0x121e4b=_0x121e4b===undefined?'':'s='+_0x121e4b;_0x492f4f=_0x492f4f?_0x63a2('0x49'):'';return this[_0x63a2('0x25')](util[_0x63a2('0x2b')](_0x63a2('0x4a'),_0x8ee394,_0x27257d,_0x495233,_0xb1426f,_0x492f4f,_0x121e4b));};AGIChannel['prototype'][_0x63a2('0x4b')]=function(_0x705cf1,_0x28486e){_0x28486e=_0x28486e||'';return this['sendRequest'](util[_0x63a2('0x2b')](_0x63a2('0x4c'),_0x705cf1,_0x28486e));};AGIChannel[_0x63a2('0x24')][_0x63a2('0x4d')]=function(_0x3eb78f){return this[_0x63a2('0x2d')](_0x63a2('0x4e'),_0x3eb78f);};AGIChannel[_0x63a2('0x24')]['wait']=function(_0x2c228e){return this[_0x63a2('0x2d')](_0x63a2('0x4f'),_0x2c228e);};AGIChannel[_0x63a2('0x24')][_0x63a2('0x1b')]=function(_0x3c0fb4,_0x3002c0){this[_0x63a2('0x44')](util[_0x63a2('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3c0fb4['id'],_0x3c0fb4[_0x63a2('0x50')],_0x3002c0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x63a2('0x51')]=AGIChannel; \ No newline at end of file +var _0xae35=['result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','write','destroy','sendRequest','sync','prototype','answer','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','extension','setExtension','setPriority','noop','getVariable','recordFile','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','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','headers','ready','line','toLowerCase','emit','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code'];(function(_0x5f082a,_0x2514bc){var _0xf6c760=function(_0x509e1b){while(--_0x509e1b){_0x5f082a['push'](_0x5f082a['shift']());}};_0xf6c760(++_0x2514bc);}(_0xae35,0x172));var _0x5ae3=function(_0x494394,_0xe67345){_0x494394=_0x494394-0x0;var _0x417183=_0xae35[_0x494394];return _0x417183;};'use strict';var util=require(_0x5ae3('0x0'));var _=require(_0x5ae3('0x1'));var EventEmitter=require(_0x5ae3('0x2'))[_0x5ae3('0x3')];var AGIReply=require(_0x5ae3('0x4'));var AGIError=require(_0x5ae3('0x5'));function AGIChannel(_0x2bd1c8){var _0x39d9b7=this,_0x54c0f2=new AGIReply(),_0x6dffe3=![],_0x4d1536={};EventEmitter[_0x5ae3('0x6')](_0x39d9b7);_0x2bd1c8[_0x5ae3('0x7')]('utf8');_0x2bd1c8[_0x5ae3('0x8')](0x8*0x3c*0x3c*0x3e8);_0x54c0f2[_0x5ae3('0x7')]('utf8');_0x54c0f2['on'](_0x5ae3('0x9'),function(_0x2c91a0){for(var _0x2bdef8 in _0x2c91a0){_0x39d9b7[_0x2bdef8]=_0x2c91a0[_0x2bdef8];}_0x39d9b7['emit'](_0x5ae3('0xa'));});_0x54c0f2['on'](_0x5ae3('0xb'),function(_0x5a8f92){if(_0x5a8f92[_0x5ae3('0xc')]()=='hangup'){_0x39d9b7[_0x5ae3('0xd')](_0x5ae3('0xe'));return;}if(_0x5a8f92[_0x5ae3('0xf')](0x0,0xb)==_0x5ae3('0x10')){_0x6dffe3=!![];}if(_0x6dffe3){_0x4d1536['rx']+=_0x5a8f92+'\x0a';if(_0x5a8f92[_0x5ae3('0x11')](_0x5ae3('0x12'))!=-0x1){_0x6dffe3=![];}}else{_0x4d1536['rx']=_0x5a8f92;}if(_0x6dffe3){return;}if(typeof _0x4d1536['cb']=='function'){var _0x294df1=_0x4d1536['rx'][_0x5ae3('0xf')](0x0,0x3),_0x3953f3=null,_0x1a2ec4=null;_0x294df1=parseInt(_0x294df1);if(isNaN(_0x294df1)){_0x4d1536['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5ae3('0x13')});return;}if(_0x294df1!=0xc8){_0x4d1536['cb'](null,{'code':_0x294df1,'result':-0x1,'extra':'KO'});return;}_0x3953f3=_0x4d1536['rx'][_0x5ae3('0xf')](0x4)['replace'](_0x5ae3('0x14'),'');if(_0x3953f3[_0x5ae3('0x15')]('\x20')!=-0x1){_0x3953f3=_0x3953f3[_0x5ae3('0x16')](0x0,_0x3953f3[_0x5ae3('0x15')]('\x20'));}if(_[_0x5ae3('0x17')](_0x3953f3,'-1')){_0x3953f3=parseInt(_0x3953f3);}_0x1a2ec4=_0x4d1536['rx'][_0x5ae3('0x18')]('\x20');if(_0x1a2ec4['length']==0x3){_0x1a2ec4=_0x1a2ec4[0x2][_0x5ae3('0xf')](0x1,_0x1a2ec4[0x2]['length']-0x1);}else if(_0x1a2ec4[_0x5ae3('0x19')]>0x3){var _0x5e2470=/\((.+)\)/;var _0x81f732=_0x4d1536['rx'][_0x5ae3('0x1a')](_0x5e2470);if(_0x81f732){_0x1a2ec4=_0x81f732[0x1];}else{_0x1a2ec4=null;}}else{_0x1a2ec4=null;}_0x4d1536['cb'](null,{'code':_0x294df1,'result':_0x3953f3,'extra':_0x1a2ec4});}});_0x2bd1c8['on'](_0x5ae3('0x1b'),function(_0x2d8626){_0x39d9b7[_0x5ae3('0xd')](_0x5ae3('0x1b'),new AGIError(_0x5ae3('0x1c'),_0x2d8626[_0x5ae3('0x1d')]));});_0x2bd1c8['on']('close',function(){_0x39d9b7[_0x5ae3('0xd')](_0x5ae3('0x1e'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x2bd1c8['on'](_0x5ae3('0x1f'),function(){_0x39d9b7[_0x5ae3('0xd')]('timeout',new AGIError(_0x5ae3('0x20')));_0x2bd1c8['destroy']();});_0x2bd1c8[_0x5ae3('0x21')](_0x54c0f2);this[_0x5ae3('0x22')]=function(_0x2ede90,_0x23bf8b){var _0x2ede90=_0x2ede90||'',_0x23bf8b=typeof _0x23bf8b==_0x5ae3('0x23')?_0x23bf8b:new Function();_0x4d1536={'tx':_0x2ede90,'rx':'','cb':_0x23bf8b};_0x2bd1c8[_0x5ae3('0x24')](_0x2ede90+'\x0a');},this[_0x5ae3('0x1e')]=function(){_0x2bd1c8[_0x5ae3('0x25')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x5ae3('0x26')]=function(_0x10d30b){return this['command'][_0x5ae3('0x27')](this,_0x10d30b);};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x29')]=function(){return this[_0x5ae3('0x26')](_0x5ae3('0x2a'));};AGIChannel[_0x5ae3('0x28')]['getData']=function(_0x1b95ed,_0xafa531,_0x48c258){_0x1b95ed=_0x1b95ed===undefined?_0x5ae3('0x2b'):_0x1b95ed;_0xafa531=_0xafa531===undefined?'5':_0xafa531;_0x48c258=_0x48c258===undefined?'1':_0x48c258;return this['sendRequest'](util['format'](_0x5ae3('0x2c'),_0x1b95ed,_0xafa531*0x3e8,_0x48c258));};AGIChannel[_0x5ae3('0x28')]['noop']=function(_0x9a97b){_0x9a97b=_0x9a97b||_0x5ae3('0x2d');return this['sendRequest'](util[_0x5ae3('0x2e')](_0x5ae3('0x2f'),_0x9a97b));};AGIChannel['prototype'][_0x5ae3('0x30')]=function(_0x87574d,_0x58f17f){if(_[_0x5ae3('0x31')](_0x58f17f)){return this[_0x5ae3('0x26')](util[_0x5ae3('0x2e')](_0x5ae3('0x32'),_0x87574d,_0x58f17f[_0x5ae3('0x33')](',')));}return this[_0x5ae3('0x26')](util['format'](_0x5ae3('0x32'),_0x87574d,_0x58f17f));};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x34')]=function(_0x23c040){return this[_0x5ae3('0x26')](util['format'](_0x5ae3('0x35'),_0x23c040));};AGIChannel['prototype']['setExtension']=function(_0x671898){return this[_0x5ae3('0x26')](util[_0x5ae3('0x2e')](_0x5ae3('0x36'),_0x671898));};AGIChannel[_0x5ae3('0x28')]['setPriority']=function(_0x371ebd){return this[_0x5ae3('0x26')](util[_0x5ae3('0x2e')](_0x5ae3('0x37'),_0x371ebd));};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0xe')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x38')]=function(_0x2c7d9c,_0x42fc9f){var _0x4c9416=_[_0x5ae3('0x39')](_0x42fc9f)||_[_0x5ae3('0x3a')](_0x42fc9f)?_0x42fc9f[_0x5ae3('0x3b')]():_0x42fc9f;return this[_0x5ae3('0x26')](util['format'](_0x5ae3('0x3c'),_0x2c7d9c,_0x4c9416?_0x4c9416['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x3d')]=function(_0x1484df,_0x3e4d17){return this[_0x5ae3('0x26')](util['format'](_0x5ae3('0x3e'),_0x1484df,_0x3e4d17));};AGIChannel['prototype']['sayDigits']=function(_0x4cf9f5,_0x111439){return this[_0x5ae3('0x26')](util[_0x5ae3('0x2e')](_0x5ae3('0x3f'),_0x4cf9f5,_0x111439));};AGIChannel['prototype'][_0x5ae3('0x40')]=function(_0x5f235e,_0x4d97a0){return this[_0x5ae3('0x26')](util[_0x5ae3('0x2e')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x5f235e,_0x4d97a0));};AGIChannel[_0x5ae3('0x28')]['continueAt']=function(_0xcb5dc7,_0x287f08,_0x3c94ea){_0x287f08=_0x287f08||this[_0x5ae3('0x41')];_0x3c94ea=_0x3c94ea||0x1;this[_0x5ae3('0x34')](_0xcb5dc7);this[_0x5ae3('0x42')](_0x287f08);this[_0x5ae3('0x43')](_0x3c94ea);return this[_0x5ae3('0x44')](util['format']('GOTO\x20%s\x20%s\x20%s',_0xcb5dc7,_0x287f08,_0x3c94ea));};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x45')]=function(_0x3952d0){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x3952d0));};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x46')]=function(_0x53a309,_0x149fd5,_0x29bbbe,_0x5b777a,_0x4b93f0,_0x463ddf){_0x149fd5=_0x149fd5||_0x5ae3('0x47');_0x29bbbe=_0x29bbbe||'';_0x5b777a=_0x5b777a===undefined?-0x1:_0x5b777a==='-1'?-0x1:_0x5b777a*0x3e8;_0x4b93f0=_0x4b93f0===undefined?'':'s='+_0x4b93f0;_0x463ddf=_0x463ddf?'BEEP':'';return this[_0x5ae3('0x26')](util[_0x5ae3('0x2e')](_0x5ae3('0x48'),_0x53a309,_0x149fd5,_0x29bbbe,_0x5b777a,_0x463ddf,_0x4b93f0));};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x49')]=function(_0x32ae6b,_0x312769){_0x312769=_0x312769||'';return this[_0x5ae3('0x26')](util[_0x5ae3('0x2e')](_0x5ae3('0x4a'),_0x32ae6b,_0x312769));};AGIChannel[_0x5ae3('0x28')]['agi']=function(_0x10dc5f){return this[_0x5ae3('0x30')]('AGI',_0x10dc5f);};AGIChannel[_0x5ae3('0x28')]['wait']=function(_0x549019){return this[_0x5ae3('0x30')](_0x5ae3('0x4b'),_0x549019);};AGIChannel[_0x5ae3('0x28')][_0x5ae3('0x1b')]=function(_0x257a97,_0x2c8b60){this[_0x5ae3('0x44')](util[_0x5ae3('0x2e')](_0x5ae3('0x4c'),_0x257a97['id'],_0x257a97['label'],_0x2c8b60));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x5ae3('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 3c3c383..f193b61 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 _0x1356=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','E_AGI_UNDEFINED','push','format','apply','Undefined\x20error.'];(function(_0x4ca08b,_0x453114){var _0x4108e8=function(_0x47d8fa){while(--_0x47d8fa){_0x4ca08b['push'](_0x4ca08b['shift']());}};_0x4108e8(++_0x453114);}(_0x1356,0x11f));var _0x6135=function(_0x39ca43,_0x499341){_0x39ca43=_0x39ca43-0x0;var _0x38ed9b=_0x1356[_0x39ca43];return _0x38ed9b;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x6135('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x6135('0x1'),'E_AGI_SERVER_CLOSE':_0x6135('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x6135('0x3'),'E_AGI_SOCKET_ERROR':_0x6135('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','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(_0x505bf3){var _0x505bf3=_0x505bf3||null,_0x4ff669=_0x4ff669||[],_0x35f0a8=0x1,_0x12cea0='';if(!error[_0x505bf3]){_0x505bf3=_0x6135('0x5');}_0x4ff669['push'](error[_0x505bf3]);while(arguments[_0x35f0a8]){_0x4ff669[_0x6135('0x6')](arguments[_0x35f0a8]);_0x35f0a8++;}_0x12cea0=util[_0x6135('0x7')][_0x6135('0x8')](util,_0x4ff669);this['message']=_0x12cea0;this['name']=_0x505bf3;}module['exports']=AGIError; \ No newline at end of file +var _0xb1f7=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply','name','exports','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x3433b0,_0x4f0ff0){var _0x33f469=function(_0x52a5f6){while(--_0x52a5f6){_0x3433b0['push'](_0x3433b0['shift']());}};_0x33f469(++_0x4f0ff0);}(_0xb1f7,0x14b));var _0x7b1f=function(_0x1ae406,_0x22d05e){_0x1ae406=_0x1ae406-0x0;var _0x510ab5=_0xb1f7[_0x1ae406];return _0x510ab5;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x7b1f('0x0'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x7b1f('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0x7b1f('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0x7b1f('0x3'),'E_AGI_SOCKET_ERROR':_0x7b1f('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x7b1f('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7b1f('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2bf1eb){var _0x2bf1eb=_0x2bf1eb||null,_0x1607b1=_0x1607b1||[],_0xaa998e=0x1,_0x2b3ee4='';if(!error[_0x2bf1eb]){_0x2bf1eb=_0x7b1f('0x7');}_0x1607b1[_0x7b1f('0x8')](error[_0x2bf1eb]);while(arguments[_0xaa998e]){_0x1607b1[_0x7b1f('0x8')](arguments[_0xaa998e]);_0xaa998e++;}_0x2b3ee4=util['format'][_0x7b1f('0x9')](util,_0x1607b1);this['message']=_0x2b3ee4;this[_0x7b1f('0xa')]=_0x2bf1eb;}module[_0x7b1f('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 07118c6..09b3e01 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 _0xc64d=['numberOfEdges','size','relations','getVertex','traverseBFS','info','stop\x20traverse','no\x20edge/s\x20available','length','split','agicommand','target','invalid','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','vertices','prototype','edges','addEdge','push'];(function(_0x457eb2,_0x11c98a){var _0x28ec17=function(_0xc859ac){while(--_0xc859ac){_0x457eb2['push'](_0x457eb2['shift']());}};_0x28ec17(++_0x11c98a);}(_0xc64d,0x1d2));var _0xdc64=function(_0x4bdb0d,_0x1aca0d){_0x4bdb0d=_0x4bdb0d-0x0;var _0x2bdf63=_0xc64d[_0x4bdb0d];return _0x2bdf63;};'use strict';var _=require(_0xdc64('0x0'));var logger=require(_0xdc64('0x1'))(_0xdc64('0x2'));var verticesWithRetry=[_0xdc64('0x3'),'getdigits','getsecretdigits'];var Graph=function(){this[_0xdc64('0x4')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0xdc64('0x5')]['addVertex']=function(_0x393975){this[_0xdc64('0x4')][_0x393975['id']]=_0x393975;this[_0xdc64('0x6')][_0x393975['id']]=[];};Graph[_0xdc64('0x5')][_0xdc64('0x7')]=function(_0x3ffa9c,_0x310908,_0x1dfb2b){this[_0xdc64('0x6')][_0x3ffa9c][_0xdc64('0x8')]({'target':_0x310908,'condition':_0x1dfb2b});this[_0xdc64('0x9')]+=0x1;};Graph['prototype'][_0xdc64('0xa')]=function(){return _['size'](this[_0xdc64('0x4')]);};Graph['prototype'][_0xdc64('0xb')]=function(){return this[_0xdc64('0x9')];};Graph[_0xdc64('0x5')][_0xdc64('0xc')]=function(_0x5446ad){return this['vertices'][_0x5446ad];};Graph[_0xdc64('0x5')][_0xdc64('0xd')]=function(_0x454505,_0x54b96c){if(!this[_0xdc64('0x4')][_0x454505]){return logger[_0xdc64('0xe')]('no\x20vertex\x20found');}var _0x50d323=_0x54b96c(this[_0xdc64('0x4')][_0x454505]);if(!_0x50d323){return logger[_0xdc64('0xe')](_0xdc64('0xf'));}if(this[_0xdc64('0x6')][_0x454505]['length']===0x0){return logger[_0xdc64('0xe')](_0xdc64('0x10'));}for(var _0x51b660=0x0,_0x1689aa=[],_0x31cc15=![];_0x51b660\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','Project\x20%s\x20not\x20published','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./graph','defaults','127.0.0.1','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','format','[%s]\x20%s','[ERROR]\x20%s','info','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','indexOf','agi_','substring','inspect','debug'];(function(_0x2727b9,_0x2de6fb){var _0x5ede4d=function(_0x1ac008){while(--_0x1ac008){_0x2727b9['push'](_0x2727b9['shift']());}};_0x5ede4d(++_0x2de6fb);}(_0x726a,0x134));var _0xa726=function(_0x247927,_0x14c9aa){_0x247927=_0x247927-0x0;var _0x242f82=_0x726a[_0x247927];return _0x242f82;};'use strict';var parser=require(_0xa726('0x0'));var _=require('lodash');var syncho=require(_0xa726('0x1'));var util=require(_0xa726('0x2'));var moment=require('moment');var config=require(_0xa726('0x3'));var logger=require(_0xa726('0x4'))(_0xa726('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0xa726('0x6'));var mailRpc=require('./mailRpc');var Graph=require(_0xa726('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xa726('0x5')]=_[_0xa726('0x8')](config[_0xa726('0x5')],{'ip':_0xa726('0x9'),'port':0x11dd});function connectionHandler(_0x28e6f0){process[_0xa726('0xa')](function(){syncho(function(){try{setChannelVariables(_0x28e6f0);agiHandler(_0x28e6f0);}catch(_0x4f3ee3){logger['error'](_0x4f3ee3[_0xa726('0xb')]);}});});}function listeningHandler(){console[_0xa726('0xc')](_0xa726('0xd'),config[_0xa726('0x5')][_0xa726('0xe')]);logger['info'](util['format'](_0xa726('0xf'),config[_0xa726('0x5')]['ip'],config['agi'][_0xa726('0xe')]));}function errorHandler(_0x1c3441){if(_0x1c3441&&_0x1c3441[_0xa726('0x10')]&&_0x1c3441[_0xa726('0x11')]){logger[_0xa726('0x12')](util[_0xa726('0x13')](_0xa726('0x14'),_0x1c3441[_0xa726('0x10')],_0x1c3441[_0xa726('0x11')]));}else{logger[_0xa726('0x12')](util['format'](_0xa726('0x15'),_0x1c3441[_0xa726('0xb')]));}}function closeHandler(){logger[_0xa726('0x16')](util[_0xa726('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xa726('0x17')],this[_0xa726('0x18')],this[_0xa726('0x19')],this[_0xa726('0x1a')]));try{createSquareReport(this);}catch(_0x33c1a3){logger[_0xa726('0x12')](_0x33c1a3[_0xa726('0xb')]);}}function timeoutHandler(){logger[_0xa726('0x16')](util[_0xa726('0x13')](_0xa726('0x1b'),this[_0xa726('0x1c')],this[_0xa726('0x17')],this[_0xa726('0x18')],this[_0xa726('0x19')],this['uniqueid']));}function hangupHandler(){logger[_0xa726('0x16')](util['format'](_0xa726('0x1d'),this[_0xa726('0x1c')],this[_0xa726('0x17')],this[_0xa726('0x18')],this[_0xa726('0x19')],this[_0xa726('0x1a')]));this[_0xa726('0x1e')]=!![];}function getRoot(_0x3e03e4){return parser['toJson'](_0x3e03e4,{'object':!![]})[_0xa726('0x1f')]['root'];}function addVertex(_0x42b4ab,_0x20debf,_0x4d779c){_0x20debf[_0xa726('0x20')]=_0x4d779c;if(_0x20debf[_0xa726('0x21')](_0xa726('0x22'))){_0x20debf['maxRetry']=parseInt(_0x20debf['retry'],0xa);}_0x42b4ab[_0xa726('0x23')](_[_0xa726('0x24')](_0x20debf,_0xa726('0x25')));}function initGraph(_0x2e2c5f,_0x4c3d54){var _0xf10a49=new Graph();for(var _0x2213dd in _0x2e2c5f){if(_0x2e2c5f[_0xa726('0x21')](_0x2213dd)){if(_[_0xa726('0x26')](_0x2e2c5f[_0x2213dd])){for(var _0x528a81=0x0;_0x528a81<_0x2e2c5f[_0x2213dd][_0xa726('0x27')];_0x528a81+=0x1){addVertex(_0xf10a49,_0x2e2c5f[_0x2213dd][_0x528a81],_0x2213dd);}}else{addVertex(_0xf10a49,_0x2e2c5f[_0x2213dd],_0x2213dd);}}}for(var _0x28cae9=0x0;_0x28cae9<_0x4c3d54['length'];_0x28cae9+=0x1){if(_0x4c3d54[_0x28cae9]['source']&&_0x4c3d54[_0x28cae9][_0xa726('0x28')]){_0xf10a49[_0xa726('0x29')](_0x4c3d54[_0x28cae9][_0xa726('0x2a')],_0x4c3d54[_0x28cae9][_0xa726('0x28')],_0x4c3d54[_0x28cae9][_0xa726('0x2b')]);}}return _0xf10a49;}function getSquareProject(_0x30b215,_0x207350){rpc[_0xa726('0x2c')](_0x30b215)[_0xa726('0x2d')](function(_0x59e365){_0x207350(null,_0x59e365);})[_0xa726('0x2e')](function(_0x9e8d17){_0x207350(null,_0x9e8d17);});}function createSquareReport(_0x5628b2,_0x485e06){rpc['createSquareReport'](_0x5628b2)[_0xa726('0x2d')](function(_0x32f092){if(_0x485e06){_0x485e06(null,_0x32f092);}})[_0xa726('0x2e')](function(_0x3e93f2){if(_0x485e06){_0x485e06(null,_0x3e93f2);}});}function setChannelVariables(_0x421db7){for(var _0x1e7264 in _0x421db7){if(_0x421db7[_0xa726('0x21')](_0x1e7264)){if(_0x1e7264[_0xa726('0x2f')](_0xa726('0x30'))===0x0){_0x421db7[_0x1e7264[_0xa726('0x31')](0x4)]=_0x421db7[_0x1e7264];delete _0x421db7[_0x1e7264];}}}}function getLogFromObject(_0x4750b3){return util[_0xa726('0x32')](_0x4750b3,{'showHidden':![],'depth':null});}function agiHandler(_0x12126f){var _0x39d9e8,_0xbf44ea,_0x463504,_0x3b1904,_0x1beb5d;logger[_0xa726('0x33')](_0xa726('0x34'),JSON[_0xa726('0x35')](_0x12126f,null,0x2));logger['info'](util[_0xa726('0x13')](_0xa726('0x36'),_0x12126f[_0xa726('0x1c')],_0x12126f[_0xa726('0x17')],_0x12126f[_0xa726('0x18')],_0x12126f[_0xa726('0x19')],_0x12126f[_0xa726('0x1a')]));_0x12126f['on']('error',errorHandler);_0x12126f['on'](_0xa726('0x37'),closeHandler);_0x12126f['on'](_0xa726('0x38'),timeoutHandler);_0x12126f[_0xa726('0x1e')]=![];_0x12126f['on'](_0xa726('0x39'),hangupHandler);var _0x519931=getSquareProject['sync'](null,_0x12126f[_0xa726('0x1c')]);if(_0x519931){if(_0x519931[_0xa726('0x3a')]){_0x39d9e8=getRoot(_0x519931[_0xa726('0x3a')]);if(_0x39d9e8&&_0x39d9e8['start']){logger[_0xa726('0x33')](_0xa726('0x3b'),JSON[_0xa726('0x35')](_0x39d9e8,null,0x2));_0x12126f[_0xa726('0x3c')]=moment()[_0xa726('0x13')](_0xa726('0x3d'));_0xbf44ea=initGraph(_[_0xa726('0x24')](_0x39d9e8,_0xa726('0x25')),_0x39d9e8[_0xa726('0x25')]);_0x463504=new Vertices(_0x12126f,rpc,mailRpc);logger[_0xa726('0x16')](util[_0xa726('0x13')](_0xa726('0x3e'),_0x12126f[_0xa726('0x1c')],_0x12126f[_0xa726('0x17')],_0x12126f[_0xa726('0x18')],_0x12126f[_0xa726('0x19')],_0x12126f[_0xa726('0x1a')]));_0xbf44ea[_0xa726('0x3f')](_0x39d9e8['start']['id'],function(_0x34ad0d){try{_0x34ad0d=_0x463504[_0xa726('0x40')](_0x34ad0d);logger[_0xa726('0x33')]('vertex',JSON[_0xa726('0x35')](_0x34ad0d,null,0x2));if(_0x34ad0d['agicommand']===_0xa726('0x41')){logger[_0xa726('0x16')](_0xa726('0x42'));_0x12126f[_0xa726('0x43')]=_0x34ad0d[_0xa726('0x43')]||_0x12126f[_0xa726('0x43')];_0x12126f[_0xa726('0x44')]=_0x34ad0d['extension'];_0x12126f[_0xa726('0x45')]=_0x34ad0d[_0xa726('0x45')]?_0x34ad0d[_0xa726('0x45')]-0x1:0x1;return null;}else if(_0x34ad0d&&_0x463504[_0x34ad0d[_0xa726('0x20')]]){_0x1beb5d=_0x463504[_0x34ad0d[_0xa726('0x20')]](_0x34ad0d);logger['info'](_0xa726('0x46'),JSON[_0xa726('0x35')](_0x1beb5d,null,0x2));if(_0x1beb5d&&_0x1beb5d[_0xa726('0x47')]===AGI_CODE_SUCCESS&&_0x1beb5d[_0xa726('0x48')]!==AGI_RESULT_ERROR&&!_0x12126f[_0xa726('0x1e')]){logger[_0xa726('0x33')](_0xa726('0x46'),getLogFromObject(_0x1beb5d));return _[_0xa726('0x49')](_0x1beb5d[_0xa726('0x48')])?null:_0x1beb5d[_0xa726('0x48')][_0xa726('0x4a')]();}else{logger[_0xa726('0x12')](_0xa726('0x46'),getLogFromObject(_0x1beb5d));return null;}}else{logger['error'](_0xa726('0x4b'));return null;}}catch(_0x5e099e){logger[_0xa726('0x12')](_0x5e099e['stack']);return null;}});if(_0x39d9e8[_0xa726('0x4c')]){logger[_0xa726('0x16')](util['format'](_0xa726('0x4d'),_0x12126f[_0xa726('0x1c')],_0x12126f[_0xa726('0x17')],_0x12126f['callerid'],_0x12126f[_0xa726('0x19')],_0x12126f[_0xa726('0x1a')]));_0xbf44ea[_0xa726('0x3f')](_0x39d9e8[_0xa726('0x4c')]['id'],function(_0x1faeb1){try{_0x1faeb1=_0x463504[_0xa726('0x40')](_0x1faeb1);logger[_0xa726('0x33')]('vertex',JSON[_0xa726('0x35')](_0x1faeb1,null,0x2));if(_0x1faeb1&&_0x463504[_0x1faeb1[_0xa726('0x20')]]){_0x1beb5d=_0x463504[_0x1faeb1[_0xa726('0x20')]](_0x1faeb1);if(_0x1beb5d){logger[_0xa726('0x33')](_0xa726('0x46'),getLogFromObject(_0x1beb5d));return _['isUndefined'](_0x1beb5d[_0xa726('0x48')])?null:_0x1beb5d[_0xa726('0x48')][_0xa726('0x4a')]();}else{logger[_0xa726('0x12')](_0xa726('0x46'),getLogFromObject(_0x1beb5d));return null;}}else{logger[_0xa726('0x12')]('agicommand\x20not\x20found');return null;}}catch(_0x450a48){logger[_0xa726('0x12')](_0x450a48['stack']);return null;}});}logger[_0xa726('0x16')](util[_0xa726('0x13')](_0xa726('0x4e'),_0x12126f[_0xa726('0x1c')],_0x12126f[_0xa726('0x17')],_0x12126f[_0xa726('0x18')],_0x12126f[_0xa726('0x19')],_0x12126f[_0xa726('0x1a')]));logger[_0xa726('0x16')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x12126f[_0xa726('0x43')],_0x12126f[_0xa726('0x44')],parseInt(_0x12126f['priority'],0xa)+0x1));_0x12126f['continueAt'](_0x12126f['context'],_0x12126f['extension'],parseInt(_0x12126f['priority'],0xa)+0x1);_0x12126f['close']();}}else{logger[_0xa726('0x12')](util[_0xa726('0x13')](_0xa726('0x4f'),_0x12126f[_0xa726('0x1c')]));_0x12126f[_0xa726('0x50')](_0x12126f[_0xa726('0x43')],_0x12126f[_0xa726('0x44')],parseInt(_0x12126f['priority'],0xa)+0x1);_0x12126f[_0xa726('0x37')]();}}else{logger[_0xa726('0x12')](util[_0xa726('0x13')]('Project\x20%s\x20not\x20found',_0x12126f['arg_1']));_0x12126f[_0xa726('0x50')](_0x12126f[_0xa726('0x43')],_0x12126f[_0xa726('0x44')],parseInt(_0x12126f[_0xa726('0x45')],0xa)+0x1);_0x12126f['close']();}}function main(){var _0xd14787;return utilLicense[_0xa726('0x51')]()[_0xa726('0x2d')](function(_0x29b7e6){if(_0x29b7e6){if(_0x29b7e6[_0xa726('0x52')]){if(_0x29b7e6['callysquare']&&_0x29b7e6[_0xa726('0x53')]>0x0){logger[_0xa726('0x16')](util['format'](_0xa726('0x54'),_0x29b7e6['callysquare']));_0xd14787=_0x29b7e6[_0xa726('0x53')];}else{logger['info'](_0xa726('0x55'));}}else{logger[_0xa726('0x16')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xd14787=-0x1;}}})[_0xa726('0x2e')](function(_0x4abd8d){logger[_0xa726('0x12')](_0xa726('0x56'),_0x4abd8d['stack']);})[_0xa726('0x4c')](function(){var _0x44714d=require(_0xa726('0x57'))(config[_0xa726('0x5')][_0xa726('0xe')],config[_0xa726('0x5')]['ip'],_0xd14787);_0x44714d['on'](_0xa726('0x12'),errorHandler);_0x44714d['on'](_0xa726('0x58'),listeningHandler);_0x44714d['on'](_0xa726('0x59'),connectionHandler);_0x44714d['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xd98b=['production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','debug','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./rpc','./mailRpc','./graph','defaults','127.0.0.1','nextTick','error','stack','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[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','dnid','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','then','createSquareReport','catch','indexOf','agi_','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','hangup','sync'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xd98b,0xc9));var _0xbd98=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0xd98b[_0x2db667];return _0x83ff9;};'use strict';var parser=require(_0xbd98('0x0'));var _=require(_0xbd98('0x1'));var syncho=require(_0xbd98('0x2'));var util=require(_0xbd98('0x3'));var moment=require(_0xbd98('0x4'));var config=require(_0xbd98('0x5'));var logger=require(_0xbd98('0x6'))(_0xbd98('0x7'));var utilLicense=require('../../config/license/util');var rpc=require(_0xbd98('0x8'));var mailRpc=require(_0xbd98('0x9'));var Graph=require(_0xbd98('0xa'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xbd98('0xb')](config[_0xbd98('0x7')],{'ip':_0xbd98('0xc'),'port':0x11dd});function connectionHandler(_0x5cad8f){process[_0xbd98('0xd')](function(){syncho(function(){try{setChannelVariables(_0x5cad8f);agiHandler(_0x5cad8f);}catch(_0x8c1f25){logger[_0xbd98('0xe')](_0x8c1f25[_0xbd98('0xf')]);}});});}function listeningHandler(){console[_0xbd98('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi']['port']);logger[_0xbd98('0x11')](util[_0xbd98('0x12')](_0xbd98('0x13'),config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x2312aa){if(_0x2312aa&&_0x2312aa[_0xbd98('0x14')]&&_0x2312aa[_0xbd98('0x15')]){logger[_0xbd98('0xe')](util[_0xbd98('0x12')]('[%s]\x20%s',_0x2312aa[_0xbd98('0x14')],_0x2312aa[_0xbd98('0x15')]));}else{logger[_0xbd98('0xe')](util[_0xbd98('0x12')](_0xbd98('0x16'),_0x2312aa['stack']));}}function closeHandler(){logger[_0xbd98('0x11')](util[_0xbd98('0x12')](_0xbd98('0x17'),this[_0xbd98('0x18')],this[_0xbd98('0x19')],this[_0xbd98('0x1a')],this['dnid'],this[_0xbd98('0x1b')]));try{createSquareReport(this);}catch(_0x5f4de4){logger[_0xbd98('0xe')](_0x5f4de4[_0xbd98('0xf')]);}}function timeoutHandler(){logger[_0xbd98('0x11')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xbd98('0x18')],this[_0xbd98('0x19')],this[_0xbd98('0x1a')],this[_0xbd98('0x1c')],this[_0xbd98('0x1b')]));}function hangupHandler(){logger['info'](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xbd98('0x18')],this[_0xbd98('0x19')],this['callerid'],this[_0xbd98('0x1c')],this[_0xbd98('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x8d7ee9){return parser['toJson'](_0x8d7ee9,{'object':!![]})[_0xbd98('0x1d')][_0xbd98('0x1e')];}function addVertex(_0x3efa84,_0x5c718f,_0x73fa8b){_0x5c718f[_0xbd98('0x1f')]=_0x73fa8b;if(_0x5c718f[_0xbd98('0x20')](_0xbd98('0x21'))){_0x5c718f[_0xbd98('0x22')]=parseInt(_0x5c718f[_0xbd98('0x21')],0xa);}_0x3efa84[_0xbd98('0x23')](_[_0xbd98('0x24')](_0x5c718f,_0xbd98('0x25')));}function initGraph(_0x2e3309,_0x126844){var _0x2b376b=new Graph();for(var _0x189c50 in _0x2e3309){if(_0x2e3309['hasOwnProperty'](_0x189c50)){if(_['isArray'](_0x2e3309[_0x189c50])){for(var _0x488674=0x0;_0x488674<_0x2e3309[_0x189c50][_0xbd98('0x26')];_0x488674+=0x1){addVertex(_0x2b376b,_0x2e3309[_0x189c50][_0x488674],_0x189c50);}}else{addVertex(_0x2b376b,_0x2e3309[_0x189c50],_0x189c50);}}}for(var _0x536883=0x0;_0x536883<_0x126844[_0xbd98('0x26')];_0x536883+=0x1){if(_0x126844[_0x536883][_0xbd98('0x27')]&&_0x126844[_0x536883][_0xbd98('0x28')]){_0x2b376b[_0xbd98('0x29')](_0x126844[_0x536883][_0xbd98('0x27')],_0x126844[_0x536883]['target'],_0x126844[_0x536883]['value']);}}return _0x2b376b;}function getSquareProject(_0x1d39bb,_0x29602c){rpc['getSquareProject'](_0x1d39bb)[_0xbd98('0x2a')](function(_0x5ead6e){_0x29602c(null,_0x5ead6e);})['catch'](function(_0x36dcfd){_0x29602c(null,_0x36dcfd);});}function createSquareReport(_0xfba149,_0x271669){rpc[_0xbd98('0x2b')](_0xfba149)[_0xbd98('0x2a')](function(_0xc71fc7){if(_0x271669){_0x271669(null,_0xc71fc7);}})[_0xbd98('0x2c')](function(_0x5b1350){if(_0x271669){_0x271669(null,_0x5b1350);}});}function setChannelVariables(_0x47f2c1){for(var _0x2e4c33 in _0x47f2c1){if(_0x47f2c1[_0xbd98('0x20')](_0x2e4c33)){if(_0x2e4c33[_0xbd98('0x2d')](_0xbd98('0x2e'))===0x0){_0x47f2c1[_0x2e4c33[_0xbd98('0x2f')](0x4)]=_0x47f2c1[_0x2e4c33];delete _0x47f2c1[_0x2e4c33];}}}}function getLogFromObject(_0x28eee5){return util['inspect'](_0x28eee5,{'showHidden':![],'depth':null});}function agiHandler(_0x3d091c){var _0xfc02a0,_0x8a2a11,_0x3d46f0,_0x51cd00,_0x592756;logger['debug']('variables',JSON[_0xbd98('0x30')](_0x3d091c,null,0x2));logger[_0xbd98('0x11')](util[_0xbd98('0x12')](_0xbd98('0x31'),_0x3d091c[_0xbd98('0x18')],_0x3d091c[_0xbd98('0x19')],_0x3d091c[_0xbd98('0x1a')],_0x3d091c[_0xbd98('0x1c')],_0x3d091c[_0xbd98('0x1b')]));_0x3d091c['on'](_0xbd98('0xe'),errorHandler);_0x3d091c['on'](_0xbd98('0x32'),closeHandler);_0x3d091c['on']('timeout',timeoutHandler);_0x3d091c[_0xbd98('0x33')]=![];_0x3d091c['on'](_0xbd98('0x34'),hangupHandler);var _0x5d87a8=getSquareProject[_0xbd98('0x35')](null,_0x3d091c['arg_1']);if(_0x5d87a8){if(_0x5d87a8[_0xbd98('0x36')]){_0xfc02a0=getRoot(_0x5d87a8[_0xbd98('0x36')]);if(_0xfc02a0&&_0xfc02a0[_0xbd98('0x37')]){logger['debug'](_0xbd98('0x1e'),JSON['stringify'](_0xfc02a0,null,0x2));_0x3d091c[_0xbd98('0x38')]=moment()[_0xbd98('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x8a2a11=initGraph(_[_0xbd98('0x24')](_0xfc02a0,_0xbd98('0x25')),_0xfc02a0['mxCell']);_0x3d46f0=new Vertices(_0x3d091c,rpc,mailRpc);logger['info'](util[_0xbd98('0x12')](_0xbd98('0x39'),_0x3d091c['arg_1'],_0x3d091c[_0xbd98('0x19')],_0x3d091c[_0xbd98('0x1a')],_0x3d091c[_0xbd98('0x1c')],_0x3d091c['uniqueid']));_0x8a2a11['traverseBFS'](_0xfc02a0[_0xbd98('0x37')]['id'],function(_0x2d6daa){try{_0x2d6daa=_0x3d46f0[_0xbd98('0x3a')](_0x2d6daa);logger[_0xbd98('0x3b')](_0xbd98('0x3c'),JSON[_0xbd98('0x30')](_0x2d6daa,null,0x2));if(_0x2d6daa[_0xbd98('0x1f')]===_0xbd98('0x3d')){logger[_0xbd98('0x11')](_0xbd98('0x3e'));_0x3d091c[_0xbd98('0x3f')]=_0x2d6daa[_0xbd98('0x3f')]||_0x3d091c['context'];_0x3d091c[_0xbd98('0x40')]=_0x2d6daa[_0xbd98('0x40')];_0x3d091c['priority']=_0x2d6daa[_0xbd98('0x41')]?_0x2d6daa['priority']-0x1:0x1;return null;}else if(_0x2d6daa&&_0x3d46f0[_0x2d6daa[_0xbd98('0x1f')]]){_0x592756=_0x3d46f0[_0x2d6daa[_0xbd98('0x1f')]](_0x2d6daa);logger[_0xbd98('0x11')](_0xbd98('0x42'),JSON[_0xbd98('0x30')](_0x592756,null,0x2));if(_0x592756&&_0x592756[_0xbd98('0x43')]===AGI_CODE_SUCCESS&&_0x592756['result']!==AGI_RESULT_ERROR&&!_0x3d091c['evtHangup']){logger[_0xbd98('0x3b')](_0xbd98('0x42'),getLogFromObject(_0x592756));return _['isUndefined'](_0x592756[_0xbd98('0x44')])?null:_0x592756[_0xbd98('0x44')][_0xbd98('0x45')]();}else{logger[_0xbd98('0xe')](_0xbd98('0x42'),getLogFromObject(_0x592756));return null;}}else{logger[_0xbd98('0xe')](_0xbd98('0x46'));return null;}}catch(_0x36c673){logger['error'](_0x36c673[_0xbd98('0xf')]);return null;}});if(_0xfc02a0[_0xbd98('0x47')]){logger[_0xbd98('0x11')](util[_0xbd98('0x12')](_0xbd98('0x48'),_0x3d091c[_0xbd98('0x18')],_0x3d091c[_0xbd98('0x19')],_0x3d091c[_0xbd98('0x1a')],_0x3d091c[_0xbd98('0x1c')],_0x3d091c[_0xbd98('0x1b')]));_0x8a2a11['traverseBFS'](_0xfc02a0['finally']['id'],function(_0xf75984){try{_0xf75984=_0x3d46f0['clear'](_0xf75984);logger[_0xbd98('0x3b')]('vertex',JSON[_0xbd98('0x30')](_0xf75984,null,0x2));if(_0xf75984&&_0x3d46f0[_0xf75984['agicommand']]){_0x592756=_0x3d46f0[_0xf75984[_0xbd98('0x1f')]](_0xf75984);if(_0x592756){logger[_0xbd98('0x3b')]('response',getLogFromObject(_0x592756));return _[_0xbd98('0x49')](_0x592756[_0xbd98('0x44')])?null:_0x592756['result'][_0xbd98('0x45')]();}else{logger[_0xbd98('0xe')](_0xbd98('0x42'),getLogFromObject(_0x592756));return null;}}else{logger[_0xbd98('0xe')](_0xbd98('0x46'));return null;}}catch(_0x34e96e){logger[_0xbd98('0xe')](_0x34e96e[_0xbd98('0xf')]);return null;}});}logger['info'](util[_0xbd98('0x12')](_0xbd98('0x4a'),_0x3d091c[_0xbd98('0x18')],_0x3d091c[_0xbd98('0x19')],_0x3d091c[_0xbd98('0x1a')],_0x3d091c[_0xbd98('0x1c')],_0x3d091c[_0xbd98('0x1b')]));logger[_0xbd98('0x11')](util[_0xbd98('0x12')](_0xbd98('0x4b'),_0x3d091c['context'],_0x3d091c[_0xbd98('0x40')],parseInt(_0x3d091c[_0xbd98('0x41')],0xa)+0x1));_0x3d091c[_0xbd98('0x4c')](_0x3d091c[_0xbd98('0x3f')],_0x3d091c[_0xbd98('0x40')],parseInt(_0x3d091c['priority'],0xa)+0x1);_0x3d091c['close']();}}else{logger['error'](util[_0xbd98('0x12')](_0xbd98('0x4d'),_0x3d091c['arg_1']));_0x3d091c['continueAt'](_0x3d091c[_0xbd98('0x3f')],_0x3d091c[_0xbd98('0x40')],parseInt(_0x3d091c[_0xbd98('0x41')],0xa)+0x1);_0x3d091c[_0xbd98('0x32')]();}}else{logger['error'](util[_0xbd98('0x12')]('Project\x20%s\x20not\x20found',_0x3d091c[_0xbd98('0x18')]));_0x3d091c[_0xbd98('0x4c')](_0x3d091c[_0xbd98('0x3f')],_0x3d091c[_0xbd98('0x40')],parseInt(_0x3d091c[_0xbd98('0x41')],0xa)+0x1);_0x3d091c[_0xbd98('0x32')]();}}function main(){var _0xad100c;return utilLicense['getLicense']()[_0xbd98('0x2a')](function(_0x5b41de){if(_0x5b41de){if(_0x5b41de[_0xbd98('0x4e')]){if(_0x5b41de[_0xbd98('0x4f')]&&_0x5b41de[_0xbd98('0x4f')]>0x0){logger['info'](util['format'](_0xbd98('0x50'),_0x5b41de['callysquare']));_0xad100c=_0x5b41de['callysquare'];}else{logger[_0xbd98('0x11')](_0xbd98('0x51'));}}else{logger[_0xbd98('0x11')](_0xbd98('0x52'));_0xad100c=-0x1;}}})[_0xbd98('0x2c')](function(_0xfea97b){logger[_0xbd98('0xe')]('[LICENSE]',_0xfea97b['stack']);})[_0xbd98('0x47')](function(){var _0x211a4e=require('./server')(config[_0xbd98('0x7')]['port'],config['agi']['ip'],_0xad100c);_0x211a4e['on']('error',errorHandler);_0x211a4e['on'](_0xbd98('0x53'),listeningHandler);_0x211a4e['on'](_0xbd98('0x54'),connectionHandler);_0x211a4e['on'](_0xbd98('0x32'),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 224c535..f132cc2 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 _0xd2e9=['jayson/promise','client','http','request','error','message','catch','sendMailMessage','SendMail','bluebird'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xd2e9,0x15d));var _0x9d2e=function(_0x3d94df,_0x392e3a){_0x3d94df=_0x3d94df-0x0;var _0x3d9ce2=_0xd2e9[_0x3d94df];return _0x3d9ce2;};'use strict';var BPromise=require(_0x9d2e('0x0'));var jayson=require(_0x9d2e('0x1'));var client=jayson[_0x9d2e('0x2')][_0x9d2e('0x3')]({'port':0x232b});function request(_0x51a2c9,_0x4e3b73){return new BPromise(function(_0x3ff0d4,_0x225739){return client[_0x9d2e('0x4')](_0x51a2c9,_0x4e3b73)['then'](function(_0x4ea497){if(_0x4ea497[_0x9d2e('0x5')]){return _0x225739(_0x4ea497[_0x9d2e('0x5')][_0x9d2e('0x6')]);}else{return _0x3ff0d4(_0x4ea497['result']);}})[_0x9d2e('0x7')](function(_0x379680){return _0x225739(_0x379680);});});}exports[_0x9d2e('0x8')]=function(_0x5d3b81,_0xc7882b){return request(_0x9d2e('0x9'),{'account':_0x5d3b81,'message':_0xc7882b});}; \ No newline at end of file +var _0x63e3=['bluebird','jayson/promise','client','http','request','then','error','message','result','catch','SendMail'];(function(_0x2a4dc6,_0x156ef5){var _0x534dbb=function(_0x55f0d0){while(--_0x55f0d0){_0x2a4dc6['push'](_0x2a4dc6['shift']());}};_0x534dbb(++_0x156ef5);}(_0x63e3,0x160));var _0x363e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x63e3[_0xd1d19a];return _0x52a79d;};'use strict';var BPromise=require(_0x363e('0x0'));var jayson=require(_0x363e('0x1'));var client=jayson[_0x363e('0x2')][_0x363e('0x3')]({'port':0x232b});function request(_0x35eb66,_0x176e92){return new BPromise(function(_0x2224d4,_0x5c3b08){return client[_0x363e('0x4')](_0x35eb66,_0x176e92)[_0x363e('0x5')](function(_0x5d6112){if(_0x5d6112[_0x363e('0x6')]){return _0x5c3b08(_0x5d6112[_0x363e('0x6')][_0x363e('0x7')]);}else{return _0x2224d4(_0x5d6112[_0x363e('0x8')]);}})[_0x363e('0x9')](function(_0x38fdbb){return _0x5c3b08(_0x38fdbb);});});}exports['sendMailMessage']=function(_0x9216ea,_0x1a29a0){return request(_0x363e('0xa'),{'account':_0x9216ea,'message':_0x1a29a0});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index a992b7e..01ff51f 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 _0xae60=['_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','Transform','call','_localBuffer'];(function(_0x22afc9,_0xd3633a){var _0x50e77f=function(_0x249465){while(--_0x249465){_0x22afc9['push'](_0x22afc9['shift']());}};_0x50e77f(++_0xd3633a);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xae60[_0x4dc7b9];return _0x3ab114;};'use strict';var util=require(_0x0ae6('0x0'));var Transform=require(_0x0ae6('0x1'))[_0x0ae6('0x2')];function AGIReply(_0x52d7cd){Transform[_0x0ae6('0x3')](this,_0x52d7cd);this[_0x0ae6('0x4')]='';this[_0x0ae6('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x0ae6('0x6')][_0x0ae6('0x7')]=function(_0x47c9e0,_0xe0287b,_0x25ac7c){var _0x30e000='\x0a',_0x46fed4=['\x0a\x0a',_0x0ae6('0x8')],_0xbb596c=-0x1,_0x447a1d=-0x1,_0x120910='',_0x1b5e80=0x0,_0x4860f8='',_0x3b3fc3='';this[_0x0ae6('0x4')]+=_0x47c9e0[_0x0ae6('0x9')]();_0x4860f8=this['_localBuffer'];if(!this[_0x0ae6('0x5')]){_0x1b5e80=0x0;while(_0x46fed4[_0x1b5e80]){while((_0x447a1d=_0x4860f8[_0x0ae6('0xa')](_0x46fed4[_0x1b5e80]))!=-0x1){_0x120910=_0x46fed4[_0x1b5e80];_0x3b3fc3=_0x4860f8[_0x0ae6('0xb')](0x0,_0x447a1d);_0x4860f8=_0x4860f8[_0x0ae6('0xb')](_0x447a1d+_0x120910[_0x0ae6('0xc')]);var _0x144272=_0x3b3fc3[_0x0ae6('0xd')](_0x30e000),_0x13d5c1=0x0,_0x1473ea={},_0x3b05a4='',_0x30f8f9='',_0x1aefd5=-0x1;while(_0x144272[_0x13d5c1]){_0x1aefd5=_0x144272[_0x13d5c1][_0x0ae6('0xa')](':');if(_0x1aefd5!=-0x1){_0x3b05a4=_0x144272[_0x13d5c1][_0x0ae6('0xe')](0x0,_0x1aefd5)['trim']();_0x30f8f9=_0x144272[_0x13d5c1][_0x0ae6('0xe')](_0x1aefd5+0x1)[_0x0ae6('0xf')]();if(_0x3b05a4[_0x0ae6('0xc')]>0x0){_0x1473ea[_0x3b05a4]=_0x30f8f9;}}else{}_0x13d5c1++;}this[_0x0ae6('0x10')](_0x0ae6('0x11'),_0x1473ea);this[_0x0ae6('0x5')]=!![];}_0x1b5e80++;}this[_0x0ae6('0x4')]=_0x4860f8;}else{while((_0xbb596c=_0x4860f8[_0x0ae6('0xa')](_0x30e000))!=-0x1){_0x3b3fc3=_0x4860f8[_0x0ae6('0xb')](0x0,_0xbb596c);this[_0x0ae6('0x10')](_0x0ae6('0x12'),_0x3b3fc3);_0x4860f8=_0x4860f8[_0x0ae6('0xb')](_0xbb596c+_0x30e000[_0x0ae6('0xc')]);}this[_0x0ae6('0x4')]=_0x4860f8;}_0x25ac7c();};module[_0x0ae6('0x13')]=AGIReply; \ No newline at end of file +var _0x4266=['prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','line','util','stream','Transform','call','_localBuffer','_inBody','inherits'];(function(_0x2c1758,_0x29edf8){var _0xcf08b3=function(_0x568a26){while(--_0x568a26){_0x2c1758['push'](_0x2c1758['shift']());}};_0xcf08b3(++_0x29edf8);}(_0x4266,0xa4));var _0x6426=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4266[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0x6426('0x0'));var Transform=require(_0x6426('0x1'))[_0x6426('0x2')];function AGIReply(_0x3a6dc9){Transform[_0x6426('0x3')](this,_0x3a6dc9);this[_0x6426('0x4')]='';this[_0x6426('0x5')]=![];}util[_0x6426('0x6')](AGIReply,Transform);AGIReply[_0x6426('0x7')][_0x6426('0x8')]=function(_0x271966,_0x19a733,_0x392929){var _0x52741a='\x0a',_0x32a8fc=['\x0a\x0a',_0x6426('0x9')],_0x55dcd2=-0x1,_0x58fb5c=-0x1,_0x4219f8='',_0x18acec=0x0,_0x15b6cd='',_0x5b2b20='';this[_0x6426('0x4')]+=_0x271966[_0x6426('0xa')]();_0x15b6cd=this[_0x6426('0x4')];if(!this['_inBody']){_0x18acec=0x0;while(_0x32a8fc[_0x18acec]){while((_0x58fb5c=_0x15b6cd[_0x6426('0xb')](_0x32a8fc[_0x18acec]))!=-0x1){_0x4219f8=_0x32a8fc[_0x18acec];_0x5b2b20=_0x15b6cd['substring'](0x0,_0x58fb5c);_0x15b6cd=_0x15b6cd[_0x6426('0xc')](_0x58fb5c+_0x4219f8[_0x6426('0xd')]);var _0xbd9c9f=_0x5b2b20[_0x6426('0xe')](_0x52741a),_0x2ceae0=0x0,_0x4aecff={},_0x274885='',_0x8feb60='',_0x5142e5=-0x1;while(_0xbd9c9f[_0x2ceae0]){_0x5142e5=_0xbd9c9f[_0x2ceae0][_0x6426('0xb')](':');if(_0x5142e5!=-0x1){_0x274885=_0xbd9c9f[_0x2ceae0][_0x6426('0xf')](0x0,_0x5142e5)[_0x6426('0x10')]();_0x8feb60=_0xbd9c9f[_0x2ceae0]['slice'](_0x5142e5+0x1)[_0x6426('0x10')]();if(_0x274885[_0x6426('0xd')]>0x0){_0x4aecff[_0x274885]=_0x8feb60;}}else{}_0x2ceae0++;}this['emit']('headers',_0x4aecff);this[_0x6426('0x5')]=!![];}_0x18acec++;}this[_0x6426('0x4')]=_0x15b6cd;}else{while((_0x55dcd2=_0x15b6cd[_0x6426('0xb')](_0x52741a))!=-0x1){_0x5b2b20=_0x15b6cd[_0x6426('0xc')](0x0,_0x55dcd2);this[_0x6426('0x11')](_0x6426('0x12'),_0x5b2b20);_0x15b6cd=_0x15b6cd[_0x6426('0xc')](_0x55dcd2+_0x52741a[_0x6426('0xd')]);}this['_localBuffer']=_0x15b6cd;}_0x392929();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index c4d5369..6fde825 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 _0xde61=['getUserById','ShowUser','getContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','then','error','message','result','catch','getSquareProjects','production','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','name','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn'];(function(_0x332935,_0x25b2e5){var _0x2a1052=function(_0xedc916){while(--_0xedc916){_0x332935['push'](_0x332935['shift']());}};_0x2a1052(++_0x25b2e5);}(_0xde61,0x9c));var _0x1de6=function(_0x46acc0,_0xcf2f9d){_0x46acc0=_0x46acc0-0x0;var _0xbe272a=_0xde61[_0x46acc0];return _0xbe272a;};'use strict';var BPromise=require(_0x1de6('0x0'));var moment=require(_0x1de6('0x1'));var _=require('lodash');var util=require(_0x1de6('0x2'));var jayson=require(_0x1de6('0x3'));var client=jayson['client']['http']({'port':0x2329});function request(_0x4019ca,_0x2d399f){return new BPromise(function(_0x57707c,_0x50ebae){return client['request'](_0x4019ca,_0x2d399f)[_0x1de6('0x4')](function(_0x2e52c4){if(_0x2e52c4[_0x1de6('0x5')]){return _0x50ebae(_0x2e52c4[_0x1de6('0x5')][_0x1de6('0x6')]);}else{return _0x57707c(_0x2e52c4[_0x1de6('0x7')]);}})[_0x1de6('0x8')](function(_0x19b5d6){return _0x50ebae(_0x19b5d6);});});}exports[_0x1de6('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x1de6('0xa')]}});};exports['getSquareProject']=function(_0x2c5e74){return request(_0x1de6('0xb'),{'options':{'raw':![],'where':{'name':_0x2c5e74},'attributes':['production']}});};exports[_0x1de6('0xc')]=function(_0xfb3b9a){return request(_0x1de6('0xd'),{'options':{'raw':![],'where':{'id':_0xfb3b9a},'include':[{'model':_0x1de6('0xe'),'as':'Smtp','include':[{'model':_0x1de6('0xf'),'as':_0x1de6('0xf')}]}],'attributes':['id',_0x1de6('0x10'),_0x1de6('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x5b3df0){return request(_0x1de6('0xb'),{'options':{'where':{'id':_0x5b3df0},'attributes':[_0x1de6('0x10')]}});};exports['getVoiceQueueById']=function(_0x3d783d){return request(_0x1de6('0x12'),{'options':{'where':{'id':_0x3d783d},'attributes':[_0x1de6('0x10')]}});};exports[_0x1de6('0x13')]=function(_0x530c87){return request(_0x1de6('0x14'),{'options':{'where':{'id':_0x530c87},'attributes':[_0x1de6('0x10')]}});};exports[_0x1de6('0x15')]=function(_0x1eee69){return request(_0x1de6('0x16'),{'options':{'where':{'id':_0x1eee69},'attributes':[_0x1de6('0x17')]}});};exports[_0x1de6('0x18')]=function(_0x52b90f){return request(_0x1de6('0x19'),{'options':{'where':{'id':_0x52b90f},'attributes':['name']}});};exports[_0x1de6('0x1a')]=function(_0x3b36d2){return request('GetContactByPhone',{'options':{'where':{'phone':_0x3b36d2['phone']},'attributes':['id']}});};exports[_0x1de6('0x1b')]=function(_0x105779){return request(_0x1de6('0x1c'),{'options':{'where':{'id':_0x105779},'attributes':[_0x1de6('0x10')]}});};exports[_0x1de6('0x1d')]=function(_0x1a984f){return request(_0x1de6('0x1e'),{'options':{'where':{'id':_0x1a984f},'attributes':['save_name']}});};exports[_0x1de6('0x1f')]=function(_0x539381){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x539381},'include':[{'model':_0x1de6('0x20'),'as':_0x1de6('0x21')}]}});};exports[_0x1de6('0x22')]=function(_0x5da5e9){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5da5e9},'attributes':['id','name']}});};exports[_0x1de6('0x23')]=function(_0x57ca1d){return request('CreateSmsMessage',{'body':_0x57ca1d});};exports[_0x1de6('0x24')]=function(_0x8aeac2){return request(_0x1de6('0x25'),{'body':_0x8aeac2});};exports[_0x1de6('0x26')]=function(_0x1cff02){return request(_0x1de6('0x27'),{'body':_['merge'](_0x1cff02,{'project_name':_0x1cff02[_0x1de6('0x28')],'prev_project_name':_0x1cff02[_0x1de6('0x29')]||'','is_subproject':_0x1cff02[_0x1de6('0x29')]?!![]:![],'leaveAt':moment()[_0x1de6('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x1de6('0x2b')]=function(_0x2b8570){return request(_0x1de6('0x2c'),{'body':_0x2b8570});};exports['createSquareMessage']=function(_0x343c6c){return request(_0x1de6('0x2d'),{'body':_0x343c6c});};exports[_0x1de6('0x2e')]=function(_0x21fa79){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x21fa79[_0x1de6('0x2f')],'ListId':_0x21fa79[_0x1de6('0x30')]}}})[_0x1de6('0x4')](function(_0x29d09c){if(_0x29d09c){return _0x29d09c;}return request(_0x1de6('0x31'),{'body':_0x21fa79});});};exports[_0x1de6('0x32')]=function(_0x326912){return request(_0x1de6('0x33'),{'options':{'where':{'id':_0x326912},'attributes':['name']}});};exports[_0x1de6('0x34')]=function(_0x4ea047,_0x35cd8e){return request(_0x1de6('0x35'),{'body':{'interface':_0x35cd8e},'options':{'where':_0x4ea047}});};exports[_0x1de6('0x36')]=function(_0xc744d1,_0x21d42b,_0xc881a){return request(_0x1de6('0x37'),{'body':{'type':_0x21d42b,'uniqueid':_0xc881a},'options':{'where':_0xc744d1}});};exports[_0x1de6('0x38')]=function(_0x5ee754){return request(_0x1de6('0x39'),{'body':{},'options':{'where':_0x5ee754}});};exports[_0x1de6('0x3a')]=function(_0x166589){return request(_0x1de6('0x3b'),{'body':{},'options':{'where':_0x166589}});}; \ No newline at end of file +var _0xe798=['createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','ShowSquareOdbc','getContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xe798,0x174));var _0x8e79=function(_0x3c2799,_0x579f00){_0x3c2799=_0x3c2799-0x0;var _0x95f73a=_0xe798[_0x3c2799];return _0x95f73a;};'use strict';var BPromise=require(_0x8e79('0x0'));var moment=require(_0x8e79('0x1'));var _=require(_0x8e79('0x2'));var util=require(_0x8e79('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x8e79('0x4')][_0x8e79('0x5')]({'port':0x2329});function request(_0xbc27fd,_0x16a00c){return new BPromise(function(_0x299556,_0x4a0fe8){return client[_0x8e79('0x6')](_0xbc27fd,_0x16a00c)[_0x8e79('0x7')](function(_0x4712aa){if(_0x4712aa[_0x8e79('0x8')]){return _0x4a0fe8(_0x4712aa[_0x8e79('0x8')][_0x8e79('0x9')]);}else{return _0x299556(_0x4712aa[_0x8e79('0xa')]);}})[_0x8e79('0xb')](function(_0x4fc5b3){return _0x4a0fe8(_0x4fc5b3);});});}exports[_0x8e79('0xc')]=function(){return request(_0x8e79('0xd'),{'options':{'raw':![],'attributes':['id',_0x8e79('0xe'),'production']}});};exports[_0x8e79('0xf')]=function(_0x5ecdfe){return request(_0x8e79('0x10'),{'options':{'raw':![],'where':{'name':_0x5ecdfe},'attributes':[_0x8e79('0x11')]}});};exports[_0x8e79('0x12')]=function(_0x5e2c09){return request(_0x8e79('0x13'),{'options':{'raw':![],'where':{'id':_0x5e2c09},'include':[{'model':_0x8e79('0x14'),'as':_0x8e79('0x15'),'include':[{'model':_0x8e79('0x16'),'as':'CloudProvider'}]}],'attributes':['id',_0x8e79('0xe'),_0x8e79('0x17')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x1b4354){return request(_0x8e79('0x10'),{'options':{'where':{'id':_0x1b4354},'attributes':[_0x8e79('0xe')]}});};exports[_0x8e79('0x18')]=function(_0x3dca3c){return request(_0x8e79('0x19'),{'options':{'where':{'id':_0x3dca3c},'attributes':[_0x8e79('0xe')]}});};exports['getVariableById']=function(_0x171a8f){return request('ShowVariable',{'options':{'where':{'id':_0x171a8f},'attributes':[_0x8e79('0xe')]}});};exports['getSquareOdbcById']=function(_0x28c166){return request(_0x8e79('0x1a'),{'options':{'where':{'id':_0x28c166},'attributes':['dsn']}});};exports['getUserById']=function(_0x171bfa){return request('ShowUser',{'options':{'where':{'id':_0x171bfa},'attributes':['name']}});};exports[_0x8e79('0x1b')]=function(_0x34a2a8){return request('GetContactByPhone',{'options':{'where':{'phone':_0x34a2a8[_0x8e79('0x1c')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x420d4c){return request(_0x8e79('0x1d'),{'options':{'where':{'id':_0x420d4c},'attributes':[_0x8e79('0xe')]}});};exports[_0x8e79('0x1e')]=function(_0xd926bf){return request(_0x8e79('0x1f'),{'options':{'where':{'id':_0xd926bf},'attributes':[_0x8e79('0x20')]}});};exports[_0x8e79('0x21')]=function(_0x2804a6){return request(_0x8e79('0x22'),{'options':{'raw':![],'where':{'id':_0x2804a6},'include':[{'model':'Interval','as':_0x8e79('0x23')}]}});};exports['getSmsAccountById']=function(_0x42c994){return request(_0x8e79('0x24'),{'options':{'where':{'id':_0x42c994},'attributes':['id',_0x8e79('0xe')]}});};exports['createSmsMessage']=function(_0x40682f){return request(_0x8e79('0x25'),{'body':_0x40682f});};exports[_0x8e79('0x26')]=function(_0x12cfe5){return request(_0x8e79('0x27'),{'body':_0x12cfe5});};exports[_0x8e79('0x28')]=function(_0x472cf4){return request(_0x8e79('0x29'),{'body':_['merge'](_0x472cf4,{'project_name':_0x472cf4['arg_1'],'prev_project_name':_0x472cf4[_0x8e79('0x2a')]||'','is_subproject':_0x472cf4[_0x8e79('0x2a')]?!![]:![],'leaveAt':moment()[_0x8e79('0x2b')](_0x8e79('0x2c'))})});};exports[_0x8e79('0x2d')]=function(_0x2d7762){return request('CreateSquareRecording',{'body':_0x2d7762});};exports[_0x8e79('0x2e')]=function(_0x55062c){return request(_0x8e79('0x2f'),{'body':_0x55062c});};exports[_0x8e79('0x30')]=function(_0x389d11){return request(_0x8e79('0x31'),{'options':{'raw':![],'where':{'phone':_0x389d11[_0x8e79('0x1c')],'ListId':_0x389d11[_0x8e79('0x32')]}}})[_0x8e79('0x7')](function(_0x45e453){if(_0x45e453){return _0x45e453;}return request('CreateCmContact',{'body':_0x389d11});});};exports[_0x8e79('0x33')]=function(_0xff33cc){return request(_0x8e79('0x34'),{'options':{'where':{'id':_0xff33cc},'attributes':[_0x8e79('0xe')]}});};exports[_0x8e79('0x35')]=function(_0x29685b,_0x5f4d43){return request(_0x8e79('0x36'),{'body':{'interface':_0x5f4d43},'options':{'where':_0x29685b}});};exports[_0x8e79('0x37')]=function(_0x265795,_0x26288d,_0x3b370e){return request('PauseUser',{'body':{'type':_0x26288d,'uniqueid':_0x3b370e},'options':{'where':_0x265795}});};exports[_0x8e79('0x38')]=function(_0x25be00){return request(_0x8e79('0x39'),{'body':{},'options':{'where':_0x25be00}});};exports[_0x8e79('0x3a')]=function(_0x323c79){return request(_0x8e79('0x3b'),{'body':{},'options':{'where':_0x323c79}});}; \ 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 1351828..0f41181 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 _0xbf25=['./polly','exports'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xbf25,0x15e));var _0x5bf2=function(_0x18e6a8,_0x8799e9){_0x18e6a8=_0x18e6a8-0x0;var _0x19eb36=_0xbf25[_0x18e6a8];return _0x19eb36;};var polly=require(_0x5bf2('0x0'));var lex=require('./lex');module[_0x5bf2('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xe75a=['./polly','./lex'];(function(_0x2aa36a,_0x244215){var _0x3d4a16=function(_0x234b19){while(--_0x234b19){_0x2aa36a['push'](_0x2aa36a['shift']());}};_0x3d4a16(++_0x244215);}(_0xe75a,0x1de));var _0xae75=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xe75a[_0x2e4aa2];return _0x5e6092;};var polly=require(_0xae75('0x0'));var lex=require(_0xae75('0x1'));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 b8fff46..abcbc85 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 _0x6f7a=['./lib/api','exports'];(function(_0x55124a,_0x26e5f1){var _0xb0beb1=function(_0x74efcb){while(--_0x74efcb){_0x55124a['push'](_0x55124a['shift']());}};_0xb0beb1(++_0x26e5f1);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5c5b69,_0x281ff3){_0x5c5b69=_0x5c5b69-0x0;var _0x2dd58c=_0x6f7a[_0x5c5b69];return _0x2dd58c;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x1ffbbf,_0x18bf2d,_0x26844b,_0x1ba0bb,_0x455700,_0x2ad237){return lex(_0x1ffbbf,_0x18bf2d,_0x26844b,_0x1ba0bb,_0x455700,_0x2ad237);}; \ 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 7a3825e..8810470 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(_0xd5596a,_0x21b3af){var _0x4cd4ff=function(_0x404a66){while(--_0x404a66){_0xd5596a['push'](_0xd5596a['shift']());}};_0x4cd4ff(++_0x21b3af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x45ad93,_0x4e96b6){var _0x5c0cc5=function(_0x326f17){while(--_0x326f17){_0x45ad93['push'](_0x45ad93['shift']());}};_0x5c0cc5(++_0x4e96b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 0257633..ee1e738 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 _0xe74f=['exports','./lib/api'];(function(_0xd66d3a,_0x544c32){var _0x1a513f=function(_0x121b17){while(--_0x121b17){_0xd66d3a['push'](_0xd66d3a['shift']());}};_0x1a513f(++_0x544c32);}(_0xe74f,0xb1));var _0xfe74=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xe74f[_0x1c9c24];return _0x349c69;};'use strict';var polly=require(_0xfe74('0x0'));module[_0xfe74('0x1')]=function(_0x56be2e,_0x4b129c,_0x13e05a,_0x3077ae,_0x5b52fd,_0x1c18b8,_0x1b1684){return polly(_0x56be2e,_0x4b129c,_0x13e05a,_0x3077ae,_0x5b52fd,_0x1c18b8,_0x1b1684);}; \ No newline at end of file +var _0xe5e4=['exports'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0xe5e4,0x1b2));var _0x4e5e=function(_0x183d49,_0x1f713e){_0x183d49=_0x183d49-0x0;var _0x2ee2c7=_0xe5e4[_0x183d49];return _0x2ee2c7;};'use strict';var polly=require('./lib/api');module[_0x4e5e('0x0')]=function(_0x4cdaca,_0x3dafa1,_0x305590,_0x7191bf,_0x33723a,_0x1df7bc,_0x5e05d5){return polly(_0x4cdaca,_0x3dafa1,_0x305590,_0x7191bf,_0x33723a,_0x1df7bc,_0x5e05d5);}; \ 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 3d81527..0aa7aa7 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 _0x7ffc=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path'];(function(_0xa8f821,_0x54cfad){var _0x1d2d48=function(_0x3a5a75){while(--_0x3a5a75){_0xa8f821['push'](_0xa8f821['shift']());}};_0x1d2d48(++_0x54cfad);}(_0x7ffc,0x1df));var _0xc7ff=function(_0x5e7979,_0x4175c0){_0x5e7979=_0x5e7979-0x0;var _0x50f569=_0x7ffc[_0x5e7979];return _0x50f569;};'use strict';var fs=require('fs');var path=require(_0xc7ff('0x0'));var BPromise=require('bluebird');var rs=require(_0xc7ff('0x1'));var AWS=require(_0xc7ff('0x2'));function pollyResult(_0x7228f0,_0x4f7e2c,_0x16643f){return new BPromise(function(_0x42e08a,_0x24129b){_0x7228f0[_0xc7ff('0x3')](_0x4f7e2c,function(_0x533b91,_0x3be533){if(_0x533b91){_0x24129b(_0x533b91);}else if(_0x3be533){if(_0x3be533[_0xc7ff('0x4')]instanceof Buffer){fs['writeFile'](_0x16643f,_0x3be533[_0xc7ff('0x4')],function(_0x163141){if(_0x163141){_0x24129b(_0x163141);}else{_0x42e08a();}});}else{_0x24129b(new Error(_0xc7ff('0x5')));}}else{_0x24129b(new Error(_0xc7ff('0x6')));}});});}module[_0xc7ff('0x7')]=function(_0x22592d,_0x5b8fc1,_0x4a652f,_0x332c5c,_0xf70ebb,_0x2922e1,_0x86359){var _0x50fcda=new AWS[(_0xc7ff('0x8'))]({'accessKeyId':_0x22592d,'secretAccessKey':_0x5b8fc1,'region':_0x4a652f});var _0x1f91d6={'Text':_0xf70ebb,'TextType':_0x2922e1||'text','OutputFormat':_0xc7ff('0x9'),'VoiceId':_0x332c5c};return pollyResult(_0x50fcda,_0x1f91d6,_0x86359);}; \ No newline at end of file +var _0x8efe=['Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x8efe,0x13b));var _0xe8ef=function(_0x1e0919,_0x350959){_0x1e0919=_0x1e0919-0x0;var _0x44dac5=_0x8efe[_0x1e0919];return _0x44dac5;};'use strict';var fs=require('fs');var path=require(_0xe8ef('0x0'));var BPromise=require(_0xe8ef('0x1'));var rs=require(_0xe8ef('0x2'));var AWS=require(_0xe8ef('0x3'));function pollyResult(_0x515831,_0x12d53,_0x297c04){return new BPromise(function(_0x2f0844,_0x374eb3){_0x515831[_0xe8ef('0x4')](_0x12d53,function(_0x15a278,_0x3e277b){if(_0x15a278){_0x374eb3(_0x15a278);}else if(_0x3e277b){if(_0x3e277b[_0xe8ef('0x5')]instanceof Buffer){fs[_0xe8ef('0x6')](_0x297c04,_0x3e277b[_0xe8ef('0x5')],function(_0x2483ea){if(_0x2483ea){_0x374eb3(_0x2483ea);}else{_0x2f0844();}});}else{_0x374eb3(new Error(_0xe8ef('0x7')));}}else{_0x374eb3(new Error(_0xe8ef('0x8')));}});});}module[_0xe8ef('0x9')]=function(_0x59b90e,_0x3a7e84,_0x44e14f,_0x2f8714,_0x5022e8,_0x3a556f,_0x300475){var _0xecd577=new AWS[(_0xe8ef('0xa'))]({'accessKeyId':_0x59b90e,'secretAccessKey':_0x3a7e84,'region':_0x44e14f});var _0x4bbce1={'Text':_0x5022e8,'TextType':_0x3a556f||_0xe8ef('0xb'),'OutputFormat':_0xe8ef('0xc'),'VoiceId':_0x2f8714};return pollyResult(_0xecd577,_0x4bbce1,_0x300475);}; \ 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 024d987..9e23827 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 _0xc7ed=['./lib/api','exports'];(function(_0x1f0ca6,_0x3a7cfc){var _0x51fc6e=function(_0x1ab976){while(--_0x1ab976){_0x1f0ca6['push'](_0x1f0ca6['shift']());}};_0x51fc6e(++_0x3a7cfc);}(_0xc7ed,0xdc));var _0xdc7e=function(_0x7033ad,_0x4f191a){_0x7033ad=_0x7033ad-0x0;var _0x4117fb=_0xc7ed[_0x7033ad];return _0x4117fb;};'use strict';var asr=require(_0xdc7e('0x0'));module[_0xdc7e('0x1')]=function(_0x1c3258,_0x4024ff,_0xdc9af6,_0x1cb887){return asr(_0x1c3258,_0x4024ff,_0xdc9af6);}; \ No newline at end of file +var _0xef2f=['./lib/api','exports'];(function(_0x3a54d4,_0x84842e){var _0x18be71=function(_0x48f3f1){while(--_0x48f3f1){_0x3a54d4['push'](_0x3a54d4['shift']());}};_0x18be71(++_0x84842e);}(_0xef2f,0x18e));var _0xfef2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xef2f[_0x618414];return _0x21c19a;};'use strict';var asr=require(_0xfef2('0x0'));module[_0xfef2('0x1')]=function(_0x4252a2,_0x3443dd,_0x493f2e,_0x3ddb2e){return asr(_0x4252a2,_0x3443dd,_0x493f2e);}; \ 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 17d9a0a..c3cb964 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 _0x80df=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird'];(function(_0x327a7c,_0x1112d0){var _0x1866a1=function(_0xada274){while(--_0xada274){_0x327a7c['push'](_0x327a7c['shift']());}};_0x1866a1(++_0x1112d0);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var url=require(_0xf80d('0x0'));var BPromise=require(_0xf80d('0x1'));var fs=require('fs');var host=_0xf80d('0x2');module[_0xf80d('0x3')]=function(_0x5390c8,_0x3aee0a,_0x216488){return new BPromise(function(_0xfd239e,_0x21365c){var _0x15d302;if(typeof _0x5390c8!==_0xf80d('0x4')||_0x5390c8[_0xf80d('0x5')]===0x0){return _0x21365c(_0xf80d('0x6'));}if(typeof _0x3aee0a!==_0xf80d('0x4')||_0x3aee0a[_0xf80d('0x5')]===0x0){return _0x21365c('key\x20should\x20be\x20a\x20string');}if(typeof _0x216488!==_0xf80d('0x7')&&(typeof _0x216488!==_0xf80d('0x4')||_0x216488[_0xf80d('0x5')]===0x0)){return _0x21365c(_0xf80d('0x8'));}try{_0x15d302=fs[_0xf80d('0x9')](_0x5390c8)[_0xf80d('0xa')](_0xf80d('0xb'));}catch(_0x45d290){return _0x21365c(_0x45d290);}return _0xfd239e({'method':_0xf80d('0xc'),'uri':host+_0xf80d('0xd')+_0x3aee0a,'body':{'config':{'encoding':_0xf80d('0xe'),'sampleRateHertz':_0xf80d('0xf'),'languageCode':_0x216488},'audio':{'content':_0x15d302}},'json':!![]});});}; \ No newline at end of file +var _0xa4db=['8000','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x2707c1,_0x14af1c){var _0x4b5892=function(_0x2fc789){while(--_0x2fc789){_0x2707c1['push'](_0x2707c1['shift']());}};_0x4b5892(++_0x14af1c);}(_0xa4db,0x139));var _0xba4d=function(_0x1138c7,_0x516f2d){_0x1138c7=_0x1138c7-0x0;var _0xabe0d7=_0xa4db[_0x1138c7];return _0xabe0d7;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xba4d('0x0')]=function(_0x46aae0,_0x22432c,_0x1f3b60){return new BPromise(function(_0x32ad53,_0x158edc){var _0x5870ff;if(typeof _0x46aae0!==_0xba4d('0x1')||_0x46aae0['length']===0x0){return _0x158edc(_0xba4d('0x2'));}if(typeof _0x22432c!==_0xba4d('0x1')||_0x22432c[_0xba4d('0x3')]===0x0){return _0x158edc(_0xba4d('0x4'));}if(typeof _0x1f3b60!==_0xba4d('0x5')&&(typeof _0x1f3b60!==_0xba4d('0x1')||_0x1f3b60[_0xba4d('0x3')]===0x0)){return _0x158edc(_0xba4d('0x6'));}try{_0x5870ff=fs[_0xba4d('0x7')](_0x46aae0)['toString'](_0xba4d('0x8'));}catch(_0x1675a8){return _0x158edc(_0x1675a8);}return _0x32ad53({'method':_0xba4d('0x9'),'uri':host+_0xba4d('0xa')+_0x22432c,'body':{'config':{'encoding':_0xba4d('0xb'),'sampleRateHertz':_0xba4d('0xc'),'languageCode':_0x1f3b60},'audio':{'content':_0x5870ff}},'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 84c6d24..f87d468 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 _0xa088=['./asr','exports'];(function(_0x573ce9,_0x19f195){var _0x179ffa=function(_0x30523e){while(--_0x30523e){_0x573ce9['push'](_0x573ce9['shift']());}};_0x179ffa(++_0x19f195);}(_0xa088,0x146));var _0x8a08=function(_0x945151,_0x54645f){_0x945151=_0x945151-0x0;var _0x2532f2=_0xa088[_0x945151];return _0x2532f2;};var asr=require(_0x8a08('0x0'));module[_0x8a08('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf4a7=['./asr','exports'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0xf4a7,0xbc));var _0x7f4a=function(_0x135054,_0x47c78e){_0x135054=_0x135054-0x0;var _0x28cfea=_0xf4a7[_0x135054];return _0x28cfea;};var asr=require(_0x7f4a('0x0'));module[_0x7f4a('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 f4e581c..b55035a 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 _0x05b3=['join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','result','resolvedQuery','action','fulfillment','speech','score','status','metadata','isFallbackIntent','SessionsClient','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','parse','sestekNDA','nda','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','md5','path','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','createWriteStream','finish','finish\x20download\x20file','close','pipe','request\x20to\x20','statusMessage','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','info','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','uri','results','alternatives','transcript'];(function(_0xb9e2bc,_0x1bb304){var _0x5cddae=function(_0x6a282e){while(--_0x6a282e){_0xb9e2bc['push'](_0xb9e2bc['shift']());}};_0x5cddae(++_0x1bb304);}(_0x05b3,0x1ae));var _0x305b=function(_0x3bc298,_0x583d14){_0x3bc298=_0x3bc298-0x0;var _0x31bf58=_0x05b3[_0x3bc298];return _0x31bf58;};'use strict';var apiai=require(_0x305b('0x0'));var BPromise=require(_0x305b('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x305b('0x2'));var https=require('https');var md5=require(_0x305b('0x3'));var path=require(_0x305b('0x4'));var querystring=require('querystring');var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x305b('0x5'));var tts=require(_0x305b('0x6'));var urlParse=require(_0x305b('0x7'))['parse'];var util=require(_0x305b('0x8'));var aws=require(_0x305b('0x9'));var google=require(_0x305b('0xa'));var sestek=require(_0x305b('0xb'));var tilde=require(_0x305b('0xc'));var logger=require('../../../config/logger')(_0x305b('0xd'));var ISPEECH_API=_0x305b('0xe');function downloadFile(_0x9966ca,_0xab143b){return new BPromise(function(_0x5b53ee,_0x463890){var _0x1ad88a=urlParse(_0x9966ca);var _0x5b13db=_0x1ad88a[_0x305b('0xf')]===_0x305b('0x10')?https:http;var _0x38cddf={'host':_0x1ad88a[_0x305b('0x11')],'path':_0x1ad88a[_0x305b('0x4')],'headers':{'user-agent':_0x305b('0x12')}};_0x5b13db[_0x305b('0x13')](_0x38cddf,function(_0x29b92c){if(_0x29b92c[_0x305b('0x14')]!==0xc8){logger[_0x305b('0x15')]('request\x20to\x20'+_0x9966ca+'\x20failed,\x20status\x20code\x20=\x20'+_0x29b92c[_0x305b('0x14')]+'\x20('+_0x29b92c['statusMessage']+')');_0x463890(new Error('request\x20to\x20'+_0x9966ca+'\x20failed,\x20status\x20code\x20=\x20'+_0x29b92c[_0x305b('0x14')]+'\x20('+_0x29b92c['statusMessage']+')'));return;}var _0x295d79=fs[_0x305b('0x16')](_0xab143b);_0x295d79['on'](_0x305b('0x17'),function(){logger['info'](_0x305b('0x18'));_0x295d79[_0x305b('0x19')](_0x5b53ee);});_0x295d79['on'](_0x305b('0x15'),function(_0x13998c){fs['unlink'](_0xab143b);logger[_0x305b('0x15')]('download\x20error',_0x13998c);_0x463890(_0x13998c);});_0x29b92c[_0x305b('0x1a')](_0x295d79);})['on'](_0x305b('0x15'),function(_0x6058ce){logger[_0x305b('0x15')](_0x6058ce);_0x463890(_0x6058ce);})['end']();});}function uploadFile(_0x49f75b){return new BPromise(function(_0x46606e,_0x2f36a3){var _0x35814a=urlParse(_0x49f75b);var _0x45c89a=_0x35814a[_0x305b('0xf')]===_0x305b('0x10')?https:http;var _0xf48760={'host':_0x35814a[_0x305b('0x11')],'path':_0x35814a[_0x305b('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x45c89a[_0x305b('0x13')](_0xf48760,function(_0x4dc8eb){if(_0x4dc8eb[_0x305b('0x14')]!==0xc8){_0x2f36a3(new Error(_0x305b('0x1b')+_0x49f75b+'\x20failed,\x20status\x20code\x20=\x20'+_0x4dc8eb[_0x305b('0x14')]+'\x20('+_0x4dc8eb[_0x305b('0x1c')]+')'));return;}var _0x84aab8='';_0x4dc8eb['on'](_0x305b('0x1d'),function(_0x574f35){_0x84aab8+=_0x574f35;});_0x4dc8eb['on']('end',function(){_0x46606e(_0x84aab8);});})['on'](_0x305b('0x15'),function(_0x57f72d){_0x2f36a3(_0x57f72d);})[_0x305b('0x1e')]();});}function convertFile(_0x1b5645,_0x1ff34a){return new BPromise(function(_0x4b8935,_0x5b9f79){var _0x4a3ec2=sox[_0x305b('0x1f')](_0x1b5645,_0x1ff34a,{'sampleRate':0x1f40,'format':_0x305b('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4a3ec2['on'](_0x305b('0x15'),function(_0x363b89){logger[_0x305b('0x15')](_0x305b('0x21'),_0x363b89);_0x5b9f79(_0x363b89);});_0x4a3ec2['on']('end',function(){logger['info'](_0x305b('0x22'));_0x4b8935();});_0x4a3ec2[_0x305b('0x23')]();});}function base64Decode(_0xfbf125,_0xcb78d4){var _0x454bed=path[_0x305b('0x24')](__dirname,_0x305b('0x25'),rs[_0x305b('0x26')](0x4)+_0x305b('0x27'));fs[_0x305b('0x28')](_0x454bed,_0xfbf125,_0x305b('0x29'));return convertFile(_0x454bed,_0xcb78d4)[_0x305b('0x2a')](function(){try{fs[_0x305b('0x2b')](_0x454bed);fs[_0x305b('0x2c')](_0xcb78d4,_0x305b('0x2d'));}catch(_0x517c25){logger['error'](_0x517c25);}return _0xcb78d4[_0x305b('0x2e')]('.')[0x0];});}function base64Encode(_0x32355f){var _0x37d47a=fs[_0x305b('0x2f')](_0x32355f);return new Buffer(_0x37d47a)[_0x305b('0x30')](_0x305b('0x29'));}exports['googleCloudTTS']=function(_0x109fcc,_0x2eb580,_0x5b7be0,_0x4f79db,_0x25b5a2,_0x36cc61){var _0x5494c0,_0x5522c3;var _0x1e17ed='https://texttospeech.googleapis.com/v1/';var _0x622a7d=_0x305b('0x31')+_0x109fcc;var _0xd0c8b6={};if(_0x2eb580==='ssml'){_0xd0c8b6[_0x305b('0x32')]={'ssml':_0x5b7be0};}else{_0xd0c8b6[_0x305b('0x32')]={'text':_0x5b7be0};};_0xd0c8b6[_0x305b('0x33')]={'languageCode':_0x4f79db,'ssmlGender':_0x25b5a2};_0xd0c8b6[_0x305b('0x34')]={'audioEncoding':_0x305b('0x35'),'sampleRateHertz':0x1f40};var _0x514f95={'url':_0x1e17ed+_0x305b('0x36')+_0x622a7d,'method':_0x305b('0x37'),'json':!![],'body':_0xd0c8b6};return rp(_0x514f95)['then'](function(_0x5ea404){return new BPromise(function(_0xce0ace,_0x35b0e8){_0x5494c0=path[_0x305b('0x24')](__dirname,_0x305b('0x25'),rs[_0x305b('0x26')](0x4)+_0x305b('0x38'));var _0x2a13cb=Buffer['from'](_0x5ea404[_0x305b('0x39')],_0x305b('0x29'));return fs['writeFile'](_0x5494c0,_0x2a13cb,function(_0x418354){_0x35b0e8(_0x418354);},function(_0xa4a7e){fs[_0x305b('0x2c')](_0x5494c0,'777');_0xce0ace(_0xa4a7e);});});})[_0x305b('0x2a')](function(_0x446569){_0x5522c3=path[_0x305b('0x24')](__dirname,'tmp',rs[_0x305b('0x26')](0x4)+_0x305b('0x27'));return convertFile(_0x5494c0,_0x5522c3);})[_0x305b('0x2a')](function(){try{fs[_0x305b('0x2b')](_0x5494c0);fs[_0x305b('0x2c')](_0x5522c3,_0x305b('0x2d'));}catch(_0x4a1382){logger['error'](_0x4a1382);}logger[_0x305b('0x3a')]('googleCloudTTS\x20path',_0x5522c3[_0x305b('0x2e')]('.')[0x0]);return _0x5522c3[_0x305b('0x2e')]('.')[0x0];});};exports[_0x305b('0x3b')]=function(_0x324c98,_0x1fb35d){var _0x3553cb=_0x305b('0x3c');var _0x351914,_0x1b3755;var _0x1c67ec;var _0x32ca7b={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x3553cb,'headers':{'Content-Type':_0x305b('0x3d')},'body':_0x305b('0x3e')+encodeURIComponent(JSON[_0x305b('0x3f')]([[[_0x305b('0x40'),JSON[_0x305b('0x3f')]([_0x324c98,_0x1fb35d||'en',![],_0x305b('0x41')]),null,_0x305b('0x42')]]]))};return rp(_0x32ca7b)[_0x305b('0x2a')](function(_0x368015){try{_0x1c67ec=eval(_0x368015[_0x305b('0x43')](0x5))[0x0][0x2];}catch(_0x40b0b0){throw new Error('parse\x20response\x20failed:\x0a'+_0x368015[_0x305b('0x1d')]);}if(!_0x1c67ec){if(_0x324c98[_0x305b('0x44')]>0xc8){throw new Error(_0x305b('0x45'));}else{throw new Error(_0x305b('0x46')+_0x1fb35d+_0x305b('0x47'));}}try{_0x1c67ec=eval(_0x1c67ec)[0x0];}catch(_0xa9779e){throw new Error(_0x305b('0x48')+res[_0x305b('0x1d')]);}const _0x366b40=_0x1c67ec;_0x351914=path[_0x305b('0x24')](__dirname,'tmp',rs[_0x305b('0x26')](0x4)+'.mp3');fs[_0x305b('0x28')](_0x351914,_0x1c67ec,{'encoding':'base64'});_0x1b3755=path[_0x305b('0x24')](__dirname,_0x305b('0x25'),rs['generate'](0x4)+_0x305b('0x27'));return convertFile(_0x351914,_0x1b3755);})[_0x305b('0x2a')](function(){try{fs[_0x305b('0x2b')](_0x351914);fs[_0x305b('0x2c')](_0x1b3755,'777');}catch(_0x1ff3ec){logger['error'](_0x1ff3ec);}logger[_0x305b('0x3a')](_0x305b('0x49'),_0x1b3755[_0x305b('0x2e')]('.')[0x0]);return _0x1b3755[_0x305b('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x247d3d,_0x30289c,_0x5173e6){return google['asr'](_0x247d3d,_0x30289c,_0x5173e6)[_0x305b('0x2a')](function(_0xe6ea2){logger[_0x305b('0x3a')](_0xe6ea2[_0x305b('0x4a')]);return rp(_0xe6ea2);})[_0x305b('0x2a')](function(_0x3d16b3){var _0x4cfc36='';var _0x4e1f33=0x0;try{fs[_0x305b('0x2b')](_0x247d3d);}catch(_0x40c127){logger['error'](_0x40c127);}if(_0x3d16b3&&_0x3d16b3[_0x305b('0x4b')]){_0x4cfc36=_0x3d16b3[_0x305b('0x4b')]['map'](function(_0x52aadb){return _0x52aadb&&_0x52aadb[_0x305b('0x4c')][0x0]&&_0x52aadb[_0x305b('0x4c')][0x0][_0x305b('0x4d')]?_0x52aadb['alternatives'][0x0]['transcript']:'';})[_0x305b('0x4e')]('\x0a');_0x4e1f33=_0x3d16b3[_0x305b('0x4b')]['map'](function(_0xb35323){return _0xb35323&&_0xb35323[_0x305b('0x4c')][0x0]&&_0xb35323['alternatives'][0x0][_0x305b('0x4f')]?_0xb35323[_0x305b('0x4c')][0x0][_0x305b('0x4f')]:0x0;})[_0x305b('0x4e')]('\x0a');}logger[_0x305b('0x3a')]('googleASR\x20transcription',_0x4cfc36);logger[_0x305b('0x3a')](_0x305b('0x50'),_0x4e1f33);return{'transcript':_0x4cfc36,'confidence':_0x4e1f33};})[_0x305b('0x51')](function(_0x509a0b){logger[_0x305b('0x15')](_0x305b('0x52'),_0x509a0b['statusCode'],_0x509a0b[_0x305b('0x53')],_0x509a0b['message']);});};exports[_0x305b('0x54')]=function(_0x3e9a36,_0x496edb,_0x5527b0,_0x279798){var _0x5d4e0b=apiai(_0x496edb,{'language':_0x279798||'en'});return _0x5d4e0b['textRequest'](_0x5527b0,{'sessionId':md5(_0x3e9a36)})['then'](function(_0x4dcb6d){logger['info'](JSON[_0x305b('0x3f')](_0x4dcb6d));return{'source':_0x4dcb6d[_0x305b('0x55')]['source'],'resolvedQuery':_0x4dcb6d['result'][_0x305b('0x56')],'action':_0x4dcb6d['result'][_0x305b('0x57')],'actionIncomplete':_0x4dcb6d[_0x305b('0x55')]['actionIncomplete'],'speech':_0x4dcb6d[_0x305b('0x55')][_0x305b('0x58')][_0x305b('0x59')],'score':_0x4dcb6d['result'][_0x305b('0x5a')],'statusCode':_0x4dcb6d[_0x305b('0x5b')]['code'],'endConversation':_0x4dcb6d[_0x305b('0x55')][_0x305b('0x5c')]['endConversation']||![],'isFallbackIntent':_0x4dcb6d[_0x305b('0x55')][_0x305b('0x5c')][_0x305b('0x5d')]};});};exports['googleDialogflowV2']=function(_0x36168e,_0x1aeb87,_0x1b95a4,_0x32452d,_0x4910da,_0x3a88dc){var _0x40a71f=_0x32452d['replace'](/\\n/g,'\x0a');var _0x3973ba={'credentials':{'private_key':_0x40a71f,'client_email':_0x1b95a4}};var _0xbadb6=new dialogflow[(_0x305b('0x5e'))](_0x3973ba);var _0x2ae7d8=_0xbadb6['sessionPath'](_0x1aeb87,md5(_0x36168e));var _0x577e3c={'session':_0x2ae7d8,'queryInput':{'text':{'text':_0x4910da,'languageCode':_0x3a88dc}}};return _0xbadb6[_0x305b('0x5f')](_0x577e3c)[_0x305b('0x2a')](function(_0x5197eb){if(_0x5197eb&&_0x5197eb[_0x305b('0x44')]){logger[_0x305b('0x3a')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x5197eb));var _0x577b6d=_0x5197eb[0x0];if(_0x577b6d){var _0x1b756d={'action':_0x577b6d[_0x305b('0x60')]['action'],'allRequiredParamsPresent':_0x577b6d['queryResult']['allRequiredParamsPresent'],'endConversation':_0x577b6d[_0x305b('0x60')][_0x305b('0x61')]&&_0x577b6d[_0x305b('0x60')][_0x305b('0x61')][_0x305b('0x62')]?_0x577b6d['queryResult']['diagnosticInfo'][_0x305b('0x62')][_0x305b('0x63')][_0x305b('0x64')]:![],'fulfillmentText':_0x577b6d[_0x305b('0x60')]['fulfillmentText'],'intentName':_0x577b6d[_0x305b('0x60')][_0x305b('0x65')]['name'],'intentDisplayName':_0x577b6d['queryResult'][_0x305b('0x65')][_0x305b('0x66')],'isFallbackIntent':_0x577b6d[_0x305b('0x60')][_0x305b('0x65')][_0x305b('0x67')],'languageCode':_0x577b6d[_0x305b('0x60')][_0x305b('0x68')],'queryText':_0x577b6d['queryResult'][_0x305b('0x69')],'responseId':_0x577b6d[_0x305b('0x6a')],'score':_0x577b6d['queryResult'][_0x305b('0x6b')],'speech':_0x577b6d[_0x305b('0x60')]['fulfillmentText'],'providerResponse':JSON[_0x305b('0x3f')](_0x5197eb)};return _0x1b756d;}}});};exports[_0x305b('0x6c')]=function(_0x1378ac,_0x1de938,_0x5bffff,_0x22443b){return tilde[_0x305b('0x6d')](_0x1378ac,_0x1de938,_0x5bffff,_0x22443b)['then'](function(_0x446226){try{fs['unlink'](_0x1378ac);}catch(_0x590e67){logger[_0x305b('0x15')](_0x590e67);}logger[_0x305b('0x3a')](_0x305b('0x6e'),_0x446226[_0x305b('0x4d')]);logger[_0x305b('0x3a')](_0x305b('0x6f'),_0x446226['confidence']);return _0x446226;});};exports[_0x305b('0x70')]=function(_0x5b57ac,_0x30f9dc,_0x3297e0,_0x2e34bc,_0x1bc30d,_0x19da9d){var _0x464067=path[_0x305b('0x24')](__dirname,_0x305b('0x25'),rs[_0x305b('0x26')](0x4)+_0x305b('0x38'));var _0x539092;return aws['polly'](_0x5b57ac,_0x30f9dc,_0x3297e0,_0x2e34bc,_0x1bc30d,_0x19da9d,_0x464067)['then'](function(){_0x539092=path[_0x305b('0x24')](__dirname,'tmp',rs[_0x305b('0x26')](0x4)+_0x305b('0x27'));return convertFile(_0x464067,_0x539092);})[_0x305b('0x2a')](function(){try{fs[_0x305b('0x2b')](_0x464067);fs['chmodSync'](_0x539092,_0x305b('0x2d'));}catch(_0x1f7cec){logger[_0x305b('0x15')](_0x1f7cec);}return _0x539092[_0x305b('0x2e')]('.')[0x0];});};exports['awsLex']=function(_0x378985,_0x53844e,_0x21f94a,_0x40433b,_0x52d8b3,_0x2b4010){return aws[_0x305b('0x71')](_0x378985,_0x53844e,_0x21f94a,_0x40433b,_0x52d8b3,_0x2b4010)[_0x305b('0x2a')](function(_0x21bdf0){logger['info'](JSON[_0x305b('0x3f')](_0x21bdf0));return _0x21bdf0;});};exports['ispeechTTS']=function(_0x482161,_0x4dd3e9,_0x1c1721,_0x11f561){var _0x4b7ae3=util[_0x305b('0x72')](_0x305b('0x73'),ISPEECH_API,_0x482161,encodeURIComponent(_0x4dd3e9),_0x1c1721,_0x11f561);var _0xf4fc75=path['resolve'](__dirname,_0x305b('0x25'),rs[_0x305b('0x26')](0x4)+_0x305b('0x38'));var _0x3218b7;return downloadFile(_0x4b7ae3,_0xf4fc75)[_0x305b('0x2a')](function(){_0x3218b7=path[_0x305b('0x24')](__dirname,_0x305b('0x25'),rs[_0x305b('0x26')](0x4)+_0x305b('0x27'));return convertFile(_0xf4fc75,_0x3218b7);})[_0x305b('0x2a')](function(){try{fs[_0x305b('0x2b')](_0xf4fc75);fs['chmodSync'](_0x3218b7,_0x305b('0x2d'));}catch(_0x5d163d){logger[_0x305b('0x15')](_0x5d163d);}return _0x3218b7[_0x305b('0x2e')]('.')[0x0];});};exports[_0x305b('0x74')]=function(_0xf27032,_0x37101e,_0x24ce10,_0x3b5a93){var _0x2c75ae=util[_0x305b('0x72')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x37101e,_0x24ce10,base64Encode(_0xf27032),_0x3b5a93?util[_0x305b('0x72')]('model=%s',encodeURIComponent(_0x3b5a93)):_0x305b('0x75'));return uploadFile(_0x2c75ae)[_0x305b('0x2a')](function(_0x23759e){return querystring[_0x305b('0x76')](_0x23759e);});};exports[_0x305b('0x77')]=function(_0x108e9c,_0x309177){return sestek[_0x305b('0x78')](_0x108e9c,_0x309177)['then'](function(_0x527cac){logger['info'](JSON[_0x305b('0x3f')](_0x527cac));var _0x522caa={'speech':_0x527cac['text'],'action':_0x527cac[_0x305b('0x79')]?_0x527cac[_0x305b('0x79')]['CustomAction']:undefined,'actiondata':_0x527cac[_0x305b('0x79')]?_0x527cac[_0x305b('0x79')][_0x305b('0x7a')]:undefined};if(_0x527cac[_0x305b('0x79')]&&_0x527cac['channelData'][_0x305b('0x7b')]){return base64Decode(_0x527cac[_0x305b('0x79')][_0x305b('0x7b')][_0x305b('0x7c')],path[_0x305b('0x24')](__dirname,_0x305b('0x25'),rs[_0x305b('0x26')](0x4)+_0x305b('0x27')))[_0x305b('0x2a')](function(_0x5c4625){_0x522caa[_0x305b('0x7d')]=_0x5c4625;return _0x522caa;});}return _0x522caa;});};exports[_0x305b('0x7e')]=function(){return __dirname;}; \ No newline at end of file +var _0x1b8f=['isFallback','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','finish\x20download\x20file','close','unlink','error','download\x20error','pipe','end','data','transcode','wav','finish\x20to\x20convert','start','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','toString','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','text:synthesize','POST','resolve','tmp','.mp3','from','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','null','generic','slice','length','lang\x20\x22','parse\x20response\x20failed:\x0a','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','actionIncomplete','fulfillment','status','code','metadata','endConversation','replace','sessionPath','detectIntent','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName'];(function(_0x568c60,_0x12eaba){var _0x50762c=function(_0x3f35f8){while(--_0x3f35f8){_0x568c60['push'](_0x568c60['shift']());}};_0x50762c(++_0x12eaba);}(_0x1b8f,0x123));var _0xf1b8=function(_0x89d570,_0x10aee8){_0x89d570=_0x89d570-0x0;var _0x312364=_0x1b8f[_0x89d570];return _0x312364;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xf1b8('0x0'));var dialogflow=require(_0xf1b8('0x1'));var fs=require('fs');var http=require(_0xf1b8('0x2'));var https=require(_0xf1b8('0x3'));var md5=require(_0xf1b8('0x4'));var path=require(_0xf1b8('0x5'));var querystring=require(_0xf1b8('0x6'));var rp=require(_0xf1b8('0x7'));var rs=require(_0xf1b8('0x8'));var sox=require(_0xf1b8('0x9'));var tts=require('google-tts-api');var urlParse=require(_0xf1b8('0xa'))[_0xf1b8('0xb')];var util=require(_0xf1b8('0xc'));var aws=require(_0xf1b8('0xd'));var google=require(_0xf1b8('0xe'));var sestek=require(_0xf1b8('0xf'));var tilde=require('./tilde');var logger=require(_0xf1b8('0x10'))(_0xf1b8('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x14bbde,_0x11e33e){return new BPromise(function(_0x3a7fdc,_0x2db7c3){var _0x2ce893=urlParse(_0x14bbde);var _0x34267e=_0x2ce893[_0xf1b8('0x12')]===_0xf1b8('0x13')?https:http;var _0x4ebb97={'host':_0x2ce893[_0xf1b8('0x14')],'path':_0x2ce893[_0xf1b8('0x5')],'headers':{'user-agent':_0xf1b8('0x15')}};_0x34267e[_0xf1b8('0x16')](_0x4ebb97,function(_0x2a3ef7){if(_0x2a3ef7['statusCode']!==0xc8){logger['error'](_0xf1b8('0x17')+_0x14bbde+_0xf1b8('0x18')+_0x2a3ef7[_0xf1b8('0x19')]+'\x20('+_0x2a3ef7['statusMessage']+')');_0x2db7c3(new Error(_0xf1b8('0x17')+_0x14bbde+_0xf1b8('0x18')+_0x2a3ef7[_0xf1b8('0x19')]+'\x20('+_0x2a3ef7[_0xf1b8('0x1a')]+')'));return;}var _0x1dfa4f=fs['createWriteStream'](_0x11e33e);_0x1dfa4f['on'](_0xf1b8('0x1b'),function(){logger[_0xf1b8('0x1c')](_0xf1b8('0x1d'));_0x1dfa4f[_0xf1b8('0x1e')](_0x3a7fdc);});_0x1dfa4f['on']('error',function(_0x32db77){fs[_0xf1b8('0x1f')](_0x11e33e);logger[_0xf1b8('0x20')](_0xf1b8('0x21'),_0x32db77);_0x2db7c3(_0x32db77);});_0x2a3ef7[_0xf1b8('0x22')](_0x1dfa4f);})['on'](_0xf1b8('0x20'),function(_0xe6dfd5){logger[_0xf1b8('0x20')](_0xe6dfd5);_0x2db7c3(_0xe6dfd5);})[_0xf1b8('0x23')]();});}function uploadFile(_0x3f2644){return new BPromise(function(_0x35ee8c,_0x5731f4){var _0x2356f2=urlParse(_0x3f2644);var _0x62ee6b=_0x2356f2[_0xf1b8('0x12')]===_0xf1b8('0x13')?https:http;var _0xc137be={'host':_0x2356f2['host'],'path':_0x2356f2['path'],'headers':{'user-agent':_0xf1b8('0x15')}};_0x62ee6b[_0xf1b8('0x16')](_0xc137be,function(_0x34293e){if(_0x34293e['statusCode']!==0xc8){_0x5731f4(new Error(_0xf1b8('0x17')+_0x3f2644+_0xf1b8('0x18')+_0x34293e[_0xf1b8('0x19')]+'\x20('+_0x34293e[_0xf1b8('0x1a')]+')'));return;}var _0x2b5aee='';_0x34293e['on'](_0xf1b8('0x24'),function(_0x1be87c){_0x2b5aee+=_0x1be87c;});_0x34293e['on']('end',function(){_0x35ee8c(_0x2b5aee);});})['on'](_0xf1b8('0x20'),function(_0x3e842c){_0x5731f4(_0x3e842c);})[_0xf1b8('0x23')]();});}function convertFile(_0x5b4b78,_0x5b6410){return new BPromise(function(_0x4e7e35,_0x3ae1a6){var _0x59d2e8=sox[_0xf1b8('0x25')](_0x5b4b78,_0x5b6410,{'sampleRate':0x1f40,'format':_0xf1b8('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x59d2e8['on']('error',function(_0x51b02e){logger[_0xf1b8('0x20')]('error\x20convert',_0x51b02e);_0x3ae1a6(_0x51b02e);});_0x59d2e8['on'](_0xf1b8('0x23'),function(){logger[_0xf1b8('0x1c')](_0xf1b8('0x27'));_0x4e7e35();});_0x59d2e8[_0xf1b8('0x28')]();});}function base64Decode(_0x1a2533,_0x23c319){var _0x4207bb=path['resolve'](__dirname,'tmp',rs[_0xf1b8('0x29')](0x4)+_0xf1b8('0x2a'));fs[_0xf1b8('0x2b')](_0x4207bb,_0x1a2533,_0xf1b8('0x2c'));return convertFile(_0x4207bb,_0x23c319)[_0xf1b8('0x2d')](function(){try{fs[_0xf1b8('0x1f')](_0x4207bb);fs[_0xf1b8('0x2e')](_0x23c319,_0xf1b8('0x2f'));}catch(_0x113cf5){logger['error'](_0x113cf5);}return _0x23c319[_0xf1b8('0x30')]('.')[0x0];});}function base64Encode(_0x45628c){var _0x4f3441=fs['readFileSync'](_0x45628c);return new Buffer(_0x4f3441)[_0xf1b8('0x31')](_0xf1b8('0x2c'));}exports['googleCloudTTS']=function(_0x5807d5,_0xbf9229,_0x215613,_0x2893c6,_0x4e6dfa,_0x5340b0){var _0x5f2bf8,_0xc2d048;var _0x12ca49=_0xf1b8('0x32');var _0x306d72='?key='+_0x5807d5;var _0xb96055={};if(_0xbf9229===_0xf1b8('0x33')){_0xb96055['input']={'ssml':_0x215613};}else{_0xb96055[_0xf1b8('0x34')]={'text':_0x215613};};_0xb96055[_0xf1b8('0x35')]={'languageCode':_0x2893c6,'ssmlGender':_0x4e6dfa};_0xb96055[_0xf1b8('0x36')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x331557={'url':_0x12ca49+_0xf1b8('0x37')+_0x306d72,'method':_0xf1b8('0x38'),'json':!![],'body':_0xb96055};return rp(_0x331557)['then'](function(_0x325087){return new BPromise(function(_0xedbc6,_0x561e8){_0x5f2bf8=path[_0xf1b8('0x39')](__dirname,_0xf1b8('0x3a'),rs[_0xf1b8('0x29')](0x4)+_0xf1b8('0x3b'));var _0x4625fc=Buffer[_0xf1b8('0x3c')](_0x325087['audioContent'],_0xf1b8('0x2c'));return fs['writeFile'](_0x5f2bf8,_0x4625fc,function(_0x497a62){_0x561e8(_0x497a62);},function(_0x55a349){fs[_0xf1b8('0x2e')](_0x5f2bf8,'777');_0xedbc6(_0x55a349);});});})['then'](function(_0x152f22){_0xc2d048=path[_0xf1b8('0x39')](__dirname,_0xf1b8('0x3a'),rs[_0xf1b8('0x29')](0x4)+_0xf1b8('0x2a'));return convertFile(_0x5f2bf8,_0xc2d048);})[_0xf1b8('0x2d')](function(){try{fs[_0xf1b8('0x1f')](_0x5f2bf8);fs['chmodSync'](_0xc2d048,'777');}catch(_0x208a60){logger[_0xf1b8('0x20')](_0x208a60);}logger[_0xf1b8('0x1c')](_0xf1b8('0x3d'),_0xc2d048[_0xf1b8('0x30')]('.')[0x0]);return _0xc2d048[_0xf1b8('0x30')]('.')[0x0];});};exports[_0xf1b8('0x3e')]=function(_0x51fde1,_0x1b0f81){var _0x4bbe82=_0xf1b8('0x3f');var _0x1eae2d,_0x3faee1;var _0xaa1bf4;var _0x598c34={'encoding':_0xf1b8('0x40'),'method':'POST','timeout':0x2710,'url':_0x4bbe82,'headers':{'Content-Type':_0xf1b8('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0xf1b8('0x42')]([[['jQ1olc',JSON[_0xf1b8('0x42')]([_0x51fde1,_0x1b0f81||'en',![],_0xf1b8('0x43')]),null,_0xf1b8('0x44')]]]))};return rp(_0x598c34)[_0xf1b8('0x2d')](function(_0x2038fd){try{_0xaa1bf4=eval(_0x2038fd[_0xf1b8('0x45')](0x5))[0x0][0x2];}catch(_0x242fd1){throw new Error('parse\x20response\x20failed:\x0a'+_0x2038fd['data']);}if(!_0xaa1bf4){if(_0x51fde1[_0xf1b8('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xf1b8('0x47')+_0x1b0f81+'\x22\x20might\x20not\x20exist');}}try{_0xaa1bf4=eval(_0xaa1bf4)[0x0];}catch(_0x5488ac){throw new Error(_0xf1b8('0x48')+res['data']);}const _0x3cda02=_0xaa1bf4;_0x1eae2d=path[_0xf1b8('0x39')](__dirname,_0xf1b8('0x3a'),rs['generate'](0x4)+_0xf1b8('0x3b'));fs['writeFileSync'](_0x1eae2d,_0xaa1bf4,{'encoding':_0xf1b8('0x2c')});_0x3faee1=path[_0xf1b8('0x39')](__dirname,_0xf1b8('0x3a'),rs['generate'](0x4)+'.wav');return convertFile(_0x1eae2d,_0x3faee1);})[_0xf1b8('0x2d')](function(){try{fs[_0xf1b8('0x1f')](_0x1eae2d);fs[_0xf1b8('0x2e')](_0x3faee1,_0xf1b8('0x2f'));}catch(_0x34cce2){logger['error'](_0x34cce2);}logger[_0xf1b8('0x1c')]('goggleTTS\x20path',_0x3faee1['split']('.')[0x0]);return _0x3faee1[_0xf1b8('0x30')]('.')[0x0];});};exports[_0xf1b8('0x49')]=function(_0x5a6c39,_0x5694d7,_0x534b1e){return google[_0xf1b8('0x4a')](_0x5a6c39,_0x5694d7,_0x534b1e)[_0xf1b8('0x2d')](function(_0x20c743){logger[_0xf1b8('0x1c')](_0x20c743[_0xf1b8('0x4b')]);return rp(_0x20c743);})[_0xf1b8('0x2d')](function(_0x366f7b){var _0x2dd2c2='';var _0x44fbd1=0x0;try{fs[_0xf1b8('0x1f')](_0x5a6c39);}catch(_0x2e58f3){logger[_0xf1b8('0x20')](_0x2e58f3);}if(_0x366f7b&&_0x366f7b[_0xf1b8('0x4c')]){_0x2dd2c2=_0x366f7b[_0xf1b8('0x4c')][_0xf1b8('0x4d')](function(_0x5394d2){return _0x5394d2&&_0x5394d2[_0xf1b8('0x4e')][0x0]&&_0x5394d2['alternatives'][0x0][_0xf1b8('0x4f')]?_0x5394d2['alternatives'][0x0][_0xf1b8('0x4f')]:'';})['join']('\x0a');_0x44fbd1=_0x366f7b[_0xf1b8('0x4c')][_0xf1b8('0x4d')](function(_0x5566b5){return _0x5566b5&&_0x5566b5['alternatives'][0x0]&&_0x5566b5[_0xf1b8('0x4e')][0x0][_0xf1b8('0x50')]?_0x5566b5[_0xf1b8('0x4e')][0x0][_0xf1b8('0x50')]:0x0;})[_0xf1b8('0x51')]('\x0a');}logger[_0xf1b8('0x1c')](_0xf1b8('0x52'),_0x2dd2c2);logger[_0xf1b8('0x1c')](_0xf1b8('0x53'),_0x44fbd1);return{'transcript':_0x2dd2c2,'confidence':_0x44fbd1};})[_0xf1b8('0x54')](function(_0x554364){logger['error'](_0xf1b8('0x55'),_0x554364[_0xf1b8('0x19')],_0x554364[_0xf1b8('0x56')],_0x554364[_0xf1b8('0x57')]);});};exports[_0xf1b8('0x58')]=function(_0x447c83,_0x56b81b,_0x411581,_0x5a269c){var _0xca0f0d=apiai(_0x56b81b,{'language':_0x5a269c||'en'});return _0xca0f0d[_0xf1b8('0x59')](_0x411581,{'sessionId':md5(_0x447c83)})[_0xf1b8('0x2d')](function(_0x45afe6){logger[_0xf1b8('0x1c')](JSON[_0xf1b8('0x42')](_0x45afe6));return{'source':_0x45afe6[_0xf1b8('0x5a')]['source'],'resolvedQuery':_0x45afe6[_0xf1b8('0x5a')][_0xf1b8('0x5b')],'action':_0x45afe6[_0xf1b8('0x5a')]['action'],'actionIncomplete':_0x45afe6['result'][_0xf1b8('0x5c')],'speech':_0x45afe6[_0xf1b8('0x5a')][_0xf1b8('0x5d')]['speech'],'score':_0x45afe6[_0xf1b8('0x5a')]['score'],'statusCode':_0x45afe6[_0xf1b8('0x5e')][_0xf1b8('0x5f')],'endConversation':_0x45afe6['result'][_0xf1b8('0x60')][_0xf1b8('0x61')]||![],'isFallbackIntent':_0x45afe6[_0xf1b8('0x5a')][_0xf1b8('0x60')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0xb33e4a,_0x4c4403,_0x25dad3,_0xe45018,_0x15cad1,_0x4acdb7){var _0x49b42f=_0xe45018[_0xf1b8('0x62')](/\\n/g,'\x0a');var _0x4fa6b6={'credentials':{'private_key':_0x49b42f,'client_email':_0x25dad3}};var _0x9c9204=new dialogflow['SessionsClient'](_0x4fa6b6);var _0x1f286d=_0x9c9204[_0xf1b8('0x63')](_0x4c4403,md5(_0xb33e4a));var _0x5944e0={'session':_0x1f286d,'queryInput':{'text':{'text':_0x15cad1,'languageCode':_0x4acdb7}}};return _0x9c9204[_0xf1b8('0x64')](_0x5944e0)[_0xf1b8('0x2d')](function(_0x12a259){if(_0x12a259&&_0x12a259['length']){logger[_0xf1b8('0x1c')]('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x12a259));var _0x5f1b06=_0x12a259[0x0];if(_0x5f1b06){var _0x35cfa3={'action':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x66')],'allRequiredParamsPresent':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x67')],'endConversation':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x68')]&&_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x68')][_0xf1b8('0x69')]?_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x68')][_0xf1b8('0x69')][_0xf1b8('0x6a')][_0xf1b8('0x6b')]:![],'fulfillmentText':_0x5f1b06['queryResult'][_0xf1b8('0x6c')],'intentName':_0x5f1b06['queryResult']['intent'][_0xf1b8('0x56')],'intentDisplayName':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x6d')][_0xf1b8('0x6e')],'isFallbackIntent':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x6d')][_0xf1b8('0x6f')],'languageCode':_0x5f1b06['queryResult']['languageCode'],'queryText':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x70')],'responseId':_0x5f1b06[_0xf1b8('0x71')],'score':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x72')],'speech':_0x5f1b06[_0xf1b8('0x65')][_0xf1b8('0x6c')],'providerResponse':JSON[_0xf1b8('0x42')](_0x12a259)};return _0x35cfa3;}}});};exports['tildeASR']=function(_0x1be0f6,_0x5c8cbf,_0x371283,_0x4611f0){return tilde[_0xf1b8('0x4a')](_0x1be0f6,_0x5c8cbf,_0x371283,_0x4611f0)[_0xf1b8('0x2d')](function(_0x3b0bbb){try{fs['unlink'](_0x1be0f6);}catch(_0x4f699f){logger[_0xf1b8('0x20')](_0x4f699f);}logger['info'](_0xf1b8('0x73'),_0x3b0bbb[_0xf1b8('0x4f')]);logger[_0xf1b8('0x1c')](_0xf1b8('0x74'),_0x3b0bbb[_0xf1b8('0x50')]);return _0x3b0bbb;});};exports[_0xf1b8('0x75')]=function(_0x5d53f8,_0x4fbb23,_0x5b5de9,_0x26fd1e,_0x3cab50,_0xceddca){var _0x57c29c=path['resolve'](__dirname,'tmp',rs[_0xf1b8('0x29')](0x4)+_0xf1b8('0x3b'));var _0x52944f;return aws[_0xf1b8('0x76')](_0x5d53f8,_0x4fbb23,_0x5b5de9,_0x26fd1e,_0x3cab50,_0xceddca,_0x57c29c)[_0xf1b8('0x2d')](function(){_0x52944f=path[_0xf1b8('0x39')](__dirname,'tmp',rs[_0xf1b8('0x29')](0x4)+_0xf1b8('0x2a'));return convertFile(_0x57c29c,_0x52944f);})[_0xf1b8('0x2d')](function(){try{fs[_0xf1b8('0x1f')](_0x57c29c);fs[_0xf1b8('0x2e')](_0x52944f,_0xf1b8('0x2f'));}catch(_0x24640b){logger[_0xf1b8('0x20')](_0x24640b);}return _0x52944f[_0xf1b8('0x30')]('.')[0x0];});};exports[_0xf1b8('0x77')]=function(_0x37ee51,_0x1f2574,_0x37c0ca,_0x46b553,_0x9f18cf,_0x488c9d){return aws[_0xf1b8('0x78')](_0x37ee51,_0x1f2574,_0x37c0ca,_0x46b553,_0x9f18cf,_0x488c9d)[_0xf1b8('0x2d')](function(_0x1a7d9b){logger[_0xf1b8('0x1c')](JSON[_0xf1b8('0x42')](_0x1a7d9b));return _0x1a7d9b;});};exports[_0xf1b8('0x79')]=function(_0xb1870b,_0x3584dd,_0x1c8f0c,_0x3f28a5){var _0x31d739=util[_0xf1b8('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0xb1870b,encodeURIComponent(_0x3584dd),_0x1c8f0c,_0x3f28a5);var _0x5a8b31=path[_0xf1b8('0x39')](__dirname,_0xf1b8('0x3a'),rs[_0xf1b8('0x29')](0x4)+_0xf1b8('0x3b'));var _0x3954c7;return downloadFile(_0x31d739,_0x5a8b31)[_0xf1b8('0x2d')](function(){_0x3954c7=path['resolve'](__dirname,_0xf1b8('0x3a'),rs[_0xf1b8('0x29')](0x4)+_0xf1b8('0x2a'));return convertFile(_0x5a8b31,_0x3954c7);})[_0xf1b8('0x2d')](function(){try{fs[_0xf1b8('0x1f')](_0x5a8b31);fs[_0xf1b8('0x2e')](_0x3954c7,_0xf1b8('0x2f'));}catch(_0x19e295){logger[_0xf1b8('0x20')](_0x19e295);}return _0x3954c7[_0xf1b8('0x30')]('.')[0x0];});};exports[_0xf1b8('0x7b')]=function(_0x39efcc,_0x58bec2,_0x1d72c2,_0xc422bb){var _0x39f40a=util[_0xf1b8('0x7a')](_0xf1b8('0x7c'),ISPEECH_API,_0x58bec2,_0x1d72c2,base64Encode(_0x39efcc),_0xc422bb?util['format'](_0xf1b8('0x7d'),encodeURIComponent(_0xc422bb)):'freeform=3');return uploadFile(_0x39f40a)[_0xf1b8('0x2d')](function(_0x59f7e1){return querystring['parse'](_0x59f7e1);});};exports[_0xf1b8('0x7e')]=function(_0x5263fb,_0x3312ce){return sestek['nda'](_0x5263fb,_0x3312ce)['then'](function(_0x48bbc8){logger[_0xf1b8('0x1c')](JSON[_0xf1b8('0x42')](_0x48bbc8));var _0x2d1a59={'speech':_0x48bbc8[_0xf1b8('0x7f')],'action':_0x48bbc8[_0xf1b8('0x80')]?_0x48bbc8['channelData'][_0xf1b8('0x81')]:undefined,'actiondata':_0x48bbc8[_0xf1b8('0x80')]?_0x48bbc8[_0xf1b8('0x80')][_0xf1b8('0x82')]:undefined};if(_0x48bbc8[_0xf1b8('0x80')]&&_0x48bbc8[_0xf1b8('0x80')][_0xf1b8('0x83')]){return base64Decode(_0x48bbc8['channelData']['AudioFromTts']['Data'],path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xf1b8('0x2a')))['then'](function(_0x56e4b8){_0x2d1a59[_0xf1b8('0x84')]=_0x56e4b8;return _0x2d1a59;});}return _0x2d1a59;});};exports[_0xf1b8('0x85')]=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 2105711..bd8c688 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 _0xd616=['exports','./nda'];(function(_0x59d2d8,_0x5df195){var _0x14cc62=function(_0x536514){while(--_0x536514){_0x59d2d8['push'](_0x59d2d8['shift']());}};_0x14cc62(++_0x5df195);}(_0xd616,0x10d));var _0x6d61=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0xd616[_0x5c14f6];return _0x4949b3;};var nda=require(_0x6d61('0x0'));module[_0x6d61('0x1')]={'nda':nda}; \ No newline at end of file +var _0x4652=['./nda','exports'];(function(_0x403621,_0x1ac340){var _0x587743=function(_0xbb013d){while(--_0xbb013d){_0x403621['push'](_0x403621['shift']());}};_0x587743(++_0x1ac340);}(_0x4652,0xac));var _0x2465=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4652[_0x57b54c];return _0x59cc19;};var nda=require(_0x2465('0x0'));module[_0x2465('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 5fe34af..3ab3c5a 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 _0x97e7=['ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token','body','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','channelData','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url'];(function(_0x43dd0a,_0x206e1a){var _0x1492ac=function(_0x7bae4d){while(--_0x7bae4d){_0x43dd0a['push'](_0x43dd0a['shift']());}};_0x1492ac(++_0x206e1a);}(_0x97e7,0x1a1));var _0x797e=function(_0x4e18c0,_0x41b0dc){_0x4e18c0=_0x4e18c0-0x0;var _0xb26c3a=_0x97e7[_0x4e18c0];return _0xb26c3a;};'use strict';var rp=require(_0x797e('0x0'));var url=require(_0x797e('0x1'));var logger=require(_0x797e('0x2'))('agi');module[_0x797e('0x3')]=function(_0x2996c0,_0x13b749){var _0x3ed027={'method':_0x797e('0x4'),'uri':url[_0x797e('0x5')](_0x13b749[_0x797e('0x6')],_0x797e('0x7')),'form':{'grant_type':_0x797e('0x8'),'username':_0x13b749[_0x797e('0x9')],'password':_0x13b749[_0x797e('0x8')]},'json':!![]};return rp(_0x3ed027)[_0x797e('0xa')](function(_0x5db8f6){var _0x2fed68={'method':_0x797e('0x4'),'uri':url[_0x797e('0x5')](_0x13b749[_0x797e('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x13b749[_0x797e('0xc')]||_0x797e('0xd'),'channelId':_0x797e('0xe'),'conversation':{'id':_0x2996c0[_0x797e('0xf')]},'from':{'id':_0x2996c0[_0x797e('0x10')],'name':_0x2996c0[_0x797e('0x11')]},'recipient':{'id':_0x2996c0[_0x797e('0x12')],'name':_0x2996c0['extension']},'text':_0x13b749[_0x797e('0x13')],'channelData':{}},'headers':{'Authorization':_0x797e('0x14')+_0x5db8f6[_0x797e('0x15')]},'json':!![]};if(_0x13b749['project']){_0x2fed68[_0x797e('0x16')]['channelData'][_0x797e('0x17')]=_0x13b749['project'];}if(_0x13b749[_0x797e('0x18')]=='1'){_0x2fed68[_0x797e('0x16')]['channelData'][_0x797e('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x13b749[_0x797e('0x1a')]){_0x2fed68[_0x797e('0x16')][_0x797e('0x1b')][_0x797e('0x1c')]=_0x13b749[_0x797e('0x1a')];if(_0x13b749[_0x797e('0x1d')]){_0x2fed68[_0x797e('0x16')][_0x797e('0x1b')][_0x797e('0x1e')]=_0x13b749['custom_action_data'];}}logger[_0x797e('0x1f')](JSON[_0x797e('0x20')](_0x2fed68));return rp(_0x2fed68);});}; \ No newline at end of file +var _0x7035=['project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','../../../../../config/logger','agi','POST','resolve','/token','password','then','ndaactivity_type','Nda','calleridname','dnid','extension','Bearer\x20'];(function(_0x30012e,_0x20daa7){var _0x2875da=function(_0x1068ee){while(--_0x1068ee){_0x30012e['push'](_0x30012e['shift']());}};_0x2875da(++_0x20daa7);}(_0x7035,0x15e));var _0x5703=function(_0x579b97,_0x14955b){_0x579b97=_0x579b97-0x0;var _0x4a7be7=_0x7035[_0x579b97];return _0x4a7be7;};'use strict';var rp=require(_0x5703('0x0'));var url=require('url');var logger=require(_0x5703('0x1'))(_0x5703('0x2'));module['exports']=function(_0xcc3f27,_0x4183e5){var _0x431dc3={'method':_0x5703('0x3'),'uri':url[_0x5703('0x4')](_0x4183e5['ndauth_url'],_0x5703('0x5')),'form':{'grant_type':_0x5703('0x6'),'username':_0x4183e5['username'],'password':_0x4183e5[_0x5703('0x6')]},'json':!![]};return rp(_0x431dc3)[_0x5703('0x7')](function(_0x401d33){var _0x291988={'method':_0x5703('0x3'),'uri':url[_0x5703('0x4')](_0x4183e5['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4183e5[_0x5703('0x8')]||'message','channelId':_0x5703('0x9'),'conversation':{'id':_0xcc3f27['uniqueid']},'from':{'id':_0xcc3f27['callerid'],'name':_0xcc3f27[_0x5703('0xa')]},'recipient':{'id':_0xcc3f27[_0x5703('0xb')],'name':_0xcc3f27[_0x5703('0xc')]},'text':_0x4183e5['text'],'channelData':{}},'headers':{'Authorization':_0x5703('0xd')+_0x401d33['access_token']},'json':!![]};if(_0x4183e5[_0x5703('0xe')]){_0x291988[_0x5703('0xf')][_0x5703('0x10')][_0x5703('0x11')]=_0x4183e5[_0x5703('0xe')];}if(_0x4183e5[_0x5703('0x12')]=='1'){_0x291988[_0x5703('0xf')][_0x5703('0x10')][_0x5703('0x13')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5703('0x14')};}if(_0x4183e5[_0x5703('0x15')]){_0x291988['body'][_0x5703('0x10')][_0x5703('0x16')]=_0x4183e5[_0x5703('0x15')];if(_0x4183e5[_0x5703('0x17')]){_0x291988[_0x5703('0xf')][_0x5703('0x10')][_0x5703('0x18')]=_0x4183e5[_0x5703('0x17')];}}logger[_0x5703('0x19')](JSON['stringify'](_0x291988));return rp(_0x291988);});}; \ 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 b5f3134..fc8d599 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e98=['./lib/api'];(function(_0x1b3978,_0x5bedcd){var _0x4ac9e9=function(_0x34d551){while(--_0x34d551){_0x1b3978['push'](_0x1b3978['shift']());}};_0x4ac9e9(++_0x5bedcd);}(_0x7e98,0x1ba));var _0x87e9=function(_0x20ace9,_0x50f960){_0x20ace9=_0x20ace9-0x0;var _0x44de53=_0x7e98[_0x20ace9];return _0x44de53;};'use strict';var asr=require(_0x87e9('0x0'));module['exports']=function(_0x5731a5,_0x55a9dd,_0x4c666c,_0x20094d){return asr(_0x5731a5,_0x55a9dd,_0x4c666c,_0x20094d);}; \ No newline at end of file +var _0xfff2=['./lib/api','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfff2,0x1e8));var _0x2fff=function(_0x2d7cbe,_0x3279e0){_0x2d7cbe=_0x2d7cbe-0x0;var _0x133be=_0xfff2[_0x2d7cbe];return _0x133be;};'use strict';var asr=require(_0x2fff('0x0'));module[_0x2fff('0x1')]=function(_0x4a48e4,_0x351a68,_0x42dae0,_0x56caf1){return asr(_0x4a48e4,_0x351a68,_0x42dae0,_0x56caf1);}; \ 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 447445e..45fcea5 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 _0x4f11=['exports','info','Tilde\x20URI','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','stringify','createReadStream','data','close','send','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger'];(function(_0x11f48c,_0x286b55){var _0xf8530c=function(_0x40a529){while(--_0x40a529){_0x11f48c['push'](_0x11f48c['shift']());}};_0xf8530c(++_0x286b55);}(_0x4f11,0x1e9));var _0x14f1=function(_0x30c22f,_0x2e452f){_0x30c22f=_0x30c22f-0x0;var _0x3beb30=_0x4f11[_0x30c22f];return _0x3beb30;};'use strict';var BPromise=require(_0x14f1('0x0'));var _=require(_0x14f1('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x14f1('0x2'));var crypto=require(_0x14f1('0x3'));var logger=require(_0x14f1('0x4'))('agi');module[_0x14f1('0x5')]=function(_0x184242,_0x412f9c,_0x3e6f5c,_0x2daf7f){return new BPromise(function(_0x5bd9e9,_0x37f7e2){logger[_0x14f1('0x6')](_0x14f1('0x7'),_0x2daf7f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x5390ca=new WebSocket(_0x2daf7f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x58f771='';var _0x5bce03='0';var _0xf9a5a8='1';var _0x29ac21='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x1ad267(_0x3b1de1){var _0x2771a2=crypto['createHash'](_0x14f1('0x8'));_0x2771a2[_0x14f1('0x9')](_0x3b1de1);return _0x2771a2[_0x14f1('0xa')]('hex');}function _0x121bb8(){try{logger[_0x14f1('0x6')](_0x14f1('0xb'));var _0x440e8e=moment()['unix']();var _0x455ac0=_0x1ad267(_0x440e8e+_0x412f9c+_0x3e6f5c);_0x5390ca['send'](JSON[_0x14f1('0xc')]({'appID':_0x412f9c,'timestamp':_0x440e8e,'appKey':_0x455ac0}));var _0x3d4da4=fs[_0x14f1('0xd')](_0x184242);_0x3d4da4['on'](_0x14f1('0xe'),function(_0x5670b0){_0x5390ca['send'](_0x5670b0);});_0x3d4da4['on'](_0x14f1('0xf'),function(){_0x5390ca[_0x14f1('0x10')]('EOS');});}catch(_0x59360e){logger['error'](_0x14f1('0x11'),JSON[_0x14f1('0xc')](_0x59360e));_0x5390ca[_0x14f1('0x12')]();}}function _0x2d4f24(_0x5e5fe5){try{if(_0x5e5fe5){var _0x2f2338=JSON[_0x14f1('0x13')](_0x5e5fe5);switch(_0x2f2338[_0x14f1('0x14')]){case 0x0:if(_0x2f2338['result']){if(_0x2f2338[_0x14f1('0x15')][_0x14f1('0x16')]){logger['info'](_0x14f1('0x17'),JSON['stringify'](_0x2f2338['result'][_0x14f1('0x18')]));_0x58f771=_0x2f2338[_0x14f1('0x15')]['hypotheses'][0x0][_0x14f1('0x19')];_0x5bce03=_0x2f2338[_0x14f1('0x15')]['hypotheses'][0x0]['likelihood'];_0xf9a5a8='0';_0x29ac21=_0x14f1('0x1a');_0x5390ca[_0x14f1('0x12')]();}}break;case 0x1:logger[_0x14f1('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0xf9a5a8='1';_0x29ac21=_0x14f1('0x1b');break;case 0x2:logger[_0x14f1('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0xf9a5a8='2';_0x29ac21=_0x14f1('0x1c');break;case 0x9:logger[_0x14f1('0x6')](_0x14f1('0x1d'));_0xf9a5a8='9';_0x29ac21='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x14f1('0x6')](_0x14f1('0x1e'));_0xf9a5a8='10';_0x29ac21='Authentication\x20failed.';break;case 0xb:logger['info'](_0x14f1('0x1f'));_0xf9a5a8='11';_0x29ac21=_0x14f1('0x1f');}}}catch(_0x378d64){logger[_0x14f1('0x20')](_0x14f1('0x21'),JSON[_0x14f1('0xc')](_0x378d64));_0x5390ca['terminate']();}}function _0x310fd8(){logger['info'](_0x14f1('0x22'));_0x5bd9e9({'transcript':_0x58f771,'confidence':_0x5bce03,'status':_0xf9a5a8,'status_message':_0x29ac21});}function _0xc4072a(_0xa545d8){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x14f1('0x23')](_0xa545d8)){logger[_0x14f1('0x20')](_['isObject'](_0xa545d8)?JSON['stringify'](_0xa545d8):_0xa545d8);}}_0x5390ca['on'](_0x14f1('0x24'),_0x121bb8);_0x5390ca['on'](_0x14f1('0x25'),_0x2d4f24);_0x5390ca['on'](_0x14f1('0xf'),_0x310fd8);_0x5390ca['on'](_0x14f1('0x20'),_0xc4072a);});}; \ No newline at end of file +var _0xfad6=['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','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','hex','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','info','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x26f403,_0x16bdde){var _0x5420bb=function(_0x931b9){while(--_0x931b9){_0x26f403['push'](_0x26f403['shift']());}};_0x5420bb(++_0x16bdde);}(_0xfad6,0xe3));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x6fad('0x0'));var _=require(_0x6fad('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6fad('0x2'));var crypto=require(_0x6fad('0x3'));var logger=require(_0x6fad('0x4'))(_0x6fad('0x5'));module[_0x6fad('0x6')]=function(_0x355ff2,_0x1ea373,_0x207854,_0x30e996){return new BPromise(function(_0x518852,_0x2078dc){logger['info'](_0x6fad('0x7'),_0x30e996||_0x6fad('0x8'));var _0xc824aa=new WebSocket(_0x30e996||_0x6fad('0x8'),{'perMessageDeflate':![]});var _0x299cfc='';var _0x2df188='0';var _0xdbd41c='1';var _0x2c3cd5=_0x6fad('0x9');function _0x1ae831(_0x1a8e2f){var _0x1c318b=crypto['createHash']('sha1');_0x1c318b[_0x6fad('0xa')](_0x1a8e2f);return _0x1c318b['digest'](_0x6fad('0xb'));}function _0x42dd17(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x202fb5=moment()[_0x6fad('0xc')]();var _0x21bcce=_0x1ae831(_0x202fb5+_0x1ea373+_0x207854);_0xc824aa[_0x6fad('0xd')](JSON[_0x6fad('0xe')]({'appID':_0x1ea373,'timestamp':_0x202fb5,'appKey':_0x21bcce}));var _0xe37bda=fs[_0x6fad('0xf')](_0x355ff2);_0xe37bda['on'](_0x6fad('0x10'),function(_0x3130ee){_0xc824aa['send'](_0x3130ee);});_0xe37bda['on'](_0x6fad('0x11'),function(){_0xc824aa[_0x6fad('0xd')](_0x6fad('0x12'));});}catch(_0x535295){logger[_0x6fad('0x13')](_0x6fad('0x14'),JSON['stringify'](_0x535295));_0xc824aa[_0x6fad('0x15')]();}}function _0x43de43(_0x517d4b){try{if(_0x517d4b){var _0x45e8fd=JSON[_0x6fad('0x16')](_0x517d4b);switch(_0x45e8fd[_0x6fad('0x17')]){case 0x0:if(_0x45e8fd[_0x6fad('0x18')]){if(_0x45e8fd[_0x6fad('0x18')][_0x6fad('0x19')]){logger['info'](_0x6fad('0x1a'),JSON['stringify'](_0x45e8fd['result']['hypotheses']));_0x299cfc=_0x45e8fd['result'][_0x6fad('0x1b')][0x0]['transcript'];_0x2df188=_0x45e8fd[_0x6fad('0x18')][_0x6fad('0x1b')][0x0][_0x6fad('0x1c')];_0xdbd41c='0';_0x2c3cd5='Success.';_0xc824aa[_0x6fad('0x15')]();}}break;case 0x1:logger['info'](_0x6fad('0x9'));_0xdbd41c='1';_0x2c3cd5=_0x6fad('0x9');break;case 0x2:logger[_0x6fad('0x1d')](_0x6fad('0x1e'));_0xdbd41c='2';_0x2c3cd5=_0x6fad('0x1e');break;case 0x9:logger[_0x6fad('0x1d')](_0x6fad('0x1f'));_0xdbd41c='9';_0x2c3cd5=_0x6fad('0x1f');break;case 0xa:logger[_0x6fad('0x1d')]('Authentication\x20failed.');_0xdbd41c='10';_0x2c3cd5=_0x6fad('0x20');break;case 0xb:logger[_0x6fad('0x1d')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xdbd41c='11';_0x2c3cd5=_0x6fad('0x21');}}}catch(_0x453f48){logger[_0x6fad('0x13')](_0x6fad('0x22'),JSON[_0x6fad('0xe')](_0x453f48));_0xc824aa[_0x6fad('0x15')]();}}function _0x5b127b(){logger[_0x6fad('0x1d')](_0x6fad('0x23'));_0x518852({'transcript':_0x299cfc,'confidence':_0x2df188,'status':_0xdbd41c,'status_message':_0x2c3cd5});}function _0x520e81(_0x2bf71d){logger[_0x6fad('0x13')](_0x6fad('0x24'));if(!_['isNil'](_0x2bf71d)){logger[_0x6fad('0x13')](_['isObject'](_0x2bf71d)?JSON[_0x6fad('0xe')](_0x2bf71d):_0x2bf71d);}}_0xc824aa['on']('open',_0x42dd17);_0xc824aa['on']('message',_0x43de43);_0xc824aa['on'](_0x6fad('0x11'),_0x5b127b);_0xc824aa['on']('error',_0x520e81);});}; \ 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 115e54b..1a730d7 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 _0xe17d=['./asr','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe17d,0xa6));var _0xde17=function(_0x4bd835,_0x1aca68){_0x4bd835=_0x4bd835-0x0;var _0x3088a0=_0xe17d[_0x4bd835];return _0x3088a0;};var asr=require(_0xde17('0x0'));module[_0xde17('0x1')]={'asr':asr}; \ No newline at end of file +var _0x16b1=['./asr','exports'];(function(_0x201d8a,_0x5a753e){var _0x30aad4=function(_0xe7dff4){while(--_0xe7dff4){_0x201d8a['push'](_0x201d8a['shift']());}};_0x30aad4(++_0x5a753e);}(_0x16b1,0xd8));var _0x116b=function(_0x2d75a3,_0x4c2a7c){_0x2d75a3=_0x2d75a3-0x0;var _0x5036b1=_0x16b1[_0x2d75a3];return _0x5036b1;};var asr=require(_0x116b('0x0'));module[_0x116b('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 2220efc..1c619ca 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 _0x727f=['127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','util','net','events','EventEmitter','./error','./channel'];(function(_0x3223eb,_0x4fa281){var _0x34a459=function(_0x274352){while(--_0x274352){_0x3223eb['push'](_0x3223eb['shift']());}};_0x34a459(++_0x4fa281);}(_0x727f,0x1b2));var _0xf727=function(_0x261f7b,_0x14eabe){_0x261f7b=_0x261f7b-0x0;var _0x3f2c7f=_0x727f[_0x261f7b];return _0x3f2c7f;};'use strict';var util=require(_0xf727('0x0'));var net=require(_0xf727('0x1'));var EventEmitter=require(_0xf727('0x2'))[_0xf727('0x3')];var AGIError=require(_0xf727('0x4'));var AGIChannel=require(_0xf727('0x5'));var AGIServer=function(_0x4080d9,_0x14e146,_0x165061){var _0x169cb7=this,_0x4080d9=_0x4080d9||0x11dd,_0x14e146=_0x14e146||_0xf727('0x6'),_0x877e5d=null,_0x29e145=0x0;EventEmitter[_0xf727('0x7')](_0x169cb7);function _0x263984(){if(!_0x4080d9){_0x169cb7[_0xf727('0x8')]('error',new AGIError(_0xf727('0x9')));return![];}_0x877e5d=net[_0xf727('0xa')]();_0x877e5d['listen'](_0x4080d9,_0x14e146);_0x877e5d['on']('listening',function(){_0x169cb7[_0xf727('0x8')]('listening');});_0x877e5d['on'](_0xf727('0xb'),function(_0xba1d65){_0x877e5d[_0xf727('0xc')](function(_0x1c23c6,_0x3bb123){if(_0x1c23c6){_0x169cb7[_0xf727('0x8')](_0xf727('0xd'),new AGIError('E_AGI_SERVER_ERROR',_0x1c23c6));}else if(_0x165061&&_0x165061<0x0){_0x169cb7[_0xf727('0x8')](_0xf727('0xd'),new AGIError(_0xf727('0xe')));_0xba1d65[_0xf727('0xf')]();}else if(_0x165061&&_0x165061>0x0&&_0x165061<_0x3bb123){_0x29e145+=0x1;_0x169cb7[_0xf727('0x8')](_0xf727('0xd'),new AGIError(_0xf727('0x10'),_0x29e145));_0xba1d65[_0xf727('0xf')]();}else{var _0x2a8e9e=new AGIChannel(_0xba1d65);_0x2a8e9e['on'](_0xf727('0x11'),function(){_0x169cb7[_0xf727('0x8')](_0xf727('0xb'),_0x2a8e9e);});}});});_0x877e5d['on'](_0xf727('0xd'),function(_0x44028e){_0x169cb7[_0xf727('0x8')](_0xf727('0xd'),new AGIError(_0xf727('0x12'),_0x44028e['code']));});_0x877e5d['on']('close',function(){_0x169cb7['emit'](_0xf727('0x13'),new AGIError(_0xf727('0x14')));});}process['nextTick'](function(){_0x263984();});};util[_0xf727('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x4f5306,_0x295eec,_0x477a9c){return new AGIServer(_0x4f5306,_0x295eec,_0x477a9c);}; \ No newline at end of file +var _0xddc3=['emit','error','createServer','listening','connection','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call'];(function(_0x501f88,_0x1e0f9e){var _0x2c180c=function(_0x260b50){while(--_0x260b50){_0x501f88['push'](_0x501f88['shift']());}};_0x2c180c(++_0x1e0f9e);}(_0xddc3,0x70));var _0x3ddc=function(_0x16aba2,_0x1b6b4d){_0x16aba2=_0x16aba2-0x0;var _0x155b6a=_0xddc3[_0x16aba2];return _0x155b6a;};'use strict';var util=require(_0x3ddc('0x0'));var net=require(_0x3ddc('0x1'));var EventEmitter=require(_0x3ddc('0x2'))[_0x3ddc('0x3')];var AGIError=require(_0x3ddc('0x4'));var AGIChannel=require(_0x3ddc('0x5'));var AGIServer=function(_0x2f235e,_0x19a797,_0x25cb95){var _0x3a54b9=this,_0x2f235e=_0x2f235e||0x11dd,_0x19a797=_0x19a797||_0x3ddc('0x6'),_0x2fecfc=null,_0xf9e39c=0x0;EventEmitter[_0x3ddc('0x7')](_0x3a54b9);function _0x2b0e66(){if(!_0x2f235e){_0x3a54b9[_0x3ddc('0x8')](_0x3ddc('0x9'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x2fecfc=net[_0x3ddc('0xa')]();_0x2fecfc['listen'](_0x2f235e,_0x19a797);_0x2fecfc['on'](_0x3ddc('0xb'),function(){_0x3a54b9[_0x3ddc('0x8')]('listening');});_0x2fecfc['on'](_0x3ddc('0xc'),function(_0x223ada){_0x2fecfc[_0x3ddc('0xd')](function(_0x573602,_0x525252){if(_0x573602){_0x3a54b9[_0x3ddc('0x8')](_0x3ddc('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x573602));}else if(_0x25cb95&&_0x25cb95<0x0){_0x3a54b9[_0x3ddc('0x8')](_0x3ddc('0x9'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x223ada[_0x3ddc('0xe')]();}else if(_0x25cb95&&_0x25cb95>0x0&&_0x25cb95<_0x525252){_0xf9e39c+=0x1;_0x3a54b9['emit'](_0x3ddc('0x9'),new AGIError(_0x3ddc('0xf'),_0xf9e39c));_0x223ada['destroy']();}else{var _0xbbda87=new AGIChannel(_0x223ada);_0xbbda87['on'](_0x3ddc('0x10'),function(){_0x3a54b9[_0x3ddc('0x8')](_0x3ddc('0xc'),_0xbbda87);});}});});_0x2fecfc['on'](_0x3ddc('0x9'),function(_0x1a9f66){_0x3a54b9[_0x3ddc('0x8')](_0x3ddc('0x9'),new AGIError(_0x3ddc('0x11'),_0x1a9f66[_0x3ddc('0x12')]));});_0x2fecfc['on'](_0x3ddc('0x13'),function(){_0x3a54b9[_0x3ddc('0x8')]('close',new AGIError(_0x3ddc('0x14')));});}process[_0x3ddc('0x15')](function(){_0x2b0e66();});};util[_0x3ddc('0x16')](AGIServer,EventEmitter);module[_0x3ddc('0x17')]=function(_0x2bb48d,_0x220802,_0xb08e33){return new AGIServer(_0x2bb48d,_0x220802,_0xb08e33);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4c69342..d0c03f9 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 _0xe3d4=['no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','true','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','no\x20sms\x20account\x20configured','getSmsAccount','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','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','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','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','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','lodash','shelljs','odbc','moment','mustache','../../config/logger','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','mailRpc','prototype','getVariable','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','dsn','getUser','getSoundById','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','arg_1','createSquareRecording','uniqueid','callerid','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','uri','clear','agicommand','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','isEmpty','format','%s.%s','setVariable','split','toString','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','result','getAndSetVariable','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','audiofile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x519869,_0x5e9535){_0x519869=_0x519869-0x0;var _0x26f819=_0xe3d4[_0x519869];return _0x26f819;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x4e3d('0x0'));var sh=require(_0x4e3d('0x1'));var odbc=require(_0x4e3d('0x2'))();var rs=require('randomstring');var moment=require(_0x4e3d('0x3'));var Mustache=require(_0x4e3d('0x4'));var rp=require('request-promise');var logger=require(_0x4e3d('0x5'))('agi');var config=require(_0x4e3d('0x6'));var shared=require(_0x4e3d('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x4e3d('0x8');var recursiveMapAttributes=[_0x4e3d('0x9'),'rawBody'];var verticesWithRetry=[_0x4e3d('0xa'),_0x4e3d('0xb'),_0x4e3d('0xc')];var AGIVertices=function(_0x352616,_0x2b7f0f,_0x2968cd){this['channel']=_0x352616;this['rpc']=_0x2b7f0f;this[_0x4e3d('0xd')]=_0x2968cd;};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xf')]=function(_0x42cfab,_0xcf18eb){this[_0x4e3d('0x10')]['getVariableById'](_0x42cfab)[_0x4e3d('0x11')](function(_0x46d51d){_0xcf18eb(null,_0x46d51d?_0x46d51d[_0x4e3d('0x12')]:![]);})[_0x4e3d('0x13')](function(_0x3556ec){_0xcf18eb(_0x3556ec);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x14')]=function(_0x37ac10,_0x54debc){this[_0x4e3d('0x10')][_0x4e3d('0x15')](_0x37ac10)[_0x4e3d('0x11')](function(_0x5e0d2c){_0x54debc(null,_0x5e0d2c?_0x5e0d2c[_0x4e3d('0x12')]:![]);})[_0x4e3d('0x13')](function(_0x46bf2b){_0x54debc(_0x46bf2b);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x16')]=function(_0x364798,_0x28979d){this[_0x4e3d('0x10')]['getSquareProjectById'](_0x364798)[_0x4e3d('0x11')](function(_0x5129d5){_0x28979d(null,_0x5129d5?_0x5129d5['name']:![]);})[_0x4e3d('0x13')](function(_0x493949){_0x28979d(_0x493949);});};AGIVertices['prototype'][_0x4e3d('0x17')]=function(_0x2e37ad,_0x30d938){this[_0x4e3d('0x10')]['getSquareOdbcById'](_0x2e37ad)[_0x4e3d('0x11')](function(_0x552ca7){_0x30d938(null,_0x552ca7?_0x552ca7[_0x4e3d('0x18')]:![]);})['catch'](function(_0x170f88){_0x30d938(_0x170f88);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x19')]=function(_0x534185,_0x224c05){this[_0x4e3d('0x10')]['getUserById'](_0x534185)['then'](function(_0x18271a){_0x224c05(null,_0x18271a?_0x18271a[_0x4e3d('0x12')]:![]);})[_0x4e3d('0x13')](function(_0x49301f){_0x224c05(_0x49301f);});};AGIVertices[_0x4e3d('0xe')]['getTrunk']=function(_0xcec7a6,_0xf98d56){this[_0x4e3d('0x10')]['getTrunkById'](_0xcec7a6)[_0x4e3d('0x11')](function(_0xa6569b){_0xf98d56(null,_0xa6569b?_0xa6569b['name']:![]);})[_0x4e3d('0x13')](function(_0x21d7e4){_0xf98d56(_0x21d7e4);});};AGIVertices[_0x4e3d('0xe')]['getSound']=function(_0x727783,_0x56395b){var _0x13fa95=this;this['rpc'][_0x4e3d('0x1a')](_0x727783)[_0x4e3d('0x11')](function(_0x17c0f4){_0x56395b(null,_0x17c0f4?_0x13fa95['getSoundPath'](_0x17c0f4[_0x4e3d('0x1b')]):![]);})[_0x4e3d('0x13')](function(_0x492788){_0x56395b(_0x492788);});};AGIVertices['prototype'][_0x4e3d('0x1c')]=function(_0x333fff,_0x36621d){this['rpc'][_0x4e3d('0x1d')](_0x333fff)[_0x4e3d('0x11')](function(_0x5e0c3d){_0x36621d(null,_0x5e0c3d?_0x5e0c3d:![]);})['catch'](function(_0x2b87b5){_0x36621d(_0x2b87b5);});};AGIVertices[_0x4e3d('0xe')]['sendMailMessage']=function(_0xefeafa,_0x521cb5,_0x2b00f6){this[_0x4e3d('0xd')]['sendMailMessage'](_0xefeafa,_0x521cb5)[_0x4e3d('0x11')](function(){_0x2b00f6(null);})[_0x4e3d('0x13')](function(_0x199070){_0x2b00f6(_0x199070);});};AGIVertices['prototype'][_0x4e3d('0x1e')]=function(_0x3da357,_0x50d3db){this[_0x4e3d('0x10')][_0x4e3d('0x1f')](_0x3da357)['then'](function(_0x2ae342){if(_0x2ae342){if(_0x2ae342[_0x4e3d('0x20')]){_0x50d3db(null,[_0x2ae342[_0x4e3d('0x21')]]);}else{_0x50d3db(null,_[_0x4e3d('0x22')](_0x2ae342[_0x4e3d('0x23')],_0x4e3d('0x21')));}}else{_0x50d3db(null,![]);}})[_0x4e3d('0x13')](function(_0xc8c613){_0x50d3db(_0xc8c613);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x24')]=function(_0x352672){return util['format'](_0x4e3d('0x25'),FILES_PATH,_0x352672);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x26')]=function(_0x7aa215,_0x363027,_0xcd3499){odbc['open'](_0x7aa215,function(_0x24232c){if(_0x24232c){logger[_0x4e3d('0x27')](_0x4e3d('0x28'),_0x24232c);_0xcd3499(_0x24232c);}else{logger[_0x4e3d('0x29')](_0x4e3d('0x2a'));odbc[_0x4e3d('0x2b')](_0x363027,function(_0x37b91d,_0x16f969){if(_0x37b91d){logger[_0x4e3d('0x29')](_0x4e3d('0x2c'),_0x363027);_0xcd3499(_0x37b91d);}else{logger[_0x4e3d('0x29')](_0x4e3d('0x2d'),_0x363027);odbc[_0x4e3d('0x2e')](function(_0x107788){if(_0x107788){logger[_0x4e3d('0x27')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x107788);}_0xcd3499(null,_0x16f969);});}});}});};AGIVertices[_0x4e3d('0xe')]['getSmsAccount']=function(_0x194354,_0x31f346){this[_0x4e3d('0x10')][_0x4e3d('0x2f')](_0x194354)[_0x4e3d('0x11')](function(_0x8bbc10){_0x31f346(null,_0x8bbc10?_0x8bbc10:![]);})['catch'](function(_0x2c9f5b){_0x31f346(_0x2c9f5b);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x30')]=function(_0x5b4b89,_0x8ee96f){this['rpc']['createSmsMessage'](_0x5b4b89)[_0x4e3d('0x11')](function(_0x146227){_0x8ee96f(null,_0x146227);})[_0x4e3d('0x13')](function(_0x4f1c27){_0x8ee96f(_0x4f1c27);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x31')]=function(_0x572134,_0x3d922e,_0x5b6fe0){this[_0x4e3d('0x10')][_0x4e3d('0x31')]({'uniqueid':this[_0x4e3d('0x32')]['uniqueid'],'node':_0x572134[_0x4e3d('0x33')],'application':_0x572134['agicommand'],'data':_0x3d922e||null,'project_name':this[_0x4e3d('0x32')][_0x4e3d('0x34')],'callerid':this[_0x4e3d('0x32')]['callerid']})[_0x4e3d('0x11')](function(_0x29ca44){if(_0x5b6fe0){_0x5b6fe0(null,_0x29ca44);}})[_0x4e3d('0x13')](function(_0x8e807d){if(_0x5b6fe0){_0x5b6fe0(_0x8e807d);}});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x35')]=function(_0xee533a,_0xa3ff1f,_0x186c29,_0x454a6f){this['rpc'][_0x4e3d('0x35')]({'uniqueid':this[_0x4e3d('0x32')][_0x4e3d('0x36')],'callerid':this[_0x4e3d('0x32')][_0x4e3d('0x37')],'calleridname':this[_0x4e3d('0x32')][_0x4e3d('0x38')],'context':this[_0x4e3d('0x32')][_0x4e3d('0x39')],'extension':this[_0x4e3d('0x32')][_0x4e3d('0x3a')],'priority':this[_0x4e3d('0x32')]['priority'],'accountcode':this['channel'][_0x4e3d('0x3b')],'dnid':this['channel'][_0x4e3d('0x3c')],'projectName':this[_0x4e3d('0x32')][_0x4e3d('0x34')],'saveName':_0xa3ff1f,'filename':_0xee533a[_0x4e3d('0x3d')]||_0xa3ff1f,'savePath':_0x186c29})[_0x4e3d('0x11')](function(_0x4c04fe){_0x454a6f(null,_0x4c04fe);})[_0x4e3d('0x13')](function(_0x901bf3){_0x454a6f(_0x901bf3);});};AGIVertices['prototype']['createSquareMessage']=function(_0x504eb6,_0x5e1f2e,_0x393854,_0xba207d,_0xbaec0){this[_0x4e3d('0x10')][_0x4e3d('0x3e')]({'uniqueid':this[_0x4e3d('0x32')][_0x4e3d('0x36')],'body':_0x504eb6,'direction':_0x5e1f2e,'providerName':_0x393854,'providerResponse':_0xba207d})['then'](function(_0x2ca8b5){if(_0xbaec0){_0xbaec0(null,_0x2ca8b5);}})[_0x4e3d('0x13')](function(_0x352f8f){if(_0xbaec0){_0xbaec0(_0x352f8f);}});};AGIVertices[_0x4e3d('0xe')]['createCmContact']=function(_0x2c14cb,_0x30cdf0){this[_0x4e3d('0x10')][_0x4e3d('0x3f')]({'firstName':_['isEmpty'](_0x2c14cb[_0x4e3d('0x12')])||_[_0x4e3d('0x40')](_0x2c14cb[_0x4e3d('0x12')])?'callback_'+Math[_0x4e3d('0x41')]():_0x2c14cb[_0x4e3d('0x12')],'lastName':_['isEmpty'](_0x2c14cb['lastName'])||_[_0x4e3d('0x40')](_0x2c14cb[_0x4e3d('0x42')])?null:_0x2c14cb[_0x4e3d('0x42')],'phone':_0x2c14cb[_0x4e3d('0x43')],'ListId':_0x2c14cb[_0x4e3d('0x44')],'scheduledat':_0x2c14cb['scheduledAt'],'callbackUniqueid':this['channel'][_0x4e3d('0x36')],'tags':'callback','description':_0x4e3d('0x45')+_0x2c14cb[_0x4e3d('0x46')]['toString'](),'priority':_0x2c14cb[_0x4e3d('0x47')]})[_0x4e3d('0x11')](function(_0x5dc3a3){_0x30cdf0(null,_0x5dc3a3);})[_0x4e3d('0x13')](function(_0x518dda){_0x30cdf0(_0x518dda);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x48')]=function(_0x1dbef0,_0x5d9275){this[_0x4e3d('0x10')]['getPauseById'](_0x1dbef0)['then'](function(_0x18d4f8){_0x5d9275(null,_0x18d4f8?_0x18d4f8[_0x4e3d('0x12')]:![]);})[_0x4e3d('0x13')](function(_0x30cbb0){_0x5d9275(_0x30cbb0);});};AGIVertices[_0x4e3d('0xe')]['agentPause']=function(_0x103d81,_0x5e3da0,_0x55c001){var _0x515c9b={'role':'agent'};_0x515c9b[_0x103d81]=this[_0x4e3d('0x32')][_0x4e3d('0x37')];this[_0x4e3d('0x10')][_0x4e3d('0x49')](_0x515c9b,_0x5e3da0,this[_0x4e3d('0x32')][_0x4e3d('0x36')])[_0x4e3d('0x11')](function(_0x181921){_0x55c001(null,_[_0x4e3d('0x40')](_0x181921)?![]:!![]);})['catch'](function(_0x235b98){logger[_0x4e3d('0x27')](_0x235b98);_0x55c001(null,![]);});};AGIVertices[_0x4e3d('0xe')]['agentUnpause']=function(_0x5f150a,_0xdf0610){var _0x62e7a4={'role':_0x4e3d('0x4a')};_0x62e7a4[_0x5f150a]=this[_0x4e3d('0x32')][_0x4e3d('0x37')];this[_0x4e3d('0x10')][_0x4e3d('0x4b')](_0x62e7a4)[_0x4e3d('0x11')](function(_0x47421a){_0xdf0610(null,_[_0x4e3d('0x40')](_0x47421a)?![]:!![]);})[_0x4e3d('0x13')](function(_0x5eaba7){logger[_0x4e3d('0x27')](_0x5eaba7);_0xdf0610(null,![]);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x4c')]=function(_0x596322,_0x45d807){var _0x2ec1ba={'role':_0x4e3d('0x4a')};_0x2ec1ba[_0x596322]=this[_0x4e3d('0x32')][_0x4e3d('0x37')];this[_0x4e3d('0x10')]['agentLogout'](_0x2ec1ba)[_0x4e3d('0x11')](function(_0x2d527f){_0x45d807(null,_['isNil'](_0x2d527f)?![]:!![]);})[_0x4e3d('0x13')](function(_0x3839e0){logger['error'](_0x3839e0);_0x45d807(null,![]);});};AGIVertices['prototype'][_0x4e3d('0x4d')]=function(_0x2d9d3d,_0x700d55){var _0x57998a={'role':_0x4e3d('0x4a')};_0x57998a[_0x2d9d3d]=this['channel']['callerid'];var _0x329a0c=_0x2d9d3d!=_0x4e3d('0x4e')?util['format']('%s/%s@from-sip/n',_0x4e3d('0x4f'),this[_0x4e3d('0x32')][_0x4e3d('0x37')]):undefined;this[_0x4e3d('0x10')][_0x4e3d('0x4d')](_0x57998a,_0x329a0c)[_0x4e3d('0x11')](function(_0x272382){_0x700d55(null,_['isNil'](_0x272382)?![]:!![]);})[_0x4e3d('0x13')](function(_0x1fef79){logger[_0x4e3d('0x27')](_0x1fef79);_0x700d55(null,![]);});};AGIVertices[_0x4e3d('0xe')]['shellCommand']=function(_0x5cd6a3,_0x41f6db){sh[_0x4e3d('0x50')](_[_0x4e3d('0x51')](_0x5cd6a3),function(_0x160d3f,_0x4c8450){var _0xbc23cf=_0x4c8450[_0x4e3d('0x52')](/(\r\n|\n|\r)/gm,'');_0x41f6db(null,_0xbc23cf);});};AGIVertices['prototype'][_0x4e3d('0x53')]=function(_0x8bc195,_0x29c290){scripts[_0x4e3d('0x53')](_0x8bc195[_0x4e3d('0x54')],_0x8bc195[_0x4e3d('0x55')]||_0x4e3d('0x56'),_0x8bc195[_0x4e3d('0x56')],_0x8bc195[_0x4e3d('0x57')]||_0x4e3d('0x58'),_0x8bc195[_0x4e3d('0x59')]||_0x4e3d('0x5a'),_0x8bc195[_0x4e3d('0x5b')]||_0x4e3d('0x5c'))['then'](function(_0x209313){_0x29c290(null,_0x209313);})[_0x4e3d('0x13')](function(_0x11b241){_0x29c290(_0x11b241);});};AGIVertices['prototype'][_0x4e3d('0x5d')]=function(_0x373566,_0x1b45b9){scripts[_0x4e3d('0x5d')](_0x373566[_0x4e3d('0x56')],_0x373566[_0x4e3d('0x5e')]||'en',0x1)[_0x4e3d('0x11')](function(_0x2725e0){_0x1b45b9(null,_0x2725e0);})[_0x4e3d('0x13')](function(_0x577bfc){_0x1b45b9(_0x577bfc);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x5f')]=function(_0x40ee1a,_0x2d6198){var _0x5483c5={'uri':_0x40ee1a['url'],'method':_0x40ee1a[_0x4e3d('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x40ee1a[_0x4e3d('0x61')])===_0x4e3d('0x62')&&parseInt(_0x40ee1a['timeout'])>=0x1?parseInt(_0x40ee1a[_0x4e3d('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x4e3d('0x63')](['POST',_0x4e3d('0x64')],_0x5483c5[_0x4e3d('0x60')][_0x4e3d('0x65')]())){try{_0x5483c5[_0x4e3d('0x66')]=_0x40ee1a['rawBody']?JSON['parse'](_0x40ee1a['rawBody']):{};}catch(_0x363f71){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x363f71);}}try{_0x5483c5['headers']=_0x40ee1a[_0x4e3d('0x9')]?JSON[_0x4e3d('0x67')](_0x40ee1a[_0x4e3d('0x9')]):{};}catch(_0x41c684){logger[_0x4e3d('0x27')](_0x4e3d('0x68'),_0x41c684);}if(_0x40ee1a[_0x4e3d('0x69')]){try{var _0x37dac9=require(_0x40ee1a[_0x4e3d('0x69')])[_0x4e3d('0x6a')](this,_0x5483c5);_0x5483c5['uri']=Mustache[_0x4e3d('0x6b')](_0x40ee1a[_0x4e3d('0x6c')],_0x37dac9,{},['$$','$$']);if(_0x5483c5[_0x4e3d('0x6d')]){_0x5483c5[_0x4e3d('0x6d')]=JSON[_0x4e3d('0x67')](Mustache[_0x4e3d('0x6b')](JSON[_0x4e3d('0x6e')](_0x5483c5[_0x4e3d('0x6d')]),_0x37dac9,{},['$$','$$']));}if(_0x5483c5['body']){_0x5483c5[_0x4e3d('0x66')]=JSON[_0x4e3d('0x67')](Mustache[_0x4e3d('0x6b')](JSON[_0x4e3d('0x6e')](_0x5483c5['body']),_0x37dac9,{},['$$','$$']));}}catch(_0x18975b){logger['error'](_0x4e3d('0x6f'),_0x18975b);}}rp(_0x5483c5)[_0x4e3d('0x11')](function(_0x3a3ebc){var _0x2ceb09={'statusCode':_0x3a3ebc[_0x4e3d('0x70')]||0xc8,'statusMessage':_0x3a3ebc[_0x4e3d('0x71')]||'OK','headers':_0x3a3ebc[_0x4e3d('0x6d')]||{},'body':_0x3a3ebc[_0x4e3d('0x66')]||{}};_0x2d6198(null,_0x2ceb09);})[_0x4e3d('0x13')](function(_0xf29f4c){var _0x5adba5={'statusCode':_0xf29f4c[_0x4e3d('0x70')]||0x1f4,'statusMessage':_0xf29f4c[_0x4e3d('0x72')]||_0x4e3d('0x73'),'headers':_0xf29f4c[_0x4e3d('0x74')][_0x4e3d('0x6d')]||{},'body':_0xf29f4c[_0x4e3d('0x74')][_0x4e3d('0x66')]||{}};_0x2d6198(null,_0x5adba5);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x75')]=function(_0x21f4b1,_0x1455cb){scripts[_0x4e3d('0x75')](this[_0x4e3d('0x32')][_0x4e3d('0x36')],_0x21f4b1[_0x4e3d('0x76')],_0x21f4b1[_0x4e3d('0x56')],_0x21f4b1[_0x4e3d('0x77')]||'en')['then'](function(_0x54af5b){_0x1455cb(null,_0x54af5b);})[_0x4e3d('0x13')](function(_0x14e295){_0x1455cb(_0x14e295);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x78')]=function(_0x442ba7,_0x304ce1){scripts[_0x4e3d('0x78')](this[_0x4e3d('0x32')][_0x4e3d('0x36')],_0x442ba7[_0x4e3d('0x79')],_0x442ba7[_0x4e3d('0x7a')],_0x442ba7[_0x4e3d('0x7b')],_0x442ba7[_0x4e3d('0x56')],_0x442ba7['dialogflowV2_language']||'en')['then'](function(_0x5b8bc1){_0x304ce1(null,_0x5b8bc1);})[_0x4e3d('0x13')](function(_0x14ec13){_0x304ce1(_0x14ec13);});};AGIVertices['prototype']['sestekNDA']=function(_0x10b79b,_0x1eb37d){scripts[_0x4e3d('0x7c')](this[_0x4e3d('0x32')],_0x10b79b)['then'](function(_0x4d58b2){_0x1eb37d(null,_0x4d58b2);})['catch'](function(_0x102132){_0x1eb37d(_0x102132);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x7d')]=function(_0x2e4d32,_0x5ad2e3){scripts['ispeechTTS'](_0x2e4d32[_0x4e3d('0x76')],_0x2e4d32['text'],_0x2e4d32[_0x4e3d('0x7e')]||'en-US',_0x2e4d32['speed'])[_0x4e3d('0x11')](function(_0x48dbf5){_0x5ad2e3(null,_0x48dbf5);})[_0x4e3d('0x13')](function(_0x253db8){_0x5ad2e3(_0x253db8);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x7f')]=function(_0x298fc6,_0x415708,_0x224874){scripts[_0x4e3d('0x7f')](_0x415708,_0x298fc6['key'],_0x298fc6[_0x4e3d('0x80')]||'en-US',this['isConfigured'](_0x298fc6[_0x4e3d('0x81')])?_0x298fc6[_0x4e3d('0x81')]:undefined)[_0x4e3d('0x11')](function(_0xd80c52){_0x224874(null,_0xd80c52);})[_0x4e3d('0x13')](function(_0x5f0bd4){_0x224874(_0x5f0bd4);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x82')]=function(_0x27a067,_0x3355d5){scripts['awsPolly'](_0x27a067['aws_access_key_id'],_0x27a067[_0x4e3d('0x83')],_0x27a067[_0x4e3d('0x84')],_0x27a067[_0x4e3d('0x85')]||_0x4e3d('0x86'),_0x27a067[_0x4e3d('0x56')],_0x27a067[_0x4e3d('0x87')]||'text')[_0x4e3d('0x11')](function(_0x251893){_0x3355d5(null,_0x251893);})[_0x4e3d('0x13')](function(_0x3621b5){_0x3355d5(_0x3621b5);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x88')]=function(_0x9fa6d6,_0x2b1928){scripts[_0x4e3d('0x88')](this[_0x4e3d('0x32')][_0x4e3d('0x36')],_0x9fa6d6['aws_access_key_id'],_0x9fa6d6['aws_secret_access_key'],_0x9fa6d6[_0x4e3d('0x89')],_0x9fa6d6[_0x4e3d('0x56')],_0x9fa6d6['aws_bot_name'])[_0x4e3d('0x11')](function(_0x5b8a41){_0x2b1928(null,_0x5b8a41);})['catch'](function(_0x36d500){_0x2b1928(_0x36d500);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x8a')]=function(_0x5574f0,_0x270fa7,_0x45ea50){scripts[_0x4e3d('0x8a')](_0x270fa7,_0x5574f0[_0x4e3d('0x76')],_0x5574f0[_0x4e3d('0x8b')]||_0x4e3d('0x58'))[_0x4e3d('0x11')](function(_0x3fa33d){_0x45ea50(null,_0x3fa33d);})['catch'](function(_0xd423af){_0x45ea50(_0xd423af);});};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x8c')]=function(_0x2aa83d,_0x295301,_0x1e9acf){scripts['tildeASR'](_0x295301,_0x2aa83d[_0x4e3d('0x8d')],_0x2aa83d['appsecret'],_0x2aa83d[_0x4e3d('0x8e')])[_0x4e3d('0x11')](function(_0x666dab){_0x1e9acf(null,_0x666dab);})['catch'](function(_0x2938e7){_0x1e9acf(_0x2938e7);});};AGIVertices['prototype'][_0x4e3d('0x8f')]=function(_0x15d286){var _0x2651ac=_['includes'](verticesWithRetry,_0x15d286[_0x4e3d('0x90')])?_0x15d286:_['clone'](_0x15d286);for(var _0x25eb1c in _0x2651ac){if(_0x2651ac[_0x4e3d('0x91')](_0x25eb1c)){if(_0x2651ac[_0x25eb1c]&&_[_0x4e3d('0x92')](_0x2651ac[_0x25eb1c])){if(_['includes'](recursiveMapAttributes,_0x25eb1c)){_0x2651ac[_0x25eb1c]=this[_0x4e3d('0x93')](_0x2651ac[_0x25eb1c]);}else{_0x2651ac[_0x25eb1c]=this[_0x4e3d('0x94')](_0x2651ac[_0x25eb1c]);}}}}return _0x2651ac;};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x95')]=function(_0x57d217){for(var _0x41811f in _0x57d217){if(_0x57d217['hasOwnProperty'](_0x41811f)){if(_[_0x4e3d('0x96')](_0x57d217[_0x41811f])){this[_0x4e3d('0x95')](_0x57d217[_0x41811f]);}else if(_[_0x4e3d('0x97')](_0x57d217[_0x41811f])){for(var _0x307821=0x0;_0x307821<_0x57d217[_0x41811f][_0x4e3d('0x98')];_0x307821++){this[_0x4e3d('0x95')](_0x57d217[_0x41811f][_0x307821]);}}else if(_['isString'](_0x57d217[_0x41811f])){_0x57d217[_0x41811f]=this[_0x4e3d('0x94')](_0x57d217[_0x41811f]);}}}};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x99')]=function(_0x110780,_0xb3afc9){for(var _0x25fa37 in _0x110780){if(_0x110780[_0x4e3d('0x91')](_0x25fa37)){if(_[_0x4e3d('0x96')](_0x110780[_0x25fa37])){if(!_[_0x4e3d('0x9a')](_0x110780[_0x25fa37])){this[_0x4e3d('0x99')](_0x110780[_0x25fa37],util[_0x4e3d('0x9b')](_0x4e3d('0x9c'),_0xb3afc9,_0x25fa37));}}else if(_[_0x4e3d('0x97')](_0x110780[_0x25fa37])){for(var _0x38868b=0x0;_0x38868b<_0x110780[_0x25fa37][_0x4e3d('0x98')];_0x38868b++){this['saveRestApiResult'](_0x110780[_0x25fa37][_0x38868b],util[_0x4e3d('0x9b')](_0x4e3d('0x9c'),_0xb3afc9,_0x25fa37+'['+_0x38868b+']'));}}else{if(!_['isNil'](_0x110780[_0x25fa37])){this['channel'][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')](_0x4e3d('0x9c'),_0xb3afc9,_0x25fa37),_0x110780[_0x25fa37]);}}}}};AGIVertices['prototype'][_0x4e3d('0x93')]=function(_0x2b906d){try{var _0x266f99=JSON[_0x4e3d('0x67')](_0x2b906d);this[_0x4e3d('0x95')](_0x266f99);return JSON[_0x4e3d('0x6e')](_0x266f99);}catch(_0x47f7ac){return this[_0x4e3d('0x94')](_0x2b906d);}};AGIVertices[_0x4e3d('0xe')]['replaceAllVariables']=function(_0x1dd627){var _0x12323f=_0x1dd627[_0x4e3d('0x9e')]('{');for(var _0x4bfaa7=0x1;_0x4bfaa7<_0x12323f[_0x4e3d('0x98')];_0x4bfaa7+=0x1){var _0x56474d=_0x12323f[_0x4bfaa7]['split']('}');if(_0x56474d[_0x4e3d('0x98')]>0x1){_0x1dd627=_0x1dd627['replaceAll']('{'+_0x56474d[0x0]+'}',this[_0x4e3d('0x32')][_0x4e3d('0xf')](_0x56474d[0x0])['extra']||_0x56474d[0x0]);}}if(_0x12323f['length']===0x1){return _0x1dd627[_0x4e3d('0x9f')]();}return this[_0x4e3d('0x94')](_0x1dd627);};AGIVertices[_0x4e3d('0xe')]['getAndSetVariable']=function(_0xe95ddc,_0x421fcf){var _0x2af483=this['channel'][_0x4e3d('0xf')](_0xe95ddc);if(_0x2af483['result']===-0x1){return _0x2af483;}logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0xa0'),_0x421fcf,_0x2af483[_0x4e3d('0xa1')]));return this[_0x4e3d('0x32')][_0x4e3d('0x9d')](_0x421fcf,_0x2af483[_0x4e3d('0xa1')]);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xa2')]=function(_0x20eb3d){return _0x20eb3d&&_0x20eb3d!=='0'&&_0x20eb3d!=='-1'&&_0x20eb3d!=='';};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xa3')]=function(_0x277a8d){this[_0x4e3d('0x31')]['sync'](this,_0x277a8d,'-');_0x277a8d[_0x4e3d('0xa4')]=_0x277a8d[_0x4e3d('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x4e3d('0xa5')]=function(_0x36ad81){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0xa6'),_0x36ad81[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x36ad81[_0x4e3d('0x56')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xa8'));}var _0x1203a3='\x22'+_0x36ad81[_0x4e3d('0x56')]+'\x22';if(this[_0x4e3d('0xa2')](_0x36ad81['options'])){_0x1203a3+=','+_0x36ad81[_0x4e3d('0x74')];}var _0x214567=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0xa9'),_0x1203a3);if(_0x214567['result']===-0x1){return _0x214567;}return this[_0x4e3d('0x32')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x1203a3));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xaa')]=function(_0x21f929){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0xab'),_0x21f929['label']));if(!this[_0x4e3d('0xa2')](_0x21f929[_0x4e3d('0xac')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x396745=_0x21f929['grammar'];if(this[_0x4e3d('0xa2')](_0x21f929['options'])){_0x396745+=','+_0x21f929[_0x4e3d('0x74')];}var _0x2902ca=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0xad'),_0x396745);if(_0x2902ca[_0x4e3d('0xae')]===-0x1){return _0x2902ca;}var _0x2cf647=this[_0x4e3d('0xaf')]('RECOG_CONFIDENCE()',_0x4e3d('0xb0'));if(_0x2cf647['result']===-0x1){return _0x2cf647;}var _0x198ee7=this['getAndSetVariable']('RECOG_INPUT()',_0x4e3d('0xb1'));if(_0x198ee7[_0x4e3d('0xae')]===-0x1){return _0x198ee7;}var _0x2b5aa6=this[_0x4e3d('0xaf')](_0x4e3d('0xb2'),_0x4e3d('0xb3'));if(_0x2b5aa6[_0x4e3d('0xae')]===-0x1){return _0x2b5aa6;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xb4'),_0x396745));};AGIVertices['prototype'][_0x4e3d('0xb5')]=function(_0x40083f){logger['info'](util['format'](_0x4e3d('0xb6'),_0x40083f[_0x4e3d('0x33')]));return this[_0x4e3d('0x32')][_0x4e3d('0xb5')]([_0x40083f['command'],_0x40083f[_0x4e3d('0xb7')]]);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xb8')]=function(_0xa4e200){logger['info'](util['format'](_0x4e3d('0xb9'),_0xa4e200[_0x4e3d('0x33')]));if(this[_0x4e3d('0xa2')](_0xa4e200[_0x4e3d('0x61')])){logger['info'](util[_0x4e3d('0x9b')](_0x4e3d('0xba'),_0xa4e200[_0x4e3d('0x61')]));var _0x5224bd=this[_0x4e3d('0x32')][_0x4e3d('0xbb')](_0xa4e200['timeout']);if(_0x5224bd['result']===-0x1){return _0x5224bd;}}return this[_0x4e3d('0x32')][_0x4e3d('0xb8')]();};AGIVertices['prototype'][_0x4e3d('0xbc')]=function(_0x3aad02){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0xbd'),_0x3aad02[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x3aad02[_0x4e3d('0x44')])){return this[_0x4e3d('0x32')]['error'](_0x3aad02,_0x4e3d('0xbe'));}_0x3aad02[_0x4e3d('0x46')]=moment();if(this[_0x4e3d('0xa2')](_0x3aad02[_0x4e3d('0xbf')])){_0x3aad02[_0x4e3d('0x46')]=moment()['add'](_0x3aad02['delay'],_0x4e3d('0xc0'));}if(!this[_0x4e3d('0xa2')](_0x3aad02[_0x4e3d('0x47')])){_0x3aad02[_0x4e3d('0x47')]=0x2;}this[_0x4e3d('0x3f')][_0x4e3d('0x6a')](this,_0x3aad02);return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xc1'),_0x3aad02[_0x4e3d('0x43')],_0x3aad02[_0x4e3d('0x44')],_0x3aad02['scheduledAt']));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xc2')]=function(_0x5bced3){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0xc3'),_0x5bced3[_0x4e3d('0x33')]));var _0x2ec07b=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x5bced3[_0x4e3d('0xc4')],_0x5bced3['options']);if(_0x2ec07b[_0x4e3d('0xae')]===-0x1){return _0x2ec07b;}return this[_0x4e3d('0x32')]['noop'](util['format'](_0x4e3d('0xc5'),_0x5bced3[_0x4e3d('0xc4')],_0x5bced3[_0x4e3d('0x74')]));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xc6')]=function(_0x212694){logger['info'](util[_0x4e3d('0x9b')](_0x4e3d('0xc7'),_0x212694[_0x4e3d('0x33')]));if(!this['isConfigured'](_0x212694[_0x4e3d('0x56')])){return this['channel'][_0x4e3d('0xa7')]('no\x20text\x20configured');}var _0xe8cb07='\x22'+_0x212694['text']+'\x22';if(this[_0x4e3d('0xa2')](_0x212694['options'])){_0xe8cb07+=','+_0x212694[_0x4e3d('0x74')];}var _0x1e2cad=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0xa9'),_0xe8cb07);if(_0x1e2cad[_0x4e3d('0xae')]===-0x1){return _0x1e2cad;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')]('Executed\x20command\x20MRCPSynth\x20%s',_0xe8cb07));};AGIVertices['prototype']['sestektts']=function(_0x349a53){logger['info'](util[_0x4e3d('0x9b')](_0x4e3d('0xc8'),_0x349a53[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x349a53[_0x4e3d('0x56')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xa8'));}var _0x7d123b='\x22'+_0x349a53[_0x4e3d('0x56')]+'\x22';if(this[_0x4e3d('0xa2')](_0x349a53[_0x4e3d('0x74')])){_0x7d123b+=','+_0x349a53[_0x4e3d('0x74')];}var _0x1f7af3=this['channel']['exec'](_0x4e3d('0xa9'),_0x7d123b);if(_0x1f7af3[_0x4e3d('0xae')]===-0x1){return _0x1f7af3;}return this[_0x4e3d('0x32')]['noop'](util[_0x4e3d('0x9b')](_0x4e3d('0xc9'),_0x7d123b));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xca')]=function(_0x31f77e){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x31f77e[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x31f77e['grammar'])){return this[_0x4e3d('0x32')]['noop']('no\x20grammar\x20configured');}var _0x5526fc=_0x31f77e[_0x4e3d('0xac')];if(this[_0x4e3d('0xa2')](_0x31f77e['options'])){_0x5526fc+=','+_0x31f77e[_0x4e3d('0x74')];}var _0x2e1788=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0xad'),_0x5526fc);if(_0x2e1788[_0x4e3d('0xae')]===-0x1){return _0x2e1788;}var _0x424498=this[_0x4e3d('0xaf')](_0x4e3d('0xcb'),'LUMENVOX_ASR_CONFIDENCE');if(_0x424498[_0x4e3d('0xae')]===-0x1){return _0x424498;}var _0x1ccc33=this[_0x4e3d('0xaf')](_0x4e3d('0xcc'),_0x4e3d('0xcd'));if(_0x1ccc33['result']===-0x1){return _0x1ccc33;}var _0x177b64=this[_0x4e3d('0xaf')](_0x4e3d('0xb2'),_0x4e3d('0xce'));if(_0x177b64[_0x4e3d('0xae')]===-0x1){return _0x177b64;}return this['channel'][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xb4'),_0x5526fc));};AGIVertices['prototype']['sestekasr']=function(_0xe60158){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0xe60158[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0xe60158[_0x4e3d('0xac')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x1a8ea5=_0xe60158[_0x4e3d('0xac')];if(this[_0x4e3d('0xa2')](_0xe60158[_0x4e3d('0x74')])){_0x1a8ea5+=','+_0xe60158[_0x4e3d('0x74')];}var _0x331adb=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0xad'),_0x1a8ea5);if(_0x331adb['result']===-0x1){return _0x331adb;}var _0x58195a=this['getAndSetVariable'](_0x4e3d('0xcb'),_0x4e3d('0xcf'));if(_0x58195a[_0x4e3d('0xae')]===-0x1){return _0x58195a;}var _0x17c745=this['getAndSetVariable'](_0x4e3d('0xcc'),'SESTEK_ASR_TRANSCRIPT');if(_0x17c745['result']===-0x1){return _0x17c745;}var _0xb3be28=this['getAndSetVariable'](_0x4e3d('0xb2'),_0x4e3d('0xd0'));if(_0xb3be28[_0x4e3d('0xae')]===-0x1){return _0xb3be28;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xb4'),_0x1a8ea5));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xd1')]=function(_0x48718f){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0xd2'),_0x48718f['label']));if(!this[_0x4e3d('0xa2')](_0x48718f[_0x4e3d('0xd3')])){return this['channel']['error'](_0x48718f,_0x4e3d('0xd4'));}var _0x4cac36=this[_0x4e3d('0x17')][_0x4e3d('0x6a')](this,_0x48718f[_0x4e3d('0xd3')]);if(!_0x4cac36){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x48718f,'no\x20odbc\x20database\x20found');}if(!this[_0x4e3d('0xa2')](_0x48718f[_0x4e3d('0x2b')])){return this['channel'][_0x4e3d('0x27')](_0x48718f,_0x4e3d('0xd5'));}var _0x34ef6f=_0x48718f[_0x4e3d('0x2b')][_0x4e3d('0x52')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util['format'](_0x4e3d('0xd6'),_0x34ef6f));var _0x108d5a=this[_0x4e3d('0x26')][_0x4e3d('0x6a')](this,_0x4cac36,_0x34ef6f);this['createSquareDetailsReport'][_0x4e3d('0x6a')](this,_0x48718f,_0x34ef6f);if(!this['isConfigured'](_0x48718f['variable_id'])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xd7'));}var _0x1834e0=this[_0x4e3d('0xf')][_0x4e3d('0x6a')](this,_0x48718f[_0x4e3d('0xd8')]);if(!_0x1834e0){return this['channel'][_0x4e3d('0x27')](_0x48718f,'no\x20variable\x20found');}var _0x7841de=this;_0x108d5a['forEach'](function(_0x538fbd,_0x3ea463){Object[_0x4e3d('0xd9')](_0x538fbd)['forEach'](function(_0x173dc2){_0x7841de[_0x4e3d('0x32')][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')](_0x4e3d('0xda'),_0x1834e0,_0x3ea463,_0x173dc2),_0x538fbd[_0x173dc2]);});});this[_0x4e3d('0x32')]['setVariable'](util['format'](_0x4e3d('0xdb'),_0x1834e0),_0x108d5a['length']);return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format']('variable\x20%s\x20set',_0x1834e0));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xdc')]=function(_0x50867e){logger[_0x4e3d('0xdd')](util[_0x4e3d('0x9b')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x50867e[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x50867e[_0x4e3d('0xde')])){return this['channel'][_0x4e3d('0x27')](_0x50867e,_0x4e3d('0xdf'));}var _0x4f477e=this[_0x4e3d('0x19')]['sync'](this,_0x50867e[_0x4e3d('0xde')]);if(!_0x4f477e){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x50867e,_0x4e3d('0xe0'));}var _0x2f90e9=this[_0x4e3d('0x32')]['exec'](_0x4e3d('0xe1'),[util[_0x4e3d('0x9b')]('SIP/%s',_0x4f477e),_0x50867e[_0x4e3d('0x61')],_0x50867e[_0x4e3d('0xe2')],_0x50867e[_0x4e3d('0x6c')]]);if(_0x2f90e9[_0x4e3d('0xae')]===-0x1){return _0x2f90e9;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xe3'),_0x4e3d('0xe1')));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xe4')]=function(_0x4f3e61){logger['info'](util[_0x4e3d('0x9b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x4f3e61['label']));if(!this['isConfigured'](_0x4f3e61[_0x4e3d('0x76')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xe5'));}if(!this['isConfigured'](_0x4f3e61[_0x4e3d('0x56')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xa8'));}this['channel'][_0x4e3d('0xe6')]=!![];this['createSquareDetailsReport'](_0x4f3e61);this[_0x4e3d('0x3e')](_0x4f3e61[_0x4e3d('0x56')],'in','','');this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xe7'),_0x4f3e61['text']));var _0x6a168=this[_0x4e3d('0x75')][_0x4e3d('0x6a')](this,_0x4f3e61);if(_0x6a168){for(var _0x2e400b in _0x6a168){if(_0x6a168[_0x4e3d('0x91')](_0x2e400b)){this[_0x4e3d('0x32')][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')](_0x4e3d('0xe8'),_0x2e400b[_0x4e3d('0x65')]()),_0x6a168[_0x2e400b]);}}this['createSquareMessage'](_0x6a168['speech'],_0x4e3d('0xe9'),_0x4e3d('0xe4'),'');return this['channel'][_0x4e3d('0xa7')](util['format'](_0x4e3d('0xea'),_0x6a168[_0x4e3d('0xeb')]));}return this['channel'][_0x4e3d('0x27')](_0x4f3e61,_0x4e3d('0xec'));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xed')]=function(_0x259747){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x259747['label']));if(!this[_0x4e3d('0xa2')](_0x259747['dialogflowV2_project_id'])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')]('no\x20project_id\x20configured');}if(!this[_0x4e3d('0xa2')](_0x259747[_0x4e3d('0x7a')])){return this[_0x4e3d('0x32')]['noop'](_0x4e3d('0xee'));}if(!this[_0x4e3d('0xa2')](_0x259747['private_key'])){return this[_0x4e3d('0x32')]['noop']('no\x20private_key\x20configured');}if(!this[_0x4e3d('0xa2')](_0x259747['dialogflowV2_language'])){return this['channel'][_0x4e3d('0xa7')](_0x4e3d('0xef'));}if(!this[_0x4e3d('0xa2')](_0x259747['text'])){return this[_0x4e3d('0x32')]['noop']('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x4e3d('0x31')](_0x259747);this[_0x4e3d('0x3e')](_0x259747['text'],'in','','');this['channel'][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xf0'),_0x259747[_0x4e3d('0x56')]));var _0x3d2f00=this[_0x4e3d('0x78')][_0x4e3d('0x6a')](this,_0x259747);if(_0x3d2f00){for(var _0x203852 in _0x3d2f00){if(_0x3d2f00[_0x4e3d('0x91')](_0x203852)){if(_0x203852!=='providerResponse'){this[_0x4e3d('0x32')][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')](_0x4e3d('0xe8'),_0x203852[_0x4e3d('0x65')]()),_0x3d2f00[_0x203852]);}}}this[_0x4e3d('0x3e')](_0x3d2f00['speech'],_0x4e3d('0xe9'),_0x4e3d('0xed'),_0x3d2f00[_0x4e3d('0xf1')]);return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xf2'),_0x3d2f00[_0x4e3d('0xeb')]));}return this[_0x4e3d('0x32')]['error'](_0x259747,_0x4e3d('0xf3'));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xf4')]=function(_0x206e2e){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x206e2e[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x206e2e['ndauth_url'])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xf5'));}if(!this[_0x4e3d('0xa2')](_0x206e2e[_0x4e3d('0xf6')])){return this['channel'][_0x4e3d('0xa7')](_0x4e3d('0xf7'));}if(!this['isConfigured'](_0x206e2e[_0x4e3d('0xf8')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xf9'));}if(!this[_0x4e3d('0xa2')](_0x206e2e[_0x4e3d('0xfa')])){return this[_0x4e3d('0x32')]['noop'](_0x4e3d('0xa8'));}this[_0x4e3d('0x32')]['bot']=!![];this[_0x4e3d('0x31')](_0x206e2e);this['createSquareMessage'](_0x206e2e[_0x4e3d('0x56')],'in','','');this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0xfb'),_0x206e2e[_0x4e3d('0x56')]));var _0x41230a=this[_0x4e3d('0x7c')][_0x4e3d('0x6a')](this,_0x206e2e);if(_0x41230a){for(var _0xee8572 in _0x41230a){if(_0x41230a['hasOwnProperty'](_0xee8572)){this[_0x4e3d('0x32')][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')]('SESTEK_NDA_%s',_0xee8572[_0x4e3d('0x65')]()),_0x41230a[_0xee8572]);}}this['createSquareMessage'](_0x41230a['speech'],'out','sesteknda','');if(_0x41230a['audiofile']){this['channel']['noop'](util['format'](_0x4e3d('0xfc'),_0x41230a['audiofile']));var _0x472adb=this[_0x4e3d('0x32')][_0x4e3d('0xfd')](_0x41230a[_0x4e3d('0xfe')]);try{fs[_0x4e3d('0xff')](_0x41230a[_0x4e3d('0xfe')]+'.wav');}catch(_0x12c320){logger[_0x4e3d('0x27')](_0x12c320);}return _0x472adb;}else{return this[_0x4e3d('0x32')]['noop'](util['format'](_0x4e3d('0x100'),_0x41230a[_0x4e3d('0xeb')]));}}return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x206e2e,_0x4e3d('0x101'));};AGIVertices[_0x4e3d('0xe')]['end']=function(_0x5f2501){logger['info'](util[_0x4e3d('0x9b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5f2501[_0x4e3d('0x33')]));return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0x102'));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x103')]=function(_0x2bf255){logger['info'](util[_0x4e3d('0x9b')](_0x4e3d('0x104'),_0x2bf255[_0x4e3d('0x33')]));var _0x140e70='';if(_0x2bf255[_0x4e3d('0x105')]){if(!this[_0x4e3d('0xa2')](_0x2bf255[_0x4e3d('0x105')])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x2bf255,_0x4e3d('0x106'));}else{var _0x8a9c0b=parseInt(_0x2bf255[_0x4e3d('0x105')],0xa);if(isNaN(_0x8a9c0b)){_0x140e70=_0x2bf255['trunk_id'];}else{_0x140e70=this[_0x4e3d('0x107')][_0x4e3d('0x6a')](this,_0x2bf255[_0x4e3d('0x105')]);if(!_0x140e70){return this['channel']['error'](_0x2bf255,_0x4e3d('0x108'));}}}}else if(_0x2bf255['trunk_name']){_0x140e70=_0x2bf255[_0x4e3d('0x109')];}else{return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x2bf255,'no\x20trunk\x20selected');}var _0x157015=this['channel'][_0x4e3d('0x50')](_0x4e3d('0xe1'),[util[_0x4e3d('0x9b')](_0x4e3d('0x10a'),_0x140e70,_0x2bf255[_0x4e3d('0x43')]),_0x2bf255['timeout'],_0x2bf255['opts'],_0x2bf255[_0x4e3d('0x6c')]]);if(_0x157015['result']===-0x1){return _0x157015;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format'](_0x4e3d('0xe3'),'DIAL'));};AGIVertices[_0x4e3d('0xe')]['finally']=function(_0x1d7af2){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x10b'),_0x1d7af2[_0x4e3d('0x33')]));return this[_0x4e3d('0x32')][_0x4e3d('0xa7')]('finally');};AGIVertices['prototype'][_0x4e3d('0xb')]=function(_0x9ba83f){logger['info'](util[_0x4e3d('0x9b')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x9ba83f[_0x4e3d('0x33')]));if(_0x9ba83f[_0x4e3d('0xa4')]===0x0){return this[_0x4e3d('0xa3')](_0x9ba83f);}_0x9ba83f['retry']-=0x1;if(!this['isConfigured'](_0x9ba83f[_0x4e3d('0x10c')])){return this[_0x4e3d('0x32')]['error'](_0x9ba83f,_0x4e3d('0x10d'));}var _0x226b33=this[_0x4e3d('0x10e')][_0x4e3d('0x6a')](this,_0x9ba83f['file_id']);if(!_0x226b33){return this[_0x4e3d('0x32')]['error'](_0x9ba83f,_0x4e3d('0x10f'));}if(!this[_0x4e3d('0xa2')](_0x9ba83f['variable_id'])){return this['channel']['error'](_0x4e3d('0xd7'));}var _0x4a85f6=this[_0x4e3d('0x32')]['getData'](_0x226b33,_0x9ba83f[_0x4e3d('0x110')],_0x9ba83f[_0x4e3d('0x111')]);var _0xbf38dc=_0x4a85f6[_0x4e3d('0xae')]?_0x4a85f6[_0x4e3d('0xae')][_0x4e3d('0x9f')]():'';logger[_0x4e3d('0x29')](_0x4e3d('0x112'),JSON['stringify'](_0x4a85f6));if(_0x4a85f6[_0x4e3d('0xae')]===-0x1){this[_0x4e3d('0x31')][_0x4e3d('0x6a')](this,_0x9ba83f,_0xbf38dc);return _0x4a85f6;}else if(_0x4a85f6['extra']===_0x4e3d('0x61')){_0x4a85f6[_0x4e3d('0xae')]=_0xbf38dc[_0x4e3d('0x98')]>=parseInt(_0x9ba83f[_0x4e3d('0x113')])?'x':'i';}else{_0x4a85f6[_0x4e3d('0xae')]=_0xbf38dc[_0x4e3d('0x98')]>=parseInt(_0x9ba83f['mindigit'])&&_0xbf38dc[_0x4e3d('0x98')]<=parseInt(_0x9ba83f[_0x4e3d('0x111')])?'x':'i';}var _0xbfc3e1=this[_0x4e3d('0xf')]['sync'](this,_0x9ba83f[_0x4e3d('0xd8')]);if(!_0xbfc3e1){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x9ba83f,_0x4e3d('0x114'));}this[_0x4e3d('0x32')][_0x4e3d('0x9d')](_0xbfc3e1,_0xbf38dc);if(this['isConfigured'](_0x9ba83f['hiddendigitsnum'])){var _0x19e27a=parseInt(_0x9ba83f[_0x4e3d('0x115')],0xa);var _0x227b84=rs['generate']({'charset':'*','length':_0x19e27a});var _0x3b9aa4=_0xbf38dc['length'];if(_0x3b9aa4>0x0){if(_0x3b9aa4>_0x19e27a){this[_0x4e3d('0x31')][_0x4e3d('0x6a')](this,_0x9ba83f,_0x9ba83f[_0x4e3d('0x116')]===_0x4e3d('0x117')?_0x227b84+_0xbf38dc[_0x4e3d('0x118')](_0x19e27a):_0xbf38dc['substr'](0x0,_0x3b9aa4-_0x19e27a)+_0x227b84);}else{this[_0x4e3d('0x31')]['sync'](this,_0x9ba83f,rs[_0x4e3d('0x119')]({'charset':'*','length':_0x3b9aa4}));}}else{this[_0x4e3d('0x31')][_0x4e3d('0x6a')](this,_0x9ba83f,'');}}else{this[_0x4e3d('0x31')]['sync'](this,_0x9ba83f,_0xbf38dc);}return _0x4a85f6;};AGIVertices[_0x4e3d('0xe')]['getsecretdigits']=function(_0x2d8f18){logger['info'](util[_0x4e3d('0x9b')](_0x4e3d('0x11a'),_0x2d8f18[_0x4e3d('0x33')]));return this['getdigits'](_0x2d8f18);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x11b')]=function(_0x25f2ea){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x11c'),_0x25f2ea[_0x4e3d('0x33')]));this[_0x4e3d('0x31')][_0x4e3d('0x6a')](this,_0x25f2ea,_0x25f2ea['goalname']);return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x11d'),_0x25f2ea[_0x4e3d('0x11e')]));};AGIVertices['prototype'][_0x4e3d('0x11f')]=function(_0x5026f3){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x120'),_0x5026f3[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x5026f3[_0x4e3d('0x121')])||!this[_0x4e3d('0xa2')](_0x5026f3[_0x4e3d('0x83')])){return this[_0x4e3d('0x32')]['noop'](_0x4e3d('0x122'));}if(!this[_0x4e3d('0xa2')](_0x5026f3['text'])){return this[_0x4e3d('0x32')]['noop']('no\x20text\x20configured');}this['channel'][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x123'),_0x5026f3[_0x4e3d('0x56')]));var _0x1b7ee9=this['awsPolly'][_0x4e3d('0x6a')](this,_0x5026f3);if(_0x1b7ee9){this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x124'),_0x1b7ee9));var _0x33b1c2=this[_0x4e3d('0x32')][_0x4e3d('0xfd')](_0x1b7ee9);try{fs[_0x4e3d('0xff')](_0x1b7ee9+_0x4e3d('0x125'));}catch(_0xac01e6){logger[_0x4e3d('0x27')](_0xac01e6);}return _0x33b1c2;}return this['channel'][_0x4e3d('0x27')](_0x5026f3,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x4e3d('0x126')]=function(_0x3f6796){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x127'),_0x3f6796[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x3f6796['aws_access_key_id'])||!this[_0x4e3d('0xa2')](_0x3f6796['aws_secret_access_key'])){return this['channel'][_0x4e3d('0xa7')](_0x4e3d('0x122'));}if(!this['isConfigured'](_0x3f6796[_0x4e3d('0x128')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x3f6796[_0x4e3d('0x56')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xa8'));}this[_0x4e3d('0x32')][_0x4e3d('0xe6')]=!![];this[_0x4e3d('0x31')](_0x3f6796);this[_0x4e3d('0x3e')](_0x3f6796[_0x4e3d('0x56')],'in','','');this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x129'),_0x3f6796['text']));var _0x46eeeb=this[_0x4e3d('0x88')]['sync'](this,_0x3f6796);if(_0x46eeeb){for(var _0x507ec1 in _0x46eeeb){if(_0x46eeeb['hasOwnProperty'](_0x507ec1)&&_['isString'](_0x46eeeb[_0x507ec1])){this[_0x4e3d('0x32')][_0x4e3d('0x9d')](util['format'](_0x4e3d('0x12a'),_0x507ec1[_0x4e3d('0x65')]()),_0x46eeeb[_0x507ec1]);}}if(_[_0x4e3d('0x40')](_0x46eeeb['message'])){return this['channel']['noop'](_0x4e3d('0x12b'));}else{this[_0x4e3d('0x3e')](_0x46eeeb[_0x4e3d('0x72')],_0x4e3d('0xe9'),_0x4e3d('0x12c'),'');return this[_0x4e3d('0x32')]['noop'](util[_0x4e3d('0x9b')](_0x4e3d('0x12d'),_0x46eeeb['message']));}}return this[_0x4e3d('0x32')]['error'](_0x3f6796,_0x4e3d('0x12e'));};AGIVertices['prototype']['googleasr']=function(_0x16fedb){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x16fedb[_0x4e3d('0x33')],_0x16fedb[_0x4e3d('0x61')]));if(!this[_0x4e3d('0xa2')](_0x16fedb['key'])){return this['channel']['noop'](_0x4e3d('0xe5'));}var _0x2ae715='wav';var _0x17ffb2=util[_0x4e3d('0x9b')](_0x4e3d('0x12f'),FILES_PATH,rs[_0x4e3d('0x119')](0x4));var _0x2d31d3=util[_0x4e3d('0x9b')](_0x4e3d('0x9c'),_0x17ffb2,_0x2ae715);var _0x24b921=!![];if(_0x16fedb[_0x4e3d('0x130')]===_0x4e3d('0x131')){_0x24b921=![];}var _0x2a3a24=this[_0x4e3d('0x32')][_0x4e3d('0x132')](_0x17ffb2,_0x2ae715,_0x16fedb[_0x4e3d('0x133')],_0x16fedb[_0x4e3d('0x61')],undefined,_0x24b921);if(_0x2a3a24[_0x4e3d('0xae')]!==-0x1){this[_0x4e3d('0x32')]['noop'](util[_0x4e3d('0x9b')](_0x4e3d('0x134'),_0x2d31d3));var _0xef6425=this[_0x4e3d('0x8a')]['sync'](this,_0x16fedb,_0x2d31d3);if(_0xef6425){for(var _0x24d405 in _0xef6425){if(_0xef6425[_0x4e3d('0x91')](_0x24d405)){this[_0x4e3d('0x32')]['setVariable'](util[_0x4e3d('0x9b')](_0x4e3d('0x135'),_0x24d405[_0x4e3d('0x65')]()),_0xef6425[_0x24d405]);}}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x136'),JSON[_0x4e3d('0x6e')](_0xef6425)));}}return _0x2a3a24;};AGIVertices['prototype'][_0x4e3d('0x137')]=function(_0x3375cd){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x138'),_0x3375cd[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x3375cd[_0x4e3d('0x8d')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0x139'));}if(!this[_0x4e3d('0xa2')](_0x3375cd[_0x4e3d('0x13a')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0x13b'));}var _0x25052b=_0x4e3d('0x13c');var _0x51960b=util[_0x4e3d('0x9b')](_0x4e3d('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x1d5d5d=util[_0x4e3d('0x9b')](_0x4e3d('0x9c'),_0x51960b,_0x25052b);var _0x14eafe=!![];if(_0x3375cd[_0x4e3d('0x130')]===_0x4e3d('0x131')){_0x14eafe=![];}var _0xddb4e2=this[_0x4e3d('0x32')]['recordFile'](_0x51960b,_0x25052b,_0x3375cd[_0x4e3d('0x133')],_0x3375cd[_0x4e3d('0x61')],undefined,_0x14eafe);if(_0xddb4e2[_0x4e3d('0xae')]!==-0x1){this[_0x4e3d('0x32')]['noop'](util[_0x4e3d('0x9b')](_0x4e3d('0x13d'),_0x1d5d5d));var _0x388b56=this[_0x4e3d('0x8c')]['sync'](this,_0x3375cd,_0x1d5d5d);if(_0x388b56){for(var _0x45e686 in _0x388b56){if(_0x388b56[_0x4e3d('0x91')](_0x45e686)){this['channel'][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')](_0x4e3d('0x13e'),_0x45e686[_0x4e3d('0x65')]()),_0x388b56[_0x45e686]);}}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x13f'),JSON[_0x4e3d('0x6e')](_0x388b56)));}}return _0xddb4e2;};AGIVertices[_0x4e3d('0xe')]['gotoc']=function(_0xfeccae){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x140'),_0xfeccae[_0x4e3d('0x33')]));return this[_0x4e3d('0x32')][_0x4e3d('0x141')](_0xfeccae[_0x4e3d('0x39')],_0xfeccae['extension'],_0xfeccae[_0x4e3d('0x142')]);};AGIVertices['prototype']['gotoif']=function(_0x58b99b){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x143'),_0x58b99b[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x58b99b[_0x4e3d('0x144')])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x58b99b,_0x4e3d('0x145'));}try{var _0x1ed886=eval(_0x58b99b[_0x4e3d('0x144')])?'true':_0x4e3d('0x146');this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x147'),_0x58b99b[_0x4e3d('0x144')],_0x1ed886));return{'code':0xc8,'result':_0x1ed886};}catch(_0x3d3617){return{'code':0xc8,'result':_0x4e3d('0x146')};}};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x148')]=function(_0xfecd77){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0xfecd77['label']));if(!this[_0x4e3d('0xa2')](_0xfecd77[_0x4e3d('0x149')])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0xfecd77,_0x4e3d('0x14a'));}var _0x4f03a6=this[_0x4e3d('0x1e')][_0x4e3d('0x6a')](this,_0xfecd77['interval_id']);if(!_0x4f03a6){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0xfecd77,_0x4e3d('0x14b'));}for(var _0x19f42f=0x0;_0x19f42f<_0x4f03a6['length'];_0x19f42f+=0x1){var _0x50b06c=this[_0x4e3d('0x32')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x4f03a6[_0x19f42f]));if(_0x50b06c[_0x4e3d('0xae')]===-0x1){return _0x50b06c;}logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('IFTIME\x20%s\x20%s',_0x4f03a6[_0x19f42f],_0x50b06c[_0x4e3d('0xa1')]));if(_0x50b06c['extra']===_0x4e3d('0x14c')){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x14d'),_0x4f03a6[_0x19f42f],_0x4e3d('0x14c')));this[_0x4e3d('0x32')]['noop'](util[_0x4e3d('0x9b')](_0x4e3d('0x14d'),_0x4f03a6[_0x19f42f],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x4e3d('0x9b')]('IFTIME\x20%s\x20%s',_0x4f03a6[_0x19f42f],_0x4e3d('0x146')));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x14d'),_0x4f03a6[_0x19f42f],'false'));}}return{'code':0xc8,'result':_0x4e3d('0x146')};};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x14e')]=function(_0x3b337d){logger['info'](util[_0x4e3d('0x9b')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3b337d['label']));return this[_0x4e3d('0x32')]['hangup']();};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x14f')]=function(_0xc15d8e){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x150'),_0xc15d8e[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0xc15d8e[_0x4e3d('0x76')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0xe5'));}var _0x483602=_0x4e3d('0x13c');var _0x589e7f=util[_0x4e3d('0x9b')](_0x4e3d('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x9df766=util[_0x4e3d('0x9b')](_0x4e3d('0x9c'),_0x589e7f,_0x483602);var _0x21977e=!![];if(_0xc15d8e[_0x4e3d('0x130')]==='NOBEEP'){_0x21977e=![];}var _0x157448=this[_0x4e3d('0x32')]['recordFile'](_0x589e7f,_0x483602,_0xc15d8e[_0x4e3d('0x133')],_0xc15d8e[_0x4e3d('0x61')],undefined,_0x21977e);if(_0x157448[_0x4e3d('0xae')]!==-0x1){this['channel'][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x151'),_0x9df766));var _0x1f239a=this[_0x4e3d('0x7f')]['sync'](this,_0xc15d8e,_0x9df766);if(_0x1f239a){for(var _0x43cbe8 in _0x1f239a){if(_0x1f239a[_0x4e3d('0x91')](_0x43cbe8)){this[_0x4e3d('0x32')][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')](_0x4e3d('0x152'),_0x43cbe8['toUpperCase']()),_0x1f239a[_0x43cbe8]);}}return this['channel'][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x153'),JSON[_0x4e3d('0x6e')](_0x1f239a)));}}return _0x157448;};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x154')]=function(_0x2c4783){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x155'),_0x2c4783[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x2c4783[_0x4e3d('0x76')])){return this['channel'][_0x4e3d('0xa7')](_0x4e3d('0xe5'));}if(!this['isConfigured'](_0x2c4783['text'])){return this['channel']['noop'](_0x4e3d('0xa8'));}this[_0x4e3d('0x32')]['noop'](util[_0x4e3d('0x9b')](_0x4e3d('0x156'),_0x2c4783[_0x4e3d('0x56')]));var _0x1ac27a=this['ispeechTTS'][_0x4e3d('0x6a')](this,_0x2c4783);if(_0x1ac27a){this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x151'),_0x1ac27a));var _0x19e45d=this[_0x4e3d('0x32')][_0x4e3d('0xfd')](_0x1ac27a,_0x2c4783[_0x4e3d('0x133')]);try{fs[_0x4e3d('0xff')](_0x1ac27a+_0x4e3d('0x125'));}catch(_0x2527e6){logger['error'](_0x2527e6);}return _0x19e45d;}return this[_0x4e3d('0x32')]['error'](_0x2c4783,_0x4e3d('0x157'));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x158')]=function(_0x4d75c4){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x159'),_0x4d75c4[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x4d75c4[_0x4e3d('0x15a')])){return this[_0x4e3d('0x32')]['error'](_0x4d75c4,_0x4e3d('0x15b'));}logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x4e3d('0x37')],_0x4d75c4[_0x4e3d('0x15a')]));var _0x2a6ef4=this['agentLogin'][_0x4e3d('0x6a')](this,_0x4d75c4['findBy']);if(_0x2a6ef4){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x4d75c4[_0x4e3d('0x15a')]));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format'](_0x4e3d('0x15c'),this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x4d75c4['findBy']));return{'code':0xc8,'result':_0x4e3d('0x15d')};}else{logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x15e'),this['channel'][_0x4e3d('0x37')],_0x4d75c4[_0x4e3d('0x15a')]));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x4d75c4['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x15f')]=function(_0x81a2e4){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x81a2e4['label']));if(!this['isConfigured'](_0x81a2e4['findBy'])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x81a2e4,_0x4e3d('0x15b'));}logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x81a2e4[_0x4e3d('0x15a')]));var _0x50a883=this[_0x4e3d('0x4c')][_0x4e3d('0x6a')](this,_0x81a2e4['findBy']);if(_0x50a883){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x15c'),this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x81a2e4['findBy']));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format'](_0x4e3d('0x15c'),this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x81a2e4['findBy']));return{'code':0xc8,'result':_0x4e3d('0x15d')};}else{logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x15e'),this[_0x4e3d('0x32')]['callerid'],_0x81a2e4[_0x4e3d('0x15a')]));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x15e'),this['channel'][_0x4e3d('0x37')],_0x81a2e4['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x4e3d('0x160')]=function(_0x5eace1){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x161'),_0x5eace1['label']));if(!this[_0x4e3d('0xa2')](_0x5eace1[_0x4e3d('0x162')])){return this['channel'][_0x4e3d('0x27')](_0x5eace1,'no\x20operation\x20configured');}this[_0x4e3d('0x32')]['noop'](util[_0x4e3d('0x9b')](_0x4e3d('0x163'),_0x5eace1[_0x4e3d('0x162')]));var _0x27d9c7=eval(_0x5eace1[_0x4e3d('0x162')]);if(!this['isConfigured'](_0x5eace1[_0x4e3d('0xd8')])){return this['channel'][_0x4e3d('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x15563=this[_0x4e3d('0xf')][_0x4e3d('0x6a')](this,_0x5eace1[_0x4e3d('0xd8')]);if(!_0x15563){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x5eace1,_0x4e3d('0x114'));}if(_[_0x4e3d('0x97')](_0x27d9c7)){var _0x30b276=this;_0x27d9c7[_0x4e3d('0x164')](function(_0x445490,_0x221c04){_0x30b276[_0x4e3d('0x32')][_0x4e3d('0x9d')](util['format'](_0x4e3d('0x165'),_0x15563,_0x221c04),_0x445490);});return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x166'),_0x15563));}else{return this[_0x4e3d('0x32')][_0x4e3d('0x9d')](_0x15563,_0x27d9c7);}};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0xa')]=function(_0x374cfd){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x167'),_0x374cfd[_0x4e3d('0x33')]));if(_0x374cfd[_0x4e3d('0xa4')]===0x0){return this['maxRetry'](_0x374cfd);}_0x374cfd[_0x4e3d('0xa4')]-=0x1;if(!this['isConfigured'](_0x374cfd['file_id'])){return this['channel'][_0x4e3d('0x27')](_0x374cfd,_0x4e3d('0x10d'));}var _0x101cd8=this['getSound'][_0x4e3d('0x6a')](this,_0x374cfd['file_id']);if(!_0x101cd8){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x374cfd,_0x4e3d('0x10f'));}var _0x53ce0c=this[_0x4e3d('0x32')]['getData'](_0x101cd8,_0x374cfd['response'],_0x374cfd[_0x4e3d('0x168')]);var _0x5a0a40=_0x53ce0c[_0x4e3d('0xae')];if(_0x53ce0c[_0x4e3d('0xae')]===-0x1){this[_0x4e3d('0x31')][_0x4e3d('0x6a')](this,_0x374cfd,'-1');return _0x53ce0c;}else if(_0x53ce0c[_0x4e3d('0xa1')]===_0x4e3d('0x61')){_0x53ce0c['result']=_0x53ce0c[_0x4e3d('0xae')][_0x4e3d('0x98')]>0x0?_0x53ce0c[_0x4e3d('0xae')]:'t';}else if(_[_0x4e3d('0x9a')](_0x53ce0c[_0x4e3d('0xae')])){_0x53ce0c[_0x4e3d('0xae')]='#';_0x5a0a40='#';}if(!this[_0x4e3d('0xa2')](_0x374cfd[_0x4e3d('0xd8')])){this['channel'][_0x4e3d('0xa7')](_0x4e3d('0xd7'));}else{var _0x301eb8=this[_0x4e3d('0xf')][_0x4e3d('0x6a')](this,_0x374cfd[_0x4e3d('0xd8')]);if(!_0x301eb8){return this['channel']['error'](_0x374cfd,'no\x20variable\x20found');}this[_0x4e3d('0x32')][_0x4e3d('0x9d')](_0x301eb8,_0x5a0a40);}this['createSquareDetailsReport'][_0x4e3d('0x6a')](this,_0x374cfd,_0x5a0a40);return _0x53ce0c;};AGIVertices['prototype'][_0x4e3d('0xa7')]=function(_0x480514){logger['info'](util['format'](_0x4e3d('0x169'),_0x480514[_0x4e3d('0x33')]));return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x480514[_0x4e3d('0x16a')]||_0x480514[_0x4e3d('0x33')]);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x16b')]=function(_0x212ae8){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x212ae8[_0x4e3d('0x33')]));if(!this['isConfigured'](_0x212ae8[_0x4e3d('0x15a')])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x212ae8,_0x4e3d('0x15b'));}logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x16c'),this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x212ae8[_0x4e3d('0x15a')]));var _0x49cfea=this['getPause'][_0x4e3d('0x6a')](this,_0x212ae8[_0x4e3d('0x16d')]);var _0x21275d=this[_0x4e3d('0x49')][_0x4e3d('0x6a')](this,_0x212ae8[_0x4e3d('0x15a')],_0x49cfea);if(_0x21275d){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x212ae8[_0x4e3d('0x15a')]));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x15c'),this['channel']['callerid'],_0x212ae8['findBy']));return{'code':0xc8,'result':_0x4e3d('0x15d')};}else{logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x15e'),this['channel'][_0x4e3d('0x37')],_0x212ae8['findBy']));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x212ae8['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x16e')]=function(_0x284bce){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x16f'),_0x284bce[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x284bce['file_id'])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x284bce,_0x4e3d('0x10d'));}var _0x1df050=this[_0x4e3d('0x10e')]['sync'](this,_0x284bce[_0x4e3d('0x10c')]);if(!_0x1df050){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x284bce,_0x4e3d('0x10f'));}var _0x476cd4=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0x170'),[_0x1df050,_0x284bce['opts']]);if(_0x476cd4[_0x4e3d('0xae')]===-0x1){return _0x476cd4;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x4e3d('0x170'),_0x1df050));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x171')]=function(_0x27ce89){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x172'),_0x27ce89[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x27ce89['queue_id'])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x27ce89,_0x4e3d('0x173'));}var _0xb2e4ab='';var _0x5482cf=parseInt(_0x27ce89[_0x4e3d('0x174')],0xa);if(isNaN(_0x5482cf)){_0xb2e4ab=_0x27ce89['queue_id'];}else{_0xb2e4ab=this[_0x4e3d('0x14')][_0x4e3d('0x6a')](this,_0x27ce89[_0x4e3d('0x174')]);if(!_0xb2e4ab){return this[_0x4e3d('0x32')]['error'](_0x27ce89,'no\x20queue\x20found');}}var _0xca241c='';if(this[_0x4e3d('0xa2')](_0x27ce89[_0x4e3d('0x10c')])){var _0x57c7b9=this[_0x4e3d('0x10e')][_0x4e3d('0x6a')](this,_0x27ce89[_0x4e3d('0x10c')]);if(_0x57c7b9){_0xca241c=_0x57c7b9;}}this[_0x4e3d('0x31')][_0x4e3d('0x6a')](this,_0x27ce89,_0xb2e4ab);if(_0x27ce89[_0x4e3d('0xe2')][_0x4e3d('0x175')]('x')<0x0){_0x27ce89[_0x4e3d('0xe2')]+='x';}if(_0x27ce89[_0x4e3d('0xe2')][_0x4e3d('0x175')]('X')<0x0){_0x27ce89[_0x4e3d('0xe2')]+='X';}this[_0x4e3d('0x32')][_0x4e3d('0x9d')](_0x4e3d('0x176'),_0xb2e4ab?_0xb2e4ab[_0x4e3d('0x177')]():'');var _0x2976eb=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0x178'),[_0xb2e4ab,_0x27ce89[_0x4e3d('0xe2')],_0x27ce89[_0x4e3d('0x6c')],_0xca241c,_0x27ce89[_0x4e3d('0x61')],_0x27ce89[_0x4e3d('0xb5')],_0x27ce89[_0x4e3d('0x179')],_0x27ce89['gosub'],'',_0x27ce89[_0x4e3d('0x17a')]]);if(_0x2976eb[_0x4e3d('0xae')]===-0x1){return _0x2976eb;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x4e3d('0x178'),_0xb2e4ab));};AGIVertices['prototype']['record']=function(_0x56a6ab){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x17b'),_0x56a6ab['label']));var _0x37491a=_0x56a6ab[_0x4e3d('0x17c')]||_0x4e3d('0x13c');var _0x25a1a6=util[_0x4e3d('0x9b')](_0x4e3d('0x17d'),this[_0x4e3d('0x32')]['uniqueid'],rs[_0x4e3d('0x119')](0x5));var _0xfcdf0=util['format'](_0x4e3d('0x17e'),FILES_PATH,_0x25a1a6,_0x37491a);var _0x3c389b=util[_0x4e3d('0x9b')](_0x4e3d('0x12f'),FILES_PATH,_0x25a1a6);this[_0x4e3d('0x35')][_0x4e3d('0x6a')](this,_0x56a6ab,_0x25a1a6,_0xfcdf0);this[_0x4e3d('0x32')][_0x4e3d('0x9d')](_0x4e3d('0x17f'),_0x25a1a6);logger[_0x4e3d('0x29')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3c389b,_0x37491a,_0x56a6ab[_0x4e3d('0x180')],_0x56a6ab[_0x4e3d('0x61')]);return this[_0x4e3d('0x32')][_0x4e3d('0x132')](_0x3c389b,_0x37491a,_0x56a6ab['escape_digits'],_0x56a6ab[_0x4e3d('0x61')],undefined,!![]);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x181')]=function(_0x4daed6){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x182'),_0x4daed6['label']));if(!this[_0x4e3d('0xa2')](_0x4daed6['url'])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')]('no\x20url\x20configured');}var _0x4849de=this[_0x4e3d('0x5f')][_0x4e3d('0x6a')](this,_0x4daed6);logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Response:',util[_0x4e3d('0x183')](_0x4849de,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x4daed6[_0x4e3d('0xd8')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0x184'));}var _0x5aac75=this[_0x4e3d('0xf')]['sync'](this,_0x4daed6['variable_id']);if(!_0x5aac75){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x4daed6,_0x4e3d('0x114'));}this['channel'][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')](_0x4e3d('0x185'),_0x5aac75),_0x4849de[_0x4e3d('0x70')]?_0x4849de['statusCode']:'200');this[_0x4e3d('0x32')][_0x4e3d('0x9d')](util[_0x4e3d('0x9b')]('%s_STATUS_MESSAGE',_0x5aac75),_0x4849de[_0x4e3d('0x71')]?_0x4849de[_0x4e3d('0x71')]:'OK');if(_0x4849de[_0x4e3d('0x66')]){try{this[_0x4e3d('0x99')](_0x4849de[_0x4e3d('0x66')],_0x5aac75);}catch(_0x129992){logger['error'](util[_0x4e3d('0x9b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x5aac75));}}return this['channel']['noop'](util['format']('variable\x20%s\x20set',_0x5aac75));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x186')]=function(_0x1991c1){logger['info'](util[_0x4e3d('0x9b')](_0x4e3d('0x187'),_0x1991c1[_0x4e3d('0x33')]));return this['channel'][_0x4e3d('0x188')](_0x1991c1[_0x4e3d('0x189')][_0x4e3d('0x52')](/\s+/g,''),_0x1991c1[_0x4e3d('0x180')]);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x18a')]=function(_0x48df16){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x48df16[_0x4e3d('0x33')]));return this['channel'][_0x4e3d('0x18b')](_0x48df16[_0x4e3d('0x62')][_0x4e3d('0x52')](/\s+/g,''),_0x48df16[_0x4e3d('0x180')]);};AGIVertices['prototype'][_0x4e3d('0x18c')]=function(_0x2884e0){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x18d'),_0x2884e0[_0x4e3d('0x33')]));return this[_0x4e3d('0x32')][_0x4e3d('0x18e')](_0x2884e0['text'],_0x2884e0['escape_digits']);};AGIVertices['prototype']['sendMail']=function(_0x4667fb){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x18f'),_0x4667fb[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x4667fb[_0x4e3d('0x190')])){return this[_0x4e3d('0x32')][_0x4e3d('0xa7')]('no\x20mail\x20account\x20configured');}var _0x291675=this[_0x4e3d('0x1c')][_0x4e3d('0x6a')](this,_0x4667fb[_0x4e3d('0x190')]);if(!_0x291675||!_0x291675[_0x4e3d('0x191')]){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x4667fb,'no\x20mail\x20account\x20found');}var _0x143a8f={'from':util['format'](_0x4e3d('0x192'),_0x291675[_0x4e3d('0x12')],_0x291675[_0x4e3d('0x193')]||_0x291675[_0x4e3d('0x191')][_0x4e3d('0x194')]),'to':_0x4667fb['to']||'','cc':_0x4667fb['cc']||'','bcc':_0x4667fb[_0x4e3d('0x195')]||'','subject':_0x4667fb[_0x4e3d('0x196')],'html':_0x4667fb[_0x4e3d('0x56')],'text':_0x4667fb[_0x4e3d('0x56')]};if(this[_0x4e3d('0xa2')](_0x4667fb[_0x4e3d('0x197')])){}logger[_0x4e3d('0xdd')]('sendMail\x20message',JSON[_0x4e3d('0x6e')](_0x143a8f));this['createSquareDetailsReport']['sync'](this,_0x4667fb,_0x4667fb[_0x4e3d('0x190')]);this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x198'),_0x291675[_0x4e3d('0x12')]));this['sendMailMessage'][_0x4e3d('0x6a')](this,_0x291675[_0x4e3d('0x199')],_0x143a8f);return this[_0x4e3d('0x32')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x4e3d('0x19a')]=function(_0x4f935a){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x19b'),_0x4f935a['label']));return this[_0x4e3d('0x32')]['noop'](_0x4e3d('0x19c'));};AGIVertices['prototype']['sendSMS']=function(_0x313fa6){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x313fa6[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x313fa6['sms_account_id'])){return this[_0x4e3d('0x32')]['noop'](_0x4e3d('0x19d'));}var _0x33da54=this[_0x4e3d('0x19e')][_0x4e3d('0x6a')](this,_0x313fa6[_0x4e3d('0x19f')]);if(!_0x33da54){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x313fa6,_0x4e3d('0x1a0'));}var _0x3138fc={'body':_0x313fa6[_0x4e3d('0x1a1')],'phone':_0x313fa6['to']||'','SmsAccountId':_0x33da54['id']};logger[_0x4e3d('0xdd')](_0x4e3d('0x1a2'),JSON['stringify'](_0x3138fc));this[_0x4e3d('0x31')]['sync'](this,_0x313fa6,_0x313fa6[_0x4e3d('0x19f')]);this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format'](_0x4e3d('0x1a3'),_0x33da54['name']));this[_0x4e3d('0x30')][_0x4e3d('0x6a')](this,_0x3138fc);return this['channel']['noop'](_0x4e3d('0x1a4'));};AGIVertices['prototype'][_0x4e3d('0x1a5')]=function(_0x43ccdc){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x1a6'),_0x43ccdc[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x43ccdc['variable_id'])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x43ccdc,_0x4e3d('0x1a7'));}var _0xfdc4d4=this[_0x4e3d('0xf')]['sync'](this,_0x43ccdc[_0x4e3d('0xd8')]);if(!_0xfdc4d4){return this[_0x4e3d('0x32')]['error'](_0x43ccdc,_0x4e3d('0x114'));}return this['channel']['setVariable'](_0xfdc4d4,_0x43ccdc[_0x4e3d('0x1a8')]);};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x1a9')]=function(_0x54c963){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x1aa'),_0x54c963['label']));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](_0x4e3d('0x1ab'));if(_0x54c963[_0x4e3d('0xb8')]===_0x4e3d('0x1ac')){this['channel'][_0x4e3d('0xa7')](_0x4e3d('0x1ad'));return this[_0x4e3d('0x32')][_0x4e3d('0xb8')]();}return this['channel'][_0x4e3d('0xa7')](_0x4e3d('0x1ae'));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x1af')]=function(_0x54f948){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x1b0'),_0x54f948[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x54f948['project_id'])){return this[_0x4e3d('0x32')]['error'](_0x54f948,_0x4e3d('0x1b1'));}var _0x196862=this['getSquareProject'][_0x4e3d('0x6a')](this,_0x54f948[_0x4e3d('0x1b2')]);if(!this[_0x4e3d('0xa2')](_0x196862)){return this[_0x4e3d('0x32')]['error'](_0x54f948,util[_0x4e3d('0x9b')](_0x4e3d('0x1b3'),_0x54f948['project_id']));}if(_0x196862===this[_0x4e3d('0x32')][_0x4e3d('0x34')]){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x54f948,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x4e3d('0x6a')](this,_0x54f948,_0x196862);var _0x237102=this[_0x4e3d('0x32')]['exec'](_0x4e3d('0x1b4'),util[_0x4e3d('0x9b')](_0x4e3d('0x1b5'),config['agi']['host']||_0x4e3d('0x1b6'),_0x196862,this[_0x4e3d('0x32')][_0x4e3d('0x34')]));if(_0x237102['result']===-0x1){return _0x237102;}return this[_0x4e3d('0x32')]['noop'](util['format'](_0x4e3d('0xc5'),'AGI',_0x196862));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x1b7')]=function(_0x543b72){logger['info'](util[_0x4e3d('0x9b')](_0x4e3d('0x1b8'),_0x543b72[_0x4e3d('0x33')]));var _0x12939c=this[_0x4e3d('0x1b9')][_0x4e3d('0x6a')](this,_0x543b72[_0x4e3d('0x1ba')]);this[_0x4e3d('0x31')][_0x4e3d('0x6a')](this,_0x543b72,_0x543b72['command']);if(this[_0x4e3d('0xa2')](_0x543b72[_0x4e3d('0xd8')])){var _0x392e0e=this[_0x4e3d('0xf')][_0x4e3d('0x6a')](this,_0x543b72[_0x4e3d('0xd8')]);if(_0x392e0e){this[_0x4e3d('0x32')][_0x4e3d('0x9d')](_0x392e0e,_0x12939c);return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x543b72['command'],_0x392e0e));}}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util['format'](_0x4e3d('0x1bb'),_0x543b72[_0x4e3d('0x1ba')]));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x1bc')]=function(_0x2fa814){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x1bd'),_0x2fa814['label']));_0x2fa814[_0x4e3d('0x56')]=_0x2fa814[_0x4e3d('0x56')][_0x4e3d('0x52')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2fa814[_0x4e3d('0x54')])){return this['channel'][_0x4e3d('0xa7')](_0x4e3d('0x1be'));}if(!this['isConfigured'](_0x2fa814['text'])){return this['channel']['noop'](_0x4e3d('0xa8'));}this['channel'][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x1bf'),_0x2fa814[_0x4e3d('0x56')]));var _0x4ff203=this['googleCloudTTS'][_0x4e3d('0x6a')](this,_0x2fa814);if(_0x4ff203){this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x1c0'),_0x4ff203));var _0x5af541=this[_0x4e3d('0x32')][_0x4e3d('0xfd')](_0x4ff203);try{fs[_0x4e3d('0xff')](_0x4ff203+_0x4e3d('0x125'));}catch(_0x519834){logger[_0x4e3d('0x27')](_0x519834);}return _0x5af541;}return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x2fa814,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x4e3d('0xe')]['tts']=function(_0x1ec63d){logger['info'](util[_0x4e3d('0x9b')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1ec63d['label']));_0x1ec63d[_0x4e3d('0x56')]=_0x1ec63d[_0x4e3d('0x56')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4e3d('0xa2')](_0x1ec63d[_0x4e3d('0x56')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x1c1'),_0x1ec63d[_0x4e3d('0x56')]));var _0x986076=this[_0x4e3d('0x5d')]['sync'](this,_0x1ec63d);if(_0x986076){this['channel'][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')]('Google\x20TTS\x20%s\x20file\x20created',_0x986076));var _0x54be3c=this[_0x4e3d('0x32')]['streamFile'](_0x986076);try{fs[_0x4e3d('0xff')](_0x986076+_0x4e3d('0x125'));}catch(_0x443d9e){logger[_0x4e3d('0x27')](_0x443d9e);}return _0x54be3c;}return this['channel']['error'](_0x1ec63d,_0x4e3d('0x1c2'));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x1c3')]=function(_0x2b5ba0){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x1c4'),_0x2b5ba0[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x2b5ba0[_0x4e3d('0x15a')])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x2b5ba0,_0x4e3d('0x15b'));}logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x16c'),this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x2b5ba0[_0x4e3d('0x15a')]));var _0x56df66=this['agentUnpause']['sync'](this,_0x2b5ba0[_0x4e3d('0x15a')]);if(_0x56df66){logger[_0x4e3d('0x29')](util['format'](_0x4e3d('0x15c'),this[_0x4e3d('0x32')]['callerid'],_0x2b5ba0[_0x4e3d('0x15a')]));this['channel'][_0x4e3d('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x2b5ba0['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x2b5ba0[_0x4e3d('0x15a')]));this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')](_0x4e3d('0x15e'),this[_0x4e3d('0x32')][_0x4e3d('0x37')],_0x2b5ba0[_0x4e3d('0x15a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x4e3d('0x1c5')]=function(_0x4ee8ff){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x1c6'),_0x4ee8ff['label']));var _0x4a26ce=this[_0x4e3d('0x32')][_0x4e3d('0x50')](_0x4e3d('0x1c7'),[_0x4ee8ff[_0x4e3d('0x1c8')],_0x4ee8ff[_0x4e3d('0x74')]]);if(_0x4a26ce['result']===-0x1){return _0x4a26ce;}return this[_0x4e3d('0x32')][_0x4e3d('0xa7')](util[_0x4e3d('0x9b')]('Executed\x20command\x20%s\x20%s',_0x4e3d('0x1c7'),_0x4ee8ff[_0x4e3d('0x1c8')]));};AGIVertices[_0x4e3d('0xe')][_0x4e3d('0x1c9')]=function(_0x44b221){logger[_0x4e3d('0x29')](util[_0x4e3d('0x9b')](_0x4e3d('0x1ca'),_0x44b221[_0x4e3d('0x33')]));if(!this[_0x4e3d('0xa2')](_0x44b221[_0x4e3d('0xd8')])){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x44b221,_0x4e3d('0x1a7'));}var _0x3cc1ca=this[_0x4e3d('0xf')][_0x4e3d('0x6a')](this,_0x44b221[_0x4e3d('0xd8')]);if(!_0x3cc1ca){return this[_0x4e3d('0x32')][_0x4e3d('0x27')](_0x44b221,_0x4e3d('0x114'));}var _0x551c5e=this[_0x4e3d('0x32')][_0x4e3d('0xf')](_0x3cc1ca);return{'code':0xc8,'result':_0x551c5e['extra']?_0x551c5e[_0x4e3d('0xa1')]:'-'};};String[_0x4e3d('0xe')][_0x4e3d('0x1cb')]=function(_0x2f4495,_0x517063){return this[_0x4e3d('0x9e')](_0x2f4495)[_0x4e3d('0x1cc')](_0x517063);};module[_0x4e3d('0x1cd')]=AGIVertices; \ No newline at end of file +var _0x97e7=['getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','url','stringify','body','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','aws_text_type','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','isPlainObject','%s.%s','length','setVariable','split','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','phone','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','MRCPSynth','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','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','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','awsLex','amazonlex','Amazon\x20Lex\x20Result\x20%s','wav','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','findBy','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','success','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','template_id','sendMail\x20message','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','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','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueueById','name','getSquareProject','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount'];(function(_0x892a72,_0x31ee21){var _0x506939=function(_0x1e6b13){while(--_0x1e6b13){_0x892a72['push'](_0x892a72['shift']());}};_0x506939(++_0x31ee21);}(_0x97e7,0x1a1));var _0x797e=function(_0x541d23,_0x9ee29a){_0x541d23=_0x541d23-0x0;var _0x372498=_0x97e7[_0x541d23];return _0x372498;};'use strict';var fs=require('fs');var util=require(_0x797e('0x0'));var _=require(_0x797e('0x1'));var sh=require(_0x797e('0x2'));var odbc=require('odbc')();var rs=require(_0x797e('0x3'));var moment=require(_0x797e('0x4'));var Mustache=require(_0x797e('0x5'));var rp=require(_0x797e('0x6'));var logger=require(_0x797e('0x7'))(_0x797e('0x8'));var config=require(_0x797e('0x9'));var shared=require(_0x797e('0xa'));var scripts=require(_0x797e('0xb'));var FILES_PATH=_0x797e('0xc');var recursiveMapAttributes=[_0x797e('0xd'),_0x797e('0xe')];var verticesWithRetry=['menu',_0x797e('0xf'),_0x797e('0x10')];var AGIVertices=function(_0x2e148f,_0x149c09,_0x5ad3cf){this[_0x797e('0x11')]=_0x2e148f;this[_0x797e('0x12')]=_0x149c09;this[_0x797e('0x13')]=_0x5ad3cf;};AGIVertices[_0x797e('0x14')][_0x797e('0x15')]=function(_0x442b39,_0x291aa8){this['rpc'][_0x797e('0x16')](_0x442b39)[_0x797e('0x17')](function(_0x1da7a4){_0x291aa8(null,_0x1da7a4?_0x1da7a4['name']:![]);})[_0x797e('0x18')](function(_0x5adb17){_0x291aa8(_0x5adb17);});};AGIVertices[_0x797e('0x14')]['getVoiceQueue']=function(_0x285968,_0x437b80){this['rpc'][_0x797e('0x19')](_0x285968)['then'](function(_0x37d007){_0x437b80(null,_0x37d007?_0x37d007[_0x797e('0x1a')]:![]);})[_0x797e('0x18')](function(_0x1ccfaa){_0x437b80(_0x1ccfaa);});};AGIVertices[_0x797e('0x14')][_0x797e('0x1b')]=function(_0x4244aa,_0xfe2fff){this[_0x797e('0x12')]['getSquareProjectById'](_0x4244aa)[_0x797e('0x17')](function(_0x26469b){_0xfe2fff(null,_0x26469b?_0x26469b[_0x797e('0x1a')]:![]);})['catch'](function(_0x112eb3){_0xfe2fff(_0x112eb3);});};AGIVertices[_0x797e('0x14')]['getSquareOdbc']=function(_0x2c1657,_0x19b2af){this[_0x797e('0x12')][_0x797e('0x1c')](_0x2c1657)[_0x797e('0x17')](function(_0x57ddae){_0x19b2af(null,_0x57ddae?_0x57ddae[_0x797e('0x1d')]:![]);})['catch'](function(_0x544225){_0x19b2af(_0x544225);});};AGIVertices['prototype']['getUser']=function(_0x47bde9,_0x2f7bdc){this[_0x797e('0x12')][_0x797e('0x1e')](_0x47bde9)[_0x797e('0x17')](function(_0x1b03d0){_0x2f7bdc(null,_0x1b03d0?_0x1b03d0[_0x797e('0x1a')]:![]);})[_0x797e('0x18')](function(_0x1023e7){_0x2f7bdc(_0x1023e7);});};AGIVertices[_0x797e('0x14')][_0x797e('0x1f')]=function(_0x1713a0,_0x506209){this[_0x797e('0x12')][_0x797e('0x20')](_0x1713a0)['then'](function(_0x2ead35){_0x506209(null,_0x2ead35?_0x2ead35[_0x797e('0x1a')]:![]);})[_0x797e('0x18')](function(_0x28189c){_0x506209(_0x28189c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x21')]=function(_0xa156f0,_0x13f7e7){var _0x3a9310=this;this[_0x797e('0x12')][_0x797e('0x22')](_0xa156f0)['then'](function(_0x281ade){_0x13f7e7(null,_0x281ade?_0x3a9310[_0x797e('0x23')](_0x281ade[_0x797e('0x24')]):![]);})[_0x797e('0x18')](function(_0x4b8d78){_0x13f7e7(_0x4b8d78);});};AGIVertices[_0x797e('0x14')][_0x797e('0x25')]=function(_0xb1c813,_0x520b4f){this[_0x797e('0x12')][_0x797e('0x26')](_0xb1c813)['then'](function(_0x50d220){_0x520b4f(null,_0x50d220?_0x50d220:![]);})[_0x797e('0x18')](function(_0x596b32){_0x520b4f(_0x596b32);});};AGIVertices['prototype'][_0x797e('0x27')]=function(_0x20be8,_0x59787b,_0x4d299a){this[_0x797e('0x13')][_0x797e('0x27')](_0x20be8,_0x59787b)[_0x797e('0x17')](function(){_0x4d299a(null);})['catch'](function(_0x4a918b){_0x4d299a(_0x4a918b);});};AGIVertices['prototype'][_0x797e('0x28')]=function(_0x267be6,_0x9e8555){this['rpc'][_0x797e('0x29')](_0x267be6)['then'](function(_0x5e6792){if(_0x5e6792){if(_0x5e6792[_0x797e('0x2a')]){_0x9e8555(null,[_0x5e6792[_0x797e('0x2b')]]);}else{_0x9e8555(null,_[_0x797e('0x2c')](_0x5e6792['Intervals'],'interval'));}}else{_0x9e8555(null,![]);}})['catch'](function(_0xc7f01e){_0x9e8555(_0xc7f01e);});};AGIVertices['prototype'][_0x797e('0x23')]=function(_0x4c7fef){return util[_0x797e('0x2d')](_0x797e('0x2e'),FILES_PATH,_0x4c7fef);};AGIVertices['prototype'][_0x797e('0x2f')]=function(_0x5abdbb,_0x5da0f1,_0x56f263){odbc['open'](_0x5abdbb,function(_0x40c347){if(_0x40c347){logger[_0x797e('0x30')](_0x797e('0x31'),_0x40c347);_0x56f263(_0x40c347);}else{logger[_0x797e('0x32')]('ODBC\x20connection\x20successfully');odbc['query'](_0x5da0f1,function(_0x5afb7f,_0x161e9c){if(_0x5afb7f){logger[_0x797e('0x32')]('Error\x20executing\x20query\x20%s',_0x5da0f1);_0x56f263(_0x5afb7f);}else{logger[_0x797e('0x32')]('Query\x20executed\x20correctly\x20%s',_0x5da0f1);odbc[_0x797e('0x33')](function(_0x79408d){if(_0x79408d){logger['error'](_0x797e('0x34'),_0x79408d);}_0x56f263(null,_0x161e9c);});}});}});};AGIVertices[_0x797e('0x14')][_0x797e('0x35')]=function(_0x415768,_0x1f0458){this[_0x797e('0x12')][_0x797e('0x36')](_0x415768)[_0x797e('0x17')](function(_0x38778b){_0x1f0458(null,_0x38778b?_0x38778b:![]);})[_0x797e('0x18')](function(_0x5a5336){_0x1f0458(_0x5a5336);});};AGIVertices[_0x797e('0x14')][_0x797e('0x37')]=function(_0x51919a,_0x13af20){this[_0x797e('0x12')][_0x797e('0x37')](_0x51919a)['then'](function(_0x8c85e3){_0x13af20(null,_0x8c85e3);})['catch'](function(_0x24d84c){_0x13af20(_0x24d84c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x38')]=function(_0x970d20,_0x55219f,_0x1dad91){this[_0x797e('0x12')][_0x797e('0x38')]({'uniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'node':_0x970d20[_0x797e('0x3a')],'application':_0x970d20['agicommand'],'data':_0x55219f||null,'project_name':this['channel'][_0x797e('0x3b')],'callerid':this['channel']['callerid']})[_0x797e('0x17')](function(_0x30fa19){if(_0x1dad91){_0x1dad91(null,_0x30fa19);}})[_0x797e('0x18')](function(_0x421e67){if(_0x1dad91){_0x1dad91(_0x421e67);}});};AGIVertices['prototype'][_0x797e('0x3c')]=function(_0x128d01,_0x1cf727,_0x367c95,_0x5eb031){this[_0x797e('0x12')][_0x797e('0x3c')]({'uniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'callerid':this[_0x797e('0x11')][_0x797e('0x3d')],'calleridname':this[_0x797e('0x11')]['calleridname'],'context':this['channel']['context'],'extension':this[_0x797e('0x11')][_0x797e('0x3e')],'priority':this['channel'][_0x797e('0x3f')],'accountcode':this[_0x797e('0x11')]['accountcode'],'dnid':this['channel'][_0x797e('0x40')],'projectName':this['channel'][_0x797e('0x3b')],'saveName':_0x1cf727,'filename':_0x128d01[_0x797e('0x41')]||_0x1cf727,'savePath':_0x367c95})[_0x797e('0x17')](function(_0x5711a1){_0x5eb031(null,_0x5711a1);})['catch'](function(_0x32814c){_0x5eb031(_0x32814c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x42')]=function(_0x5324aa,_0x473e1f,_0x561198,_0x5b13b6,_0x441f1c){this[_0x797e('0x12')][_0x797e('0x42')]({'uniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'body':_0x5324aa,'direction':_0x473e1f,'providerName':_0x561198,'providerResponse':_0x5b13b6})[_0x797e('0x17')](function(_0x1a6968){if(_0x441f1c){_0x441f1c(null,_0x1a6968);}})[_0x797e('0x18')](function(_0x41cd8b){if(_0x441f1c){_0x441f1c(_0x41cd8b);}});};AGIVertices[_0x797e('0x14')][_0x797e('0x43')]=function(_0x23836d,_0x2064bb){this[_0x797e('0x12')][_0x797e('0x43')]({'firstName':_[_0x797e('0x44')](_0x23836d[_0x797e('0x1a')])||_[_0x797e('0x45')](_0x23836d[_0x797e('0x1a')])?'callback_'+Math[_0x797e('0x46')]():_0x23836d[_0x797e('0x1a')],'lastName':_[_0x797e('0x44')](_0x23836d[_0x797e('0x47')])||_[_0x797e('0x45')](_0x23836d[_0x797e('0x47')])?null:_0x23836d[_0x797e('0x47')],'phone':_0x23836d['phone'],'ListId':_0x23836d[_0x797e('0x48')],'scheduledat':_0x23836d[_0x797e('0x49')],'callbackUniqueid':this[_0x797e('0x11')][_0x797e('0x39')],'tags':_0x797e('0x4a'),'description':_0x797e('0x4b')+_0x23836d[_0x797e('0x49')][_0x797e('0x4c')](),'priority':_0x23836d[_0x797e('0x4d')]})[_0x797e('0x17')](function(_0xab3823){_0x2064bb(null,_0xab3823);})['catch'](function(_0x2eaabc){_0x2064bb(_0x2eaabc);});};AGIVertices[_0x797e('0x14')][_0x797e('0x4e')]=function(_0xa46318,_0x58ec56){this[_0x797e('0x12')][_0x797e('0x4f')](_0xa46318)[_0x797e('0x17')](function(_0x44b199){_0x58ec56(null,_0x44b199?_0x44b199['name']:![]);})[_0x797e('0x18')](function(_0x28ff41){_0x58ec56(_0x28ff41);});};AGIVertices[_0x797e('0x14')][_0x797e('0x50')]=function(_0x1c0994,_0x29112d,_0x4dc6e6){var _0x3a8678={'role':_0x797e('0x51')};_0x3a8678[_0x1c0994]=this[_0x797e('0x11')][_0x797e('0x3d')];this[_0x797e('0x12')]['agentPause'](_0x3a8678,_0x29112d,this[_0x797e('0x11')][_0x797e('0x39')])['then'](function(_0x9fc1b7){_0x4dc6e6(null,_[_0x797e('0x45')](_0x9fc1b7)?![]:!![]);})[_0x797e('0x18')](function(_0xd88a48){logger['error'](_0xd88a48);_0x4dc6e6(null,![]);});};AGIVertices[_0x797e('0x14')][_0x797e('0x52')]=function(_0xd0d95,_0x341013){var _0xf6259a={'role':_0x797e('0x51')};_0xf6259a[_0xd0d95]=this['channel'][_0x797e('0x3d')];this[_0x797e('0x12')][_0x797e('0x52')](_0xf6259a)['then'](function(_0x52f40f){_0x341013(null,_[_0x797e('0x45')](_0x52f40f)?![]:!![]);})[_0x797e('0x18')](function(_0x287dce){logger[_0x797e('0x30')](_0x287dce);_0x341013(null,![]);});};AGIVertices[_0x797e('0x14')][_0x797e('0x53')]=function(_0x177a75,_0x427eaa){var _0xcdce75={'role':_0x797e('0x51')};_0xcdce75[_0x177a75]=this['channel'][_0x797e('0x3d')];this[_0x797e('0x12')][_0x797e('0x53')](_0xcdce75)[_0x797e('0x17')](function(_0x24a4f9){_0x427eaa(null,_[_0x797e('0x45')](_0x24a4f9)?![]:!![]);})['catch'](function(_0x9f9d04){logger[_0x797e('0x30')](_0x9f9d04);_0x427eaa(null,![]);});};AGIVertices['prototype'][_0x797e('0x54')]=function(_0x3254e7,_0x732659){var _0x525ff1={'role':'agent'};_0x525ff1[_0x3254e7]=this[_0x797e('0x11')][_0x797e('0x3d')];var _0x289a0f=_0x3254e7!=_0x797e('0x55')?util[_0x797e('0x2d')](_0x797e('0x56'),_0x797e('0x57'),this[_0x797e('0x11')][_0x797e('0x3d')]):undefined;this[_0x797e('0x12')]['agentLogin'](_0x525ff1,_0x289a0f)[_0x797e('0x17')](function(_0x2e1238){_0x732659(null,_[_0x797e('0x45')](_0x2e1238)?![]:!![]);})['catch'](function(_0x460387){logger[_0x797e('0x30')](_0x460387);_0x732659(null,![]);});};AGIVertices[_0x797e('0x14')][_0x797e('0x58')]=function(_0x1194c1,_0x2d92c9){sh[_0x797e('0x59')](_[_0x797e('0x5a')](_0x1194c1),function(_0x55f0b3,_0x5734c0){var _0x427b63=_0x5734c0['replace'](/(\r\n|\n|\r)/gm,'');_0x2d92c9(null,_0x427b63);});};AGIVertices[_0x797e('0x14')][_0x797e('0x5b')]=function(_0x5ab7e7,_0x133880){scripts[_0x797e('0x5b')](_0x5ab7e7['apiKey'],_0x5ab7e7[_0x797e('0x5c')]||'text',_0x5ab7e7[_0x797e('0x5d')],_0x5ab7e7[_0x797e('0x5e')]||_0x797e('0x5f'),_0x5ab7e7['ssmlGender']||_0x797e('0x60'),_0x5ab7e7[_0x797e('0x61')]||_0x797e('0x62'))[_0x797e('0x17')](function(_0x20fc9e){_0x133880(null,_0x20fc9e);})[_0x797e('0x18')](function(_0x5a7dbf){_0x133880(_0x5a7dbf);});};AGIVertices[_0x797e('0x14')][_0x797e('0x63')]=function(_0x255c96,_0x48c607){scripts[_0x797e('0x63')](_0x255c96['text'],_0x255c96[_0x797e('0x64')]||'en',0x1)[_0x797e('0x17')](function(_0x347bfe){_0x48c607(null,_0x347bfe);})[_0x797e('0x18')](function(_0x1ca634){_0x48c607(_0x1ca634);});};AGIVertices[_0x797e('0x14')][_0x797e('0x65')]=function(_0x5aaf14,_0x472494){var _0x2c86cd={'uri':_0x5aaf14['url'],'method':_0x5aaf14[_0x797e('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5aaf14[_0x797e('0x67')])===_0x797e('0x68')&&parseInt(_0x5aaf14[_0x797e('0x67')])>=0x1?parseInt(_0x5aaf14['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x797e('0x69')]([_0x797e('0x6a'),_0x797e('0x6b')],_0x2c86cd[_0x797e('0x66')][_0x797e('0x6c')]())){try{_0x2c86cd['body']=_0x5aaf14[_0x797e('0xe')]?JSON[_0x797e('0x6d')](_0x5aaf14['rawBody']):{};}catch(_0x62e71){logger['error'](_0x797e('0x6e'),_0x62e71);}}try{_0x2c86cd[_0x797e('0x6f')]=_0x5aaf14[_0x797e('0xd')]?JSON[_0x797e('0x6d')](_0x5aaf14['rawHeaders']):{};}catch(_0x225aee){logger[_0x797e('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x225aee);}if(_0x5aaf14[_0x797e('0x70')]){try{var _0x543322=require(_0x5aaf14[_0x797e('0x70')])[_0x797e('0x71')](this,_0x2c86cd);_0x2c86cd[_0x797e('0x72')]=Mustache[_0x797e('0x73')](_0x5aaf14[_0x797e('0x74')],_0x543322,{},['$$','$$']);if(_0x2c86cd[_0x797e('0x6f')]){_0x2c86cd['headers']=JSON[_0x797e('0x6d')](Mustache[_0x797e('0x73')](JSON[_0x797e('0x75')](_0x2c86cd['headers']),_0x543322,{},['$$','$$']));}if(_0x2c86cd[_0x797e('0x76')]){_0x2c86cd['body']=JSON[_0x797e('0x6d')](Mustache['render'](JSON[_0x797e('0x75')](_0x2c86cd[_0x797e('0x76')]),_0x543322,{},['$$','$$']));}}catch(_0xe9a8db){logger[_0x797e('0x30')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe9a8db);}}rp(_0x2c86cd)['then'](function(_0x610e11){var _0xb3292e={'statusCode':_0x610e11[_0x797e('0x77')]||0xc8,'statusMessage':_0x610e11['statusMessage']||'OK','headers':_0x610e11['headers']||{},'body':_0x610e11['body']||{}};_0x472494(null,_0xb3292e);})[_0x797e('0x18')](function(_0x45998b){var _0x3de89c={'statusCode':_0x45998b[_0x797e('0x77')]||0x1f4,'statusMessage':_0x45998b[_0x797e('0x78')]||_0x797e('0x79'),'headers':_0x45998b[_0x797e('0x7a')][_0x797e('0x6f')]||{},'body':_0x45998b['options']['body']||{}};_0x472494(null,_0x3de89c);});};AGIVertices[_0x797e('0x14')][_0x797e('0x7b')]=function(_0x344b59,_0x4f944b){scripts[_0x797e('0x7b')](this[_0x797e('0x11')][_0x797e('0x39')],_0x344b59['key'],_0x344b59[_0x797e('0x5d')],_0x344b59[_0x797e('0x7c')]||'en')[_0x797e('0x17')](function(_0x767d91){_0x4f944b(null,_0x767d91);})['catch'](function(_0x368929){_0x4f944b(_0x368929);});};AGIVertices[_0x797e('0x14')]['googleDialogflowV2']=function(_0x423c92,_0x514a67){scripts[_0x797e('0x7d')](this[_0x797e('0x11')][_0x797e('0x39')],_0x423c92['dialogflowV2_project_id'],_0x423c92[_0x797e('0x7e')],_0x423c92[_0x797e('0x7f')],_0x423c92[_0x797e('0x5d')],_0x423c92[_0x797e('0x80')]||'en')['then'](function(_0x3c67f9){_0x514a67(null,_0x3c67f9);})[_0x797e('0x18')](function(_0x132758){_0x514a67(_0x132758);});};AGIVertices[_0x797e('0x14')][_0x797e('0x81')]=function(_0x4c13a8,_0x384f6f){scripts[_0x797e('0x81')](this[_0x797e('0x11')],_0x4c13a8)[_0x797e('0x17')](function(_0x42db46){_0x384f6f(null,_0x42db46);})[_0x797e('0x18')](function(_0x1752fd){_0x384f6f(_0x1752fd);});};AGIVertices[_0x797e('0x14')][_0x797e('0x82')]=function(_0x411678,_0x2f23ca){scripts[_0x797e('0x82')](_0x411678['key'],_0x411678[_0x797e('0x5d')],_0x411678[_0x797e('0x83')]||_0x797e('0x5f'),_0x411678[_0x797e('0x84')])['then'](function(_0x5709d6){_0x2f23ca(null,_0x5709d6);})['catch'](function(_0x3da493){_0x2f23ca(_0x3da493);});};AGIVertices[_0x797e('0x14')][_0x797e('0x85')]=function(_0x5d075a,_0x2a5a36,_0x42f948){scripts[_0x797e('0x85')](_0x2a5a36,_0x5d075a[_0x797e('0x86')],_0x5d075a[_0x797e('0x87')]||_0x797e('0x5f'),this[_0x797e('0x88')](_0x5d075a[_0x797e('0x89')])?_0x5d075a[_0x797e('0x89')]:undefined)['then'](function(_0x2dd8b3){_0x42f948(null,_0x2dd8b3);})[_0x797e('0x18')](function(_0x23205e){_0x42f948(_0x23205e);});};AGIVertices['prototype'][_0x797e('0x8a')]=function(_0x68f24a,_0x1c33ab){scripts[_0x797e('0x8a')](_0x68f24a['aws_access_key_id'],_0x68f24a['aws_secret_access_key'],_0x68f24a[_0x797e('0x8b')],_0x68f24a[_0x797e('0x8c')]||'Amy',_0x68f24a[_0x797e('0x5d')],_0x68f24a[_0x797e('0x8d')]||_0x797e('0x5d'))[_0x797e('0x17')](function(_0x8d2056){_0x1c33ab(null,_0x8d2056);})[_0x797e('0x18')](function(_0x22aa63){_0x1c33ab(_0x22aa63);});};AGIVertices[_0x797e('0x14')]['awsLex']=function(_0x26ce84,_0x581dd2){scripts['awsLex'](this[_0x797e('0x11')]['uniqueid'],_0x26ce84['aws_access_key_id'],_0x26ce84[_0x797e('0x8e')],_0x26ce84[_0x797e('0x8f')],_0x26ce84[_0x797e('0x5d')],_0x26ce84[_0x797e('0x90')])[_0x797e('0x17')](function(_0x205945){_0x581dd2(null,_0x205945);})[_0x797e('0x18')](function(_0x5ace54){_0x581dd2(_0x5ace54);});};AGIVertices[_0x797e('0x14')][_0x797e('0x91')]=function(_0x136f90,_0x552669,_0x53aa0e){scripts[_0x797e('0x91')](_0x552669,_0x136f90[_0x797e('0x86')],_0x136f90['google_asr_language']||_0x797e('0x5f'))['then'](function(_0x595209){_0x53aa0e(null,_0x595209);})[_0x797e('0x18')](function(_0x3d3edb){_0x53aa0e(_0x3d3edb);});};AGIVertices['prototype'][_0x797e('0x92')]=function(_0x16d5e9,_0x3318b1,_0x148de8){scripts[_0x797e('0x92')](_0x3318b1,_0x16d5e9[_0x797e('0x93')],_0x16d5e9[_0x797e('0x94')],_0x16d5e9[_0x797e('0x72')])[_0x797e('0x17')](function(_0x55ac3d){_0x148de8(null,_0x55ac3d);})['catch'](function(_0x371b94){_0x148de8(_0x371b94);});};AGIVertices[_0x797e('0x14')][_0x797e('0x95')]=function(_0x2c9a47){var _0x41e08c=_['includes'](verticesWithRetry,_0x2c9a47[_0x797e('0x96')])?_0x2c9a47:_[_0x797e('0x97')](_0x2c9a47);for(var _0x58e11c in _0x41e08c){if(_0x41e08c[_0x797e('0x98')](_0x58e11c)){if(_0x41e08c[_0x58e11c]&&_[_0x797e('0x99')](_0x41e08c[_0x58e11c])){if(_[_0x797e('0x69')](recursiveMapAttributes,_0x58e11c)){_0x41e08c[_0x58e11c]=this[_0x797e('0x9a')](_0x41e08c[_0x58e11c]);}else{_0x41e08c[_0x58e11c]=this[_0x797e('0x9b')](_0x41e08c[_0x58e11c]);}}}}return _0x41e08c;};AGIVertices[_0x797e('0x14')]['recursiveNodeIndex']=function(_0x46fa5a){for(var _0x51c990 in _0x46fa5a){if(_0x46fa5a[_0x797e('0x98')](_0x51c990)){if(_['isPlainObject'](_0x46fa5a[_0x51c990])){this[_0x797e('0x9c')](_0x46fa5a[_0x51c990]);}else if(_[_0x797e('0x9d')](_0x46fa5a[_0x51c990])){for(var _0xe832a7=0x0;_0xe832a7<_0x46fa5a[_0x51c990]['length'];_0xe832a7++){this[_0x797e('0x9c')](_0x46fa5a[_0x51c990][_0xe832a7]);}}else if(_[_0x797e('0x99')](_0x46fa5a[_0x51c990])){_0x46fa5a[_0x51c990]=this[_0x797e('0x9b')](_0x46fa5a[_0x51c990]);}}}};AGIVertices[_0x797e('0x14')][_0x797e('0x9e')]=function(_0x401d5b,_0x48692c){for(var _0x39d73e in _0x401d5b){if(_0x401d5b[_0x797e('0x98')](_0x39d73e)){if(_[_0x797e('0x9f')](_0x401d5b[_0x39d73e])){if(!_[_0x797e('0x44')](_0x401d5b[_0x39d73e])){this[_0x797e('0x9e')](_0x401d5b[_0x39d73e],util[_0x797e('0x2d')](_0x797e('0xa0'),_0x48692c,_0x39d73e));}}else if(_[_0x797e('0x9d')](_0x401d5b[_0x39d73e])){for(var _0x13c45a=0x0;_0x13c45a<_0x401d5b[_0x39d73e][_0x797e('0xa1')];_0x13c45a++){this['saveRestApiResult'](_0x401d5b[_0x39d73e][_0x13c45a],util[_0x797e('0x2d')]('%s.%s',_0x48692c,_0x39d73e+'['+_0x13c45a+']'));}}else{if(!_[_0x797e('0x45')](_0x401d5b[_0x39d73e])){this['channel'][_0x797e('0xa2')](util['format']('%s.%s',_0x48692c,_0x39d73e),_0x401d5b[_0x39d73e]);}}}}};AGIVertices[_0x797e('0x14')][_0x797e('0x9a')]=function(_0x59ccce){try{var _0x34ddb4=JSON[_0x797e('0x6d')](_0x59ccce);this[_0x797e('0x9c')](_0x34ddb4);return JSON[_0x797e('0x75')](_0x34ddb4);}catch(_0x1eb1f3){return this[_0x797e('0x9b')](_0x59ccce);}};AGIVertices[_0x797e('0x14')]['replaceAllVariables']=function(_0x47a61d){var _0x35af5f=_0x47a61d['split']('{');for(var _0x440fd5=0x1;_0x440fd5<_0x35af5f[_0x797e('0xa1')];_0x440fd5+=0x1){var _0xb7bca4=_0x35af5f[_0x440fd5][_0x797e('0xa3')]('}');if(_0xb7bca4[_0x797e('0xa1')]>0x1){_0x47a61d=_0x47a61d['replaceAll']('{'+_0xb7bca4[0x0]+'}',this[_0x797e('0x11')][_0x797e('0x15')](_0xb7bca4[0x0])[_0x797e('0xa4')]||_0xb7bca4[0x0]);}}if(_0x35af5f[_0x797e('0xa1')]===0x1){return _0x47a61d[_0x797e('0x4c')]();}return this[_0x797e('0x9b')](_0x47a61d);};AGIVertices['prototype'][_0x797e('0xa5')]=function(_0x2a250c,_0x4af4f6){var _0x2af9a5=this['channel'][_0x797e('0x15')](_0x2a250c);if(_0x2af9a5[_0x797e('0xa6')]===-0x1){return _0x2af9a5;}logger[_0x797e('0x32')](util[_0x797e('0x2d')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4af4f6,_0x2af9a5[_0x797e('0xa4')]));return this['channel'][_0x797e('0xa2')](_0x4af4f6,_0x2af9a5[_0x797e('0xa4')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x88')]=function(_0x54c7ec){return _0x54c7ec&&_0x54c7ec!=='0'&&_0x54c7ec!=='-1'&&_0x54c7ec!=='';};AGIVertices['prototype'][_0x797e('0xa7')]=function(_0x48cc9e){this[_0x797e('0x38')][_0x797e('0x71')](this,_0x48cc9e,'-');_0x48cc9e[_0x797e('0xa8')]=_0x48cc9e['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x797e('0x14')][_0x797e('0xa9')]=function(_0x129932){logger['info'](util[_0x797e('0x2d')](_0x797e('0xaa'),_0x129932[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x129932[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}var _0x33d28f='\x22'+_0x129932[_0x797e('0x5d')]+'\x22';if(this['isConfigured'](_0x129932[_0x797e('0x7a')])){_0x33d28f+=','+_0x129932['options'];}var _0x4ee95f=this[_0x797e('0x11')]['exec']('MRCPSynth',_0x33d28f);if(_0x4ee95f[_0x797e('0xa6')]===-0x1){return _0x4ee95f;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xad'),_0x33d28f));};AGIVertices[_0x797e('0x14')][_0x797e('0xae')]=function(_0x6441ae){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xaf'),_0x6441ae[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x6441ae[_0x797e('0xb0')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xb1'));}var _0x1453f0=_0x6441ae[_0x797e('0xb0')];if(this[_0x797e('0x88')](_0x6441ae[_0x797e('0x7a')])){_0x1453f0+=','+_0x6441ae[_0x797e('0x7a')];}var _0x35e8c5=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xb2'),_0x1453f0);if(_0x35e8c5[_0x797e('0xa6')]===-0x1){return _0x35e8c5;}var _0x1d9536=this['getAndSetVariable'](_0x797e('0xb3'),_0x797e('0xb4'));if(_0x1d9536[_0x797e('0xa6')]===-0x1){return _0x1d9536;}var _0x3572c0=this[_0x797e('0xa5')](_0x797e('0xb5'),'MRCP_RECOG_TRANSCRIPT');if(_0x3572c0[_0x797e('0xa6')]===-0x1){return _0x3572c0;}var _0x4a5003=this['getAndSetVariable'](_0x797e('0xb6'),_0x797e('0xb7'));if(_0x4a5003[_0x797e('0xa6')]===-0x1){return _0x4a5003;}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0xb8'),_0x1453f0));};AGIVertices[_0x797e('0x14')]['agi']=function(_0x2f60df){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xb9'),_0x2f60df[_0x797e('0x3a')]));return this['channel'][_0x797e('0x8')]([_0x2f60df['command'],_0x2f60df[_0x797e('0xba')]]);};AGIVertices[_0x797e('0x14')][_0x797e('0xbb')]=function(_0x46fcbc){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x46fcbc[_0x797e('0x3a')]));if(this[_0x797e('0x88')](_0x46fcbc['timeout'])){logger['info'](util[_0x797e('0x2d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x46fcbc[_0x797e('0x67')]));var _0x4b7785=this[_0x797e('0x11')][_0x797e('0xbc')](_0x46fcbc[_0x797e('0x67')]);if(_0x4b7785[_0x797e('0xa6')]===-0x1){return _0x4b7785;}}return this[_0x797e('0x11')][_0x797e('0xbb')]();};AGIVertices[_0x797e('0x14')][_0x797e('0x4a')]=function(_0x51b16d){logger['info'](util[_0x797e('0x2d')](_0x797e('0xbd'),_0x51b16d['label']));if(!this['isConfigured'](_0x51b16d[_0x797e('0x48')])){return this[_0x797e('0x11')]['error'](_0x51b16d,_0x797e('0xbe'));}_0x51b16d[_0x797e('0x49')]=moment();if(this[_0x797e('0x88')](_0x51b16d[_0x797e('0xbf')])){_0x51b16d[_0x797e('0x49')]=moment()[_0x797e('0xc0')](_0x51b16d[_0x797e('0xbf')],_0x797e('0xc1'));}if(!this['isConfigured'](_0x51b16d[_0x797e('0x4d')])){_0x51b16d['callback_priority']=0x2;}this[_0x797e('0x43')][_0x797e('0x71')](this,_0x51b16d);return this[_0x797e('0x11')][_0x797e('0xab')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x51b16d[_0x797e('0xc2')],_0x51b16d['list_id'],_0x51b16d['scheduledAt']));};AGIVertices[_0x797e('0x14')][_0x797e('0xc3')]=function(_0x107c1a){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x107c1a[_0x797e('0x3a')]));var _0x5cf9a5=this['channel'][_0x797e('0x59')](_0x107c1a['application'],_0x107c1a[_0x797e('0x7a')]);if(_0x5cf9a5[_0x797e('0xa6')]===-0x1){return _0x5cf9a5;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xc4'),_0x107c1a[_0x797e('0xc5')],_0x107c1a['options']));};AGIVertices[_0x797e('0x14')][_0x797e('0xc6')]=function(_0x484d56){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x484d56[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x484d56[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}var _0x4c19c7='\x22'+_0x484d56[_0x797e('0x5d')]+'\x22';if(this[_0x797e('0x88')](_0x484d56[_0x797e('0x7a')])){_0x4c19c7+=','+_0x484d56[_0x797e('0x7a')];}var _0x3ec564=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xc7'),_0x4c19c7);if(_0x3ec564[_0x797e('0xa6')]===-0x1){return _0x3ec564;}return this[_0x797e('0x11')][_0x797e('0xab')](util['format'](_0x797e('0xad'),_0x4c19c7));};AGIVertices[_0x797e('0x14')][_0x797e('0xc8')]=function(_0xe9975b){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xe9975b['label']));if(!this['isConfigured'](_0xe9975b[_0x797e('0x5d')])){return this['channel'][_0x797e('0xab')](_0x797e('0xac'));}var _0x3e1fce='\x22'+_0xe9975b[_0x797e('0x5d')]+'\x22';if(this['isConfigured'](_0xe9975b[_0x797e('0x7a')])){_0x3e1fce+=','+_0xe9975b[_0x797e('0x7a')];}var _0x40328e=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xc7'),_0x3e1fce);if(_0x40328e[_0x797e('0xa6')]===-0x1){return _0x40328e;}return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3e1fce));};AGIVertices[_0x797e('0x14')][_0x797e('0xc9')]=function(_0x527c37){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xca'),_0x527c37[_0x797e('0x3a')]));if(!this['isConfigured'](_0x527c37[_0x797e('0xb0')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xb1'));}var _0x48903a=_0x527c37[_0x797e('0xb0')];if(this[_0x797e('0x88')](_0x527c37['options'])){_0x48903a+=','+_0x527c37['options'];}var _0x58231b=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xb2'),_0x48903a);if(_0x58231b['result']===-0x1){return _0x58231b;}var _0x4d0b7b=this[_0x797e('0xa5')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x4d0b7b['result']===-0x1){return _0x4d0b7b;}var _0x251e8d=this['getAndSetVariable'](_0x797e('0xb5'),_0x797e('0xcb'));if(_0x251e8d[_0x797e('0xa6')]===-0x1){return _0x251e8d;}var _0x321f8e=this[_0x797e('0xa5')](_0x797e('0xb6'),'LUMENVOX_ASR_INSTANCE');if(_0x321f8e['result']===-0x1){return _0x321f8e;}return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x48903a));};AGIVertices[_0x797e('0x14')][_0x797e('0xcc')]=function(_0x284eb2){logger['info'](util[_0x797e('0x2d')](_0x797e('0xcd'),_0x284eb2[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x284eb2[_0x797e('0xb0')])){return this['channel'][_0x797e('0xab')](_0x797e('0xb1'));}var _0x5423a6=_0x284eb2[_0x797e('0xb0')];if(this[_0x797e('0x88')](_0x284eb2[_0x797e('0x7a')])){_0x5423a6+=','+_0x284eb2[_0x797e('0x7a')];}var _0x3c655e=this[_0x797e('0x11')][_0x797e('0x59')](_0x797e('0xb2'),_0x5423a6);if(_0x3c655e[_0x797e('0xa6')]===-0x1){return _0x3c655e;}var _0x4dc1c5=this[_0x797e('0xa5')](_0x797e('0xb3'),_0x797e('0xce'));if(_0x4dc1c5[_0x797e('0xa6')]===-0x1){return _0x4dc1c5;}var _0x47a8ea=this[_0x797e('0xa5')](_0x797e('0xb5'),'SESTEK_ASR_TRANSCRIPT');if(_0x47a8ea[_0x797e('0xa6')]===-0x1){return _0x47a8ea;}var _0x319fb3=this['getAndSetVariable'](_0x797e('0xb6'),_0x797e('0xcf'));if(_0x319fb3[_0x797e('0xa6')]===-0x1){return _0x319fb3;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xb8'),_0x5423a6));};AGIVertices[_0x797e('0x14')][_0x797e('0xd0')]=function(_0x46e7b4){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x46e7b4[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x46e7b4[_0x797e('0xd1')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x46e7b4,_0x797e('0xd2'));}var _0x4222f3=this[_0x797e('0xd3')]['sync'](this,_0x46e7b4[_0x797e('0xd1')]);if(!_0x4222f3){return this[_0x797e('0x11')]['error'](_0x46e7b4,_0x797e('0xd4'));}if(!this['isConfigured'](_0x46e7b4[_0x797e('0xd5')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x46e7b4,_0x797e('0xd6'));}var _0xa81849=_0x46e7b4[_0x797e('0xd5')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('query:\x20%s',_0xa81849));var _0x42ab05=this['getQueryOdbc']['sync'](this,_0x4222f3,_0xa81849);this[_0x797e('0x38')][_0x797e('0x71')](this,_0x46e7b4,_0xa81849);if(!this['isConfigured'](_0x46e7b4[_0x797e('0xd7')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xd8'));}var _0x347044=this[_0x797e('0x15')]['sync'](this,_0x46e7b4['variable_id']);if(!_0x347044){return this[_0x797e('0x11')][_0x797e('0x30')](_0x46e7b4,_0x797e('0xd9'));}var _0x255e1d=this;_0x42ab05['forEach'](function(_0x3d30d3,_0x2764f3){Object['keys'](_0x3d30d3)['forEach'](function(_0x4b4fca){_0x255e1d['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xda'),_0x347044,_0x2764f3,_0x4b4fca),_0x3d30d3[_0x4b4fca]);});});this['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xdb'),_0x347044),_0x42ab05[_0x797e('0xa1')]);return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xdc'),_0x347044));};AGIVertices['prototype'][_0x797e('0xdd')]=function(_0x2c8149){logger[_0x797e('0xde')](util['format'](_0x797e('0xdf'),_0x2c8149[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x2c8149[_0x797e('0xe0')])){return this['channel'][_0x797e('0x30')](_0x2c8149,_0x797e('0xe1'));}var _0x486f41=this[_0x797e('0xe2')][_0x797e('0x71')](this,_0x2c8149['sip_id']);if(!_0x486f41){return this['channel'][_0x797e('0x30')](_0x2c8149,'no\x20user\x20found');}var _0x4b5806=this['channel'][_0x797e('0x59')](_0x797e('0xe3'),[util[_0x797e('0x2d')](_0x797e('0xe4'),_0x486f41),_0x2c8149[_0x797e('0x67')],_0x2c8149[_0x797e('0xe5')],_0x2c8149['url']]);if(_0x4b5806[_0x797e('0xa6')]===-0x1){return _0x4b5806;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xe6'),'DIAL'));};AGIVertices[_0x797e('0x14')][_0x797e('0xe7')]=function(_0x502524){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xe8'),_0x502524[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x502524['key'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}if(!this[_0x797e('0x88')](_0x502524[_0x797e('0x5d')])){return this[_0x797e('0x11')]['noop'](_0x797e('0xac'));}this[_0x797e('0x11')]['bot']=!![];this[_0x797e('0x38')](_0x502524);this[_0x797e('0x42')](_0x502524[_0x797e('0x5d')],'in','','');this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xea'),_0x502524[_0x797e('0x5d')]));var _0x31c156=this[_0x797e('0x7b')][_0x797e('0x71')](this,_0x502524);if(_0x31c156){for(var _0x505280 in _0x31c156){if(_0x31c156[_0x797e('0x98')](_0x505280)){this['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xeb'),_0x505280[_0x797e('0x6c')]()),_0x31c156[_0x505280]);}}this[_0x797e('0x42')](_0x31c156[_0x797e('0xec')],_0x797e('0xed'),'dialogflow','');return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('Dialogflow\x20Result\x20%s',_0x31c156[_0x797e('0xec')]));}return this[_0x797e('0x11')][_0x797e('0x30')](_0x502524,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x797e('0x14')][_0x797e('0xee')]=function(_0x3f5fa5){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0xef'),_0x3f5fa5['label']));if(!this[_0x797e('0x88')](_0x3f5fa5[_0x797e('0xf0')])){return this['channel'][_0x797e('0xab')](_0x797e('0xf1'));}if(!this['isConfigured'](_0x3f5fa5['client_email'])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20client_email\x20configured');}if(!this[_0x797e('0x88')](_0x3f5fa5['private_key'])){return this['channel'][_0x797e('0xab')](_0x797e('0xf2'));}if(!this[_0x797e('0x88')](_0x3f5fa5['dialogflowV2_language'])){return this['channel'][_0x797e('0xab')](_0x797e('0xf3'));}if(!this[_0x797e('0x88')](_0x3f5fa5[_0x797e('0x5d')])){return this['channel'][_0x797e('0xab')](_0x797e('0xac'));}this[_0x797e('0x11')][_0x797e('0xf4')]=!![];this[_0x797e('0x38')](_0x3f5fa5);this['createSquareMessage'](_0x3f5fa5['text'],'in','','');this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xf5'),_0x3f5fa5[_0x797e('0x5d')]));var _0x7863df=this[_0x797e('0x7d')][_0x797e('0x71')](this,_0x3f5fa5);if(_0x7863df){for(var _0x1b84b5 in _0x7863df){if(_0x7863df[_0x797e('0x98')](_0x1b84b5)){if(_0x1b84b5!==_0x797e('0xf6')){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0xeb'),_0x1b84b5[_0x797e('0x6c')]()),_0x7863df[_0x1b84b5]);}}}this[_0x797e('0x42')](_0x7863df[_0x797e('0xec')],_0x797e('0xed'),_0x797e('0xee'),_0x7863df[_0x797e('0xf6')]);return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xf7'),_0x7863df['speech']));}return this[_0x797e('0x11')]['error'](_0x3f5fa5,_0x797e('0xf8'));};AGIVertices[_0x797e('0x14')][_0x797e('0xf9')]=function(_0x853b21){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x853b21[_0x797e('0x3a')]));if(!this['isConfigured'](_0x853b21['ndauth_url'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xfa'));}if(!this[_0x797e('0x88')](_0x853b21['username'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xfb'));}if(!this[_0x797e('0x88')](_0x853b21[_0x797e('0xfc')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xfd'));}if(!this[_0x797e('0x88')](_0x853b21[_0x797e('0xfe')])){return this[_0x797e('0x11')]['noop'](_0x797e('0xac'));}this[_0x797e('0x11')]['bot']=!![];this[_0x797e('0x38')](_0x853b21);this[_0x797e('0x42')](_0x853b21['text'],'in','','');this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0xff'),_0x853b21[_0x797e('0x5d')]));var _0x199599=this['sestekNDA'][_0x797e('0x71')](this,_0x853b21);if(_0x199599){for(var _0x35ed1e in _0x199599){if(_0x199599[_0x797e('0x98')](_0x35ed1e)){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x100'),_0x35ed1e['toUpperCase']()),_0x199599[_0x35ed1e]);}}this[_0x797e('0x42')](_0x199599['speech'],_0x797e('0xed'),_0x797e('0xf9'),'');if(_0x199599[_0x797e('0x101')]){this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0x102'),_0x199599[_0x797e('0x101')]));var _0x27329c=this['channel']['streamFile'](_0x199599[_0x797e('0x101')]);try{fs[_0x797e('0x103')](_0x199599[_0x797e('0x101')]+_0x797e('0x104'));}catch(_0x55f854){logger['error'](_0x55f854);}return _0x27329c;}else{return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')]('SestekNDA\x20Result\x20%s',_0x199599[_0x797e('0xec')]));}}return this[_0x797e('0x11')][_0x797e('0x30')](_0x853b21,_0x797e('0x105'));};AGIVertices[_0x797e('0x14')]['end']=function(_0x547415){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x547415[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x106'));};AGIVertices[_0x797e('0x14')]['ext_dial']=function(_0x19809e){logger[_0x797e('0x32')](util['format'](_0x797e('0x107'),_0x19809e[_0x797e('0x3a')]));var _0x5386e6='';if(_0x19809e[_0x797e('0x108')]){if(!this['isConfigured'](_0x19809e[_0x797e('0x108')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x19809e,_0x797e('0x109'));}else{var _0x5d9f79=parseInt(_0x19809e[_0x797e('0x108')],0xa);if(isNaN(_0x5d9f79)){_0x5386e6=_0x19809e[_0x797e('0x108')];}else{_0x5386e6=this[_0x797e('0x1f')][_0x797e('0x71')](this,_0x19809e['trunk_id']);if(!_0x5386e6){return this['channel'][_0x797e('0x30')](_0x19809e,_0x797e('0x10a'));}}}}else if(_0x19809e[_0x797e('0x10b')]){_0x5386e6=_0x19809e['trunk_name'];}else{return this[_0x797e('0x11')][_0x797e('0x30')](_0x19809e,_0x797e('0x109'));}var _0x334b26=this['channel'][_0x797e('0x59')](_0x797e('0xe3'),[util[_0x797e('0x2d')](_0x797e('0x10c'),_0x5386e6,_0x19809e['phone']),_0x19809e['timeout'],_0x19809e['opts'],_0x19809e[_0x797e('0x74')]]);if(_0x334b26[_0x797e('0xa6')]===-0x1){return _0x334b26;}return this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0xe6'),_0x797e('0xe3')));};AGIVertices[_0x797e('0x14')][_0x797e('0x10d')]=function(_0x125a9c){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x125a9c[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')]('finally');};AGIVertices[_0x797e('0x14')][_0x797e('0xf')]=function(_0x54b13b){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x10e'),_0x54b13b[_0x797e('0x3a')]));if(_0x54b13b['retry']===0x0){return this[_0x797e('0xa7')](_0x54b13b);}_0x54b13b['retry']-=0x1;if(!this['isConfigured'](_0x54b13b[_0x797e('0x10f')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x54b13b,_0x797e('0x110'));}var _0x539c09=this[_0x797e('0x21')][_0x797e('0x71')](this,_0x54b13b[_0x797e('0x10f')]);if(!_0x539c09){return this[_0x797e('0x11')]['error'](_0x54b13b,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x54b13b[_0x797e('0xd7')])){return this[_0x797e('0x11')][_0x797e('0x30')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x49da2d=this[_0x797e('0x11')][_0x797e('0x111')](_0x539c09,_0x54b13b[_0x797e('0x112')],_0x54b13b[_0x797e('0x113')]);var _0x342459=_0x49da2d[_0x797e('0xa6')]?_0x49da2d[_0x797e('0xa6')][_0x797e('0x4c')]():'';logger['info'](_0x797e('0x114'),JSON[_0x797e('0x75')](_0x49da2d));if(_0x49da2d[_0x797e('0xa6')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x54b13b,_0x342459);return _0x49da2d;}else if(_0x49da2d['extra']===_0x797e('0x67')){_0x49da2d['result']=_0x342459[_0x797e('0xa1')]>=parseInt(_0x54b13b[_0x797e('0x115')])?'x':'i';}else{_0x49da2d[_0x797e('0xa6')]=_0x342459['length']>=parseInt(_0x54b13b['mindigit'])&&_0x342459[_0x797e('0xa1')]<=parseInt(_0x54b13b['maxdigit'])?'x':'i';}var _0x18870e=this['getVariable']['sync'](this,_0x54b13b[_0x797e('0xd7')]);if(!_0x18870e){return this[_0x797e('0x11')]['error'](_0x54b13b,_0x797e('0xd9'));}this['channel'][_0x797e('0xa2')](_0x18870e,_0x342459);if(this[_0x797e('0x88')](_0x54b13b[_0x797e('0x116')])){var _0x4df0f4=parseInt(_0x54b13b[_0x797e('0x116')],0xa);var _0x40628b=rs[_0x797e('0x117')]({'charset':'*','length':_0x4df0f4});var _0x1f1385=_0x342459[_0x797e('0xa1')];if(_0x1f1385>0x0){if(_0x1f1385>_0x4df0f4){this['createSquareDetailsReport'][_0x797e('0x71')](this,_0x54b13b,_0x54b13b['hiddendigitspos']===_0x797e('0x118')?_0x40628b+_0x342459[_0x797e('0x119')](_0x4df0f4):_0x342459['substr'](0x0,_0x1f1385-_0x4df0f4)+_0x40628b);}else{this[_0x797e('0x38')]['sync'](this,_0x54b13b,rs[_0x797e('0x117')]({'charset':'*','length':_0x1f1385}));}}else{this[_0x797e('0x38')][_0x797e('0x71')](this,_0x54b13b,'');}}else{this[_0x797e('0x38')][_0x797e('0x71')](this,_0x54b13b,_0x342459);}return _0x49da2d;};AGIVertices[_0x797e('0x14')][_0x797e('0x10')]=function(_0x52502e){logger['info'](util[_0x797e('0x2d')](_0x797e('0x11a'),_0x52502e[_0x797e('0x3a')]));return this[_0x797e('0xf')](_0x52502e);};AGIVertices['prototype'][_0x797e('0x11b')]=function(_0x4e691f){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x11c'),_0x4e691f['label']));this['createSquareDetailsReport'][_0x797e('0x71')](this,_0x4e691f,_0x4e691f[_0x797e('0x11d')]);return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x11e'),_0x4e691f[_0x797e('0x11d')]));};AGIVertices['prototype']['awspolly']=function(_0x1f41da){logger['info'](util[_0x797e('0x2d')](_0x797e('0x11f'),_0x1f41da['label']));if(!this[_0x797e('0x88')](_0x1f41da[_0x797e('0x120')])||!this[_0x797e('0x88')](_0x1f41da[_0x797e('0x8e')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x121'));}if(!this[_0x797e('0x88')](_0x1f41da[_0x797e('0x5d')])){return this[_0x797e('0x11')]['noop']('no\x20text\x20configured');}this[_0x797e('0x11')][_0x797e('0xab')](util['format'](_0x797e('0x122'),_0x1f41da[_0x797e('0x5d')]));var _0x410fbd=this['awsPolly']['sync'](this,_0x1f41da);if(_0x410fbd){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x123'),_0x410fbd));var _0x4f95a6=this[_0x797e('0x11')][_0x797e('0x124')](_0x410fbd);try{fs['unlink'](_0x410fbd+_0x797e('0x104'));}catch(_0x1b8aee){logger['error'](_0x1b8aee);}return _0x4f95a6;}return this[_0x797e('0x11')][_0x797e('0x30')](_0x1f41da,_0x797e('0x125'));};AGIVertices[_0x797e('0x14')][_0x797e('0x126')]=function(_0x55e81a){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x55e81a[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x55e81a['aws_access_key_id'])||!this['isConfigured'](_0x55e81a[_0x797e('0x8e')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x121'));}if(!this['isConfigured'](_0x55e81a['aws_bot_name'])){return this['channel'][_0x797e('0xab')](_0x797e('0x127'));}if(!this[_0x797e('0x88')](_0x55e81a[_0x797e('0x5d')])){return this[_0x797e('0x11')]['noop']('no\x20text\x20configured');}this[_0x797e('0x11')][_0x797e('0xf4')]=!![];this[_0x797e('0x38')](_0x55e81a);this['createSquareMessage'](_0x55e81a[_0x797e('0x5d')],'in','','');this[_0x797e('0x11')]['noop'](util['format'](_0x797e('0x128'),_0x55e81a['text']));var _0x2001cb=this[_0x797e('0x129')][_0x797e('0x71')](this,_0x55e81a);if(_0x2001cb){for(var _0x25e5a0 in _0x2001cb){if(_0x2001cb[_0x797e('0x98')](_0x25e5a0)&&_['isString'](_0x2001cb[_0x25e5a0])){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')]('AWS_LEX_%s',_0x25e5a0[_0x797e('0x6c')]()),_0x2001cb[_0x25e5a0]);}}if(_[_0x797e('0x45')](_0x2001cb[_0x797e('0x78')])){return this[_0x797e('0x11')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x797e('0x42')](_0x2001cb[_0x797e('0x78')],_0x797e('0xed'),_0x797e('0x12a'),'');return this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0x12b'),_0x2001cb['message']));}}return this[_0x797e('0x11')][_0x797e('0x30')](_0x55e81a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype']['googleasr']=function(_0x396b59){logger[_0x797e('0x32')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x396b59[_0x797e('0x3a')],_0x396b59[_0x797e('0x67')]));if(!this['isConfigured'](_0x396b59[_0x797e('0x86')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}var _0x3d5aab=_0x797e('0x12c');var _0x2450ee=util[_0x797e('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0x797e('0x117')](0x4));var _0x3ed2b3=util[_0x797e('0x2d')](_0x797e('0xa0'),_0x2450ee,_0x3d5aab);var _0x37ba32=!![];if(_0x396b59[_0x797e('0x12d')]==='NOBEEP'){_0x37ba32=![];}var _0x5e0c24=this[_0x797e('0x11')][_0x797e('0x12e')](_0x2450ee,_0x3d5aab,_0x396b59['intKey'],_0x396b59[_0x797e('0x67')],undefined,_0x37ba32);if(_0x5e0c24['result']!==-0x1){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x12f'),_0x3ed2b3));var _0xf954fe=this['googleASR'][_0x797e('0x71')](this,_0x396b59,_0x3ed2b3);if(_0xf954fe){for(var _0x22f9d7 in _0xf954fe){if(_0xf954fe['hasOwnProperty'](_0x22f9d7)){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x130'),_0x22f9d7[_0x797e('0x6c')]()),_0xf954fe[_0x22f9d7]);}}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x131'),JSON[_0x797e('0x75')](_0xf954fe)));}}return _0x5e0c24;};AGIVertices[_0x797e('0x14')][_0x797e('0x132')]=function(_0x5f20b3){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x5f20b3['label']));if(!this['isConfigured'](_0x5f20b3[_0x797e('0x93')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x133'));}if(!this[_0x797e('0x88')](_0x5f20b3['appsecret'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x134'));}var _0x9e2f4f=_0x797e('0x12c');var _0x13e2e9=util[_0x797e('0x2d')](_0x797e('0x135'),FILES_PATH,rs[_0x797e('0x117')](0x4));var _0x3a6b6b=util[_0x797e('0x2d')](_0x797e('0xa0'),_0x13e2e9,_0x9e2f4f);var _0x2bbe4d=!![];if(_0x5f20b3['beep']===_0x797e('0x136')){_0x2bbe4d=![];}var _0x4cf606=this[_0x797e('0x11')][_0x797e('0x12e')](_0x13e2e9,_0x9e2f4f,_0x5f20b3[_0x797e('0x137')],_0x5f20b3[_0x797e('0x67')],undefined,_0x2bbe4d);if(_0x4cf606[_0x797e('0xa6')]!==-0x1){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x138'),_0x3a6b6b));var _0x40dfe2=this[_0x797e('0x92')][_0x797e('0x71')](this,_0x5f20b3,_0x3a6b6b);if(_0x40dfe2){for(var _0xb48288 in _0x40dfe2){if(_0x40dfe2[_0x797e('0x98')](_0xb48288)){this[_0x797e('0x11')][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x139'),_0xb48288[_0x797e('0x6c')]()),_0x40dfe2[_0xb48288]);}}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x13a'),JSON[_0x797e('0x75')](_0x40dfe2)));}}return _0x4cf606;};AGIVertices['prototype']['gotoc']=function(_0x23aa48){logger['info'](util[_0x797e('0x2d')](_0x797e('0x13b'),_0x23aa48[_0x797e('0x3a')]));return this['channel']['continueAt'](_0x23aa48[_0x797e('0x13c')],_0x23aa48['extension'],_0x23aa48[_0x797e('0x3f')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x13d')]=function(_0x456e4a){logger[_0x797e('0x32')](util['format'](_0x797e('0x13e'),_0x456e4a[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x456e4a['condition'])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x456e4a,'no\x20condition\x20configured');}try{var _0x165d91=eval(_0x456e4a[_0x797e('0x13f')])?_0x797e('0x140'):_0x797e('0x141');this[_0x797e('0x11')][_0x797e('0xab')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x456e4a[_0x797e('0x13f')],_0x165d91));return{'code':0xc8,'result':_0x165d91};}catch(_0x2f4990){return{'code':0xc8,'result':_0x797e('0x141')};}};AGIVertices['prototype'][_0x797e('0x142')]=function(_0x5387b0){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x143'),_0x5387b0['label']));if(!this[_0x797e('0x88')](_0x5387b0[_0x797e('0x144')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x5387b0,_0x797e('0x145'));}var _0x53c1da=this[_0x797e('0x28')][_0x797e('0x71')](this,_0x5387b0['interval_id']);if(!_0x53c1da){return this['channel'][_0x797e('0x30')](_0x5387b0,'no\x20intervals\x20found');}for(var _0x1d66dc=0x0;_0x1d66dc<_0x53c1da['length'];_0x1d66dc+=0x1){var _0x416253=this[_0x797e('0x11')][_0x797e('0x15')](util['format'](_0x797e('0x146'),_0x53c1da[_0x1d66dc]));if(_0x416253['result']===-0x1){return _0x416253;}logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x416253[_0x797e('0xa4')]));if(_0x416253[_0x797e('0xa4')]===_0x797e('0x140')){logger['info'](util[_0x797e('0x2d')](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x797e('0x140')));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x797e('0x140')));return{'code':0xc8,'result':_0x797e('0x140')};}else{logger[_0x797e('0x32')](util['format'](_0x797e('0x147'),_0x53c1da[_0x1d66dc],_0x797e('0x141')));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('IFTIME\x20%s\x20%s',_0x53c1da[_0x1d66dc],_0x797e('0x141')));}}return{'code':0xc8,'result':_0x797e('0x141')};};AGIVertices[_0x797e('0x14')][_0x797e('0x148')]=function(_0x229f8b){logger['info'](util[_0x797e('0x2d')](_0x797e('0x149'),_0x229f8b[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0x148')]();};AGIVertices[_0x797e('0x14')][_0x797e('0x14a')]=function(_0x33e41e){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x14b'),_0x33e41e['label']));if(!this[_0x797e('0x88')](_0x33e41e[_0x797e('0x86')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}var _0x4e26d1='wav';var _0x57d2f4=util[_0x797e('0x2d')](_0x797e('0x135'),FILES_PATH,rs[_0x797e('0x117')](0x4));var _0x64dc2d=util[_0x797e('0x2d')]('%s.%s',_0x57d2f4,_0x4e26d1);var _0x593ba1=!![];if(_0x33e41e[_0x797e('0x12d')]==='NOBEEP'){_0x593ba1=![];}var _0x1c0b57=this[_0x797e('0x11')]['recordFile'](_0x57d2f4,_0x4e26d1,_0x33e41e['intKey'],_0x33e41e[_0x797e('0x67')],undefined,_0x593ba1);if(_0x1c0b57[_0x797e('0xa6')]!==-0x1){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x14c'),_0x64dc2d));var _0x431228=this[_0x797e('0x85')]['sync'](this,_0x33e41e,_0x64dc2d);if(_0x431228){for(var _0xc32c5e in _0x431228){if(_0x431228[_0x797e('0x98')](_0xc32c5e)){this[_0x797e('0x11')]['setVariable'](util[_0x797e('0x2d')](_0x797e('0x14d'),_0xc32c5e[_0x797e('0x6c')]()),_0x431228[_0xc32c5e]);}}return this[_0x797e('0x11')][_0x797e('0xab')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x797e('0x75')](_0x431228)));}}return _0x1c0b57;};AGIVertices[_0x797e('0x14')][_0x797e('0x14e')]=function(_0x1c5d82){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x14f'),_0x1c5d82[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x1c5d82[_0x797e('0x86')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xe9'));}if(!this['isConfigured'](_0x1c5d82[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}this['channel'][_0x797e('0xab')](util['format'](_0x797e('0x150'),_0x1c5d82[_0x797e('0x5d')]));var _0x180213=this['ispeechTTS'][_0x797e('0x71')](this,_0x1c5d82);if(_0x180213){this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x14c'),_0x180213));var _0x2a4a9f=this[_0x797e('0x11')]['streamFile'](_0x180213,_0x1c5d82['intKey']);try{fs[_0x797e('0x103')](_0x180213+_0x797e('0x104'));}catch(_0x50bb75){logger[_0x797e('0x30')](_0x50bb75);}return _0x2a4a9f;}return this[_0x797e('0x11')][_0x797e('0x30')](_0x1c5d82,_0x797e('0x151'));};AGIVertices['prototype'][_0x797e('0x152')]=function(_0x594f6f){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x153'),_0x594f6f[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x594f6f['findBy'])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x594f6f,_0x797e('0x154'));}logger[_0x797e('0x32')](util['format'](_0x797e('0x155'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x594f6f['findBy']));var _0x4c0ac6=this[_0x797e('0x54')][_0x797e('0x71')](this,_0x594f6f['findBy']);if(_0x4c0ac6){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x156'),this[_0x797e('0x11')]['callerid'],_0x594f6f[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x156'),this['channel'][_0x797e('0x3d')],_0x594f6f['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x158'),this[_0x797e('0x11')]['callerid'],_0x594f6f['findBy']));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x158'),this[_0x797e('0x11')]['callerid'],_0x594f6f[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices[_0x797e('0x14')][_0x797e('0x15a')]=function(_0x1d5fb8){logger[_0x797e('0x32')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1d5fb8[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x1d5fb8[_0x797e('0x157')])){return this[_0x797e('0x11')]['error'](_0x1d5fb8,_0x797e('0x154'));}logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x155'),this['channel'][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));var _0x575350=this['agentLogout'][_0x797e('0x71')](this,_0x1d5fb8[_0x797e('0x157')]);if(_0x575350){logger['info'](util[_0x797e('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x797e('0x11')]['callerid'],_0x1d5fb8[_0x797e('0x157')]));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x156'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x797e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x1d5fb8[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices[_0x797e('0x14')][_0x797e('0x15b')]=function(_0x7f7cdd){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x15c'),_0x7f7cdd[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x7f7cdd[_0x797e('0x15d')])){return this['channel'][_0x797e('0x30')](_0x7f7cdd,_0x797e('0x15e'));}this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x15f'),_0x7f7cdd['operation']));var _0x5cc62e=eval(_0x7f7cdd['operation']);if(!this['isConfigured'](_0x7f7cdd[_0x797e('0xd7')])){return this['channel'][_0x797e('0xab')](_0x797e('0xd8'));}var _0x39dc71=this[_0x797e('0x15')]['sync'](this,_0x7f7cdd['variable_id']);if(!_0x39dc71){return this[_0x797e('0x11')][_0x797e('0x30')](_0x7f7cdd,_0x797e('0xd9'));}if(_[_0x797e('0x9d')](_0x5cc62e)){var _0x1ff648=this;_0x5cc62e[_0x797e('0x160')](function(_0x23d46b,_0x536e2){_0x1ff648['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')](_0x797e('0x161'),_0x39dc71,_0x536e2),_0x23d46b);});return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('variable\x20%s[key]\x20set',_0x39dc71));}else{return this[_0x797e('0x11')][_0x797e('0xa2')](_0x39dc71,_0x5cc62e);}};AGIVertices[_0x797e('0x14')]['menu']=function(_0x448a7c){logger['info'](util['format'](_0x797e('0x162'),_0x448a7c[_0x797e('0x3a')]));if(_0x448a7c['retry']===0x0){return this['maxRetry'](_0x448a7c);}_0x448a7c[_0x797e('0xa8')]-=0x1;if(!this['isConfigured'](_0x448a7c[_0x797e('0x10f')])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x448a7c,_0x797e('0x110'));}var _0x4d89c6=this['getSound'][_0x797e('0x71')](this,_0x448a7c['file_id']);if(!_0x4d89c6){return this[_0x797e('0x11')]['error'](_0x448a7c,_0x797e('0x163'));}var _0xd35282=this[_0x797e('0x11')][_0x797e('0x111')](_0x4d89c6,_0x448a7c[_0x797e('0x112')],_0x448a7c['digit']);var _0x1be8a0=_0xd35282[_0x797e('0xa6')];if(_0xd35282['result']===-0x1){this[_0x797e('0x38')][_0x797e('0x71')](this,_0x448a7c,'-1');return _0xd35282;}else if(_0xd35282[_0x797e('0xa4')]===_0x797e('0x67')){_0xd35282['result']=_0xd35282[_0x797e('0xa6')][_0x797e('0xa1')]>0x0?_0xd35282[_0x797e('0xa6')]:'t';}else if(_[_0x797e('0x44')](_0xd35282[_0x797e('0xa6')])){_0xd35282['result']='#';_0x1be8a0='#';}if(!this[_0x797e('0x88')](_0x448a7c[_0x797e('0xd7')])){this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xd8'));}else{var _0x4c60e1=this[_0x797e('0x15')]['sync'](this,_0x448a7c[_0x797e('0xd7')]);if(!_0x4c60e1){return this[_0x797e('0x11')][_0x797e('0x30')](_0x448a7c,'no\x20variable\x20found');}this['channel'][_0x797e('0xa2')](_0x4c60e1,_0x1be8a0);}this[_0x797e('0x38')]['sync'](this,_0x448a7c,_0x1be8a0);return _0xd35282;};AGIVertices['prototype'][_0x797e('0xab')]=function(_0x1a89d8){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x164'),_0x1a89d8[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')](_0x1a89d8[_0x797e('0x165')]||_0x1a89d8[_0x797e('0x3a')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x166')]=function(_0x54ac52){logger['info'](util[_0x797e('0x2d')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x54ac52[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x54ac52['findBy'])){return this[_0x797e('0x11')]['error'](_0x54ac52,_0x797e('0x154'));}logger[_0x797e('0x32')](util['format'](_0x797e('0x155'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));var _0x1643f6=this[_0x797e('0x4e')]['sync'](this,_0x54ac52[_0x797e('0x167')]);var _0x5808da=this[_0x797e('0x50')]['sync'](this,_0x54ac52[_0x797e('0x157')],_0x1643f6);if(_0x5808da){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x156'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52['findBy']));return{'code':0xc8,'result':_0x797e('0x168')};}else{logger[_0x797e('0x32')](util['format'](_0x797e('0x158'),this['channel'][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x797e('0x11')][_0x797e('0x3d')],_0x54ac52[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices['prototype']['playback']=function(_0x1520e5){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x169'),_0x1520e5['label']));if(!this[_0x797e('0x88')](_0x1520e5[_0x797e('0x10f')])){return this[_0x797e('0x11')]['error'](_0x1520e5,_0x797e('0x110'));}var _0x35db00=this[_0x797e('0x21')][_0x797e('0x71')](this,_0x1520e5['file_id']);if(!_0x35db00){return this[_0x797e('0x11')][_0x797e('0x30')](_0x1520e5,_0x797e('0x163'));}var _0x3d4dc3=this['channel']['exec'](_0x797e('0x16a'),[_0x35db00,_0x1520e5['opts']]);if(_0x3d4dc3['result']===-0x1){return _0x3d4dc3;}return this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('Executed\x20command\x20%s\x20%s',_0x797e('0x16a'),_0x35db00));};AGIVertices[_0x797e('0x14')][_0x797e('0x16b')]=function(_0x127126){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x16c'),_0x127126[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x127126[_0x797e('0x16d')])){return this[_0x797e('0x11')]['error'](_0x127126,_0x797e('0x16e'));}var _0x163461='';var _0x23e549=parseInt(_0x127126[_0x797e('0x16d')],0xa);if(isNaN(_0x23e549)){_0x163461=_0x127126['queue_id'];}else{_0x163461=this[_0x797e('0x16f')][_0x797e('0x71')](this,_0x127126['queue_id']);if(!_0x163461){return this['channel'][_0x797e('0x30')](_0x127126,_0x797e('0x170'));}}var _0x6e7ff2='';if(this[_0x797e('0x88')](_0x127126[_0x797e('0x10f')])){var _0x195c38=this[_0x797e('0x21')][_0x797e('0x71')](this,_0x127126[_0x797e('0x10f')]);if(_0x195c38){_0x6e7ff2=_0x195c38;}}this['createSquareDetailsReport']['sync'](this,_0x127126,_0x163461);if(_0x127126[_0x797e('0xe5')][_0x797e('0x171')]('x')<0x0){_0x127126[_0x797e('0xe5')]+='x';}if(_0x127126['opts'][_0x797e('0x171')]('X')<0x0){_0x127126['opts']+='X';}this[_0x797e('0x11')][_0x797e('0xa2')](_0x797e('0x172'),_0x163461?_0x163461['toLowerCase']():'');var _0x2345e9=this['channel'][_0x797e('0x59')](_0x797e('0x173'),[_0x163461,_0x127126[_0x797e('0xe5')],_0x127126[_0x797e('0x74')],_0x6e7ff2,_0x127126['timeout'],_0x127126[_0x797e('0x8')],_0x127126[_0x797e('0x174')],_0x127126['gosub'],'',_0x127126[_0x797e('0x175')]]);if(_0x2345e9[_0x797e('0xa6')]===-0x1){return _0x2345e9;}return this['channel'][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0xc4'),_0x797e('0x173'),_0x163461));};AGIVertices[_0x797e('0x14')][_0x797e('0x176')]=function(_0x29e453){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x177'),_0x29e453[_0x797e('0x3a')]));var _0x482db2=_0x29e453[_0x797e('0x178')]||_0x797e('0x12c');var _0x20c69b=util[_0x797e('0x2d')](_0x797e('0x179'),this[_0x797e('0x11')][_0x797e('0x39')],rs[_0x797e('0x117')](0x5));var _0x2ffda2=util[_0x797e('0x2d')](_0x797e('0x17a'),FILES_PATH,_0x20c69b,_0x482db2);var _0x312988=util[_0x797e('0x2d')](_0x797e('0x135'),FILES_PATH,_0x20c69b);this[_0x797e('0x3c')][_0x797e('0x71')](this,_0x29e453,_0x20c69b,_0x2ffda2);this['channel']['setVariable']('RECORDING_SAVENAME',_0x20c69b);logger['info'](_0x797e('0x17b'),_0x312988,_0x482db2,_0x29e453[_0x797e('0x17c')],_0x29e453[_0x797e('0x67')]);return this[_0x797e('0x11')][_0x797e('0x12e')](_0x312988,_0x482db2,_0x29e453[_0x797e('0x17c')],_0x29e453[_0x797e('0x67')],undefined,!![]);};AGIVertices[_0x797e('0x14')][_0x797e('0x17d')]=function(_0x5c20ae){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x5c20ae[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x5c20ae['url'])){return this[_0x797e('0x11')]['noop']('no\x20url\x20configured');}var _0x573a8e=this['restAPI'][_0x797e('0x71')](this,_0x5c20ae);logger['info'](util[_0x797e('0x2d')]('Response:',util[_0x797e('0x17e')](_0x573a8e,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x5c20ae[_0x797e('0xd7')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x17f'));}var _0x34ac94=this[_0x797e('0x15')][_0x797e('0x71')](this,_0x5c20ae[_0x797e('0xd7')]);if(!_0x34ac94){return this['channel'][_0x797e('0x30')](_0x5c20ae,_0x797e('0xd9'));}this[_0x797e('0x11')][_0x797e('0xa2')](util['format']('%s_STATUS_CODE',_0x34ac94),_0x573a8e[_0x797e('0x77')]?_0x573a8e[_0x797e('0x77')]:_0x797e('0x180'));this['channel'][_0x797e('0xa2')](util[_0x797e('0x2d')]('%s_STATUS_MESSAGE',_0x34ac94),_0x573a8e[_0x797e('0x181')]?_0x573a8e['statusMessage']:'OK');if(_0x573a8e[_0x797e('0x76')]){try{this[_0x797e('0x9e')](_0x573a8e[_0x797e('0x76')],_0x34ac94);}catch(_0x19ff61){logger[_0x797e('0x30')](util[_0x797e('0x2d')](_0x797e('0x182'),_0x34ac94));}}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0xdc'),_0x34ac94));};AGIVertices[_0x797e('0x14')][_0x797e('0x183')]=function(_0x58155f){logger['info'](util[_0x797e('0x2d')](_0x797e('0x184'),_0x58155f[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0x185')](_0x58155f[_0x797e('0x186')][_0x797e('0x187')](/\s+/g,''),_0x58155f[_0x797e('0x17c')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x188')]=function(_0x403536){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x189'),_0x403536[_0x797e('0x3a')]));return this[_0x797e('0x11')]['sayNumber'](_0x403536[_0x797e('0x68')][_0x797e('0x187')](/\s+/g,''),_0x403536['escape_digits']);};AGIVertices[_0x797e('0x14')]['sayphonetic']=function(_0x218964){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x18a'),_0x218964[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0x18b')](_0x218964[_0x797e('0x5d')],_0x218964['escape_digits']);};AGIVertices['prototype'][_0x797e('0x18c')]=function(_0x4e3d0a){logger[_0x797e('0x32')](util[_0x797e('0x2d')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4e3d0a[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x4e3d0a['account_id'])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x18d'));}var _0x3f0381=this[_0x797e('0x25')]['sync'](this,_0x4e3d0a[_0x797e('0x18e')]);if(!_0x3f0381||!_0x3f0381[_0x797e('0x18f')]){return this['channel'][_0x797e('0x30')](_0x4e3d0a,_0x797e('0x190'));}var _0x50e41b={'from':util[_0x797e('0x2d')](_0x797e('0x191'),_0x3f0381['name'],_0x3f0381[_0x797e('0x192')]||_0x3f0381[_0x797e('0x18f')][_0x797e('0x193')]),'to':_0x4e3d0a['to']||'','cc':_0x4e3d0a['cc']||'','bcc':_0x4e3d0a[_0x797e('0x194')]||'','subject':_0x4e3d0a['subject'],'html':_0x4e3d0a['text'],'text':_0x4e3d0a['text']};if(this[_0x797e('0x88')](_0x4e3d0a[_0x797e('0x195')])){}logger[_0x797e('0xde')](_0x797e('0x196'),JSON['stringify'](_0x50e41b));this[_0x797e('0x38')][_0x797e('0x71')](this,_0x4e3d0a,_0x4e3d0a['account_id']);this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3f0381['name']));this[_0x797e('0x27')][_0x797e('0x71')](this,_0x3f0381[_0x797e('0x197')],_0x50e41b);return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x198'));};AGIVertices[_0x797e('0x14')][_0x797e('0x199')]=function(_0x2a7410){logger['info'](util[_0x797e('0x2d')](_0x797e('0x19a'),_0x2a7410[_0x797e('0x3a')]));return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x19b'));};AGIVertices[_0x797e('0x14')]['sendSMS']=function(_0x5afd3f){logger[_0x797e('0x32')](util['format'](_0x797e('0x19c'),_0x5afd3f[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x5afd3f[_0x797e('0x19d')])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20sms\x20account\x20configured');}var _0x26dd2c=this[_0x797e('0x35')][_0x797e('0x71')](this,_0x5afd3f[_0x797e('0x19d')]);if(!_0x26dd2c){return this[_0x797e('0x11')][_0x797e('0x30')](_0x5afd3f,_0x797e('0x19e'));}var _0x210631={'body':_0x5afd3f[_0x797e('0x19f')],'phone':_0x5afd3f['to']||'','SmsAccountId':_0x26dd2c['id']};logger[_0x797e('0xde')](_0x797e('0x1a0'),JSON['stringify'](_0x210631));this[_0x797e('0x38')][_0x797e('0x71')](this,_0x5afd3f,_0x5afd3f[_0x797e('0x19d')]);this['channel'][_0x797e('0xab')](util['format'](_0x797e('0x1a1'),_0x26dd2c['name']));this[_0x797e('0x37')][_0x797e('0x71')](this,_0x210631);return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0x1a2'));};AGIVertices[_0x797e('0x14')][_0x797e('0x1a3')]=function(_0x181ea5){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1a4'),_0x181ea5[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x181ea5['variable_id'])){return this[_0x797e('0x11')][_0x797e('0x30')](_0x181ea5,_0x797e('0x1a5'));}var _0x330ec8=this[_0x797e('0x15')][_0x797e('0x71')](this,_0x181ea5[_0x797e('0xd7')]);if(!_0x330ec8){return this['channel'][_0x797e('0x30')](_0x181ea5,_0x797e('0xd9'));}return this[_0x797e('0x11')][_0x797e('0xa2')](_0x330ec8,_0x181ea5[_0x797e('0x1a6')]);};AGIVertices[_0x797e('0x14')][_0x797e('0x1a7')]=function(_0x5cd696){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1a8'),_0x5cd696[_0x797e('0x3a')]));this[_0x797e('0x11')][_0x797e('0xab')]('START\x20CALLY\x20SQUARE');if(_0x5cd696[_0x797e('0xbb')]===_0x797e('0x1a9')){this['channel'][_0x797e('0xab')](_0x797e('0x1aa'));return this['channel'][_0x797e('0xbb')]();}return this['channel'][_0x797e('0xab')](_0x797e('0x1ab'));};AGIVertices[_0x797e('0x14')][_0x797e('0x1ac')]=function(_0x4856b7){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x1ad'),_0x4856b7[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x4856b7[_0x797e('0x1ae')])){return this['channel'][_0x797e('0x30')](_0x4856b7,_0x797e('0x1af'));}var _0x56f61f=this[_0x797e('0x1b')][_0x797e('0x71')](this,_0x4856b7['project_id']);if(!this[_0x797e('0x88')](_0x56f61f)){return this[_0x797e('0x11')]['error'](_0x4856b7,util['format'](_0x797e('0x1b0'),_0x4856b7[_0x797e('0x1ae')]));}if(_0x56f61f===this[_0x797e('0x11')]['arg_1']){return this['channel']['error'](_0x4856b7,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x797e('0x38')][_0x797e('0x71')](this,_0x4856b7,_0x56f61f);var _0xb2a1e0=this[_0x797e('0x11')][_0x797e('0x59')]('AGI',util['format'](_0x797e('0x1b1'),config[_0x797e('0x8')][_0x797e('0x1b2')]||'127.0.0.1',_0x56f61f,this[_0x797e('0x11')][_0x797e('0x3b')]));if(_0xb2a1e0[_0x797e('0xa6')]===-0x1){return _0xb2a1e0;}return this['channel']['noop'](util['format'](_0x797e('0xc4'),'AGI',_0x56f61f));};AGIVertices[_0x797e('0x14')][_0x797e('0x1b3')]=function(_0xf8909){logger[_0x797e('0x32')](util['format'](_0x797e('0x1b4'),_0xf8909['label']));var _0x5d0adc=this[_0x797e('0x58')][_0x797e('0x71')](this,_0xf8909[_0x797e('0x1b5')]);this[_0x797e('0x38')]['sync'](this,_0xf8909,_0xf8909[_0x797e('0x1b5')]);if(this[_0x797e('0x88')](_0xf8909[_0x797e('0xd7')])){var _0x404c7c=this[_0x797e('0x15')][_0x797e('0x71')](this,_0xf8909[_0x797e('0xd7')]);if(_0x404c7c){this[_0x797e('0x11')][_0x797e('0xa2')](_0x404c7c,_0x5d0adc);return this['channel'][_0x797e('0xab')](util['format'](_0x797e('0x1b6'),_0xf8909[_0x797e('0x1b5')],_0x404c7c));}}return this[_0x797e('0x11')]['noop'](util[_0x797e('0x2d')](_0x797e('0x1b7'),_0xf8909[_0x797e('0x1b5')]));};AGIVertices[_0x797e('0x14')][_0x797e('0x1b8')]=function(_0x580a99){logger['info'](util['format'](_0x797e('0x1b9'),_0x580a99['label']));_0x580a99[_0x797e('0x5d')]=_0x580a99[_0x797e('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x797e('0x88')](_0x580a99['apiKey'])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x580a99['text'])){return this[_0x797e('0x11')][_0x797e('0xab')]('no\x20text\x20configured');}this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x1ba'),_0x580a99['text']));var _0x3e8b09=this[_0x797e('0x5b')][_0x797e('0x71')](this,_0x580a99);if(_0x3e8b09){this[_0x797e('0x11')][_0x797e('0xab')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3e8b09));var _0x7e131c=this[_0x797e('0x11')][_0x797e('0x124')](_0x3e8b09);try{fs[_0x797e('0x103')](_0x3e8b09+'.wav');}catch(_0xd2d7b1){logger[_0x797e('0x30')](_0xd2d7b1);}return _0x7e131c;}return this[_0x797e('0x11')][_0x797e('0x30')](_0x580a99,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x797e('0x14')][_0x797e('0x1bb')]=function(_0x47935c){logger[_0x797e('0x32')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x47935c[_0x797e('0x3a')]));_0x47935c[_0x797e('0x5d')]=_0x47935c[_0x797e('0x5d')][_0x797e('0x187')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x797e('0x88')](_0x47935c[_0x797e('0x5d')])){return this[_0x797e('0x11')][_0x797e('0xab')](_0x797e('0xac'));}this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')](_0x797e('0x1bc'),_0x47935c[_0x797e('0x5d')]));var _0x47a432=this[_0x797e('0x63')]['sync'](this,_0x47935c);if(_0x47a432){this[_0x797e('0x11')]['noop'](util['format'](_0x797e('0x1bd'),_0x47a432));var _0x3bb3f2=this[_0x797e('0x11')][_0x797e('0x124')](_0x47a432);try{fs['unlink'](_0x47a432+'.wav');}catch(_0x12e3ff){logger[_0x797e('0x30')](_0x12e3ff);}return _0x3bb3f2;}return this['channel']['error'](_0x47935c,_0x797e('0x1be'));};AGIVertices[_0x797e('0x14')]['unpause']=function(_0x45b98d){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1bf'),_0x45b98d[_0x797e('0x3a')]));if(!this[_0x797e('0x88')](_0x45b98d[_0x797e('0x157')])){return this['channel']['error'](_0x45b98d,_0x797e('0x154'));}logger['info'](util[_0x797e('0x2d')](_0x797e('0x155'),this[_0x797e('0x11')]['callerid'],_0x45b98d[_0x797e('0x157')]));var _0x422473=this[_0x797e('0x52')][_0x797e('0x71')](this,_0x45b98d[_0x797e('0x157')]);if(_0x422473){logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x156'),this['channel'][_0x797e('0x3d')],_0x45b98d[_0x797e('0x157')]));this[_0x797e('0x11')]['noop'](util['format'](_0x797e('0x156'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x45b98d[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x168')};}else{logger[_0x797e('0x32')](util[_0x797e('0x2d')](_0x797e('0x158'),this[_0x797e('0x11')][_0x797e('0x3d')],_0x45b98d[_0x797e('0x157')]));this[_0x797e('0x11')][_0x797e('0xab')](util[_0x797e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x45b98d[_0x797e('0x157')]));return{'code':0xc8,'result':_0x797e('0x159')};}};AGIVertices['prototype']['voicemail']=function(_0x5acba5){logger[_0x797e('0x32')](util['format'](_0x797e('0x1c0'),_0x5acba5[_0x797e('0x3a')]));var _0x25bf06=this[_0x797e('0x11')]['exec'](_0x797e('0x1c1'),[_0x5acba5[_0x797e('0x1c2')],_0x5acba5['options']]);if(_0x25bf06[_0x797e('0xa6')]===-0x1){return _0x25bf06;}return this['channel']['noop'](util[_0x797e('0x2d')](_0x797e('0xc4'),_0x797e('0x1c1'),_0x5acba5[_0x797e('0x1c2')]));};AGIVertices['prototype'][_0x797e('0x1c3')]=function(_0x69950e){logger['info'](util[_0x797e('0x2d')](_0x797e('0x1c4'),_0x69950e[_0x797e('0x3a')]));if(!this['isConfigured'](_0x69950e[_0x797e('0xd7')])){return this['channel'][_0x797e('0x30')](_0x69950e,_0x797e('0x1a5'));}var _0x3395be=this[_0x797e('0x15')]['sync'](this,_0x69950e[_0x797e('0xd7')]);if(!_0x3395be){return this['channel'][_0x797e('0x30')](_0x69950e,_0x797e('0xd9'));}var _0x2d2a94=this[_0x797e('0x11')][_0x797e('0x15')](_0x3395be);return{'code':0xc8,'result':_0x2d2a94[_0x797e('0xa4')]?_0x2d2a94['extra']:'-'};};String[_0x797e('0x14')][_0x797e('0x1c5')]=function(_0x16a5cd,_0x36c1a6){return this[_0x797e('0xa3')](_0x16a5cd)[_0x797e('0x1c6')](_0x36c1a6);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 63e0043..3039aa8 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 _0xb3ee=['moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','lastPauseAt','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','message','stopAcw','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','attended','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','exports','util','lodash'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xb3ee,0x103));var _0xeb3e=function(_0x1d766e,_0x587531){_0x1d766e=_0x1d766e-0x0;var _0x3bfe8f=_0xb3ee[_0x1d766e];return _0x3bfe8f;};'use strict';var util=require(_0xeb3e('0x0'));var _=require(_0xeb3e('0x1'));var moment=require(_0xeb3e('0x2'));var ami=require(_0xeb3e('0x3'));var logger=require(_0xeb3e('0x4'))(_0xeb3e('0x5'));var RpcUser=require(_0xeb3e('0x6'));var RpcVoiceAgentReport=require(_0xeb3e('0x7'));function Acw(_0x16dbbe){this[_0xeb3e('0x8')]=_0x16dbbe[_0xeb3e('0x8')];this[_0xeb3e('0x9')]=_0x16dbbe[_0xeb3e('0x9')];this[_0xeb3e('0xa')]=_0x16dbbe['timers'];this[_0xeb3e('0xb')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xeb3e('0xc')](this));ami['on']('hanguprequest',this[_0xeb3e('0xd')][_0xeb3e('0xc')](this));ami['on'](_0xeb3e('0xe'),this[_0xeb3e('0xf')][_0xeb3e('0xc')](this));ami['on'](_0xeb3e('0x10'),this[_0xeb3e('0x11')]['bind'](this));ami['on'](_0xeb3e('0x12'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xeb3e('0x13'),this['syncBlindTransfer'][_0xeb3e('0xc')](this));ami['on'](_0xeb3e('0x14'),this[_0xeb3e('0x15')][_0xeb3e('0xc')](this));}function getDiff(_0x2bee33){var _0x588b51=moment()[_0xeb3e('0x16')](0x0);var _0x3f6c21=moment(_0x2bee33)[_0xeb3e('0x16')](0x0);return _0x588b51[_0xeb3e('0x17')](_0x3f6c21,_0xeb3e('0x18'));}Acw[_0xeb3e('0x19')]['startAcw']=function(_0x37f2ae){try{var _0x25de76=this;var _0x198b64=this[_0xeb3e('0xb')][_0x37f2ae]['interface'];var _0x4bc83a=this['channels'][_0x37f2ae][_0xeb3e('0x1a')];var _0x3e6a37=this[_0xeb3e('0x8')][_0x4bc83a];var _0x35efa9=![];var _0x585d2d=_0xeb3e('0x1b');if(_0x3e6a37['mandatoryDisposition']){if(_0x3e6a37[_0xeb3e('0x1c')][_0xeb3e('0x1d')]){_0x35efa9=!![];_0x585d2d=_0x3e6a37[_0xeb3e('0x1c')]['name'];}}ami[_0xeb3e('0x1e')]({'action':_0xeb3e('0x1f'),'interface':_0x198b64,'paused':!![],'reason':_0x585d2d})['then'](function(_0x1ccf30){if(_0x25de76['agents'][_0x198b64]){return RpcUser[_0xeb3e('0x20')](_0x25de76['agents'][_0x198b64]['id'])[_0xeb3e('0x21')](function(_0x3e46f4){if(_0x3e46f4&&!_0x3e46f4[_0xeb3e('0x22')]){logger[_0xeb3e('0x23')](_0xeb3e('0x24'),_0x37f2ae,_0x198b64,_0x4bc83a);var _0x12e1ec=_0x25de76[_0xeb3e('0xb')][_0x37f2ae]['attended']&&_0x25de76[_0xeb3e('0xb')][_0x37f2ae][_0xeb3e('0x25')]?_0x25de76[_0xeb3e('0xb')][_0x37f2ae][_0xeb3e('0x25')]:_0x37f2ae;return RpcUser[_0xeb3e('0x26')](_0x25de76['agents'][_0x198b64],_0x585d2d,_0x12e1ec)[_0xeb3e('0x21')](function(_0x2b1e37){if(!_0x35efa9){_0x25de76['timers'][_0x198b64]={};logger[_0xeb3e('0x23')](_0xeb3e('0x27'),_0x37f2ae,_0x25de76[_0xeb3e('0x8')][_0x4bc83a][_0xeb3e('0x28')],_0x198b64,_0x4bc83a);_0x25de76[_0xeb3e('0xa')][_0x198b64]['timer']=setTimeout(_0x25de76['stopAcw']['bind'](_0x25de76,_0x198b64),_0x25de76[_0xeb3e('0x8')][_0x4bc83a]['acwTimeout']*0x3e8);_0x25de76[_0xeb3e('0xa')][_0x198b64]['lastPauseAt']=moment()[_0xeb3e('0x29')](_0xeb3e('0x2a'));_0x25de76[_0xeb3e('0xa')][_0x198b64]['uniqueid']=_0x37f2ae;_0x25de76[_0xeb3e('0xa')][_0x198b64][_0xeb3e('0x1a')]=_0x4bc83a;_0x25de76['timers'][_0x198b64][_0xeb3e('0x2b')]=function(){var _0xae6be5=getDiff(_0x25de76[_0xeb3e('0xa')][_0x198b64][_0xeb3e('0x2c')]);clearTimeout(_0x25de76[_0xeb3e('0xa')][_0x198b64][_0xeb3e('0x2d')]);_0x25de76[_0xeb3e('0xa')][_0x198b64][_0xeb3e('0x2d')]=![];RpcVoiceAgentReport[_0xeb3e('0x2e')]({'acwtime':_0xae6be5},_0x25de76['timers'][_0x198b64][_0xeb3e('0x2f')],_0x198b64)[_0xeb3e('0x21')](function(_0x3cf097){logger['info'](_0xeb3e('0x30'),_0x37f2ae,_0xae6be5,_0x3cf097);})[_0xeb3e('0x31')](function(_0x3daf18){logger[_0xeb3e('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x37f2ae,_0x3daf18);});delete _0x25de76[_0xeb3e('0xa')][_0x198b64];};}});}else{logger[_0xeb3e('0x23')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x37f2ae,_0x198b64,_0x4bc83a);}});}})[_0xeb3e('0x31')](function(_0x50d90b){logger[_0xeb3e('0x32')](_0xeb3e('0x27'),_0x37f2ae,_0x25de76[_0xeb3e('0x8')][_0x4bc83a][_0xeb3e('0x28')],_0x198b64,_0x4bc83a);})[_0xeb3e('0x33')](function(){delete _0x25de76['channels'][_0x37f2ae];});}catch(_0x5796a6){logger[_0xeb3e('0x32')]('[ACW][START]\x20%s',_0x5796a6[_0xeb3e('0x34')]);}};Acw[_0xeb3e('0x19')][_0xeb3e('0x35')]=function(_0x278fc9){try{var _0x1804a1=this;if(_0x1804a1[_0xeb3e('0xa')][_0x278fc9]){_0x1804a1[_0xeb3e('0xa')][_0x278fc9][_0xeb3e('0x2d')]=![];var _0x2a2805=_0x1804a1[_0xeb3e('0xa')][_0x278fc9][_0xeb3e('0x2f')];var _0x6bc852=_0x1804a1[_0xeb3e('0xa')][_0x278fc9]['queue'];var _0x4f48f0=_0x1804a1[_0xeb3e('0x8')][_0x6bc852][_0xeb3e('0x28')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x2a2805,_0x278fc9);RpcUser[_0xeb3e('0x36')](this[_0xeb3e('0x9')][_0x278fc9]);RpcVoiceAgentReport[_0xeb3e('0x2e')]({'acwtime':_0x4f48f0,'agentacw':!![]},_0x2a2805,_0x278fc9)[_0xeb3e('0x21')](function(_0x1823d2){logger[_0xeb3e('0x23')](_0xeb3e('0x30'),_0x2a2805,_0x4f48f0,_0x1823d2);})[_0xeb3e('0x31')](function(_0x224000){logger[_0xeb3e('0x32')](_0xeb3e('0x37'),_0x2a2805,_0x224000);});}else{logger[_0xeb3e('0x32')](_0xeb3e('0x38'),_0x278fc9);if(_0x1804a1[_0xeb3e('0xa')]){logger[_0xeb3e('0x23')]('[ACW][TIMERS]',JSON['stringify'](_0x1804a1[_0xeb3e('0xa')]));}}}catch(_0x14a73d){logger[_0xeb3e('0x32')](_0xeb3e('0x39'),_0x14a73d[_0xeb3e('0x34')]);}};Acw[_0xeb3e('0x19')][_0xeb3e('0x3a')]=function(_0x2e8141){try{if(this[_0xeb3e('0x8')][_0x2e8141['queue']]&&(this[_0xeb3e('0x8')][_0x2e8141[_0xeb3e('0x1a')]][_0xeb3e('0x5')]||this['voiceQueues'][_0x2e8141[_0xeb3e('0x1a')]]['mandatoryDisposition'])){if(this[_0xeb3e('0x9')][_0x2e8141[_0xeb3e('0x3b')]]){this[_0xeb3e('0xb')][_0x2e8141[_0xeb3e('0x2f')]]={'queue':_0x2e8141['queue'],'interface':_0x2e8141[_0xeb3e('0x3b')],'destlinkedid':_0x2e8141[_0xeb3e('0x25')]};}}}catch(_0x13822b){logger[_0xeb3e('0x32')](_0xeb3e('0x3c'),_0x13822b['message']);}};Acw[_0xeb3e('0x19')][_0xeb3e('0x15')]=function(_0x35540c){try{if(this[_0xeb3e('0x8')][_0x35540c[_0xeb3e('0x1a')]]&&(this[_0xeb3e('0x8')][_0x35540c['queue']][_0xeb3e('0x5')]||this['voiceQueues'][_0x35540c[_0xeb3e('0x1a')]][_0xeb3e('0x3d')])){if(this[_0xeb3e('0x9')][_0x35540c[_0xeb3e('0x3b')]]){this[_0xeb3e('0xb')][_0x35540c[_0xeb3e('0x2f')]]={'queue':_0x35540c[_0xeb3e('0x1a')],'interface':_0x35540c[_0xeb3e('0x3b')]};}}}catch(_0x2ccd0e){logger[_0xeb3e('0x32')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2ccd0e[_0xeb3e('0x34')]);}};Acw['prototype']['syncHangupRequest']=function(_0x12e9f9){try{if(this[_0xeb3e('0xb')][_0x12e9f9[_0xeb3e('0x2f')]]&&_[_0xeb3e('0x3e')](this['channels'][_0x12e9f9[_0xeb3e('0x2f')]]['attended'])){logger['info'](_0xeb3e('0x3f'),_0x12e9f9[_0xeb3e('0x2f')]);this[_0xeb3e('0x40')](_0x12e9f9[_0xeb3e('0x2f')]);}else if(this['channels'][_0x12e9f9[_0xeb3e('0x41')]]&&_['isUndefined'](this[_0xeb3e('0xb')][_0x12e9f9[_0xeb3e('0x41')]][_0xeb3e('0x42')])){logger[_0xeb3e('0x23')]('[%s][HANGUP:LINKEDID]',_0x12e9f9[_0xeb3e('0x41')]);this['startAcw'](_0x12e9f9[_0xeb3e('0x41')]);}}catch(_0x2b3ac5){logger[_0xeb3e('0x32')](_0xeb3e('0x43'),_0x2b3ac5[_0xeb3e('0x34')]);}};Acw[_0xeb3e('0x19')][_0xeb3e('0xf')]=function(_0x29f13b){try{if(this[_0xeb3e('0xb')][_0x29f13b[_0xeb3e('0x2f')]]&&this['channels'][_0x29f13b[_0xeb3e('0x2f')]]['attended']){logger['info'](_0xeb3e('0x44'),_0x29f13b[_0xeb3e('0x2f')]);this[_0xeb3e('0x40')](_0x29f13b[_0xeb3e('0x2f')]);}else if(this[_0xeb3e('0xb')][_0x29f13b[_0xeb3e('0x41')]]&&this[_0xeb3e('0xb')][_0x29f13b[_0xeb3e('0x41')]][_0xeb3e('0x42')]){logger[_0xeb3e('0x23')](_0xeb3e('0x45'),_0x29f13b['linkedid']);this[_0xeb3e('0x40')](_0x29f13b[_0xeb3e('0x41')]);}}catch(_0xd8bd27){logger[_0xeb3e('0x32')](_0xeb3e('0x46'),_0xd8bd27[_0xeb3e('0x34')]);}};Acw[_0xeb3e('0x19')][_0xeb3e('0x47')]=function(_0x360161){try{if(!_[_0xeb3e('0x48')](this['channels'][_0x360161[_0xeb3e('0x49')]])){this[_0xeb3e('0x40')](_0x360161[_0xeb3e('0x49')]);if(this[_0xeb3e('0xb')][_0x360161[_0xeb3e('0x4a')]]){this[_0xeb3e('0xb')][_0x360161['secondtransfereruniqueid']][_0xeb3e('0x42')]=!![];this[_0xeb3e('0xb')][_0x360161[_0xeb3e('0x4b')]]=this[_0xeb3e('0xb')][_0x360161[_0xeb3e('0x4a')]];delete this[_0xeb3e('0xb')][_0x360161[_0xeb3e('0x4a')]];}}else if(!_[_0xeb3e('0x48')](this[_0xeb3e('0xb')][_0x360161[_0xeb3e('0x4b')]])){this[_0xeb3e('0x40')](_0x360161['transfertargetuniqueid']);if(this[_0xeb3e('0xb')][_0x360161['origtransfereruniqueid']]){this['channels'][_0x360161['origtransfereruniqueid']][_0xeb3e('0x42')]=!![];this['channels'][_0x360161[_0xeb3e('0x49')]]=this['channels'][_0x360161[_0xeb3e('0x4c')]];delete this[_0xeb3e('0xb')][_0x360161['origtransfereruniqueid']];}}}catch(_0x484649){logger[_0xeb3e('0x32')](_0xeb3e('0x4d'),_0x484649[_0xeb3e('0x34')]);}};Acw[_0xeb3e('0x19')]['syncBlindTransfer']=function(_0x5579a0){try{if(this[_0xeb3e('0xb')][_0x5579a0[_0xeb3e('0x4e')]]){logger[_0xeb3e('0x23')](_0xeb3e('0x4f'),JSON[_0xeb3e('0x50')](_0x5579a0[_0xeb3e('0x4e')]));this[_0xeb3e('0x40')](_0x5579a0[_0xeb3e('0x4e')]);}else if(this[_0xeb3e('0xb')][_0x5579a0['transfererlinkedid']]){logger['info'](_0xeb3e('0x51'),JSON[_0xeb3e('0x50')](_0x5579a0[_0xeb3e('0x52')]));this[_0xeb3e('0x40')](_0x5579a0['transfererlinkedid']);}}catch(_0x45423b){logger[_0xeb3e('0x32')](_0xeb3e('0x53'),_0x45423b[_0xeb3e('0x34')]);}};Acw[_0xeb3e('0x19')]['syncAgentRingNoAnswer']=function(_0x1c0932){try{if(this['voiceQueues'][_0x1c0932[_0xeb3e('0x1a')]]&&this[_0xeb3e('0x8')][_0x1c0932[_0xeb3e('0x1a')]]['autopause']===_0xeb3e('0x54')){if(this[_0xeb3e('0x9')][_0x1c0932[_0xeb3e('0x3b')]]){logger[_0xeb3e('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1c0932[_0xeb3e('0x2f')],_0x1c0932['interface'],_0x1c0932[_0xeb3e('0x1a')]);return RpcUser[_0xeb3e('0x26')](this[_0xeb3e('0x9')][_0x1c0932[_0xeb3e('0x3b')]],_0xeb3e('0x55'),_0x1c0932[_0xeb3e('0x2f')]);}}}catch(_0x1410e6){logger[_0xeb3e('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1410e6[_0xeb3e('0x34')]);}};module[_0xeb3e('0x56')]=Acw; \ No newline at end of file +var _0xe875=['timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','bind','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','startAcw','interface','voiceQueues','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','destlinkedid','savePause','stopAcw','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','lastPauseAt','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','queue','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','agents'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe875,0x1e6));var _0x5e87=function(_0x5bb35,_0x540d88){_0x5bb35=_0x5bb35-0x0;var _0x43e78a=_0xe875[_0x5bb35];return _0x43e78a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5e87('0x0'));var ami=require(_0x5e87('0x1'));var logger=require('../../../config/logger')(_0x5e87('0x2'));var RpcUser=require(_0x5e87('0x3'));var RpcVoiceAgentReport=require(_0x5e87('0x4'));function Acw(_0x8ae737){this['voiceQueues']=_0x8ae737['voiceQueues'];this[_0x5e87('0x5')]=_0x8ae737['agents'];this[_0x5e87('0x6')]=_0x8ae737[_0x5e87('0x6')];this[_0x5e87('0x7')]={};ami['on'](_0x5e87('0x8'),this[_0x5e87('0x9')]['bind'](this));ami['on'](_0x5e87('0xa'),this[_0x5e87('0xb')]['bind'](this));ami['on'](_0x5e87('0xc'),this['syncHangup'][_0x5e87('0xd')](this));ami['on'](_0x5e87('0xe'),this[_0x5e87('0xf')][_0x5e87('0xd')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x5e87('0xd')](this));ami['on'](_0x5e87('0x10'),this[_0x5e87('0x11')][_0x5e87('0xd')](this));ami['on'](_0x5e87('0x12'),this[_0x5e87('0x13')]['bind'](this));}function getDiff(_0x3f356d){var _0x1612f8=moment()[_0x5e87('0x14')](0x0);var _0x3fadb5=moment(_0x3f356d)[_0x5e87('0x14')](0x0);return _0x1612f8['diff'](_0x3fadb5,_0x5e87('0x15'));}Acw['prototype'][_0x5e87('0x16')]=function(_0x1a74fd){try{var _0x147f70=this;var _0x407f66=this['channels'][_0x1a74fd][_0x5e87('0x17')];var _0x1042a6=this[_0x5e87('0x7')][_0x1a74fd]['queue'];var _0x1dd9a0=this[_0x5e87('0x18')][_0x1042a6];var _0x677c4d=![];var _0x2152fb='ACW';if(_0x1dd9a0[_0x5e87('0x19')]){if(_0x1dd9a0[_0x5e87('0x1a')][_0x5e87('0x1b')]){_0x677c4d=!![];_0x2152fb=_0x1dd9a0['mandatoryDispositionPause'][_0x5e87('0x1b')];}}ami[_0x5e87('0x1c')]({'action':_0x5e87('0x1d'),'interface':_0x407f66,'paused':!![],'reason':_0x2152fb})[_0x5e87('0x1e')](function(_0x3e2c54){if(_0x147f70[_0x5e87('0x5')][_0x407f66]){return RpcUser[_0x5e87('0x1f')](_0x147f70['agents'][_0x407f66]['id'])[_0x5e87('0x1e')](function(_0x28ba55){if(_0x28ba55&&!_0x28ba55['voicePause']){logger[_0x5e87('0x20')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x1a74fd,_0x407f66,_0x1042a6);var _0x137258=_0x147f70[_0x5e87('0x7')][_0x1a74fd]['attended']&&_0x147f70[_0x5e87('0x7')][_0x1a74fd][_0x5e87('0x21')]?_0x147f70[_0x5e87('0x7')][_0x1a74fd][_0x5e87('0x21')]:_0x1a74fd;return RpcUser[_0x5e87('0x22')](_0x147f70[_0x5e87('0x5')][_0x407f66],_0x2152fb,_0x137258)[_0x5e87('0x1e')](function(_0x5b7b8c){if(!_0x677c4d){_0x147f70[_0x5e87('0x6')][_0x407f66]={};logger[_0x5e87('0x20')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1a74fd,_0x147f70[_0x5e87('0x18')][_0x1042a6]['acwTimeout'],_0x407f66,_0x1042a6);_0x147f70[_0x5e87('0x6')][_0x407f66]['timer']=setTimeout(_0x147f70[_0x5e87('0x23')]['bind'](_0x147f70,_0x407f66),_0x147f70[_0x5e87('0x18')][_0x1042a6][_0x5e87('0x24')]*0x3e8);_0x147f70[_0x5e87('0x6')][_0x407f66]['lastPauseAt']=moment()[_0x5e87('0x25')](_0x5e87('0x26'));_0x147f70['timers'][_0x407f66]['uniqueid']=_0x1a74fd;_0x147f70[_0x5e87('0x6')][_0x407f66]['queue']=_0x1042a6;_0x147f70['timers'][_0x407f66][_0x5e87('0x27')]=function(){var _0x2b11eb=getDiff(_0x147f70[_0x5e87('0x6')][_0x407f66][_0x5e87('0x28')]);clearTimeout(_0x147f70['timers'][_0x407f66][_0x5e87('0x29')]);_0x147f70[_0x5e87('0x6')][_0x407f66]['timer']=![];RpcVoiceAgentReport[_0x5e87('0x2a')]({'acwtime':_0x2b11eb},_0x147f70[_0x5e87('0x6')][_0x407f66][_0x5e87('0x2b')],_0x407f66)['then'](function(_0x2aee7e){logger['info'](_0x5e87('0x2c'),_0x1a74fd,_0x2b11eb,_0x2aee7e);})[_0x5e87('0x2d')](function(_0x3ba82a){logger[_0x5e87('0x2e')](_0x5e87('0x2f'),_0x1a74fd,_0x3ba82a);});delete _0x147f70[_0x5e87('0x6')][_0x407f66];};}});}else{logger[_0x5e87('0x20')](_0x5e87('0x30'),_0x1a74fd,_0x407f66,_0x1042a6);}});}})['catch'](function(_0x3f7619){logger[_0x5e87('0x2e')](_0x5e87('0x31'),_0x1a74fd,_0x147f70[_0x5e87('0x18')][_0x1042a6]['acwTimeout'],_0x407f66,_0x1042a6);})['finally'](function(){delete _0x147f70['channels'][_0x1a74fd];});}catch(_0x40f753){logger['error'](_0x5e87('0x32'),_0x40f753[_0x5e87('0x33')]);}};Acw[_0x5e87('0x34')][_0x5e87('0x23')]=function(_0x4226d6){try{var _0xadece5=this;if(_0xadece5['timers'][_0x4226d6]){_0xadece5[_0x5e87('0x6')][_0x4226d6][_0x5e87('0x29')]=![];var _0x156f39=_0xadece5[_0x5e87('0x6')][_0x4226d6][_0x5e87('0x2b')];var _0x363631=_0xadece5[_0x5e87('0x6')][_0x4226d6][_0x5e87('0x35')];var _0x5a59c7=_0xadece5[_0x5e87('0x18')][_0x363631]['acwTimeout'];logger[_0x5e87('0x20')](_0x5e87('0x36'),_0x156f39,_0x4226d6);RpcUser['saveUnpause'](this[_0x5e87('0x5')][_0x4226d6]);RpcVoiceAgentReport[_0x5e87('0x2a')]({'acwtime':_0x5a59c7,'agentacw':!![]},_0x156f39,_0x4226d6)[_0x5e87('0x1e')](function(_0x1183af){logger[_0x5e87('0x20')](_0x5e87('0x2c'),_0x156f39,_0x5a59c7,_0x1183af);})[_0x5e87('0x2d')](function(_0x413ef2){logger[_0x5e87('0x2e')](_0x5e87('0x2f'),_0x156f39,_0x413ef2);});}else{logger['error'](_0x5e87('0x37'),_0x4226d6);if(_0xadece5[_0x5e87('0x6')]){logger[_0x5e87('0x20')](_0x5e87('0x38'),JSON[_0x5e87('0x39')](_0xadece5['timers']));}}}catch(_0x47e9d4){logger[_0x5e87('0x2e')](_0x5e87('0x3a'),_0x47e9d4['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x4fae14){try{if(this[_0x5e87('0x18')][_0x4fae14['queue']]&&(this['voiceQueues'][_0x4fae14[_0x5e87('0x35')]][_0x5e87('0x2')]||this[_0x5e87('0x18')][_0x4fae14[_0x5e87('0x35')]][_0x5e87('0x19')])){if(this[_0x5e87('0x5')][_0x4fae14[_0x5e87('0x17')]]){this[_0x5e87('0x7')][_0x4fae14['uniqueid']]={'queue':_0x4fae14[_0x5e87('0x35')],'interface':_0x4fae14[_0x5e87('0x17')],'destlinkedid':_0x4fae14[_0x5e87('0x21')]};}}}catch(_0x3fa9e8){logger[_0x5e87('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x3fa9e8['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4c9eb0){try{if(this[_0x5e87('0x18')][_0x4c9eb0[_0x5e87('0x35')]]&&(this[_0x5e87('0x18')][_0x4c9eb0[_0x5e87('0x35')]][_0x5e87('0x2')]||this['voiceQueues'][_0x4c9eb0[_0x5e87('0x35')]][_0x5e87('0x19')])){if(this[_0x5e87('0x5')][_0x4c9eb0[_0x5e87('0x17')]]){this['channels'][_0x4c9eb0[_0x5e87('0x2b')]]={'queue':_0x4c9eb0[_0x5e87('0x35')],'interface':_0x4c9eb0[_0x5e87('0x17')]};}}}catch(_0x1a729){logger['error'](_0x5e87('0x3b'),_0x1a729[_0x5e87('0x33')]);}};Acw[_0x5e87('0x34')][_0x5e87('0xb')]=function(_0x275c98){try{if(this[_0x5e87('0x7')][_0x275c98[_0x5e87('0x2b')]]&&_[_0x5e87('0x3c')](this[_0x5e87('0x7')][_0x275c98[_0x5e87('0x2b')]][_0x5e87('0x3d')])){logger[_0x5e87('0x20')]('[%s][HANGUP:UNIQUEID]',_0x275c98[_0x5e87('0x2b')]);this[_0x5e87('0x16')](_0x275c98[_0x5e87('0x2b')]);}else if(this[_0x5e87('0x7')][_0x275c98[_0x5e87('0x3e')]]&&_[_0x5e87('0x3c')](this[_0x5e87('0x7')][_0x275c98['linkedid']][_0x5e87('0x3d')])){logger[_0x5e87('0x20')](_0x5e87('0x3f'),_0x275c98[_0x5e87('0x3e')]);this[_0x5e87('0x16')](_0x275c98['linkedid']);}}catch(_0x26666d){logger[_0x5e87('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x26666d['message']);}};Acw[_0x5e87('0x34')][_0x5e87('0x40')]=function(_0x139e68){try{if(this[_0x5e87('0x7')][_0x139e68[_0x5e87('0x2b')]]&&this[_0x5e87('0x7')][_0x139e68[_0x5e87('0x2b')]][_0x5e87('0x3d')]){logger[_0x5e87('0x20')](_0x5e87('0x41'),_0x139e68[_0x5e87('0x2b')]);this[_0x5e87('0x16')](_0x139e68[_0x5e87('0x2b')]);}else if(this['channels'][_0x139e68[_0x5e87('0x3e')]]&&this['channels'][_0x139e68[_0x5e87('0x3e')]][_0x5e87('0x3d')]){logger['info'](_0x5e87('0x42'),_0x139e68[_0x5e87('0x3e')]);this[_0x5e87('0x16')](_0x139e68['linkedid']);}}catch(_0x4ed98a){logger['error'](_0x5e87('0x43'),_0x4ed98a[_0x5e87('0x33')]);}};Acw[_0x5e87('0x34')]['syncAttendedTransfer']=function(_0x3444cd){try{if(!_[_0x5e87('0x44')](this['channels'][_0x3444cd[_0x5e87('0x45')]])){this['startAcw'](_0x3444cd[_0x5e87('0x45')]);if(this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x46')]]){this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x46')]]['attended']=!![];this[_0x5e87('0x7')][_0x3444cd['transfertargetuniqueid']]=this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x46')]];delete this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x46')]];}}else if(!_[_0x5e87('0x44')](this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x47')]])){this[_0x5e87('0x16')](_0x3444cd['transfertargetuniqueid']);if(this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x48')]]){this[_0x5e87('0x7')][_0x3444cd['origtransfereruniqueid']]['attended']=!![];this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x45')]]=this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x48')]];delete this[_0x5e87('0x7')][_0x3444cd[_0x5e87('0x48')]];}}}catch(_0x26bf61){logger[_0x5e87('0x2e')]('[ACW][syncAttendedTransfer]\x20%s',_0x26bf61[_0x5e87('0x33')]);}};Acw[_0x5e87('0x34')]['syncBlindTransfer']=function(_0x11b4dc){try{if(this[_0x5e87('0x7')][_0x11b4dc[_0x5e87('0x49')]]){logger[_0x5e87('0x20')](_0x5e87('0x4a'),JSON['stringify'](_0x11b4dc[_0x5e87('0x49')]));this[_0x5e87('0x16')](_0x11b4dc['transfereruniqueid']);}else if(this['channels'][_0x11b4dc['transfererlinkedid']]){logger['info'](_0x5e87('0x4b'),JSON[_0x5e87('0x39')](_0x11b4dc[_0x5e87('0x4c')]));this[_0x5e87('0x16')](_0x11b4dc[_0x5e87('0x4c')]);}}catch(_0xce9bc0){logger[_0x5e87('0x2e')](_0x5e87('0x4d'),_0xce9bc0['message']);}};Acw['prototype'][_0x5e87('0xf')]=function(_0x1bee8b){try{if(this[_0x5e87('0x18')][_0x1bee8b['queue']]&&this[_0x5e87('0x18')][_0x1bee8b['queue']][_0x5e87('0x4e')]===_0x5e87('0x4f')){if(this['agents'][_0x1bee8b[_0x5e87('0x17')]]){logger[_0x5e87('0x20')](_0x5e87('0x50'),_0x1bee8b[_0x5e87('0x2b')],_0x1bee8b[_0x5e87('0x17')],_0x1bee8b[_0x5e87('0x35')]);return RpcUser[_0x5e87('0x22')](this[_0x5e87('0x5')][_0x1bee8b['interface']],'Auto-Pause',_0x1bee8b[_0x5e87('0x2b')]);}}}catch(_0x2fc5b0){logger[_0x5e87('0x2e')](_0x5e87('0x51'),_0x2fc5b0[_0x5e87('0x33')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 993d641..79d53f8 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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x4d4a52,_0x563660){_0x4d4a52=_0x4d4a52-0x0;var _0x3aee39=_0x2032[_0x4d4a52];return _0x3aee39;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x5b6a56,_0x3e9506){var _0x4527bd=function(_0x4ece1b){while(--_0x4ece1b){_0x5b6a56['push'](_0x5b6a56['shift']());}};_0x4527bd(++_0x3e9506);}(_0x757a,0xde));var _0xa757=function(_0xf21614,_0x4dbb1a){_0xf21614=_0xf21614-0x0;var _0x2421aa=_0x757a[_0xf21614];return _0x2421aa;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index f81d3f9..4f1370d 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0xb3bb49,_0x1b3484){var _0x3afc25=function(_0x4be11a){while(--_0x4be11a){_0xb3bb49['push'](_0xb3bb49['shift']());}};_0x3afc25(++_0x1b3484);}(_0xb43b,0x1b2));var _0xbb43=function(_0x39f921,_0x2a7b8b){_0x39f921=_0x39f921-0x0;var _0xfe8cc5=_0xb43b[_0x39f921];return _0xfe8cc5;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x2cd1fb,_0x291f55){var _0x48fd2b=function(_0x18e23e){while(--_0x18e23e){_0x2cd1fb['push'](_0x2cd1fb['shift']());}};_0x48fd2b(++_0x291f55);}(_0x9bde,0xe1));var _0xe9bd=function(_0x218412,_0x83799a){_0x218412=_0x218412-0x0;var _0x12cbac=_0x9bde[_0x218412];return _0x12cbac;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 3704093..cff71c2 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2be=['number','queue','name','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','VoiceQueueId','CampaignId','idHopper','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','string','voiceQueue','uniqueid','Contact','phone','firstName'];(function(_0x3a1ce1,_0x23c83a){var _0x3f6f45=function(_0x365118){while(--_0x365118){_0x3a1ce1['push'](_0x3a1ce1['shift']());}};_0x3f6f45(++_0x23c83a);}(_0xd2be,0x1d8));var _0xed2b=function(_0x36fd75,_0x22ef90){_0x36fd75=_0x36fd75-0x0;var _0x250360=_0xd2be[_0x36fd75];return _0x250360;};'use strict';var util=require(_0xed2b('0x0'));var _=require(_0xed2b('0x1'));var moment=require('moment');function checkNameSurname(_0x23372a,_0x5c2f34,_0x2aa456){var _0x2c4e1c='';if(!_['isNil'](_0x5c2f34)&&_0xed2b('0x2')===typeof _0x5c2f34){_0x2c4e1c+=_0x5c2f34;}if(!_['isNil'](_0x2aa456)&&'string'===typeof _0x2aa456){_0x2c4e1c+='\x20'+_0x2aa456;}if(_0x2c4e1c!==''){return _0x2c4e1c;}return _0x23372a;}function Action(_0x18834f,_0x4fea57,_0x583b10){this[_0xed2b('0x3')]=_0x18834f;this[_0xed2b('0x4')]=_0x583b10||undefined;this['name']=checkNameSurname(_0x4fea57[_0xed2b('0x5')][_0xed2b('0x6')],_0x4fea57[_0xed2b('0x5')][_0xed2b('0x7')],_0x4fea57[_0xed2b('0x5')]['lastName']);this[_0xed2b('0x8')]=_0x4fea57['Contact'][_0xed2b('0x6')];this[_0xed2b('0x9')]=_0x18834f[_0xed2b('0xa')];this['active']=_0x4fea57['active']||![];this[_0xed2b('0xb')]=_0x18834f['type'];this[_0xed2b('0xc')]=_0x18834f[_0xed2b('0xc')]||0x3;this['scheduledat']=_0x4fea57[_0xed2b('0xd')];this['countbusyretry']=_0x4fea57[_0xed2b('0xe')];this[_0xed2b('0xf')]=_0x4fea57['countcongestionretry'];this[_0xed2b('0x10')]=_0x4fea57[_0xed2b('0x10')];this[_0xed2b('0x11')]=_0x4fea57['countnosuchnumberretry'];this[_0xed2b('0x12')]=_0x4fea57['countdropretry'];this[_0xed2b('0x13')]=_0x4fea57[_0xed2b('0x13')];this[_0xed2b('0x14')]=_0x4fea57[_0xed2b('0x14')];this[_0xed2b('0x15')]=_0x4fea57['countagentrejectretry'];this['ContactId']=_0x4fea57['ContactId'];this['ListId']=_0x4fea57[_0xed2b('0x16')];this['UserId']=_0x4fea57['UserId'];this[_0xed2b('0x17')]=_0x4fea57[_0xed2b('0x17')];this[_0xed2b('0x18')]=_0x4fea57[_0xed2b('0x18')];this[_0xed2b('0x19')]=_0x4fea57['id'];this['ContactFirstName']=_0x4fea57[_0xed2b('0x5')]['firstName']||'';this[_0xed2b('0x1a')]=moment()[_0xed2b('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xed2b('0x1c')]=_0x4fea57['callback'];this[_0xed2b('0x1d')]=_0x4fea57['callbackuniqueid'];this[_0xed2b('0x1e')]=_0x4fea57['callbackat'];this['recallme']=_0x4fea57[_0xed2b('0x1f')];this[_0xed2b('0x20')]='';this[_0xed2b('0x21')]='';}Action[_0xed2b('0x22')]['getCaller']=function(){return util[_0xed2b('0x1b')](_0xed2b('0x23'),this[_0xed2b('0xa')],this['voiceQueue'][_0xed2b('0x24')]>0x0?this['number'][_0xed2b('0x25')](this[_0xed2b('0x3')][_0xed2b('0x24')]):this[_0xed2b('0x8')]);};Action[_0xed2b('0x22')][_0xed2b('0x26')]=function(){return this[_0xed2b('0x9')];};module[_0xed2b('0x27')]=Action; \ No newline at end of file +var _0xe4ae=['CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','phone','Contact','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','UserId','VoiceQueueId'];(function(_0x2dd555,_0x360667){var _0x18a480=function(_0x382e98){while(--_0x382e98){_0x2dd555['push'](_0x2dd555['shift']());}};_0x18a480(++_0x360667);}(_0xe4ae,0x16b));var _0xee4a=function(_0x4794bd,_0x38b5a7){_0x4794bd=_0x4794bd-0x0;var _0x17ea14=_0xe4ae[_0x4794bd];return _0x17ea14;};'use strict';var util=require(_0xee4a('0x0'));var _=require(_0xee4a('0x1'));var moment=require(_0xee4a('0x2'));function checkNameSurname(_0x38b5fd,_0x3a5c60,_0x16599){var _0x37b20b='';if(!_[_0xee4a('0x3')](_0x3a5c60)&&_0xee4a('0x4')===typeof _0x3a5c60){_0x37b20b+=_0x3a5c60;}if(!_[_0xee4a('0x3')](_0x16599)&&'string'===typeof _0x16599){_0x37b20b+='\x20'+_0x16599;}if(_0x37b20b!==''){return _0x37b20b;}return _0x38b5fd;}function Action(_0x336437,_0x28a0d4,_0x4a20cc){this['voiceQueue']=_0x336437;this[_0xee4a('0x5')]=_0x4a20cc||undefined;this[_0xee4a('0x6')]=checkNameSurname(_0x28a0d4['Contact'][_0xee4a('0x7')],_0x28a0d4[_0xee4a('0x8')][_0xee4a('0x9')],_0x28a0d4['Contact'][_0xee4a('0xa')]);this[_0xee4a('0xb')]=_0x28a0d4[_0xee4a('0x8')][_0xee4a('0x7')];this['queue']=_0x336437[_0xee4a('0x6')];this['active']=_0x28a0d4[_0xee4a('0xc')]||![];this['type']=_0x336437[_0xee4a('0xd')];this[_0xee4a('0xe')]=_0x336437[_0xee4a('0xe')]||0x3;this['scheduledat']=_0x28a0d4[_0xee4a('0xf')];this['countbusyretry']=_0x28a0d4['countbusyretry'];this[_0xee4a('0x10')]=_0x28a0d4['countcongestionretry'];this['countnoanswerretry']=_0x28a0d4['countnoanswerretry'];this[_0xee4a('0x11')]=_0x28a0d4[_0xee4a('0x11')];this[_0xee4a('0x12')]=_0x28a0d4['countdropretry'];this[_0xee4a('0x13')]=_0x28a0d4['countabandonedretry'];this[_0xee4a('0x14')]=_0x28a0d4['countmachineretry'];this['countagentrejectretry']=_0x28a0d4[_0xee4a('0x15')];this['ContactId']=_0x28a0d4['ContactId'];this['ListId']=_0x28a0d4['ListId'];this[_0xee4a('0x16')]=_0x28a0d4[_0xee4a('0x16')];this[_0xee4a('0x17')]=_0x28a0d4['VoiceQueueId'];this[_0xee4a('0x18')]=_0x28a0d4[_0xee4a('0x18')];this[_0xee4a('0x19')]=_0x28a0d4['id'];this[_0xee4a('0x1a')]=_0x28a0d4[_0xee4a('0x8')]['firstName']||'';this[_0xee4a('0x1b')]=moment()[_0xee4a('0x1c')](_0xee4a('0x1d'));this[_0xee4a('0x1e')]=_0x28a0d4[_0xee4a('0x1e')];this[_0xee4a('0x1f')]=_0x28a0d4[_0xee4a('0x1f')];this['callbackat']=_0x28a0d4[_0xee4a('0x20')];this[_0xee4a('0x21')]=_0x28a0d4[_0xee4a('0x21')];this[_0xee4a('0x22')]='';this['originatecalleridname']='';}Action[_0xee4a('0x23')][_0xee4a('0x24')]=function(){return util['format'](_0xee4a('0x25'),this['name'],this[_0xee4a('0x26')]['dialCutDigit']>0x0?this[_0xee4a('0xb')][_0xee4a('0x27')](this[_0xee4a('0x26')][_0xee4a('0x28')]):this[_0xee4a('0xb')]);};Action[_0xee4a('0x23')][_0xee4a('0x29')]=function(){return this['queue'];};module[_0xee4a('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index d481041..08f479a 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7863=['number','starttime','responsetime','answertime','endtime','ringtime','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum'];(function(_0x1bd91c,_0x285e72){var _0x3bc43c=function(_0x5801c4){while(--_0x5801c4){_0x1bd91c['push'](_0x1bd91c['shift']());}};_0x3bc43c(++_0x285e72);}(_0x7863,0x18d));var _0x3786=function(_0x1155e6,_0x233e73){_0x1155e6=_0x1155e6-0x0;var _0x35dd79=_0x7863[_0x1155e6];return _0x35dd79;};'use strict';var util=require('util');var _=require(_0x3786('0x0'));var moment=require('moment');function getSeconds(_0x48a9c9,_0x298b51){var _0x4b4ca8=moment(_0x48a9c9)[_0x3786('0x1')](0x0);var _0x58d023=moment(_0x298b51)[_0x3786('0x1')](0x0);return _0x4b4ca8[_0x3786('0x2')](_0x58d023,'seconds');}function AgentComplete(_0x10744d,_0x5e5137){this[_0x3786('0x3')]=0x4;this[_0x3786('0x4')]=_0x3786('0x5');this[_0x3786('0x6')]=_0x10744d[_0x3786('0x6')];this[_0x3786('0x7')]=_0x10744d[_0x3786('0x7')];this[_0x3786('0x8')]=_0x10744d[_0x3786('0x7')]===_0x3786('0x9')?_0x3786('0xa'):_0x10744d['type'];this['countbusyretry']=_0x10744d['countbusyretry'];this[_0x3786('0xb')]=_0x10744d[_0x3786('0xb')];this[_0x3786('0xc')]=_0x10744d['countnoanswerretry'];this[_0x3786('0xd')]=_0x10744d[_0x3786('0xe')]+_0x10744d[_0x3786('0xb')]+_0x10744d['countnoanswerretry']+_0x10744d[_0x3786('0xf')]+_0x10744d['countdropretry']+_0x10744d[_0x3786('0x10')]+_0x10744d[_0x3786('0x11')]+_0x10744d[_0x3786('0x12')];this['countnosuchnumberretry']=_0x10744d['countnosuchnumberretry'];this[_0x3786('0x13')]=_0x10744d['countdropretry'];this[_0x3786('0x10')]=_0x10744d[_0x3786('0x10')];this['countmachineretry']=_0x10744d[_0x3786('0x11')];this[_0x3786('0x12')]=_0x10744d[_0x3786('0x12')];this['uniqueid']=_0x5e5137[_0x3786('0x14')];this['calleridname']=_0x10744d[_0x3786('0x15')];this[_0x3786('0x16')]=_0x10744d[_0x3786('0x17')];this[_0x3786('0x18')]=_0x10744d[_0x3786('0x18')];this[_0x3786('0x19')]=_0x10744d['responsetime'];this[_0x3786('0x1a')]=_0x10744d[_0x3786('0x1a')];this[_0x3786('0x1b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x3786('0x1c')]=getSeconds(_0x10744d[_0x3786('0x19')],_0x10744d[_0x3786('0x18')]);this['holdtime']=getSeconds(_0x10744d['answertime'],_0x10744d[_0x3786('0x19')]);this['talktime']=getSeconds(this[_0x3786('0x1b')],_0x10744d[_0x3786('0x1a')]);this[_0x3786('0xa')]=_0x5e5137[_0x3786('0xa')];this['membername']=_0x5e5137[_0x3786('0x1d')];this[_0x3786('0x1e')]=_0x5e5137[_0x3786('0x1e')];this[_0x3786('0x1f')]=_0x10744d[_0x3786('0x1f')];this[_0x3786('0x20')]=_0x10744d[_0x3786('0x20')];this[_0x3786('0x21')]=_0x10744d['callbackat'];this['recallme']=_0x10744d['recallme'];this[_0x3786('0x22')]=_0x10744d[_0x3786('0x22')];this['ListId']=_0x10744d[_0x3786('0x23')];this[_0x3786('0x24')]=_0x10744d['UserId'];this[_0x3786('0x25')]=_0x10744d[_0x3786('0x25')];this[_0x3786('0x26')]=_0x10744d[_0x3786('0x26')];this[_0x3786('0x27')]=_0x10744d['originatecalleridnum']||'';this[_0x3786('0x28')]=_0x10744d[_0x3786('0x28')]||'';}module[_0x3786('0x29')]=AgentComplete; \ No newline at end of file +var _0x8e78=['seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x8e78,0x16d));var _0x88e7=function(_0x8ba320,_0x464dc1){_0x8ba320=_0x8ba320-0x0;var _0x48989a=_0x8e78[_0x8ba320];return _0x48989a;};'use strict';var util=require(_0x88e7('0x0'));var _=require('lodash');var moment=require(_0x88e7('0x1'));function getSeconds(_0x2aa3c8,_0x23c9ed){var _0x5c96d1=moment(_0x2aa3c8)['milliseconds'](0x0);var _0x40a241=moment(_0x23c9ed)[_0x88e7('0x2')](0x0);return _0x5c96d1['diff'](_0x40a241,_0x88e7('0x3'));}function AgentComplete(_0x11d99f,_0x530c9a){this[_0x88e7('0x4')]=0x4;this[_0x88e7('0x5')]='Answer';this[_0x88e7('0x6')]=_0x11d99f['scheduledat'];this[_0x88e7('0x7')]=_0x11d99f[_0x88e7('0x7')];this[_0x88e7('0x8')]=_0x11d99f[_0x88e7('0x7')]===_0x88e7('0x9')?_0x88e7('0xa'):_0x11d99f[_0x88e7('0x7')];this['countbusyretry']=_0x11d99f[_0x88e7('0xb')];this[_0x88e7('0xc')]=_0x11d99f[_0x88e7('0xc')];this[_0x88e7('0xd')]=_0x11d99f[_0x88e7('0xd')];this[_0x88e7('0xe')]=_0x11d99f[_0x88e7('0xb')]+_0x11d99f[_0x88e7('0xc')]+_0x11d99f['countnoanswerretry']+_0x11d99f[_0x88e7('0xf')]+_0x11d99f[_0x88e7('0x10')]+_0x11d99f['countabandonedretry']+_0x11d99f['countmachineretry']+_0x11d99f['countagentrejectretry'];this[_0x88e7('0xf')]=_0x11d99f[_0x88e7('0xf')];this['countdropretry']=_0x11d99f[_0x88e7('0x10')];this['countabandonedretry']=_0x11d99f[_0x88e7('0x11')];this['countmachineretry']=_0x11d99f[_0x88e7('0x12')];this[_0x88e7('0x13')]=_0x11d99f[_0x88e7('0x13')];this[_0x88e7('0x14')]=_0x530c9a[_0x88e7('0x14')];this[_0x88e7('0x15')]=_0x11d99f[_0x88e7('0x16')];this[_0x88e7('0x17')]=_0x11d99f[_0x88e7('0x18')];this[_0x88e7('0x19')]=_0x11d99f['starttime'];this[_0x88e7('0x1a')]=_0x11d99f[_0x88e7('0x1a')];this[_0x88e7('0x1b')]=_0x11d99f[_0x88e7('0x1b')];this[_0x88e7('0x1c')]=moment()[_0x88e7('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x88e7('0x1e')]=getSeconds(_0x11d99f[_0x88e7('0x1a')],_0x11d99f['starttime']);this[_0x88e7('0x1f')]=getSeconds(_0x11d99f[_0x88e7('0x1b')],_0x11d99f[_0x88e7('0x1a')]);this['talktime']=getSeconds(this[_0x88e7('0x1c')],_0x11d99f[_0x88e7('0x1b')]);this[_0x88e7('0xa')]=_0x530c9a[_0x88e7('0xa')];this[_0x88e7('0x20')]=_0x530c9a[_0x88e7('0x20')];this['reason']=_0x530c9a[_0x88e7('0x21')];this[_0x88e7('0x22')]=_0x11d99f[_0x88e7('0x22')];this[_0x88e7('0x23')]=_0x11d99f[_0x88e7('0x23')];this[_0x88e7('0x24')]=_0x11d99f[_0x88e7('0x24')];this[_0x88e7('0x25')]=_0x11d99f[_0x88e7('0x25')];this[_0x88e7('0x26')]=_0x11d99f[_0x88e7('0x26')];this[_0x88e7('0x27')]=_0x11d99f[_0x88e7('0x27')];this[_0x88e7('0x28')]=_0x11d99f[_0x88e7('0x28')];this['VoiceQueueId']=_0x11d99f[_0x88e7('0x29')];this['CampaignId']=_0x11d99f[_0x88e7('0x2a')];this[_0x88e7('0x2b')]=_0x11d99f[_0x88e7('0x2b')]||'';this[_0x88e7('0x2c')]=_0x11d99f['originatecalleridname']||'';}module[_0x88e7('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index afa16be..5da3084 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89c3=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x2150c3,_0x3e8664){var _0x2a96d8=function(_0x517d76){while(--_0x517d76){_0x2150c3['push'](_0x2150c3['shift']());}};_0x2a96d8(++_0x3e8664);}(_0x89c3,0xff));var _0x389c=function(_0x5e0415,_0x4d6eda){_0x5e0415=_0x5e0415-0x0;var _0x576c82=_0x89c3[_0x5e0415];return _0x576c82;};'use strict';var util=require(_0x389c('0x0'));var _=require(_0x389c('0x1'));var moment=require(_0x389c('0x2'));function getSeconds(_0x56e907,_0x2ffc1d){var _0x14c809=moment(_0x56e907)[_0x389c('0x3')](0x0);var _0x3a2fa4=moment(_0x2ffc1d)['milliseconds'](0x0);return _0x14c809[_0x389c('0x4')](_0x3a2fa4,'seconds');}function Final(_0x283ff9){this['uniqueid']=_0x283ff9['uniqueid'];this[_0x389c('0x5')]=_0x283ff9['scheduledat'];this['type']=_0x283ff9[_0x389c('0x6')];this[_0x389c('0x7')]=_0x283ff9[_0x389c('0x6')]===_0x389c('0x8')?_0x389c('0x9'):_0x283ff9[_0x389c('0x6')];this[_0x389c('0xa')]=_0x283ff9[_0x389c('0xa')];this[_0x389c('0xb')]=_0x283ff9['countcongestionretry'];this[_0x389c('0xc')]=_0x283ff9[_0x389c('0xc')];this[_0x389c('0xd')]=_0x283ff9[_0x389c('0xa')]+_0x283ff9[_0x389c('0xb')]+_0x283ff9['countnoanswerretry']+_0x283ff9['countnosuchnumberretry']+_0x283ff9[_0x389c('0xe')]+_0x283ff9[_0x389c('0xf')]+_0x283ff9[_0x389c('0x10')]+_0x283ff9['countagentrejectretry'];this[_0x389c('0x11')]=_0x283ff9['countnosuchnumberretry'];this[_0x389c('0xe')]=_0x283ff9[_0x389c('0xe')];this['countabandonedretry']=_0x283ff9[_0x389c('0xf')];this[_0x389c('0x10')]=_0x283ff9[_0x389c('0x10')];this['countagentrejectretry']=_0x283ff9[_0x389c('0x12')];this[_0x389c('0x9')]=_0x283ff9[_0x389c('0x9')];this[_0x389c('0x13')]=_0x283ff9[_0x389c('0x13')];this['calleridnum']=_0x283ff9['calleridnum'];this['starttime']=_0x283ff9[_0x389c('0x14')];this[_0x389c('0x15')]=_0x283ff9['responsetime'];this[_0x389c('0x16')]=_0x283ff9[_0x389c('0x15')];this[_0x389c('0x17')]=_0x283ff9[_0x389c('0x17')]||0x0;this[_0x389c('0x18')]=_0x283ff9[_0x389c('0x18')]||0x0;this[_0x389c('0x19')]=_0x283ff9[_0x389c('0x19')]||0x0;this[_0x389c('0x1a')]=_0x283ff9['callback'];this[_0x389c('0x1b')]=_0x283ff9[_0x389c('0x1b')];this[_0x389c('0x1c')]=_0x283ff9[_0x389c('0x1c')];this[_0x389c('0x1d')]=_0x283ff9[_0x389c('0x1d')];this['ContactId']=_0x283ff9[_0x389c('0x1e')];this[_0x389c('0x1f')]=_0x283ff9[_0x389c('0x1f')];this[_0x389c('0x20')]=_0x283ff9['UserId'];this[_0x389c('0x21')]=_0x283ff9[_0x389c('0x21')];this['CampaignId']=_0x283ff9[_0x389c('0x22')];this['originatecalleridnum']=_0x283ff9[_0x389c('0x23')]||'';this[_0x389c('0x24')]=_0x283ff9[_0x389c('0x24')]||'';}module[_0x389c('0x25')]=Final; \ No newline at end of file +var _0xd8b1=['originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0xf3d78e,_0x27da8b){var _0xe66984=function(_0x3aac43){while(--_0x3aac43){_0xf3d78e['push'](_0xf3d78e['shift']());}};_0xe66984(++_0x27da8b);}(_0xd8b1,0x105));var _0x1d8b=function(_0x2e02f5,_0xaba685){_0x2e02f5=_0x2e02f5-0x0;var _0x533472=_0xd8b1[_0x2e02f5];return _0x533472;};'use strict';var util=require(_0x1d8b('0x0'));var _=require(_0x1d8b('0x1'));var moment=require(_0x1d8b('0x2'));function getSeconds(_0x5c8d8a,_0x20c6dd){var _0x5deaca=moment(_0x5c8d8a)[_0x1d8b('0x3')](0x0);var _0x417c87=moment(_0x20c6dd)['milliseconds'](0x0);return _0x5deaca[_0x1d8b('0x4')](_0x417c87,'seconds');}function Final(_0x5d069a){this['uniqueid']=_0x5d069a[_0x1d8b('0x5')];this['scheduledat']=_0x5d069a[_0x1d8b('0x6')];this[_0x1d8b('0x7')]=_0x5d069a[_0x1d8b('0x7')];this[_0x1d8b('0x8')]=_0x5d069a['type']==='outbound'?_0x1d8b('0x9'):_0x5d069a['type'];this['countbusyretry']=_0x5d069a[_0x1d8b('0xa')];this['countcongestionretry']=_0x5d069a[_0x1d8b('0xb')];this['countnoanswerretry']=_0x5d069a[_0x1d8b('0xc')];this[_0x1d8b('0xd')]=_0x5d069a[_0x1d8b('0xa')]+_0x5d069a[_0x1d8b('0xb')]+_0x5d069a[_0x1d8b('0xc')]+_0x5d069a[_0x1d8b('0xe')]+_0x5d069a['countdropretry']+_0x5d069a[_0x1d8b('0xf')]+_0x5d069a[_0x1d8b('0x10')]+_0x5d069a[_0x1d8b('0x11')];this[_0x1d8b('0xe')]=_0x5d069a[_0x1d8b('0xe')];this[_0x1d8b('0x12')]=_0x5d069a[_0x1d8b('0x12')];this[_0x1d8b('0xf')]=_0x5d069a['countabandonedretry'];this[_0x1d8b('0x10')]=_0x5d069a[_0x1d8b('0x10')];this[_0x1d8b('0x11')]=_0x5d069a[_0x1d8b('0x11')];this[_0x1d8b('0x9')]=_0x5d069a[_0x1d8b('0x9')];this[_0x1d8b('0x13')]=_0x5d069a['calleridname'];this['calleridnum']=_0x5d069a[_0x1d8b('0x14')];this[_0x1d8b('0x15')]=_0x5d069a[_0x1d8b('0x15')];this[_0x1d8b('0x16')]=_0x5d069a[_0x1d8b('0x16')];this['endtime']=_0x5d069a[_0x1d8b('0x16')];this[_0x1d8b('0x17')]=_0x5d069a['ringtime']||0x0;this[_0x1d8b('0x18')]=_0x5d069a[_0x1d8b('0x18')]||0x0;this[_0x1d8b('0x19')]=_0x5d069a['talktime']||0x0;this[_0x1d8b('0x1a')]=_0x5d069a[_0x1d8b('0x1a')];this[_0x1d8b('0x1b')]=_0x5d069a[_0x1d8b('0x1b')];this[_0x1d8b('0x1c')]=_0x5d069a[_0x1d8b('0x1c')];this[_0x1d8b('0x1d')]=_0x5d069a['recallme'];this[_0x1d8b('0x1e')]=_0x5d069a[_0x1d8b('0x1e')];this[_0x1d8b('0x1f')]=_0x5d069a[_0x1d8b('0x1f')];this['UserId']=_0x5d069a['UserId'];this[_0x1d8b('0x20')]=_0x5d069a[_0x1d8b('0x20')];this['CampaignId']=_0x5d069a[_0x1d8b('0x21')];this[_0x1d8b('0x22')]=_0x5d069a['originatecalleridnum']||'';this['originatecalleridname']=_0x5d069a[_0x1d8b('0x23')]||'';}module[_0x1d8b('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 817533f..023c8d3 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x205d=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry'];(function(_0x5517a3,_0x236707){var _0x24ef15=function(_0x55d314){while(--_0x55d314){_0x5517a3['push'](_0x5517a3['shift']());}};_0x24ef15(++_0x236707);}(_0x205d,0x120));var _0xd205=function(_0x39428c,_0x34b23a){_0x39428c=_0x39428c-0x0;var _0x52d069=_0x205d[_0x39428c];return _0x52d069;};'use strict';var util=require(_0xd205('0x0'));var _=require(_0xd205('0x1'));var moment=require(_0xd205('0x2'));function getSeconds(_0x1fb160,_0x3694b3){var _0x55e48d=moment(_0x1fb160)[_0xd205('0x3')](0x0);var _0x2cf928=moment(_0x3694b3)[_0xd205('0x3')](0x0);return _0x55e48d[_0xd205('0x4')](_0x2cf928,_0xd205('0x5'));}function Hangup(_0xd18d9d,_0x515385){this['state']=0x4;this[_0xd205('0x6')]='Answer';this[_0xd205('0x7')]=_0xd18d9d['scheduledat'];this[_0xd205('0x8')]=_0xd18d9d[_0xd205('0x8')];this[_0xd205('0x9')]=_0xd18d9d[_0xd205('0x8')]===_0xd205('0xa')?'queue':_0xd18d9d[_0xd205('0x8')];this['countbusyretry']=_0xd18d9d['countbusyretry'];this[_0xd205('0xb')]=_0xd18d9d[_0xd205('0xb')];this[_0xd205('0xc')]=_0xd18d9d[_0xd205('0xc')];this[_0xd205('0xd')]=_0xd18d9d['countbusyretry']+_0xd18d9d[_0xd205('0xb')]+_0xd18d9d[_0xd205('0xc')]+_0xd18d9d[_0xd205('0xe')]+_0xd18d9d[_0xd205('0xf')]+_0xd18d9d[_0xd205('0x10')]+_0xd18d9d['countmachineretry']+_0xd18d9d[_0xd205('0x11')];this['countnosuchnumberretry']=_0xd18d9d[_0xd205('0xe')];this['countdropretry']=_0xd18d9d[_0xd205('0xf')];this[_0xd205('0x10')]=_0xd18d9d[_0xd205('0x10')];this['countmachineretry']=_0xd18d9d['countmachineretry'];this[_0xd205('0x11')]=_0xd18d9d[_0xd205('0x11')];this['uniqueid']=_0x515385[_0xd205('0x12')];this[_0xd205('0x13')]=_0xd18d9d['name'];this[_0xd205('0x14')]=_0xd18d9d[_0xd205('0x15')];this[_0xd205('0x16')]=_0xd18d9d['starttime'];this[_0xd205('0x17')]=_0xd18d9d[_0xd205('0x17')];this[_0xd205('0x18')]=moment()['format'](_0xd205('0x19'));this[_0xd205('0x1a')]=getSeconds(_0xd18d9d[_0xd205('0x17')],_0xd18d9d[_0xd205('0x16')]);this[_0xd205('0x1b')]=0x0;this[_0xd205('0x1c')]=getSeconds(this[_0xd205('0x18')],_0xd18d9d[_0xd205('0x17')]);this['queue']=_0xd18d9d[_0xd205('0x1d')];this[_0xd205('0x1e')]=_0xd205('0x1f');this[_0xd205('0x20')]=_0x515385[_0xd205('0x21')];this[_0xd205('0x22')]=_0xd18d9d['callback'];this[_0xd205('0x23')]=_0xd18d9d[_0xd205('0x23')];this[_0xd205('0x24')]=_0xd18d9d[_0xd205('0x24')];this[_0xd205('0x25')]=_0xd18d9d['recallme'];this[_0xd205('0x26')]=_0xd18d9d[_0xd205('0x26')];this[_0xd205('0x27')]=_0xd18d9d[_0xd205('0x27')];this[_0xd205('0x28')]=_0xd18d9d[_0xd205('0x28')];this['VoiceQueueId']=_0xd18d9d['VoiceQueueId'];this[_0xd205('0x29')]=_0xd18d9d[_0xd205('0x29')];}module[_0xd205('0x2a')]=Hangup; \ No newline at end of file +var _0x9032=['talktime','endtime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x1e096e,_0x3a8b1d){var _0x2906d7=function(_0x176bec){while(--_0x176bec){_0x1e096e['push'](_0x1e096e['shift']());}};_0x2906d7(++_0x3a8b1d);}(_0x9032,0x92));var _0x2903=function(_0x13ddbb,_0xc3f367){_0x13ddbb=_0x13ddbb-0x0;var _0x508608=_0x9032[_0x13ddbb];return _0x508608;};'use strict';var util=require('util');var _=require(_0x2903('0x0'));var moment=require(_0x2903('0x1'));function getSeconds(_0x3ef111,_0x5003fb){var _0xe535b4=moment(_0x3ef111)[_0x2903('0x2')](0x0);var _0x27ba91=moment(_0x5003fb)[_0x2903('0x2')](0x0);return _0xe535b4[_0x2903('0x3')](_0x27ba91,_0x2903('0x4'));}function Hangup(_0x1aec79,_0xb2d932){this['state']=0x4;this['statedesc']=_0x2903('0x5');this[_0x2903('0x6')]=_0x1aec79[_0x2903('0x6')];this[_0x2903('0x7')]=_0x1aec79['type'];this[_0x2903('0x8')]=_0x1aec79[_0x2903('0x7')]===_0x2903('0x9')?_0x2903('0xa'):_0x1aec79[_0x2903('0x7')];this[_0x2903('0xb')]=_0x1aec79['countbusyretry'];this['countcongestionretry']=_0x1aec79[_0x2903('0xc')];this[_0x2903('0xd')]=_0x1aec79['countnoanswerretry'];this['countglobal']=_0x1aec79[_0x2903('0xb')]+_0x1aec79['countcongestionretry']+_0x1aec79[_0x2903('0xd')]+_0x1aec79[_0x2903('0xe')]+_0x1aec79[_0x2903('0xf')]+_0x1aec79[_0x2903('0x10')]+_0x1aec79[_0x2903('0x11')]+_0x1aec79['countagentrejectretry'];this[_0x2903('0xe')]=_0x1aec79['countnosuchnumberretry'];this[_0x2903('0xf')]=_0x1aec79[_0x2903('0xf')];this[_0x2903('0x10')]=_0x1aec79[_0x2903('0x10')];this['countmachineretry']=_0x1aec79[_0x2903('0x11')];this[_0x2903('0x12')]=_0x1aec79['countagentrejectretry'];this[_0x2903('0x13')]=_0xb2d932[_0x2903('0x13')];this[_0x2903('0x14')]=_0x1aec79[_0x2903('0x15')];this[_0x2903('0x16')]=_0x1aec79[_0x2903('0x17')];this[_0x2903('0x18')]=_0x1aec79[_0x2903('0x18')];this[_0x2903('0x19')]=_0x1aec79[_0x2903('0x19')];this['endtime']=moment()[_0x2903('0x1a')](_0x2903('0x1b'));this[_0x2903('0x1c')]=getSeconds(_0x1aec79[_0x2903('0x19')],_0x1aec79[_0x2903('0x18')]);this[_0x2903('0x1d')]=0x0;this[_0x2903('0x1e')]=getSeconds(this[_0x2903('0x1f')],_0x1aec79[_0x2903('0x19')]);this['queue']=_0x1aec79[_0x2903('0xa')];this[_0x2903('0x20')]='IVR';this[_0x2903('0x21')]=_0xb2d932[_0x2903('0x22')];this[_0x2903('0x23')]=_0x1aec79[_0x2903('0x23')];this[_0x2903('0x24')]=_0x1aec79[_0x2903('0x24')];this[_0x2903('0x25')]=_0x1aec79[_0x2903('0x25')];this[_0x2903('0x26')]=_0x1aec79[_0x2903('0x26')];this[_0x2903('0x27')]=_0x1aec79[_0x2903('0x27')];this[_0x2903('0x28')]=_0x1aec79[_0x2903('0x28')];this[_0x2903('0x29')]=_0x1aec79['UserId'];this[_0x2903('0x2a')]=_0x1aec79['VoiceQueueId'];this['CampaignId']=_0x1aec79[_0x2903('0x2b')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 48ead40..e616650 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a86=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x4a86,0x190));var _0x64a8=function(_0x3e395e,_0xb875e5){_0x3e395e=_0x3e395e-0x0;var _0x47eb8e=_0x4a86[_0x3e395e];return _0x47eb8e;};'use strict';var util=require(_0x64a8('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x4c2456,_0x3d97b1){var _0x57a5b6=moment(_0x4c2456)['milliseconds'](0x0);var _0x5e15b1=moment(_0x3d97b1)[_0x64a8('0x1')](0x0);return _0x57a5b6[_0x64a8('0x2')](_0x5e15b1,_0x64a8('0x3'));}function History(_0x56e097){this['uniqueid']=_0x56e097[_0x64a8('0x4')];this[_0x64a8('0x5')]=_0x56e097[_0x64a8('0x5')]||undefined;this[_0x64a8('0x6')]=_0x56e097[_0x64a8('0x6')];this[_0x64a8('0x7')]=_0x56e097['type']===_0x64a8('0x8')?_0x64a8('0x9'):_0x56e097['type'];this[_0x64a8('0xa')]=_0x56e097[_0x64a8('0xa')];this[_0x64a8('0xb')]=_0x56e097[_0x64a8('0xb')];this[_0x64a8('0xc')]=_0x56e097[_0x64a8('0xc')];this['countglobal']=_0x56e097[_0x64a8('0xa')]+_0x56e097[_0x64a8('0xb')]+_0x56e097[_0x64a8('0xc')]+_0x56e097[_0x64a8('0xd')]+_0x56e097[_0x64a8('0xe')]+_0x56e097[_0x64a8('0xf')]+_0x56e097['countmachineretry']+_0x56e097['countagentrejectretry'];this['countnosuchnumberretry']=_0x56e097[_0x64a8('0xd')];this[_0x64a8('0xe')]=_0x56e097[_0x64a8('0xe')];this['countabandonedretry']=_0x56e097['countabandonedretry'];this[_0x64a8('0x10')]=_0x56e097[_0x64a8('0x10')];this[_0x64a8('0x11')]=_0x56e097[_0x64a8('0x11')];this['queue']=_0x56e097[_0x64a8('0x9')];this[_0x64a8('0x12')]=_0x56e097[_0x64a8('0x13')];this[_0x64a8('0x14')]=_0x56e097[_0x64a8('0x15')];this[_0x64a8('0x16')]=_0x56e097[_0x64a8('0x16')];this[_0x64a8('0x17')]=_0x56e097[_0x64a8('0x17')];this[_0x64a8('0x18')]=_0x56e097[_0x64a8('0x17')];this[_0x64a8('0x19')]=getSeconds(_0x56e097[_0x64a8('0x17')],_0x56e097[_0x64a8('0x16')]);this[_0x64a8('0x1a')]=0x0;this['talktime']=0x0;this[_0x64a8('0x1b')]=_0x56e097[_0x64a8('0x1b')];this[_0x64a8('0x1c')]=_0x56e097[_0x64a8('0x1c')];this[_0x64a8('0x1d')]=_0x56e097['callbackat'];this[_0x64a8('0x1e')]=_0x56e097['recallme'];this[_0x64a8('0x1f')]=_0x56e097[_0x64a8('0x1f')];this[_0x64a8('0x20')]=_0x56e097[_0x64a8('0x20')];this[_0x64a8('0x21')]=_0x56e097[_0x64a8('0x21')];this[_0x64a8('0x22')]=_0x56e097[_0x64a8('0x22')];this[_0x64a8('0x23')]=_0x56e097[_0x64a8('0x23')];this[_0x64a8('0x24')]=_0x56e097['originatecalleridnum']||'';this[_0x64a8('0x25')]=_0x56e097[_0x64a8('0x25')]||'';}module[_0x64a8('0x26')]=History; \ No newline at end of file +var _0x4dd8=['ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0xdb60ed,_0x4d5394){var _0x171fc7=function(_0x4686a5){while(--_0x4686a5){_0xdb60ed['push'](_0xdb60ed['shift']());}};_0x171fc7(++_0x4d5394);}(_0x4dd8,0x1e7));var _0x84dd=function(_0x2eb8d8,_0x3cbca9){_0x2eb8d8=_0x2eb8d8-0x0;var _0x94b827=_0x4dd8[_0x2eb8d8];return _0x94b827;};'use strict';var util=require(_0x84dd('0x0'));var _=require(_0x84dd('0x1'));var moment=require(_0x84dd('0x2'));function getSeconds(_0x46804c,_0xf70a5){var _0x59da5c=moment(_0x46804c)['milliseconds'](0x0);var _0xb8349c=moment(_0xf70a5)['milliseconds'](0x0);return _0x59da5c[_0x84dd('0x3')](_0xb8349c,_0x84dd('0x4'));}function History(_0x1d8c1f){this[_0x84dd('0x5')]=_0x1d8c1f[_0x84dd('0x5')];this[_0x84dd('0x6')]=_0x1d8c1f[_0x84dd('0x6')]||undefined;this[_0x84dd('0x7')]=_0x1d8c1f[_0x84dd('0x7')];this[_0x84dd('0x8')]=_0x1d8c1f[_0x84dd('0x7')]==='outbound'?_0x84dd('0x9'):_0x1d8c1f[_0x84dd('0x7')];this[_0x84dd('0xa')]=_0x1d8c1f[_0x84dd('0xa')];this[_0x84dd('0xb')]=_0x1d8c1f['countcongestionretry'];this['countnoanswerretry']=_0x1d8c1f[_0x84dd('0xc')];this[_0x84dd('0xd')]=_0x1d8c1f[_0x84dd('0xa')]+_0x1d8c1f['countcongestionretry']+_0x1d8c1f[_0x84dd('0xc')]+_0x1d8c1f[_0x84dd('0xe')]+_0x1d8c1f[_0x84dd('0xf')]+_0x1d8c1f['countabandonedretry']+_0x1d8c1f[_0x84dd('0x10')]+_0x1d8c1f[_0x84dd('0x11')];this[_0x84dd('0xe')]=_0x1d8c1f[_0x84dd('0xe')];this[_0x84dd('0xf')]=_0x1d8c1f[_0x84dd('0xf')];this['countabandonedretry']=_0x1d8c1f[_0x84dd('0x12')];this[_0x84dd('0x10')]=_0x1d8c1f[_0x84dd('0x10')];this[_0x84dd('0x11')]=_0x1d8c1f[_0x84dd('0x11')];this[_0x84dd('0x9')]=_0x1d8c1f[_0x84dd('0x9')];this['calleridname']=_0x1d8c1f[_0x84dd('0x13')];this[_0x84dd('0x14')]=_0x1d8c1f['number'];this[_0x84dd('0x15')]=_0x1d8c1f['starttime'];this['responsetime']=_0x1d8c1f[_0x84dd('0x16')];this[_0x84dd('0x17')]=_0x1d8c1f[_0x84dd('0x16')];this[_0x84dd('0x18')]=getSeconds(_0x1d8c1f[_0x84dd('0x16')],_0x1d8c1f[_0x84dd('0x15')]);this[_0x84dd('0x19')]=0x0;this['talktime']=0x0;this[_0x84dd('0x1a')]=_0x1d8c1f[_0x84dd('0x1a')];this[_0x84dd('0x1b')]=_0x1d8c1f[_0x84dd('0x1b')];this[_0x84dd('0x1c')]=_0x1d8c1f['callbackat'];this[_0x84dd('0x1d')]=_0x1d8c1f[_0x84dd('0x1d')];this[_0x84dd('0x1e')]=_0x1d8c1f[_0x84dd('0x1e')];this[_0x84dd('0x1f')]=_0x1d8c1f['ListId'];this['UserId']=_0x1d8c1f[_0x84dd('0x20')];this['VoiceQueueId']=_0x1d8c1f['VoiceQueueId'];this['CampaignId']=_0x1d8c1f[_0x84dd('0x21')];this[_0x84dd('0x22')]=_0x1d8c1f[_0x84dd('0x22')]||'';this[_0x84dd('0x23')]=_0x1d8c1f[_0x84dd('0x23')]||'';}module[_0x84dd('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b5317aa..d71cee8 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 _0xa30c=['[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','UserId','VoiceQueueId','[emptyContact]','isTrunkReachable','reachable','SIP/%s','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countmachineretry','emit','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countbusyretry','countnosuchnumberretry','countagentrejectretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','dialDropMaxRetry','CampaignId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','predictiveIntervalDroppedCallsCallersExit','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','stateinterface','locked','rrmemory','push','idHopper','paused','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','Failure','\x20Timezone\x20unknow\x20','isArray','length','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','dialPreviewRecallmeReminder','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','substring','dialCutDigit','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','syncOriginateResponse','responsetime','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getVoiceQueueRtPauses','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\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','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','Amax\x20=\x20','----\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','lodash','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startProgressive','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','type','outbound','strategy','answered','available','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','prototype','[uniqueid]','clearZombieChannels','actions','[actions]','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact'];(function(_0x1dc05f,_0x320907){var _0x40cbae=function(_0x113ffe){while(--_0x113ffe){_0x1dc05f['push'](_0x1dc05f['shift']());}};_0x40cbae(++_0x320907);}(_0xa30c,0x165));var _0xca30=function(_0x55eec1,_0x3a087a){_0x55eec1=_0x55eec1-0x0;var _0x561ec3=_0xa30c[_0x55eec1];return _0x561ec3;};'use strict';var util=require('util');var _=require(_0xca30('0x0'));var BPromise=require('bluebird');var uuid=require(_0xca30('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0xca30('0x2'));var Redis=require(_0xca30('0x3'));var ut=require(_0xca30('0x4'));var config=require(_0xca30('0x5'));var logger=require(_0xca30('0x6'))(_0xca30('0x7'));var loggerBooked=require(_0xca30('0x6'))(_0xca30('0x8'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0xca30('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xca30('0x9'));var ami=require(_0xca30('0xa'));config[_0xca30('0xb')]=_[_0xca30('0xc')](config['redis'],{'host':_0xca30('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xca30('0xe'));var cmHopperHistory=require(_0xca30('0xf'));var cmHopperBlack=require(_0xca30('0x10'));var voiceQueueRt=require(_0xca30('0x11'));var RpcSetting=require(_0xca30('0x12'));var Action=require('./action');var History=require('./history');var Final=require('./final');var AgentComplete=require(_0xca30('0x13'));var QueueCallerAbandon=require(_0xca30('0x14'));var Hangup=require(_0xca30('0x15'));var ipAgi=process[_0xca30('0x16')]['XCALLY_IP_AGI']||_0xca30('0x17');var strategy={'rrmemory':'rrmemory','roundrobin':_0xca30('0x18')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x16292a){this[_0xca30('0x19')]=this[_0xca30('0x19')]?this[_0xca30('0x19')][_0xca30('0x1a')](_0x16292a):_0x16292a();};function Dialer(_0xce5383,_0x19c6bd){this[_0xca30('0x1b')]=new Sequence();this[_0xca30('0x1c')]=_0x19c6bd;this[_0xca30('0x1d')]=_0xce5383[_0xca30('0x1d')];this[_0xca30('0x1e')]=_0xce5383[_0xca30('0x1e')];this[_0xca30('0x1f')]=_0xce5383[_0xca30('0x1f')];this[_0xca30('0x20')]=_0xce5383[_0xca30('0x20')];this[_0xca30('0x21')]=config['maxNumberOriginate']||0x2;this[_0xca30('0x22')]={};this['actions']={};this['contactsId']={};this[_0xca30('0x23')]={};this[_0xca30('0x24')]={};this['startPredictive']={};this[_0xca30('0x25')]={};this['ivrOriginated']={};this[_0xca30('0x26')]={};this['queueBookedRR']={};ami['on'](_0xca30('0x27'),this[_0xca30('0x28')][_0xca30('0x29')](this));ami['on']('queuecallerabandon',this[_0xca30('0x2a')][_0xca30('0x29')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xca30('0x29')](this));ami['on'](_0xca30('0x2b'),this[_0xca30('0x2c')][_0xca30('0x29')](this));ami['on'](_0xca30('0x2d'),this['syncQueueSummary'][_0xca30('0x29')](this));ami['on'](_0xca30('0x2e'),this[_0xca30('0x2f')]['bind'](this));ami['on'](_0xca30('0x30'),this[_0xca30('0x31')][_0xca30('0x29')](this));ami['on'](_0xca30('0x32'),this[_0xca30('0x33')]['bind'](this));ami['on'](_0xca30('0x34'),this[_0xca30('0x35')][_0xca30('0x29')](this));ami['on'](_0xca30('0x36'),this[_0xca30('0x37')][_0xca30('0x29')](this));this[_0xca30('0x38')]();this[_0xca30('0x39')]();RpcSetting[_0xca30('0x3a')]()[_0xca30('0x3b')](function(_0x512ee9){previewRecallmeReminderInterval=_0x512ee9[_0xca30('0x3c')];});}function isNotNull(_0x210237){return _0x210237!==null&&!_[_0xca30('0x3d')](_0x210237);}function checkIsLoggedIn(_0x2bc45b,_0x46d084){return function(){if(_0x46d084<=0x0){_0x2bc45b[_0xca30('0x3e')]=_0xca30('0x3f');throw _0x2bc45b[_0xca30('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x40ddfc){return _0x40ddfc;}function checkIsActive(_0x256edd,_0x51249c){return function(){if(!isActive(_0x51249c)){_0x256edd['message']=_0xca30('0x41');throw _0x256edd['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x51426f){return function(){if(!isNotNull(_0x51426f['Interval'])){_0x51426f[_0xca30('0x3e')]=_0xca30('0x42');throw _0x51426f[_0xca30('0x40')]+_0xca30('0x43');}if(!isNotNull(_0x51426f['Interval'][_0xca30('0x44')])){_0x51426f[_0xca30('0x3e')]=_0xca30('0x42');throw _0x51426f[_0xca30('0x40')]+_0xca30('0x43');}if(!isNotNull(_[_0xca30('0x45')](_0x51426f['Interval']['Intervals']))){_0x51426f['message']='INTERVAL_IS_NULL';throw _0x51426f[_0xca30('0x40')]+_0xca30('0x43');}};}function msgResponse(_0x4ebcd4,_0x486f82,_0x280ad7){return{'action':_0x4ebcd4,'response':_0x486f82,'message':_0x280ad7,'stack':_0x280ad7};}function myreject(_0x26ded4){return function(_0xcc8950){return _0x26ded4(msgResponse(_0xca30('0x46'),'Error',JSON[_0xca30('0x47')](_0xcc8950)));};}function getSeconds(_0x56b30e,_0x3b2fc3){var _0xca30c=moment(_0x56b30e)[_0xca30('0x48')](0x0);var _0x333789=moment(_0x3b2fc3)[_0xca30('0x48')](0x0);return _0xca30c['diff'](_0x333789,_0xca30('0x49'));}function emit(_0x22f28e,_0x2d163d,_0x553d65){io['to'](_0x22f28e)['emit'](_0x2d163d,_0x553d65);}function emitVoiceQueueSummary(_0x758b5b){if(_0x758b5b[_0xca30('0x4a')]===_0xca30('0x4b')){var _0x48d7ba={'id':_0x758b5b['id'],'name':_0x758b5b['name'],'strategy':_0x758b5b[_0xca30('0x4c')],'answered':_0x758b5b[_0xca30('0x4d')],'available':_0x758b5b[_0xca30('0x4e')],'loggedIn':_0x758b5b['loggedIn'],'pTalking':_0x758b5b[_0xca30('0x4f')],'sumBillable':_0x758b5b[_0xca30('0x50')],'sumDuration':_0x758b5b['sumDuration'],'sumHoldTime':_0x758b5b[_0xca30('0x51')]||0x0,'talking':_0x758b5b[_0xca30('0x52')],'total':_0x758b5b[_0xca30('0x53')],'type':_0x758b5b[_0xca30('0x4a')],'unmanaged':_0x758b5b[_0xca30('0x54')],'abandoned':_0x758b5b[_0xca30('0x55')],'waiting':_0x758b5b['waiting'],'loggedInDb':_0x758b5b[_0xca30('0x56')],'dialActive':_0x758b5b[_0xca30('0x57')],'dialMethod':_0x758b5b[_0xca30('0x58')],'dialOriginateCallerIdName':_0x758b5b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x758b5b[_0xca30('0x59')],'dialOriginateTimeout':_0x758b5b[_0xca30('0x5a')],'dialPrefix':_0x758b5b[_0xca30('0x5b')],'outboundAnswerAgiCallsDay':_0x758b5b[_0xca30('0x5c')],'outboundAnswerCallsDay':_0x758b5b[_0xca30('0x5d')],'outboundBlacklistCallsDay':_0x758b5b['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x758b5b[_0xca30('0x5e')],'outboundCongestionCallsDay':_0x758b5b[_0xca30('0x5f')],'outboundDropCallsDayACS':_0x758b5b[_0xca30('0x60')],'outboundDropCallsDayCallersExit':_0x758b5b[_0xca30('0x61')],'outboundDropCallsDayTimeout':_0x758b5b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x758b5b[_0xca30('0x62')],'outboundNoSuchCallsDay':_0x758b5b[_0xca30('0x63')],'outboundOriginateFailureCallsDay':_0x758b5b[_0xca30('0x64')],'outboundReCallsDay':_0x758b5b[_0xca30('0x65')],'outboundRejectCallsDay':_0x758b5b[_0xca30('0x66')],'outboundUnknownCallsDay':_0x758b5b['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x758b5b['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x758b5b[_0xca30('0x67')],'predictiveIntervalAvgTalktime':_0x758b5b[_0xca30('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x758b5b['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x758b5b[_0xca30('0x69')],'predictiveIntervalErlangCalls':_0x758b5b[_0xca30('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x758b5b[_0xca30('0x6b')],'predictiveIntervalHitRate':_0x758b5b['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x758b5b[_0xca30('0x6c')],'predictiveIntervalPauses':_0x758b5b[_0xca30('0x6d')],'predictiveIntervalAvailable':_0x758b5b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x758b5b[_0xca30('0x6e')],'message':_0x758b5b[_0xca30('0x3e')],'originated':_0x758b5b[_0xca30('0x6f')],'erlangCalls':_0x758b5b[_0xca30('0x70')],'erlangCallToSecond':_0x758b5b[_0xca30('0x71')],'erlangAbandonmentRate':_0x758b5b['erlangAbandonmentRate'],'erlangBusyFactor':_0x758b5b[_0xca30('0x72')],'startPredictive':_0x758b5b[_0xca30('0x73')],'startProgressive':_0x758b5b[_0xca30('0x25')]};if(_0x758b5b[_0xca30('0x74')]){_0x48d7ba['Trunk']={'id':_0x758b5b['Trunk']['id'],'name':_0x758b5b['Trunk']['name'],'active':_0x758b5b[_0xca30('0x74')][_0xca30('0x75')],'callerid':_0x758b5b['Trunk'][_0xca30('0x76')]};}if(_0x758b5b['Interval']){_0x48d7ba[_0xca30('0x77')]={'id':_0x758b5b[_0xca30('0x77')]['id'],'name':_0x758b5b[_0xca30('0x77')][_0xca30('0x40')]};}var _0x452480=md5(JSON[_0xca30('0x47')](_0x48d7ba));if(_0x758b5b[_0xca30('0x2')]!==_0x452480){_0x758b5b[_0xca30('0x2')]=_0x452480;emit(util[_0xca30('0x78')](_0xca30('0x79'),_0x48d7ba[_0xca30('0x40')]),_0xca30('0x7a'),_0x48d7ba);}}}function emitCampaignSummary(_0x19fdfb){if(_0x19fdfb[_0xca30('0x4a')]===_0xca30('0x7b')){emit(util[_0xca30('0x78')]('campaign:ivr:%s',_0x19fdfb[_0xca30('0x40')]),_0xca30('0x7c'),_0x19fdfb);}}function checkGetDataPredictive(_0x521fa9){if(isNotNull(_0x521fa9)&&!_['isEmpty'](_0x521fa9)){loggerPredictive[_0xca30('0x7d')](_0xca30('0x7e'));loggerPredictive[_0xca30('0x7d')](_0xca30('0x7f'),_0x521fa9[_0xca30('0x6e')]);loggerPredictive[_0xca30('0x7d')](_0xca30('0x80'),_0x521fa9['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xca30('0x7d')](_0xca30('0x81'),_0x521fa9[_0xca30('0x69')]);loggerPredictive[_0xca30('0x7d')](_0xca30('0x82'),_0x521fa9['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xca30('0x7d')](_0xca30('0x83'),_0x521fa9[_0xca30('0x67')]);loggerPredictive[_0xca30('0x7d')](_0xca30('0x84'),_0x521fa9[_0xca30('0x68')]);loggerPredictive[_0xca30('0x7d')](_0xca30('0x85'));if(_0x521fa9['predictiveIntervalTotalCalls']>0x0){if(!_[_0xca30('0x3d')](_0x521fa9[_0xca30('0x68')])&&_0x521fa9['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xca30('0x7d')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xca30('0x3d')](_0x521fa9['predictiveIntervalAvgHoldtime'])&&_0x521fa9[_0xca30('0x67')]>0x0){return!![];}loggerPredictive[_0xca30('0x7d')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xca30('0x7d')](_0xca30('0x86'));}return![];}function mergeDataErlangB(_0x519961){return function(_0x2ed377){loggerPredictive[_0xca30('0x7d')](_0xca30('0x87'));loggerPredictive[_0xca30('0x7d')](_0xca30('0x88'),_0x2ed377['erlangCalls']);loggerPredictive[_0xca30('0x7d')](_0xca30('0x89'),_0x2ed377[_0xca30('0x71')]);loggerPredictive[_0xca30('0x7d')](_0xca30('0x8a'),_0x2ed377['erlangAbandonmentRate']);loggerPredictive[_0xca30('0x7d')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ed377[_0xca30('0x72')]);loggerPredictive[_0xca30('0x7d')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ed377[_0xca30('0x8b')]);loggerPredictive[_0xca30('0x7d')]('---------------------------');_[_0xca30('0x8c')](_0x519961,_0x2ed377);};}function getDiff(_0x4b5db5){var _0x327eb0=moment()['milliseconds'](0x0);var _0x38c029=moment(_0x4b5db5)['milliseconds'](0x0);return _0x327eb0[_0xca30('0x8d')](_0x38c029,_0xca30('0x49'));}function ifInterval(_0x5e3bcb,_0x4315f0){if(_[_0xca30('0x3d')](_0x4315f0)){return![];}return getDiff(_0x4315f0)<_0x5e3bcb*0x3c;}function freeVariablesPredictive(_0x599c7e){if(isNotNull(_0x599c7e)){if(!_[_0xca30('0x3d')](_0x599c7e[_0xca30('0x25')])){_0x599c7e[_0xca30('0x25')]=undefined;loggerPredictive[_0xca30('0x7d')](_0x599c7e[_0xca30('0x40')],_0xca30('0x8e'));}if(!_[_0xca30('0x3d')](_0x599c7e['startPredictive'])){_0x599c7e[_0xca30('0x73')]=undefined;loggerPredictive[_0xca30('0x7d')](_0x599c7e[_0xca30('0x40')],_0xca30('0x8f'));}if(!_[_0xca30('0x3d')](_0x599c7e[_0xca30('0x90')])){clearInterval(_0x599c7e['handlePredictive']);_0x599c7e[_0xca30('0x90')]=undefined;loggerPredictive[_0xca30('0x7d')](_0x599c7e[_0xca30('0x40')],_0xca30('0x91'));}}}function erlangb(_0x3075d6,_0x42df9e){if(_0x42df9e===0x0){return 0x0;}var _0x3a3798=0x1;for(var _0x464754=0x1;_0x464754<=_0x42df9e;_0x464754+=0x1){_0x3a3798=0x1+_0x3a3798*_0x464754/_0x3075d6;}return 0x1/_0x3a3798;}function isVoiceQueueOutbound(_0x4730c4){return _0x4730c4===_0xca30('0x4b');}function isNotPreview(_0x31ec93){return _0x31ec93!==_0xca30('0x1c');}function isCampaignIvr(_0xf9ccbb){return _0xf9ccbb==='ivr';}function getCallerId(_0x3a2f45,_0x5eed82,_0x4c1031){if(!_[_0xca30('0x3d')](_0x4c1031)&&typeof _0x4c1031==='string'&&!_[_0xca30('0x45')](_0x4c1031)){if(!_['isUndefined'](_0x5eed82)&&typeof _0x5eed82===_0xca30('0x92')&&!_['isEmpty'](_0x5eed82)){return util[_0xca30('0x78')]('\x22%s\x22\x20<%s>',_0x5eed82,_0x4c1031);}return util['format'](_0xca30('0x93'),_0x4c1031,_0x4c1031);}if(!_[_0xca30('0x3d')](_0x3a2f45)&&typeof _0x3a2f45===_0xca30('0x92')&&!_[_0xca30('0x45')](_0x3a2f45)){return _0x3a2f45;}return _0xca30('0x94');}function loggerCatchQueueSummary(_0x360761,_0x43fece){return function(_0x9ba4ff){freeVariablesPredictive(_0x43fece);emitVoiceQueueSummary(_0x43fece);emitCampaignSummary(_0x43fece);loggerSyncQueueSummary[_0xca30('0x95')](_0x360761,util[_0xca30('0x96')](_0x9ba4ff,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4e01e4,_0x1b7def){return function(_0x88262){loggerPredictive[_0xca30('0x95')](_0x1b7def['name'],_0x4e01e4);loggerPredictive[_0xca30('0x95')](_0x88262[_0xca30('0x97')]);freeVariablesPredictive(_0x1b7def);};}function loggerCatch(_0x2a152e){return function(_0x526c61){logger[_0xca30('0x95')](_0x2a152e,util[_0xca30('0x96')](_0x526c61,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x114c00){return _0x114c00&&!_['isUndefined'](_0x114c00)&&_0x114c00['length']>0x0;}function decremetOriginate(_0x5b0c59){if(!_[_0xca30('0x3d')](_0x5b0c59)&&_0x5b0c59!==null){if(typeof _0x5b0c59[_0xca30('0x6f')]!==_0xca30('0x98')){if(_0x5b0c59[_0xca30('0x6f')]>0x0){_0x5b0c59['originated']-=0x1;}else{logger['error'](_0xca30('0x99'));}}}else{logger['error'](_0xca30('0x9a'));}}function checkContactLowerLimitOriginate(_0x53d973,_0x598d2c,_0x28d7fa){if(_0x598d2c>_0x28d7fa){for(var _0x31959e=0x0;_0x31959e<_0x598d2c-_0x28d7fa;_0x31959e+=0x1){decremetOriginate(_0x53d973);}}}function loggerGetContactDialer(_0xba2620,_0x196bb7,_0x7cb6f5){return function(_0xa6d21c){checkContactLowerLimitOriginate(_0x196bb7,_0x7cb6f5,0x0);logger[_0xca30('0x95')](_0xba2620,util[_0xca30('0x96')](_0xa6d21c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x364c92){return function(_0x4d96ff){if(isNotNull(_0x4d96ff)&&isNotNull(_0x4d96ff[0x0])){if(_0x4d96ff[0x0][_0xca30('0x9b')]>0x0){_0x364c92[_0xca30('0x3e')]='RESCHEDULED_CONTACTS';logger[_0xca30('0x7d')](_0xca30('0x9c')+_0x364c92['name'],_0x4d96ff[0x0][_0xca30('0x9b')],_0xca30('0x9d'));}else{_0x364c92[_0xca30('0x3e')]=_0xca30('0x9e');logger[_0xca30('0x7d')](_0xca30('0x9f')+_0x364c92[_0xca30('0x40')]);}}};}function notSendMessagesQueue(_0x4ae316){if(_0x4ae316[_0xca30('0xa0')]){freeVariablesPredictive(_0x4ae316);if(_0x4ae316[_0xca30('0x6f')]===0x0&&_0x4ae316['talking']===0x0&&_0x4ae316[_0xca30('0xa1')]===0x0&&(_0x4ae316[_0xca30('0x4f')]||0x0)===0x0){_0x4ae316[_0xca30('0xa0')]=![];_0x4ae316[_0xca30('0x4e')]=0x0;_0x4ae316['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xca30('0x95')](_0xca30('0xa2'),_0x4ae316[_0xca30('0x40')],_0xca30('0xa3'));}else{_0x4ae316[_0xca30('0x3e')]=_0xca30('0xa4');loggerSyncQueueSummary[_0xca30('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4ae316[_0xca30('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x4ae316);}}function notSendMessagesCampaign(_0x871f2c){if(_0x871f2c['sendMessageOneNotActive']){if(_0x871f2c['originated']===0x0){_0x871f2c[_0xca30('0xa0')]=![];_0x871f2c[_0xca30('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xca30('0x95')](_0xca30('0xa5'),_0x871f2c[_0xca30('0x40')],_0xca30('0xa3'));}else{_0x871f2c[_0xca30('0x3e')]=_0xca30('0xa4');loggerSyncQueueSummary[_0xca30('0x95')](_0xca30('0xa5'),_0x871f2c[_0xca30('0x40')],_0xca30('0xa6'));}emitCampaignSummary(_0x871f2c);}}function createObjHistory(_0x26bf1c,_0x1caa98,_0x46d4d9,_0x487863,_0x5dbd38){_0x26bf1c[_0xca30('0x3e')]=_0x46d4d9;var _0x1b3864=new Action(_0x26bf1c,_0x1caa98);var _0x16d782=new History(_0x1b3864);_0x16d782[_0xca30('0xa7')]=_0x487863;_0x16d782[_0xca30('0xa8')]=_0x5dbd38;_0x16d782[_0xca30('0xa9')]=_0x1b3864['starttime'];return _0x16d782;}Dialer[_0xca30('0xaa')][_0xca30('0x39')]=function(){var _0x309721=this;setInterval(function(){_0x309721['clearZombieChannels'](_0x309721['uniqueId'],_0xca30('0xab'));_0x309721[_0xca30('0xac')](_0x309721[_0xca30('0xad')],_0xca30('0xae'));},0x32c8);};Dialer['prototype'][_0xca30('0xac')]=function(_0x5b9b88,_0x5c6259){var _0x13ebb7=this;for(var _0x4d7b54 in _0x5b9b88){if(typeof _0x5b9b88[_0x4d7b54]!==_0xca30('0x98')){this[_0xca30('0x1b')][_0xca30('0xaf')](function(){if(!_[_0xca30('0xb0')](_0x5b9b88[_0x4d7b54])){return ami[_0xca30('0xb1')]({'action':_0xca30('0xb2'),'channel':_0x5b9b88[_0x4d7b54][_0xca30('0xb3')]})[_0xca30('0xb4')](function(_0x4d0852){if(_0x4d0852[_0xca30('0x3e')]===_0xca30('0xb5')){setTimeout(function(){if(_0x5b9b88[_0x4d7b54]&&_0x5b9b88[_0x4d7b54][_0xca30('0x4a')]!==_0xca30('0x7b')){_0x13ebb7[_0xca30('0xb6')](_0x13ebb7[_0xca30('0x1d')][_0x5b9b88[_0x4d7b54]['queue']]);logger['error'](_0xca30('0xb7'),_0x5c6259,_0x4d7b54,_0x5b9b88[_0x4d7b54]['queue']);delete _0x5b9b88[_0x4d7b54];}if(_0x5b9b88[_0x4d7b54]&&_0x5b9b88[_0x4d7b54][_0xca30('0x4a')]==='ivr'){_0x13ebb7[_0xca30('0xb6')](_0x13ebb7[_0xca30('0x1e')][_0x5b9b88[_0x4d7b54][_0xca30('0xb8')]]);logger[_0xca30('0x95')](_0xca30('0xb9'),_0x5c6259,_0x4d7b54,_0x5b9b88[_0x4d7b54]['queue']);delete _0x5b9b88[_0x4d7b54];}},0x2328);}});}});}}};Dialer['prototype'][_0xca30('0xba')]=function(_0x105774){return BPromise['resolve']()[_0xca30('0x3b')](cmHopper[_0xca30('0xba')](_0x105774))[_0xca30('0xb4')](loggerCatch(_0xca30('0xbb')));};Dialer[_0xca30('0xaa')][_0xca30('0xbc')]=function(_0x97c38){return BPromise['resolve']()[_0xca30('0x3b')](cmHopperBlack[_0xca30('0xbc')](_0x97c38))[_0xca30('0xb4')](loggerCatch(_0xca30('0xbd')));};Dialer[_0xca30('0xaa')][_0xca30('0xbe')]=function(_0x257571){return BPromise[_0xca30('0xbf')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x257571))[_0xca30('0xb4')](loggerCatch(_0xca30('0xc0')));};Dialer['prototype'][_0xca30('0xc1')]=function(_0x88054c){return BPromise['resolve']()[_0xca30('0x3b')](cmHopperHistory['avgHandleTime'](_0x88054c))[_0xca30('0xb4')](loggerCatch(_0xca30('0xc2')));};Dialer[_0xca30('0xaa')][_0xca30('0xc3')]=function(_0x13a0de){return BPromise['resolve']()['then'](cmHopper[_0xca30('0xc3')](_0x13a0de))[_0xca30('0xb4')](loggerCatch(_0xca30('0xc4')));};Dialer[_0xca30('0xaa')][_0xca30('0xc5')]=function(_0x1e714c,_0x2a1970,_0xdd3f6d){return BPromise[_0xca30('0xbf')]()[_0xca30('0x3b')](cmHopper[_0xca30('0xc5')](_0x1e714c,_0x2a1970,_0xdd3f6d))['catch'](loggerCatch(_0xca30('0xc6')));};Dialer[_0xca30('0xaa')][_0xca30('0xc7')]=function(_0x19813a,_0x53249c,_0x3faa54,_0x38705f,_0x4d0920){return BPromise[_0xca30('0xbf')]()['then'](cmHopper[_0xca30('0xc7')](_0x19813a,_0x53249c,_0x3faa54,_0x38705f))['catch'](function(_0x2a0452){_0x4d0920[_0xca30('0xc8')]-=_0x3faa54;_0x4d0920[_0xca30('0xc8')]=_0x4d0920['temp']>0x0?_0x4d0920[_0xca30('0xc8')]:0x0;loggerCatch(_0xca30('0xc9'))(_0x2a0452);});};Dialer[_0xca30('0xaa')][_0xca30('0xca')]=function(_0x22c892,_0x9c96ae,_0x512af4,_0x34c000){return BPromise[_0xca30('0xbf')]()[_0xca30('0x3b')](cmHopper[_0xca30('0xca')](_0x22c892,_0x9c96ae,_0x512af4))[_0xca30('0xb4')](function(_0x4191b1){_0x34c000[_0xca30('0xc8')]-=_0x9c96ae;_0x34c000[_0xca30('0xc8')]=_0x34c000[_0xca30('0xc8')]>0x0?_0x34c000[_0xca30('0xc8')]:0x0;loggerCatch(_0xca30('0xcb'))(_0x4191b1);});};Dialer[_0xca30('0xaa')]['getVoiceQueueRtPauses']=function(_0x2c4f96){return BPromise[_0xca30('0xbf')]()[_0xca30('0x3b')](voiceQueueRt['getVoiceQueueRtPauses'](_0x2c4f96))[_0xca30('0xb4')](loggerCatch(_0xca30('0xcc')));};Dialer[_0xca30('0xaa')][_0xca30('0xcd')]=function(_0x2475c0){return BPromise[_0xca30('0xbf')]()[_0xca30('0x3b')](cmHopper[_0xca30('0xcd')](_0x2475c0))[_0xca30('0xb4')](loggerCatch(_0xca30('0xce')));};Dialer[_0xca30('0xaa')][_0xca30('0xcf')]=function(_0x35c8c3){return BPromise[_0xca30('0xbf')]()[_0xca30('0x3b')](cmHopperHistory[_0xca30('0xcf')](_0x35c8c3))[_0xca30('0xb4')](loggerCatch(_0xca30('0xd0')));};Dialer['prototype'][_0xca30('0xb6')]=function(_0x3c230d){if(!_[_0xca30('0x3d')](_0x3c230d)&&_0x3c230d!==null){if(typeof _0x3c230d[_0xca30('0x6f')]!==_0xca30('0x98')){if(_0x3c230d[_0xca30('0x6f')]>0x0){_0x3c230d[_0xca30('0x6f')]-=0x1;}else{logger['error'](_0xca30('0xd1'));}}}else{logger[_0xca30('0x95')](_0xca30('0xd2'));}};Dialer[_0xca30('0xaa')][_0xca30('0xd3')]=function(_0x2b5840,_0x310514){var _0x27dab0=this;return function(_0x1447ef){_0x27dab0['updateOriginated'](_0x310514);logger['error'](_0x2b5840,util[_0xca30('0x96')](_0x1447ef,{'showHidden':![],'depth':null}));};};Dialer[_0xca30('0xaa')][_0xca30('0xd4')]=function(_0x334872,_0x48792a,_0x46a01e){var _0x5b752c={'state':0x19,'statedesc':_0xca30('0xd5')};this[_0xca30('0xb6')](_0x48792a);this['saveInDb'](_[_0xca30('0x8c')](_0x5b752c,_[_0xca30('0xd6')](_0x46a01e,[_0xca30('0xd7'),'ListId',_0xca30('0xd8'),_0xca30('0xd9'),'CampaignId'])),'[emptyContact][createHistory]',_0xca30('0xda'));logger['error'](_0x334872);};Dialer[_0xca30('0xaa')]['isSuccess']=function(_0x3fc1fd){return _0x3fc1fd==='Success';};Dialer[_0xca30('0xaa')][_0xca30('0xdb')]=function(_0x3ba914){return!_['isUndefined'](_0x3ba914)&&_0x3ba914&&!_['isUndefined'](_0x3ba914[_0xca30('0x40')])&&!_[_0xca30('0x3d')](_0x3ba914[_0xca30('0x75')])&&_0x3ba914[_0xca30('0x75')]&&(this[_0xca30('0x20')][util[_0xca30('0x78')]('SIP/%s',_0x3ba914[_0xca30('0x40')])]['status']===_0xca30('0xdc')||this[_0xca30('0x20')][util[_0xca30('0x78')](_0xca30('0xdd'),_0x3ba914[_0xca30('0x40')])][_0xca30('0xb2')]===_0xca30('0xde'));};Dialer['prototype'][_0xca30('0xdf')]=function(_0x437955,_0x3ba6af,_0x146b46){this[_0xca30('0xcf')](_0x437955)[_0xca30('0xb4')](loggerCatch(_0x3ba6af));this[_0xca30('0xcd')](_0x437955)[_0xca30('0xb4')](loggerCatch(_0x146b46));};Dialer['prototype'][_0xca30('0x33')]=function(_0x4cae08){var _0x4acfe4=this['uniqueId'][_0x4cae08[_0xca30('0xe0')]];var _0x2fdce8;if(!_[_0xca30('0xb0')](_0x4cae08)&&!_[_0xca30('0xb0')](_0x4cae08[_0xca30('0xe1')])&&!_[_0xca30('0xb0')](_0x4cae08[_0xca30('0xe1')][_0xca30('0xe2')])&&_0x4cae08[_0xca30('0xe3')]===_0xca30('0xe4')&&_0x4acfe4){if(_0x4acfe4[_0xca30('0x4a')]!=='ivr'&&this[_0xca30('0x1d')][_0x4acfe4['queue']]['dialAMDActive']&&_0x4cae08[_0xca30('0xe5')]===_0xca30('0xe6')){delete this[_0xca30('0x23')][_0x4cae08[_0xca30('0xe0')]];this[_0xca30('0xb6')](this[_0xca30('0x1d')][_0x4acfe4[_0xca30('0xb8')]]);this[_0xca30('0x1d')][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0x5d')]+=0x1;this['voiceQueues'][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0x5c')]+=0x1;_0x2fdce8=new Hangup(_0x4acfe4,_0x4cae08);_0x2fdce8[_0xca30('0xa7')]=0x12;_0x2fdce8[_0xca30('0xa8')]=_0xca30('0xe7');_0x2fdce8[_0xca30('0xe8')]=_0xca30('0xe9');ami['emit'](_0xca30('0xea'),ut[_0xca30('0xeb')](_0x2fdce8,_0xca30('0xec')));this[_0xca30('0xdf')](_0x2fdce8,_0xca30('0xed'),_0xca30('0xee'));}if(_0x4acfe4[_0xca30('0x4a')]!==_0xca30('0x7b')&&this['voiceQueues'][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0xef')]&&_0x4cae08[_0xca30('0xe5')]===_0xca30('0xf0')){var _0x3e5fa2=this;return new BPromise(function(_0x2409a2,_0x22592c){delete _0x3e5fa2['uniqueId'][_0x4cae08['uniqueid']];_0x3e5fa2['updateOriginated'](_0x3e5fa2[_0xca30('0x1d')][_0x4acfe4['queue']]);_0x3e5fa2[_0xca30('0x1d')][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0x5d')]+=0x1;_0x3e5fa2['voiceQueues'][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0x5c')]+=0x1;var _0xea3696=_0x3e5fa2[_0xca30('0x1d')][_0x4acfe4[_0xca30('0xb8')]];var _0x24ffc8=new Hangup(_0x4acfe4,_0x4cae08);_0x24ffc8[_0xca30('0xa7')]=0x13;_0x24ffc8[_0xca30('0xa8')]=_0xca30('0xf1');_0x24ffc8[_0xca30('0xe8')]=_0xca30('0xe9');_0x24ffc8[_0xca30('0xf2')]+=0x1;_0x24ffc8['countglobal']+=0x1;_0x24ffc8[_0xca30('0xec')]=!![];ami[_0xca30('0xf3')]('custom:amd',ut[_0xca30('0xeb')](_0x24ffc8,_0xca30('0xec')));_0x3e5fa2['createHistory'](_0x24ffc8)[_0xca30('0xb4')](loggerCatch(_0xca30('0xf4')));if(_0x24ffc8['countbusyretry']+_0x24ffc8[_0xca30('0xf5')]+_0x24ffc8[_0xca30('0xf6')]+_0x24ffc8['countnosuchnumberretry']+_0x24ffc8[_0xca30('0xf7')]+_0x24ffc8[_0xca30('0xf8')]+_0x24ffc8[_0xca30('0xf2')]+_0x24ffc8['countagentrejectretry']>=_0xea3696[_0xca30('0xf9')]){_0x3e5fa2[_0xca30('0xfa')](_0x24ffc8,_0x2409a2,_0x22592c,_0xca30('0xfb'));}else{if(_0x24ffc8[_0xca30('0xf2')]>=_0xea3696[_0xca30('0xfc')]){_0x3e5fa2[_0xca30('0xfd')](_0x24ffc8,_0x2409a2,_0x22592c,_0xca30('0xfe'));}else{_0x3e5fa2[_0xca30('0xc3')]({'active':![],'countmachineretry':_0x24ffc8[_0xca30('0xf2')],'scheduledat':moment()[_0xca30('0xff')](_0xea3696[_0xca30('0x100')],_0xca30('0x101'))[_0xca30('0x78')](_0xca30('0x102')),'ContactId':_0x24ffc8[_0xca30('0xd7')],'ListId':_0x24ffc8[_0xca30('0x103')],'VoiceQueueId':_0x24ffc8[_0xca30('0xd9')]||undefined,'CampaignId':_0x24ffc8['CampaignId']||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x104')));_0x2409a2({'reschedule':0x1});}}});}if(_0x4acfe4[_0xca30('0x4a')]==='ivr'&&this[_0xca30('0x1e')][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0xef')]&&_0x4cae08[_0xca30('0xe5')]==='HANGUP'){delete this['uniqueId'][_0x4cae08[_0xca30('0xe0')]];this[_0xca30('0xb6')](this[_0xca30('0x1e')][_0x4acfe4[_0xca30('0xb8')]]);_0x2fdce8=new Hangup(_0x4acfe4,_0x4cae08);_0x2fdce8[_0xca30('0xa7')]=0x12;_0x2fdce8[_0xca30('0xa8')]=_0xca30('0xe7');_0x2fdce8['membername']=_0xca30('0xe9');ami[_0xca30('0xf3')](_0xca30('0xea'),ut[_0xca30('0xeb')](_0x2fdce8,_0xca30('0xec')));this[_0xca30('0xdf')](_0x2fdce8,_0xca30('0x105'),_0xca30('0x106'));}if(_0x4acfe4['type']===_0xca30('0x7b')&&this[_0xca30('0x1e')][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0xef')]&&_0x4cae08[_0xca30('0xe5')]==='MACHINE'){var _0x3e5fa2=this;return new BPromise(function(_0x13599d,_0x2f6ba3){delete _0x3e5fa2[_0xca30('0x23')][_0x4cae08[_0xca30('0xe0')]];_0x3e5fa2[_0xca30('0xb6')](_0x3e5fa2[_0xca30('0x1e')][_0x4acfe4[_0xca30('0xb8')]]);_0x3e5fa2[_0xca30('0x1e')][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0x5d')]+=0x1;_0x3e5fa2['campaigns'][_0x4acfe4[_0xca30('0xb8')]][_0xca30('0x5c')]+=0x1;var _0x392560=_0x3e5fa2['campaigns'][_0x4acfe4[_0xca30('0xb8')]];var _0x4ed007=new Hangup(_0x4acfe4,_0x4cae08);_0x4ed007['state']=0x13;_0x4ed007['statedesc']='Machine';_0x4ed007[_0xca30('0xe8')]=_0xca30('0xe9');_0x4ed007['countmachineretry']+=0x1;_0x4ed007[_0xca30('0x107')]+=0x1;_0x4ed007[_0xca30('0xec')]=!![];ami[_0xca30('0xf3')](_0xca30('0xea'),ut[_0xca30('0xeb')](_0x4ed007,_0xca30('0xec')));_0x3e5fa2['createHistory'](_0x4ed007)['catch'](loggerCatch(_0xca30('0xf4')));if(_0x4ed007[_0xca30('0x108')]+_0x4ed007['countcongestionretry']+_0x4ed007[_0xca30('0xf6')]+_0x4ed007[_0xca30('0x109')]+_0x4ed007['countdropretry']+_0x4ed007['countabandonedretry']+_0x4ed007['countmachineretry']+_0x4ed007[_0xca30('0x10a')]>=_0x392560[_0xca30('0xf9')]){_0x3e5fa2['stateGlobal'](_0x4ed007,_0x13599d,_0x2f6ba3,_0xca30('0xfb'));}else{if(_0x4ed007['countmachineretry']>=_0x392560['dialMachineMaxRetry']){_0x3e5fa2[_0xca30('0xfd')](_0x4ed007,_0x13599d,_0x2f6ba3,_0xca30('0xfe'));}else{_0x3e5fa2[_0xca30('0xc3')]({'active':![],'countmachineretry':_0x4ed007[_0xca30('0xf2')],'scheduledat':moment()[_0xca30('0xff')](_0x392560['dialMachineRetryFrequency'],_0xca30('0x101'))[_0xca30('0x78')](_0xca30('0x102')),'ContactId':_0x4ed007['ContactId'],'ListId':_0x4ed007[_0xca30('0x103')],'VoiceQueueId':_0x4ed007[_0xca30('0xd9')]||undefined,'CampaignId':_0x4ed007['CampaignId']||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x104')));_0x13599d({'reschedule':0x1});}}});}}};Dialer[_0xca30('0xaa')][_0xca30('0x2f')]=function(_0x32baf2){var _0x282168=this[_0xca30('0x23')][_0x32baf2['uniqueid']];var _0x97fe46=this;var _0x5f3f83;if(_0x282168&&_0x282168['type']===_0xca30('0x7b')){delete this[_0xca30('0x23')][_0x32baf2[_0xca30('0xe0')]];this[_0xca30('0xb6')](this[_0xca30('0x1e')][_0x282168[_0xca30('0xb8')]]);this[_0xca30('0x1e')][_0x282168[_0xca30('0xb8')]][_0xca30('0x10b')]+=0x1;_0x5f3f83=new Hangup(_0x282168,_0x32baf2);this[_0xca30('0xcf')](_0x5f3f83)[_0xca30('0xb4')](loggerCatch(_0xca30('0x10c')));this[_0xca30('0xcd')](_0x5f3f83)[_0xca30('0xb4')](loggerCatch(_0xca30('0x10d')));}if(_0x282168&&_0x282168[_0xca30('0x4a')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x282168[_0xca30('0xb8')]][_0xca30('0x10e')])){delete this[_0xca30('0x23')][_0x32baf2[_0xca30('0xe0')]];this[_0xca30('0xb6')](this[_0xca30('0x1d')][_0x282168[_0xca30('0xb8')]]);this['voiceQueues'][_0x282168[_0xca30('0xb8')]][_0xca30('0x5d')]+=0x1;this[_0xca30('0x1d')][_0x282168[_0xca30('0xb8')]][_0xca30('0x5c')]+=0x1;_0x5f3f83=new Hangup(_0x282168,_0x32baf2);_0x5f3f83[_0xca30('0xa7')]=0x10;_0x5f3f83[_0xca30('0xa8')]='AnswerAGI';_0x5f3f83[_0xca30('0xe8')]=_0xca30('0x10f');this[_0xca30('0xcf')](_0x5f3f83)['catch'](loggerCatch(_0xca30('0x10c')));this['moveContactManagedDialer'](_0x5f3f83)[_0xca30('0xb4')](loggerCatch('[syncHangupIvr]'));}if(_0x282168&&_0x282168['type']!==_0xca30('0x7b')&&!isNotNull(this[_0xca30('0x1d')][_0x282168[_0xca30('0xb8')]]['dialQueueProject'])){delete this[_0xca30('0x23')][_0x32baf2[_0xca30('0xe0')]];this[_0xca30('0xb6')](this[_0xca30('0x1d')][_0x282168['queue']]);this[_0xca30('0x1d')][_0x282168[_0xca30('0xb8')]][_0xca30('0x110')]+=0x1;_0x5f3f83=new Hangup(_0x282168,_0x32baf2);_0x5f3f83['state']=0xc;_0x5f3f83['statedesc']=_0x32baf2['cause-txt'];_0x5f3f83[_0xca30('0xe8')]='Unknow';this[_0xca30('0xcf')](_0x5f3f83)[_0xca30('0xb4')](loggerCatch(_0xca30('0x10c')));this[_0xca30('0xcd')](_0x5f3f83)[_0xca30('0xb4')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xca30('0xaa')][_0xca30('0x2c')]=function(_0xedd011){var _0x410b0=this['uniqueId'][_0xedd011['uniqueid']];var _0x196b5b=this;if(this['voiceQueues'][_0xedd011[_0xca30('0xb8')]]){if(_0x410b0&&_0x410b0[_0xca30('0x4a')]!==_0xca30('0x7b')){delete this[_0xca30('0x23')][_0xedd011['uniqueid']];this[_0xca30('0x1d')][_0xedd011['queue']][_0xca30('0x5d')]+=0x1;var _0x53165a=new AgentComplete(_0x410b0,_0xedd011);if(_0xedd011[_0xca30('0x111')]===_0xca30('0x112')){_0x53165a['agiafterat']=this[_0xca30('0x1d')][_0xedd011[_0xca30('0xb8')]][_0xca30('0x113')]&&this['voiceQueues'][_0xedd011[_0xca30('0xb8')]][_0xca30('0x114')]?moment()['format'](_0xca30('0x102')):undefined;}this['createHistory'](_0x53165a)[_0xca30('0xb4')](loggerCatch(_0xca30('0x115')));this[_0xca30('0xcd')](_0x53165a)[_0xca30('0xb4')](loggerCatch(_0xca30('0x116')));}}};Dialer[_0xca30('0xaa')][_0xca30('0x28')]=function(_0x44b15a){if(this[_0xca30('0x1d')][_0x44b15a[_0xca30('0xb8')]]){if(this['uniqueId'][_0x44b15a[_0xca30('0xe0')]]&&this[_0xca30('0x23')][_0x44b15a[_0xca30('0xe0')]]['type']!==_0xca30('0x7b')){this[_0xca30('0xb6')](this[_0xca30('0x1d')][_0x44b15a[_0xca30('0xb8')]]);this['uniqueId'][_0x44b15a['uniqueid']][_0xca30('0x117')]=moment()[_0xca30('0x78')](_0xca30('0x102'));}}};Dialer[_0xca30('0xaa')][_0xca30('0x118')]=function(_0x4c6224){this[_0xca30('0xcf')](_0x4c6224)[_0xca30('0xb4')](loggerCatch(_0xca30('0x115')));this[_0xca30('0xcd')](_0x4c6224)[_0xca30('0xb4')](loggerCatch(_0xca30('0x119')));};Dialer[_0xca30('0xaa')][_0xca30('0x2a')]=function(_0x31fd31){var _0x8c0a53=this[_0xca30('0x23')][_0x31fd31[_0xca30('0xe0')]];var _0x494f1d=this;if(this['voiceQueues'][_0x31fd31[_0xca30('0xb8')]]){if(_0x8c0a53&&_0x8c0a53[_0xca30('0x4a')]!==_0xca30('0x7b')){delete this[_0xca30('0x23')][_0x31fd31[_0xca30('0xe0')]];this['updateOriginated'](this['voiceQueues'][_0x31fd31[_0xca30('0xb8')]]);_0x8c0a53[_0xca30('0x11a')]=moment()[_0xca30('0x78')](_0xca30('0x102'));var _0x389358=new QueueCallerAbandon(_0x8c0a53,_0x31fd31);if(getSeconds(_0x8c0a53[_0xca30('0x11a')],_0x8c0a53['responsetime'])>=_0x8c0a53[_0xca30('0x11b')]){this[_0xca30('0x1d')][_0x31fd31['queue']][_0xca30('0x69')]+=0x1;this[_0xca30('0x1d')][_0x31fd31[_0xca30('0xb8')]][_0xca30('0x11c')]+=0x1;this[_0xca30('0x1d')][_0x31fd31[_0xca30('0xb8')]][_0xca30('0x6b')]+=0x1;_0x389358[_0xca30('0xa7')]=0xa;_0x389358[_0xca30('0xa8')]=_0xca30('0x11d');_0x389358[_0xca30('0x11e')]='TIMEOUT';_0x389358['agiafterat']=this[_0xca30('0x1d')][_0x31fd31['queue']][_0xca30('0x113')]?moment()['format'](_0xca30('0x102')):undefined;_0x389358[_0xca30('0xf7')]+=0x1;_0x389358['countglobal']+=0x1;if(_0x389358[_0xca30('0xf7')]>=this[_0xca30('0x1d')][_0x31fd31[_0xca30('0xb8')]][_0xca30('0x11f')]){this['queueCallerAbandonCreateState'](_0x389358);}else{this[_0xca30('0xc3')]({'active':![],'countdropretry':_0x389358['countdropretry'],'scheduledat':moment()[_0xca30('0xff')](this['voiceQueues'][_0x31fd31[_0xca30('0xb8')]]['dialDropRetryFrequency'],_0xca30('0x101'))[_0xca30('0x78')](_0xca30('0x102')),'ContactId':_0x8c0a53[_0xca30('0xd7')],'ListId':_0x8c0a53[_0xca30('0x103')],'VoiceQueueId':_0x8c0a53[_0xca30('0xd9')]||undefined,'CampaignId':_0x8c0a53[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x121')));var _0x1f4599=new History(_0x389358);_0x1f4599[_0xca30('0xa7')]=0xa;_0x1f4599[_0xca30('0xa8')]=_0xca30('0x11d');_0x1f4599[_0xca30('0x122')]=moment()[_0xca30('0x78')](_0xca30('0x102'));_0x1f4599[_0xca30('0xa9')]=_0x1f4599['starttime'];_0x1f4599['calleridname']=_0x389358[_0xca30('0x123')];_0x1f4599[_0xca30('0x124')]=_0x389358[_0xca30('0x124')];this[_0xca30('0xcf')](_0x1f4599)['catch'](loggerCatch(_0xca30('0x125')));}}else{this['voiceQueues'][_0x31fd31[_0xca30('0xb8')]][_0xca30('0x126')]+=0x1;this[_0xca30('0x1d')][_0x31fd31[_0xca30('0xb8')]][_0xca30('0x61')]+=0x1;_0x389358['state']=0xb;_0x389358[_0xca30('0xa8')]='Abandoned';_0x389358['dropreason']='CALLEREXIT';_0x389358[_0xca30('0xf8')]+=0x1;_0x389358['countglobal']+=0x1;if(_0x389358[_0xca30('0xf8')]>=this[_0xca30('0x1d')][_0x31fd31['queue']][_0xca30('0x127')]){this[_0xca30('0x118')](_0x389358);}else{this[_0xca30('0xc3')]({'active':![],'countabandonedretry':_0x389358[_0xca30('0xf8')],'scheduledat':moment()[_0xca30('0xff')](this['voiceQueues'][_0x31fd31['queue']][_0xca30('0x128')],_0xca30('0x101'))['format'](_0xca30('0x102')),'ContactId':_0x8c0a53[_0xca30('0xd7')],'ListId':_0x8c0a53[_0xca30('0x103')],'VoiceQueueId':_0x8c0a53[_0xca30('0xd9')]||undefined,'CampaignId':_0x8c0a53[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x129')));var _0x1f4599=new History(_0x389358);_0x1f4599[_0xca30('0xa7')]=0xb;_0x1f4599[_0xca30('0xa8')]=_0xca30('0x12a');_0x1f4599[_0xca30('0x122')]=moment()['format'](_0xca30('0x102'));_0x1f4599[_0xca30('0xa9')]=_0x1f4599[_0xca30('0x122')];_0x1f4599[_0xca30('0x123')]=_0x389358['calleridname'];_0x1f4599[_0xca30('0x124')]=_0x389358[_0xca30('0x124')];this[_0xca30('0xcf')](_0x1f4599)[_0xca30('0xb4')](loggerCatch(_0xca30('0x12b')));}}}}};Dialer[_0xca30('0xaa')][_0xca30('0x31')]=function(_0x21a42e){if(this[_0xca30('0xad')][_0x21a42e['uniqueid']]){this[_0xca30('0xad')][_0x21a42e['uniqueid']][_0xca30('0xb3')]=_0x21a42e[_0xca30('0xb3')];}if(this[_0xca30('0x23')][_0x21a42e['uniqueid']]){this[_0xca30('0x23')][_0x21a42e['uniqueid']][_0xca30('0xb3')]=_0x21a42e[_0xca30('0xb3')];}};Dialer[_0xca30('0xaa')][_0xca30('0x35')]=function(_0x5ac2a1){if(strategy[this['voiceQueues'][this['actions'][_0x5ac2a1[_0xca30('0x12c')]]['queue']][_0xca30('0x4c')]]===_0xca30('0x18')){if(this[_0xca30('0xad')][_0x5ac2a1[_0xca30('0x12c')]]&&_['isNil'](this[_0xca30('0xad')][_0x5ac2a1[_0xca30('0x12c')]]['locked'])&&_0x5ac2a1[_0xca30('0xb2')]==='1'&&_0x5ac2a1['paused']==='0'){if(this['agents'][_0x5ac2a1[_0xca30('0x12d')]]){if(!this[_0xca30('0x1f')][_0x5ac2a1[_0xca30('0x12d')]][_0xca30('0x12e')]){this[_0xca30('0x1f')][_0x5ac2a1[_0xca30('0x12d')]][_0xca30('0x12e')]=!![];this['actions'][_0x5ac2a1[_0xca30('0x12c')]]['locked']=!![];this[_0xca30('0xad')][_0x5ac2a1[_0xca30('0x12c')]]['stateinterface']=_0x5ac2a1['stateinterface'];}}}}else if((strategy[this[_0xca30('0x1d')][this['actions'][_0x5ac2a1['actionid']]['queue']][_0xca30('0x4c')]]||_0xca30('0x12f'))===_0xca30('0x12f')){if(this[_0xca30('0xad')][_0x5ac2a1[_0xca30('0x12c')]]){if(this[_0xca30('0x1f')][_0x5ac2a1[_0xca30('0x12d')]]){this[_0xca30('0xad')][_0x5ac2a1[_0xca30('0x12c')]][_0xca30('0x12d')]=_0x5ac2a1[_0xca30('0x12d')];if(_[_0xca30('0xb0')](this[_0xca30('0x26')][this[_0xca30('0xad')][_0x5ac2a1[_0xca30('0x12c')]][_0xca30('0xb8')]])){this[_0xca30('0x26')][this['actions'][_0x5ac2a1['actionid']][_0xca30('0xb8')]]=[];}this[_0xca30('0x26')][this[_0xca30('0xad')][_0x5ac2a1['actionid']][_0xca30('0xb8')]][_0xca30('0x130')](_[_0xca30('0x8c')](_[_0xca30('0xd6')](this[_0xca30('0xad')][_0x5ac2a1['actionid']],[_0xca30('0x131'),_0xca30('0x12d')]),{'status':_0x5ac2a1[_0xca30('0xb2')],'paused':_0x5ac2a1[_0xca30('0x132')]}));}}}};function unlockQueueStatus(_0x5ced46,_0x2eac5c){setTimeout(function(){if(_['isUndefined'](_0x5ced46['queueStatusComplete'])){loggerBooked[_0xca30('0x95')]('[unlockQueueStatus][undefined]',_0x2eac5c);}_0x5ced46[_0xca30('0x133')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x2eac5c,JSON[_0xca30('0x47')](_['pick'](_0x5ced46,[_0xca30('0x40'),_0xca30('0x133')])));},0x1f3);}Dialer[_0xca30('0xaa')][_0xca30('0x37')]=function(_0x378363){var _0xc60336=this;var _0x5678f6=_0xc60336[_0xca30('0x1d')][_0xc60336['actions'][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]];if(strategy[this['voiceQueues'][this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]][_0xca30('0x4c')]]===_0xca30('0x18')){if(this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]]&&this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0x12d')]){this[_0xca30('0x1c')][_0xca30('0x134')](this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0x131')],this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]]['stateinterface'])['catch'](function(_0x530eda){logger[_0xca30('0x95')](_0xca30('0x135'),util[_0xca30('0x96')](_0x530eda,{'showHidden':![],'depth':null}));})['finally'](function(){_0xc60336['updateOriginated'](_0xc60336['voiceQueues'][_0xc60336['actions'][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]]);_0xc60336['agents'][_0xc60336[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0x12d')]][_0xca30('0x12e')]=![];delete _0xc60336[_0xca30('0xad')][_0x378363['actionid']];unlockQueueStatus(_0x5678f6);});}else{this[_0xca30('0xb6')](this[_0xca30('0x1d')][this['actions'][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]]);this[_0xca30('0xc3')]({'active':![],'ContactId':this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]]['ContactId'],'ListId':this['actions'][_0x378363[_0xca30('0x12c')]][_0xca30('0x103')],'VoiceQueueId':this[_0xca30('0xad')][_0x378363['actionid']][_0xca30('0xd9')]||undefined,'CampaignId':this['actions'][_0x378363[_0xca30('0x12c')]][_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x136')));delete this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]];unlockQueueStatus(_0x5678f6);}}else if((strategy[this[_0xca30('0x1d')][this[_0xca30('0xad')][_0x378363['actionid']]['queue']][_0xca30('0x4c')]]||_0xca30('0x12f'))===_0xca30('0x12f')){var _0x1ad087;if(this['actions'][_0x378363[_0xca30('0x12c')]]&&!_[_0xca30('0x45')](this[_0xca30('0x26')][this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]])){if(this[_0xca30('0x137')][_0xc60336[_0xca30('0xad')][_0x378363['actionid']][_0xca30('0xb8')]]){this[_0xca30('0x137')][_0xc60336[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]]=this[_0xca30('0x137')][this[_0xca30('0xad')][_0x378363['actionid']][_0xca30('0xb8')]]?this[_0xca30('0x137')][this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]]:this['queueBooked'][this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]]['queue']]?this[_0xca30('0x26')][this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]]['_rr']||0x0:0x0;}this[_0xca30('0x26')][this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]][_0xca30('0x138')]=this[_0xca30('0x137')][this[_0xca30('0xad')][_0x378363[_0xca30('0x12c')]][_0xca30('0xb8')]];for(var _0x5bcace=0x0;_0x5bcace=0x0;})[_0xca30('0xb4')](myreject(_0x36aa11)));}}else{_0x3b8973[_0xca30('0x130')](ami['Action']({'action':_0xca30('0x14f'),'command':util[_0xca30('0x78')](_0xca30('0x150'),_0xc5bc94,!_['isUndefined'](config[_0xca30('0x152')][_0x81df68])?_0x81df68:'')})[_0xca30('0x3b')](function(_0x23aad8){return _0x23aad8[_0xca30('0x153')][_0xca30('0x154')](_0xca30('0x155'))>=0x0;})[_0xca30('0xb4')](myreject(_0x36aa11)));}BPromise[_0xca30('0x156')](_0x3b8973)['then'](function(_0x40357f){var _0x16fb94=_[_0xca30('0x157')](_0x40357f);if(_0x16fb94){return _0x3ebdb2(_0x16fb94);}else{_0x3c6a41[_0xca30('0x3e')]=_0x5bec55?_0xca30('0x158'):_0xca30('0x159');return _0x36aa11(msgResponse(_0xca30('0x15a'),_0xca30('0x14b'),_0xca30('0x15b')+_0x5bec55+'\x20'+_0x161a7c+_0xca30('0x15c')+util[_0xca30('0x96')](_0xc5bc94,{'showHidden':![],'depth':null})+_0xca30('0x15d')+_0x81df68));}})['catch'](function(_0x5178e0){return _0x36aa11(msgResponse(_0xca30('0x148'),_0xca30('0x14b'),JSON[_0xca30('0x47')](_0x5178e0)));});});};Dialer[_0xca30('0xaa')]['checkDialMethod']=function(_0x59ac53){var _0x21c5c7=this;return function(){switch(_0x59ac53[_0xca30('0x58')]){case _0xca30('0x15e'):freeVariablesPredictive(_0x59ac53);_0x21c5c7[_0xca30('0x15f')](_0x59ac53,0x1);break;case _0xca30('0x160'):freeVariablesPredictive(_0x59ac53);_0x21c5c7[_0xca30('0x15f')](_0x59ac53,_0x59ac53[_0xca30('0x161')]);break;case _0xca30('0x162'):_0x21c5c7[_0xca30('0x162')](_0x59ac53);break;case'booked':freeVariablesPredictive(_0x59ac53);_0x21c5c7[_0xca30('0x15f')](_0x59ac53,0x1);break;default:freeVariablesPredictive(_0x59ac53);logger['error'](_0xca30('0x163'),_0x59ac53[_0xca30('0x40')],_0xca30('0x164'));}};};Dialer[_0xca30('0xaa')]['checkPreviewRecallReminder']=function(_0x4e4c26){return BPromise['resolve']()[_0xca30('0x3b')](cmHopper[_0xca30('0x165')](_0x4e4c26['id'],previewRecallmeReminderInterval))[_0xca30('0x3b')](function(_0x370e20){for(var _0x32f2c2=0x0;_0x32f2c2<_0x370e20[_0xca30('0x14e')];_0x32f2c2++){var _0x120623=_0x370e20[_0x32f2c2][_0xca30('0x166')]['name'];if(_0x120623)io['to'](util['format'](_0xca30('0x167'),_0x120623))[_0xca30('0xf3')](_0xca30('0x168'),{'hopper':_0x370e20[_0x32f2c2]});}})[_0xca30('0xb4')](function(_0x5dd5a4){});};Dialer[_0xca30('0xaa')][_0xca30('0x169')]=function(_0x12943f){var _0x2e736a=this;return function(){_0x2e736a['handleIvr'](_0x12943f);};};Dialer['prototype'][_0xca30('0x9')]=function(_0x2b7091){var _0x3664f8=this;if(isNotPreview(_0x2b7091[_0xca30('0x58')])){if(isVoiceQueueOutbound(_0x2b7091[_0xca30('0x4a')])&&isActive(_0x2b7091[_0xca30('0x57')])){_0x2b7091[_0xca30('0xa0')]=!![];BPromise['resolve']()[_0xca30('0x3b')](checkIsLoggedIn(_0x2b7091,_0x2b7091[_0xca30('0x16a')]))[_0xca30('0x3b')](checkIsActive(_0x2b7091,_0x2b7091[_0xca30('0x57')]))[_0xca30('0x3b')](checkInterval(_0x2b7091))[_0xca30('0x3b')](_0x3664f8[_0xca30('0x16b')](_0x2b7091))[_0xca30('0x3b')](_0x3664f8[_0xca30('0x146')](_0x2b7091[_0xca30('0x16c')],_0x2b7091[_0xca30('0x16d')],_0x2b7091[_0xca30('0x40')],_0x2b7091))[_0xca30('0x3b')](_0x3664f8[_0xca30('0x147')](_0x2b7091[_0xca30('0x77')],_0x2b7091['dialTimezone'],_0x2b7091[_0xca30('0x40')],_0x2b7091))[_0xca30('0x3b')](_0x3664f8[_0xca30('0x16e')](_0x2b7091))[_0xca30('0xb4')](loggerCatchQueueSummary(_0xca30('0x16f'),_0x2b7091));}else{notSendMessagesQueue(_0x2b7091);}}else{freeVariablesPredictive(_0x2b7091);if(_0x2b7091[_0xca30('0x170')]){_0x3664f8['checkPreviewRecallReminder'](_0x2b7091);}}};Dialer['prototype'][_0xca30('0x142')]=function(){var _0x9c9c02=this;var _0x58c1d6;for(var _0x13266f in this[_0xca30('0x1e')]){if(typeof this[_0xca30('0x1e')][_0x13266f]!==_0xca30('0x98')){_0x58c1d6=this['campaigns'][_0x13266f];if(isCampaignIvr(_0x58c1d6[_0xca30('0x4a')])&&isActive(_0x58c1d6[_0xca30('0x75')])){_0x58c1d6[_0xca30('0xa0')]=!![];BPromise[_0xca30('0xbf')]()['then'](checkIsActive(_0x58c1d6,_0x58c1d6['active']))[_0xca30('0x3b')](checkInterval(_0x58c1d6))[_0xca30('0x3b')](_0x9c9c02[_0xca30('0x16b')](_0x58c1d6))[_0xca30('0x3b')](_0x9c9c02[_0xca30('0x146')](_0x58c1d6[_0xca30('0x16c')],_0x58c1d6['dialTimezone'],_0x58c1d6[_0xca30('0x40')],_0x58c1d6))[_0xca30('0x3b')](_0x9c9c02['checkIfTimeIntervals'](_0x58c1d6[_0xca30('0x77')],_0x58c1d6[_0xca30('0x16d')],_0x58c1d6[_0xca30('0x40')],_0x58c1d6))[_0xca30('0x3b')](_0x9c9c02['launchHandleIvr'](_0x58c1d6))[_0xca30('0xb4')](loggerCatchQueueSummary(_0xca30('0x171'),_0x58c1d6));}else{notSendMessagesCampaign(_0x58c1d6);}}}};function getCallerIdRandom(_0x434e83,_0x42423d){var _0x4b6915;var _0x310fc2;var _0x255926;if(_0x42423d<=0x0){_0x42423d=0x1;}_0x4b6915=new RegExp('\x5cw{0,'+_0x42423d+'}$');_0x310fc2=Math[_0xca30('0x172')](0xa,_0x42423d-0x1);_0x255926=Math[_0xca30('0x172')](0xa,_0x42423d)-0x1;return util[_0xca30('0x78')]('%s',_[_0xca30('0x173')](_0x434e83,_0x4b6915,_[_0xca30('0x174')](_0x310fc2,_0x255926)));}function extractCalleridName(_0x3a1227){var _0xe8eb0a=_0x3a1227['match'](/"(.*?)"/);return _0xe8eb0a?_0xe8eb0a[0x1]:_0x3a1227;}function extractCalleridNumber(_0xb3913c){var _0x61ede5=_0xb3913c[_0xca30('0x175')](/<(.*?)>/);return _0x61ede5?_0x61ede5[0x1]:_0xb3913c;}Dialer[_0xca30('0xaa')][_0xca30('0x176')]=function(_0x3572b6,_0x114bb2){var _0x184b83=this;var _0x1f61e5=uuid['v4']();this[_0xca30('0xad')][_0x1f61e5]=new Action(_0x3572b6,_0x114bb2,_0x1f61e5);return new BPromise(function(_0x5d7e00,_0x18a81b){if(_[_0xca30('0x3d')](_0x3572b6)&&typeof _0x3572b6!==_0xca30('0x177')){return _0x18a81b(msgResponse(_0xca30('0x178'),_0xca30('0x14b'),_0xca30('0x179')));}if(_['isUndefined'](_0x114bb2[_0xca30('0x17a')]['phone'])||_0x114bb2[_0xca30('0x17a')][_0xca30('0x17b')]===null){return _0x18a81b(msgResponse('originate',_0xca30('0x14b'),'contact\x20is\x20undefine'));}var _0xec09bc={'XMD-CALLERID':_0x184b83['actions'][_0x1f61e5][_0xca30('0x17c')](),'XMD-AGI':_0x3572b6['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x3572b6[_0xca30('0x10e')]):_0xca30('0x17d'),'XMD-AGIAFTER':_0x3572b6[_0xca30('0x113')]?util[_0xca30('0x78')](_0xca30('0x17e'),ipAgi,_0x3572b6[_0xca30('0x113')]):'NONE','XMD-QUEUE':_0x3572b6[_0xca30('0x4a')]===_0xca30('0x4b')?util[_0xca30('0x78')](_0xca30('0x17f'),_0x3572b6[_0xca30('0x40')],_0x3572b6['dialQueueOptions']||'',_0x3572b6[_0xca30('0x114')]?'c':'',_0x3572b6['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x114bb2[_0xca30('0xd7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x184b83['actions'][_0x1f61e5][_0xca30('0x17c')](),'XMD-AMD':_0x3572b6[_0xca30('0xef')]?_0xca30('0x180'):_0xca30('0x17d'),'XMD-DESTINATION':_0xca30('0xe4')};if(_0x3572b6['dialAMDActive']){_0xec09bc[_0xca30('0x181')]=_0x3572b6[_0xca30('0x182')]||0x9c4;_0xec09bc[_0xca30('0x183')]=_0x3572b6[_0xca30('0x184')]||0x5dc;_0xec09bc[_0xca30('0x185')]=_0x3572b6[_0xca30('0x186')]||0x320;_0xec09bc['XMD-AMDTOTALANALYSISTIME']=_0x3572b6[_0xca30('0x187')]||0x1388;_0xec09bc[_0xca30('0x188')]=_0x3572b6['dialAMDMinWordLength']||0x64;_0xec09bc['XMD-AMDBETWEENWORDSSILENCE']=_0x3572b6['dialAMDBetweenWordsSilence']||0x32;_0xec09bc[_0xca30('0x189')]=_0x3572b6['dialAMDMaximumNumberOfWords']||0x3;_0xec09bc[_0xca30('0x18a')]=_0x3572b6[_0xca30('0x18b')]||0x100;_0xec09bc[_0xca30('0x18c')]=_0x3572b6[_0xca30('0x18d')]||0x1388;}if(_0x3572b6[_0xca30('0x4a')]===_0xca30('0x4b')){_0xec09bc['XMD-VOICEQUEUEID']=_0x114bb2[_0xca30('0xd9')];}else{_0xec09bc[_0xca30('0x18e')]=_0x114bb2[_0xca30('0x120')];}for(var _0x1b907c in _0x114bb2['Contact']){if(typeof _0x114bb2[_0xca30('0x17a')][_0x1b907c]!==_0xca30('0x98')){if(isNotNull(_0x114bb2[_0xca30('0x17a')][_0x1b907c])&&_0x1b907c!=='id'&&_0x1b907c!==_0xca30('0x18f')&&_0x1b907c!==_0xca30('0x190')&&_0x1b907c!==_0xca30('0x191')){_0xec09bc[util[_0xca30('0x78')](_0xca30('0x192'),'XMD-',_[_0xca30('0x193')](_0x1b907c))]=_0x114bb2['Contact'][_0x1b907c];}}}var _0x187670=_0x184b83['isTrunkReachable'](_0x3572b6[_0xca30('0x74')])?getCallerId(_0x3572b6[_0xca30('0x74')][_0xca30('0x76')],_0x3572b6[_0xca30('0x194')],_0x3572b6['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x3572b6[_0xca30('0x59')],_0x3572b6[_0xca30('0x195')]):_0x3572b6[_0xca30('0x59')]):getCallerId(_['isNil'](_0x3572b6[_0xca30('0x143')])?_0x3572b6[_0xca30('0x74')][_0xca30('0x76')]:_0x3572b6[_0xca30('0x143')]['callerid'],_0x3572b6['dialOriginateCallerIdName'],_0x3572b6[_0xca30('0x195')]>0x0?getCallerIdRandom(_0x3572b6[_0xca30('0x59')],_0x3572b6['dialRandomLastDigitCallerIdNumber']):_0x3572b6[_0xca30('0x59')]);if(_0x187670){_0xec09bc[_0xca30('0x196')]=_0x184b83[_0xca30('0xad')][_0x1f61e5][_0xca30('0x197')]=extractCalleridName(_0x187670);_0xec09bc[_0xca30('0x198')]=_0x184b83[_0xca30('0xad')][_0x1f61e5][_0xca30('0x199')]=extractCalleridNumber(_0x187670);}return ami[_0xca30('0xb1')]({'actionid':_0x1f61e5,'action':_0xca30('0x178'),'channel':_0x184b83[_0xca30('0xdb')](_0x3572b6[_0xca30('0x74')])?util[_0xca30('0x78')](_0xca30('0x19a'),_0x3572b6['Trunk']['name'],isNotNull(_0x3572b6[_0xca30('0x5b')])?_0x3572b6['dialPrefix']['trim']()||'':'',_0x3572b6['dialCutDigit']>0x0?_0x114bb2['Contact'][_0xca30('0x17b')][_0xca30('0x19b')](_0x3572b6[_0xca30('0x19c')]):_0x114bb2[_0xca30('0x17a')][_0xca30('0x17b')]):util[_0xca30('0x78')]('SIP/%s/%s%s',_[_0xca30('0xb0')](_0x3572b6[_0xca30('0x143')])?_0x3572b6[_0xca30('0x74')][_0xca30('0x40')]:_0x3572b6['TrunkBackup'][_0xca30('0x40')],isNotNull(_0x3572b6[_0xca30('0x5b')])?_0x3572b6['dialPrefix'][_0xca30('0x19d')]()||'':'',_0x3572b6[_0xca30('0x19c')]>0x0?_0x114bb2[_0xca30('0x17a')][_0xca30('0x17b')][_0xca30('0x19b')](_0x3572b6['dialCutDigit']):_0x114bb2['Contact'][_0xca30('0x17b')]),'callerid':_0x187670,'Exten':_0xca30('0xe4'),'Context':_0xca30('0x19e'),'Priority':'1','variable':_0xec09bc,'timeout':(_0x3572b6[_0xca30('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1f61e5})[_0xca30('0x3b')](function(_0x3aa4f5){return _0x5d7e00(_0x3aa4f5);})[_0xca30('0xb4')](function(_0x5c0976){_0x3572b6[_0xca30('0x64')]+=0x1;var _0x4b7631=new History(_0x184b83[_0xca30('0xad')][_0x1f61e5]);logger[_0xca30('0x95')](util[_0xca30('0x78')](_0xca30('0x19f'),JSON[_0xca30('0x47')](_0x5c0976)));_0x4b7631[_0xca30('0xa7')]=0xe;_0x4b7631[_0xca30('0xa8')]=_0xca30('0x1a0');_0x4b7631['starttime']=moment()['format'](_0xca30('0x102'));_0x4b7631[_0xca30('0xa9')]=_0x4b7631['starttime'];_0x184b83[_0xca30('0xcf')](_0x4b7631)['catch'](loggerCatch('[originate][error]'));_0x184b83[_0xca30('0xcd')](_0x4b7631)[_0xca30('0xb4')](loggerCatch(_0xca30('0x1a1')))[_0xca30('0x1a')](function(){delete _0x184b83['actions'][_0x1f61e5];return _0x18a81b(msgResponse('originate',_0xca30('0x1a2'),'originate\x20action\x20Error'));});});});};Dialer[_0xca30('0xaa')][_0xca30('0x1a3')]=function(_0x38173d){var _0x2ca50a=this[_0xca30('0xad')][_0x38173d['actionid']];if(_0x2ca50a){delete this['actions'][_0x38173d[_0xca30('0x12c')]];_0x2ca50a[_0xca30('0x1a4')]=moment()[_0xca30('0x78')](_0xca30('0x102'));var _0x6a85de=_0x2ca50a[_0xca30('0x4a')]===_0xca30('0x7b')?this['campaigns'][_0x2ca50a[_0xca30('0xb8')]]:this[_0xca30('0x1d')][_0x2ca50a[_0xca30('0x1a5')]()];if(!this[_0xca30('0x1a6')](_0x38173d[_0xca30('0x1a7')])){this[_0xca30('0xb6')](_0x6a85de);return this[_0xca30('0x1a8')](_0x2ca50a,_0x6a85de,_0x38173d)['catch'](loggerCatch(_0xca30('0x1a9')));}this['uniqueId'][_0x38173d[_0xca30('0xe0')]]=_0x2ca50a;}};Dialer[_0xca30('0xaa')]['checkRetriveMax']=function(_0x47a30c,_0x5aed7f,_0x36a0f5){var _0x1a9c48=new History(_0x5aed7f);if(_0x1a9c48[_0xca30('0x108')]+_0x1a9c48['countcongestionretry']+_0x1a9c48[_0xca30('0xf6')]+_0x1a9c48[_0xca30('0x109')]+_0x1a9c48['countdropretry']+_0x1a9c48[_0xca30('0xf8')]+_0x1a9c48['countmachineretry']+_0x1a9c48[_0xca30('0x10a')]>=_0x36a0f5[_0xca30('0xf9')]-0x1){return!![];}switch(_0x47a30c){case 0x3:if(_0x1a9c48[_0xca30('0xf6')]>=_0x36a0f5[_0xca30('0x1aa')]-0x1){return!![];}this[_0xca30('0xc3')]({'active':![],'countnoanswerretry':_0x1a9c48['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xca30('0xff')](_0x36a0f5[_0xca30('0x1ab')],_0xca30('0x101'))[_0xca30('0x78')](_0xca30('0x102')),'ContactId':_0x1a9c48[_0xca30('0xd7')],'ListId':_0x1a9c48['ListId'],'VoiceQueueId':_0x1a9c48[_0xca30('0xd9')]||undefined,'CampaignId':_0x1a9c48[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x1ac')));break;case 0x5:if(_0x1a9c48[_0xca30('0x108')]>=_0x36a0f5[_0xca30('0x1ad')]-0x1){return!![];}this[_0xca30('0xc3')]({'active':![],'countbusyretry':_0x1a9c48[_0xca30('0x108')]+=0x1,'scheduledat':moment()['add'](_0x36a0f5[_0xca30('0x1ae')],_0xca30('0x101'))[_0xca30('0x78')](_0xca30('0x102')),'ContactId':_0x1a9c48[_0xca30('0xd7')],'ListId':_0x1a9c48[_0xca30('0x103')],'VoiceQueueId':_0x1a9c48[_0xca30('0xd9')]||undefined,'CampaignId':_0x1a9c48['CampaignId']||undefined})[_0xca30('0xb4')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1a9c48[_0xca30('0xf5')]>=_0x36a0f5['dialCongestionMaxRetry']-0x1){return!![];}this[_0xca30('0xc3')]({'active':![],'countcongestionretry':_0x1a9c48['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x36a0f5['dialCongestionRetryFrequency'],_0xca30('0x101'))['format'](_0xca30('0x102')),'ContactId':_0x1a9c48[_0xca30('0xd7')],'ListId':_0x1a9c48[_0xca30('0x103')],'VoiceQueueId':_0x1a9c48[_0xca30('0xd9')]||undefined,'CampaignId':_0x1a9c48[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x1af')));break;case 0x0:if(_0x1a9c48['countnosuchnumberretry']>=_0x36a0f5[_0xca30('0x1b0')]-0x1){return!![];}else{this[_0xca30('0xc3')]({'active':![],'countnosuchnumberretry':_0x1a9c48[_0xca30('0x109')]+=0x1,'scheduledat':moment()[_0xca30('0xff')](_0x36a0f5[_0xca30('0x1b1')],'minutes')['format'](_0xca30('0x102')),'ContactId':_0x1a9c48[_0xca30('0xd7')],'ListId':_0x1a9c48[_0xca30('0x103')],'VoiceQueueId':_0x1a9c48[_0xca30('0xd9')]||undefined,'CampaignId':_0x1a9c48['CampaignId']||undefined})[_0xca30('0xb4')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1a9c48[_0xca30('0xf7')]>=_0x36a0f5['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x1a9c48[_0xca30('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x36a0f5[_0xca30('0x1b2')],_0xca30('0x101'))['format'](_0xca30('0x102')),'ContactId':_0x1a9c48['ContactId'],'ListId':_0x1a9c48[_0xca30('0x103')],'VoiceQueueId':_0x1a9c48[_0xca30('0xd9')]||undefined,'CampaignId':_0x1a9c48[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x1a9c48[_0xca30('0xf8')]>=_0x36a0f5[_0xca30('0x127')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x1a9c48[_0xca30('0xf8')]+=0x1,'scheduledat':moment()[_0xca30('0xff')](_0x36a0f5[_0xca30('0x128')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a9c48[_0xca30('0xd7')],'ListId':_0x1a9c48[_0xca30('0x103')],'VoiceQueueId':_0x1a9c48['VoiceQueueId']||undefined,'CampaignId':_0x1a9c48[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1a9c48[_0xca30('0xf2')]>=_0x36a0f5['dialMachineMaxRetry']-0x1){return!![];}this[_0xca30('0xc3')]({'active':![],'countmachineretry':_0x1a9c48[_0xca30('0xf2')]+=0x1,'scheduledat':moment()[_0xca30('0xff')](_0x36a0f5[_0xca30('0x100')],'minutes')[_0xca30('0x78')](_0xca30('0x102')),'ContactId':_0x1a9c48[_0xca30('0xd7')],'ListId':_0x1a9c48[_0xca30('0x103')],'VoiceQueueId':_0x1a9c48['VoiceQueueId']||undefined,'CampaignId':_0x1a9c48[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x104')));break;case 0x14:if(_0x1a9c48[_0xca30('0x10a')]>=_0x36a0f5[_0xca30('0x1b3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x1a9c48[_0xca30('0x10a')]+=0x1,'scheduledat':moment()[_0xca30('0xff')](_0x36a0f5['dialAgentRejectRetryFrequency'],_0xca30('0x101'))[_0xca30('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a9c48['ContactId'],'ListId':_0x1a9c48[_0xca30('0x103')],'VoiceQueueId':_0x1a9c48[_0xca30('0xd9')]||undefined,'CampaignId':_0x1a9c48[_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x1b4')));break;default:return!![];}};Dialer[_0xca30('0xaa')][_0xca30('0x1a8')]=function(_0x4bbc2e,_0x56f884,_0x19af24){var _0x1ea1f2=this;var _0x48452a=new History(_0x4bbc2e);return new BPromise(function(_0x3c0efc,_0x1f5f74){if(_[_0xca30('0x3d')](_0x56f884)&&typeof _0x56f884!==_0xca30('0x177')){return _0x1f5f74(msgResponse('[callProgressDetecting]',_0xca30('0x14b'),_0xca30('0x1b5')));}if(_['isUndefined'](_0x19af24)&&typeof _0x19af24!=='object'){return _0x1f5f74(msgResponse(_0xca30('0x1b6'),_0xca30('0x14b'),_0xca30('0x1b7')));}switch(_0x19af24['reason']){case'0':_0x56f884[_0xca30('0x63')]+=0x1;_0x48452a['state']=0x0;_0x48452a[_0xca30('0xa8')]=_0xca30('0x1b8');_0x48452a[_0xca30('0x109')]+=0x1;_0x48452a['countglobal']+=0x1;ami[_0xca30('0xf3')](_0xca30('0x1b9'),ut[_0xca30('0xeb')](_0x4bbc2e,_0xca30('0x1ba')));_0x1ea1f2[_0xca30('0xcf')](_0x48452a)[_0xca30('0xb4')](loggerCatch(_0xca30('0xf4')));if(_0x1ea1f2[_0xca30('0x1bb')](0x0,_0x4bbc2e,_0x56f884)){if(_0x48452a['countnosuchnumberretry']>=_0x56f884[_0xca30('0x1b0')]){_0x1ea1f2[_0xca30('0xfd')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1bc'));}else{_0x1ea1f2[_0xca30('0xfa')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1bc'));}}break;case'3':_0x56f884[_0xca30('0x62')]+=0x1;_0x48452a[_0xca30('0xa7')]=0x3;_0x48452a['statedesc']=_0xca30('0x1bd');_0x48452a['countnoanswerretry']+=0x1;_0x48452a[_0xca30('0x107')]+=0x1;ami[_0xca30('0xf3')](_0xca30('0x1be'),ut['buildObj'](_0x4bbc2e,_0xca30('0x1bf')));_0x1ea1f2[_0xca30('0xcf')](_0x48452a)['catch'](loggerCatch(_0xca30('0x1c0')));if(_0x1ea1f2['checkRetriveMax'](0x3,_0x4bbc2e,_0x56f884)){if(_0x48452a[_0xca30('0xf6')]>=_0x56f884[_0xca30('0x1aa')]){_0x1ea1f2[_0xca30('0xfd')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1c1'));}else{_0x1ea1f2[_0xca30('0xfa')](_0x48452a,_0x3c0efc,_0x1f5f74,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x56f884['outboundBusyCallsDay']+=0x1;_0x48452a[_0xca30('0xa7')]=0x5;_0x48452a[_0xca30('0xa8')]='Busy';_0x48452a[_0xca30('0x108')]+=0x1;_0x48452a['countglobal']+=0x1;ami[_0xca30('0xf3')]('custom:agentbusy',ut[_0xca30('0xeb')](_0x4bbc2e,_0xca30('0x1c2')));_0x1ea1f2[_0xca30('0xcf')](_0x48452a)[_0xca30('0xb4')](loggerCatch(_0xca30('0x1c3')));if(_0x1ea1f2['checkRetriveMax'](0x5,_0x4bbc2e,_0x56f884)){if(_0x48452a[_0xca30('0x108')]>=_0x56f884[_0xca30('0x1ad')]){_0x1ea1f2[_0xca30('0xfd')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1c4'));}else{_0x1ea1f2[_0xca30('0xfa')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1c4'));}}break;case'8':_0x56f884['outboundCongestionCallsDay']+=0x1;_0x48452a['state']=0x8;_0x48452a[_0xca30('0xa8')]=_0xca30('0x1c5');_0x48452a[_0xca30('0xf5')]+=0x1;_0x48452a['countglobal']+=0x1;ami[_0xca30('0xf3')](_0xca30('0x1c6'),ut[_0xca30('0xeb')](_0x4bbc2e,'congestion'));_0x1ea1f2[_0xca30('0xcf')](_0x48452a)[_0xca30('0xb4')](loggerCatch(_0xca30('0x1c7')));if(_0x1ea1f2[_0xca30('0x1bb')](0x8,_0x4bbc2e,_0x56f884)){if(_0x48452a[_0xca30('0xf5')]>=_0x56f884[_0xca30('0x1c8')]){_0x1ea1f2[_0xca30('0xfd')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1c9'));}else{_0x1ea1f2[_0xca30('0xfa')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1c9'));}}break;case'11':_0x56f884['outboundAbandonedCallsDay']+=0x1;_0x48452a[_0xca30('0xa7')]=0xb;_0x48452a[_0xca30('0xa8')]='Abandoned';_0x48452a[_0xca30('0xf8')]+=0x1;_0x48452a[_0xca30('0x107')]+=0x1;_0x1ea1f2[_0xca30('0xcf')](_0x48452a)['catch'](loggerCatch(_0xca30('0x12b')));if(_0x1ea1f2[_0xca30('0x1bb')](0xb,_0x4bbc2e,_0x56f884)){if(_0x48452a[_0xca30('0xf8')]>=_0x56f884[_0xca30('0x127')]){_0x1ea1f2[_0xca30('0xfd')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1ca'));}else{_0x1ea1f2[_0xca30('0xfa')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1ca'));}}break;case'20':_0x56f884[_0xca30('0x66')]+=0x1;_0x48452a[_0xca30('0xa7')]=0x14;_0x48452a[_0xca30('0xa8')]=_0xca30('0x1cb');_0x48452a[_0xca30('0x10a')]+=0x1;_0x48452a[_0xca30('0x107')]+=0x1;ami[_0xca30('0xf3')](_0xca30('0x1cc'),ut[_0xca30('0xeb')](_0x4bbc2e,'agentreject'));_0x1ea1f2['createHistory'](_0x48452a)[_0xca30('0xb4')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1ea1f2[_0xca30('0x1bb')](0x14,_0x4bbc2e,_0x56f884)){if(_0x48452a[_0xca30('0x10a')]>=_0x56f884[_0xca30('0x1b3')]){_0x1ea1f2['createStateFinal'](_0x48452a,_0x3c0efc,_0x1f5f74,'reason\x2020\x20agentreject');}else{_0x1ea1f2[_0xca30('0xfa')](_0x48452a,_0x3c0efc,_0x1f5f74,_0xca30('0x1cd'));}}break;default:_0x56f884['outboundUnknownCallsDay']+=0x1;_0x48452a[_0xca30('0xa7')]=0xc;_0x48452a[_0xca30('0xa8')]=_0x19af24['reason'];_0x1ea1f2[_0xca30('0xcf')](_0x48452a)[_0xca30('0xb4')](loggerCatch(_0xca30('0x1ce')));if(_0x1ea1f2[_0xca30('0x1bb')](_0x19af24[_0xca30('0x111')],_0x4bbc2e,_0x56f884)){if(_0x48452a[_0xca30('0x108')]+_0x48452a[_0xca30('0xf5')]+_0x48452a[_0xca30('0xf6')]+_0x48452a['countnosuchnumberretry']+_0x48452a[_0xca30('0xf7')]+_0x48452a['countabandonedretry']+_0x48452a[_0xca30('0xf2')]+_0x48452a['countagentrejectretry']>=_0x56f884['dialGlobalMaxRetry']){_0x1ea1f2[_0xca30('0xfa')](_0x48452a,_0x3c0efc,_0x1f5f74,_0x19af24[_0xca30('0x111')]);}else{_0x1ea1f2[_0xca30('0xfd')](_0x48452a,_0x3c0efc,_0x1f5f74,_0x19af24[_0xca30('0x111')]);}}}});};Dialer[_0xca30('0xaa')][_0xca30('0xfa')]=function(_0x17847b,_0x1d6527,_0x3b0e3c,_0x375189){var _0x42a46f=new Final(_0x17847b);_0x42a46f['state']=0xf;_0x42a46f['statedesc']=_0xca30('0x1cf');this[_0xca30('0xfd')](_0x42a46f,_0x1d6527,_0x3b0e3c,_0x375189);};Dialer[_0xca30('0xaa')][_0xca30('0xfd')]=function(_0x22aeea,_0x195211,_0xa06e1d,_0x3ea025){this[_0xca30('0xcd')](_0x22aeea)[_0xca30('0x3b')](function(){return _0x195211(msgResponse(_0xca30('0x1b6'),_0xca30('0x1d0'),_0x3ea025));})[_0xca30('0xb4')](function(){return _0xa06e1d(msgResponse(_0xca30('0x1d1'),_0xca30('0x14b'),_0xca30('0x1d2')));});};Dialer[_0xca30('0xaa')][_0xca30('0x162')]=function(_0x18084e){var _0x444155=_0x18084e['dialPredictiveOptimizationPercentage']/0x64;var _0x441084=_0x18084e['outboundDropCallsDayTimeout']/(_0x18084e[_0xca30('0x11c')]+_0x18084e[_0xca30('0x5d')]);var _0x5d3f92=Math['round'](_0x18084e['predictiveIntervalAvailable']*(_0x18084e[_0xca30('0x1d3')]/0x64));var _0x9fc0b2=Math['round'](_0x18084e[_0xca30('0x1d4')]*(_0x18084e[_0xca30('0x1d5')]/0x64));var _0x483d9a=_0x18084e[_0xca30('0x4e')]+_0x18084e[_0xca30('0x52')];var _0x2e04b5=Math['floor'](_0x18084e[_0xca30('0x70')]*_0x18084e[_0xca30('0x8b')]*_0x18084e[_0xca30('0x1d6')]*_0x18084e['predictiveIntervalMultiplicativeFactor']);if(_[_0xca30('0x3d')](_0x18084e[_0xca30('0x25')])){if(!_['isUndefined'](_0x18084e[_0xca30('0x73')])){_0x18084e[_0xca30('0x73')]=undefined;loggerPredictive[_0xca30('0x95')](_0xca30('0x1d7'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xca30('0x3d')](_0x18084e[_0xca30('0x90')])){loggerPredictive['error'](_0xca30('0x1d7'),_0xca30('0x1d8'));clearInterval(_0x18084e['handlePredictive']);_0x18084e[_0xca30('0x90')]=undefined;}_0x18084e['startProgressive']=moment()[_0xca30('0x78')](_0xca30('0x102'));loggerPredictive[_0xca30('0x7d')](_0x18084e[_0xca30('0x40')],_0xca30('0x1d9'),_0x18084e[_0xca30('0x25')]);this[_0xca30('0x15f')](_0x18084e,0x1);}else if(ifInterval(_0x18084e['dialPredictiveInterval'],_0x18084e[_0xca30('0x25')])){this[_0xca30('0x15f')](_0x18084e,0x1);loggerPredictiveCalls[_0xca30('0x7d')]('[startMethodPredictive][StartProgressive][Loop]',_0x18084e[_0xca30('0x25')],_0x18084e[_0xca30('0x40')]);_0x18084e['erlangCalls']=0x0;_0x18084e['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x444155<_0x441084&&_0x18084e[_0xca30('0x1da')]===_0xca30('0x1db')){freeVariablesPredictive(_0x18084e);loggerPredictive[_0xca30('0x7d')](_0xca30('0x1dc'),_0xca30('0x1dd'),_0x441084,_0xca30('0x25'),_0x18084e[_0xca30('0x40')]);}else if(_0x2e04b5<_0x18084e[_0xca30('0x6b')]&&_0x18084e[_0xca30('0x1da')]===_0xca30('0x1db')){freeVariablesPredictive(_0x18084e);loggerPredictive[_0xca30('0x7d')](_0xca30('0x1de'),_0xca30('0x1df'),_0x2e04b5,_0xca30('0x1e0'),_0x18084e[_0xca30('0x6b')],_0xca30('0x25'),_0x18084e['name']);}else if(!ifInterval(_0x18084e[_0xca30('0x1e1')],_0x18084e[_0xca30('0x25')])&&_[_0xca30('0x3d')](_0x18084e[_0xca30('0x73')])&&!_[_0xca30('0x3d')](_0x18084e[_0xca30('0x25')])){_0x18084e[_0xca30('0x73')]=moment()['format'](_0xca30('0x102'));loggerPredictive['info'](_0x18084e[_0xca30('0x40')],'started\x20in\x20predictive\x20at',_0x18084e[_0xca30('0x73')]);this[_0xca30('0xc1')](_0x18084e[_0xca30('0x1e1')])[_0xca30('0x3b')](this[_0xca30('0x1e2')](_0x18084e))[_0xca30('0x3b')](mergeDataErlangB(_0x18084e))['then'](this[_0xca30('0x1e3')](_0x18084e))[_0xca30('0xb4')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x18084e));}else if(!ifInterval(_0x18084e['dialPredictiveInterval'],_0x18084e['startPredictive'])){_0x18084e[_0xca30('0x6b')]=0x0;_0x18084e['startPredictive']=moment()[_0xca30('0x78')](_0xca30('0x102'));loggerPredictive[_0xca30('0x7d')](_0x18084e[_0xca30('0x40')],'recalculate\x20predictive\x20at',_0x18084e[_0xca30('0x73')]);clearInterval(_0x18084e['handlePredictive']);_0x18084e[_0xca30('0x90')]=undefined;this[_0xca30('0xc1')](_0x18084e[_0xca30('0x1e1')])[_0xca30('0x3b')](this[_0xca30('0x1e2')](_0x18084e))[_0xca30('0x3b')](mergeDataErlangB(_0x18084e))[_0xca30('0x3b')](this[_0xca30('0x1e3')](_0x18084e))[_0xca30('0xb4')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x18084e));}else if(_0x18084e[_0xca30('0x1d4')]&&_0x483d9a<_0x18084e[_0xca30('0x1d4')]-_0x9fc0b2){freeVariablesPredictive(_0x18084e);loggerPredictive[_0xca30('0x7d')](_0x18084e['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x483d9a,_0xca30('0x1e4'),_0x18084e['predictiveIntervalAvailable'],'-',_0x9fc0b2,'=',_0x18084e[_0xca30('0x1d4')]-_0x9fc0b2,')');}else if(_0x18084e[_0xca30('0x1d4')]&&_0x483d9a>_0x18084e['predictiveIntervalAvailable']+_0x5d3f92){freeVariablesPredictive(_0x18084e);loggerPredictive['info'](_0x18084e[_0xca30('0x40')],_0xca30('0x1e5'),_0x483d9a,_0xca30('0x1e6'),_0x18084e[_0xca30('0x1d4')],'+',_0x5d3f92,'=',_0x18084e['predictiveIntervalAvailable']+_0x5d3f92,')');}};Dialer[_0xca30('0xaa')]['getDataPredictive']=function(_0x1a1007){var _0x5ceeaf=this;return function(_0x216014){return new BPromise(function(_0x5263de,_0xb8f859){_['merge'](_0x1a1007,_0x216014[0x0]);if(checkGetDataPredictive(_0x216014[0x0])){var _0x25c91a=_0x1a1007['predictiveIntervalAvailable']=_0x1a1007[_0xca30('0x52')]+_0x1a1007['available'];var _0x471101=_0x1a1007[_0xca30('0x1e1')]*0x3c;var _0x36bff2=_0x216014[0x0]['predictiveIntervalAvgTalktime']+_0x216014[0x0][_0xca30('0x67')];var _0x4c2d9e=(_0x216014[0x0][_0xca30('0x1e7')]+_0x216014[0x0][_0xca30('0x69')]+_0x216014[0x0][_0xca30('0x126')])/_0x216014[0x0][_0xca30('0x6e')];_0x1a1007[_0xca30('0x1d6')]=_0x4c2d9e>0x0?_0x4c2d9e:0x1;switch(_0x1a1007[_0xca30('0x1da')]){case _0xca30('0x1db'):var _0x2095f7=_0x1a1007[_0xca30('0x1e8')]/0x64;return _0x5ceeaf[_0xca30('0x1e9')](_0x25c91a,_0x471101,_0x36bff2,_0x4c2d9e,_0x2095f7)[_0xca30('0x3b')](function(_0x5b1177){return _0x5263de(_0x5b1177);});case'agentBusyFactor':var _0x5e508f=_0x1a1007[_0xca30('0x1e8')]/0x64;return _0x5ceeaf[_0xca30('0x1ea')](_0x25c91a,_0x471101,_0x36bff2,_0x4c2d9e,_0x5e508f)[_0xca30('0x3b')](function(_0x48b131){return _0x5263de(_0x48b131);});default:return _0xb8f859(msgResponse('[getDataPredictive]',_0xca30('0x14b'),_0xca30('0x1eb')));}}else{return _0xb8f859(msgResponse(_0xca30('0x1ec'),_0xca30('0x14b'),_0xca30('0x1ed')));}});};};Dialer[_0xca30('0xaa')]['getDataPredictiveOld']=function(_0x36603c){var _0x142fdd=this;return function(_0x1ea277){return new BPromise(function(_0x540625,_0x57d053){_[_0xca30('0x8c')](_0x36603c,_0x1ea277[0x0]);if(checkGetDataPredictive(_0x1ea277[0x0])){loggerPredictive[_0xca30('0x7d')](JSON[_0xca30('0x47')](_0x1ea277[0x0]));if(_0x36603c['dialPredictiveOptimization']===_0xca30('0x1db')){return _0x142fdd[_0xca30('0x1ee')](_0x36603c['id'])[_0xca30('0x3b')](function(_0x3661ae){var _0x2c9309=_0x36603c[_0xca30('0x16a')]-_0x3661ae[0x0][_0xca30('0x1ef')];var _0x394473=_0x36603c['dialPredictiveInterval']*0x3c;var _0x12ef09=_0x1ea277[0x0][_0xca30('0x68')]+_0x1ea277[0x0]['predictiveIntervalAvgHoldtime'];var _0x143fec=(_0x1ea277[0x0]['predictiveIntervalAnsweredCalls']+_0x1ea277[0x0][_0xca30('0x69')]+_0x1ea277[0x0][_0xca30('0x126')])/_0x1ea277[0x0][_0xca30('0x6e')];var _0x47a3d0=_0x36603c[_0xca30('0x1e8')]/0x64;_0x36603c[_0xca30('0x6d')]=_0x3661ae[0x0]['outboundQueuePauses']||0x0;_0x36603c[_0xca30('0x1d6')]=_0x143fec>0x0?_0x143fec:0x1;return _0x142fdd[_0xca30('0x1e9')](_0x2c9309,_0x394473,_0x12ef09,_0x143fec,_0x47a3d0);})[_0xca30('0x3b')](function(_0x2c59ea){return _0x540625(_0x2c59ea);})['catch'](function(_0xc10691){return _0x57d053(msgResponse(_0xca30('0x1f0'),_0xca30('0x14b'),JSON[_0xca30('0x47')](_0xc10691)));});}if(_0x36603c[_0xca30('0x1da')]===_0xca30('0x1f1')){return _0x142fdd[_0xca30('0x1ee')](_0x36603c['id'])[_0xca30('0x3b')](function(_0x3b25b5){var _0x26b299=_0x36603c[_0xca30('0x16a')]-_0x3b25b5[0x0][_0xca30('0x1ef')];var _0x39c333=_0x36603c[_0xca30('0x1e1')]*0x3c;var _0x1165fc=_0x1ea277[0x0][_0xca30('0x68')]+_0x1ea277[0x0][_0xca30('0x67')];var _0x5b079b=(_0x1ea277[0x0][_0xca30('0x1e7')]+_0x1ea277[0x0][_0xca30('0x69')]+_0x1ea277[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1ea277[0x0]['predictiveIntervalTotalCalls'];var _0x1282fb=_0x36603c[_0xca30('0x1e8')]/0x64;_0x36603c['predictiveIntervalPauses']=_0x3b25b5[0x0][_0xca30('0x1ef')]||0x0;_0x36603c[_0xca30('0x1d6')]=_0x5b079b>0x0?_0x5b079b:0x1;return _0x142fdd['busyFactor'](_0x26b299,_0x39c333,_0x1165fc,_0x5b079b,_0x1282fb);})[_0xca30('0x3b')](function(_0xfd80aa){return _0x540625(_0xfd80aa);})[_0xca30('0xb4')](function(_0x3b898e){return _0x57d053(msgResponse(_0xca30('0x1f0'),'Failure',JSON['stringify'](_0x3b898e)));});}}else{return _0x57d053(msgResponse(_0xca30('0x1ec'),'Failure',_0xca30('0x1ed')));}});};};Dialer[_0xca30('0xaa')][_0xca30('0x1e3')]=function(_0x10e35a){var _0x287890=this;return function(){var _0x6e23ce=0x0;var _0x22faeb=Math['floor'](_0x10e35a[_0xca30('0x71')]*0x3e8);if(_0x22faeb>0x0){_0x22faeb=_0x22faeb<0x64?0x64:_0x22faeb;loggerPredictive[_0xca30('0x7d')](_0x10e35a[_0xca30('0x40')],_0xca30('0x1f2'),_0x22faeb,_0xca30('0x48'));_0x10e35a[_0xca30('0x90')]=setInterval(function(){_0x287890[_0xca30('0x90')](_0x10e35a);loggerPredictiveCalls[_0xca30('0x7d')](_0xca30('0x1f3'),_0x6e23ce+=0x1);},_0x22faeb);}else{loggerPredictive['info'](_0x10e35a['name'],_0xca30('0x1f4'));}};};Dialer[_0xca30('0xaa')][_0xca30('0x1f5')]=function(_0x56446d,_0x4a50c7){var _0x29674e=this;return function(_0x176d68){if(_[_0xca30('0x45')](_0x176d68)){if(_['isNil'](_0x4a50c7['UserId'])||!_0x4a50c7['recallme']){if(_0x56446d[_0xca30('0x58')]===_0xca30('0x8')){_0x56446d[_0xca30('0x133')]=_[_0xca30('0x3d')](_0x56446d[_0xca30('0x133')])?!![]:_0x56446d['queueStatusComplete'];var _0x3f67f7=uuid['v4']();_0x29674e[_0xca30('0xad')][_0x3f67f7]=new Action(_0x56446d,_0x4a50c7,_0x3f67f7);loggerBooked[_0xca30('0x7d')]('[booked][checkContactBlack]',_0x3f67f7,_0xca30('0x1f6'),JSON[_0xca30('0x47')](_0x56446d[_0xca30('0x133')]),_0xca30('0x1f7'),_0x56446d[_0xca30('0x40')]);if(_0x56446d['queueStatusComplete']){_0x56446d['queueStatusComplete']=![];_0x29674e['queueBooked'][_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0xb8')]]=[];ami[_0xca30('0xb1')]({'actionid':_0x3f67f7,'action':_0xca30('0x1f8'),'queue':_0x56446d[_0xca30('0x40')]})[_0xca30('0xb4')](function(){_0x29674e[_0xca30('0xb6')](_0x56446d);_0x29674e[_0xca30('0xc3')]({'active':![],'ContactId':_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0xd7')],'ListId':_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0x103')],'VoiceQueueId':_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0xd9')]||undefined,'CampaignId':_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0x120')]||undefined})['catch'](loggerCatch(_0xca30('0x1f9')));delete _0x29674e[_0xca30('0xad')][_0x3f67f7];});}else{loggerBooked['info'](_0xca30('0x1fa'),JSON[_0xca30('0x47')](_0x56446d[_0xca30('0x133')]),_0xca30('0x1f7'),_0x56446d[_0xca30('0x40')]);_0x29674e[_0xca30('0xb6')](_0x56446d);_0x29674e['rescheduleContact']({'active':![],'ContactId':_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0xd7')],'ListId':_0x29674e[_0xca30('0xad')][_0x3f67f7]['ListId'],'VoiceQueueId':_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0xd9')]||undefined,'CampaignId':_0x29674e[_0xca30('0xad')][_0x3f67f7][_0xca30('0x120')]||undefined})[_0xca30('0xb4')](loggerCatch(_0xca30('0x1f9')));delete _0x29674e['actions'][_0x3f67f7];}}else{return _0x29674e[_0xca30('0x176')](_0x56446d,_0x4a50c7);}}else{if(getDiff(_0x4a50c7['scheduledat'])<_0x56446d[_0xca30('0x1fb')]*0x3c){if(_0x4a50c7[_0xca30('0x166')]&&!_0x4a50c7[_0xca30('0x166')]['voicePause']){_0x29674e[_0xca30('0x1c')][_0xca30('0x134')](_0x4a50c7['id'])[_0xca30('0x1a')](function(){_0x29674e['updateOriginated'](_0x56446d);});}else{_0x29674e[_0xca30('0xc5')]({'active':![]},_0x4a50c7['id'],0x1)['finally'](function(){_0x29674e[_0xca30('0xb6')](_0x56446d);});}}else{_0x56446d[_0xca30('0x65')]+=0x1;_0x29674e[_0xca30('0xb6')](_0x56446d);if(_0x56446d[_0xca30('0x1fc')]){_0x29674e[_0xca30('0xc3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a50c7[_0xca30('0xd7')],'ListId':_0x4a50c7[_0xca30('0x103')],'VoiceQueueId':_0x4a50c7[_0xca30('0xd9')]||undefined,'CampaignId':_0x4a50c7[_0xca30('0x120')]||undefined})['catch'](loggerCatch(_0xca30('0x1fd')));_0x29674e['createHistory'](createObjHistory(_0x56446d,_0x4a50c7,_0xca30('0x1fe'),0x17,_0xca30('0x1ff')))[_0xca30('0xb4')](loggerCatch(_0xca30('0x200')));}else{_0x29674e[_0xca30('0xdf')](createObjHistory(_0x56446d,_0x4a50c7,_0xca30('0x201'),0x16,_0xca30('0x202')),_0xca30('0x203'),_0xca30('0x204'));}}}}else{_0x56446d[_0xca30('0x205')]+=0x1;_0x29674e[_0xca30('0xdf')](createObjHistory(_0x56446d,_0x4a50c7,_0xca30('0x206'),0xd,_0xca30('0x207')),'[Originate][historyBlacklist]',_0xca30('0x208'));throw _0xca30('0x209');}};};Dialer[_0xca30('0xaa')][_0xca30('0x20a')]=function(_0x205f29){var _0x18c819=this;var _0x2078ac=_0x205f29['limitCalls']-_0x205f29[_0xca30('0x6f')]-_0x205f29[_0xca30('0xc8')];emitCampaignSummary(_0x205f29);if(_0x2078ac>0x0){if(_0x2078ac>this[_0xca30('0x21')]){_0x2078ac=this[_0xca30('0x21')];}_0x205f29[_0xca30('0xc8')]+=_0x2078ac;this[_0xca30('0xca')](_0x205f29['id'],_0x2078ac,_0x205f29[_0xca30('0x20b')],_0x205f29)['then'](function(_0x273745){_0x205f29['temp']-=_0x2078ac;_0x205f29[_0xca30('0xc8')]=_0x205f29[_0xca30('0xc8')]>0x0?_0x205f29[_0xca30('0xc8')]:0x0;if(!checkContactEmpty(_0x273745)){_0x205f29[_0xca30('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xca30('0x20c')+_0x205f29['name']);}else{_0x205f29[_0xca30('0x6f')]+=_0x273745[_0xca30('0x14e')];_0x205f29[_0xca30('0x3e')]=_0xca30('0x20d');for(var _0x3d6f99=0x0;_0x3d6f99<_0x273745[_0xca30('0x14e')];_0x3d6f99+=0x1){_0x205f29[_0xca30('0x20e')]+=0x1;if(_[_0xca30('0xb0')](_0x273745[_0x3d6f99])||_[_0xca30('0xb0')](_0x273745[_0x3d6f99][_0xca30('0x17a')])||_['isNil'](_0x273745[_0x3d6f99][_0xca30('0x17a')][_0xca30('0x17b')])){_0x18c819[_0xca30('0xd4')](_0xca30('0x20f'),_0x205f29,_0x273745[_0x3d6f99]);}else{_0x18c819[_0xca30('0xbe')](_[_0xca30('0xd6')](_0x273745[_0x3d6f99],[_0xca30('0x120'),'Contact.phone']))[_0xca30('0x3b')](_0x18c819[_0xca30('0x1f5')](_0x205f29,_0x273745[_0x3d6f99]))[_0xca30('0xb4')](_0x18c819[_0xca30('0xd3')](_0xca30('0x210'),_0x205f29));}}}})[_0xca30('0xb4')](loggerGetContactDialer(_0xca30('0x211'),_0x205f29,_0x2078ac));}};Dialer[_0xca30('0xaa')][_0xca30('0x15f')]=function(_0x1ad058,_0x144e91){var _0x4901bf=this;var _0x3b62e5=[];var _0x40fc8c=_0x144e91>=0x1?_0x144e91:0x1;if(_0x1ad058[_0xca30('0x58')]===_0xca30('0x8')){_0x40fc8c=0x1;}var _0xdb1d47=Math[_0xca30('0x212')](_0x1ad058[_0xca30('0x4e')]*_0x40fc8c)-_0x1ad058[_0xca30('0x6f')]-_0x1ad058[_0xca30('0xc8')];emitVoiceQueueSummary(_0x1ad058);if(_0x1ad058[_0xca30('0x213')]>0x0){var _0x5cb53c=_0x1ad058[_0xca30('0x213')]-_0x1ad058[_0xca30('0x6f')]-_0x1ad058['talking']-_0x1ad058[_0xca30('0xc8')]-_0x1ad058['pTalking'];if(_0xdb1d47>_0x5cb53c){_0xdb1d47=_0x5cb53c;}}if(_0xdb1d47>0x0){if(_0x1ad058[_0xca30('0x58')]==='booked'){_0xdb1d47=0x1;}if(_0xdb1d47>this[_0xca30('0x21')]){_0xdb1d47=this[_0xca30('0x21')];}_0x1ad058['temp']+=_0xdb1d47;for(var _0x3190ea in this[_0xca30('0x1f')]){if(typeof this[_0xca30('0x1f')][_0x3190ea]!=='undefined'){if(this['agents'][_0x3190ea]['state']===_0xca30('0x214')&&this['agents'][_0x3190ea][_0xca30('0xb2')]===_0xca30('0xdc')){_0x3b62e5[_0xca30('0x130')](this[_0xca30('0x1f')][_0x3190ea]['id']);}}}this[_0xca30('0xc7')](_0x1ad058['id'],_0x3b62e5,_0xdb1d47,_0x1ad058[_0xca30('0x20b')],_0x1ad058)[_0xca30('0x3b')](function(_0x261a4c){_0x1ad058['temp']-=_0xdb1d47;_0x1ad058[_0xca30('0xc8')]=_0x1ad058[_0xca30('0xc8')]>0x0?_0x1ad058[_0xca30('0xc8')]:0x0;if(!checkContactEmpty(_0x261a4c)){_0x4901bf['countReScheduled'](_0x1ad058)['then'](sendMessageReschedule(_0x1ad058))[_0xca30('0xb4')](loggerCatch('[countReScheduled]\x20'));}else{_0x1ad058[_0xca30('0x6f')]+=_0x261a4c['length'];_0x1ad058[_0xca30('0x3e')]=_0x1ad058[_0xca30('0x58')]===_0xca30('0x8')?_0xca30('0x180'):'RUNNING';for(var _0x52c539=0x0;_0x52c539<_0x261a4c[_0xca30('0x14e')];_0x52c539+=0x1){if(_[_0xca30('0xb0')](_0x261a4c[_0x52c539])||_[_0xca30('0xb0')](_0x261a4c[_0x52c539]['Contact'])||_[_0xca30('0xb0')](_0x261a4c[_0x52c539]['Contact'][_0xca30('0x17b')])){_0x4901bf['emptyContact'](_0xca30('0x20f'),_0x1ad058,_0x261a4c[_0x52c539]);}else{_0x4901bf['checkIsBlackList'](_[_0xca30('0xd6')](_0x261a4c[_0x52c539],[_0xca30('0xd9'),_0xca30('0x215')]))[_0xca30('0x3b')](_0x4901bf[_0xca30('0x1f5')](_0x1ad058,_0x261a4c[_0x52c539]))['catch'](_0x4901bf[_0xca30('0xd3')]('[actionOriginate]\x20',_0x1ad058));}}}})['catch'](loggerGetContactDialer(_0xca30('0x216'),_0x1ad058,_0xdb1d47));}};Dialer['prototype'][_0xca30('0x90')]=function(_0x38855d){if(_0x38855d[_0xca30('0x213')]>0x0){var _0x4af144=_0x38855d[_0xca30('0x213')]-_0x38855d[_0xca30('0x6f')]-_0x38855d['talking'];if(_0x4af144>0x0){this[_0xca30('0x217')](_0x38855d);}else{loggerPredictiveCalls[_0xca30('0x7d')](_0xca30('0x218'));}}else{this[_0xca30('0x217')](_0x38855d);}};Dialer['prototype'][_0xca30('0x217')]=function(_0xe305f6){var _0x10972a=this;var _0xf31bcb=[];_0xe305f6[_0xca30('0x6f')]+=0x1;for(var _0x216c2c in this[_0xca30('0x1f')]){if(typeof this[_0xca30('0x1f')][_0x216c2c]!==_0xca30('0x98')){if(this[_0xca30('0x1f')][_0x216c2c][_0xca30('0xa7')]===_0xca30('0x214')&&this[_0xca30('0x1f')][_0x216c2c][_0xca30('0xb2')]===_0xca30('0xdc')){_0xf31bcb['push'](this[_0xca30('0x1f')][_0x216c2c]['id']);}}}this['getContactDialer'](_0xe305f6['id'],_0xf31bcb,0x1,_0xe305f6['dialOrderByScheduledAt'],_0xe305f6)['then'](function(_0x585a9d){if(!checkContactEmpty(_0x585a9d)){checkContactLowerLimitOriginate(_0xe305f6,0x1,0x0);_0x10972a[_0xca30('0xba')](_0xe305f6)['then'](sendMessageReschedule(_0xe305f6))[_0xca30('0xb4')](loggerCatch(_0xca30('0xbb')));}else{_0xe305f6[_0xca30('0x3e')]=_0xca30('0x20d');if(_[_0xca30('0xb0')](_0x585a9d[0x0])||_[_0xca30('0xb0')](_0x585a9d[0x0][_0xca30('0x17a')])||_[_0xca30('0xb0')](_0x585a9d[0x0][_0xca30('0x17a')]['phone'])){_0x10972a[_0xca30('0xd4')](_0xca30('0x20f'),_0xe305f6,_0x585a9d[0x0]);}else{_0x10972a[_0xca30('0xbc')](_['pick'](_0x585a9d[0x0],[_0xca30('0xd9'),'Contact.phone']))[_0xca30('0x3b')](_0x10972a[_0xca30('0x1f5')](_0xe305f6,_0x585a9d[0x0]))['catch'](_0x10972a['loggerHandler'](_0xca30('0x219'),_0xe305f6));}}})[_0xca30('0xb4')](loggerGetContactDialer('[getContactDialerPredictive]',_0xe305f6,0x1));emitVoiceQueueSummary(_0xe305f6);};Dialer[_0xca30('0xaa')][_0xca30('0x1e9')]=function(_0x5965bd,_0x53c193,_0x21ce27,_0x57d9a5,_0x3af080,_0x6d2d72){loggerPredictive[_0xca30('0x7d')](_0xca30('0x21a'));loggerPredictive['info'](_0xca30('0x21b'),_0x5965bd);loggerPredictive[_0xca30('0x7d')](_0xca30('0x21c'),_0x53c193);loggerPredictive['info'](_0xca30('0x21d'),_0x21ce27);loggerPredictive[_0xca30('0x7d')]('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',_0x57d9a5);loggerPredictive[_0xca30('0x7d')](_0xca30('0x21e'),_0x3af080);loggerPredictive[_0xca30('0x7d')]('---------------------------');return new BPromise(function(_0x21ffe0,_0x1ad8aa){if(_0x5965bd<=0x0||isNaN(_0x5965bd)){return _0x1ad8aa(msgResponse(_0xca30('0x21f'),_0xca30('0x1a2'),'m\x20=\x20'+_0x5965bd));}if(_0x21ce27<=0x0||isNaN(_0x21ce27)){return _0x1ad8aa(msgResponse('[abandonmentRate]',_0xca30('0x1a2'),_0xca30('0x220')+_0x21ce27));}if(_0x57d9a5<=0x0||isNaN(_0x57d9a5)){return _0x1ad8aa(msgResponse(_0xca30('0x21f'),_0xca30('0x1a2'),_0xca30('0x221')+_0x57d9a5));}if(_0x53c193<=0x0||isNaN(_0x53c193)){return _0x1ad8aa(msgResponse(_0xca30('0x21f'),'Error',_0xca30('0x222')+_0x53c193));}if(_0x3af080<=0x0||isNaN(_0x3af080)){return _0x1ad8aa(msgResponse(_0xca30('0x21f'),_0xca30('0x1a2'),_0xca30('0x223')+_0x3af080));}_0x6d2d72=_0x6d2d72||0x0;var _0x4a9707=0x1/_0x21ce27;var _0x16bf19=0x0;var _0x124e8d=0x0;var _0x4ece88=0x0;var _0x2ab20e=0x0;for(var _0xbb2f4b=0x0;_0x4ece88<_0x3af080;_0xbb2f4b+=0x1){_0x124e8d=_0xbb2f4b/_0x53c193;_0x16bf19=(_0x57d9a5*_0x124e8d+_0x6d2d72)/_0x4a9707;_0x4ece88=erlangb(_0x16bf19,_0x5965bd);_0x2ab20e=_0x16bf19/_0x5965bd*(0x1-erlangb(_0x16bf19,_0x5965bd));}return _0x21ffe0({'erlangCalls':_0xbb2f4b,'erlangCallToSecond':_0x53c193/_0xbb2f4b,'erlangAbandonmentRate':_0x4ece88,'erlangBusyFactor':_0x2ab20e});});};Dialer[_0xca30('0xaa')][_0xca30('0x1ea')]=function(_0x2131fb,_0x257821,_0x3ca720,_0x30a885,_0x19aa32,_0x171e67){loggerPredictive[_0xca30('0x7d')](_0xca30('0x224'));loggerPredictive[_0xca30('0x7d')]('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',_0x2131fb);loggerPredictive[_0xca30('0x7d')](_0xca30('0x21c'),_0x257821);loggerPredictive[_0xca30('0x7d')](_0xca30('0x21d'),_0x3ca720);loggerPredictive[_0xca30('0x7d')](_0xca30('0x225'),_0x30a885);loggerPredictive[_0xca30('0x7d')](_0xca30('0x226'),_0x19aa32);loggerPredictive['info'](_0xca30('0x85'));return new BPromise(function(_0x4d27a4,_0xaf98a2){if(_0x2131fb<=0x0||isNaN(_0x2131fb)){return _0xaf98a2(msgResponse(_0xca30('0x227'),_0xca30('0x1a2'),'m\x20=\x20'+_0x2131fb));}if(_0x3ca720<=0x0||isNaN(_0x3ca720)){return _0xaf98a2(msgResponse(_0xca30('0x227'),_0xca30('0x1a2'),_0xca30('0x220')+_0x3ca720));}if(_0x30a885<=0x0||isNaN(_0x30a885)){return _0xaf98a2(msgResponse(_0xca30('0x227'),_0xca30('0x1a2'),_0xca30('0x221')+_0x30a885));}if(_0x257821<=0x0||isNaN(_0x257821)){return _0xaf98a2(msgResponse(_0xca30('0x227'),_0xca30('0x1a2'),_0xca30('0x222')+_0x257821));}if(_0x19aa32<=0x0||isNaN(_0x19aa32)){return _0xaf98a2(msgResponse(_0xca30('0x227'),_0xca30('0x1a2'),_0xca30('0x228')+_0x19aa32));}_0x171e67=_0x171e67||0x0;var _0x28b666=0x1/_0x3ca720;var _0x513049=0x0;var _0x3d5ae3=0x0;var _0x2347a2=0x0;var _0x367cf2=0x0;for(var _0x5b8be0=0x0;_0x367cf2<_0x19aa32;_0x5b8be0+=0x1){_0x3d5ae3=_0x5b8be0/_0x257821;_0x513049=(_0x30a885*_0x3d5ae3+_0x171e67)/_0x28b666;_0x2347a2=erlangb(_0x513049,_0x2131fb);_0x367cf2=_0x513049/_0x2131fb*(0x1-erlangb(_0x513049,_0x2131fb));}return _0x4d27a4({'erlangCalls':_0x5b8be0,'erlangCallToSecond':_0x257821/_0x5b8be0,'erlangAbandonmentRate':_0x2347a2,'erlangBusyFactor':_0x367cf2});});};module['exports']=Dialer; \ No newline at end of file +var _0x60a5=['dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','Trunk','active','callerid','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','[uniqueid]','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','merge','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','reachable','SIP/%s','unmonitored','variable','exten','xcally-motion-dialer','value','HANGUP','uniqueid','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countmachineretry','countglobal','emit','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','responsetime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','queueCallerAbandonCreateState','dialAbandonedRetryFrequency','calleridname','[syncAgentComplete][createHistory][11]','actionid','strategy','locked','stateinterface','rrmemory','idHopper','queueStatusComplete','stringify','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','length','command','iftime\x20%s,%s','content','indexOf','true','push','some','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','dialPreviewRecallmeReminder','syncCampaigns','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','response','callProgressDetecting','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','object','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','abandonmentRate','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','dialLimitQueue','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','exports','bluebird','uuid','moment','md5','../preview/util/util','../../../config/environment/','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','milliseconds','diff','seconds','type','outbound','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','loggedInDb'];(function(_0x5e3abb,_0x46cca9){var _0x11e753=function(_0x4ad1ae){while(--_0x4ad1ae){_0x5e3abb['push'](_0x5e3abb['shift']());}};_0x11e753(++_0x46cca9);}(_0x60a5,0x1bc));var _0x560a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x60a5[_0x501510];return _0x1e6ee5;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x560a('0x0'));var uuid=require(_0x560a('0x1'));var moment=require(_0x560a('0x2'));var rr=require('rr');var md5=require(_0x560a('0x3'));var Redis=require('ioredis');var ut=require(_0x560a('0x4'));var config=require(_0x560a('0x5'));var logger=require('../../../config/logger')(_0x560a('0x6'));var loggerBooked=require('../../../config/logger')(_0x560a('0x7'));var loggerPredictive=require(_0x560a('0x8'))(_0x560a('0x9'));var loggerPredictiveCalls=require(_0x560a('0x8'))(_0x560a('0xa'));var loggerSyncQueueSummary=require(_0x560a('0x8'))(_0x560a('0xb'));var ami=require('../ami');config['redis']=_[_0x560a('0xc')](config[_0x560a('0xd')],{'host':_0x560a('0xe'),'port':0x18eb});var io=require(_0x560a('0xf'))(new Redis(config[_0x560a('0xd')]));var cmHopper=require(_0x560a('0x10'));var cmHopperHistory=require(_0x560a('0x11'));var cmHopperBlack=require(_0x560a('0x12'));var voiceQueueRt=require(_0x560a('0x13'));var RpcSetting=require(_0x560a('0x14'));var Action=require(_0x560a('0x15'));var History=require(_0x560a('0x16'));var Final=require(_0x560a('0x17'));var AgentComplete=require(_0x560a('0x18'));var QueueCallerAbandon=require(_0x560a('0x19'));var Hangup=require(_0x560a('0x1a'));var ipAgi=process[_0x560a('0x1b')][_0x560a('0x1c')]||_0x560a('0x1d');var strategy={'rrmemory':'rrmemory','roundrobin':_0x560a('0x1e')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x560a('0x1f')][_0x560a('0x20')]=function(_0x2a5d3b){this[_0x560a('0x21')]=this[_0x560a('0x21')]?this[_0x560a('0x21')][_0x560a('0x22')](_0x2a5d3b):_0x2a5d3b();};function Dialer(_0x23cc61,_0x613940){this['sequence']=new Sequence();this['preview']=_0x613940;this[_0x560a('0x23')]=_0x23cc61[_0x560a('0x23')];this[_0x560a('0x24')]=_0x23cc61[_0x560a('0x24')];this[_0x560a('0x25')]=_0x23cc61['agents'];this[_0x560a('0x26')]=_0x23cc61[_0x560a('0x26')];this[_0x560a('0x27')]=config[_0x560a('0x27')]||0x2;this[_0x560a('0x28')]={};this[_0x560a('0x29')]={};this[_0x560a('0x2a')]={};this[_0x560a('0x2b')]={};this['optionPredictive']={};this[_0x560a('0x2c')]={};this[_0x560a('0x2d')]={};this[_0x560a('0x2e')]={};this[_0x560a('0x2f')]={};this[_0x560a('0x30')]={};ami['on'](_0x560a('0x31'),this[_0x560a('0x32')][_0x560a('0x33')](this));ami['on'](_0x560a('0x34'),this[_0x560a('0x35')][_0x560a('0x33')](this));ami['on'](_0x560a('0x36'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x560a('0x37'),this[_0x560a('0x38')][_0x560a('0x33')](this));ami['on'](_0x560a('0x39'),this['syncQueueSummary'][_0x560a('0x33')](this));ami['on'](_0x560a('0x3a'),this[_0x560a('0x3b')][_0x560a('0x33')](this));ami['on']('newexten',this[_0x560a('0x3c')][_0x560a('0x33')](this));ami['on'](_0x560a('0x3d'),this[_0x560a('0x3e')][_0x560a('0x33')](this));ami['on'](_0x560a('0x3f'),this[_0x560a('0x40')][_0x560a('0x33')](this));ami['on'](_0x560a('0x41'),this[_0x560a('0x42')][_0x560a('0x33')](this));this[_0x560a('0x43')]();this[_0x560a('0x44')]();RpcSetting['getSettings']()[_0x560a('0x45')](function(_0x4eebaa){previewRecallmeReminderInterval=_0x4eebaa[_0x560a('0x46')];});}function isNotNull(_0x1c1a34){return _0x1c1a34!==null&&!_['isUndefined'](_0x1c1a34);}function checkIsLoggedIn(_0x228ecb,_0x3ab7e3){return function(){if(_0x3ab7e3<=0x0){_0x228ecb[_0x560a('0x47')]=_0x560a('0x48');throw _0x228ecb[_0x560a('0x49')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x428108){return _0x428108;}function checkIsActive(_0x25d6b3,_0x47f0d6){return function(){if(!isActive(_0x47f0d6)){_0x25d6b3[_0x560a('0x47')]='NOT_ACTIVE';throw _0x25d6b3[_0x560a('0x49')]+_0x560a('0x4a');}};}function checkInterval(_0x2622de){return function(){if(!isNotNull(_0x2622de[_0x560a('0x4b')])){_0x2622de[_0x560a('0x47')]=_0x560a('0x4c');throw _0x2622de[_0x560a('0x49')]+_0x560a('0x4d');}if(!isNotNull(_0x2622de[_0x560a('0x4b')][_0x560a('0x4e')])){_0x2622de[_0x560a('0x47')]=_0x560a('0x4c');throw _0x2622de['name']+_0x560a('0x4d');}if(!isNotNull(_[_0x560a('0x4f')](_0x2622de[_0x560a('0x4b')][_0x560a('0x4e')]))){_0x2622de[_0x560a('0x47')]='INTERVAL_IS_NULL';throw _0x2622de['name']+_0x560a('0x4d');}};}function msgResponse(_0x339d12,_0x389308,_0x57f42d){return{'action':_0x339d12,'response':_0x389308,'message':_0x57f42d,'stack':_0x57f42d};}function myreject(_0x513c79){return function(_0x3e2999){return _0x513c79(msgResponse('[ifTime][Action]',_0x560a('0x50'),JSON['stringify'](_0x3e2999)));};}function getSeconds(_0x435e7c,_0x2bc876){var _0x232286=moment(_0x435e7c)[_0x560a('0x51')](0x0);var _0x5de493=moment(_0x2bc876)[_0x560a('0x51')](0x0);return _0x232286[_0x560a('0x52')](_0x5de493,_0x560a('0x53'));}function emit(_0x4d1aec,_0x7bec83,_0x2df47d){io['to'](_0x4d1aec)['emit'](_0x7bec83,_0x2df47d);}function emitVoiceQueueSummary(_0x58dbc3){if(_0x58dbc3[_0x560a('0x54')]===_0x560a('0x55')){var _0x30e815={'id':_0x58dbc3['id'],'name':_0x58dbc3['name'],'strategy':_0x58dbc3['strategy'],'answered':_0x58dbc3[_0x560a('0x56')],'available':_0x58dbc3[_0x560a('0x57')],'loggedIn':_0x58dbc3['loggedIn'],'pTalking':_0x58dbc3[_0x560a('0x58')],'sumBillable':_0x58dbc3[_0x560a('0x59')],'sumDuration':_0x58dbc3[_0x560a('0x5a')],'sumHoldTime':_0x58dbc3[_0x560a('0x5b')]||0x0,'talking':_0x58dbc3['talking'],'total':_0x58dbc3[_0x560a('0x5c')],'type':_0x58dbc3['type'],'unmanaged':_0x58dbc3['unmanaged'],'abandoned':_0x58dbc3[_0x560a('0x5d')],'waiting':_0x58dbc3['waiting'],'loggedInDb':_0x58dbc3[_0x560a('0x5e')],'dialActive':_0x58dbc3[_0x560a('0x5f')],'dialMethod':_0x58dbc3['dialMethod'],'dialOriginateCallerIdName':_0x58dbc3[_0x560a('0x60')],'dialOriginateCallerIdNumber':_0x58dbc3[_0x560a('0x61')],'dialOriginateTimeout':_0x58dbc3[_0x560a('0x62')],'dialPrefix':_0x58dbc3['dialPrefix'],'outboundAnswerAgiCallsDay':_0x58dbc3[_0x560a('0x63')],'outboundAnswerCallsDay':_0x58dbc3[_0x560a('0x64')],'outboundBlacklistCallsDay':_0x58dbc3['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x58dbc3[_0x560a('0x65')],'outboundCongestionCallsDay':_0x58dbc3[_0x560a('0x66')],'outboundDropCallsDayACS':_0x58dbc3[_0x560a('0x67')],'outboundDropCallsDayCallersExit':_0x58dbc3[_0x560a('0x68')],'outboundDropCallsDayTimeout':_0x58dbc3[_0x560a('0x69')],'outboundNoAnswerCallsDay':_0x58dbc3[_0x560a('0x6a')],'outboundNoSuchCallsDay':_0x58dbc3[_0x560a('0x6b')],'outboundOriginateFailureCallsDay':_0x58dbc3['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x58dbc3['outboundReCallsDay'],'outboundRejectCallsDay':_0x58dbc3[_0x560a('0x6c')],'outboundUnknownCallsDay':_0x58dbc3['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x58dbc3[_0x560a('0x6d')],'predictiveIntervalAvgHoldtime':_0x58dbc3[_0x560a('0x6e')],'predictiveIntervalAvgTalktime':_0x58dbc3['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x58dbc3[_0x560a('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x58dbc3[_0x560a('0x70')],'predictiveIntervalErlangCalls':_0x58dbc3[_0x560a('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x58dbc3[_0x560a('0x72')],'predictiveIntervalHitRate':_0x58dbc3[_0x560a('0x73')],'predictiveIntervalMultiplicativeFactor':_0x58dbc3['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x58dbc3[_0x560a('0x74')],'predictiveIntervalAvailable':_0x58dbc3[_0x560a('0x75')],'predictiveIntervalTotalCalls':_0x58dbc3[_0x560a('0x76')],'message':_0x58dbc3[_0x560a('0x47')],'originated':_0x58dbc3[_0x560a('0x77')],'erlangCalls':_0x58dbc3[_0x560a('0x78')],'erlangCallToSecond':_0x58dbc3['erlangCallToSecond'],'erlangAbandonmentRate':_0x58dbc3[_0x560a('0x79')],'erlangBusyFactor':_0x58dbc3['erlangBusyFactor'],'startPredictive':_0x58dbc3[_0x560a('0x2c')],'startProgressive':_0x58dbc3[_0x560a('0x2d')]};if(_0x58dbc3[_0x560a('0x7a')]){_0x30e815['Trunk']={'id':_0x58dbc3['Trunk']['id'],'name':_0x58dbc3[_0x560a('0x7a')]['name'],'active':_0x58dbc3[_0x560a('0x7a')][_0x560a('0x7b')],'callerid':_0x58dbc3[_0x560a('0x7a')][_0x560a('0x7c')]};}if(_0x58dbc3[_0x560a('0x4b')]){_0x30e815[_0x560a('0x4b')]={'id':_0x58dbc3[_0x560a('0x4b')]['id'],'name':_0x58dbc3[_0x560a('0x4b')][_0x560a('0x49')]};}var _0x17eab9=md5(JSON['stringify'](_0x30e815));if(_0x58dbc3[_0x560a('0x3')]!==_0x17eab9){_0x58dbc3[_0x560a('0x3')]=_0x17eab9;emit(util['format'](_0x560a('0x7d'),_0x30e815[_0x560a('0x49')]),'voice_queue:save',_0x30e815);}}}function emitCampaignSummary(_0x55260f){if(_0x55260f[_0x560a('0x54')]===_0x560a('0x7e')){emit(util[_0x560a('0x7f')](_0x560a('0x80'),_0x55260f[_0x560a('0x49')]),_0x560a('0x81'),_0x55260f);}}function checkGetDataPredictive(_0x3c4b18){if(isNotNull(_0x3c4b18)&&!_['isEmpty'](_0x3c4b18)){loggerPredictive[_0x560a('0x82')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x560a('0x82')](_0x560a('0x83'),_0x3c4b18[_0x560a('0x76')]);loggerPredictive[_0x560a('0x82')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c4b18[_0x560a('0x6d')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c4b18[_0x560a('0x70')]);loggerPredictive[_0x560a('0x82')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c4b18['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x560a('0x82')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c4b18['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c4b18[_0x560a('0x84')]);loggerPredictive[_0x560a('0x82')](_0x560a('0x85'));if(_0x3c4b18[_0x560a('0x76')]>0x0){if(!_['isUndefined'](_0x3c4b18[_0x560a('0x84')])&&_0x3c4b18[_0x560a('0x84')]>0x0){return!![];}loggerPredictive[_0x560a('0x82')](_0x560a('0x86'));if(!_[_0x560a('0x87')](_0x3c4b18[_0x560a('0x6e')])&&_0x3c4b18[_0x560a('0x6e')]>0x0){return!![];}loggerPredictive['info'](_0x560a('0x88'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x560a('0x82')](_0x560a('0x89'));}return![];}function mergeDataErlangB(_0x833a97){return function(_0x3ed2ef){loggerPredictive[_0x560a('0x82')](_0x560a('0x8a'));loggerPredictive[_0x560a('0x82')](_0x560a('0x8b'),_0x3ed2ef[_0x560a('0x78')]);loggerPredictive[_0x560a('0x82')](_0x560a('0x8c'),_0x3ed2ef[_0x560a('0x8d')]);loggerPredictive[_0x560a('0x82')](_0x560a('0x8e'),_0x3ed2ef[_0x560a('0x79')]);loggerPredictive[_0x560a('0x82')](_0x560a('0x8f'),_0x3ed2ef[_0x560a('0x90')]);loggerPredictive['info'](_0x560a('0x8e'),_0x3ed2ef['erlangAbandonmentRate']);loggerPredictive[_0x560a('0x82')](_0x560a('0x85'));_['merge'](_0x833a97,_0x3ed2ef);};}function getDiff(_0x2dca5a){var _0x47b314=moment()['milliseconds'](0x0);var _0x3e765b=moment(_0x2dca5a)['milliseconds'](0x0);return _0x47b314['diff'](_0x3e765b,_0x560a('0x53'));}function ifInterval(_0x329e4d,_0x16f9be){if(_[_0x560a('0x87')](_0x16f9be)){return![];}return getDiff(_0x16f9be)<_0x329e4d*0x3c;}function freeVariablesPredictive(_0x462e09){if(isNotNull(_0x462e09)){if(!_[_0x560a('0x87')](_0x462e09['startProgressive'])){_0x462e09[_0x560a('0x2d')]=undefined;loggerPredictive[_0x560a('0x82')](_0x462e09[_0x560a('0x49')],_0x560a('0x91'));}if(!_[_0x560a('0x87')](_0x462e09[_0x560a('0x2c')])){_0x462e09['startPredictive']=undefined;loggerPredictive[_0x560a('0x82')](_0x462e09[_0x560a('0x49')],_0x560a('0x92'));}if(!_[_0x560a('0x87')](_0x462e09[_0x560a('0x93')])){clearInterval(_0x462e09[_0x560a('0x93')]);_0x462e09[_0x560a('0x93')]=undefined;loggerPredictive['info'](_0x462e09[_0x560a('0x49')],_0x560a('0x94'));}}}function erlangb(_0x47422b,_0x2edcf2){if(_0x2edcf2===0x0){return 0x0;}var _0x518bbd=0x1;for(var _0x21b22b=0x1;_0x21b22b<=_0x2edcf2;_0x21b22b+=0x1){_0x518bbd=0x1+_0x518bbd*_0x21b22b/_0x47422b;}return 0x1/_0x518bbd;}function isVoiceQueueOutbound(_0x9a6c43){return _0x9a6c43===_0x560a('0x55');}function isNotPreview(_0x3597cc){return _0x3597cc!==_0x560a('0x95');}function isCampaignIvr(_0x3e4068){return _0x3e4068===_0x560a('0x7e');}function getCallerId(_0xd64ce7,_0x59044d,_0x1de7db){if(!_[_0x560a('0x87')](_0x1de7db)&&typeof _0x1de7db===_0x560a('0x96')&&!_[_0x560a('0x4f')](_0x1de7db)){if(!_[_0x560a('0x87')](_0x59044d)&&typeof _0x59044d===_0x560a('0x96')&&!_['isEmpty'](_0x59044d)){return util[_0x560a('0x7f')](_0x560a('0x97'),_0x59044d,_0x1de7db);}return util['format']('\x22%s\x22\x20<%s>',_0x1de7db,_0x1de7db);}if(!_['isUndefined'](_0xd64ce7)&&typeof _0xd64ce7===_0x560a('0x96')&&!_[_0x560a('0x4f')](_0xd64ce7)){return _0xd64ce7;}return _0x560a('0x98');}function loggerCatchQueueSummary(_0x5a8f60,_0x53d8be){return function(_0x3620b7){freeVariablesPredictive(_0x53d8be);emitVoiceQueueSummary(_0x53d8be);emitCampaignSummary(_0x53d8be);loggerSyncQueueSummary['error'](_0x5a8f60,util[_0x560a('0x99')](_0x3620b7,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1d55cb,_0x56f3b8){return function(_0x4df26b){loggerPredictive[_0x560a('0x9a')](_0x56f3b8[_0x560a('0x49')],_0x1d55cb);loggerPredictive[_0x560a('0x9a')](_0x4df26b[_0x560a('0x9b')]);freeVariablesPredictive(_0x56f3b8);};}function loggerCatch(_0x3e6bb0){return function(_0x19e120){logger[_0x560a('0x9a')](_0x3e6bb0,util[_0x560a('0x99')](_0x19e120,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x26b568){return _0x26b568&&!_['isUndefined'](_0x26b568)&&_0x26b568['length']>0x0;}function decremetOriginate(_0x2635d8){if(!_['isUndefined'](_0x2635d8)&&_0x2635d8!==null){if(typeof _0x2635d8[_0x560a('0x77')]!==_0x560a('0x9c')){if(_0x2635d8[_0x560a('0x77')]>0x0){_0x2635d8[_0x560a('0x77')]-=0x1;}else{logger[_0x560a('0x9a')](_0x560a('0x9d'));}}}else{logger[_0x560a('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x25a314,_0x3b356a,_0x272e23){if(_0x3b356a>_0x272e23){for(var _0x23c133=0x0;_0x23c133<_0x3b356a-_0x272e23;_0x23c133+=0x1){decremetOriginate(_0x25a314);}}}function loggerGetContactDialer(_0x3b8c80,_0x3c9240,_0x467854){return function(_0x3ef584){checkContactLowerLimitOriginate(_0x3c9240,_0x467854,0x0);logger[_0x560a('0x9a')](_0x3b8c80,util[_0x560a('0x99')](_0x3ef584,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1c5f1d){return function(_0x891879){if(isNotNull(_0x891879)&&isNotNull(_0x891879[0x0])){if(_0x891879[0x0]['contactsRescheduled']>0x0){_0x1c5f1d[_0x560a('0x47')]=_0x560a('0x9e');logger[_0x560a('0x82')](_0x560a('0x9f')+_0x1c5f1d[_0x560a('0x49')],_0x891879[0x0]['contactsRescheduled'],'contacts');}else{_0x1c5f1d[_0x560a('0x47')]='AVAILABLE_CONTACTS_FINISHED';logger['info']('[getContactDialer2][Empty]'+_0x1c5f1d[_0x560a('0x49')]);}}};}function notSendMessagesQueue(_0x412a30){if(_0x412a30['sendMessageOneNotActive']){freeVariablesPredictive(_0x412a30);if(_0x412a30['originated']===0x0&&_0x412a30[_0x560a('0xa0')]===0x0&&_0x412a30['waiting']===0x0&&(_0x412a30[_0x560a('0x58')]||0x0)===0x0){_0x412a30['sendMessageOneNotActive']=![];_0x412a30[_0x560a('0x57')]=0x0;_0x412a30[_0x560a('0x47')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x560a('0x9a')](_0x560a('0xa1'),_0x412a30[_0x560a('0x49')],_0x560a('0xa2'));}else{_0x412a30[_0x560a('0x47')]=_0x560a('0xa3');loggerSyncQueueSummary[_0x560a('0x9a')](_0x560a('0xa1'),_0x412a30[_0x560a('0x49')],_0x560a('0xa4'));}emitVoiceQueueSummary(_0x412a30);}}function notSendMessagesCampaign(_0xb1deea){if(_0xb1deea[_0x560a('0xa5')]){if(_0xb1deea['originated']===0x0){_0xb1deea[_0x560a('0xa5')]=![];_0xb1deea[_0x560a('0x47')]=_0x560a('0xa6');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xb1deea['name'],_0x560a('0xa2'));}else{_0xb1deea[_0x560a('0x47')]=_0x560a('0xa3');loggerSyncQueueSummary[_0x560a('0x9a')](_0x560a('0xa7'),_0xb1deea[_0x560a('0x49')],_0x560a('0xa4'));}emitCampaignSummary(_0xb1deea);}}function createObjHistory(_0x176074,_0xcedfae,_0x50057b,_0x29be9b,_0x45c984){_0x176074['message']=_0x50057b;var _0xb7bc42=new Action(_0x176074,_0xcedfae);var _0x21ca08=new History(_0xb7bc42);_0x21ca08[_0x560a('0xa8')]=_0x29be9b;_0x21ca08['statedesc']=_0x45c984;_0x21ca08[_0x560a('0xa9')]=_0xb7bc42['starttime'];return _0x21ca08;}Dialer[_0x560a('0x1f')][_0x560a('0x44')]=function(){var _0x5e879f=this;setInterval(function(){_0x5e879f['clearZombieChannels'](_0x5e879f[_0x560a('0x2b')],_0x560a('0xaa'));_0x5e879f[_0x560a('0xab')](_0x5e879f[_0x560a('0x29')],_0x560a('0xac'));},0x32c8);};Dialer[_0x560a('0x1f')][_0x560a('0xab')]=function(_0x5e7960,_0xab1823){var _0x59639a=this;for(var _0x818b28 in _0x5e7960){if(typeof _0x5e7960[_0x818b28]!==_0x560a('0x9c')){this[_0x560a('0xad')][_0x560a('0x20')](function(){if(!_[_0x560a('0xae')](_0x5e7960[_0x818b28])){return ami[_0x560a('0xaf')]({'action':_0x560a('0xb0'),'channel':_0x5e7960[_0x818b28][_0x560a('0xb1')]})[_0x560a('0xb2')](function(_0x37e268){if(_0x37e268['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5e7960[_0x818b28]&&_0x5e7960[_0x818b28]['type']!==_0x560a('0x7e')){_0x59639a[_0x560a('0xb3')](_0x59639a[_0x560a('0x23')][_0x5e7960[_0x818b28][_0x560a('0xb4')]]);logger['error'](_0x560a('0xb5'),_0xab1823,_0x818b28,_0x5e7960[_0x818b28][_0x560a('0xb4')]);delete _0x5e7960[_0x818b28];}if(_0x5e7960[_0x818b28]&&_0x5e7960[_0x818b28][_0x560a('0x54')]===_0x560a('0x7e')){_0x59639a[_0x560a('0xb3')](_0x59639a[_0x560a('0x24')][_0x5e7960[_0x818b28][_0x560a('0xb4')]]);logger[_0x560a('0x9a')](_0x560a('0xb6'),_0xab1823,_0x818b28,_0x5e7960[_0x818b28]['queue']);delete _0x5e7960[_0x818b28];}},0x2328);}});}});}}};Dialer['prototype'][_0x560a('0xb7')]=function(_0x52fd80){return BPromise['resolve']()[_0x560a('0x45')](cmHopper[_0x560a('0xb7')](_0x52fd80))['catch'](loggerCatch(_0x560a('0xb8')));};Dialer['prototype'][_0x560a('0xb9')]=function(_0x1c84c7){return BPromise[_0x560a('0xba')]()[_0x560a('0x45')](cmHopperBlack[_0x560a('0xb9')](_0x1c84c7))[_0x560a('0xb2')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x560a('0x1f')][_0x560a('0xbb')]=function(_0x346af4){return BPromise[_0x560a('0xba')]()['then'](cmHopperBlack[_0x560a('0xbb')](_0x346af4))['catch'](loggerCatch(_0x560a('0xbc')));};Dialer[_0x560a('0x1f')][_0x560a('0xbd')]=function(_0x17b3cf){return BPromise['resolve']()[_0x560a('0x45')](cmHopperHistory[_0x560a('0xbe')](_0x17b3cf))[_0x560a('0xb2')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x560a('0x1f')][_0x560a('0xbf')]=function(_0xaa64f3){return BPromise[_0x560a('0xba')]()['then'](cmHopper[_0x560a('0xbf')](_0xaa64f3))[_0x560a('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x560a('0x1f')]['unlockContact']=function(_0x5a5d47,_0x2fa01e,_0x4acc62){return BPromise[_0x560a('0xba')]()[_0x560a('0x45')](cmHopper[_0x560a('0xc0')](_0x5a5d47,_0x2fa01e,_0x4acc62))[_0x560a('0xb2')](loggerCatch(_0x560a('0xc1')));};Dialer['prototype'][_0x560a('0xc2')]=function(_0x188550,_0x17478f,_0x3484e0,_0x2205cc,_0x3c20a7){return BPromise[_0x560a('0xba')]()[_0x560a('0x45')](cmHopper[_0x560a('0xc2')](_0x188550,_0x17478f,_0x3484e0,_0x2205cc))[_0x560a('0xb2')](function(_0x93a63){_0x3c20a7[_0x560a('0xc3')]-=_0x3484e0;_0x3c20a7[_0x560a('0xc3')]=_0x3c20a7[_0x560a('0xc3')]>0x0?_0x3c20a7[_0x560a('0xc3')]:0x0;loggerCatch(_0x560a('0xc4'))(_0x93a63);});};Dialer[_0x560a('0x1f')][_0x560a('0xc5')]=function(_0x525399,_0x3bb64b,_0x6bf32e,_0x385e6f){return BPromise['resolve']()[_0x560a('0x45')](cmHopper['getContactDialerIvr'](_0x525399,_0x3bb64b,_0x6bf32e))[_0x560a('0xb2')](function(_0x45b97f){_0x385e6f[_0x560a('0xc3')]-=_0x3bb64b;_0x385e6f['temp']=_0x385e6f[_0x560a('0xc3')]>0x0?_0x385e6f[_0x560a('0xc3')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x45b97f);});};Dialer[_0x560a('0x1f')][_0x560a('0xc6')]=function(_0x1cea11){return BPromise[_0x560a('0xba')]()[_0x560a('0x45')](voiceQueueRt[_0x560a('0xc6')](_0x1cea11))[_0x560a('0xb2')](loggerCatch(_0x560a('0xc7')));};Dialer[_0x560a('0x1f')][_0x560a('0xc8')]=function(_0x4cfdb0){return BPromise[_0x560a('0xba')]()[_0x560a('0x45')](cmHopper[_0x560a('0xc8')](_0x4cfdb0))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x560a('0xc9')]=function(_0x1454dd){return BPromise['resolve']()['then'](cmHopperHistory['createHistory'](_0x1454dd))[_0x560a('0xb2')](loggerCatch(_0x560a('0xca')));};Dialer[_0x560a('0x1f')][_0x560a('0xb3')]=function(_0x4f3401){if(!_['isUndefined'](_0x4f3401)&&_0x4f3401!==null){if(typeof _0x4f3401[_0x560a('0x77')]!==_0x560a('0x9c')){if(_0x4f3401[_0x560a('0x77')]>0x0){_0x4f3401[_0x560a('0x77')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x560a('0x9a')](_0x560a('0xcb'));}};Dialer[_0x560a('0x1f')][_0x560a('0xcc')]=function(_0x1c9d9c,_0x2fe5b4){var _0x3d9785=this;return function(_0x2d3634){_0x3d9785[_0x560a('0xb3')](_0x2fe5b4);logger[_0x560a('0x9a')](_0x1c9d9c,util[_0x560a('0x99')](_0x2d3634,{'showHidden':![],'depth':null}));};};Dialer[_0x560a('0x1f')]['emptyContact']=function(_0x35aeb0,_0x8d676e,_0x488c2d){var _0x1b0df3={'state':0x19,'statedesc':_0x560a('0xcd')};this[_0x560a('0xb3')](_0x8d676e);this[_0x560a('0xce')](_[_0x560a('0xcf')](_0x1b0df3,_[_0x560a('0xd0')](_0x488c2d,[_0x560a('0xd1'),_0x560a('0xd2'),_0x560a('0xd3'),_0x560a('0xd4'),'CampaignId'])),_0x560a('0xd5'),_0x560a('0xd6'));logger[_0x560a('0x9a')](_0x35aeb0);};Dialer[_0x560a('0x1f')][_0x560a('0xd7')]=function(_0xc1dec3){return _0xc1dec3==='Success';};Dialer['prototype'][_0x560a('0xd8')]=function(_0x5d80eb){return!_['isUndefined'](_0x5d80eb)&&_0x5d80eb&&!_[_0x560a('0x87')](_0x5d80eb['name'])&&!_[_0x560a('0x87')](_0x5d80eb['active'])&&_0x5d80eb['active']&&(this[_0x560a('0x26')][util[_0x560a('0x7f')]('SIP/%s',_0x5d80eb[_0x560a('0x49')])][_0x560a('0xb0')]===_0x560a('0xd9')||this['trunks'][util['format'](_0x560a('0xda'),_0x5d80eb[_0x560a('0x49')])][_0x560a('0xb0')]===_0x560a('0xdb'));};Dialer[_0x560a('0x1f')][_0x560a('0xce')]=function(_0x232fa1,_0x32d4d2,_0x3634c6){this[_0x560a('0xc9')](_0x232fa1)['catch'](loggerCatch(_0x32d4d2));this['moveContactManagedDialer'](_0x232fa1)[_0x560a('0xb2')](loggerCatch(_0x3634c6));};Dialer['prototype'][_0x560a('0x3e')]=function(_0x2bee06){var _0x77cfd8=this[_0x560a('0x2b')][_0x2bee06['uniqueid']];var _0x4aac5e;if(!_[_0x560a('0xae')](_0x2bee06)&&!_['isNil'](_0x2bee06[_0x560a('0xdc')])&&!_[_0x560a('0xae')](_0x2bee06['variable']['amdstatus'])&&_0x2bee06[_0x560a('0xdd')]===_0x560a('0xde')&&_0x77cfd8){if(_0x77cfd8[_0x560a('0x54')]!==_0x560a('0x7e')&&this[_0x560a('0x23')][_0x77cfd8[_0x560a('0xb4')]]['dialAMDActive']&&_0x2bee06[_0x560a('0xdf')]===_0x560a('0xe0')){delete this[_0x560a('0x2b')][_0x2bee06[_0x560a('0xe1')]];this['updateOriginated'](this[_0x560a('0x23')][_0x77cfd8[_0x560a('0xb4')]]);this[_0x560a('0x23')][_0x77cfd8[_0x560a('0xb4')]]['outboundAnswerCallsDay']+=0x1;this[_0x560a('0x23')][_0x77cfd8[_0x560a('0xb4')]][_0x560a('0x63')]+=0x1;_0x4aac5e=new Hangup(_0x77cfd8,_0x2bee06);_0x4aac5e[_0x560a('0xa8')]=0x12;_0x4aac5e[_0x560a('0xe2')]=_0x560a('0xe3');_0x4aac5e[_0x560a('0xe4')]=_0x560a('0xe5');ami['emit'](_0x560a('0xe6'),ut[_0x560a('0xe7')](_0x4aac5e,'amd'));this[_0x560a('0xce')](_0x4aac5e,_0x560a('0xe8'),_0x560a('0xe9'));}if(_0x77cfd8[_0x560a('0x54')]!==_0x560a('0x7e')&&this['voiceQueues'][_0x77cfd8[_0x560a('0xb4')]][_0x560a('0xea')]&&_0x2bee06[_0x560a('0xdf')]===_0x560a('0xeb')){var _0x2fb167=this;return new BPromise(function(_0x96d545,_0x45fd52){delete _0x2fb167['uniqueId'][_0x2bee06[_0x560a('0xe1')]];_0x2fb167[_0x560a('0xb3')](_0x2fb167[_0x560a('0x23')][_0x77cfd8[_0x560a('0xb4')]]);_0x2fb167['voiceQueues'][_0x77cfd8[_0x560a('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x2fb167[_0x560a('0x23')][_0x77cfd8['queue']][_0x560a('0x63')]+=0x1;var _0x214f2b=_0x2fb167['voiceQueues'][_0x77cfd8['queue']];var _0x55e7a1=new Hangup(_0x77cfd8,_0x2bee06);_0x55e7a1[_0x560a('0xa8')]=0x13;_0x55e7a1['statedesc']=_0x560a('0xec');_0x55e7a1[_0x560a('0xe4')]=_0x560a('0xe5');_0x55e7a1[_0x560a('0xed')]+=0x1;_0x55e7a1[_0x560a('0xee')]+=0x1;_0x55e7a1['amd']=!![];ami[_0x560a('0xef')](_0x560a('0xe6'),ut[_0x560a('0xe7')](_0x55e7a1,'amd'));_0x2fb167[_0x560a('0xc9')](_0x55e7a1)[_0x560a('0xb2')](loggerCatch(_0x560a('0xf0')));if(_0x55e7a1[_0x560a('0xf1')]+_0x55e7a1[_0x560a('0xf2')]+_0x55e7a1[_0x560a('0xf3')]+_0x55e7a1[_0x560a('0xf4')]+_0x55e7a1[_0x560a('0xf5')]+_0x55e7a1[_0x560a('0xf6')]+_0x55e7a1[_0x560a('0xed')]+_0x55e7a1['countagentrejectretry']>=_0x214f2b[_0x560a('0xf7')]){_0x2fb167[_0x560a('0xf8')](_0x55e7a1,_0x96d545,_0x45fd52,'reason19\x20machine....');}else{if(_0x55e7a1[_0x560a('0xed')]>=_0x214f2b['dialMachineMaxRetry']){_0x2fb167[_0x560a('0xf9')](_0x55e7a1,_0x96d545,_0x45fd52,_0x560a('0xfa'));}else{_0x2fb167[_0x560a('0xbf')]({'active':![],'countmachineretry':_0x55e7a1['countmachineretry'],'scheduledat':moment()['add'](_0x214f2b[_0x560a('0xfb')],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x55e7a1[_0x560a('0xd1')],'ListId':_0x55e7a1[_0x560a('0xd2')],'VoiceQueueId':_0x55e7a1[_0x560a('0xd4')]||undefined,'CampaignId':_0x55e7a1[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0xff')));_0x96d545({'reschedule':0x1});}}});}if(_0x77cfd8['type']==='ivr'&&this[_0x560a('0x24')][_0x77cfd8[_0x560a('0xb4')]][_0x560a('0xea')]&&_0x2bee06[_0x560a('0xdf')]===_0x560a('0xe0')){delete this[_0x560a('0x2b')][_0x2bee06[_0x560a('0xe1')]];this['updateOriginated'](this[_0x560a('0x24')][_0x77cfd8[_0x560a('0xb4')]]);_0x4aac5e=new Hangup(_0x77cfd8,_0x2bee06);_0x4aac5e['state']=0x12;_0x4aac5e[_0x560a('0xe2')]=_0x560a('0xe3');_0x4aac5e[_0x560a('0xe4')]=_0x560a('0xe5');ami[_0x560a('0xef')](_0x560a('0xe6'),ut[_0x560a('0xe7')](_0x4aac5e,_0x560a('0x100')));this[_0x560a('0xce')](_0x4aac5e,_0x560a('0x101'),_0x560a('0x102'));}if(_0x77cfd8[_0x560a('0x54')]===_0x560a('0x7e')&&this[_0x560a('0x24')][_0x77cfd8['queue']]['dialAMDActive']&&_0x2bee06[_0x560a('0xdf')]===_0x560a('0xeb')){var _0x2fb167=this;return new BPromise(function(_0x4db5cb,_0x4af49e){delete _0x2fb167[_0x560a('0x2b')][_0x2bee06[_0x560a('0xe1')]];_0x2fb167['updateOriginated'](_0x2fb167[_0x560a('0x24')][_0x77cfd8[_0x560a('0xb4')]]);_0x2fb167[_0x560a('0x24')][_0x77cfd8['queue']]['outboundAnswerCallsDay']+=0x1;_0x2fb167[_0x560a('0x24')][_0x77cfd8['queue']][_0x560a('0x63')]+=0x1;var _0x55583b=_0x2fb167[_0x560a('0x24')][_0x77cfd8[_0x560a('0xb4')]];var _0x54d1af=new Hangup(_0x77cfd8,_0x2bee06);_0x54d1af['state']=0x13;_0x54d1af[_0x560a('0xe2')]=_0x560a('0xec');_0x54d1af[_0x560a('0xe4')]=_0x560a('0xe5');_0x54d1af[_0x560a('0xed')]+=0x1;_0x54d1af[_0x560a('0xee')]+=0x1;_0x54d1af[_0x560a('0x100')]=!![];ami['emit'](_0x560a('0xe6'),ut[_0x560a('0xe7')](_0x54d1af,_0x560a('0x100')));_0x2fb167['createHistory'](_0x54d1af)[_0x560a('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x54d1af[_0x560a('0xf1')]+_0x54d1af[_0x560a('0xf2')]+_0x54d1af[_0x560a('0xf3')]+_0x54d1af[_0x560a('0xf4')]+_0x54d1af[_0x560a('0xf5')]+_0x54d1af[_0x560a('0xf6')]+_0x54d1af[_0x560a('0xed')]+_0x54d1af[_0x560a('0x103')]>=_0x55583b[_0x560a('0xf7')]){_0x2fb167[_0x560a('0xf8')](_0x54d1af,_0x4db5cb,_0x4af49e,_0x560a('0x104'));}else{if(_0x54d1af['countmachineretry']>=_0x55583b[_0x560a('0x105')]){_0x2fb167[_0x560a('0xf9')](_0x54d1af,_0x4db5cb,_0x4af49e,_0x560a('0xfa'));}else{_0x2fb167[_0x560a('0xbf')]({'active':![],'countmachineretry':_0x54d1af['countmachineretry'],'scheduledat':moment()[_0x560a('0x106')](_0x55583b[_0x560a('0xfb')],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x54d1af[_0x560a('0xd1')],'ListId':_0x54d1af['ListId'],'VoiceQueueId':_0x54d1af[_0x560a('0xd4')]||undefined,'CampaignId':_0x54d1af[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch('[rescheduleContact][Machine]'));_0x4db5cb({'reschedule':0x1});}}});}}};Dialer[_0x560a('0x1f')][_0x560a('0x3b')]=function(_0x4eaf58){var _0xc7576d=this['uniqueId'][_0x4eaf58['uniqueid']];var _0x4a5c76=this;var _0x4ea639;if(_0xc7576d&&_0xc7576d[_0x560a('0x54')]===_0x560a('0x7e')){delete this[_0x560a('0x2b')][_0x4eaf58[_0x560a('0xe1')]];this['updateOriginated'](this[_0x560a('0x24')][_0xc7576d[_0x560a('0xb4')]]);this['campaigns'][_0xc7576d[_0x560a('0xb4')]][_0x560a('0x107')]+=0x1;_0x4ea639=new Hangup(_0xc7576d,_0x4eaf58);this[_0x560a('0xc9')](_0x4ea639)[_0x560a('0xb2')](loggerCatch(_0x560a('0x108')));this[_0x560a('0xc8')](_0x4ea639)[_0x560a('0xb2')](loggerCatch(_0x560a('0x109')));}if(_0xc7576d&&_0xc7576d[_0x560a('0x54')]!=='ivr'&&isNotNull(this['voiceQueues'][_0xc7576d['queue']][_0x560a('0x10a')])){delete this[_0x560a('0x2b')][_0x4eaf58['uniqueid']];this[_0x560a('0xb3')](this[_0x560a('0x23')][_0xc7576d['queue']]);this['voiceQueues'][_0xc7576d[_0x560a('0xb4')]][_0x560a('0x64')]+=0x1;this[_0x560a('0x23')][_0xc7576d[_0x560a('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4ea639=new Hangup(_0xc7576d,_0x4eaf58);_0x4ea639[_0x560a('0xa8')]=0x10;_0x4ea639[_0x560a('0xe2')]=_0x560a('0x10b');_0x4ea639[_0x560a('0xe4')]=_0x560a('0x10c');this['createHistory'](_0x4ea639)[_0x560a('0xb2')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x4ea639)[_0x560a('0xb2')](loggerCatch(_0x560a('0x109')));}if(_0xc7576d&&_0xc7576d[_0x560a('0x54')]!==_0x560a('0x7e')&&!isNotNull(this[_0x560a('0x23')][_0xc7576d[_0x560a('0xb4')]][_0x560a('0x10a')])){delete this[_0x560a('0x2b')][_0x4eaf58[_0x560a('0xe1')]];this[_0x560a('0xb3')](this[_0x560a('0x23')][_0xc7576d['queue']]);this['voiceQueues'][_0xc7576d[_0x560a('0xb4')]][_0x560a('0x10d')]+=0x1;_0x4ea639=new Hangup(_0xc7576d,_0x4eaf58);_0x4ea639[_0x560a('0xa8')]=0xc;_0x4ea639[_0x560a('0xe2')]=_0x4eaf58[_0x560a('0x10e')];_0x4ea639['membername']=_0x560a('0x10f');this[_0x560a('0xc9')](_0x4ea639)[_0x560a('0xb2')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x560a('0xc8')](_0x4ea639)[_0x560a('0xb2')](loggerCatch(_0x560a('0x109')));}};Dialer[_0x560a('0x1f')][_0x560a('0x38')]=function(_0xf4dfb5){var _0xcc9a0e=this['uniqueId'][_0xf4dfb5[_0x560a('0xe1')]];var _0x26c5b1=this;if(this[_0x560a('0x23')][_0xf4dfb5[_0x560a('0xb4')]]){if(_0xcc9a0e&&_0xcc9a0e[_0x560a('0x54')]!==_0x560a('0x7e')){delete this['uniqueId'][_0xf4dfb5[_0x560a('0xe1')]];this[_0x560a('0x23')][_0xf4dfb5[_0x560a('0xb4')]]['outboundAnswerCallsDay']+=0x1;var _0x1b99cd=new AgentComplete(_0xcc9a0e,_0xf4dfb5);if(_0xf4dfb5[_0x560a('0x110')]===_0x560a('0x111')){_0x1b99cd[_0x560a('0x112')]=this['voiceQueues'][_0xf4dfb5['queue']][_0x560a('0x113')]&&this[_0x560a('0x23')][_0xf4dfb5['queue']]['dialAgiAfterHangupAgent']?moment()[_0x560a('0x7f')](_0x560a('0xfd')):undefined;}this[_0x560a('0xc9')](_0x1b99cd)[_0x560a('0xb2')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x560a('0xc8')](_0x1b99cd)[_0x560a('0xb2')](loggerCatch(_0x560a('0x114')));}}};Dialer[_0x560a('0x1f')][_0x560a('0x32')]=function(_0x33c928){if(this[_0x560a('0x23')][_0x33c928[_0x560a('0xb4')]]){if(this[_0x560a('0x2b')][_0x33c928['uniqueid']]&&this[_0x560a('0x2b')][_0x33c928[_0x560a('0xe1')]]['type']!==_0x560a('0x7e')){this[_0x560a('0xb3')](this[_0x560a('0x23')][_0x33c928['queue']]);this[_0x560a('0x2b')][_0x33c928[_0x560a('0xe1')]][_0x560a('0x115')]=moment()['format'](_0x560a('0xfd'));}}};Dialer[_0x560a('0x1f')]['queueCallerAbandonCreateState']=function(_0x29ba2e){this[_0x560a('0xc9')](_0x29ba2e)[_0x560a('0xb2')](loggerCatch(_0x560a('0x116')));this['moveContactManagedDialer'](_0x29ba2e)[_0x560a('0xb2')](loggerCatch(_0x560a('0x117')));};Dialer[_0x560a('0x1f')][_0x560a('0x35')]=function(_0x150dad){var _0x9aab38=this[_0x560a('0x2b')][_0x150dad[_0x560a('0xe1')]];var _0x2e18aa=this;if(this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]]){if(_0x9aab38&&_0x9aab38[_0x560a('0x54')]!==_0x560a('0x7e')){delete this[_0x560a('0x2b')][_0x150dad[_0x560a('0xe1')]];this['updateOriginated'](this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]]);_0x9aab38['droptime']=moment()['format'](_0x560a('0xfd'));var _0x3f9b49=new QueueCallerAbandon(_0x9aab38,_0x150dad);if(getSeconds(_0x9aab38['droptime'],_0x9aab38[_0x560a('0x118')])>=_0x9aab38['dialQueueTimeout']){this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]][_0x560a('0x70')]+=0x1;this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]][_0x560a('0x69')]+=0x1;this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]][_0x560a('0x72')]+=0x1;_0x3f9b49[_0x560a('0xa8')]=0xa;_0x3f9b49[_0x560a('0xe2')]=_0x560a('0x119');_0x3f9b49[_0x560a('0x11a')]=_0x560a('0x11b');_0x3f9b49[_0x560a('0x112')]=this[_0x560a('0x23')][_0x150dad['queue']][_0x560a('0x113')]?moment()[_0x560a('0x7f')](_0x560a('0xfd')):undefined;_0x3f9b49[_0x560a('0xf5')]+=0x1;_0x3f9b49[_0x560a('0xee')]+=0x1;if(_0x3f9b49[_0x560a('0xf5')]>=this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]][_0x560a('0x11c')]){this['queueCallerAbandonCreateState'](_0x3f9b49);}else{this[_0x560a('0xbf')]({'active':![],'countdropretry':_0x3f9b49[_0x560a('0xf5')],'scheduledat':moment()[_0x560a('0x106')](this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]][_0x560a('0x11d')],_0x560a('0xfc'))['format'](_0x560a('0xfd')),'ContactId':_0x9aab38['ContactId'],'ListId':_0x9aab38['ListId'],'VoiceQueueId':_0x9aab38[_0x560a('0xd4')]||undefined,'CampaignId':_0x9aab38['CampaignId']||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0x11e')));var _0x3372c0=new History(_0x3f9b49);_0x3372c0[_0x560a('0xa8')]=0xa;_0x3372c0[_0x560a('0xe2')]=_0x560a('0x119');_0x3372c0[_0x560a('0x11f')]=moment()['format'](_0x560a('0xfd'));_0x3372c0[_0x560a('0xa9')]=_0x3372c0[_0x560a('0x11f')];_0x3372c0['calleridname']=_0x3f9b49['calleridname'];_0x3372c0[_0x560a('0x120')]=_0x3f9b49['calleridnum'];this[_0x560a('0xc9')](_0x3372c0)[_0x560a('0xb2')](loggerCatch(_0x560a('0x121')));}}else{this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]][_0x560a('0x6f')]+=0x1;this['voiceQueues'][_0x150dad[_0x560a('0xb4')]][_0x560a('0x68')]+=0x1;_0x3f9b49[_0x560a('0xa8')]=0xb;_0x3f9b49[_0x560a('0xe2')]=_0x560a('0x122');_0x3f9b49[_0x560a('0x11a')]=_0x560a('0x123');_0x3f9b49[_0x560a('0xf6')]+=0x1;_0x3f9b49['countglobal']+=0x1;if(_0x3f9b49['countabandonedretry']>=this['voiceQueues'][_0x150dad['queue']][_0x560a('0x124')]){this[_0x560a('0x125')](_0x3f9b49);}else{this[_0x560a('0xbf')]({'active':![],'countabandonedretry':_0x3f9b49[_0x560a('0xf6')],'scheduledat':moment()['add'](this[_0x560a('0x23')][_0x150dad[_0x560a('0xb4')]][_0x560a('0x126')],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x9aab38[_0x560a('0xd1')],'ListId':_0x9aab38[_0x560a('0xd2')],'VoiceQueueId':_0x9aab38[_0x560a('0xd4')]||undefined,'CampaignId':_0x9aab38[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x3372c0=new History(_0x3f9b49);_0x3372c0[_0x560a('0xa8')]=0xb;_0x3372c0['statedesc']=_0x560a('0x122');_0x3372c0[_0x560a('0x11f')]=moment()[_0x560a('0x7f')](_0x560a('0xfd'));_0x3372c0[_0x560a('0xa9')]=_0x3372c0[_0x560a('0x11f')];_0x3372c0[_0x560a('0x127')]=_0x3f9b49[_0x560a('0x127')];_0x3372c0[_0x560a('0x120')]=_0x3f9b49[_0x560a('0x120')];this[_0x560a('0xc9')](_0x3372c0)[_0x560a('0xb2')](loggerCatch(_0x560a('0x128')));}}}}};Dialer[_0x560a('0x1f')][_0x560a('0x3c')]=function(_0x4f2800){if(this[_0x560a('0x29')][_0x4f2800[_0x560a('0xe1')]]){this[_0x560a('0x29')][_0x4f2800[_0x560a('0xe1')]][_0x560a('0xb1')]=_0x4f2800['channel'];}if(this['uniqueId'][_0x4f2800['uniqueid']]){this['uniqueId'][_0x4f2800[_0x560a('0xe1')]][_0x560a('0xb1')]=_0x4f2800['channel'];}};Dialer[_0x560a('0x1f')][_0x560a('0x40')]=function(_0x126f07){if(strategy[this[_0x560a('0x23')][this['actions'][_0x126f07[_0x560a('0x129')]]['queue']][_0x560a('0x12a')]]==='roundrobin'){if(this['actions'][_0x126f07['actionid']]&&_['isNil'](this['actions'][_0x126f07['actionid']][_0x560a('0x12b')])&&_0x126f07['status']==='1'&&_0x126f07['paused']==='0'){if(this[_0x560a('0x25')][_0x126f07[_0x560a('0x12c')]]){if(!this[_0x560a('0x25')][_0x126f07[_0x560a('0x12c')]][_0x560a('0x12b')]){this[_0x560a('0x25')][_0x126f07[_0x560a('0x12c')]][_0x560a('0x12b')]=!![];this[_0x560a('0x29')][_0x126f07[_0x560a('0x129')]][_0x560a('0x12b')]=!![];this[_0x560a('0x29')][_0x126f07[_0x560a('0x129')]][_0x560a('0x12c')]=_0x126f07[_0x560a('0x12c')];}}}}else if((strategy[this[_0x560a('0x23')][this[_0x560a('0x29')][_0x126f07[_0x560a('0x129')]][_0x560a('0xb4')]][_0x560a('0x12a')]]||'rrmemory')===_0x560a('0x12d')){if(this[_0x560a('0x29')][_0x126f07[_0x560a('0x129')]]){if(this['agents'][_0x126f07[_0x560a('0x12c')]]){this['actions'][_0x126f07[_0x560a('0x129')]][_0x560a('0x12c')]=_0x126f07[_0x560a('0x12c')];if(_[_0x560a('0xae')](this['queueBooked'][this[_0x560a('0x29')][_0x126f07[_0x560a('0x129')]][_0x560a('0xb4')]])){this[_0x560a('0x2f')][this[_0x560a('0x29')][_0x126f07['actionid']][_0x560a('0xb4')]]=[];}this[_0x560a('0x2f')][this[_0x560a('0x29')][_0x126f07[_0x560a('0x129')]]['queue']]['push'](_[_0x560a('0xcf')](_[_0x560a('0xd0')](this[_0x560a('0x29')][_0x126f07[_0x560a('0x129')]],[_0x560a('0x12e'),'stateinterface']),{'status':_0x126f07[_0x560a('0xb0')],'paused':_0x126f07['paused']}));}}}};function unlockQueueStatus(_0x5a214f,_0x355593){setTimeout(function(){if(_['isUndefined'](_0x5a214f['queueStatusComplete'])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x355593);}_0x5a214f[_0x560a('0x12f')]=!![];loggerBooked[_0x560a('0x82')]('[booked][unlockQueueStatus]',_0x355593,JSON[_0x560a('0x130')](_['pick'](_0x5a214f,[_0x560a('0x49'),_0x560a('0x12f')])));},0x1f3);}Dialer['prototype'][_0x560a('0x42')]=function(_0x134220){var _0x1ba5d0=this;var _0x41bf06=_0x1ba5d0[_0x560a('0x23')][_0x1ba5d0[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]];if(strategy[this[_0x560a('0x23')][this['actions'][_0x134220[_0x560a('0x129')]]['queue']][_0x560a('0x12a')]]===_0x560a('0x1e')){if(this['actions'][_0x134220[_0x560a('0x129')]]&&this[_0x560a('0x29')][_0x134220['actionid']][_0x560a('0x12c')]){this[_0x560a('0x95')][_0x560a('0x131')](this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0x12e')],this['actions'][_0x134220[_0x560a('0x129')]][_0x560a('0x12c')])[_0x560a('0xb2')](function(_0x5b214b){logger['error'](_0x560a('0x132'),util[_0x560a('0x99')](_0x5b214b,{'showHidden':![],'depth':null}));})[_0x560a('0x22')](function(){_0x1ba5d0['updateOriginated'](_0x1ba5d0[_0x560a('0x23')][_0x1ba5d0[_0x560a('0x29')][_0x134220[_0x560a('0x129')]]['queue']]);_0x1ba5d0[_0x560a('0x25')][_0x1ba5d0[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0x12c')]][_0x560a('0x12b')]=![];delete _0x1ba5d0[_0x560a('0x29')][_0x134220[_0x560a('0x129')]];unlockQueueStatus(_0x41bf06);});}else{this[_0x560a('0xb3')](this[_0x560a('0x23')][this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]]);this[_0x560a('0xbf')]({'active':![],'ContactId':this['actions'][_0x134220[_0x560a('0x129')]]['ContactId'],'ListId':this[_0x560a('0x29')][_0x134220['actionid']][_0x560a('0xd2')],'VoiceQueueId':this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x134220[_0x560a('0x129')]][_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0x133')));delete this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]];unlockQueueStatus(_0x41bf06);}}else if((strategy[this[_0x560a('0x23')][this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]]['queue']][_0x560a('0x12a')]]||_0x560a('0x12d'))===_0x560a('0x12d')){var _0x1a00f6;if(this['actions'][_0x134220[_0x560a('0x129')]]&&!_[_0x560a('0x4f')](this[_0x560a('0x2f')][this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]])){if(this[_0x560a('0x30')][_0x1ba5d0[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]]){this[_0x560a('0x30')][_0x1ba5d0[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]]=this[_0x560a('0x30')][this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]]?this[_0x560a('0x30')][this[_0x560a('0x29')][_0x134220['actionid']][_0x560a('0xb4')]]:this['queueBooked'][this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]]?this[_0x560a('0x2f')][this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]]['queue']][_0x560a('0x134')]||0x0:0x0;}this[_0x560a('0x2f')][this['actions'][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]]['_rr']=this[_0x560a('0x30')][this[_0x560a('0x29')][_0x134220[_0x560a('0x129')]][_0x560a('0xb4')]];for(var _0x490b74=0x0;_0x490b74=0x0;})[_0x560a('0xb2')](myreject(_0x24d880)));}}else{_0x5e40d7[_0x560a('0x151')](ami[_0x560a('0xaf')]({'action':_0x560a('0x14c'),'command':util[_0x560a('0x7f')](_0x560a('0x14d'),_0x3579ad,!_[_0x560a('0x87')](config[_0x560a('0x149')][_0x44726f])?_0x44726f:'')})[_0x560a('0x45')](function(_0x4fe4de){return _0x4fe4de['content'][_0x560a('0x14f')](_0x560a('0x150'))>=0x0;})['catch'](myreject(_0x24d880)));}BPromise['all'](_0x5e40d7)[_0x560a('0x45')](function(_0xa866b4){var _0x3e4a41=_[_0x560a('0x152')](_0xa866b4);if(_0x3e4a41){return _0xe3ab5d(_0x3e4a41);}else{_0xe50aad[_0x560a('0x47')]=_0x2830fe?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x24d880(msgResponse(_0x560a('0x153'),'Failure','Global:\x20'+_0x2830fe+'\x20'+_0x2d4eb1+_0x560a('0x154')+util[_0x560a('0x99')](_0x3579ad,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x44726f));}})[_0x560a('0xb2')](function(_0x4739ae){return _0x24d880(msgResponse(_0x560a('0x144'),_0x560a('0x145'),JSON[_0x560a('0x130')](_0x4739ae)));});});};Dialer[_0x560a('0x1f')][_0x560a('0x155')]=function(_0x4bf226){var _0x310657=this;return function(){switch(_0x4bf226[_0x560a('0x156')]){case _0x560a('0x157'):freeVariablesPredictive(_0x4bf226);_0x310657['handlePower'](_0x4bf226,0x1);break;case'power':freeVariablesPredictive(_0x4bf226);_0x310657[_0x560a('0x158')](_0x4bf226,_0x4bf226[_0x560a('0x159')]);break;case _0x560a('0x9'):_0x310657['predictive'](_0x4bf226);break;case _0x560a('0x7'):freeVariablesPredictive(_0x4bf226);_0x310657[_0x560a('0x158')](_0x4bf226,0x1);break;default:freeVariablesPredictive(_0x4bf226);logger['error']('Queue',_0x4bf226['name'],'method\x20not\x20recognized');}};};Dialer[_0x560a('0x1f')][_0x560a('0x15a')]=function(_0x63268c){return BPromise[_0x560a('0xba')]()[_0x560a('0x45')](cmHopper[_0x560a('0x15b')](_0x63268c['id'],previewRecallmeReminderInterval))[_0x560a('0x45')](function(_0x5ccfd3){for(var _0x7b5f29=0x0;_0x7b5f29<_0x5ccfd3['length'];_0x7b5f29++){var _0x3f8264=_0x5ccfd3[_0x7b5f29][_0x560a('0x15c')][_0x560a('0x49')];if(_0x3f8264)io['to'](util[_0x560a('0x7f')](_0x560a('0x15d'),_0x3f8264))[_0x560a('0xef')](_0x560a('0x15e'),{'hopper':_0x5ccfd3[_0x7b5f29]});}})[_0x560a('0xb2')](function(_0x5ceb2b){});};Dialer[_0x560a('0x1f')]['launchHandleIvr']=function(_0x3ac938){var _0x357351=this;return function(){_0x357351[_0x560a('0x15f')](_0x3ac938);};};Dialer['prototype'][_0x560a('0xb')]=function(_0x2cd0fc){var _0x3dba03=this;if(isNotPreview(_0x2cd0fc[_0x560a('0x156')])){if(isVoiceQueueOutbound(_0x2cd0fc[_0x560a('0x54')])&&isActive(_0x2cd0fc['dialActive'])){_0x2cd0fc[_0x560a('0xa5')]=!![];BPromise[_0x560a('0xba')]()[_0x560a('0x45')](checkIsLoggedIn(_0x2cd0fc,_0x2cd0fc[_0x560a('0x160')]))[_0x560a('0x45')](checkIsActive(_0x2cd0fc,_0x2cd0fc['dialActive']))[_0x560a('0x45')](checkInterval(_0x2cd0fc))[_0x560a('0x45')](_0x3dba03[_0x560a('0x140')](_0x2cd0fc))[_0x560a('0x45')](_0x3dba03['checkIfTime'](_0x2cd0fc[_0x560a('0x161')],_0x2cd0fc[_0x560a('0x162')],_0x2cd0fc['name'],_0x2cd0fc))['then'](_0x3dba03[_0x560a('0x163')](_0x2cd0fc[_0x560a('0x4b')],_0x2cd0fc['dialTimezone'],_0x2cd0fc[_0x560a('0x49')],_0x2cd0fc))[_0x560a('0x45')](_0x3dba03[_0x560a('0x155')](_0x2cd0fc))['catch'](loggerCatchQueueSummary(_0x560a('0x164'),_0x2cd0fc));}else{notSendMessagesQueue(_0x2cd0fc);}}else{freeVariablesPredictive(_0x2cd0fc);if(_0x2cd0fc[_0x560a('0x165')]){_0x3dba03[_0x560a('0x15a')](_0x2cd0fc);}}};Dialer[_0x560a('0x1f')][_0x560a('0x166')]=function(){var _0x52e816=this;var _0xa8d1b1;for(var _0x4b7ace in this[_0x560a('0x24')]){if(typeof this[_0x560a('0x24')][_0x4b7ace]!==_0x560a('0x9c')){_0xa8d1b1=this[_0x560a('0x24')][_0x4b7ace];if(isCampaignIvr(_0xa8d1b1[_0x560a('0x54')])&&isActive(_0xa8d1b1[_0x560a('0x7b')])){_0xa8d1b1['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x560a('0x45')](checkIsActive(_0xa8d1b1,_0xa8d1b1[_0x560a('0x7b')]))[_0x560a('0x45')](checkInterval(_0xa8d1b1))['then'](_0x52e816[_0x560a('0x140')](_0xa8d1b1))[_0x560a('0x45')](_0x52e816['checkIfTime'](_0xa8d1b1[_0x560a('0x161')],_0xa8d1b1[_0x560a('0x162')],_0xa8d1b1['name'],_0xa8d1b1))['then'](_0x52e816['checkIfTimeIntervals'](_0xa8d1b1['Interval'],_0xa8d1b1['dialTimezone'],_0xa8d1b1['name'],_0xa8d1b1))[_0x560a('0x45')](_0x52e816[_0x560a('0x167')](_0xa8d1b1))['catch'](loggerCatchQueueSummary(_0x560a('0x168'),_0xa8d1b1));}else{notSendMessagesCampaign(_0xa8d1b1);}}}};function getCallerIdRandom(_0x391f2f,_0x5ea878){var _0x449c12;var _0x19ba97;var _0x5d817e;if(_0x5ea878<=0x0){_0x5ea878=0x1;}_0x449c12=new RegExp(_0x560a('0x169')+_0x5ea878+'}$');_0x19ba97=Math[_0x560a('0x16a')](0xa,_0x5ea878-0x1);_0x5d817e=Math['pow'](0xa,_0x5ea878)-0x1;return util['format']('%s',_[_0x560a('0x16b')](_0x391f2f,_0x449c12,_[_0x560a('0x16c')](_0x19ba97,_0x5d817e)));}function extractCalleridName(_0xd9965c){var _0x225134=_0xd9965c[_0x560a('0x16d')](/"(.*?)"/);return _0x225134?_0x225134[0x1]:_0xd9965c;}function extractCalleridNumber(_0x13d17a){var _0x58a664=_0x13d17a['match'](/<(.*?)>/);return _0x58a664?_0x58a664[0x1]:_0x13d17a;}Dialer['prototype'][_0x560a('0x16e')]=function(_0x4c7dc7,_0xbccd87){var _0x5af2ee=this;var _0x3be022=uuid['v4']();this['actions'][_0x3be022]=new Action(_0x4c7dc7,_0xbccd87,_0x3be022);return new BPromise(function(_0x23239a,_0x269e24){if(_[_0x560a('0x87')](_0x4c7dc7)&&typeof _0x4c7dc7!=='object'){return _0x269e24(msgResponse('originate',_0x560a('0x145'),'voiceQueue\x20is\x20undefine'));}if(_[_0x560a('0x87')](_0xbccd87[_0x560a('0x16f')][_0x560a('0x170')])||_0xbccd87['Contact'][_0x560a('0x170')]===null){return _0x269e24(msgResponse(_0x560a('0x171'),'Failure',_0x560a('0x172')));}var _0x5991d0={'XMD-CALLERID':_0x5af2ee[_0x560a('0x29')][_0x3be022][_0x560a('0x173')](),'XMD-AGI':_0x4c7dc7[_0x560a('0x10a')]?util[_0x560a('0x7f')](_0x560a('0x174'),ipAgi,_0x4c7dc7[_0x560a('0x10a')]):_0x560a('0x175'),'XMD-AGIAFTER':_0x4c7dc7[_0x560a('0x113')]?util[_0x560a('0x7f')](_0x560a('0x174'),ipAgi,_0x4c7dc7['dialQueueProject2']):_0x560a('0x175'),'XMD-QUEUE':_0x4c7dc7['type']===_0x560a('0x55')?util['format'](_0x560a('0x176'),_0x4c7dc7['name'],_0x4c7dc7[_0x560a('0x177')]||'',_0x4c7dc7[_0x560a('0x178')]?'c':'',_0x4c7dc7[_0x560a('0x179')]||0x3):_0x560a('0x175'),'XMD-CONTACTID':_0xbccd87[_0x560a('0xd1')],'XMD-CDRTYPE':_0x560a('0x6'),'CALLERID(all)':_0x5af2ee[_0x560a('0x29')][_0x3be022][_0x560a('0x173')](),'XMD-AMD':_0x4c7dc7['dialAMDActive']?_0x560a('0x17a'):_0x560a('0x175'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4c7dc7[_0x560a('0xea')]){_0x5991d0[_0x560a('0x17b')]=_0x4c7dc7[_0x560a('0x17c')]||0x9c4;_0x5991d0[_0x560a('0x17d')]=_0x4c7dc7[_0x560a('0x17e')]||0x5dc;_0x5991d0[_0x560a('0x17f')]=_0x4c7dc7[_0x560a('0x180')]||0x320;_0x5991d0['XMD-AMDTOTALANALYSISTIME']=_0x4c7dc7[_0x560a('0x181')]||0x1388;_0x5991d0[_0x560a('0x182')]=_0x4c7dc7[_0x560a('0x183')]||0x64;_0x5991d0[_0x560a('0x184')]=_0x4c7dc7[_0x560a('0x185')]||0x32;_0x5991d0[_0x560a('0x186')]=_0x4c7dc7[_0x560a('0x187')]||0x3;_0x5991d0[_0x560a('0x188')]=_0x4c7dc7['dialAMDSilenceThreshold']||0x100;_0x5991d0[_0x560a('0x189')]=_0x4c7dc7[_0x560a('0x18a')]||0x1388;}if(_0x4c7dc7[_0x560a('0x54')]==='outbound'){_0x5991d0[_0x560a('0x18b')]=_0xbccd87[_0x560a('0xd4')];}else{_0x5991d0[_0x560a('0x18c')]=_0xbccd87['CampaignId'];}for(var _0x298ae1 in _0xbccd87[_0x560a('0x16f')]){if(typeof _0xbccd87[_0x560a('0x16f')][_0x298ae1]!=='undefined'){if(isNotNull(_0xbccd87[_0x560a('0x16f')][_0x298ae1])&&_0x298ae1!=='id'&&_0x298ae1!=='tags'&&_0x298ae1!==_0x560a('0x18d')&&_0x298ae1!==_0x560a('0x18e')){_0x5991d0[util['format'](_0x560a('0x18f'),'XMD-',_['toUpper'](_0x298ae1))]=_0xbccd87[_0x560a('0x16f')][_0x298ae1];}}}var _0x44f999=_0x5af2ee[_0x560a('0xd8')](_0x4c7dc7[_0x560a('0x7a')])?getCallerId(_0x4c7dc7[_0x560a('0x7a')]['callerid'],_0x4c7dc7[_0x560a('0x60')],_0x4c7dc7[_0x560a('0x190')]>0x0?getCallerIdRandom(_0x4c7dc7[_0x560a('0x61')],_0x4c7dc7[_0x560a('0x190')]):_0x4c7dc7[_0x560a('0x61')]):getCallerId(_[_0x560a('0xae')](_0x4c7dc7[_0x560a('0x141')])?_0x4c7dc7[_0x560a('0x7a')][_0x560a('0x7c')]:_0x4c7dc7['TrunkBackup'][_0x560a('0x7c')],_0x4c7dc7[_0x560a('0x60')],_0x4c7dc7[_0x560a('0x190')]>0x0?getCallerIdRandom(_0x4c7dc7[_0x560a('0x61')],_0x4c7dc7[_0x560a('0x190')]):_0x4c7dc7[_0x560a('0x61')]);if(_0x44f999){_0x5991d0['XMD-ORIGINATECALLERIDNAME']=_0x5af2ee[_0x560a('0x29')][_0x3be022][_0x560a('0x191')]=extractCalleridName(_0x44f999);_0x5991d0[_0x560a('0x192')]=_0x5af2ee['actions'][_0x3be022][_0x560a('0x193')]=extractCalleridNumber(_0x44f999);}return ami['Action']({'actionid':_0x3be022,'action':_0x560a('0x171'),'channel':_0x5af2ee[_0x560a('0xd8')](_0x4c7dc7['Trunk'])?util[_0x560a('0x7f')](_0x560a('0x194'),_0x4c7dc7[_0x560a('0x7a')][_0x560a('0x49')],isNotNull(_0x4c7dc7[_0x560a('0x195')])?_0x4c7dc7[_0x560a('0x195')][_0x560a('0x196')]()||'':'',_0x4c7dc7[_0x560a('0x197')]>0x0?_0xbccd87['Contact']['phone'][_0x560a('0x198')](_0x4c7dc7['dialCutDigit']):_0xbccd87[_0x560a('0x16f')]['phone']):util[_0x560a('0x7f')](_0x560a('0x194'),_[_0x560a('0xae')](_0x4c7dc7[_0x560a('0x141')])?_0x4c7dc7[_0x560a('0x7a')][_0x560a('0x49')]:_0x4c7dc7[_0x560a('0x141')][_0x560a('0x49')],isNotNull(_0x4c7dc7['dialPrefix'])?_0x4c7dc7[_0x560a('0x195')][_0x560a('0x196')]()||'':'',_0x4c7dc7[_0x560a('0x197')]>0x0?_0xbccd87[_0x560a('0x16f')]['phone']['substring'](_0x4c7dc7[_0x560a('0x197')]):_0xbccd87[_0x560a('0x16f')]['phone']),'callerid':_0x44f999,'Exten':'xcally-motion-dialer','Context':_0x560a('0x199'),'Priority':'1','variable':_0x5991d0,'timeout':(_0x4c7dc7[_0x560a('0x62')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3be022})[_0x560a('0x45')](function(_0x1bc630){return _0x23239a(_0x1bc630);})[_0x560a('0xb2')](function(_0x340eca){_0x4c7dc7[_0x560a('0x19a')]+=0x1;var _0x1dd4c4=new History(_0x5af2ee[_0x560a('0x29')][_0x3be022]);logger[_0x560a('0x9a')](util[_0x560a('0x7f')](_0x560a('0x19b'),JSON[_0x560a('0x130')](_0x340eca)));_0x1dd4c4[_0x560a('0xa8')]=0xe;_0x1dd4c4['statedesc']='OriginateError';_0x1dd4c4[_0x560a('0x11f')]=moment()[_0x560a('0x7f')](_0x560a('0xfd'));_0x1dd4c4[_0x560a('0xa9')]=_0x1dd4c4[_0x560a('0x11f')];_0x5af2ee[_0x560a('0xc9')](_0x1dd4c4)[_0x560a('0xb2')](loggerCatch(_0x560a('0x19c')));_0x5af2ee['moveContactManagedDialer'](_0x1dd4c4)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0x5af2ee[_0x560a('0x29')][_0x3be022];return _0x269e24(msgResponse(_0x560a('0x171'),_0x560a('0x50'),_0x560a('0x19d')));});});});};Dialer['prototype'][_0x560a('0x19e')]=function(_0x55604b){var _0x74a774=this[_0x560a('0x29')][_0x55604b[_0x560a('0x129')]];if(_0x74a774){delete this[_0x560a('0x29')][_0x55604b[_0x560a('0x129')]];_0x74a774['responsetime']=moment()[_0x560a('0x7f')](_0x560a('0xfd'));var _0x58e515=_0x74a774[_0x560a('0x54')]===_0x560a('0x7e')?this['campaigns'][_0x74a774[_0x560a('0xb4')]]:this[_0x560a('0x23')][_0x74a774['getQueue']()];if(!this[_0x560a('0xd7')](_0x55604b[_0x560a('0x19f')])){this[_0x560a('0xb3')](_0x58e515);return this[_0x560a('0x1a0')](_0x74a774,_0x58e515,_0x55604b)[_0x560a('0xb2')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x560a('0x2b')][_0x55604b[_0x560a('0xe1')]]=_0x74a774;}};Dialer[_0x560a('0x1f')][_0x560a('0x1a1')]=function(_0x46fd7e,_0x57fa2d,_0x3270a9){var _0x58babe=new History(_0x57fa2d);if(_0x58babe[_0x560a('0xf1')]+_0x58babe[_0x560a('0xf2')]+_0x58babe[_0x560a('0xf3')]+_0x58babe['countnosuchnumberretry']+_0x58babe['countdropretry']+_0x58babe[_0x560a('0xf6')]+_0x58babe[_0x560a('0xed')]+_0x58babe[_0x560a('0x103')]>=_0x3270a9[_0x560a('0xf7')]-0x1){return!![];}switch(_0x46fd7e){case 0x3:if(_0x58babe['countnoanswerretry']>=_0x3270a9['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x560a('0xbf')]({'active':![],'countnoanswerretry':_0x58babe[_0x560a('0xf3')]+=0x1,'scheduledat':moment()[_0x560a('0x106')](_0x3270a9[_0x560a('0x1a2')],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x58babe[_0x560a('0xd1')],'ListId':_0x58babe[_0x560a('0xd2')],'VoiceQueueId':_0x58babe[_0x560a('0xd4')]||undefined,'CampaignId':_0x58babe[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x58babe[_0x560a('0xf1')]>=_0x3270a9[_0x560a('0x1a3')]-0x1){return!![];}this[_0x560a('0xbf')]({'active':![],'countbusyretry':_0x58babe[_0x560a('0xf1')]+=0x1,'scheduledat':moment()[_0x560a('0x106')](_0x3270a9['dialBusyRetryFrequency'],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x58babe[_0x560a('0xd1')],'ListId':_0x58babe['ListId'],'VoiceQueueId':_0x58babe[_0x560a('0xd4')]||undefined,'CampaignId':_0x58babe[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0x1a4')));break;case 0x8:if(_0x58babe[_0x560a('0xf2')]>=_0x3270a9[_0x560a('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x58babe['countcongestionretry']+=0x1,'scheduledat':moment()[_0x560a('0x106')](_0x3270a9['dialCongestionRetryFrequency'],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x58babe[_0x560a('0xd1')],'ListId':_0x58babe[_0x560a('0xd2')],'VoiceQueueId':_0x58babe[_0x560a('0xd4')]||undefined,'CampaignId':_0x58babe[_0x560a('0xfe')]||undefined})['catch'](loggerCatch(_0x560a('0x1a6')));break;case 0x0:if(_0x58babe[_0x560a('0xf4')]>=_0x3270a9[_0x560a('0x1a7')]-0x1){return!![];}else{this[_0x560a('0xbf')]({'active':![],'countnosuchnumberretry':_0x58babe[_0x560a('0xf4')]+=0x1,'scheduledat':moment()[_0x560a('0x106')](_0x3270a9[_0x560a('0x1a8')],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x58babe[_0x560a('0xd1')],'ListId':_0x58babe[_0x560a('0xd2')],'VoiceQueueId':_0x58babe['VoiceQueueId']||undefined,'CampaignId':_0x58babe['CampaignId']||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0x1a9')));}break;case 0xa:if(_0x58babe[_0x560a('0xf5')]>=_0x3270a9['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x58babe[_0x560a('0xf5')]+=0x1,'scheduledat':moment()[_0x560a('0x106')](_0x3270a9[_0x560a('0x11d')],'minutes')[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x58babe[_0x560a('0xd1')],'ListId':_0x58babe[_0x560a('0xd2')],'VoiceQueueId':_0x58babe['VoiceQueueId']||undefined,'CampaignId':_0x58babe[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0x11e')));break;case 0xb:if(_0x58babe[_0x560a('0xf6')]>=_0x3270a9[_0x560a('0x124')]-0x1){return!![];}this[_0x560a('0xbf')]({'active':![],'countabandonedretry':_0x58babe[_0x560a('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x3270a9[_0x560a('0x126')],_0x560a('0xfc'))[_0x560a('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x58babe['ContactId'],'ListId':_0x58babe['ListId'],'VoiceQueueId':_0x58babe[_0x560a('0xd4')]||undefined,'CampaignId':_0x58babe['CampaignId']||undefined})[_0x560a('0xb2')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x58babe[_0x560a('0xed')]>=_0x3270a9[_0x560a('0x105')]-0x1){return!![];}this[_0x560a('0xbf')]({'active':![],'countmachineretry':_0x58babe[_0x560a('0xed')]+=0x1,'scheduledat':moment()['add'](_0x3270a9[_0x560a('0xfb')],_0x560a('0xfc'))[_0x560a('0x7f')](_0x560a('0xfd')),'ContactId':_0x58babe[_0x560a('0xd1')],'ListId':_0x58babe['ListId'],'VoiceQueueId':_0x58babe[_0x560a('0xd4')]||undefined,'CampaignId':_0x58babe[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0xff')));break;case 0x14:if(_0x58babe[_0x560a('0x103')]>=_0x3270a9[_0x560a('0x1aa')]-0x1){return!![];}this[_0x560a('0xbf')]({'active':![],'countagentrejectretry':_0x58babe[_0x560a('0x103')]+=0x1,'scheduledat':moment()[_0x560a('0x106')](_0x3270a9['dialAgentRejectRetryFrequency'],_0x560a('0xfc'))[_0x560a('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x58babe[_0x560a('0xd1')],'ListId':_0x58babe[_0x560a('0xd2')],'VoiceQueueId':_0x58babe[_0x560a('0xd4')]||undefined,'CampaignId':_0x58babe[_0x560a('0xfe')]||undefined})[_0x560a('0xb2')](loggerCatch(_0x560a('0x1ab')));break;default:return!![];}};Dialer['prototype'][_0x560a('0x1a0')]=function(_0x22bf9c,_0x55f2e6,_0x50dcf5){var _0x29fc11=this;var _0x3c22bd=new History(_0x22bf9c);return new BPromise(function(_0x45b924,_0x56d543){if(_[_0x560a('0x87')](_0x55f2e6)&&typeof _0x55f2e6!=='object'){return _0x56d543(msgResponse(_0x560a('0x1ac'),_0x560a('0x145'),'entity\x20is\x20undefine'));}if(_[_0x560a('0x87')](_0x50dcf5)&&typeof _0x50dcf5!==_0x560a('0x1ad')){return _0x56d543(msgResponse(_0x560a('0x1ac'),'Failure','evt\x20is\x20undefine'));}switch(_0x50dcf5['reason']){case'0':_0x55f2e6[_0x560a('0x6b')]+=0x1;_0x3c22bd[_0x560a('0xa8')]=0x0;_0x3c22bd[_0x560a('0xe2')]=_0x560a('0x1ae');_0x3c22bd['countnosuchnumberretry']+=0x1;_0x3c22bd['countglobal']+=0x1;ami[_0x560a('0xef')](_0x560a('0x1af'),ut[_0x560a('0xe7')](_0x22bf9c,_0x560a('0x1b0')));_0x29fc11[_0x560a('0xc9')](_0x3c22bd)['catch'](loggerCatch(_0x560a('0xf0')));if(_0x29fc11[_0x560a('0x1a1')](0x0,_0x22bf9c,_0x55f2e6)){if(_0x3c22bd['countnosuchnumberretry']>=_0x55f2e6['dialNoSuchNumberMaxRetry']){_0x29fc11[_0x560a('0xf9')](_0x3c22bd,_0x45b924,_0x56d543,'reason\x200\x20no\x20such\x20number....');}else{_0x29fc11['stateGlobal'](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1b1'));}}break;case'3':_0x55f2e6[_0x560a('0x6a')]+=0x1;_0x3c22bd[_0x560a('0xa8')]=0x3;_0x3c22bd[_0x560a('0xe2')]='NoAnswer';_0x3c22bd[_0x560a('0xf3')]+=0x1;_0x3c22bd[_0x560a('0xee')]+=0x1;ami[_0x560a('0xef')](_0x560a('0x1b2'),ut[_0x560a('0xe7')](_0x22bf9c,_0x560a('0x1b3')));_0x29fc11[_0x560a('0xc9')](_0x3c22bd)[_0x560a('0xb2')](loggerCatch(_0x560a('0x1b4')));if(_0x29fc11[_0x560a('0x1a1')](0x3,_0x22bf9c,_0x55f2e6)){if(_0x3c22bd['countnoanswerretry']>=_0x55f2e6[_0x560a('0x1b5')]){_0x29fc11[_0x560a('0xf9')](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1b6'));}else{_0x29fc11[_0x560a('0xf8')](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1b6'));}}break;case'5':_0x55f2e6[_0x560a('0x65')]+=0x1;_0x3c22bd[_0x560a('0xa8')]=0x5;_0x3c22bd[_0x560a('0xe2')]='Busy';_0x3c22bd[_0x560a('0xf1')]+=0x1;_0x3c22bd['countglobal']+=0x1;ami[_0x560a('0xef')](_0x560a('0x1b7'),ut[_0x560a('0xe7')](_0x22bf9c,_0x560a('0x1b8')));_0x29fc11[_0x560a('0xc9')](_0x3c22bd)[_0x560a('0xb2')](loggerCatch(_0x560a('0x1b9')));if(_0x29fc11[_0x560a('0x1a1')](0x5,_0x22bf9c,_0x55f2e6)){if(_0x3c22bd[_0x560a('0xf1')]>=_0x55f2e6[_0x560a('0x1a3')]){_0x29fc11[_0x560a('0xf9')](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1ba'));}else{_0x29fc11['stateGlobal'](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1ba'));}}break;case'8':_0x55f2e6[_0x560a('0x66')]+=0x1;_0x3c22bd[_0x560a('0xa8')]=0x8;_0x3c22bd[_0x560a('0xe2')]=_0x560a('0x1bb');_0x3c22bd[_0x560a('0xf2')]+=0x1;_0x3c22bd[_0x560a('0xee')]+=0x1;ami[_0x560a('0xef')](_0x560a('0x1bc'),ut['buildObj'](_0x22bf9c,'congestion'));_0x29fc11[_0x560a('0xc9')](_0x3c22bd)[_0x560a('0xb2')](loggerCatch(_0x560a('0x1bd')));if(_0x29fc11[_0x560a('0x1a1')](0x8,_0x22bf9c,_0x55f2e6)){if(_0x3c22bd[_0x560a('0xf2')]>=_0x55f2e6[_0x560a('0x1a5')]){_0x29fc11['createStateFinal'](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1be'));}else{_0x29fc11[_0x560a('0xf8')](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1be'));}}break;case'11':_0x55f2e6['outboundAbandonedCallsDay']+=0x1;_0x3c22bd[_0x560a('0xa8')]=0xb;_0x3c22bd['statedesc']='Abandoned';_0x3c22bd[_0x560a('0xf6')]+=0x1;_0x3c22bd[_0x560a('0xee')]+=0x1;_0x29fc11[_0x560a('0xc9')](_0x3c22bd)['catch'](loggerCatch(_0x560a('0x128')));if(_0x29fc11[_0x560a('0x1a1')](0xb,_0x22bf9c,_0x55f2e6)){if(_0x3c22bd[_0x560a('0xf6')]>=_0x55f2e6[_0x560a('0x124')]){_0x29fc11[_0x560a('0xf9')](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1bf'));}else{_0x29fc11[_0x560a('0xf8')](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1bf'));}}break;case'20':_0x55f2e6['outboundRejectCallsDay']+=0x1;_0x3c22bd['state']=0x14;_0x3c22bd['statedesc']=_0x560a('0x1c0');_0x3c22bd[_0x560a('0x103')]+=0x1;_0x3c22bd[_0x560a('0xee')]+=0x1;ami[_0x560a('0xef')](_0x560a('0x1c1'),ut[_0x560a('0xe7')](_0x22bf9c,'agentreject'));_0x29fc11[_0x560a('0xc9')](_0x3c22bd)[_0x560a('0xb2')](loggerCatch(_0x560a('0x1c2')));if(_0x29fc11['checkRetriveMax'](0x14,_0x22bf9c,_0x55f2e6)){if(_0x3c22bd['countagentrejectretry']>=_0x55f2e6[_0x560a('0x1aa')]){_0x29fc11[_0x560a('0xf9')](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1c3'));}else{_0x29fc11['stateGlobal'](_0x3c22bd,_0x45b924,_0x56d543,_0x560a('0x1c3'));}}break;default:_0x55f2e6[_0x560a('0x10d')]+=0x1;_0x3c22bd['state']=0xc;_0x3c22bd[_0x560a('0xe2')]=_0x50dcf5[_0x560a('0x110')];_0x29fc11['createHistory'](_0x3c22bd)[_0x560a('0xb2')](loggerCatch(_0x560a('0x1c4')));if(_0x29fc11[_0x560a('0x1a1')](_0x50dcf5[_0x560a('0x110')],_0x22bf9c,_0x55f2e6)){if(_0x3c22bd[_0x560a('0xf1')]+_0x3c22bd['countcongestionretry']+_0x3c22bd[_0x560a('0xf3')]+_0x3c22bd[_0x560a('0xf4')]+_0x3c22bd[_0x560a('0xf5')]+_0x3c22bd[_0x560a('0xf6')]+_0x3c22bd[_0x560a('0xed')]+_0x3c22bd[_0x560a('0x103')]>=_0x55f2e6[_0x560a('0xf7')]){_0x29fc11['stateGlobal'](_0x3c22bd,_0x45b924,_0x56d543,_0x50dcf5['reason']);}else{_0x29fc11[_0x560a('0xf9')](_0x3c22bd,_0x45b924,_0x56d543,_0x50dcf5[_0x560a('0x110')]);}}}});};Dialer['prototype']['stateGlobal']=function(_0x43f37c,_0x12540e,_0x3a6f93,_0x1020aa){var _0x281b86=new Final(_0x43f37c);_0x281b86[_0x560a('0xa8')]=0xf;_0x281b86[_0x560a('0xe2')]=_0x560a('0x1c5');this[_0x560a('0xf9')](_0x281b86,_0x12540e,_0x3a6f93,_0x1020aa);};Dialer[_0x560a('0x1f')][_0x560a('0xf9')]=function(_0x5c33ea,_0x1bff57,_0x43255f,_0x5a4c10){this[_0x560a('0xc8')](_0x5c33ea)[_0x560a('0x45')](function(){return _0x1bff57(msgResponse(_0x560a('0x1ac'),_0x560a('0x1c6'),_0x5a4c10));})['catch'](function(){return _0x43255f(msgResponse(_0x560a('0x1c7'),_0x560a('0x145'),_0x560a('0x1c8')));});};Dialer[_0x560a('0x1f')][_0x560a('0x9')]=function(_0x1cf299){var _0x53f444=_0x1cf299['dialPredictiveOptimizationPercentage']/0x64;var _0x2ad065=_0x1cf299[_0x560a('0x69')]/(_0x1cf299[_0x560a('0x69')]+_0x1cf299[_0x560a('0x64')]);var _0x5e47f8=Math[_0x560a('0x1c9')](_0x1cf299[_0x560a('0x75')]*(_0x1cf299[_0x560a('0x1ca')]/0x64));var _0x553878=Math['round'](_0x1cf299['predictiveIntervalAvailable']*(_0x1cf299['predictiveIntervalMinThreshold']/0x64));var _0xc0ab1b=_0x1cf299[_0x560a('0x57')]+_0x1cf299['talking'];var _0x3b5793=Math['floor'](_0x1cf299[_0x560a('0x78')]*_0x1cf299[_0x560a('0x79')]*_0x1cf299['predictiveIntervalHitRate']*_0x1cf299['predictiveIntervalMultiplicativeFactor']);if(_[_0x560a('0x87')](_0x1cf299[_0x560a('0x2d')])){if(!_[_0x560a('0x87')](_0x1cf299['startPredictive'])){_0x1cf299[_0x560a('0x2c')]=undefined;loggerPredictive[_0x560a('0x9a')](_0x560a('0x1cb'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x1cf299[_0x560a('0x93')])){loggerPredictive[_0x560a('0x9a')](_0x560a('0x1cb'),_0x560a('0x1cc'));clearInterval(_0x1cf299['handlePredictive']);_0x1cf299[_0x560a('0x93')]=undefined;}_0x1cf299[_0x560a('0x2d')]=moment()[_0x560a('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x560a('0x82')](_0x1cf299[_0x560a('0x49')],'collection\x20data\x20in\x20progressive\x20at',_0x1cf299['startProgressive']);this['handlePower'](_0x1cf299,0x1);}else if(ifInterval(_0x1cf299[_0x560a('0x1cd')],_0x1cf299[_0x560a('0x2d')])){this[_0x560a('0x158')](_0x1cf299,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x1cf299['startProgressive'],_0x1cf299[_0x560a('0x49')]);_0x1cf299[_0x560a('0x78')]=0x0;_0x1cf299[_0x560a('0x72')]=0x0;}else if(_0x53f444<_0x2ad065&&_0x1cf299[_0x560a('0x1ce')]===_0x560a('0x1cf')){freeVariablesPredictive(_0x1cf299);loggerPredictive[_0x560a('0x82')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x2ad065,_0x560a('0x2d'),_0x1cf299['name']);}else if(_0x3b5793<_0x1cf299[_0x560a('0x72')]&&_0x1cf299[_0x560a('0x1ce')]==='dropRate'){freeVariablesPredictive(_0x1cf299);loggerPredictive['info'](_0x560a('0x1d0'),_0x560a('0x1d1'),_0x3b5793,'Drop\x20in\x20this\x20interval',_0x1cf299['predictiveIntervalErlangCallsDroppedCalls'],_0x560a('0x2d'),_0x1cf299[_0x560a('0x49')]);}else if(!ifInterval(_0x1cf299[_0x560a('0x1cd')],_0x1cf299[_0x560a('0x2d')])&&_[_0x560a('0x87')](_0x1cf299[_0x560a('0x2c')])&&!_[_0x560a('0x87')](_0x1cf299['startProgressive'])){_0x1cf299[_0x560a('0x2c')]=moment()[_0x560a('0x7f')](_0x560a('0xfd'));loggerPredictive['info'](_0x1cf299[_0x560a('0x49')],_0x560a('0x1d2'),_0x1cf299[_0x560a('0x2c')]);this['averageHandleTime'](_0x1cf299[_0x560a('0x1cd')])[_0x560a('0x45')](this[_0x560a('0x1d3')](_0x1cf299))['then'](mergeDataErlangB(_0x1cf299))['then'](this[_0x560a('0x1d4')](_0x1cf299))[_0x560a('0xb2')](loggerCatchPredictive(_0x560a('0x1d5'),_0x1cf299));}else if(!ifInterval(_0x1cf299[_0x560a('0x1cd')],_0x1cf299['startPredictive'])){_0x1cf299[_0x560a('0x72')]=0x0;_0x1cf299[_0x560a('0x2c')]=moment()['format'](_0x560a('0xfd'));loggerPredictive[_0x560a('0x82')](_0x1cf299[_0x560a('0x49')],_0x560a('0x1d6'),_0x1cf299[_0x560a('0x2c')]);clearInterval(_0x1cf299[_0x560a('0x93')]);_0x1cf299['handlePredictive']=undefined;this[_0x560a('0xbd')](_0x1cf299['dialPredictiveInterval'])[_0x560a('0x45')](this[_0x560a('0x1d3')](_0x1cf299))[_0x560a('0x45')](mergeDataErlangB(_0x1cf299))[_0x560a('0x45')](this[_0x560a('0x1d4')](_0x1cf299))[_0x560a('0xb2')](loggerCatchPredictive(_0x560a('0x1d7'),_0x1cf299));}else if(_0x1cf299['predictiveIntervalAvailable']&&_0xc0ab1b<_0x1cf299[_0x560a('0x75')]-_0x553878){freeVariablesPredictive(_0x1cf299);loggerPredictive[_0x560a('0x82')](_0x1cf299[_0x560a('0x49')],_0x560a('0x1d8'),_0xc0ab1b,_0x560a('0x1d9'),_0x1cf299[_0x560a('0x75')],'-',_0x553878,'=',_0x1cf299[_0x560a('0x75')]-_0x553878,')');}else if(_0x1cf299[_0x560a('0x75')]&&_0xc0ab1b>_0x1cf299[_0x560a('0x75')]+_0x5e47f8){freeVariablesPredictive(_0x1cf299);loggerPredictive[_0x560a('0x82')](_0x1cf299[_0x560a('0x49')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xc0ab1b,')\x20are\x20more\x20than\x20threshold\x20(',_0x1cf299[_0x560a('0x75')],'+',_0x5e47f8,'=',_0x1cf299[_0x560a('0x75')]+_0x5e47f8,')');}};Dialer['prototype'][_0x560a('0x1d3')]=function(_0x1f34a7){var _0x5e8826=this;return function(_0x251e89){return new BPromise(function(_0x2a0e3c,_0x79a33c){_[_0x560a('0xcf')](_0x1f34a7,_0x251e89[0x0]);if(checkGetDataPredictive(_0x251e89[0x0])){var _0x4ab12e=_0x1f34a7[_0x560a('0x75')]=_0x1f34a7[_0x560a('0xa0')]+_0x1f34a7['available'];var _0x466fc2=_0x1f34a7['dialPredictiveInterval']*0x3c;var _0x1fd38f=_0x251e89[0x0][_0x560a('0x84')]+_0x251e89[0x0]['predictiveIntervalAvgHoldtime'];var _0x5de4bc=(_0x251e89[0x0][_0x560a('0x6d')]+_0x251e89[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x251e89[0x0][_0x560a('0x6f')])/_0x251e89[0x0][_0x560a('0x76')];_0x1f34a7[_0x560a('0x73')]=_0x5de4bc>0x0?_0x5de4bc:0x1;switch(_0x1f34a7[_0x560a('0x1ce')]){case _0x560a('0x1cf'):var _0x4263c3=_0x1f34a7['dialPredictiveOptimizationPercentage']/0x64;return _0x5e8826['abandonmentRate'](_0x4ab12e,_0x466fc2,_0x1fd38f,_0x5de4bc,_0x4263c3)[_0x560a('0x45')](function(_0x1cd4b7){return _0x2a0e3c(_0x1cd4b7);});case _0x560a('0x1da'):var _0x73c96b=_0x1f34a7[_0x560a('0x1db')]/0x64;return _0x5e8826[_0x560a('0x1dc')](_0x4ab12e,_0x466fc2,_0x1fd38f,_0x5de4bc,_0x73c96b)[_0x560a('0x45')](function(_0x16a671){return _0x2a0e3c(_0x16a671);});default:return _0x79a33c(msgResponse(_0x560a('0x1dd'),_0x560a('0x145'),'Unknown\x20Predictive'));}}else{return _0x79a33c(msgResponse('[getDataPredictive]','Failure',_0x560a('0x1de')));}});};};Dialer[_0x560a('0x1f')]['getDataPredictiveOld']=function(_0x8de7c7){var _0xffe236=this;return function(_0x17b0c6){return new BPromise(function(_0x277969,_0x264dde){_[_0x560a('0xcf')](_0x8de7c7,_0x17b0c6[0x0]);if(checkGetDataPredictive(_0x17b0c6[0x0])){loggerPredictive[_0x560a('0x82')](JSON['stringify'](_0x17b0c6[0x0]));if(_0x8de7c7[_0x560a('0x1ce')]===_0x560a('0x1cf')){return _0xffe236[_0x560a('0xc6')](_0x8de7c7['id'])[_0x560a('0x45')](function(_0x1b345b){var _0x172f82=_0x8de7c7[_0x560a('0x160')]-_0x1b345b[0x0][_0x560a('0x1df')];var _0x1bcf3e=_0x8de7c7['dialPredictiveInterval']*0x3c;var _0x514d6f=_0x17b0c6[0x0][_0x560a('0x84')]+_0x17b0c6[0x0]['predictiveIntervalAvgHoldtime'];var _0x3b6e88=(_0x17b0c6[0x0][_0x560a('0x6d')]+_0x17b0c6[0x0][_0x560a('0x70')]+_0x17b0c6[0x0][_0x560a('0x6f')])/_0x17b0c6[0x0][_0x560a('0x76')];var _0x31ce42=_0x8de7c7[_0x560a('0x1db')]/0x64;_0x8de7c7[_0x560a('0x74')]=_0x1b345b[0x0][_0x560a('0x1df')]||0x0;_0x8de7c7[_0x560a('0x73')]=_0x3b6e88>0x0?_0x3b6e88:0x1;return _0xffe236[_0x560a('0x1e0')](_0x172f82,_0x1bcf3e,_0x514d6f,_0x3b6e88,_0x31ce42);})[_0x560a('0x45')](function(_0x54d2e6){return _0x277969(_0x54d2e6);})[_0x560a('0xb2')](function(_0x53c511){return _0x264dde(msgResponse('[CatchErlangB]','Failure',JSON[_0x560a('0x130')](_0x53c511)));});}if(_0x8de7c7['dialPredictiveOptimization']===_0x560a('0x1da')){return _0xffe236[_0x560a('0xc6')](_0x8de7c7['id'])[_0x560a('0x45')](function(_0x4747f0){var _0x24bfee=_0x8de7c7['loggedIn']-_0x4747f0[0x0][_0x560a('0x1df')];var _0x43aaf6=_0x8de7c7[_0x560a('0x1cd')]*0x3c;var _0x10a0dc=_0x17b0c6[0x0]['predictiveIntervalAvgTalktime']+_0x17b0c6[0x0][_0x560a('0x6e')];var _0x3dcaec=(_0x17b0c6[0x0][_0x560a('0x6d')]+_0x17b0c6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x17b0c6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x17b0c6[0x0][_0x560a('0x76')];var _0x1a8eeb=_0x8de7c7[_0x560a('0x1db')]/0x64;_0x8de7c7[_0x560a('0x74')]=_0x4747f0[0x0][_0x560a('0x1df')]||0x0;_0x8de7c7[_0x560a('0x73')]=_0x3dcaec>0x0?_0x3dcaec:0x1;return _0xffe236[_0x560a('0x1dc')](_0x24bfee,_0x43aaf6,_0x10a0dc,_0x3dcaec,_0x1a8eeb);})[_0x560a('0x45')](function(_0x3e1ee5){return _0x277969(_0x3e1ee5);})[_0x560a('0xb2')](function(_0x442a80){return _0x264dde(msgResponse(_0x560a('0x1e1'),_0x560a('0x145'),JSON[_0x560a('0x130')](_0x442a80)));});}}else{return _0x264dde(msgResponse(_0x560a('0x1dd'),'Failure',_0x560a('0x1de')));}});};};Dialer['prototype'][_0x560a('0x1d4')]=function(_0x38e1b8){var _0xe65255=this;return function(){var _0x18e0df=0x0;var _0x38b950=Math[_0x560a('0x1e2')](_0x38e1b8[_0x560a('0x8d')]*0x3e8);if(_0x38b950>0x0){_0x38b950=_0x38b950<0x64?0x64:_0x38b950;loggerPredictive[_0x560a('0x82')](_0x38e1b8[_0x560a('0x49')],_0x560a('0x1e3'),_0x38b950,_0x560a('0x51'));_0x38e1b8[_0x560a('0x93')]=setInterval(function(){_0xe65255[_0x560a('0x93')](_0x38e1b8);loggerPredictiveCalls[_0x560a('0x82')](_0x560a('0x1e4'),_0x18e0df+=0x1);},_0x38b950);}else{loggerPredictive[_0x560a('0x82')](_0x38e1b8[_0x560a('0x49')],_0x560a('0x1e5'));}};};Dialer['prototype'][_0x560a('0x1e6')]=function(_0x2fafa1,_0x384e32){var _0x5a21bd=this;return function(_0x15b733){if(_[_0x560a('0x4f')](_0x15b733)){if(_['isNil'](_0x384e32['UserId'])||!_0x384e32[_0x560a('0x1e7')]){if(_0x2fafa1['dialMethod']===_0x560a('0x7')){_0x2fafa1[_0x560a('0x12f')]=_[_0x560a('0x87')](_0x2fafa1[_0x560a('0x12f')])?!![]:_0x2fafa1['queueStatusComplete'];var _0xd1d879=uuid['v4']();_0x5a21bd[_0x560a('0x29')][_0xd1d879]=new Action(_0x2fafa1,_0x384e32,_0xd1d879);loggerBooked[_0x560a('0x82')](_0x560a('0x1e8'),_0xd1d879,_0x560a('0x1e9'),JSON[_0x560a('0x130')](_0x2fafa1[_0x560a('0x12f')]),_0x560a('0x1ea'),_0x2fafa1[_0x560a('0x49')]);if(_0x2fafa1[_0x560a('0x12f')]){_0x2fafa1['queueStatusComplete']=![];_0x5a21bd[_0x560a('0x2f')][_0x5a21bd[_0x560a('0x29')][_0xd1d879]['queue']]=[];ami[_0x560a('0xaf')]({'actionid':_0xd1d879,'action':_0x560a('0x1eb'),'queue':_0x2fafa1[_0x560a('0x49')]})[_0x560a('0xb2')](function(){_0x5a21bd['updateOriginated'](_0x2fafa1);_0x5a21bd['rescheduleContact']({'active':![],'ContactId':_0x5a21bd[_0x560a('0x29')][_0xd1d879][_0x560a('0xd1')],'ListId':_0x5a21bd['actions'][_0xd1d879][_0x560a('0xd2')],'VoiceQueueId':_0x5a21bd[_0x560a('0x29')][_0xd1d879][_0x560a('0xd4')]||undefined,'CampaignId':_0x5a21bd['actions'][_0xd1d879][_0x560a('0xfe')]||undefined})['catch'](loggerCatch(_0x560a('0x1ec')));delete _0x5a21bd[_0x560a('0x29')][_0xd1d879];});}else{loggerBooked[_0x560a('0x82')]('[booked][checkContactBlack][else]',JSON[_0x560a('0x130')](_0x2fafa1[_0x560a('0x12f')]),_0x560a('0x1ea'),_0x2fafa1[_0x560a('0x49')]);_0x5a21bd['updateOriginated'](_0x2fafa1);_0x5a21bd[_0x560a('0xbf')]({'active':![],'ContactId':_0x5a21bd[_0x560a('0x29')][_0xd1d879][_0x560a('0xd1')],'ListId':_0x5a21bd['actions'][_0xd1d879][_0x560a('0xd2')],'VoiceQueueId':_0x5a21bd[_0x560a('0x29')][_0xd1d879][_0x560a('0xd4')]||undefined,'CampaignId':_0x5a21bd[_0x560a('0x29')][_0xd1d879][_0x560a('0xfe')]||undefined})['catch'](loggerCatch(_0x560a('0x1ec')));delete _0x5a21bd[_0x560a('0x29')][_0xd1d879];}}else{return _0x5a21bd[_0x560a('0x16e')](_0x2fafa1,_0x384e32);}}else{if(getDiff(_0x384e32[_0x560a('0x1ed')])<_0x2fafa1[_0x560a('0x1ee')]*0x3c){if(_0x384e32['Agent']&&!_0x384e32[_0x560a('0x15c')][_0x560a('0x1ef')]){_0x5a21bd[_0x560a('0x95')][_0x560a('0x131')](_0x384e32['id'])[_0x560a('0x22')](function(){_0x5a21bd[_0x560a('0xb3')](_0x2fafa1);});}else{_0x5a21bd[_0x560a('0xc0')]({'active':![]},_0x384e32['id'],0x1)['finally'](function(){_0x5a21bd['updateOriginated'](_0x2fafa1);});}}else{_0x2fafa1[_0x560a('0x1f0')]+=0x1;_0x5a21bd['updateOriginated'](_0x2fafa1);if(_0x2fafa1[_0x560a('0x1f1')]){_0x5a21bd['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x384e32['ContactId'],'ListId':_0x384e32['ListId'],'VoiceQueueId':_0x384e32[_0x560a('0xd4')]||undefined,'CampaignId':_0x384e32['CampaignId']||undefined})['catch'](loggerCatch(_0x560a('0x1f2')));_0x5a21bd['createHistory'](createObjHistory(_0x2fafa1,_0x384e32,'RECALLINQUEUE',0x17,_0x560a('0x1f3')))[_0x560a('0xb2')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5a21bd[_0x560a('0xce')](createObjHistory(_0x2fafa1,_0x384e32,_0x560a('0x1f4'),0x16,_0x560a('0x1f5')),_0x560a('0x1f6'),_0x560a('0x1f7'));}}}}else{_0x2fafa1[_0x560a('0x1f8')]+=0x1;_0x5a21bd[_0x560a('0xce')](createObjHistory(_0x2fafa1,_0x384e32,_0x560a('0x1f9'),0xd,'Blacklist'),_0x560a('0x1fa'),_0x560a('0x1fb'));throw _0x560a('0x1fc');}};};Dialer[_0x560a('0x1f')][_0x560a('0x15f')]=function(_0x471022){var _0x315978=this;var _0x158b6e=_0x471022[_0x560a('0x1fd')]-_0x471022[_0x560a('0x77')]-_0x471022['temp'];emitCampaignSummary(_0x471022);if(_0x158b6e>0x0){if(_0x158b6e>this['maxNumberOriginate']){_0x158b6e=this[_0x560a('0x27')];}_0x471022[_0x560a('0xc3')]+=_0x158b6e;this[_0x560a('0xc5')](_0x471022['id'],_0x158b6e,_0x471022[_0x560a('0x1fe')],_0x471022)[_0x560a('0x45')](function(_0x10726f){_0x471022[_0x560a('0xc3')]-=_0x158b6e;_0x471022[_0x560a('0xc3')]=_0x471022['temp']>0x0?_0x471022[_0x560a('0xc3')]:0x0;if(!checkContactEmpty(_0x10726f)){_0x471022[_0x560a('0x47')]=_0x560a('0x1ff');logger['info'](_0x560a('0x200')+_0x471022[_0x560a('0x49')]);}else{_0x471022[_0x560a('0x77')]+=_0x10726f[_0x560a('0x14b')];_0x471022[_0x560a('0x47')]=_0x560a('0x201');for(var _0x456db6=0x0;_0x456db6<_0x10726f[_0x560a('0x14b')];_0x456db6+=0x1){_0x471022[_0x560a('0x202')]+=0x1;if(_['isNil'](_0x10726f[_0x456db6])||_[_0x560a('0xae')](_0x10726f[_0x456db6]['Contact'])||_[_0x560a('0xae')](_0x10726f[_0x456db6][_0x560a('0x16f')][_0x560a('0x170')])){_0x315978[_0x560a('0x203')](_0x560a('0x204'),_0x471022,_0x10726f[_0x456db6]);}else{_0x315978[_0x560a('0xbb')](_['pick'](_0x10726f[_0x456db6],[_0x560a('0xfe'),'Contact.phone']))[_0x560a('0x45')](_0x315978[_0x560a('0x1e6')](_0x471022,_0x10726f[_0x456db6]))[_0x560a('0xb2')](_0x315978['loggerHandler']('[actionOriginateIvr]\x20',_0x471022));}}}})[_0x560a('0xb2')](loggerGetContactDialer('[getContactCampaign2]',_0x471022,_0x158b6e));}};Dialer[_0x560a('0x1f')]['handlePower']=function(_0xdd9027,_0xf9f7ae){var _0x42b649=this;var _0x37e4d6=[];var _0x622077=_0xf9f7ae>=0x1?_0xf9f7ae:0x1;if(_0xdd9027[_0x560a('0x156')]===_0x560a('0x7')){_0x622077=0x1;}var _0x170119=Math[_0x560a('0x1e2')](_0xdd9027[_0x560a('0x57')]*_0x622077)-_0xdd9027[_0x560a('0x77')]-_0xdd9027[_0x560a('0xc3')];emitVoiceQueueSummary(_0xdd9027);if(_0xdd9027['dialLimitQueue']>0x0){var _0x1068f=_0xdd9027[_0x560a('0x205')]-_0xdd9027[_0x560a('0x77')]-_0xdd9027[_0x560a('0xa0')]-_0xdd9027[_0x560a('0xc3')]-_0xdd9027[_0x560a('0x58')];if(_0x170119>_0x1068f){_0x170119=_0x1068f;}}if(_0x170119>0x0){if(_0xdd9027[_0x560a('0x156')]===_0x560a('0x7')){_0x170119=0x1;}if(_0x170119>this['maxNumberOriginate']){_0x170119=this['maxNumberOriginate'];}_0xdd9027[_0x560a('0xc3')]+=_0x170119;for(var _0x202ad8 in this[_0x560a('0x25')]){if(typeof this[_0x560a('0x25')][_0x202ad8]!==_0x560a('0x9c')){if(this[_0x560a('0x25')][_0x202ad8][_0x560a('0xa8')]==='not_inuse'&&this[_0x560a('0x25')][_0x202ad8][_0x560a('0xb0')]===_0x560a('0xd9')){_0x37e4d6[_0x560a('0x151')](this[_0x560a('0x25')][_0x202ad8]['id']);}}}this['getContactDialer'](_0xdd9027['id'],_0x37e4d6,_0x170119,_0xdd9027[_0x560a('0x1fe')],_0xdd9027)['then'](function(_0x1d3728){_0xdd9027['temp']-=_0x170119;_0xdd9027['temp']=_0xdd9027[_0x560a('0xc3')]>0x0?_0xdd9027['temp']:0x0;if(!checkContactEmpty(_0x1d3728)){_0x42b649['countReScheduled'](_0xdd9027)[_0x560a('0x45')](sendMessageReschedule(_0xdd9027))[_0x560a('0xb2')](loggerCatch(_0x560a('0xb8')));}else{_0xdd9027['originated']+=_0x1d3728[_0x560a('0x14b')];_0xdd9027['message']=_0xdd9027['dialMethod']===_0x560a('0x7')?_0x560a('0x17a'):'RUNNING';for(var _0x13bc11=0x0;_0x13bc11<_0x1d3728[_0x560a('0x14b')];_0x13bc11+=0x1){if(_['isNil'](_0x1d3728[_0x13bc11])||_[_0x560a('0xae')](_0x1d3728[_0x13bc11][_0x560a('0x16f')])||_['isNil'](_0x1d3728[_0x13bc11][_0x560a('0x16f')][_0x560a('0x170')])){_0x42b649[_0x560a('0x203')](_0x560a('0x204'),_0xdd9027,_0x1d3728[_0x13bc11]);}else{_0x42b649[_0x560a('0xb9')](_[_0x560a('0xd0')](_0x1d3728[_0x13bc11],[_0x560a('0xd4'),_0x560a('0x206')]))[_0x560a('0x45')](_0x42b649[_0x560a('0x1e6')](_0xdd9027,_0x1d3728[_0x13bc11]))[_0x560a('0xb2')](_0x42b649[_0x560a('0xcc')](_0x560a('0x204'),_0xdd9027));}}}})[_0x560a('0xb2')](loggerGetContactDialer(_0x560a('0x207'),_0xdd9027,_0x170119));}};Dialer[_0x560a('0x1f')][_0x560a('0x93')]=function(_0x1a5a90){if(_0x1a5a90[_0x560a('0x205')]>0x0){var _0x35a7b4=_0x1a5a90[_0x560a('0x205')]-_0x1a5a90[_0x560a('0x77')]-_0x1a5a90['talking'];if(_0x35a7b4>0x0){this[_0x560a('0x208')](_0x1a5a90);}else{loggerPredictiveCalls[_0x560a('0x82')](_0x560a('0x209'));}}else{this[_0x560a('0x208')](_0x1a5a90);}};Dialer[_0x560a('0x1f')][_0x560a('0x208')]=function(_0x41fc13){var _0x12010b=this;var _0x2f4822=[];_0x41fc13['originated']+=0x1;for(var _0xa1bb34 in this[_0x560a('0x25')]){if(typeof this['agents'][_0xa1bb34]!=='undefined'){if(this[_0x560a('0x25')][_0xa1bb34]['state']==='not_inuse'&&this[_0x560a('0x25')][_0xa1bb34][_0x560a('0xb0')]==='reachable'){_0x2f4822[_0x560a('0x151')](this[_0x560a('0x25')][_0xa1bb34]['id']);}}}this[_0x560a('0xc2')](_0x41fc13['id'],_0x2f4822,0x1,_0x41fc13[_0x560a('0x1fe')],_0x41fc13)[_0x560a('0x45')](function(_0x288a33){if(!checkContactEmpty(_0x288a33)){checkContactLowerLimitOriginate(_0x41fc13,0x1,0x0);_0x12010b[_0x560a('0xb7')](_0x41fc13)[_0x560a('0x45')](sendMessageReschedule(_0x41fc13))[_0x560a('0xb2')](loggerCatch(_0x560a('0xb8')));}else{_0x41fc13[_0x560a('0x47')]=_0x560a('0x201');if(_[_0x560a('0xae')](_0x288a33[0x0])||_[_0x560a('0xae')](_0x288a33[0x0][_0x560a('0x16f')])||_['isNil'](_0x288a33[0x0]['Contact'][_0x560a('0x170')])){_0x12010b[_0x560a('0x203')](_0x560a('0x204'),_0x41fc13,_0x288a33[0x0]);}else{_0x12010b[_0x560a('0xb9')](_[_0x560a('0xd0')](_0x288a33[0x0],[_0x560a('0xd4'),'Contact.phone']))[_0x560a('0x45')](_0x12010b[_0x560a('0x1e6')](_0x41fc13,_0x288a33[0x0]))['catch'](_0x12010b[_0x560a('0xcc')](_0x560a('0x20a'),_0x41fc13));}}})['catch'](loggerGetContactDialer(_0x560a('0x20b'),_0x41fc13,0x1));emitVoiceQueueSummary(_0x41fc13);};Dialer['prototype'][_0x560a('0x1e0')]=function(_0x54aa1f,_0x51dbac,_0xc1b087,_0x46f6cb,_0x86b8b6,_0x274732){loggerPredictive[_0x560a('0x82')](_0x560a('0x20c'));loggerPredictive[_0x560a('0x82')](_0x560a('0x20d'),_0x54aa1f);loggerPredictive[_0x560a('0x82')](_0x560a('0x20e'),_0x51dbac);loggerPredictive[_0x560a('0x82')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc1b087);loggerPredictive['info'](_0x560a('0x20f'),_0x46f6cb);loggerPredictive[_0x560a('0x82')](_0x560a('0x210'),_0x86b8b6);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x5aa8f2,_0x4479b6){if(_0x54aa1f<=0x0||isNaN(_0x54aa1f)){return _0x4479b6(msgResponse('[abandonmentRate]',_0x560a('0x50'),_0x560a('0x211')+_0x54aa1f));}if(_0xc1b087<=0x0||isNaN(_0xc1b087)){return _0x4479b6(msgResponse(_0x560a('0x212'),_0x560a('0x50'),_0x560a('0x213')+_0xc1b087));}if(_0x46f6cb<=0x0||isNaN(_0x46f6cb)){return _0x4479b6(msgResponse(_0x560a('0x212'),_0x560a('0x50'),_0x560a('0x214')+_0x46f6cb));}if(_0x51dbac<=0x0||isNaN(_0x51dbac)){return _0x4479b6(msgResponse(_0x560a('0x212'),'Error','interval\x20=\x20'+_0x51dbac));}if(_0x86b8b6<=0x0||isNaN(_0x86b8b6)){return _0x4479b6(msgResponse(_0x560a('0x212'),_0x560a('0x50'),'Amax\x20=\x20'+_0x86b8b6));}_0x274732=_0x274732||0x0;var _0x5b8100=0x1/_0xc1b087;var _0x4ac73c=0x0;var _0x2b3e01=0x0;var _0x4e188b=0x0;var _0x2dd9aa=0x0;for(var _0x426c9c=0x0;_0x4e188b<_0x86b8b6;_0x426c9c+=0x1){_0x2b3e01=_0x426c9c/_0x51dbac;_0x4ac73c=(_0x46f6cb*_0x2b3e01+_0x274732)/_0x5b8100;_0x4e188b=erlangb(_0x4ac73c,_0x54aa1f);_0x2dd9aa=_0x4ac73c/_0x54aa1f*(0x1-erlangb(_0x4ac73c,_0x54aa1f));}return _0x5aa8f2({'erlangCalls':_0x426c9c,'erlangCallToSecond':_0x51dbac/_0x426c9c,'erlangAbandonmentRate':_0x4e188b,'erlangBusyFactor':_0x2dd9aa});});};Dialer[_0x560a('0x1f')][_0x560a('0x1dc')]=function(_0x265e96,_0x5f1a8d,_0x241b77,_0x29546a,_0x1f7ca4,_0x130412){loggerPredictive[_0x560a('0x82')](_0x560a('0x215'));loggerPredictive['info'](_0x560a('0x20d'),_0x265e96);loggerPredictive[_0x560a('0x82')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5f1a8d);loggerPredictive[_0x560a('0x82')](_0x560a('0x216'),_0x241b77);loggerPredictive['info'](_0x560a('0x20f'),_0x29546a);loggerPredictive[_0x560a('0x82')](_0x560a('0x217'),_0x1f7ca4);loggerPredictive[_0x560a('0x82')]('---------------------------');return new BPromise(function(_0x502a16,_0x1a72ab){if(_0x265e96<=0x0||isNaN(_0x265e96)){return _0x1a72ab(msgResponse('[busyFactor]',_0x560a('0x50'),_0x560a('0x211')+_0x265e96));}if(_0x241b77<=0x0||isNaN(_0x241b77)){return _0x1a72ab(msgResponse(_0x560a('0x218'),_0x560a('0x50'),_0x560a('0x213')+_0x241b77));}if(_0x29546a<=0x0||isNaN(_0x29546a)){return _0x1a72ab(msgResponse(_0x560a('0x218'),'Error',_0x560a('0x214')+_0x29546a));}if(_0x5f1a8d<=0x0||isNaN(_0x5f1a8d)){return _0x1a72ab(msgResponse(_0x560a('0x218'),'Error',_0x560a('0x219')+_0x5f1a8d));}if(_0x1f7ca4<=0x0||isNaN(_0x1f7ca4)){return _0x1a72ab(msgResponse(_0x560a('0x218'),_0x560a('0x50'),'Umin\x20=\x20'+_0x1f7ca4));}_0x130412=_0x130412||0x0;var _0x5cbc46=0x1/_0x241b77;var _0x5e543e=0x0;var _0x4ae5b1=0x0;var _0x327640=0x0;var _0x1baf66=0x0;for(var _0x8d13a8=0x0;_0x1baf66<_0x1f7ca4;_0x8d13a8+=0x1){_0x4ae5b1=_0x8d13a8/_0x5f1a8d;_0x5e543e=(_0x29546a*_0x4ae5b1+_0x130412)/_0x5cbc46;_0x327640=erlangb(_0x5e543e,_0x265e96);_0x1baf66=_0x5e543e/_0x265e96*(0x1-erlangb(_0x5e543e,_0x265e96));}return _0x502a16({'erlangCalls':_0x8d13a8,'erlangCallToSecond':_0x5f1a8d/_0x8d13a8,'erlangAbandonmentRate':_0x327640,'erlangBusyFactor':_0x1baf66});});};module[_0x560a('0x21a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index a469f2d..2c73ddf 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1606=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1606,0x162));var _0x6160=function(_0x503e62,_0x1f38fd){_0x503e62=_0x503e62-0x0;var _0x51f9d1=_0x1606[_0x503e62];return _0x51f9d1;};'use strict';var util=require(_0x6160('0x0'));var _=require(_0x6160('0x1'));var moment=require('moment');function getSeconds(_0x30b72b,_0x33fd9a){var _0x477bb5=moment(_0x30b72b)['milliseconds'](0x0);var _0x53cda0=moment(_0x33fd9a)[_0x6160('0x2')](0x0);return _0x477bb5['diff'](_0x53cda0,_0x6160('0x3'));}function QueueCallerAbandon(_0xbcc826,_0x23bfac){this[_0x6160('0x4')]=_0xbcc826[_0x6160('0x4')];this[_0x6160('0x5')]=_0xbcc826[_0x6160('0x5')];this[_0x6160('0x6')]=_0xbcc826[_0x6160('0x5')]===_0x6160('0x7')?_0x6160('0x8'):_0xbcc826['type'];this[_0x6160('0x9')]=_0xbcc826['countbusyretry'];this[_0x6160('0xa')]=_0xbcc826[_0x6160('0xa')];this[_0x6160('0xb')]=_0xbcc826['countnoanswerretry'];this[_0x6160('0xc')]=_0xbcc826[_0x6160('0x9')]+_0xbcc826['countcongestionretry']+_0xbcc826[_0x6160('0xb')]+_0xbcc826[_0x6160('0xd')]+_0xbcc826[_0x6160('0xe')]+_0xbcc826[_0x6160('0xf')]+_0xbcc826[_0x6160('0x10')]+_0xbcc826[_0x6160('0x11')];this[_0x6160('0xd')]=_0xbcc826[_0x6160('0xd')];this[_0x6160('0xe')]=_0xbcc826[_0x6160('0xe')];this[_0x6160('0xf')]=_0xbcc826[_0x6160('0xf')];this['countmachineretry']=_0xbcc826[_0x6160('0x10')];this['countagentrejectretry']=_0xbcc826[_0x6160('0x11')];this[_0x6160('0x12')]=_0x23bfac[_0x6160('0x12')];this[_0x6160('0x13')]=_0xbcc826[_0x6160('0x14')];this['calleridnum']=_0xbcc826[_0x6160('0x15')];this[_0x6160('0x16')]=_0xbcc826['starttime'];this[_0x6160('0x17')]=_0xbcc826[_0x6160('0x17')];this['droptime']=_0xbcc826[_0x6160('0x18')];this[_0x6160('0x19')]=this[_0x6160('0x18')];this['ringtime']=getSeconds(_0xbcc826[_0x6160('0x17')],_0xbcc826[_0x6160('0x16')]);this[_0x6160('0x1a')]=getSeconds(this[_0x6160('0x18')],_0xbcc826[_0x6160('0x17')]);this[_0x6160('0x1b')]=0x0;this['queue']=_0x23bfac[_0x6160('0x8')];this[_0x6160('0x1c')]=_0x23bfac[_0x6160('0x1d')];this[_0x6160('0x1e')]=_0x23bfac[_0x6160('0x1e')];this[_0x6160('0x1f')]=_0xbcc826[_0x6160('0x1f')];this['callbackuniqueid']=_0xbcc826[_0x6160('0x20')];this[_0x6160('0x21')]=_0xbcc826[_0x6160('0x21')];this[_0x6160('0x22')]=_0xbcc826[_0x6160('0x22')];this[_0x6160('0x23')]=_0xbcc826[_0x6160('0x23')];this[_0x6160('0x24')]=_0xbcc826[_0x6160('0x24')];this[_0x6160('0x25')]=_0xbcc826['UserId'];this[_0x6160('0x26')]=_0xbcc826[_0x6160('0x26')];this['CampaignId']=_0xbcc826[_0x6160('0x27')];this[_0x6160('0x28')]=_0xbcc826[_0x6160('0x28')]||'';this[_0x6160('0x29')]=_0xbcc826['originatecalleridname']||'';}module[_0x6160('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xf468=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','responsetime','endtime','droptime','ringtime','starttime','holdtime','talktime','membername','connectedlinename','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','scheduledat','type'];(function(_0x593da6,_0x839a8d){var _0x1169de=function(_0xfbea48){while(--_0xfbea48){_0x593da6['push'](_0x593da6['shift']());}};_0x1169de(++_0x839a8d);}(_0xf468,0x111));var _0x8f46=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xf468[_0x433a86];return _0x23000c;};'use strict';var util=require(_0x8f46('0x0'));var _=require(_0x8f46('0x1'));var moment=require(_0x8f46('0x2'));function getSeconds(_0x5e9464,_0x2a06ad){var _0x4eafe5=moment(_0x5e9464)[_0x8f46('0x3')](0x0);var _0x287704=moment(_0x2a06ad)[_0x8f46('0x3')](0x0);return _0x4eafe5[_0x8f46('0x4')](_0x287704,'seconds');}function QueueCallerAbandon(_0x1b214d,_0xa00071){this[_0x8f46('0x5')]=_0x1b214d[_0x8f46('0x5')];this[_0x8f46('0x6')]=_0x1b214d['type'];this[_0x8f46('0x7')]=_0x1b214d[_0x8f46('0x6')]===_0x8f46('0x8')?_0x8f46('0x9'):_0x1b214d[_0x8f46('0x6')];this[_0x8f46('0xa')]=_0x1b214d[_0x8f46('0xa')];this[_0x8f46('0xb')]=_0x1b214d[_0x8f46('0xb')];this[_0x8f46('0xc')]=_0x1b214d[_0x8f46('0xc')];this[_0x8f46('0xd')]=_0x1b214d['countbusyretry']+_0x1b214d[_0x8f46('0xb')]+_0x1b214d['countnoanswerretry']+_0x1b214d[_0x8f46('0xe')]+_0x1b214d[_0x8f46('0xf')]+_0x1b214d[_0x8f46('0x10')]+_0x1b214d[_0x8f46('0x11')]+_0x1b214d['countagentrejectretry'];this['countnosuchnumberretry']=_0x1b214d[_0x8f46('0xe')];this[_0x8f46('0xf')]=_0x1b214d[_0x8f46('0xf')];this[_0x8f46('0x10')]=_0x1b214d[_0x8f46('0x10')];this['countmachineretry']=_0x1b214d[_0x8f46('0x11')];this[_0x8f46('0x12')]=_0x1b214d[_0x8f46('0x12')];this[_0x8f46('0x13')]=_0xa00071['uniqueid'];this['calleridname']=_0x1b214d['name'];this[_0x8f46('0x14')]=_0x1b214d['number'];this['starttime']=_0x1b214d['starttime'];this[_0x8f46('0x15')]=_0x1b214d[_0x8f46('0x15')];this['droptime']=_0x1b214d['droptime'];this[_0x8f46('0x16')]=this[_0x8f46('0x17')];this[_0x8f46('0x18')]=getSeconds(_0x1b214d[_0x8f46('0x15')],_0x1b214d[_0x8f46('0x19')]);this[_0x8f46('0x1a')]=getSeconds(this[_0x8f46('0x17')],_0x1b214d[_0x8f46('0x15')]);this[_0x8f46('0x1b')]=0x0;this[_0x8f46('0x9')]=_0xa00071[_0x8f46('0x9')];this[_0x8f46('0x1c')]=_0xa00071[_0x8f46('0x1d')];this['reason']=_0xa00071['reason'];this['callback']=_0x1b214d[_0x8f46('0x1e')];this[_0x8f46('0x1f')]=_0x1b214d['callbackuniqueid'];this[_0x8f46('0x20')]=_0x1b214d[_0x8f46('0x20')];this['recallme']=_0x1b214d['recallme'];this[_0x8f46('0x21')]=_0x1b214d[_0x8f46('0x21')];this[_0x8f46('0x22')]=_0x1b214d['ListId'];this[_0x8f46('0x23')]=_0x1b214d[_0x8f46('0x23')];this[_0x8f46('0x24')]=_0x1b214d[_0x8f46('0x24')];this['CampaignId']=_0x1b214d[_0x8f46('0x25')];this[_0x8f46('0x26')]=_0x1b214d[_0x8f46('0x26')]||'';this[_0x8f46('0x27')]=_0x1b214d[_0x8f46('0x27')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index c4ba4ac..786a01b 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(_0x458d4a,_0x5da1bc){var _0x51e518=function(_0x148c12){while(--_0x148c12){_0x458d4a['push'](_0x458d4a['shift']());}};_0x51e518(++_0x5da1bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x592d66,_0x2d10a1){var _0x3ca426=function(_0x17aed7){while(--_0x17aed7){_0x592d66['push'](_0x592d66['shift']());}};_0x3ca426(++_0x2d10a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 b4da962..efa3e79 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 _0xa571=['execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','update','AttachmentId','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxstatusstring','SENDING\x20FAILED'];(function(_0x53b7ca,_0x7b041d){var _0x4a64bd=function(_0x2f2d03){while(--_0x2f2d03){_0x53b7ca['push'](_0x53b7ca['shift']());}};_0x4a64bd(++_0x7b041d);}(_0xa571,0x107));var _0x1a57=function(_0x22c00f,_0x33f101){_0x22c00f=_0x22c00f-0x0;var _0x34a543=_0xa571[_0x22c00f];return _0x34a543;};'use strict';var util=require(_0x1a57('0x0'));var _=require(_0x1a57('0x1'));var BPromise=require(_0x1a57('0x2'));var uuid=require(_0x1a57('0x3'));var moment=require('moment');var path=require(_0x1a57('0x4'));var tiff2pdf=require(_0x1a57('0x5'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x1a57('0x6'));var ami=require('../ami');var rpcDb=require(_0x1a57('0x7'));var Channel=require(_0x1a57('0x8'));var ut=require(_0x1a57('0x9'));var Action=require(_0x1a57('0xa'));var faxAccount=require(_0x1a57('0xb'));var attachment=require(_0x1a57('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x3edb40){this[_0x1a57('0xd')]={};this[_0x1a57('0xe')]=_0x3edb40['faxAccounts'];this[_0x1a57('0xf')]=_0x3edb40[_0x1a57('0xf')];this[_0x1a57('0x10')]={};ami['on'](_0x1a57('0x11'),this[_0x1a57('0x12')][_0x1a57('0x13')](this));ami['on'](_0x1a57('0x14'),this[_0x1a57('0x15')]['bind'](this));ami['on']('newstate',this[_0x1a57('0x16')][_0x1a57('0x13')](this));ami['on'](_0x1a57('0x17'),this['syncNewExten'][_0x1a57('0x13')](this));ami['on'](_0x1a57('0x18'),this['syncFaxStatus'][_0x1a57('0x13')](this));ami['on']('receivefax',this[_0x1a57('0x19')][_0x1a57('0x13')](this));ami['on'](_0x1a57('0x1a'),this[_0x1a57('0x1b')]['bind'](this));ami['on'](_0x1a57('0x1c'),this['syncOriginateResponse']['bind'](this));}Fax[_0x1a57('0x1d')][_0x1a57('0x12')]=function(_0x22f400){if(_0x22f400['context']===_0x1a57('0x1e')){for(var _0x1662a3 in this[_0x1a57('0xe')]){if(this['faxAccounts'][_0x1a57('0x1f')](_0x1662a3)){if(_0x22f400[_0x1a57('0x20')]===this[_0x1a57('0xe')][_0x1662a3][_0x1a57('0x21')]){this[_0x1a57('0xd')][_0x22f400['uniqueid']]={};this['channels'][_0x22f400[_0x1a57('0x22')]][_0x1a57('0x23')]=_0x22f400[_0x1a57('0x23')];this['channels'][_0x22f400['uniqueid']]['id']=this['faxAccounts'][_0x1662a3]['id'];this[_0x1a57('0xd')][_0x22f400[_0x1a57('0x22')]][_0x1a57('0x24')]=this[_0x1a57('0xe')][_0x1662a3][_0x1a57('0x24')];logger[_0x1a57('0x25')](_0x22f400[_0x1a57('0x22')],_0x1a57('0x26'));}}}}if(this[_0x1a57('0x10')][_0x22f400[_0x1a57('0x22')]]){this[_0x1a57('0xd')][_0x22f400[_0x1a57('0x22')]]={};this[_0x1a57('0xd')][_0x22f400[_0x1a57('0x22')]][_0x1a57('0x23')]=_0x22f400[_0x1a57('0x23')];logger[_0x1a57('0x25')](_0x22f400[_0x1a57('0x22')],_0x1a57('0x26'));}};Fax[_0x1a57('0x1d')][_0x1a57('0x15')]=function(_0x1dd939){if(this['channels'][_0x1dd939['uniqueid']]){for(var _0x139d8c in _0x1dd939[_0x1a57('0x27')]){if(_0x1dd939['variable'][_0x1a57('0x1f')](_0x139d8c)){this['channels'][_0x1dd939[_0x1a57('0x22')]][_0x139d8c]=_0x1dd939[_0x1a57('0x28')];}}}};Fax['prototype'][_0x1a57('0x16')]=function(_0x274fe6){if(this[_0x1a57('0xd')][_0x274fe6[_0x1a57('0x22')]]){this['channels'][_0x274fe6[_0x1a57('0x22')]][_0x1a57('0x29')]=_0x274fe6[_0x1a57('0x29')];this[_0x1a57('0xd')][_0x274fe6['uniqueid']][_0x1a57('0x2a')]=_0x274fe6[_0x1a57('0x2a')];}};Fax[_0x1a57('0x1d')][_0x1a57('0x2b')]=function(_0x3ac6ff){if(this[_0x1a57('0xd')][_0x3ac6ff[_0x1a57('0x22')]]){for(var _0x1e7f0d in _0x3ac6ff[_0x1a57('0x27')]){if(_0x3ac6ff['variable'][_0x1a57('0x1f')](_0x1e7f0d)){this[_0x1a57('0xd')][_0x3ac6ff['uniqueid']][_0x1e7f0d]=_0x3ac6ff['value'];}}}};Fax[_0x1a57('0x1d')][_0x1a57('0x2c')]=function(_0x159c74){if(this[_0x1a57('0xd')][_0x159c74[_0x1a57('0x22')]]){this[_0x1a57('0xd')][_0x159c74[_0x1a57('0x22')]][_0x1a57('0x2d')]=_0x159c74[_0x1a57('0x2d')];this[_0x1a57('0xd')][_0x159c74[_0x1a57('0x22')]][_0x1a57('0x2e')]=_0x159c74[_0x1a57('0x2e')];this[_0x1a57('0xd')][_0x159c74[_0x1a57('0x22')]][_0x1a57('0x21')]=_0x159c74[_0x1a57('0x21')];this[_0x1a57('0xd')][_0x159c74['uniqueid']][_0x1a57('0x2f')]=_0x159c74[_0x1a57('0x2f')];logger[_0x1a57('0x25')](_0x159c74[_0x1a57('0x22')],_0x1a57('0x30'));}};Fax[_0x1a57('0x1d')][_0x1a57('0x19')]=function(_0x23d087){var _0x1b6514=this;if(this['channels'][_0x23d087['uniqueid']]){var _0x5da96f=this['channels'][_0x23d087[_0x1a57('0x22')]]['id'];this[_0x1a57('0xd')][_0x23d087[_0x1a57('0x22')]]['remotestationid']=_0x23d087[_0x1a57('0x31')];this[_0x1a57('0xd')][_0x23d087[_0x1a57('0x22')]][_0x1a57('0x32')]=_0x23d087['pagestransferred'];this[_0x1a57('0xd')][_0x23d087['uniqueid']][_0x1a57('0x21')]=_0x23d087[_0x1a57('0x21')];this[_0x1a57('0xd')][_0x23d087['uniqueid']][_0x1a57('0x33')]=_0x23d087[_0x1a57('0x33')];this[_0x1a57('0xd')][_0x23d087[_0x1a57('0x22')]][_0x1a57('0x34')]=_0x23d087['transferrate'];this[_0x1a57('0xd')][_0x23d087['uniqueid']]['filename']=_0x23d087[_0x1a57('0x2f')];this['channels'][_0x23d087[_0x1a57('0x22')]][_0x1a57('0x35')]=_0x23d087[_0x1a57('0x35')];if(this['channels'][_0x23d087[_0x1a57('0x22')]][_0x1a57('0x32')]>0x0){tiff2pdf(_0x23d087[_0x1a57('0x2f')],_0x1a57('0x36'),function(_0x504c29){logger[_0x1a57('0x25')](_0x23d087[_0x1a57('0x22')],'\x20result\x20conversion\x20file\x20',_0x504c29[_0x1a57('0x37')]);attachment['create']({'name':path['parse'](_0x23d087[_0x1a57('0x2f')])[_0x1a57('0x24')],'basename':path[_0x1a57('0x38')](_0x23d087[_0x1a57('0x2f')])['name']+_0x1a57('0x39'),'type':_0x1a57('0x3a')})[_0x1a57('0x3b')](function(_0x1b4231){faxAccount[_0x1a57('0x3c')](_0x5da96f,{'from':_0x23d087['calleridnum'],'mapKey':_0x1a57('0x6'),'body':path[_0x1a57('0x38')](_0x23d087[_0x1a57('0x2f')])[_0x1a57('0x24')]+'.pdf','AttachmentId':_0x1b4231['id']})[_0x1a57('0x3d')](function(_0x5f1d5f){logger[_0x1a57('0x3e')](_0x23d087[_0x1a57('0x22')],_0x1a57('0x3f'),JSON[_0x1a57('0x40')](_0x5f1d5f));});})[_0x1a57('0x3d')](function(_0x445df1){logger[_0x1a57('0x3e')](_0x23d087[_0x1a57('0x22')],_0x1a57('0x41'),JSON[_0x1a57('0x40')](_0x445df1));});});}logger[_0x1a57('0x25')](_0x23d087[_0x1a57('0x22')],_0x1a57('0x41'));}};Fax['prototype'][_0x1a57('0x42')]=function(_0x480aff){if(this[_0x1a57('0x10')][_0x480aff[_0x1a57('0x22')]]){_[_0x1a57('0x43')](this[_0x1a57('0xd')][_0x480aff[_0x1a57('0x22')]],_[_0x1a57('0x44')](_0x480aff,[_0x1a57('0x45'),_0x1a57('0x46')]));}};function updateStatus(_0xe82028){if(_0xe82028['AttachmentId']){faxMessage[_0x1a57('0x47')](_0xe82028[_0x1a57('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x1a57('0x3b')](function(_0x270a33){ut['logger'](_0x1a57('0x49'),_0x270a33);})[_0x1a57('0x3d')](function(_0x5610ca){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x5610ca);});}else{ut[_0x1a57('0x4a')](_0x1a57('0x4b'));}}Fax['prototype'][_0x1a57('0x4c')]=function(_0x18267c,_0x572202,_0x5e510e){var _0x4b02c9=this;var _0x3cb9ce={};if(_0x572202){_0x3cb9ce={'read':_0x572202};}else{_0x3cb9ce={'failMessage':_0x5e510e};}if(this[_0x1a57('0x10')][_0x18267c][_0x1a57('0x48')]){faxMessage[_0x1a57('0x47')](this[_0x1a57('0x10')][_0x18267c][_0x1a57('0x48')],_0x3cb9ce)[_0x1a57('0x3b')](function(_0x1f705b){ut['logger']('[Fax][Message][Updated]',_0x1f705b);})['catch'](function(_0x5ef58d){ut['logger'](_0x1a57('0x4d'),_0x5ef58d);})[_0x1a57('0x4e')](function(){delete _0x4b02c9[_0x1a57('0xd')][_0x18267c];delete _0x4b02c9[_0x1a57('0x10')][_0x18267c];});}else{ut[_0x1a57('0x4a')](_0x1a57('0x4f'));delete this[_0x1a57('0xd')][_0x18267c];delete this[_0x1a57('0x10')][_0x18267c];}};Fax['prototype']['syncHangup']=function(_0x515b81){var _0x13ebc4=this;if(this['channels'][_0x515b81[_0x1a57('0x22')]]){if(this[_0x1a57('0x10')][_0x515b81[_0x1a57('0x22')]]){this[_0x1a57('0xd')][_0x515b81[_0x1a57('0x22')]]['id']=this[_0x1a57('0x10')][_0x515b81[_0x1a57('0x22')]]['id'];this['channels'][_0x515b81['uniqueid']]['name']=this[_0x1a57('0x10')][_0x515b81[_0x1a57('0x22')]][_0x1a57('0x24')];}logger[_0x1a57('0x25')](_0x515b81[_0x1a57('0x22')],this[_0x1a57('0x10')][_0x515b81[_0x1a57('0x22')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x1a57('0x40')](this[_0x1a57('0xd')][_0x515b81[_0x1a57('0x22')]]));if(this[_0x1a57('0x10')][_0x515b81[_0x1a57('0x22')]]){if(this[_0x1a57('0xd')][_0x515b81['uniqueid']]['faxpages']>0x0&&this[_0x1a57('0xd')][_0x515b81[_0x1a57('0x22')]]['faxstatus']==='SUCCESS'){this[_0x1a57('0x4c')](_0x515b81[_0x1a57('0x22')],!![]);}else{this[_0x1a57('0x4c')](_0x515b81[_0x1a57('0x22')],![],this[_0x1a57('0xd')][_0x515b81[_0x1a57('0x22')]][_0x1a57('0x50')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x515b81[_0x1a57('0x22')]][_0x1a57('0x50')]:_0x1a57('0x51'));}}}};Fax[_0x1a57('0x1d')]['send']=function(_0x33092d){var _0x28354c=this;return new BPromise(function(_0x1c28ca,_0x33c8d4){_0x28354c[_0x1a57('0x52')](_0x33092d,_0x28354c['faxAccounts'][_0x33092d['FaxAccountId']])['then'](function(_0x62ba80){ut[_0x1a57('0x4a')](_0x1a57('0x53'),_0x62ba80);_0x1c28ca(ut[_0x1a57('0x37')](_0x1a57('0x54')));})[_0x1a57('0x3d')](function(_0x304b96){ut[_0x1a57('0x4a')]('[Fax][execOriginate][failure]',_0x304b96);updateStatus(_0x33092d);_0x33c8d4(ut[_0x1a57('0x37')](_0x1a57('0x55')));});});};Fax['prototype']['checkAfterSend']=function(_0x5e9440){var _0x5be7b4=this;return new BPromise(function(_0x2ebd9c,_0x9379e3){var _0x28bf55=_0x5be7b4[_0x1a57('0x56')](_0x5be7b4[_0x1a57('0xe')][_0x5e9440[_0x1a57('0x57')]][_0x1a57('0x58')],_0x5e9440);if(_0x28bf55[_0x1a57('0x59')]){_0x2ebd9c(ut['message'](_0x1a57('0x5a')));}else{_0x9379e3(ut[_0x1a57('0x37')](_0x28bf55['message']));}});};function originate(_0x24b56c,_0x392f49,_0x20b0d5){return new BPromise(function(_0x570674,_0x5c3eb8){if(_0x20b0d5){var _0x349c9d=util[_0x1a57('0x5b')](_0x1a57('0x5c'),path[_0x1a57('0x38')](_0x24b56c['path'])[_0x1a57('0x24')],_0x24b56c[_0x1a57('0x4')]);gs[_0x1a57('0x5d')](_0x349c9d)[_0x1a57('0x3b')](function(){_0x24b56c[_0x1a57('0x4')]=util['format'](_0x1a57('0x5e'),path[_0x1a57('0x38')](_0x24b56c[_0x1a57('0x4')])[_0x1a57('0x5f')],path[_0x1a57('0x38')](_0x24b56c[_0x1a57('0x4')])[_0x1a57('0x24')]);_0x392f49[_0x1a57('0x60')]=_0x24b56c[_0x1a57('0x4')];ut[_0x1a57('0x4a')](_0x1a57('0x61'),'');ami['Action'](ut[_0x1a57('0x62')](_0x24b56c,_0x392f49))[_0x1a57('0x3b')](function(_0x4c9925){_0x570674(_0x4c9925);})[_0x1a57('0x3d')](function(_0x3fc28a){_0x5c3eb8(_0x3fc28a);});})['catch'](function(_0x1d9a08){_0x5c3eb8(_0x1d9a08);});}else{ami[_0x1a57('0x63')](ut[_0x1a57('0x62')](_0x24b56c,_0x392f49))[_0x1a57('0x3b')](function(_0xa39a8b){_0x570674(_0xa39a8b);})[_0x1a57('0x3d')](function(_0x8cb993){_0x5c3eb8(_0x8cb993);});}});}Fax[_0x1a57('0x1d')]['execOriginate']=function(_0x190631,_0x598a8d){var _0x5447ca=this;return new BPromise(function(_0x22fcb1,_0x3e11db){var _0x3ac0b9=uuid['v4']();var _0x15e48d=ut[_0x1a57('0x64')](_0x190631,_0x598a8d);_0x5447ca[_0x1a57('0x10')][_0x3ac0b9]=new Action(_0x3ac0b9,_0x598a8d,_0x190631);var _0x220725=_0x5447ca[_0x1a57('0x10')][_0x3ac0b9];if(path[_0x1a57('0x38')](_0x190631['path'])[_0x1a57('0x65')]===_0x1a57('0x39')){originate(_0x220725,_0x15e48d,!![])[_0x1a57('0x3b')](function(_0x1e4d4e){_0x22fcb1(_0x1e4d4e);})[_0x1a57('0x3d')](function(_0x59869e){_0x3e11db(_0x59869e);});}else{originate(_0x220725,_0x15e48d,![])[_0x1a57('0x3b')](function(_0xd56ee1){_0x22fcb1(_0xd56ee1);})[_0x1a57('0x3d')](function(_0x34fd50){_0x3e11db(_0x34fd50);});}});};Fax[_0x1a57('0x1d')][_0x1a57('0x66')]=function(_0x1b6169){return!_[_0x1a57('0x67')](_0x1b6169)&&!_['isNil'](_0x1b6169[_0x1a57('0x24')])&&!_[_0x1a57('0x67')](_0x1b6169[_0x1a57('0x68')])&&_0x1b6169[_0x1a57('0x68')]&&!_['isNil'](this['trunks'][util['format']('SIP/%s',_0x1b6169['name'])])&&!_[_0x1a57('0x67')](this[_0x1a57('0xf')][util['format'](_0x1a57('0x69'),_0x1b6169[_0x1a57('0x24')])]['status'])&&(this[_0x1a57('0xf')][util[_0x1a57('0x5b')](_0x1a57('0x69'),_0x1b6169[_0x1a57('0x24')])]['status']===_0x1a57('0x6a')||this[_0x1a57('0xf')][util['format'](_0x1a57('0x69'),_0x1b6169[_0x1a57('0x24')])][_0x1a57('0x2e')]===_0x1a57('0x6b'));};Fax[_0x1a57('0x1d')][_0x1a57('0x56')]=function(_0x465df7,_0x4bb760){if(!this[_0x1a57('0x66')](_0x465df7)){ut['logger'](_0x1a57('0x6c'),_[_0x1a57('0x67')](_0x465df7)?'':_0x465df7[_0x1a57('0x24')]+_0x1a57('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x1a57('0x67')](_0x4bb760[_0x1a57('0x6')])){ut[_0x1a57('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x1a57('0x40')](_0x4bb760));return{'isValid':![],'message':_0x1a57('0x6e')};}if(_[_0x1a57('0x67')](_0x4bb760['path'])){ut[_0x1a57('0x4a')](_0x1a57('0x6f'),JSON[_0x1a57('0x40')](_0x4bb760));return{'isValid':![],'message':_0x1a57('0x70')};}return{'isValid':!![],'message':_0x1a57('0x71')};};module[_0x1a57('0x72')]=Fax; \ No newline at end of file +var _0x7916=['\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','variable','channelstatedesc','value','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','info','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','fax','catch','error'];(function(_0x3c4f40,_0x302e0b){var _0x12032f=function(_0x159d92){while(--_0x159d92){_0x3c4f40['push'](_0x3c4f40['shift']());}};_0x12032f(++_0x302e0b);}(_0x7916,0x128));var _0x6791=function(_0x46fc01,_0x4f83c8){_0x46fc01=_0x46fc01-0x0;var _0x44dc34=_0x7916[_0x46fc01];return _0x44dc34;};'use strict';var util=require(_0x6791('0x0'));var _=require('lodash');var BPromise=require(_0x6791('0x1'));var uuid=require(_0x6791('0x2'));var moment=require('moment');var path=require(_0x6791('0x3'));var tiff2pdf=require(_0x6791('0x4'));var gs=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('fax');var ami=require(_0x6791('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x6791('0x8'));var ut=require(_0x6791('0x9'));var Action=require('./action');var faxAccount=require(_0x6791('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x6791('0xb'));function Fax(_0x50c563){this['channels']={};this[_0x6791('0xc')]=_0x50c563[_0x6791('0xc')];this['trunks']=_0x50c563[_0x6791('0xd')];this[_0x6791('0xe')]={};ami['on'](_0x6791('0xf'),this['syncNewchannel'][_0x6791('0x10')](this));ami['on'](_0x6791('0x11'),this[_0x6791('0x12')][_0x6791('0x10')](this));ami['on'](_0x6791('0x13'),this[_0x6791('0x14')][_0x6791('0x10')](this));ami['on'](_0x6791('0x15'),this[_0x6791('0x16')][_0x6791('0x10')](this));ami['on'](_0x6791('0x17'),this['syncFaxStatus']['bind'](this));ami['on'](_0x6791('0x18'),this['syncReceiveFax'][_0x6791('0x10')](this));ami['on']('hangup',this[_0x6791('0x19')][_0x6791('0x10')](this));ami['on']('originateresponse',this[_0x6791('0x1a')]['bind'](this));}Fax[_0x6791('0x1b')][_0x6791('0x1c')]=function(_0x596a06){if(_0x596a06[_0x6791('0x1d')]===_0x6791('0x1e')){for(var _0x5bec14 in this[_0x6791('0xc')]){if(this['faxAccounts'][_0x6791('0x1f')](_0x5bec14)){if(_0x596a06[_0x6791('0x20')]===this[_0x6791('0xc')][_0x5bec14][_0x6791('0x21')]){this[_0x6791('0x22')][_0x596a06[_0x6791('0x23')]]={};this[_0x6791('0x22')][_0x596a06['uniqueid']][_0x6791('0x24')]=_0x596a06[_0x6791('0x24')];this['channels'][_0x596a06[_0x6791('0x23')]]['id']=this[_0x6791('0xc')][_0x5bec14]['id'];this['channels'][_0x596a06[_0x6791('0x23')]][_0x6791('0x25')]=this[_0x6791('0xc')][_0x5bec14][_0x6791('0x25')];logger['info'](_0x596a06[_0x6791('0x23')],_0x6791('0x26'));}}}}if(this['actions'][_0x596a06['uniqueid']]){this['channels'][_0x596a06[_0x6791('0x23')]]={};this['channels'][_0x596a06[_0x6791('0x23')]]['channel']=_0x596a06['channel'];logger['info'](_0x596a06[_0x6791('0x23')],_0x6791('0x26'));}};Fax[_0x6791('0x1b')]['syncVarSet']=function(_0x3def2e){if(this[_0x6791('0x22')][_0x3def2e['uniqueid']]){for(var _0x342107 in _0x3def2e['variable']){if(_0x3def2e[_0x6791('0x27')]['hasOwnProperty'](_0x342107)){this['channels'][_0x3def2e[_0x6791('0x23')]][_0x342107]=_0x3def2e['value'];}}}};Fax[_0x6791('0x1b')][_0x6791('0x14')]=function(_0x483d6c){if(this[_0x6791('0x22')][_0x483d6c[_0x6791('0x23')]]){this[_0x6791('0x22')][_0x483d6c[_0x6791('0x23')]]['channelstate']=_0x483d6c['channelstate'];this[_0x6791('0x22')][_0x483d6c['uniqueid']][_0x6791('0x28')]=_0x483d6c[_0x6791('0x28')];}};Fax[_0x6791('0x1b')][_0x6791('0x16')]=function(_0x1d551b){if(this[_0x6791('0x22')][_0x1d551b[_0x6791('0x23')]]){for(var _0x14307e in _0x1d551b[_0x6791('0x27')]){if(_0x1d551b[_0x6791('0x27')]['hasOwnProperty'](_0x14307e)){this[_0x6791('0x22')][_0x1d551b[_0x6791('0x23')]][_0x14307e]=_0x1d551b[_0x6791('0x29')];}}}};Fax[_0x6791('0x1b')][_0x6791('0x2a')]=function(_0x36f673){if(this['channels'][_0x36f673['uniqueid']]){this['channels'][_0x36f673[_0x6791('0x23')]][_0x6791('0x2b')]=_0x36f673[_0x6791('0x2b')];this['channels'][_0x36f673['uniqueid']][_0x6791('0x2c')]=_0x36f673[_0x6791('0x2c')];this[_0x6791('0x22')][_0x36f673[_0x6791('0x23')]]['localstationid']=_0x36f673[_0x6791('0x21')];this[_0x6791('0x22')][_0x36f673[_0x6791('0x23')]]['filename']=_0x36f673[_0x6791('0x2d')];logger['info'](_0x36f673['uniqueid'],_0x6791('0x2e'));}};Fax[_0x6791('0x1b')]['syncReceiveFax']=function(_0x764f15){var _0x70b2b7=this;if(this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]]){var _0x3e5676=this['channels'][_0x764f15[_0x6791('0x23')]]['id'];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]]['remotestationid']=_0x764f15[_0x6791('0x2f')];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]]['pagestransferred']=_0x764f15[_0x6791('0x30')];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x21')]=_0x764f15['localstationid'];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x31')]=_0x764f15[_0x6791('0x31')];this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x32')]=_0x764f15[_0x6791('0x32')];this[_0x6791('0x22')][_0x764f15['uniqueid']]['filename']=_0x764f15[_0x6791('0x2d')];this[_0x6791('0x22')][_0x764f15['uniqueid']][_0x6791('0x33')]=_0x764f15[_0x6791('0x33')];if(this[_0x6791('0x22')][_0x764f15[_0x6791('0x23')]][_0x6791('0x30')]>0x0){tiff2pdf(_0x764f15[_0x6791('0x2d')],_0x6791('0x34'),function(_0x58f6da){logger[_0x6791('0x35')](_0x764f15['uniqueid'],_0x6791('0x36'),_0x58f6da[_0x6791('0x37')]);attachment[_0x6791('0x38')]({'name':path[_0x6791('0x39')](_0x764f15['filename'])[_0x6791('0x25')],'basename':path[_0x6791('0x39')](_0x764f15[_0x6791('0x2d')])[_0x6791('0x25')]+_0x6791('0x3a'),'type':_0x6791('0x3b')})[_0x6791('0x3c')](function(_0x453ccd){faxAccount['notify'](_0x3e5676,{'from':_0x764f15[_0x6791('0x33')],'mapKey':_0x6791('0x3d'),'body':path[_0x6791('0x39')](_0x764f15[_0x6791('0x2d')])['name']+_0x6791('0x3a'),'AttachmentId':_0x453ccd['id']})[_0x6791('0x3e')](function(_0x540ebe){logger[_0x6791('0x3f')](_0x764f15['uniqueid'],_0x6791('0x40'),JSON[_0x6791('0x41')](_0x540ebe));});})[_0x6791('0x3e')](function(_0x3ddccc){logger[_0x6791('0x3f')](_0x764f15[_0x6791('0x23')],_0x6791('0x42'),JSON[_0x6791('0x41')](_0x3ddccc));});});}logger[_0x6791('0x35')](_0x764f15['uniqueid'],_0x6791('0x42'));}};Fax['prototype'][_0x6791('0x1a')]=function(_0x2bb86a){if(this[_0x6791('0xe')][_0x2bb86a[_0x6791('0x23')]]){_[_0x6791('0x43')](this['channels'][_0x2bb86a[_0x6791('0x23')]],_[_0x6791('0x44')](_0x2bb86a,[_0x6791('0x45'),_0x6791('0x46')]));}};function updateStatus(_0x2b1656){if(_0x2b1656['AttachmentId']){faxMessage[_0x6791('0x47')](_0x2b1656[_0x6791('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x6791('0x3c')](function(_0x56f6c6){ut[_0x6791('0x49')](_0x6791('0x4a'),_0x56f6c6);})[_0x6791('0x3e')](function(_0x37e360){ut['logger'](_0x6791('0x4b'),_0x37e360);});}else{ut[_0x6791('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x6791('0x1b')][_0x6791('0x4c')]=function(_0x3a895b,_0x5df56e,_0x355e97){var _0x166b9a=this;var _0x54272c={};if(_0x5df56e){_0x54272c={'read':_0x5df56e};}else{_0x54272c={'failMessage':_0x355e97};}if(this[_0x6791('0xe')][_0x3a895b][_0x6791('0x48')]){faxMessage['update'](this[_0x6791('0xe')][_0x3a895b][_0x6791('0x48')],_0x54272c)[_0x6791('0x3c')](function(_0x285bfd){ut['logger'](_0x6791('0x4d'),_0x285bfd);})[_0x6791('0x3e')](function(_0x32f36b){ut['logger']('[Fax][Message][NoUpdate1]',_0x32f36b);})[_0x6791('0x4e')](function(){delete _0x166b9a[_0x6791('0x22')][_0x3a895b];delete _0x166b9a[_0x6791('0xe')][_0x3a895b];});}else{ut[_0x6791('0x49')](_0x6791('0x4f'));delete this['channels'][_0x3a895b];delete this['actions'][_0x3a895b];}};Fax[_0x6791('0x1b')]['syncHangup']=function(_0x51f071){var _0x8fc04b=this;if(this[_0x6791('0x22')][_0x51f071[_0x6791('0x23')]]){if(this[_0x6791('0xe')][_0x51f071[_0x6791('0x23')]]){this[_0x6791('0x22')][_0x51f071['uniqueid']]['id']=this['actions'][_0x51f071[_0x6791('0x23')]]['id'];this[_0x6791('0x22')][_0x51f071['uniqueid']][_0x6791('0x25')]=this['actions'][_0x51f071[_0x6791('0x23')]][_0x6791('0x25')];}logger['info'](_0x51f071[_0x6791('0x23')],this[_0x6791('0xe')][_0x51f071[_0x6791('0x23')]]?'\x20hangup\x20sendFile\x20':_0x6791('0x50'),JSON[_0x6791('0x41')](this[_0x6791('0x22')][_0x51f071[_0x6791('0x23')]]));if(this[_0x6791('0xe')][_0x51f071['uniqueid']]){if(this['channels'][_0x51f071[_0x6791('0x23')]][_0x6791('0x51')]>0x0&&this['channels'][_0x51f071[_0x6791('0x23')]][_0x6791('0x17')]===_0x6791('0x52')){this[_0x6791('0x4c')](_0x51f071[_0x6791('0x23')],!![]);}else{this[_0x6791('0x4c')](_0x51f071[_0x6791('0x23')],![],this[_0x6791('0x22')][_0x51f071['uniqueid']][_0x6791('0x53')]?_0x6791('0x54')+this[_0x6791('0x22')][_0x51f071[_0x6791('0x23')]]['faxstatusstring']:_0x6791('0x55'));}}}};Fax[_0x6791('0x1b')][_0x6791('0x56')]=function(_0x5ca809){var _0x205320=this;return new BPromise(function(_0x1fcbb6,_0x99d4ee){_0x205320[_0x6791('0x57')](_0x5ca809,_0x205320['faxAccounts'][_0x5ca809[_0x6791('0x58')]])[_0x6791('0x3c')](function(_0x5522db){ut[_0x6791('0x49')](_0x6791('0x59'),_0x5522db);_0x1fcbb6(ut[_0x6791('0x37')](_0x6791('0x5a')));})[_0x6791('0x3e')](function(_0x36d02a){ut['logger'](_0x6791('0x5b'),_0x36d02a);updateStatus(_0x5ca809);_0x99d4ee(ut[_0x6791('0x37')](_0x6791('0x5c')));});});};Fax['prototype'][_0x6791('0x5d')]=function(_0x530e1c){var _0x2648fa=this;return new BPromise(function(_0x11f3b2,_0xf0941a){var _0x2d5818=_0x2648fa[_0x6791('0x5e')](_0x2648fa['faxAccounts'][_0x530e1c[_0x6791('0x58')]][_0x6791('0x5f')],_0x530e1c);if(_0x2d5818[_0x6791('0x60')]){_0x11f3b2(ut[_0x6791('0x37')]('Trunk\x20Reachable'));}else{_0xf0941a(ut[_0x6791('0x37')](_0x2d5818[_0x6791('0x37')]));}});};function originate(_0x546995,_0x34691c,_0x1fa44a){return new BPromise(function(_0x567302,_0x201465){if(_0x1fa44a){var _0x23b9b4=util[_0x6791('0x61')](_0x6791('0x62'),path['parse'](_0x546995[_0x6791('0x3')])[_0x6791('0x25')],_0x546995['path']);gs[_0x6791('0x63')](_0x23b9b4)[_0x6791('0x3c')](function(){_0x546995[_0x6791('0x3')]=util[_0x6791('0x61')](_0x6791('0x64'),path['parse'](_0x546995[_0x6791('0x3')])[_0x6791('0x65')],path['parse'](_0x546995[_0x6791('0x3')])[_0x6791('0x25')]);_0x34691c[_0x6791('0x66')]=_0x546995['path'];ut[_0x6791('0x49')](_0x6791('0x67'),'');ami[_0x6791('0x68')](ut[_0x6791('0x69')](_0x546995,_0x34691c))[_0x6791('0x3c')](function(_0x1a1c3b){_0x567302(_0x1a1c3b);})[_0x6791('0x3e')](function(_0x30b3e6){_0x201465(_0x30b3e6);});})['catch'](function(_0x2ec629){_0x201465(_0x2ec629);});}else{ami[_0x6791('0x68')](ut['variablesAction'](_0x546995,_0x34691c))[_0x6791('0x3c')](function(_0x2b39d1){_0x567302(_0x2b39d1);})[_0x6791('0x3e')](function(_0x4bca9f){_0x201465(_0x4bca9f);});}});}Fax[_0x6791('0x1b')]['execOriginate']=function(_0xa1e941,_0x304e2a){var _0x126732=this;return new BPromise(function(_0x30d606,_0x3a964a){var _0x2d15b5=uuid['v4']();var _0x45712e=ut[_0x6791('0x6a')](_0xa1e941,_0x304e2a);_0x126732[_0x6791('0xe')][_0x2d15b5]=new Action(_0x2d15b5,_0x304e2a,_0xa1e941);var _0x1fa853=_0x126732[_0x6791('0xe')][_0x2d15b5];if(path[_0x6791('0x39')](_0xa1e941[_0x6791('0x3')])[_0x6791('0x6b')]===_0x6791('0x3a')){originate(_0x1fa853,_0x45712e,!![])[_0x6791('0x3c')](function(_0x3b53b8){_0x30d606(_0x3b53b8);})[_0x6791('0x3e')](function(_0xc6c959){_0x3a964a(_0xc6c959);});}else{originate(_0x1fa853,_0x45712e,![])['then'](function(_0x49e48e){_0x30d606(_0x49e48e);})['catch'](function(_0x15af12){_0x3a964a(_0x15af12);});}});};Fax[_0x6791('0x1b')][_0x6791('0x6c')]=function(_0x194a0b){return!_[_0x6791('0x6d')](_0x194a0b)&&!_[_0x6791('0x6d')](_0x194a0b[_0x6791('0x25')])&&!_[_0x6791('0x6d')](_0x194a0b[_0x6791('0x6e')])&&_0x194a0b[_0x6791('0x6e')]&&!_[_0x6791('0x6d')](this[_0x6791('0xd')][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b[_0x6791('0x25')])])&&!_[_0x6791('0x6d')](this[_0x6791('0xd')][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b[_0x6791('0x25')])][_0x6791('0x2c')])&&(this[_0x6791('0xd')][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b[_0x6791('0x25')])]['status']===_0x6791('0x70')||this['trunks'][util[_0x6791('0x61')](_0x6791('0x6f'),_0x194a0b['name'])][_0x6791('0x2c')]==='unmonitored');};Fax[_0x6791('0x1b')][_0x6791('0x5e')]=function(_0x5945cb,_0x33ed3b){if(!this[_0x6791('0x6c')](_0x5945cb)){ut[_0x6791('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x6791('0x6d')](_0x5945cb)?'':_0x5945cb[_0x6791('0x25')]+_0x6791('0x71'));return{'isValid':![],'message':_0x6791('0x72')};}if(_[_0x6791('0x6d')](_0x33ed3b[_0x6791('0x3d')])){ut['logger'](_0x6791('0x73'),JSON[_0x6791('0x41')](_0x33ed3b));return{'isValid':![],'message':_0x6791('0x74')};}if(_[_0x6791('0x6d')](_0x33ed3b[_0x6791('0x3')])){ut[_0x6791('0x49')](_0x6791('0x75'),JSON['stringify'](_0x33ed3b));return{'isValid':![],'message':_0x6791('0x76')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x6791('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f3b51f5..8074307 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 _0x92d6=['catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','inspect','resolve','then','notify'];(function(_0x5e131c,_0x47f9d2){var _0x2c35ff=function(_0xc1ec72){while(--_0xc1ec72){_0x5e131c['push'](_0x5e131c['shift']());}};_0x2c35ff(++_0x47f9d2);}(_0x92d6,0xc8));var _0x692d=function(_0x6f9285,_0xc7a118){_0x6f9285=_0x6f9285-0x0;var _0x1f324d=_0x92d6[_0x6f9285];return _0x1f324d;};'use strict';var util=require(_0x692d('0x0'));var BPromise=require(_0x692d('0x1'));var logger=require(_0x692d('0x2'))(_0x692d('0x3'));var _=require(_0x692d('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x23152e){return function(_0x2a328a){logger['error'](_0x23152e,util[_0x692d('0x5')](_0x2a328a,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x125c7d,_0x5787e1){return BPromise[_0x692d('0x6')]()[_0x692d('0x7')](faxAccount[_0x692d('0x8')](_0x125c7d,_0x5787e1))[_0x692d('0x9')](loggerCatch(_0x692d('0xa')));}; \ No newline at end of file +var _0xb5da=['then','catch','[Notify]\x20','../../../config/logger','preview','lodash','../rpc/faxAccount','notify','resolve'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb5da,0x1ce));var _0xab5d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb5da[_0x502c7d];return _0x30b7ed;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xab5d('0x0'))(_0xab5d('0x1'));var _=require(_0xab5d('0x2'));var faxAccount=require(_0xab5d('0x3'));function loggerCatch(_0x22569e){return function(_0x1067ae){logger['error'](_0x22569e,util['inspect'](_0x1067ae,{'showHidden':![],'depth':null}));};}exports[_0xab5d('0x4')]=function(_0x518349,_0x54b893){return BPromise[_0xab5d('0x5')]()[_0xab5d('0x6')](faxAccount[_0xab5d('0x4')](_0x518349,_0x54b893))[_0xab5d('0x7')](loggerCatch(_0xab5d('0x8')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index e799661..eaf7148 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 _0xb2bb=['../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x568a97,_0x1686a7){var _0x5080e4=function(_0xd584fa){while(--_0xd584fa){_0x568a97['push'](_0x568a97['shift']());}};_0x5080e4(++_0x1686a7);}(_0xb2bb,0x1d8));var _0xbb2b=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0xb2bb[_0x2abc3d];return _0x252745;};'use strict';var util=require(_0xbb2b('0x0'));var logger=require(_0xbb2b('0x1'))(_0xbb2b('0x2'));var BPromise=require(_0xbb2b('0x3'));var exec=require(_0xbb2b('0x4'))[_0xbb2b('0x5')];exports[_0xbb2b('0x6')]=function(_0x11dfdb){return new BPromise(function(_0x4b8c71,_0x32877a){exec(_0x11dfdb,function(_0x3457b2,_0xfb366b,_0x221d13){logger[_0xbb2b('0x7')](_0xbb2b('0x8'),_0xfb366b);if(_0x3457b2){logger[_0xbb2b('0x7')](_0xbb2b('0x8'),_0xbb2b('0x9'),util[_0xbb2b('0xa')](_0x3457b2,{'showHidden':![],'depth':null}),_0xfb366b,_0x221d13);_0x32877a(_0x3457b2);}_0x4b8c71(_0xfb366b);});});}; \ No newline at end of file +var _0xbbc2=['Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x5926bd,_0x5c8ddf){var _0x2b1633=function(_0x17c275){while(--_0x17c275){_0x5926bd['push'](_0x5926bd['shift']());}};_0x2b1633(++_0x5c8ddf);}(_0xbbc2,0xb7));var _0x2bbc=function(_0x2131e0,_0x34f5cd){_0x2131e0=_0x2131e0-0x0;var _0x4ecb5f=_0xbbc2[_0x2131e0];return _0x4ecb5f;};'use strict';var util=require('util');var logger=require(_0x2bbc('0x0'))(_0x2bbc('0x1'));var BPromise=require(_0x2bbc('0x2'));var exec=require(_0x2bbc('0x3'))[_0x2bbc('0x4')];exports[_0x2bbc('0x5')]=function(_0x50cdc9){return new BPromise(function(_0x32bac9,_0x53d855){exec(_0x50cdc9,function(_0xd7a362,_0x4141ce,_0x19db2b){logger[_0x2bbc('0x6')](_0x2bbc('0x7'),_0x4141ce);if(_0xd7a362){logger['info'](_0x2bbc('0x7'),_0x2bbc('0x8'),util[_0x2bbc('0x9')](_0xd7a362,{'showHidden':![],'depth':null}),_0x4141ce,_0x19db2b);_0x53d855(_0xd7a362);}_0x32bac9(_0x4141ce);});});}; \ 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 6e834ca..35b70a3 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 _0x8f74=['moment','../../../../config/logger','message','logger','inspect','addVariables','headerinfo','minrate','\x22%s\x22','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x8f74,0x1e0));var _0x48f7=function(_0x8db5a4,_0x30c14f){_0x8db5a4=_0x8db5a4-0x0;var _0x717a1=_0x8f74[_0x8db5a4];return _0x717a1;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x48f7('0x0'));var logger=require(_0x48f7('0x1'))('fax');exports[_0x48f7('0x2')]=function(_0x42005b){return{'message':_0x42005b};};exports[_0x48f7('0x3')]=function(_0x592d7d,_0x6264b6){logger['info'](_0x592d7d,util[_0x48f7('0x4')](_0x6264b6,{'showHidden':![],'depth':null}));};exports[_0x48f7('0x5')]=function(_0x14721a,_0x379db8){var _0x36f34c={'XMF-ECM':_0x379db8['ecm'],'XMF-HEADERINFO':_0x379db8[_0x48f7('0x6')],'XMF-MINRATE':_0x379db8[_0x48f7('0x7')],'XMF-MAXRATE':_0x379db8['maxrate'],'XMF-MODEM':util['format'](_0x48f7('0x8'),_0x379db8['modem']),'XMF-GATEWAY':_0x379db8['gateway'],'XMF-FAXDETECT':_0x379db8[_0x48f7('0x9')],'XMF-T38TIMEOUT':_0x379db8[_0x48f7('0xa')],'XMF-LOCALSTATIONID':_0x379db8[_0x48f7('0xb')],'XMF-PATH':_0x14721a[_0x48f7('0xc')]};return _0x36f34c;};exports[_0x48f7('0xd')]=function(_0x4c854f,_0x138f98){return{'actionid':_0x4c854f[_0x48f7('0xe')],'action':_0x48f7('0xf'),'channel':_0x4c854f[_0x48f7('0x10')],'Exten':_0x48f7('0x11'),'Context':_0x48f7('0x12'),'Priority':'1','callerid':util['format'](_0x48f7('0x13'),_0x4c854f[_0x48f7('0x6')]?_0x4c854f['headerinfo']:'',_0x4c854f[_0x48f7('0xb')]),'variable':_0x138f98,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4c854f[_0x48f7('0xe')]};}; \ No newline at end of file +var _0xde49=['inspect','addVariables','headerinfo','minrate','maxrate','format','modem','gateway','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','localstationid','util','lodash','fax','info'];(function(_0x2d93fd,_0x392681){var _0xfddbf7=function(_0x2aa3a7){while(--_0x2aa3a7){_0x2d93fd['push'](_0x2d93fd['shift']());}};_0xfddbf7(++_0x392681);}(_0xde49,0x119));var _0x9de4=function(_0x41a5f4,_0x26a022){_0x41a5f4=_0x41a5f4-0x0;var _0x3bf6af=_0xde49[_0x41a5f4];return _0x3bf6af;};'use strict';var util=require(_0x9de4('0x0'));var _=require(_0x9de4('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x9de4('0x2'));exports['message']=function(_0x4f1211){return{'message':_0x4f1211};};exports['logger']=function(_0x23ef49,_0x143120){logger[_0x9de4('0x3')](_0x23ef49,util[_0x9de4('0x4')](_0x143120,{'showHidden':![],'depth':null}));};exports[_0x9de4('0x5')]=function(_0x4c0d41,_0x1cfd0b){var _0x35bf7a={'XMF-ECM':_0x1cfd0b['ecm'],'XMF-HEADERINFO':_0x1cfd0b[_0x9de4('0x6')],'XMF-MINRATE':_0x1cfd0b[_0x9de4('0x7')],'XMF-MAXRATE':_0x1cfd0b[_0x9de4('0x8')],'XMF-MODEM':util[_0x9de4('0x9')]('\x22%s\x22',_0x1cfd0b[_0x9de4('0xa')]),'XMF-GATEWAY':_0x1cfd0b[_0x9de4('0xb')],'XMF-FAXDETECT':_0x1cfd0b['faxdetect'],'XMF-T38TIMEOUT':_0x1cfd0b['t38timeout'],'XMF-LOCALSTATIONID':_0x1cfd0b['localstationid'],'XMF-PATH':_0x4c0d41['path']};return _0x35bf7a;};exports[_0x9de4('0xc')]=function(_0x478d4b,_0x9746c8){return{'actionid':_0x478d4b[_0x9de4('0xd')],'action':_0x9de4('0xe'),'channel':_0x478d4b[_0x9de4('0xf')],'Exten':_0x9de4('0x10'),'Context':'from-sip','Priority':'1','callerid':util[_0x9de4('0x9')](_0x9de4('0x11'),_0x478d4b[_0x9de4('0x6')]?_0x478d4b[_0x9de4('0x6')]:'',_0x478d4b[_0x9de4('0x12')]),'variable':_0x9746c8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x478d4b[_0x9de4('0xd')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 2708aa1..c52b0db 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 _0xa359=['initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','[index.js][initParams]','inspect','listen','catch','[index.js][main]','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','then','initAgents','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts'];(function(_0x5a028c,_0x5c1a96){var _0x16448c=function(_0x44a25c){while(--_0x44a25c){_0x5a028c['push'](_0x5a028c['shift']());}};_0x16448c(++_0x5c1a96);}(_0xa359,0x184));var _0x9a35=function(_0x5c2f03,_0x549239){_0x5c2f03=_0x5c2f03-0x0;var _0x1f3105=_0xa359[_0x5c2f03];return _0x1f3105;};'use strict';var BPromise=require('bluebird');var util=require(_0x9a35('0x0'));var moment=require(_0x9a35('0x1'));var server=require(_0x9a35('0x2'));var Realtime=require(_0x9a35('0x3'));var Report=require(_0x9a35('0x4'));var Acw=require('./acw');var Trigger=require(_0x9a35('0x5'));var Dialer=require(_0x9a35('0x6'));var Preview=require(_0x9a35('0x7'));var Fax=require('./fax');var user=require(_0x9a35('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x9a35('0x9'));var voiceCallReport=require(_0x9a35('0xa'));var trunk=require(_0x9a35('0xb'));var trigger=require(_0x9a35('0xc'));var template=require(_0x9a35('0xd'));var cmHopperHistory=require(_0x9a35('0xe'));var campaign=require(_0x9a35('0xf'));var voiceExtension=require(_0x9a35('0x10'));var faxAccount=require(_0x9a35('0x11'));var zendesk=require(_0x9a35('0x12'));var salesforce=require(_0x9a35('0x13'));var sugarcrm=require(_0x9a35('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x9a35('0x15'));var zoho=require(_0x9a35('0x16'));var vtiger=require(_0x9a35('0x17'));var freshsales=require(_0x9a35('0x18'));var servicenow=require(_0x9a35('0x19'));var dynamics365=require(_0x9a35('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x9a35('0x1b'))(_0x9a35('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x9a35('0x1d')](_0x9a35('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9a35('0x1d')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x9a35('0x1f')]()['then'](user[_0x9a35('0x20')]())[_0x9a35('0x21')](realtime[_0x9a35('0x22')]())[_0x9a35('0x21')](user['getTelephones']())['then'](realtime[_0x9a35('0x23')]())[_0x9a35('0x21')](trunk[_0x9a35('0x24')]())[_0x9a35('0x21')](realtime['initTrunks']())[_0x9a35('0x21')](voiceQueue['getVoiceQueues']())['then'](realtime[_0x9a35('0x25')]())[_0x9a35('0x21')](trigger[_0x9a35('0x26')]())[_0x9a35('0x21')](realtime[_0x9a35('0x27')]())[_0x9a35('0x21')](template[_0x9a35('0x28')]())[_0x9a35('0x21')](realtime[_0x9a35('0x29')]())['then'](zendesk[_0x9a35('0x2a')]())[_0x9a35('0x21')](realtime[_0x9a35('0x2b')]())[_0x9a35('0x21')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x9a35('0x2c')]())['then'](sugarcrm[_0x9a35('0x2d')]())[_0x9a35('0x21')](realtime['initSugarcrmAccounts']())[_0x9a35('0x21')](freshdesk[_0x9a35('0x2e')]())[_0x9a35('0x21')](realtime[_0x9a35('0x2f')]())[_0x9a35('0x21')](desk[_0x9a35('0x30')]())[_0x9a35('0x21')](realtime['initDeskAccounts']())[_0x9a35('0x21')](zoho[_0x9a35('0x31')]())[_0x9a35('0x21')](realtime[_0x9a35('0x32')]())[_0x9a35('0x21')](vtiger[_0x9a35('0x33')]())['then'](realtime[_0x9a35('0x34')]())[_0x9a35('0x21')](freshsales[_0x9a35('0x35')]())[_0x9a35('0x21')](realtime[_0x9a35('0x36')]())[_0x9a35('0x21')](servicenow[_0x9a35('0x37')]())[_0x9a35('0x21')](realtime[_0x9a35('0x38')]())[_0x9a35('0x21')](dynamics365[_0x9a35('0x39')]())['then'](realtime[_0x9a35('0x3a')]())[_0x9a35('0x21')](campaign[_0x9a35('0x3b')]())[_0x9a35('0x21')](realtime['initCampaigns']())[_0x9a35('0x21')](voiceExtension['getVoiceExtensions']())[_0x9a35('0x21')](realtime[_0x9a35('0x3c')]())[_0x9a35('0x21')](faxAccount[_0x9a35('0x3d')]())[_0x9a35('0x21')](realtime[_0x9a35('0x3e')]())[_0x9a35('0x21')](function(){return realtime;});}function initParams(){return BPromise[_0x9a35('0x1f')]()['then'](voiceQueueReport[_0x9a35('0x3f')]())[_0x9a35('0x21')](realtime[_0x9a35('0x40')]())[_0x9a35('0x21')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x9a35('0x21')](realtime[_0x9a35('0x41')]())[_0x9a35('0x21')](cmHopperHistory[_0x9a35('0x42')]())['then'](realtime['initCampaignHopperHistory']())[_0x9a35('0x21')](voiceCallReport[_0x9a35('0x43')]())[_0x9a35('0x21')](realtime['initVoiceCallReports']())['catch'](function(_0x3ea085){logger['error'](_0x9a35('0x44'),util[_0x9a35('0x45')](_0x3ea085,{'showHidden':![],'depth':null}));});}function main(){return server[_0x9a35('0x46')](realtime,preview,fax)[_0x9a35('0x21')](function(_0x13c4b1){return initRealtime();})[_0x9a35('0x21')](function(){return initParams();})[_0x9a35('0x21')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x9a35('0x47')](function(_0x1fe72f){logger['error'](_0x9a35('0x48'),util['inspect'](_0x1fe72f,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x499a=['initDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','bluebird','./server','./realtime','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','hour','then','getAgents','initAgents','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x499a,0x16b));var _0xa499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x499a[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xa499('0x0'));var util=require('util');var moment=require('moment');var server=require(_0xa499('0x1'));var Realtime=require(_0xa499('0x2'));var Report=require('./report');var Acw=require(_0xa499('0x3'));var Trigger=require('./trigger');var Dialer=require(_0xa499('0x4'));var Preview=require(_0xa499('0x5'));var Fax=require('./fax');var user=require(_0xa499('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xa499('0x7'));var voiceCallReport=require(_0xa499('0x8'));var trunk=require(_0xa499('0x9'));var trigger=require(_0xa499('0xa'));var template=require(_0xa499('0xb'));var cmHopperHistory=require(_0xa499('0xc'));var campaign=require(_0xa499('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xa499('0xe'));var zendesk=require(_0xa499('0xf'));var salesforce=require(_0xa499('0x10'));var sugarcrm=require(_0xa499('0x11'));var freshdesk=require(_0xa499('0x12'));var desk=require(_0xa499('0x13'));var zoho=require(_0xa499('0x14'));var vtiger=require(_0xa499('0x15'));var freshsales=require(_0xa499('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xa499('0x17'));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(_0xa499('0x18'))(_0xa499('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xa499('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xa499('0x1b')](user[_0xa499('0x1c')]())[_0xa499('0x1b')](realtime[_0xa499('0x1d')]())[_0xa499('0x1b')](user['getTelephones']())[_0xa499('0x1b')](realtime['initTelephones']())[_0xa499('0x1b')](trunk['getTrunks']())[_0xa499('0x1b')](realtime[_0xa499('0x1e')]())['then'](voiceQueue[_0xa499('0x1f')]())['then'](realtime[_0xa499('0x20')]())['then'](trigger[_0xa499('0x21')]())[_0xa499('0x1b')](realtime[_0xa499('0x22')]())[_0xa499('0x1b')](template[_0xa499('0x23')]())[_0xa499('0x1b')](realtime[_0xa499('0x24')]())[_0xa499('0x1b')](zendesk[_0xa499('0x25')]())['then'](realtime[_0xa499('0x26')]())[_0xa499('0x1b')](salesforce['getSalesforceAccounts']())[_0xa499('0x1b')](realtime[_0xa499('0x27')]())[_0xa499('0x1b')](sugarcrm[_0xa499('0x28')]())[_0xa499('0x1b')](realtime['initSugarcrmAccounts']())[_0xa499('0x1b')](freshdesk[_0xa499('0x29')]())[_0xa499('0x1b')](realtime[_0xa499('0x2a')]())['then'](desk[_0xa499('0x2b')]())[_0xa499('0x1b')](realtime['initDeskAccounts']())[_0xa499('0x1b')](zoho[_0xa499('0x2c')]())['then'](realtime[_0xa499('0x2d')]())['then'](vtiger['getVtigerAccounts']())['then'](realtime[_0xa499('0x2e')]())[_0xa499('0x1b')](freshsales[_0xa499('0x2f')]())[_0xa499('0x1b')](realtime['initFreshsalesAccounts']())[_0xa499('0x1b')](servicenow[_0xa499('0x30')]())['then'](realtime[_0xa499('0x31')]())[_0xa499('0x1b')](dynamics365[_0xa499('0x32')]())[_0xa499('0x1b')](realtime[_0xa499('0x33')]())[_0xa499('0x1b')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0xa499('0x1b')](voiceExtension[_0xa499('0x34')]())[_0xa499('0x1b')](realtime[_0xa499('0x35')]())[_0xa499('0x1b')](faxAccount[_0xa499('0x36')]())[_0xa499('0x1b')](realtime[_0xa499('0x37')]())[_0xa499('0x1b')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xa499('0x1b')](voiceQueueReport[_0xa499('0x38')]())[_0xa499('0x1b')](realtime[_0xa499('0x39')]())[_0xa499('0x1b')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xa499('0x3a')]())[_0xa499('0x1b')](cmHopperHistory[_0xa499('0x3b')]())[_0xa499('0x1b')](realtime[_0xa499('0x3c')]())['then'](voiceCallReport[_0xa499('0x3d')]())[_0xa499('0x1b')](realtime[_0xa499('0x3e')]())[_0xa499('0x3f')](function(_0x2f698f){logger['error'](_0xa499('0x40'),util[_0xa499('0x41')](_0x2f698f,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa499('0x42')](realtime,preview,fax)[_0xa499('0x1b')](function(_0xefa372){return initRealtime();})[_0xa499('0x1b')](function(){return initParams();})[_0xa499('0x1b')](function(){report[_0xa499('0x43')]();setInterval(initRealtime,0x1388);})[_0xa499('0x3f')](function(_0x4bfbab){logger[_0xa499('0x44')]('[index.js][main]',util[_0xa499('0x41')](_0x4bfbab,{'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 c2f067e..ed257fe 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 _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0xbf0351,_0x46d4fa){var _0x7b99a6=function(_0x2d36bb){while(--_0x2d36bb){_0xbf0351['push'](_0xbf0351['shift']());}};_0x7b99a6(++_0x46d4fa);}(_0x34e8,0x12c));var _0x834e=function(_0x61727e,_0x2ce08d){_0x61727e=_0x61727e-0x0;var _0xa637c9=_0x34e8[_0x61727e];return _0xa637c9;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x4ca3b4,_0x2450bc){var _0x51ea64=function(_0x1bdfd4){while(--_0x1bdfd4){_0x4ca3b4['push'](_0x4ca3b4['shift']());}};_0x51ea64(++_0x2450bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 20322a6..e791e3c 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 _0x907a=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x5f0f74,_0x556796){var _0xdbb1a5=function(_0x3298e7){while(--_0x3298e7){_0x5f0f74['push'](_0x5f0f74['shift']());}};_0xdbb1a5(++_0x556796);}(_0x907a,0x11b));var _0xa907=function(_0x5840f6,_0x49337e){_0x5840f6=_0x5840f6-0x0;var _0x235deb=_0x907a[_0x5840f6];return _0x235deb;};'use strict';function Campaign(_0x135c42){this['id']=_0x135c42['id']||0x0;this[_0xa907('0x0')]=_0x135c42[_0xa907('0x0')]||'';this['type']=_0x135c42['type']||_0xa907('0x1');this[_0xa907('0x2')]=0x0;this[_0xa907('0x3')]=0x0;this[_0xa907('0x4')]=0x0;this[_0xa907('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0xa907('0x6')]=_0x135c42[_0xa907('0x6')];this[_0xa907('0x7')]=_0x135c42[_0xa907('0x7')];this[_0xa907('0x8')]=_0x135c42['dialTimezone']||null;this[_0xa907('0x9')]=_0x135c42[_0xa907('0x9')]?_0x135c42[_0xa907('0x9')]:null;this['dialOriginateCallerIdName']=_0x135c42[_0xa907('0xa')];this['dialOriginateCallerIdNumber']=_0x135c42[_0xa907('0xb')];this[_0xa907('0xc')]=_0x135c42['dialOriginateTimeout']||0x1e;this[_0xa907('0xd')]=_0x135c42[_0xa907('0xd')];this[_0xa907('0xe')]=_0x135c42[_0xa907('0xe')];this['dialBusyMaxRetry']=_0x135c42[_0xa907('0xf')];this[_0xa907('0x10')]=_0x135c42[_0xa907('0x10')];this[_0xa907('0x11')]=_0x135c42[_0xa907('0x11')];this[_0xa907('0x12')]=_0x135c42['dialNoAnswerRetryFrequency'];this[_0xa907('0x13')]=_0x135c42[_0xa907('0x13')];this[_0xa907('0x14')]=_0x135c42[_0xa907('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x135c42[_0xa907('0x15')]||0x96;this[_0xa907('0x16')]=_0x135c42['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x135c42[_0xa907('0x17')]||0x96;this[_0xa907('0x18')]=_0x135c42[_0xa907('0x18')]||0x3;this[_0xa907('0x19')]=_0x135c42[_0xa907('0x19')]||0x96;this['dialMachineMaxRetry']=_0x135c42[_0xa907('0x1a')]||0x3;this[_0xa907('0x1b')]=_0x135c42[_0xa907('0x1b')]||0x96;this[_0xa907('0x1c')]=_0x135c42['dialAgentRejectMaxRetry']||0x3;this[_0xa907('0x1d')]=_0x135c42[_0xa907('0x1d')]||0x96;this[_0xa907('0x1e')]=_0x135c42[_0xa907('0x1e')]||_0xa907('0x1f');this['dialPrefix']=_0x135c42[_0xa907('0x20')]||undefined;this[_0xa907('0x21')]=_0x135c42['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa907('0x22')]=_0x135c42['dialCutDigit']||undefined;this[_0xa907('0x23')]=_0x135c42['TrunkBackup']?_0x135c42['TrunkBackup']:undefined;this[_0xa907('0x24')]=_0x135c42['Trunk']?_0x135c42[_0xa907('0x24')]:undefined;this[_0xa907('0x25')]=_0x135c42[_0xa907('0x25')]?_0x135c42[_0xa907('0x25')]:undefined;this[_0xa907('0x26')]=_0x135c42['SquareProject']?_0x135c42[_0xa907('0x26')]:undefined;this[_0xa907('0x27')]=_0x135c42[_0xa907('0x26')]?_0x135c42[_0xa907('0x26')]['name']:undefined;this['dialAMDActive']=_0x135c42['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x135c42[_0xa907('0x28')];this['dialAMDGreeting']=_0x135c42[_0xa907('0x29')];this[_0xa907('0x2a')]=_0x135c42[_0xa907('0x2a')];this[_0xa907('0x2b')]=_0x135c42[_0xa907('0x2b')];this[_0xa907('0x2c')]=_0x135c42[_0xa907('0x2c')];this[_0xa907('0x2d')]=_0x135c42[_0xa907('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x135c42[_0xa907('0x2e')];this[_0xa907('0x2f')]=_0x135c42[_0xa907('0x2f')];this['dialAMDMaximumWordLength']=_0x135c42[_0xa907('0x30')];}module[_0xa907('0x31')]=Campaign; \ No newline at end of file +var _0xe768=['Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x244f51,_0x3645f4){var _0x497d00=function(_0x497ef2){while(--_0x497ef2){_0x244f51['push'](_0x244f51['shift']());}};_0x497d00(++_0x3645f4);}(_0xe768,0x12e));var _0x8e76=function(_0x5e7d16,_0x43c659){_0x5e7d16=_0x5e7d16-0x0;var _0x4b2104=_0xe768[_0x5e7d16];return _0x4b2104;};'use strict';function Campaign(_0x448521){this['id']=_0x448521['id']||0x0;this[_0x8e76('0x0')]=_0x448521[_0x8e76('0x0')]||'';this['type']=_0x448521[_0x8e76('0x1')]||'campaign';this['originated']=0x0;this[_0x8e76('0x2')]=0x0;this[_0x8e76('0x3')]=0x0;this[_0x8e76('0x4')]=0x0;this[_0x8e76('0x5')]='';this[_0x8e76('0x6')]=!![];this['active']=_0x448521[_0x8e76('0x7')];this[_0x8e76('0x8')]=_0x448521['limitCalls'];this[_0x8e76('0x9')]=_0x448521['dialTimezone']||null;this['dialGlobalInterval']=_0x448521[_0x8e76('0xa')]?_0x448521[_0x8e76('0xa')]:null;this[_0x8e76('0xb')]=_0x448521['dialOriginateCallerIdName'];this[_0x8e76('0xc')]=_0x448521[_0x8e76('0xc')];this['dialOriginateTimeout']=_0x448521[_0x8e76('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x448521[_0x8e76('0xe')];this['dialCongestionRetryFrequency']=_0x448521[_0x8e76('0xf')];this[_0x8e76('0x10')]=_0x448521[_0x8e76('0x10')];this[_0x8e76('0x11')]=_0x448521[_0x8e76('0x11')];this[_0x8e76('0x12')]=_0x448521[_0x8e76('0x12')];this[_0x8e76('0x13')]=_0x448521['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x448521[_0x8e76('0x14')];this['dialNoSuchNumberMaxRetry']=_0x448521['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x448521[_0x8e76('0x15')]||0x96;this[_0x8e76('0x16')]=_0x448521['dialDropMaxRetry']||0x3;this[_0x8e76('0x17')]=_0x448521[_0x8e76('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x448521[_0x8e76('0x18')]||0x3;this[_0x8e76('0x19')]=_0x448521[_0x8e76('0x19')]||0x96;this[_0x8e76('0x1a')]=_0x448521[_0x8e76('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x448521['dialMachineRetryFrequency']||0x96;this[_0x8e76('0x1b')]=_0x448521[_0x8e76('0x1b')]||0x3;this[_0x8e76('0x1c')]=_0x448521['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x448521[_0x8e76('0x1d')]||'DESC';this[_0x8e76('0x1e')]=_0x448521['dialPrefix']||undefined;this[_0x8e76('0x1f')]=_0x448521[_0x8e76('0x1f')]||undefined;this[_0x8e76('0x20')]=_0x448521[_0x8e76('0x20')]||undefined;this[_0x8e76('0x21')]=_0x448521[_0x8e76('0x21')]?_0x448521[_0x8e76('0x21')]:undefined;this[_0x8e76('0x22')]=_0x448521[_0x8e76('0x22')]?_0x448521[_0x8e76('0x22')]:undefined;this['Interval']=_0x448521['Interval']?_0x448521[_0x8e76('0x23')]:undefined;this[_0x8e76('0x24')]=_0x448521['SquareProject']?_0x448521['SquareProject']:undefined;this['dialQueueProject']=_0x448521[_0x8e76('0x24')]?_0x448521[_0x8e76('0x24')][_0x8e76('0x0')]:undefined;this[_0x8e76('0x25')]=_0x448521[_0x8e76('0x25')]||![];this[_0x8e76('0x26')]=_0x448521['dialAMDInitialSilence'];this[_0x8e76('0x27')]=_0x448521[_0x8e76('0x27')];this[_0x8e76('0x28')]=_0x448521[_0x8e76('0x28')];this[_0x8e76('0x29')]=_0x448521[_0x8e76('0x29')];this['dialAMDMinWordLength']=_0x448521[_0x8e76('0x2a')];this[_0x8e76('0x2b')]=_0x448521[_0x8e76('0x2b')];this[_0x8e76('0x2c')]=_0x448521[_0x8e76('0x2c')];this[_0x8e76('0x2d')]=_0x448521['dialAMDSilenceThreshold'];this[_0x8e76('0x2e')]=_0x448521[_0x8e76('0x2e')];}module[_0x8e76('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index d8c3c7d..2ff0ee0 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 _0xc3b7=['queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','answered','answertime','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x527245,_0xbb9a5e){_0x527245=_0x527245-0x0;var _0x2520ce=_0xc3b7[_0x527245];return _0x2520ce;};'use strict';function Channel(){this['starttime']=null;this[_0x7c3b('0x0')]='';this[_0x7c3b('0x1')]='';this[_0x7c3b('0x2')]=0x0;this[_0x7c3b('0x3')]='';this[_0x7c3b('0x4')]=undefined;this[_0x7c3b('0x5')]=undefined;this[_0x7c3b('0x6')]=0x0;this[_0x7c3b('0x7')]='';this[_0x7c3b('0x8')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x7c3b('0x9')]=![];this[_0x7c3b('0xa')]=null;this[_0x7c3b('0xb')]=null;this[_0x7c3b('0xc')]=![];this['abandoned']=![];this[_0x7c3b('0xd')]='';this[_0x7c3b('0xe')]='';this[_0x7c3b('0xf')]=0x0;this[_0x7c3b('0x10')]=0x0;this[_0x7c3b('0x11')]=0x0;this[_0x7c3b('0x12')]=null;this[_0x7c3b('0x13')]=null;this[_0x7c3b('0x14')]=null;this[_0x7c3b('0x15')]=![];this[_0x7c3b('0x16')]=null;this[_0x7c3b('0x17')]=null;this[_0x7c3b('0x18')]=[];this[_0x7c3b('0x19')]=undefined;this[_0x7c3b('0x1a')]=undefined;this['transferType']=undefined;this[_0x7c3b('0x1b')]=0x0;}module[_0x7c3b('0x1c')]=Channel; \ No newline at end of file +var _0x3423=['lastdata','duration','billableseconds','tag','monitors','transfercalleridnum','transferType','exports','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication'];(function(_0x5ec1f4,_0x450ec7){var _0x81db00=function(_0x575c0a){while(--_0x575c0a){_0x5ec1f4['push'](_0x5ec1f4['shift']());}};_0x81db00(++_0x450ec7);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x3342('0x0')]='';this[_0x3342('0x1')]=0x0;this[_0x3342('0x2')]='';this[_0x3342('0x3')]=undefined;this[_0x3342('0x4')]=undefined;this[_0x3342('0x5')]=0x0;this[_0x3342('0x6')]='';this[_0x3342('0x7')]=0x0;this[_0x3342('0x8')]=0x0;this[_0x3342('0x9')]=0x0;this[_0x3342('0xa')]=![];this[_0x3342('0xb')]=null;this[_0x3342('0xc')]=null;this[_0x3342('0xd')]=![];this[_0x3342('0xe')]=![];this[_0x3342('0xf')]='';this[_0x3342('0x10')]='';this[_0x3342('0x11')]=0x0;this[_0x3342('0x12')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x3342('0x13')]=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0x3342('0x14')]=[];this[_0x3342('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x3342('0x16')]=undefined;this['mohtime']=0x0;}module[_0x3342('0x17')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 5db0a52..508e060 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 _0xd1ba=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0xd1ba,0x9f));var _0xad1b=function(_0x5f5c4e,_0x2a2bd0){_0x5f5c4e=_0x5f5c4e-0x0;var _0x265957=_0xd1ba[_0x5f5c4e];return _0x265957;};'use strict';function DeskAccount(_0xd5540b){this['id']=_0xd5540b['id']||0x0;this['name']=_0xd5540b[_0xad1b('0x0')]||'';this[_0xad1b('0x1')]=_0xd5540b[_0xad1b('0x1')]||'';this[_0xad1b('0x2')]=_0xd5540b[_0xad1b('0x2')]||'';this[_0xad1b('0x3')]=_0xd5540b['authType']||'';this['password']=_0xd5540b[_0xad1b('0x4')]||'';this[_0xad1b('0x5')]=_0xd5540b['consumerKey']||'';this[_0xad1b('0x6')]=_0xd5540b['consumerSecret']||'';this[_0xad1b('0x7')]=_0xd5540b[_0xad1b('0x7')]||'';this[_0xad1b('0x8')]=_0xd5540b[_0xad1b('0x8')]||'';this['type']=_0xd5540b[_0xad1b('0x9')]||'';this[_0xad1b('0xa')]=_0xd5540b[_0xad1b('0xa')]||'';this[_0xad1b('0xb')]=_0xd5540b[_0xad1b('0xb')]||{};}module[_0xad1b('0xc')]=DeskAccount; \ No newline at end of file +var _0xebc7=['Configurations','name','username','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x4e2062,_0x532ea8){var _0x32546b=function(_0x2dd2e0){while(--_0x2dd2e0){_0x4e2062['push'](_0x4e2062['shift']());}};_0x32546b(++_0x532ea8);}(_0xebc7,0x161));var _0x7ebc=function(_0xd5bd9,_0x65c6fd){_0xd5bd9=_0xd5bd9-0x0;var _0x1eced4=_0xebc7[_0xd5bd9];return _0x1eced4;};'use strict';function DeskAccount(_0x4137d7){this['id']=_0x4137d7['id']||0x0;this['name']=_0x4137d7[_0x7ebc('0x0')]||'';this[_0x7ebc('0x1')]=_0x4137d7[_0x7ebc('0x1')]||'';this['remoteUri']=_0x4137d7['remoteUri']||'';this[_0x7ebc('0x2')]=_0x4137d7[_0x7ebc('0x2')]||'';this[_0x7ebc('0x3')]=_0x4137d7[_0x7ebc('0x3')]||'';this[_0x7ebc('0x4')]=_0x4137d7['consumerKey']||'';this['consumerSecret']=_0x4137d7[_0x7ebc('0x5')]||'';this[_0x7ebc('0x6')]=_0x4137d7[_0x7ebc('0x6')]||'';this[_0x7ebc('0x7')]=_0x4137d7[_0x7ebc('0x7')]||'';this[_0x7ebc('0x8')]=_0x4137d7[_0x7ebc('0x8')]||'';this[_0x7ebc('0x9')]=_0x4137d7['serverUrl']||'';this[_0x7ebc('0xa')]=_0x4137d7[_0x7ebc('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index fd9f688..8b708a7 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 _0x5bd7=['tenantId','clientId','clientSecret','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x6bfb5f,_0x178f50){var _0x153e0d=function(_0x2ee710){while(--_0x2ee710){_0x6bfb5f['push'](_0x6bfb5f['shift']());}};_0x153e0d(++_0x178f50);}(_0x5bd7,0x11f));var _0x75bd=function(_0x366be5,_0x3648d9){_0x366be5=_0x366be5-0x0;var _0xd40df6=_0x5bd7[_0x366be5];return _0xd40df6;};'use strict';function Dynamics365Account(_0x37d04d){this['id']=_0x37d04d['id']||0x0;this[_0x75bd('0x0')]=_0x37d04d[_0x75bd('0x0')]||'';this[_0x75bd('0x1')]=_0x37d04d[_0x75bd('0x1')]||'';this[_0x75bd('0x2')]=_0x37d04d['password']||'';this['remoteUri']=_0x37d04d['remoteUri']||'';this['tenantId']=_0x37d04d[_0x75bd('0x3')]||'';this[_0x75bd('0x4')]=_0x37d04d[_0x75bd('0x4')]||'';this[_0x75bd('0x5')]=_0x37d04d['clientSecret']||{};this['serverUrl']=_0x37d04d['serverUrl']||'';this[_0x75bd('0x6')]=_0x37d04d[_0x75bd('0x6')]||![];this[_0x75bd('0x7')]=_0x37d04d[_0x75bd('0x7')]||{};this[_0x75bd('0x8')]=_0x37d04d[_0x75bd('0x8')]||{};}module[_0x75bd('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x54ee=['tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','name','username','password','remoteUri'];(function(_0x2ecd43,_0x29ba90){var _0x2b3978=function(_0x258527){while(--_0x258527){_0x2ecd43['push'](_0x2ecd43['shift']());}};_0x2b3978(++_0x29ba90);}(_0x54ee,0xc4));var _0xe54e=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x54ee[_0x3de8a4];return _0x4635cf;};'use strict';function Dynamics365Account(_0x33ad40){this['id']=_0x33ad40['id']||0x0;this[_0xe54e('0x0')]=_0x33ad40[_0xe54e('0x0')]||'';this[_0xe54e('0x1')]=_0x33ad40[_0xe54e('0x1')]||'';this[_0xe54e('0x2')]=_0x33ad40[_0xe54e('0x2')]||'';this[_0xe54e('0x3')]=_0x33ad40['remoteUri']||'';this[_0xe54e('0x4')]=_0x33ad40['tenantId']||'';this[_0xe54e('0x5')]=_0x33ad40[_0xe54e('0x5')]||'';this[_0xe54e('0x6')]=_0x33ad40['clientSecret']||{};this[_0xe54e('0x7')]=_0x33ad40['serverUrl']||'';this[_0xe54e('0x8')]=_0x33ad40[_0xe54e('0x8')]||![];this[_0xe54e('0x9')]=_0x33ad40['Configurations']||{};this['CloudProvider']=_0x33ad40['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9fcad3c..ace5e82 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 _0x10f7=['modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','key','exports','name','description','ecm','headerinfo','minrate','maxrate'];(function(_0xe1e431,_0x429329){var _0x13a6a6=function(_0xc186){while(--_0xc186){_0xe1e431['push'](_0xe1e431['shift']());}};_0x13a6a6(++_0x429329);}(_0x10f7,0x126));var _0x710f=function(_0x32c8ed,_0x45fef2){_0x32c8ed=_0x32c8ed-0x0;var _0x580764=_0x10f7[_0x32c8ed];return _0x580764;};'use strict';function FaxAccount(_0x41cfdf){this['id']=_0x41cfdf['id']||0x0;this['name']=_0x41cfdf[_0x710f('0x0')]||'';this[_0x710f('0x1')]=_0x41cfdf[_0x710f('0x1')];this[_0x710f('0x2')]=_0x41cfdf[_0x710f('0x2')];this[_0x710f('0x3')]=_0x41cfdf['headerinfo'];this['localstationid']=_0x41cfdf['localstationid'];this[_0x710f('0x4')]=_0x41cfdf[_0x710f('0x4')]||0x960;this[_0x710f('0x5')]=_0x41cfdf[_0x710f('0x5')]||0x3840;this[_0x710f('0x6')]=_0x41cfdf[_0x710f('0x6')]||'v17,v27,v29';this[_0x710f('0x7')]=_0x41cfdf[_0x710f('0x7')]||'no';this['faxdetect']=_0x41cfdf[_0x710f('0x8')]||'no';this[_0x710f('0x9')]=_0x41cfdf[_0x710f('0x9')]||0x1388;this[_0x710f('0xa')]=_0x41cfdf[_0x710f('0xa')]||_0x710f('0xb');this['Trunk']=_0x41cfdf[_0x710f('0xc')]?_0x41cfdf[_0x710f('0xc')]:undefined;this['ListId']=_0x41cfdf['ListId'];this[_0x710f('0xd')]=_0x41cfdf[_0x710f('0xd')];}module[_0x710f('0xe')]=FaxAccount; \ No newline at end of file +var _0xaf55=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x3405b3,_0x5a748b){var _0xf7ab60=function(_0x550132){while(--_0x550132){_0x3405b3['push'](_0x3405b3['shift']());}};_0xf7ab60(++_0x5a748b);}(_0xaf55,0x1e0));var _0x5af5=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xaf55[_0x17b6e3];return _0x3906f3;};'use strict';function FaxAccount(_0xa3107b){this['id']=_0xa3107b['id']||0x0;this[_0x5af5('0x0')]=_0xa3107b[_0x5af5('0x0')]||'';this[_0x5af5('0x1')]=_0xa3107b[_0x5af5('0x1')];this[_0x5af5('0x2')]=_0xa3107b[_0x5af5('0x2')];this[_0x5af5('0x3')]=_0xa3107b[_0x5af5('0x3')];this[_0x5af5('0x4')]=_0xa3107b[_0x5af5('0x4')];this[_0x5af5('0x5')]=_0xa3107b[_0x5af5('0x5')]||0x960;this[_0x5af5('0x6')]=_0xa3107b[_0x5af5('0x6')]||0x3840;this[_0x5af5('0x7')]=_0xa3107b[_0x5af5('0x7')]||_0x5af5('0x8');this[_0x5af5('0x9')]=_0xa3107b[_0x5af5('0x9')]||'no';this['faxdetect']=_0xa3107b[_0x5af5('0xa')]||'no';this[_0x5af5('0xb')]=_0xa3107b[_0x5af5('0xb')]||0x1388;this[_0x5af5('0xc')]=_0xa3107b[_0x5af5('0xc')]||_0x5af5('0xd');this[_0x5af5('0xe')]=_0xa3107b[_0x5af5('0xe')]?_0xa3107b[_0x5af5('0xe')]:undefined;this['ListId']=_0xa3107b[_0x5af5('0xf')];this[_0x5af5('0x10')]=_0xa3107b[_0x5af5('0x10')];}module[_0x5af5('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index bd2e659..ecbd8a7 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 _0x76fc=['Configurations','name','username','remoteUri','serverUrl'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x76fc,0x8d));var _0xc76f=function(_0x5a156f,_0x5a3c1a){_0x5a156f=_0x5a156f-0x0;var _0x310631=_0x76fc[_0x5a156f];return _0x310631;};'use strict';function FreshdeskAccount(_0x53a516){this['id']=_0x53a516['id']||0x0;this[_0xc76f('0x0')]=_0x53a516[_0xc76f('0x0')]||'';this[_0xc76f('0x1')]=_0x53a516[_0xc76f('0x1')]||'';this['apiKey']=_0x53a516['token']||'';this['remoteUri']=_0x53a516[_0xc76f('0x2')]||'';this[_0xc76f('0x3')]=_0x53a516[_0xc76f('0x3')]||'';this[_0xc76f('0x4')]=_0x53a516[_0xc76f('0x4')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x23af=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x164806,_0x55c82a){var _0x11bb28=function(_0x43e982){while(--_0x43e982){_0x164806['push'](_0x164806['shift']());}};_0x11bb28(++_0x55c82a);}(_0x23af,0x16e));var _0xf23a=function(_0x250009,_0x15bacb){_0x250009=_0x250009-0x0;var _0x745b27=_0x23af[_0x250009];return _0x745b27;};'use strict';function FreshdeskAccount(_0x4e81f8){this['id']=_0x4e81f8['id']||0x0;this[_0xf23a('0x0')]=_0x4e81f8[_0xf23a('0x0')]||'';this[_0xf23a('0x1')]=_0x4e81f8[_0xf23a('0x1')]||'';this[_0xf23a('0x2')]=_0x4e81f8[_0xf23a('0x3')]||'';this[_0xf23a('0x4')]=_0x4e81f8['remoteUri']||'';this[_0xf23a('0x5')]=_0x4e81f8[_0xf23a('0x5')]||'';this[_0xf23a('0x6')]=_0x4e81f8[_0xf23a('0x6')]||{};}module[_0xf23a('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 88b4919..ab0ed00 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 _0x7edb=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x4e5798,_0x187411){var _0x188008=function(_0x306391){while(--_0x306391){_0x4e5798['push'](_0x4e5798['shift']());}};_0x188008(++_0x187411);}(_0x7edb,0x158));var _0xb7ed=function(_0x41b2c0,_0x2ac47f){_0x41b2c0=_0x41b2c0-0x0;var _0x59a44f=_0x7edb[_0x41b2c0];return _0x59a44f;};'use strict';function FreshsalesAccount(_0x3ae98f){this['id']=_0x3ae98f['id']||0x0;this[_0xb7ed('0x0')]=_0x3ae98f[_0xb7ed('0x0')]||'';this[_0xb7ed('0x1')]=_0x3ae98f[_0xb7ed('0x1')]||'';this[_0xb7ed('0x2')]=_0x3ae98f['token']||'';this[_0xb7ed('0x3')]=_0x3ae98f['remoteUri']||'';this['serverUrl']=_0x3ae98f[_0xb7ed('0x4')]||'';this[_0xb7ed('0x5')]=_0x3ae98f[_0xb7ed('0x5')]||{};}module[_0xb7ed('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x7217=['exports','name','username','apiKey','token','serverUrl','Configurations'];(function(_0x21ce1e,_0x37678d){var _0x152a0b=function(_0x1dd2a9){while(--_0x1dd2a9){_0x21ce1e['push'](_0x21ce1e['shift']());}};_0x152a0b(++_0x37678d);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';function FreshsalesAccount(_0x516f0e){this['id']=_0x516f0e['id']||0x0;this['name']=_0x516f0e[_0x7721('0x0')]||'';this[_0x7721('0x1')]=_0x516f0e[_0x7721('0x1')]||'';this[_0x7721('0x2')]=_0x516f0e[_0x7721('0x3')]||'';this['remoteUri']=_0x516f0e['remoteUri']||'';this[_0x7721('0x4')]=_0x516f0e[_0x7721('0x4')]||'';this[_0x7721('0x5')]=_0x516f0e[_0x7721('0x5')]||{};}module[_0x7721('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 c8ffa5d..ad3c39c 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 _0x2da8=['connectedlinenum','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','mohtime','variables','exports','type','inbound','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel'];(function(_0x8c7ef2,_0x7a3008){var _0x18bbed=function(_0x2ff9c3){while(--_0x2ff9c3){_0x8c7ef2['push'](_0x8c7ef2['shift']());}};_0x18bbed(++_0x7a3008);}(_0x2da8,0x10f));var _0x82da=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2da8[_0x4a9fb1];return _0x348672;};'use strict';function QueueReport(){this[_0x82da('0x0')]=_0x82da('0x1');this['uniqueid']='';this[_0x82da('0x2')]='';this['calleridname']='';this[_0x82da('0x3')]='';this['queuecallerjoinAt']=null;this[_0x82da('0x4')]=null;this[_0x82da('0x5')]=0x1;this[_0x82da('0x6')]=0x1;this[_0x82da('0x7')]=![];this[_0x82da('0x8')]=null;this[_0x82da('0x9')]=![];this[_0x82da('0xa')]=null;this[_0x82da('0xb')]=![];this[_0x82da('0xc')]=null;this[_0x82da('0xd')]=0x1;this[_0x82da('0xe')]='';this[_0x82da('0xf')]='';this['connectedlinename']='';this[_0x82da('0x10')]='';this['context']='';this[_0x82da('0x11')]='';this[_0x82da('0x12')]='';this[_0x82da('0x13')]=0x0;this[_0x82da('0x14')]=![];this[_0x82da('0x15')]='';this[_0x82da('0x16')]='voice';this[_0x82da('0x17')]=0x0;this[_0x82da('0x18')]={};}module[_0x82da('0x19')]=QueueReport; \ No newline at end of file +var _0x4e2f=['context','exten','priority','holdtime','assigned','motionChannel','voice','mohtime','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode'];(function(_0x91c69b,_0x31d494){var _0x4a57ff=function(_0x12e91a){while(--_0x12e91a){_0x91c69b['push'](_0x91c69b['shift']());}};_0x4a57ff(++_0x31d494);}(_0x4e2f,0x71));var _0xf4e2=function(_0x435319,_0x431558){_0x435319=_0x435319-0x0;var _0x50e7a6=_0x4e2f[_0x435319];return _0x50e7a6;};'use strict';function QueueReport(){this['type']=_0xf4e2('0x0');this[_0xf4e2('0x1')]='';this[_0xf4e2('0x2')]='';this[_0xf4e2('0x3')]='';this[_0xf4e2('0x4')]='';this[_0xf4e2('0x5')]=null;this[_0xf4e2('0x6')]=null;this[_0xf4e2('0x7')]=0x1;this['count']=0x1;this[_0xf4e2('0x8')]=![];this[_0xf4e2('0x9')]=null;this[_0xf4e2('0xa')]=![];this[_0xf4e2('0xb')]=null;this[_0xf4e2('0xc')]=![];this[_0xf4e2('0xd')]=null;this[_0xf4e2('0xe')]=0x1;this['channel']='';this[_0xf4e2('0xf')]='';this['connectedlinename']='';this[_0xf4e2('0x10')]='';this[_0xf4e2('0x11')]='';this[_0xf4e2('0x12')]='';this[_0xf4e2('0x13')]='';this[_0xf4e2('0x14')]=0x0;this[_0xf4e2('0x15')]=![];this['lastAssignedTo']='';this[_0xf4e2('0x16')]=_0xf4e2('0x17');this[_0xf4e2('0x18')]=0x0;this['variables']={};}module[_0xf4e2('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 5c16d9f..130f63e 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 _0x8969=['clientId','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x1fe56b,_0x3860ff){var _0x366c40=function(_0x29d3ea){while(--_0x29d3ea){_0x1fe56b['push'](_0x1fe56b['shift']());}};_0x366c40(++_0x3860ff);}(_0x8969,0x130));var _0x9896=function(_0x42bfd5,_0x26c47c){_0x42bfd5=_0x42bfd5-0x0;var _0x351cae=_0x8969[_0x42bfd5];return _0x351cae;};'use strict';function SalesforceAccount(_0x3b582f){this['id']=_0x3b582f['id']||0x0;this['name']=_0x3b582f[_0x9896('0x0')]||'';this[_0x9896('0x1')]=_0x3b582f[_0x9896('0x1')]||'';this[_0x9896('0x2')]=_0x3b582f[_0x9896('0x2')]||'';this[_0x9896('0x3')]=_0x3b582f[_0x9896('0x3')]||'';this['clientId']=_0x3b582f[_0x9896('0x4')]||'';this['clientSecret']=_0x3b582f['clientSecret']||'';this[_0x9896('0x5')]=_0x3b582f[_0x9896('0x5')]||'';this[_0x9896('0x6')]=_0x3b582f['type']||_0x9896('0x7');this[_0x9896('0x8')]=_0x3b582f[_0x9896('0x8')]||'';this['Configurations']=_0x3b582f[_0x9896('0x9')]||{};}module[_0x9896('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xa6ed=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientSecret','securityToken','type'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xa6ed,0x111));var _0xda6e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xa6ed[_0x13d07a];return _0x5ee0ee;};'use strict';function SalesforceAccount(_0x13016f){this['id']=_0x13016f['id']||0x0;this[_0xda6e('0x0')]=_0x13016f[_0xda6e('0x0')]||'';this[_0xda6e('0x1')]=_0x13016f['username']||'';this['remoteUri']=_0x13016f[_0xda6e('0x2')]||'';this[_0xda6e('0x3')]=_0x13016f[_0xda6e('0x3')]||'';this['clientId']=_0x13016f['clientId']||'';this[_0xda6e('0x4')]=_0x13016f[_0xda6e('0x4')]||'';this[_0xda6e('0x5')]=_0x13016f['securityToken']||'';this[_0xda6e('0x6')]=_0x13016f[_0xda6e('0x6')]||'integrationTab';this[_0xda6e('0x7')]=_0x13016f[_0xda6e('0x7')]||'';this[_0xda6e('0x8')]=_0x13016f[_0xda6e('0x8')]||{};}module[_0xda6e('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 4dcc11a..211c415 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 _0x0502=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x161194,_0x409934){var _0x57f9b4=function(_0x5ab550){while(--_0x5ab550){_0x161194['push'](_0x161194['shift']());}};_0x57f9b4(++_0x409934);}(_0x0502,0x1cb));var _0x2050=function(_0x280660,_0x2a25a2){_0x280660=_0x280660-0x0;var _0x308126=_0x0502[_0x280660];return _0x308126;};'use strict';function ServicenowAccount(_0x263883){this['id']=_0x263883['id']||0x0;this[_0x2050('0x0')]=_0x263883[_0x2050('0x0')]||'';this[_0x2050('0x1')]=_0x263883['username']||'';this[_0x2050('0x2')]=_0x263883[_0x2050('0x2')]||'';this[_0x2050('0x3')]=_0x263883[_0x2050('0x3')]||'';this[_0x2050('0x4')]=_0x263883[_0x2050('0x4')]||'';this[_0x2050('0x5')]=_0x263883[_0x2050('0x5')]||{};}module[_0x2050('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x3932=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x3932,0xd7));var _0x2393=function(_0x4360ce,_0xa1d8f4){_0x4360ce=_0x4360ce-0x0;var _0x47518=_0x3932[_0x4360ce];return _0x47518;};'use strict';function ServicenowAccount(_0x2d66e1){this['id']=_0x2d66e1['id']||0x0;this[_0x2393('0x0')]=_0x2d66e1[_0x2393('0x0')]||'';this['username']=_0x2d66e1['username']||'';this['password']=_0x2d66e1[_0x2393('0x1')]||'';this['remoteUri']=_0x2d66e1[_0x2393('0x2')]||'';this[_0x2393('0x3')]=_0x2d66e1[_0x2393('0x3')]||'';this['Configurations']=_0x2d66e1[_0x2393('0x4')]||{};}module[_0x2393('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index ee49734..2651f63 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 _0xa97b=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa97b,0x75));var _0xba97=function(_0x36b093,_0x22bbb7){_0x36b093=_0x36b093-0x0;var _0x5b2896=_0xa97b[_0x36b093];return _0x5b2896;};'use strict';function SugarcrmAccount(_0x49ee37){this['id']=_0x49ee37['id']||0x0;this[_0xba97('0x0')]=_0x49ee37[_0xba97('0x0')]||'';this[_0xba97('0x1')]=_0x49ee37[_0xba97('0x1')]||'';this['password']=_0x49ee37['password']||'';this[_0xba97('0x2')]=_0x49ee37[_0xba97('0x2')]||'';this[_0xba97('0x3')]=_0x49ee37[_0xba97('0x3')]||'';this[_0xba97('0x4')]=_0x49ee37[_0xba97('0x4')]||{};}module[_0xba97('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xe9a4=['name','username','serverUrl','Configurations','exports'];(function(_0x4bad7a,_0x2a49d7){var _0x4f9bbd=function(_0x2fd536){while(--_0x2fd536){_0x4bad7a['push'](_0x4bad7a['shift']());}};_0x4f9bbd(++_0x2a49d7);}(_0xe9a4,0x1c2));var _0x4e9a=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0xe9a4[_0x1f9503];return _0xaab94f;};'use strict';function SugarcrmAccount(_0x35fd82){this['id']=_0x35fd82['id']||0x0;this[_0x4e9a('0x0')]=_0x35fd82[_0x4e9a('0x0')]||'';this['username']=_0x35fd82[_0x4e9a('0x1')]||'';this['password']=_0x35fd82['password']||'';this['remoteUri']=_0x35fd82['remoteUri']||'';this['serverUrl']=_0x35fd82[_0x4e9a('0x2')]||'';this[_0x4e9a('0x3')]=_0x35fd82[_0x4e9a('0x3')]||{};}module[_0x4e9a('0x4')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index d183edd..a0eaa31 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 _0x094c=['exports','name','accountcode','state','stateTime','status','unknown','address'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x094c,0x131));var _0xc094=function(_0x5bfee6,_0x3e9443){_0x5bfee6=_0x5bfee6-0x0;var _0x4aad05=_0x094c[_0x5bfee6];return _0x4aad05;};'use strict';function Telephone(_0x46e089){this['id']=_0x46e089['id']||0x0;this[_0xc094('0x0')]=_0x46e089[_0xc094('0x0')]||'';this['accountcode']=_0x46e089[_0xc094('0x1')]||'';this[_0xc094('0x2')]='unknown';this[_0xc094('0x3')]=0x0;this[_0xc094('0x4')]=_0xc094('0x5');this[_0xc094('0x6')]='';}module[_0xc094('0x7')]=Telephone; \ No newline at end of file +var _0x9a2a=['unknown','stateTime','status','address','exports','name'];(function(_0x322342,_0x4335b7){var _0x34f02a=function(_0x139ddb){while(--_0x139ddb){_0x322342['push'](_0x322342['shift']());}};_0x34f02a(++_0x4335b7);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x4435c2,_0x3c12f2){_0x4435c2=_0x4435c2-0x0;var _0x160402=_0x9a2a[_0x4435c2];return _0x160402;};'use strict';function Telephone(_0x31dea3){this['id']=_0x31dea3['id']||0x0;this[_0xa9a2('0x0')]=_0x31dea3[_0xa9a2('0x0')]||'';this['accountcode']=_0x31dea3['accountcode']||'';this['state']=_0xa9a2('0x1');this[_0xa9a2('0x2')]=0x0;this[_0xa9a2('0x3')]=_0xa9a2('0x1');this[_0xa9a2('0x4')]='';}module[_0xa9a2('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 3cacdfe..1d279ee 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(_0x1cf643,_0x79b9e2){var _0x3c3c0d=function(_0x136af6){while(--_0x136af6){_0x1cf643['push'](_0x1cf643['shift']());}};_0x3c3c0d(++_0x79b9e2);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f6037,_0x8e0a90){_0x4f6037=_0x4f6037-0x0;var _0x2542e2=_0xb10b[_0x4f6037];return _0x2542e2;};'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(_0x3ca01c,_0x492ee7){var _0x1ecf93=function(_0x3d99ec){while(--_0x3d99ec){_0x3ca01c['push'](_0x3ca01c['shift']());}};_0x1ecf93(++_0x492ee7);}(_0xb10b,0x12a));var _0xbb10=function(_0x52de48,_0x5bc748){_0x52de48=_0x52de48-0x0;var _0x18f4c0=_0xb10b[_0x52de48];return _0x18f4c0;};'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 e1f6f12..707643d 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x3ae82e,_0x51cc2f){var _0x3abb70=function(_0x50eca6){while(--_0x50eca6){_0x3ae82e['push'](_0x3ae82e['shift']());}};_0x3abb70(++_0x51cc2f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x26a921,_0x3c6ded){_0x26a921=_0x26a921-0x0;var _0x1eccd8=_0x9ffd[_0x26a921];return _0x1eccd8;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0x5f2f=['AnyConditions','Actions','exports','name','channel','voice','status'];(function(_0x55c55a,_0x5d48e2){var _0x187f89=function(_0x2e0f06){while(--_0x2e0f06){_0x55c55a['push'](_0x55c55a['shift']());}};_0x187f89(++_0x5d48e2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x10a4db,_0x1b1dbb){_0x10a4db=_0x10a4db-0x0;var _0x332573=_0x5f2f[_0x10a4db];return _0x332573;};'use strict';function Trigger(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||_0xf5f2('0x2');this[_0xf5f2('0x3')]=_0x7c86d8[_0xf5f2('0x3')]||![];this['AllConditions']=_0x7c86d8['AllConditions']||[];this[_0xf5f2('0x4')]=_0x7c86d8[_0xf5f2('0x4')]||[];this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||[];}module[_0xf5f2('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 8442128..d26a0e6 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 _0x027c=['domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','stateTime','unknown','registry','indexOf','split','host','domain'];(function(_0xeb3378,_0x2121c9){var _0x5d0470=function(_0x68292b){while(--_0x68292b){_0xeb3378['push'](_0xeb3378['shift']());}};_0x5d0470(++_0x2121c9);}(_0x027c,0x16c));var _0xc027=function(_0x597374,_0x540138){_0x597374=_0x597374-0x0;var _0x5728c4=_0x027c[_0x597374];return _0x5728c4;};'use strict';function Trunk(_0x3a18d7){this['id']=_0x3a18d7['id']||0x0;this[_0xc027('0x0')]=_0x3a18d7['active']||![];this[_0xc027('0x1')]=_0x3a18d7[_0xc027('0x1')]||'';this[_0xc027('0x2')]='unknown';this[_0xc027('0x3')]=0x0;this['status']=_0xc027('0x4');this[_0xc027('0x5')]=_0x3a18d7[_0xc027('0x5')]&&_0x3a18d7[_0xc027('0x5')][_0xc027('0x6')](':')?_0x3a18d7[_0xc027('0x5')][_0xc027('0x7')](':')[0x0]:'';this[_0xc027('0x8')]='';this['port']='';this[_0xc027('0x9')]='';this[_0xc027('0xa')]='';this[_0xc027('0xb')]='';this[_0xc027('0xc')]=_0xc027('0x4');this[_0xc027('0xd')]='';this[_0xc027('0xe')]='';this['defaultuser']=_0x3a18d7[_0xc027('0xf')]||'';}module[_0xc027('0x10')]=Trunk; \ No newline at end of file +var _0x623e=['refresh','address','defaultuser','active','name','unknown','registry','split','host','port','domain'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x623e,0x184));var _0xe623=function(_0xe464a9,_0x471db9){_0xe464a9=_0xe464a9-0x0;var _0x10a10f=_0x623e[_0xe464a9];return _0x10a10f;};'use strict';function Trunk(_0x15c12f){this['id']=_0x15c12f['id']||0x0;this[_0xe623('0x0')]=_0x15c12f['active']||![];this[_0xe623('0x1')]=_0x15c12f[_0xe623('0x1')]||'';this['state']=_0xe623('0x2');this['stateTime']=0x0;this['status']=_0xe623('0x2');this['registry']=_0x15c12f[_0xe623('0x3')]&&_0x15c12f['registry']['indexOf'](':')?_0x15c12f['registry'][_0xe623('0x4')](':')[0x0]:'';this[_0xe623('0x5')]='';this[_0xe623('0x6')]='';this[_0xe623('0x7')]='';this['domainport']='';this[_0xe623('0x8')]='';this['stateRegistry']=_0xe623('0x2');this['registrationtime']='';this[_0xe623('0x9')]='';this[_0xe623('0xa')]=_0x15c12f[_0xe623('0xa')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 5a35000..9dbbf16 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 _0xfe49=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x392efa,_0x323910){var _0x10dac3=function(_0x360ad1){while(--_0x360ad1){_0x392efa['push'](_0x392efa['shift']());}};_0x10dac3(++_0x323910);}(_0xfe49,0x75));var _0x9fe4=function(_0xb6afda,_0x55854e){_0xb6afda=_0xb6afda-0x0;var _0x8c25e3=_0xfe49[_0xb6afda];return _0x8c25e3;};'use strict';function voiceExtension(_0x4c0458){this['id']=_0x4c0458['id']||0x0;this['exten']=_0x4c0458[_0x9fe4('0x0')]||'';this['recordingFormat']=_0x4c0458[_0x9fe4('0x1')]||_0x9fe4('0x2');this[_0x9fe4('0x3')]=_0x4c0458[_0x9fe4('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x0db4=['none','mandatoryDisposition','exports'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x0db4,0x126));var _0x40db=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x0db4[_0x4792c8];return _0x35edb1;};'use strict';function voiceExtension(_0x256d65){this['id']=_0x256d65['id']||0x0;this['exten']=_0x256d65['exten']||'';this['recordingFormat']=_0x256d65['recordingFormat']||_0x40db('0x0');this['mandatoryDisposition']=_0x256d65[_0x40db('0x1')]||![];}module[_0x40db('0x2')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 69a7b24..5530a6d 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 _0x24b4=['erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','ringinuse','onhold','wav','wav49','rrmemory','name','monitor_format','type','inbound','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls'];(function(_0x1cb1a3,_0x907158){var _0x3f974b=function(_0x3f5d43){while(--_0x3f5d43){_0x1cb1a3['push'](_0x1cb1a3['shift']());}};_0x3f974b(++_0x907158);}(_0x24b4,0xf4));var _0x424b=function(_0x551b6b,_0x1ead57){_0x551b6b=_0x551b6b-0x0;var _0x547219=_0x24b4[_0x551b6b];return _0x547219;};'use strict';var statusDesc=['unknown',_0x424b('0x0'),_0x424b('0x1'),_0x424b('0x2'),_0x424b('0x3'),'unavailable','ringing',_0x424b('0x4'),_0x424b('0x5')];var monitorFormat={'wav':_0x424b('0x6'),'wav49':_0x424b('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0x424b('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x5d23a5){this['id']=_0x5d23a5['id']||0x0;this[_0x424b('0x9')]=_0x5d23a5[_0x424b('0x9')]||'';this[_0x424b('0xa')]=_0x5d23a5['monitor_format']||'';this[_0x424b('0xb')]=_0x5d23a5[_0x424b('0xb')]||_0x424b('0xc');this['waiting']=0x0;this['talking']=0x0;this[_0x424b('0xd')]=0x0;this[_0x424b('0xe')]=0x0;this[_0x424b('0xf')]=0x0;this[_0x424b('0x10')]=0x0;this[_0x424b('0x11')]=0x0;this['unmanaged']=0x0;this[_0x424b('0x12')]=0x0;this['loggedIn']=0x0;this[_0x424b('0x13')]=0x0;this[_0x424b('0x14')]=_0x5d23a5[_0x424b('0x14')]||![];this[_0x424b('0x15')]=_0x5d23a5[_0x424b('0x15')]||0xa;this[_0x424b('0x16')]=_0x5d23a5[_0x424b('0x16')]||'no';this[_0x424b('0x17')]=!![];this[_0x424b('0x18')]='';this['originated']=0x0;this[_0x424b('0x19')]=0x0;this[_0x424b('0x1a')]=_0x5d23a5[_0x424b('0x1a')]||null;this['dialGlobalInterval']=_0x5d23a5['dialGlobalInterval']?_0x5d23a5['dialGlobalInterval']:null;this['dialActive']=_0x5d23a5[_0x424b('0x1b')];this[_0x424b('0x1c')]=_0x5d23a5[_0x424b('0x1c')]||_0x424b('0x1d');this[_0x424b('0x1e')]=_0x5d23a5[_0x424b('0x1e')]||0x0;this[_0x424b('0x1f')]=_0x5d23a5[_0x424b('0x1f')]||0x0;this[_0x424b('0x20')]=_0x5d23a5[_0x424b('0x20')]||0x1;this[_0x424b('0x21')]=_0x5d23a5[_0x424b('0x21')]||_0x424b('0x22');this[_0x424b('0x23')]=_0x5d23a5[_0x424b('0x23')]||0.03;this[_0x424b('0x24')]=_0x5d23a5['dialPredictiveInterval']||0x258;this[_0x424b('0x25')]=_0x5d23a5['dialOriginateCallerIdName']||_0x424b('0x26');this[_0x424b('0x27')]=_0x5d23a5['dialOriginateCallerIdNumber']||'anonymous';this[_0x424b('0x28')]=_0x5d23a5[_0x424b('0x28')]||0x1e;this[_0x424b('0x29')]=_0x5d23a5[_0x424b('0x29')]||_0x424b('0x2a');this[_0x424b('0x2b')]=_0x5d23a5[_0x424b('0x2b')]||0x3;this[_0x424b('0x2c')]=_0x5d23a5['dialQueueProject']||undefined;this[_0x424b('0x2d')]=_0x5d23a5[_0x424b('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x5d23a5[_0x424b('0x2e')]||0x96;this[_0x424b('0x2f')]=_0x5d23a5[_0x424b('0x2f')]||0x3;this[_0x424b('0x30')]=_0x5d23a5[_0x424b('0x30')]||0x96;this[_0x424b('0x31')]=_0x5d23a5[_0x424b('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5d23a5[_0x424b('0x32')]||0x96;this[_0x424b('0x33')]=_0x5d23a5[_0x424b('0x33')]||0x3;this[_0x424b('0x34')]=_0x5d23a5['dialNoSuchNumberRetryFrequency']||0x96;this[_0x424b('0x35')]=_0x5d23a5['dialDropMaxRetry']||0x3;this[_0x424b('0x36')]=_0x5d23a5['dialDropRetryFrequency']||0x96;this[_0x424b('0x37')]=_0x5d23a5[_0x424b('0x37')]||0x3;this[_0x424b('0x38')]=_0x5d23a5[_0x424b('0x38')]||0x96;this[_0x424b('0x39')]=_0x5d23a5['dialMachineMaxRetry']||0x3;this[_0x424b('0x3a')]=_0x5d23a5[_0x424b('0x3a')]||0x96;this[_0x424b('0x3b')]=_0x5d23a5[_0x424b('0x3b')]||0x3;this[_0x424b('0x3c')]=_0x5d23a5['dialAgentRejectRetryFrequency']||0x96;this[_0x424b('0x3d')]=_0x5d23a5[_0x424b('0x3d')]||0x4;this[_0x424b('0x3e')]=_0x5d23a5[_0x424b('0x3e')]?_0x5d23a5[_0x424b('0x3e')]:undefined;this[_0x424b('0x3f')]=_0x5d23a5['TrunkBackup']?_0x5d23a5[_0x424b('0x3f')]:undefined;this[_0x424b('0x40')]=_0x5d23a5[_0x424b('0x40')]||undefined;this[_0x424b('0x41')]=_0x5d23a5[_0x424b('0x41')]?_0x5d23a5[_0x424b('0x41')]:undefined;this[_0x424b('0x42')]=_0x5d23a5[_0x424b('0x42')]||_0x424b('0x43');this[_0x424b('0x44')]=_0x5d23a5['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x5d23a5[_0x424b('0x45')]||undefined;this['strategy']=strategy[_0x5d23a5[_0x424b('0x46')]]||_0x424b('0x8');this[_0x424b('0x47')]=!![];this[_0x424b('0x48')]=_0x5d23a5[_0x424b('0x48')]||![];this['dialAMDInitialSilence']=_0x5d23a5[_0x424b('0x49')];this['dialAMDGreeting']=_0x5d23a5[_0x424b('0x4a')];this[_0x424b('0x4b')]=_0x5d23a5[_0x424b('0x4b')];this['dialAMDTotalAnalysisTime']=_0x5d23a5[_0x424b('0x4c')];this['dialAMDMinWordLength']=_0x5d23a5['dialAMDMinWordLength'];this[_0x424b('0x4d')]=_0x5d23a5[_0x424b('0x4d')];this[_0x424b('0x4e')]=_0x5d23a5['dialAMDMaximumNumberOfWords'];this[_0x424b('0x4f')]=_0x5d23a5[_0x424b('0x4f')];this[_0x424b('0x50')]=_0x5d23a5[_0x424b('0x50')];this[_0x424b('0x51')]=0x0;this[_0x424b('0x52')]=0x0;this[_0x424b('0x53')]=_0x5d23a5[_0x424b('0x53')];this[_0x424b('0x54')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x424b('0x55')]=0x0;this[_0x424b('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x424b('0x57')]=0x0;this[_0x424b('0x58')]=0x0;this[_0x424b('0x59')]=0x0;this[_0x424b('0x5a')]=0x0;this[_0x424b('0x5b')]=0x0;this[_0x424b('0x5c')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x424b('0x5d')]=0x0;this[_0x424b('0x5e')]=undefined;this[_0x424b('0x5f')]=undefined;this[_0x424b('0x60')]=undefined;this[_0x424b('0x61')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x424b('0x62')]=0x0;this[_0x424b('0x63')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x424b('0x64')]=0x0;this[_0x424b('0x65')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x424b('0x66')]=0x0;this[_0x424b('0x67')]=_0x5d23a5[_0x424b('0x68')]||0x14;this[_0x424b('0x69')]=_0x5d23a5[_0x424b('0x68')]||0xa;this[_0x424b('0x6a')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0x424b('0x6b')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x424b('0x6c')]=0x0;this[_0x424b('0x6d')]=_0x5d23a5[_0x424b('0x6d')]||0x1e;this[_0x424b('0x6e')]=_0x5d23a5[_0x424b('0x6e')]||![];this['dialPreviewAutoRecallMe']=!!_0x5d23a5['dialPreviewAutoRecallMe']||![];this[_0x424b('0x6f')]=!!_0x5d23a5['dialPreviewRecallmeReminder']||![];this[_0x424b('0x70')]=_0x5d23a5[_0x424b('0x70')]||undefined;this[_0x424b('0x71')]=_0x5d23a5[_0x424b('0x71')]||![];this[_0x424b('0x72')]=_0x5d23a5['dialAgiAfterHangupAgent']||![];this[_0x424b('0xa')]=monitorFormat[_0x5d23a5['monitor_format']]?monitorFormat[_0x5d23a5['monitor_format']]:undefined;this['mandatoryDisposition']=_0x5d23a5['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x5d23a5[_0x424b('0x73')]?_0x5d23a5[_0x424b('0x73')]:undefined;}module[_0x424b('0x74')]=VoiceQueue; \ No newline at end of file +var _0x0fbd=['dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','unavailable','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0fbd,0x154));var _0xd0fb=function(_0x3dab3e,_0x59afee){_0x3dab3e=_0x3dab3e-0x0;var _0x1ed821=_0x0fbd[_0x3dab3e];return _0x1ed821;};'use strict';var statusDesc=[_0xd0fb('0x0'),_0xd0fb('0x1'),_0xd0fb('0x2'),'busy','invalid',_0xd0fb('0x3'),_0xd0fb('0x4'),_0xd0fb('0x5'),_0xd0fb('0x6')];var monitorFormat={'wav':_0xd0fb('0x7'),'wav49':_0xd0fb('0x8'),'gsm':'gsm'};var strategy={'rrmemory':_0xd0fb('0x9'),'roundrobin':_0xd0fb('0xa')};function VoiceQueue(_0x4e8d6c){this['id']=_0x4e8d6c['id']||0x0;this[_0xd0fb('0xb')]=_0x4e8d6c['name']||'';this[_0xd0fb('0xc')]=_0x4e8d6c['monitor_format']||'';this[_0xd0fb('0xd')]=_0x4e8d6c[_0xd0fb('0xd')]||_0xd0fb('0xe');this[_0xd0fb('0xf')]=0x0;this[_0xd0fb('0x10')]=0x0;this[_0xd0fb('0x11')]=0x0;this['answered']=0x0;this[_0xd0fb('0x12')]=0x0;this[_0xd0fb('0x13')]=0x0;this[_0xd0fb('0x14')]=0x0;this[_0xd0fb('0x15')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0xd0fb('0x16')]=0x0;this['acw']=_0x4e8d6c[_0xd0fb('0x17')]||![];this[_0xd0fb('0x18')]=_0x4e8d6c[_0xd0fb('0x18')]||0xa;this[_0xd0fb('0x19')]=_0x4e8d6c['autopause']||'no';this[_0xd0fb('0x1a')]=!![];this[_0xd0fb('0x1b')]='';this[_0xd0fb('0x1c')]=0x0;this[_0xd0fb('0x1d')]=0x0;this[_0xd0fb('0x1e')]=_0x4e8d6c[_0xd0fb('0x1e')]||null;this['dialGlobalInterval']=_0x4e8d6c[_0xd0fb('0x1f')]?_0x4e8d6c[_0xd0fb('0x1f')]:null;this[_0xd0fb('0x20')]=_0x4e8d6c['dialActive'];this[_0xd0fb('0x21')]=_0x4e8d6c[_0xd0fb('0x21')]||_0xd0fb('0x22');this[_0xd0fb('0x23')]=_0x4e8d6c[_0xd0fb('0x23')]||0x0;this['dialLimitQueue']=_0x4e8d6c[_0xd0fb('0x24')]||0x0;this['dialPowerLevel']=_0x4e8d6c[_0xd0fb('0x25')]||0x1;this['dialPredictiveOptimization']=_0x4e8d6c['dialPredictiveOptimization']||_0xd0fb('0x26');this['dialPredictiveOptimizationPercentage']=_0x4e8d6c['dialPredictiveOptimizationPercentage']||0.03;this[_0xd0fb('0x27')]=_0x4e8d6c[_0xd0fb('0x27')]||0x258;this[_0xd0fb('0x28')]=_0x4e8d6c[_0xd0fb('0x28')]||_0xd0fb('0x29');this[_0xd0fb('0x2a')]=_0x4e8d6c[_0xd0fb('0x2a')]||_0xd0fb('0x29');this[_0xd0fb('0x2b')]=_0x4e8d6c[_0xd0fb('0x2b')]||0x1e;this[_0xd0fb('0x2c')]=_0x4e8d6c[_0xd0fb('0x2c')]||_0xd0fb('0x2d');this[_0xd0fb('0x2e')]=_0x4e8d6c['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x4e8d6c['dialQueueProject']||undefined;this[_0xd0fb('0x2f')]=_0x4e8d6c[_0xd0fb('0x2f')]||0x3;this[_0xd0fb('0x30')]=_0x4e8d6c[_0xd0fb('0x30')]||0x96;this['dialBusyMaxRetry']=_0x4e8d6c[_0xd0fb('0x31')]||0x3;this[_0xd0fb('0x32')]=_0x4e8d6c['dialBusyRetryFrequency']||0x96;this[_0xd0fb('0x33')]=_0x4e8d6c[_0xd0fb('0x33')]||0x3;this[_0xd0fb('0x34')]=_0x4e8d6c['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x4e8d6c['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4e8d6c[_0xd0fb('0x35')]||0x96;this[_0xd0fb('0x36')]=_0x4e8d6c[_0xd0fb('0x36')]||0x3;this[_0xd0fb('0x37')]=_0x4e8d6c[_0xd0fb('0x37')]||0x96;this[_0xd0fb('0x38')]=_0x4e8d6c[_0xd0fb('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x4e8d6c[_0xd0fb('0x39')]||0x96;this[_0xd0fb('0x3a')]=_0x4e8d6c[_0xd0fb('0x3a')]||0x3;this[_0xd0fb('0x3b')]=_0x4e8d6c[_0xd0fb('0x3b')]||0x96;this[_0xd0fb('0x3c')]=_0x4e8d6c[_0xd0fb('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x4e8d6c[_0xd0fb('0x3d')]||0x96;this['dialGlobalMaxRetry']=_0x4e8d6c['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x4e8d6c['Trunk']?_0x4e8d6c[_0xd0fb('0x3e')]:undefined;this[_0xd0fb('0x3f')]=_0x4e8d6c[_0xd0fb('0x3f')]?_0x4e8d6c[_0xd0fb('0x3f')]:undefined;this[_0xd0fb('0x40')]=_0x4e8d6c[_0xd0fb('0x40')]||undefined;this[_0xd0fb('0x41')]=_0x4e8d6c[_0xd0fb('0x41')]?_0x4e8d6c[_0xd0fb('0x41')]:undefined;this[_0xd0fb('0x42')]=_0x4e8d6c[_0xd0fb('0x42')]||_0xd0fb('0x43');this[_0xd0fb('0x44')]=_0x4e8d6c[_0xd0fb('0x44')]||undefined;this[_0xd0fb('0x45')]=_0x4e8d6c[_0xd0fb('0x45')]||undefined;this['strategy']=strategy[_0x4e8d6c[_0xd0fb('0x46')]]||_0xd0fb('0x9');this[_0xd0fb('0x47')]=!![];this[_0xd0fb('0x48')]=_0x4e8d6c[_0xd0fb('0x48')]||![];this[_0xd0fb('0x49')]=_0x4e8d6c[_0xd0fb('0x49')];this[_0xd0fb('0x4a')]=_0x4e8d6c[_0xd0fb('0x4a')];this[_0xd0fb('0x4b')]=_0x4e8d6c[_0xd0fb('0x4b')];this['dialAMDTotalAnalysisTime']=_0x4e8d6c[_0xd0fb('0x4c')];this[_0xd0fb('0x4d')]=_0x4e8d6c[_0xd0fb('0x4d')];this[_0xd0fb('0x4e')]=_0x4e8d6c[_0xd0fb('0x4e')];this[_0xd0fb('0x4f')]=_0x4e8d6c[_0xd0fb('0x4f')];this['dialAMDSilenceThreshold']=_0x4e8d6c[_0xd0fb('0x50')];this[_0xd0fb('0x51')]=_0x4e8d6c[_0xd0fb('0x51')];this[_0xd0fb('0x52')]=0x0;this['pTalking']=0x0;this[_0xd0fb('0x53')]=_0x4e8d6c[_0xd0fb('0x53')];this['outboundAnswerCallsDay']=0x0;this[_0xd0fb('0x54')]=0x0;this[_0xd0fb('0x55')]=0x0;this[_0xd0fb('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd0fb('0x57')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xd0fb('0x58')]=0x0;this[_0xd0fb('0x59')]=0x0;this[_0xd0fb('0x5a')]=0x0;this['outboundReCallsDay']=0x0;this[_0xd0fb('0x5b')]=0x0;this['startProgressive']=undefined;this[_0xd0fb('0x5c')]=undefined;this['handlePredictive']=undefined;this[_0xd0fb('0x5d')]=1.05;this[_0xd0fb('0x5e')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xd0fb('0x5f')]=0x0;this[_0xd0fb('0x60')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xd0fb('0x61')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x4e8d6c[_0xd0fb('0x62')]||0x14;this[_0xd0fb('0x63')]=_0x4e8d6c[_0xd0fb('0x62')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xd0fb('0x64')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xd0fb('0x65')]=0x0;this[_0xd0fb('0x66')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xd0fb('0x67')]=0x0;this['dialRecallMeTimeout']=_0x4e8d6c[_0xd0fb('0x68')]||0x1e;this['dialRecallInQueue']=_0x4e8d6c['dialRecallInQueue']||![];this[_0xd0fb('0x69')]=!!_0x4e8d6c[_0xd0fb('0x69')]||![];this['dialPreviewRecallmeReminder']=!!_0x4e8d6c['dialPreviewRecallmeReminder']||![];this[_0xd0fb('0x6a')]=_0x4e8d6c[_0xd0fb('0x6a')]||undefined;this[_0xd0fb('0x6b')]=_0x4e8d6c[_0xd0fb('0x6b')]||![];this[_0xd0fb('0x6c')]=_0x4e8d6c['dialAgiAfterHangupAgent']||![];this[_0xd0fb('0xc')]=monitorFormat[_0x4e8d6c[_0xd0fb('0xc')]]?monitorFormat[_0x4e8d6c[_0xd0fb('0xc')]]:undefined;this['mandatoryDisposition']=_0x4e8d6c[_0xd0fb('0x6d')]||![];this[_0xd0fb('0x6e')]=_0x4e8d6c[_0xd0fb('0x6e')]?_0x4e8d6c[_0xd0fb('0x6e')]:undefined;}module[_0xd0fb('0x6f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 04bfdf4..08fd630 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 _0xd9be=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xd9be,0x103));var _0xed9b=function(_0x3d239e,_0xa964c1){_0x3d239e=_0x3d239e-0x0;var _0x2df6d0=_0xd9be[_0x3d239e];return _0x2df6d0;};'use strict';function VtigerAccount(_0x3b0e32){this['id']=_0x3b0e32['id']||0x0;this[_0xed9b('0x0')]=_0x3b0e32['name']||'';this['username']=_0x3b0e32[_0xed9b('0x1')]||'';this[_0xed9b('0x2')]=_0x3b0e32[_0xed9b('0x2')]||'';this[_0xed9b('0x3')]=_0x3b0e32[_0xed9b('0x3')]||'';this[_0xed9b('0x4')]=_0x3b0e32[_0xed9b('0x4')]||'';this['Configurations']=_0x3b0e32[_0xed9b('0x5')]||{};}module[_0xed9b('0x6')]=VtigerAccount; \ No newline at end of file +var _0x03ea=['accessKey','remoteUri','serverUrl','exports','name','username'];(function(_0x290758,_0xd56b3f){var _0x2d80f4=function(_0x207a8f){while(--_0x207a8f){_0x290758['push'](_0x290758['shift']());}};_0x2d80f4(++_0xd56b3f);}(_0x03ea,0x1ba));var _0xa03e=function(_0xb7ef08,_0x21b77a){_0xb7ef08=_0xb7ef08-0x0;var _0x53c8ca=_0x03ea[_0xb7ef08];return _0x53c8ca;};'use strict';function VtigerAccount(_0x6678a6){this['id']=_0x6678a6['id']||0x0;this[_0xa03e('0x0')]=_0x6678a6['name']||'';this['username']=_0x6678a6[_0xa03e('0x1')]||'';this[_0xa03e('0x2')]=_0x6678a6[_0xa03e('0x2')]||'';this[_0xa03e('0x3')]=_0x6678a6[_0xa03e('0x3')]||'';this['serverUrl']=_0x6678a6[_0xa03e('0x4')]||'';this['Configurations']=_0x6678a6['Configurations']||{};}module[_0xa03e('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index ca12299..f1fefde 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 _0x41d2=['token','remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password'];(function(_0x474f02,_0x44c5af){var _0x47321d=function(_0x40e0de){while(--_0x40e0de){_0x474f02['push'](_0x474f02['shift']());}};_0x47321d(++_0x44c5af);}(_0x41d2,0x10b));var _0x241d=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x41d2[_0x152121];return _0x592a85;};'use strict';function ZendeskAccount(_0x2d1b95){this['id']=_0x2d1b95['id']||0x0;this[_0x241d('0x0')]=_0x2d1b95[_0x241d('0x0')]||'';this[_0x241d('0x1')]=_0x2d1b95[_0x241d('0x1')]||'';this['password']=_0x2d1b95[_0x241d('0x2')]||'';this[_0x241d('0x3')]=_0x2d1b95['token']||'';this[_0x241d('0x4')]=_0x2d1b95['remoteUri']||'';this[_0x241d('0x5')]=_0x2d1b95[_0x241d('0x5')]||'';this[_0x241d('0x6')]=_0x2d1b95[_0x241d('0x6')]||'integrationTab';this['serverUrl']=_0x2d1b95[_0x241d('0x7')]||'';this[_0x241d('0x8')]=_0x2d1b95[_0x241d('0x8')]||{};}module[_0x241d('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x1340=['password','token','remoteUri','authType','type','serverUrl','Configurations','name','username'];(function(_0x31daf2,_0x55e83c){var _0x1535be=function(_0x423e1e){while(--_0x423e1e){_0x31daf2['push'](_0x31daf2['shift']());}};_0x1535be(++_0x55e83c);}(_0x1340,0x193));var _0x0134=function(_0x4bb3c1,_0x560d47){_0x4bb3c1=_0x4bb3c1-0x0;var _0x5d7551=_0x1340[_0x4bb3c1];return _0x5d7551;};'use strict';function ZendeskAccount(_0x49df44){this['id']=_0x49df44['id']||0x0;this[_0x0134('0x0')]=_0x49df44[_0x0134('0x0')]||'';this['username']=_0x49df44[_0x0134('0x1')]||'';this[_0x0134('0x2')]=_0x49df44[_0x0134('0x2')]||'';this[_0x0134('0x3')]=_0x49df44[_0x0134('0x3')]||'';this['remoteUri']=_0x49df44[_0x0134('0x4')]||'';this[_0x0134('0x5')]=_0x49df44[_0x0134('0x5')]||'';this[_0x0134('0x6')]=_0x49df44[_0x0134('0x6')]||'integrationTab';this[_0x0134('0x7')]=_0x49df44[_0x0134('0x7')]||'';this[_0x0134('0x8')]=_0x49df44[_0x0134('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 468af38..9d7c88d 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 _0xcd45=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x2d2623,_0x1aaea0){var _0x28f6c1=function(_0x599d40){while(--_0x599d40){_0x2d2623['push'](_0x2d2623['shift']());}};_0x28f6c1(++_0x1aaea0);}(_0xcd45,0x1f2));var _0x5cd4=function(_0x561375,_0x354b19){_0x561375=_0x561375-0x0;var _0x3e36d0=_0xcd45[_0x561375];return _0x3e36d0;};'use strict';function ZohoAccount(_0xf93364){this['id']=_0xf93364['id']||0x0;this[_0x5cd4('0x0')]=_0xf93364[_0x5cd4('0x0')]||'';this[_0x5cd4('0x1')]=_0xf93364['description']||'';this[_0x5cd4('0x2')]=_0xf93364[_0x5cd4('0x2')]||'';this[_0x5cd4('0x3')]=_0xf93364['zone']||'';this[_0x5cd4('0x4')]=_0xf93364[_0x5cd4('0x4')]||'';this[_0x5cd4('0x5')]=_0xf93364['clientSecret']||'';this[_0x5cd4('0x6')]=_0xf93364['serverUrl']||'';this[_0x5cd4('0x7')]=_0xf93364[_0x5cd4('0x7')]||'';this[_0x5cd4('0x8')]=_0xf93364['refreshToken']||'';this[_0x5cd4('0x9')]=_0xf93364[_0x5cd4('0x9')]||{};}module[_0x5cd4('0xa')]=ZohoAccount; \ No newline at end of file +var _0x39ba=['description','host','zone','clientId','clientSecret','serverUrl','code','Configurations','exports','name'];(function(_0x2d6b32,_0x35905a){var _0x5b6619=function(_0x54b454){while(--_0x54b454){_0x2d6b32['push'](_0x2d6b32['shift']());}};_0x5b6619(++_0x35905a);}(_0x39ba,0xe5));var _0xa39b=function(_0x5c5cf0,_0x83c4d4){_0x5c5cf0=_0x5c5cf0-0x0;var _0xc58e1d=_0x39ba[_0x5c5cf0];return _0xc58e1d;};'use strict';function ZohoAccount(_0x31b5cf){this['id']=_0x31b5cf['id']||0x0;this[_0xa39b('0x0')]=_0x31b5cf[_0xa39b('0x0')]||'';this[_0xa39b('0x1')]=_0x31b5cf[_0xa39b('0x1')]||'';this[_0xa39b('0x2')]=_0x31b5cf['host']||'';this[_0xa39b('0x3')]=_0x31b5cf[_0xa39b('0x3')]||'';this[_0xa39b('0x4')]=_0x31b5cf[_0xa39b('0x4')]||'';this[_0xa39b('0x5')]=_0x31b5cf[_0xa39b('0x5')]||'';this[_0xa39b('0x6')]=_0x31b5cf[_0xa39b('0x6')]||'';this[_0xa39b('0x7')]=_0x31b5cf[_0xa39b('0x7')]||'';this['refreshToken']=_0x31b5cf['refreshToken']||'';this[_0xa39b('0x8')]=_0x31b5cf[_0xa39b('0x8')]||{};}module[_0xa39b('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 5d50730..d6f6e16 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 _0x9f40=['recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','\x22%s\x22\x20<%s>','exports','lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','phone','Contact','active','scheduledat','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','callback','callbackuniqueid','callbackat'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0x9f40,0x138));var _0x09f4=function(_0x4cff86,_0x466cb7){_0x4cff86=_0x4cff86-0x0;var _0x32f02c=_0x9f40[_0x4cff86];return _0x32f02c;};'use strict';var util=require('util');var _=require(_0x09f4('0x0'));var moment=require(_0x09f4('0x1'));function checkNameSurname(_0x108a35,_0x1cca17,_0x503d88){var _0x51f83a='';if(!_[_0x09f4('0x2')](_0x1cca17)&&_0x09f4('0x3')===typeof _0x1cca17){_0x51f83a+=_0x1cca17;}if(!_[_0x09f4('0x2')](_0x503d88)&&_0x09f4('0x3')===typeof _0x503d88){_0x51f83a+='\x20'+_0x503d88;}if(_0x51f83a!==''){return _0x51f83a;}return _0x108a35;}function Action(_0x1acb28,_0x4cdb23,_0x5234b4,_0x2e1469,_0xbfc254){this['uniqueid']=_0x5234b4||undefined;this[_0x09f4('0x4')]=_0x1acb28['id'];this[_0x09f4('0x5')]=_0x4cdb23[_0x09f4('0x6')];this[_0x09f4('0x7')]=_0x4cdb23[_0x09f4('0x7')];this['campaigntype']='queue';this[_0x09f4('0x8')]=![];this['membername']=_[_0x09f4('0x2')](_0x1acb28['Agent'])?undefined:_0x1acb28[_0x09f4('0x9')][_0x09f4('0x6')];this[_0x09f4('0xa')]=this[_0x09f4('0xb')]?util[_0x09f4('0xc')](_0x09f4('0xd'),this['membername']):_0x2e1469||undefined;this[_0x09f4('0xe')]=checkNameSurname(_0x1acb28['Contact'][_0x09f4('0xf')],_0x1acb28[_0x09f4('0x10')]['firstName'],_0x1acb28[_0x09f4('0x10')]['lastName']);this[_0x09f4('0x11')]=_0x1acb28[_0x09f4('0x11')]||![];this['calleridnum']=_0x1acb28[_0x09f4('0x10')][_0x09f4('0xf')];this[_0x09f4('0x12')]=_0x1acb28[_0x09f4('0x12')];this[_0x09f4('0x13')]=_0x1acb28['countbusyretry']||0x0;this['countcongestionretry']=_0x1acb28['countcongestionretry']||0x0;this[_0x09f4('0x14')]=_0x1acb28[_0x09f4('0x14')]||0x0;this['countglobal']=(_0x1acb28[_0x09f4('0x13')]||0x0)+(_0x1acb28[_0x09f4('0x15')]||0x0)+(_0x1acb28[_0x09f4('0x14')]||0x0)+(_0x1acb28['countnosuchnumberretry']||0x0)+(_0x1acb28[_0x09f4('0x16')]||0x0)+(_0x1acb28[_0x09f4('0x17')]||0x0)+(_0x1acb28[_0x09f4('0x18')]||0x0)+(_0x1acb28['countagentrejectretry']||0x0);this[_0x09f4('0x19')]=_0x1acb28[_0x09f4('0x19')]||0x0;this['countdropretry']=_0x1acb28[_0x09f4('0x16')]||0x0;this[_0x09f4('0x17')]=_0x1acb28['countabandonedretry']||0x0;this[_0x09f4('0x18')]=_0x1acb28['countmachineretry']||0x0;this[_0x09f4('0x1a')]=_0x1acb28[_0x09f4('0x1a')]||0x0;this[_0x09f4('0x1b')]=_0x1acb28['callback'];this[_0x09f4('0x1c')]=_0x1acb28['callbackuniqueid'];this['callbackat']=_0x1acb28[_0x09f4('0x1d')];this[_0x09f4('0x1e')]=_0x1acb28[_0x09f4('0x1e')];this[_0x09f4('0x1f')]=_0x1acb28[_0x09f4('0x1f')];this[_0x09f4('0x20')]=_0x1acb28[_0x09f4('0x20')];this[_0x09f4('0x21')]=_[_0x09f4('0x2')](_0x1acb28[_0x09f4('0x9')])?_0x1acb28[_0x09f4('0x21')]:_0x1acb28[_0x09f4('0x9')]['id'];this[_0x09f4('0x22')]=_0x1acb28[_0x09f4('0x22')];this[_0x09f4('0x23')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util['format'](_0x09f4('0x24'),this[_0x09f4('0xe')],this['number']);};module[_0x09f4('0x25')]=Action; \ No newline at end of file +var _0x2308=['Contact','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent'];(function(_0x101da2,_0x3d5d98){var _0x2af8cf=function(_0x4ad326){while(--_0x4ad326){_0x101da2['push'](_0x101da2['shift']());}};_0x2af8cf(++_0x3d5d98);}(_0x2308,0x140));var _0x8230=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x2308[_0x33032e];return _0x13316b;};'use strict';var util=require(_0x8230('0x0'));var _=require(_0x8230('0x1'));var moment=require('moment');function checkNameSurname(_0x322667,_0x1871a7,_0x152ea7){var _0x513860='';if(!_[_0x8230('0x2')](_0x1871a7)&&_0x8230('0x3')===typeof _0x1871a7){_0x513860+=_0x1871a7;}if(!_[_0x8230('0x2')](_0x152ea7)&&_0x8230('0x3')===typeof _0x152ea7){_0x513860+='\x20'+_0x152ea7;}if(_0x513860!==''){return _0x513860;}return _0x322667;}function Action(_0x310ef4,_0x24a3c6,_0x42f0e2,_0x514f51,_0x279e5a){this[_0x8230('0x4')]=_0x42f0e2||undefined;this['idContact']=_0x310ef4['id'];this[_0x8230('0x5')]=_0x24a3c6[_0x8230('0x6')];this['type']=_0x24a3c6[_0x8230('0x7')];this[_0x8230('0x8')]=_0x8230('0x5');this[_0x8230('0x9')]=![];this[_0x8230('0xa')]=_[_0x8230('0x2')](_0x310ef4[_0x8230('0xb')])?undefined:_0x310ef4[_0x8230('0xb')][_0x8230('0x6')];this[_0x8230('0xc')]=this[_0x8230('0xa')]?util['format']('SIP/%s',this[_0x8230('0xa')]):_0x514f51||undefined;this['calleridname']=checkNameSurname(_0x310ef4[_0x8230('0xd')]['phone'],_0x310ef4[_0x8230('0xd')]['firstName'],_0x310ef4[_0x8230('0xd')]['lastName']);this[_0x8230('0xe')]=_0x310ef4[_0x8230('0xe')]||![];this[_0x8230('0xf')]=_0x310ef4[_0x8230('0xd')][_0x8230('0x10')];this['scheduledat']=_0x310ef4[_0x8230('0x11')];this[_0x8230('0x12')]=_0x310ef4[_0x8230('0x12')]||0x0;this[_0x8230('0x13')]=_0x310ef4[_0x8230('0x13')]||0x0;this[_0x8230('0x14')]=_0x310ef4['countnoanswerretry']||0x0;this['countglobal']=(_0x310ef4[_0x8230('0x12')]||0x0)+(_0x310ef4['countcongestionretry']||0x0)+(_0x310ef4['countnoanswerretry']||0x0)+(_0x310ef4[_0x8230('0x15')]||0x0)+(_0x310ef4['countdropretry']||0x0)+(_0x310ef4[_0x8230('0x16')]||0x0)+(_0x310ef4[_0x8230('0x17')]||0x0)+(_0x310ef4[_0x8230('0x18')]||0x0);this['countnosuchnumberretry']=_0x310ef4['countnosuchnumberretry']||0x0;this[_0x8230('0x19')]=_0x310ef4['countdropretry']||0x0;this[_0x8230('0x16')]=_0x310ef4['countabandonedretry']||0x0;this[_0x8230('0x17')]=_0x310ef4[_0x8230('0x17')]||0x0;this[_0x8230('0x18')]=_0x310ef4[_0x8230('0x18')]||0x0;this[_0x8230('0x1a')]=_0x310ef4[_0x8230('0x1a')];this['callbackuniqueid']=_0x310ef4[_0x8230('0x1b')];this[_0x8230('0x1c')]=_0x310ef4[_0x8230('0x1c')];this[_0x8230('0x1d')]=_0x310ef4[_0x8230('0x1d')];this['ContactId']=_0x310ef4[_0x8230('0x1e')];this[_0x8230('0x1f')]=_0x310ef4['ListId'];this[_0x8230('0x20')]=_[_0x8230('0x2')](_0x310ef4[_0x8230('0xb')])?_0x310ef4[_0x8230('0x20')]:_0x310ef4[_0x8230('0xb')]['id'];this[_0x8230('0x21')]=_0x310ef4[_0x8230('0x21')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util['format'](_0x8230('0x22'),this[_0x8230('0x23')],this['number']);};module[_0x8230('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index b8351a4..d6a781d 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 _0x04de=['erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','voice_queue_presence:remove','pTalking','sendMessageOneNotActive','paused','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','hasOwnProperty','booked','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','info','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','agentReadyId','getDiff','dialRecallMeTimeout','Agent','voicePause','then','[RecallMe]','logger2','disableContact','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','uniqueid','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','scheduledAt','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','VoiceQueueId','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','run','execRun','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','unlockContact','idContact','rejected','starttime','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','name','available','loggedIn','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls'];(function(_0x37b5c0,_0x339f4a){var _0x1f251f=function(_0x31587e){while(--_0x31587e){_0x37b5c0['push'](_0x37b5c0['shift']());}};_0x1f251f(++_0x339f4a);}(_0x04de,0x107));var _0xe04d=function(_0x3c9d48,_0x4e3f26){_0x3c9d48=_0x3c9d48-0x0;var _0x4e3d8c=_0x04de[_0x3c9d48];return _0x4e3d8c;};'use strict';var util=require(_0xe04d('0x0'));var _=require(_0xe04d('0x1'));var BPromise=require(_0xe04d('0x2'));var uuid=require(_0xe04d('0x3'));var moment=require(_0xe04d('0x4'));var md5=require(_0xe04d('0x5'));var Redis=require(_0xe04d('0x6'));var config=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var loggerAction=require(_0xe04d('0x8'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xe04d('0xa'));config[_0xe04d('0xb')]=_[_0xe04d('0xc')](config[_0xe04d('0xb')],{'host':_0xe04d('0xd'),'port':0x18eb});var io=require(_0xe04d('0xe'))(new Redis(config[_0xe04d('0xb')]));var Sequence=function(){};Sequence[_0xe04d('0xf')]['enqueue']=function(_0x160d4f){this[_0xe04d('0x10')]=this[_0xe04d('0x10')]?this[_0xe04d('0x10')][_0xe04d('0x11')](_0x160d4f):_0x160d4f();};function Preview(_0x3e1837){this[_0xe04d('0x12')]=new Sequence();this[_0xe04d('0x13')]=_0x3e1837[_0xe04d('0x14')];this['trunks']=_0x3e1837[_0xe04d('0x15')];this[_0xe04d('0x16')]={};this[_0xe04d('0x17')]=_0x3e1837[_0xe04d('0x17')];this[_0xe04d('0x18')]=0x0;ami['on'](_0xe04d('0x19'),this[_0xe04d('0x1a')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x1c'),this[_0xe04d('0x1d')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x1e'),this['syncHangupRequest'][_0xe04d('0x1b')](this));ami['on']('dialend',this[_0xe04d('0x1f')]['bind'](this));ami['on'](_0xe04d('0x20'),this[_0xe04d('0x21')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x22'),this[_0xe04d('0x23')][_0xe04d('0x1b')](this));ami['on'](_0xe04d('0x24'),this[_0xe04d('0x25')][_0xe04d('0x1b')](this));ami['on']('blindtransfer',this[_0xe04d('0x26')][_0xe04d('0x1b')](this));this[_0xe04d('0x27')](this[_0xe04d('0x13')]);}function emit(_0x2ac847,_0x34e15f,_0x55fc38){io['to'](_0x2ac847)[_0xe04d('0x28')](_0x34e15f,_0x55fc38);}function emitCampaignPreview(_0x162ee4){if(_0x162ee4['type']==='outbound'){var _0x5bcfc3={'id':_0x162ee4['id'],'name':_0x162ee4[_0xe04d('0x29')],'strategy':_0x162ee4['strategy'],'answered':_0x162ee4['answered'],'available':_0x162ee4[_0xe04d('0x2a')],'loggedIn':_0x162ee4[_0xe04d('0x2b')],'pTalking':_0x162ee4['pTalking'],'sumBillable':_0x162ee4[_0xe04d('0x2c')],'sumDuration':_0x162ee4['sumDuration'],'sumHoldTime':_0x162ee4[_0xe04d('0x2d')]||0x0,'talking':_0x162ee4['talking'],'total':_0x162ee4[_0xe04d('0x2e')],'type':_0x162ee4[_0xe04d('0x2f')],'unmanaged':_0x162ee4[_0xe04d('0x30')],'abandoned':_0x162ee4[_0xe04d('0x31')],'waiting':_0x162ee4[_0xe04d('0x32')],'loggedInDb':_0x162ee4['loggedInDb'],'dialActive':_0x162ee4[_0xe04d('0x33')],'dialMethod':_0x162ee4[_0xe04d('0x34')],'dialOriginateCallerIdName':_0x162ee4[_0xe04d('0x35')],'dialOriginateCallerIdNumber':_0x162ee4[_0xe04d('0x36')],'dialOriginateTimeout':_0x162ee4['dialOriginateTimeout'],'dialPrefix':_0x162ee4[_0xe04d('0x37')],'outboundAnswerAgiCallsDay':_0x162ee4[_0xe04d('0x38')],'outboundAnswerCallsDay':_0x162ee4[_0xe04d('0x39')],'outboundBlacklistCallsDay':_0x162ee4['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x162ee4[_0xe04d('0x3a')],'outboundCongestionCallsDay':_0x162ee4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x162ee4['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x162ee4['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x162ee4[_0xe04d('0x3b')],'outboundNoAnswerCallsDay':_0x162ee4[_0xe04d('0x3c')],'outboundNoSuchCallsDay':_0x162ee4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x162ee4['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x162ee4[_0xe04d('0x3d')],'outboundRejectCallsDay':_0x162ee4[_0xe04d('0x3e')],'outboundUnknownCallsDay':_0x162ee4[_0xe04d('0x3f')],'outboundAbandonedCallsDay':_0x162ee4['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x162ee4[_0xe04d('0x40')],'predictiveIntervalAvgHoldtime':_0x162ee4[_0xe04d('0x41')],'predictiveIntervalAvgTalktime':_0x162ee4['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x162ee4[_0xe04d('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x162ee4['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x162ee4[_0xe04d('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x162ee4[_0xe04d('0x44')],'predictiveIntervalHitRate':_0x162ee4['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x162ee4[_0xe04d('0x45')],'predictiveIntervalPauses':_0x162ee4['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x162ee4[_0xe04d('0x46')],'predictiveIntervalTotalCalls':_0x162ee4[_0xe04d('0x47')],'message':_0x162ee4[_0xe04d('0x48')],'originated':_0x162ee4[_0xe04d('0x49')],'erlangCalls':_0x162ee4[_0xe04d('0x4a')],'erlangCallToSecond':_0x162ee4[_0xe04d('0x4b')],'erlangAbandonmentRate':_0x162ee4[_0xe04d('0x4c')],'erlangBusyFactor':_0x162ee4['erlangBusyFactor'],'startPredictive':_0x162ee4[_0xe04d('0x4d')],'startProgressive':_0x162ee4[_0xe04d('0x4e')]};if(_0x162ee4[_0xe04d('0x4f')]){_0x5bcfc3[_0xe04d('0x4f')]={'id':_0x162ee4[_0xe04d('0x4f')]['id'],'name':_0x162ee4[_0xe04d('0x4f')][_0xe04d('0x29')],'active':_0x162ee4[_0xe04d('0x4f')][_0xe04d('0x50')],'callerid':_0x162ee4['Trunk'][_0xe04d('0x51')]};}if(_0x162ee4['Interval']){_0x5bcfc3[_0xe04d('0x52')]={'id':_0x162ee4['Interval']['id'],'name':_0x162ee4['Interval'][_0xe04d('0x29')]};}var _0x9353a1=md5(JSON[_0xe04d('0x53')](_0x5bcfc3));if(_0x162ee4[_0xe04d('0x5')]!==_0x9353a1){_0x162ee4['md5']=_0x9353a1;emit(util[_0xe04d('0x54')](_0xe04d('0x55'),_0x5bcfc3[_0xe04d('0x29')]),_0xe04d('0x56'),_0x5bcfc3);}}}function emitVoiceQueueChannelRemove(_0x322228){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xe04d('0x53')](_0x322228));emit(util['format']('voice:queue:%s',_0x322228[_0xe04d('0x29')]),_0xe04d('0x57'),_0x322228);io[_0xe04d('0x28')](_0xe04d('0x58'),_0x322228);}function notSendMessagesQueue(_0x5915d9){if(_0x5915d9['sendMessageOneNotActive']){if(_0x5915d9[_0xe04d('0x49')]===0x0&&_0x5915d9[_0xe04d('0x59')]===0x0){_0x5915d9[_0xe04d('0x5a')]=![];_0x5915d9[_0xe04d('0x2a')]=0x0;_0x5915d9[_0xe04d('0x5b')]=0x0;_0x5915d9[_0xe04d('0x48')]='NOT_ACTIVE';ut[_0xe04d('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5915d9[_0xe04d('0x29')]+_0xe04d('0x5d'));}else{_0x5915d9[_0xe04d('0x48')]=_0xe04d('0x5e');ut[_0xe04d('0x5c')](_0xe04d('0x5f'),_0x5915d9[_0xe04d('0x29')]+_0xe04d('0x60'));}emitCampaignPreview(_0x5915d9);}}Preview['prototype'][_0xe04d('0x27')]=function(){var _0x14c36b=this;setInterval(function(){_0x14c36b['syncCampaigns']();},0x7cf);};Preview[_0xe04d('0xf')]['syncCampaigns']=function(){var _0x123926=this[_0xe04d('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x198d89 in _0x123926){if(_0x123926[_0xe04d('0x61')](_0x198d89)&&(_0x123926[_0x198d89][_0xe04d('0x34')]===_0xe04d('0x9')||_0x123926[_0x198d89][_0xe04d('0x34')]===_0xe04d('0x62'))&&_0x123926[_0x198d89][_0xe04d('0x2f')]===_0xe04d('0x63')){if(this[_0xe04d('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x123926['hasOwnProperty'](_0x198d89)&&_0x123926[_0x198d89][_0xe04d('0x34')]==='preview'&&_0x123926[_0x198d89][_0xe04d('0x2f')]===_0xe04d('0x63')){if(_0x123926[_0x198d89][_0xe04d('0x33')]){this[_0xe04d('0x64')](_0x123926[_0x198d89]);if(_0x123926[_0x198d89][_0xe04d('0x65')])this[_0xe04d('0x66')](_0x123926[_0x198d89]);}else{notSendMessagesQueue(_0x123926[_0x198d89]);}}}};Preview['prototype'][_0xe04d('0x67')]=function(_0x3d20ac){var _0x5526b5=this;this['sequence'][_0xe04d('0x68')](function(){if(!_[_0xe04d('0x69')](_0x5526b5['actions'][_0x3d20ac])){loggerAction[_0xe04d('0x6a')]('[clearZombieChannels][talking]',_0x3d20ac,_0xe04d('0x6b'),_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6c')],_0xe04d('0x6d'),JSON[_0xe04d('0x53')](_0x5526b5[_0xe04d('0x13')][_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6c')]][_0xe04d('0x49')]),_0xe04d('0x6e'),JSON['stringify'](_0x5526b5['campaignsPreview'][_0x5526b5[_0xe04d('0x16')][_0x3d20ac]['queue']]['pTalking']),JSON['stringify'](_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6f')]),JSON[_0xe04d('0x53')](_['pick'](_0x5526b5['actions'][_0x3d20ac],[_0xe04d('0x70'),_0xe04d('0x71'),'VoiceQueueId','ListId'])));return ami[_0xe04d('0x72')]({'action':'status','channel':_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x73')]})[_0xe04d('0x74')](function(_0x434315){if(_0x434315[_0xe04d('0x48')]===_0xe04d('0x75')){setTimeout(function(){if(_0x5526b5[_0xe04d('0x16')][_0x3d20ac]){ut[_0xe04d('0x76')](_0x5526b5['campaignsPreview'][_0x5526b5['actions'][_0x3d20ac][_0xe04d('0x6c')]],_0xe04d('0x77'));if(_0x5526b5[_0xe04d('0x16')][_0x3d20ac][_0xe04d('0x6f')]===!![]){ut[_0xe04d('0x78')](_0x5526b5['campaignsPreview'][_0x5526b5['actions'][_0x3d20ac][_0xe04d('0x6c')]],'[clearZombieChannel]');ut['loggerError'](_0xe04d('0x79')+_0x3d20ac,_0x5526b5['actions'][_0x3d20ac][_0xe04d('0x6c')]);}ut['loggerError'](_0xe04d('0x7a')+_0x3d20ac,_0x5526b5['actions'][_0x3d20ac]['queue']);delete _0x5526b5[_0xe04d('0x16')][_0x3d20ac];}},0x2328);}});}});};Preview[_0xe04d('0xf')][_0xe04d('0x7b')]=function(){var _0x1996cf=this;loggerAction[_0xe04d('0x6a')](_0xe04d('0x7c'),_[_0xe04d('0x7d')](this[_0xe04d('0x16')]));for(var _0xa032af in this[_0xe04d('0x16')]){if(_0x1996cf[_0xe04d('0x16')]['hasOwnProperty'](_0xa032af)){_0x1996cf[_0xe04d('0x67')](_0xa032af);}}};Preview[_0xe04d('0xf')][_0xe04d('0x66')]=function(_0x522242){var _0x455951=this;rpcDb['getContactRecallMe'](_0x522242['id'],ut[_0xe04d('0x7e')](this[_0xe04d('0x17')]))['then'](function(_0x1f9540){if(!_[_0xe04d('0x69')](_0x1f9540)){for(var _0x19c0d6=0x0;_0x19c0d6<_0x1f9540['length'];_0x19c0d6+=0x1){if(ut[_0xe04d('0x7f')](_0x1f9540[_0x19c0d6]['scheduledat'])<_0x522242[_0xe04d('0x80')]*0x3c){if(_0x1f9540[_0x19c0d6][_0xe04d('0x81')]&&!_0x1f9540[_0x19c0d6][_0xe04d('0x81')][_0xe04d('0x82')]){_0x455951['run'](_0x1f9540[_0x19c0d6]['id'])[_0xe04d('0x83')](ut['logger2'](_0xe04d('0x84')))['catch'](ut[_0xe04d('0x85')](_0xe04d('0x84')));}else{rpcDb[_0xe04d('0x86')](_0x1f9540[_0x19c0d6]['id']);}}else{var _0x174143=new Action(_0x1f9540[_0x19c0d6],_0x522242);_0x174143['starttime']=moment()[_0xe04d('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x522242['outboundReCallsDay']+=0x1;ut[_0xe04d('0x87')](_0x174143,0x17,_0xe04d('0x88'));if(_0x522242[_0xe04d('0x89')]){rpcDb[_0xe04d('0x8a')](ut['createBody'](_0x1f9540[_0x19c0d6]));rpcDb['createCustomerHistory'](_0x174143,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x174143,0x16,_0xe04d('0x8b'));rpcDb[_0xe04d('0x8c')](_0x174143,'[HistoryRecallClose]');rpcDb[_0xe04d('0x8d')](_0x174143,_0xe04d('0x8e'));}}}}})[_0xe04d('0x74')](ut[_0xe04d('0x85')](_0xe04d('0x8f')));};Preview['prototype'][_0xe04d('0x64')]=function(_0x49d579){_0x49d579[_0xe04d('0x5a')]=!![];if(ut['IsNotLoggedIn'](_0x49d579[_0xe04d('0x2b')])){_0x49d579[_0xe04d('0x48')]=_0xe04d('0x90');}else if(!ut['isActive'](_0x49d579[_0xe04d('0x33')])){_0x49d579[_0xe04d('0x48')]=_0xe04d('0x91');}else if(!this[_0xe04d('0x92')](_0x49d579[_0xe04d('0x4f')])){if(!this[_0xe04d('0x92')](_0x49d579[_0xe04d('0x93')])){_0x49d579['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x49d579[_0xe04d('0x48')]=_0xe04d('0x94');}}else{_0x49d579[_0xe04d('0x48')]=_0xe04d('0x94');}emitCampaignPreview(_0x49d579);};Preview['prototype'][_0xe04d('0x95')]=function(_0xe6d038,_0x192054,_0xcc3f96){var _0x526733=this;var _0x1d3e7c=this[_0xe04d('0x16')][_0x192054];var _0x5a6e4a=this[_0xe04d('0x13')][_0x1d3e7c[_0xe04d('0x6c')]];var _0x24a3bc;if(_0x5a6e4a){switch(_0xcc3f96){case'1':_0x5a6e4a['outboundNoSuchCallsDay']+=0x1;_0x1d3e7c[_0xe04d('0x96')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x0,_0xe04d('0x99'));ami[_0xe04d('0x28')](_0xe04d('0x9a'),ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0x9c')));rpcDb['createCustomerHistory'](_0x1d3e7c,_0xe04d('0x9d'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xa1'));}else{if(_0x1d3e7c[_0xe04d('0x96')]>=_0x5a6e4a[_0xe04d('0xa2')]){rpcDb['createCustomerFinal'](_0x1d3e7c,_0xe04d('0xa1'));}else{rpcDb[_0xe04d('0xa3')](ut['scheduledAt'](_0x1d3e7c,_0xe04d('0x96'),_0x5a6e4a['dialNoSuchNumberRetryFrequency']),_0x1d3e7c['unlockAgent'],_0x1d3e7c[_0xe04d('0xa4')]);}}delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];break;case _0xe04d('0xa6'):var _0x242a6b=moment()['format'](_0xe04d('0xa7'));_0x1d3e7c[_0xe04d('0xa8')]=_0x242a6b;_0x1d3e7c['answertime']=_0x242a6b;_0x1d3e7c[_0xe04d('0x6f')]=!![];_0x5a6e4a['pTalking']+=0x1;logger['info']('[syncHangup][talking][increment]',_0x1d3e7c[_0xe04d('0xa9')],'\x20Queue',_0x5a6e4a[_0xe04d('0x29')],'pTalking:\x20',_0x5a6e4a[_0xe04d('0x59')]);ami[_0xe04d('0x28')]('custom:agentconnect',ut[_0xe04d('0x9b')](_0x1d3e7c,'connect',this[_0xe04d('0x13')][_0x1d3e7c['queue']]));if(_0x5a6e4a[_0xe04d('0xaa')]){ami[_0xe04d('0x28')](_0xe04d('0xab'),ut[_0xe04d('0xac')](_0x1d3e7c));}break;case'16':ami[_0xe04d('0x28')](_0xe04d('0xad'),ut[_0xe04d('0x9b')](_0x1d3e7c,'complete',this[_0xe04d('0x13')][_0x1d3e7c['queue']]));emitVoiceQueueChannelRemove(ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0xae')));_0x5a6e4a['outboundAnswerCallsDay']+=0x1;_0x5a6e4a[_0xe04d('0x2e')]+=0x1;_0x5a6e4a[_0xe04d('0xaf')]+=0x1;ut[_0xe04d('0x78')](_0x5a6e4a,_0xe04d('0xb0'));_0x1d3e7c['countglobal']=ut[_0xe04d('0x98')](_0x1d3e7c);ut['logCustomer'](_0x1d3e7c,0x4,'Answer');rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xb1'));rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xb2'));rpcDb[_0xe04d('0xb3')](_0x1d3e7c);_0x5a6e4a[_0xe04d('0xb4')]+=_0x1d3e7c[_0xe04d('0xb5')];_0x5a6e4a['sumBillable']+=_0x1d3e7c[_0xe04d('0xb5')];logger[_0xe04d('0x6a')](_0xe04d('0xb6'),_0x1d3e7c[_0xe04d('0xa9')],_0xe04d('0xb7'),_0x5a6e4a[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5a6e4a[_0xe04d('0x59')]);delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];break;case _0xe04d('0xb8'):_0x5a6e4a['outboundBusyCallsDay']+=0x1;_0x1d3e7c[_0xe04d('0xb9')]+=0x1;_0x1d3e7c['countglobal']=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x5,_0xe04d('0xba'));ami[_0xe04d('0x28')](_0xe04d('0xbb'),ut['buildObj'](_0x1d3e7c,'busy'));rpcDb['createCustomerHistory'](_0x1d3e7c,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a['dialGlobalMaxRetry']){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,'Global');rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xbc'));}else{if(_0x1d3e7c['countbusyretry']>=_0x5a6e4a[_0xe04d('0xbd')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1d3e7c,'countbusyretry',_0x5a6e4a[_0xe04d('0xbe')]),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c['activeContact']);}}break;case _0xe04d('0xc0'):_0x5a6e4a[_0xe04d('0x3c')]+=0x1;_0x1d3e7c[_0xe04d('0xc1')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x3,_0xe04d('0xc2'));ami['emit'](_0xe04d('0xc3'),ut['buildObj'](_0x1d3e7c,'noanswer'));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xc4'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut['cloneAction'](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xc5'));}else{if(_0x1d3e7c['countnoanswerretry']>=_0x5a6e4a['dialNoAnswerMaxRetry']){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xc4'));}else{rpcDb[_0xe04d('0xa3')](ut['scheduledAt'](_0x1d3e7c,'countnoanswerretry',_0x5a6e4a[_0xe04d('0xc6')]),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c[_0xe04d('0xa4')]);}}break;case'CONGESTION':_0x5a6e4a['outboundCongestionCallsDay']+=0x1;_0x1d3e7c['countcongestionretry']+=0x1;_0x1d3e7c['countglobal']=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x8,_0xe04d('0xc7'));ami[_0xe04d('0x28')](_0xe04d('0xc8'),ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0xc9')));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xca'));if(ut['totalGlobal'](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,_0xe04d('0xcb'));}else{if(_0x1d3e7c[_0xe04d('0xcc')]>=_0x5a6e4a[_0xe04d('0xcd')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xca'));}else{rpcDb[_0xe04d('0xa3')](ut[_0xe04d('0xce')](_0x1d3e7c,_0xe04d('0xcc'),_0x5a6e4a['dialBusyRetryFrequency']),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c['activeContact']);}}break;case _0xe04d('0xcf'):_0x5a6e4a[_0xe04d('0x3e')]+=0x1;_0x1d3e7c[_0xe04d('0xd0')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x14,_0xe04d('0xd1'));ami[_0xe04d('0x28')](_0xe04d('0xd2'),ut[_0xe04d('0x9b')](_0x1d3e7c,_0xe04d('0xd3')));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xd4'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a['dialGlobalMaxRetry']){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x24a3bc,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1d3e7c[_0xe04d('0xd0')]>=_0x5a6e4a[_0xe04d('0xd5')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xd6'));}else{rpcDb[_0xe04d('0xa3')](ut[_0xe04d('0xce')](_0x1d3e7c,_0xe04d('0xd0'),_0x5a6e4a[_0xe04d('0xd7')]),_0x1d3e7c['unlockAgent'],_0x1d3e7c[_0xe04d('0xa4')]);}}break;case _0xe04d('0xd8'):_0x5a6e4a[_0xe04d('0xd9')]+=0x1;_0x1d3e7c[_0xe04d('0xda')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0xb,_0xe04d('0xdb'));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xdc'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb['createCustomerFinal'](_0x24a3bc,_0xe04d('0xdc'));}else{if(_0x1d3e7c[_0xe04d('0xdd')]>=_0x5a6e4a[_0xe04d('0xde')]){rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xdc'));}else{rpcDb[_0xe04d('0xa3')](ut[_0xe04d('0xce')](_0x1d3e7c,_0xe04d('0xda'),_0x5a6e4a['dialAbandonedRetryFrequency']),_0x1d3e7c[_0xe04d('0xbf')],_0x1d3e7c[_0xe04d('0xa4')]);}}break;case'18':_0x5a6e4a[_0xe04d('0x3f')]+=0x1;_0x1d3e7c['countmachineretry']+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x12,_0xe6d038['cause-txt']||_0xe6d038[_0xe04d('0xdf')]);ami[_0xe04d('0x28')]('custom:amd',ut['buildObj'](_0x1d3e7c,_0xe04d('0xe0')));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb[_0xe04d('0x8d')](_0x24a3bc,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xe1'));}delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];break;case'19':_0x5a6e4a[_0xe04d('0x3f')]+=0x1;_0x1d3e7c[_0xe04d('0x97')]=ut[_0xe04d('0x98')](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0x13,_0xe6d038[_0xe04d('0xe2')]||_0xe6d038[_0xe04d('0xdf')]);ami[_0xe04d('0x28')](_0xe04d('0xe3'),ut['buildObj'](_0x1d3e7c,'amd'));rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xe4'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a['dialGlobalMaxRetry']){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,_0xe04d('0xa0'));rpcDb['createCustomerFinal'](_0x24a3bc,_0xe04d('0xe4'));}else{rpcDb[_0xe04d('0x8d')](_0x1d3e7c,'[callProgressDetectingCustomer][machine]');}delete this[_0xe04d('0x16')][_0xe6d038['linkedid']];break;default:if(_0x1d3e7c['dialAnswer']){ut[_0xe04d('0x78')](_0x5a6e4a,_0xe04d('0xe5'));ut[_0xe04d('0xe6')](_0xe04d('0xe7')+_0x5a6e4a[_0xe04d('0x29')],_0xe6d038);}_0x5a6e4a[_0xe04d('0x3f')]+=0x1;_0x1d3e7c['countglobal']=ut['totalGlobal'](_0x1d3e7c);ut[_0xe04d('0x87')](_0x1d3e7c,0xc,_0xe6d038['cause-txt']||_0xe6d038[_0xe04d('0xdf')]);rpcDb[_0xe04d('0x8c')](_0x1d3e7c,_0xe04d('0xe8'));if(ut[_0xe04d('0x98')](_0x1d3e7c)>=_0x5a6e4a[_0xe04d('0x9e')]){_0x24a3bc=ut[_0xe04d('0x9f')](_0x1d3e7c,0xf,'Global');rpcDb['createCustomerFinal'](_0x24a3bc,_0xe04d('0xe9'));}else{rpcDb[_0xe04d('0x8d')](_0x1d3e7c,_0xe04d('0xe9'));}delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];}if(!(_0x1d3e7c[_0xe04d('0x6f')]&&_0xcc3f96==='16')){ut[_0xe04d('0x76')](_0x5a6e4a,_0xe04d('0xea'));logger[_0xe04d('0x6a')]('[originated][decrement][callProgressDetectingCustomer]',_0x1d3e7c[_0xe04d('0xa9')],_0xe04d('0xb7'),_0x5a6e4a[_0xe04d('0x29')],'originated:\x20',_0x5a6e4a[_0xe04d('0x49')]);}if(_0xcc3f96!==_0xe04d('0xa6')){delete this[_0xe04d('0x16')][_0xe6d038[_0xe04d('0xa5')]];delete this['actions'][_0xe6d038[_0xe04d('0xeb')]];}}};Preview[_0xe04d('0xf')][_0xe04d('0xec')]=function(_0x49c639,_0x38bd21,_0x1f8465){if(_[_0xe04d('0xed')](_0x38bd21)&&_0xe04d('0xee')!==typeof _0x38bd21){return;}if(_[_0xe04d('0xed')](_0x1f8465)&&_0xe04d('0xee')!==typeof _0x1f8465){return;}switch(_0x1f8465[_0xe04d('0xef')]){case'0':ut[_0xe04d('0xf0')](_0x49c639,0x0,_0xe04d('0x99'));rpcDb[_0xe04d('0xf1')](_0x49c639,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xe04d('0xf0')](_0x49c639,0x3,_0xe04d('0xc2'));rpcDb[_0xe04d('0xf1')](_0x49c639,_0xe04d('0xf2'));break;case'5':ut['logAgent'](_0x49c639,0x5,_0xe04d('0xba'));rpcDb[_0xe04d('0xf1')](_0x49c639,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x49c639,0x8,_0xe04d('0xc7'));rpcDb[_0xe04d('0xf1')](_0x49c639,_0xe04d('0xf3'));break;case'22':ut[_0xe04d('0xf0')](_0x49c639,0x16,_0xe04d('0xf4'));rpcDb[_0xe04d('0xf1')](_0x49c639,_0xe04d('0xf5'));break;default:ut[_0xe04d('0xf0')](_0x49c639,0xc,_0x1f8465['reason']);rpcDb['createAgentHistory'](_0x49c639,_0xe04d('0xf3'));}ut[_0xe04d('0x76')](_0x38bd21,_0xe04d('0xf6'));logger[_0xe04d('0x6a')]('[originated][decrement][callProgressDetectingAgent]',_0x49c639[_0xe04d('0xa9')],_0xe04d('0xb7'),_0x38bd21[_0xe04d('0x29')],_0xe04d('0x6d'),_0x38bd21[_0xe04d('0x49')]);delete this[_0xe04d('0x16')][_0x49c639[_0xe04d('0xa9')]];};Preview['prototype'][_0xe04d('0xf7')]=function(_0x147aa9,_0x284a56,_0x4a4251,_0x54d5ad,_0x5c2c28){var _0x59834e=this;return new BPromise(function(_0x2104d4,_0x280f4c){if(_[_0xe04d('0x69')](_0x284a56)||_[_0xe04d('0x69')](_0x284a56[_0xe04d('0xf8')])||_[_0xe04d('0x69')](_0x284a56[_0xe04d('0xf8')]['phone'])||_[_0xe04d('0x69')](_0x284a56[_0xe04d('0xf9')])){_0x280f4c(ut[_0xe04d('0x48')]('Contact\x20is\x20undefined',_0x54d5ad,_0x5c2c28));return;}var _0x5d6240=uuid['v4']();var _0x4a494d=_0x59834e[_0xe04d('0x13')][_0x284a56[_0xe04d('0x6b')][_0xe04d('0x29')]];var _0x5cb5a9=_0x4a4251?_0x59834e[_0xe04d('0x17')][_0x4a4251]['id']:undefined;_0x59834e[_0xe04d('0x16')][_0x5d6240]=new Action(_0x284a56,_0x4a494d,_0x5d6240,_0x4a4251,_0x5cb5a9);var _0x42b3d8=_0x59834e[_0xe04d('0x16')][_0x5d6240];_0x42b3d8[_0xe04d('0xbf')]=_0x54d5ad;_0x42b3d8[_0xe04d('0xa4')]=_0x5c2c28;_0x42b3d8[_0xe04d('0xfa')]=_0x4a4251;if(_[_0xe04d('0xfb')](_0x147aa9)){_0x59834e['execCall'](_0x42b3d8,_0x4a494d,_0x284a56,_0x4a4251)[_0xe04d('0x83')](function(_0x36dfa1){logger[_0xe04d('0x6a')](_0xe04d('0xfc'),_0xe04d('0xfd')+_0x42b3d8[_0xe04d('0x6c')]+_0xe04d('0xfe')+_0x42b3d8['idContact'],JSON[_0xe04d('0x53')](_0x36dfa1));ami[_0xe04d('0x28')](_0xe04d('0xff'),ut[_0xe04d('0x9b')](_0x42b3d8,'called',_0x59834e[_0xe04d('0x13')][_0x42b3d8['queue']]));_0x2104d4(ut[_0xe04d('0x48')](_0xe04d('0x100')));})[_0xe04d('0x74')](function(_0x3c700f){ut['logger'](_0xe04d('0x101'),_0x3c700f);_0x280f4c(ut[_0xe04d('0x48')](_0xe04d('0x102'),_0x54d5ad,_0x5c2c28));});}else{_0x4a494d[_0xe04d('0x103')]+=0x1;ut[_0xe04d('0x104')](_0x42b3d8);rpcDb[_0xe04d('0x105')](_0x42b3d8,_0xe04d('0x106'));delete _0x59834e[_0xe04d('0x16')][_0x5d6240];_0x280f4c(ut['message'](_0xe04d('0x107'),_0x54d5ad,_0x5c2c28));}});};Preview[_0xe04d('0xf')]['isTrunkReachable']=function(_0x32bc6e){return!_[_0xe04d('0x69')](_0x32bc6e)&&!_['isNil'](_0x32bc6e['name'])&&!_[_0xe04d('0x69')](_0x32bc6e[_0xe04d('0x50')])&&_0x32bc6e['active']&&!_[_0xe04d('0x69')](this[_0xe04d('0x15')][util[_0xe04d('0x54')](_0xe04d('0x108'),_0x32bc6e['name'])])&&!_['isNil'](this[_0xe04d('0x15')][util[_0xe04d('0x54')](_0xe04d('0x108'),_0x32bc6e[_0xe04d('0x29')])][_0xe04d('0x109')])&&(this[_0xe04d('0x15')][util[_0xe04d('0x54')]('SIP/%s',_0x32bc6e['name'])][_0xe04d('0x109')]===_0xe04d('0x10a')||this[_0xe04d('0x15')][util[_0xe04d('0x54')](_0xe04d('0x108'),_0x32bc6e[_0xe04d('0x29')])][_0xe04d('0x109')]===_0xe04d('0x10b'));};Preview[_0xe04d('0xf')][_0xe04d('0x10c')]=function(_0x38c58c,_0x2f835e){var _0x5e8c40=this;return new BPromise(function(_0x34da09,_0x311cf8){_0x5e8c40[_0xe04d('0x10d')](_0x38c58c,_0x2f835e)[_0xe04d('0x83')](function(_0x570a45){_0x34da09(_[_0xe04d('0x10e')](_0x570a45,[_0xe04d('0x48')]));})[_0xe04d('0x74')](function(_0x48a69d){if(_0x48a69d['unlock']){rpcDb['unlockContact'](_0x38c58c);}if(_0x48a69d[_0xe04d('0x50')]){rpcDb[_0xe04d('0x86')](_0x38c58c);}_0x311cf8(_[_0xe04d('0x10e')](_0x48a69d,['message']));});});};Preview[_0xe04d('0xf')][_0xe04d('0x10d')]=function(_0x40ec63,_0x4f88d0){var _0x309dcc=this;return new BPromise(function(_0x5b3123,_0x2969b1){var _0x2da37c,_0x28ce60;rpcDb[_0xe04d('0x10f')](_0x40ec63)[_0xe04d('0x83')](function(_0x89c842){if(!_['isNil'](_0x89c842[0x0])){_0x28ce60=_0x89c842[0x0]['recallme']?![]:!![];_0x2da37c=_0x89c842[0x0][_0xe04d('0x110')]?!![]:![];_0x2da37c=_0x4f88d0?!![]:_0x2da37c;}var _0x2680d7=_0x309dcc[_0xe04d('0x111')](_0x89c842);if(_0x2680d7[_0xe04d('0x112')]){rpcDb[_0xe04d('0x113')](_[_0xe04d('0x10e')](_0x89c842[0x0],[_0xe04d('0xf9'),_0xe04d('0x114')]))[_0xe04d('0x83')](function(_0x4b61fc){_0x309dcc[_0xe04d('0xf7')](_0x4b61fc,_0x89c842[0x0],_0x4f88d0,_0x28ce60,_0x2da37c)[_0xe04d('0x83')](function(_0x1cd95f){_0x5b3123(_0x1cd95f);})[_0xe04d('0x74')](function(_0x1c42ad){_0x2969b1(_0x1c42ad);});})[_0xe04d('0x74')](function(_0x538e33){ut[_0xe04d('0x5c')](_0xe04d('0x115'),_0x538e33);_0x2969b1(ut[_0xe04d('0x48')]('Call\x20unsuccessful',_0x28ce60,_0x2da37c));});}else{_0x2969b1(ut[_0xe04d('0x48')](_0x2680d7[_0xe04d('0x48')],_0x28ce60,_0x2da37c));}})['catch'](function(_0x33007d){ut[_0xe04d('0x5c')](_0xe04d('0x116'),_0x33007d);_0x2969b1(ut[_0xe04d('0x48')](_0xe04d('0x117'),![],!![]));});});};Preview['prototype'][_0xe04d('0x111')]=function(_0x5d958a){if(_[_0xe04d('0x69')](_0x5d958a)||_[_0xe04d('0xfb')](_0x5d958a)||!_[_0xe04d('0x69')](_0x5d958a[0x0]['Agent'])&&_[_0xe04d('0x69')](_0x5d958a[0x0][_0xe04d('0x81')]['name'])){ut['logger'](_0xe04d('0x118'),_0x5d958a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x286e88=this[_0xe04d('0x13')][_0x5d958a[0x0][_0xe04d('0x6b')]['name']];_0x286e88['message']=_0xe04d('0x94');if(_[_0xe04d('0x69')](_0x286e88)){ut[_0xe04d('0x5c')](_0xe04d('0x119'),_0x286e88);return{'isValid':![],'message':_0xe04d('0x11a')};}if(!this[_0xe04d('0x92')](_0x286e88['Trunk'])){ut[_0xe04d('0x5c')](_0xe04d('0x11b'),'campaign\x20Name:\x20'+_0x286e88[_0xe04d('0x29')]+_0xe04d('0x11c'));if(!this[_0xe04d('0x92')](_0x286e88[_0xe04d('0x93')])){ut[_0xe04d('0x5c')](_0xe04d('0x11b'),_0x286e88[_0xe04d('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xe04d('0x11d')};}}if(!ut[_0xe04d('0x11e')](_0x286e88[_0xe04d('0x33')])){ut[_0xe04d('0x5c')](_0xe04d('0x11f'),_0x286e88[_0xe04d('0x29')]+_0xe04d('0x120'));return{'isValid':![],'message':_0xe04d('0x121')+_0x286e88[_0xe04d('0x29')]+_0xe04d('0x120')};}return{'isValid':!![],'message':_0xe04d('0x122')};};Preview[_0xe04d('0xf')][_0xe04d('0x123')]=function(_0x908dd3,_0x4c5a73,_0x5b8dca,_0x568378){var _0x7eab6c=this;return new BPromise(function(_0x2770a5,_0x5556ce){var _0x482e81=_0x908dd3[_0xe04d('0xa9')];var _0x83c3d9=_0x7eab6c[_0xe04d('0x92')](_0x4c5a73[_0xe04d('0x4f')])?util[_0xe04d('0x54')](_0xe04d('0x124'),_0x4c5a73[_0xe04d('0x4f')][_0xe04d('0x29')],_[_0xe04d('0x69')](_0x4c5a73[_0xe04d('0x37')])?'':_0x4c5a73[_0xe04d('0x37')][_0xe04d('0x125')]()||'',_0x4c5a73[_0xe04d('0x126')]>0x0?_0x5b8dca[_0xe04d('0xf8')]['phone'][_0xe04d('0x127')](_0x4c5a73[_0xe04d('0x126')]):_0x5b8dca[_0xe04d('0xf8')]['phone']):util['format']('SIP/%s/%s%s',_['isNil'](_0x4c5a73[_0xe04d('0x93')])?_0x4c5a73[_0xe04d('0x4f')]['name']:_0x4c5a73[_0xe04d('0x93')][_0xe04d('0x29')],_[_0xe04d('0x69')](_0x4c5a73[_0xe04d('0x37')])?'':_0x4c5a73[_0xe04d('0x37')][_0xe04d('0x125')]()||'',_0x4c5a73[_0xe04d('0x126')]>0x0?_0x5b8dca[_0xe04d('0xf8')][_0xe04d('0x128')]['substring'](_0x4c5a73['dialCutDigit']):_0x5b8dca[_0xe04d('0xf8')]['phone']);var _0x50691e=_0x7eab6c[_0xe04d('0x92')](_0x4c5a73[_0xe04d('0x4f')])?ut[_0xe04d('0x129')](_0x4c5a73[_0xe04d('0x4f')][_0xe04d('0x51')],_0x4c5a73[_0xe04d('0x35')],_0x4c5a73[_0xe04d('0x12a')]>0x0?ut[_0xe04d('0x12b')](_0x4c5a73[_0xe04d('0x36')],_0x4c5a73[_0xe04d('0x12a')]):_0x4c5a73['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0xe04d('0x69')](_0x4c5a73[_0xe04d('0x93')])?_0x4c5a73[_0xe04d('0x4f')][_0xe04d('0x51')]:_0x4c5a73[_0xe04d('0x93')]['callerid'],_0x4c5a73['dialOriginateCallerIdName'],_0x4c5a73[_0xe04d('0x12a')]>0x0?ut[_0xe04d('0x12b')](_0x4c5a73[_0xe04d('0x36')],_0x4c5a73['dialRandomLastDigitCallerIdNumber']):_0x4c5a73[_0xe04d('0x36')]);if(_0x50691e){_0x908dd3[_0xe04d('0x12c')]=ut[_0xe04d('0x12d')](_0x50691e);_0x908dd3[_0xe04d('0x12e')]=ut[_0xe04d('0x12f')](_0x50691e);}var _0x6f68f5=ut[_0xe04d('0x130')](_0x4c5a73,_0x5b8dca,_0x83c3d9,_0x50691e,_0x482e81,_0x908dd3);_[_0xe04d('0x131')](_0x908dd3,ut['toLowerVariables'](_0x6f68f5));_0x908dd3['starttime']=moment()[_0xe04d('0x54')](_0xe04d('0xa7'));ami[_0xe04d('0x72')](ut[_0xe04d('0x132')](_0x908dd3,_0x4c5a73,_0x6f68f5,_0x908dd3[_0xe04d('0xa4')],_0x568378))[_0xe04d('0x83')](function(_0x40d8fc){_0x4c5a73[_0xe04d('0x49')]+=0x1;logger['info'](_0xe04d('0x133'),_0x482e81,_0xe04d('0xb7'),_0x4c5a73[_0xe04d('0x29')],'originated:\x20',_0x4c5a73[_0xe04d('0x49')]);_0x2770a5(_0x40d8fc);})[_0xe04d('0x74')](function(_0x3361ab){ut[_0xe04d('0xf0')](_0x908dd3,0xe,_0xe04d('0x134'));rpcDb['createAgentHistory'](_0x908dd3,_0xe04d('0x135'));_0x5556ce(_0x3361ab);});});};Preview[_0xe04d('0xf')]['syncNewExten']=function(_0x2b683e){if(this['actions'][_0x2b683e[_0xe04d('0xa5')]]){this[_0xe04d('0x16')][_0x2b683e[_0xe04d('0xa5')]][_0xe04d('0x73')]=_0x2b683e['channel'];}};Preview[_0xe04d('0xf')]['syncOriginateResponse']=function(_0x2133b4){var _0x2d3a9b=this;var _0x1bf7b6=this[_0xe04d('0x16')][_0x2133b4[_0xe04d('0x136')]];if(_0x1bf7b6){if(_0x1bf7b6[_0xe04d('0xfa')]&&this[_0xe04d('0x17')][_0x1bf7b6[_0xe04d('0xfa')]]){ut[_0xe04d('0x137')](_0x1bf7b6,this[_0xe04d('0x17')][_0x1bf7b6[_0xe04d('0xfa')]][_0xe04d('0x29')],this[_0xe04d('0x17')][_0x1bf7b6[_0xe04d('0xfa')]]['id']);}var _0x4d16c0=_[_0xe04d('0x138')](_0x1bf7b6);_0x4d16c0[_0xe04d('0xa8')]=moment()[_0xe04d('0x54')](_0xe04d('0xa7'));var _0xeb9533=_0x2d3a9b[_0xe04d('0x13')][_0x1bf7b6[_0xe04d('0x6c')]];if(ut['isFailure'](_0x2133b4[_0xe04d('0x139')])){if(_0x1bf7b6[_0xe04d('0xbf')]){rpcDb[_0xe04d('0x13a')](_0x1bf7b6[_0xe04d('0x13b')]);}if(_0x1bf7b6[_0xe04d('0xa4')]){rpcDb[_0xe04d('0x86')](_0x1bf7b6[_0xe04d('0x13b')]);}ami[_0xe04d('0x28')]('custom:agentringnoanswer',ut[_0xe04d('0x9b')](_0x1bf7b6,_0xe04d('0x13c'),this[_0xe04d('0x13')][_0x1bf7b6[_0xe04d('0x6c')]]));this[_0xe04d('0xec')](_0x4d16c0,_0xeb9533,_0x2133b4);}else{_0x1bf7b6[_0xe04d('0x13d')]=moment()['format'](_0xe04d('0xa7'));ut['logAgent'](_0x4d16c0,0x4,_0xe04d('0x13e'));rpcDb[_0xe04d('0xf1')](_0x4d16c0,_0xe04d('0x13f'));}}};Preview[_0xe04d('0xf')][_0xe04d('0x1d')]=function(_0x4d0c00){var _0xe2de8f=this;var _0x4c6236=this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]];var _0x5b6329;if(_0x4c6236){_0x5b6329=this['campaignsPreview'][_0x4c6236[_0xe04d('0x6c')]];logger['info']('[syncHangup][talking]',_0x4d0c00[_0xe04d('0xa5')],'\x20Queue',_0x5b6329[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5b6329[_0xe04d('0x59')]);}if(this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]]&&_0x4d0c00[_0xe04d('0xa5')]!==_0x4d0c00[_0xe04d('0xa9')]){if(_0x4d0c00[_0xe04d('0x140')]==='16'&&this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]][_0xe04d('0x6f')]){this[_0xe04d('0x95')](_0x4d0c00,_0x4d0c00['linkedid'],_0x4d0c00['cause']);}else if(this[_0xe04d('0x16')][_0x4d0c00[_0xe04d('0xa5')]][_0xe04d('0x6f')]){logger[_0xe04d('0x6a')](_0xe04d('0x141'),_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00[_0xe04d('0x140')],_0xe04d('0xb7'),_0x5b6329[_0xe04d('0x29')],'pTalking:\x20',_0x5b6329[_0xe04d('0x59')]);this['callProgressDetectingCustomer'](_0x4d0c00,_0x4d0c00['linkedid'],_0x4d0c00[_0xe04d('0x140')]);}}else if(_0x4c6236&&_[_0xe04d('0x69')](_0x4c6236['statedesc'])&&_0x5b6329[_0xe04d('0x142')]&&_0x4d0c00['linkedid']===_0x4d0c00['uniqueid']&&_[_0xe04d('0x69')](_0x4d0c00[_0xe04d('0xef')])&&_0x4d0c00['cause']==='16'&&_0x4d0c00[_0xe04d('0x143')]==='6'&&_[_0xe04d('0xed')](_0x4c6236[_0xe04d('0x144')])){if(_0x4c6236[_0xe04d('0xbf')]){rpcDb[_0xe04d('0x13a')](_0x4c6236[_0xe04d('0x13b')]);}if(_0x4c6236[_0xe04d('0xa4')]){rpcDb['disableContact'](_0x4c6236[_0xe04d('0x13b')]);}_0x4d0c00[_0xe04d('0xef')]='22';this[_0xe04d('0xec')](_0x4c6236,_0x5b6329,_0x4d0c00);}else if(_0x4c6236&&_0x4c6236[_0xe04d('0x144')]){if(_0x4d0c00[_0xe04d('0x140')]==='16'&&this['actions'][_0x4d0c00[_0xe04d('0xa5')]]['dialAnswer']){logger[_0xe04d('0x6a')](_0xe04d('0x145'),_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00[_0xe04d('0x140')],_0xe04d('0xb7'),_0x5b6329[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5b6329['pTalking']);this[_0xe04d('0x95')](_0x4d0c00,_0x4d0c00['linkedid'],_0x4d0c00[_0xe04d('0x140')]);}else if(this['actions'][_0x4d0c00[_0xe04d('0xa5')]][_0xe04d('0x6f')]){logger['info'](_0xe04d('0x141'),_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00[_0xe04d('0x140')],'\x20Queue',_0x5b6329[_0xe04d('0x29')],_0xe04d('0x6e'),_0x5b6329[_0xe04d('0x59')]);this[_0xe04d('0x95')](_0x4d0c00,_0x4d0c00[_0xe04d('0xa5')],_0x4d0c00['cause']);}}};Preview[_0xe04d('0xf')][_0xe04d('0x1f')]=function(_0x59d4f8){if(this[_0xe04d('0x16')][_0x59d4f8[_0xe04d('0xeb')]]&&_0x59d4f8[_0xe04d('0xeb')]!==_0x59d4f8[_0xe04d('0x146')]){this[_0xe04d('0x95')](_0x59d4f8,_0x59d4f8[_0xe04d('0xeb')],_0x59d4f8[_0xe04d('0xdf')]);}};Preview[_0xe04d('0xf')]['syncHangupRequest']=function(_0x17fc78){if(this[_0xe04d('0x16')][_0x17fc78[_0xe04d('0xa5')]]&&_0x17fc78[_0xe04d('0xa5')]!==_0x17fc78[_0xe04d('0xa9')]&&!this['actions'][_0x17fc78[_0xe04d('0xa5')]]['dialAnswer']){if(_0x17fc78[_0xe04d('0x140')]==='1'){this['callProgressDetectingCustomer'](_0x17fc78,_0x17fc78[_0xe04d('0xa5')],_0x17fc78[_0xe04d('0x140')]);}}};Preview[_0xe04d('0xf')]['addVariable']=function(_0x109a43,_0x479c33,_0x1895de){if(this[_0xe04d('0x16')][_0x109a43]){if(_['isNil'](this[_0xe04d('0x16')][_0x109a43][_0xe04d('0x147')])){this['actions'][_0x109a43][_0xe04d('0x147')]={};}this[_0xe04d('0x16')][_0x109a43][_0xe04d('0x147')][_0x479c33]=_0x1895de;}};Preview[_0xe04d('0xf')][_0xe04d('0x23')]=function(_0x356968){try{if(!_[_0xe04d('0x69')](_0x356968)){if(ut[_0xe04d('0x148')](_[_0xe04d('0x149')](_0x356968[_0xe04d('0x14a')])[0x0])){this[_0xe04d('0x14b')](_0x356968[_0xe04d('0xa9')],_[_0xe04d('0x149')](_0x356968[_0xe04d('0x14a')])[0x0],_0x356968[_0xe04d('0x14c')]);}}}catch(_0x36d1d4){logger[_0xe04d('0x14d')](_0xe04d('0x14e'),util['inspect'](_0x36d1d4,{'showHidden':![],'depth':null}));}};Preview[_0xe04d('0xf')][_0xe04d('0x25')]=function(_0x1ec936){if(_0x1ec936){if(this[_0xe04d('0x16')][_0x1ec936[_0xe04d('0x14f')]]){this['actions'][_0x1ec936[_0xe04d('0x14f')]][_0xe04d('0x144')]=!![];}}};Preview[_0xe04d('0xf')]['syncBlindTransfer']=function(_0x1b40a9){if(_0x1b40a9){if(this[_0xe04d('0x16')][_0x1b40a9[_0xe04d('0x150')]]){this[_0xe04d('0x16')][_0x1b40a9[_0xe04d('0x150')]][_0xe04d('0x144')]=!![];}}};module[_0xe04d('0x151')]=Preview; \ No newline at end of file +var _0x56a4=['sumBillable','sumDuration','talking','total','unmanaged','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','name','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','Queue','actions','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','catch','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','cloneAction','createCustomerFinal','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','answered','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','originated:\x20','Contact','phone','lookAgent','[Preview][execCall][success]','Queue:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','execRun','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','substring','dialCutDigit','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','isFailure','response','custom:agentringnoanswer','cause','callProgressDetectingCustomer','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','variables','filterKey','variable','addVariable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','type','outbound','strategy','pTalking'];(function(_0x2cbee6,_0x493470){var _0x14ba4f=function(_0x33621e){while(--_0x33621e){_0x2cbee6['push'](_0x2cbee6['shift']());}};_0x14ba4f(++_0x493470);}(_0x56a4,0x11b));var _0x456a=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0x56a4[_0x1c5142];return _0x1268cb;};'use strict';var util=require(_0x456a('0x0'));var _=require(_0x456a('0x1'));var BPromise=require('bluebird');var uuid=require(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var loggerAction=require(_0x456a('0x5'))(_0x456a('0x7'));var ami=require('../ami');var rpcDb=require(_0x456a('0x8'));var Action=require('./action');var ut=require('./util/util');config[_0x456a('0x9')]=_[_0x456a('0xa')](config[_0x456a('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x456a('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x456a('0xc')][_0x456a('0xd')]=function(_0x3bb712){this[_0x456a('0xe')]=this[_0x456a('0xe')]?this[_0x456a('0xe')][_0x456a('0xf')](_0x3bb712):_0x3bb712();};function Preview(_0xe60506){this[_0x456a('0x10')]=new Sequence();this[_0x456a('0x11')]=_0xe60506[_0x456a('0x12')];this['trunks']=_0xe60506[_0x456a('0x13')];this['actions']={};this['agents']=_0xe60506[_0x456a('0x14')];this[_0x456a('0x15')]=0x0;ami['on'](_0x456a('0x16'),this[_0x456a('0x17')]['bind'](this));ami['on'](_0x456a('0x18'),this[_0x456a('0x19')][_0x456a('0x1a')](this));ami['on'](_0x456a('0x1b'),this[_0x456a('0x1c')][_0x456a('0x1a')](this));ami['on']('dialend',this[_0x456a('0x1d')][_0x456a('0x1a')](this));ami['on'](_0x456a('0x1e'),this[_0x456a('0x1f')]['bind'](this));ami['on'](_0x456a('0x20'),this[_0x456a('0x21')][_0x456a('0x1a')](this));ami['on']('attendedtransfer',this[_0x456a('0x22')]['bind'](this));ami['on']('blindtransfer',this[_0x456a('0x23')]['bind'](this));this[_0x456a('0x24')](this['campaignsPreview']);}function emit(_0x962b6d,_0x17d0ae,_0x55054e){io['to'](_0x962b6d)['emit'](_0x17d0ae,_0x55054e);}function emitCampaignPreview(_0x55fe9e){if(_0x55fe9e[_0x456a('0x25')]===_0x456a('0x26')){var _0xb8d35c={'id':_0x55fe9e['id'],'name':_0x55fe9e['name'],'strategy':_0x55fe9e[_0x456a('0x27')],'answered':_0x55fe9e['answered'],'available':_0x55fe9e['available'],'loggedIn':_0x55fe9e['loggedIn'],'pTalking':_0x55fe9e[_0x456a('0x28')],'sumBillable':_0x55fe9e[_0x456a('0x29')],'sumDuration':_0x55fe9e[_0x456a('0x2a')],'sumHoldTime':_0x55fe9e['sumHoldTime']||0x0,'talking':_0x55fe9e[_0x456a('0x2b')],'total':_0x55fe9e[_0x456a('0x2c')],'type':_0x55fe9e['type'],'unmanaged':_0x55fe9e[_0x456a('0x2d')],'abandoned':_0x55fe9e['abandoned'],'waiting':_0x55fe9e['waiting'],'loggedInDb':_0x55fe9e[_0x456a('0x2e')],'dialActive':_0x55fe9e['dialActive'],'dialMethod':_0x55fe9e[_0x456a('0x2f')],'dialOriginateCallerIdName':_0x55fe9e['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x55fe9e[_0x456a('0x30')],'dialOriginateTimeout':_0x55fe9e[_0x456a('0x31')],'dialPrefix':_0x55fe9e[_0x456a('0x32')],'outboundAnswerAgiCallsDay':_0x55fe9e[_0x456a('0x33')],'outboundAnswerCallsDay':_0x55fe9e[_0x456a('0x34')],'outboundBlacklistCallsDay':_0x55fe9e[_0x456a('0x35')],'outboundBusyCallsDay':_0x55fe9e[_0x456a('0x36')],'outboundCongestionCallsDay':_0x55fe9e[_0x456a('0x37')],'outboundDropCallsDayACS':_0x55fe9e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x55fe9e['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x55fe9e['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x55fe9e[_0x456a('0x38')],'outboundNoSuchCallsDay':_0x55fe9e[_0x456a('0x39')],'outboundOriginateFailureCallsDay':_0x55fe9e['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x55fe9e[_0x456a('0x3a')],'outboundRejectCallsDay':_0x55fe9e[_0x456a('0x3b')],'outboundUnknownCallsDay':_0x55fe9e[_0x456a('0x3c')],'outboundAbandonedCallsDay':_0x55fe9e[_0x456a('0x3d')],'predictiveIntervalAnsweredCalls':_0x55fe9e[_0x456a('0x3e')],'predictiveIntervalAvgHoldtime':_0x55fe9e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x55fe9e[_0x456a('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x55fe9e[_0x456a('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x55fe9e[_0x456a('0x41')],'predictiveIntervalErlangCalls':_0x55fe9e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x55fe9e[_0x456a('0x42')],'predictiveIntervalHitRate':_0x55fe9e[_0x456a('0x43')],'predictiveIntervalMultiplicativeFactor':_0x55fe9e['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x55fe9e[_0x456a('0x44')],'predictiveIntervalAvailable':_0x55fe9e[_0x456a('0x45')],'predictiveIntervalTotalCalls':_0x55fe9e[_0x456a('0x46')],'message':_0x55fe9e[_0x456a('0x47')],'originated':_0x55fe9e[_0x456a('0x48')],'erlangCalls':_0x55fe9e['erlangCalls'],'erlangCallToSecond':_0x55fe9e[_0x456a('0x49')],'erlangAbandonmentRate':_0x55fe9e[_0x456a('0x4a')],'erlangBusyFactor':_0x55fe9e[_0x456a('0x4b')],'startPredictive':_0x55fe9e['startPredictive'],'startProgressive':_0x55fe9e['startProgressive']};if(_0x55fe9e[_0x456a('0x4c')]){_0xb8d35c['Trunk']={'id':_0x55fe9e['Trunk']['id'],'name':_0x55fe9e['Trunk'][_0x456a('0x4d')],'active':_0x55fe9e[_0x456a('0x4c')][_0x456a('0x4e')],'callerid':_0x55fe9e[_0x456a('0x4c')]['callerid']};}if(_0x55fe9e[_0x456a('0x4f')]){_0xb8d35c[_0x456a('0x4f')]={'id':_0x55fe9e['Interval']['id'],'name':_0x55fe9e[_0x456a('0x4f')][_0x456a('0x4d')]};}var _0xbf9c10=md5(JSON[_0x456a('0x50')](_0xb8d35c));if(_0x55fe9e[_0x456a('0x51')]!==_0xbf9c10){_0x55fe9e['md5']=_0xbf9c10;emit(util[_0x456a('0x52')](_0x456a('0x53'),_0xb8d35c['name']),_0x456a('0x54'),_0xb8d35c);}}}function emitVoiceQueueChannelRemove(_0x1d4420){logger[_0x456a('0x55')](_0x456a('0x56'),JSON[_0x456a('0x50')](_0x1d4420));emit(util[_0x456a('0x52')](_0x456a('0x53'),_0x1d4420[_0x456a('0x4d')]),'voice_queue_channel:remove',_0x1d4420);io[_0x456a('0x57')](_0x456a('0x58'),_0x1d4420);}function notSendMessagesQueue(_0x172bbe){if(_0x172bbe[_0x456a('0x59')]){if(_0x172bbe[_0x456a('0x48')]===0x0&&_0x172bbe['pTalking']===0x0){_0x172bbe[_0x456a('0x59')]=![];_0x172bbe['available']=0x0;_0x172bbe[_0x456a('0x5a')]=0x0;_0x172bbe[_0x456a('0x47')]='NOT_ACTIVE';ut[_0x456a('0x5b')](_0x456a('0x5c'),_0x172bbe[_0x456a('0x4d')]+'\x20is\x20not\x20active');}else{_0x172bbe[_0x456a('0x47')]='IS_DISACTIVED';ut['logger'](_0x456a('0x5c'),_0x172bbe['name']+_0x456a('0x5d'));}emitCampaignPreview(_0x172bbe);}}Preview[_0x456a('0xc')]['loopCampaigns']=function(){var _0x442da9=this;setInterval(function(){_0x442da9[_0x456a('0x5e')]();},0x7cf);};Preview[_0x456a('0xc')][_0x456a('0x5e')]=function(){var _0x355ae8=this[_0x456a('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0xcba613 in _0x355ae8){if(_0x355ae8['hasOwnProperty'](_0xcba613)&&(_0x355ae8[_0xcba613][_0x456a('0x2f')]===_0x456a('0x6')||_0x355ae8[_0xcba613][_0x456a('0x2f')]===_0x456a('0x5f'))&&_0x355ae8[_0xcba613][_0x456a('0x25')]==='outbound'){if(this[_0x456a('0x15')]>0x7){this[_0x456a('0x15')]=0x0;this[_0x456a('0x60')]();}}if(_0x355ae8[_0x456a('0x61')](_0xcba613)&&_0x355ae8[_0xcba613][_0x456a('0x2f')]===_0x456a('0x6')&&_0x355ae8[_0xcba613][_0x456a('0x25')]==='outbound'){if(_0x355ae8[_0xcba613][_0x456a('0x62')]){this[_0x456a('0x63')](_0x355ae8[_0xcba613]);if(_0x355ae8[_0xcba613][_0x456a('0x64')])this[_0x456a('0x65')](_0x355ae8[_0xcba613]);}else{notSendMessagesQueue(_0x355ae8[_0xcba613]);}}}};Preview[_0x456a('0xc')]['clearZombieChannel']=function(_0x2bbe80){var _0x8b32cc=this;this['sequence']['enqueue'](function(){if(!_[_0x456a('0x66')](_0x8b32cc['actions'][_0x2bbe80])){loggerAction[_0x456a('0x55')]('[clearZombieChannels][talking]',_0x2bbe80,_0x456a('0x67'),_0x8b32cc[_0x456a('0x68')][_0x2bbe80]['queue'],'originated:\x20',JSON['stringify'](_0x8b32cc[_0x456a('0x11')][_0x8b32cc[_0x456a('0x68')][_0x2bbe80]['queue']]['originated']),_0x456a('0x69'),JSON['stringify'](_0x8b32cc[_0x456a('0x11')][_0x8b32cc[_0x456a('0x68')][_0x2bbe80][_0x456a('0x6a')]]['pTalking']),JSON['stringify'](_0x8b32cc['actions'][_0x2bbe80][_0x456a('0x6b')]),JSON[_0x456a('0x50')](_[_0x456a('0x6c')](_0x8b32cc['actions'][_0x2bbe80],[_0x456a('0x6d'),_0x456a('0x6e'),_0x456a('0x6f'),_0x456a('0x70')])));return ami[_0x456a('0x71')]({'action':_0x456a('0x72'),'channel':_0x8b32cc[_0x456a('0x68')][_0x2bbe80][_0x456a('0x73')]})['catch'](function(_0x3f539e){if(_0x3f539e[_0x456a('0x47')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x8b32cc[_0x456a('0x68')][_0x2bbe80]){ut[_0x456a('0x74')](_0x8b32cc['campaignsPreview'][_0x8b32cc[_0x456a('0x68')][_0x2bbe80][_0x456a('0x6a')]],'[clearZombieChannel]');if(_0x8b32cc[_0x456a('0x68')][_0x2bbe80][_0x456a('0x6b')]===!![]){ut[_0x456a('0x75')](_0x8b32cc[_0x456a('0x11')][_0x8b32cc['actions'][_0x2bbe80]['queue']],_0x456a('0x76'));ut['loggerError'](_0x456a('0x77')+_0x2bbe80,_0x8b32cc[_0x456a('0x68')][_0x2bbe80]['queue']);}ut['loggerError'](_0x456a('0x78')+_0x2bbe80,_0x8b32cc[_0x456a('0x68')][_0x2bbe80]['queue']);delete _0x8b32cc[_0x456a('0x68')][_0x2bbe80];}},0x2328);}});}});};Preview[_0x456a('0xc')][_0x456a('0x60')]=function(){var _0x3e7e2c=this;loggerAction[_0x456a('0x55')](_0x456a('0x79'),_[_0x456a('0x7a')](this['actions']));for(var _0x3ff564 in this[_0x456a('0x68')]){if(_0x3e7e2c['actions']['hasOwnProperty'](_0x3ff564)){_0x3e7e2c['clearZombieChannel'](_0x3ff564);}}};Preview[_0x456a('0xc')][_0x456a('0x65')]=function(_0x3d1090){var _0x5522c0=this;rpcDb['getContactRecallMe'](_0x3d1090['id'],ut[_0x456a('0x7b')](this[_0x456a('0x14')]))['then'](function(_0x560d02){if(!_[_0x456a('0x66')](_0x560d02)){for(var _0x38215e=0x0;_0x38215e<_0x560d02['length'];_0x38215e+=0x1){if(ut[_0x456a('0x7c')](_0x560d02[_0x38215e][_0x456a('0x7d')])<_0x3d1090[_0x456a('0x7e')]*0x3c){if(_0x560d02[_0x38215e]['Agent']&&!_0x560d02[_0x38215e][_0x456a('0x7f')][_0x456a('0x80')]){_0x5522c0[_0x456a('0x81')](_0x560d02[_0x38215e]['id'])[_0x456a('0x82')](ut[_0x456a('0x83')](_0x456a('0x84')))[_0x456a('0x85')](ut[_0x456a('0x83')](_0x456a('0x84')));}else{rpcDb[_0x456a('0x86')](_0x560d02[_0x38215e]['id']);}}else{var _0x56b933=new Action(_0x560d02[_0x38215e],_0x3d1090);_0x56b933[_0x456a('0x87')]=moment()[_0x456a('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d1090[_0x456a('0x3a')]+=0x1;ut[_0x456a('0x88')](_0x56b933,0x17,_0x456a('0x89'));if(_0x3d1090[_0x456a('0x8a')]){rpcDb['rescheduleContactInQueue'](ut[_0x456a('0x8b')](_0x560d02[_0x38215e]));rpcDb[_0x456a('0x8c')](_0x56b933,_0x456a('0x8d'));}else{ut['logCustomer'](_0x56b933,0x16,_0x456a('0x8e'));rpcDb[_0x456a('0x8c')](_0x56b933,_0x456a('0x8f'));rpcDb['createCustomerFinal'](_0x56b933,_0x456a('0x8f'));}}}}})[_0x456a('0x85')](ut['logger2'](_0x456a('0x90')));};Preview[_0x456a('0xc')]['setMessage']=function(_0x3938ab){_0x3938ab[_0x456a('0x59')]=!![];if(ut[_0x456a('0x91')](_0x3938ab['loggedIn'])){_0x3938ab[_0x456a('0x47')]=_0x456a('0x92');}else if(!ut[_0x456a('0x93')](_0x3938ab[_0x456a('0x62')])){_0x3938ab[_0x456a('0x47')]=_0x456a('0x94');}else if(!this['isTrunkReachable'](_0x3938ab[_0x456a('0x4c')])){if(!this[_0x456a('0x95')](_0x3938ab[_0x456a('0x96')])){_0x3938ab[_0x456a('0x47')]=_0x456a('0x97');}else{_0x3938ab[_0x456a('0x47')]=_0x456a('0x98');}}else{_0x3938ab[_0x456a('0x47')]='ACTIVE';}emitCampaignPreview(_0x3938ab);};Preview[_0x456a('0xc')]['callProgressDetectingCustomer']=function(_0x14e6ff,_0xbfae2a,_0x5293d3){var _0x1d8b2a=this;var _0x26b512=this[_0x456a('0x68')][_0xbfae2a];var _0x4f15bd=this[_0x456a('0x11')][_0x26b512[_0x456a('0x6a')]];var _0x3be164;if(_0x4f15bd){switch(_0x5293d3){case'1':_0x4f15bd['outboundNoSuchCallsDay']+=0x1;_0x26b512[_0x456a('0x99')]+=0x1;_0x26b512[_0x456a('0x9a')]=ut[_0x456a('0x9b')](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0x0,_0x456a('0x9c'));ami[_0x456a('0x57')](_0x456a('0x9d'),ut[_0x456a('0x9e')](_0x26b512,'nosuchnumber'));rpcDb[_0x456a('0x8c')](_0x26b512,_0x456a('0x9f'));if(ut[_0x456a('0x9b')](_0x26b512)>=_0x4f15bd['dialGlobalMaxRetry']){_0x3be164=ut[_0x456a('0xa0')](_0x26b512,0xf,'Global');rpcDb[_0x456a('0xa1')](_0x3be164,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x26b512[_0x456a('0x99')]>=_0x4f15bd[_0x456a('0xa2')]){rpcDb[_0x456a('0xa1')](_0x26b512,_0x456a('0xa3'));}else{rpcDb[_0x456a('0xa4')](ut[_0x456a('0xa5')](_0x26b512,_0x456a('0x99'),_0x4f15bd[_0x456a('0xa6')]),_0x26b512['unlockAgent'],_0x26b512[_0x456a('0xa7')]);}}delete this[_0x456a('0x68')][_0x14e6ff[_0x456a('0xa8')]];break;case _0x456a('0xa9'):var _0x235275=moment()[_0x456a('0x52')](_0x456a('0xaa'));_0x26b512[_0x456a('0xab')]=_0x235275;_0x26b512[_0x456a('0xac')]=_0x235275;_0x26b512[_0x456a('0x6b')]=!![];_0x4f15bd[_0x456a('0x28')]+=0x1;logger[_0x456a('0x55')]('[syncHangup][talking][increment]',_0x26b512[_0x456a('0xad')],_0x456a('0xae'),_0x4f15bd[_0x456a('0x4d')],_0x456a('0x69'),_0x4f15bd[_0x456a('0x28')]);ami[_0x456a('0x57')](_0x456a('0xaf'),ut[_0x456a('0x9e')](_0x26b512,'connect',this[_0x456a('0x11')][_0x26b512[_0x456a('0x6a')]]));if(_0x4f15bd[_0x456a('0xb0')]){ami[_0x456a('0x57')](_0x456a('0xb1'),ut[_0x456a('0xb2')](_0x26b512));}break;case'16':ami[_0x456a('0x57')](_0x456a('0xb3'),ut[_0x456a('0x9e')](_0x26b512,'complete',this[_0x456a('0x11')][_0x26b512['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x26b512,'complete'));_0x4f15bd[_0x456a('0x34')]+=0x1;_0x4f15bd['total']+=0x1;_0x4f15bd[_0x456a('0xb4')]+=0x1;ut[_0x456a('0x75')](_0x4f15bd,'[16]');_0x26b512[_0x456a('0x9a')]=ut['totalGlobal'](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0x4,_0x456a('0xb5'));rpcDb[_0x456a('0x8c')](_0x26b512,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x456a('0xa1')](_0x26b512,_0x456a('0xb6'));rpcDb[_0x456a('0xb7')](_0x26b512);_0x4f15bd[_0x456a('0x2a')]+=_0x26b512[_0x456a('0xb8')];_0x4f15bd[_0x456a('0x29')]+=_0x26b512[_0x456a('0xb8')];logger[_0x456a('0x55')](_0x456a('0xb9'),_0x26b512[_0x456a('0xad')],_0x456a('0xae'),_0x4f15bd[_0x456a('0x4d')],'pTalking:\x20',_0x4f15bd['pTalking']);delete this[_0x456a('0x68')][_0x14e6ff[_0x456a('0xa8')]];break;case _0x456a('0xba'):_0x4f15bd['outboundBusyCallsDay']+=0x1;_0x26b512[_0x456a('0xbb')]+=0x1;_0x26b512['countglobal']=ut['totalGlobal'](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0x5,_0x456a('0xbc'));ami[_0x456a('0x57')]('custom:agentbusy',ut['buildObj'](_0x26b512,_0x456a('0xbd')));rpcDb[_0x456a('0x8c')](_0x26b512,_0x456a('0xbe'));if(ut[_0x456a('0x9b')](_0x26b512)>=_0x4f15bd[_0x456a('0xbf')]){_0x3be164=ut['cloneAction'](_0x26b512,0xf,'Global');rpcDb[_0x456a('0xa1')](_0x3be164,_0x456a('0xc0'));}else{if(_0x26b512['countbusyretry']>=_0x4f15bd[_0x456a('0xc1')]){rpcDb[_0x456a('0xa1')](_0x26b512,_0x456a('0xbe'));}else{rpcDb['rescheduleContact'](ut[_0x456a('0xa5')](_0x26b512,'countbusyretry',_0x4f15bd[_0x456a('0xc2')]),_0x26b512[_0x456a('0xc3')],_0x26b512[_0x456a('0xa7')]);}}break;case _0x456a('0xc4'):_0x4f15bd[_0x456a('0x38')]+=0x1;_0x26b512[_0x456a('0xc5')]+=0x1;_0x26b512['countglobal']=ut[_0x456a('0x9b')](_0x26b512);ut['logCustomer'](_0x26b512,0x3,_0x456a('0xc6'));ami[_0x456a('0x57')](_0x456a('0xc7'),ut[_0x456a('0x9e')](_0x26b512,'noanswer'));rpcDb['createCustomerHistory'](_0x26b512,_0x456a('0xc8'));if(ut[_0x456a('0x9b')](_0x26b512)>=_0x4f15bd[_0x456a('0xbf')]){_0x3be164=ut[_0x456a('0xa0')](_0x26b512,0xf,_0x456a('0xc9'));rpcDb[_0x456a('0xa1')](_0x3be164,_0x456a('0xca'));}else{if(_0x26b512[_0x456a('0xc5')]>=_0x4f15bd['dialNoAnswerMaxRetry']){rpcDb[_0x456a('0xa1')](_0x26b512,_0x456a('0xc8'));}else{rpcDb[_0x456a('0xa4')](ut[_0x456a('0xa5')](_0x26b512,_0x456a('0xc5'),_0x4f15bd[_0x456a('0xcb')]),_0x26b512[_0x456a('0xc3')],_0x26b512['activeContact']);}}break;case _0x456a('0xcc'):_0x4f15bd[_0x456a('0x37')]+=0x1;_0x26b512[_0x456a('0xcd')]+=0x1;_0x26b512[_0x456a('0x9a')]=ut[_0x456a('0x9b')](_0x26b512);ut['logCustomer'](_0x26b512,0x8,'Congestion');ami[_0x456a('0x57')](_0x456a('0xce'),ut[_0x456a('0x9e')](_0x26b512,_0x456a('0xcf')));rpcDb['createCustomerHistory'](_0x26b512,_0x456a('0xd0'));if(ut[_0x456a('0x9b')](_0x26b512)>=_0x4f15bd['dialGlobalMaxRetry']){_0x3be164=ut['cloneAction'](_0x26b512,0xf,_0x456a('0xc9'));rpcDb[_0x456a('0xa1')](_0x3be164,_0x456a('0xd1'));}else{if(_0x26b512[_0x456a('0xcd')]>=_0x4f15bd['dialCongestionMaxRetry']){rpcDb[_0x456a('0xa1')](_0x26b512,_0x456a('0xd0'));}else{rpcDb[_0x456a('0xa4')](ut[_0x456a('0xa5')](_0x26b512,'countcongestionretry',_0x4f15bd[_0x456a('0xc2')]),_0x26b512[_0x456a('0xc3')],_0x26b512[_0x456a('0xa7')]);}}break;case _0x456a('0xd2'):_0x4f15bd['outboundRejectCallsDay']+=0x1;_0x26b512[_0x456a('0xd3')]+=0x1;_0x26b512[_0x456a('0x9a')]=ut[_0x456a('0x9b')](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0x14,_0x456a('0xd4'));ami['emit'](_0x456a('0xd5'),ut['buildObj'](_0x26b512,_0x456a('0xd6')));rpcDb[_0x456a('0x8c')](_0x26b512,_0x456a('0xd7'));if(ut['totalGlobal'](_0x26b512)>=_0x4f15bd[_0x456a('0xbf')]){_0x3be164=ut[_0x456a('0xa0')](_0x26b512,0x14,'AgentReject');rpcDb[_0x456a('0xa1')](_0x3be164,_0x456a('0xd8'));}else{if(_0x26b512['countagentrejectretry']>=_0x4f15bd[_0x456a('0xd9')]){rpcDb['createCustomerFinal'](_0x26b512,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x456a('0xa5')](_0x26b512,_0x456a('0xd3'),_0x4f15bd[_0x456a('0xda')]),_0x26b512['unlockAgent'],_0x26b512[_0x456a('0xa7')]);}}break;case'ABANDONED':_0x4f15bd[_0x456a('0x3d')]+=0x1;_0x26b512[_0x456a('0xdb')]+=0x1;_0x26b512[_0x456a('0x9a')]=ut['totalGlobal'](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0xb,_0x456a('0xdc'));rpcDb[_0x456a('0x8c')](_0x26b512,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x456a('0x9b')](_0x26b512)>=_0x4f15bd[_0x456a('0xbf')]){_0x3be164=ut[_0x456a('0xa0')](_0x26b512,0xf,_0x456a('0xc9'));rpcDb[_0x456a('0xa1')](_0x3be164,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x26b512[_0x456a('0xdd')]>=_0x4f15bd[_0x456a('0xde')]){rpcDb['createCustomerFinal'](_0x26b512,_0x456a('0xdf'));}else{rpcDb[_0x456a('0xa4')](ut[_0x456a('0xa5')](_0x26b512,_0x456a('0xdb'),_0x4f15bd[_0x456a('0xe0')]),_0x26b512[_0x456a('0xc3')],_0x26b512[_0x456a('0xa7')]);}}break;case'18':_0x4f15bd[_0x456a('0x3c')]+=0x1;_0x26b512[_0x456a('0xe1')]+=0x1;_0x26b512['countglobal']=ut[_0x456a('0x9b')](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0x12,_0x14e6ff[_0x456a('0xe2')]||_0x14e6ff[_0x456a('0xe3')]);ami[_0x456a('0x57')](_0x456a('0xe4'),ut[_0x456a('0x9e')](_0x26b512,_0x456a('0xe5')));rpcDb[_0x456a('0x8c')](_0x26b512,_0x456a('0xe6'));if(ut[_0x456a('0x9b')](_0x26b512)>=_0x4f15bd[_0x456a('0xbf')]){_0x3be164=ut[_0x456a('0xa0')](_0x26b512,0xf,_0x456a('0xc9'));rpcDb[_0x456a('0xa1')](_0x3be164,_0x456a('0xe6'));}else{rpcDb['createCustomerFinal'](_0x26b512,_0x456a('0xe6'));}delete this[_0x456a('0x68')][_0x14e6ff[_0x456a('0xa8')]];break;case'19':_0x4f15bd['outboundUnknownCallsDay']+=0x1;_0x26b512[_0x456a('0x9a')]=ut[_0x456a('0x9b')](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0x13,_0x14e6ff[_0x456a('0xe2')]||_0x14e6ff[_0x456a('0xe3')]);ami[_0x456a('0x57')]('custom:amd',ut[_0x456a('0x9e')](_0x26b512,_0x456a('0xe5')));rpcDb[_0x456a('0x8c')](_0x26b512,_0x456a('0xe7'));if(ut[_0x456a('0x9b')](_0x26b512)>=_0x4f15bd['dialGlobalMaxRetry']){_0x3be164=ut[_0x456a('0xa0')](_0x26b512,0xf,_0x456a('0xc9'));rpcDb[_0x456a('0xa1')](_0x3be164,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x26b512,_0x456a('0xe7'));}delete this[_0x456a('0x68')][_0x14e6ff[_0x456a('0xa8')]];break;default:if(_0x26b512[_0x456a('0x6b')]){ut[_0x456a('0x75')](_0x4f15bd,_0x456a('0xe8'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4f15bd[_0x456a('0x4d')],_0x14e6ff);}_0x4f15bd['outboundUnknownCallsDay']+=0x1;_0x26b512[_0x456a('0x9a')]=ut[_0x456a('0x9b')](_0x26b512);ut[_0x456a('0x88')](_0x26b512,0xc,_0x14e6ff['cause-txt']||_0x14e6ff[_0x456a('0xe3')]);rpcDb[_0x456a('0x8c')](_0x26b512,_0x456a('0xe9'));if(ut['totalGlobal'](_0x26b512)>=_0x4f15bd[_0x456a('0xbf')]){_0x3be164=ut['cloneAction'](_0x26b512,0xf,_0x456a('0xc9'));rpcDb[_0x456a('0xa1')](_0x3be164,_0x456a('0xea'));}else{rpcDb[_0x456a('0xa1')](_0x26b512,_0x456a('0xea'));}delete this['actions'][_0x14e6ff['linkedid']];}if(!(_0x26b512['dialAnswer']&&_0x5293d3==='16')){ut['updateOriginated'](_0x4f15bd,_0x456a('0xeb'));logger[_0x456a('0x55')]('[originated][decrement][callProgressDetectingCustomer]',_0x26b512[_0x456a('0xad')],_0x456a('0xae'),_0x4f15bd[_0x456a('0x4d')],'originated:\x20',_0x4f15bd[_0x456a('0x48')]);}if(_0x5293d3!==_0x456a('0xa9')){delete this['actions'][_0x14e6ff['linkedid']];delete this[_0x456a('0x68')][_0x14e6ff[_0x456a('0xec')]];}}};Preview[_0x456a('0xc')][_0x456a('0xed')]=function(_0x4605ff,_0xe78f46,_0x1ed52e){if(_[_0x456a('0xee')](_0xe78f46)&&_0x456a('0xef')!==typeof _0xe78f46){return;}if(_[_0x456a('0xee')](_0x1ed52e)&&_0x456a('0xef')!==typeof _0x1ed52e){return;}switch(_0x1ed52e[_0x456a('0xf0')]){case'0':ut[_0x456a('0xf1')](_0x4605ff,0x0,_0x456a('0x9c'));rpcDb[_0x456a('0xf2')](_0x4605ff,_0x456a('0xf3'));break;case'3':ut[_0x456a('0xf1')](_0x4605ff,0x3,_0x456a('0xc6'));rpcDb[_0x456a('0xf2')](_0x4605ff,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x456a('0xf1')](_0x4605ff,0x5,_0x456a('0xbc'));rpcDb[_0x456a('0xf2')](_0x4605ff,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x456a('0xf1')](_0x4605ff,0x8,_0x456a('0xf4'));rpcDb[_0x456a('0xf2')](_0x4605ff,_0x456a('0xf5'));break;case'22':ut[_0x456a('0xf1')](_0x4605ff,0x16,'AnswerAGI');rpcDb[_0x456a('0xf2')](_0x4605ff,_0x456a('0xf6'));break;default:ut[_0x456a('0xf1')](_0x4605ff,0xc,_0x1ed52e[_0x456a('0xf0')]);rpcDb[_0x456a('0xf2')](_0x4605ff,_0x456a('0xf5'));}ut[_0x456a('0x74')](_0xe78f46,'[callProgressDetectingAgent]');logger[_0x456a('0x55')]('[originated][decrement][callProgressDetectingAgent]',_0x4605ff[_0x456a('0xad')],'\x20Queue',_0xe78f46['name'],_0x456a('0xf7'),_0xe78f46['originated']);delete this['actions'][_0x4605ff[_0x456a('0xad')]];};Preview['prototype']['checkInBlack']=function(_0x6cbeb8,_0xd8c295,_0x1d81ba,_0x3bcc6a,_0x709b0){var _0x123b60=this;return new BPromise(function(_0xd1a656,_0xf30f8e){if(_[_0x456a('0x66')](_0xd8c295)||_[_0x456a('0x66')](_0xd8c295[_0x456a('0xf8')])||_[_0x456a('0x66')](_0xd8c295[_0x456a('0xf8')][_0x456a('0xf9')])||_[_0x456a('0x66')](_0xd8c295[_0x456a('0x6f')])){_0xf30f8e(ut[_0x456a('0x47')]('Contact\x20is\x20undefined',_0x3bcc6a,_0x709b0));return;}var _0x40f3bf=uuid['v4']();var _0x968d1a=_0x123b60[_0x456a('0x11')][_0xd8c295[_0x456a('0x67')][_0x456a('0x4d')]];var _0x58b64c=_0x1d81ba?_0x123b60[_0x456a('0x14')][_0x1d81ba]['id']:undefined;_0x123b60['actions'][_0x40f3bf]=new Action(_0xd8c295,_0x968d1a,_0x40f3bf,_0x1d81ba,_0x58b64c);var _0xb45882=_0x123b60[_0x456a('0x68')][_0x40f3bf];_0xb45882[_0x456a('0xc3')]=_0x3bcc6a;_0xb45882[_0x456a('0xa7')]=_0x709b0;_0xb45882[_0x456a('0xfa')]=_0x1d81ba;if(_['isEmpty'](_0x6cbeb8)){_0x123b60['execCall'](_0xb45882,_0x968d1a,_0xd8c295,_0x1d81ba)[_0x456a('0x82')](function(_0x2a0d7d){logger[_0x456a('0x55')](_0x456a('0xfb'),_0x456a('0xfc')+_0xb45882[_0x456a('0x6a')]+'\x20IdHopper:\x20'+_0xb45882[_0x456a('0xfd')],JSON[_0x456a('0x50')](_0x2a0d7d));ami['emit'](_0x456a('0xfe'),ut[_0x456a('0x9e')](_0xb45882,_0x456a('0xff'),_0x123b60[_0x456a('0x11')][_0xb45882['queue']]));_0xd1a656(ut[_0x456a('0x47')](_0x456a('0x100')));})[_0x456a('0x85')](function(_0x12e00b){ut[_0x456a('0x5b')](_0x456a('0x101'),_0x12e00b);_0xf30f8e(ut[_0x456a('0x47')]('Call\x20failed',_0x3bcc6a,_0x709b0));});}else{_0x968d1a['outboundBlacklistCallsDay']+=0x1;ut[_0x456a('0x102')](_0xb45882);rpcDb[_0x456a('0x103')](_0xb45882,_0x456a('0x104'));delete _0x123b60['actions'][_0x40f3bf];_0xf30f8e(ut['message']('Contact\x20in\x20black\x20List',_0x3bcc6a,_0x709b0));}});};Preview[_0x456a('0xc')][_0x456a('0x95')]=function(_0x16bf44){return!_[_0x456a('0x66')](_0x16bf44)&&!_[_0x456a('0x66')](_0x16bf44[_0x456a('0x4d')])&&!_['isNil'](_0x16bf44[_0x456a('0x4e')])&&_0x16bf44[_0x456a('0x4e')]&&!_[_0x456a('0x66')](this[_0x456a('0x13')][util[_0x456a('0x52')]('SIP/%s',_0x16bf44[_0x456a('0x4d')])])&&!_[_0x456a('0x66')](this['trunks'][util[_0x456a('0x52')]('SIP/%s',_0x16bf44[_0x456a('0x4d')])][_0x456a('0x72')])&&(this[_0x456a('0x13')][util[_0x456a('0x52')](_0x456a('0x105'),_0x16bf44[_0x456a('0x4d')])][_0x456a('0x72')]===_0x456a('0x106')||this[_0x456a('0x13')][util['format'](_0x456a('0x105'),_0x16bf44[_0x456a('0x4d')])][_0x456a('0x72')]==='unmonitored');};Preview[_0x456a('0xc')][_0x456a('0x81')]=function(_0x59a2c0,_0xc757b7){var _0x5730bc=this;return new BPromise(function(_0x41f824,_0x4584d5){_0x5730bc[_0x456a('0x107')](_0x59a2c0,_0xc757b7)['then'](function(_0x2a1c1a){_0x41f824(_[_0x456a('0x6c')](_0x2a1c1a,['message']));})[_0x456a('0x85')](function(_0x4e6811){if(_0x4e6811['unlock']){rpcDb[_0x456a('0x108')](_0x59a2c0);}if(_0x4e6811[_0x456a('0x4e')]){rpcDb['disableContact'](_0x59a2c0);}_0x4584d5(_[_0x456a('0x6c')](_0x4e6811,[_0x456a('0x47')]));});});};Preview[_0x456a('0xc')][_0x456a('0x107')]=function(_0x523c2c,_0x352ea9){var _0x14c403=this;return new BPromise(function(_0x319254,_0x1993fc){var _0x4385c7,_0x9a5312;rpcDb['getContactPreview'](_0x523c2c)[_0x456a('0x82')](function(_0x474a08){if(!_[_0x456a('0x66')](_0x474a08[0x0])){_0x9a5312=_0x474a08[0x0][_0x456a('0x109')]?![]:!![];_0x4385c7=_0x474a08[0x0][_0x456a('0x109')]?!![]:![];_0x4385c7=_0x352ea9?!![]:_0x4385c7;}var _0x5965d4=_0x14c403[_0x456a('0x10a')](_0x474a08);if(_0x5965d4[_0x456a('0x10b')]){rpcDb[_0x456a('0x10c')](_[_0x456a('0x6c')](_0x474a08[0x0],['VoiceQueueId',_0x456a('0x10d')]))[_0x456a('0x82')](function(_0x1e7543){_0x14c403['checkInBlack'](_0x1e7543,_0x474a08[0x0],_0x352ea9,_0x9a5312,_0x4385c7)[_0x456a('0x82')](function(_0x52ba0f){_0x319254(_0x52ba0f);})[_0x456a('0x85')](function(_0x18ee2c){_0x1993fc(_0x18ee2c);});})[_0x456a('0x85')](function(_0x4b79fc){ut['logger'](_0x456a('0x10e'),_0x4b79fc);_0x1993fc(ut[_0x456a('0x47')](_0x456a('0x10f'),_0x9a5312,_0x4385c7));});}else{_0x1993fc(ut['message'](_0x5965d4[_0x456a('0x47')],_0x9a5312,_0x4385c7));}})['catch'](function(_0x47b933){ut[_0x456a('0x5b')]('[Preview][getContactPreview]',_0x47b933);_0x1993fc(ut['message'](_0x456a('0x10f'),![],!![]));});});};Preview['prototype'][_0x456a('0x10a')]=function(_0x5d5e4a){if(_[_0x456a('0x66')](_0x5d5e4a)||_[_0x456a('0x110')](_0x5d5e4a)||!_[_0x456a('0x66')](_0x5d5e4a[0x0][_0x456a('0x7f')])&&_['isNil'](_0x5d5e4a[0x0][_0x456a('0x7f')][_0x456a('0x4d')])){ut[_0x456a('0x5b')](_0x456a('0x111'),_0x5d5e4a);return{'isValid':![],'message':_0x456a('0x112')};}var _0xa4918a=this['campaignsPreview'][_0x5d5e4a[0x0][_0x456a('0x67')][_0x456a('0x4d')]];_0xa4918a[_0x456a('0x47')]='ACTIVE';if(_['isNil'](_0xa4918a)){ut['logger'](_0x456a('0x113'),_0xa4918a);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x456a('0x95')](_0xa4918a[_0x456a('0x4c')])){ut[_0x456a('0x5b')](_0x456a('0x114'),'campaign\x20Name:\x20'+_0xa4918a[_0x456a('0x4d')]+_0x456a('0x115'));if(!this['isTrunkReachable'](_0xa4918a[_0x456a('0x96')])){ut[_0x456a('0x5b')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xa4918a['name']+_0x456a('0x116'));return{'isValid':![],'message':_0x456a('0x117')};}}if(!ut[_0x456a('0x93')](_0xa4918a[_0x456a('0x62')])){ut[_0x456a('0x5b')](_0x456a('0x118'),_0xa4918a[_0x456a('0x4d')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xa4918a[_0x456a('0x4d')]+_0x456a('0x119')};}return{'isValid':!![],'message':_0x456a('0x11a')};};Preview[_0x456a('0xc')][_0x456a('0x11b')]=function(_0xdbe059,_0x26b16c,_0xa5e697,_0x4b5d50){var _0x398552=this;return new BPromise(function(_0x5bb2be,_0x589af3){var _0x2bb55a=_0xdbe059[_0x456a('0xad')];var _0x653592=_0x398552[_0x456a('0x95')](_0x26b16c[_0x456a('0x4c')])?util[_0x456a('0x52')](_0x456a('0x11c'),_0x26b16c[_0x456a('0x4c')][_0x456a('0x4d')],_[_0x456a('0x66')](_0x26b16c['dialPrefix'])?'':_0x26b16c['dialPrefix'][_0x456a('0x11d')]()||'',_0x26b16c['dialCutDigit']>0x0?_0xa5e697[_0x456a('0xf8')][_0x456a('0xf9')][_0x456a('0x11e')](_0x26b16c[_0x456a('0x11f')]):_0xa5e697['Contact'][_0x456a('0xf9')]):util[_0x456a('0x52')]('SIP/%s/%s%s',_['isNil'](_0x26b16c[_0x456a('0x96')])?_0x26b16c[_0x456a('0x4c')][_0x456a('0x4d')]:_0x26b16c[_0x456a('0x96')][_0x456a('0x4d')],_[_0x456a('0x66')](_0x26b16c['dialPrefix'])?'':_0x26b16c[_0x456a('0x32')][_0x456a('0x11d')]()||'',_0x26b16c[_0x456a('0x11f')]>0x0?_0xa5e697[_0x456a('0xf8')][_0x456a('0xf9')][_0x456a('0x11e')](_0x26b16c['dialCutDigit']):_0xa5e697['Contact'][_0x456a('0xf9')]);var _0x2cce4a=_0x398552['isTrunkReachable'](_0x26b16c['Trunk'])?ut['getCallerId'](_0x26b16c[_0x456a('0x4c')][_0x456a('0x120')],_0x26b16c[_0x456a('0x121')],_0x26b16c[_0x456a('0x122')]>0x0?ut[_0x456a('0x123')](_0x26b16c[_0x456a('0x30')],_0x26b16c['dialRandomLastDigitCallerIdNumber']):_0x26b16c[_0x456a('0x30')]):ut[_0x456a('0x124')](_[_0x456a('0x66')](_0x26b16c['TrunkBackup'])?_0x26b16c['Trunk'][_0x456a('0x120')]:_0x26b16c[_0x456a('0x96')][_0x456a('0x120')],_0x26b16c[_0x456a('0x121')],_0x26b16c[_0x456a('0x122')]>0x0?ut[_0x456a('0x123')](_0x26b16c[_0x456a('0x30')],_0x26b16c[_0x456a('0x122')]):_0x26b16c[_0x456a('0x30')]);if(_0x2cce4a){_0xdbe059[_0x456a('0x125')]=ut[_0x456a('0x126')](_0x2cce4a);_0xdbe059[_0x456a('0x127')]=ut[_0x456a('0x128')](_0x2cce4a);}var _0x3b2eae=ut[_0x456a('0x129')](_0x26b16c,_0xa5e697,_0x653592,_0x2cce4a,_0x2bb55a,_0xdbe059);_[_0x456a('0x12a')](_0xdbe059,ut[_0x456a('0x12b')](_0x3b2eae));_0xdbe059['starttime']=moment()['format'](_0x456a('0xaa'));ami[_0x456a('0x71')](ut['variablesAction'](_0xdbe059,_0x26b16c,_0x3b2eae,_0xdbe059[_0x456a('0xa7')],_0x4b5d50))['then'](function(_0x1fdba6){_0x26b16c['originated']+=0x1;logger[_0x456a('0x55')](_0x456a('0x12c'),_0x2bb55a,'\x20Queue',_0x26b16c['name'],_0x456a('0xf7'),_0x26b16c[_0x456a('0x48')]);_0x5bb2be(_0x1fdba6);})[_0x456a('0x85')](function(_0x4a083a){ut[_0x456a('0xf1')](_0xdbe059,0xe,'OriginateError');rpcDb[_0x456a('0xf2')](_0xdbe059,_0x456a('0x12d'));_0x589af3(_0x4a083a);});});};Preview['prototype'][_0x456a('0x1f')]=function(_0x207e02){if(this[_0x456a('0x68')][_0x207e02[_0x456a('0xa8')]]){this[_0x456a('0x68')][_0x207e02[_0x456a('0xa8')]]['channel']=_0x207e02[_0x456a('0x73')];}};Preview['prototype']['syncOriginateResponse']=function(_0x19f2f1){var _0x264d11=this;var _0x1f3209=this[_0x456a('0x68')][_0x19f2f1[_0x456a('0x12e')]];if(_0x1f3209){if(_0x1f3209[_0x456a('0xfa')]&&this['agents'][_0x1f3209['lookAgent']]){ut['logLookAgent'](_0x1f3209,this[_0x456a('0x14')][_0x1f3209[_0x456a('0xfa')]][_0x456a('0x4d')],this[_0x456a('0x14')][_0x1f3209[_0x456a('0xfa')]]['id']);}var _0x306129=_['clone'](_0x1f3209);_0x306129[_0x456a('0xab')]=moment()['format'](_0x456a('0xaa'));var _0x18beb4=_0x264d11[_0x456a('0x11')][_0x1f3209[_0x456a('0x6a')]];if(ut[_0x456a('0x12f')](_0x19f2f1[_0x456a('0x130')])){if(_0x1f3209[_0x456a('0xc3')]){rpcDb['unlockContact'](_0x1f3209[_0x456a('0xfd')]);}if(_0x1f3209[_0x456a('0xa7')]){rpcDb[_0x456a('0x86')](_0x1f3209[_0x456a('0xfd')]);}ami[_0x456a('0x57')](_0x456a('0x131'),ut[_0x456a('0x9e')](_0x1f3209,'rejected',this['campaignsPreview'][_0x1f3209[_0x456a('0x6a')]]));this['callProgressDetectingAgent'](_0x306129,_0x18beb4,_0x19f2f1);}else{_0x1f3209[_0x456a('0x87')]=moment()[_0x456a('0x52')](_0x456a('0xaa'));ut[_0x456a('0xf1')](_0x306129,0x4,_0x456a('0xb5'));rpcDb[_0x456a('0xf2')](_0x306129,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x456a('0xc')][_0x456a('0x19')]=function(_0x1edd25){var _0x14d894=this;var _0x5a97c1=this[_0x456a('0x68')][_0x1edd25[_0x456a('0xa8')]];var _0x11aa1c;if(_0x5a97c1){_0x11aa1c=this[_0x456a('0x11')][_0x5a97c1['queue']];logger[_0x456a('0x55')]('[syncHangup][talking]',_0x1edd25['linkedid'],_0x456a('0xae'),_0x11aa1c[_0x456a('0x4d')],_0x456a('0x69'),_0x11aa1c[_0x456a('0x28')]);}if(this[_0x456a('0x68')][_0x1edd25[_0x456a('0xa8')]]&&_0x1edd25[_0x456a('0xa8')]!==_0x1edd25[_0x456a('0xad')]){if(_0x1edd25[_0x456a('0x132')]==='16'&&this[_0x456a('0x68')][_0x1edd25['linkedid']][_0x456a('0x6b')]){this[_0x456a('0x133')](_0x1edd25,_0x1edd25[_0x456a('0xa8')],_0x1edd25[_0x456a('0x132')]);}else if(this['actions'][_0x1edd25[_0x456a('0xa8')]][_0x456a('0x6b')]){logger[_0x456a('0x55')]('[syncHangup][talking][cause]',_0x1edd25[_0x456a('0xa8')],_0x1edd25[_0x456a('0x132')],_0x456a('0xae'),_0x11aa1c[_0x456a('0x4d')],_0x456a('0x69'),_0x11aa1c[_0x456a('0x28')]);this[_0x456a('0x133')](_0x1edd25,_0x1edd25['linkedid'],_0x1edd25[_0x456a('0x132')]);}}else if(_0x5a97c1&&_[_0x456a('0x66')](_0x5a97c1['statedesc'])&&_0x11aa1c[_0x456a('0x134')]&&_0x1edd25[_0x456a('0xa8')]===_0x1edd25[_0x456a('0xad')]&&_['isNil'](_0x1edd25[_0x456a('0xf0')])&&_0x1edd25[_0x456a('0x132')]==='16'&&_0x1edd25[_0x456a('0x135')]==='6'&&_[_0x456a('0xee')](_0x5a97c1[_0x456a('0x136')])){if(_0x5a97c1[_0x456a('0xc3')]){rpcDb[_0x456a('0x108')](_0x5a97c1['idContact']);}if(_0x5a97c1['activeContact']){rpcDb[_0x456a('0x86')](_0x5a97c1['idContact']);}_0x1edd25[_0x456a('0xf0')]='22';this[_0x456a('0xed')](_0x5a97c1,_0x11aa1c,_0x1edd25);}else if(_0x5a97c1&&_0x5a97c1['transfer']){if(_0x1edd25[_0x456a('0x132')]==='16'&&this['actions'][_0x1edd25['linkedid']]['dialAnswer']){logger[_0x456a('0x55')](_0x456a('0x137'),_0x1edd25[_0x456a('0xa8')],_0x1edd25[_0x456a('0x132')],_0x456a('0xae'),_0x11aa1c[_0x456a('0x4d')],'pTalking:\x20',_0x11aa1c[_0x456a('0x28')]);this['callProgressDetectingCustomer'](_0x1edd25,_0x1edd25['linkedid'],_0x1edd25[_0x456a('0x132')]);}else if(this[_0x456a('0x68')][_0x1edd25['linkedid']][_0x456a('0x6b')]){logger[_0x456a('0x55')](_0x456a('0x138'),_0x1edd25[_0x456a('0xa8')],_0x1edd25[_0x456a('0x132')],'\x20Queue',_0x11aa1c[_0x456a('0x4d')],_0x456a('0x69'),_0x11aa1c['pTalking']);this[_0x456a('0x133')](_0x1edd25,_0x1edd25[_0x456a('0xa8')],_0x1edd25['cause']);}}};Preview['prototype'][_0x456a('0x1d')]=function(_0x19fa79){if(this[_0x456a('0x68')][_0x19fa79[_0x456a('0xec')]]&&_0x19fa79[_0x456a('0xec')]!==_0x19fa79['destuniqueid']){this['callProgressDetectingCustomer'](_0x19fa79,_0x19fa79[_0x456a('0xec')],_0x19fa79[_0x456a('0xe3')]);}};Preview[_0x456a('0xc')][_0x456a('0x1c')]=function(_0x5949e0){if(this[_0x456a('0x68')][_0x5949e0[_0x456a('0xa8')]]&&_0x5949e0[_0x456a('0xa8')]!==_0x5949e0['uniqueid']&&!this['actions'][_0x5949e0[_0x456a('0xa8')]][_0x456a('0x6b')]){if(_0x5949e0['cause']==='1'){this[_0x456a('0x133')](_0x5949e0,_0x5949e0[_0x456a('0xa8')],_0x5949e0[_0x456a('0x132')]);}}};Preview['prototype']['addVariable']=function(_0x55eedf,_0x49dba5,_0x1f12c0){if(this[_0x456a('0x68')][_0x55eedf]){if(_[_0x456a('0x66')](this[_0x456a('0x68')][_0x55eedf]['variables'])){this[_0x456a('0x68')][_0x55eedf][_0x456a('0x139')]={};}this[_0x456a('0x68')][_0x55eedf][_0x456a('0x139')][_0x49dba5]=_0x1f12c0;}};Preview[_0x456a('0xc')][_0x456a('0x21')]=function(_0x3ee851){try{if(!_[_0x456a('0x66')](_0x3ee851)){if(ut[_0x456a('0x13a')](_['keys'](_0x3ee851[_0x456a('0x13b')])[0x0])){this[_0x456a('0x13c')](_0x3ee851[_0x456a('0xad')],_['keys'](_0x3ee851[_0x456a('0x13b')])[0x0],_0x3ee851[_0x456a('0x13d')]);}}}catch(_0x3f7218){logger[_0x456a('0x13e')](_0x456a('0x13f'),util[_0x456a('0x140')](_0x3f7218,{'showHidden':![],'depth':null}));}};Preview[_0x456a('0xc')][_0x456a('0x22')]=function(_0x568e6c){if(_0x568e6c){if(this['actions'][_0x568e6c[_0x456a('0x141')]]){this[_0x456a('0x68')][_0x568e6c[_0x456a('0x141')]][_0x456a('0x136')]=!![];}}};Preview[_0x456a('0xc')]['syncBlindTransfer']=function(_0x3de0d1){if(_0x3de0d1){if(this[_0x456a('0x68')][_0x3de0d1[_0x456a('0x142')]]){this[_0x456a('0x68')][_0x3de0d1[_0x456a('0x142')]][_0x456a('0x136')]=!![];}}};module[_0x456a('0x143')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9651d16..bba4348 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 _0xf19b=['[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','answertime','queuecallercomplete','queuecallercompleteAt','membername','context','from-sip','xcally-motion-preview','lastAssignedTo','create'];(function(_0x318296,_0x2663ae){var _0x18e91b=function(_0x5e31ed){while(--_0x5e31ed){_0x318296['push'](_0x318296['shift']());}};_0x18e91b(++_0x2663ae);}(_0xf19b,0x164));var _0xbf19=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xf19b[_0xf50820];return _0x2a9b10;};'use strict';var util=require('util');var BPromise=require(_0xbf19('0x0'));var logger=require('../../../config/logger')('preview');var _=require('lodash');var cmHopper=require(_0xbf19('0x1'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xbf19('0x2'));var cmHopperBlack=require(_0xbf19('0x3'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xbf19('0x4'));function loggerCatch(_0x11011b){return function(_0x42bbc3){logger[_0xbf19('0x5')](_0x11011b,util[_0xbf19('0x6')](_0x42bbc3,{'showHidden':![],'depth':null}));};}function create(_0x3f7652){return BPromise[_0xbf19('0x7')]()[_0xbf19('0x8')](cmHopperHistory[_0xbf19('0x9')](_0x3f7652))[_0xbf19('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x54f77b){return BPromise[_0xbf19('0x7')]()['then'](agentReportPreview['createHistory'](_0x54f77b))[_0xbf19('0xa')](loggerCatch(_0xbf19('0xb')));}function moveContact(_0x174501){return BPromise[_0xbf19('0x7')]()['then'](cmHopper['moveContactManagedDialer'](_0x174501,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xbf19('0xc')]=function(_0x46519f){return BPromise[_0xbf19('0x7')]()['then'](cmHopperBlack[_0xbf19('0xc')](_0x46519f))['catch'](loggerCatch(_0xbf19('0xd')));};exports[_0xbf19('0xe')]=function(_0x5a1f59){return BPromise['resolve']()[_0xbf19('0x8')](cmHopper[_0xbf19('0xe')](_0x5a1f59))[_0xbf19('0xa')](loggerCatch(_0xbf19('0xf')));};exports[_0xbf19('0x9')]=function(_0x2ba98e,_0x2cf862){create(_0x2ba98e)[_0xbf19('0xa')](loggerCatch(_0x2cf862));moveContact(_0x2ba98e)[_0xbf19('0xa')](loggerCatch(_0x2cf862));};exports[_0xbf19('0x10')]=function(_0x48e0b1,_0x39c59f){createAgent(_0x48e0b1)[_0xbf19('0xa')](loggerCatch(_0x39c59f));};exports['createCustomerHistory']=function(_0x5043fe,_0x1a70d9){create(_0x5043fe)['catch'](loggerCatch(_0x1a70d9));};exports['createCustomerFinal']=function(_0xbee68e,_0xc07dfe){moveContact(_0xbee68e)[_0xbf19('0xa')](loggerCatch(_0xc07dfe));};exports[_0xbf19('0x11')]=function(_0x3d5240,_0x468681,_0x2da7b3){if(_0x468681){_0x3d5240[_0xbf19('0x12')]=null;}if(_0x2da7b3){_0x3d5240['active']=![];}return BPromise[_0xbf19('0x7')]()[_0xbf19('0x8')](cmHopper[_0xbf19('0x11')](_0x3d5240))[_0xbf19('0xa')](loggerCatch(_0xbf19('0x13')));};exports['countReScheduled']=function(_0x3ec1fb){return BPromise[_0xbf19('0x7')]()[_0xbf19('0x8')](cmHopper[_0xbf19('0x14')](_0x3ec1fb))['catch'](loggerCatch(_0xbf19('0x15')));};exports[_0xbf19('0x16')]=function(_0x5ad363){return BPromise[_0xbf19('0x7')]()[_0xbf19('0x8')](cmHopper[_0xbf19('0x16')]({'UserId':null},_0x5ad363,0x1))[_0xbf19('0xa')](loggerCatch(_0xbf19('0x17')));};exports[_0xbf19('0x18')]=function(_0x4a8722){return BPromise['resolve']()[_0xbf19('0x8')](cmHopper[_0xbf19('0x16')]({'active':![]},_0x4a8722,0x1))[_0xbf19('0xa')](loggerCatch(_0xbf19('0x19')));};exports[_0xbf19('0x1a')]=function(_0x1a7656){var _0x4accfe={};_0x4accfe['type']=_0x1a7656[_0xbf19('0x1b')];_0x4accfe[_0xbf19('0x1c')]=_0x1a7656[_0xbf19('0x1c')];_0x4accfe[_0xbf19('0x1d')]=_0x1a7656[_0xbf19('0x1d')];_0x4accfe[_0xbf19('0x1e')]=_0x1a7656[_0xbf19('0x1e')];_0x4accfe['queue']=_0x1a7656['queue'];_0x4accfe['queuecallerjoinAt']=_0x1a7656[_0xbf19('0x1f')];_0x4accfe['queuecallerleaveAt']=_0x1a7656[_0xbf19('0x1f')];_0x4accfe[_0xbf19('0x20')]=0x1;_0x4accfe[_0xbf19('0x21')]=_0x1a7656['endtime'];_0x4accfe['connectedlinename']=_0x1a7656[_0xbf19('0x22')];_0x4accfe[_0xbf19('0x23')]=_0xbf19('0x24');_0x4accfe['exten']=_0xbf19('0x25');_0x4accfe['holdtime']=0x0;_0x4accfe['assigned']=0x1;_0x4accfe[_0xbf19('0x26')]=_0x1a7656[_0xbf19('0x22')];_0x4accfe['queuecallerexitreason']='COMPLETED';return BPromise['resolve']()[_0xbf19('0x8')](voiceQueueReport[_0xbf19('0x27')](_0x4accfe))[_0xbf19('0xa')](loggerCatch(_0xbf19('0x28')));};exports[_0xbf19('0x29')]=function(_0x568120,_0x3d1d4d){return BPromise[_0xbf19('0x7')]()[_0xbf19('0x8')](cmHopper[_0xbf19('0x29')](_0x568120,_0x3d1d4d))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xbf19('0x2a')]=function(_0x5366e0){return BPromise[_0xbf19('0x7')]()['then'](cmHopper[_0xbf19('0x11')](_0x5366e0,!![],!![]))[_0xbf19('0xa')](loggerCatch(_0xbf19('0x2b')));}; \ No newline at end of file +var _0x41d5=['../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x58cc7a,_0x4e7ee6){var _0x540462=function(_0x555af2){while(--_0x555af2){_0x58cc7a['push'](_0x58cc7a['shift']());}};_0x540462(++_0x4e7ee6);}(_0x41d5,0xf6));var _0x541d=function(_0x3603e7,_0x210293){_0x3603e7=_0x3603e7-0x0;var _0x3285f4=_0x41d5[_0x3603e7];return _0x3285f4;};'use strict';var util=require(_0x541d('0x0'));var BPromise=require(_0x541d('0x1'));var logger=require(_0x541d('0x2'))(_0x541d('0x3'));var _=require('lodash');var cmHopper=require(_0x541d('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x541d('0x5'));var cmHopperBlack=require(_0x541d('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x541d('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x823835){return function(_0x543d11){logger['error'](_0x823835,util[_0x541d('0x8')](_0x543d11,{'showHidden':![],'depth':null}));};}function create(_0x209457){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopperHistory[_0x541d('0xb')](_0x209457))[_0x541d('0xc')](loggerCatch(_0x541d('0xd')));}function createAgent(_0x4e6f75){return BPromise['resolve']()['then'](agentReportPreview[_0x541d('0xb')](_0x4e6f75))[_0x541d('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x5c59b5){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopper[_0x541d('0xe')](_0x5c59b5,!![]))[_0x541d('0xc')](loggerCatch(_0x541d('0xf')));}exports[_0x541d('0x10')]=function(_0x3baf8c){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopperBlack['checkIsBlackList'](_0x3baf8c))[_0x541d('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x541d('0x11')]=function(_0x23daf4){return BPromise['resolve']()[_0x541d('0xa')](cmHopper['getContactPreview'](_0x23daf4))['catch'](loggerCatch(_0x541d('0x12')));};exports[_0x541d('0xb')]=function(_0x19e385,_0x343743){create(_0x19e385)['catch'](loggerCatch(_0x343743));moveContact(_0x19e385)[_0x541d('0xc')](loggerCatch(_0x343743));};exports[_0x541d('0x13')]=function(_0x2cb03f,_0x19fccf){createAgent(_0x2cb03f)['catch'](loggerCatch(_0x19fccf));};exports[_0x541d('0x14')]=function(_0x40d673,_0x544909){create(_0x40d673)[_0x541d('0xc')](loggerCatch(_0x544909));};exports[_0x541d('0x15')]=function(_0x34fa97,_0x4c09cd){moveContact(_0x34fa97)['catch'](loggerCatch(_0x4c09cd));};exports[_0x541d('0x16')]=function(_0x15b916,_0xc83c54,_0x38beba){if(_0xc83c54){_0x15b916[_0x541d('0x17')]=null;}if(_0x38beba){_0x15b916[_0x541d('0x18')]=![];}return BPromise['resolve']()[_0x541d('0xa')](cmHopper['rescheduleContact'](_0x15b916))[_0x541d('0xc')](loggerCatch(_0x541d('0x19')));};exports['countReScheduled']=function(_0x5c9eb7){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopper[_0x541d('0x1a')](_0x5c9eb7))[_0x541d('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0x541d('0x1b')]=function(_0x53ce5e){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopper[_0x541d('0x1b')]({'UserId':null},_0x53ce5e,0x1))['catch'](loggerCatch(_0x541d('0x1c')));};exports['disableContact']=function(_0x2267f6){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopper['unlockContact']({'active':![]},_0x2267f6,0x1))[_0x541d('0xc')](loggerCatch(_0x541d('0x1d')));};exports['crateCustomerReportQueue']=function(_0x474bef){var _0x1c1fb9={};_0x1c1fb9[_0x541d('0x1e')]=_0x474bef['type'];_0x1c1fb9[_0x541d('0x1f')]=_0x474bef[_0x541d('0x1f')];_0x1c1fb9[_0x541d('0x20')]=_0x474bef[_0x541d('0x20')];_0x1c1fb9[_0x541d('0x21')]=_0x474bef['calleridname'];_0x1c1fb9['queue']=_0x474bef['queue'];_0x1c1fb9['queuecallerjoinAt']=_0x474bef[_0x541d('0x22')];_0x1c1fb9[_0x541d('0x23')]=_0x474bef[_0x541d('0x22')];_0x1c1fb9[_0x541d('0x24')]=0x1;_0x1c1fb9[_0x541d('0x25')]=_0x474bef[_0x541d('0x26')];_0x1c1fb9[_0x541d('0x27')]=_0x474bef['membername'];_0x1c1fb9[_0x541d('0x28')]='from-sip';_0x1c1fb9[_0x541d('0x29')]=_0x541d('0x2a');_0x1c1fb9[_0x541d('0x2b')]=0x0;_0x1c1fb9['assigned']=0x1;_0x1c1fb9[_0x541d('0x2c')]=_0x474bef[_0x541d('0x2d')];_0x1c1fb9[_0x541d('0x2e')]=_0x541d('0x2f');return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](voiceQueueReport['create'](_0x1c1fb9))[_0x541d('0xc')](loggerCatch(_0x541d('0x30')));};exports['getContactRecallMe']=function(_0x3f3d1e,_0x351676){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopper['getContactRecallMe'](_0x3f3d1e,_0x351676))[_0x541d('0xc')](loggerCatch(_0x541d('0x31')));};exports['rescheduleContactInQueue']=function(_0x143b85){return BPromise[_0x541d('0x9')]()[_0x541d('0xa')](cmHopper['rescheduleContact'](_0x143b85,!![],!![]))[_0x541d('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 7cf8b0a..53cb59d 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 _0xcfcc=['bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','lodash','moment','preview','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','inspect','info','loggerError','error','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','responsetime','endtime','logAgent','statedesc','ringtime','starttime','membername','UserId','state','talktime','answertime','isFailure','variablesAction','uniqueid','originate','from-sip','timeout','totalGlobal','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','channelAgent','motionChannel','mandatoryDisposition','buildAcw','queue','interface','agentReadyId','not_inuse','reachable','getDiff','diff','createBody','CampaignId','filterKey','type','dialAnswer','scheduledat','countcongestionretry','countnoanswerretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged'];(function(_0x3aa1a7,_0x4650b4){var _0x5cb5d2=function(_0x11c71e){while(--_0x11c71e){_0x3aa1a7['push'](_0x3aa1a7['shift']());}};_0x5cb5d2(++_0x4650b4);}(_0xcfcc,0x196));var _0xccfc=function(_0x42dea5,_0x34108b){_0x42dea5=_0x42dea5-0x0;var _0x4597a4=_0xcfcc[_0x42dea5];return _0x4597a4;};'use strict';var util=require(_0xccfc('0x0'));var _=require(_0xccfc('0x1'));var moment=require(_0xccfc('0x2'));var logger=require('../../../../config/logger')(_0xccfc('0x3'));var ipAgi=process['env'][_0xccfc('0x4')]||'127.0.0.1';function getSeconds(_0x5c8628,_0x3314d6){var _0x321bf1=moment(_0x5c8628)[_0xccfc('0x5')](0x0);var _0x3eaa14=moment(_0x3314d6)['milliseconds'](0x0);return _0x321bf1['diff'](_0x3eaa14,_0xccfc('0x6'));}exports[_0xccfc('0x7')]=function(_0x5f0e81){return function(_0x11d60b){logger['error'](_0x5f0e81,util[_0xccfc('0x8')](_0x11d60b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x588987,_0x1a88fe){logger[_0xccfc('0x9')](_0x588987,util[_0xccfc('0x8')](_0x1a88fe,{'showHidden':![],'depth':null}));};exports[_0xccfc('0xa')]=function(_0x217fc1,_0x4101c1){logger[_0xccfc('0xb')](_0x217fc1,util['inspect'](_0x4101c1,{'showHidden':![],'depth':null}));};exports[_0xccfc('0xc')]=function(_0x4183df){return function(_0x41c33e){logger['info'](_0x4183df,util[_0xccfc('0x8')](_0x41c33e,{'showHidden':![],'depth':null}));};};exports[_0xccfc('0xd')]=function(_0x5eba6d,_0x2a8bc5,_0x154e31){return{'message':_0x5eba6d,'unlock':_0x2a8bc5,'active':_0x154e31};};exports['getCallerId']=function(_0x45ae5c,_0x1adb95,_0x19ec93){if(!_[_0xccfc('0xe')](_0x19ec93)&&_0xccfc('0xf')===typeof _0x19ec93&&!_[_0xccfc('0x10')](_0x19ec93)){if(!_[_0xccfc('0xe')](_0x1adb95)&&_0xccfc('0xf')===typeof _0x1adb95&&!_['isEmpty'](_0x1adb95)){return util[_0xccfc('0x11')]('\x22%s\x22\x20<%s>',_0x1adb95,_0x19ec93);}return util[_0xccfc('0x11')](_0xccfc('0x12'),_0x19ec93,_0x19ec93);}if(!_[_0xccfc('0xe')](_0x45ae5c)&&_0xccfc('0xf')===typeof _0x45ae5c&&!_[_0xccfc('0x10')](_0x45ae5c)){return _0x45ae5c;}return _0xccfc('0x13');};exports['isActive']=function(_0xf4fe3d){if(_[_0xccfc('0x14')](_0xf4fe3d)){return![];}return _0xf4fe3d;};exports[_0xccfc('0x15')]=function(_0x2e1ef3,_0x3a41e2,_0x4f423b,_0x49090b,_0x26498f,_0x3fabc6){var _0x362af1={'XMD-QUEUE':_0x3a41e2[_0xccfc('0x16')]?_0x3a41e2['Queue'][_0xccfc('0x17')]:'','XMD-CALLERID':_0x49090b,'XMD-CALLERID-PREVIEW':_0x3fabc6?util[_0xccfc('0x11')](_0xccfc('0x12'),_0x3fabc6[_0xccfc('0x18')],_0x3fabc6[_0xccfc('0x19')]):_0x49090b,'XMD-DIALID':_0x26498f,'XMD-CONTACTID':_0x3a41e2[_0xccfc('0x1a')],'XMD-CDRTYPE':_0xccfc('0x1b'),'CALLERID(all)':_0x49090b,'XMD-VOICEQUEUEID':_0x3a41e2[_0xccfc('0x1c')],'XMD-DIALCHANNEL':_0x4f423b,'XMD-DIALTIMEOUT':_0x2e1ef3[_0xccfc('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xccfc('0x11')]('\x22rtTxX%s%s\x22',_0x2e1ef3['dialQueueProject2']?'g':'',_[_0xccfc('0x10')](_0x2e1ef3[_0xccfc('0x1e')])?'':_0xccfc('0x1f')),'XMD-DIALURL':_0x2e1ef3[_0xccfc('0x20')]||'','XMD-AGI':_0x2e1ef3[_0xccfc('0x21')]?util[_0xccfc('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2e1ef3[_0xccfc('0x21')]):_0xccfc('0x22'),'XMD-AGIAFTER':_0x2e1ef3[_0xccfc('0x23')]?util[_0xccfc('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2e1ef3[_0xccfc('0x23')]):_0xccfc('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x3fabc6?_0x3fabc6[_0xccfc('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3fabc6?_0x3fabc6[_0xccfc('0x25')]:'','XMD-DESTINATION':_0xccfc('0x26'),'SIPADDHEADER':_0xccfc('0x27')};if(!_['isEmpty'](_0x2e1ef3[_0xccfc('0x1e')])){_0x362af1[util[_0xccfc('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x2e1ef3['monitor_format'];_0x362af1[util[_0xccfc('0x11')]('%s',_0xccfc('0x28'))]=_0x26498f;}if(_0x3a41e2&&_0x3a41e2[_0xccfc('0x29')]){for(var _0x3f8f48 in _0x3a41e2[_0xccfc('0x29')]){if(_0x3a41e2[_0xccfc('0x29')]['hasOwnProperty'](_0x3f8f48)){if(!_[_0xccfc('0x14')](_0x3a41e2['Contact'][_0x3f8f48])&&_0x3f8f48!=='id'&&_0x3f8f48!=='tags'&&_0x3f8f48!==_0xccfc('0x2a')&&_0x3f8f48!==_0xccfc('0x2b')){_0x362af1[util['format'](_0xccfc('0x2c'),_0xccfc('0x2d'),_[_0xccfc('0x2e')](_0x3f8f48))]=_0x3a41e2[_0xccfc('0x29')][_0x3f8f48];}}}}return _0x362af1;};exports[_0xccfc('0x2f')]=function(_0x38df7a){var _0x5b8786={};for(var _0x15dff5 in _0x38df7a){if(_0x38df7a[_0xccfc('0x30')](_0x15dff5)){_0x5b8786[util[_0xccfc('0x11')]('%s',_[_0xccfc('0x31')](_0x15dff5))]=_0x38df7a[_0x15dff5];}}return{'variables':_0x5b8786};};exports['updateOriginated']=function(_0x33b4c0,_0x508e94){if(!_['isNil'](_0x33b4c0)){if(_0x33b4c0[_0xccfc('0x30')](_0xccfc('0x32'))){if(_0x33b4c0[_0xccfc('0x32')]>0x0){_0x33b4c0[_0xccfc('0x32')]-=0x1;}else{logger[_0xccfc('0xb')](_0xccfc('0x33'),_0x508e94);}}}else{logger['error'](_0xccfc('0x34'),_0x508e94);}};exports[_0xccfc('0x35')]=function(_0x113f0d){var _0x4e77a6=moment()['format'](_0xccfc('0x36'));_0x113f0d['state']=0xd;_0x113f0d['statedesc']='Blacklist';_0x113f0d['starttime']=_0x4e77a6;_0x113f0d[_0xccfc('0x37')]=_0x4e77a6;_0x113f0d[_0xccfc('0x38')]=_0x4e77a6;};exports[_0xccfc('0x39')]=function(_0x276907,_0x4880a7,_0x5d5c3d){var _0x15ee6d=moment()[_0xccfc('0x11')](_0xccfc('0x36'));_0x276907['state']=_0x4880a7;_0x276907[_0xccfc('0x3a')]=_0x5d5c3d;_0x276907['responsetime']=_0x15ee6d;_0x276907[_0xccfc('0x3b')]=getSeconds(_0x276907[_0xccfc('0x37')],_0x276907[_0xccfc('0x3c')]);};exports['logLookAgent']=function(_0x270dde,_0x5a39f2,_0x44c17f){_0x270dde[_0xccfc('0x3d')]=_0x5a39f2;_0x270dde[_0xccfc('0x3e')]=_0x44c17f;};exports['logCustomer']=function(_0x233511,_0x12e68b,_0x10464b){var _0x55ba95=moment()[_0xccfc('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x233511[_0xccfc('0x3f')]=_0x12e68b;_0x233511[_0xccfc('0x3a')]=_0x10464b;_0x233511[_0xccfc('0x37')]=_0x233511[_0xccfc('0x37')]?_0x233511[_0xccfc('0x37')]:_0x55ba95;_0x233511[_0xccfc('0x38')]=_0x233511[_0xccfc('0x38')]?_0x233511['endtime']:_0x55ba95;_0x233511[_0xccfc('0x3b')]=getSeconds(_0x233511[_0xccfc('0x37')]||0x0,_0x233511[_0xccfc('0x3c')]||0x0);_0x233511[_0xccfc('0x40')]=_0x233511[_0xccfc('0x41')]?getSeconds(_0x233511[_0xccfc('0x38')],_0x233511[_0xccfc('0x41')]):0x0;};exports[_0xccfc('0x42')]=function(_0x3e08a1){return _0x3e08a1==='Failure';};exports[_0xccfc('0x43')]=function(_0x1e1910,_0x15d82b,_0xd0d391,_0x497da2,_0x266d50){var _0x377f4a=_0x497da2?'RECALL':_0x1e1910['calleridname'];_0x377f4a=_0x266d50?'BOOKED':_0x377f4a;return{'actionid':_0x1e1910[_0xccfc('0x44')],'action':_0xccfc('0x45'),'channel':_0x1e1910['channelAgent'],'callerid':util[_0xccfc('0x11')](_0xccfc('0x12'),_0x377f4a,_0x1e1910[_0xccfc('0x19')]),'Exten':_0xccfc('0x26'),'Context':_0xccfc('0x46'),'Priority':'1','variable':_0xd0d391,'timeout':(_0x15d82b[_0xccfc('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1e1910[_0xccfc('0x44')]};};exports[_0xccfc('0x48')]=function(_0x557be){return _0x557be['countbusyretry']+_0x557be['countcongestionretry']+_0x557be['countnoanswerretry']+_0x557be[_0xccfc('0x49')]+_0x557be[_0xccfc('0x4a')];};exports[_0xccfc('0x4b')]=function(_0x36177a){var _0x2ee850=_['clone'](_0x36177a);_0x2ee850[_0xccfc('0x3f')]=0xf;_0x2ee850[_0xccfc('0x3a')]=_0xccfc('0x4c');return _0x2ee850;};exports[_0xccfc('0x4d')]=function(_0x1313c0,_0x51c44e,_0x385ee9){var _0x173885={};_0x173885[_0x51c44e]=_0x1313c0[_0x51c44e];_0x173885[_0xccfc('0x4e')]=![];_0x173885['scheduledat']=moment()[_0xccfc('0x4f')](_0x385ee9,_0xccfc('0x50'))[_0xccfc('0x11')](_0xccfc('0x36'));_0x173885['ContactId']=_0x1313c0[_0xccfc('0x1a')];_0x173885[_0xccfc('0x51')]=_0x1313c0['ListId'];_0x173885[_0xccfc('0x1c')]=_0x1313c0[_0xccfc('0x1c')]||undefined;return _0x173885;};exports[_0xccfc('0x52')]=function(_0xed500,_0x4de075){if(!_[_0xccfc('0x14')](_0xed500)){if(_0xed500['pTalking']>0x0){_0xed500['pTalking']-=0x1;}else{logger[_0xccfc('0xb')](_0x4de075,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xccfc('0xb')](_0x4de075,_0xccfc('0x53'));}};exports['IsNotLoggedIn']=function(_0x944ea5){if(_0x944ea5<=0x0){return!![];}return![];};exports[_0xccfc('0x54')]=function(_0x2067de,_0x36bb98,_0x1abeeb){_0x2067de[_0xccfc('0x55')]=_0x36bb98;_0x2067de['name']=_0x2067de['queue'];_0x2067de['interface']=_0x2067de[_0xccfc('0x56')];_0x2067de[_0xccfc('0x57')]='voice';if(_0x1abeeb){_0x2067de[_0xccfc('0x58')]=_0x1abeeb[_0xccfc('0x58')];}return _0x2067de;};exports[_0xccfc('0x59')]=function(_0x5c1601){var _0x26328d={};_0x26328d[_0xccfc('0x5a')]=_0x5c1601[_0xccfc('0x5a')];_0x26328d[_0xccfc('0x5b')]=_0x5c1601[_0xccfc('0x56')];_0x26328d[_0xccfc('0x44')]=_0x5c1601[_0xccfc('0x44')];return _0x26328d;};exports[_0xccfc('0x5c')]=function(_0x50d4a4){var _0xdb038c=[];for(var _0x5de9db in _0x50d4a4){if(_0x50d4a4[_0xccfc('0x30')](_0x5de9db)){if(!_[_0xccfc('0x14')](_0x50d4a4[_0x5de9db])&&_0x50d4a4[_0x5de9db]['state']===_0xccfc('0x5d')&&_0x50d4a4[_0x5de9db]['status']===_0xccfc('0x5e')){_0xdb038c['push'](_0x50d4a4[_0x5de9db]['id']);}}}return _0xdb038c;};exports[_0xccfc('0x5f')]=function(_0x32115d){var _0x2e9683=moment()[_0xccfc('0x5')](0x0);var _0xbdf162=moment(_0x32115d)[_0xccfc('0x5')](0x0);return _0x2e9683[_0xccfc('0x60')](_0xbdf162,_0xccfc('0x6'));};exports[_0xccfc('0x61')]=function(_0x2f3e73){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2f3e73[_0xccfc('0x1a')],'ListId':_0x2f3e73[_0xccfc('0x51')],'VoiceQueueId':_0x2f3e73[_0xccfc('0x1c')]||undefined,'CampaignId':_0x2f3e73[_0xccfc('0x62')]||undefined};};exports[_0xccfc('0x63')]=function(_0x57f18e){if(_0x57f18e===_0xccfc('0x44')||_0x57f18e==='idContact'||_0x57f18e===_0xccfc('0x5a')||_0x57f18e===_0xccfc('0x64')||_0x57f18e==='campaigntype'||_0x57f18e===_0xccfc('0x65')||_0x57f18e==='membername'||_0x57f18e===_0xccfc('0x56')||_0x57f18e===_0xccfc('0x18')||_0x57f18e===_0xccfc('0x4e')||_0x57f18e===_0xccfc('0x19')||_0x57f18e===_0xccfc('0x66')||_0x57f18e==='countbusyretry'||_0x57f18e===_0xccfc('0x67')||_0x57f18e===_0xccfc('0x68')||_0x57f18e===_0xccfc('0x69')||_0x57f18e===_0xccfc('0x6a')||_0x57f18e==='callbackuniqueid'||_0x57f18e===_0xccfc('0x6b')||_0x57f18e===_0xccfc('0x6c')||_0x57f18e===_0xccfc('0x1a')||_0x57f18e===_0xccfc('0x51')||_0x57f18e===_0xccfc('0x3e')||_0x57f18e===_0xccfc('0x1c')||_0x57f18e===_0xccfc('0x6d')||_0x57f18e===_0xccfc('0x6e')||_0x57f18e==='xmd-queue'||_0x57f18e===_0xccfc('0x6f')||_0x57f18e===_0xccfc('0x70')||_0x57f18e==='xmd-dialurl'||_0x57f18e==='xmd-dialtimeout'||_0x57f18e===_0xccfc('0x71')||_0x57f18e===_0xccfc('0x72')||_0x57f18e===_0xccfc('0x73')||_0x57f18e===_0xccfc('0x74')||_0x57f18e===_0xccfc('0x75')||_0x57f18e==='xmd-callerid'||_0x57f18e===_0xccfc('0x76')||_0x57f18e==='xmd-agi'||_0x57f18e==='rtpaudioqos'||_0x57f18e===_0xccfc('0x77')||_0x57f18e===_0xccfc('0x78')||_0x57f18e===_0xccfc('0x79')||_0x57f18e===_0xccfc('0x7a')||_0x57f18e===_0xccfc('0x7b')||_0x57f18e===_0xccfc('0x7c')||_0x57f18e===_0xccfc('0x7d')||_0x57f18e==='rtpaudioqos'||_0x57f18e===_0xccfc('0x77')||_0x57f18e===_0xccfc('0x78')||_0x57f18e==='rtpaudioqosjitterbridged'||_0x57f18e===_0xccfc('0x7a')||_0x57f18e===_0xccfc('0x7b')||_0x57f18e==='rtpaudioqosrtt'||_0x57f18e===_0xccfc('0x7d')||_0x57f18e==='bridgepeer'||_0x57f18e===_0xccfc('0x7e')||_0x57f18e===_0xccfc('0x3f')||_0x57f18e==='statedesc'){return![];}return!![];};exports[_0xccfc('0x7f')]=function(_0x3b3992,_0xbebbed){var _0x37b59f,_0x50cace,_0x4f2572;if(_0xbebbed<=0x0){_0xbebbed=0x1;}_0x37b59f=new RegExp(_0xccfc('0x80')+_0xbebbed+'}$');_0x50cace=Math[_0xccfc('0x81')](0xa,_0xbebbed-0x1);_0x4f2572=Math[_0xccfc('0x81')](0xa,_0xbebbed)-0x1;return util[_0xccfc('0x11')]('%s',_['replace'](_0x3b3992,_0x37b59f,_[_0xccfc('0x82')](_0x50cace,_0x4f2572)));};exports[_0xccfc('0x83')]=function(_0x27fb7d){var _0x1bcdab=_0x27fb7d[_0xccfc('0x84')](/"(.*?)"/);return _0x1bcdab?_0x1bcdab[0x1]:_0x27fb7d;};exports['extractCalleridNumber']=function(_0x5a1e){var _0x9c6ac6=_0x5a1e[_0xccfc('0x84')](/<(.*?)>/);return _0x9c6ac6?_0x9c6ac6[0x1]:_0x5a1e;}; \ No newline at end of file +var _0xaed1=['totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','Global','active','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','queue','motionChannel','voice','mandatoryDisposition','agentReadyId','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','logger','info','inspect','loggerError','error','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','calleridname','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout'];(function(_0x176018,_0x578511){var _0x1583ea=function(_0x14af72){while(--_0x14af72){_0x176018['push'](_0x176018['shift']());}};_0x1583ea(++_0x578511);}(_0xaed1,0x1e3));var _0x1aed=function(_0x2cd9e8,_0x3520ed){_0x2cd9e8=_0x2cd9e8-0x0;var _0x2f712f=_0xaed1[_0x2cd9e8];return _0x2f712f;};'use strict';var util=require(_0x1aed('0x0'));var _=require(_0x1aed('0x1'));var moment=require(_0x1aed('0x2'));var logger=require('../../../../config/logger')(_0x1aed('0x3'));var ipAgi=process[_0x1aed('0x4')]['XCALLY_IP_AGI']||_0x1aed('0x5');function getSeconds(_0x77cd95,_0x4576f1){var _0x122522=moment(_0x77cd95)[_0x1aed('0x6')](0x0);var _0x379144=moment(_0x4576f1)[_0x1aed('0x6')](0x0);return _0x122522[_0x1aed('0x7')](_0x379144,_0x1aed('0x8'));}exports[_0x1aed('0x9')]=function(_0x228d26){return function(_0x2441ce){logger['error'](_0x228d26,util['inspect'](_0x2441ce,{'showHidden':![],'depth':null}));};};exports[_0x1aed('0xa')]=function(_0x3e2db4,_0x5376c2){logger[_0x1aed('0xb')](_0x3e2db4,util[_0x1aed('0xc')](_0x5376c2,{'showHidden':![],'depth':null}));};exports[_0x1aed('0xd')]=function(_0x372892,_0x221cee){logger[_0x1aed('0xe')](_0x372892,util['inspect'](_0x221cee,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x321a76){return function(_0x47182e){logger[_0x1aed('0xb')](_0x321a76,util[_0x1aed('0xc')](_0x47182e,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x5d272e,_0x3ece6c,_0x43b4a6){return{'message':_0x5d272e,'unlock':_0x3ece6c,'active':_0x43b4a6};};exports[_0x1aed('0xf')]=function(_0x42c132,_0x34dfd8,_0x19933c){if(!_[_0x1aed('0x10')](_0x19933c)&&_0x1aed('0x11')===typeof _0x19933c&&!_[_0x1aed('0x12')](_0x19933c)){if(!_[_0x1aed('0x10')](_0x34dfd8)&&_0x1aed('0x11')===typeof _0x34dfd8&&!_[_0x1aed('0x12')](_0x34dfd8)){return util[_0x1aed('0x13')](_0x1aed('0x14'),_0x34dfd8,_0x19933c);}return util['format'](_0x1aed('0x14'),_0x19933c,_0x19933c);}if(!_[_0x1aed('0x10')](_0x42c132)&&_0x1aed('0x11')===typeof _0x42c132&&!_['isEmpty'](_0x42c132)){return _0x42c132;}return _0x1aed('0x15');};exports['isActive']=function(_0x5cdd67){if(_['isNil'](_0x5cdd67)){return![];}return _0x5cdd67;};exports[_0x1aed('0x16')]=function(_0x3d32f8,_0x5334ec,_0x2db84c,_0x5f1685,_0x1fa72b,_0x821fba){var _0x5a1a1b={'XMD-QUEUE':_0x5334ec[_0x1aed('0x17')]?_0x5334ec['Queue'][_0x1aed('0x18')]:'','XMD-CALLERID':_0x5f1685,'XMD-CALLERID-PREVIEW':_0x821fba?util[_0x1aed('0x13')]('\x22%s\x22\x20<%s>',_0x821fba[_0x1aed('0x19')],_0x821fba['calleridnum']):_0x5f1685,'XMD-DIALID':_0x1fa72b,'XMD-CONTACTID':_0x5334ec[_0x1aed('0x1a')],'XMD-CDRTYPE':_0x1aed('0x1b'),'CALLERID(all)':_0x5f1685,'XMD-VOICEQUEUEID':_0x5334ec['VoiceQueueId'],'XMD-DIALCHANNEL':_0x2db84c,'XMD-DIALTIMEOUT':_0x3d32f8['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x1aed('0x13')](_0x1aed('0x1c'),_0x3d32f8[_0x1aed('0x1d')]?'g':'',_[_0x1aed('0x12')](_0x3d32f8[_0x1aed('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3d32f8[_0x1aed('0x1f')]||'','XMD-AGI':_0x3d32f8[_0x1aed('0x20')]?util[_0x1aed('0x13')](_0x1aed('0x21'),ipAgi,_0x3d32f8[_0x1aed('0x20')]):_0x1aed('0x22'),'XMD-AGIAFTER':_0x3d32f8[_0x1aed('0x1d')]?util[_0x1aed('0x13')](_0x1aed('0x21'),ipAgi,_0x3d32f8[_0x1aed('0x1d')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x821fba?_0x821fba[_0x1aed('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x821fba?_0x821fba[_0x1aed('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x1aed('0x25')};if(!_[_0x1aed('0x12')](_0x3d32f8[_0x1aed('0x1e')])){_0x5a1a1b[util[_0x1aed('0x13')]('%s',_0x1aed('0x26'))]=_0x3d32f8[_0x1aed('0x1e')];_0x5a1a1b[util[_0x1aed('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1fa72b;}if(_0x5334ec&&_0x5334ec[_0x1aed('0x27')]){for(var _0x163e4d in _0x5334ec[_0x1aed('0x27')]){if(_0x5334ec[_0x1aed('0x27')][_0x1aed('0x28')](_0x163e4d)){if(!_[_0x1aed('0x29')](_0x5334ec[_0x1aed('0x27')][_0x163e4d])&&_0x163e4d!=='id'&&_0x163e4d!==_0x1aed('0x2a')&&_0x163e4d!==_0x1aed('0x2b')&&_0x163e4d!==_0x1aed('0x2c')){_0x5a1a1b[util['format'](_0x1aed('0x2d'),_0x1aed('0x2e'),_['toUpper'](_0x163e4d))]=_0x5334ec['Contact'][_0x163e4d];}}}}return _0x5a1a1b;};exports['toLowerVariables']=function(_0x900085){var _0x196c69={};for(var _0x2eb690 in _0x900085){if(_0x900085[_0x1aed('0x28')](_0x2eb690)){_0x196c69[util[_0x1aed('0x13')]('%s',_[_0x1aed('0x2f')](_0x2eb690))]=_0x900085[_0x2eb690];}}return{'variables':_0x196c69};};exports[_0x1aed('0x30')]=function(_0x484f8d,_0xf38466){if(!_['isNil'](_0x484f8d)){if(_0x484f8d[_0x1aed('0x28')](_0x1aed('0x31'))){if(_0x484f8d[_0x1aed('0x31')]>0x0){_0x484f8d['originated']-=0x1;}else{logger['error'](_0x1aed('0x32'),_0xf38466);}}}else{logger['error'](_0x1aed('0x33'),_0xf38466);}};exports[_0x1aed('0x34')]=function(_0x5b0fde){var _0x12bee1=moment()[_0x1aed('0x13')](_0x1aed('0x35'));_0x5b0fde['state']=0xd;_0x5b0fde[_0x1aed('0x36')]=_0x1aed('0x37');_0x5b0fde[_0x1aed('0x38')]=_0x12bee1;_0x5b0fde[_0x1aed('0x39')]=_0x12bee1;_0x5b0fde[_0x1aed('0x3a')]=_0x12bee1;};exports[_0x1aed('0x3b')]=function(_0x1332ed,_0x3deaab,_0x7e5d8f){var _0x257758=moment()[_0x1aed('0x13')](_0x1aed('0x35'));_0x1332ed[_0x1aed('0x3c')]=_0x3deaab;_0x1332ed[_0x1aed('0x36')]=_0x7e5d8f;_0x1332ed[_0x1aed('0x39')]=_0x257758;_0x1332ed[_0x1aed('0x3d')]=getSeconds(_0x1332ed['responsetime'],_0x1332ed[_0x1aed('0x38')]);};exports[_0x1aed('0x3e')]=function(_0x331b4c,_0x47fbcc,_0x4d32d1){_0x331b4c['membername']=_0x47fbcc;_0x331b4c[_0x1aed('0x3f')]=_0x4d32d1;};exports[_0x1aed('0x40')]=function(_0x5bf364,_0x25368b,_0x4fc7d5){var _0x1df64d=moment()['format'](_0x1aed('0x35'));_0x5bf364[_0x1aed('0x3c')]=_0x25368b;_0x5bf364[_0x1aed('0x36')]=_0x4fc7d5;_0x5bf364[_0x1aed('0x39')]=_0x5bf364[_0x1aed('0x39')]?_0x5bf364[_0x1aed('0x39')]:_0x1df64d;_0x5bf364[_0x1aed('0x3a')]=_0x5bf364['endtime']?_0x5bf364[_0x1aed('0x3a')]:_0x1df64d;_0x5bf364[_0x1aed('0x3d')]=getSeconds(_0x5bf364['responsetime']||0x0,_0x5bf364[_0x1aed('0x38')]||0x0);_0x5bf364[_0x1aed('0x41')]=_0x5bf364[_0x1aed('0x42')]?getSeconds(_0x5bf364[_0x1aed('0x3a')],_0x5bf364[_0x1aed('0x42')]):0x0;};exports['isFailure']=function(_0x419600){return _0x419600===_0x1aed('0x43');};exports[_0x1aed('0x44')]=function(_0xce90f7,_0xb4c03e,_0x3ef365,_0x1f1846,_0x26ca24){var _0x374d1a=_0x1f1846?_0x1aed('0x45'):_0xce90f7[_0x1aed('0x19')];_0x374d1a=_0x26ca24?'BOOKED':_0x374d1a;return{'actionid':_0xce90f7[_0x1aed('0x46')],'action':_0x1aed('0x47'),'channel':_0xce90f7[_0x1aed('0x48')],'callerid':util[_0x1aed('0x13')]('\x22%s\x22\x20<%s>',_0x374d1a,_0xce90f7[_0x1aed('0x49')]),'Exten':_0x1aed('0x4a'),'Context':_0x1aed('0x4b'),'Priority':'1','variable':_0x3ef365,'timeout':(_0xb4c03e[_0x1aed('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0xce90f7['uniqueid']};};exports[_0x1aed('0x4d')]=function(_0x3bb469){return _0x3bb469[_0x1aed('0x4e')]+_0x3bb469[_0x1aed('0x4f')]+_0x3bb469['countnoanswerretry']+_0x3bb469[_0x1aed('0x50')]+_0x3bb469[_0x1aed('0x51')];};exports['cloneAction']=function(_0x331dc2){var _0x406ecc=_['clone'](_0x331dc2);_0x406ecc[_0x1aed('0x3c')]=0xf;_0x406ecc[_0x1aed('0x36')]=_0x1aed('0x52');return _0x406ecc;};exports['scheduledAt']=function(_0x1fda53,_0x29eaaa,_0x5ea238){var _0x6d401={};_0x6d401[_0x29eaaa]=_0x1fda53[_0x29eaaa];_0x6d401[_0x1aed('0x53')]=![];_0x6d401['scheduledat']=moment()['add'](_0x5ea238,_0x1aed('0x54'))[_0x1aed('0x13')](_0x1aed('0x35'));_0x6d401[_0x1aed('0x1a')]=_0x1fda53[_0x1aed('0x1a')];_0x6d401[_0x1aed('0x55')]=_0x1fda53['ListId'];_0x6d401[_0x1aed('0x56')]=_0x1fda53[_0x1aed('0x56')]||undefined;return _0x6d401;};exports[_0x1aed('0x57')]=function(_0x577f5b,_0x522772){if(!_[_0x1aed('0x29')](_0x577f5b)){if(_0x577f5b[_0x1aed('0x58')]>0x0){_0x577f5b['pTalking']-=0x1;}else{logger[_0x1aed('0xe')](_0x522772,_0x1aed('0x59'));}}else{logger[_0x1aed('0xe')](_0x522772,_0x1aed('0x5a'));}};exports['IsNotLoggedIn']=function(_0xf2b6db){if(_0xf2b6db<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4e361a,_0x1f2694,_0x514292){_0x4e361a['lastevent']=_0x1f2694;_0x4e361a[_0x1aed('0x18')]=_0x4e361a[_0x1aed('0x5b')];_0x4e361a['interface']=_0x4e361a[_0x1aed('0x48')];_0x4e361a[_0x1aed('0x5c')]=_0x1aed('0x5d');if(_0x514292){_0x4e361a[_0x1aed('0x5e')]=_0x514292[_0x1aed('0x5e')];}return _0x4e361a;};exports['buildAcw']=function(_0x5ad75d){var _0x28b9fb={};_0x28b9fb[_0x1aed('0x5b')]=_0x5ad75d[_0x1aed('0x5b')];_0x28b9fb['interface']=_0x5ad75d['channelAgent'];_0x28b9fb[_0x1aed('0x46')]=_0x5ad75d[_0x1aed('0x46')];return _0x28b9fb;};exports[_0x1aed('0x5f')]=function(_0x44b3c4){var _0x2b9570=[];for(var _0x4b901c in _0x44b3c4){if(_0x44b3c4[_0x1aed('0x28')](_0x4b901c)){if(!_[_0x1aed('0x29')](_0x44b3c4[_0x4b901c])&&_0x44b3c4[_0x4b901c]['state']==='not_inuse'&&_0x44b3c4[_0x4b901c][_0x1aed('0x60')]===_0x1aed('0x61')){_0x2b9570[_0x1aed('0x62')](_0x44b3c4[_0x4b901c]['id']);}}}return _0x2b9570;};exports[_0x1aed('0x63')]=function(_0x2db52f){var _0x1c73c9=moment()[_0x1aed('0x6')](0x0);var _0x1ecaf6=moment(_0x2db52f)[_0x1aed('0x6')](0x0);return _0x1c73c9[_0x1aed('0x7')](_0x1ecaf6,_0x1aed('0x8'));};exports[_0x1aed('0x64')]=function(_0x3d0a50){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3d0a50['ContactId'],'ListId':_0x3d0a50[_0x1aed('0x55')],'VoiceQueueId':_0x3d0a50['VoiceQueueId']||undefined,'CampaignId':_0x3d0a50[_0x1aed('0x65')]||undefined};};exports[_0x1aed('0x66')]=function(_0x15bf41){if(_0x15bf41==='uniqueid'||_0x15bf41===_0x1aed('0x67')||_0x15bf41==='queue'||_0x15bf41===_0x1aed('0x68')||_0x15bf41===_0x1aed('0x69')||_0x15bf41==='dialAnswer'||_0x15bf41==='membername'||_0x15bf41===_0x1aed('0x48')||_0x15bf41===_0x1aed('0x19')||_0x15bf41===_0x1aed('0x53')||_0x15bf41===_0x1aed('0x49')||_0x15bf41===_0x1aed('0x6a')||_0x15bf41==='countbusyretry'||_0x15bf41===_0x1aed('0x4f')||_0x15bf41===_0x1aed('0x6b')||_0x15bf41===_0x1aed('0x6c')||_0x15bf41==='callback'||_0x15bf41===_0x1aed('0x6d')||_0x15bf41===_0x1aed('0x6e')||_0x15bf41===_0x1aed('0x6f')||_0x15bf41===_0x1aed('0x1a')||_0x15bf41==='ListId'||_0x15bf41==='UserId'||_0x15bf41===_0x1aed('0x56')||_0x15bf41===_0x1aed('0x70')||_0x15bf41===_0x1aed('0x71')||_0x15bf41===_0x1aed('0x72')||_0x15bf41===_0x1aed('0x73')||_0x15bf41===_0x1aed('0x74')||_0x15bf41===_0x1aed('0x75')||_0x15bf41===_0x1aed('0x76')||_0x15bf41==='xmd-dialoptions'||_0x15bf41==='xmd-dialid'||_0x15bf41==='xmd-dialchannel'||_0x15bf41===_0x1aed('0x77')||_0x15bf41===_0x1aed('0x78')||_0x15bf41===_0x1aed('0x79')||_0x15bf41===_0x1aed('0x7a')||_0x15bf41==='xmd-agi'||_0x15bf41===_0x1aed('0x7b')||_0x15bf41===_0x1aed('0x7c')||_0x15bf41===_0x1aed('0x7d')||_0x15bf41===_0x1aed('0x7e')||_0x15bf41==='rtpaudioqosloss'||_0x15bf41==='rtpaudioqoslossbridged'||_0x15bf41===_0x1aed('0x7f')||_0x15bf41==='rtpaudioqosrttbridged'||_0x15bf41==='rtpaudioqos'||_0x15bf41==='rtpaudioqosbridged'||_0x15bf41===_0x1aed('0x7d')||_0x15bf41==='rtpaudioqosjitterbridged'||_0x15bf41===_0x1aed('0x80')||_0x15bf41===_0x1aed('0x81')||_0x15bf41===_0x1aed('0x7f')||_0x15bf41===_0x1aed('0x82')||_0x15bf41===_0x1aed('0x83')||_0x15bf41===_0x1aed('0x84')||_0x15bf41===_0x1aed('0x3c')||_0x15bf41===_0x1aed('0x36')){return![];}return!![];};exports[_0x1aed('0x85')]=function(_0x557357,_0x98ceb4){var _0x2b4e93,_0x536afe,_0x3a8d9f;if(_0x98ceb4<=0x0){_0x98ceb4=0x1;}_0x2b4e93=new RegExp(_0x1aed('0x86')+_0x98ceb4+'}$');_0x536afe=Math[_0x1aed('0x87')](0xa,_0x98ceb4-0x1);_0x3a8d9f=Math[_0x1aed('0x87')](0xa,_0x98ceb4)-0x1;return util['format']('%s',_[_0x1aed('0x88')](_0x557357,_0x2b4e93,_[_0x1aed('0x89')](_0x536afe,_0x3a8d9f)));};exports['extractCalleridName']=function(_0x1563c0){var _0x4382ae=_0x1563c0[_0x1aed('0x8a')](/"(.*?)"/);return _0x4382ae?_0x4382ae[0x1]:_0x1563c0;};exports[_0x1aed('0x8b')]=function(_0x4c243d){var _0x39373b=_0x4c243d[_0x1aed('0x8a')](/<(.*?)>/);return _0x39373b?_0x39373b[0x1]:_0x4c243d;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 130d797..7159801 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 _0x7f3e=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean','queuepause','voicequeuechannel'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x7f3e,0x93));var _0xe7f3=function(_0x2aad4c,_0x2123d7){_0x2aad4c=_0x2aad4c-0x0;var _0x31e080=_0x7f3e[_0x2aad4c];return _0x31e080;};'use strict';exports[_0xe7f3('0x0')]={'queue':{'type':_0xe7f3('0x1'),'required':!![]},'interface':{'type':_0xe7f3('0x1'),'required':!![]},'membername':{'type':_0xe7f3('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xe7f3('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0xe7f3('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xe7f3('0x3')]={'interface':{'type':_0xe7f3('0x1'),'required':!![]},'paused':{'type':_0xe7f3('0x2')},'reason':{'type':_0xe7f3('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xe7f3('0x1'),'required':![]}};exports[_0xe7f3('0x4')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xe7f3('0x5')]={'uniqueid':{'type':_0xe7f3('0x1'),'required':!![]},'filename':{'type':_0xe7f3('0x1')},'format':{'type':_0xe7f3('0x1')},'mixmonitorid':{'type':_0xe7f3('0x1')}};exports[_0xe7f3('0x6')]={'uniqueid':{'type':_0xe7f3('0x1'),'required':!![]}};exports[_0xe7f3('0x7')]={'uniqueid':{'type':_0xe7f3('0x1'),'required':!![]},'exten':{'type':_0xe7f3('0x1'),'required':!![]},'context':{'type':_0xe7f3('0x1')}}; \ No newline at end of file +var _0x936d=['voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel'];(function(_0x13b59b,_0x4b6df4){var _0xb43cc0=function(_0x4c1743){while(--_0x4c1743){_0x13b59b['push'](_0x13b59b['shift']());}};_0xb43cc0(++_0x4b6df4);}(_0x936d,0x160));var _0xd936=function(_0x44ea05,_0x1019fc){_0x44ea05=_0x44ea05-0x0;var _0x11953c=_0x936d[_0x44ea05];return _0x11953c;};'use strict';exports[_0xd936('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd936('0x1'),'required':!![]},'membername':{'type':_0xd936('0x1'),'required':!![]},'penalty':{'type':_0xd936('0x2'),'required':![]},'paused':{'type':_0xd936('0x3'),'required':![]}};exports[_0xd936('0x4')]={'queue':{'type':_0xd936('0x1'),'required':!![]},'interface':{'type':_0xd936('0x1'),'required':!![]}};exports[_0xd936('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0xd936('0x6')]={'module':{'type':'string','required':![]}};exports[_0xd936('0x7')]={'uniqueid':{'type':_0xd936('0x1'),'required':!![]}};exports[_0xd936('0x8')]={'uniqueid':{'type':_0xd936('0x1'),'required':!![]},'filename':{'type':_0xd936('0x1')},'format':{'type':_0xd936('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0xd936('0x9')]={'uniqueid':{'type':_0xd936('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xd936('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index becb659..8e82c42 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 _0x1a56=['faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','SIP/%s','total','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','isUndefined','length','initTrunks','initVoiceQueues','initTemplates','templates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','merge','initVoiceQueueReports','queuecallerexit','unmanaged','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerleaveAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','bluebird','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts'];(function(_0x353abb,_0x194c80){var _0x43c9c5=function(_0x456b74){while(--_0x456b74){_0x353abb['push'](_0x353abb['shift']());}};_0x43c9c5(++_0x194c80);}(_0x1a56,0x178));var _0x61a5=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x1a56[_0x695b76];return _0x1dc21f;};'use strict';var BPromise=require(_0x61a5('0x0'));var util=require(_0x61a5('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x61a5('0x2'));var Trunk=require(_0x61a5('0x3'));var VoiceQueue=require(_0x61a5('0x4'));var Trigger=require(_0x61a5('0x5'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x61a5('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x61a5('0x7'));var SugarcrmAccount=require(_0x61a5('0x8'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x61a5('0x9'));var VtigerAccount=require(_0x61a5('0xa'));var ServicenowAccount=require(_0x61a5('0xb'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x61a5('0xc'));var FaxAccount=require(_0x61a5('0xd'));var Realtime=function(){this[_0x61a5('0xe')]={};this[_0x61a5('0xf')]={};this[_0x61a5('0x10')]={};this[_0x61a5('0x11')]={};this[_0x61a5('0x12')]={};this['campaigns']={};this['templates']={};this[_0x61a5('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x61a5('0x14')]={};this[_0x61a5('0x15')]={};this[_0x61a5('0x16')]={};this[_0x61a5('0x17')]={};this[_0x61a5('0x18')]={};this[_0x61a5('0x19')]={};this[_0x61a5('0x1a')]={};this[_0x61a5('0x1b')]={};this[_0x61a5('0x1c')]={};this[_0x61a5('0x1d')]={};this[_0x61a5('0x1e')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x61a5('0x1f')]={};this['freshsalesAccounts']={};this[_0x61a5('0x20')]={};};function freeIsNotKey(_0x30ebba,_0x1f74ad,_0x3971ef){var _0x32e1f3=_[_0x61a5('0x21')](_0x30ebba,function(_0x732e2b,_0x366171){return _0x732e2b[_0x3971ef];});for(var _0x45dd90 in _0x1f74ad){if(_0x1f74ad[_0x61a5('0x22')](_0x45dd90)){if(!_0x32e1f3[_0x45dd90]){delete _0x1f74ad[_0x45dd90];}}}}function freeIsNotKeySip(_0x3569f8,_0xc9c565){var _0x349a92=_['mapKeys'](_0x3569f8,function(_0x52fb66,_0x3e5681){return util[_0x61a5('0x23')]('SIP/%s',_0x52fb66[_0x61a5('0x24')]);});for(var _0x4652aa in _0xc9c565){if(_0xc9c565[_0x61a5('0x22')](_0x4652aa)){if(!_0x349a92[_0x4652aa]){delete _0xc9c565[_0x4652aa];}}}}function freeIsNotKeyAgent(_0x3a9fd3,_0x20a076){var _0x2ccc9e=_[_0x61a5('0x21')](_0x3a9fd3,function(_0x1d5741,_0x2c9da2){var _0x22e9bb=_[_0x61a5('0x25')](_0x1d5741[_0x61a5('0x26')])?util['format'](_0x61a5('0x27'),_0x1d5741[_0x61a5('0x24')]):_0x1d5741[_0x61a5('0x26')];return _0x22e9bb;});for(var _0x310435 in _0x20a076){if(_0x20a076[_0x61a5('0x22')](_0x310435)){if(!_0x2ccc9e[_0x310435]){delete _0x20a076[_0x310435];}}}}function clearVoiceCallReports(_0x4c01d0){_0x4c01d0[_0x61a5('0x28')]=0x0;_0x4c01d0[_0x61a5('0x29')]=0x0;_0x4c01d0['sumHoldTime']=0x0;_0x4c01d0[_0x61a5('0x2a')]=0x0;_0x4c01d0[_0x61a5('0x2b')]=0x0;}function clearCampaigns(_0x59e9ae){if(!_[_0x61a5('0x2c')](_0x59e9ae)){for(var _0x1827f6 in _0x59e9ae){if(_0x59e9ae[_0x61a5('0x22')](_0x1827f6)){_0x59e9ae[_0x1827f6][_0x61a5('0x2d')]=0x0;_0x59e9ae[_0x1827f6][_0x61a5('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x4d408a){if(!_[_0x61a5('0x2c')](_0x4d408a)){for(var _0x4f77b0 in _0x4d408a){if(_0x4d408a[_0x61a5('0x22')](_0x4f77b0)){_0x4d408a[_0x4f77b0][_0x61a5('0x28')]=0x0;_0x4d408a[_0x4f77b0]['answered']=0x0;_0x4d408a[_0x4f77b0]['unmanaged']=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x2f')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x30')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x2a')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x2b')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x31')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x32')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x33')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x34')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x35')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x36')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x37')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x38')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x39')]=0x0;_0x4d408a[_0x4f77b0]['outboundOriginateFailureCallsDay']=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x3a')]=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x3b')]=0x0;_0x4d408a[_0x4f77b0]['outboundAnswerAgiCallsDay']=0x0;_0x4d408a[_0x4f77b0][_0x61a5('0x3c')]=0x0;_0x4d408a[_0x4f77b0]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x61a5('0x3d')]=function(_0xedc20,_0x52c28a){for(var _0xe8b288 in _0x52c28a){if(_0xedc20[_0x61a5('0x22')](_0xe8b288)){_0xedc20[_0xe8b288]=_0x52c28a[_0xe8b288];}}};Realtime[_0x61a5('0x3e')]['initAgents']=function(){var _0x3b7aa7=this;return function(_0x5ec773){if(_0x5ec773){freeIsNotKeyAgent(_0x5ec773,_0x3b7aa7[_0x61a5('0xe')]);for(var _0x3e402e=0x0,_0x10ce16={},_0x2c4228={};_0x3e402e<_0x5ec773['length'];_0x3e402e+=0x1){_0x10ce16=_0x5ec773[_0x3e402e];var _0x334f53=_['isNil'](_0x10ce16[_0x61a5('0x26')])?util[_0x61a5('0x23')]('SIP/%s',_0x10ce16[_0x61a5('0x24')]):_0x10ce16['interface'];if(_[_0x61a5('0x3f')](_0x3b7aa7[_0x61a5('0xe')][_0x334f53])){_0x3b7aa7['agents'][_0x334f53]=new Agent(_0x10ce16);}else{_0x3b7aa7['mergeFromDatabase'](_0x3b7aa7[_0x61a5('0xe')][_0x334f53],_0x10ce16);}}}return _0x3b7aa7[_0x61a5('0xe')];};};Realtime[_0x61a5('0x3e')]['initTelephones']=function(){var _0x54fed2=this;return function(_0x8d2edc){if(_0x8d2edc){freeIsNotKeySip(_0x8d2edc,_0x54fed2[_0x61a5('0xf')]);for(var _0xdd940=0x0,_0x278f5a={},_0xed7905={};_0xdd940<_0x8d2edc[_0x61a5('0x40')];_0xdd940+=0x1){_0x278f5a=_0x8d2edc[_0xdd940];if(_[_0x61a5('0x3f')](_0x54fed2[_0x61a5('0xf')][util[_0x61a5('0x23')]('SIP/%s',_0x278f5a[_0x61a5('0x24')])])){_0x54fed2['telephones'][util[_0x61a5('0x23')]('SIP/%s',_0x278f5a[_0x61a5('0x24')])]=new Telephone(_0x278f5a);}else{_0x54fed2[_0x61a5('0x3d')](_0x54fed2['telephones'][util['format'](_0x61a5('0x27'),_0x278f5a[_0x61a5('0x24')])],_0x278f5a);}}}return _0x54fed2[_0x61a5('0xf')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x41')]=function(){var _0x1dd92e=this;return function(_0x4403f1){if(_0x4403f1){freeIsNotKeySip(_0x4403f1,_0x1dd92e[_0x61a5('0x10')]);for(var _0x3aac81=0x0,_0x1f4b52={},_0x69bd5a={};_0x3aac81<_0x4403f1[_0x61a5('0x40')];_0x3aac81+=0x1){_0x1f4b52=_0x4403f1[_0x3aac81];if(_[_0x61a5('0x3f')](_0x1dd92e['trunks'][util[_0x61a5('0x23')](_0x61a5('0x27'),_0x1f4b52[_0x61a5('0x24')])])){_0x1dd92e['trunks'][util[_0x61a5('0x23')](_0x61a5('0x27'),_0x1f4b52[_0x61a5('0x24')])]=new Trunk(_0x1f4b52);}else{_0x1dd92e[_0x61a5('0x3d')](_0x1dd92e[_0x61a5('0x10')][util[_0x61a5('0x23')]('SIP/%s',_0x1f4b52[_0x61a5('0x24')])],_0x1f4b52);}}}return _0x1dd92e[_0x61a5('0x10')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x42')]=function(){var _0x126947=this;return function(_0x3203cb){if(_0x3203cb){freeIsNotKey(_0x3203cb,_0x126947[_0x61a5('0x11')],_0x61a5('0x24'));for(var _0x3d6061=0x0,_0x2a8bfb={},_0x468f8f={};_0x3d6061<_0x3203cb['length'];_0x3d6061+=0x1){_0x2a8bfb=_0x3203cb[_0x3d6061];if(_[_0x61a5('0x3f')](_0x126947[_0x61a5('0x11')][_0x2a8bfb[_0x61a5('0x24')]])){_0x126947['voiceQueues'][_0x2a8bfb[_0x61a5('0x24')]]=new VoiceQueue(_0x2a8bfb);}else{_0x126947['mergeFromDatabase'](_0x126947[_0x61a5('0x11')][_0x2a8bfb[_0x61a5('0x24')]],_0x2a8bfb);}}}return _0x126947[_0x61a5('0x11')];};};Realtime[_0x61a5('0x3e')]['initTriggers']=function(){var _0x530ef3=this;return function(_0x541e83){if(_0x541e83){freeIsNotKey(_0x541e83,_0x530ef3['triggers'],'id');for(var _0x396ea9=0x0,_0x522ddb={},_0xd0a4ab={};_0x396ea9<_0x541e83[_0x61a5('0x40')];_0x396ea9+=0x1){_0x522ddb=_0x541e83[_0x396ea9];if(_[_0x61a5('0x3f')](_0x530ef3[_0x61a5('0x12')][_0x522ddb['id']])){_0x530ef3['triggers'][_0x522ddb['id']]=new Trigger(_0x522ddb);}else{_0x530ef3[_0x61a5('0x3d')](_0x530ef3[_0x61a5('0x12')][_0x522ddb['id']],_0x522ddb);}}}return _0x530ef3[_0x61a5('0x12')];};};Realtime['prototype'][_0x61a5('0x43')]=function(){var _0x338cf5=this;return function(_0x310270){if(_0x310270){freeIsNotKey(_0x310270,_0x338cf5[_0x61a5('0x44')],'id');for(var _0x19b412=0x0,_0x1f4818={},_0x50a705={};_0x19b412<_0x310270[_0x61a5('0x40')];_0x19b412+=0x1){_0x1f4818=_0x310270[_0x19b412];if(_[_0x61a5('0x3f')](_0x338cf5[_0x61a5('0x44')][_0x1f4818['id']])){_0x338cf5[_0x61a5('0x44')][_0x1f4818['id']]=new Template(_0x1f4818);}else{_0x338cf5[_0x61a5('0x3d')](_0x338cf5['templates'][_0x1f4818['id']],_0x1f4818);}}}return _0x338cf5[_0x61a5('0x44')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x45')]=function(){var _0x5b78a2=this;return function(_0xf053f1){if(_0xf053f1){freeIsNotKey(_0xf053f1,_0x5b78a2[_0x61a5('0x19')],'id');for(var _0x4ad53d=0x0,_0x1edbb2={},_0x2d9238={};_0x4ad53d<_0xf053f1[_0x61a5('0x40')];_0x4ad53d+=0x1){_0x1edbb2=_0xf053f1[_0x4ad53d];if(_[_0x61a5('0x3f')](_0x5b78a2[_0x61a5('0x19')][_0x1edbb2['id']])){_0x5b78a2[_0x61a5('0x19')][_0x1edbb2['id']]=new ZendeskAccount(_0x1edbb2);}else{_0x5b78a2[_0x61a5('0x3d')](_0x5b78a2['zendeskAccounts'][_0x1edbb2['id']],_0x1edbb2);}}}return _0x5b78a2[_0x61a5('0x19')];};};Realtime[_0x61a5('0x3e')]['initSalesforceAccounts']=function(){var _0x361126=this;return function(_0x599589){if(_0x599589){freeIsNotKey(_0x599589,_0x361126[_0x61a5('0x1a')],'id');for(var _0x1e0adf=0x0,_0x15d419={},_0x103507={};_0x1e0adf<_0x599589[_0x61a5('0x40')];_0x1e0adf+=0x1){_0x15d419=_0x599589[_0x1e0adf];if(_[_0x61a5('0x3f')](_0x361126[_0x61a5('0x1a')][_0x15d419['id']])){_0x361126[_0x61a5('0x1a')][_0x15d419['id']]=new SalesforceAccount(_0x15d419);}else{_0x361126[_0x61a5('0x3d')](_0x361126[_0x61a5('0x1a')][_0x15d419['id']],_0x15d419);}}}return _0x361126[_0x61a5('0x1a')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x46')]=function(){var _0x19f892=this;return function(_0x2e5951){if(_0x2e5951){freeIsNotKey(_0x2e5951,_0x19f892[_0x61a5('0x1c')],'id');for(var _0x21ffc5=0x0,_0x44d6f8={},_0xa28013={};_0x21ffc5<_0x2e5951[_0x61a5('0x40')];_0x21ffc5+=0x1){_0x44d6f8=_0x2e5951[_0x21ffc5];if(_['isUndefined'](_0x19f892['freshdeskAccounts'][_0x44d6f8['id']])){_0x19f892[_0x61a5('0x1c')][_0x44d6f8['id']]=new FreshdeskAccount(_0x44d6f8);}else{_0x19f892[_0x61a5('0x3d')](_0x19f892['freshdeskAccounts'][_0x44d6f8['id']],_0x44d6f8);}}}return _0x19f892[_0x61a5('0x1c')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x47')]=function(){var _0x5001a4=this;return function(_0x19783a){if(_0x19783a){freeIsNotKey(_0x19783a,_0x5001a4[_0x61a5('0x1d')],'id');for(var _0x592e9a=0x0,_0x1201ca={},_0x5404e3={};_0x592e9a<_0x19783a[_0x61a5('0x40')];_0x592e9a+=0x1){_0x1201ca=_0x19783a[_0x592e9a];if(_['isUndefined'](_0x5001a4[_0x61a5('0x1d')][_0x1201ca['id']])){_0x5001a4[_0x61a5('0x1d')][_0x1201ca['id']]=new ZohoAccount(_0x1201ca);}else{_0x5001a4[_0x61a5('0x3d')](_0x5001a4[_0x61a5('0x1d')][_0x1201ca['id']],_0x1201ca);}}}return _0x5001a4[_0x61a5('0x1d')];};};Realtime[_0x61a5('0x3e')]['initDeskAccounts']=function(){var _0x5d4c3c=this;return function(_0x387acc){if(_0x387acc){freeIsNotKey(_0x387acc,_0x5d4c3c['deskAccounts'],'id');for(var _0x361d94=0x0,_0x4eacac={},_0x203a01={};_0x361d94<_0x387acc[_0x61a5('0x40')];_0x361d94+=0x1){_0x4eacac=_0x387acc[_0x361d94];if(_['isUndefined'](_0x5d4c3c[_0x61a5('0x1e')][_0x4eacac['id']])){_0x5d4c3c[_0x61a5('0x1e')][_0x4eacac['id']]=new DeskAccount(_0x4eacac);}else{_0x5d4c3c[_0x61a5('0x3d')](_0x5d4c3c[_0x61a5('0x1e')][_0x4eacac['id']],_0x4eacac);}}}return _0x5d4c3c[_0x61a5('0x1e')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x48')]=function(){var _0x5e8acc=this;return function(_0x5cd253){if(_0x5cd253){freeIsNotKey(_0x5cd253,_0x5e8acc[_0x61a5('0x1b')],'id');for(var _0x3a71fa=0x0,_0x5d8a37={},_0x56b088={};_0x3a71fa<_0x5cd253[_0x61a5('0x40')];_0x3a71fa+=0x1){_0x5d8a37=_0x5cd253[_0x3a71fa];if(_[_0x61a5('0x3f')](_0x5e8acc[_0x61a5('0x1b')][_0x5d8a37['id']])){_0x5e8acc[_0x61a5('0x1b')][_0x5d8a37['id']]=new SugarcrmAccount(_0x5d8a37);}else{_0x5e8acc[_0x61a5('0x3d')](_0x5e8acc[_0x61a5('0x1b')][_0x5d8a37['id']],_0x5d8a37);}}}return _0x5e8acc[_0x61a5('0x1b')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x49')]=function(){var _0x49b359=this;return function(_0xd1b0e1){if(_0xd1b0e1){freeIsNotKey(_0xd1b0e1,_0x49b359[_0x61a5('0x4a')],'id');for(var _0x4787a5=0x0,_0x42f20a={},_0x44d356={};_0x4787a5<_0xd1b0e1[_0x61a5('0x40')];_0x4787a5+=0x1){_0x42f20a=_0xd1b0e1[_0x4787a5];if(_[_0x61a5('0x3f')](_0x49b359[_0x61a5('0x4a')][_0x42f20a['id']])){_0x49b359['vtigerAccounts'][_0x42f20a['id']]=new VtigerAccount(_0x42f20a);}else{_0x49b359['mergeFromDatabase'](_0x49b359[_0x61a5('0x4a')][_0x42f20a['id']],_0x42f20a);}}}return _0x49b359[_0x61a5('0x4a')];};};Realtime['prototype'][_0x61a5('0x4b')]=function(){var _0x34dee5=this;return function(_0x285289){if(_0x285289){freeIsNotKey(_0x285289,_0x34dee5[_0x61a5('0x4c')],'id');for(var _0x5cbc5d=0x0,_0xd70393={},_0x213085={};_0x5cbc5d<_0x285289[_0x61a5('0x40')];_0x5cbc5d+=0x1){_0xd70393=_0x285289[_0x5cbc5d];if(_[_0x61a5('0x3f')](_0x34dee5[_0x61a5('0x4c')][_0xd70393['id']])){_0x34dee5[_0x61a5('0x4c')][_0xd70393['id']]=new ServicenowAccount(_0xd70393);}else{_0x34dee5[_0x61a5('0x3d')](_0x34dee5['servicenowAccounts'][_0xd70393['id']],_0xd70393);}}}return _0x34dee5[_0x61a5('0x4c')];};};Realtime[_0x61a5('0x3e')]['initDynamics365Accounts']=function(){var _0x490e22=this;return function(_0x50f1e9){if(_0x50f1e9){freeIsNotKey(_0x50f1e9,_0x490e22['dynamics365Accounts'],'id');for(var _0xcad17=0x0,_0x4e4972={},_0x264462={};_0xcad17<_0x50f1e9[_0x61a5('0x40')];_0xcad17+=0x1){_0x4e4972=_0x50f1e9[_0xcad17];if(_[_0x61a5('0x3f')](_0x490e22['dynamics365Accounts'][_0x4e4972['id']])){_0x490e22['dynamics365Accounts'][_0x4e4972['id']]=new Dynamics365Account(_0x4e4972);}else{_0x490e22['mergeFromDatabase'](_0x490e22['dynamics365Accounts'][_0x4e4972['id']],_0x4e4972);}}}return _0x490e22[_0x61a5('0x1f')];};};Realtime['prototype'][_0x61a5('0x4d')]=function(){var _0x5d20a7=this;return function(_0x8b24be){if(_0x8b24be){freeIsNotKey(_0x8b24be,_0x5d20a7[_0x61a5('0x4e')],'id');for(var _0x308a46=0x0,_0xd9b54b={},_0x38aa37={};_0x308a46<_0x8b24be[_0x61a5('0x40')];_0x308a46+=0x1){_0xd9b54b=_0x8b24be[_0x308a46];if(_['isUndefined'](_0x5d20a7[_0x61a5('0x4e')][_0xd9b54b['id']])){_0x5d20a7[_0x61a5('0x4e')][_0xd9b54b['id']]=new FreshsalesAccount(_0xd9b54b);}else{_0x5d20a7['mergeFromDatabase'](_0x5d20a7[_0x61a5('0x4e')][_0xd9b54b['id']],_0xd9b54b);}}}return _0x5d20a7[_0x61a5('0x4e')];};};Realtime[_0x61a5('0x3e')]['initVoiceQueueHopperHistory']=function(){var _0x4dd1d0=this;return function(_0x470a89){for(var _0x5e4308=0x0;_0x5e4308<_0x470a89[_0x61a5('0x40')];_0x5e4308+=0x1){_[_0x61a5('0x4f')](_0x4dd1d0['voiceQueues'][_0x470a89[_0x5e4308][_0x61a5('0x24')]],_0x470a89[_0x5e4308]);}return _0x4dd1d0['voiceQueues'];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x50')]=function(){var _0x727d1c=this;return function(_0xe6c9ba){clearVoiceQueues(_0x727d1c['voiceQueues']);if(_0xe6c9ba){_0xe6c9ba=_['groupBy'](_0xe6c9ba,'uniqueid');for(var _0x137c56 in _0xe6c9ba){if(_0xe6c9ba[_0x61a5('0x22')](_0x137c56)){var _0x328534={};for(var _0x3c35cd=0x0;_0x3c35cd<_0xe6c9ba[_0x137c56]['length'];_0x3c35cd+=0x1){var _0x397b7b=_0xe6c9ba[_0x137c56][_0x3c35cd]['queue'];if(_0x727d1c[_0x61a5('0x11')][_0x397b7b]){if(_0xe6c9ba[_0x137c56][_0x3c35cd][_0x61a5('0x51')]){_0x727d1c[_0x61a5('0x11')][_0x397b7b][_0x61a5('0x52')]+=0x1;}if(_0xe6c9ba[_0x137c56][_0x3c35cd][_0x61a5('0x53')]){_0x727d1c[_0x61a5('0x11')][_0x397b7b][_0x61a5('0x2f')]+=0x1;}_0x727d1c[_0x61a5('0x11')][_0x397b7b][_0x61a5('0x30')]+=moment(_0xe6c9ba[_0x137c56][_0x3c35cd]['queuecallerleaveAt'])[_0x61a5('0x54')](moment(_0xe6c9ba[_0x137c56][_0x3c35cd][_0x61a5('0x55')]),_0x61a5('0x56'))||0x0;if(_0x3c35cd===_0xe6c9ba[_0x137c56][_0x61a5('0x40')]-0x1){_0x727d1c[_0x61a5('0x11')][_0x397b7b][_0x61a5('0x2a')]+=moment(_0xe6c9ba[_0x137c56][_0x3c35cd][_0x61a5('0x57')]||_0xe6c9ba[_0x137c56][_0x3c35cd][_0x61a5('0x58')]||_0xe6c9ba[_0x137c56][_0x3c35cd][_0x61a5('0x59')])[_0x61a5('0x54')](moment(_0xe6c9ba[_0x137c56][_0x3c35cd]['queuecallerjoinAt']),_0x61a5('0x56'))||0x0;_0x727d1c[_0x61a5('0x11')][_0x397b7b][_0x61a5('0x28')]+=0x1;if(_0xe6c9ba[_0x137c56][_0x3c35cd]['queuecallercomplete']){_0x727d1c['voiceQueues'][_0x397b7b][_0x61a5('0x29')]+=0x1;_0x727d1c[_0x61a5('0x11')][_0x397b7b]['sumBillable']+=moment(_0xe6c9ba[_0x137c56][_0x3c35cd]['queuecallercompleteAt'])[_0x61a5('0x54')](moment(_0xe6c9ba[_0x137c56][_0x3c35cd][_0x61a5('0x5a')]),'seconds')||0x0;}}else{_0x727d1c[_0x61a5('0x11')][_0x397b7b][_0x61a5('0x2a')]+=_0x727d1c[_0x61a5('0x11')][_0x397b7b]['sumHoldTime']||0x0;}}}}}}return _0x727d1c[_0x61a5('0x11')];};};Realtime[_0x61a5('0x3e')]['initVoiceCallReports']=function(){var _0x2302cc=this;return function(_0x16e5f3){clearVoiceCallReports(_0x2302cc[_0x61a5('0x13')]);if(_0x16e5f3){for(var _0xeea26e=0x0;_0xeea26e<_0x16e5f3[_0x61a5('0x40')];_0xeea26e+=0x1){_0x2302cc[_0x61a5('0x13')]['total']+=0x1;_0x2302cc[_0x61a5('0x13')][_0x61a5('0x2a')]+=_0x16e5f3[_0xeea26e][_0x61a5('0x5b')];if(_0x16e5f3[_0xeea26e][_0x61a5('0x5c')]===_0x61a5('0x5d')){_0x2302cc['outbound'][_0x61a5('0x29')]+=0x1;_0x2302cc[_0x61a5('0x13')][_0x61a5('0x30')]+=_0x16e5f3[_0xeea26e][_0x61a5('0x5b')]-_0x16e5f3[_0xeea26e][_0x61a5('0x5e')]||0x0;_0x2302cc['outbound'][_0x61a5('0x2b')]+=_0x16e5f3[_0xeea26e][_0x61a5('0x5e')];}}}return _0x2302cc[_0x61a5('0x13')];};};Realtime['prototype'][_0x61a5('0x5f')]=function(){var _0x176736=this;return function(_0x5ad2d6){if(_0x5ad2d6){freeIsNotKey(_0x5ad2d6,_0x176736[_0x61a5('0x60')],_0x61a5('0x24'));for(var _0x988db5=0x0,_0x222619={};_0x988db5<_0x5ad2d6[_0x61a5('0x40')];_0x988db5+=0x1){_0x222619=_0x5ad2d6[_0x988db5];if(_['isUndefined'](_0x176736[_0x61a5('0x60')][_0x222619[_0x61a5('0x24')]])){_0x176736[_0x61a5('0x60')][_0x222619[_0x61a5('0x24')]]=new Campaign(_0x222619);}else{_0x176736[_0x61a5('0x3d')](_0x176736[_0x61a5('0x60')][_0x222619['name']],_0x222619);_0x176736[_0x61a5('0x60')][_0x222619[_0x61a5('0x24')]][_0x61a5('0x61')]=_0x222619[_0x61a5('0x62')]?_0x222619[_0x61a5('0x62')]['name']:undefined;}}}return _0x176736[_0x61a5('0x60')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x63')]=function(){var _0x5eef3d=this;return function(_0x302712){if(_0x302712){freeIsNotKey(_0x302712,_0x5eef3d[_0x61a5('0x64')],'id');for(var _0x13c9b1=0x0,_0x2381a5={};_0x13c9b1<_0x302712[_0x61a5('0x40')];_0x13c9b1+=0x1){_0x2381a5=_0x302712[_0x13c9b1];if(_[_0x61a5('0x3f')](_0x5eef3d[_0x61a5('0x64')][_0x2381a5['id']])){_0x5eef3d[_0x61a5('0x64')][_0x2381a5['id']]=new VoiceExtension(_0x2381a5);}else{_0x5eef3d[_0x61a5('0x3d')](_0x5eef3d[_0x61a5('0x64')][_0x2381a5['id']],_0x2381a5);}}}return _0x5eef3d[_0x61a5('0x64')];};};Realtime[_0x61a5('0x3e')][_0x61a5('0x65')]=function(){var _0xf7b267=this;return function(_0x486919){clearCampaigns(_0xf7b267['campaigns']);for(var _0x2411e3=0x0;_0x2411e3<_0x486919['length'];_0x2411e3+=0x1){_[_0x61a5('0x4f')](_0xf7b267['campaigns'][_0x486919[_0x2411e3][_0x61a5('0x24')]],_0x486919[_0x2411e3]);}return _0xf7b267['campaigns'];};};Realtime[_0x61a5('0x3e')]['initFaxAccounts']=function(){var _0x5c0ed7=this;return function(_0x52a0dc){if(_0x52a0dc){freeIsNotKey(_0x52a0dc,_0x5c0ed7[_0x61a5('0x20')],'id');for(var _0x1b4971=0x0,_0x269d19={},_0x1fe05c={};_0x1b4971<_0x52a0dc[_0x61a5('0x40')];_0x1b4971+=0x1){_0x269d19=_0x52a0dc[_0x1b4971];if(_[_0x61a5('0x3f')](_0x5c0ed7[_0x61a5('0x20')][_0x269d19['id']])){_0x5c0ed7[_0x61a5('0x20')][_0x269d19['id']]=new FaxAccount(_0x269d19);}else{_0x5c0ed7[_0x61a5('0x3d')](_0x5c0ed7['faxAccounts'][_0x269d19['id']],_0x269d19);}}}return _0x5c0ed7[_0x61a5('0x20')];};};module['exports']=Realtime; \ No newline at end of file +var _0xfdbc=['billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','initAgents','length','interface','mergeFromDatabase','initTelephones','isUndefined','initTrunks','initVoiceQueues','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initDynamics365Accounts','freshsalesAccounts','groupBy','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','duration'];(function(_0x3f0c06,_0x3d0ecf){var _0x507d9f=function(_0xd3a037){while(--_0xd3a037){_0x3f0c06['push'](_0x3f0c06['shift']());}};_0x507d9f(++_0x3d0ecf);}(_0xfdbc,0x19f));var _0xcfdb=function(_0x18f9b2,_0x1c1db4){_0x18f9b2=_0x18f9b2-0x0;var _0x4996e4=_0xfdbc[_0x18f9b2];return _0x4996e4;};'use strict';var BPromise=require(_0xcfdb('0x0'));var util=require(_0xcfdb('0x1'));var _=require(_0xcfdb('0x2'));var moment=require(_0xcfdb('0x3'));var Agent=require(_0xcfdb('0x4'));var Telephone=require(_0xcfdb('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xcfdb('0x6'));var Template=require(_0xcfdb('0x7'));var Campaign=require(_0xcfdb('0x8'));var VoiceExtension=require(_0xcfdb('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xcfdb('0xa'));var FreshdeskAccount=require(_0xcfdb('0xb'));var SugarcrmAccount=require(_0xcfdb('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xcfdb('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xcfdb('0xe'));var Dynamics365Account=require(_0xcfdb('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xcfdb('0x10'));var Realtime=function(){this[_0xcfdb('0x11')]={};this[_0xcfdb('0x12')]={};this[_0xcfdb('0x13')]={};this[_0xcfdb('0x14')]={};this[_0xcfdb('0x15')]={};this['campaigns']={};this[_0xcfdb('0x16')]={};this[_0xcfdb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xcfdb('0x18')]={};this[_0xcfdb('0x19')]={};this[_0xcfdb('0x1a')]={};this[_0xcfdb('0x1b')]={};this[_0xcfdb('0x1c')]={};this[_0xcfdb('0x1d')]={};this[_0xcfdb('0x1e')]={};this[_0xcfdb('0x1f')]={};this[_0xcfdb('0x20')]={};this[_0xcfdb('0x21')]={};this[_0xcfdb('0x22')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0xcfdb('0x23')]={};this[_0xcfdb('0x24')]={};this['freshsalesAccounts']={};this[_0xcfdb('0x25')]={};};function freeIsNotKey(_0x485e12,_0x27fe54,_0x49bf85){var _0x328134=_[_0xcfdb('0x26')](_0x485e12,function(_0x82a95b,_0x447040){return _0x82a95b[_0x49bf85];});for(var _0xcec240 in _0x27fe54){if(_0x27fe54[_0xcfdb('0x27')](_0xcec240)){if(!_0x328134[_0xcec240]){delete _0x27fe54[_0xcec240];}}}}function freeIsNotKeySip(_0x4fcb74,_0x12d06f){var _0x5c39f0=_[_0xcfdb('0x26')](_0x4fcb74,function(_0x4d1d13,_0x148bed){return util[_0xcfdb('0x28')](_0xcfdb('0x29'),_0x4d1d13[_0xcfdb('0x2a')]);});for(var _0x4fd1f9 in _0x12d06f){if(_0x12d06f['hasOwnProperty'](_0x4fd1f9)){if(!_0x5c39f0[_0x4fd1f9]){delete _0x12d06f[_0x4fd1f9];}}}}function freeIsNotKeyAgent(_0x39960c,_0x5f0ac7){var _0x11b8f5=_[_0xcfdb('0x26')](_0x39960c,function(_0x433b56,_0x69bcfc){var _0x3f9376=_[_0xcfdb('0x2b')](_0x433b56['interface'])?util[_0xcfdb('0x28')](_0xcfdb('0x29'),_0x433b56[_0xcfdb('0x2a')]):_0x433b56['interface'];return _0x3f9376;});for(var _0xcac42e in _0x5f0ac7){if(_0x5f0ac7[_0xcfdb('0x27')](_0xcac42e)){if(!_0x11b8f5[_0xcac42e]){delete _0x5f0ac7[_0xcac42e];}}}}function clearVoiceCallReports(_0x59da57){_0x59da57[_0xcfdb('0x2c')]=0x0;_0x59da57[_0xcfdb('0x2d')]=0x0;_0x59da57[_0xcfdb('0x2e')]=0x0;_0x59da57[_0xcfdb('0x2f')]=0x0;_0x59da57['sumBillable']=0x0;}function clearCampaigns(_0x46add3){if(!_[_0xcfdb('0x30')](_0x46add3)){for(var _0x1067f8 in _0x46add3){if(_0x46add3[_0xcfdb('0x27')](_0x1067f8)){_0x46add3[_0x1067f8][_0xcfdb('0x31')]=0x0;_0x46add3[_0x1067f8][_0xcfdb('0x32')]=0x0;}}}}function clearVoiceQueues(_0xfb4122){if(!_[_0xcfdb('0x30')](_0xfb4122)){for(var _0xb25dab in _0xfb4122){if(_0xfb4122[_0xcfdb('0x27')](_0xb25dab)){_0xfb4122[_0xb25dab][_0xcfdb('0x2c')]=0x0;_0xfb4122[_0xb25dab]['answered']=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x33')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x34')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x2e')]=0x0;_0xfb4122[_0xb25dab]['sumDuration']=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x35')]=0x0;_0xfb4122[_0xb25dab]['outboundAnswerAgiCallsDay']=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x36')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x37')]=0x0;_0xfb4122[_0xb25dab]['outboundCongestionCallsDay']=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x38')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x39')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x3a')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x3b')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x3c')]=0x0;_0xfb4122[_0xb25dab]['outboundOriginateFailureCallsDay']=0x0;_0xfb4122[_0xb25dab]['outboundRejectCallsDay']=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x3d')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x3e')]=0x0;_0xfb4122[_0xb25dab][_0xcfdb('0x3f')]=0x0;_0xfb4122[_0xb25dab]['queueStatusComplete']=!![];}}}}Realtime[_0xcfdb('0x40')]['mergeFromDatabase']=function(_0x2ab72a,_0xdbcda9){for(var _0x51c0f2 in _0xdbcda9){if(_0x2ab72a[_0xcfdb('0x27')](_0x51c0f2)){_0x2ab72a[_0x51c0f2]=_0xdbcda9[_0x51c0f2];}}};Realtime[_0xcfdb('0x40')][_0xcfdb('0x41')]=function(){var _0x3a16db=this;return function(_0x147eb3){if(_0x147eb3){freeIsNotKeyAgent(_0x147eb3,_0x3a16db['agents']);for(var _0x4a9c52=0x0,_0x54e2dc={},_0x1ef07b={};_0x4a9c52<_0x147eb3[_0xcfdb('0x42')];_0x4a9c52+=0x1){_0x54e2dc=_0x147eb3[_0x4a9c52];var _0x2c7d84=_[_0xcfdb('0x2b')](_0x54e2dc[_0xcfdb('0x43')])?util['format']('SIP/%s',_0x54e2dc[_0xcfdb('0x2a')]):_0x54e2dc[_0xcfdb('0x43')];if(_['isUndefined'](_0x3a16db[_0xcfdb('0x11')][_0x2c7d84])){_0x3a16db['agents'][_0x2c7d84]=new Agent(_0x54e2dc);}else{_0x3a16db[_0xcfdb('0x44')](_0x3a16db[_0xcfdb('0x11')][_0x2c7d84],_0x54e2dc);}}}return _0x3a16db['agents'];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x45')]=function(){var _0x1bba7f=this;return function(_0x93bc19){if(_0x93bc19){freeIsNotKeySip(_0x93bc19,_0x1bba7f[_0xcfdb('0x12')]);for(var _0x1948ca=0x0,_0x3fd322={},_0x4839cc={};_0x1948ca<_0x93bc19[_0xcfdb('0x42')];_0x1948ca+=0x1){_0x3fd322=_0x93bc19[_0x1948ca];if(_[_0xcfdb('0x46')](_0x1bba7f[_0xcfdb('0x12')][util[_0xcfdb('0x28')](_0xcfdb('0x29'),_0x3fd322[_0xcfdb('0x2a')])])){_0x1bba7f['telephones'][util[_0xcfdb('0x28')](_0xcfdb('0x29'),_0x3fd322['name'])]=new Telephone(_0x3fd322);}else{_0x1bba7f[_0xcfdb('0x44')](_0x1bba7f[_0xcfdb('0x12')][util[_0xcfdb('0x28')](_0xcfdb('0x29'),_0x3fd322[_0xcfdb('0x2a')])],_0x3fd322);}}}return _0x1bba7f[_0xcfdb('0x12')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x47')]=function(){var _0x50260d=this;return function(_0x3c215b){if(_0x3c215b){freeIsNotKeySip(_0x3c215b,_0x50260d['trunks']);for(var _0x5d1edb=0x0,_0x59033d={},_0x2d8bbd={};_0x5d1edb<_0x3c215b[_0xcfdb('0x42')];_0x5d1edb+=0x1){_0x59033d=_0x3c215b[_0x5d1edb];if(_[_0xcfdb('0x46')](_0x50260d[_0xcfdb('0x13')][util[_0xcfdb('0x28')](_0xcfdb('0x29'),_0x59033d[_0xcfdb('0x2a')])])){_0x50260d[_0xcfdb('0x13')][util['format'](_0xcfdb('0x29'),_0x59033d[_0xcfdb('0x2a')])]=new Trunk(_0x59033d);}else{_0x50260d[_0xcfdb('0x44')](_0x50260d[_0xcfdb('0x13')][util[_0xcfdb('0x28')](_0xcfdb('0x29'),_0x59033d[_0xcfdb('0x2a')])],_0x59033d);}}}return _0x50260d[_0xcfdb('0x13')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x48')]=function(){var _0x2c6d4d=this;return function(_0x2ddd2c){if(_0x2ddd2c){freeIsNotKey(_0x2ddd2c,_0x2c6d4d[_0xcfdb('0x14')],_0xcfdb('0x2a'));for(var _0x1aeb19=0x0,_0x306c24={},_0x93139b={};_0x1aeb19<_0x2ddd2c[_0xcfdb('0x42')];_0x1aeb19+=0x1){_0x306c24=_0x2ddd2c[_0x1aeb19];if(_[_0xcfdb('0x46')](_0x2c6d4d[_0xcfdb('0x14')][_0x306c24['name']])){_0x2c6d4d[_0xcfdb('0x14')][_0x306c24[_0xcfdb('0x2a')]]=new VoiceQueue(_0x306c24);}else{_0x2c6d4d[_0xcfdb('0x44')](_0x2c6d4d['voiceQueues'][_0x306c24['name']],_0x306c24);}}}return _0x2c6d4d[_0xcfdb('0x14')];};};Realtime[_0xcfdb('0x40')]['initTriggers']=function(){var _0x206212=this;return function(_0x1f09dc){if(_0x1f09dc){freeIsNotKey(_0x1f09dc,_0x206212[_0xcfdb('0x15')],'id');for(var _0xc96acd=0x0,_0x67baa0={},_0x31a599={};_0xc96acd<_0x1f09dc[_0xcfdb('0x42')];_0xc96acd+=0x1){_0x67baa0=_0x1f09dc[_0xc96acd];if(_[_0xcfdb('0x46')](_0x206212['triggers'][_0x67baa0['id']])){_0x206212['triggers'][_0x67baa0['id']]=new Trigger(_0x67baa0);}else{_0x206212['mergeFromDatabase'](_0x206212[_0xcfdb('0x15')][_0x67baa0['id']],_0x67baa0);}}}return _0x206212['triggers'];};};Realtime[_0xcfdb('0x40')]['initTemplates']=function(){var _0x34e0de=this;return function(_0x3399c0){if(_0x3399c0){freeIsNotKey(_0x3399c0,_0x34e0de['templates'],'id');for(var _0x2ae8b1=0x0,_0x1c70ab={},_0x58cbe4={};_0x2ae8b1<_0x3399c0[_0xcfdb('0x42')];_0x2ae8b1+=0x1){_0x1c70ab=_0x3399c0[_0x2ae8b1];if(_['isUndefined'](_0x34e0de[_0xcfdb('0x16')][_0x1c70ab['id']])){_0x34e0de[_0xcfdb('0x16')][_0x1c70ab['id']]=new Template(_0x1c70ab);}else{_0x34e0de['mergeFromDatabase'](_0x34e0de[_0xcfdb('0x16')][_0x1c70ab['id']],_0x1c70ab);}}}return _0x34e0de['templates'];};};Realtime['prototype'][_0xcfdb('0x49')]=function(){var _0x3975e2=this;return function(_0x5c4d39){if(_0x5c4d39){freeIsNotKey(_0x5c4d39,_0x3975e2['zendeskAccounts'],'id');for(var _0x5f458b=0x0,_0x3f8d64={},_0x1cc3ff={};_0x5f458b<_0x5c4d39['length'];_0x5f458b+=0x1){_0x3f8d64=_0x5c4d39[_0x5f458b];if(_[_0xcfdb('0x46')](_0x3975e2[_0xcfdb('0x1e')][_0x3f8d64['id']])){_0x3975e2[_0xcfdb('0x1e')][_0x3f8d64['id']]=new ZendeskAccount(_0x3f8d64);}else{_0x3975e2[_0xcfdb('0x44')](_0x3975e2[_0xcfdb('0x1e')][_0x3f8d64['id']],_0x3f8d64);}}}return _0x3975e2[_0xcfdb('0x1e')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x4a')]=function(){var _0x47af19=this;return function(_0x219f07){if(_0x219f07){freeIsNotKey(_0x219f07,_0x47af19[_0xcfdb('0x1f')],'id');for(var _0x7f31b1=0x0,_0x2b15ba={},_0xfb1f1c={};_0x7f31b1<_0x219f07[_0xcfdb('0x42')];_0x7f31b1+=0x1){_0x2b15ba=_0x219f07[_0x7f31b1];if(_[_0xcfdb('0x46')](_0x47af19[_0xcfdb('0x1f')][_0x2b15ba['id']])){_0x47af19[_0xcfdb('0x1f')][_0x2b15ba['id']]=new SalesforceAccount(_0x2b15ba);}else{_0x47af19['mergeFromDatabase'](_0x47af19[_0xcfdb('0x1f')][_0x2b15ba['id']],_0x2b15ba);}}}return _0x47af19[_0xcfdb('0x1f')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x4b')]=function(){var _0x16a727=this;return function(_0x5de469){if(_0x5de469){freeIsNotKey(_0x5de469,_0x16a727['freshdeskAccounts'],'id');for(var _0x2735fc=0x0,_0x461e6b={},_0x315b74={};_0x2735fc<_0x5de469[_0xcfdb('0x42')];_0x2735fc+=0x1){_0x461e6b=_0x5de469[_0x2735fc];if(_[_0xcfdb('0x46')](_0x16a727[_0xcfdb('0x21')][_0x461e6b['id']])){_0x16a727[_0xcfdb('0x21')][_0x461e6b['id']]=new FreshdeskAccount(_0x461e6b);}else{_0x16a727[_0xcfdb('0x44')](_0x16a727['freshdeskAccounts'][_0x461e6b['id']],_0x461e6b);}}}return _0x16a727[_0xcfdb('0x21')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x4c')]=function(){var _0xc48e6b=this;return function(_0x5036a0){if(_0x5036a0){freeIsNotKey(_0x5036a0,_0xc48e6b[_0xcfdb('0x22')],'id');for(var _0x4767c7=0x0,_0x200a2d={},_0x737697={};_0x4767c7<_0x5036a0[_0xcfdb('0x42')];_0x4767c7+=0x1){_0x200a2d=_0x5036a0[_0x4767c7];if(_[_0xcfdb('0x46')](_0xc48e6b[_0xcfdb('0x22')][_0x200a2d['id']])){_0xc48e6b[_0xcfdb('0x22')][_0x200a2d['id']]=new ZohoAccount(_0x200a2d);}else{_0xc48e6b[_0xcfdb('0x44')](_0xc48e6b[_0xcfdb('0x22')][_0x200a2d['id']],_0x200a2d);}}}return _0xc48e6b[_0xcfdb('0x22')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x4d')]=function(){var _0x1378c8=this;return function(_0x195751){if(_0x195751){freeIsNotKey(_0x195751,_0x1378c8[_0xcfdb('0x4e')],'id');for(var _0x37450a=0x0,_0x4850f2={},_0x18bfdd={};_0x37450a<_0x195751[_0xcfdb('0x42')];_0x37450a+=0x1){_0x4850f2=_0x195751[_0x37450a];if(_['isUndefined'](_0x1378c8[_0xcfdb('0x4e')][_0x4850f2['id']])){_0x1378c8[_0xcfdb('0x4e')][_0x4850f2['id']]=new DeskAccount(_0x4850f2);}else{_0x1378c8[_0xcfdb('0x44')](_0x1378c8[_0xcfdb('0x4e')][_0x4850f2['id']],_0x4850f2);}}}return _0x1378c8[_0xcfdb('0x4e')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x4f')]=function(){var _0x57031b=this;return function(_0x4acc86){if(_0x4acc86){freeIsNotKey(_0x4acc86,_0x57031b[_0xcfdb('0x20')],'id');for(var _0x446451=0x0,_0x51f98e={},_0x15b70e={};_0x446451<_0x4acc86[_0xcfdb('0x42')];_0x446451+=0x1){_0x51f98e=_0x4acc86[_0x446451];if(_[_0xcfdb('0x46')](_0x57031b[_0xcfdb('0x20')][_0x51f98e['id']])){_0x57031b[_0xcfdb('0x20')][_0x51f98e['id']]=new SugarcrmAccount(_0x51f98e);}else{_0x57031b[_0xcfdb('0x44')](_0x57031b[_0xcfdb('0x20')][_0x51f98e['id']],_0x51f98e);}}}return _0x57031b[_0xcfdb('0x20')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x50')]=function(){var _0x17052f=this;return function(_0x11bb09){if(_0x11bb09){freeIsNotKey(_0x11bb09,_0x17052f[_0xcfdb('0x51')],'id');for(var _0x5f50b6=0x0,_0x3baf5e={},_0x4ed786={};_0x5f50b6<_0x11bb09['length'];_0x5f50b6+=0x1){_0x3baf5e=_0x11bb09[_0x5f50b6];if(_[_0xcfdb('0x46')](_0x17052f['vtigerAccounts'][_0x3baf5e['id']])){_0x17052f['vtigerAccounts'][_0x3baf5e['id']]=new VtigerAccount(_0x3baf5e);}else{_0x17052f[_0xcfdb('0x44')](_0x17052f[_0xcfdb('0x51')][_0x3baf5e['id']],_0x3baf5e);}}}return _0x17052f[_0xcfdb('0x51')];};};Realtime[_0xcfdb('0x40')]['initServicenowAccounts']=function(){var _0x7ac102=this;return function(_0x2ee555){if(_0x2ee555){freeIsNotKey(_0x2ee555,_0x7ac102[_0xcfdb('0x23')],'id');for(var _0x5d6620=0x0,_0x26b23b={},_0x12cb3b={};_0x5d6620<_0x2ee555['length'];_0x5d6620+=0x1){_0x26b23b=_0x2ee555[_0x5d6620];if(_[_0xcfdb('0x46')](_0x7ac102[_0xcfdb('0x23')][_0x26b23b['id']])){_0x7ac102[_0xcfdb('0x23')][_0x26b23b['id']]=new ServicenowAccount(_0x26b23b);}else{_0x7ac102[_0xcfdb('0x44')](_0x7ac102['servicenowAccounts'][_0x26b23b['id']],_0x26b23b);}}}return _0x7ac102['servicenowAccounts'];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x52')]=function(){var _0x5ef02b=this;return function(_0x3d1982){if(_0x3d1982){freeIsNotKey(_0x3d1982,_0x5ef02b[_0xcfdb('0x24')],'id');for(var _0x4bc009=0x0,_0x5a7f12={},_0x4ba652={};_0x4bc009<_0x3d1982['length'];_0x4bc009+=0x1){_0x5a7f12=_0x3d1982[_0x4bc009];if(_[_0xcfdb('0x46')](_0x5ef02b['dynamics365Accounts'][_0x5a7f12['id']])){_0x5ef02b['dynamics365Accounts'][_0x5a7f12['id']]=new Dynamics365Account(_0x5a7f12);}else{_0x5ef02b[_0xcfdb('0x44')](_0x5ef02b['dynamics365Accounts'][_0x5a7f12['id']],_0x5a7f12);}}}return _0x5ef02b['dynamics365Accounts'];};};Realtime[_0xcfdb('0x40')]['initFreshsalesAccounts']=function(){var _0x1dcd69=this;return function(_0x45a543){if(_0x45a543){freeIsNotKey(_0x45a543,_0x1dcd69['freshsalesAccounts'],'id');for(var _0x120333=0x0,_0x4afefe={},_0xb9b93a={};_0x120333<_0x45a543[_0xcfdb('0x42')];_0x120333+=0x1){_0x4afefe=_0x45a543[_0x120333];if(_['isUndefined'](_0x1dcd69['freshsalesAccounts'][_0x4afefe['id']])){_0x1dcd69[_0xcfdb('0x53')][_0x4afefe['id']]=new FreshsalesAccount(_0x4afefe);}else{_0x1dcd69[_0xcfdb('0x44')](_0x1dcd69[_0xcfdb('0x53')][_0x4afefe['id']],_0x4afefe);}}}return _0x1dcd69[_0xcfdb('0x53')];};};Realtime[_0xcfdb('0x40')]['initVoiceQueueHopperHistory']=function(){var _0x1a7704=this;return function(_0x444f82){for(var _0xf5eaf=0x0;_0xf5eaf<_0x444f82[_0xcfdb('0x42')];_0xf5eaf+=0x1){_['merge'](_0x1a7704[_0xcfdb('0x14')][_0x444f82[_0xf5eaf][_0xcfdb('0x2a')]],_0x444f82[_0xf5eaf]);}return _0x1a7704[_0xcfdb('0x14')];};};Realtime[_0xcfdb('0x40')]['initVoiceQueueReports']=function(){var _0x47a013=this;return function(_0x5e5e6f){clearVoiceQueues(_0x47a013[_0xcfdb('0x14')]);if(_0x5e5e6f){_0x5e5e6f=_[_0xcfdb('0x54')](_0x5e5e6f,'uniqueid');for(var _0x3aab6d in _0x5e5e6f){if(_0x5e5e6f[_0xcfdb('0x27')](_0x3aab6d)){var _0x5e1aef={};for(var _0xc19713=0x0;_0xc19713<_0x5e5e6f[_0x3aab6d]['length'];_0xc19713+=0x1){var _0x546e97=_0x5e5e6f[_0x3aab6d][_0xc19713]['queue'];if(_0x47a013[_0xcfdb('0x14')][_0x546e97]){if(_0x5e5e6f[_0x3aab6d][_0xc19713]['queuecallerexit']){_0x47a013[_0xcfdb('0x14')][_0x546e97][_0xcfdb('0x33')]+=0x1;}if(_0x5e5e6f[_0x3aab6d][_0xc19713][_0xcfdb('0x55')]){_0x47a013['voiceQueues'][_0x546e97][_0xcfdb('0x34')]+=0x1;}_0x47a013[_0xcfdb('0x14')][_0x546e97][_0xcfdb('0x2e')]+=moment(_0x5e5e6f[_0x3aab6d][_0xc19713]['queuecallerleaveAt'])[_0xcfdb('0x56')](moment(_0x5e5e6f[_0x3aab6d][_0xc19713][_0xcfdb('0x57')]),_0xcfdb('0x58'))||0x0;if(_0xc19713===_0x5e5e6f[_0x3aab6d][_0xcfdb('0x42')]-0x1){_0x47a013[_0xcfdb('0x14')][_0x546e97][_0xcfdb('0x2f')]+=moment(_0x5e5e6f[_0x3aab6d][_0xc19713][_0xcfdb('0x59')]||_0x5e5e6f[_0x3aab6d][_0xc19713]['queuecallerabandonAt']||_0x5e5e6f[_0x3aab6d][_0xc19713][_0xcfdb('0x5a')])[_0xcfdb('0x56')](moment(_0x5e5e6f[_0x3aab6d][_0xc19713][_0xcfdb('0x57')]),_0xcfdb('0x58'))||0x0;_0x47a013['voiceQueues'][_0x546e97][_0xcfdb('0x2c')]+=0x1;if(_0x5e5e6f[_0x3aab6d][_0xc19713][_0xcfdb('0x5b')]){_0x47a013[_0xcfdb('0x14')][_0x546e97][_0xcfdb('0x2d')]+=0x1;_0x47a013[_0xcfdb('0x14')][_0x546e97][_0xcfdb('0x35')]+=moment(_0x5e5e6f[_0x3aab6d][_0xc19713]['queuecallercompleteAt'])['diff'](moment(_0x5e5e6f[_0x3aab6d][_0xc19713][_0xcfdb('0x5c')]),'seconds')||0x0;}}else{_0x47a013[_0xcfdb('0x14')][_0x546e97][_0xcfdb('0x2f')]+=_0x47a013[_0xcfdb('0x14')][_0x546e97][_0xcfdb('0x2e')]||0x0;}}}}}}return _0x47a013['voiceQueues'];};};Realtime['prototype'][_0xcfdb('0x5d')]=function(){var _0x32e202=this;return function(_0x41608f){clearVoiceCallReports(_0x32e202[_0xcfdb('0x17')]);if(_0x41608f){for(var _0x5cab01=0x0;_0x5cab01<_0x41608f['length'];_0x5cab01+=0x1){_0x32e202[_0xcfdb('0x17')][_0xcfdb('0x2c')]+=0x1;_0x32e202[_0xcfdb('0x17')]['sumDuration']+=_0x41608f[_0x5cab01][_0xcfdb('0x5e')];if(_0x41608f[_0x5cab01]['disposition']==='ANSWERED'){_0x32e202['outbound'][_0xcfdb('0x2d')]+=0x1;_0x32e202['outbound'][_0xcfdb('0x2e')]+=_0x41608f[_0x5cab01][_0xcfdb('0x5e')]-_0x41608f[_0x5cab01][_0xcfdb('0x5f')]||0x0;_0x32e202['outbound'][_0xcfdb('0x35')]+=_0x41608f[_0x5cab01][_0xcfdb('0x5f')];}}}return _0x32e202[_0xcfdb('0x17')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x60')]=function(){var _0x2a0411=this;return function(_0x5b366b){if(_0x5b366b){freeIsNotKey(_0x5b366b,_0x2a0411[_0xcfdb('0x61')],_0xcfdb('0x2a'));for(var _0xffdac6=0x0,_0x39bb8f={};_0xffdac6<_0x5b366b['length'];_0xffdac6+=0x1){_0x39bb8f=_0x5b366b[_0xffdac6];if(_[_0xcfdb('0x46')](_0x2a0411[_0xcfdb('0x61')][_0x39bb8f[_0xcfdb('0x2a')]])){_0x2a0411[_0xcfdb('0x61')][_0x39bb8f[_0xcfdb('0x2a')]]=new Campaign(_0x39bb8f);}else{_0x2a0411[_0xcfdb('0x44')](_0x2a0411[_0xcfdb('0x61')][_0x39bb8f[_0xcfdb('0x2a')]],_0x39bb8f);_0x2a0411[_0xcfdb('0x61')][_0x39bb8f[_0xcfdb('0x2a')]][_0xcfdb('0x62')]=_0x39bb8f['SquareProject']?_0x39bb8f[_0xcfdb('0x63')][_0xcfdb('0x2a')]:undefined;}}}return _0x2a0411['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x48b24a=this;return function(_0x701426){if(_0x701426){freeIsNotKey(_0x701426,_0x48b24a[_0xcfdb('0x18')],'id');for(var _0x2240cb=0x0,_0x39dfd3={};_0x2240cb<_0x701426['length'];_0x2240cb+=0x1){_0x39dfd3=_0x701426[_0x2240cb];if(_[_0xcfdb('0x46')](_0x48b24a[_0xcfdb('0x18')][_0x39dfd3['id']])){_0x48b24a[_0xcfdb('0x18')][_0x39dfd3['id']]=new VoiceExtension(_0x39dfd3);}else{_0x48b24a[_0xcfdb('0x44')](_0x48b24a['voiceExtensions'][_0x39dfd3['id']],_0x39dfd3);}}}return _0x48b24a[_0xcfdb('0x18')];};};Realtime[_0xcfdb('0x40')]['initCampaignHopperHistory']=function(){var _0x2a5161=this;return function(_0x4b41b7){clearCampaigns(_0x2a5161['campaigns']);for(var _0x1f1038=0x0;_0x1f1038<_0x4b41b7[_0xcfdb('0x42')];_0x1f1038+=0x1){_['merge'](_0x2a5161[_0xcfdb('0x61')][_0x4b41b7[_0x1f1038][_0xcfdb('0x2a')]],_0x4b41b7[_0x1f1038]);}return _0x2a5161[_0xcfdb('0x61')];};};Realtime[_0xcfdb('0x40')][_0xcfdb('0x64')]=function(){var _0x4fa03f=this;return function(_0x3ccc2c){if(_0x3ccc2c){freeIsNotKey(_0x3ccc2c,_0x4fa03f['faxAccounts'],'id');for(var _0x1ff296=0x0,_0x30ffea={},_0x32455b={};_0x1ff296<_0x3ccc2c[_0xcfdb('0x42')];_0x1ff296+=0x1){_0x30ffea=_0x3ccc2c[_0x1ff296];if(_['isUndefined'](_0x4fa03f[_0xcfdb('0x25')][_0x30ffea['id']])){_0x4fa03f[_0xcfdb('0x25')][_0x30ffea['id']]=new FaxAccount(_0x30ffea);}else{_0x4fa03f[_0xcfdb('0x44')](_0x4fa03f['faxAccounts'][_0x30ffea['id']],_0x30ffea);}}}return _0x4fa03f[_0xcfdb('0x25')];};};module[_0xcfdb('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 914ca54..e04c3cb 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 _0x4f7d=['telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','accountcode','name','interface','format','SIP/%s','length','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','match','getAgentByInternal','keys','getCallType','split','calleridnum','destination','exten','type','lastapplication','queue','lastdata','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','UserId','membername','create','monitors','filename','createdAt','connectedlinename','isArray','forEach','startsWith','Local','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','moment','util','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x4f7d,0x157));var _0xd4f7=function(_0x54c9ed,_0xd41328){_0x54c9ed=_0x54c9ed-0x0;var _0x270c25=_0x4f7d[_0x54c9ed];return _0x270c25;};'use strict';var _=require('lodash');var moment=require(_0xd4f7('0x0'));var util=require(_0xd4f7('0x1'));var config=require('../../../config/environment');var ami=require(_0xd4f7('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xd4f7('0x3'));var RpcVoiceDialReport=require(_0xd4f7('0x4'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xd4f7('0x5'));var RpcVoiceRecording=require(_0xd4f7('0x6'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xd4f7('0x7'));var VoiceCallReport=require(_0xd4f7('0x8'));var VoiceAgentReport=require(_0xd4f7('0x9'));var VoiceDialReport=require(_0xd4f7('0xa'));var UserReport=require(_0xd4f7('0xb'));function Report(_0x22440e){this['realtime']=_0x22440e;this[_0xd4f7('0xc')]=_0x22440e[_0xd4f7('0xc')];this[_0xd4f7('0xd')]=_0x22440e['telephones'];}Report[_0xd4f7('0xe')]['sync']=function(_0xa9a99a){var _0x42fe5b=new VoiceQueueReport(this[_0xd4f7('0xf')]);var _0x57265a=new VoiceAgentReport(this[_0xd4f7('0xf')]);var _0x2d79a5=new VoiceDialReport(this['realtime']);var _0x10a826=new VoiceCallReport(this[_0xd4f7('0xf')]);var _0x54db40=new UserReport(this[_0xd4f7('0xf')]);if(config['xdr']&&config[_0xd4f7('0x10')][_0xd4f7('0x11')]){ami['on'](_0xd4f7('0x12'),this[_0xd4f7('0x13')][_0xd4f7('0x14')](this));ami['on'](_0xd4f7('0x15'),this[_0xd4f7('0x16')][_0xd4f7('0x14')](this));ami['on'](_0xd4f7('0x17'),this[_0xd4f7('0x18')][_0xd4f7('0x14')](this));ami['on'](_0xd4f7('0x19'),this[_0xd4f7('0x1a')][_0xd4f7('0x14')](this));ami['on'](_0xd4f7('0x1b'),this['blindTransfer']['bind'](this));ami['on'](_0xd4f7('0x1c'),this[_0xd4f7('0x1d')][_0xd4f7('0x14')](this));}};Report[_0xd4f7('0xe')][_0xd4f7('0x1e')]=function(_0x48eaf4){var _0x275658;_0x275658=_[_0xd4f7('0x1f')](this[_0xd4f7('0xc')],function(_0x3f58c8){return _0x3f58c8['accountcode']==_0x48eaf4||_0x3f58c8['name']==_0x48eaf4;});if(_[_0xd4f7('0x20')](_0x275658)){var _0x25049d=_[_0xd4f7('0x1f')](this[_0xd4f7('0xd')],function(_0x153070){return _0x153070[_0xd4f7('0x21')]==_0x48eaf4||_0x153070[_0xd4f7('0x22')]==_0x48eaf4;});if(_0x25049d){_0x275658=_[_0xd4f7('0x1f')](this[_0xd4f7('0xc')],function(_0x23b4d6){return _0x23b4d6[_0xd4f7('0x23')]==util[_0xd4f7('0x24')](_0xd4f7('0x25'),_0x25049d[_0xd4f7('0x22')]);});}}return _0x275658;};Report['prototype'][_0xd4f7('0x13')]=function(_0x26cb8c){for(var _0x3de8ce=0x0;_0x3de8ce<_0x26cb8c[_0xd4f7('0x26')];_0x3de8ce+=0x1){var _0xdf983=this[_0xd4f7('0x1e')](_0x26cb8c[_0x3de8ce]['connectedlinenum']);if(_0xdf983){_0x26cb8c[_0x3de8ce][_0xd4f7('0x21')]=_0xdf983['accountcode'];_0x26cb8c[_0x3de8ce][_0xd4f7('0x27')]=!![];_0x26cb8c[_0x3de8ce][_0xd4f7('0x28')]=_0xdf983['name'];_0x26cb8c[_0x3de8ce]['interface']=_[_0xd4f7('0x20')](_0xdf983[_0xd4f7('0x23')])?util[_0xd4f7('0x24')]('SIP/%s',_0xdf983[_0xd4f7('0x22')]):_0xdf983[_0xd4f7('0x23')];if(_0x26cb8c[_0x3de8ce][_0xd4f7('0x29')]){_0x26cb8c[_0x3de8ce][_0xd4f7('0x2a')]=moment()[_0xd4f7('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x26cb8c[_0x3de8ce][_0xd4f7('0x2b')]){_0x26cb8c[_0x3de8ce][_0xd4f7('0x2c')]=moment()[_0xd4f7('0x24')](_0xd4f7('0x2d'));}RpcMemberReport[_0xd4f7('0x13')](_0x26cb8c[_0x3de8ce]);}RpcVoiceQueueReport['create'](_0x26cb8c[_0x3de8ce]);}};function extractCalleridNumber(_0x349cc5){var _0x1de892=_0x349cc5[_0xd4f7('0x2e')](/<(.*?)>/);return _0x1de892?_0x1de892[0x1]:_0x349cc5;}Report[_0xd4f7('0xe')][_0xd4f7('0x2f')]=function(_0xfe89cc){for(var _0x3c38b8=0x0;_0x3c38b8',_0xca9490[_0xd4f7('0x44')],_0xca9490['calleridnum']);}if(RpcVoiceTransferReport[_0xd4f7('0x45')][_0xca9490[_0xd4f7('0x46')]]){var _0x2120a5=RpcVoiceTransferReport[_0xd4f7('0x45')][_0xca9490['linkedid']];_0x2120a5[_0xd4f7('0x47')]=_0xca9490['uniqueid'];RpcVoiceTransferReport[_0xd4f7('0x48')](_0x2120a5);delete RpcVoiceTransferReport[_0xd4f7('0x45')][_0xca9490[_0xd4f7('0x46')]];}if(_['isNil'](_0xca9490[_0xd4f7('0x36')])){_0xca9490[_0xd4f7('0x36')]=this['getCallType'](_0xca9490);}if(_[_0xd4f7('0x20')](_0xca9490[_0xd4f7('0x49')])){var _0x4623c8=_0xca9490[_0xd4f7('0x40')][_0xd4f7('0x32')]('-')[0x0];var _0x31b1b8=this['agents'][_0x4623c8];if(!_0x31b1b8)_0x31b1b8=this[_0xd4f7('0x2f')](_0xca9490[_0xd4f7('0x21')]);if(_0x31b1b8){_0xca9490[_0xd4f7('0x49')]=_0x31b1b8['id'];_0xca9490[_0xd4f7('0x4a')]=_0x31b1b8[_0xd4f7('0x22')];}}RpcVoiceCallReport[_0xd4f7('0x4b')](_0xca9490);if(_0xca9490['monitor']){for(var _0x3af60d=0x0;_0x3af60d<_0xca9490[_0xd4f7('0x4c')][_0xd4f7('0x26')];_0x3af60d+=0x1){_0xca9490['monitorFilename']=_0xca9490[_0xd4f7('0x4c')][_0x3af60d][_0xd4f7('0x4d')];_0xca9490['createdAt']=_0xca9490['monitors'][_0x3af60d][_0xd4f7('0x4e')];if(_0xca9490[_0xd4f7('0x35')]==_0xd4f7('0x3c')){_0xca9490[_0xd4f7('0x33')]=_0xca9490[_0xd4f7('0x43')];_0xca9490[_0xd4f7('0x44')]=_0xca9490[_0xd4f7('0x4f')];_0xca9490['connectedlinenum']=_0xca9490['accountcode'];_0xca9490[_0xd4f7('0x4f')]=_0xca9490['membername'];_0xca9490[_0xd4f7('0x35')]=_0xca9490[_0xd4f7('0x3e')];}else if(_0xca9490[_0xd4f7('0x35')]=='xcally-motion-dialer'){_0xca9490[_0xd4f7('0x33')]=_0xca9490[_0xd4f7('0x34')];_0xca9490[_0xd4f7('0x35')]=_0xca9490['originatecalleridnum'];}RpcVoiceRecording[_0xd4f7('0x4b')](_0xca9490);}}};Report[_0xd4f7('0xe')][_0xd4f7('0x18')]=function(_0x4f6f05){if(_[_0xd4f7('0x50')](_0x4f6f05)){_0x4f6f05[_0xd4f7('0x51')](function(_0x4106d2){RpcVoiceAgentReport['create'](_0x4106d2);});}else{RpcVoiceAgentReport['create'](_0x4f6f05);}};Report[_0xd4f7('0xe')][_0xd4f7('0x1a')]=function(_0x399101){RpcVoiceDialReport[_0xd4f7('0x4b')](_0x399101);var _0x348bff;var _0x10b19d;var _0x2cab69=_0x399101[_0xd4f7('0x40')];if(_[_0xd4f7('0x52')](_0x2cab69,_0xd4f7('0x53'))){_0x10b19d=_0x2cab69['substring'](_0x2cab69[_0xd4f7('0x54')]('/')+0x1,_0x2cab69[_0xd4f7('0x54')]('@'));_0x348bff=_[_0xd4f7('0x1f')](this[_0xd4f7('0xc')],function(_0x75f26d){return _0x75f26d[_0xd4f7('0x55')]==_0x10b19d||_0x75f26d[_0xd4f7('0x56')]==_0x10b19d||_0x75f26d[_0xd4f7('0x21')]==_0x10b19d;});}else{_0x10b19d=_0x2cab69['substring'](_0x2cab69[_0xd4f7('0x54')]('/')+0x1,_0x2cab69[_0xd4f7('0x57')]('-'));_0x348bff=this[_0xd4f7('0x1e')](_0x10b19d);}if(_0x348bff){_0x399101[_0xd4f7('0x23')]=_[_0xd4f7('0x20')](_0x348bff['interface'])?util[_0xd4f7('0x24')](_0xd4f7('0x25'),_0x348bff[_0xd4f7('0x22')]):_0x348bff[_0xd4f7('0x23')];_0x399101[_0xd4f7('0x4a')]=_0x348bff[_0xd4f7('0x22')];_0x399101[_0xd4f7('0x21')]=_0x348bff[_0xd4f7('0x21')];RpcMemberReport[_0xd4f7('0x1a')](_0x399101);}};Report['prototype']['blindTransfer']=function(_0x561ab4){RpcVoiceTransferReport[_0xd4f7('0x45')][_0x561ab4[_0xd4f7('0x58')]]=_0x561ab4;};Report[_0xd4f7('0xe')][_0xd4f7('0x1d')]=function(_0x7addf0){RpcVoiceTransferReport[_0xd4f7('0x1d')](_0x7addf0);};module['exports']=Report; \ No newline at end of file +var _0x4d6b=['lastIndexOf','transfererlinkedid','attendedTransfer','exports','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','voiceQueueReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','find','accountcode','name','isNil','interface','assigned','lastAssignedTo','format','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','channel','split','calleridnum','outbound','internal','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','getCallType','UserId','membername','create','monitor','length','monitorFilename','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone'];(function(_0x2958f8,_0x1b8fda){var _0x1a02c0=function(_0x47642c){while(--_0x47642c){_0x2958f8['push'](_0x2958f8['shift']());}};_0x1a02c0(++_0x1b8fda);}(_0x4d6b,0xb8));var _0xb4d6=function(_0x501f4d,_0x51b9d9){_0x501f4d=_0x501f4d-0x0;var _0x199d85=_0x4d6b[_0x501f4d];return _0x199d85;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xb4d6('0x0'));var config=require(_0xb4d6('0x1'));var ami=require(_0xb4d6('0x2'));var RpcVoiceAgentReport=require(_0xb4d6('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xb4d6('0x4'));var RpcVoiceQueueReport=require(_0xb4d6('0x5'));var RpcVoiceRecording=require(_0xb4d6('0x6'));var RpcVoiceTransferReport=require(_0xb4d6('0x7'));var VoiceQueueReport=require(_0xb4d6('0x8'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xb4d6('0x9'));function Report(_0x47252c){this[_0xb4d6('0xa')]=_0x47252c;this[_0xb4d6('0xb')]=_0x47252c[_0xb4d6('0xb')];this[_0xb4d6('0xc')]=_0x47252c['telephones'];}Report[_0xb4d6('0xd')][_0xb4d6('0xe')]=function(_0x2572f5){var _0x240160=new VoiceQueueReport(this[_0xb4d6('0xa')]);var _0x2f023a=new VoiceAgentReport(this[_0xb4d6('0xa')]);var _0x3b431e=new VoiceDialReport(this[_0xb4d6('0xa')]);var _0x33aef3=new VoiceCallReport(this[_0xb4d6('0xa')]);var _0x2c6e0a=new UserReport(this[_0xb4d6('0xa')]);if(config['xdr']&&config['xdr'][_0xb4d6('0xf')]){ami['on']('custom:voiceQueueReport',this[_0xb4d6('0x10')][_0xb4d6('0x11')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0xb4d6('0x11')](this));ami['on']('custom:voiceAgentReport',this[_0xb4d6('0x12')][_0xb4d6('0x11')](this));ami['on'](_0xb4d6('0x13'),this[_0xb4d6('0x14')][_0xb4d6('0x11')](this));ami['on']('blindtransfer',this[_0xb4d6('0x15')][_0xb4d6('0x11')](this));ami['on'](_0xb4d6('0x16'),this['attendedTransfer']['bind'](this));}};Report[_0xb4d6('0xd')]['findAgent']=function(_0x384efb){var _0x447d90;_0x447d90=_[_0xb4d6('0x17')](this[_0xb4d6('0xb')],function(_0xfb4d94){return _0xfb4d94[_0xb4d6('0x18')]==_0x384efb||_0xfb4d94[_0xb4d6('0x19')]==_0x384efb;});if(_[_0xb4d6('0x1a')](_0x447d90)){var _0x3d7808=_['find'](this[_0xb4d6('0xc')],function(_0x4dfb7d){return _0x4dfb7d[_0xb4d6('0x18')]==_0x384efb||_0x4dfb7d[_0xb4d6('0x19')]==_0x384efb;});if(_0x3d7808){_0x447d90=_['find'](this[_0xb4d6('0xb')],function(_0x42a5dc){return _0x42a5dc[_0xb4d6('0x1b')]==util['format']('SIP/%s',_0x3d7808[_0xb4d6('0x19')]);});}}return _0x447d90;};Report['prototype']['voiceQueueReport']=function(_0x1dddab){for(var _0x3ccc31=0x0;_0x3ccc31<_0x1dddab['length'];_0x3ccc31+=0x1){var _0x45ccd5=this['findAgent'](_0x1dddab[_0x3ccc31]['connectedlinenum']);if(_0x45ccd5){_0x1dddab[_0x3ccc31][_0xb4d6('0x18')]=_0x45ccd5['accountcode'];_0x1dddab[_0x3ccc31][_0xb4d6('0x1c')]=!![];_0x1dddab[_0x3ccc31][_0xb4d6('0x1d')]=_0x45ccd5[_0xb4d6('0x19')];_0x1dddab[_0x3ccc31][_0xb4d6('0x1b')]=_[_0xb4d6('0x1a')](_0x45ccd5[_0xb4d6('0x1b')])?util[_0xb4d6('0x1e')](_0xb4d6('0x1f'),_0x45ccd5[_0xb4d6('0x19')]):_0x45ccd5[_0xb4d6('0x1b')];if(_0x1dddab[_0x3ccc31][_0xb4d6('0x20')]){_0x1dddab[_0x3ccc31]['queuecallercompleteAt']=moment()['format'](_0xb4d6('0x21'));}if(_0x1dddab[_0x3ccc31][_0xb4d6('0x22')]){_0x1dddab[_0x3ccc31][_0xb4d6('0x23')]=moment()[_0xb4d6('0x1e')](_0xb4d6('0x21'));}RpcMemberReport['voiceQueueReport'](_0x1dddab[_0x3ccc31]);}RpcVoiceQueueReport['create'](_0x1dddab[_0x3ccc31]);}};function extractCalleridNumber(_0x434d61){var _0x3fda98=_0x434d61[_0xb4d6('0x24')](/<(.*?)>/);return _0x3fda98?_0x3fda98[0x1]:_0x434d61;}Report[_0xb4d6('0xd')][_0xb4d6('0x25')]=function(_0x47b855){for(var _0x4bdcf3=0x0;_0x4bdcf30x0?_0x4a0e8b:0x0;this[_0x56a4('0x3d')][_0x18e743[_0x56a4('0x6c')]][_0x56a4('0x2d')]=this['voiceQueues'][_0x18e743[_0x56a4('0x6c')]]['talking']>_[_0x56a4('0x71')](_0x18e743[_0x56a4('0x72')])?_['toNumber'](_0x18e743[_0x56a4('0x72')]):this[_0x56a4('0x3d')][_0x18e743[_0x56a4('0x6c')]]['talking'];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x18e743[_0x56a4('0x6c')]],_0x56a4('0x73'));}logger['debug'](_0x56a4('0x74'),util[_0x56a4('0x45')](this[_0x56a4('0x3d')][_0x18e743[_0x56a4('0x6c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x56a4('0x75'),this[_0x56a4('0x3d')][_0x18e743['queue']]);}}}catch(_0x1cd9c0){logger[_0x56a4('0x38')](_0x56a4('0x6b'),util[_0x56a4('0x45')](_0x1cd9c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x833a8b){logger[_0x56a4('0x41')](_0x56a4('0x76'),util[_0x56a4('0x45')](_0x833a8b,{'showHidden':![],'depth':null}));this[_0x56a4('0x68')]=!![];};VoiceQueueReport[_0x56a4('0xa')][_0x56a4('0x77')]=function(_0x20588e){try{if(this[_0x56a4('0x63')](_0x20588e)){logger[_0x56a4('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x20588e['uniqueid'],util[_0x56a4('0x45')](_0x20588e,{'showHidden':![],'depth':null}));if(_[_0x56a4('0x64')](this[_0x56a4('0xf')][_0x20588e['uniqueid']]))this[_0x56a4('0xf')][_0x20588e[_0x56a4('0x44')]]=[];if(_[_0x56a4('0x64')](this['channels'][_0x20588e[_0x56a4('0x44')]]))this[_0x56a4('0x11')][_0x20588e[_0x56a4('0x44')]]={};var _0x1c57ab=new QueueReport();_0x1c57ab[_0x56a4('0x4d')]=_0x20588e['queue'];_0x1c57ab[_0x56a4('0x50')]=this[_0x56a4('0x3d')][_0x1c57ab[_0x56a4('0x4d')]]&&this[_0x56a4('0x3d')][_0x1c57ab['name']]['type']?this[_0x56a4('0x3d')][_0x1c57ab[_0x56a4('0x4d')]][_0x56a4('0x50')]||_0x56a4('0x51'):_0x56a4('0x51');_0x1c57ab['queue']=_0x20588e[_0x56a4('0x6c')];_0x1c57ab[_0x56a4('0x78')]=moment()[_0x56a4('0x46')](_0x56a4('0x79'));_0x1c57ab[_0x56a4('0x7a')]=_0x20588e[_0x56a4('0x7a')];_0x1c57ab['count']=_0x20588e[_0x56a4('0x7b')];_0x1c57ab[_0x56a4('0x44')]=_0x20588e[_0x56a4('0x44')];_0x1c57ab[_0x56a4('0x7c')]=this[_0x56a4('0x11')][_0x20588e['uniqueid']][_0x56a4('0x7c')];logger[_0x56a4('0x6e')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1c57ab[_0x56a4('0x4d')],_0x1c57ab[_0x56a4('0x50')]);_[_0x56a4('0x7d')](_0x1c57ab,_['pick'](_0x20588e,_[_0x56a4('0x7e')](_0x1c57ab)));this['queueReports'][_0x20588e['uniqueid']][_0x56a4('0x7f')](_0x1c57ab);this[_0x56a4('0x11')][_0x20588e[_0x56a4('0x44')]]=_0x1c57ab;this[_0x56a4('0x80')](_0x1c57ab,'queuecallerjoin');}}catch(_0x2c551b){logger[_0x56a4('0x38')]('[%s][voiceQueueReport][queuecallerjoin]',_0x20588e[_0x56a4('0x44')],util[_0x56a4('0x45')](_0x2c551b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56a4('0xa')]['syncQueueCallerAbandon']=function(_0x4b619e){try{if(this[_0x56a4('0x63')](_0x4b619e)){logger[_0x56a4('0x41')](_0x56a4('0x81'),_0x4b619e[_0x56a4('0x44')],util[_0x56a4('0x45')](_0x4b619e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b619e[_0x56a4('0x44')]]){var _0x365b20=_[_0x56a4('0x82')](this[_0x56a4('0xf')][_0x4b619e[_0x56a4('0x44')]]);_0x365b20[_0x56a4('0x83')]=![];_0x365b20['queuecallercompleteAt']=null;_0x365b20[_0x56a4('0x84')]=_0x4b619e[_0x56a4('0x84')];_0x365b20[_0x56a4('0x85')]=_0x4b619e[_0x56a4('0x85')];_0x365b20['queuecallerabandon']=!![];_0x365b20[_0x56a4('0x86')]=moment()[_0x56a4('0x46')](_0x56a4('0x79'));_0x365b20[_0x56a4('0x4b')]=_0x56a4('0x87');_0x365b20['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x365b20[_0x56a4('0x4d')],_0x365b20[_0x56a4('0x50')]);this[_0x56a4('0x11')][_0x4b619e[_0x56a4('0x44')]]=_0x365b20;this[_0x56a4('0x3e')](_0x365b20,_0x56a4('0x18'));}}}catch(_0x3b11de){logger[_0x56a4('0x38')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4b619e[_0x56a4('0x44')],util['inspect'](_0x3b11de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56a4('0xa')][_0x56a4('0x1a')]=function(_0x34fb39){try{if(this['isNotNull'](_0x34fb39)){logger[_0x56a4('0x41')](_0x56a4('0x88'),_0x34fb39[_0x56a4('0x44')],util[_0x56a4('0x45')](_0x34fb39,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x34fb39[_0x56a4('0x44')]]){var _0x4af777=_[_0x56a4('0x82')](this[_0x56a4('0xf')][_0x34fb39[_0x56a4('0x44')]]);_0x4af777[_0x56a4('0x89')]=moment()[_0x56a4('0x46')](_0x56a4('0x79'));_0x4af777[_0x56a4('0x8a')]=_0x34fb39[_0x56a4('0x8a')];_0x4af777[_0x56a4('0x8b')]=_0x34fb39[_0x56a4('0x8b')];logger[_0x56a4('0x6e')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4af777[_0x56a4('0x4d')],_0x4af777[_0x56a4('0x50')],_0x34fb39[_0x56a4('0x8a')],_0x34fb39[_0x56a4('0x8b')]);this[_0x56a4('0x11')][_0x34fb39[_0x56a4('0x44')]]=_0x4af777;this[_0x56a4('0x80')](_0x4af777,'queuecallerleave');}}}catch(_0x4abf92){logger[_0x56a4('0x38')]('[%s][voiceQueueReport][queuecallerleave]',_0x34fb39[_0x56a4('0x44')],util[_0x56a4('0x45')](_0x4abf92,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56a4('0xa')][_0x56a4('0x1d')]=function(_0x314fd1){try{if(this[_0x56a4('0x63')](_0x314fd1)){logger[_0x56a4('0x41')](_0x56a4('0x8c'),_0x314fd1[_0x56a4('0x44')],util[_0x56a4('0x45')](_0x314fd1,{'showHidden':![],'depth':null}));if(this[_0x56a4('0xf')][_0x314fd1['uniqueid']]){var _0x1da46=_[_0x56a4('0x82')](this[_0x56a4('0xf')][_0x314fd1[_0x56a4('0x44')]]);_0x1da46[_0x56a4('0x83')]=!![];_0x1da46[_0x56a4('0x4b')]='COMPLETEDBYAGENT';logger[_0x56a4('0x6e')](_0x56a4('0x8d'),_0x1da46[_0x56a4('0x4d')],_0x1da46[_0x56a4('0x50')]);}}}catch(_0x512817){logger[_0x56a4('0x38')](_0x56a4('0x8c'),_0x314fd1['uniqueid'],util['inspect'](_0x512817,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56a4('0xa')][_0x56a4('0x1c')]=function(_0x1f1f65){try{if(this['isNotNull'](_0x1f1f65)){logger[_0x56a4('0x41')](_0x56a4('0x8e'),_0x1f1f65[_0x56a4('0x44')],util[_0x56a4('0x45')](_0x1f1f65,{'showHidden':![],'depth':null}));if(this[_0x56a4('0xf')][_0x1f1f65['uniqueid']]){var _0x25ae96=_[_0x56a4('0x82')](this[_0x56a4('0xf')][_0x1f1f65[_0x56a4('0x44')]]);_0x25ae96['queuecallerabandon']=![];_0x25ae96[_0x56a4('0x86')]=null;_0x25ae96['assigned']=!![];_0x25ae96[_0x56a4('0x8f')]=_0x1f1f65[_0x56a4('0x90')];_0x25ae96['holdtime']=_0x1f1f65[_0x56a4('0x84')];_0x25ae96['queuecallercomplete']=!![];_0x25ae96[_0x56a4('0x91')]=![];_0x25ae96[_0x56a4('0x92')]=null;if(!_0x25ae96['transfer']){if(_0x1f1f65[_0x56a4('0x93')]==_0x56a4('0x94')){_0x25ae96[_0x56a4('0x4b')]='COMPLETED';logger[_0x56a4('0x6e')](_0x56a4('0x95'),_0x25ae96[_0x56a4('0x4d')],_0x25ae96['type']);}else{if(_[_0x56a4('0x96')](_0x1f1f65[_0x56a4('0x34')][_0x56a4('0x97')](),_0x56a4('0x98'))){if(this[_0x56a4('0xf')][_0x1f1f65['linkedid']]){var _0x5d4115=_['last'](this[_0x56a4('0xf')][_0x1f1f65[_0x56a4('0x99')]]);_0x5d4115[_0x56a4('0x83')]=![];_0x5d4115['queuecallerexit']=!![];_0x5d4115[_0x56a4('0x92')]=moment(_0x25ae96['queuecallerjoinAt'])['add'](_0x1f1f65[_0x56a4('0x84')],_0x56a4('0x9a'))['format'](_0x56a4('0x79'));_0x5d4115[_0x56a4('0x4b')]='FORWARDTRANSFER';_0x5d4115[_0x56a4('0x94')]=!![];_0x5d4115['transfertype']=_0x56a4('0x9b');_0x5d4115[_0x56a4('0x9c')]=_0x1f1f65[_0x56a4('0x9d')];_0x5d4115[_0x56a4('0x9e')]=_0x1f1f65[_0x56a4('0x44')];logger[_0x56a4('0x6e')](_0x56a4('0x9f'),_0x5d4115[_0x56a4('0x4d')],_0x5d4115[_0x56a4('0x50')]);var _0xb42566=this[_0x56a4('0xf')][_0x1f1f65[_0x56a4('0x99')]];this[_0x56a4('0xf')][_0x1f1f65['linkedid']]=this['queueReports'][_0x1f1f65[_0x56a4('0x44')]];this[_0x56a4('0xf')][_0x1f1f65['uniqueid']]=_0xb42566;}}else{_0x25ae96[_0x56a4('0x4b')]=_0x56a4('0xa0')+_0x1f1f65[_0x56a4('0x93')][_0x56a4('0xa1')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x25ae96[_0x56a4('0x4d')],_0x25ae96[_0x56a4('0x50')],_0x25ae96[_0x56a4('0x4b')]);}}}this[_0x56a4('0x11')][_0x1f1f65[_0x56a4('0x44')]]=_0x25ae96;this[_0x56a4('0x3e')](_0x25ae96,'agentcomplete');}}}catch(_0x5bad05){logger[_0x56a4('0x38')]('[%s][voiceQueueReport][agentcomplete]',_0x1f1f65['uniqueid'],util[_0x56a4('0x45')](_0x5bad05,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56a4('0xa')][_0x56a4('0x1f')]=function(_0xe7e2e9){try{if(this['isNotNull'](_0xe7e2e9)){logger['debug']('[%s][voiceQueueReport][varset]',_0xe7e2e9['uniqueid'],util[_0x56a4('0x45')](_0xe7e2e9,{'showHidden':![],'depth':null}));this['addVariable'](_0xe7e2e9[_0x56a4('0x44')],_[_0x56a4('0x7e')](_0xe7e2e9[_0x56a4('0xa2')])[0x0],_0xe7e2e9['value']);if(this[_0x56a4('0xf')][_0xe7e2e9[_0x56a4('0x44')]]){var _0x5766e0=_[_0x56a4('0x82')](this[_0x56a4('0xf')][_0xe7e2e9[_0x56a4('0x44')]]);if(_0x5766e0){if(this[_0x56a4('0x63')](_0xe7e2e9[_0x56a4('0xa2')])&&this['isNotNull'](_0xe7e2e9['variable'][_0x56a4('0xa3')])){switch(_0xe7e2e9['value']){case _0x56a4('0xa4'):_0x5766e0['queuecallerexit']=![];_0x5766e0[_0x56a4('0x92')]=null;break;case _0x56a4('0xa5'):_0x5766e0[_0x56a4('0xa6')]=_0x56a4('0xa7');_0x5766e0[_0x56a4('0x91')]=!![];_0x5766e0['queuecallerexitAt']=moment()[_0x56a4('0x46')](_0x56a4('0x79'));_0x5766e0['queuecallerleaveAt']=moment()[_0x56a4('0x46')](_0x56a4('0x79'));logger[_0x56a4('0x41')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0xe7e2e9['uniqueid'],util[_0x56a4('0x45')](_0x5766e0,{'showHidden':![],'depth':null}));ami['emit'](_0x56a4('0xa8'),_0x5766e0);break;default:_0x5766e0[_0x56a4('0x91')]=!![];_0x5766e0[_0x56a4('0x92')]=moment()[_0x56a4('0x46')](_0x56a4('0x79'));_0x5766e0['queuecallerleaveAt']=moment()[_0x56a4('0x46')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5766e0[_0x56a4('0x18')]=![];_0x5766e0[_0x56a4('0x86')]=null;_0x5766e0[_0x56a4('0x4b')]=_0xe7e2e9[_0x56a4('0xa9')];this['channels'][_0xe7e2e9[_0x56a4('0x44')]]=_0x5766e0;this['emitVoiceQueueChannelRemove'](_0x5766e0,_0x56a4('0x1e'));}else if(this[_0x56a4('0x63')](_0xe7e2e9[_0x56a4('0xa2')])&&this[_0x56a4('0x63')](_0xe7e2e9[_0x56a4('0xa2')]['queueposition'])){if(!_0x5766e0[_0x56a4('0x18')]){_0x5766e0[_0x56a4('0x91')]=!![];_0x5766e0[_0x56a4('0x92')]=moment()[_0x56a4('0x46')](_0x56a4('0x79'));_0x5766e0['queuecallerexitreason']=_0x56a4('0xaa');_0x5766e0['queuecallerleaveAt']=moment()[_0x56a4('0x46')](_0x56a4('0x79'));this[_0x56a4('0x11')][_0xe7e2e9[_0x56a4('0x44')]]=_0x5766e0;}}logger[_0x56a4('0x6e')](_0x56a4('0xab'),_0xe7e2e9[_0x56a4('0x44')],_0x5766e0[_0x56a4('0x4d')],_0x5766e0['type'],_[_0x56a4('0x7e')](_0xe7e2e9[_0x56a4('0xa2')])[0x0],_0xe7e2e9[_0x56a4('0xa9')]);_0x5766e0[_0x56a4('0x14')]=this[_0x56a4('0x14')][_0xe7e2e9[_0x56a4('0x44')]];}}}}catch(_0xab05e3){logger[_0x56a4('0x38')](_0x56a4('0xac'),_0xe7e2e9[_0x56a4('0x44')],util['inspect'](_0xab05e3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56a4('0xa')]['addVariable']=function(_0xaf666b,_0x57c5a5,_0x267fbc){var _0x310423=[_0x56a4('0xad'),'rtpaudioqosbridged',_0x56a4('0xae'),_0x56a4('0xaf'),'rtpaudioqosloss',_0x56a4('0xb0'),_0x56a4('0xb1'),_0x56a4('0xb2'),_0x56a4('0xb3'),_0x56a4('0xb4'),_0x56a4('0xb5'),'bridgepvtcallid',_0x56a4('0xb6'),'memberdynamic','memberinterface',_0x56a4('0xb7'),_0x56a4('0x90'),_0x56a4('0xb8'),_0x56a4('0xb9')];if(!_[_0x56a4('0x31')](_0x57c5a5)&&!_[_0x56a4('0xba')](_0x310423,_0x57c5a5)){if(_[_0x56a4('0x64')](this['variables'][_0xaf666b])){this[_0x56a4('0x14')][_0xaf666b]={};}this[_0x56a4('0x14')][_0xaf666b][_0x57c5a5]=_0x267fbc;}};VoiceQueueReport['prototype'][_0x56a4('0x20')]=function(_0x168490){try{if(this[_0x56a4('0x63')](_0x168490)){logger[_0x56a4('0x41')]('[%s][voiceQueueReport][hangup]',_0x168490[_0x56a4('0x44')],util['inspect'](_0x168490,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x168490[_0x56a4('0x44')]]){for(var _0x6bbb34=0x0,_0x131e66={};_0x6bbb340x0?_0x16769d:0x0;this[_0x5401('0xf')][_0x184f7c['queue']]['talking']=this[_0x5401('0xf')][_0x184f7c[_0x5401('0x6b')]]['talking']>_['toNumber'](_0x184f7c[_0x5401('0x6f')])?_[_0x5401('0x6e')](_0x184f7c[_0x5401('0x6f')]):this[_0x5401('0xf')][_0x184f7c[_0x5401('0x6b')]][_0x5401('0x55')];this[_0x5401('0x4c')](this['voiceQueues'][_0x184f7c[_0x5401('0x6b')]],'queuesummary');}logger['debug'](_0x5401('0x70'),util[_0x5401('0x38')](this[_0x5401('0xf')][_0x184f7c[_0x5401('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x5401('0x40')](_0x5401('0x71'),this['voiceQueues'][_0x184f7c[_0x5401('0x6b')]]);}}}catch(_0x1db9c7){logger[_0x5401('0x37')](_0x5401('0x67'),util[_0x5401('0x38')](_0x1db9c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5401('0xa')][_0x5401('0x72')]=function(_0xb9c161){logger[_0x5401('0x42')](_0x5401('0x73'),util['inspect'](_0xb9c161,{'showHidden':![],'depth':null}));this[_0x5401('0x10')]=!![];};VoiceQueueReport[_0x5401('0xa')][_0x5401('0x15')]=function(_0x1e266c){try{if(this[_0x5401('0x60')](_0x1e266c)){logger[_0x5401('0x42')](_0x5401('0x74'),_0x1e266c['uniqueid'],util[_0x5401('0x38')](_0x1e266c,{'showHidden':![],'depth':null}));if(_[_0x5401('0x61')](this[_0x5401('0x39')][_0x1e266c[_0x5401('0x47')]]))this['queueReports'][_0x1e266c[_0x5401('0x47')]]=[];if(_['isUndefined'](this[_0x5401('0xe')][_0x1e266c[_0x5401('0x47')]]))this[_0x5401('0xe')][_0x1e266c[_0x5401('0x47')]]={};var _0x4e8cea=new QueueReport();_0x4e8cea[_0x5401('0x49')]=_0x1e266c[_0x5401('0x6b')];_0x4e8cea[_0x5401('0x56')]=this[_0x5401('0xf')][_0x4e8cea[_0x5401('0x49')]]&&this[_0x5401('0xf')][_0x4e8cea[_0x5401('0x49')]][_0x5401('0x56')]?this[_0x5401('0xf')][_0x4e8cea['name']][_0x5401('0x56')]||_0x5401('0x4d'):_0x5401('0x4d');_0x4e8cea[_0x5401('0x6b')]=_0x1e266c['queue'];_0x4e8cea['queuecallerjoinAt']=moment()[_0x5401('0x45')](_0x5401('0x75'));_0x4e8cea[_0x5401('0x76')]=_0x1e266c['position'];_0x4e8cea[_0x5401('0x77')]=_0x1e266c[_0x5401('0x77')];_0x4e8cea[_0x5401('0x47')]=_0x1e266c['uniqueid'];_0x4e8cea[_0x5401('0x78')]=this[_0x5401('0xe')][_0x1e266c[_0x5401('0x47')]]['routealias'];logger[_0x5401('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4e8cea[_0x5401('0x49')],_0x4e8cea[_0x5401('0x56')]);_[_0x5401('0x79')](_0x4e8cea,_[_0x5401('0x7a')](_0x1e266c,_[_0x5401('0x7b')](_0x4e8cea)));this[_0x5401('0x39')][_0x1e266c[_0x5401('0x47')]][_0x5401('0x7c')](_0x4e8cea);this['channels'][_0x1e266c[_0x5401('0x47')]]=_0x4e8cea;this[_0x5401('0x41')](_0x4e8cea,_0x5401('0x7d'));}}catch(_0x200260){logger[_0x5401('0x37')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1e266c[_0x5401('0x47')],util[_0x5401('0x38')](_0x200260,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5401('0x17')]=function(_0x20ad24){try{if(this[_0x5401('0x60')](_0x20ad24)){logger[_0x5401('0x42')](_0x5401('0x7e'),_0x20ad24[_0x5401('0x47')],util[_0x5401('0x38')](_0x20ad24,{'showHidden':![],'depth':null}));if(this[_0x5401('0x39')][_0x20ad24[_0x5401('0x47')]]){var _0x208cb1=_['last'](this[_0x5401('0x39')][_0x20ad24[_0x5401('0x47')]]);_0x208cb1[_0x5401('0x7f')]=![];_0x208cb1['queuecallercompleteAt']=null;_0x208cb1[_0x5401('0x80')]=_0x20ad24[_0x5401('0x80')];_0x208cb1[_0x5401('0x81')]=_0x20ad24[_0x5401('0x81')];_0x208cb1[_0x5401('0x16')]=!![];_0x208cb1[_0x5401('0x82')]=moment()[_0x5401('0x45')](_0x5401('0x75'));_0x208cb1[_0x5401('0x83')]=_0x5401('0x84');_0x208cb1[_0x5401('0x85')]=null;logger['info'](_0x5401('0x86'),_0x208cb1[_0x5401('0x49')],_0x208cb1['type']);this[_0x5401('0xe')][_0x20ad24[_0x5401('0x47')]]=_0x208cb1;this[_0x5401('0x3e')](_0x208cb1,_0x5401('0x16'));}}}catch(_0x4a0e31){logger[_0x5401('0x37')](_0x5401('0x7e'),_0x20ad24[_0x5401('0x47')],util['inspect'](_0x4a0e31,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5401('0xa')][_0x5401('0x19')]=function(_0x2e8db4){try{if(this[_0x5401('0x60')](_0x2e8db4)){logger['debug'](_0x5401('0x87'),_0x2e8db4[_0x5401('0x47')],util[_0x5401('0x38')](_0x2e8db4,{'showHidden':![],'depth':null}));if(this[_0x5401('0x39')][_0x2e8db4[_0x5401('0x47')]]){var _0x32bebf=_[_0x5401('0x88')](this[_0x5401('0x39')][_0x2e8db4[_0x5401('0x47')]]);_0x32bebf[_0x5401('0x89')]=moment()[_0x5401('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x32bebf[_0x5401('0x8a')]=_0x2e8db4[_0x5401('0x8a')];_0x32bebf[_0x5401('0x8b')]=_0x2e8db4[_0x5401('0x8b')];logger[_0x5401('0x69')](_0x5401('0x8c'),_0x32bebf[_0x5401('0x49')],_0x32bebf['type'],_0x2e8db4[_0x5401('0x8a')],_0x2e8db4['connectedlinename']);this['channels'][_0x2e8db4[_0x5401('0x47')]]=_0x32bebf;this[_0x5401('0x41')](_0x32bebf,_0x5401('0x18'));}}}catch(_0x2b5c2b){logger[_0x5401('0x37')](_0x5401('0x87'),_0x2e8db4['uniqueid'],util[_0x5401('0x38')](_0x2b5c2b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5401('0xa')]['syncAgentConnect']=function(_0x57940d){try{if(this[_0x5401('0x60')](_0x57940d)){logger[_0x5401('0x42')](_0x5401('0x8d'),_0x57940d[_0x5401('0x47')],util['inspect'](_0x57940d,{'showHidden':![],'depth':null}));if(this[_0x5401('0x39')][_0x57940d[_0x5401('0x47')]]){var _0x212abe=_[_0x5401('0x88')](this[_0x5401('0x39')][_0x57940d['uniqueid']]);_0x212abe[_0x5401('0x7f')]=!![];_0x212abe[_0x5401('0x83')]='COMPLETEDBYAGENT';logger[_0x5401('0x69')](_0x5401('0x8e'),_0x212abe[_0x5401('0x49')],_0x212abe[_0x5401('0x56')]);}}}catch(_0x388817){logger[_0x5401('0x37')](_0x5401('0x8d'),_0x57940d[_0x5401('0x47')],util[_0x5401('0x38')](_0x388817,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5401('0x1b')]=function(_0xdfb0b){try{if(this[_0x5401('0x60')](_0xdfb0b)){logger[_0x5401('0x42')](_0x5401('0x8f'),_0xdfb0b[_0x5401('0x47')],util[_0x5401('0x38')](_0xdfb0b,{'showHidden':![],'depth':null}));if(this[_0x5401('0x39')][_0xdfb0b['uniqueid']]){var _0x222abe=_[_0x5401('0x88')](this[_0x5401('0x39')][_0xdfb0b[_0x5401('0x47')]]);_0x222abe[_0x5401('0x16')]=![];_0x222abe['queuecallerabandonAt']=null;_0x222abe[_0x5401('0x90')]=!![];_0x222abe['lastAssignedTo']=_0xdfb0b[_0x5401('0x91')];_0x222abe[_0x5401('0x80')]=_0xdfb0b[_0x5401('0x80')];_0x222abe[_0x5401('0x7f')]=!![];_0x222abe['queuecallerexit']=![];_0x222abe[_0x5401('0x92')]=null;if(!_0x222abe[_0x5401('0x93')]){if(_0xdfb0b[_0x5401('0x94')]=='transfer'){_0x222abe[_0x5401('0x83')]=_0x5401('0x95');logger[_0x5401('0x69')](_0x5401('0x96'),_0x222abe['name'],_0x222abe['type']);}else{if(_[_0x5401('0x97')](_0xdfb0b[_0x5401('0x98')][_0x5401('0x99')](),_0x5401('0x9a'))){if(this[_0x5401('0x39')][_0xdfb0b[_0x5401('0x9b')]]){var _0x486e9f=_[_0x5401('0x88')](this[_0x5401('0x39')][_0xdfb0b[_0x5401('0x9b')]]);_0x486e9f[_0x5401('0x7f')]=![];_0x486e9f[_0x5401('0x9c')]=!![];_0x486e9f['queuecallerexitAt']=moment(_0x222abe[_0x5401('0x9d')])['add'](_0xdfb0b['holdtime'],'seconds')['format'](_0x5401('0x75'));_0x486e9f[_0x5401('0x83')]=_0x5401('0x9e');_0x486e9f[_0x5401('0x93')]=!![];_0x486e9f[_0x5401('0x9f')]=_0x5401('0xa0');_0x486e9f['transferexten']=_0xdfb0b[_0x5401('0xa1')];_0x486e9f[_0x5401('0xa2')]=_0xdfb0b[_0x5401('0x47')];logger[_0x5401('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x486e9f[_0x5401('0x49')],_0x486e9f[_0x5401('0x56')]);var _0x4dea86=this[_0x5401('0x39')][_0xdfb0b[_0x5401('0x9b')]];this[_0x5401('0x39')][_0xdfb0b[_0x5401('0x9b')]]=this['queueReports'][_0xdfb0b['uniqueid']];this['queueReports'][_0xdfb0b[_0x5401('0x47')]]=_0x4dea86;}}else{_0x222abe[_0x5401('0x83')]='COMPLETEDBY'+_0xdfb0b[_0x5401('0x94')][_0x5401('0xa3')]();logger['info'](_0x5401('0xa4'),_0x222abe['name'],_0x222abe[_0x5401('0x56')],_0x222abe['queuecallerexitreason']);}}}this[_0x5401('0xe')][_0xdfb0b[_0x5401('0x47')]]=_0x222abe;this[_0x5401('0x3e')](_0x222abe,'agentcomplete');}}}catch(_0x279b43){logger[_0x5401('0x37')](_0x5401('0x8f'),_0xdfb0b[_0x5401('0x47')],util['inspect'](_0x279b43,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5401('0xa')][_0x5401('0x1f')]=function(_0x477eb4){try{if(this[_0x5401('0x60')](_0x477eb4)){logger[_0x5401('0x42')](_0x5401('0xa5'),_0x477eb4['uniqueid'],util['inspect'](_0x477eb4,{'showHidden':![],'depth':null}));this[_0x5401('0xa6')](_0x477eb4[_0x5401('0x47')],_[_0x5401('0x7b')](_0x477eb4[_0x5401('0xa7')])[0x0],_0x477eb4[_0x5401('0xa8')]);if(this['queueReports'][_0x477eb4[_0x5401('0x47')]]){var _0x2683ea=_[_0x5401('0x88')](this[_0x5401('0x39')][_0x477eb4[_0x5401('0x47')]]);if(_0x2683ea){if(this['isNotNull'](_0x477eb4[_0x5401('0xa7')])&&this[_0x5401('0x60')](_0x477eb4[_0x5401('0xa7')][_0x5401('0xa9')])){switch(_0x477eb4[_0x5401('0xa8')]){case'CONTINUE':_0x2683ea['queuecallerexit']=![];_0x2683ea['queuecallerexitAt']=null;break;case _0x5401('0xaa'):_0x2683ea[_0x5401('0xab')]=_0x5401('0xac');_0x2683ea['queuecallerexit']=!![];_0x2683ea[_0x5401('0x92')]=moment()[_0x5401('0x45')](_0x5401('0x75'));_0x2683ea['queuecallerleaveAt']=moment()[_0x5401('0x45')](_0x5401('0x75'));logger[_0x5401('0x42')](_0x5401('0xad'),_0x477eb4[_0x5401('0x47')],util['inspect'](_0x2683ea,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x2683ea);break;default:_0x2683ea[_0x5401('0x9c')]=!![];_0x2683ea[_0x5401('0x92')]=moment()[_0x5401('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x2683ea[_0x5401('0x89')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2683ea['queuecallerabandon']=![];_0x2683ea[_0x5401('0x82')]=null;_0x2683ea[_0x5401('0x83')]=_0x477eb4['value'];this[_0x5401('0xe')][_0x477eb4[_0x5401('0x47')]]=_0x2683ea;this['emitVoiceQueueChannelRemove'](_0x2683ea,'varset');}else if(this[_0x5401('0x60')](_0x477eb4[_0x5401('0xa7')])&&this['isNotNull'](_0x477eb4['variable'][_0x5401('0xae')])){if(!_0x2683ea[_0x5401('0x16')]){_0x2683ea['queuecallerexit']=!![];_0x2683ea[_0x5401('0x92')]=moment()[_0x5401('0x45')](_0x5401('0x75'));_0x2683ea[_0x5401('0x83')]=_0x5401('0xaf');_0x2683ea[_0x5401('0x89')]=moment()['format'](_0x5401('0x75'));this[_0x5401('0xe')][_0x477eb4[_0x5401('0x47')]]=_0x2683ea;}}logger[_0x5401('0x69')](_0x5401('0xb0'),_0x477eb4[_0x5401('0x47')],_0x2683ea[_0x5401('0x49')],_0x2683ea[_0x5401('0x56')],_[_0x5401('0x7b')](_0x477eb4[_0x5401('0xa7')])[0x0],_0x477eb4['value']);_0x2683ea[_0x5401('0x3a')]=this['variables'][_0x477eb4[_0x5401('0x47')]];}}}}catch(_0x246fe0){logger[_0x5401('0x37')](_0x5401('0xa5'),_0x477eb4['uniqueid'],util[_0x5401('0x38')](_0x246fe0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5401('0xa')]['addVariable']=function(_0x17f05b,_0x500d9f,_0xbdf976){var _0x3a9618=[_0x5401('0xb1'),_0x5401('0xb2'),_0x5401('0xb3'),_0x5401('0xb4'),_0x5401('0xb5'),_0x5401('0xb6'),'rtpaudioqosrtt',_0x5401('0xb7'),'sipcallid',_0x5401('0xb8'),_0x5401('0xb9'),_0x5401('0xba'),_0x5401('0xbb'),_0x5401('0xbc'),_0x5401('0xbd'),_0x5401('0xbe'),_0x5401('0x91'),_0x5401('0xbf'),'memberrealtime'];if(!_[_0x5401('0x33')](_0x500d9f)&&!_[_0x5401('0xc0')](_0x3a9618,_0x500d9f)){if(_[_0x5401('0x61')](this[_0x5401('0x3a')][_0x17f05b])){this[_0x5401('0x3a')][_0x17f05b]={};}this[_0x5401('0x3a')][_0x17f05b][_0x500d9f]=_0xbdf976;}};VoiceQueueReport[_0x5401('0xa')][_0x5401('0x21')]=function(_0x2d209a){try{if(this[_0x5401('0x60')](_0x2d209a)){logger['debug'](_0x5401('0xc1'),_0x2d209a[_0x5401('0x47')],util['inspect'](_0x2d209a,{'showHidden':![],'depth':null}));if(this[_0x5401('0x39')][_0x2d209a['uniqueid']]){for(var _0x95239c=0x0,_0x587de2={};_0x95239c=0x0?moment(_0x13d44e[_0x3e17('0x1a')])[_0x3e17('0x1b')](_0x13d44e[_0x3e17('0x19')],_0x3e17('0xf')):null,'data1':_0x3e17('0x1c'),'data2':_0x13d44e[_0x3e17('0x14')],'data3':_0x13d44e['exten'],'data4':_0x13d44e[_0x3e17('0x1d')]||null,'role':_0x3e17('0x13'),'internal':_0x13d44e[_0x3e17('0x14')]?_[_0x3e17('0x15')](_0x13d44e['accountcode']):undefined,'uniqueid':_0x13d44e[_0x3e17('0x16')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x65d1=['voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','voice','starttime','endtime','diff','outbound','dialstring','moment','../client'];(function(_0x682069,_0x42209e){var _0x43c5fa=function(_0x550523){while(--_0x550523){_0x682069['push'](_0x682069['shift']());}};_0x43c5fa(++_0x42209e);}(_0x65d1,0x116));var _0x165d=function(_0x5275b8,_0x51e5dd){_0x5275b8=_0x5275b8-0x0;var _0x568a9b=_0x65d1[_0x5275b8];return _0x568a9b;};'use strict';var moment=require(_0x165d('0x0'));var _=require('lodash');var util=require('util');var client=require(_0x165d('0x1'));exports[_0x165d('0x2')]=function(_0xfb549b){var _0x1ca363=_0xfb549b[_0x165d('0x3')]||_0xfb549b['queuecallerexitAt'];return client[_0x165d('0x4')](_0x165d('0x5'),{'body':{'channel':'voice','membername':_0xfb549b[_0x165d('0x6')],'interface':_['isNil'](_0xfb549b[_0x165d('0x7')])?util[_0x165d('0x8')](_0x165d('0x9'),_0xfb549b[_0x165d('0x6')]):_0xfb549b['interface'],'type':_0x165d('0xa'),'enterAt':_0xfb549b[_0x165d('0xb')],'exitAt':_0x1ca363,'duration':moment(_0x1ca363)['diff'](_0xfb549b[_0x165d('0xb')],_0x165d('0xc')),'data1':_0x165d('0xd'),'data2':_0xfb549b[_0x165d('0xe')],'data3':_0xfb549b[_0x165d('0xf')],'data4':null,'data5':_0xfb549b[_0x165d('0x10')],'role':_0x165d('0x11'),'internal':_0xfb549b[_0x165d('0x12')]?_[_0x165d('0x13')](_0xfb549b['accountcode']):undefined,'uniqueid':_0xfb549b[_0x165d('0x14')]},'log':_0x165d('0x5')});};exports[_0x165d('0x15')]=function(_0x3129d6){return client['Request'](_0x165d('0x5'),{'body':{'channel':_0x165d('0x16'),'membername':_0x3129d6['membername'],'interface':_0x3129d6[_0x165d('0x7')],'type':_0x165d('0xa'),'enterAt':_0x3129d6[_0x165d('0x17')],'exitAt':_0x3129d6[_0x165d('0x18')],'duration':moment(_0x3129d6['endtime'])[_0x165d('0x19')](_0x3129d6[_0x165d('0x17')],_0x165d('0xc'))>=0x0?moment(_0x3129d6['endtime'])[_0x165d('0x19')](_0x3129d6['starttime'],'seconds'):null,'data1':_0x165d('0x1a'),'data2':_0x3129d6[_0x165d('0x12')],'data3':_0x3129d6[_0x165d('0xf')],'data4':_0x3129d6[_0x165d('0x1b')]||null,'role':_0x165d('0x11'),'internal':_0x3129d6[_0x165d('0x12')]?_[_0x165d('0x13')](_0x3129d6[_0x165d('0x12')]):undefined,'uniqueid':_0x3129d6[_0x165d('0x14')]},'log':_0x165d('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index d9571b3..28c503c 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 _0x977c=['getSettings','Request','ShowSetting','GetSettings'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0x977c,0x1d0));var _0xc977=function(_0x4347ee,_0x368f1a){_0x4347ee=_0x4347ee-0x0;var _0x4c2bfb=_0x977c[_0x4347ee];return _0x4c2bfb;};'use strict';var client=require('../client');exports[_0xc977('0x0')]=function(){return client[_0xc977('0x1')](_0xc977('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0xc977('0x3')});}; \ No newline at end of file +var _0x6f24=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client','getSettings'];(function(_0xcf7400,_0x28adf5){var _0x200342=function(_0x44d6bb){while(--_0x44d6bb){_0xcf7400['push'](_0xcf7400['shift']());}};_0x200342(++_0x28adf5);}(_0x6f24,0x76));var _0x46f2=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x6f24[_0x3afe18];return _0x19ed1f;};'use strict';var client=require(_0x46f2('0x0'));exports[_0x46f2('0x1')]=function(){return client['Request'](_0x46f2('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x46f2('0x3'),_0x46f2('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 3c34213..ee7f4f9 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 _0x20df=['getTemplates','GetTemplate','name','html','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20df,0x7c));var _0xf20d=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x20df[_0x310504];return _0x5b36d0;};'use strict';var client=require(_0xf20d('0x0'));exports[_0xf20d('0x1')]=function(_0x44f997){return function(_0x1e95cb){return client['Request'](_0xf20d('0x2'),{'options':{'raw':!![],'attributes':['id',_0xf20d('0x3'),_0xf20d('0x4')]},'log':_0xf20d('0x2')});};}; \ No newline at end of file +var _0x2f68=['Request','GetTemplate','html','getTemplates'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0x2f68,0x12b));var _0x82f6=function(_0xb6e079,_0x29f8df){_0xb6e079=_0xb6e079-0x0;var _0x24de70=_0x2f68[_0xb6e079];return _0x24de70;};'use strict';var client=require('../client');exports[_0x82f6('0x0')]=function(_0x7adcdc){return function(_0x1110ca){return client[_0x82f6('0x1')](_0x82f6('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x82f6('0x3')]},'log':_0x82f6('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index e07b837..ed8e323 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 _0xde09=['channel','field','value','AnyConditions','operator','Action','Actions','data1','data2','data3','data4','data5','getTriggers','Request','GetTrigger'];(function(_0x1467e3,_0x28c46b){var _0x4d26ab=function(_0x163fae){while(--_0x163fae){_0x1467e3['push'](_0x1467e3['shift']());}};_0x4d26ab(++_0x28c46b);}(_0xde09,0x93));var _0x9de0=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xde09[_0x5a776b];return _0xbbef59;};'use strict';var client=require('../client');exports[_0x9de0('0x0')]=function(_0x566589){return function(_0x4eaa24){return client[_0x9de0('0x1')](_0x9de0('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9de0('0x3'),'status'],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x9de0('0x4'),'operator',_0x9de0('0x5')]},{'model':'Condition','as':_0x9de0('0x6'),'attributes':['id',_0x9de0('0x4'),_0x9de0('0x7'),_0x9de0('0x5')]},{'model':_0x9de0('0x8'),'as':_0x9de0('0x9'),'attributes':['id','action',_0x9de0('0xa'),_0x9de0('0xb'),_0x9de0('0xc'),_0x9de0('0xd'),_0x9de0('0xe'),'data6','data7']}]},'log':_0x9de0('0x2')});};}; \ No newline at end of file +var _0xb540=['channel','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','Actions','data2','data3','data7','../client','getTriggers','Request','GetTrigger'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xb540,0xa6));var _0x0b54=function(_0x261bc1,_0x2dee77){_0x261bc1=_0x261bc1-0x0;var _0x27c1d1=_0xb540[_0x261bc1];return _0x27c1d1;};'use strict';var client=require(_0x0b54('0x0'));exports[_0x0b54('0x1')]=function(_0x113064){return function(_0x19c74c){return client[_0x0b54('0x2')](_0x0b54('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0b54('0x4'),_0x0b54('0x5')],'include':[{'model':_0x0b54('0x6'),'as':_0x0b54('0x7'),'attributes':['id',_0x0b54('0x8'),_0x0b54('0x9'),'value']},{'model':_0x0b54('0x6'),'as':_0x0b54('0xa'),'attributes':['id',_0x0b54('0x8'),_0x0b54('0x9'),_0x0b54('0xb')]},{'model':_0x0b54('0xc'),'as':_0x0b54('0xd'),'attributes':['id','action','data1',_0x0b54('0xe'),_0x0b54('0xf'),'data4','data5','data6',_0x0b54('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d993fe0..f3b8bf6 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 _0x45c9=['getTrunks','Request','GetTrunk','name','registry'];(function(_0xed9fea,_0x5ed774){var _0x198f12=function(_0xfb85f6){while(--_0xfb85f6){_0xed9fea['push'](_0xed9fea['shift']());}};_0x198f12(++_0x5ed774);}(_0x45c9,0x96));var _0x945c=function(_0x26a9b2,_0x423da6){_0x26a9b2=_0x26a9b2-0x0;var _0x3446aa=_0x45c9[_0x26a9b2];return _0x3446aa;};'use strict';var client=require('../client');exports[_0x945c('0x0')]=function(_0x50dd3f){return function(_0x1c778e){return client[_0x945c('0x1')](_0x945c('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x945c('0x3'),_0x945c('0x4'),'defaultuser']},'log':_0x945c('0x2')});};}; \ No newline at end of file +var _0x0060=['name','defaultuser','GetTrunk','getTrunks','Request'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x0060,0xda));var _0x0006=function(_0x46a55e,_0xe095bf){_0x46a55e=_0x46a55e-0x0;var _0x2648a8=_0x0060[_0x46a55e];return _0x2648a8;};'use strict';var client=require('../client');exports[_0x0006('0x0')]=function(_0x332a3e){return function(_0xd89d5f){return client[_0x0006('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0006('0x2'),'registry',_0x0006('0x3')]},'log':_0x0006('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index c160443..b8aebdd 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(_0x3ce307,_0x2f199b){var _0x536ece=function(_0x4b24b2){while(--_0x4b24b2){_0x3ce307['push'](_0x3ce307['shift']());}};_0x536ece(++_0x2f199b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xcb91[_0x1911ed];return _0x11edaa;};'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(_0x35ab00,_0x4e6b0b){var _0x3db045=function(_0x3c65f6){while(--_0x3c65f6){_0x35ab00['push'](_0x35ab00['shift']());}};_0x3db045(++_0x4e6b0b);}(_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 9b2856d..352dc95 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 _0x8f1d=['update','UpdateVoiceAgentReport','Request','CreateVoiceAgentReport'];(function(_0x3ea7a7,_0x1ee032){var _0x46f4e6=function(_0x3d7db4){while(--_0x3d7db4){_0x3ea7a7['push'](_0x3ea7a7['shift']());}};_0x46f4e6(++_0x1ee032);}(_0x8f1d,0x1c6));var _0xd8f1=function(_0x3a05a6,_0x5a2916){_0x3a05a6=_0x3a05a6-0x0;var _0x55a922=_0x8f1d[_0x3a05a6];return _0x55a922;};'use strict';var client=require('../client');exports['create']=function(_0x3033e6){return client[_0xd8f1('0x0')](_0xd8f1('0x1'),{'body':_0x3033e6,'log':_0xd8f1('0x1')});};exports[_0xd8f1('0x2')]=function(_0x22cbf2,_0x184ccf,_0xcc1d6d){return client[_0xd8f1('0x0')](_0xd8f1('0x3'),{'body':_0x22cbf2,'options':{'where':{'uniqueid':_0x184ccf,'interface':_0xcc1d6d,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x9d88=['create','Request','CreateVoiceAgentReport','update'];(function(_0x50674b,_0x297129){var _0x23314d=function(_0x45b0f4){while(--_0x45b0f4){_0x50674b['push'](_0x50674b['shift']());}};_0x23314d(++_0x297129);}(_0x9d88,0x140));var _0x89d8=function(_0x447de7,_0x433eb0){_0x447de7=_0x447de7-0x0;var _0x42ac84=_0x9d88[_0x447de7];return _0x42ac84;};'use strict';var client=require('../client');exports[_0x89d8('0x0')]=function(_0x41ac1a){return client[_0x89d8('0x1')](_0x89d8('0x2'),{'body':_0x41ac1a,'log':_0x89d8('0x2')});};exports[_0x89d8('0x3')]=function(_0x45d96f,_0x3bd6f8,_0x413b33){return client[_0x89d8('0x1')]('UpdateVoiceAgentReport',{'body':_0x45d96f,'options':{'where':{'uniqueid':_0x3bd6f8,'interface':_0x413b33,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index de361cd..e87e6c6 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 _0xdfd5=['context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','calleridnum'];(function(_0x183cec,_0x1c4e2c){var _0x573fd0=function(_0xfdb9fb){while(--_0xfdb9fb){_0x183cec['push'](_0x183cec['shift']());}};_0x573fd0(++_0x1c4e2c);}(_0xdfd5,0x7f));var _0x5dfd=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xdfd5[_0x273c39];return _0x46d6b5;};'use strict';var moment=require(_0x5dfd('0x0'));var util=require(_0x5dfd('0x1'));var _=require(_0x5dfd('0x2'));var client=require('../client');exports['create']=function(_0x12c821){return client[_0x5dfd('0x3')](_0x5dfd('0x4'),{'body':_['merge'](_0x12c821,{'source':_0x12c821[_0x5dfd('0x5')],'destinationcontext':_0x12c821[_0x5dfd('0x6')],'callerid':_0x12c821[_0x5dfd('0x7')],'amaflags':_0x5dfd('0x8')}),'log':_0x5dfd('0x4')});};exports[_0x5dfd('0x9')]=function(){return function(){return client[_0x5dfd('0x3')](_0x5dfd('0xa'),{'options':{'where':{'type':[_0x5dfd('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x5dfd('0xc'))[_0x5dfd('0xd')](_0x5dfd('0xe')),moment()['endOf'](_0x5dfd('0xc'))['format'](_0x5dfd('0xe'))]}},'attributes':[_0x5dfd('0xf'),_0x5dfd('0x10'),_0x5dfd('0x11'),'billableseconds']},'log':_0x5dfd('0x12')});};}; \ No newline at end of file +var _0x430a=['lodash','create','CreateVoiceCallReport','merge','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x3bfe0a,_0x1168e3){var _0x198d2f=function(_0x86bc35){while(--_0x86bc35){_0x3bfe0a['push'](_0x3bfe0a['shift']());}};_0x198d2f(++_0x1168e3);}(_0x430a,0x12a));var _0xa430=function(_0x565840,_0x284670){_0x565840=_0x565840-0x0;var _0x34885b=_0x430a[_0x565840];return _0x34885b;};'use strict';var moment=require(_0xa430('0x0'));var util=require(_0xa430('0x1'));var _=require(_0xa430('0x2'));var client=require('../client');exports[_0xa430('0x3')]=function(_0x27b378){return client['Request'](_0xa430('0x4'),{'body':_[_0xa430('0x5')](_0x27b378,{'source':_0x27b378['calleridnum'],'destinationcontext':_0x27b378['context'],'callerid':_0x27b378[_0xa430('0x6')],'amaflags':_0xa430('0x7')}),'log':_0xa430('0x4')});};exports[_0xa430('0x8')]=function(){return function(){return client[_0xa430('0x9')](_0xa430('0xa'),{'options':{'where':{'type':[_0xa430('0xb')],'createdAt':{'$between':[moment()[_0xa430('0xc')](_0xa430('0xd'))[_0xa430('0xe')](_0xa430('0xf')),moment()['endOf'](_0xa430('0xd'))[_0xa430('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0xa430('0x10'),_0xa430('0x11'),_0xa430('0x12')]},'log':_0xa430('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d9cdf32..8feb103 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 _0x8c45=['CreateVoiceDialReport','../client','create','Request'];(function(_0x148803,_0x4d91a1){var _0x311565=function(_0x18c0f2){while(--_0x18c0f2){_0x148803['push'](_0x148803['shift']());}};_0x311565(++_0x4d91a1);}(_0x8c45,0x125));var _0x58c4=function(_0x209955,_0x50e4f){_0x209955=_0x209955-0x0;var _0x4a9620=_0x8c45[_0x209955];return _0x4a9620;};'use strict';var client=require(_0x58c4('0x0'));exports[_0x58c4('0x1')]=function(_0x47b29d){return client[_0x58c4('0x2')](_0x58c4('0x3'),{'body':_0x47b29d,'log':_0x58c4('0x3')});}; \ No newline at end of file +var _0x4f08=['Request','CreateVoiceDialReport','../client','create'];(function(_0x11877b,_0x3d3b9b){var _0x916f41=function(_0x504732){while(--_0x504732){_0x11877b['push'](_0x11877b['shift']());}};_0x916f41(++_0x3d3b9b);}(_0x4f08,0x19e));var _0x84f0=function(_0x4a8600,_0x1e723e){_0x4a8600=_0x4a8600-0x0;var _0x4458b6=_0x4f08[_0x4a8600];return _0x4458b6;};'use strict';var client=require(_0x84f0('0x0'));exports[_0x84f0('0x1')]=function(_0x3d7df6){return client[_0x84f0('0x2')](_0x84f0('0x3'),{'body':_0x3d7df6,'log':_0x84f0('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ecc38d1..746a68e 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 _0x579c=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x3e803d,_0x5d4750){var _0x4c3220=function(_0x2b1a9d){while(--_0x2b1a9d){_0x3e803d['push'](_0x3e803d['shift']());}};_0x4c3220(++_0x5d4750);}(_0x579c,0xda));var _0xc579=function(_0x403133,_0x3dc612){_0x403133=_0x403133-0x0;var _0x5c8a93=_0x579c[_0x403133];return _0x5c8a93;};'use strict';var client=require(_0xc579('0x0'));exports[_0xc579('0x1')]=function(){return function(){return client[_0xc579('0x2')](_0xc579('0x3'),{'options':{'raw':!![],'attributes':['id',_0xc579('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xc579('0x1')});};}; \ No newline at end of file +var _0x81a5=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x81a5,0x1c8));var _0x581a=function(_0x66a014,_0x5d9f5c){_0x66a014=_0x66a014-0x0;var _0x3a3404=_0x81a5[_0x66a014];return _0x3a3404;};'use strict';var client=require(_0x581a('0x0'));exports[_0x581a('0x1')]=function(){return function(){return client[_0x581a('0x2')](_0x581a('0x3'),{'options':{'raw':!![],'attributes':['id',_0x581a('0x4'),_0x581a('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index a17e59d..fda49d2 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 _0x8dd9=['name','acw','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','Request'];(function(_0x36bf71,_0x50d4c1){var _0x2bb65f=function(_0x171e3f){while(--_0x171e3f){_0x36bf71['push'](_0x36bf71['shift']());}};_0x2bb65f(++_0x50d4c1);}(_0x8dd9,0x16b));var _0x98dd=function(_0x105608,_0x567eea){_0x105608=_0x105608-0x0;var _0x4938a2=_0x8dd9[_0x105608];return _0x4938a2;};'use strict';var client=require(_0x98dd('0x0'));exports[_0x98dd('0x1')]=function(){return function(){return client[_0x98dd('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x98dd('0x3'),_0x98dd('0x4'),'acwTimeout','autopause',_0x98dd('0x5'),_0x98dd('0x6'),_0x98dd('0x7'),'dialMethod',_0x98dd('0x8'),_0x98dd('0x9'),_0x98dd('0xa'),'dialPredictiveOptimization',_0x98dd('0xb'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x98dd('0xc'),_0x98dd('0xd'),'dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0x98dd('0xe'),_0x98dd('0xf'),_0x98dd('0x10'),_0x98dd('0x11'),_0x98dd('0x12'),_0x98dd('0x13'),_0x98dd('0x14'),_0x98dd('0x15'),_0x98dd('0x16'),_0x98dd('0x17'),_0x98dd('0x18'),_0x98dd('0x19'),_0x98dd('0x1a'),_0x98dd('0x1b'),_0x98dd('0x1c'),'dialAMDMinWordLength',_0x98dd('0x1d'),_0x98dd('0x1e'),_0x98dd('0x1f'),_0x98dd('0x20'),'timeout',_0x98dd('0x21'),'dialRecallInQueue',_0x98dd('0x22'),_0x98dd('0x23'),_0x98dd('0x24'),'dialQueueProject2',_0x98dd('0x5'),_0x98dd('0x25'),_0x98dd('0x26'),_0x98dd('0x27'),_0x98dd('0x28'),_0x98dd('0x29'),_0x98dd('0x2a'),_0x98dd('0x2b'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x98dd('0x2c'),_0x98dd('0x2d'),_0x98dd('0x2e'),_0x98dd('0x2f'),_0x98dd('0x30'),_0x98dd('0x31'),_0x98dd('0x32'),_0x98dd('0x33'),_0x98dd('0x34')],'include':[{'model':_0x98dd('0x35'),'as':_0x98dd('0x35'),'attributes':['id','name',_0x98dd('0x36'),'active']},{'model':_0x98dd('0x37'),'as':_0x98dd('0x38'),'attributes':['id','name']},{'model':_0x98dd('0x35'),'as':_0x98dd('0x39'),'attributes':['id',_0x98dd('0x3'),_0x98dd('0x36'),_0x98dd('0x3a')]},{'model':_0x98dd('0x3b'),'as':_0x98dd('0x3b'),'attributes':['id','name'],'include':[{'model':_0x98dd('0x3b'),'as':_0x98dd('0x3c'),'attributes':['id',_0x98dd('0x3'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xaa08=['dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','mandatoryDispositionPause','callerid','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy'];(function(_0x2674ce,_0x3c0a72){var _0x7eca7d=function(_0x1780f6){while(--_0x1780f6){_0x2674ce['push'](_0x2674ce['shift']());}};_0x7eca7d(++_0x3c0a72);}(_0xaa08,0xc6));var _0x8aa0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaa08[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x8aa0('0x0'));exports[_0x8aa0('0x1')]=function(){return function(){return client['Request'](_0x8aa0('0x2'),{'options':{'raw':![],'attributes':['id',_0x8aa0('0x3'),_0x8aa0('0x4'),_0x8aa0('0x5'),_0x8aa0('0x6'),_0x8aa0('0x7'),'type',_0x8aa0('0x8'),_0x8aa0('0x9'),_0x8aa0('0xa'),'dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0x8aa0('0xb'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x8aa0('0xc'),_0x8aa0('0xd'),_0x8aa0('0xe'),'dialQueueTimeout',_0x8aa0('0xf'),'dialCongestionMaxRetry',_0x8aa0('0x10'),_0x8aa0('0x11'),_0x8aa0('0x12'),_0x8aa0('0x13'),_0x8aa0('0x14'),'dialGlobalMaxRetry',_0x8aa0('0x15'),_0x8aa0('0x16'),'dialPrefix',_0x8aa0('0x17'),_0x8aa0('0x18'),'dialAMDInitialSilence','dialAMDGreeting',_0x8aa0('0x19'),_0x8aa0('0x1a'),'dialAMDMinWordLength',_0x8aa0('0x1b'),_0x8aa0('0x1c'),_0x8aa0('0x1d'),_0x8aa0('0x1e'),_0x8aa0('0x1f'),_0x8aa0('0x20'),_0x8aa0('0x21'),_0x8aa0('0x22'),_0x8aa0('0x23'),'dialAgiAfterHangupClient',_0x8aa0('0x24'),_0x8aa0('0x7'),_0x8aa0('0x25'),_0x8aa0('0x26'),_0x8aa0('0x27'),_0x8aa0('0x28'),_0x8aa0('0x29'),_0x8aa0('0x2a'),_0x8aa0('0x2b'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x8aa0('0x2c'),_0x8aa0('0x2d'),_0x8aa0('0x2e'),_0x8aa0('0x2f'),_0x8aa0('0x30'),_0x8aa0('0x31'),_0x8aa0('0x32'),_0x8aa0('0x33')],'include':[{'model':_0x8aa0('0x34'),'as':_0x8aa0('0x34'),'attributes':['id','name','callerid',_0x8aa0('0x35')]},{'model':'Pause','as':_0x8aa0('0x36'),'attributes':['id',_0x8aa0('0x3')]},{'model':_0x8aa0('0x34'),'as':'TrunkBackup','attributes':['id','name',_0x8aa0('0x37'),_0x8aa0('0x35')]},{'model':_0x8aa0('0x38'),'as':_0x8aa0('0x38'),'attributes':['id',_0x8aa0('0x3')],'include':[{'model':_0x8aa0('0x38'),'as':_0x8aa0('0x39'),'attributes':['id',_0x8aa0('0x3'),_0x8aa0('0x3a')]}]}]},'log':_0x8aa0('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index f38c9ea..2b700ed 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(_0x54ba8b,_0x3f6863){var _0x18f656=function(_0x33e1a5){while(--_0x33e1a5){_0x54ba8b['push'](_0x54ba8b['shift']());}};_0x18f656(++_0x3f6863);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x16c08c,_0x1e70ce){var _0xbb7989=function(_0x463417){while(--_0x463417){_0x16c08c['push'](_0x16c08c['shift']());}};_0xbb7989(++_0x1e70ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 2b2e8a5..7346a1a 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 _0x3102=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x165ece,_0x1f0a42){var _0x545fe6=function(_0x1ac8e9){while(--_0x1ac8e9){_0x165ece['push'](_0x165ece['shift']());}};_0x545fe6(++_0x1f0a42);}(_0x3102,0x1e7));var _0x2310=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0x3102[_0x4fdcc0];return _0xc0ce94;};'use strict';var client=require(_0x2310('0x0'));exports[_0x2310('0x1')]=function(_0xa4dd76){return function(){return client[_0x2310('0x2')](_0x2310('0x3'),{'options':{'where':{'VoiceQueueId':_0xa4dd76,'paused':!![]},'raw':!![]},'log':_0x2310('0x1')});};}; \ No newline at end of file +var _0x0bbd=['Request','getVoiceQueueRtPauses'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0bbd,0x1f3));var _0xd0bb=function(_0x409e95,_0x3c96e2){_0x409e95=_0x409e95-0x0;var _0xd7fdc=_0x0bbd[_0x409e95];return _0xd7fdc;};'use strict';var client=require('../client');exports[_0xd0bb('0x0')]=function(_0x167fca){return function(){return client[_0xd0bb('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x167fca,'paused':!![]},'raw':!![]},'log':_0xd0bb('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 09b6133..14859e9 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2b5615,_0x408dcc){var _0x88bb54=function(_0x3c0d11){while(--_0x3c0d11){_0x2b5615['push'](_0x2b5615['shift']());}};_0x88bb54(++_0x408dcc);}(_0x7a54,0x106));var _0x47a5=function(_0x4b588a,_0x1439eb){_0x4b588a=_0x4b588a-0x0;var _0x17a5da=_0x7a54[_0x4b588a];return _0x17a5da;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x39e4d1,_0x336932){var _0x263e21=function(_0x3b77e4){while(--_0x3b77e4){_0x39e4d1['push'](_0x39e4d1['shift']());}};_0x263e21(++_0x336932);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 3ffe548..d5a1f71 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 _0x88c7=['result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','transfers','CreateVoiceTransferReport'];(function(_0x1376af,_0x4a98b1){var _0x32cae1=function(_0x2cd5b9){while(--_0x2cd5b9){_0x1376af['push'](_0x1376af['shift']());}};_0x32cae1(++_0x4a98b1);}(_0x88c7,0x1e2));var _0x788c=function(_0xe034ad,_0x51ee84){_0xe034ad=_0xe034ad-0x0;var _0x29d8c=_0x88c7[_0xe034ad];return _0x29d8c;};'use strict';var client=require('../client');exports[_0x788c('0x0')]={};exports['blindTransfer']=function(_0x4256aa){return client['Request'](_0x788c('0x1'),{'body':{'result':_0x4256aa[_0x788c('0x2')],'transfererchannel':_0x4256aa[_0x788c('0x3')],'transferercalleridnum':_0x4256aa[_0x788c('0x4')],'transferercalleridname':_0x4256aa[_0x788c('0x5')],'transfererconnectedlinenum':_0x4256aa[_0x788c('0x6')],'transfererconnectedlinename':_0x4256aa[_0x788c('0x7')],'transfereraccountcode':_0x4256aa[_0x788c('0x8')],'transferercontext':_0x4256aa[_0x788c('0x9')],'transfererexten':_0x4256aa[_0x788c('0xa')],'transfererlinkedid':_0x4256aa[_0x788c('0xb')],'transfereechannel':_0x4256aa[_0x788c('0xc')],'transfereecalleridnum':_0x4256aa[_0x788c('0xd')],'transfereecalleridname':_0x4256aa[_0x788c('0xe')],'transfereeconnectedlinenum':_0x4256aa[_0x788c('0xf')],'transfereeconnectedlinename':_0x4256aa[_0x788c('0x10')],'transfereeaccountcode':_0x4256aa[_0x788c('0x11')],'transfereecontext':_0x4256aa[_0x788c('0x12')],'transfereeexten':_0x4256aa[_0x788c('0x13')],'transfereelinkedid':_0x4256aa[_0x788c('0x14')],'isexternal':_0x4256aa[_0x788c('0x15')],'context':_0x4256aa['context'],'extension':_0x4256aa[_0x788c('0x16')],'type':_0x788c('0x17')},'log':_0x788c('0x1')});};exports['attendedTransfer']=function(_0x581e40){return client[_0x788c('0x18')](_0x788c('0x1'),{'body':{'result':_0x581e40['result'],'transfererchannel':_0x581e40[_0x788c('0x19')],'transferercalleridnum':_0x581e40[_0x788c('0x1a')],'transferercalleridname':_0x581e40[_0x788c('0x1b')],'transfererconnectedlinenum':_0x581e40[_0x788c('0x1c')],'transfererconnectedlinename':_0x581e40[_0x788c('0x1d')],'transfereraccountcode':_0x581e40[_0x788c('0x1e')],'transferercontext':_0x581e40[_0x788c('0x1f')],'transfererexten':_0x581e40[_0x788c('0x20')],'transfererlinkedid':_0x581e40[_0x788c('0x21')],'transfereechannel':_0x581e40[_0x788c('0x22')],'transfereecalleridnum':_0x581e40[_0x788c('0x23')],'transfereecalleridname':_0x581e40[_0x788c('0x24')],'transfereeconnectedlinenum':_0x581e40['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x581e40[_0x788c('0x25')],'transfereeaccountcode':_0x581e40[_0x788c('0x26')],'transfereecontext':_0x581e40[_0x788c('0x27')],'transfereeexten':_0x581e40[_0x788c('0x28')],'transfereelinkedid':_0x581e40[_0x788c('0x29')],'isexternal':_0x581e40[_0x788c('0x15')],'context':_0x581e40['origtransferercontext'],'extension':_0x581e40[_0x788c('0x2a')],'type':_0x788c('0x2b')},'log':_0x788c('0x1')});}; \ No newline at end of file +var _0x93b2=['transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext'];(function(_0x429a5e,_0x9393df){var _0x12220c=function(_0x361e00){while(--_0x361e00){_0x429a5e['push'](_0x429a5e['shift']());}};_0x12220c(++_0x9393df);}(_0x93b2,0x86));var _0x293b=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x93b2[_0x4a747d];return _0x3a5b5c;};'use strict';var client=require(_0x293b('0x0'));exports['transfers']={};exports[_0x293b('0x1')]=function(_0x30ac63){return client[_0x293b('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x30ac63['result'],'transfererchannel':_0x30ac63[_0x293b('0x3')],'transferercalleridnum':_0x30ac63[_0x293b('0x4')],'transferercalleridname':_0x30ac63['transferercalleridname'],'transfererconnectedlinenum':_0x30ac63[_0x293b('0x5')],'transfererconnectedlinename':_0x30ac63['transfererconnectedlinename'],'transfereraccountcode':_0x30ac63[_0x293b('0x6')],'transferercontext':_0x30ac63[_0x293b('0x7')],'transfererexten':_0x30ac63[_0x293b('0x8')],'transfererlinkedid':_0x30ac63['transfererlinkedid'],'transfereechannel':_0x30ac63[_0x293b('0x9')],'transfereecalleridnum':_0x30ac63[_0x293b('0xa')],'transfereecalleridname':_0x30ac63[_0x293b('0xb')],'transfereeconnectedlinenum':_0x30ac63['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x30ac63['transfereeconnectedlinename'],'transfereeaccountcode':_0x30ac63[_0x293b('0xc')],'transfereecontext':_0x30ac63[_0x293b('0xd')],'transfereeexten':_0x30ac63[_0x293b('0xe')],'transfereelinkedid':_0x30ac63[_0x293b('0xf')],'isexternal':_0x30ac63[_0x293b('0x10')],'context':_0x30ac63[_0x293b('0x11')],'extension':_0x30ac63[_0x293b('0x12')],'type':_0x293b('0x13')},'log':_0x293b('0x14')});};exports['attendedTransfer']=function(_0x163633){return client[_0x293b('0x2')](_0x293b('0x14'),{'body':{'result':_0x163633[_0x293b('0x15')],'transfererchannel':_0x163633[_0x293b('0x16')],'transferercalleridnum':_0x163633[_0x293b('0x17')],'transferercalleridname':_0x163633['origtransferercalleridname'],'transfererconnectedlinenum':_0x163633[_0x293b('0x18')],'transfererconnectedlinename':_0x163633['secondtransfererconnectedlinename'],'transfereraccountcode':_0x163633[_0x293b('0x19')],'transferercontext':_0x163633[_0x293b('0x1a')],'transfererexten':_0x163633['secondtransfererexten'],'transfererlinkedid':_0x163633['origtransfererlinkedid'],'transfereechannel':_0x163633[_0x293b('0x1b')],'transfereecalleridnum':_0x163633[_0x293b('0x1c')],'transfereecalleridname':_0x163633[_0x293b('0x1d')],'transfereeconnectedlinenum':_0x163633[_0x293b('0x1e')],'transfereeconnectedlinename':_0x163633[_0x293b('0x1f')],'transfereeaccountcode':_0x163633[_0x293b('0x20')],'transfereecontext':_0x163633['transfertargetcontext'],'transfereeexten':_0x163633[_0x293b('0x21')],'transfereelinkedid':_0x163633['transfertargetlinkedid'],'isexternal':_0x163633[_0x293b('0x10')],'context':_0x163633[_0x293b('0x22')],'extension':_0x163633[_0x293b('0x23')],'type':_0x293b('0x24')},'log':_0x293b('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1617701..b914414 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 _0xb511=['outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','username','map','channel','filename','uniqueid','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','MixMonitor\x20Success','catch','Channel\x20doesn\x27t\x20exist','voicechannel','validate','StopMixMonitor','destinationchannel','stop','%s.%s','status','queueChannels','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','keys','module','action','Action','then','message','error','pick','command','content','voiceQueues','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay'];(function(_0x5d02c6,_0x1bfdbc){var _0x22cc4e=function(_0xf68f41){while(--_0xf68f41){_0x5d02c6['push'](_0x5d02c6['shift']());}};_0x22cc4e(++_0x1bfdbc);}(_0xb511,0x165));var _0x1b51=function(_0x21941f,_0x33ce63){_0x21941f=_0x21941f-0x0;var _0x37ac96=_0xb511[_0x21941f];return _0x37ac96;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var jayson=require(_0x1b51('0x2'));var schema=require('validate');var BPromise=require(_0x1b51('0x3'));var moment=require(_0x1b51('0x4'));var config=require('../../../config/environment');var properties=require(_0x1b51('0x5'));var ami=require(_0x1b51('0x6'));exports[_0x1b51('0x7')]=function(_0x4d17ab,_0x14e88a,_0x463bec){return new BPromise(function(_0x506653,_0x475add){var _0x43c14c={'QueuePause':function(_0x5e7ece){return new Promise(function(_0xfa46a3,_0x1690c9){var _0x407a2f=util[_0x1b51('0x8')](_0x1b51('0x9'),_0x1b51('0xa'),_0x5e7ece[_0x1b51('0xb')]);if(_0x4d17ab[_0x1b51('0xc')]&&_0x4d17ab['timers'][_0x407a2f]&&_0x4d17ab[_0x1b51('0xc')][_0x407a2f][_0x1b51('0xd')]){_0x4d17ab[_0x1b51('0xc')][_0x407a2f][_0x1b51('0xe')]();}if(_0x4d17ab[_0x1b51('0xf')][_0x407a2f]){_0x4d17ab[_0x1b51('0xf')][_0x407a2f]['updateStatusRealtime']({'statePause':_0x5e7ece[_0x1b51('0x10')]?!![]:![]});}_0xfa46a3({'code':0xc8,'message':_0x1b51('0x11')});});},'Reload':function(_0x146dc0){var _0x119628=this;return new Promise(function(_0x3abd5c,_0x46c991){if(ami[_0x1b51('0x12')]()==![]){return _0x46c991(_0x119628['error'](0x1f4,[config[_0x1b51('0x13')]['ip'],config['asterisk']['username'],_0x1b51('0x14')][_0x1b51('0x15')]('\x20')));}_0x146dc0=_['pick'](_0x146dc0,_[_0x1b51('0x16')](properties[_0x1b51('0x17')]));_0x146dc0[_0x1b51('0x18')]='Reload';return ami[_0x1b51('0x19')](_0x146dc0)[_0x1b51('0x1a')](function(_0x24bfc1){_0x3abd5c({'code':0xc8,'message':_0x24bfc1[_0x1b51('0x1b')]});})['catch'](function(_0x238749){_0x46c991(_0x119628[_0x1b51('0x1c')](0x1f5,_0x238749[_0x1b51('0x1b')]));});});},'Command':function(_0x556762){var _0x5e222b=this;return new Promise(function(_0x1d67f3,_0x3ff992){if(ami['isConnected']()==![]){return _0x3ff992(_0x5e222b[_0x1b51('0x1c')](0x1f4,[config[_0x1b51('0x13')]['ip'],config['asterisk']['username'],_0x1b51('0x14')][_0x1b51('0x15')]('\x20')));}_0x556762=_[_0x1b51('0x1d')](_0x556762,_0x1b51('0x1e'));_0x556762['action']='Command';return ami[_0x1b51('0x19')](_0x556762)[_0x1b51('0x1a')](function(_0x4c6c6b){_0x1d67f3({'code':0xc8,'message':_0x4c6c6b[_0x1b51('0x1f')]});})['catch'](function(_0x4a2e45){_0x3ff992(_0x5e222b[_0x1b51('0x1c')](0x1f5,_0x4a2e45['message']));});});},'VoiceQueues':function(_0x1eac36){return new Promise(function(_0x2a720f,_0x54a526){var _0x1ba4d2=[];for(var _0x68cdfb in _0x4d17ab[_0x1b51('0x20')]){if(_0x4d17ab[_0x1b51('0x20')]['hasOwnProperty'](_0x68cdfb)){var _0x5559cf=_0x4d17ab[_0x1b51('0x20')][_0x68cdfb];var _0x1a6c68={'id':_0x5559cf['id'],'name':_0x5559cf[_0x1b51('0xb')],'strategy':_0x5559cf[_0x1b51('0x21')],'answered':_0x5559cf[_0x1b51('0x22')],'available':_0x5559cf[_0x1b51('0x23')],'loggedIn':_0x5559cf[_0x1b51('0x24')],'pTalking':_0x5559cf['pTalking'],'sumBillable':_0x5559cf[_0x1b51('0x25')],'sumDuration':_0x5559cf[_0x1b51('0x26')],'sumHoldTime':_0x5559cf[_0x1b51('0x27')]||0x0,'talking':_0x5559cf['talking'],'total':_0x5559cf[_0x1b51('0x28')],'type':_0x5559cf[_0x1b51('0x29')],'unmanaged':_0x5559cf[_0x1b51('0x2a')],'abandoned':_0x5559cf[_0x1b51('0x2b')],'waiting':_0x5559cf[_0x1b51('0x2c')],'loggedInDb':_0x5559cf[_0x1b51('0x2d')]};if(_0x5559cf[_0x1b51('0x29')]==='outbound'){_0x1a6c68[_0x1b51('0x2e')]=_0x5559cf[_0x1b51('0x2e')];_0x1a6c68[_0x1b51('0x2f')]=_0x5559cf[_0x1b51('0x2f')];_0x1a6c68[_0x1b51('0x30')]=_0x5559cf[_0x1b51('0x30')];_0x1a6c68[_0x1b51('0x31')]=_0x5559cf[_0x1b51('0x31')];_0x1a6c68[_0x1b51('0x32')]=_0x5559cf['dialOriginateTimeout'];_0x1a6c68[_0x1b51('0x33')]=_0x5559cf[_0x1b51('0x33')];_0x1a6c68['temp']=_0x5559cf[_0x1b51('0x34')];_0x1a6c68['outboundAnswerAgiCallsDay']=_0x5559cf[_0x1b51('0x35')];_0x1a6c68[_0x1b51('0x36')]=_0x5559cf[_0x1b51('0x36')];_0x1a6c68[_0x1b51('0x37')]=_0x5559cf['outboundBlacklistCallsDay'];_0x1a6c68[_0x1b51('0x38')]=_0x5559cf[_0x1b51('0x38')];_0x1a6c68[_0x1b51('0x39')]=_0x5559cf[_0x1b51('0x39')];_0x1a6c68['outboundDropCallsDayACS']=_0x5559cf['outboundDropCallsDayACS'];_0x1a6c68[_0x1b51('0x3a')]=_0x5559cf[_0x1b51('0x3a')];_0x1a6c68[_0x1b51('0x3b')]=_0x5559cf[_0x1b51('0x3b')];_0x1a6c68[_0x1b51('0x3c')]=_0x5559cf['outboundNoAnswerCallsDay'];_0x1a6c68[_0x1b51('0x3d')]=_0x5559cf[_0x1b51('0x3d')];_0x1a6c68[_0x1b51('0x3e')]=_0x5559cf[_0x1b51('0x3e')];_0x1a6c68[_0x1b51('0x3f')]=_0x5559cf[_0x1b51('0x3f')];_0x1a6c68['outboundRejectCallsDay']=_0x5559cf[_0x1b51('0x40')];_0x1a6c68[_0x1b51('0x41')]=_0x5559cf[_0x1b51('0x41')];_0x1a6c68[_0x1b51('0x42')]=_0x5559cf['predictiveIntervalAnsweredCalls'];_0x1a6c68[_0x1b51('0x43')]=_0x5559cf[_0x1b51('0x43')];_0x1a6c68[_0x1b51('0x44')]=_0x5559cf[_0x1b51('0x44')];_0x1a6c68['predictiveIntervalDroppedCallsCallersExit']=_0x5559cf[_0x1b51('0x45')];_0x1a6c68[_0x1b51('0x46')]=_0x5559cf[_0x1b51('0x46')];_0x1a6c68['predictiveIntervalErlangCalls']=_0x5559cf['predictiveIntervalErlangCalls'];_0x1a6c68[_0x1b51('0x47')]=_0x5559cf['predictiveIntervalErlangCallsDroppedCalls'];_0x1a6c68[_0x1b51('0x48')]=_0x5559cf['predictiveIntervalHitRate'];_0x1a6c68[_0x1b51('0x49')]=_0x5559cf[_0x1b51('0x49')];_0x1a6c68['predictiveIntervalPauses']=_0x5559cf[_0x1b51('0x4a')];_0x1a6c68['predictiveIntervalAvailable']=_0x5559cf[_0x1b51('0x4b')];_0x1a6c68[_0x1b51('0x4c')]=_0x5559cf[_0x1b51('0x4c')];_0x1a6c68[_0x1b51('0x1b')]=_0x5559cf[_0x1b51('0x1b')];_0x1a6c68[_0x1b51('0x4d')]=_0x5559cf['originated'];_0x1a6c68[_0x1b51('0x4e')]=_0x5559cf[_0x1b51('0x4e')];_0x1a6c68[_0x1b51('0x4f')]=_0x5559cf[_0x1b51('0x4f')];_0x1a6c68[_0x1b51('0x50')]=_0x5559cf[_0x1b51('0x50')];_0x1a6c68['erlangBusyFactor']=_0x5559cf[_0x1b51('0x51')];_0x1a6c68[_0x1b51('0x52')]=_0x5559cf[_0x1b51('0x52')];_0x1a6c68[_0x1b51('0x53')]=_0x5559cf[_0x1b51('0x53')];}if(_0x5559cf[_0x1b51('0x54')]){_0x1a6c68['Trunk']={'id':_0x5559cf[_0x1b51('0x54')]['id'],'name':_0x5559cf[_0x1b51('0x54')]['name'],'active':_0x5559cf[_0x1b51('0x54')][_0x1b51('0x55')],'callerid':_0x5559cf[_0x1b51('0x54')][_0x1b51('0x56')]};}if(_0x5559cf[_0x1b51('0x57')]){_0x1a6c68[_0x1b51('0x57')]={'id':_0x5559cf[_0x1b51('0x57')]['id'],'name':_0x5559cf[_0x1b51('0x57')][_0x1b51('0xb')]};}_0x1ba4d2[_0x1b51('0x58')](_0x1a6c68);}}_0x2a720f({'count':_0x1ba4d2[_0x1b51('0x59')],'rows':_0x1ba4d2});});},'UpdateVoiceQueue':function(_0xd27a41){return new Promise(function(_0x2732e8,_0x3e2921){var _0x526547=_[_0x1b51('0x5a')](_0x4d17ab[_0x1b51('0x20')],{'id':parseInt(_0xd27a41['id'])});var _0x94e9ff=_[_0x1b51('0x5b')](_0xd27a41,['id']);if(_0x526547){for(var _0x1a15b3 in _0x94e9ff){if(typeof _0x94e9ff[_0x1a15b3]!==_0x1b51('0x5c')&&typeof _0x526547[_0x1a15b3]!=='undefined'){_0x526547[_0x1a15b3]=_0x94e9ff[_0x1a15b3];}}_0x2732e8(_0x526547);}else{_0x3e2921();}});},'VoiceChannels':function(_0x3ef6af){return new Promise(function(_0x23035b,_0x43aef2){var _0x3a01d9=_[_0x1b51('0x5d')](_0x4d17ab[_0x1b51('0x5e')]);_0x23035b({'count':_0x3a01d9['length'],'rows':_0x3a01d9});});},'VoiceChannelMixMonitor':function(_0x3db7d3){var _0x16b0ec=this;return new Promise(function(_0xe39db8,_0x595cbc){if(ami[_0x1b51('0x12')]()==![]){return _0x595cbc(_0x16b0ec[_0x1b51('0x1c')](0x1f4,[config[_0x1b51('0x13')]['ip'],config[_0x1b51('0x13')][_0x1b51('0x5f')],_0x1b51('0x14')][_0x1b51('0x15')]('\x20')));}var _0x2d5a57=schema(properties['voicechannel'])['validate'](_0x3db7d3);if(_0x2d5a57['length']>0x0){return _0x595cbc(_0x16b0ec[_0x1b51('0x1c')](0x1f4,_[_0x1b51('0x60')](_0x2d5a57,'message')['join'](',\x20')));}var _0x56736b=_[_0x1b51('0x5a')](_0x4d17ab[_0x1b51('0x5e')],{'uniqueid':_0x3db7d3['uniqueid']});if(_0x56736b&&_0x56736b[_0x1b51('0x61')]){var _0x78b3f5=util[_0x1b51('0x8')]('%s.%s',_0x3db7d3[_0x1b51('0x62')]||_0x3db7d3[_0x1b51('0x63')],_0x3db7d3[_0x1b51('0x8')]||_0x1b51('0x64'));return ami['Action']({'action':'MixMonitor','channel':_0x56736b[_0x1b51('0x61')],'file':_0x78b3f5,'options':_0x1b51('0x65')})['then'](function(_0x2b0d49){var _0x18707e=_[_0x1b51('0x5a')](_0x56736b[_0x1b51('0x66')],{'filename':_0x1b51('0x67')+_0x78b3f5[_0x1b51('0x68')]()});if(_['isNil'](_0x18707e)){_0x56736b['monitors'][_0x1b51('0x58')]({'filename':_0x1b51('0x67')+_0x78b3f5[_0x1b51('0x68')](),'createdAt':moment()[_0x1b51('0x8')](_0x1b51('0x69')),'mixmonitorid':_0x2b0d49['mixmonitorid'],'status':'rec'});}else{_0x18707e[_0x1b51('0x6a')]=_0x2b0d49['mixmonitorid'];_0x18707e['status']='rec';}_0xe39db8({'code':0xc8,'message':[_0x3db7d3[_0x1b51('0x63')],_0x1b51('0x6b'),_0x2b0d49[_0x1b51('0x6a')]][_0x1b51('0x15')]('\x20'),'mixmonitorid':_0x2b0d49[_0x1b51('0x6a')]});})[_0x1b51('0x6c')](function(_0x36b520){_0x595cbc(_0x16b0ec[_0x1b51('0x1c')](0x1f5,[_0x3db7d3[_0x1b51('0x63')],_0x36b520[_0x1b51('0x1b')][_0x1b51('0x68')]()][_0x1b51('0x15')]('\x20')));});}else{return _0x595cbc(_0x16b0ec['error'](0x1f5,_0x1b51('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x25b050){var _0x7b23ce=this;return new Promise(function(_0x2063c6,_0x875489){if(ami['isConnected']()==![]){return _0x875489(_0x7b23ce[_0x1b51('0x1c')](0x1f4,[config['asterisk']['ip'],config[_0x1b51('0x13')][_0x1b51('0x5f')],_0x1b51('0x14')][_0x1b51('0x15')]('\x20')));}var _0x3ddf0d=schema(properties[_0x1b51('0x6e')])[_0x1b51('0x6f')](_0x25b050);if(_0x3ddf0d['length']>0x0){return _0x875489(_0x7b23ce[_0x1b51('0x1c')](0x1f4,_['map'](_0x3ddf0d,_0x1b51('0x1b'))['join'](',\x20')));}var _0x4b8a15=_[_0x1b51('0x5a')](_0x4d17ab[_0x1b51('0x5e')],{'uniqueid':_0x25b050['uniqueid']});if(_0x4b8a15){return BPromise['resolve']()['then'](function(){if(_0x4b8a15[_0x1b51('0x61')]){return ami[_0x1b51('0x19')]({'action':_0x1b51('0x70'),'channel':_0x4b8a15[_0x1b51('0x61')],'mixmonitorid':_0x25b050[_0x1b51('0x6a')]})[_0x1b51('0x6c')](function(_0x41922f){});}})[_0x1b51('0x1a')](function(){if(_0x4b8a15[_0x1b51('0x71')]){return ami[_0x1b51('0x19')]({'action':_0x1b51('0x70'),'channel':_0x4b8a15['destinationchannel'],'mixmonitorid':_0x25b050['mixmonitorid']})[_0x1b51('0x6c')](function(_0x39d3ba){});}})[_0x1b51('0x1a')](function(_0x1353a9){var _0x5ba89d=_[_0x1b51('0x5a')](_0x4b8a15[_0x1b51('0x66')],{'mixmonitorid':_0x25b050[_0x1b51('0x6a')]});if(_0x5ba89d){_0x5ba89d['status']=_0x1b51('0x72');}})[_0x1b51('0x1a')](function(){var _0x19b760=util[_0x1b51('0x8')](_0x1b51('0x73'),_0x25b050[_0x1b51('0x62')]||_0x25b050[_0x1b51('0x63')],_0x25b050['format']||_0x1b51('0x64'));var _0x3b0af5=_[_0x1b51('0x5a')](_0x4b8a15['monitors'],{'filename':_0x1b51('0x67')+_0x19b760[_0x1b51('0x68')]()});if(_0x3b0af5){_0x3b0af5[_0x1b51('0x74')]=_0x1b51('0x72');}})[_0x1b51('0x1a')](function(){_0x2063c6({'code':0xc8,'message':[_0x25b050[_0x1b51('0x63')],'StopMixMonitor\x20Success'][_0x1b51('0x15')]('\x20')});})[_0x1b51('0x6c')](function(_0x3e72dc){_0x875489(_0x7b23ce['error'](0x1f5,[_0x25b050['uniqueid'],_0x3e72dc[_0x1b51('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x875489(_0x7b23ce[_0x1b51('0x1c')](0x1f5,_0x1b51('0x6d')));}});},'VoiceQueuesChannels':function(_0x34336b){return new Promise(function(_0x2ccea1,_0x126ac1){var _0x35fe05=_['values'](_0x4d17ab[_0x1b51('0x75')]);_0x2ccea1({'count':_0x35fe05[_0x1b51('0x59')],'rows':_0x35fe05});});},'VoiceQueuesChannel':function(_0x30f64d){var _0x4d39b6=this;return new Promise(function(_0x4269f6,_0x2fad15){var _0xe37dc1=schema(properties['voicequeuechannel'])['validate'](_0x30f64d);if(_0xe37dc1[_0x1b51('0x59')]>0x0){return _0x2fad15(_0x4d39b6[_0x1b51('0x1c')](0x1f4,_[_0x1b51('0x60')](_0xe37dc1,_0x1b51('0x1b'))['join'](',\x20')));}var _0x5128a5=_[_0x1b51('0x5a')](_0x4d17ab['queueChannels'],{'uniqueid':_0x30f64d[_0x1b51('0x63')]});if(_0x5128a5){_0x4269f6(_0x5128a5);}else{return _0x2fad15(_0x4d39b6[_0x1b51('0x1c')](0x1f5,_0x1b51('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x549f69){var _0x71b46c=this;return new Promise(function(_0x31f9d9,_0x161af8){if(ami[_0x1b51('0x12')]()==![]){return _0x161af8(_0x71b46c[_0x1b51('0x1c')](0x1f4,[config[_0x1b51('0x13')]['ip'],config['asterisk'][_0x1b51('0x5f')],_0x1b51('0x14')]['join']('\x20')));}var _0x4ae114=schema(properties[_0x1b51('0x76')])[_0x1b51('0x6f')](_0x549f69);if(_0x4ae114[_0x1b51('0x59')]>0x0){return _0x161af8(_0x71b46c[_0x1b51('0x1c')](0x1f4,_['map'](_0x4ae114,_0x1b51('0x1b'))[_0x1b51('0x15')](',\x20')));}var _0x423a92=_[_0x1b51('0x5a')](_0x4d17ab[_0x1b51('0x75')],{'uniqueid':_0x549f69[_0x1b51('0x63')]});if(_0x423a92&&_0x423a92[_0x1b51('0x61')]){return ami['Action']({'action':_0x1b51('0x77'),'channel':_0x423a92[_0x1b51('0x61')]})['then'](function(_0x22c3c9){_0x31f9d9({'code':0xc8,'message':[_0x549f69[_0x1b51('0x63')],_0x22c3c9[_0x1b51('0x1b')][_0x1b51('0x68')]()]['join']('\x20')});})[_0x1b51('0x6c')](function(_0x9227f9){_0x161af8(_0x71b46c[_0x1b51('0x1c')](0x1f5,[_0x549f69[_0x1b51('0x63')],_0x9227f9[_0x1b51('0x1b')][_0x1b51('0x68')]()][_0x1b51('0x15')]('\x20')));});}else{return _0x161af8(_0x71b46c['error'](0x1f5,_0x1b51('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x30b8a0){var _0x3e786c=this;return new Promise(function(_0x37b382,_0x46194a){if(ami['isConnected']()==![]){return _0x46194a(_0x3e786c[_0x1b51('0x1c')](0x1f4,[config[_0x1b51('0x13')]['ip'],config[_0x1b51('0x13')][_0x1b51('0x5f')],_0x1b51('0x14')][_0x1b51('0x15')]('\x20')));}var _0x8c050c=schema(properties['voicequeuechannelredirect'])['validate'](_0x30b8a0);if(_0x8c050c['length']>0x0){return _0x46194a(_0x3e786c[_0x1b51('0x1c')](0x1f4,_[_0x1b51('0x60')](_0x8c050c,_0x1b51('0x1b'))[_0x1b51('0x15')](',\x20')));}var _0x53de66=_[_0x1b51('0x5a')](_0x4d17ab[_0x1b51('0x75')],{'uniqueid':_0x30b8a0[_0x1b51('0x63')]});if(_0x53de66&&_0x53de66[_0x1b51('0x61')]){return ami[_0x1b51('0x19')]({'action':_0x1b51('0x78'),'channel':_0x53de66[_0x1b51('0x61')],'exten':_0x30b8a0[_0x1b51('0x79')],'context':_0x30b8a0['context']||_0x53de66[_0x1b51('0x7a')],'priority':0x1})[_0x1b51('0x1a')](function(_0x4d89f1){_0x37b382({'code':0xc8,'message':[_0x30b8a0[_0x1b51('0x63')],_0x4d89f1[_0x1b51('0x1b')]['toLowerCase']()][_0x1b51('0x15')]('\x20')});})[_0x1b51('0x6c')](function(_0x47ac6e){_0x46194a(_0x3e786c[_0x1b51('0x1c')](0x1f5,[_0x30b8a0['uniqueid'],_0x47ac6e[_0x1b51('0x1b')][_0x1b51('0x68')]()][_0x1b51('0x15')]('\x20')));});}else{return _0x46194a(_0x3e786c[_0x1b51('0x1c')](0x1f5,_0x1b51('0x6d')));}});},'Agents':function(_0x685925){return new Promise(function(_0x6d9b96,_0x40e315){var _0x58aead=_[_0x1b51('0x5d')](_0x4d17ab['agents']);_0x6d9b96({'count':_0x58aead[_0x1b51('0x59')],'rows':_0x58aead});});},'Telephones':function(_0x11ea3b){return new Promise(function(_0x1de9bd,_0x446563){var _0x1eaeeb=_[_0x1b51('0x5d')](_0x4d17ab[_0x1b51('0x7b')]);_0x1de9bd({'count':_0x1eaeeb[_0x1b51('0x59')],'rows':_0x1eaeeb});});},'Trunks':function(_0x409e71){return new Promise(function(_0x11af6f,_0x376b71){var _0x1fafbc=_['values'](_0x4d17ab[_0x1b51('0x7c')]);_0x11af6f({'count':_0x1fafbc['length'],'rows':_0x1fafbc});});},'OutboundChannels':function(_0x1e7c54){return new Promise(function(_0x51641d,_0x37a6c5){var _0x2a0645=_[_0x1b51('0x5d')](_0x4d17ab[_0x1b51('0x7d')]);_0x51641d({'count':_0x2a0645[_0x1b51('0x59')],'rows':_0x2a0645});});},'Outbound':function(_0x3d233d){return new Promise(function(_0x46119b,_0x32c072){_0x46119b(_0x4d17ab[_0x1b51('0x7e')]);});},'Campaigns':function(_0x3e9017){return new Promise(function(_0x22df69,_0x5ee437){var _0x464930=_['values'](_0x4d17ab['campaigns']);_0x22df69({'count':_0x464930[_0x1b51('0x59')],'rows':_0x464930});});},'VoiceQueuesPreview':function(_0x243934){var _0x281efc=this;return new Promise(function(_0x542e10,_0x16a99b){_0x14e88a['run'](_0x243934['id'])['then'](function(_0x33a575){_0x542e10({'code':0xc8,'message':_0x33a575[_0x1b51('0x1b')]});})[_0x1b51('0x6c')](function(_0x43d5d2){_0x16a99b(_0x281efc[_0x1b51('0x1c')](0x1f4,_0x43d5d2[_0x1b51('0x1b')]));});});},'EventManager':function(_0x20c1ea){var _0x31982c=this;return new Promise(function(_0x1f76d3,_0x2af6ac){if(!_0x20c1ea['event']){return _0x2af6ac(_0x31982c[_0x1b51('0x1c')](0x1f4,_0x1b51('0x7f')));}ami[_0x1b51('0x80')](_0x1b51('0x81')+_0x20c1ea['event'],_0x20c1ea['message']);_0x1f76d3({'code':0xc8,'message':_0x20c1ea});});},'FaxAccounts':function(_0x435b75){return new Promise(function(_0x551e1f,_0x56cd21){var _0x3e2b58=_[_0x1b51('0x5d')](_0x4d17ab[_0x1b51('0x82')]);_0x551e1f({'count':_0x3e2b58[_0x1b51('0x59')],'rows':_0x3e2b58});});},'SendFax':function(_0x1c4239){var _0x176299=this;return new Promise(function(_0x2f563a,_0x1d3dbb){_0x463bec[_0x1b51('0x83')](_0x1c4239)[_0x1b51('0x1a')](function(_0x5dc3e5){_0x2f563a({'code':0xc8,'message':_0x5dc3e5[_0x1b51('0x1b')]});})[_0x1b51('0x6c')](function(_0x482bc5){_0x1d3dbb(_0x176299['error'](0x1f4,_0x482bc5[_0x1b51('0x1b')]));});});},'CheckAfterSend':function(_0x3ea898){var _0x42734e=this;return new Promise(function(_0x2920c1,_0x1cf773){_0x463bec[_0x1b51('0x84')](_0x3ea898)['then'](function(_0x47fda3){_0x2920c1({'code':0xc8,'message':_0x47fda3['message']});})[_0x1b51('0x6c')](function(_0x4e3f14){_0x1cf773(_0x42734e[_0x1b51('0x1c')](0x1f4,_0x4e3f14[_0x1b51('0x1b')]));});});}};var _0x2ae6cc=jayson[_0x1b51('0x85')](_0x43c14c)[_0x1b51('0x86')]();_0x2ae6cc['on'](_0x1b51('0x1c'),function(_0x576cb6){return _0x475add(_0x576cb6);});_0x2ae6cc[_0x1b51('0x7')](0x232a,_0x1b51('0x87'),function(){console['log'](_0x1b51('0x88'),0x232a);return _0x506653(_0x1b51('0x89')+0x232a);});});}; \ No newline at end of file +var _0xf562=['keys','action','Reload','Action','then','catch','message','Command','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','pTalking','sumHoldTime','talking','total','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','Interval','push','omit','undefined','values','length','map','find','channels','uniqueid','channel','%s.%s','filename','wav','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','timers','timer','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xf562,0x100));var _0x2f56=function(_0x1347a5,_0x3753ca){_0x1347a5=_0x1347a5-0x0;var _0x4f524d=_0xf562[_0x1347a5];return _0x4f524d;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var jayson=require(_0x2f56('0x2'));var schema=require(_0x2f56('0x3'));var BPromise=require(_0x2f56('0x4'));var moment=require(_0x2f56('0x5'));var config=require(_0x2f56('0x6'));var properties=require(_0x2f56('0x7'));var ami=require(_0x2f56('0x8'));exports['listen']=function(_0x29e08d,_0x4e8d0b,_0x14436b){return new BPromise(function(_0x5b3784,_0x1fd9d8){var _0x3c4002={'QueuePause':function(_0x25f51a){return new Promise(function(_0x1add20,_0x46799e){var _0x2975c2=util[_0x2f56('0x9')](_0x2f56('0xa'),_0x2f56('0xb'),_0x25f51a['name']);if(_0x29e08d[_0x2f56('0xc')]&&_0x29e08d[_0x2f56('0xc')][_0x2975c2]&&_0x29e08d['timers'][_0x2975c2][_0x2f56('0xd')]){_0x29e08d[_0x2f56('0xc')][_0x2975c2]['updateAcw']();}if(_0x29e08d[_0x2f56('0xe')][_0x2975c2]){_0x29e08d['agents'][_0x2975c2][_0x2f56('0xf')]({'statePause':_0x25f51a['pause']?!![]:![]});}_0x1add20({'code':0xc8,'message':_0x2f56('0x10')});});},'Reload':function(_0x3bec3f){var _0x11ef44=this;return new Promise(function(_0x3d5742,_0x2e3889){if(ami[_0x2f56('0x11')]()==![]){return _0x2e3889(_0x11ef44[_0x2f56('0x12')](0x1f4,[config[_0x2f56('0x13')]['ip'],config['asterisk'][_0x2f56('0x14')],_0x2f56('0x15')][_0x2f56('0x16')]('\x20')));}_0x3bec3f=_[_0x2f56('0x17')](_0x3bec3f,_[_0x2f56('0x18')](properties['module']));_0x3bec3f[_0x2f56('0x19')]=_0x2f56('0x1a');return ami[_0x2f56('0x1b')](_0x3bec3f)[_0x2f56('0x1c')](function(_0x39d74e){_0x3d5742({'code':0xc8,'message':_0x39d74e['message']});})[_0x2f56('0x1d')](function(_0x33b43f){_0x2e3889(_0x11ef44[_0x2f56('0x12')](0x1f5,_0x33b43f[_0x2f56('0x1e')]));});});},'Command':function(_0x45ad8c){var _0x562cea=this;return new Promise(function(_0x3a3161,_0x19ab8c){if(ami[_0x2f56('0x11')]()==![]){return _0x19ab8c(_0x562cea[_0x2f56('0x12')](0x1f4,[config[_0x2f56('0x13')]['ip'],config[_0x2f56('0x13')][_0x2f56('0x14')],_0x2f56('0x15')]['join']('\x20')));}_0x45ad8c=_[_0x2f56('0x17')](_0x45ad8c,'command');_0x45ad8c['action']=_0x2f56('0x1f');return ami[_0x2f56('0x1b')](_0x45ad8c)[_0x2f56('0x1c')](function(_0x4ee4c9){_0x3a3161({'code':0xc8,'message':_0x4ee4c9[_0x2f56('0x20')]});})[_0x2f56('0x1d')](function(_0x2db586){_0x19ab8c(_0x562cea['error'](0x1f5,_0x2db586['message']));});});},'VoiceQueues':function(_0x3b7603){return new Promise(function(_0x32931b,_0x38b366){var _0x3e047b=[];for(var _0x4406ff in _0x29e08d['voiceQueues']){if(_0x29e08d[_0x2f56('0x21')][_0x2f56('0x22')](_0x4406ff)){var _0x861e9c=_0x29e08d[_0x2f56('0x21')][_0x4406ff];var _0x45a929={'id':_0x861e9c['id'],'name':_0x861e9c[_0x2f56('0x23')],'strategy':_0x861e9c[_0x2f56('0x24')],'answered':_0x861e9c[_0x2f56('0x25')],'available':_0x861e9c[_0x2f56('0x26')],'loggedIn':_0x861e9c['loggedIn'],'pTalking':_0x861e9c[_0x2f56('0x27')],'sumBillable':_0x861e9c['sumBillable'],'sumDuration':_0x861e9c['sumDuration'],'sumHoldTime':_0x861e9c[_0x2f56('0x28')]||0x0,'talking':_0x861e9c[_0x2f56('0x29')],'total':_0x861e9c[_0x2f56('0x2a')],'type':_0x861e9c['type'],'unmanaged':_0x861e9c['unmanaged'],'abandoned':_0x861e9c['abandoned'],'waiting':_0x861e9c[_0x2f56('0x2b')],'loggedInDb':_0x861e9c[_0x2f56('0x2c')]};if(_0x861e9c[_0x2f56('0x2d')]===_0x2f56('0x2e')){_0x45a929[_0x2f56('0x2f')]=_0x861e9c[_0x2f56('0x2f')];_0x45a929[_0x2f56('0x30')]=_0x861e9c['dialMethod'];_0x45a929[_0x2f56('0x31')]=_0x861e9c[_0x2f56('0x31')];_0x45a929[_0x2f56('0x32')]=_0x861e9c['dialOriginateCallerIdNumber'];_0x45a929[_0x2f56('0x33')]=_0x861e9c[_0x2f56('0x33')];_0x45a929[_0x2f56('0x34')]=_0x861e9c[_0x2f56('0x34')];_0x45a929[_0x2f56('0x35')]=_0x861e9c[_0x2f56('0x35')];_0x45a929[_0x2f56('0x36')]=_0x861e9c['outboundAnswerAgiCallsDay'];_0x45a929[_0x2f56('0x37')]=_0x861e9c[_0x2f56('0x37')];_0x45a929['outboundBlacklistCallsDay']=_0x861e9c[_0x2f56('0x38')];_0x45a929[_0x2f56('0x39')]=_0x861e9c['outboundBusyCallsDay'];_0x45a929[_0x2f56('0x3a')]=_0x861e9c['outboundCongestionCallsDay'];_0x45a929['outboundDropCallsDayACS']=_0x861e9c[_0x2f56('0x3b')];_0x45a929[_0x2f56('0x3c')]=_0x861e9c[_0x2f56('0x3c')];_0x45a929['outboundDropCallsDayTimeout']=_0x861e9c[_0x2f56('0x3d')];_0x45a929['outboundNoAnswerCallsDay']=_0x861e9c[_0x2f56('0x3e')];_0x45a929['outboundNoSuchCallsDay']=_0x861e9c[_0x2f56('0x3f')];_0x45a929[_0x2f56('0x40')]=_0x861e9c[_0x2f56('0x40')];_0x45a929['outboundReCallsDay']=_0x861e9c[_0x2f56('0x41')];_0x45a929[_0x2f56('0x42')]=_0x861e9c[_0x2f56('0x42')];_0x45a929[_0x2f56('0x43')]=_0x861e9c[_0x2f56('0x43')];_0x45a929[_0x2f56('0x44')]=_0x861e9c['predictiveIntervalAnsweredCalls'];_0x45a929[_0x2f56('0x45')]=_0x861e9c[_0x2f56('0x45')];_0x45a929[_0x2f56('0x46')]=_0x861e9c[_0x2f56('0x46')];_0x45a929[_0x2f56('0x47')]=_0x861e9c[_0x2f56('0x47')];_0x45a929[_0x2f56('0x48')]=_0x861e9c[_0x2f56('0x48')];_0x45a929[_0x2f56('0x49')]=_0x861e9c['predictiveIntervalErlangCalls'];_0x45a929[_0x2f56('0x4a')]=_0x861e9c['predictiveIntervalErlangCallsDroppedCalls'];_0x45a929[_0x2f56('0x4b')]=_0x861e9c[_0x2f56('0x4b')];_0x45a929[_0x2f56('0x4c')]=_0x861e9c[_0x2f56('0x4c')];_0x45a929[_0x2f56('0x4d')]=_0x861e9c[_0x2f56('0x4d')];_0x45a929[_0x2f56('0x4e')]=_0x861e9c['predictiveIntervalAvailable'];_0x45a929['predictiveIntervalTotalCalls']=_0x861e9c[_0x2f56('0x4f')];_0x45a929['message']=_0x861e9c[_0x2f56('0x1e')];_0x45a929[_0x2f56('0x50')]=_0x861e9c[_0x2f56('0x50')];_0x45a929[_0x2f56('0x51')]=_0x861e9c[_0x2f56('0x51')];_0x45a929[_0x2f56('0x52')]=_0x861e9c[_0x2f56('0x52')];_0x45a929[_0x2f56('0x53')]=_0x861e9c[_0x2f56('0x53')];_0x45a929['erlangBusyFactor']=_0x861e9c['erlangBusyFactor'];_0x45a929[_0x2f56('0x54')]=_0x861e9c['startPredictive'];_0x45a929[_0x2f56('0x55')]=_0x861e9c[_0x2f56('0x55')];}if(_0x861e9c[_0x2f56('0x56')]){_0x45a929[_0x2f56('0x56')]={'id':_0x861e9c[_0x2f56('0x56')]['id'],'name':_0x861e9c[_0x2f56('0x56')]['name'],'active':_0x861e9c['Trunk']['active'],'callerid':_0x861e9c[_0x2f56('0x56')]['callerid']};}if(_0x861e9c[_0x2f56('0x57')]){_0x45a929[_0x2f56('0x57')]={'id':_0x861e9c['Interval']['id'],'name':_0x861e9c[_0x2f56('0x57')]['name']};}_0x3e047b[_0x2f56('0x58')](_0x45a929);}}_0x32931b({'count':_0x3e047b['length'],'rows':_0x3e047b});});},'UpdateVoiceQueue':function(_0x31834b){return new Promise(function(_0x2cf9d1,_0x44f592){var _0x3ceb43=_['find'](_0x29e08d[_0x2f56('0x21')],{'id':parseInt(_0x31834b['id'])});var _0x3a1e5c=_[_0x2f56('0x59')](_0x31834b,['id']);if(_0x3ceb43){for(var _0x423af3 in _0x3a1e5c){if(typeof _0x3a1e5c[_0x423af3]!==_0x2f56('0x5a')&&typeof _0x3ceb43[_0x423af3]!=='undefined'){_0x3ceb43[_0x423af3]=_0x3a1e5c[_0x423af3];}}_0x2cf9d1(_0x3ceb43);}else{_0x44f592();}});},'VoiceChannels':function(_0x1deea1){return new Promise(function(_0x3899ea,_0x349f6b){var _0x519790=_[_0x2f56('0x5b')](_0x29e08d['channels']);_0x3899ea({'count':_0x519790[_0x2f56('0x5c')],'rows':_0x519790});});},'VoiceChannelMixMonitor':function(_0x31e9d9){var _0x4c4818=this;return new Promise(function(_0x5d24c5,_0x986bdb){if(ami[_0x2f56('0x11')]()==![]){return _0x986bdb(_0x4c4818[_0x2f56('0x12')](0x1f4,[config[_0x2f56('0x13')]['ip'],config[_0x2f56('0x13')]['username'],_0x2f56('0x15')][_0x2f56('0x16')]('\x20')));}var _0xcfe3d8=schema(properties['voicechannel'])[_0x2f56('0x3')](_0x31e9d9);if(_0xcfe3d8[_0x2f56('0x5c')]>0x0){return _0x986bdb(_0x4c4818[_0x2f56('0x12')](0x1f4,_[_0x2f56('0x5d')](_0xcfe3d8,'message')[_0x2f56('0x16')](',\x20')));}var _0x2771cc=_[_0x2f56('0x5e')](_0x29e08d[_0x2f56('0x5f')],{'uniqueid':_0x31e9d9[_0x2f56('0x60')]});if(_0x2771cc&&_0x2771cc[_0x2f56('0x61')]){var _0x3f6e16=util['format'](_0x2f56('0x62'),_0x31e9d9[_0x2f56('0x63')]||_0x31e9d9['uniqueid'],_0x31e9d9['format']||_0x2f56('0x64'));return ami[_0x2f56('0x1b')]({'action':'MixMonitor','channel':_0x2771cc[_0x2f56('0x61')],'file':_0x3f6e16,'options':'ai(mixmonitorid)'})[_0x2f56('0x1c')](function(_0x47e765){var _0xd24ee2=_['find'](_0x2771cc['monitors'],{'filename':_0x2f56('0x65')+_0x3f6e16[_0x2f56('0x66')]()});if(_[_0x2f56('0x67')](_0xd24ee2)){_0x2771cc[_0x2f56('0x68')]['push']({'filename':_0x2f56('0x65')+_0x3f6e16['toLowerCase'](),'createdAt':moment()[_0x2f56('0x9')](_0x2f56('0x69')),'mixmonitorid':_0x47e765[_0x2f56('0x6a')],'status':_0x2f56('0x6b')});}else{_0xd24ee2[_0x2f56('0x6a')]=_0x47e765['mixmonitorid'];_0xd24ee2['status']=_0x2f56('0x6b');}_0x5d24c5({'code':0xc8,'message':[_0x31e9d9[_0x2f56('0x60')],'MixMonitor\x20Success',_0x47e765[_0x2f56('0x6a')]][_0x2f56('0x16')]('\x20'),'mixmonitorid':_0x47e765[_0x2f56('0x6a')]});})[_0x2f56('0x1d')](function(_0x348d2d){_0x986bdb(_0x4c4818[_0x2f56('0x12')](0x1f5,[_0x31e9d9[_0x2f56('0x60')],_0x348d2d[_0x2f56('0x1e')][_0x2f56('0x66')]()][_0x2f56('0x16')]('\x20')));});}else{return _0x986bdb(_0x4c4818[_0x2f56('0x12')](0x1f5,_0x2f56('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x270981){var _0x169927=this;return new Promise(function(_0xfdf9c6,_0x354bb4){if(ami[_0x2f56('0x11')]()==![]){return _0x354bb4(_0x169927[_0x2f56('0x12')](0x1f4,[config[_0x2f56('0x13')]['ip'],config[_0x2f56('0x13')]['username'],'ami\x20disconnected'][_0x2f56('0x16')]('\x20')));}var _0x1a918b=schema(properties[_0x2f56('0x6d')])[_0x2f56('0x3')](_0x270981);if(_0x1a918b[_0x2f56('0x5c')]>0x0){return _0x354bb4(_0x169927[_0x2f56('0x12')](0x1f4,_['map'](_0x1a918b,_0x2f56('0x1e'))['join'](',\x20')));}var _0x45eeaf=_[_0x2f56('0x5e')](_0x29e08d[_0x2f56('0x5f')],{'uniqueid':_0x270981['uniqueid']});if(_0x45eeaf){return BPromise[_0x2f56('0x6e')]()[_0x2f56('0x1c')](function(){if(_0x45eeaf['channel']){return ami['Action']({'action':_0x2f56('0x6f'),'channel':_0x45eeaf[_0x2f56('0x61')],'mixmonitorid':_0x270981['mixmonitorid']})[_0x2f56('0x1d')](function(_0x4d503a){});}})[_0x2f56('0x1c')](function(){if(_0x45eeaf[_0x2f56('0x70')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x45eeaf[_0x2f56('0x70')],'mixmonitorid':_0x270981[_0x2f56('0x6a')]})['catch'](function(_0x4cc5a8){});}})[_0x2f56('0x1c')](function(_0x2cf808){var _0x77c6ee=_[_0x2f56('0x5e')](_0x45eeaf['monitors'],{'mixmonitorid':_0x270981[_0x2f56('0x6a')]});if(_0x77c6ee){_0x77c6ee[_0x2f56('0x71')]=_0x2f56('0x72');}})[_0x2f56('0x1c')](function(){var _0x249168=util['format'](_0x2f56('0x62'),_0x270981['filename']||_0x270981[_0x2f56('0x60')],_0x270981[_0x2f56('0x9')]||_0x2f56('0x64'));var _0x173734=_[_0x2f56('0x5e')](_0x45eeaf[_0x2f56('0x68')],{'filename':'/var/spool/asterisk/monitor/'+_0x249168[_0x2f56('0x66')]()});if(_0x173734){_0x173734[_0x2f56('0x71')]=_0x2f56('0x72');}})[_0x2f56('0x1c')](function(){_0xfdf9c6({'code':0xc8,'message':[_0x270981['uniqueid'],_0x2f56('0x73')][_0x2f56('0x16')]('\x20')});})[_0x2f56('0x1d')](function(_0x5324a9){_0x354bb4(_0x169927[_0x2f56('0x12')](0x1f5,[_0x270981[_0x2f56('0x60')],_0x5324a9[_0x2f56('0x1e')][_0x2f56('0x66')]()][_0x2f56('0x16')]('\x20')));});}else{return _0x354bb4(_0x169927['error'](0x1f5,_0x2f56('0x6c')));}});},'VoiceQueuesChannels':function(_0x55fb5a){return new Promise(function(_0x3f94ec,_0x150daf){var _0x389440=_[_0x2f56('0x5b')](_0x29e08d[_0x2f56('0x74')]);_0x3f94ec({'count':_0x389440[_0x2f56('0x5c')],'rows':_0x389440});});},'VoiceQueuesChannel':function(_0x548b0b){var _0x50a446=this;return new Promise(function(_0x258f5b,_0x261e3c){var _0x3dd39e=schema(properties[_0x2f56('0x75')])[_0x2f56('0x3')](_0x548b0b);if(_0x3dd39e[_0x2f56('0x5c')]>0x0){return _0x261e3c(_0x50a446[_0x2f56('0x12')](0x1f4,_[_0x2f56('0x5d')](_0x3dd39e,_0x2f56('0x1e'))[_0x2f56('0x16')](',\x20')));}var _0x55dd02=_[_0x2f56('0x5e')](_0x29e08d[_0x2f56('0x74')],{'uniqueid':_0x548b0b[_0x2f56('0x60')]});if(_0x55dd02){_0x258f5b(_0x55dd02);}else{return _0x261e3c(_0x50a446['error'](0x1f5,_0x2f56('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x119e25){var _0x1408d6=this;return new Promise(function(_0x1a46cc,_0x3c2aae){if(ami[_0x2f56('0x11')]()==![]){return _0x3c2aae(_0x1408d6['error'](0x1f4,[config[_0x2f56('0x13')]['ip'],config[_0x2f56('0x13')][_0x2f56('0x14')],_0x2f56('0x15')]['join']('\x20')));}var _0x374342=schema(properties[_0x2f56('0x76')])['validate'](_0x119e25);if(_0x374342[_0x2f56('0x5c')]>0x0){return _0x3c2aae(_0x1408d6[_0x2f56('0x12')](0x1f4,_[_0x2f56('0x5d')](_0x374342,'message')[_0x2f56('0x16')](',\x20')));}var _0x21da99=_['find'](_0x29e08d['queueChannels'],{'uniqueid':_0x119e25['uniqueid']});if(_0x21da99&&_0x21da99[_0x2f56('0x61')]){return ami[_0x2f56('0x1b')]({'action':_0x2f56('0x77'),'channel':_0x21da99[_0x2f56('0x61')]})[_0x2f56('0x1c')](function(_0x28bafd){_0x1a46cc({'code':0xc8,'message':[_0x119e25['uniqueid'],_0x28bafd['message']['toLowerCase']()][_0x2f56('0x16')]('\x20')});})[_0x2f56('0x1d')](function(_0x48ae9f){_0x3c2aae(_0x1408d6[_0x2f56('0x12')](0x1f5,[_0x119e25[_0x2f56('0x60')],_0x48ae9f['message'][_0x2f56('0x66')]()][_0x2f56('0x16')]('\x20')));});}else{return _0x3c2aae(_0x1408d6['error'](0x1f5,_0x2f56('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x19c780){var _0xb63ab7=this;return new Promise(function(_0x549f09,_0x370087){if(ami[_0x2f56('0x11')]()==![]){return _0x370087(_0xb63ab7[_0x2f56('0x12')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x2f56('0x14')],_0x2f56('0x15')]['join']('\x20')));}var _0x30d7fc=schema(properties[_0x2f56('0x78')])[_0x2f56('0x3')](_0x19c780);if(_0x30d7fc[_0x2f56('0x5c')]>0x0){return _0x370087(_0xb63ab7['error'](0x1f4,_[_0x2f56('0x5d')](_0x30d7fc,_0x2f56('0x1e'))['join'](',\x20')));}var _0x43eb5a=_[_0x2f56('0x5e')](_0x29e08d[_0x2f56('0x74')],{'uniqueid':_0x19c780[_0x2f56('0x60')]});if(_0x43eb5a&&_0x43eb5a[_0x2f56('0x61')]){return ami[_0x2f56('0x1b')]({'action':_0x2f56('0x79'),'channel':_0x43eb5a['channel'],'exten':_0x19c780[_0x2f56('0x7a')],'context':_0x19c780[_0x2f56('0x7b')]||_0x43eb5a['context'],'priority':0x1})[_0x2f56('0x1c')](function(_0xd22844){_0x549f09({'code':0xc8,'message':[_0x19c780[_0x2f56('0x60')],_0xd22844[_0x2f56('0x1e')][_0x2f56('0x66')]()]['join']('\x20')});})[_0x2f56('0x1d')](function(_0x4d85c4){_0x370087(_0xb63ab7[_0x2f56('0x12')](0x1f5,[_0x19c780[_0x2f56('0x60')],_0x4d85c4[_0x2f56('0x1e')]['toLowerCase']()][_0x2f56('0x16')]('\x20')));});}else{return _0x370087(_0xb63ab7[_0x2f56('0x12')](0x1f5,_0x2f56('0x6c')));}});},'Agents':function(_0x588674){return new Promise(function(_0x219712,_0x548c5f){var _0x1ae564=_[_0x2f56('0x5b')](_0x29e08d[_0x2f56('0xe')]);_0x219712({'count':_0x1ae564['length'],'rows':_0x1ae564});});},'Telephones':function(_0x59acd7){return new Promise(function(_0x4e9460,_0x31b3fd){var _0x562a13=_[_0x2f56('0x5b')](_0x29e08d[_0x2f56('0x7c')]);_0x4e9460({'count':_0x562a13[_0x2f56('0x5c')],'rows':_0x562a13});});},'Trunks':function(_0x229bce){return new Promise(function(_0x4572e6,_0x26e9c4){var _0x385f37=_[_0x2f56('0x5b')](_0x29e08d[_0x2f56('0x7d')]);_0x4572e6({'count':_0x385f37[_0x2f56('0x5c')],'rows':_0x385f37});});},'OutboundChannels':function(_0x403313){return new Promise(function(_0x5e560a,_0x4258a2){var _0x1cdf48=_[_0x2f56('0x5b')](_0x29e08d[_0x2f56('0x7e')]);_0x5e560a({'count':_0x1cdf48[_0x2f56('0x5c')],'rows':_0x1cdf48});});},'Outbound':function(_0x32950a){return new Promise(function(_0x379b67,_0x5c4644){_0x379b67(_0x29e08d[_0x2f56('0x2e')]);});},'Campaigns':function(_0x12a1dc){return new Promise(function(_0xca32d5,_0x5e26a9){var _0x28b12e=_[_0x2f56('0x5b')](_0x29e08d[_0x2f56('0x7f')]);_0xca32d5({'count':_0x28b12e[_0x2f56('0x5c')],'rows':_0x28b12e});});},'VoiceQueuesPreview':function(_0x258c1f){var _0x181453=this;return new Promise(function(_0x45d6e4,_0x550e7f){_0x4e8d0b[_0x2f56('0x80')](_0x258c1f['id'])[_0x2f56('0x1c')](function(_0x23449f){_0x45d6e4({'code':0xc8,'message':_0x23449f['message']});})[_0x2f56('0x1d')](function(_0x540c58){_0x550e7f(_0x181453[_0x2f56('0x12')](0x1f4,_0x540c58['message']));});});},'EventManager':function(_0x1d94ee){var _0x17a62e=this;return new Promise(function(_0x203876,_0x529086){if(!_0x1d94ee[_0x2f56('0x81')]){return _0x529086(_0x17a62e['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x2f56('0x82')](_0x2f56('0x83')+_0x1d94ee[_0x2f56('0x81')],_0x1d94ee['message']);_0x203876({'code':0xc8,'message':_0x1d94ee});});},'FaxAccounts':function(_0x3f37f3){return new Promise(function(_0xbee59b,_0x3002d2){var _0x5cc6a6=_[_0x2f56('0x5b')](_0x29e08d[_0x2f56('0x84')]);_0xbee59b({'count':_0x5cc6a6['length'],'rows':_0x5cc6a6});});},'SendFax':function(_0x1c8ae3){var _0x1f8e84=this;return new Promise(function(_0x124c3b,_0x291cdc){_0x14436b['send'](_0x1c8ae3)['then'](function(_0x187e73){_0x124c3b({'code':0xc8,'message':_0x187e73[_0x2f56('0x1e')]});})[_0x2f56('0x1d')](function(_0x26b324){_0x291cdc(_0x1f8e84[_0x2f56('0x12')](0x1f4,_0x26b324[_0x2f56('0x1e')]));});});},'CheckAfterSend':function(_0x1f0c26){var _0xd01c7d=this;return new Promise(function(_0xa8f182,_0x355f5d){_0x14436b[_0x2f56('0x85')](_0x1f0c26)[_0x2f56('0x1c')](function(_0x55ecf0){_0xa8f182({'code':0xc8,'message':_0x55ecf0[_0x2f56('0x1e')]});})['catch'](function(_0x237a62){_0x355f5d(_0xd01c7d['error'](0x1f4,_0x237a62['message']));});});}};var _0x239b4e=jayson[_0x2f56('0x86')](_0x3c4002)[_0x2f56('0x87')]();_0x239b4e['on']('error',function(_0x383744){return _0x1fd9d8(_0x383744);});_0x239b4e[_0x2f56('0x88')](0x232a,_0x2f56('0x89'),function(){console[_0x2f56('0x8a')](_0x2f56('0x8b'),0x232a);return _0x5b3784('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 70263b5..eefa6a2 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 _0xdace=['data5','xmd-contactid','ListId','data3','phone','map','routeId','firstName','lastName','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','calleridname','','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','push','format','user:%s','name','trigger:%s','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data2','isNil'];(function(_0x25aaec,_0x159e5b){var _0x293c2f=function(_0x3cd42a){while(--_0x3cd42a){_0x25aaec['push'](_0x25aaec['shift']());}};_0x293c2f(++_0x159e5b);}(_0xdace,0xc5));var _0xedac=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xdace[_0x3e32a8];return _0x2997b0;};'use strict';var _=require(_0xedac('0x0'));var BPromise=require('bluebird');var Redis=require(_0xedac('0x1'));var util=require(_0xedac('0x2'));var config=require(_0xedac('0x3'));var logger=require('../../../../config/logger')(_0xedac('0x4'));var cmContactRpc=require(_0xedac('0x5'));config[_0xedac('0x6')]=_[_0xedac('0x7')](config['redis'],{'host':_0xedac('0x8'),'port':0x18eb});var io=require(_0xedac('0x9'))(new Redis(config[_0xedac('0x6')]));function emit(_0x5ecbd3,_0x4081c6,_0x21440e,_0x162eea,_0x53fa43){logger[_0xedac('0xa')](_0xedac('0xb'),_0x5ecbd3,_0x4081c6['id'],_0x21440e,_0x162eea,JSON[_0xedac('0xc')](_0x53fa43));io['to'](_0x21440e)['emit'](_0x162eea,_0x53fa43);}exports['exec']=function(_0x144368,_0x2ea11d,_0x57e1bf,_0x4d6a29){var _0x4db2ad,_0x25395d;var _0x57f637={};var _0x261401=Number(_0x57e1bf['data1']);var _0x21c6ae=_0x57e1bf[_0xedac('0xd')]?Boolean(Number(_0x57e1bf[_0xedac('0xd')])):![];var _0x342186;var _0x9a79a0=![];if(!_[_0xedac('0xe')](_0x57e1bf[_0xedac('0xf')])){if(_0x57e1bf[_0xedac('0xf')]=='1')_0x9a79a0=!![];}if(!_0x9a79a0){if(_0x4d6a29['xmd-contactid']){_0x57f637['id']=_0x4d6a29[_0xedac('0x10')];}}if(!_0x57f637['id']){_0x57f637[_0xedac('0x11')]=_0x261401;_0x342186=_0x57e1bf[_0xedac('0x12')]&&_0x57e1bf[_0xedac('0x12')]!=='0'?_0x57e1bf[_0xedac('0x12')]['split'](','):[_0xedac('0x13')];_0x57f637['$or']=_[_0xedac('0x14')](_0x342186,function(_0x2eeac9){var _0xdad128={};_0xdad128[_0x2eeac9]=_0x4d6a29[_0xedac('0x15')]?_0x4d6a29['destcalleridnum']:_0x4d6a29['calleridnum'];return _0xdad128;});}var _0x2d02d7=['id',_0xedac('0x16'),_0xedac('0x17'),_0xedac('0x13'),'mobile','fax',_0xedac('0x11'),_0xedac('0x18'),_0xedac('0x19'),_0xedac('0x1a')];var _0x2f5eee=_[_0xedac('0x1b')](_0x2d02d7,_0x342186);BPromise[_0xedac('0x1c')]()[_0xedac('0x1d')](cmContactRpc['getContacts']({'attributes':_0x2f5eee,'where':_0x57f637}))[_0xedac('0x1d')](function(_0x510005){_0x25395d=_0x510005;if(!_[_0xedac('0x1e')](_0x25395d)){if(_0x25395d[_0xedac('0x1f')]===0x1){_0x4db2ad=_0x25395d[0x0];logger['info'](_0xedac('0x20'),_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id'],_0x4db2ad['id']);}else{logger[_0xedac('0xa')](_0xedac('0x22'),_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id'],_[_0xedac('0x14')](_0x25395d,'id')['join'](','));}return;}else{logger[_0xedac('0xa')](_0xedac('0x23'),_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id']);var _0x41ad8d={'ListId':_0x261401};var _0x1ff33e=_0x57e1bf[_0xedac('0x24')]&&_0x57e1bf[_0xedac('0x24')]!=='0'?_0x57e1bf[_0xedac('0x24')]:_0xedac('0x13');if(_0x21c6ae){logger[_0xedac('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4d6a29[_0xedac('0x21')],_0x2ea11d['id']);_0x41ad8d[_0x1ff33e]=_[_0xedac('0xe')](_0x4d6a29[_0xedac('0x15')])?_0x4d6a29['calleridnum']:_0x4d6a29[_0xedac('0x25')];if(_['isNil'](_0x4d6a29['routeId'])){_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x26')]&&_0x4d6a29[_0xedac('0x26')]!==_0xedac('0x27')?_0x4d6a29['calleridname']:'Unknown';}else{_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x28')]&&_0x4d6a29[_0xedac('0x28')]!==_0xedac('0x27')?_0x4d6a29[_0xedac('0x28')]:_0xedac('0x29');}return BPromise[_0xedac('0x1c')]()['then'](cmContactRpc[_0xedac('0x2a')](_0x41ad8d))[_0xedac('0x1d')](function(_0x2cbe33){_0x4db2ad=_0x2cbe33;_0x25395d['push'](_0x2cbe33);if(_0x4db2ad){logger[_0xedac('0xa')](_0xedac('0x2b'),_0x4d6a29['uniqueid'],_0x2ea11d['id'],_0x4db2ad['id']);}return;});}else{logger[_0xedac('0xa')](_0xedac('0x2c'),_0x4d6a29['uniqueid'],_0x2ea11d['id']);_0x41ad8d[_0x1ff33e]=_[_0xedac('0xe')](_0x4d6a29[_0xedac('0x15')])?_0x4d6a29[_0xedac('0x2d')]:_0x4d6a29[_0xedac('0x25')];if(_[_0xedac('0xe')](_0x4d6a29[_0xedac('0x15')])){_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x26')]&&_0x4d6a29[_0xedac('0x26')]!==_0xedac('0x27')?_0x4d6a29['calleridname']:_0xedac('0x29');}else{_0x41ad8d[_0xedac('0x16')]=_0x4d6a29[_0xedac('0x28')]&&_0x4d6a29[_0xedac('0x28')]!==_0xedac('0x27')?_0x4d6a29[_0xedac('0x28')]:_0xedac('0x29');}_0x4db2ad=_0x41ad8d;_0x25395d[_0xedac('0x2e')](_0x41ad8d);return;}}})[_0xedac('0x1d')](function(){if(_0x144368){emit(_0x4d6a29[_0xedac('0x21')],_0x2ea11d,util[_0xedac('0x2f')](_0xedac('0x30'),_0x144368[_0xedac('0x31')]),util[_0xedac('0x2f')](_0xedac('0x32'),_0x57e1bf['action'][_0xedac('0x33')]()),{'evt':_[_0xedac('0x34')](_0x4d6a29,{'autoCreate':_0x21c6ae}),'contact':_0x4db2ad===undefined?{}:_0x4db2ad,'contacts':_0x25395d[_0xedac('0x1f')]===0x0?undefined:_0x25395d});}});}; \ No newline at end of file +var _0x22fb=['destcalleridnum','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','toLowerCase','merge','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map'];(function(_0x4e859d,_0x58ae3b){var _0x43b831=function(_0x52bd7c){while(--_0x52bd7c){_0x4e859d['push'](_0x4e859d['shift']());}};_0x43b831(++_0x58ae3b);}(_0x22fb,0x192));var _0xb22f=function(_0x55dede,_0x18673e){_0x55dede=_0x55dede-0x0;var _0x748314=_0x22fb[_0x55dede];return _0x748314;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xb22f('0x0'));var util=require('util');var config=require(_0xb22f('0x1'));var logger=require(_0xb22f('0x2'))(_0xb22f('0x3'));var cmContactRpc=require(_0xb22f('0x4'));config[_0xb22f('0x5')]=_['defaults'](config[_0xb22f('0x5')],{'host':_0xb22f('0x6'),'port':0x18eb});var io=require(_0xb22f('0x7'))(new Redis(config[_0xb22f('0x5')]));function emit(_0x412a95,_0x367d4b,_0x47f61a,_0x34433b,_0x22c509){logger[_0xb22f('0x8')](_0xb22f('0x9'),_0x412a95,_0x367d4b['id'],_0x47f61a,_0x34433b,JSON[_0xb22f('0xa')](_0x22c509));io['to'](_0x47f61a)[_0xb22f('0xb')](_0x34433b,_0x22c509);}exports[_0xb22f('0xc')]=function(_0x2ca6dd,_0x26cf79,_0x2676f3,_0x3473d4){var _0x593330,_0x4b9e56;var _0x5b2399={};var _0x1caf67=Number(_0x2676f3['data1']);var _0x4bb02a=_0x2676f3['data2']?Boolean(Number(_0x2676f3[_0xb22f('0xd')])):![];var _0x40fcf8;var _0x4ae6bb=![];if(!_[_0xb22f('0xe')](_0x2676f3[_0xb22f('0xf')])){if(_0x2676f3[_0xb22f('0xf')]=='1')_0x4ae6bb=!![];}if(!_0x4ae6bb){if(_0x3473d4['xmd-contactid']){_0x5b2399['id']=_0x3473d4[_0xb22f('0x10')];}}if(!_0x5b2399['id']){_0x5b2399['ListId']=_0x1caf67;_0x40fcf8=_0x2676f3[_0xb22f('0x11')]&&_0x2676f3['data3']!=='0'?_0x2676f3[_0xb22f('0x11')][_0xb22f('0x12')](','):[_0xb22f('0x13')];_0x5b2399[_0xb22f('0x14')]=_[_0xb22f('0x15')](_0x40fcf8,function(_0x538da0){var _0x1530f7={};_0x1530f7[_0x538da0]=_0x3473d4['routeId']?_0x3473d4[_0xb22f('0x16')]:_0x3473d4[_0xb22f('0x17')];return _0x1530f7;});}var _0x2aaec4=['id',_0xb22f('0x18'),_0xb22f('0x19'),_0xb22f('0x13'),'mobile',_0xb22f('0x1a'),'ListId',_0xb22f('0x1b'),_0xb22f('0x1c'),_0xb22f('0x1d')];var _0x2239b8=_[_0xb22f('0x1e')](_0x2aaec4,_0x40fcf8);BPromise['resolve']()['then'](cmContactRpc[_0xb22f('0x1f')]({'attributes':_0x2239b8,'where':_0x5b2399}))[_0xb22f('0x20')](function(_0xf34e0d){_0x4b9e56=_0xf34e0d;if(!_[_0xb22f('0x21')](_0x4b9e56)){if(_0x4b9e56[_0xb22f('0x22')]===0x1){_0x593330=_0x4b9e56[0x0];logger[_0xb22f('0x8')](_0xb22f('0x23'),_0x3473d4[_0xb22f('0x24')],_0x26cf79['id'],_0x593330['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x3473d4[_0xb22f('0x24')],_0x26cf79['id'],_[_0xb22f('0x15')](_0x4b9e56,'id')['join'](','));}return;}else{logger[_0xb22f('0x8')](_0xb22f('0x25'),_0x3473d4['uniqueid'],_0x26cf79['id']);var _0x4687f2={'ListId':_0x1caf67};var _0x2918be=_0x2676f3['data4']&&_0x2676f3[_0xb22f('0x26')]!=='0'?_0x2676f3[_0xb22f('0x26')]:_0xb22f('0x13');if(_0x4bb02a){logger[_0xb22f('0x8')](_0xb22f('0x27'),_0x3473d4[_0xb22f('0x24')],_0x26cf79['id']);_0x4687f2[_0x2918be]=_[_0xb22f('0xe')](_0x3473d4[_0xb22f('0x28')])?_0x3473d4['calleridnum']:_0x3473d4['destcalleridnum'];if(_['isNil'](_0x3473d4[_0xb22f('0x28')])){_0x4687f2['firstName']=_0x3473d4[_0xb22f('0x29')]&&_0x3473d4[_0xb22f('0x29')]!==_0xb22f('0x2a')?_0x3473d4[_0xb22f('0x29')]:_0xb22f('0x2b');}else{_0x4687f2['firstName']=_0x3473d4['destcalleridname']&&_0x3473d4[_0xb22f('0x2c')]!==_0xb22f('0x2a')?_0x3473d4[_0xb22f('0x2c')]:_0xb22f('0x2b');}return BPromise['resolve']()[_0xb22f('0x20')](cmContactRpc[_0xb22f('0x2d')](_0x4687f2))['then'](function(_0x344c30){_0x593330=_0x344c30;_0x4b9e56[_0xb22f('0x2e')](_0x344c30);if(_0x593330){logger[_0xb22f('0x8')](_0xb22f('0x2f'),_0x3473d4[_0xb22f('0x24')],_0x26cf79['id'],_0x593330['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x3473d4[_0xb22f('0x24')],_0x26cf79['id']);_0x4687f2[_0x2918be]=_[_0xb22f('0xe')](_0x3473d4[_0xb22f('0x28')])?_0x3473d4[_0xb22f('0x17')]:_0x3473d4[_0xb22f('0x16')];if(_[_0xb22f('0xe')](_0x3473d4[_0xb22f('0x28')])){_0x4687f2[_0xb22f('0x18')]=_0x3473d4[_0xb22f('0x29')]&&_0x3473d4['calleridname']!==_0xb22f('0x2a')?_0x3473d4['calleridname']:'Unknown';}else{_0x4687f2[_0xb22f('0x18')]=_0x3473d4[_0xb22f('0x2c')]&&_0x3473d4[_0xb22f('0x2c')]!==_0xb22f('0x2a')?_0x3473d4[_0xb22f('0x2c')]:_0xb22f('0x2b');}_0x593330=_0x4687f2;_0x4b9e56[_0xb22f('0x2e')](_0x4687f2);return;}}})[_0xb22f('0x20')](function(){if(_0x2ca6dd){emit(_0x3473d4[_0xb22f('0x24')],_0x26cf79,util[_0xb22f('0x30')](_0xb22f('0x31'),_0x2ca6dd[_0xb22f('0x32')]),util[_0xb22f('0x30')]('trigger:%s',_0x2676f3['action'][_0xb22f('0x33')]()),{'evt':_[_0xb22f('0x34')](_0x3473d4,{'autoCreate':_0x4bb02a}),'contact':_0x593330===undefined?{}:_0x593330,'contacts':_0x4b9e56[_0xb22f('0x22')]===0x0?undefined:_0x4b9e56});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5458962..f004a3b 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 _0xfb0b=['urlforward','script','parse','query','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','operator','value','ChatWebsiteId','upperFirst','interaction','message','event','agent','membername','lastevent','substatus','undefined','offlineMessage','created','equals','exports','util','lodash','url','ioredis','./urlforward','./script','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','dynamics365Accounts','custom:agentcalled','bind','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','info','stringify','emit','clone','motionChannel','voice','checkTriggers','status','checkTrigger','merge','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','buildUri','data3','isNil','data4','location','uriLocation','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','exec','integration','queue','routeId'];(function(_0xfc35ec,_0x3f9d7f){var _0x3d12b2=function(_0x5622c){while(--_0x5622c){_0xfc35ec['push'](_0xfc35ec['shift']());}};_0x3d12b2(++_0x3f9d7f);}(_0xfb0b,0x94));var _0xbfb0=function(_0x32d9fe,_0x213473){_0x32d9fe=_0x32d9fe-0x0;var _0x1b8f8e=_0xfb0b[_0x32d9fe];return _0x1b8f8e;};'use strict';var util=require(_0xbfb0('0x0'));var _=require(_0xbfb0('0x1'));var url=require(_0xbfb0('0x2'));var Mustache=require('mustache');var Redis=require(_0xbfb0('0x3'));var urlforward=require(_0xbfb0('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0xbfb0('0x5'));var config=require('../../../config/environment');var logger=require(_0xbfb0('0x6'))(_0xbfb0('0x7'));var ami=require(_0xbfb0('0x8'));config[_0xbfb0('0x9')]=_[_0xbfb0('0xa')](config[_0xbfb0('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xbfb0('0xb'))(new Redis(config[_0xbfb0('0x9')]));var operators={'equals':function(_0x373a86,_0x353598){return _0x373a86==_0x353598;},'not_equals':function(_0x4c2cee,_0x50bb81){return _0x4c2cee!=_0x50bb81;}};var barAndWebActions=['popup','url',_0xbfb0('0xc')];function Trigger(_0x27a395){this[_0xbfb0('0xd')]=_0x27a395['triggers'];this[_0xbfb0('0xe')]=_0x27a395['agents'];this[_0xbfb0('0xf')]=_0x27a395[_0xbfb0('0xf')];this[_0xbfb0('0x10')]=_0x27a395[_0xbfb0('0x10')];this[_0xbfb0('0x11')]=_0x27a395[_0xbfb0('0x11')];this['zendeskAccounts']=_0x27a395[_0xbfb0('0x12')];this['freshdeskAccounts']=_0x27a395['freshdeskAccounts'];this['salesforceAccounts']=_0x27a395[_0xbfb0('0x13')];this[_0xbfb0('0x14')]=_0x27a395[_0xbfb0('0x14')];this[_0xbfb0('0x15')]=_0x27a395[_0xbfb0('0x15')];this[_0xbfb0('0x16')]=_0x27a395[_0xbfb0('0x16')];this[_0xbfb0('0x17')]=_0x27a395[_0xbfb0('0x17')];this[_0xbfb0('0x18')]=_0x27a395[_0xbfb0('0x18')];this['dynamics365Accounts']=_0x27a395['dynamics365Accounts'];this[_0xbfb0('0x19')]=_0x27a395[_0xbfb0('0x19')];this['accounts']={'zendesk':this[_0xbfb0('0x12')],'salesforce':this[_0xbfb0('0x13')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xbfb0('0x14')],'zoho':this['zohoAccounts'],'desk':this[_0xbfb0('0x16')],'vtiger':this[_0xbfb0('0x17')],'dynamics365':this[_0xbfb0('0x1a')],'freshsales':this[_0xbfb0('0x19')],'servicenow':this['servicenowAccounts']};ami['on'](_0xbfb0('0x1b'),this['syncCustomEvent'][_0xbfb0('0x1c')](this));ami['on']('custom:agentconnect',this[_0xbfb0('0x1d')]['bind'](this));ami['on'](_0xbfb0('0x1e'),this['syncCustomEvent'][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x1f'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on']('custom:agentnosuchnumber',this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x20'),this[_0xbfb0('0x1d')]['bind'](this));ami['on'](_0xbfb0('0x21'),this['syncCustomEvent'][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x22'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x23'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on']('custom:queuecallerabandon',this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x24'),this[_0xbfb0('0x1d')]['bind'](this));ami['on'](_0xbfb0('0x25'),this[_0xbfb0('0x26')]['bind'](this));ami['on'](_0xbfb0('0x27'),this[_0xbfb0('0x26')][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x28'),this[_0xbfb0('0x26')][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x29'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x2a'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on']('custom:substatus',this['syncCustomEvent']['bind'](this));ami['on'](_0xbfb0('0x2b'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x2c'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x2d'),this[_0xbfb0('0x1d')]['bind'](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0xbfb0('0x1c')](this));ami['on'](_0xbfb0('0x2e'),this[_0xbfb0('0x1d')][_0xbfb0('0x1c')](this));}Trigger[_0xbfb0('0x2f')]['emit']=function(_0x4ccaf4,_0x3f1814,_0x3e18e5){logger[_0xbfb0('0x30')](_0x4ccaf4,_0x3f1814,JSON[_0xbfb0('0x31')](_0x3e18e5));io['to'](_0x4ccaf4)[_0xbfb0('0x32')](_0x3f1814,_0x3e18e5);};Trigger[_0xbfb0('0x2f')][_0xbfb0('0x1d')]=function(_0x269f1a){var _0x1b9438=_[_0xbfb0('0x33')](_0x269f1a);if(typeof _0x1b9438['motionChannel']==='undefined'){_0x1b9438[_0xbfb0('0x34')]=_0xbfb0('0x35');}this['checkTriggers'](_0x1b9438);};Trigger[_0xbfb0('0x2f')]['syncAgentDial']=function(_0x7abbb5){if(this[_0xbfb0('0xe')][_0x7abbb5['interface']]){this['syncCustomEvent'](_0x7abbb5);}};Trigger[_0xbfb0('0x2f')][_0xbfb0('0x36')]=function(_0x5a0e86){var _0x2b34b9;for(var _0x49f90d in this[_0xbfb0('0xd')]){if(this['triggers']['hasOwnProperty'](_0x49f90d)){if(this[_0xbfb0('0xd')][_0x49f90d][_0xbfb0('0x37')]){_0x2b34b9=this[_0xbfb0('0x38')](this[_0xbfb0('0xd')][_0x49f90d],_0x5a0e86);if(_0x2b34b9){_[_0xbfb0('0x39')](_0x5a0e86,_0x5a0e86['variables']);for(var _0x4240a=0x0,_0x52bfe,_0x15b179,_0x3958c8;_0x4240a0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20833d,_0x3f8641){var _0x5f18a4=function(_0x329634){while(--_0x329634){_0x20833d['push'](_0x20833d['shift']());}};_0x5f18a4(++_0x3f8641);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ 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 38ac276..96678fd 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 _0x0186=['tenantId','data2','resolve','data5','POST','clientId','username','password','then','access_token','catch','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','isdisabled','toUpperCase','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','type','nameField','idField','substring','ticketType','assign','getString','Descriptions','userId','Fields','phonecall','queue','/contacts(','callDirection','phonecalls','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','ioredis','../../../../config/logger','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider'];(function(_0x3fb2d4,_0x44a3a8){var _0x4cfd9a=function(_0x35f723){while(--_0x35f723){_0x3fb2d4['push'](_0x3fb2d4['shift']());}};_0x4cfd9a(++_0x44a3a8);}(_0x0186,0x1f1));var _0x6018=function(_0x3a471b,_0x50bc11){_0x3a471b=_0x3a471b-0x0;var _0x326550=_0x0186[_0x3a471b];return _0x326550;};'use strict';var _=require(_0x6018('0x0'));var rp=require(_0x6018('0x1'));var util=require('util');var intUtil=require(_0x6018('0x2'));var md5=require('md5');var Redis=require(_0x6018('0x3'));var logger=require(_0x6018('0x4'))('dynamics365');var config=require(_0x6018('0x5'));config['redis']=_[_0x6018('0x6')](config[_0x6018('0x7')],{'host':_0x6018('0x8'),'port':0x18eb});var io=require(_0x6018('0x9'))(new Redis(config[_0x6018('0x7')]));function getAuthToken(_0x9548c7,_0x33d95d,_0x17470c){if(_0x9548c7[_0x6018('0xa')]){_0x9548c7[_0x6018('0xb')]=_0x9548c7[_0x6018('0xc')]['data7'];_0x9548c7[_0x6018('0xd')]=_0x9548c7['CloudProvider'][_0x6018('0xe')];return Promise[_0x6018('0xf')](_0x9548c7[_0x6018('0xc')][_0x6018('0x10')]);}var _0x499661={'method':_0x6018('0x11'),'uri':_0x33d95d,'form':{'client_id':_0x9548c7[_0x6018('0x12')],'resource':_0x9548c7[_0x6018('0xb')],'username':_0x9548c7[_0x6018('0x13')],'password':_0x9548c7[_0x6018('0x14')],'grant_type':_0x6018('0x14'),'client_secret':_0x9548c7['clientSecret']},'json':!![]};return rp(_0x499661)[_0x6018('0x15')](function(_0x4c234f){return _0x4c234f[_0x6018('0x16')];})[_0x6018('0x17')](function(_0x3d8525){logger[_0x6018('0x18')]('['+[_0x17470c['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x3d8525[_0x6018('0x19')];});}function getUser(_0x4f1bf2,_0x45b577,_0x571f54,_0x3e7d55,_0xe04081,_0x411589){return new Promise(function(_0x5c4e34,_0x4e4c79){return getAuthToken(_0x45b577,_0x3e7d55,_0x411589)['then'](function(_0x2a0bb7){var _0x24fd83={'method':_0x6018('0x1a'),'uri':_0xe04081+_0x6018('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x2a0bb7,'OData-Version':_0x6018('0x1c')},'json':!![]};return rp(_0x24fd83);})['then'](function(_0x5b60e9){var _0xd33c91=_0x5b60e9[_0x6018('0x1d')];var _0x5acc2d=![];var _0x4e0f29=null;if(!_[_0x6018('0x1e')](_0x571f54)){if(intUtil[_0x6018('0x1f')](_0x571f54[_0x6018('0x20')])){_0x4f1bf2[_0x6018('0x21')]=_0x571f54[_0x6018('0x20')];for(_0x4e0f29=0x0;_0x4e0f29<_0xd33c91[_0x6018('0x22')];_0x4e0f29++){if(_0xd33c91[_0x4e0f29]['internalemailaddress']===_0x571f54[_0x6018('0x20')]&&!_0xd33c91[_0x4e0f29][_0x6018('0x23')]){_0x5acc2d=!![];logger['info']('['+[_0x411589[_0x6018('0x24')]()]+']\x20Agent\x20found\x20'+_0xd33c91[_0x4e0f29][_0x6018('0x25')]+'!');_0x4f1bf2['userId']=_0xd33c91[_0x4e0f29]['systemuserid'];}}}}if(!_0x5acc2d){logger[_0x6018('0x26')]('['+[_0x411589[_0x6018('0x24')]()]+_0x6018('0x27'));_0x4f1bf2[_0x6018('0x21')]=_0x45b577[_0x6018('0x13')];for(_0x4e0f29=0x0;_0x4e0f29<_0xd33c91['length'];_0x4e0f29++){if(_0xd33c91[_0x4e0f29]['internalemailaddress']===_0x45b577[_0x6018('0x13')]){_0x4f1bf2['userId']=_0xd33c91[_0x4e0f29][_0x6018('0x25')];}}}_0x5c4e34(_0x4f1bf2);})[_0x6018('0x17')](function(_0x27672d){_0x4e4c79(_0x27672d[_0x6018('0x19')]);});});}function createEndUser(_0x31367c,_0x4716bd,_0x129257,_0x4d50df,_0x4fa12a,_0x46fc78){return new Promise(function(_0x8b74b6,_0x582818){return getAuthToken(_0x4716bd,_0x129257,_0x46fc78)[_0x6018('0x15')](function(_0x375c4b){var _0x300374=_0x46fc78[_0x6018('0x28')]()===_0x6018('0x29')?_0x4fa12a[_0x6018('0x2a')]:_0x4fa12a[_0x6018('0x2b')];var _0x286a5b={'method':_0x6018('0x11'),'uri':_0x4d50df+_0x6018('0x2c'),'body':{'telephone1':_0x300374,'fullname':_0x300374,'firstname':_0x300374,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6018('0x2d')+_0x31367c['userId']+')'},'headers':{'Authorization':_0x6018('0x2e')+_0x375c4b,'OData-Version':_0x6018('0x1c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x286a5b);})[_0x6018('0x15')](function(_0x4cb102){var _0x2f28ec=_0x4cb102[_0x6018('0x2f')][_0x6018('0x30')];var _0x3e8407=_0x2f28ec['substring'](_0x2f28ec['lastIndexOf']('(')+0x1,_0x2f28ec[_0x6018('0x31')](')'));_0x31367c[_0x6018('0x32')]=_0x3e8407;_0x8b74b6(_0x31367c);})[_0x6018('0x17')](function(_0x1dc1f9){_0x582818(_0x1dc1f9[_0x6018('0x19')]);});});}function getEndUser(_0x1d5f82,_0x523116,_0x23c8cc,_0x316313,_0x64f1cf,_0x368113,_0x345517){var _0x5434be=_0x368113['toLowerCase']()===_0x6018('0x29')?_0x64f1cf[_0x6018('0x2a')]:_0x64f1cf['calleridnum'];return getAuthToken(_0x523116,_0x23c8cc,_0x368113)['then'](function(_0x3f3443){var _0x2eb182={'method':'GET','uri':_0x316313+_0x6018('0x33')+_0x5434be['replace']('+',_0x6018('0x34'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3f3443,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2eb182);})[_0x6018('0x15')](function(_0x8e18ef){var _0x9ea3d1=![];if(!_0x8e18ef)return _0x9ea3d1;var _0x3ebcda=_0x8e18ef['value'];for(var _0x59cb79=0x0;_0x59cb79<_0x3ebcda[_0x6018('0x22')];_0x59cb79++){if(_0x3ebcda[_0x59cb79][_0x6018('0x35')]===_0x5434be){_0x9ea3d1=!![];_0x1d5f82[_0x6018('0x32')]=_0x3ebcda[_0x59cb79][_0x6018('0x36')];}}return _0x9ea3d1;})[_0x6018('0x15')](function(_0x378eb7){if(_0x378eb7)return _0x1d5f82;if(_0x345517===_0x6018('0x37')){logger[_0x6018('0x26')]('['+[_0x368113[_0x6018('0x24')]()]+_0x6018('0x38'));return _0x1d5f82;}return createEndUser(_0x1d5f82,_0x523116,_0x23c8cc,_0x316313,_0x64f1cf,_0x368113)[_0x6018('0x15')](function(_0x214348){logger[_0x6018('0x26')]('['+[_0x368113[_0x6018('0x24')]()]+']\x20Enduser\x20created!',_0x214348['enduserId']);return _0x214348;});});}function getCustomFields(_0x135510,_0x5e8cec,_0x12adf3){var _0xacbb4f={};if(_0x135510[_0x6018('0x22')]>0x0){_[_0x6018('0x39')](_0x135510,function(_0x169c38){if(_[_0x6018('0x3a')]([_0x6018('0x3b'),'picklist'],_0x169c38[_0x6018('0x3c')])&&_0x169c38[_0x6018('0x3d')]&&!_0x169c38['customField']){var _0x852416=_0x169c38[_0x6018('0x3e')][_0x6018('0x28')]();var _0x41ee0c=_0x852416[_0x6018('0x3f')](0x0,_0x852416['indexOf']('_'));var _0x5e8c66=_0x852416[_0x6018('0x3f')](_0x852416['indexOf']('_')+0x1);if(_0x41ee0c===_0x12adf3){_0xacbb4f[_0x5e8c66]=_0x169c38['content'];}}});}return _0xacbb4f;}function getTicket(_0x495493,_0x16ec02,_0x3dfe85,_0x160950,_0x59821a,_0x449aa0,_0x4c64c5){return new Promise(function(_0x3bb965,_0x3ab630){var _0x15bf32;return getAuthToken(_0x16ec02,_0x3dfe85,_0x4c64c5)[_0x6018('0x15')](function(_0x10fb63){if(_0x449aa0[_0x6018('0x40')]==='incident'){_0x15bf32={'method':_0x6018('0x11'),'uri':_0x160950+'incidents','body':Object[_0x6018('0x41')]({},{'title':intUtil[_0x6018('0x42')](_0x449aa0['Subjects'],_0x59821a,'\x20'),'description':intUtil[_0x6018('0x42')](_0x449aa0[_0x6018('0x43')],_0x59821a,'\x0a'),'customerid_contact@odata.bind':_0x495493[_0x6018('0x32')]?'/contacts('+_0x495493[_0x6018('0x32')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x495493[_0x6018('0x44')]+')','caseorigincode':'1'},getCustomFields(_0x449aa0[_0x6018('0x45')],_0x59821a,_0x449aa0[_0x6018('0x40')])),'headers':{'Authorization':_0x6018('0x2e')+_0x10fb63,'OData-Version':_0x6018('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x449aa0[_0x6018('0x40')]===_0x6018('0x46')){var _0x43b2ed=_0x495493['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x495493[_0x6018('0x44')]+')','participationtypemask':_0x495493['callDirection']===_0x6018('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x6018('0x48')+_0x495493[_0x6018('0x32')]+')','participationtypemask':_0x495493[_0x6018('0x49')]===_0x6018('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6018('0x2d')+_0x495493['userId']+')','participationtypemask':_0x495493[_0x6018('0x49')]===_0x6018('0x47')?0x2:0x1}];_0x15bf32={'method':_0x6018('0x11'),'uri':_0x160950+_0x6018('0x4a'),'body':Object[_0x6018('0x41')]({},{'subject':intUtil['getString'](_0x449aa0[_0x6018('0x4b')],_0x59821a,'\x20'),'phonenumber':String(_0x59821a['calleridnum']),'description':intUtil[_0x6018('0x42')](_0x449aa0[_0x6018('0x43')],_0x59821a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x495493[_0x6018('0x32')]?_0x6018('0x48')+_0x495493['enduserId']+')':undefined,'ownerid@odata.bind':_0x6018('0x2d')+_0x495493[_0x6018('0x44')]+')','directioncode':_0x495493['callDirection']===_0x6018('0x47')?![]:!![],'phonecall_activity_parties':_0x43b2ed},getCustomFields(_0x449aa0[_0x6018('0x45')],_0x59821a,_0x449aa0[_0x6018('0x40')])),'headers':{'Authorization':_0x6018('0x2e')+_0x10fb63,'OData-Version':_0x6018('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x15bf32);})[_0x6018('0x15')](function(_0x45d946){var _0x3df8cf=_0x45d946[_0x6018('0x2f')][_0x6018('0x30')];var _0x4db56d=_0x3df8cf['substring'](_0x3df8cf[_0x6018('0x31')]('(')+0x1,_0x3df8cf['lastIndexOf'](')'));_0x495493[_0x6018('0x4c')]=_0x4db56d;_0x3bb965(_0x495493);})[_0x6018('0x17')](function(_0x595b5f){_0x3ab630(_0x595b5f[_0x6018('0x19')]);});});}function emit(_0x4281a1,_0x26dc76,_0x56dff0,_0x5260a1){var _0x278ed8={'uri':util[_0x6018('0x4d')](_0x6018('0x4e'),_0x4281a1,_0x56dff0,_0x5260a1)};io['to'](util[_0x6018('0x4d')](_0x6018('0x4f'),_0x26dc76))[_0x6018('0x50')]('trigger:browser:url',_0x278ed8);}exports['cs']=function(_0xebc7d2,_0x45211a,_0x511142,_0x58a0b0,_0x2158cc,_0x338451,_0x2d9654,_0x4a4682){var _0x2867a0={};_0x338451[_0x6018('0xb')]=_0x338451[_0x6018('0xa')]?intUtil[_0x6018('0x51')](_0x338451[_0x6018('0xc')][_0x6018('0x52')]):intUtil[_0x6018('0x51')](_0x338451[_0x6018('0xb')]);_0x338451[_0x6018('0x53')]=intUtil[_0x6018('0x51')](_0x338451['serverUrl']);_0x2867a0['callDirection']=_0x4a4682===_0x6018('0x47')||_0x4a4682===_0x6018('0x54')?_0x6018('0x47'):_0x6018('0x29');var _0x32911f=_0x338451[_0x6018('0xa')]?util['format'](_0x6018('0x55'),_0x338451[_0x6018('0xc')][_0x6018('0x52')]):util['format'](_0x6018('0x55'),_0x338451['remoteUri']);var _0x3b52ce=util[_0x6018('0x4d')](_0x6018('0x56'),_0x338451[_0x6018('0xd')]);var _0x4e1d53=util[_0x6018('0x4d')](_0x6018('0x57'),_0x338451[_0x6018('0x53')],_0x45211a[_0x6018('0x58')],md5(_0x45211a[_0x6018('0x58')]));if(_0x2158cc&&_0x2158cc[_0x6018('0x59')]){logger[_0x6018('0x26')]('[QUEUE]','Recording\x20is\x20enabled!');_0x45211a[_0x6018('0x5a')]=_0x4e1d53;}else if(_0x2d9654&&_0x2d9654[_0x6018('0x5b')]&&_0x2d9654[_0x6018('0x5b')]!=='none'){logger[_0x6018('0x26')](_0x6018('0x5c'),_0x6018('0x5d'));_0x45211a[_0x6018('0x5a')]=_0x4e1d53;}else{_0x45211a['recordingURL']='';}return getUser(_0x2867a0,_0x338451,_0x58a0b0,_0x3b52ce,_0x32911f,_0x4a4682)[_0x6018('0x15')](function(_0x420f8b){logger[_0x6018('0x26')]('['+_0x4a4682[_0x6018('0x24')]()+_0x6018('0x5e'),_0x420f8b[_0x6018('0x44')]);logger[_0x6018('0x26')]('['+_0x4a4682[_0x6018('0x24')]()+_0x6018('0x5f'),_0x420f8b['userEmail']);return getEndUser(_0x420f8b,_0x338451,_0x3b52ce,_0x32911f,_0x45211a,_0x4a4682,_0x511142['moduleCreate']);})[_0x6018('0x15')](function(_0x57e6da){logger[_0x6018('0x26')]('['+_0x4a4682[_0x6018('0x24')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x57e6da[_0x6018('0x32')]);logger[_0x6018('0x26')]('['+_0x4a4682[_0x6018('0x24')]()+_0x6018('0x60'),_0x45211a['calleridnum']);return getTicket(_0x57e6da,_0x338451,_0x3b52ce,_0x32911f,_0x45211a,_0x511142,_0x4a4682);})['then'](function(_0x5893e1){logger[_0x6018('0x26')](util['format']('['+_0x4a4682['toUpperCase']()+_0x6018('0x61'),_0x511142[_0x6018('0x40')],_0x5893e1[_0x6018('0x4c')]));logger[_0x6018('0x26')](util[_0x6018('0x4d')]('['+_0x4a4682[_0x6018('0x24')]()+_0x6018('0x62'),_0x4a4682));if(_0x4a4682!==_0x6018('0x54')){logger[_0x6018('0x26')]('['+_0x4a4682[_0x6018('0x24')]()+']',_0x6018('0x63'));emit(_0x338451[_0x6018('0xb')],_0x58a0b0[_0x6018('0x64')],_0x511142[_0x6018('0x40')],_0x5893e1[_0x6018('0x4c')]);}})[_0x6018('0x17')](function(_0x5e9706){logger[_0x6018('0x18')]('['+_0x4a4682[_0x6018('0x24')]()+_0x6018('0x65'),_0x5e9706[_0x6018('0x19')]);});}; \ No newline at end of file +var _0x5f12=['../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','data2','resolve','data5','clientId','remoteUri','username','password','then','catch','error','toUpperCase','GET','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','calleridnum','POST','contacts','headers','odata-entityid','lastIndexOf','enduserId','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','picklist','type','nameField','customField','substring','indexOf','content','ticketType','incident','incidents','assign','Subjects','getString','/contacts(','/systemusers(','Fields','callDirection','queue','phonecalls','Descriptions','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','data7','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','ioredis'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x5f12,0x1eb));var _0x25f1=function(_0xaace91,_0x5d2d04){_0xaace91=_0xaace91-0x0;var _0x3c689f=_0x5f12[_0xaace91];return _0x3c689f;};'use strict';var _=require('lodash');var rp=require(_0x25f1('0x0'));var util=require(_0x25f1('0x1'));var intUtil=require(_0x25f1('0x2'));var md5=require('md5');var Redis=require(_0x25f1('0x3'));var logger=require(_0x25f1('0x4'))(_0x25f1('0x5'));var config=require('../../../../config/environment');config[_0x25f1('0x6')]=_[_0x25f1('0x7')](config['redis'],{'host':_0x25f1('0x8'),'port':0x18eb});var io=require(_0x25f1('0x9'))(new Redis(config[_0x25f1('0x6')]));function getAuthToken(_0x2b44c8,_0x3e1218,_0x455621){if(_0x2b44c8[_0x25f1('0xa')]){_0x2b44c8['remoteUri']=_0x2b44c8[_0x25f1('0xb')]['data7'];_0x2b44c8[_0x25f1('0xc')]=_0x2b44c8[_0x25f1('0xb')][_0x25f1('0xd')];return Promise[_0x25f1('0xe')](_0x2b44c8[_0x25f1('0xb')][_0x25f1('0xf')]);}var _0x5b157c={'method':'POST','uri':_0x3e1218,'form':{'client_id':_0x2b44c8[_0x25f1('0x10')],'resource':_0x2b44c8[_0x25f1('0x11')],'username':_0x2b44c8[_0x25f1('0x12')],'password':_0x2b44c8['password'],'grant_type':_0x25f1('0x13'),'client_secret':_0x2b44c8['clientSecret']},'json':!![]};return rp(_0x5b157c)[_0x25f1('0x14')](function(_0x1aeee5){return _0x1aeee5['access_token'];})[_0x25f1('0x15')](function(_0x44ab48){logger[_0x25f1('0x16')]('['+[_0x455621[_0x25f1('0x17')]()]+']\x20Wrong\x20credentials!');return _0x44ab48['message'];});}function getUser(_0xb51718,_0x2f9bf9,_0x268e01,_0x177499,_0xda060c,_0x362c1d){return new Promise(function(_0x5e7f3d,_0x2e4823){return getAuthToken(_0x2f9bf9,_0x177499,_0x362c1d)['then'](function(_0x5bdd47){var _0x125d0b={'method':_0x25f1('0x18'),'uri':_0xda060c+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x25f1('0x19')+_0x5bdd47,'OData-Version':_0x25f1('0x1a')},'json':!![]};return rp(_0x125d0b);})[_0x25f1('0x14')](function(_0x10b13b){var _0x5e325a=_0x10b13b[_0x25f1('0x1b')];var _0x143314=![];var _0x1936ea=null;if(!_['isNil'](_0x268e01)){if(intUtil[_0x25f1('0x1c')](_0x268e01[_0x25f1('0x1d')])){_0xb51718[_0x25f1('0x1e')]=_0x268e01[_0x25f1('0x1d')];for(_0x1936ea=0x0;_0x1936ea<_0x5e325a[_0x25f1('0x1f')];_0x1936ea++){if(_0x5e325a[_0x1936ea][_0x25f1('0x20')]===_0x268e01[_0x25f1('0x1d')]&&!_0x5e325a[_0x1936ea]['isdisabled']){_0x143314=!![];logger['info']('['+[_0x362c1d[_0x25f1('0x17')]()]+_0x25f1('0x21')+_0x5e325a[_0x1936ea][_0x25f1('0x22')]+'!');_0xb51718[_0x25f1('0x23')]=_0x5e325a[_0x1936ea][_0x25f1('0x22')];}}}}if(!_0x143314){logger[_0x25f1('0x24')]('['+[_0x362c1d[_0x25f1('0x17')]()]+_0x25f1('0x25'));_0xb51718[_0x25f1('0x1e')]=_0x2f9bf9[_0x25f1('0x12')];for(_0x1936ea=0x0;_0x1936ea<_0x5e325a[_0x25f1('0x1f')];_0x1936ea++){if(_0x5e325a[_0x1936ea][_0x25f1('0x20')]===_0x2f9bf9[_0x25f1('0x12')]){_0xb51718[_0x25f1('0x23')]=_0x5e325a[_0x1936ea]['systemuserid'];}}}_0x5e7f3d(_0xb51718);})['catch'](function(_0x3a24fb){_0x2e4823(_0x3a24fb[_0x25f1('0x26')]);});});}function createEndUser(_0x1ef68d,_0x22683c,_0x4631ee,_0x202ba5,_0x4898da,_0x5b8c0c){return new Promise(function(_0x4b5cc4,_0x175b28){return getAuthToken(_0x22683c,_0x4631ee,_0x5b8c0c)[_0x25f1('0x14')](function(_0x5e2cf1){var _0x489cfa=_0x5b8c0c[_0x25f1('0x27')]()===_0x25f1('0x28')?_0x4898da['destcalleridnum']:_0x4898da[_0x25f1('0x29')];var _0x2c0ef2={'method':_0x25f1('0x2a'),'uri':_0x202ba5+_0x25f1('0x2b'),'body':{'telephone1':_0x489cfa,'fullname':_0x489cfa,'firstname':_0x489cfa,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x1ef68d[_0x25f1('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x5e2cf1,'OData-Version':_0x25f1('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2c0ef2);})[_0x25f1('0x14')](function(_0x33a9f0){var _0x77a31b=_0x33a9f0[_0x25f1('0x2c')][_0x25f1('0x2d')];var _0x5d6e80=_0x77a31b['substring'](_0x77a31b[_0x25f1('0x2e')]('(')+0x1,_0x77a31b['lastIndexOf'](')'));_0x1ef68d[_0x25f1('0x2f')]=_0x5d6e80;_0x4b5cc4(_0x1ef68d);})['catch'](function(_0x137fb3){_0x175b28(_0x137fb3['message']);});});}function getEndUser(_0x1dee29,_0x20bf4f,_0x1fb3ef,_0x40b2ad,_0x3f1e56,_0x34de9a,_0x58fb53){var _0x2622e2=_0x34de9a[_0x25f1('0x27')]()==='outbound'?_0x3f1e56[_0x25f1('0x30')]:_0x3f1e56['calleridnum'];return getAuthToken(_0x20bf4f,_0x1fb3ef,_0x34de9a)[_0x25f1('0x14')](function(_0x546521){var _0x159bcd={'method':_0x25f1('0x18'),'uri':_0x40b2ad+_0x25f1('0x31')+_0x2622e2['replace']('+',_0x25f1('0x32'))+'\x27','headers':{'Authorization':_0x25f1('0x19')+_0x546521,'If-None-Match':null,'OData-Version':_0x25f1('0x1a')},'json':!![]};return rp(_0x159bcd);})[_0x25f1('0x14')](function(_0x4ba178){var _0x15f04f=![];if(!_0x4ba178)return _0x15f04f;var _0x51641d=_0x4ba178['value'];for(var _0x101491=0x0;_0x101491<_0x51641d['length'];_0x101491++){if(_0x51641d[_0x101491][_0x25f1('0x33')]===_0x2622e2){_0x15f04f=!![];_0x1dee29[_0x25f1('0x2f')]=_0x51641d[_0x101491][_0x25f1('0x34')];}}return _0x15f04f;})[_0x25f1('0x14')](function(_0x3c865c){if(_0x3c865c)return _0x1dee29;if(_0x58fb53===_0x25f1('0x35')){logger['info']('['+[_0x34de9a[_0x25f1('0x17')]()]+_0x25f1('0x36'));return _0x1dee29;}return createEndUser(_0x1dee29,_0x20bf4f,_0x1fb3ef,_0x40b2ad,_0x3f1e56,_0x34de9a)[_0x25f1('0x14')](function(_0xb554e4){logger['info']('['+[_0x34de9a[_0x25f1('0x17')]()]+']\x20Enduser\x20created!',_0xb554e4[_0x25f1('0x2f')]);return _0xb554e4;});});}function getCustomFields(_0x7c358a,_0x3283ad,_0x408237){var _0xe1e281={};if(_0x7c358a[_0x25f1('0x1f')]>0x0){_['forEach'](_0x7c358a,function(_0xa11e83){if(_['includes'](['string',_0x25f1('0x37')],_0xa11e83[_0x25f1('0x38')])&&_0xa11e83[_0x25f1('0x39')]&&!_0xa11e83[_0x25f1('0x3a')]){var _0x36922d=_0xa11e83['idField'][_0x25f1('0x27')]();var _0x1bbb44=_0x36922d[_0x25f1('0x3b')](0x0,_0x36922d[_0x25f1('0x3c')]('_'));var _0x1dd18f=_0x36922d[_0x25f1('0x3b')](_0x36922d[_0x25f1('0x3c')]('_')+0x1);if(_0x1bbb44===_0x408237){_0xe1e281[_0x1dd18f]=_0xa11e83[_0x25f1('0x3d')];}}});}return _0xe1e281;}function getTicket(_0x4f56de,_0x51e30b,_0x1b38eb,_0x1006a1,_0x9c5687,_0x50f200,_0x36e708){return new Promise(function(_0x3be960,_0x4250bc){var _0x3d6d4b;return getAuthToken(_0x51e30b,_0x1b38eb,_0x36e708)[_0x25f1('0x14')](function(_0x52f40e){if(_0x50f200[_0x25f1('0x3e')]===_0x25f1('0x3f')){_0x3d6d4b={'method':_0x25f1('0x2a'),'uri':_0x1006a1+_0x25f1('0x40'),'body':Object[_0x25f1('0x41')]({},{'title':intUtil['getString'](_0x50f200[_0x25f1('0x42')],_0x9c5687,'\x20'),'description':intUtil[_0x25f1('0x43')](_0x50f200['Descriptions'],_0x9c5687,'\x0a'),'customerid_contact@odata.bind':_0x4f56de[_0x25f1('0x2f')]?_0x25f1('0x44')+_0x4f56de['enduserId']+')':undefined,'ownerid@odata.bind':_0x25f1('0x45')+_0x4f56de[_0x25f1('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x50f200[_0x25f1('0x46')],_0x9c5687,_0x50f200[_0x25f1('0x3e')])),'headers':{'Authorization':_0x25f1('0x19')+_0x52f40e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x50f200[_0x25f1('0x3e')]==='phonecall'){var _0x5cf5e4=_0x4f56de['enduserId']?[{'partyid_systemuser@odata.bind':_0x25f1('0x45')+_0x4f56de['userId']+')','participationtypemask':_0x4f56de[_0x25f1('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x25f1('0x44')+_0x4f56de[_0x25f1('0x2f')]+')','participationtypemask':_0x4f56de['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x25f1('0x45')+_0x4f56de[_0x25f1('0x23')]+')','participationtypemask':_0x4f56de[_0x25f1('0x47')]===_0x25f1('0x48')?0x2:0x1}];_0x3d6d4b={'method':_0x25f1('0x2a'),'uri':_0x1006a1+_0x25f1('0x49'),'body':Object[_0x25f1('0x41')]({},{'subject':intUtil[_0x25f1('0x43')](_0x50f200['Subjects'],_0x9c5687,'\x20'),'phonenumber':String(_0x9c5687[_0x25f1('0x29')]),'description':intUtil[_0x25f1('0x43')](_0x50f200[_0x25f1('0x4a')],_0x9c5687,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4f56de[_0x25f1('0x2f')]?_0x25f1('0x44')+_0x4f56de[_0x25f1('0x2f')]+')':undefined,'ownerid@odata.bind':_0x25f1('0x45')+_0x4f56de[_0x25f1('0x23')]+')','directioncode':_0x4f56de[_0x25f1('0x47')]===_0x25f1('0x48')?![]:!![],'phonecall_activity_parties':_0x5cf5e4},getCustomFields(_0x50f200['Fields'],_0x9c5687,_0x50f200[_0x25f1('0x3e')])),'headers':{'Authorization':_0x25f1('0x19')+_0x52f40e,'OData-Version':_0x25f1('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3d6d4b);})['then'](function(_0x266129){var _0x495090=_0x266129[_0x25f1('0x2c')][_0x25f1('0x2d')];var _0x24d452=_0x495090[_0x25f1('0x3b')](_0x495090['lastIndexOf']('(')+0x1,_0x495090['lastIndexOf'](')'));_0x4f56de[_0x25f1('0x4b')]=_0x24d452;_0x3be960(_0x4f56de);})[_0x25f1('0x15')](function(_0x4db915){_0x4250bc(_0x4db915[_0x25f1('0x26')]);});});}function emit(_0x4a9be2,_0x56d5c2,_0x44fa95,_0x2db901){var _0x532d95={'uri':util[_0x25f1('0x4c')](_0x25f1('0x4d'),_0x4a9be2,_0x44fa95,_0x2db901)};io['to'](util[_0x25f1('0x4c')](_0x25f1('0x4e'),_0x56d5c2))[_0x25f1('0x4f')]('trigger:browser:url',_0x532d95);}exports['cs']=function(_0x5c2cd4,_0x3ed026,_0x13850a,_0x5bd7ed,_0x39c9df,_0xd8705b,_0x2ab0db,_0x48efd1){var _0x273e4f={};_0xd8705b['remoteUri']=_0xd8705b[_0x25f1('0xa')]?intUtil['stripTrailingSlash'](_0xd8705b[_0x25f1('0xb')][_0x25f1('0x50')]):intUtil['stripTrailingSlash'](_0xd8705b[_0x25f1('0x11')]);_0xd8705b[_0x25f1('0x51')]=intUtil[_0x25f1('0x52')](_0xd8705b[_0x25f1('0x51')]);_0x273e4f[_0x25f1('0x47')]=_0x48efd1==='queue'||_0x48efd1===_0x25f1('0x53')?_0x25f1('0x48'):_0x25f1('0x28');var _0x52595e=_0xd8705b[_0x25f1('0xa')]?util[_0x25f1('0x4c')](_0x25f1('0x54'),_0xd8705b[_0x25f1('0xb')][_0x25f1('0x50')]):util[_0x25f1('0x4c')]('%s/api/data/v9.0/',_0xd8705b[_0x25f1('0x11')]);var _0x4e2097=util['format'](_0x25f1('0x55'),_0xd8705b[_0x25f1('0xc')]);var _0xb0d484=util[_0x25f1('0x4c')](_0x25f1('0x56'),_0xd8705b['serverUrl'],_0x3ed026['uniqueid'],md5(_0x3ed026['uniqueid']));if(_0x39c9df&&_0x39c9df['monitor_format']){logger[_0x25f1('0x24')](_0x25f1('0x57'),'Recording\x20is\x20enabled!');_0x3ed026['recordingURL']=_0xb0d484;}else if(_0x2ab0db&&_0x2ab0db[_0x25f1('0x58')]&&_0x2ab0db[_0x25f1('0x58')]!==_0x25f1('0x59')){logger[_0x25f1('0x24')](_0x25f1('0x5a'),_0x25f1('0x5b'));_0x3ed026[_0x25f1('0x5c')]=_0xb0d484;}else{_0x3ed026[_0x25f1('0x5c')]='';}return getUser(_0x273e4f,_0xd8705b,_0x5bd7ed,_0x4e2097,_0x52595e,_0x48efd1)[_0x25f1('0x14')](function(_0x5217be){logger['info']('['+_0x48efd1[_0x25f1('0x17')]()+']\x20The\x20User\x20ID\x20is:',_0x5217be[_0x25f1('0x23')]);logger[_0x25f1('0x24')]('['+_0x48efd1['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x5217be['userEmail']);return getEndUser(_0x5217be,_0xd8705b,_0x4e2097,_0x52595e,_0x3ed026,_0x48efd1,_0x13850a['moduleCreate']);})[_0x25f1('0x14')](function(_0xedef6f){logger[_0x25f1('0x24')]('['+_0x48efd1[_0x25f1('0x17')]()+_0x25f1('0x5d'),_0xedef6f['enduserId']);logger[_0x25f1('0x24')]('['+_0x48efd1[_0x25f1('0x17')]()+_0x25f1('0x5e'),_0x3ed026[_0x25f1('0x29')]);return getTicket(_0xedef6f,_0xd8705b,_0x4e2097,_0x52595e,_0x3ed026,_0x13850a,_0x48efd1);})['then'](function(_0x3f310a){logger['info'](util[_0x25f1('0x4c')]('['+_0x48efd1[_0x25f1('0x17')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x13850a[_0x25f1('0x3e')],_0x3f310a['ticketId']));logger['info'](util[_0x25f1('0x4c')]('['+_0x48efd1[_0x25f1('0x17')]()+_0x25f1('0x5f'),_0x48efd1));if(_0x48efd1!==_0x25f1('0x53')){logger[_0x25f1('0x24')]('['+_0x48efd1[_0x25f1('0x17')]()+']',_0x25f1('0x60'));emit(_0xd8705b[_0x25f1('0x11')],_0x5bd7ed[_0x25f1('0x61')],_0x13850a['ticketType'],_0x3f310a[_0x25f1('0x4b')]);}})[_0x25f1('0x15')](function(_0x252ee8){logger[_0x25f1('0x16')]('['+_0x48efd1[_0x25f1('0x17')]()+_0x25f1('0x62'),_0x252ee8['message']);});}; \ 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 e4ea7be..e41951a 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 _0xa562=['Agent\x20found!','contact','email','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','POST','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toString','idField','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','user:%s','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','redis','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','Ticket\x20created!','%s/api/v2/agents','then','length'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0xa562,0x98));var _0x2a56=function(_0x20025e,_0x44c8e1){_0x20025e=_0x20025e-0x0;var _0x4a5ac4=_0xa562[_0x20025e];return _0x4a5ac4;};'use strict';var _=require(_0x2a56('0x0'));var rp=require(_0x2a56('0x1'));var md5=require(_0x2a56('0x2'));var util=require(_0x2a56('0x3'));var Redis=require(_0x2a56('0x4'));var intUtil=require(_0x2a56('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshdesk');config[_0x2a56('0x6')]=_[_0x2a56('0x7')](config['redis'],{'host':_0x2a56('0x8'),'port':0x18eb});var io=require(_0x2a56('0x9'))(new Redis(config[_0x2a56('0x6')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x2b2be4,_0x413940,_0x2b772f){io['to'](_0x2b2be4)['emit'](_0x413940,_0x2b772f);}function getTicket(_0x2a6248,_0xc8c5a,_0x5bcb22,_0x1d9fc0,_0x448da4){logger[_0x2a56('0xa')](_0x2a56('0xb'));var _0xa32d7e=_[_0x2a56('0xc')]({'responder_id':_0xc8c5a['id'],'requester_id':_0x5bcb22['id'],'name':util[_0x2a56('0xd')](_0x2a56('0xe'),_0x448da4[_0x2a56('0xf')]),'phone':_0x448da4[_0x2a56('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2a56('0x11')](_0x1d9fc0[_0x2a56('0x12')],_0x448da4,'\x20'),'description':intUtil['getString'](_0x1d9fc0[_0x2a56('0x13')],_0x448da4,_0x2a56('0x14')),'tags':getTags(_0x1d9fc0[_0x2a56('0x15')],'name')},getCustomFields(_0x1d9fc0['Fields'],_0x448da4));_0xa32d7e['custom_fields']=_[_0x2a56('0x16')](_[_0x2a56('0x17')](_0xa32d7e[_0x2a56('0x18')],'id'),_0x2a56('0x19'));return request({'uri':util[_0x2a56('0xd')](_0x2a56('0x1a'),_0x2a6248[_0x2a56('0x1b')]),'method':'POST','body':_0xa32d7e})['then'](function(_0x439296){logger[_0x2a56('0xa')](_0x2a56('0x1c'));return _0x439296;});}function getUser(_0xa1423e,_0x2d70a1){if(intUtil['validateEmail'](_0x2d70a1)){return request({'uri':util[_0x2a56('0xd')](_0x2a56('0x1d'),_0xa1423e[_0x2a56('0x1b')]),'qs':{'email':_0x2d70a1}})[_0x2a56('0x1e')](function(_0x53d01f){if(_0x53d01f[_0x2a56('0x1f')]){logger[_0x2a56('0xa')](_0x2a56('0x20'));return _['find'](_0x53d01f,function(_0xbf66a){return _0xbf66a[_0x2a56('0x21')][_0x2a56('0x22')]===_0x2d70a1;});}else{logger[_0x2a56('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0xa1423e[_0x2a56('0x1b')])})['then'](function(_0x19f28f){logger[_0x2a56('0xa')]('Admin\x20account\x20selected.');return _0x19f28f;});}});}else{logger['info'](_0x2a56('0x23'));return request({'uri':util['format'](_0x2a56('0x24'),_0xa1423e[_0x2a56('0x1b')])})[_0x2a56('0x1e')](function(_0x6f93d8){logger[_0x2a56('0xa')]('Admin\x20account\x20selected.');return _0x6f93d8;});}}function getEndUser(_0x47c0d3,_0x3e9349,_0x1bc72a){logger['info'](_0x2a56('0x25'),_0x1bc72a);return request({'uri':util[_0x2a56('0xd')](_0x2a56('0x26'),_0x47c0d3[_0x2a56('0x1b')]),'qs':{'phone':_0x1bc72a}})[_0x2a56('0x1e')](function(_0x1e6689){if(_0x1e6689[_0x2a56('0x1f')]){logger[_0x2a56('0xa')](_0x2a56('0x27'));return _[_0x2a56('0x28')](_0x1e6689,{'phone':_0x1bc72a});}else{logger[_0x2a56('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x2a56('0xd')](_0x2a56('0x26'),_0x47c0d3['remoteUri']),'method':_0x2a56('0x29'),'body':{'name':_0x3e9349,'phone':_0x1bc72a}})[_0x2a56('0x1e')](function(_0x5dce6d){logger[_0x2a56('0xa')](_0x2a56('0x2a'));return _0x5dce6d;});}});}function getAuth(_0x175c1d){return util['format'](_0x2a56('0x2b'),new Buffer(_0x175c1d[_0x2a56('0x2c')]+':X')['toString'](_0x2a56('0x2d')));}function request(_0xe3f23){logger[_0x2a56('0x2e')](_0x2a56('0x2f'),JSON[_0x2a56('0x30')](_0xe3f23));return rp(_[_0x2a56('0x7')](_0xe3f23,{'method':_0x2a56('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3995e0,_0x333be2){var _0x52f924=[];if(_0x3995e0&&_0x3995e0[_0x2a56('0x1f')]>0x0){_0x52f924=_['map'](_0x3995e0,_0x333be2);}return _0x52f924;}function getCustomFields(_0x38d13d,_0x8aabcc){var _0x57894d=[];var _0x1338fa={'custom_fields':[]};if(_0x38d13d[_0x2a56('0x1f')]>0x0){_[_0x2a56('0x32')](_0x38d13d,function(_0x53c1fa){if(_[_0x2a56('0x33')]([_0x2a56('0x34'),_0x2a56('0x35')],_0x53c1fa[_0x2a56('0x36')])&&_0x53c1fa[_0x2a56('0x37')]&&!_0x53c1fa[_0x2a56('0x38')]){_0x1338fa[_0x53c1fa[_0x2a56('0x37')]['toLowerCase']()]=_0x53c1fa['content'][_0x2a56('0x39')]();}else if(_['includes']([_0x2a56('0x34'),_0x2a56('0x35')],_0x53c1fa[_0x2a56('0x36')])&&_0x53c1fa[_0x2a56('0x3a')]&&_0x53c1fa[_0x2a56('0x38')]){_0x1338fa[_0x2a56('0x18')][_0x2a56('0x3b')]({'id':_0x53c1fa[_0x2a56('0x3a')],'value':_0x53c1fa[_0x2a56('0x3c')][_0x2a56('0x39')]()});}else if(_0x53c1fa[_0x2a56('0x36')]===_0x2a56('0x3d')&&_0x53c1fa['variableName']&&_0x53c1fa[_0x2a56('0x3a')]&&_0x53c1fa[_0x2a56('0x38')]){_0x8aabcc[_0x53c1fa[_0x2a56('0x3e')]]&&_0x1338fa[_0x2a56('0x18')][_0x2a56('0x3b')]({'id':_0x53c1fa[_0x2a56('0x3a')],'value':_0x8aabcc[_0x53c1fa[_0x2a56('0x3e')]]['toString']()});}else if(_0x53c1fa[_0x2a56('0x36')]===_0x2a56('0x3f')&&_0x53c1fa[_0x2a56('0x40')]&&_0x53c1fa['Variable'][_0x2a56('0x41')]&&_0x53c1fa[_0x2a56('0x3a')]&&_0x53c1fa['customField']){_0x8aabcc[_0x53c1fa[_0x2a56('0x40')][_0x2a56('0x41')][_0x2a56('0x42')]()]&&_0x1338fa[_0x2a56('0x18')]['push']({'id':_0x53c1fa[_0x2a56('0x3a')],'value':_0x8aabcc[_0x53c1fa[_0x2a56('0x40')][_0x2a56('0x41')][_0x2a56('0x42')]()][_0x2a56('0x39')]()});}});}return _0x1338fa;}exports[_0x2a56('0x43')]=function(_0x14225a,_0x5da13d,_0x245258,_0x2bd3ed,_0x260244,_0x5cd349){var _0xf13fbd,_0x51fcf5;_0x5cd349['remoteUri']=intUtil[_0x2a56('0x44')](_0x5cd349[_0x2a56('0x1b')]);_0x5cd349[_0x2a56('0x45')]=intUtil[_0x2a56('0x44')](_0x5cd349[_0x2a56('0x45')]);if(_0x260244&&_0x260244['monitor_format']){logger[_0x2a56('0xa')](_0x2a56('0x46'),_0x2a56('0x47'));_0x5da13d[_0x2a56('0x48')]=util['format'](_0x2a56('0x49'),_0x5cd349[_0x2a56('0x45')],_0x5da13d[_0x2a56('0x4a')],md5(_0x5da13d[_0x2a56('0x4a')]));}else{_0x5da13d['recordingURL']='';}headers['Authorization']=getAuth(_0x5cd349);return getUser(_0x5cd349,_0x2bd3ed[_0x2a56('0x22')])[_0x2a56('0x1e')](function(_0x1ad1b3){_0xf13fbd=_0x1ad1b3;logger[_0x2a56('0xa')](_0x2a56('0x4b'),_0xf13fbd['id']);return getEndUser(_0x5cd349,_0x5da13d[_0x2a56('0xf')],_0x5da13d[_0x2a56('0x10')]);})[_0x2a56('0x1e')](function(_0x4919c9){_0x51fcf5=_0x4919c9;logger[_0x2a56('0xa')](_0x2a56('0x4c'),_0x51fcf5['id']);return getTicket(_0x5cd349,_0xf13fbd,_0x51fcf5,_0x245258,_0x5da13d);})[_0x2a56('0x1e')](function(_0x11f10f){if(_0x11f10f&&_0x11f10f['id']){logger[_0x2a56('0xa')](_0x2a56('0x1c'));logger[_0x2a56('0xa')](_0x2a56('0x4d'),_0x11f10f['id']);logger[_0x2a56('0xa')]('[QUEUE]',_0x2a56('0x4e'));emit(util['format']('user:%s',_0x2bd3ed[_0x2a56('0x41')]),_0x2a56('0x4f'),{'uri':util[_0x2a56('0xd')](_0x2a56('0x50'),_0x5cd349[_0x2a56('0x1b')],_0x11f10f['id'])});}})[_0x2a56('0x51')](function(_0x29e57c){logger[_0x2a56('0x52')]('[QUEUE]',JSON[_0x2a56('0x30')](_0x29e57c));});};exports['outbound']=function(_0x39fced,_0x2b87de,_0x15a52c,_0x12ae49,_0x4d9b10,_0x8b3c69,_0x6c4de4){var _0x1ea079,_0x290b0f;_0x8b3c69[_0x2a56('0x1b')]=intUtil[_0x2a56('0x44')](_0x8b3c69['remoteUri']);_0x8b3c69[_0x2a56('0x45')]=intUtil[_0x2a56('0x44')](_0x8b3c69[_0x2a56('0x45')]);if(_0x6c4de4&&_0x6c4de4['recordingFormat']&&_0x6c4de4['recordingFormat']!==_0x2a56('0x53')){logger[_0x2a56('0xa')](_0x2a56('0x54'),_0x2a56('0x47'));_0x2b87de[_0x2a56('0x48')]=util[_0x2a56('0xd')](_0x2a56('0x49'),_0x8b3c69['serverUrl'],_0x2b87de['uniqueid'],md5(_0x2b87de[_0x2a56('0x4a')]));}headers[_0x2a56('0x55')]=getAuth(_0x8b3c69);return getUser(_0x8b3c69,_0x12ae49[_0x2a56('0x22')])[_0x2a56('0x1e')](function(_0x3ee9b8){_0x1ea079=_0x3ee9b8;logger[_0x2a56('0xa')]('The\x20User\x20ID\x20is:',_0x1ea079['id']);return getEndUser(_0x8b3c69,_0x2b87de[_0x2a56('0x56')],_0x2b87de[_0x2a56('0x57')]);})[_0x2a56('0x1e')](function(_0x3d6779){_0x290b0f=_0x3d6779;logger[_0x2a56('0xa')]('The\x20Enduser\x20ID\x20is:',_0x290b0f['id']);return getTicket(_0x8b3c69,_0x1ea079,_0x290b0f,_0x15a52c,_0x2b87de);})[_0x2a56('0x1e')](function(_0xe1b5c5){if(_0xe1b5c5&&_0xe1b5c5['id']){logger[_0x2a56('0xa')]('Ticket\x20created!');logger[_0x2a56('0xa')]('The\x20Ticket\x20ID\x20is:',_0xe1b5c5['id']);logger[_0x2a56('0xa')]('[OUTBOUND]',_0x2a56('0x4e'));emit(util[_0x2a56('0xd')](_0x2a56('0x58'),_0x12ae49['name']),_0x2a56('0x4f'),{'uri':util[_0x2a56('0xd')](_0x2a56('0x50'),_0x8b3c69[_0x2a56('0x1b')],_0xe1b5c5['id'])});}})[_0x2a56('0x51')](function(_0x2b1554){logger[_0x2a56('0x52')]('[OUTBOUND]',JSON[_0x2a56('0x30')](_0x2b1554));});};exports[_0x2a56('0x59')]=function(_0x5b4e66,_0x2306b9,_0xc4fc3c,_0x51dad3,_0x3d77d8,_0x4bb705){var _0x3f4894,_0x2ab30f;_0x4bb705[_0x2a56('0x1b')]=intUtil['stripTrailingSlash'](_0x4bb705[_0x2a56('0x1b')]);_0x4bb705[_0x2a56('0x45')]=intUtil[_0x2a56('0x44')](_0x4bb705[_0x2a56('0x45')]);if(_0x3d77d8&&_0x3d77d8[_0x2a56('0x5a')]){logger['info']('['+_0x2306b9['lastevent']['toUpperCase']()+']',_0x2a56('0x47'));_0x2306b9[_0x2a56('0x48')]=util[_0x2a56('0xd')](_0x2a56('0x49'),_0x4bb705['serverUrl'],_0x2306b9[_0x2a56('0x4a')],md5(_0x2306b9[_0x2a56('0x4a')]));}else{_0x2306b9[_0x2a56('0x48')]='';}headers['Authorization']=getAuth(_0x4bb705);return getUser(_0x4bb705,'')[_0x2a56('0x1e')](function(_0x2e70d5){_0x3f4894=_0x2e70d5;logger[_0x2a56('0xa')](_0x2a56('0x4b'),_0x3f4894['id']);return getEndUser(_0x4bb705,_0x2306b9[_0x2a56('0xf')],_0x2306b9[_0x2a56('0x10')]);})[_0x2a56('0x1e')](function(_0x347988){_0x2ab30f=_0x347988;logger[_0x2a56('0xa')](_0x2a56('0x4c'),_0x2ab30f['id']);return getTicket(_0x4bb705,_0x3f4894,_0x2ab30f,_0xc4fc3c,_0x2306b9);})['then'](function(_0x923935){if(_0x923935){logger[_0x2a56('0xa')](_0x2a56('0x1c'));logger[_0x2a56('0xa')]('The\x20Ticket\x20ID\x20is:',_0x923935['id']);}})[_0x2a56('0x51')](function(_0x29acb2){logger[_0x2a56('0x52')]('['+_0x2306b9['lastevent'][_0x2a56('0x5b')]()+']',JSON[_0x2a56('0x30')](_0x29acb2));});}; \ No newline at end of file +var _0x4ab7=['
','Tags','name','Fields','custom_fields','mapValues','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','GET','map','includes','picklist','type','customField','nameField','toLowerCase','content','string','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','stringify','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x4ab7,0xa4));var _0x74ab=function(_0x559a1c,_0x389b77){_0x559a1c=_0x559a1c-0x0;var _0x265590=_0x4ab7[_0x559a1c];return _0x265590;};'use strict';var _=require(_0x74ab('0x0'));var rp=require(_0x74ab('0x1'));var md5=require('md5');var util=require(_0x74ab('0x2'));var Redis=require('ioredis');var intUtil=require(_0x74ab('0x3'));var config=require(_0x74ab('0x4'));var logger=require(_0x74ab('0x5'))(_0x74ab('0x6'));config[_0x74ab('0x7')]=_[_0x74ab('0x8')](config[_0x74ab('0x7')],{'host':_0x74ab('0x9'),'port':0x18eb});var io=require(_0x74ab('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x74ab('0xb'),'Accept':'application/json'};function emit(_0x28a662,_0x4b9ab7,_0x2c27ce){io['to'](_0x28a662)[_0x74ab('0xc')](_0x4b9ab7,_0x2c27ce);}function getTicket(_0x71e371,_0x3d08e2,_0x240a4f,_0x4816b2,_0x286658){logger[_0x74ab('0xd')](_0x74ab('0xe'));var _0x3ab87b=_[_0x74ab('0xf')]({'responder_id':_0x3d08e2['id'],'requester_id':_0x240a4f['id'],'name':util[_0x74ab('0x10')]('Caller\x20-\x20%s',_0x286658['calleridname']),'phone':_0x286658[_0x74ab('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x74ab('0x12')](_0x4816b2[_0x74ab('0x13')],_0x286658,'\x20'),'description':intUtil['getString'](_0x4816b2['Descriptions'],_0x286658,_0x74ab('0x14')),'tags':getTags(_0x4816b2[_0x74ab('0x15')],_0x74ab('0x16'))},getCustomFields(_0x4816b2[_0x74ab('0x17')],_0x286658));_0x3ab87b[_0x74ab('0x18')]=_[_0x74ab('0x19')](_['keyBy'](_0x3ab87b['custom_fields'],'id'),'value');return request({'uri':util[_0x74ab('0x10')](_0x74ab('0x1a'),_0x71e371[_0x74ab('0x1b')]),'method':_0x74ab('0x1c'),'body':_0x3ab87b})[_0x74ab('0x1d')](function(_0x276af5){logger[_0x74ab('0xd')](_0x74ab('0x1e'));return _0x276af5;});}function getUser(_0x3db49e,_0x22a74a){if(intUtil[_0x74ab('0x1f')](_0x22a74a)){return request({'uri':util[_0x74ab('0x10')](_0x74ab('0x20'),_0x3db49e[_0x74ab('0x1b')]),'qs':{'email':_0x22a74a}})[_0x74ab('0x1d')](function(_0xbc56a){if(_0xbc56a[_0x74ab('0x21')]){logger['info'](_0x74ab('0x22'));return _[_0x74ab('0x23')](_0xbc56a,function(_0x4fdc19){return _0x4fdc19[_0x74ab('0x24')][_0x74ab('0x25')]===_0x22a74a;});}else{logger[_0x74ab('0xd')](_0x74ab('0x26'));return request({'uri':util[_0x74ab('0x10')](_0x74ab('0x27'),_0x3db49e[_0x74ab('0x1b')])})[_0x74ab('0x1d')](function(_0x47f09b){logger[_0x74ab('0xd')](_0x74ab('0x28'));return _0x47f09b;});}});}else{logger[_0x74ab('0xd')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x74ab('0x10')]('%s/api/v2/agents/me',_0x3db49e['remoteUri'])})[_0x74ab('0x1d')](function(_0x5336e5){logger[_0x74ab('0xd')](_0x74ab('0x28'));return _0x5336e5;});}}function getEndUser(_0x233e6d,_0x23cc52,_0x28ec3a){logger[_0x74ab('0xd')](_0x74ab('0x29'),_0x28ec3a);return request({'uri':util['format'](_0x74ab('0x2a'),_0x233e6d['remoteUri']),'qs':{'phone':_0x28ec3a}})[_0x74ab('0x1d')](function(_0x5035b5){if(_0x5035b5[_0x74ab('0x21')]){logger[_0x74ab('0xd')]('Enduser\x20found!');return _[_0x74ab('0x23')](_0x5035b5,{'phone':_0x28ec3a});}else{logger[_0x74ab('0xd')](_0x74ab('0x2b'));return request({'uri':util['format'](_0x74ab('0x2a'),_0x233e6d[_0x74ab('0x1b')]),'method':'POST','body':{'name':_0x23cc52,'phone':_0x28ec3a}})['then'](function(_0x1c5114){logger['info']('Enduser\x20created.');return _0x1c5114;});}});}function getAuth(_0x182d79){return util[_0x74ab('0x10')](_0x74ab('0x2c'),new Buffer(_0x182d79[_0x74ab('0x2d')]+':X')[_0x74ab('0x2e')](_0x74ab('0x2f')));}function request(_0x59aeb9){logger['debug']('[HTTP]',JSON['stringify'](_0x59aeb9));return rp(_[_0x74ab('0x8')](_0x59aeb9,{'method':_0x74ab('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x5293f9,_0x3a0378){var _0x5dfa8a=[];if(_0x5293f9&&_0x5293f9[_0x74ab('0x21')]>0x0){_0x5dfa8a=_[_0x74ab('0x31')](_0x5293f9,_0x3a0378);}return _0x5dfa8a;}function getCustomFields(_0x1d13c9,_0x153b69){var _0x2943a7=[];var _0xbe99d9={'custom_fields':[]};if(_0x1d13c9[_0x74ab('0x21')]>0x0){_['forEach'](_0x1d13c9,function(_0x52dda1){if(_[_0x74ab('0x32')](['string',_0x74ab('0x33')],_0x52dda1[_0x74ab('0x34')])&&_0x52dda1['nameField']&&!_0x52dda1[_0x74ab('0x35')]){_0xbe99d9[_0x52dda1[_0x74ab('0x36')][_0x74ab('0x37')]()]=_0x52dda1[_0x74ab('0x38')]['toString']();}else if(_[_0x74ab('0x32')]([_0x74ab('0x39'),_0x74ab('0x33')],_0x52dda1[_0x74ab('0x34')])&&_0x52dda1[_0x74ab('0x3a')]&&_0x52dda1[_0x74ab('0x35')]){_0xbe99d9[_0x74ab('0x18')][_0x74ab('0x3b')]({'id':_0x52dda1[_0x74ab('0x3a')],'value':_0x52dda1[_0x74ab('0x38')][_0x74ab('0x2e')]()});}else if(_0x52dda1['type']===_0x74ab('0x3c')&&_0x52dda1[_0x74ab('0x3d')]&&_0x52dda1[_0x74ab('0x3a')]&&_0x52dda1['customField']){_0x153b69[_0x52dda1[_0x74ab('0x3d')]]&&_0xbe99d9['custom_fields'][_0x74ab('0x3b')]({'id':_0x52dda1[_0x74ab('0x3a')],'value':_0x153b69[_0x52dda1[_0x74ab('0x3d')]][_0x74ab('0x2e')]()});}else if(_0x52dda1[_0x74ab('0x34')]===_0x74ab('0x3e')&&_0x52dda1[_0x74ab('0x3f')]&&_0x52dda1[_0x74ab('0x3f')][_0x74ab('0x16')]&&_0x52dda1['idField']&&_0x52dda1['customField']){_0x153b69[_0x52dda1[_0x74ab('0x3f')][_0x74ab('0x16')][_0x74ab('0x37')]()]&&_0xbe99d9[_0x74ab('0x18')][_0x74ab('0x3b')]({'id':_0x52dda1[_0x74ab('0x3a')],'value':_0x153b69[_0x52dda1[_0x74ab('0x3f')][_0x74ab('0x16')]['toLowerCase']()][_0x74ab('0x2e')]()});}});}return _0xbe99d9;}exports[_0x74ab('0x40')]=function(_0x1c0e68,_0x53010f,_0xe260be,_0x14c79e,_0x5764a1,_0x365bc5){var _0xeeab8a,_0x23d323;_0x365bc5['remoteUri']=intUtil[_0x74ab('0x41')](_0x365bc5['remoteUri']);_0x365bc5[_0x74ab('0x42')]=intUtil['stripTrailingSlash'](_0x365bc5[_0x74ab('0x42')]);if(_0x5764a1&&_0x5764a1[_0x74ab('0x43')]){logger[_0x74ab('0xd')](_0x74ab('0x44'),_0x74ab('0x45'));_0x53010f['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x365bc5['serverUrl'],_0x53010f[_0x74ab('0x46')],md5(_0x53010f['uniqueid']));}else{_0x53010f[_0x74ab('0x47')]='';}headers[_0x74ab('0x48')]=getAuth(_0x365bc5);return getUser(_0x365bc5,_0x14c79e[_0x74ab('0x25')])[_0x74ab('0x1d')](function(_0x3dfca8){_0xeeab8a=_0x3dfca8;logger[_0x74ab('0xd')](_0x74ab('0x49'),_0xeeab8a['id']);return getEndUser(_0x365bc5,_0x53010f[_0x74ab('0x4a')],_0x53010f[_0x74ab('0x11')]);})['then'](function(_0x1938bc){_0x23d323=_0x1938bc;logger[_0x74ab('0xd')](_0x74ab('0x4b'),_0x23d323['id']);return getTicket(_0x365bc5,_0xeeab8a,_0x23d323,_0xe260be,_0x53010f);})['then'](function(_0x44cd46){if(_0x44cd46&&_0x44cd46['id']){logger[_0x74ab('0xd')](_0x74ab('0x1e'));logger[_0x74ab('0xd')](_0x74ab('0x4c'),_0x44cd46['id']);logger['info'](_0x74ab('0x44'),_0x74ab('0x4d'));emit(util[_0x74ab('0x10')](_0x74ab('0x4e'),_0x14c79e['name']),_0x74ab('0x4f'),{'uri':util[_0x74ab('0x10')]('%s/helpdesk/tickets/%d',_0x365bc5[_0x74ab('0x1b')],_0x44cd46['id'])});}})[_0x74ab('0x50')](function(_0x506810){logger[_0x74ab('0x51')]('[QUEUE]',JSON[_0x74ab('0x52')](_0x506810));});};exports[_0x74ab('0x53')]=function(_0x2cb081,_0x26bd55,_0x370ecd,_0x242133,_0x352eeb,_0x2d4f19,_0x4cc6d7){var _0x125eeb,_0x316278;_0x2d4f19[_0x74ab('0x1b')]=intUtil['stripTrailingSlash'](_0x2d4f19['remoteUri']);_0x2d4f19[_0x74ab('0x42')]=intUtil[_0x74ab('0x41')](_0x2d4f19[_0x74ab('0x42')]);if(_0x4cc6d7&&_0x4cc6d7[_0x74ab('0x54')]&&_0x4cc6d7[_0x74ab('0x54')]!=='none'){logger[_0x74ab('0xd')](_0x74ab('0x55'),_0x74ab('0x45'));_0x26bd55[_0x74ab('0x47')]=util[_0x74ab('0x10')](_0x74ab('0x56'),_0x2d4f19['serverUrl'],_0x26bd55[_0x74ab('0x46')],md5(_0x26bd55[_0x74ab('0x46')]));}headers[_0x74ab('0x48')]=getAuth(_0x2d4f19);return getUser(_0x2d4f19,_0x242133[_0x74ab('0x25')])['then'](function(_0x31d878){_0x125eeb=_0x31d878;logger[_0x74ab('0xd')](_0x74ab('0x49'),_0x125eeb['id']);return getEndUser(_0x2d4f19,_0x26bd55['destcalleridname'],_0x26bd55[_0x74ab('0x57')]);})[_0x74ab('0x1d')](function(_0x546f78){_0x316278=_0x546f78;logger['info'](_0x74ab('0x4b'),_0x316278['id']);return getTicket(_0x2d4f19,_0x125eeb,_0x316278,_0x370ecd,_0x26bd55);})[_0x74ab('0x1d')](function(_0x26c368){if(_0x26c368&&_0x26c368['id']){logger[_0x74ab('0xd')](_0x74ab('0x1e'));logger[_0x74ab('0xd')](_0x74ab('0x4c'),_0x26c368['id']);logger[_0x74ab('0xd')](_0x74ab('0x55'),_0x74ab('0x4d'));emit(util[_0x74ab('0x10')](_0x74ab('0x4e'),_0x242133[_0x74ab('0x16')]),_0x74ab('0x4f'),{'uri':util[_0x74ab('0x10')](_0x74ab('0x58'),_0x2d4f19[_0x74ab('0x1b')],_0x26c368['id'])});}})[_0x74ab('0x50')](function(_0x256215){logger['error'](_0x74ab('0x55'),JSON[_0x74ab('0x52')](_0x256215));});};exports[_0x74ab('0x59')]=function(_0x120faf,_0x1c11ba,_0x338144,_0x5440d8,_0x3e99fa,_0x18de99){var _0x36e0e0,_0x4d3517;_0x18de99[_0x74ab('0x1b')]=intUtil[_0x74ab('0x41')](_0x18de99[_0x74ab('0x1b')]);_0x18de99[_0x74ab('0x42')]=intUtil['stripTrailingSlash'](_0x18de99[_0x74ab('0x42')]);if(_0x3e99fa&&_0x3e99fa[_0x74ab('0x43')]){logger[_0x74ab('0xd')]('['+_0x1c11ba[_0x74ab('0x5a')][_0x74ab('0x5b')]()+']',_0x74ab('0x45'));_0x1c11ba[_0x74ab('0x47')]=util[_0x74ab('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18de99[_0x74ab('0x42')],_0x1c11ba[_0x74ab('0x46')],md5(_0x1c11ba[_0x74ab('0x46')]));}else{_0x1c11ba[_0x74ab('0x47')]='';}headers[_0x74ab('0x48')]=getAuth(_0x18de99);return getUser(_0x18de99,'')[_0x74ab('0x1d')](function(_0x364897){_0x36e0e0=_0x364897;logger['info'](_0x74ab('0x49'),_0x36e0e0['id']);return getEndUser(_0x18de99,_0x1c11ba['calleridname'],_0x1c11ba[_0x74ab('0x11')]);})[_0x74ab('0x1d')](function(_0x2535e1){_0x4d3517=_0x2535e1;logger[_0x74ab('0xd')](_0x74ab('0x4b'),_0x4d3517['id']);return getTicket(_0x18de99,_0x36e0e0,_0x4d3517,_0x338144,_0x1c11ba);})[_0x74ab('0x1d')](function(_0x2ce7cb){if(_0x2ce7cb){logger[_0x74ab('0xd')]('Ticket\x20created!');logger['info'](_0x74ab('0x4c'),_0x2ce7cb['id']);}})['catch'](function(_0xd6d7aa){logger[_0x74ab('0x51')]('['+_0x1c11ba[_0x74ab('0x5a')][_0x74ab('0x5b')]()+']',JSON['stringify'](_0xd6d7aa));});}; \ 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 ab3baea..b1d84ba 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 _0x9bcc=['getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','adminEmail','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','bluebird','./util','../../../../config/environment','freshsales','redis','GET','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','catch','error','message','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks'];(function(_0x26ac27,_0x574b86){var _0x44a599=function(_0x130e2c){while(--_0x130e2c){_0x26ac27['push'](_0x26ac27['shift']());}};_0x44a599(++_0x574b86);}(_0x9bcc,0xd2));var _0xc9bc=function(_0x26c2f3,_0x424805){_0x26c2f3=_0x26c2f3-0x0;var _0x2fa8bd=_0x9bcc[_0x26c2f3];return _0x2fa8bd;};'use strict';var _=require(_0xc9bc('0x0'));var rp=require('request-promise');var md5=require(_0xc9bc('0x1'));var util=require(_0xc9bc('0x2'));var moment=require('moment');var Promise=require(_0xc9bc('0x3'));var Redis=require('ioredis');var intUtil=require(_0xc9bc('0x4'));var config=require(_0xc9bc('0x5'));var logger=require('../../../../config/logger')(_0xc9bc('0x6'));config[_0xc9bc('0x7')]=_['defaults'](config[_0xc9bc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc9bc('0x7')]));function getAdminId(_0x566e7a,_0x58ad28,_0x57b900,_0x4aee9f){return new Promise(function(_0x3cc971,_0x415104){var _0xc7cd1d=![];var _0x355a9f={'method':_0xc9bc('0x8'),'uri':_0x4aee9f+'/api/selector/owners','json':!![]};_0x355a9f[_0xc9bc('0x9')]=_0x57b900;logger[_0xc9bc('0xa')](_0xc9bc('0xb'));return rp(_0x355a9f)[_0xc9bc('0xc')](function(_0x241f97){if(_0x241f97){var _0x41343d=_0x241f97[_0xc9bc('0xd')];var _0x2615c7=null;for(_0x2615c7=0x0;_0x2615c7<_0x41343d[_0xc9bc('0xe')];_0x2615c7++){if(_0x41343d[_0x2615c7][_0xc9bc('0xf')]===_0x566e7a['adminEmail']){_0x566e7a[_0xc9bc('0x10')]=_0x41343d[_0x2615c7]['id'];_0xc7cd1d=!![];}}if(_0xc7cd1d){logger['info'](_0xc9bc('0x11'),_0x566e7a[_0xc9bc('0x10')]);_0x3cc971(_0x566e7a);}else{_0x415104({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x415104({'statusCode':0x194,'message':_0xc9bc('0x12')});}})['catch'](function(_0x5e3fd6){logger['error']('['+[_0x58ad28[_0xc9bc('0x13')]()]+']',_0x5e3fd6['message']);_0x415104(_0x5e3fd6);});});}function getUser(_0x30aad9,_0x5110c9,_0x4a5b39){return function(_0x5c087b){return new Promise(function(_0xffcd0c,_0x2bfc3a){var _0x25d449={'method':'GET','uri':_0x4a5b39+_0xc9bc('0x14'),'json':!![]};_0x25d449[_0xc9bc('0x9')]=_0x5110c9;logger[_0xc9bc('0xa')](_0xc9bc('0x15'));return rp(_0x25d449)[_0xc9bc('0xc')](function(_0x4f9de6){if(_0x4f9de6){var _0x26ca60=_0x4f9de6['users'];var _0x7ff3be=![];var _0x41d3e3=null;if(_0x5c087b[_0xc9bc('0x16')]!==null){logger[_0xc9bc('0xa')](_0xc9bc('0x17'),_0x5c087b['agentEmail']);_0x5c087b[_0xc9bc('0x18')]=_0x5c087b['agentEmail'];for(_0x41d3e3=0x0;_0x41d3e3<_0x26ca60[_0xc9bc('0xe')];_0x41d3e3++){if(_0x26ca60[_0x41d3e3][_0xc9bc('0xf')]===_0x5c087b[_0xc9bc('0x16')]){_0x7ff3be=!![];_0x5c087b[_0xc9bc('0x19')]=_0x26ca60[_0x41d3e3]['id'];logger['info'](_0xc9bc('0x1a'),_0x5c087b[_0xc9bc('0x19')]);}}}if(!_0x7ff3be){logger[_0xc9bc('0xa')](_0xc9bc('0x1b'));_0x5c087b[_0xc9bc('0x18')]=_0x5c087b['adminEmail'];_0x5c087b[_0xc9bc('0x19')]=_0x5c087b[_0xc9bc('0x10')];_0x7ff3be=!![];}if(_0x7ff3be){_0xffcd0c(_0x5c087b);}else{_0x2bfc3a({'statusCode':0x194,'message':_0xc9bc('0x12')});}}else{_0x2bfc3a({'statusCode':0x194,'message':_0xc9bc('0x12')});}})[_0xc9bc('0x1c')](function(_0x5305ea){logger[_0xc9bc('0x1d')]('['+[_0x30aad9[_0xc9bc('0x13')]()]+']',_0x5305ea[_0xc9bc('0x1e')]);_0x2bfc3a(_0x5305ea);});});};}function searchContact(_0x50dd0c,_0x264f09,_0x6cfd45,_0x46208a){return new Promise(function(_0x324c87,_0x8ded5f){var _0x58f590={'method':_0xc9bc('0x8'),'headers':_0x264f09,'uri':_0x50dd0c+_0xc9bc('0x1f')+_0x46208a+'&f='+_0x6cfd45+'&entities=contact','json':!![]};rp(_0x58f590)['then'](function(_0x24c5e4){var _0x17bd3c=_[_0xc9bc('0x20')](_0x24c5e4[_0xc9bc('0x21')][_0xc9bc('0x21')],[_0x6cfd45,_0x46208a]);_0x324c87(_0x17bd3c);})[_0xc9bc('0x1c')](function(_0x5bed66){_0x8ded5f(_0x5bed66);});});}function getEndUser(_0x77ca05,_0x24020c,_0x21c50a){return function(_0x58c74c){return new Promise(function(_0x4c5dff,_0x2e6965){logger[_0xc9bc('0xa')](util[_0xc9bc('0x22')](_0xc9bc('0x23'),_0x58c74c[_0xc9bc('0x24')]));searchContact(_0x21c50a,_0x24020c,_0xc9bc('0x25'),_0x58c74c[_0xc9bc('0x24')])[_0xc9bc('0xc')](function(_0x255c4d){if(_0x255c4d){_0x58c74c[_0xc9bc('0x26')]=_0x255c4d['id'];logger['info'](_0xc9bc('0x27'),_0x58c74c[_0xc9bc('0x26')]);return _0x4c5dff(_0x58c74c);}searchContact(_0x21c50a,_0x24020c,_0xc9bc('0x28'),_0x58c74c[_0xc9bc('0x24')])[_0xc9bc('0xc')](function(_0x499cd0){if(_0x499cd0){_0x58c74c[_0xc9bc('0x26')]=_0x499cd0['id'];logger['info'](_0xc9bc('0x29'),_0x58c74c[_0xc9bc('0x26')]);return _0x4c5dff(_0x58c74c);}createEndUser(_0x58c74c,_0x77ca05,_0x24020c,_0x21c50a)[_0xc9bc('0xc')](function(_0x2b6c4f){logger[_0xc9bc('0xa')]('Contact\x20created:',_0x2b6c4f['endUserId']);return _0x4c5dff(_0x2b6c4f);});});})[_0xc9bc('0x1c')](function(_0x179c53){_0x2e6965(_0x179c53);});});};}function createEndUser(_0x3841ac,_0xfcb7de,_0x5e5b04,_0xee1b73){return new Promise(function(_0x46f7ec,_0x2e03eb){var _0x4d7515=moment();var _0x404a32={'method':_0xc9bc('0x2a'),'uri':_0xee1b73+_0xc9bc('0x2b'),'body':{'contact':{'last_name':_0x3841ac['contactNumber'],'work_number':_0x3841ac['contactNumber'],'mobile_number':_0x3841ac['contactNumber'],'owner_id':_0x3841ac[_0xc9bc('0x19')],'created_at':_0x4d7515[_0xc9bc('0x22')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x404a32[_0xc9bc('0x9')]=_0x5e5b04;logger['info'](_0xc9bc('0x2c'));return rp(_0x404a32)[_0xc9bc('0xc')](function(_0x1bfdbf){_0x3841ac['endUserId']=_0x1bfdbf[_0xc9bc('0x2d')]['id'];_0x46f7ec(_0x3841ac);})[_0xc9bc('0x1c')](function(_0x4b1371){logger['error']('['+[_0xfcb7de['toUpperCase']()]+']',_0x4b1371[_0xc9bc('0x1e')]);_0x2e03eb(_0x4b1371[_0xc9bc('0x1e')]);});});}function getTicket(_0x30072f,_0x277e20,_0xd9e461,_0x42370c,_0x343235){return function(_0x435e34){logger[_0xc9bc('0xa')](_0xc9bc('0x2e'));return new Promise(function(_0x150c78,_0x1dfec4){var _0x359aee=moment();var _0x850487={'method':'POST','uri':_0xd9e461+_0xc9bc('0x2f'),'body':{'title':intUtil['getString'](_0x42370c['Subjects'],_0x343235,'\x20'),'description':intUtil[_0xc9bc('0x30')](_0x42370c[_0xc9bc('0x31')],_0x343235,'\x0a'),'owner_id':_0x435e34[_0xc9bc('0x19')],'creater_id':_0x435e34[_0xc9bc('0x10')],'targetable_id':_0x435e34[_0xc9bc('0x26')],'targetable_type':_0xc9bc('0x32'),'created_at':_0x359aee[_0xc9bc('0x22')](_0xc9bc('0x33')),'due_date':_0x359aee[_0xc9bc('0x34')](0x1e,'m')[_0xc9bc('0x22')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x850487[_0xc9bc('0x9')]=_0x277e20;return rp(_0x850487)[_0xc9bc('0xc')](function(_0xb96d02){_0x435e34['ticketId']=_0xb96d02[_0xc9bc('0x35')]['id'];logger[_0xc9bc('0xa')](_0xc9bc('0x36'),_0x435e34[_0xc9bc('0x37')]);_0x150c78(_0x435e34);})['catch'](function(_0x4560ef){logger[_0xc9bc('0x1d')]('['+[_0x30072f['toUpperCase']()]+']',_0x4560ef[_0xc9bc('0x1e')]);_0x1dfec4(_0x4560ef[_0xc9bc('0x1e')]);});});};}function emit(_0x397c05,_0x32400a,_0x4053d6){var _0x2ad1e8={'uri':_0x397c05+_0xc9bc('0x38')+_0x4053d6};io['to'](util[_0xc9bc('0x22')](_0xc9bc('0x39'),_0x32400a))[_0xc9bc('0x3a')](_0xc9bc('0x3b'),_0x2ad1e8);}exports['cs']=function(_0x1fb0d8,_0x3caec0,_0x4a79e7,_0x2f8f35,_0x20788a,_0x14c331,_0xa4f095,_0x1ac7d1){var _0x3d85fc={};var _0x4d1998={'Authorization':_0xc9bc('0x3c')+_0x14c331[_0xc9bc('0x3d')]};_0x14c331['remoteUri']=intUtil[_0xc9bc('0x3e')](_0x14c331[_0xc9bc('0x3f')]);_0x14c331[_0xc9bc('0x40')]=intUtil['stripTrailingSlash'](_0x14c331['serverUrl']);var _0x5d639e=_0x14c331[_0xc9bc('0x3f')];_0x3d85fc[_0xc9bc('0x41')]=_0x14c331[_0xc9bc('0x42')];_0x3d85fc[_0xc9bc('0x24')]=_0x1ac7d1['toLowerCase']()===_0xc9bc('0x43')?_0x3caec0[_0xc9bc('0x44')]:_0x3caec0[_0xc9bc('0x45')];_0x3d85fc[_0xc9bc('0x46')]=_0x1ac7d1===_0xc9bc('0x47')||_0x1ac7d1===_0xc9bc('0x48')?'queue':'outbound';if(_0x2f8f35){_0x3d85fc[_0xc9bc('0x16')]=_0x2f8f35[_0xc9bc('0xf')];}var _0x4d6d62=util[_0xc9bc('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x14c331[_0xc9bc('0x40')],_0x3caec0[_0xc9bc('0x49')],md5(_0x3caec0[_0xc9bc('0x49')]));if(_0x20788a&&_0x20788a[_0xc9bc('0x4a')]){logger[_0xc9bc('0xa')](_0xc9bc('0x4b'),_0xc9bc('0x4c'));_0x3caec0[_0xc9bc('0x4d')]=_0x4d6d62;}else if(_0xa4f095&&_0xa4f095[_0xc9bc('0x4e')]&&_0xa4f095[_0xc9bc('0x4e')]!==_0xc9bc('0x4f')){logger[_0xc9bc('0xa')](_0xc9bc('0x50'),_0xc9bc('0x4c'));_0x3caec0[_0xc9bc('0x4d')]=_0x4d6d62;}else{_0x3caec0[_0xc9bc('0x4d')]='';}return getAdminId(_0x3d85fc,_0x1ac7d1,_0x4d1998,_0x5d639e)[_0xc9bc('0xc')](getUser(_0x1ac7d1,_0x4d1998,_0x5d639e))[_0xc9bc('0xc')](getEndUser(_0x1ac7d1,_0x4d1998,_0x5d639e))[_0xc9bc('0xc')](getTicket(_0x1ac7d1,_0x4d1998,_0x5d639e,_0x4a79e7,_0x3caec0))['then'](function(_0x1b5b2a){logger[_0xc9bc('0xa')](util[_0xc9bc('0x22')](_0xc9bc('0x51'),_0x1b5b2a['ticketId']));if(_0x1ac7d1!=='unmanaged'){logger['info']('['+[_0x1ac7d1[_0xc9bc('0x13')]()]+']',_0xc9bc('0x52'));emit(_0x5d639e,_0x2f8f35[_0xc9bc('0x53')],_0x1b5b2a[_0xc9bc('0x26')]);}})['catch'](function(_0x509293){logger[_0xc9bc('0x1d')]('['+[_0x1ac7d1[_0xc9bc('0x13')]()]+_0xc9bc('0x54'),util[_0xc9bc('0x55')](_0x509293,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfba3=['trigger:browser:url','Token\x20token=','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','users','length','adminEmail','adminId','info','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','then','agentEmail','userEmail','email','User\x20found:','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','userId','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Contact','format','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit'];(function(_0x73874d,_0x45490e){var _0x55dbd4=function(_0x50f2ff){while(--_0x50f2ff){_0x73874d['push'](_0x73874d['shift']());}};_0x55dbd4(++_0x45490e);}(_0xfba3,0x11d));var _0x3fba=function(_0x2d9dd7,_0x268fd1){_0x2d9dd7=_0x2d9dd7-0x0;var _0x3775b9=_0xfba3[_0x2d9dd7];return _0x3775b9;};'use strict';var _=require(_0x3fba('0x0'));var rp=require(_0x3fba('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0x3fba('0x2'));var Promise=require(_0x3fba('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3fba('0x4'));var config=require(_0x3fba('0x5'));var logger=require(_0x3fba('0x6'))(_0x3fba('0x7'));config[_0x3fba('0x8')]=_[_0x3fba('0x9')](config[_0x3fba('0x8')],{'host':_0x3fba('0xa'),'port':0x18eb});var io=require(_0x3fba('0xb'))(new Redis(config[_0x3fba('0x8')]));function getAdminId(_0x3ec86f,_0x5a1502,_0x225aad,_0x1bcbf2){return new Promise(function(_0x45ce0d,_0x2ea7ff){var _0x12a890=![];var _0xa4dcce={'method':_0x3fba('0xc'),'uri':_0x1bcbf2+_0x3fba('0xd'),'json':!![]};_0xa4dcce['headers']=_0x225aad;logger['info'](_0x3fba('0xe'));return rp(_0xa4dcce)['then'](function(_0x4f093d){if(_0x4f093d){var _0x5da699=_0x4f093d[_0x3fba('0xf')];var _0x2de826=null;for(_0x2de826=0x0;_0x2de826<_0x5da699[_0x3fba('0x10')];_0x2de826++){if(_0x5da699[_0x2de826]['email']===_0x3ec86f[_0x3fba('0x11')]){_0x3ec86f[_0x3fba('0x12')]=_0x5da699[_0x2de826]['id'];_0x12a890=!![];}}if(_0x12a890){logger[_0x3fba('0x13')]('Admin\x20found:',_0x3ec86f['adminId']);_0x45ce0d(_0x3ec86f);}else{_0x2ea7ff({'statusCode':0x194,'message':_0x3fba('0x14')});}}else{_0x2ea7ff({'statusCode':0x194,'message':_0x3fba('0x14')});}})[_0x3fba('0x15')](function(_0xaf00ae){logger['error']('['+[_0x5a1502[_0x3fba('0x16')]()]+']',_0xaf00ae[_0x3fba('0x17')]);_0x2ea7ff(_0xaf00ae);});});}function getUser(_0x572c6a,_0x4908ae,_0xc2dafb){return function(_0x27fc69){return new Promise(function(_0x2e0f45,_0x319966){var _0x2c4ece={'method':'GET','uri':_0xc2dafb+_0x3fba('0xd'),'json':!![]};_0x2c4ece['headers']=_0x4908ae;logger[_0x3fba('0x13')]('Getting\x20user\x20list');return rp(_0x2c4ece)[_0x3fba('0x18')](function(_0x1f94c2){if(_0x1f94c2){var _0x243bc5=_0x1f94c2[_0x3fba('0xf')];var _0x12c830=![];var _0x4810c1=null;if(_0x27fc69[_0x3fba('0x19')]!==null){logger[_0x3fba('0x13')]('Getting\x20user\x20with\x20email',_0x27fc69['agentEmail']);_0x27fc69[_0x3fba('0x1a')]=_0x27fc69[_0x3fba('0x19')];for(_0x4810c1=0x0;_0x4810c1<_0x243bc5[_0x3fba('0x10')];_0x4810c1++){if(_0x243bc5[_0x4810c1][_0x3fba('0x1b')]===_0x27fc69[_0x3fba('0x19')]){_0x12c830=!![];_0x27fc69['userId']=_0x243bc5[_0x4810c1]['id'];logger['info'](_0x3fba('0x1c'),_0x27fc69['userId']);}}}if(!_0x12c830){logger[_0x3fba('0x13')](_0x3fba('0x1d'));_0x27fc69[_0x3fba('0x1a')]=_0x27fc69['adminEmail'];_0x27fc69['userId']=_0x27fc69[_0x3fba('0x12')];_0x12c830=!![];}if(_0x12c830){_0x2e0f45(_0x27fc69);}else{_0x319966({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x319966({'statusCode':0x194,'message':_0x3fba('0x14')});}})['catch'](function(_0x19b4ed){logger[_0x3fba('0x1e')]('['+[_0x572c6a['toUpperCase']()]+']',_0x19b4ed['message']);_0x319966(_0x19b4ed);});});};}function searchContact(_0x3292e5,_0x1d9068,_0x2b792a,_0x3f5358){return new Promise(function(_0x386a23,_0x3198f8){var _0x4f5c9a={'method':'GET','headers':_0x1d9068,'uri':_0x3292e5+_0x3fba('0x1f')+_0x3f5358+_0x3fba('0x20')+_0x2b792a+_0x3fba('0x21'),'json':!![]};rp(_0x4f5c9a)[_0x3fba('0x18')](function(_0x8bd831){var _0x593fa8=_[_0x3fba('0x22')](_0x8bd831['contacts'][_0x3fba('0x23')],[_0x2b792a,_0x3f5358]);_0x386a23(_0x593fa8);})[_0x3fba('0x15')](function(_0x20e99d){_0x3198f8(_0x20e99d);});});}function getEndUser(_0x568c9b,_0x5bad3a,_0x58cbf5){return function(_0x3d38e4){return new Promise(function(_0x83da3,_0x208187){logger['info'](util['format'](_0x3fba('0x24'),_0x3d38e4['contactNumber']));searchContact(_0x58cbf5,_0x5bad3a,_0x3fba('0x25'),_0x3d38e4['contactNumber'])[_0x3fba('0x18')](function(_0x2a4a4b){if(_0x2a4a4b){_0x3d38e4[_0x3fba('0x26')]=_0x2a4a4b['id'];logger[_0x3fba('0x13')](_0x3fba('0x27'),_0x3d38e4['endUserId']);return _0x83da3(_0x3d38e4);}searchContact(_0x58cbf5,_0x5bad3a,_0x3fba('0x28'),_0x3d38e4[_0x3fba('0x29')])[_0x3fba('0x18')](function(_0x33bc16){if(_0x33bc16){_0x3d38e4[_0x3fba('0x26')]=_0x33bc16['id'];logger[_0x3fba('0x13')](_0x3fba('0x2a'),_0x3d38e4['endUserId']);return _0x83da3(_0x3d38e4);}createEndUser(_0x3d38e4,_0x568c9b,_0x5bad3a,_0x58cbf5)['then'](function(_0x1dfea5){logger[_0x3fba('0x13')](_0x3fba('0x2b'),_0x1dfea5[_0x3fba('0x26')]);return _0x83da3(_0x1dfea5);});});})[_0x3fba('0x15')](function(_0x3f6654){_0x208187(_0x3f6654);});});};}function createEndUser(_0x290e80,_0x5813d9,_0x36418d,_0x1ab526){return new Promise(function(_0x2df4a6,_0x634e12){var _0x51d9f5=moment();var _0xfdd7e5={'method':_0x3fba('0x2c'),'uri':_0x1ab526+_0x3fba('0x2d'),'body':{'contact':{'last_name':_0x290e80[_0x3fba('0x29')],'work_number':_0x290e80[_0x3fba('0x29')],'mobile_number':_0x290e80['contactNumber'],'owner_id':_0x290e80[_0x3fba('0x2e')],'created_at':_0x51d9f5['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0xfdd7e5[_0x3fba('0x2f')]=_0x36418d;logger[_0x3fba('0x13')](_0x3fba('0x30'));return rp(_0xfdd7e5)['then'](function(_0x838464){_0x290e80[_0x3fba('0x26')]=_0x838464[_0x3fba('0x31')]['id'];_0x2df4a6(_0x290e80);})['catch'](function(_0xec776e){logger[_0x3fba('0x1e')]('['+[_0x5813d9[_0x3fba('0x16')]()]+']',_0xec776e[_0x3fba('0x17')]);_0x634e12(_0xec776e['message']);});});}function getTicket(_0x10df88,_0x1f6819,_0x129aa3,_0x48e4e9,_0x5128c9){return function(_0x49723e){logger['info'](_0x3fba('0x32'));return new Promise(function(_0x7087f,_0x5bef95){var _0x534465=moment();var _0x2cb51d={'method':_0x3fba('0x2c'),'uri':_0x129aa3+'/api/tasks','body':{'title':intUtil[_0x3fba('0x33')](_0x48e4e9[_0x3fba('0x34')],_0x5128c9,'\x20'),'description':intUtil[_0x3fba('0x33')](_0x48e4e9['Descriptions'],_0x5128c9,'\x0a'),'owner_id':_0x49723e[_0x3fba('0x2e')],'creater_id':_0x49723e[_0x3fba('0x12')],'targetable_id':_0x49723e['endUserId'],'targetable_type':_0x3fba('0x35'),'created_at':_0x534465[_0x3fba('0x36')](_0x3fba('0x37')),'due_date':_0x534465[_0x3fba('0x38')](0x1e,'m')[_0x3fba('0x36')](_0x3fba('0x37'))},'json':!![]};_0x2cb51d['headers']=_0x1f6819;return rp(_0x2cb51d)['then'](function(_0x5c390a){_0x49723e[_0x3fba('0x39')]=_0x5c390a[_0x3fba('0x3a')]['id'];logger['info'](_0x3fba('0x3b'),_0x49723e[_0x3fba('0x39')]);_0x7087f(_0x49723e);})[_0x3fba('0x15')](function(_0x445fa4){logger[_0x3fba('0x1e')]('['+[_0x10df88['toUpperCase']()]+']',_0x445fa4['message']);_0x5bef95(_0x445fa4['message']);});});};}function emit(_0x9a3881,_0x219419,_0x222ab9){var _0x2b61fd={'uri':_0x9a3881+_0x3fba('0x3c')+_0x222ab9};io['to'](util[_0x3fba('0x36')](_0x3fba('0x3d'),_0x219419))[_0x3fba('0x3e')](_0x3fba('0x3f'),_0x2b61fd);}exports['cs']=function(_0x2d0514,_0x137ea8,_0x103489,_0x2680ad,_0x5e6041,_0x3903df,_0x50b829,_0x59b282){var _0x146f97={};var _0x335409={'Authorization':_0x3fba('0x40')+_0x3903df['apiKey']};_0x3903df['remoteUri']=intUtil[_0x3fba('0x41')](_0x3903df['remoteUri']);_0x3903df[_0x3fba('0x42')]=intUtil['stripTrailingSlash'](_0x3903df[_0x3fba('0x42')]);var _0x1ff16d=_0x3903df[_0x3fba('0x43')];_0x146f97['adminEmail']=_0x3903df[_0x3fba('0x44')];_0x146f97[_0x3fba('0x29')]=_0x59b282[_0x3fba('0x45')]()===_0x3fba('0x46')?_0x137ea8[_0x3fba('0x47')]:_0x137ea8[_0x3fba('0x48')];_0x146f97[_0x3fba('0x49')]=_0x59b282===_0x3fba('0x4a')||_0x59b282===_0x3fba('0x4b')?_0x3fba('0x4a'):'outbound';if(_0x2680ad){_0x146f97['agentEmail']=_0x2680ad[_0x3fba('0x1b')];}var _0x22c004=util[_0x3fba('0x36')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3903df[_0x3fba('0x42')],_0x137ea8[_0x3fba('0x4c')],md5(_0x137ea8[_0x3fba('0x4c')]));if(_0x5e6041&&_0x5e6041[_0x3fba('0x4d')]){logger['info'](_0x3fba('0x4e'),'Recording\x20is\x20enabled!');_0x137ea8[_0x3fba('0x4f')]=_0x22c004;}else if(_0x50b829&&_0x50b829[_0x3fba('0x50')]&&_0x50b829[_0x3fba('0x50')]!==_0x3fba('0x51')){logger[_0x3fba('0x13')]('[OUTBOUND]',_0x3fba('0x52'));_0x137ea8[_0x3fba('0x4f')]=_0x22c004;}else{_0x137ea8[_0x3fba('0x4f')]='';}return getAdminId(_0x146f97,_0x59b282,_0x335409,_0x1ff16d)[_0x3fba('0x18')](getUser(_0x59b282,_0x335409,_0x1ff16d))[_0x3fba('0x18')](getEndUser(_0x59b282,_0x335409,_0x1ff16d))[_0x3fba('0x18')](getTicket(_0x59b282,_0x335409,_0x1ff16d,_0x103489,_0x137ea8))[_0x3fba('0x18')](function(_0x21c5f9){logger[_0x3fba('0x13')](util[_0x3fba('0x36')](_0x3fba('0x53'),_0x21c5f9[_0x3fba('0x39')]));if(_0x59b282!=='unmanaged'){logger['info']('['+[_0x59b282['toUpperCase']()]+']',_0x3fba('0x54'));emit(_0x1ff16d,_0x2680ad[_0x3fba('0x55')],_0x21c5f9[_0x3fba('0x26')]);}})['catch'](function(_0x5914c4){logger[_0x3fba('0x1e')]('['+[_0x59b282['toUpperCase']()]+_0x3fba('0x56'),util['inspect'](_0x5914c4,{'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 36d96be..a2198e0 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 _0x314c=['data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','freshdesk','log','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations'];(function(_0x4188bf,_0x393bd1){var _0x42de76=function(_0x563091){while(--_0x563091){_0x4188bf['push'](_0x4188bf['shift']());}};_0x42de76(++_0x393bd1);}(_0x314c,0x17f));var _0xc314=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x314c[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0xc314('0x0'));var util=require(_0xc314('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xc314('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xc314('0x3'));var zoho=require(_0xc314('0x4'));var desk=require(_0xc314('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xc314('0x6'));var dynamics365=require(_0xc314('0x7'));var freshsales=require(_0xc314('0x8'));var integrations=['zendesk',_0xc314('0x9'),_0xc314('0xa'),'freshdesk',_0xc314('0xb'),_0xc314('0xc'),_0xc314('0xd'),_0xc314('0xe'),_0xc314('0xf'),_0xc314('0x10')];exports[_0xc314('0x11')]=function(_0x2dff08,_0x4da777,_0x33877f,_0xf77c30,_0x3e86de,_0x3589eb){if(_0x33877f){if(_[_0xc314('0x12')](integrations,_0x2dff08[_0xc314('0x13')][_0xc314('0x14')]())){try{var _0x594c29=null;var _0x4c9150='';var _0x43263b=_0x33877f[_0x2dff08['data1'][_0xc314('0x14')]()];if(_0x43263b){var _0x389d34=_0x43263b[_0x2dff08[_0xc314('0x15')]];if(_0x389d34){var _0x419951=_[_0xc314('0x16')](_0x389d34[_0xc314('0x17')],{'id':parseInt(_0x2dff08[_0xc314('0x18')],0xa)});if(_0x419951){if(_0xf77c30){if(_0x3e86de&&_0x4da777['queue']){_0x4c9150=_0xc314('0x19');}else if(_0x4da777['routeId']){_0x4c9150=_0xc314('0x1a');}else{console['log'](_0xc314('0x1b'),_0x4da777);}}else{_0x4c9150=_0xc314('0x1c');}switch(_0x2dff08[_0xc314('0x13')][_0xc314('0x14')]()){case'zendesk':zendesk[_0x4c9150](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb);break;case _0xc314('0x9'):salesforce[_0x4c9150](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb);break;case'sugarcrm':sugarcrm[_0x4c9150](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb);break;case _0xc314('0x1d'):freshdesk[_0x4c9150](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb);break;case _0xc314('0xb'):zoho[_0x4c9150](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb);break;case'desk':desk[_0x4c9150](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb);break;case _0xc314('0xd'):vtiger[_0x4c9150](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb);break;case _0xc314('0xf'):freshsales['cs'](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb,_0x4c9150);break;case _0xc314('0x10'):servicenow['cs'](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb,_0x4c9150);break;case'dynamics365':dynamics365['cs'](_0x2dff08,_0x4da777,_0x419951,_0xf77c30,_0x3e86de,_0x389d34,_0x3589eb,_0x4c9150);break;default:console[_0xc314('0x1e')]('unknown\x20integration');}}else{_0x594c29=require(_0xc314('0x1f'))(_0x2dff08[_0xc314('0x13')][_0xc314('0x14')]());_0x594c29[_0xc314('0x20')](_0xc314('0x21'),util[_0xc314('0x22')](_0xc314('0x23'),_0x2dff08[_0xc314('0x13')]['toLowerCase'](),_0x2dff08[_0xc314('0x18')]));}}else{_0x594c29=require(_0xc314('0x1f'))(_0x2dff08[_0xc314('0x13')]['toLowerCase']());_0x594c29[_0xc314('0x20')]('[EXEC]',util[_0xc314('0x22')](_0xc314('0x24'),_0x2dff08[_0xc314('0x13')][_0xc314('0x14')](),_0x2dff08[_0xc314('0x15')]));}}else{}}catch(_0x5ac73a){console[_0xc314('0x20')](_0x5ac73a);}}}}; \ No newline at end of file +var _0x1507=['util','./zendesk','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','data2','find','Configurations','queue','routeId','outbound','unmanaged','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','error'];(function(_0x3c7869,_0x207240){var _0x23bc0b=function(_0x1d5f28){while(--_0x1d5f28){_0x3c7869['push'](_0x3c7869['shift']());}};_0x23bc0b(++_0x207240);}(_0x1507,0x1e1));var _0x7150=function(_0x3df822,_0x299495){_0x3df822=_0x3df822-0x0;var _0x4e457d=_0x1507[_0x3df822];return _0x4e457d;};'use strict';var _=require('lodash');var util=require(_0x7150('0x0'));var zendesk=require(_0x7150('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x7150('0x2'));var freshdesk=require(_0x7150('0x3'));var zoho=require('./zoho');var desk=require(_0x7150('0x4'));var vtiger=require(_0x7150('0x5'));var servicenow=require(_0x7150('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x7150('0x7'));var integrations=[_0x7150('0x8'),_0x7150('0x9'),_0x7150('0xa'),_0x7150('0xb'),_0x7150('0xc'),_0x7150('0xd'),_0x7150('0xe'),_0x7150('0xf'),_0x7150('0x10'),_0x7150('0x11')];exports[_0x7150('0x12')]=function(_0x517544,_0xf4d582,_0x610bc2,_0x2aefdc,_0x275cec,_0x3ea4d7){if(_0x610bc2){if(_[_0x7150('0x13')](integrations,_0x517544['data1'][_0x7150('0x14')]())){try{var _0x2db2bc=null;var _0x4c29c4='';var _0x7f5392=_0x610bc2[_0x517544[_0x7150('0x15')][_0x7150('0x14')]()];if(_0x7f5392){var _0x5dedf0=_0x7f5392[_0x517544[_0x7150('0x16')]];if(_0x5dedf0){var _0x4efda8=_[_0x7150('0x17')](_0x5dedf0[_0x7150('0x18')],{'id':parseInt(_0x517544['data3'],0xa)});if(_0x4efda8){if(_0x2aefdc){if(_0x275cec&&_0xf4d582[_0x7150('0x19')]){_0x4c29c4=_0x7150('0x19');}else if(_0xf4d582[_0x7150('0x1a')]){_0x4c29c4=_0x7150('0x1b');}else{console['log']('EVENT\x20UNKNOWN',_0xf4d582);}}else{_0x4c29c4=_0x7150('0x1c');}switch(_0x517544[_0x7150('0x15')][_0x7150('0x14')]()){case _0x7150('0x8'):zendesk[_0x4c29c4](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7);break;case _0x7150('0x9'):salesforce[_0x4c29c4](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7);break;case _0x7150('0xa'):sugarcrm[_0x4c29c4](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7);break;case _0x7150('0xb'):freshdesk[_0x4c29c4](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7);break;case'zoho':zoho[_0x4c29c4](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7);break;case'desk':desk[_0x4c29c4](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7);break;case _0x7150('0xe'):vtiger[_0x4c29c4](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7);break;case _0x7150('0x10'):freshsales['cs'](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7,_0x4c29c4);break;case _0x7150('0x11'):servicenow['cs'](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7,_0x4c29c4);break;case _0x7150('0xf'):dynamics365['cs'](_0x517544,_0xf4d582,_0x4efda8,_0x2aefdc,_0x275cec,_0x5dedf0,_0x3ea4d7,_0x4c29c4);break;default:console['log'](_0x7150('0x1d'));}}else{_0x2db2bc=require(_0x7150('0x1e'))(_0x517544[_0x7150('0x15')]['toLowerCase']());_0x2db2bc['error'](_0x7150('0x1f'),util[_0x7150('0x20')](_0x7150('0x21'),_0x517544[_0x7150('0x15')]['toLowerCase'](),_0x517544[_0x7150('0x22')]));}}else{_0x2db2bc=require(_0x7150('0x1e'))(_0x517544['data1'][_0x7150('0x14')]());_0x2db2bc['error'](_0x7150('0x1f'),util[_0x7150('0x20')](_0x7150('0x23'),_0x517544[_0x7150('0x15')][_0x7150('0x14')](),_0x517544['data2']));}}else{}}catch(_0x1d2ff6){console[_0x7150('0x24')](_0x1d2ff6);}}}}; \ 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 8ac4c57..95ddb32 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 _0x6a5c=['bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','AccountId','lead','leadId','info','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','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','upperFirst','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','calleridnum','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment'];(function(_0x3501fd,_0x3232fd){var _0x38e354=function(_0x4544ad){while(--_0x4544ad){_0x3501fd['push'](_0x3501fd['shift']());}};_0x38e354(++_0x3232fd);}(_0x6a5c,0x190));var _0xc6a5=function(_0x29af75,_0x152b87){_0x29af75=_0x29af75-0x0;var _0x32b56b=_0x6a5c[_0x29af75];return _0x32b56b;};'use strict';var _=require(_0xc6a5('0x0'));var rp=require('request-promise');var moment=require(_0xc6a5('0x1'));var BPromise=require(_0xc6a5('0x2'));var md5=require(_0xc6a5('0x3'));var jsforce=require(_0xc6a5('0x4'));var util=require(_0xc6a5('0x5'));var Redis=require(_0xc6a5('0x6'));var intUtil=require(_0xc6a5('0x7'));var config=require('../../../../config/environment');var logger=require(_0xc6a5('0x8'))(_0xc6a5('0x9'));config[_0xc6a5('0xa')]=_['defaults'](config[_0xc6a5('0xa')],{'host':_0xc6a5('0xb'),'port':0x18eb});var io=require(_0xc6a5('0xc'))(new Redis(config[_0xc6a5('0xa')]));function emit(_0x397ff0,_0x31d533,_0x2eaaef){io['to'](_0x397ff0)['emit'](_0x31d533,_0x2eaaef);}function getTicket(_0x346362,_0x506db3,_0x46aa17,_0x5a09cd,_0x270b71,_0x33075e,_0x1dd2d6,_0x58c604){var _0x30f6b3=Object[_0xc6a5('0xd')]({},{'OwnerId':_0x506db3['id'],'Subject':intUtil[_0xc6a5('0xe')](_0x5a09cd[_0xc6a5('0xf')],_0x270b71,'\x20'),'Description':intUtil['getString'](_0x5a09cd[_0xc6a5('0x10')],_0x270b71,'\x0a')},getCustomFields(_0x33075e,_0x270b71));if(_0x46aa17){if(_0x5a09cd[_0xc6a5('0x11')]===_0xc6a5('0x12')){_0x30f6b3['ActivityDate']=moment[_0xc6a5('0x13')]();_0x30f6b3[_0xc6a5('0x14')]=![];_0x30f6b3[_0xc6a5('0x15')]=![];if(_0x46aa17[_0xc6a5('0x16')]===_0xc6a5('0x17')||_0x46aa17['endUserType']==='lead'){_0x30f6b3[_0xc6a5('0x18')]=_0x46aa17['id'];}else if(_0x46aa17[_0xc6a5('0x16')]===_0xc6a5('0x19')){_0x30f6b3[_0xc6a5('0x1a')]=_0x46aa17['id'];}}else if(_0x5a09cd[_0xc6a5('0x11')]===_0xc6a5('0x1b')){if(_0x46aa17[_0xc6a5('0x16')]===_0xc6a5('0x17')){_0x30f6b3['ContactId']=_0x46aa17['id'];}else if(_0x46aa17[_0xc6a5('0x16')]===_0xc6a5('0x19')){_0x30f6b3[_0xc6a5('0x1c')]=_0x46aa17['id'];}else if(_0x46aa17['endUserType']===_0xc6a5('0x1d')&&_0x5a09cd[_0xc6a5('0x1e')]){_0x30f6b3[_0x5a09cd[_0xc6a5('0x1e')]]=_0x46aa17['id'];}else{logger[_0xc6a5('0x1f')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1dd2d6[_0xc6a5('0x20')](_0x5a09cd[_0xc6a5('0x11')])[_0xc6a5('0x21')](_0x30f6b3);}function getUser(_0x44d74e,_0x3ed563,_0xaa2c53){if(!_[_0xc6a5('0x22')](_0x3ed563)&&intUtil[_0xc6a5('0x23')](_0x3ed563)){var _0x2514cf={'Email':_0x3ed563};var _0xa477e1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xaa2c53['sobject'](_0xc6a5('0x24'))[_0xc6a5('0x25')](_0x2514cf,_0xa477e1)[_0xc6a5('0x26')]()[_0xc6a5('0x27')](function(_0x5c4d3d){if(_0x5c4d3d[_0xc6a5('0x28')]){var _0x13b1ae=_['find'](_0x5c4d3d,function(_0x137d19){return _0x137d19[_0xc6a5('0x29')]===_0x3ed563;});if(_0x13b1ae){logger[_0xc6a5('0x1f')](_0xc6a5('0x2a'),_0x3ed563);return BPromise[_0xc6a5('0x2b')]({'id':_0x13b1ae['Id'],'name':_0x13b1ae[_0xc6a5('0x2c')]});}}else{logger[_0xc6a5('0x1f')](_0xc6a5('0x2d'),_0x3ed563);return _0xaa2c53['identity']()[_0xc6a5('0x27')](function(_0x140396){return BPromise[_0xc6a5('0x2b')]({'id':_0x140396[_0xc6a5('0x2e')],'name':_0x140396['display_name']});});}});}else{logger[_0xc6a5('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3ed563);return _0xaa2c53[_0xc6a5('0x2f')]()[_0xc6a5('0x27')](function(_0x40a644){return BPromise[_0xc6a5('0x2b')]({'id':_0x40a644[_0xc6a5('0x2e')],'name':_0x40a644[_0xc6a5('0x30')]});});}}function getEndUser(_0x8c2710,_0x161410,_0x1372fb,_0x3120f4,_0x760eb7){var _0x1862ab={'$or':{'Phone':_0x3120f4}};var _0x3be055={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xc6a5('0x27')](function(){logger[_0xc6a5('0x1f')](_0xc6a5('0x31'),_0x3120f4,_0x161410[_0xc6a5('0x32')]);switch(_0x161410[_0xc6a5('0x32')]){case _0xc6a5('0x33'):var _0x93f776=_[_0xc6a5('0x34')](_0x1862ab);if(_0x161410[_0xc6a5('0x35')]){var _0x7591e4={};_0x7591e4[_0x161410[_0xc6a5('0x35')]]=_0x3120f4;_[_0xc6a5('0x36')](_0x93f776[_0xc6a5('0x37')],_0x7591e4);}return _0x760eb7[_0xc6a5('0x20')](_0xc6a5('0x38'))[_0xc6a5('0x25')](_0x93f776,_0x3be055)['execute']()[_0xc6a5('0x27')](function(_0x3f6fca){if(_0x3f6fca&&_0x3f6fca[_0xc6a5('0x28')]){return _0x3f6fca;}else{var _0x4d58bd=_['cloneDeep'](_0x1862ab);if(_0x161410[_0xc6a5('0x39')]){var _0x348a0b={};_0x348a0b[_0x161410[_0xc6a5('0x39')]]=_0x3120f4;_[_0xc6a5('0x36')](_0x4d58bd[_0xc6a5('0x37')],_0x348a0b);}return _0x760eb7[_0xc6a5('0x20')](_0xc6a5('0x3a'))[_0xc6a5('0x25')](_0x4d58bd,_0x3be055);}});case _0xc6a5('0x3b'):var _0x5e9f2a=_['cloneDeep'](_0x1862ab);if(_0x161410[_0xc6a5('0x3c')]){var _0x7591e4={};_0x7591e4[_0x161410[_0xc6a5('0x3c')]]=_0x3120f4;_[_0xc6a5('0x36')](_0x5e9f2a[_0xc6a5('0x37')],_0x7591e4);}return _0x760eb7['sobject'](_0xc6a5('0x3d'))[_0xc6a5('0x25')](_0x5e9f2a,_0x3be055)[_0xc6a5('0x26')]()['then'](function(_0x44ac82){if(_0x44ac82&&_0x44ac82['length']){return _0x44ac82;}else{var _0x276b1c=_[_0xc6a5('0x34')](_0x1862ab);if(_0x161410[_0xc6a5('0x35')]){var _0x1512f1={};_0x1512f1[_0x161410[_0xc6a5('0x35')]]=_0x3120f4;_['merge'](_0x276b1c[_0xc6a5('0x37')],_0x1512f1);}return _0x760eb7[_0xc6a5('0x20')]('Contact')[_0xc6a5('0x25')](_0x276b1c,_0x3be055)['then'](function(_0x2dc380){if(_0x2dc380&&_0x2dc380['length']){return _0x2dc380;}else{var _0x20fff6=_[_0xc6a5('0x34')](_0x1862ab);if(_0x161410['additionalSearchLead']){var _0x43cf8c={};_0x43cf8c[_0x161410[_0xc6a5('0x39')]]=_0x3120f4;_['merge'](_0x20fff6[_0xc6a5('0x37')],_0x43cf8c);}return _0x760eb7[_0xc6a5('0x20')]('Lead')[_0xc6a5('0x25')](_0x20fff6,_0x3be055);}});}});case _0xc6a5('0x17'):var _0x93f776=_[_0xc6a5('0x34')](_0x1862ab);if(_0x161410['additionalSearchContact']){var _0x7591e4={};_0x7591e4[_0x161410['additionalSearchContact']]=_0x3120f4;_['merge'](_0x93f776[_0xc6a5('0x37')],_0x7591e4);}return _0x760eb7['sobject']('Contact')[_0xc6a5('0x25')](_0x93f776,_0x3be055)[_0xc6a5('0x26')]();case _0xc6a5('0x1d'):var _0x2518b4=_[_0xc6a5('0x34')](_0x1862ab);if(_0x161410[_0xc6a5('0x39')]){var _0x7591e4={};_0x7591e4[_0x161410['additionalSearchLead']]=_0x3120f4;_[_0xc6a5('0x36')](_0x2518b4[_0xc6a5('0x37')],_0x7591e4);}return _0x760eb7[_0xc6a5('0x20')]('Lead')[_0xc6a5('0x25')](_0x2518b4,_0x3be055);case _0xc6a5('0x19'):var _0x5e9f2a=_[_0xc6a5('0x34')](_0x1862ab);if(_0x161410['additionalSearchAccount']){var _0x7591e4={};_0x7591e4[_0x161410[_0xc6a5('0x3c')]]=_0x3120f4;_['merge'](_0x5e9f2a[_0xc6a5('0x37')],_0x7591e4);}return _0x760eb7[_0xc6a5('0x20')]('Account')['find'](_0x5e9f2a,_0x3be055);default:return null;}})[_0xc6a5('0x27')](function(_0x546362){if(_0x546362&&_0x546362[_0xc6a5('0x28')]){var _0x4451eb=_[_0xc6a5('0x3e')](_0x546362);if(_0x4451eb){return BPromise[_0xc6a5('0x2b')]({'id':_0x4451eb['Id'],'name':_0x4451eb[_0xc6a5('0x2c')],'phone':_0x4451eb[_0xc6a5('0x3f')],'endUserType':_0x4451eb['attributes']['type']['toLowerCase']()});}}})[_0xc6a5('0x27')](function(_0x279847){if(_0x279847){logger[_0xc6a5('0x1f')](_0xc6a5('0x40'),_0x279847[_0xc6a5('0x16')],_0x3120f4);return BPromise[_0xc6a5('0x2b')](_0x279847);}else{logger[_0xc6a5('0x1f')](_0xc6a5('0x41'),_0x3120f4);var _0x244da6={'Phone':_0x3120f4};if(_0x161410[_0xc6a5('0x42')]){if(_0x161410['moduleCreate']===_0xc6a5('0x17')){logger[_0xc6a5('0x1f')](_0xc6a5('0x43'),_0x3120f4,_0x161410[_0xc6a5('0x42')]);_0x244da6[_0xc6a5('0x44')]=_0x1372fb!==''?_0x1372fb:util[_0xc6a5('0x45')](_0xc6a5('0x46'),_0x3120f4);}else if(_0x161410[_0xc6a5('0x42')]===_0xc6a5('0x1d')){logger[_0xc6a5('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3120f4,_0x161410[_0xc6a5('0x42')]);_0x244da6[_0xc6a5('0x44')]=_0x1372fb!==_0xc6a5('0x47')?_0x1372fb:util[_0xc6a5('0x45')](_0xc6a5('0x46'),_0x3120f4);_0x244da6[_0xc6a5('0x48')]=_0xc6a5('0x49');}else if(_0x161410[_0xc6a5('0x42')]==='account'){logger[_0xc6a5('0x1f')](_0xc6a5('0x43'),_0x3120f4,_0x161410[_0xc6a5('0x42')]);_0x244da6[_0xc6a5('0x2c')]=_0x1372fb!==_0xc6a5('0x47')?_0x1372fb:util[_0xc6a5('0x45')]('Caller\x20-\x20%s',_0x3120f4);}else{return null;}}return _0x760eb7['sobject'](_[_0xc6a5('0x4a')](_0x161410[_0xc6a5('0x42')]))[_0xc6a5('0x21')](_0x244da6)['then'](function(_0x4ee786){return BPromise[_0xc6a5('0x2b')]({'id':_0x4ee786['id'],'endUserType':_0x161410[_0xc6a5('0x42')]});});}});}function getCustomFields(_0x5066f9,_0x2f5a76){var _0x402f96={};if(_0x5066f9['length']>0x0){_[_0xc6a5('0x4b')](_0x5066f9,function(_0x3e33de){if(_[_0xc6a5('0x4c')]([_0xc6a5('0x4d'),_0xc6a5('0x4e')],_0x3e33de[_0xc6a5('0x4f')])&&_0x3e33de['idField']){_0x402f96[_0x3e33de[_0xc6a5('0x50')]]=_0x3e33de[_0xc6a5('0x51')][_0xc6a5('0x52')]();}else if(_0x3e33de[_0xc6a5('0x4f')]===_0xc6a5('0x53')&&_0x3e33de['variableName']&&_0x3e33de[_0xc6a5('0x50')]){_0x2f5a76[_0x3e33de[_0xc6a5('0x54')]]&&(_0x402f96[_0x3e33de[_0xc6a5('0x50')]]=_0x2f5a76[_0x3e33de['variableName']][_0xc6a5('0x52')]());}else if(_0x3e33de[_0xc6a5('0x4f')]===_0xc6a5('0x55')&&_0x3e33de[_0xc6a5('0x56')]&&_0x3e33de[_0xc6a5('0x56')]['name']&&_0x3e33de[_0xc6a5('0x50')]){_0x2f5a76[_0x3e33de[_0xc6a5('0x56')][_0xc6a5('0x57')]['toLowerCase']()]&&(_0x402f96[_0x3e33de[_0xc6a5('0x50')]]=_0x2f5a76[_0x3e33de[_0xc6a5('0x56')][_0xc6a5('0x57')][_0xc6a5('0x58')]()]['toString']());}});}return _0x402f96;}function getConnection(_0x43928b){var _0x335a5d=_0x43928b[_0xc6a5('0x59')][_0xc6a5('0x5a')](_0x43928b[_0xc6a5('0x5b')]);var _0x1586de=new jsforce['Connection']({'oauth2':{'loginUrl':_0x43928b[_0xc6a5('0x5c')]||_0xc6a5('0x5d'),'clientId':_0x43928b[_0xc6a5('0x5e')],'clientSecret':_0x43928b['clientSecret']}});return _0x1586de[_0xc6a5('0x5f')](_0x43928b[_0xc6a5('0x60')],_0x335a5d)[_0xc6a5('0x27')](function(){logger['info'](_0xc6a5('0x61'));return _0x1586de;});}exports[_0xc6a5('0x62')]=function(_0x2315ba,_0x286a2c,_0x304a1d,_0x91226c,_0x1b94da,_0x1d86d2){var _0x2afe0a,_0x534c4c,_0xe68825,_0x29ea05;_0x1d86d2[_0xc6a5('0x63')]=intUtil['stripTrailingSlash'](_0x1d86d2[_0xc6a5('0x63')]);_0x1d86d2['remoteUri']=intUtil[_0xc6a5('0x64')](_0x1d86d2[_0xc6a5('0x5c')]);if(_0x1b94da&&_0x1b94da[_0xc6a5('0x65')]){logger[_0xc6a5('0x1f')](_0xc6a5('0x66'),_0xc6a5('0x67'));_0x286a2c[_0xc6a5('0x68')]=util[_0xc6a5('0x45')](_0xc6a5('0x69'),_0x1d86d2[_0xc6a5('0x63')],_0x286a2c[_0xc6a5('0x6a')],md5(_0x286a2c['uniqueid']));}else{_0x286a2c['recordingURL']='';}return getConnection(_0x1d86d2)[_0xc6a5('0x27')](function(_0xdde406){_0x29ea05=_0xdde406;return getUser(_0x1d86d2,_0x91226c['email'],_0x29ea05);})[_0xc6a5('0x27')](function(_0x581667){_0x2afe0a=_0x581667;return getEndUser(_0x1d86d2,_0x304a1d,_0x286a2c[_0xc6a5('0x6b')],_0x286a2c['calleridnum'],_0x29ea05);})[_0xc6a5('0x27')](function(_0x5c242e){_0x534c4c=_0x5c242e;return getTicket(_0x1d86d2,_0x2afe0a,_0x534c4c,_0x304a1d,_0x286a2c,_0x304a1d[_0xc6a5('0x6c')],_0x29ea05,'queue');})[_0xc6a5('0x27')](function(_0x3538f2){_0xe68825=_0x3538f2;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0xe68825['id']);logger[_0xc6a5('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xe68825['id'],_0x91226c[_0xc6a5('0x57')],_0x1d86d2[_0xc6a5('0x4f')]);switch(_0x1d86d2['type']){case'integrationTab':emit(util['format'](_0xc6a5('0x6d'),_0x91226c[_0xc6a5('0x57')]),_0xc6a5('0x6e'),{'recordId':_0xe68825['id']});break;case _0xc6a5('0x6f'):emit(util['format']('user:%s',_0x91226c[_0xc6a5('0x57')]),_0xc6a5('0x70'),{'uri':util[_0xc6a5('0x45')](_0xc6a5('0x71'),_0x29ea05[_0xc6a5('0x72')],_0xe68825['id'])});break;default:logger[_0xc6a5('0x73')](_0xc6a5('0x74'));}})[_0xc6a5('0x75')](function(_0x49c514){logger[_0xc6a5('0x73')](_0xc6a5('0x66'),_0x49c514);});};exports['outbound']=function(_0x9e6b17,_0x546480,_0x2341b0,_0x25178c,_0x39eff7,_0x34590d,_0x3dd0c1){var _0x7b53ee,_0x36c8ae,_0x315b58,_0x1fc116;_0x34590d[_0xc6a5('0x63')]=intUtil[_0xc6a5('0x64')](_0x34590d[_0xc6a5('0x63')]);_0x34590d[_0xc6a5('0x5c')]=intUtil[_0xc6a5('0x64')](_0x34590d[_0xc6a5('0x5c')]);if(_0x3dd0c1&&_0x3dd0c1[_0xc6a5('0x76')]&&_0x3dd0c1[_0xc6a5('0x76')]!==_0xc6a5('0x77')){logger['info'](_0xc6a5('0x78'),_0xc6a5('0x67'));_0x546480[_0xc6a5('0x68')]=util[_0xc6a5('0x45')](_0xc6a5('0x69'),_0x34590d[_0xc6a5('0x63')],_0x546480[_0xc6a5('0x6a')],md5(_0x546480['uniqueid']));}return getConnection(_0x34590d)[_0xc6a5('0x27')](function(_0x1f5f4a){_0x1fc116=_0x1f5f4a;return getUser(_0x34590d,_0x25178c[_0xc6a5('0x79')],_0x1fc116);})[_0xc6a5('0x27')](function(_0x2600ce){_0x7b53ee=_0x2600ce;return getEndUser(_0x34590d,_0x2341b0,_0x546480[_0xc6a5('0x7a')],_0x546480[_0xc6a5('0x7b')],_0x1fc116);})['then'](function(_0x318c8d){_0x36c8ae=_0x318c8d;return getTicket(_0x34590d,_0x7b53ee,_0x36c8ae,_0x2341b0,_0x546480,_0x2341b0['Fields'],_0x1fc116,_0xc6a5('0x7c'));})[_0xc6a5('0x27')](function(_0x2483ee){_0x315b58=_0x2483ee;logger[_0xc6a5('0x1f')](_0xc6a5('0x7d'),_0x315b58['id']);logger['info'](_0xc6a5('0x7e'),_0x315b58['id'],_0x25178c[_0xc6a5('0x57')],_0x34590d['type']);switch(_0x34590d['type']){case'integrationTab':emit(util[_0xc6a5('0x45')]('user:%s',_0x25178c[_0xc6a5('0x57')]),_0xc6a5('0x6e'),{'recordId':_0x315b58['id']});break;case _0xc6a5('0x6f'):emit(util['format']('user:%s',_0x25178c['name']),'trigger:browser:url',{'uri':util[_0xc6a5('0x45')]('%s/%s/e',_0x1fc116['instanceUrl'],_0x315b58['id'])});break;default:logger[_0xc6a5('0x73')](_0xc6a5('0x78'),_0xc6a5('0x7f'));}})['catch'](function(_0x92c90d){logger[_0xc6a5('0x73')](_0xc6a5('0x78'),_0x92c90d);});};exports[_0xc6a5('0x80')]=function(_0x7431c8,_0x1816ac,_0xc5b482,_0x1e2ed3,_0x1b0e2f,_0x2fd33e){var _0x236020,_0x252a8b,_0x49de8c,_0x2c0d35;_0x2fd33e['serverUrl']=intUtil['stripTrailingSlash'](_0x2fd33e[_0xc6a5('0x63')]);_0x2fd33e['remoteUri']=intUtil[_0xc6a5('0x64')](_0x2fd33e[_0xc6a5('0x5c')]);if(_0x1b0e2f&&_0x1b0e2f['monitor_format']){logger[_0xc6a5('0x1f')]('['+_0x1816ac['lastevent'][_0xc6a5('0x81')]()+']',_0xc6a5('0x67'));_0x1816ac[_0xc6a5('0x68')]=util[_0xc6a5('0x45')](_0xc6a5('0x69'),_0x2fd33e['serverUrl'],_0x1816ac[_0xc6a5('0x6a')],md5(_0x1816ac[_0xc6a5('0x6a')]));}else{_0x1816ac[_0xc6a5('0x68')]='';}return getConnection(_0x2fd33e)['then'](function(_0x24e106){_0x2c0d35=_0x24e106;if(!_[_0xc6a5('0x22')](_0x1e2ed3)){return getUser(_0x2fd33e,_0x1e2ed3['name'],_0x2c0d35);}else{return getUser(_0x2fd33e,null,_0x2c0d35);}})[_0xc6a5('0x27')](function(_0x47de22){_0x236020=_0x47de22;return getEndUser(_0x2fd33e,_0xc5b482,_0x1816ac[_0xc6a5('0x6b')],_0x1816ac[_0xc6a5('0x82')],_0x2c0d35);})['then'](function(_0x3bb1db){_0x252a8b=_0x3bb1db;return getTicket(_0x2fd33e,_0x236020,_0x252a8b,_0xc5b482,_0x1816ac,_0xc5b482[_0xc6a5('0x6c')],_0x2c0d35);})['then'](function(_0x239324){_0x49de8c=_0x239324;logger[_0xc6a5('0x1f')]('['+_0x1816ac[_0xc6a5('0x83')][_0xc6a5('0x81')]()+_0xc6a5('0x84'),_0x49de8c['id']);logger[_0xc6a5('0x1f')]('['+_0x1816ac[_0xc6a5('0x83')][_0xc6a5('0x81')]()+_0xc6a5('0x85'),_0x2fd33e[_0xc6a5('0x4f')]);})[_0xc6a5('0x75')](function(_0x593569){logger[_0xc6a5('0x73')]('['+_0x1816ac['lastevent'][_0xc6a5('0x81')]()+']',_0x593569);});}; \ No newline at end of file +var _0xad16=['WhatId','ticketType','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','No\x20Company','create','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','Connection','remoteUri','https://login.salesforce.com','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId'];(function(_0x324eaa,_0x245f46){var _0x4ff13b=function(_0x7671c7){while(--_0x7671c7){_0x324eaa['push'](_0x324eaa['shift']());}};_0x4ff13b(++_0x245f46);}(_0xad16,0xef));var _0x6ad1=function(_0xae4d23,_0xd31a8){_0xae4d23=_0xae4d23-0x0;var _0x2a1462=_0xad16[_0xae4d23];return _0x2a1462;};'use strict';var _=require('lodash');var rp=require(_0x6ad1('0x0'));var moment=require(_0x6ad1('0x1'));var BPromise=require(_0x6ad1('0x2'));var md5=require(_0x6ad1('0x3'));var jsforce=require(_0x6ad1('0x4'));var util=require('util');var Redis=require(_0x6ad1('0x5'));var intUtil=require(_0x6ad1('0x6'));var config=require(_0x6ad1('0x7'));var logger=require(_0x6ad1('0x8'))(_0x6ad1('0x9'));config[_0x6ad1('0xa')]=_[_0x6ad1('0xb')](config[_0x6ad1('0xa')],{'host':_0x6ad1('0xc'),'port':0x18eb});var io=require(_0x6ad1('0xd'))(new Redis(config['redis']));function emit(_0x3783a3,_0x2e1133,_0x5c7cb2){io['to'](_0x3783a3)[_0x6ad1('0xe')](_0x2e1133,_0x5c7cb2);}function getTicket(_0x5c4bb6,_0x57050f,_0xdde301,_0x5df0ee,_0x478ab5,_0x58ce6c,_0x2acabf,_0x205ad7){var _0x38b228=Object[_0x6ad1('0xf')]({},{'OwnerId':_0x57050f['id'],'Subject':intUtil[_0x6ad1('0x10')](_0x5df0ee[_0x6ad1('0x11')],_0x478ab5,'\x20'),'Description':intUtil[_0x6ad1('0x10')](_0x5df0ee['Descriptions'],_0x478ab5,'\x0a')},getCustomFields(_0x58ce6c,_0x478ab5));if(_0xdde301){if(_0x5df0ee['ticketType']===_0x6ad1('0x12')){_0x38b228[_0x6ad1('0x13')]=moment[_0x6ad1('0x14')]();_0x38b228[_0x6ad1('0x15')]=![];_0x38b228[_0x6ad1('0x16')]=![];if(_0xdde301[_0x6ad1('0x17')]===_0x6ad1('0x18')||_0xdde301[_0x6ad1('0x17')]===_0x6ad1('0x19')){_0x38b228[_0x6ad1('0x1a')]=_0xdde301['id'];}else if(_0xdde301[_0x6ad1('0x17')]==='account'){_0x38b228[_0x6ad1('0x1b')]=_0xdde301['id'];}}else if(_0x5df0ee[_0x6ad1('0x1c')]==='Case'){if(_0xdde301[_0x6ad1('0x17')]==='contact'){_0x38b228[_0x6ad1('0x1d')]=_0xdde301['id'];}else if(_0xdde301['endUserType']===_0x6ad1('0x1e')){_0x38b228[_0x6ad1('0x1f')]=_0xdde301['id'];}else if(_0xdde301[_0x6ad1('0x17')]==='lead'&&_0x5df0ee[_0x6ad1('0x20')]){_0x38b228[_0x5df0ee[_0x6ad1('0x20')]]=_0xdde301['id'];}else{logger[_0x6ad1('0x21')](_0x6ad1('0x22'));}}}return _0x2acabf[_0x6ad1('0x23')](_0x5df0ee[_0x6ad1('0x1c')])['create'](_0x38b228);}function getUser(_0x4850ea,_0x70ae7,_0x3e3c90){if(!_[_0x6ad1('0x24')](_0x70ae7)&&intUtil[_0x6ad1('0x25')](_0x70ae7)){var _0x24fffc={'Email':_0x70ae7};var _0x3df4ac={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3e3c90['sobject'](_0x6ad1('0x26'))[_0x6ad1('0x27')](_0x24fffc,_0x3df4ac)[_0x6ad1('0x28')]()[_0x6ad1('0x29')](function(_0xab095d){if(_0xab095d[_0x6ad1('0x2a')]){var _0x5f3070=_['find'](_0xab095d,function(_0x2bc31b){return _0x2bc31b[_0x6ad1('0x2b')]===_0x70ae7;});if(_0x5f3070){logger[_0x6ad1('0x21')]('Agent\x20%s\x20found.',_0x70ae7);return BPromise['resolve']({'id':_0x5f3070['Id'],'name':_0x5f3070['Name']});}}else{logger[_0x6ad1('0x21')](_0x6ad1('0x2c'),_0x70ae7);return _0x3e3c90[_0x6ad1('0x2d')]()['then'](function(_0x50d306){return BPromise[_0x6ad1('0x2e')]({'id':_0x50d306['user_id'],'name':_0x50d306[_0x6ad1('0x2f')]});});}});}else{logger[_0x6ad1('0x21')](_0x6ad1('0x2c'),_0x70ae7);return _0x3e3c90['identity']()[_0x6ad1('0x29')](function(_0xaa1e9b){return BPromise['resolve']({'id':_0xaa1e9b[_0x6ad1('0x30')],'name':_0xaa1e9b[_0x6ad1('0x2f')]});});}}function getEndUser(_0x5ce5d8,_0x414b65,_0x268114,_0x1fe653,_0x459378){var _0x286899={'$or':{'Phone':_0x1fe653}};var _0xd93c20={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x6ad1('0x29')](function(){logger[_0x6ad1('0x21')](_0x6ad1('0x31'),_0x1fe653,_0x414b65[_0x6ad1('0x32')]);switch(_0x414b65[_0x6ad1('0x32')]){case _0x6ad1('0x33'):var _0x333ebc=_[_0x6ad1('0x34')](_0x286899);if(_0x414b65[_0x6ad1('0x35')]){var _0x248c74={};_0x248c74[_0x414b65[_0x6ad1('0x35')]]=_0x1fe653;_[_0x6ad1('0x36')](_0x333ebc[_0x6ad1('0x37')],_0x248c74);}return _0x459378[_0x6ad1('0x23')](_0x6ad1('0x38'))[_0x6ad1('0x27')](_0x333ebc,_0xd93c20)[_0x6ad1('0x28')]()[_0x6ad1('0x29')](function(_0x84af6b){if(_0x84af6b&&_0x84af6b[_0x6ad1('0x2a')]){return _0x84af6b;}else{var _0x6631c=_[_0x6ad1('0x34')](_0x286899);if(_0x414b65['additionalSearchLead']){var _0xaf929d={};_0xaf929d[_0x414b65[_0x6ad1('0x39')]]=_0x1fe653;_[_0x6ad1('0x36')](_0x6631c[_0x6ad1('0x37')],_0xaf929d);}return _0x459378['sobject'](_0x6ad1('0x3a'))[_0x6ad1('0x27')](_0x6631c,_0xd93c20);}});case _0x6ad1('0x3b'):var _0x1a196c=_[_0x6ad1('0x34')](_0x286899);if(_0x414b65[_0x6ad1('0x3c')]){var _0x248c74={};_0x248c74[_0x414b65[_0x6ad1('0x3c')]]=_0x1fe653;_['merge'](_0x1a196c[_0x6ad1('0x37')],_0x248c74);}return _0x459378[_0x6ad1('0x23')](_0x6ad1('0x3d'))[_0x6ad1('0x27')](_0x1a196c,_0xd93c20)[_0x6ad1('0x28')]()[_0x6ad1('0x29')](function(_0x5a6d75){if(_0x5a6d75&&_0x5a6d75[_0x6ad1('0x2a')]){return _0x5a6d75;}else{var _0xddc3b1=_[_0x6ad1('0x34')](_0x286899);if(_0x414b65[_0x6ad1('0x35')]){var _0x15fc5a={};_0x15fc5a[_0x414b65[_0x6ad1('0x35')]]=_0x1fe653;_['merge'](_0xddc3b1[_0x6ad1('0x37')],_0x15fc5a);}return _0x459378[_0x6ad1('0x23')]('Contact')[_0x6ad1('0x27')](_0xddc3b1,_0xd93c20)[_0x6ad1('0x29')](function(_0x4e8b11){if(_0x4e8b11&&_0x4e8b11[_0x6ad1('0x2a')]){return _0x4e8b11;}else{var _0x1ecc68=_[_0x6ad1('0x34')](_0x286899);if(_0x414b65[_0x6ad1('0x39')]){var _0x125a1f={};_0x125a1f[_0x414b65['additionalSearchLead']]=_0x1fe653;_[_0x6ad1('0x36')](_0x1ecc68[_0x6ad1('0x37')],_0x125a1f);}return _0x459378[_0x6ad1('0x23')](_0x6ad1('0x3a'))['find'](_0x1ecc68,_0xd93c20);}});}});case _0x6ad1('0x18'):var _0x333ebc=_['cloneDeep'](_0x286899);if(_0x414b65[_0x6ad1('0x35')]){var _0x248c74={};_0x248c74[_0x414b65[_0x6ad1('0x35')]]=_0x1fe653;_[_0x6ad1('0x36')](_0x333ebc[_0x6ad1('0x37')],_0x248c74);}return _0x459378[_0x6ad1('0x23')](_0x6ad1('0x38'))[_0x6ad1('0x27')](_0x333ebc,_0xd93c20)[_0x6ad1('0x28')]();case _0x6ad1('0x19'):var _0x4e500e=_['cloneDeep'](_0x286899);if(_0x414b65[_0x6ad1('0x39')]){var _0x248c74={};_0x248c74[_0x414b65[_0x6ad1('0x39')]]=_0x1fe653;_[_0x6ad1('0x36')](_0x4e500e[_0x6ad1('0x37')],_0x248c74);}return _0x459378[_0x6ad1('0x23')]('Lead')[_0x6ad1('0x27')](_0x4e500e,_0xd93c20);case _0x6ad1('0x1e'):var _0x1a196c=_[_0x6ad1('0x34')](_0x286899);if(_0x414b65[_0x6ad1('0x3c')]){var _0x248c74={};_0x248c74[_0x414b65[_0x6ad1('0x3c')]]=_0x1fe653;_['merge'](_0x1a196c['$or'],_0x248c74);}return _0x459378['sobject']('Account')[_0x6ad1('0x27')](_0x1a196c,_0xd93c20);default:return null;}})[_0x6ad1('0x29')](function(_0x3a759f){if(_0x3a759f&&_0x3a759f[_0x6ad1('0x2a')]){var _0x6bbd62=_[_0x6ad1('0x3e')](_0x3a759f);if(_0x6bbd62){return BPromise[_0x6ad1('0x2e')]({'id':_0x6bbd62['Id'],'name':_0x6bbd62[_0x6ad1('0x3f')],'phone':_0x6bbd62[_0x6ad1('0x40')],'endUserType':_0x6bbd62[_0x6ad1('0x41')]['type']['toLowerCase']()});}}})[_0x6ad1('0x29')](function(_0x8a9576){if(_0x8a9576){logger['info'](_0x6ad1('0x42'),_0x8a9576[_0x6ad1('0x17')],_0x1fe653);return BPromise[_0x6ad1('0x2e')](_0x8a9576);}else{logger[_0x6ad1('0x21')](_0x6ad1('0x43'),_0x1fe653);var _0x40521f={'Phone':_0x1fe653};if(_0x414b65['moduleCreate']){if(_0x414b65['moduleCreate']===_0x6ad1('0x18')){logger[_0x6ad1('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1fe653,_0x414b65[_0x6ad1('0x44')]);_0x40521f[_0x6ad1('0x45')]=_0x268114!==_0x6ad1('0x46')?_0x268114:util['format'](_0x6ad1('0x47'),_0x1fe653);}else if(_0x414b65[_0x6ad1('0x44')]==='lead'){logger[_0x6ad1('0x21')](_0x6ad1('0x48'),_0x1fe653,_0x414b65['moduleCreate']);_0x40521f['LastName']=_0x268114!==_0x6ad1('0x46')?_0x268114:util[_0x6ad1('0x49')](_0x6ad1('0x47'),_0x1fe653);_0x40521f['Company']=_0x6ad1('0x4a');}else if(_0x414b65[_0x6ad1('0x44')]===_0x6ad1('0x1e')){logger[_0x6ad1('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1fe653,_0x414b65[_0x6ad1('0x44')]);_0x40521f[_0x6ad1('0x3f')]=_0x268114!==_0x6ad1('0x46')?_0x268114:util[_0x6ad1('0x49')](_0x6ad1('0x47'),_0x1fe653);}else{return null;}}return _0x459378[_0x6ad1('0x23')](_['upperFirst'](_0x414b65[_0x6ad1('0x44')]))[_0x6ad1('0x4b')](_0x40521f)[_0x6ad1('0x29')](function(_0x49e3c4){return BPromise[_0x6ad1('0x2e')]({'id':_0x49e3c4['id'],'endUserType':_0x414b65[_0x6ad1('0x44')]});});}});}function getCustomFields(_0x39b1c2,_0x48fb44){var _0x56c282={};if(_0x39b1c2[_0x6ad1('0x2a')]>0x0){_[_0x6ad1('0x4c')](_0x39b1c2,function(_0x9f29cb){if(_[_0x6ad1('0x4d')]([_0x6ad1('0x4e'),_0x6ad1('0x4f')],_0x9f29cb[_0x6ad1('0x50')])&&_0x9f29cb['idField']){_0x56c282[_0x9f29cb[_0x6ad1('0x51')]]=_0x9f29cb[_0x6ad1('0x52')][_0x6ad1('0x53')]();}else if(_0x9f29cb['type']===_0x6ad1('0x54')&&_0x9f29cb[_0x6ad1('0x55')]&&_0x9f29cb[_0x6ad1('0x51')]){_0x48fb44[_0x9f29cb['variableName']]&&(_0x56c282[_0x9f29cb['idField']]=_0x48fb44[_0x9f29cb[_0x6ad1('0x55')]][_0x6ad1('0x53')]());}else if(_0x9f29cb['type']===_0x6ad1('0x56')&&_0x9f29cb['Variable']&&_0x9f29cb[_0x6ad1('0x57')][_0x6ad1('0x58')]&&_0x9f29cb[_0x6ad1('0x51')]){_0x48fb44[_0x9f29cb['Variable'][_0x6ad1('0x58')][_0x6ad1('0x59')]()]&&(_0x56c282[_0x9f29cb[_0x6ad1('0x51')]]=_0x48fb44[_0x9f29cb[_0x6ad1('0x57')][_0x6ad1('0x58')][_0x6ad1('0x59')]()][_0x6ad1('0x53')]());}});}return _0x56c282;}function getConnection(_0x5c692d){var _0x6e3fdd=_0x5c692d['password'][_0x6ad1('0x5a')](_0x5c692d['securityToken']);var _0x4df5f8=new jsforce[(_0x6ad1('0x5b'))]({'oauth2':{'loginUrl':_0x5c692d[_0x6ad1('0x5c')]||_0x6ad1('0x5d'),'clientId':_0x5c692d['clientId'],'clientSecret':_0x5c692d['clientSecret']}});return _0x4df5f8[_0x6ad1('0x5e')](_0x5c692d[_0x6ad1('0x5f')],_0x6e3fdd)['then'](function(){logger['info'](_0x6ad1('0x60'));return _0x4df5f8;});}exports[_0x6ad1('0x61')]=function(_0x56d36f,_0x4e7bda,_0xc4e99a,_0x15f61e,_0x1a7a47,_0x4ef833){var _0x36140a,_0x153f31,_0x4e560a,_0x495b6b;_0x4ef833[_0x6ad1('0x62')]=intUtil[_0x6ad1('0x63')](_0x4ef833[_0x6ad1('0x62')]);_0x4ef833['remoteUri']=intUtil['stripTrailingSlash'](_0x4ef833[_0x6ad1('0x5c')]);if(_0x1a7a47&&_0x1a7a47[_0x6ad1('0x64')]){logger['info']('[QUEUE]',_0x6ad1('0x65'));_0x4e7bda[_0x6ad1('0x66')]=util['format'](_0x6ad1('0x67'),_0x4ef833['serverUrl'],_0x4e7bda[_0x6ad1('0x68')],md5(_0x4e7bda[_0x6ad1('0x68')]));}else{_0x4e7bda['recordingURL']='';}return getConnection(_0x4ef833)[_0x6ad1('0x29')](function(_0x2f5d85){_0x495b6b=_0x2f5d85;return getUser(_0x4ef833,_0x15f61e[_0x6ad1('0x69')],_0x495b6b);})[_0x6ad1('0x29')](function(_0x598093){_0x36140a=_0x598093;return getEndUser(_0x4ef833,_0xc4e99a,_0x4e7bda[_0x6ad1('0x6a')],_0x4e7bda[_0x6ad1('0x6b')],_0x495b6b);})[_0x6ad1('0x29')](function(_0x463201){_0x153f31=_0x463201;return getTicket(_0x4ef833,_0x36140a,_0x153f31,_0xc4e99a,_0x4e7bda,_0xc4e99a[_0x6ad1('0x6c')],_0x495b6b,_0x6ad1('0x61'));})[_0x6ad1('0x29')](function(_0x1ba717){_0x4e560a=_0x1ba717;logger[_0x6ad1('0x21')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4e560a['id']);logger[_0x6ad1('0x21')](_0x6ad1('0x6d'),_0x4e560a['id'],_0x15f61e['name'],_0x4ef833[_0x6ad1('0x50')]);switch(_0x4ef833[_0x6ad1('0x50')]){case _0x6ad1('0x6e'):emit(util[_0x6ad1('0x49')](_0x6ad1('0x6f'),_0x15f61e[_0x6ad1('0x58')]),_0x6ad1('0x70'),{'recordId':_0x4e560a['id']});break;case'newTab':emit(util[_0x6ad1('0x49')](_0x6ad1('0x6f'),_0x15f61e[_0x6ad1('0x58')]),_0x6ad1('0x71'),{'uri':util[_0x6ad1('0x49')](_0x6ad1('0x72'),_0x495b6b[_0x6ad1('0x73')],_0x4e560a['id'])});break;default:logger['error'](_0x6ad1('0x74'));}})[_0x6ad1('0x75')](function(_0x38a355){logger[_0x6ad1('0x76')](_0x6ad1('0x77'),_0x38a355);});};exports[_0x6ad1('0x78')]=function(_0xfc849d,_0x16f67f,_0x51fed5,_0x57ee05,_0x13079e,_0x3eee07,_0x5b2267){var _0x4ddd3e,_0x564b92,_0x365ba1,_0xdee7;_0x3eee07[_0x6ad1('0x62')]=intUtil[_0x6ad1('0x63')](_0x3eee07['serverUrl']);_0x3eee07[_0x6ad1('0x5c')]=intUtil[_0x6ad1('0x63')](_0x3eee07[_0x6ad1('0x5c')]);if(_0x5b2267&&_0x5b2267[_0x6ad1('0x79')]&&_0x5b2267['recordingFormat']!==_0x6ad1('0x7a')){logger[_0x6ad1('0x21')](_0x6ad1('0x7b'),_0x6ad1('0x65'));_0x16f67f[_0x6ad1('0x66')]=util['format'](_0x6ad1('0x67'),_0x3eee07['serverUrl'],_0x16f67f['uniqueid'],md5(_0x16f67f['uniqueid']));}return getConnection(_0x3eee07)[_0x6ad1('0x29')](function(_0x29c76f){_0xdee7=_0x29c76f;return getUser(_0x3eee07,_0x57ee05[_0x6ad1('0x69')],_0xdee7);})[_0x6ad1('0x29')](function(_0x263c72){_0x4ddd3e=_0x263c72;return getEndUser(_0x3eee07,_0x51fed5,_0x16f67f['destcalleridname'],_0x16f67f['destcalleridnum'],_0xdee7);})[_0x6ad1('0x29')](function(_0x4512bf){_0x564b92=_0x4512bf;return getTicket(_0x3eee07,_0x4ddd3e,_0x564b92,_0x51fed5,_0x16f67f,_0x51fed5[_0x6ad1('0x6c')],_0xdee7,_0x6ad1('0x78'));})[_0x6ad1('0x29')](function(_0x5dc183){_0x365ba1=_0x5dc183;logger[_0x6ad1('0x21')](_0x6ad1('0x7c'),_0x365ba1['id']);logger[_0x6ad1('0x21')](_0x6ad1('0x7d'),_0x365ba1['id'],_0x57ee05[_0x6ad1('0x58')],_0x3eee07['type']);switch(_0x3eee07['type']){case _0x6ad1('0x6e'):emit(util[_0x6ad1('0x49')]('user:%s',_0x57ee05[_0x6ad1('0x58')]),'trigger:salesforce:display',{'recordId':_0x365ba1['id']});break;case _0x6ad1('0x7e'):emit(util[_0x6ad1('0x49')](_0x6ad1('0x6f'),_0x57ee05[_0x6ad1('0x58')]),_0x6ad1('0x71'),{'uri':util[_0x6ad1('0x49')](_0x6ad1('0x72'),_0xdee7[_0x6ad1('0x73')],_0x365ba1['id'])});break;default:logger[_0x6ad1('0x76')](_0x6ad1('0x7b'),_0x6ad1('0x7f'));}})[_0x6ad1('0x75')](function(_0x4e7d94){logger[_0x6ad1('0x76')](_0x6ad1('0x7b'),_0x4e7d94);});};exports[_0x6ad1('0x80')]=function(_0x36856c,_0x2ba6f6,_0x1bc954,_0x9557e7,_0x435fdd,_0xa821ac){var _0x44206b,_0x10960b,_0x59b43d,_0x364342;_0xa821ac[_0x6ad1('0x62')]=intUtil[_0x6ad1('0x63')](_0xa821ac[_0x6ad1('0x62')]);_0xa821ac[_0x6ad1('0x5c')]=intUtil[_0x6ad1('0x63')](_0xa821ac[_0x6ad1('0x5c')]);if(_0x435fdd&&_0x435fdd[_0x6ad1('0x64')]){logger[_0x6ad1('0x21')]('['+_0x2ba6f6[_0x6ad1('0x81')][_0x6ad1('0x82')]()+']',_0x6ad1('0x65'));_0x2ba6f6['recordingURL']=util[_0x6ad1('0x49')](_0x6ad1('0x67'),_0xa821ac['serverUrl'],_0x2ba6f6['uniqueid'],md5(_0x2ba6f6[_0x6ad1('0x68')]));}else{_0x2ba6f6[_0x6ad1('0x66')]='';}return getConnection(_0xa821ac)[_0x6ad1('0x29')](function(_0x46a9ab){_0x364342=_0x46a9ab;if(!_[_0x6ad1('0x24')](_0x9557e7)){return getUser(_0xa821ac,_0x9557e7[_0x6ad1('0x58')],_0x364342);}else{return getUser(_0xa821ac,null,_0x364342);}})['then'](function(_0x4c3982){_0x44206b=_0x4c3982;return getEndUser(_0xa821ac,_0x1bc954,_0x2ba6f6['calleridname'],_0x2ba6f6['calleridnum'],_0x364342);})[_0x6ad1('0x29')](function(_0x386cd5){_0x10960b=_0x386cd5;return getTicket(_0xa821ac,_0x44206b,_0x10960b,_0x1bc954,_0x2ba6f6,_0x1bc954[_0x6ad1('0x6c')],_0x364342);})['then'](function(_0x4637ef){_0x59b43d=_0x4637ef;logger[_0x6ad1('0x21')]('['+_0x2ba6f6['lastevent'][_0x6ad1('0x82')]()+_0x6ad1('0x83'),_0x59b43d['id']);logger[_0x6ad1('0x21')]('['+_0x2ba6f6[_0x6ad1('0x81')][_0x6ad1('0x82')]()+_0x6ad1('0x84'),_0xa821ac[_0x6ad1('0x50')]);})['catch'](function(_0xf7bb00){logger['error']('['+_0x2ba6f6['lastevent'][_0x6ad1('0x82')]()+']',_0xf7bb00);});}; \ 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 0694e58..bf8036d 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 _0x6064=['info','],\x20getUser\x20input\x20crm','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm','error','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','variableName','customVariable','name','Variable','toString',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x6064,0xce));var _0x4606=function(_0x34b1d2,_0x12fce7){_0x34b1d2=_0x34b1d2-0x0;var _0x28852c=_0x6064[_0x34b1d2];return _0x28852c;};'use strict';var _=require(_0x4606('0x0'));var Promise=require(_0x4606('0x1'));var rp=require('request-promise');var util=require(_0x4606('0x2'));var md5=require('md5');var Redis=require(_0x4606('0x3'));var intUtil=require(_0x4606('0x4'));var config=require(_0x4606('0x5'));var logger=require('../../../../config/logger')(_0x4606('0x6'));config[_0x4606('0x7')]=_[_0x4606('0x8')](config[_0x4606('0x7')],{'host':_0x4606('0x9'),'port':0x18eb});var io=require(_0x4606('0xa'))(new Redis(config[_0x4606('0x7')]));function getAdminUser(_0x2ac012,_0x1e0556,_0x4b54b5,_0x1355c4,_0x570ac4,_0x46de73){return new Promise(function(_0x343381,_0x48823c){var _0x113117={'method':'GET','uri':_0x1355c4+_0x4606('0xb')+'&'+_0x570ac4+'&'+_0x46de73,'auth':_0x1e0556,'json':!![]};return rp(_0x113117)['then'](function(_0x23f34a){if(_0x23f34a[_0x4606('0xc')][_0x4606('0xd')]>0x0){_0x4b54b5[_0x4606('0xe')]=_0x23f34a[_0x4606('0xc')][0x0][_0x4606('0xf')];}logger['info']('['+[_0x2ac012[_0x4606('0x10')]()]+_0x4606('0x11'),_0x4b54b5);_0x343381(_0x4b54b5);})[_0x4606('0x12')](function(_0x1da5f1){logger['error']('['+[_0x2ac012[_0x4606('0x10')]()]+']',_0x1da5f1[_0x4606('0x13')]);_0x48823c(_0x1da5f1[_0x4606('0x13')]);});});}function getUser(_0x318028,_0x43f5f6,_0x12c704,_0x16268f,_0x3b9240){return function(_0x6aff08){logger[_0x4606('0x14')]('['+[_0x318028[_0x4606('0x10')]()]+_0x4606('0x15'),_0x6aff08);return new Promise(function(_0x3526a4,_0x3b6382){if(intUtil['validateEmail'](_0x6aff08[_0x4606('0x16')])){var _0x3bf55c={'method':_0x4606('0x17'),'uri':_0x12c704+_0x4606('0x18')+_0x6aff08['userEmail']+'&'+_0x16268f+'&'+_0x3b9240,'auth':_0x43f5f6,'json':!![]};logger['info']('['+[_0x318028[_0x4606('0x10')]()]+_0x4606('0x19'),_0x3bf55c);return rp(_0x3bf55c)['then'](function(_0x27b72c){logger[_0x4606('0x14')]('['+[_0x318028['toUpperCase']()]+'],\x20getUser\x20entity',_0x27b72c);if(_0x27b72c[_0x4606('0xc')][_0x4606('0xd')]>0x0&&String(_0x27b72c['result'][0x0][_0x4606('0x1a')])===_0x4606('0x1b')){_0x6aff08[_0x4606('0x1c')]=_0x27b72c[_0x4606('0xc')][0x0]['sys_id'];}else{_0x6aff08[_0x4606('0x1c')]=_0x6aff08[_0x4606('0xe')];_0x6aff08[_0x4606('0x16')]=_0x6aff08[_0x4606('0x1d')];}logger[_0x4606('0x14')]('['+[_0x318028['toUpperCase']()]+_0x4606('0x1e'),_0x6aff08);_0x3526a4(_0x6aff08);})[_0x4606('0x12')](function(_0x553ddf){logger[_0x4606('0x1f')]('['+[_0x318028[_0x4606('0x10')]()]+']',_0x553ddf[_0x4606('0x13')]);_0x3b6382(_0x553ddf[_0x4606('0x13')]);});}else{logger[_0x4606('0x14')]('['+[_0x318028[_0x4606('0x10')]()]+']\x20using\x20admin\x20profile');_0x6aff08['userId']=_0x6aff08[_0x4606('0xe')];_0x6aff08[_0x4606('0x16')]=_0x6aff08[_0x4606('0x1d')];_0x3526a4(_0x6aff08);}});};}function createEndUser(_0x16d14d,_0x4f8156,_0x28f820,_0x5eab01,_0x16a862){logger[_0x4606('0x14')]('['+[_0x16d14d[_0x4606('0x10')]()]+_0x4606('0x20'),_0x28f820);return new Promise(function(_0x5be035,_0x1083a5){var _0x5c90b8={'method':_0x4606('0x21'),'uri':_0x5eab01+_0x4606('0x22')+_0x16a862,'body':{'user_name':_0x28f820['endUserNumber'],'roles':_0x4606('0x23'),'first_name':_0x28f820[_0x4606('0x24')],'active':'true','date_format':_0x4606('0x25'),'phone':_0x28f820[_0x4606('0x24')]},'auth':_0x4f8156,'json':!![]};return rp(_0x5c90b8)[_0x4606('0x26')](function(_0x18ff74){logger[_0x4606('0x14')]('['+[_0x16d14d[_0x4606('0x10')]()]+_0x4606('0x27'),_0x18ff74[_0x4606('0xc')]);_0x28f820[_0x4606('0x28')]=_0x18ff74[_0x4606('0xc')]['sys_id'];_0x5be035(_0x28f820);})[_0x4606('0x12')](function(_0x1bdb79){logger[_0x4606('0x1f')]('['+[_0x16d14d[_0x4606('0x10')]()]+']',_0x1bdb79[_0x4606('0x13')]);_0x1083a5(_0x1bdb79[_0x4606('0x13')]);});});}function getEndUser(_0x3f9478,_0x5b700f,_0x1a17e3,_0x2d6eb7,_0x5e463e){return function(_0x294d95){logger[_0x4606('0x14')]('['+[_0x3f9478[_0x4606('0x10')]()]+_0x4606('0x29'),_0x294d95);return new Promise(function(_0x4e6ca1,_0x371c70){var _0x2f9e39={'method':'GET','uri':_0x1a17e3+_0x4606('0x2a')+_0x294d95[_0x4606('0x24')]+'&'+_0x2d6eb7+'&'+_0x5e463e,'auth':_0x5b700f,'json':!![]};return rp(_0x2f9e39)[_0x4606('0x26')](function(_0x186e36){if(_0x186e36[_0x4606('0xc')]['length']>0x0){_0x294d95[_0x4606('0x28')]=_0x186e36[_0x4606('0xc')][0x0][_0x4606('0xf')];logger[_0x4606('0x14')]('['+[_0x3f9478[_0x4606('0x10')]()]+_0x4606('0x2b'),_0x294d95);_0x4e6ca1(_0x294d95);}else{return createEndUser(_0x3f9478,_0x5b700f,_0x294d95,_0x1a17e3,_0x2d6eb7)[_0x4606('0x26')](function(_0x5d9b42){logger[_0x4606('0x14')]('['+[_0x3f9478[_0x4606('0x10')]()]+_0x4606('0x2c'),_0x5d9b42);_0x4e6ca1(_0x5d9b42);});}})[_0x4606('0x12')](function(_0x317625){logger[_0x4606('0x1f')]('['+[_0x3f9478['toUpperCase']()]+']',_0x317625[_0x4606('0x13')]);_0x371c70(_0x317625[_0x4606('0x13')]);});});};}function getCustomFields(_0x30aa7f,_0x264ba9){var _0xc5cc16={};if(_0x30aa7f['length']>0x0){_[_0x4606('0x2d')](_0x30aa7f,function(_0x591a2d){if(_[_0x4606('0x2e')](['string',_0x4606('0x2f')],_0x591a2d[_0x4606('0x30')])&&_0x591a2d[_0x4606('0x31')]&&!_0x591a2d[_0x4606('0x32')]){_0xc5cc16[_0x591a2d[_0x4606('0x31')][_0x4606('0x33')]()]=_0x591a2d[_0x4606('0x34')]['toString']();}else if(_['includes']([_0x4606('0x35'),_0x4606('0x2f')],_0x591a2d[_0x4606('0x30')])&&_0x591a2d[_0x4606('0x36')]&&_0x591a2d[_0x4606('0x32')]){_0xc5cc16[_0x591a2d[_0x4606('0x36')][_0x4606('0x33')]()]=_0x591a2d[_0x4606('0x34')]['toString']();}else if(_0x591a2d[_0x4606('0x30')]==='variable'&&_0x591a2d['variableName']&&_0x591a2d['idField']&&_0x591a2d[_0x4606('0x32')]){_0xc5cc16[_0x591a2d[_0x4606('0x36')][_0x4606('0x33')]()]=_0x264ba9[_0x591a2d[_0x4606('0x37')]]['toString']();}else if(_0x591a2d['type']===_0x4606('0x38')&&_0x591a2d['Variable']&&_0x591a2d['Variable'][_0x4606('0x39')]&&_0x591a2d['idField']&&_0x591a2d[_0x4606('0x32')]){_0xc5cc16[_0x591a2d[_0x4606('0x36')]['toLowerCase']()]=_0x264ba9[_0x591a2d[_0x4606('0x3a')][_0x4606('0x39')][_0x4606('0x33')]()][_0x4606('0x3b')]();}});}return _0xc5cc16;}function getTicket(_0x3fdfda,_0x1809cb,_0x31f1c8,_0x2e8f36,_0x3b7354,_0x1058c7){return function(_0x2ce228){logger[_0x4606('0x14')]('['+[_0x3fdfda['toUpperCase']()]+_0x4606('0x3c'),_0x2ce228);return new Promise(function(_0x5f268d,_0x15c0c4){var _0x1aa7c5=_0x3fdfda[_0x4606('0x33')]()===_0x4606('0x3d')?_0x2ce228['userId']:_0x2ce228[_0x4606('0x28')];var _0x39b79e={'method':_0x4606('0x21'),'uri':_0x31f1c8+_0x4606('0x3e')+'?'+_0x1058c7,'body':Object[_0x4606('0x3f')]({},{'active':_0x4606('0x1b'),'caller_id':_0x1aa7c5,'assigned_to':_0x2ce228['userId'],'short_description':intUtil[_0x4606('0x40')](_0x2e8f36['Subjects'],_0x3b7354,'\x20'),'description':intUtil[_0x4606('0x40')](_0x2e8f36[_0x4606('0x41')],_0x3b7354,'\x0a')},getCustomFields(_0x2e8f36[_0x4606('0x42')],_0x3b7354)),'auth':_0x1809cb,'json':!![]};return rp(_0x39b79e)[_0x4606('0x26')](function(_0x473db1){logger[_0x4606('0x14')]('['+[_0x3fdfda['toUpperCase']()]+_0x4606('0x43'),_0x473db1[_0x4606('0xc')]);_0x2ce228[_0x4606('0x44')]=_0x473db1[_0x4606('0xc')][_0x4606('0xf')];_0x2ce228[_0x4606('0x45')]=_0x473db1[_0x4606('0xc')][_0x4606('0x46')];logger[_0x4606('0x14')]('['+[_0x3fdfda[_0x4606('0x10')]()]+_0x4606('0x47'),_0x2ce228);_0x5f268d(_0x2ce228);})['catch'](function(_0x140bda){logger[_0x4606('0x1f')]('['+[_0x3fdfda['toUpperCase']()]+']',_0x140bda[_0x4606('0x13')]);_0x15c0c4(_0x140bda[_0x4606('0x13')]);});});};}function createRemoteTag(_0x12fa11,_0x25c936,_0x409071,_0x44cf09){return new Promise(function(_0x30ea3a,_0x1f7d45){var _0x1fea67={'method':_0x4606('0x21'),'uri':_0x409071+'label'+'?'+_0x44cf09,'body':{'short_description':_0x12fa11,'global':!![],'active':!![],'name':_0x12fa11},'auth':_0x25c936,'json':!![]};return rp(_0x1fea67)[_0x4606('0x26')](function(_0x14db1c){var _0x38860b=_0x14db1c['result'][_0x4606('0xf')];_0x30ea3a(_0x38860b);});});}function getRemoteTag(_0x1e3e04,_0x112635,_0x370421,_0x1e3eba,_0x28ee25){return new Promise(function(_0x704c83,_0x3a0e88){var _0x5b9450={'method':'GET','uri':_0x370421+_0x4606('0x48')+'?sysparm_query=name%3D'+_0x1e3e04+'&'+_0x1e3eba,'auth':_0x112635,'json':!![]};return rp(_0x5b9450)[_0x4606('0x26')](function(_0x2b6a4b){if(_0x2b6a4b['result'][_0x4606('0xd')]>0x0){var _0x3c58b1=_0x2b6a4b['result'][0x0][_0x4606('0xf')];_0x704c83(_0x3c58b1);}else{return createRemoteTag(_0x1e3e04,_0x112635,_0x370421,_0x1e3eba)[_0x4606('0x26')](function(_0x2ce062){_0x704c83(_0x2ce062);});}});});}function assignTagToIncident(_0x1f4613,_0x3b71a2,_0x581f5d,_0x2bd3fc,_0x5e9d1c){return new Promise(function(_0x4b0a6b,_0x2af01c){var _0x48d243={'method':'POST','uri':_0x581f5d+_0x4606('0x49')+'?'+_0x5e9d1c,'body':{'label':_0x1f4613,'table':_0x4606('0x3e'),'id_type':_0x4606('0x4a'),'table_key':_0x2bd3fc[_0x4606('0x44')],'title':_0x4606('0x4b')+_0x2bd3fc[_0x4606('0x45')],'id_display':_0x2bd3fc[_0x4606('0x45')]},'auth':_0x3b71a2,'json':!![]};return rp(_0x48d243)['then'](function(_0x2f8a9f){_0x4b0a6b();})[_0x4606('0x12')](function(){_0x4b0a6b();});});}function manageTags(_0x3d35eb,_0x52fcd4,_0x2947ad,_0x3b4f53,_0x43f22e,_0x129e52,_0x690a7f){return new Promise(function(_0x5a29e4,_0x5ef7ed){var _0xde26df=[];_0x52fcd4[_0x4606('0x2d')](function(_0x1dfe7e){_0xde26df[_0x4606('0x4c')](getRemoteTag(_0x1dfe7e,_0x2947ad,_0x3b4f53,_0x129e52,_0x690a7f));});return Promise[_0x4606('0x4d')](_0xde26df)['then'](function(_0x232f64){if(_0x232f64[_0x4606('0xd')]){logger[_0x4606('0x14')]('['+[_0x3d35eb[_0x4606('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x232f64);var _0x37a18d=[];_0x232f64['forEach'](function(_0x2f9416){_0x37a18d[_0x4606('0x4c')](assignTagToIncident(_0x2f9416,_0x2947ad,_0x3b4f53,_0x43f22e,_0x129e52));});return Promise['all'](_0x37a18d)[_0x4606('0x26')](function(){_0x5a29e4();})[_0x4606('0x12')](function(){_0x5a29e4();});}else{_0x5a29e4();}});});}function getTags(_0x49625b,_0x3690a5,_0x3cf6b7,_0x19fd98,_0x5c67b5,_0x221e03){return function(_0x59dd7a){return new Promise(function(_0x5e154e,_0x49a529){var _0x28bde0=[];var _0x231650=_0x19fd98[_0x4606('0x4e')];if(_0x231650&&_0x231650[_0x4606('0xd')]>0x0){_0x28bde0=_[_0x4606('0x4f')](_0x231650,_0x4606('0x39'));}if(_0x28bde0[_0x4606('0xd')]>0x0){return manageTags(_0x49625b,_0x28bde0,_0x3690a5,_0x3cf6b7,_0x59dd7a,_0x5c67b5,_0x221e03)['then'](function(){_0x5e154e(_0x59dd7a);});}else{_0x5e154e(_0x59dd7a);}});};}function emit(_0xda7144,_0x4eadb3,_0x171540){var _0x65dd71=_0x4606('0x50')+_0x4606('0x51')+_0x4606('0x52')+_0x4606('0x53');var _0x51e46e={'uri':_0xda7144+_0x4606('0x54')+_0x171540+_0x65dd71};io['to'](util[_0x4606('0x55')](_0x4606('0x56'),_0x4eadb3))['emit'](_0x4606('0x57'),_0x51e46e);}exports['cs']=function(_0x11c8f1,_0x35378f,_0x5b1187,_0xe30fc5,_0x3e9907,_0x1b7c73,_0x318765,_0x159b60){var _0x1d816f={};var _0x73f036={'user':_0x1b7c73[_0x4606('0x58')],'pass':_0x1b7c73['password']};var _0x1f15a5=_0x4606('0x59');var _0x1b652e=_0x4606('0x5a');_0x1b7c73[_0x4606('0x5b')]=intUtil[_0x4606('0x5c')](_0x1b7c73[_0x4606('0x5b')]);_0x1b7c73[_0x4606('0x5d')]=intUtil['stripTrailingSlash'](_0x1b7c73[_0x4606('0x5d')]);var _0x25f52b=util[_0x4606('0x55')]('%s/api/now/table/',_0x1b7c73[_0x4606('0x5b')]);_0x1d816f[_0x4606('0x16')]=!_[_0x4606('0x5e')](_0xe30fc5)?_0xe30fc5['email']:null;_0x1d816f[_0x4606('0x1d')]=_0x1b7c73['email'];_0x1d816f[_0x4606('0x24')]=_0x159b60[_0x4606('0x33')]()===_0x4606('0x3d')?_0x35378f[_0x4606('0x5f')]:_0x35378f[_0x4606('0x60')];_0x1d816f[_0x4606('0x61')]=_0x159b60===_0x4606('0x62')||_0x159b60===_0x4606('0x63')?_0x4606('0x62'):'outbound';var _0x7dabfe=util[_0x4606('0x55')](_0x4606('0x64'),_0x1b7c73['serverUrl'],_0x35378f['uniqueid'],md5(_0x35378f[_0x4606('0x65')]));if(_0x3e9907&&_0x3e9907[_0x4606('0x66')]){logger[_0x4606('0x14')]('[QUEUE]','Recording\x20is\x20enabled!');_0x35378f[_0x4606('0x67')]=_0x7dabfe;}else if(_0x318765&&_0x318765['recordingFormat']&&_0x318765[_0x4606('0x68')]!==_0x4606('0x69')){logger[_0x4606('0x14')](_0x4606('0x6a'),_0x4606('0x6b'));_0x35378f[_0x4606('0x67')]=_0x7dabfe;}else{_0x35378f[_0x4606('0x67')]='';}return getAdminUser(_0x159b60,_0x73f036,_0x1d816f,_0x25f52b,_0x1b652e,_0x1f15a5)[_0x4606('0x26')](getUser(_0x159b60,_0x73f036,_0x25f52b,_0x1b652e,_0x1f15a5))['then'](getEndUser(_0x159b60,_0x73f036,_0x25f52b,_0x1b652e,_0x1f15a5))['then'](getTicket(_0x159b60,_0x73f036,_0x25f52b,_0x5b1187,_0x35378f,_0x1b652e))['then'](function(_0x1df7d9){logger[_0x4606('0x14')](util[_0x4606('0x55')](_0x4606('0x6c'),_0x1df7d9[_0x4606('0x44')]));logger[_0x4606('0x14')](util[_0x4606('0x55')](_0x4606('0x6d'),_0x159b60));if(_0x159b60!==_0x4606('0x63')){logger[_0x4606('0x14')]('['+[_0x159b60[_0x4606('0x10')]()]+']',_0x4606('0x6e'));emit(_0x1b7c73[_0x4606('0x5b')],_0xe30fc5[_0x4606('0x39')],_0x1df7d9[_0x4606('0x44')]);}})[_0x4606('0x12')](function(_0x4d3044){logger[_0x4606('0x1f')]('['+[_0x159b60[_0x4606('0x10')]()]+_0x4606('0x6f'),util[_0x4606('0x70')](_0x4d3044,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0732=['format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','then','result','length','adminId','info','toUpperCase','catch','message','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm','error','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','variable','variableName','customVariable','Variable','idField','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','ticketNumber','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0732,0x143));var _0x2073=function(_0x3bf3f1,_0x5b8238){_0x3bf3f1=_0x3bf3f1-0x0;var _0x5a0c0c=_0x0732[_0x3bf3f1];return _0x5a0c0c;};'use strict';var _=require('lodash');var Promise=require(_0x2073('0x0'));var rp=require(_0x2073('0x1'));var util=require('util');var md5=require('md5');var Redis=require(_0x2073('0x2'));var intUtil=require(_0x2073('0x3'));var config=require(_0x2073('0x4'));var logger=require(_0x2073('0x5'))(_0x2073('0x6'));config[_0x2073('0x7')]=_['defaults'](config[_0x2073('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x33f5fb,_0x3331fc,_0x465986,_0x17d18d,_0x41d091,_0x5b6d82){return new Promise(function(_0x142cef,_0x5a2917){var _0x2051d0={'method':'GET','uri':_0x17d18d+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x41d091+'&'+_0x5b6d82,'auth':_0x3331fc,'json':!![]};return rp(_0x2051d0)[_0x2073('0x8')](function(_0x359c66){if(_0x359c66[_0x2073('0x9')][_0x2073('0xa')]>0x0){_0x465986[_0x2073('0xb')]=_0x359c66[_0x2073('0x9')][0x0]['sys_id'];}logger[_0x2073('0xc')]('['+[_0x33f5fb[_0x2073('0xd')]()]+'],\x20getAdminUser\x20crm',_0x465986);_0x142cef(_0x465986);})[_0x2073('0xe')](function(_0x3e13dc){logger['error']('['+[_0x33f5fb[_0x2073('0xd')]()]+']',_0x3e13dc[_0x2073('0xf')]);_0x5a2917(_0x3e13dc['message']);});});}function getUser(_0x623fd1,_0x284e9a,_0x3d8a72,_0x3fdbc5,_0x4553e7){return function(_0x204c3){logger[_0x2073('0xc')]('['+[_0x623fd1[_0x2073('0xd')]()]+'],\x20getUser\x20input\x20crm',_0x204c3);return new Promise(function(_0x3693ce,_0x1b6d7d){if(intUtil[_0x2073('0x10')](_0x204c3[_0x2073('0x11')])){var _0xdd3e77={'method':_0x2073('0x12'),'uri':_0x3d8a72+_0x2073('0x13')+_0x204c3[_0x2073('0x11')]+'&'+_0x3fdbc5+'&'+_0x4553e7,'auth':_0x284e9a,'json':!![]};logger['info']('['+[_0x623fd1[_0x2073('0xd')]()]+_0x2073('0x14'),_0xdd3e77);return rp(_0xdd3e77)[_0x2073('0x8')](function(_0x494241){logger[_0x2073('0xc')]('['+[_0x623fd1[_0x2073('0xd')]()]+'],\x20getUser\x20entity',_0x494241);if(_0x494241[_0x2073('0x9')]['length']>0x0&&String(_0x494241[_0x2073('0x9')][0x0][_0x2073('0x15')])===_0x2073('0x16')){_0x204c3[_0x2073('0x17')]=_0x494241[_0x2073('0x9')][0x0][_0x2073('0x18')];}else{_0x204c3[_0x2073('0x17')]=_0x204c3[_0x2073('0xb')];_0x204c3['userEmail']=_0x204c3[_0x2073('0x19')];}logger[_0x2073('0xc')]('['+[_0x623fd1[_0x2073('0xd')]()]+_0x2073('0x1a'),_0x204c3);_0x3693ce(_0x204c3);})['catch'](function(_0x1fbc4c){logger[_0x2073('0x1b')]('['+[_0x623fd1[_0x2073('0xd')]()]+']',_0x1fbc4c['message']);_0x1b6d7d(_0x1fbc4c['message']);});}else{logger[_0x2073('0xc')]('['+[_0x623fd1[_0x2073('0xd')]()]+']\x20using\x20admin\x20profile');_0x204c3[_0x2073('0x17')]=_0x204c3[_0x2073('0xb')];_0x204c3[_0x2073('0x11')]=_0x204c3[_0x2073('0x19')];_0x3693ce(_0x204c3);}});};}function createEndUser(_0x34bed9,_0xaaf3b2,_0x23a83f,_0x503a15,_0x3a8f08){logger[_0x2073('0xc')]('['+[_0x34bed9[_0x2073('0xd')]()]+_0x2073('0x1c'),_0x23a83f);return new Promise(function(_0x5753c7,_0x2fde4b){var _0xb338df={'method':_0x2073('0x1d'),'uri':_0x503a15+_0x2073('0x1e')+_0x3a8f08,'body':{'user_name':_0x23a83f[_0x2073('0x1f')],'roles':_0x2073('0x20'),'first_name':_0x23a83f[_0x2073('0x1f')],'active':_0x2073('0x16'),'date_format':_0x2073('0x21'),'phone':_0x23a83f[_0x2073('0x1f')]},'auth':_0xaaf3b2,'json':!![]};return rp(_0xb338df)['then'](function(_0x26fb4b){logger[_0x2073('0xc')]('['+[_0x34bed9[_0x2073('0xd')]()]+'],\x20EndUser\x20schema',_0x26fb4b['result']);_0x23a83f['endUserId']=_0x26fb4b['result'][_0x2073('0x18')];_0x5753c7(_0x23a83f);})[_0x2073('0xe')](function(_0x29a409){logger[_0x2073('0x1b')]('['+[_0x34bed9[_0x2073('0xd')]()]+']',_0x29a409[_0x2073('0xf')]);_0x2fde4b(_0x29a409[_0x2073('0xf')]);});});}function getEndUser(_0x2ca64b,_0x14df69,_0x2ec6db,_0x4dc10f,_0x3528a8){return function(_0x5cb59e){logger[_0x2073('0xc')]('['+[_0x2ca64b['toUpperCase']()]+_0x2073('0x22'),_0x5cb59e);return new Promise(function(_0x12e12c,_0x982ba8){var _0x418938={'method':_0x2073('0x12'),'uri':_0x2ec6db+_0x2073('0x23')+_0x5cb59e['endUserNumber']+'&'+_0x4dc10f+'&'+_0x3528a8,'auth':_0x14df69,'json':!![]};return rp(_0x418938)[_0x2073('0x8')](function(_0xcfe983){if(_0xcfe983[_0x2073('0x9')][_0x2073('0xa')]>0x0){_0x5cb59e[_0x2073('0x24')]=_0xcfe983[_0x2073('0x9')][0x0][_0x2073('0x18')];logger[_0x2073('0xc')]('['+[_0x2ca64b[_0x2073('0xd')]()]+'],\x20getEndUser\x20crm',_0x5cb59e);_0x12e12c(_0x5cb59e);}else{return createEndUser(_0x2ca64b,_0x14df69,_0x5cb59e,_0x2ec6db,_0x4dc10f)[_0x2073('0x8')](function(_0x57ce5c){logger['info']('['+[_0x2ca64b[_0x2073('0xd')]()]+_0x2073('0x25'),_0x57ce5c);_0x12e12c(_0x57ce5c);});}})['catch'](function(_0x4f3096){logger[_0x2073('0x1b')]('['+[_0x2ca64b[_0x2073('0xd')]()]+']',_0x4f3096['message']);_0x982ba8(_0x4f3096[_0x2073('0xf')]);});});};}function getCustomFields(_0x267a83,_0x4e328c){var _0x200268={};if(_0x267a83[_0x2073('0xa')]>0x0){_['forEach'](_0x267a83,function(_0x491f67){if(_[_0x2073('0x26')]([_0x2073('0x27'),_0x2073('0x28')],_0x491f67[_0x2073('0x29')])&&_0x491f67[_0x2073('0x2a')]&&!_0x491f67[_0x2073('0x2b')]){_0x200268[_0x491f67[_0x2073('0x2a')][_0x2073('0x2c')]()]=_0x491f67[_0x2073('0x2d')][_0x2073('0x2e')]();}else if(_[_0x2073('0x26')]([_0x2073('0x27'),'picklist'],_0x491f67[_0x2073('0x29')])&&_0x491f67['idField']&&_0x491f67[_0x2073('0x2b')]){_0x200268[_0x491f67['idField'][_0x2073('0x2c')]()]=_0x491f67[_0x2073('0x2d')]['toString']();}else if(_0x491f67[_0x2073('0x29')]===_0x2073('0x2f')&&_0x491f67[_0x2073('0x30')]&&_0x491f67['idField']&&_0x491f67[_0x2073('0x2b')]){_0x200268[_0x491f67['idField'][_0x2073('0x2c')]()]=_0x4e328c[_0x491f67['variableName']][_0x2073('0x2e')]();}else if(_0x491f67['type']===_0x2073('0x31')&&_0x491f67[_0x2073('0x32')]&&_0x491f67['Variable']['name']&&_0x491f67[_0x2073('0x33')]&&_0x491f67[_0x2073('0x2b')]){_0x200268[_0x491f67['idField']['toLowerCase']()]=_0x4e328c[_0x491f67[_0x2073('0x32')][_0x2073('0x34')][_0x2073('0x2c')]()][_0x2073('0x2e')]();}});}return _0x200268;}function getTicket(_0x1f4113,_0x54694e,_0x16299d,_0x22ec34,_0x5bd6d3,_0x4b1999){return function(_0x2fb18d){logger[_0x2073('0xc')]('['+[_0x1f4113[_0x2073('0xd')]()]+_0x2073('0x35'),_0x2fb18d);return new Promise(function(_0x512d5e,_0xa307d3){var _0x2c790d=_0x1f4113['toLowerCase']()===_0x2073('0x36')?_0x2fb18d['userId']:_0x2fb18d[_0x2073('0x24')];var _0x5267ab={'method':_0x2073('0x1d'),'uri':_0x16299d+_0x2073('0x37')+'?'+_0x4b1999,'body':Object['assign']({},{'active':_0x2073('0x16'),'caller_id':_0x2c790d,'assigned_to':_0x2fb18d[_0x2073('0x17')],'short_description':intUtil[_0x2073('0x38')](_0x22ec34[_0x2073('0x39')],_0x5bd6d3,'\x20'),'description':intUtil[_0x2073('0x38')](_0x22ec34[_0x2073('0x3a')],_0x5bd6d3,'\x0a')},getCustomFields(_0x22ec34[_0x2073('0x3b')],_0x5bd6d3)),'auth':_0x54694e,'json':!![]};return rp(_0x5267ab)[_0x2073('0x8')](function(_0xfc287f){logger[_0x2073('0xc')]('['+[_0x1f4113['toUpperCase']()]+_0x2073('0x3c'),_0xfc287f['result']);_0x2fb18d[_0x2073('0x3d')]=_0xfc287f[_0x2073('0x9')][_0x2073('0x18')];_0x2fb18d['ticketNumber']=_0xfc287f[_0x2073('0x9')]['number'];logger[_0x2073('0xc')]('['+[_0x1f4113[_0x2073('0xd')]()]+_0x2073('0x3e'),_0x2fb18d);_0x512d5e(_0x2fb18d);})[_0x2073('0xe')](function(_0x2e6a6b){logger[_0x2073('0x1b')]('['+[_0x1f4113[_0x2073('0xd')]()]+']',_0x2e6a6b[_0x2073('0xf')]);_0xa307d3(_0x2e6a6b[_0x2073('0xf')]);});});};}function createRemoteTag(_0x161c67,_0x310b59,_0x136041,_0x45086a){return new Promise(function(_0x2fbbc1,_0x135f63){var _0xc92bdc={'method':_0x2073('0x1d'),'uri':_0x136041+_0x2073('0x3f')+'?'+_0x45086a,'body':{'short_description':_0x161c67,'global':!![],'active':!![],'name':_0x161c67},'auth':_0x310b59,'json':!![]};return rp(_0xc92bdc)[_0x2073('0x8')](function(_0x4e8e93){var _0x362890=_0x4e8e93[_0x2073('0x9')][_0x2073('0x18')];_0x2fbbc1(_0x362890);});});}function getRemoteTag(_0x1fa2fc,_0x3ad979,_0x1be9bc,_0xc47dab,_0x4ebe9d){return new Promise(function(_0x28c2a2,_0x3a70be){var _0x4edf9e={'method':_0x2073('0x12'),'uri':_0x1be9bc+_0x2073('0x3f')+_0x2073('0x40')+_0x1fa2fc+'&'+_0xc47dab,'auth':_0x3ad979,'json':!![]};return rp(_0x4edf9e)[_0x2073('0x8')](function(_0x4a585d){if(_0x4a585d[_0x2073('0x9')][_0x2073('0xa')]>0x0){var _0x359792=_0x4a585d[_0x2073('0x9')][0x0]['sys_id'];_0x28c2a2(_0x359792);}else{return createRemoteTag(_0x1fa2fc,_0x3ad979,_0x1be9bc,_0xc47dab)[_0x2073('0x8')](function(_0x14efab){_0x28c2a2(_0x14efab);});}});});}function assignTagToIncident(_0xc05195,_0x381f88,_0x288359,_0x3faa5d,_0x10e083){return new Promise(function(_0x40a940,_0x338fdf){var _0x4488b6={'method':'POST','uri':_0x288359+_0x2073('0x41')+'?'+_0x10e083,'body':{'label':_0xc05195,'table':_0x2073('0x37'),'id_type':'Incident','table_key':_0x3faa5d[_0x2073('0x3d')],'title':_0x2073('0x42')+_0x3faa5d[_0x2073('0x43')],'id_display':_0x3faa5d[_0x2073('0x43')]},'auth':_0x381f88,'json':!![]};return rp(_0x4488b6)[_0x2073('0x8')](function(_0x41e1cc){_0x40a940();})['catch'](function(){_0x40a940();});});}function manageTags(_0x3c276a,_0x159ac2,_0x3a4494,_0xdfda6a,_0x2f6ae7,_0x83a1d2,_0x1333af){return new Promise(function(_0x5648d5,_0x5977cb){var _0x3c60b8=[];_0x159ac2[_0x2073('0x44')](function(_0x58c76e){_0x3c60b8[_0x2073('0x45')](getRemoteTag(_0x58c76e,_0x3a4494,_0xdfda6a,_0x83a1d2,_0x1333af));});return Promise[_0x2073('0x46')](_0x3c60b8)[_0x2073('0x8')](function(_0x46f7d9){if(_0x46f7d9[_0x2073('0xa')]){logger[_0x2073('0xc')]('['+[_0x3c276a['toUpperCase']()]+_0x2073('0x47'),_0x46f7d9);var _0x4b71ac=[];_0x46f7d9[_0x2073('0x44')](function(_0x43dc20){_0x4b71ac['push'](assignTagToIncident(_0x43dc20,_0x3a4494,_0xdfda6a,_0x2f6ae7,_0x83a1d2));});return Promise[_0x2073('0x46')](_0x4b71ac)[_0x2073('0x8')](function(){_0x5648d5();})[_0x2073('0xe')](function(){_0x5648d5();});}else{_0x5648d5();}});});}function getTags(_0x29235e,_0x560ee6,_0x18c9bc,_0x4011e5,_0x3d513f,_0x4c2f8e){return function(_0x517f1d){return new Promise(function(_0x46709c,_0x11fead){var _0xa2e753=[];var _0x6a4fe6=_0x4011e5[_0x2073('0x48')];if(_0x6a4fe6&&_0x6a4fe6[_0x2073('0xa')]>0x0){_0xa2e753=_[_0x2073('0x49')](_0x6a4fe6,_0x2073('0x34'));}if(_0xa2e753['length']>0x0){return manageTags(_0x29235e,_0xa2e753,_0x560ee6,_0x18c9bc,_0x517f1d,_0x3d513f,_0x4c2f8e)['then'](function(){_0x46709c(_0x517f1d);});}else{_0x46709c(_0x517f1d);}});};}function emit(_0x3302a7,_0xfc6551,_0x48f2e5){var _0x4eac22=_0x2073('0x4a')+_0x2073('0x4b')+_0x2073('0x4c')+'%255EORDERBYDESCnumber';var _0x330b89={'uri':_0x3302a7+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x48f2e5+_0x4eac22};io['to'](util['format'](_0x2073('0x4d'),_0xfc6551))[_0x2073('0x4e')](_0x2073('0x4f'),_0x330b89);}exports['cs']=function(_0x251b8f,_0x3a841f,_0x4d007e,_0x30786d,_0x1bfe7d,_0x2ba55a,_0x1e01e8,_0x4b87bf){var _0x509559={};var _0x323678={'user':_0x2ba55a[_0x2073('0x50')],'pass':_0x2ba55a[_0x2073('0x51')]};var _0x1ed586=_0x2073('0x52');var _0xaf5d59=_0x2073('0x53');_0x2ba55a[_0x2073('0x54')]=intUtil['stripTrailingSlash'](_0x2ba55a[_0x2073('0x54')]);_0x2ba55a[_0x2073('0x55')]=intUtil[_0x2073('0x56')](_0x2ba55a['serverUrl']);var _0x3417d9=util['format']('%s/api/now/table/',_0x2ba55a['remoteUri']);_0x509559[_0x2073('0x11')]=!_['isNil'](_0x30786d)?_0x30786d[_0x2073('0x57')]:null;_0x509559['adminEmail']=_0x2ba55a['email'];_0x509559[_0x2073('0x1f')]=_0x4b87bf[_0x2073('0x2c')]()===_0x2073('0x36')?_0x3a841f[_0x2073('0x58')]:_0x3a841f[_0x2073('0x59')];_0x509559[_0x2073('0x5a')]=_0x4b87bf===_0x2073('0x5b')||_0x4b87bf===_0x2073('0x5c')?_0x2073('0x5b'):_0x2073('0x36');var _0x10c9eb=util[_0x2073('0x5d')](_0x2073('0x5e'),_0x2ba55a['serverUrl'],_0x3a841f['uniqueid'],md5(_0x3a841f[_0x2073('0x5f')]));if(_0x1bfe7d&&_0x1bfe7d[_0x2073('0x60')]){logger[_0x2073('0xc')](_0x2073('0x61'),_0x2073('0x62'));_0x3a841f['recordingURL']=_0x10c9eb;}else if(_0x1e01e8&&_0x1e01e8[_0x2073('0x63')]&&_0x1e01e8['recordingFormat']!==_0x2073('0x64')){logger[_0x2073('0xc')]('[OUTBOUND]',_0x2073('0x62'));_0x3a841f[_0x2073('0x65')]=_0x10c9eb;}else{_0x3a841f[_0x2073('0x65')]='';}return getAdminUser(_0x4b87bf,_0x323678,_0x509559,_0x3417d9,_0xaf5d59,_0x1ed586)[_0x2073('0x8')](getUser(_0x4b87bf,_0x323678,_0x3417d9,_0xaf5d59,_0x1ed586))[_0x2073('0x8')](getEndUser(_0x4b87bf,_0x323678,_0x3417d9,_0xaf5d59,_0x1ed586))[_0x2073('0x8')](getTicket(_0x4b87bf,_0x323678,_0x3417d9,_0x4d007e,_0x3a841f,_0xaf5d59))[_0x2073('0x8')](function(_0x23567d){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x23567d['ticketId']));logger[_0x2073('0xc')](util[_0x2073('0x5d')]('call\x20direction:\x20%s',_0x4b87bf));if(_0x4b87bf!=='unmanaged'){logger[_0x2073('0xc')]('['+[_0x4b87bf[_0x2073('0xd')]()]+']',_0x2073('0x66'));emit(_0x2ba55a['remoteUri'],_0x30786d[_0x2073('0x34')],_0x23567d['ticketId']);}})['catch'](function(_0x38e126){logger['error']('['+[_0x4b87bf[_0x2073('0xd')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x2073('0x67')](_0x38e126,{'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 507b43b..5d5d68b 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 _0x7859=['find','value','resolve','name_value_list','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','','debug','[HTTP]','map','type','customField','nameField','content','string','custom_fields','toString','variable','customVariable','Variable','toLowerCase','login','username','PLAIN','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','uri','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','users','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','unmanaged','%s/service/v4_1/rest.php','Ticket\x20created!','lastevent','toUpperCase','lodash','request-promise','util','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','date_start','slice','replace','duration_hours','duration_minutes','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','stringify','isNil','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list'];(function(_0x3db8c5,_0x54c852){var _0x50e30a=function(_0x2d8760){while(--_0x2d8760){_0x3db8c5['push'](_0x3db8c5['shift']());}};_0x50e30a(++_0x54c852);}(_0x7859,0x1a3));var _0x9785=function(_0x19b938,_0x43144a){_0x19b938=_0x19b938-0x0;var _0x12a737=_0x7859[_0x19b938];return _0x12a737;};'use strict';var _=require(_0x9785('0x0'));var rp=require(_0x9785('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x9785('0x2'));var Redis=require(_0x9785('0x3'));var intUtil=require(_0x9785('0x4'));var config=require(_0x9785('0x5'));var logger=require(_0x9785('0x6'))('sugarcrm');config[_0x9785('0x7')]=_[_0x9785('0x8')](config['redis'],{'host':_0x9785('0x9'),'port':0x18eb});var io=require(_0x9785('0xa'))(new Redis(config[_0x9785('0x7')]));var def={'method':_0x9785('0xb'),'json':!![]};function emit(_0x1dbdb9,_0x2d2115,_0x5b6009){io['to'](_0x1dbdb9)[_0x9785('0xc')](_0x2d2115,_0x5b6009);}function getTicket(_0x281a48,_0x160345,_0x437980,_0x6f7412,_0x4c443b,_0x443885,_0x65e285,_0x23f928){logger[_0x9785('0xd')](_0x9785('0xe'));var _0x6b52a7=new Date();var _0x34fd86=[{'name':_0x9785('0xf'),'value':intUtil[_0x9785('0x10')](_0x6f7412[_0x9785('0x11')],_0x4c443b,'\x20')},{'name':_0x9785('0x12'),'value':_0x160345['id']},{'name':_0x9785('0x13'),'value':_0x160345['id']},{'name':_0x9785('0x14'),'value':intUtil[_0x9785('0x10')](_0x6f7412[_0x9785('0x15')],_0x4c443b,'\x0a')},{'name':_0x9785('0x16'),'value':_0x6b52a7['toISOString']()[_0x9785('0x17')](0x0,0x13)[_0x9785('0x18')]('T','\x20')},{'name':_0x9785('0x19'),'value':'0'},{'name':_0x9785('0x1a'),'value':'15'},{'name':'parent_id','value':_0x437980['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x9785('0x1b'),'value':_0x437980['name']},{'name':_0x9785('0x1c'),'value':_0x23f928}];if(_0x443885[_0x9785('0x1d')]){_[_0x9785('0x1e')](_0x443885,function(_0x5f20ec){if(_0x4c443b[_0x5f20ec[_0x9785('0x1f')]]){_0x34fd86[_0x9785('0x20')]({'name':_0x5f20ec[_0x9785('0x21')],'value':_0x4c443b[_0x5f20ec[_0x9785('0x1f')]]});}});}return request({'form':{'method':_0x9785('0x22'),'input_type':_0x9785('0x23'),'response_type':_0x9785('0x23'),'rest_data':JSON['stringify']({'session':_0x65e285['id'],'module_name':_0x9785('0x24'),'name_value_list':_0x34fd86})}});}function getAuth(_0x3dc8cb){return util[_0x9785('0x25')](_0x9785('0x26'),new Buffer(_0x3dc8cb[_0x9785('0x27')]+':X')['toString'](_0x9785('0x28')));}function getServerInfo(_0x4cbe89){return request({'form':{'method':_0x9785('0x29'),'input_type':'JSON','response_type':_0x9785('0x23'),'rest_data':JSON[_0x9785('0x2a')]({'session':_0x4cbe89['id']})}});}function getUser(_0x38a078,_0x53627a,_0x3f487d){if(!_[_0x9785('0x2b')](_0x53627a)){logger[_0x9785('0xd')]('Getting\x20agent\x20with\x20name',_0x53627a);return request({'form':{'method':_0x9785('0x2c'),'input_type':_0x9785('0x23'),'response_type':_0x9785('0x23'),'rest_data':JSON[_0x9785('0x2a')]({'session':_0x3f487d['id'],'module_name':'Employees','query':util['format'](_0x9785('0x2d'),_0x53627a),'order_by':'','offset':'0','select_fields':['id',_0x9785('0xf'),_0x9785('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9785('0x2f')](function(_0x369701){if(_0x369701[_0x9785('0x30')]['length']){var _0x15a33e=_[_0x9785('0x31')](_0x369701[_0x9785('0x30')],function(_0x2e33f5){return _0x2e33f5['name_value_list']['user_name'][_0x9785('0x32')]===_0x53627a;});if(_0x15a33e){logger[_0x9785('0xd')]('Agent\x20found!');return BPromise[_0x9785('0x33')]({'id':_0x15a33e['name_value_list']['id'][_0x9785('0x32')],'name':_0x15a33e[_0x9785('0x34')]['name']['value']});}}logger[_0x9785('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9785('0x33')]({'id':_0x3f487d[_0x9785('0x34')]['user_id'][_0x9785('0x32')],'name':_0x3f487d[_0x9785('0x34')][_0x9785('0x2e')][_0x9785('0x32')]});});}else{logger['info'](_0x9785('0x35'));return BPromise[_0x9785('0x33')]({'id':_0x3f487d['name_value_list'][_0x9785('0x36')][_0x9785('0x32')],'name':_0x3f487d[_0x9785('0x34')]['user_name'][_0x9785('0x32')]});}}function getEndUser(_0x218235,_0x398ac8,_0x5542fd,_0x37d6d7){logger[_0x9785('0xd')](_0x9785('0x37'),_0x5542fd);return request({'form':{'method':'get_entry_list','input_type':_0x9785('0x23'),'response_type':_0x9785('0x23'),'rest_data':JSON[_0x9785('0x2a')]({'session':_0x37d6d7['id'],'module_name':_0x9785('0x38'),'query':util[_0x9785('0x25')](_0x9785('0x39'),_0x5542fd),'order_by':'','offset':'0','select_fields':['id',_0x9785('0xf'),_0x9785('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x98e2db){if(_0x98e2db[_0x9785('0x30')][_0x9785('0x1d')]){var _0x4c6730=_[_0x9785('0x31')](_0x98e2db[_0x9785('0x30')],function(_0x240d2d){return _0x240d2d[_0x9785('0x34')][_0x9785('0x3a')]['value']===_0x5542fd;});if(_0x4c6730){logger['info'](_0x9785('0x3b'));return BPromise[_0x9785('0x33')]({'id':_0x4c6730[_0x9785('0x34')]['id'][_0x9785('0x32')],'name':_0x4c6730[_0x9785('0x34')][_0x9785('0xf')]['value'],'phone':_0x4c6730[_0x9785('0x34')][_0x9785('0x3a')][_0x9785('0x32')]});}}else{logger[_0x9785('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x9785('0x22'),'input_type':_0x9785('0x23'),'response_type':'JSON','rest_data':JSON[_0x9785('0x2a')]({'session':_0x37d6d7['id'],'module_name':_0x9785('0x38'),'name_value_list':[{'name':_0x9785('0x3c'),'value':_0x398ac8!==_0x9785('0x3d')?_0x398ac8:util[_0x9785('0x25')]('Caller\x20-\x20%s',_0x5542fd)},{'name':_0x9785('0x3a'),'value':_0x5542fd}]})}})[_0x9785('0x2f')](function(_0x171c41){logger[_0x9785('0xd')]('Enduser\x20created.');return BPromise[_0x9785('0x33')]({'id':_0x171c41['id'],'name':_0x171c41[_0x9785('0x30')][_0x9785('0x3c')][_0x9785('0x32')],'phone':_0x171c41[_0x9785('0x30')][_0x9785('0x3a')][_0x9785('0x32')]});});}});}function request(_0x549925){logger[_0x9785('0x3e')](_0x9785('0x3f'),JSON[_0x9785('0x2a')](_0x549925));return rp(_['merge'](def,_0x549925));}function getTags(_0x317c00,_0x38d8ad){var _0x2c261b=[];if(_0x317c00&&_0x317c00[_0x9785('0x1d')]>0x0){_0x2c261b=_[_0x9785('0x40')](_0x317c00,_0x38d8ad);}return _0x2c261b;}function getCustomFields(_0x176161,_0x5b45fd){var _0x1388ff=[];var _0x40769d={'custom_fields':[]};if(_0x176161[_0x9785('0x1d')]>0x0){_['forEach'](_0x176161,function(_0xd3b619){if(_0xd3b619[_0x9785('0x41')]==='string'&&_0xd3b619['nameField']&&!_0xd3b619[_0x9785('0x42')]){_0x40769d[_0xd3b619[_0x9785('0x43')]['toLowerCase']()]=_0xd3b619[_0x9785('0x44')]['toString']();}else if(_0xd3b619[_0x9785('0x41')]===_0x9785('0x45')&&_0xd3b619[_0x9785('0x21')]&&_0xd3b619['customField']){_0x40769d[_0x9785('0x46')][_0x9785('0x20')]({'id':_0xd3b619['idField'],'value':_0xd3b619[_0x9785('0x44')][_0x9785('0x47')]()});}else if(_0xd3b619[_0x9785('0x41')]===_0x9785('0x48')&&_0xd3b619[_0x9785('0x1f')]&&_0xd3b619[_0x9785('0x21')]&&_0xd3b619['customField']){_0x5b45fd[_0xd3b619[_0x9785('0x1f')]]&&_0x40769d[_0x9785('0x46')][_0x9785('0x20')]({'id':_0xd3b619[_0x9785('0x21')],'value':_0x5b45fd[_0xd3b619['variableName']][_0x9785('0x47')]()});}else if(_0xd3b619[_0x9785('0x41')]===_0x9785('0x49')&&_0xd3b619[_0x9785('0x4a')]&&_0xd3b619['Variable']['name']&&_0xd3b619[_0x9785('0x21')]&&_0xd3b619[_0x9785('0x42')]){_0x5b45fd[_0xd3b619[_0x9785('0x4a')]['name'][_0x9785('0x4b')]()]&&_0x40769d[_0x9785('0x46')][_0x9785('0x20')]({'id':_0xd3b619['idField'],'value':_0x5b45fd[_0xd3b619[_0x9785('0x4a')][_0x9785('0xf')][_0x9785('0x4b')]()][_0x9785('0x47')]()});}});}return _0x40769d;}function getConnection(_0x3a4582){return request({'method':'POST','form':{'method':_0x9785('0x4c'),'input_type':'JSON','response_type':_0x9785('0x23'),'rest_data':JSON[_0x9785('0x2a')]({'user_auth':{'user_name':_0x3a4582[_0x9785('0x4d')],'password':_0x3a4582['password'],'encryption':_0x9785('0x4e')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x9785('0x2f')](function(_0xb56506){var _0x5c81aa=_0xb56506;if(_0x5c81aa['id']){def['sessionID']=_0x5c81aa['id'];return BPromise[_0x9785('0x33')](_0x5c81aa);}else{throw new Error(util[_0x9785('0x25')](_0x9785('0x4f'),_0x3a4582['id']));}});}function setRelationship(_0x253bbf,_0x33db3b,_0x950499,_0x56d4ba){return request({'form':{'method':'set_relationship','input_type':_0x9785('0x23'),'response_type':'JSON','rest_data':JSON[_0x9785('0x2a')]({'session':_0x253bbf['id'],'module_name':_0x9785('0x24'),'module_id':_0x950499['id'],'link_field_name':_0x56d4ba,'related_ids':[_0x33db3b['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x2c4713,_0x330895,_0xe81626,_0x5e5789,_0x574c7e,_0x16d03d){var _0xf0ed6c,_0x65c02d,_0x35fad7,_0x3e7240;_0x16d03d[_0x9785('0x50')]=intUtil[_0x9785('0x51')](_0x16d03d[_0x9785('0x50')]);_0x16d03d[_0x9785('0x52')]=intUtil[_0x9785('0x51')](_0x16d03d['serverUrl']);def['uri']=util[_0x9785('0x25')]('%s/service/v4_1/rest.php',_0x16d03d['remoteUri']);if(_0x574c7e&&_0x574c7e[_0x9785('0x53')]){logger['info'](_0x9785('0x54'),_0x9785('0x55'));_0x330895[_0x9785('0x56')]=util[_0x9785('0x25')](_0x9785('0x57'),_0x16d03d[_0x9785('0x52')],_0x330895[_0x9785('0x58')],md5(_0x330895[_0x9785('0x58')]));}else{_0x330895[_0x9785('0x56')]='';}return getConnection(_0x16d03d)[_0x9785('0x2f')](function(_0x255c65){_0x3e7240=_0x255c65;return getUser(_0x16d03d,_0x5e5789['name'],_0x3e7240);})[_0x9785('0x2f')](function(_0x300112){_0xf0ed6c=_0x300112;logger[_0x9785('0xd')](_0x9785('0x59'),_0xf0ed6c['id']);return getEndUser(_0x16d03d,_0x330895[_0x9785('0x5a')],_0x330895[_0x9785('0x5b')],_0x3e7240);})[_0x9785('0x2f')](function(_0x2f96ef){_0x65c02d=_0x2f96ef;logger[_0x9785('0xd')]('The\x20Enduser\x20ID\x20is:',_0x65c02d['id']);return getTicket(_0x16d03d,_0xf0ed6c,_0x65c02d,_0xe81626,_0x330895,_0xe81626[_0x9785('0x5c')],_0x3e7240,_0x9785('0x5d'));})[_0x9785('0x2f')](function(_0x2301ea){_0x35fad7=_0x2301ea;logger['info']('Ticket\x20created!');logger[_0x9785('0xd')]('The\x20Ticket\x20ID\x20is:',_0x35fad7['id']);return setRelationship(_0x3e7240,_0xf0ed6c,_0x35fad7,'users');})[_0x9785('0x2f')](function(){return setRelationship(_0x3e7240,_0x65c02d,_0x35fad7,_0x9785('0x5e'));})['then'](function(){return getServerInfo(_0x3e7240);})[_0x9785('0x2f')](function(_0x5e88f5){var _0x8c5504=parseInt(_0x5e88f5[_0x9785('0x5f')]['charAt'](0x0));var _0x4f0879=util[_0x9785('0x25')](_0x9785('0x60'),_0x16d03d[_0x9785('0x50')],_0x35fad7['id']);if(_0x8c5504>0x6){_0x4f0879=util[_0x9785('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x16d03d[_0x9785('0x50')],_0x35fad7['id']);}logger['info'](_0x9785('0x54'),_0x9785('0x61'));emit(util[_0x9785('0x25')](_0x9785('0x62'),_0x5e5789['name']),_0x9785('0x63'),{'uri':_0x4f0879});})[_0x9785('0x64')](function(_0x1377d6){logger['error'](_0x9785('0x54'),JSON[_0x9785('0x2a')](_0x1377d6));});};exports['outbound']=function(_0x235a45,_0x1c2bf5,_0x4b2bbe,_0x55a66b,_0xf4105e,_0x1fd446,_0x3aaae1){var _0x3fbbfa,_0x3e27e7,_0x54fee8,_0x5ead19;_0x1fd446[_0x9785('0x50')]=intUtil[_0x9785('0x51')](_0x1fd446[_0x9785('0x50')]);_0x1fd446[_0x9785('0x52')]=intUtil[_0x9785('0x51')](_0x1fd446[_0x9785('0x52')]);def[_0x9785('0x65')]=util[_0x9785('0x25')]('%s/service/v4_1/rest.php',_0x1fd446[_0x9785('0x50')]);if(_0x3aaae1&&_0x3aaae1[_0x9785('0x66')]&&_0x3aaae1[_0x9785('0x66')]!==_0x9785('0x67')){logger[_0x9785('0xd')](_0x9785('0x68'),'Recording\x20is\x20enabled!');_0x1c2bf5[_0x9785('0x56')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1fd446[_0x9785('0x52')],_0x1c2bf5[_0x9785('0x58')],md5(_0x1c2bf5[_0x9785('0x58')]));}return getConnection(_0x1fd446)[_0x9785('0x2f')](function(_0xf7163){_0x5ead19=_0xf7163;return getUser(_0x1fd446,_0x55a66b['name'],_0x5ead19);})[_0x9785('0x2f')](function(_0x59173d){_0x3fbbfa=_0x59173d;logger[_0x9785('0xd')](_0x9785('0x59'),_0x3fbbfa['id']);return getEndUser(_0x1fd446,_0x1c2bf5['destcalleridname'],_0x1c2bf5[_0x9785('0x69')],_0x5ead19);})[_0x9785('0x2f')](function(_0x1d44cb){_0x3e27e7=_0x1d44cb;logger[_0x9785('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3e27e7['id']);return getTicket(_0x1fd446,_0x3fbbfa,_0x3e27e7,_0x4b2bbe,_0x1c2bf5,_0x4b2bbe[_0x9785('0x5c')],_0x5ead19,_0x9785('0x6a'));})[_0x9785('0x2f')](function(_0x52a245){_0x54fee8=_0x52a245;logger[_0x9785('0xd')]('Ticket\x20created!');logger[_0x9785('0xd')](_0x9785('0x6b'),_0x54fee8['id']);return setRelationship(_0x5ead19,_0x3fbbfa,_0x54fee8,_0x9785('0x6c'));})[_0x9785('0x2f')](function(){return setRelationship(_0x5ead19,_0x3e27e7,_0x54fee8,_0x9785('0x5e'));})[_0x9785('0x2f')](function(){return getServerInfo(_0x5ead19);})['then'](function(_0x5c48a5){var _0x17f2f6=parseInt(_0x5c48a5[_0x9785('0x5f')][_0x9785('0x6d')](0x0));var _0x276a96=util[_0x9785('0x25')](_0x9785('0x60'),_0x1fd446['remoteUri'],_0x54fee8['id']);if(_0x17f2f6>0x6){_0x276a96=util['format'](_0x9785('0x6e'),_0x1fd446[_0x9785('0x50')],_0x54fee8['id']);}logger[_0x9785('0xd')](_0x9785('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x9785('0x62'),_0x55a66b[_0x9785('0xf')]),_0x9785('0x63'),{'uri':_0x276a96});})['catch'](function(_0x459a75){logger[_0x9785('0x6f')]('[OUTBOUND]',JSON[_0x9785('0x2a')](_0x459a75));});};exports[_0x9785('0x70')]=function(_0x116978,_0xdd5571,_0x1b5c2a,_0x2cde79,_0x14ecbd,_0x530dcf){var _0x2fe240,_0x3df531,_0x10c145,_0x2c898e;_0x530dcf[_0x9785('0x50')]=intUtil['stripTrailingSlash'](_0x530dcf[_0x9785('0x50')]);_0x530dcf['serverUrl']=intUtil['stripTrailingSlash'](_0x530dcf[_0x9785('0x52')]);def[_0x9785('0x65')]=util[_0x9785('0x25')](_0x9785('0x71'),_0x530dcf['remoteUri']);if(_0x14ecbd&&_0x14ecbd['monitor_format']){logger[_0x9785('0xd')]('['+_0xdd5571['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0xdd5571['recordingURL']=util[_0x9785('0x25')](_0x9785('0x57'),_0x530dcf['serverUrl'],_0xdd5571[_0x9785('0x58')],md5(_0xdd5571[_0x9785('0x58')]));}else{_0xdd5571['recordingURL']='';}return getConnection(_0x530dcf)[_0x9785('0x2f')](function(_0x5c27c6){_0x2c898e=_0x5c27c6;if(!_[_0x9785('0x2b')](_0x2cde79)){return getUser(_0x530dcf,_0x2cde79[_0x9785('0xf')],_0x2c898e);}else{return getUser(_0x530dcf,null,_0x2c898e);}})[_0x9785('0x2f')](function(_0x3fb28d){_0x2fe240=_0x3fb28d;logger[_0x9785('0xd')](_0x9785('0x59'),_0x2fe240['id']);return getEndUser(_0x530dcf,_0xdd5571[_0x9785('0x5a')],_0xdd5571['calleridnum'],_0x2c898e);})['then'](function(_0x38e46f){_0x3df531=_0x38e46f;logger[_0x9785('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3df531['id']);return getTicket(_0x530dcf,_0x2fe240,_0x3df531,_0x1b5c2a,_0xdd5571,_0x1b5c2a['Fields'],_0x2c898e,'Inbound');})['then'](function(_0x2dd30d){_0x10c145=_0x2dd30d;logger['info'](_0x9785('0x72'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x10c145['id']);return setRelationship(_0x2c898e,_0x2fe240,_0x10c145,_0x9785('0x6c'));})[_0x9785('0x2f')](function(){return setRelationship(_0x2c898e,_0x3df531,_0x10c145,_0x9785('0x5e'));})[_0x9785('0x2f')](function(){return getServerInfo(_0x2c898e);})[_0x9785('0x64')](function(_0x321b6c){logger[_0x9785('0x6f')]('['+_0xdd5571[_0x9785('0x73')][_0x9785('0x74')]()+']',JSON[_0x9785('0x2a')](_0x321b6c));});}; \ No newline at end of file +var _0x6c31=['remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','contacts','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum','Fields','lodash','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','content','custom_fields','toString','variable','Variable','toLowerCase','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','stripTrailingSlash'];(function(_0x2660aa,_0x4b4e74){var _0x4f4d32=function(_0x431725){while(--_0x431725){_0x2660aa['push'](_0x2660aa['shift']());}};_0x4f4d32(++_0x4b4e74);}(_0x6c31,0x19a));var _0x16c3=function(_0x4201de,_0x43ac07){_0x4201de=_0x4201de-0x0;var _0x3fef97=_0x6c31[_0x4201de];return _0x3fef97;};'use strict';var _=require(_0x16c3('0x0'));var rp=require('request-promise');var BPromise=require(_0x16c3('0x1'));var md5=require(_0x16c3('0x2'));var util=require(_0x16c3('0x3'));var Redis=require(_0x16c3('0x4'));var intUtil=require('./util');var config=require(_0x16c3('0x5'));var logger=require(_0x16c3('0x6'))(_0x16c3('0x7'));config[_0x16c3('0x8')]=_[_0x16c3('0x9')](config['redis'],{'host':_0x16c3('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16c3('0x8')]));var def={'method':_0x16c3('0xb'),'json':!![]};function emit(_0x52f41b,_0x16970d,_0x51706a){io['to'](_0x52f41b)['emit'](_0x16970d,_0x51706a);}function getTicket(_0x4799fb,_0x9d9316,_0x13bd58,_0x5ad295,_0x437f59,_0x2d8d7a,_0x53a5ec,_0x1ec09e){logger[_0x16c3('0xc')](_0x16c3('0xd'));var _0x8662c3=new Date();var _0x390988=[{'name':_0x16c3('0xe'),'value':intUtil[_0x16c3('0xf')](_0x5ad295['Subjects'],_0x437f59,'\x20')},{'name':_0x16c3('0x10'),'value':_0x9d9316['id']},{'name':_0x16c3('0x11'),'value':_0x9d9316['id']},{'name':_0x16c3('0x12'),'value':intUtil['getString'](_0x5ad295[_0x16c3('0x13')],_0x437f59,'\x0a')},{'name':'date_start','value':_0x8662c3[_0x16c3('0x14')]()[_0x16c3('0x15')](0x0,0x13)[_0x16c3('0x16')]('T','\x20')},{'name':_0x16c3('0x17'),'value':'0'},{'name':_0x16c3('0x18'),'value':'15'},{'name':_0x16c3('0x19'),'value':_0x13bd58['id']},{'name':_0x16c3('0x1a'),'value':_0x16c3('0x1b')},{'name':_0x16c3('0x1c'),'value':_0x13bd58[_0x16c3('0xe')]},{'name':_0x16c3('0x1d'),'value':_0x1ec09e}];if(_0x2d8d7a[_0x16c3('0x1e')]){_[_0x16c3('0x1f')](_0x2d8d7a,function(_0x39795c){if(_0x437f59[_0x39795c[_0x16c3('0x20')]]){_0x390988[_0x16c3('0x21')]({'name':_0x39795c[_0x16c3('0x22')],'value':_0x437f59[_0x39795c['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x16c3('0x23'),'rest_data':JSON[_0x16c3('0x24')]({'session':_0x53a5ec['id'],'module_name':_0x16c3('0x25'),'name_value_list':_0x390988})}});}function getAuth(_0x20781d){return util[_0x16c3('0x26')](_0x16c3('0x27'),new Buffer(_0x20781d[_0x16c3('0x28')]+':X')['toString'](_0x16c3('0x29')));}function getServerInfo(_0x125012){return request({'form':{'method':_0x16c3('0x2a'),'input_type':'JSON','response_type':_0x16c3('0x23'),'rest_data':JSON[_0x16c3('0x24')]({'session':_0x125012['id']})}});}function getUser(_0x1864b6,_0x145fda,_0x434f21){if(!_[_0x16c3('0x2b')](_0x145fda)){logger['info'](_0x16c3('0x2c'),_0x145fda);return request({'form':{'method':'get_entry_list','input_type':_0x16c3('0x23'),'response_type':_0x16c3('0x23'),'rest_data':JSON[_0x16c3('0x24')]({'session':_0x434f21['id'],'module_name':_0x16c3('0x2d'),'query':util[_0x16c3('0x26')](_0x16c3('0x2e'),_0x145fda),'order_by':'','offset':'0','select_fields':['id',_0x16c3('0xe'),_0x16c3('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x259718){if(_0x259718[_0x16c3('0x30')]['length']){var _0x3b7d64=_['find'](_0x259718[_0x16c3('0x30')],function(_0x5996d7){return _0x5996d7[_0x16c3('0x31')][_0x16c3('0x2f')][_0x16c3('0x32')]===_0x145fda;});if(_0x3b7d64){logger['info'](_0x16c3('0x33'));return BPromise[_0x16c3('0x34')]({'id':_0x3b7d64[_0x16c3('0x31')]['id'][_0x16c3('0x32')],'name':_0x3b7d64[_0x16c3('0x31')][_0x16c3('0xe')][_0x16c3('0x32')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x16c3('0x34')]({'id':_0x434f21[_0x16c3('0x31')][_0x16c3('0x35')][_0x16c3('0x32')],'name':_0x434f21['name_value_list'][_0x16c3('0x2f')]['value']});});}else{logger[_0x16c3('0xc')](_0x16c3('0x36'));return BPromise[_0x16c3('0x34')]({'id':_0x434f21['name_value_list']['user_id'][_0x16c3('0x32')],'name':_0x434f21[_0x16c3('0x31')][_0x16c3('0x2f')][_0x16c3('0x32')]});}}function getEndUser(_0x34fd16,_0x33e0ac,_0x2efa8f,_0x3a2322){logger['info'](_0x16c3('0x37'),_0x2efa8f);return request({'form':{'method':_0x16c3('0x38'),'input_type':_0x16c3('0x23'),'response_type':_0x16c3('0x23'),'rest_data':JSON[_0x16c3('0x24')]({'session':_0x3a2322['id'],'module_name':'Contacts','query':util[_0x16c3('0x26')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x2efa8f),'order_by':'','offset':'0','select_fields':['id',_0x16c3('0xe'),_0x16c3('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x16c3('0x3a')](function(_0x2eab87){if(_0x2eab87[_0x16c3('0x30')]['length']){var _0xe1aaea=_[_0x16c3('0x3b')](_0x2eab87[_0x16c3('0x30')],function(_0x494a62){return _0x494a62[_0x16c3('0x31')][_0x16c3('0x39')][_0x16c3('0x32')]===_0x2efa8f;});if(_0xe1aaea){logger[_0x16c3('0xc')](_0x16c3('0x3c'));return BPromise['resolve']({'id':_0xe1aaea[_0x16c3('0x31')]['id']['value'],'name':_0xe1aaea['name_value_list'][_0x16c3('0xe')][_0x16c3('0x32')],'phone':_0xe1aaea[_0x16c3('0x31')][_0x16c3('0x39')][_0x16c3('0x32')]});}}else{logger[_0x16c3('0xc')](_0x16c3('0x3d'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x16c3('0x24')]({'session':_0x3a2322['id'],'module_name':_0x16c3('0x1b'),'name_value_list':[{'name':_0x16c3('0x3e'),'value':_0x33e0ac!==''?_0x33e0ac:util[_0x16c3('0x26')](_0x16c3('0x3f'),_0x2efa8f)},{'name':_0x16c3('0x39'),'value':_0x2efa8f}]})}})['then'](function(_0xb36afe){logger[_0x16c3('0xc')](_0x16c3('0x40'));return BPromise['resolve']({'id':_0xb36afe['id'],'name':_0xb36afe[_0x16c3('0x30')][_0x16c3('0x3e')]['value'],'phone':_0xb36afe[_0x16c3('0x30')][_0x16c3('0x39')]['value']});});}});}function request(_0x3ad070){logger[_0x16c3('0x41')](_0x16c3('0x42'),JSON[_0x16c3('0x24')](_0x3ad070));return rp(_[_0x16c3('0x43')](def,_0x3ad070));}function getTags(_0x3714c8,_0x1941c7){var _0xf2bf61=[];if(_0x3714c8&&_0x3714c8[_0x16c3('0x1e')]>0x0){_0xf2bf61=_[_0x16c3('0x44')](_0x3714c8,_0x1941c7);}return _0xf2bf61;}function getCustomFields(_0x30530b,_0x3d1542){var _0x1c1cb2=[];var _0x1b9610={'custom_fields':[]};if(_0x30530b[_0x16c3('0x1e')]>0x0){_[_0x16c3('0x1f')](_0x30530b,function(_0x5f99b6){if(_0x5f99b6[_0x16c3('0x45')]===_0x16c3('0x46')&&_0x5f99b6[_0x16c3('0x47')]&&!_0x5f99b6[_0x16c3('0x48')]){_0x1b9610[_0x5f99b6[_0x16c3('0x47')]['toLowerCase']()]=_0x5f99b6[_0x16c3('0x49')]['toString']();}else if(_0x5f99b6[_0x16c3('0x45')]==='string'&&_0x5f99b6[_0x16c3('0x22')]&&_0x5f99b6['customField']){_0x1b9610[_0x16c3('0x4a')][_0x16c3('0x21')]({'id':_0x5f99b6[_0x16c3('0x22')],'value':_0x5f99b6['content'][_0x16c3('0x4b')]()});}else if(_0x5f99b6[_0x16c3('0x45')]===_0x16c3('0x4c')&&_0x5f99b6['variableName']&&_0x5f99b6[_0x16c3('0x22')]&&_0x5f99b6[_0x16c3('0x48')]){_0x3d1542[_0x5f99b6[_0x16c3('0x20')]]&&_0x1b9610[_0x16c3('0x4a')][_0x16c3('0x21')]({'id':_0x5f99b6[_0x16c3('0x22')],'value':_0x3d1542[_0x5f99b6[_0x16c3('0x20')]]['toString']()});}else if(_0x5f99b6[_0x16c3('0x45')]==='customVariable'&&_0x5f99b6['Variable']&&_0x5f99b6['Variable'][_0x16c3('0xe')]&&_0x5f99b6[_0x16c3('0x22')]&&_0x5f99b6['customField']){_0x3d1542[_0x5f99b6[_0x16c3('0x4d')]['name'][_0x16c3('0x4e')]()]&&_0x1b9610[_0x16c3('0x4a')][_0x16c3('0x21')]({'id':_0x5f99b6[_0x16c3('0x22')],'value':_0x3d1542[_0x5f99b6[_0x16c3('0x4d')]['name'][_0x16c3('0x4e')]()][_0x16c3('0x4b')]()});}});}return _0x1b9610;}function getConnection(_0x11c24a){return request({'method':_0x16c3('0xb'),'form':{'method':'login','input_type':_0x16c3('0x23'),'response_type':_0x16c3('0x23'),'rest_data':JSON[_0x16c3('0x24')]({'user_auth':{'user_name':_0x11c24a[_0x16c3('0x4f')],'password':_0x11c24a['password'],'encryption':_0x16c3('0x50')},'application':_0x16c3('0x51')})}})[_0x16c3('0x3a')](function(_0x4a5e84){var _0x592a0d=_0x4a5e84;if(_0x592a0d['id']){def[_0x16c3('0x52')]=_0x592a0d['id'];return BPromise['resolve'](_0x592a0d);}else{throw new Error(util[_0x16c3('0x26')](_0x16c3('0x53'),_0x11c24a['id']));}});}function setRelationship(_0x586566,_0x5de17a,_0x24390b,_0x4ba9a8){return request({'form':{'method':_0x16c3('0x54'),'input_type':_0x16c3('0x23'),'response_type':'JSON','rest_data':JSON[_0x16c3('0x24')]({'session':_0x586566['id'],'module_name':_0x16c3('0x25'),'module_id':_0x24390b['id'],'link_field_name':_0x4ba9a8,'related_ids':[_0x5de17a['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x46b5b2,_0x4044cf,_0x5e3edf,_0xe4b42b,_0x3c9d95,_0x2d5c6a){var _0x4ea108,_0x475438,_0x11b94b,_0x1920cc;_0x2d5c6a['remoteUri']=intUtil[_0x16c3('0x55')](_0x2d5c6a[_0x16c3('0x56')]);_0x2d5c6a[_0x16c3('0x57')]=intUtil[_0x16c3('0x55')](_0x2d5c6a[_0x16c3('0x57')]);def[_0x16c3('0x58')]=util[_0x16c3('0x26')](_0x16c3('0x59'),_0x2d5c6a[_0x16c3('0x56')]);if(_0x3c9d95&&_0x3c9d95[_0x16c3('0x5a')]){logger[_0x16c3('0xc')](_0x16c3('0x5b'),'Recording\x20is\x20enabled!');_0x4044cf[_0x16c3('0x5c')]=util[_0x16c3('0x26')](_0x16c3('0x5d'),_0x2d5c6a[_0x16c3('0x57')],_0x4044cf[_0x16c3('0x5e')],md5(_0x4044cf['uniqueid']));}else{_0x4044cf[_0x16c3('0x5c')]='';}return getConnection(_0x2d5c6a)['then'](function(_0x474dae){_0x1920cc=_0x474dae;return getUser(_0x2d5c6a,_0xe4b42b[_0x16c3('0xe')],_0x1920cc);})[_0x16c3('0x3a')](function(_0x53f550){_0x4ea108=_0x53f550;logger['info']('The\x20User\x20ID\x20is:',_0x4ea108['id']);return getEndUser(_0x2d5c6a,_0x4044cf[_0x16c3('0x5f')],_0x4044cf['calleridnum'],_0x1920cc);})[_0x16c3('0x3a')](function(_0x3371e7){_0x475438=_0x3371e7;logger['info'](_0x16c3('0x60'),_0x475438['id']);return getTicket(_0x2d5c6a,_0x4ea108,_0x475438,_0x5e3edf,_0x4044cf,_0x5e3edf['Fields'],_0x1920cc,_0x16c3('0x61'));})[_0x16c3('0x3a')](function(_0x3df23a){_0x11b94b=_0x3df23a;logger[_0x16c3('0xc')](_0x16c3('0x62'));logger['info'](_0x16c3('0x63'),_0x11b94b['id']);return setRelationship(_0x1920cc,_0x4ea108,_0x11b94b,_0x16c3('0x64'));})[_0x16c3('0x3a')](function(){return setRelationship(_0x1920cc,_0x475438,_0x11b94b,'contacts');})[_0x16c3('0x3a')](function(){return getServerInfo(_0x1920cc);})['then'](function(_0x1e49b0){var _0x58b6cd=parseInt(_0x1e49b0[_0x16c3('0x65')][_0x16c3('0x66')](0x0));var _0x55ee1f=util[_0x16c3('0x26')](_0x16c3('0x67'),_0x2d5c6a[_0x16c3('0x56')],_0x11b94b['id']);if(_0x58b6cd>0x6){_0x55ee1f=util[_0x16c3('0x26')](_0x16c3('0x68'),_0x2d5c6a[_0x16c3('0x56')],_0x11b94b['id']);}logger[_0x16c3('0xc')](_0x16c3('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x16c3('0x26')](_0x16c3('0x69'),_0xe4b42b[_0x16c3('0xe')]),_0x16c3('0x6a'),{'uri':_0x55ee1f});})['catch'](function(_0x2929b0){logger['error'](_0x16c3('0x5b'),JSON[_0x16c3('0x24')](_0x2929b0));});};exports[_0x16c3('0x6b')]=function(_0x1b3b88,_0x46a1dd,_0x22d504,_0x2fd5e9,_0x188fa0,_0x2ad2aa,_0x513b4b){var _0x152ebd,_0x71549f,_0x3d770a,_0x3ceb17;_0x2ad2aa[_0x16c3('0x56')]=intUtil[_0x16c3('0x55')](_0x2ad2aa['remoteUri']);_0x2ad2aa[_0x16c3('0x57')]=intUtil[_0x16c3('0x55')](_0x2ad2aa[_0x16c3('0x57')]);def[_0x16c3('0x58')]=util[_0x16c3('0x26')](_0x16c3('0x59'),_0x2ad2aa[_0x16c3('0x56')]);if(_0x513b4b&&_0x513b4b['recordingFormat']&&_0x513b4b[_0x16c3('0x6c')]!==_0x16c3('0x6d')){logger[_0x16c3('0xc')](_0x16c3('0x6e'),'Recording\x20is\x20enabled!');_0x46a1dd[_0x16c3('0x5c')]=util[_0x16c3('0x26')](_0x16c3('0x5d'),_0x2ad2aa[_0x16c3('0x57')],_0x46a1dd[_0x16c3('0x5e')],md5(_0x46a1dd[_0x16c3('0x5e')]));}return getConnection(_0x2ad2aa)[_0x16c3('0x3a')](function(_0x49e141){_0x3ceb17=_0x49e141;return getUser(_0x2ad2aa,_0x2fd5e9[_0x16c3('0xe')],_0x3ceb17);})[_0x16c3('0x3a')](function(_0x5e0c96){_0x152ebd=_0x5e0c96;logger[_0x16c3('0xc')](_0x16c3('0x6f'),_0x152ebd['id']);return getEndUser(_0x2ad2aa,_0x46a1dd['destcalleridname'],_0x46a1dd[_0x16c3('0x70')],_0x3ceb17);})['then'](function(_0x57672b){_0x71549f=_0x57672b;logger['info'](_0x16c3('0x60'),_0x71549f['id']);return getTicket(_0x2ad2aa,_0x152ebd,_0x71549f,_0x22d504,_0x46a1dd,_0x22d504['Fields'],_0x3ceb17,_0x16c3('0x71'));})[_0x16c3('0x3a')](function(_0x556542){_0x3d770a=_0x556542;logger[_0x16c3('0xc')](_0x16c3('0x62'));logger['info'](_0x16c3('0x63'),_0x3d770a['id']);return setRelationship(_0x3ceb17,_0x152ebd,_0x3d770a,_0x16c3('0x64'));})[_0x16c3('0x3a')](function(){return setRelationship(_0x3ceb17,_0x71549f,_0x3d770a,_0x16c3('0x72'));})[_0x16c3('0x3a')](function(){return getServerInfo(_0x3ceb17);})[_0x16c3('0x3a')](function(_0x3013d2){var _0xa7ef73=parseInt(_0x3013d2[_0x16c3('0x65')]['charAt'](0x0));var _0x4bbee9=util[_0x16c3('0x26')](_0x16c3('0x67'),_0x2ad2aa[_0x16c3('0x56')],_0x3d770a['id']);if(_0xa7ef73>0x6){_0x4bbee9=util[_0x16c3('0x26')](_0x16c3('0x68'),_0x2ad2aa[_0x16c3('0x56')],_0x3d770a['id']);}logger[_0x16c3('0xc')](_0x16c3('0x6e'),_0x16c3('0x73'));emit(util[_0x16c3('0x26')](_0x16c3('0x69'),_0x2fd5e9['name']),_0x16c3('0x6a'),{'uri':_0x4bbee9});})[_0x16c3('0x74')](function(_0x1588c3){logger[_0x16c3('0x75')](_0x16c3('0x6e'),JSON[_0x16c3('0x24')](_0x1588c3));});};exports[_0x16c3('0x76')]=function(_0xf36a41,_0x2a1166,_0x28fd83,_0x317f8a,_0x2e00d0,_0x484e37){var _0x18dfed,_0x3d129a,_0x3721dd,_0x5e9690;_0x484e37['remoteUri']=intUtil[_0x16c3('0x55')](_0x484e37[_0x16c3('0x56')]);_0x484e37[_0x16c3('0x57')]=intUtil[_0x16c3('0x55')](_0x484e37[_0x16c3('0x57')]);def[_0x16c3('0x58')]=util[_0x16c3('0x26')](_0x16c3('0x59'),_0x484e37[_0x16c3('0x56')]);if(_0x2e00d0&&_0x2e00d0[_0x16c3('0x5a')]){logger[_0x16c3('0xc')]('['+_0x2a1166[_0x16c3('0x77')][_0x16c3('0x78')]()+']',_0x16c3('0x79'));_0x2a1166[_0x16c3('0x5c')]=util['format'](_0x16c3('0x5d'),_0x484e37[_0x16c3('0x57')],_0x2a1166[_0x16c3('0x5e')],md5(_0x2a1166[_0x16c3('0x5e')]));}else{_0x2a1166[_0x16c3('0x5c')]='';}return getConnection(_0x484e37)[_0x16c3('0x3a')](function(_0x29438c){_0x5e9690=_0x29438c;if(!_[_0x16c3('0x2b')](_0x317f8a)){return getUser(_0x484e37,_0x317f8a['name'],_0x5e9690);}else{return getUser(_0x484e37,null,_0x5e9690);}})['then'](function(_0x19756c){_0x18dfed=_0x19756c;logger[_0x16c3('0xc')](_0x16c3('0x6f'),_0x18dfed['id']);return getEndUser(_0x484e37,_0x2a1166[_0x16c3('0x5f')],_0x2a1166[_0x16c3('0x7a')],_0x5e9690);})[_0x16c3('0x3a')](function(_0x19d9ab){_0x3d129a=_0x19d9ab;logger[_0x16c3('0xc')](_0x16c3('0x60'),_0x3d129a['id']);return getTicket(_0x484e37,_0x18dfed,_0x3d129a,_0x28fd83,_0x2a1166,_0x28fd83[_0x16c3('0x7b')],_0x5e9690,_0x16c3('0x61'));})[_0x16c3('0x3a')](function(_0x39ee76){_0x3721dd=_0x39ee76;logger['info']('Ticket\x20created!');logger['info'](_0x16c3('0x63'),_0x3721dd['id']);return setRelationship(_0x5e9690,_0x18dfed,_0x3721dd,'users');})['then'](function(){return setRelationship(_0x5e9690,_0x3d129a,_0x3721dd,_0x16c3('0x72'));})[_0x16c3('0x3a')](function(){return getServerInfo(_0x5e9690);})[_0x16c3('0x74')](function(_0x49c9c8){logger[_0x16c3('0x75')]('['+_0x2a1166[_0x16c3('0x77')][_0x16c3('0x78')]()+']',JSON[_0x16c3('0x24')](_0x49c9c8));});}; \ 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 745730f..c4d12bc 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 _0xd591=['key','%s:\x20%s','keyContent','format','customVariable','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xd591,0x134));var _0x1d59=function(_0x16f903,_0x5cc7c8){_0x16f903=_0x16f903-0x0;var _0x261fad=_0xd591[_0x16f903];return _0x261fad;};'use strict';var _=require(_0x1d59('0x0'));var util=require('util');exports[_0x1d59('0x1')]=function(_0x536a36,_0x1b9329,_0xb74a06){var _0x474e8f=[];if(_0x536a36[_0x1d59('0x2')]>0x0){var _0x135243=_[_0x1d59('0x3')](_0x536a36,['id']);for(var _0x2486aa=0x0;_0x2486aa<_0x135243[_0x1d59('0x2')];_0x2486aa++){var _0x610451=_0x135243[_0x2486aa];if(_0x610451[_0x1d59('0x4')]===_0x1d59('0x5')){_0x474e8f[_0x1d59('0x6')](_0x610451[_0x1d59('0x7')]);}else if(_0x610451['type']===_0x1d59('0x8')&&_0x610451[_0x1d59('0x9')]){_0x1b9329[_0x610451[_0x1d59('0x9')]]&&_0x474e8f[_0x1d59('0x6')](_0x1b9329[_0x610451[_0x1d59('0x9')]][_0x1d59('0xa')]());}else if(_0x610451['type']==='customVariable'&&_0x610451[_0x1d59('0xb')]&&_0x610451[_0x1d59('0xb')][_0x1d59('0xc')]){_0x1b9329[_0x610451[_0x1d59('0xb')][_0x1d59('0xc')][_0x1d59('0xd')]()]&&_0x474e8f['push'](_0x1b9329[_0x610451[_0x1d59('0xb')][_0x1d59('0xc')][_0x1d59('0xd')]()][_0x1d59('0xa')]());}else if(_0x610451['type']===_0x1d59('0xe')){if(_0x610451[_0x1d59('0xf')]===_0x1d59('0x5')&&_0x610451[_0x1d59('0x10')]){_0x474e8f[_0x1d59('0x6')](util['format'](_0x1d59('0x11'),_0x610451[_0x1d59('0x10')],_0x610451[_0x1d59('0x12')]));}else if(_0x610451[_0x1d59('0xf')]===_0x1d59('0x8')&&_0x610451[_0x1d59('0x9')]&&_0x610451['key']){_0x1b9329[_0x610451['variableName']]&&_0x474e8f[_0x1d59('0x6')](util[_0x1d59('0x13')](_0x1d59('0x11'),_0x610451['key'],_0x1b9329[_0x610451['variableName']]));}else if(_0x610451[_0x1d59('0xf')]===_0x1d59('0x14')&&_0x610451[_0x1d59('0xb')]&&_0x610451['Variable'][_0x1d59('0xc')]&&_0x610451[_0x1d59('0x10')]){_0x1b9329[_0x610451['Variable']['name']['toLowerCase']()]&&_0x474e8f[_0x1d59('0x6')](util[_0x1d59('0x13')](_0x1d59('0x11'),_0x610451['key'],_0x1b9329[_0x610451[_0x1d59('0xb')]['name']['toLowerCase']()]));}}}}return _0x474e8f['join'](_0xb74a06);};exports[_0x1d59('0x15')]=function(_0xa02432){var _0xc2e9ea=_0xa02432['slice'](-0x1);if(_0xc2e9ea==='/'){_0xa02432=_0xa02432[_0x1d59('0x16')](0x0,_0xa02432[_0x1d59('0x17')](_0xc2e9ea));}return _0xa02432;};exports[_0x1d59('0x18')]=function(_0x25685b){if(!_[_0x1d59('0x19')](_0x25685b)&&_0x25685b!==''){var _0x1aaf81=/^(([^<>()\[\]\\.,;:\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 _0x1aaf81[_0x1d59('0x1a')](String(_0x25685b)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x98cb=['keyType','keyContent','key','format','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue'];(function(_0x578082,_0x48c3fc){var _0x16ffd1=function(_0x5b0b0b){while(--_0x5b0b0b){_0x578082['push'](_0x578082['shift']());}};_0x16ffd1(++_0x48c3fc);}(_0x98cb,0x15d));var _0xb98c=function(_0x539ee9,_0x4ffa32){_0x539ee9=_0x539ee9-0x0;var _0x2d0e22=_0x98cb[_0x539ee9];return _0x2d0e22;};'use strict';var _=require('lodash');var util=require('util');exports[_0xb98c('0x0')]=function(_0x4b0b71,_0x2f2759,_0x5f28bc){var _0x1ae280=[];if(_0x4b0b71[_0xb98c('0x1')]>0x0){var _0x4a3595=_[_0xb98c('0x2')](_0x4b0b71,['id']);for(var _0x5b399e=0x0;_0x5b399e<_0x4a3595[_0xb98c('0x1')];_0x5b399e++){var _0x14f9d2=_0x4a3595[_0x5b399e];if(_0x14f9d2[_0xb98c('0x3')]===_0xb98c('0x4')){_0x1ae280[_0xb98c('0x5')](_0x14f9d2[_0xb98c('0x6')]);}else if(_0x14f9d2[_0xb98c('0x3')]===_0xb98c('0x7')&&_0x14f9d2[_0xb98c('0x8')]){_0x2f2759[_0x14f9d2[_0xb98c('0x8')]]&&_0x1ae280[_0xb98c('0x5')](_0x2f2759[_0x14f9d2[_0xb98c('0x8')]][_0xb98c('0x9')]());}else if(_0x14f9d2[_0xb98c('0x3')]===_0xb98c('0xa')&&_0x14f9d2[_0xb98c('0xb')]&&_0x14f9d2['Variable']['name']){_0x2f2759[_0x14f9d2[_0xb98c('0xb')][_0xb98c('0xc')][_0xb98c('0xd')]()]&&_0x1ae280[_0xb98c('0x5')](_0x2f2759[_0x14f9d2['Variable'][_0xb98c('0xc')][_0xb98c('0xd')]()]['toString']());}else if(_0x14f9d2[_0xb98c('0x3')]===_0xb98c('0xe')){if(_0x14f9d2[_0xb98c('0xf')]==='string'&&_0x14f9d2['key']){_0x1ae280['push'](util['format']('%s:\x20%s',_0x14f9d2['key'],_0x14f9d2[_0xb98c('0x10')]));}else if(_0x14f9d2['keyType']===_0xb98c('0x7')&&_0x14f9d2['variableName']&&_0x14f9d2[_0xb98c('0x11')]){_0x2f2759[_0x14f9d2[_0xb98c('0x8')]]&&_0x1ae280['push'](util[_0xb98c('0x12')](_0xb98c('0x13'),_0x14f9d2['key'],_0x2f2759[_0x14f9d2[_0xb98c('0x8')]]));}else if(_0x14f9d2['keyType']==='customVariable'&&_0x14f9d2[_0xb98c('0xb')]&&_0x14f9d2[_0xb98c('0xb')][_0xb98c('0xc')]&&_0x14f9d2[_0xb98c('0x11')]){_0x2f2759[_0x14f9d2[_0xb98c('0xb')][_0xb98c('0xc')][_0xb98c('0xd')]()]&&_0x1ae280[_0xb98c('0x5')](util[_0xb98c('0x12')]('%s:\x20%s',_0x14f9d2['key'],_0x2f2759[_0x14f9d2[_0xb98c('0xb')][_0xb98c('0xc')][_0xb98c('0xd')]()]));}}}}return _0x1ae280[_0xb98c('0x14')](_0x5f28bc);};exports[_0xb98c('0x15')]=function(_0x212950){var _0x4d6fbe=_0x212950['slice'](-0x1);if(_0x4d6fbe==='/'){_0x212950=_0x212950[_0xb98c('0x16')](0x0,_0x212950[_0xb98c('0x17')](_0x4d6fbe));}return _0x212950;};exports['validateEmail']=function(_0x30d0c7){if(!_[_0xb98c('0x18')](_0x30d0c7)&&_0x30d0c7!==''){var _0x24cffe=/^(([^<>()\[\]\\.,;:\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 _0x24cffe[_0xb98c('0x19')](String(_0x30d0c7)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 4068c7b..b85c794 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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 a438cb5..3bd4080 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 _0x8031=['includes','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','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','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','destcalleridname','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridname','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','../../../../config/environment','zendesk','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','[HTTP]','stringify','GET','map','forEach','string','type','nameField','customField','toLowerCase','content'];(function(_0x29cce4,_0x379f7c){var _0x1a6616=function(_0x21aadf){while(--_0x21aadf){_0x29cce4['push'](_0x29cce4['shift']());}};_0x1a6616(++_0x379f7c);}(_0x8031,0x17f));var _0x1803=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x8031[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x1803('0x0'));var rp=require(_0x1803('0x1'));var md5=require(_0x1803('0x2'));var util=require(_0x1803('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x1803('0x4'));var logger=require('../../../../config/logger')(_0x1803('0x5'));config['redis']=_[_0x1803('0x6')](config['redis'],{'host':_0x1803('0x7'),'port':0x18eb});var io=require(_0x1803('0x8'))(new Redis(config['redis']));function emit(_0x5ba307,_0x443394,_0x4ecfa5){io['to'](_0x5ba307)[_0x1803('0x9')](_0x443394,_0x4ecfa5);}var headers={'Content-Type':_0x1803('0xa'),'Accept':_0x1803('0xa')};function getTicket(_0x4959fc,_0x12cb3f,_0x510942,_0x5b702d,_0x43c937){logger[_0x1803('0xb')](_0x1803('0xc'));return request({'uri':util[_0x1803('0xd')](_0x1803('0xe'),_0x4959fc[_0x1803('0xf')]),'method':_0x1803('0x10'),'body':{'ticket':_[_0x1803('0x11')]({'requester_id':_0x510942['id'],'submitter_id':_0x12cb3f?_0x12cb3f['id']:undefined,'assignee_id':_0x12cb3f?_0x12cb3f['id']:undefined,'tags':getTags(_0x5b702d[_0x1803('0x12')],_0x1803('0x13')),'subject':intUtil[_0x1803('0x14')](_0x5b702d[_0x1803('0x15')],_0x43c937,'\x20'),'description':intUtil[_0x1803('0x14')](_0x5b702d[_0x1803('0x16')],_0x43c937,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1803('0x14')](_0x5b702d[_0x1803('0x16')],_0x43c937,'\x0a')}},getCustomFields(_0x5b702d['Fields'],_0x43c937))}})[_0x1803('0x17')](function(_0x3a7418){logger[_0x1803('0xb')]('Ticket\x20created!');return _0x3a7418[_0x1803('0x18')];});}function getUser(_0x37c86f,_0x2d1816){if(intUtil[_0x1803('0x19')](_0x2d1816)){logger[_0x1803('0xb')](_0x1803('0x1a'),_0x2d1816);return request({'uri':util[_0x1803('0xd')](_0x1803('0x1b'),_0x37c86f[_0x1803('0xf')]),'qs':{'query':util['format'](_0x1803('0x1c'),_0x2d1816)}})[_0x1803('0x17')](function(_0x2c9130){if(_0x2c9130[_0x1803('0x1d')]){logger[_0x1803('0xb')](_0x1803('0x1e'));return _[_0x1803('0x1f')](_0x2c9130[_0x1803('0x20')],{'email':_0x2d1816,'role':_0x1803('0x21')});}else{logger['info'](_0x1803('0x22'));return request({'uri':util['format'](_0x1803('0x23'),_0x37c86f[_0x1803('0xf')])})['then'](function(_0x20e2fa){logger[_0x1803('0xb')](_0x1803('0x24'));return _0x20e2fa[_0x1803('0x25')];});}});}else{logger[_0x1803('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1803('0xd')](_0x1803('0x23'),_0x37c86f[_0x1803('0xf')])})[_0x1803('0x17')](function(_0x312875){logger['info'](_0x1803('0x24'));return _0x312875['user'];});}}function getEndUser(_0x41f676,_0x511190,_0x37c802){logger['info'](_0x1803('0x26'),_0x37c802);return request({'uri':util[_0x1803('0xd')](_0x1803('0x1b'),_0x41f676['remoteUri']),'qs':{'query':util[_0x1803('0xd')](_0x1803('0x27'),_0x37c802)}})[_0x1803('0x17')](function(_0x32d5dc){var _0x1267b3;if(_0x32d5dc[_0x1803('0x20')]['length']){_0x32d5dc[_0x1803('0x20')]=_[_0x1803('0x28')](_0x32d5dc[_0x1803('0x20')],{'suspended':![],'role':_0x1803('0x29')});if(_0x32d5dc[_0x1803('0x20')][_0x1803('0x2a')]){_0x1267b3=_['first'](_0x32d5dc[_0x1803('0x20')]);}}if(_0x1267b3){logger[_0x1803('0xb')]('Enduser\x20found!');return _0x1267b3;}else{logger['info'](_0x1803('0x2b'));return request({'uri':util[_0x1803('0xd')](_0x1803('0x2c'),_0x41f676['remoteUri']),'method':_0x1803('0x10'),'body':{'user':{'role':_0x1803('0x29'),'name':util[_0x1803('0xd')]('Caller\x20-\x20%s',_0x511190||_0x37c802),'phone':_0x37c802}}})[_0x1803('0x17')](function(_0x50ede9){logger[_0x1803('0xb')](_0x1803('0x2d'));return _0x50ede9[_0x1803('0x25')];});}});}function getAuth(_0x27f46b){var _0x28897f;if(_0x27f46b[_0x1803('0x2e')]==='password'){_0x28897f=util['format'](_0x1803('0x2f'),_0x27f46b[_0x1803('0x30')],_0x27f46b[_0x1803('0x31')]);}else if(_0x27f46b['authType']===_0x1803('0x32')){_0x28897f=util[_0x1803('0xd')](_0x1803('0x33'),_0x27f46b[_0x1803('0x30')],_0x27f46b['token']);}return util[_0x1803('0xd')](_0x1803('0x34'),new Buffer(_0x28897f)[_0x1803('0x35')]('base64'));}function request(_0x5abba1){logger['debug'](_0x1803('0x36'),JSON[_0x1803('0x37')](_0x5abba1));return rp(_[_0x1803('0x6')](_0x5abba1,{'method':_0x1803('0x38'),'headers':headers,'json':!![]}));}function getTags(_0xdeac9f,_0x237452){var _0x318fe7=[];if(_0xdeac9f&&_0xdeac9f[_0x1803('0x2a')]>0x0){_0x318fe7=_[_0x1803('0x39')](_0xdeac9f,_0x237452);}return _0x318fe7;}function getCustomFields(_0x2ded7c,_0x4ac38a){var _0x569635=[];var _0x1a6562={'custom_fields':[]};if(_0x2ded7c[_0x1803('0x2a')]>0x0){_[_0x1803('0x3a')](_0x2ded7c,function(_0x226992){if(_['includes']([_0x1803('0x3b'),'picklist'],_0x226992[_0x1803('0x3c')])&&_0x226992[_0x1803('0x3d')]&&!_0x226992[_0x1803('0x3e')]){_0x1a6562[_0x226992[_0x1803('0x3d')][_0x1803('0x3f')]()]=_0x226992[_0x1803('0x40')][_0x1803('0x35')]();}else if(_[_0x1803('0x41')]([_0x1803('0x3b'),'picklist'],_0x226992[_0x1803('0x3c')])&&_0x226992[_0x1803('0x42')]&&_0x226992[_0x1803('0x3e')]){_0x1a6562[_0x1803('0x43')][_0x1803('0x44')]({'id':_0x226992['idField'],'value':_0x226992[_0x1803('0x40')][_0x1803('0x35')]()});}else if(_0x226992[_0x1803('0x3c')]===_0x1803('0x45')&&_0x226992[_0x1803('0x46')]&&_0x226992[_0x1803('0x42')]&&_0x226992[_0x1803('0x3e')]){_0x4ac38a[_0x226992[_0x1803('0x46')]]&&_0x1a6562[_0x1803('0x43')][_0x1803('0x44')]({'id':_0x226992[_0x1803('0x42')],'value':_0x4ac38a[_0x226992['variableName']]['toString']()});}else if(_0x226992['type']===_0x1803('0x47')&&_0x226992[_0x1803('0x48')]&&_0x226992[_0x1803('0x48')][_0x1803('0x13')]&&_0x226992[_0x1803('0x42')]&&_0x226992[_0x1803('0x3e')]){_0x4ac38a[_0x226992[_0x1803('0x48')][_0x1803('0x13')]['toLowerCase']()]&&_0x1a6562[_0x1803('0x43')][_0x1803('0x44')]({'id':_0x226992[_0x1803('0x42')],'value':_0x4ac38a[_0x226992[_0x1803('0x48')][_0x1803('0x13')]['toLowerCase']()]['toString']()});}});}return _0x1a6562;}exports[_0x1803('0x49')]=function(_0x3617a4,_0x53ae83,_0x34e065,_0x11b975,_0x466b43,_0x1a757a){var _0x40bde7,_0xba4c03;_0x1a757a[_0x1803('0xf')]=intUtil['stripTrailingSlash'](_0x1a757a['remoteUri']);_0x1a757a[_0x1803('0x4a')]=intUtil[_0x1803('0x4b')](_0x1a757a[_0x1803('0x4a')]);if(_0x466b43&&_0x466b43[_0x1803('0x4c')]){logger['info'](_0x1803('0x4d'),_0x1803('0x4e'));_0x53ae83[_0x1803('0x4f')]=util[_0x1803('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a757a[_0x1803('0x4a')],_0x53ae83[_0x1803('0x50')],md5(_0x53ae83['uniqueid']));}else{_0x53ae83[_0x1803('0x4f')]='';}headers[_0x1803('0x51')]=getAuth(_0x1a757a);return getUser(_0x1a757a,_0x11b975['email'])[_0x1803('0x17')](function(_0x148330){_0x40bde7=_0x148330;logger[_0x1803('0xb')]('The\x20User\x20ID\x20is:',_0x40bde7['id']);return getEndUser(_0x1a757a,_0x53ae83['calleridname'],_0x53ae83['calleridnum']);})[_0x1803('0x17')](function(_0x1ff4f7){_0xba4c03=_0x1ff4f7;logger['info'](_0x1803('0x52'),_0xba4c03['id']);return getTicket(_0x1a757a,_0x40bde7,_0xba4c03,_0x34e065,_0x53ae83);})[_0x1803('0x17')](function(_0x1f1dab){if(_0x1f1dab){logger[_0x1803('0xb')](_0x1803('0x53'),_0x1f1dab['id']);switch(_0x1a757a[_0x1803('0x3c')]){case _0x1803('0x54'):logger[_0x1803('0xb')]('[QUEUE]',_0x1803('0x55'));return request({'uri':util['format'](_0x1803('0x56'),_0x1a757a[_0x1803('0xf')],_0x40bde7['id'],_0x1f1dab['id']),'method':_0x1803('0x10')});case _0x1803('0x57'):logger[_0x1803('0xb')]('[QUEUE]',_0x1803('0x58'));emit(util['format'](_0x1803('0x59'),_0x11b975[_0x1803('0x13')]),_0x1803('0x5a'),{'uri':util[_0x1803('0xd')](_0x1803('0x5b'),_0x1a757a['remoteUri'][_0x1803('0x5c')](_0x1803('0x5d'),''),_0x1f1dab['id'])});break;default:logger[_0x1803('0x5e')]('[QUEUE]',_0x1803('0x5f'));}}})[_0x1803('0x60')](function(_0x1a5a09){logger['error'](_0x1803('0x61'),util[_0x1803('0x62')](_0x1a5a09,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x2f89d2,_0x3beaa1,_0x5f5969,_0x36afd3,_0x621cd5,_0x1cf859,_0x54dcfe){var _0x20906a,_0x25758f;_0x1cf859[_0x1803('0xf')]=intUtil[_0x1803('0x4b')](_0x1cf859['remoteUri']);_0x1cf859[_0x1803('0x4a')]=intUtil[_0x1803('0x4b')](_0x1cf859[_0x1803('0x4a')]);if(_0x54dcfe&&_0x54dcfe['recordingFormat']&&_0x54dcfe[_0x1803('0x63')]!==_0x1803('0x64')){logger[_0x1803('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3beaa1['recordingURL']=util[_0x1803('0xd')](_0x1803('0x65'),_0x1cf859[_0x1803('0x4a')],_0x3beaa1[_0x1803('0x50')],md5(_0x3beaa1[_0x1803('0x50')]));}headers[_0x1803('0x51')]=getAuth(_0x1cf859);return getUser(_0x1cf859,_0x36afd3[_0x1803('0x66')])[_0x1803('0x17')](function(_0x1fbbce){_0x20906a=_0x1fbbce;logger[_0x1803('0xb')](_0x1803('0x67'),_0x20906a['id']);return getEndUser(_0x1cf859,_0x3beaa1[_0x1803('0x68')],_0x3beaa1['destcalleridnum']);})[_0x1803('0x17')](function(_0x1b2748){_0x25758f=_0x1b2748;logger['info'](_0x1803('0x52'),_0x25758f['id']);return getTicket(_0x1cf859,_0x20906a,_0x25758f,_0x5f5969,_0x3beaa1);})[_0x1803('0x17')](function(_0x2cc6bb){if(_0x2cc6bb){logger['info'](_0x1803('0x53'),_0x2cc6bb['id']);switch(_0x1cf859[_0x1803('0x3c')]){case _0x1803('0x54'):logger['info'](_0x1803('0x69'),_0x1803('0x55'));return request({'uri':util['format'](_0x1803('0x56'),_0x1cf859[_0x1803('0xf')],_0x20906a['id'],_0x2cc6bb['id']),'method':_0x1803('0x10')});case _0x1803('0x57'):logger['info'](_0x1803('0x69'),_0x1803('0x58'));emit(util[_0x1803('0xd')](_0x1803('0x59'),_0x36afd3[_0x1803('0x13')]),'trigger:browser:url',{'uri':util['format'](_0x1803('0x5b'),_0x1cf859[_0x1803('0xf')][_0x1803('0x5c')](_0x1803('0x5d'),''),_0x2cc6bb['id'])});break;default:logger['error'](_0x1803('0x69'),_0x1803('0x5f'));}}})[_0x1803('0x60')](function(_0x102191){logger['error'](_0x1803('0x6a'),util[_0x1803('0x62')](_0x102191,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x4fb6ee,_0x5e7410,_0x1f326f,_0x43877a,_0xb7c2c3,_0xba579c){var _0xf99eaf,_0x189d52;_0xba579c[_0x1803('0xf')]=intUtil['stripTrailingSlash'](_0xba579c[_0x1803('0xf')]);_0xba579c['serverUrl']=intUtil[_0x1803('0x4b')](_0xba579c[_0x1803('0x4a')]);if(_0xb7c2c3&&_0xb7c2c3[_0x1803('0x4c')]){logger[_0x1803('0xb')]('['+_0x5e7410[_0x1803('0x6b')][_0x1803('0x6c')]()+']',_0x1803('0x4e'));_0x5e7410[_0x1803('0x4f')]=util['format'](_0x1803('0x65'),_0xba579c[_0x1803('0x4a')],_0x5e7410['uniqueid'],md5(_0x5e7410[_0x1803('0x50')]));}else{_0x5e7410[_0x1803('0x4f')]='';}headers[_0x1803('0x51')]=getAuth(_0xba579c);return getUser(_0xba579c)['then'](function(_0x4d232e){_0xf99eaf=_0x4d232e;logger[_0x1803('0xb')](_0x1803('0x67'),_0xf99eaf['id']);return getEndUser(_0xba579c,_0x5e7410[_0x1803('0x6d')],_0x5e7410[_0x1803('0x6e')]);})['then'](function(_0x23e3d4){_0x189d52=_0x23e3d4;logger[_0x1803('0xb')](_0x1803('0x52'),_0x189d52['id']);return getTicket(_0xba579c,_0xf99eaf,_0x189d52,_0x1f326f,_0x5e7410);})[_0x1803('0x17')](function(_0x3e83b1){if(_0x3e83b1){logger[_0x1803('0xb')](_0x1803('0x53'),_0x3e83b1['id']);}})[_0x1803('0x60')](function(_0x2c0fe2){logger[_0x1803('0x5e')]('['+_0x5e7410[_0x1803('0x6b')][_0x1803('0x6c')]()+']'+_0x1803('0x6f'),util[_0x1803('0x62')](_0x2c0fe2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2014=['toString','idField','custom_fields','push','variable','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization','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','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','Tags','getString','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','user','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','Enduser\x20found!','%s/users.json','authType','password','%s:%s','username','token','Basic\x20%s','base64','debug','stringify','length','map','includes','string','picklist','type','nameField','customField','toLowerCase','content'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2014,0x9b));var _0x4201=function(_0x26251b,_0x21eff3){_0x26251b=_0x26251b-0x0;var _0x2ba315=_0x2014[_0x26251b];return _0x2ba315;};'use strict';var _=require(_0x4201('0x0'));var rp=require('request-promise');var md5=require(_0x4201('0x1'));var util=require(_0x4201('0x2'));var Redis=require(_0x4201('0x3'));var intUtil=require('./util');var config=require(_0x4201('0x4'));var logger=require(_0x4201('0x5'))(_0x4201('0x6'));config[_0x4201('0x7')]=_[_0x4201('0x8')](config[_0x4201('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4201('0x9'))(new Redis(config[_0x4201('0x7')]));function emit(_0x326df5,_0x2dd47d,_0xc1ec61){io['to'](_0x326df5)['emit'](_0x2dd47d,_0xc1ec61);}var headers={'Content-Type':'application/json','Accept':_0x4201('0xa')};function getTicket(_0x33c003,_0x4e9a79,_0x93addf,_0x1448a5,_0x5eb2e6){logger[_0x4201('0xb')](_0x4201('0xc'));return request({'uri':util[_0x4201('0xd')](_0x4201('0xe'),_0x33c003['remoteUri']),'method':_0x4201('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x93addf['id'],'submitter_id':_0x4e9a79?_0x4e9a79['id']:undefined,'assignee_id':_0x4e9a79?_0x4e9a79['id']:undefined,'tags':getTags(_0x1448a5[_0x4201('0x10')],'name'),'subject':intUtil[_0x4201('0x11')](_0x1448a5['Subjects'],_0x5eb2e6,'\x20'),'description':intUtil['getString'](_0x1448a5['Descriptions'],_0x5eb2e6,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4201('0x11')](_0x1448a5[_0x4201('0x12')],_0x5eb2e6,'\x0a')}},getCustomFields(_0x1448a5[_0x4201('0x13')],_0x5eb2e6))}})[_0x4201('0x14')](function(_0x1ca07f){logger[_0x4201('0xb')]('Ticket\x20created!');return _0x1ca07f[_0x4201('0x15')];});}function getUser(_0x3de2dc,_0x99a5cc){if(intUtil[_0x4201('0x16')](_0x99a5cc)){logger[_0x4201('0xb')](_0x4201('0x17'),_0x99a5cc);return request({'uri':util[_0x4201('0xd')](_0x4201('0x18'),_0x3de2dc['remoteUri']),'qs':{'query':util['format'](_0x4201('0x19'),_0x99a5cc)}})['then'](function(_0x172479){if(_0x172479['count']){logger[_0x4201('0xb')](_0x4201('0x1a'));return _[_0x4201('0x1b')](_0x172479[_0x4201('0x1c')],{'email':_0x99a5cc,'role':'agent'});}else{logger[_0x4201('0xb')](_0x4201('0x1d'));return request({'uri':util[_0x4201('0xd')]('%s/users/me.json',_0x3de2dc[_0x4201('0x1e')])})[_0x4201('0x14')](function(_0x2adf8a){logger[_0x4201('0xb')]('Admin\x20account\x20selected.');return _0x2adf8a[_0x4201('0x1f')];});}});}else{logger[_0x4201('0xb')](_0x4201('0x1d'));return request({'uri':util[_0x4201('0xd')](_0x4201('0x20'),_0x3de2dc[_0x4201('0x1e')])})[_0x4201('0x14')](function(_0x42983){logger[_0x4201('0xb')](_0x4201('0x21'));return _0x42983[_0x4201('0x1f')];});}}function getEndUser(_0x332425,_0x5a01bb,_0x504297){logger[_0x4201('0xb')](_0x4201('0x22'),_0x504297);return request({'uri':util['format'](_0x4201('0x18'),_0x332425[_0x4201('0x1e')]),'qs':{'query':util[_0x4201('0xd')](_0x4201('0x23'),_0x504297)}})[_0x4201('0x14')](function(_0x50dc6d){var _0x23a27b;if(_0x50dc6d[_0x4201('0x1c')]['length']){_0x50dc6d[_0x4201('0x1c')]=_[_0x4201('0x24')](_0x50dc6d[_0x4201('0x1c')],{'suspended':![],'role':_0x4201('0x25')});if(_0x50dc6d[_0x4201('0x1c')]['length']){_0x23a27b=_['first'](_0x50dc6d['results']);}}if(_0x23a27b){logger[_0x4201('0xb')](_0x4201('0x26'));return _0x23a27b;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4201('0xd')](_0x4201('0x27'),_0x332425[_0x4201('0x1e')]),'method':_0x4201('0xf'),'body':{'user':{'role':_0x4201('0x25'),'name':util[_0x4201('0xd')]('Caller\x20-\x20%s',_0x5a01bb||_0x504297),'phone':_0x504297}}})['then'](function(_0x5aff8f){logger[_0x4201('0xb')]('Enduser\x20created.');return _0x5aff8f[_0x4201('0x1f')];});}});}function getAuth(_0x359ced){var _0x4e25fc;if(_0x359ced[_0x4201('0x28')]===_0x4201('0x29')){_0x4e25fc=util['format'](_0x4201('0x2a'),_0x359ced[_0x4201('0x2b')],_0x359ced[_0x4201('0x29')]);}else if(_0x359ced[_0x4201('0x28')]==='token'){_0x4e25fc=util[_0x4201('0xd')]('%s/token:%s',_0x359ced[_0x4201('0x2b')],_0x359ced[_0x4201('0x2c')]);}return util['format'](_0x4201('0x2d'),new Buffer(_0x4e25fc)['toString'](_0x4201('0x2e')));}function request(_0x3979f1){logger[_0x4201('0x2f')]('[HTTP]',JSON[_0x4201('0x30')](_0x3979f1));return rp(_['defaults'](_0x3979f1,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5577c9,_0xce3087){var _0x809747=[];if(_0x5577c9&&_0x5577c9[_0x4201('0x31')]>0x0){_0x809747=_[_0x4201('0x32')](_0x5577c9,_0xce3087);}return _0x809747;}function getCustomFields(_0x327b30,_0x3d792a){var _0x1aedca=[];var _0xab0101={'custom_fields':[]};if(_0x327b30['length']>0x0){_['forEach'](_0x327b30,function(_0x22d45a){if(_[_0x4201('0x33')]([_0x4201('0x34'),_0x4201('0x35')],_0x22d45a[_0x4201('0x36')])&&_0x22d45a[_0x4201('0x37')]&&!_0x22d45a[_0x4201('0x38')]){_0xab0101[_0x22d45a[_0x4201('0x37')][_0x4201('0x39')]()]=_0x22d45a[_0x4201('0x3a')][_0x4201('0x3b')]();}else if(_['includes'](['string',_0x4201('0x35')],_0x22d45a['type'])&&_0x22d45a[_0x4201('0x3c')]&&_0x22d45a['customField']){_0xab0101[_0x4201('0x3d')][_0x4201('0x3e')]({'id':_0x22d45a['idField'],'value':_0x22d45a[_0x4201('0x3a')][_0x4201('0x3b')]()});}else if(_0x22d45a[_0x4201('0x36')]===_0x4201('0x3f')&&_0x22d45a[_0x4201('0x40')]&&_0x22d45a[_0x4201('0x3c')]&&_0x22d45a[_0x4201('0x38')]){_0x3d792a[_0x22d45a[_0x4201('0x40')]]&&_0xab0101[_0x4201('0x3d')][_0x4201('0x3e')]({'id':_0x22d45a[_0x4201('0x3c')],'value':_0x3d792a[_0x22d45a[_0x4201('0x40')]][_0x4201('0x3b')]()});}else if(_0x22d45a[_0x4201('0x36')]==='customVariable'&&_0x22d45a[_0x4201('0x41')]&&_0x22d45a[_0x4201('0x41')][_0x4201('0x42')]&&_0x22d45a[_0x4201('0x3c')]&&_0x22d45a[_0x4201('0x38')]){_0x3d792a[_0x22d45a[_0x4201('0x41')][_0x4201('0x42')]['toLowerCase']()]&&_0xab0101['custom_fields']['push']({'id':_0x22d45a[_0x4201('0x3c')],'value':_0x3d792a[_0x22d45a[_0x4201('0x41')]['name'][_0x4201('0x39')]()][_0x4201('0x3b')]()});}});}return _0xab0101;}exports[_0x4201('0x43')]=function(_0x4cd683,_0x2ea126,_0x1d3f40,_0x1f2aa2,_0x50cd85,_0x140cf0){var _0x329342,_0x66d4f8;_0x140cf0['remoteUri']=intUtil[_0x4201('0x44')](_0x140cf0[_0x4201('0x1e')]);_0x140cf0[_0x4201('0x45')]=intUtil['stripTrailingSlash'](_0x140cf0[_0x4201('0x45')]);if(_0x50cd85&&_0x50cd85[_0x4201('0x46')]){logger['info'](_0x4201('0x47'),'Recording\x20is\x20enabled!');_0x2ea126[_0x4201('0x48')]=util[_0x4201('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x140cf0['serverUrl'],_0x2ea126[_0x4201('0x49')],md5(_0x2ea126['uniqueid']));}else{_0x2ea126[_0x4201('0x48')]='';}headers[_0x4201('0x4a')]=getAuth(_0x140cf0);return getUser(_0x140cf0,_0x1f2aa2['email'])[_0x4201('0x14')](function(_0x58d132){_0x329342=_0x58d132;logger[_0x4201('0xb')]('The\x20User\x20ID\x20is:',_0x329342['id']);return getEndUser(_0x140cf0,_0x2ea126[_0x4201('0x4b')],_0x2ea126[_0x4201('0x4c')]);})['then'](function(_0x45cfd4){_0x66d4f8=_0x45cfd4;logger[_0x4201('0xb')](_0x4201('0x4d'),_0x66d4f8['id']);return getTicket(_0x140cf0,_0x329342,_0x66d4f8,_0x1d3f40,_0x2ea126);})[_0x4201('0x14')](function(_0x3f6946){if(_0x3f6946){logger[_0x4201('0xb')](_0x4201('0x4e'),_0x3f6946['id']);switch(_0x140cf0[_0x4201('0x36')]){case _0x4201('0x4f'):logger[_0x4201('0xb')]('[QUEUE]',_0x4201('0x50'));return request({'uri':util[_0x4201('0xd')](_0x4201('0x51'),_0x140cf0['remoteUri'],_0x329342['id'],_0x3f6946['id']),'method':_0x4201('0xf')});case _0x4201('0x52'):logger[_0x4201('0xb')](_0x4201('0x47'),_0x4201('0x53'));emit(util[_0x4201('0xd')](_0x4201('0x54'),_0x1f2aa2[_0x4201('0x42')]),_0x4201('0x55'),{'uri':util['format'](_0x4201('0x56'),_0x140cf0[_0x4201('0x1e')]['replace'](_0x4201('0x57'),''),_0x3f6946['id'])});break;default:logger[_0x4201('0x58')]('[QUEUE]',_0x4201('0x59'));}}})[_0x4201('0x5a')](function(_0x5af9d2){logger['error'](_0x4201('0x5b'),util[_0x4201('0x5c')](_0x5af9d2,{'showHidden':!![],'depth':null}));});};exports[_0x4201('0x5d')]=function(_0xef6076,_0x52eedd,_0x468246,_0x522a94,_0xdcf830,_0x54d8a2,_0x5bc9a5){var _0x536416,_0x5134d1;_0x54d8a2[_0x4201('0x1e')]=intUtil[_0x4201('0x44')](_0x54d8a2['remoteUri']);_0x54d8a2[_0x4201('0x45')]=intUtil[_0x4201('0x44')](_0x54d8a2[_0x4201('0x45')]);if(_0x5bc9a5&&_0x5bc9a5[_0x4201('0x5e')]&&_0x5bc9a5[_0x4201('0x5e')]!==_0x4201('0x5f')){logger['info'](_0x4201('0x60'),_0x4201('0x61'));_0x52eedd[_0x4201('0x48')]=util[_0x4201('0xd')](_0x4201('0x62'),_0x54d8a2[_0x4201('0x45')],_0x52eedd[_0x4201('0x49')],md5(_0x52eedd['uniqueid']));}headers[_0x4201('0x4a')]=getAuth(_0x54d8a2);return getUser(_0x54d8a2,_0x522a94[_0x4201('0x63')])[_0x4201('0x14')](function(_0x4b0c7f){_0x536416=_0x4b0c7f;logger[_0x4201('0xb')](_0x4201('0x64'),_0x536416['id']);return getEndUser(_0x54d8a2,_0x52eedd[_0x4201('0x65')],_0x52eedd[_0x4201('0x66')]);})['then'](function(_0x1508e0){_0x5134d1=_0x1508e0;logger[_0x4201('0xb')](_0x4201('0x4d'),_0x5134d1['id']);return getTicket(_0x54d8a2,_0x536416,_0x5134d1,_0x468246,_0x52eedd);})[_0x4201('0x14')](function(_0x12b2c1){if(_0x12b2c1){logger[_0x4201('0xb')](_0x4201('0x4e'),_0x12b2c1['id']);switch(_0x54d8a2[_0x4201('0x36')]){case _0x4201('0x4f'):logger[_0x4201('0xb')](_0x4201('0x60'),_0x4201('0x50'));return request({'uri':util[_0x4201('0xd')](_0x4201('0x51'),_0x54d8a2[_0x4201('0x1e')],_0x536416['id'],_0x12b2c1['id']),'method':_0x4201('0xf')});case _0x4201('0x52'):logger['info'](_0x4201('0x60'),_0x4201('0x53'));emit(util[_0x4201('0xd')](_0x4201('0x54'),_0x522a94[_0x4201('0x42')]),_0x4201('0x55'),{'uri':util[_0x4201('0xd')]('%s/agent/tickets/%s',_0x54d8a2[_0x4201('0x1e')]['replace']('/api/v2',''),_0x12b2c1['id'])});break;default:logger[_0x4201('0x58')](_0x4201('0x60'),_0x4201('0x59'));}}})[_0x4201('0x5a')](function(_0x49ca1e){logger[_0x4201('0x58')](_0x4201('0x67'),util[_0x4201('0x5c')](_0x49ca1e,{'showHidden':!![],'depth':null}));});};exports[_0x4201('0x68')]=function(_0x567efa,_0x104574,_0x5d7387,_0x263142,_0x4463d8,_0x3b23d1){var _0x40f4fb,_0x3d783a;_0x3b23d1['remoteUri']=intUtil[_0x4201('0x44')](_0x3b23d1[_0x4201('0x1e')]);_0x3b23d1['serverUrl']=intUtil['stripTrailingSlash'](_0x3b23d1['serverUrl']);if(_0x4463d8&&_0x4463d8[_0x4201('0x46')]){logger['info']('['+_0x104574['lastevent']['toUpperCase']()+']',_0x4201('0x61'));_0x104574[_0x4201('0x48')]=util[_0x4201('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b23d1[_0x4201('0x45')],_0x104574[_0x4201('0x49')],md5(_0x104574[_0x4201('0x49')]));}else{_0x104574[_0x4201('0x48')]='';}headers[_0x4201('0x4a')]=getAuth(_0x3b23d1);return getUser(_0x3b23d1)['then'](function(_0x501495){_0x40f4fb=_0x501495;logger[_0x4201('0xb')](_0x4201('0x64'),_0x40f4fb['id']);return getEndUser(_0x3b23d1,_0x104574['calleridname'],_0x104574['calleridnum']);})[_0x4201('0x14')](function(_0xc5c3da){_0x3d783a=_0xc5c3da;logger[_0x4201('0xb')](_0x4201('0x4d'),_0x3d783a['id']);return getTicket(_0x3b23d1,_0x40f4fb,_0x3d783a,_0x5d7387,_0x104574);})[_0x4201('0x14')](function(_0x2a25a3){if(_0x2a25a3){logger[_0x4201('0xb')](_0x4201('0x4e'),_0x2a25a3['id']);}})['catch'](function(_0x19c1cf){logger[_0x4201('0x58')]('['+_0x104574[_0x4201('0x69')][_0x4201('0x6a')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x19c1cf,{'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 c9fd3ed..6fc4ed6 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 _0xc203=['answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stack','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','https://crm.','unmanaged','lastevent','toUpperCase','calleridname','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','isArrayLikeObject','findIndex','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','Contacts','lead','Leads','Creating\x20new\x20call...','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','Call_Duration','format'];(function(_0x79c6de,_0x10de94){var _0x321a56=function(_0x2e313e){while(--_0x2e313e){_0x79c6de['push'](_0x79c6de['shift']());}};_0x321a56(++_0x10de94);}(_0xc203,0x176));var _0x3c20=function(_0x3ce977,_0x192fd2){_0x3ce977=_0x3ce977-0x0;var _0x309ff4=_0xc203[_0x3ce977];return _0x309ff4;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x3c20('0x0'));var util=require(_0x3c20('0x1'));var intUtil=require('./util');var moment=require(_0x3c20('0x2'));var Redis=require(_0x3c20('0x3'));var BPromise=require(_0x3c20('0x4'));var config=require(_0x3c20('0x5'));var logger=require(_0x3c20('0x6'))(_0x3c20('0x7'));config[_0x3c20('0x8')]=_[_0x3c20('0x9')](config[_0x3c20('0x8')],{'host':_0x3c20('0xa'),'port':0x18eb});var io=require(_0x3c20('0xb'))(new Redis(config[_0x3c20('0x8')]));function emit(_0x5b6d42,_0xb06f5b,_0x12a1a8){io['to'](_0x5b6d42)[_0x3c20('0xc')](_0xb06f5b,_0x12a1a8);}function request(_0x28b7d3){logger[_0x3c20('0xd')](_0x3c20('0xe'),JSON[_0x3c20('0xf')](_0x28b7d3));return rp(_0x28b7d3);}function getCustomFields(_0x5df704,_0xb95196){var _0x3286ef={};if(_0x5df704['length']>0x0){_['forEach'](_0x5df704,function(_0x574f12){if(_['includes']([_0x3c20('0x10'),_0x3c20('0x11')],_0x574f12[_0x3c20('0x12')])&&_0x574f12[_0x3c20('0x13')]){_0x3286ef[_0x574f12[_0x3c20('0x13')]]=_0x574f12[_0x3c20('0x14')][_0x3c20('0x15')]();}else if(_0x574f12['type']===_0x3c20('0x16')&&_0x574f12[_0x3c20('0x17')]&&_0x574f12[_0x3c20('0x13')]&&_0xb95196[_0x574f12[_0x3c20('0x17')]]){_0x3286ef[_0x574f12['idField']]=_0xb95196[_0x574f12[_0x3c20('0x17')]][_0x3c20('0x15')]();}else if(_0x574f12[_0x3c20('0x12')]==='customVariable'&&_0x574f12[_0x3c20('0x18')]&&_0x574f12[_0x3c20('0x18')][_0x3c20('0x19')]&&_0x574f12[_0x3c20('0x13')]&&_0xb95196[_0x574f12['Variable'][_0x3c20('0x19')][_0x3c20('0x1a')]()]){_0x3286ef[_0x574f12[_0x3c20('0x13')]]=_0xb95196[_0x574f12['Variable'][_0x3c20('0x19')][_0x3c20('0x1a')]()][_0x3c20('0x15')]();}});}return _0x3286ef;}function getName(_0x623564){if(_0x623564[_0x3c20('0x1b')]('\x20')>0x0){var _0x308c2c=_0x623564[_0x3c20('0x1c')](/ (.+)/);if(_0x308c2c[0x1]){return _0x308c2c;}}return[_0x623564,_0x623564];}var accountsTokens={};function getAccessToken(_0x22bd24){return new Promise(function(_0x1d871b,_0x482c12){if(!_[_0x3c20('0x1d')](accountsTokens[_0x22bd24['id']])&&!_[_0x3c20('0x1d')](accountsTokens[_0x22bd24['id']][_0x3c20('0x1e')])){if(moment()[_0x3c20('0x1f')](accountsTokens[_0x22bd24['id']][_0x3c20('0x20')])){_0x1d871b(accountsTokens[_0x22bd24['id']]['access_token']);}}var _0x12e22c;switch(_0x22bd24[_0x3c20('0x21')]){case'US':_0x12e22c=_0x3c20('0x22');break;case'AU':_0x12e22c=_0x3c20('0x23');break;case'EU':_0x12e22c=_0x3c20('0x24');break;case'IN':_0x12e22c='https://accounts.zoho.in';break;case'CN':_0x12e22c='https://accounts.zoho.com.cn';break;default:_0x12e22c=_0x3c20('0x24');break;}var _0x2bc1b4={'method':_0x3c20('0x25'),'uri':_0x12e22c+_0x3c20('0x26'),'qs':{'refresh_token':_0x22bd24[_0x3c20('0x27')],'client_id':_0x22bd24[_0x3c20('0x28')],'client_secret':_0x22bd24['clientSecret'],'grant_type':_0x3c20('0x29')},'json':!![]};return rp(_0x2bc1b4)['then'](function(_0xfdc903){accountsTokens[_0x22bd24['id']]={'access_token':_0xfdc903[_0x3c20('0x1e')],'expires_in':moment()[_0x3c20('0x2a')](_0xfdc903[_0x3c20('0x20')],'seconds')};_0x1d871b(_0xfdc903[_0x3c20('0x1e')]);})[_0x3c20('0x2b')](function(_0x4fb157){logger[_0x3c20('0x2c')](_0x3c20('0x2d'),_0x4fb157['stack']);_0x482c12(_0x4fb157);});});}function getUser(_0x5f37bf,_0x298aab,_0x512ccd,_0xc3c08f){logger[_0x3c20('0x2e')](_0x3c20('0x2f'));return request({'method':_0x3c20('0x30'),'uri':util['format'](_0x3c20('0x31'),_0x298aab),'qs':{'type':_0x3c20('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5f37bf},'json':!![]})[_0x3c20('0x33')](function(_0x4e1fc2){if(_0x4e1fc2['users']){var _0x4a7006=-0x1;if(_[_0x3c20('0x34')](_0x4e1fc2['users'])){if(!_[_0x3c20('0x1d')](_0xc3c08f)){_0x4a7006=_[_0x3c20('0x35')](_0x4e1fc2[_0x3c20('0x36')],function(_0x140347){return _0x140347[_0x3c20('0x37')]===_0xc3c08f;});}if(_0x4a7006>=0x0){logger['info'](_0x3c20('0x38'));}else{logger['info'](_0x3c20('0x39'));_0x4a7006=_[_0x3c20('0x35')](_0x4e1fc2[_0x3c20('0x36')],function(_0x43966e){return _0x43966e['profile']['name']===_0x3c20('0x3a');});}return _0x4e1fc2['users'][_0x4a7006];}else{if(_0x4e1fc2[_0x3c20('0x3b')][_0x3c20('0x3c')]['name']==='Administrator'){logger[_0x3c20('0x2e')](_0x3c20('0x39'));user=_0x4e1fc2['user'];return user;}else{logger[_0x3c20('0x2c')](_0x3c20('0x3d'),JSON[_0x3c20('0xf')](_0x4e1fc2));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x3c20('0xf')](_0x4e1fc2));}}}else{logger[_0x3c20('0x2c')](_0x3c20('0x3d'),JSON[_0x3c20('0xf')](_0x4e1fc2));throw new Error(_0x3c20('0x3e')+JSON['stringify'](_0x4e1fc2));}})[_0x3c20('0x2b')](function(_0x30e4ec){console[_0x3c20('0x2c')](_0x30e4ec);});}function getZohoUser(_0x1a381b,_0x5be49a){return new BPromise(function(_0x3e2680,_0x4fce12){request(_0x1a381b)['then'](function(_0x11ae91){var _0x4bf109=null;if(_0x11ae91){_0x4bf109=_0x11ae91[_0x3c20('0x3f')][0x0];_0x4bf109[_0x3c20('0x40')]=_0x5be49a;}_0x3e2680(_0x4bf109);})[_0x3c20('0x2b')](function(_0x9cfe57){_0x4fce12(_0x9cfe57);});});}function createEndUser(_0x22e8f0,_0xc77b59,_0x326335,_0x408f62,_0x751802,_0x5a6276){var _0x326335=getName(_0x326335);return request({'method':_0x3c20('0x25'),'uri':'https://www.zohoapis.'+_0xc77b59+_0x3c20('0x41')+_[_0x3c20('0x42')](_0x5a6276[_0x3c20('0x43')])+'s','body':{'data':[{'Last_Name':_0x326335[0x1],'First_Name':_0x326335[0x0],'Phone':_0x408f62,'Owner':{'name':!_[_0x3c20('0x1d')](_0x751802['role']['name'])?_0x751802[_0x3c20('0x44')][_0x3c20('0x19')]:!_[_0x3c20('0x1d')](_0x751802[_0x3c20('0x45')])?_0x751802[_0x3c20('0x45')]+'\x20'+_0x751802[_0x3c20('0x46')]:_0x751802[_0x3c20('0x46')],'id':_0x751802['id']}}]},'headers':{'Authorization':_0x3c20('0x47')+_0x22e8f0},'json':!![]})[_0x3c20('0x33')](function(_0x4869bf){if(_0x4869bf&&_0x4869bf['data'][0x0][_0x3c20('0x48')]===_0x3c20('0x49')){var _0x21ed39=_0x4869bf[_0x3c20('0x3f')][0x0][_0x3c20('0x4a')];_0x21ed39[_0x3c20('0x40')]=_[_0x3c20('0x42')](_0x5a6276[_0x3c20('0x43')])+'s';return _0x21ed39;}logger[_0x3c20('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x3c20('0xf')](data));throw new Error(_0x3c20('0x4b')+JSON['stringify'](data));})[_0x3c20('0x2b')](function(_0xc4790e){console[_0x3c20('0x4c')](_0x3c20('0x4d'),_0xc4790e);});}function getEndUser(_0x3237cf,_0x496a2b,_0x554337,_0x1ca7aa,_0x48b77b,_0x1011eb,_0x509b12){var _0x5d12aa={'method':_0x3c20('0x30'),'uri':'','headers':{'Authorization':_0x3c20('0x47')+_0x3237cf},'json':!![]};switch(_0x509b12[_0x3c20('0x4e')]){case _0x3c20('0x4f'):_0x5d12aa[_0x3c20('0x50')]=_0x3c20('0x51')+_0x496a2b+_0x3c20('0x52')+_0x48b77b+'))';return getZohoUser(_0x5d12aa,'Contacts')[_0x3c20('0x33')](function(_0x54cd3e){if(_0x54cd3e)return _0x54cd3e;_0x5d12aa[_0x3c20('0x50')]=_0x3c20('0x51')+_0x496a2b+_0x3c20('0x53')+_0x48b77b+'))';return getZohoUser(_0x5d12aa,'Leads')[_0x3c20('0x33')](function(_0x3a5115){if(_0x3a5115)return _0x3a5115;if(_0x509b12[_0x3c20('0x43')]!=_0x3c20('0x54')){return createEndUser(_0x3237cf,_0x496a2b,_0x1ca7aa,_0x48b77b,_0x1011eb,_0x509b12);}else{return{};}});});break;case _0x3c20('0x55'):_0x5d12aa[_0x3c20('0x50')]=_0x3c20('0x51')+_0x496a2b+_0x3c20('0x52')+_0x48b77b+'))';return getZohoUser(_0x5d12aa,_0x3c20('0x56'))['then'](function(_0x5d9edd){if(_0x5d9edd)return _0x5d9edd;if(_0x509b12[_0x3c20('0x43')]!=_0x3c20('0x54')){return createEndUser(_0x3237cf,_0x496a2b,_0x1ca7aa,_0x48b77b,_0x1011eb,_0x509b12);}else{return{};}});break;case _0x3c20('0x57'):_0x5d12aa[_0x3c20('0x50')]=_0x3c20('0x51')+_0x496a2b+_0x3c20('0x53')+_0x48b77b+'))';return getZohoUser(_0x5d12aa,_0x3c20('0x58'))['then'](function(_0x1f3645){if(_0x1f3645)return _0x1f3645;if(_0x509b12[_0x3c20('0x43')]!=_0x3c20('0x54')){return createEndUser(_0x3237cf,_0x496a2b,_0x1ca7aa,_0x48b77b,_0x1011eb,_0x509b12);}else{return{};}});break;}}function getCall(_0x4f0b57,_0x55a8f0,_0x465d20,_0x2517fe,_0x16d42e,_0x484805,_0x470cfc,_0x44cf8d){logger[_0x3c20('0x2e')](_0x3c20('0x59'));var _0x5bbf7b={};_0x5bbf7b['Owner']={'name':!_[_0x3c20('0x1d')](_0x2517fe[_0x3c20('0x44')][_0x3c20('0x19')])&&!_[_0x3c20('0x1d')](_0x2517fe['profile'][_0x3c20('0x19')])&&_0x2517fe[_0x3c20('0x3c')]['name']==='administrator'?_0x2517fe[_0x3c20('0x44')][_0x3c20('0x19')]:!_['isNil'](_0x2517fe[_0x3c20('0x45')])?_0x2517fe[_0x3c20('0x45')]+'\x20'+_0x2517fe[_0x3c20('0x46')]:_0x2517fe[_0x3c20('0x46')],'id':_0x2517fe['id']};_0x5bbf7b[_0x3c20('0x5a')]=intUtil[_0x3c20('0x5b')](_0x484805['Subjects'],_0x470cfc,'\x20');_0x5bbf7b[_0x3c20('0x5c')]=intUtil[_0x3c20('0x5b')](_0x484805[_0x3c20('0x5d')],_0x470cfc,'\x0a');if(_0x16d42e[_0x3c20('0x40')]===_0x3c20('0x56')){_0x5bbf7b['Who_Id']={'name':!_[_0x3c20('0x1d')](_0x16d42e[_0x3c20('0x5e')])?_0x16d42e[_0x3c20('0x5e')]:!_[_0x3c20('0x1d')](_0x16d42e['First_Name'])?_0x16d42e[_0x3c20('0x5f')]+'\x20'+_0x16d42e[_0x3c20('0x60')]:_0x16d42e[_0x3c20('0x60')],'id':_0x16d42e['id']};}if(_0x16d42e[_0x3c20('0x40')]===_0x3c20('0x58')){_0x5bbf7b[_0x3c20('0x61')]={'name':!_[_0x3c20('0x1d')](_0x16d42e['Full_Name'])?_0x16d42e[_0x3c20('0x5e')]:!_[_0x3c20('0x1d')](_0x16d42e['First_Name'])?_0x16d42e[_0x3c20('0x5f')]+'\x20'+_0x16d42e[_0x3c20('0x60')]:_0x16d42e[_0x3c20('0x60')],'id':_0x16d42e['id']};_0x5bbf7b['$se_module']=_[_0x3c20('0x42')](_0x16d42e[_0x3c20('0x40')]);}if(_0x470cfc['talktime']){_0x5bbf7b[_0x3c20('0x62')]=moment['utc'](parseInt(_0x470cfc['talktime'])*0x3e8)[_0x3c20('0x63')]('mm:ss');}else if(_0x470cfc[_0x3c20('0x64')]&&_0x470cfc[_0x3c20('0x65')]){_0x5bbf7b['Call_Duration']=moment[_0x3c20('0x66')](moment(_0x470cfc[_0x3c20('0x65')],_0x3c20('0x67'))[_0x3c20('0x68')](moment(_0x470cfc[_0x3c20('0x69')],_0x3c20('0x67'))))[_0x3c20('0x63')](_0x3c20('0x6a'));}switch(_0x470cfc['lastevent']){case _0x3c20('0x6b'):_0x5bbf7b['Call_Result']=_0x3c20('0x6c');break;case _0x3c20('0x6d'):case _0x3c20('0x6e'):_0x5bbf7b[_0x3c20('0x6f')]=_0x3c20('0x70');break;case _0x3c20('0x71'):_0x5bbf7b[_0x3c20('0x6f')]=_0x3c20('0x72');break;case _0x3c20('0x73'):_0x5bbf7b[_0x3c20('0x6f')]=_0x3c20('0x74');break;case _0x3c20('0x75'):_0x5bbf7b[_0x3c20('0x6f')]=_0x3c20('0x76');default:}_0x5bbf7b['Call_Start_Time']=(_0x44cf8d==='outbound'?moment(_0x470cfc[_0x3c20('0x69')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x470cfc[_0x3c20('0x77')])[_0x3c20('0x63')](_0x3c20('0x67')))||moment()[_0x3c20('0x63')](_0x3c20('0x67'));_0x5bbf7b['Call_Type']=_0x44cf8d||_0x3c20('0x78');_0x5bbf7b=_[_0x3c20('0x79')](_0x5bbf7b,getCustomFields(_0x484805[_0x3c20('0x7a')],_0x470cfc));return request({'method':_0x3c20('0x25'),'uri':_0x3c20('0x51')+_0x55a8f0+_0x3c20('0x7b'),'headers':{'Authorization':_0x3c20('0x47')+_0x4f0b57},'body':{'data':[_0x5bbf7b]},'json':!![]})[_0x3c20('0x33')](function(_0x5ab3b5){if(_0x5ab3b5&&_0x5ab3b5[_0x3c20('0x3f')][0x0]['code']===_0x3c20('0x49')){logger[_0x3c20('0x2e')](_0x3c20('0x7c'));return{'id':_0x5ab3b5[_0x3c20('0x3f')][0x0][_0x3c20('0x4a')]['id']};}})[_0x3c20('0x2b')](function(_0x3255e9){logger[_0x3c20('0x2e')](_0x3c20('0x7d'),_0x3255e9[_0x3c20('0x7e')]);console[_0x3c20('0x4c')](_0x3c20('0x7d'),_0x3255e9);});}exports[_0x3c20('0x7f')]=function(_0x385d06,_0x29b383,_0x37a276,_0x18a9a0,_0x48488c,_0x331818){var _0x1c8506,_0x30d01f,_0x2d34fe;_0x331818[_0x3c20('0x80')]=intUtil['stripTrailingSlash'](_0x331818[_0x3c20('0x80')]);_0x331818[_0x3c20('0x81')]=intUtil[_0x3c20('0x82')](_0x331818['serverUrl']);if(_0x48488c&&_0x48488c['monitor_format']){logger[_0x3c20('0x2e')](_0x3c20('0x83'),_0x3c20('0x84'));_0x29b383['recordingURL']=_0x331818[_0x3c20('0x81')]+_0x3c20('0x85')+_0x29b383[_0x3c20('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x29b383[_0x3c20('0x86')]);}else{_0x29b383[_0x3c20('0x87')]='';}var _0x417c5c=_0x331818[_0x3c20('0x80')]===_0x3c20('0x88')?'eu':_0x3c20('0x89');return getAccessToken(_0x331818)[_0x3c20('0x33')](function(_0x2a2ef0){_0x2d34fe=_0x2a2ef0;return getUser(_0x2d34fe,_0x417c5c,_0x331818,_0x18a9a0[_0x3c20('0x37')]);})['then'](function(_0x4b4b44){_0x1c8506=_0x4b4b44;logger['info'](_0x3c20('0x8a'),_0x1c8506['id']);return getEndUser(_0x2d34fe,_0x417c5c,_0x331818,_0x29b383['calleridname'],_0x29b383[_0x3c20('0x8b')],_0x1c8506,_0x37a276);})[_0x3c20('0x33')](function(_0x54c155){_0x30d01f=_0x54c155;return getCall(_0x2d34fe,_0x417c5c,_0x331818,_0x1c8506,_0x30d01f,_0x37a276,_0x29b383,_0x3c20('0x78'));})[_0x3c20('0x33')](function(_0x4bb935){if(_0x4bb935){logger['info']('The\x20Call\x20ID\x20is:',_0x4bb935['id']);logger[_0x3c20('0x2e')](_0x3c20('0x83'),_0x3c20('0x8c'));emit(util[_0x3c20('0x63')](_0x3c20('0x8d'),_0x18a9a0[_0x3c20('0x19')]),_0x3c20('0x8e'),{'uri':'https://crm.'+_0x331818['host']+_0x3c20('0x8f')+_0x4bb935['id']});}})[_0x3c20('0x2b')](function(_0x36a428){logger[_0x3c20('0x2c')](_0x3c20('0x83'),JSON[_0x3c20('0xf')](_0x36a428));});};exports[_0x3c20('0x90')]=function(_0x3cbe4a,_0x259f2b,_0x29d397,_0x5e5eec,_0x2d41e1,_0x18bc98,_0x2d65d9){var _0x4b1469,_0x55de28,_0x5ed1c6;_0x18bc98[_0x3c20('0x80')]=intUtil[_0x3c20('0x82')](_0x18bc98[_0x3c20('0x80')]);_0x18bc98[_0x3c20('0x81')]=intUtil[_0x3c20('0x82')](_0x18bc98[_0x3c20('0x81')]);if(_0x2d65d9&&_0x2d65d9[_0x3c20('0x91')]&&_0x2d65d9[_0x3c20('0x91')]!==_0x3c20('0x92')){logger[_0x3c20('0x2e')](_0x3c20('0x93'),'Recording\x20is\x20enabled!');_0x259f2b['recordingURL']=_0x18bc98[_0x3c20('0x81')]+'/api/voice/recordings/'+_0x259f2b[_0x3c20('0x86')]+_0x3c20('0x94')+md5(_0x259f2b[_0x3c20('0x86')]);}var _0x31a441=_0x18bc98[_0x3c20('0x80')]===_0x3c20('0x88')?'eu':'com';return getAccessToken(_0x18bc98)[_0x3c20('0x33')](function(_0x37403f){_0x5ed1c6=_0x37403f;return getUser(_0x5ed1c6,_0x31a441,_0x18bc98,_0x5e5eec['email']);})[_0x3c20('0x33')](function(_0x4b8b2d){_0x4b1469=_0x4b8b2d;logger[_0x3c20('0x2e')](_0x3c20('0x8a'),_0x4b1469['id']);return getEndUser(_0x5ed1c6,_0x31a441,_0x18bc98,_0x259f2b[_0x3c20('0x95')],_0x259f2b[_0x3c20('0x96')],_0x4b1469,_0x29d397);})[_0x3c20('0x33')](function(_0x502ed2){_0x55de28=_0x502ed2;return getCall(_0x5ed1c6,_0x31a441,_0x18bc98,_0x4b1469,_0x55de28,_0x29d397,_0x259f2b,_0x3c20('0x97'));})[_0x3c20('0x33')](function(_0x5afa0f){if(_0x5afa0f){logger[_0x3c20('0x2e')](_0x3c20('0x98'),_0x5afa0f['id']);logger[_0x3c20('0x2e')](_0x3c20('0x93'),_0x3c20('0x8c'));emit(util[_0x3c20('0x63')](_0x3c20('0x8d'),_0x5e5eec[_0x3c20('0x19')]),'trigger:browser:url',{'uri':_0x3c20('0x99')+_0x18bc98[_0x3c20('0x80')]+_0x3c20('0x8f')+_0x5afa0f['id']});}})[_0x3c20('0x2b')](function(_0x4d0d7e){logger[_0x3c20('0x2c')]('[OUTBOUND]',JSON[_0x3c20('0xf')](_0x4d0d7e));});};exports[_0x3c20('0x9a')]=function(_0x2cef9d,_0x2c9124,_0x16b1bb,_0x26e00a,_0x166d6d,_0x121971){var _0x1f061c,_0xbbfbd4,_0x1bda1a;_0x121971[_0x3c20('0x80')]=intUtil['stripTrailingSlash'](_0x121971[_0x3c20('0x80')]);_0x121971[_0x3c20('0x81')]=intUtil[_0x3c20('0x82')](_0x121971['serverUrl']);if(_0x166d6d&&_0x166d6d['monitor_format']){logger[_0x3c20('0x2e')]('['+_0x2c9124[_0x3c20('0x9b')][_0x3c20('0x9c')]()+']','Recording\x20is\x20enabled!');_0x2c9124['recordingURL']=_0x121971['serverUrl']+_0x3c20('0x85')+_0x2c9124[_0x3c20('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x2c9124[_0x3c20('0x86')]);}else{_0x2c9124['recordingURL']='';}var _0x23d973=_0x121971[_0x3c20('0x80')]===_0x3c20('0x88')?'eu':'com';return getAccessToken(_0x121971)[_0x3c20('0x33')](function(_0x64a032){_0x1bda1a=_0x64a032;return getUser(_0x1bda1a,_0x23d973,_0x121971);})[_0x3c20('0x33')](function(_0x37aa5e){_0x1f061c=_0x37aa5e;logger[_0x3c20('0x2e')]('The\x20User\x20ID\x20is:',_0x1f061c['id']);return getEndUser(_0x1bda1a,_0x23d973,_0x121971,_0x2c9124[_0x3c20('0x9d')],_0x2c9124['calleridnum'],_0x1f061c,_0x16b1bb);})[_0x3c20('0x33')](function(_0x44f9f9){_0xbbfbd4=_0x44f9f9;return getCall(_0x1bda1a,_0x23d973,_0x121971,_0x1f061c,_0xbbfbd4,_0x16b1bb,_0x2c9124,_0x3c20('0x78'));})[_0x3c20('0x33')](function(_0x35ecc0){if(_0x35ecc0){logger[_0x3c20('0x2e')](_0x3c20('0x98'),_0x35ecc0['id']);}})[_0x3c20('0x2b')](function(_0x32e034){logger[_0x3c20('0x2c')]('['+_0x2c9124[_0x3c20('0x9b')][_0x3c20('0x9c')]()+']',JSON[_0x3c20('0xf')](_0x32e034));});}; \ No newline at end of file +var _0x08e7=['lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','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','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','role','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Owner','first_name','last_name','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','none','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','com','calleridnum'];(function(_0x453b84,_0x30f3af){var _0x167261=function(_0x4670bf){while(--_0x4670bf){_0x453b84['push'](_0x453b84['shift']());}};_0x167261(++_0x30f3af);}(_0x08e7,0x9d));var _0x708e=function(_0x3f3c14,_0x5780fd){_0x3f3c14=_0x3f3c14-0x0;var _0x413cff=_0x08e7[_0x3f3c14];return _0x413cff;};'use strict';var _=require(_0x708e('0x0'));var rp=require(_0x708e('0x1'));var md5=require(_0x708e('0x2'));var util=require(_0x708e('0x3'));var intUtil=require(_0x708e('0x4'));var moment=require(_0x708e('0x5'));var Redis=require(_0x708e('0x6'));var BPromise=require(_0x708e('0x7'));var config=require(_0x708e('0x8'));var logger=require('../../../../config/logger')(_0x708e('0x9'));config[_0x708e('0xa')]=_[_0x708e('0xb')](config['redis'],{'host':_0x708e('0xc'),'port':0x18eb});var io=require(_0x708e('0xd'))(new Redis(config[_0x708e('0xa')]));function emit(_0x554363,_0x5e564e,_0x12a1eb){io['to'](_0x554363)[_0x708e('0xe')](_0x5e564e,_0x12a1eb);}function request(_0x3da4ae){logger['debug'](_0x708e('0xf'),JSON[_0x708e('0x10')](_0x3da4ae));return rp(_0x3da4ae);}function getCustomFields(_0x1b88ba,_0x3af3d5){var _0x39cc8b={};if(_0x1b88ba[_0x708e('0x11')]>0x0){_[_0x708e('0x12')](_0x1b88ba,function(_0x22d316){if(_[_0x708e('0x13')]([_0x708e('0x14'),_0x708e('0x15')],_0x22d316[_0x708e('0x16')])&&_0x22d316[_0x708e('0x17')]){_0x39cc8b[_0x22d316[_0x708e('0x17')]]=_0x22d316[_0x708e('0x18')][_0x708e('0x19')]();}else if(_0x22d316['type']==='variable'&&_0x22d316[_0x708e('0x1a')]&&_0x22d316[_0x708e('0x17')]&&_0x3af3d5[_0x22d316['variableName']]){_0x39cc8b[_0x22d316['idField']]=_0x3af3d5[_0x22d316[_0x708e('0x1a')]][_0x708e('0x19')]();}else if(_0x22d316[_0x708e('0x16')]===_0x708e('0x1b')&&_0x22d316[_0x708e('0x1c')]&&_0x22d316[_0x708e('0x1c')][_0x708e('0x1d')]&&_0x22d316[_0x708e('0x17')]&&_0x3af3d5[_0x22d316[_0x708e('0x1c')][_0x708e('0x1d')][_0x708e('0x1e')]()]){_0x39cc8b[_0x22d316['idField']]=_0x3af3d5[_0x22d316[_0x708e('0x1c')][_0x708e('0x1d')][_0x708e('0x1e')]()][_0x708e('0x19')]();}});}return _0x39cc8b;}function getName(_0x2b5f7a){if(_0x2b5f7a[_0x708e('0x1f')]('\x20')>0x0){var _0x4591de=_0x2b5f7a[_0x708e('0x20')](/ (.+)/);if(_0x4591de[0x1]){return _0x4591de;}}return[_0x2b5f7a,_0x2b5f7a];}var accountsTokens={};function getAccessToken(_0x5d69d7){return new Promise(function(_0x2f1855,_0x4b9cee){if(!_[_0x708e('0x21')](accountsTokens[_0x5d69d7['id']])&&!_['isNil'](accountsTokens[_0x5d69d7['id']][_0x708e('0x22')])){if(moment()[_0x708e('0x23')](accountsTokens[_0x5d69d7['id']]['expires_in'])){_0x2f1855(accountsTokens[_0x5d69d7['id']]['access_token']);}}var _0x479913;switch(_0x5d69d7['zone']){case'US':_0x479913=_0x708e('0x24');break;case'AU':_0x479913=_0x708e('0x25');break;case'EU':_0x479913=_0x708e('0x26');break;case'IN':_0x479913=_0x708e('0x27');break;case'CN':_0x479913=_0x708e('0x28');break;default:_0x479913=_0x708e('0x26');break;}var _0x1ec897={'method':_0x708e('0x29'),'uri':_0x479913+_0x708e('0x2a'),'qs':{'refresh_token':_0x5d69d7[_0x708e('0x2b')],'client_id':_0x5d69d7[_0x708e('0x2c')],'client_secret':_0x5d69d7[_0x708e('0x2d')],'grant_type':_0x708e('0x2e')},'json':!![]};return rp(_0x1ec897)[_0x708e('0x2f')](function(_0x4a1b54){accountsTokens[_0x5d69d7['id']]={'access_token':_0x4a1b54['access_token'],'expires_in':moment()['add'](_0x4a1b54['expires_in'],_0x708e('0x30'))};_0x2f1855(_0x4a1b54['access_token']);})[_0x708e('0x31')](function(_0x207e39){logger[_0x708e('0x32')](_0x708e('0x33'),_0x207e39[_0x708e('0x34')]);_0x4b9cee(_0x207e39);});});}function getUser(_0x425a60,_0x4f2d5f,_0x42f91b,_0x17783a){logger[_0x708e('0x35')](_0x708e('0x36'));return request({'method':_0x708e('0x37'),'uri':util[_0x708e('0x38')]('https://www.zohoapis.%s/crm/v2/users',_0x4f2d5f),'qs':{'type':_0x708e('0x39')},'headers':{'Authorization':_0x708e('0x3a')+_0x425a60},'json':!![]})[_0x708e('0x2f')](function(_0x14392f){if(_0x14392f[_0x708e('0x3b')]){var _0xc4bfaf=-0x1;if(_[_0x708e('0x3c')](_0x14392f['users'])){if(!_['isNil'](_0x17783a)){_0xc4bfaf=_[_0x708e('0x3d')](_0x14392f[_0x708e('0x3b')],function(_0x56a42e){return _0x56a42e[_0x708e('0x3e')]===_0x17783a;});}if(_0xc4bfaf>=0x0){logger[_0x708e('0x35')](_0x708e('0x3f'));}else{logger[_0x708e('0x35')](_0x708e('0x40'));_0xc4bfaf=_[_0x708e('0x3d')](_0x14392f[_0x708e('0x3b')],function(_0x4a4433){return _0x4a4433[_0x708e('0x41')][_0x708e('0x1d')]==='Administrator';});}return _0x14392f[_0x708e('0x3b')][_0xc4bfaf];}else{if(_0x14392f['user']['profile'][_0x708e('0x1d')]===_0x708e('0x42')){logger[_0x708e('0x35')](_0x708e('0x40'));user=_0x14392f['user'];return user;}else{logger[_0x708e('0x32')](_0x708e('0x43'),JSON[_0x708e('0x10')](_0x14392f));throw new Error(_0x708e('0x44')+JSON[_0x708e('0x10')](_0x14392f));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x708e('0x10')](_0x14392f));throw new Error(_0x708e('0x44')+JSON[_0x708e('0x10')](_0x14392f));}})['catch'](function(_0x4cb071){console[_0x708e('0x32')](_0x4cb071);});}function getZohoUser(_0x1d3e11,_0x2f2da9){return new BPromise(function(_0x1e61be,_0x2a8eea){request(_0x1d3e11)[_0x708e('0x2f')](function(_0x4685d8){var _0x3e6431=null;if(_0x4685d8){_0x3e6431=_0x4685d8[_0x708e('0x45')][0x0];_0x3e6431[_0x708e('0x46')]=_0x2f2da9;}_0x1e61be(_0x3e6431);})[_0x708e('0x31')](function(_0x265226){_0x2a8eea(_0x265226);});});}function createEndUser(_0x519543,_0xc0c275,_0x8926c5,_0x42c883,_0x50991f,_0x4dd0b8){var _0x8926c5=getName(_0x8926c5);return request({'method':_0x708e('0x29'),'uri':_0x708e('0x47')+_0xc0c275+'/crm/v2/'+_[_0x708e('0x48')](_0x4dd0b8['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x8926c5[0x1],'First_Name':_0x8926c5[0x0],'Phone':_0x42c883,'Owner':{'name':!_[_0x708e('0x21')](_0x50991f['role'][_0x708e('0x1d')])?_0x50991f[_0x708e('0x49')][_0x708e('0x1d')]:!_['isNil'](_0x50991f['first_name'])?_0x50991f['first_name']+'\x20'+_0x50991f['last_name']:_0x50991f['last_name'],'id':_0x50991f['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x519543},'json':!![]})[_0x708e('0x2f')](function(_0x2d3be7){if(_0x2d3be7&&_0x2d3be7[_0x708e('0x45')][0x0][_0x708e('0x4a')]===_0x708e('0x4b')){var _0x4d2dfe=_0x2d3be7['data'][0x0][_0x708e('0x4c')];_0x4d2dfe[_0x708e('0x46')]=_[_0x708e('0x48')](_0x4dd0b8[_0x708e('0x4d')])+'s';return _0x4d2dfe;}logger[_0x708e('0x32')](_0x708e('0x43'),JSON[_0x708e('0x10')](data));throw new Error(_0x708e('0x4e')+JSON[_0x708e('0x10')](data));})[_0x708e('0x31')](function(_0x2f7db6){console[_0x708e('0x4f')](_0x708e('0x50'),_0x2f7db6);});}function getEndUser(_0x3902bd,_0x219004,_0x3c41d6,_0x6a5400,_0x3bcdd1,_0x1a9c05,_0x1088a4){var _0x40353c={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3902bd},'json':!![]};switch(_0x1088a4[_0x708e('0x51')]){case _0x708e('0x52'):_0x40353c['uri']=_0x708e('0x47')+_0x219004+_0x708e('0x53')+_0x3bcdd1+'))';return getZohoUser(_0x40353c,_0x708e('0x54'))['then'](function(_0x86a17a){if(_0x86a17a)return _0x86a17a;_0x40353c[_0x708e('0x55')]='https://www.zohoapis.'+_0x219004+_0x708e('0x56')+_0x3bcdd1+'))';return getZohoUser(_0x40353c,'Leads')[_0x708e('0x2f')](function(_0x3d3de8){if(_0x3d3de8)return _0x3d3de8;if(_0x1088a4['moduleCreate']!=_0x708e('0x57')){return createEndUser(_0x3902bd,_0x219004,_0x6a5400,_0x3bcdd1,_0x1a9c05,_0x1088a4);}else{return{};}});});break;case _0x708e('0x58'):_0x40353c[_0x708e('0x55')]=_0x708e('0x47')+_0x219004+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3bcdd1+'))';return getZohoUser(_0x40353c,_0x708e('0x54'))[_0x708e('0x2f')](function(_0xb9263){if(_0xb9263)return _0xb9263;if(_0x1088a4[_0x708e('0x4d')]!=_0x708e('0x57')){return createEndUser(_0x3902bd,_0x219004,_0x6a5400,_0x3bcdd1,_0x1a9c05,_0x1088a4);}else{return{};}});break;case _0x708e('0x59'):_0x40353c[_0x708e('0x55')]=_0x708e('0x47')+_0x219004+_0x708e('0x56')+_0x3bcdd1+'))';return getZohoUser(_0x40353c,_0x708e('0x5a'))[_0x708e('0x2f')](function(_0x41ec80){if(_0x41ec80)return _0x41ec80;if(_0x1088a4[_0x708e('0x4d')]!=_0x708e('0x57')){return createEndUser(_0x3902bd,_0x219004,_0x6a5400,_0x3bcdd1,_0x1a9c05,_0x1088a4);}else{return{};}});break;}}function getCall(_0x382884,_0x50164c,_0x42997c,_0x409494,_0x13b7bd,_0xe5181b,_0x2ec42d,_0x5b5082){logger[_0x708e('0x35')]('Creating\x20new\x20call...');var _0x1f8db4={};_0x1f8db4[_0x708e('0x5b')]={'name':!_[_0x708e('0x21')](_0x409494[_0x708e('0x49')][_0x708e('0x1d')])&&!_[_0x708e('0x21')](_0x409494[_0x708e('0x41')][_0x708e('0x1d')])&&_0x409494['profile'][_0x708e('0x1d')]==='administrator'?_0x409494[_0x708e('0x49')][_0x708e('0x1d')]:!_[_0x708e('0x21')](_0x409494[_0x708e('0x5c')])?_0x409494[_0x708e('0x5c')]+'\x20'+_0x409494[_0x708e('0x5d')]:_0x409494['last_name'],'id':_0x409494['id']};_0x1f8db4[_0x708e('0x5e')]=intUtil[_0x708e('0x5f')](_0xe5181b[_0x708e('0x60')],_0x2ec42d,'\x20');_0x1f8db4['Description']=intUtil[_0x708e('0x5f')](_0xe5181b[_0x708e('0x61')],_0x2ec42d,'\x0a');if(_0x13b7bd[_0x708e('0x46')]===_0x708e('0x54')){_0x1f8db4[_0x708e('0x62')]={'name':!_[_0x708e('0x21')](_0x13b7bd['Full_Name'])?_0x13b7bd[_0x708e('0x63')]:!_['isNil'](_0x13b7bd[_0x708e('0x64')])?_0x13b7bd[_0x708e('0x64')]+'\x20'+_0x13b7bd['Last_Name']:_0x13b7bd[_0x708e('0x65')],'id':_0x13b7bd['id']};}if(_0x13b7bd['enduserType']===_0x708e('0x5a')){_0x1f8db4['What_Id']={'name':!_['isNil'](_0x13b7bd[_0x708e('0x63')])?_0x13b7bd[_0x708e('0x63')]:!_['isNil'](_0x13b7bd[_0x708e('0x64')])?_0x13b7bd[_0x708e('0x64')]+'\x20'+_0x13b7bd[_0x708e('0x65')]:_0x13b7bd[_0x708e('0x65')],'id':_0x13b7bd['id']};_0x1f8db4['$se_module']=_[_0x708e('0x48')](_0x13b7bd['enduserType']);}if(_0x2ec42d[_0x708e('0x66')]){_0x1f8db4['Call_Duration']=moment[_0x708e('0x67')](parseInt(_0x2ec42d[_0x708e('0x66')])*0x3e8)[_0x708e('0x38')](_0x708e('0x68'));}else if(_0x2ec42d[_0x708e('0x69')]&&_0x2ec42d[_0x708e('0x6a')]){_0x1f8db4[_0x708e('0x6b')]=moment[_0x708e('0x67')](moment(_0x2ec42d[_0x708e('0x6a')],_0x708e('0x6c'))[_0x708e('0x6d')](moment(_0x2ec42d[_0x708e('0x6e')],'YYYY-MM-DDTHH:mm:ss')))[_0x708e('0x38')](_0x708e('0x68'));}switch(_0x2ec42d[_0x708e('0x6f')]){case _0x708e('0x70'):_0x1f8db4[_0x708e('0x71')]='Called';break;case _0x708e('0x72'):case _0x708e('0x73'):_0x1f8db4[_0x708e('0x71')]='Answered';break;case _0x708e('0x74'):_0x1f8db4[_0x708e('0x71')]=_0x708e('0x75');break;case _0x708e('0x76'):_0x1f8db4['Call_Result']=_0x708e('0x77');break;case _0x708e('0x78'):_0x1f8db4[_0x708e('0x71')]='Timeout';default:}_0x1f8db4[_0x708e('0x79')]=(_0x5b5082===_0x708e('0x7a')?moment(_0x2ec42d[_0x708e('0x6e')])[_0x708e('0x38')](_0x708e('0x6c')):moment(_0x2ec42d['agentcalledAt'])[_0x708e('0x38')](_0x708e('0x6c')))||moment()[_0x708e('0x38')](_0x708e('0x6c'));_0x1f8db4[_0x708e('0x7b')]=_0x5b5082||_0x708e('0x7c');_0x1f8db4=_['merge'](_0x1f8db4,getCustomFields(_0xe5181b[_0x708e('0x7d')],_0x2ec42d));return request({'method':_0x708e('0x29'),'uri':_0x708e('0x47')+_0x50164c+_0x708e('0x7e'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x382884},'body':{'data':[_0x1f8db4]},'json':!![]})['then'](function(_0x33f326){if(_0x33f326&&_0x33f326[_0x708e('0x45')][0x0]['code']==='SUCCESS'){logger['info'](_0x708e('0x7f'));return{'id':_0x33f326[_0x708e('0x45')][0x0]['details']['id']};}})[_0x708e('0x31')](function(_0x223344){logger[_0x708e('0x35')](_0x708e('0x80'),_0x223344[_0x708e('0x34')]);console[_0x708e('0x4f')](_0x708e('0x80'),_0x223344);});}exports[_0x708e('0x81')]=function(_0x20bd72,_0x21edab,_0x599fd6,_0x5f5096,_0x115195,_0x14113c){var _0x275e63,_0x546ad7,_0x147a18;_0x14113c[_0x708e('0x82')]=intUtil[_0x708e('0x83')](_0x14113c[_0x708e('0x82')]);_0x14113c['serverUrl']=intUtil[_0x708e('0x83')](_0x14113c[_0x708e('0x84')]);if(_0x115195&&_0x115195['monitor_format']){logger[_0x708e('0x35')](_0x708e('0x85'),_0x708e('0x86'));_0x21edab[_0x708e('0x87')]=_0x14113c['serverUrl']+_0x708e('0x88')+_0x21edab[_0x708e('0x89')]+_0x708e('0x8a')+md5(_0x21edab[_0x708e('0x89')]);}else{_0x21edab['recordingURL']='';}var _0x1e77be=_0x14113c[_0x708e('0x82')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x14113c)['then'](function(_0x27197a){_0x147a18=_0x27197a;return getUser(_0x147a18,_0x1e77be,_0x14113c,_0x5f5096[_0x708e('0x3e')]);})[_0x708e('0x2f')](function(_0x5384a7){_0x275e63=_0x5384a7;logger['info'](_0x708e('0x8b'),_0x275e63['id']);return getEndUser(_0x147a18,_0x1e77be,_0x14113c,_0x21edab['calleridname'],_0x21edab['calleridnum'],_0x275e63,_0x599fd6);})[_0x708e('0x2f')](function(_0x5a6f41){_0x546ad7=_0x5a6f41;return getCall(_0x147a18,_0x1e77be,_0x14113c,_0x275e63,_0x546ad7,_0x599fd6,_0x21edab,'Inbound');})[_0x708e('0x2f')](function(_0x2f740c){if(_0x2f740c){logger[_0x708e('0x35')]('The\x20Call\x20ID\x20is:',_0x2f740c['id']);logger['info'](_0x708e('0x85'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x708e('0x38')](_0x708e('0x8c'),_0x5f5096[_0x708e('0x1d')]),_0x708e('0x8d'),{'uri':_0x708e('0x8e')+_0x14113c[_0x708e('0x82')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2f740c['id']});}})[_0x708e('0x31')](function(_0x2154b4){logger['error'](_0x708e('0x85'),JSON[_0x708e('0x10')](_0x2154b4));});};exports[_0x708e('0x7a')]=function(_0xfe6aef,_0x522a8c,_0x29f337,_0x571c19,_0x12e947,_0x3f2b6d,_0x525f04){var _0x47863a,_0x5438ae,_0x493646;_0x3f2b6d[_0x708e('0x82')]=intUtil['stripTrailingSlash'](_0x3f2b6d['host']);_0x3f2b6d[_0x708e('0x84')]=intUtil[_0x708e('0x83')](_0x3f2b6d[_0x708e('0x84')]);if(_0x525f04&&_0x525f04['recordingFormat']&&_0x525f04['recordingFormat']!==_0x708e('0x8f')){logger['info'](_0x708e('0x90'),'Recording\x20is\x20enabled!');_0x522a8c['recordingURL']=_0x3f2b6d[_0x708e('0x84')]+_0x708e('0x88')+_0x522a8c[_0x708e('0x89')]+_0x708e('0x8a')+md5(_0x522a8c['uniqueid']);}var _0x5f1471=_0x3f2b6d[_0x708e('0x82')]===_0x708e('0x91')?'eu':'com';return getAccessToken(_0x3f2b6d)[_0x708e('0x2f')](function(_0x279635){_0x493646=_0x279635;return getUser(_0x493646,_0x5f1471,_0x3f2b6d,_0x571c19[_0x708e('0x3e')]);})[_0x708e('0x2f')](function(_0xed590){_0x47863a=_0xed590;logger['info'](_0x708e('0x8b'),_0x47863a['id']);return getEndUser(_0x493646,_0x5f1471,_0x3f2b6d,_0x522a8c[_0x708e('0x92')],_0x522a8c[_0x708e('0x93')],_0x47863a,_0x29f337);})[_0x708e('0x2f')](function(_0x9caeb3){_0x5438ae=_0x9caeb3;return getCall(_0x493646,_0x5f1471,_0x3f2b6d,_0x47863a,_0x5438ae,_0x29f337,_0x522a8c,_0x708e('0x94'));})[_0x708e('0x2f')](function(_0x31d7c6){if(_0x31d7c6){logger[_0x708e('0x35')](_0x708e('0x95'),_0x31d7c6['id']);logger['info'](_0x708e('0x90'),_0x708e('0x96'));emit(util['format'](_0x708e('0x8c'),_0x571c19[_0x708e('0x1d')]),_0x708e('0x8d'),{'uri':_0x708e('0x8e')+_0x3f2b6d['host']+_0x708e('0x97')+_0x31d7c6['id']});}})['catch'](function(_0x3ce41f){logger[_0x708e('0x32')](_0x708e('0x90'),JSON[_0x708e('0x10')](_0x3ce41f));});};exports[_0x708e('0x98')]=function(_0x395c00,_0x41b82c,_0x5cbc01,_0x4ea7c4,_0x4ad0a3,_0x5213b6){var _0x8f592a,_0x503bb4,_0x152bd6;_0x5213b6[_0x708e('0x82')]=intUtil[_0x708e('0x83')](_0x5213b6['host']);_0x5213b6['serverUrl']=intUtil[_0x708e('0x83')](_0x5213b6[_0x708e('0x84')]);if(_0x4ad0a3&&_0x4ad0a3[_0x708e('0x99')]){logger['info']('['+_0x41b82c[_0x708e('0x6f')][_0x708e('0x9a')]()+']',_0x708e('0x86'));_0x41b82c[_0x708e('0x87')]=_0x5213b6[_0x708e('0x84')]+_0x708e('0x88')+_0x41b82c[_0x708e('0x89')]+'/downloads?type=uniqueid&token='+md5(_0x41b82c[_0x708e('0x89')]);}else{_0x41b82c['recordingURL']='';}var _0x16571d=_0x5213b6[_0x708e('0x82')]==='zoho.eu'?'eu':_0x708e('0x9b');return getAccessToken(_0x5213b6)['then'](function(_0x2dd60e){_0x152bd6=_0x2dd60e;return getUser(_0x152bd6,_0x16571d,_0x5213b6);})[_0x708e('0x2f')](function(_0x3f9400){_0x8f592a=_0x3f9400;logger[_0x708e('0x35')]('The\x20User\x20ID\x20is:',_0x8f592a['id']);return getEndUser(_0x152bd6,_0x16571d,_0x5213b6,_0x41b82c['calleridname'],_0x41b82c[_0x708e('0x9c')],_0x8f592a,_0x5cbc01);})['then'](function(_0x233b6e){_0x503bb4=_0x233b6e;return getCall(_0x152bd6,_0x16571d,_0x5213b6,_0x8f592a,_0x503bb4,_0x5cbc01,_0x41b82c,_0x708e('0x7c'));})[_0x708e('0x2f')](function(_0xd625f7){if(_0xd625f7){logger[_0x708e('0x35')]('The\x20Call\x20ID\x20is:',_0xd625f7['id']);}})[_0x708e('0x31')](function(_0x3750fa){logger[_0x708e('0x32')]('['+_0x41b82c[_0x708e('0x6f')][_0x708e('0x9a')]()+']',JSON[_0x708e('0x10')](_0x3750fa));});}; \ 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 23f1412..47e36a6 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 _0x866e=['data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','exec','data2','Script'];(function(_0x50ac50,_0x17ab3c){var _0x598a25=function(_0x4b28b9){while(--_0x4b28b9){_0x50ac50['push'](_0x50ac50['shift']());}};_0x598a25(++_0x17ab3c);}(_0x866e,0x170));var _0xe866=function(_0x4b4d4b,_0x2a4138){_0x4b4d4b=_0x4b4d4b-0x0;var _0x15bb3a=_0x866e[_0x4b4d4b];return _0x15bb3a;};'use strict';var util=require(_0xe866('0x0'));var sh=require(_0xe866('0x1'));var Mustache=require(_0xe866('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0xe866('0x3')]=function(_0x5e0aa2,_0x26485c){var _0x305db8=_0x5e0aa2[_0xe866('0x4')]?_0x5e0aa2[_0xe866('0x4')]:_0xe866('0x5');var _0x84cd61=_0x5e0aa2[_0xe866('0x6')]?Mustache['render'](_0x5e0aa2[_0xe866('0x6')],_0x26485c):_0x26485c;sh[_0xe866('0x3')](_0x84cd61,function(_0xbdf02,_0x24c803,_0x4e1d0a){if(_0xbdf02!==0x0){logger[_0xe866('0x7')](util[_0xe866('0x8')](_0xe866('0x9'),_0x305db8,_0x84cd61,_0xbdf02,_0x4e1d0a));}else{logger[_0xe866('0xa')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x305db8,_0x84cd61,_0x24c803));}});}; \ No newline at end of file +var _0x50d4=['trigger','exec','data2','Script','render','data3','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x50d4,0x8c));var _0x450d=function(_0x565702,_0x265f26){_0x565702=_0x565702-0x0;var _0x8e147e=_0x50d4[_0x565702];return _0x8e147e;};'use strict';var util=require('util');var sh=require(_0x450d('0x0'));var Mustache=require(_0x450d('0x1'));var logger=require(_0x450d('0x2'))(_0x450d('0x3'));exports[_0x450d('0x4')]=function(_0x891484,_0x59ffaa){var _0x13c58b=_0x891484[_0x450d('0x5')]?_0x891484[_0x450d('0x5')]:_0x450d('0x6');var _0x2163b7=_0x891484['data3']?Mustache[_0x450d('0x7')](_0x891484[_0x450d('0x8')],_0x59ffaa):_0x59ffaa;sh['exec'](_0x2163b7,function(_0x3eb21c,_0x25d19e,_0x3af715){if(_0x3eb21c!==0x0){logger[_0x450d('0x9')](util[_0x450d('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x13c58b,_0x2163b7,_0x3eb21c,_0x3af715));}else{logger[_0x450d('0xb')](util[_0x450d('0xa')](_0x450d('0xc'),_0x13c58b,_0x2163b7,_0x25d19e));}});}; \ 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 37e16b6..688456d 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 _0x65e2=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','data2','statusCode','name','message','request-promise','util','../../../../config/logger','data1','toUpperCase','data5','data6','parse','render','error','stack','DELETE','POST','PUT','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','object','format'];(function(_0x14cb49,_0x268e4f){var _0x139faf=function(_0x3dbd52){while(--_0x3dbd52){_0x14cb49['push'](_0x14cb49['shift']());}};_0x139faf(++_0x268e4f);}(_0x65e2,0x102));var _0x265e=function(_0x1cab6a,_0x297a05){_0x1cab6a=_0x1cab6a-0x0;var _0x192913=_0x65e2[_0x1cab6a];return _0x192913;};'use strict';var rp=require(_0x265e('0x0'));var util=require(_0x265e('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x265e('0x2'))('trigger');exports['exec']=function(_0x33fd12,_0x5d3e01){var _0x28b862,_0x4124c5;var _0x102280={'method':_0x33fd12[_0x265e('0x3')][_0x265e('0x4')](),'uri':Mustache['render'](_0x33fd12['data2'],_0x5d3e01),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x33fd12['data5'])==='number'&&parseInt(_0x33fd12[_0x265e('0x5')])>=0x1&&parseInt(_0x33fd12[_0x265e('0x5')])<=0xa?parseInt(_0x33fd12[_0x265e('0x5')])*0x3e8:0x5*0x3e8};try{_0x102280['headers']=_0x33fd12[_0x265e('0x6')]?JSON[_0x265e('0x7')](Mustache[_0x265e('0x8')](_0x33fd12[_0x265e('0x6')],_0x5d3e01)):{};}catch(_0x1751a0){logger[_0x265e('0x9')](_0x1751a0[_0x265e('0xa')]);}switch(_0x33fd12[_0x265e('0x3')][_0x265e('0x4')]()){case'GET':case _0x265e('0xb'):_0x28b862=null;_0x102280['qs']=_0x5d3e01;break;case _0x265e('0xc'):case _0x265e('0xd'):if(_0x33fd12['data7']){try{_0x28b862=JSON['parse'](Mustache[_0x265e('0x8')](_0x33fd12['data7'],_0x5d3e01));_0x102280[_0x265e('0xe')]=_0x28b862;}catch(_0x535022){logger[_0x265e('0x9')](_0x535022[_0x265e('0xa')]);logger[_0x265e('0x9')](_0x265e('0xf'));}}else{_0x28b862=_0x5d3e01;_0x102280[_0x265e('0xe')]=_0x28b862;}break;}logger[_0x265e('0x10')](util['format'](_0x265e('0x11'),_0x33fd12['data1'],_0x33fd12['data2'],JSON['stringify'](_0x102280)));rp(_0x102280)[_0x265e('0x12')](function(_0x441f16){_0x28b862=!_[_0x265e('0x13')](_0x28b862)?',\x20request\x20body:\x20'+_0x28b862:'';_0x4124c5=typeof _0x441f16['body']===_0x265e('0x14')?JSON['stringify'](_0x441f16[_0x265e('0xe')]):_0x441f16[_0x265e('0xe')];logger[_0x265e('0x10')](util[_0x265e('0x15')](_0x265e('0x16'),_0x33fd12[_0x265e('0x3')],_0x33fd12['data2'],_0x441f16['statusCode'],_0x4124c5));})['catch'](function(_0xdb4911){logger[_0x265e('0x9')](util[_0x265e('0x15')](_0x265e('0x17'),_0x33fd12['data1'],_0x33fd12[_0x265e('0x18')],_0xdb4911[_0x265e('0x19')],_0xdb4911[_0x265e('0x1a')],_0xdb4911[_0x265e('0x1b')]));});}; \ No newline at end of file +var _0xadbc=['catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','../../../../config/logger','trigger','data2','number','data5','data6','parse','error','data1','toUpperCase','DELETE','PUT','data7','render','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode'];(function(_0x2cc0b6,_0x4eb810){var _0x14c87f=function(_0x5536dc){while(--_0x5536dc){_0x2cc0b6['push'](_0x2cc0b6['shift']());}};_0x14c87f(++_0x4eb810);}(_0xadbc,0xc4));var _0xcadb=function(_0x35f85e,_0x500bcc){_0x35f85e=_0x35f85e-0x0;var _0x41e71a=_0xadbc[_0x35f85e];return _0x41e71a;};'use strict';var rp=require(_0xcadb('0x0'));var util=require(_0xcadb('0x1'));var _=require(_0xcadb('0x2'));var Mustache=require('mustache');var logger=require(_0xcadb('0x3'))(_0xcadb('0x4'));exports['exec']=function(_0x3447fe,_0x10d667){var _0x4857ab,_0x432222;var _0x3b6233={'method':_0x3447fe['data1']['toUpperCase'](),'uri':Mustache['render'](_0x3447fe[_0xcadb('0x5')],_0x10d667),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3447fe['data5'])===_0xcadb('0x6')&&parseInt(_0x3447fe[_0xcadb('0x7')])>=0x1&&parseInt(_0x3447fe[_0xcadb('0x7')])<=0xa?parseInt(_0x3447fe[_0xcadb('0x7')])*0x3e8:0x5*0x3e8};try{_0x3b6233['headers']=_0x3447fe[_0xcadb('0x8')]?JSON[_0xcadb('0x9')](Mustache['render'](_0x3447fe[_0xcadb('0x8')],_0x10d667)):{};}catch(_0x54322b){logger[_0xcadb('0xa')](_0x54322b['stack']);}switch(_0x3447fe[_0xcadb('0xb')][_0xcadb('0xc')]()){case'GET':case _0xcadb('0xd'):_0x4857ab=null;_0x3b6233['qs']=_0x10d667;break;case'POST':case _0xcadb('0xe'):if(_0x3447fe[_0xcadb('0xf')]){try{_0x4857ab=JSON[_0xcadb('0x9')](Mustache[_0xcadb('0x10')](_0x3447fe[_0xcadb('0xf')],_0x10d667));_0x3b6233[_0xcadb('0x11')]=_0x4857ab;}catch(_0x671f3){logger[_0xcadb('0xa')](_0x671f3[_0xcadb('0x12')]);logger[_0xcadb('0xa')](_0xcadb('0x13'));}}else{_0x4857ab=_0x10d667;_0x3b6233[_0xcadb('0x11')]=_0x4857ab;}break;}logger[_0xcadb('0x14')](util[_0xcadb('0x15')](_0xcadb('0x16'),_0x3447fe[_0xcadb('0xb')],_0x3447fe[_0xcadb('0x5')],JSON[_0xcadb('0x17')](_0x3b6233)));rp(_0x3b6233)['then'](function(_0x1deac5){_0x4857ab=!_[_0xcadb('0x18')](_0x4857ab)?',\x20request\x20body:\x20'+_0x4857ab:'';_0x432222=typeof _0x1deac5['body']===_0xcadb('0x19')?JSON['stringify'](_0x1deac5['body']):_0x1deac5['body'];logger[_0xcadb('0x14')](util[_0xcadb('0x15')](_0xcadb('0x1a'),_0x3447fe['data1'],_0x3447fe['data2'],_0x1deac5[_0xcadb('0x1b')],_0x432222));})[_0xcadb('0x1c')](function(_0x3c9b88){logger[_0xcadb('0xa')](util[_0xcadb('0x15')](_0xcadb('0x1d'),_0x3447fe['data1'],_0x3447fe[_0xcadb('0x5')],_0x3c9b88[_0xcadb('0x1b')],_0x3c9b88[_0xcadb('0x1e')],_0x3c9b88[_0xcadb('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 42340f1..2d04a2b 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 _0x20c7=['debug','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then'];(function(_0x57228b,_0x1fc843){var _0x2e5cc5=function(_0x6f058a){while(--_0x6f058a){_0x57228b['push'](_0x57228b['shift']());}};_0x2e5cc5(++_0x1fc843);}(_0x20c7,0xca));var _0x720c=function(_0x5bea7e,_0x5b62b2){_0x5bea7e=_0x5bea7e-0x0;var _0x3b8ed4=_0x20c7[_0x5bea7e];return _0x3b8ed4;};'use strict';var jayson=require(_0x720c('0x0'));var BPromise=require(_0x720c('0x1'));var logger=require(_0x720c('0x2'))(_0x720c('0x3'));var client=jayson['client'][_0x720c('0x4')]({'port':0x2329});client[_0x720c('0x5')]=function(_0x18f492,_0x211619){return new BPromise(function(_0x31e148,_0x3cc283){return client[_0x720c('0x6')](_0x18f492,_0x211619)[_0x720c('0x7')](function(_0x5d0c23){logger[_0x720c('0x8')]('rpc',_0x720c('0x3'),_0x18f492,_0x211619,_0x5d0c23);if(_0x5d0c23[_0x720c('0x9')]){logger[_0x720c('0x9')](_0x720c('0xa'),_0x720c('0x3'),_0x18f492,_0x5d0c23[_0x720c('0x9')]['message'],_0x211619);return _0x3cc283(_0x5d0c23[_0x720c('0x9')][_0x720c('0xb')]);}else{return _0x31e148(_0x5d0c23['result']);}})[_0x720c('0xc')](function(_0x22a242){logger[_0x720c('0x9')](_0x720c('0xa'),_0x720c('0x3'),_0x18f492,_0x22a242,_0x211619);return _0x3cc283(_0x22a242);});});};module[_0x720c('0xd')]=client; \ No newline at end of file +var _0xa0d0=['http','request','rpc','routing','message','error','result','catch','exports','bluebird','client'];(function(_0x3cd630,_0x2b1582){var _0x6a0952=function(_0x4a31ff){while(--_0x4a31ff){_0x3cd630['push'](_0x3cd630['shift']());}};_0x6a0952(++_0x2b1582);}(_0xa0d0,0x1ab));var _0x0a0d=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xa0d0[_0x33032e];return _0x13316b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x0a0d('0x0'));var logger=require('../../config/logger')('routing');var client=jayson[_0x0a0d('0x1')][_0x0a0d('0x2')]({'port':0x2329});client['Request']=function(_0x23e243,_0x23e727){return new BPromise(function(_0x40567e,_0x37be29){return client[_0x0a0d('0x3')](_0x23e243,_0x23e727)['then'](function(_0x5f4d73){logger['debug'](_0x0a0d('0x4'),_0x0a0d('0x5'),_0x23e243,_0x23e727,_0x5f4d73);if(_0x5f4d73['error']){logger['error'](_0x0a0d('0x4'),_0x0a0d('0x5'),_0x23e243,_0x5f4d73['error'][_0x0a0d('0x6')],_0x23e727);return _0x37be29(_0x5f4d73[_0x0a0d('0x7')]['message']);}else{return _0x40567e(_0x5f4d73[_0x0a0d('0x8')]);}})[_0x0a0d('0x9')](function(_0x256382){logger[_0x0a0d('0x7')](_0x0a0d('0x4'),_0x0a0d('0x5'),_0x23e243,_0x256382,_0x23e727);return _0x37be29(_0x256382);});});};module[_0x0a0d('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 6ae7589..5a8b3f3 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 _0x637a=['refresh','listen','getSettings','catch','./server','./realtime','./lib/email','./rpc/setting','email','resolve','then','getMailAccounts','initMailAccounts'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0x637a,0x79));var _0xa637=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x637a[_0x3947c9];return _0x2e7871;};'use strict';var server=require(_0xa637('0x0'));var Realtime=require(_0xa637('0x1'));var EmailChannel=require(_0xa637('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xa637('0x3'));var logger=require('../../config/logger')(_0xa637('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa637('0x5')]()[_0xa637('0x6')](mailAccount[_0xa637('0x7')]())[_0xa637('0x6')](realtime[_0xa637('0x8')]())['then'](function(){email[_0xa637('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xa637('0xa')](realtime,email)[_0xa637('0x6')](function(){return initRealtime();})[_0xa637('0x6')](function(){return setting[_0xa637('0xb')]();})[_0xa637('0x6')](function(_0x2bb380){return setInterval(initRealtime,_0x2bb380['loginMailFrequency']*0x3e8);})[_0xa637('0xc')](function(_0x382cb2){logger['error']('Email\x20service\x20initialization',_0x382cb2);});}main(); \ No newline at end of file +var _0x9718=['./realtime','./lib/email','../../config/logger','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server'];(function(_0x485895,_0x5432b0){var _0x32ac72=function(_0x5746a9){while(--_0x5746a9){_0x485895['push'](_0x485895['shift']());}};_0x32ac72(++_0x5432b0);}(_0x9718,0x14f));var _0x8971=function(_0x3f27eb,_0x1863ec){_0x3f27eb=_0x3f27eb-0x0;var _0x28ef97=_0x9718[_0x3f27eb];return _0x28ef97;};'use strict';var server=require(_0x8971('0x0'));var Realtime=require(_0x8971('0x1'));var EmailChannel=require(_0x8971('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0x8971('0x3'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x8971('0x4')](mailAccount[_0x8971('0x5')]())[_0x8971('0x4')](realtime[_0x8971('0x6')]())['then'](function(){email[_0x8971('0x7')](realtime[_0x8971('0x8')]);return realtime;});}function main(){return server[_0x8971('0x9')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x8971('0xa')]();})[_0x8971('0x4')](function(_0x58d143){return setInterval(initRealtime,_0x58d143[_0x8971('0xb')]*0x3e8);})[_0x8971('0xc')](function(_0x5a80cc){logger['error'](_0x8971('0xd'),_0x5a80cc);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index d7ee0b4..983a85b 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 _0xd056=['verify','verified','exports','lodash','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','emit','name','key','active','status','Imap','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapEmail','bind','end','error','prototype','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','stringify','handleImapEnd','lastSync','handleImapError','sendMail','smtp','send','verifySmtp','Smtp'];(function(_0x4ea955,_0x1eda76){var _0x558561=function(_0x5b20f4){while(--_0x5b20f4){_0x4ea955['push'](_0x4ea955['shift']());}};_0x558561(++_0x1eda76);}(_0xd056,0x1d3));var _0x6d05=function(_0x2ed72d,_0x40a972){_0x2ed72d=_0x2ed72d-0x0;var _0x2f8d6f=_0xd056[_0x2ed72d];return _0x2f8d6f;};'use strict';var _=require(_0x6d05('0x0'));var moment=require('moment');var BPromise=require(_0x6d05('0x1'));var md5=require(_0x6d05('0x2'));var Redis=require(_0x6d05('0x3'));var config=require(_0x6d05('0x4'));var logger=require('../../../config/logger')(_0x6d05('0x5'));config[_0x6d05('0x6')]=_[_0x6d05('0x7')](config[_0x6d05('0x6')],{'host':_0x6d05('0x8'),'port':0x18eb});var io=require(_0x6d05('0x9'))(new Redis(config[_0x6d05('0x6')]));var EmailImap=require(_0x6d05('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x6d05('0xb'));var md5Accounts={};function EmailChannel(_0x2b8776){logger[_0x6d05('0xc')]('start\x20email\x20channel');this[_0x6d05('0xd')]=_0x2b8776['mailAccounts'];this[_0x6d05('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x6d05('0xf')]=function(_0xbba1f9){var _0x1f3a50=this['mailAccounts'][_0xbba1f9];var _0x57d643={'id':_0x1f3a50['id'],'name':_0x1f3a50[_0x6d05('0x10')],'key':_0x1f3a50[_0x6d05('0x11')],'active':_0x1f3a50[_0x6d05('0x12')],'Imap':{'status':_0x1f3a50['Imap'][_0x6d05('0x13')],'messageStatus':_0x1f3a50[_0x6d05('0x14')][_0x6d05('0x15')],'total':_0x1f3a50[_0x6d05('0x14')][_0x6d05('0x16')]}};if(_[_0x6d05('0x17')](md5Accounts[_0xbba1f9])){md5Accounts[_0xbba1f9]={};}var _0x4f6db7=md5(JSON['stringify'](_0x57d643));if(md5Accounts[_0xbba1f9][_0x6d05('0x2')]!==_0x4f6db7){md5Accounts[_0xbba1f9][_0x6d05('0x2')]=_0x4f6db7;io['emit'](_0x6d05('0x18'),_0x57d643);}};EmailChannel['prototype'][_0x6d05('0x19')]=function(_0x2547d7){for(var _0x5d3e88 in _0x2547d7){if(_0x2547d7[_0x6d05('0x1a')](_0x5d3e88)){if(_0x2547d7[_0x5d3e88][_0x6d05('0x14')]&&_0x2547d7[_0x5d3e88][_0x6d05('0x12')]){var _0x28b48a=_0x2547d7[_0x5d3e88][_0x6d05('0x14')];if(!_0x28b48a[_0x6d05('0x1b')]&&_0x2547d7[_0x5d3e88][_0x6d05('0x1c')]!==_0x6d05('0x1d'))_0x28b48a[_0x6d05('0x1b')]=_0x2547d7[_0x5d3e88][_0x6d05('0x1c')];if(!this[_0x6d05('0xe')][_0x6d05('0x1a')](_0x28b48a['id'])){this[_0x6d05('0xe')][_0x28b48a['id']]=new EmailImap(_0x28b48a,_0x2547d7[_0x5d3e88][_0x6d05('0x5')]);this[_0x6d05('0xe')][_0x28b48a['id']]['on'](_0x6d05('0x1e'),this['handleImapBox']['bind'](this,_0x5d3e88));this[_0x6d05('0xe')][_0x28b48a['id']]['on']('email',this[_0x6d05('0x1f')][_0x6d05('0x20')](this,_0x5d3e88));this[_0x6d05('0xe')][_0x28b48a['id']]['on'](_0x6d05('0x21'),this['handleImapEnd']['bind'](this,_0x5d3e88));this['imapAccounts'][_0x28b48a['id']]['on'](_0x6d05('0x22'),this['handleImapError'][_0x6d05('0x20')](this,_0x5d3e88));}}else{if(_[_0x6d05('0x17')](this[_0x6d05('0xd')][_0x5d3e88][_0x6d05('0x14')])){this[_0x6d05('0xd')][_0x5d3e88][_0x6d05('0x14')]={};}this[_0x6d05('0xd')][_0x5d3e88][_0x6d05('0x14')]['status']='disabled';this['mailAccounts'][_0x5d3e88]['Imap']['messageStatus']='';this[_0x6d05('0xf')](_0x5d3e88);}}}};EmailChannel[_0x6d05('0x23')][_0x6d05('0x24')]=function(_0x4a9a44,_0x664095){if(this['mailAccounts'][_0x4a9a44]){this['mailAccounts'][_0x4a9a44][_0x6d05('0x14')][_0x6d05('0x13')]=_0x6d05('0x25');this[_0x6d05('0xd')][_0x4a9a44]['Imap'][_0x6d05('0x15')]=_0x664095[_0x6d05('0x10')];if(_0x664095[_0x6d05('0x26')]){this[_0x6d05('0xd')][_0x4a9a44][_0x6d05('0x14')][_0x6d05('0x16')]=_0x664095[_0x6d05('0x26')][_0x6d05('0x16')];}return this[_0x6d05('0xf')](_0x4a9a44);}};EmailChannel[_0x6d05('0x23')][_0x6d05('0x1f')]=function(_0x4afbfc,_0x3b3764){logger['info'](_0x6d05('0x27'),_0x3b3764[_0x6d05('0x28')],_0x3b3764[_0x6d05('0x29')],_0x3b3764[_0x6d05('0x2a')],_0x4afbfc);if(this[_0x6d05('0xd')][_0x4afbfc]){return mailAccount[_0x6d05('0x2b')](_0x4afbfc,_0x3b3764)[_0x6d05('0x2c')](function(_0x25f564){if(_0x25f564){logger[_0x6d05('0xc')](_0x6d05('0x2d'));}})['catch'](function(_0x24527f){logger[_0x6d05('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x6d05('0x2e')](_0x24527f));});}};EmailChannel['prototype'][_0x6d05('0x2f')]=function(_0x36a699){if(this[_0x6d05('0xd')][_0x36a699]&&this[_0x6d05('0xd')][_0x36a699][_0x6d05('0x14')]){if(this[_0x6d05('0xe')][this['mailAccounts'][_0x36a699]['Imap']['id']]){delete this['imapAccounts'][this[_0x6d05('0xd')][_0x36a699][_0x6d05('0x14')]['id']];}this[_0x6d05('0xd')][_0x36a699][_0x6d05('0x14')][_0x6d05('0x30')]=moment();this[_0x6d05('0xf')](_0x36a699);}};EmailChannel[_0x6d05('0x23')][_0x6d05('0x31')]=function(_0x4f2599,_0x316e90){if(this[_0x6d05('0xd')][_0x4f2599]){this[_0x6d05('0xd')][_0x4f2599][_0x6d05('0x14')][_0x6d05('0x13')]=_0x6d05('0x22');this['mailAccounts'][_0x4f2599][_0x6d05('0x14')][_0x6d05('0x15')]=_0x316e90;return this[_0x6d05('0xf')](_0x4f2599);}};EmailChannel[_0x6d05('0x23')][_0x6d05('0x32')]=function(_0x5f2720,_0x157052){return this[_0x6d05('0x33')][_0x6d05('0x34')](_0x5f2720,_0x157052);};EmailChannel[_0x6d05('0x23')][_0x6d05('0x35')]=function(_0x167c43){var _0x57fe51=this;if(this[_0x6d05('0xd')][_0x167c43['id']]){if(_[_0x6d05('0x17')](this[_0x6d05('0xd')][_0x167c43['id']]['Smtp'])){this['mailAccounts'][_0x167c43['id']][_0x6d05('0x36')]={};}this['mailAccounts'][_0x167c43['id']][_0x6d05('0x36')][_0x6d05('0x30')]=moment();return new BPromise(function(_0x3cd5ca,_0x5d2f08){return _0x57fe51[_0x6d05('0x33')][_0x6d05('0x37')](_0x167c43)['then'](function(_0x297cb8){_0x57fe51[_0x6d05('0xd')][_0x167c43['id']][_0x6d05('0x36')][_0x6d05('0x13')]=_0x6d05('0x38');_0x57fe51[_0x6d05('0xd')][_0x167c43['id']]['Smtp'][_0x6d05('0x15')]='';_0x57fe51[_0x6d05('0xf')](_0x167c43['id']);_0x3cd5ca(_0x297cb8);})['catch'](function(_0x1aa107){_0x57fe51[_0x6d05('0xd')][_0x167c43['id']][_0x6d05('0x36')][_0x6d05('0x13')]=_0x6d05('0x22');_0x57fe51[_0x6d05('0xd')][_0x167c43['id']][_0x6d05('0x36')][_0x6d05('0x15')]=_0x1aa107;_0x57fe51[_0x6d05('0xf')](_0x167c43['id']);_0x5d2f08(_0x1aa107);});});}return this[_0x6d05('0x33')][_0x6d05('0x37')](_0x167c43);};module[_0x6d05('0x39')]=EmailChannel; \ No newline at end of file +var _0x6b8b=['lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','isNil','verify','Smtp','verified','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','localhost','socket.io-emitter','redis','./imap','../rpc/mailAccount','info','mailAccounts','smtp','prototype','emit','key','active','status','Imap','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','custom','service','provider','imapAccounts','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','name','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x6b8b,0x12a));var _0xb6b8=function(_0x54a2df,_0x376f96){_0x54a2df=_0x54a2df-0x0;var _0x42e322=_0x6b8b[_0x54a2df];return _0x42e322;};'use strict';var _=require(_0xb6b8('0x0'));var moment=require(_0xb6b8('0x1'));var BPromise=require(_0xb6b8('0x2'));var md5=require('md5');var Redis=require(_0xb6b8('0x3'));var config=require(_0xb6b8('0x4'));var logger=require(_0xb6b8('0x5'))(_0xb6b8('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0xb6b8('0x7'),'port':0x18eb});var io=require(_0xb6b8('0x8'))(new Redis(config[_0xb6b8('0x9')]));var EmailImap=require(_0xb6b8('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xb6b8('0xb'));var md5Accounts={};function EmailChannel(_0x442c39){logger[_0xb6b8('0xc')]('start\x20email\x20channel');this[_0xb6b8('0xd')]=_0x442c39['mailAccounts'];this['imapAccounts']={};this[_0xb6b8('0xe')]=new EmailSmtp();}EmailChannel[_0xb6b8('0xf')][_0xb6b8('0x10')]=function(_0x2baf8a){var _0x71dab5=this[_0xb6b8('0xd')][_0x2baf8a];var _0x102e48={'id':_0x71dab5['id'],'name':_0x71dab5['name'],'key':_0x71dab5[_0xb6b8('0x11')],'active':_0x71dab5[_0xb6b8('0x12')],'Imap':{'status':_0x71dab5['Imap'][_0xb6b8('0x13')],'messageStatus':_0x71dab5[_0xb6b8('0x14')][_0xb6b8('0x15')],'total':_0x71dab5[_0xb6b8('0x14')][_0xb6b8('0x16')]}};if(_['isNil'](md5Accounts[_0x2baf8a])){md5Accounts[_0x2baf8a]={};}var _0x1623fe=md5(JSON[_0xb6b8('0x17')](_0x102e48));if(md5Accounts[_0x2baf8a][_0xb6b8('0x18')]!==_0x1623fe){md5Accounts[_0x2baf8a][_0xb6b8('0x18')]=_0x1623fe;io['emit'](_0xb6b8('0x19'),_0x102e48);}};EmailChannel[_0xb6b8('0xf')][_0xb6b8('0x1a')]=function(_0x45e728){for(var _0x4aa523 in _0x45e728){if(_0x45e728[_0xb6b8('0x1b')](_0x4aa523)){if(_0x45e728[_0x4aa523][_0xb6b8('0x14')]&&_0x45e728[_0x4aa523]['active']){var _0x58d692=_0x45e728[_0x4aa523]['Imap'];if(!_0x58d692['service']&&_0x45e728[_0x4aa523]['provider']!==_0xb6b8('0x1c'))_0x58d692[_0xb6b8('0x1d')]=_0x45e728[_0x4aa523][_0xb6b8('0x1e')];if(!this['imapAccounts']['hasOwnProperty'](_0x58d692['id'])){this['imapAccounts'][_0x58d692['id']]=new EmailImap(_0x58d692,_0x45e728[_0x4aa523][_0xb6b8('0x6')]);this[_0xb6b8('0x1f')][_0x58d692['id']]['on'](_0xb6b8('0x20'),this['handleImapBox'][_0xb6b8('0x21')](this,_0x4aa523));this['imapAccounts'][_0x58d692['id']]['on'](_0xb6b8('0x6'),this[_0xb6b8('0x22')][_0xb6b8('0x21')](this,_0x4aa523));this[_0xb6b8('0x1f')][_0x58d692['id']]['on'](_0xb6b8('0x23'),this[_0xb6b8('0x24')][_0xb6b8('0x21')](this,_0x4aa523));this[_0xb6b8('0x1f')][_0x58d692['id']]['on'](_0xb6b8('0x25'),this[_0xb6b8('0x26')]['bind'](this,_0x4aa523));}}else{if(_['isNil'](this[_0xb6b8('0xd')][_0x4aa523][_0xb6b8('0x14')])){this[_0xb6b8('0xd')][_0x4aa523][_0xb6b8('0x14')]={};}this[_0xb6b8('0xd')][_0x4aa523][_0xb6b8('0x14')]['status']=_0xb6b8('0x27');this[_0xb6b8('0xd')][_0x4aa523]['Imap'][_0xb6b8('0x15')]='';this[_0xb6b8('0x10')](_0x4aa523);}}}};EmailChannel[_0xb6b8('0xf')]['handleImapBox']=function(_0x527c91,_0x3af5e3){if(this[_0xb6b8('0xd')][_0x527c91]){this['mailAccounts'][_0x527c91][_0xb6b8('0x14')]['status']=_0xb6b8('0x28');this[_0xb6b8('0xd')][_0x527c91][_0xb6b8('0x14')][_0xb6b8('0x15')]=_0x3af5e3[_0xb6b8('0x29')];if(_0x3af5e3['messages']){this[_0xb6b8('0xd')][_0x527c91][_0xb6b8('0x14')][_0xb6b8('0x16')]=_0x3af5e3['messages'][_0xb6b8('0x16')];}return this[_0xb6b8('0x10')](_0x527c91);}};EmailChannel[_0xb6b8('0xf')][_0xb6b8('0x22')]=function(_0x2ab4dc,_0xa205c5){logger[_0xb6b8('0xc')](_0xb6b8('0x2a'),_0xa205c5[_0xb6b8('0x2b')],_0xa205c5[_0xb6b8('0x2c')],_0xa205c5[_0xb6b8('0x2d')],_0x2ab4dc);if(this[_0xb6b8('0xd')][_0x2ab4dc]){return mailAccount[_0xb6b8('0x2e')](_0x2ab4dc,_0xa205c5)[_0xb6b8('0x2f')](function(_0x1b4076){if(_0x1b4076){logger['info'](_0xb6b8('0x30'));}})[_0xb6b8('0x31')](function(_0x503260){logger[_0xb6b8('0x25')](_0xb6b8('0x32'),JSON[_0xb6b8('0x17')](_0x503260));});}};EmailChannel[_0xb6b8('0xf')][_0xb6b8('0x24')]=function(_0x18f748){if(this[_0xb6b8('0xd')][_0x18f748]&&this[_0xb6b8('0xd')][_0x18f748][_0xb6b8('0x14')]){if(this[_0xb6b8('0x1f')][this['mailAccounts'][_0x18f748][_0xb6b8('0x14')]['id']]){delete this['imapAccounts'][this[_0xb6b8('0xd')][_0x18f748][_0xb6b8('0x14')]['id']];}this[_0xb6b8('0xd')][_0x18f748]['Imap'][_0xb6b8('0x33')]=moment();this[_0xb6b8('0x10')](_0x18f748);}};EmailChannel[_0xb6b8('0xf')][_0xb6b8('0x26')]=function(_0x21a384,_0x4a67db){if(this[_0xb6b8('0xd')][_0x21a384]){this[_0xb6b8('0xd')][_0x21a384]['Imap']['status']=_0xb6b8('0x25');this[_0xb6b8('0xd')][_0x21a384]['Imap']['messageStatus']=_0x4a67db;return this[_0xb6b8('0x10')](_0x21a384);}};EmailChannel[_0xb6b8('0xf')][_0xb6b8('0x34')]=function(_0x455655,_0x1101d9){return this[_0xb6b8('0xe')]['send'](_0x455655,_0x1101d9);};EmailChannel[_0xb6b8('0xf')]['verifySmtp']=function(_0x5777fd){var _0x237d3d=this;if(this[_0xb6b8('0xd')][_0x5777fd['id']]){if(_[_0xb6b8('0x35')](this[_0xb6b8('0xd')][_0x5777fd['id']]['Smtp'])){this['mailAccounts'][_0x5777fd['id']]['Smtp']={};}this[_0xb6b8('0xd')][_0x5777fd['id']]['Smtp'][_0xb6b8('0x33')]=moment();return new BPromise(function(_0x5e5553,_0x19d40a){return _0x237d3d['smtp'][_0xb6b8('0x36')](_0x5777fd)[_0xb6b8('0x2f')](function(_0x5b9300){_0x237d3d[_0xb6b8('0xd')][_0x5777fd['id']][_0xb6b8('0x37')]['status']=_0xb6b8('0x38');_0x237d3d[_0xb6b8('0xd')][_0x5777fd['id']]['Smtp'][_0xb6b8('0x15')]='';_0x237d3d[_0xb6b8('0x10')](_0x5777fd['id']);_0x5e5553(_0x5b9300);})['catch'](function(_0x3017cd){_0x237d3d[_0xb6b8('0xd')][_0x5777fd['id']][_0xb6b8('0x37')][_0xb6b8('0x13')]=_0xb6b8('0x25');_0x237d3d[_0xb6b8('0xd')][_0x5777fd['id']][_0xb6b8('0x37')][_0xb6b8('0x15')]=_0x3017cd;_0x237d3d['emit'](_0x5777fd['id']);_0x19d40a(_0x3017cd);});});}return this[_0xb6b8('0xe')][_0xb6b8('0x36')](_0x5777fd);};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 64a6e98..660e60e 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 _0x0af5=['generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','autotls','required','prototype','openBox','mailbox','handleOpenBox','box','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','textCode','upperFirst','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account','handleReady','bind','once','end','handleEnd','error','handleError','connect','inherits','connTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2'];(function(_0x56a4a4,_0x2e15e5){var _0x16d910=function(_0x184239){while(--_0x184239){_0x56a4a4['push'](_0x56a4a4['shift']());}};_0x16d910(++_0x2e15e5);}(_0x0af5,0x158));var _0x50af=function(_0x35ef98,_0xaa0d52){_0x35ef98=_0x35ef98-0x0;var _0x35efb7=_0x0af5[_0x35ef98];return _0x35efb7;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var Imap=require(_0x50af('0x1'));var simpleParser=require(_0x50af('0x2'))[_0x50af('0x3')];var Iconv=require(_0x50af('0x4'))[_0x50af('0x5')];var EventEmitter=require(_0x50af('0x6'))[_0x50af('0x7')];var utils=require(_0x50af('0x8'));var logger=require(_0x50af('0x9'))(_0x50af('0xa'));function EmailImap(_0xe37b1,_0x5e94f8){this['mailbox']=_0x50af('0xb');this[_0x50af('0xc')]=this['getAccount'](_0xe37b1,_0x5e94f8);this['imap']=new Imap(this[_0x50af('0xc')]);this[_0x50af('0x1')]['once']('ready',this[_0x50af('0xd')][_0x50af('0xe')](this));this['imap'][_0x50af('0xf')](_0x50af('0x10'),this[_0x50af('0x11')][_0x50af('0xe')](this));this['imap']['on'](_0x50af('0x12'),this[_0x50af('0x13')][_0x50af('0xe')](this));this[_0x50af('0x1')][_0x50af('0x14')]();}util[_0x50af('0x15')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x569851,_0x620389){var _0x561cd2={'connTimeout':_0x569851[_0x50af('0x16')]?_0x569851[_0x50af('0x16')]*0x3e8:0x2710,'authTimeout':_0x569851['authTimeout']?_0x569851['authTimeout']*0x3e8:0x1388};if(_0x569851[_0x50af('0x17')]){_0x561cd2[_0x50af('0x18')]=_0x569851['user'];_0x561cd2['email']=_0x620389||_0x569851[_0x50af('0x18')]||_0x50af('0x19');if(_0x569851[_0x50af('0x1a')]){_0x561cd2[_0x50af('0x1b')]=utils[_0x50af('0x1c')](_0x569851[_0x50af('0x1d')][_0x50af('0x1e')],_0x569851[_0x50af('0x18')]);}else{_0x561cd2[_0x50af('0x1f')]=_0x569851[_0x50af('0x1f')];}}else{if(_0x569851['authentication']){_0x561cd2[_0x50af('0x18')]=_0x569851[_0x50af('0x18')];_0x561cd2[_0x50af('0x1f')]=_0x569851[_0x50af('0x1f')];}}_0x561cd2['host']=_0x569851[_0x50af('0x20')];_0x561cd2[_0x50af('0x21')]=_0x569851[_0x50af('0x21')]||0x3e1;if(_0x569851[_0x50af('0x22')]){_0x561cd2[_0x50af('0x22')]=!![];}else{_0x561cd2[_0x50af('0x22')]=![];_0x561cd2[_0x50af('0x23')]=_0x50af('0x24');}return _0x561cd2;};EmailImap[_0x50af('0x25')][_0x50af('0xd')]=function(){this['imap'][_0x50af('0x26')](this[_0x50af('0x27')],![],this[_0x50af('0x28')][_0x50af('0xe')](this));};EmailImap[_0x50af('0x25')][_0x50af('0x28')]=function(_0x4db72d,_0xb3c15a){if(_0x4db72d){this[_0x50af('0x13')](_0x4db72d,!![]);}else{this['emit'](_0x50af('0x29'),_0xb3c15a);this[_0x50af('0x2a')]();}};EmailImap[_0x50af('0x25')]['handleCloseBox']=function(_0x53af9d){if(_0x53af9d){this[_0x50af('0x13')](_0x53af9d,!![]);}else{this[_0x50af('0x1')][_0x50af('0x10')]();}};EmailImap[_0x50af('0x25')][_0x50af('0x2a')]=function(){this[_0x50af('0x1')][_0x50af('0x2b')]([_0x50af('0x2c')],this['handleReadUnseen'][_0x50af('0xe')](this));};EmailImap[_0x50af('0x25')][_0x50af('0x2d')]=function(_0x4db406,_0x43f1c8){if(_0x4db406){this['handleError'](_0x4db406,!![]);}else{if(_0x43f1c8[_0x50af('0x2e')]){try{var _0x52d65a=this['imap']['fetch'](_0x43f1c8,{'bodies':'','markSeen':!![]});_0x52d65a['on'](_0x50af('0x2f'),this[_0x50af('0x30')][_0x50af('0xe')](this));_0x52d65a[_0x50af('0xf')](_0x50af('0x12'),this[_0x50af('0x31')][_0x50af('0xe')](this));_0x52d65a[_0x50af('0xf')](_0x50af('0x10'),this[_0x50af('0x32')]['bind'](this));}catch(_0x4ad19b){logger[_0x50af('0x12')](_0x4ad19b);}}else{this[_0x50af('0x1')][_0x50af('0x33')](!![],this[_0x50af('0x34')]['bind'](this));}}};EmailImap[_0x50af('0x25')]['handleFetchMessage']=function(_0x5ac19f){_0x5ac19f['on']('body',this[_0x50af('0x35')][_0x50af('0xe')](this));_0x5ac19f[_0x50af('0xf')](_0x50af('0x36'),this[_0x50af('0x37')]['bind'](this));_0x5ac19f['once'](_0x50af('0x10'),this[_0x50af('0x38')][_0x50af('0xe')](this));};EmailImap[_0x50af('0x25')][_0x50af('0x35')]=function(_0x5560e8){simpleParser(_0x5560e8,{'Iconv':Iconv},this[_0x50af('0x39')][_0x50af('0xe')](this));};EmailImap[_0x50af('0x25')][_0x50af('0x37')]=function(){};EmailImap['prototype'][_0x50af('0x38')]=function(){};EmailImap[_0x50af('0x25')][_0x50af('0x39')]=function(_0x4bab50,_0x220fd8){if(_0x4bab50){logger['error'](_0x4bab50);}else{var _0x50ce3f=this;utils['parser'](this[_0x50af('0xc')],_0x220fd8,function(_0x35d38f){_0x50ce3f[_0x50af('0x3a')](_0x50af('0xa'),_0x35d38f);});}};EmailImap[_0x50af('0x25')][_0x50af('0x32')]=function(){this[_0x50af('0x1')][_0x50af('0x33')](!![],this[_0x50af('0x34')][_0x50af('0xe')](this));};EmailImap[_0x50af('0x25')][_0x50af('0x31')]=function(_0x42fc7d){this[_0x50af('0x13')](_0x42fc7d);this[_0x50af('0x1')][_0x50af('0x33')](!![],this['handleCloseBox'][_0x50af('0xe')](this));};EmailImap[_0x50af('0x25')][_0x50af('0x11')]=function(){this['emit']('end');};EmailImap[_0x50af('0x25')][_0x50af('0x13')]=function(_0x18f9dc,_0x456d1c){logger[_0x50af('0x12')](_0x50af('0x13'),this[_0x50af('0xc')][_0x50af('0xa')],JSON['stringify'](_0x18f9dc));var _0x59e451='';if(_0x18f9dc){if(_0x18f9dc[_0x50af('0x3b')]){_0x59e451=_0x18f9dc[_0x50af('0x3b')];}else{for(var _0x52fcb4 in _0x18f9dc){if(_0x18f9dc['hasOwnProperty'](_0x52fcb4)){_0x59e451+=_[_0x50af('0x3c')](_0x52fcb4)+':\x20'+_0x18f9dc[_0x52fcb4]+'\x0a';}}}}if(_0x456d1c){this[_0x50af('0x1')][_0x50af('0x10')]();}else{this['emit'](_0x50af('0x12'),_0x59e451);this[_0x50af('0x3a')](_0x50af('0x10'));}};module[_0x50af('0x3d')]=EmailImap; \ No newline at end of file +var _0x9b0d=['simpleParser','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','account','getAccount','ready','bind','once','end','handleEnd','error','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','required','handleReady','openBox','handleOpenBox','handleError','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','emit','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','mailparser'];(function(_0x4d78c9,_0x5a6550){var _0x50adfa=function(_0x3700f2){while(--_0x3700f2){_0x4d78c9['push'](_0x4d78c9['shift']());}};_0x50adfa(++_0x5a6550);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x3d44ce,_0x44e7f9){_0x3d44ce=_0x3d44ce-0x0;var _0x4e8645=_0x9b0d[_0x3d44ce];return _0x4e8645;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var Imap=require(_0xd9b0('0x1'));var simpleParser=require(_0xd9b0('0x2'))[_0xd9b0('0x3')];var Iconv=require('iconv')[_0xd9b0('0x4')];var EventEmitter=require(_0xd9b0('0x5'))[_0xd9b0('0x6')];var utils=require(_0xd9b0('0x7'));var logger=require('../../../config/logger')(_0xd9b0('0x8'));function EmailImap(_0x21798d,_0x41dad9){this[_0xd9b0('0x9')]=_0xd9b0('0xa');this[_0xd9b0('0xb')]=this[_0xd9b0('0xc')](_0x21798d,_0x41dad9);this['imap']=new Imap(this[_0xd9b0('0xb')]);this[_0xd9b0('0x1')]['once'](_0xd9b0('0xd'),this['handleReady'][_0xd9b0('0xe')](this));this['imap'][_0xd9b0('0xf')](_0xd9b0('0x10'),this[_0xd9b0('0x11')][_0xd9b0('0xe')](this));this[_0xd9b0('0x1')]['on'](_0xd9b0('0x12'),this['handleError'][_0xd9b0('0xe')](this));this[_0xd9b0('0x1')]['connect']();}util[_0xd9b0('0x13')](EmailImap,EventEmitter);EmailImap[_0xd9b0('0x14')][_0xd9b0('0xc')]=function(_0x46321d,_0x2a15b1){var _0x13a800={'connTimeout':_0x46321d['connTimeout']?_0x46321d[_0xd9b0('0x15')]*0x3e8:0x2710,'authTimeout':_0x46321d['authTimeout']?_0x46321d[_0xd9b0('0x16')]*0x3e8:0x1388};if(_0x46321d[_0xd9b0('0x17')]){_0x13a800[_0xd9b0('0x18')]=_0x46321d[_0xd9b0('0x18')];_0x13a800[_0xd9b0('0x8')]=_0x2a15b1||_0x46321d[_0xd9b0('0x18')]||_0xd9b0('0x19');if(_0x46321d['modernAuthentication']){_0x13a800[_0xd9b0('0x1a')]=utils[_0xd9b0('0x1b')](_0x46321d[_0xd9b0('0x1c')][_0xd9b0('0x1d')],_0x46321d[_0xd9b0('0x18')]);}else{_0x13a800[_0xd9b0('0x1e')]=_0x46321d[_0xd9b0('0x1e')];}}else{if(_0x46321d['authentication']){_0x13a800[_0xd9b0('0x18')]=_0x46321d['user'];_0x13a800[_0xd9b0('0x1e')]=_0x46321d['password'];}}_0x13a800[_0xd9b0('0x1f')]=_0x46321d[_0xd9b0('0x1f')];_0x13a800[_0xd9b0('0x20')]=_0x46321d[_0xd9b0('0x20')]||0x3e1;if(_0x46321d[_0xd9b0('0x21')]){_0x13a800[_0xd9b0('0x21')]=!![];}else{_0x13a800['tls']=![];_0x13a800['autotls']=_0xd9b0('0x22');}return _0x13a800;};EmailImap['prototype'][_0xd9b0('0x23')]=function(){this[_0xd9b0('0x1')][_0xd9b0('0x24')](this['mailbox'],![],this[_0xd9b0('0x25')]['bind'](this));};EmailImap['prototype'][_0xd9b0('0x25')]=function(_0x334657,_0x5569c3){if(_0x334657){this[_0xd9b0('0x26')](_0x334657,!![]);}else{this['emit'](_0xd9b0('0x27'),_0x5569c3);this[_0xd9b0('0x28')]();}};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x29')]=function(_0x1560bf){if(_0x1560bf){this[_0xd9b0('0x26')](_0x1560bf,!![]);}else{this[_0xd9b0('0x1')][_0xd9b0('0x10')]();}};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x28')]=function(){this[_0xd9b0('0x1')][_0xd9b0('0x2a')]([_0xd9b0('0x2b')],this[_0xd9b0('0x2c')][_0xd9b0('0xe')](this));};EmailImap[_0xd9b0('0x14')]['handleReadUnseen']=function(_0x2e9d2d,_0x579119){if(_0x2e9d2d){this[_0xd9b0('0x26')](_0x2e9d2d,!![]);}else{if(_0x579119[_0xd9b0('0x2d')]){try{var _0x4b67d2=this[_0xd9b0('0x1')][_0xd9b0('0x2e')](_0x579119,{'bodies':'','markSeen':!![]});_0x4b67d2['on']('message',this[_0xd9b0('0x2f')][_0xd9b0('0xe')](this));_0x4b67d2[_0xd9b0('0xf')](_0xd9b0('0x12'),this[_0xd9b0('0x30')][_0xd9b0('0xe')](this));_0x4b67d2[_0xd9b0('0xf')](_0xd9b0('0x10'),this['handleFetchEnd'][_0xd9b0('0xe')](this));}catch(_0x2a8212){logger[_0xd9b0('0x12')](_0x2a8212);}}else{this[_0xd9b0('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xd9b0('0xe')](this));}}};EmailImap['prototype'][_0xd9b0('0x2f')]=function(_0x3bd1ec){_0x3bd1ec['on']('body',this['handleMessageBody'][_0xd9b0('0xe')](this));_0x3bd1ec[_0xd9b0('0xf')](_0xd9b0('0x31'),this[_0xd9b0('0x32')][_0xd9b0('0xe')](this));_0x3bd1ec[_0xd9b0('0xf')](_0xd9b0('0x10'),this[_0xd9b0('0x33')]['bind'](this));};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x34')]=function(_0x864955){simpleParser(_0x864955,{'Iconv':Iconv},this[_0xd9b0('0x35')][_0xd9b0('0xe')](this));};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x32')]=function(){};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x33')]=function(){};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x35')]=function(_0xa3d1d,_0x2ed7d4){if(_0xa3d1d){logger[_0xd9b0('0x12')](_0xa3d1d);}else{var _0x4cadd2=this;utils[_0xd9b0('0x36')](this[_0xd9b0('0xb')],_0x2ed7d4,function(_0x140948){_0x4cadd2[_0xd9b0('0x37')](_0xd9b0('0x8'),_0x140948);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0xd9b0('0x1')]['closeBox'](!![],this[_0xd9b0('0x29')][_0xd9b0('0xe')](this));};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x30')]=function(_0x193615){this[_0xd9b0('0x26')](_0x193615);this[_0xd9b0('0x1')][_0xd9b0('0x38')](!![],this[_0xd9b0('0x29')][_0xd9b0('0xe')](this));};EmailImap['prototype'][_0xd9b0('0x11')]=function(){this[_0xd9b0('0x37')]('end');};EmailImap[_0xd9b0('0x14')][_0xd9b0('0x26')]=function(_0x3dac3b,_0x562be2){logger[_0xd9b0('0x12')](_0xd9b0('0x26'),this[_0xd9b0('0xb')][_0xd9b0('0x8')],JSON[_0xd9b0('0x39')](_0x3dac3b));var _0x2e0705='';if(_0x3dac3b){if(_0x3dac3b[_0xd9b0('0x3a')]){_0x2e0705=_0x3dac3b[_0xd9b0('0x3a')];}else{for(var _0x6b2393 in _0x3dac3b){if(_0x3dac3b[_0xd9b0('0x3b')](_0x6b2393)){_0x2e0705+=_[_0xd9b0('0x3c')](_0x6b2393)+':\x20'+_0x3dac3b[_0x6b2393]+'\x0a';}}}}if(_0x562be2){this[_0xd9b0('0x1')][_0xd9b0('0x10')]();}else{this[_0xd9b0('0x37')](_0xd9b0('0x12'),_0x2e0705);this[_0xd9b0('0x37')](_0xd9b0('0x10'));}};module[_0xd9b0('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index ebe7f43..ef1da2e 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 _0x722d=['verify','toString','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail'];(function(_0x3767d2,_0x2067dc){var _0x4f96c6=function(_0x1c3601){while(--_0x1c3601){_0x3767d2['push'](_0x3767d2['shift']());}};_0x4f96c6(++_0x2067dc);}(_0x722d,0x16f));var _0xd722=function(_0x5bbf6a,_0x29460a){_0x5bbf6a=_0x5bbf6a-0x0;var _0x5d051a=_0x722d[_0x5bbf6a];return _0x5d051a;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xd722('0x0'));function EmailSmtp(){}EmailSmtp[_0xd722('0x1')][_0xd722('0x2')]=function(_0x733ff2,_0x156370){return new Promise(function(_0x2c1622,_0x3ae61c){var _0x71f42=nodemailer[_0xd722('0x3')](_0x733ff2);_0x71f42[_0xd722('0x4')](_0xd722('0x5'),inlineBase64());_0x71f42[_0xd722('0x6')](_0x156370,function(_0x3906af,_0x63c219){if(_0x3906af){_0x3ae61c(_0x3906af['toString']());}else{_0x2c1622(_0x63c219);}});});};EmailSmtp[_0xd722('0x1')]['verify']=function(_0x1d6475){return new Promise(function(_0x804e2c,_0xf3bf3b){var _0x42c97c=nodemailer['createTransport'](_0x1d6475);_0x42c97c[_0xd722('0x7')](function(_0x4a18c6,_0x96bd0a){if(_0x4a18c6){_0xf3bf3b(_0x4a18c6[_0xd722('0x8')]());}else{if(_0x96bd0a){_0x804e2c(_0x96bd0a);}else{_0xf3bf3b(_0xd722('0x9'));}}});});};module[_0xd722('0xa')]=EmailSmtp; \ No newline at end of file +var _0x7896=['verify','createTransport','exports','nodemailer','prototype','send','use','sendMail','toString'];(function(_0x5868ae,_0x5d6bf1){var _0x591860=function(_0x28ce73){while(--_0x28ce73){_0x5868ae['push'](_0x5868ae['shift']());}};_0x591860(++_0x5d6bf1);}(_0x7896,0x81));var _0x6789=function(_0x4fb5ce,_0x3a79f9){_0x4fb5ce=_0x4fb5ce-0x0;var _0x3c07b5=_0x7896[_0x4fb5ce];return _0x3c07b5;};'use strict';var nodemailer=require(_0x6789('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x6789('0x1')][_0x6789('0x2')]=function(_0x30da95,_0x58d9b3){return new Promise(function(_0x4c33b3,_0x190cd4){var _0x3b6074=nodemailer['createTransport'](_0x30da95);_0x3b6074[_0x6789('0x3')]('compile',inlineBase64());_0x3b6074[_0x6789('0x4')](_0x58d9b3,function(_0x1daee6,_0x172559){if(_0x1daee6){_0x190cd4(_0x1daee6[_0x6789('0x5')]());}else{_0x4c33b3(_0x172559);}});});};EmailSmtp[_0x6789('0x1')][_0x6789('0x6')]=function(_0x57e4ac){return new Promise(function(_0x401ba1,_0x4479e8){var _0x4225c7=nodemailer[_0x6789('0x7')](_0x57e4ac);_0x4225c7[_0x6789('0x6')](function(_0x2555ff,_0x522969){if(_0x2555ff){_0x4479e8(_0x2555ff[_0x6789('0x5')]());}else{if(_0x522969){_0x401ba1(_0x522969);}else{_0x4479e8('Not\x20verifired');}}});});};module[_0x6789('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 2df30ad..1c7f03b 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 _0xcc72=['randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','@xcally.com','value','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x435684[_0x2cc7('0x12')](0x0,-0x1)[_0x2cc7('0x13')]('\x20'):_0x4a8464[_0x2cc7('0xe')];}return _0x2cc7('0x14');}function getLastName(_0x4515b2){var _0x255141=_[_0x2cc7('0x9')](_0x4515b2['value']);if(_0x255141&&_0x255141[_0x2cc7('0xe')]){var _0x1e4e1c=_0x255141[_0x2cc7('0xe')][_0x2cc7('0x10')](/\s+/);return _0x1e4e1c[_0x2cc7('0x11')]>0x1?_0x1e4e1c[_0x2cc7('0x15')]():'';}return'';}function getMails(_0x2b00f7,_0x59cb14){var _0x448b91='';for(var _0x2e91c8=0x0;_0x2e91c8<_0x59cb14[_0x2cc7('0xd')][_0x2cc7('0x11')];_0x2e91c8+=0x1){if(_0x59cb14['value'][_0x2e91c8]['address']!==_0x2b00f7){if(!_[_0x2cc7('0x16')](_0x448b91)){_0x448b91+=',';}_0x448b91+=_0x59cb14[_0x2cc7('0xd')][_0x2e91c8]['name']||_0x59cb14[_0x2cc7('0xd')][_0x2e91c8][_0x2cc7('0xa')]||'';_0x448b91+='\x20<';_0x448b91+=_0x59cb14[_0x2cc7('0xd')][_0x2e91c8][_0x2cc7('0xa')]?_0x59cb14[_0x2cc7('0xd')][_0x2e91c8][_0x2cc7('0xa')]:_0x2cc7('0xb')+random['generate'](0x6)+_0x2cc7('0xc');_0x448b91+='>';}}return _0x448b91;}function parseEmail(_0x2f7632,_0x432d57,_0x149de3){if(_0x432d57[_0x2cc7('0x17')]){var _0x84c519=/)<[^<]*)*<\/script>/gi;while(_0x84c519[_0x2cc7('0x18')](_0x432d57[_0x2cc7('0x17')])){_0x432d57[_0x2cc7('0x17')]=_0x432d57[_0x2cc7('0x17')][_0x2cc7('0x19')](_0x84c519,'');}if(_0x432d57[_0x2cc7('0x17')][_0x2cc7('0x1a')](_0x2cc7('0x1b'))){var _0x17bcae=[];_0x432d57[_0x2cc7('0x1c')][_0x2cc7('0x1d')](_0x38a96f=>{_0x17bcae['push'](_0x38a96f[_0x2cc7('0x1e')]);});var _0x40ab15=/]+>/g;var _0x4227b5=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x9f44d6=_0x432d57[_0x2cc7('0x17')]['replace'](_0x4227b5,'_SRC');var _0x765a=_0x9f44d6['replace'](_0x40ab15,_0x2cc7('0x1f'));for(let _0x2c4fd5=0x0;_0x2c4fd5<_0x17bcae[_0x2cc7('0x11')];_0x2c4fd5++){var _0x248b33=_0x765a['replace']('_IMG',_0x2cc7('0x20')+_0x17bcae[_0x2c4fd5]+_0x2cc7('0x21'));_0x765a=_0x248b33;}_0x432d57[_0x2cc7('0x17')]=_0x765a;}_0x149de3[_0x2cc7('0x22')]=_0x432d57[_0x2cc7('0x17')];}else{_0x149de3[_0x2cc7('0x22')]=_0x432d57[_0x2cc7('0x23')];}if(_0x149de3['body']){_0x149de3[_0x2cc7('0x22')]=_0x149de3[_0x2cc7('0x22')][_0x2cc7('0x19')](/0x0){var _0x1a6350=[_0x2cc7('0x32'),'X-Auto-Response-Suppress:\x20All',_0x2cc7('0x33')];for(var _0x55cba8=0x0;_0x55cba8<_0x432d57[_0x2cc7('0x31')][_0x2cc7('0x11')];_0x55cba8++){var _0x191a96=_[_0x2cc7('0x34')](_0x1a6350,_0x432d57['headerLines'][_0x55cba8]['line']);if(_0x191a96>=0x0){_0x149de3['isAutoreply']=!![];}}}return _0x149de3;}exports[_0x2cc7('0x35')]=function(_0x1af4a9,_0x61b513,_0x2bfc66){var _0x13f14f={'from':getAddress(_0x61b513[_0x2cc7('0x36')]),'firstName':getFirstName(_0x61b513[_0x2cc7('0x36')]),'lastName':getLastName(_0x61b513[_0x2cc7('0x36')]),'mapKey':'email','message':{'from':getMails(_0x1af4a9['email'],_0x61b513['from']),'to':_0x1af4a9[_0x2cc7('0x7')],'cc':'','subject':_0x61b513[_0x2cc7('0x37')]||'','messageId':_0x61b513[_0x2cc7('0x38')],'inReplyTo':_0x61b513[_0x2cc7('0x39')],'sentAt':moment(_0x61b513[_0x2cc7('0x3a')])[_0x2cc7('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x61b513[_0x2cc7('0x17')]&&!_0x61b513[_0x2cc7('0x23')]){var _0x45911b=_[_0x2cc7('0x3b')](_0x61b513['attachments'],{'contentType':_0x2cc7('0x3c')});if(_0x45911b['length']){logger[_0x2cc7('0x3d')](util[_0x2cc7('0x2a')](_0x2cc7('0x3e'),_0x61b513[_0x2cc7('0x38')]));tnef['parseBuffer'](_['first'](_0x45911b)[_0x2cc7('0x2f')],function(_0xbf788b,_0xdc82e8){if(_0xdc82e8){_0x61b513['html']=_0xdc82e8[_0x2cc7('0x3f')]||'

Empty\x20message

';if(_0xdc82e8[_0x2cc7('0x40')]){for(var _0x196491=0x0;_0x196491<_0xdc82e8[_0x2cc7('0x40')][_0x2cc7('0x11')];_0x196491++){var _0x5bd2f5=_0xdc82e8['Attachments'][_0x196491];_0x13f14f[_0x2cc7('0x25')]['attachments']['push']({'filename':_0x5bd2f5['Title'],'content':Buffer['from'](_0x5bd2f5[_0x2cc7('0x41')])});}}}_0x2bfc66(parseEmail(_0x1af4a9,_0x61b513,_0x13f14f));});}else{_0x61b513[_0x2cc7('0x17')]='

Empty\x20message

';_0x2bfc66(parseEmail(_0x1af4a9,_0x61b513,_0x13f14f));}}else{_0x2bfc66(parseEmail(_0x1af4a9,_0x61b513,_0x13f14f));}};exports[_0x2cc7('0x42')]=function(_0x5b1e78,_0x197843){var _0x41367d=['user='+(_0x197843||''),'auth=Bearer\x20'+_0x5b1e78,'',''];return Buffer['from'](_0x41367d['join'](''),_0x2cc7('0x43'))[_0x2cc7('0x44')](_0x2cc7('0x45'));}; \ No newline at end of file +var _0x02c3=['format','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','indexOf','line','isAutoreply','from','subject','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','

Empty\x20message

','Attachments','Data','user=','auth=Bearer\x20','toString','base64','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','head','name','substring','split','slice','join','Anonymous','length','pop','isEmpty','@xcally.com','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x498c7e[_0x302c('0x10')](0x0,-0x1)[_0x302c('0x11')]('\x20'):_0x10aea8['name'];}return _0x302c('0x12');}function getLastName(_0x589060){var _0x2655df=_[_0x302c('0xc')](_0x589060[_0x302c('0x8')]);if(_0x2655df&&_0x2655df[_0x302c('0xd')]){var _0x16ed87=_0x2655df[_0x302c('0xd')]['split'](/\s+/);return _0x16ed87[_0x302c('0x13')]>0x1?_0x16ed87[_0x302c('0x14')]():'';}return'';}function getMails(_0x5a60e5,_0x99d136){var _0x25dafd='';for(var _0x3ae860=0x0;_0x3ae860<_0x99d136[_0x302c('0x8')][_0x302c('0x13')];_0x3ae860+=0x1){if(_0x99d136[_0x302c('0x8')][_0x3ae860][_0x302c('0x9')]!==_0x5a60e5){if(!_[_0x302c('0x15')](_0x25dafd)){_0x25dafd+=',';}_0x25dafd+=_0x99d136[_0x302c('0x8')][_0x3ae860][_0x302c('0xd')]||_0x99d136[_0x302c('0x8')][_0x3ae860][_0x302c('0x9')]||'';_0x25dafd+='\x20<';_0x25dafd+=_0x99d136[_0x302c('0x8')][_0x3ae860][_0x302c('0x9')]?_0x99d136['value'][_0x3ae860][_0x302c('0x9')]:'anonymous'+random['generate'](0x6)+_0x302c('0x16');_0x25dafd+='>';}}return _0x25dafd;}function parseEmail(_0x1dcb13,_0x4bb8a3,_0x56e3c4){if(_0x4bb8a3[_0x302c('0x17')]){var _0x57fa25=/)<[^<]*)*<\/script>/gi;while(_0x57fa25[_0x302c('0x18')](_0x4bb8a3[_0x302c('0x17')])){_0x4bb8a3[_0x302c('0x17')]=_0x4bb8a3['html'][_0x302c('0x19')](_0x57fa25,'');}if(_0x4bb8a3['html'][_0x302c('0x1a')](_0x302c('0x1b'))){var _0x62a1d4=[];_0x4bb8a3['attachments'][_0x302c('0x1c')](_0x43c492=>{_0x62a1d4[_0x302c('0x1d')](_0x43c492[_0x302c('0x1e')]);});var _0x3d5dcb=/]+>/g;var _0x4fa1d1=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xdc9944=_0x4bb8a3[_0x302c('0x17')][_0x302c('0x19')](_0x4fa1d1,'_SRC');var _0x331d04=_0xdc9944[_0x302c('0x19')](_0x3d5dcb,_0x302c('0x1f'));for(let _0x3037fd=0x0;_0x3037fd<_0x62a1d4['length'];_0x3037fd++){var _0x5d3d5d=_0x331d04['replace'](_0x302c('0x1f'),_0x302c('0x20')+_0x62a1d4[_0x3037fd]+_0x302c('0x21'));_0x331d04=_0x5d3d5d;}_0x4bb8a3[_0x302c('0x17')]=_0x331d04;}_0x56e3c4['body']=_0x4bb8a3[_0x302c('0x17')];}else{_0x56e3c4[_0x302c('0x22')]=_0x4bb8a3[_0x302c('0x23')];}if(_0x56e3c4[_0x302c('0x22')]){_0x56e3c4[_0x302c('0x22')]=_0x56e3c4['body']['replace'](/0x0){var _0x4c4c5a=[_0x302c('0x35'),_0x302c('0x36'),'Precedence:\x20auto_reply'];for(var _0x52e8b1=0x0;_0x52e8b1<_0x4bb8a3[_0x302c('0x34')][_0x302c('0x13')];_0x52e8b1++){var _0x102e2f=_[_0x302c('0x37')](_0x4c4c5a,_0x4bb8a3[_0x302c('0x34')][_0x52e8b1][_0x302c('0x38')]);if(_0x102e2f>=0x0){_0x56e3c4[_0x302c('0x39')]=!![];}}}return _0x56e3c4;}exports['parser']=function(_0x4f11e6,_0x42ed89,_0x4684d0){var _0x59a13c={'from':getAddress(_0x42ed89[_0x302c('0x3a')]),'firstName':getFirstName(_0x42ed89['from']),'lastName':getLastName(_0x42ed89[_0x302c('0x3a')]),'mapKey':_0x302c('0x6'),'message':{'from':getMails(_0x4f11e6[_0x302c('0x6')],_0x42ed89[_0x302c('0x3a')]),'to':_0x4f11e6[_0x302c('0x6')],'cc':'','subject':_0x42ed89[_0x302c('0x3b')]||'','messageId':_0x42ed89[_0x302c('0x3c')],'inReplyTo':_0x42ed89[_0x302c('0x3d')],'sentAt':moment(_0x42ed89[_0x302c('0x3e')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x42ed89[_0x302c('0x17')]&&!_0x42ed89[_0x302c('0x23')]){var _0x3081ce=_[_0x302c('0x3f')](_0x42ed89[_0x302c('0x29')],{'contentType':_0x302c('0x40')});if(_0x3081ce[_0x302c('0x13')]){logger[_0x302c('0x41')](util[_0x302c('0x2d')](_0x302c('0x42'),_0x42ed89['messageId']));tnef[_0x302c('0x43')](_[_0x302c('0x44')](_0x3081ce)[_0x302c('0x32')],function(_0x5c54f5,_0x3bf5fc){if(_0x3bf5fc){_0x42ed89['html']=_0x3bf5fc['BodyHTML']||_0x302c('0x45');if(_0x3bf5fc[_0x302c('0x46')]){for(var _0x13e982=0x0;_0x13e982<_0x3bf5fc[_0x302c('0x46')][_0x302c('0x13')];_0x13e982++){var _0x5e569c=_0x3bf5fc[_0x302c('0x46')][_0x13e982];_0x59a13c['message'][_0x302c('0x29')][_0x302c('0x1d')]({'filename':_0x5e569c['Title'],'content':Buffer[_0x302c('0x3a')](_0x5e569c[_0x302c('0x47')])});}}}_0x4684d0(parseEmail(_0x4f11e6,_0x42ed89,_0x59a13c));});}else{_0x42ed89[_0x302c('0x17')]='

Empty\x20message

';_0x4684d0(parseEmail(_0x4f11e6,_0x42ed89,_0x59a13c));}}else{_0x4684d0(parseEmail(_0x4f11e6,_0x42ed89,_0x59a13c));}};exports['generateXOAuth2Token']=function(_0x2989f2,_0x4d542f){var _0x22b22f=[_0x302c('0x48')+(_0x4d542f||''),_0x302c('0x49')+_0x2989f2,'',''];return Buffer[_0x302c('0x3a')](_0x22b22f[_0x302c('0x11')](''),'utf-8')[_0x302c('0x4a')](_0x302c('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d9de758..76552cc 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 _0xbcd8=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x2c5e34,_0x377d9e){var _0x255c4f=function(_0x14acaa){while(--_0x14acaa){_0x2c5e34['push'](_0x2c5e34['shift']());}};_0x255c4f(++_0x377d9e);}(_0xbcd8,0x178));var _0x8bcd=function(_0x5b7834,_0x124554){_0x5b7834=_0x5b7834-0x0;var _0x5725d9=_0xbcd8[_0x5b7834];return _0x5725d9;};'use strict';var _=require(_0x8bcd('0x0'));function MailAccount(_0x2e915d){this['id']=_0x2e915d['id']||0x0;this[_0x8bcd('0x1')]=_0x2e915d[_0x8bcd('0x1')]||_0x8bcd('0x2');this[_0x8bcd('0x3')]=_0x2e915d[_0x8bcd('0x3')]||_0x8bcd('0x4');this['active']=_0x2e915d[_0x8bcd('0x5')]||![];this[_0x8bcd('0x6')]=_0x2e915d['Imap']||[];this['Smtp']=_0x2e915d[_0x8bcd('0x7')]||[];}module[_0x8bcd('0x8')]=MailAccount; \ No newline at end of file +var _0xaf9f=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xaf9f,0xe1));var _0xfaf9=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0xaf9f[_0x5224ba];return _0x459bd2;};'use strict';var _=require(_0xfaf9('0x0'));function MailAccount(_0x2137d9){this['id']=_0x2137d9['id']||0x0;this[_0xfaf9('0x1')]=_0x2137d9[_0xfaf9('0x1')]||_0xfaf9('0x2');this[_0xfaf9('0x3')]=_0x2137d9['key']||_0xfaf9('0x4');this[_0xfaf9('0x5')]=_0x2137d9[_0xfaf9('0x5')]||![];this[_0xfaf9('0x6')]=_0x2137d9[_0xfaf9('0x6')]||[];this['Smtp']=_0x2137d9[_0xfaf9('0x7')]||[];}module[_0xfaf9('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 ecb9b03..692adb5 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 _0x7a58=['lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','length','isUndefined','merge','exports'];(function(_0x3e0b68,_0x3e92a7){var _0x3e7577=function(_0x32ddf5){while(--_0x32ddf5){_0x3e0b68['push'](_0x3e0b68['shift']());}};_0x3e7577(++_0x3e92a7);}(_0x7a58,0x8f));var _0x87a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x87a5('0x0'));var MailAccount=require(_0x87a5('0x1'));var Realtime=function(){this[_0x87a5('0x2')]={};};function freeIsNotKey(_0x57e963,_0x58d0a8,_0x55d75d){var _0x3012b8=_[_0x87a5('0x3')](_0x57e963,function(_0x367f82,_0x28dff2){return _0x367f82[_0x55d75d];});for(var _0x4e31c2 in _0x58d0a8){if(_0x58d0a8[_0x87a5('0x4')](_0x4e31c2)){if(!_0x3012b8[_0x4e31c2]){delete _0x58d0a8[_0x4e31c2];}}}}Realtime['prototype'][_0x87a5('0x5')]=function(_0x50c713,_0x3cd786){for(var _0x182cb5 in _0x3cd786){if(_0x50c713[_0x87a5('0x4')](_0x182cb5)){_0x50c713[_0x182cb5]=_0x3cd786[_0x182cb5];}}};Realtime[_0x87a5('0x6')]['initMailAccounts']=function(){var _0x3ff2d2=this;return function(_0x49e7ac){if(_0x49e7ac){freeIsNotKey(_0x49e7ac,_0x3ff2d2[_0x87a5('0x2')],'id');for(var _0x3d8845=0x0,_0x5eaf7b={},_0x4bb33f={};_0x3d8845<_0x49e7ac[_0x87a5('0x7')];_0x3d8845+=0x1){_0x5eaf7b=_0x49e7ac[_0x3d8845];if(_[_0x87a5('0x8')](_0x3ff2d2['mailAccounts'][_0x5eaf7b['id']])){_0x3ff2d2[_0x87a5('0x2')][_0x5eaf7b['id']]=new MailAccount(_0x5eaf7b);}else{_[_0x87a5('0x9')](_0x3ff2d2[_0x87a5('0x2')][_0x5eaf7b['id']],_0x5eaf7b);}}}return _0x3ff2d2[_0x87a5('0x2')];};};module[_0x87a5('0xa')]=Realtime; \ No newline at end of file +var _0x33c5=['length','merge','exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x457d51,_0x259c93){var _0x266b92=function(_0x312151){while(--_0x312151){_0x457d51['push'](_0x457d51['shift']());}};_0x266b92(++_0x259c93);}(_0x33c5,0xc9));var _0x533c=function(_0x9cc1d7,_0x126bd4){_0x9cc1d7=_0x9cc1d7-0x0;var _0x294e87=_0x33c5[_0x9cc1d7];return _0x294e87;};'use strict';var _=require(_0x533c('0x0'));var MailAccount=require(_0x533c('0x1'));var Realtime=function(){this[_0x533c('0x2')]={};};function freeIsNotKey(_0x3dc272,_0x310ff9,_0x228a48){var _0x337d95=_['mapKeys'](_0x3dc272,function(_0x12e4d3,_0x3863fb){return _0x12e4d3[_0x228a48];});for(var _0x230af5 in _0x310ff9){if(_0x310ff9[_0x533c('0x3')](_0x230af5)){if(!_0x337d95[_0x230af5]){delete _0x310ff9[_0x230af5];}}}}Realtime[_0x533c('0x4')][_0x533c('0x5')]=function(_0x5c713f,_0x575ffa){for(var _0x3eeb34 in _0x575ffa){if(_0x5c713f['hasOwnProperty'](_0x3eeb34)){_0x5c713f[_0x3eeb34]=_0x575ffa[_0x3eeb34];}}};Realtime[_0x533c('0x4')]['initMailAccounts']=function(){var _0x1cd0d5=this;return function(_0x482ec4){if(_0x482ec4){freeIsNotKey(_0x482ec4,_0x1cd0d5[_0x533c('0x2')],'id');for(var _0x27f2fa=0x0,_0x447e3c={},_0x30d103={};_0x27f2fa<_0x482ec4[_0x533c('0x6')];_0x27f2fa+=0x1){_0x447e3c=_0x482ec4[_0x27f2fa];if(_['isUndefined'](_0x1cd0d5[_0x533c('0x2')][_0x447e3c['id']])){_0x1cd0d5[_0x533c('0x2')][_0x447e3c['id']]=new MailAccount(_0x447e3c);}else{_[_0x533c('0x7')](_0x1cd0d5[_0x533c('0x2')][_0x447e3c['id']],_0x447e3c);}}}return _0x1cd0d5[_0x533c('0x2')];};};module[_0x533c('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 4dd3131..3ffae69 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 _0x06f1=['Imap','CloudProvider','data5','MailServerOut','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','service','key','ListId','TemplateId','MailServerIn'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x06f1,0x6e));var _0x106f=function(_0x4179e7,_0x1687d7){_0x4179e7=_0x4179e7-0x0;var _0x52227e=_0x06f1[_0x4179e7];return _0x52227e;};'use strict';var client=require(_0x106f('0x0'));exports[_0x106f('0x1')]=function(){return function(){return client[_0x106f('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x106f('0x3'),'provider',_0x106f('0x4'),'email','active',_0x106f('0x5'),_0x106f('0x6'),_0x106f('0x7')],'raw':![],'include':[{'model':_0x106f('0x8'),'as':_0x106f('0x9'),'include':[{'model':_0x106f('0xa'),'attributes':['id','name',_0x106f('0x4'),'type',_0x106f('0xb')],'as':_0x106f('0xa')}]},{'model':_0x106f('0xc'),'as':'Smtp','include':[{'model':_0x106f('0xa'),'attributes':['id',_0x106f('0x3'),_0x106f('0x4'),_0x106f('0xd'),_0x106f('0xb')],'as':_0x106f('0xa')}]}]},'log':_0x106f('0xe')});};};exports[_0x106f('0xf')]=function(_0x6894d8,_0x244c4d){return client['Request'](_0x106f('0x10'),{'account':{'id':_0x6894d8},'body':_0x244c4d,'log':_0x106f('0x10')});}; \ No newline at end of file +var _0x0960=['email','active','key','ListId','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0960,0xc2));var _0x0096=function(_0x37bcfa,_0x5ddc1a){_0x37bcfa=_0x37bcfa-0x0;var _0x5d0974=_0x0960[_0x37bcfa];return _0x5d0974;};'use strict';var client=require(_0x0096('0x0'));exports[_0x0096('0x1')]=function(){return function(){return client['Request'](_0x0096('0x2'),{'options':{'attributes':['id',_0x0096('0x3'),_0x0096('0x4'),_0x0096('0x5'),_0x0096('0x6'),_0x0096('0x7'),_0x0096('0x8'),_0x0096('0x9'),_0x0096('0xa')],'raw':![],'include':[{'model':_0x0096('0xb'),'as':'Imap','include':[{'model':_0x0096('0xc'),'attributes':['id','name',_0x0096('0x5'),_0x0096('0xd'),_0x0096('0xe')],'as':'CloudProvider'}]},{'model':_0x0096('0xf'),'as':_0x0096('0x10'),'include':[{'model':_0x0096('0xc'),'attributes':['id',_0x0096('0x3'),'service',_0x0096('0xd'),_0x0096('0xe')],'as':'CloudProvider'}]}]},'log':_0x0096('0x11')});};};exports['notify']=function(_0x2f653b,_0x50320d){return client[_0x0096('0x12')](_0x0096('0x13'),{'account':{'id':_0x2f653b},'body':_0x50320d,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 5e6192e..e8ef8ab 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 _0xd682=['loginMailFrequency','GetSettings','../client','ShowSetting'];(function(_0x408a19,_0x47bbf9){var _0x26ebad=function(_0x1772c2){while(--_0x1772c2){_0x408a19['push'](_0x408a19['shift']());}};_0x26ebad(++_0x47bbf9);}(_0xd682,0xe2));var _0x2d68=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd682[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x2d68('0x0'));exports['getSettings']=function(){return client['Request'](_0x2d68('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2d68('0x2')]},'log':_0x2d68('0x3')});}; \ No newline at end of file +var _0x0115=['loginMailFrequency','GetSettings','../client','Request','ShowSetting'];(function(_0x34c0e8,_0x216159){var _0x203775=function(_0x1cc2a8){while(--_0x1cc2a8){_0x34c0e8['push'](_0x34c0e8['shift']());}};_0x203775(++_0x216159);}(_0x0115,0x70));var _0x5011=function(_0xd99d4,_0x1a2dbd){_0xd99d4=_0xd99d4-0x0;var _0x298dd6=_0x0115[_0xd99d4];return _0x298dd6;};'use strict';var client=require(_0x5011('0x0'));exports['getSettings']=function(){return client[_0x5011('0x1')](_0x5011('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5011('0x3')]},'log':_0x5011('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index a17da04..e884a00 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 02078aa..994159f 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 _0xd8ca=['Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','redis','defaults','createServer','timeout','listen','socket.io','polling','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','config','SET','psubscribe','__key*__:expired','pmessage','__keyevent@0__:expired','__keyspace@0__:expired','replace','_expire','split','checkUserIsOnline','../../config/express','../../routes','once','log'];(function(_0x5c1b05,_0x213768){var _0x1a65e7=function(_0x2845d7){while(--_0x2845d7){_0x5c1b05['push'](_0x5c1b05['shift']());}};_0x1a65e7(++_0x213768);}(_0xd8ca,0x178));var _0xad8c=function(_0x284b22,_0x1e0f2c){_0x284b22=_0x284b22-0x0;var _0x261e08=_0xd8ca[_0x284b22];return _0x261e08;};'use strict';var _=require(_0xad8c('0x0'));var http=require(_0xad8c('0x1'));var express=require(_0xad8c('0x2'));var sticky=require(_0xad8c('0x3'));var Redis=require(_0xad8c('0x4'));var config=require('../../config/environment');config[_0xad8c('0x5')]=_[_0xad8c('0x6')](config[_0xad8c('0x5')],{'host':'localhost','port':0x18eb});var app=express();var server=http[_0xad8c('0x7')](app);server[_0xad8c('0x8')]=0xdbba0;var pub=new Redis(config[_0xad8c('0x5')]);var sub=new Redis(config[_0xad8c('0x5')]);if(sticky[_0xad8c('0x9')](server,config['port'])){var socketio=require(_0xad8c('0xa'))(server,{'transports':['websocket',_0xad8c('0xb')]});socketio[_0xad8c('0xc')](require(_0xad8c('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xad8c('0x5')])}));require(_0xad8c('0xe'))[_0xad8c('0xf')]();var configSocketio=require(_0xad8c('0x10'));configSocketio[_0xad8c('0xf')](socketio,pub);pub[_0xad8c('0x11')](_0xad8c('0x12'),'notify-keyspace-events','EKx');sub[_0xad8c('0x13')](_0xad8c('0x14'));sub['on'](_0xad8c('0x15'),function(_0x11da1b,_0x4d596b,_0x393efb){if(_0x4d596b===_0xad8c('0x16')||_0x4d596b===_0xad8c('0x17')){var _0x1749cd=_0x393efb[_0xad8c('0x18')](_0xad8c('0x19'),'');var _0x1f9eba=_[_0xad8c('0x1a')](_0x1749cd,':');var _0x1e8803={'id':_0x1f9eba[0x0],'name':_0x1f9eba[0x1]};configSocketio[_0xad8c('0x1b')](_0x1e8803);}});require(_0xad8c('0x1c'))['default'](app);require(_0xad8c('0x1d'))[_0xad8c('0xf')](app);}else{server[_0xad8c('0x1e')]('listening',function(){console[_0xad8c('0x1f')](_0xad8c('0x20'),config['port']);});}exports=module[_0xad8c('0x21')]=app; \ No newline at end of file +var _0xbf6b=['_expire','split','checkUserIsOnline','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','redis','defaults','localhost','createServer','timeout','listen','port','socket.io','websocket','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','config','SET','notify-keyspace-events','EKx','__keyspace@0__:expired'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xbf6b,0x168));var _0xbbf6=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xbf6b[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xbbf6('0x0'));var http=require(_0xbbf6('0x1'));var express=require(_0xbbf6('0x2'));var sticky=require(_0xbbf6('0x3'));var Redis=require(_0xbbf6('0x4'));var config=require('../../config/environment');config[_0xbbf6('0x5')]=_[_0xbbf6('0x6')](config[_0xbbf6('0x5')],{'host':_0xbbf6('0x7'),'port':0x18eb});var app=express();var server=http[_0xbbf6('0x8')](app);server[_0xbbf6('0x9')]=0xdbba0;var pub=new Redis(config[_0xbbf6('0x5')]);var sub=new Redis(config[_0xbbf6('0x5')]);if(sticky[_0xbbf6('0xa')](server,config[_0xbbf6('0xb')])){var socketio=require(_0xbbf6('0xc'))(server,{'transports':[_0xbbf6('0xd'),'polling']});socketio[_0xbbf6('0xe')](require(_0xbbf6('0xf'))({'pubClient':new Redis(config[_0xbbf6('0x5')]),'subClient':new Redis(config[_0xbbf6('0x5')])}));require(_0xbbf6('0x10'))['default']();var configSocketio=require(_0xbbf6('0x11'));configSocketio[_0xbbf6('0x12')](socketio,pub);pub[_0xbbf6('0x13')](_0xbbf6('0x14'),_0xbbf6('0x15'),_0xbbf6('0x16'));sub['psubscribe']('__key*__:expired');sub['on']('pmessage',function(_0x4a2f47,_0x803762,_0x25b40){if(_0x803762==='__keyevent@0__:expired'||_0x803762===_0xbbf6('0x17')){var _0x14e0a6=_0x25b40['replace'](_0xbbf6('0x18'),'');var _0x173b5d=_[_0xbbf6('0x19')](_0x14e0a6,':');var _0x5e48ca={'id':_0x173b5d[0x0],'name':_0x173b5d[0x1]};configSocketio[_0xbbf6('0x1a')](_0x5e48ca);}});require('../../config/express')[_0xbbf6('0x12')](app);require('../../routes')[_0xbbf6('0x12')](app);}else{server[_0xbbf6('0x1b')](_0xbbf6('0x1c'),function(){console[_0xbbf6('0x1d')](_0xbbf6('0x1e'),config['port']);});}exports=module[_0xbbf6('0x1f')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index e51556e..305eee7 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 _0xa980=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','catch','exports'];(function(_0x39cdb8,_0x15ee98){var _0x44bbc9=function(_0x395338){while(--_0x395338){_0x39cdb8['push'](_0x39cdb8['shift']());}};_0x44bbc9(++_0x15ee98);}(_0xa980,0x190));var _0x0a98=function(_0x3cfbc9,_0x3a710c){_0x3cfbc9=_0x3cfbc9-0x0;var _0x46a6c7=_0xa980[_0x3cfbc9];return _0x46a6c7;};'use strict';var jayson=require(_0x0a98('0x0'));var BPromise=require(_0x0a98('0x1'));var logger=require(_0x0a98('0x2'))(_0x0a98('0x3'));var client=jayson[_0x0a98('0x4')][_0x0a98('0x5')]({'port':0x2329});client[_0x0a98('0x6')]=function(_0x3c65b3,_0x42521b){return new BPromise(function(_0x8db8dc,_0x1ddd7e){return client[_0x0a98('0x7')](_0x3c65b3,_0x42521b)[_0x0a98('0x8')](function(_0x318bee){logger[_0x0a98('0x9')](_0x0a98('0xa'),_0x0a98('0x3'),_0x3c65b3,_0x42521b,_0x318bee);if(_0x318bee[_0x0a98('0xb')]){logger['error'](_0x0a98('0xa'),_0x0a98('0x3'),_0x3c65b3,_0x318bee[_0x0a98('0xb')][_0x0a98('0xc')],_0x42521b);return _0x1ddd7e(_0x318bee[_0x0a98('0xb')][_0x0a98('0xc')]);}else{return _0x8db8dc(_0x318bee[_0x0a98('0xd')]);}})[_0x0a98('0xe')](function(_0x5b8c2f){logger['error'](_0x0a98('0xa'),_0x0a98('0x3'),_0x3c65b3,_0x5b8c2f,_0x42521b);return _0x1ddd7e(_0x5b8c2f);});});};module[_0x0a98('0xf')]=client; \ No newline at end of file +var _0x35ef=['bluebird','routing','client','http','request','debug','rpc','error','message','result','exports','jayson/promise'];(function(_0x1be841,_0x180f97){var _0x2b1bb1=function(_0x329f03){while(--_0x329f03){_0x1be841['push'](_0x1be841['shift']());}};_0x2b1bb1(++_0x180f97);}(_0x35ef,0x1c7));var _0xf35e=function(_0x338ea0,_0x2d9b5c){_0x338ea0=_0x338ea0-0x0;var _0x13bab3=_0x35ef[_0x338ea0];return _0x13bab3;};'use strict';var jayson=require(_0xf35e('0x0'));var BPromise=require(_0xf35e('0x1'));var logger=require('../../config/logger')(_0xf35e('0x2'));var client=jayson[_0xf35e('0x3')][_0xf35e('0x4')]({'port':0x2329});client['Request']=function(_0x1e3145,_0x55c836){return new BPromise(function(_0x573f51,_0x485741){return client[_0xf35e('0x5')](_0x1e3145,_0x55c836)['then'](function(_0x292b22){logger[_0xf35e('0x6')](_0xf35e('0x7'),_0xf35e('0x2'),_0x1e3145,_0x55c836,_0x292b22);if(_0x292b22[_0xf35e('0x8')]){logger[_0xf35e('0x8')](_0xf35e('0x7'),_0xf35e('0x2'),_0x1e3145,_0x292b22[_0xf35e('0x8')]['message'],_0x55c836);return _0x485741(_0x292b22[_0xf35e('0x8')][_0xf35e('0x9')]);}else{return _0x573f51(_0x292b22[_0xf35e('0xa')]);}})['catch'](function(_0x320e75){logger[_0xf35e('0x8')](_0xf35e('0x7'),'routing',_0x1e3145,_0x320e75,_0x55c836);return _0x485741(_0x320e75);});});};module[_0xf35e('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 62b0214..bf40ba7 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 _0x9b54=['getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents'];(function(_0x5184cc,_0x42e501){var _0xf6a0ec=function(_0x1cd823){while(--_0x1cd823){_0x5184cc['push'](_0x5184cc['shift']());}};_0xf6a0ec(++_0x42e501);}(_0x9b54,0x10b));var _0x49b5=function(_0x11bbad,_0x30ff67){_0x11bbad=_0x11bbad-0x0;var _0x79dc8a=_0x9b54[_0x11bbad];return _0x79dc8a;};'use strict';var BPromise=require(_0x49b5('0x0'));var server=require(_0x49b5('0x1'));var Realtime=require(_0x49b5('0x2'));var user=require(_0x49b5('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x49b5('0x4'));var chatQueue=require(_0x49b5('0x5'));var smsQueue=require(_0x49b5('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x49b5('0x7'));var whatsappQueue=require(_0x49b5('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x49b5('0x9')]()[_0x49b5('0xa')](user[_0x49b5('0xb')]())[_0x49b5('0xa')](realtime[_0x49b5('0xc')]())[_0x49b5('0xa')](interval[_0x49b5('0xd')]())[_0x49b5('0xa')](realtime[_0x49b5('0xe')]())[_0x49b5('0xa')](openchannelQueue[_0x49b5('0xf')]())['then'](realtime['initOpenchannelQueues']())[_0x49b5('0xa')](chatQueue[_0x49b5('0x10')]())[_0x49b5('0xa')](realtime[_0x49b5('0x11')]())[_0x49b5('0xa')](smsQueue['getSmsQueues']())[_0x49b5('0xa')](realtime[_0x49b5('0x12')]())['then'](mailQueue[_0x49b5('0x13')]())['then'](realtime[_0x49b5('0x14')]())[_0x49b5('0xa')](faxQueue[_0x49b5('0x15')]())[_0x49b5('0xa')](realtime[_0x49b5('0x16')]())['then'](whatsappQueue[_0x49b5('0x17')]())[_0x49b5('0xa')](realtime[_0x49b5('0x18')]())[_0x49b5('0xa')](function(){return realtime;});}function main(){return server[_0x49b5('0x19')](realtime)[_0x49b5('0xa')](function(_0x31f51f){return initRealtime();})[_0x49b5('0xa')](function(_0x5d13f3){return setInterval(initRealtime,0x1388);})[_0x49b5('0x1a')](function(_0x12ee1d){console[_0x49b5('0x1b')](_0x12ee1d);});}main(); \ No newline at end of file +var _0x458b=['initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x458b,0x7d));var _0xb458=function(_0x1dc82c,_0x4f43eb){_0x1dc82c=_0x1dc82c-0x0;var _0x39b34a=_0x458b[_0x1dc82c];return _0x39b34a;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require('./realtime');var user=require(_0xb458('0x0'));var interval=require(_0xb458('0x1'));var openchannelQueue=require(_0xb458('0x2'));var chatQueue=require(_0xb458('0x3'));var smsQueue=require(_0xb458('0x4'));var mailQueue=require(_0xb458('0x5'));var faxQueue=require(_0xb458('0x6'));var whatsappQueue=require(_0xb458('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xb458('0x8')]()['then'](user[_0xb458('0x9')]())[_0xb458('0xa')](realtime[_0xb458('0xb')]())['then'](interval[_0xb458('0xc')]())[_0xb458('0xa')](realtime[_0xb458('0xd')]())['then'](openchannelQueue[_0xb458('0xe')]())[_0xb458('0xa')](realtime[_0xb458('0xf')]())[_0xb458('0xa')](chatQueue[_0xb458('0x10')]())[_0xb458('0xa')](realtime[_0xb458('0x11')]())[_0xb458('0xa')](smsQueue[_0xb458('0x12')]())['then'](realtime[_0xb458('0x13')]())[_0xb458('0xa')](mailQueue[_0xb458('0x14')]())[_0xb458('0xa')](realtime[_0xb458('0x15')]())[_0xb458('0xa')](faxQueue['getFaxQueues']())[_0xb458('0xa')](realtime[_0xb458('0x16')]())['then'](whatsappQueue[_0xb458('0x17')]())['then'](realtime[_0xb458('0x18')]())[_0xb458('0xa')](function(){return realtime;});}function main(){return server[_0xb458('0x19')](realtime)[_0xb458('0xa')](function(_0xf13aad){return initRealtime();})[_0xb458('0xa')](function(_0x363f7d){return setInterval(initRealtime,0x1388);})[_0xb458('0x1a')](function(_0x4fe62e){console[_0xb458('0x1b')](_0x4fe62e);});}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 a3a0f84..a08a19f 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 _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(_0x579121,_0x27e9e2){var _0x38a4ae=function(_0x53e154){while(--_0x53e154){_0x579121['push'](_0x579121['shift']());}};_0x38a4ae(++_0x27e9e2);}(_0x326f,0xd1));var _0xf326=function(_0x4b6dcf,_0x9d4d7b){_0x4b6dcf=_0x4b6dcf-0x0;var _0x187fa9=_0x326f[_0x4b6dcf];return _0x187fa9;};'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 +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x1261[_0x4b9dc9];return _0x57b302;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index f994169..8b07fbe 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 _0x02f9=['http','request','error','message','result','catch','sendMailMessage','SendMail','bluebird','client'];(function(_0x4e9990,_0x363765){var _0x49d92b=function(_0x30a021){while(--_0x30a021){_0x4e9990['push'](_0x4e9990['shift']());}};_0x49d92b(++_0x363765);}(_0x02f9,0xe4));var _0x902f=function(_0x12faf8,_0x4eb1da){_0x12faf8=_0x12faf8-0x0;var _0x1353ee=_0x02f9[_0x12faf8];return _0x1353ee;};'use strict';var BPromise=require(_0x902f('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x902f('0x1')][_0x902f('0x2')]({'port':0x232b});function request(_0x1094a7,_0x4a847c){return new BPromise(function(_0x4f8aa9,_0x2c3d95){return client[_0x902f('0x3')](_0x1094a7,_0x4a847c)['then'](function(_0x567a4b){if(_0x567a4b[_0x902f('0x4')]){return _0x2c3d95(_0x567a4b['error'][_0x902f('0x5')]);}else{return _0x4f8aa9(_0x567a4b[_0x902f('0x6')]);}})[_0x902f('0x7')](function(_0x366972){return _0x2c3d95(_0x366972);});});}exports[_0x902f('0x8')]=function(_0x45f0e6,_0x2a36c5){return request(_0x902f('0x9'),{'account':_0x45f0e6,'message':_0x2a36c5});}; \ No newline at end of file +var _0x40dd=['message','catch','bluebird','jayson/promise','client','http','request','error'];(function(_0x421aab,_0xabe03b){var _0x5f4093=function(_0x64f991){while(--_0x64f991){_0x421aab['push'](_0x421aab['shift']());}};_0x5f4093(++_0xabe03b);}(_0x40dd,0xc2));var _0xd40d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x40dd[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xd40d('0x0'));var jayson=require(_0xd40d('0x1'));var client=jayson[_0xd40d('0x2')][_0xd40d('0x3')]({'port':0x232b});function request(_0x2fa74f,_0x2525b8){return new BPromise(function(_0x3e6e17,_0x308c20){return client[_0xd40d('0x4')](_0x2fa74f,_0x2525b8)['then'](function(_0xe7376e){if(_0xe7376e['error']){return _0x308c20(_0xe7376e[_0xd40d('0x5')][_0xd40d('0x6')]);}else{return _0x3e6e17(_0xe7376e['result']);}})[_0xd40d('0x7')](function(_0x305d57){return _0x308c20(_0x305d57);});});}exports['sendMailMessage']=function(_0x2754a2,_0x23fd08){return request('SendMail',{'account':_0x2754a2,'message':_0x23fd08});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 3230ff0..f087971 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 _0xb9e7=['online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','format','Status','chatStatus','chatStatusTime','chatCurrentCapacity','mailStatus','whatsappStatus','openchannelStatus','user:save','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x2ce69a,_0x311e96){var _0x5547ab=function(_0x1d9862){while(--_0x1d9862){_0x2ce69a['push'](_0x2ce69a['shift']());}};_0x5547ab(++_0x311e96);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xb9e7[_0x5416db];return _0x243e35;};'use strict';var _=require('lodash');var moment=require(_0x7b9e('0x0'));var md5=require(_0x7b9e('0x1'));var Redis=require(_0x7b9e('0x2'));var config=require(_0x7b9e('0x3'));config[_0x7b9e('0x4')]=_[_0x7b9e('0x5')](config['redis'],{'host':_0x7b9e('0x6'),'port':0x18eb});var io=require(_0x7b9e('0x7'))(new Redis(config['redis']));function Agent(_0x2372ee){this['id']=_0x2372ee['id']||0x0;this['name']=_0x2372ee[_0x7b9e('0x8')]||'';this[_0x7b9e('0x9')]=_0x2372ee[_0x7b9e('0x9')]||!![];this[_0x7b9e('0xa')]=_0x2372ee[_0x7b9e('0xa')]||![];this['chatPause']=_0x2372ee[_0x7b9e('0xb')]||![];this[_0x7b9e('0xc')]=_0x2372ee[_0x7b9e('0xc')]||![];this['faxPause']=_0x2372ee[_0x7b9e('0xd')]||![];this['smsPause']=_0x2372ee[_0x7b9e('0xe')]||![];this[_0x7b9e('0xf')]=_0x2372ee['openchannelPause']||![];this['chatStatus']=_0x7b9e('0x10');this['chatStatusTime']=0x0;this[_0x7b9e('0x11')]=_0x2372ee['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x7b9e('0x10');this[_0x7b9e('0x12')]=0x0;this[_0x7b9e('0x13')]=_0x2372ee[_0x7b9e('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x7b9e('0x14')]=_0x7b9e('0x10');this[_0x7b9e('0x15')]=0x0;this[_0x7b9e('0x16')]=_0x2372ee[_0x7b9e('0x16')]||0x0;this[_0x7b9e('0x17')]=0x0;this[_0x7b9e('0x18')]=_0x7b9e('0x10');this[_0x7b9e('0x19')]=0x0;this[_0x7b9e('0x1a')]=_0x2372ee['smsCapacity']||0x0;this[_0x7b9e('0x1b')]=0x0;this['whatsappStatus']=_0x7b9e('0x10');this[_0x7b9e('0x1c')]=0x0;this['whatsappCapacity']=_0x2372ee[_0x7b9e('0x1d')]||0x0;this[_0x7b9e('0x1e')]=0x0;this['openchannelStatus']='unknown';this[_0x7b9e('0x1f')]=0x0;this[_0x7b9e('0x20')]=_0x2372ee[_0x7b9e('0x20')]||0x0;this[_0x7b9e('0x21')]=0x0;this['busy']=![];this[_0x7b9e('0x22')]=undefined;this[_0x7b9e('0x1')]='';this[_0x7b9e('0x23')]();}Agent[_0x7b9e('0x24')][_0x7b9e('0x25')]=function(_0x535433){if(this[_0x535433+_0x7b9e('0x26')]>0x0){if(this[_0x535433+_0x7b9e('0x27')]>0x0&&this[_0x535433+_0x7b9e('0x26')]>=this[_0x535433+_0x7b9e('0x27')]){return _0x7b9e('0x28');}else{return _0x7b9e('0x29');}}else{return _0x7b9e('0x2a');}};Agent[_0x7b9e('0x24')][_0x7b9e('0x23')]=function(){var _0x5dcd42=[_0x7b9e('0x2b'),_0x7b9e('0x2c'),_0x7b9e('0x2d'),_0x7b9e('0x2e'),_0x7b9e('0x2f'),_0x7b9e('0x30')];for(var _0x42fbe7=0x0;_0x42fbe7<_0x5dcd42[_0x7b9e('0x31')];_0x42fbe7+=0x1){var _0x2ddd56=this[_0x7b9e('0x25')](_0x5dcd42[_0x42fbe7]);if(this[_0x5dcd42[_0x42fbe7]+'Status']!==_0x2ddd56){this[_0x5dcd42[_0x42fbe7]+_0x7b9e('0x32')]=_[_0x7b9e('0x33')](moment()[_0x7b9e('0x34')]('x'));}this[_0x5dcd42[_0x42fbe7]+_0x7b9e('0x35')]=_0x2ddd56;}var _0x2ac45e={'id':this['id'],'name':this[_0x7b9e('0x8')],'online':this['online'],'voicePause':this[_0x7b9e('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x7b9e('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x7b9e('0xd')],'openchannelPause':this[_0x7b9e('0xf')],'chatStatus':this[_0x7b9e('0x36')],'chatStatusTime':this[_0x7b9e('0x37')],'chatCapacity':this[_0x7b9e('0x11')],'chatCurrentCapacity':this[_0x7b9e('0x38')],'mailStatus':this[_0x7b9e('0x39')],'mailStatusTime':this[_0x7b9e('0x12')],'mailCapacity':this[_0x7b9e('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x7b9e('0x14')],'faxStatusTime':this[_0x7b9e('0x15')],'faxCapacity':this[_0x7b9e('0x16')],'faxCurrentCapacity':this[_0x7b9e('0x17')],'smsStatus':this[_0x7b9e('0x18')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x7b9e('0x1a')],'smsCurrentCapacity':this[_0x7b9e('0x1b')],'whatsappStatus':this[_0x7b9e('0x3a')],'whatsappStatusTime':this[_0x7b9e('0x1c')],'whatsappCapacity':this[_0x7b9e('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x7b9e('0x3b')],'openchannelStatusTime':this[_0x7b9e('0x1f')],'openchannelCapacity':this[_0x7b9e('0x20')],'openchannelCurrentCapacity':this[_0x7b9e('0x21')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x3bd8eb=md5(JSON['stringify'](_0x2ac45e));if(this['md5']!==_0x3bd8eb){this[_0x7b9e('0x1')]=_0x3bd8eb;io['emit'](_0x7b9e('0x3c'),_0x2ac45e);}};module['exports']=Agent; \ No newline at end of file +var _0x4189=['faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','prototype','mail','openchannel','sms','length','Status','StatusTime','toNumber','smsStatus','whatsappCapacity','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','unknown','faxStatusTime','faxCapacity'];(function(_0x17e315,_0x361db6){var _0x3e7afb=function(_0x830a5f){while(--_0x830a5f){_0x17e315['push'](_0x17e315['shift']());}};_0x3e7afb(++_0x361db6);}(_0x4189,0x13c));var _0x9418=function(_0x22ffaa,_0x226583){_0x22ffaa=_0x22ffaa-0x0;var _0x2a953a=_0x4189[_0x22ffaa];return _0x2a953a;};'use strict';var _=require(_0x9418('0x0'));var moment=require('moment');var md5=require(_0x9418('0x1'));var Redis=require(_0x9418('0x2'));var config=require(_0x9418('0x3'));config[_0x9418('0x4')]=_['defaults'](config[_0x9418('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9418('0x5'))(new Redis(config[_0x9418('0x4')]));function Agent(_0x1e3061){this['id']=_0x1e3061['id']||0x0;this['name']=_0x1e3061[_0x9418('0x6')]||'';this['online']=_0x1e3061[_0x9418('0x7')]||!![];this['voicePause']=_0x1e3061[_0x9418('0x8')]||![];this[_0x9418('0x9')]=_0x1e3061['chatPause']||![];this['mailPause']=_0x1e3061[_0x9418('0xa')]||![];this[_0x9418('0xb')]=_0x1e3061[_0x9418('0xb')]||![];this[_0x9418('0xc')]=_0x1e3061['smsPause']||![];this[_0x9418('0xd')]=_0x1e3061[_0x9418('0xd')]||![];this[_0x9418('0xe')]='unknown';this[_0x9418('0xf')]=0x0;this['chatCapacity']=_0x1e3061[_0x9418('0x10')]||0x0;this[_0x9418('0x11')]=0x0;this[_0x9418('0x12')]='unknown';this[_0x9418('0x13')]=0x0;this['mailCapacity']=_0x1e3061[_0x9418('0x14')]||0x0;this[_0x9418('0x15')]=0x0;this[_0x9418('0x16')]=_0x9418('0x17');this[_0x9418('0x18')]=0x0;this[_0x9418('0x19')]=_0x1e3061[_0x9418('0x19')]||0x0;this[_0x9418('0x1a')]=0x0;this['smsStatus']=_0x9418('0x17');this[_0x9418('0x1b')]=0x0;this[_0x9418('0x1c')]=_0x1e3061[_0x9418('0x1c')]||0x0;this[_0x9418('0x1d')]=0x0;this['whatsappStatus']='unknown';this[_0x9418('0x1e')]=0x0;this['whatsappCapacity']=_0x1e3061['whatsappCapacity']||0x0;this[_0x9418('0x1f')]=0x0;this[_0x9418('0x20')]=_0x9418('0x17');this[_0x9418('0x21')]=0x0;this[_0x9418('0x22')]=_0x1e3061[_0x9418('0x22')]||0x0;this[_0x9418('0x23')]=0x0;this[_0x9418('0x24')]=![];this[_0x9418('0x25')]=undefined;this[_0x9418('0x1')]='';this[_0x9418('0x26')]();}Agent['prototype'][_0x9418('0x27')]=function(_0x333137){if(this[_0x333137+_0x9418('0x28')]>0x0){if(this[_0x333137+_0x9418('0x29')]>0x0&&this[_0x333137+_0x9418('0x28')]>=this[_0x333137+'Capacity']){return _0x9418('0x2a');}else{return'working';}}else{return _0x9418('0x2b');}};Agent[_0x9418('0x2c')]['updateRealtime']=function(){var _0x329c33=[_0x9418('0x2d'),'chat',_0x9418('0x2e'),'fax',_0x9418('0x2f'),'whatsapp'];for(var _0x4864d7=0x0;_0x4864d7<_0x329c33[_0x9418('0x30')];_0x4864d7+=0x1){var _0x514a03=this[_0x9418('0x27')](_0x329c33[_0x4864d7]);if(this[_0x329c33[_0x4864d7]+_0x9418('0x31')]!==_0x514a03){this[_0x329c33[_0x4864d7]+_0x9418('0x32')]=_[_0x9418('0x33')](moment()['format']('x'));}this[_0x329c33[_0x4864d7]+_0x9418('0x31')]=_0x514a03;}var _0x5e24d2={'id':this['id'],'name':this[_0x9418('0x6')],'online':this[_0x9418('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0x9418('0x9')],'mailPause':this[_0x9418('0xa')],'smsPause':this[_0x9418('0xc')],'faxPause':this[_0x9418('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x9418('0xf')],'chatCapacity':this[_0x9418('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x9418('0x13')],'mailCapacity':this[_0x9418('0x14')],'mailCurrentCapacity':this[_0x9418('0x15')],'faxStatus':this[_0x9418('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x9418('0x19')],'faxCurrentCapacity':this[_0x9418('0x1a')],'smsStatus':this[_0x9418('0x34')],'smsStatusTime':this[_0x9418('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x9418('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x9418('0x1e')],'whatsappCapacity':this[_0x9418('0x35')],'whatsappCurrentCapacity':this[_0x9418('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x9418('0x21')],'openchannelCapacity':this[_0x9418('0x22')],'openchannelCurrentCapacity':this[_0x9418('0x23')],'busy':this[_0x9418('0x24')],'busyQueue':this[_0x9418('0x25')]};var _0x315bdb=md5(JSON['stringify'](_0x5e24d2));if(this[_0x9418('0x1')]!==_0x315bdb){this[_0x9418('0x1')]=_0x315bdb;io[_0x9418('0x36')](_0x9418('0x37'),_0x5e24d2);}};module[_0x9418('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 841c522..2a7547f 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 _0x86f9=['length','online','chatPause','available','name','waiting','stringify','format','emit','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','timeout','strategy','mapAgentsId','updateRouting','_rr','map','Agents','prototype','updateRealtime','loggedIn','paused'];(function(_0x137815,_0x78dd4b){var _0x29ded1=function(_0x32d620){while(--_0x32d620){_0x137815['push'](_0x137815['shift']());}};_0x29ded1(++_0x78dd4b);}(_0x86f9,0x15a));var _0x986f=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x86f9[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x986f('0x0'));var md5=require(_0x986f('0x1'));var util=require('util');var Redis=require(_0x986f('0x2'));var config=require(_0x986f('0x3'));config['redis']=_[_0x986f('0x4')](config[_0x986f('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x986f('0x6'))(new Redis(config[_0x986f('0x5')]));function ChatQueue(_0x4b57e5){this['id']=_0x4b57e5['id']||0x0;this['name']=_0x4b57e5['name']||'';this[_0x986f('0x7')]=_0x4b57e5[_0x986f('0x7')]||0xa;this[_0x986f('0x8')]=_0x4b57e5[_0x986f('0x8')]||'beepall';this['Agents']=_0x4b57e5['Agents'];this[_0x986f('0x9')]={};this['waiting']=0x0;this[_0x986f('0x1')]='';this[_0x986f('0xa')]();this['updateRealtime']();}ChatQueue['prototype']['updateRouting']=function(){var _0xe408e7=this[_0x986f('0x9')][_0x986f('0xb')];this[_0x986f('0x9')]=_[_0x986f('0xc')](this[_0x986f('0xd')],'id');this['mapAgentsId'][_0x986f('0xb')]=_0xe408e7;};ChatQueue[_0x986f('0xe')][_0x986f('0xf')]=function(){this[_0x986f('0x10')]=0x0;this[_0x986f('0x11')]=0x0;for(var _0x4f2911=0x0;_0x4f2911=0x0?this[_0x986f('0x15')]:0x0;var _0x37c2a9={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x986f('0x16')],'paused':this[_0x986f('0x11')],'waiting':this[_0x986f('0x17')]};var _0x4518c2=md5(JSON[_0x986f('0x18')](_0x37c2a9));if(this[_0x986f('0x1')]!==_0x4518c2){this['md5']=_0x4518c2;io['to'](util[_0x986f('0x19')]('chat:queue:%s',_0x37c2a9[_0x986f('0x16')]))[_0x986f('0x1a')]('chat_queue:save',_0x37c2a9);}};module[_0x986f('0x1b')]=ChatQueue; \ No newline at end of file +var _0x5fd1=['online','chatPause','available','paused','stringify','format','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','length'];(function(_0x2e6823,_0x5ea1b2){var _0x56afd9=function(_0x123275){while(--_0x123275){_0x2e6823['push'](_0x2e6823['shift']());}};_0x56afd9(++_0x5ea1b2);}(_0x5fd1,0x1da));var _0x15fd=function(_0x4c496c,_0x1f0919){_0x4c496c=_0x4c496c-0x0;var _0x52593a=_0x5fd1[_0x4c496c];return _0x52593a;};'use strict';var _=require(_0x15fd('0x0'));var md5=require(_0x15fd('0x1'));var util=require(_0x15fd('0x2'));var Redis=require(_0x15fd('0x3'));var config=require(_0x15fd('0x4'));config['redis']=_[_0x15fd('0x5')](config[_0x15fd('0x6')],{'host':_0x15fd('0x7'),'port':0x18eb});var io=require(_0x15fd('0x8'))(new Redis(config[_0x15fd('0x6')]));function ChatQueue(_0x5852a7){this['id']=_0x5852a7['id']||0x0;this[_0x15fd('0x9')]=_0x5852a7['name']||'';this[_0x15fd('0xa')]=_0x5852a7[_0x15fd('0xa')]||0xa;this['strategy']=_0x5852a7[_0x15fd('0xb')]||_0x15fd('0xc');this['Agents']=_0x5852a7[_0x15fd('0xd')];this[_0x15fd('0xe')]={};this[_0x15fd('0xf')]=0x0;this[_0x15fd('0x1')]='';this[_0x15fd('0x10')]();this[_0x15fd('0x11')]();}ChatQueue['prototype'][_0x15fd('0x10')]=function(){var _0x15efad=this[_0x15fd('0xe')][_0x15fd('0x12')];this[_0x15fd('0xe')]=_['map'](this[_0x15fd('0xd')],'id');this[_0x15fd('0xe')]['_rr']=_0x15efad;};ChatQueue[_0x15fd('0x13')]['updateRealtime']=function(){this[_0x15fd('0x14')]=0x0;this['paused']=0x0;for(var _0x1031fe=0x0;_0x1031fe=0x0?this[_0x15fd('0x18')]:0x0;var _0x391cb3={'id':this['id'],'available':this[_0x15fd('0x18')],'loggedIn':this[_0x15fd('0x14')],'name':this[_0x15fd('0x9')],'paused':this['paused'],'waiting':this[_0x15fd('0xf')]};var _0x2b4fea=md5(JSON[_0x15fd('0x1a')](_0x391cb3));if(this[_0x15fd('0x1')]!==_0x2b4fea){this[_0x15fd('0x1')]=_0x2b4fea;io['to'](util[_0x15fd('0x1b')]('chat:queue:%s',_0x391cb3[_0x15fd('0x9')]))[_0x15fd('0x1c')](_0x15fd('0x1d'),_0x391cb3);}};module[_0x15fd('0x1e')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index cca0192..b5b3783 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 _0xfe58=['stringify','format','fax:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','faxPause','available'];(function(_0xea706b,_0x3ce5b5){var _0x5318af=function(_0x3f6ecd){while(--_0x3f6ecd){_0xea706b['push'](_0xea706b['shift']());}};_0x5318af(++_0x3ce5b5);}(_0xfe58,0x1c6));var _0x8fe5=function(_0xe3f748,_0x1a6160){_0xe3f748=_0xe3f748-0x0;var _0x5e022d=_0xfe58[_0xe3f748];return _0x5e022d;};'use strict';var _=require(_0x8fe5('0x0'));var md5=require(_0x8fe5('0x1'));var util=require(_0x8fe5('0x2'));var Redis=require(_0x8fe5('0x3'));var config=require(_0x8fe5('0x4'));config[_0x8fe5('0x5')]=_[_0x8fe5('0x6')](config[_0x8fe5('0x5')],{'host':_0x8fe5('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8fe5('0x5')]));function FaxQueue(_0x396a7c){this['id']=_0x396a7c['id']||0x0;this[_0x8fe5('0x8')]=_0x396a7c[_0x8fe5('0x8')]||'';this[_0x8fe5('0x9')]=_0x396a7c[_0x8fe5('0x9')]||0xa;this[_0x8fe5('0xa')]=_0x396a7c[_0x8fe5('0xa')]||_0x8fe5('0xb');this[_0x8fe5('0xc')]=_0x396a7c[_0x8fe5('0xc')];this[_0x8fe5('0xd')]={};this[_0x8fe5('0xe')]=0x0;this[_0x8fe5('0x1')]='';this['updateRouting']();this[_0x8fe5('0xf')]();}FaxQueue[_0x8fe5('0x10')][_0x8fe5('0x11')]=function(){var _0xb10808=this[_0x8fe5('0xd')][_0x8fe5('0x12')];this[_0x8fe5('0xd')]=_[_0x8fe5('0x13')](this['Agents'],'id');this[_0x8fe5('0xd')][_0x8fe5('0x12')]=_0xb10808;};FaxQueue[_0x8fe5('0x10')][_0x8fe5('0xf')]=function(){this[_0x8fe5('0x14')]=0x0;this[_0x8fe5('0x15')]=0x0;for(var _0x18c5f9=0x0;_0x18c5f9=0x0?this[_0x8fe5('0x19')]:0x0;var _0x4969ba={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8fe5('0x14')],'name':this[_0x8fe5('0x8')],'paused':this[_0x8fe5('0x15')],'waiting':this[_0x8fe5('0xe')]};var _0x51b880=md5(JSON[_0x8fe5('0x1a')](_0x4969ba));if(this[_0x8fe5('0x1')]!==_0x51b880){this[_0x8fe5('0x1')]=_0x51b880;io['to'](util[_0x8fe5('0x1b')](_0x8fe5('0x1c'),_0x4969ba[_0x8fe5('0x8')]))['emit']('fax_queue:save',_0x4969ba);}};module[_0x8fe5('0x1d')]=FaxQueue; \ No newline at end of file +var _0x90c2=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','faxPause','available','name','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util'];(function(_0x2280e8,_0x1be0e5){var _0x2166ab=function(_0x5940e4){while(--_0x5940e4){_0x2280e8['push'](_0x2280e8['shift']());}};_0x2166ab(++_0x1be0e5);}(_0x90c2,0x1ce));var _0x290c=function(_0x4be309,_0x4c0469){_0x4be309=_0x4be309-0x0;var _0x375a42=_0x90c2[_0x4be309];return _0x375a42;};'use strict';var _=require(_0x290c('0x0'));var md5=require(_0x290c('0x1'));var util=require(_0x290c('0x2'));var Redis=require(_0x290c('0x3'));var config=require(_0x290c('0x4'));config[_0x290c('0x5')]=_[_0x290c('0x6')](config['redis'],{'host':_0x290c('0x7'),'port':0x18eb});var io=require(_0x290c('0x8'))(new Redis(config['redis']));function FaxQueue(_0x3d48c9){this['id']=_0x3d48c9['id']||0x0;this['name']=_0x3d48c9['name']||'';this[_0x290c('0x9')]=_0x3d48c9['timeout']||0xa;this[_0x290c('0xa')]=_0x3d48c9[_0x290c('0xa')]||_0x290c('0xb');this[_0x290c('0xc')]=_0x3d48c9[_0x290c('0xc')];this[_0x290c('0xd')]={};this['waiting']=0x0;this[_0x290c('0x1')]='';this[_0x290c('0xe')]();this[_0x290c('0xf')]();}FaxQueue[_0x290c('0x10')][_0x290c('0xe')]=function(){var _0x15d7ff=this[_0x290c('0xd')][_0x290c('0x11')];this['mapAgentsId']=_[_0x290c('0x12')](this[_0x290c('0xc')],'id');this['mapAgentsId'][_0x290c('0x11')]=_0x15d7ff;};FaxQueue['prototype'][_0x290c('0xf')]=function(){this[_0x290c('0x13')]=0x0;this[_0x290c('0x14')]=0x0;for(var _0x408e1a=0x0;_0x408e1a=0x0?this[_0x290c('0x17')]:0x0;var _0x4bb979={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x290c('0x18')],'paused':this[_0x290c('0x14')],'waiting':this[_0x290c('0x19')]};var _0xfabe02=md5(JSON[_0x290c('0x1a')](_0x4bb979));if(this[_0x290c('0x1')]!==_0xfabe02){this[_0x290c('0x1')]=_0xfabe02;io['to'](util[_0x290c('0x1b')](_0x290c('0x1c'),_0x4bb979['name']))[_0x290c('0x1d')](_0x290c('0x1e'),_0x4bb979);}};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 df5f48a..b189689 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 _0x8322=['name','Intervals','exports'];(function(_0x3e5fdc,_0x309cb1){var _0x5ce834=function(_0x279734){while(--_0x279734){_0x3e5fdc['push'](_0x3e5fdc['shift']());}};_0x5ce834(++_0x309cb1);}(_0x8322,0xfc));var _0x2832=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0x8322[_0x216428];return _0x313dd4;};'use strict';function Interval(_0x7a549){this['id']=_0x7a549['id']||0x0;this['name']=_0x7a549[_0x2832('0x0')]||'';this[_0x2832('0x1')]=_0x7a549[_0x2832('0x1')]||{};}module[_0x2832('0x2')]=Interval; \ No newline at end of file +var _0xdad0=['Intervals','exports','name'];(function(_0x105045,_0x2e471e){var _0x2487d0=function(_0x243428){while(--_0x243428){_0x105045['push'](_0x105045['shift']());}};_0x2487d0(++_0x2e471e);}(_0xdad0,0xbc));var _0x0dad=function(_0xb04827,_0xeeb829){_0xb04827=_0xb04827-0x0;var _0x22cbe0=_0xdad0[_0xb04827];return _0x22cbe0;};'use strict';function Interval(_0x4fb231){this['id']=_0x4fb231['id']||0x0;this['name']=_0x4fb231[_0x0dad('0x0')]||'';this['Intervals']=_0x4fb231[_0x0dad('0x1')]||{};}module[_0x0dad('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index a8a9237..2379b03 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 _0xf9e8=['emit','mail_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','length','online','mailPause','available','stringify','format'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xf9e8,0xcd));var _0x8f9e=function(_0x2a6700,_0x2b144a){_0x2a6700=_0x2a6700-0x0;var _0x3d3567=_0xf9e8[_0x2a6700];return _0x3d3567;};'use strict';var _=require('lodash');var md5=require(_0x8f9e('0x0'));var util=require(_0x8f9e('0x1'));var Redis=require(_0x8f9e('0x2'));var config=require(_0x8f9e('0x3'));config[_0x8f9e('0x4')]=_[_0x8f9e('0x5')](config[_0x8f9e('0x4')],{'host':_0x8f9e('0x6'),'port':0x18eb});var io=require(_0x8f9e('0x7'))(new Redis(config[_0x8f9e('0x4')]));function MailQueue(_0x31eba4){this['id']=_0x31eba4['id']||0x0;this['name']=_0x31eba4[_0x8f9e('0x8')]||'';this['timeout']=_0x31eba4[_0x8f9e('0x9')]||0xa;this['strategy']=_0x31eba4[_0x8f9e('0xa')]||_0x8f9e('0xb');this[_0x8f9e('0xc')]=_0x31eba4[_0x8f9e('0xc')];this['mapAgentsId']={};this[_0x8f9e('0xd')]=0x0;this[_0x8f9e('0x0')]='';this[_0x8f9e('0xe')]();this[_0x8f9e('0xf')]();}MailQueue[_0x8f9e('0x10')][_0x8f9e('0xe')]=function(){var _0x2af206=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0x8f9e('0xc')],'id');this[_0x8f9e('0x11')][_0x8f9e('0x12')]=_0x2af206;};MailQueue[_0x8f9e('0x10')][_0x8f9e('0xf')]=function(){this[_0x8f9e('0x13')]=0x0;this[_0x8f9e('0x14')]=0x0;for(var _0x75ef07=0x0;_0x75ef07=0x0?this[_0x8f9e('0x18')]:0x0;var _0x16b368={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8f9e('0x13')],'name':this[_0x8f9e('0x8')],'paused':this[_0x8f9e('0x14')],'waiting':this[_0x8f9e('0xd')]};var _0x2e096d=md5(JSON[_0x8f9e('0x19')](_0x16b368));if(this[_0x8f9e('0x0')]!==_0x2e096d){this['md5']=_0x2e096d;io['to'](util[_0x8f9e('0x1a')]('mail:queue:%s',_0x16b368['name']))[_0x8f9e('0x1b')](_0x8f9e('0x1c'),_0x16b368);}};module['exports']=MailQueue; \ No newline at end of file +var _0x5df4=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','paused','length','mailPause','available','loggedIn','stringify','format','mail:queue:%s','emit','mail_queue:save','md5','util','ioredis','redis'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x5df4,0xdc));var _0x45df=function(_0x5dcff,_0x1855dc){_0x5dcff=_0x5dcff-0x0;var _0x512082=_0x5df4[_0x5dcff];return _0x512082;};'use strict';var _=require('lodash');var md5=require(_0x45df('0x0'));var util=require(_0x45df('0x1'));var Redis=require(_0x45df('0x2'));var config=require('../../../config/environment');config[_0x45df('0x3')]=_['defaults'](config['redis'],{'host':_0x45df('0x4'),'port':0x18eb});var io=require(_0x45df('0x5'))(new Redis(config[_0x45df('0x3')]));function MailQueue(_0x4c9d24){this['id']=_0x4c9d24['id']||0x0;this[_0x45df('0x6')]=_0x4c9d24['name']||'';this[_0x45df('0x7')]=_0x4c9d24['timeout']||0xa;this[_0x45df('0x8')]=_0x4c9d24[_0x45df('0x8')]||_0x45df('0x9');this[_0x45df('0xa')]=_0x4c9d24[_0x45df('0xa')];this[_0x45df('0xb')]={};this[_0x45df('0xc')]=0x0;this[_0x45df('0x0')]='';this[_0x45df('0xd')]();this[_0x45df('0xe')]();}MailQueue[_0x45df('0xf')]['updateRouting']=function(){var _0x2d98fb=this[_0x45df('0xb')]['_rr'];this[_0x45df('0xb')]=_[_0x45df('0x10')](this['Agents'],'id');this[_0x45df('0xb')][_0x45df('0x11')]=_0x2d98fb;};MailQueue[_0x45df('0xf')][_0x45df('0xe')]=function(){this['loggedIn']=0x0;this[_0x45df('0x12')]=0x0;for(var _0x506399=0x0;_0x506399=0x0?this[_0x45df('0x15')]:0x0;var _0x1588b5={'id':this['id'],'available':this[_0x45df('0x15')],'loggedIn':this[_0x45df('0x16')],'name':this['name'],'paused':this[_0x45df('0x12')],'waiting':this[_0x45df('0xc')]};var _0x2679fb=md5(JSON[_0x45df('0x17')](_0x1588b5));if(this[_0x45df('0x0')]!==_0x2679fb){this[_0x45df('0x0')]=_0x2679fb;io['to'](util[_0x45df('0x18')](_0x45df('0x19'),_0x1588b5[_0x45df('0x6')]))[_0x45df('0x1a')](_0x45df('0x1b'),_0x1588b5);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 9cf6040..3c020e6 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x1d3019,_0x8dbbd5){var _0x36458e=function(_0x5d60db){while(--_0x5d60db){_0x1d3019['push'](_0x1d3019['shift']());}};_0x36458e(++_0x8dbbd5);}(_0xadb5,0xad));var _0x5adb=function(_0x43ae64,_0x362dc2){_0x43ae64=_0x43ae64-0x0;var _0x313801=_0xadb5[_0x43ae64];return _0x313801;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x7f287d,_0xe3b36e){var _0x21514f=function(_0x2e392e){while(--_0x2e392e){_0x7f287d['push'](_0x7f287d['shift']());}};_0x21514f(++_0xe3b36e);}(_0xadb5,0xad));var _0x5adb=function(_0x449825,_0x384d0a){_0x449825=_0x449825-0x0;var _0x117901=_0xadb5[_0x449825];return _0x117901;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 564d938..dbbaa2c 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 _0x34e5=['length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused'];(function(_0x56a02a,_0x1edb70){var _0x501c29=function(_0x1e8fa2){while(--_0x1e8fa2){_0x56a02a['push'](_0x56a02a['shift']());}};_0x501c29(++_0x1edb70);}(_0x34e5,0x172));var _0x534e=function(_0x1c5237,_0x223e78){_0x1c5237=_0x1c5237-0x0;var _0x232ec6=_0x34e5[_0x1c5237];return _0x232ec6;};'use strict';var _=require('lodash');var md5=require(_0x534e('0x0'));var util=require('util');var Redis=require(_0x534e('0x1'));var config=require(_0x534e('0x2'));config[_0x534e('0x3')]=_[_0x534e('0x4')](config[_0x534e('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x534e('0x5'))(new Redis(config[_0x534e('0x3')]));function SmsQueue(_0x3c772f){this['id']=_0x3c772f['id']||0x0;this[_0x534e('0x6')]=_0x3c772f[_0x534e('0x6')]||'';this[_0x534e('0x7')]=_0x3c772f[_0x534e('0x7')]||0xa;this['strategy']=_0x3c772f[_0x534e('0x8')]||_0x534e('0x9');this[_0x534e('0xa')]=_0x3c772f['Agents'];this['mapAgentsId']={};this[_0x534e('0xb')]=0x0;this['md5']='';this[_0x534e('0xc')]();this['updateRealtime']();}SmsQueue[_0x534e('0xd')][_0x534e('0xc')]=function(){var _0x27561c=this['mapAgentsId'][_0x534e('0xe')];this[_0x534e('0xf')]=_[_0x534e('0x10')](this[_0x534e('0xa')],'id');this[_0x534e('0xf')]['_rr']=_0x27561c;};SmsQueue[_0x534e('0xd')][_0x534e('0x11')]=function(){this[_0x534e('0x12')]=0x0;this[_0x534e('0x13')]=0x0;for(var _0x359565=0x0;_0x359565=0x0?this[_0x534e('0x17')]:0x0;var _0x26938d={'id':this['id'],'available':this[_0x534e('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x534e('0x6')],'paused':this[_0x534e('0x13')],'waiting':this[_0x534e('0xb')]};var _0x1bef0a=md5(JSON[_0x534e('0x18')](_0x26938d));if(this['md5']!==_0x1bef0a){this[_0x534e('0x0')]=_0x1bef0a;io['to'](util[_0x534e('0x19')](_0x534e('0x1a'),_0x26938d[_0x534e('0x6')]))[_0x534e('0x1b')](_0x534e('0x1c'),_0x26938d);}};module[_0x534e('0x1d')]=SmsQueue; \ No newline at end of file +var _0xa5ca=['localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','length','loggedIn','smsPause','paused','available','stringify','format','emit','sms_queue:save','exports','lodash','md5','util','redis','defaults'];(function(_0x272606,_0x62b8f){var _0x2f96ca=function(_0x40736a){while(--_0x40736a){_0x272606['push'](_0x272606['shift']());}};_0x2f96ca(++_0x62b8f);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa5ca[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xaa5c('0x0'));var md5=require(_0xaa5c('0x1'));var util=require(_0xaa5c('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xaa5c('0x3')]=_[_0xaa5c('0x4')](config[_0xaa5c('0x3')],{'host':_0xaa5c('0x5'),'port':0x18eb});var io=require(_0xaa5c('0x6'))(new Redis(config[_0xaa5c('0x3')]));function SmsQueue(_0x56500a){this['id']=_0x56500a['id']||0x0;this['name']=_0x56500a['name']||'';this[_0xaa5c('0x7')]=_0x56500a[_0xaa5c('0x7')]||0xa;this[_0xaa5c('0x8')]=_0x56500a['strategy']||'beepall';this[_0xaa5c('0x9')]=_0x56500a[_0xaa5c('0x9')];this[_0xaa5c('0xa')]={};this['waiting']=0x0;this[_0xaa5c('0x1')]='';this[_0xaa5c('0xb')]();this[_0xaa5c('0xc')]();}SmsQueue[_0xaa5c('0xd')][_0xaa5c('0xb')]=function(){var _0xb03963=this[_0xaa5c('0xa')][_0xaa5c('0xe')];this[_0xaa5c('0xa')]=_[_0xaa5c('0xf')](this[_0xaa5c('0x9')],'id');this[_0xaa5c('0xa')][_0xaa5c('0xe')]=_0xb03963;};SmsQueue['prototype'][_0xaa5c('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4c8461=0x0;_0x4c8461=0x0?this['available']:0x0;var _0x43990d={'id':this['id'],'available':this[_0xaa5c('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x3e7eab=md5(JSON[_0xaa5c('0x15')](_0x43990d));if(this['md5']!==_0x3e7eab){this[_0xaa5c('0x1')]=_0x3e7eab;io['to'](util[_0xaa5c('0x16')]('sms:queue:%s',_0x43990d['name']))[_0xaa5c('0x17')](_0xaa5c('0x18'),_0x43990d);}};module[_0xaa5c('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 578e6a3..687e7c3 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 _0xaef8=['paused','length','online','whatsappPause','available','waiting','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','prototype','_rr','map','updateRealtime','loggedIn'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xaef8,0x183));var _0x8aef=function(_0x5aa20c,_0x28b6ca){_0x5aa20c=_0x5aa20c-0x0;var _0x5d0a3a=_0xaef8[_0x5aa20c];return _0x5d0a3a;};'use strict';var _=require(_0x8aef('0x0'));var md5=require(_0x8aef('0x1'));var util=require('util');var Redis=require(_0x8aef('0x2'));var config=require(_0x8aef('0x3'));config[_0x8aef('0x4')]=_[_0x8aef('0x5')](config[_0x8aef('0x4')],{'host':_0x8aef('0x6'),'port':0x18eb});var io=require(_0x8aef('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x156edd){this['id']=_0x156edd['id']||0x0;this[_0x8aef('0x8')]=_0x156edd['name']||'';this[_0x8aef('0x9')]=_0x156edd[_0x8aef('0x9')]||0xa;this[_0x8aef('0xa')]=_0x156edd[_0x8aef('0xa')]||_0x8aef('0xb');this[_0x8aef('0xc')]=_0x156edd[_0x8aef('0xc')];this[_0x8aef('0xd')]={};this['waiting']=0x0;this[_0x8aef('0x1')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x8aef('0xe')]['updateRouting']=function(){var _0x1cf902=this['mapAgentsId'][_0x8aef('0xf')];this['mapAgentsId']=_[_0x8aef('0x10')](this[_0x8aef('0xc')],'id');this['mapAgentsId'][_0x8aef('0xf')]=_0x1cf902;};WhatsappQueue[_0x8aef('0xe')][_0x8aef('0x11')]=function(){this[_0x8aef('0x12')]=0x0;this[_0x8aef('0x13')]=0x0;for(var _0x27e6a9=0x0;_0x27e6a9=0x0?this[_0x8aef('0x17')]:0x0;var _0x489689={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8aef('0x12')],'name':this[_0x8aef('0x8')],'paused':this[_0x8aef('0x13')],'waiting':this[_0x8aef('0x18')]};var _0x580edd=md5(JSON['stringify'](_0x489689));if(this[_0x8aef('0x1')]!==_0x580edd){this['md5']=_0x580edd;io['to'](util['format'](_0x8aef('0x19'),_0x489689[_0x8aef('0x8')]))[_0x8aef('0x1a')](_0x8aef('0x1b'),_0x489689);}};module[_0x8aef('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x3f26=['prototype','_rr','updateRealtime','loggedIn','paused','length','online','available','stringify','format','emit','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x5e0532,_0x38f899){var _0x3894fe=function(_0x5caea5){while(--_0x5caea5){_0x5e0532['push'](_0x5e0532['shift']());}};_0x3894fe(++_0x38f899);}(_0x3f26,0x1bc));var _0x63f2=function(_0x3b468f,_0x4f565b){_0x3b468f=_0x3b468f-0x0;var _0x5966e8=_0x3f26[_0x3b468f];return _0x5966e8;};'use strict';var _=require('lodash');var md5=require(_0x63f2('0x0'));var util=require(_0x63f2('0x1'));var Redis=require(_0x63f2('0x2'));var config=require('../../../config/environment');config[_0x63f2('0x3')]=_[_0x63f2('0x4')](config['redis'],{'host':_0x63f2('0x5'),'port':0x18eb});var io=require(_0x63f2('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x1c54e9){this['id']=_0x1c54e9['id']||0x0;this['name']=_0x1c54e9[_0x63f2('0x7')]||'';this[_0x63f2('0x8')]=_0x1c54e9[_0x63f2('0x8')]||0xa;this[_0x63f2('0x9')]=_0x1c54e9[_0x63f2('0x9')]||_0x63f2('0xa');this[_0x63f2('0xb')]=_0x1c54e9[_0x63f2('0xb')];this[_0x63f2('0xc')]={};this[_0x63f2('0xd')]=0x0;this[_0x63f2('0x0')]='';this[_0x63f2('0xe')]();this['updateRealtime']();}WhatsappQueue[_0x63f2('0xf')]['updateRouting']=function(){var _0x3ae19e=this[_0x63f2('0xc')][_0x63f2('0x10')];this[_0x63f2('0xc')]=_['map'](this[_0x63f2('0xb')],'id');this['mapAgentsId']['_rr']=_0x3ae19e;};WhatsappQueue[_0x63f2('0xf')][_0x63f2('0x11')]=function(){this[_0x63f2('0x12')]=0x0;this[_0x63f2('0x13')]=0x0;for(var _0x13419f=0x0;_0x13419f=0x0?this['available']:0x0;var _0x5be3ea={'id':this['id'],'available':this[_0x63f2('0x16')],'loggedIn':this[_0x63f2('0x12')],'name':this[_0x63f2('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x315547=md5(JSON[_0x63f2('0x17')](_0x5be3ea));if(this[_0x63f2('0x0')]!==_0x315547){this['md5']=_0x315547;io['to'](util[_0x63f2('0x18')]('whatsapp:queue:%s',_0x5be3ea[_0x63f2('0x7')]))[_0x63f2('0x19')]('whatsapp_queue:save',_0x5be3ea);}};module[_0x63f2('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 6a2e2e4..7dce83d 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index d3606a5..96fc224 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 _0x041e=['updateChatInteraction','addTags','Request','AddTagsToChatInteraction','../client','update'];(function(_0x301164,_0x5f1ad4){var _0x222d6f=function(_0x56be4f){while(--_0x56be4f){_0x301164['push'](_0x301164['shift']());}};_0x222d6f(++_0x5f1ad4);}(_0x041e,0xe2));var _0xe041=function(_0x1d35c7,_0x1d184d){_0x1d35c7=_0x1d35c7-0x0;var _0x19196d=_0x041e[_0x1d35c7];return _0x19196d;};'use strict';var client=require(_0xe041('0x0'));exports[_0xe041('0x1')]=function(_0x41d3af,_0x410da5){return client['Request']('UpdateChatInteraction',{'body':_0x410da5,'options':{'where':{'id':_0x41d3af}},'log':_0xe041('0x2')});};exports[_0xe041('0x3')]=function(_0x509e11,_0x4c9f0a){return client[_0xe041('0x4')](_0xe041('0x5'),{'body':_0x4c9f0a,'options':{'where':{'id':_0x509e11}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x80b9=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x13c8c8,_0xd66219){var _0x1f2839=function(_0x280845){while(--_0x280845){_0x13c8c8['push'](_0x13c8c8['shift']());}};_0x1f2839(++_0xd66219);}(_0x80b9,0xf4));var _0x980b=function(_0x33e2e3,_0x45a429){_0x33e2e3=_0x33e2e3-0x0;var _0x1f0d07=_0x80b9[_0x33e2e3];return _0x1f0d07;};'use strict';var client=require(_0x980b('0x0'));exports[_0x980b('0x1')]=function(_0x54fecb,_0x275133){return client[_0x980b('0x2')](_0x980b('0x3'),{'body':_0x275133,'options':{'where':{'id':_0x54fecb}},'log':_0x980b('0x4')});};exports[_0x980b('0x5')]=function(_0x3baac6,_0x50b6de){return client['Request'](_0x980b('0x6'),{'body':_0x50b6de,'options':{'where':{'id':_0x3baac6}},'log':_0x980b('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 5c1a95d..176d553 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 _0x7c44=['../client','Request','CreateChatMessage'];(function(_0x49c450,_0x4c1e9b){var _0x5a7336=function(_0x34007a){while(--_0x34007a){_0x49c450['push'](_0x49c450['shift']());}};_0x5a7336(++_0x4c1e9b);}(_0x7c44,0xdb));var _0x47c4=function(_0x202350,_0x1d0559){_0x202350=_0x202350-0x0;var _0x33beff=_0x7c44[_0x202350];return _0x33beff;};'use strict';var client=require(_0x47c4('0x0'));exports['create']=function(_0x4ed4aa){return client[_0x47c4('0x1')](_0x47c4('0x2'),{'body':_0x4ed4aa,'log':'createChatMessage'});}; \ No newline at end of file +var _0x463d=['CreateChatMessage','createChatMessage','Request'];(function(_0x32aa7c,_0x4280f7){var _0xbbacae=function(_0x556c6f){while(--_0x556c6f){_0x32aa7c['push'](_0x32aa7c['shift']());}};_0xbbacae(++_0x4280f7);}(_0x463d,0x68));var _0xd463=function(_0x154f21,_0x3c7f37){_0x154f21=_0x154f21-0x0;var _0x5ae16f=_0x463d[_0x154f21];return _0x5ae16f;};'use strict';var client=require('../client');exports['create']=function(_0xa4fb57){return client[_0xd463('0x0')](_0xd463('0x1'),{'body':_0xa4fb57,'log':_0xd463('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3c9a0af..dc70020 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 _0x5fc3=['name','timeout','strategy','User','online','chatPause','../client','getChatQueues','GetChatQueue'];(function(_0x3d9b04,_0x1e851a){var _0x557936=function(_0x3bf3ae){while(--_0x3bf3ae){_0x3d9b04['push'](_0x3d9b04['shift']());}};_0x557936(++_0x1e851a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x5fc3[_0x323d87];return _0x5e8f74;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(){return function(){return client['Request'](_0x35fc('0x2'),{'options':{'raw':![],'attributes':['id',_0x35fc('0x3'),_0x35fc('0x4'),_0x35fc('0x5')],'include':[{'model':_0x35fc('0x6'),'as':'Agents','attributes':['id',_0x35fc('0x3'),_0x35fc('0x7'),_0x35fc('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x1c88=['chatPause','getChatQueues','../client','Request','GetChatQueue','name','User','Agents','online'];(function(_0x31981a,_0x2ad046){var _0x37688d=function(_0x3c264a){while(--_0x3c264a){_0x31981a['push'](_0x31981a['shift']());}};_0x37688d(++_0x2ad046);}(_0x1c88,0x1a9));var _0x81c8=function(_0x3500f2,_0x142fb1){_0x3500f2=_0x3500f2-0x0;var _0x7ad03f=_0x1c88[_0x3500f2];return _0x7ad03f;};'use strict';var client=require(_0x81c8('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x81c8('0x1')](_0x81c8('0x2'),{'options':{'raw':![],'attributes':['id',_0x81c8('0x3'),'timeout','strategy'],'include':[{'model':_0x81c8('0x4'),'as':_0x81c8('0x5'),'attributes':['id',_0x81c8('0x3'),_0x81c8('0x6'),_0x81c8('0x7')]}]},'log':_0x81c8('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index f2e29a5..810f50a 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 _0x4944=['DESC','../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x1274f5,_0x3ddb6b){var _0x5542db=function(_0x225c69){while(--_0x225c69){_0x1274f5['push'](_0x1274f5['shift']());}};_0x5542db(++_0x3ddb6b);}(_0x4944,0x6d));var _0x4494=function(_0x2251ac,_0x5ae9c0){_0x2251ac=_0x2251ac-0x0;var _0x5ed16f=_0x4944[_0x2251ac];return _0x5ed16f;};'use strict';var client=require(_0x4494('0x0'));exports['create']=function(_0xfcff90){return client[_0x4494('0x1')](_0x4494('0x2'),{'body':_0xfcff90,'log':_0x4494('0x2')});};exports[_0x4494('0x3')]=function(_0x5074d9,_0x187098){return client['Request'](_0x4494('0x4'),{'body':_0x187098,'options':{'where':{'uniqueid':_0x5074d9},'order':[['id',_0x4494('0x5')]],'limit':0x1},'log':_0x4494('0x4')});}; \ No newline at end of file +var _0xd3d1=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x3561e5,_0x202002){var _0x1fa299=function(_0x414ad3){while(--_0x414ad3){_0x3561e5['push'](_0x3561e5['shift']());}};_0x1fa299(++_0x202002);}(_0xd3d1,0x172));var _0x1d3d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd3d1[_0x13d07a];return _0x5ee0ee;};'use strict';var client=require(_0x1d3d('0x0'));exports[_0x1d3d('0x1')]=function(_0x49043e){return client['Request'](_0x1d3d('0x2'),{'body':_0x49043e,'log':_0x1d3d('0x2')});};exports[_0x1d3d('0x3')]=function(_0xfd3615,_0x41a806){return client[_0x1d3d('0x4')](_0x1d3d('0x5'),{'body':_0x41a806,'options':{'where':{'uniqueid':_0xfd3615},'order':[['id',_0x1d3d('0x6')]],'limit':0x1},'log':_0x1d3d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 736c139..9e93545 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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x7a54,0x106));var _0x47a5=function(_0x5a42c6,_0x27d756){_0x5a42c6=_0x5a42c6-0x0;var _0x44f5d6=_0x7a54[_0x5a42c6];return _0x44f5d6;};'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 +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x14af66,_0x5b5fb3){var _0x4f219f=function(_0x2a57f0){while(--_0x2a57f0){_0x14af66['push'](_0x14af66['shift']());}};_0x4f219f(++_0x5b5fb3);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 147abd7..fd0819f 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 _0x428c=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x577708,_0x28ca76){var _0xc781c8=function(_0xdb46fb){while(--_0xdb46fb){_0x577708['push'](_0x577708['shift']());}};_0xc781c8(++_0x28ca76);}(_0x428c,0x170));var _0xc428=function(_0x594954,_0xac78){_0x594954=_0x594954-0x0;var _0x5cc4a5=_0x428c[_0x594954];return _0x5cc4a5;};'use strict';var client=require(_0xc428('0x0'));exports[_0xc428('0x1')]=function(_0x4958c1){return client[_0xc428('0x2')](_0xc428('0x3'),{'body':_0x4958c1,'log':_0xc428('0x4')});}; \ No newline at end of file +var _0x9a3d=['createFaxMessage','create','CreateFaxMessage'];(function(_0xaaa0fd,_0x266bef){var _0x4b3ae9=function(_0x2fb9a8){while(--_0x2fb9a8){_0xaaa0fd['push'](_0xaaa0fd['shift']());}};_0x4b3ae9(++_0x266bef);}(_0x9a3d,0x16f));var _0xd9a3=function(_0x32fe8f,_0x2490a4){_0x32fe8f=_0x32fe8f-0x0;var _0xd6d83c=_0x9a3d[_0x32fe8f];return _0xd6d83c;};'use strict';var client=require('../client');exports[_0xd9a3('0x0')]=function(_0xb945ea){return client['Request'](_0xd9a3('0x1'),{'body':_0xb945ea,'log':_0xd9a3('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6e9667a..16431ed 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 _0xf4fa=['../client','getFaxQueues','name','timeout','strategy','Agents','online','faxPause'];(function(_0x3b9ea9,_0x503d09){var _0x1d181d=function(_0x3c727f){while(--_0x3c727f){_0x3b9ea9['push'](_0x3b9ea9['shift']());}};_0x1d181d(++_0x503d09);}(_0xf4fa,0xa8));var _0xaf4f=function(_0x486b99,_0x126c81){_0x486b99=_0x486b99-0x0;var _0x309f59=_0xf4fa[_0x486b99];return _0x309f59;};'use strict';var client=require(_0xaf4f('0x0'));exports[_0xaf4f('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xaf4f('0x2'),_0xaf4f('0x3'),_0xaf4f('0x4')],'include':[{'model':'User','as':_0xaf4f('0x5'),'attributes':['id',_0xaf4f('0x2'),_0xaf4f('0x6'),_0xaf4f('0x7')]}]},'log':_0xaf4f('0x1')});};}; \ No newline at end of file +var _0xd218=['Agents','online','faxPause','../client','getFaxQueues','Request','name','timeout'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xd218,0x83));var _0x8d21=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xd218[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x8d21('0x0'));exports[_0x8d21('0x1')]=function(){return function(){return client[_0x8d21('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x8d21('0x3'),_0x8d21('0x4'),'strategy'],'include':[{'model':'User','as':_0x8d21('0x5'),'attributes':['id',_0x8d21('0x3'),_0x8d21('0x6'),_0x8d21('0x7')]}]},'log':_0x8d21('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 8a49676..254901d 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 _0xda42=['CreateFaxQueueReport','UpdateFaxQueueReport','../client','create','Request'];(function(_0x28fbcc,_0x512282){var _0x5e9121=function(_0x45610c){while(--_0x45610c){_0x28fbcc['push'](_0x28fbcc['shift']());}};_0x5e9121(++_0x512282);}(_0xda42,0xc0));var _0x2da4=function(_0x3eab76,_0x330767){_0x3eab76=_0x3eab76-0x0;var _0x3c46c8=_0xda42[_0x3eab76];return _0x3c46c8;};'use strict';var client=require(_0x2da4('0x0'));exports[_0x2da4('0x1')]=function(_0x13f6fb){return client[_0x2da4('0x2')](_0x2da4('0x3'),{'body':_0x13f6fb,'log':_0x2da4('0x3')});};exports['update']=function(_0x354390,_0x9ecca4){return client['Request'](_0x2da4('0x4'),{'body':_0x9ecca4,'options':{'where':{'uniqueid':_0x354390},'order':[['id','DESC']],'limit':0x1},'log':_0x2da4('0x4')});}; \ No newline at end of file +var _0xc185=['CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x3fb731,_0x2baf6d){var _0x139aac=function(_0x1c835e){while(--_0x1c835e){_0x3fb731['push'](_0x3fb731['shift']());}};_0x139aac(++_0x2baf6d);}(_0xc185,0x1a3));var _0x5c18=function(_0x144c4c,_0x2b6672){_0x144c4c=_0x144c4c-0x0;var _0x11c36e=_0xc185[_0x144c4c];return _0x11c36e;};'use strict';var client=require(_0x5c18('0x0'));exports['create']=function(_0xb56db0){return client['Request'](_0x5c18('0x1'),{'body':_0xb56db0,'log':_0x5c18('0x1')});};exports[_0x5c18('0x2')]=function(_0x49c4a6,_0x1cec25){return client['Request'](_0x5c18('0x3'),{'body':_0x1cec25,'options':{'where':{'uniqueid':_0x49c4a6},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index ee0206f..e25b0bf 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 _0x9412=['getIntervals','Request','GetInterval','Interval','Intervals','interval','../client'];(function(_0x17dfd5,_0x4c08fa){var _0x2629b1=function(_0x1af05b){while(--_0x1af05b){_0x17dfd5['push'](_0x17dfd5['shift']());}};_0x2629b1(++_0x4c08fa);}(_0x9412,0x172));var _0x2941=function(_0x55569f,_0x48ab6d){_0x55569f=_0x55569f-0x0;var _0x2664b1=_0x9412[_0x55569f];return _0x2664b1;};'use strict';var client=require(_0x2941('0x0'));exports[_0x2941('0x1')]=function(){return function(){return client[_0x2941('0x2')](_0x2941('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x2941('0x4'),'as':_0x2941('0x5'),'attributes':['id','name',_0x2941('0x6')]}]},'log':_0x2941('0x1')});};}; \ No newline at end of file +var _0xe4ea=['GetInterval','name','Interval','Intervals','../client','getIntervals','Request'];(function(_0x30bbad,_0x3827f1){var _0x17ae59=function(_0x5850aa){while(--_0x5850aa){_0x30bbad['push'](_0x30bbad['shift']());}};_0x17ae59(++_0x3827f1);}(_0xe4ea,0x1cb));var _0xae4e=function(_0x6f723e,_0x136bd0){_0x6f723e=_0x6f723e-0x0;var _0x2afaa1=_0xe4ea[_0x6f723e];return _0x2afaa1;};'use strict';var client=require(_0xae4e('0x0'));exports[_0xae4e('0x1')]=function(){return function(){return client[_0xae4e('0x2')](_0xae4e('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xae4e('0x4')],'include':[{'model':_0xae4e('0x5'),'as':_0xae4e('0x6'),'attributes':['id',_0xae4e('0x4'),'interval']}]},'log':_0xae4e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 42583fd..8f2fc0a 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 _0x0120=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x519481,_0x49f898){var _0x5d2d9c=function(_0x195fc2){while(--_0x195fc2){_0x519481['push'](_0x519481['shift']());}};_0x5d2d9c(++_0x49f898);}(_0x0120,0x6f));var _0x0012=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0120[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x0012('0x0'));exports[_0x0012('0x1')]=function(_0x3d23e7,_0xb8d57c){return client[_0x0012('0x2')](_0x0012('0x3'),{'body':_0xb8d57c,'options':{'where':{'id':_0x3d23e7}},'log':_0x0012('0x4')});};exports[_0x0012('0x5')]=function(_0x357f77,_0x302029){return client[_0x0012('0x2')](_0x0012('0x6'),{'body':_0x302029,'options':{'where':{'id':_0x357f77}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7334=['Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','addTags'];(function(_0x42c398,_0x169f5f){var _0x470146=function(_0x52d9bf){while(--_0x52d9bf){_0x42c398['push'](_0x42c398['shift']());}};_0x470146(++_0x169f5f);}(_0x7334,0x184));var _0x4733=function(_0x107a42,_0x949ee){_0x107a42=_0x107a42-0x0;var _0x5db247=_0x7334[_0x107a42];return _0x5db247;};'use strict';var client=require(_0x4733('0x0'));exports[_0x4733('0x1')]=function(_0x280b6b,_0x5016ad){return client['Request'](_0x4733('0x2'),{'body':_0x5016ad,'options':{'where':{'id':_0x280b6b}},'log':'updateMailInteraction'});};exports[_0x4733('0x3')]=function(_0x218143,_0x3645a2){return client[_0x4733('0x4')](_0x4733('0x5'),{'body':_0x3645a2,'options':{'where':{'id':_0x218143}},'log':_0x4733('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1247a6f..24cbcb9 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 _0xc200=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x4ed187,_0x3246a2){var _0x3378f6=function(_0x27e1b4){while(--_0x27e1b4){_0x4ed187['push'](_0x4ed187['shift']());}};_0x3378f6(++_0x3246a2);}(_0xc200,0x9b));var _0x0c20=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc200[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x0c20('0x0'));exports[_0x0c20('0x1')]=function(_0x802dff){return client[_0x0c20('0x2')](_0x0c20('0x3'),{'body':_0x802dff,'log':_0x0c20('0x4')});}; \ No newline at end of file +var _0x0a76=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x2d093b,_0x460963){var _0x1abe4e=function(_0x3608b4){while(--_0x3608b4){_0x2d093b['push'](_0x2d093b['shift']());}};_0x1abe4e(++_0x460963);}(_0x0a76,0x8c));var _0x60a7=function(_0x1c9b71,_0x3a635c){_0x1c9b71=_0x1c9b71-0x0;var _0x301c5a=_0x0a76[_0x1c9b71];return _0x301c5a;};'use strict';var client=require(_0x60a7('0x0'));exports[_0x60a7('0x1')]=function(_0x2b8923){return client[_0x60a7('0x2')](_0x60a7('0x3'),{'body':_0x2b8923,'log':_0x60a7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index d14f1f7..0c72e2c 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 _0x9541=['name','timeout','strategy','online','mailPause','getMailQueues','Request','GetMailQueue'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x9541,0xc5));var _0x1954=function(_0x545a17,_0x5b6b3e){_0x545a17=_0x545a17-0x0;var _0x406e2c=_0x9541[_0x545a17];return _0x406e2c;};'use strict';var client=require('../client');exports[_0x1954('0x0')]=function(){return function(){return client[_0x1954('0x1')](_0x1954('0x2'),{'options':{'raw':![],'attributes':['id',_0x1954('0x3'),_0x1954('0x4'),_0x1954('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x1954('0x6'),_0x1954('0x7')]}]},'log':_0x1954('0x0')});};}; \ No newline at end of file +var _0x0416=['name','timeout','strategy','Agents','online','mailPause','../client','getMailQueues','Request'];(function(_0x2bc1ce,_0x1b32d0){var _0x930aa5=function(_0x5ef020){while(--_0x5ef020){_0x2bc1ce['push'](_0x2bc1ce['shift']());}};_0x930aa5(++_0x1b32d0);}(_0x0416,0x165));var _0x6041=function(_0x50d3ac,_0x9a806f){_0x50d3ac=_0x50d3ac-0x0;var _0x25ac33=_0x0416[_0x50d3ac];return _0x25ac33;};'use strict';var client=require(_0x6041('0x0'));exports[_0x6041('0x1')]=function(){return function(){return client[_0x6041('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x6041('0x3'),_0x6041('0x4'),_0x6041('0x5')],'include':[{'model':'User','as':_0x6041('0x6'),'attributes':['id',_0x6041('0x3'),_0x6041('0x7'),_0x6041('0x8')]}]},'log':_0x6041('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index a948473..4c725b0 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 _0x2667=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x4a6e77,_0x4a677c){var _0x1c137e=function(_0x3ecd59){while(--_0x3ecd59){_0x4a6e77['push'](_0x4a6e77['shift']());}};_0x1c137e(++_0x4a677c);}(_0x2667,0x77));var _0x7266=function(_0x38a8ab,_0x369be6){_0x38a8ab=_0x38a8ab-0x0;var _0x58a917=_0x2667[_0x38a8ab];return _0x58a917;};'use strict';var client=require(_0x7266('0x0'));exports[_0x7266('0x1')]=function(_0x97b14b){return client[_0x7266('0x2')]('CreateMailQueueReport',{'body':_0x97b14b,'log':_0x7266('0x3')});};exports[_0x7266('0x4')]=function(_0x1cb3ce,_0x4d28f5){return client[_0x7266('0x2')](_0x7266('0x5'),{'body':_0x4d28f5,'options':{'where':{'uniqueid':_0x1cb3ce},'order':[['id',_0x7266('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x3f1f=['update','UpdateMailQueueReport','../client','Request','CreateMailQueueReport'];(function(_0x49e7d5,_0x2f43b2){var _0xd2f6ea=function(_0x5a9a9d){while(--_0x5a9a9d){_0x49e7d5['push'](_0x49e7d5['shift']());}};_0xd2f6ea(++_0x2f43b2);}(_0x3f1f,0xac));var _0xf3f1=function(_0x5d7707,_0x16f3a6){_0x5d7707=_0x5d7707-0x0;var _0x437720=_0x3f1f[_0x5d7707];return _0x437720;};'use strict';var client=require(_0xf3f1('0x0'));exports['create']=function(_0x1d5e44){return client[_0xf3f1('0x1')](_0xf3f1('0x2'),{'body':_0x1d5e44,'log':_0xf3f1('0x2')});};exports[_0xf3f1('0x3')]=function(_0x2ae254,_0x4ee6d3){return client[_0xf3f1('0x1')](_0xf3f1('0x4'),{'body':_0x4ee6d3,'options':{'where':{'uniqueid':_0x2ae254},'order':[['id','DESC']],'limit':0x1},'log':_0xf3f1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9d9588f..16d145e 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 _0xae5f=['updateOpenchannelInteraction','addTags','Request','../client','UpdateOpenchannelInteraction'];(function(_0xdd4d73,_0x3f0604){var _0x6a8f22=function(_0x22f0b8){while(--_0x22f0b8){_0xdd4d73['push'](_0xdd4d73['shift']());}};_0x6a8f22(++_0x3f0604);}(_0xae5f,0x170));var _0xfae5=function(_0x1db142,_0x1b8810){_0x1db142=_0x1db142-0x0;var _0x39f43e=_0xae5f[_0x1db142];return _0x39f43e;};'use strict';var client=require(_0xfae5('0x0'));exports['update']=function(_0x37b8d5,_0x5be682){return client['Request'](_0xfae5('0x1'),{'body':_0x5be682,'options':{'where':{'id':_0x37b8d5}},'log':_0xfae5('0x2')});};exports[_0xfae5('0x3')]=function(_0x47f16c,_0x403f07){return client[_0xfae5('0x4')]('AddTagsToOpenchannelInteraction',{'body':_0x403f07,'options':{'where':{'id':_0x47f16c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xf436=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xf436,0x1de));var _0x6f43=function(_0x5c9dc7,_0x4a3c16){_0x5c9dc7=_0x5c9dc7-0x0;var _0x45f871=_0xf436[_0x5c9dc7];return _0x45f871;};'use strict';var client=require(_0x6f43('0x0'));exports[_0x6f43('0x1')]=function(_0x45f872,_0x41e4be){return client[_0x6f43('0x2')]('UpdateOpenchannelInteraction',{'body':_0x41e4be,'options':{'where':{'id':_0x45f872}},'log':_0x6f43('0x3')});};exports[_0x6f43('0x4')]=function(_0x1a995d,_0x223a98){return client[_0x6f43('0x2')](_0x6f43('0x5'),{'body':_0x223a98,'options':{'where':{'id':_0x1a995d}},'log':_0x6f43('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d16b55a..2b89946 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 _0x5d3b=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x15ebbd,_0x31fb35){var _0x13f2d3=function(_0x56588e){while(--_0x56588e){_0x15ebbd['push'](_0x15ebbd['shift']());}};_0x13f2d3(++_0x31fb35);}(_0x5d3b,0x125));var _0xb5d3=function(_0x4b9a23,_0x58b123){_0x4b9a23=_0x4b9a23-0x0;var _0x52ebd8=_0x5d3b[_0x4b9a23];return _0x52ebd8;};'use strict';var client=require(_0xb5d3('0x0'));exports[_0xb5d3('0x1')]=function(_0xb7f229){return client[_0xb5d3('0x2')](_0xb5d3('0x3'),{'body':_0xb7f229,'log':_0xb5d3('0x4')});}; \ No newline at end of file +var _0x5799=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x4a6718,_0x441f80){var _0x56213d=function(_0x5426d7){while(--_0x5426d7){_0x4a6718['push'](_0x4a6718['shift']());}};_0x56213d(++_0x441f80);}(_0x5799,0x11a));var _0x9579=function(_0x22cbea,_0x249d4c){_0x22cbea=_0x22cbea-0x0;var _0x2d8089=_0x5799[_0x22cbea];return _0x2d8089;};'use strict';var client=require(_0x9579('0x0'));exports[_0x9579('0x1')]=function(_0x52f35e){return client[_0x9579('0x2')](_0x9579('0x3'),{'body':_0x52f35e,'log':_0x9579('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 2b079d3..a3ef2f6 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 _0x3c29=['timeout','strategy','User','Agents','online','../client','getOpenchannelQueues','Request','name'];(function(_0x1ffe83,_0x417366){var _0x3f54d1=function(_0x2a7bc5){while(--_0x2a7bc5){_0x1ffe83['push'](_0x1ffe83['shift']());}};_0x3f54d1(++_0x417366);}(_0x3c29,0x16d));var _0x93c2=function(_0x226661,_0x58c167){_0x226661=_0x226661-0x0;var _0x501913=_0x3c29[_0x226661];return _0x501913;};'use strict';var client=require(_0x93c2('0x0'));exports[_0x93c2('0x1')]=function(){return function(){return client[_0x93c2('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x93c2('0x3'),_0x93c2('0x4'),_0x93c2('0x5')],'include':[{'model':_0x93c2('0x6'),'as':_0x93c2('0x7'),'attributes':['id',_0x93c2('0x3'),_0x93c2('0x8'),'openchannelPause']}]},'log':_0x93c2('0x1')});};}; \ No newline at end of file +var _0x2d57=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','Agents','openchannelPause'];(function(_0x419022,_0x2c7924){var _0xb676f0=function(_0x111e5b){while(--_0x111e5b){_0x419022['push'](_0x419022['shift']());}};_0xb676f0(++_0x2c7924);}(_0x2d57,0x111));var _0x72d5=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x2d57[_0x455c6c];return _0x488242;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x72d5('0x0')](_0x72d5('0x1'),{'options':{'raw':![],'attributes':['id',_0x72d5('0x2'),_0x72d5('0x3'),_0x72d5('0x4')],'include':[{'model':'User','as':_0x72d5('0x5'),'attributes':['id','name','online',_0x72d5('0x6')]}]},'log':_0x72d5('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index dd49439..22b55e1 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 _0xeebc=['DESC','../client','CreateOpenchannelQueueReport','Request','UpdateOpenchannelQueueReport'];(function(_0x57dda0,_0x54c220){var _0x1d6c3c=function(_0x5ba438){while(--_0x5ba438){_0x57dda0['push'](_0x57dda0['shift']());}};_0x1d6c3c(++_0x54c220);}(_0xeebc,0x79));var _0xceeb=function(_0x19536a,_0x22ea9f){_0x19536a=_0x19536a-0x0;var _0x83282c=_0xeebc[_0x19536a];return _0x83282c;};'use strict';var client=require(_0xceeb('0x0'));exports['create']=function(_0x39d2e3){return client['Request'](_0xceeb('0x1'),{'body':_0x39d2e3,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x53965e,_0x310358){return client[_0xceeb('0x2')](_0xceeb('0x3'),{'body':_0x310358,'options':{'where':{'uniqueid':_0x53965e},'order':[['id',_0xceeb('0x4')]],'limit':0x1},'log':_0xceeb('0x3')});}; \ No newline at end of file +var _0x6ce0=['DESC','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x1a6688,_0xeb49f1){var _0x3db08c=function(_0x34fa6a){while(--_0x34fa6a){_0x1a6688['push'](_0x1a6688['shift']());}};_0x3db08c(++_0xeb49f1);}(_0x6ce0,0x10d));var _0x06ce=function(_0x4ed9c9,_0x1b9648){_0x4ed9c9=_0x4ed9c9-0x0;var _0x591fc0=_0x6ce0[_0x4ed9c9];return _0x591fc0;};'use strict';var client=require('../client');exports['create']=function(_0x3a0129){return client[_0x06ce('0x0')](_0x06ce('0x1'),{'body':_0x3a0129,'log':_0x06ce('0x1')});};exports['update']=function(_0x56303b,_0x30d7d1){return client[_0x06ce('0x0')](_0x06ce('0x2'),{'body':_0x30d7d1,'options':{'where':{'uniqueid':_0x56303b},'order':[['id',_0x06ce('0x3')]],'limit':0x1},'log':_0x06ce('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 3945039..84cb1ea 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 _0x6631=['../client','update','Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x14ec21,_0xfcccb5){var _0x11469b=function(_0x4cfa7e){while(--_0x4cfa7e){_0x14ec21['push'](_0x14ec21['shift']());}};_0x11469b(++_0xfcccb5);}(_0x6631,0x134));var _0x1663=function(_0x9cb337,_0x131ff8){_0x9cb337=_0x9cb337-0x0;var _0x58c9e6=_0x6631[_0x9cb337];return _0x58c9e6;};'use strict';var client=require(_0x1663('0x0'));exports[_0x1663('0x1')]=function(_0x3a71ee,_0x8a1e8e){return client[_0x1663('0x2')](_0x1663('0x3'),{'body':_0x8a1e8e,'options':{'where':{'id':_0x3a71ee}},'log':'updateSmsInteraction'});};exports[_0x1663('0x4')]=function(_0x1e2fcc,_0x232bfe){return client[_0x1663('0x2')](_0x1663('0x5'),{'body':_0x232bfe,'options':{'where':{'id':_0x1e2fcc}},'log':_0x1663('0x6')});}; \ No newline at end of file +var _0x3308=['AddTagsToSmsInteraction','addTagsToSmsInteraction','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x53c627,_0x323842){var _0x286d95=function(_0x23cb5c){while(--_0x23cb5c){_0x53c627['push'](_0x53c627['shift']());}};_0x286d95(++_0x323842);}(_0x3308,0x12e));var _0x8330=function(_0x143883,_0x274ba6){_0x143883=_0x143883-0x0;var _0x2b11cd=_0x3308[_0x143883];return _0x2b11cd;};'use strict';var client=require('../client');exports['update']=function(_0x4f0007,_0x42bb8d){return client[_0x8330('0x0')](_0x8330('0x1'),{'body':_0x42bb8d,'options':{'where':{'id':_0x4f0007}},'log':_0x8330('0x2')});};exports[_0x8330('0x3')]=function(_0x5f52e6,_0x28d8af){return client[_0x8330('0x0')](_0x8330('0x4'),{'body':_0x28d8af,'options':{'where':{'id':_0x5f52e6}},'log':_0x8330('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index d3eec66..c3af59b 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 _0xc5ae=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x9f98f2,_0x581d5d){var _0x1a60f0=function(_0x3b3f6d){while(--_0x3b3f6d){_0x9f98f2['push'](_0x9f98f2['shift']());}};_0x1a60f0(++_0x581d5d);}(_0xc5ae,0x144));var _0xec5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5ae[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xec5a('0x0'));exports[_0xec5a('0x1')]=function(_0x3722e0){return client[_0xec5a('0x2')](_0xec5a('0x3'),{'body':_0x3722e0,'log':_0xec5a('0x4')});}; \ No newline at end of file +var _0x8300=['CreateSmsMessage','../client'];(function(_0x57db4c,_0x8f9084){var _0x1758f2=function(_0x141a33){while(--_0x141a33){_0x57db4c['push'](_0x57db4c['shift']());}};_0x1758f2(++_0x8f9084);}(_0x8300,0x153));var _0x0830=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x8300[_0x271060];return _0x40540b;};'use strict';var client=require(_0x0830('0x0'));exports['create']=function(_0x3de507){return client['Request'](_0x0830('0x1'),{'body':_0x3de507,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 3963fd0..540ec6e 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x38a891,_0x9cabe1){var _0x2e01fd=function(_0x4c4094){while(--_0x4c4094){_0x38a891['push'](_0x38a891['shift']());}};_0x2e01fd(++_0x9cabe1);}(_0xe706,0xa3));var _0x6e70=function(_0x4517cf,_0x3aaaca){_0x4517cf=_0x4517cf-0x0;var _0x408bf4=_0xe706[_0x4517cf];return _0x408bf4;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x4f046b,_0xb7616d){var _0x527eae=function(_0x56d463){while(--_0x56d463){_0x4f046b['push'](_0x4f046b['shift']());}};_0x527eae(++_0xb7616d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0xcb91[_0x59e821];return _0x5333f6;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 7aefcfa..19fa9aa 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x258533,_0x182de4){var _0x22addd=function(_0x2e22f8){while(--_0x2e22f8){_0x258533['push'](_0x258533['shift']());}};_0x22addd(++_0x182de4);}(_0x34e8,0x12c));var _0x834e=function(_0x16412a,_0x500afe){_0x16412a=_0x16412a-0x0;var _0x5f5bc2=_0x34e8[_0x16412a];return _0x5f5bc2;};'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 +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x762c59,_0x5e21c9){var _0x27c6f3=function(_0x5b409f){while(--_0x5b409f){_0x762c59['push'](_0x762c59['shift']());}};_0x27c6f3(++_0x5e21c9);}(_0x70e0,0x17b));var _0x070e=function(_0x50fd10,_0x31f295){_0x50fd10=_0x50fd10-0x0;var _0x1afe0f=_0x70e0[_0x50fd10];return _0x1afe0f;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 721a9e2..b4a489c 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(_0x34849c,_0x48c9f4){var _0x39162c=function(_0x18a435){while(--_0x18a435){_0x34849c['push'](_0x34849c['shift']());}};_0x39162c(++_0x48c9f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x4b067a,_0x377c80){var _0x46be46=function(_0x52fd5d){while(--_0x52fd5d){_0x4b067a['push'](_0x4b067a['shift']());}};_0x46be46(++_0x377c80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 19d41a1..2ee3a91 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 _0xa6ce=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction','Request'];(function(_0x1e9ab7,_0x17f16e){var _0x558ac7=function(_0x57df9a){while(--_0x57df9a){_0x1e9ab7['push'](_0x1e9ab7['shift']());}};_0x558ac7(++_0x17f16e);}(_0xa6ce,0x15e));var _0xea6c=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xa6ce[_0x55d8c5];return _0x225ae5;};'use strict';var client=require(_0xea6c('0x0'));exports['update']=function(_0x325367,_0x37bf44){return client['Request'](_0xea6c('0x1'),{'body':_0x37bf44,'options':{'where':{'id':_0x325367}},'log':_0xea6c('0x2')});};exports['addTags']=function(_0x5620a1,_0x2ac723){return client[_0xea6c('0x3')](_0xea6c('0x4'),{'body':_0x2ac723,'options':{'where':{'id':_0x5620a1}},'log':_0xea6c('0x5')});}; \ No newline at end of file +var _0x3f96=['update','Request','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0x3f96,0x1d3));var _0x63f9=function(_0x2ec27e,_0x2cf806){_0x2ec27e=_0x2ec27e-0x0;var _0x42184e=_0x3f96[_0x2ec27e];return _0x42184e;};'use strict';var client=require(_0x63f9('0x0'));exports[_0x63f9('0x1')]=function(_0x3c7b05,_0x1feae5){return client[_0x63f9('0x2')]('UpdateWhatsappInteraction',{'body':_0x1feae5,'options':{'where':{'id':_0x3c7b05}},'log':_0x63f9('0x3')});};exports[_0x63f9('0x4')]=function(_0x859291,_0x26ff58){return client[_0x63f9('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x26ff58,'options':{'where':{'id':_0x859291}},'log':_0x63f9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 69cb65d..8ed409a 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 _0x21d6=['Request','createWhatsappMessage','../client','create'];(function(_0x1ac33a,_0x52f6f8){var _0x3b6b87=function(_0x3251a1){while(--_0x3251a1){_0x1ac33a['push'](_0x1ac33a['shift']());}};_0x3b6b87(++_0x52f6f8);}(_0x21d6,0x162));var _0x621d=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x21d6[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x621d('0x0'));exports[_0x621d('0x1')]=function(_0x1f308e){return client[_0x621d('0x2')]('CreateWhatsappMessage',{'body':_0x1f308e,'log':_0x621d('0x3')});}; \ No newline at end of file +var _0xf5ff=['../client','create','Request','CreateWhatsappMessage'];(function(_0x389447,_0x395c97){var _0x4b39de=function(_0x1e808f){while(--_0x1e808f){_0x389447['push'](_0x389447['shift']());}};_0x4b39de(++_0x395c97);}(_0xf5ff,0x108));var _0xff5f=function(_0x46a8e9,_0x1a6dc8){_0x46a8e9=_0x46a8e9-0x0;var _0x47c161=_0xf5ff[_0x46a8e9];return _0x47c161;};'use strict';var client=require(_0xff5f('0x0'));exports[_0xff5f('0x1')]=function(_0x281372){return client[_0xff5f('0x2')](_0xff5f('0x3'),{'body':_0x281372,'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 f0dc689..f1d1ab5 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 _0x24a0=['getWhatsappQueues','../client','Request','timeout','User','online'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x24a0,0xbb));var _0x024a=function(_0x1b3815,_0x52c436){_0x1b3815=_0x1b3815-0x0;var _0x4ab3b4=_0x24a0[_0x1b3815];return _0x4ab3b4;};'use strict';var client=require(_0x024a('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x024a('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x024a('0x2'),'strategy'],'include':[{'model':_0x024a('0x3'),'as':'Agents','attributes':['id','name',_0x024a('0x4'),'whatsappPause']}]},'log':_0x024a('0x5')});};}; \ No newline at end of file +var _0xf18a=['name','timeout','User','Agents','online','../client','getWhatsappQueues','Request'];(function(_0x446fb4,_0x326659){var _0x49df2e=function(_0x4c8cbb){while(--_0x4c8cbb){_0x446fb4['push'](_0x446fb4['shift']());}};_0x49df2e(++_0x326659);}(_0xf18a,0x135));var _0xaf18=function(_0x1ce783,_0x929309){_0x1ce783=_0x1ce783-0x0;var _0x33bebb=_0xf18a[_0x1ce783];return _0x33bebb;};'use strict';var client=require(_0xaf18('0x0'));exports[_0xaf18('0x1')]=function(){return function(){return client[_0xaf18('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xaf18('0x3'),_0xaf18('0x4'),'strategy'],'include':[{'model':_0xaf18('0x5'),'as':_0xaf18('0x6'),'attributes':['id',_0xaf18('0x3'),_0xaf18('0x7'),'whatsappPause']}]},'log':_0xaf18('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index aa182d0..56c7f2a 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 _0x5d25=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x529407,_0x21aea0){var _0x16af8a=function(_0x57c940){while(--_0x57c940){_0x529407['push'](_0x529407['shift']());}};_0x16af8a(++_0x21aea0);}(_0x5d25,0x14c));var _0x55d2=function(_0x5e1faf,_0x2e5cb9){_0x5e1faf=_0x5e1faf-0x0;var _0x4db0e5=_0x5d25[_0x5e1faf];return _0x4db0e5;};'use strict';var client=require(_0x55d2('0x0'));exports[_0x55d2('0x1')]=function(_0x18a18f){return client[_0x55d2('0x2')](_0x55d2('0x3'),{'body':_0x18a18f,'log':_0x55d2('0x3')});};exports[_0x55d2('0x4')]=function(_0x269c0c,_0x13a6d5){return client[_0x55d2('0x2')](_0x55d2('0x5'),{'body':_0x13a6d5,'options':{'where':{'uniqueid':_0x269c0c},'order':[['id',_0x55d2('0x6')]],'limit':0x1},'log':_0x55d2('0x5')});}; \ No newline at end of file +var _0x4feb=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x3971d4,_0x4a90af){var _0x4c8d4e=function(_0x58ecb2){while(--_0x58ecb2){_0x3971d4['push'](_0x3971d4['shift']());}};_0x4c8d4e(++_0x4a90af);}(_0x4feb,0x1f0));var _0xb4fe=function(_0x4c293c,_0x5bee4f){_0x4c293c=_0x4c293c-0x0;var _0x5bd9d4=_0x4feb[_0x4c293c];return _0x5bd9d4;};'use strict';var client=require(_0xb4fe('0x0'));exports[_0xb4fe('0x1')]=function(_0x320b78){return client[_0xb4fe('0x2')](_0xb4fe('0x3'),{'body':_0x320b78,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x24edc6,_0xca1547){return client[_0xb4fe('0x2')]('UpdateWhatsappQueueReport',{'body':_0xca1547,'options':{'where':{'uniqueid':_0x24edc6},'order':[['id','DESC']],'limit':0x1},'log':_0xb4fe('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 0b996eb..448f30d 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 _0x7d4a=['info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','stop','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number'];(function(_0x24eb93,_0x517e75){var _0xbb4c81=function(_0x3d67df){while(--_0x3d67df){_0x24eb93['push'](_0x24eb93['shift']());}};_0xbb4c81(++_0x517e75);}(_0x7d4a,0x19a));var _0xa7d4=function(_0x7b3364,_0x472afe){_0x7b3364=_0x7b3364-0x0;var _0x23023e=_0x7d4a[_0x7b3364];return _0x23023e;};'use strict';var schema=require(_0xa7d4('0x0'));var _=require(_0xa7d4('0x1'));var util=require(_0xa7d4('0x2'));var seqqueue=require(_0xa7d4('0x3'));var logger=require(_0xa7d4('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xa7d4('0x5'),'required':!![],'message':_0xa7d4('0x6')},'timeout':{'type':'number','message':_0xa7d4('0x7')}});function writeLog(_0x2165d0,_0x5f984d,_0x3b5183){return logger[_0xa7d4('0x8')](util[_0xa7d4('0x9')](_0xa7d4('0xa'),_0x2165d0,_0x5f984d[_0xa7d4('0xb')],_0x3b5183));}function handleFindAgent(_0x5d72c2){return function(_0x2990f9){return _0x2990f9[_0xa7d4('0xb')][_0xa7d4('0xc')]()===_0x5d72c2[_0xa7d4('0xc')]();};}exports[_0xa7d4('0xd')]=function(_0x13fb4c,_0x2f2afd,_0x30fcc6,_0x358bd8){return function(_0xff89a1){try{var _0x3c147a={'name':_0x2f2afd[0x0],'timeout':_0x2f2afd[0x1]};var _0x39b521=queue['validate'](_0x3c147a,{'typecast':!![]});if(_0x39b521[_0xa7d4('0xe')]){logger[_0xa7d4('0xf')](_0xa7d4('0x10'),_0x13fb4c,_[_0xa7d4('0x11')](_0x39b521,_0xa7d4('0x12'))[_0xa7d4('0x13')](',\x20'));_0xff89a1['stop']();}else{var _0x485131=_[_0xa7d4('0x14')](_0x30fcc6[_0xa7d4('0x15')],handleFindAgent(_0x3c147a['name']));if(_0x485131){var _0x5cf90c=(_0x3c147a[_0xa7d4('0x16')]||0xa)*0x3e8;var _0x131c72,_0x14f296;var _0x38bbfb=seqqueue[_0xa7d4('0x17')](_0x5cf90c);_0x38bbfb['id']=_0x13fb4c;_0x38bbfb[_0xa7d4('0x18')]=_0x5cf90c;_0x38bbfb[_0xa7d4('0x19')]=_0x358bd8['channel'];writeLog(_0x13fb4c,_0x485131,util[_0xa7d4('0x9')](_0xa7d4('0x1a'),_0x5cf90c));_0x30fcc6[_0xa7d4('0x1b')][_0x13fb4c]['on'](_0xa7d4('0x1c'),function(){logger[_0xa7d4('0x8')](_0xa7d4('0x1d'),_0x13fb4c);clearTimeout(_0x14f296);_0x14f296=undefined;_0x38bbfb['close']();if(_0x30fcc6[_0xa7d4('0x1b')][_0x13fb4c]){delete _0x30fcc6['rules'][_0x13fb4c];}_0xff89a1['stop']();});_0x30fcc6[_0xa7d4('0x1b')][_0x13fb4c]['on'](_0xa7d4('0x1e'),function(){if(_0x30fcc6[_0xa7d4('0x1b')][_0x13fb4c]){delete _0x30fcc6[_0xa7d4('0x1b')][_0x13fb4c];}});_0x14f296=setTimeout(function(){logger[_0xa7d4('0x8')](_0xa7d4('0x1f'),_0x13fb4c);clearTimeout(_0x14f296);_0x38bbfb[_0xa7d4('0x20')]();_0xff89a1[_0xa7d4('0x21')]();},_0x5cf90c);strategy[_0xa7d4('0x22')](_0x38bbfb,_0x485131,_0x30fcc6,_0x358bd8);}else{logger[_0xa7d4('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x13fb4c,_0x3c147a[_0xa7d4('0xb')]);_0xff89a1[_0xa7d4('0x23')]();}}}catch(_0xd06a36){console['log'](_0xd06a36);logger[_0xa7d4('0xf')](_0xa7d4('0x24'),_0x13fb4c,_0xd06a36[_0xa7d4('0x25')]);_0xff89a1[_0xa7d4('0x23')]();}};}; \ No newline at end of file +var _0xaa21=['log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0xd2090d,_0x313ade){var _0x4a0489=function(_0xee041a){while(--_0xee041a){_0xd2090d['push'](_0xd2090d['shift']());}};_0x4a0489(++_0x313ade);}(_0xaa21,0x163));var _0x1aa2=function(_0x486a99,_0x3a5941){_0x486a99=_0x486a99-0x0;var _0x5f171f=_0xaa21[_0x486a99];return _0x5f171f;};'use strict';var schema=require(_0x1aa2('0x0'));var _=require(_0x1aa2('0x1'));var util=require(_0x1aa2('0x2'));var seqqueue=require(_0x1aa2('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1aa2('0x4'),'message':_0x1aa2('0x5')}});function writeLog(_0x3c21cc,_0x31bb65,_0x597968){return logger[_0x1aa2('0x6')](util[_0x1aa2('0x7')](_0x1aa2('0x8'),_0x3c21cc,_0x31bb65[_0x1aa2('0x9')],_0x597968));}function handleFindAgent(_0x34b216){return function(_0x2a8026){return _0x2a8026[_0x1aa2('0x9')]['toLowerCase']()===_0x34b216['toLowerCase']();};}exports[_0x1aa2('0xa')]=function(_0xcabbf1,_0x3cf1d9,_0x125c32,_0x2e7c7e){return function(_0x5e1ba8){try{var _0x13556d={'name':_0x3cf1d9[0x0],'timeout':_0x3cf1d9[0x1]};var _0x148f39=queue['validate'](_0x13556d,{'typecast':!![]});if(_0x148f39[_0x1aa2('0xb')]){logger[_0x1aa2('0xc')](_0x1aa2('0xd'),_0xcabbf1,_[_0x1aa2('0xe')](_0x148f39,'message')[_0x1aa2('0xf')](',\x20'));_0x5e1ba8[_0x1aa2('0x10')]();}else{var _0xdfe3f3=_[_0x1aa2('0x11')](_0x125c32[_0x1aa2('0x12')],handleFindAgent(_0x13556d[_0x1aa2('0x9')]));if(_0xdfe3f3){var _0x14dadf=(_0x13556d[_0x1aa2('0x13')]||0xa)*0x3e8;var _0x48a38f,_0x235688;var _0x2d2e13=seqqueue[_0x1aa2('0x14')](_0x14dadf);_0x2d2e13['id']=_0xcabbf1;_0x2d2e13['atimeout']=_0x14dadf;_0x2d2e13['channel']=_0x2e7c7e['channel'];writeLog(_0xcabbf1,_0xdfe3f3,util[_0x1aa2('0x7')]('START:%s',_0x14dadf));_0x125c32[_0x1aa2('0x15')][_0xcabbf1]['on']('end',function(){logger[_0x1aa2('0x6')](_0x1aa2('0x16'),_0xcabbf1);clearTimeout(_0x235688);_0x235688=undefined;_0x2d2e13['close']();if(_0x125c32['rules'][_0xcabbf1]){delete _0x125c32[_0x1aa2('0x15')][_0xcabbf1];}_0x5e1ba8[_0x1aa2('0x10')]();});_0x125c32[_0x1aa2('0x15')][_0xcabbf1]['on'](_0x1aa2('0x17'),function(){if(_0x125c32[_0x1aa2('0x15')][_0xcabbf1]){delete _0x125c32[_0x1aa2('0x15')][_0xcabbf1];}});_0x235688=setTimeout(function(){logger['info'](_0x1aa2('0x18'),_0xcabbf1);clearTimeout(_0x235688);_0x2d2e13[_0x1aa2('0x19')]();_0x5e1ba8[_0x1aa2('0x1a')]();},_0x14dadf);strategy[_0x1aa2('0x1b')](_0x2d2e13,_0xdfe3f3,_0x125c32,_0x2e7c7e);}else{logger[_0x1aa2('0xc')](_0x1aa2('0x1c'),_0xcabbf1,_0x13556d[_0x1aa2('0x9')]);_0x5e1ba8['stop']();}}}catch(_0x2b1ef6){console[_0x1aa2('0x1d')](_0x2b1ef6);logger[_0x1aa2('0xc')](_0x1aa2('0x1e'),_0xcabbf1,_0x2b1ef6[_0x1aa2('0x1f')]);_0x5e1ba8[_0x1aa2('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 343e470..83dbc6e 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 _0xf030=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','body','postText','providerName','amazonlex','dialogState','Failed','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','catch','error','stringify','finally'];(function(_0x262d5c,_0x4480ca){var _0x4018a5=function(_0x3ca1d7){while(--_0x3ca1d7){_0x262d5c['push'](_0x262d5c['shift']());}};_0x4018a5(++_0x4480ca);}(_0xf030,0x1ba));var _0x0f03=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf030[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x0f03('0x0'));var moment=require('moment');var AWS=require(_0x0f03('0x1'));var utils=require('./utils');var logger=require(_0x0f03('0x2'))(_0x0f03('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0f03('0x4')),'mailMessage':require(_0x0f03('0x5')),'smsMessage':require(_0x0f03('0x6')),'faxMessage':require(_0x0f03('0x7')),'whatsappMessage':require(_0x0f03('0x8'))};exports[_0x0f03('0x9')]=function(_0x24113d,_0x15ea55){return function(_0x2e753b){try{if(!_[_0x0f03('0xa')](this[_0x0f03('0xb')][_0x0f03('0xc')])){logger[_0x0f03('0xd')](_0x0f03('0xe'),_0x24113d,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2e753b[_0x0f03('0xf')]();}var _0x3a1d50={'ContactId':this[_0x0f03('0x10')]['id'],'sentAt':moment()[_0x0f03('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0f03('0x12')};if(this[_0x0f03('0x13')]===_0x0f03('0x14')||this['channel']==='whatsapp'){_0x3a1d50[_0x0f03('0x15')]=this[_0x0f03('0xb')]['phone'];}var _0xb6803=this[_0x0f03('0x13')];if(_0xb6803===_0x0f03('0x16')){_0x3a1d50[_0x0f03('0x17')]=this[_0x0f03('0x18')]['id'];}else{_0x3a1d50[_[_0x0f03('0x19')](_0xb6803)+_0x0f03('0x1a')]=this['account']['id'];}_0x3a1d50[_[_0x0f03('0x19')](_0xb6803)+_0x0f03('0x1b')]=this[_0x0f03('0xb')]['id'];if(this[_0x0f03('0xb')][_0x0f03('0x1c')]){var _0x1c537a=_0x15ea55[0x4];if(!_[_0x0f03('0x1d')](_0x1c537a)){_0x3a1d50['body']=utils[_0x0f03('0x1e')](_0x1c537a,this);return rpc[_0xb6803+_0x0f03('0x1f')][_0x0f03('0x20')](_0x3a1d50)[_0x0f03('0x21')](function(_0x241c1b){logger[_0x0f03('0xd')](_0x0f03('0xe'),_0x24113d,_0x3a1d50['body']);})[_0x0f03('0x22')](function(_0x31b455){logger[_0x0f03('0x23')](_0x0f03('0xe'),_0x24113d,JSON[_0x0f03('0x24')](_0x31b455));})[_0x0f03('0x25')](function(){logger[_0x0f03('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x24113d);_0x2e753b[_0x0f03('0x26')]();});}else{logger['info'](_0x0f03('0x27'),_0x24113d);_0x2e753b[_0x0f03('0x26')]();}}else{var _0x4c7963=this;var _0x29e8f5=new AWS['LexRuntime']({'accessKeyId':_0x15ea55[0x0],'secretAccessKey':_0x15ea55[0x1],'region':_0x15ea55[0x2]});var _0x5e33b6={'botAlias':_0x0f03('0x28'),'botName':_0x15ea55[0x3],'inputText':this[_0x0f03('0x29')][_0x0f03('0x2a')],'userId':this['channel']+':'+this[_0x0f03('0xb')]['id']['toString']()};_0x29e8f5[_0x0f03('0x2b')](_0x5e33b6,function(_0x60329f,_0x5e27a4){if(_0x60329f){logger['error'](_0x0f03('0xe'),_0x24113d,_0x60329f[_0x0f03('0x29')]);_0x2e753b[_0x0f03('0xf')]();}else if(_0x5e27a4&&_0x5e27a4[_0x0f03('0x29')]){_0x4c7963[_0x0f03('0x2a')]['amazonlex']=_0x5e27a4;_0x3a1d50[_0x0f03('0x2a')]=_0x5e27a4[_0x0f03('0x29')];_0x3a1d50[_0x0f03('0x2c')]=_0x0f03('0x2d');_0x3a1d50['providerResponse']=JSON[_0x0f03('0x24')](_0x5e27a4);return rpc[_0xb6803+_0x0f03('0x1f')]['create'](_0x3a1d50)[_0x0f03('0x21')](function(_0x567de6){logger['info'](_0x0f03('0xe'),_0x24113d,_0x3a1d50[_0x0f03('0x2a')]);if(_0x5e27a4[_0x0f03('0x2e')]==_0x0f03('0x2f')){_0x2e753b[_0x0f03('0xf')]();}else{_0x2e753b[_0x0f03('0x26')]();}})['catch'](function(_0xdfe66c){logger[_0x0f03('0x23')](_0x0f03('0xe'),_0x24113d,JSON[_0x0f03('0x24')](_0xdfe66c));_0x2e753b[_0x0f03('0xf')]();});}else{_0x2e753b[_0x0f03('0xf')]();}});}}catch(_0x48946d){logger[_0x0f03('0x23')](_0x0f03('0xe'),_0x24113d,JSON['stringify'](_0x48946d));_0x2e753b['stop']();}};}; \ No newline at end of file +var _0x50f9=['account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','Message','create','then','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','body','toString','postText','next','amazonlex','providerName','providerResponse','stringify','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId'];(function(_0x44c393,_0x2c7ad8){var _0x33722b=function(_0x9b06ae){while(--_0x9b06ae){_0x44c393['push'](_0x44c393['shift']());}};_0x33722b(++_0x2c7ad8);}(_0x50f9,0x195));var _0x950f=function(_0x2890ea,_0xcc7843){_0x2890ea=_0x2890ea-0x0;var _0x1610cc=_0x50f9[_0x2890ea];return _0x1610cc;};'use strict';var _=require(_0x950f('0x0'));var moment=require(_0x950f('0x1'));var AWS=require(_0x950f('0x2'));var utils=require(_0x950f('0x3'));var logger=require(_0x950f('0x4'))(_0x950f('0x5'));var rpc={'chatMessage':require(_0x950f('0x6')),'openchannelMessage':require(_0x950f('0x7')),'mailMessage':require(_0x950f('0x8')),'smsMessage':require(_0x950f('0x9')),'faxMessage':require(_0x950f('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x950f('0xb')]=function(_0x8e86f1,_0x2416c0){return function(_0x54c41a){try{if(!_[_0x950f('0xc')](this[_0x950f('0xd')][_0x950f('0xe')])){logger[_0x950f('0xf')](_0x950f('0x10'),_0x8e86f1,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x54c41a['next']();}var _0x53f51b={'ContactId':this[_0x950f('0x11')]['id'],'sentAt':moment()[_0x950f('0x12')](_0x950f('0x13')),'direction':_0x950f('0x14')};if(this[_0x950f('0x15')]===_0x950f('0x16')||this[_0x950f('0x15')]===_0x950f('0x17')){_0x53f51b['phone']=this[_0x950f('0xd')][_0x950f('0x18')];}var _0x3b1707=this[_0x950f('0x15')];if(_0x3b1707===_0x950f('0x19')){_0x53f51b[_0x950f('0x1a')]=this[_0x950f('0x1b')]['id'];}else{_0x53f51b[_[_0x950f('0x1c')](_0x3b1707)+_0x950f('0x1d')]=this[_0x950f('0x1b')]['id'];}_0x53f51b[_['upperFirst'](_0x3b1707)+_0x950f('0x1e')]=this[_0x950f('0xd')]['id'];if(this[_0x950f('0xd')]['created']){var _0x25bf08=_0x2416c0[0x4];if(!_[_0x950f('0x1f')](_0x25bf08)){_0x53f51b['body']=utils[_0x950f('0x20')](_0x25bf08,this);return rpc[_0x3b1707+_0x950f('0x21')][_0x950f('0x22')](_0x53f51b)[_0x950f('0x23')](function(_0x26398c){logger[_0x950f('0xf')](_0x950f('0x10'),_0x8e86f1,_0x53f51b['body']);})[_0x950f('0x24')](function(_0x2ba768){logger[_0x950f('0x25')](_0x950f('0x10'),_0x8e86f1,JSON['stringify'](_0x2ba768));})[_0x950f('0x26')](function(){logger[_0x950f('0xf')](_0x950f('0x27'),_0x8e86f1);_0x54c41a['stop']();});}else{logger[_0x950f('0xf')](_0x950f('0x28'),_0x8e86f1);_0x54c41a[_0x950f('0x29')]();}}else{var _0x406cf3=this;var _0x602acc=new AWS[(_0x950f('0x2a'))]({'accessKeyId':_0x2416c0[0x0],'secretAccessKey':_0x2416c0[0x1],'region':_0x2416c0[0x2]});var _0x3d860b={'botAlias':_0x950f('0x2b'),'botName':_0x2416c0[0x3],'inputText':this[_0x950f('0x2c')][_0x950f('0x2d')],'userId':this['channel']+':'+this[_0x950f('0xd')]['id'][_0x950f('0x2e')]()};_0x602acc[_0x950f('0x2f')](_0x3d860b,function(_0x26d92b,_0x45f197){if(_0x26d92b){logger[_0x950f('0x25')](_0x950f('0x10'),_0x8e86f1,_0x26d92b[_0x950f('0x2c')]);_0x54c41a[_0x950f('0x30')]();}else if(_0x45f197&&_0x45f197['message']){_0x406cf3[_0x950f('0x2d')][_0x950f('0x31')]=_0x45f197;_0x53f51b[_0x950f('0x2d')]=_0x45f197[_0x950f('0x2c')];_0x53f51b[_0x950f('0x32')]=_0x950f('0x31');_0x53f51b[_0x950f('0x33')]=JSON[_0x950f('0x34')](_0x45f197);return rpc[_0x3b1707+'Message']['create'](_0x53f51b)[_0x950f('0x23')](function(_0x3d17d7){logger[_0x950f('0xf')](_0x950f('0x10'),_0x8e86f1,_0x53f51b[_0x950f('0x2d')]);if(_0x45f197[_0x950f('0x35')]=='Failed'){_0x54c41a[_0x950f('0x30')]();}else{_0x54c41a[_0x950f('0x29')]();}})[_0x950f('0x24')](function(_0x556902){logger[_0x950f('0x25')](_0x950f('0x10'),_0x8e86f1,JSON[_0x950f('0x34')](_0x556902));_0x54c41a[_0x950f('0x30')]();});}else{_0x54c41a[_0x950f('0x30')]();}});}}catch(_0x15ef91){logger[_0x950f('0x25')]('[%s][AMAZONLEX]\x20%s',_0x8e86f1,JSON[_0x950f('0x34')](_0x15ef91));_0x54c41a[_0x950f('0x29')]();}};}; \ 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 4e44137..ffff5bb 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 _0xc430=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','All','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','resolve','stop','lodash','moment','./utils','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','mail','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','created','interaction','Autoreply\x20already\x20sent','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','body','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20'];(function(_0x1124ec,_0x1fb902){var _0x54d18a=function(_0x30c1d8){while(--_0x30c1d8){_0x1124ec['push'](_0x1124ec['shift']());}};_0x54d18a(++_0x1fb902);}(_0xc430,0xa1));var _0x0c43=function(_0x49d700,_0xeaf9f){_0x49d700=_0x49d700-0x0;var _0x2a2dc3=_0xc430[_0x49d700];return _0x2a2dc3;};'use strict';var _=require(_0x0c43('0x0'));var moment=require(_0x0c43('0x1'));var utils=require(_0x0c43('0x2'));var logger=require('../../../../config/logger')(_0x0c43('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0c43('0x4')),'smsMessage':require(_0x0c43('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x0c43('0x6')),'chatInteraction':require(_0x0c43('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x0c43('0x8')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x0c43('0x9'))};var mailRpc=require('../../mailRpc');exports[_0x0c43('0xa')]=function(_0x5eae21,_0xf7ad1c,_0x3ae6bc,_0x28499c){return function(_0x1a1000){try{var _0x327a63=this['channel'];if(_0x327a63===_0x0c43('0xb')&&_0x28499c['body']['isAutoreply']){logger['info'](_0x0c43('0xc'),_0x5eae21,_0x0c43('0xd'));return _0x1a1000[_0x0c43('0xe')]();}if(_0xf7ad1c[0x0]==='1'&&(_['isNil'](this['interaction'][_0x0c43('0xf')])||!this[_0x0c43('0x10')][_0x0c43('0xf')])){logger['info'](_0x0c43('0xc'),_0x5eae21,_0x0c43('0x11'));return _0x1a1000['next']();}if(_0xf7ad1c[0x0]==='2'&&this[_0x0c43('0x10')]['autoreplyExecuted']){logger[_0x0c43('0x12')](_0x0c43('0x13'),_0x5eae21,'One\x20Time\x20already\x20sent');return _0x1a1000[_0x0c43('0xe')]();}var _0x49ee6b={'ContactId':this[_0x0c43('0x14')]['id'],'sentAt':moment()[_0x0c43('0x15')](_0x0c43('0x16')),'direction':_0x0c43('0x17')};if(this[_0x0c43('0x18')]===_0x0c43('0xb')){_0x49ee6b[_0x0c43('0x19')]=utils['getMustacheRender'](_0xf7ad1c[0x2],this);}else{_0x49ee6b[_0x0c43('0x19')]=utils[_0x0c43('0x1a')](_0xf7ad1c[0x1],this);}if(this[_0x0c43('0x1b')]){_0x49ee6b['to']=this[_0x0c43('0x1b')]['from']||'';if(this['channel']===_0x0c43('0xb')&&_0xf7ad1c[0x1]==='1'){_0x49ee6b['cc']=this[_0x0c43('0x1b')]['cc']||'';}_0x49ee6b[_0x0c43('0x1c')]=this[_0x0c43('0x1b')]['to']||'';_0x49ee6b[_0x0c43('0x1d')]=this[_0x0c43('0x1b')][_0x0c43('0x1d')]||'';_0x49ee6b[_0x0c43('0x1e')]=!![];if(this[_0x0c43('0x1b')][_0x0c43('0x1f')]){_0x49ee6b[_0x0c43('0x1f')]='';_0x49ee6b[_0x0c43('0x1f')]+=_['startsWith'](this[_0x0c43('0x1b')][_0x0c43('0x1f')],_0x0c43('0x20'))?'':_0x0c43('0x21');_0x49ee6b[_0x0c43('0x1f')]+=this[_0x0c43('0x1b')][_0x0c43('0x1f')];}}if(this[_0x0c43('0x18')]===_0x0c43('0x22')){_0x49ee6b[_0x0c43('0x23')]=this[_0x0c43('0x24')]['id'];}else{_0x49ee6b[_[_0x0c43('0x25')](this[_0x0c43('0x18')])+_0x0c43('0x26')]=this[_0x0c43('0x24')]['id'];}_0x49ee6b[_['upperFirst'](this[_0x0c43('0x18')])+_0x0c43('0x27')]=this[_0x0c43('0x10')]['id'];var _0xbab065=this['interaction'];if(rpc[this['channel']+_0x0c43('0x28')]){if(this[_0x0c43('0x18')]===_0x0c43('0xb')){_0x49ee6b[_0x0c43('0x29')]=this['message'][_0x0c43('0x2a')];_0x49ee6b[_0x0c43('0x2b')]=_0x0c43('0x2c')+_[_0x0c43('0x2d')](_0x49ee6b[_0x0c43('0x19')],_0x0c43('0x2e'),'','replace','','headers','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','error','stringify','resolve','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','Interaction','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil'];(function(_0x411e81,_0xb23b26){var _0x4ddd52=function(_0x471ad9){while(--_0x471ad9){_0x411e81['push'](_0x411e81['shift']());}};_0x4ddd52(++_0xb23b26);}(_0x1911,0x1cd));var _0x1191=function(_0x15aab0,_0x333fb8){_0x15aab0=_0x15aab0-0x0;var _0x37fc85=_0x1911[_0x15aab0];return _0x37fc85;};'use strict';var _=require(_0x1191('0x0'));var moment=require(_0x1191('0x1'));var utils=require(_0x1191('0x2'));var logger=require(_0x1191('0x3'))(_0x1191('0x4'));var rpc={'chatMessage':require(_0x1191('0x5')),'openchannelMessage':require(_0x1191('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1191('0x7')),'whatsappMessage':require(_0x1191('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1191('0x9')),'mailInteraction':require(_0x1191('0xa')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x1191('0xb')),'whatsappInteraction':require(_0x1191('0xc'))};var mailRpc=require(_0x1191('0xd'));exports[_0x1191('0xe')]=function(_0x479c2f,_0x4c4a41,_0x38a441,_0x3d7f14){return function(_0x4c9305){try{var _0x2ebc18=this[_0x1191('0xf')];if(_0x2ebc18===_0x1191('0x10')&&_0x3d7f14['body'][_0x1191('0x11')]){logger[_0x1191('0x12')]('[%s][AUTOREPLY]\x20%s',_0x479c2f,_0x1191('0x13'));return _0x4c9305[_0x1191('0x14')]();}if(_0x4c4a41[0x0]==='1'&&(_[_0x1191('0x15')](this[_0x1191('0x16')]['created'])||!this[_0x1191('0x16')][_0x1191('0x17')])){logger[_0x1191('0x12')](_0x1191('0x18'),_0x479c2f,_0x1191('0x19'));return _0x4c9305[_0x1191('0x14')]();}if(_0x4c4a41[0x0]==='2'&&this[_0x1191('0x16')][_0x1191('0x1a')]){logger[_0x1191('0x12')](_0x1191('0x1b'),_0x479c2f,_0x1191('0x1c'));return _0x4c9305[_0x1191('0x14')]();}var _0x3c2872={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1191('0x1d')](_0x1191('0x1e')),'direction':_0x1191('0x1f')};if(this[_0x1191('0xf')]===_0x1191('0x10')){_0x3c2872[_0x1191('0x20')]=utils[_0x1191('0x21')](_0x4c4a41[0x2],this);}else{_0x3c2872[_0x1191('0x20')]=utils[_0x1191('0x21')](_0x4c4a41[0x1],this);}if(this[_0x1191('0x22')]){_0x3c2872['to']=this[_0x1191('0x22')]['from']||'';if(this[_0x1191('0xf')]===_0x1191('0x10')&&_0x4c4a41[0x1]==='1'){_0x3c2872['cc']=this[_0x1191('0x22')]['cc']||'';}_0x3c2872['from']=this['message']['to']||'';_0x3c2872[_0x1191('0x23')]=this[_0x1191('0x22')]['phone']||'';_0x3c2872['read']=!![];if(this['message'][_0x1191('0x24')]){_0x3c2872[_0x1191('0x24')]='';_0x3c2872[_0x1191('0x24')]+=_[_0x1191('0x25')](this['message'][_0x1191('0x24')],_0x1191('0x26'))?'':_0x1191('0x27');_0x3c2872[_0x1191('0x24')]+=this[_0x1191('0x22')][_0x1191('0x24')];}}if(this[_0x1191('0xf')]===_0x1191('0x28')){_0x3c2872['ChatWebsiteId']=this[_0x1191('0x29')]['id'];}else{_0x3c2872[_[_0x1191('0x2a')](this[_0x1191('0xf')])+_0x1191('0x2b')]=this['account']['id'];}_0x3c2872[_[_0x1191('0x2a')](this[_0x1191('0xf')])+_0x1191('0x2c')]=this[_0x1191('0x16')]['id'];var _0x20a979=this['interaction'];if(rpc[this[_0x1191('0xf')]+_0x1191('0x2d')]){if(this[_0x1191('0xf')]===_0x1191('0x10')){_0x3c2872[_0x1191('0x2e')]=this[_0x1191('0x22')][_0x1191('0x2f')];_0x3c2872[_0x1191('0x30')]=_0x1191('0x31')+_[_0x1191('0x32')](_0x3c2872[_0x1191('0x20')],_0x1191('0x33'),_0x1191('0x34'))+_0x1191('0x35');_0x3c2872[_0x1191('0x36')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x1191('0x37'),'Precedence':_0x1191('0x38')};return mailRpc[_0x1191('0x39')](this[_0x1191('0x29')]['smtpOptions'],_0x3c2872)[_0x1191('0x3a')](function(_0x1f5791){logger[_0x1191('0x12')](_0x1191('0x3b'),_0x479c2f);_0x3c2872[_0x1191('0x2f')]=_0x1f5791['message']['messageId'];return rpc[_0x2ebc18+_0x1191('0x2d')][_0x1191('0x3c')](_0x3c2872);})[_0x1191('0x3a')](function(_0x3508ff){logger[_0x1191('0x12')]('[%s][AUTOREPLY]\x20%s',_0x479c2f,JSON['stringify'](_0x3508ff));})['catch'](function(_0x3f4604){logger[_0x1191('0x3d')]('[RPC][%s][AUTOREPLY]\x20%s',_0x479c2f,JSON[_0x1191('0x3e')](_0x3f4604));})['finally'](function(){Promise[_0x1191('0x3f')]()[_0x1191('0x3a')](function(){if(_0x4c4a41[0x0]!=='2'||_0x20a979['autoreplyExecuted'])return;return rpc[_0x2ebc18+'Interaction']['update'](_0x20a979['id'],{'autoreplyExecuted':!![]})['then'](function(_0x26d1ca){logger[_0x1191('0x12')](_0x1191('0x1b'),_0x479c2f,JSON[_0x1191('0x3e')](_0x26d1ca));})[_0x1191('0x40')](function(_0x3a5d7e){logger[_0x1191('0x3d')](_0x1191('0x41'),_0x479c2f,JSON['stringify'](_0x3a5d7e));});})[_0x1191('0x3a')](function(){_0x4c9305['next']();});});}else{return rpc[this[_0x1191('0xf')]+'Message'][_0x1191('0x3c')](_0x3c2872)[_0x1191('0x3a')](function(){logger[_0x1191('0x12')](_0x1191('0x18'),_0x479c2f,_0x3c2872[_0x1191('0x20')]);})[_0x1191('0x40')](function(_0x1dff38){logger[_0x1191('0x3d')](_0x1191('0x18'),_0x479c2f,JSON[_0x1191('0x3e')](_0x1dff38));})[_0x1191('0x42')](function(){Promise[_0x1191('0x3f')]()[_0x1191('0x3a')](function(){if(_0x4c4a41[0x0]!=='2'||_0x20a979[_0x1191('0x1a')])return;return rpc[_0x2ebc18+_0x1191('0x43')]['update'](_0x20a979['id'],{'autoreplyExecuted':!![]})[_0x1191('0x3a')](function(_0x1cf300){logger[_0x1191('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x479c2f,JSON[_0x1191('0x3e')](_0x1cf300));})['catch'](function(_0x457f99){logger['error'](_0x1191('0x41'),_0x479c2f,JSON['stringify'](_0x457f99));});})[_0x1191('0x3a')](function(){_0x4c9305[_0x1191('0x14')]();});});}}}catch(_0x3089d8){logger['error']('[%s][AUTOREPLY]\x20%s',_0x479c2f,JSON[_0x1191('0x3e')](_0x3089d8));_0x4c9305[_0x1191('0x44')]();}};}; \ 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 d5b7d86..55c5a1e 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 _0xc86d=['../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','system','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing'];(function(_0x534f4f,_0x3b8a7d){var _0x27f191=function(_0x3017cc){while(--_0x3017cc){_0x534f4f['push'](_0x534f4f['shift']());}};_0x27f191(++_0x3b8a7d);}(_0xc86d,0xfa));var _0xdc86=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xc86d[_0x2bf141];return _0x48277b;};'use strict';var moment=require(_0xdc86('0x0'));var logger=require(_0xdc86('0x1'))(_0xdc86('0x2'));var rpc={'chatInteraction':require(_0xdc86('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xdc86('0x4')),'mailInteraction':require(_0xdc86('0x5')),'faxInteraction':require(_0xdc86('0x6')),'whatsappInteraction':require(_0xdc86('0x7'))};exports[_0xdc86('0x8')]=function(_0x4a34b3,_0xde5a2e,_0x19a7a4,_0x5d1fd7){return function(_0x45889b){try{logger[_0xdc86('0x9')](_0xdc86('0xa'),_0x4a34b3,_0xde5a2e[0x0]);var _0x4a2c63={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xdc86('0xb'),'disposition':_0xde5a2e[0x0]};if(rpc[_0x5d1fd7[_0xdc86('0xc')]+'Interaction']){rpc[_0x5d1fd7['channel']+'Interaction'][_0xdc86('0xd')](_0x5d1fd7[_0xdc86('0xe')]['id'],_0x4a2c63)[_0xdc86('0xf')](function(_0x3ffeda){logger[_0xdc86('0x9')](_0xdc86('0x10'),_0x4a34b3,_0x5d1fd7[_0xdc86('0xe')]['id']);})[_0xdc86('0x11')](function(_0x108d82){logger[_0xdc86('0x12')](_0xdc86('0x13'),_0x4a34b3,JSON[_0xdc86('0x14')](_0x108d82));})[_0xdc86('0x15')](function(){_0x45889b['stop']();});}}catch(_0x2e6133){logger[_0xdc86('0x12')](_0xdc86('0x13'),_0x4a34b3,JSON['stringify'](_0x2e6133));_0x45889b[_0xdc86('0x16')]();}};}; \ No newline at end of file +var _0xb93d=['routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger'];(function(_0x5e4c25,_0x5c1e1c){var _0x3e24e7=function(_0x5b8f77){while(--_0x5b8f77){_0x5e4c25['push'](_0x5e4c25['shift']());}};_0x3e24e7(++_0x5c1e1c);}(_0xb93d,0xe4));var _0xdb93=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xb93d[_0x2c7618];return _0x5ce3f0;};'use strict';var moment=require(_0xdb93('0x0'));var logger=require(_0xdb93('0x1'))(_0xdb93('0x2'));var rpc={'chatInteraction':require(_0xdb93('0x3')),'openchannelInteraction':require(_0xdb93('0x4')),'smsInteraction':require(_0xdb93('0x5')),'mailInteraction':require(_0xdb93('0x6')),'faxInteraction':require(_0xdb93('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xdb93('0x8')]=function(_0x5d5b5d,_0xdbf590,_0x64091,_0x546493){return function(_0x17ece1){try{logger[_0xdb93('0x9')](_0xdb93('0xa'),_0x5d5b5d,_0xdbf590[0x0]);var _0x516e48={'closed':0x1,'closedAt':moment()['format'](_0xdb93('0xb')),'closeReason':_0xdb93('0xc'),'disposition':_0xdbf590[0x0]};if(rpc[_0x546493['channel']+_0xdb93('0xd')]){rpc[_0x546493[_0xdb93('0xe')]+_0xdb93('0xd')]['update'](_0x546493['interaction']['id'],_0x516e48)['then'](function(_0x2cead3){logger[_0xdb93('0x9')](_0xdb93('0xf'),_0x5d5b5d,_0x546493[_0xdb93('0x10')]['id']);})[_0xdb93('0x11')](function(_0x524eab){logger[_0xdb93('0x12')](_0xdb93('0x13'),_0x5d5b5d,JSON[_0xdb93('0x14')](_0x524eab));})[_0xdb93('0x15')](function(){_0x17ece1[_0xdb93('0x16')]();});}}catch(_0x596943){logger['error'](_0xdb93('0x13'),_0x5d5b5d,JSON[_0xdb93('0x14')](_0x596943));_0x17ece1[_0xdb93('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 3312931..76656a3 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 _0xbe3b=['[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','endConversation','moment','apiai-promise','./utils','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','info'];(function(_0x2e1244,_0x50c359){var _0x423394=function(_0x2c326e){while(--_0x2c326e){_0x2e1244['push'](_0x2e1244['shift']());}};_0x423394(++_0x50c359);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x14806a,_0x14d122){_0x14806a=_0x14806a-0x0;var _0x12e125=_0xbe3b[_0x14806a];return _0x12e125;};'use strict';var _=require('lodash');var moment=require(_0xbbe3('0x0'));var apiai=require(_0xbbe3('0x1'));var md5=require('md5');var utils=require(_0xbbe3('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xbbe3('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xbbe3('0x4')),'faxMessage':require(_0xbbe3('0x5')),'whatsappMessage':require(_0xbbe3('0x6'))};exports[_0xbbe3('0x7')]=function(_0x4c6976,_0x9bd4a9){return function(_0x748756){try{if(!_[_0xbbe3('0x8')](this[_0xbbe3('0x9')][_0xbbe3('0xa')])){logger['info'](_0xbbe3('0xb'),_0x4c6976,_0xbbe3('0xc'));return _0x748756[_0xbbe3('0xd')]();}var _0x2cb1f1={'ContactId':this[_0xbbe3('0xe')]['id'],'sentAt':moment()[_0xbbe3('0xf')](_0xbbe3('0x10')),'direction':_0xbbe3('0x11')};if(this['channel']===_0xbbe3('0x12')||this[_0xbbe3('0x13')]===_0xbbe3('0x14')){_0x2cb1f1[_0xbbe3('0x15')]=this['interaction']['phone'];}var _0xe445c0=this[_0xbbe3('0x13')];if(_0xe445c0===_0xbbe3('0x16')){_0x2cb1f1[_0xbbe3('0x17')]=this[_0xbbe3('0x18')]['id'];}else{_0x2cb1f1[_[_0xbbe3('0x19')](_0xe445c0)+'AccountId']=this[_0xbbe3('0x18')]['id'];}_0x2cb1f1[_['upperFirst'](_0xe445c0)+_0xbbe3('0x1a')]=this[_0xbbe3('0x9')]['id'];if(this[_0xbbe3('0x9')][_0xbbe3('0x1b')]){var _0x1bea70=_0x9bd4a9[0x2];if(!_[_0xbbe3('0x1c')](_0x1bea70)){_0x2cb1f1[_0xbbe3('0x1d')]=utils[_0xbbe3('0x1e')](_0x1bea70,this);return rpc[_0xe445c0+_0xbbe3('0x1f')][_0xbbe3('0x20')](_0x2cb1f1)[_0xbbe3('0x21')](function(_0x3de02e){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x4c6976,_0x2cb1f1['body']);})[_0xbbe3('0x22')](function(_0x541b34){logger[_0xbbe3('0x23')](_0xbbe3('0xb'),_0x4c6976,JSON[_0xbbe3('0x24')](_0x541b34));})['finally'](function(){logger[_0xbbe3('0x25')](_0xbbe3('0x26'),_0x4c6976);_0x748756[_0xbbe3('0x27')]();});}else{logger[_0xbbe3('0x25')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4c6976);_0x748756['stop']();}}else{var _0x4a5d39=this;var _0x5e78dc=apiai(_0x9bd4a9[0x0],{'language':_0x9bd4a9[0x1]||'en'});return _0x5e78dc[_0xbbe3('0x28')](this[_0xbbe3('0x29')][_0xbbe3('0x1d')],{'sessionId':md5(this['interaction']['id'])})[_0xbbe3('0x21')](function(_0x190611){_0x4a5d39['body']['dialogflow']=_0x190611;_0x2cb1f1[_0xbbe3('0x1d')]=_0x190611[_0xbbe3('0x2a')][_0xbbe3('0x2b')][_0xbbe3('0x2c')];_0x2cb1f1[_0xbbe3('0x2d')]=_0xbbe3('0x2e');_0x2cb1f1[_0xbbe3('0x2f')]=JSON['stringify'](_0x190611);return rpc[_0xe445c0+_0xbbe3('0x1f')][_0xbbe3('0x20')](_0x2cb1f1)[_0xbbe3('0x21')](function(_0x56ee13){logger[_0xbbe3('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x4c6976,_0x2cb1f1[_0xbbe3('0x1d')]);if(_0x190611[_0xbbe3('0x2a')][_0xbbe3('0x30')][_0xbbe3('0x31')]){_0x748756[_0xbbe3('0xd')]();}else{_0x748756['stop']();}})['catch'](function(_0x46fcb3){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4c6976,JSON['stringify'](_0x46fcb3));_0x748756[_0xbbe3('0xd')]();});})['catch'](function(_0x30023d){logger[_0xbbe3('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x4c6976,_0x30023d[_0xbbe3('0x29')]);_0x748756[_0xbbe3('0xd')]();});}}catch(_0x54f043){logger[_0xbbe3('0x23')](_0xbbe3('0xb'),_0x4c6976,JSON['stringify'](_0x54f043));_0x748756['stop']();}};}; \ No newline at end of file +var _0x9851=['result','fulfillment','speech','providerName','providerResponse','stringify','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','InteractionId','body','Message','create','then','[%s][DIALOGFLOW]\x20%s','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9851,0x1f1));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1985('0x0'));var moment=require('moment');var apiai=require(_0x1985('0x1'));var md5=require(_0x1985('0x2'));var utils=require(_0x1985('0x3'));var logger=require(_0x1985('0x4'))(_0x1985('0x5'));var rpc={'chatMessage':require(_0x1985('0x6')),'openchannelMessage':require(_0x1985('0x7')),'mailMessage':require(_0x1985('0x8')),'smsMessage':require(_0x1985('0x9')),'faxMessage':require(_0x1985('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x1985('0xb')]=function(_0x8a5919,_0x310f2e){return function(_0x50eea1){try{if(!_[_0x1985('0xc')](this[_0x1985('0xd')]['UserId'])){logger[_0x1985('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x8a5919,_0x1985('0xf'));return _0x50eea1[_0x1985('0x10')]();}var _0x2d8c61={'ContactId':this[_0x1985('0x11')]['id'],'sentAt':moment()[_0x1985('0x12')](_0x1985('0x13')),'direction':_0x1985('0x14')};if(this[_0x1985('0x15')]===_0x1985('0x16')||this[_0x1985('0x15')]===_0x1985('0x17')){_0x2d8c61[_0x1985('0x18')]=this['interaction'][_0x1985('0x18')];}var _0x2390aa=this['channel'];if(_0x2390aa==='chat'){_0x2d8c61['ChatWebsiteId']=this[_0x1985('0x19')]['id'];}else{_0x2d8c61[_[_0x1985('0x1a')](_0x2390aa)+'AccountId']=this[_0x1985('0x19')]['id'];}_0x2d8c61[_[_0x1985('0x1a')](_0x2390aa)+_0x1985('0x1b')]=this['interaction']['id'];if(this[_0x1985('0xd')]['created']){var _0x275b29=_0x310f2e[0x2];if(!_['isEmpty'](_0x275b29)){_0x2d8c61[_0x1985('0x1c')]=utils['getMustacheRender'](_0x275b29,this);return rpc[_0x2390aa+_0x1985('0x1d')][_0x1985('0x1e')](_0x2d8c61)[_0x1985('0x1f')](function(_0x433a33){logger[_0x1985('0xe')](_0x1985('0x20'),_0x8a5919,_0x2d8c61[_0x1985('0x1c')]);})[_0x1985('0x21')](function(_0x54f2a8){logger[_0x1985('0x22')](_0x1985('0x20'),_0x8a5919,JSON['stringify'](_0x54f2a8));})[_0x1985('0x23')](function(){logger[_0x1985('0xe')](_0x1985('0x24'),_0x8a5919);_0x50eea1[_0x1985('0x25')]();});}else{logger[_0x1985('0xe')](_0x1985('0x26'),_0x8a5919);_0x50eea1[_0x1985('0x25')]();}}else{var _0x290c1a=this;var _0x2e648a=apiai(_0x310f2e[0x0],{'language':_0x310f2e[0x1]||'en'});return _0x2e648a[_0x1985('0x27')](this[_0x1985('0x28')]['body'],{'sessionId':md5(this[_0x1985('0xd')]['id'])})[_0x1985('0x1f')](function(_0x42889c){_0x290c1a[_0x1985('0x1c')][_0x1985('0x29')]=_0x42889c;_0x2d8c61['body']=_0x42889c[_0x1985('0x2a')][_0x1985('0x2b')][_0x1985('0x2c')];_0x2d8c61[_0x1985('0x2d')]='dialogflow';_0x2d8c61[_0x1985('0x2e')]=JSON[_0x1985('0x2f')](_0x42889c);return rpc[_0x2390aa+_0x1985('0x1d')][_0x1985('0x1e')](_0x2d8c61)['then'](function(_0x5627ba){logger[_0x1985('0xe')](_0x1985('0x20'),_0x8a5919,_0x2d8c61[_0x1985('0x1c')]);if(_0x42889c[_0x1985('0x2a')]['metadata'][_0x1985('0x30')]){_0x50eea1['next']();}else{_0x50eea1['stop']();}})[_0x1985('0x21')](function(_0x488e9c){logger['error'](_0x1985('0x20'),_0x8a5919,JSON[_0x1985('0x2f')](_0x488e9c));_0x50eea1[_0x1985('0x10')]();});})[_0x1985('0x21')](function(_0x5962d8){logger[_0x1985('0x22')](_0x1985('0x20'),_0x8a5919,_0x5962d8[_0x1985('0x28')]);_0x50eea1[_0x1985('0x10')]();});}}catch(_0x3c6bdf){logger['error'](_0x1985('0x20'),_0x8a5919,JSON[_0x1985('0x2f')](_0x3c6bdf));_0x50eea1[_0x1985('0x25')]();}};}; \ 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 eaa9618..89452d3 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 _0x1b4f=['queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','fulfillmentText','push','all','error','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','info','catch','[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','getMustacheRender','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','length','dialogflowV2'];(function(_0x413ff0,_0x1e782d){var _0x3826d4=function(_0x46c7ae){while(--_0x46c7ae){_0x413ff0['push'](_0x413ff0['shift']());}};_0x3826d4(++_0x1e782d);}(_0x1b4f,0xd8));var _0xf1b4=function(_0xa63eff,_0xdd46f6){_0xa63eff=_0xa63eff-0x0;var _0x1f6827=_0x1b4f[_0xa63eff];return _0x1f6827;};'use strict';var _=require(_0xf1b4('0x0'));var dialogflow=require(_0xf1b4('0x1'));var md5=require(_0xf1b4('0x2'));var moment=require(_0xf1b4('0x3'));var Promise=require(_0xf1b4('0x4'));var logger=require(_0xf1b4('0x5'))(_0xf1b4('0x6'));var utils=require('./utils');var rpc={'chatMessage':require(_0xf1b4('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf1b4('0x8')),'smsMessage':require(_0xf1b4('0x9')),'faxMessage':require(_0xf1b4('0xa')),'whatsappMessage':require(_0xf1b4('0xb'))};function createMessage(_0x20df0d,_0x2a7595,_0x3c1d69,_0x505b1a){return new Promise(function(_0x22ea31,_0x249314){var _0x283248=_['clone'](_0x3c1d69);_0x283248[_0xf1b4('0xc')]=_0x505b1a;return rpc[_0x2a7595+_0xf1b4('0xd')][_0xf1b4('0xe')](_0x283248)[_0xf1b4('0xf')](function(){logger[_0xf1b4('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x20df0d,_0x283248[_0xf1b4('0xc')]);_0x22ea31();})[_0xf1b4('0x11')](function(_0x1ff55f){logger['error'](_0xf1b4('0x12'),_0x20df0d,JSON['stringify'](_0x1ff55f));_0x249314(_0x1ff55f);});});}exports[_0xf1b4('0x13')]=function(_0x2e108a,_0x725d1){return function(_0xc8548e){try{if(!_[_0xf1b4('0x14')](this[_0xf1b4('0x15')]['UserId'])){logger[_0xf1b4('0x10')](_0xf1b4('0x12'),_0x2e108a,_0xf1b4('0x16'));return _0xc8548e[_0xf1b4('0x17')]();}var _0x26592a={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xf1b4('0x18')),'direction':_0xf1b4('0x19')};if(this[_0xf1b4('0x1a')]===_0xf1b4('0x1b')||this[_0xf1b4('0x1a')]===_0xf1b4('0x1c')){_0x26592a[_0xf1b4('0x1d')]=this[_0xf1b4('0x15')][_0xf1b4('0x1d')];}var _0x814e96=this[_0xf1b4('0x1a')];if(_0x814e96===_0xf1b4('0x1e')){_0x26592a[_0xf1b4('0x1f')]=this['account']['id'];}else{_0x26592a[_[_0xf1b4('0x20')](_0x814e96)+_0xf1b4('0x21')]=this[_0xf1b4('0x22')]['id'];}_0x26592a[_[_0xf1b4('0x20')](_0x814e96)+_0xf1b4('0x23')]=this[_0xf1b4('0x15')]['id'];if(this[_0xf1b4('0x15')]['created']){var _0x120d4a=_0x725d1[0x4];if(!_[_0xf1b4('0x24')](_0x120d4a)){_0x26592a[_0xf1b4('0xc')]=utils[_0xf1b4('0x25')](_0x120d4a,this);return rpc[_0x814e96+_0xf1b4('0xd')]['create'](_0x26592a)[_0xf1b4('0xf')](function(_0x3e4b63){logger[_0xf1b4('0x10')](_0xf1b4('0x12'),_0x2e108a,_0x26592a[_0xf1b4('0xc')]);})['catch'](function(_0x2d547c){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2e108a,JSON[_0xf1b4('0x26')](_0x2d547c));})[_0xf1b4('0x27')](function(){logger[_0xf1b4('0x10')](_0xf1b4('0x28'),_0x2e108a);_0xc8548e[_0xf1b4('0x29')]();});}else{logger['info'](_0xf1b4('0x2a'),_0x2e108a);_0xc8548e[_0xf1b4('0x29')]();}}else{var _0x1b679d=this;var _0x235dd1=_0x725d1[0x2]['replace'](/\\n/g,'\x0a');var _0x25b8bc={'credentials':{'private_key':_0x235dd1,'client_email':_0x725d1[0x1]}};var _0x56dd11=new dialogflow['SessionsClient'](_0x25b8bc);var _0x26871e=_0x56dd11[_0xf1b4('0x2b')](_0x725d1[0x0],md5(_0x1b679d[_0xf1b4('0x15')]['id']));var _0x4a2e67={'session':_0x26871e,'queryInput':{'text':{'text':_0x1b679d[_0xf1b4('0x2c')]['body'],'languageCode':_0x725d1[0x3]||'en'}}};return _0x56dd11[_0xf1b4('0x2d')](_0x4a2e67)[_0xf1b4('0xf')](function(_0x4a2179){if(_0x4a2179&&_0x4a2179[_0xf1b4('0x2e')]){_0x1b679d['body'][_0xf1b4('0x2f')]=_0x4a2179;var _0x1c3d1f=_0x4a2179[0x0];var _0x39e5bc=_0x1c3d1f[_0xf1b4('0x30')]['diagnosticInfo']&&_0x1c3d1f[_0xf1b4('0x30')][_0xf1b4('0x31')][_0xf1b4('0x32')]?_0x1c3d1f['queryResult'][_0xf1b4('0x31')][_0xf1b4('0x32')]['end_conversation'][_0xf1b4('0x33')]:![];_0x1b679d[_0xf1b4('0xc')][_0xf1b4('0x34')]=_0x1c3d1f[_0xf1b4('0x30')][_0xf1b4('0x35')];_0x1b679d[_0xf1b4('0xc')][_0xf1b4('0x36')]=_0x1c3d1f[_0xf1b4('0x30')]['allRequiredParamsPresent'];_0x1b679d[_0xf1b4('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x1c3d1f[_0xf1b4('0x30')]['diagnosticInfo']&&_0x1c3d1f[_0xf1b4('0x30')][_0xf1b4('0x31')][_0xf1b4('0x32')]?_0x1c3d1f[_0xf1b4('0x30')][_0xf1b4('0x31')][_0xf1b4('0x32')]['end_conversation'][_0xf1b4('0x33')]:![];_0x1b679d[_0xf1b4('0xc')]['DIALOGFLOWV2_INTENTNAME']=_0x1c3d1f[_0xf1b4('0x30')][_0xf1b4('0x37')]['name'];_0x1b679d[_0xf1b4('0xc')][_0xf1b4('0x38')]=_0x1c3d1f['queryResult'][_0xf1b4('0x37')]['displayName'];_0x1b679d[_0xf1b4('0xc')][_0xf1b4('0x39')]=_0x1c3d1f['queryResult'][_0xf1b4('0x37')]['isFallback'];_0x1b679d[_0xf1b4('0xc')][_0xf1b4('0x3a')]=_0x1c3d1f[_0xf1b4('0x30')]['languageCode'];_0x1b679d[_0xf1b4('0xc')][_0xf1b4('0x3b')]=_0x1c3d1f[_0xf1b4('0x30')]['queryText'];_0x1b679d['body'][_0xf1b4('0x3c')]=_0x1c3d1f['queryResult'][_0xf1b4('0x3d')];_0x26592a['providerName']='dialogflowV2';_0x26592a['providerResponse']=JSON[_0xf1b4('0x26')](_0x4a2179);var _0x5f1947=[];for(var _0x2ba1d2=0x0;_0x2ba1d2<_0x4a2179[_0xf1b4('0x2e')];_0x2ba1d2++){var _0x243767=_0x4a2179[_0x2ba1d2];if(_0x243767&&_0x243767[_0xf1b4('0x30')]&&_0x243767[_0xf1b4('0x30')][_0xf1b4('0x3e')]){_0x5f1947[_0xf1b4('0x3f')](createMessage(_0x2e108a,_0x814e96,_0x26592a,_0x243767['queryResult'][_0xf1b4('0x3e')]));}}return Promise[_0xf1b4('0x40')](_0x5f1947)[_0xf1b4('0xf')](function(){if(_0x39e5bc){_0xc8548e[_0xf1b4('0x17')]();}else{_0xc8548e[_0xf1b4('0x29')]();}})[_0xf1b4('0x11')](function(_0x230661){logger[_0xf1b4('0x41')](_0xf1b4('0x12'),_0x2e108a,JSON[_0xf1b4('0x26')](_0x230661));_0xc8548e[_0xf1b4('0x17')]();});}})[_0xf1b4('0x11')](function(_0x5dc506){logger[_0xf1b4('0x41')](_0xf1b4('0x12'),_0x2e108a,_0x5dc506[_0xf1b4('0x2c')]);_0xc8548e['next']();});}}catch(_0x195bd8){logger[_0xf1b4('0x41')](_0xf1b4('0x12'),_0x2e108a,JSON[_0xf1b4('0x26')](_0x195bd8));_0xc8548e['stop']();}};}; \ No newline at end of file +var _0x4326=['queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','upperFirst','AccountId','create','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'];(function(_0x1d1162,_0x5b2464){var _0x2da1f0=function(_0x5ab7c2){while(--_0x5ab7c2){_0x1d1162['push'](_0x1d1162['shift']());}};_0x2da1f0(++_0x5b2464);}(_0x4326,0xf0));var _0x6432=function(_0x2d289e,_0x1c309a){_0x2d289e=_0x2d289e-0x0;var _0x31164c=_0x4326[_0x2d289e];return _0x31164c;};'use strict';var _=require(_0x6432('0x0'));var dialogflow=require(_0x6432('0x1'));var md5=require(_0x6432('0x2'));var moment=require('moment');var Promise=require(_0x6432('0x3'));var logger=require(_0x6432('0x4'))(_0x6432('0x5'));var utils=require(_0x6432('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6432('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6432('0x8')),'faxMessage':require(_0x6432('0x9')),'whatsappMessage':require(_0x6432('0xa'))};function createMessage(_0x1bea21,_0x34bc16,_0x21f0cc,_0x257ac5){return new Promise(function(_0x1e798a,_0x12aa39){var _0x628b74=_[_0x6432('0xb')](_0x21f0cc);_0x628b74[_0x6432('0xc')]=_0x257ac5;return rpc[_0x34bc16+_0x6432('0xd')]['create'](_0x628b74)[_0x6432('0xe')](function(){logger['info'](_0x6432('0xf'),_0x1bea21,_0x628b74[_0x6432('0xc')]);_0x1e798a();})[_0x6432('0x10')](function(_0x583d6b){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1bea21,JSON[_0x6432('0x11')](_0x583d6b));_0x12aa39(_0x583d6b);});});}exports[_0x6432('0x12')]=function(_0x22dc1d,_0x1ec5ca){return function(_0x165d72){try{if(!_[_0x6432('0x13')](this[_0x6432('0x14')][_0x6432('0x15')])){logger[_0x6432('0x16')](_0x6432('0xf'),_0x22dc1d,_0x6432('0x17'));return _0x165d72[_0x6432('0x18')]();}var _0x1cd265={'ContactId':this[_0x6432('0x19')]['id'],'sentAt':moment()[_0x6432('0x1a')](_0x6432('0x1b')),'direction':_0x6432('0x1c')};if(this[_0x6432('0x1d')]===_0x6432('0x1e')||this[_0x6432('0x1d')]==='whatsapp'){_0x1cd265[_0x6432('0x1f')]=this['interaction'][_0x6432('0x1f')];}var _0xc44185=this['channel'];if(_0xc44185==='chat'){_0x1cd265[_0x6432('0x20')]=this[_0x6432('0x21')]['id'];}else{_0x1cd265[_[_0x6432('0x22')](_0xc44185)+_0x6432('0x23')]=this[_0x6432('0x21')]['id'];}_0x1cd265[_[_0x6432('0x22')](_0xc44185)+'InteractionId']=this[_0x6432('0x14')]['id'];if(this[_0x6432('0x14')]['created']){var _0xad57db=_0x1ec5ca[0x4];if(!_['isEmpty'](_0xad57db)){_0x1cd265[_0x6432('0xc')]=utils['getMustacheRender'](_0xad57db,this);return rpc[_0xc44185+_0x6432('0xd')][_0x6432('0x24')](_0x1cd265)[_0x6432('0xe')](function(_0x1740c2){logger[_0x6432('0x16')]('[%s][DIALOGFLOWV2]\x20%s',_0x22dc1d,_0x1cd265[_0x6432('0xc')]);})[_0x6432('0x10')](function(_0x418f23){logger[_0x6432('0x25')](_0x6432('0xf'),_0x22dc1d,JSON[_0x6432('0x11')](_0x418f23));})[_0x6432('0x26')](function(){logger[_0x6432('0x16')](_0x6432('0x27'),_0x22dc1d);_0x165d72[_0x6432('0x28')]();});}else{logger[_0x6432('0x16')](_0x6432('0x29'),_0x22dc1d);_0x165d72['stop']();}}else{var _0x20f32=this;var _0x4163ce=_0x1ec5ca[0x2][_0x6432('0x2a')](/\\n/g,'\x0a');var _0x2b1328={'credentials':{'private_key':_0x4163ce,'client_email':_0x1ec5ca[0x1]}};var _0x5d1527=new dialogflow[(_0x6432('0x2b'))](_0x2b1328);var _0x5b98d2=_0x5d1527[_0x6432('0x2c')](_0x1ec5ca[0x0],md5(_0x20f32['interaction']['id']));var _0x2a2d89={'session':_0x5b98d2,'queryInput':{'text':{'text':_0x20f32[_0x6432('0x2d')]['body'],'languageCode':_0x1ec5ca[0x3]||'en'}}};return _0x5d1527[_0x6432('0x2e')](_0x2a2d89)[_0x6432('0xe')](function(_0x4c5273){if(_0x4c5273&&_0x4c5273[_0x6432('0x2f')]){_0x20f32[_0x6432('0xc')]['dialogflowV2']=_0x4c5273;var _0x672d06=_0x4c5273[0x0];var _0xbfc7ee=_0x672d06[_0x6432('0x30')][_0x6432('0x31')]&&_0x672d06['queryResult']['diagnosticInfo'][_0x6432('0x32')]?_0x672d06[_0x6432('0x30')]['diagnosticInfo']['fields'][_0x6432('0x33')][_0x6432('0x34')]:![];_0x20f32[_0x6432('0xc')]['DIALOGFLOWV2_ACTION']=_0x672d06[_0x6432('0x30')][_0x6432('0x35')];_0x20f32[_0x6432('0xc')][_0x6432('0x36')]=_0x672d06[_0x6432('0x30')][_0x6432('0x37')];_0x20f32[_0x6432('0xc')][_0x6432('0x38')]=_0x672d06['queryResult'][_0x6432('0x31')]&&_0x672d06[_0x6432('0x30')][_0x6432('0x31')][_0x6432('0x32')]?_0x672d06[_0x6432('0x30')][_0x6432('0x31')]['fields'][_0x6432('0x33')]['boolValue']:![];_0x20f32[_0x6432('0xc')][_0x6432('0x39')]=_0x672d06['queryResult'][_0x6432('0x3a')][_0x6432('0x3b')];_0x20f32[_0x6432('0xc')][_0x6432('0x3c')]=_0x672d06[_0x6432('0x30')][_0x6432('0x3a')]['displayName'];_0x20f32[_0x6432('0xc')][_0x6432('0x3d')]=_0x672d06[_0x6432('0x30')][_0x6432('0x3a')]['isFallback'];_0x20f32['body'][_0x6432('0x3e')]=_0x672d06[_0x6432('0x30')][_0x6432('0x3f')];_0x20f32[_0x6432('0xc')][_0x6432('0x40')]=_0x672d06[_0x6432('0x30')]['queryText'];_0x20f32['body']['DIALOGFLOWV2_SCORE']=_0x672d06['queryResult'][_0x6432('0x41')];_0x1cd265[_0x6432('0x42')]=_0x6432('0x43');_0x1cd265[_0x6432('0x44')]=JSON[_0x6432('0x11')](_0x4c5273);var _0x3290aa=[];for(var _0x562711=0x0;_0x562711<_0x4c5273['length'];_0x562711++){var _0x38ee6b=_0x4c5273[_0x562711];if(_0x38ee6b&&_0x38ee6b[_0x6432('0x30')]&&_0x38ee6b['queryResult'][_0x6432('0x45')]){_0x3290aa[_0x6432('0x46')](createMessage(_0x22dc1d,_0xc44185,_0x1cd265,_0x38ee6b[_0x6432('0x30')][_0x6432('0x45')]));}}return Promise[_0x6432('0x47')](_0x3290aa)[_0x6432('0xe')](function(){if(_0xbfc7ee){_0x165d72[_0x6432('0x18')]();}else{_0x165d72['stop']();}})[_0x6432('0x10')](function(_0x3a83cb){logger[_0x6432('0x25')]('[%s][DIALOGFLOWV2]\x20%s',_0x22dc1d,JSON[_0x6432('0x11')](_0x3a83cb));_0x165d72[_0x6432('0x18')]();});}})[_0x6432('0x10')](function(_0x276aec){logger[_0x6432('0x25')](_0x6432('0xf'),_0x22dc1d,_0x276aec[_0x6432('0x2d')]);_0x165d72['next']();});}}catch(_0x83d4ab){logger[_0x6432('0x25')]('[%s][DIALOGFLOWV2]\x20%s',_0x22dc1d,JSON[_0x6432('0x11')](_0x83d4ab));_0x165d72[_0x6432('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 e8df45d..99ffc4d 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 _0xd684=['priorityTrue','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','error','validate','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x140461,_0x396889){var _0x133efb=function(_0x11a6ec){while(--_0x11a6ec){_0x140461['push'](_0x140461['shift']());}};_0x133efb(++_0x396889);}(_0xd684,0x174));var _0x4d68=function(_0x4dc392,_0x255362){_0x4dc392=_0x4dc392-0x0;var _0x4e45ad=_0xd684[_0x4dc392];return _0x4e45ad;};'use strict';var schema=require(_0x4d68('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x4d68('0x1'));var logger=require(_0x4d68('0x2'))(_0x4d68('0x3'));var gotoif=schema({'condition':{'type':_0x4d68('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x4d68('0x5'),'message':_0x4d68('0x6')},'priorityFalse':{'type':_0x4d68('0x5'),'message':_0x4d68('0x7')}});exports[_0x4d68('0x8')]=function(_0x2276c8,_0x5adb63){return function(_0x1ba548){try{var _0x88dd6e={'condition':htmlToText[_0x4d68('0x9')](utils[_0x4d68('0xa')](_0x5adb63[0x0],this),{'wordwrap':![]})[_0x4d68('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5adb63[0x1],'priorityFalse':_0x5adb63[0x2]};var _0x38cfd9=gotoif['validate'](_0x88dd6e,{'typecast':!![]});if(_0x38cfd9['length']){logger['error'](_0x4d68('0xc'),_0x2276c8,_[_0x4d68('0xd')](_0x38cfd9,_0x4d68('0xe'))[_0x4d68('0xf')](',\x20'));_0x1ba548[_0x4d68('0x10')]();}else{try{var _0x5ec963=eval('('+_0x88dd6e[_0x4d68('0x11')]+')');var _0x51a803=_0x5ec963?_0x88dd6e[_0x4d68('0x12')]:_0x88dd6e['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2276c8,_0x88dd6e[_0x4d68('0x11')],_0x5ec963,_0x51a803||_0x4d68('0x13'));if(_0x51a803){var _0x4fc9dd=_[_0x4d68('0x14')](_0x1ba548[_0x4d68('0x15')](),{'p':_0x51a803});if(_0x4fc9dd>=0x0){logger[_0x4d68('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2276c8,_0x51a803||'next',_0x4fc9dd);_0x1ba548['next'](_0x4fc9dd);}else{logger[_0x4d68('0x16')](_0x4d68('0x17'),_0x2276c8,_0x51a803||'next');_0x1ba548[_0x4d68('0x10')]();}}else{_0x1ba548[_0x4d68('0x13')]();}}catch(_0x28f21a){logger['error'](_0x4d68('0x18'),_0x2276c8,_0x28f21a[_0x4d68('0xe')]);_0x1ba548['stop']();}}}catch(_0x4aaf9c){logger[_0x4d68('0x19')]('[%s][GOTOIF]\x20%s',_0x2276c8,JSON['stringify'](_0x4aaf9c));_0x1ba548[_0x4d68('0x10')]();}};}; \ No newline at end of file +var _0x399d=['[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','routing','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','info'];(function(_0x224f06,_0xe769ad){var _0x669cbd=function(_0x4494d2){while(--_0x4494d2){_0x224f06['push'](_0x224f06['shift']());}};_0x669cbd(++_0xe769ad);}(_0x399d,0x78));var _0xd399=function(_0x4acea8,_0x1211b3){_0x4acea8=_0x4acea8-0x0;var _0x17f239=_0x399d[_0x4acea8];return _0x17f239;};'use strict';var schema=require(_0xd399('0x0'));var _=require(_0xd399('0x1'));var htmlToText=require(_0xd399('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xd399('0x3'));var gotoif=schema({'condition':{'type':_0xd399('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xd399('0x5')},'priorityFalse':{'type':_0xd399('0x6'),'message':_0xd399('0x7')}});exports[_0xd399('0x8')]=function(_0x4383bd,_0x316ebc){return function(_0xbbcb50){try{var _0x52264d={'condition':htmlToText['fromString'](utils[_0xd399('0x9')](_0x316ebc[0x0],this),{'wordwrap':![]})[_0xd399('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x316ebc[0x1],'priorityFalse':_0x316ebc[0x2]};var _0xa80176=gotoif[_0xd399('0x0')](_0x52264d,{'typecast':!![]});if(_0xa80176[_0xd399('0xb')]){logger[_0xd399('0xc')](_0xd399('0xd'),_0x4383bd,_['map'](_0xa80176,_0xd399('0xe'))[_0xd399('0xf')](',\x20'));_0xbbcb50[_0xd399('0x10')]();}else{try{var _0x386a83=eval('('+_0x52264d[_0xd399('0x11')]+')');var _0x1541d3=_0x386a83?_0x52264d[_0xd399('0x12')]:_0x52264d['priorityFalse'];logger[_0xd399('0x13')](_0xd399('0x14'),_0x4383bd,_0x52264d[_0xd399('0x11')],_0x386a83,_0x1541d3||'next');if(_0x1541d3){var _0x2eb772=_[_0xd399('0x15')](_0xbbcb50[_0xd399('0x16')](),{'p':_0x1541d3});if(_0x2eb772>=0x0){logger[_0xd399('0x13')](_0xd399('0x17'),_0x4383bd,_0x1541d3||_0xd399('0x18'),_0x2eb772);_0xbbcb50[_0xd399('0x18')](_0x2eb772);}else{logger[_0xd399('0x13')](_0xd399('0x19'),_0x4383bd,_0x1541d3||_0xd399('0x18'));_0xbbcb50[_0xd399('0x10')]();}}else{_0xbbcb50[_0xd399('0x18')]();}}catch(_0x50727a){logger[_0xd399('0xc')](_0xd399('0x1a'),_0x4383bd,_0x50727a[_0xd399('0xe')]);_0xbbcb50['stop']();}}}catch(_0x166dbe){logger['error']('[%s][GOTOIF]\x20%s',_0x4383bd,JSON[_0xd399('0x1b')](_0x166dbe));_0xbbcb50[_0xd399('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 7f43bc7..1c446b6 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 _0xf35f=['error','[%s][GOTOP]\x20%s','map','message','join','stop','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','../../../../config/logger','routing'];(function(_0x3b5e02,_0x535469){var _0x59464c=function(_0x2d11cb){while(--_0x2d11cb){_0x3b5e02['push'](_0x3b5e02['shift']());}};_0x59464c(++_0x535469);}(_0xf35f,0x1bc));var _0xff35=function(_0x3df45b,_0xe6e277){_0x3df45b=_0x3df45b-0x0;var _0x24f10b=_0xf35f[_0x3df45b];return _0x24f10b;};'use strict';var schema=require(_0xff35('0x0'));var _=require(_0xff35('0x1'));var logger=require(_0xff35('0x2'))(_0xff35('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x7bbc47,_0x102c90){return function(_0x26c479){try{var _0x4b0500={'priority':_0x102c90[0x0]};var _0x4f8a02=gotop[_0xff35('0x0')](_0x4b0500,{'typecast':!![]});if(_0x4f8a02['length']){logger[_0xff35('0x4')](_0xff35('0x5'),_0x7bbc47,_[_0xff35('0x6')](_0x4f8a02,_0xff35('0x7'))[_0xff35('0x8')](',\x20'));_0x26c479[_0xff35('0x9')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x7bbc47,_0x4b0500[_0xff35('0xa')]);if(_0x4b0500[_0xff35('0xa')]){var _0x29e97d=_['findIndex'](_0x26c479[_0xff35('0xb')](),{'p':_0x4b0500[_0xff35('0xa')]});if(_0x29e97d>=0x0){logger[_0xff35('0xc')](_0xff35('0xd'),_0x7bbc47,_0x4b0500[_0xff35('0xa')]||_0xff35('0xe'),_0x29e97d);_0x26c479['next'](_0x29e97d);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x7bbc47,_0x4b0500['priority']||'next');_0x26c479[_0xff35('0x9')]();}}else{_0x26c479[_0xff35('0xe')]();}}}catch(_0x31bc11){logger['error'](_0xff35('0x5'),_0x7bbc47,JSON[_0xff35('0xf')](_0x31bc11));_0x26c479[_0xff35('0x9')]();}};}; \ No newline at end of file +var _0xec4d=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next'];(function(_0xeb1cfb,_0x335324){var _0x37104c=function(_0x55a662){while(--_0x55a662){_0xeb1cfb['push'](_0xeb1cfb['shift']());}};_0x37104c(++_0x335324);}(_0xec4d,0xf9));var _0xdec4=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xec4d[_0x30b0d8];return _0x459c09;};'use strict';var schema=require(_0xdec4('0x0'));var _=require(_0xdec4('0x1'));var logger=require(_0xdec4('0x2'))(_0xdec4('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xdec4('0x4')}});exports[_0xdec4('0x5')]=function(_0x367ace,_0x5015fc){return function(_0x3b8529){try{var _0x448e83={'priority':_0x5015fc[0x0]};var _0x120354=gotop['validate'](_0x448e83,{'typecast':!![]});if(_0x120354[_0xdec4('0x6')]){logger[_0xdec4('0x7')](_0xdec4('0x8'),_0x367ace,_[_0xdec4('0x9')](_0x120354,'message')[_0xdec4('0xa')](',\x20'));_0x3b8529[_0xdec4('0xb')]();}else{logger[_0xdec4('0xc')](_0xdec4('0xd'),_0x367ace,_0x448e83[_0xdec4('0xe')]);if(_0x448e83[_0xdec4('0xe')]){var _0x3a1b46=_[_0xdec4('0xf')](_0x3b8529['rules'](),{'p':_0x448e83[_0xdec4('0xe')]});if(_0x3a1b46>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x367ace,_0x448e83[_0xdec4('0xe')]||'next',_0x3a1b46);_0x3b8529[_0xdec4('0x10')](_0x3a1b46);}else{logger[_0xdec4('0xc')](_0xdec4('0x11'),_0x367ace,_0x448e83[_0xdec4('0xe')]||'next');_0x3b8529[_0xdec4('0xb')]();}}else{_0x3b8529[_0xdec4('0x10')]();}}}catch(_0x81854b){logger[_0xdec4('0x7')](_0xdec4('0x8'),_0x367ace,JSON[_0xdec4('0x12')](_0x81854b));_0x3b8529[_0xdec4('0xb')]();}};}; \ 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 ed10fda..62bef44 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 _0x355b=['chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stop','stringify','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel'];(function(_0xc8cd64,_0x31ef3b){var _0xc618a6=function(_0xcae829){while(--_0xcae829){_0xc8cd64['push'](_0xc8cd64['shift']());}};_0xc618a6(++_0x31ef3b);}(_0x355b,0x115));var _0xb355=function(_0x1788cb,_0x42b17f){_0x1788cb=_0x1788cb-0x0;var _0x412734=_0x355b[_0x1788cb];return _0x412734;};'use strict';var _=require('lodash');var utils=require(_0xb355('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xb355('0x1')),'openchannelMessage':require(_0xb355('0x2')),'mailMessage':require(_0xb355('0x3')),'smsMessage':require(_0xb355('0x4')),'faxMessage':require(_0xb355('0x5')),'whatsappMessage':require(_0xb355('0x6'))};exports['consequence']=function(_0x1cc3fd,_0xded67e){return function(_0x418f83){try{var _0x517ef4={'body':utils['getMustacheRender'](_0xded67e[0x0],this),'ContactId':this[_0xb355('0x7')]['id']};if(this[_0xb355('0x8')]===_0xb355('0x9')){_0x517ef4[_0xb355('0xa')]=this[_0xb355('0xb')]['id'];}else{_0x517ef4[_[_0xb355('0xc')](this[_0xb355('0x8')])+'AccountId']=this[_0xb355('0xb')]['id'];}_0x517ef4[_['upperFirst'](this[_0xb355('0x8')])+_0xb355('0xd')]=this[_0xb355('0xe')]['id'];if(rpc[this[_0xb355('0x8')]+_0xb355('0xf')]){return rpc[this[_0xb355('0x8')]+_0xb355('0xf')][_0xb355('0x10')](_0x517ef4)[_0xb355('0x11')](function(_0x3359be){logger[_0xb355('0x12')]('[%s][MESSAGE]\x20%s',_0x1cc3fd,_0x517ef4[_0xb355('0x13')]);_0x418f83[_0xb355('0x14')]();})[_0xb355('0x15')](function(_0x3163be){logger[_0xb355('0x16')](_0xb355('0x17'),_0x1cc3fd,JSON['stringify'](_0x3163be));_0x418f83[_0xb355('0x18')]();});}}catch(_0x48dda9){logger[_0xb355('0x16')]('[%s][MESSAGE]\x20%s',_0x1cc3fd,JSON[_0xb355('0x19')](_0x48dda9));_0x418f83['stop']();}};}; \ No newline at end of file +var _0x6566=['upperFirst','AccountId','Message','info','body','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account'];(function(_0xe7ca6,_0x2f4cc2){var _0xcdc61=function(_0x353bfa){while(--_0x353bfa){_0xe7ca6['push'](_0xe7ca6['shift']());}};_0xcdc61(++_0x2f4cc2);}(_0x6566,0x17a));var _0x6656=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x6566[_0x246115];return _0x385878;};'use strict';var _=require(_0x6656('0x0'));var utils=require(_0x6656('0x1'));var logger=require(_0x6656('0x2'))('routing');var rpc={'chatMessage':require(_0x6656('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6656('0x4')),'smsMessage':require(_0x6656('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x6656('0x6'))};exports[_0x6656('0x7')]=function(_0x2956ab,_0x425862){return function(_0x28abf7){try{var _0x1e944d={'body':utils[_0x6656('0x8')](_0x425862[0x0],this),'ContactId':this['contact']['id']};if(this[_0x6656('0x9')]===_0x6656('0xa')){_0x1e944d[_0x6656('0xb')]=this[_0x6656('0xc')]['id'];}else{_0x1e944d[_[_0x6656('0xd')](this[_0x6656('0x9')])+_0x6656('0xe')]=this[_0x6656('0xc')]['id'];}_0x1e944d[_[_0x6656('0xd')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x6656('0x9')]+_0x6656('0xf')]){return rpc[this[_0x6656('0x9')]+_0x6656('0xf')]['create'](_0x1e944d)['then'](function(_0x2262c0){logger[_0x6656('0x10')]('[%s][MESSAGE]\x20%s',_0x2956ab,_0x1e944d[_0x6656('0x11')]);_0x28abf7['next']();})[_0x6656('0x12')](function(_0x58b690){logger[_0x6656('0x13')](_0x6656('0x14'),_0x2956ab,JSON[_0x6656('0x15')](_0x58b690));_0x28abf7[_0x6656('0x16')]();});}}catch(_0x390e4d){logger[_0x6656('0x13')](_0x6656('0x14'),_0x2956ab,JSON[_0x6656('0x15')](_0x390e4d));_0x28abf7[_0x6656('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index e052733..66e75d1 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 _0x83b3=['[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','info','getMustacheRender','next'];(function(_0x13fc3e,_0x12cd05){var _0x20d27e=function(_0x256334){while(--_0x256334){_0x13fc3e['push'](_0x13fc3e['shift']());}};_0x20d27e(++_0x12cd05);}(_0x83b3,0x13e));var _0x383b=function(_0x286c6f,_0x3d09d7){_0x286c6f=_0x286c6f-0x0;var _0x187692=_0x83b3[_0x286c6f];return _0x187692;};'use strict';var utils=require(_0x383b('0x0'));var logger=require(_0x383b('0x1'))(_0x383b('0x2'));exports['consequence']=function(_0x2e337b,_0xe43270){return function(_0x3174fd){try{logger[_0x383b('0x3')]('[%s][NOOP]\x20%s',_0x2e337b,utils[_0x383b('0x4')](_0xe43270[0x0],this));_0x3174fd[_0x383b('0x5')]();}catch(_0x6622fd){logger['error'](_0x383b('0x6'),_0x2e337b,JSON[_0x383b('0x7')](_0x6622fd));_0x3174fd[_0x383b('0x8')]();}};}; \ No newline at end of file +var _0xba45=['stop','./utils','../../../../config/logger','routing','consequence','info','getMustacheRender','next','stringify'];(function(_0x23707f,_0x471197){var _0x257308=function(_0x5f1f53){while(--_0x5f1f53){_0x23707f['push'](_0x23707f['shift']());}};_0x257308(++_0x471197);}(_0xba45,0xa3));var _0x5ba4=function(_0x452b71,_0x116d84){_0x452b71=_0x452b71-0x0;var _0x511454=_0xba45[_0x452b71];return _0x511454;};'use strict';var utils=require(_0x5ba4('0x0'));var logger=require(_0x5ba4('0x1'))(_0x5ba4('0x2'));exports[_0x5ba4('0x3')]=function(_0x5a5e81,_0x282535){return function(_0x474293){try{logger[_0x5ba4('0x4')]('[%s][NOOP]\x20%s',_0x5a5e81,utils[_0x5ba4('0x5')](_0x282535[0x0],this));_0x474293[_0x5ba4('0x6')]();}catch(_0xb7c97){logger['error']('[%s][NOOP]\x20%s',_0x5a5e81,JSON[_0x5ba4('0x7')](_0xb7c97));_0x474293[_0x5ba4('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 807937b..119348f 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 _0x85d5=['complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','from','emit','clone','queue','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','timeout','[%s][END:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','join','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','stop'];(function(_0x1cb26c,_0x1f72de){var _0x3bf0d0=function(_0x25a9f4){while(--_0x25a9f4){_0x1cb26c['push'](_0x1cb26c['shift']());}};_0x3bf0d0(++_0x1f72de);}(_0x85d5,0x1e2));var _0x585d=function(_0x181591,_0x38ad24){_0x181591=_0x181591-0x0;var _0x492cd4=_0x85d5[_0x181591];return _0x492cd4;};'use strict';var schema=require('validate');var _=require(_0x585d('0x0'));var util=require(_0x585d('0x1'));var seqqueue=require(_0x585d('0x2'));var moment=require(_0x585d('0x3'));var Redis=require(_0x585d('0x4'));var config=require(_0x585d('0x5'));var logger=require(_0x585d('0x6'))(_0x585d('0x7'));var strategy=require(_0x585d('0x8'));config[_0x585d('0x9')]=_['defaults'](config[_0x585d('0x9')],{'host':_0x585d('0xa'),'port':0x18eb});var io=require(_0x585d('0xb'))(new Redis(config[_0x585d('0x9')]));var attributes=['id',_0x585d('0xc'),_0x585d('0xd'),'queue',_0x585d('0xe'),'joinAt'];function emit(_0x25f953,_0x3f8d57,_0x131bae){io['to'](_0x25f953)[_0x585d('0xf')](_0x3f8d57,_0x131bae);}function emitChannelQueueInteraction(_0x50745b,_0x4b96c1,_0x21621b,_0x206aed,_0x6203b8,_0x5a48b7,_0x5f3a68,_0x5b1ddd){var _0x184f9a=_[_0x585d('0x10')](_0x21621b);_0x184f9a[_0x585d('0xc')]=_0x5b1ddd;_0x184f9a[_0x585d('0x11')]=_0x4b96c1;_0x184f9a[_0x585d('0xd')]=_0x206aed;_0x184f9a['id']=_0x6203b8;if(_0x5a48b7){_0x5f3a68[util[_0x585d('0x12')](_0x585d('0x13'),_0x50745b)][_0x6203b8]=_['pick'](_0x184f9a,attributes);}else{delete _0x5f3a68[util[_0x585d('0x12')](_0x585d('0x13'),_0x50745b)][_0x6203b8];}emit(util[_0x585d('0x12')](_0x585d('0x14'),_0x50745b,_0x4b96c1),util[_0x585d('0x12')]('%s_queue_waiting_interaction:%s',_0x50745b,_0x5a48b7?_0x585d('0x15'):_0x585d('0x16')),_[_0x585d('0x17')](_0x184f9a,attributes));}var rpc={'openchannelQueueReport':require(_0x585d('0x18')),'mailQueueReport':require(_0x585d('0x19')),'chatQueueReport':require(_0x585d('0x1a')),'smsQueueReport':require(_0x585d('0x1b')),'faxQueueReport':require(_0x585d('0x1c')),'whatsappQueueReport':require(_0x585d('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x585d('0x1e')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x405a41,_0x1fb0af,_0xfd076f,_0x5e3cf5){if(_0x405a41&&_0x1fb0af&&_0xfd076f){_0x1fb0af[_0x585d('0x1f')]+=0x1;var _0x3f4e50={'uniqueid':_0x405a41,'from':_0xfd076f[_0x585d('0x20')]?_0xfd076f['body'][_0x585d('0xe')]:'','joinAt':moment()[_0x585d('0x12')](_0x585d('0x21')),'ContactId':_0xfd076f[_0x585d('0x22')]?_0xfd076f[_0x585d('0x22')]['id']:null,'ListId':_0xfd076f['list']?_0xfd076f[_0x585d('0x23')]['id']:null};_0x3f4e50[_['upperFirst'](_0xfd076f[_0x585d('0x24')])+_0x585d('0x25')]=_0x1fb0af['id']||null;_0x3f4e50[_[_0x585d('0x26')](_0xfd076f[_0x585d('0x24')])+'InteractionId']=_0xfd076f[_0x585d('0x27')]?_0xfd076f[_0x585d('0x27')]['id']:null;_0x3f4e50[_[_0x585d('0x26')](_0xfd076f[_0x585d('0x24')])+_0x585d('0x28')]=_0xfd076f[_0x585d('0x29')]?_0xfd076f[_0x585d('0x29')]['id']:null;_0x3f4e50[_[_0x585d('0x26')](_0xfd076f[_0x585d('0x24')])+(_0xfd076f[_0x585d('0x24')]!==_0x585d('0x2a')?_0x585d('0x2b'):_0x585d('0x2c'))]=_0xfd076f['account']?_0xfd076f[_0x585d('0xd')]['id']:null;logger[_0x585d('0x2d')](util[_0x585d('0x12')](_0x585d('0x2e'),_0x405a41,_0x1fb0af['name']));emitChannelQueueInteraction(_0xfd076f[_0x585d('0x24')],_0x1fb0af[_0x585d('0x2f')],_0x3f4e50,_0xfd076f[_0x585d('0xd')][_0x585d('0x2f')],_0xfd076f[_0x585d('0x29')]['id'],!![],_0x5e3cf5,_0x1fb0af['id']);if(rpc[_0xfd076f[_0x585d('0x24')]+_0x585d('0x30')]){return rpc[_0xfd076f[_0x585d('0x24')]+_0x585d('0x30')]['create'](_0x3f4e50)[_0x585d('0x31')](function(_0x5eac1f){logger[_0x585d('0x32')]('create\x20queue\x20report');});}}}function stopRouting(_0x18cc06,_0x2a8c4f,_0x4922be,_0x529eef){if(_0x18cc06&&_0x2a8c4f){_0x2a8c4f['waiting']-=0x1;var _0x234ba3={'leaveAt':moment()[_0x585d('0x12')](_0x585d('0x21')),'acceptAt':moment()[_0x585d('0x12')](_0x585d('0x21')),'reason':_0x585d('0x33')};logger['info'](util['format'](_0x585d('0x34'),_0x18cc06,_0x2a8c4f[_0x585d('0x2f')]));emitChannelQueueInteraction(_0x4922be[_0x585d('0x24')],_0x2a8c4f[_0x585d('0x2f')],_0x4922be[_0x585d('0x20')],_0x4922be[_0x585d('0xd')][_0x585d('0x2f')],_0x4922be[_0x585d('0x29')]['id'],![],_0x529eef,_0x2a8c4f['id']);if(rpc[_0x4922be[_0x585d('0x24')]+_0x585d('0x30')]){return rpc[_0x4922be['channel']+_0x585d('0x30')]['update'](_0x18cc06,_0x234ba3)[_0x585d('0x31')](function(_0x3fd177){logger[_0x585d('0x32')]('update\x20queue\x20report');});}}}function endRouting(_0x45b27c,_0x459ea3,_0x508567,_0x69019b){if(_0x45b27c&&_0x459ea3){_0x459ea3[_0x585d('0x1f')]-=0x1;var _0x1db375={'leaveAt':moment()[_0x585d('0x12')](_0x585d('0x21')),'exitAt':moment()['format'](_0x585d('0x21')),'reason':_0x585d('0x35')};logger[_0x585d('0x2d')](util[_0x585d('0x12')](_0x585d('0x36'),_0x45b27c,_0x459ea3['name']));emitChannelQueueInteraction(_0x508567['channel'],_0x459ea3['name'],_0x508567[_0x585d('0x20')],_0x508567['account']['name'],_0x508567['message']['id'],![],_0x69019b);if(rpc[_0x508567[_0x585d('0x24')]+_0x585d('0x30')]){return rpc[_0x508567['channel']+'QueueReport'][_0x585d('0x37')](_0x45b27c,_0x1db375)[_0x585d('0x31')](function(_0x5e8480){logger[_0x585d('0x32')](_0x585d('0x38'));});}}}function handleFindQueue(_0xcba1d){return function(_0x49968e){return _0x49968e[_0x585d('0x2f')][_0x585d('0x39')]()===_0xcba1d[_0x585d('0x39')]();};}exports[_0x585d('0x3a')]=function(_0x52f6f5,_0x3dcda5,_0x5202e3,_0x381e84){return function(_0x2107dd){try{var _0x5913c8={'name':_0x3dcda5[0x0],'timeout':_0x3dcda5[0x1]};var _0xbe005f=queue[_0x585d('0x3b')](_0x5913c8,{'typecast':!![]});if(_0xbe005f[_0x585d('0x3c')]){logger['error'](_0x585d('0x3d'),_0x52f6f5,_['map'](_0xbe005f,_0x585d('0x29'))[_0x585d('0x3e')](',\x20'));_0x2107dd['stop']();}else{var _0x38dda1=_['find'](_0x5202e3[_0x381e84['channel']+'Queues'],handleFindQueue(_0x5913c8['name']));if(_0x38dda1){startRouting(_0x52f6f5,_0x38dda1,_0x381e84,_0x5202e3);var _0x18e8f6=(_0x38dda1[_0x585d('0x35')]||0xa)*0x3e8;var _0x5bb40c=(_0x5913c8['timeout']||0x14)*0x3e8;var _0x1655c7,_0x39da81;if(_0x18e8f6>_0x5bb40c){_0x5bb40c=_0x18e8f6;}var _0x399e68=seqqueue[_0x585d('0x3f')](_0x18e8f6);_0x399e68['id']=_0x52f6f5;_0x399e68[_0x585d('0x40')]=_0x18e8f6;_0x399e68[_0x585d('0x41')]=_0x5bb40c;_0x399e68[_0x585d('0x24')]=_0x381e84[_0x585d('0x24')];_0x5202e3['rules'][_0x52f6f5]['on'](_0x585d('0x42'),function(){logger[_0x585d('0x2d')](_0x585d('0x43'),_0x52f6f5);stopRouting(_0x52f6f5,_0x38dda1,_0x381e84,_0x5202e3);clearTimeout(_0x1655c7);_0x1655c7=undefined;_0x399e68[_0x585d('0x44')](!![]);if(_0x5202e3[_0x585d('0x45')][_0x52f6f5]){delete _0x5202e3['rules'][_0x52f6f5];}_0x2107dd[_0x585d('0x46')]();});_0x5202e3[_0x585d('0x45')][_0x52f6f5]['on'](_0x585d('0x47'),function(){if(_0x5202e3[_0x585d('0x45')][_0x52f6f5]){delete _0x5202e3[_0x585d('0x45')][_0x52f6f5];}});_0x1655c7=setTimeout(function(){logger[_0x585d('0x2d')](_0x585d('0x48'),_0x52f6f5);endRouting(_0x52f6f5,_0x38dda1,_0x381e84,_0x5202e3);clearTimeout(_0x1655c7);_0x399e68[_0x585d('0x44')](!![]);_0x2107dd[_0x585d('0x49')]();},_0x5bb40c);switch(_0x38dda1[_0x585d('0x4a')]){case'rrmemory':strategy[_0x585d('0x4b')](_0x399e68,_0x38dda1,_0x5202e3,_0x381e84);break;default:strategy[_0x585d('0x4c')](_0x399e68,_0x38dda1,_0x5202e3,_0x381e84);}}else{logger[_0x585d('0x32')](_0x585d('0x4d'),_0x52f6f5,_0x5913c8['name']);_0x2107dd[_0x585d('0x46')]();}}}catch(_0x4c59cd){console[_0x585d('0x4e')](_0x4c59cd);logger[_0x585d('0x32')](_0x585d('0x3d'),_0x52f6f5,_0x4c59cd['stack']);_0x2107dd[_0x585d('0x46')]();}};}; \ No newline at end of file +var _0x7e70=['lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','queue_id','account','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','QueueId','channel','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','map','join','stop','find','Queues','createQueue','qtimeout','rules','end','close','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack'];(function(_0x5d90b8,_0x71f07d){var _0x14408f=function(_0x11f22f){while(--_0x11f22f){_0x5d90b8['push'](_0x5d90b8['shift']());}};_0x14408f(++_0x71f07d);}(_0x7e70,0x98));var _0x07e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e70[_0x14add3];return _0x4a174f;};'use strict';var schema=require('validate');var _=require(_0x07e7('0x0'));var util=require(_0x07e7('0x1'));var seqqueue=require(_0x07e7('0x2'));var moment=require(_0x07e7('0x3'));var Redis=require(_0x07e7('0x4'));var config=require(_0x07e7('0x5'));var logger=require('../../../../config/logger')(_0x07e7('0x6'));var strategy=require(_0x07e7('0x7'));config[_0x07e7('0x8')]=_[_0x07e7('0x9')](config['redis'],{'host':_0x07e7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x07e7('0xb'),_0x07e7('0xc'),'queue','from',_0x07e7('0xd')];function emit(_0xc98bee,_0x7d30c8,_0x139ab2){io['to'](_0xc98bee)[_0x07e7('0xe')](_0x7d30c8,_0x139ab2);}function emitChannelQueueInteraction(_0x3d3f37,_0x4d1255,_0xfe1f5d,_0x567704,_0x117aa7,_0x1de317,_0x5a804f,_0x22a176){var _0x1c83b2=_[_0x07e7('0xf')](_0xfe1f5d);_0x1c83b2[_0x07e7('0xb')]=_0x22a176;_0x1c83b2[_0x07e7('0x10')]=_0x4d1255;_0x1c83b2['account']=_0x567704;_0x1c83b2['id']=_0x117aa7;if(_0x1de317){_0x5a804f[util[_0x07e7('0x11')](_0x07e7('0x12'),_0x3d3f37)][_0x117aa7]=_['pick'](_0x1c83b2,attributes);}else{delete _0x5a804f[util[_0x07e7('0x11')](_0x07e7('0x12'),_0x3d3f37)][_0x117aa7];}emit(util[_0x07e7('0x11')](_0x07e7('0x13'),_0x3d3f37,_0x4d1255),util[_0x07e7('0x11')](_0x07e7('0x14'),_0x3d3f37,_0x1de317?'save':_0x07e7('0x15')),_[_0x07e7('0x16')](_0x1c83b2,attributes));}var rpc={'openchannelQueueReport':require(_0x07e7('0x17')),'mailQueueReport':require(_0x07e7('0x18')),'chatQueueReport':require(_0x07e7('0x19')),'smsQueueReport':require(_0x07e7('0x1a')),'faxQueueReport':require(_0x07e7('0x1b')),'whatsappQueueReport':require(_0x07e7('0x1c'))};var queue=schema({'name':{'type':_0x07e7('0x1d'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x07e7('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x137efb,_0x17e7b1,_0x51d2e5,_0x2d67a8){if(_0x137efb&&_0x17e7b1&&_0x51d2e5){_0x17e7b1[_0x07e7('0x1f')]+=0x1;var _0x4aa5fe={'uniqueid':_0x137efb,'from':_0x51d2e5[_0x07e7('0x20')]?_0x51d2e5[_0x07e7('0x20')][_0x07e7('0x21')]:'','joinAt':moment()[_0x07e7('0x11')](_0x07e7('0x22')),'ContactId':_0x51d2e5['contact']?_0x51d2e5['contact']['id']:null,'ListId':_0x51d2e5['list']?_0x51d2e5[_0x07e7('0x23')]['id']:null};_0x4aa5fe[_[_0x07e7('0x24')](_0x51d2e5['channel'])+_0x07e7('0x25')]=_0x17e7b1['id']||null;_0x4aa5fe[_['upperFirst'](_0x51d2e5[_0x07e7('0x26')])+'InteractionId']=_0x51d2e5['interaction']?_0x51d2e5['interaction']['id']:null;_0x4aa5fe[_[_0x07e7('0x24')](_0x51d2e5[_0x07e7('0x26')])+'MessageId']=_0x51d2e5[_0x07e7('0x27')]?_0x51d2e5[_0x07e7('0x27')]['id']:null;_0x4aa5fe[_[_0x07e7('0x24')](_0x51d2e5['channel'])+(_0x51d2e5[_0x07e7('0x26')]!==_0x07e7('0x28')?_0x07e7('0x29'):_0x07e7('0x2a'))]=_0x51d2e5['account']?_0x51d2e5[_0x07e7('0xc')]['id']:null;logger[_0x07e7('0x2b')](util['format'](_0x07e7('0x2c'),_0x137efb,_0x17e7b1[_0x07e7('0x2d')]));emitChannelQueueInteraction(_0x51d2e5[_0x07e7('0x26')],_0x17e7b1['name'],_0x4aa5fe,_0x51d2e5[_0x07e7('0xc')]['name'],_0x51d2e5[_0x07e7('0x27')]['id'],!![],_0x2d67a8,_0x17e7b1['id']);if(rpc[_0x51d2e5[_0x07e7('0x26')]+_0x07e7('0x2e')]){return rpc[_0x51d2e5[_0x07e7('0x26')]+_0x07e7('0x2e')][_0x07e7('0x2f')](_0x4aa5fe)[_0x07e7('0x30')](function(_0x2ab03b){logger[_0x07e7('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x22c34d,_0x32b580,_0x33b8b6,_0x4c9f3d){if(_0x22c34d&&_0x32b580){_0x32b580[_0x07e7('0x1f')]-=0x1;var _0x2caca7={'leaveAt':moment()[_0x07e7('0x11')](_0x07e7('0x22')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x07e7('0x32')};logger[_0x07e7('0x2b')](util[_0x07e7('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x22c34d,_0x32b580[_0x07e7('0x2d')]));emitChannelQueueInteraction(_0x33b8b6['channel'],_0x32b580[_0x07e7('0x2d')],_0x33b8b6[_0x07e7('0x20')],_0x33b8b6[_0x07e7('0xc')][_0x07e7('0x2d')],_0x33b8b6[_0x07e7('0x27')]['id'],![],_0x4c9f3d,_0x32b580['id']);if(rpc[_0x33b8b6[_0x07e7('0x26')]+_0x07e7('0x2e')]){return rpc[_0x33b8b6['channel']+_0x07e7('0x2e')][_0x07e7('0x33')](_0x22c34d,_0x2caca7)['catch'](function(_0x216be7){logger['error'](_0x07e7('0x34'));});}}}function endRouting(_0x49edfb,_0x98628f,_0x5c6738,_0x482ce2){if(_0x49edfb&&_0x98628f){_0x98628f[_0x07e7('0x1f')]-=0x1;var _0x35f006={'leaveAt':moment()['format'](_0x07e7('0x22')),'exitAt':moment()[_0x07e7('0x11')](_0x07e7('0x22')),'reason':_0x07e7('0x35')};logger[_0x07e7('0x2b')](util['format'](_0x07e7('0x36'),_0x49edfb,_0x98628f[_0x07e7('0x2d')]));emitChannelQueueInteraction(_0x5c6738['channel'],_0x98628f['name'],_0x5c6738[_0x07e7('0x20')],_0x5c6738[_0x07e7('0xc')][_0x07e7('0x2d')],_0x5c6738['message']['id'],![],_0x482ce2);if(rpc[_0x5c6738[_0x07e7('0x26')]+'QueueReport']){return rpc[_0x5c6738[_0x07e7('0x26')]+_0x07e7('0x2e')][_0x07e7('0x33')](_0x49edfb,_0x35f006)[_0x07e7('0x30')](function(_0x2e540a){logger[_0x07e7('0x31')](_0x07e7('0x34'));});}}}function handleFindQueue(_0x1e81f1){return function(_0x3d6e3e){return _0x3d6e3e[_0x07e7('0x2d')][_0x07e7('0x37')]()===_0x1e81f1[_0x07e7('0x37')]();};}exports[_0x07e7('0x38')]=function(_0x1c16d9,_0x1bbb6b,_0x4b1711,_0xf31352){return function(_0x409471){try{var _0x127cf8={'name':_0x1bbb6b[0x0],'timeout':_0x1bbb6b[0x1]};var _0x468226=queue[_0x07e7('0x39')](_0x127cf8,{'typecast':!![]});if(_0x468226[_0x07e7('0x3a')]){logger[_0x07e7('0x31')]('[%s][QUEUE]\x20%s',_0x1c16d9,_[_0x07e7('0x3b')](_0x468226,_0x07e7('0x27'))[_0x07e7('0x3c')](',\x20'));_0x409471[_0x07e7('0x3d')]();}else{var _0xcf8e73=_[_0x07e7('0x3e')](_0x4b1711[_0xf31352[_0x07e7('0x26')]+_0x07e7('0x3f')],handleFindQueue(_0x127cf8[_0x07e7('0x2d')]));if(_0xcf8e73){startRouting(_0x1c16d9,_0xcf8e73,_0xf31352,_0x4b1711);var _0x514bb2=(_0xcf8e73[_0x07e7('0x35')]||0xa)*0x3e8;var _0x414c65=(_0x127cf8[_0x07e7('0x35')]||0x14)*0x3e8;var _0x1e7303,_0x23236c;if(_0x514bb2>_0x414c65){_0x414c65=_0x514bb2;}var _0x3a5452=seqqueue[_0x07e7('0x40')](_0x514bb2);_0x3a5452['id']=_0x1c16d9;_0x3a5452['atimeout']=_0x514bb2;_0x3a5452[_0x07e7('0x41')]=_0x414c65;_0x3a5452['channel']=_0xf31352[_0x07e7('0x26')];_0x4b1711[_0x07e7('0x42')][_0x1c16d9]['on'](_0x07e7('0x43'),function(){logger[_0x07e7('0x2b')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1c16d9);stopRouting(_0x1c16d9,_0xcf8e73,_0xf31352,_0x4b1711);clearTimeout(_0x1e7303);_0x1e7303=undefined;_0x3a5452[_0x07e7('0x44')](!![]);if(_0x4b1711[_0x07e7('0x42')][_0x1c16d9]){delete _0x4b1711[_0x07e7('0x42')][_0x1c16d9];}_0x409471['stop']();});_0x4b1711['rules'][_0x1c16d9]['on']('complete',function(){if(_0x4b1711['rules'][_0x1c16d9]){delete _0x4b1711['rules'][_0x1c16d9];}});_0x1e7303=setTimeout(function(){logger[_0x07e7('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x1c16d9);endRouting(_0x1c16d9,_0xcf8e73,_0xf31352,_0x4b1711);clearTimeout(_0x1e7303);_0x3a5452[_0x07e7('0x44')](!![]);_0x409471[_0x07e7('0x45')]();},_0x414c65);switch(_0xcf8e73['strategy']){case'rrmemory':strategy[_0x07e7('0x46')](_0x3a5452,_0xcf8e73,_0x4b1711,_0xf31352);break;default:strategy[_0x07e7('0x47')](_0x3a5452,_0xcf8e73,_0x4b1711,_0xf31352);}}else{logger['error'](_0x07e7('0x48'),_0x1c16d9,_0x127cf8[_0x07e7('0x2d')]);_0x409471[_0x07e7('0x3d')]();}}}catch(_0xdc4db1){console[_0x07e7('0x49')](_0xdc4db1);logger[_0x07e7('0x31')](_0x07e7('0x4a'),_0x1c16d9,_0xdc4db1[_0x07e7('0x4b')]);_0x409471[_0x07e7('0x3d')]();}};}; \ 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 343e03a..890b7da 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 _0xe7f9=['push','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId','agent','realtime','bind','handleTimeout','squeue','timeout','drained','handleDrained','prototype'];(function(_0x14806a,_0x14d122){var _0x12e125=function(_0x7e370e){while(--_0x7e370e){_0x14806a['push'](_0x14806a['shift']());}};_0x12e125(++_0x14d122);}(_0xe7f9,0x1c1));var _0x9e7f=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0xe7f9[_0x3d27ba];return _0xf01885;};'use strict';var _=require('lodash');var uuid=require(_0x9e7f('0x0'));var util=require(_0x9e7f('0x1'));var logger=require('../../../../../config/logger')(_0x9e7f('0x2'));var Agent=function(_0x7b7ae9,_0x21b70e,_0x3cba31,_0x11aded){this[_0x9e7f('0x3')]=uuid['v4']();this['squeue']=_0x7b7ae9;this[_0x9e7f('0x4')]=_0x21b70e;this[_0x9e7f('0x5')]=_0x3cba31;this['routing']=_0x11aded;this['squeue']['push'](this['handleRun'][_0x9e7f('0x6')](this),this[_0x9e7f('0x7')][_0x9e7f('0x6')](this));this[_0x9e7f('0x8')]['on'](_0x9e7f('0x9'),this['handleTimeout'][_0x9e7f('0x6')](this));this[_0x9e7f('0x8')]['on'](_0x9e7f('0xa'),this[_0x9e7f('0xb')][_0x9e7f('0x6')](this));};Agent[_0x9e7f('0xc')][_0x9e7f('0xd')]=function(){this[_0x9e7f('0x8')][_0x9e7f('0xd')](this[_0x9e7f('0xe')]['bind'](this),this['handleTimeout'][_0x9e7f('0x6')](this));};Agent['prototype'][_0x9e7f('0xb')]=function(){this[_0x9e7f('0x7')](!![]);};Agent[_0x9e7f('0xc')][_0x9e7f('0xe')]=function(_0x1c06d6){logger[_0x9e7f('0xf')](_0x9e7f('0x10'),this[_0x9e7f('0x8')]['id'],this[_0x9e7f('0x4')]['id']);if(_[_0x9e7f('0x11')](this['realtime'][_0x9e7f('0x12')][this[_0x9e7f('0x4')]['id']])){logger[_0x9e7f('0xf')](_0x9e7f('0x13'),this[_0x9e7f('0x8')]['id'],this[_0x9e7f('0x4')]['id']);setTimeout(this['push'][_0x9e7f('0x6')](this),0x3e8);}else{if(this[_0x9e7f('0x2')][_0x9e7f('0x14')]||util[_0x9e7f('0x15')](this['squeue']['id'],this[_0x9e7f('0x5')][_0x9e7f('0x12')][this[_0x9e7f('0x4')]['id']],this[_0x9e7f('0x8')]['channel'],![])){this[_0x9e7f('0x5')]['agents'][this[_0x9e7f('0x4')]['id']][_0x9e7f('0x16')]=!![];this[_0x9e7f('0x5')][_0x9e7f('0x12')][this['agent']['id']][_0x9e7f('0x17')]=undefined;util[_0x9e7f('0x18')](this[_0x9e7f('0x3')],this[_0x9e7f('0x8')]['id'],this[_0x9e7f('0x5')]['agents'][this[_0x9e7f('0x4')]['id']],null,this[_0x9e7f('0x2')]);util[_0x9e7f('0x19')](this[_0x9e7f('0x8')]['id'],this['realtime']['agents'][this[_0x9e7f('0x4')]['id']],_0x9e7f('0x1a')+(this[_0x9e7f('0x2')][_0x9e7f('0x14')]?_0x9e7f('0x1b'):''));}else{logger[_0x9e7f('0xf')](_0x9e7f('0x1c'),this['squeue']['id'],this[_0x9e7f('0x4')]['id']);setTimeout(this[_0x9e7f('0xd')][_0x9e7f('0x6')](this),0x3e8);}}};Agent[_0x9e7f('0xc')][_0x9e7f('0x7')]=function(_0xac27ec){if(_['isNil'](this[_0x9e7f('0x5')]['agents'][this[_0x9e7f('0x4')]['id']])){return logger[_0x9e7f('0xf')](_0x9e7f('0x13'),this[_0x9e7f('0x8')]['id'],this['agent']['id']);}else{logger[_0x9e7f('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x9e7f('0x4')]['id']);util[_0x9e7f('0x1d')](this['notificationId'],this[_0x9e7f('0x8')]['id'],this['realtime'][_0x9e7f('0x12')][this['agent']['id']],null,this['routing']);this[_0x9e7f('0x5')][_0x9e7f('0x12')][this[_0x9e7f('0x4')]['id']]['busy']=![];this[_0x9e7f('0x5')][_0x9e7f('0x12')][this[_0x9e7f('0x4')]['id']][_0x9e7f('0x17')]=undefined;util['writeLog'](this[_0x9e7f('0x8')]['id'],this[_0x9e7f('0x5')][_0x9e7f('0x12')][this['agent']['id']],_0xac27ec?_0x9e7f('0x1e'):_0x9e7f('0x1f'));}if(!_0xac27ec){setTimeout(this[_0x9e7f('0xd')][_0x9e7f('0x6')](this),0x3e8);}};function agent(_0x43c96f,_0x25d50e,_0xc5abd2,_0x39d8e7){return new Agent(_0x43c96f,_0x25d50e,_0xc5abd2,_0x39d8e7);}module[_0x9e7f('0x20')]=agent; \ No newline at end of file +var _0x57f2=['agent','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x12a426,_0x4a8112){var _0x11a509=function(_0x2df2ff){while(--_0x2df2ff){_0x12a426['push'](_0x12a426['shift']());}};_0x11a509(++_0x4a8112);}(_0x57f2,0xad));var _0x257f=function(_0x3d22b9,_0x4f6a71){_0x3d22b9=_0x3d22b9-0x0;var _0x21baa9=_0x57f2[_0x3d22b9];return _0x21baa9;};'use strict';var _=require(_0x257f('0x0'));var uuid=require(_0x257f('0x1'));var util=require(_0x257f('0x2'));var logger=require(_0x257f('0x3'))(_0x257f('0x4'));var Agent=function(_0x3a3bfb,_0x48134e,_0x552895,_0x20db55){this[_0x257f('0x5')]=uuid['v4']();this[_0x257f('0x6')]=_0x3a3bfb;this[_0x257f('0x7')]=_0x48134e;this[_0x257f('0x8')]=_0x552895;this['routing']=_0x20db55;this[_0x257f('0x6')][_0x257f('0x9')](this[_0x257f('0xa')][_0x257f('0xb')](this),this[_0x257f('0xc')][_0x257f('0xb')](this));this[_0x257f('0x6')]['on'](_0x257f('0xd'),this[_0x257f('0xc')][_0x257f('0xb')](this));this[_0x257f('0x6')]['on']('drained',this[_0x257f('0xe')][_0x257f('0xb')](this));};Agent[_0x257f('0xf')][_0x257f('0x9')]=function(){this[_0x257f('0x6')][_0x257f('0x9')](this[_0x257f('0xa')][_0x257f('0xb')](this),this[_0x257f('0xc')][_0x257f('0xb')](this));};Agent[_0x257f('0xf')][_0x257f('0xe')]=function(){this[_0x257f('0xc')](!![]);};Agent[_0x257f('0xf')][_0x257f('0xa')]=function(_0x27cb64){logger[_0x257f('0x10')](_0x257f('0x11'),this['squeue']['id'],this[_0x257f('0x7')]['id']);if(_[_0x257f('0x12')](this[_0x257f('0x8')][_0x257f('0x13')][this[_0x257f('0x7')]['id']])){logger[_0x257f('0x10')](_0x257f('0x14'),this[_0x257f('0x6')]['id'],this[_0x257f('0x7')]['id']);setTimeout(this['push'][_0x257f('0xb')](this),0x3e8);}else{if(this[_0x257f('0x4')][_0x257f('0x15')]||util[_0x257f('0x16')](this[_0x257f('0x6')]['id'],this['realtime'][_0x257f('0x13')][this[_0x257f('0x7')]['id']],this['squeue'][_0x257f('0x17')],![])){this['realtime'][_0x257f('0x13')][this[_0x257f('0x7')]['id']][_0x257f('0x18')]=!![];this[_0x257f('0x8')]['agents'][this[_0x257f('0x7')]['id']][_0x257f('0x19')]=undefined;util[_0x257f('0x1a')](this[_0x257f('0x5')],this['squeue']['id'],this[_0x257f('0x8')][_0x257f('0x13')][this['agent']['id']],null,this[_0x257f('0x4')]);util[_0x257f('0x1b')](this[_0x257f('0x6')]['id'],this[_0x257f('0x8')]['agents'][this[_0x257f('0x7')]['id']],_0x257f('0x1c')+(this[_0x257f('0x4')]['forcedOwnership']?_0x257f('0x1d'):''));}else{logger[_0x257f('0x10')](_0x257f('0x1e'),this[_0x257f('0x6')]['id'],this[_0x257f('0x7')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x257f('0xf')][_0x257f('0xc')]=function(_0x5ed5ca){if(_['isNil'](this['realtime']['agents'][this[_0x257f('0x7')]['id']])){return logger[_0x257f('0x10')](_0x257f('0x14'),this[_0x257f('0x6')]['id'],this[_0x257f('0x7')]['id']);}else{logger[_0x257f('0x10')](_0x257f('0x1f'),this[_0x257f('0x6')]['id'],this[_0x257f('0x7')]['id']);util[_0x257f('0x20')](this[_0x257f('0x5')],this[_0x257f('0x6')]['id'],this[_0x257f('0x8')]['agents'][this[_0x257f('0x7')]['id']],null,this['routing']);this[_0x257f('0x8')][_0x257f('0x13')][this[_0x257f('0x7')]['id']]['busy']=![];this[_0x257f('0x8')]['agents'][this[_0x257f('0x7')]['id']][_0x257f('0x19')]=undefined;util[_0x257f('0x1b')](this[_0x257f('0x6')]['id'],this['realtime'][_0x257f('0x13')][this[_0x257f('0x7')]['id']],_0x5ed5ca?_0x257f('0x21'):_0x257f('0x22'));}if(!_0x5ed5ca){setTimeout(this['push'][_0x257f('0xb')](this),0x3e8);}};function agent(_0x578071,_0x3429e7,_0x35f572,_0x292b95){return new Agent(_0x578071,_0x3429e7,_0x35f572,_0x292b95);}module[_0x257f('0x23')]=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 b328a25..c89d606 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 _0x4006=['isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','uuid','./util','../../../../../config/logger','routing','notificationId','realtime','squeue','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','Agents','queue','length','agents','info'];(function(_0x5ac1fe,_0x58d862){var _0x4bc32d=function(_0x49e4fb){while(--_0x49e4fb){_0x5ac1fe['push'](_0x5ac1fe['shift']());}};_0x4bc32d(++_0x58d862);}(_0x4006,0x1c7));var _0x6400=function(_0x475dce,_0x1754ff){_0x475dce=_0x475dce-0x0;var _0x40687a=_0x4006[_0x475dce];return _0x40687a;};'use strict';var _=require('lodash');var uuid=require(_0x6400('0x0'));var util=require(_0x6400('0x1'));var logger=require(_0x6400('0x2'))(_0x6400('0x3'));var Beepall=function(_0x5c8ece,_0x4b7a00,_0xee0578,_0x4b0418){this[_0x6400('0x4')]=uuid['v4']();this['squeue']=_0x5c8ece;this['queue']=_0x4b7a00;this[_0x6400('0x5')]=_0xee0578;this['routing']=_0x4b0418;this[_0x6400('0x6')][_0x6400('0x7')](this[_0x6400('0x8')][_0x6400('0x9')](this),this['handleTimeout'][_0x6400('0x9')](this));this[_0x6400('0x6')]['on'](_0x6400('0xa'),this[_0x6400('0xb')][_0x6400('0x9')](this));this[_0x6400('0x6')]['on'](_0x6400('0xc'),this[_0x6400('0xd')][_0x6400('0x9')](this));};Beepall[_0x6400('0xe')][_0x6400('0x7')]=function(){this['squeue'][_0x6400('0x7')](this[_0x6400('0x8')][_0x6400('0x9')](this),this[_0x6400('0xb')]['bind'](this));};Beepall[_0x6400('0xe')][_0x6400('0xd')]=function(_0x4ed062){this['handleTimeout'](!![]);};Beepall['prototype'][_0x6400('0x8')]=function(_0x18c2e3){var _0x5b0492=!![];if(!_[_0x6400('0xf')](this['queue'])&&!_[_0x6400('0xf')](this['queue'][_0x6400('0x10')])&&this[_0x6400('0x11')][_0x6400('0x10')][_0x6400('0x12')]>0x0){for(var _0x49d412=0x0,_0x444bce;_0x49d4120x0){for(var _0x37f297=0x0,_0x43d4b8;_0x37f2970x0&&_0x2be467[_0x6ae00c+_0x6549('0x22')]>=_0x2be467[_0x6ae00c+_0x6549('0x21')]){writeLog(_0x25bc01,_0x2be467,_0x6ae00c[_0x6549('0x23')]()+_0x6549('0x24'));return![];}}return!![];};exports[_0x6549('0x25')]=function(_0x2f58f7,_0xa6c718,_0x4c52f1,_0x1794bc,_0x136518){return sendNotification(!![],_0x2f58f7,_0xa6c718,_0x4c52f1,_0x1794bc,_0x136518);};exports[_0x6549('0x26')]=function(_0x4c605c,_0x3f1502,_0x4acaf5,_0x4f0ad1,_0x5aa3a6){return sendNotification(![],_0x4c605c,_0x3f1502,_0x4acaf5,_0x4f0ad1,_0x5aa3a6);};exports[_0x6549('0x27')]=writeLog; \ No newline at end of file +var _0x326f=['CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','split','\x20interaction','name','notificationSound','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','info','isAgentAvailable','busy','BUSY','online','OFFLINE','Capacity','hasOwnProperty'];(function(_0xaf5663,_0xed307){var _0x5daf19=function(_0x34030c){while(--_0x34030c){_0xaf5663['push'](_0xaf5663['shift']());}};_0x5daf19(++_0xed307);}(_0x326f,0xd1));var _0xf326=function(_0xf2a36e,_0x1ba6b9){_0xf2a36e=_0xf2a36e-0x0;var _0x49b6f1=_0x326f[_0xf2a36e];return _0x49b6f1;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var config=require(_0xf326('0x3'));var logger=require(_0xf326('0x4'))(_0xf326('0x5'));config[_0xf326('0x6')]=_[_0xf326('0x7')](config[_0xf326('0x6')],{'host':_0xf326('0x8'),'port':0x18eb});var io=require(_0xf326('0x9'))(new Redis(config['redis']));function emit(_0x3c254d,_0x3851eb,_0x165f95){io['to'](_0x3c254d)[_0xf326('0xa')](_0x3851eb,_0x165f95);}function sendNotification(_0x515bfa,_0x4c206c,_0x592975,_0x3bacf2,_0x1fc80e,_0x163416){io['to'](util[_0xf326('0xb')](_0xf326('0xc'),_0x3bacf2['name']))[_0xf326('0xa')]('user:save',_0x3bacf2);var _0x1cf441=_0x163416||{};var _0x4aaf3a=_0x592975[_0xf326('0xd')]('.');var _0x518ab5={'uniqueid':_0x4c206c,'channel':_0x4aaf3a[0x0],'id':_0x4aaf3a[0x1],'title':_0x4aaf3a[0x0]+_0xf326('0xe'),'interactionId':_0x4aaf3a[0x2],'queue':_0x1fc80e?_0x1fc80e[_0xf326('0xf')]:null,'sound':_0x1cf441['account'][_0xf326('0x10')],'shake':_0x1cf441[_0xf326('0x11')][_0xf326('0x12')]};try{if(!_0x1cf441[_0xf326('0x13')]){_0x1cf441['body']={};}if(_0x1fc80e){_0x1cf441[_0xf326('0x13')]['queue']=_0x1fc80e;}else if(_0x1cf441['body'][_0xf326('0x14')]){delete _0x1cf441[_0xf326('0x13')][_0xf326('0x14')];}_0x518ab5[_0xf326('0x15')]=utils[_0xf326('0x16')](_0x1cf441[_0xf326('0x11')][_0xf326('0x17')],_0x1cf441);}catch(_0x2cf2ca){_0x518ab5['msg']=_0xf326('0x18');logger[_0xf326('0x19')](util[_0xf326('0xb')](_0xf326('0x1a'),_0x4c206c,_0x2cf2ca[_0xf326('0x1b')]));}io['to'](util[_0xf326('0xb')]('user:%s',_0x3bacf2['name']))['emit'](util[_0xf326('0xb')](_0xf326('0x1c'),_0x515bfa?'save':'remove'),_0x518ab5);}function writeLog(_0x128c68,_0x4dfa76,_0x5b6d3c){return logger[_0xf326('0x1d')](util[_0xf326('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x128c68,_0x4dfa76['name'],_0x5b6d3c));}exports[_0xf326('0x1e')]=function(_0xb1efcf,_0x5f21a2,_0x337ed5,_0x1b9039){if(_0x5f21a2[_0xf326('0x1f')]){writeLog(_0xb1efcf,_0x5f21a2,_0xf326('0x20'));return![];}if(!_0x5f21a2[_0xf326('0x21')]){writeLog(_0xb1efcf,_0x5f21a2,_0xf326('0x22'));return![];}if(_0x5f21a2[_0x337ed5+'Pause']){writeLog(_0xb1efcf,_0x5f21a2,'PAUSE');return![];}if(_0x1b9039&&_0x5f21a2['hasOwnProperty'](_0x337ed5+_0xf326('0x23'))&&_0x5f21a2[_0xf326('0x24')](_0x337ed5+_0xf326('0x25'))){if(_0x5f21a2[_0x337ed5+_0xf326('0x23')]>0x0&&_0x5f21a2[_0x337ed5+_0xf326('0x25')]>=_0x5f21a2[_0x337ed5+_0xf326('0x23')]){writeLog(_0xb1efcf,_0x5f21a2,_0x337ed5['toUpperCase']()+_0xf326('0x26'));return![];}}return!![];};exports[_0xf326('0x27')]=function(_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf){return sendNotification(!![],_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf);};exports[_0xf326('0x28')]=function(_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500){return sendNotification(![],_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 1a5a7bd..24ebeb1 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 _0xf14b=['[%s][SYSTEM]\x20no\x20variable','body','next','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty'];(function(_0x3bfdd6,_0x3ce72d){var _0x2a5c32=function(_0x15e09b){while(--_0x15e09b){_0x3bfdd6['push'](_0x3bfdd6['shift']());}};_0x2a5c32(++_0x3ce72d);}(_0xf14b,0xdd));var _0xbf14=function(_0x840106,_0x59c538){_0x840106=_0x840106-0x0;var _0x41edcd=_0xf14b[_0x840106];return _0x41edcd;};'use strict';var schema=require(_0xbf14('0x0'));var sh=require(_0xbf14('0x1'));var _=require(_0xbf14('0x2'));var utils=require(_0xbf14('0x3'));var logger=require(_0xbf14('0x4'))(_0xbf14('0x5'));var system=schema({'command':{'type':_0xbf14('0x6'),'required':!![],'message':_0xbf14('0x7')}});exports[_0xbf14('0x8')]=function(_0x3afb15,_0x52d8f7){return function(_0xe00320){try{var _0xb9333b={'command':_0x52d8f7[0x0]};var _0x1b6462=system[_0xbf14('0x0')](_0xb9333b,{'typecast':!![]});if(_0x1b6462[_0xbf14('0x9')]){logger[_0xbf14('0xa')](_0xbf14('0xb'),_0x3afb15,_['map'](_0x1b6462,_0xbf14('0xc'))[_0xbf14('0xd')](',\x20'));logger[_0xbf14('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3afb15);_0xe00320['next']();}else{var _0x63b2b6=this;var _0x3d41a4=utils[_0xbf14('0xf')](_0x52d8f7[0x0],this);logger[_0xbf14('0xe')](_0xbf14('0x10'),_0x3afb15,_0x3d41a4);sh[_0xbf14('0x11')](_['trim'](_0x3d41a4),function(_0x5f1e07,_0x489c04){logger[_0xbf14('0xe')](_0xbf14('0x12'),_0x3afb15,_0x5f1e07);if(_0x5f1e07==0x0){var _0x27d669=_0x489c04[_0xbf14('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xbf14('0x14')](_0x52d8f7[0x1])||_[_0xbf14('0x15')](_0x52d8f7[0x1])){logger[_0xbf14('0xe')](_0xbf14('0x16'),_0x3afb15);_0x63b2b6[_0xbf14('0x17')][_0x52d8f7[0x1]]=_0x27d669;}else{logger[_0xbf14('0xe')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x3afb15,_0x52d8f7[0x1],_0x27d669);_0x63b2b6[_0xbf14('0x17')][_0x52d8f7[0x1]]=_0x27d669;}}_0xe00320[_0xbf14('0x18')]();});}}catch(_0x347e06){logger['error'](_0xbf14('0xb'),_0x3afb15,_[_0xbf14('0x19')](_0x347e06)?JSON['stringify'](_0x347e06):_0x347e06);logger[_0xbf14('0xe')](_0xbf14('0x1a'),_0x3afb15);_0xe00320[_0xbf14('0x18')]();}};}; \ No newline at end of file +var _0x534d=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x534d,0x79));var _0xd534=function(_0x57e95b,_0x36d240){_0x57e95b=_0x57e95b-0x0;var _0x3ffe0d=_0x534d[_0x57e95b];return _0x3ffe0d;};'use strict';var schema=require(_0xd534('0x0'));var sh=require(_0xd534('0x1'));var _=require(_0xd534('0x2'));var utils=require(_0xd534('0x3'));var logger=require(_0xd534('0x4'))(_0xd534('0x5'));var system=schema({'command':{'type':_0xd534('0x6'),'required':!![],'message':_0xd534('0x7')}});exports[_0xd534('0x8')]=function(_0x278f6b,_0x22f84a){return function(_0x268f12){try{var _0x2e9c44={'command':_0x22f84a[0x0]};var _0x2ebe36=system[_0xd534('0x0')](_0x2e9c44,{'typecast':!![]});if(_0x2ebe36[_0xd534('0x9')]){logger[_0xd534('0xa')](_0xd534('0xb'),_0x278f6b,_[_0xd534('0xc')](_0x2ebe36,'message')[_0xd534('0xd')](',\x20'));logger[_0xd534('0xe')](_0xd534('0xf'),_0x278f6b);_0x268f12[_0xd534('0x10')]();}else{var _0x28eeed=this;var _0x4a8c5a=utils[_0xd534('0x11')](_0x22f84a[0x0],this);logger[_0xd534('0xe')](_0xd534('0x12'),_0x278f6b,_0x4a8c5a);sh[_0xd534('0x13')](_[_0xd534('0x14')](_0x4a8c5a),function(_0x3f3c89,_0x225f22){logger[_0xd534('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x278f6b,_0x3f3c89);if(_0x3f3c89==0x0){var _0x518e7d=_0x225f22[_0xd534('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0xd534('0x16')](_0x22f84a[0x1])||_[_0xd534('0x17')](_0x22f84a[0x1])){logger[_0xd534('0xe')](_0xd534('0x18'),_0x278f6b);_0x28eeed[_0xd534('0x19')][_0x22f84a[0x1]]=_0x518e7d;}else{logger[_0xd534('0xe')](_0xd534('0x1a'),_0x278f6b,_0x22f84a[0x1],_0x518e7d);_0x28eeed[_0xd534('0x19')][_0x22f84a[0x1]]=_0x518e7d;}}_0x268f12[_0xd534('0x10')]();});}}catch(_0x502c61){logger['error'](_0xd534('0xb'),_0x278f6b,_[_0xd534('0x1b')](_0x502c61)?JSON[_0xd534('0x1c')](_0x502c61):_0x502c61);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x278f6b);_0x268f12[_0xd534('0x10')]();}};}; \ 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 8e1105e..e951cae 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 _0x07e9=['number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','info','next','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0x3034ce,_0x1421b6){var _0x4bc0e3=function(_0x49a5ca){while(--_0x49a5ca){_0x3034ce['push'](_0x3034ce['shift']());}};_0x4bc0e3(++_0x1421b6);}(_0x07e9,0x1dd));var _0x907e=function(_0x18a57b,_0x25907a){_0x18a57b=_0x18a57b-0x0;var _0x462f0f=_0x07e9[_0x18a57b];return _0x462f0f;};'use strict';var schema=require(_0x907e('0x0'));var _=require(_0x907e('0x1'));var rpc={'chatInteraction':require(_0x907e('0x2')),'openchannelInteraction':require(_0x907e('0x3')),'smsInteraction':require(_0x907e('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x907e('0x5')),'whatsappInteraction':require(_0x907e('0x6'))};var logger=require(_0x907e('0x7'))(_0x907e('0x8'));var tag=schema({'tag':{'type':_0x907e('0x9'),'required':!![],'message':_0x907e('0xa')}});exports[_0x907e('0xb')]=function(_0x43b785,_0x7ce32a,_0x1138d0,_0x1ac90d){return function(_0x228c9e){try{var _0x5cc3c4={'tag':_0x7ce32a[0x0]};var _0x194491=tag[_0x907e('0x0')](_0x5cc3c4,{'typecast':!![]});if(_0x194491[_0x907e('0xc')]){logger['error'](_0x907e('0xd'),_0x43b785,_['map'](_0x194491,_0x907e('0xe'))['join'](',\x20'));logger[_0x907e('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x43b785);_0x228c9e[_0x907e('0x10')]();}else{var _0x2ebbf3={'ids':[_0x7ce32a[0x0]]};if(rpc[_0x1ac90d[_0x907e('0x11')]+'Interaction']){rpc[_0x1ac90d[_0x907e('0x11')]+'Interaction'][_0x907e('0x12')](_0x1ac90d[_0x907e('0x13')]['id'],_0x2ebbf3)[_0x907e('0x14')](function(_0x5cb739){logger[_0x907e('0xf')](_0x907e('0x15'),_0x43b785,_0x7ce32a[0x1],_0x1ac90d[_0x907e('0x11')],_0x1ac90d[_0x907e('0x13')]['id']);})[_0x907e('0x16')](function(_0x2259f0){logger[_0x907e('0x17')](_0x907e('0xd'),_0x43b785,JSON['stringify'](_0x2259f0));logger[_0x907e('0xf')](_0x907e('0x18'),_0x43b785);})[_0x907e('0x19')](function(){_0x228c9e['next']();});}}}catch(_0x53d946){logger[_0x907e('0x17')](_0x907e('0xd'),_0x43b785,_[_0x907e('0x1a')](_0x53d946)?JSON['stringify'](_0x53d946):_0x53d946);logger[_0x907e('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x43b785);_0x228c9e['next']();}};}; \ No newline at end of file +var _0x398f=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','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','then','catch','stringify','isObject','validate'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x398f,0x175));var _0xf398=function(_0x33b9c9,_0x126ebb){_0x33b9c9=_0x33b9c9-0x0;var _0x1bf263=_0x398f[_0x33b9c9];return _0x1bf263;};'use strict';var schema=require(_0xf398('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xf398('0x1')),'faxInteraction':require(_0xf398('0x2')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xf398('0x3'))('routing');var tag=schema({'tag':{'type':_0xf398('0x4'),'required':!![],'message':_0xf398('0x5')}});exports[_0xf398('0x6')]=function(_0x2b790b,_0x500cca,_0x51f93a,_0x48c3f6){return function(_0x19f732){try{var _0x5b6e1d={'tag':_0x500cca[0x0]};var _0x409a67=tag[_0xf398('0x0')](_0x5b6e1d,{'typecast':!![]});if(_0x409a67[_0xf398('0x7')]){logger[_0xf398('0x8')](_0xf398('0x9'),_0x2b790b,_[_0xf398('0xa')](_0x409a67,_0xf398('0xb'))['join'](',\x20'));logger[_0xf398('0xc')](_0xf398('0xd'),_0x2b790b);_0x19f732[_0xf398('0xe')]();}else{var _0x1bcf7c={'ids':[_0x500cca[0x0]]};if(rpc[_0x48c3f6[_0xf398('0xf')]+_0xf398('0x10')]){rpc[_0x48c3f6[_0xf398('0xf')]+'Interaction'][_0xf398('0x11')](_0x48c3f6['interaction']['id'],_0x1bcf7c)[_0xf398('0x12')](function(_0x4e299a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x2b790b,_0x500cca[0x1],_0x48c3f6['channel'],_0x48c3f6['interaction']['id']);})[_0xf398('0x13')](function(_0x5e6480){logger[_0xf398('0x8')](_0xf398('0x9'),_0x2b790b,JSON[_0xf398('0x14')](_0x5e6480));logger[_0xf398('0xc')](_0xf398('0xd'),_0x2b790b);})['finally'](function(){_0x19f732[_0xf398('0xe')]();});}}}catch(_0x423dcb){logger['error'](_0xf398('0x9'),_0x2b790b,_[_0xf398('0x15')](_0x423dcb)?JSON[_0xf398('0x14')](_0x423dcb):_0x423dcb);logger[_0xf398('0xc')](_0xf398('0xd'),_0x2b790b);_0x19f732[_0xf398('0xe')]();}};}; \ 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 871e45f..d0715a0 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 _0xa855=['lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xa855,0xac));var _0x5a85=function(_0x5b04ac,_0x14b9b5){_0x5b04ac=_0x5b04ac-0x0;var _0x106281=_0xa855[_0x5b04ac];return _0x106281;};'use strict';var rp=require(_0x5a85('0x0'));var logger=require(_0x5a85('0x1'))(_0x5a85('0x2'));var _=require(_0x5a85('0x3'));var arr=[];exports[_0x5a85('0x4')]=function(_0x4b8813,_0x1d2e8b){return function(_0x4d1a5f){var _0x1e2228=_0x1d2e8b[0xa];var _0x167e7a=_0x1d2e8b[0xb];var _0x5eb593=_0x1d2e8b[0xc];var _0x244dc6=_0x1d2e8b[0xd];var _0x1614a6=_0x1d2e8b[0xe];var _0x5b9e18=_0x1d2e8b[0xf][_0x5a85('0x5')](/\n/g,_0x5a85('0x6'));var _0x29f19c=_0x1d2e8b[0x10][_0x5a85('0x5')](/\n/g,'\x20');if(!arr[_0x5a85('0x7')](_0x167e7a)){arr[_0x5a85('0x8')](_0x167e7a);var _0x201c98=_0x1d2e8b[0x3];var _0x8b5df=_0x1d2e8b[0x4];var _0xb01d9e=_0x1d2e8b[0x1];var _0x78ee93=_0x1d2e8b[0x0];var _0x331b1b={};_0x331b1b[_0x5a85('0x9')]=_0x1d2e8b[0x8]+_0x5a85('0xa')+_0x5eb593+'|'+_0x1e2228+'|'+_0x244dc6+'|'+_0x167e7a+'|'+_0x1614a6;_0x331b1b[_0x5a85('0xb')]=_0x1d2e8b[0x7]+_0x5a85('0xa')+_0x5eb593+'|'+_0x1e2228+'|'+_0x244dc6+'|'+_0x167e7a+'|'+_0x1614a6+'|'+_0x5b9e18+'|'+_0x29f19c;_0x331b1b[_0x5a85('0xc')]=_0x1d2e8b[0x9];var _0x4c4127={};_0x4c4127['jsonrpc']=_0x5a85('0xd');_0x4c4127[_0x5a85('0xe')]=_0x5a85('0xf');var _0x284522=[];_0x284522[_0x5a85('0x8')](_0x1d2e8b[0x2]);_0x284522[_0x5a85('0x8')](_0x1d2e8b[0x5]);_0x284522[_0x5a85('0x8')](_0x1d2e8b[0x6]);_0x4c4127[_0x5a85('0x10')]=_0x284522;_0x4c4127['id']=0x1;var _0x5d309f=JSON[_0x5a85('0x11')](_0x4c4127);var _0x42295a={'encoding':_0x5a85('0x12'),'method':_0x5a85('0x13'),'timeout':0x2710,'url':_0x201c98,'headers':{'Content-Type':_0x5a85('0x14')},'body':_0x5d309f};return rp(_0x42295a)[_0x5a85('0x15')](function(_0x34fc51){const _0x565eae=JSON['parse'](_0x34fc51);if(!_0x565eae[_0x5a85('0x16')][_0x5a85('0x17')]){throw new Error(_0x5a85('0x18'));}var _0x3dcd83=_0x167e7a;var _0x392820='channelId='+_0xb01d9e+'&serviceId='+_0x78ee93+_0x5a85('0x19')+_0x3dcd83+_0x5a85('0x1a')+JSON[_0x5a85('0x11')](_0x331b1b);var _0x7316db=_0x8b5df+'?'+_0x392820;return rp(_0x7316db);})['then'](function(_0x2273a1){logger['info'](_0x5a85('0x1b'),_0x4b8813,_0x2273a1);_0x4d1a5f[_0x5a85('0x1c')]();})[_0x5a85('0x1d')](function(_0xad432c){logger[_0x5a85('0x1e')](_0x5a85('0x1f'),_0x4b8813,_[_0x5a85('0x20')](_0xad432c)?JSON[_0x5a85('0x11')](_0xad432c):_0xad432c);_0x4d1a5f[_0x5a85('0x1c')]();});}else{logger[_0x5a85('0x21')](_0x5a85('0x22'),_0x4b8813);_0x4d1a5f['next']();}};}; \ No newline at end of file +var _0x1ad5=['&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','stop','next','request-promise','../../../../config/logger','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','params','stringify','utf8','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId='];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1ad5,0xd4));var _0x51ad=function(_0x3d5351,_0x27bc80){_0x3d5351=_0x3d5351-0x0;var _0x1db4db=_0x1ad5[_0x3d5351];return _0x1db4db;};'use strict';var rp=require(_0x51ad('0x0'));var logger=require(_0x51ad('0x1'))('routing');var _=require('lodash');var arr=[];exports[_0x51ad('0x2')]=function(_0x3db565,_0x4dec4b){return function(_0x15d2b2){var _0x233fb1=_0x4dec4b[0xa];var _0x37c8b9=_0x4dec4b[0xb];var _0x3985ea=_0x4dec4b[0xc];var _0x1769e3=_0x4dec4b[0xd];var _0x42f38e=_0x4dec4b[0xe];var _0x53ee1d=_0x4dec4b[0xf][_0x51ad('0x3')](/\n/g,_0x51ad('0x4'));var _0x25ce6c=_0x4dec4b[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x51ad('0x5')](_0x37c8b9)){arr[_0x51ad('0x6')](_0x37c8b9);var _0x214ba7=_0x4dec4b[0x3];var _0xd71746=_0x4dec4b[0x4];var _0x17f1e8=_0x4dec4b[0x1];var _0x108384=_0x4dec4b[0x0];var _0x1f4e17={};_0x1f4e17[_0x51ad('0x7')]=_0x4dec4b[0x8]+_0x51ad('0x8')+_0x3985ea+'|'+_0x233fb1+'|'+_0x1769e3+'|'+_0x37c8b9+'|'+_0x42f38e;_0x1f4e17[_0x51ad('0x9')]=_0x4dec4b[0x7]+_0x51ad('0x8')+_0x3985ea+'|'+_0x233fb1+'|'+_0x1769e3+'|'+_0x37c8b9+'|'+_0x42f38e+'|'+_0x53ee1d+'|'+_0x25ce6c;_0x1f4e17[_0x51ad('0xa')]=_0x4dec4b[0x9];var _0x1787dc={};_0x1787dc[_0x51ad('0xb')]='2.0';_0x1787dc[_0x51ad('0xc')]=_0x51ad('0xd');var _0x42297f=[];_0x42297f[_0x51ad('0x6')](_0x4dec4b[0x2]);_0x42297f[_0x51ad('0x6')](_0x4dec4b[0x5]);_0x42297f[_0x51ad('0x6')](_0x4dec4b[0x6]);_0x1787dc[_0x51ad('0xe')]=_0x42297f;_0x1787dc['id']=0x1;var _0x348d48=JSON[_0x51ad('0xf')](_0x1787dc);var _0x3e9723={'encoding':_0x51ad('0x10'),'method':'POST','timeout':0x2710,'url':_0x214ba7,'headers':{'Content-Type':_0x51ad('0x11')},'body':_0x348d48};return rp(_0x3e9723)[_0x51ad('0x12')](function(_0x13c730){const _0x4eed72=JSON[_0x51ad('0x13')](_0x13c730);if(!_0x4eed72[_0x51ad('0x14')][_0x51ad('0x15')]){throw new Error(_0x51ad('0x16'));}var _0x5194c5=_0x37c8b9;var _0x3f6533=_0x51ad('0x17')+_0x17f1e8+_0x51ad('0x18')+_0x108384+_0x51ad('0x19')+_0x5194c5+_0x51ad('0x1a')+JSON['stringify'](_0x1f4e17);var _0x33704f=_0xd71746+'?'+_0x3f6533;return rp(_0x33704f);})[_0x51ad('0x12')](function(_0x5f19be){logger[_0x51ad('0x1b')](_0x51ad('0x1c'),_0x3db565,_0x5f19be);_0x15d2b2['stop']();})[_0x51ad('0x1d')](function(_0x149326){logger[_0x51ad('0x1e')](_0x51ad('0x1f'),_0x3db565,_['isObject'](_0x149326)?JSON['stringify'](_0x149326):_0x149326);_0x15d2b2[_0x51ad('0x20')]();});}else{logger[_0x51ad('0x1b')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x3db565);_0x15d2b2[_0x51ad('0x21')]();}};}; \ 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 edad1ad..e26f2af 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x472c67,_0xc6c43b){var _0x3409cf=function(_0x52e9b7){while(--_0x52e9b7){_0x472c67['push'](_0x472c67['shift']());}};_0x3409cf(++_0xc6c43b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x483eeb,_0x21e286){var _0x5a2675=function(_0x56b18){while(--_0x56b18){_0x483eeb['push'](_0x483eeb['shift']());}};_0x5a2675(++_0x21e286);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 145e79e..fde49cb 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 _0x1152=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','amazonlex','TagId','tvox','getMustacheRender','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','busy','agents','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','openchannelQueues','smsQueues','name','faxQueues','whatsappQueues'];(function(_0xe68e2d,_0x5e76e9){var _0x1a7cf6=function(_0x2eee87){while(--_0x2eee87){_0xe68e2d['push'](_0xe68e2d['shift']());}};_0x1a7cf6(++_0x5e76e9);}(_0x1152,0x182));var _0x2115=function(_0x3758dd,_0x3608b9){_0x3758dd=_0x3758dd-0x0;var _0x16ba2f=_0x1152[_0x3758dd];return _0x16ba2f;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var path=require(_0x2115('0x2'));var fs=require('fs');var jayson=require(_0x2115('0x3'));var BPromise=require(_0x2115('0x4'));var uuid=require(_0x2115('0x5'));var utils=require(_0x2115('0x6'));var config=require(_0x2115('0x7'));var logger=require('../../../config/logger')(_0x2115('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2115('0x9')),'chatQueueReport':require(_0x2115('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x5df6db,_0x158711,_0xacf216){return util[_0x2115('0xb')]('%s.%s.%s',_0x5df6db,_0x158711||0x0,_0xacf216||0x0);}function getIntervals(_0x254648,_0x534958){var _0x5ca468=[];if(!_[_0x2115('0xc')](_0x534958[_0x2115('0xd')])&&!_[_0x2115('0xc')](_0x254648[_0x534958['IntervalId']])&&!_[_0x2115('0xc')](_0x254648[_0x534958['IntervalId']][_0x2115('0xe')])){_0x5ca468=_[_0x2115('0xf')](_0x254648[_0x534958[_0x2115('0xd')]][_0x2115('0xe')],_0x2115('0x10'));}else if(!_['isNil'](_0x534958[_0x2115('0x10')])){_0x5ca468=[_0x534958['interval']];}return _0x5ca468;}exports[_0x2115('0x11')]=function(_0x38e406){_0x38e406[_0x2115('0x12')]={};return new BPromise(function(_0x2001e6,_0x7f6183){var _0x113ce2={'Start':function(_0x350969){var _0x5e8f81=this;return new Promise(function(_0xdf3e24,_0x21b589){if(_0x350969){try{var _0xc97f87=[];var _0x184c05=getId(_0x350969[_0x2115('0x13')],_0x350969[_0x2115('0x14')]?_0x350969[_0x2115('0x14')]['id']:0x0,_0x350969[_0x2115('0x15')]?_0x350969['interaction']['id']:0x0);if(_0x350969[_0x2115('0x16')]&&_[_0x2115('0x17')](_0x350969[_0x2115('0x16')])&&_0x350969['applications'][_0x2115('0x18')]){for(var _0x43fe65=0x0;_0x43fe65<_0x350969[_0x2115('0x16')][_0x2115('0x18')];_0x43fe65+=0x1){var _0x534543=_0x350969[_0x2115('0x16')][_0x43fe65];if(fs[_0x2115('0x19')](path[_0x2115('0x1a')](__dirname,_0x2115('0x16'),_0x534543[_0x2115('0x1b')]+_0x2115('0x1c')))){var _0x8b7304=[];switch(_0x534543[_0x2115('0x1b')][_0x2115('0x1d')]()){case'autoreply':var _0x2f7de0=_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');if(_0x350969[_0x2115('0x13')]===_0x2115('0x20')){_0x8b7304[_0x2115('0x21')](_0x2f7de0[0x0]);_0x8b7304['push'](_0x2f7de0[0x1]);_0x8b7304['push'](_0x2f7de0['slice'](0x2,_0x2f7de0[_0x2115('0x18')])[_0x2115('0x1a')](','));}else{_0x8b7304[_0x2115('0x21')](_0x2f7de0[0x0]);_0x8b7304['push'](_0x2f7de0[_0x2115('0x22')](0x1,_0x2f7de0[_0x2115('0x18')])[_0x2115('0x1a')](','));}break;case _0x2115('0x23'):var _0x3ca0ef=_0x534543['appdata'][_0x2115('0x1f')](',');_0x8b7304[_0x2115('0x21')](_0x3ca0ef[0x0]);_0x8b7304['push'](_0x3ca0ef[0x1]);_0x8b7304[_0x2115('0x21')](_0x3ca0ef[_0x2115('0x22')](0x2,_0x3ca0ef[_0x2115('0x18')])[_0x2115('0x1a')](','));break;case'dialogflowv2':var _0x19c595=_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');_0x8b7304[_0x2115('0x21')](_0x19c595[0x0]);_0x8b7304[_0x2115('0x21')](_0x19c595[0x1]);_0x8b7304[_0x2115('0x21')](_0x19c595[0x2]);_0x8b7304['push'](_0x19c595[0x3]);_0x8b7304['push'](_0x19c595[_0x2115('0x22')](0x4,_0x19c595[_0x2115('0x18')])[_0x2115('0x1a')](','));break;case _0x2115('0x24'):var _0x32bc0c=_0x534543['appdata'][_0x2115('0x1f')](',');_0x8b7304[_0x2115('0x21')](_0x32bc0c[0x0]);_0x8b7304[_0x2115('0x21')](_0x32bc0c[0x1]);_0x8b7304['push'](_0x32bc0c[0x2]);_0x8b7304[_0x2115('0x21')](_0x32bc0c[0x3]);_0x8b7304['push'](_0x32bc0c[_0x2115('0x22')](0x4,_0x32bc0c['length'])[_0x2115('0x1a')](','));break;case _0x2115('0x14'):_0x8b7304[_0x2115('0x21')](_0x534543['appdata']);break;case'tag':_0x8b7304[_0x2115('0x21')](_0x534543[_0x2115('0x25')]);_0x8b7304['push'](_0x534543[_0x2115('0x1e')]);break;case _0x2115('0x26'):var _0x27f9e5=utils[_0x2115('0x27')](_0x350969['account'][_0x2115('0x28')],_0x350969);var _0x41c9dc=_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');_0x8b7304['push'](_0x41c9dc[0x0]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x1]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x2]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x3]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x4]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x5]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x6]);_0x8b7304['push'](_0x41c9dc[0x7]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x8]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0x9]);_0x8b7304[_0x2115('0x21')](_0x41c9dc[0xa]);_0x8b7304[_0x2115('0x21')](_0x350969[_0x2115('0x15')]['id']);_0x8b7304[_0x2115('0x21')](_0x350969['message']['id']);_0x8b7304[_0x2115('0x21')](_0x534543['ChatWebsiteId']);_0x8b7304['push'](_0x350969[_0x2115('0x15')][_0x2115('0x29')]);_0x8b7304[_0x2115('0x21')](_0x350969[_0x2115('0x2a')][_0x2115('0x2a')]);_0x8b7304[_0x2115('0x21')](_0x27f9e5);break;default:_0x8b7304=_['isNil'](_0x534543[_0x2115('0x1e')])?[]:_0x534543[_0x2115('0x1e')][_0x2115('0x1f')](',');}var _0x19c159={'id':util[_0x2115('0xb')](_0x2115('0x2b'),_0x184c05,_0x534543['id'],_0x534543[_0x2115('0x1b')]),'condition':require(_0x2115('0x2c'))[_0x2115('0x2d')](_0x184c05,getIntervals(_0x38e406[_0x2115('0x2e')],_0x534543),_0x38e406),'consequence':require('./applications/'+_0x534543['app'])[_0x2115('0x2f')](_0x184c05,_0x8b7304,_0x38e406,_0x350969),'p':_0x534543['priority']||0x0};logger[_0x2115('0x30')]('Push\x20new\x20rule',_0x19c159['id'],'on\x20interval',getIntervals(_0x38e406['intervals'],_0x534543)[_0x2115('0x1a')](_0x2115('0x31')));_0xc97f87[_0x2115('0x21')](_0x19c159);}else{logger[_0x2115('0x32')](_0x2115('0x33'),path['join'](__dirname,_0x2115('0x16'),_0x534543['app']+_0x2115('0x1c')));}}_0x38e406[_0x2115('0x12')][_0x184c05]=new RuleEngine(_0xc97f87);_0x38e406['rules'][_0x184c05][_0x2115('0x34')](_0x350969,function(_0x309f46){logger['info']('Applications\x20executed',JSON[_0x2115('0x35')](_0x309f46[_0x2115('0x36')]));if(_0x38e406['rules'][_0x184c05]){_0x38e406['rules'][_0x184c05][_0x2115('0x37')](_0x2115('0x38'));}});return _0xdf3e24({'code':0xc8,'message':_0x350969});}else{logger['info']('No\x20applications\x20to\x20execute');return _0xdf3e24({'code':0xc8,'message':_0x350969});}}catch(_0x346b32){logger[_0x2115('0x32')](_0x346b32[_0x2115('0x39')]);return _0x21b589(_0x5e8f81['error'](0x1f4,_0x346b32));}}return _0x21b589(_0x2115('0x3a'));});},'AcceptMessage':function(_0x48ca88){var _0xd003d0=this;return new Promise(function(_0xc61152,_0x3a0801){if(_0x48ca88[_0x2115('0x3b')]&&_0x48ca88[_0x2115('0x3b')]['id']){if(_0x38e406['agents'][_0x48ca88[_0x2115('0x3b')]['id']]){_0x38e406['agents'][_0x48ca88['agent']['id']][_0x2115('0x3c')]=![];_0x38e406[_0x2115('0x3d')][_0x48ca88['agent']['id']][_0x2115('0x3e')]=undefined;}}if(_0x48ca88[_0x2115('0x14')]&&_0x48ca88[_0x2115('0x14')]['id']){try{var _0x1dd6eb=getId(_0x48ca88[_0x2115('0x13')],_0x48ca88[_0x2115('0x14')]?_0x48ca88[_0x2115('0x14')]['id']:0x0,_0x48ca88[_0x2115('0x15')]?_0x48ca88[_0x2115('0x15')]['id']:0x0);if(_0x38e406['rules'][_0x1dd6eb]){_0x38e406[_0x2115('0x12')][_0x1dd6eb][_0x2115('0x37')](_0x2115('0x3f'));if(rpc[_0x48ca88['channel']+_0x2115('0x40')]){rpc[_0x48ca88['channel']+'QueueReport']['update'](_0x1dd6eb,{'UserId':_0x48ca88[_0x2115('0x14')][_0x2115('0x41')]})['catch'](function(_0x4c0e49){logger[_0x2115('0x32')](_0x2115('0x42'));});}}return _0xc61152({'code':0xc8,'message':_0x48ca88});}catch(_0x401f8f){logger[_0x2115('0x32')](_0x401f8f[_0x2115('0x39')]);return _0x3a0801(_0xd003d0[_0x2115('0x32')](0x1f4,_0x401f8f));}}logger[_0x2115('0x32')](_0x2115('0x43'));return _0x3a0801(_0xd003d0['error'](0x1f4,_0x2115('0x43')));});},'RejectMessage':function(_0x581295){var _0x51b575=this;return new Promise(function(_0xf5653f,_0x6de4e7){if(_0x581295[_0x2115('0x3b')]&&_0x581295[_0x2115('0x3b')]['id']){try{if(_0x38e406[_0x2115('0x3d')][_0x581295[_0x2115('0x3b')]['id']]){_0x38e406['agents'][_0x581295[_0x2115('0x3b')]['id']][_0x2115('0x3c')]=![];_0x38e406['agents'][_0x581295['agent']['id']][_0x2115('0x3e')]=undefined;}return _0xf5653f({'code':0xc8,'message':_0x581295});}catch(_0x29bd22){logger[_0x2115('0x32')](_0x29bd22[_0x2115('0x39')]);return _0x6de4e7(_0x51b575['error'](0x1f4,_0x29bd22));}}logger[_0x2115('0x32')](_0x2115('0x43'));return _0x6de4e7(_0x51b575[_0x2115('0x32')](0x1f4,_0x2115('0x43')));});},'AbandonInteraction':function(_0xedd07f){var _0x1bd210=this;return new Promise(function(_0x48cf39,_0xd1fe41){if(_0xedd07f[_0x2115('0x13')]&&_0xedd07f['interaction']&&_0xedd07f[_0x2115('0x15')]['id']){try{var _0x34f5f0=getId(_0xedd07f[_0x2115('0x13')],_0xedd07f['message']?_0xedd07f[_0x2115('0x14')]['id']:0x0,_0xedd07f['interaction']?_0xedd07f[_0x2115('0x15')]['id']:0x0);if(_0x38e406[_0x2115('0x12')][_0x34f5f0]){_0x38e406[_0x2115('0x12')][_0x34f5f0][_0x2115('0x37')](_0x2115('0x3f'));}return _0x48cf39({'code':0xc8,'message':_0xedd07f});}catch(_0x31a52a){logger['error'](_0x31a52a[_0x2115('0x39')]);return _0xd1fe41(_0x1bd210[_0x2115('0x32')](0x1f4,_0x31a52a));}}logger['error'](_0x2115('0x43'));return _0xd1fe41(_0x1bd210[_0x2115('0x32')](0x1f4,_0x2115('0x43')));});},'AgentCapacity':function(_0x58ed32){var _0x53ee95=this;return new Promise(function(_0x4f0c1d,_0x3d7106){if(_0x38e406['agents'][_0x2115('0x44')](_0x58ed32['id'])){for(var _0x208e4e in _0x58ed32[_0x2115('0x45')]){if(_0x58ed32['capacity'][_0x2115('0x44')](_0x208e4e)){if(_0x38e406['agents'][_0x58ed32['id']][_0x2115('0x44')](_0x208e4e+_0x2115('0x46'))){_0x38e406['agents'][_0x58ed32['id']][_0x208e4e+'CurrentCapacity']=parseInt(_0x58ed32[_0x2115('0x45')][_0x208e4e],0xa);}}}_0x38e406[_0x2115('0x3d')][_0x58ed32['id']]['updateRealtime']();return _0x4f0c1d({'code':0xc8,'message':_0x38e406[_0x2115('0x3d')][_0x58ed32['id']]});}else{return _0x3d7106(_0x53ee95['error'](0x1f4,_0x2115('0x47')));}});},'Agents':function(_0x422863){return new Promise(function(_0x4b2950,_0x2e9167){var _0x1eea52=_[_0x2115('0x48')](_0x38e406[_0x2115('0x3d')]);_0x4b2950({'count':_0x1eea52[_0x2115('0x18')],'rows':_0x1eea52});});},'ChatQueues':function(_0x23181c){return new Promise(function(_0x2cf476,_0x16bd79){var _0x2d2105=[];for(var _0x1be769 in _0x38e406[_0x2115('0x49')]){if(_0x38e406[_0x2115('0x49')][_0x2115('0x44')](_0x1be769)){var _0x84d526=_0x38e406[_0x2115('0x49')][_0x1be769];var _0x21baa7={'id':_0x84d526['id'],'available':_0x84d526[_0x2115('0x4a')],'loggedIn':_0x84d526[_0x2115('0x4b')],'name':_0x84d526['name'],'paused':_0x84d526[_0x2115('0x4c')],'waiting':_0x84d526[_0x2115('0x4d')]};_0x2d2105[_0x2115('0x21')](_0x21baa7);}}_0x2cf476({'count':_0x2d2105[_0x2115('0x18')],'rows':_0x2d2105});});},'MailQueues':function(_0x2ee9d1){return new Promise(function(_0x225389,_0x2b21c8){var _0x5ca331=[];for(var _0x96003b in _0x38e406[_0x2115('0x4e')]){if(_0x38e406[_0x2115('0x4e')]['hasOwnProperty'](_0x96003b)){var _0x2450f3=_0x38e406[_0x2115('0x4e')][_0x96003b];var _0x10a00d={'id':_0x2450f3['id'],'available':_0x2450f3[_0x2115('0x4a')],'loggedIn':_0x2450f3[_0x2115('0x4b')],'name':_0x2450f3['name'],'paused':_0x2450f3[_0x2115('0x4c')],'waiting':_0x2450f3['waiting']};_0x5ca331['push'](_0x10a00d);}}_0x225389({'count':_0x5ca331[_0x2115('0x18')],'rows':_0x5ca331});});},'OpenchannelQueues':function(_0x5826ae){return new Promise(function(_0x5d2e03,_0x509478){var _0x4f1ee3=[];for(var _0x145bf9 in _0x38e406['openchannelQueues']){if(_0x38e406[_0x2115('0x4f')]['hasOwnProperty'](_0x145bf9)){var _0x23c4cc=_0x38e406['openchannelQueues'][_0x145bf9];var _0x151894={'id':_0x23c4cc['id'],'available':_0x23c4cc['available'],'loggedIn':_0x23c4cc['loggedIn'],'name':_0x23c4cc['name'],'paused':_0x23c4cc[_0x2115('0x4c')],'waiting':_0x23c4cc[_0x2115('0x4d')]};_0x4f1ee3['push'](_0x151894);}}_0x5d2e03({'count':_0x4f1ee3[_0x2115('0x18')],'rows':_0x4f1ee3});});},'SmsQueues':function(_0x28e322){return new Promise(function(_0x185426,_0x464fa7){var _0x217383=[];for(var _0x45327e in _0x38e406[_0x2115('0x50')]){if(_0x38e406[_0x2115('0x50')][_0x2115('0x44')](_0x45327e)){var _0x85ea33=_0x38e406[_0x2115('0x50')][_0x45327e];var _0x34cdc3={'id':_0x85ea33['id'],'available':_0x85ea33[_0x2115('0x4a')],'loggedIn':_0x85ea33[_0x2115('0x4b')],'name':_0x85ea33[_0x2115('0x51')],'paused':_0x85ea33[_0x2115('0x4c')],'waiting':_0x85ea33['waiting']};_0x217383[_0x2115('0x21')](_0x34cdc3);}}_0x185426({'count':_0x217383['length'],'rows':_0x217383});});},'FaxQueues':function(_0x47edc3){return new Promise(function(_0x4d5934,_0x3c48b3){var _0x1a14ac=[];for(var _0x14e747 in _0x38e406['faxQueues']){if(_0x38e406[_0x2115('0x52')][_0x2115('0x44')](_0x14e747)){var _0x47a970=_0x38e406[_0x2115('0x52')][_0x14e747];var _0x10d172={'id':_0x47a970['id'],'available':_0x47a970[_0x2115('0x4a')],'loggedIn':_0x47a970[_0x2115('0x4b')],'name':_0x47a970[_0x2115('0x51')],'paused':_0x47a970[_0x2115('0x4c')],'waiting':_0x47a970[_0x2115('0x4d')]};_0x1a14ac[_0x2115('0x21')](_0x10d172);}}_0x4d5934({'count':_0x1a14ac[_0x2115('0x18')],'rows':_0x1a14ac});});},'WhatsappQueues':function(_0xae3f1){return new Promise(function(_0x3928e0,_0x387c2b){var _0x1eb0b9=[];for(var _0x4c9997 in _0x38e406[_0x2115('0x53')]){if(_0x38e406[_0x2115('0x53')][_0x2115('0x44')](_0x4c9997)){var _0x1b713e=_0x38e406['whatsappQueues'][_0x4c9997];var _0x249b9c={'id':_0x1b713e['id'],'available':_0x1b713e[_0x2115('0x4a')],'loggedIn':_0x1b713e[_0x2115('0x4b')],'name':_0x1b713e[_0x2115('0x51')],'paused':_0x1b713e[_0x2115('0x4c')],'waiting':_0x1b713e[_0x2115('0x4d')]};_0x1eb0b9[_0x2115('0x21')](_0x249b9c);}}_0x3928e0({'count':_0x1eb0b9[_0x2115('0x18')],'rows':_0x1eb0b9});});},'ChatQueuesWaitingInteractions':function(_0x85f3d9){return new Promise(function(_0x956842,_0xe87632){var _0x2f808c=_[_0x2115('0x48')](_0x38e406[_0x2115('0x54')]);_0x956842({'count':_0x2f808c[_0x2115('0x18')],'rows':_0x2f808c});});},'MailQueuesWaitingInteractions':function(_0x2f78a3){return new Promise(function(_0x354a73,_0x547733){var _0x20813c=_[_0x2115('0x48')](_0x38e406[_0x2115('0x55')]);_0x354a73({'count':_0x20813c[_0x2115('0x18')],'rows':_0x20813c});});},'OpenchannelQueuesWaitingInteractions':function(_0x3eb80c){return new Promise(function(_0x35e7fb,_0x22c00d){var _0x271fab=_[_0x2115('0x48')](_0x38e406[_0x2115('0x56')]);_0x35e7fb({'count':_0x271fab[_0x2115('0x18')],'rows':_0x271fab});});},'SmsQueuesWaitingInteractions':function(_0xdfc5da){return new Promise(function(_0x322a4e,_0x2e301d){var _0x4630ba=_[_0x2115('0x48')](_0x38e406[_0x2115('0x57')]);_0x322a4e({'count':_0x4630ba[_0x2115('0x18')],'rows':_0x4630ba});});},'FaxQueuesWaitingInteractions':function(_0x4ee2a4){return new Promise(function(_0x1f4e61,_0x2983c1){var _0x4b55d6=_[_0x2115('0x48')](_0x38e406[_0x2115('0x58')]);_0x1f4e61({'count':_0x4b55d6[_0x2115('0x18')],'rows':_0x4b55d6});});},'WhatsappQueuesWaitingInteractions':function(_0x19c929){return new Promise(function(_0x39632f,_0x25bbdd){var _0x4e380b=_[_0x2115('0x48')](_0x38e406['whatsappQueuesWaitingInteractions']);_0x39632f({'count':_0x4e380b[_0x2115('0x18')],'rows':_0x4e380b});});}};var _0x4705ff=jayson[_0x2115('0x59')](_0x113ce2)[_0x2115('0x5a')]();_0x4705ff['on']('error',function(_0xc5abd2){logger[_0x2115('0x32')](JSON['stringify'](_0xc5abd2));return _0x7f6183(_0xc5abd2);});_0x4705ff[_0x2115('0x11')](0x232c,_0x2115('0x5b'),function(){console[_0x2115('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2001e6(_0x2115('0x5d')+0x232c);});});}; \ No newline at end of file +var _0x4e81=['push','slice','dialogflow','appdata','amazonlex','tag','TagId','tvox','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','complete','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','waiting','mailQueues','available','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','join','app','.js','toLowerCase','split'];(function(_0x1085b4,_0x24ca63){var _0x3b4ac2=function(_0x5d01d8){while(--_0x5d01d8){_0x1085b4['push'](_0x1085b4['shift']());}};_0x3b4ac2(++_0x24ca63);}(_0x4e81,0x1bc));var _0x14e8=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0x4e81[_0x43026b];return _0x4a96cd;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require('uuid');var utils=require(_0x14e8('0x3'));var config=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var rpc={'openchannelQueueReport':require(_0x14e8('0x7')),'mailQueueReport':require(_0x14e8('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x14e8('0x9')),'whatsappQueueReport':require(_0x14e8('0xa'))};var RuleEngine=require(_0x14e8('0xb'));function getId(_0x3c1b93,_0x11ec3b,_0x20f053){return util[_0x14e8('0xc')](_0x14e8('0xd'),_0x3c1b93,_0x11ec3b||0x0,_0x20f053||0x0);}function getIntervals(_0x294b39,_0x5602cc){var _0xbd3b87=[];if(!_[_0x14e8('0xe')](_0x5602cc[_0x14e8('0xf')])&&!_[_0x14e8('0xe')](_0x294b39[_0x5602cc[_0x14e8('0xf')]])&&!_[_0x14e8('0xe')](_0x294b39[_0x5602cc[_0x14e8('0xf')]][_0x14e8('0x10')])){_0xbd3b87=_['map'](_0x294b39[_0x5602cc[_0x14e8('0xf')]]['Intervals'],_0x14e8('0x11'));}else if(!_[_0x14e8('0xe')](_0x5602cc[_0x14e8('0x11')])){_0xbd3b87=[_0x5602cc['interval']];}return _0xbd3b87;}exports[_0x14e8('0x12')]=function(_0x4e1064){_0x4e1064[_0x14e8('0x13')]={};return new BPromise(function(_0x58d26e,_0x347216){var _0x3761a1={'Start':function(_0xc6101f){var _0x135996=this;return new Promise(function(_0x52e64f,_0x10c4a9){if(_0xc6101f){try{var _0x3793a0=[];var _0x30581=getId(_0xc6101f[_0x14e8('0x14')],_0xc6101f[_0x14e8('0x15')]?_0xc6101f[_0x14e8('0x15')]['id']:0x0,_0xc6101f[_0x14e8('0x16')]?_0xc6101f[_0x14e8('0x16')]['id']:0x0);if(_0xc6101f['applications']&&_[_0x14e8('0x17')](_0xc6101f[_0x14e8('0x18')])&&_0xc6101f[_0x14e8('0x18')][_0x14e8('0x19')]){for(var _0x246c5d=0x0;_0x246c5d<_0xc6101f['applications'][_0x14e8('0x19')];_0x246c5d+=0x1){var _0x1cefdc=_0xc6101f[_0x14e8('0x18')][_0x246c5d];if(fs['existsSync'](path[_0x14e8('0x1a')](__dirname,'applications',_0x1cefdc[_0x14e8('0x1b')]+_0x14e8('0x1c')))){var _0x3e8d5c=[];switch(_0x1cefdc[_0x14e8('0x1b')][_0x14e8('0x1d')]()){case'autoreply':var _0xf6bbdc=_0x1cefdc['appdata'][_0x14e8('0x1e')](',');if(_0xc6101f[_0x14e8('0x14')]==='mail'){_0x3e8d5c['push'](_0xf6bbdc[0x0]);_0x3e8d5c['push'](_0xf6bbdc[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0xf6bbdc[_0x14e8('0x20')](0x2,_0xf6bbdc[_0x14e8('0x19')])[_0x14e8('0x1a')](','));}else{_0x3e8d5c[_0x14e8('0x1f')](_0xf6bbdc[0x0]);_0x3e8d5c['push'](_0xf6bbdc[_0x14e8('0x20')](0x1,_0xf6bbdc[_0x14e8('0x19')])[_0x14e8('0x1a')](','));}break;case _0x14e8('0x21'):var _0x28035a=_0x1cefdc[_0x14e8('0x22')][_0x14e8('0x1e')](',');_0x3e8d5c['push'](_0x28035a[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x28035a[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x28035a[_0x14e8('0x20')](0x2,_0x28035a['length'])['join'](','));break;case'dialogflowv2':var _0x8fe0e2=_0x1cefdc[_0x14e8('0x22')]['split'](',');_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x2]);_0x3e8d5c[_0x14e8('0x1f')](_0x8fe0e2[0x3]);_0x3e8d5c['push'](_0x8fe0e2[_0x14e8('0x20')](0x4,_0x8fe0e2[_0x14e8('0x19')])[_0x14e8('0x1a')](','));break;case _0x14e8('0x23'):var _0x2d0246=_0x1cefdc['appdata'][_0x14e8('0x1e')](',');_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246[0x2]);_0x3e8d5c['push'](_0x2d0246[0x3]);_0x3e8d5c[_0x14e8('0x1f')](_0x2d0246['slice'](0x4,_0x2d0246[_0x14e8('0x19')])[_0x14e8('0x1a')](','));break;case _0x14e8('0x15'):_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc[_0x14e8('0x22')]);break;case _0x14e8('0x24'):_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc[_0x14e8('0x25')]);_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc[_0x14e8('0x22')]);break;case _0x14e8('0x26'):var _0x4411e9=utils['getMustacheRender'](_0xc6101f['account']['notificationTemplate'],_0xc6101f);var _0x16ff09=_0x1cefdc['appdata'][_0x14e8('0x1e')](',');_0x3e8d5c['push'](_0x16ff09[0x0]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x1]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x2]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x3]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x4]);_0x3e8d5c['push'](_0x16ff09[0x5]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x6]);_0x3e8d5c['push'](_0x16ff09[0x7]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x8]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0x9]);_0x3e8d5c[_0x14e8('0x1f')](_0x16ff09[0xa]);_0x3e8d5c[_0x14e8('0x1f')](_0xc6101f[_0x14e8('0x16')]['id']);_0x3e8d5c[_0x14e8('0x1f')](_0xc6101f['message']['id']);_0x3e8d5c[_0x14e8('0x1f')](_0x1cefdc['ChatWebsiteId']);_0x3e8d5c[_0x14e8('0x1f')](_0xc6101f[_0x14e8('0x16')][_0x14e8('0x27')]);_0x3e8d5c['push'](_0xc6101f[_0x14e8('0x28')][_0x14e8('0x28')]);_0x3e8d5c['push'](_0x4411e9);break;default:_0x3e8d5c=_[_0x14e8('0xe')](_0x1cefdc[_0x14e8('0x22')])?[]:_0x1cefdc[_0x14e8('0x22')][_0x14e8('0x1e')](',');}var _0x77e8a0={'id':util[_0x14e8('0xc')](_0x14e8('0x29'),_0x30581,_0x1cefdc['id'],_0x1cefdc[_0x14e8('0x1b')]),'condition':require(_0x14e8('0x2a'))[_0x14e8('0x2b')](_0x30581,getIntervals(_0x4e1064[_0x14e8('0x2c')],_0x1cefdc),_0x4e1064),'consequence':require(_0x14e8('0x2d')+_0x1cefdc[_0x14e8('0x1b')])[_0x14e8('0x2e')](_0x30581,_0x3e8d5c,_0x4e1064,_0xc6101f),'p':_0x1cefdc[_0x14e8('0x2f')]||0x0};logger['info'](_0x14e8('0x30'),_0x77e8a0['id'],'on\x20interval',getIntervals(_0x4e1064['intervals'],_0x1cefdc)['join'](_0x14e8('0x31')));_0x3793a0['push'](_0x77e8a0);}else{logger[_0x14e8('0x32')](_0x14e8('0x33'),path[_0x14e8('0x1a')](__dirname,_0x14e8('0x18'),_0x1cefdc[_0x14e8('0x1b')]+_0x14e8('0x1c')));}}_0x4e1064[_0x14e8('0x13')][_0x30581]=new RuleEngine(_0x3793a0);_0x4e1064[_0x14e8('0x13')][_0x30581][_0x14e8('0x34')](_0xc6101f,function(_0x3f9da0){logger[_0x14e8('0x35')]('Applications\x20executed',JSON[_0x14e8('0x36')](_0x3f9da0[_0x14e8('0x37')]));if(_0x4e1064[_0x14e8('0x13')][_0x30581]){_0x4e1064[_0x14e8('0x13')][_0x30581]['emit'](_0x14e8('0x38'));}});return _0x52e64f({'code':0xc8,'message':_0xc6101f});}else{logger[_0x14e8('0x35')]('No\x20applications\x20to\x20execute');return _0x52e64f({'code':0xc8,'message':_0xc6101f});}}catch(_0x553002){logger[_0x14e8('0x32')](_0x553002['stack']);return _0x10c4a9(_0x135996['error'](0x1f4,_0x553002));}}return _0x10c4a9(_0x14e8('0x39'));});},'AcceptMessage':function(_0xce1e17){var _0x578d48=this;return new Promise(function(_0x31fd95,_0x11455b){if(_0xce1e17['agent']&&_0xce1e17[_0x14e8('0x3a')]['id']){if(_0x4e1064[_0x14e8('0x3b')][_0xce1e17[_0x14e8('0x3a')]['id']]){_0x4e1064[_0x14e8('0x3b')][_0xce1e17[_0x14e8('0x3a')]['id']][_0x14e8('0x3c')]=![];_0x4e1064[_0x14e8('0x3b')][_0xce1e17[_0x14e8('0x3a')]['id']][_0x14e8('0x3d')]=undefined;}}if(_0xce1e17[_0x14e8('0x15')]&&_0xce1e17[_0x14e8('0x15')]['id']){try{var _0x4083b8=getId(_0xce1e17[_0x14e8('0x14')],_0xce1e17[_0x14e8('0x15')]?_0xce1e17[_0x14e8('0x15')]['id']:0x0,_0xce1e17[_0x14e8('0x16')]?_0xce1e17['interaction']['id']:0x0);if(_0x4e1064[_0x14e8('0x13')][_0x4083b8]){_0x4e1064['rules'][_0x4083b8][_0x14e8('0x3e')](_0x14e8('0x3f'));if(rpc[_0xce1e17[_0x14e8('0x14')]+_0x14e8('0x40')]){rpc[_0xce1e17['channel']+'QueueReport']['update'](_0x4083b8,{'UserId':_0xce1e17[_0x14e8('0x15')]['UserId']})['catch'](function(_0xd2b281){logger[_0x14e8('0x32')]('error\x20update\x20queue\x20report');});}}return _0x31fd95({'code':0xc8,'message':_0xce1e17});}catch(_0x15058e){logger[_0x14e8('0x32')](_0x15058e[_0x14e8('0x41')]);return _0x11455b(_0x578d48[_0x14e8('0x32')](0x1f4,_0x15058e));}}logger['error']('message\x20is\x20empty');return _0x11455b(_0x578d48[_0x14e8('0x32')](0x1f4,_0x14e8('0x42')));});},'RejectMessage':function(_0x15464a){var _0x3a09b7=this;return new Promise(function(_0x41b5ab,_0x2fbac7){if(_0x15464a['agent']&&_0x15464a[_0x14e8('0x3a')]['id']){try{if(_0x4e1064[_0x14e8('0x3b')][_0x15464a[_0x14e8('0x3a')]['id']]){_0x4e1064[_0x14e8('0x3b')][_0x15464a['agent']['id']][_0x14e8('0x3c')]=![];_0x4e1064[_0x14e8('0x3b')][_0x15464a[_0x14e8('0x3a')]['id']][_0x14e8('0x3d')]=undefined;}return _0x41b5ab({'code':0xc8,'message':_0x15464a});}catch(_0x5d7e49){logger[_0x14e8('0x32')](_0x5d7e49[_0x14e8('0x41')]);return _0x2fbac7(_0x3a09b7[_0x14e8('0x32')](0x1f4,_0x5d7e49));}}logger[_0x14e8('0x32')](_0x14e8('0x42'));return _0x2fbac7(_0x3a09b7[_0x14e8('0x32')](0x1f4,_0x14e8('0x42')));});},'AbandonInteraction':function(_0x168b8a){var _0x5ab659=this;return new Promise(function(_0x5a1f22,_0x2fcc63){if(_0x168b8a[_0x14e8('0x14')]&&_0x168b8a[_0x14e8('0x16')]&&_0x168b8a[_0x14e8('0x16')]['id']){try{var _0x3f0b2a=getId(_0x168b8a['channel'],_0x168b8a['message']?_0x168b8a['message']['id']:0x0,_0x168b8a[_0x14e8('0x16')]?_0x168b8a[_0x14e8('0x16')]['id']:0x0);if(_0x4e1064[_0x14e8('0x13')][_0x3f0b2a]){_0x4e1064['rules'][_0x3f0b2a][_0x14e8('0x3e')](_0x14e8('0x3f'));}return _0x5a1f22({'code':0xc8,'message':_0x168b8a});}catch(_0x1d6683){logger['error'](_0x1d6683[_0x14e8('0x41')]);return _0x2fcc63(_0x5ab659[_0x14e8('0x32')](0x1f4,_0x1d6683));}}logger[_0x14e8('0x32')](_0x14e8('0x42'));return _0x2fcc63(_0x5ab659[_0x14e8('0x32')](0x1f4,_0x14e8('0x42')));});},'AgentCapacity':function(_0x3a157c){var _0x12a2b3=this;return new Promise(function(_0x2da07b,_0x455764){if(_0x4e1064[_0x14e8('0x3b')]['hasOwnProperty'](_0x3a157c['id'])){for(var _0x35e1ea in _0x3a157c[_0x14e8('0x43')]){if(_0x3a157c[_0x14e8('0x43')][_0x14e8('0x44')](_0x35e1ea)){if(_0x4e1064[_0x14e8('0x3b')][_0x3a157c['id']][_0x14e8('0x44')](_0x35e1ea+_0x14e8('0x45'))){_0x4e1064[_0x14e8('0x3b')][_0x3a157c['id']][_0x35e1ea+_0x14e8('0x45')]=parseInt(_0x3a157c[_0x14e8('0x43')][_0x35e1ea],0xa);}}}_0x4e1064[_0x14e8('0x3b')][_0x3a157c['id']][_0x14e8('0x46')]();return _0x2da07b({'code':0xc8,'message':_0x4e1064['agents'][_0x3a157c['id']]});}else{return _0x455764(_0x12a2b3[_0x14e8('0x32')](0x1f4,_0x14e8('0x47')));}});},'Agents':function(_0x5a35a0){return new Promise(function(_0x27315f,_0x2c2630){var _0x31e785=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x3b')]);_0x27315f({'count':_0x31e785[_0x14e8('0x19')],'rows':_0x31e785});});},'ChatQueues':function(_0x139405){return new Promise(function(_0x5b6e28,_0x4c30dd){var _0x5c1609=[];for(var _0x17cded in _0x4e1064[_0x14e8('0x49')]){if(_0x4e1064[_0x14e8('0x49')][_0x14e8('0x44')](_0x17cded)){var _0x39de9d=_0x4e1064[_0x14e8('0x49')][_0x17cded];var _0x402956={'id':_0x39de9d['id'],'available':_0x39de9d['available'],'loggedIn':_0x39de9d[_0x14e8('0x4a')],'name':_0x39de9d[_0x14e8('0x4b')],'paused':_0x39de9d['paused'],'waiting':_0x39de9d[_0x14e8('0x4c')]};_0x5c1609[_0x14e8('0x1f')](_0x402956);}}_0x5b6e28({'count':_0x5c1609['length'],'rows':_0x5c1609});});},'MailQueues':function(_0x58fa2e){return new Promise(function(_0x5efe1b,_0x379734){var _0xf0cae3=[];for(var _0x1109d3 in _0x4e1064[_0x14e8('0x4d')]){if(_0x4e1064['mailQueues'][_0x14e8('0x44')](_0x1109d3)){var _0x62a69c=_0x4e1064[_0x14e8('0x4d')][_0x1109d3];var _0x2e7956={'id':_0x62a69c['id'],'available':_0x62a69c[_0x14e8('0x4e')],'loggedIn':_0x62a69c[_0x14e8('0x4a')],'name':_0x62a69c['name'],'paused':_0x62a69c[_0x14e8('0x4f')],'waiting':_0x62a69c[_0x14e8('0x4c')]};_0xf0cae3[_0x14e8('0x1f')](_0x2e7956);}}_0x5efe1b({'count':_0xf0cae3['length'],'rows':_0xf0cae3});});},'OpenchannelQueues':function(_0x5add74){return new Promise(function(_0x20a598,_0x53d0c8){var _0x25f63c=[];for(var _0x5cbce8 in _0x4e1064[_0x14e8('0x50')]){if(_0x4e1064['openchannelQueues'][_0x14e8('0x44')](_0x5cbce8)){var _0x362bda=_0x4e1064['openchannelQueues'][_0x5cbce8];var _0x1daa74={'id':_0x362bda['id'],'available':_0x362bda[_0x14e8('0x4e')],'loggedIn':_0x362bda[_0x14e8('0x4a')],'name':_0x362bda[_0x14e8('0x4b')],'paused':_0x362bda[_0x14e8('0x4f')],'waiting':_0x362bda[_0x14e8('0x4c')]};_0x25f63c[_0x14e8('0x1f')](_0x1daa74);}}_0x20a598({'count':_0x25f63c[_0x14e8('0x19')],'rows':_0x25f63c});});},'SmsQueues':function(_0x24ad58){return new Promise(function(_0x3858cf,_0x1bc9c1){var _0x2e0e7d=[];for(var _0x316a7e in _0x4e1064['smsQueues']){if(_0x4e1064['smsQueues']['hasOwnProperty'](_0x316a7e)){var _0xd7427f=_0x4e1064[_0x14e8('0x51')][_0x316a7e];var _0x10e994={'id':_0xd7427f['id'],'available':_0xd7427f['available'],'loggedIn':_0xd7427f[_0x14e8('0x4a')],'name':_0xd7427f['name'],'paused':_0xd7427f['paused'],'waiting':_0xd7427f['waiting']};_0x2e0e7d[_0x14e8('0x1f')](_0x10e994);}}_0x3858cf({'count':_0x2e0e7d[_0x14e8('0x19')],'rows':_0x2e0e7d});});},'FaxQueues':function(_0x17f546){return new Promise(function(_0x4d29e3,_0xfc647b){var _0x4f83e9=[];for(var _0x36a4e0 in _0x4e1064[_0x14e8('0x52')]){if(_0x4e1064[_0x14e8('0x52')][_0x14e8('0x44')](_0x36a4e0)){var _0x3ab99d=_0x4e1064[_0x14e8('0x52')][_0x36a4e0];var _0x1918bb={'id':_0x3ab99d['id'],'available':_0x3ab99d[_0x14e8('0x4e')],'loggedIn':_0x3ab99d[_0x14e8('0x4a')],'name':_0x3ab99d['name'],'paused':_0x3ab99d[_0x14e8('0x4f')],'waiting':_0x3ab99d['waiting']};_0x4f83e9[_0x14e8('0x1f')](_0x1918bb);}}_0x4d29e3({'count':_0x4f83e9[_0x14e8('0x19')],'rows':_0x4f83e9});});},'WhatsappQueues':function(_0x53b143){return new Promise(function(_0x33552f,_0x168397){var _0x1ba2a7=[];for(var _0x3b5131 in _0x4e1064[_0x14e8('0x53')]){if(_0x4e1064[_0x14e8('0x53')]['hasOwnProperty'](_0x3b5131)){var _0x33abe5=_0x4e1064[_0x14e8('0x53')][_0x3b5131];var _0xc8b6c1={'id':_0x33abe5['id'],'available':_0x33abe5[_0x14e8('0x4e')],'loggedIn':_0x33abe5['loggedIn'],'name':_0x33abe5[_0x14e8('0x4b')],'paused':_0x33abe5[_0x14e8('0x4f')],'waiting':_0x33abe5[_0x14e8('0x4c')]};_0x1ba2a7[_0x14e8('0x1f')](_0xc8b6c1);}}_0x33552f({'count':_0x1ba2a7['length'],'rows':_0x1ba2a7});});},'ChatQueuesWaitingInteractions':function(_0x23c21f){return new Promise(function(_0x5b7f09,_0x1e8886){var _0x4bbfe3=_['values'](_0x4e1064[_0x14e8('0x54')]);_0x5b7f09({'count':_0x4bbfe3[_0x14e8('0x19')],'rows':_0x4bbfe3});});},'MailQueuesWaitingInteractions':function(_0x392bd1){return new Promise(function(_0x11b496,_0xe8425f){var _0xfa52f=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x55')]);_0x11b496({'count':_0xfa52f[_0x14e8('0x19')],'rows':_0xfa52f});});},'OpenchannelQueuesWaitingInteractions':function(_0x280a8c){return new Promise(function(_0x2ae8aa,_0x4f6c35){var _0x43dbee=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x56')]);_0x2ae8aa({'count':_0x43dbee['length'],'rows':_0x43dbee});});},'SmsQueuesWaitingInteractions':function(_0x5a9e57){return new Promise(function(_0x2e24fa,_0x368292){var _0xc3ebbc=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x57')]);_0x2e24fa({'count':_0xc3ebbc[_0x14e8('0x19')],'rows':_0xc3ebbc});});},'FaxQueuesWaitingInteractions':function(_0x7ad347){return new Promise(function(_0x196815,_0xe0027d){var _0x2cd26c=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x58')]);_0x196815({'count':_0x2cd26c[_0x14e8('0x19')],'rows':_0x2cd26c});});},'WhatsappQueuesWaitingInteractions':function(_0x13ffd2){return new Promise(function(_0x5c6fcb,_0x37e95e){var _0x5ba06e=_[_0x14e8('0x48')](_0x4e1064[_0x14e8('0x59')]);_0x5c6fcb({'count':_0x5ba06e[_0x14e8('0x19')],'rows':_0x5ba06e});});}};var _0x177d9c=jayson[_0x14e8('0x5a')](_0x3761a1)[_0x14e8('0x5b')]();_0x177d9c['on']('error',function(_0x755ab8){logger[_0x14e8('0x32')](JSON['stringify'](_0x755ab8));return _0x347216(_0x755ab8);});_0x177d9c[_0x14e8('0x12')](0x232c,_0x14e8('0x5c'),function(){console[_0x14e8('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x58d26e(_0x14e8('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 484e39a..862b0a3 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 _0xb55c=['when','log','stack','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x491083,_0x1b8cf4){var _0x1474c3=function(_0xfd003a){while(--_0xfd003a){_0x491083['push'](_0x491083['shift']());}};_0x1474c3(++_0x1b8cf4);}(_0xb55c,0x77));var _0xcb55=function(_0x104158,_0x23c876){_0x104158=_0x104158-0x0;var _0x2cd851=_0xb55c[_0x104158];return _0x2cd851;};'use strict';var util=require('util');var BPromise=require(_0xcb55('0x0'));var jayson=require(_0xcb55('0x1'));var _=require(_0xcb55('0x2'));var logger=require(_0xcb55('0x3'))('routing');var client=jayson[_0xcb55('0x4')][_0xcb55('0x5')]({'port':0x232a});function request(_0x383e85,_0x5ddffb){return new BPromise(function(_0xb08e5a,_0x26d1ef){return client[_0xcb55('0x6')](_0x383e85,_0x5ddffb)[_0xcb55('0x7')](function(_0x280922){if(_0x280922[_0xcb55('0x8')]){return _0x26d1ef(_0x280922[_0xcb55('0x8')][_0xcb55('0x9')]);}else{return _0xb08e5a(_0x280922[_0xcb55('0xa')]);}})[_0xcb55('0xb')](function(_0x19e1df){return _0x26d1ef(_0x19e1df);});});}exports['condition']=function(_0xf91f3d,_0x5adf0f,_0x49b70a){return function(_0xd2224a){if(_0x49b70a[_0xcb55('0xc')]&&!_0x49b70a[_0xcb55('0xc')][_0xf91f3d]){logger[_0xcb55('0xd')](_0xcb55('0xe'),_0xf91f3d);return _0xd2224a['stop']();}var _0x25aa57=[];for(var _0x17fdc5=0x0;_0x17fdc5<_0x5adf0f[_0xcb55('0xf')];_0x17fdc5+=0x1){_0x25aa57['push'](request(_0xcb55('0x10'),{'command':util['format'](_0xcb55('0x11'),_0x5adf0f[_0x17fdc5])})[_0xcb55('0x7')](function(_0x2d1683){return _0x2d1683&&_0x2d1683[_0xcb55('0x9')]&&_0x2d1683[_0xcb55('0x9')][_0xcb55('0x12')](_0xcb55('0x13'))>=0x0?!![]:![];})[_0xcb55('0xb')](function(_0x47047e){logger[_0xcb55('0x8')](_0xcb55('0x14'),_0xf91f3d,_0x5adf0f[_0x17fdc5]);}));}BPromise[_0xcb55('0x15')](_0x25aa57)[_0xcb55('0x7')](function(_0x4a5227){var _0x293f10=_[_0xcb55('0x16')](_0x4a5227);logger[_0xcb55('0xd')](_0xcb55('0x17'),_0xf91f3d,_0x5adf0f[_0xcb55('0x18')](_0xcb55('0x19')),_0x293f10);_0xd2224a[_0xcb55('0x1a')](_0x293f10);})[_0xcb55('0xb')](function(_0x4b5450){console[_0xcb55('0x1b')](_0x4b5450);logger['error'](_0xcb55('0x17'),_0xf91f3d,_0x5adf0f[_0xcb55('0x18')](_0xcb55('0x19')),_0x4b5450[_0xcb55('0x1c')]);_0xd2224a['stop']();});};}; \ No newline at end of file +var _0x1d05=['Command','format','iftime\x20%s','then','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util','bluebird','../../../config/logger','routing','client','http','request','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x1d05,0x1c0));var _0x51d0=function(_0x1324c0,_0x3a024e){_0x1324c0=_0x1324c0-0x0;var _0x5477fc=_0x1d05[_0x1324c0];return _0x5477fc;};'use strict';var util=require(_0x51d0('0x0'));var BPromise=require(_0x51d0('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x51d0('0x2'))(_0x51d0('0x3'));var client=jayson[_0x51d0('0x4')][_0x51d0('0x5')]({'port':0x232a});function request(_0x14244c,_0x552f88){return new BPromise(function(_0x5b7175,_0x53ab27){return client[_0x51d0('0x6')](_0x14244c,_0x552f88)['then'](function(_0x2988c4){if(_0x2988c4['error']){return _0x53ab27(_0x2988c4[_0x51d0('0x7')][_0x51d0('0x8')]);}else{return _0x5b7175(_0x2988c4[_0x51d0('0x9')]);}})['catch'](function(_0x7b1ace){return _0x53ab27(_0x7b1ace);});});}exports[_0x51d0('0xa')]=function(_0x338d9a,_0x1ff5d8,_0x303083){return function(_0x4e1b50){if(_0x303083[_0x51d0('0xb')]&&!_0x303083[_0x51d0('0xb')][_0x338d9a]){logger[_0x51d0('0xc')](_0x51d0('0xd'),_0x338d9a);return _0x4e1b50[_0x51d0('0xe')]();}var _0x201f0a=[];for(var _0x24996c=0x0;_0x24996c<_0x1ff5d8[_0x51d0('0xf')];_0x24996c+=0x1){_0x201f0a[_0x51d0('0x10')](request(_0x51d0('0x11'),{'command':util[_0x51d0('0x12')](_0x51d0('0x13'),_0x1ff5d8[_0x24996c])})[_0x51d0('0x14')](function(_0x25512f){return _0x25512f&&_0x25512f[_0x51d0('0x8')]&&_0x25512f[_0x51d0('0x8')][_0x51d0('0x15')](_0x51d0('0x16'))>=0x0?!![]:![];})[_0x51d0('0x17')](function(_0x378aaf){logger[_0x51d0('0x7')](_0x51d0('0x18'),_0x338d9a,_0x1ff5d8[_0x24996c]);}));}BPromise[_0x51d0('0x19')](_0x201f0a)['then'](function(_0xaabc08){var _0x45b3d8=_[_0x51d0('0x1a')](_0xaabc08);logger[_0x51d0('0xc')](_0x51d0('0x1b'),_0x338d9a,_0x1ff5d8[_0x51d0('0x1c')](_0x51d0('0x1d')),_0x45b3d8);_0x4e1b50[_0x51d0('0x1e')](_0x45b3d8);})[_0x51d0('0x17')](function(_0x490bea){console['log'](_0x490bea);logger['error'](_0x51d0('0x1b'),_0x338d9a,_0x1ff5d8[_0x51d0('0x1c')](_0x51d0('0x1d')),_0x490bea['stack']);_0x4e1b50['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index cc3c46c..1b158a3 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 _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x26e3ab,_0x424bbd){var _0x641423=function(_0x1ee0ed){while(--_0x1ee0ed){_0x26e3ab['push'](_0x26e3ab['shift']());}};_0x641423(++_0x424bbd);}(_0xb9a7,0x112));var _0x7b9a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xb9a7[_0x36c5b0];return _0xf19333;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file +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(_0x3f3885,_0x37ded3){var _0x574b34=function(_0x5ee05e){while(--_0x5ee05e){_0x3f3885['push'](_0x3f3885['shift']());}};_0x574b34(++_0x37ded3);}(_0x750a,0x140));var _0xa750=function(_0x2bad97,_0x14832c){_0x2bad97=_0x2bad97-0x0;var _0xa7ec73=_0x750a[_0x2bad97];return _0xa7ec73;};'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 diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index eed116b..ed97e85 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 _0x6050=['DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','userfield','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%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','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','includes','hangup','execif','gotoif','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','now'];(function(_0x51e3c6,_0xcaba20){var _0x17f560=function(_0x50343c){while(--_0x50343c){_0x51e3c6['push'](_0x51e3c6['shift']());}};_0x17f560(++_0xcaba20);}(_0x6050,0x196));var _0x0605=function(_0x4ba997,_0x2b017a){_0x4ba997=_0x4ba997-0x0;var _0x43dc92=_0x6050[_0x4ba997];return _0x43dc92;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var utils=require(_0x0605('0x2'));var transfers=require(_0x0605('0x3'));var dispositions=[_0x0605('0x4'),_0x0605('0x5'),'FAILED',_0x0605('0x4'),_0x0605('0x4'),_0x0605('0x4'),'ANSWERED','BUSY','FAILED',_0x0605('0x5'),'FAILED'];var channels={};function writeDB(_0x58f7d2){var _0x5660ad;if(transfers[_0x0605('0x6')][_0x58f7d2[_0x0605('0x7')]]){_0x5660ad=_0x58f7d2[_0x0605('0x7')];_0x58f7d2[_0x0605('0x7')]=transfers[_0x0605('0x6')][_0x58f7d2['uniqueid']][_0x0605('0x8')];}utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0xb'),_0x58f7d2[_0x0605('0x7')],_0x58f7d2[_0x0605('0xc')],_0x58f7d2[_0x0605('0xd')],_0x58f7d2[_0x0605('0xe')],_0x58f7d2[_0x0605('0xf')],_0x58f7d2[_0x0605('0x10')],_0x58f7d2[_0x0605('0x11')],_0x58f7d2[_0x0605('0x12')]));if(_0x58f7d2[_0x0605('0x13')]){utils[_0x0605('0x14')](_0x58f7d2[_0x0605('0x13')])[_0x0605('0x15')](function(_0x169a70){if(_0x169a70){_0x58f7d2[_0x0605('0x16')]=_0x169a70['id'];}utils[_0x0605('0x17')]('CreateVoiceCallReport',_0x58f7d2);});}else{utils[_0x0605('0x17')](_0x0605('0x18'),_0x58f7d2);}if(channels[_0x58f7d2[_0x0605('0x7')]]){delete channels[_0x58f7d2['uniqueid']];}else if(_0x5660ad&&channels[_0x5660ad]){if(!transfers['blinds'][_0x5660ad][_0x0605('0x19')])delete transfers[_0x0605('0x6')][_0x5660ad];delete channels[_0x5660ad];}}exports[_0x0605('0x1a')]=function(_0x2d46ef){try{utils[_0x0605('0x1b')](util[_0x0605('0xa')](_0x0605('0x1c'),_0x2d46ef[_0x0605('0x7')]),_0x2d46ef);if(_0x2d46ef[_0x0605('0x7')]==_0x2d46ef[_0x0605('0x1d')]&&_0x2d46ef[_0x0605('0xc')]!=_0x0605('0x1e')){utils[_0x0605('0x9')](util[_0x0605('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x2d46ef[_0x0605('0x7')],_0x2d46ef[_0x0605('0x1f')],_0x2d46ef[_0x0605('0x20')]));channels[_0x2d46ef[_0x0605('0x7')]]={'uniqueid':_0x2d46ef[_0x0605('0x7')],'accountcode':_0x2d46ef[_0x0605('0x13')],'source':_0x2d46ef[_0x0605('0x10')],'destination':_0x2d46ef[_0x0605('0x20')],'destinationcontext':_0x2d46ef[_0x0605('0x1f')],'channel':_0x2d46ef['channel'],'starttime':utils[_0x0605('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x0605('0x22')};}}catch(_0x118e9c){utils[_0x0605('0x23')](util[_0x0605('0xa')](_0x0605('0x1c'),_0x2d46ef[_0x0605('0x7')]),_0x118e9c);}};exports[_0x0605('0x24')]=function(_0x1ae3db){try{utils[_0x0605('0x1b')](util[_0x0605('0xa')](_0x0605('0x25'),_0x1ae3db[_0x0605('0x7')]),_0x1ae3db);if(!_['isNil'](channels[_0x1ae3db[_0x0605('0x7')]])&&_0x1ae3db[_0x0605('0x26')]==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1ae3db[_0x0605('0x7')],_0x1ae3db[_0x0605('0x1f')],_0x1ae3db[_0x0605('0xc')]));if(_[_0x0605('0x27')](channels[_0x1ae3db[_0x0605('0x7')]][_0x0605('0x28')])){channels[_0x1ae3db['uniqueid']][_0x0605('0x28')]=utils['now']();}}else if(!_[_0x0605('0x27')](channels[_0x1ae3db[_0x0605('0x1d')]])&&_0x1ae3db[_0x0605('0x26')]==0x6&&_0x1ae3db[_0x0605('0x1f')]!=_0x0605('0x29')){utils[_0x0605('0x9')](util['format'](_0x0605('0x2a'),_0x1ae3db[_0x0605('0x7')],_0x1ae3db[_0x0605('0x1d')],_0x1ae3db[_0x0605('0x1f')],_0x1ae3db[_0x0605('0xc')]));channels[_0x1ae3db[_0x0605('0x1d')]][_0x0605('0x13')]=_0x1ae3db[_0x0605('0x13')];channels[_0x1ae3db[_0x0605('0x1d')]][_0x0605('0x2b')]=_0x1ae3db[_0x0605('0xc')];if(_[_0x0605('0x27')](channels[_0x1ae3db[_0x0605('0x1d')]][_0x0605('0x2c')])){channels[_0x1ae3db[_0x0605('0x1d')]][_0x0605('0x2c')]=utils[_0x0605('0x21')]();}channels[_0x1ae3db[_0x0605('0x1d')]][_0x0605('0x2d')]=dispositions[_[_0x0605('0x2e')](_0x1ae3db[_0x0605('0x26')])]||_0x0605('0x2f');}}catch(_0x32a979){utils[_0x0605('0x23')](util[_0x0605('0xa')](_0x0605('0x25'),_0x1ae3db[_0x0605('0x7')]),_0x32a979);}};exports['hangup']=function(_0x259102){try{if(!_[_0x0605('0x27')](channels[_0x259102['uniqueid']])){utils[_0x0605('0x1b')](util[_0x0605('0xa')]('[%s][calls][hangup]',_0x259102[_0x0605('0x7')]),_0x259102);if(_[_0x0605('0x27')](channels[_0x259102[_0x0605('0x7')]][_0x0605('0x30')])){channels[_0x259102[_0x0605('0x7')]][_0x0605('0x30')]=_0x259102['calleridname']+'\x20<'+_0x259102['calleridnum']+'>';}utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x31'),_0x259102['uniqueid'],channels[_0x259102[_0x0605('0x7')]]['callerid'],_0x259102[_0x0605('0x32')]));channels[_0x259102[_0x0605('0x7')]][_0x0605('0x33')]=utils[_0x0605('0x21')]();channels[_0x259102[_0x0605('0x7')]][_0x0605('0x34')]=utils[_0x0605('0x35')](channels[_0x259102[_0x0605('0x7')]][_0x0605('0x33')],channels[_0x259102[_0x0605('0x7')]]['starttime']);channels[_0x259102[_0x0605('0x7')]]['billableseconds']=channels[_0x259102[_0x0605('0x7')]][_0x0605('0x2c')]?utils[_0x0605('0x35')](channels[_0x259102['uniqueid']]['endtime'],channels[_0x259102[_0x0605('0x7')]]['answertime']):0x0;writeDB(channels[_0x259102[_0x0605('0x7')]]);}}catch(_0x52f4b6){utils[_0x0605('0x23')](util[_0x0605('0xa')](_0x0605('0x36'),_0x259102[_0x0605('0x7')]),_0x52f4b6);}};exports[_0x0605('0x37')]=function(_0x1fdd42){try{if(!_[_0x0605('0x27')](channels[_0x1fdd42[_0x0605('0x38')]])){utils[_0x0605('0x1b')](util[_0x0605('0xa')](_0x0605('0x39'),_0x1fdd42['origtransfereruniqueid']),_0x1fdd42);if(channels[_0x1fdd42['localtwolinkedid']][_0x0605('0xc')]==_0x1fdd42['transfereechannel']){utils[_0x0605('0x9')](util[_0x0605('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x1fdd42[_0x0605('0x3a')],_0x1fdd42[_0x0605('0x38')],_0x1fdd42['secondtransfererchannel']));channels[_0x1fdd42[_0x0605('0x38')]][_0x0605('0x2b')]=_0x1fdd42['secondtransfererchannel'];channels[_0x1fdd42[_0x0605('0x38')]][_0x0605('0x3b')]='_attended';}else if(channels[_0x1fdd42[_0x0605('0x38')]]['channel']=_0x1fdd42['transfertargetchannel']){utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x3c'),_0x1fdd42[_0x0605('0x3a')],_0x1fdd42[_0x0605('0x38')],_0x1fdd42[_0x0605('0x3d')]));channels[_0x1fdd42[_0x0605('0x38')]][_0x0605('0x2b')]=_0x1fdd42['origtransfererchannel'];channels[_0x1fdd42[_0x0605('0x38')]][_0x0605('0x3b')]=_0x0605('0x3e');}}}catch(_0x483c20){utils[_0x0605('0x23')](util[_0x0605('0xa')](_0x0605('0x39'),_0x1fdd42[_0x0605('0x3a')]),_0x483c20);}};exports[_0x0605('0x3f')]=function(_0x86434d){try{if(!_[_0x0605('0x27')](channels[_0x86434d[_0x0605('0x7')]])){utils[_0x0605('0x1b')](util['format'](_0x0605('0x40'),_0x86434d[_0x0605('0x7')]),_0x86434d);channels[_0x86434d[_0x0605('0x7')]][_0x0605('0x41')]=utils[_0x0605('0x21')]();utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x42'),_0x86434d[_0x0605('0x7')],channels[_0x86434d[_0x0605('0x7')]]['musiconholdstartAt']));}}catch(_0x5a2c76){utils['error'](util[_0x0605('0xa')](_0x0605('0x40'),_0x86434d[_0x0605('0x7')]),_0x5a2c76);}};exports[_0x0605('0x43')]=function(_0xbd755e){try{if(!_[_0x0605('0x27')](channels[_0xbd755e['uniqueid']])){utils[_0x0605('0x1b')](util[_0x0605('0xa')](_0x0605('0x44'),_0xbd755e[_0x0605('0x7')]),_0xbd755e);if(!_['isNil'](channels[_0xbd755e[_0x0605('0x7')]][_0x0605('0x41')])){channels[_0xbd755e[_0x0605('0x7')]]['mohtime']+=utils['diffTime'](utils[_0x0605('0x21')](),channels[_0xbd755e[_0x0605('0x7')]][_0x0605('0x41')]);utils['info'](util['format'](_0x0605('0x45'),_0xbd755e['uniqueid'],channels[_0xbd755e[_0x0605('0x7')]][_0x0605('0x46')]));delete channels[_0xbd755e[_0x0605('0x7')]][_0x0605('0x41')];}}}catch(_0x248ecc){utils[_0x0605('0x23')](util[_0x0605('0xa')]('[%s][calls][musiconholdstop]',_0xbd755e[_0x0605('0x7')]),_0x248ecc);}};exports['varset']=function(_0x40dd01){try{if(!_['isNil'](channels[_0x40dd01[_0x0605('0x7')]])){utils[_0x0605('0x1b')](util[_0x0605('0xa')](_0x0605('0x47'),_0x40dd01['uniqueid']),_0x40dd01);if(!_['isNil'](_0x40dd01[_0x0605('0x48')][_0x0605('0x49')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x40dd01[_0x0605('0x7')],_0x40dd01[_0x0605('0x4a')]));channels[_0x40dd01[_0x0605('0x7')]][_0x0605('0x4b')]=_0x40dd01[_0x0605('0x4a')];}if(!_[_0x0605('0x27')](_0x40dd01['variable'][_0x0605('0x4c')])){utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x4d'),_0x40dd01[_0x0605('0x7')],_0x40dd01[_0x0605('0x4a')]));channels[_0x40dd01[_0x0605('0x7')]][_0x0605('0x4e')]=_0x40dd01['value'];channels[_0x40dd01['uniqueid']]['callerid']='\x22'+_0x40dd01[_0x0605('0x4a')]+_0x0605('0x4f')+_0x40dd01[_0x0605('0x4a')]+'>';}if(!_['isNil'](_0x40dd01['variable'][_0x0605('0x50')])||!_[_0x0605('0x27')](_0x40dd01[_0x0605('0x48')][_0x0605('0x51')])){utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x52'),_0x40dd01[_0x0605('0x7')],!_[_0x0605('0x27')](_0x40dd01[_0x0605('0x48')][_0x0605('0x50')])?_0x0605('0x50'):'xmd-callerid',_0x40dd01[_0x0605('0x4a')]));channels[_0x40dd01[_0x0605('0x7')]][_0x0605('0x30')]=_0x40dd01[_0x0605('0x4a')];}if(!_[_0x0605('0x27')](_0x40dd01[_0x0605('0x48')]['xmd-queue'])||!_[_0x0605('0x27')](_0x40dd01['variable']['xmcs-queue'])){utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x52'),_0x40dd01[_0x0605('0x7')],!_[_0x0605('0x27')](_0x40dd01[_0x0605('0x48')][_0x0605('0x53')])?_0x0605('0x53'):_0x0605('0x54'),_0x40dd01[_0x0605('0x4a')]));channels[_0x40dd01['uniqueid']]['lastapplication']='Queue';channels[_0x40dd01['uniqueid']]['lastdata']=_0x40dd01[_0x0605('0x4a')];channels[_0x40dd01[_0x0605('0x7')]][_0x0605('0xd')]=!![];}if(!_['isNil'](_0x40dd01[_0x0605('0x48')][_0x0605('0x55')])){utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x56'),_0x40dd01[_0x0605('0x7')],_0x40dd01['value']));channels[_0x40dd01[_0x0605('0x7')]][_0x0605('0x57')]=_0x40dd01[_0x0605('0x4a')];}if(!_['isNil'](_0x40dd01['variable']['xmd-cdrtype'])){utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x58'),_0x40dd01[_0x0605('0x7')],_0x40dd01['value']));channels[_0x40dd01['uniqueid']][_0x0605('0x59')]=_0x40dd01[_0x0605('0x4a')];}if(!_['isNil'](_0x40dd01[_0x0605('0x48')][_0x0605('0x5a')])){utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x5b'),_0x40dd01[_0x0605('0x7')],_0x40dd01[_0x0605('0x4a')]));channels[_0x40dd01[_0x0605('0x7')]][_0x0605('0x5c')]=_0x40dd01[_0x0605('0x4a')];}if(!_[_0x0605('0x27')](_0x40dd01[_0x0605('0x48')][_0x0605('0x5d')])){utils['info'](util['format'](_0x0605('0x5e'),_0x40dd01[_0x0605('0x7')],_0x40dd01[_0x0605('0x4a')]));channels[_0x40dd01['uniqueid']]['sipcallid']=_0x40dd01[_0x0605('0x4a')];}}}catch(_0x5f21b2){utils['error'](util[_0x0605('0xa')](_0x0605('0x47'),_0x40dd01[_0x0605('0x7')]),_0x5f21b2);}};exports['newexten']=function(_0x5963c9){try{if(!_['isNil'](channels[_0x5963c9[_0x0605('0x7')]])){utils['debug'](util[_0x0605('0xa')](_0x0605('0x5f'),_0x5963c9[_0x0605('0x7')]),_0x5963c9);utils[_0x0605('0x9')](util[_0x0605('0xa')](_0x0605('0x60'),_0x5963c9[_0x0605('0x7')],_0x5963c9[_0x0605('0x61')],_0x5963c9['appdata']));if(_0x5963c9['application'][_0x0605('0x62')]()==_0x0605('0x63')&&_['startsWith'](_0x5963c9[_0x0605('0x64')]['toLowerCase'](),_0x0605('0x65'))){var _0x2677b8=_0x5963c9['appdata'][_0x0605('0x66')]('=');var _0x5ad670=_0x2677b8[0x0][_0x0605('0x67')](_0x2677b8[0x0][_0x0605('0x68')]('(')+0x1,_0x2677b8[0x0][_0x0605('0x68')](')'));var _0xfc3687=_0x2677b8[0x1];channels[_0x5963c9['uniqueid']][_0x5ad670]=_0xfc3687;}if(!_[_0x0605('0x69')]([_0x0605('0x6a'),'noop',_0x0605('0x6b'),_0x0605('0x63'),_0x0605('0x6c')],_0x5963c9[_0x0605('0x61')][_0x0605('0x62')]())){channels[_0x5963c9[_0x0605('0x7')]]['lastapplication']=_0x5963c9['application'];channels[_0x5963c9[_0x0605('0x7')]][_0x0605('0x6d')]=_0x5963c9[_0x0605('0x64')];}}}catch(_0x4302fb){utils['error'](util[_0x0605('0xa')](_0x0605('0x5f'),_0x5963c9[_0x0605('0x7')]),_0x4302fb);}}; \ No newline at end of file +var _0x5fab=['calleridname','cause-txt','endtime','duration','diffTime','answertime','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%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<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','error','[%s][calls][newstate]','isNil','channelstate','context','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','toNumber','hangup','callerid'];(function(_0x389ad9,_0x2c925c){var _0x4421ae=function(_0x58f63b){while(--_0x58f63b){_0x389ad9['push'](_0x389ad9['shift']());}};_0x4421ae(++_0x2c925c);}(_0x5fab,0x177));var _0xb5fa=function(_0x1d34e3,_0x4f5844){_0x1d34e3=_0x1d34e3-0x0;var _0x34266b=_0x5fab[_0x1d34e3];return _0x34266b;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var utils=require('./utils');var transfers=require(_0xb5fa('0x2'));var dispositions=[_0xb5fa('0x3'),_0xb5fa('0x4'),_0xb5fa('0x4'),_0xb5fa('0x3'),_0xb5fa('0x3'),_0xb5fa('0x3'),_0xb5fa('0x5'),_0xb5fa('0x6'),_0xb5fa('0x4'),'FAILED','FAILED'];var channels={};function writeDB(_0x2e3804){var _0x1aec3e;if(transfers[_0xb5fa('0x7')][_0x2e3804['uniqueid']]){_0x1aec3e=_0x2e3804[_0xb5fa('0x8')];_0x2e3804[_0xb5fa('0x8')]=transfers[_0xb5fa('0x7')][_0x2e3804['uniqueid']]['transfereeuniqueid'];}utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0xb'),_0x2e3804[_0xb5fa('0x8')],_0x2e3804[_0xb5fa('0xc')],_0x2e3804[_0xb5fa('0xd')],_0x2e3804[_0xb5fa('0xe')],_0x2e3804[_0xb5fa('0xf')],_0x2e3804[_0xb5fa('0x10')],_0x2e3804['connectedlinenum'],_0x2e3804[_0xb5fa('0x11')]));if(_0x2e3804[_0xb5fa('0x12')]){utils['getUserByInternal'](_0x2e3804[_0xb5fa('0x12')])['then'](function(_0x265992){if(_0x265992){_0x2e3804[_0xb5fa('0x13')]=_0x265992['id'];}utils[_0xb5fa('0x14')](_0xb5fa('0x15'),_0x2e3804);});}else{utils[_0xb5fa('0x14')]('CreateVoiceCallReport',_0x2e3804);}if(channels[_0x2e3804['uniqueid']]){delete channels[_0x2e3804[_0xb5fa('0x8')]];}else if(_0x1aec3e&&channels[_0x1aec3e]){if(!transfers[_0xb5fa('0x7')][_0x1aec3e][_0xb5fa('0x16')])delete transfers[_0xb5fa('0x7')][_0x1aec3e];delete channels[_0x1aec3e];}}exports['newchannel']=function(_0x4fabcc){try{utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')](_0xb5fa('0x18'),_0x4fabcc[_0xb5fa('0x8')]),_0x4fabcc);if(_0x4fabcc[_0xb5fa('0x8')]==_0x4fabcc[_0xb5fa('0x19')]&&_0x4fabcc[_0xb5fa('0xc')]!=_0xb5fa('0x1a')){utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x1b'),_0x4fabcc[_0xb5fa('0x8')],_0x4fabcc['context'],_0x4fabcc[_0xb5fa('0x1c')]));channels[_0x4fabcc['uniqueid']]={'uniqueid':_0x4fabcc[_0xb5fa('0x8')],'accountcode':_0x4fabcc['accountcode'],'source':_0x4fabcc[_0xb5fa('0x10')],'destination':_0x4fabcc[_0xb5fa('0x1c')],'destinationcontext':_0x4fabcc['context'],'channel':_0x4fabcc[_0xb5fa('0xc')],'starttime':utils[_0xb5fa('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb5fa('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x32a85c){utils[_0xb5fa('0x1e')](util[_0xb5fa('0xa')]('[%s][calls][newchannel]',_0x4fabcc[_0xb5fa('0x8')]),_0x32a85c);}};exports['newstate']=function(_0x106c4b){try{utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')](_0xb5fa('0x1f'),_0x106c4b[_0xb5fa('0x8')]),_0x106c4b);if(!_[_0xb5fa('0x20')](channels[_0x106c4b[_0xb5fa('0x8')]])&&_0x106c4b[_0xb5fa('0x21')]==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x106c4b['uniqueid'],_0x106c4b[_0xb5fa('0x22')],_0x106c4b[_0xb5fa('0xc')]));if(_[_0xb5fa('0x20')](channels[_0x106c4b[_0xb5fa('0x8')]][_0xb5fa('0x23')])){channels[_0x106c4b[_0xb5fa('0x8')]][_0xb5fa('0x23')]=utils[_0xb5fa('0x1d')]();}}else if(!_[_0xb5fa('0x20')](channels[_0x106c4b[_0xb5fa('0x19')]])&&_0x106c4b[_0xb5fa('0x21')]==0x6&&_0x106c4b[_0xb5fa('0x22')]!=_0xb5fa('0x24')){utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x25'),_0x106c4b[_0xb5fa('0x8')],_0x106c4b[_0xb5fa('0x19')],_0x106c4b[_0xb5fa('0x22')],_0x106c4b[_0xb5fa('0xc')]));channels[_0x106c4b[_0xb5fa('0x19')]][_0xb5fa('0x12')]=_0x106c4b[_0xb5fa('0x12')];channels[_0x106c4b[_0xb5fa('0x19')]]['destinationchannel']=_0x106c4b[_0xb5fa('0xc')];if(_['isNil'](channels[_0x106c4b['linkedid']]['answertime'])){channels[_0x106c4b[_0xb5fa('0x19')]]['answertime']=utils[_0xb5fa('0x1d')]();}channels[_0x106c4b['linkedid']]['disposition']=dispositions[_[_0xb5fa('0x26')](_0x106c4b[_0xb5fa('0x21')])]||'ANSWERED';}}catch(_0x59f41d){utils[_0xb5fa('0x1e')](util[_0xb5fa('0xa')](_0xb5fa('0x1f'),_0x106c4b['uniqueid']),_0x59f41d);}};exports[_0xb5fa('0x27')]=function(_0xc28a80){try{if(!_['isNil'](channels[_0xc28a80[_0xb5fa('0x8')]])){utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')]('[%s][calls][hangup]',_0xc28a80[_0xb5fa('0x8')]),_0xc28a80);if(_[_0xb5fa('0x20')](channels[_0xc28a80[_0xb5fa('0x8')]]['callerid'])){channels[_0xc28a80[_0xb5fa('0x8')]][_0xb5fa('0x28')]=_0xc28a80[_0xb5fa('0x29')]+'\x20<'+_0xc28a80[_0xb5fa('0x10')]+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xc28a80['uniqueid'],channels[_0xc28a80['uniqueid']]['callerid'],_0xc28a80[_0xb5fa('0x2a')]));channels[_0xc28a80['uniqueid']][_0xb5fa('0x2b')]=utils[_0xb5fa('0x1d')]();channels[_0xc28a80[_0xb5fa('0x8')]][_0xb5fa('0x2c')]=utils[_0xb5fa('0x2d')](channels[_0xc28a80[_0xb5fa('0x8')]]['endtime'],channels[_0xc28a80['uniqueid']]['starttime']);channels[_0xc28a80[_0xb5fa('0x8')]]['billableseconds']=channels[_0xc28a80[_0xb5fa('0x8')]]['answertime']?utils['diffTime'](channels[_0xc28a80[_0xb5fa('0x8')]][_0xb5fa('0x2b')],channels[_0xc28a80[_0xb5fa('0x8')]][_0xb5fa('0x2e')]):0x0;writeDB(channels[_0xc28a80[_0xb5fa('0x8')]]);}}catch(_0x26ef1b){utils[_0xb5fa('0x1e')](util[_0xb5fa('0xa')](_0xb5fa('0x2f'),_0xc28a80[_0xb5fa('0x8')]),_0x26ef1b);}};exports['attendedtransfer']=function(_0x284bbb){try{if(!_['isNil'](channels[_0x284bbb[_0xb5fa('0x30')]])){utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')](_0xb5fa('0x31'),_0x284bbb[_0xb5fa('0x32')]),_0x284bbb);if(channels[_0x284bbb[_0xb5fa('0x30')]][_0xb5fa('0xc')]==_0x284bbb[_0xb5fa('0x33')]){utils['info'](util[_0xb5fa('0xa')](_0xb5fa('0x34'),_0x284bbb['origtransfereruniqueid'],_0x284bbb[_0xb5fa('0x30')],_0x284bbb['secondtransfererchannel']));channels[_0x284bbb[_0xb5fa('0x30')]][_0xb5fa('0x35')]=_0x284bbb['secondtransfererchannel'];channels[_0x284bbb['localtwolinkedid']][_0xb5fa('0x36')]=_0xb5fa('0x37');}else if(channels[_0x284bbb[_0xb5fa('0x30')]][_0xb5fa('0xc')]=_0x284bbb[_0xb5fa('0x38')]){utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x34'),_0x284bbb['origtransfereruniqueid'],_0x284bbb[_0xb5fa('0x30')],_0x284bbb[_0xb5fa('0x39')]));channels[_0x284bbb['localtwolinkedid']][_0xb5fa('0x35')]=_0x284bbb[_0xb5fa('0x39')];channels[_0x284bbb[_0xb5fa('0x30')]][_0xb5fa('0x36')]=_0xb5fa('0x37');}}}catch(_0x27d900){utils[_0xb5fa('0x1e')](util[_0xb5fa('0xa')](_0xb5fa('0x31'),_0x284bbb[_0xb5fa('0x32')]),_0x27d900);}};exports[_0xb5fa('0x3a')]=function(_0x2bafe4){try{if(!_[_0xb5fa('0x20')](channels[_0x2bafe4[_0xb5fa('0x8')]])){utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')]('[%s][calls][musiconholdstart]',_0x2bafe4['uniqueid']),_0x2bafe4);channels[_0x2bafe4[_0xb5fa('0x8')]]['musiconholdstartAt']=utils[_0xb5fa('0x1d')]();utils[_0xb5fa('0x9')](util['format'](_0xb5fa('0x3b'),_0x2bafe4[_0xb5fa('0x8')],channels[_0x2bafe4[_0xb5fa('0x8')]][_0xb5fa('0x3c')]));}}catch(_0x471517){utils[_0xb5fa('0x1e')](util['format'](_0xb5fa('0x3d'),_0x2bafe4['uniqueid']),_0x471517);}};exports[_0xb5fa('0x3e')]=function(_0x3907db){try{if(!_[_0xb5fa('0x20')](channels[_0x3907db['uniqueid']])){utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')]('[%s][calls][musiconholdstop]',_0x3907db['uniqueid']),_0x3907db);if(!_[_0xb5fa('0x20')](channels[_0x3907db[_0xb5fa('0x8')]][_0xb5fa('0x3c')])){channels[_0x3907db[_0xb5fa('0x8')]][_0xb5fa('0x3f')]+=utils[_0xb5fa('0x2d')](utils[_0xb5fa('0x1d')](),channels[_0x3907db[_0xb5fa('0x8')]][_0xb5fa('0x3c')]);utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x40'),_0x3907db[_0xb5fa('0x8')],channels[_0x3907db[_0xb5fa('0x8')]][_0xb5fa('0x3f')]));delete channels[_0x3907db[_0xb5fa('0x8')]][_0xb5fa('0x3c')];}}}catch(_0x24acea){utils['error'](util[_0xb5fa('0xa')](_0xb5fa('0x41'),_0x3907db[_0xb5fa('0x8')]),_0x24acea);}};exports[_0xb5fa('0x42')]=function(_0x10c68e){try{if(!_[_0xb5fa('0x20')](channels[_0x10c68e[_0xb5fa('0x8')]])){utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')](_0xb5fa('0x43'),_0x10c68e['uniqueid']),_0x10c68e);if(!_['isNil'](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x45')])){utils[_0xb5fa('0x9')](util['format'](_0xb5fa('0x46'),_0x10c68e[_0xb5fa('0x8')],_0x10c68e[_0xb5fa('0x47')]));channels[_0x10c68e[_0xb5fa('0x8')]][_0xb5fa('0x48')]=_0x10c68e[_0xb5fa('0x47')];}if(!_[_0xb5fa('0x20')](_0x10c68e['variable'][_0xb5fa('0x49')])){utils[_0xb5fa('0x9')](util['format'](_0xb5fa('0x4a'),_0x10c68e[_0xb5fa('0x8')],_0x10c68e['value']));channels[_0x10c68e[_0xb5fa('0x8')]][_0xb5fa('0x4b')]=_0x10c68e[_0xb5fa('0x47')];channels[_0x10c68e[_0xb5fa('0x8')]][_0xb5fa('0x28')]='\x22'+_0x10c68e[_0xb5fa('0x47')]+_0xb5fa('0x4c')+_0x10c68e[_0xb5fa('0x47')]+'>';}if(!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x4d')])||!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x4e')])){utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x4f'),_0x10c68e[_0xb5fa('0x8')],!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x4d')])?_0xb5fa('0x4d'):'xmd-callerid',_0x10c68e[_0xb5fa('0x47')]));channels[_0x10c68e[_0xb5fa('0x8')]][_0xb5fa('0x28')]=_0x10c68e['value'];}if(!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')]['xmd-queue'])||!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x50')])){utils['info'](util['format'](_0xb5fa('0x4f'),_0x10c68e[_0xb5fa('0x8')],!_[_0xb5fa('0x20')](_0x10c68e['variable'][_0xb5fa('0x51')])?_0xb5fa('0x51'):_0xb5fa('0x50'),_0x10c68e[_0xb5fa('0x47')]));channels[_0x10c68e['uniqueid']]['lastapplication']='Queue';channels[_0x10c68e[_0xb5fa('0x8')]][_0xb5fa('0x52')]=_0x10c68e[_0xb5fa('0x47')];channels[_0x10c68e['uniqueid']][_0xb5fa('0xd')]=!![];}if(!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x53')])){utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x54'),_0x10c68e[_0xb5fa('0x8')],_0x10c68e[_0xb5fa('0x47')]));channels[_0x10c68e[_0xb5fa('0x8')]][_0xb5fa('0x55')]=_0x10c68e[_0xb5fa('0x47')];}if(!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x56')])){utils['info'](util[_0xb5fa('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x10c68e[_0xb5fa('0x8')],_0x10c68e[_0xb5fa('0x47')]));channels[_0x10c68e[_0xb5fa('0x8')]][_0xb5fa('0x57')]=_0x10c68e[_0xb5fa('0x47')];}if(!_['isNil'](_0x10c68e[_0xb5fa('0x44')]['outboundrouteid'])){utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x58'),_0x10c68e[_0xb5fa('0x8')],_0x10c68e['value']));channels[_0x10c68e['uniqueid']]['routeid']=_0x10c68e[_0xb5fa('0x47')];}if(!_[_0xb5fa('0x20')](_0x10c68e[_0xb5fa('0x44')][_0xb5fa('0x59')])){utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x10c68e[_0xb5fa('0x8')],_0x10c68e['value']));channels[_0x10c68e['uniqueid']][_0xb5fa('0x59')]=_0x10c68e['value'];}}}catch(_0x5d11bb){utils['error'](util[_0xb5fa('0xa')]('[%s][calls][varset]',_0x10c68e[_0xb5fa('0x8')]),_0x5d11bb);}};exports[_0xb5fa('0x5a')]=function(_0x1f05f7){try{if(!_['isNil'](channels[_0x1f05f7['uniqueid']])){utils[_0xb5fa('0x17')](util[_0xb5fa('0xa')]('[%s][calls][newexten]',_0x1f05f7[_0xb5fa('0x8')]),_0x1f05f7);utils[_0xb5fa('0x9')](util[_0xb5fa('0xa')](_0xb5fa('0x5b'),_0x1f05f7['uniqueid'],_0x1f05f7[_0xb5fa('0x5c')],_0x1f05f7[_0xb5fa('0x5d')]));if(_0x1f05f7[_0xb5fa('0x5c')][_0xb5fa('0x5e')]()==_0xb5fa('0x5f')&&_[_0xb5fa('0x60')](_0x1f05f7[_0xb5fa('0x5d')]['toLowerCase'](),_0xb5fa('0x61'))){var _0x59777b=_0x1f05f7[_0xb5fa('0x5d')][_0xb5fa('0x62')]('=');var _0x55e087=_0x59777b[0x0][_0xb5fa('0x63')](_0x59777b[0x0][_0xb5fa('0x64')]('(')+0x1,_0x59777b[0x0][_0xb5fa('0x64')](')'));var _0x219b55=_0x59777b[0x1];channels[_0x1f05f7[_0xb5fa('0x8')]][_0x55e087]=_0x219b55;}if(!_[_0xb5fa('0x65')]([_0xb5fa('0x27'),_0xb5fa('0x66'),'execif',_0xb5fa('0x5f'),_0xb5fa('0x67')],_0x1f05f7[_0xb5fa('0x5c')][_0xb5fa('0x5e')]())){channels[_0x1f05f7['uniqueid']]['lastapplication']=_0x1f05f7['application'];channels[_0x1f05f7['uniqueid']][_0xb5fa('0x52')]=_0x1f05f7[_0xb5fa('0x5d')];}}}catch(_0xff504d){utils[_0xb5fa('0x1e')](util['format']('[%s][calls][newexten]',_0x1f05f7[_0xb5fa('0x8')]),_0xff504d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index cc6244d..d357115 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 _0xb4b1=['[core]\x20connected','shutdown','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','connect'];(function(_0x580f53,_0x634e22){var _0x12c8fc=function(_0x7fc002){while(--_0x7fc002){_0x580f53['push'](_0x580f53['shift']());}};_0x12c8fc(++_0x634e22);}(_0xb4b1,0x13d));var _0x1b4b=function(_0x38a855,_0x22fac5){_0x38a855=_0x38a855-0x0;var _0x107430=_0xb4b1[_0x38a855];return _0x107430;};'use strict';var utils=require(_0x1b4b('0x0'));exports[_0x1b4b('0x1')]=function(){utils['info'](_0x1b4b('0x2'));};exports[_0x1b4b('0x3')]=function(){utils[_0x1b4b('0x4')](_0x1b4b('0x5'));};exports['fullybooted']=function(){utils[_0x1b4b('0x4')](_0x1b4b('0x6'));};exports[_0x1b4b('0x7')]=function(_0x4176c5){utils[_0x1b4b('0x7')](_0x1b4b('0x8'),_0x4176c5);};exports[_0x1b4b('0x9')]=function(){utils[_0x1b4b('0x4')](_0x1b4b('0xa'));};exports['managerevent']=function(_0x3565bc){}; \ No newline at end of file +var _0x05ec=['info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','connect'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x05ec,0x1c0));var _0xc05e=function(_0xfc3efb,_0x58aa14){_0xfc3efb=_0xfc3efb-0x0;var _0xfcd987=_0x05ec[_0xfc3efb];return _0xfcd987;};'use strict';var utils=require(_0xc05e('0x0'));exports[_0xc05e('0x1')]=function(){utils['info']('[core]\x20connected');};exports['shutdown']=function(){utils[_0xc05e('0x2')](_0xc05e('0x3'));};exports[_0xc05e('0x4')]=function(){utils[_0xc05e('0x2')](_0xc05e('0x5'));};exports['error']=function(_0x3b8f48){utils[_0xc05e('0x6')](_0xc05e('0x7'),_0x3b8f48);};exports[_0xc05e('0x8')]=function(){utils[_0xc05e('0x2')]('[core]\x20close');};exports[_0xc05e('0x9')]=function(_0x1149d0){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 939a2dc..18932c1 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 _0xa3c5=['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','cause-txt','now','complete','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','info','uniqueid','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr(routeid)','split','error','format','varset','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','[%s][dials][dialbegin]','assign','lastevent','called','starttime','dialend','[%s][dials][dialend]'];(function(_0x220fec,_0x148df0){var _0x41a110=function(_0x1bb5e1){while(--_0x1bb5e1){_0x220fec['push'](_0x220fec['shift']());}};_0x41a110(++_0x148df0);}(_0xa3c5,0xd7));var _0x5a3c=function(_0x271c01,_0x3af2d5){_0x271c01=_0x271c01-0x0;var _0x45fad3=_0xa3c5[_0x271c01];return _0x45fad3;};'use strict';var _=require(_0x5a3c('0x0'));var util=require(_0x5a3c('0x1'));var utils=require(_0x5a3c('0x2'));var dials={};function writeDB(_0xc050b6){utils[_0x5a3c('0x3')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0xc050b6[_0x5a3c('0x4')],_0xc050b6[_0x5a3c('0x5')],_0xc050b6[_0x5a3c('0x6')],_0xc050b6[_0x5a3c('0x7')],_0xc050b6['connectedlinenum'],_0xc050b6[_0x5a3c('0x8')]));utils[_0x5a3c('0x9')](_0x5a3c('0xa'),_0xc050b6);delete dials[_0xc050b6['uniqueid']];}exports[_0x5a3c('0xb')]=function(_0x258fc8){try{utils[_0x5a3c('0xc')](util['format'](_0x5a3c('0xd'),_0x258fc8[_0x5a3c('0x4')]),_0x258fc8);utils[_0x5a3c('0x3')](util['format'](_0x5a3c('0xe'),_0x258fc8[_0x5a3c('0x4')],_0x258fc8[_0x5a3c('0xf')],_0x258fc8[_0x5a3c('0x10')]));if(_0x258fc8[_0x5a3c('0xf')]['toLowerCase']()=='set'&&_['startsWith'](_0x258fc8[_0x5a3c('0x10')][_0x5a3c('0x11')](),_0x5a3c('0x12'))){var _0x15f3bb=_0x258fc8[_0x5a3c('0x10')][_0x5a3c('0x13')]('=');dials[_0x258fc8['uniqueid']]={'routeId':_0x15f3bb[0x1]};}}catch(_0x30923b){utils[_0x5a3c('0x14')](util[_0x5a3c('0x15')](_0x5a3c('0xd'),_0x258fc8[_0x5a3c('0x4')]),_0x30923b);}};exports[_0x5a3c('0x16')]=function(_0x1f7330){try{utils[_0x5a3c('0xc')](util['format'](_0x5a3c('0x17'),_0x1f7330[_0x5a3c('0x4')]),_0x1f7330);if(!_['isNil'](_0x1f7330['variable'][_0x5a3c('0x18')])){utils[_0x5a3c('0x3')](util[_0x5a3c('0x15')](_0x5a3c('0x19'),_0x1f7330[_0x5a3c('0x4')],_0x1f7330[_0x5a3c('0x1a')]));dials[_0x1f7330[_0x5a3c('0x4')]]={'routeId':_0x1f7330['value']};}}catch(_0x4769bf){utils[_0x5a3c('0x14')](util[_0x5a3c('0x15')](_0x5a3c('0x17'),_0x1f7330[_0x5a3c('0x4')]),_0x4769bf);}};exports['dialbegin']=function(_0x3e2307){try{if(!_[_0x5a3c('0x1b')](dials[_0x3e2307[_0x5a3c('0x4')]])){utils[_0x5a3c('0xc')](util['format'](_0x5a3c('0x1c'),_0x3e2307[_0x5a3c('0x4')]),_0x3e2307);dials[_0x3e2307[_0x5a3c('0x4')]]=_[_0x5a3c('0x1d')](dials[_0x3e2307[_0x5a3c('0x4')]],_0x3e2307);dials[_0x3e2307['uniqueid']]['starttime']=utils['now']();dials[_0x3e2307[_0x5a3c('0x4')]][_0x5a3c('0x1e')]=_0x5a3c('0x1f');utils[_0x5a3c('0x3')](util[_0x5a3c('0x15')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3e2307[_0x5a3c('0x4')],dials[_0x3e2307[_0x5a3c('0x4')]][_0x5a3c('0x20')]));}}catch(_0x2fceeb){utils[_0x5a3c('0x14')](util[_0x5a3c('0x15')](_0x5a3c('0x1c'),_0x3e2307[_0x5a3c('0x4')]),_0x2fceeb);}};exports[_0x5a3c('0x21')]=function(_0x5dd274){try{if(!_['isNil'](dials[_0x5dd274[_0x5a3c('0x4')]])){utils[_0x5a3c('0xc')](util[_0x5a3c('0x15')](_0x5a3c('0x22'),_0x5dd274[_0x5a3c('0x4')]),_0x5dd274);dials[_0x5dd274['uniqueid']]['dialstatus']=_0x5dd274[_0x5a3c('0x8')];if(_0x5dd274[_0x5a3c('0x8')]=='ANSWER'){dials[_0x5dd274[_0x5a3c('0x4')]]=_['assign'](dials[_0x5dd274[_0x5a3c('0x4')]],_0x5dd274);dials[_0x5dd274[_0x5a3c('0x4')]][_0x5a3c('0x23')]=utils['now']();dials[_0x5dd274[_0x5a3c('0x4')]][_0x5a3c('0x1e')]=_0x5a3c('0x24');utils[_0x5a3c('0x3')](util[_0x5a3c('0x15')](_0x5a3c('0x25'),_0x5dd274['uniqueid'],_0x5dd274['dialstatus'],dials[_0x5dd274[_0x5a3c('0x4')]]['answertime']));}else{utils['info'](util[_0x5a3c('0x15')](_0x5a3c('0x26'),_0x5dd274[_0x5a3c('0x4')],_0x5dd274[_0x5a3c('0x8')]));}}}catch(_0x366abe){utils[_0x5a3c('0x14')](util[_0x5a3c('0x15')](_0x5a3c('0x22'),_0x5dd274['uniqueid']),_0x366abe);}};exports[_0x5a3c('0x27')]=function(_0x142f58){try{if(!_['isNil'](dials[_0x142f58[_0x5a3c('0x4')]])){utils['debug'](util[_0x5a3c('0x15')]('[%s][dials][hangup]',_0x142f58[_0x5a3c('0x4')]),_0x142f58);utils[_0x5a3c('0x3')](util['format'](_0x5a3c('0x28'),_0x142f58[_0x5a3c('0x4')],_0x142f58[_0x5a3c('0x7')],_0x142f58['calleridname'],_0x142f58[_0x5a3c('0x29')]));dials[_0x142f58[_0x5a3c('0x4')]]=_['assign'](dials[_0x142f58[_0x5a3c('0x4')]],{'endtime':utils[_0x5a3c('0x2a')](),'lastevent':_0x5a3c('0x2b')});dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x2c')]=utils[_0x5a3c('0x2d')](dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x2e')],dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x20')]);dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x2f')]=utils[_0x5a3c('0x2d')](dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x23')]||dials[_0x142f58['uniqueid']][_0x5a3c('0x2e')],dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x20')]);dials[_0x142f58['uniqueid']][_0x5a3c('0x30')]=dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x23')]?utils['diffTime'](dials[_0x142f58['uniqueid']][_0x5a3c('0x2e')],dials[_0x142f58[_0x5a3c('0x4')]][_0x5a3c('0x23')]):0x0;writeDB(dials[_0x142f58[_0x5a3c('0x4')]]);}}catch(_0x4658fe){utils[_0x5a3c('0x14')](util[_0x5a3c('0x15')](_0x5a3c('0x31'),_0x142f58[_0x5a3c('0x4')]),_0x4658fe);}}; \ No newline at end of file +var _0x79b0=['[%s][dials][dialend]','ANSWER','now','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend'];(function(_0x1daa6e,_0x1a84b1){var _0x228fd4=function(_0x52128c){while(--_0x52128c){_0x1daa6e['push'](_0x1daa6e['shift']());}};_0x228fd4(++_0x1a84b1);}(_0x79b0,0x17b));var _0x079b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x79b0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x079b('0x0'));var util=require(_0x079b('0x1'));var utils=require(_0x079b('0x2'));var dials={};function writeDB(_0x550988){utils['info'](util[_0x079b('0x3')](_0x079b('0x4'),_0x550988[_0x079b('0x5')],_0x550988['channel'],_0x550988[_0x079b('0x6')],_0x550988[_0x079b('0x7')],_0x550988[_0x079b('0x8')],_0x550988[_0x079b('0x9')]));utils[_0x079b('0xa')]('CreateVoiceDialReport',_0x550988);delete dials[_0x550988['uniqueid']];}exports[_0x079b('0xb')]=function(_0x494f82){try{utils[_0x079b('0xc')](util[_0x079b('0x3')]('[%s][dials][newexten]',_0x494f82['uniqueid']),_0x494f82);utils[_0x079b('0xd')](util[_0x079b('0x3')](_0x079b('0xe'),_0x494f82[_0x079b('0x5')],_0x494f82[_0x079b('0xf')],_0x494f82[_0x079b('0x10')]));if(_0x494f82[_0x079b('0xf')][_0x079b('0x11')]()=='set'&&_[_0x079b('0x12')](_0x494f82[_0x079b('0x10')][_0x079b('0x11')](),_0x079b('0x13'))){var _0x1ec05e=_0x494f82[_0x079b('0x10')][_0x079b('0x14')]('=');dials[_0x494f82[_0x079b('0x5')]]={'routeId':_0x1ec05e[0x1]};}}catch(_0x142f02){utils[_0x079b('0x15')](util[_0x079b('0x3')](_0x079b('0x16'),_0x494f82[_0x079b('0x5')]),_0x142f02);}};exports[_0x079b('0x17')]=function(_0x3d894a){try{utils['debug'](util[_0x079b('0x3')](_0x079b('0x18'),_0x3d894a[_0x079b('0x5')]),_0x3d894a);if(!_[_0x079b('0x19')](_0x3d894a[_0x079b('0x1a')][_0x079b('0x1b')])){utils['info'](util[_0x079b('0x3')](_0x079b('0x1c'),_0x3d894a['uniqueid'],_0x3d894a['value']));dials[_0x3d894a[_0x079b('0x5')]]={'routeId':_0x3d894a[_0x079b('0x1d')]};}}catch(_0x27e1c4){utils[_0x079b('0x15')](util[_0x079b('0x3')](_0x079b('0x18'),_0x3d894a[_0x079b('0x5')]),_0x27e1c4);}};exports['dialbegin']=function(_0x28cc17){try{if(!_[_0x079b('0x19')](dials[_0x28cc17['uniqueid']])){utils[_0x079b('0xc')](util[_0x079b('0x3')](_0x079b('0x1e'),_0x28cc17[_0x079b('0x5')]),_0x28cc17);dials[_0x28cc17[_0x079b('0x5')]]=_[_0x079b('0x1f')](dials[_0x28cc17[_0x079b('0x5')]],_0x28cc17);dials[_0x28cc17[_0x079b('0x5')]][_0x079b('0x20')]=utils['now']();dials[_0x28cc17['uniqueid']][_0x079b('0x21')]=_0x079b('0x22');utils[_0x079b('0xd')](util[_0x079b('0x3')](_0x079b('0x23'),_0x28cc17[_0x079b('0x5')],dials[_0x28cc17[_0x079b('0x5')]][_0x079b('0x20')]));}}catch(_0x5cde52){utils[_0x079b('0x15')](util[_0x079b('0x3')](_0x079b('0x1e'),_0x28cc17[_0x079b('0x5')]),_0x5cde52);}};exports[_0x079b('0x24')]=function(_0xd36dc5){try{if(!_[_0x079b('0x19')](dials[_0xd36dc5['uniqueid']])){utils[_0x079b('0xc')](util['format'](_0x079b('0x25'),_0xd36dc5[_0x079b('0x5')]),_0xd36dc5);dials[_0xd36dc5[_0x079b('0x5')]][_0x079b('0x9')]=_0xd36dc5['dialstatus'];if(_0xd36dc5['dialstatus']==_0x079b('0x26')){dials[_0xd36dc5['uniqueid']]=_[_0x079b('0x1f')](dials[_0xd36dc5[_0x079b('0x5')]],_0xd36dc5);dials[_0xd36dc5[_0x079b('0x5')]]['answertime']=utils[_0x079b('0x27')]();dials[_0xd36dc5['uniqueid']][_0x079b('0x21')]='connect';utils[_0x079b('0xd')](util[_0x079b('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0xd36dc5[_0x079b('0x5')],_0xd36dc5[_0x079b('0x9')],dials[_0xd36dc5[_0x079b('0x5')]][_0x079b('0x28')]));}else{utils['info'](util['format'](_0x079b('0x29'),_0xd36dc5[_0x079b('0x5')],_0xd36dc5[_0x079b('0x9')]));}}}catch(_0x59d168){utils['error'](util[_0x079b('0x3')](_0x079b('0x25'),_0xd36dc5['uniqueid']),_0x59d168);}};exports[_0x079b('0x2a')]=function(_0x453a82){try{if(!_[_0x079b('0x19')](dials[_0x453a82['uniqueid']])){utils['debug'](util[_0x079b('0x3')](_0x079b('0x2b'),_0x453a82[_0x079b('0x5')]),_0x453a82);utils['info'](util[_0x079b('0x3')](_0x079b('0x2c'),_0x453a82[_0x079b('0x5')],_0x453a82[_0x079b('0x7')],_0x453a82[_0x079b('0x2d')],_0x453a82[_0x079b('0x2e')]));dials[_0x453a82[_0x079b('0x5')]]=_['assign'](dials[_0x453a82[_0x079b('0x5')]],{'endtime':utils[_0x079b('0x27')](),'lastevent':_0x079b('0x2f')});dials[_0x453a82[_0x079b('0x5')]][_0x079b('0x30')]=utils[_0x079b('0x31')](dials[_0x453a82[_0x079b('0x5')]][_0x079b('0x32')],dials[_0x453a82['uniqueid']][_0x079b('0x20')]);dials[_0x453a82[_0x079b('0x5')]][_0x079b('0x33')]=utils[_0x079b('0x31')](dials[_0x453a82[_0x079b('0x5')]]['answertime']||dials[_0x453a82['uniqueid']][_0x079b('0x32')],dials[_0x453a82[_0x079b('0x5')]][_0x079b('0x20')]);dials[_0x453a82['uniqueid']]['billableseconds']=dials[_0x453a82[_0x079b('0x5')]][_0x079b('0x28')]?utils[_0x079b('0x31')](dials[_0x453a82[_0x079b('0x5')]]['endtime'],dials[_0x453a82['uniqueid']][_0x079b('0x28')]):0x0;writeDB(dials[_0x453a82['uniqueid']]);}}catch(_0x3b7c1c){utils[_0x079b('0x15')](util[_0x079b('0x3')]('[%s][dials][hangup]',_0x453a82[_0x079b('0x5')]),_0x3b7c1c);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 10f43d1..b6924f9 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 _0x927a=['../../config/environment','./utils','xdr','disabled','production','local','asterisk','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./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','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','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','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x104b47,_0x491eff){var _0x34a3f1=function(_0x467a15){while(--_0x467a15){_0x104b47['push'](_0x104b47['shift']());}};_0x34a3f1(++_0x491eff);}(_0x927a,0x15e));var _0xa927=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x927a[_0x13606d];return _0x1b85b0;};var AsteriskManager=require('asterisk-manager');var config=require(_0xa927('0x0'));var utils=require(_0xa927('0x1'));var util=require('util');var isXDREnabled=config[_0xa927('0x2')]&&config[_0xa927('0x2')][_0xa927('0x3')]?!config['xdr'][_0xa927('0x3')]:!![];var isProduction=config['env']===_0xa927('0x4')||![];var isLocalAsterisk=config[_0xa927('0x2')]&&config['xdr'][_0xa927('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xa927('0x6')]['port'],config[_0xa927('0x6')]['ip'],config[_0xa927('0x6')]['username'],config['asterisk']['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xa927('0x7')](_0xa927('0x8'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa927('0x7')](_0xa927('0x9'));}else{var agents=require(_0xa927('0xa'));var calls=require(_0xa927('0xb'));var queues=require(_0xa927('0xc'));var recordings=require(_0xa927('0xd'));var members=require(_0xa927('0xe'));var dials=require(_0xa927('0xf'));var transfers=require(_0xa927('0x10'));var core=require(_0xa927('0x11'));ami['on'](_0xa927('0x12'),core[_0xa927('0x12')]);ami['on']('shutdown',core[_0xa927('0x13')]);ami['on'](_0xa927('0x14'),core[_0xa927('0x14')]);ami['on']('error',core[_0xa927('0x15')]);ami['on'](_0xa927('0x16'),core[_0xa927('0x16')]);ami['on'](_0xa927('0x17'),core[_0xa927('0x17')]);ami['on'](_0xa927('0x18'),function(_0x43bd65){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x1b'),_0x43bd65[_0xa927('0x1c')]),_0x43bd65);members['devicestatechange'](_0x43bd65);}catch(_0x55a936){utils['error'](util[_0xa927('0x1a')](_0xa927('0x1b'),_0x43bd65['device']),_0x55a936);}});ami['on']('agentcalled',function(_0xa737e){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x1d'),_0xa737e[_0xa927('0x1e')]),_0xa737e);agents[_0xa927('0x1f')](_0xa737e);}catch(_0x5b993c){utils['error'](util[_0xa927('0x1a')]('[%s][index][agentcalled]',_0xa737e[_0xa927('0x1e')]),_0x5b993c);}});ami['on'](_0xa927('0x20'),function(_0x5bf7af){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x21'),_0x5bf7af[_0xa927('0x1e')]),_0x5bf7af);agents[_0xa927('0x20')](_0x5bf7af);}catch(_0x4d4ccd){utils[_0xa927('0x15')](util['format'](_0xa927('0x21'),_0x5bf7af[_0xa927('0x1e')]),_0x4d4ccd);}});ami['on'](_0xa927('0x22'),function(_0x52f008){try{utils['debug'](util[_0xa927('0x1a')](_0xa927('0x23'),_0x52f008[_0xa927('0x1e')]),_0x52f008);agents[_0xa927('0x22')](_0x52f008);queues[_0xa927('0x22')](_0x52f008);}catch(_0x21931e){utils['error'](util[_0xa927('0x1a')](_0xa927('0x23'),_0x52f008[_0xa927('0x1e')]),_0x21931e);}});ami['on'](_0xa927('0x24'),function(_0x274d69){try{utils[_0xa927('0x19')](util['format'](_0xa927('0x25'),_0x274d69[_0xa927('0x1e')]),_0x274d69);agents['agentcomplete'](_0x274d69);queues[_0xa927('0x24')](_0x274d69);members['agentcomplete'](_0x274d69);}catch(_0xd2f1d5){utils['error'](util['format'](_0xa927('0x25'),_0x274d69[_0xa927('0x1e')]),_0xd2f1d5);}});ami['on'](_0xa927('0x26'),function(_0x1bd7fe){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x27'),_0x1bd7fe[_0xa927('0x1e')]),_0x1bd7fe);agents[_0xa927('0x26')](_0x1bd7fe);queues[_0xa927('0x26')](_0x1bd7fe);}catch(_0x3b2b4e){utils['error'](util[_0xa927('0x1a')](_0xa927('0x27'),_0x1bd7fe['uniqueid']),_0x3b2b4e);}});ami['on'](_0xa927('0x28'),function(_0x19c6f3){try{utils[_0xa927('0x19')](util['format'](_0xa927('0x29'),_0x19c6f3[_0xa927('0x1e')]),_0x19c6f3);queues[_0xa927('0x28')](_0x19c6f3);recordings['queuecallerjoin'](_0x19c6f3);}catch(_0x3497ee){utils[_0xa927('0x15')](util['format'](_0xa927('0x29'),_0x19c6f3['uniqueid']),_0x3497ee);}});ami['on'](_0xa927('0x2a'),function(_0x1c1f51){try{utils[_0xa927('0x19')](util['format'](_0xa927('0x2b'),_0x1c1f51['uniqueid']),_0x1c1f51);queues[_0xa927('0x2a')](_0x1c1f51);}catch(_0x2f2fd5){utils[_0xa927('0x15')](util[_0xa927('0x1a')]('[%s][index][queuecallerleave]',_0x1c1f51[_0xa927('0x1e')]),_0x2f2fd5);}});ami['on'](_0xa927('0x2c'),function(_0xf1b565){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x2d'),_0xf1b565[_0xa927('0x1e')]),_0xf1b565);queues[_0xa927('0x2c')](_0xf1b565);calls[_0xa927('0x2c')](_0xf1b565);}catch(_0x465d6b){utils[_0xa927('0x15')](util[_0xa927('0x1a')](_0xa927('0x2d'),_0xf1b565[_0xa927('0x1e')]),_0x465d6b);}});ami['on'](_0xa927('0x2e'),function(_0x3ad252){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x2f'),_0x3ad252[_0xa927('0x1e')]),_0x3ad252);queues[_0xa927('0x2e')](_0x3ad252);calls[_0xa927('0x2e')](_0x3ad252);}catch(_0x80f80c){utils[_0xa927('0x15')](util[_0xa927('0x1a')](_0xa927('0x2f'),_0x3ad252[_0xa927('0x1e')]),_0x80f80c);}});ami['on'](_0xa927('0x30'),function(_0xc22947){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x31'),_0xc22947[_0xa927('0x1e')]),_0xc22947);calls[_0xa927('0x30')](_0xc22947);recordings['newstate'](_0xc22947);}catch(_0x326e6c){utils['error'](util['format']('[%s][index][newstate]',_0xc22947[_0xa927('0x1e')]),_0x326e6c);}});ami['on'](_0xa927('0x32'),function(_0x3f5c45){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')]('[%s][index][hangup]',_0x3f5c45['uniqueid']),_0x3f5c45);calls[_0xa927('0x32')](_0x3f5c45);recordings['hangup'](_0x3f5c45);dials[_0xa927('0x32')](_0x3f5c45);agents['hangup'](_0x3f5c45);queues[_0xa927('0x32')](_0x3f5c45);}catch(_0x3d84df){utils['error'](util['format'](_0xa927('0x33'),_0x3f5c45[_0xa927('0x1e')]),_0x3d84df);}});ami['on'](_0xa927('0x34'),function(_0x2fd6d0){try{utils[_0xa927('0x19')](util['format'](_0xa927('0x35'),_0x2fd6d0[_0xa927('0x1e')]),_0x2fd6d0);members[_0xa927('0x34')](_0x2fd6d0);}catch(_0x4bf852){utils[_0xa927('0x15')](util[_0xa927('0x1a')](_0xa927('0x35'),_0x2fd6d0[_0xa927('0x1e')]),_0x4bf852);}});ami['on'](_0xa927('0x36'),function(_0x468139){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')]('[%s][index][blindtransfer]',_0x468139[_0xa927('0x1e')]),_0x468139);queues[_0xa927('0x36')](_0x468139);agents[_0xa927('0x36')](_0x468139);transfers[_0xa927('0x36')](_0x468139);recordings['blindtransfer'](_0x468139);}catch(_0x180a77){utils[_0xa927('0x15')](util[_0xa927('0x1a')](_0xa927('0x37'),_0x468139[_0xa927('0x1e')]),_0x180a77);}});ami['on'](_0xa927('0x38'),function(_0x5e0e1b){try{utils['debug'](util['format'](_0xa927('0x39'),_0x5e0e1b[_0xa927('0x3a')]),_0x5e0e1b);queues[_0xa927('0x38')](_0x5e0e1b);transfers[_0xa927('0x38')](_0x5e0e1b);agents['attendedtransfer'](_0x5e0e1b);calls['attendedtransfer'](_0x5e0e1b);}catch(_0x25a484){utils[_0xa927('0x15')](util['format'](_0xa927('0x39'),_0x5e0e1b[_0xa927('0x3a')]),_0x25a484);}});ami['on'](_0xa927('0x3b'),function(_0x2cee8f){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x3c'),_0x2cee8f[_0xa927('0x1e')]),_0x2cee8f);queues[_0xa927('0x3b')](_0x2cee8f);recordings[_0xa927('0x3b')](_0x2cee8f);calls[_0xa927('0x3b')](_0x2cee8f);dials[_0xa927('0x3b')](_0x2cee8f);}catch(_0x4828ef){utils[_0xa927('0x15')](util[_0xa927('0x1a')](_0xa927('0x3c'),_0x2cee8f['uniqueid']),_0x4828ef);}});ami['on']('newexten',function(_0x1db6b9){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x3d'),_0x1db6b9[_0xa927('0x1e')]),_0x1db6b9);calls['newexten'](_0x1db6b9);recordings[_0xa927('0x3e')](_0x1db6b9);dials[_0xa927('0x3e')](_0x1db6b9);}catch(_0x1ed42a){utils['error'](util[_0xa927('0x1a')]('[%s][index][newexten]',_0x1db6b9[_0xa927('0x1e')]),_0x1ed42a);}});ami['on'](_0xa927('0x3f'),function(_0x290c59){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x40'),_0x290c59['uniqueid']),_0x290c59);calls[_0xa927('0x3f')](_0x290c59);recordings[_0xa927('0x3f')](_0x290c59);}catch(_0x2bbf85){utils[_0xa927('0x15')](util[_0xa927('0x1a')](_0xa927('0x40'),_0x290c59[_0xa927('0x1e')]),_0x2bbf85);}});ami['on'](_0xa927('0x41'),function(_0x111e0b){try{utils['debug'](util[_0xa927('0x1a')](_0xa927('0x42'),_0x111e0b['uniqueid']),_0x111e0b);dials[_0xa927('0x41')](_0x111e0b);}catch(_0x5b361e){utils['error'](util[_0xa927('0x1a')](_0xa927('0x43'),_0x111e0b['uniqueid']),_0x5b361e);}});ami['on'](_0xa927('0x44'),function(_0x12f38d){try{utils[_0xa927('0x19')](util[_0xa927('0x1a')](_0xa927('0x45'),_0x12f38d[_0xa927('0x1e')]),_0x12f38d);dials[_0xa927('0x44')](_0x12f38d);}catch(_0x1ac34d){utils[_0xa927('0x15')](util[_0xa927('0x1a')](_0xa927('0x45'),_0x12f38d[_0xa927('0x1e')]),_0x1ac34d);}});} \ No newline at end of file +var _0x94cd=['queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]'];(function(_0x24b951,_0x2108e8){var _0x534ee1=function(_0xf58b62){while(--_0xf58b62){_0x24b951['push'](_0x24b951['shift']());}};_0x534ee1(++_0x2108e8);}(_0x94cd,0x17f));var _0xd94c=function(_0x43c73d,_0x23edb6){_0x43c73d=_0x43c73d-0x0;var _0x341650=_0x94cd[_0x43c73d];return _0x341650;};var AsteriskManager=require(_0xd94c('0x0'));var config=require(_0xd94c('0x1'));var utils=require(_0xd94c('0x2'));var util=require('util');var isXDREnabled=config['xdr']&&config[_0xd94c('0x3')]['disabled']?!config[_0xd94c('0x3')][_0xd94c('0x4')]:!![];var isProduction=config[_0xd94c('0x5')]===_0xd94c('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0xd94c('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xd94c('0x7')][_0xd94c('0x8')],config['asterisk']['ip'],config['asterisk'][_0xd94c('0x9')],config[_0xd94c('0x7')][_0xd94c('0xa')],!![]);ami[_0xd94c('0xb')]();if(!isXDREnabled){utils[_0xd94c('0xc')](_0xd94c('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd94c('0xc')](_0xd94c('0xe'));}else{var agents=require('./agents.controller');var calls=require(_0xd94c('0xf'));var queues=require(_0xd94c('0x10'));var recordings=require(_0xd94c('0x11'));var members=require('./members.controller');var dials=require(_0xd94c('0x12'));var transfers=require(_0xd94c('0x13'));var core=require('./core.controller');ami['on']('connect',core[_0xd94c('0x14')]);ami['on'](_0xd94c('0x15'),core[_0xd94c('0x15')]);ami['on'](_0xd94c('0x16'),core[_0xd94c('0x16')]);ami['on'](_0xd94c('0x17'),core['error']);ami['on'](_0xd94c('0x18'),core[_0xd94c('0x18')]);ami['on']('managerevent',core[_0xd94c('0x19')]);ami['on'](_0xd94c('0x1a'),function(_0x1fb5e3){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')]('[%s][index][devicestatechange]',_0x1fb5e3[_0xd94c('0x1d')]),_0x1fb5e3);members[_0xd94c('0x1a')](_0x1fb5e3);}catch(_0x26c36b){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x1e'),_0x1fb5e3[_0xd94c('0x1d')]),_0x26c36b);}});ami['on'](_0xd94c('0x1f'),function(_0x172790){try{utils[_0xd94c('0x1b')](util['format'](_0xd94c('0x20'),_0x172790[_0xd94c('0x21')]),_0x172790);agents['agentcalled'](_0x172790);}catch(_0x37d2a8){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x20'),_0x172790[_0xd94c('0x21')]),_0x37d2a8);}});ami['on'](_0xd94c('0x22'),function(_0x5c4313){try{utils['debug'](util['format']('[%s][index][agentringnoanswer]',_0x5c4313[_0xd94c('0x21')]),_0x5c4313);agents['agentringnoanswer'](_0x5c4313);}catch(_0x330808){utils['error'](util['format'](_0xd94c('0x23'),_0x5c4313[_0xd94c('0x21')]),_0x330808);}});ami['on'](_0xd94c('0x24'),function(_0x5ebe9c){try{utils['debug'](util['format']('[%s][index][agentconnect]',_0x5ebe9c[_0xd94c('0x21')]),_0x5ebe9c);agents[_0xd94c('0x24')](_0x5ebe9c);queues[_0xd94c('0x24')](_0x5ebe9c);}catch(_0x3d7814){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x25'),_0x5ebe9c[_0xd94c('0x21')]),_0x3d7814);}});ami['on'](_0xd94c('0x26'),function(_0x13f993){try{utils['debug'](util['format'](_0xd94c('0x27'),_0x13f993[_0xd94c('0x21')]),_0x13f993);agents[_0xd94c('0x26')](_0x13f993);queues['agentcomplete'](_0x13f993);members['agentcomplete'](_0x13f993);}catch(_0x2b21c7){utils[_0xd94c('0x17')](util['format'](_0xd94c('0x27'),_0x13f993[_0xd94c('0x21')]),_0x2b21c7);}});ami['on'](_0xd94c('0x28'),function(_0xf023b0){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x29'),_0xf023b0[_0xd94c('0x21')]),_0xf023b0);agents[_0xd94c('0x28')](_0xf023b0);queues['queuecallerabandon'](_0xf023b0);}catch(_0x4119df){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x29'),_0xf023b0[_0xd94c('0x21')]),_0x4119df);}});ami['on']('queuecallerjoin',function(_0x49417c){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x2a'),_0x49417c[_0xd94c('0x21')]),_0x49417c);queues[_0xd94c('0x2b')](_0x49417c);recordings['queuecallerjoin'](_0x49417c);}catch(_0x1f2a6f){utils['error'](util['format'](_0xd94c('0x2a'),_0x49417c[_0xd94c('0x21')]),_0x1f2a6f);}});ami['on'](_0xd94c('0x2c'),function(_0xcada2a){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')]('[%s][index][queuecallerleave]',_0xcada2a[_0xd94c('0x21')]),_0xcada2a);queues[_0xd94c('0x2c')](_0xcada2a);}catch(_0x150b11){utils[_0xd94c('0x17')](util['format'](_0xd94c('0x2d'),_0xcada2a[_0xd94c('0x21')]),_0x150b11);}});ami['on']('musiconholdstart',function(_0x2418a6){try{utils['debug'](util[_0xd94c('0x1c')](_0xd94c('0x2e'),_0x2418a6[_0xd94c('0x21')]),_0x2418a6);queues[_0xd94c('0x2f')](_0x2418a6);calls[_0xd94c('0x2f')](_0x2418a6);}catch(_0x3472cc){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')]('[%s][index][musiconholdstart]',_0x2418a6[_0xd94c('0x21')]),_0x3472cc);}});ami['on']('musiconholdstop',function(_0x3fc3bf){try{utils['debug'](util[_0xd94c('0x1c')](_0xd94c('0x30'),_0x3fc3bf[_0xd94c('0x21')]),_0x3fc3bf);queues[_0xd94c('0x31')](_0x3fc3bf);calls[_0xd94c('0x31')](_0x3fc3bf);}catch(_0x183fe6){utils[_0xd94c('0x17')](util['format'](_0xd94c('0x30'),_0x3fc3bf['uniqueid']),_0x183fe6);}});ami['on']('newstate',function(_0x5ae7cf){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x32'),_0x5ae7cf[_0xd94c('0x21')]),_0x5ae7cf);calls[_0xd94c('0x33')](_0x5ae7cf);recordings[_0xd94c('0x33')](_0x5ae7cf);}catch(_0x18a52f){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')]('[%s][index][newstate]',_0x5ae7cf[_0xd94c('0x21')]),_0x18a52f);}});ami['on'](_0xd94c('0x34'),function(_0x15f3c7){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x35'),_0x15f3c7[_0xd94c('0x21')]),_0x15f3c7);calls[_0xd94c('0x34')](_0x15f3c7);recordings[_0xd94c('0x34')](_0x15f3c7);dials[_0xd94c('0x34')](_0x15f3c7);agents['hangup'](_0x15f3c7);queues['hangup'](_0x15f3c7);}catch(_0x123c22){utils[_0xd94c('0x17')](util['format'](_0xd94c('0x35'),_0x15f3c7[_0xd94c('0x21')]),_0x123c22);}});ami['on'](_0xd94c('0x36'),function(_0xe48e91){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x37'),_0xe48e91[_0xd94c('0x21')]),_0xe48e91);members[_0xd94c('0x36')](_0xe48e91);}catch(_0x555831){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x37'),_0xe48e91['uniqueid']),_0x555831);}});ami['on'](_0xd94c('0x38'),function(_0x57d31c){try{utils[_0xd94c('0x1b')](util['format'](_0xd94c('0x39'),_0x57d31c['uniqueid']),_0x57d31c);queues[_0xd94c('0x38')](_0x57d31c);agents[_0xd94c('0x38')](_0x57d31c);transfers[_0xd94c('0x38')](_0x57d31c);recordings[_0xd94c('0x38')](_0x57d31c);}catch(_0x5621eb){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x39'),_0x57d31c[_0xd94c('0x21')]),_0x5621eb);}});ami['on'](_0xd94c('0x3a'),function(_0x2bc5f8){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x3b'),_0x2bc5f8[_0xd94c('0x3c')]),_0x2bc5f8);queues[_0xd94c('0x3a')](_0x2bc5f8);transfers[_0xd94c('0x3a')](_0x2bc5f8);agents[_0xd94c('0x3a')](_0x2bc5f8);calls[_0xd94c('0x3a')](_0x2bc5f8);}catch(_0x3dd6ec){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x3b'),_0x2bc5f8['origtransfereruniqueid']),_0x3dd6ec);}});ami['on']('varset',function(_0x2c0dcb){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x3d'),_0x2c0dcb['uniqueid']),_0x2c0dcb);queues[_0xd94c('0x3e')](_0x2c0dcb);recordings['varset'](_0x2c0dcb);calls[_0xd94c('0x3e')](_0x2c0dcb);dials[_0xd94c('0x3e')](_0x2c0dcb);}catch(_0x1bffc5){utils['error'](util['format'](_0xd94c('0x3d'),_0x2c0dcb[_0xd94c('0x21')]),_0x1bffc5);}});ami['on']('newexten',function(_0x2e66c5){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')]('[%s][index][newexten]',_0x2e66c5[_0xd94c('0x21')]),_0x2e66c5);calls['newexten'](_0x2e66c5);recordings[_0xd94c('0x3f')](_0x2e66c5);dials[_0xd94c('0x3f')](_0x2e66c5);}catch(_0xa3c745){utils[_0xd94c('0x17')](util[_0xd94c('0x1c')](_0xd94c('0x40'),_0x2e66c5[_0xd94c('0x21')]),_0xa3c745);}});ami['on'](_0xd94c('0x41'),function(_0xf44c12){try{utils[_0xd94c('0x1b')](util[_0xd94c('0x1c')](_0xd94c('0x42'),_0xf44c12[_0xd94c('0x21')]),_0xf44c12);calls[_0xd94c('0x41')](_0xf44c12);recordings['newchannel'](_0xf44c12);}catch(_0x5d8f1c){utils[_0xd94c('0x17')](util['format'](_0xd94c('0x42'),_0xf44c12[_0xd94c('0x21')]),_0x5d8f1c);}});ami['on'](_0xd94c('0x43'),function(_0x231008){try{utils[_0xd94c('0x1b')](util['format'](_0xd94c('0x44'),_0x231008[_0xd94c('0x21')]),_0x231008);dials[_0xd94c('0x43')](_0x231008);}catch(_0x48ac82){utils['error'](util['format']('[%s]dialbegin',_0x231008[_0xd94c('0x21')]),_0x48ac82);}});ami['on'](_0xd94c('0x45'),function(_0x3f62e4){try{utils[_0xd94c('0x1b')](util['format'](_0xd94c('0x46'),_0x3f62e4[_0xd94c('0x21')]),_0x3f62e4);dials['dialend'](_0x3f62e4);}catch(_0x48c51e){utils[_0xd94c('0x17')](util['format'](_0xd94c('0x46'),_0x3f62e4[_0xd94c('0x21')]),_0x48c51e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b0c67b0..cb6a76b 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 _0x217b=['[%s][members][devicestatechange]','device','info','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','isNil','diffTime','exitAt','agentcomplete','queue','[%s][members][agentcomplete]','assign','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','source','[%s][members][cdr]','util','./utils','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','membername','type','getUserByInterface','interface','internal','request','CreateMemberReport','getUserByName','split','then','name','catch','error','some','devicestatechange','debug'];(function(_0x4aa6b2,_0x54395a){var _0x50005c=function(_0x1b77f7){while(--_0x1b77f7){_0x4aa6b2['push'](_0x4aa6b2['shift']());}};_0x50005c(++_0x54395a);}(_0x217b,0x199));var _0xb217=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x217b[_0x29d915];return _0x160f86;};'use strict';var _=require('lodash');var util=require(_0xb217('0x0'));var utils=require(_0xb217('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xb217('0x2')];function writeDB(_0x15fd5a){utils['info'](util[_0xb217('0x3')](_0xb217('0x4'),_0x15fd5a[_0xb217('0x5')],_0x15fd5a['interface'],_0x15fd5a[_0xb217('0x6')],_0x15fd5a['data2'],_0x15fd5a[_0xb217('0x7')],_0x15fd5a[_0xb217('0x8')]));if(_0x15fd5a['interface']){utils[_0xb217('0x9')](_0x15fd5a[_0xb217('0xa')])['then'](function(_0x27b68b){if(_0x27b68b){_0x15fd5a[_0xb217('0x7')]=_0x27b68b['name'];_0x15fd5a[_0xb217('0xb')]=_0x27b68b[_0xb217('0xb')];utils[_0xb217('0xc')](_0xb217('0xd'),_0x15fd5a);}else{utils[_0xb217('0xe')](_0x15fd5a[_0xb217('0xa')][_0xb217('0xf')]('/')[0x1])[_0xb217('0x10')](function(_0x5a5835){if(_0x5a5835){_0x15fd5a['membername']=_0x5a5835[_0xb217('0x11')];_0x15fd5a[_0xb217('0xb')]=_0x5a5835[_0xb217('0xb')];utils[_0xb217('0xc')](_0xb217('0xd'),_0x15fd5a);}});}})[_0xb217('0x12')](function(_0x1d6978){utils[_0xb217('0x13')](util['format']('[%s][members][writeDB]',_0x15fd5a[_0xb217('0x5')]),_0x1d6978);});}delete members[_0x15fd5a[_0xb217('0xa')]];}function startsWith(_0x17facd,_0x2b2b3e){return _[_0xb217('0x14')](_0x17facd,function(_0x5be0b8){return _['startsWith'](_0x2b2b3e,_0x5be0b8);});}exports[_0xb217('0x15')]=function(_0x17f7a4){try{utils[_0xb217('0x16')](util[_0xb217('0x3')](_0xb217('0x17'),members[_0x17f7a4[_0xb217('0x18')]]?members[_0x17f7a4['device']][_0xb217('0x5')]:_0x17f7a4['device']),_0x17f7a4);utils[_0xb217('0x19')](util[_0xb217('0x3')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x17f7a4['device']]?members[_0x17f7a4['device']][_0xb217('0x5')]:_0x17f7a4[_0xb217('0x18')],_0x17f7a4[_0xb217('0x1a')],_0x17f7a4[_0xb217('0x18')]));switch(_0x17f7a4['state']){case _0xb217('0x1b'):case _0xb217('0x1c'):if(!startsWith(exclude,_0x17f7a4[_0xb217('0x18')])){members[_0x17f7a4[_0xb217('0x18')]]={'channel':_0xb217('0x1d'),'interface':_0x17f7a4[_0xb217('0x18')],'type':'TALKING','enterAt':utils[_0xb217('0x1e')](),'role':_0xb217('0x1f')};}break;case _0xb217('0x20'):if(!_[_0xb217('0x21')](members[_0x17f7a4[_0xb217('0x18')]])){members[_0x17f7a4[_0xb217('0x18')]]['exitAt']=utils[_0xb217('0x1e')]();members[_0x17f7a4['device']]['duration']=utils[_0xb217('0x22')](members[_0x17f7a4[_0xb217('0x18')]][_0xb217('0x23')],members[_0x17f7a4[_0xb217('0x18')]]['enterAt']);if(members[_0x17f7a4['device']][_0xb217('0x5')]){writeDB(members[_0x17f7a4[_0xb217('0x18')]]);}}break;default:break;}}catch(_0x25dc41){utils[_0xb217('0x13')](util[_0xb217('0x3')](_0xb217('0x17'),members[_0x17f7a4[_0xb217('0x18')]]?members[_0x17f7a4[_0xb217('0x18')]][_0xb217('0x5')]:_0x17f7a4['device']),_0x25dc41);}};exports[_0xb217('0x24')]=function(_0x340083){try{if(!_[_0xb217('0x21')](members[_0x340083[_0xb217('0xa')]])){utils[_0xb217('0x16')](util[_0xb217('0x3')]('[%s][members][agentcomplete]',_0x340083[_0xb217('0x5')]),_0x340083);utils['info'](util[_0xb217('0x3')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x340083[_0xb217('0x5')],_0x340083[_0xb217('0xa')],_0x340083[_0xb217('0x25')]));members[_0x340083[_0xb217('0xa')]]=_['assign'](members[_0x340083['interface']],{'data4':_0x340083[_0xb217('0x25')],'uniqueid':_0x340083[_0xb217('0x5')]});}}catch(_0x2c88ac){utils[_0xb217('0x13')](util[_0xb217('0x3')](_0xb217('0x26'),_0x340083['uniqueid']),_0x2c88ac);}};exports['cdr']=function(_0x193876){try{utils[_0xb217('0x16')](util['format']('[%s][members][cdr]',_0x193876[_0xb217('0x5')]),_0x193876);if(_0x193876[_0xb217('0x6')]){var _0x57fca5=_0x193876[_0xb217('0x6')][_0xb217('0xf')]('-')[0x0];if(!_[_0xb217('0x21')](members[_0x57fca5])){members[_0x57fca5]=_[_0xb217('0x27')](members[_0x57fca5],{'data1':members[_0x57fca5][_0xb217('0x28')]||_0x193876[_0xb217('0x8')],'data2':members[_0x57fca5]['data2']||_0x193876['source'],'data3':members[_0x57fca5][_0xb217('0x29')]||_0x193876[_0xb217('0x2a')],'uniqueid':members[_0x57fca5][_0xb217('0x5')]||_0x193876[_0xb217('0x5')]});utils[_0xb217('0x19')](util['format'](_0xb217('0x2b'),_0x193876['uniqueid'],members[_0x57fca5][_0xb217('0x28')],members[_0x57fca5][_0xb217('0x2c')],members[_0x57fca5][_0xb217('0x29')]));if(members[_0x57fca5]['exitAt']){writeDB(members[_0x57fca5]);}}}if(_0x193876[_0xb217('0x2d')]){var _0xead9f7=_0x193876[_0xb217('0x2d')][_0xb217('0xf')]('-')[0x0];if(!_[_0xb217('0x21')](members[_0xead9f7])){members[_0xead9f7]=_[_0xb217('0x27')](members[_0xead9f7],{'data1':members[_0xead9f7]['data1']||_0x193876['type'],'data2':members[_0xead9f7][_0xb217('0x2c')]||_0x193876[_0xb217('0x2e')],'data3':members[_0xead9f7][_0xb217('0x29')]||_0x193876[_0xb217('0x2a')],'uniqueid':members[_0xead9f7][_0xb217('0x5')]||_0x193876[_0xb217('0x5')]});utils[_0xb217('0x19')](util[_0xb217('0x3')](_0xb217('0x2b'),_0x193876[_0xb217('0x5')],members[_0xead9f7][_0xb217('0x28')],members[_0xead9f7][_0xb217('0x2c')],members[_0xead9f7][_0xb217('0x29')]));if(members[_0xead9f7]['exitAt']){writeDB(members[_0xead9f7]);}}}}catch(_0x31e44c){utils[_0xb217('0x13')](util[_0xb217('0x3')](_0xb217('0x2f'),_0x193876[_0xb217('0x5')]),_0x31e44c);}}; \ No newline at end of file +var _0x7aaf=['error','[%s][members][writeDB]','uniqueid','devicestatechange','debug','format','[%s][members][devicestatechange]','device','state','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','data1','type','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','split','lodash','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','then','internal','request','CreateMemberReport','name','catch'];(function(_0x608209,_0x3cbd8b){var _0x48e72e=function(_0x31845f){while(--_0x31845f){_0x608209['push'](_0x608209['shift']());}};_0x48e72e(++_0x3cbd8b);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0xe5d437,_0x3da969){_0xe5d437=_0xe5d437-0x0;var _0x591057=_0x7aaf[_0xe5d437];return _0x591057;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var utils=require(_0xf7aa('0x1'));var members={};var exclude=[_0xf7aa('0x2'),'Queue:'];function writeDB(_0x4b942e){utils[_0xf7aa('0x3')](util['format'](_0xf7aa('0x4'),_0x4b942e['uniqueid'],_0x4b942e[_0xf7aa('0x5')],_0x4b942e[_0xf7aa('0x6')],_0x4b942e[_0xf7aa('0x7')],_0x4b942e[_0xf7aa('0x8')],_0x4b942e['type']));if(_0x4b942e[_0xf7aa('0x5')]){utils['getUserByInterface'](_0x4b942e['interface'])[_0xf7aa('0x9')](function(_0x6c0332){if(_0x6c0332){_0x4b942e['membername']=_0x6c0332['name'];_0x4b942e['internal']=_0x6c0332[_0xf7aa('0xa')];utils[_0xf7aa('0xb')](_0xf7aa('0xc'),_0x4b942e);}else{utils['getUserByName'](_0x4b942e[_0xf7aa('0x5')]['split']('/')[0x1])['then'](function(_0x76fd12){if(_0x76fd12){_0x4b942e[_0xf7aa('0x8')]=_0x76fd12[_0xf7aa('0xd')];_0x4b942e[_0xf7aa('0xa')]=_0x76fd12[_0xf7aa('0xa')];utils[_0xf7aa('0xb')](_0xf7aa('0xc'),_0x4b942e);}});}})[_0xf7aa('0xe')](function(_0x23e749){utils[_0xf7aa('0xf')](util['format'](_0xf7aa('0x10'),_0x4b942e[_0xf7aa('0x11')]),_0x23e749);});}delete members[_0x4b942e[_0xf7aa('0x5')]];}function startsWith(_0xf29da6,_0x5c8c69){return _['some'](_0xf29da6,function(_0x2377e3){return _['startsWith'](_0x5c8c69,_0x2377e3);});}exports[_0xf7aa('0x12')]=function(_0x15d263){try{utils[_0xf7aa('0x13')](util[_0xf7aa('0x14')](_0xf7aa('0x15'),members[_0x15d263[_0xf7aa('0x16')]]?members[_0x15d263[_0xf7aa('0x16')]][_0xf7aa('0x11')]:_0x15d263[_0xf7aa('0x16')]),_0x15d263);utils[_0xf7aa('0x3')](util[_0xf7aa('0x14')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x15d263['device']]?members[_0x15d263[_0xf7aa('0x16')]]['uniqueid']:_0x15d263[_0xf7aa('0x16')],_0x15d263[_0xf7aa('0x17')],_0x15d263[_0xf7aa('0x16')]));switch(_0x15d263['state']){case'INUSE':case _0xf7aa('0x18'):if(!startsWith(exclude,_0x15d263[_0xf7aa('0x16')])){members[_0x15d263['device']]={'channel':_0xf7aa('0x19'),'interface':_0x15d263['device'],'type':_0xf7aa('0x1a'),'enterAt':utils[_0xf7aa('0x1b')](),'role':_0xf7aa('0x1c')};}break;case _0xf7aa('0x1d'):if(!_[_0xf7aa('0x1e')](members[_0x15d263[_0xf7aa('0x16')]])){members[_0x15d263[_0xf7aa('0x16')]][_0xf7aa('0x1f')]=utils['now']();members[_0x15d263[_0xf7aa('0x16')]]['duration']=utils[_0xf7aa('0x20')](members[_0x15d263[_0xf7aa('0x16')]][_0xf7aa('0x1f')],members[_0x15d263[_0xf7aa('0x16')]]['enterAt']);if(members[_0x15d263[_0xf7aa('0x16')]][_0xf7aa('0x11')]){writeDB(members[_0x15d263[_0xf7aa('0x16')]]);}}break;default:break;}}catch(_0x2b5fbc){utils[_0xf7aa('0xf')](util[_0xf7aa('0x14')](_0xf7aa('0x15'),members[_0x15d263['device']]?members[_0x15d263['device']]['uniqueid']:_0x15d263[_0xf7aa('0x16')]),_0x2b5fbc);}};exports[_0xf7aa('0x21')]=function(_0x23d309){try{if(!_[_0xf7aa('0x1e')](members[_0x23d309[_0xf7aa('0x5')]])){utils['debug'](util[_0xf7aa('0x14')](_0xf7aa('0x22'),_0x23d309[_0xf7aa('0x11')]),_0x23d309);utils[_0xf7aa('0x3')](util[_0xf7aa('0x14')](_0xf7aa('0x23'),_0x23d309[_0xf7aa('0x11')],_0x23d309[_0xf7aa('0x5')],_0x23d309[_0xf7aa('0x24')]));members[_0x23d309[_0xf7aa('0x5')]]=_[_0xf7aa('0x25')](members[_0x23d309[_0xf7aa('0x5')]],{'data4':_0x23d309['queue'],'uniqueid':_0x23d309[_0xf7aa('0x11')]});}}catch(_0x3cdc78){utils['error'](util[_0xf7aa('0x14')](_0xf7aa('0x22'),_0x23d309['uniqueid']),_0x3cdc78);}};exports['cdr']=function(_0x162560){try{utils[_0xf7aa('0x13')](util[_0xf7aa('0x14')]('[%s][members][cdr]',_0x162560[_0xf7aa('0x11')]),_0x162560);if(_0x162560[_0xf7aa('0x6')]){var _0x2b5cd9=_0x162560['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x2b5cd9])){members[_0x2b5cd9]=_['assign'](members[_0x2b5cd9],{'data1':members[_0x2b5cd9][_0xf7aa('0x26')]||_0x162560[_0xf7aa('0x27')],'data2':members[_0x2b5cd9][_0xf7aa('0x7')]||_0x162560[_0xf7aa('0x28')],'data3':members[_0x2b5cd9]['data3']||_0x162560[_0xf7aa('0x29')],'uniqueid':members[_0x2b5cd9][_0xf7aa('0x11')]||_0x162560['uniqueid']});utils[_0xf7aa('0x3')](util[_0xf7aa('0x14')](_0xf7aa('0x2a'),_0x162560['uniqueid'],members[_0x2b5cd9]['data1'],members[_0x2b5cd9][_0xf7aa('0x7')],members[_0x2b5cd9][_0xf7aa('0x2b')]));if(members[_0x2b5cd9][_0xf7aa('0x1f')]){writeDB(members[_0x2b5cd9]);}}}if(_0x162560['destinationchannel']){var _0x5bb7ba=_0x162560[_0xf7aa('0x2c')][_0xf7aa('0x2d')]('-')[0x0];if(!_[_0xf7aa('0x1e')](members[_0x5bb7ba])){members[_0x5bb7ba]=_[_0xf7aa('0x25')](members[_0x5bb7ba],{'data1':members[_0x5bb7ba][_0xf7aa('0x26')]||_0x162560[_0xf7aa('0x27')],'data2':members[_0x5bb7ba][_0xf7aa('0x7')]||_0x162560[_0xf7aa('0x28')],'data3':members[_0x5bb7ba][_0xf7aa('0x2b')]||_0x162560['destination'],'uniqueid':members[_0x5bb7ba][_0xf7aa('0x11')]||_0x162560[_0xf7aa('0x11')]});utils['info'](util['format'](_0xf7aa('0x2a'),_0x162560[_0xf7aa('0x11')],members[_0x5bb7ba][_0xf7aa('0x26')],members[_0x5bb7ba]['data2'],members[_0x5bb7ba][_0xf7aa('0x2b')]));if(members[_0x5bb7ba][_0xf7aa('0x1f')]){writeDB(members[_0x5bb7ba]);}}}}catch(_0x1ad521){utils['error'](util[_0xf7aa('0x14')]('[%s][members][cdr]',_0x162560[_0xf7aa('0x11')]),_0x1ad521);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index d6d60a3..535162c 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 _0x7fdc=['transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','type','request','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','varset','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER'];(function(_0x42a90d,_0x11c01c){var _0x37c156=function(_0x4ce075){while(--_0x4ce075){_0x42a90d['push'](_0x42a90d['shift']());}};_0x37c156(++_0x11c01c);}(_0x7fdc,0x1a0));var _0xc7fd=function(_0x351453,_0x34718d){_0x351453=_0x351453-0x0;var _0x37be69=_0x7fdc[_0x351453];return _0x37be69;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x3f9253){utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')](_0xc7fd('0x2'),_0x3f9253['uniqueid'],_0x3f9253[_0xc7fd('0x3')],_0x3f9253[_0xc7fd('0x4')],_0x3f9253[_0xc7fd('0x5')],_0x3f9253[_0xc7fd('0x6')],_0x3f9253[_0xc7fd('0x7')],_0x3f9253['queuecallerexitreason']));if(_0x3f9253[_0xc7fd('0x4')]){utils[_0xc7fd('0x8')](_0x3f9253[_0xc7fd('0x4')])['then'](function(_0x5740d9){if(_0x5740d9){_0x3f9253[_0xc7fd('0x9')]=_0x5740d9['type'];}utils[_0xc7fd('0xa')]('CreateVoiceQueueReport',_0x3f9253);});}else{utils[_0xc7fd('0xa')]('CreateVoiceQueueReport',_0x3f9253);}if(_0x3f9253[_0xc7fd('0xb')]){delete queues[_0x3f9253[_0xc7fd('0xb')]];}else{delete queues[_0x3f9253[_0xc7fd('0xc')]];}}exports['queuecallerjoin']=function(_0x493054){try{utils[_0xc7fd('0xd')](util[_0xc7fd('0x1')](_0xc7fd('0xe'),_0x493054[_0xc7fd('0xc')]),_0x493054);utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')](_0xc7fd('0xf'),_0x493054[_0xc7fd('0xc')],_0x493054[_0xc7fd('0x4')],_0x493054['position']));queues[_0x493054[_0xc7fd('0xc')]]=_[_0xc7fd('0x10')](_0x493054,{'originalposition':_0x493054[_0xc7fd('0x11')],'queuecallerjoinAt':utils[_0xc7fd('0x12')](),'mohtime':0x0});}catch(_0x4f6860){utils[_0xc7fd('0x13')](util[_0xc7fd('0x1')]('[%s][queues][queuecallerjoin]',_0x493054['uniqueid']),_0x4f6860);}};exports[_0xc7fd('0x14')]=function(_0x36a3fd){try{if(!_[_0xc7fd('0x15')](queues[_0x36a3fd[_0xc7fd('0xc')]])){utils[_0xc7fd('0xd')](util[_0xc7fd('0x1')](_0xc7fd('0x16'),_0x36a3fd[_0xc7fd('0xc')]),_0x36a3fd);if(queues[_0x36a3fd['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0x17')]&&!queues[_0x36a3fd[_0xc7fd('0xc')]]['queuecallerexit']){queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0x18')]=!![];queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0x19')]=utils[_0xc7fd('0x12')]();queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0x1a')]=_0xc7fd('0x1b');}utils[_0xc7fd('0x0')](util['format'](_0xc7fd('0x1c'),_0x36a3fd[_0xc7fd('0xc')],queues[_0x36a3fd['uniqueid']]['name'],queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0x1a')]));writeDB(queues[_0x36a3fd[_0xc7fd('0xc')]]);}else if(queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0xb')]){utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')](_0xc7fd('0x1d'),_0x36a3fd[_0xc7fd('0xc')],queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0x1e')],queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0xb')]));queues[queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0xb')]]=queues[_0x36a3fd[_0xc7fd('0xc')]];queues[queues[_0x36a3fd[_0xc7fd('0xc')]][_0xc7fd('0xb')]]['queuecallerenterreason']=0x2;delete queues[_0x36a3fd[_0xc7fd('0xc')]];}}}catch(_0x5b2c89){utils[_0xc7fd('0x13')](util['format'](_0xc7fd('0x16'),_0x36a3fd[_0xc7fd('0xc')]),_0x5b2c89);}};exports[_0xc7fd('0x1f')]=function(_0x450cb7){try{utils[_0xc7fd('0xd')](util['format']('[%s][queues][varset]',_0x450cb7[_0xc7fd('0xc')]),_0x450cb7);if(!_['isNil'](_0x450cb7[_0xc7fd('0x20')][_0xc7fd('0x21')])&&_0x450cb7['value'][_0xc7fd('0x22')]()!==_0xc7fd('0x23')){if(!_['isNil'](queues[_0x450cb7['uniqueid']])){queues[_0x450cb7['uniqueid']][_0xc7fd('0x17')]=![];queues[_0x450cb7[_0xc7fd('0xc')]][_0xc7fd('0x24')]=null;queues[_0x450cb7[_0xc7fd('0xc')]]['queuecallerexit']=!![];queues[_0x450cb7[_0xc7fd('0xc')]][_0xc7fd('0x25')]=utils['now']();queues[_0x450cb7['uniqueid']][_0xc7fd('0x1a')]=_0x450cb7[_0xc7fd('0x26')][_0xc7fd('0x22')]();utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')](_0xc7fd('0x27'),_0x450cb7['uniqueid'],queues[_0x450cb7[_0xc7fd('0xc')]]['name'],_0x450cb7[_0xc7fd('0x26')],queues[_0x450cb7['uniqueid']][_0xc7fd('0x1a')]));writeDB(queues[_0x450cb7[_0xc7fd('0xc')]]);}}else if(!_[_0xc7fd('0x15')](_0x450cb7[_0xc7fd('0x20')][_0xc7fd('0x28')])){if(!_[_0xc7fd('0x15')](queues[_0x450cb7[_0xc7fd('0xc')]])&&!queues[_0x450cb7[_0xc7fd('0xc')]][_0xc7fd('0x17')]){queues[_0x450cb7['uniqueid']]['queuecallerabandon']=![];queues[_0x450cb7[_0xc7fd('0xc')]][_0xc7fd('0x24')]=null;queues[_0x450cb7[_0xc7fd('0xc')]][_0xc7fd('0x29')]=!![];queues[_0x450cb7['uniqueid']][_0xc7fd('0x25')]=utils[_0xc7fd('0x12')]();queues[_0x450cb7[_0xc7fd('0xc')]][_0xc7fd('0x1a')]='EXITWITHKEY';utils[_0xc7fd('0x0')](util['format'](_0xc7fd('0x2a'),_0x450cb7[_0xc7fd('0xc')],queues[_0x450cb7[_0xc7fd('0xc')]][_0xc7fd('0x1e')],_0x450cb7[_0xc7fd('0x26')],queues[_0x450cb7[_0xc7fd('0xc')]]['queuecallerexitreason']));}}}catch(_0xa2989){utils[_0xc7fd('0x13')](util[_0xc7fd('0x1')](_0xc7fd('0x2b'),_0x450cb7[_0xc7fd('0xc')]),_0xa2989);}};exports[_0xc7fd('0x17')]=function(_0x43c605){try{if(!_[_0xc7fd('0x15')](queues[_0x43c605[_0xc7fd('0xc')]])){utils['debug'](util['format']('[%s][queues][queuecallerabandon]',_0x43c605[_0xc7fd('0xc')]),_0x43c605);queues[_0x43c605['uniqueid']][_0xc7fd('0x29')]=![];queues[_0x43c605[_0xc7fd('0xc')]][_0xc7fd('0x25')]=null;queues[_0x43c605['uniqueid']]['queuecallerabandon']=!![];queues[_0x43c605[_0xc7fd('0xc')]][_0xc7fd('0x24')]=utils[_0xc7fd('0x12')]();queues[_0x43c605[_0xc7fd('0xc')]][_0xc7fd('0x1a')]=_0xc7fd('0x2c');utils[_0xc7fd('0x0')](util['format'](_0xc7fd('0x2d'),_0x43c605[_0xc7fd('0xc')],queues[_0x43c605[_0xc7fd('0xc')]][_0xc7fd('0x1e')],queues[_0x43c605['uniqueid']]['queuecallerexitreason']));}}catch(_0x9f70e3){utils[_0xc7fd('0x13')](util[_0xc7fd('0x1')](_0xc7fd('0x2e'),_0x43c605[_0xc7fd('0xc')]),_0x9f70e3);}};exports[_0xc7fd('0x2f')]=function(_0x362706){try{if(!_[_0xc7fd('0x15')](queues[_0x362706[_0xc7fd('0xc')]])){utils[_0xc7fd('0xd')](util[_0xc7fd('0x1')](_0xc7fd('0x30'),_0x362706[_0xc7fd('0xc')]),_0x362706);utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')](_0xc7fd('0x31'),_0x362706['uniqueid'],queues[_0x362706['uniqueid']]['name'],_0x362706[_0xc7fd('0x32')],_0x362706['connectedlinename']));queues[_0x362706['uniqueid']][_0xc7fd('0x2f')]=!![];queues[_0x362706[_0xc7fd('0xc')]][_0xc7fd('0x33')]=utils[_0xc7fd('0x12')]();queues[_0x362706[_0xc7fd('0xc')]][_0xc7fd('0x34')]=utils[_0xc7fd('0x35')](queues[_0x362706[_0xc7fd('0xc')]][_0xc7fd('0x33')],queues[_0x362706[_0xc7fd('0xc')]][_0xc7fd('0x36')]);queues[_0x362706[_0xc7fd('0xc')]][_0xc7fd('0x11')]=_0x362706[_0xc7fd('0x11')];queues[_0x362706[_0xc7fd('0xc')]][_0xc7fd('0x37')]=_0x362706[_0xc7fd('0x37')];queues[_0x362706[_0xc7fd('0xc')]][_0xc7fd('0x32')]=_0x362706[_0xc7fd('0x32')];queues[_0x362706[_0xc7fd('0xc')]]['connectedlinename']=_0x362706[_0xc7fd('0x38')];}}catch(_0x26f4f9){utils['error'](util[_0xc7fd('0x1')](_0xc7fd('0x30'),_0x362706[_0xc7fd('0xc')]),_0x26f4f9);}};exports['agentconnect']=function(_0x162956){try{if(!_['isNil'](queues[_0x162956['uniqueid']])){utils[_0xc7fd('0xd')](util['format'](_0xc7fd('0x39'),_0x162956[_0xc7fd('0xc')]),_0x162956);utils['info'](util[_0xc7fd('0x1')](_0xc7fd('0x3a'),_0x162956[_0xc7fd('0xc')],queues[_0x162956[_0xc7fd('0xc')]]['name'],_0x162956[_0xc7fd('0x3b')],_0x162956[_0xc7fd('0x3c')]));queues[_0x162956['uniqueid']][_0xc7fd('0x17')]=![];queues[_0x162956[_0xc7fd('0xc')]][_0xc7fd('0x17')]=![];queues[_0x162956[_0xc7fd('0xc')]][_0xc7fd('0x24')]=null;queues[_0x162956[_0xc7fd('0xc')]]['queuecallerexit']=![];queues[_0x162956['uniqueid']][_0xc7fd('0x1a')]=null;queues[_0x162956[_0xc7fd('0xc')]][_0xc7fd('0x25')]=null;queues[_0x162956[_0xc7fd('0xc')]][_0xc7fd('0x3d')]=!![];queues[_0x162956[_0xc7fd('0xc')]][_0xc7fd('0x7')]=_0x162956[_0xc7fd('0x3c')];queues[_0x162956[_0xc7fd('0xc')]][_0xc7fd('0x5')]=_0x162956['membername'];}}catch(_0x2ccc5c){utils['error'](util['format']('[%s][queues][agentconnect]',_0x162956[_0xc7fd('0xc')]),_0x2ccc5c);}};exports[_0xc7fd('0x3e')]=function(_0x2f5fde){try{if(!_[_0xc7fd('0x15')](queues[_0x2f5fde[_0xc7fd('0xc')]])){if(queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x33')]){utils['debug'](util['format'](_0xc7fd('0x3f'),_0x2f5fde['uniqueid']),_0x2f5fde);queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x17')]=![];queues[_0x2f5fde['uniqueid']][_0xc7fd('0x17')]=![];queues[_0x2f5fde['uniqueid']][_0xc7fd('0x24')]=null;queues[_0x2f5fde[_0xc7fd('0xc')]]['queuecallerexit']=![];queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x25')]=null;queues[_0x2f5fde['uniqueid']][_0xc7fd('0x3d')]=!![];queues[_0x2f5fde['uniqueid']][_0xc7fd('0x5')]=_0x2f5fde[_0xc7fd('0x3b')];queues[_0x2f5fde['uniqueid']][_0xc7fd('0x18')]=!![];queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x19')]=utils[_0xc7fd('0x12')]();if(_0x2f5fde[_0xc7fd('0x40')]=='transfer'){if(!queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x41')]){queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x1a')]=_0xc7fd('0x42');}}else{queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x1a')]=_0xc7fd('0x43')+_0x2f5fde[_0xc7fd('0x40')][_0xc7fd('0x22')]();}utils[_0xc7fd('0x0')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2f5fde['uniqueid'],queues[_0x2f5fde[_0xc7fd('0xc')]]['name'],_0x2f5fde[_0xc7fd('0x3b')],queues[_0x2f5fde[_0xc7fd('0xc')]][_0xc7fd('0x1a')]));writeDB(queues[_0x2f5fde['uniqueid']]);}}}catch(_0x610b54){utils[_0xc7fd('0x13')](util[_0xc7fd('0x1')](_0xc7fd('0x3f'),_0x2f5fde[_0xc7fd('0xc')]),_0x610b54);}};exports[_0xc7fd('0x44')]=function(_0x40901d){try{if(!_['isNil'](queues[_0x40901d[_0xc7fd('0x45')]])){utils[_0xc7fd('0xd')](util['format'](_0xc7fd('0x46'),_0x40901d[_0xc7fd('0xc')]),_0x40901d);queues[_0x40901d[_0xc7fd('0x45')]][_0xc7fd('0x41')]=!![];queues[_0x40901d[_0xc7fd('0x45')]][_0xc7fd('0x47')]=_0xc7fd('0x48');queues[_0x40901d[_0xc7fd('0x45')]][_0xc7fd('0x49')]=_0x40901d[_0xc7fd('0x4a')];queues[_0x40901d[_0xc7fd('0x45')]][_0xc7fd('0x4b')]=_0x40901d[_0xc7fd('0x45')];queues[_0x40901d[_0xc7fd('0x45')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0xc7fd('0x1')](_0xc7fd('0x4c'),_0x40901d[_0xc7fd('0xc')],queues[_0x40901d[_0xc7fd('0x45')]][_0xc7fd('0x1e')],_0x40901d[_0xc7fd('0x45')],_0x40901d[_0xc7fd('0x4a')]));}}catch(_0x44ffde){utils['error'](util[_0xc7fd('0x1')]('[%s][queues][blindtransfer]',_0x40901d[_0xc7fd('0xc')]),_0x44ffde);}};exports[_0xc7fd('0x4d')]=function(_0x351173){try{utils['debug'](util[_0xc7fd('0x1')](_0xc7fd('0x4e'),_0x351173[_0xc7fd('0x4f')]),_0x351173);if(_0x351173['origtransfereruniqueid']==_0x351173[_0xc7fd('0x50')]){if(!_[_0xc7fd('0x15')](queues[_0x351173[_0xc7fd('0x51')]])){utils['info'](util[_0xc7fd('0x1')](_0xc7fd('0x52'),_0x351173[_0xc7fd('0x4f')],queues[_0x351173[_0xc7fd('0x51')]]['name'],_0x351173[_0xc7fd('0x53')]));queues[_0x351173['secondtransfererlinkedid']]['transfer']=!![];queues[_0x351173[_0xc7fd('0x51')]]['transfertype']='ATTENDED';queues[_0x351173[_0xc7fd('0x51')]][_0xc7fd('0x49')]=_0x351173[_0xc7fd('0x53')];queues[_0x351173['secondtransfererlinkedid']]['transferuniqueid']=_0x351173['origtransfereruniqueid'];queues[_0x351173[_0xc7fd('0x51')]][_0xc7fd('0x1a')]='ATTENDEDTRANSFER';}if(!_[_0xc7fd('0x15')](queues[_0x351173[_0xc7fd('0x50')]])){if(_0x351173[_0xc7fd('0x54')]&&queues[_0x351173[_0xc7fd('0x54')]]){queues[_0x351173[_0xc7fd('0x54')]]['queuecallerenterreason']=0x1;queues[_0x351173[_0xc7fd('0x45')]]=_[_0xc7fd('0x55')](queues[_0x351173[_0xc7fd('0x54')]]);queues[_0x351173[_0xc7fd('0x45')]]['transfereduniqueid']=_0x351173[_0xc7fd('0x56')];queues[_0x351173['transfereeuniqueid']][_0xc7fd('0x57')]=0x2;queues[_0x351173[_0xc7fd('0x45')]][_0xc7fd('0x6')]=queues[_0x351173[_0xc7fd('0x51')]][_0xc7fd('0x6')];queues[_0x351173[_0xc7fd('0x45')]][_0xc7fd('0x58')]=queues[_0x351173['secondtransfererlinkedid']][_0xc7fd('0x58')];queues[_0x351173[_0xc7fd('0x45')]][_0xc7fd('0x36')]=utils[_0xc7fd('0x12')]();queues[_0x351173['transfereeuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x351173[_0xc7fd('0x45')]][_0xc7fd('0x34')]=0x0;queues[_0x351173[_0xc7fd('0x45')]][_0xc7fd('0x59')]=0x0;utils[_0xc7fd('0x0')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x351173[_0xc7fd('0x4f')],queues[_0x351173[_0xc7fd('0x45')]][_0xc7fd('0x1e')],queues[_0x351173[_0xc7fd('0x45')]]['calleridnum'],queues[_0x351173['transfereeuniqueid']][_0xc7fd('0x58')]));}else{utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')](_0xc7fd('0x5a'),_0x351173[_0xc7fd('0x4f')],queues[_0x351173['origtransfererlinkedid']]['name'],_0x351173[_0xc7fd('0x51')]));queues[_0x351173[_0xc7fd('0x50')]][_0xc7fd('0xb')]=_0x351173[_0xc7fd('0x51')];}}}else if(_0x351173[_0xc7fd('0x5b')]==_0x351173[_0xc7fd('0x51')]){if(!_['isNil'](queues[_0x351173[_0xc7fd('0x50')]])){utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x351173[_0xc7fd('0x4f')],queues[_0x351173[_0xc7fd('0x50')]]['name'],_0x351173['secondtransfereruniqueid'],_0x351173[_0xc7fd('0x5c')]));queues[_0x351173[_0xc7fd('0x50')]][_0xc7fd('0x41')]=!![];queues[_0x351173[_0xc7fd('0x50')]][_0xc7fd('0x47')]='ATTENDED';queues[_0x351173[_0xc7fd('0x50')]][_0xc7fd('0x49')]=_0x351173[_0xc7fd('0x5c')];queues[_0x351173[_0xc7fd('0x50')]][_0xc7fd('0x4b')]=_0x351173[_0xc7fd('0x5b')];queues[_0x351173['origtransfererlinkedid']][_0xc7fd('0x1a')]=_0xc7fd('0x5d');}if(!_[_0xc7fd('0x15')](queues[_0x351173[_0xc7fd('0x51')]])){if(_0x351173[_0xc7fd('0x5e')]&&queues[_0x351173[_0xc7fd('0x5e')]]){queues[_0x351173[_0xc7fd('0x5e')]]['queuecallerenterreason']=0x1;queues[_0x351173['transfertargetuniqueid']]=_[_0xc7fd('0x55')](queues[_0x351173[_0xc7fd('0x5e')]]);queues[_0x351173['transfertargetuniqueid']][_0xc7fd('0xb')]=_0x351173[_0xc7fd('0x56')];queues[_0x351173['transfertargetuniqueid']][_0xc7fd('0x57')]=0x2;queues[_0x351173[_0xc7fd('0x56')]][_0xc7fd('0x6')]=queues[_0x351173[_0xc7fd('0x50')]][_0xc7fd('0x6')];queues[_0x351173['transfertargetuniqueid']][_0xc7fd('0x58')]=queues[_0x351173['origtransfererlinkedid']][_0xc7fd('0x58')];queues[_0x351173[_0xc7fd('0x56')]][_0xc7fd('0x36')]=utils['now']();queues[_0x351173['transfertargetuniqueid']][_0xc7fd('0x33')]=utils[_0xc7fd('0x12')]();queues[_0x351173[_0xc7fd('0x56')]][_0xc7fd('0x34')]=0x0;queues[_0x351173['transfertargetuniqueid']][_0xc7fd('0x59')]=0x0;utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')](_0xc7fd('0x5f'),_0x351173['origtransfereruniqueid'],queues[_0x351173['transfertargetuniqueid']]['name'],queues[_0x351173['transfertargetuniqueid']][_0xc7fd('0xb')],queues[_0x351173[_0xc7fd('0x56')]]['calleridnum'],queues[_0x351173[_0xc7fd('0x56')]]['calleridname']));}else{utils[_0xc7fd('0x0')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x351173[_0xc7fd('0x4f')],queues[_0x351173[_0xc7fd('0x51')]][_0xc7fd('0x1e')],_0x351173[_0xc7fd('0x50')]));queues[_0x351173[_0xc7fd('0x51')]]['transfereduniqueid']=_0x351173[_0xc7fd('0x50')];}}}}catch(_0x14380c){utils[_0xc7fd('0x13')](util['format'](_0xc7fd('0x4e'),_0x351173[_0xc7fd('0x4f')]),_0x14380c);}};exports[_0xc7fd('0x60')]=function(_0x200b34){try{if(!_[_0xc7fd('0x15')](queues[_0x200b34[_0xc7fd('0xc')]])){utils['debug'](util['format'](_0xc7fd('0x61'),_0x200b34[_0xc7fd('0xc')]),_0x200b34);queues[_0x200b34['uniqueid']][_0xc7fd('0x62')]=utils[_0xc7fd('0x12')]();utils[_0xc7fd('0x0')](util['format'](_0xc7fd('0x63'),_0x200b34[_0xc7fd('0xc')],queues[_0x200b34['uniqueid']][_0xc7fd('0x1e')],queues[_0x200b34[_0xc7fd('0xc')]]['musiconholdstartAt']));}}catch(_0x469ccd){utils[_0xc7fd('0x13')](util[_0xc7fd('0x1')](_0xc7fd('0x61'),_0x200b34['uniqueid']),_0x469ccd);}};exports[_0xc7fd('0x64')]=function(_0x2a3ef3){try{if(!_[_0xc7fd('0x15')](queues[_0x2a3ef3[_0xc7fd('0xc')]])){if(!_[_0xc7fd('0x15')](queues[_0x2a3ef3['uniqueid']][_0xc7fd('0x62')])){utils[_0xc7fd('0xd')](util[_0xc7fd('0x1')](_0xc7fd('0x65'),_0x2a3ef3[_0xc7fd('0xc')]),_0x2a3ef3);queues[_0x2a3ef3[_0xc7fd('0xc')]][_0xc7fd('0x59')]+=utils['diffTime'](utils[_0xc7fd('0x12')](),queues[_0x2a3ef3['uniqueid']][_0xc7fd('0x62')]);utils[_0xc7fd('0x0')](util[_0xc7fd('0x1')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x2a3ef3[_0xc7fd('0xc')],queues[_0x2a3ef3[_0xc7fd('0xc')]]['name'],queues[_0x2a3ef3[_0xc7fd('0xc')]][_0xc7fd('0x59')]));delete queues[_0x2a3ef3[_0xc7fd('0xc')]][_0xc7fd('0x62')];}}}catch(_0x395b81){utils['error'](util[_0xc7fd('0x1')](_0xc7fd('0x65'),_0x2a3ef3[_0xc7fd('0xc')]),_0x395b81);}}; \ No newline at end of file +var _0x55c3=['[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','[%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','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferuniqueid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','mohtime'];(function(_0x17a4e0,_0x21eac4){var _0x557de3=function(_0x148596){while(--_0x148596){_0x17a4e0['push'](_0x17a4e0['shift']());}};_0x557de3(++_0x21eac4);}(_0x55c3,0x12a));var _0x355c=function(_0x25cb8e,_0xeb3340){_0x25cb8e=_0x25cb8e-0x0;var _0x4ca5f2=_0x55c3[_0x25cb8e];return _0x4ca5f2;};'use strict';var _=require(_0x355c('0x0'));var util=require(_0x355c('0x1'));var utils=require(_0x355c('0x2'));var queues={};function writeDB(_0x392d85){utils[_0x355c('0x3')](util[_0x355c('0x4')](_0x355c('0x5'),_0x392d85[_0x355c('0x6')],_0x392d85[_0x355c('0x7')],_0x392d85['queue'],_0x392d85[_0x355c('0x8')],_0x392d85[_0x355c('0x9')],_0x392d85[_0x355c('0xa')],_0x392d85[_0x355c('0xb')]));if(_0x392d85[_0x355c('0xc')]){utils[_0x355c('0xd')](_0x392d85[_0x355c('0xc')])[_0x355c('0xe')](function(_0x586d38){if(_0x586d38){_0x392d85[_0x355c('0xf')]=_0x586d38[_0x355c('0xf')];}utils[_0x355c('0x10')](_0x355c('0x11'),_0x392d85);});}else{utils[_0x355c('0x10')](_0x355c('0x11'),_0x392d85);}if(_0x392d85['transfereduniqueid']){delete queues[_0x392d85[_0x355c('0x12')]];}else{delete queues[_0x392d85[_0x355c('0x6')]];}}exports['queuecallerjoin']=function(_0xfd64c2){try{utils[_0x355c('0x13')](util[_0x355c('0x4')]('[%s][queues][queuecallerjoin]',_0xfd64c2['uniqueid']),_0xfd64c2);utils[_0x355c('0x3')](util[_0x355c('0x4')](_0x355c('0x14'),_0xfd64c2[_0x355c('0x6')],_0xfd64c2[_0x355c('0xc')],_0xfd64c2[_0x355c('0x15')]));queues[_0xfd64c2['uniqueid']]=_[_0x355c('0x16')](_0xfd64c2,{'originalposition':_0xfd64c2[_0x355c('0x15')],'queuecallerjoinAt':utils[_0x355c('0x17')](),'mohtime':0x0});}catch(_0x248a15){utils[_0x355c('0x18')](util[_0x355c('0x4')](_0x355c('0x19'),_0xfd64c2[_0x355c('0x6')]),_0x248a15);}};exports['hangup']=function(_0x4d9b93){try{if(!_['isNil'](queues[_0x4d9b93['uniqueid']])){utils[_0x355c('0x13')](util[_0x355c('0x4')](_0x355c('0x1a'),_0x4d9b93['uniqueid']),_0x4d9b93);if(queues[_0x4d9b93['uniqueid']][_0x355c('0x1b')]){if(!queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0x1c')]&&!queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0x1d')]){queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0x1e')]=!![];queues[_0x4d9b93['uniqueid']][_0x355c('0x1f')]=utils[_0x355c('0x17')]();queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0xb')]='COMPLETEDBYAGENT';}utils[_0x355c('0x3')](util[_0x355c('0x4')](_0x355c('0x20'),_0x4d9b93['uniqueid'],queues[_0x4d9b93['uniqueid']][_0x355c('0x21')],queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0xb')]));writeDB(queues[_0x4d9b93[_0x355c('0x6')]]);}else if(queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0x12')]){utils[_0x355c('0x3')](util[_0x355c('0x4')](_0x355c('0x22'),_0x4d9b93['uniqueid'],queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0x21')],queues[_0x4d9b93['uniqueid']]['transfereduniqueid']));queues[queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0x12')]]=queues[_0x4d9b93[_0x355c('0x6')]];queues[queues[_0x4d9b93[_0x355c('0x6')]][_0x355c('0x12')]][_0x355c('0x23')]=0x2;delete queues[_0x4d9b93['uniqueid']];}}}catch(_0x24b51f){utils[_0x355c('0x18')](util[_0x355c('0x4')](_0x355c('0x1a'),_0x4d9b93['uniqueid']),_0x24b51f);}};exports[_0x355c('0x24')]=function(_0x381415){try{utils[_0x355c('0x13')](util['format'](_0x355c('0x25'),_0x381415[_0x355c('0x6')]),_0x381415);if(!_[_0x355c('0x26')](_0x381415[_0x355c('0x27')]['queuestatus'])&&_0x381415[_0x355c('0x28')][_0x355c('0x29')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x381415[_0x355c('0x6')]])){queues[_0x381415[_0x355c('0x6')]][_0x355c('0x1c')]=![];queues[_0x381415[_0x355c('0x6')]][_0x355c('0x2a')]=null;queues[_0x381415['uniqueid']][_0x355c('0x1d')]=!![];queues[_0x381415[_0x355c('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0x381415[_0x355c('0x6')]][_0x355c('0xb')]=_0x381415['value']['toUpperCase']();utils[_0x355c('0x3')](util[_0x355c('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x381415['uniqueid'],queues[_0x381415[_0x355c('0x6')]]['name'],_0x381415[_0x355c('0x28')],queues[_0x381415[_0x355c('0x6')]][_0x355c('0xb')]));writeDB(queues[_0x381415[_0x355c('0x6')]]);}}else if(!_[_0x355c('0x26')](_0x381415[_0x355c('0x27')]['queueposition'])){if(!_[_0x355c('0x26')](queues[_0x381415[_0x355c('0x6')]])&&!queues[_0x381415['uniqueid']][_0x355c('0x1c')]){queues[_0x381415['uniqueid']][_0x355c('0x1c')]=![];queues[_0x381415[_0x355c('0x6')]][_0x355c('0x2a')]=null;queues[_0x381415['uniqueid']][_0x355c('0x1d')]=!![];queues[_0x381415['uniqueid']][_0x355c('0x2b')]=utils['now']();queues[_0x381415[_0x355c('0x6')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x355c('0x3')](util[_0x355c('0x4')](_0x355c('0x2c'),_0x381415[_0x355c('0x6')],queues[_0x381415[_0x355c('0x6')]][_0x355c('0x21')],_0x381415[_0x355c('0x28')],queues[_0x381415[_0x355c('0x6')]]['queuecallerexitreason']));}}}catch(_0x57ab05){utils['error'](util['format'](_0x355c('0x25'),_0x381415['uniqueid']),_0x57ab05);}};exports['queuecallerabandon']=function(_0x230b90){try{if(!_[_0x355c('0x26')](queues[_0x230b90[_0x355c('0x6')]])){utils['debug'](util[_0x355c('0x4')](_0x355c('0x2d'),_0x230b90[_0x355c('0x6')]),_0x230b90);queues[_0x230b90[_0x355c('0x6')]][_0x355c('0x1d')]=![];queues[_0x230b90[_0x355c('0x6')]][_0x355c('0x2b')]=null;queues[_0x230b90[_0x355c('0x6')]][_0x355c('0x1c')]=!![];queues[_0x230b90['uniqueid']]['queuecallerabandonAt']=utils[_0x355c('0x17')]();queues[_0x230b90['uniqueid']][_0x355c('0xb')]=_0x355c('0x2e');utils[_0x355c('0x3')](util['format'](_0x355c('0x2f'),_0x230b90[_0x355c('0x6')],queues[_0x230b90[_0x355c('0x6')]][_0x355c('0x21')],queues[_0x230b90['uniqueid']][_0x355c('0xb')]));}}catch(_0x230379){utils['error'](util[_0x355c('0x4')]('[%s][queues][queuecallerabandon]',_0x230b90[_0x355c('0x6')]),_0x230379);}};exports[_0x355c('0x30')]=function(_0x49cbcd){try{if(!_[_0x355c('0x26')](queues[_0x49cbcd[_0x355c('0x6')]])){utils[_0x355c('0x13')](util['format'](_0x355c('0x31'),_0x49cbcd[_0x355c('0x6')]),_0x49cbcd);utils[_0x355c('0x3')](util['format'](_0x355c('0x32'),_0x49cbcd[_0x355c('0x6')],queues[_0x49cbcd[_0x355c('0x6')]][_0x355c('0x21')],_0x49cbcd['connectedlinenum'],_0x49cbcd['connectedlinename']));queues[_0x49cbcd['uniqueid']][_0x355c('0x30')]=!![];queues[_0x49cbcd[_0x355c('0x6')]][_0x355c('0x1b')]=utils[_0x355c('0x17')]();queues[_0x49cbcd[_0x355c('0x6')]][_0x355c('0x33')]=utils[_0x355c('0x34')](queues[_0x49cbcd[_0x355c('0x6')]][_0x355c('0x1b')],queues[_0x49cbcd['uniqueid']][_0x355c('0x35')]);queues[_0x49cbcd[_0x355c('0x6')]][_0x355c('0x15')]=_0x49cbcd[_0x355c('0x15')];queues[_0x49cbcd['uniqueid']][_0x355c('0x36')]=_0x49cbcd['count'];queues[_0x49cbcd[_0x355c('0x6')]][_0x355c('0x37')]=_0x49cbcd[_0x355c('0x37')];queues[_0x49cbcd[_0x355c('0x6')]][_0x355c('0x38')]=_0x49cbcd[_0x355c('0x38')];}}catch(_0x1df16f){utils[_0x355c('0x18')](util[_0x355c('0x4')](_0x355c('0x31'),_0x49cbcd[_0x355c('0x6')]),_0x1df16f);}};exports[_0x355c('0x39')]=function(_0x33ff28){try{if(!_[_0x355c('0x26')](queues[_0x33ff28[_0x355c('0x6')]])){utils['debug'](util['format']('[%s][queues][agentconnect]',_0x33ff28[_0x355c('0x6')]),_0x33ff28);utils['info'](util[_0x355c('0x4')](_0x355c('0x3a'),_0x33ff28[_0x355c('0x6')],queues[_0x33ff28[_0x355c('0x6')]]['name'],_0x33ff28[_0x355c('0x3b')],_0x33ff28[_0x355c('0x3c')]));queues[_0x33ff28[_0x355c('0x6')]][_0x355c('0x1c')]=![];queues[_0x33ff28['uniqueid']][_0x355c('0x1c')]=![];queues[_0x33ff28[_0x355c('0x6')]][_0x355c('0x2a')]=null;queues[_0x33ff28[_0x355c('0x6')]][_0x355c('0x1d')]=![];queues[_0x33ff28[_0x355c('0x6')]][_0x355c('0xb')]=null;queues[_0x33ff28[_0x355c('0x6')]]['queuecallerexitAt']=null;queues[_0x33ff28['uniqueid']][_0x355c('0x3d')]=!![];queues[_0x33ff28[_0x355c('0x6')]][_0x355c('0xa')]=_0x33ff28[_0x355c('0x3c')];queues[_0x33ff28[_0x355c('0x6')]][_0x355c('0x8')]=_0x33ff28['membername'];}}catch(_0x37f386){utils[_0x355c('0x18')](util[_0x355c('0x4')]('[%s][queues][agentconnect]',_0x33ff28[_0x355c('0x6')]),_0x37f386);}};exports['agentcomplete']=function(_0x4055d9){try{if(!_[_0x355c('0x26')](queues[_0x4055d9[_0x355c('0x6')]])){if(queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x1b')]){utils['debug'](util[_0x355c('0x4')](_0x355c('0x3e'),_0x4055d9[_0x355c('0x6')]),_0x4055d9);queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x1c')]=![];queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x1c')]=![];queues[_0x4055d9[_0x355c('0x6')]]['queuecallerabandonAt']=null;queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x1d')]=![];queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x2b')]=null;queues[_0x4055d9['uniqueid']][_0x355c('0x3d')]=!![];queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x8')]=_0x4055d9[_0x355c('0x3b')];queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x1e')]=!![];queues[_0x4055d9['uniqueid']]['queuecallercompleteAt']=utils[_0x355c('0x17')]();if(_0x4055d9[_0x355c('0x3f')]==_0x355c('0x40')){if(!queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0x40')]){queues[_0x4055d9[_0x355c('0x6')]][_0x355c('0xb')]=_0x355c('0x41');}}else{queues[_0x4055d9['uniqueid']][_0x355c('0xb')]='COMPLETEDBY'+_0x4055d9[_0x355c('0x3f')]['toUpperCase']();}utils[_0x355c('0x3')](util['format'](_0x355c('0x42'),_0x4055d9['uniqueid'],queues[_0x4055d9['uniqueid']][_0x355c('0x21')],_0x4055d9[_0x355c('0x3b')],queues[_0x4055d9[_0x355c('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x4055d9['uniqueid']]);}}}catch(_0x126c15){utils[_0x355c('0x18')](util[_0x355c('0x4')]('[%s][queues][agentcomplete]',_0x4055d9[_0x355c('0x6')]),_0x126c15);}};exports[_0x355c('0x43')]=function(_0x82b603){try{if(!_[_0x355c('0x26')](queues[_0x82b603[_0x355c('0x44')]])){utils[_0x355c('0x13')](util[_0x355c('0x4')]('[%s][queues][blindtransfer]',_0x82b603['uniqueid']),_0x82b603);queues[_0x82b603[_0x355c('0x44')]][_0x355c('0x40')]=!![];queues[_0x82b603['transfereeuniqueid']][_0x355c('0x45')]=_0x355c('0x46');queues[_0x82b603[_0x355c('0x44')]][_0x355c('0x47')]=_0x82b603[_0x355c('0x48')];queues[_0x82b603['transfereeuniqueid']]['transferuniqueid']=_0x82b603[_0x355c('0x44')];queues[_0x82b603[_0x355c('0x44')]][_0x355c('0xb')]=_0x355c('0x49');utils[_0x355c('0x3')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x82b603[_0x355c('0x6')],queues[_0x82b603['transfereeuniqueid']][_0x355c('0x21')],_0x82b603[_0x355c('0x44')],_0x82b603[_0x355c('0x48')]));}}catch(_0x514c95){utils[_0x355c('0x18')](util[_0x355c('0x4')]('[%s][queues][blindtransfer]',_0x82b603[_0x355c('0x6')]),_0x514c95);}};exports['attendedtransfer']=function(_0x15e4b1){try{utils[_0x355c('0x13')](util[_0x355c('0x4')]('[%s][queues][attendedtransfer]',_0x15e4b1[_0x355c('0x4a')]),_0x15e4b1);if(_0x15e4b1[_0x355c('0x4a')]==_0x15e4b1[_0x355c('0x4b')]){if(!_[_0x355c('0x26')](queues[_0x15e4b1[_0x355c('0x4c')]])){utils[_0x355c('0x3')](util[_0x355c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x15e4b1[_0x355c('0x4a')],queues[_0x15e4b1[_0x355c('0x4c')]]['name'],_0x15e4b1[_0x355c('0x4d')]));queues[_0x15e4b1[_0x355c('0x4c')]][_0x355c('0x40')]=!![];queues[_0x15e4b1[_0x355c('0x4c')]][_0x355c('0x45')]=_0x355c('0x4e');queues[_0x15e4b1[_0x355c('0x4c')]][_0x355c('0x47')]=_0x15e4b1[_0x355c('0x4d')];queues[_0x15e4b1['secondtransfererlinkedid']][_0x355c('0x4f')]=_0x15e4b1[_0x355c('0x4a')];queues[_0x15e4b1[_0x355c('0x4c')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x355c('0x26')](queues[_0x15e4b1['origtransfererlinkedid']])){if(_0x15e4b1[_0x355c('0x50')]&&queues[_0x15e4b1['transfereelinkedid']]){queues[_0x15e4b1[_0x355c('0x50')]][_0x355c('0x23')]=0x1;queues[_0x15e4b1[_0x355c('0x44')]]=_[_0x355c('0x51')](queues[_0x15e4b1[_0x355c('0x50')]]);queues[_0x15e4b1[_0x355c('0x44')]][_0x355c('0x12')]=_0x15e4b1[_0x355c('0x52')];queues[_0x15e4b1[_0x355c('0x44')]]['queuecallerenterreason']=0x2;queues[_0x15e4b1['transfereeuniqueid']][_0x355c('0x9')]=queues[_0x15e4b1[_0x355c('0x4c')]]['calleridnum'];queues[_0x15e4b1['transfereeuniqueid']][_0x355c('0x53')]=queues[_0x15e4b1[_0x355c('0x4c')]][_0x355c('0x53')];queues[_0x15e4b1['transfereeuniqueid']][_0x355c('0x35')]=utils['now']();queues[_0x15e4b1[_0x355c('0x44')]][_0x355c('0x1b')]=utils[_0x355c('0x17')]();queues[_0x15e4b1['transfereeuniqueid']][_0x355c('0x33')]=0x0;queues[_0x15e4b1[_0x355c('0x44')]]['mohtime']=0x0;utils[_0x355c('0x3')](util[_0x355c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x15e4b1['origtransfereruniqueid'],queues[_0x15e4b1[_0x355c('0x44')]]['name'],queues[_0x15e4b1['transfereeuniqueid']][_0x355c('0x9')],queues[_0x15e4b1[_0x355c('0x44')]][_0x355c('0x53')]));}else{utils[_0x355c('0x3')](util[_0x355c('0x4')](_0x355c('0x54'),_0x15e4b1[_0x355c('0x4a')],queues[_0x15e4b1['origtransfererlinkedid']][_0x355c('0x21')],_0x15e4b1[_0x355c('0x4c')]));queues[_0x15e4b1['origtransfererlinkedid']][_0x355c('0x12')]=_0x15e4b1[_0x355c('0x4c')];}}}else if(_0x15e4b1['secondtransfereruniqueid']==_0x15e4b1['secondtransfererlinkedid']){if(!_[_0x355c('0x26')](queues[_0x15e4b1[_0x355c('0x4b')]])){utils[_0x355c('0x3')](util[_0x355c('0x4')](_0x355c('0x55'),_0x15e4b1[_0x355c('0x4a')],queues[_0x15e4b1[_0x355c('0x4b')]][_0x355c('0x21')],_0x15e4b1['secondtransfereruniqueid'],_0x15e4b1[_0x355c('0x56')]));queues[_0x15e4b1['origtransfererlinkedid']][_0x355c('0x40')]=!![];queues[_0x15e4b1[_0x355c('0x4b')]][_0x355c('0x45')]=_0x355c('0x4e');queues[_0x15e4b1[_0x355c('0x4b')]][_0x355c('0x47')]=_0x15e4b1[_0x355c('0x56')];queues[_0x15e4b1[_0x355c('0x4b')]][_0x355c('0x4f')]=_0x15e4b1['secondtransfereruniqueid'];queues[_0x15e4b1[_0x355c('0x4b')]]['queuecallerexitreason']=_0x355c('0x57');}if(!_[_0x355c('0x26')](queues[_0x15e4b1[_0x355c('0x4c')]])){if(_0x15e4b1[_0x355c('0x58')]&&queues[_0x15e4b1[_0x355c('0x58')]]){queues[_0x15e4b1[_0x355c('0x58')]]['queuecallerenterreason']=0x1;queues[_0x15e4b1[_0x355c('0x52')]]=_[_0x355c('0x51')](queues[_0x15e4b1['transfertargetlinkedid']]);queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x12')]=_0x15e4b1[_0x355c('0x52')];queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x23')]=0x2;queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x9')]=queues[_0x15e4b1['origtransfererlinkedid']]['calleridnum'];queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x53')]=queues[_0x15e4b1[_0x355c('0x4b')]]['calleridname'];queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x35')]=utils[_0x355c('0x17')]();queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x1b')]=utils['now']();queues[_0x15e4b1['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x15e4b1['transfertargetuniqueid']][_0x355c('0x59')]=0x0;utils['info'](util[_0x355c('0x4')](_0x355c('0x5a'),_0x15e4b1[_0x355c('0x4a')],queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x21')],queues[_0x15e4b1['transfertargetuniqueid']][_0x355c('0x12')],queues[_0x15e4b1[_0x355c('0x52')]][_0x355c('0x9')],queues[_0x15e4b1['transfertargetuniqueid']]['calleridname']));}else{utils[_0x355c('0x3')](util[_0x355c('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x15e4b1['origtransfereruniqueid'],queues[_0x15e4b1[_0x355c('0x4c')]][_0x355c('0x21')],_0x15e4b1[_0x355c('0x4b')]));queues[_0x15e4b1['secondtransfererlinkedid']]['transfereduniqueid']=_0x15e4b1[_0x355c('0x4b')];}}}}catch(_0x307514){utils[_0x355c('0x18')](util['format']('[%s][queues][attendedtransfer]',_0x15e4b1[_0x355c('0x4a')]),_0x307514);}};exports['musiconholdstart']=function(_0xda5e06){try{if(!_['isNil'](queues[_0xda5e06['uniqueid']])){utils['debug'](util[_0x355c('0x4')](_0x355c('0x5b'),_0xda5e06['uniqueid']),_0xda5e06);queues[_0xda5e06[_0x355c('0x6')]][_0x355c('0x5c')]=utils[_0x355c('0x17')]();utils[_0x355c('0x3')](util['format'](_0x355c('0x5d'),_0xda5e06['uniqueid'],queues[_0xda5e06['uniqueid']][_0x355c('0x21')],queues[_0xda5e06['uniqueid']]['musiconholdstartAt']));}}catch(_0x235dab){utils[_0x355c('0x18')](util[_0x355c('0x4')](_0x355c('0x5b'),_0xda5e06['uniqueid']),_0x235dab);}};exports[_0x355c('0x5e')]=function(_0xc1d674){try{if(!_[_0x355c('0x26')](queues[_0xc1d674[_0x355c('0x6')]])){if(!_[_0x355c('0x26')](queues[_0xc1d674[_0x355c('0x6')]][_0x355c('0x5c')])){utils['debug'](util['format'](_0x355c('0x5f'),_0xc1d674['uniqueid']),_0xc1d674);queues[_0xc1d674[_0x355c('0x6')]][_0x355c('0x59')]+=utils['diffTime'](utils[_0x355c('0x17')](),queues[_0xc1d674[_0x355c('0x6')]][_0x355c('0x5c')]);utils[_0x355c('0x3')](util['format'](_0x355c('0x60'),_0xc1d674[_0x355c('0x6')],queues[_0xc1d674[_0x355c('0x6')]][_0x355c('0x21')],queues[_0xc1d674[_0x355c('0x6')]]['mohtime']));delete queues[_0xc1d674['uniqueid']][_0x355c('0x5c')];}}}catch(_0x47be62){utils[_0x355c('0x18')](util['format']('[%s][queues][musiconholdstop]',_0xc1d674[_0x355c('0x6')]),_0x47be62);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b68638f..8e109dd 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 _0x9386=['[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','then','name','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','endsWith','.wav49','value','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','appdata','application','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin'];(function(_0x57fc84,_0xd4b54d){var _0x4cf422=function(_0x44238d){while(--_0x44238d){_0x57fc84['push'](_0x57fc84['shift']());}};_0x4cf422(++_0xd4b54d);}(_0x9386,0xe2));var _0x6938=function(_0x2cb30d,_0xdaa0c5){_0x2cb30d=_0x2cb30d-0x0;var _0x1aa4b3=_0x9386[_0x2cb30d];return _0x1aa4b3;};'use strict';var _=require('lodash');var util=require(_0x6938('0x0'));var utils=require(_0x6938('0x1'));var transfers=require(_0x6938('0x2'));var recordings={};function writeDB(_0xf23cc3){var _0x53362c;utils[_0x6938('0x3')](util[_0x6938('0x4')](_0x6938('0x5'),_0xf23cc3[_0x6938('0x6')]));if(transfers[_0x6938('0x7')][_0xf23cc3['uniqueid']]){_0x53362c=_0xf23cc3[_0x6938('0x6')];_0xf23cc3[_0x6938('0x6')]=transfers[_0x6938('0x7')][_0xf23cc3[_0x6938('0x6')]][_0x6938('0x8')];}if(_0xf23cc3[_0x6938('0x9')]){utils['getUserByInternal'](_0xf23cc3[_0x6938('0x9')])[_0x6938('0xa')](function(_0x1e60c6){if(_0x1e60c6){_0xf23cc3['membername']=_0x1e60c6[_0x6938('0xb')];_0xf23cc3['UserId']=_0x1e60c6['id'];}utils[_0x6938('0xc')](_0x6938('0xd'),_0xf23cc3);});}else{utils['request'](_0x6938('0xd'),_0xf23cc3);}if(_0x53362c)delete transfers[_0x6938('0x7')][_0x53362c];}exports['newchannel']=function(_0xb94b99){try{utils[_0x6938('0xe')](util[_0x6938('0x4')](_0x6938('0xf'),_0xb94b99[_0x6938('0x6')]),_0xb94b99);if(_0xb94b99[_0x6938('0x6')]==_0xb94b99[_0x6938('0x10')]){utils[_0x6938('0x3')](util[_0x6938('0x4')](_0x6938('0x11'),_0xb94b99[_0x6938('0x6')],_0xb94b99['context'],_0xb94b99[_0x6938('0x12')]));recordings[_0xb94b99[_0x6938('0x6')]]={'uniqueid':_0xb94b99[_0x6938('0x6')],'accountcode':_0xb94b99[_0x6938('0x9')],'exten':_0xb94b99['exten'],'context':_0xb94b99[_0x6938('0x13')],'channel':_0xb94b99[_0x6938('0x14')],'monitors':[]};}}catch(_0x370e6d){utils[_0x6938('0x15')](util[_0x6938('0x4')](_0x6938('0xf'),_0xb94b99[_0x6938('0x6')]),_0x370e6d);}};exports[_0x6938('0x16')]=function(_0x48146e){try{utils[_0x6938('0xe')](util[_0x6938('0x4')]('[%s][recordings][newstate]',_0x48146e[_0x6938('0x6')]),_0x48146e);if(!_[_0x6938('0x17')](recordings[_0x48146e[_0x6938('0x6')]])&&_0x48146e[_0x6938('0x18')]==0x6){utils[_0x6938('0x3')](util[_0x6938('0x4')](_0x6938('0x19'),_0x48146e['uniqueid'],_0x48146e[_0x6938('0x13')],_0x48146e[_0x6938('0x14')]));}else if(!_[_0x6938('0x17')](recordings[_0x48146e[_0x6938('0x10')]])&&_0x48146e[_0x6938('0x18')]==0x6&&_0x48146e[_0x6938('0x13')]!=_0x6938('0x1a')){utils[_0x6938('0x3')](util[_0x6938('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x48146e[_0x6938('0x6')],_0x48146e[_0x6938('0x10')],_0x48146e['context'],_0x48146e[_0x6938('0x14')]));recordings[_0x48146e[_0x6938('0x10')]][_0x6938('0x9')]=_0x48146e[_0x6938('0x9')];}}catch(_0x249057){utils[_0x6938('0x15')](util[_0x6938('0x4')](_0x6938('0x1b'),_0x48146e[_0x6938('0x6')]),_0x249057);}};exports[_0x6938('0x1c')]=function(_0x55d022){try{if(!_[_0x6938('0x17')](_0x55d022[_0x6938('0x1d')])&&!_[_0x6938('0x17')](_0x55d022[_0x6938('0x1d')]['mixmonitor_filename'])){utils[_0x6938('0xe')](util[_0x6938('0x4')](_0x6938('0x1e'),_0x55d022[_0x6938('0x6')]),_0x55d022);utils[_0x6938('0x3')](util[_0x6938('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x55d022[_0x6938('0x6')],_0x55d022[_0x6938('0x1d')],_0x55d022['value']));if(_[_0x6938('0x1f')](_0x55d022['value'],_0x6938('0x20'))){_0x55d022[_0x6938('0x21')]=_0x55d022[_0x6938('0x21')][_0x6938('0x22')](_0x6938('0x20'),_0x6938('0x23'));}if(recordings[_0x55d022['linkedid']]){var _0x88f606=_[_0x6938('0x24')](recordings[_0x55d022[_0x6938('0x10')]][_0x6938('0x25')],{'value':_0x55d022[_0x6938('0x21')]});if(_[_0x6938('0x17')](_0x88f606)){recordings[_0x55d022[_0x6938('0x10')]][_0x6938('0x25')]['push']({'value':_0x55d022['value']});}}}}catch(_0x5012c7){utils[_0x6938('0x15')](util[_0x6938('0x4')](_0x6938('0x1e'),_0x55d022['uniqueid']),_0x5012c7);}};exports[_0x6938('0x26')]=function(_0x24b588){try{if(!_[_0x6938('0x17')](recordings[_0x24b588[_0x6938('0x6')]])){utils[_0x6938('0xe')](util['format']('[%s][recordings][hangup]',_0x24b588[_0x6938('0x6')]),_0x24b588);utils[_0x6938('0x3')](util[_0x6938('0x4')](_0x6938('0x27'),_0x24b588[_0x6938('0x6')],_0x24b588['calleridnum'],_0x24b588['calleridname'],_0x24b588[_0x6938('0x28')]));recordings[_0x24b588[_0x6938('0x6')]][_0x6938('0x29')]=_0x24b588['calleridnum'];recordings[_0x24b588['uniqueid']][_0x6938('0x2a')]=_0x24b588[_0x6938('0x2a')];recordings[_0x24b588[_0x6938('0x6')]][_0x6938('0x2b')]=_0x24b588[_0x6938('0x2b')];recordings[_0x24b588[_0x6938('0x6')]]['connectedlinename']=_0x24b588[_0x6938('0x2c')];if(recordings[_0x24b588[_0x6938('0x6')]][_0x6938('0x2d')]==_0x6938('0x2e')&&recordings[_0x24b588[_0x6938('0x6')]][_0x6938('0x9')]){recordings[_0x24b588[_0x6938('0x6')]]['connectedlinenum']=recordings[_0x24b588[_0x6938('0x6')]]['accountcode'];recordings[_0x24b588[_0x6938('0x6')]][_0x6938('0x2c')]='';}recordings[_0x24b588[_0x6938('0x6')]][_0x6938('0x25')][_0x6938('0x2f')](function(_0x10ac54){var _0x201e7b=_[_0x6938('0x30')](recordings[_0x24b588['uniqueid']]);_0x201e7b[_0x6938('0x21')]=_0x10ac54[_0x6938('0x21')];writeDB(_0x201e7b);});delete recordings[_0x24b588[_0x6938('0x6')]];}}catch(_0x467833){utils['error'](util['format'](_0x6938('0x31'),_0x24b588[_0x6938('0x6')]),_0x467833);}};exports[_0x6938('0x32')]=function(_0x57b714){try{if(!_[_0x6938('0x17')](recordings[_0x57b714[_0x6938('0x6')]])){utils[_0x6938('0xe')](util[_0x6938('0x4')]('[%s][recordings][newexten]',_0x57b714[_0x6938('0x6')]),_0x57b714);utils[_0x6938('0x3')](util[_0x6938('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x57b714[_0x6938('0x6')],_0x57b714['application'],_0x57b714[_0x6938('0x33')]));if(_0x57b714[_0x6938('0x34')]['toLowerCase']()==_0x6938('0x35')&&_[_0x6938('0x36')](_0x57b714[_0x6938('0x33')][_0x6938('0x37')](),_0x6938('0x38'))){var _0xc2d0c9=_0x57b714[_0x6938('0x33')][_0x6938('0x39')]('=');var _0x379520=_0xc2d0c9[0x0][_0x6938('0x3a')](_0xc2d0c9[0x0][_0x6938('0x3b')]('(')+0x1,_0xc2d0c9[0x0][_0x6938('0x3b')](')'));var _0x1d2162=_0xc2d0c9[0x1];recordings[_0x57b714['uniqueid']][_0x379520]=_0x1d2162;}}}catch(_0x14f2d4){utils[_0x6938('0x15')](util['format'](_0x6938('0x3c'),_0x57b714[_0x6938('0x6')]),_0x14f2d4);}};exports[_0x6938('0x3d')]=function(_0x288002){try{if(!_[_0x6938('0x17')](recordings[_0x288002[_0x6938('0x6')]])){utils[_0x6938('0xe')](util['format'](_0x6938('0x3e'),_0x288002[_0x6938('0x6')]),_0x288002);utils[_0x6938('0x3')](util[_0x6938('0x4')](_0x6938('0x3f'),_0x288002[_0x6938('0x6')],_0x288002[_0x6938('0x40')]));recordings[_0x288002['uniqueid']][_0x6938('0x40')]=_0x288002[_0x6938('0x40')];}}catch(_0x2c5335){utils['error'](util['format'](_0x6938('0x3e'),_0x288002[_0x6938('0x6')]),_0x2c5335);}};exports[_0x6938('0x41')]=function(_0x18d819){try{utils[_0x6938('0xe')](util[_0x6938('0x4')](_0x6938('0x42'),_0x18d819[_0x6938('0x6')]),_0x18d819);utils[_0x6938('0x3')](util[_0x6938('0x4')](_0x6938('0x43'),_0x18d819[_0x6938('0x6')],_0x18d819[_0x6938('0x44')],_0x18d819['transferercalleridname'],_0x18d819['transfereecalleridnum'],_0x18d819[_0x6938('0x45')]));if(recordings[_0x18d819[_0x6938('0x46')]]&&transfers[_0x6938('0x7')][_0x18d819[_0x6938('0x46')]]){transfers[_0x6938('0x7')][_0x18d819[_0x6938('0x46')]][_0x6938('0x47')]=!![];}}catch(_0x3926f0){utils[_0x6938('0x15')](util[_0x6938('0x4')]('[%s][recordings][blindtransfer]',_0x18d819[_0x6938('0x6')]),_0x3926f0);}}; \ No newline at end of file +var _0xb488=['transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','membername','name','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname'];(function(_0x5531db,_0x4136ba){var _0xb7e3b9=function(_0x5905cb){while(--_0x5905cb){_0x5531db['push'](_0x5531db['shift']());}};_0xb7e3b9(++_0x4136ba);}(_0xb488,0xe0));var _0x8b48=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb488[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x8b48('0x0'));var util=require(_0x8b48('0x1'));var utils=require(_0x8b48('0x2'));var transfers=require(_0x8b48('0x3'));var recordings={};function writeDB(_0x5d9fa4){var _0x1fad36;utils[_0x8b48('0x4')](util['format'](_0x8b48('0x5'),_0x5d9fa4[_0x8b48('0x6')]));if(transfers[_0x8b48('0x7')][_0x5d9fa4[_0x8b48('0x6')]]){_0x1fad36=_0x5d9fa4[_0x8b48('0x6')];_0x5d9fa4[_0x8b48('0x6')]=transfers[_0x8b48('0x7')][_0x5d9fa4[_0x8b48('0x6')]][_0x8b48('0x8')];}if(_0x5d9fa4[_0x8b48('0x9')]){utils['getUserByInternal'](_0x5d9fa4[_0x8b48('0x9')])['then'](function(_0x598114){if(_0x598114){_0x5d9fa4[_0x8b48('0xa')]=_0x598114[_0x8b48('0xb')];_0x5d9fa4['UserId']=_0x598114['id'];}utils[_0x8b48('0xc')](_0x8b48('0xd'),_0x5d9fa4);});}else{utils[_0x8b48('0xc')](_0x8b48('0xd'),_0x5d9fa4);}if(_0x1fad36)delete transfers[_0x8b48('0x7')][_0x1fad36];}exports['newchannel']=function(_0x43df59){try{utils[_0x8b48('0xe')](util['format'](_0x8b48('0xf'),_0x43df59[_0x8b48('0x6')]),_0x43df59);if(_0x43df59[_0x8b48('0x6')]==_0x43df59[_0x8b48('0x10')]){utils['info'](util[_0x8b48('0x11')](_0x8b48('0x12'),_0x43df59[_0x8b48('0x6')],_0x43df59[_0x8b48('0x13')],_0x43df59[_0x8b48('0x14')]));recordings[_0x43df59[_0x8b48('0x6')]]={'uniqueid':_0x43df59[_0x8b48('0x6')],'accountcode':_0x43df59[_0x8b48('0x9')],'exten':_0x43df59[_0x8b48('0x14')],'context':_0x43df59['context'],'channel':_0x43df59[_0x8b48('0x15')],'monitors':[]};}}catch(_0x4cc5ab){utils[_0x8b48('0x16')](util[_0x8b48('0x11')](_0x8b48('0xf'),_0x43df59['uniqueid']),_0x4cc5ab);}};exports[_0x8b48('0x17')]=function(_0x512103){try{utils[_0x8b48('0xe')](util[_0x8b48('0x11')](_0x8b48('0x18'),_0x512103[_0x8b48('0x6')]),_0x512103);if(!_[_0x8b48('0x19')](recordings[_0x512103[_0x8b48('0x6')]])&&_0x512103['channelstate']==0x6){utils['info'](util[_0x8b48('0x11')](_0x8b48('0x1a'),_0x512103[_0x8b48('0x6')],_0x512103['context'],_0x512103[_0x8b48('0x15')]));}else if(!_[_0x8b48('0x19')](recordings[_0x512103[_0x8b48('0x10')]])&&_0x512103[_0x8b48('0x1b')]==0x6&&_0x512103['context']!=_0x8b48('0x1c')){utils[_0x8b48('0x4')](util[_0x8b48('0x11')](_0x8b48('0x1d'),_0x512103[_0x8b48('0x6')],_0x512103[_0x8b48('0x10')],_0x512103[_0x8b48('0x13')],_0x512103[_0x8b48('0x15')]));recordings[_0x512103[_0x8b48('0x10')]]['accountcode']=_0x512103[_0x8b48('0x9')];}}catch(_0x2d8ca2){utils[_0x8b48('0x16')](util[_0x8b48('0x11')](_0x8b48('0x18'),_0x512103[_0x8b48('0x6')]),_0x2d8ca2);}};exports[_0x8b48('0x1e')]=function(_0x183e5b){try{if(!_[_0x8b48('0x19')](_0x183e5b[_0x8b48('0x1f')])&&!_[_0x8b48('0x19')](_0x183e5b[_0x8b48('0x1f')]['mixmonitor_filename'])){utils['debug'](util[_0x8b48('0x11')]('[%s][recordings][varset]',_0x183e5b[_0x8b48('0x6')]),_0x183e5b);utils[_0x8b48('0x4')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x183e5b['uniqueid'],_0x183e5b[_0x8b48('0x1f')],_0x183e5b[_0x8b48('0x20')]));if(_[_0x8b48('0x21')](_0x183e5b[_0x8b48('0x20')],_0x8b48('0x22'))){_0x183e5b[_0x8b48('0x20')]=_0x183e5b[_0x8b48('0x20')][_0x8b48('0x23')](_0x8b48('0x22'),_0x8b48('0x24'));}if(recordings[_0x183e5b[_0x8b48('0x10')]]){var _0xa96a27=_[_0x8b48('0x25')](recordings[_0x183e5b[_0x8b48('0x10')]][_0x8b48('0x26')],{'value':_0x183e5b[_0x8b48('0x20')]});if(_['isNil'](_0xa96a27)){recordings[_0x183e5b['linkedid']][_0x8b48('0x26')][_0x8b48('0x27')]({'value':_0x183e5b['value']});}}}}catch(_0x3d980c){utils[_0x8b48('0x16')](util[_0x8b48('0x11')](_0x8b48('0x28'),_0x183e5b[_0x8b48('0x6')]),_0x3d980c);}};exports[_0x8b48('0x29')]=function(_0x3b2a5a){try{if(!_['isNil'](recordings[_0x3b2a5a[_0x8b48('0x6')]])){utils[_0x8b48('0xe')](util['format'](_0x8b48('0x2a'),_0x3b2a5a[_0x8b48('0x6')]),_0x3b2a5a);utils[_0x8b48('0x4')](util[_0x8b48('0x11')](_0x8b48('0x2b'),_0x3b2a5a[_0x8b48('0x6')],_0x3b2a5a['calleridnum'],_0x3b2a5a['calleridname'],_0x3b2a5a[_0x8b48('0x2c')]));recordings[_0x3b2a5a[_0x8b48('0x6')]][_0x8b48('0x2d')]=_0x3b2a5a[_0x8b48('0x2d')];recordings[_0x3b2a5a[_0x8b48('0x6')]][_0x8b48('0x2e')]=_0x3b2a5a[_0x8b48('0x2e')];recordings[_0x3b2a5a[_0x8b48('0x6')]][_0x8b48('0x2f')]=_0x3b2a5a['connectedlinenum'];recordings[_0x3b2a5a[_0x8b48('0x6')]][_0x8b48('0x30')]=_0x3b2a5a[_0x8b48('0x30')];if(recordings[_0x3b2a5a[_0x8b48('0x6')]][_0x8b48('0x31')]==_0x8b48('0x32')&&recordings[_0x3b2a5a[_0x8b48('0x6')]][_0x8b48('0x9')]){recordings[_0x3b2a5a[_0x8b48('0x6')]]['connectedlinenum']=recordings[_0x3b2a5a[_0x8b48('0x6')]]['accountcode'];recordings[_0x3b2a5a[_0x8b48('0x6')]]['connectedlinename']='';}recordings[_0x3b2a5a[_0x8b48('0x6')]][_0x8b48('0x26')][_0x8b48('0x33')](function(_0x2e3240){var _0x13c497=_['clone'](recordings[_0x3b2a5a['uniqueid']]);_0x13c497[_0x8b48('0x20')]=_0x2e3240[_0x8b48('0x20')];writeDB(_0x13c497);});delete recordings[_0x3b2a5a['uniqueid']];}}catch(_0x550008){utils[_0x8b48('0x16')](util[_0x8b48('0x11')](_0x8b48('0x2a'),_0x3b2a5a['uniqueid']),_0x550008);}};exports[_0x8b48('0x34')]=function(_0x56e4b6){try{if(!_[_0x8b48('0x19')](recordings[_0x56e4b6[_0x8b48('0x6')]])){utils['debug'](util[_0x8b48('0x11')](_0x8b48('0x35'),_0x56e4b6[_0x8b48('0x6')]),_0x56e4b6);utils[_0x8b48('0x4')](util[_0x8b48('0x11')](_0x8b48('0x36'),_0x56e4b6[_0x8b48('0x6')],_0x56e4b6[_0x8b48('0x37')],_0x56e4b6[_0x8b48('0x38')]));if(_0x56e4b6['application'][_0x8b48('0x39')]()==_0x8b48('0x3a')&&_[_0x8b48('0x3b')](_0x56e4b6[_0x8b48('0x38')][_0x8b48('0x39')](),_0x8b48('0x3c'))){var _0x44ca79=_0x56e4b6[_0x8b48('0x38')]['split']('=');var _0x19cab8=_0x44ca79[0x0]['substring'](_0x44ca79[0x0][_0x8b48('0x3d')]('(')+0x1,_0x44ca79[0x0][_0x8b48('0x3d')](')'));var _0x3a6df7=_0x44ca79[0x1];recordings[_0x56e4b6[_0x8b48('0x6')]][_0x19cab8]=_0x3a6df7;}}}catch(_0x1f8d23){utils[_0x8b48('0x16')](util[_0x8b48('0x11')](_0x8b48('0x35'),_0x56e4b6[_0x8b48('0x6')]),_0x1f8d23);}};exports[_0x8b48('0x3e')]=function(_0x5768aa){try{if(!_[_0x8b48('0x19')](recordings[_0x5768aa[_0x8b48('0x6')]])){utils[_0x8b48('0xe')](util[_0x8b48('0x11')](_0x8b48('0x3f'),_0x5768aa[_0x8b48('0x6')]),_0x5768aa);utils[_0x8b48('0x4')](util['format'](_0x8b48('0x40'),_0x5768aa[_0x8b48('0x6')],_0x5768aa[_0x8b48('0x41')]));recordings[_0x5768aa[_0x8b48('0x6')]][_0x8b48('0x41')]=_0x5768aa['queue'];}}catch(_0x29afc3){utils[_0x8b48('0x16')](util[_0x8b48('0x11')](_0x8b48('0x3f'),_0x5768aa[_0x8b48('0x6')]),_0x29afc3);}};exports[_0x8b48('0x42')]=function(_0x56855a){try{utils[_0x8b48('0xe')](util[_0x8b48('0x11')](_0x8b48('0x43'),_0x56855a[_0x8b48('0x6')]),_0x56855a);utils[_0x8b48('0x4')](util['format'](_0x8b48('0x44'),_0x56855a[_0x8b48('0x6')],_0x56855a[_0x8b48('0x45')],_0x56855a[_0x8b48('0x46')],_0x56855a['transfereecalleridnum'],_0x56855a[_0x8b48('0x47')]));if(recordings[_0x56855a['transfereruniqueid']]&&transfers[_0x8b48('0x7')][_0x56855a[_0x8b48('0x48')]]){transfers[_0x8b48('0x7')][_0x56855a[_0x8b48('0x48')]][_0x8b48('0x49')]=!![];}}catch(_0x19723b){utils[_0x8b48('0x16')](util[_0x8b48('0x11')](_0x8b48('0x43'),_0x56855a[_0x8b48('0x6')]),_0x19723b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 0ffcf5a..a385df2 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 _0x6e15=['format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','./utils','info'];(function(_0x530956,_0x1ca933){var _0x3c762c=function(_0x58b284){while(--_0x58b284){_0x530956['push'](_0x530956['shift']());}};_0x3c762c(++_0x1ca933);}(_0x6e15,0x198));var _0x56e1=function(_0x563db9,_0x42eb8a){_0x563db9=_0x563db9-0x0;var _0x636a82=_0x6e15[_0x563db9];return _0x636a82;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x56e1('0x0'));function writeDB(_0x1d51df){utils[_0x56e1('0x1')](util[_0x56e1('0x2')](_0x56e1('0x3'),_0x1d51df[_0x56e1('0x4')]===_0x56e1('0x5')?_0x1d51df[_0x56e1('0x6')]:_0x1d51df['uniqueid'],_0x1d51df[_0x56e1('0x4')]));utils[_0x56e1('0x7')](_0x56e1('0x8'),_0x1d51df);}exports[_0x56e1('0x9')]={};exports[_0x56e1('0xa')]=function(_0x5da393){try{utils[_0x56e1('0xb')](util[_0x56e1('0x2')](_0x56e1('0xc'),_0x5da393['uniqueid']),_0x5da393);utils[_0x56e1('0x1')](util[_0x56e1('0x2')](_0x56e1('0xd'),_0x5da393[_0x56e1('0xe')],_0x5da393[_0x56e1('0xf')],_0x5da393[_0x56e1('0x10')],_0x5da393[_0x56e1('0x11')],_0x5da393[_0x56e1('0x12')]));_0x5da393[_0x56e1('0x4')]=_0x56e1('0x13');exports[_0x56e1('0x9')][_0x5da393[_0x56e1('0x14')]]=_0x5da393;writeDB(_0x5da393);}catch(_0x5a4aa4){utils[_0x56e1('0x15')](util[_0x56e1('0x2')](_0x56e1('0xc'),_0x5da393[_0x56e1('0xe')]),_0x5a4aa4);}};exports[_0x56e1('0x16')]=function(_0x3f6134){try{utils['debug'](util[_0x56e1('0x2')](_0x56e1('0x17'),_0x3f6134['origtransfereruniqueid']),_0x3f6134);utils['info'](util[_0x56e1('0x2')](_0x56e1('0x18'),_0x3f6134['origtransfereruniqueid'],_0x3f6134[_0x56e1('0x19')],_0x3f6134[_0x56e1('0x1a')],_0x3f6134[_0x56e1('0x1b')],_0x3f6134[_0x56e1('0x1c')]));_0x3f6134=_[_0x56e1('0x1d')](_0x3f6134,{'transfererchannel':_0x3f6134[_0x56e1('0x1e')],'transferercalleridnum':_0x3f6134[_0x56e1('0x19')],'transferercalleridname':_0x3f6134[_0x56e1('0x1a')],'transfererconnectedlinenum':_0x3f6134[_0x56e1('0x1f')],'transfererconnectedlinename':_0x3f6134['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3f6134['origtransfereraccountcode'],'transferercontext':_0x3f6134[_0x56e1('0x20')],'transfererexten':_0x3f6134[_0x56e1('0x21')],'transfererlinkedid':_0x3f6134['origtransfererlinkedid'],'context':_0x3f6134['origtransferercontext'],'extension':_0x3f6134['origtransfererexten'],'type':_0x56e1('0x5')});if(_[_0x56e1('0x22')](_0x3f6134[_0x56e1('0x23')])){_0x3f6134=_[_0x56e1('0x1d')](_0x3f6134,{'transfereechannel':_0x3f6134[_0x56e1('0x24')],'transfereecalleridnum':_0x3f6134[_0x56e1('0x1b')],'transfereecalleridname':_0x3f6134[_0x56e1('0x1c')],'transfereeconnectedlinenum':_0x3f6134[_0x56e1('0x25')],'transfereeconnectedlinename':_0x3f6134[_0x56e1('0x26')],'transfereeaccountcode':_0x3f6134[_0x56e1('0x27')],'transfereecontext':_0x3f6134[_0x56e1('0x28')],'transfereeexten':_0x3f6134['transfertargetexten'],'transfereelinkedid':_0x3f6134['transfertargetlinkedid']});}writeDB(_0x3f6134);}catch(_0x34a005){utils[_0x56e1('0x15')](util[_0x56e1('0x2')](_0x56e1('0x17'),_0x3f6134[_0x56e1('0x6')]),_0x34a005);}}; \ No newline at end of file +var _0xd490=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','lodash','util','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','info','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel'];(function(_0x5ee702,_0x5b0ef8){var _0x37071f=function(_0x1ee95e){while(--_0x1ee95e){_0x5ee702['push'](_0x5ee702['shift']());}};_0x37071f(++_0x5b0ef8);}(_0xd490,0x1bc));var _0x0d49=function(_0x25304b,_0x4723fa){_0x25304b=_0x25304b-0x0;var _0x342505=_0xd490[_0x25304b];return _0x342505;};'use strict';var _=require(_0x0d49('0x0'));var util=require(_0x0d49('0x1'));var utils=require('./utils');function writeDB(_0x55a212){utils['info'](util[_0x0d49('0x2')](_0x0d49('0x3'),_0x55a212[_0x0d49('0x4')]===_0x0d49('0x5')?_0x55a212[_0x0d49('0x6')]:_0x55a212[_0x0d49('0x7')],_0x55a212[_0x0d49('0x4')]));utils['request']('CreateVoiceTransferReport',_0x55a212);}exports[_0x0d49('0x8')]={};exports[_0x0d49('0x9')]=function(_0x5593ef){try{utils['debug'](util['format'](_0x0d49('0xa'),_0x5593ef['uniqueid']),_0x5593ef);utils['info'](util[_0x0d49('0x2')](_0x0d49('0xb'),_0x5593ef[_0x0d49('0x7')],_0x5593ef[_0x0d49('0xc')],_0x5593ef[_0x0d49('0xd')],_0x5593ef[_0x0d49('0xe')],_0x5593ef[_0x0d49('0xf')]));_0x5593ef['type']=_0x0d49('0x10');exports['blinds'][_0x5593ef[_0x0d49('0x11')]]=_0x5593ef;writeDB(_0x5593ef);}catch(_0x353953){utils[_0x0d49('0x12')](util[_0x0d49('0x2')](_0x0d49('0xa'),_0x5593ef[_0x0d49('0x7')]),_0x353953);}};exports[_0x0d49('0x13')]=function(_0x217d14){try{utils[_0x0d49('0x14')](util[_0x0d49('0x2')](_0x0d49('0x15'),_0x217d14[_0x0d49('0x6')]),_0x217d14);utils[_0x0d49('0x16')](util[_0x0d49('0x2')](_0x0d49('0x17'),_0x217d14[_0x0d49('0x6')],_0x217d14['origtransferercalleridnum'],_0x217d14[_0x0d49('0x18')],_0x217d14[_0x0d49('0x19')],_0x217d14[_0x0d49('0x1a')]));_0x217d14=_[_0x0d49('0x1b')](_0x217d14,{'transfererchannel':_0x217d14[_0x0d49('0x1c')],'transferercalleridnum':_0x217d14[_0x0d49('0x1d')],'transferercalleridname':_0x217d14[_0x0d49('0x18')],'transfererconnectedlinenum':_0x217d14['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x217d14['secondtransfererconnectedlinename'],'transfereraccountcode':_0x217d14['origtransfereraccountcode'],'transferercontext':_0x217d14[_0x0d49('0x1e')],'transfererexten':_0x217d14[_0x0d49('0x1f')],'transfererlinkedid':_0x217d14[_0x0d49('0x20')],'context':_0x217d14[_0x0d49('0x21')],'extension':_0x217d14[_0x0d49('0x22')],'type':_0x0d49('0x5')});if(_['isNil'](_0x217d14[_0x0d49('0x23')])){_0x217d14=_['assign'](_0x217d14,{'transfereechannel':_0x217d14['transfertargetchannel'],'transfereecalleridnum':_0x217d14[_0x0d49('0x19')],'transfereecalleridname':_0x217d14[_0x0d49('0x1a')],'transfereeconnectedlinenum':_0x217d14[_0x0d49('0x24')],'transfereeconnectedlinename':_0x217d14[_0x0d49('0x25')],'transfereeaccountcode':_0x217d14['transfertargetaccountcode'],'transfereecontext':_0x217d14[_0x0d49('0x26')],'transfereeexten':_0x217d14['transfertargetexten'],'transfereelinkedid':_0x217d14[_0x0d49('0x27')]});}writeDB(_0x217d14);}catch(_0x2e3ca6){utils[_0x0d49('0x12')](util[_0x0d49('0x2')]('[%s][transfers][attendedtransfer]',_0x217d14[_0x0d49('0x6')]),_0x2e3ca6);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 285ba4d..a034a40 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 _0x7d5b=['[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','bluebird','jayson/promise','util','client','http','xdr','info','debug','inspect','then','[utils][request]\x20name:%s','error','request','GetUser','internal','name','interface','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x7d5b,0x131));var _0xb7d5=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x7d5b[_0x122096];return _0x3d1966;};'use strict';var BPromise=require(_0xb7d5('0x0'));var jayson=require(_0xb7d5('0x1'));var moment=require('moment');var util=require(_0xb7d5('0x2'));var client=jayson[_0xb7d5('0x3')][_0xb7d5('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xb7d5('0x5'));exports[_0xb7d5('0x6')]=function(_0xf37c04,_0x4bc772){logger[_0xb7d5('0x6')](_0xf37c04,_0x4bc772?util['inspect'](_0x4bc772,{'showHidden':![],'depth':null}):'');};exports[_0xb7d5('0x7')]=function(_0x42cbc3,_0x3aa3a7){logger['debug'](_0x42cbc3,_0x3aa3a7?util[_0xb7d5('0x8')](_0x3aa3a7,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x667d0f,_0x28b48c){logger['error'](_0x667d0f,_0x28b48c?util[_0xb7d5('0x8')](_0x28b48c,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3e7f12,_0x50b972){return client['request'](_0x3e7f12,{'body':_0x50b972})[_0xb7d5('0x9')](function(_0x393b60){logger[_0xb7d5('0x7')](_0xb7d5('0xa'),_0x3e7f12,_0x393b60?util[_0xb7d5('0x8')](_0x393b60,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x50454e){logger[_0xb7d5('0xb')](_0xb7d5('0xa'),_0x3e7f12,_0x50454e?util[_0xb7d5('0x8')](_0x50454e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3d912a){return client[_0xb7d5('0xc')](_0xb7d5('0xd'),{'options':{'raw':!![],'attributes':['id',_0xb7d5('0xe'),_0xb7d5('0xf'),_0xb7d5('0x10')],'where':_0x3d912a,'limit':0x1}})[_0xb7d5('0x9')](function(_0x120bcb){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0xb7d5('0x11')](_0x3d912a),_0x120bcb?util[_0xb7d5('0x8')](_0x120bcb,{'showHidden':![],'depth':null}):'');return _0x120bcb['result']['length']?_0x120bcb[_0xb7d5('0x12')][0x0]:null;});}exports[_0xb7d5('0x13')]=function(_0x220444){return new BPromise(function(_0x5ef410,_0xe5be0b){if(_0x220444){return getUser({'internal':_0x220444})[_0xb7d5('0x9')](function(_0x147318){logger[_0xb7d5('0x6')](_0xb7d5('0x14'),_0x220444,_0x147318?_0xb7d5('0x15'):_0xb7d5('0x16'));return _0x5ef410(_0x147318);})[_0xb7d5('0x17')](function(_0x18692d){logger['error'](_0xb7d5('0x18'),_0x18692d?util[_0xb7d5('0x8')](_0x18692d,{'showHidden':![],'depth':null}):'');return _0x5ef410(null);});}return _0x5ef410(null);});};exports[_0xb7d5('0x19')]=function(_0x426f81){return new BPromise(function(_0x4ca3d1,_0x38060c){if(_0x426f81){return getUser({'interface':_0x426f81})['then'](function(_0x455e37){logger['info'](_0xb7d5('0x1a'),_0x426f81,_0x455e37?'found':_0xb7d5('0x16'));return _0x4ca3d1(_0x455e37);})[_0xb7d5('0x17')](function(_0x2b64b7){logger[_0xb7d5('0xb')]('[utils][getUserByInterface]',_0x2b64b7?util[_0xb7d5('0x8')](_0x2b64b7,{'showHidden':![],'depth':null}):'');return _0x4ca3d1(null);});}return _0x4ca3d1(null);});};exports[_0xb7d5('0x1b')]=function(_0x18ce4a){return new BPromise(function(_0x341e49,_0x15337a){if(_0x18ce4a){return getUser({'name':_0x18ce4a})[_0xb7d5('0x9')](function(_0x314124){logger[_0xb7d5('0x6')](_0xb7d5('0x1c'),_0x18ce4a,_0x314124?_0xb7d5('0x15'):_0xb7d5('0x16'));return _0x341e49(_0x314124);})[_0xb7d5('0x17')](function(_0x1c19ff){logger[_0xb7d5('0xb')](_0xb7d5('0x1d'),_0x1c19ff?util[_0xb7d5('0x8')](_0x1c19ff,{'showHidden':![],'depth':null}):'');return _0x341e49(null);});}return _0x341e49(null);});};exports[_0xb7d5('0x1e')]=function(_0x17671e){return new BPromise(function(_0x555342,_0x41e32b){if(_0x17671e){return client[_0xb7d5('0xc')](_0xb7d5('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xb7d5('0xf'),_0xb7d5('0x20'),_0xb7d5('0x21'),_0xb7d5('0x22')],'where':{'name':_0x17671e},'limit':0x1}})['then'](function(_0x192450){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x17671e,_0x192450?util[_0xb7d5('0x8')](_0x192450,{'showHidden':![],'depth':null}):'');logger[_0xb7d5('0x6')](_0xb7d5('0x23'),_0x17671e,_0x192450?_0xb7d5('0x15'):_0xb7d5('0x16'));return _0x555342(_0x192450[_0xb7d5('0x12')][_0xb7d5('0x24')]?_0x192450[_0xb7d5('0x12')][0x0]:null);})[_0xb7d5('0x17')](function(_0x391c86){logger[_0xb7d5('0xb')]('[utils][getVoiceQueueByName]',_0x391c86?util['inspect'](_0x391c86,{'showHidden':![],'depth':null}):'');return _0x555342(null);});}return _0x555342(null);});};exports['addTime']=function(_0x4e8e64,_0x3ed91b){return moment(_0x4e8e64)[_0xb7d5('0x25')](_0x3ed91b,_0xb7d5('0x26'))[_0xb7d5('0x27')](_0xb7d5('0x28'));};exports['subtractTime']=function(_0x338996,_0x569b86){return moment(_0x338996)[_0xb7d5('0x29')](_0x569b86,_0xb7d5('0x26'))['format'](_0xb7d5('0x28'));};exports[_0xb7d5('0x2a')]=function(_0x50eba7,_0x4b2afb){return moment(_0x50eba7)[_0xb7d5('0x2b')](moment(_0x4b2afb),_0xb7d5('0x26'));};exports[_0xb7d5('0x2c')]=function(_0x5e39f7,_0x412ed9){return parseInt(_0x5e39f7,0xa)+parseInt(_0x412ed9,0xa);};exports[_0xb7d5('0x2d')]=function(){return moment()[_0xb7d5('0x27')](_0xb7d5('0x28'));};exports[_0xb7d5('0x2e')]=function(_0x143488,_0x421982){if(_0x421982){return moment(_0x143488)['isAfter'](_0x421982);}return!![];};exports['isBefore']=function(_0x1f47a1,_0x3a0454){if(_0x3a0454){return moment(_0x1f47a1)['isBefore'](_0x3a0454);}else if(_0x1f47a1){return!![];}return![];}; \ No newline at end of file +var _0x75dd=['YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','interface','result','length','getUserByInternal','[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','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x75dd,0x1c9));var _0xd75d=function(_0x53b15f,_0x281645){_0x53b15f=_0x53b15f-0x0;var _0x3a358e=_0x75dd[_0x53b15f];return _0x3a358e;};'use strict';var BPromise=require(_0xd75d('0x0'));var jayson=require(_0xd75d('0x1'));var moment=require(_0xd75d('0x2'));var util=require(_0xd75d('0x3'));var client=jayson[_0xd75d('0x4')][_0xd75d('0x5')]({'port':0x2329});var logger=require('../../config/logger')(_0xd75d('0x6'));exports[_0xd75d('0x7')]=function(_0x468082,_0xcb99e){logger[_0xd75d('0x7')](_0x468082,_0xcb99e?util[_0xd75d('0x8')](_0xcb99e,{'showHidden':![],'depth':null}):'');};exports[_0xd75d('0x9')]=function(_0x3594fc,_0x48cce5){logger[_0xd75d('0x9')](_0x3594fc,_0x48cce5?util[_0xd75d('0x8')](_0x48cce5,{'showHidden':![],'depth':null}):'');};exports[_0xd75d('0xa')]=function(_0xd24f6b,_0x51ff92){logger[_0xd75d('0xa')](_0xd24f6b,_0x51ff92?util[_0xd75d('0x8')](_0x51ff92,{'showHidden':![],'depth':null}):'');};exports[_0xd75d('0xb')]=function(_0x216f91,_0x79e229){return client[_0xd75d('0xb')](_0x216f91,{'body':_0x79e229})[_0xd75d('0xc')](function(_0x3fa590){logger['debug'](_0xd75d('0xd'),_0x216f91,_0x3fa590?util[_0xd75d('0x8')](_0x3fa590,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2cd327){logger[_0xd75d('0xa')]('[utils][request]\x20name:%s',_0x216f91,_0x2cd327?util[_0xd75d('0x8')](_0x2cd327,{'showHidden':![],'depth':null}):'');});};function getUser(_0x44164){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xd75d('0xe'),_0xd75d('0xf'),_0xd75d('0x10')],'where':_0x44164,'limit':0x1}})['then'](function(_0x20f203){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0x44164),_0x20f203?util[_0xd75d('0x8')](_0x20f203,{'showHidden':![],'depth':null}):'');return _0x20f203[_0xd75d('0x11')][_0xd75d('0x12')]?_0x20f203['result'][0x0]:null;});}exports[_0xd75d('0x13')]=function(_0x3d4d89){return new BPromise(function(_0xb86bbf,_0x53d05b){if(_0x3d4d89){return getUser({'internal':_0x3d4d89})[_0xd75d('0xc')](function(_0x5537c2){logger[_0xd75d('0x7')](_0xd75d('0x14'),_0x3d4d89,_0x5537c2?_0xd75d('0x15'):_0xd75d('0x16'));return _0xb86bbf(_0x5537c2);})[_0xd75d('0x17')](function(_0x28892f){logger['error'](_0xd75d('0x18'),_0x28892f?util[_0xd75d('0x8')](_0x28892f,{'showHidden':![],'depth':null}):'');return _0xb86bbf(null);});}return _0xb86bbf(null);});};exports[_0xd75d('0x19')]=function(_0x42a68e){return new BPromise(function(_0x2cc214,_0x13ec15){if(_0x42a68e){return getUser({'interface':_0x42a68e})[_0xd75d('0xc')](function(_0x5e1e36){logger[_0xd75d('0x7')](_0xd75d('0x1a'),_0x42a68e,_0x5e1e36?'found':_0xd75d('0x16'));return _0x2cc214(_0x5e1e36);})[_0xd75d('0x17')](function(_0x96e5b4){logger[_0xd75d('0xa')]('[utils][getUserByInterface]',_0x96e5b4?util['inspect'](_0x96e5b4,{'showHidden':![],'depth':null}):'');return _0x2cc214(null);});}return _0x2cc214(null);});};exports[_0xd75d('0x1b')]=function(_0xbc4bd4){return new BPromise(function(_0x3db450,_0x5c0f97){if(_0xbc4bd4){return getUser({'name':_0xbc4bd4})[_0xd75d('0xc')](function(_0x4619a){logger[_0xd75d('0x7')](_0xd75d('0x1c'),_0xbc4bd4,_0x4619a?_0xd75d('0x15'):_0xd75d('0x16'));return _0x3db450(_0x4619a);})[_0xd75d('0x17')](function(_0x59387f){logger[_0xd75d('0xa')]('[utils][getUserByName]',_0x59387f?util[_0xd75d('0x8')](_0x59387f,{'showHidden':![],'depth':null}):'');return _0x3db450(null);});}return _0x3db450(null);});};exports['getVoiceQueueByName']=function(_0x5db546){return new BPromise(function(_0x151cb1,_0x4baa60){if(_0x5db546){return client['request'](_0xd75d('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xd75d('0xf'),_0xd75d('0x1e'),'acw',_0xd75d('0x1f')],'where':{'name':_0x5db546},'limit':0x1}})[_0xd75d('0xc')](function(_0x39d434){logger[_0xd75d('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x5db546,_0x39d434?util[_0xd75d('0x8')](_0x39d434,{'showHidden':![],'depth':null}):'');logger[_0xd75d('0x7')](_0xd75d('0x20'),_0x5db546,_0x39d434?'found':_0xd75d('0x16'));return _0x151cb1(_0x39d434['result'][_0xd75d('0x12')]?_0x39d434[_0xd75d('0x11')][0x0]:null);})[_0xd75d('0x17')](function(_0xe760ba){logger[_0xd75d('0xa')](_0xd75d('0x21'),_0xe760ba?util[_0xd75d('0x8')](_0xe760ba,{'showHidden':![],'depth':null}):'');return _0x151cb1(null);});}return _0x151cb1(null);});};exports[_0xd75d('0x22')]=function(_0x57e0a1,_0x448ae0){return moment(_0x57e0a1)[_0xd75d('0x23')](_0x448ae0,_0xd75d('0x24'))[_0xd75d('0x25')](_0xd75d('0x26'));};exports['subtractTime']=function(_0x39d408,_0x30a195){return moment(_0x39d408)[_0xd75d('0x27')](_0x30a195,_0xd75d('0x24'))['format'](_0xd75d('0x26'));};exports[_0xd75d('0x28')]=function(_0x20ab46,_0x21bc4b){return moment(_0x20ab46)['diff'](moment(_0x21bc4b),_0xd75d('0x24'));};exports[_0xd75d('0x29')]=function(_0x4930c1,_0x55615c){return parseInt(_0x4930c1,0xa)+parseInt(_0x55615c,0xa);};exports[_0xd75d('0x2a')]=function(){return moment()['format'](_0xd75d('0x26'));};exports[_0xd75d('0x2b')]=function(_0x127b9f,_0x3b99be){if(_0x3b99be){return moment(_0x127b9f)[_0xd75d('0x2b')](_0x3b99be);}return!![];};exports[_0xd75d('0x2c')]=function(_0x22bf73,_0x469df2){if(_0x469df2){return moment(_0x22bf73)['isBefore'](_0x469df2);}else if(_0x22bf73){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 f71bb6b..4da9364 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 _0x31f6=['responseTime','role','inspect','agent_id','url','device','other','agent_name','test','fs-extra','lodash','express-winston','path','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','name','ensureDir','then','user','no-user','data','catch','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','x-forwarded-for','headers','connection','remoteAddress','statusCode'];(function(_0x293752,_0x3beb97){var _0x174162=function(_0x2a5bca){while(--_0x2a5bca){_0x293752['push'](_0x293752['shift']());}};_0x174162(++_0x3beb97);}(_0x31f6,0x1b9));var _0x631f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x31f6[_0x20a584];return _0x4b41a8;};var fs=require(_0x631f('0x0'));var _=require(_0x631f('0x1'));var ewinston=require(_0x631f('0x2'));var path=require(_0x631f('0x3'));var util=require('util');var fileLogger=require(_0x631f('0x4'))[_0x631f('0x5')];var safeTemplate=require(_0x631f('0x6'))[_0x631f('0x7')];var maskSensitiveData=require(_0x631f('0x8'))[_0x631f('0x9')];function ClientSideLogger(){function _0x3c7880(_0x448353){var _0x548bfb=path[_0x631f('0xa')](_0x631f('0xb'),_0x631f('0xc'),_0x631f('0xd'));var _0x3514c5=path[_0x631f('0xa')](_0x631f('0xe'),_0x448353['role']+'-'+_0x448353[_0x631f('0xf')]);return fs[_0x631f('0x10')](path[_0x631f('0xa')](_0x548bfb,_0x3514c5))[_0x631f('0x11')](function(){var _0x3dd2f1=fileLogger(_0x631f('0xe'),path[_0x631f('0xa')](_0x548bfb,_0x3514c5));return _0x3dd2f1;})['catch'](function(_0xd4e3e9){throw _0xd4e3e9;});}this[_0x631f('0xc')]=function(_0x323817,_0x5a7e2e,_0x4c8b53,_0x2c1cc6){return _0x3c7880(_0x323817[_0x631f('0x12')])[_0x631f('0x11')](function(_0x327de7){var _0x13fe28=_0x327de7[_0x5a7e2e];return _0x13fe28;})[_0x631f('0x11')](function(_0x2abcb2){var _0x914b2f=_0x323817[_0x631f('0x12')]?_0x323817['user']['id']:_0x631f('0x13');var _0x31f0dc=_0x2c1cc6[_0x631f('0x14')];var _0x29cc29=_0x2c1cc6['timestamp'];var _0x5655a4=new Date(Number(_0x29cc29));return _0x2abcb2(_0x914b2f,_0x5655a4,_0x4c8b53,_0x31f0dc);})[_0x631f('0x15')](function(_0x3f5cc8){fileLogger(_0x631f('0xe'))[_0x631f('0x16')](_0x3f5cc8);});};}function setupLoggers(_0x4903b6){return new Promise(function(_0x304615){var _0x27c5d6=new ClientSideLogger();var _0x2e442a=fileLogger(_0x631f('0x17'));var _0x2fc9bf=fileLogger(_0x631f('0x18'));_0x4903b6[_0x631f('0x19')](_0x631f('0x1a'),_0x27c5d6);_0x4903b6[_0x631f('0x1b')](ewinston[_0x631f('0x1c')]({'winstonInstance':_0x2e442a,'meta':![],'statusLevels':!![],'msg':function(_0x2dd837,_0x8cb539){var _0x34ab42=_0x631f('0x1d');if(!_[_0x631f('0x1e')](_0x2dd837[_0x631f('0x1f')])){_0x34ab42+='\x20body=%s';var _0x3b419b=_0x2dd837[_0x631f('0x1f')];maskSensitiveData(_0x3b419b);}return safeTemplate(util[_0x631f('0x20')](_0x34ab42,_0x2dd837[_0x631f('0x21')],_0x2dd837['headers'][_0x631f('0x22')]?_0x2dd837[_0x631f('0x23')][_0x631f('0x22')]:_0x2dd837[_0x631f('0x24')][_0x631f('0x25')]||_0x2dd837['ip'],_0x2dd837['url'],_0x8cb539[_0x631f('0x26')],_0x8cb539[_0x631f('0x27')],_0x2dd837[_0x631f('0x12')]?_0x2dd837[_0x631f('0x12')]['id']:null,_0x2dd837['user']?_0x2dd837['user'][_0x631f('0xf')]:null,_0x2dd837[_0x631f('0x12')]?_0x2dd837[_0x631f('0x12')][_0x631f('0x28')]:null,_0x3b419b?util[_0x631f('0x29')](_0x3b419b,![],null):''));}}));_0x4903b6['use'](ewinston[_0x631f('0x1c')]({'winstonInstance':_0x2fc9bf,'meta':![],'statusLevels':!![],'msg':function(_0x4aa265,_0x5b637c){var _0xf3d13='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4aa265[_0x631f('0x1f')]&&_0x4aa265[_0x631f('0x1f')]['device']&&_0x4aa265[_0x631f('0x1f')][_0x631f('0x2a')]){_0xf3d13='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0xf3d13,_0x4aa265[_0x631f('0x21')],_0x4aa265['headers'][_0x631f('0x22')]?_0x4aa265[_0x631f('0x23')][_0x631f('0x22')]:_0x4aa265[_0x631f('0x24')][_0x631f('0x25')]||_0x4aa265['ip'],_0x4aa265[_0x631f('0x2b')],_0x5b637c[_0x631f('0x26')],_0x5b637c['responseTime'],_0x4aa265[_0x631f('0x12')]?_0x4aa265[_0x631f('0x12')]['id']:null,_0x4aa265[_0x631f('0x12')]?_0x4aa265[_0x631f('0x12')][_0x631f('0xf')]:null,_0x4aa265[_0x631f('0x12')]?_0x4aa265[_0x631f('0x12')][_0x631f('0x28')]:null,_0x4aa265[_0x631f('0x1f')]&&_0x4aa265[_0x631f('0x1f')]['device']?_0x4aa265[_0x631f('0x1f')][_0x631f('0x2c')]:_0x631f('0x2d'),_0x4aa265[_0x631f('0x1f')]&&_0x4aa265[_0x631f('0x1f')][_0x631f('0x2a')]?_0x4aa265[_0x631f('0x1f')][_0x631f('0x2a')]:'',_0x4aa265['body']&&_0x4aa265['body']['agent_name']?_0x4aa265['body'][_0x631f('0x2e')]:'');},'ignoreRoute':function(_0x223fa5){var _0x4c0205=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4c0205[_0x631f('0x2f')](_0x223fa5['url']);}}));return _0x304615();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0xdca5=['other','agent_name','test','setupLoggers','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','ensureDir','then','client','catch','user','no-user','data','timestamp','error','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','connection','remoteAddress','url','responseTime','name','inspect','%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)','x-forwarded-for','statusCode'];(function(_0x54b648,_0x4a2af7){var _0x19b71=function(_0x31146c){while(--_0x31146c){_0x54b648['push'](_0x54b648['shift']());}};_0x19b71(++_0x4a2af7);}(_0xdca5,0x6a));var _0x5dca=function(_0x263908,_0x61d16c){_0x263908=_0x263908-0x0;var _0x4e98ca=_0xdca5[_0x263908];return _0x4e98ca;};var fs=require('fs-extra');var _=require(_0x5dca('0x0'));var ewinston=require(_0x5dca('0x1'));var path=require(_0x5dca('0x2'));var util=require(_0x5dca('0x3'));var fileLogger=require(_0x5dca('0x4'))[_0x5dca('0x5')];var safeTemplate=require(_0x5dca('0x6'))[_0x5dca('0x7')];var maskSensitiveData=require(_0x5dca('0x8'))[_0x5dca('0x9')];function ClientSideLogger(){function _0x27985(_0x48f158){var _0x1e396b=path[_0x5dca('0xa')](_0x5dca('0xb'),_0x5dca('0xc'),_0x5dca('0xd'));var _0x55d210=path[_0x5dca('0xa')]('client',_0x48f158[_0x5dca('0xe')]+'-'+_0x48f158['name']);return fs[_0x5dca('0xf')](path[_0x5dca('0xa')](_0x1e396b,_0x55d210))[_0x5dca('0x10')](function(){var _0x4da626=fileLogger(_0x5dca('0x11'),path[_0x5dca('0xa')](_0x1e396b,_0x55d210));return _0x4da626;})[_0x5dca('0x12')](function(_0x532f06){throw _0x532f06;});}this['log']=function(_0x535d42,_0x131307,_0x18f4c5,_0x19302a){return _0x27985(_0x535d42['user'])[_0x5dca('0x10')](function(_0x2e7c0e){var _0x2af67f=_0x2e7c0e[_0x131307];return _0x2af67f;})[_0x5dca('0x10')](function(_0x2b2f4a){var _0x47d81b=_0x535d42['user']?_0x535d42[_0x5dca('0x13')]['id']:_0x5dca('0x14');var _0x2b37e0=_0x19302a[_0x5dca('0x15')];var _0x4b2930=_0x19302a[_0x5dca('0x16')];var _0x26839c=new Date(Number(_0x4b2930));return _0x2b2f4a(_0x47d81b,_0x26839c,_0x18f4c5,_0x2b37e0);})[_0x5dca('0x12')](function(_0x5aad0e){fileLogger('client')[_0x5dca('0x17')](_0x5aad0e);});};}function setupLoggers(_0x137a82){return new Promise(function(_0x308b77){var _0x2db560=new ClientSideLogger();var _0xcd23c3=fileLogger('api');var _0x4ec0c6=fileLogger(_0x5dca('0x18'));_0x137a82['set'](_0x5dca('0x19'),_0x2db560);_0x137a82[_0x5dca('0x1a')](ewinston[_0x5dca('0x1b')]({'winstonInstance':_0xcd23c3,'meta':![],'statusLevels':!![],'msg':function(_0x52dab4,_0x4d39db){var _0x35846d=_0x5dca('0x1c');if(!_[_0x5dca('0x1d')](_0x52dab4[_0x5dca('0x1e')])){_0x35846d+=_0x5dca('0x1f');var _0x56326a=_0x52dab4[_0x5dca('0x1e')];maskSensitiveData(_0x56326a);}return safeTemplate(util[_0x5dca('0x20')](_0x35846d,_0x52dab4[_0x5dca('0x21')],_0x52dab4[_0x5dca('0x22')]['x-forwarded-for']?_0x52dab4[_0x5dca('0x22')]['x-forwarded-for']:_0x52dab4[_0x5dca('0x23')][_0x5dca('0x24')]||_0x52dab4['ip'],_0x52dab4[_0x5dca('0x25')],_0x4d39db['statusCode'],_0x4d39db[_0x5dca('0x26')],_0x52dab4[_0x5dca('0x13')]?_0x52dab4[_0x5dca('0x13')]['id']:null,_0x52dab4[_0x5dca('0x13')]?_0x52dab4['user'][_0x5dca('0x27')]:null,_0x52dab4['user']?_0x52dab4[_0x5dca('0x13')][_0x5dca('0xe')]:null,_0x56326a?util[_0x5dca('0x28')](_0x56326a,![],null):''));}}));_0x137a82['use'](ewinston[_0x5dca('0x1b')]({'winstonInstance':_0x4ec0c6,'meta':![],'statusLevels':!![],'msg':function(_0x24d5bb,_0x3e9b0a){var _0x46eccc=_0x5dca('0x29');if(_0x24d5bb[_0x5dca('0x1e')]&&_0x24d5bb[_0x5dca('0x1e')][_0x5dca('0x2a')]&&_0x24d5bb['body'][_0x5dca('0x2b')]){_0x46eccc=_0x5dca('0x2c');}return util[_0x5dca('0x20')](_0x46eccc,_0x24d5bb[_0x5dca('0x21')],_0x24d5bb[_0x5dca('0x22')]['x-forwarded-for']?_0x24d5bb[_0x5dca('0x22')][_0x5dca('0x2d')]:_0x24d5bb[_0x5dca('0x23')]['remoteAddress']||_0x24d5bb['ip'],_0x24d5bb[_0x5dca('0x25')],_0x3e9b0a[_0x5dca('0x2e')],_0x3e9b0a[_0x5dca('0x26')],_0x24d5bb[_0x5dca('0x13')]?_0x24d5bb['user']['id']:null,_0x24d5bb[_0x5dca('0x13')]?_0x24d5bb['user'][_0x5dca('0x27')]:null,_0x24d5bb['user']?_0x24d5bb[_0x5dca('0x13')]['role']:null,_0x24d5bb[_0x5dca('0x1e')]&&_0x24d5bb[_0x5dca('0x1e')]['device']?_0x24d5bb[_0x5dca('0x1e')][_0x5dca('0x2a')]:_0x5dca('0x2f'),_0x24d5bb[_0x5dca('0x1e')]&&_0x24d5bb[_0x5dca('0x1e')][_0x5dca('0x2b')]?_0x24d5bb['body'][_0x5dca('0x2b')]:'',_0x24d5bb['body']&&_0x24d5bb['body'][_0x5dca('0x30')]?_0x24d5bb[_0x5dca('0x1e')][_0x5dca('0x30')]:'');},'ignoreRoute':function(_0x540784){var _0x2bc493=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2bc493[_0x5dca('0x31')](_0x540784[_0x5dca('0x25')]);}}));return _0x308b77();});}exports[_0x5dca('0x32')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 03c6aa0..f265110 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6eaa=['bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','{{{','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','File','error','%s-%s','warn','consoleLogger','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6eaa,0x185));var _0xa6ea=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0x6eaa[_0x5f5cce];return _0x705ecf;};'use strict';var path=require('path');var util=require(_0xa6ea('0x0'));var moment=require(_0xa6ea('0x1'));var winston=require(_0xa6ea('0x2'));var config=require(_0xa6ea('0x3'));var debugLevel=config[_0xa6ea('0x4')]?config[_0xa6ea('0x4')][_0xa6ea('0x5')]():_0xa6ea('0x6');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':_0xa6ea('0x7'),'error':_0xa6ea('0x8'),'warn':_0xa6ea('0x9'),'info':_0xa6ea('0xa'),'print':_0xa6ea('0xb'),'success':_0xa6ea('0xc'),'http':_0xa6ea('0xd'),'verbose':_0xa6ea('0xe'),'debug':'bold\x20blue','silly':_0xa6ea('0xf')};winston[_0xa6ea('0x10')](XC_LOG_COLORS);function getLogFileName(_0x476869,_0x26e6a8,_0x40067b){var _0x3b5d5b=_0x476869||_0xa6ea('0x11');return path['join'](_0x3b5d5b,util[_0xa6ea('0x12')]('%s-%s.log',_0x26e6a8,_0x40067b));}function formatter(_0x5d6990,_0x26ab45){_0x26ab45['message']=_0x26ab45[_0xa6ea('0x13')][_0xa6ea('0x14')](/@@{/g,'{{{')[_0xa6ea('0x14')](/}@@/g,_0xa6ea('0x15'))[_0xa6ea('0x14')](/@{/g,'{{')[_0xa6ea('0x14')](/}@/g,'}}');return util[_0xa6ea('0x12')](_0xa6ea('0x16'),moment()['format'](_0xa6ea('0x17')),_0x26ab45[_0xa6ea('0x18')]['toUpperCase'](),_0x5d6990,_0x26ab45[_0xa6ea('0x13')]);}function fileFormat(_0x163b66,_0x2877bf){_0x2877bf[_0xa6ea('0x13')]=_0x2877bf['message'][_0xa6ea('0x14')](/@@{/g,_0xa6ea('0x19'))[_0xa6ea('0x14')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xa6ea('0x14')](/}@/g,'}}');var _0x393994=_0x2877bf[_0xa6ea('0x1a')]&&Object[_0xa6ea('0x1b')](_0x2877bf[_0xa6ea('0x1a')])[_0xa6ea('0x1c')]?'\x0a\x09'+JSON[_0xa6ea('0x1d')](_0x2877bf['meta']):'';return util[_0xa6ea('0x12')](_0xa6ea('0x1e'),moment()[_0xa6ea('0x12')](_0xa6ea('0x17')),_0x2877bf[_0xa6ea('0x18')][_0xa6ea('0x1f')](),_0x163b66,_0x2877bf['message'],_0x393994);}function consoleLogger(){var _0xaab3=new winston[(_0xa6ea('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa6ea('0x21'))][(_0xa6ea('0x22'))]({'level':'warn','json':![],'formatter':function(_0x33c3cb){return formatter('',_0x33c3cb);}})]});return _0xaab3;}function fileLogger(_0x5f230e,_0x2c0a81){var _0x526167=new winston[(_0xa6ea('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa6ea('0x21'))][(_0xa6ea('0x23'))]({'name':util[_0xa6ea('0x12')]('%s-%s',_0x5f230e,_0xa6ea('0x24')),'filename':getLogFileName(_0x2c0a81,_0x5f230e,'error'),'level':_0xa6ea('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x66b560){return fileFormat(_0x5f230e,_0x66b560);}}),new winston[(_0xa6ea('0x21'))]['File']({'name':util[_0xa6ea('0x12')](_0xa6ea('0x25'),_0x5f230e,debugLevel),'filename':getLogFileName(_0x2c0a81,_0x5f230e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c2a93){return fileFormat(_0x5f230e,_0x5c2a93);}}),new winston[(_0xa6ea('0x21'))][(_0xa6ea('0x22'))]({'level':_0xa6ea('0x26'),'json':![],'formatter':function(_0x50b57f){return fileFormat(_0x5f230e,_0x50b57f);}})]});return _0x526167;}exports[_0xa6ea('0x27')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x711f=['YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','File','%s-%s','error','transports','warn','consoleLogger','fileLogger','path','util','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x193025,_0x21ee8d){var _0x4db355=function(_0x33035a){while(--_0x33035a){_0x193025['push'](_0x193025['shift']());}};_0x4db355(++_0x21ee8d);}(_0x711f,0x67));var _0xf711=function(_0x466f2e,_0x5e2a7f){_0x466f2e=_0x466f2e-0x0;var _0x22dfbb=_0x711f[_0x466f2e];return _0x22dfbb;};'use strict';var path=require(_0xf711('0x0'));var util=require(_0xf711('0x1'));var moment=require('moment');var winston=require(_0xf711('0x2'));var config=require(_0xf711('0x3'));var debugLevel=config[_0xf711('0x4')]?config['debugLevel'][_0xf711('0x5')]():_0xf711('0x6');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':_0xf711('0x7'),'error':_0xf711('0x8'),'warn':_0xf711('0x9'),'info':_0xf711('0xa'),'print':_0xf711('0xb'),'success':_0xf711('0xc'),'http':_0xf711('0xd'),'verbose':_0xf711('0xe'),'debug':_0xf711('0xf'),'silly':_0xf711('0x10')};winston[_0xf711('0x11')](XC_LOG_COLORS);function getLogFileName(_0x3c8139,_0x22c4c6,_0x4e6fb6){var _0x11ca4d=_0x3c8139||_0xf711('0x12');return path[_0xf711('0x13')](_0x11ca4d,util[_0xf711('0x14')](_0xf711('0x15'),_0x22c4c6,_0x4e6fb6));}function formatter(_0x334537,_0x42dbb6){_0x42dbb6[_0xf711('0x16')]=_0x42dbb6[_0xf711('0x16')]['replace'](/@@{/g,_0xf711('0x17'))[_0xf711('0x18')](/}@@/g,'}}}')[_0xf711('0x18')](/@{/g,'{{')[_0xf711('0x18')](/}@/g,'}}');return util['format'](_0xf711('0x19'),moment()[_0xf711('0x14')](_0xf711('0x1a')),_0x42dbb6[_0xf711('0x1b')][_0xf711('0x1c')](),_0x334537,_0x42dbb6[_0xf711('0x16')]);}function fileFormat(_0xaa9ab9,_0x4ae25d){_0x4ae25d['message']=_0x4ae25d[_0xf711('0x16')][_0xf711('0x18')](/@@{/g,_0xf711('0x17'))[_0xf711('0x18')](/}@@/g,_0xf711('0x1d'))['replace'](/@{/g,'{{')[_0xf711('0x18')](/}@/g,'}}');var _0x499d97=_0x4ae25d[_0xf711('0x1e')]&&Object[_0xf711('0x1f')](_0x4ae25d[_0xf711('0x1e')])[_0xf711('0x20')]?'\x0a\x09'+JSON['stringify'](_0x4ae25d[_0xf711('0x1e')]):'';return util['format'](_0xf711('0x21'),moment()[_0xf711('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4ae25d[_0xf711('0x1b')][_0xf711('0x1c')](),_0xaa9ab9,_0x4ae25d['message'],_0x499d97);}function consoleLogger(){var _0x34ff36=new winston[(_0xf711('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xf711('0x23'))]({'level':'warn','json':![],'formatter':function(_0x42f727){return formatter('',_0x42f727);}})]});return _0x34ff36;}function fileLogger(_0x1fa98e,_0xbc0915){var _0x2352de=new winston[(_0xf711('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xf711('0x24'))]({'name':util[_0xf711('0x14')](_0xf711('0x25'),_0x1fa98e,'error'),'filename':getLogFileName(_0xbc0915,_0x1fa98e,_0xf711('0x26')),'level':_0xf711('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x382d35){return fileFormat(_0x1fa98e,_0x382d35);}}),new winston[(_0xf711('0x27'))][(_0xf711('0x24'))]({'name':util['format'](_0xf711('0x25'),_0x1fa98e,debugLevel),'filename':getLogFileName(_0xbc0915,_0x1fa98e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xa759c1){return fileFormat(_0x1fa98e,_0xa759c1);}}),new winston[(_0xf711('0x27'))][(_0xf711('0x23'))]({'level':_0xf711('0x28'),'json':![],'formatter':function(_0xc3b4e9){return fileFormat(_0x1fa98e,_0xc3b4e9);}})]});return _0x2352de;}exports[_0xf711('0x29')]=consoleLogger;exports[_0xf711('0x2a')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index f039309..0418829 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 _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x1967,0x173));var _0x7196=function(_0x566c26,_0x28c5dc){_0x566c26=_0x566c26-0x0;var _0x1dcc50=_0x1967[_0x566c26];return _0x1dcc50;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x0295,0x1f0));var _0x5029=function(_0x24c564,_0x49afff){_0x24c564=_0x24c564-0x0;var _0x3a5538=_0x0295[_0x24c564];return _0x3a5538;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 323e822..6439c42 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 _0x0abf=['safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce','exports'];(function(_0x4cfa8d,_0x42f18f){var _0x37b1d5=function(_0x21230d){while(--_0x21230d){_0x4cfa8d['push'](_0x4cfa8d['shift']());}};_0x37b1d5(++_0x42f18f);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0abf[_0x5ddb1c];return _0x354adc;};var _=require(_0xf0ab('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4d04cc){return _0x4d04cc==='{{'?_0xf0ab('0x1'):_0xf0ab('0x2');}function safeTemplate(_0x528ef7){var _0x598001=_0x528ef7;if(typeof _0x528ef7===_0xf0ab('0x3')){_0x598001=_0x528ef7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf0ab('0x4')](_0x528ef7)){_0x598001=_0x528ef7[_0xf0ab('0x5')](function(_0x2efe43){return safeTemplate(_0x2efe43);});}else if(_[_0xf0ab('0x6')](_0x528ef7)){_0x598001=Object[_0xf0ab('0x7')](_0x528ef7)[_0xf0ab('0x8')](function(_0x233afe,_0x57ff3b){_0x233afe[_0x57ff3b]=safeTemplate(_0x528ef7[_0x57ff3b]);return _0x233afe;},{});}return _0x598001;}module[_0xf0ab('0x9')][_0xf0ab('0xa')]=safeTemplate; \ No newline at end of file +var _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x3b1bcd,_0x53622e){var _0x23ad11=function(_0x49fd2b){while(--_0x49fd2b){_0x3b1bcd['push'](_0x3b1bcd['shift']());}};_0x23ad11(++_0x53622e);}(_0x1a85,0x178));var _0x51a8=function(_0x5aef5a,_0x3ad0db){_0x5aef5a=_0x5aef5a-0x0;var _0xcff0b4=_0x1a85[_0x5aef5a];return _0xcff0b4;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file